mirror of
https://codeberg.org/Duvelcorp/MetaHunt.git
synced 2026-09-25 17:16:05 +00:00
v1.1.0
This commit is contained in:
@@ -0,0 +1,52 @@
|
||||
------------------------------------------------------
|
||||
-- MetaHunt: ICU Module Wrapper
|
||||
-- Safe wrapper for ICU minimap targeting utilities
|
||||
------------------------------------------------------
|
||||
|
||||
local MTH_ICU = {
|
||||
name = "icu",
|
||||
enabled = false,
|
||||
version = "1.1.0",
|
||||
events = {
|
||||
"VARIABLES_LOADED",
|
||||
},
|
||||
initialized = false,
|
||||
}
|
||||
|
||||
local function ICU_Log(message, severity)
|
||||
if type(MTH_Log) == "function" then
|
||||
MTH_Log("[ICU] " .. tostring(message or ""), severity)
|
||||
end
|
||||
end
|
||||
|
||||
function MTH_ICU:init()
|
||||
self.initialized = true
|
||||
if type(ICU_SetEnabled) == "function" then
|
||||
ICU_SetEnabled(self.enabled and true or false)
|
||||
end
|
||||
end
|
||||
|
||||
function MTH_ICU:setEnabled(enabled)
|
||||
if not self.initialized then
|
||||
self:init()
|
||||
end
|
||||
if type(ICU_SetEnabled) == "function" then
|
||||
ICU_SetEnabled(enabled and true or false)
|
||||
else
|
||||
ICU_Log("runtime not loaded; cannot change enabled state", "error")
|
||||
end
|
||||
end
|
||||
|
||||
function MTH_ICU:onEvent(eventName)
|
||||
if eventName == "VARIABLES_LOADED" and type(ICU_SetEnabled) == "function" then
|
||||
ICU_SetEnabled(self.enabled and true or false)
|
||||
end
|
||||
end
|
||||
|
||||
function MTH_ICU:cleanup()
|
||||
if type(ICU_SetEnabled) == "function" then
|
||||
ICU_SetEnabled(false)
|
||||
end
|
||||
end
|
||||
|
||||
MTH:RegisterModule("icu", MTH_ICU)
|
||||
Reference in New Issue
Block a user