浏览代码

Merge pull request #371 from Areloch/AssetNameSanityCheck

Adds a sanity check so asset names cannot start with a number
Brian Roberts 4 年之前
父节点
当前提交
1e9df5f415
共有 1 个文件被更改,包括 7 次插入0 次删除
  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();