From a5e37b9b24257d2c7b0596fc8ccd184ca969e2ed Mon Sep 17 00:00:00 2001 From: zhipu Date: Thu, 26 Mar 2026 16:47:50 +0000 Subject: [PATCH] Fix UI issues: Equipment tab, remove manual floor navigation and element conversion - Fix EquipmentTab props interface - Fix ActionButtons to receive correct props - Remove manual ascend/descend floor buttons - floor changes automatically after clearing - Remove Element Conversion section from LabTab - Remove Unlock Elements section from LabTab - Remove Convert action from ActionButtons - Simplify SpireTab to be self-contained with just store prop --- src/app/page.tsx | 30 ++---- src/components/game/ActionButtons.tsx | 5 +- src/components/game/tabs/LabTab.tsx | 113 +++----------------- src/components/game/tabs/SpireTab.tsx | 144 +++++--------------------- 4 files changed, 51 insertions(+), 241 deletions(-) diff --git a/src/app/page.tsx b/src/app/page.tsx index fea13cc..d165635 100755 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -19,7 +19,6 @@ import { AchievementsDisplay } from '@/components/game/AchievementsDisplay'; export default function ManaLoopGame() { const [activeTab, setActiveTab] = useState('spire'); - const [convertTarget, setConvertTarget] = useState('fire'); const [isGathering, setIsGathering] = useState(false); // Game store @@ -188,20 +187,11 @@ export default function ManaLoopGame() { {/* Action Buttons */} {/* Calendar */} @@ -250,15 +240,7 @@ export default function ManaLoopGame() { - + diff --git a/src/components/game/ActionButtons.tsx b/src/components/game/ActionButtons.tsx index d49c5f5..7f305e3 100644 --- a/src/components/game/ActionButtons.tsx +++ b/src/components/game/ActionButtons.tsx @@ -1,7 +1,7 @@ 'use client'; import { Button } from '@/components/ui/button'; -import { Sparkles, Swords, BookOpen, FlaskConical, Target } from 'lucide-react'; +import { Sparkles, Swords, BookOpen, Target, FlaskConical } from 'lucide-react'; import type { GameAction } from '@/lib/game/types'; interface ActionButtonsProps { @@ -23,7 +23,6 @@ export function ActionButtons({ { id: 'meditate', label: 'Meditate', icon: Sparkles }, { id: 'climb', label: 'Climb', icon: Swords }, { id: 'study', label: 'Study', icon: BookOpen }, - { id: 'convert', label: 'Convert', icon: FlaskConical }, ]; const hasDesignProgress = designProgress !== null; @@ -32,7 +31,7 @@ export function ActionButtons({ return (
-
+
{actions.map(({ id, label, icon: Icon }) => ( -
- ); - })} -
- - - ); - }; - // Render composite crafting const renderCompositeCrafting = () => { const compositeElements = Object.entries(ELEMENTS) @@ -134,6 +82,21 @@ export function LabTab({ store }: LabTabProps) { ); }; + // Check if there are any unlocked elements + const hasUnlockedElements = Object.values(store.elements).some(e => e.unlocked); + + if (!hasUnlockedElements) { + return ( + + +
+ No elemental mana available. Elements are unlocked through gameplay. +
+
+
+ ); + } + return (
{/* Elemental Mana Display */} @@ -146,48 +109,6 @@ export function LabTab({ store }: LabTabProps) { - {/* Element Conversion */} - - - Element Conversion - - -

- Convert raw mana to elemental mana (100:1 ratio) -

- -
- - - -
-
-
- - {/* Unlock Elements */} - {renderLockedElements()} - {/* Composite Crafting */} {renderCompositeCrafting()}
diff --git a/src/components/game/tabs/SpireTab.tsx b/src/components/game/tabs/SpireTab.tsx index 9e34fdd..a0a045e 100755 --- a/src/components/game/tabs/SpireTab.tsx +++ b/src/components/game/tabs/SpireTab.tsx @@ -8,13 +8,15 @@ import { ScrollArea } from '@/components/ui/scroll-area'; import { Separator } from '@/components/ui/separator'; import { TooltipProvider } from '@/components/ui/tooltip'; import { Swords, BookOpen, ChevronUp, ChevronDown, RotateCcw, X } from 'lucide-react'; -import type { GameState, GameAction, EquipmentSpellState, StudyTarget } from '@/lib/game/types'; +import type { GameStore } from '@/lib/game/types'; import { ELEMENTS, GUARDIANS, SPELLS_DEF, SKILLS_DEF } from '@/lib/game/constants'; -import { fmt, fmtDec, getFloorElement, calcDamage, canAffordSpellCost } from '@/lib/game/store'; +import { fmt, fmtDec, getFloorElement, canAffordSpellCost } from '@/lib/game/store'; import { formatSpellCost, getSpellCostColor, formatStudyTime } from '@/lib/game/formatting'; import { ComboMeter, CraftingProgress, StudyProgress } from '@/components/game'; import { ENCHANTMENT_EFFECTS } from '@/lib/game/data/enchantment-effects'; import { EQUIPMENT_TYPES } from '@/lib/game/data/equipment'; +import { getUnifiedEffects } from '@/lib/game/effects'; +import { getTotalDPS } from '@/lib/game/store'; // Helper to get active spells from equipped caster weapons function getActiveEquipmentSpells( @@ -49,30 +51,10 @@ function getActiveEquipmentSpells( } interface SpireTabProps { - store: GameState & { - setAction: (action: GameAction) => void; - setSpell: (spellId: string) => void; - cancelStudy: () => void; - cancelParallelStudy: () => void; - setClimbDirection: (direction: 'up' | 'down') => void; - changeFloor: (direction: 'up' | 'down') => void; - cancelDesign?: () => void; - cancelPreparation?: () => void; - pauseApplication?: () => void; - resumeApplication?: () => void; - cancelApplication?: () => void; - }; - totalDPS: number; - studySpeedMult: number; - incursionStrength: number; + store: GameStore; } -export function SpireTab({ - store, - totalDPS, - studySpeedMult, - incursionStrength, -}: SpireTabProps) { +export function SpireTab({ store }: SpireTabProps) { const floorElem = getFloorElement(store.currentFloor); const floorElemDef = ELEMENTS[floorElem]; const isGuardianFloor = !!GUARDIANS[store.currentFloor]; @@ -82,9 +64,14 @@ export function SpireTab({ // Check if current floor is cleared (for respawn indicator) const isFloorCleared = clearedFloors[store.currentFloor]; - + // Get active equipment spells const activeEquipmentSpells = getActiveEquipmentSpells(store.equippedInstances, store.equipmentInstances); + + // Get upgrade effects and DPS + const upgradeEffects = getUnifiedEffects(store); + const totalDPS = getTotalDPS(store, upgradeEffects, floorElem); + const studySpeedMult = 1; // Base study speed const canCastSpell = (spellId: string): boolean => { const spell = SPELLS_DEF[spellId]; @@ -140,59 +127,28 @@ export function SpireTab({ - {/* Floor Navigation Controls */} + {/* Floor Navigation - Direction indicator only */}
- Auto-Direction + Direction
- - +
-
- - -
- {isFloorCleared && (
- Floor will respawn when you leave and return + Floor cleared! Advancing...
)}
@@ -239,7 +195,7 @@ export function SpireTab({
- ⚔️ {fmt(calcDamage(store, spellId, floorElem))} dmg • + ⚔️ {fmt(totalDPS)} DPS • {' '}{formatSpellCost(spellDef.cost)} @@ -273,16 +229,7 @@ export function SpireTab({ })}
) : ( -
No spells on equipped weapons. Enchant a staff with spell effects.
- )} - - {incursionStrength > 0 && ( -
-
LABYRINTH INCURSION
-
- -{Math.round(incursionStrength * 100)}% mana regen -
-
+
No spells on equipped weapons. Enchant a staff with spell effects in the Crafting tab.
)} @@ -316,7 +263,7 @@ export function SpireTab({ variant="ghost" size="sm" className="h-6 w-6 p-0 text-gray-400 hover:text-white" - onClick={() => store.cancelParallelStudy()} + onClick={() => store.cancelParallelStudy?.()} > @@ -352,45 +299,6 @@ export function SpireTab({ )} - {/* Spells Available */} - - - Known Spells - - -
- {Object.entries(store.spells) - .filter(([, state]) => state.learned) - .map(([id, state]) => { - const def = SPELLS_DEF[id]; - if (!def) return null; - const elemDef = def.elem === 'raw' ? null : ELEMENTS[def.elem]; - const isActive = store.activeSpell === id; - const canCast = canCastSpell(id); - - return ( - - ); - })} -
-
-
- {/* Activity Log */}