Browse Source

Bugfix: Fix GUI update lagging one frame
- Reordered the update() calls to execute as they were before the 'bsf' scripting refactor

BearishSun 6 years ago
parent
commit
adfbb0cf24

+ 9 - 0
Source/EditorCore/BsEditorApplication.cpp

@@ -175,6 +175,13 @@ namespace bs
 		// Do nothing, we initialize the script manager at a later stage
 		// Do nothing, we initialize the script manager at a later stage
 	}
 	}
 
 
+	void EditorApplication::updateScriptManager()
+	{
+		// Do nothing, we need to perform script update before editor window update, but Application::postUpdate (where this
+		// method is normally called from) needs to execute after editor window update.
+	}
+
+
 	void EditorApplication::preUpdate()
 	void EditorApplication::preUpdate()
 	{
 	{
 		Application::preUpdate();
 		Application::preUpdate();
@@ -185,6 +192,8 @@ namespace bs
 
 
 	void EditorApplication::postUpdate()
 	void EditorApplication::postUpdate()
 	{
 	{
+		ScriptManager::instance().update();
+
 		// Call update on editor widgets before parent's postUpdate because the parent will render the GUI and we need
 		// Call update on editor widgets before parent's postUpdate because the parent will render the GUI and we need
 		// to ensure editor widget's GUI is updated.
 		// to ensure editor widget's GUI is updated.
 		EditorWindowManager::instance().update();
 		EditorWindowManager::instance().update();

+ 3 - 0
Source/EditorCore/BsEditorApplication.h

@@ -101,6 +101,9 @@ namespace bs
 		/** @copydoc Application::startUpScriptManager */
 		/** @copydoc Application::startUpScriptManager */
 		void startUpScriptManager() override;
 		void startUpScriptManager() override;
 
 
+		/** @copydoc Application::updateScriptManager */
+		void updateScriptManager() override;
+
 		/**
 		/**
 		 * Loads the previously saved editor widget layout from the default location. Can return null if no layout was 
 		 * Loads the previously saved editor widget layout from the default location. Can return null if no layout was 
 		 * previously saved.
 		 * previously saved.

+ 1 - 2
Source/EditorScript/BsEditorScriptLibrary.cpp

@@ -37,10 +37,9 @@ namespace bs
 
 
 	void EditorScriptLibrary::update()
 	void EditorScriptLibrary::update()
 	{
 	{
+		EngineScriptLibrary::update();
 
 
 		EditorScriptManager::instance().update();
 		EditorScriptManager::instance().update();
-
-		EngineScriptLibrary::update();
 	}
 	}
 
 
 	void EditorScriptLibrary::reload()
 	void EditorScriptLibrary::reload()

+ 1 - 1
Source/bsf

@@ -1 +1 @@
-Subproject commit 9bac615ef05f7adbe06918d09d5dd3ae5071ff42
+Subproject commit a072722267017fa0eaaab1ed2b15d53395ae2b1e