mirror of
https://github.com/rvtr/TDT.git
synced 2025-10-31 13:51:07 -04:00
Delete menus.c
This commit is contained in:
parent
eb16d0581a
commit
34d231c58f
72
src/menus.c
72
src/menus.c
@ -1,72 +0,0 @@
|
||||
#include "menus.h"
|
||||
|
||||
void keyWait(u32 key)
|
||||
{
|
||||
while (1)
|
||||
{
|
||||
swiWaitForVBlank();
|
||||
scanKeys();
|
||||
|
||||
if (keysDown() & key)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
int choiceBox(char* message)
|
||||
{
|
||||
const int choiceRow = 10;
|
||||
int cursor = 0;
|
||||
|
||||
consoleSelect(&bottomScreen);
|
||||
consoleClear();
|
||||
|
||||
iprintf("%s\n", message);
|
||||
iprintf("\x1b[%d;0H\tYes\n\tNo\n", choiceRow);
|
||||
|
||||
while (1)
|
||||
{
|
||||
swiWaitForVBlank();
|
||||
scanKeys();
|
||||
|
||||
//Clear cursor
|
||||
iprintf("\x1b[%d;0H ", choiceRow + cursor);
|
||||
|
||||
if (keysDown() & (KEY_UP | KEY_DOWN))
|
||||
cursor = !cursor;
|
||||
|
||||
//Print cursor
|
||||
iprintf("\x1b[%d;0H>", choiceRow + cursor);
|
||||
|
||||
if (keysDown() & (KEY_A | KEY_START))
|
||||
break;
|
||||
|
||||
if (keysDown() & KEY_B)
|
||||
{
|
||||
cursor = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
scanKeys();
|
||||
return (cursor == 0)? YES: NO;
|
||||
}
|
||||
|
||||
void messageBox(char* message)
|
||||
{
|
||||
consoleSelect(&bottomScreen);
|
||||
consoleClear();
|
||||
|
||||
iprintf("%s\n", message);
|
||||
iprintf("\nOkay - A\n");
|
||||
|
||||
while (1)
|
||||
{
|
||||
swiWaitForVBlank();
|
||||
scanKeys();
|
||||
|
||||
if (keysDown() & (KEY_A | KEY_START))
|
||||
break;
|
||||
}
|
||||
|
||||
scanKeys();
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user