public
Description: WoW Powerleveling addon
Homepage: http://www.tekkub.net/
Clone URL: git://github.com/tekkub/tourguide.git
Search Repo:
Click here to lend your support to: tourguide and make a donation at www.pledgie.com !
TOC and embed updates across the board

git-svn-id: https://tekkub-wow.googlecode.com/svn/trunk/TourGuide@549 
86fe6d9a-1522-0410-a387-bf9db416f0a0
tekkub (author)
Thu Sep 27 02:24:29 -0700 2007
commit  246cb69c40178a6b81ea51061cfa08f10b3a4b77
tree    7704575c86ab508bd5ba738e7e80932d9f2b15c6
parent  ef22bd7ace1ac5e28f2d624526b260352df2884c
...
155
156
157
158
 
159
160
161
...
898
899
900
901
 
902
903
904
...
155
156
157
 
158
159
160
161
...
898
899
900
 
901
902
903
904
0
@@ -155,7 +155,7 @@ end
0
 ---------------------------------------------------------------------------]]
0
 
0
 local major = "Dongle-1.0"
0
-local minor = tonumber(string.match("$Revision: 371 $", "(%d+)") or 1) + 500
0
+local minor = tonumber(string.match("$Revision: 612 $", "(%d+)") or 1) + 500
0
 -- ** IMPORTANT NOTE **
0
 -- Due to some issues we had previously with Dongle revision numbers
0
 -- we need to artificially inflate the minor revision number, to ensure
0
@@ -898,7 +898,7 @@ function Dongle.GetProfiles(db, t)
0
 end
0
 
0
 function Dongle.GetCurrentProfile(db)
0
- assert(e, databases[db], string.format(L["MUST_CALLFROM_DBOBJECT"], "GetCurrentProfile"))
0
+ assert(3, databases[db], string.format(L["MUST_CALLFROM_DBOBJECT"], "GetCurrentProfile"))
0
   return db.keys.profile
0
 end
0
 
...
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
...
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
 
 
158
159
 
160
161
 
 
162
163
164
165
166
167
168
169
...
173
174
175
 
176
177
178
...
182
183
184
185
186
187
188
...
217
218
219
220
 
221
222
223
 
224
225
226
...
228
229
230
231
 
232
233
234
235
 
236
237
238
...
241
242
243
244
 
245
246
247
...
255
256
257
258
 
259
260
261
...
315
316
317
318
 
319
320
321
322
323
 
324
325
326
...
342
343
344
345
 
346
347
348
...
371
372
373
374
 
375
376
377
 
378
379
380
...
387
388
389
390
391
 
 
392
393
394
...
404
405
406
407
 
408
409
410
411
412
413
 
414
415
416
...
424
425
426
427
 
428
429
430
...
447
448
449
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
450
451
452
453
 
454
455
456
...
461
462
463
464
 
465
466
467
468
469
470
471
472
473
 
474
475
476
...
478
479
480
481
482
483
484
485
 
486
487
488
489
490
491
492
493
494
495
 
 
496
497
498
...
517
518
519
520
 
521
522
523
...
665
666
667
668
669
670
671
672
673
674
675
676
...
683
684
685
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
686
687
688
689
 
690
691
692
693
 
694
695
696
...
704
705
706
707
 
708
709
710
...
724
725
726
727
 
 
728
729
730
...
732
733
734
735
 
 
736
737
738
739
740
...
760
761
762
 
763
764
765
766
767
768
769
770
771
...
780
781
782
 
 
 
 
783
784
785
...
787
788
789
 
 
 
 
 
790
791
792
793
794
 
 
 
 
795
796
797
798
799
800
 
 
 
 
 
801
802
 
 
 
 
 
803
 
804
805
 
806
807
 
808
 
 
 
 
 
 
 
 
809
 
 
 
 
 
 
 
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
 
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
...
932
933
934
935
 
936
937
938
...
940
941
942
943
 
944
945
 
946
 
947
948
949
950
951
952
953
 
954
955
956
...
981
982
983
984
 
985
986
987
 
988
989
990
...
998
999
1000
1001
 
1002
1003
1004
...
1012
1013
1014
1015
 
1016
1017
1018
1019
1020
1021
 
1022
 
1023
1024
1025
...
1037
1038
1039
1040
1041
1042
1043
...
1086
1087
1088
1089
 
1090
1091
1092
...
1106
1107
1108
1109
 
 
1110
1111
1112
...
1159
1160
1161
1162
 
 
 
 
1163
 
1164
1165
1166
...
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
 
 
 
 
 
 
1220
1221
1222
...
1258
1259
1260
1261
 
1262
1263
1264
1265
1266
 
1267
1268
1269
...
1278
1279
1280
1281
 
1282
1283
1284
1285
1286
1287
 
1288
1289
1290
...
1294
1295
1296
1297
 
1298
1299
1300
1301
1302
1303
 
1304
1305
1306
1307
1308
1309
1310
 
1311
1312
1313
...
1315
1316
1317
1318
 
1319
1320
1321
...
1339
1340
1341
1342
1343
1344
1345
1346
 
 
 
 
 
1347
1348
1349
1350
1351
1352
 
 
 
1353
1354
1355
...
1376
1377
1378
1379
1380
1381
1382
 
 
 
 
 
 
1383
1384
1385
...
1390
1391
1392
1393
 
 
 
 
 
 
 
 
 
 
1394
1395
1396
1397
 
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
...
79
80
81
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
82
83
84
85
 
 
86
87
88
 
89
90
 
91
92
93
94
95
96
 
97
98
99
...
103
104
105
106
107
108
109
...
113
114
115
 
116
117
118
...
147
148
149
 
150
151
152
 
153
154
155
156
...
158
159
160
 
161
162
163
164
 
165
166
167
168
...
171
172
173
 
174
175
176
177
...
185
186
187
 
188
189
190
191
...
245
246
247
 
248
249
250
251
252
 
253
254
255
256
...
272
273
274
 
275
276
277
278
...
301
302
303
 
304
305
306
 
307
308
309
310
...
317
318
319
 
 
320
321
322
323
324
...
334
335
336
 
337
338
339
340
341
342
343
344
345
346
347
...
355
356
357
 
358
359
360
361
...
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
 
400
401
402
403
...
408
409
410
 
411
412
413
414
415
416
417
 
 
 
418
419
420
421
...
423
424
425
 
 
 
 
 
426
427
428
429
430
 
 
 
 
 
 
431
432
433
434
435
...
454
455
456
 
457
458
459
460
...
602
603
604
 
 
 
 
 
 
605
606
607
...
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
 
696
697
698
699
 
700
701
702
703
...
711
712
713
 
714
715
716
717
...
731
732
733
 
734
735
736
737
738
...
740
741
742
 
743
744
745
 
746
747
748
...
768
769
770
771
772
773
774
775
776
 
777
778
779
...
788
789
790
791
792
793
794
795
796
797
...
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
 
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
 
836
837
 
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
859
860
861
 
 
 
 
 
 
 
 
 
 
862
863
864
...
902
903
904
 
905
906
907
908
...
910
911
912
 
913
914
 
915
916
917
918
919
920
921
922
923
 
924
925
926
927
...
952
953
954
 
955
956
957
 
958
959
960
961
...
969
970
971
 
972
973
974
975
...
983
984
985
 
986
987
988
989
990
991
 
992
993
994
995
996
997
...
1009
1010
1011
 
1012
1013
1014
...
1057
1058
1059
 
1060
1061
1062
1063
...
1077
1078
1079
 
1080
1081
1082
1083
1084
...
1131
1132
1133
 
1134
1135
1136
1137
1138
1139
1140
1141
1142
...
1160
1161
1162
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1163
1164
1165
1166
1167
1168
1169
1170
1171
...
1207
1208
1209
 
1210
1211
1212
1213
1214
 
1215
1216
1217
1218
...
1227
1228
1229
 
1230
1231
1232
1233
1234
1235
 
1236
1237
1238
1239
...
1243
1244
1245
 
1246
1247
1248
1249
1250
1251
 
1252
1253
1254
1255
1256
1257
1258
 
1259
1260
1261
1262
...
1264
1265
1266
 
1267
1268
1269
1270
...
1288
1289
1290
 
 
 
 
 
1291
1292
1293
1294
1295
1296
1297
1298
1299
 
 
1300
1301
1302
1303
1304
1305
...
1326
1327
1328
 
 
 
 
1329
1330
1331
1332
1333
1334
1335
1336
1337
...
1342
1343
1344
 
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
 
1358
0
@@ -1,3 +1,54 @@
0
+-- LibStub is a simple versioning stub meant for use in Libraries. http://www.wowace.com/wiki/LibStub for more info
0
+-- LibStub is hereby placed in the Public Domain
0
+-- Credits: Kaelten, Cladhaire, ckknight, Mikk, Ammo, Nevcairiel, joshborke
0
+local LIBSTUB_MAJOR, LIBSTUB_MINOR = "LibStub", 2 -- NEVER MAKE THIS AN SVN REVISION! IT NEEDS TO BE USABLE IN ALL REPOS!
0
+local LibStub = _G[LIBSTUB_MAJOR]
0
+
0
+-- Check to see is this version of the stub is obsolete
0
+if not LibStub or LibStub.minor < LIBSTUB_MINOR then
0
+ LibStub = LibStub or {libs = {}, minors = {} }
0
+ _G[LIBSTUB_MAJOR] = LibStub
0
+ LibStub.minor = LIBSTUB_MINOR
0
+
0
+ -- LibStub:NewLibrary(major, minor)
0
+ -- major (string) - the major version of the library
0
+ -- minor (string or number ) - the minor version of the library
0
+ --
0
+ -- returns nil if a newer or same version of the lib is already present
0
+ -- returns empty library object or old library object if upgrade is needed
0
+ function LibStub:NewLibrary(major, minor)
0
+ assert(type(major) == "string", "Bad argument #2 to `NewLibrary' (string expected)")
0
+ minor = assert(tonumber(strmatch(minor, "%d+")), "Minor version must either be a number or contain a number.")
0
+
0
+ local oldminor = self.minors[major]
0
+ if oldminor and oldminor >= minor then return nil end
0
+ self.minors[major], self.libs[major] = minor, self.libs[major] or {}
0
+ return self.libs[major], oldminor
0
+ end
0
+
0
+ -- LibStub:GetLibrary(major, [silent])
0
+ -- major (string) - the major version of the library
0
+ -- silent (boolean) - if true, library is optional, silently return nil if its not found
0
+ --
0
+ -- throws an error if the library can not be found (except silent is set)
0
+ -- returns the library object if found
0
+ function LibStub:GetLibrary(major, silent)
0
+ if not self.libs[major] and not silent then
0
+ error(("Cannot find a library instance of %q."):format(tostring(major)), 2)
0
+ end
0
+ return self.libs[major], self.minors[major]
0
+ end
0
+
0
+ -- LibStub:IterateLibraries()
0
+ --
0
+ -- Returns an iterator for the currently registered libraries
0
+ function LibStub:IterateLibraries()
0
+ return pairs(self.libs)
0
+ end
0
+
0
+ setmetatable(LibStub, { __call = LibStub.GetLibrary })
0
+end
0
+
0
 --[[-------------------------------------------------------------------------
0
   Copyright (c) 2006-2007, Dongle Development Team
0
   All rights reserved.
0
@@ -28,142 +79,21 @@
0
   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
0
   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
0
 ---------------------------------------------------------------------------]]
0
-local major = "DongleStub"
0
-local minor = tonumber(string.match("$Revision: 313 $", "(%d+)") or 1)
0
-
0
-local g = getfenv(0)
0
-
0
-if not g.DongleStub or g.DongleStub:IsNewerVersion(major, minor) then
0
- local lib = setmetatable({}, {
0
- __call = function(t,k)
0
- if type(t.versions) == "table" and t.versions[k] then
0
- return t.versions[k].instance
0
- else
0
- error("Cannot find a library with name '"..tostring(k).."'", 2)
0
- end
0
- end
0
- })
0
-
0
- function lib:IsNewerVersion(major, minor)
0
- local versionData = self.versions and self.versions[major]
0
-
0
- -- If DongleStub versions have differing major version names
0
- -- such as DongleStub-Beta0 and DongleStub-1.0-RC2 then a second
0
- -- instance will be loaded, with older logic. This code attempts
0
- -- to compensate for that by matching the major version against
0
- -- "^DongleStub", and handling the version check correctly.
0
-
0
- if major:match("^DongleStub") then
0
- local oldmajor,oldminor = self:GetVersion()
0
- if self.versions and self.versions[oldmajor] then
0
- return minor > oldminor
0
- else
0
- return true
0
- end
0
- end
0
-
0
- if not versionData then return true end
0
- local oldmajor,oldminor = versionData.instance:GetVersion()
0
- return minor > oldminor
0
- end
0
-
0
- local function NilCopyTable(src, dest)
0
- for k,v in pairs(dest) do dest[k] = nil end
0
- for k,v in pairs(src) do dest[k] = v end
0
- end
0
-
0
- function lib:Register(newInstance, activate, deactivate)
0
- assert(type(newInstance.GetVersion) == "function",
0
- "Attempt to register a library with DongleStub that does not have a 'GetVersion' method.")
0
-
0
- local major,minor = newInstance:GetVersion()
0
- assert(type(major) == "string",
0
- "Attempt to register a library with DongleStub that does not have a proper major version.")
0
- assert(type(minor) == "number",
0
- "Attempt to register a library with DongleStub that does not have a proper minor version.")
0
-
0
- -- Generate a log of all library registrations
0
- if not self.log then self.log = {} end
0
- table.insert(self.log, string.format("Register: %s, %s", major, minor))
0
-
0
- if not self:IsNewerVersion(major, minor) then return false end
0
- if not self.versions then self.versions = {} end
0
-
0
- local versionData = self.versions[major]
0
- if not versionData then
0
- -- New major version
0
- versionData = {
0
- ["instance"] = newInstance,
0
- ["deactivate"] = deactivate,
0
- }
0
-
0
- self.versions[major] = versionData
0
- if type(activate) == "function" then
0
- table.insert(self.log, string.format("Activate: %s, %s", major, minor))
0
- activate(newInstance)
0
- end
0
- return newInstance
0
- end
0
-
0
- local oldDeactivate = versionData.deactivate
0
- local oldInstance = versionData.instance
0
-
0
- versionData.deactivate = deactivate
0
-
0
- local skipCopy
0
- if type(activate) == "function" then
0
- table.insert(self.log, string.format("Activate: %s, %s", major, minor))
0
- skipCopy = activate(newInstance, oldInstance)
0
- end
0
-
0
- -- Deactivate the old libary if necessary
0
- if type(oldDeactivate) == "function" then
0
- local major, minor = oldInstance:GetVersion()
0
- table.insert(self.log, string.format("Deactivate: %s, %s", major, minor))
0
- oldDeactivate(oldInstance, newInstance)
0
- end
0
-
0
- -- Re-use the old table, and discard the new one
0
- if not skipCopy then
0
- NilCopyTable(newInstance, oldInstance)
0
- end
0
- return oldInstance
0
- end
0
-
0
- function lib:GetVersion() return major,minor end
0
-
0
- local function Activate(new, old)
0
- -- This code ensures that we'll move the versions table even
0
- -- if the major version names are different, in the case of
0
- -- DongleStub
0
- if not old then old = g.DongleStub end
0
-
0
- if old then
0
- new.versions = old.versions
0
- new.log = old.log
0
- end
0
- g.DongleStub = new
0
- end
0
-
0
- -- Actually trigger libary activation here
0
- local stub = g.DongleStub or lib
0
- lib = stub:Register(lib, Activate)
0
-end
0
 
0
 --[[-------------------------------------------------------------------------
0
   Begin Library Implementation
0
 ---------------------------------------------------------------------------]]
0
-local major = "OptionHouse-1.0"
0
-local minor = tonumber(string.match("$Revision: 581 $", "(%d+)") or 1)
0
+local major = "OptionHouse-1.1"
0
+local minor = tonumber(string.match("$Revision: 619 $", "(%d+)") or 1)
0
 
0
-assert(DongleStub, string.format("%s requires DongleStub.", major))
0
+assert(LibStub, string.format("%s requires LibStub.", major))
0
 
0
-if( not DongleStub:IsNewerVersion(major, minor) ) then return end
0
+local OHInstance, oldRevision = LibStub:NewLibrary(major, minor)
0
+if( not OHInstance ) then return end
0
 
0
 local L = {
0
   ["ERROR_NO_FRAME"] = "No frame returned for the addon \"%s\", category \"%s\", sub category \"%s\".",
0
   ["NO_FUNC_PASSED"] = "You must associate a function with a category.",
0
- ["IS_PRIVATEAPI"] = "You are trying to call a private api from a non-OptionHouse module.",
0
   ["BAD_ARGUMENT"] = "bad argument #%d to '%s' (%s expected, got %s)",
0
   ["MUST_CALL"] = "You must call '%s' from an OptionHouse addon object.",
0
   ["ADDON_ALREADYREG"] = "The addon '%s' is already registered with OptionHouse.",
0
@@ -173,6 +103,7 @@ local L = {
0
   ["NO_SUBCATEXISTS"] = "No sub-category '%s' exists in '%s' for the addon '%s'.",
0
   ["NO_PARENTCAT"] = "No parent category named '%s' exists in %s'",
0
   ["SUBCATEGORY_ALREADYREG"] = "The sub-category named '%s' already exists in the category '%s' for '%s'",
0
+ ["UNKNOWN_FRAMETYPE"] = "Unknown frame type given '%s', only 'main', 'perf', 'addon', 'config' are supported.",
0
   ["OPTION_HOUSE"] = "Option House",
0
   ["ENTERED_COMBAT"] = "|cFF33FF99Option House|r: Configuration window closed due to entering combat.",
0
   ["SEARCH"] = "Search...",
0
@@ -182,7 +113,6 @@ local L = {
0
   ["TOTAL_SUBCATEGORIES"] = "Sub Categories: %d",
0
   ["TAB_MANAGEMENT"] = "Management",
0
   ["TAB_PERFORMANCE"] = "Performance",
0
- ["UNKNOWN_FRAMETYPE"] = "Unknown frame type requested '%s', only 'main', 'perf', 'addon', 'config' are supported.",
0
 }
0
 
0
 local function assert(level,condition,message)
0
@@ -217,10 +147,10 @@ local frame
0
 -- TABS
0
 local function resizeTab(tab)
0
   local textWidth = tab:GetFontString():GetWidth()
0
-
0
+
0
   tab.middleActive:SetWidth(textWidth)
0
   tab.middleInactive:SetWidth(textWidth)
0
-
0
+
0
   tab:SetWidth((2 * tab.leftActive:GetWidth()) + textWidth)
0
   tab.highlightTexture:SetWidth(textWidth + 20)
0
 end
0
@@ -228,11 +158,11 @@ end
0
 local function tabSelected(tab)
0
   tab:SetTextColor(HIGHLIGHT_FONT_COLOR.r, HIGHLIGHT_FONT_COLOR.g, HIGHLIGHT_FONT_COLOR.b)
0
   tab.highlightTexture:Hide()
0
-
0
+
0
   tab.leftActive:Show()
0
   tab.middleActive:Show()
0
   tab.rightActive:Show()
0
-
0
+
0
   tab.leftInactive:Hide()
0
   tab.middleInactive:Hide()
0
   tab.rightInactive:Hide()
0
@@ -241,7 +171,7 @@ end
0
 local function tabDeselected(tab)
0
   tab:SetTextColor(NORMAL_FONT_COLOR.r, NORMAL_FONT_COLOR.g, NORMAL_FONT_COLOR.b)
0
   tab.highlightTexture:Show()
0
-
0
+
0
   tab.leftInactive:Show()
0
   tab.middleInactive:Show()
0
   tab.rightInactive:Show()
0
@@ -255,7 +185,7 @@ local function setTab(id)
0
   if( frame.selectedTab ) then
0
     tabDeselected(frame.tabs[frame.selectedTab])
0
   end
0
-
0
+
0
   frame.selectedTab = id
0
   tabSelected(frame.tabs[id])
0
 end
0
@@ -315,12 +245,12 @@ local function createTab(text, id)
0
     tab:SetID(id)
0
     tab:SetScript("OnClick", tabOnClick)
0
     tab:GetFontString():SetPoint("CENTER", 0, 2)
0
-
0
+
0
     tab.highlightTexture = tab:GetHighlightTexture()
0
     tab.highlightTexture:ClearAllPoints()
0
     tab.highlightTexture:SetPoint("CENTER", tab:GetFontString(), 0, 0)
0
     tab.highlightTexture:SetBlendMode("ADD")
0
-
0
+
0
     -- TAB SELECTED TEXTURES
0
     tab.leftActive = tab:CreateTexture(nil, "ARTWORK")
0
     tab.leftActive:SetTexture("Interface\\PaperDollInfoFrame\\UI-Character-ActiveTab")
0
@@ -342,7 +272,7 @@ local function createTab(text, id)
0
     tab.rightActive:SetWidth(20)
0
     tab.rightActive:SetPoint("LEFT", tab.middleActive, "RIGHT")
0
     tab.rightActive:SetTexCoord(0.84375, 1.0, 0, 1.0)
0
-
0
+
0
     -- TAB DESELECTED TEXTURES
0
     tab.leftInactive = tab:CreateTexture(nil, "ARTWORK")
0
     tab.leftInactive:SetTexture("Interface\\PaperDollInfoFrame\\UI-Character-InActiveTab")
0
@@ -371,10 +301,10 @@ local function createTab(text, id)
0
 
0
   tab:SetText(text)
0
   tab:Show()
0
-
0
+
0
   tabDeselected(tab)
0
   resizeTab(tab)
0
-
0
+
0
   if( id == 1 ) then
0
     tab:SetPoint("TOPLEFT", frame, "BOTTOMLEFT", 15, 11)
0
   else
0
@@ -387,8 +317,8 @@ local function onVerticalScroll(self, offset)
0
   offset = ceil(offset)
0
 
0
   self.bar:SetValue(offset)
0
- self.offset = ceil((offset / self.displayNum))
0
-
0
+ self.offset = ceil(offset / self.displayNum)
0
+
0
   if( self.offset < 0 ) then
0
     self.offset = 0
0
   end
0
@@ -404,13 +334,14 @@ local function onVerticalScroll(self, offset)
0
   if( max == offset ) then
0
     self.down:Disable()
0
   else
0
- self.down:Enable()
0
+ self.down:Enable()
0
   end
0
 
0
   self.updateFunc()
0
 end
0
 
0
 local function onMouseWheel(self, offset)
0
+ if( self.scroll ) then self = self.scroll end
0
   if( offset > 0 ) then
0
     self.bar:SetValue(self.bar:GetValue() - (self.bar:GetHeight() / 2))
0
   else
0
@@ -424,7 +355,7 @@ end
0
 
0
 local function updateScroll(scroll, totalRows)
0
   local max = (totalRows - scroll.displayNum) * scroll.displayNum
0
-
0
+
0
   -- Macs are unhappy if max is less then the min
0
   if( max < 0 ) then
0
     max = 0
0
@@ -447,10 +378,26 @@ local function updateScroll(scroll, totalRows)
0
   end
0
 end
0
 
0
+local function onValueChanged(self, offset)
0
+ self:GetParent():SetVerticalScroll(offset)
0
+end
0
+
0
+local function scrollButtonUp(self)
0
+ local parent = self:GetParent()
0
+ parent:SetValue(parent:GetValue() - (parent:GetHeight() / 2))
0
+ PlaySound("UChatScrollButton")
0
+end
0
+
0
+local function scrollButtonDown(self)
0
+ local parent = self:GetParent()
0
+ parent:SetValue(parent:GetValue() + (parent:GetHeight() / 2))
0
+ PlaySound("UChatScrollButton")
0
+end
0
+
0
 local function createScrollFrame(frame, displayNum, onScroll)
0
   frame:EnableMouseWheel(true)
0
   frame:SetScript("OnMouseWheel", onParentMouseWheel)
0
-
0
+
0
   frame.scroll = CreateFrame("ScrollFrame", nil, frame)
0
   frame.scroll:EnableMouseWheel(true)
0
   frame.scroll:SetWidth(16)
0
@@ -461,16 +408,14 @@ local function createScrollFrame(frame, displayNum, onScroll)
0
   frame.scroll.offset = 0
0
   frame.scroll.displayNum = displayNum
0
   frame.scroll.updateFunc = onScroll
0
-
0
+
0
   -- Actual bar for scrolling
0
   frame.scroll.bar = CreateFrame("Slider", nil, frame.scroll)
0
   frame.scroll.bar:SetValueStep(frame.scroll.displayNum)
0
   frame.scroll.bar:SetMinMaxValues(0, 0)
0
   frame.scroll.bar:SetValue(0)
0
   frame.scroll.bar:SetWidth(16)
0
- frame.scroll.bar:SetScript("OnValueChanged", function(self, offset)
0
- self:GetParent():SetVerticalScroll(offset)
0
- end)
0
+ frame.scroll.bar:SetScript("OnValueChanged", onValueChanged)
0
   frame.scroll.bar:SetPoint("TOPLEFT", frame.scroll, "TOPRIGHT", 6, -16)
0
   frame.scroll.bar:SetPoint("BOTTOMLEFT", frame.scroll, "BOTTOMRIGHT", 6, -16)
0
 
0
@@ -478,21 +423,13 @@ local function createScrollFrame(frame, displayNum, onScroll)
0
   frame.scroll.up = CreateFrame("Button", nil, frame.scroll.bar, "UIPanelScrollUpButtonTemplate")
0
   frame.scroll.up:ClearAllPoints()
0
   frame.scroll.up:SetPoint( "BOTTOM", frame.scroll.bar, "TOP" )
0
- frame.scroll.up:SetScript("OnClick", function(self)