Simplify custom world result editing controls
This commit is contained in:
@@ -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,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user