From f551da71bf824d0bf1033c3eea277b31e19b5371 Mon Sep 17 00:00:00 2001 From: Saicchi <47158232+Saicchi@users.noreply.github.com> Date: Tue, 8 Dec 2020 21:26:05 +0300 Subject: [PATCH 1/8] Debug menu option to generate sound at tile --- src/debug_menu.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/debug_menu.cpp b/src/debug_menu.cpp index 36ac08123867..c7aa4e245777 100644 --- a/src/debug_menu.cpp +++ b/src/debug_menu.cpp @@ -134,6 +134,7 @@ enum debug_menu_index { DEBUG_CHANGE_WEATHER, DEBUG_WIND_DIRECTION, DEBUG_WIND_SPEED, + DEBUG_GEN_SOUND, DEBUG_KILL_MONS, DEBUG_DISPLAY_HORDES, DEBUG_TEST_IT_GROUP, @@ -296,6 +297,7 @@ static int map_uilist() { uilist_entry( DEBUG_CHANGE_WEATHER, true, 'w', _( "Change weather" ) ) }, { uilist_entry( DEBUG_WIND_DIRECTION, true, 'd', _( "Change wind direction" ) ) }, { uilist_entry( DEBUG_WIND_SPEED, true, 's', _( "Change wind speed" ) ) }, + { uilist_entry( DEBUG_GEN_SOUND, true, 'S', _( "Generate sound" ) ) }, { uilist_entry( DEBUG_KILL_MONS, true, 'K', _( "Kill all monsters" ) ) }, { uilist_entry( DEBUG_CHANGE_TIME, true, 't', _( "Change time" ) ) }, { uilist_entry( DEBUG_OM_EDITOR, true, 'O', _( "Overmap editor" ) ) }, @@ -1461,6 +1463,26 @@ void debug() } break; + case DEBUG_GEN_SOUND: { + const cata::optional where = g->look_around(); + if( !where ) { + return; + } + + int volume; + if( !query_int( volume, _( "Volume of sound: " ) ) ) { + return; + } + + if( volume < 0 ) { + return; + } + + sounds::sound( *where, volume, sounds::sound_t::order, string_format( _( "DEBUG SOUND ( %d )" ), + volume ) ); + } + break; + case DEBUG_KILL_MONS: { for( monster &critter : g->all_monsters() ) { // Use the normal death functions, useful for testing death From 395d1c751064a8eba87dd76a945399ac3250b247 Mon Sep 17 00:00:00 2001 From: Aivean Date: Wed, 25 Nov 2020 13:21:30 -0800 Subject: [PATCH 2/8] speedup quicksave by limiting `ui_manager::redraw()` rate --- src/mapbuffer.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/mapbuffer.cpp b/src/mapbuffer.cpp index 55bc4899e959..5f46649da810 100644 --- a/src/mapbuffer.cpp +++ b/src/mapbuffer.cpp @@ -117,16 +117,18 @@ void mapbuffer::save( bool delete_after_save ) // A set of already-saved submaps, in global overmap coordinates. std::set saved_submaps; std::list submaps_to_delete; - int next_report = 0; + static constexpr std::chrono::milliseconds update_interval( 500 ); + auto last_update = std::chrono::steady_clock::now(); + for( auto &elem : submaps ) { - if( num_total_submaps > 100 && num_saved_submaps >= next_report ) { + auto now = std::chrono::steady_clock::now(); + if( last_update + update_interval < now ) { popup.message( _( "Please wait as the map saves [%d/%d]" ), num_saved_submaps, num_total_submaps ); ui_manager::redraw(); refresh_display(); - next_report += std::max( 100, num_total_submaps / 20 ); + last_update = now; } - // Whatever the coordinates of the current submap are, // we're saving a 2x2 quad of submaps at a time. // Submaps are generated in quads, so we know if we have one member of a quad, From af965d1fc18d3f3cb69cb73fe204169585c859ca Mon Sep 17 00:00:00 2001 From: Aloxaf Date: Mon, 7 Dec 2020 14:20:04 +0800 Subject: [PATCH 3/8] Fix support of font formats --- src/sdl_font.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sdl_font.cpp b/src/sdl_font.cpp index 5b1f3f5d577e..1871dd39bae9 100644 --- a/src/sdl_font.cpp +++ b/src/sdl_font.cpp @@ -190,7 +190,7 @@ CachedTTFFont::CachedTTFFont( { int faceIndex = 0; std::vector typefaces; - std::vector known_suffixes = { ".ttf", ".fon" }; + std::vector known_suffixes = { ".ttf", ".otf", ".ttc", ".fon" }; bool add_suffix = true; for( const std::string &ks : known_suffixes ) { if( string_ends_with( typeface, ks ) ) { @@ -249,7 +249,7 @@ CachedTTFFont::CachedTTFFont( typefaces.emplace_back( typeface + ( add_suffix ? ks : "" ) ); } } - if( typefaces.empty() ) { + if( add_suffix ) { typefaces.emplace_back( typeface ); } ensure_unifont_loaded( typefaces ); From 5d25b6c4f8c0f78b459d58698f6cbd9cf95c2439 Mon Sep 17 00:00:00 2001 From: Pupsi Mupsi <44737997+Pupsi-Mupsi@users.noreply.github.com> Date: Tue, 8 Dec 2020 21:21:18 +0300 Subject: [PATCH 4/8] Fix inventory_selector fast scroll via PAGE_UP/DOWN --- src/inventory_ui.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/inventory_ui.cpp b/src/inventory_ui.cpp index 6bc7f0652b58..b2a0b96f50a8 100644 --- a/src/inventory_ui.cpp +++ b/src/inventory_ui.cpp @@ -686,9 +686,9 @@ void inventory_column::on_input( const inventory_input &input ) move_selection( scroll_direction::FORWARD ); } else if( input.action == "UP" ) { move_selection( scroll_direction::BACKWARD ); - } else if( input.action == "NEXT_TAB" ) { + } else if( input.action == "PAGE_DOWN" ) { move_selection_page( scroll_direction::FORWARD ); - } else if( input.action == "PREV_TAB" ) { + } else if( input.action == "PAGE_UP" ) { move_selection_page( scroll_direction::BACKWARD ); } else if( input.action == "HOME" ) { select( 0, scroll_direction::FORWARD ); @@ -1690,14 +1690,14 @@ inventory_selector::inventory_selector( player &u, const inventory_selector_pres { ctxt.register_action( "DOWN", to_translation( "Next item" ) ); ctxt.register_action( "UP", to_translation( "Previous item" ) ); + ctxt.register_action( "PAGE_DOWN", to_translation( "Page down" ) ); + ctxt.register_action( "PAGE_UP", to_translation( "Page up" ) ); ctxt.register_action( "RIGHT", to_translation( "Next column" ) ); ctxt.register_action( "LEFT", to_translation( "Previous column" ) ); ctxt.register_action( "CONFIRM", to_translation( "Confirm your selection" ) ); ctxt.register_action( "QUIT", to_translation( "Cancel" ) ); - ctxt.register_action( "CATEGORY_SELECTION", to_translation( "Switch selection mode" ) ); + ctxt.register_action( "CATEGORY_SELECTION", to_translation( "Switch category selection mode" ) ); ctxt.register_action( "TOGGLE_FAVORITE", to_translation( "Toggle favorite" ) ); - ctxt.register_action( "NEXT_TAB", to_translation( "Page down" ) ); - ctxt.register_action( "PREV_TAB", to_translation( "Page up" ) ); ctxt.register_action( "HOME", to_translation( "Home" ) ); ctxt.register_action( "END", to_translation( "End" ) ); ctxt.register_action( "HELP_KEYBINDINGS" ); From 66fa94ed404f0b3f14e1ce5c3430b8044e00e668 Mon Sep 17 00:00:00 2001 From: Cimanyd0 <74877667+Cimanyd0@users.noreply.github.com> Date: Sun, 22 Nov 2020 21:10:38 -0600 Subject: [PATCH 5/8] change 'Toggle Panel Admin' to 'Sidebar Options' because that's what it's actually called --- data/raw/keybindings.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/raw/keybindings.json b/data/raw/keybindings.json index 9a2ed19cc0be..01ab3c84f7d5 100644 --- a/data/raw/keybindings.json +++ b/data/raw/keybindings.json @@ -2006,7 +2006,7 @@ }, { "type": "keybinding", - "name": "Toggle Panel Admin", + "name": "Sidebar Options", "category": "DEFAULTMODE", "id": "toggle_panel_adm", "bindings": [ { "input_method": "keyboard", "key": "}" } ] From 8b37d2ff3be7e262dc288343a06aebf2774f9b23 Mon Sep 17 00:00:00 2001 From: Reed Schrier Date: Sat, 21 Nov 2020 03:06:00 -0800 Subject: [PATCH 6/8] Add bodypart to bandaged/disinfected description --- data/json/effects.json | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/data/json/effects.json b/data/json/effects.json index 803519e8a804..e9dc732384c0 100644 --- a/data/json/effects.json +++ b/data/json/effects.json @@ -807,12 +807,13 @@ "type": "effect_type", "id": "bandaged", "name": [ "Bandaged" ], - "desc": [ "Your wounds are bandaged." ], + "desc": [ "The wounds on your %s are bandaged." ], "main_parts_only": true, "rating": "good", "int_dur_factor": "6 h", "max_intensity": 16, "max_effective_intensity": 8, + "part_descs": true, "max_duration": "4 d", "base_mods": { "healing_rate": [ 2 ], "healing_head": [ 50 ], "healing_torso": [ 150 ] }, "scaling_mods": { "healing_rate": [ 2 ] } @@ -821,12 +822,13 @@ "type": "effect_type", "id": "disinfected", "name": [ "Disinfected" ], - "desc": [ "Your wounds are disinfected." ], + "desc": [ "The wounds on your %s are disinfected." ], "main_parts_only": true, "rating": "good", "int_dur_factor": "6 h", "max_intensity": 16, "max_effective_intensity": 8, + "part_descs": true, "max_duration": "4 d", "base_mods": { "healing_rate": [ 2 ], "healing_head": [ 50 ], "healing_torso": [ 150 ] }, "scaling_mods": { "healing_rate": [ 2 ] } From 675cb5c14d4feec9e32ec24d4ca694ee13a137e0 Mon Sep 17 00:00:00 2001 From: Squishums <2533896+Squishums@users.noreply.github.com> Date: Sat, 14 Nov 2020 17:34:27 -0500 Subject: [PATCH 7/8] Fixes one second too short wait durations. --- src/handle_action.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/handle_action.cpp b/src/handle_action.cpp index 623b79306667..7e47415f38bf 100644 --- a/src/handle_action.cpp +++ b/src/handle_action.cpp @@ -919,7 +919,7 @@ static void wait() actType = ACT_WAIT; } - player_activity new_act( actType, 100 * ( to_turns( time_to_wait ) - 1 ), 0 ); + player_activity new_act( actType, 100 * ( to_turns( time_to_wait ) ), 0 ); u.assign_activity( new_act, false ); } From 4ebc2dc07654b7023e23b74542e534c74f5a8b52 Mon Sep 17 00:00:00 2001 From: Pupsi-Mupsi <44737997+Pupsi-Mupsi@users.noreply.github.com> Date: Tue, 3 Nov 2020 22:17:07 +0100 Subject: [PATCH 8/8] Increase max. batch number to 50 + cosmetics --- src/crafting_gui.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/crafting_gui.cpp b/src/crafting_gui.cpp index 4751f5694df2..5de44f2ff54a 100644 --- a/src/crafting_gui.cpp +++ b/src/crafting_gui.cpp @@ -598,7 +598,7 @@ const recipe *select_crafting_recipe( int &batch_size ) if( batch ) { current.clear(); - for( int i = 1; i <= 20; i++ ) { + for( int i = 1; i <= 50; i++ ) { current.push_back( chosen ); available.push_back( availability( chosen, i ) ); } @@ -822,9 +822,9 @@ const recipe *select_crafting_recipe( int &batch_size ) std::string description = _( "The default is to search result names. Some single-character prefixes " - "can be used with a colon (:) to search in other ways. Additional filters " - "are separated by commas (,).\n" - "\n" + "can be used with a colon : to search in other ways. Additional filters " + "are separated by commas ,.\n" + "\n\n" "Examples:\n" ); { @@ -844,7 +844,8 @@ const recipe *select_crafting_recipe( int &batch_size ) } description += - _( "\nYou can use arrow keys to go through search history\n\n" ); + _( "\nUse up/down arrow to go through your search history." ); + description += "\n\n\n"; string_input_popup() .title( _( "Search:" ) )