From 9c643a69cfc96c8650bb5ad5021f9bf6fb1832d5 Mon Sep 17 00:00:00 2001 From: Areloch Date: Sat, 3 Feb 2024 16:24:12 -0600 Subject: [PATCH] Adds a callback invoke for objects in the scene to inform them if the level is being saved. Allows for certain special actions, like having objects reset to an original position before the save occurs. --- .../game/tools/worldEditor/scripts/menuHandlers.ed.tscript | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Templates/BaseGame/game/tools/worldEditor/scripts/menuHandlers.ed.tscript b/Templates/BaseGame/game/tools/worldEditor/scripts/menuHandlers.ed.tscript index 6cfdb0350..7859a95d1 100644 --- a/Templates/BaseGame/game/tools/worldEditor/scripts/menuHandlers.ed.tscript +++ b/Templates/BaseGame/game/tools/worldEditor/scripts/menuHandlers.ed.tscript @@ -328,7 +328,13 @@ function EditorSaveMission() // now write the terrain and mission files out: if(EWorldEditor.isDirty || ETerrainEditor.isMissionDirty) + { + //Inform objects a save is happening, in case there is any special pre-save behavior a class needs to do + getScene(0).callOnChildren("onSaving", $Server::MissionFile); + getScene(0).save($Server::MissionFile); + + } if(ETerrainEditor.isDirty) { // Find all of the terrain files