Commit 4a27afbc authored by Simpy's avatar Simpy 🐹
Browse files

some clean up

parent 19589add
......@@ -3,7 +3,7 @@ local DT = E:GetModule('DataTexts')
local AB = E:GetModule('ActionBars')
local _G = _G
local tonumber, type, pairs, select, gsub = tonumber, type, pairs, select, gsub
local tonumber, type, pairs, select = tonumber, type, pairs, select
local lower, split, format, wipe, next, print = strlower, strsplit, format, wipe, next, print
local debugprofilestop = debugprofilestop
......
......@@ -2,7 +2,6 @@ local E, L, V, P, G = unpack(select(2, ...)); --Import: Engine, Locales, Private
local _G = _G
local tinsert = tinsert
local CreateFrame = CreateFrame
local ToggleFrame = ToggleFrame
local GetCursorPosition = GetCursorPosition
......
......@@ -117,8 +117,8 @@ function MC:CreateMoversConfigGroup()
order = 1,
type = 'toggle',
name = data.mover.textString,
get = function(info) return E.global.profileCopy.movers[moverName] end,
set = function(info, value) E.global.profileCopy.movers[moverName] = value; end
get = function() return E.global.profileCopy.movers[moverName] end,
set = function(_, value) E.global.profileCopy.movers[moverName] = value; end
}
end
for moverName, data in pairs(E.DisabledMovers) do
......@@ -127,8 +127,8 @@ function MC:CreateMoversConfigGroup()
order = 1,
type = 'toggle',
name = data.mover.textString,
get = function(info) return E.global.profileCopy.movers[moverName] end,
set = function(info, value) E.global.profileCopy.movers[moverName] = value; end
get = function() return E.global.profileCopy.movers[moverName] end,
set = function(_, value) E.global.profileCopy.movers[moverName] = value; end
}
end
return config
......
......@@ -353,7 +353,7 @@ end
function E:ToggleMovers(show, moverType)
self.configMode = show
for name, holder in pairs(E.CreatedMovers) do
for _, holder in pairs(E.CreatedMovers) do
if show and holder.type[moverType] then
holder.mover:Show()
else
......
......@@ -127,15 +127,14 @@ local function SetPage(PageNum, PrevPage)
f.Status.text:SetFormattedText('%d / %d', f.CurrentPage, f.MaxPage)
if f.StepTitles then
for i = 1, #f.side.Lines do
local b = f.side.Lines[i]
local color
b.text:SetText(f.StepTitles[i])
local line, color = f.side.Lines[i]
line.text:SetText(f.StepTitles[i])
if i == f.CurrentPage then
color = f.StepTitlesColorSelected or {.09,.52,.82}
else
color = f.StepTitlesColor or {1,1,1}
end
b.text:SetTextColor(color[1] or color.r, color[2] or color.g, color[3] or color.b)
line.text:SetTextColor(color[1] or color.r, color[2] or color.g, color[3] or color.b)
end
end
end
......
local E, L, V, P, G = unpack(select(2, ...)); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
local Skins = E:GetModule('Skins')
local wipe, sort, unpack = wipe, sort, unpack
local next, pairs, tinsert = next, pairs, tinsert
......
......@@ -79,15 +79,15 @@ function E:SpawnTutorialFrame()
_G[f.disableButton:GetName() .. 'Text']:SetText(DISABLE)
f.disableButton:Point('BOTTOMLEFT')
Skins:HandleCheckBox(f.disableButton)
f.disableButton:SetScript('OnShow', function(self) self:SetChecked(E.db.hideTutorial) end)
f.disableButton:SetScript('OnShow', function(btn) btn:SetChecked(E.db.hideTutorial) end)
f.disableButton:SetScript('OnClick', function(self) E.db.hideTutorial = self:GetChecked() end)
f.disableButton:SetScript('OnClick', function(btn) E.db.hideTutorial = btn:GetChecked() end)
f.hideButton = CreateFrame('Button', f:GetName()..'HideButton', f, 'OptionsButtonTemplate')
f.hideButton:Point('BOTTOMRIGHT', -5, 5)
Skins:HandleButton(f.hideButton)
_G[f.hideButton:GetName() .. 'Text']:SetText(HIDE)
f.hideButton:SetScript('OnClick', function(self) E:StaticPopupSpecial_Hide(self:GetParent()) end)
f.hideButton:SetScript('OnClick', function(btn) E:StaticPopupSpecial_Hide(btn:GetParent()) end)
f.nextButton = CreateFrame('Button', f:GetName()..'NextButton', f, 'OptionsButtonTemplate')
f.nextButton:Point('RIGHT', f.hideButton, 'LEFT', -4, 0)
......
......@@ -21,7 +21,7 @@ local IsDebugDisabled = function()
end
end
SLASH_FRAME1 = '/frame'
_G.SLASH_FRAME1 = '/frame'
SlashCmdList.FRAME = function(arg)
if IsDebugDisabled() then return end
......@@ -32,7 +32,7 @@ SlashCmdList.FRAME = function(arg)
end
if arg ~= nil then
FRAME = arg -- Set the global variable FRAME to = whatever we are mousing over to simplify messing with frames that have no name.
_G.FRAME = arg -- Set the global variable FRAME to = whatever we are mousing over to simplify messing with frames that have no name.
end
if not _G.TableAttributeDisplay then
......@@ -45,7 +45,7 @@ SlashCmdList.FRAME = function(arg)
end
end
SLASH_FRAMELIST1 = '/framelist'
_G.SLASH_FRAMELIST1 = '/framelist'
SlashCmdList.FRAMELIST = function(msg)
if IsDebugDisabled() then return end
......@@ -92,7 +92,7 @@ local function TextureList(frame)
end
end
SLASH_TEXLIST1 = '/texlist'
_G.SLASH_TEXLIST1 = '/texlist'
SlashCmdList.TEXLIST = TextureList
local function GetPoint(frame)
......@@ -109,10 +109,10 @@ local function GetPoint(frame)
print(frameName, point, relativeToName, relativePoint, xOffset, yOffset)
end
SLASH_GETPOINT1 = '/getpoint'
_G.SLASH_GETPOINT1 = '/getpoint'
SlashCmdList.GETPOINT = GetPoint
SLASH_DEV1 = '/dev'
_G.SLASH_DEV1 = '/dev'
SlashCmdList.DEV = function()
if not IsAddOnLoaded('ElvUIDev') then
local _, _, _, loadable, reason = GetAddOnInfo('ElvUIDev')
......@@ -122,11 +122,11 @@ SlashCmdList.DEV = function()
elseif reason == 'DISABLED' then
print('ElvUIDev addon is disabled.')
elseif reason == 'DEMAND_LOADED' then
local loaded, reason = LoadAddOn('ElvUIDev')
local loaded, rsn = LoadAddOn('ElvUIDev')
if loaded then
ElvUIDev:ToggleFrame()
else
print('ElvUIDev addon cannot be loaded: %s.', strlower(reason))
print('ElvUIDev addon cannot be loaded: %s.', strlower(rsn))
end
end
end
......
......@@ -32,7 +32,6 @@ local GetContainerItemLink = GetContainerItemLink
local GetContainerItemQuestInfo = GetContainerItemQuestInfo
local GetContainerNumFreeSlots = GetContainerNumFreeSlots
local GetContainerNumSlots = GetContainerNumSlots
local GetCurrencyLink = GetCurrencyLink
local GetCurrentGuildBankTab = GetCurrentGuildBankTab
local GetDetailedItemLevelInfo = GetDetailedItemLevelInfo
local GetGuildBankItemLink = GetGuildBankItemLink
......@@ -42,10 +41,8 @@ local GetItemQualityColor = GetItemQualityColor
local GetMoney = GetMoney
local GetNumBankSlots = GetNumBankSlots
local GetScreenWidth, GetScreenHeight = GetScreenWidth, GetScreenHeight
local HandleModifiedItemClick = HandleModifiedItemClick
local IsBagOpen, IsOptionFrameOpen = IsBagOpen, IsOptionFrameOpen
local IsInventoryItemProfessionBag = IsInventoryItemProfessionBag
local IsModifiedClick = IsModifiedClick
local IsReagentBankUnlocked = IsReagentBankUnlocked
local IsShiftKeyDown, IsControlKeyDown = IsShiftKeyDown, IsControlKeyDown
local PickupContainerItem = PickupContainerItem
......
......@@ -2,7 +2,6 @@ local E, L, V, P, G = unpack(select(2, ...)); --Import: Engine, Locales, Private
local B = E:GetModule('Blizzard')
local _G = _G
local CreateFrame = CreateFrame
local hooksecurefunc = hooksecurefunc
......
......@@ -2,7 +2,6 @@ local E, L, V, P, G = unpack(select(2, ...)); --Import: Engine, Locales, Private
local DB = E:GetModule('DataBars')
local _G = _G
local CreateFrame = CreateFrame
local GetExpansionLevel = GetExpansionLevel
local MAX_PLAYER_LEVEL_TABLE = MAX_PLAYER_LEVEL_TABLE
......
......@@ -4,7 +4,6 @@ local LSM = E.Libs.LSM
local _G = _G
local format = format
local UnitHonor = UnitHonor
local UnitHonorLevel = UnitHonorLevel
local UnitHonorMax = UnitHonorMax
......
......@@ -11,7 +11,7 @@ local ToggleCharacter = ToggleCharacter
local GetWatchedFactionInfo = GetWatchedFactionInfo
local REPUTATION, STANDING = REPUTATION, STANDING
local function OnEvent(self, event, eventType)
local function OnEvent(self)
local name, reaction, min, max, value, factionID = GetWatchedFactionInfo()
if not name then return end
......
......@@ -30,11 +30,11 @@ local Screenshot = Screenshot
local SetCVar = SetCVar
local UnitCastingInfo = UnitCastingInfo
local UnitIsAFK = UnitIsAFK
local CinematicFrame = _G.CinematicFrame
local MovieFrame = _G.MovieFrame
local DNDstr = _G.DND
local AFKstr = _G.AFK
local C_PetBattles_IsInBattle = _G.C_PetBattles.IsInBattle
local CinematicFrame = CinematicFrame
local MovieFrame = MovieFrame
local DNDstr = DND
local AFKstr = AFK
local C_PetBattles_IsInBattle = C_PetBattles.IsInBattle
local CAMERA_SPEED = 0.035
local ignoreKeys = {
......
......@@ -210,22 +210,17 @@ function M:SkinBubble(frame)
frame.isSkinnedElvUI = true
end
local function ChatBubble_OnEvent(self, event, msg, sender, _, _, _, _, _, _, _, _, _, guid)
local function ChatBubble_OnEvent(_, _, msg, sender, _, _, _, _, _, _, _, _, _, guid)
if not E.private.general.chatBubbleName then return end
messageToGUID[msg] = guid
messageToSender[msg] = Ambiguate(sender, "none")
end
local function ChatBubble_OnUpdate(self, elapsed)
if not M.BubbleFrame then return end
if not M.BubbleFrame.lastupdate then
M.BubbleFrame.lastupdate = -2 -- wait 2 seconds before hooking frames
end
M.BubbleFrame.lastupdate = M.BubbleFrame.lastupdate + elapsed
if M.BubbleFrame.lastupdate < 0.1 then return end
M.BubbleFrame.lastupdate = 0
local function ChatBubble_OnUpdate(frame, elapsed)
frame.lastupdate = (frame.lastupdate or -2) + elapsed
if frame.lastupdate < 0.1 then return end
frame.lastupdate = 0
for _, chatBubble in pairs(C_ChatBubbles_GetAllChatBubbles()) do
if not chatBubble.isSkinnedElvUI then
......
......@@ -179,7 +179,7 @@ end
local count = {}
local function UpdateIcons(self)
local raid = IsInRaid()
local party --= IsInGroup() --We could have this in party :thinking:
--local party = IsInGroup() --We could have this in party :thinking:
if not (raid or party) then
self:Hide()
......
......@@ -88,7 +88,7 @@ function NP:Power_UpdateColor(_, unit)
end
end
function NP:Power_PostUpdate(unit, cur, min, max)
function NP:Power_PostUpdate(_, cur) --unit, cur, min, max
local db = NP.db.units[self.__owner.frameType]
if not db then return end
......
......@@ -3,7 +3,7 @@ local NP = E:GetModule("NamePlates")
local oUF = E.oUF
local _G = _G
local format, pairs, select, strsplit, type, wipe = format, pairs, select, strsplit, type, wipe
local format, pairs, select, strsplit, wipe = format, pairs, select, strsplit, wipe
local CreateFrame = CreateFrame
local GetCVar = GetCVar
......
......@@ -86,7 +86,7 @@ local QuestTypesLocalized = {
local QuestTypes = QuestTypesLocalized[UsedLocale] or QuestTypesLocalized.enUS
local function QUEST_ACCEPTED(self, event, questLogIndex, questID)
local function QUEST_ACCEPTED(_, _, questLogIndex, questID)
if questLogIndex and questLogIndex > 0 then
local questName = GetQuestLogTitle(questLogIndex)
if questName and (questID and questID > 0) then
......@@ -95,7 +95,7 @@ local function QUEST_ACCEPTED(self, event, questLogIndex, questID)
end
end
local function QUEST_REMOVED(self, event, questID)
local function QUEST_REMOVED(_, _, questID)
if not questID then return end
for questName, id in pairs(ActiveQuests) do
if id == questID then
......
......@@ -3,7 +3,7 @@ local mod = E:GetModule('NamePlates')
local LSM = E.Libs.LSM
local _G = _G
local ipairs, next, pairs, rawget, rawset, select = ipairs, next, pairs, rawget, rawset, select
local ipairs, next, pairs, select = ipairs, next, pairs, select
local setmetatable, tostring, tonumber, type, unpack = setmetatable, tostring, tonumber, type, unpack
local strmatch, tinsert, tremove, sort, wipe = strmatch, tinsert, tremove, sort, wipe
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment