-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDashboard.lua
More file actions
1135 lines (1042 loc) · 32.2 KB
/
Dashboard.lua
File metadata and controls
1135 lines (1042 loc) · 32.2 KB
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
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
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
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
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
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
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
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
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
--version 1.1
--[[ Character Sheet Template by: MrStump
You can set up your own character sheet if you follow these steps.
Step 1) Change the character sheet image
-Right click on the character sheet, click Custom
-Replace the image URL with one for your character sheet
-Click import, make sure your sheet loads
-SAVE THE GAME (the table setup)
-LOAD FROM THAT SAVE YOU JUST MADE
Step 2) Edit script to fit your character sheet
-Below you will see some general options, and then the big data table
-The data table is what determines how many of which buttons are made
-Checkboxes
-Counters
-Textboxes
-By default, there are 3 of each. You can add more or remove entries
-If you intend to add/remove, be sure only to add/remove ENTRIES
-This is what an entry looks like:
{
pos = {-0.977,0.1,-0.589},
size = 800,
state = false
},
-Deleting the whole thing would remove that specific item on the sheet
-Copy and pasting it after another entry would create another
-Each entry type has unique data points (pos, size, state, etc)
-Do not try to add in your own data points or remove them individually
-There is a summary of what each point does at the top of its category
Step 3) Save and check script changes
-Hit Save & Apply in the script window to save your code
-You can edit your code as needed and Save+Apply as often as needed
-When you are finished, make disableSave = false below then Save+apply
-This enables saving, so your sheet will remember whats on it.
Bonus) Finding/Editing Positions for elements
I have included a tool to get positions for buttons in {x,y,z} form
Place it where you want the center of your element to be
Then copy the table from the notes (lower right of screen)
You can highlight it and CTRL+C
Paste it into the data table where needed (pos=)
If you want to manually tweek the values:
{0,0,0} is the center of the character sheet
{1,0,0} is right, {-1,0,0} is left
{0,0,-1} is up, {0,0,1} is down
0.1 for Y is the height off of the page.
If it was 0, it would be down inside the model of the sheet
Begin editing below: ]]
--Set this to true while editing and false when you have finished
disableSave = false
--Remember to set this to false once you are done making changes
--Then, after you save & apply it, save your game too
--Color information for button text (r,g,b, values of 0-1)
buttonFontColor = {0,0,0}
--Color information for button background
buttonColor = {1,1,1}
--Change scale of button (Avoid changing if possible)
buttonScale = {0.1,0.1,0.1}
inputIdx = 0
indexMap = {}
tableMap = {}
--This is the button placement information
defaultButtonData = {
--Add checkboxes
checkbox = {
--[[
pos = the position (pasted from the helper tool)
size = height/width/font_size for checkbox
state = default starting value for checkbox (true=checked, false=not)
]]
--Hull 16
{
pos = {2.062,0.1,-1.380},
size = 650,
state = false,
name = "cbHull16"
},
--Hull 15
{
pos = {2.062,0.1,-1.193},
size = 650,
state = false
},
--Hull 14
{
pos = {2.062,0.1,-1.004},
size = 650,
state = false
},
--Hull 13
{
pos = {2.062,0.1,-0.817},
size = 650,
state = false
},
--Hull 12
{
pos = {2.062,0.1,-0.632},
size = 650,
state = false
},
--Hull 11
{
pos = {2.062,0.1,-0.443},
size = 650,
state = false
},
--Hull 10
{
pos = {2.062,0.1,-0.256},
size = 650,
state = false
},
--Hull 9
{
pos = {2.062,0.1,-0.070},
size = 650,
state = false
},
--Hull 8
{
pos = {2.062,0.1,0.120},
size = 650,
state = false
},
--Hull 7
{
pos = {2.062,0.1,0.306},
size = 650,
state = false
},
--Hull 6
{
pos = {2.062,0.1,0.493},
size = 650,
state = false
},
--Hull 5
{
pos = {2.062,0.1,0.681},
size = 650,
state = false
},
--Hull 4
{
pos = {2.062,0.1,0.868},
size = 650,
state = false
},
--Hull 3
{
pos = {2.062,0.1,1.055},
size = 650,
state = false
},
--Hull 2
{
pos = {2.062,0.1,1.243},
size = 650,
state = false
},
--Hull 1
{
pos = {2.062,0.1,1.430},
size = 650,
state = false,
hideBG = true
},
--End of checkboxes
},
--Add counters that have a + and - button
counter = {
--[[
pos = the position (pasted from the helper tool)
size = height/width/font_size for counter
value = default starting value for counter
hideBG = if background of counter is hidden (true=hidden, false=not)
]]
--Handling
{
pos = {0.842,0.1,-1.071},
size = 900,
value = 0,
hideBG = true,
name = "cHandling"
},
--Crew
{
pos = {1.244,0.1,-1.071},
size = 900,
value = 0,
hideBG = true,
name = "cCrew"
},
--Max Gear
{
pos = {1.645,0.1,-1.071},
size = 900,
value = 0,
hideBG = true,
name = "cMaxGear"
},
--Current Gear
{
pos = {1.725,0.1,0.403},
size = 1200,
value = 0,
hideBG = true,
name = "cCurrentGear"
},
--Hazards
{
pos = {1.724,0.1,0.965},
size = 1200,
value = 0,
hideBG = true,
name = "cHazards"
},
--End of counters
},
--Add editable text boxes
textbox = {
--[[
pos = the position (pasted from the helper tool)
rows = how many lines of text you want for this box
width = how wide the text box is
font_size = size of text. This and "rows" effect overall height
label = what is shown when there is no text. "" = nothing
value = text entered into box. "" = nothing
alignment = Number to indicate how you want text aligned
(1=Automatic, 2=Left, 3=Center, 4=Right, 5=Justified)
]]
--Vehicle Name
{
pos = {-1.266,0.1,-1.375},
rows = 1,
width = 8400,
font_size = 500,
label = "Name",
value = "",
alignment = 2,
name = "tbVName"
},
--Vehicle Type
{
pos = {0.216,0.1,-1.375},
rows = 1,
width = 5000,
font_size = 500,
label = "Vehicle type",
value = "",
alignment = 2,
name = "tbVType"
},
--Weight
{
pos = {1.095,0.1,-1.375},
rows = 1,
width = 2600,
font_size = 500,
label = "L/M/H",
value = "",
alignment = 3,
name = "tbVWeight"
},
--Cost
{
pos = {1.644,0.1,-1.375},
rows = 1,
width = 1850,
font_size = 500,
label = "cans",
value = "",
alignment = 3,
name = "tbVCans"
},
--Team Name
{
pos = {-1.375,0.1,-1.073},
rows = 1,
width = 7340,
font_size = 500,
label = "The name of your group.",
value = "",
alignment = 2,
name = "tbVTName"
},
--Sponsor
{
pos = {-0.011,0.1,-1.073},
rows = 1,
width = 5000,
font_size = 500,
label = "unsponsored",
value = "",
alignment = 2,
name = "tbVSponsor"
},
-- The Big blocks of text are all beyond this point
--The giant fuck of the weapons table lies here, pray for your soul
--Weapon Name 1
{
pos = {-1.668,0.1,-0.735},
rows = 2,
width = 4490,
font_size = 450,
label = "weapon 1/2",
value = "",
alignment = 2,
name = "tbWName1"
},
--Weapon Type 1
{
pos = {-0.986,0.1,-0.735},
rows = 2,
width = 1930,
font_size = 450,
label = "shooting",
value = "",
alignment = 3,
name = "tbWType1"
},
--Weapon Attack 1
{
pos = {-0.577,0.1,-0.735},
rows = 2,
width = 1855,
font_size = 450,
label = "xd6",
value = "",
alignment = 3,
name = "tbWAttack1"
},
--Weapon Range 1
{
pos = {-0.172,0.1,-0.735},
rows = 2,
width = 1880,
font_size = 450,
label = "Med/Dbl/Burst",
value = "",
alignment = 3,
name = "tbWRange1"
},
--Weapon Facing 1
{
pos = {0.205,0.1,-0.735},
rows = 2,
width = 1600,
font_size = 450,
label = "Front/360/Side",
value = "",
alignment = 3,
name = "tbWFace1"
},
--Weapon Special 1
{
pos = {0.976,0.1,-0.735},
rows = 2,
width = 5650,
font_size = 450,
label = "e.g. Fire, Ammo, Indirect Etc.",
value = "",
alignment = 2,
name = "tbWSpec1"
},
--Weapon Slots 1
{
pos = {1.662,0.1,-0.735},
rows = 2,
width = 800,
font_size = 450,
label = "-",
value = "",
alignment = 3,
name = "tbWSlots1"
},
--Weapon Cans 1
{
pos = {1.838,0.1,-0.735},
rows = 2,
width = 805,
font_size = 450,
label = "-",
value = "",
alignment = 3,
name = "tbWCans1"
},
--Weapon Name 2
{
pos = {-1.668,0.1,-0.538},
rows = 2,
width = 4490,
font_size = 450,
label = "-",
value = "",
alignment = 2,
name = "tbWName2"
},
--Weapon Type 2
{
pos = {-0.986,0.1,-0.538},
rows = 2,
width = 1930,
font_size = 450,
label = "-",
value = "",
alignment = 3,
name = "tbWType2"
},
--Weapon Attack 2
{
pos = {-0.577,0.1,-0.538},
rows = 2,
width = 1855,
font_size = 450,
label = "-",
value = "",
alignment = 3,
name = "tbWAttack2"
},
--Weapon Range 2
{
pos = {-0.172,0.1,-0.538},
rows = 2,
width = 1880,
font_size = 450,
label = "-",
value = "",
alignment = 3,
name = "tbWRange2"
},
--Weapon Facing 2
{
pos = {0.205,0.1,-0.538},
rows = 2,
width = 1600,
font_size = 450,
label = "-",
value = "",
alignment = 3,
name = "tbWFace2"
},
--Weapon Special 2
{
pos = {0.976,0.1,-0.538},
rows = 2,
width = 5650,
font_size = 450,
label = "-",
value = "",
alignment = 2,
name = "tbWSpec2"
},
--Weapon Slots 2
{
pos = {1.662,0.1,-0.538},
rows = 2,
width = 800,
font_size = 450,
label = "-",
value = "",
alignment = 3,
name = "tbWSlots2"
},
--Weapon Cans 2
{
pos = {1.838,0.1,-0.538},
rows = 2,
width = 805,
font_size = 450,
label = "-",
value = "",
alignment = 3,
name = "tbWCans2"
},
--Weapon Name 3
{
pos = {-1.668,0.1,-0.340},
rows = 2,
width = 4490,
font_size = 450,
label = "-",
value = "",
alignment = 2,
name = "tbWName3"
},
--Weapon Type 3
{
pos = {-0.986,0.1,-0.340},
rows = 2,
width = 1930,
font_size = 450,
label = "-",
value = "",
alignment = 3,
name = "tbWType3"
},
--Weapon Attack 3
{
pos = {-0.577,0.1,-0.340},
rows = 2,
width = 1855,
font_size = 450,
label = "-",
value = "",
alignment = 3,
name = "tbWAttack3"
},
--Weapon Range 3
{
pos = {-0.172,0.1,-0.340},
rows = 2,
width = 1880,
font_size = 450,
label = "-",
value = "",
alignment = 3,
name = "tbWRange3"
},
--Weapon Facing 3
{
pos = {0.205,0.1,-0.340},
rows = 2,
width = 1600,
font_size = 450,
label = "-",
value = "",
alignment = 3,
name = "tbWFace3"
},
--Weapon Special 3
{
pos = {0.976,0.1,-0.340},
rows = 2,
width = 5650,
font_size = 450,
label = "-",
value = "",
alignment = 2,
name = "tbWSpec3"
},
--Weapon Slots 3
{
pos = {1.662,0.1,-0.340},
rows = 2,
width = 800,
font_size = 450,
label = "-",
value = "",
alignment = 3,
name = "tbWSlots3"
},
--Weapon Cans 3
{
pos = {1.838,0.1,-0.340},
rows = 2,
width = 805,
font_size = 450,
label = "-",
value = "",
alignment = 3,
name = "tbWCans3"
},
--Weapon Name 4
{
pos = {-1.668,0.1,-0.160},
rows = 2,
width = 4490,
font_size = 380,
label = "-",
value = "",
alignment = 2,
name = "tbWName4"
},
--Weapon Type 4
{
pos = {-0.986,0.1,-0.160},
rows = 2,
width = 1930,
font_size = 380,
label = "-",
value = "",
alignment = 3,
name = "tbWType4"
},
--Weapon Attack 4
{
pos = {-0.577,0.1,-0.160},
rows = 2,
width = 1855,
font_size = 380,
label = "-",
value = "",
alignment = 3,
name = "tbWAttack4"
},
--Weapon Range 4
{
pos = {-0.172,0.1,-0.160},
rows = 2,
width = 1880,
font_size = 380,
label = "-",
value = "",
alignment = 3,
name = "tbWRange4"
},
--Weapon Facing 4
{
pos = {0.205,0.1,-0.160},
rows = 2,
width = 1600,
font_size = 380,
label = "-",
value = "",
alignment = 3,
name = "tbWFace4"
},
--Weapon Special 4
{
pos = {0.976,0.1,-0.160},
rows = 2,
width = 5650,
font_size = 380,
label = "-",
value = "",
alignment = 2,
name = "tbWSpec4"
},
--Weapon Slots 4
{
pos = {1.662,0.1,-0.160},
rows = 2,
width = 800,
font_size = 380,
label = "-",
value = "-",
alignment = 3,
name = "tbWSlots4"
},
--Weapon Cans 4
{
pos = {1.838,0.1,-0.160},
rows = 2,
width = 805,
font_size = 380,
label = "-",
value = "-",
alignment = 3,
name = "tbWCans4"
},
--Just perks and Upgrades past here
--Perks
{
pos = {-0.4400,0.1,0.425},
rows = 9,
width = 16300,
font_size = 360,
label = "Vehicle Perks",
value = "",
alignment = 2,
name = "tbPerks"
},
--Perk Costs
{
pos = {1.360,0.1,0.425},
rows = 9,
width = 850,
font_size = 360,
label = "-",
value = "",
alignment = 3,
name = "tbPCans"
},
--Upgrades
{
pos = {-0.518,0.1,1.245},
rows = 8,
width = 15550,
font_size = 360,
label = "Vehicle Upgrades",
value = "",
alignment = 2,
name = "tbUpgrades"
},
--Upgrades Slots
{
pos = {1.195,0.1,1.245},
rows = 8,
width = 800,
font_size = 360,
label = "-",
value = "",
alignment = 3,
name = "tbUSlots"
},
--Upgrades Cans
{
pos = {1.370,0.1,1.245},
rows = 8,
width = 800,
font_size = 360,
label = "-",
value = "",
alignment = 3,
name = "tbUCans"
},
--ID number this will hopefully be used to link vehicles with the sheet at some point
{
pos = {1.725,0.1,1.425},
rows = 1,
width = 1450,
font_size = 420,
label = "-",
value = "",
alignment = 2,
name = "tbGuid"
},
--End of textboxes
}
}
--Lua beyond this point, I recommend doing something more fun with your life
--Save function
function updateSave()
saved_data = JSON.encode(ref_buttonData)
if disableSave==true then saved_data="" end
self.script_state = saved_data
end
--Startup procedure
function onload(saved_data)
if disableSave==true then saved_data="" end
if saved_data ~= "" then
local loaded_data = JSON.decode(saved_data)
ref_buttonData = loaded_data
else
ref_buttonData = defaultButtonData
end
hullCount = 0
maxHull = 0
spawnedButtonCount = 0
createCheckbox()
createCounter()
createTextbox()
end
--Click functions for buttons
--Checks or unchecks the given box
function click_checkbox(tableIndex, buttonIndex)
ref_buttonData.checkbox[tableIndex].state = not ref_buttonData.checkbox[tableIndex].state
label = ref_buttonData.checkbox[tableIndex].state and string.char(10008) or ""
self.editButton({index=buttonIndex, label=label})
countHull()
updateOverlay()
updateSave()
end
--Applies value to given counter display
function click_counter(tableIndex, buttonIndex, amount)
ref_buttonData.counter[tableIndex].value = ref_buttonData.counter[tableIndex].value + amount
self.editButton({index=buttonIndex, label=ref_buttonData.counter[tableIndex].value})
updateOverlay()
updateSave()
end
--Updates saved value for given text box
function click_textbox(i, value, selected)
if selected == false then
ref_buttonData.textbox[i].value = value
updateOverlay()
updateSave()
end
end
--Dud function for if you have a background on a counter
function click_none() end
--Button creation
hullCbIndex = 0
hullTableIndex =0
--Makes checkboxes
function createCheckbox()
for i, data in ipairs(ref_buttonData.checkbox) do
if data.name == "cbHull16" then
hullCbIndex=spawnedButtonCount
hullTableIndex =i
end
--Sets up reference function
local buttonNumber = spawnedButtonCount
local funcName = "checkbox"..i
local func = function() click_checkbox(i, buttonNumber) end
self.setVar(funcName, func)
--Sets up label
local label = ""
if data.state==true then label=string.char(10008) end
--Creates button and counts it
self.createButton({
label=label, click_function=funcName, function_owner=self,
position=data.pos, height=data.size, width=data.size,
font_size=data.size, scale=buttonScale,
color=buttonColor, font_color=buttonFontColor
})
spawnedButtonCount = spawnedButtonCount + 1
end
end
--Makes counters
function createCounter()
for i, data in ipairs(ref_buttonData.counter) do
--Sets up display
local displayNumber = spawnedButtonCount
--Sets up label
local label = data.value
--Sets height/width for display
local size = data.size
if data.hideBG == true then size = 0 end
--Creates button and counts it
self.createButton({
label=label, click_function="click_none", function_owner=self,
position=data.pos, height=size, width=size,
font_size=data.size, scale=buttonScale,
color=buttonColor, font_color=buttonFontColor
})
if data.name != nil and data.name != '' then
indexMap[data.name] = spawnedButtonCount
tableMap[data.name] = i
end
spawnedButtonCount = spawnedButtonCount + 1
--Sets up add 1
local funcName = "counterAdd"..i
local func = function() click_counter(i, displayNumber, 1) end
self.setVar(funcName, func)
--Sets up label
local label = "+"
--Sets up position
local offsetDistance = (data.size/2 + data.size/4) * (buttonScale[1] * 0.002)
local pos = {data.pos[1] + offsetDistance, data.pos[2], data.pos[3]}
--Sets up size
local size = data.size / 2
--Creates button and counts it
self.createButton({
label=label, click_function=funcName, function_owner=self,
position=pos, height=size, width=size,
font_size=size, scale=buttonScale,
color=buttonColor, font_color=buttonFontColor
})
spawnedButtonCount = spawnedButtonCount + 1
--Sets up subtract 1
local funcName = "counterSub"..i
local func = function() click_counter(i, displayNumber, -1) end
self.setVar(funcName, func)
--Sets up label
local label = "-"
--Set up position
local pos = {data.pos[1] - offsetDistance, data.pos[2], data.pos[3]}
--Creates button and counts it
self.createButton({
label=label, click_function=funcName, function_owner=self,
position=pos, height=size, width=size,
font_size=size, scale=buttonScale,
color=buttonColor, font_color=buttonFontColor
})
spawnedButtonCount = spawnedButtonCount + 1
end
end
function createTextbox()
--print "load tb"
for i, data in ipairs(ref_buttonData.textbox) do
--Sets up reference function
local funcName = "textbox"..i
local func = function(_,_,val,sel) click_textbox(i,val,sel) end
self.setVar(funcName, func)
self.createInput({
input_function = funcName,
function_owner = self,
label = data.label,
alignment = data.alignment,
position = data.pos,
scale = buttonScale,
width = data.width,
height = (data.font_size*data.rows)+24,
font_size = data.font_size,
color = buttonColor,
font_color = buttonFontColor,
value = data.value,
})
if data.name != nil and data.name != '' then
indexMap[data.name] = inputIdx
tableMap[data.name] = i
end
inputIdx = inputIdx + 1
end
end
weights={"L","M","H"}
--Vehicle Lua table schema for the dashboard
--Some of these are future-proofing for things the dash doesn't use now
-- Should be commented in production, uncommented for coding so I can collapse things, lol
vehicleSchema = {
name="Vehicle 1",
type="Car",
sponsor="Rutherford",
teamName="Some clever name",
weight=2,
hull=10,
handling=3,
maxGear=5,
slots=2,
crew=2,
abilities="",
cans=25, -- It's the importer's job to tally this up
weapons={
{
name="Magnum",
facing="360",
location="Cab",
type="Shooting",
attack="1D6",
range="Medium",
ammo=0,
slots=0,
cans=3,
rules="Crew Fired. Blast"
}
},
upgrades={
{
name="Armour Plating"
}
},
trailer=0,
cargo=0,
perks={
{
name="Powder Keg"
},
{
name="Road Warrior"
}
}
}
function numOrDash(num)
return (num == 0 and "-") or num
end
function loadCounter(name, value)
ref_buttonData.counter[tableMap[name]].value = value
self.editButton({index=indexMap[name], label=value})
end
function loadTextbox(name, value)
ref_buttonData.textbox[tableMap[name]].value = value