Quantcast

- Titan : Add API version check so Titan will not init if not at least 10.00.00

urnati [12-29-22 - 19:09]
- Titan : Add API version check so Titan will not init if not at least 10.00.00
- Config : Expand some descriptions
- License : Update years
Filename
Titan/TitanConfig.lua
Titan/TitanPanel.lua
Titan/license.txt
diff --git a/Titan/TitanConfig.lua b/Titan/TitanConfig.lua
index 7da277f..f7d4b9d 100644
--- a/Titan/TitanConfig.lua
+++ b/Titan/TitanConfig.lua
@@ -30,6 +30,7 @@ local notes = ""
 	..TitanUtils_GetRedText("NOTE : ")
 	..TitanUtils_GetNormalText(""
 		.."Currently the menu & bag frame and the status / xp frame are NOT adjustable via edit mode. In the Titan Configuration for Bottom Bars you may adjust the menu & bag frame and the status / xp frame *vertically only*.\n"
+		.."On PTR the menu & bag frame and the status / xp frame ARE adjustable via edit mode. This adjustment will be removed in a future release.\n"
 		)
 local changes = ""
 	..TitanUtils_GetGoldText("6.00.11.100002 : 2020/12/20\n")
@@ -98,7 +99,8 @@ TITAN_PANEL_CONFIG = {
 		extras			= L["TITAN_PANEL_EXTRAS_SHORT"],
 		attempts		= L["TITAN_PANEL_ATTEMPTS_SHORT"],
 		advanced		= L["TITAN_PANEL_MENU_ADV"],
-		changes			= (CHANGE or "Change").." "..(HISTORY or "History")
+		changes			= (CHANGE or "Change").." "..(HISTORY or "History"),
+		slash			= ("/").." "..(COMMAND or "Command"),
 		}
 	}
 -- TITAN_PANEL_CONFIG.topic.trans
@@ -182,7 +184,11 @@ local optionsControl = {
 		confgendesc = {
 			order = 1,
 			type = "description",
-			name = L["TITAN_PANEL_CONFIG_MAIN_LABEL"].."\n\n",
+--			name = L["TITAN_PANEL_CONFIG_MAIN_LABEL"].."\n\n",
+			name = ""
+				.."Titan Panel is an Interface Enhancement addon."
+				.."\n"
+				.."This addon does not interfere with, enhance, or replace any of your actual gameplay within the game. Titan Panel is meant to give you a quick visual point or click-on access to see the data related to your character without having to open other dialog boxes in the game or, in some cases, other addons. There are points we allow you to customize these features, but they do not relate directly to your gameplay. Our main program allows you to add bars to the top and bottom of your game screen. Over the years, we have been able to add some other features, but only if they do not interfere with your actual game experience.",
 			cmdHidden = true
 		},
 		confnotes = {
@@ -199,9 +205,26 @@ local optionsControl = {
 				},
 			}
 		},
+		confthanks = {
+			name = "Thank You",
+			order = 5,
+			type = "group", inline = true,
+			args = {
+				confversiondesc = {
+				order = 1,
+				type = "description",
+				name = ""
+					.."We would like to thank all of the users of TitanPanel."
+					.."\n"
+					.."We understand you have many choices on which addons to enhance your World of Warcraft experience."
+					.." Our Mission has always been to provide you with a tool to help add and improve your experience without impeding your enjoyment of the game. ",
+				cmdHidden = true
+				},
+			}
+		},
 		confinfodesc = {
 			name = "About",
-			order = 5,
+			order = 7,
 			type = "group", inline = true,
 			args = {
 				confversiondesc = {
@@ -239,6 +262,7 @@ local optionsControl = {
 						.._G["HIGHLIGHT_FONT_COLOR_CODE"]..TitanPanel_GetEmail(),
 					cmdHidden = true
 				},
+--[[ has not been updated in quite a while...
 				confwebsitedesc = {
 					order = 6,
 					type = "description",
@@ -246,6 +270,7 @@ local optionsControl = {
 						.._G["HIGHLIGHT_FONT_COLOR_CODE"]..TitanPanel_GetWebsite(),
 					cmdHidden = true
 				},
+--]]
 				conflicensedesc = {
 					order = 7,
 					type = "description",
@@ -255,55 +280,6 @@ local optionsControl = {
 				},
 			}
 		},
-		confslash = {
-			name = "Slash Commands",
-			order = 3,
-			type = "group", inline = true,
-			args = {
-				confversiondesc = {
-				order = 1,
-				type = "description",
-				name = ""
-					..TitanUtils_GetGoldText("reset\n")
-					..L["TITAN_PANEL_SLASH_RESET_0"].."\n"
-					..L["TITAN_PANEL_SLASH_RESET_1"].."\n"
-					..L["TITAN_PANEL_SLASH_RESET_2"].."\n"
-					..L["TITAN_PANEL_SLASH_RESET_3"].."\n"
-					..L["TITAN_PANEL_SLASH_RESET_4"].."\n"
-					..L["TITAN_PANEL_SLASH_RESET_5"].."\n"
-					.."\n"
-					..TitanUtils_GetGoldText("gui\n")
-					..L["TITAN_PANEL_SLASH_GUI_0"].."\n"
-					..L["TITAN_PANEL_SLASH_GUI_1"].."\n"
-					..L["TITAN_PANEL_SLASH_GUI_2"].."\n"
-					..L["TITAN_PANEL_SLASH_GUI_3"].."\n"
-					.."\n"
-					..TitanUtils_GetGoldText("profile\n")
-					..L["TITAN_PANEL_SLASH_PROFILE_0"].."\n"
-					..L["TITAN_PANEL_SLASH_PROFILE_1"].."\n"
-					..L["TITAN_PANEL_SLASH_PROFILE_2"].."\n"
-					..L["TITAN_PANEL_SLASH_PROFILE_3"].."\n"
-					.."\n"
-					..TitanUtils_GetGoldText("silent\n")
-					..L["TITAN_PANEL_SLASH_SILENT_0"].."\n"
-					..L["TITAN_PANEL_SLASH_SILENT_1"].."\n"
-					.."\n"
-					..TitanUtils_GetGoldText("orderhall\n")
-					..L["TITAN_PANEL_SLASH_ORDERHALL_0"].."\n"
-					..L["TITAN_PANEL_SLASH_ORDERHALL_1"].."\n"
-					.."\n"
-					..TitanUtils_GetGoldText("help\n")
-					..L["TITAN_PANEL_SLASH_HELP_0"].."\n"
-					..L["TITAN_PANEL_SLASH_HELP_1"].."\n"
-					.."\n"
-					..TitanUtils_GetGoldText("all\n")
-					..L["TITAN_PANEL_SLASH_ALL_0"].."\n"
-					..L["TITAN_PANEL_SLASH_ALL_1"].."\n"
-					.."",
-				cmdHidden = true
-				},
-			}
-		},
 	}
 }
 -------------
@@ -1968,8 +1944,8 @@ local optionsAdvanced = {
 					end,
 				},
 				advplugins = {
-					name = "Registration process", --L["TITAN_PANEL_MENU_ADV_PEW"],
-					desc = "Registration and number of registered", -- L["TITAN_PANEL_MENU_ADV_PEW_DESC"],
+					name = "Plugin Registration process", --L["TITAN_PANEL_MENU_ADV_PEW"],
+					desc = "Shows start and end of Registration process and number of registered plugins", -- L["TITAN_PANEL_MENU_ADV_PEW_DESC"],
 					order = 120, type = "toggle", width = "full",
 					get = function() return TitanAllGetVar("Registered") end,
 					set = function(_, a)
@@ -2007,6 +1983,67 @@ local changeHistory = {
 	},
 }

+--[[ local
+NAME: slash command help
+DESC: Show detailed help for slash commands
+:DESC
+--]]
+local slashHelp = {
+	name = TITAN_PANEL_CONFIG.topic.slash,
+	type = "group",
+	args = {
+		confslash = {
+			name = (HELP or "Help"),
+			order = 3,
+			type = "group", inline = true,
+			args = {
+				confversiondesc = {
+				order = 1,
+				type = "description",
+				name = ""
+					..TitanUtils_GetGoldText("reset\n")
+					..L["TITAN_PANEL_SLASH_RESET_0"].."\n"
+					..L["TITAN_PANEL_SLASH_RESET_1"].."\n"
+					..L["TITAN_PANEL_SLASH_RESET_2"].."\n"
+					..L["TITAN_PANEL_SLASH_RESET_3"].."\n"
+					..L["TITAN_PANEL_SLASH_RESET_4"].."\n"
+					..L["TITAN_PANEL_SLASH_RESET_5"].."\n"
+					.."\n"
+					..TitanUtils_GetGoldText("gui\n")
+					..L["TITAN_PANEL_SLASH_GUI_0"].."\n"
+					..L["TITAN_PANEL_SLASH_GUI_1"].."\n"
+					..L["TITAN_PANEL_SLASH_GUI_2"].."\n"
+					..L["TITAN_PANEL_SLASH_GUI_3"].."\n"
+					.."\n"
+					..TitanUtils_GetGoldText("profile\n")
+					..L["TITAN_PANEL_SLASH_PROFILE_0"].."\n"
+					..L["TITAN_PANEL_SLASH_PROFILE_1"].."\n"
+					..L["TITAN_PANEL_SLASH_PROFILE_2"].."\n"
+					..L["TITAN_PANEL_SLASH_PROFILE_3"].."\n"
+					.."\n"
+					..TitanUtils_GetGoldText("silent\n")
+					..L["TITAN_PANEL_SLASH_SILENT_0"].."\n"
+					..L["TITAN_PANEL_SLASH_SILENT_1"].."\n"
+					.."\n"
+					..TitanUtils_GetGoldText("orderhall\n")
+					..L["TITAN_PANEL_SLASH_ORDERHALL_0"].."\n"
+					..L["TITAN_PANEL_SLASH_ORDERHALL_1"].."\n"
+					.."\n"
+					..TitanUtils_GetGoldText("help\n")
+					..L["TITAN_PANEL_SLASH_HELP_0"].."\n"
+					..L["TITAN_PANEL_SLASH_HELP_1"].."\n"
+					.."\n"
+					..TitanUtils_GetGoldText("all\n")
+					..L["TITAN_PANEL_SLASH_ALL_0"].."\n"
+					..L["TITAN_PANEL_SLASH_ALL_1"].."\n"
+					.."",
+				cmdHidden = true
+				},
+			}
+		},
+	},
+}
+
 --[[ Titan
 NAME: TitanUpdateConfig
 DESC: This routine will handle the requests to update the various data items in Titan options screens.
@@ -2071,6 +2108,7 @@ AceConfig:RegisterOptionsTable("Titan Panel Addon Extras", optionsExtras)
 AceConfig:RegisterOptionsTable("Titan Panel Addon Chars", optionsChars)
 AceConfig:RegisterOptionsTable("Titan Panel Addon Advanced", optionsAdvanced)
 AceConfig:RegisterOptionsTable("Titan Panel Addon Changes", changeHistory)
+AceConfig:RegisterOptionsTable("Titan Panel Addon Slash", slashHelp)
 --]]
 -- Set the main options pages
 --[[ The first param must be the same as the cooresponding 'Ace register'
@@ -2092,4 +2130,5 @@ AceConfigDialog:AddToBlizOptions("Titan Panel Addon Extras", optionsExtras.name,
 AceConfigDialog:AddToBlizOptions("Titan Panel Addon Attempts", optionsAddonAttempts.name, optionsControl.name)
 AceConfigDialog:AddToBlizOptions("Titan Panel Addon Advanced", optionsAdvanced.name, optionsControl.name)
 AceConfigDialog:AddToBlizOptions("Titan Panel Addon Changes", changeHistory.name, optionsControl.name)
+AceConfigDialog:AddToBlizOptions("Titan Panel Addon Slash", slashHelp.name, optionsControl.name)

diff --git a/Titan/TitanPanel.lua b/Titan/TitanPanel.lua
index 76b456b..d9a26a5 100644
--- a/Titan/TitanPanel.lua
+++ b/Titan/TitanPanel.lua
@@ -279,20 +279,12 @@ local function TitanPanel_CreateABar(frame)
 end

 --------------------------------------------------------------
+_G[TITAN_PANEL_CONTROL]:RegisterEvent("ADDON_LOADED");
 --
--- Event registration
-_G[TITAN_PANEL_CONTROL]:RegisterEvent("PLAYER_ENTERING_WORLD");
-_G[TITAN_PANEL_CONTROL]:RegisterEvent("CVAR_UPDATE");
-_G[TITAN_PANEL_CONTROL]:RegisterEvent("PLAYER_LOGOUT");
+-- Event routine : redirects to TitanPanelBarButton:<registered event> routines below.
 _G[TITAN_PANEL_CONTROL]:SetScript("OnEvent", function(_, event, ...)
 	_G[TITAN_PANEL_CONTROL][event](_G[TITAN_PANEL_CONTROL], ...)
 end)
--- For the pet battle - for now we'll hide the Titan bars...
--- Cannot seem to move the 'top' part of the frame.
-_G[TITAN_PANEL_CONTROL]:RegisterEvent("PET_BATTLE_OPENING_START");
-_G[TITAN_PANEL_CONTROL]:RegisterEvent("PET_BATTLE_CLOSE");
--- Adjust a couple frames per user
-_G[TITAN_PANEL_CONTROL]:RegisterEvent("EDIT_MODE_LAYOUTS_UPDATED");


 --[[ Titan
@@ -411,20 +403,58 @@ end
 --
 -- Event handlers
 --
+--[===[
+		local WoWClassicEra, WoWClassicTBC, WoWWOTLKC, WoWRetail
+		if wowversion < 20000 then
+			WoWClassicEra = true
+		elseif wowversion < 30000 then
+			WoWClassicTBC = true
+		elseif wowversion < 40000 then
+			WoWWOTLKC = true
+		elseif wowversion > 90000 then
+			WoWRetail = true
+		else
+			-- n/a
+		end
+--]===]
 function TitanPanelBarButton:ADDON_LOADED(addon)
 	if addon == TITAN_ID then
-		-- Get Profile and Saved Vars
-		TitanVariables_InitTitanSettings();
-		local VERSION = TitanPanel_GetVersion();
-		local POS = strfind(VERSION," - ");
-		VERSION = strsub(VERSION,1,POS-1);
-		TitanPrint("", "header")
+		-- Determine WoW TOC Version
+		local wowversion  = select(4, GetBuildInfo())
+		if wowversion >= 100000 then -- Initialize Titan
+			-- Event registration
+			_G[TITAN_PANEL_CONTROL]:RegisterEvent("PLAYER_ENTERING_WORLD");
+			_G[TITAN_PANEL_CONTROL]:RegisterEvent("CVAR_UPDATE");
+			_G[TITAN_PANEL_CONTROL]:RegisterEvent("PLAYER_LOGOUT");
+			-- For the pet battle - for now we'll hide the Titan bars...
+			-- Cannot seem to move the 'top' part of the frame.
+			_G[TITAN_PANEL_CONTROL]:RegisterEvent("PET_BATTLE_OPENING_START");
+			_G[TITAN_PANEL_CONTROL]:RegisterEvent("PET_BATTLE_CLOSE");
+			-- Adjust a couple frames per user
+			_G[TITAN_PANEL_CONTROL]:RegisterEvent("EDIT_MODE_LAYOUTS_UPDATED");
+
+			-- Get Profile and Saved Vars
+			TitanVariables_InitTitanSettings();
+--			local VERSION = TitanPanel_GetVersion();
+--			local POS = strfind(VERSION," - ");
+--			VERSION = strsub(VERSION,1,POS-1);
+			TitanPrint("", "header")

-		if not ServerTimeOffsets then
-			ServerTimeOffsets = {};
-		end
-		if not ServerHourFormat then
-			ServerHourFormat = {};
+			if not ServerTimeOffsets then
+				ServerTimeOffsets = {};
+			end
+			if not ServerHourFormat then
+				ServerHourFormat = {};
+			end
+		else
+			-- User loaded wrong Titan version; tried to use retail on Classic or Classic Era
+			-- Could save the user grief; Titan could mangle the saved vars on a version mismatch.
+			TitanPrint("Titan did not initialize!!!!"
+				, "error")
+			TitanPrint("This version needs API released with "
+				.." "..tostring(EXPANSION_NAME9)..""
+				.." (10.00.xx)"
+				, "error")
 		end
 		-- Unregister event - saves a few event calls.
 		self:UnregisterEvent("ADDON_LOADED");
diff --git a/Titan/license.txt b/Titan/license.txt
index b9d7fbe..0657985 100644
--- a/Titan/license.txt
+++ b/Titan/license.txt
@@ -1,4 +1,4 @@
-Copyright (c) 2018, Titan Panel Development Team
+Copyright (c) 2008-2023, Titan Panel Development Team

 All rights reserved.