diff --git a/buttons.c b/buttons.c index ff7253cf..ec5eecd0 100644 --- a/buttons.c +++ b/buttons.c @@ -962,19 +962,28 @@ void Button_Settings(void) void Add_skin(const char *name) { char * fname; - - Add_element_to_list(name, 0); - Filelist_nb_elements++; + int namelength; // Cut the long name to keep only filename (no directory) - fname = Find_last_slash(Filelist->Full_name); - if (fname[0]=='\0') - return; - - strcpy(Filelist->Full_name, fname+1); + fname = Find_last_slash(name); + if (fname) + fname++; + else + fname=name; + namelength = strlen(fname); + if (namelength>=5 && fname[0]!='_' && (!stricmp(fname+namelength-4,".png") || !stricmp(fname+namelength-4,".gif"))) + { + Add_element_to_list(name, 0); + Filelist_nb_elements++; + + if (fname[0]=='\0') + return; - // Reformat the short name - strcpy(Filelist->Short_name,Format_filename(Filelist->Full_name, 0)); + strcpy(Filelist->Full_name, fname); + + // Reformat the short name + strcpy(Filelist->Short_name,Format_filename(Filelist->Full_name, 0)); + } } @@ -1055,7 +1064,7 @@ void Button_Skins(void) // List of skins skin_list = Window_set_list_button( // Fileselector - Window_set_special_button(9,FILESEL_Y+2,144,80), // 2 + Window_set_special_button(8,FILESEL_Y+1,144,80), // 2 // Scroller du fileselector (file_scroller = Window_set_scroller_button(160,FILESEL_Y+1,82,Filelist_nb_elements,10,selector_position)), // 3 Draw_one_skin_name); // 4 diff --git a/engine.c b/engine.c index 99bd3510..e133065c 100644 --- a/engine.c +++ b/engine.c @@ -2681,7 +2681,8 @@ short Window_clicked_button(void) list->Scroller->Position=list->List_start; Window_draw_slider(list->Scroller); } - Window_redraw_list(list);// reduce redraw? + Window_redraw_list(list); + Display_cursor(); // Store the selected value as attribute2 Window_attribute2=list->List_start + list->Cursor_position; // Return the control ID of the list. @@ -2700,7 +2701,8 @@ short Window_clicked_button(void) list->Scroller->Position=list->List_start; Window_draw_slider(list->Scroller); } - Window_redraw_list(list);// reduce redraw? + Window_redraw_list(list); + Display_cursor(); // Store the selected value as attribute2 Window_attribute2=list->List_start + list->Cursor_position; // Return the control ID of the list. @@ -2715,7 +2717,8 @@ short Window_clicked_button(void) // Mise à jour du scroller list->Scroller->Position=list->List_start; Window_draw_slider(list->Scroller); - Window_redraw_list(list);// reduce redraw? + Window_redraw_list(list); + Display_cursor(); // Store the selected value as attribute2 Window_attribute2=list->List_start + list->Cursor_position; // Return the control ID of the list. @@ -2734,7 +2737,8 @@ short Window_clicked_button(void) list->Scroller->Position=list->List_start; Window_draw_slider(list->Scroller); } - Window_redraw_list(list);// reduce redraw? + Window_redraw_list(list); + Display_cursor(); // Store the selected value as attribute2 Window_attribute2=list->List_start + list->Cursor_position; // Return the control ID of the list. @@ -2763,7 +2767,8 @@ short Window_clicked_button(void) list->Scroller->Position=list->List_start; Window_draw_slider(list->Scroller); } - Window_redraw_list(list);// reduce redraw? + Window_redraw_list(list); + Display_cursor(); // Store the selected value as attribute2 Window_attribute2=list->List_start + list->Cursor_position; // Return the control ID of the list. @@ -2788,7 +2793,8 @@ short Window_clicked_button(void) list->Scroller->Position=list->List_start; Window_draw_slider(list->Scroller); } - Window_redraw_list(list);// reduce redraw? + Window_redraw_list(list); + Display_cursor(); // Store the selected value as attribute2 Window_attribute2=list->List_start + list->Cursor_position; // Return the control ID of the list. @@ -2804,10 +2810,11 @@ short Window_clicked_button(void) list->Cursor_position-=list->List_start; // On affiche à nouveau la liste Hide_cursor(); - Window_redraw_list(list);// reduce redraw? + Window_redraw_list(list); // Mise à jour du scroller list->Scroller->Position=list->List_start; Window_draw_slider(list->Scroller); + Display_cursor(); } if (Key==KEY_MOUSEWHEELDOWN && list->List_startScroller->Nb_elements-list->Scroller->Nb_visibles) { @@ -2820,10 +2827,11 @@ short Window_clicked_button(void) list->Cursor_position-=list->List_start; // On affiche à nouveau la liste Hide_cursor(); - Window_redraw_list(list);// reduce redraw? + Window_redraw_list(list); // Mise à jour du scroller list->Scroller->Position=list->List_start; Window_draw_slider(list->Scroller); + Display_cursor(); } } diff --git a/skins/_classic.png b/skins/_classic.png new file mode 100644 index 00000000..8db8d5fc Binary files /dev/null and b/skins/_classic.png differ diff --git a/skins/_fairlight.png b/skins/_fairlight.png new file mode 100644 index 00000000..5d4f9818 Binary files /dev/null and b/skins/_fairlight.png differ diff --git a/skins/_fun.png b/skins/_fun.png new file mode 100644 index 00000000..a1e36add Binary files /dev/null and b/skins/_fun.png differ diff --git a/skins/_melon.png b/skins/_melon.png new file mode 100644 index 00000000..efa4d4f0 Binary files /dev/null and b/skins/_melon.png differ