summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/newgame.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2009-07-01 23:28:27 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2009-07-01 23:28:27 +0000
commitf4fe0980660963ebfd05d86ca9c6b7df0e03940a (patch)
treecf14e0af215c2dd9343df6ae0fc95ddce2becb21 /crawl-ref/source/newgame.cc
parent995e35a5faf111223e24caeecc97c47cfe050e5a (diff)
downloadcrawl-ref-f4fe0980660963ebfd05d86ca9c6b7df0e03940a.tar.gz
crawl-ref-f4fe0980660963ebfd05d86ca9c6b7df0e03940a.zip
Add player icons (default species/job tile) to the selection menu for
saved games. Bugs/issues: * cannot handle more lines than fit the screen [*] * does not show actual equipment * probably should respect dolls.txt settings I guess the equipment problem could be solved by yet another per-character save file similar to dolls.txt, so newgame.cc could read directly from this rather than have to open the save to calculate equipment tiles or any such insanity. *) presumably because maxpagesize() assumes the entire screen is available for use by the menu git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@10083 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/newgame.cc')
-rw-r--r--crawl-ref/source/newgame.cc45
1 files changed, 24 insertions, 21 deletions
diff --git a/crawl-ref/source/newgame.cc b/crawl-ref/source/newgame.cc
index 54819b1257..3f28c38fe2 100644
--- a/crawl-ref/source/newgame.cc
+++ b/crawl-ref/source/newgame.cc
@@ -3230,7 +3230,7 @@ static void _enter_player_name(bool blankOK)
bool ask_name = true;
char *name = you.your_name;
std::vector<player_save_info> existing_chars;
- slider_menu char_menu;
+ slider_menu char_menu(MF_SINGLESELECT | MF_NOWRAP, false);
if (you.your_name[0] != 0)
ask_name = false;
@@ -3240,29 +3240,32 @@ static void _enter_player_name(bool blankOK)
existing_chars = find_saved_characters();
if (existing_chars.empty())
{
- cgotoxy(1,12);
- formatted_string::parse_string(
- " If you've never been here before, you might want to try out" EOL
- " the Dungeon Crawl tutorial. To do this, press "
- "<white>Ctrl-T</white> on the next" EOL
- " screen.").display();
+ cgotoxy(1,12);
+ formatted_string::parse_string(
+ " If you've never been here before, you might want to try out" EOL
+ " the Dungeon Crawl tutorial. To do this, press "
+ "<white>Ctrl-T</white> on the next" EOL
+ " screen.").display();
}
else
{
- MenuEntry *title = new MenuEntry("Or choose an existing character:");
- title->colour = LIGHTCYAN;
- char_menu.set_title( title );
- for (unsigned int i = 0; i < existing_chars.size(); ++i)
- {
- std::string desc = " " + existing_chars[i].short_desc();
- if (static_cast<int>(desc.length()) >= get_number_of_cols())
- desc = desc.substr(0, get_number_of_cols() - 1);
-
- MenuEntry *me = new MenuEntry(desc);
- me->data = &existing_chars[i];
- char_menu.add_entry(me);
- }
- char_menu.set_flags(MF_NOWRAP | MF_SINGLESELECT);
+ MenuEntry *title = new MenuEntry("Or choose an existing character:");
+ title->colour = LIGHTCYAN;
+ char_menu.set_title( title );
+ for (unsigned int i = 0; i < existing_chars.size(); ++i)
+ {
+ std::string desc = " " + existing_chars[i].short_desc();
+ if (static_cast<int>(desc.length()) >= get_number_of_cols())
+ desc = desc.substr(0, get_number_of_cols() - 1);
+
+#ifdef USE_TILE
+ MenuEntry *me = new PlayerMenuEntry(desc);
+#else
+ MenuEntry *me = new MenuEntry(desc);
+#endif
+ me->data = &existing_chars[i];
+ char_menu.add_entry(me);
+ }
}
}