From 3bed1f33606c69c45a840034d4925eb315603a0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Lam?= Date: Sun, 20 Sep 2020 01:08:46 +0200 Subject: [PATCH] ksys/res: Implement GParamList Armor --- CMakeLists.txt | 1 + data/uking_functions.csv | 4 +-- .../resGParamListObjectArmor.h | 36 +++++++++++++++++++ .../Resource/resResourceGParamList.cpp | 2 ++ 4 files changed, 41 insertions(+), 2 deletions(-) create mode 100644 src/KingSystem/Resource/GeneralParamList/resGParamListObjectArmor.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 7299c6ff..d0337fc0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -64,6 +64,7 @@ add_executable(uking src/KingSystem/MessageSystem/mesTransceiver.h src/KingSystem/Resource/GeneralParamList/resGParamListObject.h + src/KingSystem/Resource/GeneralParamList/resGParamListObjectArmor.h src/KingSystem/Resource/GeneralParamList/resGParamListObjectAttack.h src/KingSystem/Resource/GeneralParamList/resGParamListObjectAttackInterval.h src/KingSystem/Resource/GeneralParamList/resGParamListObjectBindBone.h diff --git a/data/uking_functions.csv b/data/uking_functions.csv index 58a38cae..0530676c 100644 --- a/data/uking_functions.csv +++ b/data/uking_functions.csv @@ -89081,7 +89081,7 @@ 0x0000007101192548,BgparamlistObjectPlayer::ctor,11236,_ZN4ksys3res22GParamListObjectPlayerC2Ev 0x000000710119512c,BgparamlistObjectCamera::ctor,884,_ZN4ksys3res22GParamListObjectCameraC2Ev 0x00000071011954a0,BgparamlistObjectGrab::ctor,1188,_ZN4ksys3res20GParamListObjectGrabC2Ev -0x0000007101195944,BgparamlistObjectArmor::ctor,700, +0x0000007101195944,BgparamlistObjectArmor::ctor,700,_ZN4ksys3res21GParamListObjectArmorC2Ev 0x0000007101195c00,BgparamlistObjectArmorEffect::ctor,540, 0x0000007101195e1c,BgparamlistObjectArmorHead::ctor,400, 0x0000007101195fac,BgparamlistObjectArmorUpper::ctor,508, @@ -89169,7 +89169,7 @@ 0x00000071011a7c98,sub_71011A7C98,12,_ZNK4ksys3res22GParamListObjectPlayer7getNameEv 0x00000071011a7ca4,sub_71011A7CA4,12,_ZNK4ksys3res22GParamListObjectCamera7getNameEv 0x00000071011a7cb0,sub_71011A7CB0,12,_ZNK4ksys3res20GParamListObjectGrab7getNameEv -0x00000071011a7cbc,sub_71011A7CBC,12, +0x00000071011a7cbc,sub_71011A7CBC,12,_ZNK4ksys3res21GParamListObjectArmor7getNameEv 0x00000071011a7cc8,sub_71011A7CC8,12, 0x00000071011a7cd4,sub_71011A7CD4,12, 0x00000071011a7ce0,sub_71011A7CE0,12, diff --git a/src/KingSystem/Resource/GeneralParamList/resGParamListObjectArmor.h b/src/KingSystem/Resource/GeneralParamList/resGParamListObjectArmor.h new file mode 100644 index 00000000..65a0aeab --- /dev/null +++ b/src/KingSystem/Resource/GeneralParamList/resGParamListObjectArmor.h @@ -0,0 +1,36 @@ +#pragma once + +#include +#include "KingSystem/Resource/GeneralParamList/resGParamListObject.h" +#include "KingSystem/Utils/Types.h" + +namespace ksys::res { + +class GParamListObjectArmor : public GParamListObject { +public: + GParamListObjectArmor(); + const char* getName() const override { return "Armor"; } + + agl::utl::Parameter mStarNum; + agl::utl::Parameter mDefenceAddLevel; + agl::utl::Parameter mWindScaleMesh; + agl::utl::Parameter mWindScale; + agl::utl::Parameter mNextRankName; + agl::utl::Parameter mAffectTransOffsetShield; + agl::utl::Parameter mAffectRotOffsetShield; +}; +KSYS_CHECK_SIZE_NX150(GParamListObjectArmor, 0x138); + +inline GParamListObjectArmor::GParamListObjectArmor() { + auto* const obj = &mObj; + + mStarNum.init(0, "StarNum", "", obj); + mDefenceAddLevel.init(0, "DefenceAddLevel", "", obj); + mWindScaleMesh.init("", "WindScaleMesh", "", obj); + mWindScale.init(0.0, "WindScale", "", obj); + mNextRankName.init("", "NextRankName", "", obj); + mAffectTransOffsetShield.init({0.0, 0.0, 0.0}, "AffectTransOffsetShield", "", obj); + mAffectRotOffsetShield.init({0.0, 0.0, 0.0}, "AffectRotOffsetShield", "", obj); +} + +} // namespace ksys::res diff --git a/src/KingSystem/Resource/resResourceGParamList.cpp b/src/KingSystem/Resource/resResourceGParamList.cpp index ba21f2d8..ed323288 100644 --- a/src/KingSystem/Resource/resResourceGParamList.cpp +++ b/src/KingSystem/Resource/resResourceGParamList.cpp @@ -3,6 +3,7 @@ #include #include "KingSystem/ActorSystem/actActorParamMgr.h" #include "KingSystem/Resource/GeneralParamList/resGParamListObject.h" +#include "KingSystem/Resource/GeneralParamList/resGParamListObjectArmor.h" #include "KingSystem/Resource/GeneralParamList/resGParamListObjectAttack.h" #include "KingSystem/Resource/GeneralParamList/resGParamListObjectAttackInterval.h" #include "KingSystem/Resource/GeneralParamList/resGParamListObjectBindBone.h" @@ -87,6 +88,7 @@ bool GParamList::parse_(u8* data, size_t, sead::Heap* heap) { add(archive.getRootList(), "Player", heap, dummy_list); add(archive.getRootList(), "Camera", heap, dummy_list); add(archive.getRootList(), "Grab", heap, dummy_list); + add(archive.getRootList(), "Armor", heap, dummy_list); // TODO: the rest