Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
crossorigin="anonymous"
/>

<title>REMAPP.ING</title>
<title>REMAPP.ING v1.2</title>
<script>
const storedTheme = localStorage.getItem('theme') ?? 'system';

Expand Down
2 changes: 1 addition & 1 deletion src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ watch(route, onRouteSwitch, { immediate: true });
<h3>GRAMCTRL & AEROKEY LABS</h3>
</div>

<h2 v-else class="text-2xl">Designed by: GRAMCTRL & AEROKEY LABS</h2>
<h2 v-else class="text-2xl">Designed by: GRAMCTRL, AEROKEY LABS & SpooX</h2>
</div>

<RouterView />
Expand Down
3 changes: 2 additions & 1 deletion src/components/ProfileSelect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,10 @@ const modes = computed(() => {

return [...deviceManager.modes.values()].map((x) => {
const modeConfig = deviceManager.config?.gameModes.find((c) => c.id === x.id);
const isDefault = x.id === deviceManager.config?.defaultMode;
return {
id: x.id,
name: gameModeToName(x.id),
name: `${gameModeToName(x.id)}${isDefault ? ' (Default)' : ''}`,
activation: x.activationBinding.map((physical) => {
const remapped = modeConfig?.buttonRemapping.find((r) => r.physical === physical);
if (remapped) {
Expand Down
10 changes: 10 additions & 0 deletions src/lib/haybox/device.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,16 @@ export class SerialDeviceManager extends ConnectionManager {

this.config.gameModeConfigs = config.gameModes.map((mode) => internalToHayboxGameMode(this.config, layout, mode));

// Update the default mode in device config
const defaultModeConfig = this.config.gameModeConfigs.findIndex(gc =>
HAYBOX_TO_MODE[gc.modeId] === config.defaultMode
) + 1; // Convert to 1-based index

// Set default mode for all backends
for (const backendConfig of this.config.communicationBackendConfigs) {
backendConfig.defaultModeConfig = defaultModeConfig;
}

this.config.projectMOptions = internalToHayboxProjectMOptions(config.projectMOptions);
this.config.meleeOptions = internalToHayboxMeleeOptions(config.meleeOptions);

Expand Down
11 changes: 11 additions & 0 deletions src/stores/deviceManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,13 +204,24 @@ export const useDeviceManager = defineStore('device_manager', () => {
async function saveConfig(): Promise<boolean> {
if (manager.value == null || !config.value || !layout.value) return false;

// Set the default mode to the current active profile
const activeProfile = useActiveProfile();
if (activeProfile.value) {
config.value.defaultMode = activeProfile.value;
}

writeRemaps();
writeOptions();

try {
if (await manager.value.setConfig(layout.value, config.value)) {
originalConfig.value = { ...config.value };
notifyConfigSaved();
const { toast } = useToast();
toast({
title: 'Config saved successfully',
description: 'Device configuration has been updated',
});
return true;
}
} catch (e) {
Expand Down