From 1230cf49bf63cebe82e355e517ae58205afb9c31 Mon Sep 17 00:00:00 2001 From: MiroslavR Date: Sat, 7 Feb 2015 18:38:41 +0100 Subject: [PATCH] Properly center jail progress widget, fix a bug with it not disappearing if the console is open --- apps/openmw/mwgui/jailscreen.cpp | 11 ++--------- apps/openmw/mwgui/jailscreen.hpp | 2 -- files/mygui/CMakeLists.txt | 1 + files/mygui/openmw_jail_screen.layout | 15 +++++++++++++++ 4 files changed, 18 insertions(+), 11 deletions(-) create mode 100644 files/mygui/openmw_jail_screen.layout diff --git a/apps/openmw/mwgui/jailscreen.cpp b/apps/openmw/mwgui/jailscreen.cpp index 0155ee5ff..548b1b604 100644 --- a/apps/openmw/mwgui/jailscreen.cpp +++ b/apps/openmw/mwgui/jailscreen.cpp @@ -1,7 +1,4 @@ -#include #include -#include -#include #include "../mwbase/windowmanager.hpp" #include "../mwbase/mechanicsmanager.hpp" @@ -19,22 +16,18 @@ namespace MWGui { JailScreen::JailScreen() - : WindowBase("openmw_loading_screen.layout"), + : WindowBase("openmw_jail_screen.layout"), mTimeAdvancer(0.0125), mDays(1), mFadeTimeRemaining(0) { - getWidget(mLoadingText, "LoadingText"); getWidget(mProgressBar, "ProgressBar"); - getWidget(mLoadingBox, "LoadingBox"); setVisible(false); mTimeAdvancer.eventProgressChanged += MyGUI::newDelegate(this, &JailScreen::onJailProgressChanged); mTimeAdvancer.eventFinished += MyGUI::newDelegate(this, &JailScreen::onJailFinished); - mLoadingText->setCaptionWithReplacing("#{sInPrisonTitle}"); - center(); } @@ -78,7 +71,7 @@ namespace MWGui void JailScreen::onJailFinished() { - MWBase::Environment::get().getWindowManager()->popGuiMode(); + MWBase::Environment::get().getWindowManager()->removeGuiMode(MWGui::GM_Jail); MWBase::Environment::get().getWindowManager()->fadeScreenIn(0.5); MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr(); diff --git a/apps/openmw/mwgui/jailscreen.hpp b/apps/openmw/mwgui/jailscreen.hpp index 06e9a3aa0..7a544126d 100644 --- a/apps/openmw/mwgui/jailscreen.hpp +++ b/apps/openmw/mwgui/jailscreen.hpp @@ -19,8 +19,6 @@ namespace MWGui float mFadeTimeRemaining; - MyGUI::Widget* mLoadingBox; - MyGUI::TextBox* mLoadingText; MyGUI::ScrollBar* mProgressBar; void onJailProgressChanged(int cur, int total); diff --git a/files/mygui/CMakeLists.txt b/files/mygui/CMakeLists.txt index 638266b0c..13d1a9e1a 100644 --- a/files/mygui/CMakeLists.txt +++ b/files/mygui/CMakeLists.txt @@ -86,6 +86,7 @@ set(MYGUI_FILES openmw_edit_note.layout openmw_debug_window.layout openmw_debug_window.skin.xml + openmw_jail_screen.layout DejaVuLGCSansMono.ttf ../launcher/images/openmw.png OpenMWResourcePlugin.xml diff --git a/files/mygui/openmw_jail_screen.layout b/files/mygui/openmw_jail_screen.layout new file mode 100644 index 000000000..4385494e1 --- /dev/null +++ b/files/mygui/openmw_jail_screen.layout @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + +