Release Healer Man 0.1.22
This commit is contained in:
1 parent
f6f2375145
commit
7f6001723a
144 files changed
+54107
-690
No files matched your search
@@ -1,3 +1,4 @@
|
||||
import { useEffect } from "react";
|
||||
import { useCombatStore } from "../game/combatStore";
|
||||
import { useGameStore } from "../game/store";
|
||||
import { classCanEquipItem, PLAYER_EQUIPMENT_OWNER_ID } from "../game/equipment";
|
||||
@@ -7,6 +8,16 @@ import {
|
||||
} from "../game/heirloomEquipment";
|
||||
import { gearProfileFor } from "../game/specializationCatalog";
|
||||
|
||||
export const BOSS_LOOT_AUTO_DISMISS_MS = 10_000;
|
||||
|
||||
export function scheduleBossLootAutoDismiss(
|
||||
rewardId: number,
|
||||
dismiss: (id: number) => void,
|
||||
): () => void {
|
||||
const timeoutId = setTimeout(() => dismiss(rewardId), BOSS_LOOT_AUTO_DISMISS_MS);
|
||||
return () => clearTimeout(timeoutId);
|
||||
}
|
||||
|
||||
function itemType(inventorySlot: string): string {
|
||||
return inventorySlot
|
||||
.split(/[-_]/)
|
||||
@@ -23,6 +34,16 @@ export function BossLootWindow() {
|
||||
const level = useCombatStore((state) => state.level);
|
||||
const equipment = useCombatStore((state) => state.equipment);
|
||||
const inventory = useCombatStore((state) => state.inventory);
|
||||
const visibleRewardId = reward?.id;
|
||||
|
||||
useEffect(() => {
|
||||
if (visibleRewardId === undefined) return;
|
||||
return scheduleBossLootAutoDismiss(
|
||||
visibleRewardId,
|
||||
(rewardId) => useCombatStore.getState().dismissBossLootReward(rewardId),
|
||||
);
|
||||
}, [visibleRewardId]);
|
||||
|
||||
if (!reward) return null;
|
||||
|
||||
const profile = gearProfileFor(classId, specializationId, role);
|
||||
|
||||
Reference in new issue
Block a user