3 local TourGuide
= TourGuide
4 local OptionHouse
= DongleStub("OptionHouse-1.0")
5 local ww
= WidgetWarlock
11 local NUMROWS
= math
.floor(305/(ROWHEIGHT
+4))
18 local function OnShow()
19 --~ offset = TourGuide.current - NUMROWS/2 - 1
20 --~ if offset < 0 then offset = 0
21 --~ elseif (offset + NUMROWS) > #TourGuide.actions then offset = #TourGuide.actions - NUMROWS end
22 TourGuide
:UpdateGuidesPanel()
26 function TourGuide
:CreateGuidesPanel()
27 local frame
= ww
.SummonOptionHouseBaseFrame()
28 local w
= frame
:GetWidth()
32 local row
= CreateFrame("Button", nil, frame
)
33 row
:SetPoint("TOPLEFT", i
== 1 and frame
or frame
.rows
[i
-1], i
== 1 and "TOPLEFT" or "BOTTOMLEFT", 0, -ROWOFFSET
)
35 row
:SetHeight(ROWHEIGHT
)
37 local check
= ww
.SummonCheckBox(ROWHEIGHT
, row
, "TOPLEFT", ROWOFFSET
, 0)
38 local text
= ww
.SummonFontString(row
, nil, nil, "GameFontNormal", nil, "LEFT", check
, "RIGHT", ROWOFFSET
, 0)
40 --~ check:SetScript("OnClick", function(f) self:SetTurnedIn(row.i, f:GetChecked()) end)
43 --~ row.detail = detail
49 --~ frame:EnableMouseWheel()
50 --~ frame:SetScript("OnMouseWheel", function(f, val)
51 --~ offset = offset - val
52 --~ if offset < 0 then offset = 0
53 --~ elseif (offset + NUMROWS) > #self.actions then offset = #self.actions - NUMROWS end
54 --~ self:UpdateOHPanel()
57 self
.OHGuidesFrame
= frame
58 frame
:SetScript("OnShow", OnShow
)
60 --~ self:UpdateGuidesPanel()
65 function TourGuide
:UpdateGuidesPanel()
66 if not self
.OHGuidesFrame
or not self
.OHGuidesFrame
:IsVisible() then return end
67 for i
,row
in ipairs(self
.OHGuidesFrame
.rows
) do
68 --~ row.i = i + offset
70 local name
= self
.guidelist
[i
]
72 row
.text
:SetText(name
)
73 row
.check
:SetChecked(self
.db
.char
.currentguide
== name
)