Browse Source

Merge pull request #1 from AtomicGameEngine/JME-ATOMIC-PR658

Avoid adding a flag to command line for running from editor's play mode
Matt Benic 9 years ago
parent
commit
79c80a280f

+ 8 - 4
Source/AtomicEditor/Application/AEPlayerApp.cpp

@@ -53,7 +53,7 @@ namespace AtomicEditor
 AEPlayerApplication::AEPlayerApplication(Context* context) :
     AEEditorCommon(context),
     debugPlayer_(false),
-    runningFromEditorPlay_(false)
+    launchedByEditor_(false)
 {
 }
 
@@ -101,8 +101,10 @@ void AEPlayerApplication::Setup()
     ReadCommandLineArguments();
 
     // Re-apply project settings if running from editor play button
-    if (runningFromEditorPlay_)
+    if (launchedByEditor_)
+    {
         EngineConfig::ApplyConfig(engineParameters_, true);
+    }
 
     // Use the script file name as the base name for the log file
     engineParameters_["LogName"] = GetSubsystem<FileSystem>()->GetAppPreferencesDir("AtomicPlayer", "Logs") + "AtomicPlayer.log";
@@ -163,9 +165,11 @@ void AEPlayerApplication::ReadCommandLineArguments()
             {
                 SubscribeToEvent(E_LOGMESSAGE, HANDLER(AEPlayerApplication, HandleLogMessage));
             }
-            else if (argument == "--fromeditorplay")
+            else if (argument.StartsWith("--ipc-server=") || argument.StartsWith("--ipc-client="))
             {
-                runningFromEditorPlay_ = true;
+                // If we have IPC server/client we're being launched from the Editor
+                // TODO: Unify this with AEPlayerMode handling
+                launchedByEditor_ = true;
             }
             else if (argument == "--debug")
             {

+ 1 - 1
Source/AtomicEditor/Application/AEPlayerApp.h

@@ -49,7 +49,7 @@ private:
 
     bool debugPlayer_;
 
-    bool runningFromEditorPlay_;
+    bool launchedByEditor_;
 
 };
 

+ 1 - 1
Source/AtomicEditor/EditorMode/AEEditorMode.cpp

@@ -124,7 +124,7 @@ bool EditorMode::PlayProject(String addArgs, bool debug)
 
     Vector<String> vargs;
 
-    String args = ToString("--player --fromEditorPlay --project \"%s\"", AddTrailingSlash(project->GetProjectPath()).CString());
+    String args = ToString("--player --project \"%s\"", AddTrailingSlash(project->GetProjectPath()).CString());
 
     vargs = args.Split(' ');