/
guide.lua
executable file
·72 lines (63 loc) · 1.53 KB
/
guide.lua
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
_G = getfenv(0)
local H = {}
H.FCF_OnUpdate = FCF_OnUpdate
local OnUpdate = function(elapsed)
H.FCF_OnUpdate(elapsed)
local vg = _G['VG_MainFrame']
local vgs = _G['VG_SettingsFrame']
if vg and (MouseIsOver(ChatFrame1, 45, -10, -5, 5) or MouseIsOver(ChatFrame3, 45, -10, -5, 5) or not vg.embedded) then
if ChatFrame3:IsShown() then
vg:Show()
if vgs.showthis then
vgs:Show()
end
else
vg:Hide()
if vgs:IsVisible() then
vgs.showthis = true
vgs:Hide()
end
end
vg.embedded = true
end
end
local AddWindow = function(i)
local _, _, _, _, _, _, shown = GetChatWindowInfo(i)
if not shown then
SetChatWindowShown(3, true)
SetChatWindowName(3, 'Quests')
--[[for _, v in pairs(
{
ChatFrame3,
ChatFrame3Tab,
}
) do
v:Show()
end]]
end
end
local AddGuide = function(parent)
local vg = _G['VG_MainFrame']
vg:Hide()
vg:RegisterForDrag(nil)
vg:SetPoint('TOPLEFT', parent)
vg:SetPoint('BOTTOMRIGHT', parent, 0, -6)
vg:SetBackdrop(nil)
vg:SetScript('OnMouseDown', nil)
for _, v in pairs({vg:GetChildren()}) do
if v:GetBackdrop() then
v:SetBackdrop(nil)
end
end
end
local OnEvent = function(n)
AddWindow(3)
ChatFrame_RemoveAllMessageGroups(ChatFrame3)
ChatFrame_RemoveAllChannels(ChatFrame3)
AddGuide(ChatFrame3)
end
FCF_OnUpdate = OnUpdate
local e = CreateFrame'Frame'
e:RegisterEvent'PLAYER_LOGIN'
e:SetScript('OnEvent', OnEvent)
--