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
@@ -10,7 +10,10 @@ import {
|
||||
import { useGameStore } from "../game/store";
|
||||
import { useInputBindingLabels } from "../input/useInputBindingLabels";
|
||||
|
||||
export function DungeonInteractionPrompt() {
|
||||
export function DungeonInteractionPrompt({ interaction, onInteract }: {
|
||||
interaction?: { prompt: string; name: string; label: string } | null;
|
||||
onInteract?: () => void;
|
||||
} = {}) {
|
||||
const label = useInputBindingLabels();
|
||||
const playerPosition = useGameStore((state) => state.playerPosition);
|
||||
const inputMode = useGameStore((state) => state.inputMode);
|
||||
@@ -21,19 +24,20 @@ export function DungeonInteractionPrompt() {
|
||||
activeDungeonEncounterRevision,
|
||||
);
|
||||
void playerPosition;
|
||||
const candidate = overlay ? null : activeDungeonInteractionCandidate();
|
||||
const local = interaction === undefined && !overlay ? activeDungeonInteractionCandidate() : null;
|
||||
const candidate = interaction ?? (local ? { prompt: local.object.interaction!.prompt, name: local.object.name, label: local.state.label } : null);
|
||||
if (!candidate) return null;
|
||||
return (
|
||||
<button
|
||||
type="button"
|
||||
className="dungeon-interaction-prompt"
|
||||
onClick={() => interactWithActiveDungeonObject()}
|
||||
aria-label={`${candidate.object.interaction!.prompt}: ${candidate.object.name}`}
|
||||
onClick={onInteract ?? (() => interactWithActiveDungeonObject())}
|
||||
aria-label={`${candidate.prompt}: ${candidate.name}`}
|
||||
>
|
||||
<span className="dungeon-interaction-prompt__key">{label(inputMode === "gamepad" ? "controller" : "pc", "loot")}</span>
|
||||
<span>
|
||||
<strong>{candidate.object.interaction!.prompt}</strong>
|
||||
<small>{candidate.object.name} · {candidate.state.label}</small>
|
||||
<strong>{candidate.prompt}</strong>
|
||||
<small>{candidate.name} · {candidate.label}</small>
|
||||
</span>
|
||||
</button>
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user