Quantcast

- Fixes fro 9.1 pre; Gold gsub; allow tooltip timer to go to 0; fix font list showing path not name

urnati [02-05-26 - 18:34]
- Fixes fro 9.1 pre; Gold gsub; allow tooltip timer to go to 0; fix font list showing path not name
Filename
Titan/Titan.lua
Titan/TitanConfig.lua
Titan/TitanHistory.lua
Titan/TitanMenu.lua
Titan/TitanTemplate.lua
TitanGold/TitanGold.lua
TitanPost/TitanPost.lua
diff --git a/Titan/Titan.lua b/Titan/Titan.lua
index a0aea93..c28395f 100644
--- a/Titan/Titan.lua
+++ b/Titan/Titan.lua
@@ -315,8 +315,6 @@ local function SetToonInfo(toon)
 	toon_info.raceName = englishRaceName
 	toon_info.raceId = raceID

-	toon_info.zoneText = GetZoneText()
-	toon_info.subZoneText = GetSubZoneText() or ""
 end

 local function SetToonLogout(toon)
@@ -325,6 +323,9 @@ local function SetToonLogout(toon)
 	local toon_info = TitanSettings.Players[toon].Info
 	local unit = "player"

+	toon_info.zoneText = GetZoneText()
+	toon_info.subZoneText = GetSubZoneText() or ""
+
 	local now = _G.time()
 	toon_info.logout = now
 	toon_info.logoutStr = TitanUtils_GetDateText(now, true)
@@ -1512,10 +1513,9 @@ local function showBar(frame_str)
 		or frame_str == TitanVariables_GetFrameName("Bar2")
 	then
 		-- ===== Battleground or Arena : User selected
-		--		if (TitanPanelGetVar("HideBarsInPVP"))
 		if TitanBarDataVars[frame_str].hide_in_pvp
-			and (C_PvP and C_PvP.IsBattleground()
-				or C_PvP and C_PvP.C_PvP.IsArena()
+			and (C_PvP and C_PvP.IsBattleground and C_PvP.IsBattleground())
+			or (C_PvP and C_PvP.IsArena and C_PvP.IsArena()
 			--			or GetZoneText() == "Stormwind City"
 			--			or GetZoneText() == "Tempest Keep"
 			)
@@ -2048,7 +2048,7 @@ local function GeneratorFunction(owner, rootDescription)
 	do
 		---@diagnostic disable-next-line: assign-type-mismatch, param-type-mismatch
 		for index, id in pairs(L["TITAN_PANEL_MENU_CATEGORIES"]) do
-			local cat = L["TITAN_PANEL_MENU_CATEGORIES"][index]
+			local cat = TITAN_PANEL_BUTTONS_PLUGIN_CATEGORY[index] -- L["TITAN_PANEL_MENU_CATEGORIES"][index]
 			local opts_plugins = Titan_Menu.AddButton(root, cat)
 			AddPlugin(opts_plugins, bar, cat) -- if same category
 		end
@@ -2089,6 +2089,7 @@ local function GeneratorFunction(owner, rootDescription)
 	Titan_Menu.AddDivider(root)

 -- Hold off for a rewrite using Blizz API over Ace
+--[[
 	if Titan_Global.switch.midnight then
 		-- disable until we figure this out
 	else
@@ -2101,6 +2102,7 @@ local function GeneratorFunction(owner, rootDescription)
 		end
 	)
 	end
+--]]

 	Titan_Menu.AddDivider(root)

diff --git a/Titan/TitanConfig.lua b/Titan/TitanConfig.lua
index 2fa95d0..547e6a0 100644
--- a/Titan/TitanConfig.lua
+++ b/Titan/TitanConfig.lua
@@ -13,6 +13,8 @@ local AceConfigRegistry = LibStub("AceConfigRegistry-3.0")
 local AceConfig = LibStub("AceConfig-3.0")
 local media = LibStub("LibSharedMedia-3.0")

+local font_list = {} -- filled later
+
 local TitanSkinToRemove = "None";
 local TitanSkinName, TitanSkinPath = "", "";

@@ -2166,8 +2168,8 @@ local optionsFrames = {
 			order = 203,
 			type = "range",
 			width = "full",
-			min = 0.5,
-			max = 10,
+			min = 0.0,
+			max = 10.0,
 			step = 0.25,
 			get = function() return TitanPanelGetVar("TooltipTimeout") end,
 			set = function(_, a)
@@ -2416,29 +2418,27 @@ local optionsUIScale = {
 			desc = L["TITAN_PANEL_MENU_LSM_FONTS_DESC"],
 			order = 31,
 			type = "select",
-			width = "40",
-			dialogControl = "LSM30_Font",
+--			width = ".5",
+			--dialogControl = "LSM30_Font",
 			get = function()
-				return TitanPanelGetVar("FontName")
+				local f_name = TitanPanelGetVar("FontName")
+				return f_name
 			end,
 			set = function(_, v)
 				TitanPanelSetVar("FontName", v)
+-- "Friz Quadrata TT"
 				TitanSetPanelFont(v, TitanPanelGetVar("FontSize"))
 			end,
-			values = media:HashTable("font"), --AceGUIWidgetLSMlists.font,
-		},
-		fontspacer = {
-			order = 32,
-			type = "description",
-			width = "20",
-			name = " ",
+			values = font_list,
+--			values = media:List("font"), --AceGUIWidgetLSMlists.font,
+--			values = media:HashTable("font"), --AceGUIWidgetLSMlists.font,
 		},
 		fontsize = {
 			name = L["TITAN_PANEL_MENU_FONT_SIZE"],
 			desc = L["TITAN_PANEL_MENU_FONT_SIZE_DESC"],
 			order = 33,
 			type = "range",
-			width = "40",
+--			width = ".5",
 			min = 7,
 			max = 15,
 			step = 1,
@@ -2448,6 +2448,12 @@ local optionsUIScale = {
 				TitanSetPanelFont(TitanPanelGetVar("FontName"), v)
 			end,
 		},
+		fontspacer = {
+			order = 35,
+			type = "description",
+			width = "full",
+			name = "* Could include Fonts from other addons.",
+		},
 		paneldesc = {
 			order = 40,
 			width = "full",
@@ -2458,6 +2464,7 @@ local optionsUIScale = {
 			name = L["TITAN_PANEL_MENU_FRAME_STRATA"],
 			desc = L["TITAN_PANEL_MENU_FRAME_STRATA_DESC"],
 			order = 41,
+			width = ".5",
 			type = "select",
 			get = function()
 				return TitanPanelGetVar("FrameStrata")
@@ -2476,6 +2483,7 @@ local optionsUIScale = {
 			},
 		},
 		panelstrataorder = {
+			width = ".5",
 			order = 42,
 			type = "description",
 			name = "Order of Strata\n"
@@ -3733,6 +3741,17 @@ end
 --============= Build the config
 ---Build the entire Config table Ace will display
 local function BuildAll()
+	-- Update font list
+
+	for idx, font in pairs (media:List("font")) do
+--		local path = media:Fetch('font', font)
+--		print(idx, font, path)
+
+		font_list[font] = font
+	end
+	table.sort(font_list)
+
+
 	-- Update the tables for the latest lists
 	UpdateConfigAddons()
 	TitanUpdateAddonAttempts()
diff --git a/Titan/TitanHistory.lua b/Titan/TitanHistory.lua
index a4f75c3..72894cc 100644
--- a/Titan/TitanHistory.lua
+++ b/Titan/TitanHistory.lua
@@ -50,6 +50,7 @@ local recent_changes = {
                "- Show and Delete are not available; the data is now part of the profile.",
                "- Delete is now delete toon profile",
                "Fix : Added back 'show color' option for those that want white text.",
+               "Fix : 'gsub' error in button text.",
             },
          },
          {
diff --git a/Titan/TitanMenu.lua b/Titan/TitanMenu.lua
index 001fb30..9de6d8c 100644
--- a/Titan/TitanMenu.lua
+++ b/Titan/TitanMenu.lua
@@ -794,7 +794,6 @@ local function TitanRightClickMenu_OnLoad(self, menu)
 			prepareFunction = "TitanPanelRightClickMenu_Prepare" .. id .. "Menu"
 			--
 		end
-
 		if type(prepareFunction) == 'string' then
 			-- Function MUST be in global namespace
 			-- Becomes nil if not found
@@ -805,7 +804,6 @@ local function TitanRightClickMenu_OnLoad(self, menu)
 			-- Invalid type, do not even try...
 			prepareFunction = nil
 		end
-
 		if prepareFunction then
 			if context_menu then
 				-- using newer context menu for this plugin
diff --git a/Titan/TitanTemplate.lua b/Titan/TitanTemplate.lua
index 85b851f..c779e01 100644
--- a/Titan/TitanTemplate.lua
+++ b/Titan/TitanTemplate.lua
@@ -283,7 +283,6 @@ local function TitanPanelButton_SetTooltip(self)
 	frame.plugin_frame_str = self:GetName()

 	ok = AllowTooltip(frame)
-
 	if ok then
 		local call_success = nil
 		local tmp_txt = ""
@@ -307,7 +306,10 @@ local function TitanPanelButton_SetTooltip(self)
 				-- 2026 Jan Switching to a Titan controlled frame made us realize
 				-- changing GameTooltip for custom tooltips creates a hybrid mess...
 				-- The plugin Dev should take full ownership of the tooltip :).
-				--TitanTooltip_SetPanelTooltip(self, id, frame);
+
+				-- For now, use the Game tooltip for custom until we can converse with other devs...
+				local custom_f = GameTooltip
+				TitanTooltip_SetPanelTooltip(self, id, custom_f);

 				-- Fill the tooltip
 				self.tooltipCustomFunction = plugin.tooltipCustomFunction;
@@ -321,7 +323,7 @@ local function TitanPanelButton_SetTooltip(self)
 					dbg_msg = dbg_msg .. " | Err: " .. tmp_txt
 				end

-				--				frame:Show(); -- now show it
+				custom_f:Show(); -- now show it
 			elseif (plugin) then
 				-- 2026 Jan No longer require registry.tooltipTitle allowing dev to set their own
 				-- From Lingkan dev of Titan Rep Continued
diff --git a/TitanGold/TitanGold.lua b/TitanGold/TitanGold.lua
index 2a83b67..86a926f 100644
--- a/TitanGold/TitanGold.lua
+++ b/TitanGold/TitanGold.lua
@@ -261,76 +261,82 @@ end
 ---@return IndexInfo
 local function EvalIndexInfo(index)
 	local str = ""
-	local res = { valid = false }
+	str = str .. tostring(index)
+
+	local res = { valid = false } -- The return table will be built as needed.
 	local character, charserver, is_custom = TitanUtils_ParseName(index)
 	local toon_info = TitanSettings.Players[index].Info ---@class CharInfo
 	if is_custom then
 		-- do not fill in
 		res.valid = false

-		str = ""..tostring(index).." ignored : is_custom"
+		str = str .. " ignored : is_custom"
 		Titan_Debug.Out('gold', 'eval', str)
 	elseif toon_info == nil then
 		-- do not fill in
 		res.valid = false

-		str = ""..tostring(index).." ignored : no data yet"
+		str = str .. " ignored : no data yet"
 	else
 		local toon_gold = toon_info[TITAN_GOLD_ID] ---@class GoldData
+		if toon_gold == nil then
+			res.valid = false

-		res.valid = true
+			str = str .. " ignored : info but no gold data yet"
+		else
+			res.valid = true

-		res.char_name = toon_info.name
-		res.server = toon_info.server
-		res.faction = toon_info.faction
+			res.char_name = character -- set in Info 9.1
+			res.server = charserver -- set in Info 9.1
+			res.faction = toon_info.faction

-		res.ignore_faction = TitanGetVar(TITAN_GOLD_ID, "IgnoreFaction")
+			res.ignore_faction = TitanGetVar(TITAN_GOLD_ID, "IgnoreFaction")

-		if (res.faction == GoldInfo.faction) then
-			res.same_faction = true
-		else
-			res.same_faction = false
-		end
+			if (res.faction == GoldInfo.faction) then
+				res.same_faction = true
+			else
+				res.same_faction = false
+			end

-		if (res.server == GoldInfo.server) then
-			res.same_realm = true
-		else
-			res.same_realm = false
-		end
+			if (res.server == GoldInfo.server) then
+				res.same_realm = true
+			else
+				res.same_realm = false
+			end

-		local saved_server = string.gsub(res.server, "%s", "") -- GetAutoCompleteRealms removes spaces, idk why...
-		if merged_realms[saved_server] then
-			res.merge_realm = true
-		else
-			res.merge_realm = false
-		end
+			local saved_server = string.gsub(res.server, "%s", "") -- GetAutoCompleteRealms removes spaces, idk why...
+			if merged_realms[saved_server] then
+				res.merge_realm = true
+			else
+				res.merge_realm = false
+			end

-		-- Assume server option is satisfied; check other options
-		if (res.ignore_faction or res.same_faction) then
-			res.show_toon = true
-		else
-			res.show_toon = false
-		end
+			-- Assume server option is satisfied; check other options
+			if (res.ignore_faction or res.same_faction) then
+				res.show_toon = true
+			else
+				res.show_toon = false
+			end

-		res.gold = toon_gold.gold
-
-		str = ""
-		.." "..tostring(index)..""
-		.." n:"..tostring(res.char_name)..""
-		.." s:"..tostring(res.server)..""
-		.." ss:"..tostring(res.same_realm)..""
-		.." ms:"..tostring(res.merge_realm)..""
-		.." f:"..tostring(res.faction)..""
-		.." if:"..tostring(res.ignore_faction)..""
-		.." sf:"..tostring(res.same_faction)..""
-		.." show:"..tostring(res.show_toon)..""
-		.." gold:"..tostring(res.gold)..""
-		Titan_Debug.Out('gold', 'eval', str)
+			res.gold = toon_gold.gold
+
+			str = str
+				.. " n:" .. tostring(res.char_name) .. ""
+				.. " s:" .. tostring(res.server) .. ""
+				.. " ss:" .. tostring(res.same_realm) .. ""
+				.. " ms:" .. tostring(res.merge_realm) .. ""
+				.. " f:" .. tostring(res.faction) .. ""
+				.. " if:" .. tostring(res.ignore_faction) .. ""
+				.. " sf:" .. tostring(res.same_faction) .. ""
+				.. " show:" .. tostring(res.show_toon) .. ""
+				.. " gold:" .. tostring(res.gold) .. ""
+		end
 	end

+	Titan_Debug.Out('gold', 'eval', str)
+
 	return res
 end
-
 ---local Helper for TotalGold
 --- If toon is to be shown add amount to total; otherwise pass back running total
 local function ToonAdd(show, amount, total)
diff --git a/TitanPost/TitanPost.lua b/TitanPost/TitanPost.lua
index 000103c..293919c 100644
--- a/TitanPost/TitanPost.lua
+++ b/TitanPost/TitanPost.lua
@@ -178,6 +178,8 @@ local function CheckExpiry()

 	local str = ""

+	local now = _G.time()
+
 	str = "CheckExpiry"
 		.. " @ " .. FormatTS(expiry_check, true)
 		.. " (" .. tostring(expiry_check) .. ")"
@@ -195,13 +197,19 @@ local function CheckExpiry()
 				.. " < " .. tostring(expiry_check) .. ""
 				.. " = " .. tostring((pdata.nextExpiry < expiry_check)) .. ""
 			Titan_Debug.Out('post', 'expiry_flow', str)
-			if (pdata.nextExpiry < expiry_check) then -- add to list for user
-				has_expiry = true

-				local estr = ShowExpiry(toon_name, pdata)
+			if (pdata.nextExpiry < expiry_check) then
+				if (pdata.nextExpiry < now) then
+					-- ignore, too late...
+				else
+					-- add to list for user
+					has_expiry = true

-				exp_str = exp_str .. estr
-				expiry_toons = expiry_toons + 1 -- count the number of toons with expiring mail
+					local estr = ShowExpiry(toon_name, pdata)
+
+					exp_str = exp_str .. estr
+					expiry_toons = expiry_toons + 1 -- count the number of toons with expiring mail
+				end
 			else
 				-- still time
 			end
@@ -226,7 +234,6 @@ local function CheckExpiry()

 	return expiry_toons, res
 end
-
 local expiry_timer = nil
 function ExpiryTimer(action) -- prior declaration
 	if action == 'start' then