Compare commits

..

54 Commits

Author SHA1 Message Date
Tobias Dahl 73b8bff1f3 Revert "Shadows" 2016-03-03 14:24:43 +01:00
Tobias Dahl 1deb506fb2 Merge pull request #145 from teamfisk/Shadows
Shadows
2016-03-03 14:06:48 +01:00
FakeShemp 7ea26d10ee Rewritten. Works as a charm now. 2016-03-03 03:28:21 +01:00
FakeShemp 28e9ba1208 Merge branch 'master' into Shadows
# Conflicts:
#	include/Engine/Rendering/DrawFinalPass.h
#	src/Engine/Rendering/DrawFinalPass.cpp
#	src/Engine/Rendering/FrameBuffer.cpp
#	src/Engine/Rendering/Renderer.cpp
2016-03-03 03:00:05 +01:00
Tobias Dahl f0c2fdead1 Merge pull request #156 from teamfisk/HUD-Timers
Hud timers for dash ability
2016-03-02 22:53:25 +01:00
Tleety e1ca104fc9 Merge remote-tracking branch 'origin/master' into HUD-Timers
# Conflicts:
#	resources/Schema/Entities/Player.xml
2016-03-02 22:49:26 +01:00
Tleety 2cb4a307eb Merge branch 'master' into HUD-Timers
# Conflicts:
#	resources/Schema/Entities/QualityAssurance.xml
#	src/Game/Game.cpp
2016-03-02 22:42:12 +01:00
Jace 6507efc0db Merge pull request #162 from teamfisk/Boost-icons
Boost icons
2016-03-02 22:28:57 +01:00
Tobias Dahl 96a3e68bf4 Merge pull request #160 from teamfisk/EntityFileCaching
Entity file caching
2016-03-02 22:19:20 +01:00
Tleety 2d438060dd Player arrow change 2016-03-02 22:08:23 +01:00
Tleety a339c61f5b Merge remote-tracking branch 'origin/master' into Boost-icons
# Conflicts:
#	resources/Schema/Components.xsd
#	resources/Schema/Types/Entity.xsd
2016-03-02 21:51:52 +01:00
Tleety 8b81ba9019 Some small fixes, also added new UI elements to Player 2016-03-02 21:40:20 +01:00
Tleety 7af17049e9 BoostIcons should now track correctly 2016-03-02 18:13:09 +01:00
Tleety 8b66d29adc Skeleton system for Boost icons 2016-03-02 17:32:45 +01:00
Tleety a9a19193ad Component for Boost icons 2016-03-02 17:21:15 +01:00
Tleety cdbc348cfa AbilityCooldownHUD should now correctly track cooldown for dash ability. 2016-03-02 14:46:37 +01:00
Tleety 502a290d36 Merge branch 'master' into HUD-Timers
# Conflicts:
#	resources/Schema/Components.xsd
#	resources/Schema/Entities/PlayerRed.xml
#	resources/Schema/Types/Entity.xsd
2016-03-02 14:22:13 +01:00
FakeShemp 5a6374f013 Fix the remainder of errors. Might have borked splatmap in the process. 2016-03-02 10:57:22 +01:00
FakeShemp 1ae2f3f5f3 Begin clean-up 2016-03-01 19:10:13 +01:00
FakeShemp 1961c16fe2 add weight slider 2016-03-01 13:27:52 +01:00
FakeShemp d32a483bb4 remove farclip override 2016-03-01 13:17:17 +01:00
FakeShemp e23ea78aeb Merge remote-tracking branch 'origin/master' into Shadows
# Conflicts:
#	resources/Shaders/ForwardPlus.frag.glsl
2016-03-01 13:04:11 +01:00
FakeShemp 4153a31e3a Fix goof. 2016-02-29 19:47:24 +01:00
FakeShemp 0908be1e02 Shadows are pretty much done. 2016-02-29 19:45:56 +01:00
FakeShemp 2ed5fad699 The shadows are working 2016-02-29 19:17:16 +01:00
FakeShemp 70374fa10e It compiles, but no shadows 2016-02-29 18:20:32 +01:00
FakeShemp 20468cba1b Merge branch 'master' into Shadows
# Conflicts:
#	assets
#	include/Engine/Rendering/DrawFinalPass.h
#	include/Engine/Rendering/Renderer.h
#	resources/Shaders/ForwardPlus.frag.glsl
#	resources/Shaders/ForwardPlus.vert.glsl
#	src/Engine/Rendering/DrawFinalPass.cpp
#	src/Engine/Rendering/FrameBuffer.cpp
#	src/Engine/Rendering/Renderer.cpp
2016-02-29 18:03:00 +01:00
FakeShemp 7749fc5474 Small fixing up 2016-02-28 19:46:50 +01:00
FakeShemp 6dd7f1a657 Buggy transparent shadows.
Transparent textures might glow.
2016-02-28 18:00:23 +01:00
Tleety 144e548b7a Added AbilityCooldownHUD component and system to track the cooldown on the dashability, this needs to be extended for other abilities when they are implemented. However current dash time needs to be included into the component, since we can currently just see the max cooldown time. 2016-02-28 17:17:24 +01:00
FakeShemp 14b0a64720 begin fixing transparent object's shadows 2016-02-27 18:42:51 +01:00
FakeShemp 8647267cad Make code less dumb, save 7 fps 2016-02-27 18:04:33 +01:00
FakeShemp ecab5de056 Various shadow calculation methods implemented and ready for use. 2016-02-27 16:35:15 +01:00
FakeShemp 38d8cdded2 Texture Array is now working. Enjoy your single Bind(). 2016-02-27 15:53:28 +01:00
FakeShemp 22c391df54 Initial work on texture arrays 2016-02-26 17:40:35 +01:00
FakeShemp f220d8088c Begin clean-up 2016-02-26 10:53:16 +01:00
FakeShemp df2e4abb52 WE HAVE WORKING CASCADE SHADOWS 2016-02-25 21:21:38 +01:00
FakeShemp 8867e7ac3c Working shadows, no cascade blend yet 2016-02-25 20:29:41 +01:00
FakeShemp 73a4336206 Try some stuff 2016-02-18 23:33:10 +01:00
FakeShemp f2ab02d860 More WIP
Switching between levels seem to work, but I borked all matrices
2016-02-18 22:38:50 +01:00
FakeShemp bf376f54b6 WIP
I think this is now finding the different segments of the cascade
2016-02-18 20:48:39 +01:00
FakeShemp 178402e964 cascade shadow wip 2016-02-18 10:08:29 +01:00
FakeShemp 36043010af wip for shadows
they work, but will be shit until we get cascaded.
2016-02-10 20:51:33 +01:00
FakeShemp cb77c1ff97 Working pcf, not optimized 2016-02-10 16:16:41 +01:00
FakeShemp 69db32337d Shado wip 2016-02-10 15:16:58 +01:00
Ayumiwii 6af167675d Shadow WIP stage 2
- fix cel-shading
2016-02-10 11:48:44 +01:00
Ayumiwii ecd823cb9f Shadow WIP stage 2
-  Soft shadow
2016-02-09 16:15:11 +01:00
FakeShemp 847c539373 Fix viewport 2016-02-09 14:44:12 +01:00
Ayumiwii cb7f06573f Shadows stage 2 WIP 2016-02-09 14:08:57 +01:00
Ayumiwii 6542d1b444 Shadow WIP
- DepthTexture working
2016-02-05 17:29:53 +01:00
Ayumiwii bbf6058c17 Shadow WIP
- fixed file placing of ShadowPass.cpp
2016-02-05 16:13:46 +01:00
Ayumiwii 0e51ae7dc9 shadow wip 2016-02-05 15:31:20 +01:00
Ayumiwii c912cd7a42 Shadows wip 2016-02-05 15:12:17 +01:00
Ayumiwii 7f1016476b Shadows WIP
- create 2D texture (depthmap)
2016-02-05 15:08:56 +01:00
13 changed files with 230 additions and 7 deletions
@@ -0,0 +1,17 @@
#ifndef AbilityCooldownHUDSystem_h__
#define AbilityCooldownHUDSystem_h__
#include "../../Engine/Core/System.h"
#include "../../Engine/GLM.h"
class AbilityCooldownHUDSystem : public ImpureSystem
{
public:
AbilityCooldownHUDSystem(SystemParams params)
: System(params)
{ }
virtual void Update(double dt) override;
};
#endif
@@ -0,0 +1,19 @@
#ifndef BoostIconsHUDSystem_h__
#define BoostIconsHUDSystem_h__
#include "../../Engine/Core/System.h"
#include "../../Engine/GLM.h"
class BoostIconsHUDSystem : public PureSystem
{
public:
BoostIconsHUDSystem(SystemParams params)
: System(params)
, PureSystem("BoostIconsHUD")
{ }
virtual void UpdateComponent(EntityWrapper& entity, ComponentWrapper& capturePoint, double dt) override;
};
#endif
+2
View File
@@ -51,10 +51,12 @@
<xs:include schemaLocation="Components/Page.xsd"/> <xs:include schemaLocation="Components/Page.xsd"/>
<xs:include schemaLocation="Components/SpriteIndicator.xsd"/> <xs:include schemaLocation="Components/SpriteIndicator.xsd"/>
<xs:include schemaLocation="Components/Button.xsd"/> <xs:include schemaLocation="Components/Button.xsd"/>
<xs:include schemaLocation="Components/AbilityCooldownHUD.xsd"/>
<xs:include schemaLocation="Components/DoubleJump.xsd"/> <xs:include schemaLocation="Components/DoubleJump.xsd"/>
<xs:include schemaLocation="Components/WeaponAttachment.xsd"/> <xs:include schemaLocation="Components/WeaponAttachment.xsd"/>
<xs:include schemaLocation="Components/DefenderWeapon.xsd"/> <xs:include schemaLocation="Components/DefenderWeapon.xsd"/>
<xs:include schemaLocation="Components/CapturePointGameMode.xsd"/> <xs:include schemaLocation="Components/CapturePointGameMode.xsd"/>
<xs:include schemaLocation="Components/CapturePointArrowHUD.xsd"/> <xs:include schemaLocation="Components/CapturePointArrowHUD.xsd"/>
<xs:include schemaLocation="Components/FloatingEffect.xsd"/> <xs:include schemaLocation="Components/FloatingEffect.xsd"/>
<xs:include schemaLocation="Components/BoostIconsHUD.xsd"/>
</xs:schema> </xs:schema>
@@ -0,0 +1,3 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<AbilityCooldownHUD xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="AbilityCooldownHUD.xsd">
</AbilityCooldownHUD>
@@ -0,0 +1,9 @@
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:t="types">
<xs:import schemaLocation="../Types.xsd" namespace="types"/>
<xs:element name="AbilityCooldownHUD">
<xs:annotation>
<xs:documentation>HUD element for tracking ability cooldown. If it has a sprite and fill component it will fill the sprite with chosen color depending on the cooldown.\n A child with text component named "Cooldown"</xs:documentation>
</xs:annotation>
</xs:element>
</xs:schema>
@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<BoostIconsHUD xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="BoostIconsHUD.xsd"/>
@@ -0,0 +1,10 @@
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:t="types">
<xs:import schemaLocation="../Types.xsd" namespace="types"/>
<xs:element name="BoostIconsHUD">
<xs:annotation>
<xs:documentation>Origin for the 3 boost states. Create 3 children with Sprite and Fill components, name them "Sprint", "Defender", "Assault"</xs:documentation>
</xs:annotation>
</xs:element>
</xs:schema>
+1 -1
View File
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?> <?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<Text xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="Text.xsd"> <Text xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="Text.xsd">
<Content></Content> <Content></Content>
<Resource></Resource> <Resource>Fonts/DroidSans.ttf,64</Resource>
<Color R="1" G="1" B="1" A="1"/> <Color R="1" G="1" B="1" A="1"/>
<Visible>true</Visible> <Visible>true</Visible>
<Alignment><Center/></Alignment> <Alignment><Center/></Alignment>
+89 -6
View File
@@ -100,12 +100,12 @@
<Percentage>1</Percentage> <Percentage>1</Percentage>
<Color A="1" B="1" G="0" R="0"/> <Color A="1" B="1" G="0" R="0"/>
</c:Fill> </c:Fill>
<c:HealthHUD/>
<c:Text> <c:Text>
<Content>100/100</Content> <Content>100/100</Content>
<Resource>Fonts/DroidSans.ttf,64</Resource> <Resource>Fonts/DroidSans.ttf,64</Resource>
<Color A="0.505882382" B="3.92156863" G="1.17647064" R="0"/> <Color A="0.505882382" B="3.92156863" G="1.17647064" R="0"/>
</c:Text> </c:Text>
<c:HealthHUD/>
<c:Transform> <c:Transform>
<Position X="-0.355000019" Y="-0.203000009" Z="0.0410000011"/> <Position X="-0.355000019" Y="-0.203000009" Z="0.0410000011"/>
<Scale X="0.0350000001" Y="0.0350000001" Z="0.0350000001"/> <Scale X="0.0350000001" Y="0.0350000001" Z="0.0350000001"/>
@@ -132,7 +132,70 @@
<Orientation X="5.87300014" Y="0" Z="4.71200037"/> <Orientation X="5.87300014" Y="0" Z="4.71200037"/>
</c:Transform> </c:Transform>
</Components> </Components>
<Children/> <Children>
<Entity name="BoostIcons">
<Components>
<c:BoostIconsHUD/>
<c:Transform/>
</Components>
<Children>
<Entity name="Assault">
<Components>
<c:Fill>
<Color A="1" B="0.533333361" G="1" R="0.329411775"/>
</c:Fill>
<c:Sprite>
<DiffuseTexture>Textures/Core/White.png</DiffuseTexture>
<DepthSort>false</DepthSort>
<GlowMap></GlowMap>
<Color A="0.588235319" B="0.0392156877" G="0.184313729" R="0"/>
</c:Sprite>
<c:Transform>
<Position X="0.225000009" Y="0.168000013" Z="0"/>
<Scale X="0.27700001" Y="0.100000001" Z="0.200000003"/>
</c:Transform>
</Components>
<Children/>
</Entity>
<Entity name="Defender">
<Components>
<c:Fill>
<Color A="1" B="1" G="0.58431375" R="0.105882354"/>
</c:Fill>
<c:Sprite>
<DiffuseTexture>Textures/Core/White.png</DiffuseTexture>
<DepthSort>false</DepthSort>
<GlowMap></GlowMap>
<Color A="0.588235319" B="0.34117648" G="0.192156866" R="0"/>
</c:Sprite>
<c:Transform>
<Position X="0.224999994" Y="0.27700001" Z="0"/>
<Scale X="0.27700001" Y="0.100000001" Z="0.200000003"/>
</c:Transform>
</Components>
<Children/>
</Entity>
<Entity name="Sniper">
<Components>
<c:Fill>
<Color A="1" B="0.345098048" G="0" R="1"/>
</c:Fill>
<c:Sprite>
<DiffuseTexture>Textures/Core/White.png</DiffuseTexture>
<DepthSort>false</DepthSort>
<GlowMap></GlowMap>
<Color A="0.588235319" B="0.121568628" G="0" R="0.443137258"/>
</c:Sprite>
<c:Transform>
<Position X="0.225000009" Y="0.38500002" Z="0"/>
<Scale X="0.27700001" Y="0.100000001" Z="0.200000003"/>
</c:Transform>
</Components>
<Children/>
</Entity>
</Children>
</Entity>
</Children>
</Entity> </Entity>
</Children> </Children>
</Entity> </Entity>
@@ -196,7 +259,6 @@
<CapturePointNumber>3</CapturePointNumber> <CapturePointNumber>3</CapturePointNumber>
</c:CapturePointHUD> </c:CapturePointHUD>
<c:Fill> <c:Fill>
<Percentage>0.80222018197612788</Percentage>
<Color A="0.699999988" B="1" G="0.200000003" R="0"/> <Color A="0.699999988" B="1" G="0.200000003" R="0"/>
</c:Fill> </c:Fill>
<c:Sprite> <c:Sprite>
@@ -231,6 +293,7 @@
<CapturePointNumber>4</CapturePointNumber> <CapturePointNumber>4</CapturePointNumber>
</c:CapturePointHUD> </c:CapturePointHUD>
<c:Fill> <c:Fill>
<Percentage>1</Percentage>
<Color A="0.699999988" B="1" G="0.200000003" R="0"/> <Color A="0.699999988" B="1" G="0.200000003" R="0"/>
</c:Fill> </c:Fill>
<c:Sprite> <c:Sprite>
@@ -286,7 +349,7 @@
<c:Sprite> <c:Sprite>
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture> <DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
<GlowMap></GlowMap> <GlowMap></GlowMap>
<Color A="0.699999988" B="0" G="0.200000003" R="1"/> <Color A="0.699999988" B="0" G="0" R="1"/>
</c:Sprite> </c:Sprite>
<c:Transform> <c:Transform>
<Position X="-1.58304751" Y="0.919596612" Z="0"/> <Position X="-1.58304751" Y="0.919596612" Z="0"/>
@@ -297,7 +360,8 @@
<Components> <Components>
<c:CapturePointHUD/> <c:CapturePointHUD/>
<c:Fill> <c:Fill>
<Color A="0.699999988" B="1" G="0.200000003" R="0"/> <Percentage>1</Percentage>
<Color A="0.699999988" B="0" G="0" R="1"/>
</c:Fill> </c:Fill>
<c:Sprite> <c:Sprite>
<DiffuseTexture>Textures/Core/UnitHexagon_Rotated.png</DiffuseTexture> <DiffuseTexture>Textures/Core/UnitHexagon_Rotated.png</DiffuseTexture>
@@ -306,7 +370,7 @@
<c:Transform> <c:Transform>
<Position X="0" Y="0" Z="0.00999999978"/> <Position X="0" Y="0" Z="0.00999999978"/>
<Scale X="0.800000012" Y="0.800000012" Z="0.800000012"/> <Scale X="0.800000012" Y="0.800000012" Z="0.800000012"/>
<Orientation X="0" Y="0" Z="1.57079637"/> <Orientation X="0" Y="0" Z="4.71238899"/>
</c:Transform> </c:Transform>
</Components> </Components>
<Children/> <Children/>
@@ -369,6 +433,25 @@
</Entity> </Entity>
</Children> </Children>
</Entity> </Entity>
<Entity name="CapturePointArrow">
<Components>
<c:CapturePointArrowHUD/>
<c:Model>
<Resource>Models/Widgets/Arrows/Arrow5.mesh</Resource>
</c:Model>
<c:Team>
<Team>
<Blue/>
</Team>
</c:Team>
<c:Transform>
<Position X="0" Y="0.714000046" Z="-1.30000007"/>
<Scale X="0.200000003" Y="0.200000003" Z="0.200000003"/>
<Orientation X="0.405680239" Y="0.369605929" Z="0"/>
</c:Transform>
</Components>
<Children/>
</Entity>
</Children> </Children>
</Entity> </Entity>
<Entity name="Hands"> <Entity name="Hands">
+2
View File
@@ -51,8 +51,10 @@
<xs:element ref="c:Page" minOccurs="0"/> <xs:element ref="c:Page" minOccurs="0"/>
<xs:element ref="c:Button" minOccurs="0"/> <xs:element ref="c:Button" minOccurs="0"/>
<xs:element ref="c:WeaponAttachment" minOccurs="0"/> <xs:element ref="c:WeaponAttachment" minOccurs="0"/>
<xs:element ref="c:AbilityCooldownHUD" minOccurs="0"/>
<xs:element ref="c:DefenderWeapon" minOccurs="0"/> <xs:element ref="c:DefenderWeapon" minOccurs="0"/>
<xs:element ref="c:CapturePointArrowHUD" minOccurs="0"/> <xs:element ref="c:CapturePointArrowHUD" minOccurs="0"/>
<xs:element ref="c:BoostIconsHUD" minOccurs="0"/>
<xs:element ref="c:FloatingEffect" minOccurs="0"/> <xs:element ref="c:FloatingEffect" minOccurs="0"/>
<xs:element ref="c:AmmoPickup" minOccurs="0"/> <xs:element ref="c:AmmoPickup" minOccurs="0"/>
<xs:element ref="c:HealthPickup" minOccurs="0"/> <xs:element ref="c:HealthPickup" minOccurs="0"/>
+4
View File
@@ -27,9 +27,11 @@
#include "Rendering/AnimationSystem.h" #include "Rendering/AnimationSystem.h"
#include "Network/MultiplayerSnapshotFilter.h" #include "Network/MultiplayerSnapshotFilter.h"
#include "Game/Systems/AmmunitionHUDSystem.h" #include "Game/Systems/AmmunitionHUDSystem.h"
#include "Game/Systems/AbilityCooldownHUDSystem.h"
#include "Game/Systems/CapturePointArrowHUDSystem.h" #include "Game/Systems/CapturePointArrowHUDSystem.h"
#include "Game/Systems/KillFeedSystem.h" #include "Game/Systems/KillFeedSystem.h"
#include "Game/Systems/BoostSystem.h" #include "Game/Systems/BoostSystem.h"
#include "Game/Systems/BoostIconsHUDSystem.h"
#include "GUI/ButtonSystem.h" #include "GUI/ButtonSystem.h"
#include "GUI/MainMenuSystem.h" #include "GUI/MainMenuSystem.h"
@@ -134,6 +136,7 @@ Game::Game(int argc, char* argv[])
m_SystemPipeline->AddSystem<AmmoPickupSystem>(updateOrderLevel); m_SystemPipeline->AddSystem<AmmoPickupSystem>(updateOrderLevel);
m_SystemPipeline->AddSystem<DamageIndicatorSystem>(updateOrderLevel); m_SystemPipeline->AddSystem<DamageIndicatorSystem>(updateOrderLevel);
m_SystemPipeline->AddSystem<AmmunitionHUDSystem>(updateOrderLevel); m_SystemPipeline->AddSystem<AmmunitionHUDSystem>(updateOrderLevel);
m_SystemPipeline->AddSystem<AbilityCooldownHUDSystem>(updateOrderLevel);
m_SystemPipeline->AddSystem<CapturePointArrowHUDSystem>(updateOrderLevel); m_SystemPipeline->AddSystem<CapturePointArrowHUDSystem>(updateOrderLevel);
m_SystemPipeline->AddSystem<KillFeedSystem>(updateOrderLevel); m_SystemPipeline->AddSystem<KillFeedSystem>(updateOrderLevel);
m_SystemPipeline->AddSystem<LifetimeSystem>(updateOrderLevel); m_SystemPipeline->AddSystem<LifetimeSystem>(updateOrderLevel);
@@ -147,6 +150,7 @@ Game::Game(int argc, char* argv[])
m_SystemPipeline->AddSystem<BoostSystem>(updateOrderLevel); m_SystemPipeline->AddSystem<BoostSystem>(updateOrderLevel);
m_SystemPipeline->AddSystem<ButtonSystem>(updateOrderLevel, m_Renderer); m_SystemPipeline->AddSystem<ButtonSystem>(updateOrderLevel, m_Renderer);
m_SystemPipeline->AddSystem<MainMenuSystem>(updateOrderLevel, m_Renderer); m_SystemPipeline->AddSystem<MainMenuSystem>(updateOrderLevel, m_Renderer);
m_SystemPipeline->AddSystem<BoostIconsHUDSystem>(updateOrderLevel);
// Populate Octree with collidables // Populate Octree with collidables
++updateOrderLevel; ++updateOrderLevel;
m_SystemPipeline->AddSystem<FillOctreeSystem>(updateOrderLevel, m_OctreeCollision, "Collidable"); m_SystemPipeline->AddSystem<FillOctreeSystem>(updateOrderLevel, m_OctreeCollision, "Collidable");
@@ -0,0 +1,30 @@
#include "Game/Systems/AbilityCooldownHUDSystem.h"
void AbilityCooldownHUDSystem::Update(double dt)
{
//HUD element for tracking cooldown on the parent entity with Dashability TODO: Make sure it support other abilities when they are made.
auto abilityHUDs = m_World->GetComponents("AbilityCooldownHUD");
if (abilityHUDs == nullptr)
return;
for (auto& abilityHUDC : *abilityHUDs) {
EntityWrapper entity = EntityWrapper(m_World, abilityHUDC.EntityID);
EntityWrapper abilityEntity = entity.FirstParentWithComponent("DashAbility");
if (!abilityEntity.Valid())
return;
EntityWrapper cooldownTextEntity = entity.FirstChildByName("Cooldown");
if(cooldownTextEntity.Valid()) {
if(cooldownTextEntity.HasComponent("Text"))
{
double maxAbilityCD = (double)abilityEntity["DashAbility"]["CoolDownMaxTimer"];
double currentAbilityCD = (double)abilityEntity["DashAbility"]["CoolDownTimer"];
currentAbilityCD = currentAbilityCD >= 0.0 ? currentAbilityCD : 0.0;
std::string t = (std::string&)cooldownTextEntity["Text"]["Content"] = std::to_string(currentAbilityCD).substr(0, 3);
if(entity.HasComponent("Fill")) {
entity["Fill"]["Percentage"] = currentAbilityCD/maxAbilityCD; //TODO: current time needs to be in the component.
}
}
}
}
}
+42
View File
@@ -0,0 +1,42 @@
#include "Game/Systems/BoostIconsHUDSystem.h"
void BoostIconsHUDSystem::UpdateComponent(EntityWrapper& entity, ComponentWrapper& capturePoint, double dt)
{
EntityWrapper assaultEntity = entity.FirstChildByName("Assault");
EntityWrapper defenderEntity = entity.FirstChildByName("Defender");
EntityWrapper sniperEntity = entity.FirstChildByName("Sniper");
if(assaultEntity.Valid()) {
if (assaultEntity.HasComponent("Fill")) {
EntityWrapper parentWithAssaultBoost = assaultEntity.FirstParentWithComponent("BoostAssault");
if (parentWithAssaultBoost.Valid()) {
(double&)assaultEntity["Fill"]["Percentage"] = 1.0;
} else {
(double&)assaultEntity["Fill"]["Percentage"] = 0.0;
}
}
}
if (defenderEntity.Valid()) {
if (defenderEntity.HasComponent("Fill")) {
EntityWrapper parentWithAssaultBoost = defenderEntity.FirstParentWithComponent("BoostDefender");
if (parentWithAssaultBoost.Valid()) {
(double&)defenderEntity["Fill"]["Percentage"] = 1.0;
} else {
(double&)defenderEntity["Fill"]["Percentage"] = 0.0;
}
}
}
if (sniperEntity.Valid()) {
if (sniperEntity.HasComponent("Fill")) {
EntityWrapper parentWithAssaultBoost = sniperEntity.FirstParentWithComponent("BoostSniper");
if (parentWithAssaultBoost.Valid()) {
(double&)sniperEntity["Fill"]["Percentage"] = 1.0;
} else {
(double&)sniperEntity["Fill"]["Percentage"] = 0.0;
}
}
}
}