Skip to content

Commit bffe0ea

Browse files
committed
build error
1 parent 37954cb commit bffe0ea

File tree

5 files changed

+12
-17
lines changed

5 files changed

+12
-17
lines changed

src/components/Profile/EquipmentPanel.tsx

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { useProfile } from '../../context/ProfileContext';
22
import { useComparison } from '../../context/ComparisonContext';
33
import { Card } from '../UI/Card';
44
import { Button } from '../UI/Button';
5-
import { X, Bookmark, GitCompare, Shield, Zap } from 'lucide-react';
5+
import { X, Bookmark, GitCompare } from 'lucide-react';
66
import { ItemSlot, MountSlot, UserProfile } from '../../types/Profile';
77
import { useState, useMemo } from 'react';
88
import { ItemSelectorModal } from './ItemSelectorModal';
@@ -13,7 +13,6 @@ import { getItemImage } from '../../utils/itemAssets';
1313
import { useGameData } from '../../hooks/useGameData';
1414
import { AGES } from '../../utils/constants';
1515
import { useTreeModifiers } from '../../hooks/useCalculatedStats';
16-
import { useSetBonuses } from '../../hooks/useSetBonuses';
1716
import { formatSecondaryStat } from '../../utils/statNames';
1817
import { SpriteSheetIcon } from '../UI/SpriteSheetIcon';
1918

@@ -85,11 +84,7 @@ const SLOT_TYPE_ID_MAP: Record<string, number> = {
8584
};
8685

8786
// Map Set IDs to Icon filenames (same as Skins.tsx)
88-
const SET_ICONS: Record<string, string> = {
89-
'SantaSet': 'SteppingStoneCharIcon0.png',
90-
'SnowmanSet': 'SteppingStoneCharIcon1.png',
91-
'SkiSet': 'SteppingStoneCharIcon2.png'
92-
};
87+
9388

9489
interface EquipmentPanelProps {
9590
variant?: 'default' | 'original' | 'test';
@@ -208,13 +203,13 @@ export function EquipmentPanel({ variant = 'default', title, showCompareButton =
208203
// Calculate item stats with tech tree bonus
209204
// For weapons: includes melee base multiplier (1.6x) to match in-game display
210205
const getItemStats = (item: ItemSlot | null, slotKey: string) => {
211-
if (!item || !itemBalancingLibrary) return { damage: 0, health: 0, bonus: 0, isMelee: true };
206+
if (!item || !itemBalancingLibrary) return { damage: 0, health: 0, bonus: 0, skinBonuses: { damage: 0, health: 0 }, isMelee: true };
212207

213208
const jsonType = SLOT_TO_JSON_TYPE[slotKey] || slotKey;
214209
const key = `{'Age': ${item.age}, 'Type': '${jsonType}', 'Idx': ${item.idx}}`;
215210
const itemData = itemBalancingLibrary[key];
216211

217-
if (!itemData?.EquipmentStats) return { damage: 0, health: 0, bonus: 0, isMelee: true };
212+
if (!itemData?.EquipmentStats) return { damage: 0, health: 0, bonus: 0, skinBonuses: { damage: 0, health: 0 }, isMelee: true };
218213

219214
// Check if weapon is melee (for applying melee base multiplier)
220215
// Melee = AttackRange < 1, Ranged = AttackRange >= 1
@@ -442,7 +437,7 @@ export function EquipmentPanel({ variant = 'default', title, showCompareButton =
442437
{(() => {
443438
// Calculate sprite position for skin icon
444439
// This logic mimics ItemSelectorModal and Skins.tsx
445-
const skinId = equipped.skin.idx;
440+
446441
// We need a helper or context to get global sorted index for precise sprite pos,
447442
// but for now, let's try to map it if possible or just use the generic icon.
448443
// Actually, without the full sorted list context, accurate sprite mapping is hard locally.
@@ -536,7 +531,7 @@ export function EquipmentPanel({ variant = 'default', title, showCompareButton =
536531
<span>⚔️{Math.round(stats.damage).toLocaleString()}</span>
537532
<div className="flex gap-1 flex-wrap justify-center font-bold">
538533
{stats.bonus > 0 && <span className="text-green-400 text-[10px]">(+{Math.round(stats.bonus * 100)}%)</span>}
539-
{stats.skinBonuses?.damage > 0 && <span className="text-accent-primary text-[10px]">(+{Math.round(stats.skinBonuses.damage * 100)}% S)</span>}
534+
{stats.skinBonuses?.damage > 0 && <span className="text-accent-primary text-[10px]">(+{Math.round((stats.skinBonuses?.damage || 0) * 100)}% S)</span>}
540535
</div>
541536
</div>
542537
)}
@@ -545,7 +540,7 @@ export function EquipmentPanel({ variant = 'default', title, showCompareButton =
545540
<span>{Math.round(stats.health).toLocaleString()}</span>
546541
<div className="flex gap-1 flex-wrap justify-center font-bold">
547542
{stats.bonus > 0 && <span className="text-green-400 text-[10px]">(+{Math.round(stats.bonus * 100)}%)</span>}
548-
{stats.skinBonuses?.health > 0 && <span className="text-accent-primary text-[10px]">(+{Math.round(stats.skinBonuses.health * 100)}% S)</span>}
543+
{stats.skinBonuses?.health > 0 && <span className="text-accent-primary text-[10px]">(+{Math.round((stats.skinBonuses?.health || 0) * 100)}% S)</span>}
549544
</div>
550545
</div>
551546
)}

src/components/Profile/ItemSelectorModal.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,7 @@ export function ItemSelectorModal({ isOpen, onClose, onSelect, slot, current, is
539539
{skinIdx !== null && (
540540
<div className="space-y-2 bg-bg-input/30 p-2 rounded">
541541
{(() => {
542-
const selectedSkin = availableSkins.find((s: any) => s.SkinId.Idx === skinIdx);
542+
const selectedSkin = availableSkins.find((s: any) => s.SkinId.Idx === skinIdx) as any;
543543
const possibleStats = selectedSkin?.PossibleStats || [];
544544
const maxStats = selectedSkin?.MaxStatCount || 0;
545545

@@ -579,7 +579,7 @@ export function ItemSelectorModal({ isOpen, onClose, onSelect, slot, current, is
579579
</option>
580580
))}
581581
</select>
582-
<Button variant="ghost" size="icon" onClick={() => removeSkinStat(i)} className="h-6 w-6 text-text-muted hover:text-red-400">
582+
<Button variant="ghost" size="sm" onClick={() => removeSkinStat(i)} className="h-6 w-6 text-text-muted hover:text-red-400 p-0">
583583
<X className="w-3 h-3" />
584584
</Button>
585585
</div>

src/hooks/useSetBonuses.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { useMemo } from 'react';
22
import { useGameData } from './useGameData';
3-
import { ItemSlot, UserProfile } from '../types/Profile';
3+
import { UserProfile } from '../types/Profile';
44

55
interface SkinEntry {
66
SkinId: {

src/pages/Skins.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { useMemo } from 'react';
22
import { useGameData } from '../hooks/useGameData';
33
import { Card } from '../components/UI/Card';
44
import { GameIcon } from '../components/UI/GameIcon';
5-
import { cn } from '../lib/utils';
5+
66
import { Shield, Sword, Heart, Zap } from 'lucide-react';
77

88
interface SkinStat {

tsconfig.tsbuildinfo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"root":["./src/app.tsx","./src/main.tsx","./src/vite-env.d.ts","./src/components/battle/battlevisualizermodal.tsx","./src/components/layout/appshell.tsx","./src/components/layout/header.tsx","./src/components/layout/sidebar.tsx","./src/components/profile/equipmentpanel.tsx","./src/components/profile/itemselectormodal.tsx","./src/components/profile/miscpanel.tsx","./src/components/profile/mountpanel.tsx","./src/components/profile/mountselectormodal.tsx","./src/components/profile/petpanel.tsx","./src/components/profile/petselectormodal.tsx","./src/components/profile/profileheaderpanel.tsx","./src/components/profile/skillpanel.tsx","./src/components/profile/skillselectormodal.tsx","./src/components/profile/skillspassivespanel.tsx","./src/components/profile/statssummarypanel.tsx","./src/components/profile/techtreepanel.tsx","./src/components/pvp/enemybuilder.tsx","./src/components/pvp/pvpbattlevisualizer.tsx","./src/components/ui/animatedclock.tsx","./src/components/ui/button.tsx","./src/components/ui/card.tsx","./src/components/ui/confirmmodal.tsx","./src/components/ui/gameicon.tsx","./src/components/ui/input.tsx","./src/components/ui/inputmodal.tsx","./src/components/ui/secondarystatinput.tsx","./src/components/ui/select.tsx","./src/components/ui/spriteicon.tsx","./src/components/ui/spritesheeticon.tsx","./src/constants/eggdata.ts","./src/constants/forgedata.ts","./src/constants/mountdata.ts","./src/constants/skilldata.ts","./src/context/gamedatacontext.tsx","./src/context/profilecontext.tsx","./src/context/treemodecontext.tsx","./src/hooks/usebattlesimulation.ts","./src/hooks/usecalculatedstats.ts","./src/hooks/useeggscalculator.ts","./src/hooks/useforgecalculator.ts","./src/hooks/usegamedata.ts","./src/hooks/useglobalstats.ts","./src/hooks/usemountscalculator.ts","./src/hooks/useprofilestats.ts","./src/hooks/useskillscalculator.ts","./src/hooks/usetreeoptimizer.ts","./src/lib/utils.ts","./src/pages/arena.tsx","./src/pages/colors.tsx","./src/pages/configs.tsx","./src/pages/dungeons.tsx","./src/pages/eggs.tsx","./src/pages/faq.tsx","./src/pages/forgewiki.tsx","./src/pages/guildwar.tsx","./src/pages/home.tsx","./src/pages/items.tsx","./src/pages/mounts.tsx","./src/pages/offline.tsx","./src/pages/pets.tsx","./src/pages/profile.tsx","./src/pages/progressprediction.tsx","./src/pages/pvparena.tsx","./src/pages/skills.tsx","./src/pages/techtree.tsx","./src/pages/unlocks.tsx","./src/pages/verify.tsx","./src/pages/calculators/forgecalculator.tsx","./src/pages/calculators/mountcalculator.tsx","./src/pages/calculators/skillcalculator.tsx","./src/pages/calculators/treecalculator.tsx","./src/types/profile.ts","./src/utils/battleengine.ts","./src/utils/battlehelper.ts","./src/utils/battlesimulator.ts","./src/utils/pvpbattleengine.ts","./src/utils/constants.ts","./src/utils/format.ts","./src/utils/itemassets.ts","./src/utils/statengine.ts","./src/utils/statnames.ts","./src/utils/statscalculator.ts","./src/utils/techutils.ts","./src/utils/temp_tree_helper.ts"],"version":"5.9.3"}
1+
{"root":["./src/app.tsx","./src/main.tsx","./src/vite-env.d.ts","./src/components/battle/battlevisualizermodal.tsx","./src/components/layout/appshell.tsx","./src/components/layout/header.tsx","./src/components/layout/sidebar.tsx","./src/components/profile/equipmentpanel.tsx","./src/components/profile/itemselectormodal.tsx","./src/components/profile/miscpanel.tsx","./src/components/profile/mountpanel.tsx","./src/components/profile/mountselectormodal.tsx","./src/components/profile/petpanel.tsx","./src/components/profile/petselectormodal.tsx","./src/components/profile/profileheaderpanel.tsx","./src/components/profile/skillpanel.tsx","./src/components/profile/skillselectormodal.tsx","./src/components/profile/skillspassivespanel.tsx","./src/components/profile/statssummarypanel.tsx","./src/components/profile/techtreepanel.tsx","./src/components/pvp/enemybuilder.tsx","./src/components/pvp/pvpbattlevisualizer.tsx","./src/components/ui/animatedclock.tsx","./src/components/ui/button.tsx","./src/components/ui/card.tsx","./src/components/ui/confirmmodal.tsx","./src/components/ui/gameicon.tsx","./src/components/ui/input.tsx","./src/components/ui/inputmodal.tsx","./src/components/ui/secondarystatinput.tsx","./src/components/ui/select.tsx","./src/components/ui/spriteicon.tsx","./src/components/ui/spritesheeticon.tsx","./src/constants/eggdata.ts","./src/constants/forgedata.ts","./src/constants/mountdata.ts","./src/constants/skilldata.ts","./src/context/comparisoncontext.tsx","./src/context/gamedatacontext.tsx","./src/context/profilecontext.tsx","./src/context/treemodecontext.tsx","./src/hooks/usebattlesimulation.ts","./src/hooks/usecalculatedstats.ts","./src/hooks/useeggscalculator.ts","./src/hooks/useforgecalculator.ts","./src/hooks/usegamedata.ts","./src/hooks/useglobalstats.ts","./src/hooks/usemountscalculator.ts","./src/hooks/useprofilestats.ts","./src/hooks/usesetbonuses.ts","./src/hooks/useskillscalculator.ts","./src/hooks/usetreeoptimizer.ts","./src/lib/utils.ts","./src/pages/arena.tsx","./src/pages/colors.tsx","./src/pages/configs.tsx","./src/pages/dungeons.tsx","./src/pages/eggs.tsx","./src/pages/emblems.tsx","./src/pages/faq.tsx","./src/pages/forgewiki.tsx","./src/pages/guildwar.tsx","./src/pages/home.tsx","./src/pages/items.tsx","./src/pages/mounts.tsx","./src/pages/offline.tsx","./src/pages/pets.tsx","./src/pages/profile.tsx","./src/pages/progressprediction.tsx","./src/pages/pvparena.tsx","./src/pages/skills.tsx","./src/pages/skins.tsx","./src/pages/techtree.tsx","./src/pages/unlocks.tsx","./src/pages/verify.tsx","./src/pages/calculators/forgecalculator.tsx","./src/pages/calculators/mountcalculator.tsx","./src/pages/calculators/skillcalculator.tsx","./src/pages/calculators/treecalculator.tsx","./src/types/profile.ts","./src/utils/battleengine.ts","./src/utils/battlehelper.ts","./src/utils/battlesimulator.ts","./src/utils/pvpbattleengine.ts","./src/utils/constants.ts","./src/utils/format.ts","./src/utils/itemassets.ts","./src/utils/statengine.ts","./src/utils/statnames.ts","./src/utils/statscalculator.ts","./src/utils/techutils.ts","./src/utils/temp_tree_helper.ts"],"version":"5.9.3"}

0 commit comments

Comments
 (0)