From 9f330fb5639e2485d95dfa42eff185ecf333b6be Mon Sep 17 00:00:00 2001 From: Bunny67 Date: Sat, 6 Jun 2020 14:01:23 +0300 Subject: [PATCH] fix #9 --- WeakAuras/Transmission.lua | 24 +++++++++++------ WeakAuras/WeakAuras.lua | 18 ------------- .../AceGUIWidget-WeakAurasDisplayButton.lua | 26 ++----------------- 3 files changed, 18 insertions(+), 50 deletions(-) diff --git a/WeakAuras/Transmission.lua b/WeakAuras/Transmission.lua index 0b16751..684a034 100644 --- a/WeakAuras/Transmission.lua +++ b/WeakAuras/Transmission.lua @@ -167,15 +167,14 @@ local function filterFunc(_, event, msg, player, l, cs, t, flag, channelId, ...) end until(done) if newMsg ~= "" then - local trimmedPlayer = Ambiguate(player, "none") - if event == "CHAT_MSG_WHISPER" and not UnitInRaid(trimmedPlayer) and not UnitInParty(trimmedPlayer) then -- XXX: Need a guild check + if event == "CHAT_MSG_WHISPER" and not UnitInRaid(player) and not UnitInParty(player) then -- XXX: Need a guild check local _, num = BNGetNumFriends() for i=1, num do if C_BattleNet then -- introduced in 8.2.5 PTR local toon = C_BattleNet.GetFriendNumGameAccounts(i) for j=1, toon do local gameAccountInfo = C_BattleNet.GetFriendGameAccountInfo(i, j); - if gameAccountInfo.characterName == trimmedPlayer and gameAccountInfo.clientProgram == "WoW" then + if gameAccountInfo.characterName == player and gameAccountInfo.clientProgram == "WoW" then return false, newMsg, player, l, cs, t, flag, channelId, ...; -- Player is a real id friend, allow it end end @@ -183,7 +182,7 @@ local function filterFunc(_, event, msg, player, l, cs, t, flag, channelId, ...) local toon = BNGetNumFriendGameAccounts(i) for j=1, toon do local _, rName, rGame = BNGetFriendGameAccountInfo(i, j) - if rName == trimmedPlayer and rGame == "WoW" then + if rName == player and rGame == "WoW" then return false, newMsg, player, l, cs, t, flag, channelId, ...; -- Player is a real id friend, allow it end end @@ -630,6 +629,14 @@ hooksecurefunc("SetItemRef", function(link, text) end end); +local OriginalSetHyperlink = ItemRefTooltip.SetHyperlink +function ItemRefTooltip:SetHyperlink(link, ...) + if(link and link:sub(0, 11) == "garrmission") then + return; + end + return OriginalSetHyperlink(self, link, ...); +end + local compressedTablesCache = {} function TableToString(inTable, forChat) @@ -1799,7 +1806,8 @@ WeakAuras.ImportString = WeakAuras.Import local function crossRealmSendCommMessage(prefix, text, target, queueName, callbackFn, callbackArg) local chattype = "WHISPER" - if target and not UnitIsSameServer(target) then +--[[ + if target then if UnitInRaid(target) then chattype = "RAID" text = ("§§%s:%s"):format(target, text) @@ -1808,13 +1816,13 @@ local function crossRealmSendCommMessage(prefix, text, target, queueName, callba text = ("§§%s:%s"):format(target, text) end end +]] Comm:SendCommMessage(prefix, text, chattype, target, queueName, callbackFn, callbackArg) end local safeSenders = {} function RequestDisplay(characterName, displayName) safeSenders[characterName] = true - safeSenders[Ambiguate(characterName, "none")] = true local transmit = { m = "dR", d = displayName @@ -1847,7 +1855,7 @@ Comm:RegisterComm("WeakAurasProg", function(prefix, message, distribution, sende local dest, msg = string.match(message, "^§§(.+):(.+)$") if dest then local dName, dServer = string.match(dest, "^(.*)-(.*)$") - local myName, myServer = UnitFullName("player") + local myName, myServer = UnitName("player") if myName == dName and myServer == dServer then message = msg else @@ -1877,7 +1885,7 @@ Comm:RegisterComm("WeakAuras", function(prefix, message, distribution, sender) local dest, msg = string.match(message, "^§§([^:]+):(.+)$") if dest then local dName, dServer = string.match(dest, "^(.*)-(.*)$") - local myName, myServer = UnitFullName("player") + local myName, myServer = UnitName("player") if myName == dName and myServer == dServer then message = msg else diff --git a/WeakAuras/WeakAuras.lua b/WeakAuras/WeakAuras.lua index ad93167..7d04991 100644 --- a/WeakAuras/WeakAuras.lua +++ b/WeakAuras/WeakAuras.lua @@ -2810,7 +2810,6 @@ function WeakAuras.Modernize(data) ["Druid"] = "DRUID", ["Hunter"] = "HUNTER", ["Mage"] = "MAGE", - ["Monk"] = "MONK", ["Paladin"] = "PALADIN", ["Priest"] = "PRIEST", ["Rogue"] = "ROGUE", @@ -2948,23 +2947,6 @@ function WeakAuras.Modernize(data) end end - if (data.regionType == "progresstexture") then - if (not data.version or data.version < 2) then - if (data.orientation == "CLOCKWISE") then - if (data.inverse) then - data.startAngle, data.endAngle = 360 - data.endAngle, 360 - data.startAngle; - data.orientation = (data.orientation == "CLOCKWISE") and "ANTICLOCKWISE" or "CLOCKWISE"; - end - elseif (data.orientation == "ANTICLOCKWISE") then - data.startAngle, data.endAngle = 360 - data.endAngle, 360 - data.startAngle; - if (data.inverse) then - data.orientation = (data.orientation == "CLOCKWISE") and "ANTICLOCKWISE" or "CLOCKWISE"; - end - end - data.version = 2; - end - end - if (not data.activeTriggerMode) then data.activeTriggerMode = 0; end diff --git a/WeakAurasOptions/AceGUI-Widgets/AceGUIWidget-WeakAurasDisplayButton.lua b/WeakAurasOptions/AceGUI-Widgets/AceGUIWidget-WeakAurasDisplayButton.lua index d7b28ed..a728770 100644 --- a/WeakAurasOptions/AceGUI-Widgets/AceGUIWidget-WeakAurasDisplayButton.lua +++ b/WeakAurasOptions/AceGUI-Widgets/AceGUIWidget-WeakAurasDisplayButton.lua @@ -490,28 +490,6 @@ local function Show_DropIndicator(id) end end --- WORKAROUND --- Blizzard in its infinite wisdom did: --- * Force enable the profanity filter for the chinese region --- * Add a realm name's part to the profanity filter -function WeakAuras.ObsfuscateName(name) - if (GetCurrentRegion() == 5) then - local result = "" - for i = 1, #name do - local b = name:byte(i) - if (b >= 196 and i ~= 1) then - -- UTF8 Start byte - result = result .. string.char(46, b) - else - result = result .. string.char(b) - end - end - return result - else - return name - end -end - --[[----------------------------------------------------------------------------- Methods -------------------------------------------------------------------------------]] @@ -537,9 +515,9 @@ local methods = { local editbox = GetCurrentKeyBoardFocus(); if(editbox) then if (not fullName) then - local name, realm = UnitFullName("player") + local name, realm = UnitName("player") if realm then - fullName = name.."-".. WeakAuras.ObsfuscateName(realm) + fullName = name.."-"..realm else fullName = name end