Release v0.1.3 2026-07-11
This commit is contained in:
@@ -3,9 +3,11 @@ import type { FrontendSnapshot } from "../frontend/store";
|
||||
import { useFrontendStore } from "../frontend/store";
|
||||
import { emitControllerToken, setExternalControllerMovement, type ControllerMovement, type ControllerTokenEvent } from "../input/controller";
|
||||
import { getGameSnapshot, type GameSnapshot, useGameStore } from "../game/store";
|
||||
import type { AbilityId, BottomTab, MemberId } from "../game/types";
|
||||
import type { AbilityId, BottomTab, MemberId, RunBuffId } from "../game/types";
|
||||
import type { BossId, HealerClassId } from "../game/types";
|
||||
import type { GameModeId, GameSettings, SaveSlotId } from "../frontend/types";
|
||||
import type { GearOwnerId, GearSlotId } from "../game/progression/gear";
|
||||
import type { DifficultySlug } from "../game/progression/loot";
|
||||
|
||||
const CHANNEL_NAME = "i-want-to-heal:thor-dual-screen:v1";
|
||||
|
||||
@@ -18,7 +20,9 @@ export type GameCommand =
|
||||
| { name: "setActiveTab"; tab: BottomTab }
|
||||
| { name: "selectItem"; itemId: string }
|
||||
| { name: "setPaused"; paused: boolean }
|
||||
| { name: "setPauseSelection"; selection: "resume" | "exit" };
|
||||
| { name: "setPauseSelection"; selection: "resume" | "exit" }
|
||||
| { name: "setSelectedRunBuff"; buffId: RunBuffId }
|
||||
| { name: "chooseRunBuff"; buffId: RunBuffId };
|
||||
|
||||
export type FrontendCommand =
|
||||
| { name: "signIn"; username: string; password: string }
|
||||
@@ -35,9 +39,17 @@ export type FrontendCommand =
|
||||
| { name: "downloadSlot"; slotId: SaveSlotId }
|
||||
| { name: "selectMode"; mode: GameModeId }
|
||||
| { name: "selectBoss"; bossId: BossId }
|
||||
| { name: "selectDifficulty"; difficultySlug: DifficultySlug }
|
||||
| { name: "selectGearOwner"; ownerId: GearOwnerId }
|
||||
| { name: "selectGearSlot"; slotId: GearSlotId }
|
||||
| { name: "selectGearWorkshopMode"; mode: "upgrade" | "infusion" }
|
||||
| { name: "selectInfusion"; infusionId: string }
|
||||
| { name: "upgradeSelectedGear" }
|
||||
| { name: "equipSelectedInfusion" }
|
||||
| { name: "equipPassiveInfusion"; passiveId: RunBuffId }
|
||||
| { name: "selectHealerClass"; classId: HealerClassId }
|
||||
| { name: "updateSetting"; key: keyof GameSettings; value: GameSettings[keyof GameSettings] }
|
||||
| { name: "launchGame"; bossIds: readonly BossId[] };
|
||||
| { name: "launchGame"; bossIds: readonly BossId[]; difficultySlug?: DifficultySlug };
|
||||
|
||||
export const DUAL_SCREEN_LAUNCH_EVENT = "iwt:dual-screen-launch-game";
|
||||
|
||||
@@ -68,6 +80,8 @@ export function executeGameCommand(command: GameCommand) {
|
||||
case "selectItem": game.selectItem(command.itemId); break;
|
||||
case "setPaused": game.setPaused(command.paused); break;
|
||||
case "setPauseSelection": game.setPauseSelection(command.selection); break;
|
||||
case "setSelectedRunBuff": game.setSelectedRunBuff(command.buffId); break;
|
||||
case "chooseRunBuff": game.chooseRunBuff(command.buffId); break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,9 +102,17 @@ export function executeFrontendCommand(command: FrontendCommand) {
|
||||
case "downloadSlot": frontend.downloadSlot(command.slotId); break;
|
||||
case "selectMode": frontend.selectMode(command.mode); break;
|
||||
case "selectBoss": frontend.selectBoss(command.bossId); break;
|
||||
case "selectDifficulty": frontend.selectDifficulty(command.difficultySlug); break;
|
||||
case "selectGearOwner": frontend.selectGearOwner(command.ownerId); break;
|
||||
case "selectGearSlot": frontend.selectGearSlot(command.slotId); break;
|
||||
case "selectGearWorkshopMode": frontend.selectGearWorkshopMode(command.mode); break;
|
||||
case "selectInfusion": frontend.selectInfusion(command.infusionId); break;
|
||||
case "upgradeSelectedGear": frontend.upgradeSelectedGear(); break;
|
||||
case "equipSelectedInfusion": frontend.equipSelectedInfusion(); break;
|
||||
case "equipPassiveInfusion": frontend.equipPassiveInfusion(command.passiveId); break;
|
||||
case "selectHealerClass": frontend.selectHealerClass(command.classId); break;
|
||||
case "updateSetting": frontend.updateSetting(command.key, command.value); break;
|
||||
case "launchGame": window.dispatchEvent(new CustomEvent(DUAL_SCREEN_LAUNCH_EVENT, { detail: command.bossIds })); break;
|
||||
case "launchGame": window.dispatchEvent(new CustomEvent(DUAL_SCREEN_LAUNCH_EVENT, { detail: { bossIds: command.bossIds, difficultySlug: command.difficultySlug } })); break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user