Fix display in message boxes when very long messages happened (normally only with Lua messages)
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1338 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
parent
87432470f3
commit
f64117aeda
@ -1117,7 +1117,7 @@ void Button_Skins(void)
|
||||
gfx = Load_graphics(skinsdir);
|
||||
if (gfx == NULL) // Error
|
||||
{
|
||||
Verbose_error_message(Gui_loading_error_message);
|
||||
Verbose_message("Error!", Gui_loading_error_message);
|
||||
// Update preview
|
||||
Window_rectangle(6, 14, 173, 16, MC_Light);
|
||||
}
|
||||
|
||||
11
factory.c
11
factory.c
@ -793,7 +793,7 @@ void Button_Brush_Factory(void)
|
||||
|
||||
if (Brush_backup == NULL)
|
||||
{
|
||||
Verbose_error_message("Out of memory!");
|
||||
Verbose_message("Error!", "Out of memory!");
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -803,7 +803,7 @@ void Button_Brush_Factory(void)
|
||||
{
|
||||
message = lua_tostring(L, 1);
|
||||
if(message)
|
||||
Verbose_error_message(message);
|
||||
Verbose_message("Error!", message);
|
||||
else
|
||||
Warning_message("Unknown error loading script!");
|
||||
}
|
||||
@ -812,7 +812,10 @@ void Button_Brush_Factory(void)
|
||||
int stack_size;
|
||||
stack_size= lua_gettop(L);
|
||||
if (stack_size>0 && (message = lua_tostring(L, stack_size))!=NULL)
|
||||
Verbose_error_message(message);
|
||||
//Verbose_message("Error running script", message);
|
||||
Verbose_message("Error!", "Your WM is forcing GrafX2 to resize to something "
|
||||
"smallerthantheminimalresolution.\n"
|
||||
"GrafX2 switched to a smaller\npixel scaler to avoid problems.");
|
||||
else
|
||||
Warning_message("Unknown error running script!");
|
||||
}
|
||||
@ -841,7 +844,7 @@ void Button_Brush_Factory(void)
|
||||
#else // NOLUA
|
||||
void Button_Brush_Factory(void)
|
||||
{
|
||||
Verbose_error_message("The brush factory is not available in this build of GrafX2.");
|
||||
Verbose_message("Error!", "The brush factory is not available in this build of GrafX2.");
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
2
graph.c
2
graph.c
@ -257,7 +257,7 @@ try_again:
|
||||
{
|
||||
if(pix_ratio != PIXEL_SIMPLE) {
|
||||
pix_ratio = PIXEL_SIMPLE;
|
||||
Verbose_error_message("Your WM is forcing GrafX2 to resize to something "
|
||||
Verbose_message("Error!", "Your WM is forcing GrafX2 to resize to something "
|
||||
"smaller than the minimal resolution.\n"
|
||||
"GrafX2 switched to a smaller\npixel scaler to avoid problems ");
|
||||
goto try_again;
|
||||
|
||||
17
windows.c
17
windows.c
@ -1113,8 +1113,8 @@ void Warning_message(char * message)
|
||||
Display_cursor();
|
||||
}
|
||||
|
||||
/// Window that shows a big message, and waits for a click on OK
|
||||
void Verbose_error_message(const char * message)
|
||||
/// Window that shows a big message (up to 34x12), and waits for a click on OK
|
||||
void Verbose_message(const char *caption, const char * message )
|
||||
{
|
||||
short clicked_button;
|
||||
int line;
|
||||
@ -1122,7 +1122,7 @@ void Verbose_error_message(const char * message)
|
||||
int nb_char;
|
||||
char buffer[36];
|
||||
|
||||
Open_window(300,160,"Error!");
|
||||
Open_window(300,160,caption);
|
||||
|
||||
// Word-wrap the message
|
||||
for (line=0; line < 12 && *message!='\0'; line++)
|
||||
@ -1142,16 +1142,18 @@ void Verbose_error_message(const char * message)
|
||||
}
|
||||
}
|
||||
// Close line buffer
|
||||
if (last_space == -1)
|
||||
last_space = 34;
|
||||
if (message[nb_char]=='\0' || last_space == -1)
|
||||
last_space = nb_char;
|
||||
buffer[last_space]='\0';
|
||||
|
||||
// Print
|
||||
Print_in_window(10,20+line*8,buffer,MC_Black,MC_Light);
|
||||
|
||||
// Next line
|
||||
message=message+last_space+1;
|
||||
// Strip leading spaces
|
||||
message=message+last_space;
|
||||
// Strip at most one carriage return and any leading spaces
|
||||
if (*message == '\n')
|
||||
message++;
|
||||
while (*message == ' ')
|
||||
message++;
|
||||
}
|
||||
@ -1169,7 +1171,6 @@ void Verbose_error_message(const char * message)
|
||||
Display_cursor();
|
||||
}
|
||||
|
||||
|
||||
// -- Redessiner le sprite d'un bouton dans le menu --
|
||||
|
||||
void Display_sprite_in_menu(int btn_number,int sprite_number)
|
||||
|
||||
@ -75,7 +75,7 @@ void Print_counter(short x,short y,const char * str,byte text_color,byte backgro
|
||||
|
||||
byte Confirmation_box(char * message);
|
||||
void Warning_message(char * message);
|
||||
void Verbose_error_message(const char * message);
|
||||
void Verbose_message(const char * caption, const char * message);
|
||||
int Requester_window(char* message, int initial_value);
|
||||
|
||||
void Display_image_limits(void);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user