diff --git a/libs/libcast.lua b/libs/libcast.lua index 2733cfdb..6affbbf0 100644 --- a/libs/libcast.lua +++ b/libs/libcast.lua @@ -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) diff --git a/libs/libtipscan.lua b/libs/libtipscan.lua index 4df96a9b..00f2d324 100644 --- a/libs/libtipscan.lua +++ b/libs/libtipscan.lua @@ -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 diff --git a/libs/libunitscan.lua b/libs/libunitscan.lua index fc0ff535..0094661f 100644 --- a/libs/libunitscan.lua +++ b/libs/libunitscan.lua @@ -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) diff --git a/modules/actionbar.lua b/modules/actionbar.lua index 772d5039..3abfa09e 100644 --- a/modules/actionbar.lua +++ b/modules/actionbar.lua @@ -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 diff --git a/modules/addonbuttons.lua b/modules/addonbuttons.lua index a496c7db..d5e052a8 100644 --- a/modules/addonbuttons.lua +++ b/modules/addonbuttons.lua @@ -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 diff --git a/modules/afkcam.lua b/modules/afkcam.lua index 98bf95c9..c99c4a30 100644 --- a/modules/afkcam.lua +++ b/modules/afkcam.lua @@ -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") diff --git a/modules/autoshift.lua b/modules/autoshift.lua index 5c76a95d..2fc0e231 100644 --- a/modules/autoshift.lua +++ b/modules/autoshift.lua @@ -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 diff --git a/modules/buffwatch.lua b/modules/buffwatch.lua index 89eb808e..c7018919 100644 --- a/modules/buffwatch.lua +++ b/modules/buffwatch.lua @@ -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 diff --git a/modules/chat.lua b/modules/chat.lua index 8843d69b..e98b8ab3 100644 --- a/modules/chat.lua +++ b/modules/chat.lua @@ -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) diff --git a/modules/panel.lua b/modules/panel.lua index ae6e2cd0..0344ef51 100644 --- a/modules/panel.lua +++ b/modules/panel.lua @@ -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 diff --git a/modules/raid.lua b/modules/raid.lua index ddfef635..b48ad6e4 100644 --- a/modules/raid.lua +++ b/modules/raid.lua @@ -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() diff --git a/modules/roll.lua b/modules/roll.lua index e93c7b90..e276cafd 100644 --- a/modules/roll.lua +++ b/modules/roll.lua @@ -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 diff --git a/modules/sellvalue.lua b/modules/sellvalue.lua index 4e40bcc3..cf2c8266 100644 --- a/modules/sellvalue.lua +++ b/modules/sellvalue.lua @@ -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 diff --git a/modules/tooltip.lua b/modules/tooltip.lua index f76bba6b..147f1d9f 100644 --- a/modules/tooltip.lua +++ b/modules/tooltip.lua @@ -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 diff --git a/pfUI.lua b/pfUI.lua index 0a525ba3..d733280a 100644 --- a/pfUI.lua +++ b/pfUI.lua @@ -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) };