Add editor_status_fmt for printf status messages
This commit is contained in:
parent
63dc72ba4a
commit
7a1a28cece
|
@ -184,7 +184,7 @@ void TimedAutosave(char *name)
|
||||||
autosave_mine(name);
|
autosave_mine(name);
|
||||||
Timer_save_flag = 0;
|
Timer_save_flag = 0;
|
||||||
time( <ime );
|
time( <ime );
|
||||||
diagnostic_message("Mine Autosaved at %s\n", ctime(<ime));
|
diagnostic_message_fmt("Mine Autosaved at %s\n", ctime(<ime));
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -319,7 +319,7 @@ int ObjectPlaceObject(void)
|
||||||
if (num_players > MAX_PLAYERS)
|
if (num_players > MAX_PLAYERS)
|
||||||
editor_status("You just placed a cooperative player object");
|
editor_status("You just placed a cooperative player object");
|
||||||
if (num_players == MAX_MULTI_PLAYERS) {
|
if (num_players == MAX_MULTI_PLAYERS) {
|
||||||
editor_status("Can't place player object. Already %i players.", MAX_MULTI_PLAYERS);
|
editor_status_fmt("Can't place player object. Already %i players.", MAX_MULTI_PLAYERS);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1543,7 +1543,7 @@ int UngroupSegment( void )
|
||||||
|
|
||||||
Update_flags |= UF_WORLD_CHANGED;
|
Update_flags |= UF_WORLD_CHANGED;
|
||||||
mine_changed = 1;
|
mine_changed = 1;
|
||||||
diagnostic_message("Segment Ungrouped from Group %d.", current_group);
|
diagnostic_message_fmt("Segment Ungrouped from Group %d.", current_group);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
} else
|
} else
|
||||||
|
@ -1559,7 +1559,7 @@ int GroupSegment( void )
|
||||||
|
|
||||||
Update_flags |= UF_WORLD_CHANGED;
|
Update_flags |= UF_WORLD_CHANGED;
|
||||||
mine_changed = 1;
|
mine_changed = 1;
|
||||||
diagnostic_message("Segment Added to Group %d.", current_group);
|
diagnostic_message_fmt("Segment Added to Group %d.", current_group);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
} else
|
} else
|
||||||
|
@ -1688,7 +1688,7 @@ int CopyGroup(void)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (i != GroupList[current_group].num_segments) {
|
if (i != GroupList[current_group].num_segments) {
|
||||||
editor_status("Error -- Cannot copy group, attach side has a child (segment %i) attached.", Groupsegp[current_group]->children[Groupside[current_group]]);
|
editor_status_fmt("Error -- Cannot copy group, attach side has a child (segment %i) attached.", Groupsegp[current_group]->children[Groupside[current_group]]);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
11
editor/med.c
11
editor/med.c
|
@ -157,7 +157,7 @@ static char status_line[DIAGNOSTIC_MESSAGE_MAX] = "";
|
||||||
|
|
||||||
struct tm Editor_status_last_time;
|
struct tm Editor_status_last_time;
|
||||||
|
|
||||||
void editor_status( const char *format, ... )
|
void editor_status_fmt( const char *format, ... )
|
||||||
{
|
{
|
||||||
va_list ap;
|
va_list ap;
|
||||||
|
|
||||||
|
@ -166,7 +166,12 @@ void editor_status( const char *format, ... )
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
|
|
||||||
Editor_status_last_time = Editor_time_of_day;
|
Editor_status_last_time = Editor_time_of_day;
|
||||||
|
}
|
||||||
|
|
||||||
|
void editor_status( const char *text)
|
||||||
|
{
|
||||||
|
strcpy(status_line, text);
|
||||||
|
Editor_status_last_time = Editor_time_of_day;
|
||||||
}
|
}
|
||||||
|
|
||||||
// int tm_sec; /* seconds after the minute -- [0,61] */
|
// int tm_sec; /* seconds after the minute -- [0,61] */
|
||||||
|
@ -1200,7 +1205,7 @@ int editor_handler(UI_DIALOG *dlg, d_event *event, void *data)
|
||||||
{
|
{
|
||||||
char kdesc[100];
|
char kdesc[100];
|
||||||
GetKeyDescription( kdesc, keypress );
|
GetKeyDescription( kdesc, keypress );
|
||||||
editor_status("Error: %s isn't bound to anything.", kdesc );
|
editor_status_fmt("Error: %s isn't bound to anything.", kdesc );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1302,7 +1307,7 @@ int editor_handler(UI_DIALOG *dlg, d_event *event, void *data)
|
||||||
if (seg<0) { //found an object
|
if (seg<0) { //found an object
|
||||||
|
|
||||||
Cur_object_index = -seg-1;
|
Cur_object_index = -seg-1;
|
||||||
editor_status("Object %d selected.",Cur_object_index);
|
editor_status_fmt("Object %d selected.",Cur_object_index);
|
||||||
|
|
||||||
Update_flags |= UF_ED_STATE_CHANGED;
|
Update_flags |= UF_ED_STATE_CHANGED;
|
||||||
}
|
}
|
||||||
|
|
|
@ -666,7 +666,7 @@ int robot_dialog_handler(UI_DIALOG *dlg, d_event *event, robot_dialog *r)
|
||||||
strncpy(id_text, Powerup_names[Cur_goody_id], strlen(Powerup_names[Cur_goody_id]));
|
strncpy(id_text, Powerup_names[Cur_goody_id], strlen(Powerup_names[Cur_goody_id]));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
editor_status("Illegal contained object type (%i), changing to powerup.", Cur_goody_type);
|
editor_status_fmt("Illegal contained object type (%i), changing to powerup.", Cur_goody_type);
|
||||||
Cur_goody_type = OBJ_POWERUP;
|
Cur_goody_type = OBJ_POWERUP;
|
||||||
Cur_goody_id = 0;
|
Cur_goody_id = 0;
|
||||||
type_text = "Powerup";
|
type_text = "Powerup";
|
||||||
|
|
|
@ -82,7 +82,7 @@ void sort_seg_list(int n_segs,short *segnumlist,vms_vector *pos)
|
||||||
int SortSelectedList(void)
|
int SortSelectedList(void)
|
||||||
{
|
{
|
||||||
sort_seg_list(N_selected_segs,Selected_segs,&ConsoleObject->pos);
|
sort_seg_list(N_selected_segs,Selected_segs,&ConsoleObject->pos);
|
||||||
editor_status("%i element selected list sorted.",N_selected_segs);
|
editor_status_fmt("%i element selected list sorted.",N_selected_segs);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1059,7 +1059,7 @@ int check_walls()
|
||||||
sprintf( Message, "Num_walls is bogus\nDo you wish to correct it?\n");
|
sprintf( Message, "Num_walls is bogus\nDo you wish to correct it?\n");
|
||||||
if (ui_messagebox( -2, -2, 2, Message, "Yes", "No" )==1) {
|
if (ui_messagebox( -2, -2, 2, Message, "Yes", "No" )==1) {
|
||||||
Num_walls = wall_count;
|
Num_walls = wall_count;
|
||||||
editor_status("Num_walls set to %d\n", Num_walls);
|
editor_status_fmt("Num_walls set to %d\n", Num_walls);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1084,7 +1084,7 @@ int check_walls()
|
||||||
sprintf( Message, "Num_triggers is bogus\nDo you wish to correct it?\n");
|
sprintf( Message, "Num_triggers is bogus\nDo you wish to correct it?\n");
|
||||||
if (ui_messagebox( -2, -2, 2, Message, "Yes", "No" )==1) {
|
if (ui_messagebox( -2, -2, 2, Message, "Yes", "No" )==1) {
|
||||||
Num_triggers = trigger_count;
|
Num_triggers = trigger_count;
|
||||||
editor_status("Num_triggers set to %d\n", Num_triggers);
|
editor_status_fmt("Num_triggers set to %d\n", Num_triggers);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1761,7 +1761,7 @@ void warn_if_concave_segments(void)
|
||||||
find_concave_segs();
|
find_concave_segs();
|
||||||
|
|
||||||
if (N_warning_segs) {
|
if (N_warning_segs) {
|
||||||
editor_status("*** WARNING *** %d concave segments in mine! *** WARNING ***",N_warning_segs);
|
editor_status_fmt("*** WARNING *** %d concave segments in mine! *** WARNING ***",N_warning_segs);
|
||||||
sprintf( temp, "%d", N_warning_segs );
|
sprintf( temp, "%d", N_warning_segs );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -601,7 +601,7 @@ void assign_uvs_to_side(segment *segp, int sidenum, uvl *uva, uvl *uvb, int va,
|
||||||
mag01 = fixmul(mag01, Stretch_scale_y);
|
mag01 = fixmul(mag01, Stretch_scale_y);
|
||||||
|
|
||||||
if (mag01 < F1_0/1024 )
|
if (mag01 < F1_0/1024 )
|
||||||
editor_status("U, V bogosity in segment #%i, probably on side #%i. CLEAN UP YOUR MESS!", segp-Segments, sidenum);
|
editor_status_fmt("U, V bogosity in segment #%i, probably on side #%i. CLEAN UP YOUR MESS!", segp-Segments, sidenum);
|
||||||
else {
|
else {
|
||||||
vm_vec_sub(&tvec,&Vertices[v2],&Vertices[v1]);
|
vm_vec_sub(&tvec,&Vertices[v2],&Vertices[v1]);
|
||||||
uvls[(vhi+1)%4].u = uvhi.u +
|
uvls[(vhi+1)%4].u = uvhi.u +
|
||||||
|
|
|
@ -437,7 +437,7 @@ int TexStretchCommon(int direction)
|
||||||
|
|
||||||
stretch_uvs_from_curedge(Cursegp, Curside);
|
stretch_uvs_from_curedge(Cursegp, Curside);
|
||||||
|
|
||||||
editor_status("Stretch scale = %7.4f, use Set Default to return to 1.0", f2fl(*sptr));
|
editor_status_fmt("Stretch scale = %7.4f, use Set Default to return to 1.0", f2fl(*sptr));
|
||||||
|
|
||||||
Update_flags |= UF_GAME_VIEW_CHANGED;
|
Update_flags |= UF_GAME_VIEW_CHANGED;
|
||||||
return 1;
|
return 1;
|
||||||
|
|
|
@ -491,13 +491,14 @@ extern int get_free_segment_number(void);
|
||||||
|
|
||||||
// Diagnostic message.
|
// Diagnostic message.
|
||||||
#define diagnostic_message editor_status
|
#define diagnostic_message editor_status
|
||||||
|
#define diagnostic_message_fmt editor_status_fmt
|
||||||
|
|
||||||
// Status Icon.
|
// Status Icon.
|
||||||
extern void print_status_icon( char icon[1], int position );
|
extern void print_status_icon( char icon[1], int position );
|
||||||
extern void clear_status_icon( char icon[1], int position );
|
extern void clear_status_icon( char icon[1], int position );
|
||||||
|
|
||||||
// Editor status message.
|
// Editor status message.
|
||||||
extern void editor_status(const char *format, ... );
|
extern void editor_status_fmt(const char *format, ... );
|
||||||
|
|
||||||
// Variables in editor.c that the k*.c files need
|
// Variables in editor.c that the k*.c files need
|
||||||
|
|
||||||
|
@ -527,7 +528,7 @@ extern editor_view RightView;
|
||||||
extern void set_view_target_from_segment(struct segment *sp);
|
extern void set_view_target_from_segment(struct segment *sp);
|
||||||
extern int SafetyCheck();
|
extern int SafetyCheck();
|
||||||
|
|
||||||
extern void editor_status( const char *format, ...);
|
void editor_status( const char *text);
|
||||||
|
|
||||||
extern int MacroNumEvents;
|
extern int MacroNumEvents;
|
||||||
extern int MacroStatus;
|
extern int MacroStatus;
|
||||||
|
|
|
@ -1404,7 +1404,7 @@ int load_level(const char * filename_passed)
|
||||||
|
|
||||||
#ifdef EDITOR
|
#ifdef EDITOR
|
||||||
if (EditorWindow)
|
if (EditorWindow)
|
||||||
editor_status("Loaded NEW mine %s, \"%s\"",filename,Current_level_name);
|
editor_status_fmt("Loaded NEW mine %s, \"%s\"",filename,Current_level_name);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(NDEBUG) && !defined(COMPACT_SEGS)
|
#if !defined(NDEBUG) && !defined(COMPACT_SEGS)
|
||||||
|
@ -1789,7 +1789,7 @@ int save_level_sub(char * filename, int compiled_version)
|
||||||
// if ( !compiled_version )
|
// if ( !compiled_version )
|
||||||
{
|
{
|
||||||
if (EditorWindow)
|
if (EditorWindow)
|
||||||
editor_status("Saved mine %s, \"%s\"",filename,Current_level_name);
|
editor_status_fmt("Saved mine %s, \"%s\"",filename,Current_level_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in a new issue