Implemented initial pass at proper client/server separation handling for module initialization

Added GameModeName to Scene
Added function to get number of active scenes
Added logic to level/client loading to enact gameplay mode logic driven by either Scene's GameModeName or project setting's default game mode
Added template module.cs file for module creation and adjusted new module logic in AssetBrowser to create off template
Updated FPSGameplay code to have deathmatchGame mode work with new GameMode logic
Updated EmptyLevel scene to define deathMatchGame as gamemode
Updated FPSGameplay module script to properly client/server initialize
This commit is contained in:
Areloch 2019-08-04 23:21:28 -05:00
parent da18eaff45
commit 1228fbcb78
25 changed files with 662 additions and 193 deletions

View file

@ -75,6 +75,31 @@ function AssetBrowser_addModuleWindow::CreateNewModule(%this)
//Now generate the script file for it
%file = new FileObject();
%templateFile = new FileObject();
%moduleTemplateCodeFilePath = AssetBrowser.templateFilesPath @ "module.cs.template";
if(%file.openForWrite(%moduleScriptFilePath) && %templateFile.openForRead(%moduleTemplateCodeFilePath))
{
while( !%templateFile.isEOF() )
{
%line = %templateFile.readline();
%line = strreplace( %line, "@@", %newModuleName );
%file.writeline(%line);
echo(%line);
}
%file.close();
%templateFile.close();
}
else
{
%file.close();
%templateFile.close();
warnf("CreateNewModule - Something went wrong and we couldn't write the script file!");
}
if(%file.openForWrite(%moduleScriptFilePath))
{