mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-21 13:20:43 +00:00
d6b29a655c
It happens very frequently that I misclick (meant to click on neighbor, mean to click modal, sensitive touchpad and many others) and ruin my game (and another player's). So by default left click opens the menu. As the attack button is in the middle you can just double click to attack. You can also shift+click to attack. I have updated the Help modal to document all that + the existing (just discovered in the code) ctrl+click to open build menu.
40 lines
867 B
TypeScript
40 lines
867 B
TypeScript
export class UserSettings {
|
|
get(key: string, defaultValue: boolean) {
|
|
const value = localStorage.getItem(key);
|
|
if (!value) return defaultValue;
|
|
|
|
if (value === "true") return true;
|
|
|
|
if (value === "false") return false;
|
|
}
|
|
|
|
set(key: string, value: boolean) {
|
|
localStorage.setItem(key, value ? "true" : "false");
|
|
document.body.classList.toggle("dark");
|
|
}
|
|
|
|
emojis() {
|
|
return this.get("settings.emojis", true);
|
|
}
|
|
|
|
darkMode() {
|
|
return this.get("settings.darkMode", false);
|
|
}
|
|
|
|
leftClickOpensMenu() {
|
|
return this.get("settings.leftClickOpensMenu", false);
|
|
}
|
|
|
|
toggleLeftClickOpenMenu() {
|
|
this.set("settings.leftClickOpensMenu", !this.leftClickOpensMenu());
|
|
}
|
|
|
|
toggleEmojis() {
|
|
this.set("settings.emojis", !this.emojis());
|
|
}
|
|
|
|
toggleDarkMode() {
|
|
this.set("settings.darkMode", !this.darkMode());
|
|
}
|
|
}
|