2012-09-11 16:37:54 +02:00
|
|
|
#ifndef MWGUI_LOADINGSCREEN_H
|
|
|
|
#define MWGUI_LOADINGSCREEN_H
|
|
|
|
|
2014-02-19 18:40:29 +01:00
|
|
|
#include <OgreTimer.h>
|
2015-01-10 03:56:06 +01:00
|
|
|
#include <OgreStringVector.h>
|
2012-09-11 16:37:54 +02:00
|
|
|
|
2013-04-10 00:32:05 -04:00
|
|
|
#include "windowbase.hpp"
|
2012-09-11 16:37:54 +02:00
|
|
|
|
2013-08-27 15:48:13 +02:00
|
|
|
#include <components/loadinglistener/loadinglistener.hpp>
|
|
|
|
|
2015-01-10 03:56:06 +01:00
|
|
|
namespace Ogre
|
|
|
|
{
|
|
|
|
class SceneManager;
|
|
|
|
}
|
|
|
|
|
2012-09-11 16:37:54 +02:00
|
|
|
namespace MWGui
|
|
|
|
{
|
2014-03-30 23:04:12 +02:00
|
|
|
class BackgroundImage;
|
|
|
|
|
2013-08-27 15:48:13 +02:00
|
|
|
class LoadingScreen : public WindowBase, public Loading::Listener
|
2012-09-11 16:37:54 +02:00
|
|
|
{
|
|
|
|
public:
|
2013-08-27 15:48:13 +02:00
|
|
|
virtual void setLabel (const std::string& label);
|
|
|
|
|
|
|
|
/// Indicate that some progress has been made, without specifying how much
|
|
|
|
virtual void indicateProgress ();
|
|
|
|
|
|
|
|
virtual void loadingOn();
|
|
|
|
virtual void loadingOff();
|
|
|
|
|
|
|
|
virtual void setProgressRange (size_t range);
|
|
|
|
virtual void setProgress (size_t value);
|
2014-04-28 11:29:57 +02:00
|
|
|
virtual void increaseProgress (size_t increase=1);
|
2013-08-27 15:48:13 +02:00
|
|
|
|
2014-03-30 23:04:12 +02:00
|
|
|
virtual void setVisible(bool visible);
|
|
|
|
|
2013-04-10 14:46:21 -04:00
|
|
|
LoadingScreen(Ogre::SceneManager* sceneMgr, Ogre::RenderWindow* rw);
|
2012-09-11 16:37:54 +02:00
|
|
|
virtual ~LoadingScreen();
|
|
|
|
|
|
|
|
void setLoadingProgress (const std::string& stage, int depth, int current, int total);
|
2012-09-13 00:21:58 +02:00
|
|
|
void loadingDone();
|
2012-09-11 16:37:54 +02:00
|
|
|
|
2013-02-05 20:48:25 +01:00
|
|
|
void updateWindow(Ogre::RenderWindow* rw) { mWindow = rw; }
|
|
|
|
|
2012-09-11 16:37:54 +02:00
|
|
|
private:
|
|
|
|
Ogre::SceneManager* mSceneMgr;
|
|
|
|
Ogre::RenderWindow* mWindow;
|
|
|
|
|
2012-09-13 12:33:09 +02:00
|
|
|
unsigned long mLastWallpaperChangeTime;
|
2012-09-11 16:37:54 +02:00
|
|
|
unsigned long mLastRenderTime;
|
|
|
|
Ogre::Timer mTimer;
|
|
|
|
|
2013-08-27 15:48:13 +02:00
|
|
|
size_t mProgress;
|
|
|
|
|
2014-12-20 00:04:24 +01:00
|
|
|
MyGUI::Widget* mLoadingBox;
|
|
|
|
|
2012-09-11 16:37:54 +02:00
|
|
|
MyGUI::TextBox* mLoadingText;
|
2013-08-27 15:48:13 +02:00
|
|
|
MyGUI::ScrollBar* mProgressBar;
|
2014-03-30 23:04:12 +02:00
|
|
|
BackgroundImage* mBackgroundImage;
|
2012-09-11 19:18:26 +02:00
|
|
|
|
2013-04-03 12:24:13 +02:00
|
|
|
Ogre::StringVector mResources;
|
2012-09-11 16:37:54 +02:00
|
|
|
|
2013-10-13 17:52:14 +02:00
|
|
|
bool mVSyncWasEnabled;
|
|
|
|
|
2012-09-13 12:33:09 +02:00
|
|
|
void changeWallpaper();
|
2013-08-27 15:48:13 +02:00
|
|
|
|
|
|
|
void draw();
|
2012-09-11 16:37:54 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|