The step light is for a first game's first turn, then by choice
It lit every turn of the first game. Now a browser's first game lights its first turn on its own, and the preference is an explicit switch that keeps it on every turn for anyone who wants it. The old preference key retires with it, so nobody is left lit by accident. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Jm2auWk6RP71CjaAb4FMoG
This commit is contained in:
co-authored by
Claude Fable 5.1
parent
53b6b01582
commit
65e88df523
@@ -31,10 +31,10 @@ export interface Prefs {
|
||||
tierChosen: boolean;
|
||||
/** Games this browser has seen through to a winner. */
|
||||
finishedGames: number;
|
||||
/** The step light: on your turn, the squares a stride can reach glow
|
||||
* and the rest of the maze falls into shadow. On for a browser's first
|
||||
* game, off once that game is won, and yours to switch on again. */
|
||||
stepLight: boolean;
|
||||
/** Keep the step light on every turn: your square and the squares a
|
||||
* stride reaches glow, the rest of the maze in shadow. A browser's
|
||||
* first game lights its first turn on its own. */
|
||||
stepLightAlways: boolean;
|
||||
}
|
||||
|
||||
const KEY = "wizwar-prefs";
|
||||
@@ -43,7 +43,7 @@ function load(): Prefs {
|
||||
const fallback: Prefs = {
|
||||
art: "photo", autoGrab: false, flourishes: true, wizardName: "", color: null,
|
||||
cautions: true, botTier: "apprentice", instantReplay: true, liveFp: false, handLeft: false,
|
||||
coached: false, tierChosen: false, finishedGames: 0, stepLight: true,
|
||||
coached: false, tierChosen: false, finishedGames: 0, stepLightAlways: false,
|
||||
};
|
||||
try {
|
||||
const raw = localStorage.getItem(KEY);
|
||||
@@ -65,9 +65,7 @@ function load(): Prefs {
|
||||
coached: p.coached === true,
|
||||
tierChosen: p.tierChosen === true,
|
||||
finishedGames: typeof p.finishedGames === "number" ? p.finishedGames : 0,
|
||||
// A browser that has already won a game meets the step light switched
|
||||
// off; a fresh one has it on for its first.
|
||||
stepLight: typeof p.stepLight === "boolean" ? p.stepLight : !(typeof p.finishedGames === "number" && p.finishedGames > 0),
|
||||
stepLightAlways: p.stepLightAlways === true,
|
||||
};
|
||||
} catch {
|
||||
return fallback;
|
||||
|
||||
Reference in New Issue
Block a user