@@ -11,11 +11,11 @@ local NUMROWS = math.floor(305/(ROWHEIGHT+4))
11
11
12
12
local offset = 0
13
13
local rows = {}
14
- local frame , scrollbar
14
+ local frame , scrollbar , upbutt , downbutt
15
15
16
16
17
17
local function OnShow (self )
18
- scrollbar :SetMinMaxValues (1 , math.max (# TourGuide .actions - NUMROWS , 1 ))
18
+ scrollbar :SetMinMaxValues (0 , math.max (# TourGuide .actions - NUMROWS , 1 ))
19
19
scrollbar :SetValue (TourGuide .current - NUMROWS / 2 - 1 )
20
20
21
21
self :SetAlpha (0 )
@@ -37,34 +37,21 @@ function TourGuide:CreateObjectivePanel()
37
37
frame = CreateFrame (" Frame" , nil , UIParent )
38
38
frame :SetFrameStrata (" DIALOG" )
39
39
40
- scrollbar = CreateFrame ( " Slider " , " TourGuideOHScroll " , frame , " UIPanelScrollBarTemplate " )
41
- scrollbar :SetPoint (" TOPRIGHT" , frame , " TOPRIGHT" , 0 , - 16 )
40
+ scrollbar , upbutt , downbutt = ww . ConjureScrollBar ( frame , true )
41
+ scrollbar :SetPoint (" TOPRIGHT" , frame , " TOPRIGHT" , 0 , - 19 )
42
42
scrollbar :SetPoint (" BOTTOMRIGHT" , frame , " BOTTOMRIGHT" , 0 , 16 )
43
43
scrollbar :SetScript (" OnValueChanged" , function (f , val ) self :UpdateOHPanel (val ) end )
44
- TourGuideOHScrollScrollUpButton :SetScript (" OnClick" , function (f )
45
- scrollbar :SetValue (offset - NUMROWS )
44
+
45
+ upbutt :SetScript (" OnClick" , function (f )
46
+ scrollbar :SetValue (offset - NUMROWS + 1 )
46
47
PlaySound (" UChatScrollButton" )
47
48
end )
48
49
49
- TourGuideOHScrollScrollDownButton :SetScript (" OnClick" , function (f )
50
- scrollbar :SetValue (offset + NUMROWS )
50
+ downbutt :SetScript (" OnClick" , function (f )
51
+ scrollbar :SetValue (offset + NUMROWS - 1 )
51
52
PlaySound (" UChatScrollButton" )
52
53
end )
53
54
54
- local uptext = scrollbar :CreateTexture (nil , " BACKGROUND" )
55
- uptext :SetWidth (31 )
56
- uptext :SetHeight (256 )
57
- uptext :SetPoint (" TOPLEFT" , TourGuideOHScrollScrollUpButton , " TOPLEFT" , - 7 , 5 )
58
- uptext :SetTexture (" Interface\\ PaperDollInfoFrame\\ UI-Character-ScrollBar" )
59
- uptext :SetTexCoord (0 , 0.484375 , 0 , 1.0 )
60
-
61
- local downtex = scrollbar :CreateTexture (nil , " BACKGROUND" )
62
- downtex :SetWidth (31 )
63
- downtex :SetHeight (106 )
64
- downtex :SetPoint (" BOTTOMLEFT" , TourGuideOHScrollScrollDownButton , " BOTTOMLEFT" , - 7 , - 3 )
65
- downtex :SetTexture (" Interface\\ PaperDollInfoFrame\\ UI-Character-ScrollBar" )
66
- downtex :SetTexCoord (0.515625 , 1.0 , 0 , 0.4140625 )
67
-
68
55
local function LevelCorrection (f ) f :SetFrameLevel (frame :GetFrameLevel ()+ 1 ); f :SetScript (" OnShow" , nil ) end
69
56
for i = 1 ,NUMROWS do
70
57
local row = CreateFrame (" Button" , nil , frame )
@@ -119,6 +106,9 @@ function TourGuide:UpdateOHPanel(value)
119
106
if (offset + NUMROWS ) > # self .actions then offset = # self .actions - NUMROWS end
120
107
if offset < 0 then offset = 0 end
121
108
109
+ if offset == 0 then upbutt :Disable () else upbutt :Enable () end
110
+ if offset == (# self .actions - NUMROWS ) then downbutt :Disable () else downbutt :Enable () end
111
+
122
112
for i in pairs (accepted ) do accepted [i ] = nil end
123
113
124
114
for i = 1 ,offset - 1 do
0 commit comments