-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.kv
1160 lines (1117 loc) · 30.4 KB
/
main.kv
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
#:kivy 2.0
#ScreenManagement - all screens defined here.
#:import Factory kivy.factory.Factory
MainManager:
id: 'MainManager'
#FadeTransition didn't work. Should look at other transition options.
#transition: FadeTransition()
PhaseScreen:
HistoryScreen:
ChallengeScreen:
#Kivy Screens
#Currently I'm using a gridlayout with a single column as the main wrapper
#This divides the screen horizontally into equal sections
#If you want to subdivide one of those horizontal sections, I use BoxLayout with 2 columns
#I kept a consistent number of GridLayout sections by adding empty Label sections
#Variables: root.variable means it's a screen variable, from the corresponding screen class in python
#Variables: app.variable means it's an app variable, from the MainApp class in python
#to do - all Labels should probably have a unique ID... allows more advanced Kivy options
<HelpPopup@Popup>:
title: 'Spirit Island Phase Tracker'
#auto_dismiss: False
size_hint_x: .95
size_hint_y: .95
GridLayout:
cols: 1
Label:
text: 'Welcome to the Spirit Island Phase Tracker, by Tony Akens.\nSpirit Island and all terms, text, and assets belongs to More Than Play Games.\n\nThis app is intended to assist in playing the board game, by helping remind you of rules as you play.\nTo get started, select the expansions you\'ll be playing with.\nThis will set the available adversaries and number of players.\nNext, select your adversary, adversary level, and number of players.\nHit start to begin.\nAs you play, use the \"Next Screen\" button to advance through the phases.\nAs you play, if your island becomes blighted, check the \"Blighted Island\" button. You\'ll begin on Stage I, when you flip your first card from Stage II, press the \"Stage2\" button. Do the same for your first Stage III card.\nThis app saves its state automatically. To reload your previous state, just hit the \"Reload Previous Session\" from the main screen.'
text_size: self.width, None
height: self.texture_size[1]
Button:
text: 'Close'
size_hint_y: 0.1
on_release: root.dismiss()
<BlightPopup@Popup>:
title: 'Blighted Island'
size_hint_x: .75
size_hint_y: .4
GridLayout:
cols: 1
id: BlightPopup
Image:
size_hint: .1, 1
source: 'resources/tokens/Icon Blight.png'
Label:
text: 'The island is blighted, flip over the blight card and follow the instructions on the back of the card.'
text_size: self.width, None
height: self.texture_size[1]
BoxLayout:
CheckBox:
size_hint_x: .2
active: app.blightscreeninactive
on_active: app.no_blight_screen(self.active)
background_checkbox_normal: 'resources/checkbox_unchecked.png'
background_checkbox_down: 'resources/checkbox_checked.png'
Label:
text: 'Select if Blighted Island Card has no ongoing effect'
text_size: self.width, None
height: self.texture_size[1]
Button:
text: 'Close'
size_hint_y: 0.25
on_release: root.dismiss()
<WinLosePopup@Popup>:
title: 'Win / Loss'
size_hint_x: 0.9
size_hint_y: 0.9
GridLayout:
cols: 1
BoxLayout:
size_hint_y: 0.075
Label:
size_hint_x: 0.2
ToggleButton:
text: "Win"
group: "winlose"
size_hint_x: 0.4
on_release: app.winloss_clicked('Win')
ToggleButton:
text: "Loss"
group: "winlose"
size_hint_x: 0.4
on_release: app.winloss_clicked('Loss')
Label:
size_hint_x: 0.2
BoxLayout:
size_hint_y: 0.075
cols: 2
Label:
text: app.spirits[0]
TextInput:
text: app.playernames[0]
multiline: False
id: player1
on_text: app.onplayertext(0, self.text)
BoxLayout:
size_hint_y: 0 if int(app.players) < 2 else 0.075
cols: 2
Label:
text: app.spirits[1]
disabled: True if int(app.players) < 2 else False
opacity: 0 if int(app.players) < 2 else 1
TextInput:
disabled: True if int(app.players) < 2 else False
multiline: False
opacity: 0 if int(app.players) < 2 else 1
text: app.playernames[1]
id: player2
on_text: app.onplayertext(1, self.text)
BoxLayout:
size_hint_y: 0 if int(app.players) < 3 else 0.075
cols: 2
Label:
text: app.spirits[2]
disabled: True if int(app.players) < 3 else False
opacity: 0 if int(app.players) < 3 else 1
TextInput:
disabled: True if int(app.players) < 3 else False
multiline: False
opacity: 0 if int(app.players) < 3 else 1
text: app.playernames[2]
id: player3
on_text: app.onplayertext(2, self.text)
BoxLayout:
size_hint_y: 0 if int(app.players) < 4 else 0.075
cols: 2
Label:
text: app.spirits[3]
disabled: True if int(app.players) < 4 else False
opacity: 0 if int(app.players) < 4 else 1
TextInput:
disabled: True if int(app.players) < 4 else False
multiline: False
opacity: 0 if int(app.players) < 4 else 1
text: app.playernames[3]
id: player4
on_text: app.onplayertext(4, self.text)
BoxLayout:
size_hint_y: 0 if int(app.players) < 5 else 0.075
cols: 2
Label:
text: app.spirits[4]
disabled: True if int(app.players) < 5 else False
opacity: 0 if int(app.players) < 5 else 1
TextInput:
disabled: True if int(app.players) < 5 else False
multiline: False
opacity: 0 if int(app.players) < 5 else 1
text: app.playernames[4]
id: player5
on_text: app.onplayertext(5, self.text)
BoxLayout:
size_hint_y: 0 if int(app.players) < 6 else 0.075
cols: 2
Label:
text: app.spirits[5]
disabled: True if int(app.players) < 6 else False
opacity: 0 if int(app.players) < 6 else 1
TextInput:
disabled: True if int(app.players) < 6 else False
multiline: False
opacity: 0 if int(app.players) < 6 else 1
text: app.playernames[5]
id: player6
on_text: app.onplayertext(6, self.text)
BoxLayout:
size_hint_y: 0.075
cols: 2
ScaleLabel:
valign: 'bottom'
text: 'Reason:'
Spinner:
id: reasonspinner
text: app.reason
values: app.reasons
on_text: app.setreason(self.text)
Label:
size_hint_y: .3
BoxLayout:
cols: 2
size_hint_y: 0.075
Button:
text: 'Go Back'
on_release: root.dismiss()
Button:
text: 'Save record and exit'
disabled: True if (app.winloss == 'None' or app.reason == 'None') else False
on_release: app.write_winloss()
<ScaleLabel@Label>:
_scale: 1. if self.texture_size[0] < self.width*0.95 else float(self.width*0.95) / self.texture_size[0]
canvas.before:
PushMatrix
Scale:
origin: self.center
x: self._scale or 1.
y: self._scale or 1.
canvas.after:
PopMatrix
<-ScaleButton@Button>:
state_image: self.background_normal if self.state == 'normal' else self.background_down
disabled_image: self.background_disabled_normal if self.state == 'normal' else self.background_disabled_down
_scale: 1. if self.texture_size[0] < self.width*0.75 else float(self.width*0.75) / self.texture_size[0]
canvas:
Color:
rgba: self.background_color
BorderImage:
border: self.border
pos: self.pos
size: self.size
source: self.disabled_image if self.disabled else self.state_image
PushMatrix
Scale:
origin: self.center
x: self._scale or 1.
y: self._scale or 1.
Color:
rgba: self.disabled_color if self.disabled else self.color
Rectangle:
texture: self.texture
size: self.texture_size
pos: int(self.center_x - self.texture_size[0] / 2.), int(self.center_y - self.texture_size[1] / 2.)
PopMatrix
<MapViewClass@BoxLayout>:
# define the properties that appear in the data
text: ''
image: ''
#orientation: 'vertical'
# define how the data is displayed
#height: label.height
Label:
id: label
size_hint: 1, 1
text: root.text
height: self.texture_size[1]
text_size: self.width, None
halign: 'center'
font_size: 20
Image:
id: image
size_hint: 1, 1
width: self.height
source: root.image
<MyViewClass@BoxLayout>:
# define the properties that appear in the data
text: ''
image: ''
# define how the data is displayed
height: rowlabel.height if self.parent else 100
Image:
id: rowimage
size_hint: app.imagewidth, 1
#width: self.height
source: root.image
Widget:
size_hint: 0.007, 1
Label:
id: rowlabel
size_hint_y: None
text: root.text
height: self.texture_size[1] #max(self.texture_size[1], rowimage.width)
text_size: self.width, None
font_size: app.fontsize
<HistoryDetailPopup@Popup>:
title: 'History Detail'
size_hint_x: 0.9
size_hint_y: 0.9
GridLayout:
cols:1
Label:
size_hint_y: 0.925
text: app.gamehistory
height: self.texture_size[1]
text_size: self.width, None
Button:
size_hint_y: 0.075
text: 'Go Back'
on_release: root.dismiss()
<HistoryViewClass@BoxLayout>:
h_opp1: ''
h_opp2: ''
h_opp1_icon: ''
h_opp2_icon: ''
h_lvl1: ''
h_lvl2: ''
h_spirits1_icon: ''
h_spirits2_icon: ''
h_spirits3_icon: ''
h_spirits4_icon: ''
h_spirits5_icon: ''
h_spirits6_icon: ''
h_diff: ''
h_winloss: ''
key: ''
canvas:
Color:
rgba: (0,1,0,.25) if root.h_winloss == 'Win' else (1,0,0,0.25)
Rectangle:
pos: self.pos
size: self.size
Color:
rgba: (0,0,0,1)
Line:
width:1
rectangle: self.x, self.y, self.width, self.height
BoxLayout:
orientation: 'vertical'
size_hint_y: 0.9
valign: 'center'
Image:
source: root.h_opp1_icon
ScaleLabel:
text: "Level: " + root.h_lvl1
opacity: 0 if root.h_opp1 == 'None' else 1
BoxLayout:
orientation: 'vertical'
size_hint_y: 0.9
valign: 'center'
Image:
source: root.h_opp2_icon
ScaleLabel:
text: "Level: " + root.h_lvl2
opacity: 0 if root.h_opp2 == 'None' else 1
BoxLayout:
orientation: 'vertical'
size_hint_y: 0.9
valign: 'center'
Image:
source: root.h_spirits1_icon
Image:
source: root.h_spirits2_icon
BoxLayout:
orientation: 'vertical'
size_hint_y: 0.9
valign: 'center'
Image:
source: root.h_spirits3_icon
Image:
source: root.h_spirits4_icon
BoxLayout:
orientation: 'vertical'
size_hint_y: 0.9
valign: 'center'
Image:
size_hint_y: 0.45
source: root.h_spirits5_icon
Image:
size_hint_y: 0.45
source: root.h_spirits6_icon
ScaleLabel:
text: "Difficulty:\n" + root.h_diff
CheckBox:
id: root.key
group: 'historytoggle'
on_release: app.root.get_screen('History').historytoggle(root.key)
<HistoryScreen>:
name: 'History'
GridLayout:
cols: 1
HISTORYRV:
id: HISTORYRV
viewclass: 'HistoryViewClass'
bar_width: 10
bar_color: 1,1,1,0.75
bar_inactive_color: 1,1,1,0.25
RecycleBoxLayout:
default_size_hint: 1, None
orientation: 'vertical'
size_hint_y: None
height: self.minimum_height
BoxLayout:
size_hint_y: 0.075
ScaleButton:
disabled: True if app.historykey == '' else False
text: 'View Selected Game Details'
on_release: Factory.HistoryDetailPopup().open()
ScaleButton:
text: 'Replay Selected Game'
disabled: True if app.historykey == '' else False
on_release: app.root.get_screen('History').replaygame(app.historykey)
Button:
size_hint_y: 0.075
text: 'Return to Main Screen'
on_release: app.root.current = 'Phase'
<ChallengeScreen>:
name: 'Challenge'
GridLayout:
cols: 1
Label:
text: 'Coming Soon!'
Button:
size_hint_y: 0.075
text: 'Return to Main Screen'
on_release: app.root.current = 'Phase'
<PhaseScreen>:
name: 'Phase'
id: PhaseScreen
GridLayout:
cols: 1
size_hint_y: 1
size_hint_x: 1
BoxLayout:
size_hint_y: .1
cols: 3
BoxLayout:
size_hint_x: .05
orientation: 'vertical'
rows: 2
Button:
id: configbutton
canvas:
Rectangle:
source: "resources/gear.png"
#pos: (self.width - configbutton.width)/2 + self.pos[0], (self.height - configbutton.width)/2 + self.pos[1]
#pos: configbutton.center_x - self.width*0.5 , configbutton.center_y - self.height * .5
pos: configbutton.center_x - ((configbutton.width*0.9)/2), configbutton.center_y - ((configbutton.height*0.9)/2)
size: min(configbutton.width, configbutton.height)*0.9, min(configbutton.width, configbutton.height)*0.9
on_release: app.open_settings()
Button:
id: winlose
opacity: 0 if root.setupScreens else 1
canvas:
Rectangle:
source: "resources/flag.png"
pos: winlose.center_x - ((winlose.width*0.9)/2), winlose.center_y - ((winlose.height*0.9)/2)
size: winlose.width*0.9, winlose.height*0.9
on_release: Factory.WinLosePopup().open()
ScaleLabel:
text: root.title
font_size: self.height*0.7
size_hint_x: .90
halign: 'center'
valign: 'center'
BoxLayout:
orientation: 'vertical'
size_hint_x: .05
rows: 2
Button:
text: 'X'
on_release: app.stop()
Button:
text: '?'
on_release: Factory.HelpPopup().open()
BoxLayout:
size_hint_y: .75 if root.setupScreens else .60
PhaseManager:
id: PhaseManager
MainScreen:
SpiritSelectScreen:
MapLayoutScreen:
BoardSetupScreen:
SpiritSetupScreen:
FirstExploreScreen:
GrowthScreen:
EnergyScreen:
PowerCardsScreen:
FastPowerScreen:
BlightedIslandScreen:
EventScreen:
FearScreen:
HighImmigrationScreen:
RavageScreen:
BuildScreen:
ExploreScreen:
AdvanceCardsScreen:
SlowPowerScreen:
TimePassesScreen:
BoxLayout:
#Enemy Health
size_hint_y: 0 if root.setupScreens else .10
opacity: 0 if root.setupScreens else 1
cols:8
Image:
source: "resources/tokens/Icon Explorer.png"
height: 55
BoxLayout:
orientation: "vertical"
rows: 2
ScaleLabel:
text: root.ehealth + " H"
font_size: self.height*0.7
ScaleLabel:
text: root.edamage + " D"
font_size: self.height*0.7
Image:
source: "resources/tokens/Icon Town.png"
height: 55
BoxLayout:
orientation: "vertical"
rows: 2
ScaleLabel:
text: root.thealth + " H"
font_size: self.height*0.7
ScaleLabel:
text: root.tdamage + " D"
font_size: self.height*0.7
Image:
source: "resources/tokens/Icon City.png"
height: 55
BoxLayout:
orientation: "vertical"
rows: 2
ScaleLabel:
text: root.chealth + " H"
font_size: self.height*0.7
ScaleLabel:
text: root.cdamage + " D"
font_size: self.height*0.7
Image:
source: "resources/tokens/Icon Dahan.png"
height: 55
BoxLayout:
orientation: "vertical"
rows: 2
ScaleLabel:
text: root.dhealth + " H"
font_size: self.height*0.7
ScaleLabel:
text: root.ddamage + " D"
font_size: self.height*0.7
BoxLayout:
size_hint_y: 0 if root.setupScreens else .075
opacity: 0 if root.setupScreens else 1
cols: 4
CheckBox:
canvas:
Color:
rgba: [1, 0, 0, 0.2] if self.active else [0, 1, 0, 0.2]
Rectangle:
size: self.size
pos: self.pos
active: root.blighted
on_active: Factory.BlightPopup().open() if root.blight_checkbox(self.active) else ""
id: blight
background_checkbox_normal: 'resources/checkbox_unchecked.png'
background_checkbox_down: 'resources/checkbox_checked.png'
ScaleLabel:
canvas:
Color:
rgba: [1, 0, 0, 0.2] if blight.active else [0, 1, 0, 0.2]
Rectangle:
size: self.size
pos: self.pos
text: 'Blighted\nIsland'
font_size: self.height*0.4
ToggleButton:
state: 'down' if root.I else 'normal'
text: "I"
id: stage1
group: "stage_group"
font_size: self.height*0.95
on_press: root.on_stage_toggle ("I")
ToggleButton:
state: 'down' if root.II else 'normal'
text: "II"
id: stage2
group: "stage_group"
font_size: self.height*0.95
on_press: root.on_stage_toggle ("II")
ToggleButton:
state: 'down' if root.III else 'normal'
text: "III"
id: stage3
group: "stage_group"
font_size: self.height*0.95
on_press: root.on_stage_toggle ("III")
BoxLayout:
cols:2
size_hint_y: 0.075 if root.currentP == 'Main' else 0
opacity: 1 if root.currentP == 'Main' else 0
ScaleButton:
text: 'Challenge Games'
on_release: app.root.current = 'Challenge'
ScaleButton:
text: 'Game History'
on_release: app.root.current = 'History'
BoxLayout:
cols: 2
size_hint_y: .075
ScaleButton:
#on_release: root.read_state() if root.currentP == 'Main' else app.root.current = root.on_back()
#on_release: PhaseManager.current = root.on_back()
on_release: PhaseManager.current = root.read_state() if root.currentP == 'Main' else root.on_back()
text: 'Load Previous\nSession' if root.currentP == 'Main' else 'Back'
font_size: self.height*0.4
size_hint_x: .3
height: 55
ScaleButton:
on_release: PhaseManager.current = root.on_next_Phase()
#text: root.next_button_text() + root.time
text: root.next_button_value if root.setupScreens else "Next Phase " + root.time
font_size: self.height*0.8
size_hint_x: 0.7
height: 55
<MainScreen>:
name: 'Main'
GridLayout:
cols: 1
BoxLayout:
orientation: "horizontal"
cols: 5
size_hint_y: .0775
ScaleLabel:
size_hint_x: .45
text: "Branch and Claw:"
font_size: 20
CheckBox:
size_hint_x: .05
id: branchandclaw
active: root.bc
on_active: root.bc_clicked(self.active)
background_checkbox_normal: 'resources/checkbox_unchecked.png'
background_checkbox_down: 'resources/checkbox_checked.png'
ScaleLabel:
size_hint_x: .45
text: "Jagged Earth:"
font_size: 20
CheckBox:
size_hint_x: .03
id: jaggedearth
active: root.je
on_active: root.je_clicked(self.active)
background_checkbox_normal: 'resources/checkbox_unchecked.png'
background_checkbox_down: 'resources/checkbox_checked.png'
Label:
size_hint_x: 0.02
BoxLayout:
orientation: "horizontal"
cols: 5
size_hint_y: .0775
ScaleLabel:
size_hint_x: .45
text: "Promo Pack 1:"
font_size: 20
CheckBox:
size_hint_x: 0.05
id: promo1
active: root.pp1
on_active: root.promo1_clicked(self.active)
background_checkbox_normal: 'resources/checkbox_unchecked.png'
background_checkbox_down: 'resources/checkbox_checked.png'
ScaleLabel:
size_hint_x: .45
text: "Promo Pack 2:"
font_size: 20
CheckBox:
size_hint_x: 0.03
id: promo2
active: root.pp2
on_active: root.promo2_clicked(self.active)
background_checkbox_normal: 'resources/checkbox_unchecked.png'
background_checkbox_down: 'resources/checkbox_checked.png'
Label:
size_hint_x: 0.02
BoxLayout:
orientation: "horizontal"
cols: 6
size_hint_y: .0775
ScaleLabel:
size_hint_x: .35
text: "Thematic Map:"
font_size: 20
CheckBox:
size_hint_x: .05
id: thematicmap
active: root.theme
on_active: root.thematic_clicked(self.active)
background_checkbox_normal: 'resources/checkbox_unchecked.png'
background_checkbox_down: 'resources/checkbox_checked.png'
ScaleLabel:
size_hint_x: .25
text: "No Tokens:"
disabled: root.notoken_disabled
font_size: 20
CheckBox:
size_hint_x: .05
id: thematictokens
active: root.notoke
on_active: root.notokens_clicked(self.active)
disabled: root.notoken_disabled
background_checkbox_normal: 'resources/checkbox_unchecked.png'
background_checkbox_down: 'resources/checkbox_checked.png'
background_checkbox_disabled_normal: 'resources/checkbox_disabled.png'
ScaleLabel:
size_hint_x: .33
text: "Extra Board:"
font_size: 20
CheckBox:
size_hint_x: .03
id: extraBoard
active: root.extrab
on_active: root.extraboard_clicked(self.active)
background_checkbox_normal: 'resources/checkbox_unchecked.png'
background_checkbox_down: 'resources/checkbox_checked.png'
Label:
size_hint_x: 0.025
BoxLayout:
orientation: "horizontal"
cols: 2
size_hint_y: .0775
ScaleLabel:
size_hint_x: .5
id: opponent
text: 'Adversary 1'
font_size: 20
Spinner:
size_hint_x: .4
background_color: [1,0,0,1]
text: root.opp[0]
values: root.opp_list
on_text: root.opponent_clicked(0,self.text)
# BoxLayout:
# orientation: "horizontal"
# cols: 2
# size_hint_y: .0775
# Label:
# id: level
# text: "Adversary 1 Level"
# font_size: 20
Spinner:
size_hint_x: .1
background_color: [1,0,0,1]
text: root.lvl[0]
on_text: root.level_clicked(0,self.text)
values: root.max_levels[0]
BoxLayout:
orientation: "horizontal"
cols: 2
size_hint_y: .0775
ScaleLabel:
size_hint_x: 0.5
id: opponent
text: 'Adversary 2'
font_size: 20
Spinner:
size_hint_x: 0.4
background_color: [0, 0, 1, 1]
text: root.opp[1]
values: root.opp_list
on_text: root.opponent_clicked(1,self.text)
# BoxLayout:
# orientation: "horizontal"
# cols: 2
# size_hint_y: .0775
# Label:
# id: level
# text: "Adversary 2 Level"
# font_size: 20
Spinner:
size_hint_x: 0.1
background_color: [0, 0, 1, 1]
text: root.lvl[1]
on_text: root.level_clicked(1,self.text)
values: root.max_levels[1]
BoxLayout:
orientation: "horizontal"
cols: 2
size_hint_y: .0775
ScaleLabel:
id: opponent
text: 'Scenario'
font_size: 20
Spinner:
background_color: [.5,0,.5,1]
text: root.scen
values: root.scen_list
on_text: root.scenario_clicked(self.text)
BoxLayout:
orientation: "horizontal"
cols: 2
size_hint_y: .0775
ScaleLabel:
id: player
text: "Players"
font_size: 20
Spinner:
background_color: [0, 1, 1, 1]
text: root.play
on_text: root.players_clicked(self.text)
values: root.max_play
BoxLayout:
orientation: "horizontal"
cols: 2
size_hint_y: 0.0775
ScaleLabel:
id: difficulty
text: "Difficulty"
font_size: 20
ScaleLabel:
id: diff
text: root.diff
font_size:20
<SpiritSelectScreen>:
name: 'SpiritSelect'
GridLayout:
cols: 1
### First Row
BoxLayout:
cols: 2
size_hint_y: .075
Label:
size_hint_x: .5
text: 'Spirit 1'
Label:
opacity: 0 if root.play < 2 else 1
disabled: True if root.play < 2 else False
size_hint_x: .5
text: 'Spirit 2'
BoxLayout:
cols: 2
size_hint_y: .1
Spinner:
size_hint_x: .5
text: root.spirit1
values: root.spirit_values
on_text: root.on_select_spirit(1, self.text)
Spinner:
opacity: 0 if root.play < 2 else 1
disabled: True if root.play < 2 else False
size_hint_x: .5
text: root.spirit2
values: root.spirit_values
on_text: root.on_select_spirit(2, self.text)
BoxLayout:
cols: 2
size_hint_y: .075
Spinner:
opacity: 1 if root.spirit1_has_aspect else 0
disabled: False if root.spirit1_has_aspect else True
size_hint_x: .5
text: root.aspect1
values: root.spirit1_aspects
on_text: root.on_select_aspect (1, self.text)
Spinner:
opacity: 1 if root.spirit2_has_aspect else 0
disabled: False if root.spirit2_has_aspect else True
size_hint_x: .5
text: root.aspect2
values: root.spirit2_aspects
on_text: root.on_select_aspect (2, self.text)
### second row
BoxLayout:
cols: 2
size_hint_y: .075
Label:
opacity: 0 if root.play < 3 else 1
disabled: True if root.play < 3 else False
size_hint_x: .5
text: 'Spirit 3'
Label:
opacity: 0 if root.play < 4 else 1
disabled: True if root.play < 4 else False
size_hint_x: .5
text: 'Spirit 4'
BoxLayout:
cols: 2
size_hint_y: .1
Spinner:
opacity: 0 if root.play < 3 else 1
disabled: True if root.play < 3 else False
size_hint_x: .5
text: root.spirit3
values: root.spirit_values
on_text: root.on_select_spirit(3, self.text)
Spinner:
opacity: 0 if root.play < 4 else 1
disabled: True if root.play < 4 else False
size_hint_x: .5
text: root.spirit4
values: root.spirit_values
on_text: root.on_select_spirit(4, self.text)
BoxLayout:
cols: 2
size_hint_y: .075
Spinner:
opacity: 1 if root.spirit3_has_aspect else 0
disabled: False if root.spirit3_has_aspect else True
size_hint_x: .5
text: root.aspect3
values: root.spirit3_aspects
on_text: root.on_select_aspect (3, self.text)
Spinner:
opacity: 1 if root.spirit4_has_aspect else 0
disabled: False if root.spirit4_has_aspect else True
size_hint_x: .5
text: root.aspect4
values: root.spirit4_aspects
on_text: root.on_select_aspect (4, self.text)
### Third Row
BoxLayout:
cols: 2
size_hint_y: .075
Label:
opacity: 0 if root.play < 5 else 1
disabled: True if root.play < 5 else False
size_hint_x: .5
text: 'Spirit 5'
Label:
opacity: 0 if root.play < 6 else 1
disabled: True if root.play < 6 else False
size_hint_x: .5
text: 'Spirit 6'
BoxLayout:
cols: 2
size_hint_y: .1
Spinner:
opacity: 0 if root.play < 5 else 1
disabled: True if root.play < 5 else False
size_hint_x: .5
text: root.spirit5
values: root.spirit_values
on_text: root.on_select_spirit(5, self.text)
Spinner:
opacity: 0 if root.play < 6 else 1
disabled: True if root.play < 6 else False
size_hint_x: .5
text: root.spirit6
values: root.spirit_values
on_text: root.on_select_spirit(6, self.text)
BoxLayout:
cols: 2
size_hint_y: .075
Spinner:
opacity: 1 if root.spirit5_has_aspect else 0
disabled: False if root.spirit5_has_aspect else True
size_hint_x: .5
text: root.aspect5
values: root.spirit5_aspects
on_text: root.on_select_aspect (5, self.text)
Spinner:
opacity: 1 if root.spirit6_has_aspect else 0
disabled: False if root.spirit6_has_aspect else True
size_hint_x: .5
text: root.aspect6
values: root.spirit6_aspects
on_text: root.on_select_aspect (6, self.text)
<MapLayoutScreen>:
name: 'MapLayout'
MAPRV:
id: MAPRV
viewclass: 'MapViewClass'
RecycleBoxLayout:
default_size_hint: 1, None
orientation: 'vertical'
size_hint_y: None
height: self.minimum_height
<BoardSetupScreen>:
name: 'BoardSetup'
id: 'BoardSetup'
RV:
id: RV
viewclass: 'MyViewClass'
RecycleBoxLayout:
default_size_hint: 1, None
orientation: 'vertical'
size_hint_y: None
height: self.minimum_height
<SpiritSetupScreen>:
name: 'SpiritSetup'
RV:
id: RV
viewclass: 'MyViewClass'
RecycleBoxLayout:
default_size_hint: 1, None
orientation: 'vertical'
size_hint_y: None
height: self.minimum_height
<FirstExploreScreen>:
name: 'FirstExplore'
id: 'FirstExplore'
RV:
id: RV
viewclass: 'MyViewClass'
RecycleBoxLayout:
default_size_hint: 1, None