The Battle for Wesnoth  1.15.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:
Inheritance graph

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 224 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 232 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 241 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 121 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 326 of file part.hpp.

References s.

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

◆ music()

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

Retrieves the background music.

Definition at line 284 of file part.hpp.

◆ 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 237 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 266 of file part.hpp.

◆ set_title()

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

Changes the story screen title.

Definition at line 278 of file part.hpp.

◆ show_title()

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

Whether the story screen title should be displayed or not.

Definition at line 254 of file part.hpp.

◆ sound()

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

Retrieves a one-time-only sound effect.

Definition at line 290 of file part.hpp.

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

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

◆ string_tblock_loc()

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

Definition at line 136 of file part.cpp.

References BLOCK_BOTTOM, BLOCK_MIDDLE, and BLOCK_TOP.

Referenced by resolve_wml().

◆ text()

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

Retrieves the story text itself.

Definition at line 260 of file part.hpp.

◆ title()

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

Retrieves the story screen title.

Definition at line 272 of file part.hpp.

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

◆ voice()

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

Retrieves a voice track.

Definition at line 296 of file part.hpp.

Member Data Documentation

◆ background_layers_

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

Definition at line 351 of file part.hpp.

Referenced by resolve_wml(), and resolve_wml_helper().

◆ floating_images_

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

Definition at line 352 of file part.hpp.

Referenced by resolve_wml_helper().

◆ music_

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

Definition at line 347 of file part.hpp.

Referenced by resolve_wml().

◆ show_title_

bool storyscreen::part::show_title_
private

Definition at line 340 of file part.hpp.

Referenced by resolve_wml().

◆ sound_

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

Definition at line 348 of file part.hpp.

Referenced by resolve_wml().

◆ text_

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

Definition at line 341 of file part.hpp.

Referenced by resolve_wml().

◆ text_alignment_

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

Definition at line 344 of file part.hpp.

Referenced by resolve_wml().

◆ text_block_loc_

BLOCK_LOCATION storyscreen::part::text_block_loc_
private

Definition at line 343 of file part.hpp.

Referenced by resolve_wml().

◆ text_title_

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

Definition at line 342 of file part.hpp.

Referenced by resolve_wml().

◆ title_alignment_

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

Definition at line 345 of file part.hpp.

Referenced by resolve_wml().

◆ voice_

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

Definition at line 349 of file part.hpp.

Referenced by resolve_wml().


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