Healthbar on player
This commit is contained in:
@@ -2,15 +2,14 @@
|
|||||||
<Entity name="Player" xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
|
<Entity name="Player" xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
|
||||||
|
|
||||||
<Components>
|
<Components>
|
||||||
|
<c:Health/>
|
||||||
<c:AABB>
|
<c:AABB>
|
||||||
<Origin X="0" Y="0.772000015" Z="0"/>
|
<Origin X="0" Y="0.772000015" Z="0"/>
|
||||||
<Size X="1" Y="1.60000002" Z="1"/>
|
<Size X="1" Y="1.60000002" Z="1"/>
|
||||||
</c:AABB>
|
</c:AABB>
|
||||||
<c:Collidable/>
|
<c:Collidable/>
|
||||||
<c:Model/>
|
<c:Model/>
|
||||||
<c:Physics>
|
<c:Physics/>
|
||||||
<Velocity X="8.33307467e-09" Y="0" Z="9.82836834e-09"/>
|
|
||||||
</c:Physics>
|
|
||||||
<c:Player>
|
<c:Player>
|
||||||
<MovementSpeed>5</MovementSpeed>
|
<MovementSpeed>5</MovementSpeed>
|
||||||
</c:Player>
|
</c:Player>
|
||||||
@@ -19,10 +18,7 @@
|
|||||||
<Red/>
|
<Red/>
|
||||||
</Team>
|
</Team>
|
||||||
</c:Team>
|
</c:Team>
|
||||||
<c:Transform>
|
<c:Transform/>
|
||||||
<Position X="2.84928203" Y="0.0264999866" Z="7.31610918"/>
|
|
||||||
<Orientation X="0" Y="2.14675093" Z="0"/>
|
|
||||||
</c:Transform>
|
|
||||||
</Components>
|
</Components>
|
||||||
|
|
||||||
<Children>
|
<Children>
|
||||||
@@ -31,7 +27,6 @@
|
|||||||
<c:Camera/>
|
<c:Camera/>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Position X="0" Y="1.37700009" Z="0"/>
|
<Position X="0" Y="1.37700009" Z="0"/>
|
||||||
<Orientation X="0.921535373" Y="0" Z="0"/>
|
|
||||||
</c:Transform>
|
</c:Transform>
|
||||||
</Components>
|
</Components>
|
||||||
<Children>
|
<Children>
|
||||||
@@ -62,6 +57,34 @@
|
|||||||
</Components>
|
</Components>
|
||||||
<Children/>
|
<Children/>
|
||||||
</Entity>
|
</Entity>
|
||||||
|
<Entity name="HUD">
|
||||||
|
<Components>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0" Y="0" Z="-0.5"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children>
|
||||||
|
<Entity name="HealthBar">
|
||||||
|
<Components>
|
||||||
|
<c:HealthHUD/>
|
||||||
|
<c:Fill>
|
||||||
|
<Percentage>1</Percentage>
|
||||||
|
<Color A="0" B="1" G="0" R="0"/>
|
||||||
|
</c:Fill>
|
||||||
|
<c:Model>
|
||||||
|
<Resource>Models/Core/UnitHexagon.mesh</Resource>
|
||||||
|
<Color A="1" B="0.70588237" G="0.70588237" R="0.70588237"/>
|
||||||
|
</c:Model>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="-0.383000016" Y="-0.185000002" Z="0"/>
|
||||||
|
<Scale X="0.150000006" Y="0.150000006" Z="0.150000006"/>
|
||||||
|
<Orientation X="0" Y="0.594000041" Z="0"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
</Children>
|
</Children>
|
||||||
</Entity>
|
</Entity>
|
||||||
<Entity name="ThirdPersonCamera">
|
<Entity name="ThirdPersonCamera">
|
||||||
@@ -82,6 +105,7 @@
|
|||||||
<Components>
|
<Components>
|
||||||
<c:Model>
|
<c:Model>
|
||||||
<Resource>Models/AssaultHeadless.mesh</Resource>
|
<Resource>Models/AssaultHeadless.mesh</Resource>
|
||||||
|
<Color A="1" B="0" G="0" R="1"/>
|
||||||
</c:Model>
|
</c:Model>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Orientation X="0" Y="3.14159274" Z="0"/>
|
<Orientation X="0" Y="3.14159274" Z="0"/>
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
#include "Editor/EditorGUI.h"
|
#include "Editor/EditorGUI.h"
|
||||||
|
#include "Rendering/ESetCamera.h"
|
||||||
|
|
||||||
EditorGUI::EditorGUI(World* world, EventBroker* eventBroker)
|
EditorGUI::EditorGUI(World* world, EventBroker* eventBroker)
|
||||||
: m_World(world)
|
: m_World(world)
|
||||||
@@ -305,6 +306,14 @@ bool EditorGUI::drawComponentNode(EntityWrapper entity, const ComponentInfo& ci)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ci.Name == "Camera") {
|
||||||
|
if (ImGui::Button("Activate")) {
|
||||||
|
Events::SetCamera e;
|
||||||
|
e.CameraEntity = entity;
|
||||||
|
m_EventBroker->Publish(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -203,7 +203,7 @@ bool EditorSystem::OnSetCamera(const Events::SetCamera& e)
|
|||||||
m_ActualCamera = e.CameraEntity;
|
m_ActualCamera = e.CameraEntity;
|
||||||
Events::SetCamera e2;
|
Events::SetCamera e2;
|
||||||
e2.CameraEntity = m_EditorCamera;
|
e2.CameraEntity = m_EditorCamera;
|
||||||
m_EventBroker->Publish(e2);
|
//m_EventBroker->Publish(e2);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,7 +52,9 @@ void RenderSystem::fillModels(std::list<std::shared_ptr<RenderJob>>& jobs)
|
|||||||
|
|
||||||
// Don't render the local player
|
// Don't render the local player
|
||||||
if (entity == m_LocalPlayer || entity.IsChildOf(m_LocalPlayer)) {
|
if (entity == m_LocalPlayer || entity.IsChildOf(m_LocalPlayer)) {
|
||||||
continue;
|
if (!entity.HasComponent("HealthHUD")) { //Should work but needs to be fixed. Should only render the things "childed" to the local player camera
|
||||||
|
continue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Model* model;
|
Model* model;
|
||||||
|
|||||||
Reference in New Issue
Block a user