-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.java
More file actions
2882 lines (2627 loc) · 203 KB
/
Copy pathMain.java
File metadata and controls
2882 lines (2627 loc) · 203 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
import java.awt.*;
import java.util.Scanner;
import java.io.*;
import java.awt.event.*;
import java.text.*;
import javax.swing.*;
import javax.sound.sampled.*;
/**
* everything outside the main method is nice and neat i swear
*
* @version 3
* @author jusps
*/
public class Main extends JFrame implements KeyListener {
private static boolean lightMode = false; //u can customize to start in light mode here
JLabel label;
private static final DecimalFormat priceFormat = new DecimalFormat("###,###,##0.00");
public static Registry registry = new Registry();
public static Inventory inventory = new Inventory();
private static byte animation = 3;
private static byte menu = 0;
private static byte menuType = 0;
private static int num2Order = 0;
private static boolean rightPanelSelected = false;
private static String[] description;
private static String receipt;
private static String[] loadedInfo;
public static boolean upPress;
public static boolean dwnPress;
public static boolean lPress;
public static boolean rPress;
public static boolean selectPress;
public static boolean backPress;
public static boolean express;
public static byte measuring = (byte)1;
public static int[] compareIndex = new int[2];
public static String nextFile;
public static final String[][][] asciiArtThings = new String[][][]
{{{" ▐▔▔▔▔▔▌ ", //Books
" ▐ ▌ ",
" ▐ ▌ ",
" ▐▁▁▁▁▁▌ "},
{" ▐▔▔▔▔▌▒▌",
" ▐ ▌▒▌",
" ▐ ▌▒▌",
" ▐▁▁▁▁▌▒▌"},
{" █▀▀▀▀▀█ ",
" █ █ ",
" █ █ ",
" █▄▄▄▄▄█ "},
{" ▐▀▀▀▀█▒▌",
" ▐ █▒▌",
" ▐ █▒▌",
" ▐▄▄▄▄█▒▌"}},
{{" ▄▀▀▀▀▀▄ ", //CDs
"█ ▄ █",
"█ ▀ █",
" ▀▄▄▄▄▄▀ "},
{" ▄▀▀▀▀▄ ",
" █ ▄ █",
" █ ▀ █",
" ▀▄▄▄▄▀ "},
{" ▄▀▀▀▀▀▄ ",
"█ ▄ █",
"█ ▀ █",
" ▀▄▄▄▄▄▀ "},
{" ▄▀▀▀▀▄ ",
" █ ▄ █",
" █ ▀ █",
" ▀▄▄▄▄▀ "}},
{{" ▄▀▀▀▀▀▄ ", //DVDs
"█ ▄ █",
"█ ▀ █",
" ▀▄▄▄▄▄▀ "},
{" ▄▀▀▀▀▄ ",
" █ ▄ █",
" █ ▀ █",
" ▀▄▄▄▄▀ "},
{" ▄▀▀▀▀▀▄ ",
"█ ▃ █",
"█ ▔ █",
" ▀▄▄▄▄▄▀ "},
{" ▄▀▀▀▀▄ ",
" █ ▃ █",
" █ ▔ █",
" ▀▄▄▄▄▀ "}},
{{" ▄▄▀▀ ", //return
" ▀██▀▀▀▄ ",
" ▀▀ █",
" ▄▄▄▄▄▀ "},
{" ▄▄▀▀ ", //return
" ▀██▀▀▀▄ ",
" ▀▀ █",
" ▄▄▄▄▄▀ "},
{"","","",""},{"","","",""}}, // waste the rest of the space
{{" ▄ ", //add new
" ▄▄█▄▄ ",
" █ ",
" "},
{" ▄ ",
" ▄▄█▄▄ ",
" █ ",
" "},
{"","","",""},{"","","",""}}, // waste the rest of the space
{{" ▄ ", // customer
" ▄▄▄▄▄ ",
" ▀ ███ ▀ ",
" █ █ "},
{" ▄ ",
" ▄▄▄▄▄▄▄ ",
" ███ ",
" █ █ "},
{" $ ▄ $ ",
" ▄▄▄▄▄ ",
" ▀ ███ ▀ ",
" █ █ "},
{" $ ▄ $ ",
" ▄▄▄▄▄▄▄ ",
" ███ ",
" █ █ "}},
{{"▄▄▄▄▄▄▄▄▄",
"█▄▀▄▀▄▀▄█",
" █▀▄▀▄▀█ ",
"▄▀█▄█▄█▀▄"},
{"█▀▀▀▀▀▀▀█",
"█▄▄▄▄▄▄▄█",
"▀█▄▀▄▀▄█▀",
"▄█▄█▄█▄█▄"},
{"▄▄▄▄▄▄▄▄▄",
"██▀██▄█▄█",
" █▀██▄▀█ ",
"▄▀█▄█▄█▀▄"},
{"█▀▀▀▀▀▀▀█",
"██▄██▄█▄█",
"▀█▄██▀██▀",
"▄███▄███▄"}},
{{" ▄▄▄▄▄ ", //compare
" █ █ █ ",
"▀▀▀ █ ▀▀▀",
" ▄▄█▄▄ "},
{" ▄▀▄▄▄ ",
"▄█▄ █ ▀▄ ",
" █ ▄█▄",
" ▄▄█▄▄ "},
{" ▄▄▄▀▄ ",
" ▄▀ █ ▄█▄",
"▄█▄ █ ",
" ▄▄█▄▄ "}},
{{" ▄▄▄▄ ", // file
" █▒▒█ ",
" █▒▒█ ",
" ▀▀▀▀ "},
{" █▀▀█ ",
" █░░█ ",
" █░░█ ",
" █▄▄█ "},
{" ▄▀▀▀▄ ",
" ▄▀ ",
" █ ",
" ▄ "}}};
/**
* @param args the command line arguments
*/
public static void main(String[] args) throws InterruptedException {
//for the JFrame
new Main();
//runTheOpeningTest
if (lightMode) {
System.out.print("\u001B[47m\u001B[30m");
System.out.println("\u001B[47m\u001B[30m█▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀█\u001B[0m");
System.out.println("\u001B[47m\u001B[30m█ █\u001B[0m");
System.out.println("\u001B[47m\u001B[30m█ (1) click (Open Desktop)———————> █\u001B[0m");
System.out.println("\u001B[47m\u001B[30m█ █\u001B[0m");
System.out.println("\u001B[47m\u001B[30m█ (2) activate audio and click the desktop itself █\u001B[0m");
System.out.println("\u001B[47m\u001B[30m█ █\u001B[0m");
System.out.println("\u001B[47m\u001B[30m█ (3) Finally, press \"enter\" / \"spacebar\" to continue █");
for (int indx=0;indx<2;indx++) System.out.println("\u001B[47m\u001B[30m█ █\u001B[0m");
System.out.println("\u001B[47m\u001B[30m█▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄█\u001B[0m");
} else {
System.out.println("█▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀█");
System.out.println("█ █");
System.out.println("█ (1) click (Open Desktop)———————> █");
System.out.println("█ █");
System.out.println("█ (2) activate audio and click the desktop itself █");
System.out.println("█ █");
System.out.println("█ (3) Finally, press \"enter\" / \"spacebar\" to continue █");
for (int indx=0;indx<2;indx++) System.out.println("█ █");
System.out.println("█▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄█");
}
System.out.println("SETUP: (Make sure the entirety of the rectangle above is visible)");
selectPress = false;
while (!selectPress) Thread.sleep(70);
clearScreen();
String printer = " _\n \\\\\n \\ { BTC\n | \\\n / /\n /_/\t\tL...";
for (int i=0;i<printer.length();i++) {
System.out.print(printer.charAt(i));
//if its a space or something invisible it doesnt wait but if not then thread.sleep
if (printer.charAt(i) != '\n' && printer.charAt(i) != ' ' && printer.charAt(i) != '\t') {
//in front of the bite mark put the loading word there, also btc becomes anana ech orp.
if (printer.charAt(i) == 'L') System.out.print("oading");
else if (printer.charAt(i) == 'B') System.out.print("anana ");
else if (printer.charAt(i) == 'T') System.out.print("ech ");
else if (printer.charAt(i) == 'C') System.out.print("orp.");
//sleeep
Thread.sleep(70);
}
}
Thread.sleep(2000);
//fill with white screen
clearScreen();
for (int j = 0;j<10;j++) {
for (int i=0;i<64;i++) System.out.print("█");
System.out.println("\u001B[0m");
if (lightMode) System.out.print("\u001B[47m\u001B[30m");
}
//play the on jingle :D
playSound("onjingle.wav");
//set screen variables
String[] faders = {"✖","X","×","·"," "};
String screen[] = new String[] {"█ █",
"█ █",
"█ ▄ ▄ ▄▄▄▄▄ ▄ ▄▄▄ ▄▄▄ ▄▄ ▄▄ ▄▄▄▄▄ █",
"█ █ █ █ █ █ █ █ █ █ █ █ █ █ █",
"█ █ █ █ █▀▀ █ █ █ █ █ █ █ █▀▀ █",
"█ █ █ █ █ █ █ █ █ █ █ █ █ █ █",
"█ ▀▀ ▀▀ ▀▀▀▀▀ ▀▀▀▀▀ ▀▀▀ ▀▀▀ ▀ ▀ ▀ ▀▀▀▀▀ █",
"█ █"};
//visible screen is what will be printed after the post processing
String visibleScreen[] = new String[8];
//play opening animation
for (int i=0;i<4;i++) {
//fill the spaces in the welcome sign with faders
for (int j=0;j<8;j++) visibleScreen[j] = fillSpace(screen[j], faders[i]);
//sleep thread for a while
Thread.sleep(70);
//clear and print screen
clearScreen();
if (lightMode) {
System.out.print("\u001B[47m\u001B[30m");
System.out.println("\u001B[47m\u001B[30m█▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀█\u001B[0m");
for (int indx=0;indx<8;indx++) System.out.println("\u001B[47m\u001B[30m"+visibleScreen[indx]+"\u001B[0m");
System.out.println("\u001B[47m\u001B[30m█▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄█\u001B[0m");
} else {
System.out.println("█▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀█");
for (int indx=0;indx<8;indx++) System.out.println(visibleScreen[indx]);
System.out.println("█▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄█");
}
}
Thread.sleep(70);
clearScreen();
if (lightMode) {
System.out.print("\u001B[47m\u001B[30m");
System.out.println("\u001B[47m\u001B[30m█▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀█\u001B[0m");
for (int indx=0;indx<8;indx++) System.out.println("\u001B[47m\u001B[30m"+screen[indx]+"\u001B[0m");
System.out.println("\u001B[47m\u001B[30m█▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄█\u001B[0m");
} else {
System.out.println("█▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀█");
for (int indx=0;indx<8;indx++) System.out.println(screen[indx]);
System.out.println("█▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄█");
}
Thread.sleep(1000);
// DISPLAY STUFF
int menuSelection = 0;
//loadFrame says this is the initial loading frame for this new scene
boolean loadFrame = true;
nextFile = "SaveFiles/Day ";
String selectedFile = "E";
if (selectedFile.equals("E")) {
//idk how optimization works but I made this if statement so that this array goes out of the ram once this is done
String files[] = (new File("SaveFiles")).list();
String fullFileNames[] = (new File("SaveFiles")).list();
boolean[] recognized = new boolean[files.length];
//save names & determine which files are recognized as text files
for (int i=0;i<files.length;i++) {
if (files[i].indexOf(".txt") != -1 && files[i].indexOf("Day ") == 0) recognized[i] = true;
//remove the stuff after the dot in the name
if (files[i].indexOf(".") != -1) files[i] = files[i].substring(0, files[i].indexOf("."));
}
while (selectedFile.equals("E")) {
//controls
if (lPress) {
if (menuSelection > 0) {
playSound("blip.wav");
menuSelection--;
lPress = false;
loadFrame = true;
}
}
if (rPress) {
if (menuSelection < files.length-1) {
playSound("blip.wav");
menuSelection++;
rPress = false;
loadFrame = true;
}
}
//load the frame
if (loadFrame) {
loadFrame = false; // Select Save File
visibleScreen = new String[] {"█ Select Save File ▄▄▄ ▄▄▄ █","","","","","","",""};
//I'm using menuSelection as an index
for (int disp=0;disp<5;disp++) {
if (disp+menuSelection < 2) for (int i=1;i<6;i++) visibleScreen[i] += " ";
else if (menuSelection+disp-2 < files.length) {
if (disp == 2) {
if (recognized[menuSelection])
for (int i=0;i<4;i++) visibleScreen[i+1] += " "+asciiArtThings[8][1][i]+" ";
else for (int i=0;i<4;i++) visibleScreen[i+1] += " "+asciiArtThings[8][2][i]+" ";
visibleScreen[5] += " ";
for (int i=0;i<35-(files[menuSelection-2+disp].length()/2);i++)visibleScreen[6] += " ";
visibleScreen[6] += files[menuSelection-2+disp];
while (visibleScreen[6].length() < 66) visibleScreen[6]+=" ";
visibleScreen[7] = " ";
} else {
if (recognized[disp+menuSelection-2])
for (int i=0;i<4;i++) visibleScreen[i+1] += " "+asciiArtThings[8][0][i]+" ";
else for (int i=0;i<4;i++) visibleScreen[i+1] += " "+asciiArtThings[8][2][i]+" ";
String thisName = files[disp+menuSelection-2];
if (thisName.length() > 12) {
visibleScreen[5] += thisName.substring(0,11)+"…";
while (visibleScreen[5].length() < visibleScreen[4].length()) visibleScreen[5]+=" ";
} else {
for (int i=0;i<5-(thisName.length()/2);i++)visibleScreen[5] += " ";
visibleScreen[5] += thisName;
while (visibleScreen[5].length() < visibleScreen[4].length()) visibleScreen[5]+=" ";
// for (int i=0;i<5-((thisName.indexOf(" ")+2)/2);i++)visibleScreen[5] += " ";
// visibleScreen[5] += thisName.substring(0,thisName.indexOf(" ")+2) + ".";
// while (visibleScreen[5].length() < visibleScreen[4].length()) visibleScreen[5]+=" ";
}
}
}
}
//brute force failsafe
while (visibleScreen[7].length() < 66 || visibleScreen[2].length() < 66) for (int i=1;i<8;i++) visibleScreen[i] += " ";
//limit screen to this area 4 66
for (int i=1;i<5;i++) visibleScreen[i] = "█"+visibleScreen[i].substring(4, 27)+"█"+visibleScreen[i].substring(28, 43)+"█"+visibleScreen[i].substring(44, 66)+"█";
visibleScreen[5] = "█"+visibleScreen[5].substring(4, 27)+"▀▀▀ / | \\ ▀▀▀"+visibleScreen[5].substring(44, 66)+"█";
for (int i=6;i<8;i++) visibleScreen[i] = "█"+visibleScreen[i].substring(4, 66)+"█";
}
//selectpress :D
if (selectPress) {
selectPress = false;
playSound("select.wav");
selectedFile = fullFileNames[menuSelection];
animation = 8; loadFrame = true;
}
//display
clearScreen();
if (lightMode) {
System.out.print("\u001B[47m\u001B[30m");
System.out.println("\u001B[47m\u001B[30m█▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀█\u001B[0m");
for (int indx=0;indx<8;indx++) System.out.println("\u001B[47m\u001B[30m"+visibleScreen[indx]+"\u001B[0m");
System.out.println("\u001B[47m\u001B[30m█▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄█\u001B[0m");
} else {
System.out.println("█▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀█");
for (int indx=0;indx<8;indx++) System.out.println(visibleScreen[indx]);
System.out.println("█▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄█");
}
//System.out.println(menuSelection+" | "+selectedFile);//debug
System.out.print("(arrow keys to move, enter to select, backspace to go back)");
Thread.sleep(70);
}
//check what the next day number will be:
int dayNum = 0;
for (String name : files) {
if (name.indexOf("Day ") != -1 && isInteger(name.substring(name.indexOf(" ")+1))) {
int thisNum = Integer.parseInt(name.substring(name.indexOf(" ")+1));
if (thisNum > dayNum) dayNum = thisNum;
}
}
nextFile += (1+dayNum)+".txt";
}
readSaveFile(selectedFile);
boolean running = true; //this boolean will become false when the user exits
while (running) {
Thread.sleep(70);
if (menu == 0 || menu == 4 || menu == 9 || menu == 10) animation++;
//MENU, -1 = System(store stats, new month, save), 0=main, 1=Customers, 2=CustomerDetails, 3=AddCustomer
// 4=Inventory, 5=InventoryPurchaseMenu, 6=InventoryPurchase, 7=InventoryRestockMenu, 8=InventoryRestock
// 9=InventorySelection;Purchase, 10=InventorySelection;restock
switch (menu) {
case -1:
//I actually made this last so I gave up on using loading, the screen and visibleScreen and am only using visibleScreen
visibleScreen[0] = "█ SYSTEM ";
//in this scenario, the animation variable is used for scrolling up and down
if (animation < 1) {
animation = 0;
visibleScreen[0] += "∧ █";
} else visibleScreen[0] += "▲ █";
if (animation > 17) {
animation = 17;
}
for (int i=1;i<8;i++) {
switch(animation+i) {
case 1: visibleScreen[i] = "█ STORE STATS: "; break;
case 2: visibleScreen[i] = "█ Total Funds: $"+(priceFormat.format(Bookstore.getTotalFunds()*0.01)+" ").substring(0,40); break;
case 3: visibleScreen[i] = "█ Products: "+((inventory.getProductStock((byte)0)+inventory.getProductStock((byte)1)+inventory.getProductStock((byte)2))+" (worth $"+priceFormat.format(inventory.inventoryValue())+") ").substring(0,41); break;
case 4: visibleScreen[i] = "█ ( Books: "+(inventory.getProductStock((byte)0)+", CDs: "+inventory.getProductStock((byte)1)+", DVDs: "+inventory.getProductStock((byte)2)+" ) ").substring(0,37); break;
case 5: visibleScreen[i] = "█ Customers: "+(registry.numMem()+" ").substring(0,40); break;
case 6: visibleScreen[i] = "█ ( Premium: "+registry.numPremMem()+", Regular: "+registry.numRegMem()+" ) "; break;
case 7: case 11: case 16: case 20: visibleScreen[i] = "█——————————————————————————————————————————————————————————— "; break;
case 8: if (menuSelection == 1) visibleScreen[i]="█ █▀▀ ▀▀█ ";
else visibleScreen[i] = "█ ";
break;
case 9: if (menuSelection == 1) visibleScreen[i]="█ █ NEW MONTH █ ";
else visibleScreen[i] = "█ NEW MONTH ";
break;
case 10: if (menuSelection == 1) visibleScreen[i]="█ █▄▄ ▄▄█ ";
else visibleScreen[i] = "█ ";
break;
case 12: if (menuSelection == 2) visibleScreen[i]="█ █▀▀ ▀▀█ ";
else visibleScreen[i] ="█ ";
break;
case 13: if (menuSelection == 2) visibleScreen[i]="█ █ MANUAL SAVE █ ";
//"█ █ DARK MODE █ "
else visibleScreen[i]="█ MANUAL SAVE ";
break;
case 14: if (menuSelection == 2) visibleScreen[i]="█ █▄▄ ▄▄█ ";
else visibleScreen[i]="█ ( Auto-saving is automatic but in case I missed something )";
break;
case 15: if (menuSelection == 2) visibleScreen[i]="█ ( Auto-saving is automatic but in case I missed something )";
else visibleScreen[i]= "█ ";
break;
case 17: if (menuSelection == 3) visibleScreen[i]="█ █▀▀ ▀▀█ ";
else visibleScreen[i] ="█ ";
break;
case 18:
if (menuSelection == 3) {
if (lightMode) visibleScreen[i]="█ █ DARK MODE █ ";
else visibleScreen[i]="█ █ LIGHT MODE █ ";
// DARK MODE
} else {
if (lightMode) visibleScreen[i]="█ DARK MODE ";
else visibleScreen[i]="█ LIGHT MODE ";
}
break;
case 19: if (menuSelection == 3) visibleScreen[i]="█ █▄▄ ▄▄█ ";
else visibleScreen[i]="█ ";
break;
case 21: if (menuSelection == 4) visibleScreen[i]="█ █▀▀ ▀▀█ ";
else visibleScreen[i] ="█ ";
break;
case 22: if (menuSelection == 4) visibleScreen[i]="█ █ SAVE & EXIT █ ";
else visibleScreen[i]="█ SAVE & EXIT ";
break;
case 23: if (menuSelection == 4) visibleScreen[i]="█ █▄▄ ▄▄█ ";
else visibleScreen[i]="█ ";
break;
default: visibleScreen[i] ="█ ";break;
}
if (i == 7) {
if (animation == 17) visibleScreen[i] += "∨ █";
else visibleScreen[i] += "▼ █";
} else visibleScreen[i] += " █";
}
break;
case 0:
if (loadFrame)
screen = new String[] {"█ Funds: $"+(priceFormat.format(Bookstore.getTotalFunds()*0.01)+" ").substring(0,15)+" MAIN MENU █",
"█ ░░░░ ░░░ ░ ░ ░░░ ░ ░ ░░░ █",
"█ ░ ░ ░ ░ ░░Customers ░ ░░ ░ ░ ░ █",
"█ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ █",
"█ ░░░░ ░░░░░ ░ Products░░░ ░ ░ ░ ░░░░░ █",
"█ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ █",
"█ ░ ░ ░ ░ ░ System ░ ░ ░░ ░ ░ █",
"█ ░░░░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ █"};
if (menuSelection == 0) {
visibleScreen[0] = screen[0];
visibleScreen[4] = screen[4];
visibleScreen[5] = screen[5];
visibleScreen[6] = screen[6];
visibleScreen[7] = screen[7];
if (animation == 4 || animation == 0) {
visibleScreen[1] = new String("█ ░░░░ ░░░ ░ ▄ ▄ ▄ ▄ ▄░░ ░ ░ ░░░ █");
visibleScreen[2] = new String("█ ░ ░ ░ ░ ░▀Customers▀ ░ ░░ ░ ░ ░ █");
visibleScreen[3] = new String("█ ░ ░ ░ ░ ░▀░▀ ▀ ▀ ▀ ▀ ░ ░ ░ ░ ░ ░ █");
} else if (animation >=8) {
visibleScreen[1] = new String("█ ░░░░ ░░░ ░▄ ▄ ▄ ▄ ▄ ▄░ ░ ░ ░░░ █");
visibleScreen[2] = new String("█ ░ ░ ░ ░ ░▄Customers▄ ░ ░░ ░ ░ ░ █");
visibleScreen[3] = new String("█ ░ ░ ░ ░ ░ ▀ ▀ ▀ ▀ ▀ ░ ░ ░ ░ ░ ░ █");
animation = 0;
}
} else if (menuSelection == 1) {
visibleScreen[0] = screen[0];
visibleScreen[1] = screen[1];
visibleScreen[2] = screen[2];
visibleScreen[6] = screen[6];
visibleScreen[7] = screen[7];
if (animation == 4) {
visibleScreen[3] = new String("█ ░ ░ ░ ░ ░ ░▄ ▄░▄ ▄ ▄ ░ ░ ░ ░ ░ ░ █");
visibleScreen[4] = new String("█ ░░░░ ░░░░░ ░ ▀Products▄░░ ░ ░ ░ ░░░░░ █");
visibleScreen[5] = new String("█ ░ ░ ░ ░ ░ ▀ ▀ ▀ ▀░▀ ░ ░ ░ ░ ░ ░ █");
} else if (animation >=8) {
visibleScreen[3] = new String("█ ░ ░ ░ ░ ░ ▄ ▄ ▄ ▄░▄ ░ ░ ░ ░ ░ ░ █");
visibleScreen[4] = new String("█ ░░░░ ░░░░░ ░ ▄Products▀░░ ░ ░ ░ ░░░░░ █");
visibleScreen[5] = new String("█ ░ ░ ░ ░ ░ ▀░▀░▀ ▀ ▀ ░ ░ ░ ░ ░ ░ █");
animation = 0;
}
} else if (menuSelection == 2) {
visibleScreen[0] = screen[0];
visibleScreen[1] = screen[1];
visibleScreen[2] = screen[2];
visibleScreen[3] = screen[3];
visibleScreen[4] = screen[4];
if (animation == 4) {
visibleScreen[5] = new String("█ ░ ░ ░ ░ ░ ▄ ▄ ▄░▄ ░ ░ ░ ░ ░ ░ █");
visibleScreen[6] = new String("█ ░ ░ ░ ░ ░ ▀System▄ ░ ░ ░░ ░ ░ █");
visibleScreen[7] = new String("█ ░░░░ ░ ░ ░ ▀ ▀░▀ ▀ ░ ░ ░ ░ ░ █");
} else if (animation >=8) {
visibleScreen[5] = new String("█ ░ ░ ░ ░ ░ ▄░▄░▄ ▄ ░ ░ ░ ░ ░ ░ █");
visibleScreen[6] = new String("█ ░ ░ ░ ░ ░ ▄System▀ ░ ░ ░░ ░ ░ █");
visibleScreen[7] = new String("█ ░░░░ ░ ░ ░ ▀ ▀ ▀░▀ ░ ░ ░ ░ ░ █");
animation = 0;
}
}
break;
//the customerList
case 1:
if (loadFrame) {
if (rightPanelSelected)
visibleScreen = new String[] {"█ Under Whose Account is▄▄This Order? ▄▄▄ █","","","","","","",""};
else
visibleScreen = new String[] {"█ Customers ▄▄▄ ▄▄▄ █","","","","","","",""};
//I'm using menuSelection as an index
for (int disp=0;disp<5;disp++) {
//menuSelection 0 == disp at 2
if (2-menuSelection > disp) for (int i=1;i<6;i++) visibleScreen[i] += " ";
else if (2-menuSelection == disp) {
for (int i=0;i<4;i++) visibleScreen[i+1] += " "+asciiArtThings[3][0][i]+" ";
if (disp == 2) {visibleScreen[5] += " ";visibleScreen[6] += " Return ";}
else visibleScreen[5] += " Return ";
} else if (3-menuSelection == disp) {
for (int i=0;i<4;i++) visibleScreen[i+1] += " "+asciiArtThings[4][0][i]+" ";
if (disp == 2) {visibleScreen[5] += " ";visibleScreen[6] += " Add ";}
else visibleScreen[5] += " Add ";
} else if (registry.numMem()+4-menuSelection > disp) {
if (disp == 2) {
String infoStuff = registry.nameMem()[menuSelection-4+disp]+", "+registry.getAge(menuSelection-4+disp)+", "+registry.getPaymentType(menuSelection-4+disp);
if (registry.isPremium(menuSelection-4+disp)[0])
for (int i=0;i<4;i++) visibleScreen[i+1] += " "+asciiArtThings[5][3][i]+" ";
else for (int i=0;i<4;i++) visibleScreen[i+1] += " "+asciiArtThings[5][1][i]+" ";
visibleScreen[5] += " ";
for (int i=0;i<35-(infoStuff.length()/2);i++)visibleScreen[6] += " ";
visibleScreen[6] += infoStuff;
while (visibleScreen[6].length() < 66) visibleScreen[6]+=" ";
boolean[] paidThisMonth = registry.isPremium(menuSelection-4+disp);
if (paidThisMonth[0]) {
if (paidThisMonth[1]) {
visibleScreen[7] = " Premium (paid) ";
} else visibleScreen[7] = " Premium (unpaid) ";
} else visibleScreen[7] = " Regular ";
} else {
if (registry.isPremium(menuSelection-4+disp)[0])
for (int i=0;i<4;i++) visibleScreen[i+1] += " "+asciiArtThings[5][2][i]+" ";
else for (int i=0;i<4;i++) visibleScreen[i+1] += " "+asciiArtThings[5][0][i]+" ";
String thisName = registry.nameMem()[menuSelection-4+disp];
if (thisName.indexOf(" ") > 9) {
visibleScreen[5] += " "+thisName.substring(0,1)+"."+thisName.substring(thisName.indexOf(" ")+1,thisName.indexOf(" ")+2)+". ";
while (visibleScreen[5].length() < visibleScreen[4].length()) visibleScreen[5]+=" ";
} else {
for (int i=0;i<5-((thisName.indexOf(" ")+2)/2);i++)visibleScreen[5] += " ";
visibleScreen[5] += thisName.substring(0,thisName.indexOf(" ")+2) + ".";
while (visibleScreen[5].length() < visibleScreen[4].length()) visibleScreen[5]+=" ";
}
}
}
}
//brute force failsafe
while (visibleScreen[7].length() < 66 || visibleScreen[2].length() < 66) for (int i=1;i<8;i++) visibleScreen[i] += " ";
//limit screen to this area 4 66
for (int i=1;i<5;i++) visibleScreen[i] = "█"+visibleScreen[i].substring(4, 27)+"█"+visibleScreen[i].substring(28, 43)+"█"+visibleScreen[i].substring(44, 66)+"█";
visibleScreen[5] = "█"+visibleScreen[5].substring(4, 27)+"▀▀▀ / | \\ ▀▀▀"+visibleScreen[5].substring(44, 66)+"█";
for (int i=6;i<8;i++) visibleScreen[i] = "█"+visibleScreen[i].substring(4, 66)+"█";
}
break;
//The customer info
case 2:
if (loadFrame){
screen = new String[] {"█________________________CUSTOMER_INFO_________________________█",
"█","█","█","█","█","█","█"};
loadedInfo = new String[] { registry.nameMem()[menuSelection-2]+", "+registry.getAge(menuSelection-2), registry.getAddress(menuSelection-2), "$"+priceFormat.format(registry.getMoneySpent(menuSelection-2)), registry.getPaymentType(menuSelection-2), registry.getPrivateDetails(menuSelection-2), "" };
if (registry.isPremium(menuSelection-2)[0]) {
if (registry.isPremium(menuSelection-2)[1]) {
loadedInfo[5] += " (Premium, paid this month)";
} else loadedInfo[5] += " (Premium, not paid this month)";
} else loadedInfo[5] += " (Regular)";
screen[1] = "NAME: "+loadedInfo[0];
while (screen[1].length() < 62) screen[1] = " "+screen[1]+" ";
screen[1] = "█"+screen[1].substring(0,62)+"█";
screen[2] = loadedInfo[5];
while (screen[2].length() < 62) screen[2] = " "+screen[2]+" ";
screen[2] = "█"+screen[2].substring(0,62)+"█";
screen[3] = "ADDRESS: "+loadedInfo[1];
while (screen[3].length() < 62) screen[3] = " "+screen[3]+" ";
screen[3] = "█"+screen[3].substring(0,62)+"█";
screen[4] = "HAS SPENT: "+loadedInfo[2];
while (screen[4].length() < 62) screen[4] = " "+screen[4]+" ";
screen[4] = "█"+screen[4].substring(0,62)+"█";
screen[5] = "PAYMENT METHOD: "+loadedInfo[3];
while (screen[5].length() < 62) screen[5] = " "+screen[5]+" ";
screen[5] = "█"+screen[5].substring(0,62)+"█";
screen[6] = "PAYMENT INFO: "+loadedInfo[4];
while (screen[6].length() < 62) screen[6] = " "+screen[6]+" ";
screen[6] = "█"+screen[6].substring(0,62)+"█";
screen[7] = "█ P R E S S X T O S E L L I N F O O N L I N E █";
}
visibleScreen = screen;
break;
//Inventory
case 4:
if (loadFrame)
screen = new String[] {"█ PRODUCTS █",
"█ ░░░░ ░░░ ░ ░ ░░░ ░ ░ ░░░ █",
"█ ░ ░ ░ ░ ░░ ░ ░ ░ ░░ ░ ░ ░ █",
"█ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ █",
"█ ░░░░ ░░░░Purchase ░ ░Restock ░ ░ ░░░░░ █",
"█ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ █",
"█ ░ ░ ░ ░ ░ Back░ ░ ░ ░░ ░ ░ █",
"█ ░░░░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ █"};
if (menuSelection == 0) {
visibleScreen[0] = screen[0];
visibleScreen[1] = screen[1];
visibleScreen[2] = screen[2];
visibleScreen[6] = screen[6];
visibleScreen[7] = screen[7];
if (animation == 4 || animation == 0) {
visibleScreen[3] = new String("█ ░ ░ ░ █▀ ░ ░ ▀█░ ░ ░ ░ ░ ░ ░ ░ █");
visibleScreen[4] = new String("█ ░░░░ ░░░█Purchase█░ ░Restock ░ ░ ░░░░░ █");
visibleScreen[5] = new String("█ ░ ░ ░ ▀▀ ░ ▀▀░ ░ ░ ░ ░ ░ ░ ░ █");
} else if (animation >=8) {
visibleScreen[3] = new String("█ ░ ░ ░ ▄▄ ░ ░ ▄▄░ ░ ░ ░ ░ ░ ░ ░ █");
visibleScreen[4] = new String("█ ░░░░ ░░░█Purchase█░ ░Restock ░ ░ ░░░░░ █");
visibleScreen[5] = new String("█ ░ ░ ░ █▄ ░ ▄█░ ░ ░ ░ ░ ░ ░ ░ █");
animation = 0;
}
} else if (menuSelection == 1) {
visibleScreen[0] = screen[0];
visibleScreen[1] = screen[1];
visibleScreen[2] = screen[2];
visibleScreen[6] = screen[6];
visibleScreen[7] = screen[7];
if (animation == 4) {
visibleScreen[3] = new String("█ ░ ░ ░ ░ ░ ░ ░ █▀ ░ ▀█░ ░ ░ ░ █");
visibleScreen[4] = new String("█ ░░░░ ░░░░Purchase ░ █Restock█ ░ ░ ░░░░░ █");
visibleScreen[5] = new String("█ ░ ░ ░ ░ ░ ░ ░ ▀▀ ░ ▀▀ ░ ░ ░ ░ █");
} else if (animation >=8) {
visibleScreen[3] = new String("█ ░ ░ ░ ░ ░ ░ ░ ▄▄ ░ ▄▄░ ░ ░ ░ █");
visibleScreen[4] = new String("█ ░░░░ ░░░░Purchase ░ █Restock█ ░ ░ ░░░░░ █");
visibleScreen[5] = new String("█ ░ ░ ░ ░ ░ ░ ░ █▄ ░ ▄█ ░ ░ ░ ░ █");
animation = 0;
}
} else if (menuSelection == 2) {
visibleScreen[0] = screen[0];
visibleScreen[1] = screen[1];
visibleScreen[2] = screen[2];
visibleScreen[3] = screen[3];
visibleScreen[4] = screen[4];
if (animation == 4) {
visibleScreen[5] = new String("█ ░ ░ ░ ░ ░ █▀░ ▀█ ░ ░ ░ ░ ░ ░ █");
visibleScreen[6] = new String("█ ░ ░ ░ ░ ░ █Back█ ░ ░ ░░ ░ ░ █");
visibleScreen[7] = new String("█ ░░░░ ░ ░ ░ ▀▀░ ▀▀ ░ ░ ░ ░ ░ █");
} else if (animation >=8) {
visibleScreen[5] = new String("█ ░ ░ ░ ░ ░ ▄▄░ ▄▄ ░ ░ ░ ░ ░ ░ █");
visibleScreen[6] = new String("█ ░ ░ ░ ░ ░ █Back█ ░ ░ ░░ ░ ░ █");
visibleScreen[7] = new String("█ ░░░░ ░ ░ ░ █▄░ ▄█ ░ ░ ░ ░ ░ █");
animation = 0;
}
}
break;
//the inventory
case 5: case 7:
measuring++; if (measuring > 31) measuring = 2;
if (loadFrame || (menuSelection == -1 && measuring % 8 == 2)) {
String topLeft = "";
switch(menu) {
case 5: topLeft += "Purchase ";break;
case 7: topLeft += " Restock ";break;
}
switch(menuType) {
case 0: topLeft += "Books";break;
case 1: topLeft += "CDs ";break;
case 2: topLeft += "DVDs ";break;
}
if (inventory.getUniqueProductStock(menuType)-menuSelection > -1 && menuSelection > 0)
visibleScreen = new String[] {"█ "+topLeft+" ▄▄▄ $","","","","","","",""};
else visibleScreen = new String[] {"█ "+topLeft+" ▄▄▄ ▄▄▄ █","","","","","","",""};
//I'm using menuSelection as an index
for (int disp=0;disp<5;disp++) {
//menuSelection 0 == disp at 2
if (0-menuSelection > disp) for (int i=1;i<6;i++) visibleScreen[i] += " ";
else if (-menuSelection == disp) {
for (int i=0;i<4;i++) visibleScreen[i+1] += " "+asciiArtThings[3][0][i]+" ";
if (disp == 2) {visibleScreen[5] += " ";visibleScreen[6] += " Return ";}
else visibleScreen[5] += " Return ";
} else if (1-menuSelection == disp) {
if (disp == 2) {
if (measuring > 0 && measuring < 8)
for (int i=0;i<4;i++) visibleScreen[i+1] += " "+asciiArtThings[7][0][i]+" ";
else if (measuring > 7 && measuring < 16)
for (int i=0;i<4;i++) visibleScreen[i+1] += " "+asciiArtThings[7][1][i]+" ";
else if (measuring > 15 && measuring < 24)
for (int i=0;i<4;i++) visibleScreen[i+1] += " "+asciiArtThings[7][0][i]+" ";
else
for (int i=0;i<4;i++) visibleScreen[i+1] += " "+asciiArtThings[7][2][i]+" ";
visibleScreen[5] += " ";
visibleScreen[6] += " Compare ";
visibleScreen[7] += " ( Prices ) ";
} else {
for (int i=0;i<4;i++) visibleScreen[i+1] += " "+asciiArtThings[7][0][i]+" ";
visibleScreen[5] += " Compare ";
}
} else if (2-menuSelection == disp) {
if (menu == 5) {
if (disp == 2) {
if (Bookstore.getCartSize() > 0)
for (int i=0;i<4;i++) visibleScreen[i+1] += " "+asciiArtThings[6][3][i]+" ";
else for (int i=0;i<4;i++) visibleScreen[i+1] += " "+asciiArtThings[6][1][i]+" ";
visibleScreen[5] += " ";
visibleScreen[6] += " Cart ";}
else {
visibleScreen[5] += " Cart ";
if (Bookstore.getCartSize() > 0)
for (int i=0;i<4;i++) visibleScreen[i+1] += " "+asciiArtThings[6][2][i]+" ";
else for (int i=0;i<4;i++) visibleScreen[i+1] += " "+asciiArtThings[6][0][i]+" ";
}
} else {
if (disp == 2) {
for (int i=0;i<4;i++) visibleScreen[i+1] += " "+asciiArtThings[4][1][i]+" ";
visibleScreen[5] += " ";
visibleScreen[6] += " Add ";}
else {
visibleScreen[5] += " Add ";
for (int i=0;i<4;i++) visibleScreen[i+1] += " "+asciiArtThings[4][0][i]+" ";
}
}
} else if (inventory.getUniqueProductStock(menuType)+3-menuSelection > disp) {
if (disp == 2) {
if (menu==5) visibleScreen[0] += (inventory.getPrice(menuType, (menuSelection-3+disp))+".99 ").substring(0,7)+"▄▄▄ █";
else {
double price = (inventory.getPrice(menuType, (menuSelection-3+disp))*100+99)*0.004;
visibleScreen[0] += (priceFormat.format(price)+" ").substring(0,7)+"▄▄▄ █";
}
if (inventory.isSpecial(menuType, (menuSelection-3+disp)))
for (int i=0;i<4;i++) visibleScreen[i+1] += " "+asciiArtThings[menuType][3][i]+" ";
else for (int i=0;i<4;i++) visibleScreen[i+1] += " "+asciiArtThings[menuType][1][i]+" ";
visibleScreen[5] += " ";
if (inventory.isSpecial(menuType, (menuSelection-3+disp)))
switch(menuType) {
case 0:
for (int i=0;i<35-(inventory.getName(menuType, (menuSelection-3+disp)).length()/2+6);i++)visibleScreen[6] += " ";
visibleScreen[6] += inventory.getName(menuType, (menuSelection-3+disp))+" (hardcover)";
break;
case 1:
for (int i=0;i<35-((inventory.getName(menuType, (menuSelection-3+disp)).length()+37)/2);i++)visibleScreen[6] += " ";
visibleScreen[6] += inventory.getName(menuType, (menuSelection-3+disp))+" (acually CD ROM of E.T. pc port)";
break;
case 2:
for (int i=0;i<35-((inventory.getName(menuType, (menuSelection-3+disp)).length()+9)/2);i++)visibleScreen[6] += " ";
visibleScreen[6] += inventory.getName(menuType, (menuSelection-3+disp))+" (BluRay)";
}
else {
for (int i=0;i<35-(inventory.getName(menuType, (menuSelection-3+disp)).length()/2);i++)visibleScreen[6] += " ";
visibleScreen[6] += inventory.getName(menuType, (menuSelection-3+disp));
}
while (visibleScreen[6].length() < 66) visibleScreen[6]+=" ";
if (menu==5) {
int stokk = inventory.getProductStock(menuType, menuSelection-1);
if (stokk > 0) visibleScreen[7] = " ("+stokk+" in stock, "+Bookstore.numInCart(menuType, inventory.getName(menuType, (menuSelection-3+disp)))+" in cart)";
else visibleScreen[7] = " OUT OF STOCK";
} else visibleScreen[7] = " ("+inventory.getProductStock(menuType, menuSelection-1)+" in stock)";
while (visibleScreen[7].length() < 66) {visibleScreen[7] = " "+visibleScreen[7];if (visibleScreen[7].length() < 66) visibleScreen[7] += " ";}
} else {
if (inventory.isSpecial(menuType, (menuSelection-3+disp)))
for (int i=0;i<4;i++) visibleScreen[i+1] += " "+asciiArtThings[menuType][2][i]+" ";
else for (int i=0;i<4;i++) visibleScreen[i+1] += " "+asciiArtThings[menuType][0][i]+" ";
if (inventory.getName(menuType, (menuSelection-3+disp)).length() > 11) visibleScreen[5] += inventory.getName(menuType, (menuSelection-3+disp)).substring(0,11)+"… ";
else {
for (int i=0;i<5-(inventory.getName(menuType, (menuSelection-3+disp)).length()/2);i++)visibleScreen[5] += " ";
visibleScreen[5] += inventory.getName(menuType, (menuSelection-3+disp));
while (visibleScreen[5].length() < visibleScreen[4].length()) visibleScreen[5]+=" ";
}
}
}
}
//im lazy so im brute forcing a failsafe
for (int i=1;i<8;i++) visibleScreen[i] += " ";
//limit screen to this area 4 66
for (int i=1;i<5;i++) visibleScreen[i] = "█"+visibleScreen[i].substring(4, 27)+"█"+visibleScreen[i].substring(28, 43)+"█"+visibleScreen[i].substring(44, 66)+"█";
visibleScreen[5] = "█"+visibleScreen[5].substring(4, 27)+"▀▀▀ / | \\ ▀▀▀"+visibleScreen[5].substring(44, 66)+"█";
for (int i=6;i<8;i++) visibleScreen[i] = "█"+visibleScreen[i].substring(4, 66)+"█";
}
break;
//inventory purchase screen
case 6:
if (rightPanelSelected) {
if (animation > 0 && !loadFrame) {animation--;loadFrame = true;if (animation > 3) animation = 3;}
if (loadFrame) {
//limit num2Order to the boundary
if (num2Order < 0) num2Order = 0; else if (num2Order > inventory.getProductStock(menuType, menuSelection-1)) num2Order = inventory.getProductStock(menuType, menuSelection-1);
//find the price
int cartPrice = Bookstore.getTotalPrice();
//create the screen object
visibleScreen=new String[] {"█ Cart: ",
"█▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄█░∨░▒ # to order: ",
"█▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓ ",
"█▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓",
"",
"█▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓ # in stock: ",
"█▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓ █",
"█▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓(press enter to add to cart)█"};
if (Bookstore.getTotalPrice() == 0) visibleScreen[0] += "0 ($0.00) █░∧░▒ ";
else visibleScreen[0] += (Bookstore.getCartSize()+" ($"+priceFormat.format(cartPrice*0.01)+") ").substring(0,22)+"█░∧░▒ ";
if (animation == 0) {
visibleScreen[2] = "█░░Title:░"+(inventory.getName(menuType, menuSelection-1)+"░░░░░░░░░░░░░░░░░░░░░░░").substring(0,24)+"▒ ";
visibleScreen[3] = "█░Description:░░░░░░░░░░░░░░░░░░░░▒";
} else if (animation == 1) visibleScreen[2] = "█░Description:░░░░░░░░░░░░░░░░░░░░▒ ";
visibleScreen[1] += (num2Order+" ").substring(0,11)+"█";
if (num2Order < 1) visibleScreen[2] += "∨ █";
else visibleScreen[2] += "▼ █";
if (num2Order >= inventory.getProductStock(menuType, menuSelection-1)) visibleScreen[0] += "∧ █";
else visibleScreen[0] += "▲ █";
visibleScreen[4] = "($"+priceFormat.format((inventory.getPrice(menuType, menuSelection-1)+0.99)*num2Order);
if (visibleScreen[4].indexOf(".") > visibleScreen[4].length()-3) visibleScreen[4] += "0)";
else if (visibleScreen[4].indexOf(".") == -1) visibleScreen[4] += ".00)";
else visibleScreen[4] += ")";
while (visibleScreen[4].length() < 28) visibleScreen[4] = " "+visibleScreen[4]+" ";
visibleScreen[3] += visibleScreen[4].substring(0,28)+"█";
visibleScreen[4] = visibleScreen[6];
visibleScreen[5] += (inventory.getProductStock(menuType, menuSelection-1)+" ").substring(0,11)+"█";
}
} else {
if (loadFrame) {
//assign description variable
description = new String[(inventory.getDescription(menuType, menuSelection-1).length()/40)+1];
if (inventory.getDescription(menuType, menuSelection-1).charAt(0) == 'Ω') {
//SPECIAL CASE FOR NOT A WAKE, USING OMEGA AS NEXT LINE
int count = 0;
for (int i = 1;i<inventory.getDescription(menuType, menuSelection-1).length();i++) {
if (inventory.getDescription(menuType, menuSelection-1).charAt(i) == 'Ω') count++;
}
description = new String[count+1];
//for some reason its set to null so this fixes that
for (int i=0;i<=count;i++) description[i] = "";
count = 0;
for (int j=1;j<inventory.getDescription(menuType, menuSelection-1).length();j++)
if (inventory.getDescription(menuType, menuSelection-1).charAt(j) == 'Ω') {
description[count] = (description[count]+" ").substring(0,40);
count++;
} else description[count] += inventory.getDescription(menuType, menuSelection-1).charAt(j);
} else for (int i=0;i<description.length;i++) description[i] = (inventory.getDescription(menuType, menuSelection-1)+" ").substring(i*40,(i+1)*40);
screen = new String[] {"█ ",
"█▄▄▄▄▄▄▄▄▄▄▄▄█ ",
"",
"",
"",
"",
"",
""};
//limit animation to where the stuff is now
if (animation > description.length-4) {animation = (byte)(description.length-4);if (animation <= 0) animation = 0;}
if (animation <= 0) animation = 0;
if (animation < description.length-4) screen[1] += "▼ ";
else screen[1] += "∨ ";
if (animation < 1) switch(menuType) {
case 0: screen[0] += "Book Info █ ∧ ";break;
case 1: screen[0] += " CD Info █ ∧ ";break;
case 2: screen[0] += " DVD Info █ ∧ ";break;
} else switch(menuType) {
case 0: screen[0] += "Book Info █ ▲ ";break;
case 1: screen[0] += " CD Info █ ▲ ";break;
case 2: screen[0] += " DVD Info █ ▲ ";break;
}
if (animation == 0) {
screen[2] = ("█ Title: "+inventory.getName(menuType, menuSelection-1)+" ").substring(0,41);
screen[3] = "█ Description: ";
for (int i=0;i<4;i++) if (description.length > i) screen[i+4] = "█"+description[i];
else screen[i+4] = "█ ";
} else if (animation == 1) {
screen[2] = "█ Description: ";
for (int i=0;i<5;i++) if (description.length > i) screen[i+3] = "█"+description[i];
else screen[i+3] = "█ ";
} else for (int i=0;i<6;i++) if (description.length > i+animation-2) screen[i+2] = "█"+description[i+animation-2];
else screen[i+2] = "█ ";
visibleScreen = screen;
visibleScreen[0] += " ▒░░░░░░░░░░░░░░░░∧░░░█";
visibleScreen[1] += " ▒░░░░░#░to░order░"+(Integer.toString(num2Order)+"░░░").substring(0,4)+"█";
visibleScreen[2] += " ▒░░░░░░░░░░░░░░░░∨░░░█";
visibleScreen[3] += " ▒░░░░░░░░░░░░░░░░░░░░█";
visibleScreen[4] += " ▒░░░░░░░░░░░░░░░░░░░░█";
visibleScreen[5] += " ▒░░░░░#░in░stock░"+(inventory.getProductStock(menuType, menuSelection-1)+"░░░░").substring(0,4)+"█";
visibleScreen[6] += " ▒░░░░░░░░░░░░░░░░░░░░█";
visibleScreen[7] += " ▒░░░░░░░░░░░░░░░░░░░░█";
}
}
break;
//inventory restock screen
case 8:
if (rightPanelSelected) {
if (animation > 0 && !loadFrame) {animation--;loadFrame = true;if (animation > 3) animation = 3;}
//actual price is 40% of selling price
//find the price
double itemPrice = ((int)((inventory.getPrice(menuType, menuSelection-1)*100)+99)*0.004);
if (loadFrame) {
//create the screen object
visibleScreen=new String[] {"█ Shop Funds: $",
"█▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄█░∨░▒ # to order: ",
"█▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓ ",
"█▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓",
"",
"█▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓ # in stock: ",
"█▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓ █",
"█▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓ (press enter to restock) █"};
if (Bookstore.getTotalFunds() == 0) visibleScreen[0] += "0.00) █░∧░▒ ";
else visibleScreen[0] += ((long)(Bookstore.getTotalFunds()*0.01)+"."+(Long.toString(Bookstore.getTotalFunds()).substring(Long.toString(Bookstore.getTotalFunds()).length()-2))+" ").substring(0,15)+"█░∧░▒ ";
if (animation == 0) {
visibleScreen[2] = "█░░Title:░"+(inventory.getName(menuType, menuSelection-1)+"░░░░░░░░░░░░░░░░░░░░░░░").substring(0,24)+"▒ ";
visibleScreen[3] = "█░Description:░░░░░░░░░░░░░░░░░░░░▒";
} else if (animation == 1) visibleScreen[2] = "█░Description:░░░░░░░░░░░░░░░░░░░░▒ ";
//set the stuff and also limit num2Order to boundary
if (num2Order < 1) {
num2Order = 0;
visibleScreen[2] += "∨ █";
} else visibleScreen[2] += "▼ █";
if (num2Order >= (int)((Bookstore.getTotalFunds()*0.01)/(itemPrice))) {