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:
parent
8c01cc23d0
commit
9088d5ef80
@ -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()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user