mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-21 07:53:53 +00:00
Fade screen out during loading screen (when travelling)
This commit is contained in:
parent
a4737d8417
commit
12510efab7
4 changed files with 14 additions and 2 deletions
|
@ -50,6 +50,8 @@ namespace MWGui
|
||||||
|
|
||||||
mBackgroundImage = MyGUI::Gui::getInstance().createWidgetReal<BackgroundImage>("ImageBox", 0,0,1,1,
|
mBackgroundImage = MyGUI::Gui::getInstance().createWidgetReal<BackgroundImage>("ImageBox", 0,0,1,1,
|
||||||
MyGUI::Align::Stretch, "Menu");
|
MyGUI::Align::Stretch, "Menu");
|
||||||
|
mSceneImage = MyGUI::Gui::getInstance().createWidgetReal<BackgroundImage>("ImageBox", 0,0,1,1,
|
||||||
|
MyGUI::Align::Stretch, "Scene");
|
||||||
|
|
||||||
findSplashScreens();
|
findSplashScreens();
|
||||||
}
|
}
|
||||||
|
@ -110,6 +112,7 @@ namespace MWGui
|
||||||
{
|
{
|
||||||
WindowBase::setVisible(visible);
|
WindowBase::setVisible(visible);
|
||||||
mBackgroundImage->setVisible(visible);
|
mBackgroundImage->setVisible(visible);
|
||||||
|
mSceneImage->setVisible(visible);
|
||||||
}
|
}
|
||||||
|
|
||||||
double LoadingScreen::getTargetFrameRate() const
|
double LoadingScreen::getTargetFrameRate() const
|
||||||
|
@ -214,8 +217,11 @@ namespace MWGui
|
||||||
// TODO: add option (filename pattern?) to use image aspect ratio instead of 4:3
|
// 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
|
// 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");
|
bool stretch = Settings::Manager::getBool("stretch menu background", "GUI");
|
||||||
|
mBackgroundImage->setVisible(true);
|
||||||
mBackgroundImage->setBackgroundImage(randomSplash, true, stretch);
|
mBackgroundImage->setBackgroundImage(randomSplash, true, stretch);
|
||||||
}
|
}
|
||||||
|
mSceneImage->setBackgroundImage("");
|
||||||
|
mSceneImage->setVisible(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LoadingScreen::setProgressRange (size_t range)
|
void LoadingScreen::setProgressRange (size_t range)
|
||||||
|
@ -292,9 +298,11 @@ namespace MWGui
|
||||||
mViewer->getCamera()->setInitialDrawCallback(new CopyFramebufferToTextureCallback(mTexture));
|
mViewer->getCamera()->setInitialDrawCallback(new CopyFramebufferToTextureCallback(mTexture));
|
||||||
|
|
||||||
mBackgroundImage->setBackgroundImage("");
|
mBackgroundImage->setBackgroundImage("");
|
||||||
|
mBackgroundImage->setVisible(false);
|
||||||
|
|
||||||
mBackgroundImage->setRenderItemTexture(mGuiTexture.get());
|
mSceneImage->setRenderItemTexture(mGuiTexture.get());
|
||||||
mBackgroundImage->getSubWidgetMain()->_setUVSet(MyGUI::FloatRect(0.f, 0.f, 1.f, 1.f));
|
mSceneImage->getSubWidgetMain()->_setUVSet(MyGUI::FloatRect(0.f, 0.f, 1.f, 1.f));
|
||||||
|
mSceneImage->setVisible(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LoadingScreen::draw()
|
void LoadingScreen::draw()
|
||||||
|
|
|
@ -72,6 +72,7 @@ namespace MWGui
|
||||||
MyGUI::TextBox* mLoadingText;
|
MyGUI::TextBox* mLoadingText;
|
||||||
MyGUI::ScrollBar* mProgressBar;
|
MyGUI::ScrollBar* mProgressBar;
|
||||||
BackgroundImage* mBackgroundImage;
|
BackgroundImage* mBackgroundImage;
|
||||||
|
BackgroundImage* mSceneImage;
|
||||||
|
|
||||||
std::vector<std::string> mSplashScreens;
|
std::vector<std::string> mSplashScreens;
|
||||||
|
|
||||||
|
|
|
@ -178,6 +178,8 @@ namespace MWGui
|
||||||
MWBase::Environment::get().getWindowManager()->removeGuiMode(GM_Travel);
|
MWBase::Environment::get().getWindowManager()->removeGuiMode(GM_Travel);
|
||||||
MWBase::Environment::get().getWindowManager()->exitCurrentGuiMode();
|
MWBase::Environment::get().getWindowManager()->exitCurrentGuiMode();
|
||||||
|
|
||||||
|
MWBase::Environment::get().getWindowManager()->fadeScreenOut(1);
|
||||||
|
|
||||||
// Teleports any followers, too.
|
// Teleports any followers, too.
|
||||||
MWWorld::ActionTeleport action(interior ? cellname : "", pos, true);
|
MWWorld::ActionTeleport action(interior ? cellname : "", pos, true);
|
||||||
action.execute(player);
|
action.execute(player);
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
<MyGUI type="Layer" version="1.0">
|
<MyGUI type="Layer" version="1.0">
|
||||||
|
<Layer name="Scene" overlapped="false" pick="false"/>
|
||||||
<Layer name="Overlay" overlapped="false" pick="false"/>
|
<Layer name="Overlay" overlapped="false" pick="false"/>
|
||||||
<Layer name="AdditiveOverlay" type="AdditiveLayer" pick="false"/>
|
<Layer name="AdditiveOverlay" type="AdditiveLayer" pick="false"/>
|
||||||
<Layer name="HUD" overlapped="false" pick="true"/>
|
<Layer name="HUD" overlapped="false" pick="true"/>
|
||||||
|
|
Loading…
Reference in a new issue