From a77e1d86ee4ce3d49c49750bee70a0fabfcf17a1 Mon Sep 17 00:00:00 2001 From: nlanza Date: Fri, 27 Feb 2009 02:54:00 +0000 Subject: FR 2533562: Move the CRAWL_PIZZA / -pizza options into the init file so that they're more easily accessible in hosted games. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9250 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/docs/crawl.6 | 6 ------ crawl-ref/docs/options_guide.txt | 6 +++++- crawl-ref/settings/init.txt | 2 ++ crawl-ref/source/acr.cc | 3 +-- crawl-ref/source/externs.h | 2 ++ crawl-ref/source/food.cc | 4 ++-- crawl-ref/source/initfile.cc | 25 +++++++++---------------- crawl-ref/source/initfile.h | 1 - 8 files changed, 21 insertions(+), 28 deletions(-) (limited to 'crawl-ref') diff --git a/crawl-ref/docs/crawl.6 b/crawl-ref/docs/crawl.6 index 5ce4add025..2010bf4456 100644 --- a/crawl-ref/docs/crawl.6 +++ b/crawl-ref/docs/crawl.6 @@ -7,7 +7,6 @@ crawl - play the roguelike game of crawl [-name ] [-race ] [-class ] -[-pizza ] [-plain] [-dir ] [-rc ] @@ -36,9 +35,6 @@ preselect race \fB-class\fR preselect class .TP -\fB-pizza\fR -crawl pizza -.TP \fB-plain\fR don't use IBM extended characters (needed when playing in a xterm) .TP @@ -1034,8 +1030,6 @@ either shout to attract them or tell them who to attack. .SH ENVIRONMENT VARIABLES .IP CRAWL_NAME Default name for your character. -.IP CRAWL_PIZZA -Your favourite pizza topping. .IP CRAWL_DIR The directory where your macros and character dumps are stored. .IP CRAWL_RC diff --git a/crawl-ref/docs/options_guide.txt b/crawl-ref/docs/options_guide.txt index 17957b7189..73346a7c9c 100644 --- a/crawl-ref/docs/options_guide.txt +++ b/crawl-ref/docs/options_guide.txt @@ -109,7 +109,7 @@ The contents of this text are: 6-a All OS. mouse_input, wiz_mode, char_set, classic_item_colours, colour, char_set, cset_ascii, cset_ibm, cset_dec, - cset_unicode, feature, mon_glyph + cset_unicode, feature, mon_glyph, pizza 6-b DOS and Windows. dos_use_background_intensity @@ -1978,6 +1978,10 @@ mon_glyph = : mon_glyph = player ghost : \_ +pizza = + The player's choice of pizza topping. + + 6-b DOS and Windows. ------------------------ diff --git a/crawl-ref/settings/init.txt b/crawl-ref/settings/init.txt index 6963a374f0..3579e5c5e3 100644 --- a/crawl-ref/settings/init.txt +++ b/crawl-ref/settings/init.txt @@ -386,6 +386,8 @@ note_monsters = orb of fire, ancient lich, Sigmund # colour.lightgray = black # colour.lightcyan = cyan # colour.yellow = brown +# +# pizza = Sausage # See options_guide.txt for the options # cset_ascii, cset_ibm, cset_dec, cset_unicode, cset_any, diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc index f46e4c33ec..0d75164a24 100644 --- a/crawl-ref/source/acr.cc +++ b/crawl-ref/source/acr.cc @@ -294,7 +294,6 @@ static void _show_commandline_options_help() puts(" -name character name"); puts(" -race preselect race (by letter, abbreviation, or name)"); puts(" -class preselect class (by letter, abbreviation, or name)"); - puts(" -pizza crawl pizza"); puts(" -plain don't use IBM extended characters"); puts(" -dir crawl directory"); puts(" -rc init file name"); @@ -303,7 +302,7 @@ static void _show_commandline_options_help() puts(" -macro directory to save/find macro.txt"); puts(""); puts("Command line options override init file options, which override"); - puts("environment options (CRAWL_NAME, CRAWL_PIZZA, CRAWL_DIR, CRAWL_RC)."); + puts("environment options (CRAWL_NAME, CRAWL_DIR, CRAWL_RC)."); puts(""); puts("Highscore list options: (Can now be redirected to more, etc)"); puts(" -scores [N] highscore list"); diff --git a/crawl-ref/source/externs.h b/crawl-ref/source/externs.h index cd33b5565b..4b70506ba3 100644 --- a/crawl-ref/source/externs.h +++ b/crawl-ref/source/externs.h @@ -2022,6 +2022,8 @@ public: int num_colours; // used for setting up curses colour table (8 or 16) + std::string pizza; + #ifdef WIZARD int wiz_mode; // yes, no, never in wiz mode to start #endif diff --git a/crawl-ref/source/food.cc b/crawl-ref/source/food.cc index adaffcb250..10ad22a7e7 100644 --- a/crawl-ref/source/food.cc +++ b/crawl-ref/source/food.cc @@ -2097,8 +2097,8 @@ void finished_eating_message(int food_type) restore_stat(STAT_ALL, 0, false); break; case FOOD_PIZZA: - if (!SysEnv.crawl_pizza.empty() && !one_chance_in(3)) - mprf("Mmm... %s.", SysEnv.crawl_pizza.c_str()); + if (!Options.pizza.empty() && !one_chance_in(3)) + mprf("Mmm... %s.", Options.pizza.c_str()); else { int temp_rand; diff --git a/crawl-ref/source/initfile.cc b/crawl-ref/source/initfile.cc index 671264c652..d4d5f1d25f 100644 --- a/crawl-ref/source/initfile.cc +++ b/crawl-ref/source/initfile.cc @@ -855,7 +855,9 @@ void game_options::reset_options() false); item_stack_summary_minimum = 5; - + + pizza.clear(); + #ifdef WIZARD fsim_rounds = 40000L; fsim_mons = "worm"; @@ -2291,6 +2293,11 @@ void game_options::read_option_line(const std::string &str, bool runscript) { set_fire_order(field, plus_equal); } + else if (key == "pizza") + { + // field is already cleaned up from trim_string() + pizza = field; + } BOOL_OPTION(random_pick); else BOOL_OPTION(good_random); @@ -3313,9 +3320,6 @@ void get_system_environment(void) // The player's name SysEnv.crawl_name = check_string( getenv("CRAWL_NAME") ); - // The player's pizza - SysEnv.crawl_pizza = check_string( getenv("CRAWL_PIZZA") ); - // The directory which contians init.txt, macro.txt, morgue.txt // This should end with the appropriate path delimiter. SysEnv.crawl_dir = check_string( getenv("CRAWL_DIR") ); @@ -3359,7 +3363,6 @@ enum commandline_option_type { CLO_NAME, CLO_RACE, CLO_CLASS, - CLO_PIZZA, CLO_PLAIN, CLO_DIR, CLO_RC, @@ -3376,7 +3379,7 @@ enum commandline_option_type { }; static const char *cmd_ops[] = { - "scores", "name", "race", "class", "pizza", "plain", "dir", "rc", + "scores", "name", "race", "class", "plain", "dir", "rc", "rcdir", "tscores", "vscores", "scorefile", "morgue", "macro", "mapstat", "arena" }; @@ -3569,16 +3572,6 @@ bool parse_args( int argc, char **argv, bool rc_only ) nextUsed = true; break; - case CLO_PIZZA: - if (!next_is_param) - return (false); - - if (!rc_only) - SysEnv.crawl_pizza = next_arg; - - nextUsed = true; - break; - case CLO_PLAIN: if (next_is_param) return (false); diff --git a/crawl-ref/source/initfile.h b/crawl-ref/source/initfile.h index 471eba7387..1d7d40f2ff 100644 --- a/crawl-ref/source/initfile.h +++ b/crawl-ref/source/initfile.h @@ -51,7 +51,6 @@ struct system_environment { public: std::string crawl_name; - std::string crawl_pizza; std::string crawl_rc; std::string crawl_dir; -- cgit v1.2.3-54-g00ecf