diff --git a/fbxa/bot_way.qc b/fbxa/bot_way.qc index 189f3ca..bbf0159 100644 --- a/fbxa/bot_way.qc +++ b/fbxa/bot_way.qc @@ -376,6 +376,7 @@ very good all things considered. if (current_way) [current_way deselect]; [t select]; + [self.editor refresh]; } } current_way = t; diff --git a/fbxa/editor.h b/fbxa/editor.h index 18531b2..41e366d 100644 --- a/fbxa/editor.h +++ b/fbxa/editor.h @@ -67,6 +67,7 @@ +(void)impulse; -(id)initWithOwner:(Target)owner; +-(void)refresh; @end #endif//__editor_h diff --git a/fbxa/editor.r b/fbxa/editor.r index e15c15d..313f6c5 100644 --- a/fbxa/editor.r +++ b/fbxa/editor.r @@ -135,6 +135,7 @@ { self = [super init]; mask = msk; + return self; } -(integer) getState @@ -380,9 +381,9 @@ initWithMask:AI_TRACE_TEST]]]; [ai_flag2_menu addItem:[[MenuItem alloc] initWithText:""]]; [ai_flag2_menu addItem:[[CommandMenuItem alloc] - initWithText:">>AI Flags page 2" + initWithText:">>AI Flag Management" object:[EditorState class] - selector:@selector(ai_flag2_menu)]]; + selector:@selector(ai_flags_menu)]]; [ai_flag2_menu addItem:[[CommandMenuItem alloc] initWithText:">>Main Menu" object:[EditorState class] @@ -485,11 +486,13 @@ +ai_flags_menu { + dprint ("ai_flags_menu\n"); [EditorState set_menu: ai_flags_menu]; } +ai_flag2_menu { + dprint ("ai_flag2_menu\n"); [EditorState set_menu: ai_flag2_menu]; } @@ -587,7 +590,7 @@ sprint (@self, PRINT_HIGH, sprintf ("\nwaypoint info for waypoint #%i", [way id])); sprint (@self, PRINT_HIGH, - sprintf ("\nAI Flag value: %#x", [way id])); + sprintf ("\nAI Flag value: %#x", way.flags)); for (i = 0; i < 4; i++) { if (!way.links[i]) continue; @@ -879,4 +882,8 @@ return self; } +-(void)refresh +{ + menu_time = time; +} @end diff --git a/fbxa/impulse_menu.r b/fbxa/impulse_menu.r index 25c6e68..0e3f8ed 100644 --- a/fbxa/impulse_menu.r +++ b/fbxa/impulse_menu.r @@ -115,12 +115,24 @@ local string str = text; local string s; local integer i; + local string [10] is; + local integer max_len = 0, len; - for (i = 0; i < 10; i++) { if (!items[i]) + for (i = 0; i < 10; i++) { + if (!items[i]) break; - s = [items[i] text]; + is[i] = [items[i] text]; + len = strlen(is[i]); + if (len > max_len) + max_len = len; + } + for (i = 0; i < 10; i++) { + if (!items[i]) + break; + s = is[i]; if (s) - str = sprintf ("%s\n[%i] %s", str, (i + 1) % 10, s); + str = sprintf (sprintf ("%%s\n[%%i] %%-%ds", max_len), + str, (i + 1) % 10, s); else str = sprintf ("%s\n", str); }