Release Healer Man 0.1.43
This commit is contained in:
1 parent
c7e8163790
commit
ccc01396cd
86 files changed
+2951
-198
No files matched your search
+27
-9
@@ -1,4 +1,7 @@
|
||||
import { useInputBindingLabels } from "../input/useInputBindingLabels";
|
||||
import { HudSurfaceContext } from "./HudSurface";
|
||||
import type { HudElementId, HudElementLayout } from "../game/uiLayout";
|
||||
import { DungeonInteractionPrompt } from "./DungeonInteractionPrompt";
|
||||
import {
|
||||
useCallback,
|
||||
useEffect,
|
||||
@@ -168,7 +171,15 @@ export function DungeonCompletePrompt({
|
||||
);
|
||||
}
|
||||
|
||||
export function Hud() {
|
||||
export function Hud({ surface = "top", onLayoutChange, completion, onFinish, onResurrect, interaction, onInteract }: {
|
||||
surface?: "top" | "bottom";
|
||||
onLayoutChange?: (id: HudElementId, update: Partial<HudElementLayout>) => void;
|
||||
completion?: boolean;
|
||||
onFinish?: () => void;
|
||||
onResurrect?: (checkpointId: string) => void;
|
||||
interaction?: { prompt: string; name: string; label: string } | null;
|
||||
onInteract?: () => void;
|
||||
} = {}) {
|
||||
const bindingLabel = useInputBindingLabels();
|
||||
const ui = useUiLayoutStore();
|
||||
const desktopBars = currentUiDevice() === "pc" && (ui.draft ?? ui.preferences.current.pc).wowBars;
|
||||
@@ -230,7 +241,7 @@ export function Hud() {
|
||||
);
|
||||
const runProgress = useDungeonRunStore((state) => state.progress);
|
||||
const finalBossDefeated = runProgress?.dungeonId === activeDungeonId && runProgress.finishedAt !== null;
|
||||
const dungeonComplete = gameMode === "dungeon" && (finalBossDefeated || activeDungeonRunIsComplete(activeDungeonId));
|
||||
const dungeonComplete = completion ?? (gameMode === "dungeon" && (finalBossDefeated || activeDungeonRunIsComplete(activeDungeonId)));
|
||||
|
||||
useEffect(() => {
|
||||
const timer = window.setInterval(() => setClock(Date.now()), 100);
|
||||
@@ -282,6 +293,10 @@ export function Hud() {
|
||||
disabled: talentLocked || level < ability.unlockLevel || health <= 0 || remaining > 0 || Boolean(activeCast) || cannotPay,
|
||||
lockedUntilLevel: level < ability.unlockLevel ? ability.unlockLevel : undefined,
|
||||
target: ability.target,
|
||||
cooldownSeconds: ability.cooldownMs / 1_000,
|
||||
castSeconds: ability.castTimeMs / 1_000,
|
||||
range: ability.range.max,
|
||||
talentLocked,
|
||||
};
|
||||
return [catalogAbility.id, item];
|
||||
})), [assignedAbilities, activeCast, auras, classColor, classId, clock, cooldowns, globalCooldownEndsAt, health, level, maxHealth, maxResource, maxResourcePools, resource, resourceName, resourcePools, resourceTone, talentModifiers, talentRanks]);
|
||||
@@ -391,12 +406,14 @@ export function Hud() {
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="hud" style={{ "--game-ui-scale": settings.uiScale } as CSSProperties}>
|
||||
<HudSurfaceContext.Provider value={{ surface, onChange: onLayoutChange, onResurrect }}>
|
||||
<div className={`hud hud-surface-${surface}`} style={{ "--game-ui-scale": settings.uiScale } as CSSProperties}>
|
||||
<ShelvedHud />
|
||||
<DpsMeter />
|
||||
<BossLootWindow />
|
||||
{surface === "top" && <BossLootWindow />}
|
||||
<EditableHudElement id="interaction"><DungeonInteractionPrompt interaction={interaction} onInteract={onInteract} /></EditableHudElement>
|
||||
<EditableHudElement id="completion">{dungeonComplete ? (
|
||||
<DungeonCompletePrompt dungeonTitle={dungeon.title} onFinish={finishDungeon}
|
||||
<DungeonCompletePrompt dungeonTitle={dungeon.title} onFinish={onFinish ?? finishDungeon}
|
||||
finalBossOnly={!activeDungeonRunIsComplete(activeDungeonId)} durationMs={runProgress?.timed ? runProgress.durationMs : null}
|
||||
onResults={finalBossDefeated ? () => useGameStore.getState().openOverlay("dungeon-results") : undefined} />
|
||||
) : null}</EditableHudElement>
|
||||
@@ -409,7 +426,7 @@ export function Hud() {
|
||||
<EditableHudElement id="party"><PartyFrames /></EditableHudElement>
|
||||
<EditableHudElement id="summons"><SummonFrames now={clock} /></EditableHudElement>
|
||||
|
||||
{pendingGroundTarget ? (
|
||||
{surface === "top" && pendingGroundTarget ? (
|
||||
<section className="ground-target-reticle" role="status" aria-live="polite">
|
||||
<div aria-hidden="true"><i /><b /></div>
|
||||
<strong>Place ground effect</strong>
|
||||
@@ -507,7 +524,7 @@ export function Hud() {
|
||||
items={actionItems}
|
||||
activeLayer={actionLayer}
|
||||
onActivate={castBinding}
|
||||
inputMode={inputMode}
|
||||
inputMode={surface === "bottom" ? "gamepad" : inputMode}
|
||||
feedback={settings.showFloatingCombatText ? feedback?.message ?? null : null}
|
||||
/></EditableHudElement>}
|
||||
</div>
|
||||
@@ -527,8 +544,8 @@ export function Hud() {
|
||||
].map((asset) => asset.fileName).join(" and ")}.`}</span>
|
||||
</div>
|
||||
)}</EditableHudElement>
|
||||
<LoadingOverlay />
|
||||
{health <= 0 ? (
|
||||
{surface === "top" && <LoadingOverlay />}
|
||||
{surface === "top" && health <= 0 ? (
|
||||
<DefeatedPrompt
|
||||
gameMode={gameMode}
|
||||
resurrectionCharges={resurrectionCharges}
|
||||
@@ -539,5 +556,6 @@ export function Hud() {
|
||||
/>
|
||||
) : null}
|
||||
</div>
|
||||
</HudSurfaceContext.Provider>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user