Skip to content

Commit

Permalink
Add a hotkey for the flipmap toggle (#141)
Browse files Browse the repository at this point in the history
It's P
Issue: #118
  • Loading branch information
chreden authored Apr 25, 2018
1 parent d99489e commit fafe00d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
6 changes: 6 additions & 0 deletions trview/Level.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -354,4 +354,10 @@ namespace trview
return mode == Room::AlternateMode::IsAlternate && !_alternate_mode ||
mode == Room::AlternateMode::HasAlternate && _alternate_mode;
}

// Get the current state of the alternate mode (flipmap).
bool Level::alternate_mode() const
{
return _alternate_mode;
}
}
3 changes: 3 additions & 0 deletions trview/Level.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ namespace trview

// Event raised when the level needs to change the alternate mode.
Event<bool> on_alternate_mode_selected;

// Get the current state of the alternate mode (flipmap).
bool alternate_mode() const;
private:
void generate_rooms();
void generate_entities();
Expand Down
5 changes: 5 additions & 0 deletions trview/Viewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,11 @@ namespace trview
set_camera_mode(CameraMode::Axis);
break;
}
case 'P':
{
set_alternate_mode(!_level->alternate_mode());
break;
}
}
});

Expand Down

0 comments on commit fafe00d

Please sign in to comment.