mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-21 12:00:44 +00:00
Make territory highlighting more efficient
This commit is contained in:
@@ -55,7 +55,7 @@ export class TerritoryLayer implements Layer {
|
||||
paintPlayerBorder(player: PlayerView) {
|
||||
player.borderTiles().then((playerBorderTiles) => {
|
||||
playerBorderTiles.borderTiles.forEach((tile: TileRef) => {
|
||||
this.paintTerritory(tile); // Immediately paint the tile instead of enqueueing
|
||||
this.paintTerritory(tile, true); // Immediately paint the tile instead of enqueueing
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
export class UserSettings {
|
||||
private focusedLocked_: boolean | null = null;
|
||||
|
||||
get(key: string, defaultValue: boolean) {
|
||||
const value = localStorage.getItem(key);
|
||||
if (!value) return defaultValue;
|
||||
@@ -25,7 +27,10 @@ export class UserSettings {
|
||||
}
|
||||
|
||||
focusLocked() {
|
||||
return this.get("settings.focusLocked", false);
|
||||
if (this.focusedLocked_ === null) {
|
||||
this.focusedLocked_ = this.get("settings.focusLocked", false);
|
||||
}
|
||||
return this.focusedLocked_;
|
||||
}
|
||||
|
||||
toggleLeftClickOpenMenu() {
|
||||
@@ -33,6 +38,7 @@ export class UserSettings {
|
||||
}
|
||||
|
||||
toggleFocusLocked() {
|
||||
this.focusLocked = null;
|
||||
this.set("settings.focusLocked", !this.focusLocked());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user