From 11a43e833f0d1de24ad4bc4d300af66f49ef5169 Mon Sep 17 00:00:00 2001 From: AssisrMatheus Date: Wed, 18 Sep 2019 22:57:32 -0300 Subject: [PATCH] :bug: #9: Fixed a bug where the user list wouldn't display after first logging in --- .gitignore | 1 + TodoChecklister.toc | 2 +- components/TodoChecklister.lua | 9 +++++---- components/TodoChecklister.xml | 2 +- constants.lua | 2 +- init.lua | 12 ++++++++---- 6 files changed, 17 insertions(+), 11 deletions(-) diff --git a/.gitignore b/.gitignore index 6fd0a37..53a6aea 100644 --- a/.gitignore +++ b/.gitignore @@ -39,3 +39,4 @@ luac.out *.x86_64 *.hex +CHANGES.txt \ No newline at end of file diff --git a/TodoChecklister.toc b/TodoChecklister.toc index aa41fcd..8532a4a 100644 --- a/TodoChecklister.toc +++ b/TodoChecklister.toc @@ -2,7 +2,7 @@ ## Title: TodoChecklister ## Author: Matheus Assis Rios (github.com/AssisrMatheus) ## Notes: I have bad memory so I made this. A todolist/checklist AddOn for World of Warcraft. -## Version: 1.1.5 +## Version: 1.1.6 ## DefaultState: enabled ## SavedVariables: TodoChecklisterDB, TodoChecklisterMapIcon diff --git a/components/TodoChecklister.lua b/components/TodoChecklister.lua index d86b333..701e8a0 100644 --- a/components/TodoChecklister.lua +++ b/components/TodoChecklister.lua @@ -151,7 +151,7 @@ function TodoChecklisterFrame:OnUpdate() end function TodoChecklisterFrame:OnLoad(frame) - self.frame = frame + self.frame = frame -- Parent's OnLoad Function ResponsiveFrame:OnLoad(frame) @@ -162,12 +162,13 @@ function TodoChecklisterFrame:OnLoad(frame) scrollFrame.update = function() TodoChecklisterFrame:OnUpdate() end HybridScrollFrame_CreateButtons(frame.ScrollFrame, "TodoItemTemplate") - -- Display the frame - self:Toggle() + -- Display the frame + self:OnUpdate() + self:Toggle() end function TodoChecklisterFrame:OnShow(frame) - self:OnUpdate() + self:OnUpdate() end function TodoChecklisterFrame:OnSizeChanged(frame) diff --git a/components/TodoChecklister.xml b/components/TodoChecklister.xml index 5b1fa45..ad6d55c 100644 --- a/components/TodoChecklister.xml +++ b/components/TodoChecklister.xml @@ -82,7 +82,7 @@ - + OnLoad(self) diff --git a/constants.lua b/constants.lua index 0442ba4..41953c4 100644 --- a/constants.lua +++ b/constants.lua @@ -13,7 +13,7 @@ end -------------------------------------- -- Defaults (usually a database!) -------------------------------------- -Constants.debugMode = false; +Constants.debugMode = true; Constants.addonName = addonName; Constants.theme = { red = 0.8, -- 204/255 diff --git a/init.lua b/init.lua index 92ba013..7a9a054 100644 --- a/init.lua +++ b/init.lua @@ -1,5 +1,9 @@ local addonName, core = ...; -- Namespace + +local events = CreateFrame("Frame", "TodoChecklisterAddon"); +events:RegisterEvent("ADDON_LOADED"); + -- WARNING: self keyword automatically becomes events frame! function core:Init(event, name) if (name ~= addonName) then return end @@ -41,9 +45,9 @@ function core:Init(event, name) end else core.Chat:Print("You have no pending tasks."); - end -end + end -local events = CreateFrame("Frame"); -events:RegisterEvent("ADDON_LOADED"); + + CreateFrame("Frame", "TodoChecklister", events, "TodoChecklisterTemplate"); +end events:SetScript("OnEvent", core.Init); \ No newline at end of file