Make it possible to specify the story to play.
This commit is contained in:
parent
c486db5a57
commit
5e9dad51b0
3 changed files with 5 additions and 7 deletions
|
|
@ -9,19 +9,17 @@
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
|
||||||
namespace storyboard {
|
namespace storyboard {
|
||||||
UI::UI() :
|
UI::UI(const std::string& story_name) :
|
||||||
$view_texture({SCREEN_WIDTH, SCREEN_HEIGHT}),
|
$view_texture({SCREEN_WIDTH, SCREEN_HEIGHT}),
|
||||||
$view_sprite($view_texture.getTexture()),
|
$view_sprite($view_texture.getTexture()),
|
||||||
$audio(sound::get_sound_pair("ambient_1").sound)
|
$audio(sound::get_sound_pair("ambient_1").sound)
|
||||||
{
|
{
|
||||||
$view_sprite.setPosition({0, 0});
|
$view_sprite.setPosition({0, 0});
|
||||||
$camera.style("pan");
|
auto config = settings::get("stories");
|
||||||
|
$story = components::convert<components::Storyboard>(config[story_name]);
|
||||||
}
|
}
|
||||||
|
|
||||||
void UI::init() {
|
void UI::init() {
|
||||||
auto config = settings::get("stories");
|
|
||||||
$story = components::convert<components::Storyboard>(config["rat_king"]);
|
|
||||||
|
|
||||||
$ui.position(0,0, SCREEN_WIDTH, SCREEN_HEIGHT);
|
$ui.position(0,0, SCREEN_WIDTH, SCREEN_HEIGHT);
|
||||||
|
|
||||||
$ui.set<guecs::Background>($ui.MAIN, {$ui.$parser, guecs::THEME.TRANSPARENT});
|
$ui.set<guecs::Background>($ui.MAIN, {$ui.$parser, guecs::THEME.TRANSPARENT});
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ namespace storyboard {
|
||||||
components::Storyboard $story;
|
components::Storyboard $story;
|
||||||
std::string $layout;
|
std::string $layout;
|
||||||
|
|
||||||
UI();
|
UI(const std::string& story_name);
|
||||||
|
|
||||||
void init();
|
void init();
|
||||||
void render(sf::RenderWindow &window);
|
void render(sf::RenderWindow &window);
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ int main(int, char*[]) {
|
||||||
|
|
||||||
gui::routing::Router router;
|
gui::routing::Router router;
|
||||||
|
|
||||||
storyboard::UI main;
|
storyboard::UI main("rat_king");
|
||||||
main.init();
|
main.init();
|
||||||
|
|
||||||
while(true) {
|
while(true) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue