1
0
mirror of https://github.com/tobspr/shapez.io.git synced 2025-12-16 03:31:52 +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 { DynamicDomAttach } from "../dynamic_dom_attach";
import { KEYMAPPINGS } from "../../key_action_mapper";
import { T } from "../../../translations.js";
export class HUDDebugInfo extends BaseHUDPart {
createElements(parent) {
@ -31,15 +32,17 @@ export class HUDDebugInfo extends BaseHUDPart {
const now = this.root.time.realtimeNow();
if (now - this.lastTick > 0.25 && this.visible) {
this.lastTick = now;
this.tickRateElement.innerText = "Tickrate: " + this.root.dynamicTickrate.currentTickRate;
this.fpsElement.innerText =
"FPS: " +
Math_round(this.root.dynamicTickrate.averageFps) +
" (" +
round2Digits(1000 / this.root.dynamicTickrate.averageFps) +
" ms)";
this.tickDurationElement.innerText =
"Tick Dur: " + round3Digits(this.root.dynamicTickrate.averageTickDuration) + "ms";
this.tickRateElement.innerText = T.ingame.debug.tickrate.replace(
"<x>",
this.root.dynamicTickrate.currentTickRate.toString()
);
this.fpsElement.innerText = T.ingame.debug.fps
.replace("<fps>", Math_round(this.root.dynamicTickrate.averageFps).toString())
.replace("<ms>", round2Digits(1000 / this.root.dynamicTickrate.averageFps).toString());
this.tickDurationElement.innerText = T.ingame.debug.tickDuration.replace(
"<ms>",
round3Digits(this.root.dynamicTickrate.averageTickDuration).toString()
);
}
}
}

View File

@ -381,6 +381,16 @@ ingame:
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.
# 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
shopUpgrades:
belt: