debug: OMNI-HUD value probes — dump in-memory debug_hud/chat/debug at mod load, every UIHud:init pass (count + setting + element count), and on toggle; settles config-vs-memory divergence
This commit is contained in:
@@ -380,6 +380,9 @@ mod.on_setting_changed = function(setting_id)
|
|||||||
end
|
end
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
if setting_id == "debug_hud" or setting_id == "debug_chat" then
|
||||||
|
mod:diag("OMNI-HUD setting changed:", setting_id, "=", tostring(mod_settings[setting_id]))
|
||||||
|
end
|
||||||
local result = mod:get(setting_id)
|
local result = mod:get(setting_id)
|
||||||
local class_name = mod:get("class_selection")
|
local class_name = mod:get("class_selection")
|
||||||
-- Normal Mod Settings
|
-- Normal Mod Settings
|
||||||
|
|||||||
@@ -8,6 +8,8 @@ local ScriptUnit_extension = ScriptUnit.extension
|
|||||||
|
|
||||||
mod.debug_hud_last = {}
|
mod.debug_hud_last = {}
|
||||||
|
|
||||||
|
mod:diag("OMNI-HUD load: settings debug_hud=", tostring(mod_settings.debug_hud), " chat=", tostring(mod_settings.debug_chat), " debug=", tostring(mod_settings.debug_mode))
|
||||||
|
|
||||||
local ELEMENT_CLASS_NAME = "HudElementAutoMarkDebug"
|
local ELEMENT_CLASS_NAME = "HudElementAutoMarkDebug"
|
||||||
local ELEMENT_FILENAME = "AutoMark/scripts/mods/AutoMark/ui/hud_element_debug"
|
local ELEMENT_FILENAME = "AutoMark/scripts/mods/AutoMark/ui/hud_element_debug"
|
||||||
|
|
||||||
@@ -19,6 +21,11 @@ mod:add_require_path(ELEMENT_FILENAME)
|
|||||||
mod:hook("UIHud", "init",
|
mod:hook("UIHud", "init",
|
||||||
function(func, self, elements, visibility_groups, params)
|
function(func, self, elements, visibility_groups, params)
|
||||||
if elements then
|
if elements then
|
||||||
|
if not mod.omni_hud_init_count then
|
||||||
|
mod.omni_hud_init_count = 0
|
||||||
|
end
|
||||||
|
mod.omni_hud_init_count = mod.omni_hud_init_count + 1
|
||||||
|
mod:diag("OMNI-HUD init#", mod.omni_hud_init_count, "debug_hud=", tostring(mod_settings.debug_hud), " elements=", tostring(#elements))
|
||||||
local idx = nil
|
local idx = nil
|
||||||
for i = 1, #elements do
|
for i = 1, #elements do
|
||||||
if elements[i].class_name == ELEMENT_CLASS_NAME then
|
if elements[i].class_name == ELEMENT_CLASS_NAME then
|
||||||
|
|||||||
Reference in New Issue
Block a user