diff --git a/buttons.c b/buttons.c index 3bc483d2..dc6a5c3b 100644 --- a/buttons.c +++ b/buttons.c @@ -2994,13 +2994,18 @@ void Save_picture(byte image) Save_image(&save_context); + if (!File_error && image && !Get_fileformat(save_context.Format)->Palette_only) + { + Main_image_is_modified=0; + strcpy(Main_backups->Pages->Filename, save_context.File_name); + strcpy(Main_backups->Pages->File_directory, save_context.File_directory); + } + Hide_cursor(); Cursor_shape=old_cursor_shape; Display_cursor(); } Destroy_context(&save_context); - //if (!image) - // Swap_data_of_image_and_brush(); Print_filename(); Set_palette(Main_palette); @@ -3042,6 +3047,10 @@ void Button_Autosave(void) Init_context_layered_image(&save_context, Main_backups->Pages->Filename, Main_backups->Pages->File_directory); Save_image(&save_context); + if (!File_error) + { + Main_image_is_modified=0; + } Destroy_context(&save_context); Hide_cursor(); diff --git a/filesel.c b/filesel.c index 895949be..c9346c6d 100644 --- a/filesel.c +++ b/filesel.c @@ -1086,7 +1086,7 @@ byte Button_Load_or_Save(byte load, T_IO_Context *context) } // Affichage du commentaire if (Get_fileformat(Main_format)->Comment) - Print_in_window(47,70,context->Comment,MC_Black,MC_Light); + Print_in_window(47,70,context->Comment,MC_Black,MC_Light); } Window_set_normal_button(253,180,51,14,"Cancel",0,1,KEY_ESC); // 2 @@ -1167,6 +1167,9 @@ byte Button_Load_or_Save(byte load, T_IO_Context *context) strcpy(Selector_filename,context->File_name); // On affiche le nouveau nom de fichier Print_filename_in_fileselector(); + + Highlight_file(context->File_name); + Prepare_and_display_filelist(Main_fileselector_position,Main_fileselector_offset,file_scroller); } New_preview_is_needed=1; @@ -1616,12 +1619,12 @@ byte Button_Load_or_Save(byte load, T_IO_Context *context) // On mémorise le répertoire dans lequel on était if (strcmp(Selector_filename,PARENT_DIR)) - strcpy(previous_directory,Format_filename(PARENT_DIR, 1)); + { + strcpy(previous_directory,PARENT_DIR); + } else { - strcpy(previous_directory, - Format_filename(Find_last_slash(Main_current_directory), 1) - ); + Extract_filename(previous_directory, Main_current_directory); } // On doit rentrer dans le répertoire: @@ -1719,6 +1722,8 @@ byte Button_Load_or_Save(byte load, T_IO_Context *context) { strcpy(context->File_name, Selector_filename); strcpy(context->File_directory, Main_current_directory); + if (!load) + context->Format = Main_format; } else { diff --git a/loadsave.c b/loadsave.c index e4bfbb1c..4a0efa36 100644 --- a/loadsave.c +++ b/loadsave.c @@ -822,12 +822,10 @@ void Save_image(T_IO_Context *context) format->Save(context); if (File_error) + { Error(0); - //else - //{ - // if ((image) && !(Get_fileformat(Main_fileformat)->Palette_only)) - // Main_image_is_modified=0; - //} + return; + } } diff --git a/skins/skin_DPaint.png b/skins/skin_DPaint.png index 4087485e..223445d8 100644 Binary files a/skins/skin_DPaint.png and b/skins/skin_DPaint.png differ