File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 233233 <MenuItem .Icon><i : Icon Value =" fa-solid fa-map" FontSize =" 14" Foreground =" #cdd6f4" /></MenuItem .Icon>
234234 </MenuItem >
235235 <Separator />
236- <MenuItem Header =" Save " Command =" {Binding SaveOtbCommand }" InputGesture =" Ctrl+S" >
236+ <MenuItem Header =" Salvar Tudo " Command =" {Binding SaveAllCommand }" InputGesture =" Ctrl+S" >
237237 <MenuItem .Icon><i : Icon Value =" fa-solid fa-floppy-disk" FontSize =" 14" Foreground =" #89b4fa" /></MenuItem .Icon>
238238 </MenuItem >
239239 <MenuItem Header =" Save As..." Command =" {Binding SaveOtbAsCommand}" InputGesture =" Ctrl+Shift+S" />
240- <MenuItem Header =" Save SPR" Command =" {Binding SaveSprCommand}" />
241- <MenuItem Header =" Save Map" Command =" {Binding SaveMapCommand}" />
242240 <Separator />
243241 <MenuItem Header =" Export Selected..." Command =" {Binding ExportThingCommand}" InputGesture =" Ctrl+E" >
244242 <MenuItem .Icon><i : Icon Value =" fa-solid fa-file-export" FontSize =" 14" Foreground =" #a6e3a1" /></MenuItem .Icon>
Original file line number Diff line number Diff line change @@ -2486,6 +2486,46 @@ private void LoadBrushDatabase()
24862486 }
24872487 }
24882488
2489+ [ RelayCommand ]
2490+ private async Task SaveAllAsync ( )
2491+ {
2492+ var saved = new List < string > ( ) ;
2493+
2494+ try
2495+ {
2496+ // 1. OTB + DAT + SPR
2497+ if ( _otbData != null && _otbPath != null )
2498+ {
2499+ foreach ( var vm in _allItems )
2500+ vm . ApplyToModel ( ) ;
2501+
2502+ OtbFile . Save ( _otbPath , _otbData ) ;
2503+ SaveClientFilesIfLoaded ( ) ;
2504+ HasUnsavedChanges = false ;
2505+ saved . Add ( "OTB" ) ;
2506+ if ( _datData != null ) saved . Add ( "DAT" ) ;
2507+ if ( _sprFile != null ) saved . Add ( "SPR" ) ;
2508+ }
2509+
2510+ // 2. Map
2511+ if ( MapData != null && ! string . IsNullOrEmpty ( MapFilePath ) )
2512+ {
2513+ OtbmFile . Save ( MapFilePath , MapData ) ;
2514+ MapTileCount = MapData . Tiles . Count ;
2515+ MapHasUnsavedChanges = false ;
2516+ saved . Add ( "Map" ) ;
2517+ }
2518+
2519+ StatusText = saved . Count > 0
2520+ ? $ "Saved: { string . Join ( ", " , saved ) } "
2521+ : "Nothing to save" ;
2522+ }
2523+ catch ( Exception ex )
2524+ {
2525+ StatusText = $ "Save error: { ex . Message } ";
2526+ }
2527+ }
2528+
24892529 [ RelayCommand ]
24902530 private async Task SaveOtbAsync ( )
24912531 {
You can’t perform that action at this time.
0 commit comments