diff --git a/Modules/Icons/Icons.lua b/Modules/Icons/Icons.lua index bd5a367..28b7ea4 100644 --- a/Modules/Icons/Icons.lua +++ b/Modules/Icons/Icons.lua @@ -346,12 +346,7 @@ end function mod:OnInitialize() self.db = StarTip.db:RegisterNamespace(self:GetName(), defaults) StarTip:SetOptionsDisabled(options, true) - - self.core = LibCore:New(mod, environment, "StarTip.Icons", {["StarTip.Icons"] = {}}, nil, StarTip.db.profile.errorLevel) - self.core.lcd = {LCOLS=self.db.profile.cols, LROWS=self.db.profile.rows, XRES=self.db.profile.xres, YRES=self.db.profile.yres, specialChars = {}} - - self.buffer = LibBuffer:New("Icons", self.core.lcd.LCOLS * self.core.lcd.LROWS * self.core.lcd.YRES * self.core.lcd.XRES, 0, StarTip.db.profile.errorLevel) - + if self.db.profile.update > 0 then self.timer = LibTimer:New("Icons", 100, true, update) end @@ -384,6 +379,11 @@ local function createIcons() end function mod:OnEnable() + self.core = LibCore:New(mod, StarTip.core.environment, "StarTip.Icons", {["StarTip.Icons"] = {}}, nil, StarTip.db.profile.errorLevel) + self.core.lcd = {LCOLS=self.db.profile.cols, LROWS=self.db.profile.rows, XRES=self.db.profile.xres, YRES=self.db.profile.yres, specialChars = {}} + + self.buffer = LibBuffer:New("Icons", self.core.lcd.LCOLS * self.core.lcd.LROWS * self.core.lcd.YRES * self.core.lcd.XRES, 0, StarTip.db.profile.errorLevel) + StarTip:SetOptionsDisabled(options, false) createIcons() -- no need to start the timer @@ -394,6 +394,9 @@ function mod:OnDisable() if self.timer then self.timer:Stop() end + if self.core then + self.core:Del() + end end function mod:GetOptionsbleh() diff --git a/Modules/Images/Images.lua b/Modules/Images/Images.lua index f5cc07e..1f97061 100644 --- a/Modules/Images/Images.lua +++ b/Modules/Images/Images.lua @@ -82,7 +82,7 @@ function mod:OnInitialize() self.db = StarTip.db:RegisterNamespace(self:GetName(), defaults) StarTip:SetOptionsDisabled(options, true) - self.core = LibCore:New(mod, environment, "StarTip.Images", {["StarTip.Images"] = {}}, nil, StarTip.db.profile.errorLevel) + self.core = LibCore:New(mod, StarTip.core.environment, "StarTip.Images", {["StarTip.Images"] = {}}, nil, StarTip.db.profile.errorLevel) self.core.lcd = {LCOLS=self.db.profile.cols, LROWS=self.db.profile.rows, LAYERS=self.db.profile.layers} self.buffer = LibBuffer:New("StarTip.Images", self.core.lcd.LCOLS * self.core.lcd.LROWS, 0, StarTip.db.profile.errorLevel)