Skip to content

Commit

Permalink
🐛 #9: Fixed a bug where the user list wouldn't display after first lo…
Browse files Browse the repository at this point in the history
…gging in
  • Loading branch information
AssisrMatheus committed Sep 19, 2019
1 parent 8af867c commit 11a43e8
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 11 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,4 @@ luac.out
*.x86_64
*.hex

CHANGES.txt
2 changes: 1 addition & 1 deletion TodoChecklister.toc
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
9 changes: 5 additions & 4 deletions components/TodoChecklister.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion components/TodoChecklister.xml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
</Frames>
</Frame>

<Frame name="TodoChecklister" inherits="TodoChecklisterResponsiveFrameTemplate" parent="UIParent">
<Frame name="TodoChecklisterTemplate" inherits="TodoChecklisterResponsiveFrameTemplate" parent="UIParent" virtual="true">
<Scripts>
<OnLoad>
OnLoad(self)
Expand Down
2 changes: 1 addition & 1 deletion constants.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 8 additions & 4 deletions init.lua
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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);

0 comments on commit 11a43e8

Please sign in to comment.