New: Implemented the functions for previous and next user's colors. (Keys = and -) They use the Shade settings.
Minor display fix: In Shortcuts screen, explanation text can no longer overdraw the border. git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@791 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
parent
61f03d0921
commit
9d19d8785a
@ -40,7 +40,7 @@ $(OBJDIR)/pages.o: pages.c global.h struct.h const.h pages.h errors.h misc.h \
|
|||||||
windows.h
|
windows.h
|
||||||
$(OBJDIR)/palette.o: palette.c const.h struct.h global.h misc.h engine.h readline.h \
|
$(OBJDIR)/palette.o: palette.c const.h struct.h global.h misc.h engine.h readline.h \
|
||||||
buttons.h pages.h help.h sdlscreen.h errors.h op_c.h windows.h input.h \
|
buttons.h pages.h help.h sdlscreen.h errors.h op_c.h windows.h input.h \
|
||||||
palette.h
|
palette.h shade.h
|
||||||
$(OBJDIR)/pxdouble.o: pxdouble.c global.h struct.h const.h sdlscreen.h misc.h \
|
$(OBJDIR)/pxdouble.o: pxdouble.c global.h struct.h const.h sdlscreen.h misc.h \
|
||||||
pxdouble.h pxwide.h
|
pxdouble.h pxwide.h
|
||||||
$(OBJDIR)/pxquad.o: pxquad.c global.h struct.h const.h sdlscreen.h misc.h pxquad.h
|
$(OBJDIR)/pxquad.o: pxquad.c global.h struct.h const.h sdlscreen.h misc.h pxquad.h
|
||||||
|
|||||||
32
buttons.c
32
buttons.c
@ -84,38 +84,6 @@ void Bouton_***(void)
|
|||||||
void Stencil_update_color(byte color);
|
void Stencil_update_color(byte color);
|
||||||
void Stencil_tag_color(byte color, byte tag_color);
|
void Stencil_tag_color(byte color, byte tag_color);
|
||||||
|
|
||||||
void Message_not_implemented(void)
|
|
||||||
{
|
|
||||||
short clicked_button;
|
|
||||||
|
|
||||||
Open_window(160,76,"Not available yet!");
|
|
||||||
|
|
||||||
Print_in_window(8,20,"This function will",MC_Black,MC_Light);
|
|
||||||
Print_in_window(12,28,"be implemented in",MC_Black,MC_Light);
|
|
||||||
Print_in_window(16,36,"a later version.",MC_Black,MC_Light);
|
|
||||||
Window_set_normal_button(60,53,40,14,"OK",1,1,SDLK_RETURN); // 1
|
|
||||||
Update_window_area(0,0,Window_width, Window_height);
|
|
||||||
Display_cursor();
|
|
||||||
|
|
||||||
do
|
|
||||||
clicked_button=Window_clicked_button();
|
|
||||||
while ((clicked_button<=0) && (Key!=KEY_ESC) && (Key!=SDLK_o));
|
|
||||||
|
|
||||||
if(clicked_button<=0) Key=0;
|
|
||||||
|
|
||||||
Close_window();
|
|
||||||
|
|
||||||
// Puisque cette fonction peut être appelée par plusieurs boutons et qu'on
|
|
||||||
// ne sait pas lequel c'est, on les désenclenche tous. De toutes façons, ça
|
|
||||||
// ne sert à rien d'essayer d'optimiser ça puisque l'utilisateur ne devrait
|
|
||||||
// pas souvent l'appeler, et en plus y'en a pas beaucoup à désenclencher. ;)
|
|
||||||
// Unselect_button(BUTTON_GRADRECT);
|
|
||||||
// Unselect_button(BUTTON_TEXT);
|
|
||||||
|
|
||||||
Display_cursor();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Message_out_of_memory(void)
|
void Message_out_of_memory(void)
|
||||||
{
|
{
|
||||||
short clicked_button;
|
short clicked_button;
|
||||||
|
|||||||
@ -27,12 +27,6 @@
|
|||||||
|
|
||||||
#include "struct.h"
|
#include "struct.h"
|
||||||
|
|
||||||
/*!
|
|
||||||
Displays an error message when calling an unavailable function.
|
|
||||||
Only used in the beta versions for things we haven't coded yet.
|
|
||||||
*/
|
|
||||||
void Message_not_implemented(void);
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Displays an error message when there is no more memory for the requested operation.
|
Displays an error message when there is no more memory for the requested operation.
|
||||||
*/
|
*/
|
||||||
|
|||||||
12
engine.c
12
engine.c
@ -661,23 +661,19 @@ void Main_handler(void)
|
|||||||
Key=0;
|
Key=0;
|
||||||
break;
|
break;
|
||||||
case SPECIAL_NEXT_USER_FORECOLOR : // Next user-defined foreground color
|
case SPECIAL_NEXT_USER_FORECOLOR : // Next user-defined foreground color
|
||||||
Message_not_implemented(); // !!! TEMPORAIRE !!!
|
Special_next_user_forecolor();
|
||||||
//Special_Next_user_forecolor();
|
|
||||||
Key=0;
|
Key=0;
|
||||||
break;
|
break;
|
||||||
case SPECIAL_PREVIOUS_USER_FORECOLOR : // Previous user-defined foreground color
|
case SPECIAL_PREVIOUS_USER_FORECOLOR : // Previous user-defined foreground color
|
||||||
Message_not_implemented(); // !!! TEMPORAIRE !!!
|
Special_previous_user_forecolor();
|
||||||
//Special_Previous_user_forecolor();
|
|
||||||
Key=0;
|
Key=0;
|
||||||
break;
|
break;
|
||||||
case SPECIAL_NEXT_USER_BACKCOLOR : // Next user-defined background color
|
case SPECIAL_NEXT_USER_BACKCOLOR : // Next user-defined background color
|
||||||
Message_not_implemented(); // !!! TEMPORAIRE !!!
|
Special_next_user_backcolor();
|
||||||
//Special_Next_user_backcolor();
|
|
||||||
Key=0;
|
Key=0;
|
||||||
break;
|
break;
|
||||||
case SPECIAL_PREVIOUS_USER_BACKCOLOR : // Previous user-defined background color
|
case SPECIAL_PREVIOUS_USER_BACKCOLOR : // Previous user-defined background color
|
||||||
Message_not_implemented(); // !!! TEMPORAIRE !!!
|
Special_previous_user_backcolor();
|
||||||
//Special_Previous_user_backcolor();
|
|
||||||
Key=0;
|
Key=0;
|
||||||
break;
|
break;
|
||||||
case SPECIAL_SHOW_HIDE_CURSOR : // Show / Hide cursor
|
case SPECIAL_SHOW_HIDE_CURSOR : // Show / Hide cursor
|
||||||
|
|||||||
6
help.c
6
help.c
@ -152,9 +152,9 @@ void Window_set_shortcut(int action_id)
|
|||||||
|
|
||||||
// Zone de description
|
// Zone de description
|
||||||
Window_display_frame_in(5,68,292,37);
|
Window_display_frame_in(5,68,292,37);
|
||||||
Print_in_window(9,70,ConfigKey[config_index].Explanation1,MC_Black,MC_Light);
|
Print_in_window(8,70,ConfigKey[config_index].Explanation1,MC_Black,MC_Light);
|
||||||
Print_in_window(9,78,ConfigKey[config_index].Explanation2,MC_Black,MC_Light);
|
Print_in_window(8,78,ConfigKey[config_index].Explanation2,MC_Black,MC_Light);
|
||||||
Print_in_window(9,86,ConfigKey[config_index].Explanation3,MC_Black,MC_Light);
|
Print_in_window(8,86,ConfigKey[config_index].Explanation3,MC_Black,MC_Light);
|
||||||
|
|
||||||
// Shortcut 0
|
// Shortcut 0
|
||||||
Window_set_normal_button(27,30,177,14,"",0,1,KEY_NONE); // 4
|
Window_set_normal_button(27,30,177,14,"",0,1,KEY_NONE); // 4
|
||||||
|
|||||||
20
helpfile.h
20
helpfile.h
@ -2222,12 +2222,26 @@ static const T_Help_table helptable_palette[] =
|
|||||||
HELP_TEXT ("- Colors for best match:")
|
HELP_TEXT ("- Colors for best match:")
|
||||||
HELP_TEXT ("A menu in which you can select the colors")
|
HELP_TEXT ("A menu in which you can select the colors")
|
||||||
HELP_TEXT ("that have not to be used for smoothing, for")
|
HELP_TEXT ("that have not to be used for smoothing, for")
|
||||||
HELP_TEXT ("the transparency mode and for remapping.")
|
HELP_TEXT ("the transparency mode, and for remapping.")
|
||||||
HELP_TEXT ("")
|
HELP_TEXT ("")
|
||||||
HELP_TEXT ("- User's color series:")
|
HELP_TEXT ("- User's color series:")
|
||||||
HELP_TEXT ("A menu in which you can define color series")
|
HELP_TEXT ("A menu in which you can define color series")
|
||||||
HELP_TEXT ("for next/previous colors.")
|
HELP_TEXT ("for next/previous user color shortcuts.")
|
||||||
HELP_TEXT ("*** Not implemented yet ***")
|
HELP_TEXT ("It's the same settings than the shade mode.")
|
||||||
|
HELP_TEXT ("After you have some color ranges defined in")
|
||||||
|
HELP_TEXT ("this screen, you can use those shortcuts to")
|
||||||
|
HELP_TEXT ("move to the next or previous color according")
|
||||||
|
HELP_TEXT ("to your ranges:")
|
||||||
|
HELP_TEXT ("")
|
||||||
|
HELP_TEXT ("Foreground color")
|
||||||
|
HELP_TEXT ("")
|
||||||
|
HELP_LINK (" Next : %s", SPECIAL_NEXT_USER_FORECOLOR)
|
||||||
|
HELP_LINK (" Previous: %s", SPECIAL_PREVIOUS_USER_FORECOLOR)
|
||||||
|
HELP_TEXT ("")
|
||||||
|
HELP_TEXT ("Background color")
|
||||||
|
HELP_LINK (" Next : %s", SPECIAL_NEXT_USER_BACKCOLOR)
|
||||||
|
HELP_LINK (" Previous: %s", SPECIAL_PREVIOUS_USER_BACKCOLOR)
|
||||||
|
HELP_TEXT ("")
|
||||||
HELP_TEXT ("")
|
HELP_TEXT ("")
|
||||||
HELP_TEXT ("- Palette layout:")
|
HELP_TEXT ("- Palette layout:")
|
||||||
HELP_TEXT ("Lets you customize the palette that appears")
|
HELP_TEXT ("Lets you customize the palette that appears")
|
||||||
|
|||||||
12
palette.c
12
palette.c
@ -34,6 +34,7 @@
|
|||||||
#include "windows.h"
|
#include "windows.h"
|
||||||
#include "input.h"
|
#include "input.h"
|
||||||
#include "palette.h"
|
#include "palette.h"
|
||||||
|
#include "shade.h"
|
||||||
|
|
||||||
byte Palette_view_is_RGB = 1; // Indique si on est en HSL ou en RGB
|
byte Palette_view_is_RGB = 1; // Indique si on est en HSL ou en RGB
|
||||||
|
|
||||||
@ -2165,7 +2166,7 @@ void Button_Secondary_palette(void)
|
|||||||
Open_window(200,146,"Palettes");
|
Open_window(200,146,"Palettes");
|
||||||
|
|
||||||
Window_set_normal_button(10,20,180,14,"Colors for best match",12,1,SDLK_b); // 1
|
Window_set_normal_button(10,20,180,14,"Colors for best match",12,1,SDLK_b); // 1
|
||||||
Window_set_normal_button(10,37,180,14,"User's color series" ,14,0,SDLK_s); // 2
|
Window_set_normal_button(10,37,180,14,"User's color series" ,14,1,SDLK_s); // 2
|
||||||
Window_set_normal_button(139,126,53,14,"OK" , 0,1,SDLK_RETURN); // 3
|
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_set_normal_button( 80,126,53,14,"Cancel" , 0,1,KEY_ESC); // 4
|
||||||
Window_display_frame(10,55,122,66);
|
Window_display_frame(10,55,122,66);
|
||||||
@ -2249,7 +2250,7 @@ void Button_Secondary_palette(void)
|
|||||||
Window_draw_slider(rgb_scale_slider);
|
Window_draw_slider(rgb_scale_slider);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
while (clicked_button!=1 && clicked_button!=3 && clicked_button!=4);
|
while (clicked_button!=1 && clicked_button!=2 && clicked_button!=3 && clicked_button!=4);
|
||||||
|
|
||||||
// We need to get the sliders positions before closing the window, because they will be freed.
|
// We need to get the sliders positions before closing the window, because they will be freed.
|
||||||
palette_cols=256-columns_slider->Position;
|
palette_cols=256-columns_slider->Position;
|
||||||
@ -2285,6 +2286,13 @@ void Button_Secondary_palette(void)
|
|||||||
{
|
{
|
||||||
Menu_tag_colors("Tag colors to exclude",Exclude_color,&dummy,1, NULL);
|
Menu_tag_colors("Tag colors to exclude",Exclude_color,&dummy,1, NULL);
|
||||||
}
|
}
|
||||||
|
else if (clicked_button==2)
|
||||||
|
{
|
||||||
|
// Open the menu with Shade settings. Same as the shortcut, except
|
||||||
|
// that this will not activate shade mode on exit.
|
||||||
|
Shade_settings_menu();
|
||||||
|
}
|
||||||
|
|
||||||
if (palette_needs_redraw)
|
if (palette_needs_redraw)
|
||||||
{
|
{
|
||||||
Change_palette_cells();
|
Change_palette_cells();
|
||||||
|
|||||||
26
shade.c
26
shade.c
@ -990,20 +990,21 @@ int Menu_shade(void)
|
|||||||
return (clicked_button==5);
|
return (clicked_button==5);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Handles the screen with Shade settings.
|
||||||
|
/// @return true if user clicked ok, false if he cancelled
|
||||||
void Button_Shade_menu(void)
|
int Shade_settings_menu(void)
|
||||||
{
|
{
|
||||||
T_Shade * initial_shade_list; // Anciennes données des shades
|
T_Shade * initial_shade_list; // Anciennes données des shades
|
||||||
byte old_shade; // old n° de shade actif
|
byte old_shade; // old n° de shade actif
|
||||||
|
int return_code;
|
||||||
|
|
||||||
// Backup des anciennes données
|
// Backup des anciennes données
|
||||||
initial_shade_list=(T_Shade *)malloc(sizeof(Shade_list));
|
initial_shade_list=(T_Shade *)malloc(sizeof(Shade_list));
|
||||||
memcpy(initial_shade_list,Shade_list,sizeof(Shade_list));
|
memcpy(initial_shade_list,Shade_list,sizeof(Shade_list));
|
||||||
old_shade=Shade_current;
|
old_shade=Shade_current;
|
||||||
|
|
||||||
if (!Menu_shade()) // Cancel
|
return_code = Menu_shade();
|
||||||
|
if (!return_code) // Cancel
|
||||||
{
|
{
|
||||||
memcpy(Shade_list,initial_shade_list,sizeof(Shade_list));
|
memcpy(Shade_list,initial_shade_list,sizeof(Shade_list));
|
||||||
Shade_current=old_shade;
|
Shade_current=old_shade;
|
||||||
@ -1014,18 +1015,25 @@ void Button_Shade_menu(void)
|
|||||||
Shade_list[Shade_current].Step,
|
Shade_list[Shade_current].Step,
|
||||||
Shade_list[Shade_current].Mode,
|
Shade_list[Shade_current].Mode,
|
||||||
Shade_table_left,Shade_table_right);
|
Shade_table_left,Shade_table_right);
|
||||||
|
|
||||||
// Si avant de rentrer dans le menu on n'était pas en mode Shade
|
|
||||||
if (!Shade_mode)
|
|
||||||
Button_Shade_mode(); // => On y passe (cool!)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
free(initial_shade_list);
|
free(initial_shade_list);
|
||||||
|
|
||||||
Display_cursor();
|
Display_cursor();
|
||||||
|
|
||||||
|
return return_code;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Button_Shade_menu(void)
|
||||||
|
{
|
||||||
|
if (Shade_settings_menu())
|
||||||
|
{
|
||||||
|
// If user clicked OK while in the menu, activate Shade mode.
|
||||||
|
if (!Shade_mode)
|
||||||
|
Button_Shade_mode();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void Button_Quick_shade_menu(void)
|
void Button_Quick_shade_menu(void)
|
||||||
|
|||||||
2
shade.h
2
shade.h
@ -27,4 +27,6 @@
|
|||||||
|
|
||||||
void Button_Quick_shade_menu(void);
|
void Button_Quick_shade_menu(void);
|
||||||
|
|
||||||
|
int Shade_settings_menu(void);
|
||||||
|
|
||||||
#endif // SHADE_H_INCLUDED
|
#endif // SHADE_H_INCLUDED
|
||||||
|
|||||||
55
special.c
55
special.c
@ -212,7 +212,7 @@ void Bigger_paintbrush(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//--------------------- Passer à la ForeColor suivante -----------------------
|
//--------------------- Increase the ForeColor -----------------------
|
||||||
void Special_next_forecolor(void)
|
void Special_next_forecolor(void)
|
||||||
{
|
{
|
||||||
Hide_cursor();
|
Hide_cursor();
|
||||||
@ -227,7 +227,7 @@ void Special_next_forecolor(void)
|
|||||||
Display_cursor();
|
Display_cursor();
|
||||||
}
|
}
|
||||||
|
|
||||||
//-------------------- Passer à la ForeColor précédente ----------------------
|
//--------------------- Decrease the ForeColor -----------------------
|
||||||
void Special_previous_forecolor(void)
|
void Special_previous_forecolor(void)
|
||||||
{
|
{
|
||||||
Hide_cursor();
|
Hide_cursor();
|
||||||
@ -242,7 +242,7 @@ void Special_previous_forecolor(void)
|
|||||||
Display_cursor();
|
Display_cursor();
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------- Passer à la BackColor suivante -----------------------
|
//--------------------- Increase the BackColor -----------------------
|
||||||
void Special_next_backcolor(void)
|
void Special_next_backcolor(void)
|
||||||
{
|
{
|
||||||
Hide_cursor();
|
Hide_cursor();
|
||||||
@ -251,7 +251,7 @@ void Special_next_backcolor(void)
|
|||||||
Display_cursor();
|
Display_cursor();
|
||||||
}
|
}
|
||||||
|
|
||||||
//-------------------- Passer à la BackColor précédente ----------------------
|
//--------------------- Decrease the BackColor -----------------------
|
||||||
void Special_previous_backcolor(void)
|
void Special_previous_backcolor(void)
|
||||||
{
|
{
|
||||||
Hide_cursor();
|
Hide_cursor();
|
||||||
@ -260,6 +260,53 @@ void Special_previous_backcolor(void)
|
|||||||
Display_cursor();
|
Display_cursor();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Picks the next foreground color, according to current shade table
|
||||||
|
void Special_next_user_forecolor(void)
|
||||||
|
{
|
||||||
|
Hide_cursor();
|
||||||
|
Frame_menu_color(MC_Black);
|
||||||
|
|
||||||
|
Fore_color=Shade_table_left[Fore_color];
|
||||||
|
|
||||||
|
Reposition_palette();
|
||||||
|
Display_foreback();
|
||||||
|
|
||||||
|
Frame_menu_color(MC_White);
|
||||||
|
Display_cursor();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Picks the previous foreground color, according to current shade table
|
||||||
|
void Special_previous_user_forecolor(void)
|
||||||
|
{
|
||||||
|
Hide_cursor();
|
||||||
|
Frame_menu_color(MC_Black);
|
||||||
|
|
||||||
|
Fore_color=Shade_table_right[Fore_color];
|
||||||
|
|
||||||
|
Reposition_palette();
|
||||||
|
Display_foreback();
|
||||||
|
|
||||||
|
Frame_menu_color(MC_White);
|
||||||
|
Display_cursor();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Picks the next background color, according to current shade table
|
||||||
|
void Special_next_user_backcolor(void)
|
||||||
|
{
|
||||||
|
Hide_cursor();
|
||||||
|
Back_color=Shade_table_left[Back_color];
|
||||||
|
Display_foreback();
|
||||||
|
Display_cursor();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Picks the previous background color, according to current shade table
|
||||||
|
void Special_previous_user_backcolor(void)
|
||||||
|
{
|
||||||
|
Hide_cursor();
|
||||||
|
Back_color=Shade_table_right[Back_color];
|
||||||
|
Display_foreback();
|
||||||
|
Display_cursor();
|
||||||
|
}
|
||||||
|
|
||||||
// ------------------- Scroller l'écran (pas en mode loupe) ------------------
|
// ------------------- Scroller l'écran (pas en mode loupe) ------------------
|
||||||
void Scroll_screen(short delta_x,short delta_y)
|
void Scroll_screen(short delta_x,short delta_y)
|
||||||
|
|||||||
@ -32,6 +32,11 @@ void Special_previous_forecolor(void);
|
|||||||
void Special_next_backcolor(void);
|
void Special_next_backcolor(void);
|
||||||
void Special_previous_backcolor(void);
|
void Special_previous_backcolor(void);
|
||||||
|
|
||||||
|
void Special_next_user_forecolor(void);
|
||||||
|
void Special_previous_user_forecolor(void);
|
||||||
|
void Special_next_user_backcolor(void);
|
||||||
|
void Special_previous_user_backcolor(void);
|
||||||
|
|
||||||
void Scroll_screen(short delta_x,short delta_y);
|
void Scroll_screen(short delta_x,short delta_y);
|
||||||
void Scroll_magnifier(short delta_x,short delta_y);
|
void Scroll_magnifier(short delta_x,short delta_y);
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user