From 06614aa9078f3facedcf1ea02d9dc9e39b612d92 Mon Sep 17 00:00:00 2001 From: William Moberg Date: Fri, 4 Mar 2016 05:41:29 +0100 Subject: [PATCH 01/10] SpectatorCameraSystem handles the overwatch cameras. Set camera to a class pick screen when connecting. Cannot spawn until both team and class has been picked. Preparations for class aware PlayerSpawnSystem. --- include/Game/Systems/PlayerSpawnSystem.h | 1 + include/Game/Systems/SpectatorCameraSystem.h | 22 + resources/DefaultInput.ini | 3 +- .../Schema/Entities/NewMapWSpectatorCam.xml | 3473 +++++++++-------- resources/Schema/Entities/OverwatchCamera.xml | 99 +- src/Game/Game.cpp | 2 + src/Game/Systems/PlayerSpawnSystem.cpp | 71 +- src/Game/Systems/SpectatorCameraSystem.cpp | 66 + 8 files changed, 1995 insertions(+), 1742 deletions(-) create mode 100644 include/Game/Systems/SpectatorCameraSystem.h create mode 100644 src/Game/Systems/SpectatorCameraSystem.cpp diff --git a/include/Game/Systems/PlayerSpawnSystem.h b/include/Game/Systems/PlayerSpawnSystem.h index 70f94807..17364a81 100644 --- a/include/Game/Systems/PlayerSpawnSystem.h +++ b/include/Game/Systems/PlayerSpawnSystem.h @@ -19,6 +19,7 @@ private: { int PlayerID; ComponentInfo::EnumType Team; + ComponentInfo::EnumType Class; }; bool m_NetworkEnabled = false; diff --git a/include/Game/Systems/SpectatorCameraSystem.h b/include/Game/Systems/SpectatorCameraSystem.h new file mode 100644 index 00000000..5a00279b --- /dev/null +++ b/include/Game/Systems/SpectatorCameraSystem.h @@ -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 m_EInputCommand; + bool OnInputCommand(const Events::InputCommand& e); +}; + +#endif \ No newline at end of file diff --git a/resources/DefaultInput.ini b/resources/DefaultInput.ini index b47c1e9b..18fb943f 100644 --- a/resources/DefaultInput.ini +++ b/resources/DefaultInput.ini @@ -28,4 +28,5 @@ P=SwitchToPlayer K=TakeDamage,1500 F2=PerformanceTimingResetAllTimers F3=PerformanceTimingCreateExcelData -F4=SwapToClassPick \ No newline at end of file +Comma=SwapToClassPick +Period=SwapToTeamPick \ No newline at end of file diff --git a/resources/Schema/Entities/NewMapWSpectatorCam.xml b/resources/Schema/Entities/NewMapWSpectatorCam.xml index 395eb1de..2305c008 100644 --- a/resources/Schema/Entities/NewMapWSpectatorCam.xml +++ b/resources/Schema/Entities/NewMapWSpectatorCam.xml @@ -23,6 +23,18 @@ + + + + + Models/Props/Highground2.mesh + + + + + + + @@ -75,18 +87,6 @@ - - - - - Models/Props/Highground2.mesh - - - - - - - @@ -1843,6 +1843,1006 @@ + + + + + + + + + + Models/Props/Stones/ShinyStoneCrystalRed.mesh + + + + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + + + + + + Models/Props/Stones/SmallStone2.mesh + + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/SmallStone2.mesh + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/SmallStone2.mesh + + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + + + Models/Props/Stones/SmallStone2.mesh + + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + + + + + Models/Props/Stones/SmallStone2.mesh + + + + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + + + Models/Props/Stones/MediumStone1.mesh + + + + + + + + + + + + + + Models/Props/Stones/MediumStone1.mesh + + + + + + + + + + + + + + Models/Props/Stones/SmallStone2.mesh + + + + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + + + + + + Models/Props/Stones/MediumStone1.mesh + + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/ShinyStoneCrystalRed.mesh + + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/SmallStone2.mesh + + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + Models/Props/Stones/MediumStone1.mesh + + + + + + + + + + + + + Models/Props/Stones/MediumStone1.mesh + + + + + + + + + + + + + + + Models/Props/Walls/MediumWall1.mesh + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/MediumStone1.mesh + + + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + + + + + Models/Props/Stones/ShinyStoneCrystalRed.mesh + + + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + + Models/Props/Stones/SmallStone2.mesh + + + + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + @@ -3229,88 +4229,6 @@ - - - - - Models/Props/Stones/AssaultHolder.mesh - - - - - - - - - - - - - - Models/Props/Stones/AssaultHolder.mesh - - - - - - - - - - - - - - Models/Props/Stones/AssaultHolder.mesh - - - - - - - - - - - - Models/Props/Stones/AssaultHolder.mesh - - - - - - - - - - - - - - - Models/Props/Stones/AssaultHolder.mesh - - - - - - - - - - - - Models/Props/Stones/AssaultHolder.mesh - - - - - - - - - - @@ -3366,6 +4284,60 @@ + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + @@ -3380,6 +4352,34 @@ + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + @@ -3396,1011 +4396,24 @@ - - - - - - - - - - Models/Props/Stones/SmallStone1.mesh - - - - - - - - - - - - - - Models/Props/Stones/BigStone.mesh - - - - - - - - - - - - Models/Props/Stones/BigStone.mesh - - - - - - - - - - - - - - - - Models/Props/Stones/SmallStone1.mesh - - - - - - - - - - - - - - Models/Props/Stones/MediumStone1.mesh - - - - - - - - - - - - - - Models/Props/Stones/BigStone.mesh - - - - - - - - - - - - - Models/Props/Stones/BigStone.mesh - - - - - - - - - - - Models/Props/Stones/BigStone.mesh - - - - - - - - - - - - - Models/Props/Stones/BigStone.mesh - - - - - - - - - - - - - Models/Props/Stones/SmallStone1.mesh - - - - - - - - - - - - - - Models/Props/Stones/BigStone.mesh - - - - - - - - - - - - - Models/Props/Stones/BigStone.mesh - - - - - - - - - - - - - - - Models/Props/Stones/BigStone.mesh - - - - - - - - - - - - - Models/Props/Stones/SmallStone2.mesh - - - - - - - - - - - - - - Models/Props/Stones/ShinyStoneCrystalRed.mesh - - - - - - - - - - - - - - Models/Props/Stones/MediumStone1.mesh - - - - - - - - - - - - - - Models/Props/Stones/BigStone.mesh - - - - - - - - - - - - - Models/Props/Stones/MediumStone2.mesh - - - - - - - - - - - - - - Models/Props/Stones/SmallStone2.mesh - - - - - - - - - - - - - - Models/Props/Stones/MediumStone1.mesh - - - - - - - - - - - - - - Models/Props/Stones/BigStone.mesh - - - - - - - - - - - - Models/Props/Stones/MediumStone1.mesh - - - - - - - - - - - - - Models/Props/Stones/MediumStone1.mesh - - - - - - - - - - - - - - - Models/Props/Stones/BigStone.mesh - - - - - - - - - - - - Models/Props/Stones/BigStone.mesh - - - - - - - - - - - - - - Models/Props/Stones/BigStone.mesh - - - - - - - - - - - - - - - Models/Props/Walls/MediumWall1.mesh - - - - - - - - - - - - Models/Props/Stones/MediumStone2.mesh - - - - - - - - - - - - - Models/Props/Stones/MediumStone2.mesh - - - - - - - - - - - - - Models/Props/Stones/BigStone.mesh - - - - - - - - - - - - - Models/Props/Stones/MediumStone2.mesh - - - - - - - - - - - - Models/Props/Stones/SmallStone1.mesh - - - - - - - - - - - - - - Models/Props/Stones/MediumStone2.mesh - - - - - - - - - - - - - - - Models/Props/Stones/SmallStone1.mesh - - - - - - - - - - - - - Models/Props/Stones/MediumStone2.mesh - - - - - - - - - - - - - Models/Props/Stones/SmallStone2.mesh - - - - - - - - - - - - - Models/Props/Stones/BigStone.mesh - - - - - - - - - - - - - Models/Props/Stones/SmallStone2.mesh - - - - - - - - - - - - - - Models/Props/Stones/MediumStone1.mesh - - - - - - - - - - - - - - Models/Props/Stones/SmallStone2.mesh - - - - - - - - - - - - - - Models/Props/Stones/MediumStone2.mesh - - - - - - - - - - - - - Models/Props/Stones/BigStone.mesh - - - - - - - - - - - - - Models/Props/Stones/MediumStone2.mesh - - - - - - - - - - - - - - Models/Props/Stones/MediumStone2.mesh - - - - - - - - - - - - - - Models/Props/Stones/BigStone.mesh - - - - - - - - - - - - - Models/Props/Stones/SmallStone2.mesh - - - - - - - - - - - - - - Models/Props/Stones/BigStone.mesh - - - - - - - - - - - - - Models/Props/Stones/ShinyStoneCrystalRed.mesh - - - - - - - - - - - - - - Models/Props/Stones/MediumStone2.mesh - - - - - - - - - - - - - - Models/Props/Stones/BigStone.mesh - - - - - - - - - - - - - - Models/Props/Stones/BigStone.mesh - - - - - - - - - - - - - Models/Props/Stones/SmallStone1.mesh - - - - - - - - - - - - - - Models/Props/Stones/BigStone.mesh - - - - - - - - - - - - Models/Props/Stones/BigStone.mesh - - - - - - - - - - - - Models/Props/Stones/BigStone.mesh - - - - - - - - - - - - - - - Models/Props/Stones/BigStone.mesh - - - - - - - - - - - - - Models/Props/Stones/BigStone.mesh - - - - - - - - - - - - - Models/Props/Stones/BigStone.mesh - - - - - - - - - - - - - Models/Props/Stones/MediumStone2.mesh - - - - - - - - - - - - - - - - Models/Props/Stones/BigStone.mesh - - - - - - - - - - - - Models/Props/Stones/ShinyStoneCrystalRed.mesh - - - - - - - - - - - - - - Models/Props/Stones/SmallStone1.mesh - - - - - - - - - - - - - - Models/Props/Stones/MediumStone2.mesh - - - - - - - - - - - - Models/Props/Stones/SmallStone1.mesh - - - - - - - - - - - - - - - - - - Models/Props/Stones/SmallStone1.mesh - - - - - - - - - - - - - - Models/Props/Stones/SmallStone1.mesh - - - - - - - - - - - - - Models/Props/Stones/MediumStone2.mesh - - - - - - - - - - - - - Models/Props/Stones/SmallStone1.mesh - - - - - - - - - - - - - Models/Props/Stones/SmallStone2.mesh - - - - - - - - - - - - - - - - Models/Props/Stones/SmallStone1.mesh - - - - - - - - - - - - - - - - Models/Props/Stones/MediumStone2.mesh - - - - - - - - - - - - - - Models/Props/Stones/MediumStone2.mesh - - - - - - - - - - - - - - Models/Props/Stones/SmallStone2.mesh - - - - - - - - - - - + + + + + Models/Props/SciFiHolder1.mesh + + + + + + + + @@ -4479,19 +4492,6 @@ - - - - - Models/Props/SciFiHolder1.mesh - - - - - - - - @@ -4519,35 +4519,8 @@ Models/Props/Stones/ShinyStoneCrystalBlue.mesh - - - - - - - - - - - - Models/Props/Stones/ShinyStoneCrystalBlue.mesh - - - - - - - - - - - - - Models/Props/Stones/ShinyStoneCrystalBlue.mesh - - - - + + @@ -4574,36 +4547,8 @@ Models/Props/Stones/ShinyStoneCrystalBlue.mesh - - - - - - - - - - - - Models/Props/Stones/ShinyStoneCrystalBlue.mesh - - - - - - - - - - - - - - Models/Props/Stones/ShinyStoneCrystalBlue.mesh - - - - + + @@ -4629,36 +4574,8 @@ Models/Props/Stones/ShinyStoneCrystalBlue.mesh - - - - - - - - - - - - Models/Props/Stones/ShinyStoneCrystalRed.mesh - - - - - - - - - - - - - Models/Props/Stones/ShinyStoneCrystalRed.mesh - - - - - + + @@ -4677,47 +4594,6 @@ - - - - - Models/Props/Stones/ShinyStoneCrystalRed.mesh - - - - - - - - - - - - - Models/Props/Stones/ShinyStoneCrystalBlue.mesh - - - - - - - - - - - - - - Models/Props/Stones/ShinyStoneCrystalRed.mesh - - - - - - - - - @@ -4732,6 +4608,130 @@ + + + + + Models/Props/Stones/ShinyStoneCrystalRed.mesh + + + + + + + + + + + + + Models/Props/Stones/ShinyStoneCrystalBlue.mesh + + + + + + + + + + + + + + Models/Props/Stones/ShinyStoneCrystalBlue.mesh + + + + + + + + + + + + + + Models/Props/Stones/ShinyStoneCrystalBlue.mesh + + + + + + + + + + + + + + Models/Props/Stones/ShinyStoneCrystalBlue.mesh + + + + + + + + + + + + + + Models/Props/Stones/ShinyStoneCrystalBlue.mesh + + + + + + + + + + + + + + Models/Props/Stones/ShinyStoneCrystalRed.mesh + + + + + + + + + + + + + + Models/Props/Stones/ShinyStoneCrystalRed.mesh + + + + + + + + + + + + + Models/Props/Stones/ShinyStoneCrystalRed.mesh + + + + + + + + + @@ -4750,434 +4750,11 @@ - - - - - - - - - 10 - - - - - - - - - - - 1 - - - - - - - - - 10 - - - - - - - - - - - 10 - - - - - - - - - - 10 - - - - - - - - - - - - - 10 - - - - - - - - - - - 1 - - - - - - - - - - - - - - Schema/Entities/Player.xml - - - - - - - - - - - - - - - - Models/Characters/Assault/AssaultTPose.mesh - false - - - - - - - - - - - - Models/Characters/Assault/AssaultTPose.mesh - false - - - - - - - - - - - - Models/Characters/Assault/AssaultTPose.mesh - false - - - - - - - - - - - - Models/Characters/Assault/AssaultTPose.mesh - false - - - - - - - - - - - - - - - - - - - Models/Props/CapturePoint/CapturePointNeutral.mesh - - - - - - - - - - 2 - - - - Models/Core/UnitCylinder.mesh - - true - - - - - - - - - - - - - - - - Models/Props/CapturePoint/CapturePointRed.mesh - - - - - - - - - - - - - - - - Models/Core/UnitCylinder.mesh - - true - - - - - - - - - - - - - - - - - - - - Models/Props/CapturePoint/CapturePointNeutral.mesh - - - - - - - - - - 3 - - - - Models/Core/UnitCylinder.mesh - - true - - - - - - - - - - - - - - - - Models/Props/CapturePoint/CapturePointNeutral.mesh - - - - - - - - - - 1.5498908015879351 - 1 - - - - Models/Core/UnitCylinder.mesh - - true - - - - - - - - - - - - - - - - Models/Props/CapturePoint/CapturePointBlue.mesh - - - - - - - - - - - - - 4 - - - - Models/Core/UnitCylinder.mesh - - true - - - - - - - - - - - - - - - - - - - - - - Schema/Entities/PlayerRed.xml - - - - - - - - - - - - - - - - Models/Characters/Assault/AssaultTPose.mesh - false - - - - - - - - - - - - Models/Characters/Assault/AssaultTPose.mesh - false - - - - - - - - - - - - Models/Characters/Assault/AssaultTPose.mesh - false - - - - - - - - - - - - Models/Characters/Assault/AssaultTPose.mesh - false - - - - - - - - - - - - - - - 0.10000000149011612 - - - - Models/Props/PickUps/HealthPickUp.mesh - - - - - - - - - @@ -5209,8 +4786,8 @@ Models/Props/PickUps/AmmoPickUp.mesh - - + + @@ -5228,27 +4805,8 @@ Models/Props/PickUps/AmmoPickUp.mesh - - - - - - - - - - - - - 0.10000000149011612 - - - - Models/Props/PickUps/HealthPickUp.mesh - - - - + + @@ -5285,8 +4843,8 @@ Models/Props/PickUps/HealthPickUp.mesh - - + + @@ -5304,13 +4862,455 @@ Models/Props/PickUps/AmmoPickUp.mesh - - + + + + + + + + 0.10000000149011612 + + + + Models/Props/PickUps/HealthPickUp.mesh + + + + + + + + + + + + + + + 0.10000000149011612 + + + + Models/Props/PickUps/HealthPickUp.mesh + + + + + + + + + + + + + + + + + + + + + Schema/Entities/Player.xml + + + + + + + + + + + Models/Characters/Assault/AssaultTPose.mesh + false + + + + + + + + + + + + Models/Characters/Assault/AssaultTPose.mesh + false + + + + + + + + + + + + Models/Characters/Assault/AssaultTPose.mesh + false + + + + + + + + + + + + Models/Characters/Assault/AssaultTPose.mesh + false + + + + + + + + + + + + + + + + + + 10 + + + + + + + + + + 10 + + + + + + + + + + + + + 1 + + + + + + + + + 10 + + + + + + + + + + + 10 + + + + + + + + + + + 10 + + + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + + Models/Props/CapturePoint/CapturePointNeutral.mesh + + + + + + + + + + 2 + + + + + Models/Core/UnitCylinder.mesh + + true + + + + + + + + + + + + + + + Models/Props/CapturePoint/CapturePointRed.mesh + + + + + + + + + + + + + + + + + + + + + Models/Core/UnitCylinder.mesh + + true + + + + + + + + + + + + + + + Models/Props/CapturePoint/CapturePointNeutral.mesh + + + + + + + + + + 3 + + + + + Models/Core/UnitCylinder.mesh + + true + + + + + + + + + + + + + + + Models/Props/CapturePoint/CapturePointNeutral.mesh + + + + + + + + + + 1.5498908015879351 + 1 + + + + + Models/Core/UnitCylinder.mesh + + true + + + + + + + + + + + + + + + Models/Props/CapturePoint/CapturePointBlue.mesh + + + + + + + + + + + + + 4 + + + + + + + + + Models/Core/UnitCylinder.mesh + + true + + + + + + + + + + + + + + + + + + + + + + Schema/Entities/PlayerRed.xml + + + + + + + + + + + Models/Characters/Assault/AssaultTPose.mesh + false + + + + + + + + + + + + Models/Characters/Assault/AssaultTPose.mesh + false + + + + + + + + + + + + Models/Characters/Assault/AssaultTPose.mesh + false + + + + + + + + + + + + Models/Characters/Assault/AssaultTPose.mesh + false + + + + + + + @@ -5367,12 +5367,12 @@ - - 2 - + + 2 + Textures/Core/UnitHexagon_Rotated.png @@ -5401,12 +5401,12 @@ - - 3 - + + 3 + Textures/Core/UnitHexagon_Rotated.png @@ -5435,12 +5435,12 @@ - - 4 - + + 4 + Textures/Core/UnitHexagon_Rotated.png @@ -5469,13 +5469,13 @@ - - 1 - 0.10332605343919568 + + 1 + Textures/Core/UnitHexagon_Rotated.png @@ -5504,10 +5504,10 @@ - + Textures/Core/UnitHexagon_Rotated.png @@ -5613,6 +5613,79 @@ + + + + + + + + + + + + + + + + + + Textures/Core/UnitHexagon.png + + + + + PickTeam + 2 + + + + + + + + + + + + + Textures/Core/UnitHexagon.png + + + + + PickTeam + 3 + + + + + + + + + + + + + Textures/Core/UnitHexagon.png + + + + PickTeam + 1 + + + + + + + + + + + + diff --git a/resources/Schema/Entities/OverwatchCamera.xml b/resources/Schema/Entities/OverwatchCamera.xml index a2b774d3..a6ef1f74 100644 --- a/resources/Schema/Entities/OverwatchCamera.xml +++ b/resources/Schema/Entities/OverwatchCamera.xml @@ -55,12 +55,12 @@ - - 2 - + + 2 + Textures/Core/UnitHexagon_Rotated.png @@ -89,12 +89,12 @@ - - 3 - + + 3 + Textures/Core/UnitHexagon_Rotated.png @@ -123,12 +123,12 @@ - - 4 - + + 4 + Textures/Core/UnitHexagon_Rotated.png @@ -157,13 +157,13 @@ - - 1 - 0.10332605343919568 + + 1 + Textures/Core/UnitHexagon_Rotated.png @@ -192,10 +192,10 @@ - + Textures/Core/UnitHexagon_Rotated.png @@ -301,6 +301,79 @@ + + + + + + + + + + + + + + + + + + Textures/Core/UnitHexagon.png + + + + + PickTeam + 2 + + + + + + + + + + + + + Textures/Core/UnitHexagon.png + + + + + PickTeam + 3 + + + + + + + + + + + + + Textures/Core/UnitHexagon.png + + + + PickTeam + 1 + + + + + + + + + + + + diff --git a/src/Game/Game.cpp b/src/Game/Game.cpp index 0629fbd5..d3972f94 100644 --- a/src/Game/Game.cpp +++ b/src/Game/Game.cpp @@ -34,6 +34,7 @@ #include "Game/Systems/KillFeedSystem.h" #include "Game/Systems/BoostSystem.h" #include "Game/Systems/BoostIconsHUDSystem.h" +#include "Game/Systems/SpectatorCameraSystem.h" #include "GUI/ButtonSystem.h" #include "GUI/MainMenuSystem.h" @@ -155,6 +156,7 @@ Game::Game(int argc, char* argv[]) m_SystemPipeline->AddSystem(updateOrderLevel, m_Renderer); m_SystemPipeline->AddSystem(updateOrderLevel, m_Renderer); m_SystemPipeline->AddSystem(updateOrderLevel); + m_SystemPipeline->AddSystem(updateOrderLevel); // Populate Octree with collidables ++updateOrderLevel; m_SystemPipeline->AddSystem(updateOrderLevel, m_OctreeCollision, "Collidable"); diff --git a/src/Game/Systems/PlayerSpawnSystem.cpp b/src/Game/Systems/PlayerSpawnSystem.cpp index 39fa1606..56ace14c 100644 --- a/src/Game/Systems/PlayerSpawnSystem.cpp +++ b/src/Game/Systems/PlayerSpawnSystem.cpp @@ -59,7 +59,7 @@ void PlayerSpawnSystem::Update(double dt) } int numSpawnedPlayers = 0; - for (auto& req : m_SpawnRequests) { + for (auto it = m_SpawnRequests.begin(); it != m_SpawnRequests.end(); ++it) { for (auto& cPlayerSpawn : *playerSpawns) { EntityWrapper spawner(m_World, cPlayerSpawn.EntityID); if (!spawner.HasComponent("Spawner")) { @@ -69,10 +69,12 @@ void PlayerSpawnSystem::Update(double dt) // If the spawner has a team affiliation, check it if (spawner.HasComponent("Team")) { auto cSpawnerTeam = spawner["Team"]; - if ((int)cSpawnerTeam["Team"] != req.Team) { - // Increase num spawned players if someone picks spectator, since it is valid to pick spectator + if ((int)cSpawnerTeam["Team"] != it->Team) { + // Increase num spawned players if someone picks spectator or didn't + // pick a class yet, since it is valid // but don't spawn anything, goto next spawnrequest. - if (req.Team == (int)cSpawnerTeam["Team"].Enum("Spectator")) { + // TODO: -1 Signifies no class picked, enum here later? + if (it->Class == -1 || it->Team == (int)cSpawnerTeam["Team"].Enum("Spectator")) { ++numSpawnedPlayers; break; } @@ -80,18 +82,24 @@ void PlayerSpawnSystem::Update(double dt) } } + // TODO: Choose a different spawner depending on class picked? + // Spawn the player! EntityWrapper player = SpawnerSystem::Spawn(spawner, EntityWrapper::Invalid, "Player"); // Set the player team affiliation - player["Team"]["Team"] = req.Team; + player["Team"]["Team"] = it->Team; // Publish a PlayerSpawned event Events::PlayerSpawned e; - e.PlayerID = req.PlayerID; + e.PlayerID = it->PlayerID; e.Player = player; e.Spawner = spawner; m_EventBroker->Publish(e); ++numSpawnedPlayers; + it = m_SpawnRequests.erase(it); + break; + } + if (it == m_SpawnRequests.end()) { break; } } @@ -100,12 +108,12 @@ void PlayerSpawnSystem::Update(double dt) } else { LOG_DEBUG("%i players were spawned or set as spectator.", numSpawnedPlayers); } - m_SpawnRequests.clear(); } bool PlayerSpawnSystem::OnInputCommand(Events::InputCommand& e) { - if (e.Command != "PickTeam" && e.Command != "SwapToClassPick") { + bool removeRequest = e.Command == "SwapToClassPick" || e.Command == "SwapToTeamPick"; + if (e.Command != "PickTeam" && e.Command != "PickClass" && !removeRequest) { return false; } @@ -113,19 +121,6 @@ bool PlayerSpawnSystem::OnInputCommand(Events::InputCommand& e) 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! // Don't make a spawn request if we're the client. if (!IsServer && m_NetworkEnabled) { @@ -137,26 +132,38 @@ bool PlayerSpawnSystem::OnInputCommand(Events::InputCommand& e) for (; iter != m_SpawnRequests.end(); ++iter) { if (iter->PlayerID == e.PlayerID) { // If player wants to switch class, remove their spawn request. - if (e.Command == "SwapToClassPick") { + if (removeRequest) { m_SpawnRequests.erase(iter); } break; } } - if (e.Command == "SwapToClassPick") { + // Return if we were only supposed to remove a request, not add one. + if (removeRequest) { return true; } + //If we get here, add or alter a spawn request. if (iter != m_SpawnRequests.end()) { - // If player is in queue to spawn, then change their team affiliation in the request. - iter->Team = (ComponentInfo::EnumType)e.Value; + // If player is in queue to spawn, then change their team affiliation or class in the request. + if (e.Command == "PickTeam") { + iter->Team = (ComponentInfo::EnumType)e.Value; + } else { + iter->Class = (ComponentInfo::EnumType)e.Value; + } } 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, // but only if they are spectating and/or just connected. SpawnRequest req; req.PlayerID = e.PlayerID; - req.Team = (ComponentInfo::EnumType)e.Value; + if (e.Command == "PickTeam") { + req.Team = (ComponentInfo::EnumType)e.Value; + req.Class = -1; // TODO: -1 Signifies no class picked, enum here later? + } else { + req.Team = 1; // TODO: 1 Signifies spectator, should probably have real enum here later. + req.Class = (ComponentInfo::EnumType)e.Value; + } m_SpawnRequests.push_back(req); } else { return false; @@ -210,7 +217,7 @@ bool PlayerSpawnSystem::OnPlayerSpawned(Events::PlayerSpawned& 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) { return false; } @@ -218,7 +225,7 @@ bool PlayerSpawnSystem::OnPlayerDeath(Events::PlayerDeath& e) return false; } ComponentWrapper cTeam = e.Player["Team"]; - //A spectator can't die anyway + // A spectator can't die anyway if ((ComponentInfo::EnumType)cTeam["Team"] == cTeam["Team"].Enum("Spectator")) { return false; } @@ -230,6 +237,14 @@ bool PlayerSpawnSystem::OnPlayerDeath(Events::PlayerDeath& e) SpawnRequest req; req.PlayerID = m_PlayerIDs.at(e.Player.ID); req.Team = cTeam["Team"]; + // TODO: Better than temp class state code. + if (e.Player.HasComponent("DashAbility")) { + req.Class = 1; // Assault + } else if (e.Player.HasComponent("SprintAbility")) { + req.Class = 3; // Sniper + } else { + req.Class = 2; // Defender + } m_SpawnRequests.push_back(req); return true; diff --git a/src/Game/Systems/SpectatorCameraSystem.cpp b/src/Game/Systems/SpectatorCameraSystem.cpp new file mode 100644 index 00000000..bf78cfb0 --- /dev/null +++ b/src/Game/Systems/SpectatorCameraSystem.cpp @@ -0,0 +1,66 @@ +#include "Systems/SpectatorCameraSystem.h" +#include "Rendering/ESetCamera.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.Valid() && spectatorCam.HasComponent("Camera")) { + m_CamSetToTeamPick = true; + Events::SetCamera eSetCamera; + eSetCamera.CameraEntity = spectatorCam; + m_EventBroker->Publish(eSetCamera); + } + } +} + +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.Valid() && spectatorCam.HasComponent("Camera")) { + Events::SetCamera eSetCamera; + eSetCamera.CameraEntity = spectatorCam; + m_EventBroker->Publish(eSetCamera); + } + + return true; +} \ No newline at end of file From 03843774d7d8f4adb4ace9f825efc275bd5a8e25 Mon Sep 17 00:00:00 2001 From: William Moberg Date: Fri, 4 Mar 2016 07:01:47 +0100 Subject: [PATCH 02/10] Moved buttons and fixed so you can't spawn with no class. --- .../Schema/Entities/NewMapWSpectatorCam.xml | 2332 +++++++++-------- resources/Schema/Entities/OverwatchCamera.xml | 372 ++- src/Game/Systems/PlayerSpawnSystem.cpp | 17 +- 3 files changed, 1481 insertions(+), 1240 deletions(-) diff --git a/resources/Schema/Entities/NewMapWSpectatorCam.xml b/resources/Schema/Entities/NewMapWSpectatorCam.xml index 2305c008..fc4dd9a1 100644 --- a/resources/Schema/Entities/NewMapWSpectatorCam.xml +++ b/resources/Schema/Entities/NewMapWSpectatorCam.xml @@ -23,6 +23,18 @@ + + + + + Models/Props/Highground1.mesh + + + + + + + @@ -75,18 +87,6 @@ - - - - - Models/Props/Highground1.mesh - - - - - - - @@ -2843,6 +2843,178 @@ + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + @@ -3229,6 +3401,125 @@ + + + + + Models/Props/Walls/MediumWall1.mesh + + + + + + + + + + + + Models/Props/Walls/MediumWall1.mesh + + + + + + + + + + + + Models/Props/Walls/MediumWall1.mesh + + + + + + + + + + + + + + Models/Props/Pillars/SciFiBridgePillar1.mesh + + + + + + + + + + + + Models/Core/UnitCube.mesh + + + + + + + + + + + + + + Models/Core/UnitPlane.mesh + + true + + + + + + + + + + + + + + Models/Props/Walls/MediumWall3.mesh + + + + + + + + + + + Models/Props/Walls/MediumWall3.mesh + + + + + + + + + + + + + + Models/Props/Pillars/SciFiBridgePillar1.mesh + + + + + + + + + @@ -3283,96 +3574,6 @@ - - - - - Models/Props/Walls/MediumWall3.mesh - - - - - - - - - - - Models/Props/Walls/MediumWall3.mesh - - - - - - - - - - - - - - Models/Props/Pillars/SciFiBridgePillar1.mesh - - - - - - - - - - - - Models/Core/UnitCube.mesh - - - - - - - - - - - - - - - Models/Props/Walls/MediumWall1.mesh - - - - - - - - - - - - Models/Props/Walls/MediumWall1.mesh - - - - - - - - - - - - Models/Props/Walls/MediumWall1.mesh - - - - - - - - - @@ -3441,21 +3642,6 @@ - - - - Models/Core/UnitPlane.mesh - - true - - - - - - - - - @@ -3499,20 +3685,6 @@ - - - - - Models/Props/Pillars/SciFiBridgePillar1.mesh - - - - - - - - - @@ -3520,6 +3692,35 @@ + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + @@ -3533,119 +3734,6 @@ - - - - Models/Props/Flora/AliveBush.mesh - true - - - - - - - - - - Models/Props/Flora/AliveBush.mesh - true - - - - - - - - - - - Models/Props/Flora/AliveBush.mesh - true - - - - - - - - - - - Models/Props/Flora/AliveBush.mesh - true - - - - - - - - - - - Models/Props/Flora/AliveBush.mesh - true - - - - - - - - - - - Models/Props/Flora/AliveBush.mesh - true - - - - - - - - - - - - - - - Models/Props/Flora/TreeLog.mesh - - - - - - - - - - - - - Models/Props/Flora/AliveBush.mesh - true - - - - - - - - - - Models/Props/Flora/AliveBush.mesh - true - - - - - - - - - @@ -3664,7 +3752,7 @@ true - + @@ -3676,7 +3764,7 @@ true - + @@ -3695,57 +3783,6 @@ - - - - Models/Props/Flora/AliveBush.mesh - true - - - - - - - - - - Models/Props/Flora/AliveBush.mesh - true - - - - - - - - - - - - Models/Props/Flora/AliveBush.mesh - true - - - - - - - - - - - - - - Models/Props/Flora/SpecialRoot.mesh - - - - - - - - @@ -3757,18 +3794,6 @@ - - - - Models/Props/Flora/AliveBush.mesh - true - - - - - - - @@ -3788,7 +3813,7 @@ true - + @@ -3800,7 +3825,19 @@ true - + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + @@ -3826,7 +3863,7 @@ true - + @@ -3837,11 +3874,37 @@ true - + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + @@ -3854,6 +3917,18 @@ + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + @@ -3868,6 +3943,20 @@ + + + + + Models/Props/Flora/SpecialRoot.mesh + + + + + + + + + @@ -3889,9 +3978,37 @@ true - - - + + + + + + + + + + + + Models/Props/Flora/SpecialRoot.mesh + + + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + @@ -3931,9 +4048,135 @@ true - - - + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + + + + Models/Props/Flora/TreeLog.mesh + + + + + + + + + + + + + + Models/Props/Flora/SpecialRoot.mesh + + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + @@ -3952,20 +4195,6 @@ - - - - - Models/Props/Flora/SpecialRoot.mesh - - - - - - - - - @@ -3980,20 +4209,6 @@ - - - - Models/Props/Flora/AliveBush.mesh - true - - - - - - - - - @@ -4007,20 +4222,6 @@ - - - - Models/Props/Flora/AliveBush.mesh - true - - - - - - - - - @@ -4036,21 +4237,6 @@ - - - - - Models/Props/Flora/AliveBush.mesh - true - - - - - - - - - @@ -4066,20 +4252,6 @@ - - - - - Models/Props/Flora/SpecialRoot.mesh - - - - - - - - - @@ -4107,36 +4279,8 @@ Models/Props/PickUps/PickUpHolder.mesh - - - - - - - - - - - - Models/Props/PickUps/PickUpHolder.mesh - - - - - - - - - - - - - - Models/Props/PickUps/PickUpHolder.mesh - - - - + + @@ -4173,8 +4317,50 @@ Models/Props/PickUps/PickUpHolder.mesh - - + + + + + + + + + + + + Models/Props/PickUps/PickUpHolder.mesh + + + + + + + + + + + + + + Models/Props/PickUps/PickUpHolder.mesh + + + + + + + + + + + + + + Models/Props/PickUps/PickUpHolder.mesh + + + + @@ -4194,20 +4380,6 @@ - - - - - Models/Props/PickUps/PickUpHolder.mesh - - - - - - - - - @@ -4224,183 +4396,24 @@ - - - - - - - - - - Models/Props/Stones/AssaultHolder.mesh - - - - - - - - - - - - Models/Props/Stones/AssaultHolder.mesh - - - - - - - - - - - - Models/Props/Stones/AssaultHolder.mesh - - - - - - - - - - - - Models/Props/Stones/AssaultHolder.mesh - - - - - - - - - - - - - - - - - - - Models/Props/Stones/AssaultHolder.mesh - - - - - - - - - - - - Models/Props/Stones/AssaultHolder.mesh - - - - - - - - - - - - - - - Models/Props/Stones/AssaultHolder.mesh - - - - - - - - - - - - Models/Props/Stones/AssaultHolder.mesh - - - - - - - - - - - - - - - Models/Props/Stones/AssaultHolder.mesh - - - - - - - - - - - - - - Models/Props/Stones/AssaultHolder.mesh - - - - - - - - - - - - - - Models/Props/Stones/AssaultHolder.mesh - - - - - - - - - - - - - - Models/Props/Stones/AssaultHolder.mesh - - - - - - - - - - - + + + + + Models/Props/SciFiHolder1.mesh + + + + + + + + @@ -4479,19 +4492,6 @@ - - - - - Models/Props/SciFiHolder1.mesh - - - - - - - - @@ -4519,13 +4519,53 @@ Models/Props/Stones/ShinyStoneCrystalBlue.mesh - - + + + + + + + Models/Props/Stones/ShinyStoneCrystalRed.mesh + + + + + + + + + + + + + Models/Props/Stones/ShinyStoneCrystalRed.mesh + + + + + + + + + + + + + + Models/Props/Stones/ShinyStoneCrystalRed.mesh + + + + + + + + @@ -4547,8 +4587,8 @@ Models/Props/Stones/ShinyStoneCrystalBlue.mesh - - + + @@ -4561,75 +4601,8 @@ Models/Props/Stones/ShinyStoneCrystalRed.mesh - - - - - - - - - - - Models/Props/Stones/ShinyStoneCrystalBlue.mesh - - - - - - - - - - - - - Models/Props/Stones/ShinyStoneCrystalBlue.mesh - - - - - - - - - - - - - - Models/Props/Stones/ShinyStoneCrystalRed.mesh - - - - - - - - - - - - - - Models/Props/Stones/ShinyStoneCrystalRed.mesh - - - - - - - - - - - - - Models/Props/Stones/ShinyStoneCrystalBlue.mesh - - - - + + @@ -4656,8 +4629,8 @@ Models/Props/Stones/ShinyStoneCrystalBlue.mesh - - + + @@ -4670,8 +4643,63 @@ Models/Props/Stones/ShinyStoneCrystalBlue.mesh - - + + + + + + + + + + + + Models/Props/Stones/ShinyStoneCrystalBlue.mesh + + + + + + + + + + + + + Models/Props/Stones/ShinyStoneCrystalRed.mesh + + + + + + + + + + + + + + Models/Props/Stones/ShinyStoneCrystalBlue.mesh + + + + + + + + + + + + + + Models/Props/Stones/ShinyStoneCrystalBlue.mesh + + + + @@ -4691,20 +4719,6 @@ - - - - - Models/Props/Stones/ShinyStoneCrystalRed.mesh - - - - - - - - - @@ -4718,20 +4732,6 @@ - - - - - Models/Props/Stones/ShinyStoneCrystalRed.mesh - - - - - - - - - @@ -4750,6 +4750,159 @@ + + + + + + + + + + Schema/Entities/PlayerRed.xml + + + + + + + + + + + Models/Characters/Assault/AssaultTPose.mesh + false + + + + + + + + + + + + Models/Characters/Assault/AssaultTPose.mesh + false + + + + + + + + + + + + Models/Characters/Assault/AssaultTPose.mesh + false + + + + + + + + + + + + Models/Characters/Assault/AssaultTPose.mesh + false + + + + + + + + + + + + + + + + + + 10 + + + + + + + + + + + 1 + + + + + + + + + 1 + + + + + + + + + + + 10 + + + + + + + + + + 10 + + + + + + + + + + + + + 10 + + + + + + + + + + + 10 + + + + + + + + + @@ -4757,18 +4910,37 @@ - + 0.10000000149011612 - Models/Props/PickUps/AmmoPickUp.mesh + Models/Props/PickUps/HealthPickUp.mesh - - + + + + + + + + + + + + + 0.10000000149011612 + + + + Models/Props/PickUps/HealthPickUp.mesh + + + + @@ -4805,8 +4977,8 @@ Models/Props/PickUps/AmmoPickUp.mesh - - + + @@ -4814,18 +4986,37 @@ - + 0.10000000149011612 - Models/Props/PickUps/HealthPickUp.mesh + Models/Props/PickUps/AmmoPickUp.mesh - - + + + + + + + + + + + + + 0.10000000149011612 + + + + Models/Props/PickUps/AmmoPickUp.mesh + + + + @@ -4850,25 +5041,6 @@ - - - - - - 0.10000000149011612 - - - - Models/Props/PickUps/AmmoPickUp.mesh - - - - - - - - - @@ -4888,25 +5060,6 @@ - - - - - - 0.10000000149011612 - - - - Models/Props/PickUps/HealthPickUp.mesh - - - - - - - - - @@ -4946,7 +5099,7 @@ false - + @@ -4959,7 +5112,7 @@ false - + @@ -4979,89 +5132,6 @@ - - - - - - - - - 10 - - - - - - - - - - 10 - - - - - - - - - - - - - 1 - - - - - - - - - 10 - - - - - - - - - - - 10 - - - - - - - - - - - 10 - - - - - - - - - - - 1 - - - - - - - - - @@ -5071,28 +5141,35 @@ - Models/Props/CapturePoint/CapturePointNeutral.mesh + Models/Props/CapturePoint/CapturePointBlue.mesh - + - 2 + + + + 4 - + + + + + Models/Core/UnitCylinder.mesh - + true - - + + @@ -5137,6 +5214,39 @@ + + + + + Models/Props/CapturePoint/CapturePointNeutral.mesh + + + + + + + + + + 1.5498908015879351 + 1 + + + + + Models/Core/UnitCylinder.mesh + + true + + + + + + + + + + @@ -5176,15 +5286,14 @@ Models/Props/CapturePoint/CapturePointNeutral.mesh - + - 1.5498908015879351 - 1 + 2 @@ -5194,123 +5303,14 @@ true - - + + - - - - - Models/Props/CapturePoint/CapturePointBlue.mesh - - - - - - - - - - - - - 4 - - - - - - - - - Models/Core/UnitCylinder.mesh - - true - - - - - - - - - - - - - - - - - - - - - - Schema/Entities/PlayerRed.xml - - - - - - - - - - - Models/Characters/Assault/AssaultTPose.mesh - false - - - - - - - - - - - - Models/Characters/Assault/AssaultTPose.mesh - false - - - - - - - - - - - - Models/Characters/Assault/AssaultTPose.mesh - false - - - - - - - - - - - - Models/Characters/Assault/AssaultTPose.mesh - false - - - - - - - @@ -5332,6 +5332,136 @@ + + + + + + + + + + + + + + + + + + Textures/Core/UnitHexagon.png + + + + + PickTeam + 1 + + + + + + + + + + + Spectator + Fonts/DroidSans.ttf,64 + + + + + + + + + + + + + + + Textures/Core/UnitHexagon.png + + + + + PickTeam + 2 + + + + + + + + + + + Red + Fonts/DroidSans.ttf,64 + + + + + + + + + + + + + + + Textures/Core/UnitHexagon.png + + + + + PickTeam + 3 + + + + + + + + + + + Blue + Fonts/DroidSans.ttf,64 + + + + + + + + + + + + + + Pick Team + Fonts/DroidSans.ttf,64 + + + + + + + + + + + + + @@ -5358,10 +5488,10 @@ Textures/Core/UnitHexagon.png - + - + @@ -5371,7 +5501,7 @@ - 2 + 4 Textures/Core/UnitHexagon_Rotated.png @@ -5426,10 +5556,10 @@ Textures/Core/UnitHexagon.png - + - + @@ -5439,7 +5569,7 @@ - 4 + 2 Textures/Core/UnitHexagon_Rotated.png @@ -5455,6 +5585,38 @@ + + + + Textures/Core/UnitHexagon.png + + + + + + + + + + + + + + + + Textures/Core/UnitHexagon_Rotated.png + + + + + + + + + + + + @@ -5490,38 +5652,6 @@ - - - - Textures/Core/UnitHexagon.png - - - - - - - - - - - - - - - - Textures/Core/UnitHexagon_Rotated.png - - - - - - - - - - - - @@ -5551,28 +5681,10 @@ - + - - - - - Textures/Core/UnitHexagon.png - - - - PickClass - 2 - - - - - - - - @@ -5585,11 +5697,59 @@ 1 - + - + + + + + Assault + Fonts/DroidSans.ttf,64 + + + + + + + + + + + + + + + + Textures/Core/UnitHexagon.png + + + + PickClass + 2 + + + + + + + + + + + Defender + Fonts/DroidSans.ttf,64 + + + + + + + + + + @@ -5603,81 +5763,37 @@ 3 - + - + + + + + Sniper + Fonts/DroidSans.ttf,64 + + + + + + + + + + - - - - - - - - - - - - - - - - - - + - - - Textures/Core/UnitHexagon.png - - - - - PickTeam - 2 - + + Pick Class + Fonts/DroidSans.ttf,64 + + - - - - - - - - - - - Textures/Core/UnitHexagon.png - - - - - PickTeam - 3 - - - - - - - - - - - - - Textures/Core/UnitHexagon.png - - - - PickTeam - 1 - - - - + + diff --git a/resources/Schema/Entities/OverwatchCamera.xml b/resources/Schema/Entities/OverwatchCamera.xml index a6ef1f74..ee3c1cb1 100644 --- a/resources/Schema/Entities/OverwatchCamera.xml +++ b/resources/Schema/Entities/OverwatchCamera.xml @@ -20,6 +20,136 @@ + + + + + + + + + + + + + + + + + + Textures/Core/UnitHexagon.png + + + + + PickTeam + 1 + + + + + + + + + + + Spectator + Fonts/DroidSans.ttf,64 + + + + + + + + + + + + + + + Textures/Core/UnitHexagon.png + + + + + PickTeam + 2 + + + + + + + + + + + Red + Fonts/DroidSans.ttf,64 + + + + + + + + + + + + + + + Textures/Core/UnitHexagon.png + + + + + PickTeam + 3 + + + + + + + + + + + Blue + Fonts/DroidSans.ttf,64 + + + + + + + + + + + + + + Pick Team + Fonts/DroidSans.ttf,64 + + + + + + + + + + + + + @@ -46,10 +176,10 @@ Textures/Core/UnitHexagon.png - + - + @@ -59,7 +189,7 @@ - 2 + 4 Textures/Core/UnitHexagon_Rotated.png @@ -114,10 +244,10 @@ Textures/Core/UnitHexagon.png - + - + @@ -127,7 +257,7 @@ - 4 + 2 Textures/Core/UnitHexagon_Rotated.png @@ -143,6 +273,38 @@ + + + + Textures/Core/UnitHexagon.png + + + + + + + + + + + + + + + + Textures/Core/UnitHexagon_Rotated.png + + + + + + + + + + + + @@ -178,38 +340,6 @@ - - - - Textures/Core/UnitHexagon.png - - - - - - - - - - - - - - - - Textures/Core/UnitHexagon_Rotated.png - - - - - - - - - - - - @@ -239,28 +369,10 @@ - + - - - - - Textures/Core/UnitHexagon.png - - - - PickClass - 2 - - - - - - - - @@ -273,11 +385,59 @@ 1 - + - + + + + + Assault + Fonts/DroidSans.ttf,64 + + + + + + + + + + + + + + + + Textures/Core/UnitHexagon.png + + + + PickClass + 2 + + + + + + + + + + + Defender + Fonts/DroidSans.ttf,64 + + + + + + + + + + @@ -291,81 +451,37 @@ 3 - + - + + + + + Sniper + Fonts/DroidSans.ttf,64 + + + + + + + + + + - - - - - - - - - - - - - - - - - - + - - - Textures/Core/UnitHexagon.png - - - - - PickTeam - 2 - + + Pick Class + Fonts/DroidSans.ttf,64 + + - - - - - - - - - - - Textures/Core/UnitHexagon.png - - - - - PickTeam - 3 - - - - - - - - - - - - - Textures/Core/UnitHexagon.png - - - - PickTeam - 1 - - - - + + diff --git a/src/Game/Systems/PlayerSpawnSystem.cpp b/src/Game/Systems/PlayerSpawnSystem.cpp index 56ace14c..10632c0a 100644 --- a/src/Game/Systems/PlayerSpawnSystem.cpp +++ b/src/Game/Systems/PlayerSpawnSystem.cpp @@ -60,6 +60,13 @@ void PlayerSpawnSystem::Update(double dt) int numSpawnedPlayers = 0; for (auto it = m_SpawnRequests.begin(); it != m_SpawnRequests.end(); ++it) { + // TODO: -1 Signifies no class picked, enum here later? + // Increase num spawned players if they didn't pick class yet since it is valid + // but don't spawn anything, goto next spawnrequest. + if (it->Class == -1) { + ++numSpawnedPlayers; + break; + } for (auto& cPlayerSpawn : *playerSpawns) { EntityWrapper spawner(m_World, cPlayerSpawn.EntityID); if (!spawner.HasComponent("Spawner")) { @@ -70,11 +77,9 @@ void PlayerSpawnSystem::Update(double dt) if (spawner.HasComponent("Team")) { auto cSpawnerTeam = spawner["Team"]; if ((int)cSpawnerTeam["Team"] != it->Team) { - // Increase num spawned players if someone picks spectator or didn't - // pick a class yet, since it is valid + // Increase num spawned players if someone picks spectator since it is valid // but don't spawn anything, goto next spawnrequest. - // TODO: -1 Signifies no class picked, enum here later? - if (it->Class == -1 || it->Team == (int)cSpawnerTeam["Team"].Enum("Spectator")) { + if (it->Team == (int)cSpawnerTeam["Team"].Enum("Spectator")) { ++numSpawnedPlayers; break; } @@ -149,8 +154,10 @@ bool PlayerSpawnSystem::OnInputCommand(Events::InputCommand& e) // If player is in queue to spawn, then change their team affiliation or class in the request. if (e.Command == "PickTeam") { iter->Team = (ComponentInfo::EnumType)e.Value; + LOG_INFO("old request swap Team"); } else { iter->Class = (ComponentInfo::EnumType)e.Value; + LOG_INFO("old request swap Class"); } } 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, @@ -160,9 +167,11 @@ bool PlayerSpawnSystem::OnInputCommand(Events::InputCommand& e) if (e.Command == "PickTeam") { req.Team = (ComponentInfo::EnumType)e.Value; req.Class = -1; // TODO: -1 Signifies no class picked, enum here later? + LOG_INFO("new request set Team"); } else { req.Team = 1; // TODO: 1 Signifies spectator, should probably have real enum here later. req.Class = (ComponentInfo::EnumType)e.Value; + LOG_INFO("new request set Class"); } m_SpawnRequests.push_back(req); } else { From 0dfe00b406c92e3696e613f046c0bef58aae92b8 Mon Sep 17 00:00:00 2001 From: William Moberg Date: Fri, 4 Mar 2016 09:49:27 +0100 Subject: [PATCH 03/10] Unlocks mouse when changing to SpectatorCamera and locking when respawning. --- include/Game/Systems/PlayerDeathSystem.h | 1 + src/Game/Systems/PlayerDeathSystem.cpp | 24 ++++++++++++++-------- src/Game/Systems/PlayerSpawnSystem.cpp | 3 +++ src/Game/Systems/SpectatorCameraSystem.cpp | 5 +++++ 4 files changed, 24 insertions(+), 9 deletions(-) diff --git a/include/Game/Systems/PlayerDeathSystem.h b/include/Game/Systems/PlayerDeathSystem.h index e4f96114..5a82f999 100644 --- a/include/Game/Systems/PlayerDeathSystem.h +++ b/include/Game/Systems/PlayerDeathSystem.h @@ -25,6 +25,7 @@ private: EventRelay m_EEntityDeleted; bool OnEntityDeleted(Events::EntityDeleted& e); + void setSpectatorCamera(); void createDeathEffect(EntityWrapper player); }; diff --git a/src/Game/Systems/PlayerDeathSystem.cpp b/src/Game/Systems/PlayerDeathSystem.cpp index cbf0927f..bb9a807c 100644 --- a/src/Game/Systems/PlayerDeathSystem.cpp +++ b/src/Game/Systems/PlayerDeathSystem.cpp @@ -1,4 +1,5 @@ #include "Systems/PlayerDeathSystem.h" +#include "Core/ELockMouse.h" PlayerDeathSystem::PlayerDeathSystem(SystemParams params) : System(params) @@ -33,10 +34,10 @@ void PlayerDeathSystem::createDeathEffect(EntityWrapper player) //components that we need from player auto playerModel = player.FirstChildByName("PlayerModel"); - if (!playerModel.Valid()) { - return; - } - if (!playerModel.HasComponent("Model") || !playerModel.HasComponent("Animation")) { + if (!playerModel.Valid() || !playerModel.HasComponent("Model") || !playerModel.HasComponent("Animation")) { + if (player == LocalPlayer) { + setSpectatorCamera(); + } return; } auto playerEntityModel = playerModel["Model"]; @@ -46,9 +47,7 @@ void PlayerDeathSystem::createDeathEffect(EntityWrapper player) playerEntityModel.Copy(deathEffectEW["Model"]); playerEntityAnimation.Copy(deathEffectEW["Animation"]); //freeze the animation - deathEffectEW["Animation"]["Speed1"] = 0.0; - deathEffectEW["Animation"]["Speed2"] = 0.0; - deathEffectEW["Animation"]["Speed3"] = 0.0; + deathEffectEW["Animation"]["Speed"] = 0.0; //copy the models position,orientation deathEffectEW["Transform"]["Position"] = (glm::vec3)player["Transform"]["Position"]; @@ -73,13 +72,20 @@ bool PlayerDeathSystem::OnEntityDeleted(Events::EntityDeleted& e) return false; } + setSpectatorCamera(); + return true; +} + +void PlayerDeathSystem::setSpectatorCamera() +{ // Look for the spectator camera entity in the level. EntityWrapper spectatorCam = m_World->GetFirstEntityByName("SpectatorCamera"); if (!spectatorCam.Valid() || !spectatorCam.HasComponent("Camera") || LocalPlayer.Valid()) { - return false; + return; } Events::SetCamera eSetCamera; eSetCamera.CameraEntity = spectatorCam; m_EventBroker->Publish(eSetCamera); - return true; + Events::UnlockMouse unlock; + m_EventBroker->Publish(unlock); } diff --git a/src/Game/Systems/PlayerSpawnSystem.cpp b/src/Game/Systems/PlayerSpawnSystem.cpp index 10632c0a..7692b0a7 100644 --- a/src/Game/Systems/PlayerSpawnSystem.cpp +++ b/src/Game/Systems/PlayerSpawnSystem.cpp @@ -1,4 +1,5 @@ #include "Systems/PlayerSpawnSystem.h" +#include "Core/ELockMouse.h" PlayerSpawnSystem::PlayerSpawnSystem(SystemParams params) : System(params) @@ -100,6 +101,8 @@ void PlayerSpawnSystem::Update(double dt) e.Player = player; e.Spawner = spawner; m_EventBroker->Publish(e); + Events::LockMouse lock; + m_EventBroker->Publish(lock); ++numSpawnedPlayers; it = m_SpawnRequests.erase(it); break; diff --git a/src/Game/Systems/SpectatorCameraSystem.cpp b/src/Game/Systems/SpectatorCameraSystem.cpp index bf78cfb0..58f25155 100644 --- a/src/Game/Systems/SpectatorCameraSystem.cpp +++ b/src/Game/Systems/SpectatorCameraSystem.cpp @@ -1,5 +1,6 @@ #include "Systems/SpectatorCameraSystem.h" #include "Rendering/ESetCamera.h" +#include "Core/ELockMouse.h" SpectatorCameraSystem::SpectatorCameraSystem(SystemParams params) : System(params) @@ -19,6 +20,8 @@ void SpectatorCameraSystem::Update(double dt) Events::SetCamera eSetCamera; eSetCamera.CameraEntity = spectatorCam; m_EventBroker->Publish(eSetCamera); + Events::UnlockMouse unlock; + m_EventBroker->Publish(unlock); } } } @@ -60,6 +63,8 @@ bool SpectatorCameraSystem::OnInputCommand(const Events::InputCommand& e) Events::SetCamera eSetCamera; eSetCamera.CameraEntity = spectatorCam; m_EventBroker->Publish(eSetCamera); + Events::UnlockMouse unlock; + m_EventBroker->Publish(unlock); } return true; From 282e0bf7c47d3d0b1b4e219f26079ee1769d9420 Mon Sep 17 00:00:00 2001 From: William Moberg Date: Mon, 7 Mar 2016 15:05:37 +0100 Subject: [PATCH 04/10] Only set spectator camera if player haven't spawned already. Don't spawn player if they switch to class pick screen. --- src/Game/Systems/PlayerDeathSystem.cpp | 16 ++++++-- src/Game/Systems/PlayerSpawnSystem.cpp | 53 +++++++++++++++----------- 2 files changed, 43 insertions(+), 26 deletions(-) diff --git a/src/Game/Systems/PlayerDeathSystem.cpp b/src/Game/Systems/PlayerDeathSystem.cpp index bb9a807c..95709e88 100644 --- a/src/Game/Systems/PlayerDeathSystem.cpp +++ b/src/Game/Systems/PlayerDeathSystem.cpp @@ -18,6 +18,8 @@ bool PlayerDeathSystem::OnPlayerDeath(Events::PlayerDeath& e) return false; } + LOG_DEBUG("------ Player #%i died.", e.Player.ID); + createDeathEffect(e.Player); // Delete player @@ -36,6 +38,7 @@ void PlayerDeathSystem::createDeathEffect(EntityWrapper player) auto playerModel = player.FirstChildByName("PlayerModel"); if (!playerModel.Valid() || !playerModel.HasComponent("Model") || !playerModel.HasComponent("Animation")) { if (player == LocalPlayer) { + LOG_DEBUG("------ LocalPlayer's death effect could not be spawned, setting to spectator instead of death cam."); setSpectatorCamera(); } return; @@ -57,6 +60,7 @@ void PlayerDeathSystem::createDeathEffect(EntityWrapper player) //camera (with lifetime) behind the player if (player == LocalPlayer) { + LOG_DEBUG("------ LocalPlayer's death effect spawning, setting to death camera."); m_LocalPlayerDeathEffect = deathEffectEW; auto cam = deathEffectEW.FirstChildByName("Camera"); Events::SetCamera eSetCamera; @@ -71,8 +75,14 @@ bool PlayerDeathSystem::OnEntityDeleted(Events::EntityDeleted& e) if (m_LocalPlayerDeathEffect.ID != e.DeletedEntity) { return false; } - - setSpectatorCamera(); + + // If the player hasn't spawned already, activate the spectator camera. + if (!LocalPlayer.Valid()) { + LOG_DEBUG("------ LocalPlayer's death effect removed, setting to spectator."); + setSpectatorCamera(); + } else { + LOG_DEBUG("------ LocalPlayer's death effect removed, player is already spawned, not setting spectator."); + } return true; } @@ -80,7 +90,7 @@ void PlayerDeathSystem::setSpectatorCamera() { // Look for the spectator camera entity in the level. EntityWrapper spectatorCam = m_World->GetFirstEntityByName("SpectatorCamera"); - if (!spectatorCam.Valid() || !spectatorCam.HasComponent("Camera") || LocalPlayer.Valid()) { + if (!spectatorCam.Valid() || !spectatorCam.HasComponent("Camera")) { return; } Events::SetCamera eSetCamera; diff --git a/src/Game/Systems/PlayerSpawnSystem.cpp b/src/Game/Systems/PlayerSpawnSystem.cpp index 7692b0a7..2e55965e 100644 --- a/src/Game/Systems/PlayerSpawnSystem.cpp +++ b/src/Game/Systems/PlayerSpawnSystem.cpp @@ -59,13 +59,15 @@ void PlayerSpawnSystem::Update(double dt) return; } - int numSpawnedPlayers = 0; + int numHandledRequests = 0; + int playersStillPickingClass = 0; + const int numRequestsToHandle = (int)m_SpawnRequests.size(); for (auto it = m_SpawnRequests.begin(); it != m_SpawnRequests.end(); ++it) { // TODO: -1 Signifies no class picked, enum here later? - // Increase num spawned players if they didn't pick class yet since it is valid + // It is valid if they didn't pick class yet // but don't spawn anything, goto next spawnrequest. if (it->Class == -1) { - ++numSpawnedPlayers; + ++playersStillPickingClass; break; } for (auto& cPlayerSpawn : *playerSpawns) { @@ -78,10 +80,11 @@ void PlayerSpawnSystem::Update(double dt) if (spawner.HasComponent("Team")) { auto cSpawnerTeam = spawner["Team"]; if ((int)cSpawnerTeam["Team"] != it->Team) { - // Increase num spawned players if someone picks spectator since it is valid + // It is valid if someone picks spectator // but don't spawn anything, goto next spawnrequest. if (it->Team == (int)cSpawnerTeam["Team"].Enum("Spectator")) { - ++numSpawnedPlayers; + ++numHandledRequests; + it = m_SpawnRequests.erase(it); break; } continue; @@ -103,7 +106,7 @@ void PlayerSpawnSystem::Update(double dt) m_EventBroker->Publish(e); Events::LockMouse lock; m_EventBroker->Publish(lock); - ++numSpawnedPlayers; + ++numHandledRequests; it = m_SpawnRequests.erase(it); break; } @@ -111,17 +114,18 @@ void PlayerSpawnSystem::Update(double dt) break; } } - if (numSpawnedPlayers != (int)m_SpawnRequests.size()) { - LOG_DEBUG("%i players were supposed to be spawned or set as spectator, but only %i was handled.", (int)m_SpawnRequests.size(), numSpawnedPlayers); + if (numHandledRequests != numRequestsToHandle - playersStillPickingClass) { + LOG_DEBUG("%i players were supposed to be spawned or set as spectator, but only %i was handled.", numRequestsToHandle, numHandledRequests); } else { - LOG_DEBUG("%i players were spawned or set as spectator.", numSpawnedPlayers); + std::string dbg = numHandledRequests != 0 ? std::to_string(numHandledRequests) + " players were spawned or set as spectator. " : ""; + dbg += playersStillPickingClass != 0 ? std::to_string(playersStillPickingClass) + " players are still picking class and will be spawned later." : ""; + LOG_DEBUG(dbg.c_str()); } } bool PlayerSpawnSystem::OnInputCommand(Events::InputCommand& e) { - bool removeRequest = e.Command == "SwapToClassPick" || e.Command == "SwapToTeamPick"; - if (e.Command != "PickTeam" && e.Command != "PickClass" && !removeRequest) { + if (e.Command != "PickTeam" && e.Command != "PickClass" && e.Command != "SwapToTeamPick" && e.Command != "SwapToClassPick") { return false; } @@ -139,28 +143,29 @@ bool PlayerSpawnSystem::OnInputCommand(Events::InputCommand& e) auto iter = m_SpawnRequests.begin(); for (; iter != m_SpawnRequests.end(); ++iter) { if (iter->PlayerID == e.PlayerID) { - // If player wants to switch class, remove their spawn request. - if (removeRequest) { + // If player wants to switch team, remove their spawn request. + if (e.Command == "SwapToTeamPick") { m_SpawnRequests.erase(iter); + } else if (e.Command == "SwapToClassPick") { + // If player wants to switch class, remove their selected class so they don't spawn. + iter->Class = -1; + } else { + break; } - break; + return true; } } - // Return if we were only supposed to remove a request, not add one. - if (removeRequest) { - return true; - } - //If we get here, add or alter a spawn request. + //If we get here we got a PickTeam or PickClass, so add or alter a spawn request. if (iter != m_SpawnRequests.end()) { // If player is in queue to spawn, then change their team affiliation or class in the request. if (e.Command == "PickTeam") { iter->Team = (ComponentInfo::EnumType)e.Value; - LOG_INFO("old request swap Team"); + LOG_DEBUG("old spawn request setting Team"); } else { iter->Class = (ComponentInfo::EnumType)e.Value; - LOG_INFO("old request swap Class"); + LOG_DEBUG("old spawn request setting Class"); } } 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, @@ -170,11 +175,13 @@ bool PlayerSpawnSystem::OnInputCommand(Events::InputCommand& e) if (e.Command == "PickTeam") { req.Team = (ComponentInfo::EnumType)e.Value; req.Class = -1; // TODO: -1 Signifies no class picked, enum here later? - LOG_INFO("new request set Team"); + LOG_DEBUG("new spawn request setting Team"); } 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 = (ComponentInfo::EnumType)e.Value; - LOG_INFO("new request set Class"); + LOG_DEBUG("new spawn request setting Class"); } m_SpawnRequests.push_back(req); } else { From 1516ed8e2df963a335bbb18a008c1e884a2e045a Mon Sep 17 00:00:00 2001 From: William Moberg Date: Mon, 7 Mar 2016 17:35:01 +0100 Subject: [PATCH 05/10] Removed debug logging. PlayerID in InputCommands from buttons is corrected. --- src/Engine/GUI/ButtonSystem.cpp | 4 +-- src/Game/Systems/PlayerDeathSystem.cpp | 7 ------ src/Game/Systems/PlayerSpawnSystem.cpp | 35 +++++++++----------------- 3 files changed, 14 insertions(+), 32 deletions(-) diff --git a/src/Engine/GUI/ButtonSystem.cpp b/src/Engine/GUI/ButtonSystem.cpp index b28c0119..44c8a13c 100644 --- a/src/Engine/GUI/ButtonSystem.cpp +++ b/src/Engine/GUI/ButtonSystem.cpp @@ -40,7 +40,7 @@ bool ButtonSystem::OnMousePress(const Events::MousePress& e) //You have clicked on a button entity, send pressed event. if (m_World->HasComponent(m_PickData.Entity, "InputCmdButton")) { Events::InputCommand eInputCmd; - eInputCmd.PlayerID = LocalPlayer.ID; + eInputCmd.PlayerID = -1; eInputCmd.Player = LocalPlayer; EntityWrapper button = EntityWrapper(m_World, m_PickData.Entity); 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")) { Events::InputCommand eInputCmd; - eInputCmd.PlayerID = LocalPlayer.ID; + eInputCmd.PlayerID = -1; eInputCmd.Player = LocalPlayer; EntityWrapper button = EntityWrapper(m_World, m_PickData.Entity); eInputCmd.Command = (std::string)button["InputCmdButton"]["Command"]; diff --git a/src/Game/Systems/PlayerDeathSystem.cpp b/src/Game/Systems/PlayerDeathSystem.cpp index 85daec9b..c562e530 100644 --- a/src/Game/Systems/PlayerDeathSystem.cpp +++ b/src/Game/Systems/PlayerDeathSystem.cpp @@ -18,8 +18,6 @@ bool PlayerDeathSystem::OnPlayerDeath(Events::PlayerDeath& e) return false; } - LOG_DEBUG("------ Player #%i died.", e.Player.ID); - createDeathEffect(e.Player); // Delete player @@ -38,7 +36,6 @@ void PlayerDeathSystem::createDeathEffect(EntityWrapper player) auto playerModel = player.FirstChildByName("PlayerModel"); if (!playerModel.Valid() || !playerModel.HasComponent("Model") || !playerModel.HasComponent("Animation")) { if (player == LocalPlayer) { - LOG_DEBUG("------ LocalPlayer's death effect could not be spawned, setting to spectator instead of death cam."); setSpectatorCamera(); } return; @@ -58,7 +55,6 @@ void PlayerDeathSystem::createDeathEffect(EntityWrapper player) //camera (with lifetime) behind the player if (player == LocalPlayer) { - LOG_DEBUG("------ LocalPlayer's death effect spawning, setting to death camera."); m_LocalPlayerDeathEffect = deathEffectEW; auto cam = deathEffectEW.FirstChildByName("Camera"); Events::SetCamera eSetCamera; @@ -76,10 +72,7 @@ bool PlayerDeathSystem::OnEntityDeleted(Events::EntityDeleted& e) // If the player hasn't spawned already, activate the spectator camera. if (!LocalPlayer.Valid()) { - LOG_DEBUG("------ LocalPlayer's death effect removed, setting to spectator."); setSpectatorCamera(); - } else { - LOG_DEBUG("------ LocalPlayer's death effect removed, player is already spawned, not setting spectator."); } return true; } diff --git a/src/Game/Systems/PlayerSpawnSystem.cpp b/src/Game/Systems/PlayerSpawnSystem.cpp index 2e55965e..e13f1bdc 100644 --- a/src/Game/Systems/PlayerSpawnSystem.cpp +++ b/src/Game/Systems/PlayerSpawnSystem.cpp @@ -59,16 +59,16 @@ void PlayerSpawnSystem::Update(double dt) return; } - int numHandledRequests = 0; - int playersStillPickingClass = 0; + int numSpawnedPlayers = 0; + int playersSpectating = 0; const int numRequestsToHandle = (int)m_SpawnRequests.size(); for (auto it = m_SpawnRequests.begin(); it != m_SpawnRequests.end(); ++it) { - // TODO: -1 Signifies no class picked, enum here later? + // TODO: -1 Signifies no class picked, or they are a spectator, enum here later? // It is valid if they didn't pick class yet // but don't spawn anything, goto next spawnrequest. if (it->Class == -1) { - ++playersStillPickingClass; - break; + ++playersSpectating; + continue; } for (auto& cPlayerSpawn : *playerSpawns) { EntityWrapper spawner(m_World, cPlayerSpawn.EntityID); @@ -80,13 +80,6 @@ void PlayerSpawnSystem::Update(double dt) if (spawner.HasComponent("Team")) { auto cSpawnerTeam = spawner["Team"]; if ((int)cSpawnerTeam["Team"] != it->Team) { - // It is valid if someone picks spectator - // but don't spawn anything, goto next spawnrequest. - if (it->Team == (int)cSpawnerTeam["Team"].Enum("Spectator")) { - ++numHandledRequests; - it = m_SpawnRequests.erase(it); - break; - } continue; } } @@ -104,9 +97,7 @@ void PlayerSpawnSystem::Update(double dt) e.Player = player; e.Spawner = spawner; m_EventBroker->Publish(e); - Events::LockMouse lock; - m_EventBroker->Publish(lock); - ++numHandledRequests; + ++numSpawnedPlayers; it = m_SpawnRequests.erase(it); break; } @@ -114,11 +105,11 @@ void PlayerSpawnSystem::Update(double dt) break; } } - if (numHandledRequests != numRequestsToHandle - playersStillPickingClass) { - LOG_DEBUG("%i players were supposed to be spawned or set as spectator, but only %i was handled.", numRequestsToHandle, numHandledRequests); + if (numSpawnedPlayers != numRequestsToHandle - playersSpectating) { + LOG_DEBUG("%i players were supposed to be spawned, but only %i was successfully.", numRequestsToHandle - playersSpectating, numSpawnedPlayers); } else { - std::string dbg = numHandledRequests != 0 ? std::to_string(numHandledRequests) + " players were spawned or set as spectator. " : ""; - dbg += playersStillPickingClass != 0 ? std::to_string(playersStillPickingClass) + " players are still picking class and will be spawned later." : ""; + 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()); } } @@ -162,10 +153,8 @@ bool PlayerSpawnSystem::OnInputCommand(Events::InputCommand& e) // If player is in queue to spawn, then change their team affiliation or class in the request. if (e.Command == "PickTeam") { iter->Team = (ComponentInfo::EnumType)e.Value; - LOG_DEBUG("old spawn request setting Team"); } else { iter->Class = (ComponentInfo::EnumType)e.Value; - LOG_DEBUG("old spawn request setting Class"); } } 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, @@ -175,13 +164,11 @@ bool PlayerSpawnSystem::OnInputCommand(Events::InputCommand& e) if (e.Command == "PickTeam") { req.Team = (ComponentInfo::EnumType)e.Value; req.Class = -1; // TODO: -1 Signifies no class picked, enum here later? - LOG_DEBUG("new spawn request setting Team"); } 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 = (ComponentInfo::EnumType)e.Value; - LOG_DEBUG("new spawn request setting Class"); } m_SpawnRequests.push_back(req); } else { @@ -217,6 +204,8 @@ bool PlayerSpawnSystem::OnPlayerSpawned(Events::PlayerSpawned& e) Events::SetCamera e; e.CameraEntity = cameraEntity; m_EventBroker->Publish(e); + Events::LockMouse lock; + m_EventBroker->Publish(lock); } // HACK: Set the player model color to team color From fcf87104c35244a85d0dcdbbf0c6a229edb25b13 Mon Sep 17 00:00:00 2001 From: William Moberg Date: Mon, 7 Mar 2016 17:50:03 +0100 Subject: [PATCH 06/10] Replaced test textures for class picking with more proper icons. --- .../Schema/Entities/NewMapWSpectatorCam.xml | 3330 ++++++++--------- resources/Schema/Entities/OverwatchCamera.xml | 260 +- 2 files changed, 1795 insertions(+), 1795 deletions(-) diff --git a/resources/Schema/Entities/NewMapWSpectatorCam.xml b/resources/Schema/Entities/NewMapWSpectatorCam.xml index fc4dd9a1..456bee0e 100644 --- a/resources/Schema/Entities/NewMapWSpectatorCam.xml +++ b/resources/Schema/Entities/NewMapWSpectatorCam.xml @@ -23,6 +23,16 @@ + + + + + Models/Props/Highground2.mesh + + + + + @@ -77,16 +87,6 @@ - - - - - Models/Props/Highground2.mesh - - - - - @@ -2843,6 +2843,439 @@ + + + + + + + + + + Models/Props/Pillars/SciFiBridgePillar1.mesh + + + + + + + + + + + + Models/Core/UnitCube.mesh + + + + + + + + + + + + + + + Models/Props/Walls/MediumWall2.mesh + + + + + + + + + + + Models/Props/Walls/MediumWall2.mesh + + + + + + + + + + + + + + Models/Core/UnitPlane.mesh + + true + + + + + + + + + + + + + + Models/Props/Pillars/SciFiBridgePillar1.mesh + + + + + + + + + + + + + + Models/Props/Walls/MediumWall1.mesh + + + + + + + + + + + Models/Props/Walls/MediumWall1.mesh + + + + + + + + + + + + + Models/Core/UnitPlane.mesh + + true + + + + + + + + + + + + + + Models/Core/UnitCube.mesh + + + + + + + + + + + + + Models/Core/UnitCube.mesh + + + + + + + + + + + + + + + Models/Props/Walls/MediumWall1.mesh + + + + + + + + + + + + Models/Props/Walls/MediumWall1.mesh + + + + + + + + + + + + Models/Props/Walls/MediumWall1.mesh + + + + + + + + + + + + + + Models/Props/Walls/MediumWall3.mesh + + + + + + + + + + + Models/Props/Walls/MediumWall3.mesh + + + + + + + + + + + + + + Models/Props/Pillars/SciFiBridgePillar1.mesh + + + + + + + + + + + + + + Models/Props/Pillars/SciFiBridgePillar1.mesh + + + + + + + + + + + + + + Models/Core/UnitCube.mesh + + + + + + + + + + + + + Models/Core/UnitCube.mesh + + + + + + + + + + + + + + + + Models/Props/Pillars/SciFiBridgePillar1.mesh + + + + + + + + + + + + + + + + + + + + + Models/Props/PickUps/PickUpHolder.mesh + + + + + + + + + + + + + + Models/Props/PickUps/PickUpHolder.mesh + + + + + + + + + + + + + + Models/Props/PickUps/PickUpHolder.mesh + + + + + + + + + + + + + + Models/Props/PickUps/PickUpHolder.mesh + + + + + + + + + + + + + + Models/Props/PickUps/PickUpHolder.mesh + + + + + + + + + + + + + Models/Props/PickUps/PickUpHolder.mesh + + + + + + + + + + + + + + + + + + + + + + + + Models/Props/PickUps/PickUpHolder.mesh + + + + + + + + + + + + + + Models/Props/PickUps/PickUpHolder.mesh + + + + + + + + + + + + + + Models/Props/PickUps/PickUpHolder.mesh + + + + + + + + + + + @@ -3015,11 +3448,618 @@ + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + + + + Models/Props/Flora/SpecialRoot.mesh + + + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + + + + Models/Props/Flora/TreeLog.mesh + + + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + + + + Models/Props/Flora/SpecialRoot.mesh + + + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + + + + Models/Props/Flora/SpecialRoot.mesh + + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + + + + + + Models/Props/Pillars/SciFiBridgePillar1.mesh + + + + + + + + + + + + + + Models/Props/Bridges/SciFiBridge1Blue.mesh + + + + + + + + + + + + + Models/Props/Bridges/SciFiBridge1Red.mesh + + + + + + + + @@ -3314,19 +4354,6 @@ - - - - - Models/Props/Bridges/SciFiBridge1Blue.mesh - - - - - - - - @@ -3340,20 +4367,6 @@ - - - - - Models/Props/Pillars/SciFiBridgePillar1.mesh - - - - - - - - - @@ -3367,19 +4380,6 @@ - - - - - Models/Props/Bridges/SciFiBridge1Red.mesh - - - - - - - - @@ -3396,1011 +4396,24 @@ - - - - - - - - - - Models/Props/Walls/MediumWall1.mesh - - - - - - - - - - - - Models/Props/Walls/MediumWall1.mesh - - - - - - - - - - - - Models/Props/Walls/MediumWall1.mesh - - - - - - - - - - - - - - Models/Props/Pillars/SciFiBridgePillar1.mesh - - - - - - - - - - - - Models/Core/UnitCube.mesh - - - - - - - - - - - - - - Models/Core/UnitPlane.mesh - - true - - - - - - - - - - - - - - Models/Props/Walls/MediumWall3.mesh - - - - - - - - - - - Models/Props/Walls/MediumWall3.mesh - - - - - - - - - - - - - - Models/Props/Pillars/SciFiBridgePillar1.mesh - - - - - - - - - - - - - - Models/Props/Pillars/SciFiBridgePillar1.mesh - - - - - - - - - - - - - - Models/Props/Pillars/SciFiBridgePillar1.mesh - - - - - - - - - - - - - - Models/Props/Walls/MediumWall2.mesh - - - - - - - - - - - Models/Props/Walls/MediumWall2.mesh - - - - - - - - - - - - - - - Models/Props/Walls/MediumWall1.mesh - - - - - - - - - - - Models/Props/Walls/MediumWall1.mesh - - - - - - - - - - - - - - Models/Core/UnitCube.mesh - - - - - - - - - - - - - Models/Core/UnitCube.mesh - - - - - - - - - - - - - - Models/Core/UnitPlane.mesh - - true - - - - - - - - - - - - - - Models/Core/UnitCube.mesh - - - - - - - - - - - - - Models/Core/UnitCube.mesh - - - - - - - - - - - - - - - - Models/Props/Pillars/SciFiBridgePillar1.mesh - - - - - - - - - - - - - - - - - - - - - Models/Props/Flora/AliveBush.mesh - true - - - - - - - - - - - - - Models/Props/Flora/AliveBush.mesh - true - - - - - - - - - - - - - Models/Props/Flora/AliveBush.mesh - true - - - - - - - - - - - - Models/Props/Flora/AliveBush.mesh - true - - - - - - - - - - Models/Props/Flora/AliveBush.mesh - true - - - - - - - - - - - Models/Props/Flora/AliveBush.mesh - true - - - - - - - - - - - Models/Props/Flora/AliveBush.mesh - true - - - - - - - - - - - - - Models/Props/Flora/AliveBush.mesh - true - - - - - - - - - - Models/Props/Flora/AliveBush.mesh - true - - - - - - - - - - - Models/Props/Flora/AliveBush.mesh - true - - - - - - - - - - - Models/Props/Flora/AliveBush.mesh - true - - - - - - - - - - - Models/Props/Flora/AliveBush.mesh - true - - - - - - - - - - - Models/Props/Flora/AliveBush.mesh - true - - - - - - - - - - - - - Models/Props/Flora/AliveBush.mesh - true - - - - - - - - - - Models/Props/Flora/AliveBush.mesh - true - - - - - - - - - - - Models/Props/Flora/AliveBush.mesh - true - - - - - - - - - - - - - - Models/Props/Flora/AliveBush.mesh - true - - - - - - - - - - Models/Props/Flora/AliveBush.mesh - true - - - - - - - - - - - Models/Props/Flora/AliveBush.mesh - true - - - - - - - - - - - Models/Props/Flora/AliveBush.mesh - true - - - - - - - - - - - - - - Models/Props/Flora/SpecialRoot.mesh - - - - - - - - - - - - - Models/Props/Flora/AliveBush.mesh - true - - - - - - - - - - - - - Models/Props/Flora/AliveBush.mesh - true - - - - - - - - - - - - - - Models/Props/Flora/SpecialRoot.mesh - - - - - - - - - - - - - Models/Props/Flora/AliveBush.mesh - true - - - - - - - - - - - - - Models/Props/Flora/AliveBush.mesh - true - - - - - - - - - - - Models/Props/Flora/AliveBush.mesh - true - - - - - - - - - - - - - - - Models/Props/Flora/AliveBush.mesh - true - - - - - - - - - - Models/Props/Flora/AliveBush.mesh - true - - - - - - - - - - - - - Models/Props/Flora/AliveBush.mesh - true - - - - - - - - - - Models/Props/Flora/AliveBush.mesh - true - - - - - - - - - - - Models/Props/Flora/AliveBush.mesh - true - - - - - - - - - - - Models/Props/Flora/AliveBush.mesh - true - - - - - - - - - - - - Models/Props/Flora/AliveBush.mesh - true - - - - - - - - - - - Models/Props/Flora/AliveBush.mesh - true - - - - - - - - - - - - - - Models/Props/Flora/TreeLog.mesh - - - - - - - - - - - - - - Models/Props/Flora/SpecialRoot.mesh - - - - - - - - - - - - Models/Props/Flora/AliveBush.mesh - true - - - - - - - - - - - - - Models/Props/Flora/AliveBush.mesh - true - - - - - - - - - - - - - Models/Props/Flora/AliveBush.mesh - true - - - - - - - - - - - - - Models/Props/Flora/AliveBush.mesh - true - - - - - - - - - - - - - Models/Props/Flora/AliveBush.mesh - true - - - - - - - - - - - - - - Models/Props/Flora/AliveBush.mesh - true - - - - - - - - - - - - - - - - - - - - - Models/Props/PickUps/PickUpHolder.mesh - - - - - - - - - - - - - Models/Props/PickUps/PickUpHolder.mesh - - - - - - - - - - - - - - Models/Props/PickUps/PickUpHolder.mesh - - - - - - - - - - - - - - - - - - - - - - - - Models/Props/PickUps/PickUpHolder.mesh - - - - - - - - - - - - - - Models/Props/PickUps/PickUpHolder.mesh - - - - - - - - - - - - - - Models/Props/PickUps/PickUpHolder.mesh - - - - - - - - - - - - - - Models/Props/PickUps/PickUpHolder.mesh - - - - - - - - - - - - - - Models/Props/PickUps/PickUpHolder.mesh - - - - - - - - - - - - - - Models/Props/PickUps/PickUpHolder.mesh - - - - - - - - - - - + + + + + Models/Props/SciFiHolder1.mesh + + + + + + + + @@ -4479,19 +4492,6 @@ - - - - - Models/Props/SciFiHolder1.mesh - - - - - - - - @@ -4519,8 +4519,49 @@ Models/Props/Stones/ShinyStoneCrystalBlue.mesh - - + + + + + + + + + + + + Models/Props/Stones/ShinyStoneCrystalRed.mesh + + + + + + + + + + + + + Models/Props/Stones/ShinyStoneCrystalBlue.mesh + + + + + + + + + + + + + + Models/Props/Stones/ShinyStoneCrystalBlue.mesh + + + + @@ -4546,9 +4587,9 @@ Models/Props/Stones/ShinyStoneCrystalRed.mesh - - - + + + @@ -4560,8 +4601,50 @@ Models/Props/Stones/ShinyStoneCrystalRed.mesh - - + + + + + + + + + + + Models/Props/Stones/ShinyStoneCrystalBlue.mesh + + + + + + + + + + + + + + Models/Props/Stones/ShinyStoneCrystalBlue.mesh + + + + + + + + + + + + + + Models/Props/Stones/ShinyStoneCrystalRed.mesh + + + + + @@ -4580,20 +4663,6 @@ - - - - - Models/Props/Stones/ShinyStoneCrystalBlue.mesh - - - - - - - - - @@ -4608,20 +4677,6 @@ - - - - - Models/Props/Stones/ShinyStoneCrystalBlue.mesh - - - - - - - - - @@ -4636,20 +4691,6 @@ - - - - - Models/Props/Stones/ShinyStoneCrystalBlue.mesh - - - - - - - - - @@ -4663,20 +4704,6 @@ - - - - - Models/Props/Stones/ShinyStoneCrystalRed.mesh - - - - - - - - - @@ -4691,20 +4718,6 @@ - - - - - Models/Props/Stones/ShinyStoneCrystalBlue.mesh - - - - - - - - - @@ -4719,19 +4732,6 @@ - - - - - Models/Props/Stones/ShinyStoneCrystalRed.mesh - - - - - - - - @@ -4750,388 +4750,6 @@ - - - - - - - - - - Schema/Entities/PlayerRed.xml - - - - - - - - - - - Models/Characters/Assault/AssaultTPose.mesh - false - - - - - - - - - - - - Models/Characters/Assault/AssaultTPose.mesh - false - - - - - - - - - - - - Models/Characters/Assault/AssaultTPose.mesh - false - - - - - - - - - - - - Models/Characters/Assault/AssaultTPose.mesh - false - - - - - - - - - - - - - - - - - - 10 - - - - - - - - - - - 1 - - - - - - - - - 1 - - - - - - - - - - - 10 - - - - - - - - - - 10 - - - - - - - - - - - - - 10 - - - - - - - - - - - 10 - - - - - - - - - - - - - - - - - - - - 0.10000000149011612 - - - - Models/Props/PickUps/HealthPickUp.mesh - - - - - - - - - - - - - - - 0.10000000149011612 - - - - Models/Props/PickUps/HealthPickUp.mesh - - - - - - - - - - - - - - - 0.10000000149011612 - - - - Models/Props/PickUps/AmmoPickUp.mesh - - - - - - - - - - - - - - - 0.10000000149011612 - - - - Models/Props/PickUps/AmmoPickUp.mesh - - - - - - - - - - - - - - - 0.10000000149011612 - - - - Models/Props/PickUps/AmmoPickUp.mesh - - - - - - - - - - - - - - - 0.10000000149011612 - - - - Models/Props/PickUps/AmmoPickUp.mesh - - - - - - - - - - - - - - - 0.10000000149011612 - - - - Models/Props/PickUps/HealthPickUp.mesh - - - - - - - - - - - - - - - 0.10000000149011612 - - - - Models/Props/PickUps/HealthPickUp.mesh - - - - - - - - - - - - - - - - - - - - - Schema/Entities/Player.xml - - - - - - - - - - - Models/Characters/Assault/AssaultTPose.mesh - false - - - - - - - - - - - - Models/Characters/Assault/AssaultTPose.mesh - false - - - - - - - - - - - - Models/Characters/Assault/AssaultTPose.mesh - false - - - - - - - - - - - - Models/Characters/Assault/AssaultTPose.mesh - false - - - - - - - - - @@ -5313,6 +4931,388 @@ + + + + + + + + + + Schema/Entities/PlayerRed.xml + + + + + + + + + + + Models/Characters/Assault/AssaultTPose.mesh + false + + + + + + + + + + + + Models/Characters/Assault/AssaultTPose.mesh + false + + + + + + + + + + + + Models/Characters/Assault/AssaultTPose.mesh + false + + + + + + + + + + + + Models/Characters/Assault/AssaultTPose.mesh + false + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + 10 + + + + + + + + + + + 10 + + + + + + + + + + + 1 + + + + + + + + + 10 + + + + + + + + + + 10 + + + + + + + + + + + + + 10 + + + + + + + + + + + + + + + + + + + + 0.10000000149011612 + + + + Models/Props/PickUps/AmmoPickUp.mesh + + + + + + + + + + + + + + + 0.10000000149011612 + + + + Models/Props/PickUps/AmmoPickUp.mesh + + + + + + + + + + + + + + + 0.10000000149011612 + + + + Models/Props/PickUps/HealthPickUp.mesh + + + + + + + + + + + + + + + 0.10000000149011612 + + + + Models/Props/PickUps/HealthPickUp.mesh + + + + + + + + + + + + + + + 0.10000000149011612 + + + + Models/Props/PickUps/HealthPickUp.mesh + + + + + + + + + + + + + + + 0.10000000149011612 + + + + Models/Props/PickUps/AmmoPickUp.mesh + + + + + + + + + + + + + + + 0.10000000149011612 + + + + Models/Props/PickUps/AmmoPickUp.mesh + + + + + + + + + + + + + + + 0.10000000149011612 + + + + Models/Props/PickUps/HealthPickUp.mesh + + + + + + + + + + + + + + + + + + + + + Schema/Entities/Player.xml + + + + + + + + + + + Models/Characters/Assault/AssaultTPose.mesh + false + + + + + + + + + + + + Models/Characters/Assault/AssaultTPose.mesh + false + + + + + + + + + + + + Models/Characters/Assault/AssaultTPose.mesh + false + + + + + + + + + + + + Models/Characters/Assault/AssaultTPose.mesh + false + + + + + + + + + @@ -5332,6 +5332,136 @@ + + + + + + + + + + + + + + + + + Pick Class + Fonts/DroidSans.ttf,64 + + + + + + + + + + + + + + Textures/Icons/Classes/Assault-01.png + + + + PickClass + 1 + + + + + + + + + + + Assault + Fonts/DroidSans.ttf,64 + + + + + + + + + + + + + + + + Textures/Icons/Classes/Sniper-01.png + + + + PickClass + 3 + + + + + + + + + + + Sniper + Fonts/DroidSans.ttf,64 + + + + + + + + + + + + + + + + Textures/Icons/Classes/Defender-01.png + + + + PickClass + 2 + + + + + + + + + + + Defender + Fonts/DroidSans.ttf,64 + + + + + + + + + + + + + + + @@ -5672,136 +5802,6 @@ - - - - - - - - - - - - - - - - - - Textures/Core/UnitRaptor.png - - - - PickClass - 1 - - - - - - - - - - - Assault - Fonts/DroidSans.ttf,64 - - - - - - - - - - - - - - - - Textures/Core/UnitHexagon.png - - - - PickClass - 2 - - - - - - - - - - - Defender - Fonts/DroidSans.ttf,64 - - - - - - - - - - - - - - - - Textures/Test/aM4ME4GR.png - - - - PickClass - 3 - - - - - - - - - - - Sniper - Fonts/DroidSans.ttf,64 - - - - - - - - - - - - - - - Pick Class - Fonts/DroidSans.ttf,64 - - - - - - - - - - - - - diff --git a/resources/Schema/Entities/OverwatchCamera.xml b/resources/Schema/Entities/OverwatchCamera.xml index ee3c1cb1..55e9099c 100644 --- a/resources/Schema/Entities/OverwatchCamera.xml +++ b/resources/Schema/Entities/OverwatchCamera.xml @@ -20,6 +20,136 @@ + + + + + + + + + + + + + + + + + Pick Class + Fonts/DroidSans.ttf,64 + + + + + + + + + + + + + + Textures/Icons/Classes/Assault-01.png + + + + PickClass + 1 + + + + + + + + + + + Assault + Fonts/DroidSans.ttf,64 + + + + + + + + + + + + + + + + Textures/Icons/Classes/Sniper-01.png + + + + PickClass + 3 + + + + + + + + + + + Sniper + Fonts/DroidSans.ttf,64 + + + + + + + + + + + + + + + + Textures/Icons/Classes/Defender-01.png + + + + PickClass + 2 + + + + + + + + + + + Defender + Fonts/DroidSans.ttf,64 + + + + + + + + + + + + + + + @@ -360,136 +490,6 @@ - - - - - - - - - - - - - - - - - - Textures/Core/UnitRaptor.png - - - - PickClass - 1 - - - - - - - - - - - Assault - Fonts/DroidSans.ttf,64 - - - - - - - - - - - - - - - - Textures/Core/UnitHexagon.png - - - - PickClass - 2 - - - - - - - - - - - Defender - Fonts/DroidSans.ttf,64 - - - - - - - - - - - - - - - - Textures/Test/aM4ME4GR.png - - - - PickClass - 3 - - - - - - - - - - - Sniper - Fonts/DroidSans.ttf,64 - - - - - - - - - - - - - - - Pick Class - Fonts/DroidSans.ttf,64 - - - - - - - - - - - - - From d7f09b1a8fa988f8f9359bb941aa0d36d8e20a40 Mon Sep 17 00:00:00 2001 From: William Moberg Date: Tue, 8 Mar 2016 11:59:15 +0100 Subject: [PATCH 07/10] Added clickable buttons to switch to class/team screens, as a better alternative to Comma/Period on the keyboard. --- .../Schema/Entities/NewMapWSpectatorCam.xml | 3014 +++++++++-------- resources/Schema/Entities/OverwatchCamera.xml | 386 ++- src/Game/Systems/SpectatorCameraSystem.cpp | 19 + 3 files changed, 1907 insertions(+), 1512 deletions(-) diff --git a/resources/Schema/Entities/NewMapWSpectatorCam.xml b/resources/Schema/Entities/NewMapWSpectatorCam.xml index 456bee0e..a655bef3 100644 --- a/resources/Schema/Entities/NewMapWSpectatorCam.xml +++ b/resources/Schema/Entities/NewMapWSpectatorCam.xml @@ -23,6 +23,16 @@ + + + + + Models/Props/Highground1.mesh + + + + + @@ -77,16 +87,6 @@ - - - - - Models/Props/Highground1.mesh - - - - - @@ -1843,6 +1843,954 @@ + + + + + + + + + + Models/Props/Bridges/SciFiBridge1Blue.mesh + + + + + + + + + + + + + Models/Props/Bridges/WoodenBridge.mesh + + + + + + + + + + + + + Models/Props/Bridges/WoodenBridge.mesh + + + + + + + + + + + + + + Models/Props/Bridges/WoodenBridge.mesh + + + + + + + + + + + + + + Models/Props/Bridges/SciFiBridge1Blue.mesh + + + + + + + + + + + + + Models/Props/Bridges/SciFiBridgeDefense.mesh + + + + + + + + + + + + Models/Props/Bridges/SciFiBridgeDefense.mesh + + + + + + + + + + + Models/Props/Bridges/SciFiBridgeDefense.mesh + + + + + + + + + + + + Models/Props/Bridges/SciFiBridgeDefense.mesh + + + + + + + + + + + + + + + + + + Models/Props/Bridges/SciFiBridgeDefense.mesh + + + + + + + + + + + + Models/Props/Bridges/SciFiBridgeDefense.mesh + + + + + + + + + + + Models/Props/Bridges/SciFiBridgeDefense.mesh + + + + + + + + + + + Models/Props/Bridges/SciFiBridgeDefense.mesh + + + + + + + + + + + + + + + + + + + + Models/Props/Bridges/SciFiBridge1Blue.mesh + + + + + + + + + + + + + Models/Props/Pillars/SciFiBridgePillar1.mesh + + + + + + + + + + + + + + Models/Props/Bridges/SciFiBridge1Red.mesh + + + + + + + + + + + + + Models/Props/Bridges/WoodenBridge.mesh + + + + + + + + + + + + + + Models/Props/Bridges/SciFiBridge1Red.mesh + + + + + + + + + + + + + Models/Props/Bridges/SciFiBridgeDefense.mesh + + + + + + + + + + + + Models/Props/Bridges/SciFiBridgeDefense.mesh + + + + + + + + + + + Models/Props/Bridges/SciFiBridgeDefense.mesh + + + + + + + + + + + Models/Props/Bridges/SciFiBridgeDefense.mesh + + + + + + + + + + + + + + + + + + Models/Props/Bridges/SciFiBridgeDefense.mesh + + + + + + + + + + + + Models/Props/Bridges/SciFiBridgeDefense.mesh + + + + + + + + + + + Models/Props/Bridges/SciFiBridgeDefense.mesh + + + + + + + + + + + Models/Props/Bridges/SciFiBridgeDefense.mesh + + + + + + + + + + + + + + + + + + + + Models/Props/Pillars/SciFiBridgePillar1.mesh + + + + + + + + + + + + + + Models/Props/Bridges/SciFiBridge1Red.mesh + + + + + + + + + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + + + Models/Props/Flora/SpecialRoot.mesh + + + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + + + + Models/Props/Flora/SpecialRoot.mesh + + + + + + + + + + + + + Models/Props/Flora/TreeLog.mesh + + + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + + + + Models/Props/Flora/SpecialRoot.mesh + + + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + @@ -3281,34 +4229,6 @@ - - - - - Models/Props/Stones/AssaultHolder.mesh - - - - - - - - - - - - - - Models/Props/Stones/AssaultHolder.mesh - - - - - - - - - @@ -3391,6 +4311,34 @@ + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + @@ -3425,8 +4373,8 @@ Models/Props/Stones/AssaultHolder.mesh - - + + @@ -3448,959 +4396,24 @@ - - - - - - - - - Models/Props/Flora/AliveBush.mesh - true - - - - - - - - - - Models/Props/Flora/AliveBush.mesh - true - - - - - - - - - - - - - Models/Props/Flora/AliveBush.mesh - true - - - - - - - - - - - Models/Props/Flora/AliveBush.mesh - true - - - - - - - - - - - - - - - Models/Props/Flora/AliveBush.mesh - true - - - - - - - - - - Models/Props/Flora/AliveBush.mesh - true - - - - - - - - - - - Models/Props/Flora/AliveBush.mesh - true - - - - - - - - - - - Models/Props/Flora/AliveBush.mesh - true - - - - - - - - - - - - - Models/Props/Flora/AliveBush.mesh - true - - - - - - - - - - Models/Props/Flora/AliveBush.mesh - true - - - - - - - - - - - - Models/Props/Flora/AliveBush.mesh - true - - - - - - - - - - - - - Models/Props/Flora/AliveBush.mesh - true - - - - - - - - - - Models/Props/Flora/AliveBush.mesh - true - - - - - - - - - - - Models/Props/Flora/AliveBush.mesh - true - - - - - - - - - - - Models/Props/Flora/AliveBush.mesh - true - - - - - - - - - - - Models/Props/Flora/AliveBush.mesh - true - - - - - - - - - - - Models/Props/Flora/AliveBush.mesh - true - - - - - - - - - - - - - Models/Props/Flora/AliveBush.mesh - true - - - - - - - - - - - - - Models/Props/Flora/AliveBush.mesh - true - - - - - - - - - - - - - Models/Props/Flora/AliveBush.mesh - true - - - - - - - - - - Models/Props/Flora/AliveBush.mesh - true - - - - - - - - - - - Models/Props/Flora/AliveBush.mesh - true - - - - - - - - - - - Models/Props/Flora/AliveBush.mesh - true - - - - - - - - - - - Models/Props/Flora/AliveBush.mesh - true - - - - - - - - - - - - Models/Props/Flora/AliveBush.mesh - true - - - - - - - - - - - - - - Models/Props/Flora/SpecialRoot.mesh - - - - - - - - - - - - - Models/Props/Flora/AliveBush.mesh - true - - - - - - - - - - - - - - Models/Props/Flora/TreeLog.mesh - - - - - - - - - - - - - Models/Props/Flora/AliveBush.mesh - true - - - - - - - - - - - - - - Models/Props/Flora/AliveBush.mesh - true - - - - - - - - - - - - - - Models/Props/Flora/AliveBush.mesh - true - - - - - - - - - - - - - Models/Props/Flora/AliveBush.mesh - true - - - - - - - - - - - - Models/Props/Flora/AliveBush.mesh - true - - - - - - - - - - Models/Props/Flora/AliveBush.mesh - true - - - - - - - - - - - Models/Props/Flora/AliveBush.mesh - true - - - - - - - - - - - Models/Props/Flora/AliveBush.mesh - true - - - - - - - - - - - - - - Models/Props/Flora/SpecialRoot.mesh - - - - - - - - - - - - - Models/Props/Flora/AliveBush.mesh - true - - - - - - - - - - - - - Models/Props/Flora/AliveBush.mesh - true - - - - - - - - - - - - - - Models/Props/Flora/SpecialRoot.mesh - - - - - - - - - - - - Models/Props/Flora/AliveBush.mesh - true - - - - - - - - - - - - - Models/Props/Flora/AliveBush.mesh - true - - - - - - - - - - - - - Models/Props/Flora/AliveBush.mesh - true - - - - - - - - - - - - - - - - - - - - - Models/Props/Pillars/SciFiBridgePillar1.mesh - - - - - - - - - - - - - - Models/Props/Bridges/SciFiBridge1Blue.mesh - - - - - - - - - - - - - Models/Props/Bridges/SciFiBridge1Red.mesh - - - - - - - - - - - - - Models/Props/Bridges/WoodenBridge.mesh - - - - - - - - - - - - - - Models/Props/Bridges/WoodenBridge.mesh - - - - - - - - - - - - - - Models/Props/Bridges/WoodenBridge.mesh - - - - - - - - - - - - - Models/Props/Bridges/SciFiBridge1Red.mesh - - - - - - - - - - - - - Models/Props/Bridges/SciFiBridgeDefense.mesh - - - - - - - - - - - - Models/Props/Bridges/SciFiBridgeDefense.mesh - - - - - - - - - - - Models/Props/Bridges/SciFiBridgeDefense.mesh - - - - - - - - - - - Models/Props/Bridges/SciFiBridgeDefense.mesh - - - - - - - - - - - - - - - - - - Models/Props/Bridges/SciFiBridgeDefense.mesh - - - - - - - - - - - - Models/Props/Bridges/SciFiBridgeDefense.mesh - - - - - - - - - - - Models/Props/Bridges/SciFiBridgeDefense.mesh - - - - - - - - - - - Models/Props/Bridges/SciFiBridgeDefense.mesh - - - - - - - - - - - - - - - - - - - - Models/Props/Bridges/SciFiBridge1Blue.mesh - - - - - - - - - - - - - Models/Props/Bridges/SciFiBridgeDefense.mesh - - - - - - - - - - - - Models/Props/Bridges/SciFiBridgeDefense.mesh - - - - - - - - - - - Models/Props/Bridges/SciFiBridgeDefense.mesh - - - - - - - - - - - - Models/Props/Bridges/SciFiBridgeDefense.mesh - - - - - - - - - - - - - - - - - - Models/Props/Bridges/SciFiBridgeDefense.mesh - - - - - - - - - - - - Models/Props/Bridges/SciFiBridgeDefense.mesh - - - - - - - - - - - Models/Props/Bridges/SciFiBridgeDefense.mesh - - - - - - - - - - - Models/Props/Bridges/SciFiBridgeDefense.mesh - - - - - - - - - - - - - - - - - - - - Models/Props/Pillars/SciFiBridgePillar1.mesh - - - - - - - - - - - - - - Models/Props/Bridges/SciFiBridge1Blue.mesh - - - - - - - - - - - - - Models/Props/Bridges/SciFiBridge1Red.mesh - - - - - - - - - - - - - Models/Props/Bridges/WoodenBridge.mesh - - - - - - - - - - - + + + + + Models/Props/SciFiHolder1.mesh + + + + + + + + @@ -4479,19 +4492,6 @@ - - - - - Models/Props/SciFiHolder1.mesh - - - - - - - - @@ -4512,74 +4512,6 @@ - - - - - Models/Props/Stones/ShinyStoneCrystalBlue.mesh - - - - - - - - - - - - - - Models/Props/Stones/ShinyStoneCrystalRed.mesh - - - - - - - - - - - - - Models/Props/Stones/ShinyStoneCrystalBlue.mesh - - - - - - - - - - - - - - Models/Props/Stones/ShinyStoneCrystalBlue.mesh - - - - - - - - - - - - - - Models/Props/Stones/ShinyStoneCrystalRed.mesh - - - - - - - - @@ -4594,19 +4526,6 @@ - - - - - Models/Props/Stones/ShinyStoneCrystalRed.mesh - - - - - - - - @@ -4614,78 +4533,8 @@ Models/Props/Stones/ShinyStoneCrystalBlue.mesh - - - - - - - - - - - - Models/Props/Stones/ShinyStoneCrystalBlue.mesh - - - - - - - - - - - - - - Models/Props/Stones/ShinyStoneCrystalRed.mesh - - - - - - - - - - - - - - Models/Props/Stones/ShinyStoneCrystalRed.mesh - - - - - - - - - - - - - - Models/Props/Stones/ShinyStoneCrystalRed.mesh - - - - - - - - - - - - - - Models/Props/Stones/ShinyStoneCrystalBlue.mesh - - - - + + @@ -4711,8 +4560,35 @@ Models/Props/Stones/ShinyStoneCrystalBlue.mesh - - + + + + + + + + + + + + Models/Props/Stones/ShinyStoneCrystalRed.mesh + + + + + + + + + + + + + Models/Props/Stones/ShinyStoneCrystalRed.mesh + + + + @@ -4732,6 +4608,130 @@ + + + + + Models/Props/Stones/ShinyStoneCrystalRed.mesh + + + + + + + + + + + + + + Models/Props/Stones/ShinyStoneCrystalBlue.mesh + + + + + + + + + + + + + + Models/Props/Stones/ShinyStoneCrystalBlue.mesh + + + + + + + + + + + + + + Models/Props/Stones/ShinyStoneCrystalRed.mesh + + + + + + + + + + + + + Models/Props/Stones/ShinyStoneCrystalRed.mesh + + + + + + + + + + + + + Models/Props/Stones/ShinyStoneCrystalBlue.mesh + + + + + + + + + + + + + + Models/Props/Stones/ShinyStoneCrystalRed.mesh + + + + + + + + + + + + + + Models/Props/Stones/ShinyStoneCrystalBlue.mesh + + + + + + + + + + + + + + Models/Props/Stones/ShinyStoneCrystalBlue.mesh + + + + + + + + + @@ -4750,6 +4750,76 @@ + + + + + + + + + + Schema/Entities/Player.xml + + + + + + + + + + + Models/Characters/Assault/AssaultTPose.mesh + false + + + + + + + + + + + + Models/Characters/Assault/AssaultTPose.mesh + false + + + + + + + + + + + + Models/Characters/Assault/AssaultTPose.mesh + false + + + + + + + + + + + + Models/Characters/Assault/AssaultTPose.mesh + false + + + + + + + + + @@ -4947,6 +5017,19 @@ + + + + + Models/Characters/Assault/AssaultTPose.mesh + false + + + + + + + @@ -4973,19 +5056,6 @@ - - - - - Models/Characters/Assault/AssaultTPose.mesh - false - - - - - - - @@ -5006,28 +5076,6 @@ - - - - 1 - - - - - - - - - - - 10 - - - - - - - @@ -5041,10 +5089,23 @@ - - 1 - - + + 10 + + + + + + + + + + + 1 + + + + @@ -5077,11 +5138,20 @@ 10 - + + + + + 1 + + + + + @@ -5101,8 +5171,8 @@ Models/Props/PickUps/AmmoPickUp.mesh - - + + @@ -5120,46 +5190,8 @@ Models/Props/PickUps/AmmoPickUp.mesh - - - - - - - - - - - - - 0.10000000149011612 - - - - Models/Props/PickUps/HealthPickUp.mesh - - - - - - - - - - - - - - - 0.10000000149011612 - - - - Models/Props/PickUps/HealthPickUp.mesh - - - - + + @@ -5178,7 +5210,64 @@ - + + + + + + + + + + + + 0.10000000149011612 + + + + Models/Props/PickUps/HealthPickUp.mesh + + + + + + + + + + + + + + + 0.10000000149011612 + + + + Models/Props/PickUps/AmmoPickUp.mesh + + + + + + + + + + + + + + + 0.10000000149011612 + + + + Models/Props/PickUps/HealthPickUp.mesh + + + + @@ -5197,26 +5286,7 @@ - - - - - - - - - - - - 0.10000000149011612 - - - - Models/Props/PickUps/AmmoPickUp.mesh - - - - + @@ -5235,7 +5305,7 @@ - + @@ -5243,76 +5313,6 @@ - - - - - - - - - - Schema/Entities/Player.xml - - - - - - - - - - - Models/Characters/Assault/AssaultTPose.mesh - false - - - - - - - - - - - - Models/Characters/Assault/AssaultTPose.mesh - false - - - - - - - - - - - - Models/Characters/Assault/AssaultTPose.mesh - false - - - - - - - - - - - - Models/Characters/Assault/AssaultTPose.mesh - false - - - - - - - - - @@ -5321,6 +5321,7 @@ + @@ -5345,41 +5346,27 @@ - - - - Pick Class - Fonts/DroidSans.ttf,64 - - - - - - - - - - + - Textures/Icons/Classes/Assault-01.png + Textures/Icons/Classes/Defender-01.png PickClass - 1 + 2 - + - + - Assault + Defender Fonts/DroidSans.ttf,64 @@ -5425,27 +5412,27 @@ - + - Textures/Icons/Classes/Defender-01.png + Textures/Icons/Classes/Assault-01.png PickClass - 2 + 1 - + - + - Defender + Assault Fonts/DroidSans.ttf,64 @@ -5458,6 +5445,66 @@ + + + + Pick Class + Fonts/DroidSans.ttf,64 + + + + + + + + + + + + + + Textures/Core/UnitHexagon.png + + + + + SwapToTeamPick + 1 + + + + + + + + + + + Change + Fonts/DroidSans.ttf,64 + + + + + + + + + + + + Team + Fonts/DroidSans.ttf,64 + + + + + + + + + + @@ -5475,6 +5522,20 @@ + + + + Pick Team + Fonts/DroidSans.ttf,64 + + + + + + + + + @@ -5526,7 +5587,7 @@ - + Red @@ -5574,19 +5635,54 @@ - + - - Pick Team - Fonts/DroidSans.ttf,64 - - + + + Textures/Core/UnitHexagon.png + + + false + + + SwapToClassPick + 1 + - - + + - + + + + + Change + Fonts/DroidSans.ttf,64 + false + + + + + + + + + + + + Class + Fonts/DroidSans.ttf,64 + false + + + + + + + + + @@ -5605,6 +5701,20 @@ + + + + 1 + Fonts/DroidSans.ttf,64 + + + + + + + + + @@ -5618,10 +5728,10 @@ Textures/Core/UnitHexagon.png - + - + @@ -5631,7 +5741,7 @@ - 4 + 3 Textures/Core/UnitHexagon_Rotated.png @@ -5652,10 +5762,10 @@ Textures/Core/UnitHexagon.png - + - + @@ -5665,7 +5775,7 @@ - 3 + 4 Textures/Core/UnitHexagon_Rotated.png @@ -5715,38 +5825,6 @@ - - - - Textures/Core/UnitHexagon.png - - - - - - - - - - - - - - - - Textures/Core/UnitHexagon_Rotated.png - - - - - - - - - - - - @@ -5782,21 +5860,131 @@ + + + + Textures/Core/UnitHexagon.png + + + + + + + + + + + + + + + + Textures/Core/UnitHexagon_Rotated.png + + + + + + + + + + + + - + - - 16 - Fonts/DroidSans.ttf,64 - - + + + Textures/Core/UnitHexagon.png + + + + + SwapToTeamPick + 1 + - - + + - + + + + + Change + Fonts/DroidSans.ttf,64 + + + + + + + + + + + + Team + Fonts/DroidSans.ttf,64 + + + + + + + + + + + + + + + Textures/Core/UnitHexagon.png + + + + + SwapToClassPick + 1 + + + + + + + + + + + Change + Fonts/DroidSans.ttf,64 + + + + + + + + + + + + Class + Fonts/DroidSans.ttf,64 + + + + + + + + + diff --git a/resources/Schema/Entities/OverwatchCamera.xml b/resources/Schema/Entities/OverwatchCamera.xml index 55e9099c..075e57e2 100644 --- a/resources/Schema/Entities/OverwatchCamera.xml +++ b/resources/Schema/Entities/OverwatchCamera.xml @@ -8,6 +8,7 @@ + @@ -33,19 +34,38 @@ - + - - Pick Class - Fonts/DroidSans.ttf,64 - - + + + Textures/Icons/Classes/Sniper-01.png + + + + PickClass + 3 + - - + + - + + + + + Sniper + Fonts/DroidSans.ttf,64 + + + + + + + + + + @@ -80,39 +100,6 @@ - - - - - Textures/Icons/Classes/Sniper-01.png - - - - PickClass - 3 - - - - - - - - - - - Sniper - Fonts/DroidSans.ttf,64 - - - - - - - - - - - @@ -146,6 +133,66 @@ + + + + Pick Class + Fonts/DroidSans.ttf,64 + + + + + + + + + + + + + + Textures/Core/UnitHexagon.png + + + + + SwapToTeamPick + 1 + + + + + + + + + + + Change + Fonts/DroidSans.ttf,64 + + + + + + + + + + + + Team + Fonts/DroidSans.ttf,64 + + + + + + + + + + @@ -163,6 +210,20 @@ + + + + Pick Team + Fonts/DroidSans.ttf,64 + + + + + + + + + @@ -214,7 +275,7 @@ - + Red @@ -262,19 +323,54 @@ - + - - Pick Team - Fonts/DroidSans.ttf,64 - - + + + Textures/Core/UnitHexagon.png + + + false + + + SwapToClassPick + 1 + - - + + - + + + + + Change + Fonts/DroidSans.ttf,64 + false + + + + + + + + + + + + Class + Fonts/DroidSans.ttf,64 + false + + + + + + + + + @@ -293,6 +389,20 @@ + + + + 15 + Fonts/DroidSans.ttf,64 + + + + + + + + + @@ -306,10 +416,10 @@ Textures/Core/UnitHexagon.png - + - + @@ -319,7 +429,7 @@ - 4 + 3 Textures/Core/UnitHexagon_Rotated.png @@ -340,10 +450,10 @@ Textures/Core/UnitHexagon.png - + - + @@ -353,7 +463,7 @@ - 3 + 4 Textures/Core/UnitHexagon_Rotated.png @@ -403,38 +513,6 @@ - - - - Textures/Core/UnitHexagon.png - - - - - - - - - - - - - - - - Textures/Core/UnitHexagon_Rotated.png - - - - - - - - - - - - @@ -470,21 +548,131 @@ + + + + Textures/Core/UnitHexagon.png + + + + + + + + + + + + + + + + Textures/Core/UnitHexagon_Rotated.png + + + + + + + + + + + + - + - - 16 - Fonts/DroidSans.ttf,64 - - + + + Textures/Core/UnitHexagon.png + + + + + SwapToTeamPick + 1 + - - + + - + + + + + Change + Fonts/DroidSans.ttf,64 + + + + + + + + + + + + Team + Fonts/DroidSans.ttf,64 + + + + + + + + + + + + + + + Textures/Core/UnitHexagon.png + + + + + SwapToClassPick + 1 + + + + + + + + + + + Change + Fonts/DroidSans.ttf,64 + + + + + + + + + + + + Class + Fonts/DroidSans.ttf,64 + + + + + + + + + diff --git a/src/Game/Systems/SpectatorCameraSystem.cpp b/src/Game/Systems/SpectatorCameraSystem.cpp index 58f25155..60b82b0d 100644 --- a/src/Game/Systems/SpectatorCameraSystem.cpp +++ b/src/Game/Systems/SpectatorCameraSystem.cpp @@ -60,6 +60,25 @@ bool SpectatorCameraSystem::OnInputCommand(const Events::InputCommand& e) EntityWrapper spectatorCam = m_World->GetFirstEntityByName(camName); // Set the camera as active, if it exists. if (spectatorCam.Valid() && 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); From 7bc3c9f7b17a3a89e8a09dc8b27a1124b45a24b6 Mon Sep 17 00:00:00 2001 From: William Moberg Date: Tue, 8 Mar 2016 18:26:17 +0100 Subject: [PATCH 08/10] Don't force to spectator camera if player presses pickTeam/Class prematurely. Players team should be remembered after picked, spawn request is not erased anymore. --- include/Game/Systems/PlayerDeathSystem.h | 2 ++ src/Game/Systems/PlayerDeathSystem.cpp | 12 ++++++++++++ src/Game/Systems/PlayerSpawnSystem.cpp | 12 ++++-------- 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/include/Game/Systems/PlayerDeathSystem.h b/include/Game/Systems/PlayerDeathSystem.h index 5a82f999..91b9997b 100644 --- a/include/Game/Systems/PlayerDeathSystem.h +++ b/include/Game/Systems/PlayerDeathSystem.h @@ -24,6 +24,8 @@ private: bool OnPlayerDeath(Events::PlayerDeath& e); EventRelay m_EEntityDeleted; bool OnEntityDeleted(Events::EntityDeleted& e); + EventRelay m_EInputCommand; + bool OnInputCommand(Events::InputCommand& e); void setSpectatorCamera(); void createDeathEffect(EntityWrapper player); diff --git a/src/Game/Systems/PlayerDeathSystem.cpp b/src/Game/Systems/PlayerDeathSystem.cpp index c562e530..4b7606e7 100644 --- a/src/Game/Systems/PlayerDeathSystem.cpp +++ b/src/Game/Systems/PlayerDeathSystem.cpp @@ -6,6 +6,7 @@ PlayerDeathSystem::PlayerDeathSystem(SystemParams params) { EVENT_SUBSCRIBE_MEMBER(m_OnPlayerDeath, &PlayerDeathSystem::OnPlayerDeath); EVENT_SUBSCRIBE_MEMBER(m_EEntityDeleted, &PlayerDeathSystem::OnEntityDeleted); + EVENT_SUBSCRIBE_MEMBER(m_EInputCommand, &PlayerDeathSystem::OnInputCommand); } void PlayerDeathSystem::Update(double dt) @@ -90,3 +91,14 @@ void PlayerDeathSystem::setSpectatorCamera() 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; +} \ No newline at end of file diff --git a/src/Game/Systems/PlayerSpawnSystem.cpp b/src/Game/Systems/PlayerSpawnSystem.cpp index e13f1bdc..0c0c60a1 100644 --- a/src/Game/Systems/PlayerSpawnSystem.cpp +++ b/src/Game/Systems/PlayerSpawnSystem.cpp @@ -134,16 +134,12 @@ bool PlayerSpawnSystem::OnInputCommand(Events::InputCommand& e) auto iter = m_SpawnRequests.begin(); for (; iter != m_SpawnRequests.end(); ++iter) { if (iter->PlayerID == e.PlayerID) { - // If player wants to switch team, remove their spawn request. - if (e.Command == "SwapToTeamPick") { - m_SpawnRequests.erase(iter); - } else if (e.Command == "SwapToClassPick") { - // If player wants to switch class, remove their selected class so they don't spawn. + // If player wants to switch team or class , remove their selected class so they don't spawn. + if (e.Command == "SwapToTeamPick" || e.Command == "SwapToClassPick") { iter->Class = -1; - } else { - break; + return true; } - return true; + break; } } From b782e735564f7cbf9583a9e32462a1e515b20555 Mon Sep 17 00:00:00 2001 From: William Moberg Date: Wed, 9 Mar 2016 10:56:05 +0100 Subject: [PATCH 09/10] Falsified DepthSort for SpectatorCamera buttons and CP-HUD elements. --- .../Schema/Entities/CapturePointHUDGroup.xml | 115 +- .../Schema/Entities/NewMapWSpectatorCam.xml | 2153 +++++++++-------- resources/Schema/Entities/OverwatchCamera.xml | 90 +- 3 files changed, 1209 insertions(+), 1149 deletions(-) diff --git a/resources/Schema/Entities/CapturePointHUDGroup.xml b/resources/Schema/Entities/CapturePointHUDGroup.xml index d35e1bde..0987cc56 100644 --- a/resources/Schema/Entities/CapturePointHUDGroup.xml +++ b/resources/Schema/Entities/CapturePointHUDGroup.xml @@ -13,38 +13,8 @@ Textures/Core/UnitHexagon.png - - - - - - - - - - - 2 - - - - - - Textures/Core/UnitHexagon_Rotated.png - - - - - - - - - - - - - - - Textures/Core/UnitHexagon.png + + false @@ -54,20 +24,21 @@ + + + 3 - - 0.80222018197612788 - - Textures/Core/UnitHexagon_Rotated.png + + false - + @@ -78,6 +49,8 @@ Textures/Core/UnitHexagon.png + + false @@ -87,19 +60,21 @@ - - 4 - + + 4 + Textures/Core/UnitHexagon_Rotated.png + + false - + @@ -110,6 +85,44 @@ Textures/Core/UnitHexagon.png + + false + + + + + + + + + + + + + + 2 + + + Textures/Core/UnitHexagon_Rotated.png + + false + + + + + + + + + + + + + + + Textures/Core/UnitHexagon.png + + false @@ -119,19 +132,21 @@ - - 1 - + + 1 + Textures/Core/UnitHexagon_Rotated.png + + false - + @@ -142,7 +157,9 @@ Textures/Core/UnitHexagon.png - + + false + @@ -151,17 +168,19 @@ - + Textures/Core/UnitHexagon_Rotated.png + + false - + diff --git a/resources/Schema/Entities/NewMapWSpectatorCam.xml b/resources/Schema/Entities/NewMapWSpectatorCam.xml index a655bef3..66561969 100644 --- a/resources/Schema/Entities/NewMapWSpectatorCam.xml +++ b/resources/Schema/Entities/NewMapWSpectatorCam.xml @@ -3,6 +3,7 @@ + 10.841646792775492 15 @@ -23,6 +24,16 @@ + + + + + Models/Props/Highground4.mesh + + + + + @@ -77,16 +88,6 @@ - - - - - Models/Props/Highground4.mesh - - - - - @@ -2791,11 +2792,425 @@ + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + + + + + Models/Props/Stones/SmallStone2.mesh + + + + + + + + + + + + + + Models/Props/Stones/ShinyStoneCrystalRed.mesh + + + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Walls/MediumWall1.mesh + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + @@ -2907,6 +3322,18 @@ + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + @@ -3217,6 +3644,19 @@ + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + @@ -3270,19 +3710,6 @@ - - - - - Models/Props/Stones/BigStone.mesh - - - - - - - - @@ -3298,20 +3725,6 @@ - - - - - Models/Props/Stones/ShinyStoneCrystalRed.mesh - - - - - - - - - @@ -3325,20 +3738,6 @@ - - - - - Models/Props/Stones/SmallStone2.mesh - - - - - - - - - @@ -3379,18 +3778,6 @@ - - - - - Models/Props/Walls/MediumWall1.mesh - - - - - - - @@ -3404,47 +3791,6 @@ - - - - - Models/Props/Stones/MediumStone2.mesh - - - - - - - - - - - - Models/Props/Stones/SmallStone1.mesh - - - - - - - - - - - - - - Models/Props/Stones/MediumStone2.mesh - - - - - - - - - - @@ -3458,19 +3804,6 @@ - - - - - Models/Props/Stones/BigStone.mesh - - - - - - - - @@ -3485,19 +3818,6 @@ - - - - - Models/Props/Stones/MediumStone2.mesh - - - - - - - - @@ -3512,19 +3832,6 @@ - - - - - Models/Props/Stones/BigStone.mesh - - - - - - - - @@ -3538,20 +3845,6 @@ - - - - - Models/Props/Stones/MediumStone2.mesh - - - - - - - - - @@ -3565,100 +3858,6 @@ - - - - - Models/Props/Stones/BigStone.mesh - - - - - - - - - - - - Models/Props/Stones/BigStone.mesh - - - - - - - - - - - - - Models/Props/Stones/BigStone.mesh - - - - - - - - - - - - - Models/Props/Stones/BigStone.mesh - - - - - - - - - - - - Models/Props/Stones/BigStone.mesh - - - - - - - - - - - - - - - Models/Props/Stones/BigStone.mesh - - - - - - - - - - - - - Models/Props/Stones/MediumStone2.mesh - - - - - - - - - - - @@ -3673,18 +3872,6 @@ - - - - - Models/Props/Stones/MediumStone2.mesh - - - - - - - @@ -3717,6 +3904,19 @@ + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + @@ -3744,19 +3944,6 @@ - - - - - Models/Props/Stones/SmallStone1.mesh - - - - - - - - @@ -3775,20 +3962,6 @@ - - - - - Models/Props/Stones/MediumStone2.mesh - - - - - - - - - @@ -3796,6 +3969,115 @@ + + + + + Models/Core/UnitCube.mesh + + + + + + + + + + + + + Models/Core/UnitCube.mesh + + + + + + + + + + + + + + + + Models/Props/Pillars/SciFiBridgePillar1.mesh + + + + + + + + + + + + + Models/Core/UnitPlane.mesh + + true + + + + + + + + + + + + + + Models/Props/Walls/MediumWall2.mesh + + + + + + + + + + + Models/Props/Walls/MediumWall2.mesh + + + + + + + + + + + + + + + Models/Props/Walls/MediumWall1.mesh + + + + + + + + + + + Models/Props/Walls/MediumWall1.mesh + + + + + + + + + @@ -3823,47 +4105,6 @@ - - - - - Models/Props/Walls/MediumWall2.mesh - - - - - - - - - - - Models/Props/Walls/MediumWall2.mesh - - - - - - - - - - - - - - Models/Core/UnitPlane.mesh - - true - - - - - - - - - @@ -3871,9 +4112,9 @@ Models/Props/Pillars/SciFiBridgePillar1.mesh - - - + + + @@ -3882,10 +4123,10 @@ - Models/Props/Walls/MediumWall1.mesh + Models/Props/Walls/MediumWall3.mesh - + @@ -3893,10 +4134,10 @@ - Models/Props/Walls/MediumWall1.mesh + Models/Props/Walls/MediumWall3.mesh - + @@ -3918,6 +4159,20 @@ + + + + + Models/Props/Pillars/SciFiBridgePillar1.mesh + + + + + + + + + @@ -3984,45 +4239,6 @@ - - - - - Models/Props/Walls/MediumWall3.mesh - - - - - - - - - - - Models/Props/Walls/MediumWall3.mesh - - - - - - - - - - - - - - Models/Props/Pillars/SciFiBridgePillar1.mesh - - - - - - - - - @@ -4037,49 +4253,6 @@ - - - - - Models/Core/UnitCube.mesh - - - - - - - - - - - - - Models/Core/UnitCube.mesh - - - - - - - - - - - - - - - - Models/Props/Pillars/SciFiBridgePillar1.mesh - - - - - - - - - @@ -4108,8 +4281,21 @@ Models/Props/PickUps/PickUpHolder.mesh - - + + + + + + + + + + + Models/Props/PickUps/PickUpHolder.mesh + + + + @@ -4136,9 +4322,9 @@ Models/Props/PickUps/PickUpHolder.mesh - - - + + + @@ -4150,8 +4336,9 @@ Models/Props/PickUps/PickUpHolder.mesh - - + + + @@ -4194,20 +4381,6 @@ - - - - - Models/Props/PickUps/PickUpHolder.mesh - - - - - - - - - @@ -4224,183 +4397,24 @@ - - - - - - - - - - Models/Props/Stones/AssaultHolder.mesh - - - - - - - - - - - - Models/Props/Stones/AssaultHolder.mesh - - - - - - - - - - - - Models/Props/Stones/AssaultHolder.mesh - - - - - - - - - - - - Models/Props/Stones/AssaultHolder.mesh - - - - - - - - - - - - - - - - - - - Models/Props/Stones/AssaultHolder.mesh - - - - - - - - - - - - Models/Props/Stones/AssaultHolder.mesh - - - - - - - - - - - - - - - Models/Props/Stones/AssaultHolder.mesh - - - - - - - - - - - - - - Models/Props/Stones/AssaultHolder.mesh - - - - - - - - - - - - - - Models/Props/Stones/AssaultHolder.mesh - - - - - - - - - - - - Models/Props/Stones/AssaultHolder.mesh - - - - - - - - - - - - - - - Models/Props/Stones/AssaultHolder.mesh - - - - - - - - - - - - - - Models/Props/Stones/AssaultHolder.mesh - - - - - - - - - - - + + + + + Models/Props/SciFiHolder1.mesh + + + + + + + + @@ -4479,19 +4493,6 @@ - - - - - Models/Props/SciFiHolder1.mesh - - - - - - - - @@ -4519,40 +4520,13 @@ Models/Props/Stones/ShinyStoneCrystalRed.mesh - - + + - - - - - Models/Props/Stones/ShinyStoneCrystalBlue.mesh - - - - - - - - - - - - - - Models/Props/Stones/ShinyStoneCrystalBlue.mesh - - - - - - - - @@ -4574,36 +4548,9 @@ Models/Props/Stones/ShinyStoneCrystalRed.mesh - - - - - - - - - - - Models/Props/Stones/ShinyStoneCrystalRed.mesh - - - - - - - - - - - - - - Models/Props/Stones/ShinyStoneCrystalBlue.mesh - - - - - + + + @@ -4629,8 +4576,35 @@ Models/Props/Stones/ShinyStoneCrystalBlue.mesh - - + + + + + + + + + + + + Models/Props/Stones/ShinyStoneCrystalRed.mesh + + + + + + + + + + + + + Models/Props/Stones/ShinyStoneCrystalBlue.mesh + + + + @@ -4657,8 +4631,22 @@ Models/Props/Stones/ShinyStoneCrystalRed.mesh - - + + + + + + + + + + + + Models/Props/Stones/ShinyStoneCrystalBlue.mesh + + + + @@ -4670,8 +4658,49 @@ Models/Props/Stones/ShinyStoneCrystalRed.mesh - - + + + + + + + + + + + Models/Props/Stones/ShinyStoneCrystalBlue.mesh + + + + + + + + + + + + + + Models/Props/Stones/ShinyStoneCrystalBlue.mesh + + + + + + + + + + + + + + Models/Props/Stones/ShinyStoneCrystalRed.mesh + + + + @@ -4690,20 +4719,6 @@ - - - - - Models/Props/Stones/ShinyStoneCrystalRed.mesh - - - - - - - - - @@ -4718,20 +4733,6 @@ - - - - - Models/Props/Stones/ShinyStoneCrystalBlue.mesh - - - - - - - - - @@ -4750,6 +4751,248 @@ + + + + + + + + + + + 0.10000000149011612 + + + + Models/Props/PickUps/AmmoPickUp.mesh + + + + + + + + + + + + + + + 0.10000000149011612 + + + + Models/Props/PickUps/HealthPickUp.mesh + + + + + + + + + + + + + + + 0.10000000149011612 + + + + Models/Props/PickUps/HealthPickUp.mesh + + + + + + + + + + + + + + + 0.10000000149011612 + + + + Models/Props/PickUps/HealthPickUp.mesh + + + + + + + + + + + + + + + 0.10000000149011612 + + + + Models/Props/PickUps/AmmoPickUp.mesh + + + + + + + + + + + + + + + 0.10000000149011612 + + + + Models/Props/PickUps/HealthPickUp.mesh + + + + + + + + + + + + + + + 0.10000000149011612 + + + + Models/Props/PickUps/AmmoPickUp.mesh + + + + + + + + + + + + + + + 0.10000000149011612 + + + + Models/Props/PickUps/AmmoPickUp.mesh + + + + + + + + + + + + + + + + + + + + 10 + + + + + + + + + + 10 + + + + + + + + + + + + + 10 + + + + + + + + + + + 10 + + + + + + + + + + + 10 + + + + + + + + + + + 1 + + + + + + + + + + + 1 + + + + + + + @@ -4774,7 +5017,7 @@ false - + @@ -4800,7 +5043,7 @@ false - + @@ -4813,7 +5056,7 @@ false - + @@ -4829,35 +5072,61 @@ - Models/Props/CapturePoint/CapturePointBlue.mesh + Models/Props/CapturePoint/CapturePointNeutral.mesh - + - - - - 4 + 1.5498908015879351 + 1 - - - - - + Models/Core/UnitCylinder.mesh - + true - - + + + + + + + + + + + + + Models/Props/CapturePoint/CapturePointNeutral.mesh + + + + + + + + + + 2 + + + + + Models/Core/UnitCylinder.mesh + + true + + + + @@ -4902,39 +5171,6 @@ - - - - - Models/Props/CapturePoint/CapturePointNeutral.mesh - - - - - - - - - - 1.5498908015879351 - 1 - - - - - Models/Core/UnitCylinder.mesh - - true - - - - - - - - - - @@ -4971,28 +5207,35 @@ - Models/Props/CapturePoint/CapturePointNeutral.mesh + Models/Props/CapturePoint/CapturePointBlue.mesh - + - 2 + + + + 4 - + + + + + Models/Core/UnitCylinder.mesh - + true - - + + @@ -5017,6 +5260,19 @@ + + + + + Models/Characters/Assault/AssaultTPose.mesh + false + + + + + + + @@ -5043,19 +5299,6 @@ - - - - - Models/Characters/Assault/AssaultTPose.mesh - false - - - - - - - @@ -5071,248 +5314,6 @@ - - - - - - - - - 10 - - - - - - - - - - - 10 - - - - - - - - - - - 1 - - - - - - - - - - - 10 - - - - - - - - - - 10 - - - - - - - - - - - - - 10 - - - - - - - - - - - 1 - - - - - - - - - - - - - - - - - - 0.10000000149011612 - - - - Models/Props/PickUps/AmmoPickUp.mesh - - - - - - - - - - - - - - - 0.10000000149011612 - - - - Models/Props/PickUps/AmmoPickUp.mesh - - - - - - - - - - - - - - - 0.10000000149011612 - - - - Models/Props/PickUps/HealthPickUp.mesh - - - - - - - - - - - - - - - 0.10000000149011612 - - - - Models/Props/PickUps/HealthPickUp.mesh - - - - - - - - - - - - - - - 0.10000000149011612 - - - - Models/Props/PickUps/AmmoPickUp.mesh - - - - - - - - - - - - - - - 0.10000000149011612 - - - - Models/Props/PickUps/HealthPickUp.mesh - - - - - - - - - - - - - - - 0.10000000149011612 - - - - Models/Props/PickUps/AmmoPickUp.mesh - - - - - - - - - - - - - - - 0.10000000149011612 - - - - Models/Props/PickUps/HealthPickUp.mesh - - - - - - - - - - - @@ -5321,7 +5322,7 @@ - + @@ -5346,12 +5347,47 @@ + + + + + Textures/Icons/Classes/Assault-01.png + + false + + + PickClass + 1 + + + + + + + + + + + Assault + Fonts/DroidSans.ttf,64 + + + + + + + + + + + Textures/Icons/Classes/Defender-01.png + false PickClass @@ -5385,6 +5421,7 @@ Textures/Icons/Classes/Sniper-01.png + false PickClass @@ -5412,39 +5449,6 @@ - - - - - Textures/Icons/Classes/Assault-01.png - - - - PickClass - 1 - - - - - - - - - - - Assault - Fonts/DroidSans.ttf,64 - - - - - - - - - - - @@ -5465,6 +5469,7 @@ Textures/Core/UnitHexagon.png + false @@ -5542,6 +5547,7 @@ Textures/Core/UnitHexagon.png + false @@ -5575,6 +5581,7 @@ Textures/Core/UnitHexagon.png + false @@ -5608,6 +5615,7 @@ Textures/Core/UnitHexagon.png + false @@ -5641,6 +5649,7 @@ Textures/Core/UnitHexagon.png + false false @@ -5704,7 +5713,7 @@ - 1 + 5 Fonts/DroidSans.ttf,64 @@ -5728,6 +5737,7 @@ Textures/Core/UnitHexagon.png + false @@ -5746,6 +5756,7 @@ Textures/Core/UnitHexagon_Rotated.png + false @@ -5762,6 +5773,7 @@ Textures/Core/UnitHexagon.png + false @@ -5780,6 +5792,7 @@ Textures/Core/UnitHexagon_Rotated.png + false @@ -5796,6 +5809,7 @@ Textures/Core/UnitHexagon.png + false @@ -5814,6 +5828,7 @@ Textures/Core/UnitHexagon_Rotated.png + false @@ -5830,6 +5845,7 @@ Textures/Core/UnitHexagon.png + false @@ -5849,6 +5865,7 @@ Textures/Core/UnitHexagon_Rotated.png + false @@ -5865,6 +5882,7 @@ Textures/Core/UnitHexagon.png + false @@ -5881,6 +5899,7 @@ Textures/Core/UnitHexagon_Rotated.png + false @@ -5900,6 +5919,7 @@ Textures/Core/UnitHexagon.png + false @@ -5946,6 +5966,7 @@ Textures/Core/UnitHexagon.png + false diff --git a/resources/Schema/Entities/OverwatchCamera.xml b/resources/Schema/Entities/OverwatchCamera.xml index 075e57e2..6c93f033 100644 --- a/resources/Schema/Entities/OverwatchCamera.xml +++ b/resources/Schema/Entities/OverwatchCamera.xml @@ -8,7 +8,7 @@ - + @@ -34,12 +34,47 @@ + + + + + Textures/Icons/Classes/Defender-01.png + + false + + + PickClass + 2 + + + + + + + + + + + Defender + Fonts/DroidSans.ttf,64 + + + + + + + + + + + Textures/Icons/Classes/Sniper-01.png + false PickClass @@ -73,6 +108,7 @@ Textures/Icons/Classes/Assault-01.png + false PickClass @@ -100,39 +136,6 @@ - - - - - Textures/Icons/Classes/Defender-01.png - - - - PickClass - 2 - - - - - - - - - - - Defender - Fonts/DroidSans.ttf,64 - - - - - - - - - - - @@ -153,6 +156,7 @@ Textures/Core/UnitHexagon.png + false @@ -230,6 +234,7 @@ Textures/Core/UnitHexagon.png + false @@ -263,6 +268,7 @@ Textures/Core/UnitHexagon.png + false @@ -296,6 +302,7 @@ Textures/Core/UnitHexagon.png + false @@ -329,6 +336,7 @@ Textures/Core/UnitHexagon.png + false false @@ -392,7 +400,7 @@ - 15 + 7 Fonts/DroidSans.ttf,64 @@ -416,6 +424,7 @@ Textures/Core/UnitHexagon.png + false @@ -434,6 +443,7 @@ Textures/Core/UnitHexagon_Rotated.png + false @@ -450,6 +460,7 @@ Textures/Core/UnitHexagon.png + false @@ -468,6 +479,7 @@ Textures/Core/UnitHexagon_Rotated.png + false @@ -484,6 +496,7 @@ Textures/Core/UnitHexagon.png + false @@ -502,6 +515,7 @@ Textures/Core/UnitHexagon_Rotated.png + false @@ -518,6 +532,7 @@ Textures/Core/UnitHexagon.png + false @@ -537,6 +552,7 @@ Textures/Core/UnitHexagon_Rotated.png + false @@ -553,6 +569,7 @@ Textures/Core/UnitHexagon.png + false @@ -569,6 +586,7 @@ Textures/Core/UnitHexagon_Rotated.png + false @@ -588,6 +606,7 @@ Textures/Core/UnitHexagon.png + false @@ -634,6 +653,7 @@ Textures/Core/UnitHexagon.png + false From 534d6639e5c5f57a878056fddc135a067af88e09 Mon Sep 17 00:00:00 2001 From: William Moberg Date: Wed, 9 Mar 2016 11:35:32 +0100 Subject: [PATCH 10/10] Class enum instead of hardcoded ints. Removed superfluous .Valid() checks. Check for spectator spawnrequest in case they somehow has a class, so we don't get "x players were supposed to be spawned but failed" if it happens. --- include/Game/Systems/PlayerSpawnSystem.h | 10 +++++++- src/Game/Systems/PlayerDeathSystem.cpp | 4 +-- src/Game/Systems/PlayerSpawnSystem.cpp | 30 ++++++++++++---------- src/Game/Systems/SpectatorCameraSystem.cpp | 4 +-- 4 files changed, 29 insertions(+), 19 deletions(-) diff --git a/include/Game/Systems/PlayerSpawnSystem.h b/include/Game/Systems/PlayerSpawnSystem.h index 17364a81..f74032f7 100644 --- a/include/Game/Systems/PlayerSpawnSystem.h +++ b/include/Game/Systems/PlayerSpawnSystem.h @@ -15,11 +15,19 @@ public: virtual void Update(double dt) override; private: + // This enum must correspond to the command values for PickTeam buttons. + enum class PlayerClass + { + None = 0, + Assault, + Defender, + Sniper + }; struct SpawnRequest { int PlayerID; ComponentInfo::EnumType Team; - ComponentInfo::EnumType Class; + PlayerClass Class; }; bool m_NetworkEnabled = false; diff --git a/src/Game/Systems/PlayerDeathSystem.cpp b/src/Game/Systems/PlayerDeathSystem.cpp index 4b7606e7..9f2900fa 100644 --- a/src/Game/Systems/PlayerDeathSystem.cpp +++ b/src/Game/Systems/PlayerDeathSystem.cpp @@ -35,7 +35,7 @@ void PlayerDeathSystem::createDeathEffect(EntityWrapper player) //components that we need from player auto playerModel = player.FirstChildByName("PlayerModel"); - if (!playerModel.Valid() || !playerModel.HasComponent("Model") || !playerModel.HasComponent("Animation")) { + if (!playerModel.HasComponent("Model") || !playerModel.HasComponent("Animation")) { if (player == LocalPlayer) { setSpectatorCamera(); } @@ -82,7 +82,7 @@ void PlayerDeathSystem::setSpectatorCamera() { // Look for the spectator camera entity in the level. EntityWrapper spectatorCam = m_World->GetFirstEntityByName("SpectatorCamera"); - if (!spectatorCam.Valid() || !spectatorCam.HasComponent("Camera")) { + if (!spectatorCam.HasComponent("Camera")) { return; } Events::SetCamera eSetCamera; diff --git a/src/Game/Systems/PlayerSpawnSystem.cpp b/src/Game/Systems/PlayerSpawnSystem.cpp index 0c0c60a1..9b7a9faf 100644 --- a/src/Game/Systems/PlayerSpawnSystem.cpp +++ b/src/Game/Systems/PlayerSpawnSystem.cpp @@ -63,10 +63,9 @@ void PlayerSpawnSystem::Update(double dt) int playersSpectating = 0; const int numRequestsToHandle = (int)m_SpawnRequests.size(); for (auto it = m_SpawnRequests.begin(); it != m_SpawnRequests.end(); ++it) { - // TODO: -1 Signifies no class picked, or they are a spectator, enum here later? // It is valid if they didn't pick class yet // but don't spawn anything, goto next spawnrequest. - if (it->Class == -1) { + if (it->Class == PlayerClass::None) { ++playersSpectating; continue; } @@ -80,6 +79,11 @@ void PlayerSpawnSystem::Update(double dt) if (spawner.HasComponent("Team")) { auto cSpawnerTeam = spawner["Team"]; if ((int)cSpawnerTeam["Team"] != it->Team) { + // If they somehow has a valid class as spectator, don't spawn them. + if (it->Team == cSpawnerTeam["Team"].Enum("Spectator")) { + ++playersSpectating; + break; + } continue; } } @@ -136,7 +140,7 @@ bool PlayerSpawnSystem::OnInputCommand(Events::InputCommand& e) if (iter->PlayerID == e.PlayerID) { // If player wants to switch team or class , remove their selected class so they don't spawn. if (e.Command == "SwapToTeamPick" || e.Command == "SwapToClassPick") { - iter->Class = -1; + iter->Class = PlayerClass::None; return true; } break; @@ -150,7 +154,7 @@ bool PlayerSpawnSystem::OnInputCommand(Events::InputCommand& e) if (e.Command == "PickTeam") { iter->Team = (ComponentInfo::EnumType)e.Value; } else { - iter->Class = (ComponentInfo::EnumType)e.Value; + iter->Class = static_cast(e.Value); } } 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, @@ -159,12 +163,12 @@ bool PlayerSpawnSystem::OnInputCommand(Events::InputCommand& e) req.PlayerID = e.PlayerID; if (e.Command == "PickTeam") { req.Team = (ComponentInfo::EnumType)e.Value; - req.Class = -1; // TODO: -1 Signifies no class picked, enum here later? + 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 = (ComponentInfo::EnumType)e.Value; + req.Class = static_cast(e.Value); } m_SpawnRequests.push_back(req); } else { @@ -229,10 +233,6 @@ bool PlayerSpawnSystem::OnPlayerDeath(Events::PlayerDeath& e) return false; } 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) { return false; @@ -241,13 +241,15 @@ bool PlayerSpawnSystem::OnPlayerDeath(Events::PlayerDeath& e) SpawnRequest req; req.PlayerID = m_PlayerIDs.at(e.Player.ID); req.Team = cTeam["Team"]; - // TODO: Better than temp class state code. + // TODO: Something better than temp class state code, if we ever add class enums in .xml if (e.Player.HasComponent("DashAbility")) { - req.Class = 1; // Assault + req.Class = PlayerClass::Assault; } else if (e.Player.HasComponent("SprintAbility")) { - req.Class = 3; // Sniper + req.Class = PlayerClass::Sniper; + } else if (e.Player.HasComponent("ShieldAbility")) { + req.Class = PlayerClass::Defender; } else { - req.Class = 2; // Defender + req.Class = PlayerClass::None; } m_SpawnRequests.push_back(req); diff --git a/src/Game/Systems/SpectatorCameraSystem.cpp b/src/Game/Systems/SpectatorCameraSystem.cpp index 60b82b0d..d1f2f1ce 100644 --- a/src/Game/Systems/SpectatorCameraSystem.cpp +++ b/src/Game/Systems/SpectatorCameraSystem.cpp @@ -15,7 +15,7 @@ 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.Valid() && spectatorCam.HasComponent("Camera")) { + if (spectatorCam.HasComponent("Camera")) { m_CamSetToTeamPick = true; Events::SetCamera eSetCamera; eSetCamera.CameraEntity = spectatorCam; @@ -59,7 +59,7 @@ bool SpectatorCameraSystem::OnInputCommand(const Events::InputCommand& e) } EntityWrapper spectatorCam = m_World->GetFirstEntityByName(camName); // Set the camera as active, if it exists. - if (spectatorCam.Valid() && spectatorCam.HasComponent("Camera")) { + 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") {