diff --git a/Titan/LDBToTitan.lua b/Titan/LDBToTitan.lua index 2219327..b5f6bc7 100644 --- a/Titan/LDBToTitan.lua +++ b/Titan/LDBToTitan.lua @@ -115,6 +115,13 @@ VAR: frame --]] function LDBToTitan:TitanLDBSetOwnerPosition(parent, anchorPoint, relativeToFrame, relativePoint, xOffset, yOffset, frame) if frame:GetName() == "GameTooltip" then + + -- Changes for 9.1.5. The background template was removed from the GameTooltip; backdrop color was changed to a NineSlice scheme... + local tool_trans = TitanPanelGetVar("TooltipTrans") + local bgR, bgG, bgB = TOOLTIP_DEFAULT_BACKGROUND_COLOR:GetRGB(); + frame.NineSlice:SetCenterColor(bgR, bgG, bgB, tool_trans); + +--[[ -- Changes for 9.1.5. The background template was removed from the GameTooltip local tip_name = frame:GetName() @@ -129,7 +136,7 @@ function LDBToTitan:TitanLDBSetOwnerPosition(parent, anchorPoint, relativeToFram tip_back_frame:SetBackdropBorderColor(TOOLTIP_DEFAULT_COLOR.r, TOOLTIP_DEFAULT_COLOR.g, TOOLTIP_DEFAULT_COLOR.b, tool_trans) tip_back_frame:SetBackdropColor(TOOLTIP_DEFAULT_BACKGROUND_COLOR.r, TOOLTIP_DEFAULT_BACKGROUND_COLOR.g, TOOLTIP_DEFAULT_BACKGROUND_COLOR.b, tool_trans) frame.MenuBackdrop = tip_back_frame - +--]] frame:SetOwner(parent, "ANCHOR_NONE"); --[[ -- set alpha (transparency) for the Game Tooltip diff --git a/Titan/TitanUtils.lua b/Titan/TitanUtils.lua index 4f9b37b..42abe72 100644 --- a/Titan/TitanUtils.lua +++ b/Titan/TitanUtils.lua @@ -696,6 +696,16 @@ end -- "TitanPanelRightClickMenu_Prepare"..<registry.id>.."Menu" -- --[[ API +NAME: TitanPanelRightClickMenu_GetDropdownLevel +DESC: Menu - add given info (button) at the given level in the form of a button. +VAR: None +OUT: int - dropdown menu level +--]] +function TitanPanelRightClickMenu_GetDropdownLevel() + return _G["L_UIDROPDOWNMENU_MENU_LEVEL"] +end + +--[[ API NAME: TitanPanelRightClickMenu_AddTitle DESC: Menu - add a title at the given level in the form of a button. VAR: title - text to show @@ -714,6 +724,19 @@ function TitanPanelRightClickMenu_AddTitle(title, level) end --[[ API +NAME: TitanPanelRightClickMenu_AddButton +DESC: Menu - add given info (button) at the given level in the form of a button. +VAR: info - text / button / command to show +VAR: level - level to put text +OUT: None +--]] +function TitanPanelRightClickMenu_AddButton(info, level) + if (info) then + DDM:UIDropDownMenu_AddButton(info, level); + end +end + +--[[ API NAME: TitanPanelRightClickMenu_AddCommand DESC: Menu - add a command at the given level in the form of a button. VAR: title - text to show @@ -820,6 +843,29 @@ function TitanPanelRightClickMenu_AddToggleColoredText(id, level) end --[[ API +NAME: TitanPanelRightClickMenu_AddToggleRightSide +DESC: Menu - add a toggle Right Side (localized) command at the given level in the form of a button. Titan will properly control the "DisplayOnRightSide" +VAR: id - id of the plugin +VAR: level - level to put the line +OUT: None +--]] +function TitanPanelRightClickMenu_AddToggleRightSide(id, level) + -- copy of TitanPanelRightClickMenu_AddToggleVar adding a remove button + local info = {}; + info.text = L["TITAN_CLOCK_MENU_DISPLAY_ON_RIGHT_SIDE"]; + info.value = {id, "DisplayOnRightSide"}; + info.func = function() + local bar = TitanUtils_GetWhichBar(id) + TitanPanelRightClickMenu_ToggleVar({id, "DisplayOnRightSide"}) + TitanPanel_RemoveButton(id); + TitanUtils_AddButtonOnBar(bar, id) + end + info.checked = TitanGetVar(id, "DisplayOnRightSide"); + info.keepShownOnClick = 1; + DDM:UIDropDownMenu_AddButton(info, level); +end + +--[[ API NAME: TitanPanelRightClickMenu_AddHide DESC: Menu - add a Hide (localized) command at the given level in the form of a button. When clicked this will remove the plugin from the Titan bar. VAR: id - id of the plugin diff --git a/TitanBag/TitanBag.lua b/TitanBag/TitanBag.lua index 193815b..086d94a 100644 --- a/TitanBag/TitanBag.lua +++ b/TitanBag/TitanBag.lua @@ -15,7 +15,7 @@ local updateTable = {TITAN_BAG_ID, TITAN_PANEL_UPDATE_BUTTON}; -- ******************************** Variables ******************************* local L = LibStub("AceLocale-3.0"):GetLocale("Titan", true) local AceTimer = LibStub("AceTimer-3.0") -local DDM = LibStub:GetLibrary("LibUIDropDownMenu-4.0") +--local DDM = LibStub:GetLibrary("LibUIDropDownMenu-4.0") local BagTimer local bag_info = { @@ -111,7 +111,7 @@ function TitanPanelBagButton_OnLoad(self) ShowLabelText = true, ShowRegularText = false, ShowColoredText = true, - DisplayOnRightSide = false + DisplayOnRightSide = true, }, savedVariables = { ShowUsedSlots = 1, @@ -120,6 +120,7 @@ function TitanPanelBagButton_OnLoad(self) ShowIcon = 1, ShowLabelText = 1, ShowColoredText = 1, + DisplayOnRightSide = false, } }; @@ -382,26 +383,29 @@ end function TitanPanelRightClickMenu_PrepareBagMenu() local info -- level 2 - if _G["L_UIDROPDOWNMENU_MENU_LEVEL"] == 2 then + if TitanPanelRightClickMenu_GetDropdownLevel() == 2 then if _G["L_UIDROPDOWNMENU_MENU_VALUE"] == "Options" then - TitanPanelRightClickMenu_AddTitle(L["TITAN_PANEL_OPTIONS"], _G["L_UIDROPDOWNMENU_MENU_LEVEL"]) + TitanPanelRightClickMenu_AddTitle(L["TITAN_PANEL_OPTIONS"], TitanPanelRightClickMenu_GetDropdownLevel()) info = {}; info.text = L["TITAN_BAG_MENU_SHOW_USED_SLOTS"]; info.func = TitanPanelBagButton_ShowUsedSlots; info.checked = TitanGetVar(TITAN_BAG_ID, "ShowUsedSlots"); - DDM:UIDropDownMenu_AddButton(info, _G["L_UIDROPDOWNMENU_MENU_LEVEL"]); +-- DDM:UIDropDownMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); + TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); info = {}; info.text = L["TITAN_BAG_MENU_SHOW_AVAILABLE_SLOTS"]; info.func = TitanPanelBagButton_ShowAvailableSlots; info.checked = TitanUtils_Toggle(TitanGetVar(TITAN_BAG_ID, "ShowUsedSlots")); - DDM:UIDropDownMenu_AddButton(info, _G["L_UIDROPDOWNMENU_MENU_LEVEL"]); +-- DDM:UIDropDownMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); + TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); info = {}; info.text = L["TITAN_BAG_MENU_SHOW_DETAILED"]; info.func = TitanPanelBagButton_ShowDetailedInfo; info.checked = TitanGetVar(TITAN_BAG_ID, "ShowDetailedInfo"); - DDM:UIDropDownMenu_AddButton(info, _G["L_UIDROPDOWNMENU_MENU_LEVEL"]); +-- DDM:UIDropDownMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); + TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); end return end @@ -414,19 +418,22 @@ function TitanPanelRightClickMenu_PrepareBagMenu() info.text = L["TITAN_PANEL_OPTIONS"]; info.value = "Options" info.hasArrow = 1; - DDM:UIDropDownMenu_AddButton(info); +-- DDM:UIDropDownMenu_AddButton(info); + TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); TitanPanelRightClickMenu_AddSpacer(); info = {}; info.text = L["TITAN_BAG_MENU_IGNORE_PROF_BAGS_SLOTS"]; info.func = TitanPanelBagButton_ToggleIgnoreProfBagSlots; info.checked = TitanUtils_Toggle(TitanGetVar(TITAN_BAG_ID, "CountProfBagSlots")); - DDM:UIDropDownMenu_AddButton(info, _G["L_UIDROPDOWNMENU_MENU_LEVEL"]); +-- DDM:UIDropDownMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); + TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); TitanPanelRightClickMenu_AddSpacer(); TitanPanelRightClickMenu_AddToggleIcon(TITAN_BAG_ID); TitanPanelRightClickMenu_AddToggleLabelText(TITAN_BAG_ID); TitanPanelRightClickMenu_AddToggleColoredText(TITAN_BAG_ID); + TitanPanelRightClickMenu_AddToggleRightSide(TITAN_BAG_ID); TitanPanelRightClickMenu_AddSpacer(); TitanPanelRightClickMenu_AddCommand(L["TITAN_PANEL_MENU_HIDE"], TITAN_BAG_ID, TITAN_PANEL_MENU_FUNC_HIDE); end diff --git a/TitanClock/TitanClock.lua b/TitanClock/TitanClock.lua index 3026482..9a63c49 100644 --- a/TitanClock/TitanClock.lua +++ b/TitanClock/TitanClock.lua @@ -10,10 +10,27 @@ local TITAN_CLOCK_FORMAT_12H = "12H"; local TITAN_CLOCK_FORMAT_24H = "24H"; local TITAN_CLOCK_FRAME_SHOW_TIME = 0.5; local _G = getfenv(0); + +local back_drop_info = + { + bgFile="Interface\\Tooltips\\UI-Tooltip-Background", + edgeFile="Interface\\Tooltips\\UI-Tooltip-Border", + tile = true, + insets = { + left = 0, + right = 0, + top = 0, + bottom = 0, + }, + tileSize = 8, + edgeSize = 8, + } + + -- ******************************** Variables ******************************* local L = LibStub("AceLocale-3.0"):GetLocale("Titan", true) local AceTimer = LibStub("AceTimer-3.0") -local DDM = LibStub:GetLibrary("LibUIDropDownMenu-4.0") +--local DDM = LibStub:GetLibrary("LibUIDropDownMenu-4.0") local ClockTimer = nil; local updateTable = {TITAN_CLOCK_ID, TITAN_PANEL_UPDATE_ALL }; local realmName = GetRealmName(); @@ -446,11 +463,20 @@ function TitanPanelClockControlFrame_OnLoad(self) Blizzard decided to remove direct Backdrop API in 9.0 (Shadowlands) so inherit the template (XML) and set the values in the code (Lua) ---]] - self:SetBackdrop(BACKDROP_SLIDER_8_8) -- use a pre-set from Backdrop.lua BACKDROP_TOOLTIP_16_16_5555 - self:SetBackdropBorderColor(1, 1, 1); - self:SetBackdropColor(0, 0, 0, 1); +9.5.1 Blizzard decided to remove the backdrop constant we were using... + +Use the Blizzard color defaults. +Leave the background opaque because it is an option not a tooltip. +--]] + self:SetBackdrop(back_drop_info) + + self:SetBackdropBorderColor(TOOLTIP_DEFAULT_COLOR.r, TOOLTIP_DEFAULT_COLOR.g, TOOLTIP_DEFAULT_COLOR.b, 1); + self:SetBackdropColor( + TOOLTIP_DEFAULT_BACKGROUND_COLOR.r, + TOOLTIP_DEFAULT_BACKGROUND_COLOR.g, + TOOLTIP_DEFAULT_BACKGROUND_COLOR.b, + 1); end -- ************************************************************************** @@ -473,31 +499,31 @@ function TitanPanelRightClickMenu_PrepareClockMenu() info.text = L["TITAN_CLOCK_MENU_LOCAL_TIME"]; info.func = function() TitanSetVar(TITAN_CLOCK_ID, "TimeMode", "Local") TitanPanelButton_UpdateButton(TITAN_CLOCK_ID) end info.checked = function() return TitanGetVar(TITAN_CLOCK_ID, "TimeMode") == "Local" end - DDM:UIDropDownMenu_AddButton(info); + TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); info = {}; info.text = L["TITAN_CLOCK_MENU_SERVER_TIME"]; info.func = function() TitanSetVar(TITAN_CLOCK_ID, "TimeMode", "Server") TitanPanelButton_UpdateButton(TITAN_CLOCK_ID) end info.checked = function() return TitanGetVar(TITAN_CLOCK_ID, "TimeMode") == "Server" end - DDM:UIDropDownMenu_AddButton(info); + TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); info = {}; info.text = L["TITAN_CLOCK_MENU_SERVER_ADJUSTED_TIME"]; info.func = function() TitanSetVar(TITAN_CLOCK_ID, "TimeMode", "ServerAdjusted") TitanPanelButton_UpdateButton(TITAN_CLOCK_ID) end info.checked = function() return TitanGetVar(TITAN_CLOCK_ID, "TimeMode") == "ServerAdjusted" end - DDM:UIDropDownMenu_AddButton(info); + TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); info = {}; info.text = L["TITAN_CLOCK_MENU_SERVER_TIME"].." & "..L["TITAN_CLOCK_MENU_LOCAL_TIME"] info.func = function() TitanSetVar(TITAN_CLOCK_ID, "TimeMode", "ServerLocal") TitanPanelButton_UpdateButton(TITAN_CLOCK_ID) end info.checked = function() return TitanGetVar(TITAN_CLOCK_ID, "TimeMode") == "ServerLocal" end - DDM:UIDropDownMenu_AddButton(info); + TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); info = {}; info.text = L["TITAN_CLOCK_MENU_SERVER_ADJUSTED_TIME"].." & "..L["TITAN_CLOCK_MENU_LOCAL_TIME"] info.func = function() TitanSetVar(TITAN_CLOCK_ID, "TimeMode", "ServerAdjustedLocal") TitanPanelButton_UpdateButton(TITAN_CLOCK_ID) end info.checked = function() return TitanGetVar(TITAN_CLOCK_ID, "TimeMode") == "ServerAdjustedLocal" end - DDM:UIDropDownMenu_AddButton(info); + TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); TitanPanelRightClickMenu_AddSpacer(); @@ -506,57 +532,20 @@ function TitanPanelRightClickMenu_PrepareClockMenu() info.func = TitanPanelClockButton_ToggleMapTime; info.checked = TitanGetVar(TITAN_CLOCK_ID, "HideMapTime"); info.keepShownOnClick = 1; - DDM:UIDropDownMenu_AddButton(info); + TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); info = {}; info.text = L["TITAN_CLOCK_MENU_HIDE_CALENDAR"]; info.func = TitanPanelClockButton_ToggleGameTimeFrameShown; info.checked = TitanGetVar(TITAN_CLOCK_ID, "HideGameTimeMinimap"); info.keepShownOnClick = 1; - DDM:UIDropDownMenu_AddButton(info); - - info = {}; - info.text = L["TITAN_CLOCK_MENU_DISPLAY_ON_RIGHT_SIDE"]; - info.func = TitanPanelClockButton_ToggleRightSideDisplay; - info.checked = TitanGetVar(TITAN_CLOCK_ID, "DisplayOnRightSide"); - DDM:UIDropDownMenu_AddButton(info); + TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); + TitanPanelRightClickMenu_AddSpacer(); TitanPanelRightClickMenu_AddToggleLabelText(TITAN_CLOCK_ID); TitanPanelRightClickMenu_AddToggleColoredText(TITAN_CLOCK_ID); + TitanPanelRightClickMenu_AddToggleRightSide(TITAN_CLOCK_ID); TitanPanelRightClickMenu_AddSpacer(); TitanPanelRightClickMenu_AddCommand(L["TITAN_PANEL_MENU_HIDE"], TITAN_CLOCK_ID, TITAN_PANEL_MENU_FUNC_HIDE); end - --- ************************************************************************** --- NAME : TitanPanelClockButton_ToggleRightSideDisplay() --- DESC : Add clock button to bar --- ************************************************************************** -function TitanPanelClockButton_ToggleRightSideDisplay() - TitanToggleVar(TITAN_CLOCK_ID, "DisplayOnRightSide"); - TitanPanel_RemoveButton(TITAN_CLOCK_ID); - --TitanPanel_AddButton(TITAN_CLOCK_ID); -end - -function TitanPanelClockButton_ToggleGameTimeFrameShown() - TitanToggleVar(TITAN_CLOCK_ID, "HideGameTimeMinimap"); - if GameTimeFrame and GameTimeFrame:GetName() then - if TitanGetVar(TITAN_CLOCK_ID, "HideGameTimeMinimap") then - GameTimeFrame:Hide() - else - GameTimeFrame:Show() - end - end -end - - -function TitanPanelClockButton_ToggleMapTime() - TitanToggleVar(TITAN_CLOCK_ID, "HideMapTime"); - if TimeManagerClockButton and TimeManagerClockButton:GetName() then - if TitanGetVar(TITAN_CLOCK_ID, "HideMapTime") then - TimeManagerClockButton:Hide() - else - TimeManagerClockButton:Show() - end - end -end diff --git a/TitanGold/TitanGold.lua b/TitanGold/TitanGold.lua index 478210b..fe0062f 100644 --- a/TitanGold/TitanGold.lua +++ b/TitanGold/TitanGold.lua @@ -22,7 +22,7 @@ local GOLD_PERHOUR_STATUS; local GOLD_STARTINGGOLD; local GOLD_SESSIONSTART; local L = LibStub("AceLocale-3.0"):GetLocale("Titan", true) -local DDM = LibStub:GetLibrary("LibUIDropDownMenu-4.0") +--local DDM = LibStub:GetLibrary("LibUIDropDownMenu-4.0") local TitanGold = LibStub("AceAddon-3.0"):NewAddon("TitanGold", "AceTimer-3.0") local GoldTimer = nil; local _G = getfenv(0); @@ -175,7 +175,7 @@ function TitanPanelGoldButton_OnLoad(self) ShowLabelText =true, ShowRegularText = false, ShowColoredText = false, - DisplayOnRightSide = false + DisplayOnRightSide = true, }, savedVariables = { Initialized = true, @@ -194,6 +194,7 @@ function TitanPanelGoldButton_OnLoad(self) MergeServers = false, SeparateServers = true, gold = { total = "112233", neg = false }, + DisplayOnRightSide = false, } }; @@ -508,7 +509,7 @@ local function ShowMenuButtons(faction) GoldSave[rementry].show = not GoldSave[rementry].show; TitanPanelButton_UpdateButton(TITAN_GOLD_ID) end - DDM:UIDropDownMenu_AddButton(info, L_UIDROPDOWNMENU_MENU_LEVEL); + TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); end end end @@ -534,7 +535,7 @@ local function DeleteMenuButtons(faction) else info.disabled = nil; end - DDM:UIDropDownMenu_AddButton(info, L_UIDROPDOWNMENU_MENU_LEVEL); + TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); end end end @@ -627,21 +628,23 @@ function TitanPanelRightClickMenu_PrepareGoldMenu() info.func = function() ShowProperLabels("ShowCoinNone") end - DDM:UIDropDownMenu_AddButton(info, _G["L_UIDROPDOWNMENU_MENU_LEVEL"]); + TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); + local info = {}; info.text = L["TITAN_GOLD_COIN_LABELS"]; info.checked = TitanGetVar(TITAN_GOLD_ID, "ShowCoinLabels"); info.func = function() ShowProperLabels("ShowCoinLabels") end - DDM:UIDropDownMenu_AddButton(info, _G["L_UIDROPDOWNMENU_MENU_LEVEL"]); + TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); + local info = {}; info.text = L["TITAN_GOLD_COIN_ICONS"]; info.checked = TitanGetVar(TITAN_GOLD_ID, "ShowCoinIcons"); info.func = function() ShowProperLabels("ShowCoinIcons") end - DDM:UIDropDownMenu_AddButton(info, _G["L_UIDROPDOWNMENU_MENU_LEVEL"]); + TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); TitanPanelRightClickMenu_AddSpacer(); @@ -651,14 +654,15 @@ function TitanPanelRightClickMenu_PrepareGoldMenu() info.func = function() Seperator("UseSeperatorComma") end - DDM:UIDropDownMenu_AddButton(info, _G["L_UIDROPDOWNMENU_MENU_LEVEL"]); + TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); + local info = {}; info.text = L["TITAN_USE_PERIOD"]; info.checked = TitanGetVar(TITAN_GOLD_ID, "UseSeperatorPeriod"); info.func = function() Seperator("UseSeperatorPeriod") end - DDM:UIDropDownMenu_AddButton(info, _G["L_UIDROPDOWNMENU_MENU_LEVEL"]); + TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); TitanPanelRightClickMenu_AddSpacer(); @@ -668,14 +672,15 @@ function TitanPanelRightClickMenu_PrepareGoldMenu() info.func = function() Merger("MergeServers") end - DDM:UIDropDownMenu_AddButton(info, _G["L_UIDROPDOWNMENU_MENU_LEVEL"]); + TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); + local info = {}; info.text = L["TITAN_GOLD_SEPARATE"]; info.checked = TitanGetVar(TITAN_GOLD_ID, "SeparateServers"); info.func = function() Merger("SeparateServers") end - DDM:UIDropDownMenu_AddButton(info, _G["L_UIDROPDOWNMENU_MENU_LEVEL"]); + TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); TitanPanelRightClickMenu_AddSpacer(); @@ -686,7 +691,7 @@ function TitanPanelRightClickMenu_PrepareGoldMenu() TitanToggleVar(TITAN_GOLD_ID, "ShowGoldOnly"); TitanPanelButton_UpdateButton(TITAN_GOLD_ID); end - DDM:UIDropDownMenu_AddButton(info, _G["L_UIDROPDOWNMENU_MENU_LEVEL"]); + TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); -- A blank line in the menu TitanPanelRightClickMenu_AddSpacer(); @@ -697,7 +702,7 @@ function TitanPanelRightClickMenu_PrepareGoldMenu() info.text = L["TITAN_GOLD_SHOW_PLAYER"]; info.value = "ToonShow"; info.hasArrow = 1; - DDM:UIDropDownMenu_AddButton(info); + TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); -- Delete toon info = {}; @@ -705,7 +710,7 @@ function TitanPanelRightClickMenu_PrepareGoldMenu() info.text = L["TITAN_GOLD_DELETE_PLAYER"]; info.value = "ToonDelete"; info.hasArrow = 1; - DDM:UIDropDownMenu_AddButton(info); + TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); -- A blank line in the menu TitanPanelRightClickMenu_AddSpacer(); @@ -715,7 +720,7 @@ function TitanPanelRightClickMenu_PrepareGoldMenu() info.notCheckable = true info.text = L["TITAN_GOLD_CLEAR_DATA_TEXT"]; info.func = TitanGold_ClearDB; - DDM:UIDropDownMenu_AddButton(info); + TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); TitanPanelRightClickMenu_AddCommand(L["TITAN_GOLD_RESET_SESS_TEXT"], TITAN_GOLD_ID, "TitanPanelGoldButton_ResetSession"); @@ -724,6 +729,7 @@ function TitanPanelRightClickMenu_PrepareGoldMenu() TitanPanelRightClickMenu_AddToggleIcon(TITAN_GOLD_ID); TitanPanelRightClickMenu_AddToggleLabelText(TITAN_GOLD_ID); TitanPanelRightClickMenu_AddToggleColoredText(TITAN_GOLD_ID); + TitanPanelRightClickMenu_AddToggleRightSide(TITAN_GOLD_ID); TitanPanelRightClickMenu_AddSpacer(); -- Generic function to toggle and hide @@ -736,24 +742,24 @@ function TitanPanelRightClickMenu_PrepareGoldMenu() info.text = L["TITAN_GOLD_FACTION_PLAYER_ALLY"]; info.value = "DeleteAlliance"; info.hasArrow = 1; - DDM:UIDropDownMenu_AddButton(info, L_UIDROPDOWNMENU_MENU_LEVEL); + TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); info.text = L["TITAN_GOLD_FACTION_PLAYER_HORDE"]; info.value = "DeleteHorde"; info.hasArrow = 1; - DDM:UIDropDownMenu_AddButton(info, L_UIDROPDOWNMENU_MENU_LEVEL); + TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); elseif L_UIDROPDOWNMENU_MENU_LEVEL == 2 and L_UIDROPDOWNMENU_MENU_VALUE == "ToonShow" then local info = {}; info.notCheckable = true info.text = L["TITAN_GOLD_FACTION_PLAYER_ALLY"]; info.value = "ShowAlliance"; info.hasArrow = 1; - DDM:UIDropDownMenu_AddButton(info, L_UIDROPDOWNMENU_MENU_LEVEL); + TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); info.text = L["TITAN_GOLD_FACTION_PLAYER_HORDE"]; info.value = "ShowHorde"; info.hasArrow = 1; - DDM:UIDropDownMenu_AddButton(info, L_UIDROPDOWNMENU_MENU_LEVEL); + TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); end if L_UIDROPDOWNMENU_MENU_LEVEL == 3 and L_UIDROPDOWNMENU_MENU_VALUE == "DeleteAlliance" then diff --git a/TitanLocation/TitanLocation.lua b/TitanLocation/TitanLocation.lua index 2e486cb..2c41345 100755 --- a/TitanLocation/TitanLocation.lua +++ b/TitanLocation/TitanLocation.lua @@ -15,7 +15,7 @@ local updateTable = {TITAN_LOCATION_ID, TITAN_PANEL_UPDATE_BUTTON}; -- ******************************** Variables ******************************* local L = LibStub("AceLocale-3.0"):GetLocale("Titan", true); local AceTimer = LibStub("AceTimer-3.0"); -local DDM = LibStub:GetLibrary("LibUIDropDownMenu-4.0") +--local DDM = LibStub:GetLibrary("LibUIDropDownMenu-4.0") local LocationTimer = nil; -- ******************************** Functions ******************************* @@ -39,7 +39,7 @@ function TitanPanelLocationButton_OnLoad(self) ShowLabelText = true, ShowRegularText = false, ShowColoredText = true, - DisplayOnRightSide = false + DisplayOnRightSide = true, }, savedVariables = { ShowZoneText = 1, @@ -53,6 +53,7 @@ function TitanPanelLocationButton_OnLoad(self) CoordsFormat2 = false, CoordsFormat3 = false, UpdateWorldmap = false, + DisplayOnRightSide = false, } }; @@ -298,20 +299,20 @@ function TitanPanelRightClickMenu_PrepareLocationMenu() info.text = L["TITAN_LOCATION_MENU_SHOW_ZONE_ON_PANEL_TEXT"]; info.func = TitanPanelLocationButton_ToggleDisplay; info.checked = TitanGetVar(TITAN_LOCATION_ID, "ShowZoneText"); - DDM:UIDropDownMenu_AddButton(info, _G["L_UIDROPDOWNMENU_MENU_LEVEL"]); + TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); info = {}; info.text = L["TITAN_LOCATION_MENU_SHOW_COORDS_ON_MAP_TEXT"]; info.func = TitanPanelLocationButton_ToggleLocationOnMap; info.checked = TitanGetVar(TITAN_LOCATION_ID, "ShowCoordsOnMap"); - DDM:UIDropDownMenu_AddButton(info, _G["L_UIDROPDOWNMENU_MENU_LEVEL"]); + TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); info = {}; info.text = L["TITAN_LOCATION_MENU_SHOW_LOC_ON_MINIMAP_TEXT"]; info.func = TitanPanelLocationButton_ToggleLocOnMiniMap; info.checked = TitanGetVar(TITAN_LOCATION_ID, "ShowLocOnMiniMap"); info.disabled = InCombatLockdown() - DDM:UIDropDownMenu_AddButton(info, _G["L_UIDROPDOWNMENU_MENU_LEVEL"]); + TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); info = {}; info.text = L["TITAN_LOCATION_MENU_UPDATE_WORLD_MAP"]; @@ -320,7 +321,7 @@ function TitanPanelRightClickMenu_PrepareLocationMenu() end info.checked = TitanGetVar(TITAN_LOCATION_ID, "UpdateWorldmap"); info.disabled = InCombatLockdown() - DDM:UIDropDownMenu_AddButton(info, _G["L_UIDROPDOWNMENU_MENU_LEVEL"]); + TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); end if _G["L_UIDROPDOWNMENU_MENU_VALUE"] == "CoordFormat" then TitanPanelRightClickMenu_AddTitle(L["TITAN_LOCATION_FORMAT_COORD_LABEL"], _G["L_UIDROPDOWNMENU_MENU_LEVEL"]); @@ -333,7 +334,7 @@ function TitanPanelRightClickMenu_PrepareLocationMenu() TitanPanelButton_UpdateButton(TITAN_LOCATION_ID); end info.checked = TitanGetVar(TITAN_LOCATION_ID, "CoordsFormat1"); - DDM:UIDropDownMenu_AddButton(info, _G["L_UIDROPDOWNMENU_MENU_LEVEL"]); + TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); info = {}; info.text = L["TITAN_LOCATION_FORMAT2_LABEL"]; @@ -344,7 +345,7 @@ function TitanPanelRightClickMenu_PrepareLocationMenu() TitanPanelButton_UpdateButton(TITAN_LOCATION_ID); end info.checked = TitanGetVar(TITAN_LOCATION_ID, "CoordsFormat2"); - DDM:UIDropDownMenu_AddButton(info, _G["L_UIDROPDOWNMENU_MENU_LEVEL"]); + TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); info = {}; info.text = L["TITAN_LOCATION_FORMAT3_LABEL"]; @@ -355,7 +356,7 @@ function TitanPanelRightClickMenu_PrepareLocationMenu() TitanPanelButton_UpdateButton(TITAN_LOCATION_ID); end info.checked = TitanGetVar(TITAN_LOCATION_ID, "CoordsFormat3"); - DDM:UIDropDownMenu_AddButton(info, _G["L_UIDROPDOWNMENU_MENU_LEVEL"]); + TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); end return end @@ -368,19 +369,20 @@ function TitanPanelRightClickMenu_PrepareLocationMenu() info.text = L["TITAN_PANEL_OPTIONS"]; info.value = "Options" info.hasArrow = 1; - DDM:UIDropDownMenu_AddButton(info); + TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); info = {}; info.notCheckable = true info.text = L["TITAN_LOCATION_FORMAT_COORD_LABEL"]; info.value = "CoordFormat" info.hasArrow = 1; - DDM:UIDropDownMenu_AddButton(info); + TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); TitanPanelRightClickMenu_AddSpacer(); TitanPanelRightClickMenu_AddToggleIcon(TITAN_LOCATION_ID); TitanPanelRightClickMenu_AddToggleLabelText(TITAN_LOCATION_ID); TitanPanelRightClickMenu_AddToggleColoredText(TITAN_LOCATION_ID); + TitanPanelRightClickMenu_AddToggleRightSide(TITAN_LOCATION_ID); TitanPanelRightClickMenu_AddSpacer(); TitanPanelRightClickMenu_AddCommand(L["TITAN_PANEL_MENU_HIDE"], TITAN_LOCATION_ID, TITAN_PANEL_MENU_FUNC_HIDE); end diff --git a/TitanLootType/TitanLootType.lua b/TitanLootType/TitanLootType.lua index f9fa423..1ad1fb7 100644 --- a/TitanLootType/TitanLootType.lua +++ b/TitanLootType/TitanLootType.lua @@ -42,12 +42,13 @@ function TitanPanelLootTypeButton_OnLoad(self) ShowLabelText = true, ShowRegularText = false, ShowColoredText = false, - DisplayOnRightSide = false + DisplayOnRightSide = true, }, savedVariables = { ShowIcon = 1, ShowLabelText = 1, RandomRoll = 100, + DisplayOnRightSide = false, ShowDungeonDiff = false, DungeonDiffType = "AUTO", } @@ -236,29 +237,32 @@ function TitanPanelRightClickMenu_PrepareLootTypeMenu() info.value = 100; info.func = TitanPanelLootType_Random100; info.checked = TitanPanelLootType_GetRoll(info.value); - DDM:UIDropDownMenu_AddButton(info,_G["L_UIDROPDOWNMENU_MENU_LEVEL"]); + TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); + info = {}; info.text = "1000"; info.value = 1000; info.func = TitanPanelLootType_Random1000; info.checked = TitanPanelLootType_GetRoll(info.value); - DDM:UIDropDownMenu_AddButton(info,_G["L_UIDROPDOWNMENU_MENU_LEVEL"]); + TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); elseif _G["L_UIDROPDOWNMENU_MENU_LEVEL"] == 2 and _G["L_UIDROPDOWNMENU_MENU_VALUE"] == "ShowDungeonDiffMenu" then info = {}; info.text = _G["LFG_TYPE_DUNGEON"]; info.func = function() TitanSetVar(TITAN_LOOTTYPE_ID, "DungeonDiffType", "DUNGEON"); TitanPanelButton_UpdateButton(TITAN_LOOTTYPE_ID) end info.checked = function() if TitanGetVar(TITAN_LOOTTYPE_ID, "DungeonDiffType") == "DUNGEON" then return true end return false end - DDM:UIDropDownMenu_AddButton(info,_G["L_UIDROPDOWNMENU_MENU_LEVEL"]); + TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); + info = {}; info.text = _G["LFG_TYPE_RAID"]; info.func = function() TitanSetVar(TITAN_LOOTTYPE_ID, "DungeonDiffType", "RAID"); TitanPanelButton_UpdateButton(TITAN_LOOTTYPE_ID) end info.checked = function() if TitanGetVar(TITAN_LOOTTYPE_ID, "DungeonDiffType") == "RAID" then return true end return false end - DDM:UIDropDownMenu_AddButton(info,_G["L_UIDROPDOWNMENU_MENU_LEVEL"]); + TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); + info = {}; info.text = L["TITAN_LOOTTYPE_AUTODIFF_LABEL"]; info.func = function() TitanSetVar(TITAN_LOOTTYPE_ID, "DungeonDiffType", "AUTO"); TitanPanelButton_UpdateButton(TITAN_LOOTTYPE_ID) end info.checked = function() if TitanGetVar(TITAN_LOOTTYPE_ID, "DungeonDiffType") == "AUTO" then return true end return false end - DDM:UIDropDownMenu_AddButton(info,_G["L_UIDROPDOWNMENU_MENU_LEVEL"]); + TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); elseif _G["L_UIDROPDOWNMENU_MENU_LEVEL"] == 2 and _G["L_UIDROPDOWNMENU_MENU_VALUE"] == "SetDungeonDiff" then info = {}; info.text = _G["GREEN_FONT_COLOR_CODE"].._G["PLAYER_DIFFICULTY1"].."|r"; @@ -279,7 +283,7 @@ function TitanPanelRightClickMenu_PrepareLootTypeMenu() else info.disabled = false end - DDM:UIDropDownMenu_AddButton(info,_G["L_UIDROPDOWNMENU_MENU_LEVEL"]); + TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); info = {} info.text = _G["ORANGE_FONT_COLOR_CODE"].._G["PLAYER_DIFFICULTY2"].."|r"; @@ -300,7 +304,7 @@ function TitanPanelRightClickMenu_PrepareLootTypeMenu() else info.disabled = false end - DDM:UIDropDownMenu_AddButton(info,_G["L_UIDROPDOWNMENU_MENU_LEVEL"]); + TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); info = {} info.text = _G["RED_FONT_COLOR_CODE"].._G["PLAYER_DIFFICULTY6"].."|r"; @@ -321,7 +325,7 @@ function TitanPanelRightClickMenu_PrepareLootTypeMenu() else info.disabled = false end - DDM:UIDropDownMenu_AddButton(info,_G["L_UIDROPDOWNMENU_MENU_LEVEL"]); + TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); info = {} info.text = _G["RED_FONT_COLOR_CODE"].._G["PLAYER_DIFFICULTY5"].."|r"; @@ -342,7 +346,7 @@ function TitanPanelRightClickMenu_PrepareLootTypeMenu() else info.disabled = false end - DDM:UIDropDownMenu_AddButton(info,_G["L_UIDROPDOWNMENU_MENU_LEVEL"]); + TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); elseif _G["L_UIDROPDOWNMENU_MENU_LEVEL"] == 2 and _G["L_UIDROPDOWNMENU_MENU_VALUE"] == "SetRaidDiff" then @@ -365,7 +369,7 @@ function TitanPanelRightClickMenu_PrepareLootTypeMenu() else info.disabled = false end - DDM:UIDropDownMenu_AddButton(info,_G["L_UIDROPDOWNMENU_MENU_LEVEL"]); + TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); info = {}; info.text = _G["ORANGE_FONT_COLOR_CODE"].._G["PLAYER_DIFFICULTY2"].."|r"; @@ -386,7 +390,7 @@ function TitanPanelRightClickMenu_PrepareLootTypeMenu() else info.disabled = false end - DDM:UIDropDownMenu_AddButton(info,_G["L_UIDROPDOWNMENU_MENU_LEVEL"]); + TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); info = {}; info.text = _G["RED_FONT_COLOR_CODE"].._G["PLAYER_DIFFICULTY6"].."|r"; @@ -407,29 +411,8 @@ function TitanPanelRightClickMenu_PrepareLootTypeMenu() else info.disabled = false end - DDM:UIDropDownMenu_AddButton(info,_G["L_UIDROPDOWNMENU_MENU_LEVEL"]); + TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); ---[[ info = {}; - info.text = _G["RED_FONT_COLOR_CODE"].._G["RAID_DIFFICULTY4"].."|r"; - info.func = function() SetRaidDifficultyID(4) end - info.checked = function() if GetRaidDifficultyID() == 4 then return true end return false end - local inParty = 0; - if (UnitExists("party1") or GetNumGroupMembers() > 0) then - inParty = 1; - end - local isLeader = 0; - if (UnitIsGroupLeader("player")) then - isLeader = 1; - end - local inInstance = IsInInstance() - local playerlevel = UnitLevel("player") - if inInstance or (inParty == 1 and isLeader == 0) or (playerlevel < 65 and GetRaidDifficultyID() == 1) then - info.disabled = 1 - else - info.disabled = false - end - DDM:UIDropDownMenu_AddButton(info,_G["L_UIDROPDOWNMENU_MENU_LEVEL"]); ---]] else TitanPanelRightClickMenu_AddTitle(TitanPlugins[TITAN_LOOTTYPE_ID].menuText); @@ -441,29 +424,32 @@ function TitanPanelRightClickMenu_PrepareLootTypeMenu() info.checked = TitanGetVar(TITAN_LOOTTYPE_ID, "ShowDungeonDiff"); info.keepShownOnClick = 1; info.hasArrow = 1; - DDM:UIDropDownMenu_AddButton(info); + TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); + info = {} info.notCheckable = true info.text = L["TITAN_LOOTTYPE_SETDUNGEONDIFF_LABEL"]; info.value = "SetDungeonDiff"; info.hasArrow = 1; - DDM:UIDropDownMenu_AddButton(info); + TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); + info = {} info.notCheckable = true info.text = L["TITAN_LOOTTYPE_SETRAIDDIFF_LABEL"]; info.value = "SetRaidDiff"; info.hasArrow = 1; - DDM:UIDropDownMenu_AddButton(info); + TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); + info = {}; info.notCheckable = true info.text = L["TITAN_LOOTTYPE_RANDOM_ROLL_LABEL"]; info.value = "RandomRoll"; info.hasArrow = 1; - DDM:UIDropDownMenu_AddButton(info); + TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); TitanPanelRightClickMenu_AddSpacer(); TitanPanelRightClickMenu_AddToggleIcon(TITAN_LOOTTYPE_ID); TitanPanelRightClickMenu_AddToggleLabelText(TITAN_LOOTTYPE_ID); - + TitanPanelRightClickMenu_AddToggleRightSide(TITAN_LOOTTYPE_ID); TitanPanelRightClickMenu_AddSpacer(); TitanPanelRightClickMenu_AddCommand(L["TITAN_PANEL_MENU_HIDE"], TITAN_LOOTTYPE_ID, TITAN_PANEL_MENU_FUNC_HIDE); end diff --git a/TitanPerformance/TitanPerformance.lua b/TitanPerformance/TitanPerformance.lua index d90fa44..832b651 100644 --- a/TitanPerformance/TitanPerformance.lua +++ b/TitanPerformance/TitanPerformance.lua @@ -35,7 +35,7 @@ local topAddOns; local memUsageSinceGC = {}; local counter = 1; --counter for active addons local L = LibStub("AceLocale-3.0"):GetLocale("Titan", true) -local DDM = LibStub:GetLibrary("LibUIDropDownMenu-4.0") +--local DDM = LibStub:GetLibrary("LibUIDropDownMenu-4.0") local AceTimer = LibStub("AceTimer-3.0") local PerfTimer = nil; -- ******************************** Functions ******************************* @@ -69,7 +69,7 @@ function TitanPanelPerformanceButton_OnLoad(self) ShowLabelText = true, ShowRegularText = false, ShowColoredText = true, - DisplayOnRightSide = false, + DisplayOnRightSide = true, }, savedVariables = { ShowFPS = 1, @@ -83,6 +83,7 @@ function TitanPanelPerformanceButton_OnLoad(self) ShowIcon = 1, ShowLabelText = false, ShowColoredText = 1, + DisplayOnRightSide = false, } }; @@ -372,8 +373,9 @@ function TitanPanelPerformanceButton_SetTooltip() -- Tooltip title GameTooltip:SetText(L["TITAN_PERFORMANCE_TOOLTIP"], HIGHLIGHT_FONT_COLOR.r, HIGHLIGHT_FONT_COLOR.g, HIGHLIGHT_FONT_COLOR.b); +-- Ticket 48 : Request to always show info in the tooltip. Does NOT include addon info as that is tooltip only -- FPS tooltip - if ( showFPS ) then +-- if ( showFPS ) then local fpsText = format(L["TITAN_FPS_FORMAT"], button.fps); local avgFPSText = format(L["TITAN_FPS_FORMAT"], button.avgFPS); local minFPSText = format(L["TITAN_FPS_FORMAT"], button.minFPS); @@ -385,10 +387,10 @@ function TitanPanelPerformanceButton_SetTooltip() GameTooltip:AddDoubleLine(L["TITAN_FPS_TOOLTIP_AVG_FPS"], TitanUtils_GetHighlightText(avgFPSText)); GameTooltip:AddDoubleLine(L["TITAN_FPS_TOOLTIP_MIN_FPS"], TitanUtils_GetHighlightText(minFPSText)); GameTooltip:AddDoubleLine(L["TITAN_FPS_TOOLTIP_MAX_FPS"], TitanUtils_GetHighlightText(maxFPSText)); - end +-- end -- Latency tooltip - if ( showLatency or showWorldLatency ) then +-- if ( showLatency or showWorldLatency ) then local latencyText = format(L["TITAN_LATENCY_FORMAT"], button.latencyHome); local latencyWorldText = format(L["TITAN_LATENCY_FORMAT"], button.latencyWorld); local bandwidthInText = format(L["TITAN_LATENCY_BANDWIDTH_FORMAT"], button.bandwidthIn); @@ -400,10 +402,10 @@ function TitanPanelPerformanceButton_SetTooltip() if showWorldLatency then GameTooltip:AddDoubleLine(L["TITAN_LATENCY_TOOLTIP_LATENCY_WORLD"], TitanUtils_GetHighlightText(latencyWorldText)); end GameTooltip:AddDoubleLine(L["TITAN_LATENCY_TOOLTIP_BANDWIDTH_IN"], TitanUtils_GetHighlightText(bandwidthInText)); GameTooltip:AddDoubleLine(L["TITAN_LATENCY_TOOLTIP_BANDWIDTH_OUT"], TitanUtils_GetHighlightText(bandwidthOutText)); - end +-- end -- Memory tooltip - if ( showMemory ) then +-- if ( showMemory ) then local memoryText = format(L["TITAN_MEMORY_FORMAT"], button.memory/1024); local initialMemoryText = format(L["TITAN_MEMORY_FORMAT"], button.initialMemory/1024); local sessionTime = time() - button.startSessionTime; @@ -424,7 +426,7 @@ function TitanPanelPerformanceButton_SetTooltip() GameTooltip:AddDoubleLine(L["TITAN_MEMORY_TOOLTIP_CURRENT_MEMORY"], TitanUtils_GetHighlightText(memoryText)); GameTooltip:AddDoubleLine(L["TITAN_MEMORY_TOOLTIP_INITIAL_MEMORY"], TitanUtils_GetHighlightText(initialMemoryText)); GameTooltip:AddDoubleLine(L["TITAN_MEMORY_TOOLTIP_INCREASING_RATE"], rateRichText); - end +-- end if ( showAddonMemory == 1 ) then for _,i in pairs(topAddOns) do @@ -464,7 +466,7 @@ function TitanPanelRightClickMenu_PreparePerformanceMenu() end info.checked = TitanGetVar(TITAN_PERFORMANCE_ID, "ShowFPS"); info.keepShownOnClick = 1; - DDM:UIDropDownMenu_AddButton(info, _G["L_UIDROPDOWNMENU_MENU_LEVEL"]); + TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); local temptable = {TITAN_PERFORMANCE_ID, "ShowLatency"}; info = {}; @@ -475,7 +477,7 @@ function TitanPanelRightClickMenu_PreparePerformanceMenu() end info.checked = TitanGetVar(TITAN_PERFORMANCE_ID, "ShowLatency"); info.keepShownOnClick = 1; - DDM:UIDropDownMenu_AddButton(info, _G["L_UIDROPDOWNMENU_MENU_LEVEL"]); + TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); local temptable = {TITAN_PERFORMANCE_ID, "ShowWorldLatency"}; info = {}; @@ -486,7 +488,7 @@ function TitanPanelRightClickMenu_PreparePerformanceMenu() end info.checked = TitanGetVar(TITAN_PERFORMANCE_ID, "ShowWorldLatency"); info.keepShownOnClick = 1; - DDM:UIDropDownMenu_AddButton(info, _G["L_UIDROPDOWNMENU_MENU_LEVEL"]); + TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); local temptable = {TITAN_PERFORMANCE_ID, "ShowMemory"}; info = {}; @@ -497,7 +499,7 @@ function TitanPanelRightClickMenu_PreparePerformanceMenu() end info.checked = TitanGetVar(TITAN_PERFORMANCE_ID, "ShowMemory"); info.keepShownOnClick = 1; - DDM:UIDropDownMenu_AddButton(info, _G["L_UIDROPDOWNMENU_MENU_LEVEL"]); + TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); end if _G["L_UIDROPDOWNMENU_MENU_VALUE"] == "AddonUsage" then @@ -512,7 +514,7 @@ function TitanPanelRightClickMenu_PreparePerformanceMenu() end info.checked = TitanGetVar(TITAN_PERFORMANCE_ID, "ShowAddonMemory"); info.keepShownOnClick = 1; - DDM:UIDropDownMenu_AddButton(info, _G["L_UIDROPDOWNMENU_MENU_LEVEL"]); + TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); local temptable = {TITAN_PERFORMANCE_ID, "ShowAddonIncRate"}; info = {}; @@ -523,14 +525,14 @@ function TitanPanelRightClickMenu_PreparePerformanceMenu() end info.checked = TitanGetVar(TITAN_PERFORMANCE_ID, "ShowAddonIncRate"); info.keepShownOnClick = 1; - DDM:UIDropDownMenu_AddButton(info, _G["L_UIDROPDOWNMENU_MENU_LEVEL"]); + TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); info = {}; info.notCheckable = true info.text = L["TITAN_PERFORMANCE_CONTROL_TOOLTIP"]..LIGHTYELLOW_FONT_COLOR_CODE..tostring(TitanGetVar(TITAN_PERFORMANCE_ID, "NumOfAddons")); info.value = "AddonControlFrame" info.hasArrow = 1; - DDM:UIDropDownMenu_AddButton(info, _G["L_UIDROPDOWNMENU_MENU_LEVEL"]); + TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); end if _G["L_UIDROPDOWNMENU_MENU_VALUE"] == "AddonMemoryFormat" then @@ -540,13 +542,13 @@ function TitanPanelRightClickMenu_PreparePerformanceMenu() info.checked = function() if TitanGetVar(TITAN_PERFORMANCE_ID, "AddonMemoryType") == 1 then return true else return nil end end info.func = function() TitanSetVar(TITAN_PERFORMANCE_ID, "AddonMemoryType", 1) end - DDM:UIDropDownMenu_AddButton(info, _G["L_UIDROPDOWNMENU_MENU_LEVEL"]); + TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); info = {}; info.text = L["TITAN_MEMORY_KBMB_LABEL"]; info.checked = function() if TitanGetVar(TITAN_PERFORMANCE_ID, "AddonMemoryType") == 2 then return true else return nil end end info.func = function() TitanSetVar(TITAN_PERFORMANCE_ID, "AddonMemoryType", 2) end - DDM:UIDropDownMenu_AddButton(info, _G["L_UIDROPDOWNMENU_MENU_LEVEL"]); + TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); end if _G["L_UIDROPDOWNMENU_MENU_VALUE"] == "CPUProfiling" then @@ -555,13 +557,13 @@ function TitanPanelRightClickMenu_PreparePerformanceMenu() info = {}; info.text = L["TITAN_PERFORMANCE_MENU_CPUPROF_LABEL_OFF"]..GREEN_FONT_COLOR_CODE..L["TITAN_PANEL_MENU_RELOADUI"]; info.func = function() SetCVar("scriptProfile", "0", 1) ReloadUI() end - DDM:UIDropDownMenu_AddButton(info, _G["L_UIDROPDOWNMENU_MENU_LEVEL"]); + TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); else TitanPanelRightClickMenu_AddTitle(L["TITAN_PERFORMANCE_MENU_CPUPROF_LABEL"]..": "..RED_FONT_COLOR_CODE..L["TITAN_PANEL_MENU_DISABLED"], _G["L_UIDROPDOWNMENU_MENU_LEVEL"]); info = {}; info.text = L["TITAN_PERFORMANCE_MENU_CPUPROF_LABEL_ON"]..GREEN_FONT_COLOR_CODE..L["TITAN_PANEL_MENU_RELOADUI"]; info.func = function() SetCVar("scriptProfile", "1", 1) ReloadUI() end - DDM:UIDropDownMenu_AddButton(info, _G["L_UIDROPDOWNMENU_MENU_LEVEL"]); + TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); end end return @@ -575,33 +577,34 @@ function TitanPanelRightClickMenu_PreparePerformanceMenu() info.text = L["TITAN_PANEL_OPTIONS"]; info.value = "Options" info.hasArrow = 1; - DDM:UIDropDownMenu_AddButton(info); + TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); info = {}; info.notCheckable = true info.text = L["TITAN_PERFORMANCE_ADDONS"]; info.value = "AddonUsage" info.hasArrow = 1; - DDM:UIDropDownMenu_AddButton(info); + TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); info = {}; info.notCheckable = true info.text = L["TITAN_PERFORMANCE_ADDON_MEM_FORMAT_LABEL"]; info.value = "AddonMemoryFormat" info.hasArrow = 1; - DDM:UIDropDownMenu_AddButton(info); + TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); info = {}; info.notCheckable = true info.text = L["TITAN_PERFORMANCE_MENU_CPUPROF_LABEL"]; info.value = "CPUProfiling" info.hasArrow = 1; - DDM:UIDropDownMenu_AddButton(info); + TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); TitanPanelRightClickMenu_AddSpacer(); TitanPanelRightClickMenu_AddToggleIcon(TITAN_PERFORMANCE_ID); TitanPanelRightClickMenu_AddToggleLabelText(TITAN_PERFORMANCE_ID); TitanPanelRightClickMenu_AddToggleColoredText(TITAN_PERFORMANCE_ID); + TitanPanelRightClickMenu_AddToggleRightSide(TITAN_PERFORMANCE_ID); TitanPanelRightClickMenu_AddSpacer(); TitanPanelRightClickMenu_AddCommand(L["TITAN_PANEL_MENU_HIDE"], TITAN_PERFORMANCE_ID, TITAN_PANEL_MENU_FUNC_HIDE); end @@ -619,7 +622,7 @@ function TitanPanelPerformanceButton_UpdateData() local showAddonMemory = TitanGetVar(TITAN_PERFORMANCE_ID, "ShowAddonMemory"); -- FPS Data - if ( showFPS ) then +-- if ( showFPS ) then button.fps = GetFramerate(); button.fpsSampleCount = button.fpsSampleCount + 1; if (button.fpsSampleCount == 1) then @@ -634,13 +637,13 @@ function TitanPanelPerformanceButton_UpdateData() end button.avgFPS = (button.avgFPS * (button.fpsSampleCount - 1) + button.fps) / button.fpsSampleCount; end - end +-- end -- Latency Data - if ( showLatency or showWorldLatency ) then +-- if ( showLatency or showWorldLatency ) then -- bandwidthIn, bandwidthOut, latencyHome, latencyWorld = GetNetStats(); button.bandwidthIn, button.bandwidthOut, button.latencyHome, button.latencyWorld = GetNetStats(); - end +-- end -- Memory data if ( showMemory ) or (showAddonMemory == 1) then @@ -694,6 +697,21 @@ function TitanPanelPerformanceButton_OnClick(self, button) end end +local back_drop_info = + { + bgFile="Interface\\Tooltips\\UI-Tooltip-Background", + edgeFile="Interface\\Tooltips\\UI-Tooltip-Border", + tile = true, + insets = { + left = 0, + right = 0, + top = 0, + bottom = 0, + }, + tileSize = 8, + edgeSize = 8, + } + -- ************************************************************************** -- NAME : TitanPanelPerfControlSlider_OnEnter() -- DESC : Display tooltip on entering slider @@ -726,7 +744,12 @@ function TitanPanelPerfControlSlider_OnShow(self) self:SetObeyStepOnDrag(true) -- since 5.4.2 (Mists of Pandaria) self:SetValue(CalcAppNum(TitanGetVar(TITAN_PERFORMANCE_ID, "NumOfAddons"))); -- self:SetValue((TitanGetVar(TITAN_PERFORMANCE_ID, "NumOfAddons"))); - TitanPanelPerfControlFrame:SetBackdropColor(0, 0, 0, 1) + TitanPanelPerfControlFrame:SetBackdropBorderColor(TOOLTIP_DEFAULT_COLOR.r, TOOLTIP_DEFAULT_COLOR.g, TOOLTIP_DEFAULT_COLOR.b, 1); + TitanPanelPerfControlFrame:SetBackdropColor( + TOOLTIP_DEFAULT_BACKGROUND_COLOR.r, + TOOLTIP_DEFAULT_BACKGROUND_COLOR.g, + TOOLTIP_DEFAULT_BACKGROUND_COLOR.b, + 1); --[[ TitanDebug("Slider_OnShow:" .." : "..(self:GetValue() or "?") @@ -812,11 +835,20 @@ function TitanPanelPerfControlFrame_OnLoad(self) Blizzard decided to remove direct Backdrop API in 9.0 (Shadowlands) so inherit the template (XML) and set the values in the code (Lua) ---]] - self:SetBackdrop(BACKDROP_TOOLTIP_16_16_5555) -- use a pre-set from Backdrop.lua - self:SetBackdropBorderColor(1, 1, 1); - self:SetBackdropColor(0, 0, 0, 1); +9.5.1 Blizzard decided to remove the backdrop constant we were using... + +Use the Blizzard color defaults. +Leave the background opaque because it is an option not a tooltip. +--]] + self:SetBackdrop(back_drop_info) + + self:SetBackdropBorderColor(TOOLTIP_DEFAULT_COLOR.r, TOOLTIP_DEFAULT_COLOR.g, TOOLTIP_DEFAULT_COLOR.b, 1); + self:SetBackdropColor( + TOOLTIP_DEFAULT_BACKGROUND_COLOR.r, + TOOLTIP_DEFAULT_BACKGROUND_COLOR.g, + TOOLTIP_DEFAULT_BACKGROUND_COLOR.b, + 1); end -- ************************************************************************** diff --git a/TitanRepair/TitanRepair.lua b/TitanRepair/TitanRepair.lua index 9e01bb5..4557e11 100644 --- a/TitanRepair/TitanRepair.lua +++ b/TitanRepair/TitanRepair.lua @@ -7,7 +7,7 @@ -- ******************************** Constants ******************************* local TITAN_REPAIR_ID = "Repair"; local L = LibStub("AceLocale-3.0"):GetLocale("Titan", true) -local DDM = LibStub:GetLibrary("LibUIDropDownMenu-4.0") +--local DDM = LibStub:GetLibrary("LibUIDropDownMenu-4.0") local TitanRepairModule = LibStub("AceAddon-3.0"):NewAddon("TitanRepair", "AceHook-3.0", "AceTimer-3.0") local _G = getfenv(0); local TPR = TitanRepairModule @@ -94,7 +94,7 @@ function TitanPanelRepairButton_OnLoad(self) ShowLabelText = true, ShowRegularText = false, ShowColoredText = true, - DisplayOnRightSide = false + DisplayOnRightSide = true, }, savedVariables = { ShowIcon = 1, @@ -119,6 +119,7 @@ function TitanPanelRepairButton_OnLoad(self) ShowItems = true, ShowDiscounts = true, ShowCosts = true, + DisplayOnRightSide = false, } }; @@ -1131,7 +1132,7 @@ local info; TitanSetVar(TITAN_REPAIR_ID,"DiscountExalted", nil) TitanPanelButton_UpdateButton(TITAN_REPAIR_ID) end - DDM:UIDropDownMenu_AddButton(info, _G["L_UIDROPDOWNMENU_MENU_LEVEL"]); + TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); info = {}; info.text = L["REPAIR_LOCALE"]["buttonFriendly"]; @@ -1144,7 +1145,7 @@ local info; TitanSetVar(TITAN_REPAIR_ID,"DiscountExalted", nil) TitanPanelButton_UpdateButton(TITAN_REPAIR_ID) end - DDM:UIDropDownMenu_AddButton(info, _G["L_UIDROPDOWNMENU_MENU_LEVEL"]); + TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); info = {}; info.text = L["REPAIR_LOCALE"]["buttonHonored"]; @@ -1157,7 +1158,7 @@ local info; TitanSetVar(TITAN_REPAIR_ID,"DiscountExalted", nil) TitanPanelButton_UpdateButton(TITAN_REPAIR_ID) end - DDM:UIDropDownMenu_AddButton(info, _G["L_UIDROPDOWNMENU_MENU_LEVEL"]); + TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); info = {}; info.text = L["REPAIR_LOCALE"]["buttonRevered"]; @@ -1170,7 +1171,7 @@ local info; TitanSetVar(TITAN_REPAIR_ID,"DiscountExalted", nil) TitanPanelButton_UpdateButton(TITAN_REPAIR_ID) end - DDM:UIDropDownMenu_AddButton(info, _G["L_UIDROPDOWNMENU_MENU_LEVEL"]); + TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); info = {}; info.text = L["REPAIR_LOCALE"]["buttonExalted"]; @@ -1183,7 +1184,7 @@ local info; TitanSetVar(TITAN_REPAIR_ID,"DiscountExalted", 1) TitanPanelButton_UpdateButton(TITAN_REPAIR_ID) end - DDM:UIDropDownMenu_AddButton(info, _G["L_UIDROPDOWNMENU_MENU_LEVEL"]); + TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); end if _G["L_UIDROPDOWNMENU_MENU_VALUE"] == "Options" then @@ -1197,31 +1198,31 @@ local info; TitanPanelButton_UpdateButton(TITAN_REPAIR_ID); end info.checked = TitanGetVar(TITAN_REPAIR_ID,"ShowPercentage"); - DDM:UIDropDownMenu_AddButton(info, _G["L_UIDROPDOWNMENU_MENU_LEVEL"]); + TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); info = {}; info.text = L["REPAIR_LOCALE"]["mostdamaged"]; info.func = TitanRepair_ShowMostDamaged; info.checked = TitanGetVar(TITAN_REPAIR_ID,"ShowMostDamaged"); - DDM:UIDropDownMenu_AddButton(info, _G["L_UIDROPDOWNMENU_MENU_LEVEL"]); + TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); info = {}; info.text = L["REPAIR_LOCALE"]["undamaged"]; info.func = TitanRepair_ShowUndamaged; info.checked = TitanGetVar(TITAN_REPAIR_ID,"ShowUndamaged"); - DDM:UIDropDownMenu_AddButton(info, _G["L_UIDROPDOWNMENU_MENU_LEVEL"]); + TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); info = {}; info.text = L["REPAIR_LOCALE"]["showinventory"]; info.func = TitanRepair_ShowInventory; info.checked = TitanGetVar(TITAN_REPAIR_ID,"ShowInventory"); - DDM:UIDropDownMenu_AddButton(info, _G["L_UIDROPDOWNMENU_MENU_LEVEL"]); + TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); info = {}; info.text = L["REPAIR_LOCALE"]["ShowRepairCost"]; --"Show Repair Cost" info.func = TitanRepair_ShowRepairCost; info.checked = TitanGetVar(TITAN_REPAIR_ID,"ShowRepairCost"); - DDM:UIDropDownMenu_AddButton(info, _G["L_UIDROPDOWNMENU_MENU_LEVEL"]); + TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); info = {}; info.text = L["REPAIR_LOCALE"]["showdurabilityframe"]; @@ -1230,13 +1231,13 @@ local info; TitanRepair_DurabilityFrame(); end info.checked = TitanGetVar(TITAN_REPAIR_ID,"ShowDurabilityFrame"); - DDM:UIDropDownMenu_AddButton(info, _G["L_UIDROPDOWNMENU_MENU_LEVEL"]); + TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); info = {}; info.text = L["REPAIR_LOCALE"]["ignoreThrown"]; info.func = TitanRepair_IgnoreThrown; info.checked = TitanGetVar(TITAN_REPAIR_ID,"IgnoreThrown"); - DDM:UIDropDownMenu_AddButton(info, _G["L_UIDROPDOWNMENU_MENU_LEVEL"]); + TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); end if _G["L_UIDROPDOWNMENU_MENU_VALUE"] == "AutoRepair" then @@ -1246,19 +1247,19 @@ local info; info.text = L["REPAIR_LOCALE"]["popup"]; info.func = TitanRepair_ShowPop; info.checked = TitanGetVar(TITAN_REPAIR_ID,"ShowPopup"); - DDM:UIDropDownMenu_AddButton(info, _G["L_UIDROPDOWNMENU_MENU_LEVEL"]); + TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); info = {}; info.text = L["REPAIR_LOCALE"]["AutoRepitemlabel"]; info.func = TitanRepair_AutoRep; info.checked = TitanGetVar(TITAN_REPAIR_ID,"AutoRepair"); - DDM:UIDropDownMenu_AddButton(info, _G["L_UIDROPDOWNMENU_MENU_LEVEL"]); + TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); info = {}; info.text = L["TITAN_REPAIR_REPORT_COST_MENU"] info.func = function() TitanToggleVar(TITAN_REPAIR_ID, "AutoRepairReport"); end info.checked = TitanGetVar(TITAN_REPAIR_ID,"AutoRepairReport"); - DDM:UIDropDownMenu_AddButton(info, _G["L_UIDROPDOWNMENU_MENU_LEVEL"]); + TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); end if _G["L_UIDROPDOWNMENU_MENU_VALUE"] == "GuildBank" then @@ -1277,7 +1278,7 @@ local info; info.text = L["TITAN_REPAIR_GBANK_USEFUNDS"] info.func = function() TitanToggleVar(TITAN_REPAIR_ID, "UseGuildBank"); end info.checked = TitanGetVar(TITAN_REPAIR_ID,"UseGuildBank"); - DDM:UIDropDownMenu_AddButton(info, _G["L_UIDROPDOWNMENU_MENU_LEVEL"]); + TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); end if _G["L_UIDROPDOWNMENU_MENU_VALUE"] == "TooltipOptions" then @@ -1288,21 +1289,21 @@ local info; info.func = function() TitanToggleVar(TITAN_REPAIR_ID, "ShowItems"); end info.checked = TitanGetVar(TITAN_REPAIR_ID,"ShowItems"); info.keepShownOnClick = 1 - DDM:UIDropDownMenu_AddButton(info, _G["L_UIDROPDOWNMENU_MENU_LEVEL"]); + TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); info = {}; info.text = L["REPAIR_LOCALE"]["ShowDiscounts"]; info.func = function() TitanToggleVar(TITAN_REPAIR_ID, "ShowDiscounts"); end info.checked = TitanGetVar(TITAN_REPAIR_ID,"ShowDiscounts"); info.keepShownOnClick = 1 - DDM:UIDropDownMenu_AddButton(info, _G["L_UIDROPDOWNMENU_MENU_LEVEL"]); + TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); info = {}; info.text = L["REPAIR_LOCALE"]["ShowCosts"]; info.func = function() TitanToggleVar(TITAN_REPAIR_ID, "ShowCosts"); end info.checked = TitanGetVar(TITAN_REPAIR_ID,"ShowCosts"); info.keepShownOnClick = 1 - DDM:UIDropDownMenu_AddButton(info, _G["L_UIDROPDOWNMENU_MENU_LEVEL"]); + TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); end return @@ -1316,14 +1317,14 @@ local info; info.text = L["TITAN_PANEL_OPTIONS"]; info.value = "Options" info.hasArrow = 1; - DDM:UIDropDownMenu_AddButton(info); + TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); info = {}; info.notCheckable = true info.text = L["REPAIR_LOCALE"]["AutoReplabel"]; info.value = "AutoRepair" info.hasArrow = 1; - DDM:UIDropDownMenu_AddButton(info); + TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); local guildName, _, _ = GetGuildInfo("player") info = {}; @@ -1335,26 +1336,27 @@ local info; else info.disabled = true end - DDM:UIDropDownMenu_AddButton(info); + TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); info = {}; info.notCheckable = true info.text = L["REPAIR_LOCALE"]["discount"]; info.value = "Discount" info.hasArrow = 1; - DDM:UIDropDownMenu_AddButton(info); + TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); info = {}; info.notCheckable = true info.text = L["REPAIR_LOCALE"]["TooltipOptions"]; info.value = "TooltipOptions" info.hasArrow = 1; - DDM:UIDropDownMenu_AddButton(info); + TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); TitanPanelRightClickMenu_AddSpacer(); TitanPanelRightClickMenu_AddToggleIcon(TITAN_REPAIR_ID); TitanPanelRightClickMenu_AddToggleLabelText(TITAN_REPAIR_ID); TitanPanelRightClickMenu_AddToggleColoredText(TITAN_REPAIR_ID); + TitanPanelRightClickMenu_AddToggleRightSide(TITAN_REPAIR_ID); TitanPanelRightClickMenu_AddSpacer(); TitanPanelRightClickMenu_AddCommand(L["TITAN_PANEL_MENU_HIDE"], TITAN_REPAIR_ID, TITAN_PANEL_MENU_FUNC_HIDE); end diff --git a/TitanVolume/TitanVolume.lua b/TitanVolume/TitanVolume.lua index c3d57fe..6b9ea54 100644 --- a/TitanVolume/TitanVolume.lua +++ b/TitanVolume/TitanVolume.lua @@ -9,7 +9,22 @@ local TITAN_VOLUME_FRAME_SHOW_TIME = 0.5; local TITAN_VOLUME_ARTWORK_PATH = "Interface\\AddOns\\TitanVolume\\Artwork\\"; local _G = getfenv(0); local L = LibStub("AceLocale-3.0"):GetLocale("Titan", true) -local DDM = LibStub:GetLibrary("LibUIDropDownMenu-4.0") +--local DDM = LibStub:GetLibrary("LibUIDropDownMenu-4.0") + +local back_drop_info = + { + bgFile="Interface\\Tooltips\\UI-Tooltip-Background", + edgeFile="Interface\\Tooltips\\UI-Tooltip-Border", + tile = true, + insets = { + left = 0, + right = 0, + top = 0, + bottom = 0, + }, + tileSize = 8, + edgeSize = 8, + } function TitanPanelVolumeButton_OnLoad(self) self.registry = { @@ -62,8 +77,8 @@ function TitanPanelVolumeButton_OnEnter() TitanPanelMusicVolumeControlSlider:SetValue(1 - GetCVar("Sound_MusicVolume")); -- TitanPanelMicrophoneVolumeControlSlider:SetValue(1 - GetCVar("OutboundChatVolume")); -- TitanPanelSpeakerVolumeControlSlider:SetValue(1 - GetCVar("InboundChatVolume")); - TitanPanelVolume_SetVolumeIcon(); -end + TitanPanelVolume_SetVolumeIcon(); + end -- 'Master' function TitanPanelMasterVolumeControlSlider_OnEnter(self) @@ -369,11 +384,20 @@ function TitanPanelVolumeControlFrame_OnLoad(self) Blizzard decided to remove direct Backdrop API in 9.0 (Shadowlands) so inherit the template (XML) and set the values in the code (Lua) + +9.5.1 Blizzard decided to remove the backdrop constant we were using... + +Use the Blizzard color defaults. +Leave the background opaque because it is an option not a tooltip. --]] - self:SetBackdrop(BACKDROP_TOOLTIP_16_16_5555) -- use a pre-set from Backdrop.lua + self:SetBackdrop(back_drop_info) - self:SetBackdropBorderColor(1, 1, 1); - self:SetBackdropColor(0, 0, 0, 1); + self:SetBackdropBorderColor(TOOLTIP_DEFAULT_COLOR.r, TOOLTIP_DEFAULT_COLOR.g, TOOLTIP_DEFAULT_COLOR.b, 1); + self:SetBackdropColor( + TOOLTIP_DEFAULT_BACKGROUND_COLOR.r, + TOOLTIP_DEFAULT_BACKGROUND_COLOR.g, + TOOLTIP_DEFAULT_BACKGROUND_COLOR.b, + 1); end function TitanPanelVolumeControlFrame_OnUpdate(self, elapsed) @@ -423,7 +447,7 @@ function TitanPanelRightClickMenu_PrepareVolumeMenu() info.func = function() ShowUIPanel(VideoOptionsFrame); end - DDM:UIDropDownMenu_AddButton(info); + TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); info.text = L["TITAN_VOLUME_MENU_OVERRIDE_BLIZZ_SETTINGS"]; info.notCheckable = false @@ -431,7 +455,7 @@ function TitanPanelRightClickMenu_PrepareVolumeMenu() TitanToggleVar(TITAN_VOLUME_ID, "OverrideBlizzSettings"); end info.checked = TitanGetVar(TITAN_VOLUME_ID, "OverrideBlizzSettings"); - DDM:UIDropDownMenu_AddButton(info); + TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); TitanPanelRightClickMenu_AddSpacer(); TitanPanelRightClickMenu_AddCommand(L["TITAN_PANEL_MENU_HIDE"], TITAN_VOLUME_ID, TITAN_PANEL_MENU_FUNC_HIDE); diff --git a/TitanXP/TitanXP.lua b/TitanXP/TitanXP.lua index 31f1805..5e64232 100644 --- a/TitanXP/TitanXP.lua +++ b/TitanXP/TitanXP.lua @@ -14,7 +14,7 @@ local TitanPanelXPButton_ButtonAdded = nil; local found = nil; local lastMobXP, lastXP, XPGain = 0, 0, 0 local L = LibStub("AceLocale-3.0"):GetLocale("Titan", true) -local DDM = LibStub:GetLibrary("LibUIDropDownMenu-4.0") +--local DDM = LibStub:GetLibrary("LibUIDropDownMenu-4.0") -- ******************************** Functions ******************************* --[[ @@ -53,7 +53,7 @@ function TitanPanelXPButton_OnLoad(self) ShowLabelText = true, ShowRegularText = false, ShowColoredText = false, - DisplayOnRightSide = false + DisplayOnRightSide = true }, savedVariables = { DisplayType = "ShowXPPerHourSession", @@ -65,6 +65,7 @@ function TitanPanelXPButton_OnLoad(self) ShowSimpleNumOfGains = false, UseSeperatorComma = true, UseSeperatorPeriod = false, + DisplayOnRightSide = false, } }; @@ -349,81 +350,81 @@ function TitanPanelRightClickMenu_PrepareXPMenu() info.func = function() TitanPanelRightClickMenu_ToggleVar({TITAN_XP_ID, "ShowSimpleRested"}) end info.checked = TitanUtils_Ternary(TitanGetVar(TITAN_XP_ID, "ShowSimpleRested"), 1, nil); info.keepShownOnClick = 1; - DDM:UIDropDownMenu_AddButton(info, 2); + TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); info = {}; info.text = L["TITAN_XP_MENU_SIMPLE_BUTTON_TOLEVELUP"]; info.func = function() TitanPanelRightClickMenu_ToggleVar({TITAN_XP_ID, "ShowSimpleToLevel"}) end info.checked = TitanUtils_Ternary(TitanGetVar(TITAN_XP_ID, "ShowSimpleToLevel"), 1, nil); info.keepShownOnClick = 1; - DDM:UIDropDownMenu_AddButton(info, 2); + TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); info = {}; info.text = L["TITAN_XP_MENU_SIMPLE_BUTTON_KILLS"]; info.func = function() TitanSetVar(TITAN_XP_ID, "ShowSimpleNumOfKills", true) TitanSetVar(TITAN_XP_ID, "ShowSimpleNumOfGains", false) end info.checked = TitanUtils_Ternary(TitanGetVar(TITAN_XP_ID, "ShowSimpleNumOfKills"), 1, nil); - DDM:UIDropDownMenu_AddButton(info, 2); + TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); info = {}; info.text = L["TITAN_XP_MENU_SIMPLE_BUTTON_XPGAIN"]; info.func = function() TitanSetVar(TITAN_XP_ID, "ShowSimpleNumOfGains", true) TitanSetVar(TITAN_XP_ID, "ShowSimpleNumOfKills", false) end info.checked = TitanUtils_Ternary(TitanGetVar(TITAN_XP_ID, "ShowSimpleNumOfGains"), 1, nil); - DDM:UIDropDownMenu_AddButton(info, 2); + TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); else + end TitanPanelRightClickMenu_AddTitle(TitanPlugins[TITAN_XP_ID].menuText); info = {}; info.text = L["TITAN_XP_MENU_SHOW_XPHR_THIS_SESSION"]; info.func = TitanPanelXPButton_ShowXPPerHourSession; info.checked = TitanUtils_Ternary("ShowXPPerHourSession" == TitanGetVar(TITAN_XP_ID, "DisplayType"), 1, nil); - DDM:UIDropDownMenu_AddButton(info); + TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); info = {}; info.text = L["TITAN_XP_MENU_SHOW_XPHR_THIS_LEVEL"]; info.func = TitanPanelXPButton_ShowXPPerHourLevel; info.checked = TitanUtils_Ternary("ShowXPPerHourLevel" == TitanGetVar(TITAN_XP_ID, "DisplayType"), 1, nil); - DDM:UIDropDownMenu_AddButton(info); + TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); info = {}; info.text = L["TITAN_XP_MENU_SHOW_SESSION_TIME"]; info.func = TitanPanelXPButton_ShowSessionTime; info.checked = TitanUtils_Ternary("ShowSessionTime" == TitanGetVar(TITAN_XP_ID, "DisplayType"), 1, nil); - DDM:UIDropDownMenu_AddButton(info); + TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); info = {}; info.text = L["TITAN_XP_MENU_SHOW_RESTED_TOLEVELUP"]; info.func = TitanPanelXPButton_ShowXPSimple; info.hasArrow = 1; info.checked = TitanUtils_Ternary("ShowXPSimple" == TitanGetVar(TITAN_XP_ID, "DisplayType"), 1, nil); - DDM:UIDropDownMenu_AddButton(info); + TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); TitanPanelRightClickMenu_AddSpacer(); TitanPanelRightClickMenu_AddCommand(L["TITAN_XP_MENU_RESET_SESSION"], TITAN_XP_ID, "TitanPanelXPButton_ResetSession"); TitanPanelRightClickMenu_AddCommand(L["TITAN_XP_MENU_REFRESH_PLAYED"], TITAN_XP_ID, "TitanPanelXPButton_RefreshPlayed"); - TitanPanelRightClickMenu_AddSpacer(); - TitanPanelRightClickMenu_AddToggleIcon(TITAN_XP_ID); - TitanPanelRightClickMenu_AddToggleLabelText(TITAN_XP_ID); - - TitanPanelRightClickMenu_AddSpacer(); + TitanPanelRightClickMenu_AddSpacer(); - local info = {}; - info.text = L["TITAN_USE_COMMA"]; - info.checked = TitanGetVar(TITAN_XP_ID, "UseSeperatorComma"); - info.func = function() - Seperator("UseSeperatorComma") - end - DDM:UIDropDownMenu_AddButton(info, _G["L_UIDROPDOWNMENU_MENU_LEVEL"]); + local info = {}; + info.text = L["TITAN_USE_COMMA"]; + info.checked = TitanGetVar(TITAN_XP_ID, "UseSeperatorComma"); + info.func = function() + Seperator("UseSeperatorComma") + end + TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); local info = {}; info.text = L["TITAN_USE_PERIOD"]; info.checked = TitanGetVar(TITAN_XP_ID, "UseSeperatorPeriod"); info.func = function() Seperator("UseSeperatorPeriod") end - DDM:UIDropDownMenu_AddButton(info, _G["L_UIDROPDOWNMENU_MENU_LEVEL"]); + TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); TitanPanelRightClickMenu_AddSpacer(); + TitanPanelRightClickMenu_AddToggleIcon(TITAN_XP_ID); + TitanPanelRightClickMenu_AddToggleLabelText(TITAN_XP_ID); + TitanPanelRightClickMenu_AddToggleRightSide(TITAN_XP_ID); + TitanPanelRightClickMenu_AddSpacer(); TitanPanelRightClickMenu_AddCommand(L["TITAN_PANEL_MENU_HIDE"], TITAN_XP_ID, TITAN_PANEL_MENU_FUNC_HIDE); - end end -- **************************************************************************