mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-12-29 03:20:46 +08:00
fixed funbox not working in tribe
This commit is contained in:
parent
603b2ac672
commit
c30511e144
3 changed files with 13 additions and 9 deletions
|
|
@ -91,10 +91,7 @@ export function toggleScript(...params) {
|
|||
}
|
||||
}
|
||||
|
||||
export async function activate(funbox, mode, mp = false) {
|
||||
if (!Tribe.checkIfCanChangeConfig(mp)) {
|
||||
return;
|
||||
}
|
||||
export async function activate(funbox, mode) {
|
||||
if (funbox === undefined || funbox === null) {
|
||||
funbox = funboxSaved;
|
||||
}
|
||||
|
|
@ -225,12 +222,17 @@ export async function activate(funbox, mode, mp = false) {
|
|||
// Settings.groups.layout.updateButton();
|
||||
// }
|
||||
// }
|
||||
Tribe.syncConfig();
|
||||
TestUI.updateModesNotice();
|
||||
return true;
|
||||
}
|
||||
export function setFunbox(funbox, mode) {
|
||||
if (TestLogic.active || TestUI.resultVisible) {
|
||||
export function setFunbox(funbox, mode, mp = false) {
|
||||
if (!Tribe.checkIfCanChangeConfig(mp)) {
|
||||
return;
|
||||
}
|
||||
if (
|
||||
TestLogic.active ||
|
||||
(TestUI.resultVisible && $(".page.pageTest").hasClass("active"))
|
||||
) {
|
||||
Notifications.add(
|
||||
"You can only change the funbox before starting a test.",
|
||||
0
|
||||
|
|
@ -241,5 +243,6 @@ export function setFunbox(funbox, mode) {
|
|||
funboxSaved = funbox;
|
||||
modeSaved = mode;
|
||||
active = funbox;
|
||||
Tribe.syncConfig();
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -588,7 +588,7 @@ export async function init(mp = false) {
|
|||
// } else {
|
||||
TestUI.showWords();
|
||||
// }
|
||||
if ($(".pageTest").hasClass("active")) {
|
||||
if ($(".pageTest").hasClass("active") || mp) {
|
||||
Funbox.activate();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -198,6 +198,7 @@ function refreshUserList() {
|
|||
}
|
||||
|
||||
function playSound(sound) {
|
||||
if (TestLogic.active) return;
|
||||
tribeSounds[sound].currentTime = 0;
|
||||
tribeSounds[sound].play();
|
||||
}
|
||||
|
|
@ -239,7 +240,7 @@ function applyRoomConfig(cfg) {
|
|||
UpdateConfig.setDifficulty(cfg.difficulty, true, true);
|
||||
UpdateConfig.setBlindMode(cfg.blindMode, true, true);
|
||||
UpdateConfig.setLanguage(cfg.language, true, true);
|
||||
Funbox.activate(cfg.funbox, null, true);
|
||||
Funbox.setFunbox(cfg.funbox, null, true);
|
||||
UpdateConfig.setStopOnError(cfg.stopOnError, true, true);
|
||||
UpdateConfig.setConfidenceMode(cfg.confidenceMode, true, true);
|
||||
UpdateConfig.setPunctuation(cfg.punctuation, true, true);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue