|
@@ -164,40 +164,3 @@ function toggleEditor(%make)
|
|
|
//------------------------------------------------------------------------------
|
|
|
// The editor action maps are defined in editor.bind.tscript
|
|
|
GlobalActionMap.bind(keyboard, "f11", fastLoadWorldEdit);
|
|
|
-
|
|
|
-
|
|
|
-// The scenario:
|
|
|
-// The editor is open and the user closes the level by any way other than
|
|
|
-// the file menu ( exit level ), eg. typing disconnect() in the console.
|
|
|
-//
|
|
|
-// The problem:
|
|
|
-// Editor::close() is not called in this scenario which means onEditorDisable
|
|
|
-// is not called on objects which hook into it and also gEditingMission will no
|
|
|
-// longer be valid.
|
|
|
-//
|
|
|
-// The solution:
|
|
|
-// Override the stock disconnect() function which is in game scripts from here
|
|
|
-// in tools so we avoid putting our code in there.
|
|
|
-//
|
|
|
-// Disclaimer:
|
|
|
-// If you think of a better way to do this feel free. The thing which could
|
|
|
-// be dangerous about this is that no one will ever realize this code overriding
|
|
|
-// a fairly standard and core game script from a somewhat random location.
|
|
|
-// If it 'did' have unforscene sideeffects who would ever find it?
|
|
|
-
|
|
|
-package EditorDisconnectOverride
|
|
|
-{
|
|
|
- function disconnect()
|
|
|
- {
|
|
|
- if ( isObject( Editor ) && Editor.isEditorEnabled() )
|
|
|
- {
|
|
|
- EditorGui.saveAs = false; //whatever edits we were doing are irrelevent now
|
|
|
- %mainMenuGUI = ProjectSettings.value("UI/mainMenuName");
|
|
|
- if (isObject( %mainMenuGUI ))
|
|
|
- Editor.close( %mainMenuGUI );
|
|
|
- }
|
|
|
-
|
|
|
- Parent::disconnect();
|
|
|
- }
|
|
|
-};
|
|
|
-activatePackage( EditorDisconnectOverride );
|