From f65e8aa7898f73a246a0f5779c5b2ea11dcfd091 Mon Sep 17 00:00:00 2001 From: Bunny67 Date: Wed, 11 Jul 2018 23:24:37 +0300 Subject: [PATCH] update --- ElvUI/Core/ClassCache.lua | 1 - ElvUI/Core/Math.lua | 2 +- ElvUI/Libraries/oUF/private.lua | 2 +- ElvUI/Modules/Bags/Sort.lua | 10 ++++++---- ElvUI/Modules/Misc/LootRoll.lua | 12 +++++++++++- 5 files changed, 19 insertions(+), 8 deletions(-) diff --git a/ElvUI/Core/ClassCache.lua b/ElvUI/Core/ClassCache.lua index 4746ca7..8f70b7c 100644 --- a/ElvUI/Core/ClassCache.lua +++ b/ElvUI/Core/ClassCache.lua @@ -7,7 +7,6 @@ local LW = LibStub:GetLibrary("LibWho-2.0"); local split, upper = string.split, string.upper local wipe = table.wipe local pairs = pairs -local select = select --WoW API / Variables local GetBattlefieldScore = GetBattlefieldScore local GetFriendInfo = GetFriendInfo diff --git a/ElvUI/Core/Math.lua b/ElvUI/Core/Math.lua index acbbd1d..ed31418 100644 --- a/ElvUI/Core/Math.lua +++ b/ElvUI/Core/Math.lua @@ -2,7 +2,7 @@ local E, L, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, Profi --Cache global variables --Lua functions -local select, unpack, assert, tonumber, type, pairs = select, unpack, assert, tonumber, type, pairs +local unpack, assert, tonumber, type, pairs = unpack, assert, tonumber, type, pairs local getn, tinsert, tremove = table.getn, tinsert, tremove local abs, ceil, floor, modf, mod = math.abs, math.ceil, math.floor, math.modf, math.mod local find, format, byte, len, sub, gsub, upper, split, utf8sub = string.find, string.format, string.byte, string.len, string.sub, string.gsub, string.upper, string.split, string.utf8sub diff --git a/ElvUI/Libraries/oUF/private.lua b/ElvUI/Libraries/oUF/private.lua index c481ad4..393662f 100644 --- a/ElvUI/Libraries/oUF/private.lua +++ b/ElvUI/Libraries/oUF/private.lua @@ -4,7 +4,7 @@ local Private = ns.oUF.Private function Private.argcheck(value, num, ...) assert(type(num) == 'number', "Bad argument #2 to 'argcheck' (number expected, got " .. type(num) .. ')') - for i = 1, select('#', arg) do + for i = 1, arg.n do if(type(value) == select(i, unpack(arg))) then return end end diff --git a/ElvUI/Modules/Bags/Sort.lua b/ElvUI/Modules/Bags/Sort.lua index 8a6db08..3e9323e 100644 --- a/ElvUI/Modules/Bags/Sort.lua +++ b/ElvUI/Modules/Bags/Sort.lua @@ -359,10 +359,12 @@ function B:ScanBags() local bagSlot = B:Encode_BagSlot(bag, slot) local itemID = ConvertLinkToID(B:GetItemLink(bag, slot)) if itemID then - bagMaxStacks[bagSlot] = select(7, GetItemInfo(itemID)) + local _, _, rarity, _, _, _, stackCount = GetItemInfo(itemID) + local _, itemCount = B:GetItemInfo(bag, slot) + bagMaxStacks[bagSlot] = stackCount bagIDs[bagSlot] = itemID - bagQualities[bagSlot] = select(3, GetItemInfo(itemID)) - bagStacks[bagSlot] = select(2, B:GetItemInfo(bag, slot)) + bagQualities[bagSlot] = rarity + bagStacks[bagSlot] = itemCount end end end @@ -666,7 +668,7 @@ function B:DoMove(move) end end - local stackSize = select(7, GetItemInfo(sourceItemID)) + local _, _, _, _, _, _, stackSize = GetItemInfo(itemID) if (sourceItemID == targetItemID) and (targetCount ~= stackSize) and ((targetCount + sourceCount) > stackSize) then B:SplitItem(sourceBag, sourceSlot, stackSize - targetCount) else diff --git a/ElvUI/Modules/Misc/LootRoll.lua b/ElvUI/Modules/Misc/LootRoll.lua index ca1c55e..3252cc1 100644 --- a/ElvUI/Modules/Misc/LootRoll.lua +++ b/ElvUI/Modules/Misc/LootRoll.lua @@ -303,7 +303,15 @@ end 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 + if f.rollID and f.button.link == itemname and not f.rolls[playername] then + f.rolls[playername] = { rolltype } + f[rolltype]:SetText(tonumber(f[rolltype]:GetText()) + 1) + return + end + end +--[[ + local _, class = UnitClass(playername) for _, f in ipairs(M.RollBars) do if f.rollID and f.button.link == itemname and not f.rolls[playername] then f.rolls[playername] = { rolltype, class } @@ -311,7 +319,9 @@ function M:CHAT_MSG_LOOT() return end end +]] end + end function M:LoadLootRoll()