From 183d8e904f5d8d14759e739773e9ecb1d073623f Mon Sep 17 00:00:00 2001 From: marauder2k7 Date: Sun, 18 May 2025 16:03:48 +0100 Subject: [PATCH] Update core.tscript returns the ability to compile all scripts and gui files --- Templates/BaseGame/game/core/core.tscript | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/Templates/BaseGame/game/core/core.tscript b/Templates/BaseGame/game/core/core.tscript index 1732114dc..09f278e03 100644 --- a/Templates/BaseGame/game/core/core.tscript +++ b/Templates/BaseGame/game/core/core.tscript @@ -38,6 +38,26 @@ function CoreModule::onCreate(%this) // Parse the command line arguments echo("\n--------- Parsing Arguments ---------"); parseArgs(); + + if($compileAll) + { + echo(" --- Compiling all files ---"); + compileFiles("*" @ $TorqueScriptFileExtension); + compileFiles("*.gui"); + compileFiles("*.ts"); + echo(" --- Exiting after compile ---"); + quit(); + } + + if($compileTools) + { + echo(" --- Compiling tools scritps ---"); + compileFiles("tools/*" @ $TorqueScriptFileExtension); + compileFiles("tools/*.gui"); + compileFiles("tools/*.ts"); + echo(" --- Exiting after compile ---"); + quit(); + } // The canvas needs to be initialized before any gui scripts are run since // some of the controls assume that the canvas exists at load time.