refactor(component): the quickbuild is an activity component, as in the client

LWOQuickBuildComponent uses the activity component's functions; DLU's
QuickBuildComponent now derives ActivityComponent. Its RebuildComponent row
(the activity among it) loads in LoadDataFromTemplate and the level's
overrides in LoadConfigData, out of Entity::Initialize. It still writes its
own replica data (same construction and update bytes) and spawns its
activator as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Aaron Kimbrell
2026-10-01 14:19:49 -05:00
parent ab8b944f2f
commit 4bfdeec369
3 changed files with 55 additions and 47 deletions

View File

@@ -6,6 +6,7 @@
#include <string>
#include "dCommonVars.h"
#include "NiPoint3.h"
#include "ActivityComponent.h"
#include "ScriptedActivityComponent.h"
#include "Preconditions.h"
#include "Component.h"
@@ -20,12 +21,13 @@ enum class eQuickBuildFailReason : uint32_t;
* consists of an activator that shows a popup and then the actual entity that the bricks are built into. Note
* that quick builds are also scripted activities so this shared some logic with the ScriptedActivityComponent.
*/
class QuickBuildComponent final : public Component {
class QuickBuildComponent final : public ActivityComponent {
public:
static constexpr eReplicaComponentType ComponentType = eReplicaComponentType::QUICK_BUILD;
QuickBuildComponent(Entity* const entity, const int32_t componentID);
void LoadDataFromTemplate() override;
void LoadConfigData() override;
~QuickBuildComponent() override;
@@ -361,6 +363,9 @@ private:
*/
int32_t m_ActivityId = 0;
// Whether the RebuildComponent row was found (the level's settings only apply over a row)
bool m_HasRow = false;
/**
* Currently unused
*/