diff --git a/assembly/events/autorun.inc b/assembly/events/autorun.inc index 45f1a06..29602cb 100644 --- a/assembly/events/autorun.inc +++ b/assembly/events/autorun.inc @@ -1,20 +1,15 @@ -.global EventScript_DisableAutoRun -.global EventScript_EnableAutoRun - -EventScript_DisableAutoRun: - lockall - msgbox Text_DisableAutoRun, MSGBOX_AUTOCLOSE - releaseall - end - -EventScript_EnableAutoRun: - lockall - msgbox Text_EnableAutoRun, MSGBOX_AUTOCLOSE - releaseall +.global EventScript_CloseAutorunMessage + +EventScript_CloseAutorunMessage: + lockall + waitmessage + waitbuttonpress + callnative HideFieldMessageBoxInstant + releaseall end -Text_DisableAutoRun: +Text_DisabledAutoRun: .string "Autorun {COLOR RED}disabled{COLOR DARK_GREY}.$" -Text_EnableAutoRun: +Text_EnabledAutoRun: .string "Autorun {COLOR GREEN}enabled{COLOR DARK_GREY}.$" diff --git a/config.asm b/config.asm index 38414e1..f6d638e 100644 --- a/config.asm +++ b/config.asm @@ -69,6 +69,9 @@ ; New "Snakewood" logo .definelabel NEW_TITLE_SCREEN, 1 +; New Game speech uses the dialogue box instead of the normal menu box. +.definelabel BIRCH_SPEECH_DBOX, 1 + ; Bugfixes ; -------- diff --git a/include/field_control_avatar.h b/include/field_control_avatar.h index 984d0ce..6ce8be6 100644 --- a/include/field_control_avatar.h +++ b/include/field_control_avatar.h @@ -22,6 +22,5 @@ struct FieldInput u8 input_field_3; }; -extern const u8 EventScript_DisableAutoRun[]; -extern const u8 EventScript_EnableAutoRun[]; +extern const u8 EventScript_CloseAutorunMessage[]; extern bool8 gAutorunEnabled; diff --git a/linker/text.ld b/linker/text.ld index 7ef428b..ba01378 100644 --- a/linker/text.ld +++ b/linker/text.ld @@ -144,6 +144,7 @@ Menu_PrintText = 0x8071e50 | 1; Menu_EraseWindowRect = 0x8071e84 | 1; Menu_BlankWindowRect = 0x8071ebc | 1; Menu_DrawStdWindowFrame = 0x8071f08 | 1; +Menu_DisplayDialogueFrame = 0x8071ffc | 1; Menu_PrintTextPixelCoords = 0x80729d8 | 1; MenuPrint_RightAligned = 0x8072b4c | 1; MenuPrint_Centered = 0x8072bd8 | 1; diff --git a/main.asm b/main.asm index 62939fa..26d5148 100644 --- a/main.asm +++ b/main.asm @@ -52,6 +52,7 @@ .include "scripts/bugfixes/text_colors.asm" .include "scripts/autorun.asm" +.include "scripts/birch_speech.asm" .include "scripts/bag_expansion.asm" .include "scripts/colored_field_moves.asm" .include "scripts/colored_stats.asm" diff --git a/scripts/birch_speech.asm b/scripts/birch_speech.asm new file mode 100644 index 0000000..2104091 --- /dev/null +++ b/scripts/birch_speech.asm @@ -0,0 +1,73 @@ +.if BIRCH_SPEECH_DBOX + +.org 0x800A3A0 +.area 0x800A3AC - 0x800A3A0, 0x0 +bl 0x8071ffc +.endarea + +.org 0x800A3AE +mov r1, #2 +mov r2, #0xf + +.org 0x800A3F6 +mov r1, #2 +mov r2, #0xf + +.org 0x800A53C +mov r1, #2 +mov r2, #0xf + +.org 0x800a576 +.area 0x800a582 - 0x800a576, 0x0 +bl 0x8071ffc +.endarea + +.org 0x800a584 +mov r1, #2 +mov r2, #0xf + +.org 0x800a764 +.area 0x800a770 - 0x800a764, 0x0 +bl 0x8071ffc +.endarea + +.org 0x800a772 +mov r1, #2 +mov r2, #0xf + +.org 0x800a97c +.area 0x800a988 - 0x800a97c, 0x0 +bl 0x8071ffc +.endarea + +.org 0x800a98a +mov r1, #2 +mov r2, #0xf + +.org 0x800aaf4 +.area 0x800ab00 - 0x800aaf4, 0x0 +bl 0x8071ffc +.endarea + +.org 0x800ab0c +mov r1, #2 +mov r2, #0xf + +.org 0x800ad08 +.area 0x800ad14 - 0x800ad08, 0x0 +bl 0x8071ffc +.endarea + +.org 0x800ad20 +mov r1, #2 +mov r2, #0xf + +.org 0x800aeaa +.area 0x800aeb6 - 0x800aeaa, 0x0 +bl 0x8071ffc +.endarea + +.org 0x800aeb8 +mov r1, #2 +mov r2, #0xf +.endif \ No newline at end of file diff --git a/src/field_control_avatar.c b/src/field_control_avatar.c index 09d6ff7..4235036 100644 --- a/src/field_control_avatar.c +++ b/src/field_control_avatar.c @@ -1,6 +1,8 @@ #include "types.h" +#include "event_object_movement.h" #include "field_control_avatar.h" #include "field_message_box.h" +#include "field_player_avatar.h" #include "flags.h" #include "item_menu.h" #include "main.h" @@ -24,22 +26,27 @@ int ProcessPlayerFieldInput_Rest(struct FieldInput *input) return FALSE; } +#include "save_time_util.h" + +static const u8 sText_DisabledAutorun[] = _("Autorun {COLOR RED}disabled{COLOR DARK_GREY}."); +static const u8 sText_EnabledAutorun[] =_("Autorun {COLOR GREEN}enabled{COLOR DARK_GREY}."); + static bool8 EnableAutoRun(void) { if (!FlagGet(FLAG_SYS_B_DASH)) return FALSE; PlaySE(SE_SELECT); - if (gAutorunEnabled) - { - gAutorunEnabled = FALSE; - ScriptContext1_SetupScript(EventScript_DisableAutoRun); - } - else - { - gAutorunEnabled = TRUE; - ScriptContext1_SetupScript(EventScript_EnableAutoRun); - } + + ScriptContext2_Enable(); + FreezeObjectEvents(); + PlayerFreeze(); + StopPlayerAvatar(); + + gAutorunEnabled = !gAutorunEnabled; + + ShowFieldMessageInstant(gAutorunEnabled ? sText_EnabledAutorun : sText_DisabledAutorun); + ScriptContext1_SetupScript(EventScript_CloseAutorunMessage); return TRUE; } \ No newline at end of file diff --git a/src/field_message_box.c b/src/field_message_box.c index 00048fb..8372a18 100644 --- a/src/field_message_box.c +++ b/src/field_message_box.c @@ -73,4 +73,4 @@ void HideFieldMessageBoxInstant(void) TextWindow_EraseDialogueFrame(&gFieldMessageBoxWindow); sMessageBoxMode = FIELD_MESSAGE_BOX_HIDDEN; -} \ No newline at end of file +}