Navigation Menu

Skip to content

Commit

Permalink
Added center action for look around mode
Browse files Browse the repository at this point in the history
The existing key binding "CENTER" lost the category.
  • Loading branch information
AMurkin committed Dec 2, 2018
1 parent 05d851e commit 26fa078
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
13 changes: 6 additions & 7 deletions data/raw/keybindings.json
Expand Up @@ -532,13 +532,6 @@
"name": "Toggle recipes to be shown in favorite tab",
"bindings": [ { "input_method": "keyboard", "key": "*" } ]
},
{
"type": "keybinding",
"id": "CENTER",
"category": "OVERMAP",
"name": "Center On Character",
"bindings": [ { "input_method": "keyboard", "key": "0" } ]
},
{
"type": "keybinding",
"id": "LEVEL_UP",
Expand Down Expand Up @@ -899,6 +892,12 @@
"name": "Toggle Snap to Target",
"bindings": [ { "input_method": "keyboard", "key": "*" } ]
},
{
"type": "keybinding",
"id": "CENTER",
"name": "Center On Character",
"bindings": [ { "input_method": "keyboard", "key": "0" } ]
},
{
"type": "keybinding",
"id": "HELP",
Expand Down
4 changes: 4 additions & 0 deletions src/game.cpp
Expand Up @@ -7248,6 +7248,7 @@ cata::optional<tripoint> game::look_around( catacurses::window w_info, tripoint
ctxt.register_action( "LIST_ITEMS" );
}
ctxt.register_action( "MOUSE_MOVE" );
ctxt.register_action( "CENTER" );

ctxt.register_action( "debug_scent" );
ctxt.register_action( "CONFIRM" );
Expand Down Expand Up @@ -7374,6 +7375,9 @@ cata::optional<tripoint> game::look_around( catacurses::window w_info, tripoint
} else if( action == "EXTENDED_DESCRIPTION" ) {
extended_description( lp );
draw_sidebar();
} else if( action == "CENTER" ) {
center = start_point;
lp = start_point;
} else if( action == "MOUSE_MOVE" ) {
const tripoint old_lp = lp;
// Maximum mouse events before a forced graphics update
Expand Down

0 comments on commit 26fa078

Please sign in to comment.