From c44e3b207dc78440ab0abef877462eaecc111cc3 Mon Sep 17 00:00:00 2001 From: Xruptor Date: Sun, 25 Sep 2016 14:13:59 -0400 Subject: [PATCH] Cross-Realm guild fix and new option -Added an option to remove the XR and BNET identifiers in the tooltips. -Fixed an issue where if a person had characters within the same group of connected realms, it would cause issues with the guild count. That's because although they are in the same guild within the connected realms, they are still on separate servers. So in order to compensate for this, it's best just not to add any realm identifiers to guilds within the same connected-realm group. --- BagSync.lua | 26 ++++++++++++++++++++++---- BagSync.toc | 2 +- locale/enUS.lua | 1 + locale/koKR.lua | 3 +++ modules/config.lua | 10 ++++++++++ 5 files changed, 37 insertions(+), 5 deletions(-) diff --git a/BagSync.lua b/BagSync.lua index 8994206..d061db8 100644 --- a/BagSync.lua +++ b/BagSync.lua @@ -187,7 +187,8 @@ function BSYC:StartupDB() if self.options.enableBNetAccountItems == nil then self.options.enableBNetAccountItems = false end 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 + --setup the default colors if self.options.colors == nil then self.options.colors = {} end if self.options.colors.first == nil then self.options.colors.first = { r = 128/255, g = 1, b = 0 } end @@ -454,22 +455,39 @@ function BSYC:GetRealmTags(srcName, srcRealm, isGuild) if srcName == self.currentPlayer and self.options.enableTooltipGreenCheck then srcName = srcName.." "..ReadyCheck end + else + --sometimes a person has characters on multiple connected servers joined to the same guild. + --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. + --This is because it will be caught by previousGuilds{} + if srcRealm == self.currentRealm or self.crossRealmNames[srcRealm] then + --return non-modified guild name + return srcName + end end if self.db.realmkey[srcRealm] then fullRealmName = self.db.realmkey[srcRealm] end --second, if we have a realmkey with a true realm name then use it --add Cross-Realm and BNet identifiers to Characters not on same realm + local crossString = "" + local bnetString = "" + + if self.options.enableRealmIDTags then + crossString = "XR-" + bnetString = "BNet-" + end + if self.options.enableBNetAccountItems then if srcRealm and srcRealm ~= self.currentRealm then if not self.crossRealmNames[srcRealm] then - srcName = srcName.." "..rgbhex(self.options.colors.bnet).."[BNet-"..fullRealmName.."]|r" + srcName = srcName.." "..rgbhex(self.options.colors.bnet).."["..bnetString..fullRealmName.."]|r" else - srcName = srcName.." "..rgbhex(self.options.colors.cross).."[XR-"..fullRealmName.."]|r" + srcName = srcName.." "..rgbhex(self.options.colors.cross).."["..crossString..fullRealmName.."]|r" end end elseif self.options.enableCrossRealmsItems then if srcRealm and srcRealm ~= self.currentRealm then - srcName = srcName.." "..rgbhex(self.options.colors.cross).."[XR-"..fullRealmName.."]|r" + srcName = srcName.." "..rgbhex(self.options.colors.cross).."["..crossString..fullRealmName.."]|r" end end diff --git a/BagSync.toc b/BagSync.toc index 1a46419..8f30958 100644 --- a/BagSync.toc +++ b/BagSync.toc @@ -2,7 +2,7 @@ ## Title: BagSync ## Notes: BagSync tracks your characters items and displays it within tooltips. ## Author: Xruptor -## Version: 10.4 +## Version: 10.5 ## OptionalDeps: tekDebug ## SavedVariables: BagSyncDB, BagSyncOpt, BagSyncGUILD_DB, BagSyncCURRENCY_DB, BagSyncPROFESSION_DB, BagSyncBLACKLIST_DB, BagSync_REALMKEY diff --git a/locale/enUS.lua b/locale/enUS.lua index abe2983..c1c72cb 100644 --- a/locale/enUS.lua +++ b/locale/enUS.lua @@ -88,6 +88,7 @@ L.DisplayCrossRealm = "Display Cross-Realms characters." L.DisplayBNET = "Display Battle.Net Account characters |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.ColorPrimary = "Primary BagSync tooltip color." L.ColorSecondary = "Secondary BagSync tooltip color." L.ColorTotal = "BagSync [Total] tooltip color." diff --git a/locale/koKR.lua b/locale/koKR.lua index ebb40e1..9cac93d 100644 --- a/locale/koKR.lua +++ b/locale/koKR.lua @@ -4,6 +4,8 @@ if not L then return end --PLEASE LOOK AT enUS.lua for a complete localization list +--special thanks to WetU @ GitHub + L.TooltipBag = "가방:" L.TooltipBank = "은행:" L.TooltipEquip = "착용중:" @@ -90,6 +92,7 @@ L.DisplayCrossRealm = "다른 서버 캐릭터의 아이템을 표시합니다." L.DisplayBNET = "Battle.Net 계정 캐릭터의 아이템을 표시합니다 |cFFDF2B2B(권장하지 않음)|r." L.DisplayItemID = "툴팁에 아이템ID를 표시합니다." L.DisplayGreenCheck = "현재 캐릭터 이름 옆에 %s를 표시합니다." +L.DisplayRealmIDTags = "서버 식별자 |cffff7d0a[XR]|r 과 |cff3587ff[BNet]|r을 표시합니다." L.ColorPrimary = "주 BagSync 툴팁 색상." L.ColorSecondary = "보조 BagSync 툴팁 색상." L.ColorTotal = "BagSync [총] 툴팁 색상." diff --git a/modules/config.lua b/modules/config.lua index b415df3..d550a53 100644 --- a/modules/config.lua +++ b/modules/config.lua @@ -287,6 +287,16 @@ options.args.display = { set = set, arg = "display.enableTooltipGreenCheck", }, + realmidtags = { + order = 13, + type = "toggle", + name = L.DisplayRealmIDTags, + width = "full", + descStyle = "hide", + get = get, + set = set, + arg = "display.enableRealmIDTags", + }, }, } -- 1.7.9.5