Skip to content

Commit

Permalink
Merge pull request CleverRaven#60132 from dseguin/main_menu_minor_fixes
Browse files Browse the repository at this point in the history
Main menu: minor fixes
  • Loading branch information
kevingranade authored Aug 29, 2022
2 parents 70905b5 + c9d551d commit 0104f29
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 3 deletions.
45 changes: 44 additions & 1 deletion data/raw/keybindings.json
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,20 @@
{ "input_method": "keyboard_code", "key": "s", "mod": [ "shift" ] }
]
},
{
"type": "keybinding",
"id": "QUIT",
"category": "AUTO_PICKUP",
"name": "Quit",
"bindings": [
{ "input_method": "keyboard_any", "key": "ESC" },
{ "input_method": "keyboard_any", "key": "q" },
{ "input_method": "keyboard_char", "key": "Q" },
{ "input_method": "keyboard_code", "key": "q", "mod": [ "shift" ] },
{ "input_method": "keyboard_any", "key": "SPACE" },
{ "input_method": "mouse", "key": "MOUSE_RIGHT" }
]
},
{
"type": "keybinding",
"id": "ADD_DEFAULT_RULESET",
Expand Down Expand Up @@ -482,6 +496,20 @@
{ "input_method": "keyboard_code", "key": "s", "mod": [ "shift" ] }
]
},
{
"type": "keybinding",
"id": "QUIT",
"category": "SAFEMODE",
"name": "Quit",
"bindings": [
{ "input_method": "keyboard_any", "key": "ESC" },
{ "input_method": "keyboard_any", "key": "q" },
{ "input_method": "keyboard_char", "key": "Q" },
{ "input_method": "keyboard_code", "key": "q", "mod": [ "shift" ] },
{ "input_method": "keyboard_any", "key": "SPACE" },
{ "input_method": "mouse", "key": "MOUSE_RIGHT" }
]
},
{
"type": "keybinding",
"id": "USAGE_HELP",
Expand Down Expand Up @@ -3668,6 +3696,20 @@
{ "input_method": "keyboard_code", "key": "c", "mod": [ "shift" ] }
]
},
{
"type": "keybinding",
"id": "QUIT",
"category": "COLORS",
"name": "Quit",
"bindings": [
{ "input_method": "keyboard_any", "key": "ESC" },
{ "input_method": "keyboard_any", "key": "q" },
{ "input_method": "keyboard_char", "key": "Q" },
{ "input_method": "keyboard_code", "key": "q", "mod": [ "shift" ] },
{ "input_method": "keyboard_any", "key": "SPACE" },
{ "input_method": "mouse", "key": "MOUSE_RIGHT" }
]
},
{
"type": "keybinding",
"id": "YES",
Expand Down Expand Up @@ -3924,7 +3966,8 @@
{ "input_method": "keyboard_any", "key": "ESC" },
{ "input_method": "keyboard_any", "key": "SPACE" },
{ "input_method": "keyboard_any", "key": "RETURN" },
{ "input_method": "keyboard_any", "key": "KEYPAD_ENTER" }
{ "input_method": "keyboard_any", "key": "KEYPAD_ENTER" },
{ "input_method": "mouse", "key": "MOUSE_RIGHT" }
]
},
{
Expand Down
6 changes: 4 additions & 2 deletions src/options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3205,8 +3205,10 @@ std::string options_manager::show( bool ingame, const bool world_options_only, b
const int psize = pages_.size();
found_opt = run_for_point_in<int, point>( opt_tab_map, *coord,
[&iCurrentPage, &new_val, &psize]( const std::pair<int, inclusive_rectangle<point>> &p ) {
new_val = true;
iCurrentPage = clamp<int>( p.first, 0, psize - 1 );
if( p.first != iCurrentPage ) {
new_val = true;
iCurrentPage = clamp<int>( p.first, 0, psize - 1 );
}
} ) > 0;
if( new_val ) {
iCurrentLine = 0;
Expand Down

0 comments on commit 0104f29

Please sign in to comment.