Compare commits
16 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f24a5a36b4 | |||
| 534d6639e5 | |||
| b782e73556 | |||
| 6c673db2f4 | |||
| 7bc3c9f7b1 | |||
| 7ee4ea637b | |||
| d7f09b1a8f | |||
| fcf87104c3 | |||
| 1516ed8e2d | |||
| 962521fa59 | |||
| 282e0bf7c4 | |||
| 0dfe00b406 | |||
| 7a2f1ac9fd | |||
| 03843774d7 | |||
| 2ecc53ecca | |||
| 06614aa907 |
@@ -23,7 +23,6 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
void renderText(std::string text, Font* font, TextJob::AlignmentEnum alignment, glm::vec4 color, glm::mat4 modelMatrix, glm::mat4 projectionMatrix, glm::mat4 viewMatrix);
|
void renderText(std::string text, Font* font, TextJob::AlignmentEnum alignment, glm::vec4 color, glm::mat4 modelMatrix, glm::mat4 projectionMatrix, glm::mat4 viewMatrix);
|
||||||
std::string parseColors(std::string text, std::map<int, glm::vec4>& colorChanges, glm::vec4 originalColor);
|
|
||||||
|
|
||||||
Font* font;
|
Font* font;
|
||||||
GLuint VAO, VBO;
|
GLuint VAO, VBO;
|
||||||
|
|||||||
@@ -40,17 +40,5 @@ private:
|
|||||||
};
|
};
|
||||||
std::vector<EntityAtMaxValuePickupStruct> m_PickupAtMaximum;
|
std::vector<EntityAtMaxValuePickupStruct> m_PickupAtMaximum;
|
||||||
void DoPickup(EntityWrapper &player, EntityWrapper &trigger);
|
void DoPickup(EntityWrapper &player, EntityWrapper &trigger);
|
||||||
//class
|
|
||||||
enum class PlayerClass {
|
|
||||||
Assault,
|
|
||||||
Defender,
|
|
||||||
Sniper,
|
|
||||||
None
|
|
||||||
};
|
|
||||||
//helper methods
|
|
||||||
bool DoesPlayerHaveMaxAmmo(EntityWrapper &player);
|
|
||||||
PlayerClass DetermineClass(EntityWrapper &player);
|
|
||||||
void SetPlayerAmmo(EntityWrapper &player, int ammoGain);
|
|
||||||
int GetPlayerMaxAmmo(EntityWrapper &player);
|
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -24,7 +24,10 @@ private:
|
|||||||
bool OnPlayerDeath(Events::PlayerDeath& e);
|
bool OnPlayerDeath(Events::PlayerDeath& e);
|
||||||
EventRelay<PlayerDeathSystem, Events::EntityDeleted> m_EEntityDeleted;
|
EventRelay<PlayerDeathSystem, Events::EntityDeleted> m_EEntityDeleted;
|
||||||
bool OnEntityDeleted(Events::EntityDeleted& e);
|
bool OnEntityDeleted(Events::EntityDeleted& e);
|
||||||
|
EventRelay<PlayerDeathSystem, Events::InputCommand> m_EInputCommand;
|
||||||
|
bool OnInputCommand(Events::InputCommand& e);
|
||||||
|
|
||||||
|
void setSpectatorCamera();
|
||||||
void createDeathEffect(EntityWrapper player);
|
void createDeathEffect(EntityWrapper player);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -15,10 +15,19 @@ public:
|
|||||||
virtual void Update(double dt) override;
|
virtual void Update(double dt) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
// This enum must correspond to the command values for PickTeam buttons.
|
||||||
|
enum class PlayerClass
|
||||||
|
{
|
||||||
|
None = 0,
|
||||||
|
Assault,
|
||||||
|
Defender,
|
||||||
|
Sniper
|
||||||
|
};
|
||||||
struct SpawnRequest
|
struct SpawnRequest
|
||||||
{
|
{
|
||||||
int PlayerID;
|
int PlayerID;
|
||||||
ComponentInfo::EnumType Team;
|
ComponentInfo::EnumType Team;
|
||||||
|
PlayerClass Class;
|
||||||
};
|
};
|
||||||
|
|
||||||
bool m_NetworkEnabled = false;
|
bool m_NetworkEnabled = false;
|
||||||
|
|||||||
@@ -0,0 +1,22 @@
|
|||||||
|
#ifndef SpectatorCameraSystem_h__
|
||||||
|
#define SpectatorCameraSystem_h__
|
||||||
|
|
||||||
|
#include "Core/System.h"
|
||||||
|
#include "Input/EInputCommand.h"
|
||||||
|
|
||||||
|
class SpectatorCameraSystem : public ImpureSystem
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
SpectatorCameraSystem(SystemParams params);
|
||||||
|
|
||||||
|
virtual void Update(double dt) override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
int m_PickedTeam;
|
||||||
|
bool m_CamSetToTeamPick;
|
||||||
|
|
||||||
|
EventRelay<SpectatorCameraSystem, Events::InputCommand> m_EInputCommand;
|
||||||
|
bool OnInputCommand(const Events::InputCommand& e);
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -28,4 +28,5 @@ P=SwitchToPlayer
|
|||||||
K=TakeDamage,1500
|
K=TakeDamage,1500
|
||||||
F2=PerformanceTimingResetAllTimers
|
F2=PerformanceTimingResetAllTimers
|
||||||
F3=PerformanceTimingCreateExcelData
|
F3=PerformanceTimingCreateExcelData
|
||||||
F4=SwapToClassPick
|
Comma=SwapToClassPick
|
||||||
|
Period=SwapToTeamPick
|
||||||
@@ -13,38 +13,8 @@
|
|||||||
<Components>
|
<Components>
|
||||||
<c:Sprite>
|
<c:Sprite>
|
||||||
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
|
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
|
||||||
<Color A="0.300000012" B="1" G="1" R="1"/>
|
<GlowMap></GlowMap>
|
||||||
</c:Sprite>
|
<DepthSort>false</DepthSort>
|
||||||
<c:Transform>
|
|
||||||
<Position X="0" Y="0.919596612" Z="0"/>
|
|
||||||
</c:Transform>
|
|
||||||
</Components>
|
|
||||||
<Children>
|
|
||||||
<Entity name="ProgressionHexagon">
|
|
||||||
<Components>
|
|
||||||
<c:CapturePointHUD>
|
|
||||||
<CapturePointNumber>2</CapturePointNumber>
|
|
||||||
</c:CapturePointHUD>
|
|
||||||
<c:Fill>
|
|
||||||
<Color A="0.699999988" B="1" G="0.200000003" R="0"/>
|
|
||||||
</c:Fill>
|
|
||||||
<c:Sprite>
|
|
||||||
<DiffuseTexture>Textures/Core/UnitHexagon_Rotated.png</DiffuseTexture>
|
|
||||||
</c:Sprite>
|
|
||||||
<c:Transform>
|
|
||||||
<Position X="0" Y="0" Z="0.00999999978"/>
|
|
||||||
<Scale X="0.800000012" Y="0.800000012" Z="0.800000012"/>
|
|
||||||
<Orientation X="0" Y="0" Z="1.57079637"/>
|
|
||||||
</c:Transform>
|
|
||||||
</Components>
|
|
||||||
<Children/>
|
|
||||||
</Entity>
|
|
||||||
</Children>
|
|
||||||
</Entity>
|
|
||||||
<Entity name="BackgroundHexagon">
|
|
||||||
<Components>
|
|
||||||
<c:Sprite>
|
|
||||||
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
|
|
||||||
<Color A="0.300000012" B="1" G="1" R="1"/>
|
<Color A="0.300000012" B="1" G="1" R="1"/>
|
||||||
</c:Sprite>
|
</c:Sprite>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
@@ -54,20 +24,21 @@
|
|||||||
<Children>
|
<Children>
|
||||||
<Entity name="ProgressionHexagon">
|
<Entity name="ProgressionHexagon">
|
||||||
<Components>
|
<Components>
|
||||||
|
<c:Fill>
|
||||||
|
<Color A="0.699999988" B="1" G="0.200000003" R="0"/>
|
||||||
|
</c:Fill>
|
||||||
<c:CapturePointHUD>
|
<c:CapturePointHUD>
|
||||||
<CapturePointNumber>3</CapturePointNumber>
|
<CapturePointNumber>3</CapturePointNumber>
|
||||||
</c:CapturePointHUD>
|
</c:CapturePointHUD>
|
||||||
<c:Fill>
|
|
||||||
<Percentage>0.80222018197612788</Percentage>
|
|
||||||
<Color A="0.699999988" B="1" G="0.200000003" R="0"/>
|
|
||||||
</c:Fill>
|
|
||||||
<c:Sprite>
|
<c:Sprite>
|
||||||
<DiffuseTexture>Textures/Core/UnitHexagon_Rotated.png</DiffuseTexture>
|
<DiffuseTexture>Textures/Core/UnitHexagon_Rotated.png</DiffuseTexture>
|
||||||
|
<GlowMap></GlowMap>
|
||||||
|
<DepthSort>false</DepthSort>
|
||||||
</c:Sprite>
|
</c:Sprite>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Position X="0" Y="0" Z="0.00999999978"/>
|
<Position X="0" Y="0" Z="0.00999999978"/>
|
||||||
<Scale X="0.800000012" Y="0.800000012" Z="0.800000012"/>
|
|
||||||
<Orientation X="0" Y="0" Z="1.57079637"/>
|
<Orientation X="0" Y="0" Z="1.57079637"/>
|
||||||
|
<Scale X="0.800000012" Y="0.800000012" Z="0.800000012"/>
|
||||||
</c:Transform>
|
</c:Transform>
|
||||||
</Components>
|
</Components>
|
||||||
<Children/>
|
<Children/>
|
||||||
@@ -78,6 +49,8 @@
|
|||||||
<Components>
|
<Components>
|
||||||
<c:Sprite>
|
<c:Sprite>
|
||||||
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
|
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
|
||||||
|
<GlowMap></GlowMap>
|
||||||
|
<DepthSort>false</DepthSort>
|
||||||
<Color A="0.699999988" B="1" G="0.200000003" R="0"/>
|
<Color A="0.699999988" B="1" G="0.200000003" R="0"/>
|
||||||
</c:Sprite>
|
</c:Sprite>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
@@ -87,19 +60,21 @@
|
|||||||
<Children>
|
<Children>
|
||||||
<Entity name="ProgressionHexagon">
|
<Entity name="ProgressionHexagon">
|
||||||
<Components>
|
<Components>
|
||||||
<c:CapturePointHUD>
|
|
||||||
<CapturePointNumber>4</CapturePointNumber>
|
|
||||||
</c:CapturePointHUD>
|
|
||||||
<c:Fill>
|
<c:Fill>
|
||||||
<Color A="0.699999988" B="1" G="0.200000003" R="0"/>
|
<Color A="0.699999988" B="1" G="0.200000003" R="0"/>
|
||||||
</c:Fill>
|
</c:Fill>
|
||||||
|
<c:CapturePointHUD>
|
||||||
|
<CapturePointNumber>4</CapturePointNumber>
|
||||||
|
</c:CapturePointHUD>
|
||||||
<c:Sprite>
|
<c:Sprite>
|
||||||
<DiffuseTexture>Textures/Core/UnitHexagon_Rotated.png</DiffuseTexture>
|
<DiffuseTexture>Textures/Core/UnitHexagon_Rotated.png</DiffuseTexture>
|
||||||
|
<GlowMap></GlowMap>
|
||||||
|
<DepthSort>false</DepthSort>
|
||||||
</c:Sprite>
|
</c:Sprite>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Position X="0" Y="0" Z="0.00999999978"/>
|
<Position X="0" Y="0" Z="0.00999999978"/>
|
||||||
<Scale X="0.800000012" Y="0.800000012" Z="0.800000012"/>
|
|
||||||
<Orientation X="0" Y="0" Z="1.57079637"/>
|
<Orientation X="0" Y="0" Z="1.57079637"/>
|
||||||
|
<Scale X="0.800000012" Y="0.800000012" Z="0.800000012"/>
|
||||||
</c:Transform>
|
</c:Transform>
|
||||||
</Components>
|
</Components>
|
||||||
<Children/>
|
<Children/>
|
||||||
@@ -110,6 +85,44 @@
|
|||||||
<Components>
|
<Components>
|
||||||
<c:Sprite>
|
<c:Sprite>
|
||||||
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
|
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
|
||||||
|
<GlowMap></GlowMap>
|
||||||
|
<DepthSort>false</DepthSort>
|
||||||
|
<Color A="0.300000012" B="1" G="1" R="1"/>
|
||||||
|
</c:Sprite>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0" Y="0.919596612" Z="0"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children>
|
||||||
|
<Entity name="ProgressionHexagon">
|
||||||
|
<Components>
|
||||||
|
<c:Fill>
|
||||||
|
<Color A="0.699999988" B="1" G="0.200000003" R="0"/>
|
||||||
|
</c:Fill>
|
||||||
|
<c:CapturePointHUD>
|
||||||
|
<CapturePointNumber>2</CapturePointNumber>
|
||||||
|
</c:CapturePointHUD>
|
||||||
|
<c:Sprite>
|
||||||
|
<DiffuseTexture>Textures/Core/UnitHexagon_Rotated.png</DiffuseTexture>
|
||||||
|
<GlowMap></GlowMap>
|
||||||
|
<DepthSort>false</DepthSort>
|
||||||
|
</c:Sprite>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0" Y="0" Z="0.00999999978"/>
|
||||||
|
<Orientation X="0" Y="0" Z="1.57079637"/>
|
||||||
|
<Scale X="0.800000012" Y="0.800000012" Z="0.800000012"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="BackgroundHexagon">
|
||||||
|
<Components>
|
||||||
|
<c:Sprite>
|
||||||
|
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
|
||||||
|
<GlowMap></GlowMap>
|
||||||
|
<DepthSort>false</DepthSort>
|
||||||
<Color A="0.300000012" B="1" G="1" R="1"/>
|
<Color A="0.300000012" B="1" G="1" R="1"/>
|
||||||
</c:Sprite>
|
</c:Sprite>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
@@ -119,19 +132,21 @@
|
|||||||
<Children>
|
<Children>
|
||||||
<Entity name="ProgressionHexagon">
|
<Entity name="ProgressionHexagon">
|
||||||
<Components>
|
<Components>
|
||||||
<c:CapturePointHUD>
|
|
||||||
<CapturePointNumber>1</CapturePointNumber>
|
|
||||||
</c:CapturePointHUD>
|
|
||||||
<c:Fill>
|
<c:Fill>
|
||||||
<Color A="0.699999988" B="1" G="0.200000003" R="0"/>
|
<Color A="0.699999988" B="1" G="0.200000003" R="0"/>
|
||||||
</c:Fill>
|
</c:Fill>
|
||||||
|
<c:CapturePointHUD>
|
||||||
|
<CapturePointNumber>1</CapturePointNumber>
|
||||||
|
</c:CapturePointHUD>
|
||||||
<c:Sprite>
|
<c:Sprite>
|
||||||
<DiffuseTexture>Textures/Core/UnitHexagon_Rotated.png</DiffuseTexture>
|
<DiffuseTexture>Textures/Core/UnitHexagon_Rotated.png</DiffuseTexture>
|
||||||
|
<GlowMap></GlowMap>
|
||||||
|
<DepthSort>false</DepthSort>
|
||||||
</c:Sprite>
|
</c:Sprite>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Position X="0" Y="0" Z="0.00999999978"/>
|
<Position X="0" Y="0" Z="0.00999999978"/>
|
||||||
<Scale X="0.800000012" Y="0.800000012" Z="0.800000012"/>
|
|
||||||
<Orientation X="0" Y="0" Z="1.57079637"/>
|
<Orientation X="0" Y="0" Z="1.57079637"/>
|
||||||
|
<Scale X="0.800000012" Y="0.800000012" Z="0.800000012"/>
|
||||||
</c:Transform>
|
</c:Transform>
|
||||||
</Components>
|
</Components>
|
||||||
<Children/>
|
<Children/>
|
||||||
@@ -142,7 +157,9 @@
|
|||||||
<Components>
|
<Components>
|
||||||
<c:Sprite>
|
<c:Sprite>
|
||||||
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
|
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
|
||||||
<Color A="0.699999988" B="0" G="0.200000003" R="1"/>
|
<GlowMap></GlowMap>
|
||||||
|
<DepthSort>false</DepthSort>
|
||||||
|
<Color A="0.699999988" B="0" G="0" R="1"/>
|
||||||
</c:Sprite>
|
</c:Sprite>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Position X="-1.58304751" Y="0.919596612" Z="0"/>
|
<Position X="-1.58304751" Y="0.919596612" Z="0"/>
|
||||||
@@ -151,17 +168,19 @@
|
|||||||
<Children>
|
<Children>
|
||||||
<Entity name="ProgressionHexagon">
|
<Entity name="ProgressionHexagon">
|
||||||
<Components>
|
<Components>
|
||||||
<c:CapturePointHUD/>
|
|
||||||
<c:Fill>
|
<c:Fill>
|
||||||
<Color A="0.699999988" B="1" G="0.200000003" R="0"/>
|
<Color A="0.699999988" B="1" G="0.200000003" R="0"/>
|
||||||
</c:Fill>
|
</c:Fill>
|
||||||
|
<c:CapturePointHUD/>
|
||||||
<c:Sprite>
|
<c:Sprite>
|
||||||
<DiffuseTexture>Textures/Core/UnitHexagon_Rotated.png</DiffuseTexture>
|
<DiffuseTexture>Textures/Core/UnitHexagon_Rotated.png</DiffuseTexture>
|
||||||
|
<GlowMap></GlowMap>
|
||||||
|
<DepthSort>false</DepthSort>
|
||||||
</c:Sprite>
|
</c:Sprite>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Position X="0" Y="0" Z="0.00999999978"/>
|
<Position X="0" Y="0" Z="0.00999999978"/>
|
||||||
<Scale X="0.800000012" Y="0.800000012" Z="0.800000012"/>
|
|
||||||
<Orientation X="0" Y="0" Z="1.57079637"/>
|
<Orientation X="0" Y="0" Z="1.57079637"/>
|
||||||
|
<Scale X="0.800000012" Y="0.800000012" Z="0.800000012"/>
|
||||||
</c:Transform>
|
</c:Transform>
|
||||||
</Components>
|
</Components>
|
||||||
<Children/>
|
<Children/>
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -8,6 +8,7 @@
|
|||||||
</c:RaptorCopter>
|
</c:RaptorCopter>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Position X="0" Y="-4" Z="0"/>
|
<Position X="0" Y="-4" Z="0"/>
|
||||||
|
<Orientation X="0" Y="55.3495064" Z="0"/>
|
||||||
</c:Transform>
|
</c:Transform>
|
||||||
</Components>
|
</Components>
|
||||||
|
|
||||||
@@ -20,6 +21,369 @@
|
|||||||
</c:Transform>
|
</c:Transform>
|
||||||
</Components>
|
</Components>
|
||||||
<Children>
|
<Children>
|
||||||
|
<Entity name="PickClassCamera">
|
||||||
|
<Components>
|
||||||
|
<c:Camera/>
|
||||||
|
<c:Transform/>
|
||||||
|
</Components>
|
||||||
|
<Children>
|
||||||
|
<Entity name="PickClassHUD">
|
||||||
|
<Components>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0" Y="-0" Z="-0.5"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children>
|
||||||
|
<Entity name="DefenderClassPick">
|
||||||
|
<Components>
|
||||||
|
<c:Button/>
|
||||||
|
<c:Sprite>
|
||||||
|
<DiffuseTexture>Textures/Icons/Classes/Defender-01.png</DiffuseTexture>
|
||||||
|
<GlowMap></GlowMap>
|
||||||
|
<DepthSort>false</DepthSort>
|
||||||
|
</c:Sprite>
|
||||||
|
<c:InputCmdButton>
|
||||||
|
<Command>PickClass</Command>
|
||||||
|
<PressValue>2</PressValue>
|
||||||
|
</c:InputCmdButton>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0" Y="-0.0500000007" Z="0"/>
|
||||||
|
<Scale X="0.0799999982" Y="0.0799999982" Z="1"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children>
|
||||||
|
<Entity name="DefenderText">
|
||||||
|
<Components>
|
||||||
|
<c:Text>
|
||||||
|
<Content>Defender</Content>
|
||||||
|
<Resource>Fonts/DroidSans.ttf,64</Resource>
|
||||||
|
<Color A="1" B="0" G="1" R="0.784313738"/>
|
||||||
|
</c:Text>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0" Y="0.800000012" Z="0"/>
|
||||||
|
<Scale X="0.310000002" Y="0.310000002" Z="1"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="SniperClassPick">
|
||||||
|
<Components>
|
||||||
|
<c:Button/>
|
||||||
|
<c:Sprite>
|
||||||
|
<DiffuseTexture>Textures/Icons/Classes/Sniper-01.png</DiffuseTexture>
|
||||||
|
<GlowMap></GlowMap>
|
||||||
|
<DepthSort>false</DepthSort>
|
||||||
|
</c:Sprite>
|
||||||
|
<c:InputCmdButton>
|
||||||
|
<Command>PickClass</Command>
|
||||||
|
<PressValue>3</PressValue>
|
||||||
|
</c:InputCmdButton>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0.150000006" Y="-0.0500000007" Z="0"/>
|
||||||
|
<Scale X="0.0799999982" Y="0.0799999982" Z="1"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children>
|
||||||
|
<Entity name="SniperText">
|
||||||
|
<Components>
|
||||||
|
<c:Text>
|
||||||
|
<Content>Sniper</Content>
|
||||||
|
<Resource>Fonts/DroidSans.ttf,64</Resource>
|
||||||
|
<Color A="1" B="0" G="1" R="0.784313738"/>
|
||||||
|
</c:Text>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0" Y="0.800000012" Z="0"/>
|
||||||
|
<Scale X="0.310000002" Y="0.310000002" Z="1"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="AssaultClassPick">
|
||||||
|
<Components>
|
||||||
|
<c:Button/>
|
||||||
|
<c:Sprite>
|
||||||
|
<DiffuseTexture>Textures/Icons/Classes/Assault-01.png</DiffuseTexture>
|
||||||
|
<GlowMap></GlowMap>
|
||||||
|
<DepthSort>false</DepthSort>
|
||||||
|
</c:Sprite>
|
||||||
|
<c:InputCmdButton>
|
||||||
|
<Command>PickClass</Command>
|
||||||
|
<PressValue>1</PressValue>
|
||||||
|
</c:InputCmdButton>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="-0.150000006" Y="-0.0500000007" Z="0"/>
|
||||||
|
<Scale X="0.0799999982" Y="0.0799999982" Z="1"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children>
|
||||||
|
<Entity name="AssaultText">
|
||||||
|
<Components>
|
||||||
|
<c:Text>
|
||||||
|
<Content>Assault</Content>
|
||||||
|
<Resource>Fonts/DroidSans.ttf,64</Resource>
|
||||||
|
<Color A="1" B="0" G="1" R="0.784313738"/>
|
||||||
|
</c:Text>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0" Y="0.800000012" Z="0"/>
|
||||||
|
<Scale X="0.310000002" Y="0.310000002" Z="1"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="ClassPickText">
|
||||||
|
<Components>
|
||||||
|
<c:Text>
|
||||||
|
<Content>Pick Class</Content>
|
||||||
|
<Resource>Fonts/DroidSans.ttf,64</Resource>
|
||||||
|
<Color A="1" B="0" G="1" R="0.784313738"/>
|
||||||
|
</c:Text>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0" Y="0.0799999982" Z="0"/>
|
||||||
|
<Scale X="0.0250000004" Y="0.0250000004" Z="1"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="ToTeamPick">
|
||||||
|
<Components>
|
||||||
|
<c:Button/>
|
||||||
|
<c:Sprite>
|
||||||
|
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
|
||||||
|
<GlowMap></GlowMap>
|
||||||
|
<DepthSort>false</DepthSort>
|
||||||
|
<Color A="1" B="0" G="1" R="0.509803951"/>
|
||||||
|
</c:Sprite>
|
||||||
|
<c:InputCmdButton>
|
||||||
|
<Command>SwapToTeamPick</Command>
|
||||||
|
<PressValue>1</PressValue>
|
||||||
|
</c:InputCmdButton>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0.349999994" Y="-0.180000007" Z="0"/>
|
||||||
|
<Scale X="0.0799999982" Y="0.0799999982" Z="1"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children>
|
||||||
|
<Entity name="ChangeText">
|
||||||
|
<Components>
|
||||||
|
<c:Text>
|
||||||
|
<Content>Change</Content>
|
||||||
|
<Resource>Fonts/DroidSans.ttf,64</Resource>
|
||||||
|
</c:Text>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0" Y="0" Z="0.00200000009"/>
|
||||||
|
<Scale X="0.25" Y="0.25" Z="1"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="TeamText">
|
||||||
|
<Components>
|
||||||
|
<c:Text>
|
||||||
|
<Content>Team</Content>
|
||||||
|
<Resource>Fonts/DroidSans.ttf,64</Resource>
|
||||||
|
</c:Text>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0" Y="-0.224999994" Z="0.00200000009"/>
|
||||||
|
<Scale X="0.25" Y="0.25" Z="1"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="PickTeamCamera">
|
||||||
|
<Components>
|
||||||
|
<c:Camera/>
|
||||||
|
<c:Transform/>
|
||||||
|
</Components>
|
||||||
|
<Children>
|
||||||
|
<Entity name="PickTeamHUD">
|
||||||
|
<Components>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0" Y="0" Z="-0.5"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children>
|
||||||
|
<Entity name="TeamPickText">
|
||||||
|
<Components>
|
||||||
|
<c:Text>
|
||||||
|
<Content>Pick Team</Content>
|
||||||
|
<Resource>Fonts/DroidSans.ttf,64</Resource>
|
||||||
|
<Color A="1" B="0" G="1" R="0.784313738"/>
|
||||||
|
</c:Text>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0" Y="0.0799999982" Z="0"/>
|
||||||
|
<Scale X="0.0250000004" Y="0.0250000004" Z="1"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="SpectatorPick">
|
||||||
|
<Components>
|
||||||
|
<c:Button/>
|
||||||
|
<c:Sprite>
|
||||||
|
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
|
||||||
|
<GlowMap></GlowMap>
|
||||||
|
<DepthSort>false</DepthSort>
|
||||||
|
<Color A="1" B="0" G="1" R="0.509803951"/>
|
||||||
|
</c:Sprite>
|
||||||
|
<c:InputCmdButton>
|
||||||
|
<Command>PickTeam</Command>
|
||||||
|
<PressValue>1</PressValue>
|
||||||
|
</c:InputCmdButton>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0" Y="-0.0500000007" Z="0"/>
|
||||||
|
<Scale X="0.0799999982" Y="0.0799999982" Z="1"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children>
|
||||||
|
<Entity name="SpectatorText">
|
||||||
|
<Components>
|
||||||
|
<c:Text>
|
||||||
|
<Content>Spectator</Content>
|
||||||
|
<Resource>Fonts/DroidSans.ttf,64</Resource>
|
||||||
|
</c:Text>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0" Y="-0.0450000018" Z="0.00200000009"/>
|
||||||
|
<Scale X="0.200000003" Y="0.200000003" Z="1"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="TeamRedPick">
|
||||||
|
<Components>
|
||||||
|
<c:Button/>
|
||||||
|
<c:Sprite>
|
||||||
|
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
|
||||||
|
<GlowMap></GlowMap>
|
||||||
|
<DepthSort>false</DepthSort>
|
||||||
|
<Color A="1" B="0" G="0.294117659" R="0.980392158"/>
|
||||||
|
</c:Sprite>
|
||||||
|
<c:InputCmdButton>
|
||||||
|
<Command>PickTeam</Command>
|
||||||
|
<PressValue>2</PressValue>
|
||||||
|
</c:InputCmdButton>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0.150000006" Y="-0.0500000007" Z="0"/>
|
||||||
|
<Scale X="0.0799999982" Y="0.0799999982" Z="1"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children>
|
||||||
|
<Entity name="RedText">
|
||||||
|
<Components>
|
||||||
|
<c:Text>
|
||||||
|
<Content>Red</Content>
|
||||||
|
<Resource>Fonts/DroidSans.ttf,64</Resource>
|
||||||
|
</c:Text>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0" Y="-0.0850000009" Z="0.00249999994"/>
|
||||||
|
<Scale X="0.310000002" Y="0.310000002" Z="1"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="TeamBluePick">
|
||||||
|
<Components>
|
||||||
|
<c:Button/>
|
||||||
|
<c:Sprite>
|
||||||
|
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
|
||||||
|
<GlowMap></GlowMap>
|
||||||
|
<DepthSort>false</DepthSort>
|
||||||
|
<Color A="1" B="0.980392158" G="0.294117659" R="0"/>
|
||||||
|
</c:Sprite>
|
||||||
|
<c:InputCmdButton>
|
||||||
|
<Command>PickTeam</Command>
|
||||||
|
<PressValue>3</PressValue>
|
||||||
|
</c:InputCmdButton>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="-0.150000006" Y="-0.0500000007" Z="0"/>
|
||||||
|
<Scale X="0.0799999982" Y="0.0799999982" Z="1"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children>
|
||||||
|
<Entity name="BlueText">
|
||||||
|
<Components>
|
||||||
|
<c:Text>
|
||||||
|
<Content>Blue</Content>
|
||||||
|
<Resource>Fonts/DroidSans.ttf,64</Resource>
|
||||||
|
</c:Text>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0" Y="-0.0850000009" Z="0.00200000009"/>
|
||||||
|
<Scale X="0.310000002" Y="0.310000002" Z="1"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="ToClassPick">
|
||||||
|
<Components>
|
||||||
|
<c:Button/>
|
||||||
|
<c:Sprite>
|
||||||
|
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
|
||||||
|
<GlowMap></GlowMap>
|
||||||
|
<DepthSort>false</DepthSort>
|
||||||
|
<Color A="1" B="0" G="1" R="0.509803951"/>
|
||||||
|
<Visible>false</Visible>
|
||||||
|
</c:Sprite>
|
||||||
|
<c:InputCmdButton>
|
||||||
|
<Command>SwapToClassPick</Command>
|
||||||
|
<PressValue>1</PressValue>
|
||||||
|
</c:InputCmdButton>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0.349999994" Y="-0.0800000057" Z="0"/>
|
||||||
|
<Scale X="0.0799999982" Y="0.0799999982" Z="1"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children>
|
||||||
|
<Entity name="ChangeText">
|
||||||
|
<Components>
|
||||||
|
<c:Text>
|
||||||
|
<Content>Change</Content>
|
||||||
|
<Resource>Fonts/DroidSans.ttf,64</Resource>
|
||||||
|
<Visible>false</Visible>
|
||||||
|
</c:Text>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0" Y="0" Z="0.00200000009"/>
|
||||||
|
<Scale X="0.25" Y="0.25" Z="1"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="ClassText">
|
||||||
|
<Components>
|
||||||
|
<c:Text>
|
||||||
|
<Content>Class</Content>
|
||||||
|
<Resource>Fonts/DroidSans.ttf,64</Resource>
|
||||||
|
<Visible>false</Visible>
|
||||||
|
</c:Text>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0" Y="-0.224999994" Z="0.00200000009"/>
|
||||||
|
<Scale X="0.25" Y="0.25" Z="1"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
<Entity name="SpectatorCamera">
|
<Entity name="SpectatorCamera">
|
||||||
<Components>
|
<Components>
|
||||||
<c:Camera/>
|
<c:Camera/>
|
||||||
@@ -33,6 +397,20 @@
|
|||||||
</c:Transform>
|
</c:Transform>
|
||||||
</Components>
|
</Components>
|
||||||
<Children>
|
<Children>
|
||||||
|
<Entity name="RespawnTimer">
|
||||||
|
<Components>
|
||||||
|
<c:Text>
|
||||||
|
<Content>7</Content>
|
||||||
|
<Resource>Fonts/DroidSans.ttf,64</Resource>
|
||||||
|
<Color A="1" B="0" G="1" R="0.784313738"/>
|
||||||
|
</c:Text>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0" Y="0.178199276" Z="0"/>
|
||||||
|
<Scale X="0.0250000004" Y="0.0250000004" Z="1"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
<Entity name="CapturePointHUD">
|
<Entity name="CapturePointHUD">
|
||||||
<Components>
|
<Components>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
@@ -46,40 +424,7 @@
|
|||||||
<c:Sprite>
|
<c:Sprite>
|
||||||
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
|
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
|
||||||
<GlowMap></GlowMap>
|
<GlowMap></GlowMap>
|
||||||
<Color A="0.300000012" B="1" G="1" R="1"/>
|
<DepthSort>false</DepthSort>
|
||||||
</c:Sprite>
|
|
||||||
<c:Transform>
|
|
||||||
<Position X="0" Y="0.919596612" Z="0"/>
|
|
||||||
</c:Transform>
|
|
||||||
</Components>
|
|
||||||
<Children>
|
|
||||||
<Entity name="ProgressionHexagon">
|
|
||||||
<Components>
|
|
||||||
<c:CapturePointHUD>
|
|
||||||
<CapturePointNumber>2</CapturePointNumber>
|
|
||||||
</c:CapturePointHUD>
|
|
||||||
<c:Fill>
|
|
||||||
<Color A="0.699999988" B="1" G="0.200000003" R="0"/>
|
|
||||||
</c:Fill>
|
|
||||||
<c:Sprite>
|
|
||||||
<DiffuseTexture>Textures/Core/UnitHexagon_Rotated.png</DiffuseTexture>
|
|
||||||
<GlowMap></GlowMap>
|
|
||||||
</c:Sprite>
|
|
||||||
<c:Transform>
|
|
||||||
<Position X="0" Y="0" Z="0.00999999978"/>
|
|
||||||
<Orientation X="0" Y="0" Z="1.57079637"/>
|
|
||||||
<Scale X="0.800000012" Y="0.800000012" Z="0.800000012"/>
|
|
||||||
</c:Transform>
|
|
||||||
</Components>
|
|
||||||
<Children/>
|
|
||||||
</Entity>
|
|
||||||
</Children>
|
|
||||||
</Entity>
|
|
||||||
<Entity name="BackgroundHexagon">
|
|
||||||
<Components>
|
|
||||||
<c:Sprite>
|
|
||||||
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
|
|
||||||
<GlowMap></GlowMap>
|
|
||||||
<Color A="0.300000012" B="1" G="1" R="1"/>
|
<Color A="0.300000012" B="1" G="1" R="1"/>
|
||||||
</c:Sprite>
|
</c:Sprite>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
@@ -89,15 +434,16 @@
|
|||||||
<Children>
|
<Children>
|
||||||
<Entity name="ProgressionHexagon">
|
<Entity name="ProgressionHexagon">
|
||||||
<Components>
|
<Components>
|
||||||
<c:CapturePointHUD>
|
|
||||||
<CapturePointNumber>3</CapturePointNumber>
|
|
||||||
</c:CapturePointHUD>
|
|
||||||
<c:Fill>
|
<c:Fill>
|
||||||
<Color A="0.699999988" B="1" G="0.200000003" R="0"/>
|
<Color A="0.699999988" B="1" G="0.200000003" R="0"/>
|
||||||
</c:Fill>
|
</c:Fill>
|
||||||
|
<c:CapturePointHUD>
|
||||||
|
<CapturePointNumber>3</CapturePointNumber>
|
||||||
|
</c:CapturePointHUD>
|
||||||
<c:Sprite>
|
<c:Sprite>
|
||||||
<DiffuseTexture>Textures/Core/UnitHexagon_Rotated.png</DiffuseTexture>
|
<DiffuseTexture>Textures/Core/UnitHexagon_Rotated.png</DiffuseTexture>
|
||||||
<GlowMap></GlowMap>
|
<GlowMap></GlowMap>
|
||||||
|
<DepthSort>false</DepthSort>
|
||||||
</c:Sprite>
|
</c:Sprite>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Position X="0" Y="0" Z="0.00999999978"/>
|
<Position X="0" Y="0" Z="0.00999999978"/>
|
||||||
@@ -114,6 +460,7 @@
|
|||||||
<c:Sprite>
|
<c:Sprite>
|
||||||
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
|
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
|
||||||
<GlowMap></GlowMap>
|
<GlowMap></GlowMap>
|
||||||
|
<DepthSort>false</DepthSort>
|
||||||
<Color A="0.699999988" B="1" G="0.200000003" R="0"/>
|
<Color A="0.699999988" B="1" G="0.200000003" R="0"/>
|
||||||
</c:Sprite>
|
</c:Sprite>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
@@ -123,15 +470,16 @@
|
|||||||
<Children>
|
<Children>
|
||||||
<Entity name="ProgressionHexagon">
|
<Entity name="ProgressionHexagon">
|
||||||
<Components>
|
<Components>
|
||||||
<c:CapturePointHUD>
|
|
||||||
<CapturePointNumber>4</CapturePointNumber>
|
|
||||||
</c:CapturePointHUD>
|
|
||||||
<c:Fill>
|
<c:Fill>
|
||||||
<Color A="0.699999988" B="1" G="0.200000003" R="0"/>
|
<Color A="0.699999988" B="1" G="0.200000003" R="0"/>
|
||||||
</c:Fill>
|
</c:Fill>
|
||||||
|
<c:CapturePointHUD>
|
||||||
|
<CapturePointNumber>4</CapturePointNumber>
|
||||||
|
</c:CapturePointHUD>
|
||||||
<c:Sprite>
|
<c:Sprite>
|
||||||
<DiffuseTexture>Textures/Core/UnitHexagon_Rotated.png</DiffuseTexture>
|
<DiffuseTexture>Textures/Core/UnitHexagon_Rotated.png</DiffuseTexture>
|
||||||
<GlowMap></GlowMap>
|
<GlowMap></GlowMap>
|
||||||
|
<DepthSort>false</DepthSort>
|
||||||
</c:Sprite>
|
</c:Sprite>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Position X="0" Y="0" Z="0.00999999978"/>
|
<Position X="0" Y="0" Z="0.00999999978"/>
|
||||||
@@ -148,6 +496,43 @@
|
|||||||
<c:Sprite>
|
<c:Sprite>
|
||||||
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
|
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
|
||||||
<GlowMap></GlowMap>
|
<GlowMap></GlowMap>
|
||||||
|
<DepthSort>false</DepthSort>
|
||||||
|
<Color A="0.300000012" B="1" G="1" R="1"/>
|
||||||
|
</c:Sprite>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0" Y="0.919596612" Z="0"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children>
|
||||||
|
<Entity name="ProgressionHexagon">
|
||||||
|
<Components>
|
||||||
|
<c:Fill>
|
||||||
|
<Color A="0.699999988" B="1" G="0.200000003" R="0"/>
|
||||||
|
</c:Fill>
|
||||||
|
<c:CapturePointHUD>
|
||||||
|
<CapturePointNumber>2</CapturePointNumber>
|
||||||
|
</c:CapturePointHUD>
|
||||||
|
<c:Sprite>
|
||||||
|
<DiffuseTexture>Textures/Core/UnitHexagon_Rotated.png</DiffuseTexture>
|
||||||
|
<GlowMap></GlowMap>
|
||||||
|
<DepthSort>false</DepthSort>
|
||||||
|
</c:Sprite>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0" Y="0" Z="0.00999999978"/>
|
||||||
|
<Orientation X="0" Y="0" Z="1.57079637"/>
|
||||||
|
<Scale X="0.800000012" Y="0.800000012" Z="0.800000012"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="BackgroundHexagon">
|
||||||
|
<Components>
|
||||||
|
<c:Sprite>
|
||||||
|
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
|
||||||
|
<GlowMap></GlowMap>
|
||||||
|
<DepthSort>false</DepthSort>
|
||||||
<Color A="0.300000012" B="1" G="1" R="1"/>
|
<Color A="0.300000012" B="1" G="1" R="1"/>
|
||||||
</c:Sprite>
|
</c:Sprite>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
@@ -157,16 +542,17 @@
|
|||||||
<Children>
|
<Children>
|
||||||
<Entity name="ProgressionHexagon">
|
<Entity name="ProgressionHexagon">
|
||||||
<Components>
|
<Components>
|
||||||
<c:CapturePointHUD>
|
|
||||||
<CapturePointNumber>1</CapturePointNumber>
|
|
||||||
</c:CapturePointHUD>
|
|
||||||
<c:Fill>
|
<c:Fill>
|
||||||
<Percentage>0.10332605343919568</Percentage>
|
<Percentage>0.10332605343919568</Percentage>
|
||||||
<Color A="0.699999988" B="0" G="0" R="1"/>
|
<Color A="0.699999988" B="0" G="0" R="1"/>
|
||||||
</c:Fill>
|
</c:Fill>
|
||||||
|
<c:CapturePointHUD>
|
||||||
|
<CapturePointNumber>1</CapturePointNumber>
|
||||||
|
</c:CapturePointHUD>
|
||||||
<c:Sprite>
|
<c:Sprite>
|
||||||
<DiffuseTexture>Textures/Core/UnitHexagon_Rotated.png</DiffuseTexture>
|
<DiffuseTexture>Textures/Core/UnitHexagon_Rotated.png</DiffuseTexture>
|
||||||
<GlowMap></GlowMap>
|
<GlowMap></GlowMap>
|
||||||
|
<DepthSort>false</DepthSort>
|
||||||
</c:Sprite>
|
</c:Sprite>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Position X="0" Y="0" Z="0.00999999978"/>
|
<Position X="0" Y="0" Z="0.00999999978"/>
|
||||||
@@ -183,6 +569,7 @@
|
|||||||
<c:Sprite>
|
<c:Sprite>
|
||||||
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
|
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
|
||||||
<GlowMap></GlowMap>
|
<GlowMap></GlowMap>
|
||||||
|
<DepthSort>false</DepthSort>
|
||||||
<Color A="0.699999988" B="0" G="0" R="1"/>
|
<Color A="0.699999988" B="0" G="0" R="1"/>
|
||||||
</c:Sprite>
|
</c:Sprite>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
@@ -192,13 +579,14 @@
|
|||||||
<Children>
|
<Children>
|
||||||
<Entity name="ProgressionHexagon">
|
<Entity name="ProgressionHexagon">
|
||||||
<Components>
|
<Components>
|
||||||
<c:CapturePointHUD/>
|
|
||||||
<c:Fill>
|
<c:Fill>
|
||||||
<Color A="0.699999988" B="1" G="0.200000003" R="0"/>
|
<Color A="0.699999988" B="1" G="0.200000003" R="0"/>
|
||||||
</c:Fill>
|
</c:Fill>
|
||||||
|
<c:CapturePointHUD/>
|
||||||
<c:Sprite>
|
<c:Sprite>
|
||||||
<DiffuseTexture>Textures/Core/UnitHexagon_Rotated.png</DiffuseTexture>
|
<DiffuseTexture>Textures/Core/UnitHexagon_Rotated.png</DiffuseTexture>
|
||||||
<GlowMap></GlowMap>
|
<GlowMap></GlowMap>
|
||||||
|
<DepthSort>false</DepthSort>
|
||||||
</c:Sprite>
|
</c:Sprite>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Position X="0" Y="0" Z="0.00999999978"/>
|
<Position X="0" Y="0" Z="0.00999999978"/>
|
||||||
@@ -212,90 +600,99 @@
|
|||||||
</Entity>
|
</Entity>
|
||||||
</Children>
|
</Children>
|
||||||
</Entity>
|
</Entity>
|
||||||
<Entity name="RespawnTimer">
|
<Entity name="ToTeamPick">
|
||||||
<Components>
|
|
||||||
<c:Text>
|
|
||||||
<Content>16</Content>
|
|
||||||
<Resource>Fonts/DroidSans.ttf,64</Resource>
|
|
||||||
<Color A="1" B="0" G="1" R="0.784313738"/>
|
|
||||||
</c:Text>
|
|
||||||
<c:Transform>
|
|
||||||
<Position X="0" Y="0.178199276" Z="0"/>
|
|
||||||
<Scale X="0.0250000004" Y="0.0250000004" Z="1"/>
|
|
||||||
</c:Transform>
|
|
||||||
</Components>
|
|
||||||
<Children/>
|
|
||||||
</Entity>
|
|
||||||
</Children>
|
|
||||||
</Entity>
|
|
||||||
</Children>
|
|
||||||
</Entity>
|
|
||||||
<Entity name="PickClassCamera">
|
|
||||||
<Components>
|
|
||||||
<c:Camera/>
|
|
||||||
<c:Transform/>
|
|
||||||
</Components>
|
|
||||||
<Children>
|
|
||||||
<Entity name="PickClassHUD">
|
|
||||||
<Components>
|
|
||||||
<c:Transform>
|
|
||||||
<Position X="0" Y="0" Z="-0.5"/>
|
|
||||||
</c:Transform>
|
|
||||||
</Components>
|
|
||||||
<Children>
|
|
||||||
<Entity name="DefenderClassPick">
|
|
||||||
<Components>
|
<Components>
|
||||||
<c:Button/>
|
<c:Button/>
|
||||||
<c:Sprite>
|
<c:Sprite>
|
||||||
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
|
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
|
||||||
<GlowMap></GlowMap>
|
<GlowMap></GlowMap>
|
||||||
|
<DepthSort>false</DepthSort>
|
||||||
|
<Color A="1" B="0" G="1" R="0.509803951"/>
|
||||||
</c:Sprite>
|
</c:Sprite>
|
||||||
<c:InputCmdButton>
|
<c:InputCmdButton>
|
||||||
<Command>PickClass</Command>
|
<Command>SwapToTeamPick</Command>
|
||||||
<PressValue>2</PressValue>
|
|
||||||
</c:InputCmdButton>
|
|
||||||
<c:Transform>
|
|
||||||
<Position X="0.349999994" Y="0.0500000007" Z="0"/>
|
|
||||||
<Scale X="0.0799999982" Y="0.0799999982" Z="1"/>
|
|
||||||
</c:Transform>
|
|
||||||
</Components>
|
|
||||||
<Children/>
|
|
||||||
</Entity>
|
|
||||||
<Entity name="AssaultClassPick">
|
|
||||||
<Components>
|
|
||||||
<c:Button/>
|
|
||||||
<c:Sprite>
|
|
||||||
<DiffuseTexture>Textures/Core/UnitRaptor.png</DiffuseTexture>
|
|
||||||
<GlowMap></GlowMap>
|
|
||||||
</c:Sprite>
|
|
||||||
<c:InputCmdButton>
|
|
||||||
<Command>PickClass</Command>
|
|
||||||
<PressValue>1</PressValue>
|
<PressValue>1</PressValue>
|
||||||
</c:InputCmdButton>
|
</c:InputCmdButton>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Position X="0.349999994" Y="0.149504215" Z="0"/>
|
<Position X="0.349999994" Y="-0.180000007" Z="0"/>
|
||||||
<Scale X="0.0799999982" Y="0.0799999982" Z="1"/>
|
<Scale X="0.0799999982" Y="0.0799999982" Z="1"/>
|
||||||
</c:Transform>
|
</c:Transform>
|
||||||
</Components>
|
</Components>
|
||||||
<Children/>
|
<Children>
|
||||||
|
<Entity name="ChangeText">
|
||||||
|
<Components>
|
||||||
|
<c:Text>
|
||||||
|
<Content>Change</Content>
|
||||||
|
<Resource>Fonts/DroidSans.ttf,64</Resource>
|
||||||
|
</c:Text>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0" Y="0" Z="0.00200000009"/>
|
||||||
|
<Scale X="0.25" Y="0.25" Z="1"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="TeamText">
|
||||||
|
<Components>
|
||||||
|
<c:Text>
|
||||||
|
<Content>Team</Content>
|
||||||
|
<Resource>Fonts/DroidSans.ttf,64</Resource>
|
||||||
|
</c:Text>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0" Y="-0.224999994" Z="0.00200000009"/>
|
||||||
|
<Scale X="0.25" Y="0.25" Z="1"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
</Entity>
|
</Entity>
|
||||||
<Entity name="SniperClassPick">
|
<Entity name="ToClassPick">
|
||||||
<Components>
|
<Components>
|
||||||
<c:Button/>
|
<c:Button/>
|
||||||
<c:Sprite>
|
<c:Sprite>
|
||||||
<DiffuseTexture>Textures/Test/aM4ME4GR.png</DiffuseTexture>
|
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
|
||||||
<GlowMap></GlowMap>
|
<GlowMap></GlowMap>
|
||||||
|
<DepthSort>false</DepthSort>
|
||||||
|
<Color A="1" B="0" G="1" R="0.509803951"/>
|
||||||
</c:Sprite>
|
</c:Sprite>
|
||||||
<c:InputCmdButton>
|
<c:InputCmdButton>
|
||||||
<Command>PickClass</Command>
|
<Command>SwapToClassPick</Command>
|
||||||
<PressValue>3</PressValue>
|
<PressValue>1</PressValue>
|
||||||
</c:InputCmdButton>
|
</c:InputCmdButton>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Position X="0.349999994" Y="-0.0500000007" Z="0"/>
|
<Position X="0.349999994" Y="-0.0800000057" Z="0"/>
|
||||||
<Scale X="0.0799999982" Y="0.0799999982" Z="1"/>
|
<Scale X="0.0799999982" Y="0.0799999982" Z="1"/>
|
||||||
</c:Transform>
|
</c:Transform>
|
||||||
</Components>
|
</Components>
|
||||||
<Children/>
|
<Children>
|
||||||
|
<Entity name="ChangeText">
|
||||||
|
<Components>
|
||||||
|
<c:Text>
|
||||||
|
<Content>Change</Content>
|
||||||
|
<Resource>Fonts/DroidSans.ttf,64</Resource>
|
||||||
|
</c:Text>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0" Y="0" Z="0.00200000009"/>
|
||||||
|
<Scale X="0.25" Y="0.25" Z="1"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="ClassText">
|
||||||
|
<Components>
|
||||||
|
<c:Text>
|
||||||
|
<Content>Class</Content>
|
||||||
|
<Resource>Fonts/DroidSans.ttf,64</Resource>
|
||||||
|
</c:Text>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0" Y="-0.224999994" Z="0.00200000009"/>
|
||||||
|
<Scale X="0.25" Y="0.25" Z="1"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
</Entity>
|
</Entity>
|
||||||
</Children>
|
</Children>
|
||||||
</Entity>
|
</Entity>
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ bool ButtonSystem::OnMousePress(const Events::MousePress& e)
|
|||||||
//You have clicked on a button entity, send pressed event.
|
//You have clicked on a button entity, send pressed event.
|
||||||
if (m_World->HasComponent(m_PickData.Entity, "InputCmdButton")) {
|
if (m_World->HasComponent(m_PickData.Entity, "InputCmdButton")) {
|
||||||
Events::InputCommand eInputCmd;
|
Events::InputCommand eInputCmd;
|
||||||
eInputCmd.PlayerID = LocalPlayer.ID;
|
eInputCmd.PlayerID = -1;
|
||||||
eInputCmd.Player = LocalPlayer;
|
eInputCmd.Player = LocalPlayer;
|
||||||
EntityWrapper button = EntityWrapper(m_World, m_PickData.Entity);
|
EntityWrapper button = EntityWrapper(m_World, m_PickData.Entity);
|
||||||
eInputCmd.Command = (std::string)button["InputCmdButton"]["Command"];
|
eInputCmd.Command = (std::string)button["InputCmdButton"]["Command"];
|
||||||
@@ -68,7 +68,7 @@ bool ButtonSystem::OnMouseRelease(const Events::MouseRelease& e)
|
|||||||
|
|
||||||
if (m_World->HasComponent(m_PickData.Entity, "InputCmdButton")) {
|
if (m_World->HasComponent(m_PickData.Entity, "InputCmdButton")) {
|
||||||
Events::InputCommand eInputCmd;
|
Events::InputCommand eInputCmd;
|
||||||
eInputCmd.PlayerID = LocalPlayer.ID;
|
eInputCmd.PlayerID = -1;
|
||||||
eInputCmd.Player = LocalPlayer;
|
eInputCmd.Player = LocalPlayer;
|
||||||
EntityWrapper button = EntityWrapper(m_World, m_PickData.Entity);
|
EntityWrapper button = EntityWrapper(m_World, m_PickData.Entity);
|
||||||
eInputCmd.Command = (std::string)button["InputCmdButton"]["Command"];
|
eInputCmd.Command = (std::string)button["InputCmdButton"]["Command"];
|
||||||
|
|||||||
@@ -7,23 +7,23 @@ TextPass::TextPass()
|
|||||||
|
|
||||||
void TextPass::Initialize()
|
void TextPass::Initialize()
|
||||||
{
|
{
|
||||||
glGenVertexArrays(1, &VAO);
|
glGenVertexArrays(1, &VAO);
|
||||||
glGenBuffers(1, &VBO);
|
glGenBuffers(1, &VBO);
|
||||||
glBindVertexArray(VAO);
|
glBindVertexArray(VAO);
|
||||||
glBindBuffer(GL_ARRAY_BUFFER, VBO);
|
glBindBuffer(GL_ARRAY_BUFFER, VBO);
|
||||||
glBufferData(GL_ARRAY_BUFFER, sizeof(GLfloat) * 6 * 4, NULL, GL_DYNAMIC_DRAW);
|
glBufferData(GL_ARRAY_BUFFER, sizeof(GLfloat) * 6 * 4, NULL, GL_DYNAMIC_DRAW);
|
||||||
glEnableVertexAttribArray(0);
|
glEnableVertexAttribArray(0);
|
||||||
glVertexAttribPointer(0, 4, GL_FLOAT, GL_FALSE, 4 * sizeof(GLfloat), 0);
|
glVertexAttribPointer(0, 4, GL_FLOAT, GL_FALSE, 4 * sizeof(GLfloat), 0);
|
||||||
glBindBuffer(GL_ARRAY_BUFFER, 0);
|
glBindBuffer(GL_ARRAY_BUFFER, 0);
|
||||||
glBindVertexArray(0);
|
glBindVertexArray(0);
|
||||||
|
|
||||||
m_TextProgram = ResourceManager::Load<ShaderProgram>("#TextProgram");
|
m_TextProgram = ResourceManager::Load<ShaderProgram>("#TextProgram");
|
||||||
m_TextProgram->AddShader(std::shared_ptr<Shader>(new VertexShader("Shaders/Text.vert.glsl")));
|
m_TextProgram->AddShader(std::shared_ptr<Shader>(new VertexShader("Shaders/Text.vert.glsl")));
|
||||||
m_TextProgram->AddShader(std::shared_ptr<Shader>(new FragmentShader("Shaders/Text.frag.glsl")));
|
m_TextProgram->AddShader(std::shared_ptr<Shader>(new FragmentShader("Shaders/Text.frag.glsl")));
|
||||||
m_TextProgram->Compile();
|
m_TextProgram->Compile();
|
||||||
m_TextProgram->BindFragDataLocation(0, "sceneColor");
|
m_TextProgram->BindFragDataLocation(0, "sceneColor");
|
||||||
m_TextProgram->BindFragDataLocation(1, "bloomColor");
|
m_TextProgram->BindFragDataLocation(1, "bloomColor");
|
||||||
m_TextProgram->Link();
|
m_TextProgram->Link();
|
||||||
}
|
}
|
||||||
|
|
||||||
void TextPass::Update()
|
void TextPass::Update()
|
||||||
@@ -33,180 +33,81 @@ void TextPass::Update()
|
|||||||
|
|
||||||
void TextPass::Draw(RenderScene& scene, FrameBuffer& frameBuffer)
|
void TextPass::Draw(RenderScene& scene, FrameBuffer& frameBuffer)
|
||||||
{
|
{
|
||||||
GLERROR("Derp1");
|
GLERROR("Derp1");
|
||||||
TextPassState* state = new TextPassState(frameBuffer.GetHandle());
|
TextPassState* state = new TextPassState(frameBuffer.GetHandle());
|
||||||
for (auto &job : scene.Jobs.Text) {
|
for (auto &job : scene.Jobs.Text) {
|
||||||
auto textJob = std::dynamic_pointer_cast<TextJob>(job);
|
auto textJob = std::dynamic_pointer_cast<TextJob>(job);
|
||||||
if (textJob) {
|
if (textJob) {
|
||||||
|
|
||||||
renderText(textJob->Content, textJob->Resource, textJob->Alignment, textJob->Color, textJob->Matrix, scene.Camera->ProjectionMatrix(), scene.Camera->ViewMatrix());
|
renderText(textJob->Content, textJob->Resource, textJob->Alignment, textJob->Color, textJob->Matrix, scene.Camera->ProjectionMatrix(), scene.Camera->ViewMatrix());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
GLERROR("Derp2");
|
GLERROR("Derp2");
|
||||||
delete state;
|
delete state;
|
||||||
}
|
|
||||||
|
|
||||||
std::string TextPass::parseColors(std::string text, std::map<int, glm::vec4>& colorChanges, glm::vec4 originalColor)
|
|
||||||
{
|
|
||||||
std::string parsedString = text;
|
|
||||||
glm::vec4 newColor = originalColor;
|
|
||||||
bool colorChange = false;
|
|
||||||
|
|
||||||
for (std::string::const_iterator c = parsedString.begin(); c != parsedString.end(); c++) {
|
|
||||||
if (*c == char(92)) { // Backlash
|
|
||||||
if ((c + 1) != parsedString.end()) {
|
|
||||||
if (*(c + 1) == char('C')) { // C for Color
|
|
||||||
if ((c + 7) != parsedString.end()) {
|
|
||||||
bool hasCorrectFormat = true;
|
|
||||||
|
|
||||||
for (std::string::const_iterator colorC = c + 2; colorC != c + 8; colorC++) {
|
|
||||||
if (*colorC < '0' || *colorC > 'F') {
|
|
||||||
hasCorrectFormat = false;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (hasCorrectFormat == true) {
|
|
||||||
colorChange = true;
|
|
||||||
|
|
||||||
std::array<int, 3> hexToInt = {
|
|
||||||
std::stoi(std::string(c + 2, c + 4), 0, 16),
|
|
||||||
std::stoi(std::string(c + 4, c + 6), 0, 16),
|
|
||||||
std::stoi(std::string(c + 6, c + 8), 0, 16)
|
|
||||||
};
|
|
||||||
|
|
||||||
newColor = glm::vec4(
|
|
||||||
float(hexToInt[0]) / 255.f,
|
|
||||||
float(hexToInt[1]) / 255.f,
|
|
||||||
float(hexToInt[2]) / 255.f,
|
|
||||||
newColor.a);
|
|
||||||
|
|
||||||
parsedString.erase(c, (c + 8));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (*(c + 1) == char('A')) { // A for Alpha
|
|
||||||
if ((c + 3) != parsedString.end()) {
|
|
||||||
bool hasCorrectFormat = true;
|
|
||||||
|
|
||||||
for (std::string::const_iterator colorC = c + 2; colorC != c + 4; colorC++) {
|
|
||||||
if (*colorC < '0' || *colorC > 'F') {
|
|
||||||
hasCorrectFormat = false;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (hasCorrectFormat == true) {
|
|
||||||
colorChange = true;
|
|
||||||
|
|
||||||
int hexToInt = std::stoi(std::string(c + 2, c + 4), 0, 16);
|
|
||||||
|
|
||||||
newColor = glm::vec4(
|
|
||||||
newColor.r,
|
|
||||||
newColor.g,
|
|
||||||
newColor.b,
|
|
||||||
float(hexToInt) / 255.f);
|
|
||||||
|
|
||||||
parsedString.erase(c, (c + 4));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((*(c + 1) >= '1' && *(c + 1) <= '9') || *(c + 1) == 'B' || *(c + 1) == 'E' || *(c + 1) == 'F') { // Icons
|
|
||||||
if (*(c + 1) >= '1' && *(c + 1) <= '9') {
|
|
||||||
parsedString.replace(c, (c + 2), 1, (*(c + 1) - 48));
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
parsedString.replace(c, (c + 2), 1, (*(c + 1) - 55));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (colorChange) {
|
|
||||||
colorChanges[c - parsedString.begin()] = newColor;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return parsedString;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void TextPass::renderText(std::string text, Font* font, TextJob::AlignmentEnum alignment, glm::vec4 color, glm::mat4 modelMatrix, glm::mat4 projectionMatrix, glm::mat4 viewMatrix)
|
void TextPass::renderText(std::string text, Font* font, TextJob::AlignmentEnum alignment, glm::vec4 color, glm::mat4 modelMatrix, glm::mat4 projectionMatrix, glm::mat4 viewMatrix)
|
||||||
{
|
{
|
||||||
GLfloat penX = 0;
|
GLfloat penX = 0;
|
||||||
GLfloat penY = 0;
|
GLfloat penY = 0;
|
||||||
GLfloat scale = 1.0 / font->FontSize;
|
GLfloat scale = 1.0/font->FontSize;
|
||||||
|
|
||||||
GLfloat stringWidth = 0.f;
|
GLfloat stringWidth = 0.f;
|
||||||
|
|
||||||
std::map<int, glm::vec4> colorChanges;
|
for (std::string::const_iterator c = text.begin(); c != text.end(); c++) {
|
||||||
std::string parsedText = parseColors(text, colorChanges, color);
|
Font::Character ch = font->m_Characters[*c];
|
||||||
|
stringWidth += (ch.Advance >> 6) * scale;
|
||||||
|
}
|
||||||
|
|
||||||
for (std::string::const_iterator c = parsedText.begin(); c != parsedText.end(); c++) {
|
if(alignment == TextJob::AlignmentEnum::Center) {
|
||||||
Font::Character ch = font->m_Characters[*c];
|
penX = -stringWidth/2.f;
|
||||||
stringWidth += (ch.Advance >> 6) * scale;
|
} else if (alignment == TextJob::AlignmentEnum::Right) {
|
||||||
}
|
penX = -stringWidth;
|
||||||
|
} else {
|
||||||
|
penX = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (alignment == TextJob::AlignmentEnum::Center) {
|
m_TextProgram->Bind();
|
||||||
penX = -stringWidth / 2.f;
|
glUniform4fv(glGetUniformLocation(m_TextProgram->GetHandle(), "textColor"), 1, glm::value_ptr(color));
|
||||||
}
|
glUniformMatrix4fv(glGetUniformLocation(m_TextProgram->GetHandle(), "M"), 1, GL_FALSE, glm::value_ptr(modelMatrix));
|
||||||
else if (alignment == TextJob::AlignmentEnum::Right) {
|
glUniformMatrix4fv(glGetUniformLocation(m_TextProgram->GetHandle(), "V"), 1, GL_FALSE, glm::value_ptr(viewMatrix));
|
||||||
penX = -stringWidth;
|
glUniformMatrix4fv(glGetUniformLocation(m_TextProgram->GetHandle(), "P"), 1, GL_FALSE, glm::value_ptr(projectionMatrix));
|
||||||
}
|
glActiveTexture(GL_TEXTURE0);
|
||||||
else {
|
glBindVertexArray(VAO);
|
||||||
penX = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
for (std::string::const_iterator c = text.begin(); c != text.end(); c++) {
|
||||||
|
Font::Character ch = font->m_Characters[*c];
|
||||||
|
|
||||||
m_TextProgram->Bind();
|
GLfloat xpos = penX + ch.Bearing.x * scale;
|
||||||
glUniform4fv(glGetUniformLocation(m_TextProgram->GetHandle(), "textColor"), 1, glm::value_ptr(color));
|
GLfloat ypos = penY - (ch.Size.y - ch.Bearing.y) * scale;
|
||||||
glUniformMatrix4fv(glGetUniformLocation(m_TextProgram->GetHandle(), "M"), 1, GL_FALSE, glm::value_ptr(modelMatrix));
|
|
||||||
glUniformMatrix4fv(glGetUniformLocation(m_TextProgram->GetHandle(), "V"), 1, GL_FALSE, glm::value_ptr(viewMatrix));
|
|
||||||
glUniformMatrix4fv(glGetUniformLocation(m_TextProgram->GetHandle(), "P"), 1, GL_FALSE, glm::value_ptr(projectionMatrix));
|
|
||||||
glActiveTexture(GL_TEXTURE0);
|
|
||||||
glBindVertexArray(VAO);
|
|
||||||
|
|
||||||
|
GLfloat w = ch.Size.x * scale;
|
||||||
|
GLfloat h = ch.Size.y * scale;
|
||||||
|
|
||||||
for (std::string::const_iterator c = parsedText.begin(); c != parsedText.end(); c++) {
|
GLfloat vertices[6][4] = {
|
||||||
|
{ xpos, ypos + h, 0.0, 0.0 },
|
||||||
|
{ xpos, ypos, 0.0, 1.0 },
|
||||||
|
{ xpos + w, ypos, 1.0, 1.0 },
|
||||||
|
|
||||||
auto it = colorChanges.find(c - parsedText.begin());
|
{ xpos, ypos + h, 0.0, 0.0 },
|
||||||
if (it != colorChanges.end()) {
|
{ xpos + w, ypos, 1.0, 1.0 },
|
||||||
glUniform4fv(glGetUniformLocation(m_TextProgram->GetHandle(), "textColor"), 1, glm::value_ptr(it->second));
|
{ xpos + w, ypos + h, 1.0, 0.0 }
|
||||||
}
|
};
|
||||||
|
|
||||||
Font::Character ch = font->m_Characters[*c];
|
glBindTexture(GL_TEXTURE_2D, ch.TextureID);
|
||||||
|
|
||||||
GLfloat xpos = penX + ch.Bearing.x * scale;
|
glBindBuffer(GL_ARRAY_BUFFER, VBO);
|
||||||
GLfloat ypos = penY - (ch.Size.y - ch.Bearing.y) * scale;
|
glBufferSubData(GL_ARRAY_BUFFER, 0, sizeof(vertices), vertices);
|
||||||
|
glBindBuffer(GL_ARRAY_BUFFER, 0);
|
||||||
|
glDrawArrays(GL_TRIANGLES, 0, 6);
|
||||||
|
penX += (ch.Advance >> 6) * scale; // Bitshift by 6 to get value in pixels (2^6 = 64)
|
||||||
|
}
|
||||||
|
glBindVertexArray(0);
|
||||||
|
glBindTexture(GL_TEXTURE_2D, 0);
|
||||||
|
|
||||||
GLfloat w = ch.Size.x * scale;
|
GLERROR("Text rendering Error");
|
||||||
GLfloat h = ch.Size.y * scale;
|
|
||||||
|
|
||||||
GLfloat vertices[6][4] = {
|
|
||||||
{ xpos, ypos + h, 0.0, 0.0 },
|
|
||||||
{ xpos, ypos, 0.0, 1.0 },
|
|
||||||
{ xpos + w, ypos, 1.0, 1.0 },
|
|
||||||
|
|
||||||
{ xpos, ypos + h, 0.0, 0.0 },
|
|
||||||
{ xpos + w, ypos, 1.0, 1.0 },
|
|
||||||
{ xpos + w, ypos + h, 1.0, 0.0 }
|
|
||||||
};
|
|
||||||
|
|
||||||
glBindTexture(GL_TEXTURE_2D, ch.TextureID);
|
|
||||||
|
|
||||||
glBindBuffer(GL_ARRAY_BUFFER, VBO);
|
|
||||||
glBufferSubData(GL_ARRAY_BUFFER, 0, sizeof(vertices), vertices);
|
|
||||||
glBindBuffer(GL_ARRAY_BUFFER, 0);
|
|
||||||
glDrawArrays(GL_TRIANGLES, 0, 6);
|
|
||||||
penX += (ch.Advance >> 6) * scale; // Bitshift by 6 to get value in pixels (2^6 = 64)
|
|
||||||
}
|
|
||||||
glBindVertexArray(0);
|
|
||||||
glBindTexture(GL_TEXTURE_2D, 0);
|
|
||||||
|
|
||||||
GLERROR("Text rendering Error");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -35,6 +35,7 @@
|
|||||||
#include "Game/Systems/BoostSystem.h"
|
#include "Game/Systems/BoostSystem.h"
|
||||||
#include "Game/Systems/BoostIconsHUDSystem.h"
|
#include "Game/Systems/BoostIconsHUDSystem.h"
|
||||||
#include "Game/Systems/ScoreScreenSystem.h"
|
#include "Game/Systems/ScoreScreenSystem.h"
|
||||||
|
#include "Game/Systems/SpectatorCameraSystem.h"
|
||||||
#include "GUI/ButtonSystem.h"
|
#include "GUI/ButtonSystem.h"
|
||||||
#include "GUI/MainMenuSystem.h"
|
#include "GUI/MainMenuSystem.h"
|
||||||
|
|
||||||
@@ -149,6 +150,7 @@ Game::Game(int argc, char* argv[])
|
|||||||
m_SystemPipeline->AddSystem<MainMenuSystem>(updateOrderLevel, m_Renderer);
|
m_SystemPipeline->AddSystem<MainMenuSystem>(updateOrderLevel, m_Renderer);
|
||||||
m_SystemPipeline->AddSystem<BoostIconsHUDSystem>(updateOrderLevel);
|
m_SystemPipeline->AddSystem<BoostIconsHUDSystem>(updateOrderLevel);
|
||||||
m_SystemPipeline->AddSystem<ScoreScreenSystem>(updateOrderLevel);
|
m_SystemPipeline->AddSystem<ScoreScreenSystem>(updateOrderLevel);
|
||||||
|
m_SystemPipeline->AddSystem<SpectatorCameraSystem>(updateOrderLevel);
|
||||||
// Populate Octree with collidables
|
// Populate Octree with collidables
|
||||||
++updateOrderLevel;
|
++updateOrderLevel;
|
||||||
m_SystemPipeline->AddSystem<FillOctreeSystem>(updateOrderLevel, m_OctreeCollision, "Collidable");
|
m_SystemPipeline->AddSystem<FillOctreeSystem>(updateOrderLevel, m_OctreeCollision, "Collidable");
|
||||||
|
|||||||
@@ -37,7 +37,8 @@ void AmmoPickupSystem::Update(double dt)
|
|||||||
|
|
||||||
//erase the current element (somePickup)
|
//erase the current element (somePickup)
|
||||||
it = m_ETriggerTouchVector.erase(it);
|
it = m_ETriggerTouchVector.erase(it);
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
it++;
|
it++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -47,7 +48,7 @@ void AmmoPickupSystem::Update(double dt)
|
|||||||
m_PickupAtMaximum.erase(it);
|
m_PickupAtMaximum.erase(it);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (!DoesPlayerHaveMaxAmmo(it->player)) {
|
if ((int)it->player["AssaultWeapon"]["Ammo"] < (int)it->player["AssaultWeapon"]["MaxAmmo"]) {
|
||||||
DoPickup(it->player, it->trigger);
|
DoPickup(it->player, it->trigger);
|
||||||
m_PickupAtMaximum.erase(it);
|
m_PickupAtMaximum.erase(it);
|
||||||
break;
|
break;
|
||||||
@@ -55,58 +56,6 @@ void AmmoPickupSystem::Update(double dt)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
bool AmmoPickupSystem::DoesPlayerHaveMaxAmmo(EntityWrapper &player) {
|
|
||||||
PlayerClass playerClass = DetermineClass(player);
|
|
||||||
if (playerClass == PlayerClass::Defender) {
|
|
||||||
return !((int)player["DefenderWeapon"]["Ammo"] < (int)player["DefenderWeapon"]["MaxAmmo"]);
|
|
||||||
} else if (playerClass == PlayerClass::Sniper) {
|
|
||||||
return !((int)player["SniperWeapon"]["Ammo"] < (int)player["SniperWeapon"]["MaxAmmo"]);
|
|
||||||
} else if (playerClass == PlayerClass::Assault) {
|
|
||||||
return !((int)player["AssaultWeapon"]["Ammo"] < (int)player["AssaultWeapon"]["MaxAmmo"]);
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
void AmmoPickupSystem::SetPlayerAmmo(EntityWrapper &player, int ammoGain) {
|
|
||||||
int maxWeaponAmmo = GetPlayerMaxAmmo(player);
|
|
||||||
|
|
||||||
PlayerClass playerClass = DetermineClass(player);
|
|
||||||
if (playerClass == PlayerClass::Defender) {
|
|
||||||
(int&)player["DefenderWeapon"]["Ammo"] = std::min((int)player["DefenderWeapon"]["Ammo"] + ammoGain, maxWeaponAmmo);
|
|
||||||
} else if (playerClass == PlayerClass::Sniper) {
|
|
||||||
(int&)player["SniperWeapon"]["Ammo"] = std::min((int)player["SniperWeapon"]["Ammo"] + ammoGain, maxWeaponAmmo);
|
|
||||||
} else if (playerClass == PlayerClass::Assault) {
|
|
||||||
(int&)player["AssaultWeapon"]["Ammo"] = std::min((int)player["AssaultWeapon"]["Ammo"] + ammoGain, maxWeaponAmmo);
|
|
||||||
} else {
|
|
||||||
//unknown class - ignore
|
|
||||||
}
|
|
||||||
}
|
|
||||||
int AmmoPickupSystem::GetPlayerMaxAmmo(EntityWrapper &player) {
|
|
||||||
PlayerClass playerClass = DetermineClass(player);
|
|
||||||
if (playerClass == PlayerClass::Defender) {
|
|
||||||
return (int)player["DefenderWeapon"]["MaxAmmo"];
|
|
||||||
} else if (playerClass == PlayerClass::Sniper) {
|
|
||||||
return (int)player["SniperWeapon"]["MaxAmmo"];
|
|
||||||
} else if (playerClass == PlayerClass::Assault) {
|
|
||||||
return (int)player["AssaultWeapon"]["MaxAmmo"];
|
|
||||||
} else {
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
AmmoPickupSystem::PlayerClass AmmoPickupSystem::DetermineClass(EntityWrapper &player)
|
|
||||||
{
|
|
||||||
//determine the class based on what component the inflictor-player has
|
|
||||||
if (m_World->HasComponent(player.ID, "DashAbility")) {
|
|
||||||
return PlayerClass::Assault;
|
|
||||||
}
|
|
||||||
if (m_World->HasComponent(player.ID, "ShieldAbility")) {
|
|
||||||
return PlayerClass::Defender;
|
|
||||||
}
|
|
||||||
if (m_World->HasComponent(player.ID, "SprintAbility")) {
|
|
||||||
return PlayerClass::Sniper;
|
|
||||||
}
|
|
||||||
return PlayerClass::None;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool AmmoPickupSystem::OnTriggerTouch(Events::TriggerTouch& e)
|
bool AmmoPickupSystem::OnTriggerTouch(Events::TriggerTouch& e)
|
||||||
{
|
{
|
||||||
@@ -114,7 +63,7 @@ bool AmmoPickupSystem::OnTriggerTouch(Events::TriggerTouch& e)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
//TODO: add other weapontypes
|
//TODO: add other weapontypes
|
||||||
if (DetermineClass(e.Entity) == PlayerClass::None) {
|
if (!e.Entity.HasComponent("AssaultWeapon")) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!e.Trigger.HasComponent("AmmoPickup")) {
|
if (!e.Trigger.HasComponent("AmmoPickup")) {
|
||||||
@@ -122,7 +71,7 @@ bool AmmoPickupSystem::OnTriggerTouch(Events::TriggerTouch& e)
|
|||||||
}
|
}
|
||||||
|
|
||||||
//if at maxammo, save the trigger-touch to a vector since standing inside it will not re-trigger the trigger
|
//if at maxammo, save the trigger-touch to a vector since standing inside it will not re-trigger the trigger
|
||||||
if (DoesPlayerHaveMaxAmmo(e.Entity)) {
|
if ((int)e.Entity["AssaultWeapon"]["Ammo"] >= (int)e.Entity["AssaultWeapon"]["MaxAmmo"]) {
|
||||||
m_PickupAtMaximum.push_back({ e.Entity, e.Trigger });
|
m_PickupAtMaximum.push_back({ e.Entity, e.Trigger });
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -136,16 +85,19 @@ bool AmmoPickupSystem::OnAmmoPickup(Events::AmmoPickup & e)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
//TODO: add other weapontypes
|
//TODO: add other weapontypes
|
||||||
if (DetermineClass(e.Player) == PlayerClass::None) {
|
if (!e.Player.HasComponent("AssaultWeapon")) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
int maxWeaponAmmo = (int)e.Player["AssaultWeapon"]["MaxAmmo"];
|
||||||
|
int& currentAmmo = (int)e.Player["AssaultWeapon"]["Ammo"];
|
||||||
//cant pick up ammopacks if you are already at MaxAmmo
|
//cant pick up ammopacks if you are already at MaxAmmo
|
||||||
if (DoesPlayerHaveMaxAmmo(e.Player)) {
|
if (currentAmmo >= maxWeaponAmmo) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
SetPlayerAmmo(e.Player, e.AmmoGain);
|
|
||||||
|
|
||||||
return true;
|
currentAmmo = std::min(currentAmmo + e.AmmoGain, maxWeaponAmmo);
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool AmmoPickupSystem::OnTriggerLeave(Events::TriggerLeave& e) {
|
bool AmmoPickupSystem::OnTriggerLeave(Events::TriggerLeave& e) {
|
||||||
@@ -167,7 +119,7 @@ void AmmoPickupSystem::DoPickup(EntityWrapper &player, EntityWrapper &trigger) {
|
|||||||
if (!trigger.Valid()) {
|
if (!trigger.Valid()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
int maxWeaponAmmo = GetPlayerMaxAmmo(player);
|
int maxWeaponAmmo = (int)player["AssaultWeapon"]["MaxAmmo"];
|
||||||
int ammoGiven = 0.01*(double)trigger["AmmoPickup"]["AmmoGain"] * maxWeaponAmmo;
|
int ammoGiven = 0.01*(double)trigger["AmmoPickup"]["AmmoGain"] * maxWeaponAmmo;
|
||||||
|
|
||||||
Events::AmmoPickup ePlayerAmmoPickup;
|
Events::AmmoPickup ePlayerAmmoPickup;
|
||||||
|
|||||||
@@ -1,10 +1,12 @@
|
|||||||
#include "Systems/PlayerDeathSystem.h"
|
#include "Systems/PlayerDeathSystem.h"
|
||||||
|
#include "Core/ELockMouse.h"
|
||||||
|
|
||||||
PlayerDeathSystem::PlayerDeathSystem(SystemParams params)
|
PlayerDeathSystem::PlayerDeathSystem(SystemParams params)
|
||||||
: System(params)
|
: System(params)
|
||||||
{
|
{
|
||||||
EVENT_SUBSCRIBE_MEMBER(m_OnPlayerDeath, &PlayerDeathSystem::OnPlayerDeath);
|
EVENT_SUBSCRIBE_MEMBER(m_OnPlayerDeath, &PlayerDeathSystem::OnPlayerDeath);
|
||||||
EVENT_SUBSCRIBE_MEMBER(m_EEntityDeleted, &PlayerDeathSystem::OnEntityDeleted);
|
EVENT_SUBSCRIBE_MEMBER(m_EEntityDeleted, &PlayerDeathSystem::OnEntityDeleted);
|
||||||
|
EVENT_SUBSCRIBE_MEMBER(m_EInputCommand, &PlayerDeathSystem::OnInputCommand);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PlayerDeathSystem::Update(double dt)
|
void PlayerDeathSystem::Update(double dt)
|
||||||
@@ -33,10 +35,10 @@ void PlayerDeathSystem::createDeathEffect(EntityWrapper player)
|
|||||||
|
|
||||||
//components that we need from player
|
//components that we need from player
|
||||||
auto playerModel = player.FirstChildByName("PlayerModel");
|
auto playerModel = player.FirstChildByName("PlayerModel");
|
||||||
if (!playerModel.Valid()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!playerModel.HasComponent("Model") || !playerModel.HasComponent("Animation")) {
|
if (!playerModel.HasComponent("Model") || !playerModel.HasComponent("Animation")) {
|
||||||
|
if (player == LocalPlayer) {
|
||||||
|
setSpectatorCamera();
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
auto playerEntityModel = playerModel["Model"];
|
auto playerEntityModel = playerModel["Model"];
|
||||||
@@ -68,14 +70,35 @@ bool PlayerDeathSystem::OnEntityDeleted(Events::EntityDeleted& e)
|
|||||||
if (m_LocalPlayerDeathEffect.ID != e.DeletedEntity) {
|
if (m_LocalPlayerDeathEffect.ID != e.DeletedEntity) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If the player hasn't spawned already, activate the spectator camera.
|
||||||
|
if (!LocalPlayer.Valid()) {
|
||||||
|
setSpectatorCamera();
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void PlayerDeathSystem::setSpectatorCamera()
|
||||||
|
{
|
||||||
// Look for the spectator camera entity in the level.
|
// Look for the spectator camera entity in the level.
|
||||||
EntityWrapper spectatorCam = m_World->GetFirstEntityByName("SpectatorCamera");
|
EntityWrapper spectatorCam = m_World->GetFirstEntityByName("SpectatorCamera");
|
||||||
if (!spectatorCam.Valid() || !spectatorCam.HasComponent("Camera") || LocalPlayer.Valid()) {
|
if (!spectatorCam.HasComponent("Camera")) {
|
||||||
return false;
|
return;
|
||||||
}
|
}
|
||||||
Events::SetCamera eSetCamera;
|
Events::SetCamera eSetCamera;
|
||||||
eSetCamera.CameraEntity = spectatorCam;
|
eSetCamera.CameraEntity = spectatorCam;
|
||||||
m_EventBroker->Publish(eSetCamera);
|
m_EventBroker->Publish(eSetCamera);
|
||||||
return true;
|
Events::UnlockMouse unlock;
|
||||||
|
m_EventBroker->Publish(unlock);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool PlayerDeathSystem::OnInputCommand(Events::InputCommand& e)
|
||||||
|
{
|
||||||
|
if (e.Value == 0 || e.Command != "SwapToTeamPick" && e.Command != "SwapToClassPick") {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Ensure that we don't set spectator camera if the player deliberately changes to class/team pick.
|
||||||
|
m_LocalPlayerDeathEffect = EntityWrapper::Invalid;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
#include "Systems/PlayerSpawnSystem.h"
|
#include "Systems/PlayerSpawnSystem.h"
|
||||||
|
#include "Core/ELockMouse.h"
|
||||||
|
|
||||||
PlayerSpawnSystem::PlayerSpawnSystem(SystemParams params)
|
PlayerSpawnSystem::PlayerSpawnSystem(SystemParams params)
|
||||||
: System(params)
|
: System(params)
|
||||||
@@ -59,7 +60,15 @@ void PlayerSpawnSystem::Update(double dt)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int numSpawnedPlayers = 0;
|
int numSpawnedPlayers = 0;
|
||||||
for (auto& req : m_SpawnRequests) {
|
int playersSpectating = 0;
|
||||||
|
const int numRequestsToHandle = (int)m_SpawnRequests.size();
|
||||||
|
for (auto it = m_SpawnRequests.begin(); it != m_SpawnRequests.end(); ++it) {
|
||||||
|
// It is valid if they didn't pick class yet
|
||||||
|
// but don't spawn anything, goto next spawnrequest.
|
||||||
|
if (it->Class == PlayerClass::None) {
|
||||||
|
++playersSpectating;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
for (auto& cPlayerSpawn : *playerSpawns) {
|
for (auto& cPlayerSpawn : *playerSpawns) {
|
||||||
EntityWrapper spawner(m_World, cPlayerSpawn.EntityID);
|
EntityWrapper spawner(m_World, cPlayerSpawn.EntityID);
|
||||||
if (!spawner.HasComponent("Spawner")) {
|
if (!spawner.HasComponent("Spawner")) {
|
||||||
@@ -69,43 +78,49 @@ void PlayerSpawnSystem::Update(double dt)
|
|||||||
// If the spawner has a team affiliation, check it
|
// If the spawner has a team affiliation, check it
|
||||||
if (spawner.HasComponent("Team")) {
|
if (spawner.HasComponent("Team")) {
|
||||||
auto cSpawnerTeam = spawner["Team"];
|
auto cSpawnerTeam = spawner["Team"];
|
||||||
if ((int)cSpawnerTeam["Team"] != req.Team) {
|
if ((int)cSpawnerTeam["Team"] != it->Team) {
|
||||||
// Increase num spawned players if someone picks spectator, since it is valid to pick spectator
|
// If they somehow has a valid class as spectator, don't spawn them.
|
||||||
// but don't spawn anything, goto next spawnrequest.
|
if (it->Team == cSpawnerTeam["Team"].Enum("Spectator")) {
|
||||||
if (req.Team == (int)cSpawnerTeam["Team"].Enum("Spectator")) {
|
++playersSpectating;
|
||||||
++numSpawnedPlayers;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: Choose a different spawner depending on class picked?
|
||||||
|
|
||||||
// Spawn the player!
|
// Spawn the player!
|
||||||
EntityWrapper player = SpawnerSystem::Spawn(spawner, EntityWrapper::Invalid, "Player");
|
EntityWrapper player = SpawnerSystem::Spawn(spawner, EntityWrapper::Invalid, "Player");
|
||||||
// Set the player team affiliation
|
// Set the player team affiliation
|
||||||
player["Team"]["Team"] = req.Team;
|
player["Team"]["Team"] = it->Team;
|
||||||
|
|
||||||
// Publish a PlayerSpawned event
|
// Publish a PlayerSpawned event
|
||||||
Events::PlayerSpawned e;
|
Events::PlayerSpawned e;
|
||||||
e.PlayerID = req.PlayerID;
|
e.PlayerID = it->PlayerID;
|
||||||
e.Player = player;
|
e.Player = player;
|
||||||
e.Spawner = spawner;
|
e.Spawner = spawner;
|
||||||
m_EventBroker->Publish(e);
|
m_EventBroker->Publish(e);
|
||||||
++numSpawnedPlayers;
|
++numSpawnedPlayers;
|
||||||
|
it = m_SpawnRequests.erase(it);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (it == m_SpawnRequests.end()) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (numSpawnedPlayers != (int)m_SpawnRequests.size()) {
|
if (numSpawnedPlayers != numRequestsToHandle - playersSpectating) {
|
||||||
LOG_DEBUG("%i players were supposed to be spawned or set as spectator, but only %i was handled.", (int)m_SpawnRequests.size(), numSpawnedPlayers);
|
LOG_DEBUG("%i players were supposed to be spawned, but only %i was successfully.", numRequestsToHandle - playersSpectating, numSpawnedPlayers);
|
||||||
} else {
|
} else {
|
||||||
LOG_DEBUG("%i players were spawned or set as spectator.", numSpawnedPlayers);
|
std::string dbg = numSpawnedPlayers != 0 ? std::to_string(numSpawnedPlayers) + " players were spawned. " : "";
|
||||||
|
dbg += playersSpectating != 0 ? std::to_string(playersSpectating) + " players are spectating/picking class. " : "";
|
||||||
|
LOG_DEBUG(dbg.c_str());
|
||||||
}
|
}
|
||||||
m_SpawnRequests.clear();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool PlayerSpawnSystem::OnInputCommand(Events::InputCommand& e)
|
bool PlayerSpawnSystem::OnInputCommand(Events::InputCommand& e)
|
||||||
{
|
{
|
||||||
if (e.Command != "PickTeam" && e.Command != "SwapToClassPick") {
|
if (e.Command != "PickTeam" && e.Command != "PickClass" && e.Command != "SwapToTeamPick" && e.Command != "SwapToClassPick") {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -113,19 +128,6 @@ bool PlayerSpawnSystem::OnInputCommand(Events::InputCommand& e)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// A dead client should be able to swap to the overwatch camera.
|
|
||||||
if (IsClient && !LocalPlayer.Valid()) {
|
|
||||||
// Set the camera as active, if it exists.
|
|
||||||
// Find the respawn camera or class pick camera.
|
|
||||||
std::string camName = e.Command == "SwapToClassPick" ? "PickClassCamera" : "SpectatorCamera";
|
|
||||||
EntityWrapper spectatorCam = m_World->GetFirstEntityByName(camName);
|
|
||||||
if (spectatorCam.Valid() && spectatorCam.HasComponent("Camera")) {
|
|
||||||
Events::SetCamera eSetCamera;
|
|
||||||
eSetCamera.CameraEntity = spectatorCam;
|
|
||||||
m_EventBroker->Publish(eSetCamera);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Team picks should be processed ONLY server-side!
|
// Team picks should be processed ONLY server-side!
|
||||||
// Don't make a spawn request if we're the client.
|
// Don't make a spawn request if we're the client.
|
||||||
if (!IsServer && m_NetworkEnabled) {
|
if (!IsServer && m_NetworkEnabled) {
|
||||||
@@ -136,27 +138,38 @@ bool PlayerSpawnSystem::OnInputCommand(Events::InputCommand& e)
|
|||||||
auto iter = m_SpawnRequests.begin();
|
auto iter = m_SpawnRequests.begin();
|
||||||
for (; iter != m_SpawnRequests.end(); ++iter) {
|
for (; iter != m_SpawnRequests.end(); ++iter) {
|
||||||
if (iter->PlayerID == e.PlayerID) {
|
if (iter->PlayerID == e.PlayerID) {
|
||||||
// If player wants to switch class, remove their spawn request.
|
// If player wants to switch team or class , remove their selected class so they don't spawn.
|
||||||
if (e.Command == "SwapToClassPick") {
|
if (e.Command == "SwapToTeamPick" || e.Command == "SwapToClassPick") {
|
||||||
m_SpawnRequests.erase(iter);
|
iter->Class = PlayerClass::None;
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (e.Command == "SwapToClassPick") {
|
//If we get here we got a PickTeam or PickClass, so add or alter a spawn request.
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (iter != m_SpawnRequests.end()) {
|
if (iter != m_SpawnRequests.end()) {
|
||||||
// If player is in queue to spawn, then change their team affiliation in the request.
|
// If player is in queue to spawn, then change their team affiliation or class in the request.
|
||||||
iter->Team = (ComponentInfo::EnumType)e.Value;
|
if (e.Command == "PickTeam") {
|
||||||
|
iter->Team = (ComponentInfo::EnumType)e.Value;
|
||||||
|
} else {
|
||||||
|
iter->Class = static_cast<PlayerClass>((int)e.Value);
|
||||||
|
}
|
||||||
} else if (m_PlayerEntities.count(e.PlayerID) == 0 || !m_PlayerEntities[e.PlayerID].Valid()) {
|
} else if (m_PlayerEntities.count(e.PlayerID) == 0 || !m_PlayerEntities[e.PlayerID].Valid()) {
|
||||||
// If player is not in queue to spawn, then create a spawn request,
|
// If player is not in queue to spawn, then create a spawn request,
|
||||||
// but only if they are spectating and/or just connected.
|
// but only if they are spectating and/or just connected.
|
||||||
SpawnRequest req;
|
SpawnRequest req;
|
||||||
req.PlayerID = e.PlayerID;
|
req.PlayerID = e.PlayerID;
|
||||||
req.Team = (ComponentInfo::EnumType)e.Value;
|
if (e.Command == "PickTeam") {
|
||||||
|
req.Team = (ComponentInfo::EnumType)e.Value;
|
||||||
|
req.Class = PlayerClass::None;
|
||||||
|
} else {
|
||||||
|
// Should never get here, since you should have picked a team before you ever get a chance to pick class.
|
||||||
|
LOG_WARNING("Sequence error: Should not be able to pick class before team");
|
||||||
|
req.Team = 1; // TODO: 1 Signifies spectator, should probably have real enum here later.
|
||||||
|
req.Class = static_cast<PlayerClass>((int)e.Value);
|
||||||
|
}
|
||||||
m_SpawnRequests.push_back(req);
|
m_SpawnRequests.push_back(req);
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
@@ -191,6 +204,8 @@ bool PlayerSpawnSystem::OnPlayerSpawned(Events::PlayerSpawned& e)
|
|||||||
Events::SetCamera e;
|
Events::SetCamera e;
|
||||||
e.CameraEntity = cameraEntity;
|
e.CameraEntity = cameraEntity;
|
||||||
m_EventBroker->Publish(e);
|
m_EventBroker->Publish(e);
|
||||||
|
Events::LockMouse lock;
|
||||||
|
m_EventBroker->Publish(lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
// HACK: Set the player model color to team color
|
// HACK: Set the player model color to team color
|
||||||
@@ -210,7 +225,7 @@ bool PlayerSpawnSystem::OnPlayerSpawned(Events::PlayerSpawned& e)
|
|||||||
|
|
||||||
bool PlayerSpawnSystem::OnPlayerDeath(Events::PlayerDeath& e)
|
bool PlayerSpawnSystem::OnPlayerDeath(Events::PlayerDeath& e)
|
||||||
{
|
{
|
||||||
//Only spawn request if network is disabled or we are server.
|
// Only spawn request if network is disabled or we are server.
|
||||||
if (!IsServer && m_NetworkEnabled) {
|
if (!IsServer && m_NetworkEnabled) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -218,10 +233,6 @@ bool PlayerSpawnSystem::OnPlayerDeath(Events::PlayerDeath& e)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
ComponentWrapper cTeam = e.Player["Team"];
|
ComponentWrapper cTeam = e.Player["Team"];
|
||||||
//A spectator can't die anyway
|
|
||||||
if ((ComponentInfo::EnumType)cTeam["Team"] == cTeam["Team"].Enum("Spectator")) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (m_PlayerIDs.count(e.Player.ID) == 0) {
|
if (m_PlayerIDs.count(e.Player.ID) == 0) {
|
||||||
return false;
|
return false;
|
||||||
@@ -230,6 +241,16 @@ bool PlayerSpawnSystem::OnPlayerDeath(Events::PlayerDeath& e)
|
|||||||
SpawnRequest req;
|
SpawnRequest req;
|
||||||
req.PlayerID = m_PlayerIDs.at(e.Player.ID);
|
req.PlayerID = m_PlayerIDs.at(e.Player.ID);
|
||||||
req.Team = cTeam["Team"];
|
req.Team = cTeam["Team"];
|
||||||
|
// TODO: Something better than temp class state code, if we ever add class enums in .xml
|
||||||
|
if (e.Player.HasComponent("DashAbility")) {
|
||||||
|
req.Class = PlayerClass::Assault;
|
||||||
|
} else if (e.Player.HasComponent("SprintAbility")) {
|
||||||
|
req.Class = PlayerClass::Sniper;
|
||||||
|
} else if (e.Player.HasComponent("ShieldAbility")) {
|
||||||
|
req.Class = PlayerClass::Defender;
|
||||||
|
} else {
|
||||||
|
req.Class = PlayerClass::None;
|
||||||
|
}
|
||||||
m_SpawnRequests.push_back(req);
|
m_SpawnRequests.push_back(req);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -0,0 +1,90 @@
|
|||||||
|
#include "Systems/SpectatorCameraSystem.h"
|
||||||
|
#include "Rendering/ESetCamera.h"
|
||||||
|
#include "Core/ELockMouse.h"
|
||||||
|
|
||||||
|
SpectatorCameraSystem::SpectatorCameraSystem(SystemParams params)
|
||||||
|
: System(params)
|
||||||
|
, m_CamSetToTeamPick(false)
|
||||||
|
, m_PickedTeam(-1)
|
||||||
|
{
|
||||||
|
EVENT_SUBSCRIBE_MEMBER(m_EInputCommand, &SpectatorCameraSystem::OnInputCommand);
|
||||||
|
}
|
||||||
|
|
||||||
|
void SpectatorCameraSystem::Update(double dt)
|
||||||
|
{
|
||||||
|
if (!m_CamSetToTeamPick && IsClient) {
|
||||||
|
// Find the class pick camera and set them to it, since they need to pick a team before they can leave the screen.
|
||||||
|
EntityWrapper spectatorCam = m_World->GetFirstEntityByName("PickTeamCamera");
|
||||||
|
if (spectatorCam.HasComponent("Camera")) {
|
||||||
|
m_CamSetToTeamPick = true;
|
||||||
|
Events::SetCamera eSetCamera;
|
||||||
|
eSetCamera.CameraEntity = spectatorCam;
|
||||||
|
m_EventBroker->Publish(eSetCamera);
|
||||||
|
Events::UnlockMouse unlock;
|
||||||
|
m_EventBroker->Publish(unlock);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool SpectatorCameraSystem::OnInputCommand(const Events::InputCommand& e)
|
||||||
|
{
|
||||||
|
// Only the client should do this, and only if player is not spawned.
|
||||||
|
if (!IsClient || LocalPlayer.Valid()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
bool swapToClass = e.Command == "PickTeam" || e.Command == "SwapToClassPick";
|
||||||
|
if (e.Value == 0 || !swapToClass && e.Command != "SwapToTeamPick" && e.Command != "PickClass") {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (e.Command == "PickTeam") {
|
||||||
|
m_PickedTeam = e.Value;
|
||||||
|
}
|
||||||
|
|
||||||
|
// If a team has not been picked, they may not exit the pick team screen.
|
||||||
|
if (m_PickedTeam == -1) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// A dead client should be able to swap to and between the overwatch cameras.
|
||||||
|
std::string camName;
|
||||||
|
// TODO: 1 Signifies spectator, should probably have real enum here later.
|
||||||
|
// Spectators should never end up at the class select, instead put them at the SpectatorCamera.
|
||||||
|
if (swapToClass && m_PickedTeam != 1) {
|
||||||
|
camName = "PickClassCamera";
|
||||||
|
} else if (e.Command == "SwapToTeamPick") {
|
||||||
|
camName = "PickTeamCamera";
|
||||||
|
} else {
|
||||||
|
camName = "SpectatorCamera";
|
||||||
|
}
|
||||||
|
EntityWrapper spectatorCam = m_World->GetFirstEntityByName(camName);
|
||||||
|
// Set the camera as active, if it exists.
|
||||||
|
if (spectatorCam.HasComponent("Camera")) {
|
||||||
|
// Set the class pick button visible if a blue or red team is picked, else invisible.
|
||||||
|
EntityWrapper HUD;
|
||||||
|
if (camName == "SpectatorCamera") {
|
||||||
|
HUD = spectatorCam.FirstChildByName("SpectatorHUD");
|
||||||
|
} else if (camName == "PickTeamCamera") {
|
||||||
|
HUD = spectatorCam.FirstChildByName("PickTeamHUD");
|
||||||
|
}
|
||||||
|
// If we are at the class pick already, or if HUD is invalid for any other reason, do nothing.
|
||||||
|
if (HUD.Valid()) {
|
||||||
|
EntityWrapper toClassButton = spectatorCam.FirstChildByName("ToClassPick");
|
||||||
|
if (toClassButton.Valid()) {
|
||||||
|
// Set ClassButton as invisible if spectator, else visible.
|
||||||
|
bool visible = m_PickedTeam != 1; // TODO: 1 Signifies spectator.
|
||||||
|
toClassButton["Sprite"]["Visible"] = visible;
|
||||||
|
for (auto& child : toClassButton.ChildrenWithComponent("Text")) {
|
||||||
|
child["Text"]["Visible"] = visible;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Events::SetCamera eSetCamera;
|
||||||
|
eSetCamera.CameraEntity = spectatorCam;
|
||||||
|
m_EventBroker->Publish(eSetCamera);
|
||||||
|
Events::UnlockMouse unlock;
|
||||||
|
m_EventBroker->Publish(unlock);
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user