Fixes the inspector/component editor to display the components attached to an entity correctly in the inspector.

This commit is contained in:
Areloch 2017-12-03 01:21:30 -06:00
parent 4f78143dc8
commit b5277e0f08
10 changed files with 513 additions and 44 deletions

View file

@ -132,6 +132,23 @@ function isNameUnique(%name)
//
function GameConnection::onDrop(%client, %reason)
{
%entityIds = parseMissionGroupForIds("Entity", "");
%entityCount = getWordCount(%entityIds);
for(%i=0; %i < %entityCount; %i++)
{
%entity = getWord(%entityIds, %i);
for(%e=0; %e < %entity.getCount(); %e++)
{
%child = %entity.getObject(%e);
if(%child.getClassName() $= "Entity")
%entityIds = %entityIds SPC %child.getID();
}
%entity.notify("onClientDisconnect", %client);
}
if($missionRunning)
theLevelInfo.onClientLeaveGame();

View file

@ -131,6 +131,22 @@ function serverCmdMissionStartPhase3Ack(%client, %seq)
%client.currentPhase = 3;
// Server is ready to drop into the game
%entityIds = parseMissionGroupForIds("Entity", "");
%entityCount = getWordCount(%entityIds);
for(%i=0; %i < %entityCount; %i++)
{
%entity = getWord(%entityIds, %i);
for(%e=0; %e < %entity.getCount(); %e++)
{
%child = %entity.getObject(%e);
if(%child.getCLassName() $= "Entity")
%entityIds = %entityIds SPC %child.getID();
}
%entity.notify("onClientConnect", %client);
}
//Have any special game-play handling here
if(theLevelInfo.isMethod("onClientEnterGame"))
@ -151,7 +167,7 @@ function serverCmdMissionStartPhase3Ack(%client, %seq)
};
}
if (isDefined("$Game::DefaultCameraClass"))
//if (isDefined("$Game::DefaultCameraClass"))
%client.camera = spawnObject("Camera", Observer);
}