mirror of
https://codeberg.org/Duvelcorp/MetaHunt.git
synced 2026-09-26 09:36:05 +00:00
Unify SavedVariables into two clean roots with one-time migration
Collapse all legacy/scattered SavedVariables from absorbed standalone
addons (FeedOMatic, ZHunter/zButtons, SmartAmmo, AutoQuest, AntiDaze,
AutoStrip, MinimapButton) into two persisted globals with clean per-module
nesting under .modules.<id>.
Migration engine (api/savedvariables.lua):
- MTH_SV_EnsureSchema() with schemaVersion gate, idempotent + non-destructive
- Per-module migrators map old locations -> canonical nested stores
- Driven by an ADDON_LOADED("MetaHunt") handler so it runs only AFTER WoW
loads the real SavedVariables (fixes announce-every-session bug that ran
the migration on empty pre-load defaults)
- One-time player-facing chat announce, gated on real legacy data present
Framework/config:
- core-framework InitSavedVariables no longer runs migration at file-load;
unconditionally strips account-root module aliases
- config.lua stops re-creating root[module] aliases (was duplicating data
onto disk); canonical store stays under .modules.<id>
Modules:
- feedomatic: bind FOM_* globals as runtime aliases into nested store,
drop persisted duplicates and .legacy blob
- zhunter: ZHunterMod_Saved re-pointed at .modules.zhunter
- smartammo/autoquest/antidaze/autostrip/minimapbutton read nested store
TOC trimmed to MTH_SavedVariables + MTH_CharSavedVariables only.
Profiles unchanged (already snapshot/apply the nested .modules structure).
Also includes pet-scan refinements: canonical pet key derivation and
level-independent pet signature (schema v3).
This commit is contained in:
@@ -165,18 +165,11 @@ MTH_ZH_ApplyEnabledRuntimeState = function(source)
|
||||
end
|
||||
|
||||
MTH_ZH_SyncSavedVariables = function()
|
||||
if not MTH or not MTH.GetModuleCharSavedVariables then
|
||||
return
|
||||
end
|
||||
|
||||
local moduleStore = MTH:GetModuleCharSavedVariables("zhunter")
|
||||
|
||||
if type(ZHunterMod_Saved) == "table" then
|
||||
if MTH_CharSavedVariables and MTH_CharSavedVariables.modules then
|
||||
MTH_CharSavedVariables.modules.zhunter = ZHunterMod_Saved
|
||||
end
|
||||
elseif type(moduleStore) == "table" then
|
||||
ZHunterMod_Saved = moduleStore
|
||||
-- Bind the ZHunterMod_Saved global as a runtime alias into the canonical
|
||||
-- nested store (MTH_CharSavedVariables.modules.zhunter). GetSavedRoot does the
|
||||
-- adoption + aliasing; there is no second on-disk copy anymore.
|
||||
if type(MTH_ZH_GetSavedRoot) == "function" then
|
||||
MTH_ZH_GetSavedRoot()
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user