mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-22 17:26:42 +00:00
disable hover highlight due to performance issues.
This commit is contained in:
@@ -205,7 +205,7 @@ export class OptionsMenu extends LitElement implements Layer {
|
|||||||
? "Opens menu"
|
? "Opens menu"
|
||||||
: "Attack"),
|
: "Attack"),
|
||||||
})}
|
})}
|
||||||
${button({
|
<!-- ${button({
|
||||||
onClick: this.onToggleFocusLockedButtonClick,
|
onClick: this.onToggleFocusLockedButtonClick,
|
||||||
title: "Lock Focus",
|
title: "Lock Focus",
|
||||||
children:
|
children:
|
||||||
@@ -213,7 +213,7 @@ export class OptionsMenu extends LitElement implements Layer {
|
|||||||
(this.userSettings.focusLocked()
|
(this.userSettings.focusLocked()
|
||||||
? "Focus locked"
|
? "Focus locked"
|
||||||
: "Hover focus"),
|
: "Hover focus"),
|
||||||
})}
|
})} -->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
|
|||||||
@@ -550,6 +550,8 @@ export class GameView implements GameMap {
|
|||||||
}
|
}
|
||||||
|
|
||||||
focusedPlayer(): PlayerView | null {
|
focusedPlayer(): PlayerView | null {
|
||||||
|
// TODO: renable when performance issues are fixed.
|
||||||
|
return null;
|
||||||
if (userSettings.focusLocked()) return this.myPlayer();
|
if (userSettings.focusLocked()) return this.myPlayer();
|
||||||
return this._focusedPlayer;
|
return this._focusedPlayer;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
export class UserSettings {
|
export class UserSettings {
|
||||||
private focusedLocked_: boolean | null = null;
|
|
||||||
|
|
||||||
get(key: string, defaultValue: boolean) {
|
get(key: string, defaultValue: boolean) {
|
||||||
const value = localStorage.getItem(key);
|
const value = localStorage.getItem(key);
|
||||||
if (!value) return defaultValue;
|
if (!value) return defaultValue;
|
||||||
@@ -27,10 +25,9 @@ export class UserSettings {
|
|||||||
}
|
}
|
||||||
|
|
||||||
focusLocked() {
|
focusLocked() {
|
||||||
if (this.focusedLocked_ === null) {
|
return false;
|
||||||
this.focusedLocked_ = this.get("settings.focusLocked", true);
|
// TODO: renable when performance issues are fixed.
|
||||||
}
|
this.get("settings.focusLocked", true);
|
||||||
return this.focusedLocked_;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
toggleLeftClickOpenMenu() {
|
toggleLeftClickOpenMenu() {
|
||||||
@@ -38,7 +35,6 @@ export class UserSettings {
|
|||||||
}
|
}
|
||||||
|
|
||||||
toggleFocusLocked() {
|
toggleFocusLocked() {
|
||||||
this.focusLocked = null;
|
|
||||||
this.set("settings.focusLocked", !this.focusLocked());
|
this.set("settings.focusLocked", !this.focusLocked());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user