From c4cf0bda1865795a376ae3c4d0fb1cda0210ebe1 Mon Sep 17 00:00:00 2001 From: urnati Date: Fri, 28 Feb 2025 12:30:35 -0500 Subject: [PATCH] - Fix for Location, Clssic only; remove ShowLocOnMinimap - Udd open Titan config to Addon Compartment, retail only atm --- Titan/Titan.lua | 30 +++++++++++++++++ TitanLocation/TitanLocation.lua | 70 --------------------------------------- 2 files changed, 30 insertions(+), 70 deletions(-) diff --git a/Titan/Titan.lua b/Titan/Titan.lua index 29f7d55..a2b8d77 100644 --- a/Titan/Titan.lua +++ b/Titan/Titan.lua @@ -224,6 +224,33 @@ _G[TITAN_PANEL_CONTROL]:SetScript("OnEvent", function(_, event, ...) _G[TITAN_PANEL_CONTROL][event](_G[TITAN_PANEL_CONTROL], ...) end) +local function RegisterAddonCompartment() + if AddonCompartmentFrame then + AddonCompartmentFrame:RegisterAddon( + { + text = TITAN_ID, + icon = "Interface\\Icons\\Achievement_Dungeon_UlduarRaid_Titan_01", + notCheckable = true, + func = function(button, menuInputData, menu) + TitanUpdateConfig("init") + Settings.OpenToCategory(TITAN_PANEL_CONFIG.topic.About) + end, + funcOnEnter = function(button) + MenuUtil.ShowTooltip(button, function(tooltip) + local msg = "" + ..L["TITAN_PANEL"] + .." "..L["TITAN_PANEL_MENU_CONFIGURATION"] + tooltip:SetText(msg) + end) + end, + funcOnLeave = function(button) + MenuUtil.HideTooltip(button) + end, + } + ) + else + end +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. @@ -273,6 +300,9 @@ function TitanPanel_PlayerEnteringWorld(reload) 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() diff --git a/TitanLocation/TitanLocation.lua b/TitanLocation/TitanLocation.lua index 85c24b5..5dad7b1 100755 --- a/TitanLocation/TitanLocation.lua +++ b/TitanLocation/TitanLocation.lua @@ -223,26 +223,6 @@ local function SetCoordText(player, cursor) end end ----local Show / hide the location above the mini map per user settings ----@param reason string -local function LocOnMiniMap(reason) - if TitanGetVar(TITAN_LOCATION_ID, "ShowLocOnMiniMap") then - MinimapBorderTop:Show() - MinimapZoneTextButton:Show() - else - MinimapBorderTop:Hide() - MinimapZoneTextButton:Hide() - MiniMapWorldMapButton:Hide() - end - - -- adjust MiniMap frame if needed - if reason == "config" then - TitanPanel_AdjustFrames(false, "Location"); - else - -- 2024 Jan - Do not adjust; allow Titan to handle on PEW - end -end - ---local Update coordinates on map. This called every tick of timer while map is open. ---@param self Button ---@param elapsed number @@ -424,20 +404,6 @@ local function OnShow(self) end CreateMapFrames() -- as needed - - if TITAN_ID == "TitanClassic" then - if not TitanGetVar(TITAN_LOCATION_ID, "ShowLocOnMiniMap") - and MinimapBorderTop and MinimapBorderTop:IsShown() then - LocOnMiniMap("PEW") - end - - if TitanGetVar(TITAN_LOCATION_ID, "ShowLocOnMiniMap") and MinimapBorderTop:IsShown() then - if not MinimapZoneTextButton:IsShown() then MinimapZoneTextButton:Show() end - end - else - -- no work needed - end - CoordFrames("start") -- start coords on map, if requested Events("register", "_OnShow") @@ -705,41 +671,6 @@ local function CreateMenu() end info.checked = TitanGetVar(TITAN_LOCATION_ID, "ShowCoordsText"); TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); ---[[ - info = {}; - info.text = L["TITAN_LOCATION_MENU_SHOW_COORDS_ON_MAP_TEXT"]; - info.func = function() - TitanToggleVar(TITAN_LOCATION_ID, "ShowCoordsOnMap"); - if (TitanGetVar(TITAN_LOCATION_ID, "ShowCoordsOnMap")) then - CoordFrames("start") - else - CoordFrames("stop") - end - end - info.checked = TitanGetVar(TITAN_LOCATION_ID, "ShowCoordsOnMap"); - TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); - - if TITAN_ID == "TitanClassic" then - info = {}; - info.text = L["TITAN_LOCATION_MENU_SHOW_LOC_ON_MINIMAP_TEXT"]; - info.func = function() - TitanToggleVar(TITAN_LOCATION_ID, "ShowLocOnMiniMap"); - LocOnMiniMap("config") - end - info.checked = TitanGetVar(TITAN_LOCATION_ID, "ShowLocOnMiniMap"); - info.disabled = InCombatLockdown() - TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); - else - -- no work needed - end - info = {}; - info.text = L["TITAN_LOCATION_MENU_UPDATE_WORLD_MAP"]; - info.func = function() - TitanToggleVar(TITAN_LOCATION_ID, "UpdateWorldmap"); - end - info.checked = TitanGetVar(TITAN_LOCATION_ID, "UpdateWorldmap"); - info.disabled = InCombatLockdown() - TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); --]] end @@ -868,7 +799,6 @@ local function OnLoad(self) ShowCoordsText = true, ShowCoordsOnMap = true, ShowCursorOnMap = true, - ShowLocOnMiniMap = 1, ShowIcon = 1, ShowLabelText = 1, ShowColoredText = 1, -- 1.7.9.5