Fix LeftPanel.tsx to use modular stores instead of legacy useGameStore
Build and Publish Mana Loop Docker Image / build-and-publish (push) Successful in 1m22s
Build and Publish Mana Loop Docker Image / build-and-publish (push) Successful in 1m22s
- Added useCraftingStore import for crafting progress fields - Changed spireMode/enterSpireMode to useCombatStore - Changed currentStudyTarget to useSkillStore - Changed crafting progress fields to useCraftingStore - Added useCraftingStore export to stores/index.ts - Kept useGameStore only for gatherMana, day, hour
This commit is contained in:
@@ -20,6 +20,9 @@ export interface CombatState {
|
||||
currentAction: GameAction;
|
||||
castProgress: number;
|
||||
|
||||
// Spire mode
|
||||
spireMode: boolean;
|
||||
|
||||
// Spells
|
||||
spells: Record<string, SpellState>;
|
||||
|
||||
@@ -37,6 +40,9 @@ export interface CombatState {
|
||||
learnSpell: (spellId: string) => void;
|
||||
setSpellState: (spellId: string, state: Partial<SpellState>) => void;
|
||||
|
||||
// Spire mode
|
||||
enterSpireMode: () => void;
|
||||
|
||||
// Combat tick
|
||||
processCombatTick: (
|
||||
skills: Record<string, number>,
|
||||
@@ -62,6 +68,7 @@ export const useCombatStore = create<CombatState>()(
|
||||
activeSpell: 'manaBolt',
|
||||
currentAction: 'meditate',
|
||||
castProgress: 0,
|
||||
spireMode: false,
|
||||
spells: {
|
||||
manaBolt: { learned: true, level: 1, studyProgress: 0 },
|
||||
},
|
||||
@@ -112,6 +119,10 @@ export const useCombatStore = create<CombatState>()(
|
||||
set({ castProgress: progress });
|
||||
},
|
||||
|
||||
enterSpireMode: () => {
|
||||
set({ spireMode: true });
|
||||
},
|
||||
|
||||
learnSpell: (spellId: string) => {
|
||||
set((state) => ({
|
||||
spells: {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// ─── Store Index ──────────────────────────────────────────────────────────────
|
||||
// ─── Store Index ──────────────────────────────────────────
|
||||
// Exports all stores and re-exports commonly used utilities
|
||||
|
||||
// Stores
|
||||
@@ -17,6 +17,9 @@ export type { SkillState } from './skillStore';
|
||||
export { useCombatStore, makeInitialSpells } from './combatStore';
|
||||
export type { CombatState } from './combatStore';
|
||||
|
||||
export { useCraftingStore } from './craftingStore';
|
||||
export type { CraftingState, CraftingActions } from './craftingStore';
|
||||
|
||||
export { useGameStore } from './gameStore';
|
||||
export { useGameLoop } from './gameHooks';
|
||||
export type { GameCoordinatorState, GameCoordinatorStore } from './gameStore';
|
||||
@@ -31,16 +34,14 @@ export {
|
||||
computeRegen,
|
||||
computeEffectiveRegen,
|
||||
computeClickMana,
|
||||
getElementalBonus,
|
||||
getMeditationBonus,
|
||||
getBoonBonuses,
|
||||
calcDamage,
|
||||
calcInsight,
|
||||
getMeditationBonus,
|
||||
getIncursionStrength,
|
||||
canAffordSpellCost,
|
||||
deductSpellCost,
|
||||
} from '../utils';
|
||||
|
||||
export { computeElementMax } from '../store-modules/computed-stats';
|
||||
|
||||
export { getStudySpeedMultiplier, getStudyCostMultiplier } from '../constants';
|
||||
|
||||
Reference in New Issue
Block a user