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
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:
@@ -5,6 +5,7 @@ import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';
|
||||
import { Sparkles, Unlock } from 'lucide-react';
|
||||
import { ATTUNEMENTS_DEF } from '@/lib/game/data/attunements';
|
||||
import { useAttunementStore } from '@/lib/game/stores';
|
||||
import { useManaStore } from '@/lib/game/stores';
|
||||
|
||||
export function AttunementDebug() {
|
||||
const attunements = useAttunementStore((s) => s.attunements);
|
||||
@@ -14,6 +15,10 @@ export function AttunementDebug() {
|
||||
const handleUnlockAttunement = (id: string) => {
|
||||
if (debugUnlockAttunement) {
|
||||
debugUnlockAttunement(id);
|
||||
// When unlocking Enchanter, also unlock the transference element
|
||||
if (id === 'enchanter') {
|
||||
useManaStore.getState().unlockElement('transference', 500);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user