-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMenus.bb
786 lines (716 loc) · 22.4 KB
/
Menus.bb
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
;//////////////////////////////////////////////////////////////////////////////
;-------------------------- HARD TIME: MENU SCREENS ---------------------------
;//////////////////////////////////////////////////////////////////////////////
;//////////////////////////////////////////////////////////////////////////////
;------------------------------ 1. MAIN MENU ----------------------------------
;//////////////////////////////////////////////////////////////////////////////
Function MainMenu()
;frame rating
timer=CreateTimer(30)
;MAIN LOOP
foc=1 : oldfoc=foc
go=0 : gotim=0 : keytim=20
While go=0
Cls
frames=WaitTimer(timer)
For framer=1 To frames
;timers
keytim=keytim-1
If keytim<1 Then keytim=0
;PORTAL
gotim=gotim+1
If gotim>20 And keytim=0
;leave
If KeyDown(1) Then go=-1
;proceed
If KeyDown(28) Or ButtonPressed()
If foc=4 Then go=-1 Else go=1
EndIf
EndIf
;CONFIGURATION
If gotim>20 And keytim=0
If KeyDown(200) Or JoyYDir()=-1 Then foc=foc-1 : PlaySound sMenuSelect : keytim=6
If KeyDown(208) Or JoyYDir()=1 Then foc=foc+1 : PlaySound sMenuSelect : keytim=6
If foc<1 Then foc=4
If foc>4 Then foc=1
EndIf
UpdateWorld
Next
RenderWorld 1
;DISPLAY
TileImage gTile
DrawMainLogo(rX#(400),rY#(300))
DrawImage gMDickie,rX#(400),rY#(515)
;options
DrawOption(1,rX#(400),rY#(75),translate("PLAY"),"")
DrawOption(2,rX#(400),rY#(130),translate("OPTIONS"),"")
DrawOption(3,rX#(400),rY#(185),translate("CREDITS"),"")
DrawOption(4,rX#(400),rY#(415),translate("<<< EXIT <<<"),"")
Flip
;screenshot (F12)
If KeyHit(88) Then Screenshot()
Wend
;leave
FreeTimer timer
If go=1 Then PlaySound sMenuGo Else PlaySound sMenuBack
If go=1
If foc=1 Then screen=5
If foc=2 Then screen=2
If foc=3 Then gamEnded=0 : screen=6
EndIf
If go=-1 Then screen=7
End Function
;//////////////////////////////////////////////////////////////////////////////
;------------------------------- 2. OPTIONS -----------------------------------
;//////////////////////////////////////////////////////////////////////////////
Function Options()
;frame rating
timer=CreateTimer(30)
;MAIN LOOP
foc=11 : oldfoc=foc
go=0 : gotim=0 : keytim=20
While go=0
Cls
frames=WaitTimer(timer)
For framer=1 To frames
;timers
keytim=keytim-1
If keytim<1 Then keytim=0
;PORTAL
gotim=gotim+1
If gotim>20 And keytim=0
;leave
If KeyDown(1) Then go=-1
;proceed
If KeyDown(28) Or ButtonPressed()
If foc<9 Then foc=11 : keytim=11
If foc=>9 And foc=<10 Then go=1
If foc=11 And keytim=0 Then go=-1
EndIf
EndIf
;CONFIGURATION
If gotim>20 And keytim=0
;highlight options
If KeyDown(200) Or JoyYDir()=-1 Then foc=foc-1 : PlaySound sMenuSelect : keytim=6
If KeyDown(208) Or JoyYDir()=1 Then foc=foc+1 : PlaySound sMenuSelect : keytim=6
If foc<1 Then foc=11
If foc>11 Then foc=1
;browse left
If KeyDown(203) Or JoyXDir()=-1
If foc=1
optRes=optRes-1
If optRes<1 Then optRes=1 Else ChangeResolution(optRes, 1)
PlaySound sMenuBrowse
keytim=6
EndIf
If foc=2
optWindowed=optWindowed-1
If optWindowed<0 Then optWindowed=1
ChangeWindowed(optWindowed)
PlaySound sMenuBrowse
keytim=6
EndIf
If foc=3 Then optPopulation=optPopulation-5 : PlaySound sMenuBrowse : keytim=6
If foc=4 Then optFog=optFog-1 : PlaySound sMenuBrowse : keytim=6
If foc=5 Then optShadows=optShadows-1 : PlaySound sMenuBrowse : keytim=6
If foc=6 Then optFX=optFX-1 : PlaySound sMenuBrowse : keytim=6
If foc=7 Then optGore=optGore-1 : PlaySound sMenuBrowse : keytim=6
If foc=8
optLanguage=optLanguage-1
If optLanguage<0 Then optLanguage=1
SaveOptions()
PlaySound sMenuBrowse
keytim=6
EndIf
EndIf
;browse right
If KeyDown(205) Or JoyXDir()=1
If foc=1
optRes=optRes+1
If optRes > 6 Then optRes=6 Else ChangeResolution(optRes, 1)
PlaySound sMenuBrowse
keytim=6
EndIf
If foc=2
optWindowed=optWindowed+1
If optWindowed>1 Then optWindowed=0
ChangeWindowed(optWindowed)
PlaySound sMenuBrowse
keytim=6
EndIf
If foc=3 Then optPopulation=optPopulation+5 : PlaySound sMenuBrowse : keytim=6
If foc=4 Then optFog=optFog+1 : PlaySound sMenuBrowse : keytim=6
If foc=5 Then optShadows=optShadows+1 : PlaySound sMenuBrowse : keytim=6
If foc=6 Then optFX=optFX+1 : PlaySound sMenuBrowse : keytim=6
If foc=7 Then optGore=optGore+1 : PlaySound sMenuBrowse : keytim=6
If foc=8
optLanguage=optLanguage+1
If optLanguage>1 Then optLanguage=0
SaveOptions()
PlaySound sMenuBrowse
keytim=6
EndIf
EndIf
EndIf
;check limits
If optPopulation<40 Then optPopulation=40
If optPopulation>100 Then optPopulation=100
If optFog<0 Then optFog=1
If optFog>1 Then optFog=0
If optShadows<0 Then optShadows=0
If optShadows>2 Then optShadows=2
If optFX<0 Then optFX=0
If optFX>2 Then optFX=2
If optGore<0 Then optGore=0
If optGore>3 Then optGore=3
UpdateWorld
Next
RenderWorld 1
;DISPLAY
TileImage gTile
DrawImage gLogo(3),rX#(400),rY#(50)
;options
SetFont font(1)
x=400 : y=110 : spacer=40
DrawOption(1,rX#(400),rY#(y),translate("Resolution"),textResX$(optRes)+" x "+textResY$(optRes)) : y=y+spacer
DrawOption(2,rX#(400),rY#(y),translate("Windowed"), textOnOff$(optWindowed)) : y=y+spacer
DrawOption(3,rX#(400),rY#(y),translate("Population"),translate("#FIRST# characters", str optPopulation)) : y=y+(spacer+5)
DrawOption(4,rX#(400),rY#(y),translate("Fog Effect"),textOnOff$(optFog)) : y=y+spacer
DrawOption(5,rX#(400),rY#(y),translate("Shadows"),textShadows$(optShadows)) : y=y+spacer
DrawOption(6,rX#(400),rY#(y),translate("Particle FX"),textFX$(optFX)) : y=y+spacer
DrawOption(7,rX#(400),rY#(y),translate("Gore"),textGore$(optGore)) : y=y+(spacer+5)
DrawOption(8,rX#(400),rY#(y),translate("Language"),translate(textLanguages$(optLanguage))) : y=y+(spacer+5)
DrawOption(9,rX#(400),rY#(y),translate("REDEFINE KEYS"),"") : y=y+spacer
DrawOption(10,rX#(400),rY#(y),translate("REDEFINE GAMEPAD"),"") : y=y+(spacer+5)
DrawOption(11,rX#(400),rY#(y),translate("<<< BACK <<<"),"")
Flip
;screenshot (F12)
If KeyHit(88) Then Screenshot()
Wend
;leave
FreeTimer timer
If go=1 Then PlaySound sMenuGo Else PlaySound sMenuBack
If go=1
If foc=9 Then screen=3
If foc=10 Then screen=4
If foc=11 Then screen=1
EndIf
If go=-1 Then screen=1
End Function
;//////////////////////////////////////////////////////////////////////////////
;---------------------------- 3. REDEFINE KEYS --------------------------------
;//////////////////////////////////////////////////////////////////////////////
Function RedefineKeys()
;frame rating
timer=CreateTimer(30)
;MAIN LOOP
foc=6 : oldfoc=foc : screenCall=0
go=0 : gotim=0 : keytim=20
While go=0
If screenCall=0 Then Cls
frames=WaitTimer(timer)
For framer=1 To frames
;timers
keytim=keytim-1
If keytim<1 Then keytim=0
;PORTAL
gotim=gotim+1
If gotim>20 And keytim=0 And screenCall=0
;leave
If KeyDown(1) Then go=-1
;proceed
If KeyDown(28) Or ButtonPressed() Or MouseDown(1)
If foc=6 Then go=-1
EndIf
EndIf
;CONFIGURATION
If gotim>20 And keytim=0 And screenCall=0
;highlight options
If KeyDown(200) Or JoyYDir()=-1 Then foc=foc-1 : PlaySound sMenuSelect : keytim=6
If KeyDown(208) Or JoyYDir()=1 Then foc=foc+1 : PlaySound sMenuSelect : keytim=6
If foc<1 Then foc=6
If foc>6 Then foc=1
;activate
If KeyDown(28) Or ButtonPressed()
;enter new command
If foc=<4
PlaySound sMenuBrowse : keytim=20
callX=MouseX() : callY=MouseY()
screenCall=foc
EndIf
;restore defaults
If foc=5
PlaySound sTrash : keytim=20
keyAttack=30 : keyThrow=31
keyDefend=44 : keyPickUp=45
EndIf
EndIf
EndIf
;INPUT DELAY
If screenCall>0 And keytim=0
If screenCall=1 Then keyAttack=AssignKey(keyAttack)
If screenCall=2 Then keyDefend=AssignKey(keyDefend)
If screenCall=3 Then keyThrow=AssignKey(keyThrow)
If screenCall=4 Then keyPickUp=AssignKey(keyPickUp)
EndIf
UpdateWorld
Next
RenderWorld 1
;DISPLAY
TileImage gTile
DrawImage gLogo(3),rX#(400),rY#(50)
;lock mouse
If screenCall>0 Then MoveMouse callX,callY
;options
SetFont font(1)
y=120
DrawOption(1,rX#(400),rY#(y),translate("Attack / Shoot"),Key$(keyAttack))
DrawOption(2,rX#(400),rY#(y+60),translate("Defend / Run"),Key$(keyDefend))
DrawOption(3,rX#(400),rY#(y+120),translate("Throw / Grab"),Key$(keyThrow))
DrawOption(4,rX#(400),rY#(y+180),translate("Pick Up / Drop"),Key$(keyPickUp))
DrawOption(5,rX#(400),rY#(y+250),translate("RESTORE DEFAULTS"),"")
DrawOption(6,rX#(400),rY#(y+320),translate("<<< BACK <<<"),"")
;new overlay
If screenCall=1 Then DrawOption(1,rX#(400),rY#(y),translate("Attack / Shoot"),translate("Press New Key"))
If screenCall=2 Then DrawOption(2,rX#(400),rY#(y+60),translate("Defend / Run"),translate("Press New Key"))
If screenCall=3 Then DrawOption(3,rX#(400),rY#(y+120),translate("Throw / Grab"),translate("Press New Key"))
If screenCall=4 Then DrawOption(4,rX#(400),rY#(y+180),translate("Pick Up / Drop"),translate("Press New Key"))
Flip
;screenshot (F12)
If KeyHit(88) Then Screenshot()
Wend
;leave
FreeTimer timer
If go=1 Then PlaySound sMenuGo Else PlaySound sMenuBack
screen=2
End Function
;//////////////////////////////////////////////////////////////////////////////
;--------------------------- 4. REDEFINE GAMEPAD ------------------------------
;//////////////////////////////////////////////////////////////////////////////
Function RedefineGamepad()
;frame rating
timer=CreateTimer(30)
;MAIN LOOP
foc=6 : oldfoc=foc : screenCall=0
go=0 : gotim=0 : keytim=20
While go=0
If screenCall=0 Then Cls
frames=WaitTimer(timer)
For framer=1 To frames
;timers
keytim=keytim-1
If keytim<1 Then keytim=0
;PORTAL
gotim=gotim+1
If gotim>20 And keytim=0 And screenCall=0
;leave
If KeyDown(1) Then go=-1
;proceed
If KeyDown(28) Or ButtonPressed() Or MouseDown(1)
If foc=6 Then go=-1
EndIf
EndIf
;CONFIGURATION
If gotim>20 And keytim=0 And screenCall=0
;highlight options
If KeyDown(200) Or JoyYDir()=-1 Then foc=foc-1 : PlaySound sMenuSelect : keytim=6
If KeyDown(208) Or JoyYDir()=1 Then foc=foc+1 : PlaySound sMenuSelect : keytim=6
If foc<1 Then foc=6
If foc>6 Then foc=1
;activate
If KeyDown(28) Or ButtonPressed()
;enter new command
If foc=<4
PlaySound sMenuBrowse : keytim=20
callX=MouseX() : callY=MouseY()
screenCall=foc
EndIf
;restore defaults
If foc=5
PlaySound sTrash : keytim=20
buttAttack=1 : buttThrow=2
buttDefend=3 : buttPickUp=4
EndIf
EndIf
EndIf
;INPUT DELAY
If screenCall>0 And keytim=0
If screenCall=1 Then buttAttack=AssignButton(buttAttack)
If screenCall=2 Then buttDefend=AssignButton(buttDefend)
If screenCall=3 Then buttThrow=AssignButton(buttThrow)
If screenCall=4 Then buttPickUp=AssignButton(buttPickUp)
EndIf
UpdateWorld
Next
RenderWorld 1
;DISPLAY
TileImage gTile
DrawImage gLogo(3),rX#(400),rY#(50)
;lock mouse
If screenCall>0 Then MoveMouse callX,callY
;options
SetFont font(1)
y=120
DrawOption(1,rX#(400),rY#(y),translate("Attack / Shoot"),buttAttack)
DrawOption(2,rX#(400),rY#(y+60),translate("Defend / Run"),buttDefend)
DrawOption(3,rX#(400),rY#(y+120),translate("Throw / Grab"),buttThrow)
DrawOption(4,rX#(400),rY#(y+180),translate("Pick Up / Drop"),buttPickUp)
DrawOption(5,rX#(400),rY#(y+250),translate("RESTORE DEFAULTS"),"")
DrawOption(6,rX#(400),rY#(y+320),translate("<<< BACK <<<"),"")
;new overlay
If screenCall=1 Then DrawOption(1,rX#(400),rY#(y),translate("Attack / Shoot"),translate("Press New Button"))
If screenCall=2 Then DrawOption(2,rX#(400),rY#(y+60),translate("Defend / Run"),translate("Press New Button"))
If screenCall=3 Then DrawOption(3,rX#(400),rY#(y+120),translate("Throw / Grab"),translate("Press New Button"))
If screenCall=4 Then DrawOption(4,rX#(400),rY#(y+180),translate("Pick Up / Drop"),translate("Press New Button"))
Flip
;screenshot (F12)
If KeyHit(88) Then Screenshot()
Wend
;leave
FreeTimer timer
If go=1 Then PlaySound sMenuGo Else PlaySound sMenuBack
screen=2
End Function
;//////////////////////////////////////////////////////////////////////////////
;----------------------------- 5. SLOT SELECT --------------------------------
;//////////////////////////////////////////////////////////////////////////////
Function SlotSelect()
;frame rating
timer=CreateTimer(30)
;MAIN LOOP
If slot=>1 And slot=<3 Then foc=slot Else foc=1
go=0 : gotim=0 : keytim=20
While go=0
Cls
frames=WaitTimer(timer)
For framer=1 To frames
;timers
keytim=keytim-1
If keytim<1 Then keytim=0
;PORTAL
gotim=gotim+1
If gotim>20 And keytim=0
;leave
If KeyDown(1) Then go=-1
;proceed
If KeyDown(28) Or ButtonPressed()
If foc=4 Then go=-1 Else go=1
EndIf
EndIf
;CONFIGURATION
If gotim>20 And keytim=0
;highlight slot
If KeyDown(200) Or JoyYDir()=-1 Then foc=foc-1 : PlaySound sMenuSelect : keytim=6
If KeyDown(208) Or JoyYDir()=1 Then foc=foc+1 : PlaySound sMenuSelect : keytim=6
If foc<1 Then foc=4
If foc>4 Then foc=1
;reset
If foc=>1 And foc=<3
If KeyDown(14) Or KeyDown(210) Then gamName$(foc)="" : PlaySound sTrash : keytim=10
If KeyDown(18) And gamName$(foc)<>"" Then PlaySound sComputer : go=2
If KeyDown(207) And gamName$(foc)<>"" Then PlaySound sDoor(1) : go=3
EndIf
EndIf
UpdateWorld
Next
RenderWorld 1
;DISPLAY
TileImage gTile
DrawMainLogo(rX#(400),rY#(300))
DrawImage gMDickie,rX#(400),rY#(515)
;game preview
If foc=>1 And foc=<3
If gamName$(foc)<>"" And gamPhoto(foc)>0
DrawImage gamPhoto(foc),rX#(400)-160,rY#(20+(55*foc))
Color 0,0,0 : Rect rX#(400)-235,rY#(20+(55*foc))-50,150,100,0
EndIf
EndIf
;options
y=75
For count=1 To 3
If gamName$(count)="" Then DrawOption(count,rX#(400),rY#(y),translate("NEW GAME"),"")
If gamName$(count)<>"" Then DrawOption(count,rX#(400),rY#(y),gamName$(count),"")
y=y+55
Next
DrawOption(4,rX#(400),rY#(415),translate("<<< BACK <<<"),"")
Flip
;screenshot (F12)
If KeyHit(88) Then Screenshot()
Wend
;leave
FreeTimer timer
If go=1 Then PlaySound sMenuGo Else PlaySound sMenuBack
If go=1
slot=foc : oldLocation=0
If gamName$(foc)=""
Loader(translate("Please Wait"),translate("Generating Game"))
GenerateGame()
gamChar(0)=gamChar(slot)
gamPointLimit=170
screen=51
Else
Loader(translate("Please Wait"),translate("Restoring Game"))
LoadProgress()
LoadChars()
LoadPhotos()
LoadItems()
camX#=0 : camY#=30 : camZ#=0
If charY#(gamChar(slot))=>100 Then camY#=130
If gamLocation(slot)=2 Then camX#=350 : camZ#=350
screen=50
EndIf
EndIf
If go=>2
slot=foc
Loader(translate("Please Wait"),translate("Restoring Game"))
LoadProgress()
LoadChars()
LoadPhotos()
LoadItems()
If go=2 Then screen=8
If go=3 Then gamEnded=0 : screen=53
EndIf
If go=-1 Then screen=1
End Function
;//////////////////////////////////////////////////////////////////////////////
;------------------------------ 8. EDIT SELECT --------------------------------
;//////////////////////////////////////////////////////////////////////////////
Function EditSelect()
;frame rating
timer=CreateTimer(30)
;MAIN LOOP
foc=1 : oldfoc=foc
go=0 : gotim=0 : keytim=20
While go=0
Cls
frames=WaitTimer(timer)
For framer=1 To frames
;timers
keytim=keytim-1
If keytim<1 Then keytim=0
;PORTAL
gotim=gotim+1
If gotim>20 And keytim=0
;leave
If KeyDown(1) Then go=-1
;proceed
If KeyDown(28) Or ButtonPressed()
If foc=2 Then go=-1 Else go=1
EndIf
EndIf
;CONFIGURATION
If gotim>20 And keytim=0
;highlight option
If KeyDown(200) Or JoyYDir()=-1 Then foc=foc-1 : PlaySound sMenuSelect : keytim=6
If KeyDown(208) Or JoyYDir()=1 Then foc=foc+1 : PlaySound sMenuSelect : keytim=6
If foc<1 Then foc=2
If foc>2 Then foc=1
;browse characters
If foc=1
If KeyDown(203) Or JoyXDir()=-1 Then gamChar(0)=gamChar(0)-1 : PlaySound sMenuBrowse : keytim=5
If KeyDown(205) Or JoyXDir()=1 Then gamChar(0)=gamChar(0)+1 : PlaySound sMenuBrowse : keytim=5
EndIf
EndIf
;limits
If gamChar(0)<1 Then gamChar(0)=no_chars
If gamChar(0)>no_chars Then gamChar(0)=1
UpdateWorld
Next
RenderWorld 1
;DISPLAY
TileImage gTile
DrawMainLogo(rX#(400),rY#(300))
DrawImage gMDickie,rX#(400),rY#(515)
;options
If charSnapped(gamChar(0))>0 And charPhoto(gamChar(0))>0
DrawImage charPhoto(gamChar(0)),rX#(400),rY#(185)-80
Else
DrawImage gPhoto,rX#(400),rY#(185)-80
EndIf
DrawOption(1,rX#(400),rY#(185),translate("Character"),gamChar(0)+". "+charName$(gamChar(0)))
DrawOption(2,rX#(400),rY#(415),translate("<<< BACK <<<"),"")
Flip
;screenshot (F12)
If KeyHit(88) Then Screenshot()
Wend
;leave
FreeTimer timer
If go=1 Then PlaySound sMenuGo Else PlaySound sMenuBack
If go=1 Then gamPointLimit=999 : screen=51
If go=-1 Then screen=5
End Function
;////////////////////////////////////////////////////////////////
;---------------------- RELATED FUNCTIONS -----------------------
;////////////////////////////////////////////////////////////////
;DRAW MAIN LOGO
Function DrawMainLogo(x#,y#)
;logo halves
DrawImage gLogo(1),x#,y#
DrawImage gLogo(2),x#,y#
;version ID
SetFont font(1)
Outline(translate("Version #FIRST#", "1." + version),x#+310,y#+60,200,200,200,200,200,200)
Outline("Rebirth " + rVersion,x#+310,y#+80,200,200,200,200,200,200)
End Function
;DRAW MENU ITEM
Function DrawOption(box,x#,y#,scriptA$,scriptB$)
;assess highlight
highlight=0
If foc=box Or box=-1 Then highlight=1
;draw solo box
If scriptB$=""
If highlight=1 Then DrawImage gMenu(1),x#,y#
If highlight=0 Then DrawImage gMenu(2),x#,y#
SqueezeFont(scriptA$,185,3)
r=135 : g=135 : b=135
If highlight=1 Then r=255 : g=255 : b=255
Outline(scriptA$,x#,y#,0,0,0,r,g,b)
EndIf
;draw twin box
If scriptB$<>""
If highlight=1 Then DrawImage gMenu(3),x#,y#
If highlight=0 Then DrawImage gMenu(4),x#,y#
SqueezeFont(scriptA$,185,3)
r=135 : g=135 : b=135
If highlight=1 Then r=255 : g=255 : b=255
Outline(scriptA$,x#-100,y#,0,0,0,r,g,b)
SqueezeFont(scriptB$,185,3)
Outline(scriptB$,x#+100,y#,0,0,0,r,g,b)
EndIf
End Function
;SQUEEZE FONT INTO BOX
Function SqueezeFont(script$,width,start)
f=start
SetFont font(f)
While f>0 And StringWidth(script$)>width
f=f-1
SetFont font(f)
Wend
End Function
;ASSIGN KEY PROCESS
Function AssignKey(current)
value=0
While value=0
For v=0 To 255
If KeyDown(v)=1 And keytim=0
If v<>0 And v<>1 And v<>28 And v<>25 Then value=v : screenCall=0 : PlaySound sMenuSelect : gotim=0 : keytim=20
EndIf
Next
If KeyDown(1) And keytim=0 Then value=current : screenCall=0 : PlaySound sMenuBack : go=0 : gotim=0 : keytim=30
Wend
Return value
End Function
;ASSIGN BUTTON PROCESS
Function AssignButton(current)
value=28
While value=28
For v=1 To 12
If JoyDown(v)=1 And keytim=0 Then value=v : screenCall=0 : PlaySound sMenuSelect : gotim=0 : keytim=20
Next
If KeyDown(1) And keytim=0 Then value=current : screenCall=0 : PlaySound sMenuBack : go=0 : gotim=0 : keytim=30
Wend
Return value
End Function
;STANDARD LOADING DISPLAY
Function Loader(scriptA$,scriptB$)
Cls
;logos
TileImage gTile
DrawMainLogo(rX#(400),rY#(300))
DrawImage gMDickie,rX#(400),rY#(515)
;message
DrawOption(-1,rX#(400),rY#(415),scriptA$,scriptB$)
;map reference
If screen=50 Or screen=52 Then DisplayMap(400,125)
Flip
End Function
;QUICK LOADING DISPLAY
Function QuickLoader(x#,y#,scriptA$,scriptB$)
SetFont font(1)
DrawOption(-1,x#,y#,scriptA$,scriptB$)
Flip
End Function
;DISPLAY MAP
Function DisplayMap(x,y)
DrawImage gMap,rX#(x),rY#(y)
If screen=50
If gamLocation(slot)=1 Then DrawImage gMarker,rX#(x)-21,rY#(y)-46
If gamLocation(slot)=2 Then DrawImage gMarker,rX#(x)+22,rY#(y)-72
If gamLocation(slot)=3 Then DrawImage gMarker,rX#(x)+47,rY#(y)-15
If gamLocation(slot)=4
If oldLocation=10 Or (oldLocation=4 And charLocation(gamChar(slot))=10)
DrawImage gMarker,rX#(x)+55,rY#(y)+30
Else
DrawImage gMarker,rX#(x)+47,rY#(y)+26
EndIf
EndIf
If gamLocation(slot)=5 Then DrawImage gMarker,rX#(x)+20,rY#(y)+53
If gamLocation(slot)=6
If oldLocation=11 Or (oldLocation=6 And charLocation(gamChar(slot))=11)
DrawImage gMarker,rX#(x)-21,rY#(y)+67
Else
DrawImage gMarker,rX#(x)-22,rY#(y)+54
EndIf
EndIf
If gamLocation(slot)=7 Then DrawImage gMarker,rX#(x)-50,rY#(y)+23
If gamLocation(slot)=8 Then DrawImage gMarker,rX#(x)-48,rY#(y)-21
If gamLocation(slot)=9
If oldLocation=0 Then DrawImage gMarker,rX#(x),rY#(y)+5
If oldLocation=1 Or (oldLocation=9 And charLocation(gamChar(slot))=1) Then DrawImage gMarker,rX#(x)-21,rY#(y)-31
If oldLocation=2 Or (oldLocation=9 And charLocation(gamChar(slot))=2) Then DrawImage gMarker,rX#(x)+21,rY#(y)-31
If oldLocation=3 Or (oldLocation=9 And charLocation(gamChar(slot))=3) Then DrawImage gMarker,rX#(x)+37,rY#(y)-16
If oldLocation=4 Or (oldLocation=9 And charLocation(gamChar(slot))=4) Then DrawImage gMarker,rX#(x)+37,rY#(y)+25
If oldLocation=5 Or (oldLocation=9 And charLocation(gamChar(slot))=5) Then DrawImage gMarker,rX#(x)+20,rY#(y)+40
If oldLocation=6 Or (oldLocation=9 And charLocation(gamChar(slot))=6) Then DrawImage gMarker,rX#(x)-22,rY#(y)+40
If oldLocation=7 Or (oldLocation=9 And charLocation(gamChar(slot))=7) Then DrawImage gMarker,rX#(x)-39,rY#(y)+24
If oldLocation=8 Or (oldLocation=9 And charLocation(gamChar(slot))=8) Then DrawImage gMarker,rX#(x)-40,rY#(y)-21
EndIf
If gamLocation(slot)=10 Then DrawImage gMarker,rX#(x)+55,rY#(y)+44
If gamLocation(slot)=11 Then DrawImage gMarker,rX#(x)-21,rY#(y)+78
EndIf
End Function
;CHANGE RESOLUTION
Function ChangeResolution(resolution,task) ;0=pre-game, 1=during game
;assess preferences
width=Int(textResX$(resolution))
height=Int(textResY$(resolution))
mode = 2
If optWindowed=0 Then mode = 1
;make transition?
If width<>GraphicsWidth() Or height<>GraphicsHeight()
If task>0 Then Loader(translate("Please Wait"),translate("Adjusting Resolution"))
Graphics3D width,height,0,mode
If task>0 ;restore media
LoadImages()
Loader(translate("Please Wait"),translate("Restoring Media"))
LoadPhotos()
LoadTextures()
LoadWeaponData()
EndIf
EndIf
SaveOptions()
End Function
Function ChangeWindowed(windowed)
width=Int(textResX$(optRes))
height=Int(textResY$(optRes))
mode=2
If windowed=0 Then mode=1
Graphics3D width,height,0,mode
LoadImages()
Loader(translate("Please Wait"),translate("Restoring Media"))
LoadPhotos()
LoadTextures()
LoadWeaponData()
SaveOptions()
End Function
;GET SCREENSHOT
Function Screenshot()
;obtain image
PlaySound sCamera
screenshot=CreateImage(GraphicsWidth(),GraphicsHeight())
GrabImage screenshot,GraphicsWidth()/2,GraphicsHeight()/2
;title & save
temp=MilliSecs()/10
namer$="Screenshot - "+temp+".bmp"
SaveImage(screenshot,"Photo Album/" + namer$)
End Function