Fade screen out during loading screen (when travelling)

pull/303/head
scrawl 7 years ago
parent a4737d8417
commit 12510efab7

@ -50,6 +50,8 @@ namespace MWGui
mBackgroundImage = MyGUI::Gui::getInstance().createWidgetReal<BackgroundImage>("ImageBox", 0,0,1,1,
MyGUI::Align::Stretch, "Menu");
mSceneImage = MyGUI::Gui::getInstance().createWidgetReal<BackgroundImage>("ImageBox", 0,0,1,1,
MyGUI::Align::Stretch, "Scene");
findSplashScreens();
}
@ -110,6 +112,7 @@ namespace MWGui
{
WindowBase::setVisible(visible);
mBackgroundImage->setVisible(visible);
mSceneImage->setVisible(visible);
}
double LoadingScreen::getTargetFrameRate() const
@ -214,8 +217,11 @@ namespace MWGui
// TODO: add option (filename pattern?) to use image aspect ratio instead of 4:3
// we can't do this by default, because the Morrowind splash screens are 1024x1024, but should be displayed as 4:3
bool stretch = Settings::Manager::getBool("stretch menu background", "GUI");
mBackgroundImage->setVisible(true);
mBackgroundImage->setBackgroundImage(randomSplash, true, stretch);
}
mSceneImage->setBackgroundImage("");
mSceneImage->setVisible(false);
}
void LoadingScreen::setProgressRange (size_t range)
@ -292,9 +298,11 @@ namespace MWGui
mViewer->getCamera()->setInitialDrawCallback(new CopyFramebufferToTextureCallback(mTexture));
mBackgroundImage->setBackgroundImage("");
mBackgroundImage->setVisible(false);
mBackgroundImage->setRenderItemTexture(mGuiTexture.get());
mBackgroundImage->getSubWidgetMain()->_setUVSet(MyGUI::FloatRect(0.f, 0.f, 1.f, 1.f));
mSceneImage->setRenderItemTexture(mGuiTexture.get());
mSceneImage->getSubWidgetMain()->_setUVSet(MyGUI::FloatRect(0.f, 0.f, 1.f, 1.f));
mSceneImage->setVisible(true);
}
void LoadingScreen::draw()

@ -72,6 +72,7 @@ namespace MWGui
MyGUI::TextBox* mLoadingText;
MyGUI::ScrollBar* mProgressBar;
BackgroundImage* mBackgroundImage;
BackgroundImage* mSceneImage;
std::vector<std::string> mSplashScreens;

@ -178,6 +178,8 @@ namespace MWGui
MWBase::Environment::get().getWindowManager()->removeGuiMode(GM_Travel);
MWBase::Environment::get().getWindowManager()->exitCurrentGuiMode();
MWBase::Environment::get().getWindowManager()->fadeScreenOut(1);
// Teleports any followers, too.
MWWorld::ActionTeleport action(interior ? cellname : "", pos, true);
action.execute(player);

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<MyGUI type="Layer" version="1.0">
<Layer name="Scene" overlapped="false" pick="false"/>
<Layer name="Overlay" overlapped="false" pick="false"/>
<Layer name="AdditiveOverlay" type="AdditiveLayer" pick="false"/>
<Layer name="HUD" overlapped="false" pick="true"/>

Loading…
Cancel
Save