forked from mirror/openmw-tes3mp
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
4 changed files with 18 additions and 11 deletions
|
@ -1,7 +1,4 @@
|
||||||
#include <MyGUI_RenderManager.h>
|
|
||||||
#include <MyGUI_ScrollBar.h>
|
#include <MyGUI_ScrollBar.h>
|
||||||
#include <MyGUI_Gui.h>
|
|
||||||
#include <MyGUI_TextBox.h>
|
|
||||||
|
|
||||||
#include "../mwbase/windowmanager.hpp"
|
#include "../mwbase/windowmanager.hpp"
|
||||||
#include "../mwbase/mechanicsmanager.hpp"
|
#include "../mwbase/mechanicsmanager.hpp"
|
||||||
|
@ -19,22 +16,18 @@
|
||||||
namespace MWGui
|
namespace MWGui
|
||||||
{
|
{
|
||||||
JailScreen::JailScreen()
|
JailScreen::JailScreen()
|
||||||
: WindowBase("openmw_loading_screen.layout"),
|
: WindowBase("openmw_jail_screen.layout"),
|
||||||
mTimeAdvancer(0.0125),
|
mTimeAdvancer(0.0125),
|
||||||
mDays(1),
|
mDays(1),
|
||||||
mFadeTimeRemaining(0)
|
mFadeTimeRemaining(0)
|
||||||
{
|
{
|
||||||
getWidget(mLoadingText, "LoadingText");
|
|
||||||
getWidget(mProgressBar, "ProgressBar");
|
getWidget(mProgressBar, "ProgressBar");
|
||||||
getWidget(mLoadingBox, "LoadingBox");
|
|
||||||
|
|
||||||
setVisible(false);
|
setVisible(false);
|
||||||
|
|
||||||
mTimeAdvancer.eventProgressChanged += MyGUI::newDelegate(this, &JailScreen::onJailProgressChanged);
|
mTimeAdvancer.eventProgressChanged += MyGUI::newDelegate(this, &JailScreen::onJailProgressChanged);
|
||||||
mTimeAdvancer.eventFinished += MyGUI::newDelegate(this, &JailScreen::onJailFinished);
|
mTimeAdvancer.eventFinished += MyGUI::newDelegate(this, &JailScreen::onJailFinished);
|
||||||
|
|
||||||
mLoadingText->setCaptionWithReplacing("#{sInPrisonTitle}");
|
|
||||||
|
|
||||||
center();
|
center();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -78,7 +71,7 @@ namespace MWGui
|
||||||
|
|
||||||
void JailScreen::onJailFinished()
|
void JailScreen::onJailFinished()
|
||||||
{
|
{
|
||||||
MWBase::Environment::get().getWindowManager()->popGuiMode();
|
MWBase::Environment::get().getWindowManager()->removeGuiMode(MWGui::GM_Jail);
|
||||||
MWBase::Environment::get().getWindowManager()->fadeScreenIn(0.5);
|
MWBase::Environment::get().getWindowManager()->fadeScreenIn(0.5);
|
||||||
|
|
||||||
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
||||||
|
|
|
@ -19,8 +19,6 @@ namespace MWGui
|
||||||
|
|
||||||
float mFadeTimeRemaining;
|
float mFadeTimeRemaining;
|
||||||
|
|
||||||
MyGUI::Widget* mLoadingBox;
|
|
||||||
MyGUI::TextBox* mLoadingText;
|
|
||||||
MyGUI::ScrollBar* mProgressBar;
|
MyGUI::ScrollBar* mProgressBar;
|
||||||
|
|
||||||
void onJailProgressChanged(int cur, int total);
|
void onJailProgressChanged(int cur, int total);
|
||||||
|
|
|
@ -86,6 +86,7 @@ set(MYGUI_FILES
|
||||||
openmw_edit_note.layout
|
openmw_edit_note.layout
|
||||||
openmw_debug_window.layout
|
openmw_debug_window.layout
|
||||||
openmw_debug_window.skin.xml
|
openmw_debug_window.skin.xml
|
||||||
|
openmw_jail_screen.layout
|
||||||
DejaVuLGCSansMono.ttf
|
DejaVuLGCSansMono.ttf
|
||||||
../launcher/images/openmw.png
|
../launcher/images/openmw.png
|
||||||
OpenMWResourcePlugin.xml
|
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…
Reference in a new issue