14 std::vector<std::string> message_lines = Utils::String::split(message,
'\n');
17 int message_width = 0;
18 int message_height = 0;
20 message_height = message_lines.size();
22 for (
size_t i = 0; i < message_lines.size(); i++)
23 message_width = std::max(message_width, (
int)message_lines[i].size());
29 int window_width = message_width + 2;
30 int window_height = message_height + 2;
32 Window dialog(window_x, window_y, window_width, window_height);
34 if (Globals::Screen::show_borders)
36 dialog.borders(Globals::Screen::fancy_borders ?
37 Window::BORDER_FANCY :
38 Window::BORDER_REGULAR);
47 for (
size_t i = 0; i < message_lines.size(); i++)
48 dialog.
print(message_lines[i], 1, i + 1);
65 question.size() + 2 + 10,
68 if (Globals::Screen::show_borders)
70 dialog.borders(Globals::Screen::fancy_borders ?
71 Window::BORDER_FANCY :
72 Window::BORDER_REGULAR);
79 Menu menu(1, 2, question.size() + 10, 2);
81 std::vector<std::string> options;
82 options.push_back(
"Yes");
83 options.push_back(
"No");
104 InputManager::update(-1);
106 if (InputManager::isPressed(
"quit"))
111 if (InputManager::isPressed(
'\n') ||
112 InputManager::isPressed(KEY_ENTER))
115 return (str ==
"Yes");
void print(std::string str, int x, int y, ColorPair pair=0)
Shows text #str at x y on the window with color #pair.
bool askBool(std::string question, std::string title="", bool default_value=false)
Spawns a Dialog box asking for a yes-or-no #question.