summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorscnorton <scnorton@biociphers.org>2017-08-30 17:51:25 -0400
committerscnorton <scnorton@biociphers.org>2017-08-30 17:51:25 -0400
commit50e82f84d6d379b6e94e7f70a7de47361156ad0f (patch)
tree0553b71e9c603bcd72a322c681647ada448a1027 /src
parentd73bd667323a309c3a38d380bcb0c644a101a251 (diff)
DaycareLevelMenuProcessKeyInput
Diffstat (limited to 'src')
-rw-r--r--src/daycare.c44
1 files changed, 44 insertions, 0 deletions
diff --git a/src/daycare.c b/src/daycare.c
index e4dc2cc45..8a86c9205 100644
--- a/src/daycare.c
+++ b/src/daycare.c
@@ -16,6 +16,11 @@
#include "data/pokemon/egg_moves.h"
#include "party_menu.h"
#include "field_effect.h"
+#include "main.h"
+#include "menu.h"
+#include "sound.h"
+#include "songs.h"
+#include "script.h"
extern u16 word_2024E82;
@@ -1620,3 +1625,42 @@ void DaycareLevelMenuGetLevelText(struct DayCareData *dayCareData, u8 *dest)
}
*dest = EOS;
}
+
+void DaycareLevelMenuProcessKeyInput(u8 taskId)
+{
+ if (gMain.newKeys & DPAD_UP)
+ {
+ if (gTasks[taskId].data[0] != 0)
+ {
+ gTasks[taskId].data[0] --;
+ MoveMenuCursor(-1);
+ PlaySE(SE_SELECT);
+ }
+ }
+ else if (gMain.newKeys & DPAD_DOWN)
+ {
+ if (gTasks[taskId].data[0] != 2)
+ {
+ gTasks[taskId].data[0] ++;
+ MoveMenuCursor(+1);
+ PlaySE(SE_SELECT);
+ }
+ }
+ else if (gMain.newKeys & A_BUTTON)
+ {
+ HandleDestroyMenuCursors();
+ PlaySE(SE_SELECT);
+ gLastFieldPokeMenuOpened = gScriptResult = gTasks[taskId].data[0];
+ DestroyTask(taskId);
+ MenuZeroFillWindowRect(15, 6, 29, 13);
+ EnableBothScriptContexts();
+ }
+ else if (gMain.newKeys & B_BUTTON)
+ {
+ HandleDestroyMenuCursors();
+ gLastFieldPokeMenuOpened = gScriptResult = 2;
+ DestroyTask(taskId);
+ MenuZeroFillWindowRect(15, 6, 29, 13);
+ EnableBothScriptContexts();
+ }
+}