Simplify custom world result editing controls

This commit is contained in:
2026-04-08 19:07:46 +08:00
parent bd9fdcbe31
commit a02f7b6414
125 changed files with 8804 additions and 1462 deletions

View File

@@ -120,11 +120,11 @@ export function useGameFlow() {
setGameState(createInitialGameState());
};
const handleWorldSelect = (type: WorldType, customWorldProfile: CustomWorldProfile | null = null) => {
const resolvedWorldType = customWorldProfile ? WorldType.CUSTOM : type;
const handleCustomWorldSelect = (customWorldProfile: CustomWorldProfile) => {
const resolvedWorldType = WorldType.CUSTOM;
setRuntimeCustomWorldProfile(customWorldProfile);
setRuntimeCharacterOverrides(
customWorldProfile ? buildCustomWorldRuntimeCharacters(customWorldProfile) : null,
buildCustomWorldRuntimeCharacters(customWorldProfile),
);
const initialScenePreset = getScenePreset(resolvedWorldType, 0) ?? null;
setIsMapOpen(false);
@@ -217,7 +217,10 @@ export function useGameFlow() {
playerSkillCooldowns: createCharacterSkillCooldowns(character),
activeBuildBuffs: [],
activeCombatEffects: [],
playerCurrency: getInitialPlayerCurrency(gameState.worldType),
playerCurrency: getInitialPlayerCurrency(
gameState.worldType,
gameState.customWorldProfile,
),
playerInventory: buildInitialPlayerInventory(character, gameState.worldType),
playerEquipment: createEmptyEquipmentLoadout(),
npcStates: initialEncounter && initialNpcState
@@ -248,7 +251,7 @@ export function useGameFlow() {
isMapOpen,
setIsMapOpen,
resetGame,
handleWorldSelect,
handleCustomWorldSelect,
handleBackToWorldSelect,
handleCharacterSelect,
};