Skip to content
Merged
22 changes: 20 additions & 2 deletions frontend/src/ts/controllers/challenge-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -368,16 +368,33 @@ export async function setup(challengeName: string): Promise<boolean> {
setConfig("keymapMode", "static", {
nosave: true,
});
} else if (challenge.name === "wingdings") {
// Ten Words of Pain: 10-word Master mode test using the Wingdings custom font, no keymap
setConfig("mode", "words", {
nosave: true,
});
setConfig("words", 10, {
nosave: true,
});
setConfig("difficulty", "master", {
nosave: true,
});
setConfig("fontFamily", "Wingdings", {
nosave: true,
});
setConfig("keymapMode", "off", {
nosave: true,
});
}
}
notitext = challenge.message;
qs("header .config")?.show();
qs(".page.pageTest")?.show();

if (notitext === undefined) {
showNoticeNotification(`Challenge '${challenge.display}' loaded.`);
showSuccessNotification(`Challenge '${challenge.display}' loaded.`);
} else {
showNoticeNotification("Challenge loaded. " + notitext);
showSuccessNotification("Challenge loaded. " + notitext);
}
setLoadedChallenge(challenge);
challengeLoading = false;
Expand Down Expand Up @@ -405,6 +422,7 @@ configEvent.subscribe(({ key }) => {
"keymapMode",
"keymapLayout",
"layout",
"fontFamily",
].includes(key)
) {
clearActive();
Expand Down
2 changes: 0 additions & 2 deletions frontend/src/ts/controllers/url-handler.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -315,11 +315,9 @@ export function loadChallengeFromUrl(getOverride?: string): void {
).toLowerCase();
if (getValue === "") return;

showNoticeNotification("Loading challenge");
ChallengeController.setup(getValue)
.then((result) => {
if (result) {
showSuccessNotification("Challenge loaded");
restartTest({
nosave: true,
});
Expand Down
12 changes: 12 additions & 0 deletions frontend/static/challenges/_list.json
Original file line number Diff line number Diff line change
Expand Up @@ -722,5 +722,17 @@
"display": "Feet warrior",
"type": "customTime",
"parameters": [3600]
},
{
"name": "wingdings",
"display": "Ten Words of Pain",
"type": "special",
"parameters": [],
"message": "Complete a 10-word Master mode test using the Wingdings custom font. No keymap allowed.",
"requirements": {
"wpm": {
Comment thread
albindavidc marked this conversation as resolved.
"min": 1
}
}
}
]
1 change: 1 addition & 0 deletions packages/schemas/src/challenges.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export const ChallengeSchema = z
"script",
"accuracy",
"funbox",
"special",
Comment thread
albindavidc marked this conversation as resolved.
Outdated
]),
message: z.string().optional(),
parameters: z.array(
Expand Down
Loading