Fix Bug 8: Replace direct setState calls with proper store actions in debug components
Build and Publish Mana Loop Docker Image / build-and-publish (push) Successful in 2m8s

- SkillDebug.tsx: Use useSkillStore.getState().incrementSkillLevel() and setSkillLevel() instead of direct setState
- ElementDebug.tsx: Use getState() for consistency
- AttunementDebug.tsx: When unlocking Enchanter, also unlock transference element
- GameStateDebug.tsx: Use proper store actions (debugSetFloor, resetFloorHP, debugSetTime) and fix Switch component usage
This commit is contained in:
2026-05-07 13:17:22 +02:00
parent 7851d8c7cb
commit 32a86c3e62
5 changed files with 114 additions and 149 deletions
+4 -5
View File
@@ -8,16 +8,15 @@ import { ELEMENTS } from '@/lib/game/constants';
export function ElementDebug() {
const elements = useManaStore((s) => s.elements);
const unlockElement = useManaStore((s) => s.unlockElement);
const addElementMana = useManaStore((s) => s.addElementMana);
const handleUnlockElement = (element: string) => {
unlockElement(element, 500);
useManaStore.getState().unlockElement(element, 500);
};
const handleAddElementalMana = (element: string, amount: number) => {
if (addElementMana) {
addElementMana(element, amount, 100);
const elem = elements?.[element];
if (elem?.unlocked) {
useManaStore.getState().addElementMana(element, amount, elem.max);
}
};