From 0aedeb61b4a0fee17ed5025cbdc20ab0edfe3881 Mon Sep 17 00:00:00 2001 From: verysecrethero Date: Fri, 11 Mar 2016 14:15:46 +0100 Subject: [PATCH] CapturePointSystem now sets all children visible/not visible for each red/blue/spectator --- assets | 2 +- .../Entities/aim_rays_with_capturep.xml | 110 +++++++++++++++++- src/Game/Systems/CapturePointSystem.cpp | 9 +- 3 files changed, 112 insertions(+), 9 deletions(-) diff --git a/assets b/assets index 007b54bd..33455a9d 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit 007b54bd678d0e80af878bed457e33e73bc0834a +Subproject commit 33455a9d10979b3041d7b8c026be4ac40b2ebad0 diff --git a/resources/Schema/Entities/aim_rays_with_capturep.xml b/resources/Schema/Entities/aim_rays_with_capturep.xml index 3cf5a26a..60030ba5 100644 --- a/resources/Schema/Entities/aim_rays_with_capturep.xml +++ b/resources/Schema/Entities/aim_rays_with_capturep.xml @@ -13,6 +13,7 @@ models/core/unitcube.mesh + false @@ -28,6 +29,7 @@ models/core/unitcube.mesh + false @@ -52,6 +54,7 @@ models/core/unitcube.mesh + false @@ -67,6 +70,7 @@ models/core/unitcube.mesh + false @@ -82,6 +86,7 @@ models/core/unitcube.mesh + false @@ -198,6 +203,7 @@ models/core/unitcube.mesh + false @@ -210,7 +216,7 @@ - + @@ -254,6 +260,13 @@ + + + + + + + @@ -265,7 +278,25 @@ - + + + + + + + + + + + + + + + + + + + @@ -276,7 +307,43 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -287,11 +354,11 @@ - + - -15 + 12 @@ -317,7 +384,38 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Game/Systems/CapturePointSystem.cpp b/src/Game/Systems/CapturePointSystem.cpp index 13ac59f3..4a511301 100644 --- a/src/Game/Systems/CapturePointSystem.cpp +++ b/src/Game/Systems/CapturePointSystem.cpp @@ -234,9 +234,14 @@ void CapturePointSystem::UpdateComponent(EntityWrapper& capturePointEntity, Comp void CapturePointSystem::ChangeCapturePointModelsVisibility(EntityWrapper &capturePointModels, bool isOwner) { (bool&)capturePointModels["Model"]["Visible"] = isOwner; - for (auto& capModel : capturePointModels.ChildrenWithComponent("Model")) + for (auto& capModel : capturePointModels.ChildrenWithComponent("Transform")) { - (bool&)capModel["Model"]["Visible"] = isOwner; + if (capModel.HasComponent("Model")) { + (bool&)capModel["Model"]["Visible"] = isOwner; + } + if (capModel.HasComponent("PointLight")) { + (bool&)capModel["PointLight"]["Visible"] = isOwner; + } } }