Make territory highlighting more efficient

This commit is contained in:
Evan
2025-04-06 09:43:33 -07:00
parent 89fb1c0f14
commit 952a2568aa
2 changed files with 8 additions and 2 deletions
+1 -1
View File
@@ -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
});
});
}
+7 -1
View File
@@ -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());
}