This commit is contained in:
Bunny67
2018-06-23 12:32:10 +03:00
parent aed8bec10e
commit 87e43e9a1c
11 changed files with 42 additions and 60 deletions
+8 -8
View File
@@ -84,17 +84,17 @@ function D:Distribute(target, otherServer, isGlobal)
E:StaticPopup_Show("DISTRIBUTOR_WAITING") E:StaticPopup_Show("DISTRIBUTOR_WAITING")
end end
function D:CHAT_MSG_ADDON(_, _, message, _, sender) function D:CHAT_MSG_ADDON()
if not Downloads[sender] then return end if not Downloads[arg4] then return end
local cur = len(message) local cur = len(arg2)
local max = Downloads[sender].length local max = Downloads[arg4].length
Downloads[sender].current = Downloads[sender].current + cur Downloads[arg4].current = Downloads[arg4].current + cur
if Downloads[sender].current > max then if Downloads[arg4].current > max then
Downloads[sender].current = max Downloads[arg4].current = max
end end
self.statusBar:SetValue(Downloads[sender].current) self.statusBar:SetValue(Downloads[arg4].current)
end end
function D:OnCommReceived(prefix, msg, dist, sender) function D:OnCommReceived(prefix, msg, dist, sender)
@@ -120,7 +120,7 @@ end
-- the user have always access to them, so we save the table cost here -- the user have always access to them, so we save the table cost here
local events = AceEvent.events local events = AceEvent.events
AceEvent.frame:SetScript("OnEvent", function() AceEvent.frame:SetScript("OnEvent", function()
events:Fire(event, arg1, arg2, arg3, arg4, arg5) events:Fire(event)
end) end)
--- Finally: upgrade our old embeds --- Finally: upgrade our old embeds
+3 -3
View File
@@ -46,10 +46,10 @@ if(not customClassColors()) then
local eventHandler = CreateFrame('Frame') local eventHandler = CreateFrame('Frame')
eventHandler:RegisterEvent('ADDON_LOADED') eventHandler:RegisterEvent('ADDON_LOADED')
eventHandler:SetScript('OnEvent', function(self) eventHandler:SetScript('OnEvent', function()
if(customClassColors()) then if(customClassColors()) then
self:UnregisterEvent('ADDON_LOADED') this:UnregisterEvent('ADDON_LOADED')
self:SetScript('OnEvent', nil) this:SetScript('OnEvent', nil)
end end
end) end)
end end
-4
View File
@@ -380,10 +380,6 @@ function AB:DisableBlizzard()
for _, element in pairs(elements) do for _, element in pairs(elements) do
if element:GetObjectType() == "Frame" then if element:GetObjectType() == "Frame" then
element:UnregisterAllEvents() element:UnregisterAllEvents()
if element == MainMenuBarArtFrame then
element:RegisterEvent("CURRENCY_DISPLAY_UPDATE")
end
end end
if element ~= MainMenuBar then if element ~= MainMenuBar then
+3 -3
View File
@@ -19,9 +19,9 @@ local NUM_PET_ACTION_SLOTS = NUM_PET_ACTION_SLOTS
local bar = CreateFrame("Frame", "ElvUI_BarPet", E.UIParent) local bar = CreateFrame("Frame", "ElvUI_BarPet", E.UIParent)
bar:SetFrameStrata("LOW") bar:SetFrameStrata("LOW")
function AB:UpdatePet(event, unit) function AB:UpdatePet(event)
if ((event == "UNIT_FLAGS" or event == "UNIT_AURA") and unit ~= "pet") then return end if ((event == "UNIT_FLAGS" or event == "UNIT_AURA") and arg1 ~= "pet") then return end
if (event == "UNIT_PET" and unit ~= "player") then return end if (event == "UNIT_PET" and arg1 ~= "player") then return end
local petActionButton, petActionIcon, petAutoCastableTexture, petAutoCastShine local petActionButton, petActionIcon, petAutoCastableTexture, petAutoCastShine
local petActionsUsable = GetPetActionsUsable() local petActionsUsable = GetPetActionsUsable()
+6 -8
View File
@@ -1128,9 +1128,7 @@ local function PrepareMessage(author, message)
return format("%s%s", strupper(author), message) return format("%s%s", strupper(author), message)
end end
function CH:ChatThrottleHandler(_, ...) function CH:ChatThrottleHandler()
local arg1, arg2 = unpack(arg)
if arg2 and arg2 ~= "" then if arg2 and arg2 ~= "" then
local message = PrepareMessage(arg2, arg1) local message = PrepareMessage(arg2, arg1)
if msgList[message] == nil then if msgList[message] == nil then
@@ -1440,14 +1438,14 @@ function CH:DelayGuildMOTD()
end) end)
end end
function CH:SaveChatHistory(event, ...) function CH:SaveChatHistory(event)
if not self.db.chatHistory then return end if not self.db.chatHistory then return end
local data = ElvCharacterDB.ChatHistoryLog 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 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) local msg = PrepareMessage(author, message)
if author and author ~= PLAYER_NAME and msgList[msg] then if author and author ~= PLAYER_NAME and msgList[msg] then
if difftime(time(), msgTime[msg]) <= CH.db.throttleInterval then if difftime(time(), msgTime[msg]) <= CH.db.throttleInterval then
@@ -1457,8 +1455,8 @@ function CH:SaveChatHistory(event, ...)
end end
local temp = {} local temp = {}
for i = 1, getn(arg) do for i = 1, 10 do
temp[i] = select(i, unpack(arg)) or false temp[i] = _G["arg"..i] or false
end end
if getn(temp) > 0 then if getn(temp) > 0 then
+3 -3
View File
@@ -41,10 +41,10 @@ function mod:UpdateDataBarDimensions()
self:UpdateReputationDimensions() self:UpdateReputationDimensions()
end end
function mod:PLAYER_LEVEL_UP(level, level2) function mod:PLAYER_LEVEL_UP()
local maxLevel = 60 local maxLevel = 60
if (level ~= maxLevel or not self.db.experience.hideAtMaxLevel) and self.db.experience.enable then if (arg1 ~= maxLevel or not self.db.experience.hideAtMaxLevel) and self.db.experience.enable then
self:UpdateExperience("PLAYER_LEVEL_UP", level) self:UpdateExperience("PLAYER_LEVEL_UP", arg1)
else else
self.expBar:Hide() self.expBar:Hide()
end end
+1 -2
View File
@@ -153,7 +153,7 @@ function AFK:SetAFK(status)
end end
end end
function AFK:OnEvent(event, ...) function AFK:OnEvent(event)
if event == "PLAYER_REGEN_DISABLED" or event == "UPDATE_BATTLEFIELD_STATUS" then if event == "PLAYER_REGEN_DISABLED" or event == "UPDATE_BATTLEFIELD_STATUS" then
if event == "UPDATE_BATTLEFIELD_STATUS" then if event == "UPDATE_BATTLEFIELD_STATUS" then
local status, _, instanceID local status, _, instanceID
@@ -163,7 +163,6 @@ function AFK:OnEvent(event, ...)
status = status status = status
end end
end end
local status = status
if status == "confirm" then if status == "confirm" then
self:SetAFK(false) self:SetAFK(false)
end end
+2 -2
View File
@@ -167,11 +167,11 @@ function M:UPDATE_MASTER_LOOT_LIST()
UIDropDownMenu_Refresh(GroupLootDropDown) UIDropDownMenu_Refresh(GroupLootDropDown)
end end
function M:LOOT_OPENED(_, autoLoot) function M:LOOT_OPENED()
lootFrame:Show() lootFrame:Show()
if not lootFrame:IsShown() then if not lootFrame:IsShown() then
CloseLoot(autoLoot == 0) CloseLoot(arg2 == 0)
end end
local items = GetNumLootItems() local items = GetNumLootItems()
+10 -21
View File
@@ -24,7 +24,6 @@ local RAID_CLASS_COLORS = RAID_CLASS_COLORS
local pos = "TOP" local pos = "TOP"
local cancelled_rolls = {} local cancelled_rolls = {}
local FRAME_WIDTH, FRAME_HEIGHT = 328, 28 local FRAME_WIDTH, FRAME_HEIGHT = 328, 28
local dummy = CreateFrame("FRAME", nil, E.UIParent)
M.RollBars = {} M.RollBars = {}
local locale = GetLocale() local locale = GetLocale()
@@ -247,20 +246,20 @@ local function GetFrame()
return f return f
end end
function M:START_LOOT_ROLL(_, rollID, time) function M:START_LOOT_ROLL()
if cancelled_rolls[rollID] then return end if cancelled_rolls[rollID] then return end
local f = GetFrame() local f = GetFrame()
f.rollID = rollID f.rollID = arg1
f.time = time f.time = arg2
for i in pairs(f.rolls) do f.rolls[i] = nil end for i in pairs(f.rolls) do f.rolls[i] = nil end
f.need:SetText(0) f.need:SetText(0)
f.greed:SetText(0) f.greed:SetText(0)
f.pass: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.icon:SetTexture(texture)
f.button.link = GetLootRollItemLink(rollID) f.button.link = GetLootRollItemLink(arg1)
f.needbutt:Enable() f.needbutt:Enable()
f.greedbutt:Enable() f.greedbutt:Enable()
@@ -284,7 +283,7 @@ function M:START_LOOT_ROLL(_, rollID, time)
f:Show() f:Show()
if E.db.general.autoRoll and UnitLevel("player") == MAX_PLAYER_LEVEL and quality == 2 and not bindOnPickUp then 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
end end
@@ -301,8 +300,8 @@ function M:ParseRollChoice(msg)
end end
end end
function M:CHAT_MSG_LOOT(_, msg) function M:CHAT_MSG_LOOT()
local playername, itemname, rolltype = self:ParseRollChoice(msg) local playername, itemname, rolltype = self:ParseRollChoice(arg1)
if playername and itemname and rolltype then if playername and itemname and rolltype then
local class = select(2, UnitClass(playername)) local class = select(2, UnitClass(playername))
for _, f in ipairs(M.RollBars) do for _, f in ipairs(M.RollBars) do
@@ -318,18 +317,8 @@ end
function M:LoadLootRoll() function M:LoadLootRoll()
if not E.private.general.lootRoll then return end if not E.private.general.lootRoll then return end
dummy:RegisterEvent("START_LOOT_ROLL") self:RegisterEvent("START_LOOT_ROLL")
-- dummy:RegisterEvent("CHAT_MSG_LOOT") self: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")
UIParent:UnregisterEvent("START_LOOT_ROLL") UIParent:UnregisterEvent("START_LOOT_ROLL")
UIParent:UnregisterEvent("CANCEL_LOOT_ROLL") UIParent:UnregisterEvent("CANCEL_LOOT_ROLL")
end end
+5 -5
View File
@@ -113,16 +113,16 @@ function M:DisbandRaidGroup()
LeaveParty() LeaveParty()
end end
function M:PVPMessageEnhancement(_, msg) function M:PVPMessageEnhancement()
if not E.db.general.enhancedPvpMessages then return end if not E.db.general.enhancedPvpMessages then return end
local _, instanceType = IsInInstance() local _, instanceType = IsInInstance()
if instanceType == "pvp" then if instanceType == "pvp" then
RaidNotice_AddMessage(RaidBossEmoteFrame, msg, ChatTypeInfo["RAID_BOSS_EMOTE"]) RaidNotice_AddMessage(RaidBossEmoteFrame, arg1, ChatTypeInfo["RAID_BOSS_EMOTE"])
end end
end end
local hideStatic = false local hideStatic = false
function M:AutoInvite(event, leaderName) function M:AutoInvite(event)
if not E.db.general.autoAcceptInvite then return end if not E.db.general.autoAcceptInvite then return end
if event == "PARTY_INVITE_REQUEST" then if event == "PARTY_INVITE_REQUEST" then
@@ -137,7 +137,7 @@ function M:AutoInvite(event, leaderName)
for friendIndex = 1, numFriends do for friendIndex = 1, numFriends do
local friendName = gsub(GetFriendInfo(friendIndex), "-.*", "") local friendName = gsub(GetFriendInfo(friendIndex), "-.*", "")
if friendName == leaderName then if friendName == arg1 then
AcceptGroup() AcceptGroup()
inGroup = true inGroup = true
break break
@@ -147,7 +147,7 @@ function M:AutoInvite(event, leaderName)
if not inGroup then if not inGroup then
for guildIndex = 1, GetNumGuildMembers(true) do for guildIndex = 1, GetNumGuildMembers(true) do
local guildMemberName = gsub(GetGuildRosterInfo(guildIndex), "-.*", "") local guildMemberName = gsub(GetGuildRosterInfo(guildIndex), "-.*", "")
if guildMemberName == leaderName then if guildMemberName == arg1 then
AcceptGroup() AcceptGroup()
inGroup = true inGroup = true
break break