From 57b2c49d571ac160d03b9bc30b6eb72976bfe82a Mon Sep 17 00:00:00 2001 From: Magnus Auvinen Date: Mon, 15 Jun 2009 13:16:33 +0000 Subject: fixed so that the demo player doesn't crash when the map isn't found --- src/game/client/components/menus.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'src/game/client/components/menus.cpp') diff --git a/src/game/client/components/menus.cpp b/src/game/client/components/menus.cpp index 1748fe18..168c514d 100644 --- a/src/game/client/components/menus.cpp +++ b/src/game/client/components/menus.cpp @@ -666,6 +666,15 @@ void MENUS::on_init() config.cl_show_welcome = 0; } +void MENUS::popup_message(const char *topic, const char *body, const char *button) +{ + str_copy(message_topic, topic, sizeof(message_topic)); + str_copy(message_body, body, sizeof(message_body)); + str_copy(message_button, button, sizeof(message_button)); + popup = POPUP_MESSAGE; +} + + int MENUS::render() { RECT screen = *ui_screen(); @@ -749,7 +758,13 @@ int MENUS::render() const char *button_text = ""; int extra_align = 0; - if(popup == POPUP_CONNECTING) + if(popup == POPUP_MESSAGE) + { + title = message_topic; + extra_text = message_body; + button_text = message_button; + } + else if(popup == POPUP_CONNECTING) { title = localize("Connecting to"); extra_text = config.ui_server_address; // TODO: query the client about the address -- cgit 1.4.1