From c8b27c96b28dc28dc3262014f66524d0de924fb0 Mon Sep 17 00:00:00 2001 From: urnati Date: Mon, 2 Feb 2026 13:53:34 -0500 Subject: [PATCH] Updates for 9.10-pre --- Titan/Artwork/Titan.blp | Bin 0 -> 6660 bytes Titan/Titan.lua | 678 +++++---------- Titan/Titan.toc | 11 +- Titan/TitanConfig.lua | 592 ++++++++----- Titan/TitanDebug.lua | 2 +- Titan/TitanGlobal.lua | 10 +- Titan/TitanHistory.lua | 74 +- Titan/TitanMenu.lua | 1399 +++++++++++++++++++++++++++++++ Titan/TitanTemplate.lua | 286 ++++--- Titan/TitanUtils.lua | 937 +-------------------- Titan/TitanVariables.lua | 28 +- Titan/_ATitanDoc.lua | 2 +- Titan/_TitanIDE.lua | 29 + TitanBag/Artwork/TitanBag.tga | Bin 0 -> 16428 bytes TitanBag/TitanBag.lua | 625 +++++++++++++- TitanBag/TitanBag.tga | Bin 16428 -> 0 bytes TitanBag/TitanBag.toc | 8 +- TitanClassic/TitanClassic.toc | 4 +- TitanClock/TitanClock.lua | 142 ++-- TitanClock/TitanClock.toc | 6 +- TitanGold/TitanGold.lua | 858 ++++++------------- TitanGold/TitanGold.toc | 6 +- TitanLocation/TitanLocation.lua | 193 +---- TitanLocation/TitanLocation.toc | 6 +- TitanLootType/TitanLootType.lua | 187 +++-- TitanLootType/TitanLootType.toc | 6 +- TitanLootType/TitanLootType_Classic.toc | 4 +- TitanPerformance/TitanPerformance.lua | 615 ++++---------- TitanPerformance/TitanPerformance.toc | 6 +- TitanPost/TitanPost.lua | 841 +++++++++++++++++++ TitanPost/TitanPost.toc | 10 + TitanPost/artwork/Mail.blp | Bin 0 -> 3902 bytes TitanPost/artwork/mail_here.mp3 | Bin 0 -> 18037 bytes TitanRegen/TitanRegen.lua | 106 +-- TitanRegen/TitanRegen_TBC.toc | 9 + TitanRegen/TitanRegen_Vanilla.toc | 6 +- TitanRepair/TitanRepair.lua | 118 +-- TitanRepair/TitanRepair.toc | 6 +- TitanUI/TitanUI.toc | 6 +- TitanUI/Tools.lua | 120 ++- TitanVolume/TitanVolume.lua | 34 +- TitanVolume/TitanVolume.toc | 6 +- TitanXP/TitanXP.lua | 177 +--- TitanXP/TitanXP.toc | 6 +- 44 files changed, 4587 insertions(+), 3572 deletions(-) create mode 100755 Titan/Artwork/Titan.blp create mode 100644 Titan/TitanMenu.lua create mode 100755 TitanBag/Artwork/TitanBag.tga delete mode 100644 TitanBag/TitanBag.tga create mode 100644 TitanPost/TitanPost.lua create mode 100644 TitanPost/TitanPost.toc create mode 100644 TitanPost/artwork/Mail.blp create mode 100644 TitanPost/artwork/mail_here.mp3 create mode 100644 TitanRegen/TitanRegen_TBC.toc diff --git a/Titan/Artwork/Titan.blp b/Titan/Artwork/Titan.blp new file mode 100755 index 0000000000000000000000000000000000000000..00c677f6f8a006ea4733f3fa14ec3127802c9a31 GIT binary patch literal 6660 zcmeI0k5f}u7RPS_mX{!FaHaCt?lj?-5{O7>Yz=EAiCFnzSA|Dd2oMuotzdQi(NaW2 z1Qi8!S~G5^GNKfUp}}@%LS0*fKpRDi?%GC}`U?fi52aFT6j6A4A960>OlS5F@C|R^ zGw0lU?)Th#&%Fu#xIS~kNEAx?*sh)UylfT;XV-V zI1>Nj5MKP}i|0iKUS!}!27WgK^RCsc`O_Rj=h6}t#W0Ll^n+EGSp2+UukdCB{3Nz7 zn$I> zh(GVQ=wItWk3K(OPFtPFm2E?(NA)Jmb9UcgA0K8J%W^6}ux1U*K1e{;uzfrc z!asKnDk>U3;Lo*pSWle-mf!=1TOYtjF*{C$x&yD^88{|-Ex9XrjLBm=*uO9NOeq`K znhw0W@YAqrR!hdW-`Y7>=x!nWk#(0EpOjYc|N262X76y)GT{G~Rq>d_q;9$=;cHDl^*;Xpu zWm+=c^wzE*glZhn{)U~-s;)L$fDhmEDOF5A*b2P0YlTl-+dc+ zm%Lo`=_3bOze{!B2FXsPlJy;$(Jq>4t|$7GH(aIddt`)vJ+MQ)^$)LXhW@@Nag#c_ z(bvFSZz z9|n8R0Un*0koXALY~;~vnfm#_=QC9j8Iwr#>?_er5X+Eya;~H?sIj#2Hu$%gqIf!8 z8mWgBSbtiYP6zs*-~S=;2o)C>3!uGr(>qfcT+o0|m_ovvJJyl)8Jf`%*1b9>59~ck ziKNvka{&&E3zRoE?=u6hHR1WUI-I}{EP=7@ds4~x-_Gp_VuxE#fPG)d0=3EO<=Mbj z@A)fJ;th?!R=bOQNe){Be92-|GJji7>LFFc>Bo9U&yxbIUzeSo4f@YNxBeejiYbdl zM&{?by+1Z!cRy*b*wheKeR6m!^hd?Ei`oZRvR>mfJLO0G?#6*#7?DAj=jOZ#9Hgm` zc(|7*0ne)CDcxOI26#zXg=C;@Y(4cI@be6=car?HUeMF!hC3vGmn;S)|CrMY+GpBb zVso}!e*o;ZC6Lpf0L<0HG`s*n|MTl#VTz<=mcBLMFU%05?%{MYz6_-p4UD@Fe5qSb znXG*s;9ncNQ{MAsEzutw(HS&j%FQ3Ze%`32TSNI|KV2;RImRg!l6>yTjgqJLmy>us znG!nrWchJuzo_hH*tN|^Nj)-O*ruNT$zu!HZ(sN}<}0g$%wI^t8D2tyE*I=kSies9 zwEOq;-$`DMqQ}+08B@iG8AK%BBwsz{_^NII`m2qV(7uAw7T`FIzufRcGO5SGnvS4> z-c=+Ydt%E)zSRR{zXV7lQM-0*yn(Se9%Clw-OhM1ax&@p(0^8$o^n^1NdGdMLHSb1 zi6>yET92q@vU&4>!?&#VNlYAD|GTFeP)<(v0O&uTEJ4eSMkAd6i%05zaWS-i$H#>i zTtD=1j2lGj^o^vR?bYb1;+|3k*n5?4NdtI%A#katoH~0~N7nmxI-g3prXb@xC-?Pi zDR#Gk|3c|aip{%9_KRDVnwB{>v0xXNBy>{x*nQ$tyT5#B$V%e7n93=EhvG2!|6qSR zI6>Fe54OR?z_-?j(OJ zH#ShmZC6SDG|JPW%Nz5I(B8jRMNg6`$bG8GV)RTgdRW1}xz(Q1)KE#*%fC%~BQ|Z# zX$Sq>d>agUJ<*Tr;rRP+72Yp0d|!tCI&l4*b7=D>U>8p@%HLf>?7p;^a>LaM?298B zLPday zma+|9OdT8F0-q){==x-_1i12Zc9sc0)VRmTWFn1nA zN3S9IGvI$B;ro6f#K-C2nCKN_#_1u<^F(O7Aix3si=^e$Brk0$@GiL?`Mudj<}WzH zNbj&OB=@Bi$^wbIB?VkdBh z<|vvpDZmT3BW1hfvMxC%`~m*>VV_JF#7ii>J||6fY2mwmb<3|r1&NVY>J~YeZc2oXkMr-15mWd!K>WMH#HavO z6aIOw7@3ifFxS3!T>BYnF{&BIGcga2V@i#`-w|GqqvPocLufv>&*Aj2pG;d7?@M*} zZe?Vbro7Vj#hMYl37fVs9{mfq4-Xw?U#mpOTDl>fefaEqe@!N*8_zFc)dVihY~ol3 z_75$T4{K)lz*EZ#klC!&0YiVof+T(jdI@py($=>)*@w@*KhMlXXc>NBzPRr>#$hGr zS#Xvs&k;~u0rncBJt#k^j@TcaI=9Tl%8>7qD;ENNle6l{dG(71_oq$IWgkBK{^Q~m z;fKTzGvN4_$o+XqMkjJ8WF8Q&FXfhZcXwMd@RBTvrzN=N2JqG!3zhDV21)%(w+Z9L zM;$o#Tpkg6e8Gj6mXw_b@vHFsjE}!GA<8o~btnk@ALIu5T5jIT29DFH=|gp6-(you zok6cw2>QT&E)&u3)t@Bwb6Q0_-6sjbQaVYqQ4Ut0u%xsk-GIRQv(iuXk~M zY#%&G>W47mwnX1Qo7C^MCV#oC)k^LsEhQC_Z?t*C5O21vLjBD(=Sko|n_ZBXw|N7^ zKNE)I@7%c)@_$EJfKqC{{tf)&A{wZG*KLP^dz8p?*RFy{U|~c#weGsr0$hmqiz9!Q z8MvoJLc0{zDS$t>z2viDb59Gz4+(dr-+%92J;XOFRjA|1l@#!|{xGG3b{n?49chp|3Y!U@m;r%|!mGMp9!7Q#X zqrB7DC`w2j&(wLHi{aX zhc-1mUGyRM|Gz!)-->LN7Qe=)(f#xB5wSnF$$NN-KC|H|Ha_0xFOBUGh1|0`8lH0J z$49Q+MnBrnT-(b2a?m%DKP~8c;{tl|`Fqa6CtUvsRmXfM3I90!W8fL;x8%4Ou>S*d Cazk|h literal 0 HcmV?d00001 diff --git a/Titan/Titan.lua b/Titan/Titan.lua index c87ae87..a0aea93 100644 --- a/Titan/Titan.lua +++ b/Titan/Titan.lua @@ -18,18 +18,6 @@ local AceTimer = LibStub("AceTimer-3.0") local media = LibStub("LibSharedMedia-3.0") local AceConfigDialog = LibStub("AceConfigDialog-3.0") ----Open the WoW config to the requested place. ---- Use AceConfigDialog:Open to open a specific part of the Titan config as a distinct frame ----@param ... unknown -local function OpenConfig(...) - -- WoW 12.0 (Midnight) changed the API to open their Config. - if C_SettingsUtil and C_SettingsUtil.OpenSettingsPanel then - C_SettingsUtil.OpenSettingsPanel(...) - else - Settings.OpenToCategory(...) - end -end - -- TitanDebug (cmd.." : "..p1.." "..p2.." "..p3.." "..#cmd_list) -------------------------------------------------------------- @@ -100,7 +88,7 @@ function TitanPanel_SaveCustomProfile(profile_name) -- helper to actually write the profile to the Titan saved vars local function Write_profile(name) --- local currentprofilevalue, _, _ = TitanUtils_GetPlayer() + -- local currentprofilevalue, _, _ = TitanUtils_GetPlayer() local currentprofilevalue = profile_name local profileName = TitanUtils_CreateName(name, TITAN_CUSTOM_PROFILE_POSTFIX) TitanSettings.Players[profileName] = @@ -112,7 +100,7 @@ function TitanPanel_SaveCustomProfile(profile_name) TitanPrint(L["TITAN_PANEL_MENU_PROFILE_SAVE_PENDING"] .. "'" .. profile_name .. "'" .. " > '" .. profileName .. "'" --- .. " > '" .. name .. "'" + -- .. " > '" .. name .. "'" , "info") end -- helper to ask the user to overwrite a profile @@ -295,17 +283,28 @@ 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 toon_info = TitanSettings.Players[toon].Info ---@class CharInfo local unit = "player" - local classFilename, classId = UnitClassBase(unit) - local localizedClassName, classFile, classID = GetClassInfo(classId) - toon_info.class = localizedClassName - toon_info.classId = classID + local p, s, is_custom = TitanUtils_ParseName(toon) + toon_info.name = p + toon_info.server = s + + local classFilename, classID = UnitClassBase(unit) -- regardless of comsetic changes + local classInfo = C_CreatureInfo.GetClassInfo(classID) + if classInfo == nil then + toon_info.class = "??" + toon_info.className = "??" + toon_info.classId = 0 + else + toon_info.class = classInfo.className + toon_info.className = classInfo.classFile + toon_info.classId = classInfo.classID + end local englishFaction, localizedFaction = UnitFactionGroup(unit) toon_info.faction = localizedFaction - toon_info.factionId = englishFaction + toon_info.factionName = englishFaction local level = UnitLevel(unit) toon_info.level = level @@ -313,7 +312,11 @@ local function SetToonInfo(toon) local localizedRaceName, englishRaceName, raceID = UnitRace(unit) toon_info.race = localizedRaceName + toon_info.raceName = englishRaceName toon_info.raceId = raceID + + toon_info.zoneText = GetZoneText() + toon_info.subZoneText = GetSubZoneText() or "" end local function SetToonLogout(toon) @@ -352,13 +355,6 @@ function TitanPanel_PlayerEnteringWorld(reload) TitanPrint("", "header") end - if not ServerTimeOffsets then - ServerTimeOffsets = {}; - end - if not ServerHourFormat then - ServerHourFormat = {}; - end - -- Set the two anchors in their default positions -- until the Titan bars are drawn Titan_Debug.Out('titan', 'p_e_w', "Create anchors for other addons") @@ -372,29 +368,13 @@ function TitanPanel_PlayerEnteringWorld(reload) for idx, v in pairs(TitanBarData) do Titan_Debug.Out('titan', 'bars_setup', "... " .. tostring(v.name)) - TitanPanelButton_CreateBar(idx) + TitanPanelButton_CreateBar(idx, v.locale_name) end -- Titan_AutoHide_Create_Frames() -- Add to Addon Compartment, if feature is present RegisterAddonCompartment() - -- Set clock vars based on user setting - if TitanPlugins["Clock"] then - local realmName = GetRealmName() - if ServerTimeOffsets[realmName] then - TitanSetVar("Clock", "OffsetHour", ServerTimeOffsets[realmName]) - elseif TitanGetVar("Clock", "OffsetHour") then - ServerTimeOffsets[realmName] = TitanGetVar("Clock", "OffsetHour") - end - - if ServerHourFormat[realmName] then - TitanSetVar("Clock", "Format", ServerHourFormat[realmName]) - elseif TitanGetVar("Clock", "Format") then - ServerHourFormat[realmName] = TitanGetVar("Clock", "Format") - end - end - -- Should be safe to register for events that could show / hide Bars Titan_Debug.Out('titan', 'p_e_w', "Register for events Titan needs") RegisterForEvents() @@ -404,7 +384,6 @@ 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 @@ -478,19 +457,6 @@ end --]===] ----Titan Handle ADDON_LOADED Minimal setup in prep for player login. -function TitanPanelBarButton:ADDON_LOADED(addon) - if addon == TITAN_ID then - _G[TITAN_PANEL_CONTROL]:RegisterEvent("PLAYER_ENTERING_WORLD") - - Titan_Debug.Out('titan', 'events', "ADDON_LOADED") - - -- Unregister event - saves a few event calls. - self:UnregisterEvent("ADDON_LOADED"); - self.ADDON_LOADED = nil - end -end - ---Titan Handle PLAYER_ENTERING_WORLD Initialize Titan, set and display Titan bars and plugins. function TitanPanelBarButton:PLAYER_ENTERING_WORLD(arg1, arg2) local call_success = nil @@ -960,7 +926,7 @@ print("_Set bar color" TOOLTIP_DEFAULT_COLOR.b, color.alpha); -- 2024 Aug : Border will use the color alpha - _G[frame]:SetBackdropColor( + _G[frame]:SetBackdropColor( color.r, color.g, color.b, @@ -1050,13 +1016,13 @@ print("_Tex" ) --]] -- Use the texture / skin per user selectable options ---[[ + --[[ if TitanBarDataVars["Global"].texure == Titan_Global.SKIN then Set_Skin(frame, titanTexture, TitanBarDataVars["Global"].skin) -- tex_path = TitanPanelGetVar("TexturePath") elseif TitanBarDataVars["Global"].texure == Titan_Global.COLOR then Set_Color(frame, titanTexture, TitanBarDataVars["Global"].color) else ---]] +--]] if TitanBarDataVars[frame].texure == Titan_Global.SKIN then Set_Skin(frame, titanTexture, TitanBarDataVars[frame].skin) elseif TitanBarDataVars[frame].texure == Titan_Global.COLOR then @@ -1548,8 +1514,8 @@ local function showBar(frame_str) -- ===== Battleground or Arena : User selected -- if (TitanPanelGetVar("HideBarsInPVP")) if TitanBarDataVars[frame_str].hide_in_pvp - and (C_PvP.IsBattleground() - or C_PvP.IsArena() + and (C_PvP and C_PvP.IsBattleground() + or C_PvP and C_PvP.C_PvP.IsArena() -- or GetZoneText() == "Stormwind City" -- or GetZoneText() == "Tempest Keep" ) @@ -1909,7 +1875,12 @@ function TitanPanelButton_Justify() -- Look at each bar for plugins. for idx, v in pairs(TitanBarData) do bar = TitanBarData[idx].name - y_offset = TitanBarData[idx].plugin_y_offset +--print("Bar Y" +-- .. " " .. tostring(idx) .. "" +-- .. " " .. tostring(TitanBarData[idx].plugin_y_offset) .. "" +-- .. " " .. tostring(TitanBarDataVars[idx].plugin_off_y) .. "" +--) + y_offset = TitanBarData[idx].plugin_y_offset -- + TitanBarDataVars[idx].plugin_off_y -- user may offset x_offset = TitanBarData[idx].plugin_x_offset firstLeftButton = TitanUtils_GetButton(TitanPanelSettings.Buttons [TitanUtils_GetFirstButtonOnBar(bar, TITAN_LEFT)]) @@ -1961,236 +1932,67 @@ end -------------------------------------------------------------- -- -- Local routines for Titan menu creation -local R_ADDONS = "Addons_" -local R_PLUGIN = "Plugin_" -local R_SETTINGS = "Settings" -local R_PROFILE = "Profile_" -local R_BARS_SETTING = "Bar_Show_Hide" - ----local Show main Titan (right click) menu. ----@param frame string Frame to add to -local function BuildMainMenu(frame) - local locale_bar = TitanBarData[frame].locale_name - local info = {}; - ----------------- - -- Menu title - TitanPanelRightClickMenu_AddTitle(L["TITAN_PANEL_MENU_TITLE"] .. " - " .. locale_bar); - TitanPanelRightClickMenu_AddSeparator(TitanPanelRightClickMenu_GetDropdownLevel()); - - TitanPanelRightClickMenu_AddTitle(L["TITAN_PANEL_MENU_PLUGINS"]); - - ----------------- - -- Plugin Categories - -- Both arrays are in TitanGlobal - ---@diagnostic disable-next-line: param-type-mismatch - for index, id in pairs(L["TITAN_PANEL_MENU_CATEGORIES"]) do - info = {}; - info.notCheckable = true - info.text = L["TITAN_PANEL_MENU_CATEGORIES"][index]; - info.value = R_ADDONS .. TITAN_PANEL_BUTTONS_PLUGIN_CATEGORY[index]; - info.hasArrow = 1; - TitanPanelRightClickMenu_AddButton(info); - end - TitanPanelRightClickMenu_AddSeparator(TitanPanelRightClickMenu_GetDropdownLevel()); - - ----------------- - -- Bars - Show / Hide - - info = {}; - info.notCheckable = true - info.text = L["TITAN_PANEL_MENU_OPTIONS_BARS"]; - info.value = R_BARS_SETTING - info.hasArrow = 1; - TitanPanelRightClickMenu_AddButton(info); - - TitanPanelRightClickMenu_AddSeparator(TitanPanelRightClickMenu_GetDropdownLevel()); - - if Titan_Global.switch.midnight then - -- disable until we figure this out +---Titan Determine if the given plugin is on any Titan bar. +---@param id string Unique ID of the plugin +---@return boolean shown True on a Titan bar even if hidden or on auto hide +function TitanPanel_IsPluginShown(id) + if (id and TitanPanelSettings) then + return TitanUtils_TableContainsValue(TitanPanelSettings.Buttons, id) else - ----------------- - -- Config - just one button to open the first Titan option screen - do - info = {}; - info.notCheckable = true - info.text = L["TITAN_PANEL_MENU_CONFIGURATION"]; - info.value = "Config"; - info.func = function() - TitanUpdateConfig("init") - OpenConfig(TITAN_PANEL_CONFIG.topic.About) - end - TitanPanelRightClickMenu_AddButton(info); - end - - TitanPanelRightClickMenu_AddSeparator(TitanPanelRightClickMenu_GetDropdownLevel()); - end - - ----------------- - -- Profiles - -- TitanPanelRightClickMenu_AddTitle(L["TITAN_PANEL_MENU_PROFILES"]); - - info = {}; - info.notCheckable = true - info.text = L["TITAN_PANEL_MENU_PROFILES"] .. " " .. L["TITAN_PANEL_MENU_CONFIGURATION"] - info.value = "ConfigProfile"; - info.func = function() - TitanUpdateConfig("init") - AceConfigDialog:Open("Titan Panel Addon Chars") + return false end - TitanPanelRightClickMenu_AddButton(info); - - local res = TitanVariables_GetProfile(TitanUtils_GetPlayer()) - info = {}; - info.notCheckable = true - info.text = res.cname - info.value = "Global_value" - TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); - - TitanPanelRightClickMenu_AddSeparator(TitanPanelRightClickMenu_GetDropdownLevel()); +end - info = {}; - info.notCheckable = true - info.text = L["TITAN_PANEL_MENU_HELP"] - info.value = "ConfigProfile"; - info.func = function() - TitanUpdateConfig("init") - AceConfigDialog:Open("Titan Panel Help List") +---Titan Determine if the given plugin is / would be on right or left of a Titan bar. +---@param id string Unique ID of the plugin +---@return string R_L TITAN_RIGHT("Right") or TITAN_Left("Left") +function TitanPanel_GetPluginSide(id) + if (TitanGetVar(id, "DisplayOnRightSide")) then + return TITAN_RIGHT; + else + return TITAN_LEFT; end - TitanPanelRightClickMenu_AddButton(info); - - TitanPanelRightClickMenu_AddSeparator(TitanPanelRightClickMenu_GetDropdownLevel()); - - ----------------- - -- Hide this bar - info = {}; - info.text = (HIDE or "Hide") - info.value = "HideMe" - info.notCheckable = true - info.disabled = (TitanUtils_NumActiveBars() == 1) - info.arg1 = frame; - info.func = function(self, frame_str) - TitanBarDataVars[frame_str].show = not TitanBarDataVars[frame_str].show - TitanPanelBarButton_DisplayBarsWanted(frame_str .. " user clicked Hide") - end - info.keepShownOnClick = nil - TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); -end - ----local Show list of plugin defined options from the Titan right click menu. -local function BuildPluginMenu() - -- - local info = {}; - - -- Handle the plugins +end - for index, id in pairs(TitanPluginsIndex) do - local plugin = TitanUtils_GetPlugin(id) - local par_val = TitanPanelRightClickMenu_GetDropdMenuValue() - local menu_plugin = string.gsub(par_val, R_PLUGIN, "") - if plugin and plugin.id and plugin.id == menu_plugin then - --title - info = {}; - info.text = TitanPlugins[plugin.id].menuText; - info.notCheckable = true - info.notClickable = 1; - info.isTitle = 1; - TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); - - --ShowIcon - if plugin.controlVariables.ShowIcon then - info = {}; - info.text = L["TITAN_PANEL_MENU_SHOW_ICON"]; - info.value = plugin.id - info.arg1 = plugin.id - info.func = function(self, p_id) -- (self, info.arg1, info.arg2) - TitanPanelRightClickMenu_ToggleVar({ p_id, "ShowIcon", nil }) - end - info.keepShownOnClick = 1; - info.checked = TitanGetVar(plugin.id, "ShowIcon"); - info.disabled = nil; - TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); - end +---Titan Set the scale, texture (graphic), and transparancy of all the Titan bars based on the user selection. +---@param reason string Debug note on where the call initiated +function TitanPanel_InitPanelBarButton(reason) + -- Set initial Panel Scale + TitanPanel_SetScale(); - --ShowLabel - if plugin.controlVariables.ShowLabelText then - info = {}; - info.text = L["TITAN_PANEL_MENU_SHOW_LABEL_TEXT"]; - info.value = plugin.id - info.arg1 = plugin.id - info.func = function(self, p_id) -- (self, info.arg1, info.arg2) - TitanPanelRightClickMenu_ToggleVar({ p_id, "ShowLabelText", nil }) - end - info.keepShownOnClick = 1; - info.checked = TitanGetVar(plugin.id, "ShowLabelText"); - info.disabled = nil; - TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); - end + -- build debug output + local str = "_InitPanelBarButton" + .. " " .. tostring(reason) .. "" + Titan_Debug.Out('titan', 'bars_setup', str) + TitanPanelBarButton_DisplayBarsWanted("InitPanelBarButton") +end - --ShowRegularText (LDB data sources only atm) - if plugin.controlVariables.ShowRegularText then - info = {}; - info.text = L["TITAN_PANEL_MENU_SHOW_PLUGIN_TEXT"] - info.value = plugin.id - info.arg1 = plugin.id - info.func = function(self, p_id) -- (self, info.arg1, info.arg2) - TitanPanelRightClickMenu_ToggleVar({ p_id, "ShowRegularText", nil }) - end - info.keepShownOnClick = 1; - info.checked = TitanGetVar(plugin.id, "ShowRegularText"); - info.disabled = nil; - TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); - end +---Titan Handle ADDON_LOADED Minimal setup in prep for player login. +function TitanPanelBarButton:ADDON_LOADED(addon) + if addon == TITAN_ID then + _G[TITAN_PANEL_CONTROL]:RegisterEvent("PLAYER_ENTERING_WORLD") - --ShowColoredText - if plugin.controlVariables.ShowColoredText then - info = {}; - info.text = L["TITAN_PANEL_MENU_SHOW_COLORED_TEXT"]; - info.value = plugin.id - info.arg1 = plugin.id - info.func = function(self, p_id) -- (self, info.arg1, info.arg2) - TitanPanelRightClickMenu_ToggleVar({ p_id, "ShowColoredText", nil }) - end - info.keepShownOnClick = 1; - info.checked = TitanGetVar(plugin.id, "ShowColoredText"); - info.disabled = nil; - TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); - end + Titan_Debug.Out('titan', 'events', "ADDON_LOADED") - -- Right-side plugin - if plugin.controlVariables.DisplayOnRightSide then - info = {}; - info.text = L["TITAN_PANEL_MENU_LDB_SIDE"]; - info.value = plugin.id - info.arg1 = plugin.id - info.func = function(self, p_id) -- (self, info.arg1, info.arg2) - TitanToggleVar(p_id, "DisplayOnRightSide") - local bar = TitanUtils_GetWhichBar(p_id) - TitanPanel_RemoveButton(p_id); - TitanUtils_AddButtonOnBar(bar, p_id); - end - info.checked = TitanGetVar(plugin.id, "DisplayOnRightSide"); - info.disabled = nil; - TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); - end - end + -- Unregister event - saves a few event calls. + self:UnregisterEvent("ADDON_LOADED"); + self.ADDON_LOADED = nil end end ----local Build the list of plugins for the category the mouse is over - Titan (right click) menu. ----@param frame string Frame to add to -local function BuildPluginCategoryMenu(frame) - local info = {}; +local function AddPlugin(owner, bar, category) local plugin; for index, id in pairs(TitanPluginsIndex) do plugin = TitanUtils_GetPlugin(id) if plugin then -- add the plugin to the menu plugin.category = plugin and plugin.category or "General"; - if (TitanPanelRightClickMenu_GetDropdMenuValue() == R_ADDONS .. plugin.category) then + if (plugin.category == category) then + local internal_bar, which_bar, which_frame_str = TitanUtils_GetWhichBar(id) if not TitanGetVar(id, "ForceBar") - or (TitanGetVar(id, "ForceBar") == TitanBarData[frame].name) then - info = {}; + or (TitanGetVar(id, "ForceBar") == TitanBarData[bar:GetName()].name) then + local info = {}; local ver = plugin and plugin.version or "" if TitanPanelGetVar("VersionShown") then if ver == nil or ver == "" then @@ -2204,36 +2006,29 @@ local function BuildPluginCategoryMenu(frame) info.text = plugin and plugin.menuText .. ver or "" -- Add Bar - local internal_bar, which_bar = TitanUtils_GetWhichBar(id) if which_bar == nil then -- Plugin not shown else - -- if internal_bar == TitanBarData[frame].name then - -- info.text = info.text .. TitanUtils_GetGreenText(" (" .. which_bar .. ")") - -- else info.text = info.text .. TitanUtils_GetGoldText(" (" .. which_bar .. ")") - -- end end - if plugin.controlVariables then - info.hasArrow = 1; - end - info.value = R_PLUGIN .. id; -- for next level dropdown - info.arg1 = frame; - info.arg2 = id; - info.func = function(self, frame_str, plugin_id) -- (self, info.arg1, info.arg2) - -- frame_str is the bar the user clicked to get the menu... - local bar = TitanBarData[frame_str].name - - if TitanPanel_IsPluginShown(plugin_id) then - TitanPanel_RemoveButton(plugin_id); - else - TitanUtils_AddButtonOnBar(bar, plugin_id) - end - end - info.checked = TitanPanel_IsPluginShown(id) or nil - info.keepShownOnClick = 1; - TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); + local opts_plugin = Titan_Menu.AddSelectorGeneric(owner, info.text, + function(data) + return (TitanPanel_IsPluginShown(data.p_id) or false) + end, + function(data) + -- frame_str is the bar the user clicked to get the menu... + local p_bar = TitanBarData[data.f_str].name + + if TitanPanel_IsPluginShown(data.p_id) then + TitanPanel_RemoveButton(data.p_id); + else + TitanUtils_AddButtonOnBar(p_bar, data.p_id) + end + end, + { f_str = bar:GetName(), p_id = id } + ) + Titan_Menu.AddControlVars(opts_plugin, id) end end else @@ -2241,148 +2036,117 @@ local function BuildPluginCategoryMenu(frame) end end -local function BuildBarList() - local info = {}; +---Generate and display right click menu options for user. +---@param owner table Plugin frame +---@param rootDescription table Menu context root +local function GeneratorFunction(owner, rootDescription) + local bar = owner + local id = owner.registry.id + local root = rootDescription -- menu widget to start with - -- sort the bar data by their intended order - local bar_list = {} - for _, v in pairs(TitanBarData) do - bar_list[v.order] = v + Titan_Menu.AddText(root, L["TITAN_PANEL_MENU_PLUGINS"]) + 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 opts_plugins = Titan_Menu.AddButton(root, cat) + AddPlugin(opts_plugins, bar, cat) -- if same category + end end - table.sort(bar_list, function(a, b) - return a.order < b.order - end) - for idx = 1, #bar_list do - local v = bar_list[idx] -- process this bar - local name = v.locale_name - local bar_data = TitanBarDataVars[v.frame_name] + Titan_Menu.AddDivider(root) - info = {}; - info.text = name - info.value = v.frame_name - info.arg1 = v.frame_name - info.func = function(self, arg1) -- (self, info.arg1, info.arg2) - TitanBarDataVars[arg1].show = not TitanBarDataVars[arg1].show - TitanPanelBarButton_DisplayBarsWanted(arg1 .. " right click menu " .. tostring(TitanBarDataVars[arg1].show)) + ----------------- + -- Bars - Show / Hide + local opts_bars = Titan_Menu.AddButton(root, L["TITAN_PANEL_MENU_OPTIONS_BARS"]) + do + -- sort the bar data by their intended order + local bar_list = {} + for _, v in pairs(TitanBarData) do + bar_list[v.order] = v end - --info.keepShownOnClick = 1; - info.checked = bar_data.show - info.disabled = nil; - TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); - end -end + table.sort(bar_list, function(a, b) + return a.order < b.order + end) ----Titan This is the controller for the Titan (right click) menu. ----@param self table Titan bar frame that was right clicked ---- Frame name used is RightClickMenu -function TitanPanelRightClickMenu_PrepareBarMenu(self) - -- Determine which bar was clicked on - -- local s, e, frame = string.find(self:GetName(), "(.*)RightClickMenu"); - local s, e, frame = string.find(self:GetName(), "(.*)" .. TITAN_PANEL_CLICK_MENU_SUFFIX); - local lev = (TitanPanelRightClickMenu_GetDropdownLevel() or 1) - --[[ -print("_prep R click" -.." "..tostring(frame).."" -.." "..tostring(lev).."" -) ---]] + for idx = 1, #bar_list do + local v = bar_list[idx] -- process this bar + local name = v.locale_name - -- Level 1 - --[===[ - Title - - ---- - Plugins - - ---- - Configuration => Opens Titan Options - ----- - Profiles - Manage > - Save => Save current profile (used for Global) - ----- - Use Global Profile - > - ---- - Hide => Hide this Bar - --]===] - if lev == 1 then - BuildMainMenu(frame) - end - - -- Level 2 - -- Plugin Categories => Plugins in that category - -- OR - -- Profiles => Server / Realm list - -- OR - -- Bars =? Show checkbox - if (lev == 2) then - if string.find(TitanPanelRightClickMenu_GetDropdMenuValue(), R_ADDONS) then - BuildPluginCategoryMenu(frame) + Titan_Menu.AddSelectorGeneric(opts_bars, name, + function(data) + return TitanBarDataVars[data.f_str].show + end, + function(data) + TitanBarDataVars[data.f_str].show = not TitanBarDataVars[data.f_str].show + TitanPanelBarButton_DisplayBarsWanted(data.f_str .. + " right click menu " .. tostring(TitanBarDataVars[data.f_str].show)) + end, + { f_str = v.frame_name } + ) end + end + Titan_Menu.AddDivider(root) - if (TitanPanelRightClickMenu_GetDropdMenuValue() == R_BARS_SETTING) then - BuildBarList() +-- Hold off for a rewrite using Blizz API over Ace + if Titan_Global.switch.midnight then + -- disable until we figure this out + else + ----------------- + -- Config - just one button to open the first Titan option screen + Titan_Menu.AddCommand(root, id, L["TITAN_PANEL_MENU_CONFIGURATION"], + function() + TitanUpdateConfig("init") + AceConfigDialog:Open("Titan") end - - return; + ) end - -- Level 3 - -- Plugin Categories => Plugins in that category => Plugin defined options - -- OR - -- Profiles > Server / Realm list > Character on realm list - if (lev == 3) then - if string.find(TitanPanelRightClickMenu_GetDropdMenuValue(), R_PLUGIN) then - BuildPluginMenu() + Titan_Menu.AddDivider(root) + + ----------------- + -- Profiles + Titan_Menu.AddCommand(root, id, L["TITAN_PANEL_MENU_PROFILES"] .. " " .. L["TITAN_PANEL_MENU_CONFIGURATION"], + function() + TitanUpdateConfig("init") + AceConfigDialog:Open("Titan Panel Addon Chars") end - return; - end -end + ) ----Titan Determine if the given plugin is on any Titan bar. ----@param id string Unique ID of the plugin ----@return boolean shown True on a Titan bar even if hidden or on auto hide -function TitanPanel_IsPluginShown(id) - if (id and TitanPanelSettings) then - return TitanUtils_TableContainsValue(TitanPanelSettings.Buttons, id) - else - return false - end -end + local res = TitanVariables_GetProfile(TitanUtils_GetPlayer()) + Titan_Menu.AddText(root, res.cname) ----Titan Determine if the given plugin is / would be on right or left of a Titan bar. ----@param id string Unique ID of the plugin ----@return string R_L TITAN_RIGHT("Right") or TITAN_Left("Left") -function TitanPanel_GetPluginSide(id) - if (TitanGetVar(id, "DisplayOnRightSide")) then - return TITAN_RIGHT; - else - return TITAN_LEFT; - end -end + Titan_Menu.AddDivider(root) ----Titan Set the scale, texture (graphic), and transparancy of all the Titan bars based on the user selection. ----@param reason string Debug note on where the call initiated -function TitanPanel_InitPanelBarButton(reason) - -- Set initial Panel Scale - TitanPanel_SetScale(); + Titan_Menu.AddCommand(root, id, L["TITAN_PANEL_MENU_HELP"], + function() + TitanUpdateConfig("init") + AceConfigDialog:Open("Titan Panel Help List") + end + ) - -- build debug output - local str = "_InitPanelBarButton" - .. " " .. tostring(reason) .. "" - Titan_Debug.Out('titan', 'bars_setup', str) - TitanPanelBarButton_DisplayBarsWanted("InitPanelBarButton") -end + Titan_Menu.AddDivider(root) + ----------------- + -- Hide this bar + local frame_str = owner:GetName() + Titan_Menu.AddCommand(root, id, (HIDE or "Hide"), + function(frame_bar) + TitanBarDataVars[frame_bar].show = not TitanBarDataVars[frame_bar].show + TitanPanelBarButton_DisplayBarsWanted(frame_bar .. " user clicked Hide") + end, + frame_str + ) +end -- --========================== -- Routines to handle creation of Titan bars -- ---Titan Create a Titan bar that can show plugins. ----@param frame_str string Unique ID of the plugin -function TitanPanelButton_CreateBar(frame_str) +---@param frame_str string Name of frame to create +---@param short_name string Short localized name of bar +function TitanPanelButton_CreateBar(frame_str, short_name) local this_bar = frame_str local a_bar = CreateFrame("Button", this_bar, UIParent, "Titan_Bar__Display_Template") @@ -2406,6 +2170,39 @@ function TitanPanelButton_CreateBar(frame_str) -- Static full width bar end + -- Jan 2026 Put .registry on each bar for the new menu scheme + -- A bit funky but the right click looks into .registry.menuContextFunction + -- off the frame for the menu function in the new scheme + local notes = "" + .. "Titan ONLY for menu, possibly more.\n" + a_bar.registry = { + id = short_name, + category = Titan_Global.categories.TitanBar, + version = TITAN_VERSION, + menuText = bar_data.locale_name, + --menuTextFunction = CreateMenu, -- OLD + menuContextFunction = GeneratorFunction, -- NEW scheme + --tooltipTitle = "", + --tooltipTextFunction = GetTooltipText, + --buttonTextFunction = FindGold, + icon = "Interface\\AddOns\\Titan\\Artwork\\Titan", + iconWidth = 16, + notes = notes, + controlVariables = { + ShowIcon = false, + ShowLabelText = false, + ShowRegularText = false, + ShowColoredText = false, + DisplayOnRightSide = false, + }, + savedVariables = { + ShowIcon = true, + ShowLabelText = false, + ShowColoredText = true, + DisplayOnRightSide = false, + } + }; + -- ====== -- Bounds only effective on Short bars for now -- Min : No smaller than the padding & one icon @@ -2446,54 +2243,5 @@ end --====== deprecated / Unused --[====[ ---[[ local -NAME: TitanPanel_CreateABar -DESC: Helper to add scripts to the Titan bar passed in. -VAR: frame - The frame name (string) of the Titan bar to create -OUT: None -NOTE: -- This also creates the hider bar in case the user want to use auto hide. -:NOTE ---]] -local function TitanPanel_CreateABar(frame) - if frame then - local bar_name = TitanBarData[frame].name - local bar_width = TitanBarData[frame].width - - if bar_name then - -- Set script handlers for display - _G[frame]:RegisterForClicks("LeftButtonUp", "RightButtonUp"); - _G[frame]:SetScript("OnEnter", function(self) TitanPanelBarButton_OnEnter(self) end) - _G[frame]:SetScript("OnLeave", function(self) TitanPanelBarButton_OnLeave(self) end) - _G[frame]:SetScript("OnClick", function(self, button) TitanPanelBarButton_OnClick(self, button) end) - _G[frame]:SetWidth(bar_width) - - local hide_name = TitanBarData[frame].hider - if hide_name then - -- Set script handlers for display - _G[hide_name]:RegisterForClicks("LeftButtonUp", "RightButtonUp"); - _G[hide_name]:SetScript("OnEnter", function(self) TitanPanelBarButtonHider_OnEnter(self) end) - _G[hide_name]:SetScript("OnLeave", function(self) TitanPanelBarButtonHider_OnLeave(self) end) - _G[hide_name]:SetScript("OnClick", function(self, button) TitanPanelBarButton_OnClick(self, button) end) - - _G[hide_name]:SetFrameStrata("BACKGROUND") - _G[hide_name]:SetWidth(bar_width) - _G[hide_name]:SetHeight(TITAN_PANEL_BAR_HEIGHT/2); - end - - -- Set the display bar - local container = _G[frame] - container:SetHeight(TITAN_PANEL_BAR_HEIGHT); - -- Set local identifier - local container_text = _G[frame.."_Text"] - if container_text then -- was used for debug/creating of the independent bars - container_text:SetText(tostring(bar_name)) - -- for now show it - container:Show() - end - end - else - end -end --]====] diff --git a/Titan/Titan.toc b/Titan/Titan.toc index 1939754..099278e 100644 --- a/Titan/Titan.toc +++ b/Titan/Titan.toc @@ -1,9 +1,9 @@ -## Interface: 120001, 120000, 110207, 50503, 20505, 11508 -## Title: Titan Panel [|cffeda55f_Core_|r] |cff00aa009.0.2|r +## Interface: 120000, 110207, 50503, 20505, 11508 +## Title: Titan Panel [|cffeda55f_Core_|r] |cff00aa009.1.0-pre|r ## Author: Titan Panel Dev Team -## Version: 9.0.2 -## IconTexture: Interface\Icons\Achievement_Dungeon_UlduarRaid_Titan_01 -## SavedVariables: TitanAll, TitanSettings, TitanSkins, ServerTimeOffsets, ServerHourFormat +## Version: 9.1.0-pre +## IconTexture: Interface\AddOns\Titan\Artwork\Titan +## SavedVariables: TitanAll, TitanSettings, TitanSkins ## Notes: Adds display bars to show and control information/launcher plugins. ## Category-enUS: User Interface ## Category-deDE: Benutzerinterface @@ -56,6 +56,7 @@ locale\Localization.TW.lua TitanDebug.lua TitanGlobal.lua TitanUtils.lua +TitanMenu.lua TitanHistory.lua TitanVariables.lua TitanTemplate.xml diff --git a/Titan/TitanConfig.lua b/Titan/TitanConfig.lua index 904b13c..2fa95d0 100644 --- a/Titan/TitanConfig.lua +++ b/Titan/TitanConfig.lua @@ -33,7 +33,6 @@ TITAN_PANEL_CONFIG = { 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"], im_ex_port = "Import / Export", --L["TITAN_PANEL_MENU_HELP"], adjust = "Frame Adjustment", @@ -299,11 +298,11 @@ local function TitanUpdateAdj(t, pos) name = Titan_Global.literals.use, order = position, get = function(info) - local frame_str = info[1] + local frame_str = f_name return TitanAdjustSettings[frame_str].adjust end, set = function(info, val) - local frame_str = info[1] + local frame_str = f_name TitanAdjustSettings[frame_str].adjust = not TitanAdjustSettings[frame_str].adjust TitanPanel_AdjustFrame(frame_str, "Adjust show changed : " .. tostring(TitanAdjustSettings[frame_str].adjust)) @@ -321,18 +320,12 @@ local function TitanUpdateAdj(t, pos) max = 600, step = 1, get = function(info) - local frame_str = info[1] + local frame_str = f_name return TitanAdjustSettings[frame_str].offset end, set = function(info, a) - local frame_str = info[1] + local frame_str = f_name TitanAdjustSettings[frame_str].offset = a - --[[ -print("Cfg Adj" -.." '"..tostring(frame_str).."'" -.." "..tostring(a).."" -) ---]] TitanPanel_AdjustFrame(frame_str, "Adjust offset changed : " .. tostring(a)) end, } @@ -347,14 +340,6 @@ print("Cfg Adj" -- Config Tables changed! AceConfigRegistry:NotifyChange("Titan Panel Bars") - --[===[ -print("Color new:" -.." "..tostring(format("%0.1f", r)).."" -.." "..tostring(format("%0.1f", g)).."" -.." "..tostring(format("%0.1f", b)).."" -.." "..tostring(format("%0.1f", a)).."" -) ---]===] end local function BuildAdj() @@ -411,8 +396,8 @@ VAR: None OUT: None --]] local function TitanUpdateConfigBars(t, pos) - local function IfColor(info) - local frame_str = TitanVariables_GetFrameName(info[1]) + local function IfColor(info, bar_short) + local frame_str = TitanVariables_GetFrameName(bar_short) return (TitanBarDataVars[frame_str].texure == Titan_Global.COLOR) end @@ -460,13 +445,13 @@ local function TitanUpdateConfigBars(t, pos) name = L["TITAN_PANEL_MENU_DISPLAY_BAR"], order = position, get = function(info) - local frame_str = TitanVariables_GetFrameName(info[1]) + local frame_str = TitanVariables_GetFrameName(v.name) return TitanBarDataVars[frame_str].show end, set = function(info, val) - local frame_str = TitanVariables_GetFrameName(info[1]) + local frame_str = TitanVariables_GetFrameName(v.name) TitanBarDataVars[frame_str].show = not TitanBarDataVars[frame_str].show - TitanPanelBarButton_DisplayBarsWanted(info[1] .. "Show " .. tostring(val)) + TitanPanelBarButton_DisplayBarsWanted(v.name .. "Show " .. tostring(val)) TitanUpdateConfigBars(optionsBars.args, 1000) end, } @@ -478,11 +463,11 @@ local function TitanUpdateConfigBars(t, pos) order = position, disabled = (v.hider == nil), get = function(info) - local frame_str = TitanVariables_GetFrameName(info[1]) + local frame_str = TitanVariables_GetFrameName(v.name) return TitanBarDataVars[frame_str].auto_hide end, set = function(info, val) - Titan_AutoHide_ToggleAutoHide(info[1]) -- short bar name + Titan_AutoHide_ToggleAutoHide(v.name) -- short bar name end, } position = position + 1 -- Center toggle @@ -492,11 +477,11 @@ local function TitanUpdateConfigBars(t, pos) name = L["TITAN_PANEL_MENU_CENTER_TEXT"], order = position, get = function(info) - local frame_str = TitanVariables_GetFrameName(info[1]) + local frame_str = TitanVariables_GetFrameName(v.name) return (TitanBarDataVars[frame_str].align == TITAN_PANEL_BUTTONS_ALIGN_CENTER) end, set = function(info) - local frame_str = TitanVariables_GetFrameName(info[1]) + local frame_str = TitanVariables_GetFrameName(v.name) if (TitanBarDataVars[frame_str].align == TITAN_PANEL_BUTTONS_ALIGN_CENTER) then TitanBarDataVars[frame_str].align = TITAN_PANEL_BUTTONS_ALIGN_LEFT else @@ -515,11 +500,11 @@ local function TitanUpdateConfigBars(t, pos) desc = L["TITAN_PANEL_MENU_HIDE_IN_COMBAT_DESC"], order = position, get = function(info) - local frame_str = TitanVariables_GetFrameName(info[1]) + local frame_str = TitanVariables_GetFrameName(v.name) return TitanBarDataVars[frame_str].hide_in_combat end, set = function(info) - local frame_str = TitanVariables_GetFrameName(info[1]) + local frame_str = TitanVariables_GetFrameName(v.name) TitanBarDataVars[frame_str].hide_in_combat = not TitanBarDataVars[frame_str].hide_in_combat end, @@ -532,23 +517,16 @@ local function TitanUpdateConfigBars(t, pos) desc = L["TITAN_PANEL_MENU_HIDE_IN_COMBAT_DESC"] .. " " .. Titan_Global.literals.pvp, order = position, get = function(info) - local frame_str = TitanVariables_GetFrameName(info[1]) + local frame_str = TitanVariables_GetFrameName(v.name) return TitanBarDataVars[frame_str].hide_in_pvp end, set = function(info) - local frame_str = TitanVariables_GetFrameName(info[1]) + local frame_str = TitanVariables_GetFrameName(v.name) TitanBarDataVars[frame_str].hide_in_pvp = not TitanBarDataVars[frame_str].hide_in_pvp end, } position = position + 1 -- spacer - args[v.name].args.transpacer1 = { - order = position, - type = "description", - width = "full", - name = " ", - } - position = position + 1 -- spacer args[v.name].args.resetposspacer = { order = position, type = "description", @@ -563,39 +541,46 @@ local function TitanUpdateConfigBars(t, pos) order = position, disabled = (v.vert == TITAN_TOP or v.vert == TITAN_BOTTOM), func = function(info, arg1) - local frame_str = TitanVariables_GetFrameName(info[1]) + local frame_str = TitanVariables_GetFrameName(v.name) TitanVariables_SetBarPos(_G[frame_str], true) - TitanPanelBarButton_DisplayBarsWanted("Bar reset to default position - " .. tostring(info[1])) + TitanPanelBarButton_DisplayBarsWanted("Bar reset to default position - " .. tostring(v.name)) end, } --[[ - -- ====== - -- Background group - position = position + 1 -- global background - args[v.name].args.globalbackground = { - name = BACKGROUND, - type = "group", - inline = true, + position = position + 1 -- spacer + args[v.name].args.offsetyspacer1 = { + type = "header", + name = "-", order = position, - hidden = function(info) - local hide = false - if TitanBarDataVars["Global"].texure == Titan_Global.NONE then - hide = true - else - hide = false -- skin or color is set global - end - return hide + width = "full", + } + position = position + 1 -- spacer + args[v.name].args.yoffset = { + type = "range", + width = "full", + name = "Plugin Y Offset", + order = position, + min = -12, + max = 12, + step = .5, + get = function(info) + local frame_str = TitanVariables_GetFrameName(v.name) + return TitanBarDataVars[frame_str].plugin_off_y + end, + set = function(info, a) + local frame_str = TitanVariables_GetFrameName(v.name) + +print("Config Y" +.." "..tostring(v.name).."" +.." "..tostring(frame_str).."" +.." "..tostring(a).."" +) TitanBarDataVars[frame_str].plugin_off_y = a + -- Justify button position + TitanPanelButton_Justify(); end, - args = { - globalskins = { - type = "header", - name = L["TITAN_PANEL_MENU_GLOBAL_SKIN_TITLE"], - order = 100, - width = "full", - }, - }, } --]] + position = position + 1 -- background args[v.name].args.background = { name = BACKGROUND, @@ -622,11 +607,11 @@ local function TitanUpdateConfigBars(t, pos) width = "full", style = "radio", get = function(info) - local frame_str = TitanVariables_GetFrameName(info[1]) + local frame_str = TitanVariables_GetFrameName(v.name) return TitanBarDataVars[frame_str].texure end, set = function(info, val) - local frame_str = TitanVariables_GetFrameName(info[1]) + local frame_str = TitanVariables_GetFrameName(v.name) TitanBarDataVars[frame_str].texure = val TitanPanel_SetBarTexture(frame_str) end, @@ -640,7 +625,7 @@ local function TitanUpdateConfigBars(t, pos) type = "group", inline = true, hidden = function(info) - return not IfColor(info) + return not IfColor(info, v.name) end, order = 110, args = { @@ -658,7 +643,7 @@ local function TitanUpdateConfigBars(t, pos) -- disabled = (v.vert == TITAN_TOP or v.vert == TITAN_BOTTOM), hasAlpha = true, get = function(info) - local frame_str = TitanVariables_GetFrameName(info[1]) + local frame_str = TitanVariables_GetFrameName(v.name) local color = TitanBarDataVars[frame_str].color return color.r, color.g, @@ -666,7 +651,7 @@ local function TitanUpdateConfigBars(t, pos) color.alpha end, set = function(info, r, g, b, a) - local frame_str = TitanVariables_GetFrameName(info[1]) + local frame_str = TitanVariables_GetFrameName(v.name) TitanBarDataVars[frame_str].color.r = r TitanBarDataVars[frame_str].color.g = g @@ -681,14 +666,14 @@ local function TitanUpdateConfigBars(t, pos) name = "Show Border", --L["TITAN_PANEL_MENU_DISPLAY_BAR"], order = 350, get = function(info) - local frame_str = TitanVariables_GetFrameName(info[1]) + local frame_str = TitanVariables_GetFrameName(v.name) return TitanBarDataVars[frame_str].color_border end, set = function(info, val) - local frame_str = TitanVariables_GetFrameName(info[1]) + local frame_str = TitanVariables_GetFrameName(v.name) TitanBarDataVars[frame_str].color_border = not TitanBarDataVars[frame_str].color_border TitanPanel_SetBarTexture(frame_str) --- TitanUpdateConfigBars(optionsBars.args, 1000) + -- TitanUpdateConfigBars(optionsBars.args, 1000) end, } }, @@ -698,7 +683,7 @@ local function TitanUpdateConfigBars(t, pos) type = "group", inline = true, hidden = function(info) - return IfColor(info) + return IfColor(info, v.name) end, order = 111, args = { @@ -714,20 +699,20 @@ local function TitanUpdateConfigBars(t, pos) name = "", order = 130, get = function(info) - local frame_str = TitanVariables_GetFrameName(info[1]) + local frame_str = TitanVariables_GetFrameName(v.name) return TitanBarDataVars[frame_str].skin.path end, set = function(info, val) - local frame_str = TitanVariables_GetFrameName(info[1]) + local frame_str = TitanVariables_GetFrameName(v.name) TitanBarDataVars[frame_str].skin.path = val TitanPanel_SetBarTexture(frame_str) - if TitanSkinToRemove == TitanPanelGetVar("Texture" .. info[1]) then + if TitanSkinToRemove == TitanPanelGetVar("Texture" .. v.name) then TitanSkinToRemove = "None" end end, values = function(info) local Skinlist = {} - local frame_str = TitanVariables_GetFrameName(info[1]) + local frame_str = TitanVariables_GetFrameName(v.name) for _, val in pairs(TitanSkins) do if val.path ~= TitanBarDataVars[frame_str].skin.path then -- if val.path ~= TitanPanelGetVar("Texture"..v.name) then @@ -752,7 +737,7 @@ local function TitanUpdateConfigBars(t, pos) skinselected = { name = "", image = function(info) - local frame_str = TitanVariables_GetFrameName(info[1]) + local frame_str = TitanVariables_GetFrameName(v.name) local vert = TitanBarData[frame_str].vert if vert == TITAN_SHORT then vert = TITAN_TOP @@ -775,11 +760,11 @@ local function TitanUpdateConfigBars(t, pos) max = 1, step = 0.01, get = function(info) - local frame_str = TitanVariables_GetFrameName(info[1]) + local frame_str = TitanVariables_GetFrameName(v.name) return TitanBarDataVars[frame_str].skin.alpha end, set = function(info, a) - local frame_str = TitanVariables_GetFrameName(info[1]) + local frame_str = TitanVariables_GetFrameName(v.name) _G[frame_str]:SetAlpha(a) TitanBarDataVars[frame_str].skin.alpha = a end, @@ -789,17 +774,6 @@ local function TitanUpdateConfigBars(t, pos) }, } end - - -- Config Tables changed! - -- AceConfigRegistry:NotifyChange("Titan Panel Bars") - --[===[ -print("Color new:" -.." "..tostring(format("%0.1f", r)).."" -.." "..tostring(format("%0.1f", g)).."" -.." "..tostring(format("%0.1f", b)).."" -.." "..tostring(format("%0.1f", a)).."" -) ---]===] end local function BuildBars() @@ -939,7 +913,7 @@ local function UpdateConfigAddons() local header = (plug_in.menuText or "") args[plug_in.id] = { type = "group", - name = ColorVisible(plug_in.id, plug_in.menuText or ""), + name = ColorVisible(plug_in.id, plug_in.menuText_NC or ""), order = idx, args = { name = { @@ -951,9 +925,17 @@ local function UpdateConfigAddons() type = "toggle", name = L["TITAN_PANEL_MENU_SHOW"], order = 3, - get = function(info) return (TitanPanel_IsPluginShown(info[1])) end, + get = function(info) +print("TConfig Show get" +.." "..tostring(info[1]).."" +) + return (TitanPanel_IsPluginShown(info[1])) end, set = function(info, v) local name = info[1] +print("TConfig Show get" +.." "..tostring(info[1]).."" +.." "..tostring(v).."" +) if v then -- Show / add local bar = (TitanGetVar(name, "ForceBar") or TitanUtils_PickBar()) if type(bar) == 'string' then -- sanity and IDE @@ -1320,20 +1302,19 @@ end ---Allow the user to load / delete / reset / sync profile data local function TitanUpdateChars() - local p_info = {} -- used to hold info about each toon in players - local 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 - -- collect some info on THIS toon for the config local this_toon = {} - local _, server = TitanUtils_ParseName(index) + local _, server, is_custom = TitanUtils_ParseName(index) -- color code the name -- - gold for normal profiles -- - green for custom profiles - if server == TITAN_CUSTOM_PROFILE_POSTFIX then + if is_custom then this_toon.fancy_name = TitanUtils_GetGreenText((index or "?")) this_toon.is_custom = true else @@ -1402,23 +1383,39 @@ local function TitanUpdateChars() order = position, } - do -- toon info - local toon = this_toon.name - if TitanSettings.Players[toon].Info then -- display - local itoon = TitanSettings.Players[toon].Info + do -- profile toon info + local custom_toon, toon_info = TitanUtils_GetPlayerInfo(this_toon.name) + if custom_toon then + -- Cannot login; There is no info to show. + elseif toon_info == nil then + -- For now show nothing + else -- display + local itoon = 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, + name = "Last Logout : " .. logout, --width = "0.5", cmdHidden = true, order = position, } + if itoon.zoneText == nil or itoon.subZoneText == nil then + -- not filled in + else + position = position + 1 + p_args[tostring(position)] = { + type = "description", + name = "@ : " .. itoon.zoneText .. " " .. itoon.subZoneText, + --width = "0.5", + cmdHidden = true, + order = position, + } + end position = position + 1 p_args[tostring(position)] = { type = "description", - name = "Level : "..itoon.levelText, + name = "Level : " .. itoon.levelText, width = "0.5", cmdHidden = true, order = position, @@ -1426,7 +1423,7 @@ local function TitanUpdateChars() position = position + 1 p_args[tostring(position)] = { type = "description", - name = "Faction : "..itoon.faction, + name = "Faction : " .. itoon.faction, width = "0.5", cmdHidden = true, order = position, @@ -1434,7 +1431,7 @@ local function TitanUpdateChars() position = position + 1 p_args[tostring(position)] = { type = "description", - name = "Class : "..itoon.class, + name = "Class : " .. itoon.class, width = "0.5", cmdHidden = true, order = position, @@ -1442,64 +1439,33 @@ local function TitanUpdateChars() position = position + 1 p_args[tostring(position)] = { type = "description", - name = "Race : "..itoon.race, + 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 + 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 + do -- profile Gold + if TitanGold then -- at least loaded if this_toon.is_custom then - -- can not log in to custom so NA - gold_str = "Gold : "..L["TITAN_PANEL_NA"] + -- Cannot login; There is no info to show. else - local name, server = TitanUtils_ParseName(this_toon.name) - local faction = UnitFactionGroup("Player") - gold_str = tostring(TitanPanel_GoldGetGold(name, server, faction)) + if TitanGold.GetInfo then -- it is at least loaded + position = position + 1 + p_args[tostring(position)] = { + name = TitanGold.GetInfo(this_toon.name, true), -- Let Gold decide what to display + order = position, + type = "description", + } + end end - else - -- not enabled - gold_str = "Gold : "..L["TITAN_PANEL_MENU_DISABLED"] end - - position = position + 1 - p_args[tostring(position)] = { - name = gold_str, - order = position, - type = "description", - } end do -- profile Mail - position = position + 1 - p_args[tostring(position)] = { - type = "description", - name = "", - cmdHidden = true, - order = position, - } - + --[[ position = position + 1 p_args[tostring(position)] = { type = "header", @@ -1507,53 +1473,56 @@ local function TitanUpdateChars() cmdHidden = true, order = position, } + --]] - local post_str = "" - local post_button = TitanUtils_GetButton("Post") - if post_button and post_button:IsShown() then - -- Is enabled + if TitanPost then -- it is at least loaded 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 + local post_str = "" + local post_button = TitanUtils_GetButton("Post") + post_str = L["TITAN_PANEL_NA"] + if post_button and post_button:IsShown() then + post_str = TitanPost.GetInfo(this_toon.name, true) - 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), - } + position = position + 1 + p_args[tostring(position)] = { + name = post_str, + order = position, + type = "description", + } - 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, - } + 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(this_toon.name) + TitanPrint( + "Clear Mail info" + .. " > " .. this_toon.name .. "" + , "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), + } + + position = position + 1 + p_args[tostring(position)] = { + type = "description", + name = "", + cmdHidden = true, + order = position, + } + else + -- not enabled + post_str = L["TITAN_PANEL_MENU_DISABLED"] + end + end + end end do -- profile load / delete @@ -1587,10 +1556,10 @@ local function TitanUpdateChars() type = "execute", -- width = "0.4", func = function(info, v) - TitanVariables_UseSettings(info[1], TitanUtils_GetPlayer(), TITAN_PROFILE_USE) + TitanVariables_UseSettings(this_toon.name, TitanUtils_GetPlayer(), TITAN_PROFILE_USE) TitanPrint( L["TITAN_PANEL_MENU_LOAD_SETTINGS"] - .. " > " .. info[1] .. "" + .. " > " .. this_toon.name .. "" , "info") end, -- does not make sense to load current character profile @@ -1616,10 +1585,10 @@ local function TitanUpdateChars() type = "execute", -- width = "0.4", func = function(info, v) - TitanSettings.Players[info[1]] = nil -- delete the entry + TitanSettings.Players[this_toon.name] = nil -- delete the entry TitanPrint( L["TITAN_PANEL_MENU_PROFILE"] - .. " " .. info[1] .. " " + .. " " .. this_toon.name .. " " .. L["TITAN_PANEL_MENU_PROFILE_DELETED"] , "info") TitanUpdateChars() -- rebuild the toons @@ -1663,7 +1632,7 @@ local function TitanUpdateChars() type = "execute", --width = "1.0", func = function(info, v) - local selected = info[1] + local selected = this_toon.name local str = "" str = str .. " " .. tostring(selected) .. "" @@ -1702,8 +1671,8 @@ local function TitanUpdateChars() 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 + TitanPanel_SaveCustomProfile(this_toon.name) -- will output message on write + TitanUpdateChars() -- rebuild the toons end, } position = position + 1 @@ -1742,21 +1711,21 @@ local function TitanUpdateChars() --width = "full", func = function(info, v) local str = "" - TitanVariables_SetProfile(TitanUtils_GetPlayer(), Titan_Global.profile.SYNC, info[1]) + TitanVariables_SetProfile(TitanUtils_GetPlayer(), Titan_Global.profile.SYNC, this_toon.name) str = str .. " " .. tostring(Titan_Global.profile.SYNC) .. "" - .. " > '" .. tostring(info[1]) .. "'" + .. " > '" .. tostring(this_toon.name) .. "'" .. " : '" .. tostring(TITAN_PROFILE_USE) .. "'" Titan_Debug.Out('titan', 'profile', str) TitanPrint("" .. "" .. L["TITAN_PANEL_MENU_PROFILE_SYNC"] .. "" .. " '" .. TitanUtils_GetPlayer() .. "'" - .. " > '" .. tostring(info[1]) .. "'" + .. " > '" .. tostring(this_toon.name) .. "'" , "info") -- Change over to new profile - -- TitanVariables_UseSettings(nil, info[1], TITAN_PROFILE_USE) + -- TitanVariables_UseSettings(nil, this_toon.name, TITAN_PROFILE_USE) TitanVariables_UseSettings(nil, TitanUtils_GetPlayer(), TITAN_PROFILE_USE) TitanUpdateChars() AceConfigRegistry:NotifyChange("Titan Panel Addon Chars") @@ -1773,16 +1742,16 @@ local function TitanUpdateChars() type = "execute", func = function(info, v) local str = "" - TitanVariables_SetProfile(info[1], Titan_Global.profile.SYNC, Titan_Global.profile.NONE) + TitanVariables_SetProfile(this_toon.name, Titan_Global.profile.SYNC, Titan_Global.profile.NONE) str = str .. " " .. tostring(Titan_Global.profile.SYNC) .. "" - .. " > '" .. tostring(info[1]) .. "'" + .. " > '" .. tostring(this_toon.name) .. "'" .. " : '" .. tostring(Titan_Global.profile.NONE) .. "'" - .. " | '" .. tostring(info[1] == TitanUtils_GetPlayer()) .. "'" + .. " | '" .. tostring(this_toon.name == TitanUtils_GetPlayer()) .. "'" Titan_Debug.Out('titan', 'profile', str) - if info[1] == TitanUtils_GetPlayer() then + if this_toon.name == TitanUtils_GetPlayer() then -- Change over to new profile TitanVariables_UseSettings(nil, TitanUtils_GetPlayer(), TITAN_PROFILE_USE) else @@ -1791,7 +1760,7 @@ local function TitanUpdateChars() TitanPrint("" .. "" .. L["TITAN_PANEL_MENU_PROFILE_CLEAR_SYNC"] .. "" - .. " '" .. tostring(info[1]) .. "'" + .. " '" .. tostring(this_toon.name) .. "'" , "info") TitanUpdateChars() @@ -1832,17 +1801,17 @@ local function TitanUpdateChars() --width = "full", func = function(info, v) local str = "" - TitanVariables_SetProfile(TitanUtils_GetPlayer(), Titan_Global.profile.GLOBAL, info[1]) + TitanVariables_SetProfile(TitanUtils_GetPlayer(), Titan_Global.profile.GLOBAL, this_toon.name) str = str .. " " .. tostring(Titan_Global.profile.GLOBAL) .. "" - .. " > '" .. tostring(info[1]) .. "'" + .. " > '" .. tostring(this_toon.name) .. "'" .. " : '" .. tostring(TITAN_PROFILE_USE) .. "'" Titan_Debug.Out('titan', 'profile', str) TitanPrint("" .. "" .. "Sync All" .. "" - .. " > '" .. tostring(info[1]) .. "'" + .. " > '" .. tostring(this_toon.name) .. "'" , "info") -- Change over to new profile @@ -1870,7 +1839,7 @@ local function TitanUpdateChars() TitanPrint("" .. "" .. "Clear Sync All" .. "" - .. " > '" .. tostring(info[1]) .. "'" + .. " > '" .. tostring(this_toon.name) .. "'" , "info") -- Change over to new profile @@ -1883,6 +1852,54 @@ local function TitanUpdateChars() } end + do + position = position + 1 + p_args.sync_all_title = { + type = "header", + name = TitanUtils_GetGoldText("Uses as Sync"), + cmdHidden = true, + order = position, + } + if g_sync and (TitanAllGetVar("GlobalProfileName") == this_toon.name) then + position = position + 1 + p_args[tostring(position)] = { + type = "description", + name = ALL or "ALL", + cmdHidden = true, + order = position, + } + else + local has_sync = false + for index, id in pairs(TitanSettings.Players) do + if id.Panel["SyncWithProfile"] == this_toon.name then + -- This profile uses this toon as a Sync + position = position + 1 + p_args[tostring(position)] = { + type = "description", + name = tostring(index), + cmdHidden = true, + order = position, + } + has_sync = true + else + -- Any output would be confusing... + end + end + + if has_sync then + -- already listed + else + position = position + 1 + p_args[tostring(position)] = { + type = "description", + name = NONE or "None", + cmdHidden = true, + order = position, + } + end + end + end + -- tell the options screen there is a new list AceConfigRegistry:NotifyChange("Titan Panel Addon Chars") end @@ -1915,11 +1932,11 @@ local function TitanToonList() -- collect some info on THIS toon for the config local this_toon = {} - local _, server = TitanUtils_ParseName(index) + local _, server, is_custom = TitanUtils_ParseName(index) -- color code the name -- - gold for normal profiles -- - green for custom profiles - if server == TITAN_CUSTOM_PROFILE_POSTFIX then + if is_custom then this_toon.fancy_name = TitanUtils_GetGreenText((index or "?")) else this_toon.fancy_name = TitanUtils_GetGoldText((index or "?")) @@ -2143,10 +2160,24 @@ local optionsFrames = { type = "header", name = L["TITAN_PANEL_MENU_OPTIONS_TOOLTIPS"], }, + optiontooltiptimer = { + name = "Tooltip Timeout", --L["TITAN_PANEL_UISCALE_CONTROL_TITLE_UI"], + desc = "Time Tooltip stays after cursor leaves.", --L["TITAN_PANEL_UISCALE_SLIDER_DESC"], + order = 203, + type = "range", + width = "full", + min = 0.5, + max = 10, + step = 0.25, + get = function() return TitanPanelGetVar("TooltipTimeout") end, + set = function(_, a) + TitanPanelSetVar("TooltipTimeout", a); + end, + }, optiontooltip = { name = L["TITAN_PANEL_MENU_TOOLTIPS_SHOWN"], -- desc = L["TITAN_PANEL_MENU_TOOLTIPS_SHOWN"], - order = 201, + order = 205, type = "toggle", width = "full", get = function() return TitanPanelGetVar("ToolTipsShown") end, @@ -2471,12 +2502,6 @@ local optionsSkins = { ---Show the default Titan skins and any custom skins the user has added. local function Show_Skins(t, position) - --[[ - table.sort(TitanSkins, function(a, b) - return string.lower(TitanSkins[a].name) - < string.lower(TitanSkins[b].name) - end) ---]] local skin = "Skin" t[skin .. position] = { type = "description", @@ -2831,9 +2856,9 @@ local function TitanUpdateExtras() type = "execute", width = "full", func = function(info, v) - TitanPluginSettings[info[1]] = nil -- delete the config entry + TitanPluginSettings[name] = nil -- delete the config entry TitanPrint( - " '" .. info[1] .. "' " .. L["TITAN_PANEL_EXTRAS_DELETE_MSG"] + " '" .. name .. "' " .. L["TITAN_PANEL_EXTRAS_DELETE_MSG"] , "info") -- TitanVariables_ExtraPluginSettings() -- rebuild the list TitanUpdateExtras() -- rebuild the options config @@ -3595,8 +3620,117 @@ local function BuildHelpList() end end ---============= Build ther config +local titan_options = { + name = "Titan structure", + type = "group", + childGroups = "tab", + args = {} +} +local function BuiltTitanStructure() + do -- create for config frame; using most of the Blizz config structure + -- This is called from Titan menu and the slash command + titan_options.args = { + titan_entry = { + name = titan_entry.name, + order = 10, + type = "group", + args = titan_entry.args + }, + optionsBars = { + name = optionsBars.name, + order = 20, + type = "group", + args = optionsBars.args + }, + optionsGlobals = { + name = optionsGlobals.name, + order = 30, + type = "group", + args = optionsGlobals.args + }, + optionsAdjust = { + name = optionsAdjust.name, + order = 40, + type = "group", + args = optionsAdjust.args + }, + optionsFrames = { + name = optionsFrames.name, + order = 50, + type = "group", + args = optionsFrames.args + }, + optionsUIScale = { + name = optionsUIScale.name, + order = 60, + type = "group", + args = optionsUIScale.args + }, + optionsSkins = { + name = optionsSkins.name, + order = 70, + type = "group", + args = optionsSkins.args + }, + optionsSkinsCustom = { + name = optionsSkinsCustom.name, + order = 80, + type = "group", + args = optionsSkinsCustom.args + }, + optionsAddons = { + name = optionsAddons.name, + order = 90, + type = "group", + args = optionsAddons.args + }, + optionsAddonAttempts = { + name = optionsAddonAttempts.name, + order = 100, + type = "group", + args = optionsAddonAttempts.args + }, + optionsExtras = { + name = optionsExtras.name, + order = 110, + type = "group", + args = optionsExtras.args + }, + optionsChars = { + name = optionsChars.name, + order = 120, + type = "group", + args = optionsChars.args + }, + optionsImportExport = { + name = optionsImportExport.name, + order = 130, + type = "group", + args = optionsImportExport.args + }, + optionsAdvanced = { + name = optionsAdvanced.name, + order = 140, + type = "group", + args = optionsAdvanced.args + }, + changeHistory = { + name = changeHistory.name, + order = 150, + type = "group", + args = changeHistory.args + }, + helplist = { + name = helplist.name, + order = 160, + type = "group", + args = helplist.args + }, + } + end +end +--============= Build the config ---Build the entire Config table Ace will display local function BuildAll() -- Update the tables for the latest lists @@ -3611,6 +3745,7 @@ local function BuildAll() BuildAdj() BuildAdv() BuildHelpList() + BuiltTitanStructure() end ---Titan This routine will handle the requests to build or clear the Titan Config screens. @@ -3655,7 +3790,7 @@ do -- Register Titan main options list -- The first param needs to used for the 'add to options' -- The second param must be the table Ace will use to create the user options -- - AceConfig:RegisterOptionsTable("Titan Panel Main", titan_entry) + AceConfig:RegisterOptionsTable("Titan Panel About", titan_entry) AceConfig:RegisterOptionsTable("Titan Panel Bars", optionsBars) AceConfig:RegisterOptionsTable("Titan Panel Globals", optionsGlobals) AceConfig:RegisterOptionsTable("Titan Panel Adjust", optionsAdjust) @@ -3672,6 +3807,8 @@ do -- Register Titan main options list AceConfig:RegisterOptionsTable("Titan Panel Addon Changes", changeHistory) -- AceConfig:RegisterOptionsTable("Titan Panel Addon Slash", slashHelp) AceConfig:RegisterOptionsTable("Titan Panel Help List", helplist) + + AceConfigRegistry:RegisterOptionsTable("Titan", titan_options) end do -- Register the options for each entry in Titan option list @@ -3680,7 +3817,8 @@ do -- Register the options for each entry in Titan option list -- The second param should be the same as the .name of the cooresponding table that was registered, -- if not, any 'open' may fail. -- - AceConfigDialog:AddToBlizOptions("Titan Panel Main", titan_entry.name) + + AceConfigDialog:AddToBlizOptions("Titan Panel About", titan_entry.name) AceConfigDialog:AddToBlizOptions("Titan Panel Bars", optionsBars.name, titan_entry.name) AceConfigDialog:AddToBlizOptions("Titan Panel Globals", optionsGlobals.name, titan_entry.name) AceConfigDialog:AddToBlizOptions("Titan Panel Adjust", optionsAdjust.name, titan_entry.name) @@ -3697,4 +3835,6 @@ do -- Register the options for each entry in Titan option list 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 Help List", helplist.name, titan_entry.name) + +-- AceConfigDialog:AddToBlizOptions("Titan_Panel", "Titan") end diff --git a/Titan/TitanDebug.lua b/Titan/TitanDebug.lua index ae5b287..66be0a8 100644 --- a/Titan/TitanDebug.lua +++ b/Titan/TitanDebug.lua @@ -30,7 +30,7 @@ Titan_Debug.titan.events = false Then place calls in code : Titan_Debug.Out("titan", "events", debug_str) -Then set to display them. +Then set to turn display them. Titan_Debug.titan.events = true diff --git a/Titan/TitanGlobal.lua b/Titan/TitanGlobal.lua index 8d13ba2..acf611c 100644 --- a/Titan/TitanGlobal.lua +++ b/Titan/TitanGlobal.lua @@ -10,7 +10,8 @@ local L = LibStub("AceLocale-3.0"):GetLocale(TITAN_ID, true) -- Global variables -Titan_Global = {} -- begin the slow journey to a smaller _G footprint +Titan_Global = {} -- begin the slow journey to a smaller _G footprint +Titan_Menu = {} -- Hold API routines for new menu scheme Titan_Global.recent_changes = "" -- Titan_History.lua @@ -176,6 +177,10 @@ L["TITAN_PANEL_MENU_CATEGORIES"] = { L["TITAN_PANEL_MENU_CATEGORIES_06"], } +-- Intended for Titan only for internal 'plugins' such as Bars +Titan_Global.categories = {} +Titan_Global.categories.TitanBar = "Titan-bar" + -- Bar background types Titan_Global.SKIN = "skin" Titan_Global.COLOR = "color" @@ -231,7 +236,8 @@ Titan_Global.colors = { ---@field category? string The Titan menu category where this plugin will be placed ---@field version? string Plugin version ---@field menuText? string Localized string for the menu (right click) ----@field menuTextFunction? string | function Plugin function to call on right click +---@field menuTextFunction? string | function Plugin function to call on right click NEW Jan 2026 +---@field menuContextFunction? string | function Plugin function to call on right click ---@field buttonTextFunction? string | function Function to call when updating button display ---@field tooltipTitle? string Localized string for the menu ---@field tooltipTextFunction? string | function Function to call for a simple tooltip (OnEnter) diff --git a/Titan/TitanHistory.lua b/Titan/TitanHistory.lua index 004ccfc..a4f75c3 100644 --- a/Titan/TitanHistory.lua +++ b/Titan/TitanHistory.lua @@ -10,6 +10,68 @@ These are in a seperate file to --- Release notes. Keep structure; most recent on 'top' local recent_changes = { { + version = "9.1.0-pre", + when = "2026/02/02", + topics = { + { + topic = "Titan Menus", + lines = { + "!! Menus have been rewritten !! The new menus will look a little different.", + "-- Some menus were reordered or changed to fit the new scheme.", + "Devs : The older scheme and the new scheme work side by side.", + "-- .menuTextFunction will fail when Blizz removes deprecated code in the future - no idea when.", + "-- If you wish to update, please see Bags for old and new menu schemes explained.", + "Devs : Titan now honors color coding in registry.menuText.", + }, + }, + { + topic = "Titan Tooltips", + lines = { + "Internals changed due to Midnight 'secret' value errors, mostly in instances.", + "!! New option in Tooltips and Frames to adjust tooltip timer - .5 - 10 sec.", + "Devs : The registry.tooltipTitle is now optional allowing the title to be custom set.", + "Devs : If your tooltip is not right, please use Titan Discord to message us for assistance.", + "-- Especially if you use registry.tooltipCustomFunction ", + }, + }, + { + topic = "Titan Config", + lines = { + "Opening Config from Titan menu remains unavailable. Use Esc > Options as before.", + "Profile Config now shows some toon info, as well as Gold and Post info if they are enabled.", + }, + }, + { + topic = "Titan Gold", + lines = { + "!! On first login the tracked list will only show that toon !!", + "!! Gold data moved into Titan profiles, causing the need to login to toons again.", + "Menus are changed:", + "- 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.", + }, + }, + { + topic = "TitanPost", + lines = { + "New built-in! ", + "Button info: ", + ": ?? read/total from last open; ?? = not opened this session.", + ": !! number of toons with expiring mail.", + }, + }, + { + topic = "Titan Fixes", + lines = { + "- Loot : Should not error on mouse over of new gear.", + "- Titan : Should not get IsBattleground error on any WoW version.", + "- Performance : Should now honor selected number of addons.", + }, + }, + }, + }, + { version = "9.0.2", when = "2026/01/12", topics = { @@ -111,18 +173,6 @@ local recent_changes = { }, }, }, - { - version = "8.4.2", - when = "2025/11/01", - topics = { - { - topic = "Titan", - lines = { - "TOC update only.", - }, - }, - }, - }, } ---Format the release notes diff --git a/Titan/TitanMenu.lua b/Titan/TitanMenu.lua new file mode 100644 index 0000000..001fb30 --- /dev/null +++ b/Titan/TitanMenu.lua @@ -0,0 +1,1399 @@ +--[===[ File +Contains various utility routines used by +- Titan and Plugins for thehier menus (right click) 'drop down' +--]===] + +--[===[ +This large file contains various utility routines used by +The Drop Down Menu routines for the Right Click menu are in this file. + +The Titan routines abstract the menu creation built into WoW. + +Whenever there is a change to the menu routines, the abstractions : +: Insulate 3rd party Titan plugin authors from Blizz or lib changes. +: Allow better maintainance by updating Utils rather than updating Titan using search & replace. + +Late 2023 during DragonFlight, WoW expanded the retail version of drop down menu to more Classic versions. +Currently (May 2025) Classic Era is the only one using an explicit timer, and a distinct file version, to close menus. +So, Titan uses a routine only in CE (UIDropDownMenu_StartCounting) to determine which version to use. + +Code notes: +The expected frame name for the Right Click menu of the plugin is: +"TitanPanelRightClickMenu_Prepare"...."Menu" + +local drop_down_1 = "" -- changes drop down menu version. Blizzard hard-codes the value... + +The L_* routines wrap the drop down menu API for Titan Classic plugins. + + +Jan 2026 : New file moving menu routines from TitanUtils +--]===] + +local _G = getfenv(0); +local L = LibStub("AceLocale-3.0"):GetLocale(TITAN_ID, true) + +local drop_down_1 = "" -- changes if using Blizz drop down (retail) or lib (Classic) + +--====== Set the default drop down menu routines per retail or Classic +drop_down_1 = "DropDownList1" -- Boo!! Per hard-coded Blizz UIDropDownMenu.lua + +--[===[ Var API Dropdown Menu wrappers +Right click menu routines for 3rd party plugins (mainly Classic WoW versions) + +--]===] + +--[[ UI dropdown lib wrappers - Classic plugins mainly +Local helper(s) from the Ace lib. +--]] +-- L_UIDropDownMenuTemplate + +---Ensure the menu is created properly including back drop +---@param name table | string +---@param parent Frame +---@return any +local function create_DropDownMenu(name, parent) + local f + if type(name) == "table" then + f = name + name = f:GetName() + else + f = CreateFrame("Frame", name, parent or nil) + end + + --if not name then name = "" end + + f:SetSize(40, 32) + + f.Left = f:CreateTexture(name and (name .. "Left") or nil, "ARTWORK") + f.Left:SetTexture("Interface\\Glues\\CharacterCreate\\CharacterCreate-LabelFrame") + f.Left:SetSize(25, 64) + f.Left:SetPoint("TOPLEFT", f, 0, 17) + f.Left:SetTexCoord(0, 0.1953125, 0, 1) + + f.Middle = f:CreateTexture(name and (name .. "Middle") or nil, "ARTWORK") + f.Middle:SetTexture("Interface\\Glues\\CharacterCreate\\CharacterCreate-LabelFrame") + f.Middle:SetSize(115, 64) + f.Middle:SetPoint("LEFT", f.Left, "RIGHT") + f.Middle:SetTexCoord(0.1953125, 0.8046875, 0, 1) + + f.Right = f:CreateTexture(name and (name .. "Right") or nil, "ARTWORK") + f.Right:SetTexture("Interface\\Glues\\CharacterCreate\\CharacterCreate-LabelFrame") + f.Right:SetSize(25, 64) + f.Right:SetPoint("LEFT", f.Middle, "RIGHT") + f.Right:SetTexCoord(0.8046875, 1, 0, 1) + + f.Text = f:CreateFontString(name and (name .. "Text") or nil, "ARTWORK", "GameFontHighlightSmall") + f.Text:SetWordWrap(false) + f.Text:SetJustifyH("RIGHT") + f.Text:SetSize(0, 10) + f.Text:SetPoint("RIGHT", f.Right, -43, 2) + + f.Icon = f:CreateTexture(name and (name .. "Icon") or nil, "OVERLAY") + f.Icon:Hide() + f.Icon:SetSize(16, 16) + f.Icon:SetPoint("LEFT", 30, 2) + + -- // UIDropDownMenuButtonScriptTemplate + f.Button = CreateFrame("Button", name and (name .. "Button") or nil, f) + f.Button:SetMotionScriptsWhileDisabled(true) + f.Button:SetSize(24, 24) + f.Button:SetPoint("TOPRIGHT", f.Right, -16, -18) + + f.Button.NormalTexture = f.Button:CreateTexture(name and (name .. "NormalTexture") or nil) + f.Button.NormalTexture:SetTexture("Interface\\ChatFrame\\UI-ChatIcon-ScrollDown-Up") + f.Button.NormalTexture:SetSize(24, 24) + f.Button.NormalTexture:SetPoint("RIGHT", f.Button, 0, 0) + f.Button:SetNormalTexture(f.Button.NormalTexture) + + f.Button.PushedTexture = f.Button:CreateTexture(name and (name .. "PushedTexture") or nil) + f.Button.PushedTexture:SetTexture("Interface\\ChatFrame\\UI-ChatIcon-ScrollDown-Down") + f.Button.PushedTexture:SetSize(24, 24) + f.Button.PushedTexture:SetPoint("RIGHT", f.Button, 0, 0) + f.Button:SetPushedTexture(f.Button.PushedTexture) + + f.Button.DisabledTexture = f.Button:CreateTexture(name and (name .. "DisabledTexture") or nil) + f.Button.DisabledTexture:SetTexture("Interface\\ChatFrame\\UI-ChatIcon-ScrollDown-Disabled") + f.Button.DisabledTexture:SetSize(24, 24) + f.Button.DisabledTexture:SetPoint("RIGHT", f.Button, 0, 0) + f.Button:SetDisabledTexture(f.Button.DisabledTexture) + + f.Button.HighlightTexture = f.Button:CreateTexture(name and (name .. "HighlightTexture") or nil) + f.Button.HighlightTexture:SetTexture("Interface\\Buttons\\UI-Common-MouseHilight") + f.Button.HighlightTexture:SetSize(24, 24) + f.Button.HighlightTexture:SetPoint("RIGHT", f.Button, 0, 0) + f.Button.HighlightTexture:SetBlendMode("ADD") + f.Button:SetHighlightTexture(f.Button.HighlightTexture) + + -- Button Script + f.Button:SetScript("OnEnter", function(self, motion) + local parent = self:GetParent() + local myscript = parent:GetScript("OnEnter") + if (myscript ~= nil) then + myscript(parent) + end + end) + f.Button:SetScript("OnLeave", function(self, motion) + local parent = self:GetParent() + local myscript = parent:GetScript("OnLeave") + if (myscript ~= nil) then + myscript(parent) + end + end) + f.Button:SetScript("OnMouseDown", function(self, button) + if self:IsEnabled() then + local parent = self:GetParent() + ToggleDropDownMenu(nil, nil, parent) + PlaySound(SOUNDKIT.IG_MAINMENU_OPTION_CHECKBOX_ON) + end + end) + + -- UIDropDownMenu Script + f:SetScript("OnHide", function(self) + CloseDropDownMenus() + end) + + return f +end +-- +-- Wrap the drop down lib as if it were Ace lib 4.0 so Classic Titan plugins look the same +-- These need to be global to act like the older version +-- +-- L_UIDropDownMenuDelegate_OnAttributeChanged -- Different in 4.0 +function L_UIDropDownMenu_InitializeHelper(frame) + UIDropDownMenu_InitializeHelper(frame) +end + +function L_Create_UIDropDownMenu(name, parent) + local f = create_DropDownMenu(name, parent) + return f +end + +function L_UIDropDownMenu_Initialize(frame, initFunction, displayMode, level, menuList) + UIDropDownMenu_Initialize(frame, initFunction, displayMode, level, menuList) +end + +function L_UIDropDownMenu_SetInitializeFunction(frame, initFunction) + UIDropDownMenu_SetInitializeFunction(frame, initFunction) +end + +function L_UIDropDownMenu_SetDisplayMode(frame, displayMode) + UIDropDownMenu_SetDisplayMode(frame, displayMode) +end + +function L_UIDropDownMenu_RefreshDropDownSize(self) + UIDropDownMenu_RefreshDropDownSize(self) +end + +--function L_UIDropDownMenu_OnUpdate(self, elapsed) -- Different in 4.0 +function L_UIDropDownMenu_StartCounting(frame) + ---@diagnostic disable-next-line: undefined-global + UIDropDownMenu_StartCounting(frame) -- CE file only +end + +function L_UIDropDownMenu_StopCounting(frame) + ---@diagnostic disable-next-line: undefined-global + UIDropDownMenu_StopCounting(frame) -- CE file only +end + +--function L_UIDropDownMenuButtonInvisibleButton_OnEnter(self)) -- Different in 4.0 +--function L_UIDropDownMenuButtonInvisibleButton_OnLeave(self)) -- Different in 4.0 +--function L_UIDropDownMenuButton_OnEnter(self) -- Different in 4.0 +--function L_UIDropDownMenuButton_OnLeave(self) -- Different in 4.0 +function L_UIDropDownMenu_CreateInfo() + return UIDropDownMenu_CreateInfo() +end + +function L_UIDropDownMenu_CreateFrames(level, index) + UIDropDownMenu_CreateFrames(level, index) +end + +function L_UIDropDownMenu_AddSeparator(level) + UIDropDownMenu_AddSeparator(level) +end + +function L_UIDropDownMenu_AddSpace(level) -- new in 4.0 + UIDropDownMenu_AddSpace(level) +end + +function L_UIDropDownMenu_AddButton(info, level) + UIDropDownMenu_AddButton(info, level) +end + +function L_UIDropDownMenu_CheckAddCustomFrame(self, button, info) + UIDropDownMenu_CheckAddCustomFrame(self, button, info) +end + +function L_UIDropDownMenu_RegisterCustomFrame(self, customFrame) + UIDropDownMenu_RegisterCustomFrame(self, customFrame) +end + +function L_UIDropDownMenu_GetMaxButtonWidth(self) + return UIDropDownMenu_GetMaxButtonWidth(self) +end + +function L_UIDropDownMenu_GetButtonWidth(button) + return UIDropDownMenu_GetButtonWidth(button) +end + +function L_UIDropDownMenu_Refresh(frame, useValue, dropdownLevel) + UIDropDownMenu_Refresh(frame, useValue, dropdownLevel) +end + +function L_UIDropDownMenu_RefreshAll(frame, useValue) + UIDropDownMenu_RefreshAll(frame, useValue) +end + +function L_UIDropDownMenu_SetIconImage(icon, texture, info) + UIDropDownMenu_SetIconImage(icon, texture, info) +end + +function L_UIDropDownMenu_SetSelectedName(frame, name, useValue) + UIDropDownMenu_SetSelectedName(frame, name, useValue) +end + +function L_UIDropDownMenu_SetSelectedValue(frame, value, useValue) + UIDropDownMenu_SetSelectedValue(frame, value, useValue) +end + +function L_UIDropDownMenu_SetSelectedID(frame, id, useValue) + UIDropDownMenu_SetSelectedID(frame, id, useValue) +end + +function L_UIDropDownMenu_GetSelectedName(frame) + return UIDropDownMenu_GetSelectedName(frame) +end + +function L_UIDropDownMenu_GetSelectedID(frame) + return UIDropDownMenu_GetSelectedID(frame) +end + +function L_UIDropDownMenu_GetSelectedValue(frame) + return UIDropDownMenu_GetSelectedValue(frame) +end + +--function L_UIDropDownMenuButton_OnClick(self) -- Different in 4.0 +function L_HideDropDownMenu(level) + HideDropDownMenu(level) +end + +function L_ToggleDropDownMenu(level, value, dropDownFrame, anchorName, xOffset, yOffset, menuList, button, + autoHideDelay) + ToggleDropDownMenu(level, value, dropDownFrame, anchorName, xOffset, yOffset, menuList, button, autoHideDelay) +end + +function L_CloseDropDownMenus(level) + CloseDropDownMenus(level) +end + +--function L_UIDropDownMenu_OnHide(self) -- Different in 4.0 +-- 4.0 has 'contains mouse' routines for retail only +function L_UIDropDownMenu_SetWidth(frame, width, padding) + UIDropDownMenu_SetWidth(frame, width, padding) +end + +function L_UIDropDownMenu_SetButtonWidth(frame, width) + UIDropDownMenu_SetButtonWidth(frame, width) +end + +function L_UIDropDownMenu_SetText(frame, text) + UIDropDownMenu_SetText(frame, text) +end + +function L_UIDropDownMenu_GetText(frame) + return UIDropDownMenu_GetText(frame) +end + +function L_UIDropDownMenu_ClearAll(frame) + UIDropDownMenu_ClearAll(frame) +end + +function L_UIDropDownMenu_JustifyText(frame, justification) + UIDropDownMenu_JustifyText(frame, justification) +end + +function L_UIDropDownMenu_SetAnchor(dropdown, xOffset, yOffset, point, relativeTo, relativePoint) + UIDropDownMenu_SetAnchor(dropdown, xOffset, yOffset, point, relativeTo, relativePoint) +end + +function L_UIDropDownMenu_GetCurrentDropDown() + return UIDropDownMenu_GetCurrentDropDown() +end + +function L_UIDropDownMenuButton_GetChecked(self) + return UIDropDownMenuButton_GetChecked(self) +end + +function L_UIDropDownMenuButton_GetName(self) + return UIDropDownMenuButton_GetName(self) +end + +function L_UIDropDownMenuButton_OpenColorPicker(self, button) + UIDropDownMenuButton_OpenColorPicker(self, button) +end + +function L_UIDropDownMenu_DisableButton(level, id) + UIDropDownMenu_DisableButton(level, id) +end + +function L_UIDropDownMenu_EnableButton(level, id) + UIDropDownMenu_EnableButton(level, id) +end + +function L_UIDropDownMenu_SetButtonText(level, id, text, colorCode) + UIDropDownMenu_SetButtonText(level, id, text, colorCode) +end + +function L_UIDropDownMenu_SetButtonNotClickable(level, id) + UIDropDownMenu_SetButtonNotClickable(level, id) +end + +function L_UIDropDownMenu_SetButtonClickable(level, id) + UIDropDownMenu_SetButtonClickable(level, id) +end + +function L_UIDropDownMenu_DisableDropDown(dropDown) + UIDropDownMenu_DisableDropDown(dropDown) +end + +function L_UIDropDownMenu_EnableDropDown(dropDown) + UIDropDownMenu_EnableDropDown(dropDown) +end + +function L_UIDropDownMenu_IsEnabled(dropDown) + return UIDropDownMenu_IsEnabled(dropDown) +end + +function L_UIDropDownMenu_GetValue(id) + return UIDropDownMenu_GetValue(id) +end + +--====== Right click menu routines - Retail dropdown menu UIDROPDOWNMENU + +---local Add menu button at the given level. +---@param info table Filled in button to add +---@param level number menu level +local function Add_button(info, level) + UIDropDownMenu_AddButton(info, level) +end + +---API Menu - Get the base frame name of the user selected menu (without level). +---@return string frame_name +function TitanPanelRightClickMenu_GetDropdownFrameBase() + local res = "" + + res = "DropDownList" -- Boo!! Per hard-coded Blizz UIDropDownMenu.lua + + return res +end + +---API Menu - Get the frame name of the user selected menu. +---@return string frame_name +function TitanPanelRightClickMenu_GetDropdownFrame() + local res = "" + + res = "DropDownList" .. tostring(UIDROPDOWNMENU_MENU_LEVEL) + + return res +end + +---API Menu - Get the current level of the user selected menu. +---@return number level +function TitanPanelRightClickMenu_GetDropdownLevel() + -- local res = _G[drop_down_1] + local res = 1 -- proper typing + + res = UIDROPDOWNMENU_MENU_LEVEL + + return res +end + +---API Menu - Get the current value of the user selected menu. +---@return any Value