Skip to content

Commit f94930b

Browse files
Updated HelpTipTemplate
1 parent 9789f03 commit f94930b

5 files changed

Lines changed: 97 additions & 60 deletions

File tree

angTemplates/LegolandoTemplates/Legolando_HelpTipTemplate/Legolando_HelpTipTemplate.lua

Lines changed: 56 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
Legolando_HelpTipCloseButtonMixin = CreateFromMixins(ButtonStateBehaviorMixin);
1+
Legolando_HelpTipCloseButtonMixin_Angleur = CreateFromMixins(ButtonStateBehaviorMixin);
22

33
local atlas
44
if WOW_PROJECT_ID == WOW_PROJECT_MAINLINE then
55
atlas = "uitools-icon-close"
66
elseif WOW_PROJECT_ID == WOW_PROJECT_CATACLYSM_CLASSIC or WOW_PROJECT_ID == WOW_PROJECT_CLASSIC or WOW_PROJECT_ID == 19 then
77
atlas = "simplecheckout-close-normal-1x"
88
end
9-
function Legolando_HelpTipCloseButtonMixin:GetAtlas()
9+
function Legolando_HelpTipCloseButtonMixin_Angleur:GetAtlas()
1010
if self:IsDown() then
1111
return atlas;
1212
end
1313
return atlas;
1414
end
1515

16-
function Legolando_HelpTipCloseButtonMixin:OnButtonStateChanged()
16+
function Legolando_HelpTipCloseButtonMixin_Angleur:OnButtonStateChanged()
1717
self.Texture:SetAtlas(self:GetAtlas(), TextureKitConstants.UseAtlasSize);
1818
end
1919

@@ -109,21 +109,21 @@ HelpTip.halfWidth = HelpTip.width / 2;
109109

110110

111111

112-
Legolando_HelpTipTemplateMixin = {};
112+
Legolando_HelpTipTemplateMixin_Angleur = {};
113113

114-
Legolando_HelpTipTemplateMixin.warningFrame = nil
114+
Legolando_HelpTipTemplateMixin_Angleur.warningFrame = nil
115115

116-
Legolando_HelpTipTemplateMixin.acknowledgeThisHide = false
116+
Legolando_HelpTipTemplateMixin_Angleur.acknowledgeThisHide = false
117117

118-
Legolando_HelpTipTemplateMixin.savedTable = nil
118+
Legolando_HelpTipTemplateMixin_Angleur.savedVarTable = nil
119119

120-
Legolando_HelpTipTemplateMixin.partActive = nil
120+
Legolando_HelpTipTemplateMixin_Angleur.partActive = nil
121121

122-
Legolando_HelpTipTemplateMixin.onSkipCallback = nil
122+
Legolando_HelpTipTemplateMixin_Angleur.onSkipCallback = nil
123123

124-
Legolando_HelpTipTemplateMixin.parts = {}
124+
Legolando_HelpTipTemplateMixin_Angleur.parts = {}
125125
--[[
126-
Legolando_HelpTipTemplateMixin.parts[i] = {
126+
Legolando_HelpTipTemplateMixin_Angleur.parts[i] = {
127127
text, -- also acts as a key for various API, MUST BE SET
128128
textColor = HIGHLIGHT_FONT_COLOR,
129129
textJustifyH = "LEFT",
@@ -154,7 +154,7 @@ Legolando_HelpTipTemplateMixin.parts = {}
154154
}
155155
]]--
156156

157-
function Legolando_HelpTipTemplateMixin:OnLoad()
157+
function Legolando_HelpTipTemplateMixin_Angleur:OnLoad()
158158
self.Arrow.Arrow:ClearAllPoints();
159159
self.Arrow.Arrow:SetPoint("CENTER");
160160
self.Arrow.Glow:ClearAllPoints();
@@ -171,7 +171,7 @@ function Legolando_HelpTipTemplateMixin:OnLoad()
171171
end)
172172
end
173173

174-
function Legolando_HelpTipTemplateMixin:OnHide()
174+
function Legolando_HelpTipTemplateMixin_Angleur:OnHide()
175175
if self.warningFrame then
176176
self.warningFrame:Hide()
177177
end
@@ -197,7 +197,7 @@ function Legolando_HelpTipTemplateMixin:OnHide()
197197
self:GoToNextPart()
198198
end
199199

200-
function Legolando_HelpTipTemplateMixin:AttachWarning(warningFrame)
200+
function Legolando_HelpTipTemplateMixin_Angleur:AttachWarning(warningFrame)
201201
self.warningFrame = warningFrame
202202

203203
warningFrame.noButton:SetScript("OnClick", function()
@@ -208,66 +208,83 @@ function Legolando_HelpTipTemplateMixin:AttachWarning(warningFrame)
208208
end)
209209
end
210210

211-
function Legolando_HelpTipTemplateMixin:SkipTutorial()
212-
Angleur_BetaPrint("Skipping Tutorial")
211+
function Legolando_HelpTipTemplateMixin_Angleur:SkipTutorial()
212+
local teeburu = self.savedVarTable
213+
if not teeburu then
214+
print("no saved variable table attached")
215+
return
216+
end
213217
self.partActive = #self.parts + 1
214-
if self.savedTable then
215-
self.savedTable.part = self.partActive
218+
if self.reference then
219+
teeburu[self.reference] = self.partActive
216220
end
217221
self:Hide()
218222
if self.onSkipCallback then
219223
self.onSkipCallback()
220224
end
221225
end
222-
function Legolando_HelpTipTemplateMixin:CompletePartWithAction(part)
226+
function Legolando_HelpTipTemplateMixin_Angleur:CompletePartWithAction(part)
223227
if part == self.partActive then
224228
self.acknowledgeThisHide = true
225229
self:Hide()
226-
Angleur_BetaPrint("Completing part with action.")
227230
end
228231
end
229232

230-
function Legolando_HelpTipTemplateMixin:Activate(startingPart)
233+
function Legolando_HelpTipTemplateMixin_Angleur:Activate(startingPart)
234+
local teeburu = self.savedVarTable
235+
if not teeburu then
236+
print("no saved variable table attached")
237+
return
238+
end
239+
if not self.reference then
240+
print("no checkbox reference string")
241+
return
242+
end
243+
if teeburu[self.reference] == nil then
244+
print("checkbox reference not found in saved variable table")
245+
return
246+
end
231247
if startingPart > #self.parts then
232-
Angleur_BetaPrint("Tutorial has already been completed.")
233248
return
234249
end
235250
self.partActive = startingPart
236251
if self.warningFrame then self.warningFrame:Hide() end
237252
self:ShowActivePart()
238253
end
239254

240-
function Legolando_HelpTipTemplateMixin:GoToNextPart()
241-
Angleur_BetaPrint("Going to next part: ")
255+
function Legolando_HelpTipTemplateMixin_Angleur:GoToNextPart()
256+
local teeburu = self.savedVarTable
257+
if not teeburu then
258+
print("no saved variable table attached")
259+
return
260+
end
242261
self.partActive = self.partActive + 1
243-
if self.savedTable then
244-
self.savedTable.part = self.partActive
262+
if self.reference then
263+
teeburu[self.reference] = self.partActive
245264
end
246265
if self.parts[self.partActive] then
247266
self:ShowActivePart()
248267
else
249268
self.partActive = nil
250-
Angleur_BetaPrint("Iterating through tutorials over.")
251269
end
252270
end
253271

254-
function Legolando_HelpTipTemplateMixin:ShowActivePart()
272+
function Legolando_HelpTipTemplateMixin_Angleur:ShowActivePart()
255273
thisPart = self.parts[self.partActive]
256-
Angleur_BetaPrint("ShowActivePart: ", thisPart.text)
257274
self:AnchorAndRotate(thisPart)
258275
self:Layout(thisPart)
259276
self:Show()
260277
end
261278

262-
function Legolando_HelpTipTemplateMixin.GetTargetPoint(targetPoint)
279+
function Legolando_HelpTipTemplateMixin_Angleur.GetTargetPoint(targetPoint)
263280
return targetPoint or HelpTip.Point.BottomEdgeCenter;
264281
end
265282

266-
function Legolando_HelpTipTemplateMixin.GetAlignment(alignment)
283+
function Legolando_HelpTipTemplateMixin_Angleur.GetAlignment(alignment)
267284
return alignment or HelpTip.Alignment.Center;
268285
end
269286

270-
function Legolando_HelpTipTemplateMixin.GetButtonInfo(buttonStyle)
287+
function Legolando_HelpTipTemplateMixin_Angleur.GetButtonInfo(buttonStyle)
271288
local buttonStyle = buttonStyle or HelpTip.ButtonStyle.None;
272289
return HelpTip.Buttons[buttonStyle];
273290
end
@@ -282,7 +299,7 @@ end
282299
offsetY = offsetY * rotationInfo.modOffsetY;
283300
return offsetX, offsetY;
284301
end
285-
function Legolando_HelpTipTemplateMixin:AnchorAndRotate(partTable, overrideTargetPoint, overrideAlignment)
302+
function Legolando_HelpTipTemplateMixin_Angleur:AnchorAndRotate(partTable, overrideTargetPoint, overrideAlignment)
286303
local baseTargetPoint = self.GetTargetPoint(partTable.targetPoint);
287304
local targetPoint = overrideTargetPoint or baseTargetPoint;
288305
local alignment = overrideAlignment or self.GetAlignment(partTable.alignment);
@@ -320,12 +337,12 @@ function Legolando_HelpTipTemplateMixin:AnchorAndRotate(partTable, overrideTarge
320337
partTable.appliedTargetPoint = targetPoint;
321338
end
322339

323-
function Legolando_HelpTipTemplateMixin.GetHighlightTextureSize(partTable)
340+
function Legolando_HelpTipTemplateMixin_Angleur.GetHighlightTextureSize(partTable)
324341
if not partTable.highlightTextureSizeMultiplierX then partTable.highlightTextureSizeMultiplierX = 1 end
325342
if not partTable.highlightTextureSizeMultiplierY then partTable.highlightTextureSizeMultiplierY = 1 end
326343
end
327344

328-
function Legolando_HelpTipTemplateMixin:Layout(partTable)
345+
function Legolando_HelpTipTemplateMixin_Angleur:Layout(partTable)
329346
local targetPoint = self.GetTargetPoint(partTable.targetPoint);
330347
local pointInfo = HelpTip.PointInfo[targetPoint];
331348
local buttonInfo = self.GetButtonInfo(partTable.buttonStyle);
@@ -373,7 +390,7 @@ function Legolando_HelpTipTemplateMixin:Layout(partTable)
373390
self:SetHeight(height);
374391
end
375392

376-
function Legolando_HelpTipTemplateMixin:SetHighlightTexture(partTable)
393+
function Legolando_HelpTipTemplateMixin_Angleur:SetHighlightTexture(partTable)
377394
if partTable.hideHighlightTexture == true then return end
378395
local multiX = partTable.highlightTextureSizeMultiplierX
379396
local multiY = partTable.highlightTextureSizeMultiplierY
@@ -391,7 +408,7 @@ function Legolando_HelpTipTemplateMixin:SetHighlightTexture(partTable)
391408
self.featureHighlight:Show()
392409
end
393410

394-
function Legolando_HelpTipTemplateMixin:ApplyText(partTable)
411+
function Legolando_HelpTipTemplateMixin_Angleur:ApplyText(partTable)
395412
local info = partTable;
396413
self.Text:SetText(partTable.text);
397414
local color = info.textColor or HIGHLIGHT_FONT_COLOR;
@@ -407,14 +424,14 @@ function Legolando_HelpTipTemplateMixin:ApplyText(partTable)
407424
self.Text:SetJustifyH(justifyH);
408425
end
409426

410-
function Legolando_HelpTipTemplateMixin:AnchorArrow(rotationInfo, alignment)
427+
function Legolando_HelpTipTemplateMixin_Angleur:AnchorArrow(rotationInfo, alignment)
411428
local arrowAnchor = rotationInfo.anchors[alignment];
412429
local offsetX, offsetY = transformOffsetsForRotation(HelpTip.ArrowOffsets[alignment], rotationInfo);
413430
self.Arrow:ClearAllPoints();
414431
self.Arrow:SetPoint("CENTER", self, arrowAnchor, offsetX, offsetY);
415432
end
416433

417-
function Legolando_HelpTipTemplateMixin:RotateArrow(rotation)
434+
function Legolando_HelpTipTemplateMixin_Angleur:RotateArrow(rotation)
418435
if self.Arrow.rotation == rotation then
419436
return;
420437
end

angTemplates/LegolandoTemplates/Legolando_HelpTipTemplate/Legolando_HelpTipTemplate.xml

Lines changed: 37 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,50 @@
11
<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/
22
..\FrameXML\UI.xsd">
33
<!-- Needs Angleur_WarningFrame to work, located in GeneralTemplates -->
4-
<Frame name="Legolando_HelpTipCloseWarning" toplevel="true" frameStrata="DIALOG" inherits="Angleur_WarningFrame" virtual="true" hidden="true">
4+
5+
<Script file="Legolando_HelpTipTemplate.lua"/>
6+
7+
<Frame name="Legolando_HelpTipCloseWarning_Angleur" toplevel="true" frameStrata="DIALOG" inherits="BasicFrameTemplateWithInset" virtual="true" hidden="true">
8+
<Size x="320" y="128"/>
59
<Anchors>
610
<Anchor point="CENTER" relativeTo="UIParent" relativePoint="CENTER" x="0" y="100"/>
711
</Anchors>
8-
<Scripts>
9-
<OnLoad>
10-
<!-- self.TitleText:SetText("Angleur Warning")
11-
self.mainText:SetText("Are you sure you want to abandon the tutorial?")
12-
self.otherText:SetText("(You can redo it later by clicking the Redo Button\nin the Tiny Panel)")
13-
local colorYellow = CreateColor(1.0, 0.82, 0.0)
14-
self.yesButton:SetText(colorYellow:WrapTextInColorCode("Yes"))
15-
self.noButton:SetText(colorYellow:WrapTextInColorCode("No")) -->
16-
</OnLoad>
17-
</Scripts>
12+
<Layers>
13+
<Layer level="ARTWORK">
14+
<FontString name="$parent_MainText" parentKey="mainText" inherits="GameFontHighlight">
15+
<Anchors>
16+
<Anchor point="TOP" x="0" y="-35"/>
17+
</Anchors>
18+
</FontString>
19+
<FontString name="$parent_OtherText" parentKey="otherText" inherits="SpellFont_Small">
20+
<Color r="0.8" g="0.8" b="0.8"/>
21+
<Anchors>
22+
<Anchor point="BOTTOM" x="0" y="22"/>
23+
</Anchors>
24+
</FontString>
25+
</Layer>
26+
</Layers>
27+
<Frames>
28+
<Button parentKey="yesButton" inherits="GameMenuButtonTemplate">
29+
<Size x="96" y="20"/>
30+
<Anchors>
31+
<Anchor point="TOPLEFT" relativeTo="$parent_MainText" relativePoint="BOTTOMLEFT" x="0" y="-10"/>
32+
</Anchors>
33+
</Button>
34+
<Button parentKey="noButton" inherits="GameMenuButtonTemplate">
35+
<Size x="96" y="20"/>
36+
<Anchors>
37+
<Anchor point="TOPRIGHT" relativeTo="$parent_MainText" relativePoint="BOTTOMRIGHT" x="0" y="-10"/>
38+
</Anchors>
39+
</Button>
40+
</Frames>
1841
</Frame>
1942

20-
<Frame name="Legolando_HelpTipTemplate" inherits="GlowBoxTemplate" hidden="true" mixin="Legolando_HelpTipTemplateMixin" toplevel="true" virtual="true" enableMouse="true" flattenRenderLayers="true">
43+
<Frame name="Legolando_HelpTipTemplate_Angleur" inherits="GlowBoxTemplate" hidden="true" mixin="Legolando_HelpTipTemplateMixin_Angleur" toplevel="true" virtual="true" enableMouse="true" flattenRenderLayers="true">
2144
<Size x="226" y="10"/>
2245
<Layers>
2346
<Layer level="OVERLAY">
24-
<Texture name="$parent_FeatureHighlight" parentKey="featureHighlight" file="Interface/AddOns/Angleur/angTemplates/LegolandoTemplates/Legolando_HelpTipTemplate/ListButtons-glowy.png" hidden="true">
25-
26-
</Texture>
47+
<Texture name="$parent_FeatureHighlight" parentKey="featureHighlight" file="Interface/AddOns/Angleur/angTemplates/LegolandoTemplates/Legolando_HelpTipTemplate/ListButtons-glowy.png" hidden="true"/>
2748
<FontString parentKey="Text" inherits="GameFontHighlightLeft" justifyH="LEFT" justifyV="TOP">
2849
<Size x="196" y="0"/>
2950
</FontString>
@@ -42,7 +63,7 @@
4263
<Anchor point="TOPLEFT" x="-17" y="-9"/>
4364
</Anchors>
4465
</Frame>
45-
<Button parentKey="CloseButton" mixin="Legolando_HelpTipCloseButtonMixin" hidden="false" frameLevel="100">
66+
<Button parentKey="CloseButton" mixin="Legolando_HelpTipCloseButtonMixin_Angleur" hidden="false" frameLevel="100">
4667
<Size x="18" y="18"/>
4768
<Anchors>
4869
<Anchor point="TOPRIGHT" x="-2" y="-2"/>

angTemplates/LegolandoTemplates/embeds.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<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/
22
..\FrameXML\UI.xsd">
33

4-
<Script file="Legolando_HelpTipTemplate\Legolando_HelpTipTemplate.lua"/>
54
<Include file="Legolando_HelpTipTemplate\Legolando_HelpTipTemplate.xml"/>
65

76
<Include file="Legolando_PictureTooltipTemplate\Legolando_PictureTooltipTemplate.xml"/>

firstInstall.lua

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,17 +56,18 @@ local alreadySet = false
5656
function Angleur_FirstInstall()
5757
if alreadySet == false then
5858

59-
angleurHelpTip = CreateFrame("Frame", "Angleur_HelpTip", Angleur.configPanel, "Legolando_HelpTipTemplate")
59+
angleurHelpTip = CreateFrame("Frame", "Angleur_HelpTip", Angleur.configPanel, "Legolando_HelpTipTemplate_Angleur")
6060

61-
angleurHelpTipCloseWarning = CreateFrame("Frame", "Angleur_HelpTip_CloseWarning", UIParent, "Legolando_HelpTipCloseWarning")
61+
angleurHelpTipCloseWarning = CreateFrame("Frame", "Angleur_HelpTip_CloseWarning", UIParent, "Legolando_HelpTipCloseWarning_Angleur")
6262
angleurHelpTipCloseWarning.TitleText:SetText(T["Angleur Warning"])
6363
angleurHelpTipCloseWarning.mainText:SetText(T["Are you sure you want to abandon the tutorial?"])
6464
angleurHelpTipCloseWarning.otherText:SetText(T["(You can redo it later by clicking the Redo Button\nin the Tiny Panel)"])
6565
angleurHelpTipCloseWarning.yesButton:SetText(colorYello:WrapTextInColorCode(T["Yes"]))
6666
angleurHelpTipCloseWarning.noButton:SetText(colorYello:WrapTextInColorCode(T["No"]))
6767
angleurHelpTip:AttachWarning(angleurHelpTipCloseWarning)
6868

69-
angleurHelpTip.savedTable = AngleurTutorial
69+
angleurHelpTip.savedVarTable = AngleurTutorial
70+
angleurHelpTip.reference = "part"
7071

7172
angleurHelpTip.onSkipCallback = platerWarning
7273

tabs/tiny_base.lua

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@ function Angleur_SetTab3(self)
113113
cata:SetDefaultsButtonScript(self)
114114
end
115115

116-
117116
self.redoTutorial.title:SetText(T["Redo Tutorial"])
118117
self.redoTutorial.icon:SetTexture("Interface/BUTTONS/UI-RefreshButton")
119118
self.redoTutorial.icon:SetTexCoord(0, 1, 0, 1)

0 commit comments

Comments
 (0)