From edadcb338cab94d1ef9c1266147abc1152b8a26d Mon Sep 17 00:00:00 2001 From: Andrei Kortunov Date: Mon, 27 Mar 2017 23:10:57 +0400 Subject: [PATCH 1/4] Savegame dialog improvements --- apps/openmw/mwgui/savegamedialog.cpp | 15 +++++++ files/mygui/openmw_button.skin.xml | 2 +- files/mygui/openmw_confirmation_dialog.layout | 2 +- files/mygui/openmw_savegame_dialog.layout | 2 +- files/mygui/openmw_windows.skin.xml | 41 ++++++++++++++++++- 5 files changed, 58 insertions(+), 4 deletions(-) diff --git a/apps/openmw/mwgui/savegamedialog.cpp b/apps/openmw/mwgui/savegamedialog.cpp index f93d1cc0a..cbc95e808 100644 --- a/apps/openmw/mwgui/savegamedialog.cpp +++ b/apps/openmw/mwgui/savegamedialog.cpp @@ -253,6 +253,21 @@ namespace MWGui return; } } + else + { + MWBase::StateManager::State state = MWBase::Environment::get().getStateManager()->getState(); + + // If game is running, ask for confirmation first + if (state == MWBase::StateManager::State_Running && !reallySure) + { + ConfirmationDialog* dialog = MWBase::Environment::get().getWindowManager()->getConfirmationDialog(); + dialog->askForConfirmation("#{sMessage1}"); + dialog->eventOkClicked.clear(); + dialog->eventOkClicked += MyGUI::newDelegate(this, &SaveGameDialog::onConfirmationGiven); + dialog->eventCancelClicked.clear(); + return; + } + } setVisible(false); MWBase::Environment::get().getWindowManager()->removeGuiMode (MWGui::GM_MainMenu); diff --git a/files/mygui/openmw_button.skin.xml b/files/mygui/openmw_button.skin.xml index 09a4c0e39..5aee8de7a 100644 --- a/files/mygui/openmw_button.skin.xml +++ b/files/mygui/openmw_button.skin.xml @@ -111,7 +111,7 @@ - + diff --git a/files/mygui/openmw_confirmation_dialog.layout b/files/mygui/openmw_confirmation_dialog.layout index fbf779cd1..2d533135a 100644 --- a/files/mygui/openmw_confirmation_dialog.layout +++ b/files/mygui/openmw_confirmation_dialog.layout @@ -1,7 +1,7 @@ - + diff --git a/files/mygui/openmw_savegame_dialog.layout b/files/mygui/openmw_savegame_dialog.layout index ca11b65f8..f18218430 100644 --- a/files/mygui/openmw_savegame_dialog.layout +++ b/files/mygui/openmw_savegame_dialog.layout @@ -1,7 +1,7 @@ - + diff --git a/files/mygui/openmw_windows.skin.xml b/files/mygui/openmw_windows.skin.xml index 423de14aa..00e6f9148 100644 --- a/files/mygui/openmw_windows.skin.xml +++ b/files/mygui/openmw_windows.skin.xml @@ -1,7 +1,7 @@ - + @@ -9,6 +9,14 @@ + + + + + + + + @@ -883,4 +891,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From e5a0f899346658eacaa330ceb5efec9b3772634a Mon Sep 17 00:00:00 2001 From: Andrei Kortunov Date: Tue, 28 Mar 2017 12:49:23 +0400 Subject: [PATCH 2/4] List scroll fix --- files/mygui/openmw_count_window.layout | 14 +++++++------- files/mygui/openmw_list.skin.xml | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/files/mygui/openmw_count_window.layout b/files/mygui/openmw_count_window.layout index 891f9f00c..e8d1afee9 100644 --- a/files/mygui/openmw_count_window.layout +++ b/files/mygui/openmw_count_window.layout @@ -1,29 +1,29 @@  - + - - + + - + - + - + - + diff --git a/files/mygui/openmw_list.skin.xml b/files/mygui/openmw_list.skin.xml index 9f5b2e94d..111d3bf30 100644 --- a/files/mygui/openmw_list.skin.xml +++ b/files/mygui/openmw_list.skin.xml @@ -131,9 +131,9 @@ - + - + From df5a43363a23a80a1a05ec6ffa0e7c089073357b Mon Sep 17 00:00:00 2001 From: Andrei Kortunov Date: Thu, 30 Mar 2017 17:05:56 +0400 Subject: [PATCH 3/4] Confirmation dialogs size fix --- apps/openmw/mwgui/confirmationdialog.cpp | 17 ++++++++++++----- apps/openmw/mwgui/confirmationdialog.hpp | 3 ++- files/mygui/openmw_confirmation_dialog.layout | 10 +++++----- 3 files changed, 19 insertions(+), 11 deletions(-) diff --git a/apps/openmw/mwgui/confirmationdialog.cpp b/apps/openmw/mwgui/confirmationdialog.cpp index e4312914f..33f8dbe3e 100644 --- a/apps/openmw/mwgui/confirmationdialog.cpp +++ b/apps/openmw/mwgui/confirmationdialog.cpp @@ -17,19 +17,26 @@ namespace MWGui } void ConfirmationDialog::askForConfirmation(const std::string& message, const std::string& confirmMessage, const std::string& cancelMessage) + { + mCancelButton->setCaptionWithReplacing(cancelMessage); + mOkButton->setCaptionWithReplacing(confirmMessage); + + askForConfirmation(message); + } + + void ConfirmationDialog::askForConfirmation(const std::string& message) { setVisible(true); mMessage->setCaptionWithReplacing(message); - mCancelButton->setCaptionWithReplacing(cancelMessage); - mOkButton->setCaptionWithReplacing(confirmMessage); + int height = mMessage->getTextSize().height + 60; - int height = mMessage->getTextSize().height + 72; + int width = mMessage->getTextSize().width + 24; - mMainWidget->setSize(mMainWidget->getWidth(), height); + mMainWidget->setSize(width, height); - mMessage->setSize(mMessage->getWidth(), mMessage->getTextSize().height+24); + mMessage->setSize(mMessage->getWidth(), mMessage->getTextSize().height + 24); center(); } diff --git a/apps/openmw/mwgui/confirmationdialog.hpp b/apps/openmw/mwgui/confirmationdialog.hpp index 14caa7748..745c7a1a5 100644 --- a/apps/openmw/mwgui/confirmationdialog.hpp +++ b/apps/openmw/mwgui/confirmationdialog.hpp @@ -9,7 +9,8 @@ namespace MWGui { public: ConfirmationDialog(); - void askForConfirmation(const std::string& message, const std::string& confirmMessage="#{sOk}", const std::string& cancelMessage="#{sCancel}"); + void askForConfirmation(const std::string& message); + void askForConfirmation(const std::string& message, const std::string& confirmMessage, const std::string& cancelMessage); virtual void exit(); typedef MyGUI::delegates::CMultiDelegate0 EventHandle_Void; diff --git a/files/mygui/openmw_confirmation_dialog.layout b/files/mygui/openmw_confirmation_dialog.layout index 2d533135a..39e77cb93 100644 --- a/files/mygui/openmw_confirmation_dialog.layout +++ b/files/mygui/openmw_confirmation_dialog.layout @@ -1,10 +1,10 @@ - + - + @@ -12,14 +12,14 @@ - + - + - + From 1fe3a3efe46b39737e423c79d37f0d3c25dffca0 Mon Sep 17 00:00:00 2001 From: Andrei Kortunov Date: Wed, 12 Apr 2017 19:15:22 +0400 Subject: [PATCH 4/4] Count dialog layout changes --- files/mygui/openmw_count_window.layout | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/files/mygui/openmw_count_window.layout b/files/mygui/openmw_count_window.layout index e8d1afee9..a3234c405 100644 --- a/files/mygui/openmw_count_window.layout +++ b/files/mygui/openmw_count_window.layout @@ -2,28 +2,25 @@ - + - + - + - - - - - + + - +