3 local TourGuide
= TourGuide
4 local OptionHouse
= DongleStub("OptionHouse-1.0")
5 local ww
= WidgetWarlock
10 local NUMROWS
= math
.floor(305/(ROWHEIGHT
))
13 local offset
, elapsed
= 0, 0
18 local function OnShow()
19 TourGuide
:UpdateGuidesPanel()
27 local function OnClick(self
)
28 local text
= self
.text
:GetText()
29 if not text
then self
:SetChecked(false)
31 TourGuide
:LoadGuide(text
)
32 TourGuide
:UpdateGuidesPanel()
33 TourGuide
:UpdateStatusFrame()
38 function TourGuide
:CreateGuidesPanel()
39 fader
= CreateFrame("Frame")
41 fader
:SetScript("OnUpdate", function(self
, elap
)
42 elapsed
= elapsed
+ elap
46 else frame
:SetAlpha(elapsed
) end
49 frame
= ww
.SummonOptionHouseBaseFrame()
50 local w
= frame
:GetWidth()
55 if i
== 1 then anchor
, point
= frame
, "TOPLEFT"
56 elseif i
<= NUMROWS
then anchor
, point
= rows
[i
-1], "BOTTOMLEFT"
57 else anchor
, point
= rows
[i
-NUMROWS
], "TOPRIGHT" end
59 local row
= CreateFrame("CheckButton", nil, frame
)
60 row
:SetPoint("TOPLEFT", anchor
, point
)
62 row
:SetHeight(ROWHEIGHT
)
64 local highlight
= ww
.SummonTexture(row
, w
/2, ROWHEIGHT
, "Interface\\HelpFrame\\HelpFrameButton-Highlight")
65 highlight
:SetTexCoord(0, 1, 0, 0.578125)
66 highlight
:SetAllPoints()
67 row
:SetHighlightTexture(highlight
)
68 row
:SetCheckedTexture(highlight
)
70 local text
= ww
.SummonFontString(row
, nil, nil, "GameFontNormal", nil, "LEFT", 6, 0)
72 row
:SetScript("OnClick", OnClick
)
78 --~ frame:EnableMouseWheel()
79 --~ frame:SetScript("OnMouseWheel", function(f, val)
80 --~ offset = offset - val*NUMROWS
81 --~ if (offset + NUMROWS*2) > #self.guidelist then offset = #self.guidelist - NUMROWS*2 end
82 --~ if offset < 0 then offset = 0 end
83 --~ self:UpdateGuidesPanel()
86 frame
:SetScript("OnShow", OnShow
)
92 function TourGuide
:UpdateGuidesPanel()
93 if not frame
or not frame
:IsVisible() then return end
94 for i
,row
in ipairs(rows
) do
97 local name
= self
.guidelist
[i
]
99 row
.text
:SetText(name
)
100 row
:SetChecked(self
.db
.char
.currentguide
== name
)