Implemented palette ordering (issue 112). You can activate it in the secondary palette window (shift-P), it's saved in gfx2.ini.

The skin file has 2 more icons for the arrows (Ilija, grafx2 won't load if you don't update yours)
Updated contextual help for the secondary palette window.
Fixed some typos in code.

git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@704 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
Yves Rizoud
2009-03-29 21:58:38 +00:00
parent eb781b9bd6
commit 8ff9028eab
14 changed files with 233 additions and 119 deletions

View File

@@ -2074,7 +2074,7 @@ void Button_Palette(void)
//---------------------- Menu de palettes secondaires ------------------------
void Button_Pecondary_palette(void)
void Button_Secondary_palette(void)
{
short clicked_button;
byte dummy;
@@ -2082,6 +2082,7 @@ void Button_Pecondary_palette(void)
T_Scroller_button * lines_slider;
T_Scroller_button * rgb_scale_slider;
char str[4];
byte palette_vertical = Config.Palette_vertical;
byte palette_needs_redraw=0;
Open_window(200,146,"Palettes");
@@ -2090,8 +2091,8 @@ void Button_Pecondary_palette(void)
Window_set_normal_button(10,37,180,14,"User's color series" ,14,0,SDLK_s); // 2
Window_set_normal_button(139,126,53,14,"OK" , 0,1,SDLK_RETURN); // 3
Window_set_normal_button( 80,126,53,14,"Cancel" , 0,1,KEY_ESC); // 4
Window_display_frame(10,55,122,51);
Print_in_window(18,59,"palette layout",MC_Dark,MC_Light);
Window_display_frame(10,55,122,66);
Print_in_window(18,59,"Palette layout",MC_Dark,MC_Light);
Print_in_window(35,77,"Cols",MC_Dark,MC_Light);
Print_in_window(84,77,"Lines",MC_Dark,MC_Light);
Print_in_window(157,66,"RGB",MC_Dark,MC_Light);
@@ -2109,6 +2110,10 @@ void Button_Pecondary_palette(void)
Num2str(RGB_scale,str,3);
Print_in_window(157,89,str,MC_Black,MC_Light);
Window_set_normal_button(35,106,13,11,"",-1,1,SDLK_LAST); // 8
Print_in_window(38,108,(palette_vertical)?"X":" ",MC_Black,MC_Light);
Print_in_window(51,108,"Vertical",MC_Dark,MC_Light);
Update_rect(Window_pos_X,Window_pos_Y,Menu_factor_X*200,Menu_factor_Y*80);
Display_cursor();
@@ -2119,7 +2124,7 @@ void Button_Pecondary_palette(void)
if (Is_shortcut(Key,0x100+BUTTON_HELP))
{
Key=0;
Window_help(BUTTON_PALETTE, NULL);
Window_help(BUTTON_PALETTE, "PALETTE OPTIONS");
}
switch(clicked_button)
{
@@ -2134,7 +2139,13 @@ void Button_Pecondary_palette(void)
case 7:
Num2str(256-Window_attribute2,str,3);
Print_in_window(157,89,str,MC_Black,MC_Light);
break;
break;
case 8:
palette_vertical = !palette_vertical;
Hide_cursor();
Print_in_window(38,108,(palette_vertical)?"X":" ",MC_Black,MC_Light);
Display_cursor();
break;
}
}
while (clicked_button!=1 && clicked_button!=3 && clicked_button!=4);
@@ -2146,12 +2157,16 @@ void Button_Pecondary_palette(void)
if (clicked_button==4) // Cancel
return;
if (palette_vertical != Config.Palette_vertical)
{
Config.Palette_vertical=palette_vertical;
palette_needs_redraw=1;
}
if (columns_slider->Position!=256-Config.Palette_cells_X ||
lines_slider->Position!=16-Config.Palette_cells_Y)
{
Config.Palette_cells_X = 256-columns_slider->Position;
Config.Palette_cells_Y = 16-lines_slider->Position;
Change_palette_cells();
palette_needs_redraw=1;
}
if (rgb_scale_slider->Position!=256-RGB_scale)
@@ -2165,5 +2180,9 @@ void Button_Pecondary_palette(void)
Menu_tag_colors("Tag colors to exclude",Exclude_color,&dummy,1, NULL);
}
if (palette_needs_redraw)
{
Change_palette_cells();
Display_menu();
Display_sprite_in_menu(BUTTON_PAL_LEFT,18+(Config.Palette_vertical!=0));
}
}