Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Medical Menu Implementation #54763

Merged
merged 13 commits into from
Apr 18, 2022
Merged
20 changes: 20 additions & 0 deletions data/raw/keybindings.json
Original file line number Diff line number Diff line change
Expand Up @@ -1275,6 +1275,12 @@
"name": "Customize character",
"bindings": [ { "input_method": "keyboard_any", "key": "y" } ]
},
{
"type": "keybinding",
"id": "MEDICAL_MENU",
"name": "Open Medical Menu",
"bindings": [ { "input_method": "keyboard_char", "key": "@" }, { "input_method": "keyboard_code", "key": "2", "mod": [ "shift" ] } ]
},
{
"type": "keybinding",
"id": "SAVE_TEMPLATE",
Expand Down Expand Up @@ -1859,6 +1865,13 @@
"name": "Toggle activate/examine",
"bindings": [ { "input_method": "keyboard_char", "key": "!" }, { "input_method": "keyboard_code", "key": "1", "mod": [ "shift" ] } ]
},
{
"type": "keybinding",
"id": "APPLY",
"category": "MEDICAL",
"name": "Apply and/or Use Item",
"bindings": [ { "input_method": "keyboard_char", "key": "A" }, { "input_method": "keyboard_code", "key": "a", "mod": [ "shift" ] } ]
},
{
"type": "keybinding",
"name": "Pause",
Expand Down Expand Up @@ -2225,6 +2238,13 @@
"id": "mutations",
"bindings": [ { "input_method": "keyboard_any", "key": "[" } ]
},
{
"type": "keybinding",
"name": "View Medical",
"category": "DEFAULTMODE",
"id": "medical",
"bindings": [ { "input_method": "keyboard_char", "key": "N" }, { "input_method": "keyboard_code", "key": "n", "mod": [ "shift" ] } ]
},
{
"type": "keybinding",
"name": "Re-layer armor/clothing",
Expand Down
4 changes: 4 additions & 0 deletions src/action.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,8 @@ std::string action_ident( action_id act )
return "factions";
case ACTION_SCORES:
return "scores";
case ACTION_MEDICAL:
return "medical";
case ACTION_MORALE:
return "morale";
case ACTION_MESSAGES:
Expand Down Expand Up @@ -431,6 +433,7 @@ bool can_action_change_worldstate( const action_id act )
case ACTION_SCORES:
case ACTION_FACTIONS:
case ACTION_MORALE:
case ACTION_MEDICAL:
case ACTION_MESSAGES:
case ACTION_HELP:
case ACTION_MAIN_MENU:
Expand Down Expand Up @@ -947,6 +950,7 @@ action_id handle_action_menu()
REGISTER_ACTION( ACTION_SCORES );
REGISTER_ACTION( ACTION_FACTIONS );
REGISTER_ACTION( ACTION_MORALE );
REGISTER_ACTION( ACTION_MEDICAL );
REGISTER_ACTION( ACTION_MESSAGES );
REGISTER_ACTION( ACTION_DIARY );
} else if( category == _( "Misc" ) ) {
Expand Down
2 changes: 2 additions & 0 deletions src/action.h
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,8 @@ enum action_id : int {
ACTION_FACTIONS,
/** Display morale effects screen */
ACTION_MORALE,
/** Displays medical menu */
ACTION_MEDICAL,
/** Display messages screen */
ACTION_MESSAGES,
/** Display help screen */
Expand Down
2 changes: 2 additions & 0 deletions src/avatar.h
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,8 @@ class avatar : public Character

/** Provides the window and detailed morale data */
void disp_morale();
/** Opens the medical window */
void disp_medical();
/** Resets stats, and applies effects in an idempotent manner */
void reset_stats() override;
/** Resets all missions before saving character to template */
Expand Down
1 change: 1 addition & 0 deletions src/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2320,6 +2320,7 @@ input_context get_default_mode_input_context()
ctxt.register_action( "drop_adj" );
ctxt.register_action( "bionics" );
ctxt.register_action( "mutations" );
ctxt.register_action( "medical" );
ctxt.register_action( "sort_armor" );
ctxt.register_action( "wait" );
ctxt.register_action( "craft" );
Expand Down
4 changes: 4 additions & 0 deletions src/handle_action.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2461,6 +2461,10 @@ bool game::do_regular_action( action_id &act, avatar &player_character,
player_character.disp_morale();
break;

case ACTION_MEDICAL:
player_character.disp_medical();
break;

case ACTION_MESSAGES:
Messages::display_messages();
break;
Expand Down
Loading