diff options
author | Robert Vollmert <rvollmert@gmx.net> | 2010-04-29 14:47:27 +0200 |
---|---|---|
committer | Robert Vollmert <rvollmert@gmx.net> | 2010-04-29 15:45:13 +0200 |
commit | 4f676d67cc8934c2193ded57964e1233ec639ddf (patch) | |
tree | 882e1762ea74bc0f556a273bee7f131f45f6f2a0 /crawl-ref/source/sprint.cc | |
parent | 54cbe5ecbdeed63fc768f07024fd83eded70e85c (diff) | |
download | crawl-ref-4f676d67cc8934c2193ded57964e1233ec639ddf.tar.gz crawl-ref-4f676d67cc8934c2193ded57964e1233ec639ddf.zip |
Add a startup menu for sprint map choice.
The menu will show up once more than one sprint map exists.
Diffstat (limited to 'crawl-ref/source/sprint.cc')
-rw-r--r-- | crawl-ref/source/sprint.cc | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/crawl-ref/source/sprint.cc b/crawl-ref/source/sprint.cc index a238febe1e..b3832d161f 100644 --- a/crawl-ref/source/sprint.cc +++ b/crawl-ref/source/sprint.cc @@ -2,6 +2,7 @@ #include "externs.h" #include "items.h" +#include "maps.h" #include "mon-util.h" #include "mpr.h" #include "player.h" @@ -73,3 +74,30 @@ bool sprint_veto_random_abyss_monster(monster_type type) { return random2(20) > (int)get_monster_data(type)->hpdice[0]; } + +std::vector<std::string> get_sprint_maps() +{ + // TODO: provide descriptions? + std::vector<map_def> mapdefs = find_maps_for_tag("sprint"); + std::vector<std::string> maps; + for (unsigned int i = 0; i < mapdefs.size(); ++i) + maps.push_back(mapdefs[i].name); + return (maps); +} + +// We could save this in crawl_state instead. +// Or choose_game() could save *ng to crawl_state +// entirely, though that'd be redundant with +// you.your_name, you.species, crawl_state.type, ... + +static std::string _sprint_map; + +std::string get_sprint_map() +{ + return _sprint_map; +} + +void set_sprint_map(const std::string& map) +{ + _sprint_map = map; +} |