v1.4.0 Twow 1.18.1

This commit is contained in:
DuvelCorp
2026-03-23 22:25:10 +01:00
parent 23bb69d094
commit 8479607a13
78 changed files with 66731 additions and 68666 deletions
+1 -46
View File
@@ -8,7 +8,7 @@ MTH_ZH_MANAGED_HOOKS = true
local MTH_ZHunter = {
name = "zhunter",
enabled = true,
version = "1.3.0",
version = "1.4.0",
events = {
"VARIABLES_LOADED",
-- PLAYER_ENTERING_WORLD handled by bootstrap frame + adjustment frames
@@ -24,19 +24,6 @@ local MTH_ZHunter = {
}
}
local function MTH_ZH_Log(msg)
if not (MTH and MTH.debug) then
return
end
MTH:Print("[ZH MODULE] " .. tostring(msg), "debug")
end
local function MTH_ZH_TraceLocal(msg)
if type(MTH_ZH_Trace) == "function" then
MTH_ZH_Trace(msg)
end
end
local MTH_ZH_PostLoginRestore = nil
local MTH_ZH_BootstrapFrame = nil
local MTH_ZH_SyncSavedVariables
@@ -80,7 +67,6 @@ local function MTH_ZH_ApplyDefaultWidgetSpawnLayoutOnce()
local orderedCount = table.getn(orderedButtons)
for i = 1, orderedCount do
if not getglobal(orderedButtons[i]) then
MTH_ZH_Log("skipped one-time default widget spawn layout (missing frame: " .. tostring(orderedButtons[i]) .. ")")
return false
end
end
@@ -95,7 +81,6 @@ local function MTH_ZH_ApplyDefaultWidgetSpawnLayoutOnce()
end
savedRoot["_mth_widget_spawn_layout_v1"] = 1
MTH_ZH_Log("applied one-time default widget spawn layout")
return true
end
@@ -107,7 +92,6 @@ function MTH_ZH_OnDeferredInitComplete()
if MTH_ZH_SetAuxFramesVisible then
MTH_ZH_SetAuxFramesVisible(false)
end
MTH_ZH_Log("deferred init applied disabled-state hide")
return
end
MTH_ZH_SyncSavedVariables()
@@ -137,10 +121,6 @@ MTH_ZH_QueuePostLoginRestore = function(tag)
MTH_ZH_SyncSavedVariables()
MTH_ZH_RestoreRuntimeFeatureFlags()
if type(MTH_ZH_TraceAllButtonPoints) == "function" then
MTH_ZH_TraceAllButtonPoints("post-login-restore:" .. tostring(tag))
end
MTH_ZH_Log("post-login restore applied: " .. tostring(tag))
end)
end
@@ -178,17 +158,10 @@ local function MTH_ZH_EnsureBootstrapRestoreFrame()
end
MTH_ZH_ApplyEnabledRuntimeState = function(source)
MTH_ZH_TraceLocal("apply-enabled-runtime-state source=" .. tostring(source or ""))
if type(MTH_ZH_TraceAllButtonPoints) == "function" then
MTH_ZH_TraceAllButtonPoints("apply-enabled:before:" .. tostring(source or ""))
end
MTH_ZH_SyncSavedVariables()
MTH_ZH_SetButtonsVisible(true)
MTH_ZH_SetAuxFramesVisible(true)
MTH_ZH_RestoreRuntimeFeatureFlags()
if type(MTH_ZH_TraceAllButtonPoints) == "function" then
MTH_ZH_TraceAllButtonPoints("apply-enabled:after:" .. tostring(source or ""))
end
end
MTH_ZH_SyncSavedVariables = function()
@@ -197,22 +170,17 @@ MTH_ZH_SyncSavedVariables = function()
end
local moduleStore = MTH:GetModuleCharSavedVariables("zhunter")
MTH_ZH_TraceLocal("sync-saved begin zhuntermod_saved=" .. tostring(type(ZHunterMod_Saved)))
if type(ZHunterMod_Saved) == "table" then
if MTH_CharSavedVariables and MTH_CharSavedVariables.modules then
MTH_CharSavedVariables.modules.zhunter = ZHunterMod_Saved
MTH_ZH_TraceLocal("sync-saved wrote ZHunterMod_Saved -> MTH_CharSavedVariables.modules.zhunter")
end
elseif type(moduleStore) == "table" then
ZHunterMod_Saved = moduleStore
MTH_ZH_TraceLocal("sync-saved loaded moduleStore -> ZHunterMod_Saved")
end
MTH_ZH_TraceLocal("sync-saved end")
end
MTH_ZH_SetButtonsVisible = function(visible)
MTH_ZH_TraceLocal("set-buttons-visible visible=" .. tostring(visible and true or false))
local buttonNames = {
"zButtonAspect",
"zButtonTrack",
@@ -294,9 +262,6 @@ MTH_ZH_SetButtonsVisible = function(visible)
for _, buttonName in ipairs(buttonNames) do
local button = getglobal(buttonName)
if button then
if type(MTH_ZH_TraceButtonPoint) == "function" then
MTH_ZH_TraceButtonPoint(button, "set-buttons-visible:before:" .. tostring(buttonName))
end
if visible then
-- Respect per-button enabled state
local getterName = buttonName .. "_GetSaved"
@@ -319,9 +284,6 @@ MTH_ZH_SetButtonsVisible = function(visible)
MTH_ZH_SetChildButtonsVisible(button, buttonName, false)
button:Hide()
end
if type(MTH_ZH_TraceButtonPoint) == "function" then
MTH_ZH_TraceButtonPoint(button, "set-buttons-visible:after:" .. tostring(buttonName))
end
end
end
end
@@ -400,7 +362,6 @@ function MTH_ZHunter:init()
end
function MTH_ZHunter:setEnabled(enabled)
MTH_ZH_TraceLocal("module setEnabled enabled=" .. tostring(enabled and true or false))
MTH_ZH_SyncSavedVariables()
if enabled then
MTH_ZH_EnsureBootstrapRestoreFrame()
@@ -409,14 +370,8 @@ function MTH_ZHunter:setEnabled(enabled)
else
MTH_ZH_ClearRuntimeFeatureFlags()
MTH_ZH_SetAdjustmentHandlersActive(false)
if type(MTH_ZH_TraceAllButtonPoints) == "function" then
MTH_ZH_TraceAllButtonPoints("setEnabled:false:before-hide")
end
MTH_ZH_SetButtonsVisible(false)
MTH_ZH_SetAuxFramesVisible(false)
if type(MTH_ZH_TraceAllButtonPoints) == "function" then
MTH_ZH_TraceAllButtonPoints("setEnabled:false:after-hide")
end
end
end