summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorscnorton <scnorton@biociphers.org>2019-01-06 15:08:17 -0500
committerscnorton <scnorton@biociphers.org>2019-01-06 15:08:17 -0500
commit6a064a4fa4bedaa1e46470645e175ba7d11a2e41 (patch)
tree8f2afdc0818d27c9b405f5b2360099acf3a9592d /src
parent607d6e13d4378ea6530f03d2c290ddd30506aa14 (diff)
Through ScrCmd_getbraillestringwidth
Diffstat (limited to 'src')
-rw-r--r--src/scrcmd.c168
1 files changed, 168 insertions, 0 deletions
diff --git a/src/scrcmd.c b/src/scrcmd.c
index 976b80564..c77dda666 100644
--- a/src/scrcmd.c
+++ b/src/scrcmd.c
@@ -23,6 +23,7 @@
#include "new_menu_helpers.h"
#include "window.h"
#include "start_menu.h"
+#include "script_menu.h"
extern u16 (*const gSpecials[])(void);
extern u16 (*const gSpecialsEnd[])(void);
@@ -1407,3 +1408,170 @@ SCRCMD_DEF(waitbuttonpress)
SetupNativeScript(ctx, WaitForAorBPress);
return TRUE;
}
+
+SCRCMD_DEF(yesnobox)
+{
+ u8 left = ScriptReadByte(ctx);
+ u8 top = ScriptReadByte(ctx);
+
+ if (ScriptMenu_YesNo(left, top) == TRUE)
+ {
+ ScriptContext1_Stop();
+ return TRUE;
+ }
+ else
+ {
+ return FALSE;
+ }
+}
+
+SCRCMD_DEF(multichoice)
+{
+ u8 left = ScriptReadByte(ctx);
+ u8 top = ScriptReadByte(ctx);
+ u8 multichoiceId = ScriptReadByte(ctx);
+ u8 ignoreBPress = ScriptReadByte(ctx);
+
+ if (ScriptMenu_Multichoice(left, top, multichoiceId, ignoreBPress) == TRUE)
+ {
+ ScriptContext1_Stop();
+ return TRUE;
+ }
+ else
+ {
+ return FALSE;
+ }
+}
+
+SCRCMD_DEF(multichoicedefault)
+{
+ u8 left = ScriptReadByte(ctx);
+ u8 top = ScriptReadByte(ctx);
+ u8 multichoiceId = ScriptReadByte(ctx);
+ u8 defaultChoice = ScriptReadByte(ctx);
+ u8 ignoreBPress = ScriptReadByte(ctx);
+
+ if (ScriptMenu_MultichoiceWithDefault(left, top, multichoiceId, ignoreBPress, defaultChoice) == TRUE)
+ {
+ ScriptContext1_Stop();
+ return TRUE;
+ }
+ else
+ {
+ return FALSE;
+ }
+}
+
+SCRCMD_DEF(drawbox)
+{
+ /*u8 left = ScriptReadByte(ctx);
+ u8 top = ScriptReadByte(ctx);
+ u8 right = ScriptReadByte(ctx);
+ u8 bottom = ScriptReadByte(ctx);
+
+ MenuDrawTextWindow(left, top, right, bottom);*/
+ return FALSE;
+}
+
+SCRCMD_DEF(multichoicegrid)
+{
+ u8 left = ScriptReadByte(ctx);
+ u8 top = ScriptReadByte(ctx);
+ u8 multichoiceId = ScriptReadByte(ctx);
+ u8 numColumns = ScriptReadByte(ctx);
+ u8 ignoreBPress = ScriptReadByte(ctx);
+
+ if (ScriptMenu_MultichoiceGrid(left, top, multichoiceId, ignoreBPress, numColumns) == TRUE)
+ {
+ ScriptContext1_Stop();
+ return TRUE;
+ }
+ else
+ {
+ return FALSE;
+ }
+}
+
+SCRCMD_DEF(erasebox)
+{
+ u8 left = ScriptReadByte(ctx);
+ u8 top = ScriptReadByte(ctx);
+ u8 right = ScriptReadByte(ctx);
+ u8 bottom = ScriptReadByte(ctx);
+
+ // MenuZeroFillWindowRect(left, top, right, bottom);
+ return FALSE;
+}
+
+SCRCMD_DEF(drawboxtext)
+{
+// u8 left = ScriptReadByte(ctx);
+// u8 top = ScriptReadByte(ctx);
+// u8 multichoiceId = ScriptReadByte(ctx);
+// u8 ignoreBPress = ScriptReadByte(ctx);
+
+ /*if (Multichoice(left, top, multichoiceId, ignoreBPress) == TRUE)
+ {
+ ScriptContext1_Stop();
+ return TRUE;
+ }*/
+ return FALSE;
+}
+
+SCRCMD_DEF(showmonpic)
+{
+ u16 species = VarGet(ScriptReadHalfword(ctx));
+ u8 x = ScriptReadByte(ctx);
+ u8 y = ScriptReadByte(ctx);
+
+ ScriptMenu_ShowPokemonPic(species, x, y);
+ PlayCry7(species, 0);
+ return FALSE;
+}
+
+SCRCMD_DEF(hidemonpic)
+{
+ bool8 (*func)(void) = ScriptMenu_GetPicboxWaitFunc();
+
+ if (func == NULL)
+ return FALSE;
+ SetupNativeScript(ctx, func);
+ return TRUE;
+}
+
+SCRCMD_DEF(showcontestwinner)
+{
+ u8 v1 = ScriptReadByte(ctx);
+
+ /*
+ if (v1)
+ sub_812FDA8(v1);
+ ShowContestWinner();
+ ScriptContext1_Stop();
+ return TRUE;
+ */
+
+ return FALSE;
+}
+
+SCRCMD_DEF(braillemessage)
+{
+ u8 *ptr = (u8 *)ScriptReadWord(ctx);
+ if (ptr == NULL)
+ ptr = (u8 *)ctx->data[0];
+
+ sub_80F6E9C();
+ sub_80F6EE4(0, 1);
+ AddTextPrinterParameterized(0, 6, ptr, 0, 1, 0, NULL);
+ return FALSE;
+}
+
+SCRCMD_DEF(getbraillestringwidth)
+{
+ u8 *ptr = (u8 *)ScriptReadWord(ctx);
+ if (ptr == NULL)
+ ptr = (u8 *)ctx->data[0];
+
+ gSpecialVar_0x8004 = GetStringWidth(6, ptr, -1);
+ return FALSE;
+}