3 local TourGuide
= TourGuide
4 local ww
= WidgetWarlock
9 local NUMROWS
= math
.floor(305/(ROWHEIGHT
+4))
15 local function OnShow()
16 offset
= TourGuide
.current
- NUMROWS
/2 - 1
17 if offset
< 0 then offset
= 0
18 elseif (offset
+ NUMROWS
) > #TourGuide
.actions
then offset
= #TourGuide
.actions
- NUMROWS
end
19 TourGuide
:UpdateOHPanel()
23 function TourGuide
:CreateObjectivePanel()
24 local frame
= ww
.SummonOptionHouseBaseFrame()
28 local row
= CreateFrame("Button", nil, frame
)
29 row
:SetPoint("TOPLEFT", i
== 1 and frame
or frame
.rows
[i
-1], i
== 1 and "TOPLEFT" or "BOTTOMLEFT", 0, -ROWOFFSET
)
31 row
:SetHeight(ROWHEIGHT
)
33 local check
= ww
.SummonCheckBox(ROWHEIGHT
, row
, "TOPLEFT", ROWOFFSET
, 0)
34 local icon
= ww
.SummonTexture(row
, ROWHEIGHT
, ROWHEIGHT
, nil, "TOPLEFT", check
, "TOPRIGHT", ROWOFFSET
, 0)
35 local text
= ww
.SummonFontString(row
, nil, nil, "GameFontNormal", nil, "LEFT", icon
, "RIGHT", ROWOFFSET
, 0)
36 local detail
= ww
.SummonFontString(row
, nil, nil, "GameFontNormal", nil, "RIGHT", -ROWOFFSET
, 0)
37 detail
:SetPoint("LEFT", text
, "RIGHT", ROWOFFSET
*3, 0)
38 detail
:SetJustifyH("RIGHT")
39 detail
:SetTextColor(240/255, 121/255, 2/255)
41 check
:SetScript("OnClick", function(f
) self
:SetTurnedIn(row
.i
, f
:GetChecked()) end)
50 frame
:EnableMouseWheel()
51 frame
:SetScript("OnMouseWheel", function(f
, val
)
53 if offset
< 0 then offset
= 0
54 elseif (offset
+ NUMROWS
) > #self
.actions
then offset
= #self
.actions
- NUMROWS
end
59 frame
:SetScript("OnShow", OnShow
)
65 function TourGuide
:UpdateOHPanel()
66 if not self
.OHFrame
or not self
.OHFrame
:IsVisible() then return end
67 for i
,row
in ipairs(self
.OHFrame
.rows
) do
69 local action
, name
, note
, logi
, complete
, hasitem
, turnedin
, fullquestname
= self
:GetObjectiveInfo(i
+ offset
)
70 local checked
= turnedin
or action
== "ACCEPT" and logi
or action
== "COMPLETE" and complete
72 row
.icon
:SetTexture(self
.icons
[action
])
73 row
.text
:SetText(name
)
74 row
.detail
:SetText(note
)
75 row
.check
:SetChecked(checked
)