From 87e43e9a1cf6ba5443c4f3cdcf1bdc1ec7a83a17 Mon Sep 17 00:00:00 2001 From: Bunny67 Date: Sat, 23 Jun 2018 12:32:10 +0300 Subject: [PATCH] update --- ElvUI/Core/distributor.lua | 16 +++++----- ElvUI/Libraries/AceEvent-3.0/AceEvent-3.0.lua | 2 +- ElvUI/Libraries/oUF/colors.lua | 6 ++-- ElvUI/Modules/ActionBars/ActionBars.lua | 4 --- ElvUI/Modules/ActionBars/BarPet.lua | 6 ++-- ElvUI/Modules/Chat/Chat.lua | 14 ++++----- ElvUI/Modules/DataBars/DataBars.lua | 6 ++-- ElvUI/Modules/Misc/AFK.lua | 3 +- ElvUI/Modules/Misc/Loot.lua | 4 +-- ElvUI/Modules/Misc/LootRoll.lua | 31 ++++++------------- ElvUI/Modules/Misc/Misc.lua | 10 +++--- 11 files changed, 42 insertions(+), 60 deletions(-) diff --git a/ElvUI/Core/distributor.lua b/ElvUI/Core/distributor.lua index 48b9579..c3db5b6 100644 --- a/ElvUI/Core/distributor.lua +++ b/ElvUI/Core/distributor.lua @@ -84,17 +84,17 @@ function D:Distribute(target, otherServer, isGlobal) E:StaticPopup_Show("DISTRIBUTOR_WAITING") end -function D:CHAT_MSG_ADDON(_, _, message, _, sender) - if not Downloads[sender] then return end - local cur = len(message) - local max = Downloads[sender].length - Downloads[sender].current = Downloads[sender].current + cur +function D:CHAT_MSG_ADDON() + if not Downloads[arg4] then return end + local cur = len(arg2) + local max = Downloads[arg4].length + Downloads[arg4].current = Downloads[arg4].current + cur - if Downloads[sender].current > max then - Downloads[sender].current = max + if Downloads[arg4].current > max then + Downloads[arg4].current = max end - self.statusBar:SetValue(Downloads[sender].current) + self.statusBar:SetValue(Downloads[arg4].current) end function D:OnCommReceived(prefix, msg, dist, sender) diff --git a/ElvUI/Libraries/AceEvent-3.0/AceEvent-3.0.lua b/ElvUI/Libraries/AceEvent-3.0/AceEvent-3.0.lua index 510e088..9eb0e36 100644 --- a/ElvUI/Libraries/AceEvent-3.0/AceEvent-3.0.lua +++ b/ElvUI/Libraries/AceEvent-3.0/AceEvent-3.0.lua @@ -120,7 +120,7 @@ end -- the user have always access to them, so we save the table cost here local events = AceEvent.events AceEvent.frame:SetScript("OnEvent", function() - events:Fire(event, arg1, arg2, arg3, arg4, arg5) + events:Fire(event) end) --- Finally: upgrade our old embeds diff --git a/ElvUI/Libraries/oUF/colors.lua b/ElvUI/Libraries/oUF/colors.lua index c7c3537..9d104c1 100644 --- a/ElvUI/Libraries/oUF/colors.lua +++ b/ElvUI/Libraries/oUF/colors.lua @@ -46,10 +46,10 @@ if(not customClassColors()) then local eventHandler = CreateFrame('Frame') eventHandler:RegisterEvent('ADDON_LOADED') - eventHandler:SetScript('OnEvent', function(self) + eventHandler:SetScript('OnEvent', function() if(customClassColors()) then - self:UnregisterEvent('ADDON_LOADED') - self:SetScript('OnEvent', nil) + this:UnregisterEvent('ADDON_LOADED') + this:SetScript('OnEvent', nil) end end) end diff --git a/ElvUI/Modules/ActionBars/ActionBars.lua b/ElvUI/Modules/ActionBars/ActionBars.lua index 6101992..05065e6 100644 --- a/ElvUI/Modules/ActionBars/ActionBars.lua +++ b/ElvUI/Modules/ActionBars/ActionBars.lua @@ -380,10 +380,6 @@ function AB:DisableBlizzard() for _, element in pairs(elements) do if element:GetObjectType() == "Frame" then element:UnregisterAllEvents() - - if element == MainMenuBarArtFrame then - element:RegisterEvent("CURRENCY_DISPLAY_UPDATE") - end end if element ~= MainMenuBar then diff --git a/ElvUI/Modules/ActionBars/BarPet.lua b/ElvUI/Modules/ActionBars/BarPet.lua index a21aa82..b5a3aee 100644 --- a/ElvUI/Modules/ActionBars/BarPet.lua +++ b/ElvUI/Modules/ActionBars/BarPet.lua @@ -19,9 +19,9 @@ local NUM_PET_ACTION_SLOTS = NUM_PET_ACTION_SLOTS local bar = CreateFrame("Frame", "ElvUI_BarPet", E.UIParent) bar:SetFrameStrata("LOW") -function AB:UpdatePet(event, unit) - if ((event == "UNIT_FLAGS" or event == "UNIT_AURA") and unit ~= "pet") then return end - if (event == "UNIT_PET" and unit ~= "player") then return end +function AB:UpdatePet(event) + if ((event == "UNIT_FLAGS" or event == "UNIT_AURA") and arg1 ~= "pet") then return end + if (event == "UNIT_PET" and arg1 ~= "player") then return end local petActionButton, petActionIcon, petAutoCastableTexture, petAutoCastShine local petActionsUsable = GetPetActionsUsable() diff --git a/ElvUI/Modules/Chat/Chat.lua b/ElvUI/Modules/Chat/Chat.lua index 86ef2df..ca8d815 100644 --- a/ElvUI/Modules/Chat/Chat.lua +++ b/ElvUI/Modules/Chat/Chat.lua @@ -1128,9 +1128,7 @@ local function PrepareMessage(author, message) return format("%s%s", strupper(author), message) end -function CH:ChatThrottleHandler(_, ...) - local arg1, arg2 = unpack(arg) - +function CH:ChatThrottleHandler() if arg2 and arg2 ~= "" then local message = PrepareMessage(arg2, arg1) if msgList[message] == nil then @@ -1440,14 +1438,14 @@ function CH:DelayGuildMOTD() end) end -function CH:SaveChatHistory(event, ...) +function CH:SaveChatHistory(event) if not self.db.chatHistory then return end local data = ElvCharacterDB.ChatHistoryLog if self.db.throttleInterval ~= 0 and (event == "CHAT_MESSAGE_SAY" or event == "CHAT_MESSAGE_YELL" or event == "CHAT_MSG_CHANNEL") then - self:ChatThrottleHandler(event, unpack(arg)) + self:ChatThrottleHandler(event) - local message, author = unpack(arg) + local message, author = arg1, arg2 local msg = PrepareMessage(author, message) if author and author ~= PLAYER_NAME and msgList[msg] then if difftime(time(), msgTime[msg]) <= CH.db.throttleInterval then @@ -1457,8 +1455,8 @@ function CH:SaveChatHistory(event, ...) end local temp = {} - for i = 1, getn(arg) do - temp[i] = select(i, unpack(arg)) or false + for i = 1, 10 do + temp[i] = _G["arg"..i] or false end if getn(temp) > 0 then diff --git a/ElvUI/Modules/DataBars/DataBars.lua b/ElvUI/Modules/DataBars/DataBars.lua index 646ef34..a93773a 100644 --- a/ElvUI/Modules/DataBars/DataBars.lua +++ b/ElvUI/Modules/DataBars/DataBars.lua @@ -41,10 +41,10 @@ function mod:UpdateDataBarDimensions() self:UpdateReputationDimensions() end -function mod:PLAYER_LEVEL_UP(level, level2) +function mod:PLAYER_LEVEL_UP() local maxLevel = 60 - if (level ~= maxLevel or not self.db.experience.hideAtMaxLevel) and self.db.experience.enable then - self:UpdateExperience("PLAYER_LEVEL_UP", level) + if (arg1 ~= maxLevel or not self.db.experience.hideAtMaxLevel) and self.db.experience.enable then + self:UpdateExperience("PLAYER_LEVEL_UP", arg1) else self.expBar:Hide() end diff --git a/ElvUI/Modules/Misc/AFK.lua b/ElvUI/Modules/Misc/AFK.lua index 4500015..204f6be 100644 --- a/ElvUI/Modules/Misc/AFK.lua +++ b/ElvUI/Modules/Misc/AFK.lua @@ -153,7 +153,7 @@ function AFK:SetAFK(status) end end -function AFK:OnEvent(event, ...) +function AFK:OnEvent(event) if event == "PLAYER_REGEN_DISABLED" or event == "UPDATE_BATTLEFIELD_STATUS" then if event == "UPDATE_BATTLEFIELD_STATUS" then local status, _, instanceID @@ -163,7 +163,6 @@ function AFK:OnEvent(event, ...) status = status end end - local status = status if status == "confirm" then self:SetAFK(false) end diff --git a/ElvUI/Modules/Misc/Loot.lua b/ElvUI/Modules/Misc/Loot.lua index 483caab..ef744a2 100644 --- a/ElvUI/Modules/Misc/Loot.lua +++ b/ElvUI/Modules/Misc/Loot.lua @@ -167,11 +167,11 @@ function M:UPDATE_MASTER_LOOT_LIST() UIDropDownMenu_Refresh(GroupLootDropDown) end -function M:LOOT_OPENED(_, autoLoot) +function M:LOOT_OPENED() lootFrame:Show() if not lootFrame:IsShown() then - CloseLoot(autoLoot == 0) + CloseLoot(arg2 == 0) end local items = GetNumLootItems() diff --git a/ElvUI/Modules/Misc/LootRoll.lua b/ElvUI/Modules/Misc/LootRoll.lua index 955f3ba..ca1c55e 100644 --- a/ElvUI/Modules/Misc/LootRoll.lua +++ b/ElvUI/Modules/Misc/LootRoll.lua @@ -24,7 +24,6 @@ local RAID_CLASS_COLORS = RAID_CLASS_COLORS local pos = "TOP" local cancelled_rolls = {} local FRAME_WIDTH, FRAME_HEIGHT = 328, 28 -local dummy = CreateFrame("FRAME", nil, E.UIParent) M.RollBars = {} local locale = GetLocale() @@ -247,20 +246,20 @@ local function GetFrame() return f end -function M:START_LOOT_ROLL(_, rollID, time) +function M:START_LOOT_ROLL() if cancelled_rolls[rollID] then return end local f = GetFrame() - f.rollID = rollID - f.time = time + f.rollID = arg1 + f.time = arg2 for i in pairs(f.rolls) do f.rolls[i] = nil end f.need:SetText(0) f.greed:SetText(0) f.pass:SetText(0) - local texture, name, count, quality, bindOnPickUp = GetLootRollItemInfo(rollID) + local texture, name, count, quality, bindOnPickUp = GetLootRollItemInfo(arg1) f.button.icon:SetTexture(texture) - f.button.link = GetLootRollItemLink(rollID) + f.button.link = GetLootRollItemLink(arg1) f.needbutt:Enable() f.greedbutt:Enable() @@ -284,7 +283,7 @@ function M:START_LOOT_ROLL(_, rollID, time) f:Show() if E.db.general.autoRoll and UnitLevel("player") == MAX_PLAYER_LEVEL and quality == 2 and not bindOnPickUp then - RollOnLoot(rollID, 2) + RollOnLoot(arg1, 2) end end @@ -301,8 +300,8 @@ function M:ParseRollChoice(msg) end end -function M:CHAT_MSG_LOOT(_, msg) - local playername, itemname, rolltype = self:ParseRollChoice(msg) +function M:CHAT_MSG_LOOT() + local playername, itemname, rolltype = self:ParseRollChoice(arg1) if playername and itemname and rolltype then local class = select(2, UnitClass(playername)) for _, f in ipairs(M.RollBars) do @@ -318,18 +317,8 @@ end function M:LoadLootRoll() if not E.private.general.lootRoll then return end - dummy:RegisterEvent("START_LOOT_ROLL") - -- dummy:RegisterEvent("CHAT_MSG_LOOT") - dummy:SetScript("OnEvent", function() - if event == "START_LOOT_ROLL" then - M:START_LOOT_ROLL("START_LOOT_ROLL", arg1, arg2) - elseif event == "CHAT_MSG_LOOT" then - M:CHAT_MSG_LOOT("CHAT_MSG_LOOT", arg1) - end - end) - - -- self:RegisterEvent("CHAT_MSG_LOOT") - -- self:RegisterEvent("START_LOOT_ROLL") + self:RegisterEvent("START_LOOT_ROLL") + self:RegisterEvent("CHAT_MSG_LOOT") UIParent:UnregisterEvent("START_LOOT_ROLL") UIParent:UnregisterEvent("CANCEL_LOOT_ROLL") end \ No newline at end of file diff --git a/ElvUI/Modules/Misc/Misc.lua b/ElvUI/Modules/Misc/Misc.lua index ec34fb8..f269850 100644 --- a/ElvUI/Modules/Misc/Misc.lua +++ b/ElvUI/Modules/Misc/Misc.lua @@ -113,16 +113,16 @@ function M:DisbandRaidGroup() LeaveParty() end -function M:PVPMessageEnhancement(_, msg) +function M:PVPMessageEnhancement() if not E.db.general.enhancedPvpMessages then return end local _, instanceType = IsInInstance() if instanceType == "pvp" then - RaidNotice_AddMessage(RaidBossEmoteFrame, msg, ChatTypeInfo["RAID_BOSS_EMOTE"]) + RaidNotice_AddMessage(RaidBossEmoteFrame, arg1, ChatTypeInfo["RAID_BOSS_EMOTE"]) end end local hideStatic = false -function M:AutoInvite(event, leaderName) +function M:AutoInvite(event) if not E.db.general.autoAcceptInvite then return end if event == "PARTY_INVITE_REQUEST" then @@ -137,7 +137,7 @@ function M:AutoInvite(event, leaderName) for friendIndex = 1, numFriends do local friendName = gsub(GetFriendInfo(friendIndex), "-.*", "") - if friendName == leaderName then + if friendName == arg1 then AcceptGroup() inGroup = true break @@ -147,7 +147,7 @@ function M:AutoInvite(event, leaderName) if not inGroup then for guildIndex = 1, GetNumGuildMembers(true) do local guildMemberName = gsub(GetGuildRosterInfo(guildIndex), "-.*", "") - if guildMemberName == leaderName then + if guildMemberName == arg1 then AcceptGroup() inGroup = true break