49 lines
No EOL
1.3 KiB
C++
49 lines
No EOL
1.3 KiB
C++
#include <3ds.h>
|
|
#include <iostream>
|
|
#include "utilsconsole.hpp"
|
|
|
|
using namespace std;
|
|
|
|
int main(void) {;
|
|
gfxInitDefault();
|
|
consoleInit(GFX_BOTTOM, NULL);
|
|
|
|
int a = 0;
|
|
int b = 2;
|
|
int c = -10;
|
|
while (aptMainLoop()) {
|
|
static const s_uc_menu_element menu[] = {
|
|
{"a", true, &a, 0, 10},
|
|
{"b", true, &b, 0, 2},
|
|
{"c", true, &c, -10, 10},
|
|
{"Show", false, NULL, 0, 0},
|
|
{"Test quick menu", false, NULL, 0, 0},
|
|
};
|
|
static auto menuVec = vector<s_uc_menu_element>(menu, menu + 5);
|
|
int ans = uc_menu(menuVec);
|
|
if (ans == 3) {
|
|
cout << "a: " << a << ", b: " << b << ", c: " << c << endl;
|
|
uc_pause();
|
|
}
|
|
else if (ans == 4) {
|
|
while (aptMainLoop()) {
|
|
ans = uc_menu_quick("hello", "hola", "bonjour", "Go back");
|
|
switch (ans) {
|
|
case 0:
|
|
cout << "bye" << endl;
|
|
break;
|
|
case 1:
|
|
cout << "adios" << endl;
|
|
break;
|
|
case 2:
|
|
cout << "au revoir" << endl;
|
|
break;
|
|
}
|
|
if (ans == 3)
|
|
break;
|
|
uc_pause();
|
|
}
|
|
}
|
|
}
|
|
gfxExit();
|
|
} |