diff --git a/Titan/Titan.toc b/Titan/Titan.toc index 0011be9..c33ee9f 100644 --- a/Titan/Titan.toc +++ b/Titan/Titan.toc @@ -1,4 +1,4 @@ -## Interface: 110205, 50502, 11507 +## Interface: 120000, 110205, 50502, 11507 ## Title: Titan Panel [|cffeda55f_Core_|r] |cff00aa009.0.0|r ## Author: Titan Panel Dev Team ## Version: 9.0.0 diff --git a/Titan/TitanTemplate.lua b/Titan/TitanTemplate.lua index 0146d26..89fa340 100644 --- a/Titan/TitanTemplate.lua +++ b/Titan/TitanTemplate.lua @@ -193,6 +193,8 @@ local function TitanTooltip_SetPanelTooltip(self, id, frame) -- Adjust the Y offset as needed local top = self:GetTop() local hgt = frame:GetHeight() + local lft = self:GetLeft() + local rel_y = top - hgt local pt = "" local rel_pt = "" @@ -204,7 +206,7 @@ local function TitanTooltip_SetPanelTooltip(self, id, frame) pt = "BOTTOM"; rel_pt = "TOP"; end - local rel_x = self:GetLeft() + frame:GetHeight() + local rel_x = lft + hgt if (rel_x < GetScreenWidth()) then -- menu will fit pt = pt .. "LEFT"; @@ -605,7 +607,9 @@ function TitanPanelButton_OnClick(self, button) NOTE: If Titan bars need a left click to show a control frame the offset will need to be changed to use the cursor position like right click menu!! --]] - if (self:GetTop() - controlFrame:GetHeight()) > 0 then + local top = self:GetTop() + local hgt = controlFrame:GetHeight() + if (top - hgt) > 0 then point = "TOP" rel_point = "BOTTOM" else -- below screen @@ -706,7 +710,6 @@ end --- Note: Titan handles up to 4 label-value pairs. User may customize (override) the plugin labels. --- The text routine is called in protected mode (pcall) to ensure the Titan main routines still run. local function TitanPanelButton_SetButtonText(id) - --- There are several places that return in this routine. Not best practice but more readable. local dbg_msg = "ptxt : '" .. tostring(id) .. "'" local ok = false @@ -714,8 +717,7 @@ local function TitanPanelButton_SetButtonText(id) -- seems valid, registered plugin ok = true else - -- return silently; The plugin is not registered! - -- output here could be a lot and really annoy the user... + -- The plugin is not registered! dbg_msg = dbg_msg .. " | unregistered plugin" end @@ -734,10 +736,10 @@ local function TitanPanelButton_SetButtonText(id) ok = true else dbg_msg = dbg_msg .. " | invalid function type" - -- silently leave... + -- silently ... end else - -- silently leave... + -- silently leve... dbg_msg = dbg_msg .. " | invalid plugin data" end @@ -756,8 +758,8 @@ local function TitanPanelButton_SetButtonText(id) buttonText:SetFont(newfont, TitanPanelGetVar("FontSize")) end - -- We'll be paranoid here and call the button text in protected mode. - -- In case the button text fails it will not take Titan with it... + -- We'll be paranoid here and call the button text function in protected mode. + -- In case the function fails it will not take Titan with it... call_success, -- for pcall label1, value1, label2, value2, label3, value3, label4, value4 = pcall(buttonTextFunction, id) @@ -781,6 +783,9 @@ local function TitanPanelButton_SetButtonText(id) -- Plugin MUST have been shown at least once. -- In the case of first label only (no value), set the button and return. + -- + -- IF there is a label or value for the 1st then check for more values. + -- 2025 Nov : Change to check each value (1-4) rather than nest them. if text and label1 and not (label2 or label3 or label4 @@ -809,35 +814,35 @@ local function TitanPanelButton_SetButtonText(id) if show_label then if TitanGetVar(id, "CustomLabel2TextShow") then -- override the label per the user - label2 = TitanGetVar(id, "CustomLabel2Text") + label2 = " "..TitanGetVar(id, "CustomLabel2Text") else end else - label2 = "" + label2 = " " end - if label3 or value3 then - if show_label then - if TitanGetVar(id, "CustomLabel3TextShow") then - -- override the label per the user - label3 = TitanGetVar(id, "CustomLabel3Text") - else - end + end + if label3 or value3 then + values = 3 + if show_label then + if TitanGetVar(id, "CustomLabel3TextShow") then + -- override the label per the user + label3 = " "..TitanGetVar(id, "CustomLabel3Text") else - label3 = "" end - values = 3 - if label4 or value4 then - values = 4 - if show_label then - if TitanGetVar(id, "CustomLabel43TextShow") then - -- override the label per the user - label4 = TitanGetVar(id, "CustomLabel4Text") - else - end - else - label4 = "" - end + else + label3 = " " + end + end + if label4 or value4 then + values = 4 + if show_label then + if TitanGetVar(id, "CustomLabel43TextShow") then + -- override the label per the user + label4 = " "..TitanGetVar(id, "CustomLabel4Text") + else end + else + label4 = " " end end dbg_msg = dbg_msg .. " | ok | " .. tostring(values) @@ -880,12 +885,14 @@ local function TitanPanelButton_SetTextButtonWidth(id, setButtonWidth) if (id) then local button = TitanUtils_GetButton(id) if button then - local text = _G[button:GetName() .. TITAN_PANEL_TEXT]; + local text = _G[button:GetName() .. TITAN_PANEL_TEXT] + local bwid = button:GetWidth() + local twid = text:GetWidth() if (setButtonWidth - or button:GetWidth() == 0 - or button:GetWidth() - text:GetWidth() > TITAN_PANEL_BUTTON_WIDTH_CHANGE_TOLERANCE - or button:GetWidth() - text:GetWidth() < -TITAN_PANEL_BUTTON_WIDTH_CHANGE_TOLERANCE) then - button:SetWidth(text:GetWidth()); + or bwid == 0 + or bwid - twid > TITAN_PANEL_BUTTON_WIDTH_CHANGE_TOLERANCE + or bwid - twid < -TITAN_PANEL_BUTTON_WIDTH_CHANGE_TOLERANCE) then + button:SetWidth(twid); TitanPanelButton_Justify(); end else @@ -927,14 +934,19 @@ local function TitanPanelButton_SetComboButtonWidth(id, setButtonWidth) local text = _G[button:GetName() .. TITAN_PANEL_TEXT]; local icon = _G[button:GetName() .. "Icon"]; + + local iwid = icon:GetWidth() + local twid = text:GetWidth() + local bwid = button:GetWidth() + local iconWidth, iconButtonWidth, newButtonWidth; -- Get icon button width iconButtonWidth = 0; if (TitanUtils_GetPlugin(id).iconButtonWidth) then iconButtonWidth = TitanUtils_GetPlugin(id).iconButtonWidth; - elseif (icon:GetWidth()) then - iconButtonWidth = icon:GetWidth(); + elseif (iwid) then + iconButtonWidth = iwid end if (TitanGetVar(id, "ShowIcon") and (iconButtonWidth ~= 0)) then @@ -942,19 +954,19 @@ local function TitanPanelButton_SetComboButtonWidth(id, setButtonWidth) text:ClearAllPoints(); text:SetPoint("LEFT", icon:GetName(), "RIGHT", 2, 1); - newButtonWidth = text:GetWidth() + iconButtonWidth; + newButtonWidth = twid + iconButtonWidth; else icon:Hide(); text:ClearAllPoints(); text:SetPoint("LEFT", button:GetName(), "LEFT", 0, 1); - newButtonWidth = text:GetWidth(); + newButtonWidth = twid end if (setButtonWidth - or button:GetWidth() == 0 - or button:GetWidth() - newButtonWidth > TITAN_PANEL_BUTTON_WIDTH_CHANGE_TOLERANCE - or button:GetWidth() - newButtonWidth < -TITAN_PANEL_BUTTON_WIDTH_CHANGE_TOLERANCE) + or bwid == 0 + or bwid - newButtonWidth > TITAN_PANEL_BUTTON_WIDTH_CHANGE_TOLERANCE + or bwid - newButtonWidth < -TITAN_PANEL_BUTTON_WIDTH_CHANGE_TOLERANCE) then button:SetWidth(newButtonWidth); TitanPanelButton_Justify(); diff --git a/Titan/TitanUtils.lua b/Titan/TitanUtils.lua index 3803273..b80c30d 100644 --- a/Titan/TitanUtils.lua +++ b/Titan/TitanUtils.lua @@ -1874,22 +1874,30 @@ function TitanUtils_GetOffscreen(frame) return 0, 0 -- ?? end local fr_scale = frame:GetEffectiveScale() - - if (frame and frame:GetLeft() - and frame:GetLeft() * fr_scale < UIParent:GetLeft() * ui_scale) then + local fr_top = frame:GetTop() + local fr_left = frame:GetLeft() + local fr_right = frame:GetRight() + local fr_bot = frame:GetBottom() + local uip_top = UIParent:GetTop() + local uip_left = UIParent:GetLeft() + local uip_right = UIParent:GetRight() + local uip_bot= UIParent:GetBottom() + + if (frame and fr_left + and fr_left * fr_scale < uip_left * ui_scale) then offscreenX = -1; - elseif (frame and frame:GetRight() - and frame:GetRight() * fr_scale > UIParent:GetRight() * ui_scale) then + elseif (frame and fr_right + and fr_right * fr_scale > uip_right * ui_scale) then offscreenX = 1; else offscreenX = 0; end - if (frame and frame:GetTop() - and frame:GetTop() * fr_scale > UIParent:GetTop() * ui_scale) then + if (frame and fr_top + and fr_top * fr_scale > uip_top * ui_scale) then offscreenY = -1; - elseif (frame and frame:GetBottom() - and frame:GetBottom() * fr_scale < UIParent:GetBottom() * ui_scale) then + elseif (frame and fr_bot + and fr_bot * fr_scale < uip_bot * ui_scale) then offscreenY = 1; else offscreenY = 0; @@ -2365,7 +2373,8 @@ print("_ toggle R menu" local drop_menu, menu_height, menu_width = TitanRightClickMenu_OnLoad(self, menu) -- Adjust the Y offset as needed - local rel_y = _G[frame]:GetTop() - menu_height + local ftop = _G[frame]:GetTop() + local rel_y = ftop - menu_height if rel_y > 0 then menu.point = "TOP"; menu.relativePoint = "BOTTOM"; @@ -2378,15 +2387,17 @@ print("_ toggle R menu" -- Adjust the X offset as needed local x_offset = 0 local left = 0 + local flft = _G[frame]:GetLeft() + local effscale = UIParent:GetEffectiveScale() if TitanBarData[frame] then -- on a Titan bar so use cursor for the 'left' left = GetCursorPosition() -- get x; ignore y - left = left / UIParent:GetEffectiveScale() + left = left / effscale -- correct for beginning of Titan bar - left = left - _G[frame]:GetLeft() + left = left - flft else -- a plugin - left = _G[frame]:GetLeft() + left = flft end local rel_x = left + menu_width if (rel_x < GetScreenWidth()) then @@ -2502,10 +2513,15 @@ end ---@return table screenXY { x | y | scaled_x | scaled_y } all numbers function TitanUtils_ScreenSize() local screen = {} - screen.x = UIParent:GetRight() - screen.y = UIParent:GetTop() - screen.scaled_x = UIParent:GetRight() * UIParent:GetEffectiveScale() - screen.scaled_y = UIParent:GetTop() * UIParent:GetEffectiveScale() + + local x = UIParent:GetRight() + local y = UIParent:GetTop() + local s = UIParent:GetEffectiveScale() + + screen.x = x + screen.y = y + screen.scaled_x = x * s + screen.scaled_y = y * s --[[ if output then diff --git a/TitanBag/TitanBag.toc b/TitanBag/TitanBag.toc index 5b86d45..37b2cdb 100644 --- a/TitanBag/TitanBag.toc +++ b/TitanBag/TitanBag.toc @@ -1,4 +1,4 @@ -## Interface: 110205, 50502, 11507 +## Interface: 120000, 110205, 50502, 11507 ## Title: Titan Panel [|cffeda55fBag|r] |cff00aa009.0.0|r ## Version: 9.0.0 ## IconTexture: Interface\AddOns\TitanBag\TitanBag diff --git a/TitanClock/TitanClock.toc b/TitanClock/TitanClock.toc index 107172f..8fc675a 100644 --- a/TitanClock/TitanClock.toc +++ b/TitanClock/TitanClock.toc @@ -1,4 +1,4 @@ -## Interface: 110205, 50502, 11507 +## Interface: 120000, 110205, 50502, 11507 ## Title: Titan Panel [|cffeda55fClock|r] |cff00aa009.0.0|r ## Version: 9.0.0 ## IconTexture: Interface\Icons\Spell_Nature_TimeStop diff --git a/TitanGold/TitanGold.toc b/TitanGold/TitanGold.toc index 9b82624..76bcaec 100644 --- a/TitanGold/TitanGold.toc +++ b/TitanGold/TitanGold.toc @@ -1,4 +1,4 @@ -## Interface: 110205, 50502, 11507 +## Interface: 120000, 110205, 50502, 11507 ## Title: Titan Panel [|cffeda55fGold|r] |cff00aa009.0.0|r ## Version: 9.0.0 ## IconTexture: Interface\AddOns\TitanGold\Artwork\TitanGold diff --git a/TitanLocation/TitanLocation.toc b/TitanLocation/TitanLocation.toc index 01ddfc0..66a0424 100644 --- a/TitanLocation/TitanLocation.toc +++ b/TitanLocation/TitanLocation.toc @@ -1,4 +1,4 @@ -## Interface: 110205, 50502, 11507 +## Interface: 120000, 110205, 50502, 11507 ## Title: Titan Panel [|cffeda55fLocation|r] |cff00aa009.0.0|r ## Version: 9.0.0 ## IconTexture: Interface\AddOns\TitanLocation\TitanLocation diff --git a/TitanLootType/TitanLootType.toc b/TitanLootType/TitanLootType.toc index 3b10a99..fe76fd1 100644 --- a/TitanLootType/TitanLootType.toc +++ b/TitanLootType/TitanLootType.toc @@ -1,4 +1,4 @@ -## Interface: 110205, 50502, 11507 +## Interface: 120000, 110205, 50502, 11507 ## Title: Titan Panel [|cffeda55fLootType|r] |cff00aa009.0.0|r ## Version: 9.0.0 ## IconTexture: Interface\AddOns\TitanLootType\TitanLootType diff --git a/TitanPerformance/TitanPerformance.toc b/TitanPerformance/TitanPerformance.toc index ba84126..3091273 100644 --- a/TitanPerformance/TitanPerformance.toc +++ b/TitanPerformance/TitanPerformance.toc @@ -1,4 +1,4 @@ -## Interface: 110205, 50502, 11507 +## Interface: 120000, 110205, 50502, 11507 ## Title: Titan Panel [|cffeda55fPerformance|r] |cff00aa009.0.0|r ## Version: 9.0.0 ## IconTexture: Interface\AddOns\TitanPerformance\TitanPerformance diff --git a/TitanRepair/TitanRepair.toc b/TitanRepair/TitanRepair.toc index 6635b1c..c56f4b7 100644 --- a/TitanRepair/TitanRepair.toc +++ b/TitanRepair/TitanRepair.toc @@ -1,4 +1,4 @@ -## Interface: 110205, 50502, 11507 +## Interface: 120000, 110205, 50502, 11507 ## Title: Titan Panel [|cffeda55fRepair|r] |cff00aa009.0.0|r ## Version: 9.0.0 ## IconTexture: Interface\AddOns\TitanRepair\TitanRepair diff --git a/TitanUI/TitanUI.toc b/TitanUI/TitanUI.toc index daa8ba1..8924311 100755 --- a/TitanUI/TitanUI.toc +++ b/TitanUI/TitanUI.toc @@ -1,4 +1,4 @@ -## Interface: 110205, 50502, 11507 +## Interface: 120000, 110205, 50502, 11507 ## Title: Titan Panel [|cffeda55fUI|r] |cff00aa008.4.2|r ## Author: Titan Panel Dev Team ## Version: 8.4.2 diff --git a/TitanVolume/TitanVolume.toc b/TitanVolume/TitanVolume.toc index d54ca01..517a186 100644 --- a/TitanVolume/TitanVolume.toc +++ b/TitanVolume/TitanVolume.toc @@ -1,4 +1,4 @@ -## Interface: 110205, 50502, 11507 +## Interface: 120000, 110205, 50502, 11507 ## Title: Titan Panel [|cffeda55fVolume|r] |cff00aa009.0.0|r ## Version: 9.0.0 ## IconTexture: Interface\AddOns\TitanVolume\Artwork\TitanVolumeHigh diff --git a/TitanXP/TitanXP.toc b/TitanXP/TitanXP.toc index e056185..53db93e 100644 --- a/TitanXP/TitanXP.toc +++ b/TitanXP/TitanXP.toc @@ -1,4 +1,4 @@ -## Interface: 110205, 50502, 11507 +## Interface: 120000, 110205, 50502, 11507 ## Title: Titan Panel [|cffeda55fXP|r] |cff00aa009.0.0|r ## Version: 9.0.0 ## IconTexture: Interface\Icons\xp_icon