new rpg mode

This commit is contained in:
Warren H
2026-07-17 12:47:42 -04:00
parent de7b59ce77
commit 10ff124466
180 changed files with 20863 additions and 1014 deletions
+26 -3
View File
@@ -10,6 +10,7 @@ import type { DifficultySlug } from "../game/progression/loot";
import { useForcedThorDisplays } from "./useThorDualScreen";
import { createRateLimitedPublisher } from "./rateLimitedPublisher";
import { DEFAULT_CONTROLLER_GLYPHS } from "../input/controllerGlyphs";
import type { HockeyPvpMatchConfig } from "../game/hockeyHealingPvp";
const BottomScreen = lazy(() => import("../components/BottomScreen").then((module) => ({ default: module.BottomScreen })));
const CONTROLLER_MOTION_SYNC_INTERVAL_MS = 33;
@@ -21,6 +22,7 @@ function screenTitle(screen: AppScreen) {
case "home": return "Choose expedition";
case "profile": return "Hunter profile";
case "gear": return "Gear upgrade";
case "appearance": return "Appearance Lab";
case "settings": return "Field settings";
case "mode": return "Prepare encounter";
case "game": return "Field console";
@@ -67,8 +69,8 @@ export function BottomDisplayApp() {
channelRef.current?.postMessage({ type: "frontend-command", command } satisfies DualScreenMessage);
}, []);
const launchGame = useCallback((bossIds: readonly BossId[], difficultySlug?: DifficultySlug) => {
postFrontendCommand({ name: "launchGame", bossIds, difficultySlug });
const launchGame = useCallback((bossIds: readonly BossId[], difficultySlug?: DifficultySlug, hockeyPvpMatch?: HockeyPvpMatchConfig) => {
postFrontendCommand({ name: "launchGame", bossIds, difficultySlug, hockeyPvpMatch });
}, [postFrontendCommand]);
useEffect(() => {
@@ -117,7 +119,7 @@ export function BottomDisplayApp() {
copySlot: (sourceId, targetId) => postFrontend({ name: "copySlot", sourceId, targetId }),
uploadSlot: (slotId) => {
postFrontend({ name: "uploadSlot", slotId });
return Promise.resolve();
return Promise.resolve(false);
},
downloadSlot: (slotId) => {
postFrontend({ name: "downloadSlot", slotId });
@@ -132,6 +134,20 @@ export function BottomDisplayApp() {
selectInfusion: (infusionId) => postFrontend({ name: "selectInfusion", infusionId }),
selectPassiveAbility: (abilityId) => postFrontend({ name: "selectPassiveAbility", abilityId }),
selectPassiveInfusion: (passiveId) => postFrontend({ name: "selectPassiveInfusion", passiveId }),
selectProfileCollectionView: (view) => postFrontend({ name: "selectProfileCollectionView", view }),
selectProfileGroup: (groupId) => postFrontend({ name: "selectProfileGroup", groupId }),
selectProfileStat: (statId) => postFrontend({ name: "selectProfileStat", statId }),
openAppearanceLab: () => postFrontend({ name: "openAppearanceLab" }),
selectAppearanceClass: (classId) => postFrontend({ name: "selectAppearanceClass", classId }),
updateAppearanceDraft: (appearance) => postFrontend({ name: "updateAppearanceDraft", appearance }),
resetAppearanceDraft: () => postFrontend({ name: "resetAppearanceDraft" }),
saveAppearanceDraft: () => {
postFrontend({ name: "saveAppearanceDraft" });
return false;
},
closeAppearanceLab: () => postFrontend({ name: "closeAppearanceLab" }),
setAppearancePreviewMode: (mode) => postFrontend({ name: "setAppearancePreviewMode", mode }),
setAppearancePreviewAnimation: (animation) => postFrontend({ name: "setAppearancePreviewAnimation", animation }),
upgradeSelectedGear: () => {
postFrontend({ name: "upgradeSelectedGear" });
return false;
@@ -174,6 +190,13 @@ export function BottomDisplayApp() {
return false;
},
setEndlessChoiceSelection: (selection) => postCommand({ name: "setEndlessChoiceSelection", selection }),
dispatchRpgAction: (action) => {
postCommand({ name: "dispatchRpgAction", action });
return false;
},
setRpgFocusId: (focusId) => postCommand({ name: "setRpgFocusId", focusId }),
cycleRpgFocus: (direction) => postCommand({ name: "cycleRpgFocus", direction }),
moveRpgFocus: (direction) => postCommand({ name: "moveRpgFocus", direction }),
});
channel.onmessage = (event: MessageEvent<DualScreenMessage>) => {
if (event.data.type === "authoritative-ready") {