-
Notifications
You must be signed in to change notification settings - Fork 121
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
64f1813
commit ea1060e
Showing
3 changed files
with
124 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
/* xoreos - A reimplementation of BioWare's Aurora engine | ||
* | ||
* xoreos is the legal property of its developers, whose names | ||
* can be found in the AUTHORS file distributed with this source | ||
* distribution. | ||
* | ||
* xoreos is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU General Public License | ||
* as published by the Free Software Foundation; either version 3 | ||
* of the License, or (at your option) any later version. | ||
* | ||
* xoreos is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with xoreos. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
/** @file | ||
* The loading screen gui | ||
*/ | ||
|
||
#include <boost/bind.hpp> | ||
|
||
#include "src/aurora/2dareg.h" | ||
#include "src/aurora/talkman.h" | ||
|
||
#include "src/engines/kotor/gui/loadscreen/loadscreen.h" | ||
|
||
#include "src/engines/kotor/gui/widgets/panel.h" | ||
#include "src/engines/kotor/gui/widgets/progressbar.h" | ||
#include "src/engines/kotor/gui/widgets/label.h" | ||
|
||
namespace Engines { | ||
|
||
namespace KotOR { | ||
|
||
LoadScreen::LoadScreen(const Common::UString &loadScreenName, Console *console) | ||
: GUI(console) { | ||
load("loadscreen"); | ||
|
||
getPanel("TGuiPanel")->setFill("load_" + loadScreenName); | ||
|
||
// TODO: Add loading hints according to loadscreenhints.2da | ||
getLabel("LBL_HINT")->setFont("fnt_d16x16b"); | ||
getLabel("LBL_HINT")->setText(""); | ||
|
||
addBackground(kBackgroundTypeLoad); | ||
|
||
_progressBar = getProgressbar("PB_PROGRESS"); | ||
_progressBar->setCurrentValue(0); | ||
} | ||
|
||
void LoadScreen::setLoadingProgress(unsigned int progress) { | ||
_progressBar->setCurrentValue(progress); | ||
} | ||
|
||
LoadingProgressFunc LoadScreen::getLoadingProgressFunc() { | ||
return boost::bind(&LoadScreen::setLoadingProgress, this, _1); | ||
} | ||
|
||
} // End of namespace KotOR | ||
|
||
} // End of namespace Engines |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/* xoreos - A reimplementation of BioWare's Aurora engine | ||
* | ||
* xoreos is the legal property of its developers, whose names | ||
* can be found in the AUTHORS file distributed with this source | ||
* distribution. | ||
* | ||
* xoreos is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU General Public License | ||
* as published by the Free Software Foundation; either version 3 | ||
* of the License, or (at your option) any later version. | ||
* | ||
* xoreos is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with xoreos. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
/** @file | ||
* The loading screen gui | ||
*/ | ||
|
||
#ifndef ENGINES_KOTOR_GUI_LOADSCREEN_LOADSCREEN_H | ||
#define ENGINES_KOTOR_GUI_LOADSCREEN_LOADSCREEN_H | ||
|
||
#include <boost/function.hpp> | ||
|
||
#include "src/common/thread.h" | ||
|
||
#include "src/engines/kotor/module.h" | ||
#include "src/engines/kotor/gui/gui.h" | ||
|
||
namespace Engines { | ||
|
||
namespace KotOR { | ||
|
||
typedef boost::function<void(unsigned int)> LoadingProgressFunc; | ||
|
||
class LoadScreen : public GUI { | ||
public: | ||
LoadScreen(const Common::UString &loadScreenName, Console *console = 0); | ||
|
||
void setLoadingProgress(unsigned int progress); | ||
LoadingProgressFunc getLoadingProgressFunc(); | ||
|
||
private: | ||
WidgetProgressbar *_progressBar; | ||
}; | ||
|
||
} // End of namespace KotOR | ||
|
||
} // End of namespace Engines | ||
|
||
#endif // ENGINES_KOTOR_GUI_LOADSCREEN_LOADSCREEN_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters