Clean menu transition for minis

This commit is contained in:
Just Call Me Koko
2025-10-06 14:47:10 -04:00
parent e5f2466c41
commit 72951397d8
3 changed files with 151 additions and 147 deletions

View File

@@ -410,6 +410,9 @@ void Display::clearScreen()
#ifndef MARAUDER_V7 #ifndef MARAUDER_V7
tft.fillScreen(TFT_BLACK); tft.fillScreen(TFT_BLACK);
tft.setCursor(0, 0); tft.setCursor(0, 0);
#elif defined(MARAUDER_MINI)
tft.fillRect(0, 0, TFT_WIDTH, TFT_HEIGHT, TFT_BLACK);
tft.setCursor(0, 0);
#else #else
tft.fillRect(0, 0, TFT_WIDTH, TFT_HEIGHT, TFT_BLACK); tft.fillRect(0, 0, TFT_WIDTH, TFT_HEIGHT, TFT_BLACK);
tft.setCursor(0, 0); tft.setCursor(0, 0);

View File

@@ -1517,11 +1517,11 @@ void MenuFunctions::updateStatusBar()
if ((current_channel != wifi_scan_obj.old_channel) || (status_changed)) { if ((current_channel != wifi_scan_obj.old_channel) || (status_changed)) {
wifi_scan_obj.old_channel = current_channel; wifi_scan_obj.old_channel = current_channel;
//#if defined(MARAUDER_MINI) || defined(MARAUDER_M5STICKC) || defined(MARAUDER_REV_FEATHER) || defined(MARAUDER_CARDPUTER) #if defined(MARAUDER_MINI) || defined(MARAUDER_M5STICKC) || defined(MARAUDER_REV_FEATHER) || defined(MARAUDER_CARDPUTER)
// display_obj.tft.fillRect(43, 0, CHAR_WIDTH * 6, STATUS_BAR_WIDTH, STATUSBAR_COLOR); display_obj.tft.fillRect(TFT_WIDTH/4, 0, CHAR_WIDTH * 6, STATUS_BAR_WIDTH, STATUSBAR_COLOR);
//#else #else
// display_obj.tft.fillRect(50, 0, (CHAR_WIDTH / 2) * 6, STATUS_BAR_WIDTH, STATUSBAR_COLOR); display_obj.tft.fillRect(50, 0, (CHAR_WIDTH / 2) * 7, STATUS_BAR_WIDTH, STATUSBAR_COLOR);
//#endif #endif
#ifdef HAS_FULL_SCREEN #ifdef HAS_FULL_SCREEN
display_obj.tft.drawString("CH: " + (String)wifi_scan_obj.old_channel, 50, 0, 2); display_obj.tft.drawString("CH: " + (String)wifi_scan_obj.old_channel, 50, 0, 2);
#endif #endif
@@ -2094,18 +2094,18 @@ void MenuFunctions::RunSetup()
// Build Main Menu // Build Main Menu
mainMenu.parentMenu = NULL; mainMenu.parentMenu = NULL;
this->addNodes(&mainMenu, text_table1[7], TFTGREEN, NULL, WIFI, [this]() { this->addNodes(&mainMenu, text_table1[7], TFTGREEN, NULL, WIFI, [this]() {
this->changeMenu(&wifiMenu); this->changeMenu(&wifiMenu, true);
}); });
this->addNodes(&mainMenu, text_table1[19], TFTCYAN, NULL, BLUETOOTH, [this]() { this->addNodes(&mainMenu, text_table1[19], TFTCYAN, NULL, BLUETOOTH, [this]() {
this->changeMenu(&bluetoothMenu); this->changeMenu(&bluetoothMenu, true);
}); });
#ifdef HAS_GPS #ifdef HAS_GPS
this->addNodes(&mainMenu, text1_66, TFTRED, NULL, GPS_MENU, [this]() { this->addNodes(&mainMenu, text1_66, TFTRED, NULL, GPS_MENU, [this]() {
this->changeMenu(&gpsMenu); this->changeMenu(&gpsMenu, true);
}); });
#endif #endif
this->addNodes(&mainMenu, text_table1[9], TFTBLUE, NULL, DEVICE, [this]() { this->addNodes(&mainMenu, text_table1[9], TFTBLUE, NULL, DEVICE, [this]() {
this->changeMenu(&deviceMenu); this->changeMenu(&deviceMenu, true);
}); });
this->addNodes(&mainMenu, text_table1[30], TFTLIGHTGREY, NULL, REBOOT, []() { this->addNodes(&mainMenu, text_table1[30], TFTLIGHTGREY, NULL, REBOOT, []() {
ESP.restart(); ESP.restart();
@@ -2114,30 +2114,30 @@ void MenuFunctions::RunSetup()
// Build WiFi Menu // Build WiFi Menu
wifiMenu.parentMenu = &mainMenu; // Main Menu is second menu parent wifiMenu.parentMenu = &mainMenu; // Main Menu is second menu parent
this->addNodes(&wifiMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() { this->addNodes(&wifiMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() {
this->changeMenu(wifiMenu.parentMenu); this->changeMenu(wifiMenu.parentMenu, true);
}); });
this->addNodes(&wifiMenu, text_table1[31], TFTYELLOW, NULL, SNIFFERS, [this]() { this->addNodes(&wifiMenu, text_table1[31], TFTYELLOW, NULL, SNIFFERS, [this]() {
this->changeMenu(&wifiSnifferMenu); this->changeMenu(&wifiSnifferMenu, true);
}); });
this->addNodes(&wifiMenu, "Scanners", TFTORANGE, NULL, SCANNERS, [this]() { this->addNodes(&wifiMenu, "Scanners", TFTORANGE, NULL, SCANNERS, [this]() {
this->changeMenu(&wifiScannerMenu); this->changeMenu(&wifiScannerMenu, true);
}); });
#ifdef HAS_GPS #ifdef HAS_GPS
this->addNodes(&wifiMenu, "Wardriving", TFTGREEN, NULL, BEACON_SNIFF, [this]() { this->addNodes(&wifiMenu, "Wardriving", TFTGREEN, NULL, BEACON_SNIFF, [this]() {
this->changeMenu(&wardrivingMenu); this->changeMenu(&wardrivingMenu, true);
}); });
#endif #endif
this->addNodes(&wifiMenu, text_table1[32], TFTRED, NULL, ATTACKS, [this]() { this->addNodes(&wifiMenu, text_table1[32], TFTRED, NULL, ATTACKS, [this]() {
this->changeMenu(&wifiAttackMenu); this->changeMenu(&wifiAttackMenu, true);
}); });
this->addNodes(&wifiMenu, text_table1[33], TFTPURPLE, NULL, GENERAL_APPS, [this]() { this->addNodes(&wifiMenu, text_table1[33], TFTPURPLE, NULL, GENERAL_APPS, [this]() {
this->changeMenu(&wifiGeneralMenu); this->changeMenu(&wifiGeneralMenu, true);
}); });
// Build WiFi scanner Menu // Build WiFi scanner Menu
wifiScannerMenu.parentMenu = &wifiMenu; // Main Menu is second menu parent wifiScannerMenu.parentMenu = &wifiMenu; // Main Menu is second menu parent
this->addNodes(&wifiScannerMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() { this->addNodes(&wifiScannerMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() {
this->changeMenu(wifiScannerMenu.parentMenu); this->changeMenu(wifiScannerMenu.parentMenu, true);
}); });
this->addNodes(&wifiScannerMenu, "Ping Scan", TFTGREEN, NULL, SCANNERS, [this]() { this->addNodes(&wifiScannerMenu, "Ping Scan", TFTGREEN, NULL, SCANNERS, [this]() {
display_obj.clearScreen(); display_obj.clearScreen();
@@ -2153,7 +2153,7 @@ void MenuFunctions::RunSetup()
// Add the back button // Add the back button
wifiIPMenu.list->clear(); wifiIPMenu.list->clear();
this->addNodes(&wifiIPMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() { this->addNodes(&wifiIPMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() {
this->changeMenu(wifiIPMenu.parentMenu); this->changeMenu(wifiIPMenu.parentMenu, true);
}); });
// Populate the menu with buttons // Populate the menu with buttons
@@ -2167,7 +2167,7 @@ void MenuFunctions::RunSetup()
wifi_scan_obj.StartScan(WIFI_PORT_SCAN_ALL, TFT_BLUE); wifi_scan_obj.StartScan(WIFI_PORT_SCAN_ALL, TFT_BLUE);
}); });
} }
this->changeMenu(&wifiIPMenu); this->changeMenu(&wifiIPMenu, true);
}); });
this->addNodes(&wifiScannerMenu, "SSH Scan", TFTORANGE, NULL, SCANNERS, [this]() { this->addNodes(&wifiScannerMenu, "SSH Scan", TFTORANGE, NULL, SCANNERS, [this]() {
display_obj.clearScreen(); display_obj.clearScreen();
@@ -2208,7 +2208,7 @@ void MenuFunctions::RunSetup()
// Build WiFi sniffer Menu // Build WiFi sniffer Menu
wifiSnifferMenu.parentMenu = &wifiMenu; // Main Menu is second menu parent wifiSnifferMenu.parentMenu = &wifiMenu; // Main Menu is second menu parent
this->addNodes(&wifiSnifferMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() { this->addNodes(&wifiSnifferMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() {
this->changeMenu(wifiSnifferMenu.parentMenu); this->changeMenu(wifiSnifferMenu.parentMenu, true);
}); });
this->addNodes(&wifiSnifferMenu, text_table1[42], TFTCYAN, NULL, PROBE_SNIFF, [this]() { this->addNodes(&wifiSnifferMenu, text_table1[42], TFTCYAN, NULL, PROBE_SNIFF, [this]() {
display_obj.clearScreen(); display_obj.clearScreen();
@@ -2317,7 +2317,7 @@ void MenuFunctions::RunSetup()
#ifdef HAS_GPS #ifdef HAS_GPS
wardrivingMenu.parentMenu = &wifiMenu; // Main Menu is second menu parent wardrivingMenu.parentMenu = &wifiMenu; // Main Menu is second menu parent
this->addNodes(&wardrivingMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() { this->addNodes(&wardrivingMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() {
this->changeMenu(wardrivingMenu.parentMenu); this->changeMenu(wardrivingMenu.parentMenu, true);
}); });
if (gps_obj.getGpsModuleStatus()) { if (gps_obj.getGpsModuleStatus()) {
this->addNodes(&wardrivingMenu, "Wardrive", TFTGREEN, NULL, BEACON_SNIFF, [this]() { this->addNodes(&wardrivingMenu, "Wardrive", TFTGREEN, NULL, BEACON_SNIFF, [this]() {
@@ -2340,7 +2340,7 @@ void MenuFunctions::RunSetup()
// Build WiFi attack menu // Build WiFi attack menu
wifiAttackMenu.parentMenu = &wifiMenu; // Main Menu is second menu parent wifiAttackMenu.parentMenu = &wifiMenu; // Main Menu is second menu parent
this->addNodes(&wifiAttackMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() { this->addNodes(&wifiAttackMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() {
this->changeMenu(wifiAttackMenu.parentMenu); this->changeMenu(wifiAttackMenu.parentMenu, true);
}); });
this->addNodes(&wifiAttackMenu, text_table1[50], TFTRED, NULL, BEACON_LIST, [this]() { this->addNodes(&wifiAttackMenu, text_table1[50], TFTRED, NULL, BEACON_LIST, [this]() {
display_obj.clearScreen(); display_obj.clearScreen();
@@ -2382,10 +2382,10 @@ void MenuFunctions::RunSetup()
ssidsMenu.parentMenu = &evilPortalMenu; ssidsMenu.parentMenu = &evilPortalMenu;
this->addNodes(&wifiAPMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() { this->addNodes(&wifiAPMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() {
this->changeMenu(wifiAPMenu.parentMenu); this->changeMenu(wifiAPMenu.parentMenu, true);
}); });
this->addNodes(&ssidsMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() { this->addNodes(&ssidsMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() {
this->changeMenu(ssidsMenu.parentMenu); this->changeMenu(ssidsMenu.parentMenu, true);
}); });
// Get AP list ready // Get AP list ready
@@ -2405,7 +2405,7 @@ void MenuFunctions::RunSetup()
wifi_scan_obj.setMac(); wifi_scan_obj.setMac();
} }
else else
this->changeMenu(&evilPortalMenu); this->changeMenu(&evilPortalMenu, true);
}); });
} }
@@ -2419,10 +2419,10 @@ void MenuFunctions::RunSetup()
wifi_scan_obj.setMac(); wifi_scan_obj.setMac();
} }
else else
this->changeMenu(&evilPortalMenu); this->changeMenu(&evilPortalMenu, true);
}); });
} }
this->changeMenu(&evilPortalMenu); this->changeMenu(&evilPortalMenu, true);
}); });
this->addNodes(&wifiAttackMenu, text_table1[54], TFTRED, NULL, DEAUTH_SNIFF, [this]() { this->addNodes(&wifiAttackMenu, text_table1[54], TFTRED, NULL, DEAUTH_SNIFF, [this]() {
display_obj.clearScreen(); display_obj.clearScreen();
@@ -2444,7 +2444,7 @@ void MenuFunctions::RunSetup()
// Add the back button // Add the back button
selectProbeSSIDsMenu.list->clear(); selectProbeSSIDsMenu.list->clear();
this->addNodes(&selectProbeSSIDsMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() { this->addNodes(&selectProbeSSIDsMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() {
this->changeMenu(&wifiAttackMenu); this->changeMenu(&wifiAttackMenu, true);
}); });
// Populate the menu with buttons // Populate the menu with buttons
@@ -2458,10 +2458,10 @@ void MenuFunctions::RunSetup()
wifi_scan_obj.setMac(); wifi_scan_obj.setMac();
} }
else else
this->changeMenu(&wifiAttackMenu); this->changeMenu(&wifiAttackMenu, true);
}); });
} }
this->changeMenu(&selectProbeSSIDsMenu); this->changeMenu(&selectProbeSSIDsMenu, true);
}); });
this->addNodes(&wifiAttackMenu, "Bad Msg", TFTRED, NULL, DEAUTH_SNIFF, [this]() { this->addNodes(&wifiAttackMenu, "Bad Msg", TFTRED, NULL, DEAUTH_SNIFF, [this]() {
@@ -2487,22 +2487,22 @@ void MenuFunctions::RunSetup()
evilPortalMenu.parentMenu = &wifiAttackMenu; evilPortalMenu.parentMenu = &wifiAttackMenu;
this->addNodes(&evilPortalMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() { this->addNodes(&evilPortalMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() {
this->changeMenu(evilPortalMenu.parentMenu); this->changeMenu(evilPortalMenu.parentMenu, true);
}); });
this->addNodes(&evilPortalMenu, "Access Points", TFTGREEN, NULL, BEACON_SNIFF, [this]() { this->addNodes(&evilPortalMenu, "Access Points", TFTGREEN, NULL, BEACON_SNIFF, [this]() {
this->changeMenu(&wifiAPMenu); this->changeMenu(&wifiAPMenu, true);
}); });
this->addNodes(&evilPortalMenu, "User SSIDs", TFTCYAN, NULL, PROBE_SNIFF, [this]() { this->addNodes(&evilPortalMenu, "User SSIDs", TFTCYAN, NULL, PROBE_SNIFF, [this]() {
this->changeMenu(&ssidsMenu); this->changeMenu(&ssidsMenu, true);
}); });
// Build WiFi General menu // Build WiFi General menu
wifiGeneralMenu.parentMenu = &wifiMenu; wifiGeneralMenu.parentMenu = &wifiMenu;
this->addNodes(&wifiGeneralMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() { this->addNodes(&wifiGeneralMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() {
this->changeMenu(wifiGeneralMenu.parentMenu); this->changeMenu(wifiGeneralMenu.parentMenu, true);
}); });
this->addNodes(&wifiGeneralMenu, text_table1[27], TFTSKYBLUE, NULL, GENERATE, [this]() { this->addNodes(&wifiGeneralMenu, text_table1[27], TFTSKYBLUE, NULL, GENERATE, [this]() {
this->changeMenu(&generateSSIDsMenu); this->changeMenu(&generateSSIDsMenu, true);
wifi_scan_obj.RunGenerateSSIDs(); wifi_scan_obj.RunGenerateSSIDs();
}); });
@@ -2512,7 +2512,7 @@ void MenuFunctions::RunSetup()
// Add the back button // Add the back button
this->addNodes(&selectProbeSSIDsMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() { this->addNodes(&selectProbeSSIDsMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() {
this->changeMenu(&wifiGeneralMenu); this->changeMenu(&wifiGeneralMenu, true);
// TODO: TBD - Should probe_req_ssids have it´s own life and override ap.config and/or ssids -list for EP? // TODO: TBD - Should probe_req_ssids have it´s own life and override ap.config and/or ssids -list for EP?
// If so, then we should not add selected ssids to ssids list // If so, then we should not add selected ssids to ssids list
@@ -2563,7 +2563,7 @@ void MenuFunctions::RunSetup()
}, },
probe_req_ssids->get(i).selected); probe_req_ssids->get(i).selected);
} }
this->changeMenu(&selectProbeSSIDsMenu); this->changeMenu(&selectProbeSSIDsMenu, true);
}); });
clearSSIDsMenu.parentMenu = &wifiGeneralMenu; clearSSIDsMenu.parentMenu = &wifiGeneralMenu;
@@ -2577,20 +2577,20 @@ void MenuFunctions::RunSetup()
#endif #endif
#if (!defined(HAS_ILI9341) && defined(HAS_BUTTONS)) #if (!defined(HAS_ILI9341) && defined(HAS_BUTTONS))
this->addNodes(&wifiGeneralMenu, text_table1[1], TFTNAVY, NULL, KEYBOARD_ICO, [this](){ this->addNodes(&wifiGeneralMenu, text_table1[1], TFTNAVY, NULL, KEYBOARD_ICO, [this](){
this->changeMenu(&miniKbMenu); this->changeMenu(&miniKbMenu, true);
this->miniKeyboard(&miniKbMenu); this->miniKeyboard(&miniKbMenu);
}); });
#endif #endif
this->addNodes(&wifiGeneralMenu, text_table1[28], TFTSILVER, NULL, CLEAR_ICO, [this]() { this->addNodes(&wifiGeneralMenu, text_table1[28], TFTSILVER, NULL, CLEAR_ICO, [this]() {
this->changeMenu(&clearSSIDsMenu); this->changeMenu(&clearSSIDsMenu, true);
wifi_scan_obj.RunClearSSIDs(); wifi_scan_obj.RunClearSSIDs();
}); });
this->addNodes(&wifiGeneralMenu, text_table1[29], TFTDARKGREY, NULL, CLEAR_ICO, [this]() { this->addNodes(&wifiGeneralMenu, text_table1[29], TFTDARKGREY, NULL, CLEAR_ICO, [this]() {
this->changeMenu(&clearAPsMenu); this->changeMenu(&clearAPsMenu, true);
wifi_scan_obj.RunClearAPs(); wifi_scan_obj.RunClearAPs();
}); });
this->addNodes(&wifiGeneralMenu, text_table1[60], TFTBLUE, NULL, CLEAR_ICO, [this]() { this->addNodes(&wifiGeneralMenu, text_table1[60], TFTBLUE, NULL, CLEAR_ICO, [this]() {
this->changeMenu(&clearAPsMenu); this->changeMenu(&clearAPsMenu, true);
wifi_scan_obj.RunClearStations(); wifi_scan_obj.RunClearStations();
}); });
//#else // Mini EP HTML select //#else // Mini EP HTML select
@@ -2598,7 +2598,7 @@ void MenuFunctions::RunSetup()
// Add the back button // Add the back button
htmlMenu.list->clear(); htmlMenu.list->clear();
this->addNodes(&htmlMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() { this->addNodes(&htmlMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() {
this->changeMenu(htmlMenu.parentMenu); this->changeMenu(htmlMenu.parentMenu, true);
}); });
// Populate the menu with buttons // Populate the menu with buttons
@@ -2609,25 +2609,25 @@ void MenuFunctions::RunSetup()
evil_portal_obj.target_html_name = evil_portal_obj.html_files->get(evil_portal_obj.selected_html_index); evil_portal_obj.target_html_name = evil_portal_obj.html_files->get(evil_portal_obj.selected_html_index);
Serial.println("Set Evil Portal HTML as " + evil_portal_obj.target_html_name); Serial.println("Set Evil Portal HTML as " + evil_portal_obj.target_html_name);
evil_portal_obj.using_serial_html = false; evil_portal_obj.using_serial_html = false;
this->changeMenu(htmlMenu.parentMenu); this->changeMenu(htmlMenu.parentMenu, true);
return; return;
}); });
} }
this->changeMenu(&htmlMenu); this->changeMenu(&htmlMenu, true);
}); });
//#if (!defined(HAS_ILI9341) && defined(HAS_BUTTONS)) //#if (!defined(HAS_ILI9341) && defined(HAS_BUTTONS))
miniKbMenu.parentMenu = &wifiGeneralMenu; miniKbMenu.parentMenu = &wifiGeneralMenu;
#ifndef MARAUDER_CARDPUTER #ifndef MARAUDER_CARDPUTER
this->addNodes(&miniKbMenu, "a", TFTCYAN, NULL, 0, [this]() { this->addNodes(&miniKbMenu, "a", TFTCYAN, NULL, 0, [this]() {
this->changeMenu(miniKbMenu.parentMenu); this->changeMenu(miniKbMenu.parentMenu, true);
}); });
#endif #endif
//#endif //#endif
htmlMenu.parentMenu = &wifiGeneralMenu; htmlMenu.parentMenu = &wifiGeneralMenu;
this->addNodes(&htmlMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() { this->addNodes(&htmlMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() {
this->changeMenu(htmlMenu.parentMenu); this->changeMenu(htmlMenu.parentMenu, true);
}); });
// Select APs on Mini // Select APs on Mini
@@ -2636,7 +2636,7 @@ void MenuFunctions::RunSetup()
// Add the back button // Add the back button
wifiAPMenu.list->clear(); wifiAPMenu.list->clear();
this->addNodes(&wifiAPMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() { this->addNodes(&wifiAPMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() {
this->changeMenu(wifiAPMenu.parentMenu); this->changeMenu(wifiAPMenu.parentMenu, true);
}); });
this->addNodes(&wifiAPMenu, "Select ALL", TFTGREEN, NULL, 255, [this](){ this->addNodes(&wifiAPMenu, "Select ALL", TFTGREEN, NULL, 255, [this](){
@@ -2651,7 +2651,7 @@ void MenuFunctions::RunSetup()
current_menu->list->set(x + 2, new_node); current_menu->list->set(x + 2, new_node);
} }
this->changeMenu(current_menu); this->changeMenu(current_menu, true);
}); });
@@ -2670,40 +2670,40 @@ void MenuFunctions::RunSetup()
access_points->set(i, new_ap); access_points->set(i, new_ap);
}, access_points->get(i).selected); }, access_points->get(i).selected);
} }
this->changeMenu(&wifiAPMenu); this->changeMenu(&wifiAPMenu, true);
}); });
this->addNodes(&wifiGeneralMenu, "View AP Info", TFTCYAN, NULL, KEYBOARD_ICO, [this](){ this->addNodes(&wifiGeneralMenu, "View AP Info", TFTCYAN, NULL, KEYBOARD_ICO, [this](){
// Add the back button // Add the back button
wifiAPMenu.list->clear(); wifiAPMenu.list->clear();
this->addNodes(&wifiAPMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() { this->addNodes(&wifiAPMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() {
this->changeMenu(wifiAPMenu.parentMenu); this->changeMenu(wifiAPMenu.parentMenu, true);
}); });
// Populate the menu with buttons // Populate the menu with buttons
for (int i = 0; i < access_points->size(); i++) { for (int i = 0; i < access_points->size(); i++) {
// This is the menu node // This is the menu node
this->addNodes(&wifiAPMenu, access_points->get(i).essid, TFTCYAN, NULL, 255, [this, i](){ this->addNodes(&wifiAPMenu, access_points->get(i).essid, TFTCYAN, NULL, 255, [this, i](){
this->changeMenu(&apInfoMenu); this->changeMenu(&apInfoMenu, true);
wifi_scan_obj.RunAPInfo(i); wifi_scan_obj.RunAPInfo(i);
}); });
} }
this->changeMenu(&wifiAPMenu); this->changeMenu(&wifiAPMenu, true);
}); });
apInfoMenu.parentMenu = &wifiAPMenu; apInfoMenu.parentMenu = &wifiAPMenu;
this->addNodes(&apInfoMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() { this->addNodes(&apInfoMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() {
this->changeMenu(apInfoMenu.parentMenu); this->changeMenu(apInfoMenu.parentMenu, true);
}); });
wifiAPMenu.parentMenu = &wifiGeneralMenu; wifiAPMenu.parentMenu = &wifiGeneralMenu;
this->addNodes(&wifiAPMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() { this->addNodes(&wifiAPMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() {
this->changeMenu(wifiAPMenu.parentMenu); this->changeMenu(wifiAPMenu.parentMenu, true);
}); });
wifiIPMenu.parentMenu = &wifiScannerMenu; wifiIPMenu.parentMenu = &wifiScannerMenu;
this->addNodes(&wifiIPMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() { this->addNodes(&wifiIPMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() {
this->changeMenu(wifiIPMenu.parentMenu); this->changeMenu(wifiIPMenu.parentMenu, true);
}); });
@@ -2711,7 +2711,7 @@ void MenuFunctions::RunSetup()
this->addNodes(&wifiGeneralMenu, "Select Stations", TFTCYAN, NULL, KEYBOARD_ICO, [this](){ this->addNodes(&wifiGeneralMenu, "Select Stations", TFTCYAN, NULL, KEYBOARD_ICO, [this](){
wifiAPMenu.list->clear(); wifiAPMenu.list->clear();
this->addNodes(&wifiAPMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() { this->addNodes(&wifiAPMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() {
this->changeMenu(wifiAPMenu.parentMenu); this->changeMenu(wifiAPMenu.parentMenu, true);
}); });
int menu_limit = access_points->size(); int menu_limit = access_points->size();
@@ -2725,7 +2725,7 @@ void MenuFunctions::RunSetup()
// Add back button to the APs // Add back button to the APs
this->addNodes(&wifiStationMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() { this->addNodes(&wifiStationMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() {
this->changeMenu(wifiStationMenu.parentMenu); this->changeMenu(wifiStationMenu.parentMenu, true);
}); });
this->addNodes(&wifiStationMenu, "Select ALL", TFTGREEN, NULL, 255, [this, i](){ this->addNodes(&wifiStationMenu, "Select ALL", TFTGREEN, NULL, 255, [this, i](){
@@ -2743,7 +2743,7 @@ void MenuFunctions::RunSetup()
stations->set(cur_ap_sta_inx, new_sta); stations->set(cur_ap_sta_inx, new_sta);
} }
this->changeMenu(current_menu); this->changeMenu(current_menu, true);
}); });
@@ -2765,18 +2765,18 @@ void MenuFunctions::RunSetup()
} }
// Final change menu to the menu of Stations // Final change menu to the menu of Stations
this->changeMenu(&wifiStationMenu); this->changeMenu(&wifiStationMenu, true);
}, false); }, false);
} }
this->changeMenu(&wifiAPMenu); this->changeMenu(&wifiAPMenu, true);
}); });
this->addNodes(&wifiGeneralMenu, "Join WiFi", TFTWHITE, NULL, KEYBOARD_ICO, [this](){ this->addNodes(&wifiGeneralMenu, "Join WiFi", TFTWHITE, NULL, KEYBOARD_ICO, [this](){
// Add the back button // Add the back button
wifiAPMenu.list->clear(); wifiAPMenu.list->clear();
this->addNodes(&wifiAPMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() { this->addNodes(&wifiAPMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() {
this->changeMenu(wifiAPMenu.parentMenu); this->changeMenu(wifiAPMenu.parentMenu, true);
}); });
// Populate the menu with buttons // Populate the menu with buttons
@@ -2785,14 +2785,14 @@ void MenuFunctions::RunSetup()
this->addNodes(&wifiAPMenu, access_points->get(i).essid, TFTCYAN, NULL, 255, [this, i](){ this->addNodes(&wifiAPMenu, access_points->get(i).essid, TFTCYAN, NULL, 255, [this, i](){
// Join WiFi using mini keyboard // Join WiFi using mini keyboard
#ifdef HAS_MINI_KB #ifdef HAS_MINI_KB
this->changeMenu(&miniKbMenu); this->changeMenu(&miniKbMenu, true);
String password = this->miniKeyboard(&miniKbMenu, true); String password = this->miniKeyboard(&miniKbMenu, true);
if (password != "") { if (password != "") {
Serial.println("Using SSID: " + (String)access_points->get(i).essid + " Password: " + (String)password); Serial.println("Using SSID: " + (String)access_points->get(i).essid + " Password: " + (String)password);
wifi_scan_obj.currentScanMode = LV_JOIN_WIFI; wifi_scan_obj.currentScanMode = LV_JOIN_WIFI;
wifi_scan_obj.StartScan(LV_JOIN_WIFI, TFT_YELLOW); wifi_scan_obj.StartScan(LV_JOIN_WIFI, TFT_YELLOW);
wifi_scan_obj.joinWiFi(access_points->get(i).essid, password); wifi_scan_obj.joinWiFi(access_points->get(i).essid, password);
this->changeMenu(current_menu); this->changeMenu(current_menu, true);
} }
#endif #endif
@@ -2804,7 +2804,7 @@ void MenuFunctions::RunSetup()
#endif #endif
}); });
} }
this->changeMenu(&wifiAPMenu); this->changeMenu(&wifiAPMenu, true);
}); });
this->addNodes(&wifiGeneralMenu, "Join Saved WiFi", TFTWHITE, NULL, KEYBOARD_ICO, [this](){ this->addNodes(&wifiGeneralMenu, "Join Saved WiFi", TFTWHITE, NULL, KEYBOARD_ICO, [this](){
@@ -2813,13 +2813,13 @@ void MenuFunctions::RunSetup()
if ((ssid != "") && (pw != "")) { if ((ssid != "") && (pw != "")) {
wifi_scan_obj.joinWiFi(ssid, pw, false); wifi_scan_obj.joinWiFi(ssid, pw, false);
this->changeMenu(&wifiGeneralMenu); this->changeMenu(&wifiGeneralMenu, true);
} }
else { else {
// Add the back button // Add the back button
wifiAPMenu.list->clear(); wifiAPMenu.list->clear();
this->addNodes(&wifiAPMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() { this->addNodes(&wifiAPMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() {
this->changeMenu(wifiAPMenu.parentMenu); this->changeMenu(wifiAPMenu.parentMenu, true);
}); });
// Populate the menu with buttons // Populate the menu with buttons
@@ -2828,14 +2828,14 @@ void MenuFunctions::RunSetup()
this->addNodes(&wifiAPMenu, access_points->get(i).essid, TFTCYAN, NULL, 255, [this, i](){ this->addNodes(&wifiAPMenu, access_points->get(i).essid, TFTCYAN, NULL, 255, [this, i](){
// Join WiFi using mini keyboard // Join WiFi using mini keyboard
#ifdef HAS_MINI_KB #ifdef HAS_MINI_KB
this->changeMenu(&miniKbMenu); this->changeMenu(&miniKbMenu, true);
String password = this->miniKeyboard(&miniKbMenu, true); String password = this->miniKeyboard(&miniKbMenu, true);
if (password != "") { if (password != "") {
Serial.println("Using SSID: " + (String)access_points->get(i).essid + " Password: " + (String)password); Serial.println("Using SSID: " + (String)access_points->get(i).essid + " Password: " + (String)password);
wifi_scan_obj.currentScanMode = LV_JOIN_WIFI; wifi_scan_obj.currentScanMode = LV_JOIN_WIFI;
wifi_scan_obj.StartScan(LV_JOIN_WIFI, TFT_YELLOW); wifi_scan_obj.StartScan(LV_JOIN_WIFI, TFT_YELLOW);
wifi_scan_obj.joinWiFi(access_points->get(i).essid, password); wifi_scan_obj.joinWiFi(access_points->get(i).essid, password);
this->changeMenu(current_menu); this->changeMenu(current_menu, true);
} }
#endif #endif
@@ -2847,7 +2847,7 @@ void MenuFunctions::RunSetup()
#endif #endif
}); });
} }
this->changeMenu(&wifiAPMenu); this->changeMenu(&wifiAPMenu, true);
} }
}); });
@@ -2857,7 +2857,7 @@ void MenuFunctions::RunSetup()
// Add the back button // Add the back button
ssidsMenu.list->clear(); ssidsMenu.list->clear();
this->addNodes(&ssidsMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() { this->addNodes(&ssidsMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() {
this->changeMenu(ssidsMenu.parentMenu); this->changeMenu(ssidsMenu.parentMenu, true);
}); });
// Populate the menu with buttons // Populate the menu with buttons
@@ -2866,14 +2866,14 @@ void MenuFunctions::RunSetup()
this->addNodes(&ssidsMenu, ssids->get(i).essid, TFTCYAN, NULL, 255, [this, i](){ this->addNodes(&ssidsMenu, ssids->get(i).essid, TFTCYAN, NULL, 255, [this, i](){
// Join WiFi using mini keyboard // Join WiFi using mini keyboard
#ifdef HAS_MINI_KB #ifdef HAS_MINI_KB
this->changeMenu(&miniKbMenu); this->changeMenu(&miniKbMenu, true);
String password = this->miniKeyboard(&miniKbMenu, true); String password = this->miniKeyboard(&miniKbMenu, true);
if (password != "") { if (password != "") {
Serial.println("Using SSID: " + (String)ssids->get(i).essid + " Password: " + (String)password); Serial.println("Using SSID: " + (String)ssids->get(i).essid + " Password: " + (String)password);
wifi_scan_obj.currentScanMode = LV_JOIN_WIFI; wifi_scan_obj.currentScanMode = LV_JOIN_WIFI;
wifi_scan_obj.StartScan(LV_JOIN_WIFI, TFT_YELLOW); wifi_scan_obj.StartScan(LV_JOIN_WIFI, TFT_YELLOW);
wifi_scan_obj.startWiFi(ssids->get(i).essid, password); wifi_scan_obj.startWiFi(ssids->get(i).essid, password);
this->changeMenu(current_menu); this->changeMenu(current_menu, true);
} }
#endif #endif
@@ -2885,7 +2885,7 @@ void MenuFunctions::RunSetup()
#endif #endif
}); });
} }
this->changeMenu(&ssidsMenu); this->changeMenu(&ssidsMenu, true);
}); });
/*this->addNodes(&wifiGeneralMenu, "Start Saved AP", TFTWHITE, NULL, KEYBOARD_ICO, [this](){ /*this->addNodes(&wifiGeneralMenu, "Start Saved AP", TFTWHITE, NULL, KEYBOARD_ICO, [this](){
@@ -2934,7 +2934,7 @@ void MenuFunctions::RunSetup()
wifiStationMenu.parentMenu = &ssidsMenu; wifiStationMenu.parentMenu = &ssidsMenu;
this->addNodes(&wifiStationMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() { this->addNodes(&wifiStationMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() {
this->changeMenu(wifiStationMenu.parentMenu); this->changeMenu(wifiStationMenu.parentMenu, true);
}); });
//#endif //#endif
@@ -2948,32 +2948,32 @@ void MenuFunctions::RunSetup()
//#endif //#endif
this->addNodes(&wifiGeneralMenu, "Set MACs", TFTLIGHTGREY, NULL, 0, [this]() { this->addNodes(&wifiGeneralMenu, "Set MACs", TFTLIGHTGREY, NULL, 0, [this]() {
this->changeMenu(&setMacMenu); this->changeMenu(&setMacMenu, true);
}); });
this->addNodes(&wifiGeneralMenu, "Shutdown WiFi", TFTRED, NULL, 0, [this]() { this->addNodes(&wifiGeneralMenu, "Shutdown WiFi", TFTRED, NULL, 0, [this]() {
WiFi.disconnect(true); WiFi.disconnect(true);
delay(100); delay(100);
wifi_scan_obj.StartScan(WIFI_SCAN_OFF, TFT_RED); wifi_scan_obj.StartScan(WIFI_SCAN_OFF, TFT_RED);
this->changeMenu(current_menu); this->changeMenu(current_menu, true);
}); });
// Menu for generating and setting MAC addrs for AP and STA // Menu for generating and setting MAC addrs for AP and STA
setMacMenu.parentMenu = &wifiGeneralMenu; setMacMenu.parentMenu = &wifiGeneralMenu;
this->addNodes(&setMacMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() { this->addNodes(&setMacMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() {
this->changeMenu(setMacMenu.parentMenu); this->changeMenu(setMacMenu.parentMenu, true);
}); });
// Generate random MAC for AP // Generate random MAC for AP
this->addNodes(&setMacMenu, "Generate AP MAC", TFTLIME, NULL, 0, [this]() { this->addNodes(&setMacMenu, "Generate AP MAC", TFTLIME, NULL, 0, [this]() {
this->changeMenu(&genAPMacMenu); this->changeMenu(&genAPMacMenu, true);
wifi_scan_obj.RunGenerateRandomMac(true); wifi_scan_obj.RunGenerateRandomMac(true);
}); });
// Generate random MAC for AP // Generate random MAC for AP
this->addNodes(&setMacMenu, "Generate STA MAC", TFTCYAN, NULL, 0, [this]() { this->addNodes(&setMacMenu, "Generate STA MAC", TFTCYAN, NULL, 0, [this]() {
this->changeMenu(&genAPMacMenu); this->changeMenu(&genAPMacMenu, true);
wifi_scan_obj.RunGenerateRandomMac(false); wifi_scan_obj.RunGenerateRandomMac(false);
}); });
@@ -2983,77 +2983,77 @@ void MenuFunctions::RunSetup()
// Add the back button // Add the back button
wifiAPMenu.list->clear(); wifiAPMenu.list->clear();
this->addNodes(&wifiAPMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() { this->addNodes(&wifiAPMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() {
this->changeMenu(wifiAPMenu.parentMenu); this->changeMenu(wifiAPMenu.parentMenu, true);
}); });
// Populate the menu with buttons // Populate the menu with buttons
for (int i = 0; i < access_points->size(); i++) { for (int i = 0; i < access_points->size(); i++) {
// This is the menu node // This is the menu node
this->addNodes(&wifiAPMenu, access_points->get(i).essid, TFTLIME, NULL, 255, [this, i](){ this->addNodes(&wifiAPMenu, access_points->get(i).essid, TFTLIME, NULL, 255, [this, i](){
this->changeMenu(&genAPMacMenu); this->changeMenu(&genAPMacMenu, true);
wifi_scan_obj.RunSetMac(access_points->get(i).bssid, true); wifi_scan_obj.RunSetMac(access_points->get(i).bssid, true);
}); });
} }
this->changeMenu(&wifiAPMenu); this->changeMenu(&wifiAPMenu, true);
}); });
this->addNodes(&setMacMenu, "Clone STA MAC", TFTMAGENTA, NULL, CLEAR_ICO, [this](){ this->addNodes(&setMacMenu, "Clone STA MAC", TFTMAGENTA, NULL, CLEAR_ICO, [this](){
// Add the back button // Add the back button
wifiAPMenu.list->clear(); wifiAPMenu.list->clear();
this->addNodes(&wifiAPMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() { this->addNodes(&wifiAPMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() {
this->changeMenu(wifiAPMenu.parentMenu); this->changeMenu(wifiAPMenu.parentMenu, true);
}); });
// Populate the menu with buttons // Populate the menu with buttons
for (int i = 0; i < stations->size(); i++) { for (int i = 0; i < stations->size(); i++) {
// This is the menu node // This is the menu node
this->addNodes(&wifiAPMenu, macToString(stations->get(i).mac), TFTMAGENTA, NULL, 255, [this, i](){ this->addNodes(&wifiAPMenu, macToString(stations->get(i).mac), TFTMAGENTA, NULL, 255, [this, i](){
this->changeMenu(&genAPMacMenu); this->changeMenu(&genAPMacMenu, true);
wifi_scan_obj.RunSetMac(stations->get(i).mac, false); wifi_scan_obj.RunSetMac(stations->get(i).mac, false);
}); });
} }
this->changeMenu(&wifiAPMenu); this->changeMenu(&wifiAPMenu, true);
}); });
//#endif //#endif
// Menu for generating and setting access point MAC (just goes bacK) // Menu for generating and setting access point MAC (just goes bacK)
genAPMacMenu.parentMenu = &wifiGeneralMenu; genAPMacMenu.parentMenu = &wifiGeneralMenu;
this->addNodes(&genAPMacMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() { this->addNodes(&genAPMacMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() {
this->changeMenu(genAPMacMenu.parentMenu); this->changeMenu(genAPMacMenu.parentMenu, true);
}); });
// Build generate ssids menu // Build generate ssids menu
generateSSIDsMenu.parentMenu = &wifiGeneralMenu; generateSSIDsMenu.parentMenu = &wifiGeneralMenu;
this->addNodes(&generateSSIDsMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() { this->addNodes(&generateSSIDsMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() {
this->changeMenu(generateSSIDsMenu.parentMenu); this->changeMenu(generateSSIDsMenu.parentMenu, true);
}); });
// Build clear ssids menu // Build clear ssids menu
this->addNodes(&clearSSIDsMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() { this->addNodes(&clearSSIDsMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() {
this->changeMenu(clearSSIDsMenu.parentMenu); this->changeMenu(clearSSIDsMenu.parentMenu, true);
}); });
clearAPsMenu.parentMenu = &wifiGeneralMenu; clearAPsMenu.parentMenu = &wifiGeneralMenu;
this->addNodes(&clearAPsMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() { this->addNodes(&clearAPsMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() {
this->changeMenu(clearAPsMenu.parentMenu); this->changeMenu(clearAPsMenu.parentMenu, true);
}); });
// Build Bluetooth Menu // Build Bluetooth Menu
bluetoothMenu.parentMenu = &mainMenu; // Second Menu is third menu parent bluetoothMenu.parentMenu = &mainMenu; // Second Menu is third menu parent
this->addNodes(&bluetoothMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() { this->addNodes(&bluetoothMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() {
this->changeMenu(bluetoothMenu.parentMenu); this->changeMenu(bluetoothMenu.parentMenu, true);
}); });
this->addNodes(&bluetoothMenu, text_table1[31], TFTYELLOW, NULL, SNIFFERS, [this]() { this->addNodes(&bluetoothMenu, text_table1[31], TFTYELLOW, NULL, SNIFFERS, [this]() {
this->changeMenu(&bluetoothSnifferMenu); this->changeMenu(&bluetoothSnifferMenu, true);
}); });
this->addNodes(&bluetoothMenu, "Bluetooth Attacks", TFTRED, NULL, ATTACKS, [this]() { this->addNodes(&bluetoothMenu, "Bluetooth Attacks", TFTRED, NULL, ATTACKS, [this]() {
this->changeMenu(&bluetoothAttackMenu); this->changeMenu(&bluetoothAttackMenu, true);
}); });
// Build bluetooth sniffer Menu // Build bluetooth sniffer Menu
bluetoothSnifferMenu.parentMenu = &bluetoothMenu; // Second Menu is third menu parent bluetoothSnifferMenu.parentMenu = &bluetoothMenu; // Second Menu is third menu parent
this->addNodes(&bluetoothSnifferMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() { this->addNodes(&bluetoothSnifferMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() {
this->changeMenu(bluetoothSnifferMenu.parentMenu); this->changeMenu(bluetoothSnifferMenu.parentMenu, true);
}); });
this->addNodes(&bluetoothSnifferMenu, text_table1[34], TFTGREEN, NULL, BLUETOOTH_SNIFF, [this]() { this->addNodes(&bluetoothSnifferMenu, text_table1[34], TFTGREEN, NULL, BLUETOOTH_SNIFF, [this]() {
display_obj.clearScreen(); display_obj.clearScreen();
@@ -3099,7 +3099,7 @@ void MenuFunctions::RunSetup()
// Bluetooth Attack menu // Bluetooth Attack menu
bluetoothAttackMenu.parentMenu = &bluetoothMenu; // Second Menu is third menu parent bluetoothAttackMenu.parentMenu = &bluetoothMenu; // Second Menu is third menu parent
this->addNodes(&bluetoothAttackMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() { this->addNodes(&bluetoothAttackMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() {
this->changeMenu(bluetoothAttackMenu.parentMenu); this->changeMenu(bluetoothAttackMenu.parentMenu, true);
}); });
this->addNodes(&bluetoothAttackMenu, "Sour Apple", TFTGREEN, NULL, DEAUTH_SNIFF, [this]() { this->addNodes(&bluetoothAttackMenu, "Sour Apple", TFTGREEN, NULL, DEAUTH_SNIFF, [this]() {
display_obj.clearScreen(); display_obj.clearScreen();
@@ -3148,7 +3148,7 @@ void MenuFunctions::RunSetup()
// Clear nodes and add back button // Clear nodes and add back button
airtagMenu.list->clear(); airtagMenu.list->clear();
this->addNodes(&airtagMenu, text09, TFT_LIGHTGREY, NULL, 0, [this]() { this->addNodes(&airtagMenu, text09, TFT_LIGHTGREY, NULL, 0, [this]() {
this->changeMenu(airtagMenu.parentMenu); this->changeMenu(airtagMenu.parentMenu, true);
}); });
// Add buttons for all airtags // Add buttons for all airtags
@@ -3183,12 +3183,12 @@ void MenuFunctions::RunSetup()
}); });
} }
this->changeMenu(&airtagMenu); this->changeMenu(&airtagMenu, true);
}); });
airtagMenu.parentMenu = &bluetoothAttackMenu; airtagMenu.parentMenu = &bluetoothAttackMenu;
this->addNodes(&airtagMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() { this->addNodes(&airtagMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() {
this->changeMenu(airtagMenu.parentMenu); this->changeMenu(airtagMenu.parentMenu, true);
}); });
#endif #endif
@@ -3197,29 +3197,29 @@ void MenuFunctions::RunSetup()
// Device menu // Device menu
deviceMenu.parentMenu = &mainMenu; deviceMenu.parentMenu = &mainMenu;
this->addNodes(&deviceMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() { this->addNodes(&deviceMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() {
this->changeMenu(deviceMenu.parentMenu); this->changeMenu(deviceMenu.parentMenu, true);
}); });
this->addNodes(&deviceMenu, text_table1[15], TFTORANGE, NULL, UPDATE, [this]() { this->addNodes(&deviceMenu, text_table1[15], TFTORANGE, NULL, UPDATE, [this]() {
wifi_scan_obj.currentScanMode = OTA_UPDATE; wifi_scan_obj.currentScanMode = OTA_UPDATE;
this->changeMenu(&whichUpdateMenu); this->changeMenu(&whichUpdateMenu, true);
}); });
this->addNodes(&deviceMenu, "Save/Load Files", TFTCYAN, NULL, SD_UPDATE, [this]() { this->addNodes(&deviceMenu, "Save/Load Files", TFTCYAN, NULL, SD_UPDATE, [this]() {
this->changeMenu(&saveFileMenu); this->changeMenu(&saveFileMenu, true);
}); });
this->addNodes(&deviceMenu, text_table1[16], TFTGREEN, NULL, LANGUAGE, [this]() { this->addNodes(&deviceMenu, text_table1[16], TFTGREEN, NULL, LANGUAGE, [this]() {
wifi_scan_obj.currentScanMode = SHOW_INFO; wifi_scan_obj.currentScanMode = SHOW_INFO;
this->changeMenu(&languageMenu); this->changeMenu(&languageMenu, true);
}); });
this->addNodes(&deviceMenu, text_table1[17], TFTWHITE, NULL, DEVICE_INFO, [this]() { this->addNodes(&deviceMenu, text_table1[17], TFTWHITE, NULL, DEVICE_INFO, [this]() {
wifi_scan_obj.currentScanMode = SHOW_INFO; wifi_scan_obj.currentScanMode = SHOW_INFO;
this->changeMenu(&infoMenu); this->changeMenu(&infoMenu, true);
wifi_scan_obj.RunInfo(); wifi_scan_obj.RunInfo();
}); });
this->addNodes(&deviceMenu, text08, TFTNAVY, NULL, KEYBOARD_ICO, [this]() { this->addNodes(&deviceMenu, text08, TFTNAVY, NULL, KEYBOARD_ICO, [this]() {
this->changeMenu(&settingsMenu); this->changeMenu(&settingsMenu, true);
}); });
#ifdef HAS_SD #ifdef HAS_SD
@@ -3406,7 +3406,7 @@ void MenuFunctions::RunSetup()
// Clear menu and lists // Clear menu and lists
this->buildSDFileMenu(); this->buildSDFileMenu();
this->changeMenu(&sdDeleteMenu); this->changeMenu(&sdDeleteMenu, true);
}); });
} }
#endif #endif
@@ -3425,61 +3425,61 @@ void MenuFunctions::RunSetup()
// Save Files Menu // Save Files Menu
saveFileMenu.parentMenu = &deviceMenu; saveFileMenu.parentMenu = &deviceMenu;
this->addNodes(&saveFileMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() { this->addNodes(&saveFileMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() {
this->changeMenu(saveFileMenu.parentMenu); this->changeMenu(saveFileMenu.parentMenu, true);
}); });
this->addNodes(&saveFileMenu, "Save SSIDs", TFTCYAN, NULL, SD_UPDATE, [this]() { this->addNodes(&saveFileMenu, "Save SSIDs", TFTCYAN, NULL, SD_UPDATE, [this]() {
this->changeMenu(&saveSSIDsMenu); this->changeMenu(&saveSSIDsMenu, true);
wifi_scan_obj.RunSaveSSIDList(true); wifi_scan_obj.RunSaveSSIDList(true);
}); });
this->addNodes(&saveFileMenu, "Load SSIDs", TFTSKYBLUE, NULL, SD_UPDATE, [this]() { this->addNodes(&saveFileMenu, "Load SSIDs", TFTSKYBLUE, NULL, SD_UPDATE, [this]() {
this->changeMenu(&loadSSIDsMenu); this->changeMenu(&loadSSIDsMenu, true);
wifi_scan_obj.RunLoadSSIDList(); wifi_scan_obj.RunLoadSSIDList();
}); });
this->addNodes(&saveFileMenu, "Save APs", TFTNAVY, NULL, SD_UPDATE, [this]() { this->addNodes(&saveFileMenu, "Save APs", TFTNAVY, NULL, SD_UPDATE, [this]() {
this->changeMenu(&saveAPsMenu); this->changeMenu(&saveAPsMenu, true);
wifi_scan_obj.RunSaveAPList(); wifi_scan_obj.RunSaveAPList();
}); });
this->addNodes(&saveFileMenu, "Load APs", TFTBLUE, NULL, SD_UPDATE, [this]() { this->addNodes(&saveFileMenu, "Load APs", TFTBLUE, NULL, SD_UPDATE, [this]() {
this->changeMenu(&loadAPsMenu); this->changeMenu(&loadAPsMenu, true);
wifi_scan_obj.RunLoadAPList(); wifi_scan_obj.RunLoadAPList();
}); });
this->addNodes(&saveFileMenu, "Save Airtags", TFTWHITE, NULL, SD_UPDATE, [this]() { this->addNodes(&saveFileMenu, "Save Airtags", TFTWHITE, NULL, SD_UPDATE, [this]() {
this->changeMenu(&saveAPsMenu); this->changeMenu(&saveAPsMenu, true);
wifi_scan_obj.RunSaveATList(); wifi_scan_obj.RunSaveATList();
}); });
this->addNodes(&saveFileMenu, "Load Airtags", TFTWHITE, NULL, SD_UPDATE, [this]() { this->addNodes(&saveFileMenu, "Load Airtags", TFTWHITE, NULL, SD_UPDATE, [this]() {
this->changeMenu(&loadAPsMenu); this->changeMenu(&loadAPsMenu, true);
wifi_scan_obj.RunLoadATList(); wifi_scan_obj.RunLoadATList();
}); });
saveSSIDsMenu.parentMenu = &saveFileMenu; saveSSIDsMenu.parentMenu = &saveFileMenu;
this->addNodes(&saveSSIDsMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() { this->addNodes(&saveSSIDsMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() {
this->changeMenu(saveSSIDsMenu.parentMenu); this->changeMenu(saveSSIDsMenu.parentMenu, true);
}); });
loadSSIDsMenu.parentMenu = &saveFileMenu; loadSSIDsMenu.parentMenu = &saveFileMenu;
this->addNodes(&loadSSIDsMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() { this->addNodes(&loadSSIDsMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() {
this->changeMenu(loadSSIDsMenu.parentMenu); this->changeMenu(loadSSIDsMenu.parentMenu, true);
}); });
saveAPsMenu.parentMenu = &saveFileMenu; saveAPsMenu.parentMenu = &saveFileMenu;
this->addNodes(&saveAPsMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() { this->addNodes(&saveAPsMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() {
this->changeMenu(saveAPsMenu.parentMenu); this->changeMenu(saveAPsMenu.parentMenu, true);
}); });
loadAPsMenu.parentMenu = &saveFileMenu; loadAPsMenu.parentMenu = &saveFileMenu;
this->addNodes(&loadAPsMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() { this->addNodes(&loadAPsMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() {
this->changeMenu(loadAPsMenu.parentMenu); this->changeMenu(loadAPsMenu.parentMenu, true);
}); });
saveATsMenu.parentMenu = &saveFileMenu; saveATsMenu.parentMenu = &saveFileMenu;
this->addNodes(&saveATsMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() { this->addNodes(&saveATsMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() {
this->changeMenu(saveATsMenu.parentMenu); this->changeMenu(saveATsMenu.parentMenu, true);
}); });
loadATsMenu.parentMenu = &saveFileMenu; loadATsMenu.parentMenu = &saveFileMenu;
this->addNodes(&loadATsMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() { this->addNodes(&loadATsMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() {
this->changeMenu(loadATsMenu.parentMenu); this->changeMenu(loadATsMenu.parentMenu, true);
}); });
// GPS Menu // GPS Menu
@@ -3488,31 +3488,31 @@ void MenuFunctions::RunSetup()
gpsMenu.parentMenu = &mainMenu; // Main Menu is second menu parent gpsMenu.parentMenu = &mainMenu; // Main Menu is second menu parent
this->addNodes(&gpsMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() { this->addNodes(&gpsMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() {
this->changeMenu(gpsMenu.parentMenu); this->changeMenu(gpsMenu.parentMenu, true);
}); });
this->addNodes(&gpsMenu, "GPS Data", TFTRED, NULL, GPS_MENU, [this]() { this->addNodes(&gpsMenu, "GPS Data", TFTRED, NULL, GPS_MENU, [this]() {
wifi_scan_obj.currentScanMode = WIFI_SCAN_GPS_DATA; wifi_scan_obj.currentScanMode = WIFI_SCAN_GPS_DATA;
this->changeMenu(&gpsInfoMenu); this->changeMenu(&gpsInfoMenu, true);
wifi_scan_obj.StartScan(WIFI_SCAN_GPS_DATA, TFT_CYAN); wifi_scan_obj.StartScan(WIFI_SCAN_GPS_DATA, TFT_CYAN);
}); });
this->addNodes(&gpsMenu, "NMEA Stream", TFTORANGE, NULL, GPS_MENU, [this]() { this->addNodes(&gpsMenu, "NMEA Stream", TFTORANGE, NULL, GPS_MENU, [this]() {
wifi_scan_obj.currentScanMode = WIFI_SCAN_GPS_NMEA; wifi_scan_obj.currentScanMode = WIFI_SCAN_GPS_NMEA;
this->changeMenu(&gpsInfoMenu); this->changeMenu(&gpsInfoMenu, true);
wifi_scan_obj.StartScan(WIFI_SCAN_GPS_NMEA, TFT_ORANGE); wifi_scan_obj.StartScan(WIFI_SCAN_GPS_NMEA, TFT_ORANGE);
}); });
this->addNodes(&gpsMenu, "GPS Tracker", TFTGREEN, NULL, GPS_MENU, [this]() { this->addNodes(&gpsMenu, "GPS Tracker", TFTGREEN, NULL, GPS_MENU, [this]() {
wifi_scan_obj.currentScanMode = GPS_TRACKER; wifi_scan_obj.currentScanMode = GPS_TRACKER;
this->changeMenu(&gpsInfoMenu); this->changeMenu(&gpsInfoMenu, true);
wifi_scan_obj.StartScan(GPS_TRACKER, TFT_CYAN); wifi_scan_obj.StartScan(GPS_TRACKER, TFT_CYAN);
}); });
this->addNodes(&gpsMenu, "GPS POI", TFTCYAN, NULL, GPS_MENU, [this]() { this->addNodes(&gpsMenu, "GPS POI", TFTCYAN, NULL, GPS_MENU, [this]() {
wifi_scan_obj.StartScan(GPS_POI, TFT_CYAN); wifi_scan_obj.StartScan(GPS_POI, TFT_CYAN);
wifi_scan_obj.currentScanMode = WIFI_SCAN_OFF; wifi_scan_obj.currentScanMode = WIFI_SCAN_OFF;
this->changeMenu(&gpsPOIMenu); this->changeMenu(&gpsPOIMenu, true);
}); });
// GPS POI Menu // GPS POI Menu
@@ -3520,7 +3520,7 @@ void MenuFunctions::RunSetup()
this->addNodes(&gpsPOIMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() { this->addNodes(&gpsPOIMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() {
wifi_scan_obj.currentScanMode = GPS_POI; wifi_scan_obj.currentScanMode = GPS_POI;
wifi_scan_obj.StartScan(WIFI_SCAN_OFF); wifi_scan_obj.StartScan(WIFI_SCAN_OFF);
this->changeMenu(gpsPOIMenu.parentMenu); this->changeMenu(gpsPOIMenu.parentMenu, true);
}); });
this->addNodes(&gpsPOIMenu, "Mark POI", TFTCYAN, NULL, GPS_MENU, [this]() { this->addNodes(&gpsPOIMenu, "Mark POI", TFTCYAN, NULL, GPS_MENU, [this]() {
/*if (wifi_scan_obj.currentScanMode != GPS_POI) { /*if (wifi_scan_obj.currentScanMode != GPS_POI) {
@@ -3537,7 +3537,7 @@ void MenuFunctions::RunSetup()
wifi_scan_obj.currentScanMode = WIFI_SCAN_OFF; wifi_scan_obj.currentScanMode = WIFI_SCAN_OFF;
delay(2000); delay(2000);
//wifi_scan_obj.StartScan(WIFI_SCAN_OFF); //wifi_scan_obj.StartScan(WIFI_SCAN_OFF);
this->changeMenu(&gpsPOIMenu); this->changeMenu(&gpsPOIMenu, true);
}); });
// GPS Info Menu // GPS Info Menu
@@ -3546,7 +3546,7 @@ void MenuFunctions::RunSetup()
if(wifi_scan_obj.currentScanMode != GPS_TRACKER) if(wifi_scan_obj.currentScanMode != GPS_TRACKER)
wifi_scan_obj.currentScanMode = WIFI_SCAN_OFF; wifi_scan_obj.currentScanMode = WIFI_SCAN_OFF;
wifi_scan_obj.StartScan(WIFI_SCAN_OFF); wifi_scan_obj.StartScan(WIFI_SCAN_OFF);
this->changeMenu(gpsInfoMenu.parentMenu); this->changeMenu(gpsInfoMenu.parentMenu, true);
}); });
} }
#endif #endif
@@ -3555,13 +3555,13 @@ void MenuFunctions::RunSetup()
// Device menu // Device menu
settingsMenu.parentMenu = &deviceMenu; settingsMenu.parentMenu = &deviceMenu;
this->addNodes(&settingsMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() { this->addNodes(&settingsMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() {
changeMenu(settingsMenu.parentMenu); changeMenu(settingsMenu.parentMenu, true);
}); });
for (int i = 0; i < settings_obj.getNumberSettings(); i++) { for (int i = 0; i < settings_obj.getNumberSettings(); i++) {
if (this->callSetting(settings_obj.setting_index_to_name(i)) == "bool") if (this->callSetting(settings_obj.setting_index_to_name(i)) == "bool")
this->addNodes(&settingsMenu, settings_obj.setting_index_to_name(i), TFTLIGHTGREY, NULL, 0, [this, i]() { this->addNodes(&settingsMenu, settings_obj.setting_index_to_name(i), TFTLIGHTGREY, NULL, 0, [this, i]() {
settings_obj.toggleSetting(settings_obj.setting_index_to_name(i)); settings_obj.toggleSetting(settings_obj.setting_index_to_name(i));
this->changeMenu(&specSettingMenu); this->changeMenu(&specSettingMenu, true);
this->displaySetting(settings_obj.setting_index_to_name(i), &settingsMenu, i + 1); this->displaySetting(settings_obj.setting_index_to_name(i), &settingsMenu, i + 1);
wifi_scan_obj.force_pmkid = settings_obj.loadSetting<bool>(text_table4[5]); wifi_scan_obj.force_pmkid = settings_obj.loadSetting<bool>(text_table4[5]);
wifi_scan_obj.force_probe = settings_obj.loadSetting<bool>(text_table4[6]); wifi_scan_obj.force_probe = settings_obj.loadSetting<bool>(text_table4[6]);
@@ -3573,29 +3573,29 @@ void MenuFunctions::RunSetup()
// Specific setting menu // Specific setting menu
specSettingMenu.parentMenu = &settingsMenu; specSettingMenu.parentMenu = &settingsMenu;
addNodes(&specSettingMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() { addNodes(&specSettingMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() {
this->changeMenu(specSettingMenu.parentMenu); this->changeMenu(specSettingMenu.parentMenu, true);
}); });
// Select update // Select update
whichUpdateMenu.parentMenu = &deviceMenu; whichUpdateMenu.parentMenu = &deviceMenu;
this->addNodes(&whichUpdateMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() { this->addNodes(&whichUpdateMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() {
wifi_scan_obj.currentScanMode = WIFI_SCAN_OFF; wifi_scan_obj.currentScanMode = WIFI_SCAN_OFF;
this->changeMenu(whichUpdateMenu.parentMenu); this->changeMenu(whichUpdateMenu.parentMenu, true);
}); });
#ifdef HAS_SD #ifdef HAS_SD
if (sd_obj.supported) addNodes(&whichUpdateMenu, text_table1[40], TFTMAGENTA, NULL, SD_UPDATE, [this]() { if (sd_obj.supported) addNodes(&whichUpdateMenu, text_table1[40], TFTMAGENTA, NULL, SD_UPDATE, [this]() {
wifi_scan_obj.currentScanMode = OTA_UPDATE; wifi_scan_obj.currentScanMode = OTA_UPDATE;
this->changeMenu(&confirmMenu); this->changeMenu(&confirmMenu, true);
}); });
// Confirm SD update menu // Confirm SD update menu
confirmMenu.parentMenu = &whichUpdateMenu; confirmMenu.parentMenu = &whichUpdateMenu;
this->addNodes(&confirmMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() { this->addNodes(&confirmMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() {
this->changeMenu(confirmMenu.parentMenu); this->changeMenu(confirmMenu.parentMenu, true);
}); });
this->addNodes(&confirmMenu, text14, TFTORANGE, NULL, UPDATE, [this]() { this->addNodes(&confirmMenu, text14, TFTORANGE, NULL, UPDATE, [this]() {
wifi_scan_obj.currentScanMode = OTA_UPDATE; wifi_scan_obj.currentScanMode = OTA_UPDATE;
this->changeMenu(&failedUpdateMenu); this->changeMenu(&failedUpdateMenu, true);
sd_obj.runUpdate(); sd_obj.runUpdate();
}); });
#endif #endif
@@ -3607,23 +3607,23 @@ void MenuFunctions::RunSetup()
failedUpdateMenu.parentMenu = &whichUpdateMenu; failedUpdateMenu.parentMenu = &whichUpdateMenu;
this->addNodes(&failedUpdateMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() { this->addNodes(&failedUpdateMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() {
wifi_scan_obj.currentScanMode = WIFI_SCAN_OFF; wifi_scan_obj.currentScanMode = WIFI_SCAN_OFF;
this->changeMenu(failedUpdateMenu.parentMenu); this->changeMenu(failedUpdateMenu.parentMenu, true);
}); });
// Device info menu // Device info menu
infoMenu.parentMenu = &deviceMenu; infoMenu.parentMenu = &deviceMenu;
this->addNodes(&infoMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() { this->addNodes(&infoMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() {
wifi_scan_obj.currentScanMode = WIFI_SCAN_OFF; wifi_scan_obj.currentScanMode = WIFI_SCAN_OFF;
this->changeMenu(infoMenu.parentMenu); this->changeMenu(infoMenu.parentMenu, true);
}); });
//language info menu //language info menu
languageMenu.parentMenu = &deviceMenu; languageMenu.parentMenu = &deviceMenu;
this->addNodes(&languageMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() { this->addNodes(&languageMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() {
wifi_scan_obj.currentScanMode = WIFI_SCAN_OFF; wifi_scan_obj.currentScanMode = WIFI_SCAN_OFF;
this->changeMenu(infoMenu.parentMenu); this->changeMenu(infoMenu.parentMenu, true);
}); });
// Set the current menu to the mainMenu // Set the current menu to the mainMenu
this->changeMenu(&mainMenu); this->changeMenu(&mainMenu, true);
this->initTime = millis(); this->initTime = millis();
} }
@@ -3827,7 +3827,7 @@ void MenuFunctions::RunSetup()
if (!do_pass) { if (!do_pass) {
if (this->isKeyPressed('`')) { if (this->isKeyPressed('`')) {
this->changeMenu(targetMenu->parentMenu); this->changeMenu(targetMenu->parentMenu, true);
return wifi_scan_obj.current_mini_kb_ssid; return wifi_scan_obj.current_mini_kb_ssid;
} }
@@ -3844,12 +3844,12 @@ void MenuFunctions::RunSetup()
} }
else { else {
if (this->isKeyPressed('(')) { if (this->isKeyPressed('(')) {
this->changeMenu(targetMenu->parentMenu); this->changeMenu(targetMenu->parentMenu, true);
return wifi_scan_obj.current_mini_kb_ssid; return wifi_scan_obj.current_mini_kb_ssid;
} }
if (this->isKeyPressed('`')) { if (this->isKeyPressed('`')) {
this->changeMenu(targetMenu->parentMenu); this->changeMenu(targetMenu->parentMenu, true);
return ""; return "";
} }
} }
@@ -3973,7 +3973,7 @@ void MenuFunctions::RunSetup()
// Reset the touch keys so we don't activate the keys when we go back // Reset the touch keys so we don't activate the keys when we go back
display_obj.menuButton(&t_x, &t_y, display_obj.updateTouch(&t_x, &t_y)); display_obj.menuButton(&t_x, &t_y, display_obj.updateTouch(&t_x, &t_y));
this->changeMenu(targetMenu->parentMenu); this->changeMenu(targetMenu->parentMenu, true);
return wifi_scan_obj.current_mini_kb_ssid; return wifi_scan_obj.current_mini_kb_ssid;
} }
@@ -4053,7 +4053,7 @@ void MenuFunctions::buildSDFileMenu() {
sdDeleteMenu.name = "SD Files"; sdDeleteMenu.name = "SD Files";
this->addNodes(&sdDeleteMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() { this->addNodes(&sdDeleteMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() {
this->changeMenu(sdDeleteMenu.parentMenu); this->changeMenu(sdDeleteMenu.parentMenu, true);
}); });
for (int x = 0; x < sd_obj.sd_files->size(); x++) { for (int x = 0; x < sd_obj.sd_files->size(); x++) {
@@ -4068,7 +4068,7 @@ void MenuFunctions::buildSDFileMenu() {
//sd_obj.sd_files->remove(x); //sd_obj.sd_files->remove(x);
//sdDeleteMenu.list->remove(x + 1); // +1 for "Back" //sdDeleteMenu.list->remove(x + 1); // +1 for "Back"
this->buildSDFileMenu(); this->buildSDFileMenu();
this->changeMenu(&sdDeleteMenu); this->changeMenu(&sdDeleteMenu, true);
} }
}); });
} }
@@ -4216,11 +4216,12 @@ uint16_t MenuFunctions::getColor(uint16_t color) {
} }
// Function to change menu // Function to change menu
void MenuFunctions::changeMenu(Menu * menu) void MenuFunctions::changeMenu(Menu* menu, bool simple_change) {
{ if (!simple_change) {
display_obj.initScrollValues(); display_obj.initScrollValues();
display_obj.setupScrollArea(TOP_FIXED_AREA, BOT_FIXED_AREA); display_obj.setupScrollArea(TOP_FIXED_AREA, BOT_FIXED_AREA);
display_obj.tft.init(); display_obj.tft.init();
}
current_menu = menu; current_menu = menu;
current_menu->selected = 0; current_menu->selected = 0;

View File

@@ -295,7 +295,7 @@ class MenuFunctions
void addAPGFX(String type = "AP"); void addAPGFX(String type = "AP");
void addStationGFX(); void addStationGFX();
void buildButtons(Menu* menu, int starting_index = 0, String button_name = ""); void buildButtons(Menu* menu, int starting_index = 0, String button_name = "");
void changeMenu(Menu* menu); void changeMenu(Menu* menu, bool simple_change = false);
void drawStatusBar(); void drawStatusBar();
void displayCurrentMenu(int start_index = 0); void displayCurrentMenu(int start_index = 0);
void main(uint32_t currentTime); void main(uint32_t currentTime);