Skip to content

Commit

Permalink
Dial Screen repear
Browse files Browse the repository at this point in the history
  • Loading branch information
AH2005NA committed Jun 20, 2024
1 parent c7268b9 commit c6032b2
Show file tree
Hide file tree
Showing 2 changed files with 84 additions and 4 deletions.
20 changes: 20 additions & 0 deletions localization.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@
#define TXT_SET_MIN "SET MINUTE"
#define TXT_ADV "Advertising:\n"
#define TXT_SP_RND "Swift Pair Random"
#ifdef DIAL
#define TXT_SEL_EXIT2 "Next: Exit"
#else
#define TXT_SEL_EXIT2 "\n\nNext: Exit"
#endif
#define TXT_BT_SPAM "BT Spam"
#define TXT_SA_CRASH "SourApple Crash"
#define TXT_CMB_BT_SPAM " Combined BT Spam"
Expand Down Expand Up @@ -145,7 +149,11 @@
#define TXT_SET_MIN "Minuten waehlen"
#define TXT_ADV "Werbung:\n"
#define TXT_SP_RND "Schnelles Paar zufaellig"
#ifdef DIAL
#define TXT_SEL_EXIT2 "Next: Exit"
#else
#define TXT_SEL_EXIT2 "\n\nNext: Exit"
#endif
#define TXT_BT_SPAM "BT Spam"
#define TXT_SA_CRASH "SourApple Crash"
#define TXT_CMB_BT_SPAM " Kombinierter BT Spam"
Expand Down Expand Up @@ -258,7 +266,11 @@
#define TXT_SET_MIN "AJUSTAR MINUTO"
#define TXT_ADV "Aviso:\n"
#define TXT_SP_RND "Swift Pair Aleatorio"
#ifdef DIAL
#define TXT_SEL_EXIT2 "Prox: Sair"
#else
#define TXT_SEL_EXIT2 "\n\nProx: Sair"
#endif
#define TXT_BT_SPAM "Bluetooth Spam"
#define TXT_SA_CRASH "SourApple Crash"
#define TXT_CMB_BT_SPAM "BT Spam Combinado"
Expand Down Expand Up @@ -372,7 +384,11 @@
#define TXT_SET_MIN "IMPOSTA MINUTI"
#define TXT_ADV "Avviso:\n"
#define TXT_SP_RND "Swift Pair Random"
#ifdef DIAL
#define TXT_SEL_EXIT2 "Prossimo: Esci"
#else
#define TXT_SEL_EXIT2 "\n\nProssimo: Esci"
#endif
#define TXT_BT_SPAM "BT Spam"
#define TXT_SA_CRASH "SourApple Crash"
#define TXT_CMB_BT_SPAM "BT Spam Misto"
Expand Down Expand Up @@ -485,7 +501,11 @@
#define TXT_SET_MIN "REGLER LES MINUTES"
#define TXT_ADV "Notification:\n"
#define TXT_SP_RND "Swift Pair Aleatoire"
#ifdef DIAL
#define TXT_SEL_EXIT2 "Suivant: Quitter"
#else
#define TXT_SEL_EXIT2 "\n\nSuivant: Quitter"
#endif
#define TXT_BT_SPAM "BT Spam"
#define TXT_SA_CRASH "SourApple Crash"
#define TXT_CMB_BT_SPAM " BT Spam Combine"
Expand Down
68 changes: 64 additions & 4 deletions m5stick-shark.ino
Original file line number Diff line number Diff line change
Expand Up @@ -780,7 +780,7 @@ void check_menu_press() {
{ "WiFi", 12 },
{ "QR Codes", 18 },
#ifdef DIAL
{ "RFID", 28 },
//{ "RFID", 28 },
#endif
{ "Modules", 27 },
{ TXT_SETTINGS, 2 },
Expand Down Expand Up @@ -2322,12 +2322,22 @@ void writeCard() {
int option = btmenu[cursor].command;
DISP.fillScreen(BGCOLOR);
DISP.setTextSize(MEDIUM_TEXT);
DISP.setCursor(0, 0);
#ifdef DIAL
DISP.setCursor(0, 50);
DISP.setTextColor(BGCOLOR, FGCOLOR);
DISP.printf(" %-10s\n", TXT_BT_SPAM);
DISP.setTextColor(FGCOLOR, BGCOLOR);
DISP.setTextSize(SMALL_TEXT);
DISP.setCursor((240 - DISP.textWidth(TXT_ADV))/2, 80);
DISP.print(TXT_ADV);
#else
DISP.setCursor(0, 50);
DISP.setTextColor(BGCOLOR, FGCOLOR);
DISP.printf(" %-12s\n", TXT_BT_SPAM);
DISP.setTextColor(FGCOLOR, BGCOLOR);
DISP.setTextSize(SMALL_TEXT);
DISP.print(TXT_ADV);
#endif

switch (option) {
case 0:
Expand All @@ -2341,31 +2351,58 @@ void writeCard() {
current_proc = 9; // jump straight to appleJuice Advertisement
rstOverride = false;
isSwitching = true;
#ifdef DIAL
DISP.setCursor((240 - DISP.textWidth(TXT_SP_RND))/2, 100);
#endif
DISP.print(TXT_SP_RND);
#ifdef DIAL
DISP.setCursor((240 - DISP.textWidth(TXT_SEL_EXIT2))/2, 130);
#endif
DISP.print(TXT_SEL_EXIT2);
break;
case 2:
sourApple = true;
current_proc = 9; // jump straight to appleJuice Advertisement
rstOverride = false;
isSwitching = true;
#ifdef DIAL
DISP.setCursor((240 - DISP.textWidth(TXT_SA_CRASH))/2, 100);
#endif
DISP.print(TXT_SA_CRASH);
#ifdef DIAL
DISP.setCursor((240 - DISP.textWidth(TXT_SEL_EXIT2))/2, 120);
#endif
DISP.print(TXT_SEL_EXIT2);
break;
case 3:
rstOverride = false;
isSwitching = true;
current_proc = 17; // Maelstrom
#ifdef DIAL
DISP.setCursor((240 - DISP.textWidth("Bluetooth Maelstrom"))/2, 100);
#endif
DISP.print("Bluetooth Maelstrom\n");
#ifdef DIAL
DISP.setCursor((240 - DISP.textWidth(TXT_CMB_BT_SPAM))/2, 120);
#endif
DISP.print(TXT_CMB_BT_SPAM);
#ifdef DIAL
DISP.setCursor((240 - DISP.textWidth(TXT_SEL_EXIT2))/2, 140);
#endif
DISP.print(TXT_SEL_EXIT2);
break;
case 4:
androidPair = true;
current_proc = 9; // jump straight to appleJuice Advertisement
rstOverride = false;
isSwitching = true;
#ifdef DIAL
DISP.setCursor((240 - DISP.textWidth(TXT_AD_SPAM))/2, 100);
#endif
DISP.print(TXT_AD_SPAM);
#ifdef DIAL
DISP.setCursor((240 - DISP.textWidth(TXT_SEL_EXIT2))/2, 120);
#endif
DISP.print(TXT_SEL_EXIT2);
break;

Expand Down Expand Up @@ -2416,9 +2453,14 @@ void writeCard() {
void aj_setup() {
DISP.fillScreen(BGCOLOR);
DISP.setTextSize(MEDIUM_TEXT);
DISP.setCursor(0, 0);
DISP.setTextColor(BGCOLOR, FGCOLOR);
#ifdef DIAL
DISP.setCursor(0, 50);
DISP.println(" AppleJuice ");
#else
DISP.setCursor(0, 0);
DISP.println(" AppleJuice ");
#endif
DISP.setTextColor(FGCOLOR, BGCOLOR);
delay(1000);
cursor = 0;
Expand Down Expand Up @@ -2540,13 +2582,27 @@ void writeCard() {
if (current_proc == 8 && isSwitching == false) {
DISP.fillScreen(BGCOLOR);
DISP.setTextSize(MEDIUM_TEXT);
DISP.setCursor(0, 0);
DISP.setTextColor(BGCOLOR, FGCOLOR);
#ifdef DIAL
DISP.setCursor(0, 50);
DISP.println(" AppleJuice ");
#else
DISP.setCursor(0, 0);
DISP.println(" AppleJuice ");
#endif
DISP.setTextColor(FGCOLOR, BGCOLOR);
DISP.setTextSize(SMALL_TEXT);
#ifdef DIAL
DISP.setCursor((240 - DISP.textWidth(TXT_ADV))/2, 100);
#endif
DISP.print(TXT_ADV);
#ifdef DIAL
DISP.setCursor((240 - DISP.textWidth(ajmenu[cursor].name))/2, 120);
#endif
DISP.print(ajmenu[cursor].name);
#ifdef DIAL
DISP.setCursor((240 - DISP.textWidth(TXT_SEL_EXIT2))/2, 140);
#endif
DISP.print(TXT_SEL_EXIT2);
isSwitching = true;
current_proc = 9; // Jump over to the AppleJuice BLE beacon loop
Expand Down Expand Up @@ -3321,7 +3377,11 @@ void writeCard() {
} else if (activeQR == false) {
activeQR = true;
DISP.fillScreen(WHITE);
#ifdef DIAL
DISP.qrcode(qrcodes[cursor].url, 28, 28, 184, 5);
#else
DISP.qrcode(qrcodes[cursor].url, (DISP.width() - DISP.height()) / 2, 0, DISP.height(), 5);
#endif
delay(500);
} else {
isSwitching = true;
Expand Down

0 comments on commit c6032b2

Please sign in to comment.