Fix toggle mode on "X"

His Dad [09-05-15 - 21:23]
Fix toggle mode on "X"
Filename
GRID.lua
ResearchTimer.lua
ResearchTimer.txt
doc/changelog.txt
diff --git a/GRID.lua b/GRID.lua
index 1932670..253e7f6 100644
--- a/GRID.lua
+++ b/GRID.lua
@@ -34,7 +34,8 @@ function RT.GRID_Create()
 --		RT.UI.GRID_BTN:SetMouseOverBlendMode(0)
 		RT.UI.GRID_BTN:SetNormalTexture("/esoui/art/buttons/decline_down.dds")
 		RT.UI.GRID_BTN:SetMouseOverTexture("/esoui/art/buttons/decline_up.dds")
-		RT.UI.GRID_BTN:SetHandler( "OnClicked" , function(self) RT.UI.GRID_TLW:SetHidden(true); end )
+		RT.UI.GRID_BTN:SetHandler( "OnClicked" , RT.toggleGRID )
+		--RT.UI.GRID_BTN:SetHandler( "OnClicked" , function(self) RT.UI.GRID_TLW:SetHidden(true); end )

 		for k, _ in pairs(RT.SV.data.Craft) do
 			RT.GRID_Create_Character(k)
diff --git a/ResearchTimer.lua b/ResearchTimer.lua
index 0dbdce9..62c5575 100644
--- a/ResearchTimer.lua
+++ b/ResearchTimer.lua
@@ -5,7 +5,7 @@ RT = {
 	name = "ResearchTimer",
 	font = "ZoFontGame",
 	cmdsetup = "/rt",
-	version = "v1.8",
+	version = "v1.9",
 	playername = "",
 	Init_done = false,
 	UI = {},
@@ -125,10 +125,13 @@ function RT.Activated()
 end

 function RT.toggleGRID()
-	if (RT.UI.GRID_TLW:IsHidden()) then
-	RT.GRID_Sort()
+	if RT.Init_done then	-- block until fully setup, other hit nil variables
+		if (RT.UI.GRID_TLW:IsHidden()) then
+		RT.GRID_Sort()
+		end
+		SCENE_MANAGER:ToggleTopLevel(RT.UI.GRID_TLW)
 	end
-	SCENE_MANAGER:ToggleTopLevel(RT.UI.GRID_TLW)
+
 end

 function RT.CommandText_setup(option)
diff --git a/ResearchTimer.txt b/ResearchTimer.txt
index 2672df5..6c3375d 100644
--- a/ResearchTimer.txt
+++ b/ResearchTimer.txt
@@ -1,7 +1,7 @@
 ## Title: |c96FF00Research Timer|r - |c96FF00 v1|r
 ## APIVersion: 100012
 ## SavedVariables: ResearchTimer
-## Version: 1.8
+## Version: 1.9
 ## Author: Hisdad


diff --git a/doc/changelog.txt b/doc/changelog.txt
index dc0172f..cd0def8 100644
--- a/doc/changelog.txt
+++ b/doc/changelog.txt
@@ -1,3 +1,6 @@
+2015-09-06 v1.9
+	Fix weird display mode after closing with"X"
+
 2015-09-01 v1.8
 	API Bump