From fb018f70ea425417d388270ab53165fcc6900ac0 Mon Sep 17 00:00:00 2001 From: Xruptor Date: Wed, 28 Sep 2016 09:52:17 -0400 Subject: [PATCH] Bug fixes and new config options -Added a new option to replace Server names in the tooltips with astricks. -Added a new option to shorten the server names in the tooltips. -Fixed a bug where the gold display tooltip was not using class colors. -Changed a few of the locale text. I want to start using the XR and BNET tags to reference cross-realm and battle.net features. It makes it easier when making config options. --- BagSync.lua | 11 ++++++++++- locale/deDE.lua | 4 ++-- locale/enUS.lua | 6 ++++-- locale/esES.lua | 4 ++-- locale/koKR.lua | 8 +++++--- modules/config.lua | 20 ++++++++++++++++++++ 6 files changed, 43 insertions(+), 10 deletions(-) diff --git a/BagSync.lua b/BagSync.lua index b85257c..c456345 100644 --- a/BagSync.lua +++ b/BagSync.lua @@ -188,6 +188,8 @@ function BSYC:StartupDB() if self.options.enableTooltipItemID == nil then self.options.enableTooltipItemID = false end if self.options.enableTooltipGreenCheck == nil then self.options.enableTooltipGreenCheck = true end if self.options.enableRealmIDTags == nil then self.options.enableRealmIDTags = true end + if self.options.enableRealmAstrickName == nil then self.options.enableRealmAstrickName = false end + if self.options.enableRealmShortName == nil then self.options.enableRealmShortName = false end --setup the default colors if self.options.colors == nil then self.options.colors = {} end @@ -463,7 +465,7 @@ function BSYC:GetRealmTags(srcName, srcRealm, isGuild) --the guild information is saved twice because although the guild is on the connected server, the characters themselves are on different servers. --too compensate for this, lets check the connected server and return only the guild name. So it doesn't get processed twice. for k, v in pairs(self.crossRealmNames) do - --check to see if the guild exists already on a connected realm + --check to see if the guild exists already on a connected realm and not the current realm if k ~= srcRealm and self.db.guild[k] and self.db.guild[k][srcName] then --return non-modified guild name, we only want the guild listed once for the cross-realm return srcName @@ -480,6 +482,12 @@ function BSYC:GetRealmTags(srcName, srcRealm, isGuild) bnetString = "BNet-" end + if self.options.enableRealmAstrickName then + fullRealmName = "*" + elseif self.options.enableRealmShortName then + fullRealmName = string.sub(fullRealmName, 1, 5) --only use 5 characters of the server name + end + if self.options.enableBNetAccountItems then if srcRealm and srcRealm ~= self.currentRealm then if not self.crossRealmNames[srcRealm] then @@ -792,6 +800,7 @@ function BSYC:ShowMoneyTooltip(objTooltip) for k, v in pairs(xDB) do if v.gold then k = self:GetRealmTags(k, v.realm) + k = self:GetClassColor(k or "Unknown", v.class) table.insert(usrData, { name=k, gold=v.gold } ) end end diff --git a/locale/deDE.lua b/locale/deDE.lua index 432ce3a..90a51c3 100644 --- a/locale/deDE.lua +++ b/locale/deDE.lua @@ -54,5 +54,5 @@ L.DisplayClassColor = "Zeige Klassenfarben für Charaktere" L.DisplayTooltipOnlySearch = "Zeige modifizierte Tooltips NUR im BagSync Suchfenster." L.EnableBagSyncTooltip = "Aktiviere BagSync Tooltips" L.DisplayLineSeperator = "Aktiviere eine leere Linie als Seperator über der BagSync Tooltip Anzeige." -L.DisplayCrossRealm = "Altiviere Items für Cross-Realm Charaktere." -L.DisplayBNET = "Aktiviere Items für die aktuellen Battle.net Account Charaktere |cFFDF2B2B(Nicht empfohlen!)|r." +L.DisplayCrossRealm = "Altiviere Items für Cross-Realm Charaktere. |cffff7d0a[XR]|r" +L.DisplayBNET = "Aktiviere Battle.net Account Charaktere. |cff3587ff[BNet]|r |cFFDF2B2B(Nicht empfohlen!)|r." diff --git a/locale/enUS.lua b/locale/enUS.lua index c1c72cb..43aeb47 100644 --- a/locale/enUS.lua +++ b/locale/enUS.lua @@ -84,11 +84,13 @@ L.DisplayFaction = "Display items for both factions (Alliance/Horde)." L.DisplayClassColor = "Display class colors for characters." L.DisplayTooltipOnlySearch = "Display BagSync tooltip ONLY in the search window." L.DisplayLineSeperator = "Display empty line seperator." -L.DisplayCrossRealm = "Display Cross-Realms characters." -L.DisplayBNET = "Display Battle.Net Account characters |cFFDF2B2B(Not Recommended)|r." +L.DisplayCrossRealm = "Display Cross-Realms characters. |cffff7d0a[XR]|r" +L.DisplayBNET = "Display Battle.Net Account characters. |cff3587ff[BNet]|r |cFFDF2B2B(Not Recommended)|r." L.DisplayItemID = "Display ItemID in tooltip." L.DisplayGreenCheck = "Display %s next to current character name." L.DisplayRealmIDTags = "Display |cffff7d0a[XR]|r and |cff3587ff[BNet]|r realm identifiers." +L.DisplayRealmAstrick = "Display [*] instead of server names for |cffff7d0a[XR]|r and |cff3587ff[BNet]|r." +L.DisplayShortRealmName = "Display short realm names for |cffff7d0a[XR]|r and |cff3587ff[BNet]|r." L.ColorPrimary = "Primary BagSync tooltip color." L.ColorSecondary = "Secondary BagSync tooltip color." L.ColorTotal = "BagSync [Total] tooltip color." diff --git a/locale/esES.lua b/locale/esES.lua index 7d539bc..2c9b5b3 100644 --- a/locale/esES.lua +++ b/locale/esES.lua @@ -63,8 +63,8 @@ L.DisplayClassColor = "Mostrar los colores de clase para los personajes." L.DisplayTooltipOnlySearch = "Mostrar descripcion de BagSync SÓLO en la ventana de búsqueda." L.EnableBagSyncTooltip = "Activar Bagsync en las descripciones" L.DisplayLineSeperator = "Mostrar un separador de línea vacío." -L.DisplayCrossRealm = "Mostrar objetos de personaje entre reinos." -L.DisplayBNET = "Mostrar personajes de la cuenta de Battle.net |cFFDF2B2B(No recomendado)|r." +L.DisplayCrossRealm = "Mostrar objetos de personaje entre reinos. |cffff7d0a[XR]|r" +L.DisplayBNET = "Mostrar personajes de la cuenta de Battle.net. |cff3587ff[BNet]|r |cFFDF2B2B(No recomendado)|r." L.ColorPrimary = "Color primario de BagSync en las descripciones." L.ColorSecondary = "Color secundario de BagSync en las descripciones." L.ColorTotal = "Color para mostar [Total] en la descripción de BagSync." diff --git a/locale/koKR.lua b/locale/koKR.lua index 9cac93d..ec24861 100644 --- a/locale/koKR.lua +++ b/locale/koKR.lua @@ -88,11 +88,13 @@ L.DisplayFaction = "양 진영 아이템을 표시합니다 (얼라이언스/호 L.DisplayClassColor = "캐릭터에 직업 색상을 표시합니다." L.DisplayTooltipOnlySearch = "검색 창에만 BagSync 툴팁을 표시합니다." L.DisplayLineSeperator = "빈 줄로 분리하여 표시합니다." -L.DisplayCrossRealm = "다른 서버 캐릭터의 아이템을 표시합니다." -L.DisplayBNET = "Battle.Net 계정 캐릭터의 아이템을 표시합니다 |cFFDF2B2B(권장하지 않음)|r." +L.DisplayCrossRealm = "다른 서버 캐릭터의 아이템을 표시합니다. |cffff7d0a[타섭]|r" +L.DisplayBNET = "Battle.Net 계정 캐릭터의 아이템을 표시합니다. |cff3587ff[BNet]|r |cFFDF2B2B(권장하지 않음)|r." L.DisplayItemID = "툴팁에 아이템ID를 표시합니다." L.DisplayGreenCheck = "현재 캐릭터 이름 옆에 %s를 표시합니다." -L.DisplayRealmIDTags = "서버 식별자 |cffff7d0a[XR]|r 과 |cff3587ff[BNet]|r을 표시합니다." +L.DisplayRealmIDTags = "서버 식별자 |cffff7d0a[타섭]|r과 |cff3587ff[BNet]|r을 표시합니다." +L.DisplayRealmAstrick = "|cffff7d0a[타섭]|r과 |cff3587ff[BNet]|r 서버 이름 대신 [*]을 표시합니다." +L.DisplayShortRealmName = "|cffff7d0a[타섭]|r과 |cff3587ff[BNet]|r 서버 이름을 축약해서 표시합니다." L.ColorPrimary = "주 BagSync 툴팁 색상." L.ColorSecondary = "보조 BagSync 툴팁 색상." L.ColorTotal = "BagSync [총] 툴팁 색상." diff --git a/modules/config.lua b/modules/config.lua index d550a53..bc42e61 100644 --- a/modules/config.lua +++ b/modules/config.lua @@ -297,6 +297,26 @@ options.args.display = { set = set, arg = "display.enableRealmIDTags", }, + realmastrick = { + order = 14, + type = "toggle", + name = L.DisplayRealmAstrick, + width = "full", + descStyle = "hide", + get = get, + set = set, + arg = "display.enableRealmAstrickName", + }, + realmshortname = { + order = 15, + type = "toggle", + name = L.DisplayShortRealmName, + width = "full", + descStyle = "hide", + get = get, + set = set, + arg = "display.enableRealmShortName", + }, }, } -- 1.7.9.5