37 #include "widgets/button.hpp"
40 #define ERR_NG LOG_STREAM(err, log_engine)
41 #define LOG_NG LOG_STREAM(info, log_engine)
49 , scenario_name_(scenario_name)
50 , segment_index_(segment_index)
65 if(key ==
"part" && !node.
empty()) {
68 if((*story_part).show_title() && (*story_part).title().empty()) {
71 parts_.push_back(story_part);
74 else if(key ==
"if") {
86 bool elseif_flag =
false;
89 for (vconfig::child_list::const_iterator elseif = elseif_children.begin(); elseif != elseif_children.end(); ++elseif) {
91 if (elseif->has_child(
"then")) {
99 if (node.
has_child(
"else") && !elseif_flag) {
105 else if(key ==
"switch") {
108 bool case_not_found =
true;
111 if(j->first !=
"case")
continue;
114 const std::string var_expected_value = (j->second)[
"value"];
115 if(var_actual_value == var_expected_value) {
116 case_not_found =
false;
123 if(j->first !=
"else")
continue;
131 else if(key ==
"deprecated_message") {
136 else if(key ==
"wml_message") {
148 LOG_NG <<
"no storyscreen parts to show\n";
161 std::vector< render_pointer_type > uis_;
163 ASSERT_LOG(
p !=
nullptr,
"Ouch: hit nullptr storyscreen part in collection" );
174 k = parts_.size() -1;
181 while(k < parts_.size()) {
183 part_ui &render_interface = *uis_[k];
185 part_ui render_interface(*parts_[k],
video_, next_button, back_button, play_button);
188 LOG_NG <<
"displaying storyscreen part " << k+1 <<
" of " << parts_.size() <<
'\n';
192 switch(render_interface.
show()) {
Storyscreen parts and floating images representation.
std::vector< part_pointer_type > parts_
The user pressed the go-next button.
vconfig child(const std::string &key) const
Returns a child of *this whose key is key.
all_children_iterator ordered_end() const
void resolve_wml(const vconfig &cfg)
GLint GLenum GLsizei GLint GLsizei const GLvoid * data
static UNUSEDNOWARN std::string _(const char *str)
static lg::log_domain log_engine("engine")
The user pressed the go-back button.
virtual config::attribute_value get_variable_const(const std::string &varname) const
returns a blank attribute value if varname is no valid variable name.
child_list get_children(const std::string &key) const
Storyscreen parts rendering interface.
bool has_child(const std::string &key) const
Returns whether or not *this has a child whose key is key.
Storyscreen part user interface.
game_events::manager * game_events
Represents and contains information about a single storyscreen part.
Define conditionals for the game's events mechanism, a.k.a.
std::stringstream & wml_error()
Use this logger to send errors due to deprecated WML.
RESULT show()
Render and display the storyscreen, process and return user input.
Define the game's event mechanism.
controller(CVideo &video, const vconfig &data, const std::string &scenario_name, int segment_index)
game_events::t_pump & pump()
bool conditional_passed(const vconfig &cond)
A variable-expanding proxy for the config class.
Standard logging facilities (interface).
std::vector< vconfig > child_list
Storyscreen controller (interface).
void put_wml_message(const std::string &logger, const std::string &message, bool in_chat)
Helper function which determines whether a wml_message text can really be pushed into the wml_message...
GLsizei const GLcharARB ** string
std::string scenario_name_
all_children_iterator ordered_begin() const
In-order iteration over all children.
STORY_RESULT show(START_POSITION startpos=START_BEGINNING)
Display all story screen parts in a first..last sequence.