local addonName, addon = ... local childName = addon['childName'] local child = addon[childName] local modName = "noduel" local events = {} local db function events:DUEL_REQUESTED(_, event) StaticPopup_Hide(event) CancelDuel() end local function OnEnable() child:RegisterEvent(events) end local function OnDisable() child:UnregisterEvent(events) end local init = { Setup = function(self) db = child['db'] child['mhmods'][modName] = { ['Enable'] = OnEnable, ['Disable'] = OnDisable } if(db[modName]) then OnEnable() end child:AddCE(modName) end } addon.RegisterCallback(init, format('Init%s', childName), 'Setup')