@@ -249,6 +249,10 @@ public override void Initialize()
249249 }
250250 if ( EditorSceneManager . Save ( ) )
251251 return Loc . Get ( "save.scene" , new { name = Runtime . Resources . Scene . Current ? . Name ?? "Untitled" } ) ;
252+
253+ // No path yet - prompt for one, but never interrupt an unattended auto-save.
254+ if ( ! SaveManager . IsAutoSave )
255+ PromptSaveAs ( ) ;
252256 return null ;
253257 } ;
254258 SaveManager . OnSave += ( ) =>
@@ -1308,6 +1312,7 @@ public void OpenPanelInstance(DockPanel panel, float width = 800, float height =
13081312 /// </summary>
13091313 public bool IsPanelOpen ( Type panelType ) => FindOpenPanel ( panelType ) != null ;
13101314
1315+ /// <summary>Prompt for a scene file path and save the current scene there.</summary>
13111316 private void PromptSaveAs ( )
13121317 {
13131318 if ( Project . Current == null ) return ;
@@ -1317,9 +1322,12 @@ private void PromptSaveAs()
13171322 string rel = EditorAssetDatabase . NormalizePath (
13181323 System . IO . Path . GetRelativePath ( Project . Current . AssetsPath , path ) ) ;
13191324 if ( ! rel . EndsWith ( ".scene" ) ) rel += ".scene" ;
1320- EditorSceneManager . SaveAs ( rel ) ;
1325+
1326+ if ( EditorSceneManager . SaveAs ( rel ) )
1327+ Toasts . Success ( Loc . Get ( "save.saved" ) ,
1328+ Loc . Get ( "save.scene" , new { name = Runtime . Resources . Scene . Current ? . Name ?? "Untitled" } ) ) ;
13211329 } , Project . Current . AssetsPath ,
1322- new [ ] { "*.scene" } , new [ ] { "Scene Files (*.scene)" } ) ;
1330+ new [ ] { "*.scene" } , new [ ] { Loc . Get ( "editor.filter_scene" ) } ) ;
13231331 }
13241332
13251333 // ================================================================
@@ -1348,33 +1356,9 @@ private void RegisterMenus()
13481356 MenuRegistry . Register ( $ "{ file } /{ Loc . Get ( "menu.file.save_scene" ) } ", ( ) =>
13491357 {
13501358 if ( ! EditorSceneManager . Save ( ) )
1351- {
1352- // No path yet prompt Save As
1353- if ( Project . Current == null ) return ;
1354- EditorApplication . OpenFileDialog ( FileDialogMode . Save , path =>
1355- {
1356- if ( path == null || Project . Current == null ) return ;
1357- string rel = EditorAssetDatabase . NormalizePath (
1358- System . IO . Path . GetRelativePath ( Project . Current . AssetsPath , path ) ) ;
1359- if ( ! rel . EndsWith ( ".scene" ) ) rel += ".scene" ;
1360- EditorSceneManager . SaveAs ( rel ) ;
1361- } , Project . Current . AssetsPath ,
1362- new [ ] { "*.scene" } , new [ ] { Loc . Get ( "editor.filter_scene" ) } ) ;
1363- }
1364- } ) ;
1365- MenuRegistry . Register ( $ "{ file } /{ Loc . Get ( "menu.file.save_scene_as" ) } ", ( ) =>
1366- {
1367- if ( Project . Current == null ) return ;
1368- EditorApplication . OpenFileDialog ( FileDialogMode . Save , path =>
1369- {
1370- if ( path == null || Project . Current == null ) return ;
1371- string rel = EditorAssetDatabase . NormalizePath (
1372- System . IO . Path . GetRelativePath ( Project . Current . AssetsPath , path ) ) ;
1373- if ( ! rel . EndsWith ( ".scene" ) ) rel += ".scene" ;
1374- EditorSceneManager . SaveAs ( rel ) ;
1375- } , Project . Current . AssetsPath ,
1376- new [ ] { "*.scene" } , new [ ] { Loc . Get ( "editor.filter_scene" ) } ) ;
1359+ PromptSaveAs ( ) ;
13771360 } ) ;
1361+ MenuRegistry . Register ( $ "{ file } /{ Loc . Get ( "menu.file.save_scene_as" ) } ", ( ) => PromptSaveAs ( ) ) ;
13781362 MenuRegistry . RegisterSeparator ( file ) ;
13791363 MenuRegistry . Register ( $ "{ file } /{ Loc . Get ( "menu.file.open_project" ) } ", ( ) => ReturnToLauncher ( ) ) ;
13801364 MenuRegistry . RegisterSeparator ( file ) ;
0 commit comments