mirror of https://github.com/zeldaret/botw.git
ksys/act: Implement final non-dev-only ActorParam function
This commit is contained in:
parent
f128251414
commit
f7e6cce7a9
|
|
@ -89065,7 +89065,7 @@
|
|||
0x0000007101186060,sub_7101186060,24,_ZN4ksys3act10ActorParam14freeLastHandleEv
|
||||
0x0000007101186078,ActorParam::Load::setResourcePointer,28,_ZN4ksys3act10ActorParam11setResourceENS1_12ResourceTypeEPNS_7ParamIOE
|
||||
0x0000007101186094,ActorParam::Load::loadPriority,472,_ZN4ksys3act10ActorParam11setPriorityERKN4sead14SafeStringBaseIcEE
|
||||
0x000000710118626c,ActorParam::Load::checkClassAndPriority,424,
|
||||
0x000000710118626c,ActorParam::Load::checkClassAndPriority,424,_ZN4ksys3act10ActorParam21setProfileAndPriorityEPKcS3_
|
||||
0x0000007101186414,nullsub_4613,4,
|
||||
0x0000007101186418,nullsub_4614,4,_ZN4ksys3res10GParamList9doCreate_EPhjPN4sead4HeapE
|
||||
0x000000710118641c,ResourceBgparamlist::doCreate,4,_ZThn632_N4ksys3res10GParamList9doCreate_EPhjPN4sead4HeapE
|
||||
|
|
|
|||
|
Can't render this file because it is too large.
|
|
|
@ -1,6 +1,9 @@
|
|||
#include "KingSystem/ActorSystem/actActorParam.h"
|
||||
#include <basis/seadRawPrint.h>
|
||||
#include <prim/seadScopedLock.h>
|
||||
#include "KingSystem/ActorSystem/actActorParamMgr.h"
|
||||
#include "KingSystem/ActorSystem/actActorTemplate.h"
|
||||
#include "KingSystem/Utils/Byaml.h"
|
||||
|
||||
namespace ksys::act {
|
||||
|
||||
|
|
@ -125,4 +128,30 @@ bool ActorParam::setPriority(const sead::SafeString& priority) {
|
|||
return false;
|
||||
}
|
||||
|
||||
void ActorParam::setProfileAndPriority(const char* profile, const char* priority) {
|
||||
mProfile = profile;
|
||||
|
||||
al::ByamlIter* root = ActorTemplate::instance()->getRootIter();
|
||||
al::ByamlIter iter;
|
||||
if (root->tryGetIterByKey(&iter, profile)) {
|
||||
const char* profile_priority;
|
||||
iter.tryGetStringByKey(&mClassName, "class");
|
||||
iter.tryGetStringByKey(&profile_priority, "priority");
|
||||
|
||||
if (setPriority(priority))
|
||||
return;
|
||||
|
||||
if (setPriority(profile_priority))
|
||||
return;
|
||||
|
||||
ActorParamMgr::instance()->getDebugMessage().log(
|
||||
"[%s] アクタテンプレート %s の 処理順指定[%s:%s]は定義されていません",
|
||||
mActorName.cstr(), profile, priority, profile_priority);
|
||||
} else {
|
||||
ActorParamMgr::instance()->getDebugMessage().log(
|
||||
"[%s] アクタテンプレートに %s は定義されていません", mActorName.cstr(), profile);
|
||||
setProfileAndPriority("Dummy", priority);
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace ksys::act
|
||||
|
|
|
|||
|
|
@ -139,6 +139,7 @@ private:
|
|||
|
||||
void setResource(ResourceType type, ParamIO* param_io);
|
||||
bool setPriority(const sead::SafeString& priority);
|
||||
void setProfileAndPriority(const char* profile, const char* priority);
|
||||
|
||||
u16 _8 = 0;
|
||||
u8 _a = 0;
|
||||
|
|
|
|||
|
|
@ -23,6 +23,8 @@ public:
|
|||
s32 getNumProfiles() const;
|
||||
const char* getProfileName(s32 idx) const;
|
||||
|
||||
al::ByamlIter* getRootIter() const { return mIter; }
|
||||
|
||||
private:
|
||||
al::ByamlIter* mIter = nullptr;
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue