'use client'; import { useState } from 'react'; import { Button } from '@/components/ui/button'; import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'; import { Badge } from '@/components/ui/badge'; import { Separator } from '@/components/ui/separator'; import { Switch } from '@/components/ui/switch'; import { Label } from '@/components/ui/label'; import { RotateCcw, Bug, Plus, Minus, Lock, Unlock, Zap, Clock, Star, AlertTriangle, Sparkles, Settings, Eye, BookOpen } from 'lucide-react'; import type { GameStore } from '@/lib/game/types'; import { ATTUNEMENTS_DEF } from '@/lib/game/data/attunements'; import { ELEMENTS } from '@/lib/game/constants'; import { fmt } from '@/lib/game/store'; import { useDebug } from '@/lib/game/debug-context'; interface DebugTabProps { store: GameStore; } export function DebugTab({ store }: DebugTabProps) { const [confirmReset, setConfirmReset] = useState(false); const { showComponentNames, toggleComponentNames } = useDebug(); const handleReset = () => { if (confirmReset) { store.resetGame(); setConfirmReset(false); } else { setConfirmReset(true); setTimeout(() => setConfirmReset(false), 3000); } }; const handleAddMana = (amount: number) => { // Use gatherMana multiple times to add mana for (let i = 0; i < amount; i++) { store.gatherMana(); } }; const handleUnlockAttunement = (id: string) => { // Debug action to unlock attunements if (store.debugUnlockAttunement) { store.debugUnlockAttunement(id); } }; const handleUnlockElement = (element: string) => { store.unlockElement(element); }; const handleAddElementalMana = (element: string, amount: number) => { const elem = store.elements[element]; if (elem?.unlocked) { // Add directly to element pool - need to implement in store if (store.debugAddElementalMana) { store.debugAddElementalMana(element, amount); } } }; const handleSetTime = (day: number, hour: number) => { if (store.debugSetTime) { store.debugSetTime(day, hour); } }; const handleAddAttunementXP = (id: string, amount: number) => { if (store.debugAddAttunementXP) { store.debugAddAttunementXP(id, amount); } }; return (
These tools are for development and testing. Using them may break game balance or save data.
Display component names at the top of each component for debugging
Reset all game progress and start fresh. This cannot be undone.