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