3 local TourGuide
= TourGuide
4 local OptionHouse
= DongleStub("OptionHouse-1.0")
5 local ww
= WidgetWarlock
10 local NUMROWS
= math
.floor(305/(ROWHEIGHT
))
18 local function OnShow(self
)
19 TourGuide
:UpdateGuidesPanel()
22 self
:SetScript("OnUpdate", ww
.FadeIn
)
26 local function OnClick(self
)
27 local text
= self
.text
:GetText()
28 if not text
then self
:SetChecked(false)
30 TourGuide
:LoadGuide(text
)
31 TourGuide
:UpdateGuidesPanel()
32 TourGuide
:UpdateStatusFrame()
37 function TourGuide
:CreateGuidesPanel()
38 frame
= CreateFrame("Frame", nil, UIParent
)
43 if i
== 1 then anchor
, point
, point2
= frame
, "TOPLEFT", "CENTER"
44 elseif i
<= NUMROWS
then anchor
, point
, point2
= rows
[i
-1], "BOTTOMLEFT", "CENTER"
45 else anchor
, point
, point2
= rows
[i
-NUMROWS
], "TOPRIGHT", "RIGHT" end
47 local row
= CreateFrame("CheckButton", nil, frame
)
48 row
:SetPoint("TOPLEFT", anchor
, point
)
49 row
:SetPoint("RIGHT", frame
, point2
)
50 row
:SetHeight(ROWHEIGHT
)
52 local highlight
= ww
.SummonTexture(row
, nil, nil, "Interface\\HelpFrame\\HelpFrameButton-Highlight")
53 highlight
:SetTexCoord(0, 1, 0, 0.578125)
54 highlight
:SetAllPoints()
55 row
:SetHighlightTexture(highlight
)
56 row
:SetCheckedTexture(highlight
)
58 local text
= ww
.SummonFontString(row
, nil, nil, "GameFontNormal", nil, "LEFT", 6, 0)
60 row
:SetScript("OnClick", OnClick
)
66 --~ frame:EnableMouseWheel()
67 --~ frame:SetScript("OnMouseWheel", function(f, val)
68 --~ offset = offset - val*NUMROWS
69 --~ if (offset + NUMROWS*2) > #self.guidelist then offset = #self.guidelist - NUMROWS*2 end
70 --~ if offset < 0 then offset = 0 end
71 --~ self:UpdateGuidesPanel()
74 frame
:SetScript("OnShow", OnShow
)
75 ww
.SetFadeTime(frame
, 0.5)
81 function TourGuide
:UpdateGuidesPanel()
82 if not frame
or not frame
:IsVisible() then return end
83 for i
,row
in ipairs(rows
) do
86 local name
= self
.guidelist
[i
]
88 row
.text
:SetText(name
)
89 row
:SetChecked(self
.db
.char
.currentguide
== name
)