diff --git a/include/Game/Systems/DamageIndicatorSystem.h b/include/Game/Systems/DamageIndicatorSystem.h index fd3ba33f..e70a69a9 100644 --- a/include/Game/Systems/DamageIndicatorSystem.h +++ b/include/Game/Systems/DamageIndicatorSystem.h @@ -13,10 +13,12 @@ #include #include +#include "Rendering/Util/CommonFunctions.h" + class DamageIndicatorSystem : public System { public: - DamageIndicatorSystem(World* world, EventBroker* eventBroker); + DamageIndicatorSystem(SystemParams params); private: EventRelay m_DamageTakenFromPlayer; @@ -26,5 +28,6 @@ private: bool OnSetCamera(const Events::SetCamera& e); EntityID m_CurrentCamera = -1; + }; #endif diff --git a/resources/Schema/Entities/DamageIndicator.xml b/resources/Schema/Entities/DamageIndicator.xml index 2d02443c..3e9e4fef 100644 --- a/resources/Schema/Entities/DamageIndicator.xml +++ b/resources/Schema/Entities/DamageIndicator.xml @@ -3,8 +3,9 @@ - Textures/TempDamageIndicator.png - Textures/TempDamageIndicator.png + Textures/DamageIndicator.png + + false diff --git a/resources/Schema/Entities/DamageIndicatorTest.xml b/resources/Schema/Entities/DamageIndicatorTest.xml index ee68da96..1155ddd5 100644 --- a/resources/Schema/Entities/DamageIndicatorTest.xml +++ b/resources/Schema/Entities/DamageIndicatorTest.xml @@ -382,14 +382,10 @@ - - Hold Pos - - 1 - + - Models/AssaultAnimated.mesh + Models/Characters/Assault/AssaultAnimations.mesh diff --git a/src/Game/Systems/CapturePointHUDSystem.cpp b/src/Game/Systems/CapturePointHUDSystem.cpp index 784c7e16..21737fbe 100644 --- a/src/Game/Systems/CapturePointHUDSystem.cpp +++ b/src/Game/Systems/CapturePointHUDSystem.cpp @@ -16,6 +16,9 @@ void CapturePointHUDSystem::Update(double dt) auto CapturePointHUDElements = m_World->GetComponents("CapturePointHUD"); auto CapturePoints = m_World->GetComponents("CapturePoint"); + if (CapturePointHUDElements == nullptr) { + return; + } for (auto& cCapturePointHUD : *CapturePointHUDElements) { int HUD_ID = cCapturePointHUD["CapturePointNumber"]; diff --git a/src/Game/Systems/DamageIndicatorSystem.cpp b/src/Game/Systems/DamageIndicatorSystem.cpp index 638307bf..93385e48 100644 --- a/src/Game/Systems/DamageIndicatorSystem.cpp +++ b/src/Game/Systems/DamageIndicatorSystem.cpp @@ -1,11 +1,15 @@ #include "Systems/DamageIndicatorSystem.h" -DamageIndicatorSystem::DamageIndicatorSystem(World* m_World, EventBroker* eventBroker) - : System(m_World, eventBroker) +DamageIndicatorSystem::DamageIndicatorSystem(SystemParams params) + : System(params) { EVENT_SUBSCRIBE_MEMBER(m_DamageTakenFromPlayer, &DamageIndicatorSystem::OnPlayerDamageTaken); //current camera EVENT_SUBSCRIBE_MEMBER(m_ESetCamera, &DamageIndicatorSystem::OnSetCamera); + + //load texture to cache + auto texture = CommonFunctions::LoadTexture("Textures/DamageIndicator.png", false); + auto entityFile = ResourceManager::Load("Schema/Entities/DamageIndicator.xml"); } bool DamageIndicatorSystem::OnPlayerDamageTaken(Events::PlayerDamage& e) @@ -58,4 +62,4 @@ bool DamageIndicatorSystem::OnPlayerDamageTaken(Events::PlayerDamage& e) bool DamageIndicatorSystem::OnSetCamera(const Events::SetCamera& e) { m_CurrentCamera = e.CameraEntity.ID; return true; -} \ No newline at end of file +}