From a8aed356d08cbadcca8c89c834e0301734d82af2 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Mon, 23 Aug 2010 14:08:37 +0900 Subject: [PATCH] fix getState and toggleState as suggested by Deek --- fbxa/editor.r | 24 ++++++++++++------------ fbxa/impulse_menu.h | 4 ++-- fbxa/impulse_menu.r | 4 ++-- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/fbxa/editor.r b/fbxa/editor.r index e7edc00..b04a428 100644 --- a/fbxa/editor.r +++ b/fbxa/editor.r @@ -62,12 +62,12 @@ @end @implementation NoclipFlag --(integer) getState +-(integer) state { return @self.movetype == MOVETYPE_NOCLIP; } --(void) toggleState +-(void) toggle { if (@self.movetype == MOVETYPE_NOCLIP) @self.movetype = MOVETYPE_WALK; @@ -77,36 +77,36 @@ @end @implementation GodmodeFlag --(integer) getState +-(integer) state { return !!(@self.flags & FL_GODMODE); } --(void) toggleState +-(void) toggle { @self.flags ^= FL_GODMODE; } @end @implementation HoldSelectFlag --(integer) getState +-(integer) state { return [EditorState getHoldSelectState]; } --(void) toggleState +-(void) toggle { [EditorState toggleHoldSelectState]; } @end @implementation DynamicFlag --(integer) getState +-(integer) state { return waypoint_mode == WM_EDITOR_DYNAMIC; } --(void) toggleState +-(void) toggle { if (waypoint_mode == WM_EDITOR_DYNAMIC) waypoint_mode = WM_EDITOR; @@ -116,13 +116,13 @@ @end @implementation DynamicLinkFlag --(integer) getState +-(integer) state { local integer mode = waypoint_mode; return mode == WM_EDITOR_DYNAMIC || mode == WM_EDITOR_DYNLINK; } --(void) toggleState +-(void) toggle { if (waypoint_mode == WM_EDITOR_DYNLINK) waypoint_mode = WM_EDITOR; @@ -139,7 +139,7 @@ return self; } --(integer) getState +-(integer) state { local Waypoint way = [EditorState current_way]; if (!way) @@ -147,7 +147,7 @@ return !!(way.flags & mask); } --(void) toggleState +-(void) toggle { local Waypoint way = [EditorState current_way]; if (way) diff --git a/fbxa/impulse_menu.h b/fbxa/impulse_menu.h index a90bc33..8a73374 100644 --- a/fbxa/impulse_menu.h +++ b/fbxa/impulse_menu.h @@ -13,8 +13,8 @@ @end @protocol FlagMenuItem --(integer) getState; --(void) toggleState; +-(integer) state; +-(void) toggle; @end @interface FlagMenuItem: MenuItem diff --git a/fbxa/impulse_menu.r b/fbxa/impulse_menu.r index 0e3f8ed..2b6303f 100644 --- a/fbxa/impulse_menu.r +++ b/fbxa/impulse_menu.r @@ -29,13 +29,13 @@ - (string) text { - local integer state = (integer)[flag getState]; + local integer state = (integer)[flag state]; return sprintf ("[%c] %s", state ? '#' : ' ', [super text]); } - (void) select { - [flag toggleState]; + [flag toggle]; } @end