Public Types | Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes

storyscreen::part Class Reference

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

#include <part.hpp>

Collaboration diagram for storyscreen::part:
Collaboration graph
[legend]

List of all members.

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.
bool scale_background () const
 Whether the background image should be scaled to fill the screen or not.
const std::string & background () const
 Path to the background image.
bool show_title () const
 Whether the story screen title should be displayed or not.
const std::string & text () const
 Retrieves the story text itself.
void set_text (const std::string &text)
 Changes the story text.
const std::string & title () const
 Retrieves the story screen title.
void set_title (const std::string &title)
 Changes the story screen title.
const std::string & music () const
 Retrieves the background music.
const std::string & sound () const
 Retrieves a one-time-only sound effect.
BLOCK_LOCATION story_text_location () const
 Retrieves the area of the screen on which the story text is displayed.
TEXT_ALIGNMENT title_text_alignment () const
 Retrieves the alignment of the title text against the screen.
const std::vector
< floating_image > & 
get_floating_images () const
 Retrieve any associated floating images for this story screen.

Private Member Functions

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

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 scale_background_
std::string background_file_
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< floating_imagefloating_images_

Detailed Description

Represents and contains information about a single storyscreen part.

Definition at line 120 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 128 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 146 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 138 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_cfg Node object which should correspond to a [part] block's contents.

Definition at line 98 of file part.cpp.

References resolve_wml().

Here is the call graph for this function:


Member Function Documentation

const std::string& storyscreen::part::background (  )  const [inline]

Path to the background image.

Definition at line 164 of file part.hpp.

References background_file_.

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

Here is the caller graph for this function:

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

Retrieve any associated floating images for this story screen.

Definition at line 214 of file part.hpp.

References floating_images_.

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

Here is the caller graph for this function:

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

Retrieves the background music.

Definition at line 194 of file part.hpp.

References music_.

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

Here is the caller graph for this function:

void storyscreen::part::resolve_wml ( const vconfig cfg  )  [private]
bool storyscreen::part::scale_background (  )  const [inline]

Whether the background image should be scaled to fill the screen or not.

Definition at line 159 of file part.hpp.

References scale_background_.

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

Here is the caller graph for this function:

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

Changes the story text.

Definition at line 179 of file part.hpp.

References text_.

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

Changes the story screen title.

Definition at line 189 of file part.hpp.

References text_title_.

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

Whether the story screen title should be displayed or not.

Definition at line 169 of file part.hpp.

References show_title_.

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

Here is the caller graph for this function:

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

Retrieves a one-time-only sound effect.

Definition at line 199 of file part.hpp.

References sound_.

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

Here is the caller graph for this function:

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

Here is the caller graph for this function:

part::BLOCK_LOCATION storyscreen::part::string_tblock_loc ( const std::string &  s  )  [static, private]

Definition at line 113 of file part.cpp.

Referenced by resolve_wml().

Here is the caller graph for this function:

part::TEXT_ALIGNMENT storyscreen::part::string_title_align ( const std::string &  s  )  [static, private]

Definition at line 126 of file part.cpp.

Referenced by resolve_wml().

Here is the caller graph for this function:

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

Retrieves the story text itself.

Definition at line 174 of file part.hpp.

References text_.

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

Here is the caller graph for this function:

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

Retrieves the story screen title.

Definition at line 184 of file part.hpp.

References text_title_.

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

Here is the caller graph for this function:

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

Retrieves the alignment of the title text against the screen.

Definition at line 209 of file part.hpp.

References title_alignment_.

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

Here is the caller graph for this function:


Member Data Documentation

std::string storyscreen::part::background_file_ [private]

Definition at line 226 of file part.hpp.

Referenced by background(), and resolve_wml().

Definition at line 237 of file part.hpp.

Referenced by get_floating_images(), and resolve_wml().

std::string storyscreen::part::music_ [private]

Definition at line 234 of file part.hpp.

Referenced by music(), and resolve_wml().

Definition at line 225 of file part.hpp.

Referenced by resolve_wml(), and scale_background().

Definition at line 228 of file part.hpp.

Referenced by resolve_wml(), and show_title().

std::string storyscreen::part::sound_ [private]

Definition at line 235 of file part.hpp.

Referenced by resolve_wml(), and sound().

std::string storyscreen::part::text_ [private]

Definition at line 229 of file part.hpp.

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

Definition at line 231 of file part.hpp.

Referenced by resolve_wml(), and story_text_location().

std::string storyscreen::part::text_title_ [private]

Definition at line 230 of file part.hpp.

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

Definition at line 232 of file part.hpp.

Referenced by resolve_wml(), and title_text_alignment().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated by doxygen 1.7.1 on Thu May 24 2012 01:26:03 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs