diff --git a/data/uking_functions.csv b/data/uking_functions.csv index 9091acbf..b008e695 100644 --- a/data/uking_functions.csv +++ b/data/uking_functions.csv @@ -75394,49 +75394,49 @@ 0x0000007100da56c4,evt::ActionContext::statusStuff_1,68, 0x0000007100da5708,evt::ActionContext::statusStuff_2,36, 0x0000007100da572c,sub_7100DA572C,56, -0x0000007100da5764,evt::DemoData::ctor,220, -0x0000007100da5840,evt::DemoData::init,1000, -0x0000007100da5c28,sub_7100DA5C28,28, -0x0000007100da5c44,sub_7100DA5C44,28, -0x0000007100da5c60,evt::DemoData::getTime,24, -0x0000007100da5c78,evt::DemoData::getWeather,28, -0x0000007100da5c94,evt::DemoData::getIsStopChemical,32, -0x0000007100da5cb4,evt::DemoData::x,32, -0x0000007100da5cd4,sub_7100DA5CD4,24, -0x0000007100da5cec,sub_7100DA5CEC,28, -0x0000007100da5d08,evt::DemoData::isForbidSkip,152, -0x0000007100da5da0,sub_7100DA5DA0,92, -0x0000007100da5dfc,sub_7100DA5DFC,28, -0x0000007100da5e18,evt::DemoData::x_0,32, -0x0000007100da5e38,sub_7100DA5E38,32, -0x0000007100da5e58,evt::DemoData::getWorldMuteType,28, -0x0000007100da5e74,sub_7100DA5E74,28, -0x0000007100da5e90,sub_7100DA5E90,28, -0x0000007100da5eac,evt::DemoData::getTraverseLimit,24, -0x0000007100da5ec4,sub_7100DA5EC4,568, -0x0000007100da60fc,sub_7100DA60FC,368, -0x0000007100da626c,sub_7100DA626C,484, -0x0000007100da6450,sub_7100DA6450,680, -0x0000007100da66f8,nullsub_3822,4, -0x0000007100da66fc,j__ZdlPv_873,4, -0x0000007100da6700,nullsub_3823,4, -0x0000007100da6704,j__ZdlPv_874,4, -0x0000007100da6708,nullsub_3824,4, -0x0000007100da670c,j__ZdlPv_875,4, -0x0000007100da6710,nullsub_3825,4, -0x0000007100da6714,j__ZdlPv_876,4, -0x0000007100da6718,nullsub_3826,4, -0x0000007100da671c,j__ZdlPv_877,4, -0x0000007100da6720,nullsub_3827,4, -0x0000007100da6724,j__ZdlPv_878,4, -0x0000007100da6728,nullsub_3828,4, -0x0000007100da672c,j__ZdlPv_879,4, -0x0000007100da6730,nullsub_3829,4, -0x0000007100da6734,j__ZdlPv_880,4, -0x0000007100da6738,nullsub_3830,4, -0x0000007100da673c,j__ZdlPv_881,4, -0x0000007100da6740,nullsub_3831,4, -0x0000007100da6744,j__ZdlPv_882,4, +0x0000007100da5764,evt::DemoData::ctor,220,_ZN4ksys3evt8DemoInfoC1Ev +0x0000007100da5840,evt::DemoData::init,1000,_ZN4ksys3evt8DemoInfo4initEPKNS_3res4DemoE +0x0000007100da5c28,sub_7100DA5C28,28,_ZNK4ksys3evt8DemoInfo11getLocationEv +0x0000007100da5c44,sub_7100DA5C44,28,_ZNK4ksys3evt8DemoInfo17getMapProjectNameEv +0x0000007100da5c60,evt::DemoData::getTime,24,_ZNK4ksys3evt8DemoInfo7getTimeEv +0x0000007100da5c78,evt::DemoData::getWeather,28,_ZNK4ksys3evt8DemoInfo10getWeatherEv +0x0000007100da5c94,evt::DemoData::getIsStopChemical,32,_ZNK4ksys3evt8DemoInfo14isStopChemicalEv +0x0000007100da5cb4,evt::DemoData::x,32,_ZNK4ksys3evt8DemoInfo20isWithTransAnimationEv +0x0000007100da5cd4,sub_7100DA5CD4,24,_ZNK4ksys3evt8DemoInfo20getStartLocationRotYEv +0x0000007100da5cec,sub_7100DA5CEC,28,_ZNK4ksys3evt8DemoInfo15getStartPosNameEv +0x0000007100da5d08,evt::DemoData::isForbidSkip,152,_ZNK4ksys3evt8DemoInfo12isForbidSkipEv +0x0000007100da5da0,sub_7100DA5DA0,92,_ZNK4ksys3evt8DemoInfo25isSkipPolicyMoveLastFrameEv +0x0000007100da5dfc,sub_7100DA5DFC,28,_ZNK4ksys3evt8DemoInfo11getDispNameEv +0x0000007100da5e18,evt::DemoData::x_0,32,_ZNK4ksys3evt8DemoInfo15isForceEnableIKEv +0x0000007100da5e38,sub_7100DA5E38,32,_ZNK4ksys3evt8DemoInfo15isUseNakedSoundEv +0x0000007100da5e58,evt::DemoData::getWorldMuteType,28,_ZNK4ksys3evt8DemoInfo16getWorldMuteTypeEv +0x0000007100da5e74,sub_7100DA5E74,28,_ZNK4ksys3evt8DemoInfo14getTraversePosEv +0x0000007100da5e90,sub_7100DA5E90,28,_ZNK4ksys3evt8DemoInfo21getWaitLoadActorNamesEv +0x0000007100da5eac,evt::DemoData::getTraverseLimit,24,_ZNK4ksys3evt8DemoInfo16getTraverseLimitEv +0x0000007100da5ec4,sub_7100DA5EC4,568,_ZN4ksys3evt8DemoInfo8Progress3setERKN4sead14SafeStringBaseIcEE +0x0000007100da60fc,sub_7100DA60FC,368,_ZN4ksys3evt8DemoInfo9StartType3setERKN4sead14SafeStringBaseIcEE +0x0000007100da626c,sub_7100DA626C,484,_ZN4ksys3evt8DemoInfo9EventMode3setERKN4sead14SafeStringBaseIcEE +0x0000007100da6450,sub_7100DA6450,680,_ZN4ksys3evt8DemoInfo17StartLocationType3setERKN4sead14SafeStringBaseIcEE +0x0000007100da66f8,nullsub_3822,4,_ZN4ksys3evt8DemoInfoD2Ev +0x0000007100da66fc,j__ZdlPv_873,4,_ZN4ksys3evt8DemoInfoD0Ev +0x0000007100da6700,nullsub_3823,4,_ZN4ksys3evt8DemoInfo13NoEntryActorsD2Ev +0x0000007100da6704,j__ZdlPv_874,4,_ZN4ksys3evt8DemoInfo13NoEntryActorsD0Ev +0x0000007100da6708,nullsub_3824,4,_ZN4ksys3evt8DemoInfo13ProductFormatD2Ev +0x0000007100da670c,j__ZdlPv_875,4,_ZN4ksys3evt8DemoInfo13ProductFormatD0Ev +0x0000007100da6710,nullsub_3825,4,_ZN4ksys3evt8DemoInfo8ProgressD2Ev +0x0000007100da6714,j__ZdlPv_876,4,_ZN4ksys3evt8DemoInfo8ProgressD0Ev +0x0000007100da6718,nullsub_3826,4,_ZN4ksys3evt8DemoInfo8SaveTypeD2Ev +0x0000007100da671c,j__ZdlPv_877,4,_ZN4ksys3evt8DemoInfo8SaveTypeD0Ev +0x0000007100da6720,nullsub_3827,4,_ZN4ksys3evt8DemoInfo9StartTypeD2Ev +0x0000007100da6724,j__ZdlPv_878,4,_ZN4ksys3evt8DemoInfo9StartTypeD0Ev +0x0000007100da6728,nullsub_3828,4,_ZN4ksys3evt8DemoInfo9ExtensionD2Ev +0x0000007100da672c,j__ZdlPv_879,4,_ZN4ksys3evt8DemoInfo9ExtensionD0Ev +0x0000007100da6730,nullsub_3829,4,_ZN4ksys3evt8DemoInfo9EventModeD2Ev +0x0000007100da6734,j__ZdlPv_880,4,_ZN4ksys3evt8DemoInfo9EventModeD0Ev +0x0000007100da6738,nullsub_3830,4,_ZN4ksys3evt8DemoInfo17StartLocationTypeD2Ev +0x0000007100da673c,j__ZdlPv_881,4,_ZN4ksys3evt8DemoInfo17StartLocationTypeD0Ev +0x0000007100da6740,nullsub_3831,4,_ZN4ksys3evt8DemoInfo12TraverseTypeD2Ev +0x0000007100da6744,j__ZdlPv_882,4,_ZN4ksys3evt8DemoInfo12TraverseTypeD0Ev 0x0000007100da6748,evt::ActionBase::ctor,208, 0x0000007100da6818,evt::ActionBase::dtor,68, 0x0000007100da685c,evt::ActionBase::m3,68, diff --git a/src/KingSystem/Event/CMakeLists.txt b/src/KingSystem/Event/CMakeLists.txt index c5680ef8..cf94386c 100644 --- a/src/KingSystem/Event/CMakeLists.txt +++ b/src/KingSystem/Event/CMakeLists.txt @@ -1,4 +1,6 @@ target_sources(uking PRIVATE + evtDemoInfo.cpp + evtDemoInfo.h evtEvent.cpp evtEvent.h evtInfoData.cpp diff --git a/src/KingSystem/Event/evtDemoInfo.cpp b/src/KingSystem/Event/evtDemoInfo.cpp new file mode 100644 index 00000000..b1cc03c4 --- /dev/null +++ b/src/KingSystem/Event/evtDemoInfo.cpp @@ -0,0 +1,205 @@ +#include "KingSystem/Event/evtDemoInfo.h" +#include "KingSystem/Resource/Event/resResourceDemo.h" + +namespace ksys::evt { + +DemoInfo::DemoInfo() { + init(nullptr); +} + +bool DemoInfo::init(const res::Demo* resource) { + mRes = resource; + + if (mRes) { + mNoEntryActors.set(mRes->mNoEntryActors.ref()); + mProductFormat.set(mRes->mProductFormat.ref()); + mProgress.set(mRes->mProgress.ref()); + mSaveType.set(mRes->mSaveType.ref()); + mStartType.set(mRes->mStartType.ref()); + mExtension.set(mRes->mExtension.ref()); + mEventMode.set(mRes->mEventMode.ref()); + mStartLocationType.set(mRes->mStartLocationType.ref()); + mTraverseType.set(mRes->mTraverseType.ref()); + } else { + mNoEntryActors.value = NoEntryActors::kDefault; + mProductFormat.value = ProductFormat::kOther; + mProgress.value = Progress::kOther; + mSaveType.value = SaveType::kNoAutoSave; + mStartType.value = StartType::kOther; + mExtension.value = Extension::kOther; + mEventMode.value = EventMode::kOther; + mStartLocationType.value = StartLocationType::kOther; + mTraverseType.value = TraverseType::kOther; + } + + return mRes != nullptr; +} + +const sead::Vector3f& DemoInfo::getLocation() const { + return isValid() ? mRes->mLocation.ref() : sead::Vector3f::zero; +} + +const sead::SafeString& DemoInfo::getMapProjectName() const { + return isValid() ? mRes->mMapProjectName.ref() : sead::SafeString::cEmptyString; +} + +float DemoInfo::getTime() const { + return isValid() ? mRes->mTime.ref() : -1.0; +} + +const sead::SafeString& DemoInfo::getWeather() const { + return isValid() ? mRes->mWeather.ref() : sead::SafeString::cEmptyString; +} + +bool DemoInfo::isStopChemical() const { + return !mRes || mRes->mIsStopChemical.ref(); +} + +bool DemoInfo::isWithTransAnimation() const { + return mRes && mRes->mWithTransAnimation.ref(); +} + +float DemoInfo::getStartLocationRotY() const { + return isValid() ? mRes->mStartLocationRotY.ref() : 0.0; +} + +const sead::SafeString& DemoInfo::getStartPosName() const { + return isValid() ? mRes->mStartPosName.ref() : sead::SafeString::cEmptyString; +} + +bool DemoInfo::isForbidSkip() const { + return mRes && mRes->mSkipPolicy.ref() == "Forbid"; +} + +bool DemoInfo::isSkipPolicyMoveLastFrame() const { + if (isValid()) { + if (mRes->mSkipPolicy->include("MoveLastFrame")) + return true; + } + return false; +} + +const sead::SafeString& DemoInfo::getDispName() const { + return isValid() ? mRes->mDispName.ref() : sead::SafeString::cEmptyString; +} + +bool DemoInfo::isForceEnableIK() const { + return mRes && mRes->mForceEnableIK.ref(); +} + +bool DemoInfo::isUseNakedSound() const { + return mRes && mRes->mIsUseNakedSound.ref(); +} + +const sead::SafeString& DemoInfo::getWorldMuteType() const { + return isValid() ? mRes->mWorldMuteType.ref() : sead::SafeString::cEmptyString; +} + +const sead::Vector3f& DemoInfo::getTraversePos() const { + return isValid() ? mRes->mTraversePos.ref() : sead::Vector3f::zero; +} + +const sead::SafeString& DemoInfo::getWaitLoadActorNames() const { + return isValid() ? mRes->mWaitLoadActorNames.ref() : sead::SafeString::cEmptyString; +} + +float DemoInfo::getTraverseLimit() const { + return isValid() ? mRes->mTraverseLimit.ref() : 0.0; +} + +void DemoInfo::NoEntryActors::set(const sead::SafeString& val) { + if (val == "AllPause") + value = kAllPause; + else + value = kDefault; +} + +void DemoInfo::ProductFormat::set(const sead::SafeString& val) { + if (val == "RealTime") + value = kRealTime; + else if (val.startsWith("MovieFile")) + value = kMovieFile; + else + value = kOther; +} + +void DemoInfo::Progress::set(const sead::SafeString& val) { + if (val == "Initialize") + value = kInitialize; + else if (val == "Temp") + value = kTemp; + else if (val == "Conte") + value = kConte; + else if (val == "Animatics") + value = kAnimatics; + else if (val == "Product") + value = kProduct; + else + value = kOther; +} + +void DemoInfo::SaveType::set(const sead::SafeString& val) { + if (val == "AutoSave") + value = kAutoSave; + else + value = kNoAutoSave; +} + +void DemoInfo::StartType::set(const sead::SafeString& val) { + if (val == "Seamless") + value = kSeamless; + else if (val == "Load") + value = kLoad; + else if (val == "Load(NotWaitPlacement)") + value = kLoadNotWaitPlacement; + else + value = kOther; +} + +void DemoInfo::Extension::set(const sead::SafeString& val) { + if (val == "evfl") + value = kEvfl; + else if (val == "evtm") + value = kEvtm; + else + value = kOther; +} + +void DemoInfo::EventMode::set(const sead::SafeString& val) { + if (val == "Seamless") + value = kSeamless; + else if (val == "Load") + value = kLoad; + else if (val == "FullPackage") + value = kFullPackage; + else if (val == "Continue") + value = kContinue; + else + value = kOther; +} + +void DemoInfo::StartLocationType::set(const sead::SafeString& val) { + if (val == "Starter") + value = kStarter; + else if (val == "StarterPositionOnly") + value = kStarterPositionOnly; + else if (val == "Player") + value = kPlayer; + else if (val == "SetWorldPos") + value = kSetWorldPos; + else if (val == "SearchSafetyPos") + value = kSearchSafetyPos; + else if (val == "MapUnitStartPos") + value = kMapUnitStartPos; + else + value = kOther; +} + +void DemoInfo::TraverseType::set(const sead::SafeString& val) { + if (val == "SetPos") + value = kSetPos; + else + value = kDefault; +} + +} // namespace ksys::evt diff --git a/src/KingSystem/Event/evtDemoInfo.h b/src/KingSystem/Event/evtDemoInfo.h new file mode 100644 index 00000000..a3e5c102 --- /dev/null +++ b/src/KingSystem/Event/evtDemoInfo.h @@ -0,0 +1,160 @@ +#pragma once + +#include +#include +#include + +namespace ksys::res { +class Demo; +} + +namespace ksys::evt { + +class DemoInfo { +public: + struct NoEntryActors { + enum Value : u8 { + kDefault = 0, + kAllPause = 1, + }; + virtual ~NoEntryActors() = default; + void set(const sead::SafeString& val); + Value value = kDefault; + }; + + struct ProductFormat { + enum Value { + kRealTime = 0, + kMovieFile = 1, + kOther = 2, + }; + virtual ~ProductFormat() = default; + void set(const sead::SafeString& val); + Value value = kOther; + }; + + struct Progress { + enum Value { + kInitialize = 0, + kTemp = 1, + kConte = 2, + kAnimatics = 3, + kProduct = 4, + kOther = 5, + }; + virtual ~Progress() = default; + void set(const sead::SafeString& val); + Value value = kOther; + }; + + struct SaveType { + enum Value : u8 { + kNoAutoSave = 0, + kAutoSave = 1, + }; + virtual ~SaveType() = default; + void set(const sead::SafeString& val); + Value value = kNoAutoSave; + }; + + struct StartType { + enum Value { + kSeamless = 0, + kLoad = 1, + kLoadNotWaitPlacement = 2, + kOther = 3, + }; + virtual ~StartType() = default; + void set(const sead::SafeString& val); + Value value = kOther; + }; + + struct Extension { + enum Value { + kEvfl = 0, + kEvtm = 1, + kOther = 2, + }; + virtual ~Extension() = default; + void set(const sead::SafeString& val); + Value value = kOther; + }; + + struct EventMode { + enum Value { + kSeamless = 0, + kLoad = 1, + kFullPackage = 2, + kContinue = 3, + kOther = 4, + }; + virtual ~EventMode() = default; + void set(const sead::SafeString& val); + Value value = kOther; + }; + + struct StartLocationType { + enum Value { + kStarter = 0, + kStarterPositionOnly = 1, + kPlayer = 2, + kSetWorldPos = 3, + kMapUnitStartPos = 4, + kSearchSafetyPos = 5, + kOther = 6, + }; + virtual ~StartLocationType() = default; + void set(const sead::SafeString& val); + Value value = kOther; + }; + + struct TraverseType { + enum Value { + kDefault = 0, + kSetPos = 1, + kOther = 2, + }; + virtual ~TraverseType() = default; + void set(const sead::SafeString& val); + Value value = kOther; + }; + + DemoInfo(); + virtual ~DemoInfo() = default; + + bool init(const res::Demo* resource); + + bool isValid() const { return mRes != nullptr; } + + const sead::Vector3f& getLocation() const; + const sead::SafeString& getMapProjectName() const; + float getTime() const; + const sead::SafeString& getWeather() const; + bool isStopChemical() const; + bool isWithTransAnimation() const; + float getStartLocationRotY() const; + const sead::SafeString& getStartPosName() const; + bool isForbidSkip() const; + bool isSkipPolicyMoveLastFrame() const; + const sead::SafeString& getDispName() const; + bool isForceEnableIK() const; + bool isUseNakedSound() const; + const sead::SafeString& getWorldMuteType() const; + const sead::Vector3f& getTraversePos() const; + const sead::SafeString& getWaitLoadActorNames() const; + float getTraverseLimit() const; + +private: + const res::Demo* mRes = nullptr; + NoEntryActors mNoEntryActors; + ProductFormat mProductFormat; + Progress mProgress; + SaveType mSaveType; + StartType mStartType; + Extension mExtension; + EventMode mEventMode; + StartLocationType mStartLocationType; + TraverseType mTraverseType; +}; + +} // namespace ksys::evt