From 04fa9d87f423727461fb89f2d827d2c341eb54ba Mon Sep 17 00:00:00 2001 From: marauder2k7 Date: Mon, 12 May 2025 12:50:31 +0100 Subject: [PATCH] Revert "Update EditorGui.ed.tscript" This reverts commit 0f819a3af496e536b84bfdd4e628e1f3b9f35bfa. --- .../worldEditor/scripts/EditorGui.ed.tscript | 31 ++++++------------- 1 file changed, 10 insertions(+), 21 deletions(-) diff --git a/Templates/BaseGame/game/tools/worldEditor/scripts/EditorGui.ed.tscript b/Templates/BaseGame/game/tools/worldEditor/scripts/EditorGui.ed.tscript index 87ec21497..714e81b80 100644 --- a/Templates/BaseGame/game/tools/worldEditor/scripts/EditorGui.ed.tscript +++ b/Templates/BaseGame/game/tools/worldEditor/scripts/EditorGui.ed.tscript @@ -317,11 +317,8 @@ function EditorGui::shutdown( %this ) %this.setEditor( "" ); // Call the shutdown callback on the editor plugins. - for ( %i = 0; %i < EditorPluginSet.getCount(); %i++ ) - { - %obj = EditorPluginSet.getObject(%i); - %obj.onWorldEditorShutdown(); - } + foreach( %plugin in EditorPluginSet ) + %plugin.onWorldEditorShutdown(); } /// This is used to add an editor to the Editors menu which @@ -578,11 +575,9 @@ function EditorGui::onWake( %this ) EHWorldEditor.setStateOn( 1 ); // Notify the editor plugins that the editor has started. - for ( %i = 0; %i < EditorPluginSet.getCount(); %i++ ) - { - %obj = EditorPluginSet.getObject( %i ); - %obj.onEditorWake(); - } + + foreach( %plugin in EditorPluginSet ) + %plugin.onEditorWake(); // Push the ActionMaps in the order that we want to have them // before activating an editor plugin, so that if the plugin @@ -621,11 +616,9 @@ function EditorGui::onSleep( %this ) MoveMap.pop(); // Notify the editor plugins that the editor will be closing. - for ( %i = 0; %i < EditorPluginSet.getCount(); %i++ ) - { - %obj = EditorPluginSet.getObject(%i); - %obj.onEditorSleep(); - } + + foreach( %plugin in EditorPluginSet ) + %plugin.onEditorSleep(); if(isObject($Server::CurrentScene)) $Server::CurrentScene.open(); @@ -722,12 +715,8 @@ function EditorGui::onNewLevelLoaded( %this, %levelName ) function EditorMissionCleanup::onRemove( %this ) { EditorGui.levelName = ""; - - for ( %i = 0; %i < EditorPluginSet.getCount(); %i++ ) - { - %obj = EditorPluginSet.getObject(%i); - %obj.onExitMission(); - } + foreach( %plugin in EditorPluginSet ) + %plugin.onExitMission(); } //-----------------------------------------------------------------------------