ksys/res: Add AttClient header

This commit is contained in:
Léo Lam 2020-11-14 13:12:00 +01:00
parent dcdb1fa70e
commit aa636bd44a
No known key found for this signature in database
GPG Key ID: 0DF30F9081000741
7 changed files with 136 additions and 1 deletions

View File

@ -91108,7 +91108,7 @@
0x00000071011810a4,EntryFactoryBatcllist::newResource_,456, 0x00000071011810a4,EntryFactoryBatcllist::newResource_,456,
0x000000710118126c,sub_710118126C,8, 0x000000710118126c,sub_710118126C,8,
0x0000007101181274,sub_7101181274,8, 0x0000007101181274,sub_7101181274,8,
0x000000710118127c,sub_710118127C,500, 0x000000710118127c,sub_710118127C,500,_ZN4ksys3res9AttClientC1Ev
0x0000007101181470,sub_7101181470,68, 0x0000007101181470,sub_7101181470,68,
0x00000071011814b4,sub_71011814B4,76, 0x00000071011814b4,sub_71011814B4,76,
0x0000007101181500,sub_7101181500,132, 0x0000007101181500,sub_7101181500,132,

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

View File

@ -22,6 +22,8 @@ target_sources(uking PRIVATE
actAiClass.h actAiClass.h
actAiParam.cpp actAiParam.cpp
actAiParam.h actAiParam.h
actAttention.cpp
actAttention.h
actBaseProc.cpp actBaseProc.cpp
actBaseProc.h actBaseProc.h
actBaseProcHandle.cpp actBaseProcHandle.cpp

View File

@ -0,0 +1,9 @@
#include "KingSystem/ActorSystem/actAttention.h"
namespace ksys::act {
SEAD_ENUM_IMPL(AttActionType)
SEAD_ENUM_IMPL(AttPriorityType)
} // namespace ksys::act

View File

@ -0,0 +1,70 @@
#pragma once
#include <prim/seadEnum.h>
namespace ksys::act {
enum class AttType {
Action = 0,
Lock = 1,
SwordSearch = 2,
Attack = 3,
Appeal = 4,
JumpRide = 5,
NameBalloon = 6,
LookOnly = 7,
Invalid = 8,
};
// Make sure to update AttActionType if this is changed
enum class AttActionCode {
None = 0x1800000,
Talk,
Listen,
Awake,
Grab,
Open,
Pick,
Catch,
CheckCatch,
CatchWeapon,
Skin,
Sleep,
Sit,
Lumber,
Pushpull,
Read,
Check,
Boot,
BootPStop,
Leave,
Remind,
Buy,
Ride,
Wakeboard,
WakeboardRide,
RideRito,
RideZora,
Cook,
KillTime,
Display,
DisplayBow,
DisplayShield,
PickUp,
Pray,
PullOut,
Waterfall,
CommandWait,
CommandCome,
Thrust,
Put,
PickToEvent,
Dummy,
};
// clang-format off
SEAD_ENUM(AttActionType, None,Talk,Listen,Awake,Grab,Open,Pick,Catch,CheckCatch,CatchWeapon,Skin,Sleep,Sit,Lumber,Pushpull,Read,Check,Boot,BootPStop,Leave,Remind,Buy,Ride,Wakeboard,WakeboardRide,RideRito,RideZora,Cook,KillTime,Display,DisplayBow,DisplayShield,PickUp,Pray,PullOut,Waterfall,CommandWait,CommandCome,Thrust,Put,PickToEvent,Dummy)
SEAD_ENUM(AttPriorityType, Default,Enemy,Npc,Obj,ObjLow,ObjMiddle,ObjHigh,Bullet)
// clang-format on
} // namespace ksys::act

View File

@ -134,6 +134,8 @@ target_sources(uking PRIVATE
resResourceAS.h resResourceAS.h
resResourceASList.cpp resResourceASList.cpp
resResourceASList.h resResourceASList.h
resResourceAttClient.cpp
resResourceAttClient.h
resResourceAttClientList.cpp resResourceAttClientList.cpp
resResourceAttClientList.h resResourceAttClientList.h
resResourceArchive.cpp resResourceArchive.cpp

View File

@ -0,0 +1,7 @@
#include "KingSystem/Resource/resResourceAttClient.h"
namespace ksys::res {
AttClient::AttClient() : ParamIO("atcl", 0) {}
} // namespace ksys::res

View File

@ -0,0 +1,45 @@
#pragma once
#include <agl/Utils/aglParameter.h>
#include <agl/Utils/aglParameterObj.h>
#include <container/seadBuffer.h>
#include <prim/seadSafeString.h>
#include "KingSystem/ActorSystem/actAttention.h"
#include "KingSystem/Resource/resResource.h"
#include "KingSystem/Utils/ParamIO.h"
#include "KingSystem/Utils/Types.h"
namespace ksys::res {
class AttClient : public ParamIO, public Resource {
SEAD_RTTI_OVERRIDE(AttClient, Resource)
public:
struct Check {};
AttClient();
~AttClient() override;
act::AttType getAttType() const { return mAttType; }
act::AttActionCode getActionCode() const { return mActionCode; }
act::AttPriorityType getPriorityType() const { return mPriorityType; }
const sead::SafeString& getPriorityTypeStr() const { return mPriorityTypeStr; }
const sead::Buffer<Check*>& getChecks() const { return mChecks; }
void doCreate_(u8*, u32, sead::Heap*) override {}
bool needsParse() const override { return true; }
bool parse_(u8* data, size_t size, sead::Heap* heap) override;
private:
act::AttType mAttType = act::AttType::Action;
act::AttActionCode mActionCode = act::AttActionCode::None;
act::AttPriorityType mPriorityType = act::AttPriorityType::Default;
sead::FixedSafeString<32> mPriorityTypeStr;
agl::utl::ParameterObj mAttClientParamsObj;
agl::utl::Parameter<sead::FixedSafeString<32>> mAttTypeParam;
agl::utl::Parameter<sead::FixedSafeString<32>> mActionTypeParam;
agl::utl::Parameter<sead::FixedSafeString<32>> mPriorityTypeParam;
sead::Buffer<Check*> mChecks;
};
KSYS_CHECK_SIZE_NX150(AttClient, 0x428);
} // namespace ksys::res