diff --git a/src/engine.h b/src/engine.h index 704a0006..351c06ae 100644 --- a/src/engine.h +++ b/src/engine.h @@ -109,8 +109,12 @@ void Get_color_behind_window(byte * color, byte * click); short Window_clicked_button(void); int Button_under_mouse(void); short Window_get_clicked_button(void); + +/// Remaps all the colors from the window background buffers from row Min_Y to row Max_Y void Remap_window_backgrounds(const byte * conversion_table, int Min_Y, int Max_Y); +/// Remaps only UI elements (Windows + Menu) in all window background buffers void Remap_UI_window_backgrounds(const byte * conversion_table); + void Pixel_background(int x_pos, int y_pos, byte color); /// /// Updates the status bar line with a color number. diff --git a/src/filesel.c b/src/filesel.c index 4f093d4f..12bd6e03 100644 --- a/src/filesel.c +++ b/src/filesel.c @@ -2213,9 +2213,12 @@ byte Button_Load_or_Save(T_Selector_settings *settings, byte load, T_IO_Context Back_color=initial_back_color; if (Windows_open <= 1) { - Set_palette(Main.palette); //TODO vrai backup? + // Restore Main.palette only when we are not going back to another window + // (we let the other window take care of its palette and remapping) + // This test was added for Load/Save dialog called from the Palette window + Set_palette(Main.palette); - Compute_optimal_menu_colors(Main.palette);//TODO + Compute_optimal_menu_colors(Main.palette); } temp=(Window_pos_Y+(Window_height*Menu_factor_Y)