Skip to content

Commit

Permalink
Add command line switch for ascii art
Browse files Browse the repository at this point in the history
  • Loading branch information
xuvatilavv committed Feb 25, 2022
1 parent 459e2ee commit fe32f3f
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ struct cli_opts {
dump_mode dmode = dump_mode::TSV;
std::vector<std::string> opts;
std::string world; /** if set try to load first save in this world on startup */
bool disable_ascii_art = false;
};

cli_opts parse_commandline( int argc, const char **argv )
Expand All @@ -273,7 +274,8 @@ cli_opts parse_commandline( int argc, const char **argv )
const char *section_default = nullptr;
const char *section_map_sharing = "Map sharing";
const char *section_user_directory = "User directories";
const std::array<arg_handler, 12> first_pass_arguments = {{
const char *section_accessibility = "Accessibility";
const std::array<arg_handler, 13> first_pass_arguments = {{
{
"--seed", "<string of letters and or numbers>",
"Sets the random number generator's seed value",
Expand Down Expand Up @@ -423,6 +425,16 @@ cli_opts parse_commandline( int argc, const char **argv )
PATH_INFO::set_standard_filenames();
return 1;
}
},
{
"--disable-ascii-art", nullptr,
"Disable aesthetic ascii art in menus and descriptions.",
section_accessibility,
0,
[&result]( int, const char ** ) -> int {
result.disable_ascii_art = true;
return 0;
}
}
}
};
Expand Down Expand Up @@ -705,6 +717,12 @@ int main( int argc, const char *argv[] )
exit_handler( -999 );
}

// Override existing settings from cli options
if( cli.disable_ascii_art ) {
get_options().get_option( "ENABLE_ASCII_ART" ).setValue( false );
get_options().get_option( "ENABLE_ASCII_TITLE" ).setValue( false );
}

// Now we do the actual game.

// I have no clue what this comment is on about
Expand Down

0 comments on commit fe32f3f

Please sign in to comment.