diff options
author | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2006-12-03 08:49:53 +0000 |
---|---|---|
committer | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2006-12-03 08:49:53 +0000 |
commit | f5b7f9f83ba80c0e512b886fca3821290a949f79 (patch) | |
tree | c9f0604369bcb6b7dcccf4d1edc394fd7f0b0af9 /crawl-ref/source/initfile.cc | |
parent | 00033a21e5e9bce12e82e37cbfccd78a58cd8b4e (diff) | |
download | crawl-ref-f5b7f9f83ba80c0e512b886fca3821290a949f79.tar.gz crawl-ref-f5b7f9f83ba80c0e512b886fca3821290a949f79.zip |
Added hp_colour and mp_colour per 1606160. Removed hp_attention.
hp_warning is still there for the * * * LOW HITPOINT WARNING * * * message.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@543 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/initfile.cc')
-rw-r--r-- | crawl-ref/source/initfile.cc | 77 |
1 files changed, 60 insertions, 17 deletions
diff --git a/crawl-ref/source/initfile.cc b/crawl-ref/source/initfile.cc index e340d4c83c..ee6dc4fcd5 100644 --- a/crawl-ref/source/initfile.cc +++ b/crawl-ref/source/initfile.cc @@ -569,7 +569,6 @@ void game_options::reset_options() easy_confirm = CONFIRM_SAFE_EASY; easy_quit_item_prompts = true; hp_warning = 10; - hp_attention = 25; confirm_self_target = true; safe_autopickup = true; use_notes = true; @@ -706,6 +705,14 @@ void game_options::reset_options() "spells,,overview,mutations,messages,screenshot," "kills,notes"); + hp_colour.clear(); + hp_colour.push_back(std::pair<int,int>(100, LIGHTGREY)); + hp_colour.push_back(std::pair<int,int>(50, YELLOW)); + hp_colour.push_back(std::pair<int,int>(25, RED)); + mp_colour.clear(); + mp_colour.push_back(std::pair<int, int>(100, LIGHTGREY)); + mp_colour.push_back(std::pair<int, int>(50, YELLOW)); + mp_colour.push_back(std::pair<int, int>(25, RED)); banned_objects.clear(); note_monsters.clear(); note_messages.clear(); @@ -1630,16 +1637,6 @@ void game_options::read_option_line(const std::string &str, bool runscript) field.c_str() ); } } - else if (key == "hp_attention") - { - hp_attention = atoi( field.c_str() ); - if (hp_attention < 0 || hp_attention > 100) - { - hp_attention = 0; - fprintf( stderr, "Bad HP attention percentage -- %s\n", - field.c_str() ); - } - } else if (key == "crawl_dir") { // We shouldn't bother to allocate this a second time @@ -1755,8 +1752,7 @@ void game_options::read_option_line(const std::string &str, bool runscript) } else if (key == "autoinscribe") { - std::vector<std::string> thesplit = - split_string(":", field); + std::vector<std::string> thesplit = split_string(":", field); autoinscriptions.push_back( std::pair<text_pattern,std::string>(thesplit[0], thesplit[1])); @@ -1765,15 +1761,62 @@ void game_options::read_option_line(const std::string &str, bool runscript) { map_file_name = field; } + else if (key == "hp_colour" || key == "hp_color") + { + hp_colour.clear(); + std::vector<std::string> thesplit = split_string(",", field); + for ( unsigned i = 0; i < thesplit.size(); ++i ) + { + std::vector<std::string> insplit = split_string(":", thesplit[i]); + int hp_percent = 100; + + if ( insplit.size() == 0 || insplit.size() > 2 || + (insplit.size() == 1 && i != 0) ) + { + fprintf(stderr, "Bad hp_colour string: %s\n", field.c_str()); + break; + } + + if ( insplit.size() == 2 ) + hp_percent = atoi(insplit[0].c_str()); + + int scolour = str_to_colour(insplit[(insplit.size()==1) ? 0 : 1]); + hp_colour.push_back(std::pair<int, int>(hp_percent, scolour)); + } + } + else if (key == "mp_color" || key == "mp_colour") + { + mp_colour.clear(); + std::vector<std::string> thesplit = split_string(",", field); + for ( unsigned i = 0; i < thesplit.size(); ++i ) + { + std::vector<std::string> insplit = split_string(":", thesplit[i]); + int mp_percent = 100; + + if ( insplit.size() == 0 || insplit.size() > 2 || + (insplit.size() == 1 && i != 0) ) + { + fprintf(stderr, "Bad mp_colour string: %s\n", field.c_str()); + break; + } + + if ( insplit.size() == 2 ) + mp_percent = atoi(insplit[0].c_str()); + + int scolour = str_to_colour(insplit[(insplit.size()==1) ? 0 : 1]); + mp_colour.push_back(std::pair<int, int>(mp_percent, scolour)); + } + } else if (key == "note_skill_levels") { std::vector<std::string> thesplit = split_string(",", field); - for ( unsigned i = 0; i < thesplit.size(); ++i ) { + for ( unsigned i = 0; i < thesplit.size(); ++i ) + { int num = atoi(thesplit[i].c_str()); - if ( num > 0 && num <= 27 ) { + if ( num > 0 && num <= 27 ) note_skill_levels.push_back(num); - } - else { + else + { fprintf(stderr, "Bad skill level to note -- %s\n", thesplit[i].c_str()); continue; |