waypoint info now works

This commit is contained in:
Bill Currie 2006-12-20 08:46:36 +00:00
parent efde0e8ab1
commit cc4429d1fe
3 changed files with 18 additions and 8 deletions

View file

@ -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;

View file

@ -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

View file

@ -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;