mirror of
https://github.com/Bluewhale1337/ElvUIModernized.git
synced 2026-07-28 00:44:45 +00:00
cleanup
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
local E, L, V, P, G = unpack(ElvUI)
|
||||
local B = E:NewModule("Bags", "AceHook-3.0", "AceEvent-3.0", "AceTimer-3.0")
|
||||
local Search = LibStub("LibItemSearch-1.2")
|
||||
-- local LIP = LibStub("ItemPrice-1.1", true)
|
||||
local E, L, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
|
||||
local B = E:NewModule("Bags", "AceHook-3.0", "AceEvent-3.0", "AceTimer-3.0");
|
||||
local Search = LibStub("LibItemSearch-1.2");
|
||||
-- local LIP = LibStub("ItemPrice-1.1", true);
|
||||
|
||||
--Cache global variables
|
||||
--Lua functions
|
||||
@@ -9,7 +9,7 @@ local _G = _G
|
||||
local type, ipairs, pairs, unpack, select, assert = type, ipairs, pairs, unpack, select, assert
|
||||
local tinsert = table.insert
|
||||
local floor, ceil = math.floor, math.ceil
|
||||
local len, sub, find = string.len, string.sub, string.find
|
||||
local len, gsub, sub, find = string.len, string.gsub, string.sub, string.find
|
||||
--WoW API / Variables
|
||||
local BankFrameItemButton_Update = BankFrameItemButton_Update
|
||||
local BankFrameItemButton_UpdateLocked = BankFrameItemButton_UpdateLocked
|
||||
|
||||
@@ -676,7 +676,7 @@ function B:DoMove(move)
|
||||
end
|
||||
end
|
||||
|
||||
local stackSize = select(8, GetItemInfo(sourceItemID))
|
||||
local stackSize = select(7, GetItemInfo(sourceItemID))
|
||||
if (sourceItemID == targetItemID) and (targetCount ~= stackSize) and ((targetCount + sourceCount) > stackSize) then
|
||||
B:SplitItem(sourceBag, sourceSlot, stackSize - targetCount)
|
||||
else
|
||||
|
||||
@@ -1,67 +1,66 @@
|
||||
local E, L, V, P, G = unpack(ElvUI);
|
||||
local E, L, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
|
||||
local DT = E:GetModule("DataTexts");
|
||||
|
||||
local max = math.max;
|
||||
--Cache global variables
|
||||
--Lua functions
|
||||
local max = math.max
|
||||
local format, join, sub = string.format, string.join, string.sub
|
||||
|
||||
local ComputePetBonus = ComputePetBonus;
|
||||
local UnitAttackPower = UnitAttackPower;
|
||||
local UnitRangedAttackPower = UnitRangedAttackPower;
|
||||
local ATTACK_POWER_COLON = ATTACK_POWER_COLON;
|
||||
local ATTACK_POWER_MAGIC_NUMBER = ATTACK_POWER_MAGIC_NUMBER;
|
||||
local MELEE_ATTACK_POWER = MELEE_ATTACK_POWER;
|
||||
local MELEE_ATTACK_POWER_TOOLTIP = MELEE_ATTACK_POWER_TOOLTIP;
|
||||
local PET_BONUS_TOOLTIP_RANGED_ATTACK_POWER = PET_BONUS_TOOLTIP_RANGED_ATTACK_POWER;
|
||||
local PET_BONUS_TOOLTIP_SPELLDAMAGE = PET_BONUS_TOOLTIP_SPELLDAMAGE;
|
||||
local RANGED_ATTACK_POWER = RANGED_ATTACK_POWER;
|
||||
local RANGED_ATTACK_POWER_TOOLTIP = RANGED_ATTACK_POWER_TOOLTIP;
|
||||
--WoW API / Variables
|
||||
local UnitAttackPower = UnitAttackPower
|
||||
local UnitRangedAttackPower = UnitRangedAttackPower
|
||||
local ATTACK_POWER_COLON = ATTACK_POWER_COLON
|
||||
local ATTACK_POWER_MAGIC_NUMBER = ATTACK_POWER_MAGIC_NUMBER
|
||||
local MELEE_ATTACK_POWER = MELEE_ATTACK_POWER
|
||||
local MELEE_ATTACK_POWER_TOOLTIP = MELEE_ATTACK_POWER_TOOLTIP
|
||||
local RANGED_ATTACK_POWER = RANGED_ATTACK_POWER
|
||||
local RANGED_ATTACK_POWER_TOOLTIP = RANGED_ATTACK_POWER_TOOLTIP
|
||||
local ATTACK_POWER_TOOLTIP = ATTACK_POWER_TOOLTIP
|
||||
|
||||
local ATTACK_POWER = sub(ATTACK_POWER_COLON, 1, -2)
|
||||
|
||||
local base, posBuff, negBuff, effective, Rbase, RposBuff, RnegBuff, Reffective, pwr;
|
||||
local displayNumberString = "";
|
||||
local lastPanel;
|
||||
local base, posBuff, negBuff, effective, Rbase, RposBuff, RnegBuff, Reffective, pwr
|
||||
local displayNumberString = ""
|
||||
local lastPanel
|
||||
|
||||
local function OnEvent(self)
|
||||
if(E.myclass == "HUNTER") then
|
||||
Rbase, RposBuff, RnegBuff = UnitRangedAttackPower("player");
|
||||
Reffective = Rbase + RposBuff + RnegBuff;
|
||||
pwr = Reffective;
|
||||
Rbase, RposBuff, RnegBuff = UnitRangedAttackPower("player")
|
||||
Reffective = Rbase + RposBuff + RnegBuff
|
||||
pwr = Reffective
|
||||
else
|
||||
base, posBuff, negBuff = UnitAttackPower("player");
|
||||
effective = base + posBuff + negBuff;
|
||||
pwr = effective;
|
||||
base, posBuff, negBuff = UnitAttackPower("player")
|
||||
effective = base + posBuff + negBuff
|
||||
pwr = effective
|
||||
end
|
||||
|
||||
self.text:SetText(format(displayNumberString, ATTACK_POWER, pwr));
|
||||
lastPanel = self;
|
||||
self.text:SetText(format(displayNumberString, ATTACK_POWER, pwr))
|
||||
lastPanel = self
|
||||
end
|
||||
|
||||
local function OnEnter(self)
|
||||
DT:SetupTooltip(self);
|
||||
DT:SetupTooltip(self)
|
||||
|
||||
if(E.myclass == "HUNTER") then
|
||||
DT.tooltip:AddDoubleLine(RANGED_ATTACK_POWER, pwr, 1, 1, 1);
|
||||
DT.tooltip:AddDoubleLine(RANGED_ATTACK_POWER, pwr, 1, 1, 1)
|
||||
|
||||
local line = format(RANGED_ATTACK_POWER_TOOLTIP, max((pwr), 0) / ATTACK_POWER_MAGIC_NUMBER);
|
||||
local line = format(RANGED_ATTACK_POWER_TOOLTIP, max((pwr), 0) / ATTACK_POWER_MAGIC_NUMBER)
|
||||
|
||||
DT.tooltip:AddLine(line, nil, nil, nil, true);
|
||||
DT.tooltip:AddLine(line, nil, nil, nil, true)
|
||||
else
|
||||
DT.tooltip:AddDoubleLine(MELEE_ATTACK_POWER, pwr, 1, 1, 1);
|
||||
DT.tooltip:AddLine(format(MELEE_ATTACK_POWER_TOOLTIP, max((base + posBuff + negBuff), 0) / ATTACK_POWER_MAGIC_NUMBER), nil, nil, nil, true);
|
||||
DT.tooltip:AddDoubleLine(MELEE_ATTACK_POWER, pwr, 1, 1, 1)
|
||||
DT.tooltip:AddLine(format(MELEE_ATTACK_POWER_TOOLTIP, max((base + posBuff + negBuff), 0) / ATTACK_POWER_MAGIC_NUMBER), nil, nil, nil, true)
|
||||
end
|
||||
|
||||
DT.tooltip:Show();
|
||||
DT.tooltip:Show()
|
||||
end
|
||||
|
||||
local function ValueColorUpdate(hex)
|
||||
displayNumberString = join("", "%s: ", hex, "%d|r");
|
||||
displayNumberString = join("", "%s: ", hex, "%d|r")
|
||||
|
||||
if(lastPanel ~= nil) then
|
||||
OnEvent(lastPanel);
|
||||
OnEvent(lastPanel)
|
||||
end
|
||||
end
|
||||
E["valueColorUpdateFuncs"][ValueColorUpdate] = true;
|
||||
E["valueColorUpdateFuncs"][ValueColorUpdate] = true
|
||||
|
||||
DT:RegisterDatatext("Attack Power", {"UNIT_ATTACK_POWER", "UNIT_RANGED_ATTACK_POWER"}, OnEvent, nil, nil, OnEnter, nil, ATTACK_POWER_TOOLTIP)
|
||||
Reference in New Issue
Block a user