xoreos  0.0.5
loadscreen.cpp
Go to the documentation of this file.
1 /* xoreos - A reimplementation of BioWare's Aurora engine
2  *
3  * xoreos is the legal property of its developers, whose names
4  * can be found in the AUTHORS file distributed with this source
5  * distribution.
6  *
7  * xoreos is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 3
10  * of the License, or (at your option) any later version.
11  *
12  * xoreos is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with xoreos. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
25 #include <boost/bind.hpp>
26 
27 #include "src/aurora/2dareg.h"
28 #include "src/aurora/talkman.h"
29 
31 
35 
36 namespace Engines {
37 
38 namespace KotOR {
39 
40 LoadScreen::LoadScreen(const Common::UString &loadScreenName, Console *console)
41  : GUI(console) {
42  load("loadscreen");
43 
44  getPanel("TGuiPanel")->setFill("load_" + loadScreenName);
45 
46  // TODO: Add loading hints according to loadscreenhints.2da
47  getLabel("LBL_HINT")->setText("");
48 
50 
51  _progressBar = getProgressbar("PB_PROGRESS");
53 }
54 
55 void LoadScreen::setLoadingProgress(unsigned int progress) {
56  _progressBar->setCurrentValue(progress);
57 }
58 
60  return boost::bind(&LoadScreen::setLoadingProgress, this, _1);
61 }
62 
63 } // End of namespace KotOR
64 
65 } // End of namespace Engines
void load(const Common::UString &resref)
Definition: gui.cpp:103
void setFill(const Common::UString &fill)
void setCurrentValue(int curValue)
Set the current progress bar value.
A label widget for Star Wars: Knights of the Old Republic and Jade Empire.
A class holding an UTF-8 string.
Definition: ustring.h:48
WidgetProgressbar * _progressBar
Definition: loadscreen.h:49
The loading screen gui.
LoadScreen(const Common::UString &loadScreenName, Console *console=0)
Definition: loadscreen.cpp:40
A panel widget for Star Wars: Knights of the Old Republic and Jade Empire.
LoadingProgressFunc getLoadingProgressFunc()
Definition: loadscreen.cpp:59
void setLoadingProgress(unsigned int progress)
Definition: loadscreen.cpp:55
The global 2DA registry.
void addBackground(const Common::UString &background, bool front=false)
Definition: gui.cpp:300
A progressbar widget for Star Wars: Knights of the Old Republic and Jade Empire.
WidgetLabel * getLabel(const Common::UString &tag, bool vital=false)
Definition: gui.cpp:204
boost::function< void(unsigned int)> LoadingProgressFunc
Definition: loadscreen.h:39
The global talk manager for Aurora strings.
WidgetProgressbar * getProgressbar(const Common::UString &tag, bool vital=false)
Definition: gui.cpp:276
void setText(const Common::UString &text)
static const Common::UString & kBackgroundTypeLoad
Definition: guibackground.h:45
A KotOR GUI.
Definition: gui.h:57
WidgetPanel * getPanel(const Common::UString &tag, bool vital=false)
Definition: gui.cpp:192