Verified Commit 055da266 authored by Repooc's avatar Repooc
Browse files

pull threat related stuff all the way out and some minor cleanup

parent 813cb74b
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: unpack, select, hooksecurefunc, UIParent, WorldFrame, CinematicFrame, StopCinematic, CanCancelScene, CancelScene, VehicleExit, _G, ShowUIPanel, HideUIPanel, strfind, RAID_CONTROL, CinematicFrame_CancelCinematic
local _G = _G
local ShowUIPanel, HideUIPanel = ShowUIPanel, HideUIPanel
-- --Threat
-- function M:ElvUIConfig_OnLoad(event, addon)
-- if addon ~= "ElvUI_OptionsUI" then return end
-- M:Threat_UpdateConfig()
-- M:UnregisterEvent("ADDON_LOADED")
-- end
-- function M:Threat_UpdatePosition()
-- if not E.db.general.threat.enable or not M.db.threat or not M.db.threat.enable then return end
-- Tr.bar:SetInside(M.db.threat.position)
-- Tr.bar:SetParent(M.db.threat.position)
-- Tr.bar.text:FontTemplate(nil, E.db.general.threat.textSize, E.db.general.threat.textOutline)
-- Tr.bar:SetFrameStrata('MEDIUM')
-- Tr.bar:SetAlpha(1)
-- end
-- function M:Threat_UpdateConfig()
-- if IsAddOnLoaded("ElvUI_OptionsUI") then
-- if M.db.threat.enable then
-- E.Options.args.general.args.general.args.threatGroup.args.position = {
-- order = 42,
-- name = L["Position"],
-- desc = L["This option have been disabled by Shadow & Light. To return it you need to disable S&L's option. Click here to see it's location."],
-- type = "execute",
-- func = function() E.Libs["AceConfigDialog"]:SelectGroup("ElvUI", "sle") end,
-- }
-- else
-- E.Options.args.general.args.general.args.threatGroup.args.position = {
-- order = 42,
-- type = 'select',
-- name = L["Position"],
-- desc = L["Adjust the position of the threat bar to either the left or right datatext panels."],
-- values = {
-- ['LEFTCHAT'] = L["Left Chat"],
-- ['RIGHTCHAT'] = L["Right Chat"],
-- },
-- get = function(info) return E.db.general.threat.position end,
-- set = function(info, value) E.db.general.threat.position = value; Tr:UpdatePosition() end,
-- }
-- end
-- end
-- end
--Viewports
function M:SetAllPoints(...)
......@@ -123,28 +74,23 @@ function M:RaidUtility_Hook()
M.RaidUtility_OnDragStop(mover)
end
frame:RegisterForDrag("") --No buttons for drag
frame:HookScript("OnEnter", M.RaidUtility_OnEnter)
frame:HookScript("OnLeave", M.RaidUtility_OnLeave)
frame:RegisterForDrag('') --No buttons for drag
frame:HookScript('OnEnter', M.RaidUtility_OnEnter)
frame:HookScript('OnLeave', M.RaidUtility_OnLeave)
M.RaidUtility_OnLeave(frame)
end
function M:Initialize()
if not SLE.initialized then return end
M.db = E.db.sle.misc
E:CreateMover(_G["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
E:CreateMover(_G.GhostFrame, "SLEGhostFrameMover", L["Ghost Frame"], nil, nil, nil, "ALL,S&L,S&L MISC")
E:CreateMover(_G.GhostFrame, 'SLEGhostFrameMover', L["Ghost Frame"], nil, nil, nil, 'ALL,S&L,S&L MISC')
_G.GhostFrame.mover:SetSize(_G.GhostFrameContentsFrame:GetSize())
--Raid Utility
if _G["RaidUtility_ShowButton"] then M:RaidUtility_Hook() end
-- --Threat
-- hooksecurefunc(Tr, 'UpdatePosition', M.Threat_UpdatePosition)
-- M:RegisterEvent("ADDON_LOADED", "ElvUIConfig_OnLoad")
-- M:Threat_UpdatePosition()
if _G['RaidUtility_ShowButton'] then M:RaidUtility_Hook() end
--Viewport
function CinematicFrame_CancelCinematic()
......@@ -165,12 +111,10 @@ function M:Initialize()
WorldFrame.SetAllPoints = M.SetAllPoints
M:SetViewport()
hooksecurefunc(E, "PixelScaleChanged", M.SetViewport)
hooksecurefunc(E, 'PixelScaleChanged', M.SetViewport)
function M:ForUpdateAll()
M.db = E.db.sle.misc
-- M:Threat_UpdateConfig()
-- M:Threat_UpdatePosition()
M:SetViewport()
end
end
......
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