diff --git a/data/raw/keybindings.json b/data/raw/keybindings.json index 2921bfb751ba1..2fdc6b55ade66 100644 --- a/data/raw/keybindings.json +++ b/data/raw/keybindings.json @@ -2609,13 +2609,6 @@ "id": "factions", "bindings": [ { "input_method": "keyboard_char", "key": "#" }, { "input_method": "keyboard_code", "key": "3", "mod": [ "shift" ] } ] }, - { - "type": "keybinding", - "name": "View achievements, scores, and kills", - "category": "DEFAULTMODE", - "id": "scores", - "bindings": [ { "input_method": "keyboard_char", "key": ")" }, { "input_method": "keyboard_code", "key": "0", "mod": [ "shift" ] } ] - }, { "type": "keybinding", "name": "View morale", @@ -2986,7 +2979,8 @@ "type": "keybinding", "id": "diary", "name": "Open diary", - "category": "DEFAULTMODE" + "category": "DEFAULTMODE", + "bindings": [ { "input_method": "keyboard_char", "key": ")" }, { "input_method": "keyboard_code", "key": "0", "mod": [ "shift" ] } ] }, { "type": "keybinding", @@ -4285,6 +4279,13 @@ "category": "DIARY", "bindings": [ { "input_method": "keyboard_any", "mod": [ ], "key": [ "n" ] } ] }, + { + "type": "keybinding", + "name": "View achievements, scores, and kills", + "category": "DIARY", + "id": "VIEW_SCORES", + "bindings": [ { "input_method": "keyboard_any", "mod": [ ], "key": [ "v" ] } ] + }, { "type": "keybinding", "id": "TEXT.QUIT", diff --git a/src/action.cpp b/src/action.cpp index 318385db7ee48..75d137c8e54d5 100644 --- a/src/action.cpp +++ b/src/action.cpp @@ -311,8 +311,6 @@ std::string action_ident( action_id act ) return "missions"; case ACTION_FACTIONS: return "factions"; - case ACTION_SCORES: - return "scores"; case ACTION_MEDICAL: return "medical"; case ACTION_BODYSTATUS: @@ -442,7 +440,6 @@ bool can_action_change_worldstate( const action_id act ) case ACTION_MAP: case ACTION_SKY: case ACTION_MISSIONS: - case ACTION_SCORES: case ACTION_FACTIONS: case ACTION_MORALE: case ACTION_MEDICAL: @@ -973,7 +970,6 @@ action_id handle_action_menu() } else if( category == _( "Info" ) ) { REGISTER_ACTION( ACTION_PL_INFO ); REGISTER_ACTION( ACTION_MISSIONS ); - REGISTER_ACTION( ACTION_SCORES ); REGISTER_ACTION( ACTION_FACTIONS ); REGISTER_ACTION( ACTION_MORALE ); REGISTER_ACTION( ACTION_MEDICAL ); diff --git a/src/action.h b/src/action.h index 957b3bb06700b..f8dd9a42b6f53 100644 --- a/src/action.h +++ b/src/action.h @@ -255,8 +255,6 @@ enum action_id : int { ACTION_SKY, /** Display missions screen */ ACTION_MISSIONS, - /** Display scores screen */ - ACTION_SCORES, /** Display factions screen */ ACTION_FACTIONS, /** Display morale effects screen */ diff --git a/src/diary_ui.cpp b/src/diary_ui.cpp index 51c3aa7a3f52d..aa33674046a2c 100644 --- a/src/diary_ui.cpp +++ b/src/diary_ui.cpp @@ -14,6 +14,7 @@ #include "options.h" #include "output.h" #include "popup.h" +#include "scores_ui.h" #include "string_editor_window.h" #include "string_formatter.h" #include "string_input_popup.h" @@ -177,6 +178,7 @@ void diary::show_diary_ui( diary *c_diary ) ctxt.register_action( "NEW_PAGE" ); ctxt.register_action( "DELETE PAGE" ); ctxt.register_action( "EXPORT_DIARY" ); + ctxt.register_action( "VIEW_SCORES" ); ctxt.register_action( "HELP_KEYBINDINGS" ); ui_adaptor ui_diary; @@ -245,7 +247,7 @@ void diary::show_diary_ui( diary *c_diary ) const point &beg = beg_and_max.first; const point &max = beg_and_max.second; - w_desc = catacurses::newwin( 3, max.x * 3 / 10 + max.x + 10, point( beg.x - 5 - max.x * 3 / 10, + w_desc = catacurses::newwin( 4, max.x * 3 / 10 + max.x + 10, point( beg.x - 5 - max.x * 3 / 10, beg.y - 6 ) ); ui.position_from_window( w_desc ); @@ -263,6 +265,8 @@ void diary::show_diary_ui( diary *c_diary ) ctxt.get_desc( "EXPORT_DIARY", _( "Export diary" ), input_context::allow_all_keys ) ); center_print( w_desc, 1, c_white, desc ); + center_print( w_desc, 2, c_white, ctxt.get_desc( "VIEW_SCORES", + _( "View achievements, scores, and kills" ), input_context::allow_all_keys ) ); wnoutrefresh( w_desc ); } ); @@ -339,6 +343,8 @@ void diary::show_diary_ui( diary *c_diary ) c_diary->new_page(); selected[window_mode::PAGE_WIN] = c_diary->pages.size() - 1; + } else if( action == "VIEW_SCORES" ) { + show_scores_ui( g->achievements(), g->stats(), g->get_kill_tracker() ); } else if( action == "DELETE PAGE" ) { if( !c_diary->pages.empty() ) { if( query_yn( _( "Really delete Page?" ) ) ) { diff --git a/src/game.cpp b/src/game.cpp index b17e741315ac9..9584dae3d4865 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -2426,7 +2426,6 @@ input_context get_default_mode_input_context() ctxt.register_action( "sky" ); ctxt.register_action( "missions" ); ctxt.register_action( "factions" ); - ctxt.register_action( "scores" ); ctxt.register_action( "morale" ); ctxt.register_action( "messages" ); ctxt.register_action( "help" ); diff --git a/src/game.h b/src/game.h index daa9d3f5abc13..832ced4b2e114 100644 --- a/src/game.h +++ b/src/game.h @@ -526,6 +526,8 @@ class game void reload_npcs(); void remove_npc( character_id const &id ); const kill_tracker &get_kill_tracker() const; + stats_tracker &stats(); + achievements_tracker &achievements(); /** Add follower id to set of followers. */ void add_npc_follower( const character_id &id ); /** Remove follower id from follower set. */ @@ -1042,9 +1044,7 @@ class game const scenario *scen = nullptr; // NOLINT(cata-serialize) event_bus &events(); - stats_tracker &stats(); timed_event_manager &timed_events; // NOLINT(cata-serialize) - achievements_tracker &achievements(); memorial_logger &memorial(); global_variables global_variables_instance; diff --git a/src/handle_action.cpp b/src/handle_action.cpp index d0c3bc52de8ec..ffdcfc84e826f 100644 --- a/src/handle_action.cpp +++ b/src/handle_action.cpp @@ -2571,10 +2571,6 @@ bool game::do_regular_action( action_id &act, avatar &player_character, diary::show_diary_ui( u.get_avatar_diary() ); break; - case ACTION_SCORES: - show_scores_ui( *achievements_tracker_ptr, stats(), get_kill_tracker() ); - break; - case ACTION_FACTIONS: faction_manager_ptr->display(); break;