The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Types | Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
storyscreen::part Class Reference

Represents and contains information about a single storyscreen part. More...

#include <part.hpp>

Public Types

enum  BLOCK_LOCATION { BLOCK_TOP, BLOCK_MIDDLE, BLOCK_BOTTOM }
 Currently used to indicate where the text block should be placed. More...
 
enum  TEXT_ALIGNMENT { TEXT_LEFT, TEXT_CENTERED, TEXT_RIGHT }
 Currently used to indicate where the page title should be placed. More...
 
enum  RESULT { NEXT, SKIP, QUIT }
 Used to signal user actions. More...
 

Public Member Functions

 part (const vconfig &part_cfg)
 Constructs a storyscreen part from a managed WML node. More...
 
bool show_title () const
 Whether the story screen title should be displayed or not. More...
 
const std::stringtext () const
 Retrieves the story text itself. More...
 
void set_text (const std::string &text)
 Changes the story text. More...
 
const std::stringtitle () const
 Retrieves the story screen title. More...
 
void set_title (const std::string &title)
 Changes the story screen title. More...
 
const std::stringmusic () const
 Retrieves the background music. More...
 
const std::stringsound () const
 Retrieves a one-time-only sound effect. More...
 
BLOCK_LOCATION story_text_location () const
 Retrieves the area of the screen on which the story text is displayed. More...
 
TEXT_ALIGNMENT title_text_alignment () const
 Retrieves the alignment of the title text against the screen. More...
 
const std::vector
< floating_image > & 
get_floating_images () const
 Retrieve any associated floating images for this story screen. More...
 
const std::vector
< background_layer > & 
get_background_layers () const
 Retrieve background layers for this story screen. More...
 

Private Member Functions

void resolve_wml (const vconfig &cfg)
 Takes care of initializing and branching properties. More...
 

Static Private Member Functions

static BLOCK_LOCATION string_tblock_loc (const std::string &s)
 
static TEXT_ALIGNMENT string_title_align (const std::string &s)
 

Private Attributes

bool show_title_
 
std::string text_
 
std::string text_title_
 
BLOCK_LOCATION text_block_loc_
 
TEXT_ALIGNMENT title_alignment_
 
std::string music_
 
std::string sound_
 
std::vector< background_layerbackground_layers_
 
std::vector< floating_imagefloating_images_
 

Detailed Description

Represents and contains information about a single storyscreen part.

Definition at line 244 of file part.hpp.

Member Enumeration Documentation

Currently used to indicate where the text block should be placed.

Note that it will always take as much space as it is possible horizontally.

Enumerator
BLOCK_TOP 

Top of the screen.

BLOCK_MIDDLE 

Center of the screen.

BLOCK_BOTTOM 

Bottom of the screen.

This is the default.

Definition at line 252 of file part.hpp.

Used to signal user actions.

Enumerator
NEXT 

Jump to next story part.

SKIP 

Skip all story parts for this set.

QUIT 

Quit game and go back to main menu.

Definition at line 270 of file part.hpp.

Currently used to indicate where the page title should be placed.

It always takes as little space (horizontally) as possible, and it is always placed at the top of the screen.

Enumerator
TEXT_LEFT 

Top-left corner.

TEXT_CENTERED 

Center on the topmost edge of the screen.

TEXT_RIGHT 

Top-right corner.

Definition at line 262 of file part.hpp.

Constructor & Destructor Documentation

storyscreen::part::part ( const vconfig part_cfg)

Constructs a storyscreen part from a managed WML node.

Parameters
part_cfgNode object which should correspond to a [part] block's contents.

Definition at line 174 of file part.cpp.

References resolve_wml().

Member Function Documentation

const std::vector<background_layer>& storyscreen::part::get_background_layers ( ) const
inline

Retrieve background layers for this story screen.

Definition at line 333 of file part.hpp.

References background_layers_.

Referenced by storyscreen::part_ui::prepare_background().

const std::vector<floating_image>& storyscreen::part::get_floating_images ( ) const
inline

Retrieve any associated floating images for this story screen.

Definition at line 328 of file part.hpp.

References floating_images_.

Referenced by storyscreen::part_ui::prepare_floating_images(), and storyscreen::part_ui::render_floating_images().

const std::string& storyscreen::part::music ( ) const
inline

Retrieves the background music.

Definition at line 308 of file part.hpp.

References music_.

Referenced by storyscreen::part_ui::show().

void storyscreen::part::resolve_wml ( const vconfig cfg)
private
void storyscreen::part::set_text ( const std::string text)
inline

Changes the story text.

Definition at line 293 of file part.hpp.

References text(), and text_.

void storyscreen::part::set_title ( const std::string title)
inline

Changes the story screen title.

Definition at line 303 of file part.hpp.

References text_title_, and title().

bool storyscreen::part::show_title ( ) const
inline

Whether the story screen title should be displayed or not.

Definition at line 283 of file part.hpp.

References show_title_.

Referenced by storyscreen::part_ui::render_story_box().

const std::string& storyscreen::part::sound ( ) const
inline

Retrieves a one-time-only sound effect.

Definition at line 313 of file part.hpp.

References sound_.

Referenced by storyscreen::part_ui::show().

BLOCK_LOCATION storyscreen::part::story_text_location ( ) const
inline

Retrieves the area of the screen on which the story text is displayed.

Definition at line 318 of file part.hpp.

References text_block_loc_.

Referenced by storyscreen::part_ui::prepare_geometry(), storyscreen::part_ui::render_story_box(), and storyscreen::part_ui::render_story_box_borders().

part::BLOCK_LOCATION storyscreen::part::string_tblock_loc ( const std::string s)
staticprivate

Definition at line 188 of file part.cpp.

References BLOCK_BOTTOM, BLOCK_MIDDLE, and BLOCK_TOP.

Referenced by resolve_wml().

part::TEXT_ALIGNMENT storyscreen::part::string_title_align ( const std::string s)
staticprivate

Definition at line 201 of file part.cpp.

References TEXT_CENTERED, TEXT_LEFT, and TEXT_RIGHT.

Referenced by resolve_wml().

const std::string& storyscreen::part::text ( ) const
inline

Retrieves the story text itself.

Definition at line 288 of file part.hpp.

References text_.

Referenced by storyscreen::part_ui::render_story_box(), and set_text().

const std::string& storyscreen::part::title ( ) const
inline

Retrieves the story screen title.

Definition at line 298 of file part.hpp.

References text_title_.

Referenced by storyscreen::part_ui::render_title_box(), and set_title().

TEXT_ALIGNMENT storyscreen::part::title_text_alignment ( ) const
inline

Retrieves the alignment of the title text against the screen.

Definition at line 323 of file part.hpp.

References title_alignment_.

Referenced by storyscreen::part_ui::render_title_box().

Member Data Documentation

std::vector<background_layer> storyscreen::part::background_layers_
private

Definition at line 353 of file part.hpp.

Referenced by get_background_layers(), and resolve_wml().

std::vector<floating_image> storyscreen::part::floating_images_
private

Definition at line 354 of file part.hpp.

Referenced by get_floating_images(), and resolve_wml().

std::string storyscreen::part::music_
private

Definition at line 350 of file part.hpp.

Referenced by music(), and resolve_wml().

bool storyscreen::part::show_title_
private

Definition at line 344 of file part.hpp.

Referenced by resolve_wml(), and show_title().

std::string storyscreen::part::sound_
private

Definition at line 351 of file part.hpp.

Referenced by resolve_wml(), and sound().

std::string storyscreen::part::text_
private

Definition at line 345 of file part.hpp.

Referenced by resolve_wml(), set_text(), and text().

BLOCK_LOCATION storyscreen::part::text_block_loc_
private

Definition at line 347 of file part.hpp.

Referenced by resolve_wml(), and story_text_location().

std::string storyscreen::part::text_title_
private

Definition at line 346 of file part.hpp.

Referenced by resolve_wml(), set_title(), and title().

TEXT_ALIGNMENT storyscreen::part::title_alignment_
private

Definition at line 348 of file part.hpp.

Referenced by resolve_wml(), and title_text_alignment().


The documentation for this class was generated from the following files: