mirror of
https://github.com/pret/pmd-red.git
synced 2026-04-24 23:17:03 -05:00
dungeon menu stairs
This commit is contained in:
parent
7a865991b1
commit
2d0e962d9e
|
|
@ -6,498 +6,6 @@
|
|||
.text
|
||||
|
||||
|
||||
thumb_func_start ShowDungeonStairsMenu
|
||||
ShowDungeonStairsMenu:
|
||||
push {r4-r7,lr}
|
||||
mov r7, r10
|
||||
mov r6, r9
|
||||
mov r5, r8
|
||||
push {r5-r7}
|
||||
sub sp, 0xE4
|
||||
adds r7, r0, 0
|
||||
add r0, sp, 0x68
|
||||
mov r9, r0
|
||||
mov r1, sp
|
||||
adds r1, 0x6C
|
||||
str r1, [sp, 0xD0]
|
||||
mov r2, sp
|
||||
adds r2, 0x6E
|
||||
str r2, [sp, 0xD4]
|
||||
mov r0, sp
|
||||
adds r0, 0x70
|
||||
str r0, [sp, 0xD8]
|
||||
adds r1, 0xC
|
||||
str r1, [sp, 0xDC]
|
||||
adds r2, 0x22
|
||||
str r2, [sp, 0xE0]
|
||||
adds r0, 0x38
|
||||
str r0, [sp, 0xC8]
|
||||
subs r1, 0x18
|
||||
str r1, [sp, 0xC4]
|
||||
add r2, sp, 0xC0
|
||||
mov r10, r2
|
||||
ldr r5, _0806490C
|
||||
adds r0, r7, 0x4
|
||||
str r0, [sp, 0xCC]
|
||||
ldr r1, _08064910
|
||||
mov r8, r1
|
||||
movs r6, 0
|
||||
_08064834:
|
||||
movs r4, 0
|
||||
ldr r0, [sp, 0xC4]
|
||||
movs r1, 0
|
||||
movs r2, 0x60
|
||||
bl memset
|
||||
movs r0, 0x6
|
||||
str r0, [sp, 0x64]
|
||||
movs r0, 0x2
|
||||
mov r2, r9
|
||||
strh r0, [r2]
|
||||
strh r0, [r2, 0x2]
|
||||
movs r0, 0x12
|
||||
ldr r1, [sp, 0xD0]
|
||||
strh r0, [r1]
|
||||
movs r0, 0x4
|
||||
ldr r2, [sp, 0xD4]
|
||||
strh r0, [r2]
|
||||
movs r0, 0x10
|
||||
ldr r1, [sp, 0xD8]
|
||||
strh r0, [r1]
|
||||
mov r2, r10
|
||||
str r2, [sp, 0x74]
|
||||
movs r0, 0x3
|
||||
ldr r1, [sp, 0xDC]
|
||||
str r0, [r1, 0x4]
|
||||
ldr r2, [sp, 0xE0]
|
||||
str r0, [r2, 0x4]
|
||||
ldr r1, [sp, 0xC8]
|
||||
str r0, [r1, 0x4]
|
||||
mov r0, sp
|
||||
ldr r1, [sp, 0xC4]
|
||||
movs r2, 0x60
|
||||
bl memcpy
|
||||
bl PlayDungeonStartButtonSE
|
||||
adds r0, r7, 0x4
|
||||
mov r1, sp
|
||||
mov r2, r10
|
||||
bl sub_80649A0
|
||||
movs r0, 0x2E
|
||||
bl DungeonRunFrameActions
|
||||
adds r0, r7, 0
|
||||
bl sub_8064A18
|
||||
strh r4, [r5, 0x8]
|
||||
strh r4, [r5, 0xA]
|
||||
mov r0, sp
|
||||
movs r1, 0x16
|
||||
bl CreateDungeonMenuSubWindow
|
||||
_080648A0:
|
||||
adds r0, r5, 0
|
||||
bl AddMenuCursorSprite
|
||||
movs r0, 0x2E
|
||||
bl DungeonRunFrameActions
|
||||
mov r2, r8
|
||||
ldrh r1, [r2, 0x4]
|
||||
movs r0, 0x80
|
||||
ands r0, r1
|
||||
cmp r0, 0
|
||||
beq _080648C6
|
||||
movs r0, 0x1
|
||||
bl PlayDungeonCursorSE
|
||||
adds r0, r5, 0
|
||||
movs r1, 0x1
|
||||
bl MoveMenuCursorDownWrapAround
|
||||
_080648C6:
|
||||
mov r0, r8
|
||||
ldrh r1, [r0, 0x4]
|
||||
movs r0, 0x40
|
||||
ands r0, r1
|
||||
cmp r0, 0
|
||||
beq _080648E0
|
||||
movs r0, 0x1
|
||||
bl PlayDungeonCursorSE
|
||||
adds r0, r5, 0
|
||||
movs r1, 0x1
|
||||
bl MoveMenuCursorUpWrapAround
|
||||
_080648E0:
|
||||
mov r2, r8
|
||||
ldrh r1, [r2, 0x2]
|
||||
movs r0, 0x1
|
||||
ands r0, r1
|
||||
cmp r0, 0
|
||||
bne _080648F6
|
||||
adds r0, r5, 0
|
||||
adds r0, 0x29
|
||||
ldrb r0, [r0]
|
||||
cmp r0, 0
|
||||
beq _08064954
|
||||
_080648F6:
|
||||
movs r1, 0x18
|
||||
ldrsh r0, [r5, r1]
|
||||
cmp r0, 0x1
|
||||
bne _08064914
|
||||
bl PlayDungeonConfirmationSE
|
||||
ldr r0, [sp, 0xCC]
|
||||
bl sub_8064A3C
|
||||
movs r4, 0x2
|
||||
b _0806496E
|
||||
.align 2, 0
|
||||
_0806490C: .4byte gDungeonMenu
|
||||
_08064910: .4byte gRealInputs
|
||||
_08064914:
|
||||
movs r2, 0x18
|
||||
ldrsh r0, [r5, r2]
|
||||
bl CanSubMenuItemBeChosen
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
beq _08064950
|
||||
ldr r4, [r7, 0x70]
|
||||
adds r4, 0x44
|
||||
ldr r1, _0806494C
|
||||
movs r2, 0x18
|
||||
ldrsh r0, [r5, r2]
|
||||
lsls r0, 2
|
||||
adds r0, r1
|
||||
ldrh r1, [r0]
|
||||
adds r0, r4, 0
|
||||
bl SetMonsterActionFields
|
||||
bl PlayDungeonConfirmationSE
|
||||
strb r6, [r4, 0x4]
|
||||
strh r6, [r4, 0x8]
|
||||
strh r6, [r4, 0xA]
|
||||
strb r6, [r4, 0xC]
|
||||
strh r6, [r4, 0x10]
|
||||
strh r6, [r4, 0x12]
|
||||
movs r4, 0
|
||||
b _0806496E
|
||||
.align 2, 0
|
||||
_0806494C: .4byte gDungeonSubMenu
|
||||
_08064950:
|
||||
bl PlayDungeonCancelSE
|
||||
_08064954:
|
||||
mov r0, r8
|
||||
ldrh r1, [r0, 0x2]
|
||||
movs r0, 0x2
|
||||
ands r0, r1
|
||||
cmp r0, 0
|
||||
bne _08064968
|
||||
ldr r1, _08064998
|
||||
ldrb r0, [r1]
|
||||
cmp r0, 0
|
||||
beq _080648A0
|
||||
_08064968:
|
||||
bl PlayDungeonCancelSE
|
||||
movs r4, 0x1
|
||||
_0806496E:
|
||||
ldr r0, _0806499C
|
||||
bl AddMenuCursorSprite
|
||||
movs r0, 0x2E
|
||||
bl DungeonRunFrameActions
|
||||
cmp r4, 0x2
|
||||
bne _08064980
|
||||
b _08064834
|
||||
_08064980:
|
||||
movs r0, 0
|
||||
movs r1, 0
|
||||
bl sub_803EAF0
|
||||
add sp, 0xE4
|
||||
pop {r3-r5}
|
||||
mov r8, r3
|
||||
mov r9, r4
|
||||
mov r10, r5
|
||||
pop {r4-r7}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.align 2, 0
|
||||
_08064998: .4byte gUnknown_202EE3A
|
||||
_0806499C: .4byte gDungeonMenu
|
||||
thumb_func_end ShowDungeonStairsMenu
|
||||
|
||||
thumb_func_start sub_80649A0
|
||||
sub_80649A0:
|
||||
push {r4,r5,lr}
|
||||
sub sp, 0x4
|
||||
adds r0, r1, 0
|
||||
movs r3, 0
|
||||
movs r1, 0x1
|
||||
strb r1, [r2]
|
||||
strb r3, [r2, 0x1]
|
||||
movs r1, 0xB
|
||||
strb r1, [r2, 0x2]
|
||||
strb r3, [r2, 0x3]
|
||||
movs r1, 0x1
|
||||
bl DungeonShowWindows
|
||||
movs r0, 0
|
||||
bl sub_80073B8
|
||||
bl GetFloorType
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
cmp r0, 0x1
|
||||
beq _080649E4
|
||||
cmp r0, 0x1
|
||||
ble _080649D4
|
||||
cmp r0, 0x2
|
||||
beq _080649DC
|
||||
_080649D4:
|
||||
ldr r0, _080649D8
|
||||
b _080649E6
|
||||
.align 2, 0
|
||||
_080649D8: .4byte gUnknown_80FE70C
|
||||
_080649DC:
|
||||
ldr r0, _080649E0
|
||||
b _080649E6
|
||||
.align 2, 0
|
||||
_080649E0: .4byte gUnknown_80FE720
|
||||
_080649E4:
|
||||
ldr r0, _08064A14
|
||||
_080649E6:
|
||||
ldr r5, [r0]
|
||||
movs r4, 0
|
||||
str r4, [sp]
|
||||
movs r0, 0xC
|
||||
movs r1, 0
|
||||
adds r2, r5, 0
|
||||
movs r3, 0
|
||||
bl PrintStringOnWindow
|
||||
str r4, [sp]
|
||||
movs r0, 0x8
|
||||
movs r1, 0x12
|
||||
adds r2, r5, 0
|
||||
movs r3, 0
|
||||
bl PrintStringOnWindow
|
||||
movs r0, 0
|
||||
bl sub_80073E0
|
||||
add sp, 0x4
|
||||
pop {r4,r5}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.align 2, 0
|
||||
_08064A14: .4byte gUnknown_80FE724
|
||||
thumb_func_end sub_80649A0
|
||||
|
||||
thumb_func_start sub_8064A18
|
||||
sub_8064A18:
|
||||
push {lr}
|
||||
ldr r1, _08064A38
|
||||
movs r0, 0
|
||||
str r0, [r1]
|
||||
movs r0, 0x26
|
||||
movs r1, 0
|
||||
bl AddActionToDungeonSubMenu
|
||||
movs r0, 0xC
|
||||
movs r1, 0
|
||||
bl AddActionToDungeonSubMenu
|
||||
bl sub_8045064
|
||||
pop {r0}
|
||||
bx r0
|
||||
.align 2, 0
|
||||
_08064A38: .4byte gDungeonSubMenuItemsCount
|
||||
thumb_func_end sub_8064A18
|
||||
|
||||
thumb_func_start sub_8064A3C
|
||||
sub_8064A3C:
|
||||
push {r4-r7,lr}
|
||||
mov r7, r10
|
||||
mov r6, r9
|
||||
mov r5, r8
|
||||
push {r5-r7}
|
||||
sub sp, 0xE8
|
||||
mov r0, sp
|
||||
adds r0, 0x20
|
||||
str r0, [sp, 0xE4]
|
||||
add r1, sp, 0x80
|
||||
mov r10, r1
|
||||
add r0, sp, 0xE0
|
||||
mov r9, r0
|
||||
add r5, sp, 0x14
|
||||
_08064A58:
|
||||
mov r0, r10
|
||||
movs r1, 0
|
||||
movs r2, 0x60
|
||||
bl memset
|
||||
add r1, sp, 0x84
|
||||
movs r0, 0x6
|
||||
str r0, [r1]
|
||||
add r0, sp, 0x88
|
||||
movs r1, 0x2
|
||||
strh r1, [r0]
|
||||
strh r1, [r0, 0x2]
|
||||
add r1, sp, 0x8C
|
||||
movs r0, 0x1A
|
||||
strh r0, [r1]
|
||||
mov r0, sp
|
||||
adds r0, 0x8E
|
||||
movs r1, 0xC
|
||||
strh r1, [r0]
|
||||
add r0, sp, 0x90
|
||||
strh r1, [r0]
|
||||
add r0, sp, 0x94
|
||||
mov r1, r9
|
||||
str r1, [r0]
|
||||
add r0, sp, 0x98
|
||||
movs r1, 0x3
|
||||
str r1, [r0, 0x4]
|
||||
add r0, sp, 0xB0
|
||||
str r1, [r0, 0x4]
|
||||
add r0, sp, 0xC8
|
||||
str r1, [r0, 0x4]
|
||||
ldr r0, [sp, 0xE4]
|
||||
mov r1, r10
|
||||
movs r2, 0x60
|
||||
bl memcpy
|
||||
add r0, sp, 0x14
|
||||
bl sub_801317C
|
||||
movs r0, 0x1
|
||||
mov r1, r9
|
||||
strb r0, [r1]
|
||||
movs r0, 0
|
||||
strb r0, [r1, 0x1]
|
||||
movs r0, 0x10
|
||||
strb r0, [r1, 0x2]
|
||||
movs r0, 0
|
||||
strb r0, [r1, 0x3]
|
||||
ldr r0, [sp, 0xE4]
|
||||
movs r1, 0
|
||||
bl DungeonShowWindows
|
||||
bl GetFloorType
|
||||
adds r4, r0, 0
|
||||
lsls r4, 24
|
||||
lsrs r4, 24
|
||||
movs r0, 0
|
||||
bl sub_80073B8
|
||||
ldr r0, _08064B0C
|
||||
lsls r4, 2
|
||||
adds r0, r4, r0
|
||||
ldr r2, [r0]
|
||||
movs r1, 0
|
||||
str r1, [sp]
|
||||
movs r0, 0x10
|
||||
movs r3, 0
|
||||
bl PrintStringOnWindow
|
||||
ldr r0, _08064B10
|
||||
adds r4, r0
|
||||
ldr r4, [r4]
|
||||
movs r0, 0
|
||||
str r0, [sp]
|
||||
movs r0, 0x8
|
||||
movs r1, 0x18
|
||||
adds r2, r4, 0
|
||||
movs r3, 0
|
||||
bl PrintStringOnWindow
|
||||
movs r0, 0
|
||||
bl sub_80073E0
|
||||
adds r0, r4, 0
|
||||
add r1, sp, 0x4
|
||||
bl sub_8097DF0
|
||||
adds r6, r0, 0
|
||||
b _08064B28
|
||||
.align 2, 0
|
||||
_08064B0C: .4byte gUnknown_80F8104
|
||||
_08064B10: .4byte gUnknown_80F7F70
|
||||
_08064B14:
|
||||
movs r0, 0x2
|
||||
ands r0, r1
|
||||
cmp r0, 0
|
||||
bne _08064B22
|
||||
ldrb r0, [r5, 0x2]
|
||||
cmp r0, 0
|
||||
beq _08064B28
|
||||
_08064B22:
|
||||
bl PlayDungeonCancelSE
|
||||
b _08064BC8
|
||||
_08064B28:
|
||||
cmp r6, 0
|
||||
beq _08064B30
|
||||
bl ShowStatusDescriptionMenuArrow
|
||||
_08064B30:
|
||||
adds r0, r5, 0
|
||||
movs r1, 0
|
||||
bl nullsub_34
|
||||
movs r0, 0x16
|
||||
bl DungeonRunFrameActions
|
||||
ldr r0, _08064B78
|
||||
ldrh r1, [r0, 0x2]
|
||||
movs r0, 0x1
|
||||
ands r0, r1
|
||||
cmp r0, 0
|
||||
bne _08064B50
|
||||
ldrb r0, [r5, 0x1]
|
||||
cmp r0, 0
|
||||
beq _08064B14
|
||||
_08064B50:
|
||||
bl PlayDungeonConfirmationSE
|
||||
cmp r6, 0
|
||||
beq _08064BC8
|
||||
movs r4, 0
|
||||
cmp r4, r6
|
||||
blt _08064B60
|
||||
b _08064A58
|
||||
_08064B60:
|
||||
subs r1, r6, 0x1
|
||||
mov r8, r1
|
||||
_08064B64:
|
||||
lsls r0, r4, 2
|
||||
add r0, sp
|
||||
adds r0, 0x4
|
||||
ldr r0, [r0]
|
||||
adds r1, r5, 0
|
||||
bl ShowStatusDescriptionMenu
|
||||
adds r7, r4, 0x1
|
||||
b _08064B90
|
||||
.align 2, 0
|
||||
_08064B78: .4byte gRealInputs
|
||||
_08064B7C:
|
||||
movs r0, 0x2
|
||||
ands r0, r1
|
||||
cmp r0, 0
|
||||
bne _08064B8A
|
||||
ldrb r0, [r5, 0x2]
|
||||
cmp r0, 0
|
||||
beq _08064B90
|
||||
_08064B8A:
|
||||
bl PlayDungeonCancelSE
|
||||
b _08064BBC
|
||||
_08064B90:
|
||||
cmp r4, r8
|
||||
bge _08064B98
|
||||
bl ShowStatusDescriptionMenuArrow
|
||||
_08064B98:
|
||||
adds r0, r5, 0
|
||||
movs r1, 0
|
||||
bl nullsub_34
|
||||
movs r0, 0x16
|
||||
bl DungeonRunFrameActions
|
||||
ldr r0, _08064BC4
|
||||
ldrh r1, [r0, 0x2]
|
||||
movs r0, 0x1
|
||||
ands r0, r1
|
||||
cmp r0, 0
|
||||
bne _08064BB8
|
||||
ldrb r0, [r5, 0x1]
|
||||
cmp r0, 0
|
||||
beq _08064B7C
|
||||
_08064BB8:
|
||||
bl PlayDungeonConfirmationSE
|
||||
_08064BBC:
|
||||
adds r4, r7, 0
|
||||
cmp r4, r6
|
||||
blt _08064B64
|
||||
b _08064A58
|
||||
.align 2, 0
|
||||
_08064BC4: .4byte gRealInputs
|
||||
_08064BC8:
|
||||
movs r0, 0
|
||||
movs r1, 0
|
||||
bl sub_803EAF0
|
||||
add sp, 0xE8
|
||||
pop {r3-r5}
|
||||
mov r8, r3
|
||||
mov r9, r4
|
||||
mov r10, r5
|
||||
pop {r4-r7}
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end sub_8064A3C
|
||||
|
||||
thumb_func_start ShowDungeonOthersMenu
|
||||
ShowDungeonOthersMenu:
|
||||
push {r4-r7,lr}
|
||||
|
|
|
|||
|
|
@ -4,9 +4,6 @@
|
|||
@ CreateFieldItemMenu - sub_8062CA8
|
||||
|
||||
|
||||
@ ???
|
||||
.align 2,0
|
||||
.string "pksdir0\0"
|
||||
|
||||
@ CreateFieldDungeonMenu - CreateFieldOthersMenu
|
||||
.align 2,0
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ enum DungeonAction
|
|||
// Some actions are different between the leader and AI-controlled Pokémon.
|
||||
ACTION_PICK_UP_PLAYER = 0x9, // Picking up an item underfoot.
|
||||
ACTION_THROW_ITEM_PLAYER = 0xB,
|
||||
ACTION_SHOW_TRAP_INFO = 0xC,
|
||||
ACTION_SHOW_INFO = 0xC,
|
||||
ACTION_EAT_BERRY_SEED_DRINK = 0xD,
|
||||
ACTION_USE_TM = 0x12,
|
||||
ACTION_TALK_FIELD = 0x13, // Talking to another Pokémon by facing them and interacting.
|
||||
|
|
|
|||
8
include/dungeon_menu_stairs.h
Normal file
8
include/dungeon_menu_stairs.h
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
#ifndef GUARD_DUNGEON_MENU_STAIRS_H
|
||||
#define GUARD_DUNGEON_MENU_STAIRS_H
|
||||
|
||||
#include "structs/dungeon_entity.h"
|
||||
|
||||
void ShowDungeonStairsMenu(Entity *mon);
|
||||
|
||||
#endif
|
||||
|
|
@ -232,6 +232,7 @@ SECTIONS {
|
|||
src/dungeon_menu_team.o(.text);
|
||||
src/dungeon_menu_moves.o(.text);
|
||||
src/dungeon_menu_tile.o(.text);
|
||||
src/dungeon_menu_stairs.o(.text);
|
||||
asm/code_805D8C8.o(.text);
|
||||
src/code_8066D04.o(.text);
|
||||
src/code_805D8C8.o(.text);
|
||||
|
|
@ -552,6 +553,7 @@ SECTIONS {
|
|||
src/dungeon_menu_team.o(.rodata);
|
||||
src/dungeon_menu_moves.o(.rodata);
|
||||
src/dungeon_menu_tile.o(.rodata);
|
||||
src/dungeon_menu_stairs.o(.rodata);
|
||||
data/data_8106A4C.o(.rodata);
|
||||
src/code_8066D04.o(.rodata);
|
||||
data/data_8106A4C_2.o(.rodata);
|
||||
|
|
|
|||
|
|
@ -47,6 +47,7 @@
|
|||
#include "dungeon_menu_team.h"
|
||||
#include "dungeon_menu_moves.h"
|
||||
#include "dungeon_menu_tile.h"
|
||||
#include "dungeon_menu_stairs.h"
|
||||
#include "constants/dungeon.h"
|
||||
#include "constants/status.h"
|
||||
#include "constants/tactic.h"
|
||||
|
|
@ -71,7 +72,6 @@ extern void sub_8045DB4(DungeonPos *, u32);
|
|||
bool8 sub_807EF48(void);
|
||||
void sub_806A2BC(Entity *a0, u8 a1);
|
||||
bool8 sub_80701A4(Entity *a0);
|
||||
void ShowDungeonStairsMenu(Entity *a0);
|
||||
void sub_803E708(s32 a0, s32 a1);
|
||||
void sub_8040A78(void);
|
||||
void ShowDungeonOthersMenu(void);
|
||||
|
|
|
|||
243
src/dungeon_menu_stairs.c
Normal file
243
src/dungeon_menu_stairs.c
Normal file
|
|
@ -0,0 +1,243 @@
|
|||
#include "global.h"
|
||||
#include "globaldata.h"
|
||||
#include "dungeon_menu_stairs.h"
|
||||
#include "dungeon_menu_team.h"
|
||||
#include "dungeon_menu_moves.h"
|
||||
#include "dungeon_submenu.h"
|
||||
#include "dungeon.h"
|
||||
#include "text.h"
|
||||
#include "menu_input.h"
|
||||
#include "input.h"
|
||||
#include "code_8044CC8.h"
|
||||
#include "dungeon_action.h"
|
||||
#include "dungeon_util.h"
|
||||
#include "dungeon_map_access.h"
|
||||
#include "code_8045A00.h"
|
||||
#include "code_8097DD0.h"
|
||||
#include "dungeon_generation.h"
|
||||
|
||||
extern void PlayDungeonStartButtonSE(void);
|
||||
extern void PlayDungeonCancelSE(void);
|
||||
extern void PlayDungeonConfirmationSE(void);
|
||||
extern void PlayDungeonCursorSE(u8 param_1);
|
||||
extern void sub_803EAF0(u32, u8 *);
|
||||
extern bool8 CanSubMenuItemBeChosen(s32 param_1);
|
||||
extern void DungeonRunFrameActions(u32 a0);
|
||||
extern void DungeonShowWindows(WindowTemplates *a0, bool8 a1);
|
||||
extern void AddActionToDungeonSubMenu(u16 actionId, u8 param_2);
|
||||
extern void sub_8045064(void);
|
||||
extern u8 GetFloorType(void);
|
||||
|
||||
extern MenuInputStruct gDungeonMenu;
|
||||
extern s32 gDungeonSubMenuItemsCount;
|
||||
|
||||
extern const u8 *const gUnknown_80FE70C;
|
||||
extern const u8 *const gUnknown_80FE720;
|
||||
extern const u8 *const gUnknown_80FE724;
|
||||
extern const u8 *const gUnknown_80F8104[];
|
||||
extern const u8 *const gUnknown_80F7F70[];
|
||||
|
||||
static void ShowAndPrintOnStairsMenu(DungeonPos *pos, WindowTemplates *windows, WindowHeader *header);
|
||||
static void AddStairsSubMenuOptions(Entity *mon);
|
||||
static void ShowStairsDescription(DungeonPos *pos);
|
||||
|
||||
// Pretty much a copy of ShowDungeonTileMenu
|
||||
void ShowDungeonStairsMenu(Entity *mon)
|
||||
{
|
||||
while (1) {
|
||||
s32 inputAction = 0;
|
||||
WindowHeader header;
|
||||
WindowTemplates windows = {
|
||||
.id = {
|
||||
[0] = {
|
||||
.type = WINDOW_TYPE_WITH_HEADER,
|
||||
.pos = {2, 2},
|
||||
.width = 18,
|
||||
.height = 4,
|
||||
.unk10 = 16,
|
||||
.unk12 = 0,
|
||||
.header = &header,
|
||||
},
|
||||
[1] = WINDOW_DUMMY,
|
||||
[2] = WINDOW_DUMMY,
|
||||
[3] = WINDOW_DUMMY,
|
||||
}
|
||||
};
|
||||
|
||||
PlayDungeonStartButtonSE();
|
||||
ShowAndPrintOnStairsMenu(&mon->pos, &windows, &header);
|
||||
DungeonRunFrameActions(0x2E);
|
||||
AddStairsSubMenuOptions(mon);
|
||||
gDungeonMenu.unk8.x = 0;
|
||||
gDungeonMenu.unk8.y = 0;
|
||||
CreateDungeonMenuSubWindow(&windows.id[0], 22);
|
||||
|
||||
while (1) {
|
||||
AddMenuCursorSprite(&gDungeonMenu);
|
||||
DungeonRunFrameActions(0x2E);
|
||||
if (gRealInputs.repeated & DPAD_DOWN) {
|
||||
PlayDungeonCursorSE(TRUE);
|
||||
MoveMenuCursorDownWrapAround(&gDungeonMenu, TRUE);
|
||||
}
|
||||
if (gRealInputs.repeated & DPAD_UP) {
|
||||
PlayDungeonCursorSE(TRUE);
|
||||
MoveMenuCursorUpWrapAround(&gDungeonMenu, TRUE);
|
||||
}
|
||||
|
||||
if ((gRealInputs.pressed & A_BUTTON) || gDungeonMenu.unk28.a_button) {
|
||||
if (gDungeonMenu.menuIndex == 1) {
|
||||
PlayDungeonConfirmationSE();
|
||||
ShowStairsDescription(&mon->pos);
|
||||
inputAction = 2;
|
||||
break;
|
||||
}
|
||||
else if (CanSubMenuItemBeChosen(gDungeonMenu.menuIndex)) {
|
||||
ActionContainer *action = &GetEntInfo(mon)->action;
|
||||
|
||||
SetMonsterActionFields(action, gDungeonSubMenu[gDungeonMenu.menuIndex].actionId);
|
||||
PlayDungeonConfirmationSE();
|
||||
action->actionParameters[0].actionUseIndex = 0;
|
||||
action->actionParameters[0].itemPos.x = 0;
|
||||
action->actionParameters[0].itemPos.y = 0;
|
||||
action->actionParameters[1].actionUseIndex = 0;
|
||||
action->actionParameters[1].itemPos.x = 0;
|
||||
action->actionParameters[1].itemPos.y = 0;
|
||||
inputAction = 0;
|
||||
break;
|
||||
}
|
||||
PlayDungeonCancelSE();
|
||||
}
|
||||
if ((gRealInputs.pressed & B_BUTTON) || gDungeonMenu.unk28.b_button) {
|
||||
PlayDungeonCancelSE();
|
||||
inputAction = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
AddMenuCursorSprite(&gDungeonMenu);
|
||||
DungeonRunFrameActions(0x2E);
|
||||
if (inputAction != 2)
|
||||
break;
|
||||
}
|
||||
|
||||
sub_803EAF0(0, 0);
|
||||
}
|
||||
|
||||
static void ShowAndPrintOnStairsMenu(DungeonPos *pos, WindowTemplates *windows, WindowHeader *header)
|
||||
{
|
||||
const u8 *str;
|
||||
|
||||
header->count = 1;
|
||||
header->currId = 0;
|
||||
header->width = 11;
|
||||
header->f3 = 0;
|
||||
DungeonShowWindows(windows, TRUE);
|
||||
sub_80073B8(0);
|
||||
switch (GetFloorType()) {
|
||||
default:
|
||||
case FLOOR_TYPE_NORMAL:
|
||||
str = gUnknown_80FE70C;
|
||||
break;
|
||||
case FLOOR_TYPE_RESCUE:
|
||||
str = gUnknown_80FE720;
|
||||
break;
|
||||
case FLOOR_TYPE_FIXED:
|
||||
str = gUnknown_80FE724;
|
||||
break;
|
||||
}
|
||||
PrintStringOnWindow(12, 0, str, 0, '\0');
|
||||
PrintStringOnWindow(8, 18, str, 0, '\0');
|
||||
sub_80073E0(0);
|
||||
}
|
||||
|
||||
static void AddStairsSubMenuOptions(Entity *mon)
|
||||
{
|
||||
gDungeonSubMenuItemsCount = 0;
|
||||
AddActionToDungeonSubMenu(ACTION_STAIRS, 0);
|
||||
AddActionToDungeonSubMenu(ACTION_SHOW_INFO, 0);
|
||||
sub_8045064();
|
||||
}
|
||||
|
||||
// Again, almost identical to its Tile counterpart.
|
||||
static void ShowStairsDescription(DungeonPos *pos)
|
||||
{
|
||||
while (1) {
|
||||
u8 floorType;
|
||||
bool8 bPress;
|
||||
struct subStruct_203B240 *statuses[4];
|
||||
MenuInputStructSub menuSub;
|
||||
WindowHeader header;
|
||||
WindowTemplates windows = {
|
||||
.id = {
|
||||
[0] = {
|
||||
.type = WINDOW_TYPE_WITH_HEADER,
|
||||
.pos = {2, 2},
|
||||
.width = 26,
|
||||
.height = 12,
|
||||
.unk10 = 12,
|
||||
.unk12 = 0,
|
||||
.header = &header,
|
||||
},
|
||||
[1] = WINDOW_DUMMY,
|
||||
[2] = WINDOW_DUMMY,
|
||||
[3] = WINDOW_DUMMY,
|
||||
}
|
||||
};
|
||||
s32 i, statusesCount;
|
||||
|
||||
sub_801317C(&menuSub);
|
||||
header.count = 1;
|
||||
header.currId = 0;
|
||||
header.width = 16;
|
||||
header.f3 = 0;
|
||||
|
||||
DungeonShowWindows(&windows, FALSE);
|
||||
floorType = GetFloorType();
|
||||
sub_80073B8(0);
|
||||
PrintStringOnWindow(16, 0, gUnknown_80F8104[floorType], 0, '\0');
|
||||
PrintStringOnWindow(8, 24, gUnknown_80F7F70[floorType], 0, '\0');
|
||||
sub_80073E0(0);
|
||||
statusesCount = sub_8097DF0(gUnknown_80F7F70[floorType], statuses);
|
||||
while (1) {
|
||||
if (statusesCount != 0) {
|
||||
ShowStatusDescriptionMenuArrow();
|
||||
}
|
||||
nullsub_34(&menuSub, 0);
|
||||
DungeonRunFrameActions(0x16);
|
||||
if ((gRealInputs.pressed & A_BUTTON) || menuSub.a_button) {
|
||||
PlayDungeonConfirmationSE();
|
||||
bPress = FALSE;
|
||||
break;
|
||||
}
|
||||
if ((gRealInputs.pressed & B_BUTTON) || menuSub.b_button) {
|
||||
PlayDungeonCancelSE();
|
||||
bPress = TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (bPress || statusesCount == 0)
|
||||
break;
|
||||
|
||||
for (i = 0; i < statusesCount; i++) {
|
||||
ShowStatusDescriptionMenu(statuses[i], &menuSub);
|
||||
while (1) {
|
||||
if (i < statusesCount - 1) {
|
||||
ShowStatusDescriptionMenuArrow();
|
||||
}
|
||||
nullsub_34(&menuSub, 0);
|
||||
DungeonRunFrameActions(0x16);
|
||||
if ((gRealInputs.pressed & A_BUTTON) || menuSub.a_button) {
|
||||
PlayDungeonConfirmationSE();
|
||||
break;
|
||||
}
|
||||
if ((gRealInputs.pressed & B_BUTTON) || menuSub.b_button) {
|
||||
PlayDungeonCancelSE();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sub_803EAF0(0, 0);
|
||||
}
|
||||
|
||||
|
|
@ -143,7 +143,7 @@ static void AddTileSubMenuOptions(Entity *mon)
|
|||
{
|
||||
gDungeonSubMenuItemsCount = 0;
|
||||
AddActionToDungeonSubMenu(ACTION_STEPPED_ON_TRAP, 0);
|
||||
AddActionToDungeonSubMenu(ACTION_SHOW_TRAP_INFO, 0);
|
||||
AddActionToDungeonSubMenu(ACTION_SHOW_INFO, 0);
|
||||
sub_8045064();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user