Move items with Select and browse the party's moves
In the start menu's pack, Select marks an item and asks where it should go; A or Select on another row moves it there, merging stacks of the same item unless either holds 99, and B ends the move. The packs that GIVE and the PC open ignore Select, as in the original. Left and right on the MOVE screen show the previous or next party member's moves, skipping Eggs, unless a move is being moved. Part of #27 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
397dcef44c
commit
e2dc5ba520
9 files changed
+362
-34
No files matched your search
+16
-6
@@ -327,7 +327,11 @@ function showMart(world: GameWorld, mart: MartChoice | undefined) {
|
||||
get("mart-money").hidden = !shop;
|
||||
get("mart-money").textContent = `MONEY ¥${world.liveState.money}`;
|
||||
get("mart-prompt").textContent =
|
||||
mart.kind === "martlist" || mart.kind === "pack" ? "" : mart.prompt;
|
||||
mart.kind === "martlist"
|
||||
? ""
|
||||
: mart.kind === "pack"
|
||||
? (mart.prompt ?? "").replace(/\n/g, " ")
|
||||
: mart.prompt;
|
||||
const key = JSON.stringify(mart);
|
||||
if (key === martMenuKey) return;
|
||||
martMenuKey = key;
|
||||
@@ -368,6 +372,9 @@ function showMart(world: GameWorld, mart: MartChoice | undefined) {
|
||||
}
|
||||
if (mart.kind === "pack") {
|
||||
// Pocket tabs (left and right on the keyboard), then the pocket's items.
|
||||
// While an item moves with Select, the pocket stays and the moving
|
||||
// entry is marked; choosing another entry places it there.
|
||||
const switching = mart.switching;
|
||||
const pocketTabs = mart.pockets.map((pocket, index) => {
|
||||
const tab = button(pocket.name, () => {
|
||||
const world = runtime.world;
|
||||
@@ -378,19 +385,22 @@ function showMart(world: GameWorld, mart: MartChoice | undefined) {
|
||||
showWorld(world);
|
||||
});
|
||||
tab.setAttribute("aria-pressed", String(mart.pocket === index));
|
||||
tab.disabled = switching !== undefined && mart.pocket !== index;
|
||||
return tab;
|
||||
});
|
||||
const entries = mart.pockets[mart.pocket].entries;
|
||||
const buttons = entries.map((entry, index) =>
|
||||
button(
|
||||
entry.name,
|
||||
const buttons = entries.map((entry, index) => {
|
||||
const entryButton = button(
|
||||
switching === index ? `▷${entry.name}` : entry.name,
|
||||
() => runtime.choosePackEntry(mart.pocket, index),
|
||||
{
|
||||
detail: entry.owned === undefined ? undefined : `×${entry.owned}`,
|
||||
selected: mart.selected === index,
|
||||
},
|
||||
),
|
||||
);
|
||||
);
|
||||
if (switching === index) entryButton.setAttribute("aria-current", "true");
|
||||
return entryButton;
|
||||
});
|
||||
if (!entries.length) {
|
||||
const empty = button("Empty", () => {}, { wide: true });
|
||||
empty.disabled = true;
|
||||
|
||||
Reference in new issue
Block a user