Release Healer Man 0.1.21
This commit is contained in:
1 parent
699fc858c9
commit
f6f2375145
210 files changed
+976039
-6247
No files matched your search
@@ -0,0 +1,38 @@
|
||||
import { useSyncExternalStore } from "react";
|
||||
import {
|
||||
activeDungeonEncounterRevision,
|
||||
subscribeDungeonEncounterSnapshots,
|
||||
} from "../game/dungeonEncounterRuntime";
|
||||
import {
|
||||
activeDungeonInteractionCandidate,
|
||||
interactWithActiveDungeonObject,
|
||||
} from "../game/dungeonWorldInteraction";
|
||||
import { useGameStore } from "../game/store";
|
||||
|
||||
export function DungeonInteractionPrompt() {
|
||||
const playerPosition = useGameStore((state) => state.playerPosition);
|
||||
const inputMode = useGameStore((state) => state.inputMode);
|
||||
const overlay = useGameStore((state) => state.overlay);
|
||||
useSyncExternalStore(
|
||||
subscribeDungeonEncounterSnapshots,
|
||||
activeDungeonEncounterRevision,
|
||||
activeDungeonEncounterRevision,
|
||||
);
|
||||
void playerPosition;
|
||||
const candidate = overlay ? null : activeDungeonInteractionCandidate();
|
||||
if (!candidate) return null;
|
||||
return (
|
||||
<button
|
||||
type="button"
|
||||
className="dungeon-interaction-prompt"
|
||||
onClick={() => interactWithActiveDungeonObject()}
|
||||
aria-label={`${candidate.object.interaction!.prompt}: ${candidate.object.name}`}
|
||||
>
|
||||
<span className="dungeon-interaction-prompt__key">{inputMode === "gamepad" ? "A" : "E"}</span>
|
||||
<span>
|
||||
<strong>{candidate.object.interaction!.prompt}</strong>
|
||||
<small>{candidate.object.name} · {candidate.state.label}</small>
|
||||
</span>
|
||||
</button>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user