mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-27 18:14:57 +00:00
Applied comments
This commit is contained in:
@@ -46,14 +46,13 @@ export class NameLayer implements Layer {
|
||||
private container: HTMLDivElement;
|
||||
private myPlayer: PlayerView | null = null;
|
||||
private firstPlace: PlayerView | null = null;
|
||||
private theme: Theme;
|
||||
private theme: Theme = this.game.config().theme();
|
||||
|
||||
constructor(
|
||||
private game: GameView,
|
||||
private transformHandler: TransformHandler,
|
||||
private clientID: ClientID,
|
||||
) {
|
||||
this.theme = game.config().theme();
|
||||
this.traitorIconImage = new Image();
|
||||
this.traitorIconImage.src = traitorIcon;
|
||||
this.allianceIconImage = new Image();
|
||||
@@ -73,6 +72,10 @@ export class NameLayer implements Layer {
|
||||
return false;
|
||||
}
|
||||
|
||||
redraw() {
|
||||
this.theme = this.game.config().theme();
|
||||
}
|
||||
|
||||
public init() {
|
||||
this.canvas = createCanvas();
|
||||
window.addEventListener("resize", () => this.resizeCanvas());
|
||||
@@ -98,9 +101,6 @@ export class NameLayer implements Layer {
|
||||
this.firstPlace = sorted[0];
|
||||
}
|
||||
|
||||
if (this.theme !== this.game.config().theme()) {
|
||||
this.theme = this.game.config().theme();
|
||||
}
|
||||
for (const player of this.game.playerViews()) {
|
||||
if (player.isAlive()) {
|
||||
if (!this.seenPlayers.has(player)) {
|
||||
|
||||
@@ -7,6 +7,7 @@ import { GameView } from "../../../core/game/GameView";
|
||||
import { Layer } from "./Layer";
|
||||
import { GameUpdateType } from "../../../core/game/GameUpdates";
|
||||
import { UserSettings } from "../../../core/game/UserSettings";
|
||||
import { RefreshGraphicsEvent } from "../../InputHandler";
|
||||
|
||||
const button = ({
|
||||
classes = "",
|
||||
@@ -83,6 +84,7 @@ export class OptionsMenu extends LitElement implements Layer {
|
||||
private onToggleDarkModeButtonClick() {
|
||||
this.userSettings.toggleDarkMode();
|
||||
this.requestUpdate();
|
||||
this.eventBus.emit(new RefreshGraphicsEvent());
|
||||
}
|
||||
|
||||
init() {
|
||||
|
||||
Reference in New Issue
Block a user