diff --git a/TitanClassic/LDBToTitanClassic.lua b/TitanClassic/LDBToTitanClassic.lua index df164ab..d7a3134 100644 --- a/TitanClassic/LDBToTitanClassic.lua +++ b/TitanClassic/LDBToTitanClassic.lua @@ -515,8 +515,9 @@ function TitanLDBRefreshButton() -- TitanDebug("LDB: RefreshButton") for name, obj in ldb:DataObjectIterator() do if obj then - LDBToTitan:TitanLDBTextUpdate(_, name, "text", (obj.text or ""), obj) - LDBToTitan:TitanLDBIconUpdate(_, name, "icon", (obj.icon or iconTitanDefault), obj) + local unused = nil + LDBToTitan:TitanLDBTextUpdate(unused, name, "text", (obj.text or ""), obj) + LDBToTitan:TitanLDBIconUpdate(unused, name, "icon", (obj.icon or iconTitanDefault), obj) else -- TitanDebug("LDB: '"..name.."' no refresh") end diff --git a/TitanClassic/TitanClassicUtils.lua b/TitanClassic/TitanClassicUtils.lua index 969f678..6793832 100644 --- a/TitanClassic/TitanClassicUtils.lua +++ b/TitanClassic/TitanClassicUtils.lua @@ -988,6 +988,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; + L_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/TitanClassicAmmo/TitanClassicAmmo.lua b/TitanClassicAmmo/TitanClassicAmmo.lua index 96cf34d..2f2adf9 100644 --- a/TitanClassicAmmo/TitanClassicAmmo.lua +++ b/TitanClassicAmmo/TitanClassicAmmo.lua @@ -153,13 +153,14 @@ function TitanPanelAmmoButton_OnLoad(self) ShowLabelText = true, ShowRegularText = false, ShowColoredText = true, - DisplayOnRightSide = false + DisplayOnRightSide = true }, savedVariables = { ShowIcon = 1, ShowLabelText = 1, ShowColoredText = 1, ShowAmmoName = false, + DisplayOnRightSide = false, } }; @@ -302,11 +303,7 @@ end -- DESC : Display rightclick menu options -- ************************************************************************** function TitanPanelRightClickMenu_PrepareAmmoMenu() - local info = {}; TitanPanelRightClickMenu_AddTitle(TitanPlugins[TITAN_AMMO_ID].menuText); - TitanPanelRightClickMenu_AddToggleIcon(TITAN_AMMO_ID); - TitanPanelRightClickMenu_AddToggleLabelText(TITAN_AMMO_ID); - TitanPanelRightClickMenu_AddToggleColoredText(TITAN_AMMO_ID); info.text = L["TITAN_AMMO_BULLET_NAME"]; info.func = function() TitanPanelRightClickMenu_ToggleVar({TITAN_AMMO_ID, "ShowAmmoName"}) @@ -314,7 +311,14 @@ function TitanPanelRightClickMenu_PrepareAmmoMenu() end info.checked = TitanUtils_Ternary(TitanGetVar(TITAN_AMMO_ID, "ShowAmmoName"), 1, nil); L_UIDropDownMenu_AddButton(info); + TitanPanelRightClickMenu_AddSpacer(); + + local info = {}; + TitanPanelRightClickMenu_AddToggleIcon(TITAN_AMMO_ID); + TitanPanelRightClickMenu_AddToggleLabelText(TITAN_AMMO_ID); + TitanPanelRightClickMenu_AddToggleColoredText(TITAN_AMMO_ID); + TitanPanelRightClickMenu_AddToggleRightSide(TITAN_AMMO_ID); TitanPanelRightClickMenu_AddSpacer(); TitanPanelRightClickMenu_AddCommand(L["TITAN_PANEL_MENU_HIDE"], TITAN_AMMO_ID, TITAN_PANEL_MENU_FUNC_HIDE); end diff --git a/TitanClassicBag/TitanClassicBag.lua b/TitanClassicBag/TitanClassicBag.lua index 79e92e7..0d7e2c9 100644 --- a/TitanClassicBag/TitanClassicBag.lua +++ b/TitanClassicBag/TitanClassicBag.lua @@ -266,7 +266,7 @@ function TitanPanelBagButton_OnLoad(self) ShowLabelText = true, ShowRegularText = false, ShowColoredText = true, - DisplayOnRightSide = false + DisplayOnRightSide = true, }, savedVariables = { ShowUsedSlots = 1, @@ -277,6 +277,7 @@ function TitanPanelBagButton_OnLoad(self) ShowIcon = 1, ShowLabelText = 1, ShowColoredText = 1, + DisplayOnRightSide = false, } }; @@ -521,6 +522,7 @@ function TitanPanelRightClickMenu_PrepareBagMenu() 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/TitanClassicClock/TitanClassicClock.lua b/TitanClassicClock/TitanClassicClock.lua index 51b1dea..24ae677 100644 --- a/TitanClassicClock/TitanClassicClock.lua +++ b/TitanClassicClock/TitanClassicClock.lua @@ -516,14 +516,10 @@ function TitanPanelRightClickMenu_PrepareClockMenu() info.keepShownOnClick = 1; L_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"); - L_UIDropDownMenu_AddButton(info); - + 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); diff --git a/TitanClassicGold/TitanClassicGold.lua b/TitanClassicGold/TitanClassicGold.lua index 97a883d..89736fa 100644 --- a/TitanClassicGold/TitanClassicGold.lua +++ b/TitanClassicGold/TitanClassicGold.lua @@ -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, } }; @@ -723,6 +724,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 diff --git a/TitanClassicLocation/TitanClassicLocation.lua b/TitanClassicLocation/TitanClassicLocation.lua index 1880fc2..b1cd07e 100755 --- a/TitanClassicLocation/TitanClassicLocation.lua +++ b/TitanClassicLocation/TitanClassicLocation.lua @@ -38,7 +38,7 @@ function TitanPanelLocationButton_OnLoad(self) ShowLabelText = true, ShowRegularText = false, ShowColoredText = true, - DisplayOnRightSide = false + DisplayOnRightSide = true, }, savedVariables = { ShowZoneText = 1, @@ -54,6 +54,7 @@ function TitanPanelLocationButton_OnLoad(self) CoordsFormat3 = false, UpdateWorldmap = false, MapLocation = false, + DisplayOnRightSide = false, } }; @@ -432,6 +433,7 @@ function TitanPanelRightClickMenu_PrepareLocationMenu() 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/TitanClassicLootType/TitanClassicLootType.lua b/TitanClassicLootType/TitanClassicLootType.lua index 68442b7..2c2ae08 100644 --- a/TitanClassicLootType/TitanClassicLootType.lua +++ b/TitanClassicLootType/TitanClassicLootType.lua @@ -1413,13 +1413,14 @@ function TitanPanelLootTypeButton_OnLoad(self) ShowLabelText = true, ShowRegularText = false, ShowColoredText = false, - DisplayOnRightSide = false + DisplayOnRightSide = true, }, savedVariables = { ShowIcon = 1, ShowLabelText = 1, RandomRoll = 100, DB = {}, + DisplayOnRightSide = false, -- ShowDungeonDiff = false, -- DungeonDiffType = "AUTO", } @@ -1541,7 +1542,7 @@ function TitanPanelRightClickMenu_PrepareLootTypeMenu() 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/TitanClassicPerformance/TitanClassicPerformance.lua b/TitanClassicPerformance/TitanClassicPerformance.lua index 7068862..45ce4fb 100644 --- a/TitanClassicPerformance/TitanClassicPerformance.lua +++ b/TitanClassicPerformance/TitanClassicPerformance.lua @@ -68,7 +68,7 @@ function TitanPanelPerformanceButton_OnLoad(self) ShowLabelText = true, ShowRegularText = false, ShowColoredText = true, - DisplayOnRightSide = false, + DisplayOnRightSide = true, }, savedVariables = { ShowFPS = 1, @@ -82,6 +82,7 @@ function TitanPanelPerformanceButton_OnLoad(self) ShowIcon = 1, ShowLabelText = false, ShowColoredText = 1, + DisplayOnRightSide = false, } }; @@ -371,8 +372,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); @@ -384,10 +386,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); @@ -399,10 +401,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; @@ -423,7 +425,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 @@ -601,6 +603,7 @@ function TitanPanelRightClickMenu_PreparePerformanceMenu() 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 @@ -618,7 +621,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 @@ -633,13 +636,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 diff --git a/TitanClassicRegen/TitanClassicRegen.lua b/TitanClassicRegen/TitanClassicRegen.lua index a4b2de8..3f88bd7 100644 --- a/TitanClassicRegen/TitanClassicRegen.lua +++ b/TitanClassicRegen/TitanClassicRegen.lua @@ -59,14 +59,15 @@ function TitanPanelRegenButton_OnLoad(self) ShowLabelText = true, ShowRegularText = false, ShowColoredText = false, - DisplayOnRightSide = false + DisplayOnRightSide = true, }, savedVariables = { ShowLabelText = 1, ShowHPRegen = 1, ShowPercentage = false, - ShowColoredText = false - } + ShowColoredText = false, + DisplayOnRightSide = false, + } }; self:RegisterEvent("UNIT_HEALTH"); @@ -271,6 +272,7 @@ function TitanPanelRightClickMenu_PrepareRegenMenu() L_UIDropDownMenu_AddButton(info); TitanPanelRightClickMenu_AddToggleLabelText("TitanRegen"); + TitanPanelRightClickMenu_AddToggleRightSide(TITAN_REGEN_ID); TitanPanelRightClickMenu_AddCommand(L["TITAN_PANEL_MENU_HIDE"], id, TITAN_PANEL_MENU_FUNC_HIDE); end diff --git a/TitanClassicRepair/TitanClassicRepair.lua b/TitanClassicRepair/TitanClassicRepair.lua index e71bf2b..ff26891 100644 --- a/TitanClassicRepair/TitanClassicRepair.lua +++ b/TitanClassicRepair/TitanClassicRepair.lua @@ -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, } }; @@ -1360,6 +1361,7 @@ local info; 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/TitanClassicXP/TitanClassicXP.lua b/TitanClassicXP/TitanClassicXP.lua index bd22408..7b23a4f 100644 --- a/TitanClassicXP/TitanClassicXP.lua +++ b/TitanClassicXP/TitanClassicXP.lua @@ -52,7 +52,7 @@ function TitanPanelXPButton_OnLoad(self) ShowLabelText = true, ShowRegularText = false, ShowColoredText = false, - DisplayOnRightSide = false + DisplayOnRightSide = true, }, savedVariables = { DisplayType = "ShowXPPerHourSession", @@ -64,6 +64,7 @@ function TitanPanelXPButton_OnLoad(self) ShowSimpleNumOfGains = false, UseSeperatorComma = true, UseSeperatorPeriod = false, + DisplayOnRightSide = false, } }; @@ -402,10 +403,6 @@ function TitanPanelRightClickMenu_PrepareXPMenu() 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(); local info = {}; info.text = L["TITAN_USE_COMMA"]; @@ -423,6 +420,11 @@ function TitanPanelRightClickMenu_PrepareXPMenu() L_UIDropDownMenu_AddButton(info, _G["L_UIDROPDOWNMENU_MENU_LEVEL"]); 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