diff options
| author | Léo Lam <leo@leolam.fr> | 2020-11-08 18:28:43 +0100 |
|---|---|---|
| committer | Léo Lam <leo@leolam.fr> | 2020-11-08 18:28:43 +0100 |
| commit | f7e6cce7a9c7c89afd1e013294ed427ace08d350 (patch) | |
| tree | 108571809b8c3295e202db7c0a8d64bbc7b462e0 /src/KingSystem/ActorSystem/actActorParam.cpp | |
| parent | f128251414b89d63228d7d0538d18efe1fac1948 (diff) | |
ksys/act: Implement final non-dev-only ActorParam function
Diffstat (limited to 'src/KingSystem/ActorSystem/actActorParam.cpp')
| -rw-r--r-- | src/KingSystem/ActorSystem/actActorParam.cpp | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/KingSystem/ActorSystem/actActorParam.cpp b/src/KingSystem/ActorSystem/actActorParam.cpp index bcc3a045..b358375a 100644 --- a/src/KingSystem/ActorSystem/actActorParam.cpp +++ b/src/KingSystem/ActorSystem/actActorParam.cpp @@ -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 |
