mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-03 12:10:01 +00:00
core: global environment cleanup
This commit is contained in:
+1
-1
@@ -213,7 +213,7 @@ libcast:SetScript("OnEvent", function()
|
||||
end
|
||||
-- Fill database with environmental casts
|
||||
elseif arg1 then
|
||||
local mob, spell
|
||||
local mob, spell, _
|
||||
|
||||
-- (.+) begins to cast (.+).
|
||||
mob, spell = cmatch(arg1, SPELLCASTOTHERSTART)
|
||||
|
||||
+1
-1
@@ -44,7 +44,7 @@ local extra_methods = {
|
||||
|
||||
local getFontString = function(obj)
|
||||
local name = obj:GetName()
|
||||
local r, g, b, color
|
||||
local r, g, b, color, a
|
||||
local text, segment
|
||||
|
||||
for i=1, obj:NumLines() do
|
||||
|
||||
@@ -84,7 +84,7 @@ libunitscan:SetScript("OnEvent", function()
|
||||
end
|
||||
|
||||
elseif event == "GUILD_ROSTER_UPDATE" then
|
||||
local name, class, level
|
||||
local name, class, level, _
|
||||
for i = 1, GetNumGuildMembers() do
|
||||
name, _, _, level, class = GetGuildRosterInfo(i)
|
||||
class = L["class"][class] or nil
|
||||
@@ -92,7 +92,7 @@ libunitscan:SetScript("OnEvent", function()
|
||||
end
|
||||
|
||||
elseif event == "RAID_ROSTER_UPDATE" then
|
||||
local name, class, SubGroup, level
|
||||
local name, class, SubGroup, level, _
|
||||
for i = 1, GetNumRaidMembers() do
|
||||
name, _, SubGroup, level, class = GetRaidRosterInfo(i)
|
||||
class = L["class"][class] or nil
|
||||
@@ -100,7 +100,7 @@ libunitscan:SetScript("OnEvent", function()
|
||||
end
|
||||
|
||||
elseif event == "PARTY_MEMBERS_CHANGED" then
|
||||
local name, class, level, unit
|
||||
local name, class, level, unit, _
|
||||
for i = 1, GetNumPartyMembers() do
|
||||
unit = "party" .. i
|
||||
_, class = UnitClass(unit)
|
||||
@@ -110,7 +110,7 @@ libunitscan:SetScript("OnEvent", function()
|
||||
end
|
||||
|
||||
elseif event == "WHO_LIST_UPDATE" or event == "CHAT_MSG_SYSTEM" then
|
||||
local name, class, level
|
||||
local name, class, level, _
|
||||
for i = 1, GetNumWhoResults() do
|
||||
name, _, level, _, class, _ = GetWhoInfo(i)
|
||||
class = L["class"][class] or nil
|
||||
@@ -119,7 +119,7 @@ libunitscan:SetScript("OnEvent", function()
|
||||
|
||||
elseif event == "UPDATE_MOUSEOVER_UNIT" or event == "PLAYER_TARGET_CHANGED" then
|
||||
local scan = event == "PLAYER_TARGET_CHANGED" and "target" or "mouseover"
|
||||
local name, class, level
|
||||
local name, class, level, elite, _
|
||||
if UnitIsPlayer(scan) then
|
||||
_, class = UnitClass(scan)
|
||||
level = UnitLevel(scan)
|
||||
|
||||
@@ -983,10 +983,10 @@ pfUI:RegisterModule("actionbar", function ()
|
||||
pager:RegisterEvent("UPDATE_BONUS_ACTIONBAR")
|
||||
pager:RegisterEvent("ACTIONBAR_PAGE_CHANGED")
|
||||
pager:SetScript("OnEvent", function()
|
||||
bar = GetActiveBar()
|
||||
local bar = GetActiveBar()
|
||||
|
||||
for i=1,12 do
|
||||
id = i + (bar-1)*12
|
||||
local id = i + (bar-1)*12
|
||||
bars[1][i].bar = bar
|
||||
bars[1][i]:SetID(id)
|
||||
bars[1][i].forceupdate = true
|
||||
|
||||
@@ -90,7 +90,7 @@ pfUI:RegisterModule("addonbuttons", function ()
|
||||
|
||||
local function TablePartialMatch(table, needle)
|
||||
for i,v in ipairs(table) do
|
||||
pos_start, pos_end = strfind(strlower(needle), strlower(v))
|
||||
local pos_start, pos_end = strfind(strlower(needle), strlower(v))
|
||||
if pos_start == 1 then
|
||||
return i
|
||||
end
|
||||
|
||||
+1
-1
@@ -87,7 +87,7 @@ pfUI:RegisterModule("afkcam", function ()
|
||||
overlay._parent = afkcam
|
||||
afkcam.overlay = overlay
|
||||
|
||||
clock = CreateFrame("Frame", "pfAFKClock", overlay)
|
||||
local clock = CreateFrame("Frame", "pfAFKClock", overlay)
|
||||
clock:SetAllPoints(overlay)
|
||||
clock.time = clock:CreateFontString("Status", "OVERLAY")
|
||||
clock.time:SetFont("Interface\\AddOns\\pfUI\\fonts\\Hooge.ttf", 32, "THICKOUTLINE")
|
||||
|
||||
@@ -69,7 +69,7 @@ pfUI:RegisterModule("autoshift", function ()
|
||||
for id, errorstring in pairs(pfUI.autoshift.errors) do
|
||||
if arg1 == errorstring then
|
||||
for i=0,31,1 do
|
||||
currBuffTex = GetPlayerBuffTexture(i)
|
||||
local currBuffTex = GetPlayerBuffTexture(i)
|
||||
if (currBuffTex) then
|
||||
for id, bufftype in pairs(pfUI.autoshift.buffs) do
|
||||
if string.find(string.lower(currBuffTex), bufftype, 1) then
|
||||
|
||||
@@ -144,7 +144,7 @@ pfUI:RegisterModule("buffwatch", function ()
|
||||
|
||||
local font = parent.config.use_unitfonts == "1" and pfUI.font_unit or pfUI.font_default
|
||||
|
||||
frame = _G[framename] or CreateFrame("Button", framename, parent)
|
||||
local frame = _G[framename] or CreateFrame("Button", framename, parent)
|
||||
frame:EnableMouse(1)
|
||||
frame:Hide()
|
||||
frame:SetPoint("BOTTOM", 0, (bar-1)*(height+2*border+1))
|
||||
@@ -306,6 +306,7 @@ pfUI:RegisterModule("buffwatch", function ()
|
||||
-- set stacks
|
||||
if data[5] > 1 then
|
||||
local stacks_percentage = data[5] / (frame.charges[uuid] * .01)
|
||||
local sr, sg, sb, sa
|
||||
if stacks_percentage >= 90 then
|
||||
sr, sg, sb, sa = .3, 1, .3, 1
|
||||
elseif stacks_percentage >= 60 then
|
||||
|
||||
+1
-1
@@ -594,7 +594,7 @@ pfUI:RegisterModule("chat", function ()
|
||||
-- read and parse whisper color settings
|
||||
local cr, cg, cb, ca = strsplit(",", C.chat.global.whisper)
|
||||
cr, cg, cb = tonumber(cr), tonumber(cg), tonumber(cb)
|
||||
wcol = string.format("%02x%02x%02x",cr * 255,cg * 255, cb * 255)
|
||||
local wcol = string.format("%02x%02x%02x",cr * 255,cg * 255, cb * 255)
|
||||
|
||||
-- read and parse chat bracket settings
|
||||
local left = "|r" .. string.sub(C.chat.text.bracket, 1, 1)
|
||||
|
||||
+4
-3
@@ -163,10 +163,11 @@ pfUI:RegisterModule("panel", function()
|
||||
|
||||
do -- XP & Kills To Level
|
||||
local widget = CreateFrame("Frame", "pfPanelWidgetXP", UIParent)
|
||||
local curexp, difexp, maxexp, remexp, oldexp, remstring
|
||||
widget:RegisterEvent("PLAYER_ENTERING_WORLD")
|
||||
widget:RegisterEvent("PLAYER_XP_UPDATE")
|
||||
widget:SetScript("OnEvent", function()
|
||||
if UnitLevel("player") ~= 60 then
|
||||
if UnitLevel("player") < _G.MAX_PLAYER_LEVEL then
|
||||
curexp = UnitXP("player")
|
||||
if oldexp ~= nil then
|
||||
difexp = curexp - oldexp
|
||||
@@ -208,7 +209,7 @@ pfUI:RegisterModule("panel", function()
|
||||
local bagsize = GetContainerNumSlots(bag)
|
||||
maxslots = maxslots + bagsize
|
||||
for j = 1,bagsize do
|
||||
link = GetContainerItemLink(bag,j)
|
||||
local link = GetContainerItemLink(bag,j)
|
||||
if link then
|
||||
usedslots = usedslots + 1
|
||||
end
|
||||
@@ -279,7 +280,7 @@ pfUI:RegisterModule("panel", function()
|
||||
local online = 0
|
||||
local all = GetNumFriends()
|
||||
for friendIndex=1, all do
|
||||
friend_name, friend_level, friend_class, friend_area, friend_connected = GetFriendInfo(friendIndex)
|
||||
local friend_name, friend_level, friend_class, friend_area, friend_connected = GetFriendInfo(friendIndex)
|
||||
if ( friend_connected ) then
|
||||
online = online + 1
|
||||
end
|
||||
|
||||
+2
-2
@@ -24,7 +24,7 @@ pfUI:RegisterModule("raid", function ()
|
||||
|
||||
for r=1, 8 do
|
||||
for g=1, 5 do
|
||||
i = g + 5*(r-1)
|
||||
local i = g + 5*(r-1)
|
||||
pfUI.uf.raid[i] = pfUI.uf:CreateUnitFrame("Raid", i, C.unitframes.raid)
|
||||
pfUI.uf.raid[i]:UpdateFrameSize()
|
||||
|
||||
@@ -42,7 +42,7 @@ pfUI:RegisterModule("raid", function ()
|
||||
-- add units to the beginning of their groups
|
||||
function pfUI.uf.raid:AddUnitToGroup(index, group)
|
||||
for subindex = 1, 5 do
|
||||
ids = subindex + 5*(group-1)
|
||||
local ids = subindex + 5*(group-1)
|
||||
if pfUI.uf.raid[ids].id == 0 and pfUI.uf.raid[ids].config.visible == "1" then
|
||||
pfUI.uf.raid[ids].id = index
|
||||
pfUI.uf.raid[ids]:Show()
|
||||
|
||||
+1
-1
@@ -249,7 +249,7 @@ pfUI:RegisterModule("roll", function ()
|
||||
|
||||
function _G.GroupLootFrame_OpenNewFrame(id, rollTime)
|
||||
-- clear cache if possible
|
||||
local nothing = nil
|
||||
local visible = nil
|
||||
for i=1,4 do
|
||||
visible = visible or pfUI.roll.frames[i]:IsVisible()
|
||||
end
|
||||
|
||||
@@ -44,6 +44,7 @@ pfUI:RegisterModule("sellvalue", function ()
|
||||
local pfHookSetBagItem = GameTooltip.SetBagItem
|
||||
function GameTooltip.SetBagItem(self, container, slot)
|
||||
GameTooltip.itemLink = GetContainerItemLink(container, slot)
|
||||
local _
|
||||
_, GameTooltip.itemCount = GetContainerItemInfo(container, slot)
|
||||
return pfHookSetBagItem(self, container, slot)
|
||||
end
|
||||
|
||||
+2
-2
@@ -96,8 +96,8 @@ pfUI:RegisterModule("tooltip", function ()
|
||||
|
||||
pfUI.tooltipStatusBar = CreateFrame('Frame', nil, GameTooltipStatusBar)
|
||||
pfUI.tooltipStatusBar:SetScript("OnUpdate", function()
|
||||
hp = GameTooltipStatusBar:GetValue()
|
||||
_, hpm = GameTooltipStatusBar:GetMinMaxValues()
|
||||
local hp = GameTooltipStatusBar:GetValue()
|
||||
local _, hpm = GameTooltipStatusBar:GetMinMaxValues()
|
||||
|
||||
if hp and hpm then
|
||||
if hp >= 1000 then hp = round(hp / 1000, 1) .. "k" end
|
||||
|
||||
@@ -54,7 +54,6 @@ pfUI.client = client or 11200
|
||||
setmetatable(pfUI.env, {__index = getfenv(0)})
|
||||
|
||||
function pfUI:UpdateColors()
|
||||
ManaBarColor = {}
|
||||
ManaBarColor[0] = { r = 0.00, g = 0.00, b = 1.00, prefix = TEXT(MANA) };
|
||||
ManaBarColor[1] = { r = 1.00, g = 0.00, b = 0.00, prefix = TEXT(RAGE_POINTS) };
|
||||
ManaBarColor[2] = { r = 1.00, g = 0.50, b = 0.25, prefix = TEXT(FOCUS_POINTS) };
|
||||
|
||||
Reference in New Issue
Block a user