Skip to content

Commit

Permalink
Hide tiles overmap behind an option (CleverRaven#49586)
Browse files Browse the repository at this point in the history
* Hide tiles overmap behind an option

Co-authored-by: actual-nh <74678550+actual-nh@users.noreply.github.com>
  • Loading branch information
ZhilkinSerg and actual-nh authored Jul 5, 2021
1 parent 0d6814d commit 1f0b625
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/cached_options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions src/cached_options.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 9 additions & 0 deletions src/options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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" ),
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -3125,6 +3133,7 @@ static void update_options_cache()
// cache to global due to heavy usage.
trigdist = ::get_option<bool>( "CIRCLEDIST" );
use_tiles = ::get_option<bool>( "USE_TILES" );
use_tiles_overmap = ::get_option<bool>( "USE_TILES_OVERMAP" );
log_from_top = ::get_option<std::string>( "LOG_FLOW" ) == "new_top";
message_ttl = ::get_option<int>( "MESSAGE_TTL" );
message_cooldown = ::get_option<int>( "MESSAGE_COOLDOWN" );
Expand Down
2 changes: 1 addition & 1 deletion src/overmap_ui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1f0b625

Please sign in to comment.