Release Healer Man 0.1.4
This commit is contained in:
1 parent
5bb170039a
commit
f4c9cf356c
63 files changed
+2694
-81
No files matched your search
+40
-2
@@ -5,6 +5,7 @@ import {
|
||||
createCharacter as persistCharacter,
|
||||
deleteCharacter as removeCharacter,
|
||||
listCharacters,
|
||||
loadCombatPresentationSettings,
|
||||
restoreSession as restoreStoredSession,
|
||||
saveSession,
|
||||
updateCharacterActionBindings,
|
||||
@@ -13,6 +14,7 @@ import {
|
||||
updateCharacterManastormProgress,
|
||||
updateCharacterProgression,
|
||||
updateCharacterSettings,
|
||||
updateCombatPresentationSettings as persistCombatPresentationSettings,
|
||||
swapRomClasses,
|
||||
} from "./accountRepository";
|
||||
import {
|
||||
@@ -36,6 +38,11 @@ import { DEFAULT_DUNGEON_ID } from "../game/dungeonDefaults";
|
||||
import type { InventoryItem } from "../game/lootTypes";
|
||||
import type { EquipmentAssignments } from "../game/equipment";
|
||||
import type { GameplaySettings } from "../game/combatStore";
|
||||
import {
|
||||
DEFAULT_COMBAT_PRESENTATION_SETTINGS,
|
||||
normalizeCombatPresentationSettings,
|
||||
type CombatPresentationSettings,
|
||||
} from "../game/combatPresentation";
|
||||
import type { PartyRole } from "../game/partyRoles";
|
||||
import type { ManastormPartySize, ManastormProgress } from "../game/manastormProgress";
|
||||
import { dungeonShellRuntime } from "./dungeonShellRuntimeBridge";
|
||||
@@ -56,6 +63,7 @@ export interface ShellState {
|
||||
notice: string;
|
||||
activeDungeonId: DungeonId;
|
||||
activeDungeonRole: PartyRole;
|
||||
combatPresentationSettings: CombatPresentationSettings;
|
||||
beginSession: (session: PlayerSession) => void;
|
||||
signOut: () => void;
|
||||
selectCharacter: (characterId: string) => void;
|
||||
@@ -89,6 +97,8 @@ export interface ShellState {
|
||||
saveActiveInventory: (inventory: readonly InventoryItem[]) => void;
|
||||
saveActiveEquipment: (equipment: EquipmentAssignments) => void;
|
||||
saveActiveSettings: (settings: GameplaySettings) => void;
|
||||
updateCombatPresentationSettings: (patch: Partial<CombatPresentationSettings>) => void;
|
||||
resetCombatPresentationSettings: () => void;
|
||||
saveActiveManastormProgress: (progress: ManastormProgress) => void;
|
||||
saveSelectedManastormLoadout: (loadout: readonly string[]) => boolean;
|
||||
setNotice: (notice: string) => void;
|
||||
@@ -108,15 +118,22 @@ function defaultDraft(categoryId: ContentCategoryId = "wow"): CharacterDraft {
|
||||
};
|
||||
}
|
||||
|
||||
function restoredState(): Pick<ShellState, "phase" | "session" | "characters" | "selectedCharacterId"> {
|
||||
function restoredState(): Pick<ShellState, "phase" | "session" | "characters" | "selectedCharacterId" | "combatPresentationSettings"> {
|
||||
const session = restoreStoredSession();
|
||||
if (!session) return { phase: "login", session: null, characters: [], selectedCharacterId: null };
|
||||
if (!session) return {
|
||||
phase: "login",
|
||||
session: null,
|
||||
characters: [],
|
||||
selectedCharacterId: null,
|
||||
combatPresentationSettings: DEFAULT_COMBAT_PRESENTATION_SETTINGS,
|
||||
};
|
||||
const characters = listCharacters(session.ownerId);
|
||||
return {
|
||||
phase: "characters",
|
||||
session,
|
||||
characters,
|
||||
selectedCharacterId: characters[0]?.id ?? null,
|
||||
combatPresentationSettings: loadCombatPresentationSettings(session.ownerId),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -139,6 +156,7 @@ export const useShellStore = create<ShellState>((set, get) => ({
|
||||
characters,
|
||||
selectedCharacterId: characters[0]?.id ?? null,
|
||||
activeCharacter: null,
|
||||
combatPresentationSettings: loadCombatPresentationSettings(session.ownerId),
|
||||
notice: session.kind === "offline" ? "Offline roster loaded." : `Welcome, ${session.displayName}.`,
|
||||
});
|
||||
},
|
||||
@@ -154,6 +172,7 @@ export const useShellStore = create<ShellState>((set, get) => ({
|
||||
activeCharacter: null,
|
||||
draft: defaultDraft(),
|
||||
notice: "Signed out.",
|
||||
combatPresentationSettings: DEFAULT_COMBAT_PRESENTATION_SETTINGS,
|
||||
});
|
||||
},
|
||||
selectCharacter: (selectedCharacterId) => set({ selectedCharacterId, notice: "" }),
|
||||
@@ -361,6 +380,7 @@ export const useShellStore = create<ShellState>((set, get) => ({
|
||||
: characters[0]?.id ?? null,
|
||||
activeCharacter: null,
|
||||
notice: "",
|
||||
combatPresentationSettings: loadCombatPresentationSettings(session.ownerId),
|
||||
});
|
||||
},
|
||||
saveActiveProgression: (level, experience, talentRanks) => {
|
||||
@@ -433,6 +453,24 @@ export const useShellStore = create<ShellState>((set, get) => ({
|
||||
characters: state.characters.map((character) => character.id === updated.id ? updated : character),
|
||||
}));
|
||||
},
|
||||
updateCombatPresentationSettings: (patch) => {
|
||||
const { session, combatPresentationSettings } = get();
|
||||
const next = normalizeCombatPresentationSettings({
|
||||
...combatPresentationSettings,
|
||||
...patch,
|
||||
}, combatPresentationSettings);
|
||||
const persisted = session
|
||||
? persistCombatPresentationSettings(session.ownerId, next)
|
||||
: next;
|
||||
set({ combatPresentationSettings: persisted });
|
||||
},
|
||||
resetCombatPresentationSettings: () => {
|
||||
const { session } = get();
|
||||
const settings = session
|
||||
? persistCombatPresentationSettings(session.ownerId, DEFAULT_COMBAT_PRESENTATION_SETTINGS)
|
||||
: DEFAULT_COMBAT_PRESENTATION_SETTINGS;
|
||||
set({ combatPresentationSettings: settings });
|
||||
},
|
||||
saveActiveManastormProgress: (progress) => {
|
||||
const { session, activeCharacter } = get();
|
||||
if (!session || !activeCharacter) return;
|
||||
|
||||
Reference in new issue
Block a user