2
2
// github.com/n0xa | IG: @4x0nn
3
3
4
4
// -=-=-=-=-=-=- Uncomment the platform you're building for -=-=-=-=-=-=-
5
- // #define STICK_C_PLUS
5
+ #define STICK_C_PLUS
6
6
// #define STICK_C_PLUS2
7
7
// #define STICK_C
8
8
// #define CARDPUTER
13
13
// #define LANGUAGE_PT_BR
14
14
15
15
// -- DEPRECATED - THESE ARE NOW EEPROM DEFINED -- //
16
- uint16_t BGCOLOR=0x0000 ;
17
- uint16_t FGCOLOR=0x07E0 ;
16
+ uint16_t BGCOLOR=0x0001 ; // placeholder
17
+ uint16_t FGCOLOR=0xFFF1 ; // placeholder
18
18
19
19
#ifndef NEMO_VERSION
20
20
#define NEMO_VERSION " dev"
@@ -197,7 +197,8 @@ uint16_t FGCOLOR=0x07E0;
197
197
// 19 - NEMO Portal
198
198
// 20 - Attack menu
199
199
// 21 - Deauth Attack
200
- // 22 - Color Settings
200
+ // 22 - Custom Color Settings
201
+ // 23 - Pre-defined color themes
201
202
// .. - ..
202
203
// 97 - Mount/UnMount SD Card on M5Stick devices, if SDCARD is declared
203
204
@@ -293,7 +294,7 @@ QRCODE qrcodes[] = {
293
294
void drawmenu (MENU thismenu[], int size) {
294
295
DISP.setTextSize (SMALL_TEXT);
295
296
DISP.fillScreen (BGCOLOR);
296
- DISP.setCursor (0 , 0 );
297
+ DISP.setCursor (0 , 0 , 1 );
297
298
// scrolling menu
298
299
if (cursor < 0 ) {
299
300
cursor = size - 1 ; // rollover hack for up-arrow on cardputer
@@ -572,7 +573,7 @@ MENU smenu[] = {
572
573
{ TXT_SDCARD, 97 },
573
574
#endif
574
575
#endif
575
- { TXT_COLOR, 22 },
576
+ { TXT_THEME, 23 },
576
577
{ TXT_ABOUT, 10 },
577
578
{ TXT_REBOOT, 98 },
578
579
#if defined(USE_EEPROM)
@@ -738,6 +739,9 @@ void color_setup() {
738
739
DISP.setCursor (0 , 0 );
739
740
DISP.println (String (TXT_SET_FGCOLOR));
740
741
cursor = 0 ;
742
+ #if defined(USE_EEPROM)
743
+ cursor=EEPROM.read (4 ); // get current fg color
744
+ #endif
741
745
rstOverride = true ;
742
746
delay (1000 );
743
747
drawmenu (cmenu, cmenu_size);
@@ -753,8 +757,10 @@ void color_loop() {
753
757
}
754
758
if (check_select_press ()) {
755
759
#if defined(USE_EEPROM)
760
+ Serial.printf (" EEPROM WRITE (4) FGCOLOR: %d\n " , cursor);
756
761
EEPROM.write (4 , cursor);
757
762
EEPROM.commit ();
763
+ cursor=EEPROM.read (5 ); // get current bg color
758
764
#endif
759
765
DISP.fillScreen (BGCOLOR);
760
766
DISP.setCursor (0 , 0 );
@@ -772,6 +778,7 @@ void color_loop() {
772
778
}
773
779
}
774
780
#if defined(USE_EEPROM)
781
+ Serial.printf (" EEPROM WRITE (5) BGCOLOR: %d\n " , cursor);
775
782
EEPROM.write (5 , cursor);
776
783
EEPROM.commit ();
777
784
#endif
@@ -781,6 +788,118 @@ void color_loop() {
781
788
}
782
789
}
783
790
791
+ MENU thmenu[] = {
792
+ { TXT_BACK, 0 },
793
+ { " Nemo" , 1 },
794
+ { " Tux" , 2 },
795
+ { " Bill" , 3 },
796
+ { " Steve" , 4 },
797
+ { " Lilac" , 5 },
798
+ { " Contrast" , 6 },
799
+ { " NightShift" , 7 },
800
+ { " Camo" , 8 },
801
+ { " BubbleGum" , 9 },
802
+ { TXT_COLOR, 99 },
803
+ };
804
+ int thmenu_size = sizeof (thmenu) / sizeof (MENU);
805
+
806
+ void theme_setup () {
807
+ DISP.fillScreen (BGCOLOR);
808
+ DISP.setCursor (0 , 0 );
809
+ DISP.println (String (TXT_THEME));
810
+ cursor = 0 ;
811
+ rstOverride = true ;
812
+ delay (1000 );
813
+ drawmenu (thmenu, thmenu_size);
814
+ }
815
+
816
+ void theme_loop () {
817
+ if (check_next_press ()) {
818
+ cursor++;
819
+ cursor = cursor % thmenu_size;
820
+ switch (thmenu[cursor].command ){
821
+ case 0 :
822
+ FGCOLOR=11 ;
823
+ BGCOLOR=1 ;
824
+ break ;
825
+ case 1 : // Nemo
826
+ FGCOLOR=11 ;
827
+ BGCOLOR=1 ;
828
+ break ;
829
+ case 2 : // Tux
830
+ FGCOLOR=8 ;
831
+ BGCOLOR=1 ;
832
+ break ;
833
+ case 3 : // Bill
834
+ FGCOLOR=16 ;
835
+ BGCOLOR=10 ;
836
+ break ;
837
+ case 4 : // Steve
838
+ FGCOLOR=1 ;
839
+ BGCOLOR=8 ;
840
+ break ;
841
+ case 5 : // Lilac
842
+ FGCOLOR=19 ;
843
+ BGCOLOR=6 ;
844
+ break ;
845
+ case 6 : // Contrast
846
+ FGCOLOR=16 ;
847
+ BGCOLOR=1 ;
848
+ break ;
849
+ case 7 : // NightShift
850
+ FGCOLOR=5 ;
851
+ BGCOLOR=1 ;
852
+ break ;
853
+ case 8 : // Camo
854
+ FGCOLOR=1 ;
855
+ BGCOLOR=7 ;
856
+ break ;
857
+ case 9 : // BubbleGum
858
+ FGCOLOR=1 ;
859
+ BGCOLOR=19 ;
860
+ break ;
861
+ case 99 :
862
+ FGCOLOR=11 ;
863
+ BGCOLOR=1 ;
864
+ break ;
865
+ }
866
+ setcolor (true , FGCOLOR);
867
+ setcolor (false , BGCOLOR);
868
+ drawmenu (thmenu, thmenu_size);
869
+ delay (250 );
870
+ }
871
+ if (check_select_press ()) {
872
+ switch (thmenu[cursor].command ){
873
+ case 99 :
874
+ rstOverride = false ;
875
+ isSwitching = true ;
876
+ current_proc = 22 ;
877
+ break ;
878
+ case 0 :
879
+ #if defined(USE_EEPROM)
880
+ setcolor (true , EEPROM.read (4 ));
881
+ setcolor (false , EEPROM.read (5 ));
882
+ #endif
883
+ rstOverride = false ;
884
+ isSwitching = true ;
885
+ current_proc = 2 ;
886
+ break ;
887
+ default :
888
+ #if defined(USE_EEPROM)
889
+ Serial.printf (" EEPROM WRITE (4) FGCOLOR: %d\n " , FGCOLOR);
890
+ EEPROM.write (4 , FGCOLOR);
891
+ Serial.printf (" EEPROM WRITE (5) BGCOLOR: %d\n " , BGCOLOR);
892
+ EEPROM.write (5 , BGCOLOR);
893
+ #endif
894
+ rstOverride = false ;
895
+ isSwitching = true ;
896
+ current_proc = 2 ;
897
+ }
898
+ }
899
+ }
900
+
901
+
902
+
784
903
int rotation = 1 ;
785
904
#if defined(ROTATION)
786
905
// / Rotation MENU ///
@@ -2418,6 +2537,9 @@ void loop() {
2418
2537
case 22 :
2419
2538
color_setup ();
2420
2539
break ;
2540
+ case 23 :
2541
+ theme_setup ();
2542
+ break ;
2421
2543
}
2422
2544
}
2423
2545
@@ -2506,6 +2628,9 @@ void loop() {
2506
2628
case 22 :
2507
2629
color_loop ();
2508
2630
break ;
2631
+ case 23 :
2632
+ theme_loop ();
2633
+ break ;
2509
2634
#if defined(SDCARD) // SDCARD M5Stick
2510
2635
#ifndef CARDPUTER // SDCARD M5Stick
2511
2636
case 97 :
0 commit comments