From b6f53bad329cb521c76da4c8fcb6b201c788b807 Mon Sep 17 00:00:00 2001 From: robojumper Date: Sun, 21 Dec 2025 21:33:53 +0100 Subject: [PATCH 01/11] d_lyt_deposit WIP --- config/SOUE01/splits.txt | 2 +- config/SOUE01/symbols.txt | 247 ++++---- configure.py | 4 +- include/d/d_cs_base.h | 8 + include/d/lyt/d_lyt_cursor_stick.h | 8 + include/d/lyt/d_lyt_deposit_box_cursor.h | 55 ++ include/d/lyt/d_lyt_deposit_stock.h | 113 ++++ include/d/lyt/d_lyt_util_items.h | 7 +- src/d/lyt/d_lyt_deposit_box_cursor.cpp | 203 +++++++ src/d/lyt/d_lyt_deposit_stock.cpp | 682 ++++++++++++++++++++++ src/d/lyt/d_lyt_pause_disp_00.cpp | 4 +- src/d/lyt/meter/d_lyt_meter_minus_btn.cpp | 10 +- 12 files changed, 1214 insertions(+), 129 deletions(-) create mode 100644 include/d/lyt/d_lyt_deposit_box_cursor.h create mode 100644 include/d/lyt/d_lyt_deposit_stock.h create mode 100644 src/d/lyt/d_lyt_deposit_box_cursor.cpp create mode 100644 src/d/lyt/d_lyt_deposit_stock.cpp diff --git a/config/SOUE01/splits.txt b/config/SOUE01/splits.txt index 5770f1f3..638e95b8 100644 --- a/config/SOUE01/splits.txt +++ b/config/SOUE01/splits.txt @@ -1026,7 +1026,7 @@ d/lyt/d_lyt_deposit_stock.cpp: .sdata2 start:0x8057A058 end:0x8057A060 .bss start:0x805B1430 end:0x805B1470 -d/lyt/d_lyt_deposit_box.cpp: +d/lyt/d_lyt_deposit_box_cursor.cpp: .text start:0x801578B0 end:0x80158288 align:16 .rodata start:0x804E8218 end:0x804E8228 .data start:0x80524BC8 end:0x80524CD0 diff --git a/config/SOUE01/symbols.txt b/config/SOUE01/symbols.txt index 36f66bc8..9205361c 100644 --- a/config/SOUE01/symbols.txt +++ b/config/SOUE01/symbols.txt @@ -8646,65 +8646,65 @@ __dt__33sFStateID_c<18dLytSkyGaugeMain_c>Fv = .text:0x80155AF0; // type:function __dt__29sFStateID_c<14dLytSkyGauge_c>Fv = .text:0x80155B50; // type:function size:0x58 scope:weak isSameName__29sFStateID_c<14dLytSkyGauge_c>CFPCc = .text:0x80155BB0; // type:function size:0x88 scope:weak isSameName__33sFStateID_c<18dLytSkyGaugeMain_c>CFPCc = .text:0x80155C40; // type:function size:0x88 scope:weak -fn_80155CD0 = .text:0x80155CD0; // type:function size:0x4 -fn_80155CE0 = .text:0x80155CE0; // type:function size:0xC -fn_80155CF0 = .text:0x80155CF0; // type:function size:0x4 -fn_80155D00 = .text:0x80155D00; // type:function size:0x1EC -fn_80155EF0 = .text:0x80155EF0; // type:function size:0x10 -fn_80155F00 = .text:0x80155F00; // type:function size:0x114 -fn_80156020 = .text:0x80156020; // type:function size:0x10 -fn_80156030 = .text:0x80156030; // type:function size:0xE4 -fn_80156120 = .text:0x80156120; // type:function size:0x164 -fn_80156290 = .text:0x80156290; // type:function size:0x15C -fn_801563F0 = .text:0x801563F0; // type:function size:0xE0 -fn_801564D0 = .text:0x801564D0; // type:function size:0x28 -fn_80156500 = .text:0x80156500; // type:function size:0x28 -fn_80156530 = .text:0x80156530; // type:function size:0xE0 -fn_80156610 = .text:0x80156610; // type:function size:0x3D4 -fn_801569F0 = .text:0x801569F0; // type:function size:0x88 -fn_80156A80 = .text:0x80156A80; // type:function size:0x1E0 -fn_80156C60 = .text:0x80156C60; // type:function size:0x14 -fn_80156C80 = .text:0x80156C80; // type:function size:0x58 -fn_80156CE0 = .text:0x80156CE0; // type:function size:0xD8 -fn_80156DC0 = .text:0x80156DC0; // type:function size:0xDC -fn_80156EA0 = .text:0x80156EA0; // type:function size:0x1D4 -fn_80157080 = .text:0x80157080; // type:function size:0x14 -fn_801570A0 = .text:0x801570A0; // type:function size:0x54 -fn_80157100 = .text:0x80157100; // type:function size:0x54 -fn_80157160 = .text:0x80157160; // type:function size:0x58 -fn_801571C0 = .text:0x801571C0; // type:function size:0xC -fn_801571D0 = .text:0x801571D0; // type:function size:0x18 -fn_801571F0 = .text:0x801571F0; // type:function size:0x48 -fn_80157240 = .text:0x80157240; // type:function size:0xC -fn_80157250 = .text:0x80157250; // type:function size:0x48 -fn_801572A0 = .text:0x801572A0; // type:function size:0x10 -fn_801572B0 = .text:0x801572B0; // type:function size:0x8 -fn_801572C0 = .text:0x801572C0; // type:function size:0x8 -fn_801572D0 = .text:0x801572D0; // type:function size:0x8 -fn_801572E0 = .text:0x801572E0; // type:function size:0x11C -fn_80157400 = .text:0x80157400; // type:function size:0xA4 -fn_801574B0 = .text:0x801574B0; // type:function size:0xA0 -fn_80157550 = .text:0x80157550; // type:function size:0x6C -fn_801575C0 = .text:0x801575C0; // type:function size:0x58 -fn_80157620 = .text:0x80157620; // type:function size:0x30 -fn_80157650 = .text:0x80157650; // type:function size:0x30 -fn_80157680 = .text:0x80157680; // type:function size:0x30 -LytDepositStock__initStates = .text:0x801576B0; // type:function size:0x10C -LytDepositStock__state_dtor = .text:0x801577C0; // type:function size:0x58 -fn_80157820 = .text:0x80157820; // type:function size:0x88 -fn_801578B0 = .text:0x801578B0; // type:function size:0x124 -fn_801579E0 = .text:0x801579E0; // type:function size:0x74 -fn_80157A60 = .text:0x80157A60; // type:function size:0x34 -fn_80157AA0 = .text:0x80157AA0; // type:function size:0xCC -fn_80157B70 = .text:0x80157B70; // type:function size:0x14C -fn_80157CC0 = .text:0x80157CC0; // type:function size:0x210 -fn_80157ED0 = .text:0x80157ED0; // type:function size:0x17C -fn_80158050 = .text:0x80158050; // type:function size:0x44 -fn_801580A0 = .text:0x801580A0; // type:function size:0xC -fn_801580B0 = .text:0x801580B0; // type:function size:0x1A8 -fn_80158260 = .text:0x80158260; // type:function size:0x8 -fn_80158270 = .text:0x80158270; // type:function size:0x8 -fn_80158280 = .text:0x80158280; // type:function size:0x8 +initializeState_None__18dLytDepositStock_cFv = .text:0x80155CD0; // type:function size:0x4 +executeState_None__18dLytDepositStock_cFv = .text:0x80155CE0; // type:function size:0xC +finalizeState_None__18dLytDepositStock_cFv = .text:0x80155CF0; // type:function size:0x4 +build__18dLytDepositStock_cFPQ23d2d10ResAccIf_c = .text:0x80155D00; // type:function size:0x1EC +changeState__87sStateMgr_c<18dLytDepositStock_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>FRC12sStateIDIf_c = .text:0x80155EF0; // type:function size:0x10 scope:weak +execute__18dLytDepositStock_cFv = .text:0x80155F00; // type:function size:0x114 +executeState__87sStateMgr_c<18dLytDepositStock_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>Fv = .text:0x80156020; // type:function size:0x10 scope:weak +remove__18dLytDepositStock_cFv = .text:0x80156030; // type:function size:0xE4 +initIcons__18dLytDepositStock_cFv = .text:0x80156120; // type:function size:0x164 +loadItems__18dLytDepositStock_cFl = .text:0x80156290; // type:function size:0x15C +loadIcon__18dLytDepositStock_cFl = .text:0x801563F0; // type:function size:0xE0 +nextPage__18dLytDepositStock_cFb = .text:0x801564D0; // type:function size:0x28 +prevPage__18dLytDepositStock_cFb = .text:0x80156500; // type:function size:0x28 +fn_80156530__18dLytDepositStock_cFb = .text:0x80156530; // type:function size:0xE0 +handleNavOrPoint__18dLytDepositStock_cFv = .text:0x80156610; // type:function size:0x3D4 +navigateOffIcon__18dLytDepositStock_cFv = .text:0x801569F0; // type:function size:0x88 +checkNav__18dLytDepositStock_cFv = .text:0x80156A80; // type:function size:0x1E0 +getCurrentSlot__18dLytDepositStock_cCFv = .text:0x80156C60; // type:function size:0x14 +setItem__18dLytDepositStock_cFll = .text:0x80156C80; // type:function size:0x58 +realizeItem__18dLytDepositStock_cFl = .text:0x80156CE0; // type:function size:0xD8 +selectNavTarget__18dLytDepositStock_cFl = .text:0x80156DC0; // type:function size:0xDC +pickUpItem__18dLytDepositStock_cFlb = .text:0x80156EA0; // type:function size:0x1D4 +navigateToPouch__18dLytDepositStock_cFv = .text:0x80157080; // type:function size:0x14 +navigateToSell__18dLytDepositStock_cFv = .text:0x801570A0; // type:function size:0x54 +navigateToSort__18dLytDepositStock_cFv = .text:0x80157100; // type:function size:0x54 +navigateToFinish__18dLytDepositStock_cFv = .text:0x80157160; // type:function size:0x58 +saveArrowDirection__18dLytDepositStock_cFv = .text:0x801571C0; // type:function size:0xC +navigateToArrow__18dLytDepositStock_cFl = .text:0x801571D0; // type:function size:0x18 +restoreArrowDirection__18dLytDepositStock_cFv = .text:0x801571F0; // type:function size:0x48 +navigateToItem__18dLytDepositStock_cFv = .text:0x80157240; // type:function size:0xC +handleSpecialNavMode__18dLytDepositStock_cFv = .text:0x80157250; // type:function size:0x48 +isNavModeItem__18dLytDepositStock_cCFv = .text:0x801572A0; // type:function size:0x10 +getName__18dLytDepositStock_cCFv = .text:0x801572B0; // type:function size:0x8 scope:weak +getLyt__18dLytDepositStock_cFv = .text:0x801572C0; // type:function size:0x8 scope:weak +getPane__18dLytDepositStock_cFv = .text:0x801572D0; // type:function size:0x8 scope:weak +__dt__18dLytDepositStock_cFv = .text:0x801572E0; // type:function size:0x11C scope:weak +__dt__57sFStateMgr_c<18dLytDepositStock_c,20sStateMethodUsr_FI_c>Fv = .text:0x80157400; // type:function size:0xA4 scope:weak +__dt__87sStateMgr_c<18dLytDepositStock_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>Fv = .text:0x801574B0; // type:function size:0xA0 scope:weak +__dt__34sFStateFct_c<18dLytDepositStock_c>Fv = .text:0x80157550; // type:function size:0x6C scope:weak +__dt__31sFState_c<18dLytDepositStock_c>Fv = .text:0x801575C0; // type:function size:0x58 scope:weak +finalizeState__33sFStateID_c<18dLytDepositStock_c>CFR18dLytDepositStock_c = .text:0x80157620; // type:function size:0x30 scope:weak +executeState__33sFStateID_c<18dLytDepositStock_c>CFR18dLytDepositStock_c = .text:0x80157650; // type:function size:0x30 scope:weak +initializeState__33sFStateID_c<18dLytDepositStock_c>CFR18dLytDepositStock_c = .text:0x80157680; // type:function size:0x30 scope:weak +__sinit_\d_lyt_deposit_stock_cpp = .text:0x801576B0; // type:function size:0x10C scope:local +__dt__33sFStateID_c<18dLytDepositStock_c>Fv = .text:0x801577C0; // type:function size:0x58 scope:weak +isSameName__33sFStateID_c<18dLytDepositStock_c>CFPCc = .text:0x80157820; // type:function size:0x88 scope:weak +build__22dLytDepositBoxCursor_cFPQ23d2d10ResAccIf_c = .text:0x801578B0; // type:function size:0x124 +execute__22dLytDepositBoxCursor_cFv = .text:0x801579E0; // type:function size:0x74 +draw__22dLytDepositBoxCursor_cFv = .text:0x80157A60; // type:function size:0x34 +remove__22dLytDepositBoxCursor_cFv = .text:0x80157AA0; // type:function size:0xCC +initIcon__22dLytDepositBoxCursor_cFv = .text:0x80157B70; // type:function size:0x14C +realizeNav__22dLytDepositBoxCursor_cFv = .text:0x80157CC0; // type:function size:0x210 +init__22dLytDepositBoxCursor_cFlllb = .text:0x80157ED0; // type:function size:0x17C +updateSlot__22dLytDepositBoxCursor_cFlllb = .text:0x80158050; // type:function size:0x44 +fn_801580A0__22dLytDepositBoxCursor_cFv = .text:0x801580A0; // type:function size:0xC +__dt__22dLytDepositBoxCursor_cFv = .text:0x801580B0; // type:function size:0x1A8 scope:weak +getName__22dLytDepositBoxCursor_cCFv = .text:0x80158260; // type:function size:0x8 scope:weak +getLyt__22dLytDepositBoxCursor_cFv = .text:0x80158270; // type:function size:0x8 scope:weak +getPane__22dLytDepositBoxCursor_cFv = .text:0x80158280; // type:function size:0x8 scope:weak fn_80158290 = .text:0x80158290; // type:function size:0x4 fn_801582A0 = .text:0x801582A0; // type:function size:0x134 fn_801583E0 = .text:0x801583E0; // type:function size:0x4 @@ -9131,13 +9131,13 @@ fn_80166C50 = .text:0x80166C50; // type:function size:0x48 fn_80166CA0 = .text:0x80166CA0; // type:function size:0x48 getPouchItemNumberColor__Flb = .text:0x80166CF0; // type:function size:0x84 isPouchBocoburinLocked__Fv = .text:0x80166D80; // type:function size:0x34 -getShieldDurability__Flb = .text:0x80166DC0; // type:function size:0xC8 -fn_80166E90 = .text:0x80166E90; // type:function size:0x3C -fn_80166ED0 = .text:0x80166ED0; // type:function size:0x68 -fn_80166F40 = .text:0x80166F40; // type:function size:0x7C +getPouchShieldDurability__Flb = .text:0x80166DC0; // type:function size:0xC8 +getDepositItemForSlot__Fl = .text:0x80166E90; // type:function size:0x3C +getDepositItemAmount__Fl = .text:0x80166ED0; // type:function size:0x68 +getDepositItemNumberColor__Fl = .text:0x80166F40; // type:function size:0x7C fn_80166FC0 = .text:0x80166FC0; // type:function size:0x50 fn_80167010 = .text:0x80167010; // type:function size:0x54 -fn_80167070 = .text:0x80167070; // type:function size:0xD4 +getDepositShieldDurability__Fl = .text:0x80167070; // type:function size:0xD4 fn_80167150 = .text:0x80167150; // type:function size:0xF0 getBWheelItemIdForIndex__Fl = .text:0x80167240; // type:function size:0x24 fn_80167270 = .text:0x80167270; // type:function size:0x24 @@ -28313,8 +28313,8 @@ lbl_804E7FF8 = .rodata:0x804E7FF8; // type:object size:0xD0 data:4byte lbl_804E80C8 = .rodata:0x804E80C8; // type:object size:0x30 brlanMap = .rodata:0x804E80F8; // type:object size:0x40 scope:local data:4byte brlanMap = .rodata:0x804E8138; // type:object size:0x18 scope:local data:4byte -lbl_804E8150 = .rodata:0x804E8150; // type:object size:0xC8 data:4byte -lbl_804E8218 = .rodata:0x804E8218; // type:object size:0x10 data:4byte +brlanMap = .rodata:0x804E8150; // type:object size:0xC8 scope:local data:4byte +brlanMap = .rodata:0x804E8218; // type:object size:0x10 scope:local data:4byte lbl_804E8228 = .rodata:0x804E8228; // type:object size:0x20 data:4byte brlanMap = .rodata:0x804E8248; // type:object size:0x10 scope:local data:4byte sNavTable1 = .rodata:0x804E8258; // type:object size:0x128 scope:local @@ -34444,47 +34444,56 @@ __vt__31sFState_c<18dLytSkyGaugeMain_c> = .data:0x80524640; // type:object size: @7568 = .data:0x805248A0; // type:object size:0x1C scope:local data:string __vt__29sFStateID_c<14dLytSkyGauge_c> = .data:0x805248BC; // type:object size:0x34 scope:weak __vt__33sFStateID_c<18dLytSkyGaugeMain_c> = .data:0x805248F0; // type:object size:0x34 scope:weak -lbl_80524928 = .data:0x80524928; // type:object size:0x1C data:string -lbl_80524944 = .data:0x80524944; // type:object size:0xB data:string -lbl_80524950 = .data:0x80524950; // type:object size:0xB data:string -lbl_8052495C = .data:0x8052495C; // type:object size:0xB data:string -lbl_80524968 = .data:0x80524968; // type:object size:0xB data:string -lbl_80524974 = .data:0x80524974; // type:object size:0xB data:string -lbl_80524980 = .data:0x80524980; // type:object size:0xB data:string -lbl_8052498C = .data:0x8052498C; // type:object size:0xB data:string -lbl_80524998 = .data:0x80524998; // type:object size:0xB data:string -lbl_805249A4 = .data:0x805249A4; // type:object size:0xB data:string -lbl_805249B0 = .data:0x805249B0; // type:object size:0xB data:string -lbl_805249BC = .data:0x805249BC; // type:object size:0xB data:string -lbl_805249C8 = .data:0x805249C8; // type:object size:0xB data:string -lbl_805249D4 = .data:0x805249D4; // type:object size:0x1B data:string -lbl_805249F0 = .data:0x805249F0; // type:object size:0xA data:string -lbl_805249FC = .data:0x805249FC; // type:object size:0x1E data:string -lbl_80524A1C = .data:0x80524A1C; // type:object size:0xB data:string -lbl_80524A28 = .data:0x80524A28; // type:object size:0xB data:string -lbl_80524A34 = .data:0x80524A34; // type:object size:0xB data:string -lbl_80524A40 = .data:0x80524A40; // type:object size:0xB data:string -lbl_80524A4C = .data:0x80524A4C; // type:object size:0xB data:string -lbl_80524A58 = .data:0x80524A58; // type:object size:0xB data:string -lbl_80524A64 = .data:0x80524A64; // type:object size:0xB data:string -lbl_80524A70 = .data:0x80524A70; // type:object size:0xB data:string -lbl_80524A7C = .data:0x80524A7C; // type:object size:0xB data:string -lbl_80524A88 = .data:0x80524A88; // type:object size:0xB data:string -lbl_80524A94 = .data:0x80524A94; // type:object size:0xB data:string -lbl_80524AA0 = .data:0x80524AA0; // type:object size:0xB data:string -lbl_80524AAC = .data:0x80524AAC; // type:object size:0x16 data:string -lbl_80524AC4 = .data:0x80524AC4; // type:object size:0x9 data:string -lbl_80524AD0 = .data:0x80524AD0; // type:object size:0x9 data:string -jumptable_80524ADC = .data:0x80524ADC; // type:object size:0x24 scope:local -lbl_80524B00 = .data:0x80524B00; // type:object size:0x90 -lbl_80524B90 = .data:0x80524B90; // type:object size:0x38 -lbl_80524BC8 = .data:0x80524BC8; // type:object size:0x1F data:string -lbl_80524BE8 = .data:0x80524BE8; // type:object size:0xA data:string -lbl_80524BF4 = .data:0x80524BF4; // type:object size:0x26 data:string -lbl_80524C1C = .data:0x80524C1C; // type:object size:0x54 -lbl_80524C70 = .data:0x80524C70; // type:object size:0x9 data:string -lbl_80524C7C = .data:0x80524C7C; // type:object size:0x9 data:string -lbl_80524C88 = .data:0x80524C88; // type:object size:0x48 +@20839 = .data:0x80524928; // type:object size:0x1C scope:local data:string +...data.0 = .data:0x80524928; // type:label scope:local +@20840 = .data:0x80524944; // type:object size:0xB scope:local data:string +@20841 = .data:0x80524950; // type:object size:0xB scope:local data:string +@20842 = .data:0x8052495C; // type:object size:0xB scope:local data:string +@20843 = .data:0x80524968; // type:object size:0xB scope:local data:string +@20844 = .data:0x80524974; // type:object size:0xB scope:local data:string +@20845 = .data:0x80524980; // type:object size:0xB scope:local data:string +@20846 = .data:0x8052498C; // type:object size:0xB scope:local data:string +@20847 = .data:0x80524998; // type:object size:0xB scope:local data:string +@20848 = .data:0x805249A4; // type:object size:0xB scope:local data:string +@20849 = .data:0x805249B0; // type:object size:0xB scope:local data:string +@20850 = .data:0x805249BC; // type:object size:0xB scope:local data:string +@20851 = .data:0x805249C8; // type:object size:0xB scope:local data:string +@20852 = .data:0x805249D4; // type:object size:0x1B scope:local data:string +@20853 = .data:0x805249F0; // type:object size:0xA scope:local data:string +@20854 = .data:0x805249FC; // type:object size:0x1E scope:local data:string +@20855 = .data:0x80524A1C; // type:object size:0xB scope:local data:string +@20856 = .data:0x80524A28; // type:object size:0xB scope:local data:string +@20857 = .data:0x80524A34; // type:object size:0xB scope:local data:string +@20858 = .data:0x80524A40; // type:object size:0xB scope:local data:string +@20859 = .data:0x80524A4C; // type:object size:0xB scope:local data:string +@20860 = .data:0x80524A58; // type:object size:0xB scope:local data:string +@20861 = .data:0x80524A64; // type:object size:0xB scope:local data:string +@20862 = .data:0x80524A70; // type:object size:0xB scope:local data:string +@20863 = .data:0x80524A7C; // type:object size:0xB scope:local data:string +@20864 = .data:0x80524A88; // type:object size:0xB scope:local data:string +@20865 = .data:0x80524A94; // type:object size:0xB scope:local data:string +@20866 = .data:0x80524AA0; // type:object size:0xB scope:local data:string +@22440 = .data:0x80524AAC; // type:object size:0x16 scope:local data:string +@21015 = .data:0x80524AC4; // type:object size:0x9 scope:local data:string +@22588 = .data:0x80524AD0; // type:object size:0x9 scope:local data:string +@22727 = .data:0x80524ADC; // type:object size:0x24 scope:local +__vt__18dLytDepositStock_c = .data:0x80524B00; // type:object size:0x34 +@22972 = .data:0x80524B48; // type:object size:0xC scope:local +@22973 = .data:0x80524B54; // type:object size:0xC scope:local +@22974 = .data:0x80524B60; // type:object size:0xC scope:local +@22976 = .data:0x80524B6C; // type:object size:0x21 scope:local data:string +__vt__33sFStateID_c<18dLytDepositStock_c> = .data:0x80524B90; // type:object size:0x34 scope:weak +@12893 = .data:0x80524BC8; // type:object size:0x1F scope:local data:string +...data.0 = .data:0x80524BC8; // type:label scope:local +@12894 = .data:0x80524BE8; // type:object size:0xA scope:local data:string +@12895 = .data:0x80524BF4; // type:object size:0x26 scope:local data:string +@12896 = .data:0x80524C1C; // type:object size:0x11 scope:local data:string +@13676 = .data:0x80524C30; // type:object size:0x1A scope:local data:string +@13678 = .data:0x80524C4C; // type:object size:0x11 scope:local data:string +@13679 = .data:0x80524C60; // type:object size:0xD scope:local data:string +@13007 = .data:0x80524C70; // type:object size:0x9 scope:local data:string +@13789 = .data:0x80524C7C; // type:object size:0x9 scope:local data:string +__vt__22dLytDepositBoxCursor_c = .data:0x80524C88; // type:object size:0x34 lbl_80524CD0 = .data:0x80524CD0; // type:object size:0xF data:string lbl_80524CE0 = .data:0x80524CE0; // type:object size:0x16 data:string lbl_80524CF8 = .data:0x80524CF8; // type:object size:0xB data:string @@ -40405,10 +40414,10 @@ lbl_8057285C = .sdata:0x8057285C; // type:object size:0x7 data:string lbl_80572978 = .sdata:0x80572978; // type:object size:0x8 data:4byte lbl_80572980 = .sdata:0x80572980; // type:object size:0x4 data:4byte lbl_80572984 = .sdata:0x80572984; // type:object size:0x4 -lbl_80572988 = .sdata:0x80572988; // type:object size:0x4 data:4byte -lbl_8057298C = .sdata:0x8057298C; // type:object size:0x4 -lbl_80572990 = .sdata:0x80572990; // type:object size:0x4 data:4byte -lbl_80572994 = .sdata:0x80572994; // type:object size:0x4 +sGroupName = .sdata:0x80572988; // type:object size:0x4 scope:local data:4byte +@22589 = .sdata:0x8057298C; // type:object size:0x1 scope:local +sGroupName = .sdata:0x80572990; // type:object size:0x4 scope:local data:4byte +@13790 = .sdata:0x80572994; // type:object size:0x1 scope:local lbl_80572998 = .sdata:0x80572998; // type:object size:0x8 lbl_805729A0 = .sdata:0x805729A0; // type:object size:0x8 data:4byte lbl_805729A8 = .sdata:0x805729A8; // type:object size:0x8 data:wstring @@ -45639,12 +45648,12 @@ lbl_8057A030 = .sdata2:0x8057A030; // type:object size:0x4 align:4 data:float @7352 = .sdata2:0x8057A048; // type:object size:0x4 scope:local align:4 data:float @7353 = .sdata2:0x8057A04C; // type:object size:0x4 scope:local align:4 data:float @7357 = .sdata2:0x8057A050; // type:object size:0x8 scope:local align:8 data:double -lbl_8057A058 = .sdata2:0x8057A058; // type:object size:0x4 align:4 data:float -lbl_8057A05C = .sdata2:0x8057A05C; // type:object size:0x4 align:4 data:float -lbl_8057A060 = .sdata2:0x8057A060; // type:object size:0x4 align:4 data:float -lbl_8057A064 = .sdata2:0x8057A064; // type:object size:0x4 align:4 data:float -lbl_8057A068 = .sdata2:0x8057A068; // type:object size:0x4 align:4 data:float -lbl_8057A070 = .sdata2:0x8057A070; // type:object size:0x8 align:8 data:double +@22441 = .sdata2:0x8057A058; // type:object size:0x4 scope:local align:4 data:float +@22442 = .sdata2:0x8057A05C; // type:object size:0x4 scope:local align:4 data:float +@13677 = .sdata2:0x8057A060; // type:object size:0x4 scope:local align:4 data:float +@13878 = .sdata2:0x8057A064; // type:object size:0x4 scope:local align:4 data:float +@13879 = .sdata2:0x8057A068; // type:object size:0x4 scope:local align:4 data:float +@13882 = .sdata2:0x8057A070; // type:object size:0x8 scope:local align:8 data:double lbl_8057A078 = .sdata2:0x8057A078; // type:object size:0x4 align:4 data:float lbl_8057A07C = .sdata2:0x8057A07C; // type:object size:0x4 align:4 data:float lbl_8057A080 = .sdata2:0x8057A080; // type:object size:0x4 align:4 data:float @@ -51970,8 +51979,8 @@ StateID_In__14dLytSkyGauge_c = .bss:0x805B1380; // type:object size:0x30 data:4b StateID_Move__14dLytSkyGauge_c = .bss:0x805B13C0; // type:object size:0x30 data:4byte @6397 = .bss:0x805B13F0; // type:object size:0xC scope:local StateID_Out__14dLytSkyGauge_c = .bss:0x805B1400; // type:object size:0x30 data:4byte -lbl_805B1430 = .bss:0x805B1430; // type:object size:0x10 -LytDepositStock__STATE_NONE = .bss:0x805B1440; // type:object size:0x30 data:4byte +@20826 = .bss:0x805B1430; // type:object size:0xC scope:local +StateID_None__18dLytDepositStock_c = .bss:0x805B1440; // type:object size:0x30 data:4byte lbl_805B1470 = .bss:0x805B1470; // type:object size:0x10 LytBossGauge__STATE_NONE = .bss:0x805B1480; // type:object size:0x40 data:4byte LytBossGauge__STATE_IN = .bss:0x805B14C0; // type:object size:0x40 data:4byte diff --git a/configure.py b/configure.py index a0133566..bb2a6003 100644 --- a/configure.py +++ b/configure.py @@ -562,8 +562,8 @@ config.libs = [ Object(NonMatching, "d/lyt/d_lyt_system_window.cpp"), Object(Matching, "d/lyt/d_lyt_bird_gauge.cpp"), Object(Matching, "d/lyt/d_lyt_sky_gauge.cpp"), - Object(NonMatching, "d/lyt/d_lyt_deposit_stock.cpp"), - Object(NonMatching, "d/lyt/d_lyt_deposit_box.cpp"), + Object(Matching, "d/lyt/d_lyt_deposit_stock.cpp"), + Object(Matching, "d/lyt/d_lyt_deposit_box_cursor.cpp"), Object(NonMatching, "d/lyt/d_lyt_boss_gauge.cpp"), Object(Matching, "d/lyt/d_lyt_pause_back.cpp"), Object(NonMatching, "d/lyt/d_lyt_pause_disp_00.cpp"), diff --git a/include/d/d_cs_base.h b/include/d/d_cs_base.h index 8c7972c8..b7c54201 100644 --- a/include/d/d_cs_base.h +++ b/include/d/d_cs_base.h @@ -52,10 +52,18 @@ public: mCursorStick.setShouldBeOn(visible); } + bool isCursorStickVisible() const { + return mCursorStick.getShouldBeOn(); + } + void setCursorStickTargetPane(const nw4r::lyt::Pane *target) { mCursorStick.setTargetPane(target); } + const nw4r::lyt::Pane *getCursorStickAllPane() const { + return mCursorStick.getAllPane(); + } + private: static dCsBase_c *sInstance; void setCurrentLyt(int lyt); diff --git a/include/d/lyt/d_lyt_cursor_stick.h b/include/d/lyt/d_lyt_cursor_stick.h index 84f7293b..7f5fef42 100644 --- a/include/d/lyt/d_lyt_cursor_stick.h +++ b/include/d/lyt/d_lyt_cursor_stick.h @@ -29,10 +29,18 @@ public: mShouldBeOn = value; } + bool getShouldBeOn() const { + return mShouldBeOn; + } + static dLytCursorStick_c *GetInstance() { return sInstance; } + const nw4r::lyt::Pane *getAllPane() const { + return mpPanes[0]; + } + private: bool build_(); bool remove_(); diff --git a/include/d/lyt/d_lyt_deposit_box_cursor.h b/include/d/lyt/d_lyt_deposit_box_cursor.h new file mode 100644 index 00000000..f14b35dd --- /dev/null +++ b/include/d/lyt/d_lyt_deposit_box_cursor.h @@ -0,0 +1,55 @@ +#ifndef D_LYT_DEPOSIT_BOX_CURSOR_H +#define D_LYT_DEPOSIT_BOX_CURSOR_H + +#include "d/lyt/d2d.h" +#include "d/lyt/d_lyt_common_icon_item.h" +#include "nw4r/lyt/lyt_pane.h" + +class dLytDepositBoxCursor_c : public d2d::dSubPane { +public: + enum ItemLocation_e { + LOC_POUCH, + LOC_DEPOSIT, + }; + +public: + /* vt 0x0C */ virtual bool build(d2d::ResAccIf_c *resAcc) override; + /* vt 0x10 */ virtual bool remove() override; + /* vt 0x14 */ virtual bool execute() override; + /* vt 0x18 */ virtual nw4r::lyt::Pane *getPane() override { + return mLyt.getLayout()->GetRootPane(); + } + /* vt 0x1C */ virtual d2d::LytBase_c *getLyt() override { + return &mLyt; + } + /* vt 0x20 */ virtual const char *getName() const override { + return mLyt.getName(); + } + + /* vt 0x08 */ virtual ~dLytDepositBoxCursor_c() {} + + bool draw(); + + void init(s32 location, s32 slot, s32 item, bool unk); + void updateSlot(s32 location, s32 slot, s32 unk, bool unk2); + void fn_801580A0(); + +private: + void initIcon(); + void realizeNav(); + + /* 0x008 */ d2d::dLytSub mLyt; + /* 0x09C */ d2d::AnmGroup_c mAnm[2]; + /* 0x11C */ nw4r::lyt::Pane *mpStickCursorPane; + /* 0x120 */ nw4r::lyt::Pane *mpGetIconPane; + /* 0x124 */ dLytCommonIconItem_c mIcon; + /* 0x930 */ d2d::SubPaneList mSubpaneList; + /* 0x938 */ d2d::SubPaneListNode mNode; + /* 0x948 */ bool mIsVisible; + /* 0x948 */ bool field_0x949; + /* 0x94C */ s32 mSlot; + /* 0x950 */ s32 field_0x950; + /* 0x954 */ s32 mItemLocation; +}; + +#endif diff --git a/include/d/lyt/d_lyt_deposit_stock.h b/include/d/lyt/d_lyt_deposit_stock.h new file mode 100644 index 00000000..a39e9690 --- /dev/null +++ b/include/d/lyt/d_lyt_deposit_stock.h @@ -0,0 +1,113 @@ +#ifndef D_LYT_DEPOSIT_STOCK_H +#define D_LYT_DEPOSIT_STOCK_H + +#include "d/lyt/d2d.h" +#include "d/lyt/d_lyt_common_icon_item.h" +#include "nw4r/lyt/lyt_pane.h" +#include "s/s_State.hpp" + +class dLytDepositStock_c : public d2d::dSubPane { +public: + enum ArrowDirection_e { + ARROW_LEFT, + ARROW_RIGHT, + + ARROW_NONE, + }; + + enum NavMode_e { + NAV_ITEM, + NAV_SELL, + NAV_SORT, + NAV_FINISH, + NAV_ARROW, + }; + +public: + dLytDepositStock_c() : mStateMgr(*this) {} + virtual ~dLytDepositStock_c() {} + + /* vt 0x0C */ virtual bool build(d2d::ResAccIf_c *resAcc) override; + /* vt 0x10 */ virtual bool remove() override; + /* vt 0x14 */ virtual bool execute() override; + /* vt 0x18 */ virtual nw4r::lyt::Pane *getPane() override { + return mLyt.getLayout()->GetRootPane(); + } + /* vt 0x1C */ virtual d2d::LytBase_c *getLyt() override { + return &mLyt; + } + /* vt 0x20 */ virtual const char *getName() const override { + return mLyt.getName(); + } + + void nextPage(bool unk); + void prevPage(bool unk); + void fn_80156530(bool unk); + + void navigateToSell(); + void navigateToSort(); + void navigateToFinish(); + void saveArrowDirection(); + void navigateToArrow(s32 arrowDirection); + s32 restoreArrowDirection(); + void handleSpecialNavMode(); + bool isNavModeItem() const; + void navigateOffIcon(); + void handleNavOrPoint(); + + void pickUpItem(s32 slot, bool unk); + void selectNavTarget(s32 idx); + void setItem(s32 idx, s32 item); + s32 getCurrentSlot() const; + + STATE_MGR_DEFINE_UTIL_EXECUTESTATE(dLytDepositStock_c); + +private: + static const s32 NUM_ICONS_PER_PAGE = 12; + static const s32 NUM_PAGES = 5; + + void initIcons(); + void navigateToItem(); + void loadItems(s32 hiddenSlot); + void loadIcon(s32 idx); + void navigateToPouch(); + void realizeItem(s32 idx); + + /** + * Check if the FS stick is pushed in a direction. Diagonal movements + * are adjusted to horizontal and vertical navigations if necessary. + * @returns FS stick direction + */ + s32 checkNav(); + + STATE_FUNC_DECLARE(dLytDepositStock_c, None); + + /* 0x0008 */ UI_STATE_MGR_DECLARE(dLytDepositStock_c); + /* 0x0044 */ d2d::dLytSub mLyt; + /* 0x00D8 */ d2d::AnmGroup_c mAnm[25]; + /* 0x0718 */ dLytCommonIconItem_c mIcons[NUM_ICONS_PER_PAGE]; + /* 0x6778 */ d2d::SubPaneList mSubpaneList; + /* 0x6784 */ d2d::SubPaneListNode mNodes[NUM_ICONS_PER_PAGE]; + /* 0x6844 */ bool field_0x6844; + /* 0x6845 */ bool field_0x6845; + /* 0x6846 */ bool field_0x6846; + /* 0x6847 */ bool field_0x6847; + /* 0x6848 */ bool field_0x6848; + /* 0x6849 */ bool field_0x6849; + /* 0x684A */ bool field_0x684A; + /* 0x684B */ bool field_0x684B; + /* 0x684C */ bool field_0x684C; + /* 0x684D */ bool field_0x684D; + /* 0x684E */ bool field_0x684E; + /* 0x6850 */ s32 mCurrentNavTarget; + /* 0x6854 */ UNKWORD field_0x6854; + /* 0x6858 */ s32 mSelectedItemId; + /* 0x685C */ UNKWORD field_0x685C; + /* 0x6860 */ s32 mArrowDirection; + /* 0x6864 */ s32 mSavedArrowDirection; + /* 0x6868 */ s32 mNavMode; + /* 0x686C */ u8 mItemIds[NUM_ICONS_PER_PAGE]; + /* 0x6878 */ u8 mItemPage; +}; + +#endif diff --git a/include/d/lyt/d_lyt_util_items.h b/include/d/lyt/d_lyt_util_items.h index 12f029a5..e384e10a 100644 --- a/include/d/lyt/d_lyt_util_items.h +++ b/include/d/lyt/d_lyt_util_items.h @@ -74,9 +74,14 @@ u8 getPouchItemForSlot(s32 slot, bool unk); bool hasPouchSlot(s32 slot, bool unk); s32 getPouchItemAmount(s32 slot, bool unk); u8 getPouchItemNumberColor(s32 slot, bool unk); -f32 getShieldDurability(s32 slot, bool unk); +f32 getPouchShieldDurability(s32 slot, bool unk); u32 getPouchItemIdForIndex(s32 slot, bool unk); +u8 getDepositItemForSlot(s32 slot); +s32 getDepositItemAmount(s32 slot); +u8 getDepositItemNumberColor(s32 slot); +f32 getDepositShieldDurability(s32 slot); + // TODO - rename and make sense of these DowsingTarget::DowsingSlot dowsingSlotForIndex(s32 index); u8 getLytIndexForDowsingIndex(s32 index); diff --git a/src/d/lyt/d_lyt_deposit_box_cursor.cpp b/src/d/lyt/d_lyt_deposit_box_cursor.cpp new file mode 100644 index 00000000..3a42105c --- /dev/null +++ b/src/d/lyt/d_lyt_deposit_box_cursor.cpp @@ -0,0 +1,203 @@ +#include "d/lyt/d_lyt_deposit_box_cursor.h" + +#include "common.h" +#include "d/d_cs_base.h" +#include "d/d_pad_nav.h" +#include "d/lyt/d2d.h" +#include "d/lyt/d_lyt_common_icon_item.h" +#include "d/lyt/d_lyt_util_items.h" +#include "m/m_vec.h" +#include "nw4r/lyt/lyt_group.h" +#include "nw4r/lyt/lyt_pane.h" +#include "nw4r/math/math_types.h" +#include "toBeSorted/arc_managers/layout_arc_manager.h" + +static const d2d::LytBrlanMapping brlanMap[] = { + { "depositBoxCursor_00_loop.brlan", "G_loop_00"}, + {"depositBoxCursor_00_stickCursor.brlan", "G_stickCursor_00"}, +}; + +#define DEPOSIT_BOX_CURSOR_ANIM_LOOP 0 +#define DEPOSIT_BOX_CURSOR_ANIM_STICK_CURSOR 1 + +#define DEPOSIT_BOX_CURSOR_NUM_ANIMS 2 + +bool dLytDepositBoxCursor_c::build(d2d::ResAccIf_c *resAcc) { + mLyt.setResAcc(resAcc); + mLyt.build("depositBoxCursor_00.brlyt", nullptr); + mLyt.setPriority(0x88); + + for (int i = 0; i < DEPOSIT_BOX_CURSOR_NUM_ANIMS; i++) { + mAnm[i].init(brlanMap[i].mFile, resAcc, mLyt.getLayout(), brlanMap[i].mName); + mAnm[i].bind(false); + mAnm[i].setAnimEnable(false); + } + + mAnm[DEPOSIT_BOX_CURSOR_ANIM_LOOP].setAnimEnable(true); + mAnm[DEPOSIT_BOX_CURSOR_ANIM_LOOP].setFrame(0.0f); + mLyt.calc(); + + mpStickCursorPane = mLyt.findPane("N_stickCursor_00"); + mpGetIconPane = mLyt.findPane("N_getIcon_00"); + initIcon(); + mIsVisible = false; + field_0x949 = false; + return true; +} + +bool dLytDepositBoxCursor_c::execute() { + realizeNav(); + mAnm[DEPOSIT_BOX_CURSOR_ANIM_LOOP].play(); + if (mIsVisible) { + mNode.mpLytPane->execute(); + } + mLyt.calc(); + + return true; +} + +bool dLytDepositBoxCursor_c::draw() { + if (mIsVisible) { + mLyt.addToDrawList(); + } + return true; +} + +bool dLytDepositBoxCursor_c::remove() { + for (d2d::SubPaneList::Iterator it = mSubpaneList.GetBeginIter(); it != mSubpaneList.GetEndIter(); ++it) { + d2d::dSubPane *subPane = it->mpLytPane; + if (subPane != nullptr) { + nw4r::lyt::Pane *parent = subPane->getPane()->GetParent(); + parent->RemoveChild(subPane->getPane()); + } + } + + mNode.mpLytPane->remove(); + + mLyt.unbindAnims(); + + for (int i = 0; i < DEPOSIT_BOX_CURSOR_NUM_ANIMS; i++) { + mAnm[i].remove(); + } + return true; +} + +static const char *sGroupName = "G_ref_00"; + +void dLytDepositBoxCursor_c::initIcon() { + void *data = LayoutArcManager::GetInstance()->getLoadedData("DoButton"); + d2d::ResAccIf_c resAcc; + resAcc.attach(data, ""); + + mNode.mpLytPane = &mIcon; + mIcon.build(&resAcc, dLytCommonIconItem_c::POUCH); + mSubpaneList.PushBack(&mNode); + + if (mLyt.getLayout()->GetGroupContainer() != nullptr) { + nw4r::lyt::Group *g = mLyt.getLayout()->GetGroupContainer()->FindGroupByName(sGroupName); + if (g != nullptr) { + d2d::dSubPane::linkMeters(g, &mSubpaneList); + } + } + + mIcon.setUnk(false); + mIcon.setHasNumber(false); + mIcon.setNumber(0); + mIcon.setVisible(false); + + mNode.mpPane->SetVisible(false); +} + +void dLytDepositBoxCursor_c::realizeNav() { + s32 s; + if (mSlot < 0) { + s = mAnm[DEPOSIT_BOX_CURSOR_ANIM_STICK_CURSOR].getLastFrame(); + } else if (dPadNav::isPointerVisible()) { + s = 4; + } else if (field_0x950 == 50) { + s = 5; + } else if (field_0x949) { + s = 6; + } else if (mItemLocation == LOC_POUCH) { + s = mSlot == 0 ? 1 : 0; + if (field_0x950 == 12) { + s += 2; + } + } else if (field_0x950 == 12) { + s = 2; + } else { + s = 0; + } + + mVec3_c v; + if (dPadNav::isPointerVisible()) { + mVec2_c pos = dCsBase_c::GetInstance()->getCursorIf()->getCursorPos(); + v.set(pos.x, pos.y + 15.0f, 0.0f); + } else { + nw4r::math::MTX34 mtx = dCsBase_c::GetInstance()->getCursorStickAllPane()->GetGlobalMtx(); + v.set(mtx._03, mtx._13, 0.0f); + } + + mpStickCursorPane->SetTranslate(v); + + mAnm[DEPOSIT_BOX_CURSOR_ANIM_STICK_CURSOR].setAnimEnable(true); + mAnm[DEPOSIT_BOX_CURSOR_ANIM_STICK_CURSOR].setFrame(s); + mLyt.calc(); + mAnm[DEPOSIT_BOX_CURSOR_ANIM_STICK_CURSOR].setAnimEnable(false); +} + +void dLytDepositBoxCursor_c::init(s32 location, s32 slot, s32 item, bool unk) { + mItemLocation = location; + field_0x949 = unk; + + s32 number; + f32 durability; + u8 color; + if (mItemLocation == LOC_POUCH) { + number = getPouchItemAmount(slot, false); + durability = getPouchShieldDurability(slot, false); + color = getPouchItemNumberColor(slot, false); + mSlot = slot; + } else { + number = getDepositItemAmount(slot); + durability = getDepositShieldDurability(slot); + color = getDepositItemNumberColor(slot); + mSlot = slot % 12; + } + + if (number < 0) { + mIcon.setHasNumber(false); + } else { + mIcon.setHasNumber(true); + mIcon.setNumber(number); + } + mIcon.setUnk(false); + mIcon.setItem(item); + if (color != 3) { + mIcon.setNumberColor(color); + } + if (durability >= 0.0f) { + mIcon.setShieldDurability(durability); + } + + mNode.mpPane->SetVisible(true); + field_0x950 = 12; + realizeNav(); + mIsVisible = true; +} + +void dLytDepositBoxCursor_c::updateSlot(s32 location, s32 slot, s32 unk, bool unk2) { + field_0x950 = unk; + mItemLocation = location; + field_0x949 = unk2; + if (mItemLocation == LOC_POUCH) { + mSlot = slot; + } else { + mSlot = slot % 12; + } +} + +void dLytDepositBoxCursor_c::fn_801580A0() { + field_0x949 = true; + realizeNav(); +} diff --git a/src/d/lyt/d_lyt_deposit_stock.cpp b/src/d/lyt/d_lyt_deposit_stock.cpp new file mode 100644 index 00000000..1dacffba --- /dev/null +++ b/src/d/lyt/d_lyt_deposit_stock.cpp @@ -0,0 +1,682 @@ +#include "d/lyt/d_lyt_deposit_stock.h" + +#include "d/d_cs_base.h" +#include "d/d_pad_nav.h" +#include "d/d_rumble.h" +#include "d/lyt/d2d.h" +#include "d/lyt/d_lyt_common_icon_item.h" +#include "d/lyt/d_lyt_common_icon_item_maps.h" +#include "d/lyt/d_lyt_util_items.h" +#include "d/snd/d_snd_small_effect_mgr.h" +#include "d/snd/d_snd_wzsound.h" +#include "nw4r/lyt/lyt_group.h" +#include "toBeSorted/arc_managers/layout_arc_manager.h" +#include "toBeSorted/file_manager.h" + +STATE_DEFINE(dLytDepositStock_c, None); + +void dLytDepositStock_c::initializeState_None() {} +void dLytDepositStock_c::executeState_None() { + field_0x6844 = true; +} +void dLytDepositStock_c::finalizeState_None() {} + +static const d2d::LytBrlanMapping brlanMap[] = { + { "depositBoxBg_00_flash.brlan", "G_flash_00"}, + { "depositBoxBg_00_flash.brlan", "G_flash_01"}, + { "depositBoxBg_00_flash.brlan", "G_flash_02"}, + { "depositBoxBg_00_flash.brlan", "G_flash_03"}, + { "depositBoxBg_00_flash.brlan", "G_flash_04"}, + { "depositBoxBg_00_flash.brlan", "G_flash_05"}, + { "depositBoxBg_00_flash.brlan", "G_flash_06"}, + { "depositBoxBg_00_flash.brlan", "G_flash_07"}, + { "depositBoxBg_00_flash.brlan", "G_flash_08"}, + { "depositBoxBg_00_flash.brlan", "G_flash_09"}, + { "depositBoxBg_00_flash.brlan", "G_flash_10"}, + { "depositBoxBg_00_flash.brlan", "G_flash_11"}, + { "depositBoxBg_00_loop.brlan", "G_loop_00"}, + {"depositBoxBg_00_haveBox.brlan", "G_poach_00"}, + {"depositBoxBg_00_haveBox.brlan", "G_poach_01"}, + {"depositBoxBg_00_haveBox.brlan", "G_poach_02"}, + {"depositBoxBg_00_haveBox.brlan", "G_poach_03"}, + {"depositBoxBg_00_haveBox.brlan", "G_poach_04"}, + {"depositBoxBg_00_haveBox.brlan", "G_poach_05"}, + {"depositBoxBg_00_haveBox.brlan", "G_poach_06"}, + {"depositBoxBg_00_haveBox.brlan", "G_poach_07"}, + {"depositBoxBg_00_haveBox.brlan", "G_poach_08"}, + {"depositBoxBg_00_haveBox.brlan", "G_poach_09"}, + {"depositBoxBg_00_haveBox.brlan", "G_poach_10"}, + {"depositBoxBg_00_haveBox.brlan", "G_poach_11"}, +}; + +#define DEPOSIT_STOCK_ANIM_FLASH_OFFSET 0 +#define DEPOSIT_STOCK_ANIM_LOOP 12 +#define DEPOSIT_STOCK_ANIM_HAVE_BOX_OFFSET 13 + +#define DEPOSIT_STOCK_NUM_ANIMS 25 + +bool dLytDepositStock_c::build(d2d::ResAccIf_c *resAcc) { + mLyt.setResAcc(resAcc); + mLyt.build("depositBoxBg_00.brlyt", nullptr); + + for (int i = 0; i < DEPOSIT_STOCK_NUM_ANIMS; i++) { + mAnm[i].init(brlanMap[i].mFile, resAcc, mLyt.getLayout(), brlanMap[i].mName); + mAnm[i].bind(false); + mAnm[i].setAnimEnable(false); + } + + int i; + + for (i = 0; i < DEPOSIT_STOCK_NUM_ANIMS; i++) { + if (i < DEPOSIT_STOCK_ANIM_FLASH_OFFSET + NUM_ICONS_PER_PAGE) { + mAnm[i].setAnimEnable(true); + mAnm[i].setToEnd(); + } else { + mAnm[i].setAnimEnable(true); + mAnm[i].setFrame(0.0f); + } + } + + mLyt.calc(); + + for (i = 0; i < DEPOSIT_STOCK_NUM_ANIMS; i++) { + if (i != DEPOSIT_STOCK_ANIM_LOOP) { + mAnm[i].setAnimEnable(false); + } + } + + initIcons(); + + mStateMgr.changeState(StateID_None); + + mCurrentNavTarget = -12; + mSelectedItemId = -1; + field_0x685C = -1; + + field_0x6849 = false; + field_0x684A = false; + field_0x684B = false; + field_0x684C = true; + field_0x684E = false; + + mArrowDirection = ARROW_NONE; + + field_0x6845 = false; + field_0x6846 = false; + field_0x6847 = false; + field_0x6848 = false; + + mSavedArrowDirection = ARROW_NONE; + + navigateToItem(); + + return true; +} + +bool dLytDepositStock_c::execute() { + for (int i = 0; i < field_0x6854; i++) { + mNodes[i].mpLytPane->execute(); + } + + if (field_0x684D) { + mStateMgr.executeState(); + } + + for (int i = 0; i < DEPOSIT_STOCK_ANIM_LOOP + 1; i++) { + if (mAnm[i].isEnabled()) { + if (i < NUM_ICONS_PER_PAGE && mAnm[i].isStop()) { + mAnm[i].setAnimEnable(false); + } + + mAnm[i].play(); + } + } + + mLyt.calc(); + + field_0x684C = dPadNav::isPointerVisible(); + + return true; +} + +bool dLytDepositStock_c::remove() { + for (d2d::SubPaneList::Iterator it = mSubpaneList.GetBeginIter(); it != mSubpaneList.GetEndIter(); ++it) { + d2d::dSubPane *subPane = it->mpLytPane; + if (subPane != nullptr) { + nw4r::lyt::Pane *parent = subPane->getPane()->GetParent(); + parent->RemoveChild(subPane->getPane()); + } + } + + for (int i = 0; i < NUM_ICONS_PER_PAGE; i++) { + mNodes[i].mpLytPane->remove(); + } + + mLyt.unbindAnims(); + + for (int i = 0; i < DEPOSIT_STOCK_NUM_ANIMS; i++) { + mAnm[i].remove(); + } + return true; +} + +static const char *sGroupName = "G_ref_00"; + +void dLytDepositStock_c::initIcons() { + void *data = LayoutArcManager::GetInstance()->getLoadedData("DoButton"); + d2d::ResAccIf_c resAcc; + resAcc.attach(data, ""); + + for (int i = 0; i < NUM_ICONS_PER_PAGE; i++) { + mNodes[i].mpLytPane = &mIcons[i]; + mIcons[i].build(&resAcc, dLytCommonIconItem_c::POUCH); + mSubpaneList.PushBack(&mNodes[i]); + } + + if (mLyt.getLayout()->GetGroupContainer() != nullptr) { + nw4r::lyt::Group *g = mLyt.getLayout()->GetGroupContainer()->FindGroupByName(sGroupName); + if (g != nullptr) { + d2d::dSubPane::linkMeters(g, &mSubpaneList); + } + } + + for (int i = 0; i < field_0x6854; i++) { + mNodes[i].mpPane->SetVisible(false); + } +} + +void dLytDepositStock_c::loadItems(s32 hiddenSlot) { + s32 slot = mItemPage * NUM_ICONS_PER_PAGE; + + field_0x6854 = 0; + field_0x684E = false; + + for (int i = 0; i < NUM_ICONS_PER_PAGE; i++) { + mIcons[i].reset(); + mItemIds[i] = getDepositItemForSlot(slot); + + f32 f = 0.0f; + if (mItemIds[i] != LYT_CMN_PouchBlank4 && slot != hiddenSlot) { + f = 1.0f; + } + loadIcon(i); + mIcons[i].setVisible(false); + if (slot == hiddenSlot) { + mNodes[i].mpPane->SetVisible(false); + } else { + mNodes[i].mpPane->SetVisible(true); + } + + mAnm[i + DEPOSIT_STOCK_ANIM_HAVE_BOX_OFFSET].setAnimEnable(true); + mAnm[i + DEPOSIT_STOCK_ANIM_HAVE_BOX_OFFSET].setFrame(f); + mLyt.calc(); + mAnm[i + DEPOSIT_STOCK_ANIM_HAVE_BOX_OFFSET].setAnimEnable(false); + + slot++; + field_0x6854++; + } +} + +void dLytDepositStock_c::loadIcon(s32 idx) { + s32 slot = idx + mItemPage * NUM_ICONS_PER_PAGE; + s32 number = getDepositItemAmount(slot); + + mIcons[idx].setUnk(false); + + if (number < 0) { + mIcons[idx].setHasNumber(false); + } else { + mIcons[idx].setHasNumber(true); + mIcons[idx].setNumber(number); + } + mIcons[idx].setItem(mItemIds[idx]); + u8 color = getDepositItemNumberColor(slot); + if (color != 3) { + mIcons[idx].setNumberColor(color); + } + f32 durability = getDepositShieldDurability(slot); + if (durability >= 0.0f) { + mIcons[idx].setShieldDurability(durability); + } +} + +void dLytDepositStock_c::nextPage(bool unk) { + mItemPage++; + if (mItemPage >= NUM_PAGES) { + mItemPage = 0; + } + field_0x684B = unk; +} + +void dLytDepositStock_c::prevPage(bool unk) { + if (mItemPage != 0) { + mItemPage--; + } else { + mItemPage = NUM_PAGES - 1; + } + field_0x684B = unk; +} + +void dLytDepositStock_c::fn_80156530(bool unk) { + for (int i = 0; i < NUM_ICONS_PER_PAGE; i++) { + mIcons[i].setVisible(unk); + } + + if (!field_0x684B) { + if (mCurrentNavTarget >= 0) { + mAnm[mCurrentNavTarget + DEPOSIT_STOCK_ANIM_FLASH_OFFSET].setAnimEnable(true); + mSelectedItemId = -1; + } + mCurrentNavTarget = -10; + } + + field_0x684B = false; + field_0x6845 = false; + field_0x6846 = false; + if (!field_0x6847) { + // okay + field_0x6847 = false; + } + field_0x6848 = false; + if (mArrowDirection >= ARROW_NONE) { + handleSpecialNavMode(); + } +} + +void dLytDepositStock_c::handleNavOrPoint() { + bool selectIcon = false; + s32 nextTarget = 0; + if (dPadNav::isPointerVisible()) { + for (nextTarget = 0; nextTarget < NUM_ICONS_PER_PAGE; nextTarget++) { + if (mIcons[nextTarget].isCursorOver()) { + selectIcon = true; + saveArrowDirection(); + break; + } + } + } else { + s32 dir = checkNav(); + if (!isNavModeItem()) { + handleSpecialNavMode(); + } else if (!field_0x6845 && !field_0x6846 && !field_0x6847 && !field_0x6848 && mSavedArrowDirection >= 2) { + s32 target = mCurrentNavTarget; + if (target < 0 || field_0x684C) { + if (dir != dPadNav::FS_STICK_NONE || dCsBase_c::GetInstance()->isCursorStickVisible()) { + if (target < 0) { + target += NUM_ICONS_PER_PAGE; + } + selectIcon = true; + nextTarget = target; + } + } else { + switch (dir) { + case dPadNav::FS_STICK_UP: + if (target < 6) { + navigateToPouch(); + } else { + nextTarget = target - 6; + selectIcon = true; + } + break; + case dPadNav::FS_STICK_UP_RIGHT: + nextTarget = target - 5; + selectIcon = true; + break; + case dPadNav::FS_STICK_RIGHT: + if (target % 6 == 5) { + navigateToArrow(ARROW_RIGHT); + saveArrowDirection(); + dRumble_c::start(dRumble_c::sRumblePreset1, dRumble_c::FLAG_SLOT0); + } else { + nextTarget = target + 1; + selectIcon = true; + } + break; + case dPadNav::FS_STICK_DOWN_RIGHT: + nextTarget = target + 7; + selectIcon = true; + break; + case dPadNav::FS_STICK_DOWN: + if (target >= 10) { + navigateToSort(); + } else if (target >= 6 && target <= 7) { + navigateToSell(); + } else { + nextTarget = target + 6; + selectIcon = true; + } + break; + case dPadNav::FS_STICK_DOWN_LEFT: + nextTarget = target + 5; + selectIcon = true; + break; + case dPadNav::FS_STICK_LEFT: + if (target % 6 == 0) { + navigateToArrow(ARROW_LEFT); + saveArrowDirection(); + dRumble_c::start(dRumble_c::sRumblePreset1, dRumble_c::FLAG_SLOT0); + } else { + nextTarget = target - 1; + selectIcon = true; + } + break; + case dPadNav::FS_STICK_UP_LEFT: + nextTarget = target - 7; + selectIcon = true; + break; + default: + nextTarget = target; + selectIcon = true; + break; + } + } + } + } + + if (selectIcon) { + mSavedArrowDirection = ARROW_NONE; + if (mCurrentNavTarget != nextTarget) { + if (mCurrentNavTarget >= 0) { + mIcons[mCurrentNavTarget].setOff(); + mAnm[mCurrentNavTarget + DEPOSIT_STOCK_ANIM_FLASH_OFFSET].setAnimEnable(true); + } + if (mItemIds[nextTarget] != LYT_CMN_PouchBlank4 && + mItemIds[nextTarget] != LYT_CMN_PouchPotionHealthPlusPlusHalf) { + mIcons[nextTarget].setOn(); + mSelectedItemId = FileManager::sInstance->getItemCheckItem(nextTarget + mItemPage * NUM_ICONS_PER_PAGE); + dSndSmallEffectMgr_c::GetInstance()->playSound(SE_S_SHOP_STK_STOCK_POINT_ITEM); + } else { + mSelectedItemId = -1; + dSndSmallEffectMgr_c::GetInstance()->playSound(SE_S_SHOP_STK_STOCK_POINT_EMPTY); + } + + s32 anmIdx = nextTarget + DEPOSIT_STOCK_ANIM_FLASH_OFFSET; + mAnm[anmIdx].setAnimEnable(true); + mAnm[anmIdx].setFrame(0.0f); + mLyt.calc(); + mAnm[anmIdx].setAnimEnable(false); + dRumble_c::start(dRumble_c::sRumblePreset1, dRumble_c::FLAG_SLOT0); + mCurrentNavTarget = nextTarget; + field_0x6846 = false; + field_0x6847 = false; + field_0x6848 = false; + navigateToItem(); + } + mNavMode = 0; + } else { + navigateOffIcon(); + } +} + +void dLytDepositStock_c::navigateOffIcon() { + if (mCurrentNavTarget >= 0) { + // TODO why LYT_CMN_PouchPotionHealthPlusPlusHalf + if (mItemIds[mCurrentNavTarget] != LYT_CMN_PouchBlank4 && + mItemIds[mCurrentNavTarget] != LYT_CMN_PouchPotionHealthPlusPlusHalf) { + mIcons[mCurrentNavTarget].setOff(); + mSelectedItemId = -1; + } + mAnm[mCurrentNavTarget + DEPOSIT_STOCK_ANIM_FLASH_OFFSET].setAnimEnable(true); + mCurrentNavTarget -= NUM_ICONS_PER_PAGE; + } +} + +s32 dLytDepositStock_c::checkNav() { + // Note: Navigating UP when in the first row means switching from stock to pouch + + s32 target = mCurrentNavTarget; + s32 direction = dPadNav::getFSStickNavDirection(); + if (target >= 0) { + switch (direction) { + case dPadNav::FS_STICK_UP_RIGHT: + if (target == 11) { + direction = dPadNav::FS_STICK_UP; + } else if (target < 6) { + if (target < 4) { + direction = dPadNav::FS_STICK_UP; + } else if (target == 5) { + direction = dPadNav::FS_STICK_NONE; + } else { + direction = dPadNav::FS_STICK_RIGHT; + } + } + break; + case dPadNav::FS_STICK_DOWN_RIGHT: + if (target == 5) { + direction = dPadNav::FS_STICK_DOWN; + } else if (target >= 6) { + if (target >= 10) { + if (field_0x684A) { + if (target == 11) { + direction = dPadNav::FS_STICK_NONE; + } else { + direction = dPadNav::FS_STICK_RIGHT; + } + + } else { + direction = dPadNav::FS_STICK_DOWN; + } + } else { + direction = dPadNav::FS_STICK_RIGHT; + } + } + break; + case dPadNav::FS_STICK_DOWN: + if (target >= 6) { + if (target < 8) { + if (field_0x6849) { + direction = dPadNav::FS_STICK_NONE; + } + } else if (target >= 10) { + if (field_0x684A) { + direction = dPadNav::FS_STICK_NONE; + } + } else { + direction = dPadNav::FS_STICK_NONE; + } + } + break; + case dPadNav::FS_STICK_DOWN_LEFT: + if (target == 0 || target == 11) { + if (target == 11 && field_0x684A) { + direction = dPadNav::FS_STICK_LEFT; + } else { + direction = dPadNav::FS_STICK_DOWN; + } + } else if (target >= 6) { + if (target <= 7) { + if (field_0x6849) { + if (target == 6) { + direction = dPadNav::FS_STICK_NONE; + } else { + direction = dPadNav::FS_STICK_LEFT; + } + } else { + direction = dPadNav::FS_STICK_DOWN; + } + } else if (target == 11) { + if (field_0x684A) { + direction = dPadNav::FS_STICK_NONE; + } else { + direction = dPadNav::FS_STICK_DOWN; + } + } else { + direction = dPadNav::FS_STICK_LEFT; + } + } + break; + case dPadNav::FS_STICK_UP_LEFT: + if (target == 6) { + direction = dPadNav::FS_STICK_UP; + } else if (target < 6) { + if (target == 0) { + direction = dPadNav::FS_STICK_NONE; + } else if (target == 1) { + direction = dPadNav::FS_STICK_LEFT; + } else { + direction = dPadNav::FS_STICK_UP; + } + } + break; + } + } + + return direction; +} + +s32 dLytDepositStock_c::getCurrentSlot() const { + return mCurrentNavTarget + mItemPage * NUM_ICONS_PER_PAGE; +} + +void dLytDepositStock_c::setItem(s32 idx, s32 item) { + mItemIds[idx] = item; + realizeItem(idx); + mIcons[idx].setOn(); + field_0x684E = false; +} + +void dLytDepositStock_c::realizeItem(s32 idx) { + f32 frame = 0.0f; + if (mItemIds[idx] != LYT_CMN_PouchBlank4) { + frame = 1.0f; + } + loadIcon(idx); + mIcons[idx].setVisible(true); + s32 anmIdx = idx + DEPOSIT_STOCK_ANIM_HAVE_BOX_OFFSET; + mAnm[anmIdx].setAnimEnable(true); + mAnm[anmIdx].setFrame(frame); + mLyt.calc(); + mAnm[anmIdx].setAnimEnable(false); +} + +void dLytDepositStock_c::selectNavTarget(s32 idx) { + if (idx < NUM_ICONS_PER_PAGE) { + if (mCurrentNavTarget >= 0) { + mAnm[mCurrentNavTarget + DEPOSIT_STOCK_ANIM_FLASH_OFFSET].setAnimEnable(true); + } + mCurrentNavTarget = idx; + + if (mCurrentNavTarget >= 0) { + mAnm[mCurrentNavTarget + DEPOSIT_STOCK_ANIM_FLASH_OFFSET].setAnimEnable(true); + mAnm[mCurrentNavTarget + DEPOSIT_STOCK_ANIM_FLASH_OFFSET].setFrame(0.0f); + mLyt.calc(); + mAnm[mCurrentNavTarget + DEPOSIT_STOCK_ANIM_FLASH_OFFSET].setAnimEnable(false); + dRumble_c::start(dRumble_c::sRumblePreset1, dRumble_c::FLAG_SLOT0); + } + } +} + +void dLytDepositStock_c::pickUpItem(s32 slot, bool unk) { + s32 page = slot / NUM_ICONS_PER_PAGE; + s32 idx = slot % NUM_ICONS_PER_PAGE; + if (unk) { + mNodes[idx].mpPane->SetVisible(unk); + } + + if (mItemPage != page) { + if (unk) { + field_0x684E = false; + } + } else { + s32 item = mItemIds[idx]; + f32 frame; + if (unk) { + // TODO why LYT_CMN_PouchPotionHealthPlusPlusHalf + if (item != LYT_CMN_PouchPotionHealthPlusPlusHalf && item != LYT_CMN_PouchBlank4) { + frame = 1.0f; + if (field_0x684E) { + s32 otherIdx = field_0x685C % NUM_ICONS_PER_PAGE; + mIcons[idx].setItem(mItemIds[otherIdx]); + field_0x684E = false; + } + } else { + frame = 0.0f; + } + field_0x685C = -1; + } else { + field_0x685C = slot; + frame = 0.0f; + field_0x684E = true; + mIcons[idx].setOff(); + mIcons[idx].setHasNumber(false); + mIcons[idx].setItem(LYT_CMN_PouchBlank4); + } + + s32 anmIdx = idx + DEPOSIT_STOCK_ANIM_HAVE_BOX_OFFSET; + mAnm[anmIdx].setAnimEnable(true); + mAnm[anmIdx].setFrame(frame); + mLyt.calc(); + mAnm[anmIdx].setAnimEnable(false); + } +} + +void dLytDepositStock_c::navigateToPouch() { + field_0x6845 = true; + mSavedArrowDirection = ARROW_NONE; +} + +void dLytDepositStock_c::navigateToSell() { + if (!field_0x6846) { + dSndSmallEffectMgr_c::GetInstance()->playSound(SE_S_SHOP_STK_POINT_SELL); + } + field_0x6846 = true; + mNavMode = NAV_SELL; + mSavedArrowDirection = ARROW_NONE; +} + +void dLytDepositStock_c::navigateToSort() { + if (!field_0x6847) { + dSndSmallEffectMgr_c::GetInstance()->playSound(SE_S_SHOP_STK_STOCK_POINT_TRIM); + } + field_0x6847 = true; + mNavMode = NAV_SORT; + mSavedArrowDirection = ARROW_NONE; +} + +void dLytDepositStock_c::navigateToFinish() { + if (!field_0x6848) { + dSndSmallEffectMgr_c::GetInstance()->playSound(SE_S_SHOP_STK_POINT_DECIDE); + } + field_0x6848 = true; + mNavMode = NAV_FINISH; + mSavedArrowDirection = ARROW_NONE; +} + +void dLytDepositStock_c::saveArrowDirection() { + mSavedArrowDirection = mArrowDirection; +} + +void dLytDepositStock_c::navigateToArrow(s32 arrowDirection) { + mArrowDirection = arrowDirection; + if (mArrowDirection < ARROW_NONE) { + mNavMode = NAV_ARROW; + } +} + +s32 dLytDepositStock_c::restoreArrowDirection() { + if (mSavedArrowDirection < ARROW_NONE && mArrowDirection >= ARROW_NONE) { + navigateToArrow(mSavedArrowDirection); + } + return mArrowDirection; +} + +void dLytDepositStock_c::navigateToItem() { + mNavMode = NAV_ITEM; +} + +void dLytDepositStock_c::handleSpecialNavMode() { + switch (mNavMode) { + case NAV_SELL: navigateToSell(); break; + case NAV_SORT: navigateToSort(); break; + case NAV_FINISH: navigateToFinish(); break; + case NAV_ARROW: + if (mArrowDirection < ARROW_NONE) { + saveArrowDirection(); + } + break; + } +} + +bool dLytDepositStock_c::isNavModeItem() const { + return mNavMode == NAV_ITEM; +} diff --git a/src/d/lyt/d_lyt_pause_disp_00.cpp b/src/d/lyt/d_lyt_pause_disp_00.cpp index ed81188a..29c68db2 100644 --- a/src/d/lyt/d_lyt_pause_disp_00.cpp +++ b/src/d/lyt/d_lyt_pause_disp_00.cpp @@ -1252,6 +1252,7 @@ void dLytPauseDisp00_c::setupInventoryWheel() { } u32 item = getPouchItemForSlot(i, true); + // TODO why LYT_CMN_PouchPotionHealthPlusPlusHalf if (item != LYT_CMN_PouchPotionHealthPlusPlusHalf) { if (isPouchBocoburinLocked()) { icon->setBocoburinLocked(true); @@ -1259,7 +1260,7 @@ void dLytPauseDisp00_c::setupInventoryWheel() { } haveFrame = 1.0f; icon->setItem(item); - f32 durability = getShieldDurability(i, true); + f32 durability = getPouchShieldDurability(i, true); if (durability >= 0.0f) { icon->setShieldDurability(durability); } @@ -1575,6 +1576,7 @@ void dLytPauseDisp00_c::setupRingIcons(s32 tab) { s32 offset = PAUSE_DISP_00_BOUNDING_RING_OFFSET; for (int i = 0; i < PAUSE_DISP_00_ICONS_NUM_ITEMS_ON_WHEEL; i++) { bool visible = false; + // TODO why LYT_CMN_PouchPotionHealthPlusPlusHalf if (getPouchItemForSlot(i, true) != LYT_CMN_PouchPotionHealthPlusPlusHalf) { visible = true; } diff --git a/src/d/lyt/meter/d_lyt_meter_minus_btn.cpp b/src/d/lyt/meter/d_lyt_meter_minus_btn.cpp index 001b70a0..7d06cb26 100644 --- a/src/d/lyt/meter/d_lyt_meter_minus_btn.cpp +++ b/src/d/lyt/meter/d_lyt_meter_minus_btn.cpp @@ -339,8 +339,8 @@ void dLytMeterMinusBtn_c::initializeState_MenuSelectingIn() { mItemIcons[i].setItem(field_0x4E98[i]); } - if (getShieldDurability(i, true) >= 0.0f) { - mItemIcons[i].setShieldDurability(getShieldDurability(i, true)); + if (getPouchShieldDurability(i, true) >= 0.0f) { + mItemIcons[i].setShieldDurability(getPouchShieldDurability(i, true)); if (i == convertFilePouchSlot(FileManager::GetInstance()->getShieldPouchSlot())) { mItemIcons[i].setShieldOnOff(false); } else { @@ -574,8 +574,8 @@ void dLytMeterMinusBtn_c::initializeState_DemoMove() { mItemIcons[i].setItem(field_0x4E98[i]); } - if (getShieldDurability(i, true) >= 0.0f) { - mItemIcons[i].setShieldDurability(getShieldDurability(i, true)); + if (getPouchShieldDurability(i, true) >= 0.0f) { + mItemIcons[i].setShieldDurability(getPouchShieldDurability(i, true)); if (i == convertFilePouchSlot(FileManager::GetInstance()->getShieldPouchSlot())) { mItemIcons[i].setShieldOnOff(false); } else { @@ -1086,7 +1086,7 @@ void dLytMeterMinusBtn_c::setItemText(s32 item) { void dLytMeterMinusBtn_c::realizeShieldDurability() { for (int i = 0; i < MINUS_BTN_NUM_ITEMS; i++) { if (field_0x4EBB[i] != 0) { - mItemIcons[i].setShieldDurability(getShieldDurability(i, true)); + mItemIcons[i].setShieldDurability(getPouchShieldDurability(i, true)); } } } From f31f539b7b6ce2abe0cad8ae846ba762c4bbf127 Mon Sep 17 00:00:00 2001 From: robojumper Date: Tue, 23 Dec 2025 09:40:44 +0100 Subject: [PATCH 02/11] d_lyt_deposit (main) wip --- config/SOUE01/splits.txt | 2 + config/SOUE01/symbols.txt | 283 ++++++++++--------- include/d/lyt/d_lyt_common_arrow.h | 4 + include/d/lyt/d_lyt_deposit.h | 117 +++++++- include/d/lyt/d_lyt_deposit_box_cursor.h | 2 + include/d/lyt/d_lyt_deposit_stock.h | 8 +- src/d/lyt/d_lyt_deposit.cpp | 345 +++++++++++++++++++++++ 7 files changed, 617 insertions(+), 144 deletions(-) create mode 100644 src/d/lyt/d_lyt_deposit.cpp diff --git a/config/SOUE01/splits.txt b/config/SOUE01/splits.txt index 638e95b8..223e95e4 100644 --- a/config/SOUE01/splits.txt +++ b/config/SOUE01/splits.txt @@ -1674,7 +1674,9 @@ d/lyt/d_lyt_deposit.cpp: .ctors start:0x804DB888 end:0x804DB88C .rodata start:0x804EF970 end:0x804EFA90 .data start:0x8053CFC8 end:0x8053DFC8 + .sdata start:0x80573C10 end:0x80573C30 .sbss start:0x805759B8 end:0x805759D0 + .sdata2 start:0x8057C7C0 end:0x8057C7E0 .bss start:0x805B6C18 end:0x805B7120 d/lyt/d_lyt_demo_title.cpp: diff --git a/config/SOUE01/symbols.txt b/config/SOUE01/symbols.txt index 9205361c..c4fc0d68 100644 --- a/config/SOUE01/symbols.txt +++ b/config/SOUE01/symbols.txt @@ -15966,49 +15966,49 @@ dLytShopMain__stateDtor = .text:0x802A7E00; // type:function size:0x58 dLytShop__dtor = .text:0x802A7E60; // type:function size:0x58 fn_802A7EC0 = .text:0x802A7EC0; // type:function size:0x88 fn_802A7F50 = .text:0x802A7F50; // type:function size:0x88 -fn_802A7FE0 = .text:0x802A7FE0; // type:function size:0x4 -fn_802A7FF0 = .text:0x802A7FF0; // type:function size:0x10 -fn_802A8000 = .text:0x802A8000; // type:function size:0x4 -fn_802A8010 = .text:0x802A8010; // type:function size:0x4 -fn_802A8020 = .text:0x802A8020; // type:function size:0x208 -fn_802A8230 = .text:0x802A8230; // type:function size:0x4 -fn_802A8240 = .text:0x802A8240; // type:function size:0x14 -fn_802A8260 = .text:0x802A8260; // type:function size:0x50 -fn_802A82B0 = .text:0x802A82B0; // type:function size:0x4 -fn_802A82C0 = .text:0x802A82C0; // type:function size:0x14 -fn_802A82E0 = .text:0x802A82E0; // type:function size:0x2A4 -fn_802A8590 = .text:0x802A8590; // type:function size:0x4 -fn_802A85A0 = .text:0x802A85A0; // type:function size:0x4 -fn_802A85B0 = .text:0x802A85B0; // type:function size:0x9C -fn_802A8650 = .text:0x802A8650; // type:function size:0x4 -fn_802A8660 = .text:0x802A8660; // type:function size:0x4 -fn_802A8670 = .text:0x802A8670; // type:function size:0xEC -fn_802A8760 = .text:0x802A8760; // type:function size:0x4 -fn_802A8770 = .text:0x802A8770; // type:function size:0x4 -fn_802A8780 = .text:0x802A8780; // type:function size:0x2F4 -fn_802A8A80 = .text:0x802A8A80; // type:function size:0x4 -fn_802A8A90 = .text:0x802A8A90; // type:function size:0x4 -fn_802A8AA0 = .text:0x802A8AA0; // type:function size:0x198 -fn_802A8C40 = .text:0x802A8C40; // type:function size:0x4 -fn_802A8C50 = .text:0x802A8C50; // type:function size:0x4 -fn_802A8C60 = .text:0x802A8C60; // type:function size:0x180 -fn_802A8DE0 = .text:0x802A8DE0; // type:function size:0x4 -fn_802A8DF0 = .text:0x802A8DF0; // type:function size:0x4 -fn_802A8E00 = .text:0x802A8E00; // type:function size:0x68 -fn_802A8E70 = .text:0x802A8E70; // type:function size:0x4 -fn_802A8E80 = .text:0x802A8E80; // type:function size:0x428 -fn_802A92B0 = .text:0x802A92B0; // type:function size:0xA4 -fn_802A9360 = .text:0x802A9360; // type:function size:0xA0 -fn_802A9400 = .text:0x802A9400; // type:function size:0x6C -fn_802A9470 = .text:0x802A9470; // type:function size:0x58 -fn_802A94D0 = .text:0x802A94D0; // type:function size:0x138 +initializeState_ModeNone__17dLytDepositMain_cFv = .text:0x802A7FE0; // type:function size:0x4 +executeState_ModeNone__17dLytDepositMain_cFv = .text:0x802A7FF0; // type:function size:0x10 +finalizeState_ModeNone__17dLytDepositMain_cFv = .text:0x802A8000; // type:function size:0x4 +initializeState_ModeIn__17dLytDepositMain_cFv = .text:0x802A8010; // type:function size:0x4 +executeState_ModeIn__17dLytDepositMain_cFv = .text:0x802A8020; // type:function size:0x208 +finalizeState_ModeIn__17dLytDepositMain_cFv = .text:0x802A8230; // type:function size:0x4 +initializeState_ModeCheck__17dLytDepositMain_cFv = .text:0x802A8240; // type:function size:0x14 +executeState_ModeCheck__17dLytDepositMain_cFv = .text:0x802A8260; // type:function size:0x50 +finalizeState_ModeCheck__17dLytDepositMain_cFv = .text:0x802A82B0; // type:function size:0x4 +initializeState_ModeChange__17dLytDepositMain_cFv = .text:0x802A82C0; // type:function size:0x14 +executeState_ModeChange__17dLytDepositMain_cFv = .text:0x802A82E0; // type:function size:0x2A4 +finalizeState_ModeChange__17dLytDepositMain_cFv = .text:0x802A8590; // type:function size:0x4 +initializeState_ModeArrangement__17dLytDepositMain_cFv = .text:0x802A85A0; // type:function size:0x4 +executeState_ModeArrangement__17dLytDepositMain_cFv = .text:0x802A85B0; // type:function size:0x9C +finalizeState_ModeArrangement__17dLytDepositMain_cFv = .text:0x802A8650; // type:function size:0x4 +initializeState_ModeReverseChange__17dLytDepositMain_cFv = .text:0x802A8660; // type:function size:0x4 +executeState_ModeReverseChange__17dLytDepositMain_cFv = .text:0x802A8670; // type:function size:0xEC +finalizeState_ModeReverseChange__17dLytDepositMain_cFv = .text:0x802A8760; // type:function size:0x4 +initializeState_ModeScroll__17dLytDepositMain_cFv = .text:0x802A8770; // type:function size:0x4 +executeState_ModeScroll__17dLytDepositMain_cFv = .text:0x802A8780; // type:function size:0x2F4 +finalizeState_ModeScroll__17dLytDepositMain_cFv = .text:0x802A8A80; // type:function size:0x4 +initializeState_ModeRecycle__17dLytDepositMain_cFv = .text:0x802A8A90; // type:function size:0x4 +executeState_ModeRecycle__17dLytDepositMain_cFv = .text:0x802A8AA0; // type:function size:0x198 +finalizeState_ModeRecycle__17dLytDepositMain_cFv = .text:0x802A8C40; // type:function size:0x4 +initializeState_ModeArrangementOut__17dLytDepositMain_cFv = .text:0x802A8C50; // type:function size:0x4 +executeState_ModeArrangementOut__17dLytDepositMain_cFv = .text:0x802A8C60; // type:function size:0x180 +finalizeState_ModeArrangementOut__17dLytDepositMain_cFv = .text:0x802A8DE0; // type:function size:0x4 +initializeState_ModeOut__17dLytDepositMain_cFv = .text:0x802A8DF0; // type:function size:0x4 +executeState_ModeOut__17dLytDepositMain_cFv = .text:0x802A8E00; // type:function size:0x68 +finalizeState_ModeOut__17dLytDepositMain_cFv = .text:0x802A8E70; // type:function size:0x4 +__ct__17dLytDepositMain_cFv = .text:0x802A8E80; // type:function size:0x428 +__dt__56sFStateMgr_c<17dLytDepositMain_c,20sStateMethodUsr_FI_c>Fv = .text:0x802A92B0; // type:function size:0xA4 +__dt__86sStateMgr_c<17dLytDepositMain_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>Fv = .text:0x802A9360; // type:function size:0xA0 +__dt__33sFStateFct_c<17dLytDepositMain_c>Fv = .text:0x802A9400; // type:function size:0x6C +__dt__30sFState_c<17dLytDepositMain_c>Fv = .text:0x802A9470; // type:function size:0x58 +__ct__18dLytDepositStock_cFv = .text:0x802A94D0; // type:function size:0x138 fn_802A9610 = .text:0x802A9610; // type:function size:0x468 fn_802A9A80 = .text:0x802A9A80; // type:function size:0x1EC -fn_802A9C70 = .text:0x802A9C70; // type:function size:0x10 +executeState__86sStateMgr_c<17dLytDepositMain_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>Fv = .text:0x802A9C70; // type:function size:0x10 fn_802A9C80 = .text:0x802A9C80; // type:function size:0x4C fn_802A9CD0 = .text:0x802A9CD0; // type:function size:0x1A8 fn_802A9E80 = .text:0x802A9E80; // type:function size:0x50 -fn_802A9ED0 = .text:0x802A9ED0; // type:function size:0x10 +changeState__86sStateMgr_c<17dLytDepositMain_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>FRC12sStateIDIf_c = .text:0x802A9ED0; // type:function size:0x10 fn_802A9EE0 = .text:0x802A9EE0; // type:function size:0x19C fn_802AA080 = .text:0x802AA080; // type:function size:0x84 fn_802AA110 = .text:0x802AA110; // type:function size:0xE4 @@ -16018,7 +16018,7 @@ fn_802AA3D0 = .text:0x802AA3D0; // type:function size:0xFC fn_802AA4D0 = .text:0x802AA4D0; // type:function size:0xEC fn_802AA5C0 = .text:0x802AA5C0; // type:function size:0xB0 fn_802AA670 = .text:0x802AA670; // type:function size:0xF8 -fn_802AA770 = .text:0x802AA770; // type:function size:0x10 +getStateID__86sStateMgr_c<17dLytDepositMain_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>CFv = .text:0x802AA770; // type:function size:0x10 fn_802AA780 = .text:0x802AA780; // type:function size:0x5C fn_802AA7E0 = .text:0x802AA7E0; // type:function size:0x348 fn_802AAB30 = .text:0x802AAB30; // type:function size:0x388 @@ -16038,105 +16038,105 @@ fn_802AC600 = .text:0x802AC600; // type:function size:0x64 fn_802AC670 = .text:0x802AC670; // type:function size:0x304 fn_802AC980 = .text:0x802AC980; // type:function size:0x54 fn_802AC9E0 = .text:0x802AC9E0; // type:function size:0x90 -fn_802ACA70 = .text:0x802ACA70; // type:function size:0x80 +setPouchItemsVisible__17dLytDepositMain_cFb = .text:0x802ACA70; // type:function size:0x80 fn_802ACAF0 = .text:0x802ACAF0; // type:function size:0x85C fn_802AD350 = .text:0x802AD350; // type:function size:0x18 fn_802AD370 = .text:0x802AD370; // type:function size:0x8C fn_802AD400 = .text:0x802AD400; // type:function size:0x5C fn_802AD460 = .text:0x802AD460; // type:function size:0x60 fn_802AD4C0 = .text:0x802AD4C0; // type:function size:0x5C -fn_802AD520 = .text:0x802AD520; // type:function size:0x4 -fn_802AD530 = .text:0x802AD530; // type:function size:0x68 -fn_802AD5A0 = .text:0x802AD5A0; // type:function size:0x10 -fn_802AD5B0 = .text:0x802AD5B0; // type:function size:0x4 -fn_802AD5C0 = .text:0x802AD5C0; // type:function size:0x4 -fn_802AD5D0 = .text:0x802AD5D0; // type:function size:0xBC -fn_802AD690 = .text:0x802AD690; // type:function size:0x4 -fn_802AD6A0 = .text:0x802AD6A0; // type:function size:0x4 -fn_802AD6B0 = .text:0x802AD6B0; // type:function size:0x14C -fn_802AD800 = .text:0x802AD800; // type:function size:0x4 -fn_802AD810 = .text:0x802AD810; // type:function size:0x4 -fn_802AD820 = .text:0x802AD820; // type:function size:0x280 -fn_802ADAA0 = .text:0x802ADAA0; // type:function size:0x4 -fn_802ADAB0 = .text:0x802ADAB0; // type:function size:0x4 -fn_802ADAC0 = .text:0x802ADAC0; // type:function size:0x60 -fn_802ADB20 = .text:0x802ADB20; // type:function size:0x4 -fn_802ADB30 = .text:0x802ADB30; // type:function size:0x4 -fn_802ADB40 = .text:0x802ADB40; // type:function size:0x5C -fn_802ADBA0 = .text:0x802ADBA0; // type:function size:0x4 -fn_802ADBB0 = .text:0x802ADBB0; // type:function size:0x4 -fn_802ADBC0 = .text:0x802ADBC0; // type:function size:0x60 -fn_802ADC20 = .text:0x802ADC20; // type:function size:0x4 -fn_802ADC30 = .text:0x802ADC30; // type:function size:0x4 -fn_802ADC40 = .text:0x802ADC40; // type:function size:0x5C -fn_802ADCA0 = .text:0x802ADCA0; // type:function size:0x4 -fn_802ADCB0 = .text:0x802ADCB0; // type:function size:0x4 -fn_802ADCC0 = .text:0x802ADCC0; // type:function size:0x5C -fn_802ADD20 = .text:0x802ADD20; // type:function size:0x4 -fn_802ADD30 = .text:0x802ADD30; // type:function size:0x4 -fn_802ADD40 = .text:0x802ADD40; // type:function size:0x80 -fn_802ADDC0 = .text:0x802ADDC0; // type:function size:0x4 -fn_802ADDD0 = .text:0x802ADDD0; // type:function size:0xF8 -fn_802ADED0 = .text:0x802ADED0; // type:function size:0x58 -fn_802ADF30 = .text:0x802ADF30; // type:function size:0x6C -fn_802ADFA0 = .text:0x802ADFA0; // type:function size:0xA0 -fn_802AE040 = .text:0x802AE040; // type:function size:0xA4 -fn_802AE0F0 = .text:0x802AE0F0; // type:function size:0x390 +initializeState_None__13dLytDeposit_cFv = .text:0x802AD520; // type:function size:0x4 +executeState_None__13dLytDeposit_cFv = .text:0x802AD530; // type:function size:0x68 +changeState__82sStateMgr_c<13dLytDeposit_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>FRC12sStateIDIf_c = .text:0x802AD5A0; // type:function size:0x10 +finalizeState_None__13dLytDeposit_cFv = .text:0x802AD5B0; // type:function size:0x4 +initializeState_In__13dLytDeposit_cFv = .text:0x802AD5C0; // type:function size:0x4 +executeState_In__13dLytDeposit_cFv = .text:0x802AD5D0; // type:function size:0xBC +finalizeState_In__13dLytDeposit_cFv = .text:0x802AD690; // type:function size:0x4 +initializeState_Check__13dLytDeposit_cFv = .text:0x802AD6A0; // type:function size:0x4 +executeState_Check__13dLytDeposit_cFv = .text:0x802AD6B0; // type:function size:0x14C +finalizeState_Check__13dLytDeposit_cFv = .text:0x802AD800; // type:function size:0x4 +initializeState_Change__13dLytDeposit_cFv = .text:0x802AD810; // type:function size:0x4 +executeState_Change__13dLytDeposit_cFv = .text:0x802AD820; // type:function size:0x280 +finalizeState_Change__13dLytDeposit_cFv = .text:0x802ADAA0; // type:function size:0x4 +initializeState_Arrangement__13dLytDeposit_cFv = .text:0x802ADAB0; // type:function size:0x4 +executeState_Arrangement__13dLytDeposit_cFv = .text:0x802ADAC0; // type:function size:0x60 +finalizeState_Arrangement__13dLytDeposit_cFv = .text:0x802ADB20; // type:function size:0x4 +initializeState_ReverseChange__13dLytDeposit_cFv = .text:0x802ADB30; // type:function size:0x4 +executeState_ReverseChange__13dLytDeposit_cFv = .text:0x802ADB40; // type:function size:0x5C +finalizeState_ReverseChange__13dLytDeposit_cFv = .text:0x802ADBA0; // type:function size:0x4 +initializeState_Scroll__13dLytDeposit_cFv = .text:0x802ADBB0; // type:function size:0x4 +executeState_Scroll__13dLytDeposit_cFv = .text:0x802ADBC0; // type:function size:0x60 +finalizeState_Scroll__13dLytDeposit_cFv = .text:0x802ADC20; // type:function size:0x4 +initializeState_Recycle__13dLytDeposit_cFv = .text:0x802ADC30; // type:function size:0x4 +executeState_Recycle__13dLytDeposit_cFv = .text:0x802ADC40; // type:function size:0x5C +finalizeState_Recycle__13dLytDeposit_cFv = .text:0x802ADCA0; // type:function size:0x4 +initializeState_ArrangementOut__13dLytDeposit_cFv = .text:0x802ADCB0; // type:function size:0x4 +executeState_ArrangementOut__13dLytDeposit_cFv = .text:0x802ADCC0; // type:function size:0x5C +finalizeState_ArrangementOut__13dLytDeposit_cFv = .text:0x802ADD20; // type:function size:0x4 +initializeState_Out__13dLytDeposit_cFv = .text:0x802ADD30; // type:function size:0x4 +executeState_Out__13dLytDeposit_cFv = .text:0x802ADD40; // type:function size:0x80 +finalizeState_Out__13dLytDeposit_cFv = .text:0x802ADDC0; // type:function size:0x4 +dLytDeposit_c_classInit__Fv = .text:0x802ADDD0; // type:function size:0xF8 +__dt__26sFState_c<13dLytDeposit_c>Fv = .text:0x802ADED0; // type:function size:0x58 +__dt__29sFStateFct_c<13dLytDeposit_c>Fv = .text:0x802ADF30; // type:function size:0x6C +__dt__82sStateMgr_c<13dLytDeposit_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>Fv = .text:0x802ADFA0; // type:function size:0xA0 +__dt__52sFStateMgr_c<13dLytDeposit_c,20sStateMethodUsr_FI_c>Fv = .text:0x802AE040; // type:function size:0xA4 +__dt__17dLytDepositMain_cFv = .text:0x802AE0F0; // type:function size:0x390 fn_802AE480 = .text:0x802AE480; // type:function size:0x54 fn_802AE4E0 = .text:0x802AE4E0; // type:function size:0x70 fn_802AE550 = .text:0x802AE550; // type:function size:0xB0 -fn_802AE600 = .text:0x802AE600; // type:function size:0x10 -fn_802AE610 = .text:0x802AE610; // type:function size:0x10 +getStateID__82sStateMgr_c<13dLytDeposit_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>CFv = .text:0x802AE600; // type:function size:0x10 +executeState__82sStateMgr_c<13dLytDeposit_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>Fv = .text:0x802AE610; // type:function size:0x10 fn_802AE620 = .text:0x802AE620; // type:function size:0x78 fn_802AE6A0 = .text:0x802AE6A0; // type:function size:0x50 fn_802AE6F0 = .text:0x802AE6F0; // type:function size:0xE0 fn_802AE7D0 = .text:0x802AE7D0; // type:function size:0x10C fn_802AE8E0 = .text:0x802AE8E0; // type:function size:0x434 -fn_802AED20 = .text:0x802AED20; // type:function size:0x60 -fn_802AED80 = .text:0x802AED80; // type:function size:0xC -fn_802AED90 = .text:0x802AED90; // type:function size:0x60 -fn_802AEDF0 = .text:0x802AEDF0; // type:function size:0xC -fn_802AEE00 = .text:0x802AEE00; // type:function size:0x60 -fn_802AEE60 = .text:0x802AEE60; // type:function size:0xC -fn_802AEE70 = .text:0x802AEE70; // type:function size:0x1C -fn_802AEE90 = .text:0x802AEE90; // type:function size:0x1C -fn_802AEEB0 = .text:0x802AEEB0; // type:function size:0x1C -fn_802AEED0 = .text:0x802AEED0; // type:function size:0x1C -fn_802AEEF0 = .text:0x802AEEF0; // type:function size:0x1C -fn_802AEF10 = .text:0x802AEF10; // type:function size:0x1C -fn_802AEF30 = .text:0x802AEF30; // type:function size:0x1C -fn_802AEF50 = .text:0x802AEF50; // type:function size:0x1C -fn_802AEF70 = .text:0x802AEF70; // type:function size:0x1C -fn_802AEF90 = .text:0x802AEF90; // type:function size:0x10 -fn_802AEFA0 = .text:0x802AEFA0; // type:function size:0x10 -fn_802AEFB0 = .text:0x802AEFB0; // type:function size:0x10 -fn_802AEFC0 = .text:0x802AEFC0; // type:function size:0x10 -fn_802AEFD0 = .text:0x802AEFD0; // type:function size:0x10 -fn_802AEFE0 = .text:0x802AEFE0; // type:function size:0x10 -fn_802AEFF0 = .text:0x802AEFF0; // type:function size:0x10 -fn_802AF000 = .text:0x802AF000; // type:function size:0x10 -fn_802AF010 = .text:0x802AF010; // type:function size:0x10 -fn_802AF020 = .text:0x802AF020; // type:function size:0x10 -fn_802AF030 = .text:0x802AF030; // type:function size:0x10 -fn_802AF040 = .text:0x802AF040; // type:function size:0x10 -fn_802AF050 = .text:0x802AF050; // type:function size:0x10 -fn_802AF060 = .text:0x802AF060; // type:function size:0x10 -fn_802AF070 = .text:0x802AF070; // type:function size:0x10 -fn_802AF080 = .text:0x802AF080; // type:function size:0x10 -fn_802AF090 = .text:0x802AF090; // type:function size:0x10 -fn_802AF0A0 = .text:0x802AF0A0; // type:function size:0x10 -fn_802AF0B0 = .text:0x802AF0B0; // type:function size:0x10 -fn_802AF0C0 = .text:0x802AF0C0; // type:function size:0x30 -fn_802AF0F0 = .text:0x802AF0F0; // type:function size:0x30 -fn_802AF120 = .text:0x802AF120; // type:function size:0x30 -fn_802AF150 = .text:0x802AF150; // type:function size:0x30 -fn_802AF180 = .text:0x802AF180; // type:function size:0x30 -fn_802AF1B0 = .text:0x802AF1B0; // type:function size:0x30 -LytDeposit__initStates = .text:0x802AF1E0; // type:function size:0xF04 -LytDepositMain__dtor = .text:0x802B00F0; // type:function size:0x58 -LytDeposit__dtor = .text:0x802B0150; // type:function size:0x58 -fn_802B01B0 = .text:0x802B01B0; // type:function size:0x88 -fn_802B0240 = .text:0x802B0240; // type:function size:0x88 +build__29sFStateFct_c<13dLytDeposit_c>FRC12sStateIDIf_c = .text:0x802AED20; // type:function size:0x60 +dispose__29sFStateFct_c<13dLytDeposit_c>FRP10sStateIf_c = .text:0x802AED80; // type:function size:0xC +build__33sFStateFct_c<17dLytDepositMain_c>FRC12sStateIDIf_c = .text:0x802AED90; // type:function size:0x60 +dispose__33sFStateFct_c<17dLytDepositMain_c>FRP10sStateIf_c = .text:0x802AEDF0; // type:function size:0xC +build__34sFStateFct_c<18dLytDepositStock_c>FRC12sStateIDIf_c = .text:0x802AEE00; // type:function size:0x60 +dispose__34sFStateFct_c<18dLytDepositStock_c>FRP10sStateIf_c = .text:0x802AEE60; // type:function size:0xC +initialize__26sFState_c<13dLytDeposit_c>Fv = .text:0x802AEE70; // type:function size:0x1C +execute__26sFState_c<13dLytDeposit_c>Fv = .text:0x802AEE90; // type:function size:0x1C +finalize__26sFState_c<13dLytDeposit_c>Fv = .text:0x802AEEB0; // type:function size:0x1C +initialize__30sFState_c<17dLytDepositMain_c>Fv = .text:0x802AEED0; // type:function size:0x1C +execute__30sFState_c<17dLytDepositMain_c>Fv = .text:0x802AEEF0; // type:function size:0x1C +finalize__30sFState_c<17dLytDepositMain_c>Fv = .text:0x802AEF10; // type:function size:0x1C +initialize__31sFState_c<18dLytDepositStock_c>Fv = .text:0x802AEF30; // type:function size:0x1C +execute__31sFState_c<18dLytDepositStock_c>Fv = .text:0x802AEF50; // type:function size:0x1C +finalize__31sFState_c<18dLytDepositStock_c>Fv = .text:0x802AEF70; // type:function size:0x1C +initializeState__82sStateMgr_c<13dLytDeposit_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>Fv = .text:0x802AEF90; // type:function size:0x10 +finalizeState__82sStateMgr_c<13dLytDeposit_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>Fv = .text:0x802AEFA0; // type:function size:0x10 +refreshState__82sStateMgr_c<13dLytDeposit_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>Fv = .text:0x802AEFB0; // type:function size:0x10 +getState__82sStateMgr_c<13dLytDeposit_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>CFv = .text:0x802AEFC0; // type:function size:0x10 +getNewStateID__82sStateMgr_c<13dLytDeposit_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>CFv = .text:0x802AEFD0; // type:function size:0x10 +getOldStateID__82sStateMgr_c<13dLytDeposit_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>CFv = .text:0x802AEFE0; // type:function size:0x10 +initializeState__86sStateMgr_c<17dLytDepositMain_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>Fv = .text:0x802AEFF0; // type:function size:0x10 +finalizeState__86sStateMgr_c<17dLytDepositMain_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>Fv = .text:0x802AF000; // type:function size:0x10 +refreshState__86sStateMgr_c<17dLytDepositMain_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>Fv = .text:0x802AF010; // type:function size:0x10 +getState__86sStateMgr_c<17dLytDepositMain_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>CFv = .text:0x802AF020; // type:function size:0x10 +getNewStateID__86sStateMgr_c<17dLytDepositMain_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>CFv = .text:0x802AF030; // type:function size:0x10 +getOldStateID__86sStateMgr_c<17dLytDepositMain_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>CFv = .text:0x802AF040; // type:function size:0x10 +initializeState__87sStateMgr_c<18dLytDepositStock_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>Fv = .text:0x802AF050; // type:function size:0x10 +finalizeState__87sStateMgr_c<18dLytDepositStock_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>Fv = .text:0x802AF060; // type:function size:0x10 +refreshState__87sStateMgr_c<18dLytDepositStock_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>Fv = .text:0x802AF070; // type:function size:0x10 +getState__87sStateMgr_c<18dLytDepositStock_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>CFv = .text:0x802AF080; // type:function size:0x10 +getNewStateID__87sStateMgr_c<18dLytDepositStock_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>CFv = .text:0x802AF090; // type:function size:0x10 +getStateID__87sStateMgr_c<18dLytDepositStock_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>CFv = .text:0x802AF0A0; // type:function size:0x10 +getOldStateID__87sStateMgr_c<18dLytDepositStock_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>CFv = .text:0x802AF0B0; // type:function size:0x10 +finalizeState__32sFStateID_c<17dLytDepositMain_c>CFR17dLytDepositMain_c = .text:0x802AF0C0; // type:function size:0x30 +executeState__32sFStateID_c<17dLytDepositMain_c>CFR17dLytDepositMain_c = .text:0x802AF0F0; // type:function size:0x30 +initializeState__32sFStateID_c<17dLytDepositMain_c>CFR17dLytDepositMain_c = .text:0x802AF120; // type:function size:0x30 +finalizeState__28sFStateID_c<13dLytDeposit_c>CFR13dLytDeposit_c = .text:0x802AF150; // type:function size:0x30 +executeState__28sFStateID_c<13dLytDeposit_c>CFR13dLytDeposit_c = .text:0x802AF180; // type:function size:0x30 +initializeState__28sFStateID_c<13dLytDeposit_c>CFR13dLytDeposit_c = .text:0x802AF1B0; // type:function size:0x30 +__sinit_\d_lyt_deposit_cpp = .text:0x802AF1E0; // type:function size:0xF04 +__dt__32sFStateID_c<17dLytDepositMain_c>Fv = .text:0x802B00F0; // type:function size:0x58 +__dt__28sFStateID_c<13dLytDeposit_c>Fv = .text:0x802B0150; // type:function size:0x58 +isSameName__28sFStateID_c<13dLytDeposit_c>CFPCc = .text:0x802B01B0; // type:function size:0x88 +isSameName__32sFStateID_c<17dLytDepositMain_c>CFPCc = .text:0x802B0240; // type:function size:0x88 fn_802B02D0 = .text:0x802B02D0; // type:function size:0x4 fn_802B02E0 = .text:0x802B02E0; // type:function size:0xC fn_802B02F0 = .text:0x802B02F0; // type:function size:0x4 @@ -37446,7 +37446,8 @@ lbl_8053D454 = .data:0x8053D454; // type:object size:0xA data:string lbl_8053D460 = .data:0x8053D460; // type:object size:0xA data:string lbl_8053D46C = .data:0x8053D46C; // type:object size:0x3C lbl_8053D4A8 = .data:0x8053D4A8; // type:object size:0x9 data:string -lbl_8053D4B4 = .data:0x8053D4B4; // type:object size:0x84 +lbl_8053D4B4 = .data:0x8053D4B4; // type:object size:0x9 data:string +lbl_8053D4C0 = .data:0x8053D4C0; // type:object size:0x78 lbl_8053D538 = .data:0x8053D538; // type:object size:0x9 data:string lbl_8053D544 = .data:0x8053D544; // type:object size:0x9 data:string lbl_8053D550 = .data:0x8053D550; // type:object size:0xF data:string @@ -37456,22 +37457,22 @@ lbl_8053D5C8 = .data:0x8053D5C8; // type:object size:0xD data:string lbl_8053D5D8 = .data:0x8053D5D8; // type:object size:0x34 g_profile_LYT_DEPOSIT = .data:0x8053D60C; // type:object size:0xC lbl_8053D618 = .data:0x8053D618; // type:object size:0x1B data:string -lbl_8053D638 = .data:0x8053D638; // type:object size:0x50 -lbl_8053D688 = .data:0x8053D688; // type:object size:0x30 -lbl_8053D6B8 = .data:0x8053D6B8; // type:object size:0x30 -lbl_8053D6E8 = .data:0x8053D6E8; // type:object size:0x18 -lbl_8053D700 = .data:0x8053D700; // type:object size:0x18 -lbl_8053D718 = .data:0x8053D718; // type:object size:0x10 -lbl_8053D728 = .data:0x8053D728; // type:object size:0x30 -lbl_8053D758 = .data:0x8053D758; // type:object size:0x30 -lbl_8053D788 = .data:0x8053D788; // type:object size:0x18 -lbl_8053D7A0 = .data:0x8053D7A0; // type:object size:0x18 -lbl_8053D7B8 = .data:0x8053D7B8; // type:object size:0x30 -lbl_8053D7E8 = .data:0x8053D7E8; // type:object size:0x30 -lbl_8053D818 = .data:0x8053D818; // type:object size:0x18 -lbl_8053D830 = .data:0x8053D830; // type:object size:0x72C -lbl_8053DF5C = .data:0x8053DF5C; // type:object size:0x34 -lbl_8053DF90 = .data:0x8053DF90; // type:object size:0x38 +__vt__13dLytDeposit_c = .data:0x8053D638; // type:object size:0x50 +__vt__52sFStateMgr_c<13dLytDeposit_c,20sStateMethodUsr_FI_c> = .data:0x8053D688; // type:object size:0x30 +__vt__82sStateMgr_c<13dLytDeposit_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c> = .data:0x8053D6B8; // type:object size:0x30 +__vt__29sFStateFct_c<13dLytDeposit_c> = .data:0x8053D6E8; // type:object size:0x18 +__vt__26sFState_c<13dLytDeposit_c> = .data:0x8053D700; // type:object size:0x18 +__vt__17dLytDepositMain_c = .data:0x8053D718; // type:object size:0x10 +__vt__56sFStateMgr_c<17dLytDepositMain_c,20sStateMethodUsr_FI_c> = .data:0x8053D728; // type:object size:0x30 +__vt__86sStateMgr_c<17dLytDepositMain_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c> = .data:0x8053D758; // type:object size:0x30 +__vt__33sFStateFct_c<17dLytDepositMain_c> = .data:0x8053D788; // type:object size:0x18 +__vt__30sFState_c<17dLytDepositMain_c> = .data:0x8053D7A0; // type:object size:0x18 +__vt__57sFStateMgr_c<18dLytDepositStock_c,20sStateMethodUsr_FI_c> = .data:0x8053D7B8; // type:object size:0x30 +__vt__87sStateMgr_c<18dLytDepositStock_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c> = .data:0x8053D7E8; // type:object size:0x30 +__vt__34sFStateFct_c<18dLytDepositStock_c> = .data:0x8053D818; // type:object size:0x18 +__vt__31sFState_c<18dLytDepositStock_c> = .data:0x8053D830; // type:object size:0x72C +__vt__32sFStateID_c<17dLytDepositMain_c> = .data:0x8053DF5C; // type:object size:0x34 +__vt__28sFStateID_c<13dLytDeposit_c> = .data:0x8053DF90; // type:object size:0x38 lbl_8053DFC8 = .data:0x8053DFC8; // type:object size:0x16 data:string lbl_8053DFE0 = .data:0x8053DFE0; // type:object size:0xB data:string lbl_8053DFEC = .data:0x8053DFEC; // type:object size:0x17 data:string diff --git a/include/d/lyt/d_lyt_common_arrow.h b/include/d/lyt/d_lyt_common_arrow.h index ccab07b9..c2e60b02 100644 --- a/include/d/lyt/d_lyt_common_arrow.h +++ b/include/d/lyt/d_lyt_common_arrow.h @@ -43,6 +43,10 @@ public: return field_0x6B8; } + bool isChangingState() const { + return mIsChangingState; + } + nw4r::lyt::Bounding *getArrowBounding(s32 idx) const { return mpBoundings[idx]; } diff --git a/include/d/lyt/d_lyt_deposit.h b/include/d/lyt/d_lyt_deposit.h index aa8804c9..a8a94d02 100644 --- a/include/d/lyt/d_lyt_deposit.h +++ b/include/d/lyt/d_lyt_deposit.h @@ -1,14 +1,129 @@ #ifndef D_LYT_DEPOSIT_H #define D_LYT_DEPOSIT_H -class dLytDeposit_c { +#include "d/d_cursor_hit_check.h" +#include "d/d_pad_nav.h" +#include "d/lyt/d2d.h" +#include "d/lyt/d_lyt_base.h" +#include "d/lyt/d_lyt_common_arrow.h" +#include "d/lyt/d_lyt_common_icon_item.h" +#include "d/lyt/d_lyt_deposit_box_cursor.h" +#include "d/lyt/d_lyt_deposit_stock.h" +#include "d/lyt/d_textbox.h" +#include "d/lyt/d_window.h" +#include "nw4r/lyt/lyt_bounding.h" +#include "nw4r/lyt/lyt_pane.h" +#include "s/s_State.hpp" + +class dLytDepositMain_c { public: + dLytDepositMain_c(); + virtual ~dLytDepositMain_c() { + dPadNav::setNavEnabled(false, false); + } + + bool build(d2d::ResAccIf_c *resAcc); + +private: + void setPouchItemsVisible(bool visible); + void fn_802AA7E0(); + void fn_802AD370(); + void fn_802A9E80(); + + void fn_802AAFC0(); + void fn_802AB210(); + void fn_802ACAF0(); + void fn_802ABB60(); + + STATE_FUNC_DECLARE(dLytDepositMain_c, ModeNone); + STATE_FUNC_DECLARE(dLytDepositMain_c, ModeIn); + STATE_FUNC_DECLARE(dLytDepositMain_c, ModeCheck); + STATE_FUNC_DECLARE(dLytDepositMain_c, ModeChange); + STATE_FUNC_DECLARE(dLytDepositMain_c, ModeArrangement); + STATE_FUNC_DECLARE(dLytDepositMain_c, ModeReverseChange); + STATE_FUNC_DECLARE(dLytDepositMain_c, ModeScroll); + STATE_FUNC_DECLARE(dLytDepositMain_c, ModeRecycle); + STATE_FUNC_DECLARE(dLytDepositMain_c, ModeArrangementOut); + STATE_FUNC_DECLARE(dLytDepositMain_c, ModeOut); + + /* 0x00004 */ UI_STATE_MGR_DECLARE(dLytDepositMain_c); + /* 0x00040 */ d2d::LytBase_c mLyt; + /* 0x000D0 */ d2d::AnmGroup_c mAnm[36]; + + /* 0x009D0 */ nw4r::lyt::Bounding *mpBoundingBox; + /* 0x009D4 */ nw4r::lyt::Bounding *mpBoundingChoices; + /* 0x009D8 */ nw4r::lyt::Bounding *mpBoundingCleanUp; + /* 0x009DC */ nw4r::lyt::Bounding *mpBoundingItem12; + /* 0x009E0 */ nw4r::lyt::Bounding *mpItemBoundings[12]; + /* 0x00A10 */ nw4r::lyt::Bounding *mpRingBoundings[8]; + /* 0x00A30 */ nw4r::lyt::Pane *mpPaneABtn; + /* 0x00A34 */ nw4r::lyt::Pane *mpPanePrice; + /* 0x00A38 */ nw4r::lyt::Pane *mpPaneCommonArrow; + /* 0x00A3C */ dWindow_c *mpWindows[2]; + /* 0x00A44 */ dTextBox_c *mpSizeBoxes[2]; + /* 0x00A4C */ dCursorHitCheckLyt_c mCsHitCheck; + + u8 _0x00002[0x8]; + + /* 0x00A7C */ dLytDepositStock_c mStock[3]; + /* 0x143F0 */ dLytDepositBoxCursor_c mCursor; + /* 0x14D48 */ dLytCommonIconItem_c mPouchItems[8]; + /* 0x18D88 */ dLytCommonArrow_c mArrow; + /* 0x19458 */ d2d::SubPaneList mSubpaneList1; + /* 0x19464 */ d2d::SubPaneListNode mNodes1[3]; + /* 0x19494 */ d2d::SubPaneList mSubpaneList2; + /* 0x194A0 */ d2d::SubPaneListNode mNodes2[8]; + /* 0x19520 */ bool field_0x19520; + /* 0x19521 */ bool field_0x19521; + /* 0x19522 */ bool field_0x19522; + /* 0x19523 */ bool field_0x19523; + /* 0x19524 */ bool field_0x19524; + /* 0x19525 */ bool field_0x19525; + /* 0x19526 */ bool field_0x19526; + /* 0x19527 */ bool field_0x19527; + /* 0x19528 */ bool field_0x19528; + /* 0x19529 */ bool field_0x19529; + /* 0x1952A */ bool field_0x1952A; + /* 0x1952B */ bool field_0x1952B; + /* 0x1952C */ bool field_0x1952C; + /* 0x19530 */ UNKWORD field_0x19530; + /* 0x19534 */ UNKWORD field_0x19534; + /* 0x19538 */ UNKWORD field_0x19538; + /* 0x1953C */ UNKWORD field_0x1953C; + /* 0x19540 */ UNKWORD field_0x19540; + /* 0x19544 */ UNKWORD field_0x19544; + /* 0x19548 */ UNKWORD field_0x19548; + /* 0x1954C */ UNKWORD field_0x1954C; + /* 0x19550 */ UNKWORD field_0x19550; + /* 0x19554 */ UNKWORD field_0x19554; + /* 0x19558 */ u8 mPouchItemIds[8]; +}; + +class dLytDeposit_c : public dLytBase_c { +public: + dLytDeposit_c() : mStateMgr(*this) {} + static dLytDeposit_c *GetInstance() { return sInstance; } private: static dLytDeposit_c *sInstance; + + STATE_FUNC_DECLARE(dLytDeposit_c, None); + STATE_FUNC_DECLARE(dLytDeposit_c, In); + STATE_FUNC_DECLARE(dLytDeposit_c, Check); + STATE_FUNC_DECLARE(dLytDeposit_c, Change); + STATE_FUNC_DECLARE(dLytDeposit_c, Arrangement); + STATE_FUNC_DECLARE(dLytDeposit_c, ReverseChange); + STATE_FUNC_DECLARE(dLytDeposit_c, Scroll); + STATE_FUNC_DECLARE(dLytDeposit_c, Recycle); + STATE_FUNC_DECLARE(dLytDeposit_c, ArrangementOut); + STATE_FUNC_DECLARE(dLytDeposit_c, Out); + + /* 0x08C */ UI_STATE_MGR_DECLARE(dLytDeposit_c); + /* 0x0C8 */ d2d::ResAccIf_c mResAcc; + /* 0x438 */ dLytDepositMain_c mMain; }; #endif diff --git a/include/d/lyt/d_lyt_deposit_box_cursor.h b/include/d/lyt/d_lyt_deposit_box_cursor.h index f14b35dd..7278d42e 100644 --- a/include/d/lyt/d_lyt_deposit_box_cursor.h +++ b/include/d/lyt/d_lyt_deposit_box_cursor.h @@ -5,6 +5,7 @@ #include "d/lyt/d_lyt_common_icon_item.h" #include "nw4r/lyt/lyt_pane.h" +// made up name class dLytDepositBoxCursor_c : public d2d::dSubPane { public: enum ItemLocation_e { @@ -13,6 +14,7 @@ public: }; public: + dLytDepositBoxCursor_c() : mSlot(-1), field_0x950(0), mItemLocation(0) {} /* vt 0x0C */ virtual bool build(d2d::ResAccIf_c *resAcc) override; /* vt 0x10 */ virtual bool remove() override; /* vt 0x14 */ virtual bool execute() override; diff --git a/include/d/lyt/d_lyt_deposit_stock.h b/include/d/lyt/d_lyt_deposit_stock.h index a39e9690..414654cb 100644 --- a/include/d/lyt/d_lyt_deposit_stock.h +++ b/include/d/lyt/d_lyt_deposit_stock.h @@ -43,7 +43,8 @@ public: void nextPage(bool unk); void prevPage(bool unk); void fn_80156530(bool unk); - + + void navigateToItem(); void navigateToSell(); void navigateToSort(); void navigateToFinish(); @@ -62,12 +63,15 @@ public: STATE_MGR_DEFINE_UTIL_EXECUTESTATE(dLytDepositStock_c); + s32 getCurrentNavTarget() const { + return mCurrentNavTarget; + } + private: static const s32 NUM_ICONS_PER_PAGE = 12; static const s32 NUM_PAGES = 5; void initIcons(); - void navigateToItem(); void loadItems(s32 hiddenSlot); void loadIcon(s32 idx); void navigateToPouch(); diff --git a/src/d/lyt/d_lyt_deposit.cpp b/src/d/lyt/d_lyt_deposit.cpp new file mode 100644 index 00000000..e2a657bb --- /dev/null +++ b/src/d/lyt/d_lyt_deposit.cpp @@ -0,0 +1,345 @@ +#include "d/lyt/d_lyt_deposit.h" + +#include "common.h" +#include "d/d_cs_base.h" +#include "d/d_cursor_hit_check.h" +#include "d/lyt/d2d.h" +#include "f/f_profile.h" +#include "f/f_profile_name.h" + +STATE_DEFINE(dLytDepositMain_c, ModeNone); +STATE_DEFINE(dLytDepositMain_c, ModeIn); +STATE_DEFINE(dLytDepositMain_c, ModeCheck); +STATE_DEFINE(dLytDepositMain_c, ModeChange); +STATE_DEFINE(dLytDepositMain_c, ModeArrangement); +STATE_DEFINE(dLytDepositMain_c, ModeReverseChange); +STATE_DEFINE(dLytDepositMain_c, ModeScroll); +STATE_DEFINE(dLytDepositMain_c, ModeRecycle); +STATE_DEFINE(dLytDepositMain_c, ModeArrangementOut); +STATE_DEFINE(dLytDepositMain_c, ModeOut); + +#define DEPOSIT_ANIM_IN 0 +#define DEPOSIT_ANIM_IN_BOX 1 +#define DEPOSIT_ANIM_FLASH_OFFSET 5 +#define DEPOSIT_ANIM_INPUT 22 +#define DEPOSIT_ANIM_ARROW_LOOP 24 +#define DEPOSIT_ANIM_BTN_LOOP 25 +#define DEPOSIT_ANIM_LOOP 26 + +#define DEPOSIT_NUM_RING_ITEMS 8 + +void dLytDepositMain_c::initializeState_ModeNone() {} +void dLytDepositMain_c::executeState_ModeNone() { + field_0x19520 = true; +} +void dLytDepositMain_c::finalizeState_ModeNone() {} + +void dLytDepositMain_c::initializeState_ModeIn() {} +void dLytDepositMain_c::executeState_ModeIn() { + if (field_0x19538 == 0) { + if (!field_0x19520) { + if (mAnm[DEPOSIT_ANIM_IN].isEndReached()) { + mAnm[DEPOSIT_ANIM_IN].setAnimEnable(false); + mpBoundingBox->SetVisible(true); + mpBoundingChoices->SetVisible(true); + mpBoundingItem12->SetVisible(true); + mpBoundingCleanUp->SetVisible(false); + setPouchItemsVisible(true); + mStock[0].navigateToItem(); + mStock[0].fn_80156530(false); + field_0x19530 = -DEPOSIT_NUM_RING_ITEMS; + dCsBase_c::GetInstance()->setCursorStickTargetPane(mpRingBoundings[0]); + field_0x1954C = 0; + field_0x19520 = true; + } + } + } else { + if (!field_0x19520) { + if (mAnm[DEPOSIT_ANIM_IN_BOX].isEndReached() && mArrow.isChangingState()) { + mAnm[DEPOSIT_ANIM_IN_BOX].setAnimEnable(false); + mpBoundingBox->SetVisible(false); + mpBoundingChoices->SetVisible(true); + mpBoundingItem12->SetVisible(true); + mpBoundingCleanUp->SetVisible(true); + setPouchItemsVisible(false); + mStock[0].navigateToItem(); + mStock[0].fn_80156530(true); + s32 target = mStock[0].getCurrentNavTarget(); + if (target < 0) { + target += 12; + } + dCsBase_c::GetInstance()->setCursorStickTargetPane(mpItemBoundings[target]); + field_0x1954C = 1; + field_0x19520 = true; + } + } + } +} +void dLytDepositMain_c::finalizeState_ModeIn() {} + +void dLytDepositMain_c::initializeState_ModeCheck() { + field_0x19521 = false; + field_0x19522 = false; +} +void dLytDepositMain_c::executeState_ModeCheck() { + fn_802AAFC0(); + fn_802AB210(); + fn_802ACAF0(); + fn_802ABB60(); + field_0x19520 = true; +} +void dLytDepositMain_c::finalizeState_ModeCheck() {} + +void dLytDepositMain_c::initializeState_ModeChange() { + field_0x19521 = false; + field_0x19522 = false; +} +void dLytDepositMain_c::executeState_ModeChange() {} +void dLytDepositMain_c::finalizeState_ModeChange() {} + +void dLytDepositMain_c::initializeState_ModeArrangement() {} +void dLytDepositMain_c::executeState_ModeArrangement() {} +void dLytDepositMain_c::finalizeState_ModeArrangement() {} + +void dLytDepositMain_c::initializeState_ModeReverseChange() {} +void dLytDepositMain_c::executeState_ModeReverseChange() {} +void dLytDepositMain_c::finalizeState_ModeReverseChange() {} + +void dLytDepositMain_c::initializeState_ModeScroll() {} +void dLytDepositMain_c::executeState_ModeScroll() {} +void dLytDepositMain_c::finalizeState_ModeScroll() {} + +void dLytDepositMain_c::initializeState_ModeRecycle() {} +void dLytDepositMain_c::executeState_ModeRecycle() {} +void dLytDepositMain_c::finalizeState_ModeRecycle() {} + +void dLytDepositMain_c::initializeState_ModeArrangementOut() {} +void dLytDepositMain_c::executeState_ModeArrangementOut() {} +void dLytDepositMain_c::finalizeState_ModeArrangementOut() {} + +void dLytDepositMain_c::initializeState_ModeOut() {} +void dLytDepositMain_c::executeState_ModeOut() {} +void dLytDepositMain_c::finalizeState_ModeOut() {} + +dLytDepositMain_c::dLytDepositMain_c() : mStateMgr(*this) {} + +static const d2d::LytBrlanMapping brlanMap[] = { + { "depositBox_00_in.brlan", "G_inOut_00"}, + { "depositBox_00_inBox.brlan", "G_inOut_01"}, + { "depositBox_00_change.brlan", "G_change_00"}, + { "depositBox_00_selectOn.brlan", "G_flashBox_00"}, + { "depositBox_00_selectOn.brlan", "G_flashPoach_00"}, + { "depositBox_00_flash.brlan", "G_poachFlash_00"}, + { "depositBox_00_flash.brlan", "G_poachFlash_01"}, + { "depositBox_00_flash.brlan", "G_poachFlash_02"}, + { "depositBox_00_flash.brlan", "G_poachFlash_03"}, + { "depositBox_00_flash.brlan", "G_poachFlash_04"}, + { "depositBox_00_flash.brlan", "G_poachFlash_05"}, + { "depositBox_00_flash.brlan", "G_poachFlash_06"}, + { "depositBox_00_flash.brlan", "G_poachFlash_07"}, + { "depositBox_00_scrollR.brlan", "G_scroll_00"}, + { "depositBox_00_scrollL.brlan", "G_scroll_00"}, + {"depositBox_00_btnDecide.brlan", "G_btn_00"}, + {"depositBox_00_btnDecide.brlan", "G_btn_01"}, + {"depositBox_00_btnDecide.brlan", "G_btn_02"}, + { "depositBox_00_out.brlan", "G_inOut_00"}, + { "depositBox_00_btnOnOff.brlan", "G_btn_00"}, + { "depositBox_00_btnOnOff.brlan", "G_btn_01"}, + { "depositBox_00_recycle.brlan", "G_recycle_00"}, + { "depositBox_00_input.brlan", "G_input_00"}, + { "depositBox_00_input.brlan", "G_input_01"}, + {"depositBox_00_arrowLoop.brlan", "G_arrowLoop_00"}, + { "depositBox_00_btnLoop.brlan", "G_btnLoop_00"}, + { "depositBox_00_loop.brlan", "G_loop_00"}, + { "depositBox_00_have.brlan", "G_itemA_00"}, + { "depositBox_00_have.brlan", "G_itemB_00"}, + { "depositBox_00_have.brlan", "G_itemC_00"}, + { "depositBox_00_have.brlan", "G_itemD_00"}, + { "depositBox_00_have.brlan", "G_itemE_00"}, + { "depositBox_00_have.brlan", "G_itemF_00"}, + { "depositBox_00_have.brlan", "G_itemG_00"}, + { "depositBox_00_have.brlan", "G_itemH_00"}, + { "depositBox_00_keta.brlan", "G_keta_00"}, +}; + +#define DEPOSIT_NUM_ANIMS 36 + +static const char *sRingBoundingNames[] = { + "B_ringA_00", "B_ringB_00", "B_ringC_00", "B_ringD_00", "B_ringE_00", "B_ringF_00", "B_ringG_00", "B_ringH_00", +}; + +#define DEPOSIT_NUM_RING_BOUNDINGS 8 + +static const char *sItemBoundingNames[] = { + "B_item_00", "B_item_01", "B_item_02", "B_item_03", "B_item_04", "B_item_05", + "B_item_06", "B_item_07", "B_item_08", "B_item_09", "B_item_10", "B_item_11", +}; + +#define DEPOSIT_NUM_ITEM_BOUNDINGS 12 + +static const char *sWindowNames[] = { + "W_bgP_00", + "W_bgP_01", +}; + +static const char *sGroupName = "G_ref_00"; + +bool dLytDepositMain_c::build(d2d::ResAccIf_c *resAcc) { + mLyt.setResAcc(resAcc); + mLyt.build("depositBox_00.brlyt", nullptr); + + for (int i = 0; i < DEPOSIT_NUM_ANIMS; i++) { + mAnm[i].init(brlanMap[i].mFile, resAcc, mLyt.getLayout(), brlanMap[i].mName); + mAnm[i].bind(false); + mAnm[i].setAnimEnable(false); + } + + mpBoundingBox = mLyt.findBounding("B_box_00"); + mpBoundingChoices = mLyt.findBounding("B_choices_00"); + mpBoundingChoices->SetVisible(true); + mpBoundingCleanUp = mLyt.findBounding("B_cleanUp_00"); + mpBoundingCleanUp->SetVisible(true); + mpBoundingItem12 = mLyt.findBounding("B_item_12"); + + mpPaneABtn = mLyt.findPane("N_aBtn_00"); + mpPanePrice = mLyt.findPane("N_price_00"); + mpPaneCommonArrow = mLyt.findPane("N_commonArrow_00"); + + for (int i = 0; i < DEPOSIT_NUM_RING_BOUNDINGS; i++) { + mpRingBoundings[i] = mLyt.findBounding(sRingBoundingNames[i]); + mpRingBoundings[i]->SetVisible(false); + } + + for (int i = 0; i < DEPOSIT_NUM_ITEM_BOUNDINGS; i++) { + mpItemBoundings[i] = mLyt.findBounding(sItemBoundingNames[i]); + mpItemBoundings[i]->SetVisible(false); + } + + for (int i = 0; i < 2; i++) { + mpWindows[i] = mLyt.getWindow(sWindowNames[i]); + mpSizeBoxes[i] = mLyt.getSizeBoxInWindow(sWindowNames[i]); + mpWindows[i]->UpdateSize(mpSizeBoxes[i], 32.0f); + } + + mAnm[DEPOSIT_ANIM_IN].setAnimEnable(true); + mAnm[DEPOSIT_ANIM_IN].setFrame(mAnm[DEPOSIT_ANIM_IN].getLastFrame()); + + mAnm[DEPOSIT_ANIM_ARROW_LOOP].setAnimEnable(true); + mAnm[DEPOSIT_ANIM_ARROW_LOOP].setFrame(0.0f); + + mAnm[DEPOSIT_ANIM_BTN_LOOP].setAnimEnable(true); + mAnm[DEPOSIT_ANIM_BTN_LOOP].setFrame(0.0f); + + mAnm[DEPOSIT_ANIM_LOOP].setAnimEnable(true); + mAnm[DEPOSIT_ANIM_LOOP].setFrame(0.0f); + + mAnm[DEPOSIT_ANIM_INPUT].setAnimEnable(true); + mAnm[DEPOSIT_ANIM_INPUT].setForwardOnce(); + mAnm[DEPOSIT_ANIM_INPUT].setFrame(mAnm[DEPOSIT_ANIM_INPUT].getLastFrame()); + + for (int i = 0; i < DEPOSIT_NUM_RING_ITEMS; i++) { + mAnm[i + DEPOSIT_ANIM_FLASH_OFFSET].setAnimEnable(true); + mAnm[i + DEPOSIT_ANIM_FLASH_OFFSET].setToEnd(); + } + + mLyt.calc(); + + mAnm[DEPOSIT_ANIM_IN].setAnimEnable(false); + mAnm[DEPOSIT_ANIM_ARROW_LOOP].setAnimEnable(false); + mAnm[DEPOSIT_ANIM_INPUT].setAnimEnable(false); + + for (int i = 0; i < DEPOSIT_NUM_RING_ITEMS; i++) { + mAnm[i + DEPOSIT_ANIM_FLASH_OFFSET].setAnimEnable(false); + } + + fn_802AA7E0(); + mCsHitCheck.init(mLyt.getLayout()->GetRootPane(), 0x1, 0, 0); + dCsMgr_c::GetInstance()->registCursorTarget(&mCsHitCheck); + fn_802AD370(); + + mCursor.build(resAcc); + + mArrow.build(); + mArrow.setState(1); + + fn_802A9E80(); + + field_0x19521 = false; + field_0x19522 = false; + field_0x19523 = false; + field_0x19524 = false; + field_0x19525 = false; + field_0x19526 = false; + field_0x19527 = false; + field_0x19528 = false; + field_0x19529 = false; + field_0x1952A = true; + field_0x1952B = false; + field_0x1952C = true; + + field_0x19530 = -1; + field_0x19534 = -1; + field_0x19538 = 0; + field_0x1953C = 0; + field_0x19540 = 0; + field_0x19544 = 0; + field_0x19548 = -1; + field_0x1954C = 0; + field_0x19550 = 0; + field_0x19554 = 0; + + return true; +} + +STATE_DEFINE(dLytDeposit_c, None); +STATE_DEFINE(dLytDeposit_c, In); +STATE_DEFINE(dLytDeposit_c, Check); +STATE_DEFINE(dLytDeposit_c, Change); +STATE_DEFINE(dLytDeposit_c, Arrangement); +STATE_DEFINE(dLytDeposit_c, ReverseChange); +STATE_DEFINE(dLytDeposit_c, Scroll); +STATE_DEFINE(dLytDeposit_c, Recycle); +STATE_DEFINE(dLytDeposit_c, ArrangementOut); +STATE_DEFINE(dLytDeposit_c, Out); + +SPECIAL_BASE_PROFILE(LYT_DEPOSIT, dLytDeposit_c, fProfile::LYT_DEPOSIT, 0x2B9, 0); + +void dLytDeposit_c::initializeState_None() {} +void dLytDeposit_c::executeState_None() {} +void dLytDeposit_c::finalizeState_None() {} + +void dLytDeposit_c::initializeState_In() {} +void dLytDeposit_c::executeState_In() {} +void dLytDeposit_c::finalizeState_In() {} + +void dLytDeposit_c::initializeState_Check() {} +void dLytDeposit_c::executeState_Check() {} +void dLytDeposit_c::finalizeState_Check() {} + +void dLytDeposit_c::initializeState_Change() {} +void dLytDeposit_c::executeState_Change() {} +void dLytDeposit_c::finalizeState_Change() {} + +void dLytDeposit_c::initializeState_Arrangement() {} +void dLytDeposit_c::executeState_Arrangement() {} +void dLytDeposit_c::finalizeState_Arrangement() {} + +void dLytDeposit_c::initializeState_ReverseChange() {} +void dLytDeposit_c::executeState_ReverseChange() {} +void dLytDeposit_c::finalizeState_ReverseChange() {} + +void dLytDeposit_c::initializeState_Scroll() {} +void dLytDeposit_c::executeState_Scroll() {} +void dLytDeposit_c::finalizeState_Scroll() {} + +void dLytDeposit_c::initializeState_Recycle() {} +void dLytDeposit_c::executeState_Recycle() {} +void dLytDeposit_c::finalizeState_Recycle() {} + +void dLytDeposit_c::initializeState_ArrangementOut() {} +void dLytDeposit_c::executeState_ArrangementOut() {} +void dLytDeposit_c::finalizeState_ArrangementOut() {} + +void dLytDeposit_c::initializeState_Out() {} +void dLytDeposit_c::executeState_Out() {} +void dLytDeposit_c::finalizeState_Out() {} From 98f3ce5b397d2c70cdd17553a58ba16199170401 Mon Sep 17 00:00:00 2001 From: robojumper Date: Tue, 23 Dec 2025 22:51:06 +0100 Subject: [PATCH 03/11] More deposit --- config/SOUE01/splits.txt | 4 +- config/SOUE01/symbols.txt | 82 +- include/d/d_cs_base.h | 11 + include/d/d_pouch.h | 4 + include/d/lyt/d_lyt_common_arrow.h | 3 +- include/d/lyt/d_lyt_cursor_stick.h | 3 + include/d/lyt/d_lyt_deposit.h | 100 ++- include/d/lyt/d_lyt_deposit_box_cursor.h | 10 +- include/d/lyt/d_lyt_deposit_stock.h | 74 +- include/d/lyt/d_lyt_util_items.h | 2 + src/d/lyt/d_lyt_common_arrow.cpp | 7 +- src/d/lyt/d_lyt_deposit.cpp | 931 +++++++++++++++++++++-- src/d/lyt/d_lyt_deposit_box_cursor.cpp | 1 + src/d/lyt/d_lyt_deposit_stock.cpp | 56 +- 14 files changed, 1147 insertions(+), 141 deletions(-) diff --git a/config/SOUE01/splits.txt b/config/SOUE01/splits.txt index 223e95e4..029135b6 100644 --- a/config/SOUE01/splits.txt +++ b/config/SOUE01/splits.txt @@ -1664,7 +1664,7 @@ d/lyt/d_lyt_demo_dowsing.cpp: d/lyt/d_lyt_shop.cpp: .text start:0x802A17D0 end:0x802A7FD8 align:16 .ctors start:0x804DB884 end:0x804DB888 - .rodata start:0x804EF130 end:0x804EF970 + .rodata start:0x804EF130 end:0x804EF8B0 .data start:0x8053BF50 end:0x8053CFC8 .sbss start:0x805759B0 end:0x805759B8 .bss start:0x805B67C0 end:0x805B6C18 @@ -1672,7 +1672,7 @@ d/lyt/d_lyt_shop.cpp: d/lyt/d_lyt_deposit.cpp: .text start:0x802A7FE0 end:0x802B02C8 align:16 .ctors start:0x804DB888 end:0x804DB88C - .rodata start:0x804EF970 end:0x804EFA90 + .rodata start:0x804EF8B0 end:0x804EFA90 .data start:0x8053CFC8 end:0x8053DFC8 .sdata start:0x80573C10 end:0x80573C30 .sbss start:0x805759B8 end:0x805759D0 diff --git a/config/SOUE01/symbols.txt b/config/SOUE01/symbols.txt index c4fc0d68..d7d68eea 100644 --- a/config/SOUE01/symbols.txt +++ b/config/SOUE01/symbols.txt @@ -9121,7 +9121,7 @@ __sinit_\d_lyt_save_msg_window_cpp = .text:0x80166540; // type:function size:0x3 __dt__34sFStateID_c<19dLytSaveMsgWindow_c>Fv = .text:0x80166880; // type:function size:0x58 scope:weak isSameName__34sFStateID_c<19dLytSaveMsgWindow_c>CFPCc = .text:0x801668E0; // type:function size:0x88 scope:weak fn_80166970 = .text:0x80166970; // type:function size:0x58 -fn_801669D0 = .text:0x801669D0; // type:function size:0x4 +convertLytPouchSlot2__Fl = .text:0x801669D0; // type:function size:0x4 hasPouchSlot__Flb = .text:0x801669E0; // type:function size:0x50 getPouchItemIdForIndex__Flb = .text:0x80166A30; // type:function size:0x5C getPouchItemForSlot__Flb = .text:0x80166A90; // type:function size:0x70 @@ -9204,7 +9204,7 @@ executeState__86sStateMgr_c<17dLytCommonArrow_c,20sStateMethodUsr_FI_c,12sFState getStateID__86sStateMgr_c<17dLytCommonArrow_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>CFv = .text:0x801685C0; // type:function size:0x10 scope:weak draw__17dLytCommonArrow_cFv = .text:0x801685D0; // type:function size:0x34 setState__17dLytCommonArrow_cFl = .text:0x80168610; // type:function size:0x24 -setTranslate__17dLytCommonArrow_cFPC3Vec = .text:0x80168640; // type:function size:0x34 +setTranslate__17dLytCommonArrow_cFPC7mVec2_c = .text:0x80168640; // type:function size:0x34 requestIn__17dLytCommonArrow_cFv = .text:0x80168680; // type:function size:0x70 requestOut__17dLytCommonArrow_cFv = .text:0x801686F0; // type:function size:0x70 fn_80168760__17dLytCommonArrow_cFv = .text:0x80168760; // type:function size:0x2C @@ -10091,9 +10091,9 @@ changeItemPouchExtensionCounter = .text:0x8018AA20; // type:function size:0x10C getExtraAmmoInPouchByType = .text:0x8018AB30; // type:function size:0x98 getExtraAmmoCapacityByType = .text:0x8018ABD0; // type:function size:0x98 getAdditionalCapacitySizeForItem = .text:0x8018AC70; // type:function size:0x60 -fn_8018ACD0 = .text:0x8018ACD0; // type:function size:0xC4 -fn_8018ADA0 = .text:0x8018ADA0; // type:function size:0xA0 -trySwapAdventurePouchItems = .text:0x8018AE40; // type:function size:0x120 +swapStockAndPouchItems__Fll = .text:0x8018ACD0; // type:function size:0xC4 +swapStockItems__Fll = .text:0x8018ADA0; // type:function size:0xA0 +swapAdventurePouchItems__Fll = .text:0x8018AE40; // type:function size:0x120 fn_8018AF60 = .text:0x8018AF60; // type:function size:0x204 itemCheckFindItemSlot__F7ITEM_ID = .text:0x8018B170; // type:function size:0x60 fn_8018B1D0 = .text:0x8018B1D0; // type:function size:0x60 @@ -16002,49 +16002,49 @@ __dt__86sStateMgr_c<17dLytDepositMain_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13 __dt__33sFStateFct_c<17dLytDepositMain_c>Fv = .text:0x802A9400; // type:function size:0x6C __dt__30sFState_c<17dLytDepositMain_c>Fv = .text:0x802A9470; // type:function size:0x58 __ct__18dLytDepositStock_cFv = .text:0x802A94D0; // type:function size:0x138 -fn_802A9610 = .text:0x802A9610; // type:function size:0x468 -fn_802A9A80 = .text:0x802A9A80; // type:function size:0x1EC +build__17dLytDepositMain_cFPQ23d2d10ResAccIf_c = .text:0x802A9610; // type:function size:0x468 +execute__17dLytDepositMain_cFv = .text:0x802A9A80; // type:function size:0x1EC executeState__86sStateMgr_c<17dLytDepositMain_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>Fv = .text:0x802A9C70; // type:function size:0x10 -fn_802A9C80 = .text:0x802A9C80; // type:function size:0x4C -fn_802A9CD0 = .text:0x802A9CD0; // type:function size:0x1A8 -fn_802A9E80 = .text:0x802A9E80; // type:function size:0x50 +draw__17dLytDepositMain_cFv = .text:0x802A9C80; // type:function size:0x4C +remove__17dLytDepositMain_cFv = .text:0x802A9CD0; // type:function size:0x1A8 +setModeNone__17dLytDepositMain_cFv = .text:0x802A9E80; // type:function size:0x50 changeState__86sStateMgr_c<17dLytDepositMain_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>FRC12sStateIDIf_c = .text:0x802A9ED0; // type:function size:0x10 -fn_802A9EE0 = .text:0x802A9EE0; // type:function size:0x19C -fn_802AA080 = .text:0x802AA080; // type:function size:0x84 -fn_802AA110 = .text:0x802AA110; // type:function size:0xE4 -fn_802AA200 = .text:0x802AA200; // type:function size:0x90 +setModeIn__17dLytDepositMain_cFv = .text:0x802A9EE0; // type:function size:0x19C +setModeCheck__17dLytDepositMain_cFv = .text:0x802AA080; // type:function size:0x84 +setModeChange__17dLytDepositMain_cFb = .text:0x802AA110; // type:function size:0xE4 +setModeArrangement__17dLytDepositMain_cFv = .text:0x802AA200; // type:function size:0x90 fn_802AA290 = .text:0x802AA290; // type:function size:0x13C fn_802AA3D0 = .text:0x802AA3D0; // type:function size:0xFC fn_802AA4D0 = .text:0x802AA4D0; // type:function size:0xEC fn_802AA5C0 = .text:0x802AA5C0; // type:function size:0xB0 fn_802AA670 = .text:0x802AA670; // type:function size:0xF8 getStateID__86sStateMgr_c<17dLytDepositMain_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>CFv = .text:0x802AA770; // type:function size:0x10 -fn_802AA780 = .text:0x802AA780; // type:function size:0x5C -fn_802AA7E0 = .text:0x802AA7E0; // type:function size:0x348 -fn_802AAB30 = .text:0x802AAB30; // type:function size:0x388 -fn_802AAEC0 = .text:0x802AAEC0; // type:function size:0xF8 -fn_802AAFC0 = .text:0x802AAFC0; // type:function size:0xB4 -fn_802AB080 = .text:0x802AB080; // type:function size:0x188 -fn_802AB210 = .text:0x802AB210; // type:function size:0x474 +loadItems__17dLytDepositMain_cFl = .text:0x802AA780; // type:function size:0x5C +fn_802AA7E0__17dLytDepositMain_cFv = .text:0x802AA7E0; // type:function size:0x348 +fn_802AAB30__17dLytDepositMain_cFv = .text:0x802AAB30; // type:function size:0x388 +fn_802AAEC0__17dLytDepositMain_cFl = .text:0x802AAEC0; // type:function size:0xF8 +fn_802AAFC0__17dLytDepositMain_cFv = .text:0x802AAFC0; // type:function size:0xB4 +fn_802AB080__17dLytDepositMain_cFv = .text:0x802AB080; // type:function size:0x188 +fn_802AB210__17dLytDepositMain_cFv = .text:0x802AB210; // type:function size:0x474 fn_802AB690 = .text:0x802AB690; // type:function size:0xB8 fn_802AB750 = .text:0x802AB750; // type:function size:0x2E8 -fn_802ABA40 = .text:0x802ABA40; // type:function size:0x114 -fn_802ABB60 = .text:0x802ABB60; // type:function size:0x580 -fn_802AC0E0 = .text:0x802AC0E0; // type:function size:0x1A8 -fn_802AC290 = .text:0x802AC290; // type:function size:0xC4 +loadItemText__17dLytDepositMain_cFll = .text:0x802ABA40; // type:function size:0x114 +fn_802ABB60__17dLytDepositMain_cFv = .text:0x802ABB60; // type:function size:0x580 +fn_802AC0E0__17dLytDepositMain_cFl = .text:0x802AC0E0; // type:function size:0x1A8 +fn_802AC290__17dLytDepositMain_cFl = .text:0x802AC290; // type:function size:0xC4 fn_802AC360 = .text:0x802AC360; // type:function size:0x58 -fn_802AC3C0 = .text:0x802AC3C0; // type:function size:0x234 +fn_802AC3C0__17dLytDepositMain_cFv = .text:0x802AC3C0; // type:function size:0x234 fn_802AC600 = .text:0x802AC600; // type:function size:0x64 -fn_802AC670 = .text:0x802AC670; // type:function size:0x304 +fn_802AC670__17dLytDepositMain_cFv = .text:0x802AC670; // type:function size:0x304 fn_802AC980 = .text:0x802AC980; // type:function size:0x54 fn_802AC9E0 = .text:0x802AC9E0; // type:function size:0x90 setPouchItemsVisible__17dLytDepositMain_cFb = .text:0x802ACA70; // type:function size:0x80 -fn_802ACAF0 = .text:0x802ACAF0; // type:function size:0x85C -fn_802AD350 = .text:0x802AD350; // type:function size:0x18 -fn_802AD370 = .text:0x802AD370; // type:function size:0x8C -fn_802AD400 = .text:0x802AD400; // type:function size:0x5C -fn_802AD460 = .text:0x802AD460; // type:function size:0x60 -fn_802AD4C0 = .text:0x802AD4C0; // type:function size:0x5C +checkForItemPickupOrDrop__17dLytDepositMain_cFv = .text:0x802ACAF0; // type:function size:0x85C +getItemSellValueFrame__17dLytDepositMain_cFl = .text:0x802AD350; // type:function size:0x18 +fn_802AD370__17dLytDepositMain_cFv = .text:0x802AD370; // type:function size:0x8C +fn_802AD400__17dLytDepositMain_cFv = .text:0x802AD400; // type:function size:0x5C +fn_802AD460__17dLytDepositMain_cFv = .text:0x802AD460; // type:function size:0x60 +fn_802AD4C0__17dLytDepositMain_cFv = .text:0x802AD4C0; // type:function size:0x5C initializeState_None__13dLytDeposit_cFv = .text:0x802AD520; // type:function size:0x4 executeState_None__13dLytDeposit_cFv = .text:0x802AD530; // type:function size:0x68 changeState__82sStateMgr_c<13dLytDeposit_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>FRC12sStateIDIf_c = .text:0x802AD5A0; // type:function size:0x10 @@ -16082,16 +16082,16 @@ __dt__29sFStateFct_c<13dLytDeposit_c>Fv = .text:0x802ADF30; // type:function siz __dt__82sStateMgr_c<13dLytDeposit_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>Fv = .text:0x802ADFA0; // type:function size:0xA0 __dt__52sFStateMgr_c<13dLytDeposit_c,20sStateMethodUsr_FI_c>Fv = .text:0x802AE040; // type:function size:0xA4 __dt__17dLytDepositMain_cFv = .text:0x802AE0F0; // type:function size:0x390 -fn_802AE480 = .text:0x802AE480; // type:function size:0x54 -fn_802AE4E0 = .text:0x802AE4E0; // type:function size:0x70 -fn_802AE550 = .text:0x802AE550; // type:function size:0xB0 +build__13dLytDeposit_cFv = .text:0x802AE480; // type:function size:0x54 +create__13dLytDeposit_cFv = .text:0x802AE4E0; // type:function size:0x70 +execute__13dLytDeposit_cFv = .text:0x802AE550; // type:function size:0xB0 getStateID__82sStateMgr_c<13dLytDeposit_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>CFv = .text:0x802AE600; // type:function size:0x10 executeState__82sStateMgr_c<13dLytDeposit_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>Fv = .text:0x802AE610; // type:function size:0x10 -fn_802AE620 = .text:0x802AE620; // type:function size:0x78 -fn_802AE6A0 = .text:0x802AE6A0; // type:function size:0x50 -fn_802AE6F0 = .text:0x802AE6F0; // type:function size:0xE0 -fn_802AE7D0 = .text:0x802AE7D0; // type:function size:0x10C -fn_802AE8E0 = .text:0x802AE8E0; // type:function size:0x434 +draw__13dLytDeposit_cFv = .text:0x802AE620; // type:function size:0x78 +doDelete__13dLytDeposit_cFv = .text:0x802AE6A0; // type:function size:0x50 +checkForNavRight__13dLytDeposit_cFv = .text:0x802AE6F0; // type:function size:0xE0 +checkForNavLeft__13dLytDeposit_cFv = .text:0x802AE7D0; // type:function size:0x10C +__dt__13dLytDeposit_cFv = .text:0x802AE8E0; // type:function size:0x434 build__29sFStateFct_c<13dLytDeposit_c>FRC12sStateIDIf_c = .text:0x802AED20; // type:function size:0x60 dispose__29sFStateFct_c<13dLytDeposit_c>FRP10sStateIf_c = .text:0x802AED80; // type:function size:0xC build__33sFStateFct_c<17dLytDepositMain_c>FRC12sStateIDIf_c = .text:0x802AED90; // type:function size:0x60 diff --git a/include/d/d_cs_base.h b/include/d/d_cs_base.h index b7c54201..b27832bc 100644 --- a/include/d/d_cs_base.h +++ b/include/d/d_cs_base.h @@ -26,6 +26,9 @@ public: void setVisible(bool val) { mVisible = val; } + bool isVisible() const { + return mVisible; + } void setDrawDirectly(bool val) { mDrawDirectly = val; } @@ -52,6 +55,14 @@ public: mCursorStick.setShouldBeOn(visible); } + void setCursorStickPriority(u8 priority) { + mCursorStick.setPriority(priority); + } + + void setCursorStickPriority2(u8 priority) { + mCursorStick.setPriority2(priority); + } + bool isCursorStickVisible() const { return mCursorStick.getShouldBeOn(); } diff --git a/include/d/d_pouch.h b/include/d/d_pouch.h index feacc53d..b7ca10cb 100644 --- a/include/d/d_pouch.h +++ b/include/d/d_pouch.h @@ -19,6 +19,10 @@ bool isItemShield(s32 item); u8 adventurePouchFindItemSlot(ITEM_ID item); u32 adventurePouchCountItem(ITEM_ID itemId); +bool swapAdventurePouchItems(s32 slot1, s32 slot2); +bool swapStockAndPouchItems(s32 pouchSlot, s32 stockSlot); +bool swapStockItems(s32 slot1, s32 slot2); + #define ITEM_CHECK_SLOT_NONE 60 u16 itemCheckFindItemSlot(ITEM_ID item); diff --git a/include/d/lyt/d_lyt_common_arrow.h b/include/d/lyt/d_lyt_common_arrow.h index c2e60b02..21a65fb7 100644 --- a/include/d/lyt/d_lyt_common_arrow.h +++ b/include/d/lyt/d_lyt_common_arrow.h @@ -6,6 +6,7 @@ // vtable order #include "d/d_cursor_hit_check.h" // clang-format on +#include "m/m_vec.h" #include "nw4r/lyt/lyt_bounding.h" #include "s/s_State.hpp" @@ -59,9 +60,9 @@ public: mBackwards = b; } bool fn_80168760(); + void setTranslate(const mVec2_c *); private: - void setTranslate(const Vec *); void displayElement(s32, f32); void unbindAt(s32); void tickDown(d2d::AnmGroup_c *); diff --git a/include/d/lyt/d_lyt_cursor_stick.h b/include/d/lyt/d_lyt_cursor_stick.h index 7f5fef42..80670a58 100644 --- a/include/d/lyt/d_lyt_cursor_stick.h +++ b/include/d/lyt/d_lyt_cursor_stick.h @@ -23,6 +23,9 @@ public: static bool drawDirectly(); void setPriority(u8 priority); + void setPriority2(u8 priority) { + mLyt.setPriority(priority); + } void setTargetPane(const nw4r::lyt::Pane *pane); void setShouldBeOn(bool value) { diff --git a/include/d/lyt/d_lyt_deposit.h b/include/d/lyt/d_lyt_deposit.h index a8a94d02..9e437649 100644 --- a/include/d/lyt/d_lyt_deposit.h +++ b/include/d/lyt/d_lyt_deposit.h @@ -23,18 +23,71 @@ public: } bool build(d2d::ResAccIf_c *resAcc); + bool execute(); + bool draw(); + bool remove(); + + void setModeNone(); + void setModeIn(); + void setModeCheck(); + void setModeChange(bool unk); + void setModeArrangement(); + + bool isSellableItem() const { + return field_0x19524 && mItemSellValue > 0; + } + + s32 getArrowDirection() const { + return mStock[STOCK_ACTIVE].getArrowDirection(); + } + + void setField_0x1952C(bool b) { + field_0x1952C = b; + } + + s32 getStateStep() const { + return mStateStep; + } + + bool isIdle() const { + return mIsIdle; + } private: + static const s32 NUM_STOCKS = 3; + static const s32 STOCK_ACTIVE = 0; + + static const s32 RING_NUM_ITEMS = 8; + + static const s32 SLOT_STOCK_OFFSET = 8; + + static const s32 NUM_ICONS_PER_PAGE = 12; + static const s32 NUM_PAGES = 5; + void setPouchItemsVisible(bool visible); void fn_802AA7E0(); void fn_802AD370(); - void fn_802A9E80(); void fn_802AAFC0(); void fn_802AB210(); - void fn_802ACAF0(); + void checkForItemPickupOrDrop(); void fn_802ABB60(); + void fn_802AB080(); + void fn_802AC3C0(); + void fn_802AD4C0(); + void loadItemText(s32 itemId, s32 where); + void fn_802AC670(); + void fn_802AC290(s32); + void fn_802AD460(); + void loadItems(s32 hiddenSlot); + s32 getItemSellValueFrame(s32 value); + void fn_802AC0E0(s32); + void fn_802AAEC0(s32); + void fn_8018ADA0(s32); + void fn_802AAB30(); + void fn_802AD400(); + STATE_FUNC_DECLARE(dLytDepositMain_c, ModeNone); STATE_FUNC_DECLARE(dLytDepositMain_c, ModeIn); STATE_FUNC_DECLARE(dLytDepositMain_c, ModeCheck); @@ -65,15 +118,15 @@ private: u8 _0x00002[0x8]; - /* 0x00A7C */ dLytDepositStock_c mStock[3]; + /* 0x00A7C */ dLytDepositStock_c mStock[NUM_STOCKS]; /* 0x143F0 */ dLytDepositBoxCursor_c mCursor; - /* 0x14D48 */ dLytCommonIconItem_c mPouchItems[8]; + /* 0x14D48 */ dLytCommonIconItem_c mPouchItems[RING_NUM_ITEMS]; /* 0x18D88 */ dLytCommonArrow_c mArrow; - /* 0x19458 */ d2d::SubPaneList mSubpaneList1; - /* 0x19464 */ d2d::SubPaneListNode mNodes1[3]; - /* 0x19494 */ d2d::SubPaneList mSubpaneList2; - /* 0x194A0 */ d2d::SubPaneListNode mNodes2[8]; - /* 0x19520 */ bool field_0x19520; + /* 0x19458 */ d2d::SubPaneList mStockList; + /* 0x19464 */ d2d::SubPaneListNode mStockNodes[NUM_STOCKS]; + /* 0x19494 */ d2d::SubPaneList mRingList; + /* 0x194A0 */ d2d::SubPaneListNode mRingNodes[RING_NUM_ITEMS]; + /* 0x19520 */ bool mIsIdle; /* 0x19521 */ bool field_0x19521; /* 0x19522 */ bool field_0x19522; /* 0x19523 */ bool field_0x19523; @@ -82,32 +135,44 @@ private: /* 0x19526 */ bool field_0x19526; /* 0x19527 */ bool field_0x19527; /* 0x19528 */ bool field_0x19528; - /* 0x19529 */ bool field_0x19529; + /* 0x19529 */ bool mHasScrolledOtherStocks; /* 0x1952A */ bool field_0x1952A; /* 0x1952B */ bool field_0x1952B; /* 0x1952C */ bool field_0x1952C; - /* 0x19530 */ UNKWORD field_0x19530; - /* 0x19534 */ UNKWORD field_0x19534; - /* 0x19538 */ UNKWORD field_0x19538; - /* 0x1953C */ UNKWORD field_0x1953C; + /* 0x19530 */ s32 mCurrentPouchNavTarget; + /* 0x19534 */ s32 mCurrentlyHoldingItemSlot; + /* 0x19538 */ s32 mStateStep; + /* 0x1953C */ s32 mCursorLocation; /* 0x19540 */ UNKWORD field_0x19540; - /* 0x19544 */ UNKWORD field_0x19544; + /* 0x19544 */ s32 mItemSellValue; /* 0x19548 */ UNKWORD field_0x19548; /* 0x1954C */ UNKWORD field_0x1954C; /* 0x19550 */ UNKWORD field_0x19550; /* 0x19554 */ UNKWORD field_0x19554; - /* 0x19558 */ u8 mPouchItemIds[8]; + /* 0x19558 */ u8 mPouchItemIds[RING_NUM_ITEMS]; }; class dLytDeposit_c : public dLytBase_c { public: dLytDeposit_c() : mStateMgr(*this) {} + virtual ~dLytDeposit_c() { + removeLyt(); + } static dLytDeposit_c *GetInstance() { return sInstance; } + virtual bool build() override; + virtual int create() override; + virtual int execute() override; + virtual int draw() override; + virtual int doDelete() override; + private: + bool checkForNavRight(); + bool checkForNavLeft(); + static dLytDeposit_c *sInstance; STATE_FUNC_DECLARE(dLytDeposit_c, None); @@ -124,6 +189,9 @@ private: /* 0x08C */ UI_STATE_MGR_DECLARE(dLytDeposit_c); /* 0x0C8 */ d2d::ResAccIf_c mResAcc; /* 0x438 */ dLytDepositMain_c mMain; + /* 0x19998 */ bool field_0x19998; + /* 0x19999 */ bool field_0x19999; + /* 0x1999A */ bool field_0x1999A; }; #endif diff --git a/include/d/lyt/d_lyt_deposit_box_cursor.h b/include/d/lyt/d_lyt_deposit_box_cursor.h index 7278d42e..4c403b48 100644 --- a/include/d/lyt/d_lyt_deposit_box_cursor.h +++ b/include/d/lyt/d_lyt_deposit_box_cursor.h @@ -10,7 +10,7 @@ class dLytDepositBoxCursor_c : public d2d::dSubPane { public: enum ItemLocation_e { LOC_POUCH, - LOC_DEPOSIT, + LOC_STOCK, }; public: @@ -36,6 +36,14 @@ public: void updateSlot(s32 location, s32 slot, s32 unk, bool unk2); void fn_801580A0(); + bool isVisible() const { + return mIsVisible; + } + + void setVisible(bool b) { + mIsVisible = b; + } + private: void initIcon(); void realizeNav(); diff --git a/include/d/lyt/d_lyt_deposit_stock.h b/include/d/lyt/d_lyt_deposit_stock.h index 414654cb..faf8eb85 100644 --- a/include/d/lyt/d_lyt_deposit_stock.h +++ b/include/d/lyt/d_lyt_deposit_stock.h @@ -67,7 +67,67 @@ public: return mCurrentNavTarget; } -private: + bool isModeSort() const { + return mIsModeSort; + } + + bool isModePouch() const { + return mIsModePouch; + } + + bool isModeSell() const { + return mIsModeSell; + } + + void disableModeSort() { + mIsModeSort = false; + } + + void disableModePouch() { + mIsModePouch = false; + } + + void disableModeSell() { + mIsModeSell = false; + } + + void returnToNormalMode() { + mIsModeFinish = false; + mIsModeSell = false; + mIsModeSort = false; + mIsModePouch = false; + mSavedArrowDirection = ARROW_NONE; + } + + u8 getItem(s32 idx) const { + return mItemIds[idx]; + } + + u8 getPage() const { + return mItemPage; + } + + void setPage(u8 page) { + mItemPage = page; + } + + s32 getActiveItem() const { + return mItemIds[mCurrentNavTarget]; + } + + void setSellBlocked(bool v) { + mIsSellBlocked = v; + } + + void setSortBlocked(bool v) { + mIsSortBlocked = v; + } + + s32 getArrowDirection() const { + return mArrowDirection; + } + +//private: static const s32 NUM_ICONS_PER_PAGE = 12; static const s32 NUM_PAGES = 5; @@ -93,12 +153,12 @@ private: /* 0x6778 */ d2d::SubPaneList mSubpaneList; /* 0x6784 */ d2d::SubPaneListNode mNodes[NUM_ICONS_PER_PAGE]; /* 0x6844 */ bool field_0x6844; - /* 0x6845 */ bool field_0x6845; - /* 0x6846 */ bool field_0x6846; - /* 0x6847 */ bool field_0x6847; - /* 0x6848 */ bool field_0x6848; - /* 0x6849 */ bool field_0x6849; - /* 0x684A */ bool field_0x684A; + /* 0x6845 */ bool mIsModePouch; + /* 0x6846 */ bool mIsModeSell; + /* 0x6847 */ bool mIsModeSort; + /* 0x6848 */ bool mIsModeFinish; + /* 0x6849 */ bool mIsSellBlocked; + /* 0x684A */ bool mIsSortBlocked; /* 0x684B */ bool field_0x684B; /* 0x684C */ bool field_0x684C; /* 0x684D */ bool field_0x684D; diff --git a/include/d/lyt/d_lyt_util_items.h b/include/d/lyt/d_lyt_util_items.h index e384e10a..d6bf4819 100644 --- a/include/d/lyt/d_lyt_util_items.h +++ b/include/d/lyt/d_lyt_util_items.h @@ -18,6 +18,8 @@ enum SongLifeTreeSeedStatus_e { SONG_LIFETREE_HAS_SOTH = 2, }; +s32 convertLytPouchSlot2(s32 fileSlot); + u8 getSongLifeTreeStatus(); /** 0: no sword, 6: TMS */ diff --git a/src/d/lyt/d_lyt_common_arrow.cpp b/src/d/lyt/d_lyt_common_arrow.cpp index 8801b033..f328cd12 100644 --- a/src/d/lyt/d_lyt_common_arrow.cpp +++ b/src/d/lyt/d_lyt_common_arrow.cpp @@ -4,6 +4,7 @@ #include "d/d_cursor_hit_check.h" #include "d/d_pad_nav.h" #include "d/snd/d_snd_small_effect_mgr.h" +#include "m/m_vec.h" #include "rvl/MTX/mtx.h" #include "toBeSorted/arc_managers/layout_arc_manager.h" @@ -96,8 +97,10 @@ void dLytCommonArrow_c::setState(s32 state) { } } -void dLytCommonArrow_c::setTranslate(const Vec *arg) { - nw4r::math::VEC3 v(*arg); +void dLytCommonArrow_c::setTranslate(const mVec2_c *arg) { + nw4r::math::VEC3 v; + v.x = arg->x; + v.y = arg->y; v.z = 0.0f; mLytBase.getLayout()->GetRootPane()->SetTranslate(v); } diff --git a/src/d/lyt/d_lyt_deposit.cpp b/src/d/lyt/d_lyt_deposit.cpp index e2a657bb..8548de8d 100644 --- a/src/d/lyt/d_lyt_deposit.cpp +++ b/src/d/lyt/d_lyt_deposit.cpp @@ -2,10 +2,95 @@ #include "common.h" #include "d/d_cs_base.h" +#include "d/d_cs_game.h" #include "d/d_cursor_hit_check.h" +#include "d/d_message.h" +#include "d/d_pad.h" +#include "d/d_pad_nav.h" +#include "d/d_pouch.h" #include "d/lyt/d2d.h" +#include "d/lyt/d_lyt_deposit_box_cursor.h" +#include "d/lyt/d_lyt_deposit_stock.h" +#include "d/lyt/d_lyt_util_items.h" +#include "d/lyt/d_textbox.h" +#include "d/snd/d_snd_small_effect_mgr.h" +#include "d/snd/d_snd_wzsound.h" #include "f/f_profile.h" #include "f/f_profile_name.h" +#include "m/m_pad.h" +#include "m/m_vec.h" +#include "nw4r/math/math_types.h" +#include "sized_string.h" +#include "toBeSorted/arc_managers/layout_arc_manager.h" +#include "toBeSorted/file_manager.h" + +struct DepositSellValues { + /* 0x00 */ u8 itemId; + /* 0x02 */ u16 sellValue; //< 0 -> unsellable +}; + +static const DepositSellValues sItemData[] = { + { ITEM_HEART_POTION, 0}, + { ITEM_HEART_POTION_PLUS, 0}, + { ITEM_HEART_POTION_PLUS_PLUS, 0}, + + { ITEM_AIR_POTION, 0}, + { ITEM_AIR_POTION_PLUS, 0}, + + { ITEM_STAMINA_POTION, 0}, + { ITEM_STAMINA_POTION_PLUS, 0}, + + { ITEM_GUARDIAN_POTION, 0}, + { ITEM_GUARDIAN_POTION_PLUS, 0}, + + { ITEM_REVITALIZING_POTION, 0}, + { ITEM_REVITALIZING_POTION_PLUS, 0}, + {ITEM_REVITALIZING_POTION_PLUS_PLUS, 0}, + + { ITEM_FAIRY, 0}, + { ITEM_WATER, 0}, + { ITEM_SACRED_WATER, 0}, + { ITEM_MUSHROOM_SPORES, 0}, + { ITEM_GLITTERING_SPORES, 0}, + { ITEM_HOT_SOUP, 0}, + { ITEM_COLD_SOUP, 0}, + { ITEM_BOTTLE, 0}, + + { ITEM_WOODEN_SHIELD, 20}, + { ITEM_BANDED_SHIELD, 50}, + { ITEM_BRACED_SHIELD, 100}, + + { ITEM_IRON_SHIELD, 50}, + { ITEM_REINFORCED_SHIELD, 80}, + { ITEM_FORTIFIED_SHIELD, 150}, + + { ITEM_SACRED_SHIELD, 300}, + { ITEM_DIVINE_SHIELD, 400}, + { ITEM_GODDESS_SHIELD, 500}, + + { ITEM_HYLIAN_SHIELD, 0}, + + { ITEM_SMALL_SEED_SATCHEL, 50}, + { ITEM_MEDIUM_SEED_SATCHEL, 80}, + { ITEM_LARGE_SEED_SATCHEL, 150}, + + { ITEM_SMALL_QUIVER, 50}, + { ITEM_MEDIUM_QUIVER, 80}, + { ITEM_LARGE_QUIVER, 150}, + + { ITEM_SMALL_BOMB_BAG, 50}, + { ITEM_MEDIUM_BOMB_BAG, 80}, + { ITEM_LARGE_BOMB_BAG, 150}, + + { ITEM_RUPEE_MEDAL_ALSO, 100}, + { ITEM_HEART_MEDAL, 0}, + { ITEM_RUPEE_MEDAL, 0}, + { ITEM_TREASURE_MEDAL, 0}, + { ITEM_POTION_MEDAL, 0}, + { ITEM_LIFE_MEDAL, 0}, + { ITEM_CURSED_MEDAL, 0}, + { ITEM_BUG_MEDAL, 0}, +}; STATE_DEFINE(dLytDepositMain_c, ModeNone); STATE_DEFINE(dLytDepositMain_c, ModeIn); @@ -20,24 +105,39 @@ STATE_DEFINE(dLytDepositMain_c, ModeOut); #define DEPOSIT_ANIM_IN 0 #define DEPOSIT_ANIM_IN_BOX 1 +#define DEPOSIT_ANIM_CHANGE 2 +#define DEPOSIT_ANIM_SELECT_ON_BOX 3 +#define DEPOSIT_ANIM_SELECT_ON_POUCH 4 #define DEPOSIT_ANIM_FLASH_OFFSET 5 -#define DEPOSIT_ANIM_INPUT 22 +#define DEPOSIT_ANIM_SCROLL_R 13 +#define DEPOSIT_ANIM_SCROLL_L 14 +#define DEPOSIT_ANIM_BTN_DECIDE_00 15 +#define DEPOSIT_ANIM_BTN_DECIDE_01 16 +#define DEPOSIT_ANIM_BTN_DECIDE_02 17 +#define DEPOSIT_ANIM_OUT 18 +#define DEPOSIT_ANIM_BTN_ON_OFF_00 19 +#define DEPOSIT_ANIM_BTN_ON_OFF_01 20 +#define DEPOSIT_ANIM_RECYCLE 21 +#define DEPOSIT_ANIM_INPUT_00 22 +#define DEPOSIT_ANIM_INPUT_01 23 #define DEPOSIT_ANIM_ARROW_LOOP 24 #define DEPOSIT_ANIM_BTN_LOOP 25 #define DEPOSIT_ANIM_LOOP 26 +#define DEPOSIT_ANIM_HAVE_OFFSET 27 +#define DEPOSIT_ANIM_KETA 35 -#define DEPOSIT_NUM_RING_ITEMS 8 +#define DEPOSIT_NUM_ANIMS 36 void dLytDepositMain_c::initializeState_ModeNone() {} void dLytDepositMain_c::executeState_ModeNone() { - field_0x19520 = true; + mIsIdle = true; } void dLytDepositMain_c::finalizeState_ModeNone() {} void dLytDepositMain_c::initializeState_ModeIn() {} void dLytDepositMain_c::executeState_ModeIn() { - if (field_0x19538 == 0) { - if (!field_0x19520) { + if (mStateStep == 0) { + if (!mIsIdle) { if (mAnm[DEPOSIT_ANIM_IN].isEndReached()) { mAnm[DEPOSIT_ANIM_IN].setAnimEnable(false); mpBoundingBox->SetVisible(true); @@ -45,16 +145,16 @@ void dLytDepositMain_c::executeState_ModeIn() { mpBoundingItem12->SetVisible(true); mpBoundingCleanUp->SetVisible(false); setPouchItemsVisible(true); - mStock[0].navigateToItem(); - mStock[0].fn_80156530(false); - field_0x19530 = -DEPOSIT_NUM_RING_ITEMS; + mStock[STOCK_ACTIVE].navigateToItem(); + mStock[STOCK_ACTIVE].fn_80156530(false); + mCurrentPouchNavTarget = -RING_NUM_ITEMS; dCsBase_c::GetInstance()->setCursorStickTargetPane(mpRingBoundings[0]); field_0x1954C = 0; - field_0x19520 = true; + mIsIdle = true; } } } else { - if (!field_0x19520) { + if (!mIsIdle) { if (mAnm[DEPOSIT_ANIM_IN_BOX].isEndReached() && mArrow.isChangingState()) { mAnm[DEPOSIT_ANIM_IN_BOX].setAnimEnable(false); mpBoundingBox->SetVisible(false); @@ -62,15 +162,15 @@ void dLytDepositMain_c::executeState_ModeIn() { mpBoundingItem12->SetVisible(true); mpBoundingCleanUp->SetVisible(true); setPouchItemsVisible(false); - mStock[0].navigateToItem(); - mStock[0].fn_80156530(true); - s32 target = mStock[0].getCurrentNavTarget(); + mStock[STOCK_ACTIVE].navigateToItem(); + mStock[STOCK_ACTIVE].fn_80156530(true); + s32 target = mStock[STOCK_ACTIVE].getCurrentNavTarget(); if (target < 0) { - target += 12; + target += NUM_ICONS_PER_PAGE; } dCsBase_c::GetInstance()->setCursorStickTargetPane(mpItemBoundings[target]); field_0x1954C = 1; - field_0x19520 = true; + mIsIdle = true; } } } @@ -84,9 +184,9 @@ void dLytDepositMain_c::initializeState_ModeCheck() { void dLytDepositMain_c::executeState_ModeCheck() { fn_802AAFC0(); fn_802AB210(); - fn_802ACAF0(); + checkForItemPickupOrDrop(); fn_802ABB60(); - field_0x19520 = true; + mIsIdle = true; } void dLytDepositMain_c::finalizeState_ModeCheck() {} @@ -94,31 +194,246 @@ void dLytDepositMain_c::initializeState_ModeChange() { field_0x19521 = false; field_0x19522 = false; } -void dLytDepositMain_c::executeState_ModeChange() {} +void dLytDepositMain_c::executeState_ModeChange() { + if (mIsIdle) { + fn_802AC3C0(); + fn_802AB080(); + if (field_0x19550 != 0) { + field_0x19550--; + } else { + mStock[STOCK_ACTIVE].handleNavOrPoint(); + if (!mStock[STOCK_ACTIVE].isModeSort()) { + checkForItemPickupOrDrop(); + } + } + + if (!dPadNav::isPointerVisible()) { + if (!mCursor.isVisible() && mCurrentlyHoldingItemSlot >= 0) { + mCursor.setVisible(true); + } + + if (mStock[STOCK_ACTIVE].isModePouch()) { + mStock[STOCK_ACTIVE].disableModePouch(); + field_0x19522 = true; + } + } + + if (mStock[STOCK_ACTIVE].getCurrentNavTarget() >= 0) { + dCsBase_c::GetInstance()->setCursorStickTargetPane( + mpItemBoundings[mStock[STOCK_ACTIVE].getCurrentNavTarget()] + ); + fn_802AD4C0(); + } + s32 slot = mStock[STOCK_ACTIVE].getCurrentSlot(); + s32 v; + if (mCurrentlyHoldingItemSlot >= 8 && slot == mCurrentlyHoldingItemSlot - 8) { + v = -1; + } else if (mStock[STOCK_ACTIVE].getCurrentNavTarget() < 0) { + v = -1; + } else { + s32 item = mStock[STOCK_ACTIVE].getItem(mStock[STOCK_ACTIVE].getCurrentNavTarget()); + if (item != 12 && item != 50 && slot >= 0 && slot < NUM_ICONS_PER_PAGE * NUM_PAGES) { + v = FileManager::GetInstance()->getItemCheckItem(slot); + if (v == 0) { + v = -1; + } + } else { + v = -1; + } + } + loadItemText(v, true); + fn_802ABB60(); + fn_802AC670(); + } else { + if (mAnm[DEPOSIT_ANIM_CHANGE].isStop() && mArrow.isChangingState()) { + mAnm[DEPOSIT_ANIM_CHANGE].setAnimEnable(false); + mAnm[DEPOSIT_ANIM_SELECT_ON_BOX].setAnimEnable(false); + mpBoundingBox->SetVisible(false); + mpBoundingCleanUp->SetVisible(true); + mStock[STOCK_ACTIVE].fn_80156530(true); + setPouchItemsVisible(false); + field_0x1954C = 1; + mStock[STOCK_ACTIVE].returnToNormalMode(); + s32 target = mStock[STOCK_ACTIVE].getCurrentNavTarget(); + if (target < 0) { + target += NUM_ICONS_PER_PAGE; + } + dCsBase_c::GetInstance()->setCursorStickTargetPane(mpItemBoundings[target]); + if (!dPadNav::isPointerVisible()) { + fn_802AC290(target); + } + fn_802AD460(); + fn_802AD4C0(); + field_0x19550 = 1; + mIsIdle = true; + } + } +} void dLytDepositMain_c::finalizeState_ModeChange() {} void dLytDepositMain_c::initializeState_ModeArrangement() {} -void dLytDepositMain_c::executeState_ModeArrangement() {} +void dLytDepositMain_c::executeState_ModeArrangement() { + if (!mIsIdle) { + if (mAnm[DEPOSIT_ANIM_BTN_DECIDE_01].isEndReached()) { + mAnm[DEPOSIT_ANIM_BTN_DECIDE_01].setAnimEnable(false); + loadItems(mCurrentlyHoldingItemSlot - SLOT_STOCK_OFFSET); + mStock[STOCK_ACTIVE].fn_80156530(true); + field_0x1954C = 1; + mIsIdle = true; + } + } +} void dLytDepositMain_c::finalizeState_ModeArrangement() {} void dLytDepositMain_c::initializeState_ModeReverseChange() {} -void dLytDepositMain_c::executeState_ModeReverseChange() {} +void dLytDepositMain_c::executeState_ModeReverseChange() { + if (mStateStep == 0) { + if (!mIsIdle && mAnm[DEPOSIT_ANIM_CHANGE].isStop() && mArrow.isChangingState()) { + mAnm[DEPOSIT_ANIM_CHANGE].setAnimEnable(false); + mAnm[DEPOSIT_ANIM_SELECT_ON_POUCH].setAnimEnable(false); + mpBoundingBox->SetVisible(true); + mpBoundingCleanUp->SetVisible(false); + setPouchItemsVisible(true); + mStock[STOCK_ACTIVE].fn_80156530(false); + field_0x1954C = 0; + mStateStep = 1; + } + } else { + fn_802AD460(); + fn_802AC0E0(4); + mIsIdle = true; + } +} void dLytDepositMain_c::finalizeState_ModeReverseChange() {} void dLytDepositMain_c::initializeState_ModeScroll() {} -void dLytDepositMain_c::executeState_ModeScroll() {} +void dLytDepositMain_c::executeState_ModeScroll() { + s32 currentlyHeldSlot = mCurrentlyHoldingItemSlot - SLOT_STOCK_OFFSET; + dPadNav::scrollRelated(); + if (mAnm[DEPOSIT_ANIM_SCROLL_R].isEnabled()) { + if (!mIsIdle && mAnm[DEPOSIT_ANIM_SCROLL_R].isEndReached()) { + mAnm[DEPOSIT_ANIM_SCROLL_R].setFrame(0.0f); + mLyt.calc(); + mAnm[DEPOSIT_ANIM_SCROLL_R].setAnimEnable(false); + for (int i = 0; i < NUM_STOCKS; i++) { + mStock[i].nextPage(field_0x1952C); + mStock[i].loadItems(currentlyHeldSlot); + } + mStock[STOCK_ACTIVE].fn_80156530(true); + field_0x1954C = 1; + fn_802AD370(); + fn_802AD460(); + if (mStock[STOCK_ACTIVE].getArrowDirection() >= dLytDepositStock_c::ARROW_NONE) { + fn_802AD4C0(); + } + field_0x1952C = true; + mIsIdle = true; + } else if (!mHasScrolledOtherStocks && mAnm[DEPOSIT_ANIM_SCROLL_R].getFrame() >= 2.0f) { + mHasScrolledOtherStocks = true; + u8 oldPage = mStock[2].getPage(); + mStock[2].setPage(mStock[1].getPage()); + mStock[2].nextPage(false); + mStock[2].loadItems(currentlyHeldSlot); + mStock[2].setPage(oldPage); + } + } else { + if (!mIsIdle && mAnm[DEPOSIT_ANIM_SCROLL_L].isEndReached()) { + mAnm[DEPOSIT_ANIM_SCROLL_L].setFrame(0.0f); + mLyt.calc(); + mAnm[DEPOSIT_ANIM_SCROLL_L].setAnimEnable(false); + for (int i = 0; i < NUM_STOCKS; i++) { + mStock[i].prevPage(field_0x1952C); + mStock[i].loadItems(currentlyHeldSlot); + } + mStock[STOCK_ACTIVE].fn_80156530(true); + field_0x1954C = 1; + fn_802AD370(); + fn_802AD460(); + if (mStock[STOCK_ACTIVE].getArrowDirection() >= dLytDepositStock_c::ARROW_NONE) { + fn_802AD4C0(); + } + field_0x1952C = true; + mIsIdle = true; + } else if (!mHasScrolledOtherStocks && mAnm[DEPOSIT_ANIM_SCROLL_L].getFrame() >= 2.0f) { + mHasScrolledOtherStocks = true; + u8 oldPage = mStock[1].getPage(); + mStock[1].setPage(mStock[2].getPage()); + mStock[1].prevPage(false); + mStock[1].loadItems(currentlyHeldSlot); + mStock[1].setPage(oldPage); + } + } +} void dLytDepositMain_c::finalizeState_ModeScroll() {} void dLytDepositMain_c::initializeState_ModeRecycle() {} -void dLytDepositMain_c::executeState_ModeRecycle() {} +void dLytDepositMain_c::executeState_ModeRecycle() { + if (mStateStep == 0) { + if (mAnm[DEPOSIT_ANIM_BTN_DECIDE_02].isEndReached()) { + mAnm[DEPOSIT_ANIM_BTN_DECIDE_02].setAnimEnable(false); + mAnm[DEPOSIT_ANIM_OUT].setAnimEnable(true); + mAnm[DEPOSIT_ANIM_OUT].setFrame(0.0f); + mLyt.calc(); + dCsBase_c::GetInstance()->setVisible(false); + dPadNav::setNavEnabled(false, false); + if (field_0x1954C != 0) { + mArrow.requestOut(); + mStateStep = 2; + } else { + mStateStep = 1; + } + } + } else { + bool b = mStateStep != 2 || mArrow.isChangingState(); + if (mAnm[DEPOSIT_ANIM_OUT].isEndReached() && b) { + mAnm[DEPOSIT_ANIM_OUT].setAnimEnable(false); + mAnm[DEPOSIT_ANIM_RECYCLE].setAnimEnable(true); + mAnm[DEPOSIT_ANIM_RECYCLE].setFrame(0.0f); + mLyt.calc(); + mAnm[DEPOSIT_ANIM_RECYCLE].setAnimEnable(false); + mCurrentlyHoldingItemSlot = -1; + mIsIdle = true; + } + } +} void dLytDepositMain_c::finalizeState_ModeRecycle() {} void dLytDepositMain_c::initializeState_ModeArrangementOut() {} -void dLytDepositMain_c::executeState_ModeArrangementOut() {} +void dLytDepositMain_c::executeState_ModeArrangementOut() { + if (mStateStep == 0) { + if (mAnm[DEPOSIT_ANIM_BTN_DECIDE_01].isEndReached()) { + mAnm[DEPOSIT_ANIM_BTN_DECIDE_01].setAnimEnable(false); + mAnm[DEPOSIT_ANIM_OUT].setAnimEnable(true); + mAnm[DEPOSIT_ANIM_OUT].setFrame(0.0f); + mLyt.calc(); + dCsBase_c::GetInstance()->setVisible(false); + dPadNav::setNavEnabled(false, false); + mArrow.requestOut(); + mStateStep = 1; + } + } else { + if (mAnm[DEPOSIT_ANIM_OUT].isEndReached() && mArrow.isChangingState()) { + mAnm[DEPOSIT_ANIM_OUT].setAnimEnable(false); + mAnm[DEPOSIT_ANIM_BTN_ON_OFF_01].setAnimEnable(true); + mAnm[DEPOSIT_ANIM_BTN_ON_OFF_01].setFrame(0.0f); + mLyt.calc(); + mAnm[DEPOSIT_ANIM_BTN_ON_OFF_01].setAnimEnable(false); + field_0x19528 = true; + mStock[STOCK_ACTIVE].disableModeSort(); + mStock[STOCK_ACTIVE].navigateToItem(); + mIsIdle = true; + } + } +} void dLytDepositMain_c::finalizeState_ModeArrangementOut() {} void dLytDepositMain_c::initializeState_ModeOut() {} -void dLytDepositMain_c::executeState_ModeOut() {} +void dLytDepositMain_c::executeState_ModeOut() { + if (mAnm[DEPOSIT_ANIM_BTN_DECIDE_00].isEndReached()) { + mAnm[DEPOSIT_ANIM_BTN_DECIDE_00].setAnimEnable(false); + mIsIdle = true; + } +} void dLytDepositMain_c::finalizeState_ModeOut() {} dLytDepositMain_c::dLytDepositMain_c() : mStateMgr(*this) {} @@ -162,8 +477,6 @@ static const d2d::LytBrlanMapping brlanMap[] = { { "depositBox_00_keta.brlan", "G_keta_00"}, }; -#define DEPOSIT_NUM_ANIMS 36 - static const char *sRingBoundingNames[] = { "B_ringA_00", "B_ringB_00", "B_ringC_00", "B_ringD_00", "B_ringE_00", "B_ringF_00", "B_ringG_00", "B_ringH_00", }; @@ -233,11 +546,11 @@ bool dLytDepositMain_c::build(d2d::ResAccIf_c *resAcc) { mAnm[DEPOSIT_ANIM_LOOP].setAnimEnable(true); mAnm[DEPOSIT_ANIM_LOOP].setFrame(0.0f); - mAnm[DEPOSIT_ANIM_INPUT].setAnimEnable(true); - mAnm[DEPOSIT_ANIM_INPUT].setForwardOnce(); - mAnm[DEPOSIT_ANIM_INPUT].setFrame(mAnm[DEPOSIT_ANIM_INPUT].getLastFrame()); + mAnm[DEPOSIT_ANIM_INPUT_00].setAnimEnable(true); + mAnm[DEPOSIT_ANIM_INPUT_00].setForwardOnce(); + mAnm[DEPOSIT_ANIM_INPUT_00].setFrame(mAnm[DEPOSIT_ANIM_INPUT_00].getLastFrame()); - for (int i = 0; i < DEPOSIT_NUM_RING_ITEMS; i++) { + for (int i = 0; i < RING_NUM_ITEMS; i++) { mAnm[i + DEPOSIT_ANIM_FLASH_OFFSET].setAnimEnable(true); mAnm[i + DEPOSIT_ANIM_FLASH_OFFSET].setToEnd(); } @@ -246,9 +559,9 @@ bool dLytDepositMain_c::build(d2d::ResAccIf_c *resAcc) { mAnm[DEPOSIT_ANIM_IN].setAnimEnable(false); mAnm[DEPOSIT_ANIM_ARROW_LOOP].setAnimEnable(false); - mAnm[DEPOSIT_ANIM_INPUT].setAnimEnable(false); + mAnm[DEPOSIT_ANIM_INPUT_00].setAnimEnable(false); - for (int i = 0; i < DEPOSIT_NUM_RING_ITEMS; i++) { + for (int i = 0; i < RING_NUM_ITEMS; i++) { mAnm[i + DEPOSIT_ANIM_FLASH_OFFSET].setAnimEnable(false); } @@ -262,7 +575,7 @@ bool dLytDepositMain_c::build(d2d::ResAccIf_c *resAcc) { mArrow.build(); mArrow.setState(1); - fn_802A9E80(); + setModeNone(); field_0x19521 = false; field_0x19522 = false; @@ -272,17 +585,17 @@ bool dLytDepositMain_c::build(d2d::ResAccIf_c *resAcc) { field_0x19526 = false; field_0x19527 = false; field_0x19528 = false; - field_0x19529 = false; + mHasScrolledOtherStocks = false; field_0x1952A = true; field_0x1952B = false; field_0x1952C = true; - field_0x19530 = -1; - field_0x19534 = -1; - field_0x19538 = 0; - field_0x1953C = 0; + mCurrentPouchNavTarget = -1; + mCurrentlyHoldingItemSlot = -1; + mStateStep = 0; + mCursorLocation = dLytDepositBoxCursor_c::LOC_POUCH; field_0x19540 = 0; - field_0x19544 = 0; + mItemSellValue = 0; field_0x19548 = -1; field_0x1954C = 0; field_0x19550 = 0; @@ -291,6 +604,430 @@ bool dLytDepositMain_c::build(d2d::ResAccIf_c *resAcc) { return true; } +bool dLytDepositMain_c::execute() { + field_0x1952B = false; + mCsHitCheck.resetCachedHitboxes(); + mCsHitCheck.execute(); + + for (int i = 0; i < NUM_STOCKS; i++) { + mStockNodes[i].mpLytPane->execute(); + } + + mStock[STOCK_ACTIVE].setSellBlocked(mItemSellValue <= 0); + mStock[STOCK_ACTIVE].setSortBlocked(mCurrentlyHoldingItemSlot >= 0); + + mStateMgr.executeState(); + mCursor.execute(); + + for (int i = 0; i < RING_NUM_ITEMS; i++) { + if (mPouchItemIds[i] < 50) { + mRingNodes[i].mpLytPane->execute(); + } + } + + for (int i = 0; i < DEPOSIT_ANIM_HAVE_OFFSET; i++) { + if (mAnm[i].isEnabled()) { + if (i >= 19 && i <= 23) { + if (mAnm[i].isStop()) { + mAnm[i].setAnimEnable(false); + } + } + mAnm[i].play(); + } + } + + mLyt.calc(); + + nw4r::math::VEC3 t = mpPaneCommonArrow->GetTranslate(); + mVec2_c v; + v.x = t.x; + v.y = t.y; + mArrow.setTranslate(&v); + mArrow.execute(); + + field_0x1952A = dPadNav::isPointerVisible(); + + return true; +} + +bool dLytDepositMain_c::draw() { + mLyt.addToDrawList(); + mCursor.draw(); + mArrow.draw(); + return true; +} + +bool dLytDepositMain_c::remove() { + dCsMgr_c::GetInstance()->unregistCursorTarget(&mCsHitCheck); + + // Okay this one does need temps to avoid regswaps, the others probably should use temps too for consistency + d2d::SubPaneList::Iterator it = mStockList.GetBeginIter(); + d2d::SubPaneList::Iterator end = mStockList.GetEndIter(); + for (; it != end; ++it) { + d2d::dSubPane *subPane = it->mpLytPane; + if (subPane != nullptr) { + nw4r::lyt::Pane *parent = subPane->getPane()->GetParent(); + parent->RemoveChild(subPane->getPane()); + } + } + + for (int i = 0; i < NUM_STOCKS; i++) { + mStockNodes[i].mpLytPane->remove(); + } + + it = mRingList.GetBeginIter(); + end = mRingList.GetEndIter(); + for (; it != end; ++it) { + d2d::dSubPane *subPane = it->mpLytPane; + if (subPane != nullptr) { + nw4r::lyt::Pane *parent = subPane->getPane()->GetParent(); + parent->RemoveChild(subPane->getPane()); + } + } + + for (int i = 0; i < RING_NUM_ITEMS; i++) { + mRingNodes[i].mpLytPane->remove(); + } + + mLyt.unbindAnims(); + + for (int i = 0; i < DEPOSIT_NUM_ANIMS; i++) { + mAnm[i].remove(); + } + + mCursor.remove(); + + mArrow.remove(); + + return true; +} + +void dLytDepositMain_c::setModeNone() { + mStateMgr.changeState(StateID_ModeNone); + mIsIdle = false; +} + +void dLytDepositMain_c::setModeIn() { + s32 loc; + if (field_0x19527) { + loc = mCursorLocation; + } else { + loc = dLytDepositBoxCursor_c::LOC_POUCH; + } + fn_802AAB30(); + + if (loc == dLytDepositBoxCursor_c::LOC_POUCH) { + mAnm[DEPOSIT_ANIM_IN].setAnimEnable(true); + + mAnm[DEPOSIT_ANIM_INPUT_00].setAnimEnable(true); + mAnm[DEPOSIT_ANIM_INPUT_00].setForwardOnce(); + mAnm[DEPOSIT_ANIM_INPUT_00].setFrame(mAnm[DEPOSIT_ANIM_INPUT_00].getLastFrame()); + mLyt.calc(); + mAnm[DEPOSIT_ANIM_INPUT_00].setAnimEnable(false); + + mStateStep = 0; + } else { + mStock[STOCK_ACTIVE].fn_80156530(true); + mAnm[DEPOSIT_ANIM_IN_BOX].setAnimEnable(true); + mAnm[DEPOSIT_ANIM_IN_BOX].setFrame(0.0f); + + mAnm[DEPOSIT_ANIM_INPUT_00].setAnimEnable(true); + mAnm[DEPOSIT_ANIM_INPUT_00].setForwardOnce(); + mAnm[DEPOSIT_ANIM_INPUT_00].setFrame(mAnm[DEPOSIT_ANIM_INPUT_00].getLastFrame()); + mLyt.calc(); + mAnm[DEPOSIT_ANIM_INPUT_00].setAnimEnable(false); + + mArrow.requestIn(); + mStateStep = 1; + } + + dPadNav::setNavEnabled(false, false); + mStateMgr.changeState(StateID_ModeIn); + mIsIdle = false; +} + +void dLytDepositMain_c::setModeCheck() { + s32 slot = mCurrentPouchNavTarget; + if (slot < 0) { + slot += RING_NUM_ITEMS; + } + dCsBase_c::GetInstance()->setCursorStickTargetPane(mpRingBoundings[slot]); + fn_802AD460(); + mStateMgr.changeState(StateID_ModeCheck); + mIsIdle = false; +} + +void dLytDepositMain_c::setModeChange(bool unk) { + if (unk) { + mAnm[DEPOSIT_ANIM_CHANGE].setAnimEnable(true); + mAnm[DEPOSIT_ANIM_CHANGE].setFrame(0.0f); + mAnm[DEPOSIT_ANIM_CHANGE].setForwardOnce(); + + mAnm[DEPOSIT_ANIM_SELECT_ON_BOX].setAnimEnable(true); + mAnm[DEPOSIT_ANIM_SELECT_ON_BOX].setFrame(0.0f); + mAnm[DEPOSIT_ANIM_SELECT_ON_BOX].setForwardOnce(); + mLyt.calc(); + + mIsIdle = false; + fn_802AD400(); + mArrow.requestIn(); + mStateStep = 0; + } + mStateMgr.changeState(StateID_ModeChange); +} + +void dLytDepositMain_c::setModeArrangement() { + mAnm[DEPOSIT_ANIM_BTN_DECIDE_01].setAnimEnable(true); + mAnm[DEPOSIT_ANIM_BTN_DECIDE_01].setFrame(0.0f); + mLyt.calc(); + mIsIdle = false; + dPadNav::setNavEnabled(true, false); + mStateMgr.changeState(StateID_ModeArrangement); +} + +void dLytDepositMain_c::loadItemText(s32 itemId, s32 where) { + dTextBox_c *box1, *box2; + + if (where == 0) { + box1 = mLyt.getTextBox("T_message_08"); + box2 = mLyt.getTextBox("T_messageS_08"); + } else { + box1 = mLyt.getTextBox("T_nameSpace_00"); + box2 = mLyt.getTextBox("T_nameSpaceS_00"); + } + + if (itemId < 0) { + static wchar_t empty[] = L""; + box1->setTextWithGlobalTextProcessor(empty); + box2->setTextWithGlobalTextProcessor(empty); + } else { + const wchar_t *str; + if (where == 0) { + SizedString<32> msg; + msg.sprintf("TRUSTEE_ITEM_%03d", itemId); + str = dMessage_c::getTextMessageByLabel(msg, true, nullptr, 0); + } else { + // TODO check if we can avoid this cast... + // getItemText has a bunch of other users as well + str = getItemText((u16)itemId); + } + box1->setTextWithGlobalTextProcessor(str); + box2->setTextWithGlobalTextProcessor(str); + } +} + +void dLytDepositMain_c::checkForItemPickupOrDrop() { + bool anyPickup = false; + + if (dPad::getDownTrigA()) { + s32 item; + if (mCurrentlyHoldingItemSlot < 0) { + // Not holding an item... + if (mCurrentPouchNavTarget >= 0 && mPouchItemIds[mCurrentPouchNavTarget] != 12 && + // ... and picking up an item from the pouch + mPouchItemIds[mCurrentPouchNavTarget] != 50) { + mCursorLocation = dLytDepositBoxCursor_c::LOC_POUCH; + field_0x19540 = convertLytPouchSlot2(mCurrentPouchNavTarget); + item = getPouchItemIdForIndex(mCurrentPouchNavTarget, false); + mCurrentlyHoldingItemSlot = mCurrentPouchNavTarget; + mCursor.init(mCursorLocation, mCurrentPouchNavTarget, mPouchItemIds[mCurrentPouchNavTarget], false); + mRingNodes[mCurrentPouchNavTarget].mpPane->SetVisible(false); + mAnm[mCurrentPouchNavTarget + DEPOSIT_ANIM_FLASH_OFFSET].setAnimEnable(true); + mAnm[mCurrentPouchNavTarget + DEPOSIT_ANIM_FLASH_OFFSET].setFrame(0.0f); + mLyt.calc(); + mAnm[mCurrentPouchNavTarget + DEPOSIT_ANIM_FLASH_OFFSET].setAnimEnable(false); + + mPouchItems[mCurrentPouchNavTarget].setOff(); + loadItemText(-1, false); + dSndSmallEffectMgr_c::GetInstance()->playSound(SE_S_SHOP_STK_POUCH_CHACH_ITEM); + anyPickup = true; + } else if (mStock[STOCK_ACTIVE].getCurrentNavTarget() >= 0) { + s32 activeItem = mStock[STOCK_ACTIVE].getItem(mStock[STOCK_ACTIVE].getCurrentNavTarget()); + if (activeItem != 12) { + // ... and picking up an item from the stock + s32 stockSlot = mStock[STOCK_ACTIVE].getCurrentSlot(); + mCursorLocation = dLytDepositBoxCursor_c::LOC_STOCK; + field_0x19540 = stockSlot; + item = FileManager::GetInstance()->getItemCheckItem(stockSlot); + mCurrentlyHoldingItemSlot = stockSlot + SLOT_STOCK_OFFSET; + mCursor.init( + mCursorLocation, stockSlot, + mStock[STOCK_ACTIVE].getItem(mStock[STOCK_ACTIVE].getCurrentNavTarget()), false + ); + mStock[STOCK_ACTIVE].pickUpItem(stockSlot, 0); + loadItemText(-1, true); + field_0x19554 = 0; + dSndSmallEffectMgr_c::GetInstance()->playSound(SE_S_SHOP_STK_STOCK_CHACH_ITEM); + anyPickup = true; + } + } + + if (!anyPickup) { + // didn't pick anything up + return; + } + + mAnm[DEPOSIT_ANIM_ARROW_LOOP].setAnimEnable(true); + mAnm[DEPOSIT_ANIM_ARROW_LOOP].setFrame(0.0f); + + for (int i = 0; i < (s32)ARRAY_LENGTH(sItemData); i++) { + if (item == sItemData[i].itemId) { + mItemSellValue = sItemData[i].sellValue; + if (mItemSellValue == 0) { + mAnm[DEPOSIT_ANIM_INPUT_00].setAnimEnable(true); + mAnm[DEPOSIT_ANIM_INPUT_00].setForwardOnce(); + } else { + s32 frame = getItemSellValueFrame(mItemSellValue); + mAnm[DEPOSIT_ANIM_INPUT_00].setAnimEnable(true); + mAnm[DEPOSIT_ANIM_INPUT_00].setBackwardsOnce(); + mAnm[DEPOSIT_ANIM_KETA].setAnimEnable(true); + mAnm[DEPOSIT_ANIM_KETA].setFrame(frame); + } + break; + } + } + + mAnm[DEPOSIT_ANIM_INPUT_01].setAnimEnable(true); + mAnm[DEPOSIT_ANIM_INPUT_01].setForwardOnce(); + } else { + // Currently holding an item... + bool b2 = false; + if (mCurrentPouchNavTarget >= 0 && mPouchItemIds[mCurrentPouchNavTarget] != 50) { + // ... and dropping the item onto the pouch + s32 oldItem = mPouchItemIds[mCurrentPouchNavTarget]; + if (mCurrentlyHoldingItemSlot < SLOT_STOCK_OFFSET) { + // Source item is from pouch, swap pouch items + mPouchItemIds[mCurrentPouchNavTarget] = mPouchItemIds[mCurrentlyHoldingItemSlot]; + mPouchItemIds[mCurrentlyHoldingItemSlot] = oldItem; + swapAdventurePouchItems( + convertLytPouchSlot(mCurrentPouchNavTarget), convertLytPouchSlot(mCurrentlyHoldingItemSlot) + ); + fn_802AAEC0(mCurrentPouchNavTarget); + mPouchItems[mCurrentlyHoldingItemSlot].reset(); + fn_802AAEC0(mCurrentlyHoldingItemSlot); + if (mCurrentlyHoldingItemSlot == mCurrentPouchNavTarget) { + b2 = true; + } + } else { + // Source item is from stock, move item from stock to pouch + s32 actualSlot = mCurrentlyHoldingItemSlot - SLOT_STOCK_OFFSET; + mPouchItemIds[mCurrentPouchNavTarget] = getDepositItemForSlot(actualSlot); + swapStockAndPouchItems(convertLytPouchSlot(mCurrentPouchNavTarget), actualSlot); + loadItems(-1); + fn_802AAEC0(mCurrentPouchNavTarget); + + mStock[STOCK_ACTIVE].field_0x684E = false; + for (int i = 0; i < NUM_STOCKS; i++) { + mStock[i].field_0x684E = false; + } + } + + if (oldItem != 12 && !b2) { + dSndSmallEffectMgr_c::GetInstance()->playSound(SE_S_SHOP_STK_POUCH_RELEASE_ITEM_CHANGE); + } else { + dSndSmallEffectMgr_c::GetInstance()->playSound(SE_S_SHOP_STK_POUCH_RELEASE_ITEM); + } + mItemSellValue = 0; + anyPickup = true; + } else if (mStock[STOCK_ACTIVE].getCurrentNavTarget() >= 0 && mStock[STOCK_ACTIVE].getActiveItem() != 50) { + // ... and dropping the item into the stock + s32 slot = mStock[STOCK_ACTIVE].getCurrentSlot(); + field_0x19554 = slot; + s32 item = mStock[STOCK_ACTIVE].getActiveItem(); + if (mCurrentlyHoldingItemSlot < SLOT_STOCK_OFFSET) { + // Source item is from pouch, so move item from pouch to stock + swapStockAndPouchItems(convertLytPouchSlot(mCurrentlyHoldingItemSlot), field_0x19554); + mStock[STOCK_ACTIVE].setItem( + mStock[STOCK_ACTIVE].getCurrentNavTarget(), mPouchItemIds[mCurrentlyHoldingItemSlot] + ); + mPouchItemIds[mCurrentlyHoldingItemSlot] = item; + mPouchItems[mCurrentlyHoldingItemSlot].reset(); + fn_802AAEC0(mCurrentlyHoldingItemSlot); + } else { + // Source item is from stock, so swap stock items + swapStockItems(mCurrentlyHoldingItemSlot - SLOT_STOCK_OFFSET, slot); + loadItems(-1); + if (!dPadNav::isPointerVisible()) { + mStock[STOCK_ACTIVE].field_0x684B = true; + } + mStock[STOCK_ACTIVE].fn_80156530(true); + field_0x1954C = 1; + if (field_0x19554 == mCurrentlyHoldingItemSlot - SLOT_STOCK_OFFSET) { + b2 = true; + } + } + + for (int i = 0; i < NUM_STOCKS; i++) { + mStock[i].field_0x684E = false; + } + + if (item != 12 && !b2) { + dSndSmallEffectMgr_c::GetInstance()->playSound(SE_S_SHOP_STK_STOCK_RELEASE_ITEM_CHANGE); + } else { + dSndSmallEffectMgr_c::GetInstance()->playSound(SE_S_SHOP_STK_STOCK_RELEASE_ITEM); + } + mItemSellValue = 0; + anyPickup = true; + } + if (anyPickup) { + if (mCurrentlyHoldingItemSlot < SLOT_STOCK_OFFSET) { + mRingNodes[mCurrentlyHoldingItemSlot].mpPane->SetVisible(true); + } + mCurrentlyHoldingItemSlot = -1; + mAnm[DEPOSIT_ANIM_ARROW_LOOP].setAnimEnable(false); + mAnm[DEPOSIT_ANIM_INPUT_00].setAnimEnable(true); + mAnm[DEPOSIT_ANIM_INPUT_00].setForwardOnce(); + mAnm[DEPOSIT_ANIM_INPUT_01].setAnimEnable(true); + mAnm[DEPOSIT_ANIM_INPUT_01].setBackwardsOnce(); + mCursor.setVisible(false); + } + } + + } else { + if (dPad::getDownTrigB() && mCurrentlyHoldingItemSlot >= 0) { + if (mStock[STOCK_ACTIVE].isModeSell()) { + // cancel while item over sell button + mAnm[DEPOSIT_ANIM_RECYCLE].setAnimEnable(true); + mAnm[DEPOSIT_ANIM_RECYCLE].setBackwardsOnce(); + mStock[STOCK_ACTIVE].disableModeSell(); + field_0x19524 = false; + if (field_0x1954C == 0) { + // TODO: Why is this not >= ... + if (mCurrentlyHoldingItemSlot > SLOT_STOCK_OFFSET) { + fn_802AC0E0(0); + } else { + fn_802AC0E0(mCurrentlyHoldingItemSlot); + } + } else { + if ((mCurrentlyHoldingItemSlot < SLOT_STOCK_OFFSET) || + ((mCurrentlyHoldingItemSlot - SLOT_STOCK_OFFSET) / 12) != mStock[STOCK_ACTIVE].getPage()) { + fn_802AC290(0); + } else { + fn_802AC290((mCurrentlyHoldingItemSlot - SLOT_STOCK_OFFSET) % 12); + } + } + } + if (mCurrentlyHoldingItemSlot < SLOT_STOCK_OFFSET) { + mRingNodes[mCurrentlyHoldingItemSlot].mpPane->SetVisible(true); + } else { + mStock[STOCK_ACTIVE].pickUpItem(mCurrentlyHoldingItemSlot - SLOT_STOCK_OFFSET, true); + loadItems(-1); + mStock[STOCK_ACTIVE].field_0x684B = true; + mStock[STOCK_ACTIVE].fn_80156530(true); + } + mCurrentlyHoldingItemSlot = -1; + mAnm[DEPOSIT_ANIM_ARROW_LOOP].setAnimEnable(false); + mAnm[DEPOSIT_ANIM_INPUT_00].setAnimEnable(true); + mAnm[DEPOSIT_ANIM_INPUT_00].setForwardOnce(); + mAnm[DEPOSIT_ANIM_INPUT_01].setAnimEnable(true); + mAnm[DEPOSIT_ANIM_INPUT_01].setBackwardsOnce(); + mCursor.setVisible(false); + mItemSellValue = 0; + field_0x1952B = 1; + } + } +} + STATE_DEFINE(dLytDeposit_c, None); STATE_DEFINE(dLytDeposit_c, In); STATE_DEFINE(dLytDeposit_c, Check); @@ -302,14 +1039,32 @@ STATE_DEFINE(dLytDeposit_c, Recycle); STATE_DEFINE(dLytDeposit_c, ArrangementOut); STATE_DEFINE(dLytDeposit_c, Out); -SPECIAL_BASE_PROFILE(LYT_DEPOSIT, dLytDeposit_c, fProfile::LYT_DEPOSIT, 0x2B9, 0); - void dLytDeposit_c::initializeState_None() {} -void dLytDeposit_c::executeState_None() {} +void dLytDeposit_c::executeState_None() { + if (field_0x19998) { + mMain.setModeIn(); + mStateMgr.changeState(StateID_In); + field_0x19998 = false; + } +} void dLytDeposit_c::finalizeState_None() {} void dLytDeposit_c::initializeState_In() {} -void dLytDeposit_c::executeState_In() {} +void dLytDeposit_c::executeState_In() { + if (mMain.isIdle()) { + if (mMain.getStateStep() == 0) { + mMain.setModeCheck(); + mStateMgr.changeState(StateID_Check); + } else { + mMain.setModeChange(false); + mStateMgr.changeState(StateID_Change); + } + + dCsBase_c::GetInstance()->setVisible(true); + dPadNav::setNavEnabled(true, false); + dCsBase_c::GetInstance()->setCursorStickPriority(0x86); + } +} void dLytDeposit_c::finalizeState_In() {} void dLytDeposit_c::initializeState_Check() {} @@ -343,3 +1098,93 @@ void dLytDeposit_c::finalizeState_ArrangementOut() {} void dLytDeposit_c::initializeState_Out() {} void dLytDeposit_c::executeState_Out() {} void dLytDeposit_c::finalizeState_Out() {} + +SPECIAL_BASE_PROFILE(LYT_DEPOSIT, dLytDeposit_c, fProfile::LYT_DEPOSIT, 0x2B9, 0); + +bool dLytDeposit_c::build() { + void *data = LayoutArcManager::GetInstance()->getLoadedData("Shop"); + mResAcc.attach(data, ""); + mMain.build(&mResAcc); + return true; +} + +int dLytDeposit_c::create() { + sInstance = this; + allocateLytWork1Heap("dLytDeposit_c::m_allocator", false); + mStateMgr.changeState(StateID_None); + field_0x19998 = false; + field_0x19999 = false; + field_0x1999A = false; + return SUCCEEDED; +} + +int dLytDeposit_c::execute() { + if (*mStateMgr.getStateID() != StateID_None) { + if (dPad::getDownTrigDown()) { + dPad::ex_c::getInstance()->centerCursor(mPad::getCurrentCoreID(), true); + } + if (dCsBase_c::GetInstance()->isVisible()) { + dCsGame_c::GetInstance()->pointerDefSet(); + } + mMain.execute(); + } + mStateMgr.executeState(); + return SUCCEEDED; +} + +int dLytDeposit_c::draw() { + if (*mStateMgr.getStateID() != StateID_None || field_0x19999) { + mMain.draw(); + } + return SUCCEEDED; +} + +int dLytDeposit_c::doDelete() { + dCsBase_c::GetInstance()->setCursorStickPriority2(0x8A); + mMain.remove(); + mResAcc.detach(); + sInstance = nullptr; + return SUCCEEDED; +} + +bool dLytDeposit_c::checkForNavRight() { + if (dPad::getDownTrigRight()) { + if (!mMain.isSellableItem()) { + field_0x1999A = false; + return true; + } + } + + if (dPad::getDownTrigA() && mMain.getArrowDirection() == dLytDepositStock_c::ARROW_RIGHT) { + dSndSmallEffectMgr_c::GetInstance()->playSound(SE_S_SHOP_STK_STOCK_SELECT_TURN_PAGE_RIGHT); + field_0x1999A = true; + return true; + } else if (dPadNav::isPointerVisible() && dPadNav::isMplsNavRightGesture()) { + mMain.setField_0x1952C(false); + field_0x1999A = false; + return true; + } + + return false; +} + +bool dLytDeposit_c::checkForNavLeft() { + if (dPad::getDownTrigLeft()) { + if (!mMain.isSellableItem()) { + field_0x1999A = false; + return true; + } + } + + if (dPad::getDownTrigA() && mMain.getArrowDirection() == dLytDepositStock_c::ARROW_LEFT) { + dSndSmallEffectMgr_c::GetInstance()->playSound(SE_S_SHOP_STK_STOCK_SELECT_TURN_PAGE_LEFT); + field_0x1999A = true; + return true; + } else if (dPadNav::isPointerVisible() && !mMain.isSellableItem() && dPadNav::isMplsNavLeftGesture()) { + mMain.setField_0x1952C(false); + field_0x1999A = false; + return true; + } + + return false; +} diff --git a/src/d/lyt/d_lyt_deposit_box_cursor.cpp b/src/d/lyt/d_lyt_deposit_box_cursor.cpp index 3a42105c..7ba91dfa 100644 --- a/src/d/lyt/d_lyt_deposit_box_cursor.cpp +++ b/src/d/lyt/d_lyt_deposit_box_cursor.cpp @@ -119,6 +119,7 @@ void dLytDepositBoxCursor_c::realizeNav() { } else if (field_0x949) { s = 6; } else if (mItemLocation == LOC_POUCH) { + // Flip the cursor for pouch slot 0 so that it's not above the screen edge s = mSlot == 0 ? 1 : 0; if (field_0x950 == 12) { s += 2; diff --git a/src/d/lyt/d_lyt_deposit_stock.cpp b/src/d/lyt/d_lyt_deposit_stock.cpp index 1dacffba..4bb60172 100644 --- a/src/d/lyt/d_lyt_deposit_stock.cpp +++ b/src/d/lyt/d_lyt_deposit_stock.cpp @@ -93,18 +93,18 @@ bool dLytDepositStock_c::build(d2d::ResAccIf_c *resAcc) { mSelectedItemId = -1; field_0x685C = -1; - field_0x6849 = false; - field_0x684A = false; + mIsSellBlocked = false; + mIsSortBlocked = false; field_0x684B = false; field_0x684C = true; field_0x684E = false; mArrowDirection = ARROW_NONE; - field_0x6845 = false; - field_0x6846 = false; - field_0x6847 = false; - field_0x6848 = false; + mIsModePouch = false; + mIsModeSell = false; + mIsModeSort = false; + mIsModeFinish = false; mSavedArrowDirection = ARROW_NONE; @@ -271,13 +271,13 @@ void dLytDepositStock_c::fn_80156530(bool unk) { } field_0x684B = false; - field_0x6845 = false; - field_0x6846 = false; - if (!field_0x6847) { + mIsModePouch = false; + mIsModeSell = false; + if (!mIsModeSort) { // okay - field_0x6847 = false; + mIsModeSort = false; } - field_0x6848 = false; + mIsModeFinish = false; if (mArrowDirection >= ARROW_NONE) { handleSpecialNavMode(); } @@ -298,7 +298,7 @@ void dLytDepositStock_c::handleNavOrPoint() { s32 dir = checkNav(); if (!isNavModeItem()) { handleSpecialNavMode(); - } else if (!field_0x6845 && !field_0x6846 && !field_0x6847 && !field_0x6848 && mSavedArrowDirection >= 2) { + } else if (!mIsModePouch && !mIsModeSell && !mIsModeSort && !mIsModeFinish && mSavedArrowDirection >= 2) { s32 target = mCurrentNavTarget; if (target < 0 || field_0x684C) { if (dir != dPadNav::FS_STICK_NONE || dCsBase_c::GetInstance()->isCursorStickVisible()) { @@ -397,9 +397,9 @@ void dLytDepositStock_c::handleNavOrPoint() { mAnm[anmIdx].setAnimEnable(false); dRumble_c::start(dRumble_c::sRumblePreset1, dRumble_c::FLAG_SLOT0); mCurrentNavTarget = nextTarget; - field_0x6846 = false; - field_0x6847 = false; - field_0x6848 = false; + mIsModeSell = false; + mIsModeSort = false; + mIsModeFinish = false; navigateToItem(); } mNavMode = 0; @@ -446,7 +446,7 @@ s32 dLytDepositStock_c::checkNav() { direction = dPadNav::FS_STICK_DOWN; } else if (target >= 6) { if (target >= 10) { - if (field_0x684A) { + if (mIsSortBlocked) { if (target == 11) { direction = dPadNav::FS_STICK_NONE; } else { @@ -464,11 +464,11 @@ s32 dLytDepositStock_c::checkNav() { case dPadNav::FS_STICK_DOWN: if (target >= 6) { if (target < 8) { - if (field_0x6849) { + if (mIsSellBlocked) { direction = dPadNav::FS_STICK_NONE; } } else if (target >= 10) { - if (field_0x684A) { + if (mIsSortBlocked) { direction = dPadNav::FS_STICK_NONE; } } else { @@ -478,14 +478,14 @@ s32 dLytDepositStock_c::checkNav() { break; case dPadNav::FS_STICK_DOWN_LEFT: if (target == 0 || target == 11) { - if (target == 11 && field_0x684A) { + if (target == 11 && mIsSortBlocked) { direction = dPadNav::FS_STICK_LEFT; } else { direction = dPadNav::FS_STICK_DOWN; } } else if (target >= 6) { if (target <= 7) { - if (field_0x6849) { + if (mIsSellBlocked) { if (target == 6) { direction = dPadNav::FS_STICK_NONE; } else { @@ -495,7 +495,7 @@ s32 dLytDepositStock_c::checkNav() { direction = dPadNav::FS_STICK_DOWN; } } else if (target == 11) { - if (field_0x684A) { + if (mIsSortBlocked) { direction = dPadNav::FS_STICK_NONE; } else { direction = dPadNav::FS_STICK_DOWN; @@ -611,33 +611,33 @@ void dLytDepositStock_c::pickUpItem(s32 slot, bool unk) { } void dLytDepositStock_c::navigateToPouch() { - field_0x6845 = true; + mIsModePouch = true; mSavedArrowDirection = ARROW_NONE; } void dLytDepositStock_c::navigateToSell() { - if (!field_0x6846) { + if (!mIsModeSell) { dSndSmallEffectMgr_c::GetInstance()->playSound(SE_S_SHOP_STK_POINT_SELL); } - field_0x6846 = true; + mIsModeSell = true; mNavMode = NAV_SELL; mSavedArrowDirection = ARROW_NONE; } void dLytDepositStock_c::navigateToSort() { - if (!field_0x6847) { + if (!mIsModeSort) { dSndSmallEffectMgr_c::GetInstance()->playSound(SE_S_SHOP_STK_STOCK_POINT_TRIM); } - field_0x6847 = true; + mIsModeSort = true; mNavMode = NAV_SORT; mSavedArrowDirection = ARROW_NONE; } void dLytDepositStock_c::navigateToFinish() { - if (!field_0x6848) { + if (!mIsModeFinish) { dSndSmallEffectMgr_c::GetInstance()->playSound(SE_S_SHOP_STK_POINT_DECIDE); } - field_0x6848 = true; + mIsModeFinish = true; mNavMode = NAV_FINISH; mSavedArrowDirection = ARROW_NONE; } From 14561ef3182e4be1b1f6c56bcf8ffaa269e103d0 Mon Sep 17 00:00:00 2001 From: robojumper Date: Thu, 25 Dec 2025 00:04:18 +0100 Subject: [PATCH 04/11] I sure hope this const doesn't break everything --- config/SOUE01/symbols.txt | 37 +- include/d/d_cs_base.h | 2 +- include/d/d_pouch.h | 2 + include/d/flag/storyflag_map.h | 2 +- include/d/lyt/d_lyt_deposit.h | 62 +- include/d/lyt/d_lyt_deposit_box_cursor.h | 6 +- include/d/lyt/d_lyt_deposit_stock.h | 23 +- .../MSL/MSL_C/MSL_Common/Include/cwchar | 6 +- src/d/lyt/d_lyt_deposit.cpp | 945 ++++++++++++++++-- src/d/lyt/d_lyt_deposit_box_cursor.cpp | 13 +- src/d/lyt/d_lyt_deposit_stock.cpp | 2 +- 11 files changed, 990 insertions(+), 110 deletions(-) diff --git a/config/SOUE01/symbols.txt b/config/SOUE01/symbols.txt index d7d68eea..b1627571 100644 --- a/config/SOUE01/symbols.txt +++ b/config/SOUE01/symbols.txt @@ -10094,7 +10094,7 @@ getAdditionalCapacitySizeForItem = .text:0x8018AC70; // type:function size:0x60 swapStockAndPouchItems__Fll = .text:0x8018ACD0; // type:function size:0xC4 swapStockItems__Fll = .text:0x8018ADA0; // type:function size:0xA0 swapAdventurePouchItems__Fll = .text:0x8018AE40; // type:function size:0x120 -fn_8018AF60 = .text:0x8018AF60; // type:function size:0x204 +sortStock__Fv = .text:0x8018AF60; // type:function size:0x204 itemCheckFindItemSlot__F7ITEM_ID = .text:0x8018B170; // type:function size:0x60 fn_8018B1D0 = .text:0x8018B1D0; // type:function size:0x60 fn_8018B230 = .text:0x8018B230; // type:function size:0x74 @@ -16013,30 +16013,30 @@ setModeIn__17dLytDepositMain_cFv = .text:0x802A9EE0; // type:function size:0x19C setModeCheck__17dLytDepositMain_cFv = .text:0x802AA080; // type:function size:0x84 setModeChange__17dLytDepositMain_cFb = .text:0x802AA110; // type:function size:0xE4 setModeArrangement__17dLytDepositMain_cFv = .text:0x802AA200; // type:function size:0x90 -fn_802AA290 = .text:0x802AA290; // type:function size:0x13C -fn_802AA3D0 = .text:0x802AA3D0; // type:function size:0xFC -fn_802AA4D0 = .text:0x802AA4D0; // type:function size:0xEC -fn_802AA5C0 = .text:0x802AA5C0; // type:function size:0xB0 -fn_802AA670 = .text:0x802AA670; // type:function size:0xF8 +setModeReverseChange__17dLytDepositMain_cFv = .text:0x802AA290; // type:function size:0x13C +setModeScroll__17dLytDepositMain_cFbb = .text:0x802AA3D0; // type:function size:0xFC +setModeRecycle__17dLytDepositMain_cFv = .text:0x802AA4D0; // type:function size:0xEC +setModeArrangementOut__17dLytDepositMain_cFv = .text:0x802AA5C0; // type:function size:0xB0 +setModeOut__17dLytDepositMain_cFv = .text:0x802AA670; // type:function size:0xF8 getStateID__86sStateMgr_c<17dLytDepositMain_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>CFv = .text:0x802AA770; // type:function size:0x10 -loadItems__17dLytDepositMain_cFl = .text:0x802AA780; // type:function size:0x5C -fn_802AA7E0__17dLytDepositMain_cFv = .text:0x802AA7E0; // type:function size:0x348 -fn_802AAB30__17dLytDepositMain_cFv = .text:0x802AAB30; // type:function size:0x388 -fn_802AAEC0__17dLytDepositMain_cFl = .text:0x802AAEC0; // type:function size:0xF8 -fn_802AAFC0__17dLytDepositMain_cFv = .text:0x802AAFC0; // type:function size:0xB4 -fn_802AB080__17dLytDepositMain_cFv = .text:0x802AB080; // type:function size:0x188 -fn_802AB210__17dLytDepositMain_cFv = .text:0x802AB210; // type:function size:0x474 -fn_802AB690 = .text:0x802AB690; // type:function size:0xB8 -fn_802AB750 = .text:0x802AB750; // type:function size:0x2E8 +loadStockItems__17dLytDepositMain_cFl = .text:0x802AA780; // type:function size:0x5C +buildSubpanes__17dLytDepositMain_cFv = .text:0x802AA7E0; // type:function size:0x348 +loadInitialState__17dLytDepositMain_cFv = .text:0x802AAB30; // type:function size:0x388 +loadPouchItem__17dLytDepositMain_cFl = .text:0x802AAEC0; // type:function size:0xF8 +checkPointToStock__17dLytDepositMain_cFv = .text:0x802AAFC0; // type:function size:0xB4 +checkPointToPouch__17dLytDepositMain_cFv = .text:0x802AB080; // type:function size:0x188 +handleNavOrPoint__17dLytDepositMain_cFv = .text:0x802AB210; // type:function size:0x474 +navigateOffIcon__17dLytDepositMain_cFv = .text:0x802AB690; // type:function size:0xB8 +checkNav__17dLytDepositMain_cFv = .text:0x802AB750; // type:function size:0x2E8 loadItemText__17dLytDepositMain_cFll = .text:0x802ABA40; // type:function size:0x114 fn_802ABB60__17dLytDepositMain_cFv = .text:0x802ABB60; // type:function size:0x580 fn_802AC0E0__17dLytDepositMain_cFl = .text:0x802AC0E0; // type:function size:0x1A8 fn_802AC290__17dLytDepositMain_cFl = .text:0x802AC290; // type:function size:0xC4 -fn_802AC360 = .text:0x802AC360; // type:function size:0x58 +fn_802AC360__17dLytDepositMain_cFl = .text:0x802AC360; // type:function size:0x58 fn_802AC3C0__17dLytDepositMain_cFv = .text:0x802AC3C0; // type:function size:0x234 fn_802AC600 = .text:0x802AC600; // type:function size:0x64 fn_802AC670__17dLytDepositMain_cFv = .text:0x802AC670; // type:function size:0x304 -fn_802AC980 = .text:0x802AC980; // type:function size:0x54 +fn_802AC980__17dLytDepositMain_cFv = .text:0x802AC980; // type:function size:0x54 fn_802AC9E0 = .text:0x802AC9E0; // type:function size:0x90 setPouchItemsVisible__17dLytDepositMain_cFb = .text:0x802ACA70; // type:function size:0x80 checkForItemPickupOrDrop__17dLytDepositMain_cFv = .text:0x802ACAF0; // type:function size:0x85C @@ -37454,7 +37454,8 @@ lbl_8053D550 = .data:0x8053D550; // type:object size:0xF data:string jumptable_8053D560 = .data:0x8053D560; // type:object size:0x24 scope:local lbl_8053D584 = .data:0x8053D584; // type:object size:0x44 lbl_8053D5C8 = .data:0x8053D5C8; // type:object size:0xD data:string -lbl_8053D5D8 = .data:0x8053D5D8; // type:object size:0x34 +lbl_8053D5D8 = .data:0x8053D5D8; // type:object size:0xE data:string +lbl_8053D5E8 = .data:0x8053D5E8; // type:object size:0x24 g_profile_LYT_DEPOSIT = .data:0x8053D60C; // type:object size:0xC lbl_8053D618 = .data:0x8053D618; // type:object size:0x1B data:string __vt__13dLytDeposit_c = .data:0x8053D638; // type:object size:0x50 diff --git a/include/d/d_cs_base.h b/include/d/d_cs_base.h index b27832bc..0ac075b9 100644 --- a/include/d/d_cs_base.h +++ b/include/d/d_cs_base.h @@ -39,7 +39,7 @@ public: mCalibrationPointCenterEnabled = val; } - dCursorHitCheck_c *getHitCheck() { + dCursorHitCheck_c *getHitCheck() const { return mCursorIf.getHit(); } diff --git a/include/d/d_pouch.h b/include/d/d_pouch.h index b7ca10cb..6ef2f808 100644 --- a/include/d/d_pouch.h +++ b/include/d/d_pouch.h @@ -23,6 +23,8 @@ bool swapAdventurePouchItems(s32 slot1, s32 slot2); bool swapStockAndPouchItems(s32 pouchSlot, s32 stockSlot); bool swapStockItems(s32 slot1, s32 slot2); +void sortStock(); + #define ITEM_CHECK_SLOT_NONE 60 u16 itemCheckFindItemSlot(ITEM_ID item); diff --git a/include/d/flag/storyflag_map.h b/include/d/flag/storyflag_map.h index 940380fd..9f82fc70 100644 --- a/include/d/flag/storyflag_map.h +++ b/include/d/flag/storyflag_map.h @@ -1520,7 +1520,7 @@ enum StoryFlags_e { /** [Set when talking to Strich] * Story Flag #300 (0x012C) - JP 805ACD7D 0x40 / US 805A9AFD 0x40 */ - STORYFLAG_300, + STORYFLAG_TALKED_TO_STRICH, /** [Kukiel screams] * Story Flag #301 (0x012D) - JP 805ACD7D 0x80 / US 805A9AFD 0x80 diff --git a/include/d/lyt/d_lyt_deposit.h b/include/d/lyt/d_lyt_deposit.h index 9e437649..ba7dd61a 100644 --- a/include/d/lyt/d_lyt_deposit.h +++ b/include/d/lyt/d_lyt_deposit.h @@ -11,6 +11,7 @@ #include "d/lyt/d_lyt_deposit_stock.h" #include "d/lyt/d_textbox.h" #include "d/lyt/d_window.h" +#include "m/m_vec.h" #include "nw4r/lyt/lyt_bounding.h" #include "nw4r/lyt/lyt_pane.h" #include "s/s_State.hpp" @@ -32,6 +33,11 @@ public: void setModeCheck(); void setModeChange(bool unk); void setModeArrangement(); + void setModeReverseChange(); + void setModeScroll(bool leftRight, bool viaButton); + void setModeRecycle(); + void setModeArrangementOut(); + void setModeOut(); bool isSellableItem() const { return field_0x19524 && mItemSellValue > 0; @@ -53,6 +59,30 @@ public: return mIsIdle; } + bool isPointingAtToStockBounding() const { + return mIsPointingAtToStockBounding; + } + + bool isPointingAtToPouchBounding() const { + return mIsPointingAtToPouchBounding; + } + + bool getField_0x19523() const { + return field_0x19523; + } + + bool getField_0x19525() const { + return field_0x19525; + } + + bool getField_0x1952B() const { + return field_0x1952B; + } + + bool isHoldingItem() const { + return mCurrentlyHoldingItemSlot >= 0; + } + private: static const s32 NUM_STOCKS = 3; static const s32 STOCK_ACTIVE = 0; @@ -65,28 +95,32 @@ private: static const s32 NUM_PAGES = 5; void setPouchItemsVisible(bool visible); - void fn_802AA7E0(); + void buildSubpanes(); void fn_802AD370(); - void fn_802AAFC0(); - void fn_802AB210(); + void checkPointToStock(); + void handleNavOrPoint(); void checkForItemPickupOrDrop(); void fn_802ABB60(); - void fn_802AB080(); + void checkPointToPouch(); void fn_802AC3C0(); void fn_802AD4C0(); void loadItemText(s32 itemId, s32 where); void fn_802AC670(); void fn_802AC290(s32); void fn_802AD460(); - void loadItems(s32 hiddenSlot); + void loadStockItems(s32 hiddenSlot); s32 getItemSellValueFrame(s32 value); void fn_802AC0E0(s32); - void fn_802AAEC0(s32); + void loadPouchItem(s32 slot); void fn_8018ADA0(s32); - void fn_802AAB30(); + void loadInitialState(); void fn_802AD400(); + void navigateOffIcon(); + s32 checkNav(); + void fn_802AC980(); + void fn_802AC360(s32); STATE_FUNC_DECLARE(dLytDepositMain_c, ModeNone); STATE_FUNC_DECLARE(dLytDepositMain_c, ModeIn); @@ -115,9 +149,7 @@ private: /* 0x00A3C */ dWindow_c *mpWindows[2]; /* 0x00A44 */ dTextBox_c *mpSizeBoxes[2]; /* 0x00A4C */ dCursorHitCheckLyt_c mCsHitCheck; - - u8 _0x00002[0x8]; - + /* 0x00A74 */ mVec2_c mCsPosition; /* 0x00A7C */ dLytDepositStock_c mStock[NUM_STOCKS]; /* 0x143F0 */ dLytDepositBoxCursor_c mCursor; /* 0x14D48 */ dLytCommonIconItem_c mPouchItems[RING_NUM_ITEMS]; @@ -127,8 +159,8 @@ private: /* 0x19494 */ d2d::SubPaneList mRingList; /* 0x194A0 */ d2d::SubPaneListNode mRingNodes[RING_NUM_ITEMS]; /* 0x19520 */ bool mIsIdle; - /* 0x19521 */ bool field_0x19521; - /* 0x19522 */ bool field_0x19522; + /* 0x19521 */ bool mIsPointingAtToStockBounding; + /* 0x19522 */ bool mIsPointingAtToPouchBounding; /* 0x19523 */ bool field_0x19523; /* 0x19524 */ bool field_0x19524; /* 0x19525 */ bool field_0x19525; @@ -189,9 +221,9 @@ private: /* 0x08C */ UI_STATE_MGR_DECLARE(dLytDeposit_c); /* 0x0C8 */ d2d::ResAccIf_c mResAcc; /* 0x438 */ dLytDepositMain_c mMain; - /* 0x19998 */ bool field_0x19998; - /* 0x19999 */ bool field_0x19999; - /* 0x1999A */ bool field_0x1999A; + /* 0x19998 */ bool mInRequest; + /* 0x19999 */ bool mIsMovingOut; + /* 0x1999A */ bool mScrollViaArrowButton; }; #endif diff --git a/include/d/lyt/d_lyt_deposit_box_cursor.h b/include/d/lyt/d_lyt_deposit_box_cursor.h index 4c403b48..65cdf154 100644 --- a/include/d/lyt/d_lyt_deposit_box_cursor.h +++ b/include/d/lyt/d_lyt_deposit_box_cursor.h @@ -14,7 +14,7 @@ public: }; public: - dLytDepositBoxCursor_c() : mSlot(-1), field_0x950(0), mItemLocation(0) {} + dLytDepositBoxCursor_c() : mSlot(-1), mItem(0), mItemLocation(0) {} /* vt 0x0C */ virtual bool build(d2d::ResAccIf_c *resAcc) override; /* vt 0x10 */ virtual bool remove() override; /* vt 0x14 */ virtual bool execute() override; @@ -33,7 +33,7 @@ public: bool draw(); void init(s32 location, s32 slot, s32 item, bool unk); - void updateSlot(s32 location, s32 slot, s32 unk, bool unk2); + void updateSlot(s32 location, s32 slot, s32 item, bool unk2); void fn_801580A0(); bool isVisible() const { @@ -58,7 +58,7 @@ private: /* 0x948 */ bool mIsVisible; /* 0x948 */ bool field_0x949; /* 0x94C */ s32 mSlot; - /* 0x950 */ s32 field_0x950; + /* 0x950 */ s32 mItem; /* 0x954 */ s32 mItemLocation; }; diff --git a/include/d/lyt/d_lyt_deposit_stock.h b/include/d/lyt/d_lyt_deposit_stock.h index faf8eb85..90f2c061 100644 --- a/include/d/lyt/d_lyt_deposit_stock.h +++ b/include/d/lyt/d_lyt_deposit_stock.h @@ -79,6 +79,10 @@ public: return mIsModeSell; } + bool isModeFinish() const { + return mIsModeFinish; + } + void disableModeSort() { mIsModeSort = false; } @@ -91,7 +95,11 @@ public: mIsModeSell = false; } - void returnToNormalMode() { + void disableModeFinish() { + mIsModeFinish = false; + } + + void returnToNoneMode() { mIsModeFinish = false; mIsModeSell = false; mIsModeSort = false; @@ -99,6 +107,13 @@ public: mSavedArrowDirection = ARROW_NONE; } + void disableSpecialModes() { + mIsModeSell = false; + mIsModeFinish = false; + mIsModeSort = false; + mSavedArrowDirection = ARROW_NONE; + } + u8 getItem(s32 idx) const { return mItemIds[idx]; } @@ -127,6 +142,10 @@ public: return mArrowDirection; } + void setMainStock(bool b) { + mIsMainStock = b; + } + //private: static const s32 NUM_ICONS_PER_PAGE = 12; static const s32 NUM_PAGES = 5; @@ -161,7 +180,7 @@ public: /* 0x684A */ bool mIsSortBlocked; /* 0x684B */ bool field_0x684B; /* 0x684C */ bool field_0x684C; - /* 0x684D */ bool field_0x684D; + /* 0x684D */ bool mIsMainStock; /* 0x684E */ bool field_0x684E; /* 0x6850 */ s32 mCurrentNavTarget; /* 0x6854 */ UNKWORD field_0x6854; diff --git a/src/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common/Include/cwchar b/src/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common/Include/cwchar index 7191d7a0..3e2dfba5 100644 --- a/src/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common/Include/cwchar +++ b/src/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common/Include/cwchar @@ -4,8 +4,8 @@ #ifdef __cplusplus namespace std { -using ::mbstowcs; -using ::mbtowc; +// using ::mbstowcs; +// using ::mbtowc; using ::swprintf; using ::vswprintf; using ::wcscat; @@ -14,7 +14,7 @@ using ::wcscmp; using ::wcscpy; using ::wcslen; using ::wcsncpy; -using ::wcstombs; +// using ::wcstombs; } // namespace std #endif diff --git a/src/d/lyt/d_lyt_deposit.cpp b/src/d/lyt/d_lyt_deposit.cpp index 8548de8d..04bf619d 100644 --- a/src/d/lyt/d_lyt_deposit.cpp +++ b/src/d/lyt/d_lyt_deposit.cpp @@ -8,7 +8,11 @@ #include "d/d_pad.h" #include "d/d_pad_nav.h" #include "d/d_pouch.h" +#include "d/d_rumble.h" +#include "d/flag/storyflag_manager.h" #include "d/lyt/d2d.h" +#include "d/lyt/d_lyt_common_icon_item.h" +#include "d/lyt/d_lyt_common_icon_item_maps.h" #include "d/lyt/d_lyt_deposit_box_cursor.h" #include "d/lyt/d_lyt_deposit_stock.h" #include "d/lyt/d_lyt_util_items.h" @@ -19,11 +23,17 @@ #include "f/f_profile_name.h" #include "m/m_pad.h" #include "m/m_vec.h" +#include "nw4r/lyt/lyt_group.h" +#include "nw4r/lyt/lyt_pane.h" +#include "nw4r/lyt/lyt_types.h" #include "nw4r/math/math_types.h" +#include "nw4r/types_nw4r.h" #include "sized_string.h" #include "toBeSorted/arc_managers/layout_arc_manager.h" #include "toBeSorted/file_manager.h" +#include + struct DepositSellValues { /* 0x00 */ u8 itemId; /* 0x02 */ u16 sellValue; //< 0 -> unsellable @@ -178,12 +188,12 @@ void dLytDepositMain_c::executeState_ModeIn() { void dLytDepositMain_c::finalizeState_ModeIn() {} void dLytDepositMain_c::initializeState_ModeCheck() { - field_0x19521 = false; - field_0x19522 = false; + mIsPointingAtToStockBounding = false; + mIsPointingAtToPouchBounding = false; } void dLytDepositMain_c::executeState_ModeCheck() { - fn_802AAFC0(); - fn_802AB210(); + checkPointToStock(); + handleNavOrPoint(); checkForItemPickupOrDrop(); fn_802ABB60(); mIsIdle = true; @@ -191,13 +201,13 @@ void dLytDepositMain_c::executeState_ModeCheck() { void dLytDepositMain_c::finalizeState_ModeCheck() {} void dLytDepositMain_c::initializeState_ModeChange() { - field_0x19521 = false; - field_0x19522 = false; + mIsPointingAtToStockBounding = false; + mIsPointingAtToPouchBounding = false; } void dLytDepositMain_c::executeState_ModeChange() { if (mIsIdle) { fn_802AC3C0(); - fn_802AB080(); + checkPointToPouch(); if (field_0x19550 != 0) { field_0x19550--; } else { @@ -214,7 +224,7 @@ void dLytDepositMain_c::executeState_ModeChange() { if (mStock[STOCK_ACTIVE].isModePouch()) { mStock[STOCK_ACTIVE].disableModePouch(); - field_0x19522 = true; + mIsPointingAtToPouchBounding = true; } } @@ -232,7 +242,8 @@ void dLytDepositMain_c::executeState_ModeChange() { v = -1; } else { s32 item = mStock[STOCK_ACTIVE].getItem(mStock[STOCK_ACTIVE].getCurrentNavTarget()); - if (item != 12 && item != 50 && slot >= 0 && slot < NUM_ICONS_PER_PAGE * NUM_PAGES) { + if (item != LYT_CMN_PouchBlank4 && item != LYT_CMN_PouchPotionHealthPlusPlusHalf && slot >= 0 && + slot < NUM_ICONS_PER_PAGE * NUM_PAGES) { v = FileManager::GetInstance()->getItemCheckItem(slot); if (v == 0) { v = -1; @@ -241,7 +252,7 @@ void dLytDepositMain_c::executeState_ModeChange() { v = -1; } } - loadItemText(v, true); + loadItemText(v, dLytDepositBoxCursor_c::LOC_STOCK); fn_802ABB60(); fn_802AC670(); } else { @@ -253,7 +264,7 @@ void dLytDepositMain_c::executeState_ModeChange() { mStock[STOCK_ACTIVE].fn_80156530(true); setPouchItemsVisible(false); field_0x1954C = 1; - mStock[STOCK_ACTIVE].returnToNormalMode(); + mStock[STOCK_ACTIVE].returnToNoneMode(); s32 target = mStock[STOCK_ACTIVE].getCurrentNavTarget(); if (target < 0) { target += NUM_ICONS_PER_PAGE; @@ -276,7 +287,7 @@ void dLytDepositMain_c::executeState_ModeArrangement() { if (!mIsIdle) { if (mAnm[DEPOSIT_ANIM_BTN_DECIDE_01].isEndReached()) { mAnm[DEPOSIT_ANIM_BTN_DECIDE_01].setAnimEnable(false); - loadItems(mCurrentlyHoldingItemSlot - SLOT_STOCK_OFFSET); + loadStockItems(mCurrentlyHoldingItemSlot - SLOT_STOCK_OFFSET); mStock[STOCK_ACTIVE].fn_80156530(true); field_0x1954C = 1; mIsIdle = true; @@ -495,8 +506,6 @@ static const char *sWindowNames[] = { "W_bgP_01", }; -static const char *sGroupName = "G_ref_00"; - bool dLytDepositMain_c::build(d2d::ResAccIf_c *resAcc) { mLyt.setResAcc(resAcc); mLyt.build("depositBox_00.brlyt", nullptr); @@ -565,7 +574,7 @@ bool dLytDepositMain_c::build(d2d::ResAccIf_c *resAcc) { mAnm[i + DEPOSIT_ANIM_FLASH_OFFSET].setAnimEnable(false); } - fn_802AA7E0(); + buildSubpanes(); mCsHitCheck.init(mLyt.getLayout()->GetRootPane(), 0x1, 0, 0); dCsMgr_c::GetInstance()->registCursorTarget(&mCsHitCheck); fn_802AD370(); @@ -577,10 +586,10 @@ bool dLytDepositMain_c::build(d2d::ResAccIf_c *resAcc) { setModeNone(); - field_0x19521 = false; - field_0x19522 = false; - field_0x19523 = false; + mIsPointingAtToStockBounding = false; + mIsPointingAtToPouchBounding = false; field_0x19524 = false; + field_0x19523 = false; field_0x19525 = false; field_0x19526 = false; field_0x19527 = false; @@ -620,7 +629,7 @@ bool dLytDepositMain_c::execute() { mCursor.execute(); for (int i = 0; i < RING_NUM_ITEMS; i++) { - if (mPouchItemIds[i] < 50) { + if (mPouchItemIds[i] < LYT_CMN_PouchPotionHealthPlusPlusHalf) { mRingNodes[i].mpLytPane->execute(); } } @@ -714,7 +723,7 @@ void dLytDepositMain_c::setModeIn() { } else { loc = dLytDepositBoxCursor_c::LOC_POUCH; } - fn_802AAB30(); + loadInitialState(); if (loc == dLytDepositBoxCursor_c::LOC_POUCH) { mAnm[DEPOSIT_ANIM_IN].setAnimEnable(true); @@ -785,6 +794,733 @@ void dLytDepositMain_c::setModeArrangement() { mStateMgr.changeState(StateID_ModeArrangement); } +void dLytDepositMain_c::setModeReverseChange() { + mAnm[DEPOSIT_ANIM_CHANGE].setAnimEnable(true); + mAnm[DEPOSIT_ANIM_CHANGE].setFrame(mAnm[DEPOSIT_ANIM_CHANGE].getLastFrame()); + mAnm[DEPOSIT_ANIM_CHANGE].setBackwardsOnce(); + mAnm[DEPOSIT_ANIM_SELECT_ON_POUCH].setAnimEnable(true); + mAnm[DEPOSIT_ANIM_SELECT_ON_POUCH].setFrame(0.0f); + mAnm[DEPOSIT_ANIM_SELECT_ON_POUCH].setForwardOnce(); + + mLyt.calc(); + + mStock[STOCK_ACTIVE].navigateOffIcon(); + mStock[STOCK_ACTIVE].field_0x684B = true; + mStock[STOCK_ACTIVE].fn_80156530(false); + mStock[STOCK_ACTIVE].navigateToItem(); + mStock[STOCK_ACTIVE].returnToNoneMode(); + mCurrentPouchNavTarget = -4; + fn_802AD400(); + mArrow.requestOut(); + dSndSmallEffectMgr_c::GetInstance()->playSound(SE_S_SHOP_STK_CHANGE_POUCH); + mStateStep = 0; + mStateMgr.changeState(StateID_ModeReverseChange); + mIsIdle = false; +} + +void dLytDepositMain_c::setModeScroll(bool leftRight, bool viaButton) { + if (leftRight) { + mAnm[DEPOSIT_ANIM_SCROLL_R].setAnimEnable(true); + mAnm[DEPOSIT_ANIM_SCROLL_R].setFrame(0.0f); + } else { + mAnm[DEPOSIT_ANIM_SCROLL_L].setAnimEnable(true); + mAnm[DEPOSIT_ANIM_SCROLL_L].setFrame(0.0f); + } + mLyt.calc(); + mStock[STOCK_ACTIVE].navigateOffIcon(); + mStock[STOCK_ACTIVE].field_0x684B = true; + mStock[STOCK_ACTIVE].fn_80156530(false); + if (viaButton) { + mArrow.fn_80168760(); + } + fn_802AD400(); + mHasScrolledOtherStocks = false; + mStateMgr.changeState(StateID_ModeScroll); + mIsIdle = false; +} + +void dLytDepositMain_c::setModeRecycle() { + mAnm[DEPOSIT_ANIM_BTN_DECIDE_02].setAnimEnable(true); + mAnm[DEPOSIT_ANIM_BTN_DECIDE_02].setFrame(0.0f); + mLyt.calc(); + mStateStep = 0; + field_0x19526 = true; + field_0x19527 = true; + + if (field_0x1954C == 0) { + setPouchItemsVisible(false); + } else { + mStock[STOCK_ACTIVE].fn_80156530(false); + } + dPadNav::setNavEnabled(false, false); + mCursor.setVisible(false); + dSndSmallEffectMgr_c::GetInstance()->playSound(SE_S_SHOP_STK_SELECT_SELL); + mStateMgr.changeState(StateID_ModeRecycle); + mIsIdle = false; +} + +void dLytDepositMain_c::setModeArrangementOut() { + mAnm[DEPOSIT_ANIM_BTN_DECIDE_01].setAnimEnable(true); + mAnm[DEPOSIT_ANIM_BTN_DECIDE_01].setFrame(0.0f); + mLyt.calc(); + field_0x19526 = false; + mCursorLocation = dLytDepositBoxCursor_c::LOC_STOCK; + field_0x19527 = true; + mStateStep = 0; + dPadNav::setNavEnabled(false, false); + mStateMgr.changeState(StateID_ModeArrangementOut); + mIsIdle = false; +} + +void dLytDepositMain_c::setModeOut() { + mAnm[DEPOSIT_ANIM_BTN_DECIDE_00].setAnimEnable(true); + mAnm[DEPOSIT_ANIM_BTN_DECIDE_00].setFrame(0.0f); + mLyt.calc(); + + if (*mStateMgr.getStateID() == StateID_ModeChange) { + navigateOffIcon(); + } else { + mStock[STOCK_ACTIVE].navigateOffIcon(); + } + + field_0x19526 = false; + field_0x19527 = false; + + dSndSmallEffectMgr_c::GetInstance()->playSound(SE_S_SHOP_STK_SELECT_DECIDE); + dPadNav::setNavEnabled(false, false); + mStateMgr.changeState(StateID_ModeOut); + mIsIdle = false; +} + +void dLytDepositMain_c::loadStockItems(s32 hiddenSlot) { + for (int i = 0; i < NUM_STOCKS; i++) { + mStock[i].loadItems(hiddenSlot); + } +} + +static const char *sGroupName = "G_ref_00"; + +void dLytDepositMain_c::buildSubpanes() { + void *data = LayoutArcManager::GetInstance()->getLoadedData("DoButton"); + d2d::ResAccIf_c resAcc1; + resAcc1.attach(data, ""); + + for (int i = 0; i < RING_NUM_ITEMS; i++) { + mRingNodes[i].mpLytPane = &mPouchItems[i]; + mPouchItems[i].build(&resAcc1, dLytCommonIconItem_c::POUCH); + mRingList.PushBack(&mRingNodes[i]); + } + + nw4r::lyt::GroupContainer *container = mLyt.getLayout()->GetGroupContainer(); + if (container != nullptr) { + nw4r::lyt::Group *g = container->FindGroupByName(sGroupName); + if (g != nullptr) { + d2d::dSubPane::linkMeters(g, &mRingList); + } + } + + for (int i = 0; i < RING_NUM_ITEMS; i++) { + mRingNodes[i].mpPane->SetVisible(false); + } + + void *data2 = LayoutArcManager::GetInstance()->getLoadedData("Shop"); + d2d::ResAccIf_c resAcc2; + resAcc2.attach(data2, ""); + + static const u8 sInitialPageIndices[] = {0, 1, 4}; + + bool isMainStock = true; + for (int i = 0; i < NUM_STOCKS; i++) { + mStockNodes[i].mpLytPane = &mStock[i]; + mStock[i].setPage(sInitialPageIndices[i]); + mStock[i].setMainStock(isMainStock); + mStockNodes[i].mpLytPane->build(&resAcc2); + mStockList.PushBack(&mStockNodes[i]); + isMainStock = false; + } + + if (container != nullptr) { + nw4r::lyt::Group *g = container->FindGroupByName(sGroupName); + if (g != nullptr) { + d2d::dSubPane::linkMeters(g, &mStockList); + } + } + + for (int i = 0; i < NUM_STOCKS; i++) { + mStockNodes[i].mpPane->SetVisible(true); + } +} + +void dLytDepositMain_c::loadInitialState() { + mAnm[DEPOSIT_ANIM_CHANGE].setAnimEnable(true); + mAnm[DEPOSIT_ANIM_CHANGE].setFrame(0.0f); + mAnm[DEPOSIT_ANIM_SELECT_ON_BOX].setAnimEnable(true); + mAnm[DEPOSIT_ANIM_SELECT_ON_POUCH].setAnimEnable(true); + + if (!field_0x19527 || mCursorLocation == dLytDepositBoxCursor_c::LOC_POUCH) { + mAnm[DEPOSIT_ANIM_SELECT_ON_BOX].setFrame(0.0f); + mAnm[DEPOSIT_ANIM_SELECT_ON_POUCH].setToEnd(); + } else { + mAnm[DEPOSIT_ANIM_SELECT_ON_BOX].setToEnd(); + mAnm[DEPOSIT_ANIM_SELECT_ON_POUCH].setFrame(0.0f); + } + + mAnm[DEPOSIT_ANIM_BTN_ON_OFF_00].setAnimEnable(true); + mAnm[DEPOSIT_ANIM_BTN_ON_OFF_00].setFrame(0.0f); + mAnm[DEPOSIT_ANIM_BTN_ON_OFF_01].setAnimEnable(true); + mAnm[DEPOSIT_ANIM_BTN_ON_OFF_01].setFrame(0.0f); + mAnm[DEPOSIT_ANIM_RECYCLE].setAnimEnable(true); + mAnm[DEPOSIT_ANIM_RECYCLE].setFrame(0.0f); + + mAnm[DEPOSIT_ANIM_INPUT_00].setAnimEnable(true); + mAnm[DEPOSIT_ANIM_INPUT_00].setForwardOnce(); + mAnm[DEPOSIT_ANIM_INPUT_00].setFrame(mAnm[DEPOSIT_ANIM_INPUT_00].getLastFrame()); + + mAnm[DEPOSIT_ANIM_INPUT_01].setAnimEnable(true); + mAnm[DEPOSIT_ANIM_INPUT_01].setForwardOnce(); + mAnm[DEPOSIT_ANIM_INPUT_01].setFrame(0.0f); + + mLyt.calc(); + + mAnm[DEPOSIT_ANIM_CHANGE].setAnimEnable(false); + mAnm[DEPOSIT_ANIM_SELECT_ON_BOX].setAnimEnable(false); + mAnm[DEPOSIT_ANIM_SELECT_ON_POUCH].setAnimEnable(false); + mAnm[DEPOSIT_ANIM_BTN_ON_OFF_00].setAnimEnable(false); + mAnm[DEPOSIT_ANIM_BTN_ON_OFF_01].setAnimEnable(false); + mAnm[DEPOSIT_ANIM_RECYCLE].setAnimEnable(false); + mAnm[DEPOSIT_ANIM_INPUT_00].setAnimEnable(false); + mAnm[DEPOSIT_ANIM_INPUT_01].setAnimEnable(false); + + for (int i = 0; i < RING_NUM_ITEMS; i++) { + mPouchItemIds[i] = getPouchItemForSlot(i, false); + f32 frame; + if (!hasPouchSlot(i, false)) { + frame = 0.0f; + mRingNodes[i].mpPane->SetVisible(false); + } else { + frame = 1.0f; + if (mPouchItemIds[i] != LYT_CMN_PouchPotionHealthPlusPlusHalf) { + mRingNodes[i].mpPane->SetVisible(true); + loadPouchItem(i); + } else { + mRingNodes[i].mpPane->SetVisible(false); + } + } + mAnm[i + DEPOSIT_ANIM_HAVE_OFFSET].setAnimEnable(true); + mAnm[i + DEPOSIT_ANIM_HAVE_OFFSET].setFrame(frame); + mLyt.calc(); + mAnm[i + DEPOSIT_ANIM_HAVE_OFFSET].setAnimEnable(false); + } + // we'll actually be initializing mCurrentlyHoldingItemSlot to -1 right afterwards + // so this is probably technically wrong + loadStockItems(mCurrentlyHoldingItemSlot - 8); + mIsPointingAtToStockBounding = false; + mIsPointingAtToPouchBounding = false; + field_0x19523 = false; + field_0x19524 = false; + field_0x19525 = false; + field_0x19526 = false; + field_0x19527 = false; + field_0x19528 = false; + + mCursorLocation = dLytDepositBoxCursor_c::LOC_POUCH; + field_0x19540 = 0; + mItemSellValue = 0; + + mCurrentPouchNavTarget = -1; + mCurrentlyHoldingItemSlot = -1; + field_0x19548 = -1; +} + +void dLytDepositMain_c::loadPouchItem(s32 slot) { + s32 amount = getPouchItemAmount(slot, false); + mPouchItems[slot].setUnk(false); + if (amount < 0) { + mPouchItems[slot].setHasNumber(false); + } else { + mPouchItems[slot].setHasNumber(true); + mPouchItems[slot].setNumber(amount); + } + mPouchItems[slot].setItem(mPouchItemIds[slot]); + u8 color = getPouchItemNumberColor(slot, false); + if (color != 3) { + mPouchItems[slot].setNumberColor(color); + } + f32 durability = getPouchShieldDurability(slot, false); + if (durability >= 0.0f) { + mPouchItems[slot].setShieldDurability(durability); + } +} + +void dLytDepositMain_c::checkPointToStock() { + dCursorHitCheck_c *d = dCsBase_c::GetInstance()->getHitCheck(); + mIsPointingAtToStockBounding = false; + if (dPadNav::isPointerVisible() && d != nullptr && d->getType() == 'lyt ' && + static_cast(d)->getHitPane() == mpBoundingBox) { + // TODO: mIsPointingAtToStockBounding is always false at this point + if (!mIsPointingAtToStockBounding) { + dRumble_c::start(dRumble_c::sRumblePreset1, dRumble_c::FLAG_SLOT0); + } + mIsPointingAtToStockBounding = true; + } +} + +void dLytDepositMain_c::checkPointToPouch() { + mIsPointingAtToPouchBounding = false; + if (dPadNav::isPointerVisible()) { + mCsPosition = dCsBase_c::GetInstance()->getCursorIf()->getCursorPos(); + nw4r::lyt::Pane *p = mLyt.findPane("N_ringAtari_00"); + nw4r::lyt::Size sz = p->GetSize(); + f32 radius = sz.width * 0.5f; + radius *= radius; + nw4r::math::MTX34 mtx = p->GetGlobalMtx(); + mVec3_c v(0.0f, 0.0f, 0.0f); + MTXMultVec(mtx, v, v); + // TODO I hate vectors + mVec2_c pos = mVec2_c(v.x, v.y); + if (pos.squareDistanceTo(mCsPosition) < radius) { + // TODO: field_0x19522 is always false at this point + if (!mIsPointingAtToPouchBounding) { + dRumble_c::start(dRumble_c::sRumblePreset1, dRumble_c::FLAG_SLOT0); + } + mIsPointingAtToPouchBounding = true; + } + } +} + +void dLytDepositMain_c::handleNavOrPoint() { + bool selectIcon = false; + s32 nextTarget = 0; + if (dPadNav::isPointerVisible()) { + for (nextTarget = 0; nextTarget < RING_NUM_ITEMS; nextTarget++) { + if (mPouchItemIds[nextTarget] < LYT_CMN_PouchPotionHealthPlusPlusHalf && + mPouchItems[nextTarget].isCursorOver()) { + mStock[STOCK_ACTIVE].disableSpecialModes(); + selectIcon = true; + break; + } + } + } else { + if (!mStock[STOCK_ACTIVE].isNavModeItem()) { + mStock[STOCK_ACTIVE].handleSpecialNavMode(); + } else if (!mStock[STOCK_ACTIVE].isModeSell() && !mStock[STOCK_ACTIVE].isModeSort() && + !mStock[STOCK_ACTIVE].isModeFinish()) { + s32 target = mCurrentPouchNavTarget; + s32 direction = dPadNav::getFSStickNavDirection(); + if (target < 0 || field_0x1952A) { + if (direction != dPadNav::FS_STICK_NONE || dCsBase_c::GetInstance()->isCursorStickVisible()) { + if (target < 0) { + target += SLOT_STOCK_OFFSET; + } + nextTarget = target; + dCsBase_c::GetInstance()->setCursorStickTargetPane(mpRingBoundings[target]); + if (!mCursor.isVisible() && mCurrentlyHoldingItemSlot >= 0) { + mCursor.setVisible(true); + } + selectIcon = true; + } + } else { + switch (checkNav()) { + case dPadNav::FS_STICK_UP: + nextTarget = mCurrentPouchNavTarget - 4; + selectIcon = true; + break; + case dPadNav::FS_STICK_RIGHT: + nextTarget = mCurrentPouchNavTarget + 1; + if (nextTarget >= 8) { + nextTarget = 0; + } + selectIcon = true; + break; + case dPadNav::FS_STICK_DOWN_RIGHT: + nextTarget = -1; + mStock[STOCK_ACTIVE].navigateToFinish(); + break; + case dPadNav::FS_STICK_DOWN: + nextTarget = mCurrentPouchNavTarget + 4; + if (nextTarget >= 8) { + mIsPointingAtToStockBounding = true; + nextTarget = -1; + } else { + selectIcon = true; + } + break; + case dPadNav::FS_STICK_DOWN_LEFT: + nextTarget = -1; + mStock[STOCK_ACTIVE].navigateToSell(); + fn_802AC980(); + break; + case dPadNav::FS_STICK_LEFT: + nextTarget = mCurrentPouchNavTarget - 1; + if (nextTarget < 0) { + nextTarget = 7; + } + selectIcon = true; + break; + default: + nextTarget = mCurrentPouchNavTarget; + selectIcon = true; + break; + } + if (nextTarget >= 0) { + dCsBase_c::GetInstance()->setCursorStickTargetPane(mpRingBoundings[nextTarget]); + } + } + } + } + + if (selectIcon) { + if (mCurrentPouchNavTarget != nextTarget) { + if (mCurrentPouchNavTarget >= 0) { + mPouchItems[mCurrentPouchNavTarget].setOff(); + mAnm[mCurrentPouchNavTarget + DEPOSIT_ANIM_FLASH_OFFSET].setAnimEnable(true); + } + if (mPouchItemIds[nextTarget] != LYT_CMN_PouchBlank4 && + mPouchItemIds[nextTarget] != LYT_CMN_PouchPotionHealthPlusPlusHalf && + (mCurrentlyHoldingItemSlot < 0 || mCurrentlyHoldingItemSlot != nextTarget)) { + mPouchItems[nextTarget].setOn(); + dSndSmallEffectMgr_c::GetInstance()->playSound(SE_S_SHOP_STK_POUCH_POINT_ITEM); + } else { + dSndSmallEffectMgr_c::GetInstance()->playSound(SE_S_SHOP_STK_POUCH_POINT_EMPTY); + } + + s32 anmIdx = nextTarget + DEPOSIT_ANIM_FLASH_OFFSET; + mAnm[anmIdx].setAnimEnable(true); + mAnm[anmIdx].setFrame(0.0f); + mLyt.calc(); + mAnm[anmIdx].setAnimEnable(false); + dRumble_c::start(dRumble_c::sRumblePreset1, dRumble_c::FLAG_SLOT0); + mCurrentPouchNavTarget = nextTarget; + } + if (mPouchItemIds[nextTarget] != LYT_CMN_PouchBlank4 && + mPouchItemIds[nextTarget] != LYT_CMN_PouchPotionHealthPlusPlusHalf && + (mCurrentlyHoldingItemSlot < 0 || mCurrentlyHoldingItemSlot != nextTarget)) { + loadItemText(getPouchItemIdForIndex(nextTarget, false), dLytDepositBoxCursor_c::LOC_POUCH); + } else { + loadItemText(-1, dLytDepositBoxCursor_c::LOC_POUCH); + } + mStock[STOCK_ACTIVE].navigateToItem(); + } else { + navigateOffIcon(); + } + + if (mCurrentPouchNavTarget >= 0) { + s32 id; + if (mCurrentlyHoldingItemSlot >= 0 && mCurrentlyHoldingItemSlot == mCurrentPouchNavTarget) { + id = LYT_CMN_PouchBlank4; + } else { + id = mPouchItemIds[mCurrentPouchNavTarget]; + } + mCursor.updateSlot(dLytDepositBoxCursor_c::LOC_POUCH, mCurrentPouchNavTarget, id, false); + } +} + +void dLytDepositMain_c::navigateOffIcon() { + if (mCurrentPouchNavTarget >= 0) { + // TODO why LYT_CMN_PouchPotionHealthPlusPlusHalf + if (mPouchItemIds[mCurrentPouchNavTarget] != LYT_CMN_PouchBlank4 && + mPouchItemIds[mCurrentPouchNavTarget] != LYT_CMN_PouchPotionHealthPlusPlusHalf && + (mCurrentlyHoldingItemSlot < 0 || mCurrentlyHoldingItemSlot != mCurrentPouchNavTarget)) { + mPouchItems[mCurrentPouchNavTarget].setOff(); + loadItemText(-1, dLytDepositBoxCursor_c::LOC_POUCH); + } + mAnm[mCurrentPouchNavTarget + DEPOSIT_ANIM_FLASH_OFFSET].setAnimEnable(true); + mCurrentPouchNavTarget -= SLOT_STOCK_OFFSET; + } +} + +s32 dLytDepositMain_c::checkNav() { + s32 direction = dPadNav::getFSStickNavDirection(); + switch (direction) { + case dPadNav::FS_STICK_UP: { + s32 target = mCurrentPouchNavTarget; + if (target == 0) { + direction = dPadNav::FS_STICK_NONE; + } else if (target == 1 || target == 2 || target == 3) { + direction = dPadNav::FS_STICK_LEFT; + } else if (target == 5 || target == 6 || target == 7) { + direction = dPadNav::FS_STICK_RIGHT; + } + break; + } + case dPadNav::FS_STICK_UP_RIGHT: { + s32 target = mCurrentPouchNavTarget; + if (target == 0 || target == 6 || target == 7) { + direction = dPadNav::FS_STICK_RIGHT; + } else if (target == 2 || target == 3 || target == 4) { + direction = dPadNav::FS_STICK_LEFT; + } else if (target == 5) { + direction = dPadNav::FS_STICK_UP; + } else { + direction = dPadNav::FS_STICK_NONE; + } + break; + } + case dPadNav::FS_STICK_RIGHT: { + s32 target = mCurrentPouchNavTarget; + // wish I knew why this requires a range comparison... + if (target >= 0 && target <= 1 || target == 7) { + direction = dPadNav::FS_STICK_RIGHT; + } else if (target == 2 || target == 3) { + if (mCurrentlyHoldingItemSlot >= 0) { + direction = dPadNav::FS_STICK_NONE; + } else { + direction = dPadNav::FS_STICK_DOWN_RIGHT; + } + } else if (target == 4 || target == 5) { + direction = dPadNav::FS_STICK_LEFT; + } else { + direction = dPadNav::FS_STICK_UP; + } + break; + } + case dPadNav::FS_STICK_DOWN_RIGHT: { + s32 target = mCurrentPouchNavTarget; + if (target == 0 || target == 1) { + direction = dPadNav::FS_STICK_RIGHT; + } else if ((target == 2 || target == 3) && mCurrentlyHoldingItemSlot >= 0) { + direction = dPadNav::FS_STICK_NONE; + } else if (target == 4) { + direction = dPadNav::FS_STICK_DOWN; + } else if (target == 5 || target == 6) { + direction = dPadNav::FS_STICK_LEFT; + } else if (target == 7) { + direction = dPadNav::FS_STICK_UP; + } + break; + } + case dPadNav::FS_STICK_DOWN: { + s32 target = mCurrentPouchNavTarget; + if (target == 0) { + direction = dPadNav::FS_STICK_DOWN; + } else if (target == 1 || target == 2 || target == 3) { + direction = dPadNav::FS_STICK_RIGHT; + } else if (target == 5 || target == 6 || target == 7) { + direction = dPadNav::FS_STICK_LEFT; + } + break; + } + case dPadNav::FS_STICK_DOWN_LEFT: { + // wish I knew why this requires a switch... + switch (mCurrentPouchNavTarget) { + case 0: + case 7: direction = dPadNav::FS_STICK_LEFT; break; + case 1: + case 4: direction = dPadNav::FS_STICK_DOWN; break; + case 2: + case 3: direction = dPadNav::FS_STICK_RIGHT; break; + case 5: + case 6: + if (mItemSellValue > 0) { + direction = dPadNav::FS_STICK_DOWN_LEFT; + } else { + direction = dPadNav::FS_STICK_NONE; + } + break; + } + break; + } + case dPadNav::FS_STICK_LEFT: { + // wish I knew why this requires a switch... + switch (mCurrentPouchNavTarget) { + case 0: + case 1: + case 7: direction = dPadNav::FS_STICK_LEFT; break; + case 2: direction = dPadNav::FS_STICK_DOWN; break; + case 3: + case 4: direction = dPadNav::FS_STICK_RIGHT; break; + case 5: + case 6: + if (mItemSellValue > 0) { + direction = dPadNav::FS_STICK_DOWN_LEFT; + } else { + direction = dPadNav::FS_STICK_NONE; + } + break; + } + break; + } + case dPadNav::FS_STICK_UP_LEFT: { + s32 target = mCurrentPouchNavTarget; + if (target == 0 || target == 1 || target == 2) { + direction = dPadNav::FS_STICK_LEFT; + } else if (target == 3) { + direction = dPadNav::FS_STICK_DOWN; + } else if (target == 4 || target == 5 || target == 6) { + direction = dPadNav::FS_STICK_RIGHT; + } else { + direction = dPadNav::FS_STICK_NONE; + } + break; + } + } + + return direction; +} + +void dLytDepositMain_c::fn_802ABB60() { + s32 updateFlags = 0; + dCursorHitCheck_c *d = dCsBase_c::GetInstance()->getHitCheck(); + if (dPadNav::isPointerVisible()) { + if (d != nullptr && d->getType() == 'lyt ') { + if (static_cast(d)->getHitPane() == mpBoundingChoices && + mCurrentlyHoldingItemSlot < 0) { + mStock[STOCK_ACTIVE].navigateToFinish(); + mStock[STOCK_ACTIVE].disableModeSort(); + mStock[STOCK_ACTIVE].disableModeSell(); + updateFlags = 1; + } else if (static_cast(d)->getHitPane() == mpBoundingItem12 && + mItemSellValue != 0) { + mStock[STOCK_ACTIVE].navigateToSell(); + mStock[STOCK_ACTIVE].disableModeFinish(); + mStock[STOCK_ACTIVE].disableModeSort(); + updateFlags = 2; + } + } + } else { + s32 direction = dPadNav::getFSStickNavDirection(); + if (mStock[STOCK_ACTIVE].isModeFinish()) { + if (!field_0x19523 || field_0x1952A) { + dCsBase_c::GetInstance()->setCursorStickTargetPane(mpBoundingChoices); + updateFlags = 1; + } else if (field_0x1954C == 0) { + switch (direction) { + case 1: + case 8: + mStock[STOCK_ACTIVE].disableModeFinish(); + fn_802AC0E0(2); + break; + case 7: + mStock[STOCK_ACTIVE].disableModeFinish(); + fn_802AC0E0(3); + break; + default: updateFlags = 1; break; + } + } else { + switch (direction) { + case 1: + case 2: { + mStock[STOCK_ACTIVE].disableModeFinish(); + mArrow.setField_0x6B8(1); + mStock[STOCK_ACTIVE].navigateToArrow(dLytDepositStock_c::ARROW_RIGHT); + dRumble_c::start(dRumble_c::sRumblePreset1, dRumble_c::FLAG_SLOT0); + mStock[STOCK_ACTIVE].saveArrowDirection(); + break; + } + case 7: + case 8: { + mStock[STOCK_ACTIVE].disableModeFinish(); + mStock[STOCK_ACTIVE].navigateToSort(); + dCsBase_c::GetInstance()->setCursorStickTargetPane(mpBoundingCleanUp); + break; + } + default: { + updateFlags = 1; + break; + } + } + } + } else if (mStock[STOCK_ACTIVE].isModeSell()) { + if (!field_0x19524 || field_0x1952A) { + dCsBase_c::GetInstance()->setCursorStickTargetPane(mpBoundingItem12); + mCursor.fn_801580A0(); + updateFlags = 2; + } else if (field_0x1954C == 0) { + switch (direction) { + case 1: + case 2: + mStock[STOCK_ACTIVE].disableModeSell(); + fn_802AC0E0(6); + break; + case 3: + mStock[STOCK_ACTIVE].disableModeSell(); + fn_802AC0E0(5); + break; + case 4: + if (mCurrentlyHoldingItemSlot < 0) { + mStock[STOCK_ACTIVE].disableModeSell(); + mStock[STOCK_ACTIVE].navigateToFinish(); + dCsBase_c::GetInstance()->setCursorStickTargetPane(mpBoundingChoices); + } + break; + default: updateFlags = 2; break; + } + } else { + switch (direction) { + case 1: { + mStock[STOCK_ACTIVE].disableModeSell(); + mArrow.setField_0x6B8(0); + mStock[STOCK_ACTIVE].navigateToArrow(dLytDepositStock_c::ARROW_LEFT); + dRumble_c::start(dRumble_c::sRumblePreset1, dRumble_c::FLAG_SLOT0); + break; + } + case 2: + case 3: { + mStock[STOCK_ACTIVE].disableModeSell(); + fn_802AC290(6); + break; + } + default: { + updateFlags = 2; + break; + } + } + } + } + } + + if (updateFlags & 1) { + if (!field_0x19523) { + mAnm[DEPOSIT_ANIM_BTN_ON_OFF_00].setAnimEnable(true); + mAnm[DEPOSIT_ANIM_BTN_ON_OFF_00].setFrame(0.0f); + mAnm[DEPOSIT_ANIM_BTN_ON_OFF_00].setForwardOnce(); + dRumble_c::start(dRumble_c::sRumblePreset1, dRumble_c::FLAG_SLOT0); + } + dCsBase_c::GetInstance()->setCursorStickTargetPane(mpBoundingChoices); + field_0x19523 = true; + } else if (field_0x19523) { + mAnm[DEPOSIT_ANIM_BTN_ON_OFF_00].setAnimEnable(true); + mAnm[DEPOSIT_ANIM_BTN_ON_OFF_00].setBackwardsOnce(); + mStock[STOCK_ACTIVE].disableModeFinish(); + field_0x19523 = false; + } + + if (updateFlags & 2) { + if (!field_0x19524 && mItemSellValue != 0) { + mAnm[DEPOSIT_ANIM_RECYCLE].setAnimEnable(true); + mAnm[DEPOSIT_ANIM_RECYCLE].setFrame(0.0f); + mAnm[DEPOSIT_ANIM_RECYCLE].setForwardOnce(); + mpPaneABtn->SetVisible(true); + mpPanePrice->SetVisible(true); + + dTextBox_c *box1, *box2; + box1 = mLyt.getTextBox("T_recycle_01"); + box2 = mLyt.getTextBox("T_recycleS_01"); + fn_802AC360(mItemSellValue); + static wchar_t buf[5]; + swprintf(buf, ARRAY_LENGTH(buf), L"%d", mItemSellValue); + box1->setTextWithGlobalTextProcessor(buf, nullptr); + box2->setTextWithGlobalTextProcessor(buf, nullptr); + dRumble_c::start(dRumble_c::sRumblePreset1, dRumble_c::FLAG_SLOT0); + if (field_0x1954C != 0) { + mArrow.setBackwards(false); + } + } + dCsBase_c::GetInstance()->setCursorStickTargetPane(mpBoundingItem12); + field_0x19524 = true; + } else { + if (field_0x19524) { + mAnm[DEPOSIT_ANIM_RECYCLE].setAnimEnable(true); + mAnm[DEPOSIT_ANIM_RECYCLE].setBackwardsOnce(); + mStock[STOCK_ACTIVE].disableModeSell(); + field_0x19524 = false; + } + if (field_0x1954C != 0) { + mArrow.setBackwards(true); + } + } +} + void dLytDepositMain_c::loadItemText(s32 itemId, s32 where) { dTextBox_c *box1, *box2; @@ -793,7 +1529,9 @@ void dLytDepositMain_c::loadItemText(s32 itemId, s32 where) { box2 = mLyt.getTextBox("T_messageS_08"); } else { box1 = mLyt.getTextBox("T_nameSpace_00"); - box2 = mLyt.getTextBox("T_nameSpaceS_00"); + // @bug shouldn't this be T_nameSpaceS_00 ? + // causes a missing text shadow + box2 = mLyt.getTextBox("T_nameSpace_00"); } if (itemId < 0) { @@ -823,9 +1561,9 @@ void dLytDepositMain_c::checkForItemPickupOrDrop() { s32 item; if (mCurrentlyHoldingItemSlot < 0) { // Not holding an item... - if (mCurrentPouchNavTarget >= 0 && mPouchItemIds[mCurrentPouchNavTarget] != 12 && + if (mCurrentPouchNavTarget >= 0 && mPouchItemIds[mCurrentPouchNavTarget] != LYT_CMN_PouchBlank4 && // ... and picking up an item from the pouch - mPouchItemIds[mCurrentPouchNavTarget] != 50) { + mPouchItemIds[mCurrentPouchNavTarget] != LYT_CMN_PouchPotionHealthPlusPlusHalf) { mCursorLocation = dLytDepositBoxCursor_c::LOC_POUCH; field_0x19540 = convertLytPouchSlot2(mCurrentPouchNavTarget); item = getPouchItemIdForIndex(mCurrentPouchNavTarget, false); @@ -838,12 +1576,12 @@ void dLytDepositMain_c::checkForItemPickupOrDrop() { mAnm[mCurrentPouchNavTarget + DEPOSIT_ANIM_FLASH_OFFSET].setAnimEnable(false); mPouchItems[mCurrentPouchNavTarget].setOff(); - loadItemText(-1, false); + loadItemText(-1, dLytDepositBoxCursor_c::LOC_POUCH); dSndSmallEffectMgr_c::GetInstance()->playSound(SE_S_SHOP_STK_POUCH_CHACH_ITEM); anyPickup = true; } else if (mStock[STOCK_ACTIVE].getCurrentNavTarget() >= 0) { s32 activeItem = mStock[STOCK_ACTIVE].getItem(mStock[STOCK_ACTIVE].getCurrentNavTarget()); - if (activeItem != 12) { + if (activeItem != LYT_CMN_PouchBlank4) { // ... and picking up an item from the stock s32 stockSlot = mStock[STOCK_ACTIVE].getCurrentSlot(); mCursorLocation = dLytDepositBoxCursor_c::LOC_STOCK; @@ -854,8 +1592,8 @@ void dLytDepositMain_c::checkForItemPickupOrDrop() { mCursorLocation, stockSlot, mStock[STOCK_ACTIVE].getItem(mStock[STOCK_ACTIVE].getCurrentNavTarget()), false ); - mStock[STOCK_ACTIVE].pickUpItem(stockSlot, 0); - loadItemText(-1, true); + mStock[STOCK_ACTIVE].pickUpItem(stockSlot, false); + loadItemText(-1, dLytDepositBoxCursor_c::LOC_STOCK); field_0x19554 = 0; dSndSmallEffectMgr_c::GetInstance()->playSound(SE_S_SHOP_STK_STOCK_CHACH_ITEM); anyPickup = true; @@ -892,7 +1630,8 @@ void dLytDepositMain_c::checkForItemPickupOrDrop() { } else { // Currently holding an item... bool b2 = false; - if (mCurrentPouchNavTarget >= 0 && mPouchItemIds[mCurrentPouchNavTarget] != 50) { + if (mCurrentPouchNavTarget >= 0 && + mPouchItemIds[mCurrentPouchNavTarget] != LYT_CMN_PouchPotionHealthPlusPlusHalf) { // ... and dropping the item onto the pouch s32 oldItem = mPouchItemIds[mCurrentPouchNavTarget]; if (mCurrentlyHoldingItemSlot < SLOT_STOCK_OFFSET) { @@ -902,9 +1641,9 @@ void dLytDepositMain_c::checkForItemPickupOrDrop() { swapAdventurePouchItems( convertLytPouchSlot(mCurrentPouchNavTarget), convertLytPouchSlot(mCurrentlyHoldingItemSlot) ); - fn_802AAEC0(mCurrentPouchNavTarget); + loadPouchItem(mCurrentPouchNavTarget); mPouchItems[mCurrentlyHoldingItemSlot].reset(); - fn_802AAEC0(mCurrentlyHoldingItemSlot); + loadPouchItem(mCurrentlyHoldingItemSlot); if (mCurrentlyHoldingItemSlot == mCurrentPouchNavTarget) { b2 = true; } @@ -913,8 +1652,8 @@ void dLytDepositMain_c::checkForItemPickupOrDrop() { s32 actualSlot = mCurrentlyHoldingItemSlot - SLOT_STOCK_OFFSET; mPouchItemIds[mCurrentPouchNavTarget] = getDepositItemForSlot(actualSlot); swapStockAndPouchItems(convertLytPouchSlot(mCurrentPouchNavTarget), actualSlot); - loadItems(-1); - fn_802AAEC0(mCurrentPouchNavTarget); + loadStockItems(-1); + loadPouchItem(mCurrentPouchNavTarget); mStock[STOCK_ACTIVE].field_0x684E = false; for (int i = 0; i < NUM_STOCKS; i++) { @@ -922,14 +1661,15 @@ void dLytDepositMain_c::checkForItemPickupOrDrop() { } } - if (oldItem != 12 && !b2) { + if (oldItem != LYT_CMN_PouchBlank4 && !b2) { dSndSmallEffectMgr_c::GetInstance()->playSound(SE_S_SHOP_STK_POUCH_RELEASE_ITEM_CHANGE); } else { dSndSmallEffectMgr_c::GetInstance()->playSound(SE_S_SHOP_STK_POUCH_RELEASE_ITEM); } mItemSellValue = 0; anyPickup = true; - } else if (mStock[STOCK_ACTIVE].getCurrentNavTarget() >= 0 && mStock[STOCK_ACTIVE].getActiveItem() != 50) { + } else if (mStock[STOCK_ACTIVE].getCurrentNavTarget() >= 0 && + mStock[STOCK_ACTIVE].getActiveItem() != LYT_CMN_PouchPotionHealthPlusPlusHalf) { // ... and dropping the item into the stock s32 slot = mStock[STOCK_ACTIVE].getCurrentSlot(); field_0x19554 = slot; @@ -942,11 +1682,11 @@ void dLytDepositMain_c::checkForItemPickupOrDrop() { ); mPouchItemIds[mCurrentlyHoldingItemSlot] = item; mPouchItems[mCurrentlyHoldingItemSlot].reset(); - fn_802AAEC0(mCurrentlyHoldingItemSlot); + loadPouchItem(mCurrentlyHoldingItemSlot); } else { // Source item is from stock, so swap stock items swapStockItems(mCurrentlyHoldingItemSlot - SLOT_STOCK_OFFSET, slot); - loadItems(-1); + loadStockItems(-1); if (!dPadNav::isPointerVisible()) { mStock[STOCK_ACTIVE].field_0x684B = true; } @@ -961,7 +1701,7 @@ void dLytDepositMain_c::checkForItemPickupOrDrop() { mStock[i].field_0x684E = false; } - if (item != 12 && !b2) { + if (item != LYT_CMN_PouchBlank4 && !b2) { dSndSmallEffectMgr_c::GetInstance()->playSound(SE_S_SHOP_STK_STOCK_RELEASE_ITEM_CHANGE); } else { dSndSmallEffectMgr_c::GetInstance()->playSound(SE_S_SHOP_STK_STOCK_RELEASE_ITEM); @@ -1000,18 +1740,20 @@ void dLytDepositMain_c::checkForItemPickupOrDrop() { } } else { if ((mCurrentlyHoldingItemSlot < SLOT_STOCK_OFFSET) || - ((mCurrentlyHoldingItemSlot - SLOT_STOCK_OFFSET) / 12) != mStock[STOCK_ACTIVE].getPage()) { + ((mCurrentlyHoldingItemSlot - SLOT_STOCK_OFFSET) / NUM_ICONS_PER_PAGE) != + mStock[STOCK_ACTIVE].getPage()) { fn_802AC290(0); } else { - fn_802AC290((mCurrentlyHoldingItemSlot - SLOT_STOCK_OFFSET) % 12); + fn_802AC290((mCurrentlyHoldingItemSlot - SLOT_STOCK_OFFSET) % NUM_ICONS_PER_PAGE); } } } if (mCurrentlyHoldingItemSlot < SLOT_STOCK_OFFSET) { + // dropped pouch item, show pouch pane mRingNodes[mCurrentlyHoldingItemSlot].mpPane->SetVisible(true); } else { mStock[STOCK_ACTIVE].pickUpItem(mCurrentlyHoldingItemSlot - SLOT_STOCK_OFFSET, true); - loadItems(-1); + loadStockItems(-1); mStock[STOCK_ACTIVE].field_0x684B = true; mStock[STOCK_ACTIVE].fn_80156530(true); } @@ -1041,10 +1783,10 @@ STATE_DEFINE(dLytDeposit_c, Out); void dLytDeposit_c::initializeState_None() {} void dLytDeposit_c::executeState_None() { - if (field_0x19998) { + if (mInRequest) { mMain.setModeIn(); mStateMgr.changeState(StateID_In); - field_0x19998 = false; + mInRequest = false; } } void dLytDeposit_c::finalizeState_None() {} @@ -1068,35 +1810,118 @@ void dLytDeposit_c::executeState_In() { void dLytDeposit_c::finalizeState_In() {} void dLytDeposit_c::initializeState_Check() {} -void dLytDeposit_c::executeState_Check() {} +void dLytDeposit_c::executeState_Check() { + if (mMain.isIdle()) { + if (dPad::getDownTrigA() && mMain.isSellableItem()) { + mMain.setModeRecycle(); + mStateMgr.changeState(StateID_Recycle); + } else if ((dPad::getDownTrigA() && mMain.getField_0x19523()) || + (dPad::getDownTrigB() && !mMain.getField_0x1952B() && !mMain.isHoldingItem())) { + mMain.setModeOut(); + mStateMgr.changeState(StateID_Out); + } else if (mMain.isPointingAtToStockBounding()) { + mMain.setModeChange(true); + mStateMgr.changeState(StateID_Change); + dSndSmallEffectMgr_c::GetInstance()->playSound(SE_S_SHOP_STK_CHANGE_STOCK); + } + } +} void dLytDeposit_c::finalizeState_Check() {} void dLytDeposit_c::initializeState_Change() {} -void dLytDeposit_c::executeState_Change() {} +void dLytDeposit_c::executeState_Change() { + if (mMain.isIdle()) { + if ((dPad::getDownTrigA() && mMain.getField_0x19523()) || + (dPad::getDownTrigB() && !mMain.getField_0x1952B() && !mMain.isHoldingItem())) { + mMain.setModeOut(); + mStateMgr.changeState(StateID_Out); + } else if (checkForNavRight()) { + dSndSmallEffectMgr_c::GetInstance()->playSound(SE_S_SHOP_STK_STOCK_PAGE_RIGHT); + mMain.setModeScroll(true, mScrollViaArrowButton); + mStateMgr.changeState(StateID_Scroll); + mScrollViaArrowButton = false; + } else if (checkForNavLeft()) { + dSndSmallEffectMgr_c::GetInstance()->playSound(SE_S_SHOP_STK_STOCK_PAGE_LEFT); + mMain.setModeScroll(false, mScrollViaArrowButton); + mStateMgr.changeState(StateID_Scroll); + mScrollViaArrowButton = false; + } else if (mMain.isPointingAtToPouchBounding()) { + mMain.setModeReverseChange(); + mStateMgr.changeState(StateID_ReverseChange); + } else if (dPad::getDownTrigA() && mMain.isSellableItem()) { + mMain.setModeRecycle(); + mStateMgr.changeState(StateID_Recycle); + } else if (dPad::getDownTrigA() && mMain.getField_0x19525()) { + // TODO: what does this do? + if (!StoryflagManager::sInstance->getCounterOrFlag(STORYFLAG_TALKED_TO_STRICH)) { + mMain.setModeArrangementOut(); + mStateMgr.changeState(StateID_ArrangementOut); + } else { + mMain.setModeArrangement(); + mStateMgr.changeState(StateID_Arrangement); + } + sortStock(); + dSndSmallEffectMgr_c::GetInstance()->playSound(SE_S_SHOP_STK_STOCK_SELECT_TRIM); + } + } +} void dLytDeposit_c::finalizeState_Change() {} void dLytDeposit_c::initializeState_Arrangement() {} -void dLytDeposit_c::executeState_Arrangement() {} +void dLytDeposit_c::executeState_Arrangement() { + if (mMain.isIdle()) { + mMain.setModeChange(false); + mStateMgr.changeState(StateID_Change); + } +} void dLytDeposit_c::finalizeState_Arrangement() {} void dLytDeposit_c::initializeState_ReverseChange() {} -void dLytDeposit_c::executeState_ReverseChange() {} +void dLytDeposit_c::executeState_ReverseChange() { + if (mMain.isIdle()) { + mMain.setModeCheck(); + mStateMgr.changeState(StateID_Check); + } +} void dLytDeposit_c::finalizeState_ReverseChange() {} void dLytDeposit_c::initializeState_Scroll() {} -void dLytDeposit_c::executeState_Scroll() {} +void dLytDeposit_c::executeState_Scroll() { + if (mMain.isIdle()) { + mMain.setModeChange(false); + mStateMgr.changeState(StateID_Change); + } +} void dLytDeposit_c::finalizeState_Scroll() {} void dLytDeposit_c::initializeState_Recycle() {} -void dLytDeposit_c::executeState_Recycle() {} +void dLytDeposit_c::executeState_Recycle() { + if (mMain.isIdle()) { + mMain.setModeNone(); + mStateMgr.changeState(StateID_None); + } +} void dLytDeposit_c::finalizeState_Recycle() {} void dLytDeposit_c::initializeState_ArrangementOut() {} -void dLytDeposit_c::executeState_ArrangementOut() {} +void dLytDeposit_c::executeState_ArrangementOut() { + if (mMain.isIdle()) { + mMain.setModeNone(); + mStateMgr.changeState(StateID_None); + } +} void dLytDeposit_c::finalizeState_ArrangementOut() {} void dLytDeposit_c::initializeState_Out() {} -void dLytDeposit_c::executeState_Out() {} +void dLytDeposit_c::executeState_Out() { + if (mMain.isIdle()) { + dCsBase_c::GetInstance()->setVisible(false); + dPadNav::setNavEnabled(false, false); + mIsMovingOut = true; + mMain.setModeNone(); + mStateMgr.changeState(StateID_None); + } +} void dLytDeposit_c::finalizeState_Out() {} SPECIAL_BASE_PROFILE(LYT_DEPOSIT, dLytDeposit_c, fProfile::LYT_DEPOSIT, 0x2B9, 0); @@ -1112,9 +1937,9 @@ int dLytDeposit_c::create() { sInstance = this; allocateLytWork1Heap("dLytDeposit_c::m_allocator", false); mStateMgr.changeState(StateID_None); - field_0x19998 = false; - field_0x19999 = false; - field_0x1999A = false; + mInRequest = false; + mIsMovingOut = false; + mScrollViaArrowButton = false; return SUCCEEDED; } @@ -1133,7 +1958,7 @@ int dLytDeposit_c::execute() { } int dLytDeposit_c::draw() { - if (*mStateMgr.getStateID() != StateID_None || field_0x19999) { + if (*mStateMgr.getStateID() != StateID_None || mIsMovingOut) { mMain.draw(); } return SUCCEEDED; @@ -1150,18 +1975,18 @@ int dLytDeposit_c::doDelete() { bool dLytDeposit_c::checkForNavRight() { if (dPad::getDownTrigRight()) { if (!mMain.isSellableItem()) { - field_0x1999A = false; + mScrollViaArrowButton = false; return true; } } if (dPad::getDownTrigA() && mMain.getArrowDirection() == dLytDepositStock_c::ARROW_RIGHT) { dSndSmallEffectMgr_c::GetInstance()->playSound(SE_S_SHOP_STK_STOCK_SELECT_TURN_PAGE_RIGHT); - field_0x1999A = true; + mScrollViaArrowButton = true; return true; } else if (dPadNav::isPointerVisible() && dPadNav::isMplsNavRightGesture()) { mMain.setField_0x1952C(false); - field_0x1999A = false; + mScrollViaArrowButton = false; return true; } @@ -1171,18 +1996,18 @@ bool dLytDeposit_c::checkForNavRight() { bool dLytDeposit_c::checkForNavLeft() { if (dPad::getDownTrigLeft()) { if (!mMain.isSellableItem()) { - field_0x1999A = false; + mScrollViaArrowButton = false; return true; } } if (dPad::getDownTrigA() && mMain.getArrowDirection() == dLytDepositStock_c::ARROW_LEFT) { dSndSmallEffectMgr_c::GetInstance()->playSound(SE_S_SHOP_STK_STOCK_SELECT_TURN_PAGE_LEFT); - field_0x1999A = true; + mScrollViaArrowButton = true; return true; } else if (dPadNav::isPointerVisible() && !mMain.isSellableItem() && dPadNav::isMplsNavLeftGesture()) { mMain.setField_0x1952C(false); - field_0x1999A = false; + mScrollViaArrowButton = false; return true; } diff --git a/src/d/lyt/d_lyt_deposit_box_cursor.cpp b/src/d/lyt/d_lyt_deposit_box_cursor.cpp index 7ba91dfa..5471b3aa 100644 --- a/src/d/lyt/d_lyt_deposit_box_cursor.cpp +++ b/src/d/lyt/d_lyt_deposit_box_cursor.cpp @@ -5,6 +5,7 @@ #include "d/d_pad_nav.h" #include "d/lyt/d2d.h" #include "d/lyt/d_lyt_common_icon_item.h" +#include "d/lyt/d_lyt_common_icon_item_maps.h" #include "d/lyt/d_lyt_util_items.h" #include "m/m_vec.h" #include "nw4r/lyt/lyt_group.h" @@ -114,17 +115,17 @@ void dLytDepositBoxCursor_c::realizeNav() { s = mAnm[DEPOSIT_BOX_CURSOR_ANIM_STICK_CURSOR].getLastFrame(); } else if (dPadNav::isPointerVisible()) { s = 4; - } else if (field_0x950 == 50) { + } else if (mItem == LYT_CMN_PouchPotionHealthPlusPlusHalf) { s = 5; } else if (field_0x949) { s = 6; } else if (mItemLocation == LOC_POUCH) { // Flip the cursor for pouch slot 0 so that it's not above the screen edge s = mSlot == 0 ? 1 : 0; - if (field_0x950 == 12) { + if (mItem == LYT_CMN_PouchBlank4) { s += 2; } - } else if (field_0x950 == 12) { + } else if (mItem == LYT_CMN_PouchBlank4) { s = 2; } else { s = 0; @@ -182,13 +183,13 @@ void dLytDepositBoxCursor_c::init(s32 location, s32 slot, s32 item, bool unk) { } mNode.mpPane->SetVisible(true); - field_0x950 = 12; + mItem = LYT_CMN_PouchBlank4; realizeNav(); mIsVisible = true; } -void dLytDepositBoxCursor_c::updateSlot(s32 location, s32 slot, s32 unk, bool unk2) { - field_0x950 = unk; +void dLytDepositBoxCursor_c::updateSlot(s32 location, s32 slot, s32 item, bool unk2) { + mItem = item; mItemLocation = location; field_0x949 = unk2; if (mItemLocation == LOC_POUCH) { diff --git a/src/d/lyt/d_lyt_deposit_stock.cpp b/src/d/lyt/d_lyt_deposit_stock.cpp index 4bb60172..fc00aaa5 100644 --- a/src/d/lyt/d_lyt_deposit_stock.cpp +++ b/src/d/lyt/d_lyt_deposit_stock.cpp @@ -118,7 +118,7 @@ bool dLytDepositStock_c::execute() { mNodes[i].mpLytPane->execute(); } - if (field_0x684D) { + if (mIsMainStock) { mStateMgr.executeState(); } From 2b2206cc4c8819a54da9cc98539abcc7836b54e3 Mon Sep 17 00:00:00 2001 From: robojumper Date: Thu, 25 Dec 2025 01:12:36 +0100 Subject: [PATCH 05/11] Better --- config/SOUE01/symbols.txt | 6 +- include/d/lyt/d_lyt_deposit.h | 16 +- src/d/lyt/d_lyt_deposit.cpp | 413 +++++++++++++++++++--------------- 3 files changed, 247 insertions(+), 188 deletions(-) diff --git a/config/SOUE01/symbols.txt b/config/SOUE01/symbols.txt index b1627571..1ba0db63 100644 --- a/config/SOUE01/symbols.txt +++ b/config/SOUE01/symbols.txt @@ -16029,10 +16029,10 @@ handleNavOrPoint__17dLytDepositMain_cFv = .text:0x802AB210; // type:function siz navigateOffIcon__17dLytDepositMain_cFv = .text:0x802AB690; // type:function size:0xB8 checkNav__17dLytDepositMain_cFv = .text:0x802AB750; // type:function size:0x2E8 loadItemText__17dLytDepositMain_cFll = .text:0x802ABA40; // type:function size:0x114 -fn_802ABB60__17dLytDepositMain_cFv = .text:0x802ABB60; // type:function size:0x580 -fn_802AC0E0__17dLytDepositMain_cFl = .text:0x802AC0E0; // type:function size:0x1A8 +checkSellOrFinish__17dLytDepositMain_cFv = .text:0x802ABB60; // type:function size:0x580 +selectPouchSlot__17dLytDepositMain_cFl = .text:0x802AC0E0; // type:function size:0x1A8 fn_802AC290__17dLytDepositMain_cFl = .text:0x802AC290; // type:function size:0xC4 -fn_802AC360__17dLytDepositMain_cFl = .text:0x802AC360; // type:function size:0x58 +calcNumDigits__17dLytDepositMain_cFl = .text:0x802AC360; // type:function size:0x58 fn_802AC3C0__17dLytDepositMain_cFv = .text:0x802AC3C0; // type:function size:0x234 fn_802AC600 = .text:0x802AC600; // type:function size:0x64 fn_802AC670__17dLytDepositMain_cFv = .text:0x802AC670; // type:function size:0x304 diff --git a/include/d/lyt/d_lyt_deposit.h b/include/d/lyt/d_lyt_deposit.h index ba7dd61a..1ce62261 100644 --- a/include/d/lyt/d_lyt_deposit.h +++ b/include/d/lyt/d_lyt_deposit.h @@ -40,7 +40,7 @@ public: void setModeOut(); bool isSellableItem() const { - return field_0x19524 && mItemSellValue > 0; + return mIsSellActive && mItemSellValue > 0; } s32 getArrowDirection() const { @@ -68,7 +68,7 @@ public: } bool getField_0x19523() const { - return field_0x19523; + return mIsFinishActive; } bool getField_0x19525() const { @@ -101,18 +101,18 @@ private: void checkPointToStock(); void handleNavOrPoint(); void checkForItemPickupOrDrop(); - void fn_802ABB60(); + void checkSellOrFinish(); void checkPointToPouch(); void fn_802AC3C0(); void fn_802AD4C0(); void loadItemText(s32 itemId, s32 where); void fn_802AC670(); - void fn_802AC290(s32); + void returnCursorAfterCancellingSell(s32 targetSlot); void fn_802AD460(); void loadStockItems(s32 hiddenSlot); s32 getItemSellValueFrame(s32 value); - void fn_802AC0E0(s32); + void selectPouchSlot(s32 slot); void loadPouchItem(s32 slot); void fn_8018ADA0(s32); void loadInitialState(); @@ -120,7 +120,7 @@ private: void navigateOffIcon(); s32 checkNav(); void fn_802AC980(); - void fn_802AC360(s32); + s32 calcNumDigits(s32); STATE_FUNC_DECLARE(dLytDepositMain_c, ModeNone); STATE_FUNC_DECLARE(dLytDepositMain_c, ModeIn); @@ -161,8 +161,8 @@ private: /* 0x19520 */ bool mIsIdle; /* 0x19521 */ bool mIsPointingAtToStockBounding; /* 0x19522 */ bool mIsPointingAtToPouchBounding; - /* 0x19523 */ bool field_0x19523; - /* 0x19524 */ bool field_0x19524; + /* 0x19523 */ bool mIsFinishActive; + /* 0x19524 */ bool mIsSellActive; /* 0x19525 */ bool field_0x19525; /* 0x19526 */ bool field_0x19526; /* 0x19527 */ bool field_0x19527; diff --git a/src/d/lyt/d_lyt_deposit.cpp b/src/d/lyt/d_lyt_deposit.cpp index 04bf619d..0a43b1d8 100644 --- a/src/d/lyt/d_lyt_deposit.cpp +++ b/src/d/lyt/d_lyt_deposit.cpp @@ -195,7 +195,7 @@ void dLytDepositMain_c::executeState_ModeCheck() { checkPointToStock(); handleNavOrPoint(); checkForItemPickupOrDrop(); - fn_802ABB60(); + checkSellOrFinish(); mIsIdle = true; } void dLytDepositMain_c::finalizeState_ModeCheck() {} @@ -253,7 +253,7 @@ void dLytDepositMain_c::executeState_ModeChange() { } } loadItemText(v, dLytDepositBoxCursor_c::LOC_STOCK); - fn_802ABB60(); + checkSellOrFinish(); fn_802AC670(); } else { if (mAnm[DEPOSIT_ANIM_CHANGE].isStop() && mArrow.isChangingState()) { @@ -271,7 +271,7 @@ void dLytDepositMain_c::executeState_ModeChange() { } dCsBase_c::GetInstance()->setCursorStickTargetPane(mpItemBoundings[target]); if (!dPadNav::isPointerVisible()) { - fn_802AC290(target); + returnCursorAfterCancellingSell(target); } fn_802AD460(); fn_802AD4C0(); @@ -311,7 +311,7 @@ void dLytDepositMain_c::executeState_ModeReverseChange() { } } else { fn_802AD460(); - fn_802AC0E0(4); + selectPouchSlot(4); mIsIdle = true; } } @@ -588,8 +588,8 @@ bool dLytDepositMain_c::build(d2d::ResAccIf_c *resAcc) { mIsPointingAtToStockBounding = false; mIsPointingAtToPouchBounding = false; - field_0x19524 = false; - field_0x19523 = false; + mIsFinishActive = false; + mIsSellActive = false; field_0x19525 = false; field_0x19526 = false; field_0x19527 = false; @@ -1016,8 +1016,8 @@ void dLytDepositMain_c::loadInitialState() { loadStockItems(mCurrentlyHoldingItemSlot - 8); mIsPointingAtToStockBounding = false; mIsPointingAtToPouchBounding = false; - field_0x19523 = false; - field_0x19524 = false; + mIsFinishActive = false; + mIsSellActive = false; field_0x19525 = false; field_0x19526 = false; field_0x19527 = false; @@ -1358,173 +1358,10 @@ s32 dLytDepositMain_c::checkNav() { return direction; } -void dLytDepositMain_c::fn_802ABB60() { - s32 updateFlags = 0; - dCursorHitCheck_c *d = dCsBase_c::GetInstance()->getHitCheck(); - if (dPadNav::isPointerVisible()) { - if (d != nullptr && d->getType() == 'lyt ') { - if (static_cast(d)->getHitPane() == mpBoundingChoices && - mCurrentlyHoldingItemSlot < 0) { - mStock[STOCK_ACTIVE].navigateToFinish(); - mStock[STOCK_ACTIVE].disableModeSort(); - mStock[STOCK_ACTIVE].disableModeSell(); - updateFlags = 1; - } else if (static_cast(d)->getHitPane() == mpBoundingItem12 && - mItemSellValue != 0) { - mStock[STOCK_ACTIVE].navigateToSell(); - mStock[STOCK_ACTIVE].disableModeFinish(); - mStock[STOCK_ACTIVE].disableModeSort(); - updateFlags = 2; - } - } - } else { - s32 direction = dPadNav::getFSStickNavDirection(); - if (mStock[STOCK_ACTIVE].isModeFinish()) { - if (!field_0x19523 || field_0x1952A) { - dCsBase_c::GetInstance()->setCursorStickTargetPane(mpBoundingChoices); - updateFlags = 1; - } else if (field_0x1954C == 0) { - switch (direction) { - case 1: - case 8: - mStock[STOCK_ACTIVE].disableModeFinish(); - fn_802AC0E0(2); - break; - case 7: - mStock[STOCK_ACTIVE].disableModeFinish(); - fn_802AC0E0(3); - break; - default: updateFlags = 1; break; - } - } else { - switch (direction) { - case 1: - case 2: { - mStock[STOCK_ACTIVE].disableModeFinish(); - mArrow.setField_0x6B8(1); - mStock[STOCK_ACTIVE].navigateToArrow(dLytDepositStock_c::ARROW_RIGHT); - dRumble_c::start(dRumble_c::sRumblePreset1, dRumble_c::FLAG_SLOT0); - mStock[STOCK_ACTIVE].saveArrowDirection(); - break; - } - case 7: - case 8: { - mStock[STOCK_ACTIVE].disableModeFinish(); - mStock[STOCK_ACTIVE].navigateToSort(); - dCsBase_c::GetInstance()->setCursorStickTargetPane(mpBoundingCleanUp); - break; - } - default: { - updateFlags = 1; - break; - } - } - } - } else if (mStock[STOCK_ACTIVE].isModeSell()) { - if (!field_0x19524 || field_0x1952A) { - dCsBase_c::GetInstance()->setCursorStickTargetPane(mpBoundingItem12); - mCursor.fn_801580A0(); - updateFlags = 2; - } else if (field_0x1954C == 0) { - switch (direction) { - case 1: - case 2: - mStock[STOCK_ACTIVE].disableModeSell(); - fn_802AC0E0(6); - break; - case 3: - mStock[STOCK_ACTIVE].disableModeSell(); - fn_802AC0E0(5); - break; - case 4: - if (mCurrentlyHoldingItemSlot < 0) { - mStock[STOCK_ACTIVE].disableModeSell(); - mStock[STOCK_ACTIVE].navigateToFinish(); - dCsBase_c::GetInstance()->setCursorStickTargetPane(mpBoundingChoices); - } - break; - default: updateFlags = 2; break; - } - } else { - switch (direction) { - case 1: { - mStock[STOCK_ACTIVE].disableModeSell(); - mArrow.setField_0x6B8(0); - mStock[STOCK_ACTIVE].navigateToArrow(dLytDepositStock_c::ARROW_LEFT); - dRumble_c::start(dRumble_c::sRumblePreset1, dRumble_c::FLAG_SLOT0); - break; - } - case 2: - case 3: { - mStock[STOCK_ACTIVE].disableModeSell(); - fn_802AC290(6); - break; - } - default: { - updateFlags = 2; - break; - } - } - } - } - } - - if (updateFlags & 1) { - if (!field_0x19523) { - mAnm[DEPOSIT_ANIM_BTN_ON_OFF_00].setAnimEnable(true); - mAnm[DEPOSIT_ANIM_BTN_ON_OFF_00].setFrame(0.0f); - mAnm[DEPOSIT_ANIM_BTN_ON_OFF_00].setForwardOnce(); - dRumble_c::start(dRumble_c::sRumblePreset1, dRumble_c::FLAG_SLOT0); - } - dCsBase_c::GetInstance()->setCursorStickTargetPane(mpBoundingChoices); - field_0x19523 = true; - } else if (field_0x19523) { - mAnm[DEPOSIT_ANIM_BTN_ON_OFF_00].setAnimEnable(true); - mAnm[DEPOSIT_ANIM_BTN_ON_OFF_00].setBackwardsOnce(); - mStock[STOCK_ACTIVE].disableModeFinish(); - field_0x19523 = false; - } - - if (updateFlags & 2) { - if (!field_0x19524 && mItemSellValue != 0) { - mAnm[DEPOSIT_ANIM_RECYCLE].setAnimEnable(true); - mAnm[DEPOSIT_ANIM_RECYCLE].setFrame(0.0f); - mAnm[DEPOSIT_ANIM_RECYCLE].setForwardOnce(); - mpPaneABtn->SetVisible(true); - mpPanePrice->SetVisible(true); - - dTextBox_c *box1, *box2; - box1 = mLyt.getTextBox("T_recycle_01"); - box2 = mLyt.getTextBox("T_recycleS_01"); - fn_802AC360(mItemSellValue); - static wchar_t buf[5]; - swprintf(buf, ARRAY_LENGTH(buf), L"%d", mItemSellValue); - box1->setTextWithGlobalTextProcessor(buf, nullptr); - box2->setTextWithGlobalTextProcessor(buf, nullptr); - dRumble_c::start(dRumble_c::sRumblePreset1, dRumble_c::FLAG_SLOT0); - if (field_0x1954C != 0) { - mArrow.setBackwards(false); - } - } - dCsBase_c::GetInstance()->setCursorStickTargetPane(mpBoundingItem12); - field_0x19524 = true; - } else { - if (field_0x19524) { - mAnm[DEPOSIT_ANIM_RECYCLE].setAnimEnable(true); - mAnm[DEPOSIT_ANIM_RECYCLE].setBackwardsOnce(); - mStock[STOCK_ACTIVE].disableModeSell(); - field_0x19524 = false; - } - if (field_0x1954C != 0) { - mArrow.setBackwards(true); - } - } -} - void dLytDepositMain_c::loadItemText(s32 itemId, s32 where) { dTextBox_c *box1, *box2; - if (where == 0) { + if (where == dLytDepositBoxCursor_c::LOC_POUCH) { box1 = mLyt.getTextBox("T_message_08"); box2 = mLyt.getTextBox("T_messageS_08"); } else { @@ -1554,6 +1391,228 @@ void dLytDepositMain_c::loadItemText(s32 itemId, s32 where) { } } +void dLytDepositMain_c::checkSellOrFinish() { + s32 updateFlags = 0; + dCursorHitCheck_c *d = dCsBase_c::GetInstance()->getHitCheck(); + if (dPadNav::isPointerVisible()) { + if (d != nullptr && d->getType() == 'lyt ') { + if (static_cast(d)->getHitPane() == mpBoundingChoices && + mCurrentlyHoldingItemSlot < 0) { + mStock[STOCK_ACTIVE].navigateToFinish(); + mStock[STOCK_ACTIVE].disableModeSort(); + mStock[STOCK_ACTIVE].disableModeSell(); + updateFlags = 1; + } else if (static_cast(d)->getHitPane() == mpBoundingItem12 && + mItemSellValue != 0) { + mStock[STOCK_ACTIVE].navigateToSell(); + mStock[STOCK_ACTIVE].disableModeFinish(); + mStock[STOCK_ACTIVE].disableModeSort(); + updateFlags = 2; + } + } + } else { + s32 direction = dPadNav::getFSStickNavDirection(); + if (mStock[STOCK_ACTIVE].isModeFinish()) { + if (!mIsFinishActive || field_0x1952A) { + dCsBase_c::GetInstance()->setCursorStickTargetPane(mpBoundingChoices); + updateFlags = 1; + } else if (field_0x1954C == 0) { + switch (direction) { + case dPadNav::FS_STICK_UP: + case dPadNav::FS_STICK_UP_LEFT: + mStock[STOCK_ACTIVE].disableModeFinish(); + selectPouchSlot(2); + break; + case dPadNav::FS_STICK_LEFT: + mStock[STOCK_ACTIVE].disableModeFinish(); + selectPouchSlot(3); + break; + default: updateFlags = 1; break; + } + } else { + switch (direction) { + case dPadNav::FS_STICK_UP: + case dPadNav::FS_STICK_UP_RIGHT: { + mStock[STOCK_ACTIVE].disableModeFinish(); + mArrow.setField_0x6B8(1); + mStock[STOCK_ACTIVE].navigateToArrow(dLytDepositStock_c::ARROW_RIGHT); + dRumble_c::start(dRumble_c::sRumblePreset1, dRumble_c::FLAG_SLOT0); + mStock[STOCK_ACTIVE].saveArrowDirection(); + break; + } + case dPadNav::FS_STICK_LEFT: + case dPadNav::FS_STICK_UP_LEFT: { + mStock[STOCK_ACTIVE].disableModeFinish(); + mStock[STOCK_ACTIVE].navigateToSort(); + dCsBase_c::GetInstance()->setCursorStickTargetPane(mpBoundingCleanUp); + break; + } + default: { + updateFlags = 1; + break; + } + } + } + } else if (mStock[STOCK_ACTIVE].isModeSell()) { + if (!mIsSellActive || field_0x1952A) { + dCsBase_c::GetInstance()->setCursorStickTargetPane(mpBoundingItem12); + mCursor.fn_801580A0(); + updateFlags = 2; + } else if (field_0x1954C == 0) { + switch (direction) { + case dPadNav::FS_STICK_UP: + case dPadNav::FS_STICK_UP_RIGHT: + mStock[STOCK_ACTIVE].disableModeSell(); + selectPouchSlot(6); + break; + case dPadNav::FS_STICK_RIGHT: + mStock[STOCK_ACTIVE].disableModeSell(); + selectPouchSlot(5); + break; + case dPadNav::FS_STICK_DOWN_RIGHT: + if (mCurrentlyHoldingItemSlot < 0) { + mStock[STOCK_ACTIVE].disableModeSell(); + mStock[STOCK_ACTIVE].navigateToFinish(); + dCsBase_c::GetInstance()->setCursorStickTargetPane(mpBoundingChoices); + } + break; + default: updateFlags = 2; break; + } + } else { + switch (direction) { + case dPadNav::FS_STICK_UP: { + mStock[STOCK_ACTIVE].disableModeSell(); + mArrow.setField_0x6B8(0); + mStock[STOCK_ACTIVE].navigateToArrow(dLytDepositStock_c::ARROW_LEFT); + dRumble_c::start(dRumble_c::sRumblePreset1, dRumble_c::FLAG_SLOT0); + break; + } + case dPadNav::FS_STICK_UP_RIGHT: + case dPadNav::FS_STICK_RIGHT: { + mStock[STOCK_ACTIVE].disableModeSell(); + returnCursorAfterCancellingSell(6); + break; + } + default: { + updateFlags = 2; + break; + } + } + } + } + } + + if (updateFlags & 1) { + if (!mIsFinishActive) { + mAnm[DEPOSIT_ANIM_BTN_ON_OFF_00].setAnimEnable(true); + mAnm[DEPOSIT_ANIM_BTN_ON_OFF_00].setFrame(0.0f); + mAnm[DEPOSIT_ANIM_BTN_ON_OFF_00].setForwardOnce(); + dRumble_c::start(dRumble_c::sRumblePreset1, dRumble_c::FLAG_SLOT0); + } + dCsBase_c::GetInstance()->setCursorStickTargetPane(mpBoundingChoices); + mIsFinishActive = true; + } else if (mIsFinishActive) { + mAnm[DEPOSIT_ANIM_BTN_ON_OFF_00].setAnimEnable(true); + mAnm[DEPOSIT_ANIM_BTN_ON_OFF_00].setBackwardsOnce(); + mStock[STOCK_ACTIVE].disableModeFinish(); + mIsFinishActive = false; + } + + if (updateFlags & 2) { + if (!mIsSellActive && mItemSellValue != 0) { + mAnm[DEPOSIT_ANIM_RECYCLE].setAnimEnable(true); + mAnm[DEPOSIT_ANIM_RECYCLE].setFrame(0.0f); + mAnm[DEPOSIT_ANIM_RECYCLE].setForwardOnce(); + mpPaneABtn->SetVisible(true); + mpPanePrice->SetVisible(true); + + dTextBox_c *box1, *box2; + box1 = mLyt.getTextBox("T_recycle_01"); + box2 = mLyt.getTextBox("T_recycleS_01"); + (void)calcNumDigits(mItemSellValue); + static wchar_t buf[5]; + swprintf(buf, ARRAY_LENGTH(buf), L"%d", mItemSellValue); + box1->setTextWithGlobalTextProcessor(buf, nullptr); + box2->setTextWithGlobalTextProcessor(buf, nullptr); + dRumble_c::start(dRumble_c::sRumblePreset1, dRumble_c::FLAG_SLOT0); + if (field_0x1954C != 0) { + mArrow.setBackwards(false); + } + } + dCsBase_c::GetInstance()->setCursorStickTargetPane(mpBoundingItem12); + mIsSellActive = true; + } else { + if (mIsSellActive) { + mAnm[DEPOSIT_ANIM_RECYCLE].setAnimEnable(true); + mAnm[DEPOSIT_ANIM_RECYCLE].setBackwardsOnce(); + mStock[STOCK_ACTIVE].disableModeSell(); + mIsSellActive = false; + } + if (field_0x1954C != 0) { + mArrow.setBackwards(true); + } + } +} + +void dLytDepositMain_c::selectPouchSlot(s32 slot) { + dCsBase_c::GetInstance()->setCursorStickTargetPane(mpRingBoundings[slot]); + mStock[STOCK_ACTIVE].navigateToItem(); + mCurrentPouchNavTarget = slot; + if (!dPadNav::isPointerVisible()) { + dRumble_c::start(dRumble_c::sRumblePreset1, dRumble_c::FLAG_SLOT0); + } + s32 item = mPouchItemIds[slot]; + if (mCurrentPouchNavTarget >= 0) { + if (mCurrentlyHoldingItemSlot >= 0 && mCurrentlyHoldingItemSlot == mCurrentPouchNavTarget) { + item = LYT_CMN_PouchBlank4; + } + mCursor.updateSlot(dLytDepositBoxCursor_c::LOC_POUCH, mCurrentPouchNavTarget, item, false); + } + if (item != LYT_CMN_PouchBlank4 && item != LYT_CMN_PouchPotionHealthPlusPlusHalf && !dPadNav::isPointerVisible()) { + mPouchItems[slot].setOn(); + loadItemText(getPouchItemIdForIndex(slot, false), dLytDepositBoxCursor_c::LOC_POUCH); + } else { + loadItemText(-1, dLytDepositBoxCursor_c::LOC_POUCH); + } + + mAnm[mCurrentPouchNavTarget + DEPOSIT_ANIM_FLASH_OFFSET].setAnimEnable(true); + mAnm[mCurrentPouchNavTarget + DEPOSIT_ANIM_FLASH_OFFSET].setFrame(0.0f); + mLyt.calc(); + mAnm[mCurrentPouchNavTarget + DEPOSIT_ANIM_FLASH_OFFSET].setAnimEnable(false); +} + +void dLytDepositMain_c::returnCursorAfterCancellingSell(s32 targetSlot) { + mStock[STOCK_ACTIVE].disableModeSell(); + if (dPadNav::isPointerVisible()) { + targetSlot -= 12; + } + mStock[STOCK_ACTIVE].selectNavTarget(targetSlot); + mStock[STOCK_ACTIVE].navigateToItem(); + s32 navTarget = mStock[STOCK_ACTIVE].getCurrentNavTarget(); + if (navTarget >= 0) { + dCsBase_c::GetInstance()->setCursorStickTargetPane(mpItemBoundings[navTarget]); + s32 item; + if (mCurrentlyHoldingItemSlot >= 0 && navTarget == mCurrentlyHoldingItemSlot - SLOT_STOCK_OFFSET) { + item = LYT_CMN_PouchBlank4; + } else { + item = mStock[STOCK_ACTIVE].getActiveItem(); + } + mCursor.updateSlot(dLytDepositBoxCursor_c::LOC_STOCK, navTarget, item, false); + } +} + +s32 dLytDepositMain_c::calcNumDigits(s32 value) { + int cmp = 1000; + int i = 4; + for (; i > 1; i--) { + if (value >= cmp) { + break; + } + cmp /= 10; + } + return i; +} + void dLytDepositMain_c::checkForItemPickupOrDrop() { bool anyPickup = false; @@ -1730,21 +1789,21 @@ void dLytDepositMain_c::checkForItemPickupOrDrop() { mAnm[DEPOSIT_ANIM_RECYCLE].setAnimEnable(true); mAnm[DEPOSIT_ANIM_RECYCLE].setBackwardsOnce(); mStock[STOCK_ACTIVE].disableModeSell(); - field_0x19524 = false; + mIsSellActive = false; if (field_0x1954C == 0) { // TODO: Why is this not >= ... if (mCurrentlyHoldingItemSlot > SLOT_STOCK_OFFSET) { - fn_802AC0E0(0); + selectPouchSlot(0); } else { - fn_802AC0E0(mCurrentlyHoldingItemSlot); + selectPouchSlot(mCurrentlyHoldingItemSlot); } } else { if ((mCurrentlyHoldingItemSlot < SLOT_STOCK_OFFSET) || ((mCurrentlyHoldingItemSlot - SLOT_STOCK_OFFSET) / NUM_ICONS_PER_PAGE) != mStock[STOCK_ACTIVE].getPage()) { - fn_802AC290(0); + returnCursorAfterCancellingSell(0); } else { - fn_802AC290((mCurrentlyHoldingItemSlot - SLOT_STOCK_OFFSET) % NUM_ICONS_PER_PAGE); + returnCursorAfterCancellingSell((mCurrentlyHoldingItemSlot - SLOT_STOCK_OFFSET) % NUM_ICONS_PER_PAGE); } } } From 72b8b1865fbbb81e918c5add5de7c076424e375e Mon Sep 17 00:00:00 2001 From: robojumper Date: Thu, 25 Dec 2025 19:46:37 +0100 Subject: [PATCH 06/11] d_lyt_deposit OK --- config/SOUE01/symbols.txt | 533 ++++++++++++++--------- configure.py | 2 +- include/d/lyt/d_lyt_common_arrow.h | 26 +- include/d/lyt/d_lyt_deposit.h | 57 ++- include/d/lyt/d_lyt_deposit_box_cursor.h | 8 +- include/d/lyt/d_lyt_deposit_stock.h | 20 +- src/d/lyt/d_lyt_common_arrow.cpp | 34 +- src/d/lyt/d_lyt_deposit.cpp | 352 +++++++++++++-- src/d/lyt/d_lyt_deposit_box_cursor.cpp | 16 +- src/d/lyt/d_lyt_deposit_stock.cpp | 27 +- src/d/lyt/d_lyt_pause.cpp | 8 +- src/d/lyt/d_lyt_pause_disp_00.cpp | 13 +- 12 files changed, 751 insertions(+), 345 deletions(-) diff --git a/config/SOUE01/symbols.txt b/config/SOUE01/symbols.txt index 1ba0db63..c2b85185 100644 --- a/config/SOUE01/symbols.txt +++ b/config/SOUE01/symbols.txt @@ -8700,7 +8700,7 @@ initIcon__22dLytDepositBoxCursor_cFv = .text:0x80157B70; // type:function size:0 realizeNav__22dLytDepositBoxCursor_cFv = .text:0x80157CC0; // type:function size:0x210 init__22dLytDepositBoxCursor_cFlllb = .text:0x80157ED0; // type:function size:0x17C updateSlot__22dLytDepositBoxCursor_cFlllb = .text:0x80158050; // type:function size:0x44 -fn_801580A0__22dLytDepositBoxCursor_cFv = .text:0x801580A0; // type:function size:0xC +activateSell__22dLytDepositBoxCursor_cFv = .text:0x801580A0; // type:function size:0xC __dt__22dLytDepositBoxCursor_cFv = .text:0x801580B0; // type:function size:0x1A8 scope:weak getName__22dLytDepositBoxCursor_cCFv = .text:0x80158260; // type:function size:0x8 scope:weak getLyt__22dLytDepositBoxCursor_cFv = .text:0x80158270; // type:function size:0x8 scope:weak @@ -9207,7 +9207,7 @@ setState__17dLytCommonArrow_cFl = .text:0x80168610; // type:function size:0x24 setTranslate__17dLytCommonArrow_cFPC7mVec2_c = .text:0x80168640; // type:function size:0x34 requestIn__17dLytCommonArrow_cFv = .text:0x80168680; // type:function size:0x70 requestOut__17dLytCommonArrow_cFv = .text:0x801686F0; // type:function size:0x70 -fn_80168760__17dLytCommonArrow_cFv = .text:0x80168760; // type:function size:0x2C +triggerArrowPress__17dLytCommonArrow_cFv = .text:0x80168760; // type:function size:0x2C displayElement__17dLytCommonArrow_cFlf = .text:0x80168790; // type:function size:0x68 unbindAt__17dLytCommonArrow_cFl = .text:0x80168800; // type:function size:0x10 tickDown__17dLytCommonArrow_cFPQ23d2d10AnmGroup_c = .text:0x80168810; // type:function size:0x64 @@ -15997,18 +15997,18 @@ initializeState_ModeOut__17dLytDepositMain_cFv = .text:0x802A8DF0; // type:funct executeState_ModeOut__17dLytDepositMain_cFv = .text:0x802A8E00; // type:function size:0x68 finalizeState_ModeOut__17dLytDepositMain_cFv = .text:0x802A8E70; // type:function size:0x4 __ct__17dLytDepositMain_cFv = .text:0x802A8E80; // type:function size:0x428 -__dt__56sFStateMgr_c<17dLytDepositMain_c,20sStateMethodUsr_FI_c>Fv = .text:0x802A92B0; // type:function size:0xA4 -__dt__86sStateMgr_c<17dLytDepositMain_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>Fv = .text:0x802A9360; // type:function size:0xA0 -__dt__33sFStateFct_c<17dLytDepositMain_c>Fv = .text:0x802A9400; // type:function size:0x6C -__dt__30sFState_c<17dLytDepositMain_c>Fv = .text:0x802A9470; // type:function size:0x58 -__ct__18dLytDepositStock_cFv = .text:0x802A94D0; // type:function size:0x138 +__dt__56sFStateMgr_c<17dLytDepositMain_c,20sStateMethodUsr_FI_c>Fv = .text:0x802A92B0; // type:function size:0xA4 scope:weak +__dt__86sStateMgr_c<17dLytDepositMain_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>Fv = .text:0x802A9360; // type:function size:0xA0 scope:weak +__dt__33sFStateFct_c<17dLytDepositMain_c>Fv = .text:0x802A9400; // type:function size:0x6C scope:weak +__dt__30sFState_c<17dLytDepositMain_c>Fv = .text:0x802A9470; // type:function size:0x58 scope:weak +__ct__18dLytDepositStock_cFv = .text:0x802A94D0; // type:function size:0x138 scope:weak build__17dLytDepositMain_cFPQ23d2d10ResAccIf_c = .text:0x802A9610; // type:function size:0x468 execute__17dLytDepositMain_cFv = .text:0x802A9A80; // type:function size:0x1EC -executeState__86sStateMgr_c<17dLytDepositMain_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>Fv = .text:0x802A9C70; // type:function size:0x10 +executeState__86sStateMgr_c<17dLytDepositMain_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>Fv = .text:0x802A9C70; // type:function size:0x10 scope:weak draw__17dLytDepositMain_cFv = .text:0x802A9C80; // type:function size:0x4C remove__17dLytDepositMain_cFv = .text:0x802A9CD0; // type:function size:0x1A8 setModeNone__17dLytDepositMain_cFv = .text:0x802A9E80; // type:function size:0x50 -changeState__86sStateMgr_c<17dLytDepositMain_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>FRC12sStateIDIf_c = .text:0x802A9ED0; // type:function size:0x10 +changeState__86sStateMgr_c<17dLytDepositMain_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>FRC12sStateIDIf_c = .text:0x802A9ED0; // type:function size:0x10 scope:weak setModeIn__17dLytDepositMain_cFv = .text:0x802A9EE0; // type:function size:0x19C setModeCheck__17dLytDepositMain_cFv = .text:0x802AA080; // type:function size:0x84 setModeChange__17dLytDepositMain_cFb = .text:0x802AA110; // type:function size:0xE4 @@ -16018,36 +16018,36 @@ setModeScroll__17dLytDepositMain_cFbb = .text:0x802AA3D0; // type:function size: setModeRecycle__17dLytDepositMain_cFv = .text:0x802AA4D0; // type:function size:0xEC setModeArrangementOut__17dLytDepositMain_cFv = .text:0x802AA5C0; // type:function size:0xB0 setModeOut__17dLytDepositMain_cFv = .text:0x802AA670; // type:function size:0xF8 -getStateID__86sStateMgr_c<17dLytDepositMain_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>CFv = .text:0x802AA770; // type:function size:0x10 +getStateID__86sStateMgr_c<17dLytDepositMain_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>CFv = .text:0x802AA770; // type:function size:0x10 scope:weak loadStockItems__17dLytDepositMain_cFl = .text:0x802AA780; // type:function size:0x5C buildSubpanes__17dLytDepositMain_cFv = .text:0x802AA7E0; // type:function size:0x348 loadInitialState__17dLytDepositMain_cFv = .text:0x802AAB30; // type:function size:0x388 loadPouchItem__17dLytDepositMain_cFl = .text:0x802AAEC0; // type:function size:0xF8 checkPointToStock__17dLytDepositMain_cFv = .text:0x802AAFC0; // type:function size:0xB4 checkPointToPouch__17dLytDepositMain_cFv = .text:0x802AB080; // type:function size:0x188 -handleNavOrPoint__17dLytDepositMain_cFv = .text:0x802AB210; // type:function size:0x474 +checkPouchItems__17dLytDepositMain_cFv = .text:0x802AB210; // type:function size:0x474 navigateOffIcon__17dLytDepositMain_cFv = .text:0x802AB690; // type:function size:0xB8 checkNav__17dLytDepositMain_cFv = .text:0x802AB750; // type:function size:0x2E8 loadItemText__17dLytDepositMain_cFll = .text:0x802ABA40; // type:function size:0x114 checkSellOrFinish__17dLytDepositMain_cFv = .text:0x802ABB60; // type:function size:0x580 selectPouchSlot__17dLytDepositMain_cFl = .text:0x802AC0E0; // type:function size:0x1A8 -fn_802AC290__17dLytDepositMain_cFl = .text:0x802AC290; // type:function size:0xC4 +returnCursorAfterCancellingSell__17dLytDepositMain_cFl = .text:0x802AC290; // type:function size:0xC4 calcNumDigits__17dLytDepositMain_cFl = .text:0x802AC360; // type:function size:0x58 -fn_802AC3C0__17dLytDepositMain_cFv = .text:0x802AC3C0; // type:function size:0x234 -fn_802AC600 = .text:0x802AC600; // type:function size:0x64 -fn_802AC670__17dLytDepositMain_cFv = .text:0x802AC670; // type:function size:0x304 -fn_802AC980__17dLytDepositMain_cFv = .text:0x802AC980; // type:function size:0x54 -fn_802AC9E0 = .text:0x802AC9E0; // type:function size:0x90 +checkSort__17dLytDepositMain_cFv = .text:0x802AC3C0; // type:function size:0x234 +returnCursorAfterCancellingSort__17dLytDepositMain_cFl = .text:0x802AC600; // type:function size:0x64 +checkArrows__17dLytDepositMain_cFv = .text:0x802AC670; // type:function size:0x304 +loadCursor__17dLytDepositMain_cFv = .text:0x802AC980; // type:function size:0x54 +returnCursorAfterCancellingArrow__17dLytDepositMain_cFl = .text:0x802AC9E0; // type:function size:0x90 setPouchItemsVisible__17dLytDepositMain_cFb = .text:0x802ACA70; // type:function size:0x80 checkForItemPickupOrDrop__17dLytDepositMain_cFv = .text:0x802ACAF0; // type:function size:0x85C getItemSellValueFrame__17dLytDepositMain_cFl = .text:0x802AD350; // type:function size:0x18 -fn_802AD370__17dLytDepositMain_cFv = .text:0x802AD370; // type:function size:0x8C -fn_802AD400__17dLytDepositMain_cFv = .text:0x802AD400; // type:function size:0x5C -fn_802AD460__17dLytDepositMain_cFv = .text:0x802AD460; // type:function size:0x60 -fn_802AD4C0__17dLytDepositMain_cFv = .text:0x802AD4C0; // type:function size:0x5C +loadPageText__17dLytDepositMain_cFv = .text:0x802AD370; // type:function size:0x8C +hideCursor__17dLytDepositMain_cFv = .text:0x802AD400; // type:function size:0x5C +showCursor__17dLytDepositMain_cFv = .text:0x802AD460; // type:function size:0x60 +updateStockCursor__17dLytDepositMain_cFv = .text:0x802AD4C0; // type:function size:0x5C initializeState_None__13dLytDeposit_cFv = .text:0x802AD520; // type:function size:0x4 executeState_None__13dLytDeposit_cFv = .text:0x802AD530; // type:function size:0x68 -changeState__82sStateMgr_c<13dLytDeposit_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>FRC12sStateIDIf_c = .text:0x802AD5A0; // type:function size:0x10 +changeState__82sStateMgr_c<13dLytDeposit_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>FRC12sStateIDIf_c = .text:0x802AD5A0; // type:function size:0x10 scope:weak finalizeState_None__13dLytDeposit_cFv = .text:0x802AD5B0; // type:function size:0x4 initializeState_In__13dLytDeposit_cFv = .text:0x802AD5C0; // type:function size:0x4 executeState_In__13dLytDeposit_cFv = .text:0x802AD5D0; // type:function size:0xBC @@ -16077,66 +16077,66 @@ initializeState_Out__13dLytDeposit_cFv = .text:0x802ADD30; // type:function size executeState_Out__13dLytDeposit_cFv = .text:0x802ADD40; // type:function size:0x80 finalizeState_Out__13dLytDeposit_cFv = .text:0x802ADDC0; // type:function size:0x4 dLytDeposit_c_classInit__Fv = .text:0x802ADDD0; // type:function size:0xF8 -__dt__26sFState_c<13dLytDeposit_c>Fv = .text:0x802ADED0; // type:function size:0x58 -__dt__29sFStateFct_c<13dLytDeposit_c>Fv = .text:0x802ADF30; // type:function size:0x6C -__dt__82sStateMgr_c<13dLytDeposit_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>Fv = .text:0x802ADFA0; // type:function size:0xA0 -__dt__52sFStateMgr_c<13dLytDeposit_c,20sStateMethodUsr_FI_c>Fv = .text:0x802AE040; // type:function size:0xA4 -__dt__17dLytDepositMain_cFv = .text:0x802AE0F0; // type:function size:0x390 +__dt__26sFState_c<13dLytDeposit_c>Fv = .text:0x802ADED0; // type:function size:0x58 scope:weak +__dt__29sFStateFct_c<13dLytDeposit_c>Fv = .text:0x802ADF30; // type:function size:0x6C scope:weak +__dt__82sStateMgr_c<13dLytDeposit_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>Fv = .text:0x802ADFA0; // type:function size:0xA0 scope:weak +__dt__52sFStateMgr_c<13dLytDeposit_c,20sStateMethodUsr_FI_c>Fv = .text:0x802AE040; // type:function size:0xA4 scope:weak +__dt__17dLytDepositMain_cFv = .text:0x802AE0F0; // type:function size:0x390 scope:weak build__13dLytDeposit_cFv = .text:0x802AE480; // type:function size:0x54 create__13dLytDeposit_cFv = .text:0x802AE4E0; // type:function size:0x70 execute__13dLytDeposit_cFv = .text:0x802AE550; // type:function size:0xB0 -getStateID__82sStateMgr_c<13dLytDeposit_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>CFv = .text:0x802AE600; // type:function size:0x10 -executeState__82sStateMgr_c<13dLytDeposit_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>Fv = .text:0x802AE610; // type:function size:0x10 +getStateID__82sStateMgr_c<13dLytDeposit_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>CFv = .text:0x802AE600; // type:function size:0x10 scope:weak +executeState__82sStateMgr_c<13dLytDeposit_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>Fv = .text:0x802AE610; // type:function size:0x10 scope:weak draw__13dLytDeposit_cFv = .text:0x802AE620; // type:function size:0x78 doDelete__13dLytDeposit_cFv = .text:0x802AE6A0; // type:function size:0x50 checkForNavRight__13dLytDeposit_cFv = .text:0x802AE6F0; // type:function size:0xE0 checkForNavLeft__13dLytDeposit_cFv = .text:0x802AE7D0; // type:function size:0x10C -__dt__13dLytDeposit_cFv = .text:0x802AE8E0; // type:function size:0x434 -build__29sFStateFct_c<13dLytDeposit_c>FRC12sStateIDIf_c = .text:0x802AED20; // type:function size:0x60 -dispose__29sFStateFct_c<13dLytDeposit_c>FRP10sStateIf_c = .text:0x802AED80; // type:function size:0xC -build__33sFStateFct_c<17dLytDepositMain_c>FRC12sStateIDIf_c = .text:0x802AED90; // type:function size:0x60 -dispose__33sFStateFct_c<17dLytDepositMain_c>FRP10sStateIf_c = .text:0x802AEDF0; // type:function size:0xC -build__34sFStateFct_c<18dLytDepositStock_c>FRC12sStateIDIf_c = .text:0x802AEE00; // type:function size:0x60 -dispose__34sFStateFct_c<18dLytDepositStock_c>FRP10sStateIf_c = .text:0x802AEE60; // type:function size:0xC -initialize__26sFState_c<13dLytDeposit_c>Fv = .text:0x802AEE70; // type:function size:0x1C -execute__26sFState_c<13dLytDeposit_c>Fv = .text:0x802AEE90; // type:function size:0x1C -finalize__26sFState_c<13dLytDeposit_c>Fv = .text:0x802AEEB0; // type:function size:0x1C -initialize__30sFState_c<17dLytDepositMain_c>Fv = .text:0x802AEED0; // type:function size:0x1C -execute__30sFState_c<17dLytDepositMain_c>Fv = .text:0x802AEEF0; // type:function size:0x1C -finalize__30sFState_c<17dLytDepositMain_c>Fv = .text:0x802AEF10; // type:function size:0x1C -initialize__31sFState_c<18dLytDepositStock_c>Fv = .text:0x802AEF30; // type:function size:0x1C -execute__31sFState_c<18dLytDepositStock_c>Fv = .text:0x802AEF50; // type:function size:0x1C -finalize__31sFState_c<18dLytDepositStock_c>Fv = .text:0x802AEF70; // type:function size:0x1C -initializeState__82sStateMgr_c<13dLytDeposit_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>Fv = .text:0x802AEF90; // type:function size:0x10 -finalizeState__82sStateMgr_c<13dLytDeposit_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>Fv = .text:0x802AEFA0; // type:function size:0x10 -refreshState__82sStateMgr_c<13dLytDeposit_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>Fv = .text:0x802AEFB0; // type:function size:0x10 -getState__82sStateMgr_c<13dLytDeposit_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>CFv = .text:0x802AEFC0; // type:function size:0x10 -getNewStateID__82sStateMgr_c<13dLytDeposit_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>CFv = .text:0x802AEFD0; // type:function size:0x10 -getOldStateID__82sStateMgr_c<13dLytDeposit_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>CFv = .text:0x802AEFE0; // type:function size:0x10 -initializeState__86sStateMgr_c<17dLytDepositMain_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>Fv = .text:0x802AEFF0; // type:function size:0x10 -finalizeState__86sStateMgr_c<17dLytDepositMain_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>Fv = .text:0x802AF000; // type:function size:0x10 -refreshState__86sStateMgr_c<17dLytDepositMain_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>Fv = .text:0x802AF010; // type:function size:0x10 -getState__86sStateMgr_c<17dLytDepositMain_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>CFv = .text:0x802AF020; // type:function size:0x10 -getNewStateID__86sStateMgr_c<17dLytDepositMain_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>CFv = .text:0x802AF030; // type:function size:0x10 -getOldStateID__86sStateMgr_c<17dLytDepositMain_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>CFv = .text:0x802AF040; // type:function size:0x10 -initializeState__87sStateMgr_c<18dLytDepositStock_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>Fv = .text:0x802AF050; // type:function size:0x10 -finalizeState__87sStateMgr_c<18dLytDepositStock_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>Fv = .text:0x802AF060; // type:function size:0x10 -refreshState__87sStateMgr_c<18dLytDepositStock_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>Fv = .text:0x802AF070; // type:function size:0x10 -getState__87sStateMgr_c<18dLytDepositStock_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>CFv = .text:0x802AF080; // type:function size:0x10 -getNewStateID__87sStateMgr_c<18dLytDepositStock_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>CFv = .text:0x802AF090; // type:function size:0x10 -getStateID__87sStateMgr_c<18dLytDepositStock_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>CFv = .text:0x802AF0A0; // type:function size:0x10 -getOldStateID__87sStateMgr_c<18dLytDepositStock_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>CFv = .text:0x802AF0B0; // type:function size:0x10 -finalizeState__32sFStateID_c<17dLytDepositMain_c>CFR17dLytDepositMain_c = .text:0x802AF0C0; // type:function size:0x30 -executeState__32sFStateID_c<17dLytDepositMain_c>CFR17dLytDepositMain_c = .text:0x802AF0F0; // type:function size:0x30 -initializeState__32sFStateID_c<17dLytDepositMain_c>CFR17dLytDepositMain_c = .text:0x802AF120; // type:function size:0x30 -finalizeState__28sFStateID_c<13dLytDeposit_c>CFR13dLytDeposit_c = .text:0x802AF150; // type:function size:0x30 -executeState__28sFStateID_c<13dLytDeposit_c>CFR13dLytDeposit_c = .text:0x802AF180; // type:function size:0x30 -initializeState__28sFStateID_c<13dLytDeposit_c>CFR13dLytDeposit_c = .text:0x802AF1B0; // type:function size:0x30 -__sinit_\d_lyt_deposit_cpp = .text:0x802AF1E0; // type:function size:0xF04 -__dt__32sFStateID_c<17dLytDepositMain_c>Fv = .text:0x802B00F0; // type:function size:0x58 -__dt__28sFStateID_c<13dLytDeposit_c>Fv = .text:0x802B0150; // type:function size:0x58 -isSameName__28sFStateID_c<13dLytDeposit_c>CFPCc = .text:0x802B01B0; // type:function size:0x88 -isSameName__32sFStateID_c<17dLytDepositMain_c>CFPCc = .text:0x802B0240; // type:function size:0x88 +__dt__13dLytDeposit_cFv = .text:0x802AE8E0; // type:function size:0x434 scope:weak +build__29sFStateFct_c<13dLytDeposit_c>FRC12sStateIDIf_c = .text:0x802AED20; // type:function size:0x60 scope:weak +dispose__29sFStateFct_c<13dLytDeposit_c>FRP10sStateIf_c = .text:0x802AED80; // type:function size:0xC scope:weak +build__33sFStateFct_c<17dLytDepositMain_c>FRC12sStateIDIf_c = .text:0x802AED90; // type:function size:0x60 scope:weak +dispose__33sFStateFct_c<17dLytDepositMain_c>FRP10sStateIf_c = .text:0x802AEDF0; // type:function size:0xC scope:weak +build__34sFStateFct_c<18dLytDepositStock_c>FRC12sStateIDIf_c = .text:0x802AEE00; // type:function size:0x60 scope:weak +dispose__34sFStateFct_c<18dLytDepositStock_c>FRP10sStateIf_c = .text:0x802AEE60; // type:function size:0xC scope:weak +initialize__26sFState_c<13dLytDeposit_c>Fv = .text:0x802AEE70; // type:function size:0x1C scope:weak +execute__26sFState_c<13dLytDeposit_c>Fv = .text:0x802AEE90; // type:function size:0x1C scope:weak +finalize__26sFState_c<13dLytDeposit_c>Fv = .text:0x802AEEB0; // type:function size:0x1C scope:weak +initialize__30sFState_c<17dLytDepositMain_c>Fv = .text:0x802AEED0; // type:function size:0x1C scope:weak +execute__30sFState_c<17dLytDepositMain_c>Fv = .text:0x802AEEF0; // type:function size:0x1C scope:weak +finalize__30sFState_c<17dLytDepositMain_c>Fv = .text:0x802AEF10; // type:function size:0x1C scope:weak +initialize__31sFState_c<18dLytDepositStock_c>Fv = .text:0x802AEF30; // type:function size:0x1C scope:weak +execute__31sFState_c<18dLytDepositStock_c>Fv = .text:0x802AEF50; // type:function size:0x1C scope:weak +finalize__31sFState_c<18dLytDepositStock_c>Fv = .text:0x802AEF70; // type:function size:0x1C scope:weak +initializeState__82sStateMgr_c<13dLytDeposit_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>Fv = .text:0x802AEF90; // type:function size:0x10 scope:weak +finalizeState__82sStateMgr_c<13dLytDeposit_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>Fv = .text:0x802AEFA0; // type:function size:0x10 scope:weak +refreshState__82sStateMgr_c<13dLytDeposit_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>Fv = .text:0x802AEFB0; // type:function size:0x10 scope:weak +getState__82sStateMgr_c<13dLytDeposit_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>CFv = .text:0x802AEFC0; // type:function size:0x10 scope:weak +getNewStateID__82sStateMgr_c<13dLytDeposit_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>CFv = .text:0x802AEFD0; // type:function size:0x10 scope:weak +getOldStateID__82sStateMgr_c<13dLytDeposit_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>CFv = .text:0x802AEFE0; // type:function size:0x10 scope:weak +initializeState__86sStateMgr_c<17dLytDepositMain_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>Fv = .text:0x802AEFF0; // type:function size:0x10 scope:weak +finalizeState__86sStateMgr_c<17dLytDepositMain_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>Fv = .text:0x802AF000; // type:function size:0x10 scope:weak +refreshState__86sStateMgr_c<17dLytDepositMain_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>Fv = .text:0x802AF010; // type:function size:0x10 scope:weak +getState__86sStateMgr_c<17dLytDepositMain_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>CFv = .text:0x802AF020; // type:function size:0x10 scope:weak +getNewStateID__86sStateMgr_c<17dLytDepositMain_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>CFv = .text:0x802AF030; // type:function size:0x10 scope:weak +getOldStateID__86sStateMgr_c<17dLytDepositMain_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>CFv = .text:0x802AF040; // type:function size:0x10 scope:weak +initializeState__87sStateMgr_c<18dLytDepositStock_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>Fv = .text:0x802AF050; // type:function size:0x10 scope:weak +finalizeState__87sStateMgr_c<18dLytDepositStock_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>Fv = .text:0x802AF060; // type:function size:0x10 scope:weak +refreshState__87sStateMgr_c<18dLytDepositStock_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>Fv = .text:0x802AF070; // type:function size:0x10 scope:weak +getState__87sStateMgr_c<18dLytDepositStock_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>CFv = .text:0x802AF080; // type:function size:0x10 scope:weak +getNewStateID__87sStateMgr_c<18dLytDepositStock_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>CFv = .text:0x802AF090; // type:function size:0x10 scope:weak +getStateID__87sStateMgr_c<18dLytDepositStock_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>CFv = .text:0x802AF0A0; // type:function size:0x10 scope:weak +getOldStateID__87sStateMgr_c<18dLytDepositStock_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>CFv = .text:0x802AF0B0; // type:function size:0x10 scope:weak +finalizeState__32sFStateID_c<17dLytDepositMain_c>CFR17dLytDepositMain_c = .text:0x802AF0C0; // type:function size:0x30 scope:weak +executeState__32sFStateID_c<17dLytDepositMain_c>CFR17dLytDepositMain_c = .text:0x802AF0F0; // type:function size:0x30 scope:weak +initializeState__32sFStateID_c<17dLytDepositMain_c>CFR17dLytDepositMain_c = .text:0x802AF120; // type:function size:0x30 scope:weak +finalizeState__28sFStateID_c<13dLytDeposit_c>CFR13dLytDeposit_c = .text:0x802AF150; // type:function size:0x30 scope:weak +executeState__28sFStateID_c<13dLytDeposit_c>CFR13dLytDeposit_c = .text:0x802AF180; // type:function size:0x30 scope:weak +initializeState__28sFStateID_c<13dLytDeposit_c>CFR13dLytDeposit_c = .text:0x802AF1B0; // type:function size:0x30 scope:weak +__sinit_\d_lyt_deposit_cpp = .text:0x802AF1E0; // type:function size:0xF04 scope:local +__dt__32sFStateID_c<17dLytDepositMain_c>Fv = .text:0x802B00F0; // type:function size:0x58 scope:weak +__dt__28sFStateID_c<13dLytDeposit_c>Fv = .text:0x802B0150; // type:function size:0x58 scope:weak +isSameName__28sFStateID_c<13dLytDeposit_c>CFPCc = .text:0x802B01B0; // type:function size:0x88 scope:weak +isSameName__32sFStateID_c<17dLytDepositMain_c>CFPCc = .text:0x802B0240; // type:function size:0x88 scope:weak fn_802B02D0 = .text:0x802B02D0; // type:function size:0x4 fn_802B02E0 = .text:0x802B02E0; // type:function size:0xC fn_802B02F0 = .text:0x802B02F0; // type:function size:0x4 @@ -28679,8 +28679,8 @@ dLytShop__UpgradeEntryArray1 = .rodata:0x804EF358; // type:object size:0x418 dat lbl_804EF770 = .rodata:0x804EF770; // type:object size:0x10 data:4byte lbl_804EF780 = .rodata:0x804EF780; // type:object size:0x68 lbl_804EF7E8 = .rodata:0x804EF7E8; // type:object size:0xC8 -lbl_804EF8B0 = .rodata:0x804EF8B0; // type:object size:0xC0 data:byte -lbl_804EF970 = .rodata:0x804EF970; // type:object size:0x120 data:4byte +sItemData = .rodata:0x804EF8B0; // type:object size:0xBC scope:local data:byte +brlanMap = .rodata:0x804EF970; // type:object size:0x120 scope:local data:4byte lbl_804EFA90 = .rodata:0x804EFA90; // type:object size:0x10 data:4byte lbl_804EFAA0 = .rodata:0x804EFAA0; // type:object size:0x18 data:4byte lbl_804EFAB8 = .rodata:0x804EFAB8; // type:object size:0x18 data:4byte @@ -37376,104 +37376,200 @@ lbl_8053C868 = .data:0x8053C868; // type:object size:0x18 lbl_8053C880 = .data:0x8053C880; // type:object size:0x6E0 lbl_8053CF60 = .data:0x8053CF60; // type:object size:0x34 lbl_8053CF94 = .data:0x8053CF94; // type:object size:0x34 -lbl_8053CFC8 = .data:0x8053CFC8; // type:object size:0x17 data:string -lbl_8053CFE0 = .data:0x8053CFE0; // type:object size:0xB data:string -lbl_8053CFEC = .data:0x8053CFEC; // type:object size:0x1A data:string -lbl_8053D008 = .data:0x8053D008; // type:object size:0xB data:string -lbl_8053D014 = .data:0x8053D014; // type:object size:0x1B data:string -lbl_8053D030 = .data:0x8053D030; // type:object size:0xC data:string -lbl_8053D03C = .data:0x8053D03C; // type:object size:0x1D data:string -lbl_8053D05C = .data:0x8053D05C; // type:object size:0xE data:string -lbl_8053D070 = .data:0x8053D070; // type:object size:0x10 data:string -lbl_8053D080 = .data:0x8053D080; // type:object size:0x1A data:string -lbl_8053D0A0 = .data:0x8053D0A0; // type:object size:0x10 data:string -lbl_8053D0B0 = .data:0x8053D0B0; // type:object size:0x10 data:string -lbl_8053D0C0 = .data:0x8053D0C0; // type:object size:0x10 data:string -lbl_8053D0D0 = .data:0x8053D0D0; // type:object size:0x10 data:string -lbl_8053D0E0 = .data:0x8053D0E0; // type:object size:0x10 data:string -lbl_8053D0F0 = .data:0x8053D0F0; // type:object size:0x10 data:string -lbl_8053D100 = .data:0x8053D100; // type:object size:0x10 data:string -lbl_8053D110 = .data:0x8053D110; // type:object size:0x10 data:string -lbl_8053D120 = .data:0x8053D120; // type:object size:0x1C data:string -lbl_8053D13C = .data:0x8053D13C; // type:object size:0xC data:string -lbl_8053D148 = .data:0x8053D148; // type:object size:0x1C data:string -lbl_8053D164 = .data:0x8053D164; // type:object size:0x1E data:string -lbl_8053D184 = .data:0x8053D184; // type:object size:0x9 data:string -lbl_8053D190 = .data:0x8053D190; // type:object size:0x9 data:string -lbl_8053D19C = .data:0x8053D19C; // type:object size:0x9 data:string -lbl_8053D1A8 = .data:0x8053D1A8; // type:object size:0x18 data:string -lbl_8053D1C0 = .data:0x8053D1C0; // type:object size:0x1D data:string -lbl_8053D1E0 = .data:0x8053D1E0; // type:object size:0x1C data:string -lbl_8053D1FC = .data:0x8053D1FC; // type:object size:0xD data:string -lbl_8053D20C = .data:0x8053D20C; // type:object size:0x1A data:string -lbl_8053D228 = .data:0x8053D228; // type:object size:0xB data:string -lbl_8053D234 = .data:0x8053D234; // type:object size:0xB data:string -lbl_8053D240 = .data:0x8053D240; // type:object size:0x1E data:string -lbl_8053D260 = .data:0x8053D260; // type:object size:0xF data:string -lbl_8053D270 = .data:0x8053D270; // type:object size:0x1C data:string -lbl_8053D28C = .data:0x8053D28C; // type:object size:0xD data:string -lbl_8053D29C = .data:0x8053D29C; // type:object size:0x19 data:string -lbl_8053D2B8 = .data:0x8053D2B8; // type:object size:0xA data:string -lbl_8053D2C4 = .data:0x8053D2C4; // type:object size:0x19 data:string -lbl_8053D2E0 = .data:0x8053D2E0; // type:object size:0xB data:string -lbl_8053D2EC = .data:0x8053D2EC; // type:object size:0xB data:string -lbl_8053D2F8 = .data:0x8053D2F8; // type:object size:0xB data:string -lbl_8053D304 = .data:0x8053D304; // type:object size:0xB data:string -lbl_8053D310 = .data:0x8053D310; // type:object size:0xB data:string -lbl_8053D31C = .data:0x8053D31C; // type:object size:0xB data:string -lbl_8053D328 = .data:0x8053D328; // type:object size:0xB data:string -lbl_8053D334 = .data:0x8053D334; // type:object size:0xB data:string -lbl_8053D340 = .data:0x8053D340; // type:object size:0x19 data:string -lbl_8053D35C = .data:0x8053D35C; // type:object size:0xA data:string -lbl_8053D368 = .data:0x8053D368; // type:object size:0xB data:string -lbl_8053D374 = .data:0x8053D374; // type:object size:0xB data:string -lbl_8053D380 = .data:0x8053D380; // type:object size:0xB data:string -lbl_8053D38C = .data:0x8053D38C; // type:object size:0xB data:string -lbl_8053D398 = .data:0x8053D398; // type:object size:0xB data:string -lbl_8053D3A4 = .data:0x8053D3A4; // type:object size:0xB data:string -lbl_8053D3B0 = .data:0x8053D3B0; // type:object size:0xB data:string -lbl_8053D3BC = .data:0x8053D3BC; // type:object size:0x2C -lbl_8053D3E8 = .data:0x8053D3E8; // type:object size:0xA data:string -lbl_8053D3F4 = .data:0x8053D3F4; // type:object size:0xA data:string -lbl_8053D400 = .data:0x8053D400; // type:object size:0xA data:string -lbl_8053D40C = .data:0x8053D40C; // type:object size:0xA data:string -lbl_8053D418 = .data:0x8053D418; // type:object size:0xA data:string -lbl_8053D424 = .data:0x8053D424; // type:object size:0xA data:string -lbl_8053D430 = .data:0x8053D430; // type:object size:0xA data:string -lbl_8053D43C = .data:0x8053D43C; // type:object size:0xA data:string -lbl_8053D448 = .data:0x8053D448; // type:object size:0xA data:string -lbl_8053D454 = .data:0x8053D454; // type:object size:0xA data:string -lbl_8053D460 = .data:0x8053D460; // type:object size:0xA data:string -lbl_8053D46C = .data:0x8053D46C; // type:object size:0x3C -lbl_8053D4A8 = .data:0x8053D4A8; // type:object size:0x9 data:string -lbl_8053D4B4 = .data:0x8053D4B4; // type:object size:0x9 data:string -lbl_8053D4C0 = .data:0x8053D4C0; // type:object size:0x78 -lbl_8053D538 = .data:0x8053D538; // type:object size:0x9 data:string -lbl_8053D544 = .data:0x8053D544; // type:object size:0x9 data:string -lbl_8053D550 = .data:0x8053D550; // type:object size:0xF data:string -jumptable_8053D560 = .data:0x8053D560; // type:object size:0x24 scope:local -lbl_8053D584 = .data:0x8053D584; // type:object size:0x44 -lbl_8053D5C8 = .data:0x8053D5C8; // type:object size:0xD data:string -lbl_8053D5D8 = .data:0x8053D5D8; // type:object size:0xE data:string -lbl_8053D5E8 = .data:0x8053D5E8; // type:object size:0x24 +@24934 = .data:0x8053CFC8; // type:object size:0x17 scope:local data:string +...data.0 = .data:0x8053CFC8; // type:label scope:local +@24935 = .data:0x8053CFE0; // type:object size:0xB scope:local data:string +@24936 = .data:0x8053CFEC; // type:object size:0x1A scope:local data:string +@24937 = .data:0x8053D008; // type:object size:0xB scope:local data:string +@24938 = .data:0x8053D014; // type:object size:0x1B scope:local data:string +@24939 = .data:0x8053D030; // type:object size:0xC scope:local data:string +@24940 = .data:0x8053D03C; // type:object size:0x1D scope:local data:string +@24941 = .data:0x8053D05C; // type:object size:0xE scope:local data:string +@24942 = .data:0x8053D070; // type:object size:0x10 scope:local data:string +@24943 = .data:0x8053D080; // type:object size:0x1A scope:local data:string +@24944 = .data:0x8053D0A0; // type:object size:0x10 scope:local data:string +@24945 = .data:0x8053D0B0; // type:object size:0x10 scope:local data:string +@24946 = .data:0x8053D0C0; // type:object size:0x10 scope:local data:string +@24947 = .data:0x8053D0D0; // type:object size:0x10 scope:local data:string +@24948 = .data:0x8053D0E0; // type:object size:0x10 scope:local data:string +@24949 = .data:0x8053D0F0; // type:object size:0x10 scope:local data:string +@24950 = .data:0x8053D100; // type:object size:0x10 scope:local data:string +@24951 = .data:0x8053D110; // type:object size:0x10 scope:local data:string +@24952 = .data:0x8053D120; // type:object size:0x1C scope:local data:string +@24953 = .data:0x8053D13C; // type:object size:0xC scope:local data:string +@24954 = .data:0x8053D148; // type:object size:0x1C scope:local data:string +@24955 = .data:0x8053D164; // type:object size:0x1E scope:local data:string +@24956 = .data:0x8053D184; // type:object size:0x9 scope:local data:string +@24957 = .data:0x8053D190; // type:object size:0x9 scope:local data:string +@24958 = .data:0x8053D19C; // type:object size:0x9 scope:local data:string +@24959 = .data:0x8053D1A8; // type:object size:0x18 scope:local data:string +@24960 = .data:0x8053D1C0; // type:object size:0x1D scope:local data:string +@24961 = .data:0x8053D1E0; // type:object size:0x1C scope:local data:string +@24962 = .data:0x8053D1FC; // type:object size:0xD scope:local data:string +@24963 = .data:0x8053D20C; // type:object size:0x1A scope:local data:string +@24964 = .data:0x8053D228; // type:object size:0xB scope:local data:string +@24965 = .data:0x8053D234; // type:object size:0xB scope:local data:string +@24966 = .data:0x8053D240; // type:object size:0x1E scope:local data:string +@24967 = .data:0x8053D260; // type:object size:0xF scope:local data:string +@24968 = .data:0x8053D270; // type:object size:0x1C scope:local data:string +@24969 = .data:0x8053D28C; // type:object size:0xD scope:local data:string +@24970 = .data:0x8053D29C; // type:object size:0x19 scope:local data:string +@24971 = .data:0x8053D2B8; // type:object size:0xA scope:local data:string +@24972 = .data:0x8053D2C4; // type:object size:0x19 scope:local data:string +@24973 = .data:0x8053D2E0; // type:object size:0xB scope:local data:string +@24974 = .data:0x8053D2EC; // type:object size:0xB scope:local data:string +@24975 = .data:0x8053D2F8; // type:object size:0xB scope:local data:string +@24976 = .data:0x8053D304; // type:object size:0xB scope:local data:string +@24977 = .data:0x8053D310; // type:object size:0xB scope:local data:string +@24978 = .data:0x8053D31C; // type:object size:0xB scope:local data:string +@24979 = .data:0x8053D328; // type:object size:0xB scope:local data:string +@24980 = .data:0x8053D334; // type:object size:0xB scope:local data:string +@24981 = .data:0x8053D340; // type:object size:0x19 scope:local data:string +@24982 = .data:0x8053D35C; // type:object size:0xA scope:local data:string +@24983 = .data:0x8053D368; // type:object size:0xB scope:local data:string +@24984 = .data:0x8053D374; // type:object size:0xB scope:local data:string +@24985 = .data:0x8053D380; // type:object size:0xB scope:local data:string +@24986 = .data:0x8053D38C; // type:object size:0xB scope:local data:string +@24987 = .data:0x8053D398; // type:object size:0xB scope:local data:string +@24988 = .data:0x8053D3A4; // type:object size:0xB scope:local data:string +@24989 = .data:0x8053D3B0; // type:object size:0xB scope:local data:string +@24990 = .data:0x8053D3BC; // type:object size:0xB scope:local data:string +sRingBoundingNames = .data:0x8053D3C8; // type:object size:0x20 scope:local +@24991 = .data:0x8053D3E8; // type:object size:0xA scope:local data:string +@24992 = .data:0x8053D3F4; // type:object size:0xA scope:local data:string +@24993 = .data:0x8053D400; // type:object size:0xA scope:local data:string +@24994 = .data:0x8053D40C; // type:object size:0xA scope:local data:string +@24995 = .data:0x8053D418; // type:object size:0xA scope:local data:string +@24996 = .data:0x8053D424; // type:object size:0xA scope:local data:string +@24997 = .data:0x8053D430; // type:object size:0xA scope:local data:string +@24998 = .data:0x8053D43C; // type:object size:0xA scope:local data:string +@24999 = .data:0x8053D448; // type:object size:0xA scope:local data:string +@25000 = .data:0x8053D454; // type:object size:0xA scope:local data:string +@25001 = .data:0x8053D460; // type:object size:0xA scope:local data:string +@25002 = .data:0x8053D46C; // type:object size:0xA scope:local data:string +sItemBoundingNames = .data:0x8053D478; // type:object size:0x30 scope:local +@25003 = .data:0x8053D4A8; // type:object size:0x9 scope:local data:string +@25004 = .data:0x8053D4B4; // type:object size:0x9 scope:local data:string +@30689 = .data:0x8053D4C0; // type:object size:0x14 scope:local data:string +@30690 = .data:0x8053D4D4; // type:object size:0x9 scope:local data:string +@30691 = .data:0x8053D4E0; // type:object size:0xD scope:local data:string +@30692 = .data:0x8053D4F0; // type:object size:0xD scope:local data:string +@30693 = .data:0x8053D500; // type:object size:0xA scope:local data:string +@30694 = .data:0x8053D50C; // type:object size:0xA scope:local data:string +@30695 = .data:0x8053D518; // type:object size:0xB scope:local data:string +@30696 = .data:0x8053D524; // type:object size:0x11 scope:local data:string +@25293 = .data:0x8053D538; // type:object size:0x9 scope:local data:string +@31055 = .data:0x8053D544; // type:object size:0x9 scope:local data:string +@31161 = .data:0x8053D550; // type:object size:0xF scope:local data:string +@31336 = .data:0x8053D560; // type:object size:0x24 scope:local +@31344 = .data:0x8053D584; // type:object size:0xD scope:local data:string +@31345 = .data:0x8053D594; // type:object size:0xE scope:local data:string +@31346 = .data:0x8053D5A4; // type:object size:0xF scope:local data:string +@31347 = .data:0x8053D5B4; // type:object size:0x12 scope:local data:string +@31435 = .data:0x8053D5C8; // type:object size:0xD scope:local data:string +@31436 = .data:0x8053D5D8; // type:object size:0xE scope:local data:string +@31783 = .data:0x8053D5E8; // type:object size:0xC scope:local data:wstring +@31784 = .data:0x8053D5F4; // type:object size:0xA scope:local data:string +@31785 = .data:0x8053D600; // type:object size:0xB scope:local data:string g_profile_LYT_DEPOSIT = .data:0x8053D60C; // type:object size:0xC -lbl_8053D618 = .data:0x8053D618; // type:object size:0x1B data:string +@32022 = .data:0x8053D618; // type:object size:0x1B scope:local data:string __vt__13dLytDeposit_c = .data:0x8053D638; // type:object size:0x50 -__vt__52sFStateMgr_c<13dLytDeposit_c,20sStateMethodUsr_FI_c> = .data:0x8053D688; // type:object size:0x30 -__vt__82sStateMgr_c<13dLytDeposit_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c> = .data:0x8053D6B8; // type:object size:0x30 -__vt__29sFStateFct_c<13dLytDeposit_c> = .data:0x8053D6E8; // type:object size:0x18 -__vt__26sFState_c<13dLytDeposit_c> = .data:0x8053D700; // type:object size:0x18 -__vt__17dLytDepositMain_c = .data:0x8053D718; // type:object size:0x10 -__vt__56sFStateMgr_c<17dLytDepositMain_c,20sStateMethodUsr_FI_c> = .data:0x8053D728; // type:object size:0x30 -__vt__86sStateMgr_c<17dLytDepositMain_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c> = .data:0x8053D758; // type:object size:0x30 -__vt__33sFStateFct_c<17dLytDepositMain_c> = .data:0x8053D788; // type:object size:0x18 -__vt__30sFState_c<17dLytDepositMain_c> = .data:0x8053D7A0; // type:object size:0x18 -__vt__57sFStateMgr_c<18dLytDepositStock_c,20sStateMethodUsr_FI_c> = .data:0x8053D7B8; // type:object size:0x30 -__vt__87sStateMgr_c<18dLytDepositStock_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c> = .data:0x8053D7E8; // type:object size:0x30 -__vt__34sFStateFct_c<18dLytDepositStock_c> = .data:0x8053D818; // type:object size:0x18 -__vt__31sFState_c<18dLytDepositStock_c> = .data:0x8053D830; // type:object size:0x72C -__vt__32sFStateID_c<17dLytDepositMain_c> = .data:0x8053DF5C; // type:object size:0x34 -__vt__28sFStateID_c<13dLytDeposit_c> = .data:0x8053DF90; // type:object size:0x38 +__vt__52sFStateMgr_c<13dLytDeposit_c,20sStateMethodUsr_FI_c> = .data:0x8053D688; // type:object size:0x30 scope:weak +__vt__82sStateMgr_c<13dLytDeposit_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c> = .data:0x8053D6B8; // type:object size:0x30 scope:weak +__vt__29sFStateFct_c<13dLytDeposit_c> = .data:0x8053D6E8; // type:object size:0x14 scope:weak +__vt__26sFState_c<13dLytDeposit_c> = .data:0x8053D700; // type:object size:0x18 scope:weak +__vt__17dLytDepositMain_c = .data:0x8053D718; // type:object size:0xC scope:weak +__vt__56sFStateMgr_c<17dLytDepositMain_c,20sStateMethodUsr_FI_c> = .data:0x8053D728; // type:object size:0x30 scope:weak +__vt__86sStateMgr_c<17dLytDepositMain_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c> = .data:0x8053D758; // type:object size:0x30 scope:weak +__vt__33sFStateFct_c<17dLytDepositMain_c> = .data:0x8053D788; // type:object size:0x14 scope:weak +__vt__30sFState_c<17dLytDepositMain_c> = .data:0x8053D7A0; // type:object size:0x18 scope:weak +__vt__57sFStateMgr_c<18dLytDepositStock_c,20sStateMethodUsr_FI_c> = .data:0x8053D7B8; // type:object size:0x30 scope:weak +__vt__87sStateMgr_c<18dLytDepositStock_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c> = .data:0x8053D7E8; // type:object size:0x30 scope:weak +__vt__34sFStateFct_c<18dLytDepositStock_c> = .data:0x8053D818; // type:object size:0x14 scope:weak +__vt__31sFState_c<18dLytDepositStock_c> = .data:0x8053D830; // type:object size:0x18 scope:weak +lbl_8053D848 = .data:0x8053D848; // type:object size:0x164 +@32336 = .data:0x8053D9AC; // type:object size:0xC scope:local +@32337 = .data:0x8053D9B8; // type:object size:0xC scope:local +@32338 = .data:0x8053D9C4; // type:object size:0xC scope:local +@32339 = .data:0x8053D9D0; // type:object size:0xC scope:local +@32340 = .data:0x8053D9DC; // type:object size:0xC scope:local +@32341 = .data:0x8053D9E8; // type:object size:0xC scope:local +@32342 = .data:0x8053D9F4; // type:object size:0xC scope:local +@32343 = .data:0x8053DA00; // type:object size:0xC scope:local +@32344 = .data:0x8053DA0C; // type:object size:0xC scope:local +@32345 = .data:0x8053DA18; // type:object size:0xC scope:local +@32346 = .data:0x8053DA24; // type:object size:0xC scope:local +@32347 = .data:0x8053DA30; // type:object size:0xC scope:local +@32348 = .data:0x8053DA3C; // type:object size:0xC scope:local +@32349 = .data:0x8053DA48; // type:object size:0xC scope:local +@32350 = .data:0x8053DA54; // type:object size:0xC scope:local +@32351 = .data:0x8053DA60; // type:object size:0xC scope:local +@32352 = .data:0x8053DA6C; // type:object size:0xC scope:local +@32353 = .data:0x8053DA78; // type:object size:0xC scope:local +@32354 = .data:0x8053DA84; // type:object size:0xC scope:local +@32355 = .data:0x8053DA90; // type:object size:0xC scope:local +@32356 = .data:0x8053DA9C; // type:object size:0xC scope:local +@32357 = .data:0x8053DAA8; // type:object size:0xC scope:local +@32358 = .data:0x8053DAB4; // type:object size:0xC scope:local +@32359 = .data:0x8053DAC0; // type:object size:0xC scope:local +@32360 = .data:0x8053DACC; // type:object size:0xC scope:local +@32361 = .data:0x8053DAD8; // type:object size:0xC scope:local +@32362 = .data:0x8053DAE4; // type:object size:0xC scope:local +@32363 = .data:0x8053DAF0; // type:object size:0xC scope:local +@32364 = .data:0x8053DAFC; // type:object size:0xC scope:local +@32365 = .data:0x8053DB08; // type:object size:0xC scope:local +@32366 = .data:0x8053DB14; // type:object size:0xC scope:local +@32367 = .data:0x8053DB20; // type:object size:0xC scope:local +@32368 = .data:0x8053DB2C; // type:object size:0xC scope:local +@32369 = .data:0x8053DB38; // type:object size:0xC scope:local +@32370 = .data:0x8053DB44; // type:object size:0xC scope:local +@32371 = .data:0x8053DB50; // type:object size:0xC scope:local +@32372 = .data:0x8053DB5C; // type:object size:0xC scope:local +@32373 = .data:0x8053DB68; // type:object size:0xC scope:local +@32374 = .data:0x8053DB74; // type:object size:0xC scope:local +@32375 = .data:0x8053DB80; // type:object size:0xC scope:local +@32376 = .data:0x8053DB8C; // type:object size:0xC scope:local +@32377 = .data:0x8053DB98; // type:object size:0xC scope:local +@32378 = .data:0x8053DBA4; // type:object size:0xC scope:local +@32379 = .data:0x8053DBB0; // type:object size:0xC scope:local +@32380 = .data:0x8053DBBC; // type:object size:0xC scope:local +@32381 = .data:0x8053DBC8; // type:object size:0xC scope:local +@32382 = .data:0x8053DBD4; // type:object size:0xC scope:local +@32383 = .data:0x8053DBE0; // type:object size:0xC scope:local +@32384 = .data:0x8053DBEC; // type:object size:0xC scope:local +@32385 = .data:0x8053DBF8; // type:object size:0xC scope:local +@32386 = .data:0x8053DC04; // type:object size:0xC scope:local +@32387 = .data:0x8053DC10; // type:object size:0xC scope:local +@32388 = .data:0x8053DC1C; // type:object size:0xC scope:local +@32389 = .data:0x8053DC28; // type:object size:0xC scope:local +@32390 = .data:0x8053DC34; // type:object size:0xC scope:local +@32391 = .data:0x8053DC40; // type:object size:0xC scope:local +@32392 = .data:0x8053DC4C; // type:object size:0xC scope:local +@32393 = .data:0x8053DC58; // type:object size:0xC scope:local +@32394 = .data:0x8053DC64; // type:object size:0xC scope:local +@32395 = .data:0x8053DC70; // type:object size:0xC scope:local +@32397 = .data:0x8053DC7C; // type:object size:0x24 scope:local data:string +@32398 = .data:0x8053DCA0; // type:object size:0x22 scope:local data:string +@32399 = .data:0x8053DCC4; // type:object size:0x25 scope:local data:string +@32400 = .data:0x8053DCEC; // type:object size:0x26 scope:local data:string +@32401 = .data:0x8053DD14; // type:object size:0x2B scope:local data:string +@32402 = .data:0x8053DD40; // type:object size:0x2D scope:local data:string +@32403 = .data:0x8053DD70; // type:object size:0x26 scope:local data:string +@32404 = .data:0x8053DD98; // type:object size:0x27 scope:local data:string +@32405 = .data:0x8053DDC0; // type:object size:0x2E scope:local data:string +@32406 = .data:0x8053DDF0; // type:object size:0x23 scope:local data:string +@32407 = .data:0x8053DE14; // type:object size:0x1C scope:local data:string +@32408 = .data:0x8053DE30; // type:object size:0x1A scope:local data:string +@32409 = .data:0x8053DE4C; // type:object size:0x1D scope:local data:string +@32410 = .data:0x8053DE6C; // type:object size:0x1E scope:local data:string +@32411 = .data:0x8053DE8C; // type:object size:0x23 scope:local data:string +@32412 = .data:0x8053DEB0; // type:object size:0x25 scope:local data:string +@32413 = .data:0x8053DED8; // type:object size:0x1E scope:local data:string +@32414 = .data:0x8053DEF8; // type:object size:0x1F scope:local data:string +@32415 = .data:0x8053DF18; // type:object size:0x26 scope:local data:string +@32416 = .data:0x8053DF40; // type:object size:0x1B scope:local data:string +__vt__32sFStateID_c<17dLytDepositMain_c> = .data:0x8053DF5C; // type:object size:0x34 scope:weak +__vt__28sFStateID_c<13dLytDeposit_c> = .data:0x8053DF90; // type:object size:0x34 scope:weak lbl_8053DFC8 = .data:0x8053DFC8; // type:object size:0x16 data:string lbl_8053DFE0 = .data:0x8053DFE0; // type:object size:0xB data:string lbl_8053DFEC = .data:0x8053DFEC; // type:object size:0x17 data:string @@ -38232,7 +38328,7 @@ __vt__22cCcD_GAtTgCoCommonBase = .data:0x80547644; // type:object size:0xC __vt__15cCcD_DivideArea = .data:0x80547650; // type:object size:0xC __vt__15cCcD_DivideInfo = .data:0x8054765C; // type:object size:0xC __vt__8cM2dGCir = .data:0x80547668; // type:object size:0xC -__vt__8cM3dGUnk = .data:0x80547678; // type:object size:0xC +__vt__8cM3dGUnk = .data:0x80547678; // type:object size:0xC scope:weak __vt__10cPartition = .data:0x80547688; // type:object size:0xC lbl_80547698 = .data:0x80547698; // type:object size:0x7C data:4byte LiquidTextures = .data:0x80547714; // type:object size:0x14 data:4byte @@ -41175,11 +41271,11 @@ lbl_80573BF4 = .sdata:0x80573BF4; // type:object size:0x4 lbl_80573BF8 = .sdata:0x80573BF8; // type:object size:0x6 data:wstring lbl_80573C00 = .sdata:0x80573C00; // type:object size:0x8 data:string lbl_80573C08 = .sdata:0x80573C08; // type:object size:0x5 data:string -lbl_80573C10 = .sdata:0x80573C10; // type:object size:0x8 data:4byte -lbl_80573C18 = .sdata:0x80573C18; // type:object size:0x4 data:4byte -lbl_80573C1C = .sdata:0x80573C1C; // type:object size:0x4 -lbl_80573C20 = .sdata:0x80573C20; // type:object size:0x5 data:string -lbl_80573C28 = .sdata:0x80573C28; // type:object size:0x6 data:wstring +sWindowNames = .sdata:0x80573C10; // type:object size:0x8 scope:local data:4byte +sGroupName = .sdata:0x80573C18; // type:object size:0x4 scope:local data:4byte +@31056 = .sdata:0x80573C1C; // type:object size:0x1 scope:local +@31057 = .sdata:0x80573C20; // type:object size:0x5 scope:local data:string +@31437 = .sdata:0x80573C28; // type:object size:0x6 scope:local data:wstring lbl_80573C30 = .sdata:0x80573C30; // type:object size:0x8 lbl_80573C38 = .sdata:0x80573C38; // type:object size:0x3 data:string lbl_80573C3C = .sdata:0x80573C3C; // type:object size:0x5 data:string @@ -42495,9 +42591,9 @@ BOSS_CAPTION_PTR = .sbss:0x805759A0; // type:object size:0x8 data:4byte sInstance__17dLytDemoDowsing_c = .sbss:0x805759A8; // type:object size:0x8 data:4byte lbl_805759B0 = .sbss:0x805759B0; // type:object size:0x2 data:2byte sInstance__10dLytShop_c = .sbss:0x805759B4; // type:object size:0x4 data:4byte -lbl_805759B8 = .sbss:0x805759B8; // type:object size:0x8 -lbl_805759C0 = .sbss:0x805759C0; // type:object size:0x8 -sInstance__13dLytDeposit_c = .sbss:0x805759C8; // type:object size:0x8 data:4byte +@LOCAL@loadItemText__17dLytDepositMain_cFll@empty = .sbss:0x805759B8; // type:object size:0x2 scope:local +@LOCAL@loadPageText__17dLytDepositMain_cFv@buf = .sbss:0x805759C0; // type:object size:0x8 scope:local +sInstance__13dLytDeposit_c = .sbss:0x805759C8; // type:object size:0x4 data:4byte lbl_805759D0 = .sbss:0x805759D0; // type:object size:0x8 data:4byte LYT_END_ROLL_PTR = .sbss:0x805759D8; // type:object size:0x8 data:4byte GLOBAL_FI_POINTER = .sbss:0x805759E0; // type:object size:0x4 data:4byte @@ -48468,14 +48564,13 @@ lbl_8057C7AC = .sdata2:0x8057C7AC; // type:object size:0x4 align:4 data:float lbl_8057C7B0 = .sdata2:0x8057C7B0; // type:object size:0x4 align:4 data:float lbl_8057C7B4 = .sdata2:0x8057C7B4; // type:object size:0x4 align:4 data:float lbl_8057C7B8 = .sdata2:0x8057C7B8; // type:object size:0x8 align:8 data:double -lbl_8057C7C0 = .sdata2:0x8057C7C0; // type:object size:0x4 align:4 data:float -lbl_8057C7C4 = .sdata2:0x8057C7C4; // type:object size:0x4 align:4 data:float -lbl_8057C7C8 = .sdata2:0x8057C7C8; // type:object size:0x4 align:4 data:float -lbl_8057C7CC = .sdata2:0x8057C7CC; // type:object size:0x4 align:4 data:float -lbl_8057C7D0 = .sdata2:0x8057C7D0; // type:object size:0x1 data:byte -lbl_8057C7D1 = .sdata2:0x8057C7D1; // type:object size:0x3 -lbl_8057C7D4 = .sdata2:0x8057C7D4; // type:object size:0x4 align:4 data:float -lbl_8057C7D8 = .sdata2:0x8057C7D8; // type:object size:0x8 align:8 data:double +@30148 = .sdata2:0x8057C7C0; // type:object size:0x4 scope:local align:4 data:float +@30281 = .sdata2:0x8057C7C4; // type:object size:0x4 scope:local align:4 data:float +@30282 = .sdata2:0x8057C7C8; // type:object size:0x4 scope:local align:4 data:float +@30697 = .sdata2:0x8057C7CC; // type:object size:0x4 scope:local align:4 data:float +@LOCAL@buildSubpanes__17dLytDepositMain_cFv@sInitialPageIndices = .sdata2:0x8057C7D0; // type:object size:0x3 scope:local data:byte +@31162 = .sdata2:0x8057C7D4; // type:object size:0x4 scope:local align:4 data:float +@31777 = .sdata2:0x8057C7D8; // type:object size:0x8 scope:local align:8 data:double lbl_8057C7E0 = .sdata2:0x8057C7E0; // type:object size:0x4 align:4 data:float lbl_8057C7E4 = .sdata2:0x8057C7E4; // type:object size:0x4 align:4 data:float lbl_8057C7E8 = .sdata2:0x8057C7E8; // type:object size:0x4 align:4 data:float @@ -52415,22 +52510,48 @@ dLytShop__STATE_MATERIAL_CHECK = .bss:0x805B6B28; // type:object size:0x40 data: dLytShop__STATE_OUT = .bss:0x805B6B68; // type:object size:0x40 data:4byte dLytShop__STATE_IN_OUT = .bss:0x805B6BA8; // type:object size:0x40 data:4byte dLytShop__STATE_END = .bss:0x805B6BE8; // type:object size:0x30 data:4byte -lbl_805B6C18 = .bss:0x805B6C18; // type:object size:0x10 -LytDepositMain__STATE_MODE_NONE = .bss:0x805B6C28; // type:object size:0x40 data:4byte -LytDepositMain__STATE_MODE_IN = .bss:0x805B6C68; // type:object size:0x40 data:4byte -LytDepositMain__STATE_MODE_CHECK = .bss:0x805B6CA8; // type:object size:0x40 data:4byte -LytDepositMain__STATE_MODE_CHANGE = .bss:0x805B6CE8; // type:object size:0x40 data:4byte -LytDepositMain__STATE_MODE_ARRANGEMENT = .bss:0x805B6D28; // type:object size:0x40 data:4byte -LytDepositMain__STATE_MODE_REVERSE_CHANGE = .bss:0x805B6D68; // type:object size:0x40 data:4byte -LytDepositMain__STATE_MODE_SCROLL = .bss:0x805B6DA8; // type:object size:0x40 data:4byte -LytDepositMain__STATE_MODE_RECYCLE = .bss:0x805B6DE8; // type:object size:0x40 data:4byte -LytDepositMain__STATE_MODE_ARRANGEMENT_OUT = .bss:0x805B6E28; // type:object size:0x40 data:4byte -LytDepositMain__STATE_MODE_OUT = .bss:0x805B6E68; // type:object size:0x30 data:4byte -lbl_805B6E98 = .bss:0x805B6E98; // type:object size:0x18 -LytDeposit__STATE_NONE = .bss:0x805B6EB0; // type:object size:0x40 data:4byte -LytDeposit__STATE_IN = .bss:0x805B6EF0; // type:object size:0x40 data:4byte -LytDeposit__STATE_CHECK = .bss:0x805B6F30; // type:object size:0x40 data:4byte -LytDeposit__STATE_CHANGE = .bss:0x805B6F70; // type:object size:0x1B0 data:4byte +@24626 = .bss:0x805B6C18; // type:object size:0xC scope:local +...bss.0 = .bss:0x805B6C18; // type:label scope:local +StateID_ModeNone__17dLytDepositMain_c = .bss:0x805B6C28; // type:object size:0x30 data:4byte +@24630 = .bss:0x805B6C58; // type:object size:0xC scope:local +StateID_ModeIn__17dLytDepositMain_c = .bss:0x805B6C68; // type:object size:0x30 data:4byte +@24634 = .bss:0x805B6C98; // type:object size:0xC scope:local +StateID_ModeCheck__17dLytDepositMain_c = .bss:0x805B6CA8; // type:object size:0x30 data:4byte +@24638 = .bss:0x805B6CD8; // type:object size:0xC scope:local +StateID_ModeChange__17dLytDepositMain_c = .bss:0x805B6CE8; // type:object size:0x30 data:4byte +@24642 = .bss:0x805B6D18; // type:object size:0xC scope:local +StateID_ModeArrangement__17dLytDepositMain_c = .bss:0x805B6D28; // type:object size:0x30 data:4byte +@24646 = .bss:0x805B6D58; // type:object size:0xC scope:local +StateID_ModeReverseChange__17dLytDepositMain_c = .bss:0x805B6D68; // type:object size:0x30 data:4byte +@24650 = .bss:0x805B6D98; // type:object size:0xC scope:local +StateID_ModeScroll__17dLytDepositMain_c = .bss:0x805B6DA8; // type:object size:0x30 data:4byte +@24654 = .bss:0x805B6DD8; // type:object size:0xC scope:local +StateID_ModeRecycle__17dLytDepositMain_c = .bss:0x805B6DE8; // type:object size:0x30 data:4byte +@24658 = .bss:0x805B6E18; // type:object size:0xC scope:local +StateID_ModeArrangementOut__17dLytDepositMain_c = .bss:0x805B6E28; // type:object size:0x30 data:4byte +@24662 = .bss:0x805B6E58; // type:object size:0xC scope:local +StateID_ModeOut__17dLytDepositMain_c = .bss:0x805B6E68; // type:object size:0x30 data:4byte +@LOCAL@checkSellOrFinish__17dLytDepositMain_cFv@buf = .bss:0x805B6E98; // type:object size:0xA scope:local +@26111 = .bss:0x805B6EA4; // type:object size:0xC scope:local +StateID_None__13dLytDeposit_c = .bss:0x805B6EB0; // type:object size:0x30 data:4byte +@26115 = .bss:0x805B6EE0; // type:object size:0xC scope:local +StateID_In__13dLytDeposit_c = .bss:0x805B6EF0; // type:object size:0x30 data:4byte +@26119 = .bss:0x805B6F20; // type:object size:0xC scope:local +StateID_Check__13dLytDeposit_c = .bss:0x805B6F30; // type:object size:0x30 data:4byte +@26123 = .bss:0x805B6F60; // type:object size:0xC scope:local +StateID_Change__13dLytDeposit_c = .bss:0x805B6F70; // type:object size:0x30 data:4byte +@26127 = .bss:0x805B6FA0; // type:object size:0xC scope:local +StateID_Arrangement__13dLytDeposit_c = .bss:0x805B6FB0; // type:object size:0x30 scope:global +@26131 = .bss:0x805B6FE0; // type:object size:0xC scope:local +StateID_ReverseChange__13dLytDeposit_c = .bss:0x805B6FF0; // type:object size:0x30 scope:global +@26135 = .bss:0x805B7020; // type:object size:0xC scope:local +StateID_Scroll__13dLytDeposit_c = .bss:0x805B7030; // type:object size:0x30 scope:global +@26139 = .bss:0x805B7060; // type:object size:0xC scope:local +StateID_Recycle__13dLytDeposit_c = .bss:0x805B7070; // type:object size:0x30 scope:global +@26143 = .bss:0x805B70A0; // type:object size:0xC scope:local +StateID_ArrangementOut__13dLytDeposit_c = .bss:0x805B70B0; // type:object size:0x30 scope:global +@26147 = .bss:0x805B70E0; // type:object size:0xC scope:local +StateID_Out__13dLytDeposit_c = .bss:0x805B70F0; // type:object size:0x30 scope:global lbl_805B7120 = .bss:0x805B7120; // type:object size:0x10 LytDemoTitleMain__STATE_MODE_NONE = .bss:0x805B7130; // type:object size:0x40 data:4byte LytDemoTitleMain__STATE_MODE_IN = .bss:0x805B7170; // type:object size:0x40 data:4byte diff --git a/configure.py b/configure.py index bb2a6003..49b5eb3c 100644 --- a/configure.py +++ b/configure.py @@ -656,7 +656,7 @@ config.libs = [ Object(NonMatching, "d/lyt/d_lyt_boss_caption.cpp"), Object(NonMatching, "d/lyt/d_lyt_demo_dowsing.cpp"), Object(NonMatching, "d/lyt/d_lyt_shop.cpp"), - Object(NonMatching, "d/lyt/d_lyt_deposit.cpp"), + Object(Matching, "d/lyt/d_lyt_deposit.cpp"), Object(NonMatching, "d/lyt/d_lyt_demo_title.cpp"), Object(NonMatching, "d/lyt/d_lyt_end_roll.cpp"), Object(NonMatching, "toBeSorted/d_a_bullet.cpp"), diff --git a/include/d/lyt/d_lyt_common_arrow.h b/include/d/lyt/d_lyt_common_arrow.h index 21a65fb7..5fd61236 100644 --- a/include/d/lyt/d_lyt_common_arrow.h +++ b/include/d/lyt/d_lyt_common_arrow.h @@ -36,12 +36,8 @@ public: bool requestIn(); bool requestOut(); - void unk() { - field_0x6B8 = mPointedAtArrow; - } - - s32 getField_0x6B8() const { - return field_0x6B8; + s32 getPointedAtArrow() const { + return mPointedAtArrow; } bool isChangingState() const { @@ -52,14 +48,18 @@ public: return mpBoundings[idx]; } - void setField_0x6B8(s32 v) { - field_0x6B8 = v; + s32 getActiveArrow() const { + return mActiveArrow; + } + + void setActiveArrow(s32 v) { + mActiveArrow = v; } void setBackwards(bool b) { mBackwards = b; } - bool fn_80168760(); + bool triggerArrowPress(); void setTranslate(const mVec2_c *); private: @@ -67,7 +67,7 @@ private: void unbindAt(s32); void tickDown(d2d::AnmGroup_c *); void checkPointAtPane(); - + /* 0x04 */ UI_STATE_MGR_DECLARE(dLytCommonArrow_c); /* 0x40 */ d2d::LytBase_c mLytBase; d2d::ResAccIf_c mResAcc; @@ -76,9 +76,9 @@ private: /* 0x6A8 */ nw4r::lyt::Bounding *mpBoundings[2]; /* 0x6B0 */ s32 mType; /* 0x6B4 */ s32 mPointedAtArrow; - /* 0x6B8 */ s32 field_0x6B8; - /* 0x6BC */ s32 field_0x6BC; - /* 0x6C0 */ s32 field_0x6C0; + /* 0x6B8 */ s32 mActiveArrow; + /* 0x6BC */ s32 mLastActiveArrow; + /* 0x6C0 */ s32 mTriggeredArrow; /* 0x6C4 */ s32 mTimer; /* 0x6C8 */ bool mInRequested; /* 0x6C9 */ bool mOutRequested; diff --git a/include/d/lyt/d_lyt_deposit.h b/include/d/lyt/d_lyt_deposit.h index 1ce62261..8596ac43 100644 --- a/include/d/lyt/d_lyt_deposit.h +++ b/include/d/lyt/d_lyt_deposit.h @@ -72,7 +72,7 @@ public: } bool getField_0x19525() const { - return field_0x19525; + return mIsSortActive; } bool getField_0x1952B() const { @@ -94,33 +94,39 @@ private: static const s32 NUM_ICONS_PER_PAGE = 12; static const s32 NUM_PAGES = 5; - void setPouchItemsVisible(bool visible); void buildSubpanes(); - void fn_802AD370(); - + void loadInitialState(); + + void checkPouchItems(); void checkPointToStock(); - void handleNavOrPoint(); void checkForItemPickupOrDrop(); void checkSellOrFinish(); - void checkPointToPouch(); - void fn_802AC3C0(); - void fn_802AD4C0(); - void loadItemText(s32 itemId, s32 where); - void fn_802AC670(); - void returnCursorAfterCancellingSell(s32 targetSlot); - void fn_802AD460(); - void loadStockItems(s32 hiddenSlot); - s32 getItemSellValueFrame(s32 value); - void selectPouchSlot(s32 slot); - void loadPouchItem(s32 slot); - void fn_8018ADA0(s32); - void loadInitialState(); - void fn_802AD400(); - void navigateOffIcon(); + void checkSort(); + void checkArrows(); s32 checkNav(); - void fn_802AC980(); - s32 calcNumDigits(s32); + + void loadItemText(s32 itemId, s32 where); + void loadStockItems(s32 hiddenSlot); + void loadPouchItem(s32 slot); + void loadPageText(); + + void setPouchItemsVisible(bool visible); + + void selectPouchSlot(s32 slot); + void navigateOffIcon(); + + void updateStockCursor(); + void showCursor(); + void hideCursor(); + void loadCursor(); + + void returnCursorAfterCancellingSell(s32 idx); + void returnCursorAfterCancellingSort(s32 idx); + void returnCursorAfterCancellingArrow(s32 idx); + + s32 getItemSellValueFrame(s32 value); + s32 calcNumDigits(s32 value); STATE_FUNC_DECLARE(dLytDepositMain_c, ModeNone); STATE_FUNC_DECLARE(dLytDepositMain_c, ModeIn); @@ -133,6 +139,8 @@ private: STATE_FUNC_DECLARE(dLytDepositMain_c, ModeArrangementOut); STATE_FUNC_DECLARE(dLytDepositMain_c, ModeOut); + STATE_MGR_DEFINE_UTIL_CHANGESTATE(dLytDepositMain_c); + /* 0x00004 */ UI_STATE_MGR_DECLARE(dLytDepositMain_c); /* 0x00040 */ d2d::LytBase_c mLyt; /* 0x000D0 */ d2d::AnmGroup_c mAnm[36]; @@ -163,7 +171,7 @@ private: /* 0x19522 */ bool mIsPointingAtToPouchBounding; /* 0x19523 */ bool mIsFinishActive; /* 0x19524 */ bool mIsSellActive; - /* 0x19525 */ bool field_0x19525; + /* 0x19525 */ bool mIsSortActive; /* 0x19526 */ bool field_0x19526; /* 0x19527 */ bool field_0x19527; /* 0x19528 */ bool field_0x19528; @@ -218,6 +226,9 @@ private: STATE_FUNC_DECLARE(dLytDeposit_c, ArrangementOut); STATE_FUNC_DECLARE(dLytDeposit_c, Out); + STATE_MGR_DEFINE_UTIL_ISSTATE(dLytDeposit_c); + STATE_MGR_DEFINE_UTIL_CHANGESTATE(dLytDeposit_c); + /* 0x08C */ UI_STATE_MGR_DECLARE(dLytDeposit_c); /* 0x0C8 */ d2d::ResAccIf_c mResAcc; /* 0x438 */ dLytDepositMain_c mMain; diff --git a/include/d/lyt/d_lyt_deposit_box_cursor.h b/include/d/lyt/d_lyt_deposit_box_cursor.h index 65cdf154..67aced0d 100644 --- a/include/d/lyt/d_lyt_deposit_box_cursor.h +++ b/include/d/lyt/d_lyt_deposit_box_cursor.h @@ -32,9 +32,9 @@ public: bool draw(); - void init(s32 location, s32 slot, s32 item, bool unk); - void updateSlot(s32 location, s32 slot, s32 item, bool unk2); - void fn_801580A0(); + void init(s32 location, s32 slot, s32 item, bool isSell); + void updateSlot(s32 location, s32 slot, s32 item, bool isSell); + void activateSell(); bool isVisible() const { return mIsVisible; @@ -56,7 +56,7 @@ private: /* 0x930 */ d2d::SubPaneList mSubpaneList; /* 0x938 */ d2d::SubPaneListNode mNode; /* 0x948 */ bool mIsVisible; - /* 0x948 */ bool field_0x949; + /* 0x948 */ bool mIsSellMode; /* 0x94C */ s32 mSlot; /* 0x950 */ s32 mItem; /* 0x954 */ s32 mItemLocation; diff --git a/include/d/lyt/d_lyt_deposit_stock.h b/include/d/lyt/d_lyt_deposit_stock.h index 90f2c061..4948c250 100644 --- a/include/d/lyt/d_lyt_deposit_stock.h +++ b/include/d/lyt/d_lyt_deposit_stock.h @@ -2,19 +2,13 @@ #define D_LYT_DEPOSIT_STOCK_H #include "d/lyt/d2d.h" +#include "d/lyt/d_lyt_common_arrow.h" #include "d/lyt/d_lyt_common_icon_item.h" #include "nw4r/lyt/lyt_pane.h" #include "s/s_State.hpp" class dLytDepositStock_c : public d2d::dSubPane { public: - enum ArrowDirection_e { - ARROW_LEFT, - ARROW_RIGHT, - - ARROW_NONE, - }; - enum NavMode_e { NAV_ITEM, NAV_SELL, @@ -104,14 +98,14 @@ public: mIsModeSell = false; mIsModeSort = false; mIsModePouch = false; - mSavedArrowDirection = ARROW_NONE; + mSavedArrowDirection = dLytCommonArrow_c::ARROW_NONE; } void disableSpecialModes() { mIsModeSell = false; mIsModeFinish = false; mIsModeSort = false; - mSavedArrowDirection = ARROW_NONE; + mSavedArrowDirection = dLytCommonArrow_c::ARROW_NONE; } u8 getItem(s32 idx) const { @@ -142,6 +136,14 @@ public: return mArrowDirection; } + s32 getSavedArrowDirection() const { + return mSavedArrowDirection; + } + + void setSavedArrowDirection(s32 dir) { + mSavedArrowDirection = dir; + } + void setMainStock(bool b) { mIsMainStock = b; } diff --git a/src/d/lyt/d_lyt_common_arrow.cpp b/src/d/lyt/d_lyt_common_arrow.cpp index f328cd12..b65815a2 100644 --- a/src/d/lyt/d_lyt_common_arrow.cpp +++ b/src/d/lyt/d_lyt_common_arrow.cpp @@ -77,7 +77,7 @@ bool dLytCommonArrow_c::execute() { mLytBase.calc(); mCsHitCheck.resetCachedHitboxes(); mCsHitCheck.execute(); - field_0x6BC = field_0x6B8; + mLastActiveArrow = mActiveArrow; return true; } @@ -121,9 +121,9 @@ bool dLytCommonArrow_c::requestOut() { return true; } -bool dLytCommonArrow_c::fn_80168760() { - if (field_0x6C0 == ARROW_NONE && field_0x6B8 != ARROW_NONE) { - field_0x6C0 = field_0x6B8; +bool dLytCommonArrow_c::triggerArrowPress() { + if (mTriggeredArrow == ARROW_NONE && mActiveArrow != ARROW_NONE) { + mTriggeredArrow = mActiveArrow; return true; } return false; @@ -180,9 +180,9 @@ void dLytCommonArrow_c::initializeState_None() { mIsChangingState = false; mVisible = false; mPointedAtArrow = ARROW_NONE; - field_0x6B8 = ARROW_NONE; - field_0x6BC = ARROW_NONE; - field_0x6C0 = ARROW_NONE; + mActiveArrow = ARROW_NONE; + mLastActiveArrow = ARROW_NONE; + mTriggeredArrow = ARROW_NONE; mTimer = 0; displayElement(ANIM_IN, 0.0f); mBackwards = true; @@ -241,11 +241,11 @@ void dLytCommonArrow_c::executeState_Wait() { } checkPointAtPane(); - if (field_0x6B8 == ARROW_LEFT) { + if (mActiveArrow == ARROW_LEFT) { d2d::AnmGroup_c &g = mAnmGroups[ANIM_ONOFF_L]; g.play(); tickDown(&mAnmGroups[ANIM_ONOFF_R]); - } else if (field_0x6B8 == ARROW_RIGHT) { + } else if (mActiveArrow == ARROW_RIGHT) { d2d::AnmGroup_c &g = mAnmGroups[ANIM_ONOFF_R]; g.play(); tickDown(&mAnmGroups[ANIM_ONOFF_L]); @@ -263,9 +263,9 @@ void dLytCommonArrow_c::executeState_Wait() { switch (mTimer) { case 0: - if (field_0x6C0 != ARROW_NONE) { - displayElement(field_0x6C0 + ANIM_DECIDE_OFFSET, 0.0f); - if (field_0x6C0 == 0) { + if (mTriggeredArrow != ARROW_NONE) { + displayElement(mTriggeredArrow + ANIM_DECIDE_OFFSET, 0.0f); + if (mTriggeredArrow == ARROW_LEFT) { dSndSmallEffectMgr_c::GetInstance()->playSound(SE_S_MENU_SELECT_TURN_PAGE_LEFT); } else { dSndSmallEffectMgr_c::GetInstance()->playSound(SE_S_MENU_SELECT_TURN_PAGE_RIGHT); @@ -274,7 +274,7 @@ void dLytCommonArrow_c::executeState_Wait() { } break; case 1: { - d2d::AnmGroup_c &g = mAnmGroups[field_0x6C0 + ANIM_DECIDE_OFFSET]; + d2d::AnmGroup_c &g = mAnmGroups[mTriggeredArrow + ANIM_DECIDE_OFFSET]; if (g.isEndReached() == true) { mTimer++; mIsChangingState = true; @@ -282,15 +282,15 @@ void dLytCommonArrow_c::executeState_Wait() { g.play(); } break; case 2: - unbindAt(field_0x6C0 + ANIM_DECIDE_OFFSET); + unbindAt(mTriggeredArrow + ANIM_DECIDE_OFFSET); mTimer = 0; mIsChangingState = false; - field_0x6C0 = ARROW_NONE; + mTriggeredArrow = ARROW_NONE; break; } - if (field_0x6BC != field_0x6B8 && field_0x6B8 != ARROW_NONE) { - if (field_0x6B8 == ARROW_LEFT) { + if (mLastActiveArrow != mActiveArrow && mActiveArrow != ARROW_NONE) { + if (mActiveArrow == ARROW_LEFT) { dSndSmallEffectMgr_c::GetInstance()->playSound(SE_S_MENU_POINT_TURN_PAGE_LEFT); } else { dSndSmallEffectMgr_c::GetInstance()->playSound(SE_S_MENU_POINT_TURN_PAGE_RIGHT); diff --git a/src/d/lyt/d_lyt_deposit.cpp b/src/d/lyt/d_lyt_deposit.cpp index 0a43b1d8..96735737 100644 --- a/src/d/lyt/d_lyt_deposit.cpp +++ b/src/d/lyt/d_lyt_deposit.cpp @@ -1,3 +1,8 @@ +// clang-format off +// need this vtable order so that stripped vtable alignment gaps work out +#include "d/lyt/d2d.h" +// clang-format on + #include "d/lyt/d_lyt_deposit.h" #include "common.h" @@ -10,7 +15,7 @@ #include "d/d_pouch.h" #include "d/d_rumble.h" #include "d/flag/storyflag_manager.h" -#include "d/lyt/d2d.h" +#include "d/lyt/d_lyt_common_arrow.h" #include "d/lyt/d_lyt_common_icon_item.h" #include "d/lyt/d_lyt_common_icon_item_maps.h" #include "d/lyt/d_lyt_deposit_box_cursor.h" @@ -193,7 +198,7 @@ void dLytDepositMain_c::initializeState_ModeCheck() { } void dLytDepositMain_c::executeState_ModeCheck() { checkPointToStock(); - handleNavOrPoint(); + checkPouchItems(); checkForItemPickupOrDrop(); checkSellOrFinish(); mIsIdle = true; @@ -206,7 +211,7 @@ void dLytDepositMain_c::initializeState_ModeChange() { } void dLytDepositMain_c::executeState_ModeChange() { if (mIsIdle) { - fn_802AC3C0(); + checkSort(); checkPointToPouch(); if (field_0x19550 != 0) { field_0x19550--; @@ -232,7 +237,7 @@ void dLytDepositMain_c::executeState_ModeChange() { dCsBase_c::GetInstance()->setCursorStickTargetPane( mpItemBoundings[mStock[STOCK_ACTIVE].getCurrentNavTarget()] ); - fn_802AD4C0(); + updateStockCursor(); } s32 slot = mStock[STOCK_ACTIVE].getCurrentSlot(); s32 v; @@ -254,7 +259,7 @@ void dLytDepositMain_c::executeState_ModeChange() { } loadItemText(v, dLytDepositBoxCursor_c::LOC_STOCK); checkSellOrFinish(); - fn_802AC670(); + checkArrows(); } else { if (mAnm[DEPOSIT_ANIM_CHANGE].isStop() && mArrow.isChangingState()) { mAnm[DEPOSIT_ANIM_CHANGE].setAnimEnable(false); @@ -273,8 +278,8 @@ void dLytDepositMain_c::executeState_ModeChange() { if (!dPadNav::isPointerVisible()) { returnCursorAfterCancellingSell(target); } - fn_802AD460(); - fn_802AD4C0(); + showCursor(); + updateStockCursor(); field_0x19550 = 1; mIsIdle = true; } @@ -310,7 +315,7 @@ void dLytDepositMain_c::executeState_ModeReverseChange() { mStateStep = 1; } } else { - fn_802AD460(); + showCursor(); selectPouchSlot(4); mIsIdle = true; } @@ -332,10 +337,10 @@ void dLytDepositMain_c::executeState_ModeScroll() { } mStock[STOCK_ACTIVE].fn_80156530(true); field_0x1954C = 1; - fn_802AD370(); - fn_802AD460(); - if (mStock[STOCK_ACTIVE].getArrowDirection() >= dLytDepositStock_c::ARROW_NONE) { - fn_802AD4C0(); + loadPageText(); + showCursor(); + if (mStock[STOCK_ACTIVE].getArrowDirection() >= dLytCommonArrow_c::ARROW_NONE) { + updateStockCursor(); } field_0x1952C = true; mIsIdle = true; @@ -358,10 +363,10 @@ void dLytDepositMain_c::executeState_ModeScroll() { } mStock[STOCK_ACTIVE].fn_80156530(true); field_0x1954C = 1; - fn_802AD370(); - fn_802AD460(); - if (mStock[STOCK_ACTIVE].getArrowDirection() >= dLytDepositStock_c::ARROW_NONE) { - fn_802AD4C0(); + loadPageText(); + showCursor(); + if (mStock[STOCK_ACTIVE].getArrowDirection() >= dLytCommonArrow_c::ARROW_NONE) { + updateStockCursor(); } field_0x1952C = true; mIsIdle = true; @@ -577,7 +582,7 @@ bool dLytDepositMain_c::build(d2d::ResAccIf_c *resAcc) { buildSubpanes(); mCsHitCheck.init(mLyt.getLayout()->GetRootPane(), 0x1, 0, 0); dCsMgr_c::GetInstance()->registCursorTarget(&mCsHitCheck); - fn_802AD370(); + loadPageText(); mCursor.build(resAcc); @@ -590,7 +595,7 @@ bool dLytDepositMain_c::build(d2d::ResAccIf_c *resAcc) { mIsPointingAtToPouchBounding = false; mIsFinishActive = false; mIsSellActive = false; - field_0x19525 = false; + mIsSortActive = false; field_0x19526 = false; field_0x19527 = false; field_0x19528 = false; @@ -761,7 +766,7 @@ void dLytDepositMain_c::setModeCheck() { slot += RING_NUM_ITEMS; } dCsBase_c::GetInstance()->setCursorStickTargetPane(mpRingBoundings[slot]); - fn_802AD460(); + showCursor(); mStateMgr.changeState(StateID_ModeCheck); mIsIdle = false; } @@ -778,7 +783,7 @@ void dLytDepositMain_c::setModeChange(bool unk) { mLyt.calc(); mIsIdle = false; - fn_802AD400(); + hideCursor(); mArrow.requestIn(); mStateStep = 0; } @@ -810,7 +815,7 @@ void dLytDepositMain_c::setModeReverseChange() { mStock[STOCK_ACTIVE].navigateToItem(); mStock[STOCK_ACTIVE].returnToNoneMode(); mCurrentPouchNavTarget = -4; - fn_802AD400(); + hideCursor(); mArrow.requestOut(); dSndSmallEffectMgr_c::GetInstance()->playSound(SE_S_SHOP_STK_CHANGE_POUCH); mStateStep = 0; @@ -831,9 +836,9 @@ void dLytDepositMain_c::setModeScroll(bool leftRight, bool viaButton) { mStock[STOCK_ACTIVE].field_0x684B = true; mStock[STOCK_ACTIVE].fn_80156530(false); if (viaButton) { - mArrow.fn_80168760(); + mArrow.triggerArrowPress(); } - fn_802AD400(); + hideCursor(); mHasScrolledOtherStocks = false; mStateMgr.changeState(StateID_ModeScroll); mIsIdle = false; @@ -877,7 +882,7 @@ void dLytDepositMain_c::setModeOut() { mAnm[DEPOSIT_ANIM_BTN_DECIDE_00].setFrame(0.0f); mLyt.calc(); - if (*mStateMgr.getStateID() == StateID_ModeChange) { + if (*mStateMgr.getStateID() == StateID_ModeCheck) { navigateOffIcon(); } else { mStock[STOCK_ACTIVE].navigateOffIcon(); @@ -1018,7 +1023,7 @@ void dLytDepositMain_c::loadInitialState() { mIsPointingAtToPouchBounding = false; mIsFinishActive = false; mIsSellActive = false; - field_0x19525 = false; + mIsSortActive = false; field_0x19526 = false; field_0x19527 = false; field_0x19528 = false; @@ -1076,9 +1081,11 @@ void dLytDepositMain_c::checkPointToPouch() { nw4r::math::MTX34 mtx = p->GetGlobalMtx(); mVec3_c v(0.0f, 0.0f, 0.0f); MTXMultVec(mtx, v, v); - // TODO I hate vectors - mVec2_c pos = mVec2_c(v.x, v.y); - if (pos.squareDistanceTo(mCsPosition) < radius) { + // TODO maybe fake + mVec2_c pos2 = mVec2_c(v.x, v.y); + mVec2_c dist = pos2; + dist -= mCsPosition; + if (dist.squaredLength() < radius) { // TODO: field_0x19522 is always false at this point if (!mIsPointingAtToPouchBounding) { dRumble_c::start(dRumble_c::sRumblePreset1, dRumble_c::FLAG_SLOT0); @@ -1088,7 +1095,7 @@ void dLytDepositMain_c::checkPointToPouch() { } } -void dLytDepositMain_c::handleNavOrPoint() { +void dLytDepositMain_c::checkPouchItems() { bool selectIcon = false; s32 nextTarget = 0; if (dPadNav::isPointerVisible()) { @@ -1148,7 +1155,7 @@ void dLytDepositMain_c::handleNavOrPoint() { case dPadNav::FS_STICK_DOWN_LEFT: nextTarget = -1; mStock[STOCK_ACTIVE].navigateToSell(); - fn_802AC980(); + loadCursor(); break; case dPadNav::FS_STICK_LEFT: nextTarget = mCurrentPouchNavTarget - 1; @@ -1434,8 +1441,8 @@ void dLytDepositMain_c::checkSellOrFinish() { case dPadNav::FS_STICK_UP: case dPadNav::FS_STICK_UP_RIGHT: { mStock[STOCK_ACTIVE].disableModeFinish(); - mArrow.setField_0x6B8(1); - mStock[STOCK_ACTIVE].navigateToArrow(dLytDepositStock_c::ARROW_RIGHT); + mArrow.setActiveArrow(1); + mStock[STOCK_ACTIVE].navigateToArrow(dLytCommonArrow_c::ARROW_RIGHT); dRumble_c::start(dRumble_c::sRumblePreset1, dRumble_c::FLAG_SLOT0); mStock[STOCK_ACTIVE].saveArrowDirection(); break; @@ -1456,7 +1463,7 @@ void dLytDepositMain_c::checkSellOrFinish() { } else if (mStock[STOCK_ACTIVE].isModeSell()) { if (!mIsSellActive || field_0x1952A) { dCsBase_c::GetInstance()->setCursorStickTargetPane(mpBoundingItem12); - mCursor.fn_801580A0(); + mCursor.activateSell(); updateFlags = 2; } else if (field_0x1954C == 0) { switch (direction) { @@ -1482,8 +1489,8 @@ void dLytDepositMain_c::checkSellOrFinish() { switch (direction) { case dPadNav::FS_STICK_UP: { mStock[STOCK_ACTIVE].disableModeSell(); - mArrow.setField_0x6B8(0); - mStock[STOCK_ACTIVE].navigateToArrow(dLytDepositStock_c::ARROW_LEFT); + mArrow.setActiveArrow(0); + mStock[STOCK_ACTIVE].navigateToArrow(dLytCommonArrow_c::ARROW_LEFT); dRumble_c::start(dRumble_c::sRumblePreset1, dRumble_c::FLAG_SLOT0); break; } @@ -1581,12 +1588,12 @@ void dLytDepositMain_c::selectPouchSlot(s32 slot) { mAnm[mCurrentPouchNavTarget + DEPOSIT_ANIM_FLASH_OFFSET].setAnimEnable(false); } -void dLytDepositMain_c::returnCursorAfterCancellingSell(s32 targetSlot) { +void dLytDepositMain_c::returnCursorAfterCancellingSell(s32 idx) { mStock[STOCK_ACTIVE].disableModeSell(); if (dPadNav::isPointerVisible()) { - targetSlot -= 12; + idx -= 12; } - mStock[STOCK_ACTIVE].selectNavTarget(targetSlot); + mStock[STOCK_ACTIVE].selectNavTarget(idx); mStock[STOCK_ACTIVE].navigateToItem(); s32 navTarget = mStock[STOCK_ACTIVE].getCurrentNavTarget(); if (navTarget >= 0) { @@ -1613,6 +1620,212 @@ s32 dLytDepositMain_c::calcNumDigits(s32 value) { return i; } +void dLytDepositMain_c::checkSort() { + bool b = false; + dCursorHitCheck_c *d = dCsBase_c::GetInstance()->getHitCheck(); + if (dPadNav::isPointerVisible()) { + if (d != nullptr && d->getType() == 'lyt ') { + if (static_cast(d)->getHitPane() == mpBoundingCleanUp && + mCurrentlyHoldingItemSlot < 0) { + mStock[STOCK_ACTIVE].navigateToSort(); + mStock[STOCK_ACTIVE].disableModeSell(); + mStock[STOCK_ACTIVE].disableModeFinish(); + b = true; + } + } + } else { + if (mStock[STOCK_ACTIVE].isModeSort()) { + if (!mIsSortActive || field_0x1952A) { + dCsBase_c::GetInstance()->setCursorStickTargetPane(mpBoundingCleanUp); + b = true; + } else { + switch (dPadNav::getFSStickNavDirection()) { + case dPadNav::FS_STICK_UP: + case dPadNav::FS_STICK_UP_RIGHT: + mStock[STOCK_ACTIVE].disableModeSort(); + returnCursorAfterCancellingSort(11); + break; + case dPadNav::FS_STICK_RIGHT: + case dPadNav::FS_STICK_DOWN_RIGHT: + case dPadNav::FS_STICK_DOWN: + mStock[STOCK_ACTIVE].disableModeSort(); + mStock[STOCK_ACTIVE].navigateToFinish(); + dCsBase_c::GetInstance()->setCursorStickTargetPane(mpBoundingChoices); + break; + case dPadNav::FS_STICK_LEFT: + case dPadNav::FS_STICK_UP_LEFT: + mStock[STOCK_ACTIVE].disableModeSort(); + returnCursorAfterCancellingSort(10); + break; + case dPadNav::FS_STICK_NONE: + case dPadNav::FS_STICK_DOWN_LEFT: + dCsBase_c::GetInstance()->setCursorStickTargetPane(mpBoundingCleanUp); + b = true; + break; + } + } + } + } + + if (b) { + if (!mIsSortActive) { + mAnm[DEPOSIT_ANIM_BTN_ON_OFF_01].setAnimEnable(true); + mAnm[DEPOSIT_ANIM_BTN_ON_OFF_01].setFrame(0.0f); + mAnm[DEPOSIT_ANIM_BTN_ON_OFF_01].setForwardOnce(); + dRumble_c::start(dRumble_c::sRumblePreset1, dRumble_c::FLAG_SLOT0); + } + dCsBase_c::GetInstance()->setCursorStickTargetPane(mpBoundingCleanUp); + mIsSortActive = true; + } else if (mIsSortActive) { + mAnm[DEPOSIT_ANIM_BTN_ON_OFF_01].setAnimEnable(true); + mAnm[DEPOSIT_ANIM_BTN_ON_OFF_01].setBackwardsOnce(); + mStock[STOCK_ACTIVE].disableModeSort(); + mIsSortActive = false; + } +} + +void dLytDepositMain_c::returnCursorAfterCancellingSort(s32 idx) { + mStock[STOCK_ACTIVE].selectNavTarget(idx); + s32 target = mStock[STOCK_ACTIVE].getCurrentNavTarget(); + mStock[STOCK_ACTIVE].navigateToItem(); + if (target >= 0) { + dCsBase_c::GetInstance()->setCursorStickTargetPane(mpItemBoundings[target]); + } +} + +void dLytDepositMain_c::checkArrows() { + if (dPadNav::isPointerVisible()) { + s32 pointArrow = mArrow.getPointedAtArrow(); + if (pointArrow < dLytCommonArrow_c::ARROW_NONE) { + if (pointArrow != mStock[STOCK_ACTIVE].getArrowDirection()) { + mArrow.setActiveArrow(pointArrow); + dCsBase_c::GetInstance()->setCursorStickTargetPane(mArrow.getArrowBounding(pointArrow)); + dRumble_c::start(dRumble_c::sRumblePreset1, dRumble_c::FLAG_SLOT0); + mStock[STOCK_ACTIVE].navigateToArrow(pointArrow); + mStock[STOCK_ACTIVE].saveArrowDirection(); + } + } else if (mStock[STOCK_ACTIVE].getArrowDirection() < dLytCommonArrow_c::ARROW_NONE) { + mStock[STOCK_ACTIVE].navigateToArrow(pointArrow); + mArrow.setActiveArrow(mArrow.getPointedAtArrow()); + } + + } else { + if (field_0x1952A && mStock[STOCK_ACTIVE].getSavedArrowDirection() < dLytCommonArrow_c::ARROW_NONE) { + s32 dir = mStock[STOCK_ACTIVE].restoreArrowDirection(); + if (mStock[STOCK_ACTIVE].getArrowDirection() >= dLytCommonArrow_c::ARROW_NONE) { + mArrow.setActiveArrow(dir); + dRumble_c::start(dRumble_c::sRumblePreset1, dRumble_c::FLAG_SLOT0); + } + dCsBase_c::GetInstance()->setCursorStickTargetPane(mArrow.getArrowBounding(dir)); + if (mCurrentlyHoldingItemSlot >= 0) { + s32 slot = mCurrentlyHoldingItemSlot; + s32 loc; + if (slot < SLOT_STOCK_OFFSET) { + loc = dLytDepositBoxCursor_c::LOC_POUCH; + } else { + loc = dLytDepositBoxCursor_c::LOC_STOCK; + slot -= SLOT_STOCK_OFFSET; + } + mCursor.updateSlot(loc, slot, LYT_CMN_PouchPotionHealthPlusPlusHalf, false); + } + } else if (mStock[STOCK_ACTIVE].getSavedArrowDirection() < dLytCommonArrow_c::ARROW_NONE) { + s32 dir = mStock[STOCK_ACTIVE].restoreArrowDirection(); + dCsBase_c::GetInstance()->setCursorStickTargetPane(mArrow.getArrowBounding(dir)); + if (mCurrentlyHoldingItemSlot >= 0) { + s32 slot = mCurrentlyHoldingItemSlot; + s32 loc; + if (slot < SLOT_STOCK_OFFSET) { + loc = dLytDepositBoxCursor_c::LOC_POUCH; + } else { + loc = dLytDepositBoxCursor_c::LOC_STOCK; + slot -= SLOT_STOCK_OFFSET; + } + mCursor.updateSlot(loc, slot, LYT_CMN_PouchPotionHealthPlusPlusHalf, false); + } + mArrow.setActiveArrow(dir); + if (!field_0x1952A) { + switch (dPadNav::getFSStickNavDirection()) { + case dPadNav::FS_STICK_UP_RIGHT: + case dPadNav::FS_STICK_RIGHT: + if (dir == dLytCommonArrow_c::ARROW_LEFT) { + returnCursorAfterCancellingArrow(0); + } + break; + case dPadNav::FS_STICK_DOWN_RIGHT: + if (dir == dLytCommonArrow_c::ARROW_LEFT) { + returnCursorAfterCancellingArrow(6); + } + break; + case dPadNav::FS_STICK_DOWN: + if (dir == dLytCommonArrow_c::ARROW_LEFT) { + if (mItemSellValue != 0) { + mArrow.setActiveArrow(dLytCommonArrow_c::ARROW_NONE); + mStock[STOCK_ACTIVE].navigateToArrow(dLytCommonArrow_c::ARROW_NONE); + mStock[STOCK_ACTIVE].navigateToSell(); + dCsBase_c::GetInstance()->setCursorStickTargetPane(mpBoundingItem12); + loadCursor(); + } + } else if (mCurrentlyHoldingItemSlot < 0) { + mArrow.setActiveArrow(dLytCommonArrow_c::ARROW_NONE); + mStock[STOCK_ACTIVE].navigateToArrow(dLytCommonArrow_c::ARROW_NONE); + mStock[STOCK_ACTIVE].navigateToFinish(); + loadCursor(); + } + break; + case dPadNav::FS_STICK_LEFT: + case dPadNav::FS_STICK_UP_LEFT: + if (dir == dLytCommonArrow_c::ARROW_RIGHT) { + returnCursorAfterCancellingArrow(5); + } + break; + case dPadNav::FS_STICK_DOWN_LEFT: + if (dir == dLytCommonArrow_c::ARROW_RIGHT) { + returnCursorAfterCancellingArrow(11); + } + break; + } + } + } + } +} + +void dLytDepositMain_c::loadCursor() { + if (mCurrentlyHoldingItemSlot >= 0) { + s32 slot; + s32 loc; + s32 item; + if (mCurrentlyHoldingItemSlot < SLOT_STOCK_OFFSET) { + slot = mCurrentlyHoldingItemSlot; + item = mPouchItemIds[mCurrentlyHoldingItemSlot]; + loc = dLytDepositBoxCursor_c::LOC_POUCH; + } else { + slot = mCurrentlyHoldingItemSlot - SLOT_STOCK_OFFSET; + item = mStock[STOCK_ACTIVE].getActiveItem(); + loc = dLytDepositBoxCursor_c::LOC_STOCK; + } + mCursor.updateSlot(loc, slot, item, mStock[STOCK_ACTIVE].isModeSell()); + } +} + +void dLytDepositMain_c::returnCursorAfterCancellingArrow(s32 idx) { + mArrow.setActiveArrow(dLytCommonArrow_c::ARROW_NONE); + mStock[STOCK_ACTIVE].navigateToArrow(dLytCommonArrow_c::ARROW_NONE); + mStock[STOCK_ACTIVE].selectNavTarget(idx); + mStock[STOCK_ACTIVE].setSavedArrowDirection(dLytCommonArrow_c::ARROW_NONE); + mStock[STOCK_ACTIVE].navigateToItem(); + if (mStock[STOCK_ACTIVE].getCurrentNavTarget() >= 0) { + dCsBase_c::GetInstance()->setCursorStickTargetPane(mpItemBoundings[mStock[STOCK_ACTIVE].getCurrentNavTarget()]); + } +} + +void dLytDepositMain_c::setPouchItemsVisible(bool visible) { + for (int i = 0; i < RING_NUM_ITEMS; i++) { + if (mPouchItemIds[i] < LYT_CMN_PouchPotionHealthPlusPlusHalf) { + mPouchItems[i].setVisible(visible); + } + } +} + void dLytDepositMain_c::checkForItemPickupOrDrop() { bool anyPickup = false; @@ -1621,8 +1834,8 @@ void dLytDepositMain_c::checkForItemPickupOrDrop() { if (mCurrentlyHoldingItemSlot < 0) { // Not holding an item... if (mCurrentPouchNavTarget >= 0 && mPouchItemIds[mCurrentPouchNavTarget] != LYT_CMN_PouchBlank4 && - // ... and picking up an item from the pouch mPouchItemIds[mCurrentPouchNavTarget] != LYT_CMN_PouchPotionHealthPlusPlusHalf) { + // ... and picking up an item from the pouch mCursorLocation = dLytDepositBoxCursor_c::LOC_POUCH; field_0x19540 = convertLytPouchSlot2(mCurrentPouchNavTarget); item = getPouchItemIdForIndex(mCurrentPouchNavTarget, false); @@ -1803,7 +2016,9 @@ void dLytDepositMain_c::checkForItemPickupOrDrop() { mStock[STOCK_ACTIVE].getPage()) { returnCursorAfterCancellingSell(0); } else { - returnCursorAfterCancellingSell((mCurrentlyHoldingItemSlot - SLOT_STOCK_OFFSET) % NUM_ICONS_PER_PAGE); + returnCursorAfterCancellingSell( + (mCurrentlyHoldingItemSlot - SLOT_STOCK_OFFSET) % NUM_ICONS_PER_PAGE + ); } } } @@ -1829,6 +2044,57 @@ void dLytDepositMain_c::checkForItemPickupOrDrop() { } } +s32 dLytDepositMain_c::getItemSellValueFrame(s32 value) { + if (value >= 100) { + return 1; + } else { + return 0; + } +} + +void dLytDepositMain_c::loadPageText() { + static wchar_t buf[4]; + swprintf(buf, ARRAY_LENGTH(buf), L"%1d/5", mStock[STOCK_ACTIVE].getPage() + 1); + mLyt.getTextBox("T_page_00")->setTextWithGlobalTextProcessor(buf, nullptr); + mLyt.getTextBox("T_pageS_00")->setTextWithGlobalTextProcessor(buf, nullptr); +} + +void dLytDepositMain_c::hideCursor() { + if (!dPadNav::isPointerVisible()) { + dPadNav::setCursorStickInvisible(); + dCsBase_c::GetInstance()->setCursorStickVisible(false); + if (mCurrentlyHoldingItemSlot >= 0) { + mCursor.setVisible(false); + } + } +} + +void dLytDepositMain_c::showCursor() { + if (!dPadNav::isPointerVisible()) { + dCsBase_c::GetInstance()->setCursorStickVisible(true); + } + dPadNav::setCursorStickVisible(); + if (mCurrentlyHoldingItemSlot >= 0) { + mCursor.setVisible(true); + } +} + +void dLytDepositMain_c::updateStockCursor() { + s32 navTarget = mStock[STOCK_ACTIVE].getCurrentNavTarget(); + if (navTarget < 0) { + navTarget += 12; + } + s32 slot = navTarget + mStock[STOCK_ACTIVE].getPage() * NUM_ICONS_PER_PAGE; + s32 item; + item = mStock[STOCK_ACTIVE].getActiveItem(); + if (mCurrentlyHoldingItemSlot >= 0 && slot == mCurrentlyHoldingItemSlot - SLOT_STOCK_OFFSET) { + item = LYT_CMN_PouchBlank4; + } else { + item = mStock[STOCK_ACTIVE].getItem(navTarget); + } + mCursor.updateSlot(dLytDepositBoxCursor_c::LOC_STOCK, slot, item, false); +} + STATE_DEFINE(dLytDeposit_c, None); STATE_DEFINE(dLytDeposit_c, In); STATE_DEFINE(dLytDeposit_c, Check); @@ -1985,6 +2251,8 @@ void dLytDeposit_c::finalizeState_Out() {} SPECIAL_BASE_PROFILE(LYT_DEPOSIT, dLytDeposit_c, fProfile::LYT_DEPOSIT, 0x2B9, 0); +dLytDeposit_c *dLytDeposit_c::sInstance; + bool dLytDeposit_c::build() { void *data = LayoutArcManager::GetInstance()->getLoadedData("Shop"); mResAcc.attach(data, ""); @@ -2039,7 +2307,7 @@ bool dLytDeposit_c::checkForNavRight() { } } - if (dPad::getDownTrigA() && mMain.getArrowDirection() == dLytDepositStock_c::ARROW_RIGHT) { + if (dPad::getDownTrigA() && mMain.getArrowDirection() == dLytCommonArrow_c::ARROW_RIGHT) { dSndSmallEffectMgr_c::GetInstance()->playSound(SE_S_SHOP_STK_STOCK_SELECT_TURN_PAGE_RIGHT); mScrollViaArrowButton = true; return true; @@ -2060,7 +2328,7 @@ bool dLytDeposit_c::checkForNavLeft() { } } - if (dPad::getDownTrigA() && mMain.getArrowDirection() == dLytDepositStock_c::ARROW_LEFT) { + if (dPad::getDownTrigA() && mMain.getArrowDirection() == dLytCommonArrow_c::ARROW_LEFT) { dSndSmallEffectMgr_c::GetInstance()->playSound(SE_S_SHOP_STK_STOCK_SELECT_TURN_PAGE_LEFT); mScrollViaArrowButton = true; return true; diff --git a/src/d/lyt/d_lyt_deposit_box_cursor.cpp b/src/d/lyt/d_lyt_deposit_box_cursor.cpp index 5471b3aa..f337a068 100644 --- a/src/d/lyt/d_lyt_deposit_box_cursor.cpp +++ b/src/d/lyt/d_lyt_deposit_box_cursor.cpp @@ -42,7 +42,7 @@ bool dLytDepositBoxCursor_c::build(d2d::ResAccIf_c *resAcc) { mpGetIconPane = mLyt.findPane("N_getIcon_00"); initIcon(); mIsVisible = false; - field_0x949 = false; + mIsSellMode = false; return true; } @@ -117,7 +117,7 @@ void dLytDepositBoxCursor_c::realizeNav() { s = 4; } else if (mItem == LYT_CMN_PouchPotionHealthPlusPlusHalf) { s = 5; - } else if (field_0x949) { + } else if (mIsSellMode) { s = 6; } else if (mItemLocation == LOC_POUCH) { // Flip the cursor for pouch slot 0 so that it's not above the screen edge @@ -148,9 +148,9 @@ void dLytDepositBoxCursor_c::realizeNav() { mAnm[DEPOSIT_BOX_CURSOR_ANIM_STICK_CURSOR].setAnimEnable(false); } -void dLytDepositBoxCursor_c::init(s32 location, s32 slot, s32 item, bool unk) { +void dLytDepositBoxCursor_c::init(s32 location, s32 slot, s32 item, bool isSell) { mItemLocation = location; - field_0x949 = unk; + mIsSellMode = isSell; s32 number; f32 durability; @@ -188,10 +188,10 @@ void dLytDepositBoxCursor_c::init(s32 location, s32 slot, s32 item, bool unk) { mIsVisible = true; } -void dLytDepositBoxCursor_c::updateSlot(s32 location, s32 slot, s32 item, bool unk2) { +void dLytDepositBoxCursor_c::updateSlot(s32 location, s32 slot, s32 item, bool isSell) { mItem = item; mItemLocation = location; - field_0x949 = unk2; + mIsSellMode = isSell; if (mItemLocation == LOC_POUCH) { mSlot = slot; } else { @@ -199,7 +199,7 @@ void dLytDepositBoxCursor_c::updateSlot(s32 location, s32 slot, s32 item, bool u } } -void dLytDepositBoxCursor_c::fn_801580A0() { - field_0x949 = true; +void dLytDepositBoxCursor_c::activateSell() { + mIsSellMode = true; realizeNav(); } diff --git a/src/d/lyt/d_lyt_deposit_stock.cpp b/src/d/lyt/d_lyt_deposit_stock.cpp index fc00aaa5..8702be8d 100644 --- a/src/d/lyt/d_lyt_deposit_stock.cpp +++ b/src/d/lyt/d_lyt_deposit_stock.cpp @@ -4,6 +4,7 @@ #include "d/d_pad_nav.h" #include "d/d_rumble.h" #include "d/lyt/d2d.h" +#include "d/lyt/d_lyt_common_arrow.h" #include "d/lyt/d_lyt_common_icon_item.h" #include "d/lyt/d_lyt_common_icon_item_maps.h" #include "d/lyt/d_lyt_util_items.h" @@ -99,14 +100,14 @@ bool dLytDepositStock_c::build(d2d::ResAccIf_c *resAcc) { field_0x684C = true; field_0x684E = false; - mArrowDirection = ARROW_NONE; + mArrowDirection = dLytCommonArrow_c::ARROW_NONE; mIsModePouch = false; mIsModeSell = false; mIsModeSort = false; mIsModeFinish = false; - mSavedArrowDirection = ARROW_NONE; + mSavedArrowDirection = dLytCommonArrow_c::ARROW_NONE; navigateToItem(); @@ -278,7 +279,7 @@ void dLytDepositStock_c::fn_80156530(bool unk) { mIsModeSort = false; } mIsModeFinish = false; - if (mArrowDirection >= ARROW_NONE) { + if (mArrowDirection >= dLytCommonArrow_c::ARROW_NONE) { handleSpecialNavMode(); } } @@ -324,7 +325,7 @@ void dLytDepositStock_c::handleNavOrPoint() { break; case dPadNav::FS_STICK_RIGHT: if (target % 6 == 5) { - navigateToArrow(ARROW_RIGHT); + navigateToArrow(dLytCommonArrow_c::ARROW_RIGHT); saveArrowDirection(); dRumble_c::start(dRumble_c::sRumblePreset1, dRumble_c::FLAG_SLOT0); } else { @@ -352,7 +353,7 @@ void dLytDepositStock_c::handleNavOrPoint() { break; case dPadNav::FS_STICK_LEFT: if (target % 6 == 0) { - navigateToArrow(ARROW_LEFT); + navigateToArrow(dLytCommonArrow_c::ARROW_LEFT); saveArrowDirection(); dRumble_c::start(dRumble_c::sRumblePreset1, dRumble_c::FLAG_SLOT0); } else { @@ -374,7 +375,7 @@ void dLytDepositStock_c::handleNavOrPoint() { } if (selectIcon) { - mSavedArrowDirection = ARROW_NONE; + mSavedArrowDirection = dLytCommonArrow_c::ARROW_NONE; if (mCurrentNavTarget != nextTarget) { if (mCurrentNavTarget >= 0) { mIcons[mCurrentNavTarget].setOff(); @@ -612,7 +613,7 @@ void dLytDepositStock_c::pickUpItem(s32 slot, bool unk) { void dLytDepositStock_c::navigateToPouch() { mIsModePouch = true; - mSavedArrowDirection = ARROW_NONE; + mSavedArrowDirection = dLytCommonArrow_c::ARROW_NONE; } void dLytDepositStock_c::navigateToSell() { @@ -621,7 +622,7 @@ void dLytDepositStock_c::navigateToSell() { } mIsModeSell = true; mNavMode = NAV_SELL; - mSavedArrowDirection = ARROW_NONE; + mSavedArrowDirection = dLytCommonArrow_c::ARROW_NONE; } void dLytDepositStock_c::navigateToSort() { @@ -630,7 +631,7 @@ void dLytDepositStock_c::navigateToSort() { } mIsModeSort = true; mNavMode = NAV_SORT; - mSavedArrowDirection = ARROW_NONE; + mSavedArrowDirection = dLytCommonArrow_c::ARROW_NONE; } void dLytDepositStock_c::navigateToFinish() { @@ -639,7 +640,7 @@ void dLytDepositStock_c::navigateToFinish() { } mIsModeFinish = true; mNavMode = NAV_FINISH; - mSavedArrowDirection = ARROW_NONE; + mSavedArrowDirection = dLytCommonArrow_c::ARROW_NONE; } void dLytDepositStock_c::saveArrowDirection() { @@ -648,13 +649,13 @@ void dLytDepositStock_c::saveArrowDirection() { void dLytDepositStock_c::navigateToArrow(s32 arrowDirection) { mArrowDirection = arrowDirection; - if (mArrowDirection < ARROW_NONE) { + if (mArrowDirection < dLytCommonArrow_c::ARROW_NONE) { mNavMode = NAV_ARROW; } } s32 dLytDepositStock_c::restoreArrowDirection() { - if (mSavedArrowDirection < ARROW_NONE && mArrowDirection >= ARROW_NONE) { + if (mSavedArrowDirection < dLytCommonArrow_c::ARROW_NONE && mArrowDirection >= dLytCommonArrow_c::ARROW_NONE) { navigateToArrow(mSavedArrowDirection); } return mArrowDirection; @@ -670,7 +671,7 @@ void dLytDepositStock_c::handleSpecialNavMode() { case NAV_SORT: navigateToSort(); break; case NAV_FINISH: navigateToFinish(); break; case NAV_ARROW: - if (mArrowDirection < ARROW_NONE) { + if (mArrowDirection < dLytCommonArrow_c::ARROW_NONE) { saveArrowDirection(); } break; diff --git a/src/d/lyt/d_lyt_pause.cpp b/src/d/lyt/d_lyt_pause.cpp index 9c541073..f4577177 100644 --- a/src/d/lyt/d_lyt_pause.cpp +++ b/src/d/lyt/d_lyt_pause.cpp @@ -290,7 +290,7 @@ void dLytPauseMain_c::executeState_Wait() { mRingToggleRequest = false; mStateMgr.changeState(StateID_Ring); } - mpArrow->unk(); + mpArrow->setActiveArrow(mpArrow->getPointedAtArrow()); } } void dLytPauseMain_c::finalizeState_Wait() {} @@ -874,7 +874,7 @@ nw4r::lyt::Bounding *dLytPauseMgr_c::getArrowBounding(int idx) const { } void dLytPauseMgr_c::setSelectedArrowBounding(int idx) { - mMain.getArrow()->setField_0x6B8(idx); + mMain.getArrow()->setActiveArrow(idx); } void dLytPauseMgr_c::setSelection(dLytPauseMgr_c::SelectionType_e type, u16 id, bool restricted) { @@ -957,8 +957,8 @@ bool dLytPauseMgr_c::checkChangeDisp() { } nav = true; } - s32 arrowPane = mMain.getArrow()->getField_0x6B8(); - if (arrowPane != dLytCommonArrow_c::ARROW_NONE && dPad::getDownTrigA() && mMain.getArrow()->fn_80168760()) { + s32 arrowPane = mMain.getArrow()->getActiveArrow(); + if (arrowPane != dLytCommonArrow_c::ARROW_NONE && dPad::getDownTrigA() && mMain.getArrow()->triggerArrowPress()) { if (arrowPane == dLytCommonArrow_c::ARROW_LEFT) { mIsNavLeft = true; } else { diff --git a/src/d/lyt/d_lyt_pause_disp_00.cpp b/src/d/lyt/d_lyt_pause_disp_00.cpp index 29c68db2..97f09055 100644 --- a/src/d/lyt/d_lyt_pause_disp_00.cpp +++ b/src/d/lyt/d_lyt_pause_disp_00.cpp @@ -10,6 +10,7 @@ #include "d/flag/itemflag_manager.h" #include "d/flag/storyflag_manager.h" #include "d/lyt/d2d.h" +#include "d/lyt/d_lyt_common_arrow.h" #include "d/lyt/d_lyt_common_icon_item_maps.h" #include "d/lyt/d_lyt_control_game.h" #include "d/lyt/d_lyt_pause.h" @@ -427,8 +428,8 @@ bool dLytPauseDisp00_c::build() { } } - mpBoundings[PAUSE_DISP_00_BOUNDING_ARROW_LEFT] = pauseMgr->getArrowBounding(0); - mpBoundings[PAUSE_DISP_00_BOUNDING_ARROW_RIGHT] = pauseMgr->getArrowBounding(1); + mpBoundings[PAUSE_DISP_00_BOUNDING_ARROW_LEFT] = pauseMgr->getArrowBounding(dLytCommonArrow_c::ARROW_LEFT); + mpBoundings[PAUSE_DISP_00_BOUNDING_ARROW_RIGHT] = pauseMgr->getArrowBounding(dLytCommonArrow_c::ARROW_RIGHT); u8 songLifetreeStatus = getSongLifeTreeStatus(); if (songLifetreeStatus == SONG_LIFETREE_HAS_SOTH) { @@ -2010,9 +2011,11 @@ bool dLytPauseDisp00_c::isPointingAtRingIcon() { nw4r::math::MTX34 mtx = mLyt.findPane("N_ringIcon_00")->GetGlobalMtx(); nw4r::math::VEC3 v(0.0f, 0.0f, 0.0f); MTXMultVec(mtx, v, v); - // TODO I hate vectors - mVec2_c pos(v.x, v.y); - if (pos.squareDistanceTo(csPos) < radiusSq) { + // TODO maybe fake + mVec2_c pos2 = mVec2_c(v.x, v.y); + mVec2_c dist = pos2; + dist -= csPos; + if (dist.squaredLength() < radiusSq) { ret = true; } From 59d51629bc9e714b02b8f0eefe0f195caa8d1ecc Mon Sep 17 00:00:00 2001 From: robojumper Date: Thu, 25 Dec 2025 20:53:07 +0100 Subject: [PATCH 07/11] Cleanup, docs --- config/SOUE01/symbols.txt | 2 +- include/d/lyt/d_lyt_deposit.h | 28 +++--- include/d/lyt/d_lyt_deposit_stock.h | 30 +++--- src/d/lyt/d_lyt_deposit.cpp | 139 ++++++++++++++-------------- src/d/lyt/d_lyt_deposit_stock.cpp | 62 ++++++------- 5 files changed, 134 insertions(+), 127 deletions(-) diff --git a/config/SOUE01/symbols.txt b/config/SOUE01/symbols.txt index c2b85185..1c12078b 100644 --- a/config/SOUE01/symbols.txt +++ b/config/SOUE01/symbols.txt @@ -8667,7 +8667,7 @@ getCurrentSlot__18dLytDepositStock_cCFv = .text:0x80156C60; // type:function siz setItem__18dLytDepositStock_cFll = .text:0x80156C80; // type:function size:0x58 realizeItem__18dLytDepositStock_cFl = .text:0x80156CE0; // type:function size:0xD8 selectNavTarget__18dLytDepositStock_cFl = .text:0x80156DC0; // type:function size:0xDC -pickUpItem__18dLytDepositStock_cFlb = .text:0x80156EA0; // type:function size:0x1D4 +pickUpOrPlaceItem__18dLytDepositStock_cFlb = .text:0x80156EA0; // type:function size:0x1D4 navigateToPouch__18dLytDepositStock_cFv = .text:0x80157080; // type:function size:0x14 navigateToSell__18dLytDepositStock_cFv = .text:0x801570A0; // type:function size:0x54 navigateToSort__18dLytDepositStock_cFv = .text:0x80157100; // type:function size:0x54 diff --git a/include/d/lyt/d_lyt_deposit.h b/include/d/lyt/d_lyt_deposit.h index 8596ac43..e9a7128b 100644 --- a/include/d/lyt/d_lyt_deposit.h +++ b/include/d/lyt/d_lyt_deposit.h @@ -48,7 +48,7 @@ public: } void setField_0x1952C(bool b) { - field_0x1952C = b; + mPreventCancellingSelection = b; } s32 getStateStep() const { @@ -76,7 +76,7 @@ public: } bool getField_0x1952B() const { - return field_0x1952B; + return mDidDropCancelItem; } bool isHoldingItem() const { @@ -172,23 +172,23 @@ private: /* 0x19523 */ bool mIsFinishActive; /* 0x19524 */ bool mIsSellActive; /* 0x19525 */ bool mIsSortActive; - /* 0x19526 */ bool field_0x19526; + /* 0x19526 */ bool mIsRecycleActive; /* 0x19527 */ bool field_0x19527; - /* 0x19528 */ bool field_0x19528; - /* 0x19529 */ bool mHasScrolledOtherStocks; - /* 0x1952A */ bool field_0x1952A; - /* 0x1952B */ bool field_0x1952B; - /* 0x1952C */ bool field_0x1952C; + /* 0x19528 */ bool mIsArrangementDone; + /* 0x19529 */ bool mHasHandledScrollTempItems; + /* 0x1952A */ bool mPrevPointerVisible; + /* 0x1952B */ bool mDidDropCancelItem; + /* 0x1952C */ bool mPreventCancellingSelection; /* 0x19530 */ s32 mCurrentPouchNavTarget; - /* 0x19534 */ s32 mCurrentlyHoldingItemSlot; + /* 0x19534 */ s32 mCurrentlyHoldingItemSlot; // encoded with SLOT_STOCK_OFFSET /* 0x19538 */ s32 mStateStep; /* 0x1953C */ s32 mCursorLocation; - /* 0x19540 */ UNKWORD field_0x19540; + /* 0x19540 */ s32 mCurrentlyHoldingStockOrPouchSlot; // always raw slot /* 0x19544 */ s32 mItemSellValue; - /* 0x19548 */ UNKWORD field_0x19548; - /* 0x1954C */ UNKWORD field_0x1954C; - /* 0x19550 */ UNKWORD field_0x19550; - /* 0x19554 */ UNKWORD field_0x19554; + /* 0x19548 */ UNKWORD field_0x19548; // always -1 + /* 0x1954C */ s32 mNextLocation; + /* 0x19550 */ s32 mChangeCooldown; + /* 0x19554 */ s32 mDroppedStockSlot; /* 0x19558 */ u8 mPouchItemIds[RING_NUM_ITEMS]; }; diff --git a/include/d/lyt/d_lyt_deposit_stock.h b/include/d/lyt/d_lyt_deposit_stock.h index 4948c250..a24d1848 100644 --- a/include/d/lyt/d_lyt_deposit_stock.h +++ b/include/d/lyt/d_lyt_deposit_stock.h @@ -34,8 +34,8 @@ public: return mLyt.getName(); } - void nextPage(bool unk); - void prevPage(bool unk); + void nextPage(bool preventCancellingSelection); + void prevPage(bool preventCancellingSelection); void fn_80156530(bool unk); void navigateToItem(); @@ -50,10 +50,11 @@ public: void navigateOffIcon(); void handleNavOrPoint(); - void pickUpItem(s32 slot, bool unk); + void pickUpOrPlaceItem(s32 slot, bool place); void selectNavTarget(s32 idx); void setItem(s32 idx, s32 item); s32 getCurrentSlot() const; + void loadItems(s32 hiddenSlot); STATE_MGR_DEFINE_UTIL_EXECUTESTATE(dLytDepositStock_c); @@ -147,13 +148,20 @@ public: void setMainStock(bool b) { mIsMainStock = b; } + + void onDropItem() { + mPickedUpItemOnThisPage = false; + } -//private: + void setPreventCancellingSelection() { + mPreventCancellingSelection = true; + } + +private: static const s32 NUM_ICONS_PER_PAGE = 12; static const s32 NUM_PAGES = 5; void initIcons(); - void loadItems(s32 hiddenSlot); void loadIcon(s32 idx); void navigateToPouch(); void realizeItem(s32 idx); @@ -173,21 +181,21 @@ public: /* 0x0718 */ dLytCommonIconItem_c mIcons[NUM_ICONS_PER_PAGE]; /* 0x6778 */ d2d::SubPaneList mSubpaneList; /* 0x6784 */ d2d::SubPaneListNode mNodes[NUM_ICONS_PER_PAGE]; - /* 0x6844 */ bool field_0x6844; + /* 0x6844 */ bool mIsIdle; /* 0x6845 */ bool mIsModePouch; /* 0x6846 */ bool mIsModeSell; /* 0x6847 */ bool mIsModeSort; /* 0x6848 */ bool mIsModeFinish; /* 0x6849 */ bool mIsSellBlocked; /* 0x684A */ bool mIsSortBlocked; - /* 0x684B */ bool field_0x684B; - /* 0x684C */ bool field_0x684C; + /* 0x684B */ bool mPreventCancellingSelection; + /* 0x684C */ bool mPrevPointerVisible; /* 0x684D */ bool mIsMainStock; - /* 0x684E */ bool field_0x684E; + /* 0x684E */ bool mPickedUpItemOnThisPage; /* 0x6850 */ s32 mCurrentNavTarget; - /* 0x6854 */ UNKWORD field_0x6854; + /* 0x6854 */ s32 mNumSlots; /* 0x6858 */ s32 mSelectedItemId; - /* 0x685C */ UNKWORD field_0x685C; + /* 0x685C */ s32 mPickedUpIdx; /* 0x6860 */ s32 mArrowDirection; /* 0x6864 */ s32 mSavedArrowDirection; /* 0x6868 */ s32 mNavMode; diff --git a/src/d/lyt/d_lyt_deposit.cpp b/src/d/lyt/d_lyt_deposit.cpp index 96735737..b71367c1 100644 --- a/src/d/lyt/d_lyt_deposit.cpp +++ b/src/d/lyt/d_lyt_deposit.cpp @@ -164,7 +164,7 @@ void dLytDepositMain_c::executeState_ModeIn() { mStock[STOCK_ACTIVE].fn_80156530(false); mCurrentPouchNavTarget = -RING_NUM_ITEMS; dCsBase_c::GetInstance()->setCursorStickTargetPane(mpRingBoundings[0]); - field_0x1954C = 0; + mNextLocation = dLytDepositBoxCursor_c::LOC_POUCH; mIsIdle = true; } } @@ -184,7 +184,7 @@ void dLytDepositMain_c::executeState_ModeIn() { target += NUM_ICONS_PER_PAGE; } dCsBase_c::GetInstance()->setCursorStickTargetPane(mpItemBoundings[target]); - field_0x1954C = 1; + mNextLocation = dLytDepositBoxCursor_c::LOC_STOCK; mIsIdle = true; } } @@ -213,8 +213,8 @@ void dLytDepositMain_c::executeState_ModeChange() { if (mIsIdle) { checkSort(); checkPointToPouch(); - if (field_0x19550 != 0) { - field_0x19550--; + if (mChangeCooldown != 0) { + mChangeCooldown--; } else { mStock[STOCK_ACTIVE].handleNavOrPoint(); if (!mStock[STOCK_ACTIVE].isModeSort()) { @@ -268,7 +268,7 @@ void dLytDepositMain_c::executeState_ModeChange() { mpBoundingCleanUp->SetVisible(true); mStock[STOCK_ACTIVE].fn_80156530(true); setPouchItemsVisible(false); - field_0x1954C = 1; + mNextLocation = dLytDepositBoxCursor_c::LOC_STOCK; mStock[STOCK_ACTIVE].returnToNoneMode(); s32 target = mStock[STOCK_ACTIVE].getCurrentNavTarget(); if (target < 0) { @@ -280,7 +280,7 @@ void dLytDepositMain_c::executeState_ModeChange() { } showCursor(); updateStockCursor(); - field_0x19550 = 1; + mChangeCooldown = 1; mIsIdle = true; } } @@ -294,7 +294,7 @@ void dLytDepositMain_c::executeState_ModeArrangement() { mAnm[DEPOSIT_ANIM_BTN_DECIDE_01].setAnimEnable(false); loadStockItems(mCurrentlyHoldingItemSlot - SLOT_STOCK_OFFSET); mStock[STOCK_ACTIVE].fn_80156530(true); - field_0x1954C = 1; + mNextLocation = dLytDepositBoxCursor_c::LOC_STOCK; mIsIdle = true; } } @@ -311,7 +311,7 @@ void dLytDepositMain_c::executeState_ModeReverseChange() { mpBoundingCleanUp->SetVisible(false); setPouchItemsVisible(true); mStock[STOCK_ACTIVE].fn_80156530(false); - field_0x1954C = 0; + mNextLocation = dLytDepositBoxCursor_c::LOC_POUCH; mStateStep = 1; } } else { @@ -332,20 +332,20 @@ void dLytDepositMain_c::executeState_ModeScroll() { mLyt.calc(); mAnm[DEPOSIT_ANIM_SCROLL_R].setAnimEnable(false); for (int i = 0; i < NUM_STOCKS; i++) { - mStock[i].nextPage(field_0x1952C); + mStock[i].nextPage(mPreventCancellingSelection); mStock[i].loadItems(currentlyHeldSlot); } mStock[STOCK_ACTIVE].fn_80156530(true); - field_0x1954C = 1; + mNextLocation = dLytDepositBoxCursor_c::LOC_STOCK; loadPageText(); showCursor(); if (mStock[STOCK_ACTIVE].getArrowDirection() >= dLytCommonArrow_c::ARROW_NONE) { updateStockCursor(); } - field_0x1952C = true; + mPreventCancellingSelection = true; mIsIdle = true; - } else if (!mHasScrolledOtherStocks && mAnm[DEPOSIT_ANIM_SCROLL_R].getFrame() >= 2.0f) { - mHasScrolledOtherStocks = true; + } else if (!mHasHandledScrollTempItems && mAnm[DEPOSIT_ANIM_SCROLL_R].getFrame() >= 2.0f) { + mHasHandledScrollTempItems = true; u8 oldPage = mStock[2].getPage(); mStock[2].setPage(mStock[1].getPage()); mStock[2].nextPage(false); @@ -358,20 +358,20 @@ void dLytDepositMain_c::executeState_ModeScroll() { mLyt.calc(); mAnm[DEPOSIT_ANIM_SCROLL_L].setAnimEnable(false); for (int i = 0; i < NUM_STOCKS; i++) { - mStock[i].prevPage(field_0x1952C); + mStock[i].prevPage(mPreventCancellingSelection); mStock[i].loadItems(currentlyHeldSlot); } mStock[STOCK_ACTIVE].fn_80156530(true); - field_0x1954C = 1; + mNextLocation = dLytDepositBoxCursor_c::LOC_STOCK; loadPageText(); showCursor(); if (mStock[STOCK_ACTIVE].getArrowDirection() >= dLytCommonArrow_c::ARROW_NONE) { updateStockCursor(); } - field_0x1952C = true; + mPreventCancellingSelection = true; mIsIdle = true; - } else if (!mHasScrolledOtherStocks && mAnm[DEPOSIT_ANIM_SCROLL_L].getFrame() >= 2.0f) { - mHasScrolledOtherStocks = true; + } else if (!mHasHandledScrollTempItems && mAnm[DEPOSIT_ANIM_SCROLL_L].getFrame() >= 2.0f) { + mHasHandledScrollTempItems = true; u8 oldPage = mStock[1].getPage(); mStock[1].setPage(mStock[2].getPage()); mStock[1].prevPage(false); @@ -392,7 +392,7 @@ void dLytDepositMain_c::executeState_ModeRecycle() { mLyt.calc(); dCsBase_c::GetInstance()->setVisible(false); dPadNav::setNavEnabled(false, false); - if (field_0x1954C != 0) { + if (mNextLocation != dLytDepositBoxCursor_c::LOC_POUCH) { mArrow.requestOut(); mStateStep = 2; } else { @@ -434,7 +434,7 @@ void dLytDepositMain_c::executeState_ModeArrangementOut() { mAnm[DEPOSIT_ANIM_BTN_ON_OFF_01].setFrame(0.0f); mLyt.calc(); mAnm[DEPOSIT_ANIM_BTN_ON_OFF_01].setAnimEnable(false); - field_0x19528 = true; + mIsArrangementDone = true; mStock[STOCK_ACTIVE].disableModeSort(); mStock[STOCK_ACTIVE].navigateToItem(); mIsIdle = true; @@ -596,30 +596,30 @@ bool dLytDepositMain_c::build(d2d::ResAccIf_c *resAcc) { mIsFinishActive = false; mIsSellActive = false; mIsSortActive = false; - field_0x19526 = false; + mIsRecycleActive = false; field_0x19527 = false; - field_0x19528 = false; - mHasScrolledOtherStocks = false; - field_0x1952A = true; - field_0x1952B = false; - field_0x1952C = true; + mIsArrangementDone = false; + mHasHandledScrollTempItems = false; + mPrevPointerVisible = true; + mDidDropCancelItem = false; + mPreventCancellingSelection = true; mCurrentPouchNavTarget = -1; mCurrentlyHoldingItemSlot = -1; mStateStep = 0; mCursorLocation = dLytDepositBoxCursor_c::LOC_POUCH; - field_0x19540 = 0; + mCurrentlyHoldingStockOrPouchSlot = 0; mItemSellValue = 0; field_0x19548 = -1; - field_0x1954C = 0; - field_0x19550 = 0; - field_0x19554 = 0; + mNextLocation = dLytDepositBoxCursor_c::LOC_POUCH; + mChangeCooldown = 0; + mDroppedStockSlot = 0; return true; } bool dLytDepositMain_c::execute() { - field_0x1952B = false; + mDidDropCancelItem = false; mCsHitCheck.resetCachedHitboxes(); mCsHitCheck.execute(); @@ -659,7 +659,7 @@ bool dLytDepositMain_c::execute() { mArrow.setTranslate(&v); mArrow.execute(); - field_0x1952A = dPadNav::isPointerVisible(); + mPrevPointerVisible = dPadNav::isPointerVisible(); return true; } @@ -810,7 +810,7 @@ void dLytDepositMain_c::setModeReverseChange() { mLyt.calc(); mStock[STOCK_ACTIVE].navigateOffIcon(); - mStock[STOCK_ACTIVE].field_0x684B = true; + mStock[STOCK_ACTIVE].setPreventCancellingSelection(); mStock[STOCK_ACTIVE].fn_80156530(false); mStock[STOCK_ACTIVE].navigateToItem(); mStock[STOCK_ACTIVE].returnToNoneMode(); @@ -833,13 +833,13 @@ void dLytDepositMain_c::setModeScroll(bool leftRight, bool viaButton) { } mLyt.calc(); mStock[STOCK_ACTIVE].navigateOffIcon(); - mStock[STOCK_ACTIVE].field_0x684B = true; + mStock[STOCK_ACTIVE].setPreventCancellingSelection(); mStock[STOCK_ACTIVE].fn_80156530(false); if (viaButton) { mArrow.triggerArrowPress(); } hideCursor(); - mHasScrolledOtherStocks = false; + mHasHandledScrollTempItems = false; mStateMgr.changeState(StateID_ModeScroll); mIsIdle = false; } @@ -849,10 +849,10 @@ void dLytDepositMain_c::setModeRecycle() { mAnm[DEPOSIT_ANIM_BTN_DECIDE_02].setFrame(0.0f); mLyt.calc(); mStateStep = 0; - field_0x19526 = true; + mIsRecycleActive = true; field_0x19527 = true; - if (field_0x1954C == 0) { + if (mNextLocation == dLytDepositBoxCursor_c::LOC_POUCH) { setPouchItemsVisible(false); } else { mStock[STOCK_ACTIVE].fn_80156530(false); @@ -868,7 +868,7 @@ void dLytDepositMain_c::setModeArrangementOut() { mAnm[DEPOSIT_ANIM_BTN_DECIDE_01].setAnimEnable(true); mAnm[DEPOSIT_ANIM_BTN_DECIDE_01].setFrame(0.0f); mLyt.calc(); - field_0x19526 = false; + mIsRecycleActive = false; mCursorLocation = dLytDepositBoxCursor_c::LOC_STOCK; field_0x19527 = true; mStateStep = 0; @@ -888,7 +888,7 @@ void dLytDepositMain_c::setModeOut() { mStock[STOCK_ACTIVE].navigateOffIcon(); } - field_0x19526 = false; + mIsRecycleActive = false; field_0x19527 = false; dSndSmallEffectMgr_c::GetInstance()->playSound(SE_S_SHOP_STK_SELECT_DECIDE); @@ -1024,12 +1024,12 @@ void dLytDepositMain_c::loadInitialState() { mIsFinishActive = false; mIsSellActive = false; mIsSortActive = false; - field_0x19526 = false; + mIsRecycleActive = false; field_0x19527 = false; - field_0x19528 = false; + mIsArrangementDone = false; mCursorLocation = dLytDepositBoxCursor_c::LOC_POUCH; - field_0x19540 = 0; + mCurrentlyHoldingStockOrPouchSlot = 0; mItemSellValue = 0; mCurrentPouchNavTarget = -1; @@ -1114,7 +1114,7 @@ void dLytDepositMain_c::checkPouchItems() { !mStock[STOCK_ACTIVE].isModeFinish()) { s32 target = mCurrentPouchNavTarget; s32 direction = dPadNav::getFSStickNavDirection(); - if (target < 0 || field_0x1952A) { + if (target < 0 || mPrevPointerVisible) { if (direction != dPadNav::FS_STICK_NONE || dCsBase_c::GetInstance()->isCursorStickVisible()) { if (target < 0) { target += SLOT_STOCK_OFFSET; @@ -1420,10 +1420,10 @@ void dLytDepositMain_c::checkSellOrFinish() { } else { s32 direction = dPadNav::getFSStickNavDirection(); if (mStock[STOCK_ACTIVE].isModeFinish()) { - if (!mIsFinishActive || field_0x1952A) { + if (!mIsFinishActive || mPrevPointerVisible) { dCsBase_c::GetInstance()->setCursorStickTargetPane(mpBoundingChoices); updateFlags = 1; - } else if (field_0x1954C == 0) { + } else if (mNextLocation == dLytDepositBoxCursor_c::LOC_POUCH) { switch (direction) { case dPadNav::FS_STICK_UP: case dPadNav::FS_STICK_UP_LEFT: @@ -1461,11 +1461,11 @@ void dLytDepositMain_c::checkSellOrFinish() { } } } else if (mStock[STOCK_ACTIVE].isModeSell()) { - if (!mIsSellActive || field_0x1952A) { + if (!mIsSellActive || mPrevPointerVisible) { dCsBase_c::GetInstance()->setCursorStickTargetPane(mpBoundingItem12); mCursor.activateSell(); updateFlags = 2; - } else if (field_0x1954C == 0) { + } else if (mNextLocation == dLytDepositBoxCursor_c::LOC_POUCH) { switch (direction) { case dPadNav::FS_STICK_UP: case dPadNav::FS_STICK_UP_RIGHT: @@ -1542,7 +1542,7 @@ void dLytDepositMain_c::checkSellOrFinish() { box1->setTextWithGlobalTextProcessor(buf, nullptr); box2->setTextWithGlobalTextProcessor(buf, nullptr); dRumble_c::start(dRumble_c::sRumblePreset1, dRumble_c::FLAG_SLOT0); - if (field_0x1954C != 0) { + if (mNextLocation != dLytDepositBoxCursor_c::LOC_POUCH) { mArrow.setBackwards(false); } } @@ -1555,7 +1555,7 @@ void dLytDepositMain_c::checkSellOrFinish() { mStock[STOCK_ACTIVE].disableModeSell(); mIsSellActive = false; } - if (field_0x1954C != 0) { + if (mNextLocation != dLytDepositBoxCursor_c::LOC_POUCH) { mArrow.setBackwards(true); } } @@ -1635,7 +1635,7 @@ void dLytDepositMain_c::checkSort() { } } else { if (mStock[STOCK_ACTIVE].isModeSort()) { - if (!mIsSortActive || field_0x1952A) { + if (!mIsSortActive || mPrevPointerVisible) { dCsBase_c::GetInstance()->setCursorStickTargetPane(mpBoundingCleanUp); b = true; } else { @@ -1710,7 +1710,7 @@ void dLytDepositMain_c::checkArrows() { } } else { - if (field_0x1952A && mStock[STOCK_ACTIVE].getSavedArrowDirection() < dLytCommonArrow_c::ARROW_NONE) { + if (mPrevPointerVisible && mStock[STOCK_ACTIVE].getSavedArrowDirection() < dLytCommonArrow_c::ARROW_NONE) { s32 dir = mStock[STOCK_ACTIVE].restoreArrowDirection(); if (mStock[STOCK_ACTIVE].getArrowDirection() >= dLytCommonArrow_c::ARROW_NONE) { mArrow.setActiveArrow(dir); @@ -1743,7 +1743,7 @@ void dLytDepositMain_c::checkArrows() { mCursor.updateSlot(loc, slot, LYT_CMN_PouchPotionHealthPlusPlusHalf, false); } mArrow.setActiveArrow(dir); - if (!field_0x1952A) { + if (!mPrevPointerVisible) { switch (dPadNav::getFSStickNavDirection()) { case dPadNav::FS_STICK_UP_RIGHT: case dPadNav::FS_STICK_RIGHT: @@ -1837,7 +1837,7 @@ void dLytDepositMain_c::checkForItemPickupOrDrop() { mPouchItemIds[mCurrentPouchNavTarget] != LYT_CMN_PouchPotionHealthPlusPlusHalf) { // ... and picking up an item from the pouch mCursorLocation = dLytDepositBoxCursor_c::LOC_POUCH; - field_0x19540 = convertLytPouchSlot2(mCurrentPouchNavTarget); + mCurrentlyHoldingStockOrPouchSlot = convertLytPouchSlot2(mCurrentPouchNavTarget); item = getPouchItemIdForIndex(mCurrentPouchNavTarget, false); mCurrentlyHoldingItemSlot = mCurrentPouchNavTarget; mCursor.init(mCursorLocation, mCurrentPouchNavTarget, mPouchItemIds[mCurrentPouchNavTarget], false); @@ -1857,16 +1857,16 @@ void dLytDepositMain_c::checkForItemPickupOrDrop() { // ... and picking up an item from the stock s32 stockSlot = mStock[STOCK_ACTIVE].getCurrentSlot(); mCursorLocation = dLytDepositBoxCursor_c::LOC_STOCK; - field_0x19540 = stockSlot; + mCurrentlyHoldingStockOrPouchSlot = stockSlot; item = FileManager::GetInstance()->getItemCheckItem(stockSlot); mCurrentlyHoldingItemSlot = stockSlot + SLOT_STOCK_OFFSET; mCursor.init( mCursorLocation, stockSlot, mStock[STOCK_ACTIVE].getItem(mStock[STOCK_ACTIVE].getCurrentNavTarget()), false ); - mStock[STOCK_ACTIVE].pickUpItem(stockSlot, false); + mStock[STOCK_ACTIVE].pickUpOrPlaceItem(stockSlot, false); loadItemText(-1, dLytDepositBoxCursor_c::LOC_STOCK); - field_0x19554 = 0; + mDroppedStockSlot = 0; dSndSmallEffectMgr_c::GetInstance()->playSound(SE_S_SHOP_STK_STOCK_CHACH_ITEM); anyPickup = true; } @@ -1927,9 +1927,8 @@ void dLytDepositMain_c::checkForItemPickupOrDrop() { loadStockItems(-1); loadPouchItem(mCurrentPouchNavTarget); - mStock[STOCK_ACTIVE].field_0x684E = false; for (int i = 0; i < NUM_STOCKS; i++) { - mStock[i].field_0x684E = false; + mStock[i].onDropItem(); } } @@ -1943,12 +1942,11 @@ void dLytDepositMain_c::checkForItemPickupOrDrop() { } else if (mStock[STOCK_ACTIVE].getCurrentNavTarget() >= 0 && mStock[STOCK_ACTIVE].getActiveItem() != LYT_CMN_PouchPotionHealthPlusPlusHalf) { // ... and dropping the item into the stock - s32 slot = mStock[STOCK_ACTIVE].getCurrentSlot(); - field_0x19554 = slot; + mDroppedStockSlot = mStock[STOCK_ACTIVE].getCurrentSlot(); s32 item = mStock[STOCK_ACTIVE].getActiveItem(); if (mCurrentlyHoldingItemSlot < SLOT_STOCK_OFFSET) { // Source item is from pouch, so move item from pouch to stock - swapStockAndPouchItems(convertLytPouchSlot(mCurrentlyHoldingItemSlot), field_0x19554); + swapStockAndPouchItems(convertLytPouchSlot(mCurrentlyHoldingItemSlot), mDroppedStockSlot); mStock[STOCK_ACTIVE].setItem( mStock[STOCK_ACTIVE].getCurrentNavTarget(), mPouchItemIds[mCurrentlyHoldingItemSlot] ); @@ -1957,20 +1955,20 @@ void dLytDepositMain_c::checkForItemPickupOrDrop() { loadPouchItem(mCurrentlyHoldingItemSlot); } else { // Source item is from stock, so swap stock items - swapStockItems(mCurrentlyHoldingItemSlot - SLOT_STOCK_OFFSET, slot); + swapStockItems(mCurrentlyHoldingItemSlot - SLOT_STOCK_OFFSET, mDroppedStockSlot); loadStockItems(-1); if (!dPadNav::isPointerVisible()) { - mStock[STOCK_ACTIVE].field_0x684B = true; + mStock[STOCK_ACTIVE].setPreventCancellingSelection(); } mStock[STOCK_ACTIVE].fn_80156530(true); - field_0x1954C = 1; - if (field_0x19554 == mCurrentlyHoldingItemSlot - SLOT_STOCK_OFFSET) { + mNextLocation = dLytDepositBoxCursor_c::LOC_STOCK; + if (mDroppedStockSlot == mCurrentlyHoldingItemSlot - SLOT_STOCK_OFFSET) { b2 = true; } } for (int i = 0; i < NUM_STOCKS; i++) { - mStock[i].field_0x684E = false; + mStock[i].onDropItem(); } if (item != LYT_CMN_PouchBlank4 && !b2) { @@ -2003,7 +2001,7 @@ void dLytDepositMain_c::checkForItemPickupOrDrop() { mAnm[DEPOSIT_ANIM_RECYCLE].setBackwardsOnce(); mStock[STOCK_ACTIVE].disableModeSell(); mIsSellActive = false; - if (field_0x1954C == 0) { + if (mNextLocation == dLytDepositBoxCursor_c::LOC_POUCH) { // TODO: Why is this not >= ... if (mCurrentlyHoldingItemSlot > SLOT_STOCK_OFFSET) { selectPouchSlot(0); @@ -2026,9 +2024,10 @@ void dLytDepositMain_c::checkForItemPickupOrDrop() { // dropped pouch item, show pouch pane mRingNodes[mCurrentlyHoldingItemSlot].mpPane->SetVisible(true); } else { - mStock[STOCK_ACTIVE].pickUpItem(mCurrentlyHoldingItemSlot - SLOT_STOCK_OFFSET, true); + // dropped stock item + mStock[STOCK_ACTIVE].pickUpOrPlaceItem(mCurrentlyHoldingItemSlot - SLOT_STOCK_OFFSET, true); loadStockItems(-1); - mStock[STOCK_ACTIVE].field_0x684B = true; + mStock[STOCK_ACTIVE].setPreventCancellingSelection(); mStock[STOCK_ACTIVE].fn_80156530(true); } mCurrentlyHoldingItemSlot = -1; @@ -2039,7 +2038,7 @@ void dLytDepositMain_c::checkForItemPickupOrDrop() { mAnm[DEPOSIT_ANIM_INPUT_01].setBackwardsOnce(); mCursor.setVisible(false); mItemSellValue = 0; - field_0x1952B = 1; + mDidDropCancelItem = true; } } } diff --git a/src/d/lyt/d_lyt_deposit_stock.cpp b/src/d/lyt/d_lyt_deposit_stock.cpp index 8702be8d..3d3602c3 100644 --- a/src/d/lyt/d_lyt_deposit_stock.cpp +++ b/src/d/lyt/d_lyt_deposit_stock.cpp @@ -18,7 +18,7 @@ STATE_DEFINE(dLytDepositStock_c, None); void dLytDepositStock_c::initializeState_None() {} void dLytDepositStock_c::executeState_None() { - field_0x6844 = true; + mIsIdle = true; } void dLytDepositStock_c::finalizeState_None() {} @@ -92,13 +92,13 @@ bool dLytDepositStock_c::build(d2d::ResAccIf_c *resAcc) { mCurrentNavTarget = -12; mSelectedItemId = -1; - field_0x685C = -1; + mPickedUpIdx = -1; mIsSellBlocked = false; mIsSortBlocked = false; - field_0x684B = false; - field_0x684C = true; - field_0x684E = false; + mPreventCancellingSelection = false; + mPrevPointerVisible = true; + mPickedUpItemOnThisPage = false; mArrowDirection = dLytCommonArrow_c::ARROW_NONE; @@ -115,7 +115,7 @@ bool dLytDepositStock_c::build(d2d::ResAccIf_c *resAcc) { } bool dLytDepositStock_c::execute() { - for (int i = 0; i < field_0x6854; i++) { + for (int i = 0; i < mNumSlots; i++) { mNodes[i].mpLytPane->execute(); } @@ -135,7 +135,7 @@ bool dLytDepositStock_c::execute() { mLyt.calc(); - field_0x684C = dPadNav::isPointerVisible(); + mPrevPointerVisible = dPadNav::isPointerVisible(); return true; } @@ -181,7 +181,7 @@ void dLytDepositStock_c::initIcons() { } } - for (int i = 0; i < field_0x6854; i++) { + for (int i = 0; i < mNumSlots; i++) { mNodes[i].mpPane->SetVisible(false); } } @@ -189,8 +189,8 @@ void dLytDepositStock_c::initIcons() { void dLytDepositStock_c::loadItems(s32 hiddenSlot) { s32 slot = mItemPage * NUM_ICONS_PER_PAGE; - field_0x6854 = 0; - field_0x684E = false; + mNumSlots = 0; + mPickedUpItemOnThisPage = false; for (int i = 0; i < NUM_ICONS_PER_PAGE; i++) { mIcons[i].reset(); @@ -214,7 +214,7 @@ void dLytDepositStock_c::loadItems(s32 hiddenSlot) { mAnm[i + DEPOSIT_STOCK_ANIM_HAVE_BOX_OFFSET].setAnimEnable(false); slot++; - field_0x6854++; + mNumSlots++; } } @@ -241,21 +241,21 @@ void dLytDepositStock_c::loadIcon(s32 idx) { } } -void dLytDepositStock_c::nextPage(bool unk) { +void dLytDepositStock_c::nextPage(bool preventCancellingSelection) { mItemPage++; if (mItemPage >= NUM_PAGES) { mItemPage = 0; } - field_0x684B = unk; + mPreventCancellingSelection = preventCancellingSelection; } -void dLytDepositStock_c::prevPage(bool unk) { +void dLytDepositStock_c::prevPage(bool preventCancellingSelection) { if (mItemPage != 0) { mItemPage--; } else { mItemPage = NUM_PAGES - 1; } - field_0x684B = unk; + mPreventCancellingSelection = preventCancellingSelection; } void dLytDepositStock_c::fn_80156530(bool unk) { @@ -263,7 +263,7 @@ void dLytDepositStock_c::fn_80156530(bool unk) { mIcons[i].setVisible(unk); } - if (!field_0x684B) { + if (!mPreventCancellingSelection) { if (mCurrentNavTarget >= 0) { mAnm[mCurrentNavTarget + DEPOSIT_STOCK_ANIM_FLASH_OFFSET].setAnimEnable(true); mSelectedItemId = -1; @@ -271,7 +271,7 @@ void dLytDepositStock_c::fn_80156530(bool unk) { mCurrentNavTarget = -10; } - field_0x684B = false; + mPreventCancellingSelection = false; mIsModePouch = false; mIsModeSell = false; if (!mIsModeSort) { @@ -301,7 +301,7 @@ void dLytDepositStock_c::handleNavOrPoint() { handleSpecialNavMode(); } else if (!mIsModePouch && !mIsModeSell && !mIsModeSort && !mIsModeFinish && mSavedArrowDirection >= 2) { s32 target = mCurrentNavTarget; - if (target < 0 || field_0x684C) { + if (target < 0 || mPrevPointerVisible) { if (dir != dPadNav::FS_STICK_NONE || dCsBase_c::GetInstance()->isCursorStickVisible()) { if (target < 0) { target += NUM_ICONS_PER_PAGE; @@ -533,7 +533,7 @@ void dLytDepositStock_c::setItem(s32 idx, s32 item) { mItemIds[idx] = item; realizeItem(idx); mIcons[idx].setOn(); - field_0x684E = false; + mPickedUpItemOnThisPage = false; } void dLytDepositStock_c::realizeItem(s32 idx) { @@ -567,37 +567,37 @@ void dLytDepositStock_c::selectNavTarget(s32 idx) { } } -void dLytDepositStock_c::pickUpItem(s32 slot, bool unk) { +void dLytDepositStock_c::pickUpOrPlaceItem(s32 slot, bool place) { s32 page = slot / NUM_ICONS_PER_PAGE; s32 idx = slot % NUM_ICONS_PER_PAGE; - if (unk) { - mNodes[idx].mpPane->SetVisible(unk); + if (place) { + mNodes[idx].mpPane->SetVisible(place); } if (mItemPage != page) { - if (unk) { - field_0x684E = false; + if (place) { + mPickedUpItemOnThisPage = false; } } else { s32 item = mItemIds[idx]; f32 frame; - if (unk) { + if (place) { // TODO why LYT_CMN_PouchPotionHealthPlusPlusHalf if (item != LYT_CMN_PouchPotionHealthPlusPlusHalf && item != LYT_CMN_PouchBlank4) { frame = 1.0f; - if (field_0x684E) { - s32 otherIdx = field_0x685C % NUM_ICONS_PER_PAGE; + if (mPickedUpItemOnThisPage) { + s32 otherIdx = mPickedUpIdx % NUM_ICONS_PER_PAGE; mIcons[idx].setItem(mItemIds[otherIdx]); - field_0x684E = false; + mPickedUpItemOnThisPage = false; } } else { frame = 0.0f; } - field_0x685C = -1; + mPickedUpIdx = -1; } else { - field_0x685C = slot; + mPickedUpIdx = slot; frame = 0.0f; - field_0x684E = true; + mPickedUpItemOnThisPage = true; mIcons[idx].setOff(); mIcons[idx].setHasNumber(false); mIcons[idx].setItem(LYT_CMN_PouchBlank4); From f92efc28d6a1baf457be6ee14d7e30a1054819f1 Mon Sep 17 00:00:00 2001 From: robojumper Date: Thu, 25 Dec 2025 20:54:57 +0100 Subject: [PATCH 08/11] Drop lbl symbol --- config/SOUE01/symbols.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/config/SOUE01/symbols.txt b/config/SOUE01/symbols.txt index 1c12078b..0c98094c 100644 --- a/config/SOUE01/symbols.txt +++ b/config/SOUE01/symbols.txt @@ -37487,7 +37487,6 @@ __vt__57sFStateMgr_c<18dLytDepositStock_c,20sStateMethodUsr_FI_c> = .data:0x8053 __vt__87sStateMgr_c<18dLytDepositStock_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c> = .data:0x8053D7E8; // type:object size:0x30 scope:weak __vt__34sFStateFct_c<18dLytDepositStock_c> = .data:0x8053D818; // type:object size:0x14 scope:weak __vt__31sFState_c<18dLytDepositStock_c> = .data:0x8053D830; // type:object size:0x18 scope:weak -lbl_8053D848 = .data:0x8053D848; // type:object size:0x164 @32336 = .data:0x8053D9AC; // type:object size:0xC scope:local @32337 = .data:0x8053D9B8; // type:object size:0xC scope:local @32338 = .data:0x8053D9C4; // type:object size:0xC scope:local From fa31853d1b3b828ab63567d66e31b7e3bd23134c Mon Sep 17 00:00:00 2001 From: robojumper Date: Sat, 24 Jan 2026 10:59:54 +0100 Subject: [PATCH 09/11] Apply suggestions from code review Co-authored-by: Elijah Thomas <42302100+elijah-thomas774@users.noreply.github.com> --- include/d/lyt/d_lyt_deposit.h | 6 +++--- include/d/lyt/d_lyt_deposit_box_cursor.h | 2 +- src/d/lyt/d_lyt_deposit.cpp | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/d/lyt/d_lyt_deposit.h b/include/d/lyt/d_lyt_deposit.h index e9a7128b..22689646 100644 --- a/include/d/lyt/d_lyt_deposit.h +++ b/include/d/lyt/d_lyt_deposit.h @@ -229,9 +229,9 @@ private: STATE_MGR_DEFINE_UTIL_ISSTATE(dLytDeposit_c); STATE_MGR_DEFINE_UTIL_CHANGESTATE(dLytDeposit_c); - /* 0x08C */ UI_STATE_MGR_DECLARE(dLytDeposit_c); - /* 0x0C8 */ d2d::ResAccIf_c mResAcc; - /* 0x438 */ dLytDepositMain_c mMain; + /* 0x0008C */ UI_STATE_MGR_DECLARE(dLytDeposit_c); + /* 0x000C8 */ d2d::ResAccIf_c mResAcc; + /* 0x00438 */ dLytDepositMain_c mMain; /* 0x19998 */ bool mInRequest; /* 0x19999 */ bool mIsMovingOut; /* 0x1999A */ bool mScrollViaArrowButton; diff --git a/include/d/lyt/d_lyt_deposit_box_cursor.h b/include/d/lyt/d_lyt_deposit_box_cursor.h index 67aced0d..a79d13d4 100644 --- a/include/d/lyt/d_lyt_deposit_box_cursor.h +++ b/include/d/lyt/d_lyt_deposit_box_cursor.h @@ -56,7 +56,7 @@ private: /* 0x930 */ d2d::SubPaneList mSubpaneList; /* 0x938 */ d2d::SubPaneListNode mNode; /* 0x948 */ bool mIsVisible; - /* 0x948 */ bool mIsSellMode; + /* 0x949 */ bool mIsSellMode; /* 0x94C */ s32 mSlot; /* 0x950 */ s32 mItem; /* 0x954 */ s32 mItemLocation; diff --git a/src/d/lyt/d_lyt_deposit.cpp b/src/d/lyt/d_lyt_deposit.cpp index b71367c1..7f3c082c 100644 --- a/src/d/lyt/d_lyt_deposit.cpp +++ b/src/d/lyt/d_lyt_deposit.cpp @@ -641,7 +641,7 @@ bool dLytDepositMain_c::execute() { for (int i = 0; i < DEPOSIT_ANIM_HAVE_OFFSET; i++) { if (mAnm[i].isEnabled()) { - if (i >= 19 && i <= 23) { + if (i >= DEPOSIT_ANIM_INPUT_00 && i <= DEPOSIT_ANIM_INPUT_01) { if (mAnm[i].isStop()) { mAnm[i].setAnimEnable(false); } From 0d7a72be97c756425b93c9a96da212d6a5d0faeb Mon Sep 17 00:00:00 2001 From: robojumper Date: Sat, 24 Jan 2026 11:03:02 +0100 Subject: [PATCH 10/11] constant --- include/d/lyt/d_lyt_deposit_box_cursor.h | 2 ++ src/d/lyt/d_lyt_deposit_box_cursor.cpp | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/include/d/lyt/d_lyt_deposit_box_cursor.h b/include/d/lyt/d_lyt_deposit_box_cursor.h index a79d13d4..82f1175e 100644 --- a/include/d/lyt/d_lyt_deposit_box_cursor.h +++ b/include/d/lyt/d_lyt_deposit_box_cursor.h @@ -45,6 +45,8 @@ public: } private: + static const s32 NUM_ICONS_PER_PAGE = 12; + void initIcon(); void realizeNav(); diff --git a/src/d/lyt/d_lyt_deposit_box_cursor.cpp b/src/d/lyt/d_lyt_deposit_box_cursor.cpp index f337a068..4cf9dda1 100644 --- a/src/d/lyt/d_lyt_deposit_box_cursor.cpp +++ b/src/d/lyt/d_lyt_deposit_box_cursor.cpp @@ -164,7 +164,7 @@ void dLytDepositBoxCursor_c::init(s32 location, s32 slot, s32 item, bool isSell) number = getDepositItemAmount(slot); durability = getDepositShieldDurability(slot); color = getDepositItemNumberColor(slot); - mSlot = slot % 12; + mSlot = slot % NUM_ICONS_PER_PAGE; } if (number < 0) { @@ -195,7 +195,7 @@ void dLytDepositBoxCursor_c::updateSlot(s32 location, s32 slot, s32 item, bool i if (mItemLocation == LOC_POUCH) { mSlot = slot; } else { - mSlot = slot % 12; + mSlot = slot % NUM_ICONS_PER_PAGE; } } From 2952e7568f6d0c2ab7c12bbdaa8d274fee619adc Mon Sep 17 00:00:00 2001 From: robojumper Date: Sat, 24 Jan 2026 11:06:03 +0100 Subject: [PATCH 11/11] oop --- src/d/lyt/d_lyt_deposit.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/d/lyt/d_lyt_deposit.cpp b/src/d/lyt/d_lyt_deposit.cpp index 7f3c082c..37fbd33b 100644 --- a/src/d/lyt/d_lyt_deposit.cpp +++ b/src/d/lyt/d_lyt_deposit.cpp @@ -641,7 +641,7 @@ bool dLytDepositMain_c::execute() { for (int i = 0; i < DEPOSIT_ANIM_HAVE_OFFSET; i++) { if (mAnm[i].isEnabled()) { - if (i >= DEPOSIT_ANIM_INPUT_00 && i <= DEPOSIT_ANIM_INPUT_01) { + if (i >= DEPOSIT_ANIM_BTN_ON_OFF_00 && i <= DEPOSIT_ANIM_INPUT_01) { if (mAnm[i].isStop()) { mAnm[i].setAnimEnable(false); }