summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/state.cc
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-11-20 12:19:31 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-11-20 12:19:31 +0000
commit9ff31d52f2dad36c684c3458c35f0666a0fb28e4 (patch)
treed74cb4ba9591eb4e904d7940c6405d6cc8321fd9 /crawl-ref/source/state.cc
parent1c9f524503622db5774b18a6fca37b71739a5946 (diff)
downloadcrawl-ref-9ff31d52f2dad36c684c3458c35f0666a0fb28e4.tar.gz
crawl-ref-9ff31d52f2dad36c684c3458c35f0666a0fb28e4.zip
Fall back to ASCII if Unicode locale is unavailable (Guus). Also queue up startup error messages and display them before the newgame screen instead of emitting them to stderr.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2882 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/state.cc')
-rw-r--r--crawl-ref/source/state.cc22
1 files changed, 22 insertions, 0 deletions
diff --git a/crawl-ref/source/state.cc b/crawl-ref/source/state.cc
index ea89679f12..1d86dc1862 100644
--- a/crawl-ref/source/state.cc
+++ b/crawl-ref/source/state.cc
@@ -40,6 +40,28 @@ game_state::game_state()
reset_cmd_again();
}
+void game_state::add_startup_error(const std::string &err)
+{
+ startup_errors.push_back(err);
+}
+
+void game_state::show_startup_errors()
+{
+ formatted_scroller error_menu;
+ error_menu.set_flags(MF_NOSELECT | MF_ALWAYS_SHOW_MORE | MF_NOWRAP
+ | MF_EASY_EXIT);
+ error_menu.set_more(
+ formatted_string::parse_string(
+ "<cyan>[ + : Page down. - : Page up."
+ " Esc or Enter to continue.]"));
+ error_menu.set_title(
+ new MenuEntry("Warning: Crawl encountered errors during startup:",
+ MEL_TITLE));
+ for (int i = 0, size = startup_errors.size(); i < size; ++i)
+ error_menu.add_entry(new MenuEntry(startup_errors[i]));
+ error_menu.show();
+}
+
///////////////////////////////////////////////////////////////////////////
// Repeating commands and doing the previous command over again.