diff --git a/Titan/Titan.lua b/Titan/Titan.lua index 282f22a..da6ca44 100644 --- a/Titan/Titan.lua +++ b/Titan/Titan.lua @@ -292,6 +292,41 @@ local function RegisterAddonCompartment() end end +local function SetToonInfo(toon) + -- New Dec 2025 Collect some toon info for profile display + -- Unlikely to change on reload but... + local toon_info = TitanSettings.Players[toon].Info + local unit = "player" + + local classFilename, classId = UnitClassBase(unit) + local localizedClassName, classFile, classID = GetClassInfo(classId) + toon_info.class = localizedClassName + toon_info.classId = classID + + local englishFaction, localizedFaction = UnitFactionGroup(unit) + toon_info.faction = localizedFaction + toon_info.factionId = englishFaction + + local level = UnitLevel(unit) + toon_info.level = level + toon_info.levelText = tostring(level) + + local localizedRaceName, englishRaceName, raceID = UnitRace(unit) + toon_info.race = localizedRaceName + toon_info.raceId = raceID +end + +local function SetToonLogout(toon) + -- New Dec 2025 Collect some toon info for profile display + -- Unlikely to change on reload but... + local toon_info = TitanSettings.Players[toon].Info + local unit = "player" + + local now = _G.time() + toon_info.logout = now + toon_info.logoutStr = TitanUtils_GetDateText(now, true) +end + ---Titan Do all the setup needed when a user logs in / reload UI / enter or leave an instance. --- This is called after the 'player entering world' event is fired by Blizz. --- This is also called when a LDB plugin is created after Titan runs the 'player entering world' code. @@ -309,7 +344,8 @@ function TitanPanel_PlayerEnteringWorld(reload) Titan_Debug.Out('titan', 'p_e_w', "Init settings") -- Get Saved Vars; sync with defaults - TitanVariables_InitTitanSettings(); + TitanVariables_InitTitanSettings() + if TitanAllGetVar("Silenced") then -- No header output else @@ -369,6 +405,8 @@ function TitanPanel_PlayerEnteringWorld(reload) local _ = nil TitanSettings.Player, _, _ = TitanUtils_GetPlayer() + SetToonInfo(TitanSettings.Player) + -- Some addons wait to create their LDB component or a Titan addon could -- create additional buttons as needed. Titan_Debug.Out('titan', 'p_e_w', "Register any plugins found") @@ -525,6 +563,8 @@ function TitanPanelBarButton:PLAYER_LOGOUT() end --]] Titan__InitializedPEW = false + + SetToonLogout(TitanSettings.Player) end ---Titan Handle ZONE_CHANGED_INDOORS Hide Titan top bars if user requested to hide Top bar(s) in BG or arena diff --git a/Titan/TitanConfig.lua b/Titan/TitanConfig.lua index 5a67e09..f0179dc 100644 --- a/Titan/TitanConfig.lua +++ b/Titan/TitanConfig.lua @@ -18,25 +18,25 @@ local TitanSkinName, TitanSkinPath = "", ""; TITAN_PANEL_CONFIG = { topic = { - About = L["TITAN_PANEL"], - top = L["TITAN_PANEL_MENU_OPTIONS_BARS"], - globals = L["TITAN_PANEL_MENU_OPTIONS_BARS_ALL"], - plugins = L["TITAN_PANEL_MENU_PLUGINS"], - profiles = L["TITAN_PANEL_MENU_PROFILES"], - tooltips = L["TITAN_PANEL_MENU_OPTIONS_SHORT"], - scale = L["TITAN_PANEL_UISCALE_MENU_TEXT_SHORT"], - trans = L["TITAN_PANEL_TRANS_MENU_TEXT_SHORT"], - skins = L["TITAN_PANEL_MENU_TEXTURE_SETTINGS"], - skinscust = L["TITAN_PANEL_SKINS_OPTIONS_CUSTOM"], - extras = L["TITAN_PANEL_EXTRAS_SHORT"], - attempts = L["TITAN_PANEL_ATTEMPTS_SHORT"], - advanced = L["TITAN_PANEL_MENU_ADV"], - changes = L["TITAN_PANEL_MENU_CHANGE_HISTORY"], - slash = L["TITAN_PANEL_MENU_SLASH_COMMAND"], + About = L["TITAN_PANEL"], + top = L["TITAN_PANEL_MENU_OPTIONS_BARS"], + globals = L["TITAN_PANEL_MENU_OPTIONS_BARS_ALL"], + plugins = L["TITAN_PANEL_MENU_PLUGINS"], + profiles = L["TITAN_PANEL_MENU_PROFILES"], + tooltips = L["TITAN_PANEL_MENU_OPTIONS_SHORT"], + scale = L["TITAN_PANEL_UISCALE_MENU_TEXT_SHORT"], + trans = L["TITAN_PANEL_TRANS_MENU_TEXT_SHORT"], + skins = L["TITAN_PANEL_MENU_TEXTURE_SETTINGS"], + skinscust = L["TITAN_PANEL_SKINS_OPTIONS_CUSTOM"], + extras = L["TITAN_PANEL_EXTRAS_SHORT"], + attempts = L["TITAN_PANEL_ATTEMPTS_SHORT"], + advanced = L["TITAN_PANEL_MENU_ADV"], + changes = L["TITAN_PANEL_MENU_CHANGE_HISTORY"], + slash = L["TITAN_PANEL_MENU_SLASH_COMMAND"], -- help = L["TITAN_PANEL_MENU_HELP"], - help_list = "Help List", --L["TITAN_PANEL_MENU_HELP"], + help_list = "Help List", --L["TITAN_PANEL_MENU_HELP"], im_ex_port = "Import / Export", --L["TITAN_PANEL_MENU_HELP"], - adjust = "Frame Adjustment", + adjust = "Frame Adjustment", } } @@ -61,12 +61,6 @@ local function GetEmail() return TitanUtils_GetAddOnMetadata(TITAN_ID, "X-Email") or L["TITAN_PANEL_NA"]; end ---[[ not used -local function GetWebsite() - return TitanUtils_GetAddOnMetadata(TITAN_ID, "X-Website") or L["TITAN_PANEL_NA"]; -end ---]] - local function GetLicense() return TitanUtils_GetAddOnMetadata(TITAN_ID, "X-License") or L["TITAN_PANEL_NA"]; end @@ -75,46 +69,6 @@ local function GetDiscord() return TitanUtils_GetAddOnMetadata(TITAN_ID, "X-Discord") or L["TITAN_PANEL_NA"]; end --- helper functions - ---[[ local -NAME: AdjustPanelScale -DESC: Set the Tian bars and plugins to the selected scale then adjust other frames as needed. -VAR: scale - the scale the user has selected for Titan -OUT: None ---]] -local function AustPanelScale(scale) - Titan_AdjustScale() - - -- Adjust frame positions - TitanPanel_AdjustFrames(true, "AdjustPanelScale") -end - --- helper functions ---[[ local -NAME: TicketReload -DESC: When the user changes the option to adjust for the Blizz ticket frame the UI must be reloaded. Ask the user if they want to do it now. -VAR: None -OUT: None ---]] -local function TicketReload() - StaticPopupDialogs["TITAN_RELOAD"] = { - text = TitanUtils_GetNormalText(L["TITAN_PANEL_MENU_TITLE"]) .. "\n\n" - .. L["TITAN_PANEL_RELOAD"], - button1 = ACCEPT, - button2 = CANCEL, - OnAccept = function(self) - TitanPanelBarButton_ToggleScreenAdjust() - ReloadUI(); - end, - showAlert = 1, - timeout = 0, - whileDead = 1, - hideOnEscape = 1 - }; - StaticPopup_Show("TITAN_RELOAD"); -end - local function ScreenAdjustReload() if TitanPanelGetVar("ScreenAdjust") then -- if set then clear it - the screen will adjust @@ -138,6 +92,7 @@ local function ScreenAdjustReload() StaticPopup_Show("TITAN_RELOAD"); end end + local function AuxScreenAdjustReload() if TitanPanelGetVar("AuxScreenAdjust") then -- if set then clear it - the screen will adjust @@ -257,7 +212,6 @@ local titan_entry = { }, } } -------------- --============= Frame Adjust -- @@ -407,7 +361,6 @@ local function BuildAdj() TitanUpdateAdj(optionsAdjust.args, 1000) AceConfigRegistry:NotifyChange("Titan Panel Adjust") end -------------- --============= Bars -- @@ -843,7 +796,6 @@ local function BuildBars() TitanUpdateConfigBars(optionsBars.args, 1000) AceConfigRegistry:NotifyChange("Titan Panel Bars") end -------------- --============= Bars - All @@ -918,8 +870,6 @@ local function BuildBarsAll() AceConfigRegistry:NotifyChange("Titan Panel Globals") end -------------- - --============= Plugins ---The plugin controls will be added here. @@ -1316,7 +1266,6 @@ local function UpdateConfigAddons() -- Config Tables changed! AceConfigRegistry:NotifyChange("Titan Panel Addon Control") end -------------- --============= Profiles @@ -1330,14 +1279,14 @@ local optionsChars = { local function SummaryText(profile) local res = "" - if profile.ptype == Titan_Global.profile.GLOBAL then - res = L["TITAN_PANEL_GLOBAL"].." : "..profile.cname - elseif profile.ptype == Titan_Global.profile.SYNC then - res = L["TITAN_PANEL_MENU_PROFILE_SYNC"].." : "..profile.cname - elseif profile.ptype == Titan_Global.profile.TOON then - res = L["TITAN_PANEL_MENU_PROFILE_CHARS"].." : "..Titan_Global.profile.NONE + if profile.ptype == Titan_Global.profile.GLOBAL then + res = L["TITAN_PANEL_GLOBAL"] .. " : " .. profile.cname + elseif profile.ptype == Titan_Global.profile.SYNC then + res = L["TITAN_PANEL_MENU_PROFILE_SYNC"] .. " : " .. profile.cname + elseif profile.ptype == Titan_Global.profile.TOON then + res = L["TITAN_PANEL_MENU_PROFILE_CHARS"] .. " : " .. Titan_Global.profile.NONE else - res = "?".." : "..Titan_Global.profile.NONE + res = "?" .. " : " .. Titan_Global.profile.NONE end return res @@ -1346,33 +1295,26 @@ end local function EndProfileText(profile) local res = "" - if profile.ptype == Titan_Global.profile.GLOBAL then - res = " : "..profile.cname - elseif profile.ptype == Titan_Global.profile.SYNC then - res = " : "..profile.cname - elseif profile.ptype == Titan_Global.profile.TOON then - res = " : "..Titan_Global.profile.NONE + if profile.ptype == Titan_Global.profile.GLOBAL then + res = " : " .. profile.cname + elseif profile.ptype == Titan_Global.profile.SYNC then + res = " : " .. profile.cname + elseif profile.ptype == Titan_Global.profile.TOON then + res = " : " .. Titan_Global.profile.NONE else - res = " : ?"..Titan_Global.profile.NONE + res = " : ?" .. Titan_Global.profile.NONE end return res end --- These are here so the config function can see them (not sure this works...). -local players = {} -- used for left side list of profiles -local p_info = {} -- used to hold info about each toon in players -local p_sync = {} -- profiles used as Sync - ---Allow the user to load / delete / reset / sync profile data local function TitanUpdateChars() - players = {} -- used for left side list of profiles - p_info = {} -- used to hold info about each toon in players - p_sync = {} -- profiles used as Sync + local p_info = {} -- used to hold info about each toon in players + local p_sync = {} -- profiles used as Sync -- Rip through the players (with server name) to sort them for index, id in pairs(TitanSettings.Players) do - table.insert(players, index); -- collect some info on THIS toon for the config local this_toon = {} @@ -1392,7 +1334,7 @@ local function TitanUpdateChars() this_toon.name = index this_toon.profile = TitanVariables_GetProfile(index) this_toon.summary = SummaryText(this_toon.profile) - this_toon.toon_header = this_toon.fancy_name..EndProfileText(this_toon.profile) + this_toon.toon_header = this_toon.fancy_name .. EndProfileText(this_toon.profile) this_toon.is_player = (index == TitanUtils_GetPlayer()) this_toon.sync_set = not (id.Panel["SyncWithProfile"] == Titan_Global.profile.NONE) this_toon.sync_name = id.Panel["SyncWithProfile"] @@ -1400,14 +1342,14 @@ local function TitanUpdateChars() p_sync[this_toon.sync_name] = this_toon.sync_set end - --Ace or Blizz sorts the toons... - -- table.sort(players, function(a, b) - -- return a < b - -- end) - + --Sort the toons... + table.sort(p_info, function(a, b) + return a.name < b.name + end) -- set up the options for the user local args = optionsChars.args + local position = 100 wipe(args) @@ -1427,9 +1369,8 @@ local function TitanUpdateChars() cmdHidden = true } - for idx = 1, #players do + for idx = 1, #p_info do local this_toon = p_info[idx] - local position = 100 -- Check for global profile being set local g_sync = (this_toon.profile.ptype == Titan_Global.profile.GLOBAL) @@ -1440,460 +1381,502 @@ local function TitanUpdateChars() order = position, args = {} } - local p_args = args[this_toon.name].args -- shartcut + local p_args = args[this_toon.name].args -- shortcut for right side -- assemble the profile section position = position + 1 p_args.name = { type = "header", - name = TitanUtils_GetGoldText(this_toon.toon_header or "?") , - cmdHidden = true, - order = position, - } - position = position + 1 - p_args.sp_1 = { - type = "description", - name = "", - cmdHidden = true, - order = position, - } - position = position + 1 - local l_reason = "" - if g_sync then - l_reason = "Sync All set" - elseif this_toon.is_player then - l_reason = L["TITAN_PANEL_MENU_LOAD_SETTINGS_ERR1"] - else - l_reason = "." - end - p_args.optionload = { - name = L["TITAN_PANEL_MENU_LOAD_SETTINGS"], - desc = L["TITAN_PANEL_MENU_LOAD_SETTINGS_DESC"], - order = position, - type = "execute", - -- width = "0.4", - func = function(info, v) - TitanVariables_UseSettings(info[1], TitanUtils_GetPlayer(), TITAN_PROFILE_USE) - TitanPrint( - L["TITAN_PANEL_MENU_LOAD_SETTINGS"] - .. " > " .. info[1].. "" - , "info") - end, - -- does not make sense to load current character profile - disabled = (this_toon.is_player or g_sync), - } - position = position + 1 - local del_reason = "" - if g_sync then - del_reason = "" -- set above - elseif p_sync[this_toon.name] then - del_reason = L["TITAN_PANEL_MENU_PROFILE_DELETE_SETTINGS_ERR1"] - elseif this_toon.is_player then - del_reason = L["TITAN_PANEL_MENU_PROFILE_DELETE_SETTINGS_ERR2"] - else - del_reason = "" - end - p_args.optiondelete = { - name = L["TITAN_PANEL_MENU_PROFILE_DELETE_SETTINGS"], - desc = L["TITAN_PANEL_MENU_PROFILE_DELETE_SETTINGS_DESC"], - order = position, - type = "execute", - -- width = "0.4", - func = function(info, v) - TitanSettings.Players[info[1]] = nil -- delete the entry - TitanPrint( - L["TITAN_PANEL_MENU_PROFILE"] - .. " " .. info[1].. " " - .. L["TITAN_PANEL_MENU_PROFILE_DELETED"] - , "info") - TitanUpdateChars() -- rebuild the toons - AceConfigRegistry:NotifyChange("Titan Panel Addon Chars") - end, - -- can not delete current character profile - disabled = (this_toon.is_player - or g_sync - or p_sync[this_toon.name]), - } - position = position + 1 - p_args.sp_30 = { - type = "description", - name = " "..TitanUtils_GetHexText(l_reason, Titan_Global.colors.orange).."\n", - cmdHidden = true, - order = position, - } - p_args.sp_31 = { - type = "description", - name = " "..TitanUtils_GetHexText(del_reason, Titan_Global.colors.orange).."\n", - cmdHidden = true, - order = position, - } - position = position + 1 - p_args.sp_35 = { - type = "description", - name = "\n", - cmdHidden = true, - order = position, - } - position = position + 1 - p_args.reset_this = { - --name = L["TITAN_PANEL_MENU_PROFILE_RESET"].." : "..this_toon.profile.cname, -- - --desc = L["TITAN_PANEL_MENU_PROFILE_RESET_DESC"], - name = "Reset Profile in Use", -- - desc = "Will reset".." : "..this_toon.profile.cname, - order = position, - type = "execute", - --width = "1.0", - func = function(info, v) - local selected = info[1] - local str = "" - str = str - .. " " .. tostring(selected) .. "" - .. " > '" .. tostring(this_toon.profile.cname) .. "'" - .. " : '" .. tostring(TITAN_PROFILE_RESET) .. "'" --- .. " | '" .. tostring(p_info[info[1]].is_player) .. "'" - - Titan_Debug.Out('titan', 'profile', str) - - -- Disabled if not current toon, otherwise it gets way complicated... - TitanVariables_UseSettings(nil, TitanUtils_GetPlayer(), TITAN_PROFILE_RESET) - - TitanPrint( - L["TITAN_PANEL_MENU_PROFILE_RESET"] - .. " "..selected - , "info") - - TitanUpdateChars() - AceConfigRegistry:NotifyChange("Titan Panel Addon Chars") - end, - disabled = not (this_toon.is_player), - } - position = position + 1 - p_args[tostring(position)] = { - type = "description", - name = " ", - cmdHidden = true, - order = position, - } - position = position + 1 - p_args.optionsave = { - order = position, - type = "execute", - -- width = "0.5", - name = L["TITAN_PANEL_MENU_PROFILE_SAVE"] .. " " .. L["TITAN_PANEL_MENU_PROFILE_CUSTOM"], - desc = L["TITAN_PANEL_MENU_PROFILE_SAVE_DESC"], - func = function(info, v) - TitanPanel_SaveCustomProfile(info[1]) -- will output message on write - TitanUpdateChars() -- rebuild the toons - end, - } - position = position + 1 - p_args[tostring(position)] = { - type = "description", - name = " ", - cmdHidden = true, - order = position, - } - position = position + 1 - p_args.sync_title = { - type = "header", - name = TitanUtils_GetGoldText("Sync"), + name = TitanUtils_GetGoldText(this_toon.toon_header or "?"), cmdHidden = true, order = position, } - position = position + 1 - local s_reason = "" - if g_sync then - s_reason = "" -- set above - elseif this_toon.sync_set then - s_reason = L["TITAN_PANEL_MENU_PROFILE_SYNC_ERR1"] - elseif this_toon.is_player then - s_reason = L["TITAN_PANEL_MENU_PROFILE_SYNC_ERR2"] - else - s_reason = "" -- no error - end - p_args.sync_with = { - name = L["TITAN_PANEL_MENU_PROFILE_SYNC"], - desc = L["TITAN_PANEL_MENU_PROFILE_SYNC_DESC"], - order = position, - type = "execute", - --width = "full", - func = function(info, v) - local str = "" - TitanVariables_SetProfile(TitanUtils_GetPlayer(), Titan_Global.profile.SYNC, info[1]) - str = str - .. " " .. tostring(Titan_Global.profile.SYNC) .. "" - .. " > '" .. tostring(info[1]) .. "'" - .. " : '" .. tostring(TITAN_PROFILE_USE) .. "'" - - Titan_Debug.Out('titan', 'profile', str) - TitanPrint("" - .. "" .. L["TITAN_PANEL_MENU_PROFILE_SYNC"] .. "" - .. " '" .. TitanUtils_GetPlayer() .. "'" - .. " > '" .. tostring(info[1]) .. "'" - , "info") - - -- Change over to new profile --- TitanVariables_UseSettings(nil, info[1], TITAN_PROFILE_USE) - TitanVariables_UseSettings(nil, TitanUtils_GetPlayer(), TITAN_PROFILE_USE) - TitanUpdateChars() - AceConfigRegistry:NotifyChange("Titan Panel Addon Chars") - end, - -- cannot sync to yourself or if sync already set - disabled = (this_toon.is_player or this_toon.sync_set or g_sync), - } - position = position + 1 - p_args.sync_clear = { - name = L["TITAN_PANEL_MENU_PROFILE_CLEAR_SYNC"], - desc = L["TITAN_PANEL_MENU_PROFILE_CLEAR_SYNC_DESC"], - order = position, - type = "execute", - func = function(info, v) - local str = "" - TitanVariables_SetProfile(info[1], Titan_Global.profile.SYNC, Titan_Global.profile.NONE) - str = str - .. " " .. tostring(Titan_Global.profile.SYNC) .. "" - .. " > '" .. tostring(info[1]) .. "'" - .. " : '" .. tostring(Titan_Global.profile.NONE) .. "'" - .. " | '" .. tostring(info[1] == TitanUtils_GetPlayer()) .. "'" - - Titan_Debug.Out('titan', 'profile', str) - - if info[1] == TitanUtils_GetPlayer() then - -- Change over to new profile - TitanVariables_UseSettings(nil, TitanUtils_GetPlayer(), TITAN_PROFILE_USE) + + do -- toon info + local toon = this_toon.name + if TitanSettings.Players[toon].Info then -- display + local itoon = TitanSettings.Players[toon].Info + local logout = (itoon.logoutStr == nil) and L["TITAN_PANEL_NA"] or itoon.logoutStr + position = position + 1 + p_args[tostring(position)] = { + type = "description", + name = "Last Logout : "..logout, + --width = "0.5", + cmdHidden = true, + order = position, + } + position = position + 1 + p_args[tostring(position)] = { + type = "description", + name = "Level : "..itoon.levelText, + width = "0.5", + cmdHidden = true, + order = position, + } + position = position + 1 + p_args[tostring(position)] = { + type = "description", + name = "Faction : "..itoon.faction, + width = "0.5", + cmdHidden = true, + order = position, + } + position = position + 1 + p_args[tostring(position)] = { + type = "description", + name = "Class : "..itoon.class, + width = "0.5", + cmdHidden = true, + order = position, + } + position = position + 1 + p_args[tostring(position)] = { + type = "description", + name = "Race : "..itoon.race, + width = "0.5", + cmdHidden = true, + order = position, + } + else -- NA + position = position + 1 + p_args[tostring(position)] = { + type = "description", + name = "Last Logout : "..L["TITAN_PANEL_NA"], + cmdHidden = true, + order = position, + } + end + + --=== Gold on toon, not guild or warbank + position = position + 1 + p_args[tostring(position)] = { + type = "description", + name = "", + cmdHidden = true, + order = position, + } + + local gold_str = "" + local gold_button = TitanUtils_GetButton("Gold") + if gold_button and gold_button:IsShown() then + -- It is enabled + if this_toon.is_custom then + -- can not log in to custom so NA + gold_str = "Gold : "..L["TITAN_PANEL_NA"] else - -- Not this toon + local name, server = TitanUtils_ParseName(this_toon.name) + local faction = UnitFactionGroup("Player") + gold_str = tostring(TitanPanel_GoldGetGold(name, server, faction)) end + else + -- not enabled + gold_str = "Gold : "..L["TITAN_PANEL_MENU_DISABLED"] + end - TitanPrint("" - .. "" .. L["TITAN_PANEL_MENU_PROFILE_CLEAR_SYNC"] .. "" - .. " '" .. tostring(info[1]) .. "'" - , "info") + position = position + 1 + p_args[tostring(position)] = { + name = gold_str, + order = position, + type = "description", + } + end - TitanUpdateChars() - AceConfigRegistry:NotifyChange("Titan Panel Addon Chars") - end, - disabled = (not this_toon.sync_set) or g_sync, - } - position = position + 1 - p_args[tostring(position)] = { - type = "description", - name = " "..TitanUtils_GetHexText(s_reason, Titan_Global.colors.orange).."\n", - cmdHidden = true, - order = position, - } - position = position + 1 - p_args[tostring(position)] = { - type = "description", - name = " ",--..TitanUtils_GetHexText(cs_reason, Titan_Global.colors.orange).."\n", - cmdHidden = true, - order = position, - } + do -- profile Mail + position = position + 1 + p_args[tostring(position)] = { + type = "description", + name = "", + cmdHidden = true, + order = position, + } - --==== - --==== Global section - position = position + 1 - p_args.sync_all_title = { - type = "header", - name = TitanUtils_GetGoldText("Global"), - cmdHidden = true, - order = position, - } - position = position + 1 - p_args.sync_all_with = { - name = "Sync All", --L["TITAN_PANEL_MENU_PROFILE_SYNC"], - desc = "Sync every toon to this profile", --L["TITAN_PANEL_MENU_PROFILE_SYNC_DESC"], - order = position, - type = "execute", - --width = "full", - func = function(info, v) - local str = "" - TitanVariables_SetProfile(TitanUtils_GetPlayer(), Titan_Global.profile.GLOBAL, info[1]) - str = str - .. " " .. tostring(Titan_Global.profile.GLOBAL) .. "" - .. " > '" .. tostring(info[1]) .. "'" - .. " : '" .. tostring(TITAN_PROFILE_USE) .. "'" - - Titan_Debug.Out('titan', 'profile', str) - - TitanPrint("" - .. "" .. "Sync All" .. "" - .. " > '" .. tostring(info[1]) .. "'" - , "info") - - -- Change over to new profile - TitanVariables_UseSettings(nil, TitanUtils_GetPlayer(), TITAN_PROFILE_USE) - TitanUpdateChars() - AceConfigRegistry:NotifyChange("Titan Panel Addon Chars") - end, - -- Can allows set global sync - --disabled = this_toon.is_player or this_toon.sync_set, - } - position = position + 1 - p_args.sync_all_clear = { - name = "Clear Sync All", --L["TITAN_PANEL_MENU_PROFILE_CLEAR_SYNC"], - desc = "Revert to each toon's settings", --L["TITAN_PANEL_MENU_PROFILE_CLEAR_SYNC_DESC"], - order = position, - type = "execute", - func = function(info, v) - local str = "" - TitanVariables_SetProfile(TitanUtils_GetPlayer(), Titan_Global.profile.GLOBAL, Titan_Global.profile.NONE) - str = str - .. " " .. tostring(Titan_Global.profile.GLOBAL) .. "" - .. " : '" .. tostring(Titan_Global.profile.NONE) .. "'" - Titan_Debug.Out('titan', 'profile', str) - - TitanPrint("" - .. "" .. "Clear Sync All" .. "" - .. " > '" .. tostring(info[1]) .. "'" - , "info") - - -- Change over to new profile - TitanVariables_UseSettings(nil, TitanUtils_GetPlayer(), TITAN_PROFILE_USE) - - TitanUpdateChars() - AceConfigRegistry:NotifyChange("Titan Panel Addon Chars") - end, - disabled = (not g_sync), - } - --[[ - position = position + 1 - p_args.reset_all_this = { - name = "Reset Global Profile", --L["TITAN_PANEL_MENU_PROFILE_RESET"], -- - desc = "Reset Global Profile to Defaults", --L["TITAN_PANEL_MENU_PROFILE_RESET_DESC"], - order = position, - type = "execute", - -- width = "0.5", - func = function(info, v) - local g_name = TitanPanelGetVar("GlobalProfileName") - local str = "" - str = str - .. " " .. tostring(Titan_Global.profile.TOON) .. "" - .. " > '" .. tostring(info[1]) .. "'" - .. " : '" .. tostring(TITAN_PROFILE_RESET) .. "'" - .. " | '" .. tostring(g_name) .. "'" - - Titan_Debug.Out('titan', 'profile', str) - - -- Reset the global profile --- TitanSettings.Players[g_name] = nil - - -- Change to new profile - TitanVariables_UseSettings(nil, TitanUtils_GetPlayer(), TITAN_PROFILE_RESET) - - TitanUpdateChars() - AceConfigRegistry:NotifyChange("Titan Panel Addon Chars") - end, - disabled = (not g_sync), - } - --]] - --[[ - position = position + 1 - p_args[tostring(position)] = { - type = "description", - name = " ",--..TitanUtils_GetHexText(cs_reason, Titan_Global.colors.orange).."\n", - cmdHidden = true, - order = position, - } - --]] - position = position + 1 - p_args[tostring(position)] = { - type = "description", - name = "", - cmdHidden = true, - order = position, - } + position = position + 1 + p_args[tostring(position)] = { + type = "header", + name = TitanUtils_GetGoldText("TitanPost"), + cmdHidden = true, + order = position, + } - position = position + 1 - p_args[tostring(position)] = { - type = "header", - name = TitanUtils_GetGoldText("TitanPost"), - cmdHidden = true, - order = position, - } + local post_str = "" + local post_button = TitanUtils_GetButton("Post") + if post_button and post_button:IsShown() then + -- Is enabled + if this_toon.is_custom then + -- can not log in to custom so NA + post_str = L["TITAN_PANEL_NA"] + else + post_str = TitanPost.GetMailInfo(this_toon.name) + end + else + -- not enabled + post_str = L["TITAN_PANEL_MENU_DISABLED"] + end + + position = position + 1 + p_args.mailClear = { + name = "Clear", --L["TITAN_PANEL_MENU_LOAD_SETTINGS"], + desc = "Clear Mail info for this toon", + order = position, + type = "execute", + func = function(info, v) + TitanPost.ClearMailInfo(info[1]) + TitanPrint( + "Clear Mail info" + .. " > " .. info[1] .. "" + , "info") + AceConfigRegistry:NotifyChange("Titan Panel Addon Chars") + end, + -- Should be able to clear any specific toon info + --disabled = (this_toon.is_player or g_sync), + } - local post_str = "" - local post_button = TitanUtils_GetButton("Post") - if post_button and post_button:IsShown() then - -- It is enabled - if this_toon.is_custom then - -- can not log in to custom so NA - post_str = L["TITAN_PANEL_NA"] + position = position + 1 + p_args[tostring(position)] = { + name = post_str, + order = position, + type = "description", + } + position = position + 1 + p_args[tostring(position)] = { + type = "description", + name = "", + cmdHidden = true, + order = position, + } + end + + do -- profile load / delete + position = position + 1 + p_args.prof_title = { + type = "header", + name = TitanUtils_GetGoldText("Profile"), + cmdHidden = true, + order = position, + } + position = position + 1 + p_args.sp_1 = { + type = "description", + name = "", + cmdHidden = true, + order = position, + } + position = position + 1 + local l_reason = "" + if g_sync then + l_reason = "Sync All set" + elseif this_toon.is_player then + l_reason = L["TITAN_PANEL_MENU_LOAD_SETTINGS_ERR1"] else - post_str = TitanPost.GetMailInfo(this_toon.name) + l_reason = "." end - else - -- not enabled - post_str = L["TITAN_PANEL_MENU_DISABLED"] + p_args.optionload = { + name = L["TITAN_PANEL_MENU_LOAD_SETTINGS"], + desc = L["TITAN_PANEL_MENU_LOAD_SETTINGS_DESC"], + order = position, + type = "execute", + -- width = "0.4", + func = function(info, v) + TitanVariables_UseSettings(info[1], TitanUtils_GetPlayer(), TITAN_PROFILE_USE) + TitanPrint( + L["TITAN_PANEL_MENU_LOAD_SETTINGS"] + .. " > " .. info[1] .. "" + , "info") + end, + -- does not make sense to load current character profile + disabled = (this_toon.is_player or g_sync), + } + + position = position + 1 + local del_reason = "" + if g_sync then + del_reason = "" -- set above + elseif p_sync[this_toon.name] then + del_reason = L["TITAN_PANEL_MENU_PROFILE_DELETE_SETTINGS_ERR1"] + elseif this_toon.is_player then + del_reason = L["TITAN_PANEL_MENU_PROFILE_DELETE_SETTINGS_ERR2"] + else + del_reason = "" + end + + p_args.optiondelete = { + name = L["TITAN_PANEL_MENU_PROFILE_DELETE_SETTINGS"], + desc = L["TITAN_PANEL_MENU_PROFILE_DELETE_SETTINGS_DESC"], + order = position, + type = "execute", + -- width = "0.4", + func = function(info, v) + TitanSettings.Players[info[1]] = nil -- delete the entry + TitanPrint( + L["TITAN_PANEL_MENU_PROFILE"] + .. " " .. info[1] .. " " + .. L["TITAN_PANEL_MENU_PROFILE_DELETED"] + , "info") + TitanUpdateChars() -- rebuild the toons + AceConfigRegistry:NotifyChange("Titan Panel Addon Chars") + end, + -- can not delete current character profile + disabled = (this_toon.is_player + or g_sync + or p_sync[this_toon.name]), + } + position = position + 1 + p_args.sp_30 = { + type = "description", + name = " " .. TitanUtils_GetHexText(l_reason, Titan_Global.colors.orange) .. "\n", + cmdHidden = true, + order = position, + } + p_args.sp_31 = { + type = "description", + name = " " .. TitanUtils_GetHexText(del_reason, Titan_Global.colors.orange) .. "\n", + cmdHidden = true, + order = position, + } + position = position + 1 + p_args.sp_35 = { + type = "description", + name = "\n", + cmdHidden = true, + order = position, + } end - position = position + 1 - p_args[tostring(position)] = { - name = post_str, - order = position, - type = "description", - } - position = position + 1 - p_args[tostring(position)] = { - type = "description", - name = "", - cmdHidden = true, - order = position, - } + do -- profile reset + position = position + 1 + p_args.reset_this = { + --name = L["TITAN_PANEL_MENU_PROFILE_RESET"].." : "..this_toon.profile.cname, -- + --desc = L["TITAN_PANEL_MENU_PROFILE_RESET_DESC"], + name = "Reset Profile in Use", -- + desc = "Will reset" .. " : " .. this_toon.profile.cname, + order = position, + type = "execute", + --width = "1.0", + func = function(info, v) + local selected = info[1] + local str = "" + str = str + .. " " .. tostring(selected) .. "" + .. " > '" .. tostring(this_toon.profile.cname) .. "'" + .. " : '" .. tostring(TITAN_PROFILE_RESET) .. "'" + + Titan_Debug.Out('titan', 'profile', str) + + -- Disabled if not current toon, otherwise it gets way complicated... + TitanVariables_UseSettings(nil, TitanUtils_GetPlayer(), TITAN_PROFILE_RESET) + + TitanPrint( + L["TITAN_PANEL_MENU_PROFILE_RESET"] + .. " " .. selected + , "info") + + TitanUpdateChars() + AceConfigRegistry:NotifyChange("Titan Panel Addon Chars") + end, + disabled = not (this_toon.is_player), + } + position = position + 1 + p_args[tostring(position)] = { + type = "description", + name = " ", + cmdHidden = true, + order = position, + } + end - position = position + 1 - p_args[tostring(position)] = { - type = "header", - name = TitanUtils_GetGoldText("TitanGold"), - cmdHidden = true, - order = position, - } + do -- profile save as + position = position + 1 + p_args.optionsave = { + order = position, + type = "execute", + name = L["TITAN_PANEL_MENU_PROFILE_SAVE"] .. " " .. L["TITAN_PANEL_MENU_PROFILE_CUSTOM"], + desc = L["TITAN_PANEL_MENU_PROFILE_SAVE_DESC"], + func = function(info, v) + TitanPanel_SaveCustomProfile(info[1]) -- will output message on write + TitanUpdateChars() -- rebuild the toons + end, + } + position = position + 1 + p_args[tostring(position)] = { + type = "description", + name = " ", + cmdHidden = true, + order = position, + } + end - local gold_str = "" - local gold_button = TitanUtils_GetButton("Gold") - if gold_button and gold_button:IsShown() then - -- It is enabled - if this_toon.is_custom then - -- can not log in to custom so NA - gold_str = L["TITAN_PANEL_NA"] + do -- profile Sync + position = position + 1 + p_args.sync_title = { + type = "header", + name = TitanUtils_GetGoldText("Sync"), + cmdHidden = true, + order = position, + } + position = position + 1 + local s_reason = "" + if g_sync then + s_reason = "" -- set above + elseif this_toon.sync_set then + s_reason = L["TITAN_PANEL_MENU_PROFILE_SYNC_ERR1"] + elseif this_toon.is_player then + s_reason = L["TITAN_PANEL_MENU_PROFILE_SYNC_ERR2"] else - local name, server = TitanUtils_ParseName(this_toon.name) - local faction = UnitFactionGroup("Player") - gold_str = tostring(TitanPanel_GoldGetGold(name, server, faction)) + s_reason = "" -- no error end - else - -- not enabled - gold_str = L["TITAN_PANEL_MENU_DISABLED"] + p_args.sync_with = { + name = L["TITAN_PANEL_MENU_PROFILE_SYNC"], + desc = L["TITAN_PANEL_MENU_PROFILE_SYNC_DESC"], + order = position, + type = "execute", + --width = "full", + func = function(info, v) + local str = "" + TitanVariables_SetProfile(TitanUtils_GetPlayer(), Titan_Global.profile.SYNC, info[1]) + str = str + .. " " .. tostring(Titan_Global.profile.SYNC) .. "" + .. " > '" .. tostring(info[1]) .. "'" + .. " : '" .. tostring(TITAN_PROFILE_USE) .. "'" + + Titan_Debug.Out('titan', 'profile', str) + TitanPrint("" + .. "" .. L["TITAN_PANEL_MENU_PROFILE_SYNC"] .. "" + .. " '" .. TitanUtils_GetPlayer() .. "'" + .. " > '" .. tostring(info[1]) .. "'" + , "info") + + -- Change over to new profile + -- TitanVariables_UseSettings(nil, info[1], TITAN_PROFILE_USE) + TitanVariables_UseSettings(nil, TitanUtils_GetPlayer(), TITAN_PROFILE_USE) + TitanUpdateChars() + AceConfigRegistry:NotifyChange("Titan Panel Addon Chars") + end, + -- cannot sync to yourself or if sync already set + disabled = (this_toon.is_player or this_toon.sync_set or g_sync), + } + + position = position + 1 + p_args.sync_clear = { + name = L["TITAN_PANEL_MENU_PROFILE_CLEAR_SYNC"], + desc = L["TITAN_PANEL_MENU_PROFILE_CLEAR_SYNC_DESC"], + order = position, + type = "execute", + func = function(info, v) + local str = "" + TitanVariables_SetProfile(info[1], Titan_Global.profile.SYNC, Titan_Global.profile.NONE) + str = str + .. " " .. tostring(Titan_Global.profile.SYNC) .. "" + .. " > '" .. tostring(info[1]) .. "'" + .. " : '" .. tostring(Titan_Global.profile.NONE) .. "'" + .. " | '" .. tostring(info[1] == TitanUtils_GetPlayer()) .. "'" + + Titan_Debug.Out('titan', 'profile', str) + + if info[1] == TitanUtils_GetPlayer() then + -- Change over to new profile + TitanVariables_UseSettings(nil, TitanUtils_GetPlayer(), TITAN_PROFILE_USE) + else + -- Not this toon + end + + TitanPrint("" + .. "" .. L["TITAN_PANEL_MENU_PROFILE_CLEAR_SYNC"] .. "" + .. " '" .. tostring(info[1]) .. "'" + , "info") + + TitanUpdateChars() + AceConfigRegistry:NotifyChange("Titan Panel Addon Chars") + end, + disabled = (not this_toon.sync_set) or g_sync, + } + position = position + 1 + p_args[tostring(position)] = { + type = "description", + name = " " .. TitanUtils_GetHexText(s_reason, Titan_Global.colors.orange) .. "\n", + cmdHidden = true, + order = position, + } + position = position + 1 + p_args[tostring(position)] = { + type = "description", + name = " ", --..TitanUtils_GetHexText(cs_reason, Titan_Global.colors.orange).."\n", + cmdHidden = true, + order = position, + } + end + + do -- profile global + position = position + 1 + p_args.sync_all_title = { + type = "header", + name = TitanUtils_GetGoldText("Global"), + cmdHidden = true, + order = position, + } + position = position + 1 + p_args.sync_all_with = { + name = "Sync All", --L["TITAN_PANEL_MENU_PROFILE_SYNC"], + desc = "Sync every toon to this profile", --L["TITAN_PANEL_MENU_PROFILE_SYNC_DESC"], + order = position, + type = "execute", + --width = "full", + func = function(info, v) + local str = "" + TitanVariables_SetProfile(TitanUtils_GetPlayer(), Titan_Global.profile.GLOBAL, info[1]) + str = str + .. " " .. tostring(Titan_Global.profile.GLOBAL) .. "" + .. " > '" .. tostring(info[1]) .. "'" + .. " : '" .. tostring(TITAN_PROFILE_USE) .. "'" + + Titan_Debug.Out('titan', 'profile', str) + + TitanPrint("" + .. "" .. "Sync All" .. "" + .. " > '" .. tostring(info[1]) .. "'" + , "info") + + -- Change over to new profile + TitanVariables_UseSettings(nil, TitanUtils_GetPlayer(), TITAN_PROFILE_USE) + TitanUpdateChars() + AceConfigRegistry:NotifyChange("Titan Panel Addon Chars") + end, + -- Can allows set global sync + --disabled = this_toon.is_player or this_toon.sync_set, + } + position = position + 1 + p_args.sync_all_clear = { + name = "Clear Sync All", --L["TITAN_PANEL_MENU_PROFILE_CLEAR_SYNC"], + desc = "Revert to each toon's settings", --L["TITAN_PANEL_MENU_PROFILE_CLEAR_SYNC_DESC"], + order = position, + type = "execute", + func = function(info, v) + local str = "" + TitanVariables_SetProfile(TitanUtils_GetPlayer(), Titan_Global.profile.GLOBAL, + Titan_Global.profile.NONE) + str = str + .. " " .. tostring(Titan_Global.profile.GLOBAL) .. "" + .. " : '" .. tostring(Titan_Global.profile.NONE) .. "'" + Titan_Debug.Out('titan', 'profile', str) + + TitanPrint("" + .. "" .. "Clear Sync All" .. "" + .. " > '" .. tostring(info[1]) .. "'" + , "info") + + -- Change over to new profile + TitanVariables_UseSettings(nil, TitanUtils_GetPlayer(), TITAN_PROFILE_USE) + + TitanUpdateChars() + AceConfigRegistry:NotifyChange("Titan Panel Addon Chars") + end, + disabled = (not g_sync), + } end - position = position + 1 - p_args[tostring(position)] = { - name = gold_str, - order = position, - type = "description", - } ---[[ --==== - --==== Summary section - position = position + 1 - p_args.setting_title = { - type = "header", - name = TitanUtils_GetGoldText("-"), - cmdHidden = true, - order = position, - } - position = position + 1 - p_args.setting_sync = { - type = "description", - name = this_toon.summary, - cmdHidden = true, - order = position, - } ---]] -- tell the options screen there is a new list AceConfigRegistry:NotifyChange("Titan Panel Addon Chars") end end -------------- --============= Import / Export Profiles @@ -1909,13 +1892,13 @@ local import_str = "" -- hold import string ---Allow the user to load / delete / reset / sync profile data local function TitanToonList() local players = {} -- used for list of profiles - local export = {} -- used for selected profiles + local export = {} -- used for selected profiles local p_info = {} -- used to hold info about each toon in players -- Rip through the players (with server name) to sort them for index, id in pairs(TitanSettings.Players) do --- table.insert(players, {index = index}); --- table.insert(export, {index = false}); + -- table.insert(players, {index = index}); + -- table.insert(export, {index = false}); players[index] = index export[index] = false @@ -1937,20 +1920,19 @@ local function TitanToonList() this_toon.sync_set = not (id.Panel["SyncWithProfile"] == Titan_Global.profile.NONE) this_toon.sync_name = id.Panel["SyncWithProfile"] table.insert(p_info, this_toon) -- table index matches players table... - end --Ace or Blizz sorts the toons... -- table.sort(players, function(a, b) -- return a < b -- end) ---TitanDumpTable(players) ---TitanDumpTable(export) + --TitanDumpTable(players) + --TitanDumpTable(export) -- set up the options for the user local args = optionsImportExport.args wipe(args) local position = 100 ---[[ + --[[ local header = "" header = header .. L["TITAN_PANEL_CHARS_DESC"] .. "\n" @@ -1970,11 +1952,11 @@ local function TitanToonList() cmdHidden = true } local ex_desc = "" - .."To create a Titan Export : \n" - .."Select the toons you want to export. \n" - .."Click Export - Ignore the Accept button, it is part of the Ace lib.\n" - .."To copy the string from the Export box; Click in the Export box; Then control-A; Then control-C.\n" - .."Paste (control-V) the string somewhere safe. Ensure no stray characters will be added. \n" + .. "To create a Titan Export : \n" + .. "Select the toons you want to export. \n" + .. "Click Export - Ignore the Accept button, it is part of the Ace lib.\n" + .. "To copy the string from the Export box; Click in the Export box; Then control-A; Then control-C.\n" + .. "Paste (control-V) the string somewhere safe. Ensure no stray characters will be added. \n" position = position + 1 args["exportdesc"] = { order = position, @@ -1988,8 +1970,8 @@ local function TitanToonList() type = "multiselect", name = "", --"Export", --L["TITAN_PANEL_MENU_PROFILES"] .. "\n", desc = "", --"Select all the toons you want to export.", --L["TITAN_PANEL_MENU_PROFILES"] .. "\n", --- cmdHidden = true, --- style = "radio", + -- cmdHidden = true, + -- style = "radio", values = players, get = function(info, v) -- Get from list... @@ -2020,12 +2002,12 @@ local function TitanToonList() position = position + 1 args["export_cmd"] = { - name = "Export", --L["TITAN_PANEL_MENU_LOAD_SETTINGS"], + name = "Export", --L["TITAN_PANEL_MENU_LOAD_SETTINGS"], desc = "Export the selected toons", --L["TITAN_PANEL_MENU_LOAD_SETTINGS_DESC"], order = position, type = "execute", func = function(info, v) --- TitanDumpTable(export) + -- TitanDumpTable(export) export_str = TitanVariables_CreateExport(export, false) end, } @@ -2034,12 +2016,11 @@ local function TitanToonList() args["export_text"] = { order = position, type = "input", - name = "Export box", --L["TITAN_PANEL_MENU_PROFILES"] .. "\n", + name = "Export box", --L["TITAN_PANEL_MENU_PROFILES"] .. "\n", desc = "To copy the string; Click in the string; Then control-A; Then control-C", --L["TITAN_PANEL_MENU_PROFILES"] .. "\n", multiline = 10, width = 'full', get = function(info, v) - local str = "Export str get :" str = str .. " " .. tostring(v) .. "" @@ -2055,7 +2036,7 @@ local function TitanToonList() str = str .. " " .. tostring(v) .. "" .. " " .. tostring(string.len(export_str)) .. "" - .. " k'"..tostring(k).."'" + .. " k'" .. tostring(k) .. "'" Titan_Debug.Out('titan', 'profile', str) end, } @@ -2068,11 +2049,11 @@ local function TitanToonList() cmdHidden = true } local im_desc = "" - .."To Import a Titan export : \n" - .."Copy (control-C) the Titan Export from a safe source.\n" - .."Click in the Import box; Then control-A; then Paste (control-V).\n" - .."Click Accept to trigger the Import. The text will disappear!\n" - .."Click Import : If successful Titan will Reload to ensure the Import is saved and operational. \n" + .. "To Import a Titan export : \n" + .. "Copy (control-C) the Titan Export from a safe source.\n" + .. "Click in the Import box; Then control-A; then Paste (control-V).\n" + .. "Click Accept to trigger the Import. The text will disappear!\n" + .. "Click Import : If successful Titan will Reload to ensure the Import is saved and operational. \n" position = position + 1 args["importdesc"] = { order = position, @@ -2085,7 +2066,7 @@ local function TitanToonList() args["import_text"] = { order = position, type = "input", - name = "Import box", --L["TITAN_PANEL_MENU_PROFILES"] .. "\n", + name = "Import box", --L["TITAN_PANEL_MENU_PROFILES"] .. "\n", desc = "To copy the export string; Click in the box; Then control-V", --L["TITAN_PANEL_MENU_PROFILES"] .. "\n", width = 'full', multiline = 10, @@ -2105,13 +2086,13 @@ local function TitanToonList() str = str .. " " .. tostring(v) .. "" .. " " .. tostring(string.len(import_str)) .. "" - .. " k'"..tostring(k).."'" + .. " k'" .. tostring(k) .. "'" Titan_Debug.Out('titan', 'profile', str) end, } position = position + 1 args["import_cmd"] = { - name = "Import", --L["TITAN_PANEL_MENU_LOAD_SETTINGS"], + name = "Import", --L["TITAN_PANEL_MENU_LOAD_SETTINGS"], desc = "Import the Titan export in the input box.", --L["TITAN_PANEL_MENU_PROFILES"] .. "\n", order = position, type = "execute", @@ -2126,7 +2107,6 @@ local function TitanToonList() end, } end -------------- --============= Tooltips and Frames @@ -2265,7 +2245,6 @@ local optionsFrames = { }, } } -------------- --============= Scale and Font @@ -2469,7 +2448,6 @@ local optionsUIScale = { }, } } -------------- --============= Skins @@ -2582,13 +2560,6 @@ end --============= Skins - Custom ---[[ NOTE: -- Blizz *does not allow* LUA to access the user file system dynamically so the skins have to be input by hand. Titan can not search for available skins in the Artwork folder. -- On the flip side a user can add a custom skin to the Titan saved variables then later delete the skin from the file system. This will not cause an error when the user tries to use (show) that skin but Titan will show a 'blank' skin. -:NOTE ---]] - - ---Helper to add each skin to the options list. ---@param skinname string Shown to user ---@param skin_path string folder name of skin ONLY; prefix (Titan path) will be added @@ -2665,12 +2636,6 @@ local function Remove_Skin(skinname) TitanPrint(out_str, msg_type) end ---[[ NOTE -- You may not remove the currently used skin -- or the default one -- or a Titan default skin (it would only come back...) ---]] - ---hold the Titan custom skins options that allow a user to add or delete skins. local optionsSkinsCustom = { name = TITAN_PANEL_CONFIG.topic.skinscust, --L["TITAN_PANEL_SKINS_TITLE_CUSTOM"], @@ -2813,7 +2778,6 @@ local optionsSkinsCustom = { }, } } -------------- --============= Extras @@ -2823,14 +2787,6 @@ local optionsExtras = { args = {} } ---[[ NOTE: -- As users change the plugins they use the old ones still have saved variable data stored by Titan. -- The old plugin data can be removed by the user when they no longer use that plugin. -- This routine is called to 'redraw' the list as a user deletes data. -- A message is sent to chat that the plugin data has been deleted. ---]] - - ---Show plugins that are not registered (loaded) but have config data. The data can be deleted by the user. local function TitanUpdateExtras() local args = optionsExtras.args @@ -2891,16 +2847,16 @@ local optionsAddonAttempts = { args = {} } ----Show the each plugin that attempted to register with Titan. +---Show the each plugin that attempted to register with Titan. local function TitanUpdateAddonAttempts() local args = optionsAddonAttempts.args local plug_in = nil ---[[ NOTE: + --[[ NOTE: - This is called after the plugins are registered in the 'player entering world' event. It can be called again as plugins registered. - Any plugins that attempted to register are shown. See the Titan Utils section for more details on plugin registration. - This option page is for display only. The user can take not action. -- This can be used by plugin developers as the create / update plugins (Titan or LDB). +- This can be used by plugin developers as the create / update plugins (Titan or LDB). - It can also be used by user to attempt to figure out why a plugin is not shown or to report an issue to Titan. --]] @@ -3122,47 +3078,47 @@ local optionsAdvanced = { inline = true, order = 100, args = { - space_400_1 = { - order = 400, - type = "description", - name = " ", - cmdHidden = true, - }, - optionlaunchers = { - name = L["TITAN_PANEL_MENU_LDB_FORCE_LAUNCHER"], - order = 401, - type = "execute", - width = "full", - func = function() TitanPanelBarButton_ForceLDBLaunchersRight() end, - }, - space_500_1 = { - order = 500, - type = "description", - name = " ", - cmdHidden = true, - }, - pluginreset = { - name = L["TITAN_PANEL_MENU_PLUGIN_RESET"], - desc = L["TITAN_PANEL_MENU_PLUGIN_RESET_DESC"], - order = 501, - type = "execute", - width = "full", - func = function() TitanPanel_InitPanelButtons() end, - }, - space_600_1 = { - order = 600, - type = "description", - name = " ", - cmdHidden = true, - }, - optionreset = { - name = L["TITAN_PANEL_MENU_RESET"] .. " " - .. TitanUtils_GetGreenText(L["TITAN_PANEL_MENU_RELOADUI"]), - order = 601, - type = "execute", - width = "full", - func = function() TitanPanel_ResetTitanToDefault() end, - } + space_400_1 = { + order = 400, + type = "description", + name = " ", + cmdHidden = true, + }, + optionlaunchers = { + name = L["TITAN_PANEL_MENU_LDB_FORCE_LAUNCHER"], + order = 401, + type = "execute", + width = "full", + func = function() TitanPanelBarButton_ForceLDBLaunchersRight() end, + }, + space_500_1 = { + order = 500, + type = "description", + name = " ", + cmdHidden = true, + }, + pluginreset = { + name = L["TITAN_PANEL_MENU_PLUGIN_RESET"], + desc = L["TITAN_PANEL_MENU_PLUGIN_RESET_DESC"], + order = 501, + type = "execute", + width = "full", + func = function() TitanPanel_InitPanelButtons() end, + }, + space_600_1 = { + order = 600, + type = "description", + name = " ", + cmdHidden = true, + }, + optionreset = { + name = L["TITAN_PANEL_MENU_RESET"] .. " " + .. TitanUtils_GetGreenText(L["TITAN_PANEL_MENU_RELOADUI"]), + order = 601, + type = "execute", + width = "full", + func = function() TitanPanel_ResetTitanToDefault() end, + } }, }, }, @@ -3179,9 +3135,6 @@ local function BuildAdv() AceConfigRegistry:NotifyChange("Titan Panel Advanced") end -------------- - - --============= Change History ---Recent change history; stored in History.lua @@ -3225,7 +3178,7 @@ local function ParseHelp(topic) str = str .. TitanUtils_GetGoldText(stopic.sub .. " : \n") local lineout = "" for line = 1, #stopic.lines do -- Details - lineout = lineout .. stopic.lines[line].. " \n" + lineout = lineout .. stopic.lines[line] .. " \n" end str = str .. TitanUtils_GetHighlightText(lineout .. "\n") end @@ -3246,7 +3199,7 @@ local help_list_topics = { "Use one of the methods below:", "- Open the Titan menu; find the plugin in a category then click to toggle Show on the plugin.", "- Open Titan Configuration > Plugins then select the plugin by name then toggle Show. Use the Bar dropdown to select the Bar the plugin should be on.", - }, + }, }, { sub = "Moving Plugins", @@ -3263,7 +3216,7 @@ local help_list_topics = { "-- This honors right side setting.", "-- This honors 'force bar' such as auto hide 'pins'.", "-- If not over a bar, the plugin will return to the bar it came from at 'end'.", - }, + }, }, }, }, @@ -3278,14 +3231,14 @@ local help_list_topics = { "- Short bars are movable and have a changeable width.", "- The Titan menu shows the name of the Bar in the menu title.", "- All Bars can be shown or hidden from the Titan menu or Titan Config.", - }, + }, }, { sub = "Enable", lines = { "Open Titan > Configuration > Bars then select the Bar then select Show to show or deselect to hide.", "OR use Titan menu to Show or Hide each bar.", - }, + }, }, { sub = "Configure", @@ -3295,7 +3248,7 @@ local help_list_topics = { " ", "Notes: ", "- See Short Bars help on how to move and resize Short Bars. ", - }, + }, }, }, }, @@ -3305,12 +3258,12 @@ local help_list_topics = { { sub = "Overview", lines = { - "- Short bars are 10 shorter Titan bars that the user can place and change width.", - "- Short bars are independent and may be moved on the WoW UI.", - "- Titan does not restrict plugins to fit within the visible width (background).", - " Plugins can be assigned well beyond the visible bar. This may be desirable for some users.", - "- Setting a plugin to right-side will use the visible right side (background); and may overlap with left or center aligned plugins.", - }, + "- Short bars are 10 shorter Titan bars that the user can place and change width.", + "- Short bars are independent and may be moved on the WoW UI.", + "- Titan does not restrict plugins to fit within the visible width (background).", + " Plugins can be assigned well beyond the visible bar. This may be desirable for some users.", + "- Setting a plugin to right-side will use the visible right side (background); and may overlap with left or center aligned plugins.", + }, }, { sub = "Change Size", @@ -3318,7 +3271,7 @@ local help_list_topics = { "- Change width by 1 : Use Shift + mouse wheel.", "- Change width by 10: Use Shift + Ctrl + mouse wheel.", "- WIll not go beyond right side of screen.", - }, + }, }, { sub = "Move", @@ -3326,7 +3279,7 @@ local help_list_topics = { "- Use Shift + left mouse on Bar, not plugins, and drag.", "- When dragging, best to place your mouse over the left side padding before moving or changing width.", "- When dragging stops, if the Short Bar is beyond the screen edge the Short Bar should 'snap' to the edge.", - }, + }, }, { sub = "Reset", @@ -3334,7 +3287,7 @@ local help_list_topics = { "- In case a Short bar gets messed up, ", "-- use Titan > Config > Bar > then select the Bar", "-- then click Reset Position to place it at its default position and width.", - }, + }, }, { sub = "Limitations", @@ -3343,11 +3296,11 @@ local help_list_topics = { "- Max width : Screen width.", "- There is no 'snap together' or grid for placing Short Bars.", "- Can select Skin per Short bar BUT only the 'top' skin is used; some skins have a different top & bottom.", - }, + }, }, }, }, - { -- profiles + { -- profiles topic = L["TITAN_PANEL_MENU_PROFILES"], subs = { { @@ -3379,7 +3332,7 @@ local help_list_topics = { "- You may Clear Sync (remove) the current Sync being used by a profile.", "- Select the profile to use. Then click Clear Sync.", "- The settings prior to the Sync will be shown and can be changed.", - }, + }, }, { sub = "Sync All a profile", @@ -3395,14 +3348,14 @@ local help_list_topics = { lines = { "- Select the profile to use. Then click Clear Sync All.", "- The settings prior to the Sync All for all toons will be shown and can be changed.", - }, + }, }, { sub = "Load a Profile", lines = { "- Select the profile you want then click Load. The current profile is gray to prevent loading.", "- Load will COPY the profile over the logged in toon.", - }, + }, }, { sub = "Delete a Profile", @@ -3411,7 +3364,7 @@ local help_list_topics = { "- On delete the profile will disappear from the config profile list.", "- Delete of a profile should be done on a toon that was deleted from the game.", "- Delete can act as a Titan reset for that toon.", - }, + }, }, { sub = "Reset a Profile in Use", @@ -3419,7 +3372,7 @@ local help_list_topics = { "- The reset will be done on the profile in use - current, Sync, or Sync All profile.", "- On the current profile, it will just reset that profile.", "- On a profile using a Sync or Sync All profile, it will reset the Sync profile leaving the Sync relationships in place.", - }, + }, }, { sub = "Custom Profile", @@ -3436,7 +3389,7 @@ local help_list_topics = { }, }, }, - { -- export / import profiles + { -- export / import profiles topic = "Export / Import", --L["TITAN_PANEL_MENU_PROFILES"], subs = { { @@ -3530,32 +3483,32 @@ local help_list_topics = { { sub = "WoW structure", lines = { - "WoW is installed in different folders on Windows, iOS, or Linux.", - "It is installed as ../World of Warcraft/<version>/", - "Where <version> can be _retail_ | _classic_ | _classic_era_ | etc.", + "WoW is installed in different folders on Windows, iOS, or Linux.", + "It is installed as ../World of Warcraft/<version>/", + "Where <version> can be _retail_ | _classic_ | _classic_era_ | etc.", }, }, { sub = "Addon location", lines = { - "Addons are under each <version> as <version>/interface/AddOns ", - "such as Titan and its various built-in plugins released by the Titan dev team.", + "Addons are under each <version> as <version>/interface/AddOns ", + "such as Titan and its various built-in plugins released by the Titan dev team.", }, }, { sub = "Saved vars location", lines = { - "There are two types of saved vars - 'account' or 'per character'.\n", - " 'account' is under <version>/WTF/Account/<your account>/SavedVariables \n", - " 'per character' is under <version>/WTF/Account/<server>/<toon name>/SavedVariables \n", + "There are two types of saved vars - 'account' or 'per character'.\n", + " 'account' is under <version>/WTF/Account/<your account>/SavedVariables \n", + " 'per character' is under <version>/WTF/Account/<server>/<toon name>/SavedVariables \n", }, }, { sub = "Notes", lines = { - "- WoW addon load process loads the proper saved vars into memory at login and reload. \n", - "- On log out or exit or reload WoW writes the saved vars to disk. \n", - "- WoW allows addons NO access to the file system. An addon cannot trigger a read or a write. \n", + "- WoW addon load process loads the proper saved vars into memory at login and reload. \n", + "- On log out or exit or reload WoW writes the saved vars to disk. \n", + "- WoW allows addons NO access to the file system. An addon cannot trigger a read or a write. \n", }, }, }, @@ -3566,8 +3519,8 @@ local help_list_topics = { { sub = "Changing Titan Scaling", lines = { - "Short bars will move on screen. They should not go off screen. ", - "If Short bars move then drag to desired location. You may have to Reset the Short bar or temporarily disable top or bottom bars to drag the Short bar.", + "Short bars will move on screen. They should not go off screen. ", + "If Short bars move then drag to desired location. You may have to Reset the Short bar or temporarily disable top or bottom bars to drag the Short bar.", }, }, }, @@ -3632,8 +3585,7 @@ local function BuildHelpList() end end -------------- -------------- +--============= Build ther config ---Build the entire Config table Ace will display local function BuildAll() @@ -3708,7 +3660,7 @@ do -- Register Titan main options list AceConfig:RegisterOptionsTable("Titan Panel Addon Im_Ex", optionsImportExport) AceConfig:RegisterOptionsTable("Titan Panel Addon Advanced", optionsAdvanced) AceConfig:RegisterOptionsTable("Titan Panel Addon Changes", changeHistory) --- AceConfig:RegisterOptionsTable("Titan Panel Addon Slash", slashHelp) + -- AceConfig:RegisterOptionsTable("Titan Panel Addon Slash", slashHelp) AceConfig:RegisterOptionsTable("Titan Panel Help List", helplist) end @@ -3733,6 +3685,6 @@ do -- Register the options for each entry in Titan option list AceConfigDialog:AddToBlizOptions("Titan Panel Addon Attempts", optionsAddonAttempts.name, titan_entry.name) AceConfigDialog:AddToBlizOptions("Titan Panel Addon Advanced", optionsAdvanced.name, titan_entry.name) AceConfigDialog:AddToBlizOptions("Titan Panel Addon Changes", changeHistory.name, titan_entry.name) --- AceConfigDialog:AddToBlizOptions("Titan Panel Addon Slash", slashHelp.name, titan_entry.name) + -- AceConfigDialog:AddToBlizOptions("Titan Panel Addon Slash", slashHelp.name, titan_entry.name) AceConfigDialog:AddToBlizOptions("Titan Panel Help List", helplist.name, titan_entry.name) end diff --git a/Titan/TitanUtils.lua b/Titan/TitanUtils.lua index ca8afa7..04810aa 100644 --- a/Titan/TitanUtils.lua +++ b/Titan/TitanUtils.lua @@ -842,6 +842,25 @@ local function GetTimeParts(seconds_value) return days, hours, minutes, seconds end +local date_stamp = "%Y-%m-%d" +local time_stamp = "%H:%M" + +---API Format time stamp with optional time +---@param time_sec number timestamp +---@param with_time boolean add time +---@return string Timestamp Formatted +function TitanUtils_GetDateText(time_sec, with_time) + local f = date_stamp + if with_time then + f = f .. " " .. time_stamp + else + -- just date w/o time + end + local str = date(f, time_sec) + + return str +end + ---API return a elapsed time from seconds given - spaces and leaving off the rest ---@param seconds_value number ---@return string Time that is readable diff --git a/Titan/TitanVariables.lua b/Titan/TitanVariables.lua index 1c6b0db..d1be1c6 100644 --- a/Titan/TitanVariables.lua +++ b/Titan/TitanVariables.lua @@ -978,7 +978,13 @@ local function Check_Titan_settings() local profile = TitanUtils_GetPlayer() -- only need profile if TitanSettings.Players[profile] == nil then TitanSettings.Players[profile] = {} - -- = TitanBarVarsDefaults + else + -- exists, good + end + + -- Info for THIS toon for display in Profile + if TitanSettings.Players[profile].Info == nil then + TitanSettings.Players[profile].Info = {} else -- exists, good end diff --git a/TitanGold/TitanGold.lua b/TitanGold/TitanGold.lua index fc83d0a..5b315f3 100644 --- a/TitanGold/TitanGold.lua +++ b/TitanGold/TitanGold.lua @@ -1351,7 +1351,7 @@ function TitanPanel_GoldGetGold(player, server, faction) then res = NiceCash(GoldSave[idx].gold, true, false) else - res = "?" + res = L["TITAN_PANEL_MENU_DISABLED"] end return res diff --git a/TitanPost/Localization.lua b/TitanPost/Localization.lua deleted file mode 100644 index af8c108..0000000 --- a/TitanPost/Localization.lua +++ /dev/null @@ -1,302 +0,0 @@ ---- English --- ---- by Tekkub --- -TITAN_POST_MENU_TEXT = "Mail"; -TITAN_POST_RIGHT_MENU_TEXT = "Mail (Right)"; -TITAN_POST_BUTTON_TEXT_NOMAIL = "No mail "; -TITAN_POST_BUTTON_TEXT_MAIL = "New Mail "; -TITAN_POST_BUTTON_TEXT_ALERT = "AH Alert! "; - -TITAN_POST_CHAT_NEW = "New Mail Received "; - -TITAN_POST_TOOLTIP = "Mail"; -TITAN_POST_TOOLTIP_NEW = " new mail items\n"; -TITAN_POST_TOOLTIP_TOTAL = " total mail items"; -TITAN_POST_TOOLTIP_OUTBID = "Outbid: "; -TITAN_POST_TOOLTIP_WON = "Won: "; -TITAN_POST_TOOLTIP_EXPIRED = "Expired: "; -TITAN_POST_TOOLTIP_CANCELLED = "Cancelled: "; -TITAN_POST_TOOLTIP_SOLD = "Sold: "; - -TITAN_POST_MENU_HIDEMM = "Hide Minimap Icon"; -TITAN_POST_MENU_COMPACT = "Compact Mode"; -TITAN_POST_MENU_CHAT = "Chat Alert"; -TITAN_POST_MENU_SOUND = "Use Sound"; -TITAN_POST_MENU_STEXT = "Show Text"; -TITAN_POST_MENU_SHOW_ICON = "Show Icon"; -TITAN_POST_MENU_COUNT = "Show Count"; -TITAN_POST_MENU_ALTICON = "Alt. AH Icon"; -TITAN_POST_MENU_NOICONNOMAIL = "No icon if no mail"; - ---- German --- ---- by Lunox --- -if ( GetLocale() == "deDE") then - TITAN_POST_MENU_TEXT = "Post"; - TITAN_POST_RIGHT_MENU_TEXT = "Post (Rechts)"; - TITAN_POST_BUTTON_TEXT_NOMAIL = "Keine Post "; - TITAN_POST_BUTTON_TEXT_MAIL = "Neue Post "; - TITAN_POST_BUTTON_TEXT_ALERT = "AH-Alarm! "; - - TITAN_POST_CHAT_NEW = "Neue Post erhalten "; - - TITAN_POST_TOOLTIP = "Post"; - TITAN_POST_TOOLTIP_NEW = " neue Nachrichten\n"; - TITAN_POST_TOOLTIP_TOTAL = " Nachrichten insgesamt"; - TITAN_POST_TOOLTIP_OUTBID = "\195\156berboten: "; - TITAN_POST_TOOLTIP_WON = "Gewonnen: "; - TITAN_POST_TOOLTIP_EXPIRED = "Abgelaufen: "; - TITAN_POST_TOOLTIP_CANCELLED = "Abgebrochen: "; - TITAN_POST_TOOLTIP_SOLD = "Verkauft: "; - - TITAN_POST_MENU_HIDEMM = "Verstecke Minimap-Symbol"; - TITAN_POST_MENU_COMPACT = "Kompakt-Modus"; - TITAN_POST_MENU_CHAT = "Chat-Alarm"; - TITAN_POST_MENU_SOUND = "Sound verwenden"; - TITAN_POST_MENU_STEXT = "Text Anzeigen"; - TITAN_POST_MENU_SHOW_ICON = "Symbol Anzeigen"; - TITAN_POST_MENU_COUNT = "Anzahl Anzeigen"; - TITAN_POST_MENU_ALTICON = "Alternatives AH-Symbol"; - TITAN_POST_MENU_NOICONNOMAIL = "Kein Symbol, wenn keine Post"; -end - ---- French --- ---- by Apsalar --- -if ( GetLocale() == "frFR") then - TITAN_POST_MENU_TEXT = "Courrier"; - TITAN_POST_RIGHT_MENU_TEXT = "Courrier (Droite)"; - TITAN_POST_BUTTON_TEXT_NOMAIL = "Aucun courrier"; - TITAN_POST_BUTTON_TEXT_MAIL = "Nouveau courrier"; - TITAN_POST_BUTTON_TEXT_ALERT = "Alerte AH!"; - - TITAN_POST_CHAT_NEW = "Nouveau courrier reçu"; - - TITAN_POST_TOOLTIP = "Courrier"; - TITAN_POST_TOOLTIP_NEW = " nouveaux courriers\n"; - TITAN_POST_TOOLTIP_TOTAL = " nombre total d'articles de courrier"; - TITAN_POST_TOOLTIP_OUTBID = "Vous devez surench\195\169rir sur"; - TITAN_POST_TOOLTIP_WON = "Vous avez gagn\195\169 l'ench\195\168re pour"; - TITAN_POST_TOOLTIP_EXPIRED = "a expir\195\169."; - TITAN_POST_TOOLTIP_CANCELLED = "a \195\169t\195\169 annul\195\169e par le vendeur"; - TITAN_POST_TOOLTIP_SOLD = " vendu."; - - TITAN_POST_MENU_HIDEMM = "Cacher l'ic\195\180ne de la minicarte"; - TITAN_POST_MENU_COMPACT = "Mode compact"; - TITAN_POST_MENU_CHAT = "Alerte de chat"; - TITAN_POST_MENU_SOUND = "Utiliser le son"; - TITAN_POST_MENU_STEXT = "Afficher le texte"; - TITAN_POST_MENU_SHOW_ICON = "Afficher l'icône"; - TITAN_POST_MENU_COUNT = "Afficher le nombre"; - TITAN_POST_MENU_ALTICON = "Autre icône AH"; - TITAN_POST_MENU_NOICONNOMAIL = "Aucune icône si pas de courrier"; -end - ---- Italian --- -if ( GetLocale() == "itIT") then - TITAN_POST_MENU_TEXT = "Posta"; - TITAN_POST_RIGHT_MENU_TEXT = "Posta (Destra)"; - TITAN_POST_BUTTON_TEXT_NOMAIL = "Niente posta "; - TITAN_POST_BUTTON_TEXT_MAIL = "Nuova posta "; - TITAN_POST_BUTTON_TEXT_ALERT = "AH Allarme! "; - - TITAN_POST_CHAT_NEW = "Nuova posta ricevuta "; - - TITAN_POST_TOOLTIP = "Posta"; - TITAN_POST_TOOLTIP_NEW = " nuovi elementi di posta\n"; - TITAN_POST_TOOLTIP_TOTAL = " invii postali totali"; - TITAN_POST_TOOLTIP_OUTBID = "Supera l'offerta: "; - TITAN_POST_TOOLTIP_WON = "Vinto: "; - TITAN_POST_TOOLTIP_EXPIRED = "Scaduto: "; - TITAN_POST_TOOLTIP_CANCELLED = "Annullato: "; - TITAN_POST_TOOLTIP_SOLD = "Venduto: "; - - TITAN_POST_MENU_HIDEMM = "Nascondi icona minimappa"; - TITAN_POST_MENU_COMPACT = "Modalità compatta"; - TITAN_POST_MENU_CHAT = "Avviso Chat"; - TITAN_POST_MENU_SOUND = "Usa il suono"; - TITAN_POST_MENU_STEXT = "Mostra testo"; - TITAN_POST_MENU_SHOW_ICON = "Mostra icona"; - TITAN_POST_MENU_COUNT = "Mostra conteggio"; - TITAN_POST_MENU_ALTICON = "Alt. Icona AH"; - TITAN_POST_MENU_NOICONNOMAIL = "Nessuna icona se nessuna posta"; -end - ---- Korean --- -if ( GetLocale() == "koKR") then - TITAN_POST_MENU_TEXT = "우편"; - TITAN_POST_RIGHT_MENU_TEXT = "메일 (오른쪽)"; - TITAN_POST_BUTTON_TEXT_NOMAIL = "메일 없음 "; - TITAN_POST_BUTTON_TEXT_MAIL = "새 메일 "; - TITAN_POST_BUTTON_TEXT_ALERT = "아 경고! "; - - TITAN_POST_CHAT_NEW = "새 메일 수신됨 "; - - TITAN_POST_TOOLTIP = "우편"; - TITAN_POST_TOOLTIP_NEW = " 새 메일 항목\n"; - TITAN_POST_TOOLTIP_TOTAL = " 총 메일 항목"; - TITAN_POST_TOOLTIP_OUTBID = "더 높은 입찰가: "; - TITAN_POST_TOOLTIP_WON = "이겼다: "; - TITAN_POST_TOOLTIP_EXPIRED = "만료됨: "; - TITAN_POST_TOOLTIP_CANCELLED = "취소 된: "; - TITAN_POST_TOOLTIP_SOLD = "판매된: "; - - TITAN_POST_MENU_HIDEMM = "미니맵 아이콘 숨기기"; - TITAN_POST_MENU_COMPACT = "컴팩트 모드"; - TITAN_POST_MENU_CHAT = "채팅 알림"; - TITAN_POST_MENU_SOUND = "사운드 사용"; - TITAN_POST_MENU_STEXT = "텍스트 표시"; - TITAN_POST_MENU_SHOW_ICON = "아이콘 표시"; - TITAN_POST_MENU_COUNT = "카운트 표시"; - TITAN_POST_MENU_ALTICON = "대체 AH 아이콘"; - TITAN_POST_MENU_NOICONNOMAIL = "메일이 없으면 아이콘 없음"; -end - ---- Chinese --- ---- by Yeachan --- -if ( GetLocale() == "zhCN") then - TITAN_POST_MENU_TEXT = "郵件"; - TITAN_POST_RIGHT_MENU_TEXT = "邮件 (右侧)"; - TITAN_POST_BUTTON_TEXT_NOMAIL = "没有邮件 "; - TITAN_POST_BUTTON_TEXT_MAIL = "有新邮件"; - TITAN_POST_BUTTON_TEXT_ALERT = "拍卖行信件! "; - TITAN_POST_CHAT_NEW = "收到新邮件"; - - TITAN_POST_TOOLTIP = "邮件助手"; - TITAN_POST_TOOLTIP_NEW = "有新邮寄物品\n"; - TITAN_POST_TOOLTIP_TOTAL = " 所有邮件附件物品"; - TITAN_POST_TOOLTIP_OUTBID = "竞标失败: "; - TITAN_POST_TOOLTIP_WON = "竞标获胜: "; - TITAN_POST_TOOLTIP_EXPIRED = "拍卖到期: "; - TITAN_POST_TOOLTIP_CANCELLED = "拍卖取消: "; - TITAN_POST_TOOLTIP_SOLD = "已售出: "; - - TITAN_POST_MENU_HIDEMM = "隐藏小地图邮件图标"; - TITAN_POST_MENU_COMPACT = "简洁模式"; - TITAN_POST_MENU_CHAT = "聊天窗口通告"; - TITAN_POST_MENU_SOUND = "使用声音报告"; - TITAN_POST_MENU_STEXT = "显示内容"; - TITAN_POST_MENU_SHOW_ICON = "显示图标"; - TITAN_POST_MENU_COUNT = "显示数目"; - TITAN_POST_MENU_ALTICON = "改变拍卖行图标"; - TITAN_POST_MENU_NOICONNOMAIL = "如无邮件则不显示图标"; -end - -if ( GetLocale() == "zhTW") then - TITAN_POST_MENU_TEXT = "郵件"; - TITAN_POST_RIGHT_MENU_TEXT = "郵件(右)"; - TITAN_POST_BUTTON_TEXT_NOMAIL = "沒有郵件 "; - TITAN_POST_BUTTON_TEXT_MAIL = "新郵件 "; - TITAN_POST_BUTTON_TEXT_ALERT = "啊警報!"; - - TITAN_POST_CHAT_NEW = "收到新郵件 "; - - TITAN_POST_TOOLTIP = "郵件"; - TITAN_POST_TOOLTIP_NEW = "有新郵寄物品\n"; - TITAN_POST_TOOLTIP_TOTAL = " 所有郵件附件物品"; - TITAN_POST_TOOLTIP_OUTBID = "競標失敗: "; - TITAN_POST_TOOLTIP_WON = "競標獲勝: "; - TITAN_POST_TOOLTIP_EXPIRED = "拍賣到期: "; - TITAN_POST_TOOLTIP_CANCELLED = "拍賣取消: "; - TITAN_POST_TOOLTIP_SOLD = "已售出: "; - - TITAN_POST_MENU_HIDEMM = "隱藏小地圖郵件圖標"; - TITAN_POST_MENU_COMPACT = "簡潔模式"; - TITAN_POST_MENU_CHAT = "聊天窗口通告"; - TITAN_POST_MENU_SOUND = "使用聲音報告"; - TITAN_POST_MENU_STEXT = "顯示內容"; - TITAN_POST_MENU_SHOW_ICON = "顯示圖標"; - TITAN_POST_MENU_COUNT = "顯示數目"; - TITAN_POST_MENU_ALTICON = "改變拍賣行圖標"; - TITAN_POST_MENU_NOICONNOMAIL = "如無郵件則不顯示圖標"; -end - -------- Russian ---------------- -------- by Mikhailo ---------------- -if ( GetLocale() == "ruRU") then - TITAN_POST_MENU_TEXT = "Сообщение"; - TITAN_POST_RIGHT_MENU_TEXT = "Сообщение (Правый)"; - TITAN_POST_BUTTON_TEXT_NOMAIL = "Нет сообщений "; - TITAN_POST_BUTTON_TEXT_MAIL = "Новое сообщение "; - TITAN_POST_BUTTON_TEXT_ALERT = "Сообщение с Аукциона! "; - - TITAN_POST_CHAT_NEW = "Получено новое сообщение "; - - TITAN_POST_TOOLTIP = "Сообщение"; - TITAN_POST_TOOLTIP_NEW = " новое сообщение\n"; - TITAN_POST_TOOLTIP_TOTAL = " всего сообщений"; - TITAN_POST_TOOLTIP_OUTBID = "Выкуплено: "; - TITAN_POST_TOOLTIP_WON = "Выиграно: "; - TITAN_POST_TOOLTIP_EXPIRED = "Истекло: "; - TITAN_POST_TOOLTIP_CANCELLED = "Отменено: "; - TITAN_POST_TOOLTIP_SOLD = "Продано: "; - - TITAN_POST_MENU_HIDEMM = "Скрыть иконку на миникарте"; - TITAN_POST_MENU_COMPACT = "Компактный режим"; - TITAN_POST_MENU_CHAT = "Предупреждать в чат"; - TITAN_POST_MENU_SOUND = "Использовать звук"; - TITAN_POST_MENU_STEXT = "Показывать текст"; - TITAN_POST_MENU_SHOW_ICON = "Показать значок"; - TITAN_POST_MENU_COUNT = "Показывать счётчик"; - TITAN_POST_MENU_ALTICON = "Альт. иконка Аукциона"; - TITAN_POST_MENU_NOICONNOMAIL = "Нет иконки если нет сообщений"; -end - ---- Portuguese Brazil --- ---- by Caracalho --- -if ( GetLocale() == "ptBR") then - TITAN_POST_MENU_TEXT = "Caixa de Correio"; - TITAN_POST_RIGHT_MENU_TEXT = "Correspondência a (Direita)"; - TITAN_POST_BUTTON_TEXT_NOMAIL = "Sem Correspondência "; - TITAN_POST_BUTTON_TEXT_MAIL = "Nova(s) Correspondência(s) "; - TITAN_POST_BUTTON_TEXT_ALERT = "Casa de Leilao! "; - - TITAN_POST_CHAT_NEW = "Nova(s) Correspondência(s) Recebida "; - - TITAN_POST_TOOLTIP = "Caixa de Correio"; - TITAN_POST_TOOLTIP_NEW = " nova(s) correspondência(s)\n"; - TITAN_POST_TOOLTIP_TOTAL = " correspondência(s) no total"; - TITAN_POST_TOOLTIP_OUTBID = "Você perdeu o lance: "; - TITAN_POST_TOOLTIP_WON = "Você venceu o lance: "; - TITAN_POST_TOOLTIP_EXPIRED = "Expirou sua Venda: "; - TITAN_POST_TOOLTIP_CANCELLED = "Venda Cancelada: "; - TITAN_POST_TOOLTIP_SOLD = "Itens foram Vendidos: "; - - TITAN_POST_MENU_HIDEMM = "Esconder Icone no Mini Mapa"; - TITAN_POST_MENU_COMPACT = "Modo Compacto"; - TITAN_POST_MENU_CHAT = "Alerta para o Bate-Papo"; - TITAN_POST_MENU_SOUND = "Usar Som"; - TITAN_POST_MENU_STEXT = "Mostrar Texto"; - TITAN_POST_MENU_SHOW_ICON = "Mostrar Icone"; - TITAN_POST_MENU_COUNT = "Mostrar Quantidade"; - TITAN_POST_MENU_ALTICON = "Alt. Icone da Casa de Leilao"; - TITAN_POST_MENU_NOICONNOMAIL = "Sem icone se não tiver correspondência"; -end - ---- Español --- ---- by Valeria Piñero --- -if ( GetLocale() == "esES" or GetLocale() == "esMX") then - TITAN_POST_MENU_TEXT = "Buzon"; - TITAN_POST_RIGHT_MENU_TEXT = "Correo a (Derecha)"; - TITAN_POST_BUTTON_TEXT_NOMAIL = "No tienes correo "; - TITAN_POST_BUTTON_TEXT_MAIL = "Nuevo(s) Correo(s) "; - TITAN_POST_BUTTON_TEXT_ALERT = "Casa de Subastas! "; - - TITAN_POST_CHAT_NEW = "Nuevo(s) Correo(s) Recibido(s) "; - - TITAN_POST_TOOLTIP = "Buzon"; - TITAN_POST_TOOLTIP_NEW = " nuevo(s) correo(s)\n"; - TITAN_POST_TOOLTIP_TOTAL = " correo(s) en total"; - TITAN_POST_TOOLTIP_OUTBID = "Ud. perdio la puja: "; - TITAN_POST_TOOLTIP_WON = "Ud. gano la puja: "; - TITAN_POST_TOOLTIP_EXPIRED = "Expiro su Venta: "; - TITAN_POST_TOOLTIP_CANCELLED = "Venta Cancelada: "; - TITAN_POST_TOOLTIP_SOLD = "Items fueron Vendidos: "; - - TITAN_POST_MENU_HIDEMM = "Esconder Icono en Mini Mapa"; - TITAN_POST_MENU_COMPACT = "Modo Compacto"; - TITAN_POST_MENU_CHAT = "Alerta de chat"; - TITAN_POST_MENU_SOUND = "Usar Sonido"; - TITAN_POST_MENU_STEXT = "Mostrar Texto"; - TITAN_POST_MENU_SHOW_ICON = "Mostrar Icono"; - TITAN_POST_MENU_COUNT = "Mostrar Cantidade"; - TITAN_POST_MENU_ALTICON = "Alt. Icono de Casa de Subastas"; - TITAN_POST_MENU_NOICONNOMAIL = "Sin icono si no hay correo"; -end diff --git a/TitanPost/TitanPost.lua b/TitanPost/TitanPost.lua index b8a7ffa..cca38a2 100644 --- a/TitanPost/TitanPost.lua +++ b/TitanPost/TitanPost.lua @@ -4,20 +4,6 @@ -- * By: The Titan Panel Development Team -- ************************************************************************** ---[[ -Dec 2025 : - APIs to consider - CheckInbox() - when open -GetInboxNumItems() -GetInboxHeaderInfo(index) - -GetInboxInvoiceInfo(index) - self:RegisterEvent("MAIL_INBOX_UPDATE", UpdateAll) - self:RegisterEvent("MAIL_SEND_SUCCESS") - - warcraft.wiki.gg/wiki/Making_scrollable_frames ---]] - -- ******************************** Constants ******************************* local _G = getfenv(0); local TITAN_POST_ID = "Post"; @@ -25,7 +11,6 @@ local TITAN_BUTTON = "TitanPanel" .. TITAN_POST_ID .. "Button" -- Constants local FolderPre = "Interface\\AddOns\\TitanPost\\artwork\\" -local TITAN_POST_ICON_NEW = FolderPre .. "Mail"; -- Local variables local L = LibStub("AceLocale-3.0"):GetLocale("Titan", true) @@ -33,49 +18,36 @@ local AceConfigDialog = LibStub("AceConfigDialog-3.0") local mailbox = {} -- default on load; store display info here mailbox.opened = false -mailbox.when = nil -mailbox.total = 0 -mailbox.read = 0 mailbox.new = 0 -mailbox.expiry_active = false -mailbox.expiry_next = 0 mailbox.expiry_text = "" mailbox.expiry_num = 0 local enter_or_reload = true - local player = TitanUtils_GetPlayer() local debug = false; local SECONDS_PER_DAY = 24 * 60 * 60 local SECONDS_PER_HOUR = 60 * 60 local MAX_MAIL_DAYS = 30 -local MAX_COD_DAYS = 72 * SECONDS_PER_HOUR local expiry_warn_days = 7 local expiry_err_days = 2 -local NOT_OPENED = "Not Opened Yet" -local NOT_USED = "Not Used Yet" -local NOT_SHOWN = "Not Running" local DAYS_REM = "Days Remaining" local MAIL_OPENED = "Mail Opened" local CHAR = "Character" local NEW_PRE = " + " local EXP_PRE = " ! " +local READ_TT_PRE = "About : " +local READ_TT_POST = " : About read / total " local NEW_TT_POST = " : New Mail this session " local EXP_TT_POST = " : Characters with expiring Mail " local MAIL_TT_PRE = "Mail opened : " -local MENU_SERVER = "Server_list" -local MENU_CHAR = "Char_name" - TitanPost = {} TitanPost.mailbox = mailbox ---[===[ for debug - --]===] ---------------------------------------------------------------------------------- function Debug(str) @@ -198,7 +170,7 @@ local function CheckExpiry() end end if has_expiry then -- add prefix for user - res = TITAN_POST_TOOLTIP_EXPIRED .. " " .. tostring(expiry_toons) .. "\n" + res = "Expired: " .. " " .. tostring(expiry_toons) .. "\n" res = res .. ex_header res = res .. exp_str else @@ -213,18 +185,30 @@ local function CheckExpiry() return expiry_toons, res end -local function GetCountsStr(player) - local toon = TitanPostDB[player] +---Create an x/y string for Mail +---@param playerName string +---@param addOpen boolean +---@return string +local function GetCountsStr(playerName, addOpen) + local toon = TitanPostDB[playerName] local res = "" + + if addOpen then + if mailbox.opened then + res = res .. " " -- counts should be accurate for this session + else + res = res .. "? " -- counts may not be accurate + end + end + if (toon.lastUpdate == 0) then res = res .. L["TITAN_PANEL_NA"] --NOT_OPENED for first time yet else - res = res .. toon.mailReadNum .. "/" .. toon.mailCount - end - if mailbox.opened then - res = res .. "" -- counts should be accurate - else - res = res .. "?" -- counts may not be accurate + if toon.mailCount > 0 then + res = res .. toon.mailReadNum .. "/" .. toon.mailCount + else + -- leave 0 as blank + end end return res @@ -237,7 +221,7 @@ end local function GetButtonText(id) local res = "" - res = GetCountsStr(player) + res = res .. GetCountsStr(player, true) local new = "" if (mailbox.new > 0) then @@ -265,19 +249,22 @@ function GetTooltipText() local res = "" local toon = TitanPostDB[player] - res = MAIL_TT_PRE..FormatTS(toon.lastUpdate, true).."\n" - res = res..GetCountsStr(player) + res = MAIL_TT_PRE .. FormatTS(toon.lastUpdate, true) .. "\n" + res = res.. " " + .. GetCountsStr(player, true) + .. READ_TT_POST .. "\n" + local new = "" if (mailbox.new > 0) then - new = NEW_PRE .. tostring(mailbox.new) .. NEW_TT_POST .."\n" + new = NEW_PRE .. tostring(mailbox.new) .. NEW_TT_POST .. "\n" else new = "" end local expiry = "" if (mailbox.expiry_num > 0) then - expiry = EXP_PRE .. tostring(mailbox.expiry_num) .. EXP_TT_POST.."\n" + expiry = EXP_PRE .. tostring(mailbox.expiry_num) .. EXP_TT_POST .. "\n" else expiry = "" end @@ -289,20 +276,6 @@ function GetTooltipText() return res end -local function convertSeconds(time) - local days = math.floor(time / 86400) - local hours = math.floor(math.fmod(time, 86400) / 3600) - local minutes = math.floor(math.fmod(time, 3600) / 60) - local seconds = math.floor(math.fmod(time, 60)) - - local s = tostring(days > 0 and days .. (days == 1 and " day, " or " days, ") or "") - s = s .. tostring(hours > 0 and hours .. (hours == 1 and " hour, " or " hours, ") or "") - s = s .. tostring(minutes > 0 and minutes .. (minutes == 1 and " minute, " or " minutes, ") or "") - s = s .. tostring(seconds > 0 and seconds .. (seconds == 1 and " second, " or " seconds, ") or "") - - return string.gsub(s, ",[^,]*$", "") -end - ---Look at any mail, setting data for action local function UpdateInboxData() if not _G.MailFrame:IsVisible() then @@ -433,11 +406,21 @@ local function UpdatePending() TitanPanelButton_UpdateButton(TITAN_POST_ID) end +local AUCTION_OUTBID = ERR_AUCTION_OUTBID_S:gsub('%%s', '%.+') -- remove the 'what' +local function GetAHMsg(message) + if strmatch(message, AUCTION_OUTBID) then + -- problem child / Blizz bug + UpdatePending() + else + -- Not interested :) + end +end + ---Event handler for registered events ---@param self Button ---@param event string ---@param ... unknown -local function OnEvent(self, event, ...) +local function OnEvent(self, event, arg1, ...) Debug(time() .. " " .. event); if (event == "VARIABLES_LOADED") then InitVars() @@ -464,75 +447,14 @@ Does not appear to trigger when auction outbid mail is received... may not in ot --]] UpdatePending() end -end - ----local Show list of servers / custom submenu off Profiles/Manage from the Titan (right click) menu. -local function BuildServerProfilesMenu() - local info = {}; - local servers = {}; - local player = nil; - local server = nil; - local s, e, ident; - local setonce = 0; - - if (TitanPanelRightClickMenu_GetDropdMenuValue() == MENU_SERVER) then - TitanPanelRightClickMenu_AddTitle(L["TITAN_PANEL_MENU_PROFILE_SERVERS"], - TitanPanelRightClickMenu_GetDropdownLevel()); - -- Normal profile per toon - for index, id in pairs(TitanSettings.Players) do - player, server = TitanUtils_ParseName(index) - - if TitanUtils_GetCurrentIndex(servers, server) == nil then - if server ~= TITAN_CUSTOM_PROFILE_POSTFIX then - table.insert(servers, server); - info = {}; - info.notCheckable = true - info.text = server; - info.value = MENU_CHAR .. server; - info.hasArrow = 1; - TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); - end - end - end + if (event == "CHAT_MSG_SYSTEM") then + --[[ Dec 2025 https://warcraft.wiki.gg/wiki/UPDATE_PENDING_MAIL +Appears to be a long standing bug that AH 'out bid' message does not fire a 'mail pending' event + --]] + GetAHMsg(arg1) end end ----local Show alphabetical list of toons submenu off Profiles/Manage/<server or custom> from the Titan right click menu. -local function BuildProfileMenu() - -- - local info = {}; - local setonce = 0; - - -- - -- Handle the profiles - -- - for idx = 1, #Titan_Global.players do - local index = Titan_Global.players[idx] - local player, server = TitanUtils_ParseName(index) - local off = (index == TitanSettings.Player) - or ((index == TitanAllGetVar("GlobalProfileUse")) and (TitanAllGetVar("GlobalProfileUse"))) - local par_val = TitanPanelRightClickMenu_GetDropdMenuValue() - local menu_val = string.gsub(par_val, MENU_CHAR, "") - - -- handle regular profiles here - if server == menu_val then - -- Set the label once - if setonce and setonce == 0 then - TitanPanelRightClickMenu_AddTitle(L["TITAN_PANEL_MENU_PROFILE_CHARS"], - TitanPanelRightClickMenu_GetDropdownLevel()); - setonce = 1; - end - info = {}; - info.disabled = off - info.notCheckable = true - info.text = player; - info.value = index; - info.hasArrow = 1; - TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); - end - end -- for players -end - ---First level of right click menu ---@param frame Button local function BuildMainMenu(frame) @@ -552,37 +474,6 @@ local function BuildMainMenu(frame) TitanPanelRightClickMenu_AddButton(info); TitanPanelRightClickMenu_AddSpacer(); - --[[ - TitanPanelRightClickMenu_AddSpacer(); - - info = {}; - info.text = TITAN_POST_MENU_CHAT; - info.value = "chat"; - info.func = TitanToggleVar(TITAN_POST_ID, "chat"); - info.keepShownOnClick = 1; - info.checked = TitanGetVar(TITAN_POST_ID, "chat"); - UIDropDownMenu_AddButton(info); - - TitanPanelRightClickMenu_AddSpacer(); - - info = {}; - info.notCheckable = true - info.text = "Servers"; - info.value = MENU_SERVER - info.hasArrow = 1; - -- lock this menu in combat - if InCombatLockdown() then - info.disabled = 1; - info.hasArrow = nil; - info.text = info.text .. " " - .. _G["GREEN_FONT_COLOR_CODE"] - .. L["TITAN_PANEL_MENU_IN_COMBAT_LOCKDOWN"]; - end - TitanPanelRightClickMenu_AddButton(info); - - TitanPanelRightClickMenu_AddSpacer(); ---]] - TitanPanelRightClickMenu_AddControlVars(TITAN_POST_ID) end @@ -594,32 +485,6 @@ local function PrepareMenu(self) if lev == 1 then BuildMainMenu(frame) end - --[[ - -- Level 2 - -- Server / Realm list - if (lev == 2) then - if (TitanPanelRightClickMenu_GetDropdMenuValue() == MENU_SERVER) then - BuildServerProfilesMenu() - end - return; - end - - -- Level 3 - -- Server / Realm list > Character on realm list - if (lev == 3) then - if string.find(TitanPanelRightClickMenu_GetDropdMenuValue(), MENU_CHAR) then - BuildProfileMenu() - end - return; - end ---]] -end - -local function sorted_index(table) - local index = {} - for key in pairs(table) do tinsert(index, key); end - sort(index) - return index end ---Register events when active @@ -639,7 +504,6 @@ local function OnShow(self) TitanPanelButton_UpdateButton(TITAN_POST_ID) end - ---Unregister events when not active ---@param self Button local function OnHide(self) @@ -664,7 +528,9 @@ end ---@param self Button local function OnLoad(self) local notes = "" - .. "Adds mail expiry information to Titan Panel.\n" + .. "Adds mail information to Titan Panel.\n" + .. "- <read>/<total>; new mail this session; expiry as known.\n" + .. "- Please report issues.\n" .. "- New built-in Dec 2025.\n" self.registry = { id = TITAN_POST_ID, @@ -674,7 +540,7 @@ local function OnLoad(self) buttonTextFunction = GetButtonText, tooltipTitle = TITAN_POST_ID, tooltipTextFunction = GetTooltipText, - icon = TITAN_POST_ICON_NEW, + icon = FolderPre .. "Mail", version = TITAN_VERSION, iconWidth = 16, notes = notes, @@ -724,12 +590,13 @@ function TitanPost.GetMailInfo(playerName) res = L["TITAN_PANEL_NA"] else if (p.mailCount > 0) then + estr = GetCountsStr(playerName, false) .. "? " if (p.nextExpiry < ExpiryWarn()) then -- add to list for user local days = math.floor((p.nextExpiry - now) / SECONDS_PER_DAY) local color = TitanUtils_GetThresholdColor(ThresholdTable, days) local days_str = DAYS_REM .. " : " .. tostring(days) days_str = TitanUtils_GetColoredText(days_str, color) - estr = days_str .. "\n" + estr = estr .. days_str .. "\n" else -- no mail to warn about estr = "" @@ -843,7 +710,6 @@ m.subject = "Debug Msg" m.wasRead = false --]] ---TitanPost.SimMailInboxUpdate() --TitanPost.SimUpdatePending() --FormatTS(1768597331, true) @@ -872,3 +738,16 @@ TitanPanelPostButton:OnEvent("PLAYER_REGEN_ENABLED", "player") function TitanPost.SimUpdatePending() UpdatePending() end + +function TitanPost.SimUpdateExpiry() + UpdateInfo() + Debug("Inbox: " .. GetInboxNumItems()); + TitanPanelButton_UpdateButton(TITAN_POST_ID) +end + +function TitanPost.SimOutBid() + local msg = "You have been outbid on New Fangled Boots." + -- print("TPost '"..AUCTION_OUTBID.."'") + + GetAHMsg(msg) +end diff --git a/TitanPost/TitanPost.toc b/TitanPost/TitanPost.toc index d4a0937..0929f7e 100644 --- a/TitanPost/TitanPost.toc +++ b/TitanPost/TitanPost.toc @@ -6,6 +6,5 @@ ## SavedVariables: TitanPostDB ## Dependencies: Titan ## OptionalDeps: -Localization.lua TitanPost.lua diff --git a/TitanXP/TitanXP.lua b/TitanXP/TitanXP.lua index 5c9c545..51f6044 100644 --- a/TitanXP/TitanXP.lua +++ b/TitanXP/TitanXP.lua @@ -79,7 +79,6 @@ else end end - -- ******************************** Functions ******************************* ---local Set icon based on faction @@ -159,7 +158,6 @@ local function XPTimeUpdate() end end - ---local Get total time played -- Do not send RequestTimePlayed output to Chat if XP requested the info. -- Override ChatFrame_DisplayTimePlayed used by RequestTimePlayed(). @@ -719,7 +717,6 @@ local function Create_Frames() end end - if TITAN_ID then -- it exists Create_Frames() -- do the work end