-
-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathTellMeWhen.xml
200 lines (171 loc) · 5.38 KB
/
TellMeWhen.xml
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
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/ .. \FrameXML\UI.xsd">
<!-- TEMPLATES -->
<Frame parentKey="border" name="TellMeWhen_GenericBorder" virtual="true" setAllPoints="true">
<Size x="1" y="1"/>
<Layers>
<Layer level="BACKGROUND">
<Texture parentKey="borderTop">
<Size x="1" y="1"/>
</Texture>
<Texture parentKey="borderBottom">
<Size x="1" y="1"/>
</Texture>
<Texture parentKey="borderLeft">
<Size x="1" y="1"/>
<Anchors>
<Anchor point="TOPLEFT" relativeKey="$parent.borderTop" relativePoint="BOTTOMLEFT"/>
<Anchor point="BOTTOMLEFT" relativeKey="$parent.borderBottom" relativePoint="TOPLEFT"/>
</Anchors>
</Texture>
<Texture parentKey="borderRight">
<Size x="1" y="1"/>
<Anchors>
<Anchor point="TOPRIGHT" relativeKey="$parent.borderTop" relativePoint="BOTTOMRIGHT"/>
<Anchor point="BOTTOMRIGHT" relativeKey="$parent.borderBottom" relativePoint="TOPRIGHT"/>
</Anchors>
</Texture>
</Layer>
</Layers>
<Scripts>
<OnLoad>
function self:SetBorderSize(pixels)
if not TMW then return end
self.size = pixels
self.borderTop:ClearAllPoints()
self.borderBottom:ClearAllPoints()
for i, tex in TMW:Vararg(self:GetRegions()) do
tex:SetShown(pixels ~= 0)
tex:SetSize(math.abs(pixels), math.abs(pixels))
end
-- Negative sizes should make inset borders.
-- Positive sizes will make outset borders
if 0 > pixels then
pixels = 0
end
self.borderTop:SetPoint("TOPLEFT", -pixels, pixels)
self.borderTop:SetPoint("TOPRIGHT", pixels, pixels)
self.borderBottom:SetPoint("BOTTOMLEFT", -pixels, -pixels)
self.borderBottom:SetPoint("BOTTOMRIGHT", pixels, -pixels)
end
function self:SetColor(r, g, b, a)
if not TMW then return end
a = a or 1
for i, tex in TMW:Vararg(self:GetRegions()) do
tex:SetColorTexture(r, g, b, a)
end
end
self:SetBorderSize(1)
self:SetColor(0, 0, 0, 1)
</OnLoad>
</Scripts>
</Frame>
<Frame name="TellMeWhen_GroupTemplate" enableMouse="false" movable="true" parent="TMW" virtual="true">
<Size x="1" y="1"/>
</Frame>
<Frame name="TellMeWhen_GlobalGroupTemplate" inherits="TellMeWhen_GroupTemplate" virtual="true">
<Frames>
<Frame inherits="TellMeWhen_GenericBorder">
<Scripts>
<OnSizeChanged>
self:SetScale(1/self:GetParent():GetEffectiveScale())
</OnSizeChanged>
</Scripts>
</Frame>
</Frames>
<Scripts>
<OnLoad>
self.border:SetBorderSize(1)
self.border:SetColor(0, 0.7647, 0, 0.75)
</OnLoad>
</Scripts>
</Frame>
<Button name="TellMeWhen_IconTemplate" virtual="true" enableMouse="true" hidden="true">
<Size x="30" y="30"/>
</Button>
<!-- END TEMPLATES -->
<Cooldown hidden="true">
<!-- cooldown bug fixer.
Seems to fix the long-standing bug once and for all where cooldown models would
not show up until one was initiated somewhere outside a TMW icon.
Don't ask why this works, because I don't have a clue. But, it does. So leave it alone.-->
<Scripts>
<OnLoad>
self:SetCooldown(GetTime(), 1)
</OnLoad>
</Scripts>
</Cooldown>
<Frame name="TellMeWhen_InterfaceOptionsPanel">
<Layers>
<Layer level="ARTWORK">
<FontString parentKey="title" inherits="GameFontNormalHuge" justifyH="CENTER" text="TellMeWhen">
<Size y="150"/>
<Anchors>
<Anchor point="TOP" y="-50"/>
<Anchor point="LEFT" x="20"/>
<Anchor point="RIGHT" x="-20"/>
</Anchors>
</FontString>
</Layer>
</Layers>
<Frames>
<!-- Much of this is copied from TellMeWhen_ButtonTemplate because that template is defined in the options. -->
<Button parentKey="Button">
<Size x="144" y="15"/>
<Anchors>
<Anchor point="TOP" relativeKey="$parent.title" relativePoint="BOTTOM" y="-10"/>
</Anchors>
<NormalFont style="GameFontNormal"/>
<HighlightFont style="GameFontHighlight"/>
<Frames>
<Frame inherits="TellMeWhen_GenericBorder" >
<Scripts>
<OnLoad inherit="prepend">
self:SetBorderSize(-1)
self:SetColor(.4, .4, .4, 1)
</OnLoad>
</Scripts>
</Frame>
</Frames>
<Layers>
<Layer level="BACKGROUND">
<Texture parentKey="Background" setAllPoints="true">
<Color r="0.15" g="0.15" b="0.15" a="0.5"/>
</Texture>
</Layer>
</Layers>
<Scripts>
<OnLoad>
if TMW then
TMW:TT(self, "MAINOPTIONS_SHOW")
self:SetText(TMW.L["MAINOPTIONS_SHOW"])
else
self:SetText("TellMeWhen was unable to load.")
self:Disable()
end
self:SetWidth(self:GetTextWidth() + 10)
self:SetFrameLevel(self:GetFrameLevel() + 2)
self:SetScale(2)
</OnLoad>
<OnClick>
TMW:ClickSound()
TMW:SlashCommand("options")
</OnClick>
</Scripts>
</Button>
</Frames>
<Scripts>
<OnLoad>
self.name = "TellMeWhen"
self.title:SetText("TellMeWhen v" .. TELLMEWHEN_VERSION_FULL)
self.title:SetFont("Fonts\\FRIZQT__.TTF", 40, "THINOUTLINE")
if InterfaceOptions_AddCategory then
InterfaceOptions_AddCategory(self)
else
-- WoW 11.0+
local category, layout = Settings.RegisterCanvasLayoutCategory(self, self.name);
Settings.RegisterAddOnCategory(category);
end
</OnLoad>
</Scripts>
</Frame>
</Ui>