Allow esc to close dialog

His Dad [08-23-15 - 07:30]
Allow esc to close dialog
Filename
ResearchTimer.lua
ResearchTimer.txt
doc/changelog.txt
diff --git a/ResearchTimer.lua b/ResearchTimer.lua
index 4a2b4ff..d83c407 100644
--- a/ResearchTimer.lua
+++ b/ResearchTimer.lua
@@ -5,7 +5,7 @@ RT = {
 	name = "ResearchTimer",
 	font = "ZoFontGame",
 	cmdsetup = "/rt",
-	version = "v1.6",
+	version = "v1.7",
 	playername = "",
 	Init_done = false,
 	UI = {},
@@ -127,10 +127,8 @@ end
 function RT.toggleGRID()
 	if (RT.UI.GRID_TLW:IsHidden()) then
 	RT.GRID_Sort()
-	RT.UI.GRID_TLW:SetHidden(false)
-	else
-	RT.UI.GRID_TLW:SetHidden(true)
 	end
+	SCENE_MANAGER:ToggleTopLevel(RT.UI.GRID_TLW)
 end

 function RT.CommandText_setup(option)
@@ -180,13 +178,15 @@ function RT.Init(_, addOnName)
 		RT.GRID_Create()
 		RT.Update()	--Manual Update

-		RT.Init_done = true
+

 		-- Only after initialised do we hook any other events.
 		EVENT_MANAGER:RegisterForEvent(RT.name, EVENT_SMITHING_TRAIT_RESEARCH_STARTED, RT.Research_Changed)
 		EVENT_MANAGER:RegisterForEvent(RT.name, EVENT_SMITHING_TRAIT_RESEARCH_COMPLETED, RT.Research_Changed)
 		EVENT_MANAGER:RegisterForEvent(RT.name, EVENT_PLAYER_ACTIVATED, RT.Activated)
 		EVENT_MANAGER:RegisterForUpdate(RT.name, 1000, RT.UpdateOnTimer)
+		SCENE_MANAGER:RegisterTopLevel(RT.UI.GRID_TLW,false)
+		RT.Init_done = true
 	end
 end

diff --git a/ResearchTimer.txt b/ResearchTimer.txt
index 2f852b4..4b75a25 100644
--- a/ResearchTimer.txt
+++ b/ResearchTimer.txt
@@ -1,7 +1,7 @@
 ## Title: |c96FF00Research Timer|r - |c96FF00 v1|r
 ## APIVersion: 100011
 ## SavedVariables: ResearchTimer
-## Version: 1.6
+## Version: 1.7
 ## Author: Hisdad


diff --git a/doc/changelog.txt b/doc/changelog.txt
index 24fbf0b..55bcdf5 100644
--- a/doc/changelog.txt
+++ b/doc/changelog.txt
@@ -1,3 +1,6 @@
+2015-08-23 v1.7
+	Allow Esc to Close the Dialog.
+
 2015-05-04 v1.6
 	Change to doc to specify IUP 3.13