Browse Source

Adds a sanity check so asset names cannot start with a number, which would be an invalid object name,

Areloch 4 years ago
parent
commit
f47e3f395a
1 changed files with 7 additions and 0 deletions
  1. 7 0
      Templates/BaseGame/game/tools/assetBrowser/scripts/newAsset.cs

+ 7 - 0
Templates/BaseGame/game/tools/assetBrowser/scripts/newAsset.cs

@@ -167,6 +167,13 @@ function CreateNewAsset()
 		return;
 	}
 	
+	%firstChar = getSubStr(%assetName, 0, 1);
+	if(isInt(%firstChar))
+	{
+	    toolsMessageBoxOK( "Error", "Names cannot start with a number!");
+		return;
+	}
+	
 	//get the selected module data
    %moduleName = NewAssetTargetModule.getText();