forked from Swater96/VanillaGuide
- Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathVGuideFu.lua
More file actions
Latest commit
217 lines (195 loc) · 5.64 KB
/
Copy pathVGuideFu.lua
File metadata and controls
217 lines (195 loc) · 5.64 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
--[[--------------------------------------------------
----- VanillaGuide -----
------------------
VGuideFu.lua
Authors: mrmr
Version: 1.04.3
------------------------------------------------------
Description:
Fubar plugin for VGuide
1.00
-- Initial Ace2 release
1.99a
-- Ally addition starter version
1.03
-- No Changes. Just adjusting "version".
1.99x for a beta release was a weird choise.
1.04.1
-- Just minor adjustments to reflect changes in the
rest of addon
1.04.2
-- no changes in here for this revision
1.04.3
-- no changes in here for this revision
------------------------------------------------------
Connection:
--]]--------------------------------------------------
ifnotVGuidethen
return
end
ifnotIsAddOnLoaded("Fubar") then
return
end
localtablet=AceLibrary("Tablet-2.0")
VGuideFu=AceLibrary("AceAddon-2.0"):new("FuBarPlugin-2.0")
VGuideFu.hasIcon="Interface\\AddOns\\VanillaGuide\\Textures\\FuBar_Icon"
-- using an AceOptions data table
VGuideFu.OnMenuRequest= {
type='group',
args= {
titletoggle= {
order=1,
type="toggle",
name="Show Title",
desc="Click to Toggle Title Visibility",
get="IsTitle",
set="ToggleTitle",
},
guidenametoggle= {
order=2,
type="toggle",
name="Show Guide Name",
desc="Click to Toggle Guide Name Visibility",
get="IsGuideName",
set="ToggleGuideName",
},
guidesteptoggle= {
order=3,
type="toggle",
name="Show Guide Step",
desc="Click to Toggle Guide Step Visibility",
get="IsGuideStep",
set="ToggleGuideStep",
},
lablestoggle= {
order=4,
type="toggle",
name="Show Labels",
desc="Click to Toggle Labels Visibility",
get="IsLabels",
set="ToggleLabels",
},
}
}
functionVGuideFu:OnInitialize()
self.title="VanillaGuide"
self.hasIcon="Interface\\AddOns\\VanillaGuide\\Textures\\FuBar_Icon.tga"
self.cannotHideText=true
self.overrideMenu=false
self.hideMenuTitle=true
self.defaultPosition="RIGHT"
self.defaultMinimapPosition=180
self.independentProfile=false
end
functionVGuideFu:OnEnable()
self.GuideID=nil
self.GuideName=nil
self.GuideStep=nil
self.GuideStepLabel=nil
self:ShowIcon()
self:SetIcon(true)
end
functionVGuideFu:IsTitle()
returnVGuide.Settings.db.char.VGuideFu.ShowTitle
end
functionVGuideFu:ToggleTitle()
VGuide.Settings.db.char.VGuideFu.ShowTitle=notVGuide.Settings.db.char.VGuideFu.ShowTitle
self:UpdateText()
end
functionVGuideFu:IsGuideName()
returnVGuide.Settings.db.char.VGuideFu.ShowGuideName
end
functionVGuideFu:ToggleGuideName()
VGuide.Settings.db.char.VGuideFu.ShowGuideName=notVGuide.Settings.db.char.VGuideFu.ShowGuideName
self:UpdateText()
end
functionVGuideFu:IsGuideStep()
returnVGuide.Settings.db.char.VGuideFu.ShowGuideStep
end
functionVGuideFu:ToggleGuideStep()
VGuide.Settings.db.char.VGuideFu.ShowGuideStep=notVGuide.Settings.db.char.VGuideFu.ShowGuideStep
self:UpdateText()
end
functionVGuideFu:IsLabels()
returnVGuide.Settings.db.char.VGuideFu.ShowLabels
end
functionVGuideFu:ToggleLabels()
VGuide.Settings.db.char.VGuideFu.ShowLabels=notVGuide.Settings.db.char.VGuideFu.ShowLabels
self:UpdateText()
end
functionVGuideFu:OnDataUpdate()
self.GuideID=VGuide.Settings.db.char.GuideValues.GuideID
self.GuideName=VGuide.Display:GetGuideTitle()
self.GuideStep=VGuide.Settings.db.char.GuideValues.Step
self.GuideStepLabel=VGuide.Display:GetStepLabel()
end
functionVGuideFu:OnTextUpdate()
localguideLabel=self.GuideNameor""
localstep=self.GuideStepor""
localtextTitle="|c00FFFF00VGuide"
localtextGuideNameLabel="|c0000FF00Guide:"
localtextGuideStepLabel="|c0000FF00Step:"
localwhiteTextColor="|c00FFFFFF"
localtext=""
ifnotself:IsLabels() then
textGuideNameLabel=""
textGuideStepLabel=""
end
ifself:IsTitle() then
text=text..textTitle
end
ifself:IsGuideName() then
ifself:IsTitle() then
text=text.." - "
end
text=text..textGuideNameLabel..whiteTextColor..guideLabel
end
ifself:IsGuideStep() then
ifself:IsGuideName() orself:IsTitle() then
text=text.." - "
end
text=text..textGuideStepLabel..whiteTextColor..step
end
self:SetText(text)
end
functionVGuideFu:OnTooltipUpdate()
tablet:SetHint("Click to Toggle VGuide's Frame")
-- as a rule, if you have an OnClick or OnDoubleClick or OnMouseUp or
-- OnMouseDown, you should set a hint.
localcat=tablet:AddCategory(
"text", "Guide",
"columns", 1,
"child_textR", 1,
"child_textG", 1,
"child_textB", 0
)
cat:AddLine(
"text", "|c00FFFF00" ..tostring(self.GuideName) .."|r"
)
cat=tablet:AddCategory(
"text", "Step Label",
"columns", 1,
"child_textR", 1,
"child_textG", 1,
"child_textB", 1
)
cat:AddLine(
"text", tostring(self.GuideStepLabel)
)
end
functionVGuideFu:OnClick()
localframe=getglobal("VG_MainFrame")
localfSettings=getglobal("VG_SettingsFrame")
ifframe:IsVisible() then
frame:Hide()
iffSettings:IsVisible() then
fSettings.showthis=true
fSettings:Hide()
end
else
frame:Show()
iffSettings.showthisthen
fSettings:Show()
end
end
end