-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCore.lua
More file actions
79 lines (63 loc) · 2.69 KB
/
Copy pathCore.lua
File metadata and controls
79 lines (63 loc) · 2.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
local _, UI = ...
local Setup = CreateFrame("Frame")
Setup:RegisterEvent("PLAYER_LOGIN")
Setup:RegisterEvent("PLAYER_ENTERING_WORLD")
Setup:SetScript("OnEvent", function(self, event)
CleanUIPositions = CleanUIPositions or {}
if CleanUIClassPortraits == nil then
CleanUIClassPortraits = true
end
if CleanUIPositions.HideGryphons == nil then
CleanUIPositions.HideGryphons = true
end
if TargetFrameToTHealthBar then UI.ProtectFrame(TargetFrameToTHealthBar) end
if FocusFrameToTHealthBar then UI.ProtectFrame(FocusFrameToTHealthBar) end
if UI.RefreshPortraits then
UI.RefreshPortraits()
end
end)
SLASH_CLEANUI1 = "/cui"
SlashCmdList["CLEANUI"] = function(msg)
msg = (msg or ""):lower()
if msg == "reset" then
CleanUIPositions = {}
CleanUIPositions.HideGryphons = true
CleanUIClassPortraits = true
local frames = {
PlayerFrame, TargetFrame, FocusFrame, PetFrame,
TargetFrameToT, FocusFrameToT,
CleanUIPartyAnchor, CleanUIPetBarAnchor,
CleanUIStanceBarAnchor, CleanUIMicroMenuAnchor, CleanUIBagBarAnchor,
}
for i = 1, 4 do
table.insert(frames, _G["PartyMemberFrame"..i])
table.insert(frames, _G["PartyMemberFrame"..i.."PetFrame"])
end
for _, f in pairs(frames) do
if f then
if f.SetMovable then f:SetMovable(true) end
f:SetUserPlaced(false)
f:ClearAllPoints()
end
end
print("|cff00ff00CleanUI:|r UI reset to defaults (Gryphons Hidden). Reloading...")
ReloadUI()
elseif msg:find("party") and msg:find("test") then
CleanUI_TestActive = not CleanUI_TestActive
if UI.UpdatePartyLayout then UI.UpdatePartyLayout() end
print("|cff00ff00CleanUI:|r Party Test Mode " .. (CleanUI_TestActive and "|cff00ff00Enabled|r" or "|cffff0000Disabled|r"))
elseif msg == "portrait" then
CleanUIClassPortraits = not CleanUIClassPortraits
if UI.RefreshPortraits then UI.RefreshPortraits() end
print("|cff00ff00CleanUI:|r Portraits set to " .. (CleanUIClassPortraits and "|cff00ff00Class Icons|r" or "|cffff00003D Faces|r"))
end
end
hooksecurefunc("TargetofTarget_Update", function(self)
if InCombatLockdown() then return end
local name = (self == TargetFrameToT) and "TargetFrameToT" or "FocusFrameToT"
local parent = (self == TargetFrameToT) and TargetFrame or FocusFrame
if not CleanUIPositions or not CleanUIPositions[name] then
self:ClearAllPoints()
self:SetPoint("BOTTOMRIGHT", parent, "BOTTOMRIGHT", -10, -10)
end
end)