diff --git a/Titan/Titan.toc b/Titan/Titan.toc index b12e877..11900db 100644 --- a/Titan/Titan.toc +++ b/Titan/Titan.toc @@ -1,7 +1,7 @@ ## Interface: 90204 -## Title: Titan Panel |cff00aa005.23.2.90204|r +## Title: Titan Panel |cff00aa005.23.3.90204|r ## Author: Titan Panel Development Team -## Version: 5.23.2.90204 +## Version: 5.23.3.90204 ## SavedVariables: TitanAll, TitanSettings, TitanSkins, ServerTimeOffsets, ServerHourFormat ## OptionalDeps: Ace3, AceGUI-3.0-SharedMediaWidgets, LibSharedMedia-3.0, LibQTip-1.0, !LibUIDropDownMenu ## Notes: Adds a display bar on the top and/or bottom of the screen. Allows users to show and control information/launcher plugins. diff --git a/Titan/TitanPanelTemplate.lua b/Titan/TitanPanelTemplate.lua index 3c94e22..d17dc08 100644 --- a/Titan/TitanPanelTemplate.lua +++ b/Titan/TitanPanelTemplate.lua @@ -210,6 +210,8 @@ VAR: self - frame reference of the plugin VAR: id - string name of the plugin --]] local function TitanPanelButton_SetTooltip(self, id) + local call_success = nil + local tmp_txt = "" -- ensure that the 'self' passed is a valid frame reference if not self:GetName() then return end @@ -224,7 +226,8 @@ local function TitanPanelButton_SetTooltip(self, id) local tooltipTextFunc = _G[plugin.tooltipTextFunction]; if ( tooltipTextFunc ) then local tmp_txt = "" - local call_success, -- for pcall + + call_success, -- for pcall tmp_txt = pcall (tooltipTextFunc); self.tooltipText = tmp_txt -- self.tooltipText = tooltipTextFunc(); @@ -524,6 +527,7 @@ function TitanPanelPluginHandle_OnUpdate(table, oldarg) -- Used by plugins if TitanPanelRightClickMenu_IsVisible() or TITAN_PANEL_MOVING == 1 then return end + TitanPanelButton_SetTooltip(_G["TitanPanel"..id.."Button"], id) end end @@ -935,6 +939,7 @@ function TitanPanelButton_UpdateTooltip(self) -- Used by plugins if not self then return end if (GameTooltip:IsOwned(self)) then local id = TitanUtils_GetButtonID(self:GetName()); + TitanPanelButton_SetTooltip(self, id); end end diff --git a/Titan/locale/Localization.BR.lua b/Titan/locale/Localization.BR.lua index 1cf27b9..e86be74 100644 --- a/Titan/locale/Localization.BR.lua +++ b/Titan/locale/Localization.BR.lua @@ -530,6 +530,7 @@ L["TITAN_GOLD_ONLY"] = "Exibir Somente Ouro"; L["TITAN_GOLD_COLORS"] = "Exibir Gold Colors"; L["TITAN_GOLD_MERGE"] = "Merge Servers"; L["TITAN_GOLD_SEPARATE"] = "Separate Servers"; +L["TITAN_GOLD_ALL"] = "All Servers"; L["TITAN_VOLUME_TOOLTIP"] = "Informação de Volume"; L["TITAN_VOLUME_MASTER_TOOLTIP_VALUE"] = "Master Sound Volume: "; diff --git a/Titan/locale/Localization.CN.lua b/Titan/locale/Localization.CN.lua index a504862..46e2fbd 100644 --- a/Titan/locale/Localization.CN.lua +++ b/Titan/locale/Localization.CN.lua @@ -530,6 +530,7 @@ L["TITAN_GOLD_ONLY"] = "只显示金"; L["TITAN_GOLD_COLORS"] = "显示金币颜色"; L["TITAN_GOLD_MERGE"] = "Merge Servers"; L["TITAN_GOLD_SEPARATE"] = "Separate Servers"; +L["TITAN_GOLD_ALL"] = "All Servers"; L["TITAN_VOLUME_TOOLTIP"] = "音量信息"; L["TITAN_VOLUME_MASTER_TOOLTIP_VALUE"] = "主音量: "; diff --git a/Titan/locale/Localization.DE.lua b/Titan/locale/Localization.DE.lua index 3edbabe..76f8730 100644 --- a/Titan/locale/Localization.DE.lua +++ b/Titan/locale/Localization.DE.lua @@ -526,6 +526,7 @@ L["TITAN_GOLD_ONLY"] = "Zeige nur Gold"; L["TITAN_GOLD_COLORS"] = "Zeige Gold (und Bruchteil)-Farben"; L["TITAN_GOLD_MERGE"] = "Zusammengelegte Servers"; L["TITAN_GOLD_SEPARATE"] = "Getrennte Servers"; +L["TITAN_GOLD_ALL"] = "All Servers"; L["TITAN_VOLUME_TOOLTIP"] = "Lautst\195\164rke einstellen"; L["TITAN_VOLUME_MASTER_TOOLTIP_VALUE"] = "Momentane Gesamtlautst\195\164rke: "; diff --git a/Titan/locale/Localization.ES.lua b/Titan/locale/Localization.ES.lua index dc88e86..14bc2a0 100644 --- a/Titan/locale/Localization.ES.lua +++ b/Titan/locale/Localization.ES.lua @@ -544,6 +544,7 @@ L["TITAN_GOLD_ONLY"] = "Mostrar sólo oro"; L["TITAN_GOLD_COLORS"] = "Mostrar colores en el oro"; L["TITAN_GOLD_MERGE"] = "Unificar servidores"; L["TITAN_GOLD_SEPARATE"] = "Separar servidores"; +L["TITAN_GOLD_ALL"] = "All Servers"; L["TITAN_VOLUME_TOOLTIP"] = "Control de Volumen"; L["TITAN_VOLUME_MASTER_TOOLTIP_VALUE"] = "Volumen general: "; diff --git a/Titan/locale/Localization.FR.lua b/Titan/locale/Localization.FR.lua index 52edb6c..c5e3958 100644 --- a/Titan/locale/Localization.FR.lua +++ b/Titan/locale/Localization.FR.lua @@ -527,6 +527,7 @@ L["TITAN_GOLD_COIN_ICONS"] = "Afficher les images des pièces"; L["TITAN_GOLD_ONLY"] = "Afficher uniquement les pièces d'or"; L["TITAN_GOLD_MERGE"] = "Merge Servers"; L["TITAN_GOLD_SEPARATE"] = "Separate Servers"; +L["TITAN_GOLD_ALL"] = "All Servers"; L["TITAN_VOLUME_TOOLTIP"] = "Contrôle du volume"; L["TITAN_VOLUME_MASTER_TOOLTIP_VALUE"] = "Volume global : "; diff --git a/Titan/locale/Localization.IT.lua b/Titan/locale/Localization.IT.lua index 809c452..31ce3ee 100644 --- a/Titan/locale/Localization.IT.lua +++ b/Titan/locale/Localization.IT.lua @@ -528,6 +528,7 @@ L["TITAN_GOLD_ONLY"] = "Mostra solo oro"; L["TITAN_GOLD_COLORS"] = "Mostra colori"; L["TITAN_GOLD_MERGE"] = "Merge Servers"; L["TITAN_GOLD_SEPARATE"] = "Separate Servers"; +L["TITAN_GOLD_ALL"] = "All Servers"; L["TITAN_VOLUME_TOOLTIP"] = "Info Volume"; L["TITAN_VOLUME_MASTER_TOOLTIP_VALUE"] = "Volume master: "; diff --git a/Titan/locale/Localization.KR.lua b/Titan/locale/Localization.KR.lua index bc8b7b8..134e856 100644 --- a/Titan/locale/Localization.KR.lua +++ b/Titan/locale/Localization.KR.lua @@ -529,6 +529,7 @@ L["TITAN_GOLD_ONLY"] = "소지금만 표시"; L["TITAN_GOLD_COLORS"] = "소지금 색상 표시"; L["TITAN_GOLD_MERGE"] = "서버 통합"; L["TITAN_GOLD_SEPARATE"] = "서버 분리"; +L["TITAN_GOLD_ALL"] = "All Servers"; L["TITAN_VOLUME_TOOLTIP"] = "음량 정보"; L["TITAN_VOLUME_MASTER_TOOLTIP_VALUE"] = "주 음량 : "; diff --git a/Titan/locale/Localization.MX.lua b/Titan/locale/Localization.MX.lua index f59608d..e27c855 100644 --- a/Titan/locale/Localization.MX.lua +++ b/Titan/locale/Localization.MX.lua @@ -544,6 +544,7 @@ L["TITAN_GOLD_ONLY"] = "Mostrar sólo oro"; L["TITAN_GOLD_COLORS"] = "Mostrar colores en el oro"; L["TITAN_GOLD_MERGE"] = "Unificar servidores"; L["TITAN_GOLD_SEPARATE"] = "Separar servidores"; +L["TITAN_GOLD_ALL"] = "All Servers"; L["TITAN_VOLUME_TOOLTIP"] = "Control de Volumen"; L["TITAN_VOLUME_MASTER_TOOLTIP_VALUE"] = "Volumen general: "; diff --git a/Titan/locale/Localization.RU.lua b/Titan/locale/Localization.RU.lua index 843df6a..b6bc10a 100644 --- a/Titan/locale/Localization.RU.lua +++ b/Titan/locale/Localization.RU.lua @@ -528,6 +528,7 @@ L["TITAN_GOLD_ONLY"] = "Показать только золото"; L["TITAN_GOLD_COLORS"] = "Показать окраску золота"; L["TITAN_GOLD_MERGE"] = "Merge Servers"; L["TITAN_GOLD_SEPARATE"] = "Separate Servers"; +L["TITAN_GOLD_ALL"] = "All Servers"; L["TITAN_VOLUME_TOOLTIP"] = "Контроль звука"; L["TITAN_VOLUME_MASTER_TOOLTIP_VALUE"] = "Громкость общего звука: "; diff --git a/Titan/locale/Localization.TW.lua b/Titan/locale/Localization.TW.lua index 283c859..9002385 100644 --- a/Titan/locale/Localization.TW.lua +++ b/Titan/locale/Localization.TW.lua @@ -527,6 +527,7 @@ L["TITAN_GOLD_ONLY"] = "Show Gold Only"; L["TITAN_GOLD_COLORS"] = "Show Gold Colors"; L["TITAN_GOLD_MERGE"] = "Merge Servers"; L["TITAN_GOLD_SEPARATE"] = "Separate Servers"; +L["TITAN_GOLD_ALL"] = "All Servers"; L["TITAN_VOLUME_TOOLTIP"] = "音量控制"; L["TITAN_VOLUME_MASTER_TOOLTIP_VALUE"] = "主音量大小: "; diff --git a/Titan/locale/Localization.lua b/Titan/locale/Localization.lua index 4a6a808..00a4841 100644 --- a/Titan/locale/Localization.lua +++ b/Titan/locale/Localization.lua @@ -530,6 +530,7 @@ L["TITAN_GOLD_ONLY"] = "Show Gold Only"; L["TITAN_GOLD_COLORS"] = "Show Gold Colors"; L["TITAN_GOLD_MERGE"] = "Merge Servers"; L["TITAN_GOLD_SEPARATE"] = "Separate Servers"; +L["TITAN_GOLD_ALL"] = "All Servers"; L["TITAN_VOLUME_TOOLTIP"] = "Volume Info"; L["TITAN_VOLUME_MASTER_TOOLTIP_VALUE"] = "Master Sound Volume: "; diff --git a/TitanBag/TitanBag.toc b/TitanBag/TitanBag.toc index 607bd5a..4f6db04 100644 --- a/TitanBag/TitanBag.toc +++ b/TitanBag/TitanBag.toc @@ -1,10 +1,10 @@ ## Interface: 90204 -## Title: Titan Panel [|cffeda55fBag|r] |cff00aa005.23.2.90204|r +## Title: Titan Panel [|cffeda55fBag|r] |cff00aa005.23.3.90204|r ## Notes: Adds bag and free slot information to Titan Panel ## Author: Titan Panel Development Team (http://www.titanpanel.org) ## SavedVariables: ## OptionalDeps: ## Dependencies: Titan -## Version: 5.23.2.90204 +## Version: 5.23.3.90204 ## X-Child-Of: Titan TitanBag.xml diff --git a/TitanClock/TitanClock.toc b/TitanClock/TitanClock.toc index f940451..acc5396 100644 --- a/TitanClock/TitanClock.toc +++ b/TitanClock/TitanClock.toc @@ -1,10 +1,10 @@ ## Interface: 90204 -## Title: Titan Panel [|cffeda55fClock|r] |cff00aa005.23.2.90204|r +## Title: Titan Panel [|cffeda55fClock|r] |cff00aa005.23.3.90204|r ## Notes: Adds a clock to Titan Panel ## Author: Titan Panel Development Team (http://www.titanpanel.org) ## SavedVariables: ## OptionalDeps: ## Dependencies: Titan -## Version: 5.23.2.90204 +## Version: 5.23.3.90204 ## X-Child-Of: Titan TitanClock.xml diff --git a/TitanGold/TitanGold.lua b/TitanGold/TitanGold.lua index 2c75e4f..807f2e4 100644 --- a/TitanGold/TitanGold.lua +++ b/TitanGold/TitanGold.lua @@ -1,8 +1,10 @@ +--[[ -- ************************************************************************** -- * TitanGold.lua -- * -- * By: The Titan Panel Development Team -- ************************************************************************** +--]] -- ******************************** Constants ******************************* local TITAN_GOLD_ID = "Gold"; @@ -13,6 +15,7 @@ local TITAN_GOLD_BLUE = {r=0.4,b=1,g=0.4}; local TITAN_GOLD_RED = {r=1,b=0,g=0}; local TITAN_GOLD_GREEN = {r=0,b=0,g=1}; local updateTable = {TITAN_GOLD_ID, TITAN_PANEL_UPDATE_TOOLTIP }; + -- ******************************** Variables ******************************* local GOLD_INITIALIZED = false; local GOLD_INDEX = ""; @@ -27,6 +30,7 @@ local GoldTimer = nil; local _G = getfenv(0); local realmName = GetRealmName(); local realmNames = GetAutoCompleteRealms(); + -- ******************************** Functions ******************************* --[[ @@ -154,10 +158,12 @@ SC.Print("Acc cash:" return outstr, cash, gold, silver, copper end +--[[ -- ************************************************************************** -- NAME : TitanPanelGoldButton_OnLoad() -- DESC : Registers the add on upon it loading -- ************************************************************************** +--]] function TitanPanelGoldButton_OnLoad(self) self.registry = { id = TITAN_GOLD_ID, @@ -192,6 +198,7 @@ function TitanPanelGoldButton_OnLoad(self) UseSeperatorPeriod = false, MergeServers = false, SeparateServers = true, + AllServers = false, gold = { total = "112233", neg = false }, } }; @@ -205,29 +212,35 @@ function TitanPanelGoldButton_OnLoad(self) GOLD_INDEX = UnitName("player").."_"..realmName.."::"..UnitFactionGroup("Player"); end +--[[ -- ************************************************************************** -- NAME : TitanPanelGoldButton_OnShow() -- DESC : Create repeating timer when plugin is visible -- ************************************************************************** +--]] function TitanPanelGoldButton_OnShow() if not GoldTimer and GoldSave and TitanGetVar(TITAN_GOLD_ID, "DisplayGoldPerHour") then GoldTimer = TitanGold:ScheduleRepeatingTimer(TitanPanelPluginHandle_OnUpdate, 1, updateTable) end end +--[[ -- ************************************************************************** -- NAME : TitanPanelGoldButton_OnHide() -- DESC : Destroy repeating timer when plugin is hidden -- ************************************************************************** +--]] function TitanPanelGoldButton_OnHide() TitanGold:CancelTimer(GoldTimer, true) GoldTimer = nil; end +--[[ -- ************************************************************************** -- NAME : TitanGold_OnEvent() -- DESC : This section will grab the events registered to the add on and act on them -- ************************************************************************** +--]] function TitanGold_OnEvent(self, event, ...) if (event == "PLAYER_MONEY") then if (GOLD_INITIALIZED) then @@ -241,77 +254,86 @@ function TitanGold_OnEvent(self, event, ...) if (not GOLD_INITIALIZED) then TitanPanelGoldButton_Initialize_Array(self); end + TitanPanelButton_UpdateButton(TITAN_GOLD_ID) return; end end +--[[ -- ******************************************************************************************* -- NAME: TitanPanelGoldButton_GetTooltipText() -- DESC: Gets our tool-tip text, what appears when we hover over our item on the Titan bar. -- ******************************************************************************************* +--]] function TitanPanelGoldButton_GetTooltipText() + local GoldSaveSorted = {}; local currentMoneyRichText = ""; + local final_text = "" local countelements = 0; - for _ in pairs (realmNames) do countelements = countelements + 1 end - if countelements == 0 or TitanGetVar(TITAN_GOLD_ID, "SeparateServers") then + local faction = UnitFactionGroup("Player") + + for _ in pairs (realmNames) do + countelements = countelements + 1 + end + +-- if countelements == 0 or TitanGetVar(TITAN_GOLD_ID, "SeparateServers") then + -- The check for no connected realms was confusing so use the 'merge' format + -- if requested. + if TitanGetVar(TITAN_GOLD_ID, "SeparateServers") then -- Parse the database and display all characters from the same faction and server - local server = realmName.."::"..UnitFactionGroup("Player"); + local server = realmName GoldSave[GOLD_INDEX].gold = GetMoney("player") - --local currentMoneyRichText = ""; -- initialize the variable to hold the array local coin_str = "" local character, charserver = "", "" local ttlgold = 0 local show_labels = (TitanGetVar(TITAN_GOLD_ID, "ShowCoinLabels") or TitanGetVar(TITAN_GOLD_ID, "ShowCoinIcons")) - -- This next section will sort the array based on user preference - -- either by name, or by gold amount descending. - - local GoldSaveSorted = {}; for index, money in pairs(GoldSave) do - character, charserver = string.match(index, '(.*)_(.*)'); + character, charserver, char_faction = string.match(index, '(.*)_(.*)::(.*)'); if (character) then if (charserver == server) then table.insert(GoldSaveSorted, index); -- insert all keys from hash into the array end end end - - if TitanGetVar(TITAN_GOLD_ID, "SortByName") then - table.sort(GoldSaveSorted, function (key1, key2) return GoldSave[key1].name < GoldSave[key2].name end) - else - table.sort(GoldSaveSorted, function (key1, key2) return GoldSave[key1].gold > GoldSave[key2].gold end) - end - - for i = 1, getn(GoldSaveSorted) do - character, charserver = string.match(GoldSaveSorted[i], '(.*)_(.*)'); - if (character) then - if (charserver == server) then - if (GoldSave[GoldSaveSorted[i]].show) then - coin_str = NiceCash(GoldSave[GoldSaveSorted[i]].gold, false, false) - currentMoneyRichText = currentMoneyRichText.."\n"..character.."\t"..coin_str + elseif TitanGetVar(TITAN_GOLD_ID, "MergeServers") then + -- Parse the database and display characters from the same faction on merged / connected servers + for ms = 1, countelements do + local server = realmNames[ms] + GoldSave[GOLD_INDEX].gold = GetMoney("player") + local coin_str = "" + local character, charserver = "", "" + local char_faction = "" + local ttlgold = 0 + local show_labels = (TitanGetVar(TITAN_GOLD_ID, "ShowCoinLabels") + or TitanGetVar(TITAN_GOLD_ID, "ShowCoinIcons")) + + for index, money in pairs(GoldSave) do + character, charserver, char_faction = string.match(index, '(.*)_(.*)::(.*)'); + if (charserver) then + charserver = string.gsub(charserver, "%s", ""); + end + if (character) then + if (server == charserver) and (char_faction == faction) then + table.insert(GoldSaveSorted, index); -- insert all keys from hash into the array end end end end - else - -- Parse the database and display all characters from the same faction across servers - local faction = UnitFactionGroup("Player"); - local server = realmNames[ms] + elseif TitanGetVar(TITAN_GOLD_ID, "AllServers") then + -- Parse the database and display characters from the same faction on all servers GoldSave[GOLD_INDEX].gold = GetMoney("player") local coin_str = "" local character, charserver = "", "" + local char_faction = "" local ttlgold = 0 local show_labels = (TitanGetVar(TITAN_GOLD_ID, "ShowCoinLabels") or TitanGetVar(TITAN_GOLD_ID, "ShowCoinIcons")) - -- This next section will sort the array based on user preference - -- either by name, or by gold amount descending. - local GoldSaveSorted = {}; for index, money in pairs(GoldSave) do - character, charserver = string.match(index, '(.*)_(.*)'); - local _, char_faction = string.match(charserver, '(.*)::(.*)') + character, charserver, char_faction = string.match(index, '(.*)_(.*)::(.*)'); if (charserver) then charserver = string.gsub(charserver, "%s", ""); end @@ -321,31 +343,45 @@ function TitanPanelGoldButton_GetTooltipText() end end end + end - if TitanGetVar(TITAN_GOLD_ID, "SortByName") then - table.sort(GoldSaveSorted, function (key1, key2) return GoldSave[key1].name < GoldSave[key2].name end) - else - table.sort(GoldSaveSorted, function (key1, key2) return GoldSave[key1].gold > GoldSave[key2].gold end) - end - - for i = 1, getn(GoldSaveSorted) do - character, charserver = string.match(GoldSaveSorted[i], '(.*)_(.*)'); - local _, char_faction = string.match(charserver, '(.*)::(.*)') - if (charserver) then - charserver = string.gsub(charserver, "%s", ""); - end - if (character) then - if (char_faction == faction) then - if (GoldSave[GoldSaveSorted[i]].show) then - coin_str = NiceCash(GoldSave[GoldSaveSorted[i]].gold, false, false) - currentMoneyRichText = currentMoneyRichText.."\n"..character.."-"..charserver.."\t"..coin_str - end + -- This next section will sort the array based on user preference + -- either by name, or by gold amount descending. + if TitanGetVar(TITAN_GOLD_ID, "SortByName") then + table.sort(GoldSaveSorted, function (key1, key2) return GoldSave[key1].name < GoldSave[key2].name end) + else + table.sort(GoldSaveSorted, function (key1, key2) return GoldSave[key1].gold > GoldSave[key2].gold end) + end + + currentMoneyRichText = "" + coin_str = "" + for i = 1, getn(GoldSaveSorted) do + character, charserver, char_faction = string.match(GoldSaveSorted[i], '(.*)_(.*)::(.*)'); + if (character) then + if (char_faction == faction) then + if (GoldSave[GoldSaveSorted[i]].show) then + coin_str = NiceCash(GoldSave[GoldSaveSorted[i]].gold, false, false) + currentMoneyRichText = currentMoneyRichText.."\n"..character.."-"..charserver.."\t"..coin_str end end end end - local coin_str = "" +--[[ +print("TG" +.." "..tostring(counter) +.." "..tostring(x0) +.." "..tostring(x1) +.." "..tostring(getn(GoldSaveSorted)) +.." "..tostring(TitanGetVar(TITAN_GOLD_ID, "SeparateServers")) +.." "..tostring(TitanGetVar(TITAN_GOLD_ID, "MergeServers")) +.." "..tostring(TitanGetVar(TITAN_GOLD_ID, "AllServers")) +.." "..tostring(TITANPANEL_TOOLTIP) +--.." "..tostring(TITANPANEL_TOOLTIP_X) +) +--]] + + coin_str = "" -- Display total gold coin_str = NiceCash(TitanPanelGoldButton_TotalGold(), false, false) currentMoneyRichText = currentMoneyRichText.."\n" @@ -389,23 +425,20 @@ function TitanPanelGoldButton_GetTooltipText() .."\t"..coin_str.."\n"; end - local final_tooltip = ""; + local final_tooltip = L["TITAN_GOLD_TOOLTIPTEXT"].." : " if realmNames == nil or TitanGetVar(TITAN_GOLD_ID, "SeparateServers") then - final_tooltip = L["TITAN_GOLD_TOOLTIPTEXT"].." : " - ..realmName.." : "..select(2,UnitFactionGroup("Player")); - if (UnitFactionGroup("Player")=="Alliance") then - GOLD_COLOR = TITAN_GOLD_GREEN; - else - GOLD_COLOR = TITAN_GOLD_RED; - end + final_tooltip = final_tooltip..realmName + elseif TitanGetVar(TITAN_GOLD_ID, "MergeServers") then + final_tooltip = final_tooltip..L["TITAN_GOLD_MERGE"] + elseif TitanGetVar(TITAN_GOLD_ID, "AllServers") then + final_tooltip = final_tooltip..ALL + end + final_tooltip = final_tooltip.." : "..select(2,UnitFactionGroup("Player")); + + if (UnitFactionGroup("Player")=="Alliance") then + GOLD_COLOR = TITAN_GOLD_GREEN; else - final_tooltip = L["TITAN_GOLD_TOOLTIPTEXT"].." " - ..select(2,UnitFactionGroup("Player")); - if (UnitFactionGroup("Player")=="Alliance") then - GOLD_COLOR = TITAN_GOLD_GREEN; - else - GOLD_COLOR = TITAN_GOLD_RED; - end + GOLD_COLOR = TITAN_GOLD_RED; end return ""..TitanUtils_GetColoredText(final_tooltip,GOLD_COLOR)..FONT_COLOR_CODE_CLOSE @@ -413,10 +446,12 @@ function TitanPanelGoldButton_GetTooltipText() ..sessionMoneyRichText end +--[[ -- ******************************************************************************************* -- NAME: TitanPanelGoldButton_FindGold() -- DESC: This routines determines which gold total the ui wants (server or player) then calls it and returns it -- ******************************************************************************************* +--]] function TitanPanelGoldButton_FindGold() if (not GOLD_INITIALIZED) then -- in case there is no db entry for this toon, return blank. @@ -441,23 +476,35 @@ function TitanPanelGoldButton_FindGold() return L["TITAN_GOLD_MENU_TEXT"]..": "..FONT_COLOR_CODE_CLOSE, ret_str end +--[[ -- ******************************************************************************************* -- NAME: TitanPanelGoldButton_TotalGold() -- DESC: Calculates total gold for display per user selections -- ******************************************************************************************* +--]] function TitanPanelGoldButton_TotalGold() local ttlgold = 0; local cnt = 0; local countelements = 0; local faction = UnitFactionGroup("Player"); + local coin_str = "" + local character, charserver = "", "" + local char_faction = "" + + for _ in pairs (realmNames) do + countelements = countelements + 1 + end - for _ in pairs (realmNames) do countelements = countelements + 1 end - if countelements == 0 or TitanGetVar(TITAN_GOLD_ID, "SeparateServers") then + if TitanGetVar(TITAN_GOLD_ID, "SeparateServers") then + -- Parse the database and display all characters from the same faction and server local server = realmName.."::"..UnitFactionGroup("Player"); GoldSave[GOLD_INDEX].gold = GetMoney("player") for index, money in pairs(GoldSave) do - local character, charserver = string.match(index, '(.*)_(.*)'); + character, charserver = string.match(index, '(.*)_(.*)'); + if (charserver) then + charserver = string.gsub(charserver, "%s", ""); + end if (character) then if (charserver == server) then if GoldSave[index].show then @@ -466,12 +513,36 @@ function TitanPanelGoldButton_TotalGold() end end end - else + elseif TitanGetVar(TITAN_GOLD_ID, "MergeServers") then + -- Parse the database and display characters from the same faction on merged / connected servers + for ms = 1, countelements do + local faction = UnitFactionGroup("Player"); + local server = realmNames[ms] + GoldSave[GOLD_INDEX].gold = GetMoney("player") + local char_faction = "" + + for index, money in pairs(GoldSave) do + character, charserver, char_faction = string.match(index, '(.*)_(.*)::(.*)'); + if (charserver) then + charserver = string.gsub(charserver, "%s", ""); + end + if (character) then + if (server == charserver) and (char_faction == faction) then + if GoldSave[index].show then + ttlgold = ttlgold + GoldSave[index].gold; + end + end + end + end + end + elseif TitanGetVar(TITAN_GOLD_ID, "AllServers") then + -- Parse the database and display characters from the same faction on all servers + local faction = UnitFactionGroup("Player"); GoldSave[GOLD_INDEX].gold = GetMoney("player") + local char_faction = "" for index, money in pairs(GoldSave) do - local character, charserver = string.match(index, '(.*)_(.*)'); - local _, char_faction = string.match(charserver, '(.*)::(.*)') + character, charserver, char_faction = string.match(index, '(.*)_(.*)::(.*)'); if (charserver) then charserver = string.gsub(charserver, "%s", ""); end @@ -579,18 +650,27 @@ local function Merger(chosen) if chosen == "MergeServers" then TitanSetVar(TITAN_GOLD_ID, "MergeServers", true); TitanSetVar(TITAN_GOLD_ID, "SeparateServers", false); + TitanSetVar(TITAN_GOLD_ID, "AllServers", false); end if chosen == "SeparateServers" then TitanSetVar(TITAN_GOLD_ID, "MergeServers", false); TitanSetVar(TITAN_GOLD_ID, "SeparateServers", true); + TitanSetVar(TITAN_GOLD_ID, "AllServers", false); + end + if chosen == "AllServers" then + TitanSetVar(TITAN_GOLD_ID, "MergeServers", false); + TitanSetVar(TITAN_GOLD_ID, "SeparateServers", false); + TitanSetVar(TITAN_GOLD_ID, "AllServers", true); end TitanPanelButton_UpdateButton(TITAN_GOLD_ID); end +--[[ -- ******************************************************************************************* -- NAME: TitanPanelRightClickMenu_PrepareGoldMenu -- DESC: Builds the right click config menu -- ******************************************************************************************* +--]] function TitanPanelRightClickMenu_PrepareGoldMenu() if TitanPanelRightClickMenu_GetDropdownLevel() == 1 then -- Menu title @@ -617,8 +697,7 @@ function TitanPanelRightClickMenu_PrepareGoldMenu() TitanPanelRightClickMenu_AddCommand(L["TITAN_GOLD_TOGGLE_GPH_SHOW"], TITAN_GOLD_ID,"TitanPanelGoldGPH_Toggle"); end - -- A blank line in the menu - TitanPanelRightClickMenu_AddSpacer(); + TitanPanelRightClickMenu_AddSeparator(); local info = {}; info.text = L["TITAN_GOLD_COIN_NONE"]; @@ -644,7 +723,7 @@ function TitanPanelRightClickMenu_PrepareGoldMenu() end TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); - TitanPanelRightClickMenu_AddSpacer(); + TitanPanelRightClickMenu_AddSeparator(); local info = {}; info.text = L["TITAN_USE_COMMA"]; @@ -662,8 +741,9 @@ function TitanPanelRightClickMenu_PrepareGoldMenu() end TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); - TitanPanelRightClickMenu_AddSpacer(); + TitanPanelRightClickMenu_AddSeparator(); + -- Which characters to show local info = {}; info.text = L["TITAN_GOLD_MERGE"]; info.checked = TitanGetVar(TITAN_GOLD_ID, "MergeServers"); @@ -680,8 +760,17 @@ function TitanPanelRightClickMenu_PrepareGoldMenu() end TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); - TitanPanelRightClickMenu_AddSpacer(); + local info = {}; + info.text = L["TITAN_GOLD_ALL"]; + info.checked = TitanGetVar(TITAN_GOLD_ID, "AllServers"); + info.func = function() + Merger("AllServers") + end + TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); + + TitanPanelRightClickMenu_AddSeparator(); + -- Only gold option info = {}; info.text = L["TITAN_GOLD_ONLY"]; info.checked = TitanGetVar(TITAN_GOLD_ID, "ShowGoldOnly"); @@ -691,8 +780,7 @@ function TitanPanelRightClickMenu_PrepareGoldMenu() end TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); - -- A blank line in the menu - TitanPanelRightClickMenu_AddSpacer(); + TitanPanelRightClickMenu_AddSeparator(); -- Show toon info = {}; @@ -710,10 +798,9 @@ function TitanPanelRightClickMenu_PrepareGoldMenu() info.hasArrow = 1; TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); - -- A blank line in the menu - TitanPanelRightClickMenu_AddSpacer(); + TitanPanelRightClickMenu_AddSeparator(); - -- Function to clear the enter database + -- Option to clear the enter database info = {}; info.notCheckable = true info.text = L["TITAN_GOLD_CLEAR_DATA_TEXT"]; @@ -722,12 +809,11 @@ function TitanPanelRightClickMenu_PrepareGoldMenu() TitanPanelRightClickMenu_AddCommand(L["TITAN_GOLD_RESET_SESS_TEXT"], TITAN_GOLD_ID, "TitanPanelGoldButton_ResetSession"); - -- A blank line in the menu - TitanPanelRightClickMenu_AddSpacer(); + TitanPanelRightClickMenu_AddSeparator(); TitanPanelRightClickMenu_AddToggleIcon(TITAN_GOLD_ID); TitanPanelRightClickMenu_AddToggleLabelText(TITAN_GOLD_ID); TitanPanelRightClickMenu_AddToggleColoredText(TITAN_GOLD_ID); - TitanPanelRightClickMenu_AddSpacer(); + TitanPanelRightClickMenu_AddSeparator(); -- Generic function to toggle and hide TitanPanelRightClickMenu_AddCommand(L["TITAN_PANEL_MENU_HIDE"], TITAN_GOLD_ID, TITAN_PANEL_MENU_FUNC_HIDE); @@ -770,10 +856,12 @@ function TitanPanelRightClickMenu_PrepareGoldMenu() end end +--[[ -- ************************************************************************** -- NAME : TitanPanelGoldButton_ClearData() -- DESC : This will allow the user to clear all the data and rebuild the array -- ************************************************************************** +--]] function TitanPanelGoldButton_ClearData(self) GOLD_INITIALIZED = false; @@ -783,10 +871,12 @@ function TitanPanelGoldButton_ClearData(self) DEFAULT_CHAT_FRAME:AddMessage(TitanUtils_GetGreenText(L["TITAN_GOLD_DB_CLEARED"])); end +--[[ -- ************************************************************************** -- NAME : TitanPanelGoldButton_Initialize_Array() -- DESC : Build the gold array for the server/faction -- ************************************************************************** +--]] function TitanPanelGoldButton_Initialize_Array(self) if (GOLD_INITIALIZED) then return; end @@ -812,27 +902,33 @@ function TitanPanelGoldButton_Initialize_Array(self) TitanPanelButton_UpdateButton(TITAN_GOLD_ID) end +--[[ -- ******************************************************************************************* -- NAME: TitanPanelGoldButton_Toggle() -- DESC: This toggles whether or not the player wants to view total gold on the button, or player gold. -- ******************************************************************************************* +--]] function TitanPanelGoldButton_Toggle() TitanToggleVar(TITAN_GOLD_ID, "ViewAll") TitanPanelButton_UpdateButton(TITAN_GOLD_ID) end +--[[ -- ******************************************************************************************* -- NAME: TitanPanelGoldSort_Toggle() -- DESC: This toggles how the player wants the display to be sorted - by name or gold amount -- ******************************************************************************************* +--]] function TitanPanelGoldSort_Toggle() TitanToggleVar(TITAN_GOLD_ID, "SortByName") end +--[[ -- ******************************************************************************************* -- NAME: TitanPanelGoldGPH_Toggle() -- DESC: This toggles if the player wants to see the gold/hour stats -- ******************************************************************************************* +--]] function TitanPanelGoldGPH_Toggle() TitanToggleVar(TITAN_GOLD_ID, "DisplayGoldPerHour") @@ -844,10 +940,12 @@ function TitanPanelGoldGPH_Toggle() end end +--[[ -- ******************************************************************************************* -- NAME: TitanPanelGoldButton_ResetSession() -- DESC: Resets the current session -- ******************************************************************************************* +--]] function TitanPanelGoldButton_ResetSession() GOLD_STARTINGGOLD = GetMoney("player"); GOLD_SESSIONSTART = GetTime(); diff --git a/TitanGold/TitanGold.toc b/TitanGold/TitanGold.toc index 8453c1f..267e8d0 100644 --- a/TitanGold/TitanGold.toc +++ b/TitanGold/TitanGold.toc @@ -1,10 +1,10 @@ ## Interface: 90204 -## Title: Titan Panel [|cffeda55fGold|r] |cff00aa005.23.2.90204|r +## Title: Titan Panel [|cffeda55fGold|r] |cff00aa005.23.3.90204|r ## Notes: Keeps track of all gold held by a player's toons on a per server/faction basis. ## Author: Titan Panel Development Team (http://www.titanpanel.org) ## SavedVariables: GoldSave ## OptionalDeps: ## Dependencies: Titan -## Version: 5.23.2.90200 +## Version: 5.23.3.90200 ## X-Child-Of: Titan TitanGold.xml diff --git a/TitanLocation/TitanLocation.lua b/TitanLocation/TitanLocation.lua index 3d1bb26..057f0ad 100755 --- a/TitanLocation/TitanLocation.lua +++ b/TitanLocation/TitanLocation.lua @@ -18,8 +18,6 @@ local L = LibStub("AceLocale-3.0"):GetLocale("Titan", true); local AceTimer = LibStub("AceTimer-3.0"); local LocationTimer = nil; - -local FormatToUse = "" -- ******************************** Functions ******************************* --[[ @@ -113,7 +111,7 @@ function TitanPanelLocationButton_GetButtonText(id) if button.px == 0 and button.py == 0 then locationText = ""; else - locationText = format(FormatToUse, 100 * button.px, 100 * button.py) + locationText = format(TitanGetVar(TITAN_LOCATION_ID, "CoordsFormat"), 100 * button.px, 100 * button.py) end else locationText = ""; @@ -204,8 +202,6 @@ function TitanPanelLocationButton_OnEvent(self, event, ...) if not TitanGetVar(TITAN_LOCATION_ID, "ShowLocOnMiniMap") and MinimapBorderTop and MinimapBorderTop:IsShown() then TitanPanelLocationButton_LocOnMiniMap() end - - FormatToUse = TitanGetVar(TITAN_LOCATION_ID, "CoordsFormat") end TitanPanelLocationButton_UpdateZoneInfo(self); @@ -256,7 +252,7 @@ function TitanPanelLocationButton_OnClick(self, button) local activeWindow = ChatEdit_GetActiveWindow(); if ( activeWindow ) then local message = TitanUtils_ToString(self.zoneText).." ".. - format(FormatToUse, 100 * self.px, 100 * self.py); + format(TitanGetVar(TITAN_LOCATION_ID, "CoordsFormat"), 100 * self.px, 100 * self.py); activeWindow:Insert(message); end else @@ -337,30 +333,27 @@ function TitanPanelRightClickMenu_PrepareLocationMenu() info.text = L["TITAN_LOCATION_FORMAT_LABEL"]; info.func = function() TitanSetVar(TITAN_LOCATION_ID, "CoordsFormat", L["TITAN_LOCATION_FORMAT"]); - FormatToUse = L["TITAN_LOCATION_FORMAT"] TitanPanelButton_UpdateButton(TITAN_LOCATION_ID); end - info.checked = (FormatToUse == L["TITAN_LOCATION_FORMAT"]) + info.checked = (TitanGetVar(TITAN_LOCATION_ID, "CoordsFormat") == L["TITAN_LOCATION_FORMAT"]) TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); info = {}; info.text = L["TITAN_LOCATION_FORMAT2_LABEL"]; info.func = function() TitanSetVar(TITAN_LOCATION_ID, "CoordsFormat", L["TITAN_LOCATION_FORMAT2"]); - FormatToUse = L["TITAN_LOCATION_FORMAT2"] TitanPanelButton_UpdateButton(TITAN_LOCATION_ID); end - info.checked = (FormatToUse == L["TITAN_LOCATION_FORMAT2"]) + info.checked = (TitanGetVar(TITAN_LOCATION_ID, "CoordsFormat") == L["TITAN_LOCATION_FORMAT2"]) TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); info = {}; info.text = L["TITAN_LOCATION_FORMAT3_LABEL"]; info.func = function() TitanSetVar(TITAN_LOCATION_ID, "CoordsFormat", L["TITAN_LOCATION_FORMAT3"]); - FormatToUse = L["TITAN_LOCATION_FORMAT3"] TitanPanelButton_UpdateButton(TITAN_LOCATION_ID); end - info.checked = (FormatToUse == L["TITAN_LOCATION_FORMAT3"]) + info.checked = (TitanGetVar(TITAN_LOCATION_ID, "CoordsFormat") == L["TITAN_LOCATION_FORMAT3"]) TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel()); end return @@ -466,7 +459,7 @@ function TitanMapFrame_OnUpdate(self, elapsed) if self.px == 0 and self.py == 0 then playerLocationText = L["TITAN_LOCATION_NO_COORDS"] else - playerLocationText = format(FormatToUse, 100 * self.px, 100 * self.py); + playerLocationText = format(TitanGetVar(TITAN_LOCATION_ID, "CoordsFormat"), 100 * self.px, 100 * self.py); end TitanMapPlayerLocation:SetText(format(L["TITAN_LOCATION_MAP_PLAYER_COORDS_TEXT"], TitanUtils_GetHighlightText(playerLocationText))); @@ -483,7 +476,7 @@ function TitanMapFrame_OnUpdate(self, elapsed) end -- per the user requested format - cursorLocationText = format(FormatToUse, 100 * cx, 100 * cy); + cursorLocationText = format(TitanGetVar(TITAN_LOCATION_ID, "CoordsFormat"), 100 * cx, 100 * cy); if (TitanGetVar(TITAN_LOCATION_ID, "ShowCoordsOnMap")) then TitanMapCursorLocation:SetText(format(L["TITAN_LOCATION_MAP_CURSOR_COORDS_TEXT"], TitanUtils_GetHighlightText(cursorLocationText))); diff --git a/TitanLocation/TitanLocation.toc b/TitanLocation/TitanLocation.toc index 37aae91..817e682 100644 --- a/TitanLocation/TitanLocation.toc +++ b/TitanLocation/TitanLocation.toc @@ -1,10 +1,10 @@ ## Interface: 90204 -## Title: Titan Panel [|cffeda55fLocation|r] |cff00aa005.23.2.90204|r +## Title: Titan Panel [|cffeda55fLocation|r] |cff00aa005.23.3.90204|r ## Notes: Adds coordinates and location information to Titan Panel ## Author: Titan Panel Development Team (http://www.titanpanel.org) ## SavedVariables: ## OptionalDeps: ## Dependencies: Titan -## Version: 5.23.2.90200 +## Version: 5.23.3.90200 ## X-Child-Of: Titan TitanLocation.xml diff --git a/TitanLootType/TitanLootType.toc b/TitanLootType/TitanLootType.toc index 98a584c..6a0b99a 100644 --- a/TitanLootType/TitanLootType.toc +++ b/TitanLootType/TitanLootType.toc @@ -1,10 +1,10 @@ ## Interface: 90204 -## Title: Titan Panel [|cffeda55fLootType|r] |cff00aa005.23.2.90204|r +## Title: Titan Panel [|cffeda55fLootType|r] |cff00aa005.23.3.90204|r ## Notes: Adds group loot and instance difficulty information to Titan Panel ## Author: Titan Panel Development Team (http://www.titanpanel.org) ## SavedVariables: ## OptionalDeps: ## Dependencies: Titan -## Version: 5.23.2.90200 +## Version: 5.23.3.90200 ## X-Child-Of: Titan TitanLootType.xml diff --git a/TitanPerformance/TitanPerformance.toc b/TitanPerformance/TitanPerformance.toc index b6df8ed..bee4204 100644 --- a/TitanPerformance/TitanPerformance.toc +++ b/TitanPerformance/TitanPerformance.toc @@ -1,10 +1,10 @@ ## Interface: 90204 -## Title: Titan Panel [|cffeda55fPerformance|r] |cff00aa005.23.2.90204|r +## Title: Titan Panel [|cffeda55fPerformance|r] |cff00aa005.23.3.90204|r ## Notes: Adds FPS and Garbage collection information to Titan Panel ## Author: Titan Panel Development Team (http://www.titanpanel.org) ## SavedVariables: ## OptionalDeps: ## Dependencies: Titan -## Version: 5.23.2.90200 +## Version: 5.23.3.90200 ## X-Child-Of: Titan TitanPerformance.xml diff --git a/TitanRepair/TitanRepair.toc b/TitanRepair/TitanRepair.toc index 9a07288..0c3f822 100644 --- a/TitanRepair/TitanRepair.toc +++ b/TitanRepair/TitanRepair.toc @@ -1,10 +1,10 @@ ## Interface: 90204 -## Title: Titan Panel [|cffeda55fRepair|r] |cff00aa005.23.2.90204|r +## Title: Titan Panel [|cffeda55fRepair|r] |cff00aa005.23.3.90204|r ## Notes: Provides a configurable durability display. Also adds the ability to auto repair items and inventory at vendors ## Author: Titan Panel Development Team (http://www.titanpanel.org) ## SavedVariables: ## OptionalDeps: ## Dependencies: Titan -## Version: 5.23.2.90200 +## Version: 5.23.3.90200 ## X-Child-Of: Titan TitanRepair.xml diff --git a/TitanVolume/TitanVolume.toc b/TitanVolume/TitanVolume.toc index 1e168d2..001988c 100644 --- a/TitanVolume/TitanVolume.toc +++ b/TitanVolume/TitanVolume.toc @@ -1,10 +1,10 @@ ## Interface: 90204 -## Title: Titan Panel [|cffeda55fVolume|r] |cff00aa005.23.2.90204|r +## Title: Titan Panel [|cffeda55fVolume|r] |cff00aa005.23.3.90204|r ## Notes: Adds a volume control icon on your Titan Bar ## Author: Titan Panel Development Team (http://www.titanpanel.org) ## SavedVariables: ## OptionalDeps: ## Dependencies: Titan -## Version: 5.23.2.90200 +## Version: 5.23.3.90200 ## X-Child-Of: Titan TitanVolume.xml diff --git a/TitanXP/TitanXP.toc b/TitanXP/TitanXP.toc index 16f1f9b..ce8851d 100644 --- a/TitanXP/TitanXP.toc +++ b/TitanXP/TitanXP.toc @@ -1,10 +1,10 @@ ## Interface: 90204 -## Title: Titan Panel [|cffeda55fXP|r] |cff00aa005.23.2.90204|r +## Title: Titan Panel [|cffeda55fXP|r] |cff00aa005.23.3.90204|r ## Notes: Adds information to Titan Panel about XP earned and time to level ## Author: Titan Panel Development Team (http://www.titanpanel.org) ## SavedVariables: ## OptionalDeps: ## Dependencies: Titan -## Version: 5.23.2.90200 +## Version: 5.23.3.90200 ## X-Child-Of: Titan TitanXP.xml