diff --git a/source/main.c b/source/main.c index 0a0243b..f1721fa 100644 --- a/source/main.c +++ b/source/main.c @@ -15,12 +15,13 @@ int main(int argc, char **argv) PadState pad; padInitializeDefault(&pad); + // Initialize save system + openSave(); + processSave(); + // Initialize UI initUI(); - printMessage("Press A to test save loading\n"); - printMessage("Press + to exit\n"); - bool exit = false; // Main loop @@ -31,11 +32,6 @@ int main(int argc, char **argv) exit = handleButtonPress(kDown); - if (kDown & HidNpadButton_A) { - openSave(); - processSave(); - } - consoleUpdate(NULL); } diff --git a/source/ui_basic.c b/source/ui_basic.c index c00a022..9c42190 100644 --- a/source/ui_basic.c +++ b/source/ui_basic.c @@ -2,14 +2,34 @@ #include #include #include "ui_basic.h" +#include "data_basic.h" +#include "map_basic.h" + +static void addKorokPins() { + printMessage("Adding Korok seed pins...\n"); + for (int i = 0; i < KOROK_COUNT; i++) { + addMapPin(MAP_PIN_LEAF, KOROKS[i]); + } + printMessage("Added %d Korok pins!\n", KOROK_COUNT); +} + +static void testFunction() { + printMessage("Test function called!\n"); +} void initUI() { printf("\x1b[2J"); // Clear screen printf("\x1b[1;1H"); // Move cursor to top-left printf("═══════════════════════════════════════\n"); - printf(" BOTW Completer v0.3\n"); + printf(" BOTW Completer v0.4\n"); printf("═══════════════════════════════════════\n"); printf("\n"); + printf("Menu:\n"); + printf("A - Add Korok pins\n"); + printf("B - Count map pins\n"); + printf("Y - Test function\n"); + printf("+ - Exit\n"); + printf("\n"); } void printMessage(const char* message, ...) { @@ -23,5 +43,18 @@ bool handleButtonPress(u64 button) { if (button & HidNpadButton_Plus) { return true; // Exit requested } + + if (button & HidNpadButton_A) { + addKorokPins(); + } + + if (button & HidNpadButton_B) { + countMapPins(); + } + + if (button & HidNpadButton_Y) { + testFunction(); + } + return false; // Continue running } \ No newline at end of file