소스 검색

Add "editor" and "standalone" feature tags

These feature tags can be used to check whether the project was
started from an editor binary or from an export template binary.
Hugo Locurcio 7 년 전
부모
커밋
0254a40817
1개의 변경된 파일7개의 추가작업 그리고 0개의 파일을 삭제
  1. 7 0
      core/os/os.cpp

+ 7 - 0
core/os/os.cpp

@@ -577,6 +577,13 @@ bool OS::has_feature(const String &p_feature) {
 	if (p_feature == "release")
 		return true;
 #endif
+#ifdef TOOLS_ENABLED
+	if (p_feature == "editor")
+		return true;
+#else
+	if (p_feature == "standalone")
+		return true;
+#endif
 
 	if (sizeof(void *) == 8 && p_feature == "64") {
 		return true;