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

@@ -73,6 +73,7 @@
#include "MovingPlatformComponent.h"
#include "dMessageIdentifiers.h"
#include "eMissionState.h"
#include "TriggerComponent.h"
void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entity* entity, const SystemAddress& sysAddr) {
std::string chatCommand;
@@ -1984,8 +1985,12 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
ChatPackets::SendSystemMessage(sysAddr, u"Active: " + (GeneralUtils::to_u16string(phantomPhysicsComponent->GetPhysicsEffectActive())));
}
if (closest->GetTrigger() != nullptr) {
ChatPackets::SendSystemMessage(sysAddr, u"Trigger: " + (GeneralUtils::to_u16string(closest->GetTrigger()->id)));
auto* triggerComponent = closest->GetComponent<TriggerComponent>();
if (triggerComponent){
auto trigger = triggerComponent->GetTrigger();
if (trigger) {
ChatPackets::SendSystemMessage(sysAddr, u"Trigger: " + (GeneralUtils::to_u16string(trigger->id)));
}
}
}
}