mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-18 06:03:48 +00:00
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:
parent
d97c05b411
commit
7dc03ae17a
32 changed files with 774 additions and 294 deletions
|
|
@ -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))
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue