The Battle for Wesnoth  1.19.0-dev
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>

Inheritance diagram for storyscreen::part:

Public Types

enum  BLOCK_LOCATION { BLOCK_TOP , BLOCK_MIDDLE , BLOCK_BOTTOM }
 Currently used to indicate where the text block 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::string & text () const
 Retrieves the story text itself. More...
 
void set_text (const std::string &text)
 Changes the story text. More...
 
const std::string & title () const
 Retrieves the story screen title. More...
 
void set_title (const std::string &title)
 Changes the story screen title. More...
 
const std::string & music () const
 Retrieves the background music. More...
 
const std::string & sound () const
 Retrieves a one-time-only sound effect. More...
 
const std::string & voice () const
 Retrieves a voice track. More...
 
BLOCK_LOCATION story_text_location () const
 Retrieves the area of the screen on which the story text is displayed. More...
 
const std::string & story_text_alignment () const
 Retrieves the alignment of the story text within the text area. More...
 
const std::string & 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

virtual void resolve_wml (const vconfig &cfg) override
 Inherited from story_parser. More...
 
virtual bool resolve_wml_helper (const std::string &key, const vconfig &node) override
 Inherited from story_parser. More...
 
- Private Member Functions inherited from storyscreen::story_parser
 story_parser ()=default
 
virtual ~story_parser ()=default
 
 story_parser (const story_parser &)=delete
 
story_parseroperator= (const story_parser &)=delete
 

Static Private Member Functions

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

Private Attributes

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

Detailed Description

Represents and contains information about a single storyscreen part.

Definition at line 226 of file part.hpp.

Member Enumeration Documentation

◆ BLOCK_LOCATION

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 234 of file part.hpp.

◆ RESULT

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 243 of file part.hpp.

Constructor & Destructor Documentation

◆ part()

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 97 of file part.cpp.

References resolve_wml().

Member Function Documentation

◆ get_background_layers()

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

Retrieve background layers for this story screen.

Definition at line 328 of file part.hpp.

References background_layers_.

◆ get_floating_images()

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

Retrieve any associated floating images for this story screen.

Definition at line 322 of file part.hpp.

References floating_images_.

◆ music()

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

Retrieves the background music.

Definition at line 286 of file part.hpp.

References music_.

◆ resolve_wml()

void storyscreen::part::resolve_wml ( const vconfig cfg)
overrideprivatevirtual

◆ resolve_wml_helper()

bool storyscreen::part::resolve_wml_helper ( const std::string &  key,
const vconfig node 
)
overrideprivatevirtual

Inherited from story_parser.

Implements storyscreen::story_parser.

Definition at line 213 of file part.cpp.

References background_layers_, floating_images_, and vconfig::get_parsed_config().

◆ set_text()

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

Changes the story text.

Definition at line 268 of file part.hpp.

References text(), and text_.

◆ set_title()

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

Changes the story screen title.

Definition at line 280 of file part.hpp.

References text_title_, and title().

◆ show_title()

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

Whether the story screen title should be displayed or not.

Definition at line 256 of file part.hpp.

References show_title_.

◆ sound()

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

Retrieves a one-time-only sound effect.

Definition at line 292 of file part.hpp.

References sound_.

◆ story_text_alignment()

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

Retrieves the alignment of the story text within the text area.

Definition at line 310 of file part.hpp.

References text_alignment_.

◆ story_text_location()

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 304 of file part.hpp.

References text_block_loc_.

◆ string_tblock_loc()

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

Definition at line 112 of file part.cpp.

References BLOCK_BOTTOM, BLOCK_MIDDLE, BLOCK_TOP, and s.

Referenced by resolve_wml().

◆ text()

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

Retrieves the story text itself.

Definition at line 262 of file part.hpp.

References text_.

Referenced by set_text().

◆ title()

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

Retrieves the story screen title.

Definition at line 274 of file part.hpp.

References text_title_.

Referenced by set_title().

◆ title_text_alignment()

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

Retrieves the alignment of the title text against the screen.

Definition at line 316 of file part.hpp.

References title_alignment_.

◆ voice()

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

Retrieves a voice track.

Definition at line 298 of file part.hpp.

References voice_.

Member Data Documentation

◆ background_layers_

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

Definition at line 353 of file part.hpp.

Referenced by get_background_layers(), resolve_wml(), and resolve_wml_helper().

◆ floating_images_

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_helper().

◆ music_

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

Definition at line 349 of file part.hpp.

Referenced by music(), and resolve_wml().

◆ show_title_

bool storyscreen::part::show_title_
private

Definition at line 342 of file part.hpp.

Referenced by resolve_wml(), and show_title().

◆ sound_

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

Definition at line 350 of file part.hpp.

Referenced by resolve_wml(), and sound().

◆ text_

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

Definition at line 343 of file part.hpp.

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

◆ text_alignment_

std::string storyscreen::part::text_alignment_
private

Definition at line 346 of file part.hpp.

Referenced by resolve_wml(), and story_text_alignment().

◆ text_block_loc_

BLOCK_LOCATION storyscreen::part::text_block_loc_
private

Definition at line 345 of file part.hpp.

Referenced by resolve_wml(), and story_text_location().

◆ text_title_

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

Definition at line 344 of file part.hpp.

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

◆ title_alignment_

std::string storyscreen::part::title_alignment_
private

Definition at line 347 of file part.hpp.

Referenced by resolve_wml(), and title_text_alignment().

◆ voice_

std::string storyscreen::part::voice_
private

Definition at line 351 of file part.hpp.

Referenced by resolve_wml(), and voice().


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