summaryrefslogtreecommitdiffstats
path: root/cwd/assets/altcraft
diff options
context:
space:
mode:
authorLaG1924 <lag1924@gmail.com>2021-06-29 13:22:31 +0200
committerLaG1924 <lag1924@gmail.com>2021-06-29 13:22:31 +0200
commitcfb56c9255fbf37a6bb9f0a6758db87320364cf6 (patch)
tree3087614059392d5c2b9927ddf37ad01955e7bf84 /cwd/assets/altcraft
parentRemoved old items ids (diff)
downloadAltCraft-cfb56c9255fbf37a6bb9f0a6758db87320364cf6.tar
AltCraft-cfb56c9255fbf37a6bb9f0a6758db87320364cf6.tar.gz
AltCraft-cfb56c9255fbf37a6bb9f0a6758db87320364cf6.tar.bz2
AltCraft-cfb56c9255fbf37a6bb9f0a6758db87320364cf6.tar.lz
AltCraft-cfb56c9255fbf37a6bb9f0a6758db87320364cf6.tar.xz
AltCraft-cfb56c9255fbf37a6bb9f0a6758db87320364cf6.tar.zst
AltCraft-cfb56c9255fbf37a6bb9f0a6758db87320364cf6.zip
Diffstat (limited to 'cwd/assets/altcraft')
-rw-r--r--cwd/assets/altcraft/scripts/ui.lua13
-rw-r--r--cwd/assets/altcraft/ui/hud.rml7
2 files changed, 18 insertions, 2 deletions
diff --git a/cwd/assets/altcraft/scripts/ui.lua b/cwd/assets/altcraft/scripts/ui.lua
index 392ad27..98f0fae 100644
--- a/cwd/assets/altcraft/scripts/ui.lua
+++ b/cwd/assets/altcraft/scripts/ui.lua
@@ -106,13 +106,26 @@ function UpdateUi()
local selection = AC.GetGameState():GetSelectionStatus()
if selection.isBlockSelected then
bid = wrld:GetBlockId(selection.selectedBlock)
+ binfo = AC.GetBlockInfo(bid)
+ light = wrld:GetBlockLight(selection.selectedBlock)
+ skyLight = wrld:GetBlockSkyLight(selection.selectedBlock)
doc:GetElementById('dbg-select-pos').inner_rml = tostring(selection.selectedBlock)
doc:GetElementById('dbg-select-bid').inner_rml = string.format("%d:%d", bid.id, bid.state)
+ doc:GetElementById('dbg-select-name').inner_rml = string.format("%s:%s", binfo.blockstate, binfo.variant)
+ doc:GetElementById('dbg-select-light').inner_rml = string.format("%d:%d", light, skyLight)
else
doc:GetElementById('dbg-select-pos').inner_rml = ""
doc:GetElementById('dbg-select-bid').inner_rml = ""
+ doc:GetElementById('dbg-select-name').inner_rml = ""
+ doc:GetElementById('dbg-select-light').inner_rml = ""
end
+ doc:GetElementById('dbg-sections-loaded').inner_rml = AC.GetDebugValue(0)
+ doc:GetElementById('dbg-sections-renderer').inner_rml = AC.GetDebugValue(1)
+ doc:GetElementById('dbg-sections-ready').inner_rml = AC.GetDebugValue(2)
+ doc:GetElementById('dbg-sections-culled').inner_rml = AC.GetDebugValue(0) - AC.GetDebugValue(5)
+ doc:GetElementById('dbg-rendered-faces').inner_rml = AC.GetDebugValue(4)
+
local player = AC.GetGameState():GetPlayerStatus()
local playerHp = string.format("%.0f", player.health)
doc:GetElementById('status-hp').inner_rml = playerHp
diff --git a/cwd/assets/altcraft/ui/hud.rml b/cwd/assets/altcraft/ui/hud.rml
index cbf5c86..baa408a 100644
--- a/cwd/assets/altcraft/ui/hud.rml
+++ b/cwd/assets/altcraft/ui/hud.rml
@@ -8,8 +8,11 @@
<div class="dbg-hud">
<p>FPS: <span id="dbg-fps">∞?</span></p>
<p>Pos: <span id="dbg-pos">∞?</span></p>
- <p>Select pos: <span id="dbg-select-pos">∞?</span></p>
- <p>Select block: <span id="dbg-select-bid">∞?</span></p>
+ <p>Select: <span id="dbg-select-pos">∞?</span></p>
+ <p>&nbsp;&nbsp; block: <span id="dbg-select-bid">∞?</span> (<span style="color: yellow;" id="dbg-select-name">...?</span>)</p>
+ <p>&nbsp;&nbsp; light: <span id="dbg-select-light">∞?</span></p>
+ <p>Sections: <span id="dbg-sections-loaded">∞?</span> / <span id="dbg-sections-renderer">∞?</span> (<span id="dbg-sections-ready">∞?</span>)</p>
+ <p>&nbsp;&nbsp; rendered: <span id="dbg-sections-culled">∞?</span> (<span id="dbg-rendered-faces">∞?</span> faces)</p>
</div>
<div class="status-hud">
<p>HP: <span id="status-hp">∞?</span> <progress value="15" max="20" id="status-hp-bar" /> </p>