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")
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)
@@ -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
+3 -3
View File
@@ -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
-4
View File
@@ -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
+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)
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()
+6 -8
View File
@@ -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
+3 -3
View File
@@ -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
+1 -2
View File
@@ -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
+2 -2
View File
@@ -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()
+10 -21
View File
@@ -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
+5 -5
View File
@@ -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