1
0
mirror of https://github.com/tobspr/shapez.io.git synced 2025-12-16 11:41:50 +00:00

Made debug overlay able to be translated

This commit is contained in:
mini-bomba 2020-06-12 14:54:07 +02:00
parent 8c01cc23d0
commit 9088d5ef80
No known key found for this signature in database
GPG Key ID: 5385F61541980B73
2 changed files with 22 additions and 9 deletions

View File

@ -3,6 +3,7 @@ import { makeDiv, round3Digits, round2Digits } from "../../../core/utils";
import { Math_round } from "../../../core/builtins"; import { Math_round } from "../../../core/builtins";
import { DynamicDomAttach } from "../dynamic_dom_attach"; import { DynamicDomAttach } from "../dynamic_dom_attach";
import { KEYMAPPINGS } from "../../key_action_mapper"; import { KEYMAPPINGS } from "../../key_action_mapper";
import { T } from "../../../translations.js";
export class HUDDebugInfo extends BaseHUDPart { export class HUDDebugInfo extends BaseHUDPart {
createElements(parent) { createElements(parent) {
@ -31,15 +32,17 @@ export class HUDDebugInfo extends BaseHUDPart {
const now = this.root.time.realtimeNow(); const now = this.root.time.realtimeNow();
if (now - this.lastTick > 0.25 && this.visible) { if (now - this.lastTick > 0.25 && this.visible) {
this.lastTick = now; this.lastTick = now;
this.tickRateElement.innerText = "Tickrate: " + this.root.dynamicTickrate.currentTickRate; this.tickRateElement.innerText = T.ingame.debug.tickrate.replace(
this.fpsElement.innerText = "<x>",
"FPS: " + this.root.dynamicTickrate.currentTickRate.toString()
Math_round(this.root.dynamicTickrate.averageFps) + );
" (" + this.fpsElement.innerText = T.ingame.debug.fps
round2Digits(1000 / this.root.dynamicTickrate.averageFps) + .replace("<fps>", Math_round(this.root.dynamicTickrate.averageFps).toString())
" ms)"; .replace("<ms>", round2Digits(1000 / this.root.dynamicTickrate.averageFps).toString());
this.tickDurationElement.innerText = this.tickDurationElement.innerText = T.ingame.debug.tickDuration.replace(
"Tick Dur: " + round3Digits(this.root.dynamicTickrate.averageTickDuration) + "ms"; "<ms>",
round3Digits(this.root.dynamicTickrate.averageTickDuration).toString()
);
} }
} }
} }

View File

@ -381,6 +381,16 @@ ingame:
1_3_expand: >- 1_3_expand: >-
This is <strong>NOT</strong> an idle game! Build more extractors and belts to finish the goal quicker.<br><br>Tip: Hold <strong>SHIFT</strong> to place multiple extractors, and use <strong>R</strong> to rotate them. This is <strong>NOT</strong> an idle game! Build more extractors and belts to finish the goal quicker.<br><br>Tip: Hold <strong>SHIFT</strong> to place multiple extractors, and use <strong>R</strong> to rotate them.
# The debug overlay (F4)
# This doesn't need to be translated.
debug:
tickrate: >-
Tickrate: <x>
tickDuration: >-
Tick Dur: <ms>ms
fps: >-
FPS: <fps> (<ms> ms)
# All shop upgrades # All shop upgrades
shopUpgrades: shopUpgrades:
belt: belt: