diff --git a/config/SOUE01/splits.txt b/config/SOUE01/splits.txt index 854423a1..d1acb77e 100644 --- a/config/SOUE01/splits.txt +++ b/config/SOUE01/splits.txt @@ -391,7 +391,11 @@ d/lyt/meter/d_lyt_meter_plus_btn.cpp: d/lyt/meter/d_lyt_meter_minus_btn.cpp: .text start:0x800F4770 end:0x800F8D98 .ctors start:0x804DB708 end:0x804DB70C + .rodata start:0x804E61A0 end:0x804E62A8 .data start:0x80516C90 end:0x80517818 + .sdata start:0x80572418 end:0x80572480 + .sdata2 start:0x80579C08 end:0x80579C18 + .bss start:0x805AB750 end:0x805ABC90 d/lyt/meter/d_lyt_meter_cross_btn.cpp: .text start:0x800F8DA0 end:0x800FAFC8 @@ -687,6 +691,9 @@ d/lyt/d_lyt_save_msg_window.cpp: .text start:0x80164F90 end:0x80166968 .ctors start:0x804DB7A8 end:0x804DB7AC +d/lyt/d_lyt_util_items.cpp: + .text start:0x80166970 end:0x80167FD4 + d/lyt/d_lyt_common_arrow.cpp: .text start:0x80167FE0 end:0x801695E8 .ctors start:0x804DB7AC end:0x804DB7B0 @@ -779,6 +786,9 @@ d/a/d_a_door_base.cpp: d/lyt/d_lyt_map_popup.cpp: .text start:0x801792D0 end:0x80189F9C +d/d_pouch.cpp: + .text start:0x80189FA0 end:0x8018B4A4 + d/a/d_a_fish_mgr_base.cpp: .text start:0x8018B880 end:0x8018BFC8 .ctors start:0x804DB7E4 end:0x804DB7E8 diff --git a/config/SOUE01/symbols.txt b/config/SOUE01/symbols.txt index b083a3c1..1f62c0f2 100644 --- a/config/SOUE01/symbols.txt +++ b/config/SOUE01/symbols.txt @@ -312,7 +312,7 @@ getAngleT3__11FileManagerFv = .text:0x8000B080; // type:function size:0x44 setPouchData__11FileManagerFiUl = .text:0x8000B0D0; // type:function size:0x54 getPouchData__11FileManagerFi = .text:0x8000B130; // type:function size:0x74 setPouchItem__11FileManagerFi7ITEM_ID = .text:0x8000B1B0; // type:function size:0x6C -getPouchItem__11FileManagerFi = .text:0x8000B220; // type:function size:0x24 +getPouchItem__11FileManagerFl = .text:0x8000B220; // type:function size:0x24 setPouchUpperData__11FileManagerFii = .text:0x8000B250; // type:function size:0x6C getPouchUpperData__11FileManagerFi = .text:0x8000B2C0; // type:function size:0x24 setItemCheckData__11FileManagerFUlUl = .text:0x8000B2F0; // type:function size:0x70 @@ -907,7 +907,7 @@ fn_80026F10__13EffectsStructFv = .text:0x80026F10; // type:function size:0x3C fn_80026F50 = .text:0x80026F50; // type:function size:0xD8 fn_80027030 = .text:0x80027030; // type:function size:0xD8 fn_80027110 = .text:0x80027110; // type:function size:0xC8 -fn_800271E0 = .text:0x800271E0; // type:function size:0x44 +fn_800271E0__13EffectsStructFP7mVec3_cP7mAng3_cP7mVec3_c = .text:0x800271E0; // type:function size:0x44 setMtx__13EffectsStructFRC6mMtx_c = .text:0x80027230; // type:function size:0x78 fn_800272B0 = .text:0x800272B0; // type:function size:0x70 fn_80027320__13EffectsStructFUc = .text:0x80027320; // type:function size:0x40 @@ -964,7 +964,7 @@ fn_800298B0 = .text:0x800298B0; // type:function size:0x4 fn_800298C0__13EffectsStructFUsP7mVec3_cPvPvPvPv = .text:0x800298C0; // type:function size:0x4C fn_80029910 = .text:0x80029910; // type:function size:0x4 fn_80029920 = .text:0x80029920; // type:function size:0x54 -fn_80029980 = .text:0x80029980; // type:function size:0x64 +fn_80029980__13EffectsStructFUsP7mVec3_cP7mAng3_cP7mVec3_cPvPv = .text:0x80029980; // type:function size:0x64 fn_800299F0__13EffectsStructFUsP6mMtx_cPvPv = .text:0x800299F0; // type:function size:0x20 fn_80029A10__13EffectsStructFUsP7mVec3_cP7mAng3_cP7mVec3_cPvPv = .text:0x80029A10; // type:function size:0x54 fn_80029A70__13EffectsStructFUsP7mVec3_cP7mAng3_cP7mVec3_cPvPv = .text:0x80029A70; // type:function size:0x64 @@ -4500,8 +4500,8 @@ fn_800C9F20 = .text:0x800C9F20; // type:function size:0x44 fn_800C9F70 = .text:0x800C9F70; // type:function size:0x70 fn_800C9FE0 = .text:0x800C9FE0; // type:function size:0x60 fn_800CA040 = .text:0x800CA040; // type:function size:0x60 -fn_800CA0A0 = .text:0x800CA0A0; // type:function size:0x1C -hasSavedAfterCredits = .text:0x800CA0C0; // type:function size:0x38 +setUiMode__11dLytMeter_cCFUs = .text:0x800CA0A0; // type:function size:0x1C +getUiMode__11dLytMeter_cFv = .text:0x800CA0C0; // type:function size:0x38 __ct__11dLytMeter_cFv = .text:0x800CA100; // type:function size:0x1C0 __ct__Q23d2d10ResAccIf_cFv = .text:0x800CA2C0; // type:function size:0x6C __ct__Q23d2d10AnmGroup_cFv = .text:0x800CA330; // type:function size:0x84 @@ -5957,91 +5957,91 @@ getPane__18dLytMeterPlusBtn_cFv = .text:0x800F4330; // type:function size:0x8 __sinit_\d_lyt_meter_plus_btn_cpp = .text:0x800F4340; // type:function size:0x338 scope:local __dt__33sFStateID_c<18dLytMeterPlusBtn_c>Fv = .text:0x800F4680; // type:function size:0x58 isSameName__33sFStateID_c<18dLytMeterPlusBtn_c>CFPCc = .text:0x800F46E0; // type:function size:0x88 -fn_800F4770 = .text:0x800F4770; // type:function size:0x4 -fn_800F4780 = .text:0x800F4780; // type:function size:0x8C -fn_800F4810 = .text:0x800F4810; // type:function size:0x4 -fn_800F4820 = .text:0x800F4820; // type:function size:0x4 -fn_800F4830 = .text:0x800F4830; // type:function size:0xCC -fn_800F4900 = .text:0x800F4900; // type:function size:0x4 -fn_800F4910 = .text:0x800F4910; // type:function size:0x4 -fn_800F4920 = .text:0x800F4920; // type:function size:0x98 -fn_800F49C0 = .text:0x800F49C0; // type:function size:0x4 -fn_800F49D0 = .text:0x800F49D0; // type:function size:0x4 -fn_800F49E0 = .text:0x800F49E0; // type:function size:0x84 -fn_800F4A70 = .text:0x800F4A70; // type:function size:0x4 -fn_800F4A80 = .text:0x800F4A80; // type:function size:0x6C -fn_800F4AF0 = .text:0x800F4AF0; // type:function size:0x10 -fn_800F4B00 = .text:0x800F4B00; // type:function size:0x4 -fn_800F4B10 = .text:0x800F4B10; // type:function size:0x8C -fn_800F4BA0 = .text:0x800F4BA0; // type:function size:0x4 -fn_800F4BB0 = .text:0x800F4BB0; // type:function size:0x4 -fn_800F4BC0 = .text:0x800F4BC0; // type:function size:0x9C -fn_800F4C60 = .text:0x800F4C60; // type:function size:0x4 -fn_800F4C70 = .text:0x800F4C70; // type:function size:0x4 -fn_800F4C80 = .text:0x800F4C80; // type:function size:0x98 -fn_800F4D20 = .text:0x800F4D20; // type:function size:0x4 -fn_800F4D30 = .text:0x800F4D30; // type:function size:0x4 -fn_800F4D40 = .text:0x800F4D40; // type:function size:0x84 -fn_800F4DD0 = .text:0x800F4DD0; // type:function size:0x4 -fn_800F4DE0 = .text:0x800F4DE0; // type:function size:0x48 -fn_800F4E30 = .text:0x800F4E30; // type:function size:0x10 -fn_800F4E40 = .text:0x800F4E40; // type:function size:0x4 -fn_800F4E50 = .text:0x800F4E50; // type:function size:0x8C -fn_800F4EE0 = .text:0x800F4EE0; // type:function size:0x4 -fn_800F4EF0 = .text:0x800F4EF0; // type:function size:0x4 -fn_800F4F00 = .text:0x800F4F00; // type:function size:0x9C -fn_800F4FA0 = .text:0x800F4FA0; // type:function size:0x4 -fn_800F4FB0 = .text:0x800F4FB0; // type:function size:0x4 -fn_800F4FC0 = .text:0x800F4FC0; // type:function size:0x98 -fn_800F5060 = .text:0x800F5060; // type:function size:0x4 -fn_800F5070 = .text:0x800F5070; // type:function size:0x4 -fn_800F5080 = .text:0x800F5080; // type:function size:0x84 -fn_800F5110 = .text:0x800F5110; // type:function size:0x4 -fn_800F5120 = .text:0x800F5120; // type:function size:0x48 -fn_800F5170 = .text:0x800F5170; // type:function size:0x10 -fn_800F5180 = .text:0x800F5180; // type:function size:0x4 -fn_800F5190 = .text:0x800F5190; // type:function size:0x78 -fn_800F5210 = .text:0x800F5210; // type:function size:0x4 -fn_800F5220 = .text:0x800F5220; // type:function size:0x34C -fn_800F5570 = .text:0x800F5570; // type:function size:0x1B8 -fn_800F5730 = .text:0x800F5730; // type:function size:0xC -fn_800F5740 = .text:0x800F5740; // type:function size:0x4 -fn_800F5750 = .text:0x800F5750; // type:function size:0x100 -fn_800F5850 = .text:0x800F5850; // type:function size:0x4 -fn_800F5860 = .text:0x800F5860; // type:function size:0x60 -fn_800F58C0 = .text:0x800F58C0; // type:function size:0x80 -fn_800F5940 = .text:0x800F5940; // type:function size:0x4 -fn_800F5950 = .text:0x800F5950; // type:function size:0x60 -fn_800F59B0 = .text:0x800F59B0; // type:function size:0xDC -fn_800F5A90 = .text:0x800F5A90; // type:function size:0xC -fn_800F5AA0 = .text:0x800F5AA0; // type:function size:0x60 -fn_800F5B00 = .text:0x800F5B00; // type:function size:0xC4 -fn_800F5BD0 = .text:0x800F5BD0; // type:function size:0xC -fn_800F5BE0 = .text:0x800F5BE0; // type:function size:0xC -fn_800F5BF0 = .text:0x800F5BF0; // type:function size:0x158 -fn_800F5D50 = .text:0x800F5D50; // type:function size:0x4 -fn_800F5D60 = .text:0x800F5D60; // type:function size:0x5C0 -fn_800F6320 = .text:0x800F6320; // type:function size:0x3D4 -fn_800F6700 = .text:0x800F6700; // type:function size:0x4 -fn_800F6710 = .text:0x800F6710; // type:function size:0x60 -fn_800F6770 = .text:0x800F6770; // type:function size:0x84 -fn_800F6800 = .text:0x800F6800; // type:function size:0x4 -fn_800F6810 = .text:0x800F6810; // type:function size:0x414 -fn_800F6C30 = .text:0x800F6C30; // type:function size:0xE4 -fn_800F6D20 = .text:0x800F6D20; // type:function size:0x534 -fn_800F7260 = .text:0x800F7260; // type:function size:0x8 -fn_800F7270 = .text:0x800F7270; // type:function size:0x84 -fn_800F7300 = .text:0x800F7300; // type:function size:0x1E4 -fn_800F74F0 = .text:0x800F74F0; // type:function size:0xEC -fn_800F75E0 = .text:0x800F75E0; // type:function size:0x14 -fn_800F7600 = .text:0x800F7600; // type:function size:0x158 -fn_800F7760 = .text:0x800F7760; // type:function size:0xA8 -fn_800F7810 = .text:0x800F7810; // type:function size:0x38 -fn_800F7850 = .text:0x800F7850; // type:function size:0xA8 -fn_800F7900 = .text:0x800F7900; // type:function size:0x74 -fn_800F7980 = .text:0x800F7980; // type:function size:0x54 -fn_800F79E0 = .text:0x800F79E0; // type:function size:0x8 -fn_800F79F0 = .text:0x800F79F0; // type:function size:0x8 +initializeState_Wait__27dLytMeterMinusBtnMenuIcon_cFv = .text:0x800F4770; // type:function size:0x4 +executeState_Wait__27dLytMeterMinusBtnMenuIcon_cFv = .text:0x800F4780; // type:function size:0x8C +finalizeState_Wait__27dLytMeterMinusBtnMenuIcon_cFv = .text:0x800F4810; // type:function size:0x4 +initializeState_On__27dLytMeterMinusBtnMenuIcon_cFv = .text:0x800F4820; // type:function size:0x4 +executeState_On__27dLytMeterMinusBtnMenuIcon_cFv = .text:0x800F4830; // type:function size:0xCC +finalizeState_On__27dLytMeterMinusBtnMenuIcon_cFv = .text:0x800F4900; // type:function size:0x4 +initializeState_Select__27dLytMeterMinusBtnMenuIcon_cFv = .text:0x800F4910; // type:function size:0x4 +executeState_Select__27dLytMeterMinusBtnMenuIcon_cFv = .text:0x800F4920; // type:function size:0x98 +finalizeState_Select__27dLytMeterMinusBtnMenuIcon_cFv = .text:0x800F49C0; // type:function size:0x4 +initializeState_Off__27dLytMeterMinusBtnMenuIcon_cFv = .text:0x800F49D0; // type:function size:0x4 +executeState_Off__27dLytMeterMinusBtnMenuIcon_cFv = .text:0x800F49E0; // type:function size:0x84 +finalizeState_Off__27dLytMeterMinusBtnMenuIcon_cFv = .text:0x800F4A70; // type:function size:0x4 +init__27dLytMeterMinusBtnMenuIcon_cFv = .text:0x800F4A80; // type:function size:0x6C +execute__27dLytMeterMinusBtnMenuIcon_cFv = .text:0x800F4AF0; // type:function size:0x10 +initializeState_Wait__24dLytMeterMinusBtnBlink_cFv = .text:0x800F4B00; // type:function size:0x4 +executeState_Wait__24dLytMeterMinusBtnBlink_cFv = .text:0x800F4B10; // type:function size:0x8C +finalizeState_Wait__24dLytMeterMinusBtnBlink_cFv = .text:0x800F4BA0; // type:function size:0x4 +initializeState_On__24dLytMeterMinusBtnBlink_cFv = .text:0x800F4BB0; // type:function size:0x4 +executeState_On__24dLytMeterMinusBtnBlink_cFv = .text:0x800F4BC0; // type:function size:0x9C +finalizeState_On__24dLytMeterMinusBtnBlink_cFv = .text:0x800F4C60; // type:function size:0x4 +initializeState_Select__24dLytMeterMinusBtnBlink_cFv = .text:0x800F4C70; // type:function size:0x4 +executeState_Select__24dLytMeterMinusBtnBlink_cFv = .text:0x800F4C80; // type:function size:0x98 +finalizeState_Select__24dLytMeterMinusBtnBlink_cFv = .text:0x800F4D20; // type:function size:0x4 +initializeState_Off__24dLytMeterMinusBtnBlink_cFv = .text:0x800F4D30; // type:function size:0x4 +executeState_Off__24dLytMeterMinusBtnBlink_cFv = .text:0x800F4D40; // type:function size:0x84 +finalizeState_Off__24dLytMeterMinusBtnBlink_cFv = .text:0x800F4DD0; // type:function size:0x4 +init__24dLytMeterMinusBtnBlink_cFv = .text:0x800F4DE0; // type:function size:0x48 +execute__24dLytMeterMinusBtnBlink_cFv = .text:0x800F4E30; // type:function size:0x10 +initializeState_Wait__23dLytMeterMinusBtnText_cFv = .text:0x800F4E40; // type:function size:0x4 +executeState_Wait__23dLytMeterMinusBtnText_cFv = .text:0x800F4E50; // type:function size:0x8C +finalizeState_Wait__23dLytMeterMinusBtnText_cFv = .text:0x800F4EE0; // type:function size:0x4 +initializeState_On__23dLytMeterMinusBtnText_cFv = .text:0x800F4EF0; // type:function size:0x4 +executeState_On__23dLytMeterMinusBtnText_cFv = .text:0x800F4F00; // type:function size:0x9C +finalizeState_On__23dLytMeterMinusBtnText_cFv = .text:0x800F4FA0; // type:function size:0x4 +initializeState_Select__23dLytMeterMinusBtnText_cFv = .text:0x800F4FB0; // type:function size:0x4 +executeState_Select__23dLytMeterMinusBtnText_cFv = .text:0x800F4FC0; // type:function size:0x98 +finalizeState_Select__23dLytMeterMinusBtnText_cFv = .text:0x800F5060; // type:function size:0x4 +initializeState_Off__23dLytMeterMinusBtnText_cFv = .text:0x800F5070; // type:function size:0x4 +executeState_Off__23dLytMeterMinusBtnText_cFv = .text:0x800F5080; // type:function size:0x84 +finalizeState_Off__23dLytMeterMinusBtnText_cFv = .text:0x800F5110; // type:function size:0x4 +init__23dLytMeterMinusBtnText_cFv = .text:0x800F5120; // type:function size:0x48 +execute__23dLytMeterMinusBtnText_cFv = .text:0x800F5170; // type:function size:0x10 +initializeState_Wait__19dLytMeterMinusBtn_cFv = .text:0x800F5180; // type:function size:0x4 +executeState_Wait__19dLytMeterMinusBtn_cFv = .text:0x800F5190; // type:function size:0x78 +finalizeState_Wait__19dLytMeterMinusBtn_cFv = .text:0x800F5210; // type:function size:0x4 +initializeState_MenuSelectingIn__19dLytMeterMinusBtn_cFv = .text:0x800F5220; // type:function size:0x34C +executeState_MenuSelectingIn__19dLytMeterMinusBtn_cFv = .text:0x800F5570; // type:function size:0x1B8 +finalizeState_MenuSelectingIn__19dLytMeterMinusBtn_cFv = .text:0x800F5730; // type:function size:0xC +initializeState_MenuSelecting__19dLytMeterMinusBtn_cFv = .text:0x800F5740; // type:function size:0x4 +executeState_MenuSelecting__19dLytMeterMinusBtn_cFv = .text:0x800F5750; // type:function size:0x100 +finalizeState_MenuSelecting__19dLytMeterMinusBtn_cFv = .text:0x800F5850; // type:function size:0x4 +initializeState_MenuSelectingOut__19dLytMeterMinusBtn_cFv = .text:0x800F5860; // type:function size:0x60 +executeState_MenuSelectingOut__19dLytMeterMinusBtn_cFv = .text:0x800F58C0; // type:function size:0x80 +finalizeState_MenuSelectingOut__19dLytMeterMinusBtn_cFv = .text:0x800F5940; // type:function size:0x4 +initializeState_ToUse__19dLytMeterMinusBtn_cFv = .text:0x800F5950; // type:function size:0x60 +executeState_ToUse__19dLytMeterMinusBtn_cFv = .text:0x800F59B0; // type:function size:0xDC +finalizeState_ToUse__19dLytMeterMinusBtn_cFv = .text:0x800F5A90; // type:function size:0xC +initializeState_ToUnuse__19dLytMeterMinusBtn_cFv = .text:0x800F5AA0; // type:function size:0x60 +executeState_ToUnuse__19dLytMeterMinusBtn_cFv = .text:0x800F5B00; // type:function size:0xC4 +finalizeState_ToUnuse__19dLytMeterMinusBtn_cFv = .text:0x800F5BD0; // type:function size:0xC +initializeState_Unuse__19dLytMeterMinusBtn_cFv = .text:0x800F5BE0; // type:function size:0xC +executeState_Unuse__19dLytMeterMinusBtn_cFv = .text:0x800F5BF0; // type:function size:0x158 +finalizeState_Unuse__19dLytMeterMinusBtn_cFv = .text:0x800F5D50; // type:function size:0x4 +initializeState_DemoMove__19dLytMeterMinusBtn_cFv = .text:0x800F5D60; // type:function size:0x5C0 +executeState_DemoMove__19dLytMeterMinusBtn_cFv = .text:0x800F6320; // type:function size:0x3D4 +finalizeState_DemoMove__19dLytMeterMinusBtn_cFv = .text:0x800F6700; // type:function size:0x4 +initializeState_DemoOut__19dLytMeterMinusBtn_cFv = .text:0x800F6710; // type:function size:0x60 +executeState_DemoOut__19dLytMeterMinusBtn_cFv = .text:0x800F6770; // type:function size:0x84 +finalizeState_DemoOut__19dLytMeterMinusBtn_cFv = .text:0x800F6800; // type:function size:0x4 +build__19dLytMeterMinusBtn_cFPQ23d2d10ResAccIf_c = .text:0x800F6810; // type:function size:0x414 +remove__19dLytMeterMinusBtn_cFv = .text:0x800F6C30; // type:function size:0xE4 +execute__19dLytMeterMinusBtn_cFv = .text:0x800F6D20; // type:function size:0x534 +getPane__19dLytMeterMinusBtn_cFv = .text:0x800F7260; // type:function size:0x8 +shouldCall__19dLytMeterMinusBtn_cCFv = .text:0x800F7270; // type:function size:0x84 +fn_800F7300__19dLytMeterMinusBtn_cFv = .text:0x800F7300; // type:function size:0x1E4 +demoRelated__19dLytMeterMinusBtn_cFl = .text:0x800F74F0; // type:function size:0xEC +fn_800F75E0__19dLytMeterMinusBtn_cCFv = .text:0x800F75E0; // type:function size:0x14 +fn_800F7600__19dLytMeterMinusBtn_cCFv = .text:0x800F7600; // type:function size:0x158 +fn_800F7760__19dLytMeterMinusBtn_cCFv = .text:0x800F7760; // type:function size:0xA8 +isUnequippable__19dLytMeterMinusBtn_cCFl = .text:0x800F7810; // type:function size:0x38 +setItemText__19dLytMeterMinusBtn_cFl = .text:0x800F7850; // type:function size:0xA8 +realizeShieldDurability__19dLytMeterMinusBtn_cFv = .text:0x800F7900; // type:function size:0x74 +isNotMedalOrExtraAmmo__19dLytMeterMinusBtn_cFl = .text:0x800F7980; // type:function size:0x54 +getName__19dLytMeterMinusBtn_cCFv = .text:0x800F79E0; // type:function size:0x8 +getLyt__19dLytMeterMinusBtn_cFv = .text:0x800F79F0; // type:function size:0x8 __sinit_\d_lyt_meter_minus_btn_cpp = .text:0x800F7A00; // type:function size:0xFD8 scope:local __dt__42sFStateID_c<27dLytMeterMinusBtnMenuIcon_c>Fv = .text:0x800F89E0; // type:function size:0x58 __dt__39sFStateID_c<24dLytMeterMinusBtnBlink_c>Fv = .text:0x800F8A40; // type:function size:0x58 @@ -9128,16 +9128,16 @@ LytSaveMsgWindow__state_dtor = .text:0x80166880; // type:function size:0x58 fn_801668E0 = .text:0x801668E0; // type:function size:0x88 fn_80166970 = .text:0x80166970; // type:function size:0x58 fn_801669D0 = .text:0x801669D0; // type:function size:0x4 -fn_801669E0 = .text:0x801669E0; // type:function size:0x50 +hasPouchSlot__Flb = .text:0x801669E0; // type:function size:0x50 fn_80166A30 = .text:0x80166A30; // type:function size:0x5C -fn_80166A90 = .text:0x80166A90; // type:function size:0x70 -fn_80166B00 = .text:0x80166B00; // type:function size:0x8C +getPouchItemForSlot__Flb = .text:0x80166A90; // type:function size:0x70 +getPouchItemAmount__Flb = .text:0x80166B00; // type:function size:0x8C fn_80166B90 = .text:0x80166B90; // type:function size:0xBC fn_80166C50 = .text:0x80166C50; // type:function size:0x48 fn_80166CA0 = .text:0x80166CA0; // type:function size:0x48 -fn_80166CF0 = .text:0x80166CF0; // type:function size:0x84 -isPouchUsable2 = .text:0x80166D80; // type:function size:0x34 -fn_80166DC0 = .text:0x80166DC0; // type:function size:0xC8 +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 @@ -10070,14 +10070,14 @@ fn_80189B80 = .text:0x80189B80; // type:function size:0x4 fn_80189B90 = .text:0x80189B90; // type:function size:0x27C fn_80189E10 = .text:0x80189E10; // type:function size:0xF4 fn_80189F10 = .text:0x80189F10; // type:function size:0x8C -getPouchSlotCount = .text:0x80189FA0; // type:function size:0x6C +getPouchSlotCount__Fb = .text:0x80189FA0; // type:function size:0x6C isPouchItem = .text:0x8018A010; // type:function size:0x88 isItemShield = .text:0x8018A0A0; // type:function size:0x18 -isItemExtraAmmo = .text:0x8018A0C0; // type:function size:0x18 +isItemExtraAmmo__Fl = .text:0x8018A0C0; // type:function size:0x18 fn_8018A0E0 = .text:0x8018A0E0; // type:function size:0x20 fn_8018A100 = .text:0x8018A100; // type:function size:0x20 fn_8018A120 = .text:0x8018A120; // type:function size:0x20 -isItemMedal = .text:0x8018A140; // type:function size:0x4C +isItemMedal__Fl = .text:0x8018A140; // type:function size:0x4C isItemPotion = .text:0x8018A190; // type:function size:0x7C isOtherItemInBottle = .text:0x8018A210; // type:function size:0x6C isItemAnyRevitalizingPotion = .text:0x8018A280; // type:function size:0x28 @@ -10089,8 +10089,8 @@ tryCollectPouchItemInPouch = .text:0x8018A520; // type:function size:0x60 collectPouchItem = .text:0x8018A580; // type:function size:0xD0 adventurePouchFindItemSlot = .text:0x8018A650; // type:function size:0x84 adventurePouchCountItem = .text:0x8018A6E0; // type:function size:0x74 -fn_8018A760 = .text:0x8018A760; // type:function size:0x1C -fn_8018A780 = .text:0x8018A780; // type:function size:0xAC +convertLytPouchSlot__Fl = .text:0x8018A760; // type:function size:0x1C +convertFilePouchSlot__Fl = .text:0x8018A780; // type:function size:0xAC fn_8018A830 = .text:0x8018A830; // type:function size:0x16C fn_8018A9A0 = .text:0x8018A9A0; // type:function size:0x7C changeItemPouchExtensionCounter = .text:0x8018AA20; // type:function size:0x10C @@ -31571,7 +31571,7 @@ lbl_80517084 = .data:0x80517084; // type:object size:0xC lbl_80517090 = .data:0x80517090; // type:object size:0xC lbl_8051709C = .data:0x8051709C; // type:object size:0x14 data:string lbl_805170B0 = .data:0x805170B0; // type:object size:0x10 -__vt__19dLytMeterMinusBtn_c = .data:0x805170C0; // type:object size:0x688 +__vt__19dLytMeterMinusBtn_c = .data:0x805170C0; // type:object size:0x34 __vt__38sFStateID_c<23dLytMeterMinusBtnText_c> = .data:0x80517748; // type:object size:0x34 __vt__39sFStateID_c<24dLytMeterMinusBtnBlink_c> = .data:0x8051777C; // type:object size:0x34 __vt__42sFStateID_c<27dLytMeterMinusBtnMenuIcon_c> = .data:0x805177B0; // type:object size:0x34 diff --git a/include/d/d_pouch.h b/include/d/d_pouch.h new file mode 100644 index 00000000..a65d0097 --- /dev/null +++ b/include/d/d_pouch.h @@ -0,0 +1,12 @@ +#ifndef D_POUCH_H +#define D_POUCH_H + +#include "common.h" + +u32 convertFilePouchSlot(s32 fileSlot); +s32 convertLytPouchSlot(s32 fileSlot); +s32 getPouchSlotCount(bool unk); +bool isItemExtraAmmo(s32 item); +bool isItemMedal(s32 item); + +#endif diff --git a/include/d/lyt/d_lyt_util_items.h b/include/d/lyt/d_lyt_util_items.h new file mode 100644 index 00000000..17675393 --- /dev/null +++ b/include/d/lyt/d_lyt_util_items.h @@ -0,0 +1,14 @@ +#ifndef D_LYT_UTIL_ITEMS_H +#define D_LYT_UTIL_ITEMS_H + +#include "common.h" + +bool isPouchBocoburinLocked(); + +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); + +#endif diff --git a/include/d/lyt/meter/d_lyt_meter.h b/include/d/lyt/meter/d_lyt_meter.h index 7078a9e5..dadff933 100644 --- a/include/d/lyt/meter/d_lyt_meter.h +++ b/include/d/lyt/meter/d_lyt_meter.h @@ -49,10 +49,17 @@ public: bool isSilentRealm(); + void setUiMode(u16 value) const; + u8 getUiMode(); + u8 getField_0x13792() const { return field_0x13792; } + u8 getField_0x13793() const { + return field_0x13793; + } + u8 getField_0x1377E() const { return field_0x1377E; } @@ -109,7 +116,8 @@ public: /* 0x1377E */ u8 field_0x1377E; /* 0x1377F */ u8 field_0x1375F[0x13792 - 0x1377F]; /* 0x13792 */ u8 field_0x13792; - /* 0x13793 */ u8 field_0x13793[0x137B4 - 0x13793]; + /* 0x13793 */ u8 field_0x13793; + /* 0x13794 */ u8 field_0x13794[0x137B4 - 0x13794]; /* 0x137B4 */ mVec3_c mPos3; /* 0x137C0 */ u32 field_0x137C0; }; @@ -168,6 +176,10 @@ public: return (mFlags & mask) == mask; } + void clearFlags(u32 mask) { + mFlags = mFlags & ~mask; + } + static s32 getCrossBtn0x7BF8() { if (sInstance != nullptr) { return sInstance->mMeter.mCrossBtn.getField_0x620(); diff --git a/include/d/lyt/meter/d_lyt_meter_minus_btn.h b/include/d/lyt/meter/d_lyt_meter_minus_btn.h index 94889bb9..59c7c6a3 100644 --- a/include/d/lyt/meter/d_lyt_meter_minus_btn.h +++ b/include/d/lyt/meter/d_lyt_meter_minus_btn.h @@ -3,8 +3,10 @@ #include "d/lyt/d2d.h" #include "d/lyt/d_lyt_common_icon_item.h" +#include "d/lyt/d_textbox.h" +#include "d/lyt/d_window.h" +#include "nw4r/lyt/lyt_pane.h" #include "s/s_State.hpp" -#include "s/s_StateMgr.hpp" #include "toBeSorted/effects_struct.h" // At 0x8, [8], size 0x48 @@ -13,16 +15,28 @@ public: dLytMeterMinusBtnMenuIcon_c() : mStateMgr(*this, sStateID::null) {} virtual ~dLytMeterMinusBtnMenuIcon_c() {} + void init(); + void execute(); + + void setAnm(d2d::AnmGroup_c *anim) { + mpAnm = anim; + } + + void setShouldBeSelect(u32 v) { + mShouldBeSelect = v; + } + private: STATE_FUNC_DECLARE(dLytMeterMinusBtnMenuIcon_c, Wait); STATE_FUNC_DECLARE(dLytMeterMinusBtnMenuIcon_c, On); STATE_FUNC_DECLARE(dLytMeterMinusBtnMenuIcon_c, Select); STATE_FUNC_DECLARE(dLytMeterMinusBtnMenuIcon_c, Off); - UI_STATE_MGR_DECLARE(dLytMeterMinusBtnMenuIcon_c); +private: + /* 0x04 */ UI_STATE_MGR_DECLARE(dLytMeterMinusBtnMenuIcon_c); - u32 padding2; - u32 padding3; + /* 0x40 */ d2d::AnmGroup_c *mpAnm; + /* 0x44 */ u32 mShouldBeSelect; }; // At 0x248, standalone @@ -31,16 +45,27 @@ public: dLytMeterMinusBtnBlink_c() : mStateMgr(*this, sStateID::null) {} ~dLytMeterMinusBtnBlink_c() {} + void init(); + void execute(); + + void setAnm(d2d::AnmGroup_c *anim) { + mpAnm = anim; + } + + void setShouldBeSelect(u32 v) { + mShouldBeSelect = v; + } + private: STATE_FUNC_DECLARE(dLytMeterMinusBtnBlink_c, Wait); STATE_FUNC_DECLARE(dLytMeterMinusBtnBlink_c, On); STATE_FUNC_DECLARE(dLytMeterMinusBtnBlink_c, Select); STATE_FUNC_DECLARE(dLytMeterMinusBtnBlink_c, Off); - UI_STATE_MGR_DECLARE(dLytMeterMinusBtnBlink_c); + /* 0x00 */ UI_STATE_MGR_DECLARE(dLytMeterMinusBtnBlink_c); - u32 padding; - u32 padding2; + /* 0x3C */ d2d::AnmGroup_c *mpAnm; + /* 0x40 */ u32 mShouldBeSelect; }; // At 0x28C, [2], size 0x44 @@ -49,16 +74,27 @@ public: dLytMeterMinusBtnText_c() : mStateMgr(*this, sStateID::null) {} ~dLytMeterMinusBtnText_c() {} + void init(); + void execute(); + + void setAnm(d2d::AnmGroup_c *anim) { + mpAnm = anim; + } + + void setShouldBeSelect(u32 v) { + mShouldBeSelect = v; + } + private: STATE_FUNC_DECLARE(dLytMeterMinusBtnText_c, Wait); STATE_FUNC_DECLARE(dLytMeterMinusBtnText_c, On); STATE_FUNC_DECLARE(dLytMeterMinusBtnText_c, Select); STATE_FUNC_DECLARE(dLytMeterMinusBtnText_c, Off); - UI_STATE_MGR_DECLARE(dLytMeterMinusBtnText_c); + /* 0x00 */ UI_STATE_MGR_DECLARE(dLytMeterMinusBtnText_c); - u32 padding; - u32 padding2; + /* 0x3C */ d2d::AnmGroup_c *mpAnm; + /* 0x40 */ u32 mShouldBeSelect; }; class dLytMeterMinusBtn_c : public d2d::dSubPane { @@ -67,13 +103,35 @@ public: virtual bool build(d2d::ResAccIf_c *resAcc) override; virtual bool remove() override; virtual bool execute() override; - virtual nw4r::lyt::Pane *getPane() override; - virtual d2d::LytBase_c *getLyt() override; - virtual const char *getName() const override; + virtual nw4r::lyt::Pane *getPane() override { + return mLyt.getLayout()->GetRootPane(); + } + virtual d2d::LytBase_c *getLyt() override { + return &mLyt; + } + virtual const char *getName() const override { + return mLyt.getName(); + } virtual ~dLytMeterMinusBtn_c() {} + bool demoRelated(s32 arg); + private: + bool shouldCall() const; + bool fn_800F75E0() const; + void fn_800F7300(); + bool fn_800F7600() const; + bool fn_800F7760() const; + void realizeShieldDurability(); + bool isUnequippable(s32 num) const; + void setItemText(s32 item); + bool isNotMedalOrExtraAmmo(s32 item); + + nw4r::lyt::Pane *getPaneByIndex(s32 idx) const { + return mpPanes[idx]; + } + STATE_FUNC_DECLARE(dLytMeterMinusBtn_c, Wait); STATE_FUNC_DECLARE(dLytMeterMinusBtn_c, MenuSelectingIn); STATE_FUNC_DECLARE(dLytMeterMinusBtn_c, MenuSelecting); @@ -84,33 +142,38 @@ private: STATE_FUNC_DECLARE(dLytMeterMinusBtn_c, DemoMove); STATE_FUNC_DECLARE(dLytMeterMinusBtn_c, DemoOut); - dLytMeterMinusBtnMenuIcon_c mIcon[8]; - dLytMeterMinusBtnBlink_c mBlink; - dLytMeterMinusBtnText_c mText[2]; - UI_STATE_MGR_DECLARE(dLytMeterMinusBtn_c); - - /* 0x490 */ d2d::dLytSub mLyt; - - /* 0x524 */ d2d::AnmGroup_c mAnmGroups[33]; - - // What is here? - u8 padding2[0xE30 - 0xDA4]; - - /* 0xE34 */ dLytCommonIconItem_c mItemIcons[8]; - - d2d::SubPaneList mNodeList; - d2d::SubPaneListNode mNodes[8]; - EffectsStruct mEffects[4]; - - s32 field_0x574C; - s32 field_0x5750; - s32 field_0x5754; - s32 field_0x5758; - s32 field_0x575C; - s32 field_0x5760; - s32 field_0x5764; - s32 field_0x5768; - /* 0x??? */ u8 padding[0x13730 - 0x136D8]; + /* 0x0008 */ dLytMeterMinusBtnMenuIcon_c mIcon[8]; + /* 0x0244 */ dLytMeterMinusBtnBlink_c mBlink; + /* 0x028C */ dLytMeterMinusBtnText_c mText[2]; + /* 0x0314 */ UI_STATE_MGR_DECLARE(dLytMeterMinusBtn_c); + /* 0x0350 */ d2d::dLytSub mLyt; + /* 0x03E4 */ d2d::AnmGroup_c mAnm[33]; + /* 0x0C24 */ nw4r::lyt::Pane *mpPanes[28]; + /* 0x0C94 */ nw4r::lyt::Pane *mpOwnerPane; + /* 0x0C98 */ dWindow_c *mpWindows[2]; + /* 0x0CA0 */ dTextBox_c *mpSizeBoxes[2]; + /* 0x0CA8 */ dTextBox_c *mpTextBoxes[2]; + /* 0x0CB0 */ dLytCommonIconItem_c mItemIcons[8]; + /* 0x4CF0 */ d2d::SubPaneList mSubpaneList; + /* 0x4CFC */ d2d::SubPaneListNode mSubpanes[8]; + /* 0x4D7C */ EffectsStruct mEffects[4]; + /* 0x4E4C */ mAng3_c mEffectsRot[4]; + /* 0x4E64 */ s32 mSlotForEffect[4]; + /* 0x4E74 */ f32 mArrowRotation; + /* 0x4E78 */ f32 mArrowLength; + /* 0x4E7C */ s32 field_0x4E7C; + /* 0x4E80 */ s32 field_0x4E80; + /* 0x4E84 */ s32 field_0x4E84; + /* 0x4E88 */ s32 field_0x4E88; + /* 0x4E8C */ s32 field_0x4E8C; + /* 0x4E90 */ s32 mDemoFrame; + /* 0x4E94 */ s32 mSlotToDemo; + /* 0x4E98 */ s32 field_0x4E98[8]; + /* 0x4EB8 */ u8 field_0x4EB8; + /* 0x4EB9 */ u8 field_0x4EB9; + /* 0x4EBA */ u8 field_0x4EBA; + /* 0x4EBB */ u8 field_0x4EBB[8]; + /* 0x4EC3 */ u8 field_0x4EC3; }; #endif diff --git a/include/m/m_angle.h b/include/m/m_angle.h index 06648b08..84e722b9 100644 --- a/include/m/m_angle.h +++ b/include/m/m_angle.h @@ -140,6 +140,10 @@ public: z = fz; } + void setR(const s32 &f) { + x = y = z = f; + } + mAng x, y, z; static mAng3_c Zero; diff --git a/include/toBeSorted/effects_struct.h b/include/toBeSorted/effects_struct.h index de9b948f..71afbb31 100644 --- a/include/toBeSorted/effects_struct.h +++ b/include/toBeSorted/effects_struct.h @@ -24,6 +24,7 @@ public: void remove(bool); void fn_80027320(u8); + void fn_800271E0(mVec3_c *pos, mAng3_c *rot, mVec3_c *scale); void fn_80029920(u16 effect, mVec3_c *pos, mAng3_c *rot, mVec3_c *scale, void *, void *); void fn_80029980(u16 effect, mVec3_c *pos, mAng3_c *rot, mVec3_c *scale, void *, void *); void fn_800299F0(u16 effect, mMtx_c *mtx, void *, void *); diff --git a/src/d/lyt/meter/d_lyt_meter.cpp b/src/d/lyt/meter/d_lyt_meter.cpp index 02538e79..b98be9a5 100644 --- a/src/d/lyt/meter/d_lyt_meter.cpp +++ b/src/d/lyt/meter/d_lyt_meter.cpp @@ -4,6 +4,7 @@ #include "d/d_sc_game.h" #include "d/d_sc_title.h" #include "d/d_stage_mgr.h" +#include "d/flag/storyflag_manager.h" #include "d/lyt/d_lyt_area_caption.h" #include "d/lyt/d_lyt_meter_configuration.h" #include "d/lyt/d_window.h" @@ -280,6 +281,14 @@ void floats2() { 3.0f; } +void dLytMeter_c::setUiMode(u16 value) const { + StoryflagManager::sInstance->setFlagOrCounterToValue(840, value); +} + +u8 dLytMeter_c::getUiMode() { + return StoryflagManager::sInstance->getFlag(840); +} + #pragma dont_inline on dLytMeter_c::dLytMeter_c() {} #pragma dont_inline reset diff --git a/src/d/lyt/meter/d_lyt_meter_item_select.cpp b/src/d/lyt/meter/d_lyt_meter_item_select.cpp index ca4b9cd3..db7f4868 100644 --- a/src/d/lyt/meter/d_lyt_meter_item_select.cpp +++ b/src/d/lyt/meter/d_lyt_meter_item_select.cpp @@ -92,7 +92,6 @@ void dLytMeterItemSelectIcon_c::finalizeState_On() {} void dLytMeterItemSelectIcon_c::initializeState_Select() {} void dLytMeterItemSelectIcon_c::executeState_Select() { - // Why is this outside of the block? mpAnm->setBackwardsOnce(); mpAnm->setToStart(); mpAnm->setAnimEnable(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 2e388799..ebeddf1f 100644 --- a/src/d/lyt/meter/d_lyt_meter_minus_btn.cpp +++ b/src/d/lyt/meter/d_lyt_meter_minus_btn.cpp @@ -1,5 +1,18 @@ #include "d/lyt/meter/d_lyt_meter_minus_btn.h" +#include "common.h" +#include "d/d_pouch.h" +#include "d/flag/storyflag_manager.h" +#include "d/lyt/d_lyt_common_icon_item_maps.h" +#include "d/lyt/d_lyt_control_game.h" +#include "d/lyt/d_lyt_util_items.h" +#include "d/lyt/meter/d_lyt_meter.h" +#include "nw4r/lyt/lyt_group.h" +#include "nw4r/math/math_types.h" +#include "sized_string.h" +#include "toBeSorted/file_manager.h" +#include "toBeSorted/small_sound_mgr.h" + STATE_DEFINE(dLytMeterMinusBtnMenuIcon_c, Wait); STATE_DEFINE(dLytMeterMinusBtnMenuIcon_c, On); STATE_DEFINE(dLytMeterMinusBtnMenuIcon_c, Select); @@ -24,3 +37,1062 @@ STATE_DEFINE(dLytMeterMinusBtn_c, ToUnuse); STATE_DEFINE(dLytMeterMinusBtn_c, Unuse); STATE_DEFINE(dLytMeterMinusBtn_c, DemoMove); STATE_DEFINE(dLytMeterMinusBtn_c, DemoOut); + +static u32 demoRotIncrement = 0x199A; + +void dLytMeterMinusBtnMenuIcon_c::initializeState_Wait() {} +void dLytMeterMinusBtnMenuIcon_c::executeState_Wait() { + if (mShouldBeSelect != 0) { + mpAnm->setForwardOnce(); + mpAnm->setFrame(0.0f); + mpAnm->setAnimEnable(true); + mStateMgr.changeState(StateID_On); + } +} +void dLytMeterMinusBtnMenuIcon_c::finalizeState_Wait() {} + +void dLytMeterMinusBtnMenuIcon_c::initializeState_On() {} +void dLytMeterMinusBtnMenuIcon_c::executeState_On() { + if (mShouldBeSelect == 0) { + mpAnm->setToEnd(); + } + + if (mpAnm->isEndReached()) { + mpAnm->setAnimEnable(false); + mStateMgr.changeState(StateID_Select); + } + + if (mpAnm->isEnabled()) { + mpAnm->play(); + } +} +void dLytMeterMinusBtnMenuIcon_c::finalizeState_On() {} + +void dLytMeterMinusBtnMenuIcon_c::initializeState_Select() {} +void dLytMeterMinusBtnMenuIcon_c::executeState_Select() { + mpAnm->setBackwardsOnce(); + mpAnm->setToStart(); + mpAnm->setAnimEnable(true); + if (mShouldBeSelect == 0) { + mStateMgr.changeState(StateID_Off); + } +} +void dLytMeterMinusBtnMenuIcon_c::finalizeState_Select() {} + +void dLytMeterMinusBtnMenuIcon_c::initializeState_Off() {} +void dLytMeterMinusBtnMenuIcon_c::executeState_Off() { + if (mpAnm->isStop2()) { + mpAnm->setAnimEnable(false); + mStateMgr.changeState(StateID_Wait); + } + + if (mpAnm->isEnabled()) { + mpAnm->play(); + } +} +void dLytMeterMinusBtnMenuIcon_c::finalizeState_Off() {} + +void dLytMeterMinusBtnMenuIcon_c::init() { + mShouldBeSelect = 0; + mpAnm->setFrame(0.0f); + mStateMgr.changeState(StateID_Wait); +} + +void dLytMeterMinusBtnMenuIcon_c::execute() { + mStateMgr.executeState(); +} + +void dLytMeterMinusBtnBlink_c::initializeState_Wait() {} +void dLytMeterMinusBtnBlink_c::executeState_Wait() { + if (mShouldBeSelect != 0) { + mpAnm->setForwardOnce(); + mpAnm->setFrame(0.0f); + mpAnm->setAnimEnable(true); + mStateMgr.changeState(StateID_On); + } +} +void dLytMeterMinusBtnBlink_c::finalizeState_Wait() {} + +void dLytMeterMinusBtnBlink_c::initializeState_On() {} +void dLytMeterMinusBtnBlink_c::executeState_On() { + if (mpAnm->isEndReached()) { + mpAnm->setAnimEnable(false); + mStateMgr.changeState(StateID_Select); + } + + if (mpAnm->isEnabled()) { + mpAnm->play(); + } +} +void dLytMeterMinusBtnBlink_c::finalizeState_On() {} + +void dLytMeterMinusBtnBlink_c::initializeState_Select() {} +void dLytMeterMinusBtnBlink_c::executeState_Select() { + if (mShouldBeSelect == 0) { + mpAnm->setBackwardsOnce(); + mpAnm->setToStart(); + mpAnm->setAnimEnable(true); + mStateMgr.changeState(StateID_Off); + } +} +void dLytMeterMinusBtnBlink_c::finalizeState_Select() {} + +void dLytMeterMinusBtnBlink_c::initializeState_Off() {} +void dLytMeterMinusBtnBlink_c::executeState_Off() { + if (mpAnm->isStop2()) { + mpAnm->setAnimEnable(false); + mStateMgr.changeState(StateID_Wait); + } + + if (mpAnm->isEnabled()) { + mpAnm->play(); + } +} +void dLytMeterMinusBtnBlink_c::finalizeState_Off() {} + +void dLytMeterMinusBtnBlink_c::init() { + mStateMgr.changeState(StateID_Wait); + mShouldBeSelect = 0; +} + +void dLytMeterMinusBtnBlink_c::execute() { + mStateMgr.executeState(); +} + +void dLytMeterMinusBtnText_c::initializeState_Wait() {} +void dLytMeterMinusBtnText_c::executeState_Wait() { + if (mShouldBeSelect != 0) { + mpAnm->setForwardOnce(); + mpAnm->setFrame(0.0f); + mpAnm->setAnimEnable(true); + mStateMgr.changeState(StateID_On); + } +} +void dLytMeterMinusBtnText_c::finalizeState_Wait() {} + +void dLytMeterMinusBtnText_c::initializeState_On() {} +void dLytMeterMinusBtnText_c::executeState_On() { + if (mpAnm->isEndReached()) { + mpAnm->setAnimEnable(false); + mStateMgr.changeState(StateID_Select); + } + + if (mpAnm->isEnabled()) { + mpAnm->play(); + } +} +void dLytMeterMinusBtnText_c::finalizeState_On() {} + +void dLytMeterMinusBtnText_c::initializeState_Select() {} +void dLytMeterMinusBtnText_c::executeState_Select() { + if (mShouldBeSelect == 0) { + mpAnm->setBackwardsOnce(); + mpAnm->setToStart(); + mpAnm->setAnimEnable(true); + mStateMgr.changeState(StateID_Off); + } +} +void dLytMeterMinusBtnText_c::finalizeState_Select() {} + +void dLytMeterMinusBtnText_c::initializeState_Off() {} +void dLytMeterMinusBtnText_c::executeState_Off() { + if (mpAnm->isStop2()) { + mpAnm->setAnimEnable(false); + mStateMgr.changeState(StateID_Wait); + } + + if (mpAnm->isEnabled()) { + mpAnm->play(); + } +} +void dLytMeterMinusBtnText_c::finalizeState_Off() {} + +void dLytMeterMinusBtnText_c::init() { + mStateMgr.changeState(StateID_Wait); + mShouldBeSelect = 0; +} + +void dLytMeterMinusBtnText_c::execute() { + mStateMgr.executeState(); +} + +static const char *sPaneNames[] = { + "N_itemArrow_00", "N_arrowHand_00", "N_bBtn_00", "N_A_00", "N_B_00", "N_C_00", "N_D_00", + "N_E_00", "N_F_00", "N_G_00", "N_H_00", "N_iconA_00", "N_iconB_00", "N_iconC_00", + "N_iconD_00", "N_iconE_00", "N_iconF_00", "N_iconG_00", "N_iconH_00", "N_textA_00", "N_textB_00", + "N_textC_00", "N_textD_00", "N_textE_00", "N_textF_00", "N_textG_06", "N_textH_07", "N_UIMode_00", +}; + +#define MINUS_BTN_PANE_ITEM_ARROW 0 +#define MINUS_BTN_PANE_ARROW_HAND 1 +#define MINUS_BTN_PANE_N_BTN_0 2 +#define MINUS_BTN_PANE_ITEM_OFFSET 3 +#define MINUS_BTN_PANE_ICON_OFFSET 11 +#define MINUS_BTN_PANE_TEXT_OFFSET 19 +#define MINUS_BTN_PANE_UIMODE 27 + +#define MINUS_BTN_NUM_PANES 28 + +static const d2d::LytBrlanMapping brlanMap[] = { + { "remoConBtn_01_in.brlan", "G_inOut_00"}, + { "remoConBtn_01_onOff.brlan", "G_itemA_00"}, + { "remoConBtn_01_onOff.brlan", "G_itemB_00"}, + { "remoConBtn_01_onOff.brlan", "G_itemC_00"}, + { "remoConBtn_01_onOff.brlan", "G_itemD_00"}, + { "remoConBtn_01_onOff.brlan", "G_itemE_00"}, + { "remoConBtn_01_onOff.brlan", "G_itemF_00"}, + { "remoConBtn_01_onOff.brlan", "G_itemG_00"}, + { "remoConBtn_01_onOff.brlan", "G_itemH_00"}, + { "remoConBtn_01_onOff.brlan", "G_text_00"}, + { "remoConBtn_01_onOff.brlan", "G_text_01"}, + {"remoConBtn_01_selectOnOff.brlan", "G_selectOnOff_00"}, + { "remoConBtn_01_selectLoop.brlan", "G_selectLoop_00"}, + { "remoConBtn_01_have.brlan", "G_itemA_00"}, + { "remoConBtn_01_have.brlan", "G_itemB_00"}, + { "remoConBtn_01_have.brlan", "G_itemC_00"}, + { "remoConBtn_01_have.brlan", "G_itemD_00"}, + { "remoConBtn_01_have.brlan", "G_itemE_00"}, + { "remoConBtn_01_have.brlan", "G_itemF_00"}, + { "remoConBtn_01_have.brlan", "G_itemG_00"}, + { "remoConBtn_01_have.brlan", "G_itemH_00"}, + { "remoConBtn_01_itemArrow.brlan", "G_itemArrow_00"}, + { "remoConBtn_01_equip.brlan", "G_equipA_00"}, + { "remoConBtn_01_equip.brlan", "G_equipB_00"}, + { "remoConBtn_01_equip.brlan", "G_equipC_00"}, + { "remoConBtn_01_equip.brlan", "G_equipD_00"}, + { "remoConBtn_01_equip.brlan", "G_equipE_00"}, + { "remoConBtn_01_equip.brlan", "G_equipF_00"}, + { "remoConBtn_01_equip.brlan", "G_equipG_00"}, + { "remoConBtn_01_equip.brlan", "G_equipH_00"}, + { "remoConBtn_01_decide.brlan", "G_decide_00"}, + { "remoConBtn_01_input.brlan", "G_input_00"}, + { "remoConBtn_01_call.brlan", "G_call_00"}, +}; + +#define MINUS_BTN_ANIM_IN 0 +#define MINUS_BTN_ANIM_ITEM_ONOFF_OFFSET 1 +#define MINUS_BTN_ANIM_TEXT_ONOFF_OFFSET 9 +#define MINUS_BTN_ANIM_SELECT_ONOFF 11 +#define MINUS_BTN_ANIM_SELECT_LOOP 12 +#define MINUS_BTN_ANIM_HAVE_OFFSET 13 +#define MINUS_BTN_ANIM_ARROW 21 +#define MINUS_BTN_ANIM_EQUIP_OFFSET 22 +#define MINUS_BTN_ANIM_DECIDE 30 +#define MINUS_BTN_ANIM_INPUT 31 +#define MINUS_BTN_ANIM_CALL 32 + +#define MINUS_BTN_NUM_ANIMS 33 + +#define MINUS_BTN_NUM_ITEMS 8 + +static const char *sTextboxNames[] = {"T_itemName_00", "T_itemNameS_00"}; + +static const char *sWindowNames[] = { + "W_bgP_01", + "W_bgP_09", +}; + +static const char *sGroupName = "G_ref_00"; + +void dLytMeterMinusBtn_c::initializeState_Wait() {} +void dLytMeterMinusBtn_c::executeState_Wait() { + if (field_0x4E88 == 1) { + mStateMgr.changeState(StateID_DemoMove); + } else if (field_0x4EB8 != 0) { + mStateMgr.changeState(StateID_MenuSelectingIn); + } else if (!dLytMeterContainer_c::GetInstance()->checkAllFlags(0x40)) { + mStateMgr.changeState(StateID_ToUnuse); + } +} +void dLytMeterMinusBtn_c::finalizeState_Wait() {} + +void dLytMeterMinusBtn_c::initializeState_MenuSelectingIn() { + bool locked = isPouchBocoburinLocked(); + mAnm[MINUS_BTN_ANIM_DECIDE].setAnimEnable(true); + mAnm[MINUS_BTN_ANIM_DECIDE].setFrame(0.0f); + + for (int i = 0; i < MINUS_BTN_NUM_ITEMS; i++) { + mpPanes[i + MINUS_BTN_PANE_ICON_OFFSET]->SetVisible(true); + mAnm[i + MINUS_BTN_ANIM_HAVE_OFFSET].setAnimEnable(true); + mAnm[i + MINUS_BTN_ANIM_EQUIP_OFFSET].setAnimEnable(true); + + field_0x4EBB[i] = 0; + field_0x4E98[i] = getPouchItemForSlot(i, true); + if (hasPouchSlot(i, true)) { + mAnm[i + MINUS_BTN_ANIM_HAVE_OFFSET].setFrame(0.0f); + if (field_0x4E98[i] != 0x32) { + s32 amount = getPouchItemAmount(i, true); + if (locked) { + mItemIcons[i].setBocoburinLocked(true); + } else { + mItemIcons[i].setBocoburinLocked(false); + } + + if (amount >= 0 && !locked) { + mItemIcons[i].setHasNumber(true); + mItemIcons[i].setNumber(amount); + mItemIcons[i].setItem(field_0x4E98[i]); + mItemIcons[i].setNumberColor(getPouchItemNumberColor(i, true)); + } else { + mItemIcons[i].setHasNumber(false); + mItemIcons[i].setItem(field_0x4E98[i]); + } + + if (getShieldDurability(i, true) >= 0.0f) { + mItemIcons[i].setShieldDurability(getShieldDurability(i, true)); + if (i == convertFilePouchSlot(FileManager::GetInstance()->getShieldPouchSlot())) { + mItemIcons[i].setShieldOnOff(false); + } else { + mItemIcons[i].setShieldOnOff(true); + field_0x4EBB[i] = 1; + } + } else { + mItemIcons[i].setShieldOnOff(false); + } + } else { + mpPanes[i + MINUS_BTN_PANE_ICON_OFFSET]->SetVisible(false); + } + } else { + mAnm[i + MINUS_BTN_ANIM_HAVE_OFFSET].setFrame(1.0f); + } + + mAnm[i + MINUS_BTN_ANIM_ITEM_ONOFF_OFFSET].setForwardOnce(); + mAnm[i + MINUS_BTN_ANIM_ITEM_ONOFF_OFFSET].setAnimEnable(true); + mAnm[i + MINUS_BTN_ANIM_ITEM_ONOFF_OFFSET].setFrame(0.0f); + mIcon[i].setShouldBeSelect(false); + } + + mLyt.calc(); + mAnm[MINUS_BTN_ANIM_DECIDE].setAnimEnable(false); + mAnm[MINUS_BTN_ANIM_IN].setForwardOnce(); + mAnm[MINUS_BTN_ANIM_IN].setFrame(0.0f); + mAnm[MINUS_BTN_ANIM_IN].setAnimEnable(true); + + for (int i = 0; i < MINUS_BTN_NUM_ITEMS; i++) { + mAnm[i + MINUS_BTN_ANIM_HAVE_OFFSET].setAnimEnable(false); + mAnm[i + MINUS_BTN_ANIM_ITEM_ONOFF_OFFSET].setAnimEnable(false); + } +} +void dLytMeterMinusBtn_c::executeState_MenuSelectingIn() { + realizeShieldDurability(); + for (int i = 0; i < MINUS_BTN_NUM_ITEMS; i++) { + mpPanes[i + MINUS_BTN_PANE_TEXT_OFFSET]->SetVisible(true); + s32 item = getPouchItemForSlot(i, true); + if (i == convertFilePouchSlot(FileManager::GetInstance()->getShieldPouchSlot())) { + mAnm[i + MINUS_BTN_ANIM_EQUIP_OFFSET].setFrame(1.0f); + mpPanes[i + MINUS_BTN_PANE_TEXT_OFFSET]->SetVisible(true); + } else { + if (isUnequippable(item)) { + mAnm[i + MINUS_BTN_ANIM_EQUIP_OFFSET].setFrame(1.0f); + } else { + mAnm[i + MINUS_BTN_ANIM_EQUIP_OFFSET].setFrame(0.0f); + } + mpPanes[i + MINUS_BTN_PANE_TEXT_OFFSET]->SetVisible(false); + } + } + + if (mAnm[MINUS_BTN_ANIM_IN].isEndReached()) { + for (int i = 0; i < MINUS_BTN_NUM_ITEMS; i++) { + mAnm[i + MINUS_BTN_ANIM_EQUIP_OFFSET].setAnimEnable(false); + } + mStateMgr.changeState(StateID_MenuSelecting); + } + if (mAnm[MINUS_BTN_ANIM_IN].isEnabled()) { + mAnm[MINUS_BTN_ANIM_IN].play(); + } +} +void dLytMeterMinusBtn_c::finalizeState_MenuSelectingIn() { + mAnm[MINUS_BTN_ANIM_IN].setAnimEnable(false); +} + +void dLytMeterMinusBtn_c::initializeState_MenuSelecting() {} +void dLytMeterMinusBtn_c::executeState_MenuSelecting() { + realizeShieldDurability(); + for (int i = 0; i < MINUS_BTN_NUM_ITEMS; i++) { + s32 item = getPouchItemForSlot(i, true); + // If our soup turned cold while the menu is open, fix the icon and text + if (hasPouchSlot(i, true) && field_0x4E98[i] == LYT_CMN_PouchPumpkinSoup && + item == LYT_CMN_PouchPumpkinSoupCold) { + field_0x4E98[i] = item; + mItemIcons[i].setItem(item); + mItemIcons[i].setNumberColor(getPouchItemNumberColor(i, true)); + u32 fileSlot = convertLytPouchSlot(i); + setItemText(FileManager::GetInstance()->getPouchItem(fileSlot)); + } + } + + if (field_0x4EB8 == 0) { + mStateMgr.changeState(StateID_MenuSelectingOut); + } +} +void dLytMeterMinusBtn_c::finalizeState_MenuSelecting() {} + +void dLytMeterMinusBtn_c::initializeState_MenuSelectingOut() { + mAnm[MINUS_BTN_ANIM_IN].setBackwardsOnce(); + mAnm[MINUS_BTN_ANIM_IN].setToStart(); + mAnm[MINUS_BTN_ANIM_IN].setAnimEnable(true); +} +void dLytMeterMinusBtn_c::executeState_MenuSelectingOut() { + realizeShieldDurability(); + if (mAnm[MINUS_BTN_ANIM_IN].isStop2()) { + mAnm[MINUS_BTN_ANIM_IN].setAnimEnable(false); + mStateMgr.changeState(StateID_Wait); + } + if (mAnm[MINUS_BTN_ANIM_IN].isEnabled()) { + mAnm[MINUS_BTN_ANIM_IN].play(); + } +} +void dLytMeterMinusBtn_c::finalizeState_MenuSelectingOut() {} + +void dLytMeterMinusBtn_c::initializeState_ToUse() { + mAnm[MINUS_BTN_ANIM_INPUT].setBackwardsOnce(); + mAnm[MINUS_BTN_ANIM_INPUT].setToStart(); + mAnm[MINUS_BTN_ANIM_INPUT].setAnimEnable(true); +} +void dLytMeterMinusBtn_c::executeState_ToUse() { + if (field_0x4EB8 != 0) { + mAnm[MINUS_BTN_ANIM_INPUT].setBackwardsOnce(); + mAnm[MINUS_BTN_ANIM_INPUT].setToEnd2(); + mLyt.calc(); + mStateMgr.changeState(StateID_MenuSelectingIn); + } else { + if (mAnm[MINUS_BTN_ANIM_INPUT].isStop2()) { + mStateMgr.changeState(StateID_Wait); + } + if (mAnm[MINUS_BTN_ANIM_INPUT].isEnabled()) { + mAnm[MINUS_BTN_ANIM_INPUT].play(); + } + } +} +void dLytMeterMinusBtn_c::finalizeState_ToUse() { + mAnm[MINUS_BTN_ANIM_INPUT].setAnimEnable(false); +} + +void dLytMeterMinusBtn_c::initializeState_ToUnuse() { + mAnm[MINUS_BTN_ANIM_INPUT].setForwardOnce(); + mAnm[MINUS_BTN_ANIM_INPUT].setToStart(); + mAnm[MINUS_BTN_ANIM_INPUT].setAnimEnable(true); +} +void dLytMeterMinusBtn_c::executeState_ToUnuse() { + if (field_0x4EB8 != 0) { + mAnm[MINUS_BTN_ANIM_INPUT].setFrame(0.0f); + mLyt.calc(); + mStateMgr.changeState(StateID_MenuSelectingIn); + } else { + if (mAnm[MINUS_BTN_ANIM_INPUT].isStop2()) { + mStateMgr.changeState(StateID_Unuse); + } + if (mAnm[MINUS_BTN_ANIM_INPUT].isEnabled()) { + mAnm[MINUS_BTN_ANIM_INPUT].play(); + } + } +} +void dLytMeterMinusBtn_c::finalizeState_ToUnuse() { + mAnm[MINUS_BTN_ANIM_INPUT].setAnimEnable(false); +} + +void dLytMeterMinusBtn_c::initializeState_Unuse() { + field_0x4E84 = 15; +} +void dLytMeterMinusBtn_c::executeState_Unuse() { + if (field_0x4E88 == 1) { + mAnm[MINUS_BTN_ANIM_INPUT].setAnimEnable(true); + mAnm[MINUS_BTN_ANIM_INPUT].setFrame(0.0f); + mLyt.calc(); + mAnm[MINUS_BTN_ANIM_INPUT].setAnimEnable(false); + mStateMgr.changeState(StateID_DemoMove); + } else if (field_0x4EB8 != 0) { + mAnm[MINUS_BTN_ANIM_INPUT].setAnimEnable(true); + mAnm[MINUS_BTN_ANIM_INPUT].setFrame(0.0f); + mLyt.calc(); + mAnm[MINUS_BTN_ANIM_INPUT].setAnimEnable(false); + mStateMgr.changeState(StateID_MenuSelectingIn); + } else { + if (dLytMeterContainer_c::GetInstance()->checkAllFlags(0x40)) { + if (field_0x4E84 <= 0) { + mStateMgr.changeState(StateID_ToUse); + } else { + field_0x4E84--; + } + } else { + field_0x4E84 = 15; + } + } +} +void dLytMeterMinusBtn_c::finalizeState_Unuse() {} +extern "C" const u16 PARTICLE_RESOURCE_ID_MAPPING_971_; +void dLytMeterMinusBtn_c::initializeState_DemoMove() { + mDemoFrame = 0; + mSlotToDemo = -1; + field_0x4EC3 = 1; + mpPanes[MINUS_BTN_PANE_UIMODE]->SetVisible(false); + isPouchBocoburinLocked(); // @bug (?) return value ignored + s32 count = getPouchSlotCount(true); + + u8 slotConfig[8]; + for (int i = 0; i < MINUS_BTN_NUM_ITEMS; i++) { + if (hasPouchSlot(i, true)) { + if (field_0x4E8C == 0) { + slotConfig[i] = 2; + } else { + slotConfig[i] = 1; + } + } else { + slotConfig[i] = 0; + if (field_0x4E8C == 1 && i == convertFilePouchSlot(count)) { + mSlotToDemo = i; + field_0x4E8C = 2; + mDemoFrame = -15; + } + } + } + + for (int i = 0; i < MINUS_BTN_NUM_ITEMS; i++) { + field_0x4E98[i] = getPouchItemForSlot(i, true); + mAnm[i + MINUS_BTN_ANIM_HAVE_OFFSET].setAnimEnable(true); + field_0x4EBB[i] = 0; + if (slotConfig[i] != 0) { + mAnm[i + MINUS_BTN_ANIM_HAVE_OFFSET].setFrame(0.0f); + if (field_0x4E98[i] != 0x32) { + mpPanes[i + MINUS_BTN_PANE_ICON_OFFSET]->SetVisible(true); + s32 amount = getPouchItemAmount(i, true); + bool locked = isPouchBocoburinLocked(); + if (locked) { + mItemIcons[i].setBocoburinLocked(true); + } else { + mItemIcons[i].setBocoburinLocked(false); + } + + if (amount >= 0 && !locked) { + mItemIcons[i].setHasNumber(true); + mItemIcons[i].setNumber(amount); + mItemIcons[i].setItem(field_0x4E98[i]); + mItemIcons[i].setNumberColor(getPouchItemNumberColor(i, true)); + } else { + mItemIcons[i].setHasNumber(false); + mItemIcons[i].setItem(field_0x4E98[i]); + } + + if (getShieldDurability(i, true) >= 0.0f) { + mItemIcons[i].setShieldDurability(getShieldDurability(i, true)); + if (i == convertFilePouchSlot(FileManager::GetInstance()->getShieldPouchSlot())) { + mItemIcons[i].setShieldOnOff(false); + } else { + mItemIcons[i].setShieldOnOff(true); + field_0x4EBB[i] = 1; + } + } else { + mItemIcons[i].setShieldOnOff(false); + } + } else { + mpPanes[i + MINUS_BTN_PANE_ICON_OFFSET]->SetVisible(false); + } + } else { + mAnm[i + MINUS_BTN_ANIM_HAVE_OFFSET].setFrame(1.0f); + mpPanes[i + MINUS_BTN_PANE_ICON_OFFSET]->SetVisible(true); + } + + if (i == convertFilePouchSlot(FileManager::GetInstance()->getShieldPouchSlot())) { + mAnm[i + MINUS_BTN_ANIM_EQUIP_OFFSET].setFrame(1.0f); + mpPanes[i + MINUS_BTN_PANE_TEXT_OFFSET]->SetVisible(true); + } else { + if (isUnequippable(field_0x4E98[i])) { + mAnm[i + MINUS_BTN_ANIM_EQUIP_OFFSET].setFrame(1.0f); + } else { + mAnm[i + MINUS_BTN_ANIM_EQUIP_OFFSET].setFrame(0.0f); + } + mpPanes[i + MINUS_BTN_PANE_TEXT_OFFSET]->SetVisible(false); + } + + mAnm[i + MINUS_BTN_ANIM_ITEM_ONOFF_OFFSET].setForwardOnce(); + mAnm[i + MINUS_BTN_ANIM_ITEM_ONOFF_OFFSET].setAnimEnable(true); + mAnm[i + MINUS_BTN_ANIM_ITEM_ONOFF_OFFSET].setFrame(0.0f); + mIcon[i].setShouldBeSelect(false); + } + + mAnm[MINUS_BTN_ANIM_IN].setForwardOnce(); + mAnm[MINUS_BTN_ANIM_IN].setToEnd2(); + mAnm[MINUS_BTN_ANIM_IN].setAnimEnable(true); + mLyt.calc(); + mAnm[MINUS_BTN_ANIM_IN].setAnimEnable(false); + + int numPlayingEffects = 0; + for (int i = 0; i < MINUS_BTN_NUM_ITEMS; i++) { + mAnm[i + MINUS_BTN_ANIM_HAVE_OFFSET].setAnimEnable(false); + mAnm[i + MINUS_BTN_ANIM_EQUIP_OFFSET].setAnimEnable(false); + mAnm[i + MINUS_BTN_ANIM_ITEM_ONOFF_OFFSET].setAnimEnable(false); + + if (slotConfig[i] == 2 && numPlayingEffects < 4) { + nw4r::math::MTX34 mtx = mpPanes[i + MINUS_BTN_PANE_ITEM_OFFSET]->GetGlobalMtx(); + mVec3_c pos(mtx._03, mtx._13, 0.0f); + mSlotForEffect[numPlayingEffects] = i; + mEffects[numPlayingEffects].fn_80029980( + PARTICLE_RESOURCE_ID_MAPPING_971_, &pos, &mEffectsRot[numPlayingEffects], nullptr, nullptr, nullptr + ); + numPlayingEffects++; + } + } + + if (field_0x4E8C == 0) { + SmallSoundManager::GetInstance()->playSound(SE_S_DOGU_PORCH_ADD_FIRST); + } else { + SmallSoundManager::GetInstance()->playSound(SE_S_DOGU_PORCH_ADD); + } +} +void dLytMeterMinusBtn_c::executeState_DemoMove() { + mDemoFrame++; + if (mDemoFrame == 0) { + if (mSlotToDemo >= 0) { + mAnm[mSlotToDemo + MINUS_BTN_ANIM_HAVE_OFFSET].setAnimEnable(true); + mAnm[mSlotToDemo + MINUS_BTN_ANIM_HAVE_OFFSET].setFrame(0.0f); + getPaneByIndex(mSlotToDemo + MINUS_BTN_PANE_ICON_OFFSET)->SetVisible(false); + + mAnm[mSlotToDemo + MINUS_BTN_ANIM_EQUIP_OFFSET].setAnimEnable(true); + mAnm[mSlotToDemo + MINUS_BTN_ANIM_EQUIP_OFFSET].setFrame(0.0f); + getPaneByIndex(mSlotToDemo + MINUS_BTN_PANE_TEXT_OFFSET)->SetVisible(false); + + mAnm[mSlotToDemo + MINUS_BTN_ANIM_ITEM_ONOFF_OFFSET].setForwardOnce(); + mAnm[mSlotToDemo + MINUS_BTN_ANIM_ITEM_ONOFF_OFFSET].setAnimEnable(true); + mAnm[mSlotToDemo + MINUS_BTN_ANIM_ITEM_ONOFF_OFFSET].setFrame(0.0f); + + mIcon[mSlotToDemo].setShouldBeSelect(false); + mLyt.calc(); + + mAnm[mSlotToDemo + MINUS_BTN_ANIM_HAVE_OFFSET].setAnimEnable(false); + mAnm[mSlotToDemo + MINUS_BTN_ANIM_EQUIP_OFFSET].setAnimEnable(false); + mAnm[mSlotToDemo + MINUS_BTN_ANIM_ITEM_ONOFF_OFFSET].setAnimEnable(false); + + nw4r::math::MTX34 mtx = getPaneByIndex(mSlotToDemo + MINUS_BTN_PANE_ITEM_OFFSET)->GetGlobalMtx(); + mVec3_c pos(mtx._03, mtx._13, 0.0f); + mSlotForEffect[0] = mSlotToDemo; + mEffects[0].fn_80029980( + PARTICLE_RESOURCE_ID_MAPPING_971_, &pos, &mEffectsRot[0], nullptr, nullptr, nullptr + ); + } + } else if (mDemoFrame > 0) { + for (int i = 0; i < 4; i++) { + s32 slot = mSlotForEffect[i]; + if (slot >= 0) { + mEffectsRot[i].z += demoRotIncrement; + nw4r::math::MTX34 mtx = getPaneByIndex(slot + MINUS_BTN_PANE_ITEM_OFFSET)->GetGlobalMtx(); + mVec3_c pos(mtx._03, mtx._13, 0.0f); + mEffects[i].fn_800271E0(&pos, &mEffectsRot[i], nullptr); + } + } + } + + if (mDemoFrame >= 65) { + mDemoFrame = 0; + mSlotToDemo = -1; + mStateMgr.changeState(StateID_DemoOut); + } +} +void dLytMeterMinusBtn_c::finalizeState_DemoMove() {} + +void dLytMeterMinusBtn_c::initializeState_DemoOut() { + mAnm[MINUS_BTN_ANIM_IN].setBackwardsOnce(); + mAnm[MINUS_BTN_ANIM_IN].setToStart(); + mAnm[MINUS_BTN_ANIM_IN].setAnimEnable(true); +} +void dLytMeterMinusBtn_c::executeState_DemoOut() { + if (mAnm[MINUS_BTN_ANIM_IN].isStop2()) { + mAnm[MINUS_BTN_ANIM_IN].setAnimEnable(false); + field_0x4E88 = 4; + mStateMgr.changeState(StateID_Wait); + } + if (mAnm[MINUS_BTN_ANIM_IN].isEnabled()) { + mAnm[MINUS_BTN_ANIM_IN].play(); + } +} +void dLytMeterMinusBtn_c::finalizeState_DemoOut() {} + +bool dLytMeterMinusBtn_c::build(d2d::ResAccIf_c *resAcc) { + mLyt.setResAcc(resAcc); + mLyt.build("remoConBtn_01.brlyt", nullptr); + + for (int i = 0; i < MINUS_BTN_NUM_PANES; i++) { + mpPanes[i] = mLyt.findPane(sPaneNames[i]); + } + + for (int i = 0; i < MINUS_BTN_NUM_ANIMS; i++) { + mAnm[i].init(brlanMap[i].mFile, resAcc, mLyt.getLayout(), brlanMap[i].mName); + mAnm[i].bind(false); + mAnm[i].setAnimEnable(false); + } + + mAnm[MINUS_BTN_ANIM_SELECT_LOOP].setAnimEnable(true); + + for (int i = 0; i < MINUS_BTN_NUM_ITEMS; i++) { + mIcon[i].setAnm(&mAnm[i + MINUS_BTN_ANIM_ITEM_ONOFF_OFFSET]); + mIcon[i].init(); + } + + mBlink.setAnm(&mAnm[MINUS_BTN_ANIM_SELECT_ONOFF]); + mBlink.init(); + + for (int i = 0; i < 2; i++) { + mText[i].setAnm(&mAnm[i + MINUS_BTN_ANIM_TEXT_ONOFF_OFFSET]); + mText[i].init(); + } + + for (int i = 0; i < 2; i++) { + mpTextBoxes[i] = mLyt.getTextBox(sTextboxNames[i]); + } + + 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); + } + + for (int i = 0; i < 8; i++) { + mSubpanes[i].mpLytPane = &mItemIcons[i]; + mItemIcons[i].build(resAcc, dLytCommonIconItem_c::POUCH); + mSubpaneList.PushBack(&mSubpanes[i]); + } + + if (mLyt.getLayout()->GetGroupContainer() != nullptr) { + nw4r::lyt::Group *g = mLyt.getLayout()->GetGroupContainer()->FindGroupByName(sGroupName); + if (g != nullptr) { + linkMeters(g, &mSubpaneList); + } + } + + for (int i = 0; i < 8; i++) { + mItemIcons[i].reset(); + mItemIcons[i].setVisible(false); + mItemIcons[i].setSize(true); + field_0x4EBB[i] = 0; + field_0x4E98[i] = 0x32; + } + + for (s32 i = 0; i < 4; i++) { + mEffectsRot[i].setR(0); + mSlotForEffect[i] = -1; + mEffects[i].init(dLytControlGame_c::getInstance()); + } + + field_0x4E80 = 8; + mArrowRotation = 0.0f; + mArrowLength = 0.0f; + + mpOwnerPane = nullptr; + + field_0x4E88 = 0; + field_0x4E8C = -1; + mDemoFrame = 0; + mSlotToDemo = -1; + + field_0x4EB8 = 0; + field_0x4EB9 = 0; + field_0x4EBA = 0; + + field_0x4EC3 = 0; + field_0x4E84 = 15; + + mAnm[MINUS_BTN_ANIM_IN].setForwardOnce(); + mAnm[MINUS_BTN_ANIM_IN].setFrame(0.0f); + mAnm[MINUS_BTN_ANIM_IN].setAnimEnable(true); + mAnm[MINUS_BTN_ANIM_CALL].setToEnd(); + mAnm[MINUS_BTN_ANIM_CALL].setAnimEnable(true); + + mLyt.calc(); + + mAnm[MINUS_BTN_ANIM_IN].setAnimEnable(false); + mAnm[MINUS_BTN_ANIM_CALL].setAnimEnable(false); + + mStateMgr.changeState(StateID_Wait); + + return true; +} + +bool dLytMeterMinusBtn_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 < MINUS_BTN_NUM_ITEMS; i++) { + mSubpanes[i].mpLytPane->remove(); + } + + for (int i = 0; i < MINUS_BTN_NUM_ANIMS; i++) { + mAnm[i].unbind(); + mAnm[i].remove(); + } + + // Not removing our EffectsStructs I guess? + return true; +} + +bool dLytMeterMinusBtn_c::execute() { + bool btnShown = true; + if (dLytMeterContainer_c::GetMeter()->getUiMode() > 1 && !shouldCall() && !fn_800F75E0()) { + btnShown = false; + } + + if (field_0x4EC3 == 0) { + if (!btnShown) { + mpPanes[MINUS_BTN_PANE_UIMODE]->SetVisible(false); + } else { + mpPanes[MINUS_BTN_PANE_UIMODE]->SetVisible(true); + } + } + + if (dLytControlGame_c::getInstance()->isStateNormal() && mpPanes[MINUS_BTN_PANE_UIMODE]->IsVisible()) { + if (StoryflagManager::sInstance->getCounterOrFlag(568) != 0) { + if (field_0x4EB8 != 0) { + field_0x4EB9 = 0; + StoryflagManager::sInstance->unsetFlag(568); + } else { + field_0x4EB9 = 1; + } + } + } else { + field_0x4EB9 = 0; + } + + if (mpOwnerPane == nullptr) { + return true; + } + + if (!mpOwnerPane->IsVisible()) { + if (*mStateMgr.getStateID() != StateID_DemoMove && *mStateMgr.getStateID() != StateID_DemoOut && + field_0x4EC3 != 0) { + if (btnShown) { + mpPanes[MINUS_BTN_PANE_UIMODE]->SetVisible(true); + } + field_0x4EC3 = false; + } + + return true; + } + + if (!getPane()->IsVisible()) { + if (*mStateMgr.getStateID() == StateID_ToUnuse) { + mAnm[MINUS_BTN_ANIM_INPUT].setToEnd2(); + } + return true; + } + + if (!StoryflagManager::sInstance->getCounterOrFlag(30)) { + dLytMeterContainer_c::GetInstance()->clearFlags(0x40); + } + + fn_800F7300(); + + mStateMgr.executeState(); + + if (field_0x4EB9 != 0 && dLytMeterContainer_c::GetInstance()->checkAllFlags(0x40)) { + if (field_0x4EBA == 0) { + mAnm[MINUS_BTN_ANIM_CALL].setToEnd(); + mAnm[MINUS_BTN_ANIM_CALL].setAnimEnable(true); + field_0x4EBA = 1; + } + + if (mAnm[MINUS_BTN_ANIM_CALL].isEnabled()) { + mAnm[MINUS_BTN_ANIM_CALL].play(); + if (dLytMeterContainer_c::GetInstance()->checkAllFlags(0x40) && + mAnm[MINUS_BTN_ANIM_CALL].getFrame() == 1.0f) { + SmallSoundManager::GetInstance()->playSound(SE_S_MINUS_BUTTON_BLINK); + } + } + } else if (field_0x4EBA == 1) { + mAnm[MINUS_BTN_ANIM_CALL].setToEnd(); + } else if (mAnm[MINUS_BTN_ANIM_CALL].isEnabled()) { + mAnm[MINUS_BTN_ANIM_CALL].setAnimEnable(false); + } + + if (!field_0x4EB9) { + field_0x4EBA = field_0x4EB9; + } + + field_0x4EB9 = 0; + + for (int i = 0; i < MINUS_BTN_NUM_ITEMS; i++) { + mIcon[i].execute(); + } + + mBlink.execute(); + + for (int i = 0; i < 2; i++) { + mText[i].execute(); + } + + mVec3_c t1(0.0f, 0.0f, 0.0f); + t1.z = mArrowRotation; + mpPanes[MINUS_BTN_PANE_ITEM_ARROW]->SetRotate(t1); + // But rotate the button and the pointer back so that + // they point up + mVec3_c t2(0.0f, 0.0f, 0.0f); + t2.z = -mArrowRotation; + mpPanes[MINUS_BTN_PANE_ARROW_HAND]->SetRotate(t2); + mpPanes[MINUS_BTN_PANE_N_BTN_0]->SetRotate(t2); + + f32 frame = mAnm[MINUS_BTN_ANIM_ARROW].getAnimDuration(); + if (mArrowLength < 0.0f) { + mArrowLength = 0.0f; + } + if (mArrowLength > 1.0f) { + mArrowLength = 1.0f; + } + mAnm[MINUS_BTN_ANIM_ARROW].setFrame(frame * mArrowLength); + mAnm[MINUS_BTN_ANIM_ARROW].setAnimEnable(true); + + if (mAnm[MINUS_BTN_ANIM_SELECT_LOOP].isEnabled()) { + mAnm[MINUS_BTN_ANIM_SELECT_LOOP].play(); + } + + for (int i = 0; i < MINUS_BTN_NUM_ITEMS; i++) { + mSubpanes[i].mpLytPane->execute(); + } + + return true; +} + +bool dLytMeterMinusBtn_c::shouldCall() const { + if (dLytControlGame_c::getInstance()->isStateNormal() && StoryflagManager::sInstance->getCounterOrFlag(568)) { + return true; + } + return false; +} + +void dLytMeterMinusBtn_c::fn_800F7300() { + s32 itemId = -1; + for (int i = 0; i < 8; i++) { + int item = getPouchItemForSlot(i, true); + if (field_0x4E80 == i && field_0x4E88 == 0 && item != 0x32) { + mIcon[i].setShouldBeSelect(true); + u32 slot = convertLytPouchSlot(i); + if (slot < getPouchSlotCount(true)) { + itemId = FileManager::GetInstance()->getPouchItem(slot); + if (itemId == 0) { + itemId = -1; + } + } + } else { + mIcon[i].setShouldBeSelect(false); + } + } + + if (*mStateMgr.getStateID() == StateID_Wait || *mStateMgr.getStateID() == StateID_MenuSelectingIn || + *mStateMgr.getStateID() == StateID_ToUnuse || *mStateMgr.getStateID() == StateID_Unuse) { + itemId = -1; + } + + setItemText(itemId); + + if (itemId >= 0) { + mBlink.setShouldBeSelect(true); + if (isNotMedalOrExtraAmmo(itemId)) { + mText[0].setShouldBeSelect(true); + } else { + mText[0].setShouldBeSelect(false); + } + } else { + mBlink.setShouldBeSelect(false); + mText[0].setShouldBeSelect(false); + } +} + +bool dLytMeterMinusBtn_c::demoRelated(s32 arg) { + if (field_0x4E88 == 0) { + field_0x4E88 = 1; + field_0x4E8C = arg; + mDemoFrame = 0; + for (s32 i = 0; i < 4; i++) { + mEffectsRot[i].setR(0); + mSlotForEffect[i] = -1; + } + mArrowRotation = 0.0f; + mArrowLength = 0.0f; + + for (int i = 0; i < MINUS_BTN_NUM_ITEMS; i++) { + mIcon[i].init(); + } + } else if (field_0x4E88 == 4) { + field_0x4E88 = 0; + return true; + } + return false; +} + +bool dLytMeterMinusBtn_c::fn_800F75E0() const { + return field_0x4E88 != 0; +} + +bool dLytMeterMinusBtn_c::fn_800F7600() const { + if (field_0x4EB8 != 0 || field_0x4E80 < 8) { + if (*mStateMgr.getStateID() == StateID_ToUse || *mStateMgr.getStateID() == StateID_Wait) { + return true; + } + } + + return *mStateMgr.getStateID() == StateID_MenuSelectingIn || *mStateMgr.getStateID() == StateID_MenuSelecting || + *mStateMgr.getStateID() == StateID_MenuSelectingOut; +} + +bool dLytMeterMinusBtn_c::fn_800F7760() const { + if (!StoryflagManager::sInstance->getCounterOrFlag(30) || + (mpOwnerPane == nullptr || !mpOwnerPane->IsVisible() || dLytMeterContainer_c::GetMeter()->fn_800D5650() || + dLytMeterContainer_c::GetMeter()->fn_800D5680() || + dLytMeterContainer_c::GetMeter()->getField_0x13793() == 0)) { + return false; + } + + return true; +} + +bool dLytMeterMinusBtn_c::isUnequippable(s32 item) const { + switch (item) { + case LYT_CMN_PouchSeedSatchelSmall: + case LYT_CMN_PouchSeedSatchelMed: + case LYT_CMN_PouchSeedSatchelBig: + case LYT_CMN_PouchQuiverSmall: + case LYT_CMN_PouchQuiverMed: + case LYT_CMN_PouchQuiverBig: + case LYT_CMN_PouchBombBagSmall: + case LYT_CMN_PouchBombBagMed: + case LYT_CMN_PouchBombBagBig: + case LYT_CMN_PouchMedalDurable: + case LYT_CMN_PouchMedalHeart: + case LYT_CMN_PouchMedalLife: + case LYT_CMN_PouchMedalRupee: + case LYT_CMN_PouchMedalTreasure: + case LYT_CMN_PouchMedalCursed: + case LYT_CMN_Pouch32: // ? + case LYT_CMN_PouchMedalBug: return true; + default: return false; + } +} + +void dLytMeterMinusBtn_c::setItemText(s32 item) { + if (item >= 0 && field_0x4E88 == 0) { + mText[1].setShouldBeSelect(true); + SizedString<16> label; + label.sprintf("NAME_ITEM_%03d", item); + mpTextBoxes[0]->setMessageWithGlobalTextProcessor2(label, nullptr); + mpTextBoxes[1]->setMessageWithGlobalTextProcessor2(label, nullptr); + mpWindows[1]->UpdateSize(mpSizeBoxes[1], 32.0f); + } else { + mText[1].setShouldBeSelect(false); + } +} + +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)); + } + } +} + +bool dLytMeterMinusBtn_c::isNotMedalOrExtraAmmo(s32 item) { + if (isItemExtraAmmo(item) || isItemMedal(item)) { + return false; + } + return true; +}