diff --git a/ElvUI_SLE/modules/actionbars.lua b/ElvUI_SLE/modules/actionbars.lua index 16f5d2e..e6ea652 100644 --- a/ElvUI_SLE/modules/actionbars.lua +++ b/ElvUI_SLE/modules/actionbars.lua @@ -1,12 +1,12 @@ local SLE, T, E, L, V, P, G = unpack(select(2, ...)) local LSM = LibStub("LibSharedMedia-3.0") local A = SLE:NewModule("Actionbars", 'AceHook-3.0', 'AceEvent-3.0') - local AB = E:GetModule('ActionBars'); - +--GLOBALS: hooksecurefunc, LibStub local _G = _G local NUM_PET_ACTION_SLOTS = NUM_PET_ACTION_SLOTS local NUM_ACTIONBAR_BUTTONS = NUM_ACTIONBAR_BUTTONS +local C_TimerAfter = C_Timer.After A.CheckedTextures = {} @@ -97,7 +97,7 @@ function A:Initialize() end end - C_Timer.After(0.3, function() + C_TimerAfter(0.3, function() if E.private.sle.actionbars.transparentBackdrop then A:BarsBackdrop() end if E.private.sle.actionbars.transparentButtons then A:ButtonsBackdrop() end end) diff --git a/ElvUI_SLE/modules/auras.lua b/ElvUI_SLE/modules/auras.lua index f53c892..7d93cb7 100644 --- a/ElvUI_SLE/modules/auras.lua +++ b/ElvUI_SLE/modules/auras.lua @@ -3,6 +3,7 @@ local SA = SLE:NewModule("Auras", 'AceEvent-3.0') local A = E:GetModule("Auras") local Masque = LibStub("Masque", true) local MasqueGroup = Masque and Masque:Group("ElvUI", "Consolidated Buffs") +--GLOBALS: hooksecurefunc local _G = _G local NUM_LE_RAID_BUFF_TYPES = NUM_LE_RAID_BUFF_TYPES local GameTooltip = GameTooltip diff --git a/ElvUI_SLE/modules/bags.lua b/ElvUI_SLE/modules/bags.lua index 5e6d7e2..1ed862f 100755 --- a/ElvUI_SLE/modules/bags.lua +++ b/ElvUI_SLE/modules/bags.lua @@ -2,6 +2,7 @@ local SLE, T, E, L, V, P, G = unpack(select(2, ...)) local SB = SLE:NewModule("Bags", 'AceHook-3.0') local Pr local B = E:GetModule('Bags') +--GLOBALS: hooksecurefunc local _G = _G local REAGENTBANK_CONTAINER = REAGENTBANK_CONTAINER local C_NewItems = C_NewItems @@ -19,8 +20,10 @@ function SB:UpdateSlot(bagID, slotID) SB:StartAnim(slot); end - if not Pr then Pr = SLE:GetModule("Professions") end - if not Pr.DeconstructionReal then return end + if not Pr then + Pr = SLE:GetModule("Professions") + if not Pr.DeconstructionReal then return end + end if Pr.DeconstructionReal:IsShown() and not slot.hasItem then B:Tooltip_Hide() Pr.DeconstructionReal:OnLeave() diff --git a/ElvUI_SLE/modules/blizzard.lua b/ElvUI_SLE/modules/blizzard.lua index 54404c6..f3469fe 100644 --- a/ElvUI_SLE/modules/blizzard.lua +++ b/ElvUI_SLE/modules/blizzard.lua @@ -99,13 +99,13 @@ function B:Addons(event, addon) end function B:VehicleScale() - local frame = VehicleSeatIndicator + local frame = _G["VehicleSeatIndicator"] frame:SetScale(B.db.vehicleSeatScale) frame.mover:SetSize(B.db.vehicleSeatScale * frame:GetWidth(), B.db.vehicleSeatScale * frame:GetHeight()) end function B:ErrorFrameSize() - UIErrorsFrame:SetSize(B.db.errorframe.width, B.db.errorframe.height) --512 x 60 + _G["UIErrorsFrame"]:SetSize(B.db.errorframe.width, B.db.errorframe.height) --512 x 60 end function B:Initialize() diff --git a/ElvUI_SLE/modules/datatexts.lua b/ElvUI_SLE/modules/datatexts.lua index a4da853..9a43d63 100644 --- a/ElvUI_SLE/modules/datatexts.lua +++ b/ElvUI_SLE/modules/datatexts.lua @@ -1,8 +1,11 @@ local SLE, T, E, L, V, P, G = unpack(select(2, ...)) local DTP = SLE:NewModule('Datatexts', 'AceHook-3.0', 'AceEvent-3.0'); local DT = E:GetModule('DataTexts'); +--GLOBALS: ElvDB, hooksecurefunc local _G = _G local CreateFrame = CreateFrame +local FACTION_ALLIANCE, FACTION_HORDE = FACTION_ALLIANCE, FACTION_HORDE + DTP.values = { [1] = {"TOPLEFT", 0, 3}, [2] = {"TOP", -((E.eyefinity or E.screenwidth)/5), 3}, diff --git a/ElvUI_SLE/modules/loot.lua b/ElvUI_SLE/modules/loot.lua index a45d437..da90b6c 100644 --- a/ElvUI_SLE/modules/loot.lua +++ b/ElvUI_SLE/modules/loot.lua @@ -1,6 +1,10 @@ local SLE, T, E, L, V, P, G = unpack(select(2, ...)) local LT = SLE:NewModule('Loot','AceHook-3.0', 'AceEvent-3.0') local M = E:GetModule('Misc') +--GLOBALS: hooksecurefunc, ChatFrame_AddMessageEventFilter, ChatFrame_RemoveMessageEventFilter, UIParent +local _G = _G +local ConfirmLootSlot = ConfirmLootSlot + LT.PlayerLevel = 0 LT.MaxPlayerLevel = 0 LT.LootItems = 0 --To determine how many items are in our loot cache @@ -242,14 +246,14 @@ function LT:AutoToggle() end function LT:LootAlpha() - LootHistoryFrame:SetAlpha(LT.db.history.alpha or 1) + _G["LootHistoryFrame"]:SetAlpha(LT.db.history.alpha or 1) end function LT:LootShow() local instance = T.IsInInstance() if (not instance and LT.db.history.autohide) then - LootHistoryFrame:Hide() + _G["LootHistoryFrame"]:Hide() end end diff --git a/ElvUI_SLE/modules/misc.lua b/ElvUI_SLE/modules/misc.lua index 3b19992..6f76f74 100644 --- a/ElvUI_SLE/modules/misc.lua +++ b/ElvUI_SLE/modules/misc.lua @@ -1,12 +1,14 @@ local SLE, T, E, L, V, P, G = unpack(select(2, ...)) local M = SLE:NewModule("Misc", 'AceHook-3.0', 'AceEvent-3.0') local Tr = E:GetModule('Threat'); +--GLOBALS: hooksecurefunc, UIParent +local _G = _G local ShowUIPanel, HideUIPanel = ShowUIPanel, HideUIPanel local find = string.find function M:RUReset() local a = E.db.sle.blizzard.rumouseover and 0 or 1 - RaidUtility_ShowButton:SetAlpha(a) + _G["RaidUtility_ShowButton"]:SetAlpha(a) end function M:UpdateThreatPosition() @@ -21,7 +23,7 @@ function M:UpdateThreatPosition() end function M:UpdateThreatConfig() - if IsAddOnLoaded("ElvUI_Config") then + if T.IsAddOnLoaded("ElvUI_Config") then if M.db.threat.enable then E.Options.args.general.args.general.args.threatPosition = { order = 42, @@ -56,25 +58,25 @@ end function M:SetViewport() local scale = 768 / UIParent:GetHeight() - WorldFrame:SetPoint("TOPLEFT", ( M.db.viewport.left * scale ), -( M.db.viewport.top * scale ) ) - WorldFrame:SetPoint("BOTTOMRIGHT", -( M.db.viewport.right * scale ), ( M.db.viewport.bottom * scale ) ) + _G["WorldFrame"]:SetPoint("TOPLEFT", ( M.db.viewport.left * scale ), -( M.db.viewport.top * scale ) ) + _G["WorldFrame"]:SetPoint("BOTTOMRIGHT", -( M.db.viewport.right * scale ), ( M.db.viewport.bottom * scale ) ) end function M:Initialize() if not SLE.initialized then return end M.db = E.db.sle.misc - E:CreateMover(UIErrorsFrame, "UIErrorsFrameMover", L["Error Frame"], nil, nil, nil, "ALL,S&L,S&L MISC") + E:CreateMover(_G["UIErrorsFrame"], "UIErrorsFrameMover", L["Error Frame"], nil, nil, nil, "ALL,S&L,S&L MISC") --GhostFrame Mover. - ShowUIPanel(GhostFrame) - E:CreateMover(GhostFrame, "GhostFrameMover", L["Ghost Frame"], nil, nil, nil, "ALL,S&L,S&L MISC") - HideUIPanel(GhostFrame) + ShowUIPanel(_G["GhostFrame"]) + E:CreateMover(_G["GhostFrame"], "GhostFrameMover", L["Ghost Frame"], nil, nil, nil, "ALL,S&L,S&L MISC") + HideUIPanel(_G["GhostFrame"]) --Raid Utility - if RaidUtility_ShowButton then - E:CreateMover(RaidUtility_ShowButton, "RaidUtility_Mover", L["Raid Utility"], nil, nil, nil, "ALL,S&L,S&L MISC") - local mover = RaidUtility_Mover - local frame = RaidUtility_ShowButton + if _G["RaidUtility_ShowButton"] then + E:CreateMover(_G["RaidUtility_ShowButton"], "RaidUtility_Mover", L["Raid Utility"], nil, nil, nil, "ALL,S&L,S&L MISC") + local mover = _G["RaidUtility_Mover"] + local frame = _G["RaidUtility_ShowButton"] if E.db.movers == nil then E.db.movers = {} end mover:HookScript("OnDragStart", function(self) diff --git a/ElvUI_SLE/modules/nameplates.lua b/ElvUI_SLE/modules/nameplates.lua index f1196f3..ebc36fc 100644 --- a/ElvUI_SLE/modules/nameplates.lua +++ b/ElvUI_SLE/modules/nameplates.lua @@ -5,6 +5,8 @@ local N = SLE:NewModule("Nameplates", 'AceHook-3.0', 'AceEvent-3.0', 'AceTimer-3 local rosterTimer N.targetCount = 0 +local GetNamePlates = C_NamePlate.GetNamePlates + local function Hex(r, g, b) return T.format('|cFF%02x%02x%02x', r * 255, g * 255, b * 255) end @@ -61,7 +63,7 @@ function N:UpdateCount(event,unit,force) if (not T.find(unit, "raid") and not T.find(unit, "party") and not (unit == "player" and force) ) or T.find(unit, "pet") then return end if force and (T.IsInRaid() or T.IsInGroup()) then N:UpdateRoster() end local target - for _, frame in T.pairs(C_NamePlate.GetNamePlates()) do + for _, frame in T.pairs(GetNamePlates()) do if(frame and frame.UnitFrame) then local plate = frame.UnitFrame plate.targetcount:SetText("") diff --git a/ElvUI_SLE/modules/pvp.lua b/ElvUI_SLE/modules/pvp.lua index 0cbef95..9a0f241 100644 --- a/ElvUI_SLE/modules/pvp.lua +++ b/ElvUI_SLE/modules/pvp.lua @@ -18,9 +18,7 @@ local RAID_CLASS_COLORS = RAID_CLASS_COLORS local TopBannerManager_Show = TopBannerManager_Show local BossBanner_BeginAnims = BossBanner_BeginAnims local PlaySound = PlaySound - - - +local CancelPetPVPDuel = C_PetBattles.CancelPVPDuel function PvP:Release() if (PvP.db.rebirth and not HasSoulstone()) or not PvP.db.rebirth then RepopMe() end @@ -56,7 +54,7 @@ function PvP:Duels(event, name) StaticPopup_Hide("DUEL_REQUESTED") cancelled = "REGULAR" elseif event == "PET_BATTLE_PVP_DUEL_REQUESTED" and PvP.db.duels.pet then - C_PetBattles.CancelPVPDuel() + CancelPetPVPDuel() StaticPopup_Hide("PET_BATTLE_PVP_DUEL_REQUESTED") cancelled = "PET" end @@ -89,8 +87,8 @@ end function PvP:Initialize() if not SLE.initialized then return end PvP.db = E.db.sle.pvp - PvP.AlwaysUpFrame = WorldStateAlwaysUpFrame - PvP.CaptureBar1 = WorldStateCaptureBar1 + PvP.AlwaysUpFrame = _G["WorldStateAlwaysUpFrame"] + PvP.CaptureBar1 = _G["WorldStateCaptureBar1"] --AutoRes event self:RegisterEvent("PLAYER_DEAD", "Dead"); --Mover for pvp info diff --git a/ElvUI_SLE/modules/raidmarkers.lua b/ElvUI_SLE/modules/raidmarkers.lua index def9615..c573562 100644 --- a/ElvUI_SLE/modules/raidmarkers.lua +++ b/ElvUI_SLE/modules/raidmarkers.lua @@ -1,7 +1,10 @@ local SLE, T, E, L, V, P, G = unpack(select(2, ...)) local RM = SLE:NewModule('RaidMarkers'); +--GLOBALS: CreateFrame local _G = _G local GameTooltip = GameTooltip +local RegisterStateDriver = RegisterStateDriver +local UnregisterStateDriver = UnregisterStateDriver RM.VisibilityStates = { ["DEFAULT"] = "[noexists, nogroup] hide; show", diff --git a/ElvUI_SLE/modules/raidroleicons.lua b/ElvUI_SLE/modules/raidroleicons.lua index 97f04d9..e54c712 100644 --- a/ElvUI_SLE/modules/raidroleicons.lua +++ b/ElvUI_SLE/modules/raidroleicons.lua @@ -1,11 +1,12 @@ local SLE, T, E, L, V, P, G = unpack(select(2, ...)) local B = SLE:NewModule("BlizzRaid", 'AceEvent-3.0') local PLAYER_REALM = T.gsub(E.myrealm,'[%s%-]','') +--GLOBALS: CreateFrame, hooksecurefunc local _G = _G +local RaiseFrameLevel = RaiseFrameLevel function B:CreateAndUpdateIcons() if not SLE.initialized then return end - local RaiseFrameLevel = RaiseFrameLevel local members = T.GetNumGroupMembers() for i = 1, members do local frame = _G["RaidGroupButton"..i] diff --git a/ElvUI_SLE/modules/toolbars.lua b/ElvUI_SLE/modules/toolbars.lua index 2338184..9f52068 100644 --- a/ElvUI_SLE/modules/toolbars.lua +++ b/ElvUI_SLE/modules/toolbars.lua @@ -3,7 +3,7 @@ local B = LibStub("LibBabble-SubZone-3.0") local BL = B:GetLookupTable() local S = E:GetModule("Skins") local Tools = SLE:NewModule("Toolbars", 'AceHook-3.0', 'AceEvent-3.0') - +--GLOBALS: CreateFrame, hooksecurefunc, UIParent local SeedAnchor, ToolAnchor, PortalAnchor, SalvageAnchor, MineAnchor local farmzones = { BL["Sunsong Ranch"], BL["The Halfhill Market"] } local garrisonzones = { BL["Salvage Yard"], BL["Frostwall Mine"], BL["Lunarfall Excavation"]} diff --git a/ElvUI_SLE/modules/uibuttons.lua b/ElvUI_SLE/modules/uibuttons.lua index 642131f..2f300e2 100644 --- a/ElvUI_SLE/modules/uibuttons.lua +++ b/ElvUI_SLE/modules/uibuttons.lua @@ -4,6 +4,9 @@ local lib = LibStub("LibElv-UIButtons-1.0") local S = E:GetModule("Skins") local RandomRoll = RandomRoll local SendChatMessage = SendChatMessage +local ReloadUI = ReloadUI +--GLOBALS: DBM, VEM, LibStub, Altoholic, AtlasLoot, xCT_Plus, Swatter, SlashCmdList +local _G = _G local function CustomRollCall() local min, max = T.tonumber(E.db.sle.uibuttons.customroll.min), T.tonumber(E.db.sle.uibuttons.customroll.max) @@ -26,7 +29,7 @@ end function UB:AddonSetup(menu) --UB:CreateSeparator("Addon", "SLE_StartSeparator", 1, 2) - menu:CreateDropdownButton("Addon", "Manager", L["AddOns"], L["AddOns Manager"], L["Click to toggle the AddOn Manager frame."], function() GameMenuButtonAddons:Click() end, nil, true) + menu:CreateDropdownButton("Addon", "Manager", L["AddOns"], L["AddOns Manager"], L["Click to toggle the AddOn Manager frame."], function() _G["GameMenuButtonAddons"]:Click() end, nil, true) menu:CreateDropdownButton("Addon", "DBM", L["Boss Mod"], L["Boss Mod"], L["Click to toggle the Configuration/Option Window from the Bossmod you have enabled."], function() DBM:LoadGUI() end, "DBM-Core") menu:CreateDropdownButton("Addon", "VEM", L["Boss Mod"], L["Boss Mod"], L["Click to toggle the Configuration/Option Window from the Bossmod you have enabled."], function() VEM:LoadGUI() end, "VEM-Core") @@ -72,7 +75,7 @@ function UB:SetupBar(menu) LibStub("LibDataBroker-1.1"):GetDataObjectByName("BigWigs"):OnClick("RightButton") end end) - menu:CreateCoreButton("Addon", "A", function(self) GameMenuButtonAddons:Click() end) + menu:CreateCoreButton("Addon", "A", function(self) _G["GameMenuButtonAddons"]:Click() end) else menu:CreateCoreButton("Config", "C") UB:ConfigSetup(menu) diff --git a/ElvUI_SLE/modules/vehicle.lua b/ElvUI_SLE/modules/vehicle.lua index bd4622b..b409f65 100644 --- a/ElvUI_SLE/modules/vehicle.lua +++ b/ElvUI_SLE/modules/vehicle.lua @@ -2,6 +2,11 @@ local SLE, T, E, L, V, P, G = unpack(select(2, ...)) local EVB = SLE:NewModule("EnhancedVehicleBar") local AB = E:GetModule("ActionBars"); local LAB = LibStub("LibActionButton-1.0-ElvUI") +--GLOBALS: CreateFrame, hooksecurefunc, UIParent +local _G = _G +local RegisterStateDriver = RegisterStateDriver +local UnregisterStateDriver = UnregisterStateDriver +local GetVehicleBarIndex, GetVehicleBarIndex, GetOverrideBarIndex = GetVehicleBarIndex, GetVehicleBarIndex, GetOverrideBarIndex -- Regular Button for these bars are 52. 52 * .71 = ~37.. I just rounded it up to 40 and called it good. function EVB:Animate(bar, x, y, duration)