From f4fe0980660963ebfd05d86ca9c6b7df0e03940a Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Wed, 1 Jul 2009 23:28:27 +0000 Subject: 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 --- crawl-ref/source/newgame.cc | 45 ++++++++++++++++++++++++--------------------- 1 file changed, 24 insertions(+), 21 deletions(-) (limited to 'crawl-ref/source/newgame.cc') 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 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 " - "Ctrl-T 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 " + "Ctrl-T 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(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(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); + } } } -- cgit v1.2.3-54-g00ecf