changeset 159:a3507735dfd9 v75

Fixed a rendering issue with auto-logging checkboxes.
author yellowfive
date Wed, 24 Apr 2019 18:00:42 -0700
parents a338b9299e7a
children d670336e8c89
files AskMrRobot-Serializer/AskMrRobot-Serializer.lua AskMrRobot.toc CombatLog.lua Options.lua
diffstat 4 files changed, 13 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/AskMrRobot-Serializer/AskMrRobot-Serializer.lua	Tue Mar 12 23:01:54 2019 -0700
+++ b/AskMrRobot-Serializer/AskMrRobot-Serializer.lua	Wed Apr 24 18:00:42 2019 -0700
@@ -1,6 +1,6 @@
 -- AskMrRobot-Serializer will serialize and communicate character data between users.
 
-local MAJOR, MINOR = "AskMrRobot-Serializer", 74
+local MAJOR, MINOR = "AskMrRobot-Serializer", 75
 local Amr, oldminor = LibStub:NewLibrary(MAJOR, MINOR)
 
 if not Amr then return end -- already loaded by something else
--- a/AskMrRobot.toc	Tue Mar 12 23:01:54 2019 -0700
+++ b/AskMrRobot.toc	Wed Apr 24 18:00:42 2019 -0700
@@ -1,7 +1,7 @@
 ## Interface: 80100
 ## Title: Ask Mr. Robot
 ## Author: Team Robot, Inc.
-## Version: 74
+## Version: 75
 ## Notes: Gear import/export, combat logging, and more.
 ## URL: www.askmrrobot.com
 ## SavedVariables: AskMrRobotDb4
--- a/CombatLog.lua	Tue Mar 12 23:01:54 2019 -0700
+++ b/CombatLog.lua	Wed Apr 24 18:00:42 2019 -0700
@@ -8,8 +8,9 @@
 local _chkAutoAll = nil
 local _autoChecks = nil
 
-local function createDifficultyCheckBox(instanceId, difficultyId)
+local function createDifficultyCheckBox(instanceId, difficultyId, container)
 	local chk = AceGUI:Create("AmrUiCheckBox")
+	container:AddChild(chk)
 	chk:SetText(L.DifficultyNames[difficultyId])
 	chk:SetCallback("OnClick", function(widget)
 		Amr:ToggleAutoLog(instanceId, difficultyId)
@@ -44,23 +45,19 @@
 	line:SetPoint("TOPLEFT", lbl.frame, "BOTTOMLEFT", 1, -7)
 	line:SetPoint("TOPRIGHT", lbl.frame, "BOTTOMRIGHT", 0, -7)
 	
-	local chkMythic = createDifficultyCheckBox(instanceId, Amr.Difficulties.Mythic)
-	container:AddChild(chkMythic)
+	local chkMythic = createDifficultyCheckBox(instanceId, Amr.Difficulties.Mythic, container)
 	chkMythic:SetPoint("TOPLEFT", line.frame, "BOTTOMLEFT", 0, -8)
-	
-	local chkNormal = createDifficultyCheckBox(instanceId, Amr.Difficulties.Normal)
-	container:AddChild(chkNormal)
+
+	local chkNormal = createDifficultyCheckBox(instanceId, Amr.Difficulties.Normal, container)
 	chkNormal:SetPoint("TOPLEFT", line.frame, "BOTTOMLEFT", 0, -30)
 
 	-- find the widest of mythic/normal
 	local w = math.max(chkMythic:GetWidth(), chkNormal:GetWidth())
 	
-	local chkHeroic = createDifficultyCheckBox(instanceId, Amr.Difficulties.Heroic)
-	container:AddChild(chkHeroic)
+	local chkHeroic = createDifficultyCheckBox(instanceId, Amr.Difficulties.Heroic, container)
 	chkHeroic:SetPoint("TOPLEFT", line.frame, "BOTTOMLEFT", w + 20, -8)
 	
-	local chkLfr = createDifficultyCheckBox(instanceId, Amr.Difficulties.Lfr)
-	container:AddChild(chkLfr)
+	local chkLfr = createDifficultyCheckBox(instanceId, Amr.Difficulties.Lfr, container)
 	chkLfr:SetPoint("TOPLEFT", line.frame, "BOTTOMLEFT", w + 20, -30)
 		
 	return lbl, chkNormal
@@ -71,13 +68,13 @@
 
 	-- main commands
 	_btnToggle = AceGUI:Create("AmrUiButton")
+	container:AddChild(_btnToggle)
 	_btnToggle:SetText(L.LogButtonStartText)
 	_btnToggle:SetBackgroundColor(Amr.Colors.Green)
 	_btnToggle:SetFont(Amr.CreateFont("Bold", 16, Amr.Colors.White))
 	_btnToggle:SetWidth(200)
 	_btnToggle:SetHeight(26)
 	_btnToggle:SetCallback("OnClick", function() Amr:ToggleLogging() end)
-	container:AddChild(_btnToggle)
 	_btnToggle:SetPoint("TOPLEFT", container.content, "TOPLEFT", 0, -40)
 	
 	_lblLogging = AceGUI:Create("AmrUiLabel")
@@ -89,13 +86,13 @@
 	_lblLogging:SetPoint("TOP", _btnToggle.frame, "BOTTOM", 0, -5)
 	
 	local btnReload = AceGUI:Create("AmrUiButton")
+	container:AddChild(btnReload)
 	btnReload:SetText(L.LogButtonReloadText)
 	btnReload:SetBackgroundColor(Amr.Colors.Blue)
 	btnReload:SetFont(Amr.CreateFont("Bold", 16, Amr.Colors.White))
 	btnReload:SetWidth(200)
 	btnReload:SetHeight(26)
 	btnReload:SetCallback("OnClick", ReloadUI)
-	container:AddChild(btnReload)
 	btnReload:SetPoint("TOPLEFT", _btnToggle.frame, "TOPRIGHT", 40, 0)
 	
 	--[[
@@ -176,9 +173,9 @@
 	lbl:SetPoint("TOPLEFT", _btnToggle.frame, "BOTTOMLEFT", 0, -40)
 	
 	_chkAutoAll = AceGUI:Create("AmrUiCheckBox")
+	container:AddChild(_chkAutoAll)
 	_chkAutoAll:SetText(L.LogAutoAllText)
 	_chkAutoAll:SetCallback("OnClick", function(widget) Amr:ToggleAllAutoLog() end)
-	container:AddChild(_chkAutoAll)
 	_chkAutoAll:SetPoint("TOPLEFT", lbl.frame, "BOTTOMLEFT", 1, -15)
 	
 	_autoChecks = {}
--- a/Options.lua	Tue Mar 12 23:01:54 2019 -0700
+++ b/Options.lua	Wed Apr 24 18:00:42 2019 -0700
@@ -45,10 +45,10 @@
 local function createCheck(container, setting, text, description)
 
 	local chk = AceGUI:Create("AmrUiCheckBox")
+	container:AddChild(chk)
 	chk:SetUserData("setting", setting)
 	chk:SetText(text)
 	chk:SetCallback("OnClick", onCheckClick)
-	container:AddChild(chk)
 	
 	local desc = AceGUI:Create("AmrUiLabel")
 	container:AddChild(desc)