Added version control

torsten.philipp [03-29-18 - 23:18]
Added version control
Filename
TaosGroupTools/util/DebugLogger.lua
TaosGroupTools/util/GroupHelper.lua
TaosGroupTools/util/UiHelper.lua
diff --git a/TaosGroupTools/util/DebugLogger.lua b/TaosGroupTools/util/DebugLogger.lua
index 151963f..5738be4 100644
--- a/TaosGroupTools/util/DebugLogger.lua
+++ b/TaosGroupTools/util/DebugLogger.lua
@@ -4,14 +4,18 @@
 	Created by @Taonnor
 ]]--

+-- Version Control
+local VERSION = 1
+
 --[[
 	Class definition
 ]]--
 -- A table in hole lua workspace must be unique
 -- The debug logger is global util table, used in several of my addons
-if (TaosDebugLogger == nil) then
+if (TaosDebugLogger == nil or TaosDebugLogger.Version == nil or TaosDebugLogger.Version < VERSION) then
 	TaosDebugLogger = {}
 	TaosDebugLogger.__index = TaosDebugLogger
+    TaosDebugLogger.Version = VERSION

 	setmetatable(TaosDebugLogger, {
 		__call = function (cls, ...)
diff --git a/TaosGroupTools/util/GroupHelper.lua b/TaosGroupTools/util/GroupHelper.lua
index 0a3f85c..03b34b7 100644
--- a/TaosGroupTools/util/GroupHelper.lua
+++ b/TaosGroupTools/util/GroupHelper.lua
@@ -4,15 +4,19 @@
 	Created by @Taonnor
 ]]--

+-- Version Control
+local VERSION = 1
+
 --[[
 	Class definition (Static class)
 ]]--
 -- A table in hole lua workspace must be unique
 -- The group helper is global util table, used in several of my addons
 -- The table is created as "static" class without constructor and static helper methods
-if (TaosGroupHelper == nil) then
+if (TaosGroupHelper == nil or TaosGroupHelper.Version == nil or TaosGroupHelper.Version < VERSION) then
 	TaosGroupHelper = {}
 	TaosGroupHelper.__index = TaosGroupHelper
+    TaosGroupHelper.Version = VERSION

     -- Global Callback Variables
     TAO_GROUP_CHANGED = "TAO-GroupChanged"
diff --git a/TaosGroupTools/util/UiHelper.lua b/TaosGroupTools/util/UiHelper.lua
index 9365a67..1366840 100644
--- a/TaosGroupTools/util/UiHelper.lua
+++ b/TaosGroupTools/util/UiHelper.lua
@@ -4,17 +4,22 @@
 	Created by @Taonnor
 ]]--

+-- Version Control
+local VERSION = 1
+
 --[[
 	Class definition (Static class)
 ]]--
 -- A table in hole lua workspace must be unique
 -- The ui helper is global util table, used in several of my addons
 -- The table is created as "static" class without constructor and static helper methods
-if (TaosUiHelper == nil) then
+if (TaosUiHelper == nil or TaosUiHelper.Version == nil or TaosUiHelper.Version < VERSION) then
 	TaosUiHelper = {}
 	TaosUiHelper.__index = TaosUiHelper
+    TaosUiHelper.Version = VERSION

     -- Global Callback Variables
+    TUI_HUD_HIDDEN_STATE_CHANGED = "TUI-HudHiddenStateChange" -- Older version, for compability
     TAO_HUD_HIDDEN_STATE_CHANGED = "TAO-HudHiddenStateChange"

 	-- isHidden logic for hud scenes
@@ -42,6 +47,7 @@ if (TaosUiHelper == nil) then

         if (isHidden ~= internalHudHiddenState) then
             internalHudHiddenState = isHidden
+            CALLBACK_MANAGER:FireCallbacks(TUI_HUD_HIDDEN_STATE_CHANGED, isHidden)
             CALLBACK_MANAGER:FireCallbacks(TAO_HUD_HIDDEN_STATE_CHANGED, isHidden)
         end
     end