Split out LUTriggers into it's own component (#986)

* Split out LUTriggers into it's own component

* some cleanup

* fix debug log

* use emplace and tryParse

* slight refactor to make the work on startup
rather than at runtime
Also TODO's for getting targets via all the possible methods

* address feedback
This commit is contained in:
Aaron Kimbrell
2023-02-10 02:29:53 -06:00
committed by GitHub
parent d17f51183e
commit 91c0c1fcfb
13 changed files with 437 additions and 137 deletions

View File

@@ -18,9 +18,6 @@ namespace Loot {
namespace tinyxml2 {
class XMLDocument;
};
namespace LUTriggers {
struct Trigger;
};
class Player;
class EntityInfo;
@@ -33,6 +30,7 @@ class Component;
class Item;
class Character;
class EntityCallbackTimer;
enum class eTriggerEventType;
namespace CppScripts {
class Script;
@@ -67,8 +65,6 @@ public:
Entity* GetParentEntity() const { return m_ParentEntity; }
LUTriggers::Trigger* GetTrigger() const { return m_Trigger; }
std::vector<std::string>& GetGroups() { return m_Groups; };
Spawner* GetSpawner() const { return m_Spawner; }
@@ -221,9 +217,8 @@ public:
void RegisterCoinDrop(uint64_t count);
void ScheduleKillAfterUpdate(Entity* murderer = nullptr);
void TriggerEvent(std::string eveneventtID, Entity* optionalTarget = nullptr);
void TriggerEvent(eTriggerEventType event, Entity* optionalTarget = nullptr);
void ScheduleDestructionAfterUpdate() { m_ShouldDestroyAfterUpdate = true; }
void HandleTriggerCommand(std::string id, std::string target, std::string targetName, std::string args, Entity* optionalTarget);
virtual NiPoint3 GetRespawnPosition() const { return NiPoint3::ZERO; }
virtual NiQuaternion GetRespawnRotation() const { return NiQuaternion::IDENTITY; }
@@ -308,8 +303,6 @@ protected:
bool m_HasSpawnerNodeID;
uint32_t m_SpawnerNodeID;
LUTriggers::Trigger* m_Trigger;
Character* m_Character;
Entity* m_ParentEntity; //For spawners and the like