From 97d79a827ef4978df15fa117e013817dbcde1d09 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sun, 14 Oct 2012 10:08:50 +0000 Subject: Added protection against duplicate dialog definitions, made the dialog window smaller. --- src/client/dialog.cc | 2 +- src/client/mainmenu.cc | 3 ++- src/client/mainwindow.cc | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) (limited to 'src/client') diff --git a/src/client/dialog.cc b/src/client/dialog.cc index f113433..b593388 100644 --- a/src/client/dialog.cc +++ b/src/client/dialog.cc @@ -54,7 +54,7 @@ void Dialog::resize() dialog_widget->set_size( ui::UI::elementsize.width() * 3.0f, - ui::UI::elementsize.width() * 2.0f + ui::UI::elementsize.width() * 1.5f ); dialog_widget->set_location( (width() - dialog_widget->width()) * 0.5f, diff --git a/src/client/mainmenu.cc b/src/client/mainmenu.cc index 7271bcf..7374224 100644 --- a/src/client/mainmenu.cc +++ b/src/client/mainmenu.cc @@ -116,9 +116,10 @@ void MainMenu::load_definitions() if (ini.got_key_label("label", strval)) { dialog = new Dialog(this); dialog->set_label(strval); + } else { + ini.unknown_error("dialog definition requires label first"); } } else { - if (ini.got_key_label("label", strval)) { dialog->set_label(strval); diff --git a/src/client/mainwindow.cc b/src/client/mainwindow.cc index 2f3f66a..1d9f4ff 100644 --- a/src/client/mainwindow.cc +++ b/src/client/mainwindow.cc @@ -125,6 +125,7 @@ void MainWindow::draw() mainwindow_mainmenu->show(); } else if (core::localcontrol()->state() == core::Entity::Destroyed) { + mainwindow_gamewindow->hide(); mainwindow_mainmenu->show_menu("respawn"); } else if (mainwindow_gamewindow->hidden()) { -- cgit v1.2.3