From 2cd9efe7548522c9fc748d820b1891d1d0b55de1 Mon Sep 17 00:00:00 2001 From: urnati Date: Mon, 26 Oct 2020 14:30:29 -0400 Subject: [PATCH] - Attempted fix for 'bouncing' extra action button - #1285 : Adjust default for buff icon list - Config : per user requests on Curse -- Add ability to adjust the Buff icon list offset, vertical only -- Add flags to output or not, on startup, Titan verion and registration process info --- Titan/TitanConfig.lua | 117 +++++++++++++++----- Titan/TitanMovable.lua | 265 ++++++++++++++++++++++++++++++++++++++-------- Titan/TitanPanel.lua | 16 +-- Titan/TitanUtils.lua | 4 +- Titan/TitanVariables.lua | 17 ++- 5 files changed, 330 insertions(+), 89 deletions(-) diff --git a/Titan/TitanConfig.lua b/Titan/TitanConfig.lua index 6fd02f4..e7ef19d 100644 --- a/Titan/TitanConfig.lua +++ b/Titan/TitanConfig.lua @@ -49,7 +49,7 @@ end --[[ local NAME: TitanAdjustPanelScale -DESC: Set the Tian bars and plugins to the selected scale then adjust other frames as needed. +DESC: Set the Titan bars and plugins to the selected scale then adjust other frames as needed. VAR: scale - the scale the user has selected for Titan OUT: None --]] @@ -57,7 +57,7 @@ local function TitanAdjustPanelScale(scale) Titan_AdjustScale() -- Adjust frame positions - TitanPanel_AdjustFrames(TITAN_PANEL_PLACE_BOTH, true) + TitanPanel_AdjustFrames(true, "AdjustPanelScale") end -- helper functions @@ -922,7 +922,7 @@ local optionsAuxBars = { set = function(_, a) TitanPanelSetVar("MainMenuBarXAdj", a); -- Adjust frame positions - TitanPanel_AdjustFrames(TITAN_PANEL_PLACE_BOTH, true) + TitanPanel_AdjustFrames(true, "Config: Adjust X (right / left)") end, }, } @@ -1705,33 +1705,96 @@ local optionsAdvanced = { name = L["TITAN_PANEL_MENU_ADV"], type = "group", args = { - confdesc = { + conftimerdesc = { + name = "Timers", + type = "group", inline = true, order = 1, - type = "description", - name = L["TITAN_PANEL_MENU_ADV_DESC"], - cmdHidden = true + args = { + confdesc = { + order = 10, + type = "description", + name = L["TITAN_PANEL_MENU_ADV_DESC"], + cmdHidden = true + }, + advtimerpew = { + name = L["TITAN_PANEL_MENU_ADV_PEW"], + desc = L["TITAN_PANEL_MENU_ADV_PEW_DESC"], + order = 20, type = "range", width = "full", + min = 1, max = 10, step = 0.5, + get = function() return TitanAllGetVar("TimerPEW") end, + set = function(_, a) + TitanAllSetVar("TimerPEW", a); + TitanTimers["EnterWorld"].delay = a + end, + }, + advtimervehicle = { + name = L["TITAN_PANEL_MENU_ADV_VEHICLE"], + desc = L["TITAN_PANEL_MENU_ADV_VEHICLE_DESC"], + order = 50, type = "range", width = "full", + min = 1, max = 10, step = 0.5, + get = function() return TitanAllGetVar("TimerVehicle") end, + set = function(_, a) + TitanAllSetVar("TimerVehicle", a); + TitanTimers["Vehicle"].delay = a + end, + }, }, - advtimerpew = { - name = L["TITAN_PANEL_MENU_ADV_PEW"], - desc = L["TITAN_PANEL_MENU_ADV_PEW_DESC"], - order = 10, type = "range", width = "full", - min = 1, max = 10, step = 0.5, - get = function() return TitanAllGetVar("TimerPEW") end, - set = function(_, a) - TitanAllSetVar("TimerPEW", a); - TitanTimers["EnterWorld"].delay = a - end, }, - advtimervehicle = { - name = L["TITAN_PANEL_MENU_ADV_VEHICLE"], - desc = L["TITAN_PANEL_MENU_ADV_VEHICLE_DESC"], - order = 50, type = "range", width = "full", - min = 1, max = 10, step = 0.5, - get = function() return TitanAllGetVar("TimerVehicle") end, - set = function(_, a) - TitanAllSetVar("TimerVehicle", a); - TitanTimers["Vehicle"].delay = a - end, + confbuffdesc = { + name = "Buff Icon Vertical Adjustment", + type = "group", inline = true, + order = 2, + args = { + confbuffdesc = { + order = 110, + type = "description", + name = "Adjust Buff icons only as needed. This will override the Titan default adjustment.", --L["TITAN_PANEL_MENU_ADV_DESC"], + cmdHidden = true + }, + advbuffadj = { + name = "Buff", --L["TITAN_PANEL_MENU_ADV_PEW"], + desc = "", -- L["TITAN_PANEL_MENU_ADV_PEW_DESC"], + order = 120, type = "range", width = "full", + min = -100, max = 100, step = 1, + get = function() return TitanPanelGetVar("BuffIconVerticalAdj") end, + set = function(_, a) + TitanPanelSetVar("BuffIconVerticalAdj", a); + -- Adjust frame positions + TitanPanel_AdjustFrames(true, "BuffIconVerticalAdj") + end, + }, + }, + }, + confoutputdesc = { + name = "Output", + type = "group", inline = true, + order = 3, + args = { + confdesc = { + order = 110, + type = "description", + name = "Output Various Titan Info At Startup.", --L["TITAN_PANEL_MENU_ADV_DESC"], + cmdHidden = true + }, + advname = { + name = "Name and Version", --L["TITAN_PANEL_MENU_ADV_PEW"], + desc = "", -- L["TITAN_PANEL_MENU_ADV_PEW_DESC"], + order = 120, type = "toggle", width = "full", + get = function() return not TitanAllGetVar("Silenced") end, -- yes, we did it to ourselves... + set = function(_, a) + TitanAllSetVar("Silenced", not a); + end, + }, + advplugins = { + name = "Registration process", --L["TITAN_PANEL_MENU_ADV_PEW"], + desc = "Registration and number of registered", -- L["TITAN_PANEL_MENU_ADV_PEW_DESC"], + order = 120, type = "toggle", width = "full", + get = function() return TitanAllGetVar("Registered") end, + set = function(_, a) + TitanAllSetVar("Registered", a); + end, + }, + }, }, }, } diff --git a/Titan/TitanMovable.lua b/Titan/TitanMovable.lua index c1c20bf..26e5bfd 100755 --- a/Titan/TitanMovable.lua +++ b/Titan/TitanMovable.lua @@ -61,8 +61,8 @@ local function DoAdjust(place, force) local res = false -- assume we will not adjust -- force is passed to cover cases where the user has just deselected both top or bottom bars -- When that happens we need to adjust - - -- We did it to ourselves - if (Aux)ScreenAdjust is true it means the user wants Titan to NOT adjust... + + -- We did it to ourselves - if (Aux)ScreenAdjust is true / 1 it means the user wants Titan to NOT adjust... if place == TITAN_PANEL_PLACE_TOP then if TitanPanelGetVar("ScreenAdjust") == 1 then -- do not adjust @@ -87,6 +87,25 @@ local function DoAdjust(place, force) return res end +--[[ local +NAME: VisibleBars +DESC: Get the x axis offset if XP or another bar are shown +VAR: None +OUT: int - X axis offset, in pixels +--]] +local function VisibleBars() + -- A valid frame and point is required + -- Determine a proper X offset using the given point (position) + local ret = 0 -- In case player at max level (no XP gain) and nothing else shown + if ( StatusTrackingBarManager:GetNumberVisibleBars() == 2 ) then + ret = 17; + elseif ( StatusTrackingBarManager:GetNumberVisibleBars() == 1 ) then + ret = 14; + end + + return ret +end + --[[ Titan NAME: TitanMovable_MenuBar_Disable DESC: Handle the main menu bar so Blizzard does not get upset. @@ -187,8 +206,8 @@ function TitanMovable_GetPanelYOffset(framePosition) -- used by other addons if framePosition == TITAN_PANEL_PLACE_TOP then return (-TITAN_PANEL_BAR_HEIGHT * scale)*(barnum_top); elseif framePosition == TITAN_PANEL_PLACE_BOTTOM then - return (TITAN_PANEL_BAR_HEIGHT * scale)*(barnum_bot)-1; - -- no idea why -1 is needed... seems anchoring to bottom is off a pixel + return (TITAN_PANEL_BAR_HEIGHT * scale)*(barnum_bot) + -1 -- no idea why -1 is needed... seems anchoring to bottom is off a pixel end end return 0 @@ -342,8 +361,17 @@ local function MoveFrame(frame_ptr, start_y, top_bottom, force) then -- skip this frame else +--[[ +TitanDebug ("MoveFrame :" + .." "..tostring(frame_ptr) + .." y:"..tostring(start_y) + ) +--]] if DoAdjust(top_bottom, force) and frame:IsShown() then - local y = TitanMovable_GetPanelYOffset(top_bottom) + (start_y or 0) -- includes scale adjustment + local scale = TitanPanelGetVar("Scale") + local y = 0 + y = TitanMovable_GetPanelYOffset(top_bottom) + + (start_y or 0) local point, relativeTo, relativePoint, xOfs, yOfs = frame:GetPoint() -- check for nil which will cause an error if point and relativeTo and relativePoint and xOfs then -- do not care about yOfs @@ -351,7 +379,9 @@ local function MoveFrame(frame_ptr, start_y, top_bottom, force) -- frame:ClearAllPoints(); -- frame:SetPoint(point, relativeTo:GetName(), relativePoint, xOfs, y) --[[ - if frame == ExtraActionBarFrame then +-- if tostring(relativeTo:GetName()) == "UIParent" then + if tostring(frame:GetName()) == "ExtraAbilityContainer" then +-- else TitanDebug ("MoveFrame :" .." "..tostring(frame:GetName()) .." point:"..tostring(point) @@ -359,6 +389,9 @@ local function MoveFrame(frame_ptr, start_y, top_bottom, force) .." relativePoint:"..tostring(relativePoint) .." xOfs:"..tostring(xOfs) .." y:"..tostring(y) + .." adj:"..tostring(DoAdjust(top_bottom, force)) + .." tb:"..tostring(top_bottom) + .." f:"..tostring(force) ) end --]] @@ -408,12 +441,7 @@ local function MoveMenuFrame(frame_ptr, start_y, top_bottom, force) and DoAdjust(top_bottom, force) then local yOffset = TitanMovable_GetPanelYOffset(top_bottom) -- includes scale adjustment --- xOffset = TitanMovableFrame_GetXOffset(frame, top_bottom); - if ( StatusTrackingBarManager:GetNumberVisibleBars() == 2 ) then - yOffset = yOffset + 17; - elseif ( StatusTrackingBarManager:GetNumberVisibleBars() == 1 ) then - yOffset = yOffset + 14; - end + + VisibleBars() local xOfs = TitanPanelGetVar("MainMenuBarXAdj") SetPosition(frame, "BOTTOM", "UIParent", "BOTTOM", xOfs, yOffset) @@ -540,6 +568,66 @@ local function has_pet_bar() return hasPetBar end +local function calc_bars() -- extra action button + local res = 0 + local out = "" + local main = 0 + local left = 0 + local pet = 0 + local stance = 0 + local cast = 0 + local poss = 0 + local vehicle = 0 + -- This covers the basic UI where there is no pet or extras + if MainMenuBar and MainMenuBar:IsShown() then + main = MainMenuBar:GetHeight() + out = MainMenuBar + end + -- Add the left bottom; the right bottom does not change Y + if MultiBarBottomLeft and MultiBarBottomLeft:IsShown() then + left = MultiBarBottomLeft:GetHeight() + out = MainMenuBar + end + -- These should be mutually exclusive... + if PetActionBarFrame and PetActionBarFrame:IsShown() then + pet = PetActionBarFrame:GetHeight(); + out = PetActionBarFrame + end + if StanceBarFrame and StanceBarFrame:IsShown() then + stance = StanceBarFrame:GetHeight(); + out = StanceBarFrame + end + if MultiCastActionBarFrame and MultiCastActionBarFrame:IsShown() then + cast = MultiCastActionBarFrame:GetHeight(); + out = MultiCastActionBarFrame + end + if PossessBarFrame and PossessBarFrame:IsShown() then + poss = PossessBarFrame:GetHeight(); + out = PossessBarFrame + end + if MainMenuBarVehicleLeaveButton and MainMenuBarVehicleLeaveButton:IsShown() then + vehicle = MainMenuBarVehicleLeaveButton:GetHeight(); + out = MainMenuBarVehicleLeaveButton + end + + res = main + left + pet + stance + cast + poss + vehicle +--[[ +TitanDebug ("calc_bars :" + .." "..tostring(out:GetName()) + .." y: "..tostring(res) + .." m: "..tostring(main) + .." l: "..tostring(left) + .." p: "..tostring(pet) + .." s: "..tostring(stance) + .." c: "..tostring(cast) + .." p: "..tostring(poss) + .." v: "..tostring(vehicle) + ) +--]] + return res +end +XXZZ_calc_bars = calc_bars + --[[ local NAME: MData table DESC: MData is a local table that holds each frame Titan may need to adjust. It controls the offsets needed to make room for the Titan bar(s). @@ -549,9 +637,14 @@ frameName - frame name (string) to adjust addonAdj - true if another addon is taking responsibility of adjusting this frame, if false Titan will use the user settings to adjust or not :DESC NOTE: +- MoveFrame calculates and offsets for the Titan bars, if shown +- When calculating the initial Y offset, consider the points and relative points of the frame being adjusted. +Titan only adjusts Y while leaving the rest of the SetPoint values as is. +An example is the extra action button - It is set against center of UIParent; it is not relative to the action bars... - Of course Blizzard had to make the MainMenuBar act differently . :GetPoint() does not work on it so a special helper routine was needed. :NOTE --]] +local save_y = 0 local MData = { [1] = {frameName = "PlayerFrame", move = function (force) MoveFrame("PlayerFrame", 0, TITAN_PANEL_PLACE_TOP, force) end, @@ -577,9 +670,10 @@ local MData = { then yOffset = (-TicketStatusFrame:GetHeight()) else - yOffset = -13 + yOffset = TitanPanelGetVar("BuffIconVerticalAdj") -- -13 (8.x) end - MoveFrame("BuffFrame", yOffset, TITAN_PANEL_PLACE_TOP, force) end, + MoveFrame("BuffFrame", yOffset, TITAN_PANEL_PLACE_TOP, force) + end, addonAdj = false, }, [6] = {frameName = "MinimapCluster", move = function (force) @@ -610,6 +704,7 @@ local MData = { if ExtraActionBarFrame and ExtraActionBarFrame:IsShown() then -- Need to calc Y because Y depends on what else is shown + -- The extra action button is calculated from the center of the screen so this needs more effort than the other buttons --[=[ UIParent Look at UIParent.lua for logic (UIParent_ManageFramePosition) --]=] @@ -618,31 +713,43 @@ local MData = { local overrideActionBarTop = 40; local petBattleTop = 60; - local yOfs = 18 -- FramePositionDelegate:UIParentManageFramePositions + local start_y = ExtraAbilityContainer:GetHeight() -- 18 -- FramePositionDelegate:UIParentManageFramePositions + local rel_start = UIParent:GetHeight() / 2 -- CENTER of UIParent + local yOfs = 0 + local yOfs1 = 0 +--[[ if MainMenuBar and MainMenuBar:IsShown() then - yOfs = yOfs + menuBarTop + yOfs2 = MainMenuBar:GetTop() -- menuBarTop end if (MultiBarBottomLeft and MultiBarBottomLeft:IsShown()) or (MultiBarBottomRight and MultiBarBottomRight:IsShown()) then - yOfs = yOfs + actionBarOffset + yOfs2 = MultiBarBottomRight:GetTop() -- actionBarOffset end if (has_pet_bar()) and (MultiBarBottomRight and MultiBarBottomRight:IsShown()) then - yOfs = yOfs + petBattleTop + yOfs2 = petBattleTop end + --(yOfs + start_y) * -1 +--]] + yOfs = (rel_start * -1) -- bottom of screen + + calc_bars() -- offset of WoW bars shown + + start_y -- center of extra action button --[[ -TitanDebug ("MData ExtraActionBarFrame :" - .." yOfs:"..tostring(yOfs) +TitanDebug ("move y :" + .." "..tostring(ExtraActionBarFrame:GetName()) + .." y: "..tostring(yOfs) + .." b/2: "..tostring(start_y) + .." b+: "..tostring(calc_bars()) + .." rs: "..tostring(rel_start) ) --]] - MoveFrame("ExtraActionBarFrame", yOfs, TITAN_PANEL_PLACE_BOTTOM, force) + --MoveFrame("ExtraActionBarFrame", yOfs, TITAN_PANEL_PLACE_BOTTOM, force) + MoveFrame("ExtraAbilityContainer", yOfs, TITAN_PANEL_PLACE_BOTTOM, force) end end, addonAdj = false, }, ---[=[ ---]=] --[[ [12] = {frameName = "OrderHallCommandBar", move = function (force) @@ -695,6 +802,7 @@ OUT: None local function TitanMovableFrame_MoveFrames(force) local move_count = 0 -- debug local str = "" -- debug + local force = force or false --[[ Setting the MainMenuBar as user placed is needed because in 8.0.0 Blizzard changed something in the way they controlled the frame. With Titan panel and bottom bars enabled the MainMenuBar @@ -730,8 +838,7 @@ local function TitanMovableFrame_MoveFrames(force) end end end ---[ ---]] + Titan_FCF_UpdateDockPosition(); -- chat UpdateContainerFrameAnchors(); -- Move bags as needed else @@ -753,14 +860,24 @@ end NAME: TitanPanel_AdjustFrames DESC: Adjust the frames for the Titan visible bars. This is a shell for the actual Movable routine used by other Titan routines and secure hooks +VAR: force - Force an adjust such as when the user changes bars shown OUT: None NOTE: :NOTE --]] -function TitanPanel_AdjustFrames(force) - -- force is passed to cover cases where Titan should always adjust - -- such as when the user has just de/selected top or bottom bars - local f = force or false -- do not require the parameter +function TitanPanel_AdjustFrames(force, reason) +--[[ +TitanDebug ("_AdjustFrames :" + .." "..tostring(force) + .." reason: '"..tostring(reason).."'" + ) +--]] + local f = false -- do not require the parameter + if force == true then -- but force it to be boolean + f = true + else + f = false + end -- Adjust frame positions top and bottom based on user choices if hooks_done then @@ -790,12 +907,76 @@ function Titan_AdjustScale() , TITAN_PANEL_PLACE_TOP); end - TitanMovableFrame_MoveFrames() + TitanPanel_AdjustFrames(false, "_AdjustScale ") -- TitanPanelBarButton_DisplayBarsWanted() TitanPanel_RefreshPanelButtons(); end end +--[[ ============= +NAME: Titan_Hook_* +DESC: Set of routines to front the adjust the frames routine. +VAR: None +OUT: None +NOTE: +This group of Titan_Hook_* is : +- to debug moving of frames when TitanPanel_AdjustFrames hooks trigger +- just in case there is specific processing needed per hook +- used when hooks and callbacks are needed + +These may be called from any Titan Panel code +:NOTE +--]] +function Titan_Hook_Frames() + TitanPanel_AdjustFrames(false, "Hook UIParent_ManageFramePositions ") +end + +function Titan_Hook_Ticket_Show() + TitanPanel_AdjustFrames(false, "Hook TicketStatusFrame Show ") +end + +function Titan_Hook_Ticket_Hide() + TitanPanel_AdjustFrames(false, "Hook TicketStatusFrame Hide ") +end + +function Titan_Hook_Target() + TitanPanel_AdjustFrames(false, "Hook TargetFrame_Update ") +end + +function Titan_Hook_Override_Show() + TitanPanel_AdjustFrames(false, "Hook OverrideActionBar Show") +end + +function Titan_Hook_Override_Hide() + TitanPanel_AdjustFrames(false, "Hook OverrideActionBar Hide") +end + +function Titan_Hook_Map() + TitanPanel_AdjustFrames(false, "Hook WorldMapFrame.BorderFrame.MaximizeMinimizeFrame.MinimizeButton ") +end + +function Titan_Hook_OrderHall() + TitanPanel_AdjustFrames(false, "Hook OrderHall_CheckCommandBar ") +end + +function Titan_Hook_PEW() + TitanPanel_AdjustFrames(false, "Hook PEW Config timer") +end + +function Titan_Hook_SpecSwitch() + TitanPanel_AdjustFrames(false, "Hook SpecSwitch Config timer ") +end + +function Titan_Hook_MoveAdj() + TitanPanel_AdjustFrames(false, "Hook MoveAdj Config timer ") +end + +function Titan_Hook_Vehicle() + TitanPanel_AdjustFrames(false, "Hook Vehicle Config timer ") +end + +-- ============= + --[[ Titan NAME: TitanMovable_SecureFrames DESC: Once Titan is initialized create the post hooks we need to help adjust frames properly. @@ -810,23 +991,21 @@ function TitanMovable_SecureFrames() if not TitanPanelAce:IsHooked("FCF_UpdateDockPosition", Titan_FCF_UpdateDockPosition) then TitanPanelAce:SecureHook("FCF_UpdateDockPosition", Titan_FCF_UpdateDockPosition) -- FloatingChatFrame end - if not TitanPanelAce:IsHooked("UIParent_ManageFramePositions", TitanPanel_AdjustFrames) then - TitanPanelAce:SecureHook("UIParent_ManageFramePositions", TitanPanel_AdjustFrames) -- UIParent.lua - TitanPanel_AdjustFrames() + if not TitanPanelAce:IsHooked("UIParent_ManageFramePositions", Titan_Hook_Frames) then + TitanPanelAce:SecureHook("UIParent_ManageFramePositions", Titan_Hook_Frames) -- UIParent.lua + TitanPanel_AdjustFrames(true, "Hook First UIParent_ManageFramePositions") end - if not TitanPanelAce:IsHooked(TicketStatusFrame, "Show", TitanPanel_AdjustFrames) then - TitanPanelAce:SecureHook(TicketStatusFrame, "Show", TitanPanel_AdjustFrames) -- HelpFrame.xml - TitanPanelAce:SecureHook(TicketStatusFrame, "Hide", TitanPanel_AdjustFrames) -- HelpFrame.xml - TitanPanelAce:SecureHook("TargetFrame_Update", TitanPanel_AdjustFrames) -- TargetFrame.lua --- TitanPanelAce:SecureHook(MainMenuBar, "Show", TitanPanel_AdjustFrames) -- HelpFrame.xml --- TitanPanelAce:SecureHook(MainMenuBar, "Hide", TitanPanel_AdjustFrames) -- HelpFrame.xml - TitanPanelAce:SecureHook(OverrideActionBar, "Show", TitanPanel_AdjustFrames) -- HelpFrame.xml - TitanPanelAce:SecureHook(OverrideActionBar, "Hide", TitanPanel_AdjustFrames) -- HelpFrame.xml + if not TitanPanelAce:IsHooked(TicketStatusFrame, "Show", Titan_Hook_Ticket_Show) then + TitanPanelAce:SecureHook(TicketStatusFrame, "Show", Titan_Hook_Ticket_Show) -- HelpFrame.xml + TitanPanelAce:SecureHook(TicketStatusFrame, "Hide", Titan_Hook_Ticket_Hide) -- HelpFrame.xml + TitanPanelAce:SecureHook("TargetFrame_Update", Titan_Hook_Target) -- TargetFrame.lua + TitanPanelAce:SecureHook(OverrideActionBar, "Show", Titan_Hook_Override_Show) -- HelpFrame.xml + TitanPanelAce:SecureHook(OverrideActionBar, "Hide", Titan_Hook_Override_Hide) -- HelpFrame.xml TitanPanelAce:SecureHook("UpdateContainerFrameAnchors", Titan_ContainerFrames_Relocate) -- ContainerFrame.lua - TitanPanelAce:SecureHook(WorldMapFrame.BorderFrame.MaximizeMinimizeFrame.MinimizeButton, "Show", TitanPanel_AdjustFrames) -- WorldMapFrame.lua + TitanPanelAce:SecureHook(WorldMapFrame.BorderFrame.MaximizeMinimizeFrame.MinimizeButton, "Show", Titan_Hook_Map) -- WorldMapFrame.lua - TitanPanelAce:SecureHook("OrderHall_CheckCommandBar", TitanPanel_AdjustFrames) + TitanPanelAce:SecureHook("OrderHall_CheckCommandBar", Titan_Hook_OrderHall) end if not TitanPanelAce:IsHooked("VideoOptionsFrameOkay_OnClick", Titan_AdjustUIScale) then diff --git a/Titan/TitanPanel.lua b/Titan/TitanPanel.lua index 5df466d..8e20428 100644 --- a/Titan/TitanPanel.lua +++ b/Titan/TitanPanel.lua @@ -422,7 +422,7 @@ function TitanPanel_PlayerEnteringWorld() -- Move frames TitanMovable_SecureFrames() - TitanPanel_AdjustFrames() + TitanPanel_AdjustFrames(true, "Init: PEW (Player Entering World)") -- Secondary failsafe check for bottom frame adjustment -- @@ -499,7 +499,7 @@ function TitanPanelBarButton:CVAR_UPDATE(cvarname, cvarvalue) if TitanPlayerSettings and TitanPanelGetVar("Scale") then Titan_AdjustScale() -- Adjust frame positions - TitanPanel_AdjustFrames() + TitanPanel_AdjustFrames(true, "CVar update "..tostring(cvarname)) end end end @@ -525,7 +525,7 @@ end function TitanPanelBarButton:PLAYER_REGEN_ENABLED() -- Outside combat check to see if frames need correction - TitanPanel_AdjustFrames() + TitanPanel_AdjustFrames(true, "Regen enabled") end --[ function TitanPanelBarButton:ACTIVE_TALENT_GROUP_CHANGED() @@ -541,7 +541,7 @@ function TitanPanelBarButton:UNIT_ENTERED_VEHICLE(self, ...) end function TitanPanelBarButton:UNIT_EXITED_VEHICLE(self, ...) -- A combat check will be done inside the adjust - TitanPanel_AdjustFrames(true) + TitanPanel_AdjustFrames(true, "Exit vehicle") end --]] -- @@ -697,7 +697,7 @@ local function handle_reset_cmds(cmd_list) -- Adjust panel scale Titan_AdjustScale() -- Adjust frame positions - TitanPanel_AdjustFrames() + TitanPanel_AdjustFrames(true, "Config: adj scale") TitanPrint(L["TITAN_PANEL_SLASH_RESP3"], "info") else TitanPrint(L["TITAN_PANEL_MENU_IN_COMBAT_LOCKDOWN"], "warning") @@ -1133,7 +1133,7 @@ NOTE: function TitanPanelBarButton_ToggleScreenAdjust() -- Turn on / off adjusting of other frames around Titan TitanPanelToggleVar("ScreenAdjust"); - TitanPanel_AdjustFrames(true) + TitanPanel_AdjustFrames(true, "Config: on/off adj top frames") end --[[ Titan @@ -1148,7 +1148,7 @@ NOTE: function TitanPanelBarButton_ToggleAuxScreenAdjust() -- turn on / off adjusting of frames at the bottom of the screen TitanPanelToggleVar("AuxScreenAdjust"); - TitanPanel_AdjustFrames(true) + TitanPanel_AdjustFrames(true, "Config: on/off adj bottom frames") end --[[ Titan @@ -1239,7 +1239,7 @@ function TitanPanelBarButton_DisplayBarsWanted() TitanAnchors() -- Adjust other frames because the bars shown / hidden may have changed - TitanPanel_AdjustFrames(true) + TitanPanel_AdjustFrames(true, "_DisplayBarsWanted") end --[[ Titan diff --git a/Titan/TitanUtils.lua b/Titan/TitanUtils.lua index ba95597..9eba364 100644 --- a/Titan/TitanUtils.lua +++ b/Titan/TitanUtils.lua @@ -1437,7 +1437,7 @@ function TitanUtils_RegisterPluginList() local id local cnt = 0 if TitanPluginToBeRegisteredNum > 0 then - if not Titan__InitializedPEW and not TitanAllGetVar("Silenced") then + if not Titan__InitializedPEW and TitanAllGetVar("Registered") then TitanDebug(L["TITAN_PANEL_REGISTER_START"], "normal") end for index, value in ipairs(TitanPluginToBeRegistered) do @@ -1446,7 +1446,7 @@ function TitanUtils_RegisterPluginList() end cnt = cnt + 1 end - if not Titan__InitializedPEW and not TitanAllGetVar("Silenced") then + if not Titan__InitializedPEW and TitanAllGetVar("Registered") then TitanDebug((L["TITAN_PANEL_REGISTER_END"].." "..cnt), "normal") end end diff --git a/Titan/TitanVariables.lua b/Titan/TitanVariables.lua index d277877..909a79d 100644 --- a/Titan/TitanVariables.lua +++ b/Titan/TitanVariables.lua @@ -277,6 +277,7 @@ TITAN_PANEL_SAVED_VARIABLES = { AuxBar2_Transparency = 0.7, AuxBar2_Align = TITAN_PANEL_BUTTONS_ALIGN_LEFT, MainMenuBarXAdj = 0, + BuffIconVerticalAdj = 10, }; --[[ Titan @@ -292,8 +293,8 @@ TITAN_ALL_SAVED_VARIABLES = { -- Global profile GlobalProfileUse = false, GlobalProfileName = TITAN_PROFILE_NONE, - -- Silent Load - Silenced = false, + Silenced = false,-- Silent Load : name and version + Registered = false, -- for debug -- OrderHallCommandBar Status OrderHall = true, }; @@ -518,9 +519,7 @@ OUT: None --]] local function Sync_panel_settings(settings) -- Synchronize registered and saved variables ---TitanDebug("Sync_1: "..(settings.FontName or "?")) TitanVariables_SyncRegisterSavedVariables(settings, TitanPanelSettings) ---TitanDebug("Sync_2: "..(TitanPanelSettings.FontName or "?")) end --[[ local @@ -532,11 +531,11 @@ OUT: None local function Set_Timers(reset) -- Titan is loaded so set the timers we want to use TitanTimers = { - ["EnterWorld"] = {obj = "PEW", callback = TitanPanel_AdjustFrames, delay = 4,}, - ["DualSpec"] = {obj = "SpecSwitch", callback = TitanPanel_AdjustFrames, delay = 2,}, + ["EnterWorld"] = {obj = "PEW", callback = Titan_Hook_PEW, delay = 4,}, + ["DualSpec"] = {obj = "SpecSwitch", callback = Titan_Hook_SpecSwitch, delay = 2,}, ["LDBRefresh"] = {obj = "LDB", callback = TitanLDBRefreshButton, delay = 2,}, - ["Adjust"] = {obj = "MoveAdj", callback = TitanPanel_AdjustFrames, delay = 1,}, - ["Vehicle"] = {obj = "Vehicle", callback = TitanPanel_AdjustFrames, delay = 1,}, + ["Adjust"] = {obj = "MoveAdj", callback = Titan_Hook_MoveAdj, delay = 1,}, + ["Vehicle"] = {obj = "Vehicle", callback = Titan_Hook_Vehicle, delay = 1,}, } if reset then @@ -626,7 +625,7 @@ function TitanVariables_InitTitanSettings() --[[ TitanDumpPlayerList() --]] - Sync_panel_settings(TITAN_PANEL_SAVED_VARIABLES) +-- Sync_panel_settings(TITAN_PANEL_SAVED_VARIABLES) if (TitanAll) then else -- 1.7.9.5