From cc4429d1fe3fcd63a30308d38acc1c30a2ed484d Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Wed, 20 Dec 2006 08:46:36 +0000 Subject: [PATCH] waypoint info now works --- fbxa/bot_way.qc | 4 ++-- fbxa/editor.h | 5 ++++- fbxa/editor.r | 17 ++++++++++++----- 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/fbxa/bot_way.qc b/fbxa/bot_way.qc index a58f67e..189f3ca 100644 --- a/fbxa/bot_way.qc +++ b/fbxa/bot_way.qc @@ -373,9 +373,9 @@ very good all things considered. [current_way linkWay:t]; } if (editor) { - setmodel(t.ent, "progs/s_light.spr"); if (current_way) - setmodel(current_way.ent, "progs/s_bubble.spr"); + [current_way deselect]; + [t select]; } } current_way = t; diff --git a/fbxa/editor.h b/fbxa/editor.h index ebde827..6b3bc3e 100644 --- a/fbxa/editor.h +++ b/fbxa/editor.h @@ -4,6 +4,7 @@ @class ImpulseMenu; @class Waypoint; @class Bot; +@class Target; @interface EditorState: Object { @@ -13,6 +14,7 @@ string confirm_text; string confirm_cmd; + Target owner; Waypoint current_way; Waypoint last_way; integer hold_select; @@ -62,9 +64,10 @@ +(void)toggleHoldSelectState; +(string)getConfirmText; +(Waypoint)current_way; +-(Waypoint)current_way; +(void)impulse; --(id)init; +-(id)initWithOwner:(Target)owner; @end #endif//__editor_h diff --git a/fbxa/editor.r b/fbxa/editor.r index fc5f65a..6587c73 100644 --- a/fbxa/editor.r +++ b/fbxa/editor.r @@ -510,9 +510,12 @@ +close_menu { + local Target player = (Target) @self.@this; [EditorState set_menu: NIL]; [Waypoint hideAll]; waypoint_mode = WM_LOADED; + [player.editor release]; + player.editor = NIL; } @@ -836,8 +839,12 @@ +(Waypoint)current_way { - local EditorState editor = ((Target) @self.@this).editor; - return editor.current_way; + return ((Target) @self.@this).current_way; +} + +-(Waypoint)current_way +{ + return owner.current_way; } +(void)impulse @@ -846,10 +853,9 @@ local EditorState editor = player.editor; if (!editor) { - dprint ("start editor"); if (@self.impulse != 104) return; - player.editor = [[EditorState alloc] init]; + player.editor = [[EditorState alloc] initWithOwner:player]; [EditorState main_menu]; @self.impulse = 0; return; @@ -861,11 +867,12 @@ } } --(id)init +-(id)initWithOwner:(Target)owner { if (!main_menu) init_menus (); self = [super init]; + self.owner = owner; waypoint_mode = WM_EDITOR; [Waypoint showAll]; return self;