From 1f0b625fec9c9712e7dff303462bcd9c1112e770 Mon Sep 17 00:00:00 2001 From: Zhilkin Serg Date: Mon, 5 Jul 2021 18:02:15 +0300 Subject: [PATCH] Hide tiles overmap behind an option (#49586) * Hide tiles overmap behind an option Co-authored-by: actual-nh <74678550+actual-nh@users.noreply.github.com> --- src/cached_options.cpp | 1 + src/cached_options.h | 1 + src/options.cpp | 9 +++++++++ src/overmap_ui.cpp | 2 +- 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/cached_options.cpp b/src/cached_options.cpp index 3f87c82385472..7dfca47e66b92 100644 --- a/src/cached_options.cpp +++ b/src/cached_options.cpp @@ -9,6 +9,7 @@ int message_cooldown; bool test_mode; bool tile_iso; bool use_tiles; +bool use_tiles_overmap; test_mode_spilling_action_t test_mode_spilling_action = test_mode_spilling_action_t::spill_all; bool direct3d_mode; bool pixel_minimap_option; diff --git a/src/cached_options.h b/src/cached_options.h index e6ac4695eae5e..f89b4fd4677f8 100644 --- a/src/cached_options.h +++ b/src/cached_options.h @@ -14,6 +14,7 @@ extern int message_ttl; extern int message_cooldown; extern bool tile_iso; extern bool use_tiles; +extern bool use_tiles_overmap; extern bool pixel_minimap_option; // test_mode is not a regular game option; it's true when we are running unit diff --git a/src/options.cpp b/src/options.cpp index 856479c33e2ab..d97edc5182dd2 100644 --- a/src/options.cpp +++ b/src/options.cpp @@ -1865,6 +1865,13 @@ void options_manager::add_options_graphics() get_option( "TILES" ).setPrerequisite( "USE_TILES" ); + add( "USE_TILES_OVERMAP", "graphics", to_translation( "Use tiles to display overmap" ), + to_translation( "If true, replaces some TTF-rendered text with tiles for overmap display." ), + false, COPT_CURSES_HIDE + ); + + get_option( "USE_TILES_OVERMAP" ).setPrerequisite( "USE_TILES" ); + add_empty_line(); add( "MEMORY_MAP_MODE", "graphics", to_translation( "Memory map overlay preset" ), @@ -2553,6 +2560,7 @@ static void refresh_tiles( bool used_tiles_changed, bool pixel_minimap_height_ch } catch( const std::exception &err ) { popup( _( "Loading the tileset failed: %s" ), err.what() ); use_tiles = false; + use_tiles_overmap = false; } } else if( ingame && pixel_minimap_option && pixel_minimap_height_changed ) { g->mark_main_ui_adaptor_resize(); @@ -3125,6 +3133,7 @@ static void update_options_cache() // cache to global due to heavy usage. trigdist = ::get_option( "CIRCLEDIST" ); use_tiles = ::get_option( "USE_TILES" ); + use_tiles_overmap = ::get_option( "USE_TILES_OVERMAP" ); log_from_top = ::get_option( "LOG_FLOW" ) == "new_top"; message_ttl = ::get_option( "MESSAGE_TTL" ); message_cooldown = ::get_option( "MESSAGE_COOLDOWN" ); diff --git a/src/overmap_ui.cpp b/src/overmap_ui.cpp index 8a29ac4c1b97e..f79fd9e2ce1e7 100644 --- a/src/overmap_ui.cpp +++ b/src/overmap_ui.cpp @@ -1139,7 +1139,7 @@ void draw( input_context *inp_ctxt, const draw_data_t &data ) { draw_om_sidebar( wbar, center, orig, blink, fast_scroll, inp_ctxt, data ); - if( !use_tiles ) { + if( !use_tiles || !use_tiles_overmap ) { draw_ascii( w, center, orig, blink, show_explored, fast_scroll, inp_ctxt, data ); } else { #ifdef TILES