From fc89f2b34a626b5d0e0520ad7d0b1afc3ea46f7f Mon Sep 17 00:00:00 2001 From: robojumper Date: Tue, 1 Apr 2025 23:08:44 +0200 Subject: [PATCH 01/31] d_lyt_msg_window_wood OK, d_lyt_common_a_btn OK --- config/SOUE01/splits.txt | 33 ++- config/SOUE01/symbols.txt | 168 ++++++------ configure.py | 19 +- include/d/d_sys.h | 1 + include/d/lyt/d2d.h | 48 ++-- include/d/lyt/d_lyt_common_a_btn.h | 103 ++++++++ include/d/lyt/d_textbox.h | 11 +- .../lyt/msg_window/d_lyt_msg_window_common.h | 27 ++ .../d/lyt/msg_window/d_lyt_msg_window_wood.h | 55 ++++ src/d/d_cs_game.cpp | 2 +- src/d/lyt/d2d.cpp | 8 +- src/d/lyt/d_lyt_area_caption.cpp | 6 +- src/d/lyt/d_lyt_battery.cpp | 2 +- src/d/lyt/d_lyt_bird_gauge.cpp | 4 +- src/d/lyt/d_lyt_common_a_btn.cpp | 244 ++++++++++++++++++ src/d/lyt/d_lyt_common_arrow.cpp | 2 +- src/d/lyt/d_lyt_common_icon_item.cpp | 12 +- src/d/lyt/d_lyt_common_icon_material.cpp | 8 +- src/d/lyt/d_lyt_fader.cpp | 10 +- src/d/lyt/d_lyt_map.cpp | 10 +- src/d/lyt/d_lyt_note.cpp | 4 +- src/d/lyt/d_lyt_sky_gauge.cpp | 4 +- src/d/lyt/meter/d_lyt_meter.cpp | 12 +- src/d/lyt/meter/d_lyt_meter_a_btn.cpp | 4 +- src/d/lyt/meter/d_lyt_meter_drink.cpp | 4 +- src/d/lyt/meter/d_lyt_meter_shield_gauge.cpp | 2 +- .../lyt/msg_window/d_lyt_msg_window_wood.cpp | 191 ++++++++++++++ 27 files changed, 819 insertions(+), 175 deletions(-) create mode 100644 include/d/lyt/d_lyt_common_a_btn.h create mode 100644 include/d/lyt/msg_window/d_lyt_msg_window_common.h create mode 100644 include/d/lyt/msg_window/d_lyt_msg_window_wood.h create mode 100644 src/d/lyt/d_lyt_common_a_btn.cpp create mode 100644 src/d/lyt/msg_window/d_lyt_msg_window_wood.cpp diff --git a/config/SOUE01/splits.txt b/config/SOUE01/splits.txt index 14f04d46..c9b1a5b8 100644 --- a/config/SOUE01/splits.txt +++ b/config/SOUE01/splits.txt @@ -407,6 +407,12 @@ d/lyt/d_lyt_do_button.cpp: .data start:0x8051A5A8 end:0x8051AC00 .bss start:0x805ACE10 end:0x805ACF78 +d/lyt/d_lyt_common_a_btn.cpp: + .text start:0x8010EF90 end:0x8010F818 + .rodata start:0x804E72E0 end:0x804E7330 + .data start:0x8051AC18 end:0x8051ACD8 + .sdata2 start:0x80579D98 end:0x80579DA8 + d/lyt/d_lyt_common_icon_material.cpp: .text start:0x8010F820 end:0x80111718 .ctors start:0x804DB730 end:0x804DB734 @@ -425,46 +431,51 @@ d/lyt/d_lyt_common_icon_item.cpp: .sdata2 start:0x80579DB8 end:0x80579DD0 .bss start:0x805AD088 end:0x805AD188 -d/lyt/d_lyt_msg_window.cpp: +d/lyt/msg_window/d_lyt_msg_window.cpp: .text start:0x801148F0 end:0x8011C8C8 .ctors start:0x804DB738 end:0x804DB73C -d/lyt/d_lyt_msg_window_select_btn.cpp: +d/lyt/msg_window/d_lyt_msg_window_select_btn.cpp: .text start:0x8011C8D0 end:0x80120988 .ctors start:0x804DB73C end:0x804DB740 -d/lyt/d_lyt_msg_window_base.cpp: +d/lyt/msg_window/d_lyt_msg_window_base.cpp: .text start:0x80120A20 end:0x80121068 -d/lyt/d_lyt_msg_window_talk.cpp: +d/lyt/msg_window/d_lyt_msg_window_talk.cpp: .text start:0x80121070 end:0x801223C8 .ctors start:0x804DB740 end:0x804DB744 -d/lyt/d_lyt_msg_window_link.cpp: +d/lyt/msg_window/d_lyt_msg_window_link.cpp: .text start:0x801223D0 end:0x80123738 .ctors start:0x804DB744 end:0x804DB748 -d/lyt/d_lyt_msg_window_get.cpp: +d/lyt/msg_window/d_lyt_msg_window_get.cpp: .text start:0x80123740 end:0x80124678 .ctors start:0x804DB748 end:0x804DB74C -d/lyt/d_lyt_msg_window_sword.cpp: +d/lyt/msg_window/d_lyt_msg_window_sword.cpp: .text start:0x80124680 end:0x80125BA8 .ctors start:0x804DB74C end:0x804DB750 -d/lyt/d_lyt_msg_window_wood.cpp: +d/lyt/msg_window/d_lyt_msg_window_wood.cpp: .text start:0x80125BB0 end:0x801267F8 .ctors start:0x804DB750 end:0x804DB754 + .rodata start:0x804E75C0 end:0x804E75D8 + .data start:0x8051D8A0 end:0x8051DB08 + .sdata start:0x805725E0 end:0x805725F8 + .sdata2 start:0x80579EC0 end:0x80579EC8 + .bss start:0x805AEDF0 end:0x805AEEF0 -d/lyt/d_lyt_msg_window_stone.cpp: +d/lyt/msg_window/d_lyt_msg_window_stone.cpp: .text start:0x80126800 end:0x80127478 .ctors start:0x804DB754 end:0x804DB758 -d/lyt/d_lyt_msg_window_demo.cpp: +d/lyt/msg_window/d_lyt_msg_window_demo.cpp: .text start:0x80127480 end:0x801281F8 .ctors start:0x804DB758 end:0x804DB75C -d/lyt/d_lyt_simple_window.cpp: +d/lyt/msg_window/d_lyt_simple_window.cpp: .text start:0x80128200 end:0x8012B948 .ctors start:0x804DB75C end:0x804DB760 diff --git a/config/SOUE01/symbols.txt b/config/SOUE01/symbols.txt index ae494792..df9063e6 100644 --- a/config/SOUE01/symbols.txt +++ b/config/SOUE01/symbols.txt @@ -2831,7 +2831,7 @@ dSys_c__endFrame = .text:0x800643E0; // type:function size:0x48 EGG__ConfigurationData__onEndFrame = .text:0x80064430; // type:function size:0x4 dSys_c__setBlack = .text:0x80064440; // type:function size:0x80 setFrameRate__4dSysFUl = .text:0x800644C0; // type:function size:0x10 -dSys_c__getFrameRate = .text:0x800644D0; // type:function size:0x10 +getFrameRate__4dSysFv = .text:0x800644D0; // type:function size:0x10 setClearColor__4dSysF6mColor = .text:0x800644E0; // type:function size:0x60 dSys_c__getClearColor = .text:0x80064540; // type:function size:0x14 dSys_c__create = .text:0x80064560; // type:function size:0x3BC @@ -3774,9 +3774,9 @@ LytMeter0x24__Q23d2d8dSubPaneCFv = .text:0x800AC4F0; // type:function size:0x8 LytMeter0x28__Q23d2d8dSubPaneFb = .text:0x800AC500; // type:function size:0x8 init__Q23d2d14AnmGroupBase_cFPCcPQ23m2d10ResAccIf_cPQ23d2d8Layout_cPCc = .text:0x800AC510; // type:function size:0x9C init__Q23d2d14AnmGroupBase_cFPQ34nw4r3lyt13AnimTransformPCcPQ23m2d10ResAccIf_cPQ34nw4r3lyt5Group = .text:0x800AC5B0; // type:function size:0x114 -setDirection__Q23d2d14AnmGroupBase_cFb = .text:0x800AC6D0; // type:function size:0xF8 +bind__Q23d2d14AnmGroupBase_cFb = .text:0x800AC6D0; // type:function size:0xF8 unbind__Q23d2d14AnmGroupBase_cFv = .text:0x800AC7D0; // type:function size:0x88 -afterUnbind__Q23d2d14AnmGroupBase_cFv = .text:0x800AC860; // type:function size:0x8 +remove__Q23d2d14AnmGroupBase_cFv = .text:0x800AC860; // type:function size:0x8 setAnimEnable__Q23d2d14AnmGroupBase_cFb = .text:0x800AC870; // type:function size:0x8C setAnmFrame__Q23d2d14AnmGroupBase_cFf = .text:0x800AC900; // type:function size:0xC syncAnmFrame__Q23d2d14AnmGroupBase_cFv = .text:0x800AC910; // type:function size:0xC @@ -3841,7 +3841,7 @@ fn_800AEF80 = .text:0x800AEF80; // type:function size:0x414 GetCharStrmReader__Q34nw4r2ut4FontCFv = .text:0x800AF3A0; // type:function size:0x38 fn_800AF3E0 = .text:0x800AF3E0; // type:function size:0x8C fn_800AF470 = .text:0x800AF470; // type:function size:0xCC -fn_800AF540 = .text:0x800AF540; // type:function size:0x8C +fn_800AF540__10dTextBox_cFPCwP15dTagProcessor_ce = .text:0x800AF540; // type:function size:0x8C fn_800AF5D0 = .text:0x800AF5D0; // type:function size:0xD4 fn_800AF6B0 = .text:0x800AF6B0; // type:function size:0x64 fn_800AF720 = .text:0x800AF720; // type:function size:0x8C @@ -6547,27 +6547,27 @@ fn_8010EC10 = .text:0x8010EC10; // type:function size:0x134 fn_8010ED50 = .text:0x8010ED50; // type:function size:0x110 fn_8010EE60 = .text:0x8010EE60; // type:function size:0xE8 fn_8010EF50 = .text:0x8010EF50; // type:function size:0x3C -fn_8010EF90 = .text:0x8010EF90; // type:function size:0xAC -fn_8010F040 = .text:0x8010F040; // type:function size:0x50 -fn_8010F090 = .text:0x8010F090; // type:function size:0x58 -fn_8010F0F0 = .text:0x8010F0F0; // type:function size:0x24 -fn_8010F120 = .text:0x8010F120; // type:function size:0x28 -fn_8010F150 = .text:0x8010F150; // type:function size:0x4 -fn_8010F160 = .text:0x8010F160; // type:function size:0x8 -fn_8010F170 = .text:0x8010F170; // type:function size:0x74 -fn_8010F1F0 = .text:0x8010F1F0; // type:function size:0xCC -fn_8010F2C0 = .text:0x8010F2C0; // type:function size:0x5C -fn_8010F320 = .text:0x8010F320; // type:function size:0x8 -fn_8010F330 = .text:0x8010F330; // type:function size:0x6C -canPressAToClearCalibrationScreenMaybe = .text:0x8010F3A0; // type:function size:0x88 -fn_8010F430 = .text:0x8010F430; // type:function size:0x58 -fn_8010F490 = .text:0x8010F490; // type:function size:0x134 -fn_8010F5D0 = .text:0x8010F5D0; // type:function size:0x188 -setTextboxStateMaybe = .text:0x8010F760; // type:function size:0x10 -fn_8010F770 = .text:0x8010F770; // type:function size:0x8 -fn_8010F780 = .text:0x8010F780; // type:function size:0x8 -fn_8010F790 = .text:0x8010F790; // type:function size:0x8 -fn_8010F7A0 = .text:0x8010F7A0; // type:function size:0x78 +build__16dLytCommonABtn_cFPQ23d2d10ResAccIf_c = .text:0x8010EF90; // type:function size:0xAC +remove__16dLytCommonABtn_cFv = .text:0x8010F040; // type:function size:0x50 +execute__16dLytCommonABtn_cFv = .text:0x8010F090; // type:function size:0x58 +requestIn__16dLytCommonABtn_cFv = .text:0x8010F0F0; // type:function size:0x24 +requestOut__16dLytCommonABtn_cFb = .text:0x8010F120; // type:function size:0x28 +resetToInvisble__16dLytCommonABtn_cFv = .text:0x8010F150; // type:function size:0x4 +setSoundVariant__16dLytCommonABtn_cFQ216dLytCommonABtn_c12SoundVariant = .text:0x8010F160; // type:function size:0x8 +runExecuteFunc__16dLytCommonABtn_cFv = .text:0x8010F170; // type:function size:0x74 +gotoStateInvisible__16dLytCommonABtn_cFv = .text:0x8010F1F0; // type:function size:0xCC +executeStateInvisible__16dLytCommonABtn_cFv = .text:0x8010F2C0; // type:function size:0x5C +gotoStateIn__16dLytCommonABtn_cFv = .text:0x8010F320; // type:function size:0x8 +executeStateIn__16dLytCommonABtn_cFv = .text:0x8010F330; // type:function size:0x6C +goToStateVisible__16dLytCommonABtn_cFv = .text:0x8010F3A0; // type:function size:0x88 +executeStateVisible__16dLytCommonABtn_cFv = .text:0x8010F430; // type:function size:0x58 +goToStateDecideOut__16dLytCommonABtn_cFv = .text:0x8010F490; // type:function size:0x134 +executeStateDecideOut__16dLytCommonABtn_cFv = .text:0x8010F5D0; // type:function size:0x188 +setState__16dLytCommonABtn_cFQ216dLytCommonABtn_c9ABtnState = .text:0x8010F760; // type:function size:0x10 +getName__16dLytCommonABtn_cCFv = .text:0x8010F770; // type:function size:0x8 +getLyt__16dLytCommonABtn_cFv = .text:0x8010F780; // type:function size:0x8 +getPane__16dLytCommonABtn_cFv = .text:0x8010F790; // type:function size:0x8 +__dt__16dLytCommonABtn_cFv = .text:0x8010F7A0; // type:function size:0x78 build__29dLytCommonIconMaterialPart1_cFPQ23d2d10ResAccIf_c = .text:0x8010F820; // type:function size:0x100 remove__29dLytCommonIconMaterialPart1_cFv = .text:0x8010F920; // type:function size:0x58 execute__29dLytCommonIconMaterialPart1_cFv = .text:0x8010F980; // type:function size:0x9C @@ -6877,7 +6877,7 @@ fn_801194C0 = .text:0x801194C0; // type:function size:0x40C LytMsgWindowTalk__dtor = .text:0x801198D0; // type:function size:0x198 fn_80119A70 = .text:0x80119A70; // type:function size:0x198 LytMsgWindowSword__dtor = .text:0x80119C10; // type:function size:0x198 -fn_80119DB0 = .text:0x80119DB0; // type:function size:0x170 +__dt__19dLytMsgWindowWood_cFv = .text:0x80119DB0; // type:function size:0x170 fn_80119F20 = .text:0x80119F20; // type:function size:0x170 fn_8011A090 = .text:0x8011A090; // type:function size:0x198 fn_8011A230 = .text:0x8011A230; // type:function size:0x158 @@ -7022,9 +7022,9 @@ fn_8011B560 = .text:0x8011B560; // type:function size:0x30 fn_8011B590 = .text:0x8011B590; // type:function size:0x30 fn_8011B5C0 = .text:0x8011B5C0; // type:function size:0x30 fn_8011B5F0 = .text:0x8011B5F0; // type:function size:0x30 -fn_8011B620 = .text:0x8011B620; // type:function size:0x30 -fn_8011B650 = .text:0x8011B650; // type:function size:0x30 -fn_8011B680 = .text:0x8011B680; // type:function size:0x30 +finalizeState__34sFStateID_c<19dLytMsgWindowWood_c>CFR19dLytMsgWindowWood_c = .text:0x8011B620; // type:function size:0x30 +executeState__34sFStateID_c<19dLytMsgWindowWood_c>CFR19dLytMsgWindowWood_c = .text:0x8011B650; // type:function size:0x30 +initializeState__34sFStateID_c<19dLytMsgWindowWood_c>CFR19dLytMsgWindowWood_c = .text:0x8011B680; // type:function size:0x30 fn_8011B6B0 = .text:0x8011B6B0; // type:function size:0x30 fn_8011B6E0 = .text:0x8011B6E0; // type:function size:0x30 fn_8011B710 = .text:0x8011B710; // type:function size:0x30 @@ -7131,7 +7131,7 @@ fn_80120DC0 = .text:0x80120DC0; // type:function size:0x104 fn_80120ED0 = .text:0x80120ED0; // type:function size:0x28 fn_80120F00 = .text:0x80120F00; // type:function size:0x14C fn_80121050 = .text:0x80121050; // type:function size:0xC -fn_80121060 = .text:0x80121060; // type:function size:0x8 +vt_0x40__20dLytMsgWindowSubtypeCFv = .text:0x80121060; // type:function size:0x8 LytMsgWindowTalk__initialize = .text:0x80121070; // type:function size:0x2F8 fn_80121370 = .text:0x80121370; // type:function size:0xE0 LytMsgWindowTalk__stateInvisibleEnter = .text:0x80121450; // type:function size:0x8 @@ -7253,34 +7253,34 @@ fn_801256B0 = .text:0x801256B0; // type:function size:0x8 LytMsgWindowSword__initStates = .text:0x801256C0; // type:function size:0x3F4 LytMsgWindowSword__dtor2 = .text:0x80125AC0; // type:function size:0x58 fn_80125B20 = .text:0x80125B20; // type:function size:0x88 -fn_80125BB0 = .text:0x80125BB0; // type:function size:0x278 -fn_80125E30 = .text:0x80125E30; // type:function size:0xD8 -fn_80125F10 = .text:0x80125F10; // type:function size:0x8 -fn_80125F20 = .text:0x80125F20; // type:function size:0x28 -fn_80125F50 = .text:0x80125F50; // type:function size:0x4 -fn_80125F60 = .text:0x80125F60; // type:function size:0x48 -fn_80125FB0 = .text:0x80125FB0; // type:function size:0x78 -fn_80126030 = .text:0x80126030; // type:function size:0x4 -fn_80126040 = .text:0x80126040; // type:function size:0x4 -fn_80126050 = .text:0x80126050; // type:function size:0x28 -fn_80126080 = .text:0x80126080; // type:function size:0x4 -fn_80126090 = .text:0x80126090; // type:function size:0x48 -fn_801260E0 = .text:0x801260E0; // type:function size:0x78 -fn_80126160 = .text:0x80126160; // type:function size:0x4 -fn_80126170 = .text:0x80126170; // type:function size:0xBC -fn_80126230 = .text:0x80126230; // type:function size:0x14 -fn_80126250 = .text:0x80126250; // type:function size:0xC -fn_80126260 = .text:0x80126260; // type:function size:0x4C -fn_801262B0 = .text:0x801262B0; // type:function size:0xC -fn_801262C0 = .text:0x801262C0; // type:function size:0x4C -fn_80126310 = .text:0x80126310; // type:function size:0x7C -fn_80126390 = .text:0x80126390; // type:function size:0x8 -fn_801263A0 = .text:0x801263A0; // type:function size:0x8 -fn_801263B0 = .text:0x801263B0; // type:function size:0x8 -fn_801263C0 = .text:0x801263C0; // type:function size:0x8 -LytMsgWindowWood__initStates = .text:0x801263D0; // type:function size:0x338 -LytMsgWindowWood__dtor = .text:0x80126710; // type:function size:0x58 -fn_80126770 = .text:0x80126770; // type:function size:0x88 +build__19dLytMsgWindowWood_cFPvPQ23d2d10ResAccIf_cP15dTagProcessor_c = .text:0x80125BB0; // type:function size:0x278 +remove__19dLytMsgWindowWood_cFv = .text:0x80125E30; // type:function size:0xD8 +initializeState_Invisible__19dLytMsgWindowWood_cFv = .text:0x80125F10; // type:function size:0x8 +executeState_Invisible__19dLytMsgWindowWood_cFv = .text:0x80125F20; // type:function size:0x28 +finalizeState_Invisible__19dLytMsgWindowWood_cFv = .text:0x80125F50; // type:function size:0x4 +initializeState_In__19dLytMsgWindowWood_cFv = .text:0x80125F60; // type:function size:0x48 +executeState_In__19dLytMsgWindowWood_cFv = .text:0x80125FB0; // type:function size:0x78 +finalizeState_In__19dLytMsgWindowWood_cFv = .text:0x80126030; // type:function size:0x4 +initializeState_Visible__19dLytMsgWindowWood_cFv = .text:0x80126040; // type:function size:0x4 +executeState_Visible__19dLytMsgWindowWood_cFv = .text:0x80126050; // type:function size:0x28 +finalizeState_Visible__19dLytMsgWindowWood_cFv = .text:0x80126080; // type:function size:0x4 +initializeState_Out__19dLytMsgWindowWood_cFv = .text:0x80126090; // type:function size:0x48 +executeState_Out__19dLytMsgWindowWood_cFv = .text:0x801260E0; // type:function size:0x78 +finalizeState_Out__19dLytMsgWindowWood_cFv = .text:0x80126160; // type:function size:0x4 +execute__19dLytMsgWindowWood_cFv = .text:0x80126170; // type:function size:0xBC +draw__19dLytMsgWindowWood_cFv = .text:0x80126230; // type:function size:0x14 +vt_0x1C__19dLytMsgWindowWood_cFv = .text:0x80126250; // type:function size:0xC +vt_0x20__19dLytMsgWindowWood_cCFv = .text:0x80126260; // type:function size:0x4C +vt_0x24__19dLytMsgWindowWood_cFv = .text:0x801262B0; // type:function size:0xC +vt_0x28__19dLytMsgWindowWood_cCFv = .text:0x801262C0; // type:function size:0x4C +setText__19dLytMsgWindowWood_cFPCw = .text:0x80126310; // type:function size:0x7C +vt_0x3C__19dLytMsgWindowWood_cCFv = .text:0x80126390; // type:function size:0x8 +vt_0x38__19dLytMsgWindowWood_cFv = .text:0x801263A0; // type:function size:0x8 +vt_0x34__19dLytMsgWindowWood_cFv = .text:0x801263B0; // type:function size:0x8 +vt_0x30__19dLytMsgWindowWood_cFv = .text:0x801263C0; // type:function size:0x8 +__sinit_\d_lyt_msg_window_wood_cpp = .text:0x801263D0; // type:function size:0x338 scope:local +__dt__34sFStateID_c<19dLytMsgWindowWood_c>Fv = .text:0x80126710; // type:function size:0x58 +isSameName__34sFStateID_c<19dLytMsgWindowWood_c>CFPCc = .text:0x80126770; // type:function size:0x88 fn_80126800 = .text:0x80126800; // type:function size:0x284 fn_80126A90 = .text:0x80126A90; // type:function size:0xD8 fn_80126B70 = .text:0x80126B70; // type:function size:0x8 @@ -31963,15 +31963,15 @@ __vt__13DoButtonClass = .data:0x8051AA60; // type:object size:0x16C __vt__29sFStateID_c<14dLytDobutton_c> = .data:0x8051ABCC; // type:object size:0x34 lbl_8051AC00 = .data:0x8051AC00; // type:object size:0xC lbl_8051AC0C = .data:0x8051AC0C; // type:object size:0xC -lbl_8051AC18 = .data:0x8051AC18; // type:object size:0x14 -lbl_8051AC2C = .data:0x8051AC2C; // type:object size:0xC -lbl_8051AC38 = .data:0x8051AC38; // type:object size:0x14 -lbl_8051AC4C = .data:0x8051AC4C; // type:object size:0x10 -lbl_8051AC5C = .data:0x8051AC5C; // type:object size:0x18 +lbl_8051AC18 = .data:0x8051AC18; // type:object size:0x11 data:string +lbl_8051AC2C = .data:0x8051AC2C; // type:object size:0xB data:string +lbl_8051AC38 = .data:0x8051AC38; // type:object size:0x13 data:string +lbl_8051AC4C = .data:0x8051AC4C; // type:object size:0xD data:string +lbl_8051AC5C = .data:0x8051AC5C; // type:object size:0x15 data:string lbl_8051AC74 = .data:0x8051AC74; // type:object size:0xC data:string -lbl_8051AC80 = .data:0x8051AC80; // type:object size:0x14 -lbl_8051AC94 = .data:0x8051AC94; // type:object size:0x10 -lbl_8051ACA4 = .data:0x8051ACA4; // type:object size:0x34 +lbl_8051AC80 = .data:0x8051AC80; // type:object size:0x12 data:string +lbl_8051AC94 = .data:0x8051AC94; // type:object size:0xE data:string +__vt__16dLytCommonABtn_c = .data:0x8051ACA4; // type:object size:0x34 lbl_8051ACD8 = .data:0x8051ACD8; // type:object size:0x18 data:string lbl_8051ACF0 = .data:0x8051ACF0; // type:object size:0x9 data:string lbl_8051ACFC = .data:0x8051ACFC; // type:object size:0x1C data:string @@ -32234,18 +32234,18 @@ lbl_8051D694 = .data:0x8051D694; // type:object size:0xC lbl_8051D6A0 = .data:0x8051D6A0; // type:object size:0x18 LytMsgWindowSword__vtable = .data:0x8051D6B8; // type:object size:0x1B4 lbl_8051D86C = .data:0x8051D86C; // type:object size:0x34 -lbl_8051D8A0 = .data:0x8051D8A0; // type:object size:0x1C -lbl_8051D8BC = .data:0x8051D8BC; // type:object size:0xC -lbl_8051D8C8 = .data:0x8051D8C8; // type:object size:0x1C -lbl_8051D8E4 = .data:0x8051D8E4; // type:object size:0xC -lbl_8051D8F0 = .data:0x8051D8F0; // type:object size:0x1C -lbl_8051D90C = .data:0x8051D90C; // type:object size:0xC -lbl_8051D918 = .data:0x8051D918; // type:object size:0xC -lbl_8051D924 = .data:0x8051D924; // type:object size:0x10 -lbl_8051D934 = .data:0x8051D934; // type:object size:0x10 -lbl_8051D944 = .data:0x8051D944; // type:object size:0xC -lbl_8051D950 = .data:0x8051D950; // type:object size:0x18 -lbl_8051D968 = .data:0x8051D968; // type:object size:0x16C +lbl_8051D8A0 = .data:0x8051D8A0; // type:object size:0x19 data:string +lbl_8051D8BC = .data:0x8051D8BC; // type:object size:0xB data:string +lbl_8051D8C8 = .data:0x8051D8C8; // type:object size:0x1B data:string +lbl_8051D8E4 = .data:0x8051D8E4; // type:object size:0xA data:string +lbl_8051D8F0 = .data:0x8051D8F0; // type:object size:0x1A data:string +lbl_8051D90C = .data:0x8051D90C; // type:object size:0xA data:string +lbl_8051D918 = .data:0x8051D918; // type:object size:0xB data:string +lbl_8051D924 = .data:0x8051D924; // type:object size:0xD data:string +lbl_8051D934 = .data:0x8051D934; // type:object size:0xE data:string +lbl_8051D944 = .data:0x8051D944; // type:object size:0x9 data:string +lbl_8051D950 = .data:0x8051D950; // type:object size:0x16 data:string +__vt__19dLytMsgWindowWood_c = .data:0x8051D968; // type:object size:0x44 lbl_8051DAD4 = .data:0x8051DAD4; // type:object size:0x34 lbl_8051DB08 = .data:0x8051DB08; // type:object size:0x1C lbl_8051DB24 = .data:0x8051DB24; // type:object size:0xC @@ -38208,7 +38208,7 @@ lbl_805725D0 = .sdata:0x805725D0; // type:object size:0x8 data:4byte lbl_805725D8 = .sdata:0x805725D8; // type:object size:0x8 data:4byte lbl_805725E0 = .sdata:0x805725E0; // type:object size:0x8 data:4byte lbl_805725E8 = .sdata:0x805725E8; // type:object size:0x8 data:4byte -lbl_805725F0 = .sdata:0x805725F0; // type:object size:0x8 data:4byte +lbl_805725F0 = .sdata:0x805725F0; // type:object size:0x4 data:4byte lbl_805725F8 = .sdata:0x805725F8; // type:object size:0x8 data:4byte lbl_80572600 = .sdata:0x80572600; // type:object size:0x8 data:4byte lbl_80572608 = .sdata:0x80572608; // type:object size:0x8 data:4byte @@ -48858,11 +48858,11 @@ LytMsgWindowSword__STATE_IN = .bss:0x805AED00; // type:object size:0x40 data:4by LytMsgWindowSword__STATE_WAIT = .bss:0x805AED40; // type:object size:0x40 data:4byte LytMsgWindowSword__STATE_VISIBLE = .bss:0x805AED80; // type:object size:0x40 data:4byte LytMsgWindowSword__STATE_OUT = .bss:0x805AEDC0; // type:object size:0x30 data:4byte -lbl_805AEDF0 = .bss:0x805AEDF0; // type:object size:0x10 -LytMsgWindowWood__STATE_INVISIBLE = .bss:0x805AEE00; // type:object size:0x40 data:4byte -LytMsgWindowWood__STATE_IN = .bss:0x805AEE40; // type:object size:0x40 data:4byte -LytMsgWindowWood__STATE_VISIBLE = .bss:0x805AEE80; // type:object size:0x40 data:4byte -LytMsgWindowWood__STATE_OUT = .bss:0x805AEEC0; // type:object size:0x30 data:4byte +lbl_805AEDF0 = .bss:0x805AEDF0; // type:object size:0xC +StateID_Invisible__19dLytMsgWindowWood_c = .bss:0x805AEE00; // type:object size:0x30 data:4byte +StateID_In__19dLytMsgWindowWood_c = .bss:0x805AEE40; // type:object size:0x30 data:4byte +StateID_Visible__19dLytMsgWindowWood_c = .bss:0x805AEE80; // type:object size:0x30 data:4byte +StateID_Out__19dLytMsgWindowWood_c = .bss:0x805AEEC0; // type:object size:0x30 data:4byte lbl_805AEEF0 = .bss:0x805AEEF0; // type:object size:0x10 LytMsgWindowStone__STATE_INVISIBLE = .bss:0x805AEF00; // type:object size:0x40 data:4byte LytMsgWindowStone__STATE_IN = .bss:0x805AEF40; // type:object size:0x40 data:4byte diff --git a/configure.py b/configure.py index 085daf4e..c5fbf426 100644 --- a/configure.py +++ b/configure.py @@ -404,17 +404,18 @@ config.libs = [ Object(NonMatching, "d/lyt/meter/d_lyt_meter_heart.cpp"), Object(NonMatching, "d/lyt/meter/d_lyt_meter_shield_gauge.cpp"), Object(NonMatching, "d/lyt/d_lyt_do_button.cpp"), + Object(Matching, "d/lyt/d_lyt_common_a_btn.cpp"), Object(Matching, "d/lyt/d_lyt_common_icon_material.cpp"), Object(Matching, "d/lyt/d_lyt_common_icon_item.cpp"), - Object(NonMatching, "d/lyt/d_lyt_msg_window.cpp"), - Object(NonMatching, "d/lyt/d_lyt_msg_window_select_btn.cpp"), - Object(NonMatching, "d/lyt/d_lyt_msg_window_talk.cpp"), - Object(NonMatching, "d/lyt/d_lyt_msg_window_link.cpp"), - Object(NonMatching, "d/lyt/d_lyt_msg_window_get.cpp"), - Object(NonMatching, "d/lyt/d_lyt_msg_window_sword.cpp"), - Object(NonMatching, "d/lyt/d_lyt_msg_window_wood.cpp"), - Object(NonMatching, "d/lyt/d_lyt_msg_window_stone.cpp"), - Object(NonMatching, "d/lyt/d_lyt_msg_window_demo.cpp"), + Object(NonMatching, "d/lyt/msg_window/d_lyt_msg_window.cpp"), + Object(NonMatching, "d/lyt/msg_window/d_lyt_msg_window_select_btn.cpp"), + Object(NonMatching, "d/lyt/msg_window/d_lyt_msg_window_talk.cpp"), + Object(NonMatching, "d/lyt/msg_window/d_lyt_msg_window_link.cpp"), + Object(NonMatching, "d/lyt/msg_window/d_lyt_msg_window_get.cpp"), + Object(NonMatching, "d/lyt/msg_window/d_lyt_msg_window_sword.cpp"), + Object(Matching, "d/lyt/msg_window/d_lyt_msg_window_wood.cpp"), + Object(NonMatching, "d/lyt/msg_window/d_lyt_msg_window_stone.cpp"), + Object(NonMatching, "d/lyt/msg_window/d_lyt_msg_window_demo.cpp"), Object(NonMatching, "d/lyt/d_lyt_simple_window.cpp"), Object(NonMatching, "d/lyt/d_lyt_auto_caption.cpp"), Object(NonMatching, "d/lyt/d_lyt_auto_explain.cpp"), diff --git a/include/d/d_sys.h b/include/d/d_sys.h index 02a9c127..a9d6ff9c 100644 --- a/include/d/d_sys.h +++ b/include/d/d_sys.h @@ -7,6 +7,7 @@ namespace dSys { void setFrameRate(u32); +u8 getFrameRate(); void setClearColor(mColor clr); } // namespace dSys_c diff --git a/include/d/lyt/d2d.h b/include/d/lyt/d2d.h index a1015f1f..50dddb7e 100644 --- a/include/d/lyt/d2d.h +++ b/include/d/lyt/d2d.h @@ -44,10 +44,10 @@ class Multi_c : public m2d::Base_c { public: Multi_c(); virtual ~Multi_c() {} - virtual void draw() override; - virtual void animate(); - virtual void calc(); - virtual bool build(const char *name, m2d::ResAccIf_c *acc); + /* vt 0x0C */ virtual void draw() override; + /* vt 0x10 */ virtual void animate(); + /* vt 0x18 */ virtual void calc(); + /* vt 0x18 */ virtual bool build(const char *name, m2d::ResAccIf_c *acc); void calcBefore(); void calcAfter(); @@ -79,11 +79,11 @@ class LytBase_c : public Multi_c { public: LytBase_c(); virtual ~LytBase_c(); - virtual void draw() override { + /* vt 0x0C */ virtual void draw() override { mLayout.Draw(mDrawInfo); }; - virtual bool build(const char *name, m2d::ResAccIf_c *acc) override; + /* vt 0x18 */ virtual bool build(const char *name, m2d::ResAccIf_c *acc) override; dTextBox_c *getTextBox(const char *name); dTextBox_c *getSizeBoxInWindow(const char *windowName); dWindow_c *getWindow(const char *name); @@ -131,9 +131,11 @@ private: class dSubPane; struct SubPaneListNode { - nw4r::ut::LinkListNode mNode; - dSubPane *mpLytPane; - nw4r::lyt::Pane *mpPane; + /* 0x00 */ nw4r::ut::LinkListNode mNode; + /** The d lyt pane, set by the UI element */ + /* 0x08 */ dSubPane *mpLytPane; + /** The nw4r lyt pane, set by linkMeters */ + /* 0x0C */ nw4r::lyt::Pane *mpPane; }; typedef nw4r::ut::LinkList SubPaneList; @@ -141,24 +143,24 @@ typedef nw4r::ut::LinkList Su class dSubPane { public: dSubPane() : field_0x04(false), field_0x05(0) {} - virtual ~dSubPane() {} - virtual bool build(ResAccIf_c *resAcc) = 0; - virtual bool remove() = 0; - virtual bool execute() = 0; - virtual nw4r::lyt::Pane *getPane() = 0; - virtual LytBase_c *getLyt() = 0; - virtual const char *getName() const = 0; - virtual bool LytMeter0x24() const { + /* vt 0x08 */ virtual ~dSubPane() {} + /* vt 0x0C */ virtual bool build(ResAccIf_c *resAcc) = 0; + /* vt 0x10 */ virtual bool remove() = 0; + /* vt 0x14 */ virtual bool execute() = 0; + /* vt 0x18 */ virtual nw4r::lyt::Pane *getPane() = 0; + /* vt 0x1C */ virtual LytBase_c *getLyt() = 0; + /* vt 0x20 */ virtual const char *getName() const = 0; + /* vt 0x24 */ virtual bool LytMeter0x24() const { return field_0x04; } - virtual void LytMeter0x28(bool arg) { + /* vt 0x28 */ virtual void LytMeter0x28(bool arg) { field_0x04 = arg; } - virtual u8 LytMeter0x2C() const { + /* vt 0x2C */ virtual u8 LytMeter0x2C() const { return field_0x05; } - virtual void LytMeter0x30(u8 arg) { + /* vt 0x30 */ virtual void LytMeter0x30(u8 arg) { field_0x05 = arg; } @@ -178,9 +180,9 @@ struct AnmGroupBase_c { bool init(const char *fileName, m2d::ResAccIf_c *acc, d2d::Layout_c *layout, const char *animName); bool init(nw4r::lyt::AnimTransform *transform, const char *fileName, m2d::ResAccIf_c *acc, nw4r::lyt::Group *group); - bool setDirection(bool backwards); + bool bind(bool bDisable); bool unbind(); - bool afterUnbind(); + bool remove(); void setAnimEnable(bool); void setAnmFrame(f32); void syncAnmFrame(); @@ -188,7 +190,7 @@ struct AnmGroupBase_c { void setBackward(); inline void setFrameAndControlThings(f32 frame) { - setDirection(false); + bind(false); setAnimEnable(true); mpFrameCtrl->setFrame(frame); syncAnmFrame(); diff --git a/include/d/lyt/d_lyt_common_a_btn.h b/include/d/lyt/d_lyt_common_a_btn.h new file mode 100644 index 00000000..dc38a6ae --- /dev/null +++ b/include/d/lyt/d_lyt_common_a_btn.h @@ -0,0 +1,103 @@ +#ifndef D_LYT_COMMON_A_BTN_H +#define D_LYT_COMMON_A_BTN_H + +#include "d/lyt/d2d.h" + +/** + * Made up name. + * + * An A button used in various message windows, as well as + * the title menu. Can be hidden, visible, animating in, animating out. + */ +class dLytCommonABtn_c : public d2d::dSubPane { +public: + virtual bool build(d2d::ResAccIf_c *resAcc) override; + virtual bool remove() override; + virtual bool execute() 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(); + } + + void openMaybe() { + field_0x1B0 = 1; + } + + void closeMaybe() { + field_0x1B0 = 0; + } + + u8 shouldBeOpen() const { + return field_0x1B0; + } + + u8 isDoneOut() const { + return mIsDoneOut; + } + + bool requestIn(); + bool requestOut(bool b); + + enum SoundVariant { + VARIANT_NORMAL, + VARIANT_TITLE, + }; + + void setSoundVariant(SoundVariant); + void resetToInvisble(); + + enum ABtnState { + STATE_INVISIBLE, + STATE_IN, + STATE_VISIBLE, + STATE_OUT, + }; + +private: + + enum OutState { + OUT_STATE_DECIDING, + OUT_STATE_GOTO_OUT, + OUT_STATE_OUT, + OUT_STATE_GOTO_INVISIBLE, + }; + + void setState(ABtnState state); + + void runExecuteFunc(); + + void executeStateInvisible(); + void executeStateIn(); + void executeStateVisible(); + void executeStateDecideOut(); + + void gotoStateInvisible(); + void gotoStateIn(); + void goToStateVisible(); + void goToStateDecideOut(); + + typedef void (dLytCommonABtn_c::*executeFunc)(void); + static const executeFunc sExecuteFuncs[4]; + + /* 0x008 */ d2d::dLytSub mLyt; + /* 0x09C */ d2d::AnmGroup_c mAnm[4]; + /* 0x19C */ ABtnState mState; + /* 0x1A0 */ OutState mOutState; + /* 0x1A4 */ SoundVariant mSoundVariant; + /* 0x1A8 */ u8 field_0x1A8; + /* 0x1A9 */ bool mInRequested; + /* 0x1AA */ bool mOutRequested; + /* 0x1AB */ bool mIsDoneOut; + /* 0x1AC */ u8 field_0x1AC; + /* 0x1AD */ bool mNoDecide; + /* 0x1AE */ u8 field_0x1AE; + /* 0x1AF */ u8 field_0x1AF; + /* 0x1B0 */ u8 field_0x1B0; +}; + +#endif diff --git a/include/d/lyt/d_textbox.h b/include/d/lyt/d_textbox.h index b3a69449..cfbd3396 100644 --- a/include/d/lyt/d_textbox.h +++ b/include/d/lyt/d_textbox.h @@ -5,6 +5,8 @@ #include "nw4r/lyt/lyt_textBox.h" #include "nw4r/lyt/lyt_types.h" +class dTagProcessor_c; + class dTextBox_c : public nw4r::lyt::TextBox { friend class dWindow_c; @@ -26,6 +28,10 @@ public: nw4r::lyt::TextBox::SetFontSize(value); } + void set0x1F6(u8 val) { + field_0x1F6 = val; + } + void set0x1F8(u8 val) { field_0x1F8 = val; } @@ -39,6 +45,7 @@ public: } void fn_800AF930(const wchar_t *); + void fn_800AF540(const wchar_t *text, dTagProcessor_c *tagProcessor, ...); // @bug: This does not implement UT's RTTI, so casts to dTextBox_c will // succeed even if all you have is a lyt::TextBox @@ -49,7 +56,9 @@ private: /* 0x108 */ u8 field_0x108[0x118 - 0x108]; /* 0x118 */ nw4r::lyt::Size mTextScale; /* 0x120 */ f32 mScale; - /* 0x124 */ u8 field_0x124[0x1F8 - 0x124]; + /* 0x124 */ u8 field_0x124[0x1F6 - 0x124]; + /* 0x1F6 */ u8 field_0x1F6; + /* 0x1F7 */ u8 field_0x1F7; /* 0x1F8 */ u8 field_0x1F8; /* 0x1F9 */ u8 field_0x1F9[0x204 - 0x1F9]; }; diff --git a/include/d/lyt/msg_window/d_lyt_msg_window_common.h b/include/d/lyt/msg_window/d_lyt_msg_window_common.h new file mode 100644 index 00000000..907cfbfd --- /dev/null +++ b/include/d/lyt/msg_window/d_lyt_msg_window_common.h @@ -0,0 +1,27 @@ +#ifndef D_LYT_MGS_WINDOW_COMMON_H +#define D_LYT_MGS_WINDOW_COMMON_H + +#include "d/d_tag_processor.h" +#include "d/lyt/d2d.h" +#include "m/m2d.h" + +class dLytMsgWindowSubtype : public m2d::Base_c { +public: + /* vt 0x08 */ virtual ~dLytMsgWindowSubtype() {} + // vt 0x0C = m2d::Base_c::draw + /* vt 0x10 */ virtual bool build(void *unk, d2d::ResAccIf_c *resAcc, dTagProcessor_c *tagProcessor); + /* vt 0x14 */ virtual bool remove(); + /* vt 0x18 */ virtual bool execute(); + /* vt 0x1C */ virtual void vt_0x1C(); + /* vt 0x20 */ virtual bool vt_0x20() const; + /* vt 0x24 */ virtual void vt_0x24(); + /* vt 0x28 */ virtual bool vt_0x28() const; + /* vt 0x2C */ virtual bool setText(const wchar_t *text); + /* vt 0x30 */ virtual dTextBox_c *vt_0x30(); + /* vt 0x34 */ virtual void vt_0x34(); + /* vt 0x38 */ virtual void vt_0x38(bool b); + /* vt 0x3C */ virtual u8 vt_0x3C() const; + /* vt 0x40 */ virtual bool vt_0x40() const; +}; + +#endif diff --git a/include/d/lyt/msg_window/d_lyt_msg_window_wood.h b/include/d/lyt/msg_window/d_lyt_msg_window_wood.h new file mode 100644 index 00000000..b3457fc4 --- /dev/null +++ b/include/d/lyt/msg_window/d_lyt_msg_window_wood.h @@ -0,0 +1,55 @@ +#ifndef D_LYT_MSG_WINDOW_WOOD_H +#define D_LYT_MSG_WINDOW_WOOD_H + +#include "d/d_tag_processor.h" +#include "d/lyt/d2d.h" +#include "d/lyt/d_lyt_common_a_btn.h" +#include "d/lyt/d_textbox.h" +#include "d/lyt/msg_window/d_lyt_msg_window_common.h" +#include "nw4r/lyt/lyt_pane.h" +#include "s/s_State.hpp" + +class dLytMsgWindowWood_c : public dLytMsgWindowSubtype { +public: + /* vt 0x08 */ virtual ~dLytMsgWindowWood_c() {} + /* vt 0x0C */ virtual void draw() override; + /* vt 0x10 */ virtual bool build(void *unk, d2d::ResAccIf_c *resAcc, dTagProcessor_c *tagProcessor) override; + /* vt 0x14 */ virtual bool remove() override; + /* vt 0x18 */ virtual bool execute() override; + /* vt 0x1C */ virtual void vt_0x1C() override; + /* vt 0x20 */ virtual bool vt_0x20() const override; + /* vt 0x24 */ virtual void vt_0x24() override; + /* vt 0x28 */ virtual bool vt_0x28() const override; + /* vt 0x2C */ virtual bool setText(const wchar_t *text) override; + /* vt 0x30 */ virtual dTextBox_c *vt_0x30() override { + return mpTextboxes[0]; + } + /* vt 0x34 */ virtual void vt_0x34() override { + mCommon.requestIn(); + } + /* vt 0x38 */ virtual void vt_0x38(bool b) override { + mCommon.requestOut(b); + } + /* vt 0x3C */ virtual u8 vt_0x3C() const override { + return mCommon.isDoneOut(); + } + + STATE_FUNC_DECLARE(dLytMsgWindowWood_c, Invisible); + STATE_FUNC_DECLARE(dLytMsgWindowWood_c, In); + STATE_FUNC_DECLARE(dLytMsgWindowWood_c, Visible); + STATE_FUNC_DECLARE(dLytMsgWindowWood_c, Out); + +private: + /* 0x010 */ UI_STATE_MGR_DECLARE(dLytMsgWindowWood_c); + /* 0x04C */ d2d::SubPaneList mSubpaneList; + /* 0x05C */ d2d::SubPaneListNode mNodes[1]; + /* 0x068 */ d2d::ResAccIf_c mResAcc; + /* 0x3D8 */ d2d::LytBase_c mLyt; + /* 0x468 */ d2d::AnmGroup_c mAnm[3]; + /* 0x528 */ dTextBox_c *mpTextboxes[2]; + /* 0x530 */ nw4r::lyt::Pane *mpPanes[2]; + /* 0x538 */ dTagProcessor_c *mpTagProcessor; + /* 0x53C */ dLytCommonABtn_c mCommon; +}; + +#endif diff --git a/src/d/d_cs_game.cpp b/src/d/d_cs_game.cpp index 3ed7ea18..bc153463 100644 --- a/src/d/d_cs_game.cpp +++ b/src/d/d_cs_game.cpp @@ -234,7 +234,7 @@ bool dCsGame_c::lytItemCursor_c::doInit() { mAnm.init(mAnmGroups.tmp.mAnmGroups, lytItemCursorMap, 0x17, mpResAcc, mLyt.getLayout()); for (int i = 0; i < 0x17; i++) { - mAnmGroups.tmp.mAnmGroups[i].setDirection(false); + mAnmGroups.tmp.mAnmGroups[i].bind(false); mAnmGroups.tmp.mAnmGroups[i].setAnimEnable(false); } diff --git a/src/d/lyt/d2d.cpp b/src/d/lyt/d2d.cpp index 41551895..6e3f4f5c 100644 --- a/src/d/lyt/d2d.cpp +++ b/src/d/lyt/d2d.cpp @@ -811,7 +811,7 @@ bool AnmGroupBase_c::init( return true; } -bool AnmGroupBase_c::setDirection(bool b) { +bool AnmGroupBase_c::bind(bool bDisable) { nw4r::lyt::AnimTransform *anmTransform = mpAnmTransform; if (anmTransform == nullptr) { return false; @@ -823,7 +823,7 @@ bool AnmGroupBase_c::setDirection(bool b) { nw4r::lyt::BindAnimation(mpGroup, anmTransform, false, b); mFlags |= ANMGROUP_FLAG_BOUND; - if (b) { + if (bDisable) { mFlags = (mFlags & ~ANMGROUP_FLAG_ENABLE); } else { mFlags |= ANMGROUP_FLAG_ENABLE; @@ -855,7 +855,7 @@ bool AnmGroupBase_c::unbind() { return true; } -bool AnmGroupBase_c::afterUnbind() { +bool AnmGroupBase_c::remove() { return true; } @@ -905,7 +905,7 @@ bool AnmGroups::init( void AnmGroups::remove() { for (int i = 0; i < mNumAnmGroups; i++) { - mpAnmGroups[i].afterUnbind(); + mpAnmGroups[i].remove(); } } diff --git a/src/d/lyt/d_lyt_area_caption.cpp b/src/d/lyt/d_lyt_area_caption.cpp index e9d5eaf5..97145059 100644 --- a/src/d/lyt/d_lyt_area_caption.cpp +++ b/src/d/lyt/d_lyt_area_caption.cpp @@ -43,7 +43,7 @@ bool dLytAreaCaptionParts_c::init(int first) { mAnmCtrlInUse[i] = false; } else { mAnmGroups[i].init(brlanMap1[i].mFile, &mResAcc, mLyt.getLayout(), brlanMap1[i].mName); - mAnmGroups[i].setDirection(false); + mAnmGroups[i].bind(false); mAnmGroups[i].setAnimEnable(false); mAnmCtrlInUse[i] = true; } @@ -56,7 +56,7 @@ bool dLytAreaCaptionParts_c::init(int first) { mAnmCtrlInUse[i] = false; } else { mAnmGroups[i].init(brlanMap2[i].mFile, &mResAcc, mLyt.getLayout(), brlanMap2[i].mName); - mAnmGroups[i].setDirection(false); + mAnmGroups[i].bind(false); mAnmGroups[i].setAnimEnable(false); mAnmCtrlInUse[i] = true; } @@ -78,7 +78,7 @@ bool dLytAreaCaptionParts_c::remove() { for (int i = 0; i < 4; i++) { if (mAnmCtrlInUse[i]) { mAnmGroups[i].unbind(); - mAnmGroups[i].afterUnbind(); + mAnmGroups[i].remove(); } } mResAcc.detach(); diff --git a/src/d/lyt/d_lyt_battery.cpp b/src/d/lyt/d_lyt_battery.cpp index 1b1f5f16..0f8681d9 100644 --- a/src/d/lyt/d_lyt_battery.cpp +++ b/src/d/lyt/d_lyt_battery.cpp @@ -48,7 +48,7 @@ bool dLytBattery_c::init() { for (int i = 0; i < 4; i++) { mAnmGroups[i].init(brlanMap[i].mFile, &mResAcc, mLyt.getLayout(), brlanMap[i].mName); - mAnmGroups[i].setDirection(false); + mAnmGroups[i].bind(false); mAnmGroups[i].setAnimEnable(false); } diff --git a/src/d/lyt/d_lyt_bird_gauge.cpp b/src/d/lyt/d_lyt_bird_gauge.cpp index 5fd5337a..9ed904f1 100644 --- a/src/d/lyt/d_lyt_bird_gauge.cpp +++ b/src/d/lyt/d_lyt_bird_gauge.cpp @@ -109,7 +109,7 @@ bool dLytBirdGaugeMain_c::build(d2d::ResAccIf_c *resAcc) { for (int i = 0; i < LYT_SKY_GAUGE_MAIN_NUM_ANIMS; i++) { mAnmGroups[i].init(brlanMap[i].mFile, resAcc, mLyt.getLayout(), brlanMap[i].mName); - mAnmGroups[i].setDirection(false); + mAnmGroups[i].bind(false); mAnmGroups[i].setAnimEnable(false); } @@ -148,7 +148,7 @@ bool dLytBirdGaugeMain_c::execute() { bool dLytBirdGaugeMain_c::remove() { mLyt.unbindAnims(); for (int i = 0; i < LYT_SKY_GAUGE_MAIN_NUM_ANIMS; i++) { - mAnmGroups[i].afterUnbind(); + mAnmGroups[i].remove(); } return true; } diff --git a/src/d/lyt/d_lyt_common_a_btn.cpp b/src/d/lyt/d_lyt_common_a_btn.cpp new file mode 100644 index 00000000..056e6397 --- /dev/null +++ b/src/d/lyt/d_lyt_common_a_btn.cpp @@ -0,0 +1,244 @@ + + +#include "d/lyt/d_lyt_common_a_btn.h" + +#include "common.h" +#include "d/d_sys.h" +#include "d/lyt/d2d.h" +#include "toBeSorted/small_sound_mgr.h" + +static const d2d::LytBrlanMapping brlanMap[] = { + { "aBtn_00_in.brlan", "G_inOut_00"}, + { "aBtn_00_loop.brlan", "G_loopBtn_00"}, + {"aBtn_00_decide.brlan", "G_decide_00"}, + { "aBtn_00_out.brlan", "G_inOut_00"}, +}; + +#define MSG_ABTN_ANIM_IN 0 +#define MSG_ABTN_ANIM_LOOP 1 +#define MSG_ABTN_ANIM_DECIDE 2 +#define MSG_ABTN_ANIM_OUT 3 + +#define MSG_ABTN_NUM_ANIMS 4 + +const dLytCommonABtn_c::executeFunc dLytCommonABtn_c::sExecuteFuncs[4] = { + &dLytCommonABtn_c::executeStateInvisible, + &dLytCommonABtn_c::executeStateIn, + &dLytCommonABtn_c::executeStateVisible, + &dLytCommonABtn_c::executeStateDecideOut, +}; + +bool dLytCommonABtn_c::build(d2d::ResAccIf_c *resAcc) { + mLyt.setResAcc(resAcc); + mLyt.build("aBtn_00.brlyt", nullptr); + + for (int i = 0; i < MSG_ABTN_NUM_ANIMS; i++) { + mAnm[i].init(brlanMap[i].mFile, resAcc, mLyt.getLayout(), brlanMap[i].mName); + } + + resetToInvisble(); + setSoundVariant(VARIANT_NORMAL); + return true; +} + +bool dLytCommonABtn_c::remove() { + for (int i = 0; i < MSG_ABTN_NUM_ANIMS; i++) { + mAnm[i].remove(); + } + return true; +} + +bool dLytCommonABtn_c::execute() { + runExecuteFunc(); + if (mState == STATE_INVISIBLE) { + return true; + } + mLyt.calc(); + return true; +} + +bool dLytCommonABtn_c::requestIn() { + if (mState != STATE_INVISIBLE) { + return false; + } + mInRequested = true; + return true; +} + +bool dLytCommonABtn_c::requestOut(bool b) { + if (mState != STATE_VISIBLE) { + return false; + } + mOutRequested = true; + field_0x1AC = b; + return true; +} + +void dLytCommonABtn_c::resetToInvisble() { + gotoStateInvisible(); +} + +void dLytCommonABtn_c::setSoundVariant(SoundVariant value) { + mSoundVariant = value; +} + +void dLytCommonABtn_c::runExecuteFunc() { + executeFunc fn = sExecuteFuncs[mState]; + if (fn != nullptr) { + (this->*fn)(); + } +} + +void dLytCommonABtn_c::gotoStateInvisible() { + setState(STATE_INVISIBLE); + mLyt.unbindAnims(); + + d2d::AnmGroup_c &inAnim = mAnm[MSG_ABTN_ANIM_IN]; + field_0x1A8 = 0; + mInRequested = false; + mOutRequested = false; + mIsDoneOut = false; + field_0x1AC = 0; + mNoDecide = false; + + inAnim.bind(false); + inAnim.setAnimEnable(true); + inAnim.setFrame(0.0f); + if (dSys::getFrameRate() == 1) { + inAnim.setRate(0.5f); + } else { + inAnim.setRate(1.0f); + } + mLyt.calc(); +} + +void dLytCommonABtn_c::executeStateInvisible() { + if (mInRequested != true) { + return; + } + + if (field_0x1AC == 1) { + gotoStateInvisible(); + } + mInRequested = false; + field_0x1A8 = 1; + gotoStateIn(); +} + +void dLytCommonABtn_c::gotoStateIn() { + setState(STATE_IN); +} + +void dLytCommonABtn_c::executeStateIn() { + d2d::AnmGroup_c &anm = mAnm[MSG_ABTN_ANIM_IN]; + if (anm.isEndReached() == true) { + goToStateVisible(); + } else { + anm.play(); + } +} + +void dLytCommonABtn_c::goToStateVisible() { + setState(STATE_VISIBLE); + mAnm[MSG_ABTN_ANIM_IN].unbind(); + d2d::AnmGroup_c &anm = mAnm[MSG_ABTN_ANIM_LOOP]; + anm.bind(false); + anm.setFrame(0.0f); + if (dSys::getFrameRate() == 1) { + anm.setRate(0.5f); + } else { + anm.setRate(1.0f); + } +} + +void dLytCommonABtn_c::executeStateVisible() { + if (mOutRequested == true) { + goToStateDecideOut(); + mOutRequested = false; + } else { + d2d::AnmGroup_c &anm = mAnm[MSG_ABTN_ANIM_LOOP]; + anm.play(); + } +} + +void dLytCommonABtn_c::goToStateDecideOut() { + setState(STATE_OUT); + mAnm[MSG_ABTN_ANIM_LOOP].unbind(); + if (mNoDecide == true) { + mNoDecide = false; + d2d::AnmGroup_c &anm = mAnm[MSG_ABTN_ANIM_OUT]; + anm.bind(false); + anm.setFrame(0.0f); + if (dSys::getFrameRate() == 1) { + anm.setRate(0.5f); + } else { + anm.setRate(1.0f); + } + mOutState = OUT_STATE_OUT; + } else { + d2d::AnmGroup_c &anm = mAnm[MSG_ABTN_ANIM_DECIDE]; + anm.bind(false); + anm.setAnimEnable(true); + anm.setFrame(0.0f); + if (dSys::getFrameRate() == 1) { + anm.setRate(0.5f); + } else { + anm.setRate(1.0f); + } + if (mSoundVariant == VARIANT_NORMAL) { + SmallSoundManager::GetInstance()->playSound(SE_S_WINDOW_PRESS_A); + } else { + SmallSoundManager::GetInstance()->playSound(SE_S_TITLE_PRESS_START); + } + } +} + +void dLytCommonABtn_c::executeStateDecideOut() { + d2d::AnmGroup_c &decideAnm = mAnm[MSG_ABTN_ANIM_DECIDE]; + switch (mOutState) { + case OUT_STATE_DECIDING: { + if (decideAnm.isEndReached() == true) { + mOutState = OUT_STATE_GOTO_OUT; + if (field_0x1AC == 1) { + mIsDoneOut = true; + setState(STATE_INVISIBLE); + break; + } + } + decideAnm.play(); + break; + } + case OUT_STATE_GOTO_OUT: { + decideAnm.unbind(); + d2d::AnmGroup_c &anmOut = mAnm[MSG_ABTN_ANIM_OUT]; + anmOut.bind(false); + anmOut.setAnimEnable(true); + anmOut.setFrame(0.0f); + if (dSys::getFrameRate() == 1) { + anmOut.setRate(0.5f); + } else { + anmOut.setRate(1.0f); + } + mOutState = OUT_STATE_OUT; + break; + } + case OUT_STATE_OUT: { + d2d::AnmGroup_c &anmOut = mAnm[MSG_ABTN_ANIM_OUT]; + if (anmOut.isEndReached() == true) { + mOutState = OUT_STATE_GOTO_INVISIBLE; + mIsDoneOut = true; + } + anmOut.play(); + break; + } + case OUT_STATE_GOTO_INVISIBLE: { + gotoStateInvisible(); + break; + } + } +} + +void dLytCommonABtn_c::setState(ABtnState state) { + mState = state; + mOutState = OUT_STATE_DECIDING; +} diff --git a/src/d/lyt/d_lyt_common_arrow.cpp b/src/d/lyt/d_lyt_common_arrow.cpp index 5126fbba..2590df0a 100644 --- a/src/d/lyt/d_lyt_common_arrow.cpp +++ b/src/d/lyt/d_lyt_common_arrow.cpp @@ -60,7 +60,7 @@ bool dLytCommonArrow_c::fn_80168490() { d2d::dLytStructDList::GetInstance()->removeFromList2(&mStructD); mLytBase.unbindAnims(); for (int i = 0; i < 9; i++) { - mAnmGroups[i].afterUnbind(); + mAnmGroups[i].remove(); } return true; } diff --git a/src/d/lyt/d_lyt_common_icon_item.cpp b/src/d/lyt/d_lyt_common_icon_item.cpp index c4fc6a66..fd0ea926 100644 --- a/src/d/lyt/d_lyt_common_icon_item.cpp +++ b/src/d/lyt/d_lyt_common_icon_item.cpp @@ -45,7 +45,7 @@ bool dLytCommonIconItemPart1_c::build(d2d::ResAccIf_c *resAcc) { mLyt.build("commonIcon_02.brlyt", nullptr); for (int i = 0; i < ITEM_PART_1_NUM_ANIMS; i++) { mAnm[i].init(brlanMapPart1[i].mFile, resAcc, mLyt.getLayout(), brlanMapPart1[i].mName); - mAnm[i].setDirection(false); + mAnm[i].bind(false); mAnm[i].setRate(1.0f); } @@ -61,7 +61,7 @@ bool dLytCommonIconItemPart1_c::build(d2d::ResAccIf_c *resAcc) { bool dLytCommonIconItemPart1_c::remove() { for (int i = 0; i < ITEM_PART_1_NUM_ANIMS; i++) { mAnm[i].unbind(); - mAnm[i].afterUnbind(); + mAnm[i].remove(); } return true; } @@ -276,7 +276,7 @@ bool dLytCommonIconItemPart2_c::build(d2d::ResAccIf_c *resAcc) { mLyt.build("commonIcon_03.brlyt", nullptr); for (int i = 0; i < ITEM_PART_2_NUM_ANIMS; i++) { mAnm[i].init(brlanMapPart2[i].mFile, resAcc, mLyt.getLayout(), brlanMapPart2[i].mName); - mAnm[i].setDirection(false); + mAnm[i].bind(false); mAnm[i].setRate(1.0f); } @@ -292,7 +292,7 @@ bool dLytCommonIconItemPart2_c::build(d2d::ResAccIf_c *resAcc) { bool dLytCommonIconItemPart2_c::remove() { for (int i = 0; i < ITEM_PART_2_NUM_ANIMS; i++) { mAnm[i].unbind(); - mAnm[i].afterUnbind(); + mAnm[i].remove(); } return true; } @@ -600,7 +600,7 @@ bool dLytCommonIconItemPart3_c::build(d2d::ResAccIf_c *resAcc) { mLyt.build("commonIcon_04.brlyt", nullptr); for (int i = 0; i < ITEM_PART_3_NUM_ANIMS; i++) { mAnm[i].init(brlanMapPart3[i].mFile, resAcc, mLyt.getLayout(), brlanMapPart3[i].mName); - mAnm[i].setDirection(false); + mAnm[i].bind(false); mAnm[i].setRate(1.0f); } @@ -612,7 +612,7 @@ bool dLytCommonIconItemPart3_c::build(d2d::ResAccIf_c *resAcc) { bool dLytCommonIconItemPart3_c::remove() { for (int i = 0; i < ITEM_PART_3_NUM_ANIMS; i++) { mAnm[i].unbind(); - mAnm[i].afterUnbind(); + mAnm[i].remove(); } return true; } diff --git a/src/d/lyt/d_lyt_common_icon_material.cpp b/src/d/lyt/d_lyt_common_icon_material.cpp index 72799255..9463bbbc 100644 --- a/src/d/lyt/d_lyt_common_icon_material.cpp +++ b/src/d/lyt/d_lyt_common_icon_material.cpp @@ -41,7 +41,7 @@ bool dLytCommonIconMaterialPart1_c::build(d2d::ResAccIf_c *resAcc) { mLyt.build("commonIcon_00.brlyt", nullptr); for (int i = 0; i < MATERIAL_PART_1_NUM_ANIMS; i++) { mAnm[i].init(brlanMapPart1[i].mFile, resAcc, mLyt.getLayout(), brlanMapPart1[i].mName); - mAnm[i].setDirection(false); + mAnm[i].bind(false); mAnm[i].setRate(1.0f); } @@ -57,7 +57,7 @@ bool dLytCommonIconMaterialPart1_c::build(d2d::ResAccIf_c *resAcc) { bool dLytCommonIconMaterialPart1_c::remove() { for (int i = 0; i < MATERIAL_PART_1_NUM_ANIMS; i++) { mAnm[i].unbind(); - mAnm[i].afterUnbind(); + mAnm[i].remove(); } return true; } @@ -240,7 +240,7 @@ bool dLytCommonIconMaterialPart2_c::build(d2d::ResAccIf_c *resAcc) { mLyt.build("commonIcon_01.brlyt", nullptr); for (int i = 0; i < MATERIAL_PART_2_NUM_ANIMS; i++) { mAnm[i].init(brlanMapPart2[i].mFile, resAcc, mLyt.getLayout(), brlanMapPart2[i].mName); - mAnm[i].setDirection(false); + mAnm[i].bind(false); mAnm[i].setRate(1.0f); } @@ -256,7 +256,7 @@ bool dLytCommonIconMaterialPart2_c::build(d2d::ResAccIf_c *resAcc) { bool dLytCommonIconMaterialPart2_c::remove() { for (int i = 0; i < MATERIAL_PART_2_NUM_ANIMS; i++) { mAnm[i].unbind(); - mAnm[i].afterUnbind(); + mAnm[i].remove(); } return true; } diff --git a/src/d/lyt/d_lyt_fader.cpp b/src/d/lyt/d_lyt_fader.cpp index 8e215e89..4b27ae73 100644 --- a/src/d/lyt/d_lyt_fader.cpp +++ b/src/d/lyt/d_lyt_fader.cpp @@ -16,7 +16,7 @@ dLytFader_c::~dLytFader_c() { if (field_0x4DD == true) { for (int i = 0; i < 3; i++) { - mLytStructAs[i].afterUnbind(); + mLytStructAs[i].remove(); } mResAcc.detach(); } @@ -27,7 +27,7 @@ void dLytFader_c::setStatus(EStatus status) { mStatus = FADED_OUT; mLytBase.unbindAnims(); d2d::AnmGroup_c *s = &mLytStructAs[0]; - s->setDirection(false); + s->bind(false); s->setToEnd(); s->setAnimEnable(true); s->play(); @@ -38,7 +38,7 @@ void dLytFader_c::setStatus(EStatus status) { mStatus = FADED_IN; mLytBase.unbindAnims(); d2d::AnmGroup_c *s = &mLytStructAs[0]; - s->setDirection(false); + s->bind(false); s->setFrame(0.0f); s->setAnimEnable(true); mLytBase.calc(); @@ -109,7 +109,7 @@ void dLytFader_c::fn_801758F0() { fn_80175BC0(0); mLytBase.unbindAnims(); d2d::AnmGroup_c *s = &mLytStructAs[0]; - s->setDirection(false); + s->bind(false); s->setFrame(0.0f); s->setRate(20.0f / (mFrame - 1)); s->setAnimEnable(true); @@ -130,7 +130,7 @@ void dLytFader_c::fn_80175A50() { fn_80175BC0(1); mLytBase.unbindAnims(); d2d::AnmGroup_c *s = &mLytStructAs[1]; - s->setDirection(false); + s->bind(false); s->setFrame(0.0f); s->setRate(20.0f / (mFrame - 1)); s->setAnimEnable(true); diff --git a/src/d/lyt/d_lyt_map.cpp b/src/d/lyt/d_lyt_map.cpp index 38d5335d..d01e6942 100644 --- a/src/d/lyt/d_lyt_map.cpp +++ b/src/d/lyt/d_lyt_map.cpp @@ -207,7 +207,7 @@ void dLytMapPinIcon_c::finalizeState_Wait() {} void dLytMapPinIcon_c::initializeState_ToSelect() { d2d::AnmGroup_c *m = &mAnmGroups[1]; - m->setDirection(false); + m->bind(false); m->setFrame(0.0f); } void dLytMapPinIcon_c::executeState_ToSelect() { @@ -255,7 +255,7 @@ bool dLytMapPinIcon_c::build(d2d::ResAccIf_c *resAcc) { for (int i = 0; i < 3; i++) { pAnmGroups[i].init(sMapPinIconBrlanMap[i].mFile, resAcc, mLyt.getLayout(), sMapPinIconBrlanMap[i].mName); - pAnmGroups[i].setDirection(false); + pAnmGroups[i].bind(false); pAnmGroups[i].setFrame(0.0f); } @@ -269,8 +269,8 @@ bool dLytMapPinIcon_c::build(d2d::ResAccIf_c *resAcc) { mStructD.fn_80065E70(mpBounding, 2, 1, 0); d2d::dLytStructDList::GetInstance()->appendToList2(&mStructD); - mAnmGroups[LYT_MAP_PIN_ICON_ANIM_SCALE].setDirection(false); - mAnmGroups[LYT_MAP_PIN_ICON_ANIM_LOOP].setDirection(false); + mAnmGroups[LYT_MAP_PIN_ICON_ANIM_SCALE].bind(false); + mAnmGroups[LYT_MAP_PIN_ICON_ANIM_LOOP].bind(false); mLyt.calc(); @@ -284,7 +284,7 @@ bool dLytMapPinIcon_c::build(d2d::ResAccIf_c *resAcc) { bool dLytMapPinIcon_c::remove() { d2d::dLytStructDList::GetInstance()->removeFromList2(&mStructD); for (int i = 0; i < 3; i++) { - mAnmGroups[i].afterUnbind(); + mAnmGroups[i].remove(); } return true; } diff --git a/src/d/lyt/d_lyt_note.cpp b/src/d/lyt/d_lyt_note.cpp index e4b83f07..5bde50d7 100644 --- a/src/d/lyt/d_lyt_note.cpp +++ b/src/d/lyt/d_lyt_note.cpp @@ -142,7 +142,7 @@ bool dLytNote_c::build(d2d::ResAccIf_c *resAcc) { for (int i = 0; i < 6; i++) { mAnmGroups[i].init(brlanMap[i].mFile, resAcc, mLyt.getLayout(), brlanMap[i].mName); - mAnmGroups[i].setDirection(false); + mAnmGroups[i].bind(false); mAnmGroups[i].setAnimEnable(false); } @@ -168,7 +168,7 @@ bool dLytNote_c::build(d2d::ResAccIf_c *resAcc) { bool dLytNote_c::remove() { for (int i = 0; i < 6; i++) { // @bug? .unbind call is missing - mAnmGroups[i].afterUnbind(); + mAnmGroups[i].remove(); } return true; } diff --git a/src/d/lyt/d_lyt_sky_gauge.cpp b/src/d/lyt/d_lyt_sky_gauge.cpp index 7e961ec3..b75541f6 100644 --- a/src/d/lyt/d_lyt_sky_gauge.cpp +++ b/src/d/lyt/d_lyt_sky_gauge.cpp @@ -68,7 +68,7 @@ bool dLytSkyGaugeMain_c::build(d2d::ResAccIf_c *resAcc) { for (int i = 0; i < 3; i++) { mAnmGroups[i].init(brlanMap[i].mFile, resAcc, mLyt.getLayout(), brlanMap[i].mName); - mAnmGroups[i].setDirection(false); + mAnmGroups[i].bind(false); mAnmGroups[i].setAnimEnable(false); } @@ -104,7 +104,7 @@ bool dLytSkyGaugeMain_c::execute() { bool dLytSkyGaugeMain_c::remove() { mLyt.unbindAnims(); for (int i = 0; i < 3; i++) { - mAnmGroups[i].afterUnbind(); + mAnmGroups[i].remove(); } return true; diff --git a/src/d/lyt/meter/d_lyt_meter.cpp b/src/d/lyt/meter/d_lyt_meter.cpp index 2ce06aab..3e8cfa7a 100644 --- a/src/d/lyt/meter/d_lyt_meter.cpp +++ b/src/d/lyt/meter/d_lyt_meter.cpp @@ -102,7 +102,7 @@ bool dLytMeter1Button_c::build(d2d::ResAccIf_c *resAcc) { for (int i = 0; i < 3; i++) { mAnmGroups[i].init(btn1BrlanMap[i].mFile, resAcc, mLyt.getLayout(), btn1BrlanMap[i].mName); - mAnmGroups[i].setDirection(false); + mAnmGroups[i].bind(false); mAnmGroups[i].setAnimEnable(false); } // TODO @@ -127,7 +127,7 @@ bool dLytMeter1Button_c::build(d2d::ResAccIf_c *resAcc) { bool dLytMeter1Button_c::remove() { for (int i = 0; i < 3; i++) { mAnmGroups[i].unbind(); - mAnmGroups[i].afterUnbind(); + mAnmGroups[i].remove(); } return true; } @@ -215,7 +215,7 @@ bool dLytMeter2Button_c::build(d2d::ResAccIf_c *resAcc) { for (int i = 0; i < 3; i++) { mAnmGroups[i].init(btn2BrlanMap[i].mFile, resAcc, mLyt.getLayout(), btn2BrlanMap[i].mName); - mAnmGroups[i].setDirection(false); + mAnmGroups[i].bind(false); mAnmGroups[i].setAnimEnable(false); } mpWindow = mLyt.getWindow(sWindowName2); @@ -237,7 +237,7 @@ bool dLytMeter2Button_c::build(d2d::ResAccIf_c *resAcc) { bool dLytMeter2Button_c::remove() { for (int i = 0; i < 3; i++) { mAnmGroups[i].unbind(); - mAnmGroups[i].afterUnbind(); + mAnmGroups[i].remove(); } return true; } @@ -333,7 +333,7 @@ bool dLytMeter_c::build(d2d::ResAccIf_c *resAcc) { mLyt.setPriority(0x8A); for (int i = 0; i < 34; i++) { mAnmGroups[i].init(meterBrlanMap[i].mFile, resAcc, mLyt.getLayout(), meterBrlanMap[i].mName); - mAnmGroups[i].setDirection(false); + mAnmGroups[i].bind(false); mAnmGroups[i].setAnimEnable(false); } @@ -460,7 +460,7 @@ bool dLytMeter_c::build(d2d::ResAccIf_c *resAcc) { bool dLytMeter_c::remove() { for (int i = 0; i < 34; i++) { - mAnmGroups[i].afterUnbind(); + mAnmGroups[i].remove(); } diff --git a/src/d/lyt/meter/d_lyt_meter_a_btn.cpp b/src/d/lyt/meter/d_lyt_meter_a_btn.cpp index 204f31fc..9383d1c8 100644 --- a/src/d/lyt/meter/d_lyt_meter_a_btn.cpp +++ b/src/d/lyt/meter/d_lyt_meter_a_btn.cpp @@ -94,7 +94,7 @@ bool dLytMeterABtn_c::build(d2d::ResAccIf_c *resAcc) { for (int i = 0; i < 3; i++) { mAnmGroups[i].init(brlanMap[i].mFile, resAcc, mLyt.getLayout(), brlanMap[i].mName); - mAnmGroups[i].setDirection(false); + mAnmGroups[i].bind(false); mAnmGroups[i].setAnimEnable(false); } @@ -133,7 +133,7 @@ bool dLytMeterABtn_c::build(d2d::ResAccIf_c *resAcc) { bool dLytMeterABtn_c::remove() { for (int i = 0; i < 3; i++) { mAnmGroups[i].unbind(); - mAnmGroups[i].afterUnbind(); + mAnmGroups[i].remove(); } return true; } diff --git a/src/d/lyt/meter/d_lyt_meter_drink.cpp b/src/d/lyt/meter/d_lyt_meter_drink.cpp index 2715fc8b..7682488f 100644 --- a/src/d/lyt/meter/d_lyt_meter_drink.cpp +++ b/src/d/lyt/meter/d_lyt_meter_drink.cpp @@ -375,7 +375,7 @@ bool dLytMeterDrink_c::build(d2d::ResAccIf_c *resAcc) { for (int i = 0; i < 20; i++) { mAnmGroups[i].init(brlanMap[i].mFile, resAcc, mLyt.getLayout(), brlanMap[i].mName); - mAnmGroups[i].setDirection(false); + mAnmGroups[i].bind(false); mAnmGroups[i].setAnimEnable(false); } @@ -409,7 +409,7 @@ bool dLytMeterDrink_c::build(d2d::ResAccIf_c *resAcc) { bool dLytMeterDrink_c::remove() { for (int i = 0; i < 20; i++) { mAnmGroups[i].unbind(); - mAnmGroups[i].afterUnbind(); + mAnmGroups[i].remove(); } return true; diff --git a/src/d/lyt/meter/d_lyt_meter_shield_gauge.cpp b/src/d/lyt/meter/d_lyt_meter_shield_gauge.cpp index e87ac199..259e9483 100644 --- a/src/d/lyt/meter/d_lyt_meter_shield_gauge.cpp +++ b/src/d/lyt/meter/d_lyt_meter_shield_gauge.cpp @@ -24,7 +24,7 @@ bool dLytMeterShieldGauge_c::build(d2d::ResAccIf_c *resAcc) { bool dLytMeterShieldGauge_c::remove() { for (int i = 0; i < 8; i++) { mAnmGroups[i].unbind(); - mAnmGroups[i].afterUnbind(); + mAnmGroups[i].remove(); } return true; } diff --git a/src/d/lyt/msg_window/d_lyt_msg_window_wood.cpp b/src/d/lyt/msg_window/d_lyt_msg_window_wood.cpp new file mode 100644 index 00000000..2727e7cf --- /dev/null +++ b/src/d/lyt/msg_window/d_lyt_msg_window_wood.cpp @@ -0,0 +1,191 @@ +#include "d/lyt/msg_window/d_lyt_msg_window_wood.h" + +#include "common.h" +#include "d/d_tag_processor.h" +#include "d/lyt/d2d.h" +#include "d/lyt/d_textbox.h" +#include "nw4r/lyt/lyt_group.h" +#include "nw4r/lyt/lyt_pane.h" +#include "s/s_State.hpp" + +STATE_DEFINE(dLytMsgWindowWood_c, Invisible); +STATE_DEFINE(dLytMsgWindowWood_c, In); +STATE_DEFINE(dLytMsgWindowWood_c, Visible); +STATE_DEFINE(dLytMsgWindowWood_c, Out); + +static const d2d::LytBrlanMapping brlanMap[] = { + { "kanbanWindow_00_in.brlan", "G_inOut_00"}, + {"kanbanWindow_00_loop.brlan", "G_loop_00"}, + { "kanbanWindow_00_out.brlan", "G_inOut_00"}, +}; + +#define KANBAN_ANIM_IN 0 +#define KANBAN_ANIM_LOOP 1 +#define KANBAN_ANIM_OUT 2 + +#define KANBAN_NUM_ANIMS 3 + +static const char *sPanes[] = { + "N_aBtn_00", + "N_inOut_00", +}; + +static const char *sTextBoxes[] = { + "T_message_00", + "T_messageS_00", +}; + +static const char *sGroupName = "G_ref_00"; + +bool dLytMsgWindowWood_c::build(void *unk, d2d::ResAccIf_c *resAcc, dTagProcessor_c *tagProcessor) { + mLyt.setResAcc(resAcc); + mLyt.build("kanbanWindow_00.brlyt", nullptr); + mLyt.setPriority(0x8A); + + for (int i = 0; i < KANBAN_NUM_ANIMS; i++) { + mAnm[i].init(brlanMap[i].mFile, resAcc, mLyt.getLayout(), brlanMap[i].mName); + mAnm[i].bind(false); + mAnm[i].setAnimEnable(false); + } + + mAnm[KANBAN_ANIM_LOOP].setAnimEnable(true); + mAnm[KANBAN_ANIM_OUT].setAnimEnable(true); + mAnm[KANBAN_ANIM_OUT].setToEnd(); + mLyt.calc(); + mAnm[KANBAN_ANIM_OUT].setAnimEnable(false); + + for (int i = 0; i < 2; i++) { + mpPanes[i] = mLyt.findPane(sPanes[i]); + } + + for (int i = 0; i < 2; i++) { + mpTextboxes[i] = mLyt.getTextBox(sTextBoxes[i]); + mpTextboxes[i]->SetTextPositionH(0); + mpTextboxes[i]->SetTextPositionV(0); + } + + mpTextboxes[1]->set0x1F6(1); + + for (int i = 0; i < 1; i++) { + mNodes[i].mpLytPane = &mCommon; + mCommon.build(resAcc); + 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); + } + } + + mpPanes[1]->SetVisible(true); + mLyt.calc(); + mpPanes[1]->SetVisible(false); + mpTagProcessor = tagProcessor; + mStateMgr.changeState(StateID_Invisible); + return true; +} + +bool dLytMsgWindowWood_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 < 1; i++) { + mNodes[i].mpLytPane->remove(); + } + mCommon.remove(); + for (int i = 0; i < KANBAN_NUM_ANIMS; i++) { + mAnm[i].remove(); + } + return true; +} + +void dLytMsgWindowWood_c::initializeState_Invisible() { + mCommon.resetToInvisble(); +} +void dLytMsgWindowWood_c::executeState_Invisible() { + if (mCommon.shouldBeOpen()) { + mStateMgr.changeState(StateID_In); + } +} +void dLytMsgWindowWood_c::finalizeState_Invisible() {} + +void dLytMsgWindowWood_c::initializeState_In() { + mAnm[KANBAN_ANIM_IN].setAnimEnable(true); + mAnm[KANBAN_ANIM_IN].setFrame(0.0f); +} +void dLytMsgWindowWood_c::executeState_In() { + if (mAnm[KANBAN_ANIM_IN].isEndReached()) { + mAnm[KANBAN_ANIM_IN].setAnimEnable(false); + mStateMgr.changeState(StateID_Visible); + } +} +void dLytMsgWindowWood_c::finalizeState_In() {} + +void dLytMsgWindowWood_c::initializeState_Visible() {} +void dLytMsgWindowWood_c::executeState_Visible() { + if (!mCommon.shouldBeOpen()) { + mStateMgr.changeState(StateID_Out); + } +} +void dLytMsgWindowWood_c::finalizeState_Visible() {} + +void dLytMsgWindowWood_c::initializeState_Out() { + mAnm[KANBAN_ANIM_OUT].setAnimEnable(true); + mAnm[KANBAN_ANIM_OUT].setFrame(0.0f); +} +void dLytMsgWindowWood_c::executeState_Out() { + if (mAnm[KANBAN_ANIM_OUT].isEndReached()) { + mAnm[KANBAN_ANIM_OUT].setAnimEnable(false); + mStateMgr.changeState(StateID_Invisible); + } +} +void dLytMsgWindowWood_c::finalizeState_Out() {} + +bool dLytMsgWindowWood_c::execute() { + mStateMgr.executeState(); + for (int i = 0; i < KANBAN_NUM_ANIMS; i++) { + if (mAnm[i].isEnabled()) { + mAnm[i].play(); + } + } + mLyt.calc(); + for (int i = 0; i < 1; i++) { + mNodes[i].mpLytPane->execute(); + } + return true; +} + +void dLytMsgWindowWood_c::draw() { + mLyt.draw(); +} + +void dLytMsgWindowWood_c::vt_0x1C() { + mCommon.openMaybe(); +} + +bool dLytMsgWindowWood_c::vt_0x20() const { + return !(*mStateMgr.getStateID() == StateID_In); +} + +void dLytMsgWindowWood_c::vt_0x24() { + mCommon.closeMaybe(); +} + +bool dLytMsgWindowWood_c::vt_0x28() const { + return !(*mStateMgr.getStateID() == StateID_Out); +} + +bool dLytMsgWindowWood_c::setText(const wchar_t *text) { + mpTextboxes[0]->SetTagProcessor(mpTagProcessor); + mpTextboxes[1]->SetTagProcessor(mpTagProcessor); + mpTextboxes[0]->fn_800AF540(text, mpTagProcessor, 0); + mpTextboxes[1]->fn_800AF540(text, mpTagProcessor, 0); + return true; +} From a4ff5b11f771e9375fc8fed3f5b492423a68529b Mon Sep 17 00:00:00 2001 From: robojumper Date: Wed, 2 Apr 2025 00:06:25 +0200 Subject: [PATCH 02/31] Fix and remove probably wrong inline --- include/d/lyt/d2d.h | 7 ------- src/d/lyt/d2d.cpp | 2 +- src/d/lyt/d_lyt_common_arrow.cpp | 4 +++- src/d/lyt/d_lyt_pause_disp_00.cpp | 4 +++- 4 files changed, 7 insertions(+), 10 deletions(-) diff --git a/include/d/lyt/d2d.h b/include/d/lyt/d2d.h index 50dddb7e..f5dbb2eb 100644 --- a/include/d/lyt/d2d.h +++ b/include/d/lyt/d2d.h @@ -189,13 +189,6 @@ struct AnmGroupBase_c { void setForward(); void setBackward(); - inline void setFrameAndControlThings(f32 frame) { - bind(false); - setAnimEnable(true); - mpFrameCtrl->setFrame(frame); - syncAnmFrame(); - } - inline void play() { mpFrameCtrl->play(); syncAnmFrame(); diff --git a/src/d/lyt/d2d.cpp b/src/d/lyt/d2d.cpp index 6e3f4f5c..0089ab19 100644 --- a/src/d/lyt/d2d.cpp +++ b/src/d/lyt/d2d.cpp @@ -821,7 +821,7 @@ bool AnmGroupBase_c::bind(bool bDisable) { return false; } - nw4r::lyt::BindAnimation(mpGroup, anmTransform, false, b); + nw4r::lyt::BindAnimation(mpGroup, anmTransform, false, bDisable); mFlags |= ANMGROUP_FLAG_BOUND; if (bDisable) { mFlags = (mFlags & ~ANMGROUP_FLAG_ENABLE); diff --git a/src/d/lyt/d_lyt_common_arrow.cpp b/src/d/lyt/d_lyt_common_arrow.cpp index 2590df0a..568de8cd 100644 --- a/src/d/lyt/d_lyt_common_arrow.cpp +++ b/src/d/lyt/d_lyt_common_arrow.cpp @@ -125,7 +125,9 @@ bool dLytCommonArrow_c::fn_80168760() { void dLytCommonArrow_c::displayElement(s32 idx, f32 frame) { d2d::AnmGroup_c *s = &mAnmGroups[idx]; - s->setFrameAndControlThings(frame); + s->bind(false); + s->setAnimEnable(true); + s->setFrame(frame); } void dLytCommonArrow_c::fn_80168800(s32 idx) { diff --git a/src/d/lyt/d_lyt_pause_disp_00.cpp b/src/d/lyt/d_lyt_pause_disp_00.cpp index 2e94dcfb..36367537 100644 --- a/src/d/lyt/d_lyt_pause_disp_00.cpp +++ b/src/d/lyt/d_lyt_pause_disp_00.cpp @@ -50,5 +50,7 @@ void dLytPauseDisp00_c::init() { void dLytPauseDisp00_c::displayElement(int i, float frame) { d2d::AnmGroup_c *s = &field_0x00D0[i]; - s->setFrameAndControlThings(frame); + s->bind(false); + s->setAnimEnable(true); + s->setFrame(frame); } From a337ae752a4aa67b423baee3d28fb6ae9a28c5be Mon Sep 17 00:00:00 2001 From: robojumper Date: Wed, 2 Apr 2025 00:29:45 +0200 Subject: [PATCH 03/31] Fix variable ownership --- include/d/lyt/d_lyt_common_a_btn.h | 18 ++---------------- .../d/lyt/msg_window/d_lyt_msg_window_common.h | 8 ++++---- .../d/lyt/msg_window/d_lyt_msg_window_wood.h | 9 +++++---- src/d/lyt/msg_window/d_lyt_msg_window_wood.cpp | 16 ++++++++-------- 4 files changed, 19 insertions(+), 32 deletions(-) diff --git a/include/d/lyt/d_lyt_common_a_btn.h b/include/d/lyt/d_lyt_common_a_btn.h index dc38a6ae..0a09b4e0 100644 --- a/include/d/lyt/d_lyt_common_a_btn.h +++ b/include/d/lyt/d_lyt_common_a_btn.h @@ -24,18 +24,6 @@ public: return mLyt.getName(); } - void openMaybe() { - field_0x1B0 = 1; - } - - void closeMaybe() { - field_0x1B0 = 0; - } - - u8 shouldBeOpen() const { - return field_0x1B0; - } - u8 isDoneOut() const { return mIsDoneOut; } @@ -59,7 +47,6 @@ public: }; private: - enum OutState { OUT_STATE_DECIDING, OUT_STATE_GOTO_OUT, @@ -70,12 +57,12 @@ private: void setState(ABtnState state); void runExecuteFunc(); - + void executeStateInvisible(); void executeStateIn(); void executeStateVisible(); void executeStateDecideOut(); - + void gotoStateInvisible(); void gotoStateIn(); void goToStateVisible(); @@ -97,7 +84,6 @@ private: /* 0x1AD */ bool mNoDecide; /* 0x1AE */ u8 field_0x1AE; /* 0x1AF */ u8 field_0x1AF; - /* 0x1B0 */ u8 field_0x1B0; }; #endif diff --git a/include/d/lyt/msg_window/d_lyt_msg_window_common.h b/include/d/lyt/msg_window/d_lyt_msg_window_common.h index 907cfbfd..cf65fb8e 100644 --- a/include/d/lyt/msg_window/d_lyt_msg_window_common.h +++ b/include/d/lyt/msg_window/d_lyt_msg_window_common.h @@ -12,10 +12,10 @@ public: /* vt 0x10 */ virtual bool build(void *unk, d2d::ResAccIf_c *resAcc, dTagProcessor_c *tagProcessor); /* vt 0x14 */ virtual bool remove(); /* vt 0x18 */ virtual bool execute(); - /* vt 0x1C */ virtual void vt_0x1C(); - /* vt 0x20 */ virtual bool vt_0x20() const; - /* vt 0x24 */ virtual void vt_0x24(); - /* vt 0x28 */ virtual bool vt_0x28() const; + /* vt 0x1C */ virtual void open(); + /* vt 0x20 */ virtual bool isOpening() const; + /* vt 0x24 */ virtual void close(); + /* vt 0x28 */ virtual bool isClosing() const; /* vt 0x2C */ virtual bool setText(const wchar_t *text); /* vt 0x30 */ virtual dTextBox_c *vt_0x30(); /* vt 0x34 */ virtual void vt_0x34(); diff --git a/include/d/lyt/msg_window/d_lyt_msg_window_wood.h b/include/d/lyt/msg_window/d_lyt_msg_window_wood.h index b3457fc4..b56499ae 100644 --- a/include/d/lyt/msg_window/d_lyt_msg_window_wood.h +++ b/include/d/lyt/msg_window/d_lyt_msg_window_wood.h @@ -16,10 +16,10 @@ public: /* vt 0x10 */ virtual bool build(void *unk, d2d::ResAccIf_c *resAcc, dTagProcessor_c *tagProcessor) override; /* vt 0x14 */ virtual bool remove() override; /* vt 0x18 */ virtual bool execute() override; - /* vt 0x1C */ virtual void vt_0x1C() override; - /* vt 0x20 */ virtual bool vt_0x20() const override; - /* vt 0x24 */ virtual void vt_0x24() override; - /* vt 0x28 */ virtual bool vt_0x28() const override; + /* vt 0x1C */ virtual void open() override; + /* vt 0x20 */ virtual bool isOpening() const override; + /* vt 0x24 */ virtual void close() override; + /* vt 0x28 */ virtual bool isClosing() const override; /* vt 0x2C */ virtual bool setText(const wchar_t *text) override; /* vt 0x30 */ virtual dTextBox_c *vt_0x30() override { return mpTextboxes[0]; @@ -50,6 +50,7 @@ private: /* 0x530 */ nw4r::lyt::Pane *mpPanes[2]; /* 0x538 */ dTagProcessor_c *mpTagProcessor; /* 0x53C */ dLytCommonABtn_c mCommon; + /* 0x6EC */ bool mShouldBeOpen; }; #endif diff --git a/src/d/lyt/msg_window/d_lyt_msg_window_wood.cpp b/src/d/lyt/msg_window/d_lyt_msg_window_wood.cpp index 2727e7cf..765a0e0b 100644 --- a/src/d/lyt/msg_window/d_lyt_msg_window_wood.cpp +++ b/src/d/lyt/msg_window/d_lyt_msg_window_wood.cpp @@ -110,7 +110,7 @@ void dLytMsgWindowWood_c::initializeState_Invisible() { mCommon.resetToInvisble(); } void dLytMsgWindowWood_c::executeState_Invisible() { - if (mCommon.shouldBeOpen()) { + if (mShouldBeOpen) { mStateMgr.changeState(StateID_In); } } @@ -130,7 +130,7 @@ void dLytMsgWindowWood_c::finalizeState_In() {} void dLytMsgWindowWood_c::initializeState_Visible() {} void dLytMsgWindowWood_c::executeState_Visible() { - if (!mCommon.shouldBeOpen()) { + if (!mShouldBeOpen) { mStateMgr.changeState(StateID_Out); } } @@ -166,19 +166,19 @@ void dLytMsgWindowWood_c::draw() { mLyt.draw(); } -void dLytMsgWindowWood_c::vt_0x1C() { - mCommon.openMaybe(); +void dLytMsgWindowWood_c::open() { + mShouldBeOpen = true; } -bool dLytMsgWindowWood_c::vt_0x20() const { +bool dLytMsgWindowWood_c::isOpening() const { return !(*mStateMgr.getStateID() == StateID_In); } -void dLytMsgWindowWood_c::vt_0x24() { - mCommon.closeMaybe(); +void dLytMsgWindowWood_c::close() { + mShouldBeOpen = false; } -bool dLytMsgWindowWood_c::vt_0x28() const { +bool dLytMsgWindowWood_c::isClosing() const { return !(*mStateMgr.getStateID() == StateID_Out); } From 5e2343afb79863394f5f1487d70cd3492305963e Mon Sep 17 00:00:00 2001 From: robojumper Date: Wed, 2 Apr 2025 00:57:49 +0200 Subject: [PATCH 04/31] d_lyt_msg_window_stone OK --- config/SOUE01/splits.txt | 5 + config/SOUE01/symbols.txt | 114 +++++----- configure.py | 2 +- .../d/lyt/msg_window/d_lyt_msg_window_stone.h | 56 +++++ src/d/lyt/d_lyt_common_a_btn.cpp | 36 ++-- .../lyt/msg_window/d_lyt_msg_window_stone.cpp | 195 ++++++++++++++++++ 6 files changed, 332 insertions(+), 76 deletions(-) create mode 100644 include/d/lyt/msg_window/d_lyt_msg_window_stone.h create mode 100644 src/d/lyt/msg_window/d_lyt_msg_window_stone.cpp diff --git a/config/SOUE01/splits.txt b/config/SOUE01/splits.txt index c9b1a5b8..5af1cf27 100644 --- a/config/SOUE01/splits.txt +++ b/config/SOUE01/splits.txt @@ -470,6 +470,11 @@ d/lyt/msg_window/d_lyt_msg_window_wood.cpp: d/lyt/msg_window/d_lyt_msg_window_stone.cpp: .text start:0x80126800 end:0x80127478 .ctors start:0x804DB754 end:0x804DB758 + .rodata start:0x804E75D8 end:0x804E75F0 + .data start:0x8051DB08 end:0x8051DD90 + .sdata start:0x805725F8 end:0x80572608 + .sdata2 start:0x80579EC8 end:0x80579ED0 + .bss start:0x805AEEF0 end:0x805AEFF0 d/lyt/msg_window/d_lyt_msg_window_demo.cpp: .text start:0x80127480 end:0x801281F8 diff --git a/config/SOUE01/symbols.txt b/config/SOUE01/symbols.txt index df9063e6..9592a204 100644 --- a/config/SOUE01/symbols.txt +++ b/config/SOUE01/symbols.txt @@ -6878,7 +6878,7 @@ LytMsgWindowTalk__dtor = .text:0x801198D0; // type:function size:0x198 fn_80119A70 = .text:0x80119A70; // type:function size:0x198 LytMsgWindowSword__dtor = .text:0x80119C10; // type:function size:0x198 __dt__19dLytMsgWindowWood_cFv = .text:0x80119DB0; // type:function size:0x170 -fn_80119F20 = .text:0x80119F20; // type:function size:0x170 +__dt__20dLytMsgWindowStone_cFv = .text:0x80119F20; // type:function size:0x170 fn_8011A090 = .text:0x8011A090; // type:function size:0x198 fn_8011A230 = .text:0x8011A230; // type:function size:0x158 fn_8011A390 = .text:0x8011A390; // type:function size:0x118 @@ -7025,9 +7025,9 @@ fn_8011B5F0 = .text:0x8011B5F0; // type:function size:0x30 finalizeState__34sFStateID_c<19dLytMsgWindowWood_c>CFR19dLytMsgWindowWood_c = .text:0x8011B620; // type:function size:0x30 executeState__34sFStateID_c<19dLytMsgWindowWood_c>CFR19dLytMsgWindowWood_c = .text:0x8011B650; // type:function size:0x30 initializeState__34sFStateID_c<19dLytMsgWindowWood_c>CFR19dLytMsgWindowWood_c = .text:0x8011B680; // type:function size:0x30 -fn_8011B6B0 = .text:0x8011B6B0; // type:function size:0x30 -fn_8011B6E0 = .text:0x8011B6E0; // type:function size:0x30 -fn_8011B710 = .text:0x8011B710; // type:function size:0x30 +finalizeState__35sFStateID_c<20dLytMsgWindowStone_c>CFR20dLytMsgWindowStone_c = .text:0x8011B6B0; // type:function size:0x30 +executeState__35sFStateID_c<20dLytMsgWindowStone_c>CFR20dLytMsgWindowStone_c = .text:0x8011B6E0; // type:function size:0x30 +initializeState__35sFStateID_c<20dLytMsgWindowStone_c>CFR20dLytMsgWindowStone_c = .text:0x8011B710; // type:function size:0x30 fn_8011B740 = .text:0x8011B740; // type:function size:0x30 fn_8011B770 = .text:0x8011B770; // type:function size:0x30 fn_8011B7A0 = .text:0x8011B7A0; // type:function size:0x30 @@ -7269,46 +7269,46 @@ executeState_Out__19dLytMsgWindowWood_cFv = .text:0x801260E0; // type:function s finalizeState_Out__19dLytMsgWindowWood_cFv = .text:0x80126160; // type:function size:0x4 execute__19dLytMsgWindowWood_cFv = .text:0x80126170; // type:function size:0xBC draw__19dLytMsgWindowWood_cFv = .text:0x80126230; // type:function size:0x14 -vt_0x1C__19dLytMsgWindowWood_cFv = .text:0x80126250; // type:function size:0xC -vt_0x20__19dLytMsgWindowWood_cCFv = .text:0x80126260; // type:function size:0x4C -vt_0x24__19dLytMsgWindowWood_cFv = .text:0x801262B0; // type:function size:0xC -vt_0x28__19dLytMsgWindowWood_cCFv = .text:0x801262C0; // type:function size:0x4C +open__19dLytMsgWindowWood_cFv = .text:0x80126250; // type:function size:0xC +isOpening__19dLytMsgWindowWood_cCFv = .text:0x80126260; // type:function size:0x4C +close__19dLytMsgWindowWood_cFv = .text:0x801262B0; // type:function size:0xC +isClosing__19dLytMsgWindowWood_cCFv = .text:0x801262C0; // type:function size:0x4C setText__19dLytMsgWindowWood_cFPCw = .text:0x80126310; // type:function size:0x7C vt_0x3C__19dLytMsgWindowWood_cCFv = .text:0x80126390; // type:function size:0x8 -vt_0x38__19dLytMsgWindowWood_cFv = .text:0x801263A0; // type:function size:0x8 +vt_0x38__19dLytMsgWindowWood_cFb = .text:0x801263A0; // type:function size:0x8 vt_0x34__19dLytMsgWindowWood_cFv = .text:0x801263B0; // type:function size:0x8 vt_0x30__19dLytMsgWindowWood_cFv = .text:0x801263C0; // type:function size:0x8 __sinit_\d_lyt_msg_window_wood_cpp = .text:0x801263D0; // type:function size:0x338 scope:local __dt__34sFStateID_c<19dLytMsgWindowWood_c>Fv = .text:0x80126710; // type:function size:0x58 isSameName__34sFStateID_c<19dLytMsgWindowWood_c>CFPCc = .text:0x80126770; // type:function size:0x88 -fn_80126800 = .text:0x80126800; // type:function size:0x284 -fn_80126A90 = .text:0x80126A90; // type:function size:0xD8 -fn_80126B70 = .text:0x80126B70; // type:function size:0x8 -fn_80126B80 = .text:0x80126B80; // type:function size:0x28 -fn_80126BB0 = .text:0x80126BB0; // type:function size:0x4 -fn_80126BC0 = .text:0x80126BC0; // type:function size:0x48 -fn_80126C10 = .text:0x80126C10; // type:function size:0x78 -fn_80126C90 = .text:0x80126C90; // type:function size:0x4 -fn_80126CA0 = .text:0x80126CA0; // type:function size:0x4 -fn_80126CB0 = .text:0x80126CB0; // type:function size:0x28 -fn_80126CE0 = .text:0x80126CE0; // type:function size:0x4 -fn_80126CF0 = .text:0x80126CF0; // type:function size:0x48 -fn_80126D40 = .text:0x80126D40; // type:function size:0x78 -fn_80126DC0 = .text:0x80126DC0; // type:function size:0x4 -fn_80126DD0 = .text:0x80126DD0; // type:function size:0xBC -fn_80126E90 = .text:0x80126E90; // type:function size:0x14 -fn_80126EB0 = .text:0x80126EB0; // type:function size:0xC -fn_80126EC0 = .text:0x80126EC0; // type:function size:0x4C -fn_80126F10 = .text:0x80126F10; // type:function size:0xC -fn_80126F20 = .text:0x80126F20; // type:function size:0x4C -fn_80126F70 = .text:0x80126F70; // type:function size:0xA0 -fn_80127010 = .text:0x80127010; // type:function size:0x8 -fn_80127020 = .text:0x80127020; // type:function size:0x8 -fn_80127030 = .text:0x80127030; // type:function size:0x8 -fn_80127040 = .text:0x80127040; // type:function size:0x8 -LytMsgWindowStone__initStates = .text:0x80127050; // type:function size:0x338 -LytMsgWindowStone__dtor = .text:0x80127390; // type:function size:0x58 -fn_801273F0 = .text:0x801273F0; // type:function size:0x88 +build__20dLytMsgWindowStone_cFPvPQ23d2d10ResAccIf_cP15dTagProcessor_c = .text:0x80126800; // type:function size:0x284 +remove__20dLytMsgWindowStone_cFv = .text:0x80126A90; // type:function size:0xD8 +initializeState_Invisible__20dLytMsgWindowStone_cFv = .text:0x80126B70; // type:function size:0x8 +executeState_Invisible__20dLytMsgWindowStone_cFv = .text:0x80126B80; // type:function size:0x28 +finalizeState_Invisible__20dLytMsgWindowStone_cFv = .text:0x80126BB0; // type:function size:0x4 +initializeState_In__20dLytMsgWindowStone_cFv = .text:0x80126BC0; // type:function size:0x48 +executeState_In__20dLytMsgWindowStone_cFv = .text:0x80126C10; // type:function size:0x78 +finalizeState_In__20dLytMsgWindowStone_cFv = .text:0x80126C90; // type:function size:0x4 +initializeState_Visible__20dLytMsgWindowStone_cFv = .text:0x80126CA0; // type:function size:0x4 +executeState_Visible__20dLytMsgWindowStone_cFv = .text:0x80126CB0; // type:function size:0x28 +finalizeState_Visible__20dLytMsgWindowStone_cFv = .text:0x80126CE0; // type:function size:0x4 +initializeState_Out__20dLytMsgWindowStone_cFv = .text:0x80126CF0; // type:function size:0x48 +executeState_Out__20dLytMsgWindowStone_cFv = .text:0x80126D40; // type:function size:0x78 +finalizeState_Out__20dLytMsgWindowStone_cFv = .text:0x80126DC0; // type:function size:0x4 +execute__20dLytMsgWindowStone_cFv = .text:0x80126DD0; // type:function size:0xBC +draw__20dLytMsgWindowStone_cFv = .text:0x80126E90; // type:function size:0x14 +open__20dLytMsgWindowStone_cFv = .text:0x80126EB0; // type:function size:0xC +isOpening__20dLytMsgWindowStone_cCFv = .text:0x80126EC0; // type:function size:0x4C +close__20dLytMsgWindowStone_cFv = .text:0x80126F10; // type:function size:0xC +isClosing__20dLytMsgWindowStone_cCFv = .text:0x80126F20; // type:function size:0x4C +setText__20dLytMsgWindowStone_cFPCw = .text:0x80126F70; // type:function size:0xA0 +vt_0x3C__20dLytMsgWindowStone_cCFv = .text:0x80127010; // type:function size:0x8 +vt_0x38__20dLytMsgWindowStone_cFb = .text:0x80127020; // type:function size:0x8 +vt_0x34__20dLytMsgWindowStone_cFv = .text:0x80127030; // type:function size:0x8 +vt_0x30__20dLytMsgWindowStone_cFv = .text:0x80127040; // type:function size:0x8 +__sinit_\d_lyt_msg_window_stone_cpp = .text:0x80127050; // type:function size:0x338 scope:local +__dt__35sFStateID_c<20dLytMsgWindowStone_c>Fv = .text:0x80127390; // type:function size:0x58 +isSameName__35sFStateID_c<20dLytMsgWindowStone_c>CFPCc = .text:0x801273F0; // type:function size:0x88 fn_80127480 = .text:0x80127480; // type:function size:0x1BC fn_80127640 = .text:0x80127640; // type:function size:0x6C fn_801276B0 = .text:0x801276B0; // type:function size:0x160 @@ -32246,22 +32246,22 @@ lbl_8051D934 = .data:0x8051D934; // type:object size:0xE data:string lbl_8051D944 = .data:0x8051D944; // type:object size:0x9 data:string lbl_8051D950 = .data:0x8051D950; // type:object size:0x16 data:string __vt__19dLytMsgWindowWood_c = .data:0x8051D968; // type:object size:0x44 -lbl_8051DAD4 = .data:0x8051DAD4; // type:object size:0x34 -lbl_8051DB08 = .data:0x8051DB08; // type:object size:0x1C -lbl_8051DB24 = .data:0x8051DB24; // type:object size:0xC +__vt__34sFStateID_c<19dLytMsgWindowWood_c> = .data:0x8051DAD4; // type:object size:0x34 +lbl_8051DB08 = .data:0x8051DB08; // type:object size:0x1A data:string +lbl_8051DB24 = .data:0x8051DB24; // type:object size:0xB data:string lbl_8051DB30 = .data:0x8051DB30; // type:object size:0x1C data:string -lbl_8051DB4C = .data:0x8051DB4C; // type:object size:0xC -lbl_8051DB58 = .data:0x8051DB58; // type:object size:0x1C -lbl_8051DB74 = .data:0x8051DB74; // type:object size:0xC -lbl_8051DB80 = .data:0x8051DB80; // type:object size:0xC -lbl_8051DB8C = .data:0x8051DB8C; // type:object size:0x10 -lbl_8051DB9C = .data:0x8051DB9C; // type:object size:0x10 -lbl_8051DBAC = .data:0x8051DBAC; // type:object size:0x10 +lbl_8051DB4C = .data:0x8051DB4C; // type:object size:0xA data:string +lbl_8051DB58 = .data:0x8051DB58; // type:object size:0x1B data:string +lbl_8051DB74 = .data:0x8051DB74; // type:object size:0xA data:string +lbl_8051DB80 = .data:0x8051DB80; // type:object size:0xB data:string +lbl_8051DB8C = .data:0x8051DB8C; // type:object size:0xD data:string +lbl_8051DB9C = .data:0x8051DB9C; // type:object size:0xE data:string +lbl_8051DBAC = .data:0x8051DBAC; // type:object size:0xE data:string lbl_8051DBBC = .data:0x8051DBBC; // type:object size:0xC data:4byte -lbl_8051DBC8 = .data:0x8051DBC8; // type:object size:0xC -lbl_8051DBD4 = .data:0x8051DBD4; // type:object size:0x18 -lbl_8051DBEC = .data:0x8051DBEC; // type:object size:0x16C -lbl_8051DD58 = .data:0x8051DD58; // type:object size:0x38 +lbl_8051DBC8 = .data:0x8051DBC8; // type:object size:0x9 data:string +lbl_8051DBD4 = .data:0x8051DBD4; // type:object size:0x17 data:string +__vt__20dLytMsgWindowStone_c = .data:0x8051DBEC; // type:object size:0x44 +__vt__35sFStateID_c<20dLytMsgWindowStone_c> = .data:0x8051DD58; // type:object size:0x34 lbl_8051DD90 = .data:0x8051DD90; // type:object size:0x18 lbl_8051DDA8 = .data:0x8051DDA8; // type:object size:0xC lbl_8051DDB4 = .data:0x8051DDB4; // type:object size:0x18 @@ -38210,7 +38210,7 @@ lbl_805725E0 = .sdata:0x805725E0; // type:object size:0x8 data:4byte lbl_805725E8 = .sdata:0x805725E8; // type:object size:0x8 data:4byte lbl_805725F0 = .sdata:0x805725F0; // type:object size:0x4 data:4byte lbl_805725F8 = .sdata:0x805725F8; // type:object size:0x8 data:4byte -lbl_80572600 = .sdata:0x80572600; // type:object size:0x8 data:4byte +lbl_80572600 = .sdata:0x80572600; // type:object size:0x4 data:4byte lbl_80572608 = .sdata:0x80572608; // type:object size:0x8 data:4byte lbl_80572610 = .sdata:0x80572610; // type:object size:0x8 lbl_80572618 = .sdata:0x80572618; // type:object size:0x8 data:4byte @@ -48863,11 +48863,11 @@ StateID_Invisible__19dLytMsgWindowWood_c = .bss:0x805AEE00; // type:object size: StateID_In__19dLytMsgWindowWood_c = .bss:0x805AEE40; // type:object size:0x30 data:4byte StateID_Visible__19dLytMsgWindowWood_c = .bss:0x805AEE80; // type:object size:0x30 data:4byte StateID_Out__19dLytMsgWindowWood_c = .bss:0x805AEEC0; // type:object size:0x30 data:4byte -lbl_805AEEF0 = .bss:0x805AEEF0; // type:object size:0x10 -LytMsgWindowStone__STATE_INVISIBLE = .bss:0x805AEF00; // type:object size:0x40 data:4byte -LytMsgWindowStone__STATE_IN = .bss:0x805AEF40; // type:object size:0x40 data:4byte -LytMsgWindowStone__STATE_VISIBLE = .bss:0x805AEF80; // type:object size:0x40 data:4byte -LytMsgWindowStone__STATE_OUT = .bss:0x805AEFC0; // type:object size:0x30 data:4byte +lbl_805AEEF0 = .bss:0x805AEEF0; // type:object size:0xC +StateID_Invisible__19dLytMsgWindowWood_c = .bss:0x805AEF00; // type:object size:0x30 data:4byte +StateID_In__19dLytMsgWindowWood_c = .bss:0x805AEF40; // type:object size:0x30 data:4byte +StateID_Visible__19dLytMsgWindowWood_c = .bss:0x805AEF80; // type:object size:0x30 data:4byte +StateID_Out__19dLytMsgWindowWood_c = .bss:0x805AEFC0; // type:object size:0x30 data:4byte lbl_805AEFF0 = .bss:0x805AEFF0; // type:object size:0x10 LytMsgWindowDemo__STATE_INVISIBLE = .bss:0x805AF000; // type:object size:0x40 data:4byte LytMsgWindowDemo__STATE_IN = .bss:0x805AF040; // type:object size:0x40 data:4byte diff --git a/configure.py b/configure.py index c5fbf426..716a2b79 100644 --- a/configure.py +++ b/configure.py @@ -414,7 +414,7 @@ config.libs = [ Object(NonMatching, "d/lyt/msg_window/d_lyt_msg_window_get.cpp"), Object(NonMatching, "d/lyt/msg_window/d_lyt_msg_window_sword.cpp"), Object(Matching, "d/lyt/msg_window/d_lyt_msg_window_wood.cpp"), - Object(NonMatching, "d/lyt/msg_window/d_lyt_msg_window_stone.cpp"), + Object(Matching, "d/lyt/msg_window/d_lyt_msg_window_stone.cpp"), Object(NonMatching, "d/lyt/msg_window/d_lyt_msg_window_demo.cpp"), Object(NonMatching, "d/lyt/d_lyt_simple_window.cpp"), Object(NonMatching, "d/lyt/d_lyt_auto_caption.cpp"), diff --git a/include/d/lyt/msg_window/d_lyt_msg_window_stone.h b/include/d/lyt/msg_window/d_lyt_msg_window_stone.h new file mode 100644 index 00000000..e7b16086 --- /dev/null +++ b/include/d/lyt/msg_window/d_lyt_msg_window_stone.h @@ -0,0 +1,56 @@ +#ifndef D_LYT_MSG_WINDOW_STONE_H +#define D_LYT_MSG_WINDOW_STONE_H + +#include "d/d_tag_processor.h" +#include "d/lyt/d2d.h" +#include "d/lyt/d_lyt_common_a_btn.h" +#include "d/lyt/d_textbox.h" +#include "d/lyt/msg_window/d_lyt_msg_window_common.h" +#include "nw4r/lyt/lyt_pane.h" +#include "s/s_State.hpp" + +class dLytMsgWindowStone_c : public dLytMsgWindowSubtype { +public: + /* vt 0x08 */ virtual ~dLytMsgWindowStone_c() {} + /* vt 0x0C */ virtual void draw() override; + /* vt 0x10 */ virtual bool build(void *unk, d2d::ResAccIf_c *resAcc, dTagProcessor_c *tagProcessor) override; + /* vt 0x14 */ virtual bool remove() override; + /* vt 0x18 */ virtual bool execute() override; + /* vt 0x1C */ virtual void open() override; + /* vt 0x20 */ virtual bool isOpening() const override; + /* vt 0x24 */ virtual void close() override; + /* vt 0x28 */ virtual bool isClosing() const override; + /* vt 0x2C */ virtual bool setText(const wchar_t *text) override; + /* vt 0x30 */ virtual dTextBox_c *vt_0x30() override { + return mpTextboxes[0]; + } + /* vt 0x34 */ virtual void vt_0x34() override { + mCommon.requestIn(); + } + /* vt 0x38 */ virtual void vt_0x38(bool b) override { + mCommon.requestOut(b); + } + /* vt 0x3C */ virtual u8 vt_0x3C() const override { + return mCommon.isDoneOut(); + } + + STATE_FUNC_DECLARE(dLytMsgWindowStone_c, Invisible); + STATE_FUNC_DECLARE(dLytMsgWindowStone_c, In); + STATE_FUNC_DECLARE(dLytMsgWindowStone_c, Visible); + STATE_FUNC_DECLARE(dLytMsgWindowStone_c, Out); + +private: + /* 0x010 */ UI_STATE_MGR_DECLARE(dLytMsgWindowStone_c); + /* 0x04C */ d2d::SubPaneList mSubpaneList; + /* 0x05C */ d2d::SubPaneListNode mNodes[1]; + /* 0x068 */ d2d::ResAccIf_c mResAcc; + /* 0x3D8 */ d2d::LytBase_c mLyt; + /* 0x468 */ d2d::AnmGroup_c mAnm[3]; + /* 0x528 */ dTextBox_c *mpTextboxes[3]; + /* 0x530 */ nw4r::lyt::Pane *mpPanes[2]; + /* 0x538 */ dTagProcessor_c *mpTagProcessor; + /* 0x53C */ dLytCommonABtn_c mCommon; + /* 0x6EC */ bool mShouldBeOpen; +}; + +#endif diff --git a/src/d/lyt/d_lyt_common_a_btn.cpp b/src/d/lyt/d_lyt_common_a_btn.cpp index 056e6397..f484e1e5 100644 --- a/src/d/lyt/d_lyt_common_a_btn.cpp +++ b/src/d/lyt/d_lyt_common_a_btn.cpp @@ -14,12 +14,12 @@ static const d2d::LytBrlanMapping brlanMap[] = { { "aBtn_00_out.brlan", "G_inOut_00"}, }; -#define MSG_ABTN_ANIM_IN 0 -#define MSG_ABTN_ANIM_LOOP 1 -#define MSG_ABTN_ANIM_DECIDE 2 -#define MSG_ABTN_ANIM_OUT 3 +#define A_BTN_ANIM_IN 0 +#define A_BTN_ANIM_LOOP 1 +#define A_BTN_ANIM_DECIDE 2 +#define A_BTN_ANIM_OUT 3 -#define MSG_ABTN_NUM_ANIMS 4 +#define A_BTN_NUM_ANIMS 4 const dLytCommonABtn_c::executeFunc dLytCommonABtn_c::sExecuteFuncs[4] = { &dLytCommonABtn_c::executeStateInvisible, @@ -32,7 +32,7 @@ bool dLytCommonABtn_c::build(d2d::ResAccIf_c *resAcc) { mLyt.setResAcc(resAcc); mLyt.build("aBtn_00.brlyt", nullptr); - for (int i = 0; i < MSG_ABTN_NUM_ANIMS; i++) { + for (int i = 0; i < A_BTN_NUM_ANIMS; i++) { mAnm[i].init(brlanMap[i].mFile, resAcc, mLyt.getLayout(), brlanMap[i].mName); } @@ -42,7 +42,7 @@ bool dLytCommonABtn_c::build(d2d::ResAccIf_c *resAcc) { } bool dLytCommonABtn_c::remove() { - for (int i = 0; i < MSG_ABTN_NUM_ANIMS; i++) { + for (int i = 0; i < A_BTN_NUM_ANIMS; i++) { mAnm[i].remove(); } return true; @@ -93,7 +93,7 @@ void dLytCommonABtn_c::gotoStateInvisible() { setState(STATE_INVISIBLE); mLyt.unbindAnims(); - d2d::AnmGroup_c &inAnim = mAnm[MSG_ABTN_ANIM_IN]; + d2d::AnmGroup_c &inAnim = mAnm[A_BTN_ANIM_IN]; field_0x1A8 = 0; mInRequested = false; mOutRequested = false; @@ -130,7 +130,7 @@ void dLytCommonABtn_c::gotoStateIn() { } void dLytCommonABtn_c::executeStateIn() { - d2d::AnmGroup_c &anm = mAnm[MSG_ABTN_ANIM_IN]; + d2d::AnmGroup_c &anm = mAnm[A_BTN_ANIM_IN]; if (anm.isEndReached() == true) { goToStateVisible(); } else { @@ -140,8 +140,8 @@ void dLytCommonABtn_c::executeStateIn() { void dLytCommonABtn_c::goToStateVisible() { setState(STATE_VISIBLE); - mAnm[MSG_ABTN_ANIM_IN].unbind(); - d2d::AnmGroup_c &anm = mAnm[MSG_ABTN_ANIM_LOOP]; + mAnm[A_BTN_ANIM_IN].unbind(); + d2d::AnmGroup_c &anm = mAnm[A_BTN_ANIM_LOOP]; anm.bind(false); anm.setFrame(0.0f); if (dSys::getFrameRate() == 1) { @@ -156,17 +156,17 @@ void dLytCommonABtn_c::executeStateVisible() { goToStateDecideOut(); mOutRequested = false; } else { - d2d::AnmGroup_c &anm = mAnm[MSG_ABTN_ANIM_LOOP]; + d2d::AnmGroup_c &anm = mAnm[A_BTN_ANIM_LOOP]; anm.play(); } } void dLytCommonABtn_c::goToStateDecideOut() { setState(STATE_OUT); - mAnm[MSG_ABTN_ANIM_LOOP].unbind(); + mAnm[A_BTN_ANIM_LOOP].unbind(); if (mNoDecide == true) { mNoDecide = false; - d2d::AnmGroup_c &anm = mAnm[MSG_ABTN_ANIM_OUT]; + d2d::AnmGroup_c &anm = mAnm[A_BTN_ANIM_OUT]; anm.bind(false); anm.setFrame(0.0f); if (dSys::getFrameRate() == 1) { @@ -176,7 +176,7 @@ void dLytCommonABtn_c::goToStateDecideOut() { } mOutState = OUT_STATE_OUT; } else { - d2d::AnmGroup_c &anm = mAnm[MSG_ABTN_ANIM_DECIDE]; + d2d::AnmGroup_c &anm = mAnm[A_BTN_ANIM_DECIDE]; anm.bind(false); anm.setAnimEnable(true); anm.setFrame(0.0f); @@ -194,7 +194,7 @@ void dLytCommonABtn_c::goToStateDecideOut() { } void dLytCommonABtn_c::executeStateDecideOut() { - d2d::AnmGroup_c &decideAnm = mAnm[MSG_ABTN_ANIM_DECIDE]; + d2d::AnmGroup_c &decideAnm = mAnm[A_BTN_ANIM_DECIDE]; switch (mOutState) { case OUT_STATE_DECIDING: { if (decideAnm.isEndReached() == true) { @@ -210,7 +210,7 @@ void dLytCommonABtn_c::executeStateDecideOut() { } case OUT_STATE_GOTO_OUT: { decideAnm.unbind(); - d2d::AnmGroup_c &anmOut = mAnm[MSG_ABTN_ANIM_OUT]; + d2d::AnmGroup_c &anmOut = mAnm[A_BTN_ANIM_OUT]; anmOut.bind(false); anmOut.setAnimEnable(true); anmOut.setFrame(0.0f); @@ -223,7 +223,7 @@ void dLytCommonABtn_c::executeStateDecideOut() { break; } case OUT_STATE_OUT: { - d2d::AnmGroup_c &anmOut = mAnm[MSG_ABTN_ANIM_OUT]; + d2d::AnmGroup_c &anmOut = mAnm[A_BTN_ANIM_OUT]; if (anmOut.isEndReached() == true) { mOutState = OUT_STATE_GOTO_INVISIBLE; mIsDoneOut = true; diff --git a/src/d/lyt/msg_window/d_lyt_msg_window_stone.cpp b/src/d/lyt/msg_window/d_lyt_msg_window_stone.cpp new file mode 100644 index 00000000..b21936ff --- /dev/null +++ b/src/d/lyt/msg_window/d_lyt_msg_window_stone.cpp @@ -0,0 +1,195 @@ +#include "d/lyt/msg_window/d_lyt_msg_window_stone.h" + +#include "common.h" +#include "d/d_tag_processor.h" +#include "d/lyt/d2d.h" +#include "d/lyt/d_textbox.h" +#include "nw4r/lyt/lyt_group.h" +#include "nw4r/lyt/lyt_pane.h" +#include "s/s_State.hpp" + +STATE_DEFINE(dLytMsgWindowStone_c, Invisible); +STATE_DEFINE(dLytMsgWindowStone_c, In); +STATE_DEFINE(dLytMsgWindowStone_c, Visible); +STATE_DEFINE(dLytMsgWindowStone_c, Out); + +static const d2d::LytBrlanMapping brlanMap[] = { + { "sekibanWindow_00_in.brlan", "G_inOut_00"}, + {"sekibanWindow_00_loop.brlan", "G_loop_00"}, + { "sekibanWindow_00_out.brlan", "G_inOut_00"}, +}; + +#define SEKIBAN_ANIM_IN 0 +#define SEKIBAN_ANIM_LOOP 1 +#define SEKIBAN_ANIM_OUT 2 + +#define SEKIBAN_NUM_ANIMS 3 + +static const char *sPanes[] = { + "N_aBtn_00", + "N_inOut_00", +}; + +static const char *sTextBoxes[] = { + "T_message_00", + "T_messageS_00", + "T_messageS_01", +}; + +static const char *sGroupName = "G_ref_00"; + +bool dLytMsgWindowStone_c::build(void *unk, d2d::ResAccIf_c *resAcc, dTagProcessor_c *tagProcessor) { + mLyt.setResAcc(resAcc); + mLyt.build("sekibanWindow_00.brlyt", nullptr); + mLyt.setPriority(0x8A); + + for (int i = 0; i < SEKIBAN_NUM_ANIMS; i++) { + mAnm[i].init(brlanMap[i].mFile, resAcc, mLyt.getLayout(), brlanMap[i].mName); + mAnm[i].bind(false); + mAnm[i].setAnimEnable(false); + } + + mAnm[SEKIBAN_ANIM_LOOP].setAnimEnable(true); + mAnm[SEKIBAN_ANIM_OUT].setAnimEnable(true); + mAnm[SEKIBAN_ANIM_OUT].setToEnd(); + mLyt.calc(); + mAnm[SEKIBAN_ANIM_OUT].setAnimEnable(false); + + for (int i = 0; i < 2; i++) { + mpPanes[i] = mLyt.findPane(sPanes[i]); + } + + for (int i = 0; i < 3; i++) { + mpTextboxes[i] = mLyt.getTextBox(sTextBoxes[i]); + mpTextboxes[i]->SetTextPositionH(0); + mpTextboxes[i]->SetTextPositionV(0); + } + + mpTextboxes[1]->set0x1F6(1); + mpTextboxes[2]->set0x1F6(1); + + for (int i = 0; i < 1; i++) { + mNodes[i].mpLytPane = &mCommon; + mCommon.build(resAcc); + 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); + } + } + + mpPanes[1]->SetVisible(true); + mLyt.calc(); + mpPanes[1]->SetVisible(false); + mpTagProcessor = tagProcessor; + mStateMgr.changeState(StateID_Invisible); + return true; +} + +bool dLytMsgWindowStone_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 < 1; i++) { + mNodes[i].mpLytPane->remove(); + } + mCommon.remove(); + for (int i = 0; i < SEKIBAN_NUM_ANIMS; i++) { + mAnm[i].remove(); + } + return true; +} + +void dLytMsgWindowStone_c::initializeState_Invisible() { + mCommon.resetToInvisble(); +} +void dLytMsgWindowStone_c::executeState_Invisible() { + if (mShouldBeOpen) { + mStateMgr.changeState(StateID_In); + } +} +void dLytMsgWindowStone_c::finalizeState_Invisible() {} + +void dLytMsgWindowStone_c::initializeState_In() { + mAnm[SEKIBAN_ANIM_IN].setAnimEnable(true); + mAnm[SEKIBAN_ANIM_IN].setFrame(0.0f); +} +void dLytMsgWindowStone_c::executeState_In() { + if (mAnm[SEKIBAN_ANIM_IN].isEndReached()) { + mAnm[SEKIBAN_ANIM_IN].setAnimEnable(false); + mStateMgr.changeState(StateID_Visible); + } +} +void dLytMsgWindowStone_c::finalizeState_In() {} + +void dLytMsgWindowStone_c::initializeState_Visible() {} +void dLytMsgWindowStone_c::executeState_Visible() { + if (!mShouldBeOpen) { + mStateMgr.changeState(StateID_Out); + } +} +void dLytMsgWindowStone_c::finalizeState_Visible() {} + +void dLytMsgWindowStone_c::initializeState_Out() { + mAnm[SEKIBAN_ANIM_OUT].setAnimEnable(true); + mAnm[SEKIBAN_ANIM_OUT].setFrame(0.0f); +} +void dLytMsgWindowStone_c::executeState_Out() { + if (mAnm[SEKIBAN_ANIM_OUT].isEndReached()) { + mAnm[SEKIBAN_ANIM_OUT].setAnimEnable(false); + mStateMgr.changeState(StateID_Invisible); + } +} +void dLytMsgWindowStone_c::finalizeState_Out() {} + +bool dLytMsgWindowStone_c::execute() { + mStateMgr.executeState(); + for (int i = 0; i < SEKIBAN_NUM_ANIMS; i++) { + if (mAnm[i].isEnabled()) { + mAnm[i].play(); + } + } + mLyt.calc(); + for (int i = 0; i < 1; i++) { + mNodes[i].mpLytPane->execute(); + } + return true; +} + +void dLytMsgWindowStone_c::draw() { + mLyt.draw(); +} + +void dLytMsgWindowStone_c::open() { + mShouldBeOpen = true; +} + +bool dLytMsgWindowStone_c::isOpening() const { + return !(*mStateMgr.getStateID() == StateID_In); +} + +void dLytMsgWindowStone_c::close() { + mShouldBeOpen = false; +} + +bool dLytMsgWindowStone_c::isClosing() const { + return !(*mStateMgr.getStateID() == StateID_Out); +} + +bool dLytMsgWindowStone_c::setText(const wchar_t *text) { + mpTextboxes[0]->SetTagProcessor(mpTagProcessor); + mpTextboxes[1]->SetTagProcessor(mpTagProcessor); + mpTextboxes[2]->SetTagProcessor(mpTagProcessor); + mpTextboxes[0]->fn_800AF540(text, mpTagProcessor, 0); + mpTextboxes[1]->fn_800AF540(text, mpTagProcessor, 0); + mpTextboxes[2]->fn_800AF540(text, mpTagProcessor, 0); + return true; +} From 4e88b4aec785bd1468bbe4716941e2681a8387e9 Mon Sep 17 00:00:00 2001 From: robojumper Date: Wed, 2 Apr 2025 13:36:11 +0200 Subject: [PATCH 05/31] auto_caption, auto_explain largely matching --- config/SOUE01/splits.txt | 10 + config/SOUE01/symbols.txt | 162 ++++++++-------- include/d/d_tag_processor.h | 10 +- include/d/lyt/d_lyt_auto_caption.h | 45 +++++ include/d/lyt/d_lyt_auto_explain.h | 45 +++++ include/d/lyt/d_lyt_common_a_btn.h | 2 +- include/d/lyt/d_textbox.h | 1 + .../lyt/msg_window/d_lyt_msg_window_common.h | 14 +- .../d/lyt/msg_window/d_lyt_msg_window_stone.h | 17 +- .../d/lyt/msg_window/d_lyt_msg_window_wood.h | 17 +- include/nw4r/lyt/lyt_textBox.h | 4 + src/d/d_tag_processor.cpp | 14 +- src/d/lyt/d_lyt_auto_caption.cpp | 176 ++++++++++++++++++ src/d/lyt/d_lyt_auto_explain.cpp | 169 +++++++++++++++++ .../lyt/msg_window/d_lyt_msg_window_stone.cpp | 10 +- .../lyt/msg_window/d_lyt_msg_window_wood.cpp | 10 +- 16 files changed, 584 insertions(+), 122 deletions(-) create mode 100644 include/d/lyt/d_lyt_auto_caption.h create mode 100644 include/d/lyt/d_lyt_auto_explain.h create mode 100644 src/d/lyt/d_lyt_auto_caption.cpp create mode 100644 src/d/lyt/d_lyt_auto_explain.cpp diff --git a/config/SOUE01/splits.txt b/config/SOUE01/splits.txt index 5af1cf27..6c52dec7 100644 --- a/config/SOUE01/splits.txt +++ b/config/SOUE01/splits.txt @@ -487,10 +487,20 @@ d/lyt/msg_window/d_lyt_simple_window.cpp: d/lyt/d_lyt_auto_caption.cpp: .text start:0x8012B950 end:0x8012C568 .ctors start:0x804DB760 end:0x804DB764 + .rodata start:0x804E7668 end:0x804E7688 + .data start:0x8051E548 end:0x8051E7C0 + .sdata start:0x80572638 end:0x80572648 + .sdata2 start:0x80579EF8 end:0x80579F10 + .bss start:0x805AF1F0 end:0x805AF2F0 d/lyt/d_lyt_auto_explain.cpp: .text start:0x8012C570 end:0x8012D188 .ctors start:0x804DB764 end:0x804DB768 + .rodata start:0x804E7688 end:0x804E76A0 + .data start:0x8051E7C0 end:0x8051EA08 + .sdata start:0x80572648 end:0x80572658 + .sdata2 start:0x80579F10 end:0x80579F28 + .bss start:0x805AF2F0 end:0x805AF3F0 d/lyt/d_lyt_map_capture.cpp: .text start:0x8012D190 end:0x8012DC28 diff --git a/config/SOUE01/symbols.txt b/config/SOUE01/symbols.txt index 9592a204..f9564118 100644 --- a/config/SOUE01/symbols.txt +++ b/config/SOUE01/symbols.txt @@ -3843,7 +3843,7 @@ fn_800AF3E0 = .text:0x800AF3E0; // type:function size:0x8C fn_800AF470 = .text:0x800AF470; // type:function size:0xCC fn_800AF540__10dTextBox_cFPCwP15dTagProcessor_ce = .text:0x800AF540; // type:function size:0x8C fn_800AF5D0 = .text:0x800AF5D0; // type:function size:0xD4 -fn_800AF6B0 = .text:0x800AF6B0; // type:function size:0x64 +fn_800AF6B0__10dTextBox_cFPCwP15dTagProcessor_c = .text:0x800AF6B0; // type:function size:0x64 fn_800AF720 = .text:0x800AF720; // type:function size:0x8C fn_800AF7B0 = .text:0x800AF7B0; // type:function size:0x84 fn_800AF840 = .text:0x800AF840; // type:function size:0xEC @@ -3949,7 +3949,7 @@ fn_800B8340 = .text:0x800B8340; // type:function size:0x18C fn_800B84D0 = .text:0x800B84D0; // type:function size:0x8C fn_800B8560 = .text:0x800B8560; // type:function size:0x54 fn_800B85C0 = .text:0x800B85C0; // type:function size:0x290 -getNumLines__15dTagProcessor_cFl = .text:0x800B8850; // type:function size:0x38 +getMaxNumLines__15dTagProcessor_cFl = .text:0x800B8850; // type:function size:0x38 getTextCommand__15dTagProcessor_cFwPCwPUcPlPPw = .text:0x800B8890; // type:function size:0x38 process0xFCommand__15dTagProcessor_cFwPCwPl = .text:0x800B88D0; // type:function size:0xC tick0x830__15dTagProcessor_cFv = .text:0x800B88E0; // type:function size:0x30 @@ -6764,14 +6764,14 @@ LytMsgWindow__stateInUpdate = .text:0x80115910; // type:function size:0x60 LytMsgWindow__stateInLeave = .text:0x80115970; // type:function size:0x4 LytMsgWindow__stateOutputTextEnter = .text:0x80115980; // type:function size:0x18 LytMsgWindow__stateOutputTextUpdate = .text:0x801159A0; // type:function size:0x2A0 -fn_80115C40 = .text:0x80115C40; // type:function size:0x8 +vt_0x34__20dLytMsgWindowSubtypeFv = .text:0x80115C40; // type:function size:0x8 LytMsgWindow__stateOutputTextLeave = .text:0x80115C50; // type:function size:0x4 stateChangePageNonFinalTextboxEnter = .text:0x80115C60; // type:function size:0x30 stateChangePageNonFinalTextboxUpdate = .text:0x80115C90; // type:function size:0x140 LytMsgWindow__stateChangePageNonFinalTextboxLeave = .text:0x80115DD0; // type:function size:0x4 LytMsgWindow__stateWaitKeyChangePage1Enter = .text:0x80115DE0; // type:function size:0x4 LytMsgWindow__stateWaitKeyChangePage1Update = .text:0x80115DF0; // type:function size:0xB4 -fn_80115EB0 = .text:0x80115EB0; // type:function size:0x8 +vt_0x38__20dLytMsgWindowSubtypeFb = .text:0x80115EB0; // type:function size:0x8 LytMsgWindow__stateWaitKeyChangePage1Leave = .text:0x80115EC0; // type:function size:0x4 stateChangePageFinalTextboxEnter = .text:0x80115ED0; // type:function size:0x40 stateChangePageFinalTextboxUpdate = .text:0x80115F10; // type:function size:0x258 @@ -6781,7 +6781,7 @@ LytMsgWindow__stateWaitKeyMsgEnd1Update = .text:0x80116190; // type:function siz LytMsgWindow__stateWaitKeyMsgEnd1Leave = .text:0x80116370; // type:function size:0x4 LytMsgWindow__stateWaitKeyMsgEnd2Enter = .text:0x80116380; // type:function size:0x4 LytMsgWindow__stateWaitKeyMsgEnd2Update = .text:0x80116390; // type:function size:0x60 -fn_801163F0 = .text:0x801163F0; // type:function size:0x8 +vt_0x3C__20dLytMsgWindowSubtypeCFv = .text:0x801163F0; // type:function size:0x8 LytMsgWindow__stateWaitKeyMsgEnd2Leave = .text:0x80116400; // type:function size:0x4 LytMsgWindow__stateWaitKeySelectQuestionEnter = .text:0x80116410; // type:function size:0xD0 LytMsgWindow__stateWaitKeySelectQuestionUpdate = .text:0x801164E0; // type:function size:0x15C @@ -6881,8 +6881,8 @@ __dt__19dLytMsgWindowWood_cFv = .text:0x80119DB0; // type:function size:0x170 __dt__20dLytMsgWindowStone_cFv = .text:0x80119F20; // type:function size:0x170 fn_8011A090 = .text:0x8011A090; // type:function size:0x198 fn_8011A230 = .text:0x8011A230; // type:function size:0x158 -fn_8011A390 = .text:0x8011A390; // type:function size:0x118 -fn_8011A4B0 = .text:0x8011A4B0; // type:function size:0x118 +__dt__17dLytAutoExplain_cFv = .text:0x8011A390; // type:function size:0x118 +__dt__17dLytAutoCaption_cFv = .text:0x8011A4B0; // type:function size:0x118 fn_8011A5D0 = .text:0x8011A5D0; // type:function size:0x1AC fn_8011A780 = .text:0x8011A780; // type:function size:0x10 fn_8011A790 = .text:0x8011A790; // type:function size:0x10 @@ -7034,12 +7034,12 @@ fn_8011B7A0 = .text:0x8011B7A0; // type:function size:0x30 fn_8011B7D0 = .text:0x8011B7D0; // type:function size:0x30 fn_8011B800 = .text:0x8011B800; // type:function size:0x30 fn_8011B830 = .text:0x8011B830; // type:function size:0x30 -fn_8011B860 = .text:0x8011B860; // type:function size:0x30 -fn_8011B890 = .text:0x8011B890; // type:function size:0x30 -fn_8011B8C0 = .text:0x8011B8C0; // type:function size:0x30 -fn_8011B8F0 = .text:0x8011B8F0; // type:function size:0x30 -fn_8011B920 = .text:0x8011B920; // type:function size:0x30 -fn_8011B950 = .text:0x8011B950; // type:function size:0x30 +finalizeState__32sFStateID_c<17dLytAutoExplain_c>CFR17dLytAutoExplain_c = .text:0x8011B860; // type:function size:0x30 +executeState__32sFStateID_c<17dLytAutoExplain_c>CFR17dLytAutoExplain_c = .text:0x8011B890; // type:function size:0x30 +initializeState__32sFStateID_c<17dLytAutoExplain_c>CFR17dLytAutoExplain_c = .text:0x8011B8C0; // type:function size:0x30 +finalizeState__32sFStateID_c<17dLytAutoCaption_c>CFR17dLytAutoCaption_c = .text:0x8011B8F0; // type:function size:0x30 +executeState__32sFStateID_c<17dLytAutoCaption_c>CFR17dLytAutoCaption_c = .text:0x8011B920; // type:function size:0x30 +initializeState__32sFStateID_c<17dLytAutoCaption_c>CFR17dLytAutoCaption_c = .text:0x8011B950; // type:function size:0x30 LytMsgWindow__initStates = .text:0x8011B980; // type:function size:0xE58 LytMsgWindow__dtor = .text:0x8011C7E0; // type:function size:0x58 fn_8011C840 = .text:0x8011C840; // type:function size:0x88 @@ -7253,7 +7253,7 @@ fn_801256B0 = .text:0x801256B0; // type:function size:0x8 LytMsgWindowSword__initStates = .text:0x801256C0; // type:function size:0x3F4 LytMsgWindowSword__dtor2 = .text:0x80125AC0; // type:function size:0x58 fn_80125B20 = .text:0x80125B20; // type:function size:0x88 -build__19dLytMsgWindowWood_cFPvPQ23d2d10ResAccIf_cP15dTagProcessor_c = .text:0x80125BB0; // type:function size:0x278 +build__19dLytMsgWindowWood_cFPQ23d2d10ResAccIf_cPQ23d2d10ResAccIf_cP15dTagProcessor_c = .text:0x80125BB0; // type:function size:0x278 remove__19dLytMsgWindowWood_cFv = .text:0x80125E30; // type:function size:0xD8 initializeState_Invisible__19dLytMsgWindowWood_cFv = .text:0x80125F10; // type:function size:0x8 executeState_Invisible__19dLytMsgWindowWood_cFv = .text:0x80125F20; // type:function size:0x28 @@ -7281,7 +7281,7 @@ vt_0x30__19dLytMsgWindowWood_cFv = .text:0x801263C0; // type:function size:0x8 __sinit_\d_lyt_msg_window_wood_cpp = .text:0x801263D0; // type:function size:0x338 scope:local __dt__34sFStateID_c<19dLytMsgWindowWood_c>Fv = .text:0x80126710; // type:function size:0x58 isSameName__34sFStateID_c<19dLytMsgWindowWood_c>CFPCc = .text:0x80126770; // type:function size:0x88 -build__20dLytMsgWindowStone_cFPvPQ23d2d10ResAccIf_cP15dTagProcessor_c = .text:0x80126800; // type:function size:0x284 +build__20dLytMsgWindowStone_cFPQ23d2d10ResAccIf_cPQ23d2d10ResAccIf_cP15dTagProcessor_c = .text:0x80126800; // type:function size:0x284 remove__20dLytMsgWindowStone_cFv = .text:0x80126A90; // type:function size:0xD8 initializeState_Invisible__20dLytMsgWindowStone_cFv = .text:0x80126B70; // type:function size:0x8 executeState_Invisible__20dLytMsgWindowStone_cFv = .text:0x80126B80; // type:function size:0x28 @@ -7421,58 +7421,58 @@ fn_8012B4F0 = .text:0x8012B4F0; // type:function size:0x30 LytSimpleWindow__initStates = .text:0x8012B520; // type:function size:0x338 LytSimpleWindow__dtor = .text:0x8012B860; // type:function size:0x58 fn_8012B8C0 = .text:0x8012B8C0; // type:function size:0x88 -fn_8012B950 = .text:0x8012B950; // type:function size:0x4 -fn_8012B960 = .text:0x8012B960; // type:function size:0x28 -fn_8012B990 = .text:0x8012B990; // type:function size:0x4 -fn_8012B9A0 = .text:0x8012B9A0; // type:function size:0xFC -fn_8012BAA0 = .text:0x8012BAA0; // type:function size:0x78 -fn_8012BB20 = .text:0x8012BB20; // type:function size:0x4 -fn_8012BB30 = .text:0x8012BB30; // type:function size:0x4 -fn_8012BB40 = .text:0x8012BB40; // type:function size:0x28 -fn_8012BB70 = .text:0x8012BB70; // type:function size:0x4 -fn_8012BB80 = .text:0x8012BB80; // type:function size:0x48 -fn_8012BBD0 = .text:0x8012BBD0; // type:function size:0x78 -fn_8012BC50 = .text:0x8012BC50; // type:function size:0x4 -fn_8012BC60 = .text:0x8012BC60; // type:function size:0x178 -fn_8012BDE0 = .text:0x8012BDE0; // type:function size:0x50 -fn_8012BE30 = .text:0x8012BE30; // type:function size:0xA8 -fn_8012BEE0 = .text:0x8012BEE0; // type:function size:0x14 -fn_8012BF00 = .text:0x8012BF00; // type:function size:0xC -fn_8012BF10 = .text:0x8012BF10; // type:function size:0x4C -fn_8012BF60 = .text:0x8012BF60; // type:function size:0xC -fn_8012BF70 = .text:0x8012BF70; // type:function size:0x4C -fn_8012BFC0 = .text:0x8012BFC0; // type:function size:0x64 -fn_8012C030 = .text:0x8012C030; // type:function size:0xF4 -fn_8012C130 = .text:0x8012C130; // type:function size:0x8 -LytAutoCaption__initStates = .text:0x8012C140; // type:function size:0x338 -LytAutoCaption__dtor = .text:0x8012C480; // type:function size:0x58 -fn_8012C4E0 = .text:0x8012C4E0; // type:function size:0x88 -fn_8012C570 = .text:0x8012C570; // type:function size:0x4 -fn_8012C580 = .text:0x8012C580; // type:function size:0x28 -fn_8012C5B0 = .text:0x8012C5B0; // type:function size:0x4 -fn_8012C5C0 = .text:0x8012C5C0; // type:function size:0xCC -fn_8012C690 = .text:0x8012C690; // type:function size:0x78 -fn_8012C710 = .text:0x8012C710; // type:function size:0x4 -fn_8012C720 = .text:0x8012C720; // type:function size:0x4 -fn_8012C730 = .text:0x8012C730; // type:function size:0x28 -fn_8012C760 = .text:0x8012C760; // type:function size:0x4 -fn_8012C770 = .text:0x8012C770; // type:function size:0x48 -fn_8012C7C0 = .text:0x8012C7C0; // type:function size:0x78 -fn_8012C840 = .text:0x8012C840; // type:function size:0x4 -fn_8012C850 = .text:0x8012C850; // type:function size:0x194 -fn_8012C9F0 = .text:0x8012C9F0; // type:function size:0x50 -fn_8012CA40 = .text:0x8012CA40; // type:function size:0xA8 -fn_8012CAF0 = .text:0x8012CAF0; // type:function size:0x14 -fn_8012CB10 = .text:0x8012CB10; // type:function size:0xC -fn_8012CB20 = .text:0x8012CB20; // type:function size:0x4C -fn_8012CB70 = .text:0x8012CB70; // type:function size:0xC -fn_8012CB80 = .text:0x8012CB80; // type:function size:0x4C -fn_8012CBD0 = .text:0x8012CBD0; // type:function size:0x7C -fn_8012CC50 = .text:0x8012CC50; // type:function size:0xF4 -fn_8012CD50 = .text:0x8012CD50; // type:function size:0x8 -LytAutoExplain__initStates = .text:0x8012CD60; // type:function size:0x338 -LytAutoExplain__dtor = .text:0x8012D0A0; // type:function size:0x58 -fn_8012D100 = .text:0x8012D100; // type:function size:0x88 +initializeState_Invisible__17dLytAutoCaption_cFv = .text:0x8012B950; // type:function size:0x4 +executeState_Invisible__17dLytAutoCaption_cFv = .text:0x8012B960; // type:function size:0x28 +finalizeState_Invisible__17dLytAutoCaption_cFv = .text:0x8012B990; // type:function size:0x4 +initializeState_In__17dLytAutoCaption_cFv = .text:0x8012B9A0; // type:function size:0xFC +executeState_In__17dLytAutoCaption_cFv = .text:0x8012BAA0; // type:function size:0x78 +finalizeState_In__17dLytAutoCaption_cFv = .text:0x8012BB20; // type:function size:0x4 +initializeState_OutputText__17dLytAutoCaption_cFv = .text:0x8012BB30; // type:function size:0x4 +executeState_OutputText__17dLytAutoCaption_cFv = .text:0x8012BB40; // type:function size:0x28 +finalizeState_OutputText__17dLytAutoCaption_cFv = .text:0x8012BB70; // type:function size:0x4 +initializeState_Out__17dLytAutoCaption_cFv = .text:0x8012BB80; // type:function size:0x48 +executeState_Out__17dLytAutoCaption_cFv = .text:0x8012BBD0; // type:function size:0x78 +finalizeState_Out__17dLytAutoCaption_cFv = .text:0x8012BC50; // type:function size:0x4 +build__17dLytAutoCaption_cFPQ23d2d10ResAccIf_cPQ23d2d10ResAccIf_cP15dTagProcessor_c = .text:0x8012BC60; // type:function size:0x178 +remove__17dLytAutoCaption_cFv = .text:0x8012BDE0; // type:function size:0x50 +execute__17dLytAutoCaption_cFv = .text:0x8012BE30; // type:function size:0xA8 +draw__17dLytAutoCaption_cFv = .text:0x8012BEE0; // type:function size:0x14 +open__17dLytAutoCaption_cFv = .text:0x8012BF00; // type:function size:0xC +isOpening__17dLytAutoCaption_cCFv = .text:0x8012BF10; // type:function size:0x4C +close__17dLytAutoCaption_cFv = .text:0x8012BF60; // type:function size:0xC +isClosing__17dLytAutoCaption_cCFv = .text:0x8012BF70; // type:function size:0x4C +setText__17dLytAutoCaption_cFPCw = .text:0x8012BFC0; // type:function size:0x64 +checkSomethingMeter__17dLytAutoCaption_cFv = .text:0x8012C030; // type:function size:0xF4 +vt_0x30__17dLytAutoCaption_cFv = .text:0x8012C130; // type:function size:0x8 +__sinit_\d_lyt_auto_caption_cpp = .text:0x8012C140; // type:function size:0x338 +__dt__32sFStateID_c<17dLytAutoCaption_c>Fv = .text:0x8012C480; // type:function size:0x58 +isSameName__32sFStateID_c<17dLytAutoCaption_c>CFPCc = .text:0x8012C4E0; // type:function size:0x88 +initializeState_Invisible__17dLytAutoExplain_cFv = .text:0x8012C570; // type:function size:0x4 +executeState_Invisible__17dLytAutoExplain_cFv = .text:0x8012C580; // type:function size:0x28 +finalizeState_Invisible__17dLytAutoExplain_cFv = .text:0x8012C5B0; // type:function size:0x4 +initializeState_In__17dLytAutoExplain_cFv = .text:0x8012C5C0; // type:function size:0xCC +executeState_In__17dLytAutoExplain_cFv = .text:0x8012C690; // type:function size:0x78 +finalizeState_In__17dLytAutoExplain_cFv = .text:0x8012C710; // type:function size:0x4 +initializeState_OutputText__17dLytAutoExplain_cFv = .text:0x8012C720; // type:function size:0x4 +executeState_OutputText__17dLytAutoExplain_cFv = .text:0x8012C730; // type:function size:0x28 +finalizeState_OutputText__17dLytAutoExplain_cFv = .text:0x8012C760; // type:function size:0x4 +initializeState_Out__17dLytAutoExplain_cFv = .text:0x8012C770; // type:function size:0x48 +executeState_Out__17dLytAutoExplain_cFv = .text:0x8012C7C0; // type:function size:0x78 +finalizeState_Out__17dLytAutoExplain_cFv = .text:0x8012C840; // type:function size:0x4 +build__17dLytAutoExplain_cFPQ23d2d10ResAccIf_cPQ23d2d10ResAccIf_cP15dTagProcessor_c = .text:0x8012C850; // type:function size:0x194 +remove__17dLytAutoExplain_cFv = .text:0x8012C9F0; // type:function size:0x50 +execute__17dLytAutoExplain_cFv = .text:0x8012CA40; // type:function size:0xA8 +draw__17dLytAutoExplain_cFv = .text:0x8012CAF0; // type:function size:0x14 +open__17dLytAutoExplain_cFv = .text:0x8012CB10; // type:function size:0xC +isOpening__17dLytAutoExplain_cCFv = .text:0x8012CB20; // type:function size:0x4C +close__17dLytAutoExplain_cFv = .text:0x8012CB70; // type:function size:0xC +isClosing__17dLytAutoExplain_cCFv = .text:0x8012CB80; // type:function size:0x4C +setText__17dLytAutoExplain_cFPCw = .text:0x8012CBD0; // type:function size:0x7C +checkSomethingMeter__17dLytAutoExplain_cFv = .text:0x8012CC50; // type:function size:0xF4 +vt_0x30__17dLytAutoExplain_cFv = .text:0x8012CD50; // type:function size:0x8 +__sinit_\d_lyt_auto_explain_cpp = .text:0x8012CD60; // type:function size:0x338 +__dt__32sFStateID_c<17dLytAutoExplain_c>Fv = .text:0x8012D0A0; // type:function size:0x58 +isSameName__32sFStateID_c<17dLytAutoExplain_c>CFPCc = .text:0x8012D100; // type:function size:0x88 fn_8012D190 = .text:0x8012D190; // type:function size:0x68 fn_8012D200 = .text:0x8012D200; // type:function size:0x108 projectForMapMaybe = .text:0x8012D310; // type:function size:0x18 @@ -32317,8 +32317,8 @@ lbl_8051E5E0 = .data:0x8051E5E0; // type:object size:0x10 lbl_8051E5F0 = .data:0x8051E5F0; // type:object size:0x10 lbl_8051E600 = .data:0x8051E600; // type:object size:0x10 lbl_8051E610 = .data:0x8051E610; // type:object size:0x18 -lbl_8051E628 = .data:0x8051E628; // type:object size:0x164 -lbl_8051E78C = .data:0x8051E78C; // type:object size:0x34 +__vt__17dLytAutoCaption_c = .data:0x8051E628; // type:object size:0x44 +__vt__32sFStateID_c<17dLytAutoCaption_c> = .data:0x8051E78C; // type:object size:0x34 lbl_8051E7C0 = .data:0x8051E7C0; // type:object size:0x18 data:string lbl_8051E7D8 = .data:0x8051E7D8; // type:object size:0xC lbl_8051E7E4 = .data:0x8051E7E4; // type:object size:0x1C @@ -32328,8 +32328,8 @@ lbl_8051E828 = .data:0x8051E828; // type:object size:0x10 lbl_8051E838 = .data:0x8051E838; // type:object size:0x10 lbl_8051E848 = .data:0x8051E848; // type:object size:0x10 lbl_8051E858 = .data:0x8051E858; // type:object size:0x18 -lbl_8051E870 = .data:0x8051E870; // type:object size:0x164 -lbl_8051E9D4 = .data:0x8051E9D4; // type:object size:0x34 +__vt__17dLytAutoExplain_c = .data:0x8051E870; // type:object size:0x44 +__vt__32sFStateID_c<17dLytAutoExplain_c> = .data:0x8051E9D4; // type:object size:0x34 lbl_8051EA08 = .data:0x8051EA08; // type:object size:0xA0 data:4byte lbl_8051EAA8 = .data:0x8051EAA8; // type:object size:0x38 lbl_8051EAE0 = .data:0x8051EAE0; // type:object size:0x14 @@ -48878,16 +48878,16 @@ LytSimpleWindow__STATE_INVISIBLE = .bss:0x805AF100; // type:object size:0x40 dat LytSimpleWindow__STATE_IN = .bss:0x805AF140; // type:object size:0x40 data:4byte LytSimpleWindow__STATE_OUTPUT_TEXT = .bss:0x805AF180; // type:object size:0x40 data:4byte LytSimpleWindow__STATE_OUT = .bss:0x805AF1C0; // type:object size:0x30 data:4byte -lbl_805AF1F0 = .bss:0x805AF1F0; // type:object size:0x10 -LytAutoCaption__STATE_INVISIBLE = .bss:0x805AF200; // type:object size:0x40 data:4byte -LytAutoCaption__STATE_IN = .bss:0x805AF240; // type:object size:0x40 data:4byte -LytAutoCaption__STATE_OUTPUT_TEXT = .bss:0x805AF280; // type:object size:0x40 data:4byte -LytAutoCaption__STATE_OUT = .bss:0x805AF2C0; // type:object size:0x30 data:4byte -lbl_805AF2F0 = .bss:0x805AF2F0; // type:object size:0x10 -LytAutoExplain__STATE_INVISIBLE = .bss:0x805AF300; // type:object size:0x40 data:4byte -LytAutoExplain__STATE_IN = .bss:0x805AF340; // type:object size:0x40 data:4byte -LytAutoExplain__STATE_OUTPUT_TEXT = .bss:0x805AF380; // type:object size:0x40 data:4byte -LytAutoExplain__STATE_OUT = .bss:0x805AF3C0; // type:object size:0x30 data:4byte +lbl_805AF1F0 = .bss:0x805AF1F0; // type:object size:0xC +StateID_Invisible__17dLytAutoCaption_c = .bss:0x805AF200; // type:object size:0x30 data:4byte +StateID_In__17dLytAutoCaption_c = .bss:0x805AF240; // type:object size:0x30 data:4byte +StateID_OutputText__17dLytAutoCaption_c = .bss:0x805AF280; // type:object size:0x30 data:4byte +StateID_Out__17dLytAutoCaption_c = .bss:0x805AF2C0; // type:object size:0x30 data:4byte +lbl_805AF2F0 = .bss:0x805AF2F0; // type:object size:0xC +StateID_Invisible__17dLytAutoExplain_c = .bss:0x805AF300; // type:object size:0x30 data:4byte +StateID_In__17dLytAutoExplain_c = .bss:0x805AF340; // type:object size:0x30 data:4byte +StateID_OutputText__17dLytAutoExplain_c = .bss:0x805AF380; // type:object size:0x30 data:4byte +StateID_Out__17dLytAutoExplain_c = .bss:0x805AF3C0; // type:object size:0x30 data:4byte lbl_805AF3F0 = .bss:0x805AF3F0; // type:object size:0x10 StateID_RenderingWait__16dLytMapCapture_c = .bss:0x805AF400; // type:object size:0x40 data:4byte StateID_RenderingWaitStep2__16dLytMapCapture_c = .bss:0x805AF440; // type:object size:0x30 data:4byte diff --git a/include/d/d_tag_processor.h b/include/d/d_tag_processor.h index c68ad2f1..bb551637 100644 --- a/include/d/d_tag_processor.h +++ b/include/d/d_tag_processor.h @@ -45,7 +45,7 @@ public: u8 symbolToFontIdx(s32 s); void setStringArg(const wchar_t *arg, s32 index); - static s32 getNumLines(s32 arg); + static s32 getMaxNumLines(s32 arg); static void getTextCommand(wchar_t _0xe, const wchar_t *src, u8 *outCmdLen, s32 *outCmd, wchar_t **outEndPtr); static void process0xFCommand(wchar_t _0xf, const wchar_t *src, s32 *outCmd); @@ -68,6 +68,10 @@ public: s32 tickPauseFrame(); s32 tick0x830(); + s32 getNumLinesMaybe() const { + return mCommandInsert; + } + private: /* 0x004 */ dTextBox_c *field_0x004; /* 0x008 */ wchar_t field_0x008[4][256]; @@ -121,8 +125,8 @@ private: /* 0x90D */ u8 field_0x90D; /* 0x90E */ u8 field_0x90E; /* 0x90F */ u8 field_0x90F[4]; - /* 0x914 */ f32 field_0x914[0x32]; - /* 0x9DC */ s32 mCommandInsert; + /* 0x914 */ f32 field_0x914[0x32]; // Maybe width for each individual line + /* 0x9DC */ s32 mCommandInsert; // Maybe number of lines /* 0x9E0 */ wchar_t mStringArgs[8][64]; /* 0xDE0 */ u8 field_0xDE0[0xEE0 - 0xDE0]; /* 0xEE0 */ u8 field_0xEE0; diff --git a/include/d/lyt/d_lyt_auto_caption.h b/include/d/lyt/d_lyt_auto_caption.h new file mode 100644 index 00000000..d09c86fe --- /dev/null +++ b/include/d/lyt/d_lyt_auto_caption.h @@ -0,0 +1,45 @@ +#ifndef D_LYT_AUTO_CAPTION_H +#define D_LYT_AUTO_CAPTION_H + +#include "d/d_tag_processor.h" +#include "d/lyt/d2d.h" +#include "d/lyt/d_textbox.h" +#include "d/lyt/msg_window/d_lyt_msg_window_common.h" +#include "nw4r/lyt/lyt_pane.h" +#include "s/s_State.hpp" + +class dLytAutoCaption_c : public dLytMsgWindowSubtype { +public: + /* vt 0x08 */ virtual ~dLytAutoCaption_c() {} + /* vt 0x0C */ virtual void draw() override; + /* vt 0x10 */ virtual bool build(d2d::ResAccIf_c *resAcc1, d2d::ResAccIf_c *resAcc, dTagProcessor_c *tagProcessor) override; + /* vt 0x14 */ virtual bool remove() override; + /* vt 0x18 */ virtual bool execute() override; + /* vt 0x1C */ virtual void open() override; + /* vt 0x20 */ virtual bool isOpening() const override; + /* vt 0x24 */ virtual void close() override; + /* vt 0x28 */ virtual bool isClosing() const override; + /* vt 0x2C */ virtual bool setText(const wchar_t *text) override; + /* vt 0x30 */ virtual dTextBox_c *vt_0x30() override { + return mpTextboxes[0]; + } + + STATE_FUNC_DECLARE(dLytAutoCaption_c, Invisible); + STATE_FUNC_DECLARE(dLytAutoCaption_c, In); + STATE_FUNC_DECLARE(dLytAutoCaption_c, OutputText); + STATE_FUNC_DECLARE(dLytAutoCaption_c, Out); + +private: + static bool checkSomethingMeter(); + + /* 0x010 */ UI_STATE_MGR_DECLARE(dLytAutoCaption_c); + /* 0x068 */ d2d::ResAccIf_c mResAcc; + /* 0x3C4 */ d2d::LytBase_c mLyt; + /* 0x44C */ d2d::AnmGroup_c mAnm[4]; + /* 0x54C */ dTextBox_c *mpTextboxes[2]; + /* 0x554 */ nw4r::lyt::Pane *mpPane; + /* 0x558 */ dTagProcessor_c *mpTagProcessor; + /* 0x55C */ bool mShouldBeOpen; +}; + +#endif diff --git a/include/d/lyt/d_lyt_auto_explain.h b/include/d/lyt/d_lyt_auto_explain.h new file mode 100644 index 00000000..e9e62e48 --- /dev/null +++ b/include/d/lyt/d_lyt_auto_explain.h @@ -0,0 +1,45 @@ +#ifndef D_LYT_AUTO_EXPLAIN_H +#define D_LYT_AUTO_EXPLAIN_H + +#include "d/d_tag_processor.h" +#include "d/lyt/d2d.h" +#include "d/lyt/d_textbox.h" +#include "d/lyt/msg_window/d_lyt_msg_window_common.h" +#include "nw4r/lyt/lyt_pane.h" +#include "s/s_State.hpp" + +class dLytAutoExplain_c : public dLytMsgWindowSubtype { +public: + /* vt 0x08 */ virtual ~dLytAutoExplain_c() {} + /* vt 0x0C */ virtual void draw() override; + /* vt 0x10 */ virtual bool build(d2d::ResAccIf_c *resAcc1, d2d::ResAccIf_c *resAcc, dTagProcessor_c *tagProcessor) override; + /* vt 0x14 */ virtual bool remove() override; + /* vt 0x18 */ virtual bool execute() override; + /* vt 0x1C */ virtual void open() override; + /* vt 0x20 */ virtual bool isOpening() const override; + /* vt 0x24 */ virtual void close() override; + /* vt 0x28 */ virtual bool isClosing() const override; + /* vt 0x2C */ virtual bool setText(const wchar_t *text) override; + /* vt 0x30 */ virtual dTextBox_c *vt_0x30() override { + return mpTextboxes[0]; + } + + STATE_FUNC_DECLARE(dLytAutoExplain_c, Invisible); + STATE_FUNC_DECLARE(dLytAutoExplain_c, In); + STATE_FUNC_DECLARE(dLytAutoExplain_c, OutputText); + STATE_FUNC_DECLARE(dLytAutoExplain_c, Out); + +private: + static bool checkSomethingMeter(); + + /* 0x010 */ UI_STATE_MGR_DECLARE(dLytAutoExplain_c); + /* 0x068 */ d2d::ResAccIf_c mResAcc; + /* 0x3C4 */ d2d::LytBase_c mLyt; + /* 0x44C */ d2d::AnmGroup_c mAnm[3]; + /* 0x50C */ dTextBox_c *mpTextboxes[2]; + /* 0x514 */ nw4r::lyt::Pane *mpPane; + /* 0x518 */ dTagProcessor_c *mpTagProcessor; + /* 0x51C */ bool mShouldBeOpen; +}; + +#endif diff --git a/include/d/lyt/d_lyt_common_a_btn.h b/include/d/lyt/d_lyt_common_a_btn.h index 0a09b4e0..a2f9fe02 100644 --- a/include/d/lyt/d_lyt_common_a_btn.h +++ b/include/d/lyt/d_lyt_common_a_btn.h @@ -24,7 +24,7 @@ public: return mLyt.getName(); } - u8 isDoneOut() const { + bool isDoneOut() const { return mIsDoneOut; } diff --git a/include/d/lyt/d_textbox.h b/include/d/lyt/d_textbox.h index cfbd3396..134ceb75 100644 --- a/include/d/lyt/d_textbox.h +++ b/include/d/lyt/d_textbox.h @@ -44,6 +44,7 @@ public: // TODO } + s32 fn_800AF6B0(const wchar_t *, dTagProcessor_c *tagProcessor); void fn_800AF930(const wchar_t *); void fn_800AF540(const wchar_t *text, dTagProcessor_c *tagProcessor, ...); diff --git a/include/d/lyt/msg_window/d_lyt_msg_window_common.h b/include/d/lyt/msg_window/d_lyt_msg_window_common.h index cf65fb8e..d8f843e3 100644 --- a/include/d/lyt/msg_window/d_lyt_msg_window_common.h +++ b/include/d/lyt/msg_window/d_lyt_msg_window_common.h @@ -9,7 +9,7 @@ class dLytMsgWindowSubtype : public m2d::Base_c { public: /* vt 0x08 */ virtual ~dLytMsgWindowSubtype() {} // vt 0x0C = m2d::Base_c::draw - /* vt 0x10 */ virtual bool build(void *unk, d2d::ResAccIf_c *resAcc, dTagProcessor_c *tagProcessor); + /* vt 0x10 */ virtual bool build(d2d::ResAccIf_c *resAcc1, d2d::ResAccIf_c *resAcc, dTagProcessor_c *tagProcessor); /* vt 0x14 */ virtual bool remove(); /* vt 0x18 */ virtual bool execute(); /* vt 0x1C */ virtual void open(); @@ -18,9 +18,15 @@ public: /* vt 0x28 */ virtual bool isClosing() const; /* vt 0x2C */ virtual bool setText(const wchar_t *text); /* vt 0x30 */ virtual dTextBox_c *vt_0x30(); - /* vt 0x34 */ virtual void vt_0x34(); - /* vt 0x38 */ virtual void vt_0x38(bool b); - /* vt 0x3C */ virtual u8 vt_0x3C() const; + /* vt 0x34 */ virtual bool vt_0x34() { + return true; + } + /* vt 0x38 */ virtual bool vt_0x38(bool b) { + return true; + } + /* vt 0x3C */ virtual bool vt_0x3C() const { + return true; + } /* vt 0x40 */ virtual bool vt_0x40() const; }; diff --git a/include/d/lyt/msg_window/d_lyt_msg_window_stone.h b/include/d/lyt/msg_window/d_lyt_msg_window_stone.h index e7b16086..4a52f910 100644 --- a/include/d/lyt/msg_window/d_lyt_msg_window_stone.h +++ b/include/d/lyt/msg_window/d_lyt_msg_window_stone.h @@ -13,7 +13,8 @@ class dLytMsgWindowStone_c : public dLytMsgWindowSubtype { public: /* vt 0x08 */ virtual ~dLytMsgWindowStone_c() {} /* vt 0x0C */ virtual void draw() override; - /* vt 0x10 */ virtual bool build(void *unk, d2d::ResAccIf_c *resAcc, dTagProcessor_c *tagProcessor) override; + /* vt 0x10 */ virtual bool + build(d2d::ResAccIf_c *resAcc1, d2d::ResAccIf_c *resAcc, dTagProcessor_c *tagProcessor) override; /* vt 0x14 */ virtual bool remove() override; /* vt 0x18 */ virtual bool execute() override; /* vt 0x1C */ virtual void open() override; @@ -24,14 +25,14 @@ public: /* vt 0x30 */ virtual dTextBox_c *vt_0x30() override { return mpTextboxes[0]; } - /* vt 0x34 */ virtual void vt_0x34() override { - mCommon.requestIn(); + /* vt 0x34 */ virtual bool vt_0x34() override { + return mBtn.requestIn(); } - /* vt 0x38 */ virtual void vt_0x38(bool b) override { - mCommon.requestOut(b); + /* vt 0x38 */ virtual bool vt_0x38(bool b) override { + return mBtn.requestOut(b); } - /* vt 0x3C */ virtual u8 vt_0x3C() const override { - return mCommon.isDoneOut(); + /* vt 0x3C */ virtual bool vt_0x3C() const override { + return mBtn.isDoneOut(); } STATE_FUNC_DECLARE(dLytMsgWindowStone_c, Invisible); @@ -49,7 +50,7 @@ private: /* 0x528 */ dTextBox_c *mpTextboxes[3]; /* 0x530 */ nw4r::lyt::Pane *mpPanes[2]; /* 0x538 */ dTagProcessor_c *mpTagProcessor; - /* 0x53C */ dLytCommonABtn_c mCommon; + /* 0x53C */ dLytCommonABtn_c mBtn; /* 0x6EC */ bool mShouldBeOpen; }; diff --git a/include/d/lyt/msg_window/d_lyt_msg_window_wood.h b/include/d/lyt/msg_window/d_lyt_msg_window_wood.h index b56499ae..795fdf97 100644 --- a/include/d/lyt/msg_window/d_lyt_msg_window_wood.h +++ b/include/d/lyt/msg_window/d_lyt_msg_window_wood.h @@ -13,7 +13,8 @@ class dLytMsgWindowWood_c : public dLytMsgWindowSubtype { public: /* vt 0x08 */ virtual ~dLytMsgWindowWood_c() {} /* vt 0x0C */ virtual void draw() override; - /* vt 0x10 */ virtual bool build(void *unk, d2d::ResAccIf_c *resAcc, dTagProcessor_c *tagProcessor) override; + /* vt 0x10 */ virtual bool + build(d2d::ResAccIf_c *resAcc1, d2d::ResAccIf_c *resAcc, dTagProcessor_c *tagProcessor) override; /* vt 0x14 */ virtual bool remove() override; /* vt 0x18 */ virtual bool execute() override; /* vt 0x1C */ virtual void open() override; @@ -24,14 +25,14 @@ public: /* vt 0x30 */ virtual dTextBox_c *vt_0x30() override { return mpTextboxes[0]; } - /* vt 0x34 */ virtual void vt_0x34() override { - mCommon.requestIn(); + /* vt 0x34 */ virtual bool vt_0x34() override { + return mBtn.requestIn(); } - /* vt 0x38 */ virtual void vt_0x38(bool b) override { - mCommon.requestOut(b); + /* vt 0x38 */ virtual bool vt_0x38(bool b) override { + return mBtn.requestOut(b); } - /* vt 0x3C */ virtual u8 vt_0x3C() const override { - return mCommon.isDoneOut(); + /* vt 0x3C */ virtual bool vt_0x3C() const override { + return mBtn.isDoneOut(); } STATE_FUNC_DECLARE(dLytMsgWindowWood_c, Invisible); @@ -49,7 +50,7 @@ private: /* 0x528 */ dTextBox_c *mpTextboxes[2]; /* 0x530 */ nw4r::lyt::Pane *mpPanes[2]; /* 0x538 */ dTagProcessor_c *mpTagProcessor; - /* 0x53C */ dLytCommonABtn_c mCommon; + /* 0x53C */ dLytCommonABtn_c mBtn; /* 0x6EC */ bool mShouldBeOpen; }; diff --git a/include/nw4r/lyt/lyt_textBox.h b/include/nw4r/lyt/lyt_textBox.h index 4dfd0549..f4d5bff9 100644 --- a/include/nw4r/lyt/lyt_textBox.h +++ b/include/nw4r/lyt/lyt_textBox.h @@ -77,6 +77,10 @@ public: mpTagProcessor = pTagProcessor; } + const wchar_t *GetString() const { + return mTextBuf; + } + virtual ~TextBox(); NW4R_UT_RTTI_DECL(TextBox); virtual void DrawSelf(const DrawInfo &drawInfo); // at 0x18 diff --git a/src/d/d_tag_processor.cpp b/src/d/d_tag_processor.cpp index 5d3fcd6f..cb7bf2e7 100644 --- a/src/d/d_tag_processor.cpp +++ b/src/d/d_tag_processor.cpp @@ -407,12 +407,12 @@ void dTagProcessor_c::eventFlowTextProcessingRelated( } } else { if (textBox != nullptr) { - if (c == 10) { + if (c == '\n') { *writePtr = c; src++; writePtr++; mCommandInsert++; - s32 i10 = getNumLines(field_0x90C); + s32 i10 = getMaxNumLines(field_0x90C); if (mCommandInsert % i10 == 0) { float1 = fn_800B8040(0, field_0x90C); float1 *= textBox->getMyScale(); @@ -628,11 +628,11 @@ void dTagProcessor_c::fn_800B4FF0(nw4r::ut::Rect *rect, nw4r::ut::PrintContextGetSize(); nw4r::lyt::Size fontSize = field_0x004->GetFontSize(); - int i1 = getNumLines(field_0x90C); + int i1 = getMaxNumLines(field_0x90C); if (arg % i1 == 0 && field_0x90C != 31 && field_0x90C != 8) { int u = 0; int v = 0; - for (int i = arg; i < arg + getNumLines(field_0x90C) && i < 0x32; i++) { + for (int i = arg; i < arg + getMaxNumLines(field_0x90C) && i < 0x32; i++) { f32 f6 = getFloat(i); if (f6 > 0.0f) { v++; @@ -650,7 +650,7 @@ void dTagProcessor_c::fn_800B4FF0(nw4r::ut::Rect *rect, nw4r::ut::PrintContext