From f4c9c663541a2196de17a352980df9eb78d64099 Mon Sep 17 00:00:00 2001 From: dengr1065 Date: Mon, 6 Jul 2020 12:02:31 +0300 Subject: [PATCH] debug info fixes --- src/js/game/hud/parts/debug_info.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/js/game/hud/parts/debug_info.js b/src/js/game/hud/parts/debug_info.js index 33644f33..bdce3071 100644 --- a/src/js/game/hud/parts/debug_info.js +++ b/src/js/game/hud/parts/debug_info.js @@ -29,7 +29,7 @@ export class HUDDebugInfo extends BaseHUDPart { } updateFullText() { - this.element.classList.toggle("debugFull", this.full); + this.element.setAttribute("data-mode", this.mode); let version = `version ${G_BUILD_VERSION}`; if (this.full) { @@ -61,12 +61,14 @@ export class HUDDebugInfo extends BaseHUDPart { break; } this.updateFullText(); - this.domAttach.update(this.mode != enumDebugOverlayMode.disabled); + this.domAttach.update(this.mode !== enumDebugOverlayMode.disabled); } update() { const now = this.root.time.realtimeNow(); - if (now - this.lastTick > 0.25 && this.visible) { + if (!this.visible) return; + + if (now - this.lastTick > 0.25) { this.lastTick = now; this.tickRateElement.innerText = "Tickrate: " + this.root.dynamicTickrate.currentTickRate; this.fpsElement.innerText =