瀏覽代碼

Minor space fix in code. Make editor stop itself when minimized and reduce defocused FPS to 10. Increase hierarchy window initial size to match inspector window initial size.

Lasse Öörni 9 年之前
父節點
當前提交
1877fb3b90

+ 1 - 1
Source/Urho3D/AngelScript/CoreAPI.cpp

@@ -953,7 +953,7 @@ void RegisterObject(asIScriptEngine* engine)
     engine->RegisterGlobalFunction("bool HasSubscribedToEvent(Object@+, const String&in)", asFUNCTION(HasSubscribedToSenderEvent), asCALL_CDECL);
     engine->RegisterGlobalFunction("Object@+ GetEventSender()", asFUNCTION(GetEventSender), asCALL_CDECL);
     engine->RegisterGlobalFunction("const String& GetTypeName(StringHash)", asFUNCTION(GetTypeName), asCALL_CDECL);
-    engine->RegisterGlobalFunction("void SetGlobalVar(const  String&in, Variant&in)", asFUNCTION(SetGlobalVar), asCALL_CDECL);
+    engine->RegisterGlobalFunction("void SetGlobalVar(const String&in, Variant&in)", asFUNCTION(SetGlobalVar), asCALL_CDECL);
     engine->RegisterGlobalFunction("Variant GetGlobalVar(const String&in)", asFUNCTION(GetGlobalVar), asCALL_CDECL);
     engine->RegisterGlobalFunction("VariantMap& get_globalVars()", asFUNCTION(GetGlobalVars), asCALL_CDECL);
 

+ 3 - 0
bin/Data/Scripts/Editor.as

@@ -45,6 +45,9 @@ void Start()
 
     // Disable Editor auto exit, check first if it is OK to exit
     engine.autoExit = false;
+    // Pause completely when minimized to save OS resources, reduce minimized framerate
+    engine.pauseMinimized = true;
+    engine.maxInactiveFps = 10;
     // Enable console commands from the editor script
     script.defaultScriptFile = scriptFile;
     // Enable automatic resource reloading

+ 2 - 2
bin/Data/Scripts/Editor/EditorHierarchyWindow.as

@@ -60,7 +60,7 @@ void CreateHierarchyWindow()
     hierarchyWindow = LoadEditorUI("UI/EditorHierarchyWindow.xml");
     hierarchyList = hierarchyWindow.GetChild("HierarchyList");
     ui.root.AddChild(hierarchyWindow);
-    int height = Min(ui.root.height - 60, 460);
+    int height = Min(ui.root.height - 60, 500);
     hierarchyWindow.SetSize(300, height);
     hierarchyWindow.SetPosition(35, 100);
     hierarchyWindow.opacity = uiMaxOpacity;
@@ -475,7 +475,7 @@ String GetNodeTitle(Node@ node)
         ret = node.typeName;
     else
         ret = node.name;
-    
+
     if (showID)
     {
         if (node.id >= FIRST_LOCAL_ID)