mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-20 15:40:32 +00:00
Properly center jail progress widget, fix a bug with it not disappearing if the console is open
This commit is contained in:
parent
1d9e973573
commit
1230cf49bf
@ -1,7 +1,4 @@
|
||||
#include <MyGUI_RenderManager.h>
|
||||
#include <MyGUI_ScrollBar.h>
|
||||
#include <MyGUI_Gui.h>
|
||||
#include <MyGUI_TextBox.h>
|
||||
|
||||
#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();
|
||||
|
@ -19,8 +19,6 @@ namespace MWGui
|
||||
|
||||
float mFadeTimeRemaining;
|
||||
|
||||
MyGUI::Widget* mLoadingBox;
|
||||
MyGUI::TextBox* mLoadingText;
|
||||
MyGUI::ScrollBar* mProgressBar;
|
||||
|
||||
void onJailProgressChanged(int cur, int total);
|
||||
|
@ -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
|
||||
|
15
files/mygui/openmw_jail_screen.layout
Normal file
15
files/mygui/openmw_jail_screen.layout
Normal file
@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<MyGUI type="Layout">
|
||||
<Widget type="Widget" skin="MW_Dialog" layer="LoadingScreen" position="0 0 300 48" name="_Main">
|
||||
|
||||
<Widget type="TextBox" skin="SandText" position="20 8 260 18" align="Stretch" name="LoadingText">
|
||||
<Property key="TextAlign" value="Center"/>
|
||||
<Property key="Caption" value="#{sInPrisonTitle}"/>
|
||||
</Widget>
|
||||
|
||||
<Widget type="ScrollBar" skin="MW_ProgressScroll_Loading" position="20 30 260 6" name="ProgressBar">
|
||||
</Widget>
|
||||
|
||||
</Widget>
|
||||
</MyGUI>
|
Loading…
x
Reference in New Issue
Block a user