ksys/res: Implement GParamList Item

This commit is contained in:
Léo Lam 2020-09-20 01:23:56 +02:00
parent 00e2ba737e
commit 31f108e78b
No known key found for this signature in database
GPG Key ID: 0DF30F9081000741
4 changed files with 41 additions and 2 deletions

View File

@ -80,6 +80,7 @@ add_executable(uking
src/KingSystem/Resource/GeneralParamList/resGParamListObjectGeneral.h
src/KingSystem/Resource/GeneralParamList/resGParamListObjectGrab.h
src/KingSystem/Resource/GeneralParamList/resGParamListObjectGuardianMiniWeapon.h
src/KingSystem/Resource/GeneralParamList/resGParamListObjectItem.h
src/KingSystem/Resource/GeneralParamList/resGParamListObjectLargeSword.h
src/KingSystem/Resource/GeneralParamList/resGParamListObjectLiftable.h
src/KingSystem/Resource/GeneralParamList/resGParamListObjectMasterSword.h

View File

@ -89087,7 +89087,7 @@
0x0000007101195fac,BgparamlistObjectArmorUpper::ctor,508,_ZN4ksys3res26GParamListObjectArmorUpperC2Ev
0x00000071011961a8,BgparamlistObjectShiekerStone::ctor,672,_ZN4ksys3res28GParamListObjectShiekerStoneC2Ev
0x0000007101196448,BgparamlistObjectLiftable::ctor,1520,_ZN4ksys3res24GParamListObjectLiftableC2Ev
0x0000007101196a38,BgparamlistObjectItem::ctor,664,
0x0000007101196a38,BgparamlistObjectItem::ctor,664,_ZN4ksys3res20GParamListObjectItemC2Ev
0x0000007101196cd0,BgparamlistObjectArrow::ctor,540,
0x0000007101196eec,BgparamlistObjectCureItem::ctor,456,
0x00000071011970b4,BgparamlistObjectCookSpice::ctor,476,
@ -89176,7 +89176,7 @@
0x00000071011a7cec,sub_71011A7CEC,12,_ZNK4ksys3res28GParamListObjectShiekerStone7getNameEv
0x00000071011a7cf8,sub_71011A7CF8,12,_ZNK4ksys3res27GParamListObjectSeriesArmor7getNameEv
0x00000071011a7d04,sub_71011A7D04,12,_ZNK4ksys3res24GParamListObjectLiftable7getNameEv
0x00000071011a7d10,sub_71011A7D10,12,
0x00000071011a7d10,sub_71011A7D10,12,_ZNK4ksys3res20GParamListObjectItem7getNameEv
0x00000071011a7d1c,sub_71011A7D1C,12,
0x00000071011a7d28,sub_71011A7D28,12,
0x00000071011a7d34,sub_71011A7D34,12,

Can't render this file because it is too large.

View File

@ -0,0 +1,36 @@
#pragma once
#include <agl/Utils/aglParameter.h>
#include "KingSystem/Resource/GeneralParamList/resGParamListObject.h"
#include "KingSystem/Utils/Types.h"
namespace ksys::res {
class GParamListObjectItem : public GParamListObject {
public:
GParamListObjectItem();
const char* getName() const override { return "Item"; }
agl::utl::Parameter<bool> mPlayerUseItem;
agl::utl::Parameter<s32> mSellingPrice;
agl::utl::Parameter<s32> mBuyingPrice;
agl::utl::Parameter<s32> mCreatingPrice;
agl::utl::Parameter<s32> mStainColor;
agl::utl::Parameter<s32> mSaleRevivalCount;
agl::utl::Parameter<sead::SafeString> mUseIconActorName;
};
KSYS_CHECK_SIZE_NX150(GParamListObjectItem, 0x120);
inline GParamListObjectItem::GParamListObjectItem() {
auto* const obj = &mObj;
mPlayerUseItem.init(false, "PlayerUseItem", "", obj);
mSellingPrice.init(-1, "SellingPrice", "", obj);
mBuyingPrice.init(-1, "BuyingPrice", "", obj);
mCreatingPrice.init(-1, "CreatingPrice", "", obj);
mStainColor.init(-1, "StainColor", "", obj);
mSaleRevivalCount.init(-1, "SaleRevivalCount", "", obj);
mUseIconActorName.init("", "UseIconActorName", "", obj);
}
} // namespace ksys::res

View File

@ -19,6 +19,7 @@
#include "KingSystem/Resource/GeneralParamList/resGParamListObjectGeneral.h"
#include "KingSystem/Resource/GeneralParamList/resGParamListObjectGrab.h"
#include "KingSystem/Resource/GeneralParamList/resGParamListObjectGuardianMiniWeapon.h"
#include "KingSystem/Resource/GeneralParamList/resGParamListObjectItem.h"
#include "KingSystem/Resource/GeneralParamList/resGParamListObjectLargeSword.h"
#include "KingSystem/Resource/GeneralParamList/resGParamListObjectLiftable.h"
#include "KingSystem/Resource/GeneralParamList/resGParamListObjectMasterSword.h"
@ -101,6 +102,7 @@ bool GParamList::parse_(u8* data, size_t, sead::Heap* heap) {
add<GParamListObjType::ShiekerStone>(archive.getRootList(), "ShiekerStone", heap, dummy_list);
add<GParamListObjType::SeriesArmor>(archive.getRootList(), "SeriesArmor", heap, dummy_list);
add<GParamListObjType::Liftable>(archive.getRootList(), "Liftable", heap, dummy_list);
add<GParamListObjType::Item>(archive.getRootList(), "Item", heap, dummy_list);
// TODO: the rest