Storyscreen part user interface. More...
#include <render.hpp>

Public Types | |
| enum | RESULT { NEXT, BACK, QUIT } |
Storyscreen result. More... | |
Public Member Functions | |
| part_ui (part &p, display &disp, gui::button &next_button, gui::button &back_button, gui::button &play_button) | |
| Constructor. | |
| RESULT | show () |
| Render and display the storyscreen, process and return user input. | |
Private Member Functions | |
| void | prepare_background () |
| Constructor implementation details. | |
| void | prepare_geometry () |
| Constructor implementation details. | |
| void | prepare_floating_images () |
| Constructor implementation details. | |
| void | render_background () |
| void | render_title_box () |
| void | render_story_box () |
| void | render_story_box_borders (SDL_Rect &) |
| bool | handle_interface () |
| Returns true if the user did an action. | |
| bool | render_floating_images () |
| Renders all floating images in sequence. | |
| void | wait_for_input () |
Private Attributes | |
| part & | p_ |
| display & | disp_ |
| CVideo & | video_ |
| CKey | keys_ |
| gui::button & | next_button_ |
| gui::button & | back_button_ |
| gui::button & | play_button_ |
| RESULT | ret_ |
| bool | skip_ |
| bool | last_key_ |
| double | scale_factor_ |
| SDL_Rect | base_rect_ |
| surface | background_ |
| std::vector < floating_image::render_input > | imgs_ |
| bool | has_background_ |
| int | text_x_ |
| int | text_y_ |
| int | buttons_x_ |
| int | buttons_y_ |
Storyscreen part user interface.
This works on the assumption, like the old one, that the screen cannot be resized while we are at this. More specifically, it is assumed that the screen dimensions remain constant between the constructor call, and the destruction of the objects.
Definition at line 43 of file render.hpp.
Storyscreen result.
| NEXT |
The user pressed the go-next button. |
| BACK |
The user pressed the go-back button. |
| QUIT |
The user selected quit. |
Definition at line 47 of file render.hpp.
| storyscreen::part_ui::part_ui | ( | part & | p, | |
| display & | disp, | |||
| gui::button & | next_button, | |||
| gui::button & | back_button, | |||
| gui::button & | play_button | |||
| ) |
Constructor.
| p | A storyscreen::part with the required information and parameters. | |
| disp | Display. | |
| next_button | Next button. Shouldn't be destroyed before the part_ui object. | |
| skip_button | Skip button. Shouldn't be destroyed before the part_ui object. |
Definition at line 80 of file render.cpp.
References prepare_background(), prepare_floating_images(), and prepare_geometry().

| bool storyscreen::part_ui::handle_interface | ( | ) | [private] |
Returns true if the user did an action.
Modifies ret_, skip_, and last_key_ accordingly.
Definition at line 479 of file render.cpp.
References back_button_, disp_, display::flip(), keys_, last_key_, next_button_, play_button_, gui::button::pressed(), events::pump(), events::raise_draw_event(), events::raise_process_event(), gui::button::release(), ret_, and skip_.
Referenced by render_floating_images(), render_story_box(), and wait_for_input().


| void storyscreen::part_ui::prepare_background | ( | ) | [private] |
Constructor implementation details.
Definition at line 105 of file render.cpp.
References ASSERT_LOG, surface::assign(), storyscreen::part::background(), background_, create_neutral_surface(), image::get_image(), CVideo::getx(), CVideo::gety(), h, has_background_, surface::null(), p_, storyscreen::part::scale_background(), scale_factor_, scale_surface(), and video_.
Referenced by part_ui().


| void storyscreen::part_ui::prepare_floating_images | ( | ) | [private] |
Constructor implementation details.
Definition at line 167 of file render.cpp.
References base_rect_, storyscreen::part::get_floating_images(), storyscreen::floating_image::get_render_input(), imgs_, p_, and scale_factor_.
Referenced by part_ui().


| void storyscreen::part_ui::prepare_geometry | ( | ) | [private] |
Constructor implementation details.
Definition at line 126 of file render.cpp.
References back_button_, background_, base_rect_, storyscreen::part::BLOCK_MIDDLE, storyscreen::part::BLOCK_TOP, buttons_x_, buttons_y_, CVideo::getx(), CVideo::gety(), next_button_, p_, play_button_, gui::widget::set_location(), gui::widget::set_volatile(), storyscreen::part::story_text_location(), text_x_, text_y_, video_, and gui::widget::width().
Referenced by part_ui().


| void storyscreen::part_ui::render_background | ( | ) | [private] |
Definition at line 175 of file render.cpp.
References background_, base_rect_, draw_solid_tinted_rectangle(), CVideo::getSurface(), CVideo::getx(), CVideo::gety(), sdl_blit(), and video_.
Referenced by show().


| bool storyscreen::part_ui::render_floating_images | ( | ) | [private] |
Renders all floating images in sequence.
Definition at line 184 of file render.cpp.
References display::delay(), disp_, storyscreen::floating_image::display_delay(), storyscreen::part::get_floating_images(), CVideo::getSurface(), handle_interface(), storyscreen::floating_image::render_input::image, imgs_, last_key_, surface::null(), p_, events::raise_draw_event(), storyscreen::floating_image::render_input::rect, sdl_blit(), skip_, update_rect(), update_whole_screen(), and video_.
Referenced by show().


| void storyscreen::part_ui::render_story_box | ( | ) | [private] |
Definition at line 339 of file render.cpp.
References back_button_, CVideo::blit_surface(), storyscreen::part::BLOCK_MIDDLE, storyscreen::part::BLOCK_TOP, buttons_x_, gui2::create_rect(), display::delay(), disp_, draw_solid_tinted_rectangle(), ERR_NG, CVideo::getSurface(), CVideo::getx(), CVideo::gety(), h, handle_interface(), gui::widget::hide(), imgs_, last_key_, LOG_NG, next_button_, surface::null(), p_, play_button_, render_story_box_borders(), screen_area(), skip_, storyscreen::part::story_text_location(), storyscreen::part::text(), text_x_, text_y_, update_rect(), update_whole_screen(), video_, w, and wait_for_input().
Referenced by show().


| void storyscreen::part_ui::render_story_box_borders | ( | SDL_Rect & | update_area | ) | [private] |
Definition at line 291 of file render.cpp.
References CVideo::blit_surface(), storyscreen::part::BLOCK_BOTTOM, storyscreen::part::BLOCK_MIDDLE, storyscreen::part::BLOCK_TOP, image::get_image(), has_background_, surface::null(), p_, scale_surface(), screen_area(), storyscreen::part::story_text_location(), video_, w, and WARN_NG.
Referenced by render_story_box().


| void storyscreen::part_ui::render_title_box | ( | ) | [private] |
Definition at line 218 of file render.cpp.
References base_rect_, CVideo::blit_surface(), draw_solid_tinted_rectangle(), ERR_NG, CVideo::getSurface(), surface::null(), p_, storyscreen::part::TEXT_CENTERED, storyscreen::part::TEXT_RIGHT, storyscreen::part::title(), storyscreen::part::title_text_alignment(), update_rect(), and video_.
Referenced by show().


| part_ui::RESULT storyscreen::part_ui::show | ( | ) |
Render and display the storyscreen, process and return user input.
Definition at line 521 of file render.cpp.
References ERR_NG, imgs_, storyscreen::part::music(), p_, sound::play_music_repeatedly(), sound::play_sound(), render_background(), render_floating_images(), render_story_box(), render_title_box(), ret_, storyscreen::part::show_title(), and storyscreen::part::sound().
Referenced by storyscreen::controller::show().


| void storyscreen::part_ui::wait_for_input | ( | ) | [private] |
Definition at line 468 of file render.cpp.
References display::delay(), disp_, handle_interface(), last_key_, LOG_NG, and skip_.
Referenced by render_story_box().


gui::button& storyscreen::part_ui::back_button_ [private] |
Definition at line 75 of file render.hpp.
Referenced by handle_interface(), prepare_geometry(), and render_story_box().
surface storyscreen::part_ui::background_ [private] |
Definition at line 87 of file render.hpp.
Referenced by prepare_background(), prepare_geometry(), and render_background().
SDL_Rect storyscreen::part_ui::base_rect_ [private] |
Definition at line 85 of file render.hpp.
Referenced by prepare_floating_images(), prepare_geometry(), render_background(), and render_title_box().
int storyscreen::part_ui::buttons_x_ [private] |
Definition at line 91 of file render.hpp.
Referenced by prepare_geometry(), and render_story_box().
int storyscreen::part_ui::buttons_y_ [private] |
Definition at line 91 of file render.hpp.
Referenced by prepare_geometry().
display& storyscreen::part_ui::disp_ [private] |
Definition at line 70 of file render.hpp.
Referenced by handle_interface(), render_floating_images(), render_story_box(), and wait_for_input().
bool storyscreen::part_ui::has_background_ [private] |
Definition at line 89 of file render.hpp.
Referenced by prepare_background(), and render_story_box_borders().
std::vector< floating_image::render_input > storyscreen::part_ui::imgs_ [private] |
Definition at line 88 of file render.hpp.
Referenced by prepare_floating_images(), render_floating_images(), render_story_box(), and show().
CKey storyscreen::part_ui::keys_ [private] |
Definition at line 72 of file render.hpp.
Referenced by handle_interface().
bool storyscreen::part_ui::last_key_ [private] |
Definition at line 79 of file render.hpp.
Referenced by handle_interface(), render_floating_images(), render_story_box(), and wait_for_input().
gui::button& storyscreen::part_ui::next_button_ [private] |
Definition at line 74 of file render.hpp.
Referenced by handle_interface(), prepare_geometry(), and render_story_box().
part& storyscreen::part_ui::p_ [private] |
Definition at line 69 of file render.hpp.
Referenced by prepare_background(), prepare_floating_images(), prepare_geometry(), render_floating_images(), render_story_box(), render_story_box_borders(), render_title_box(), and show().
gui::button& storyscreen::part_ui::play_button_ [private] |
Definition at line 76 of file render.hpp.
Referenced by handle_interface(), prepare_geometry(), and render_story_box().
RESULT storyscreen::part_ui::ret_ [private] |
Definition at line 78 of file render.hpp.
Referenced by handle_interface(), and show().
double storyscreen::part_ui::scale_factor_ [private] |
Definition at line 81 of file render.hpp.
Referenced by prepare_background(), and prepare_floating_images().
bool storyscreen::part_ui::skip_ [private] |
Definition at line 79 of file render.hpp.
Referenced by handle_interface(), render_floating_images(), render_story_box(), and wait_for_input().
int storyscreen::part_ui::text_x_ [private] |
Definition at line 91 of file render.hpp.
Referenced by prepare_geometry(), and render_story_box().
int storyscreen::part_ui::text_y_ [private] |
Definition at line 91 of file render.hpp.
Referenced by prepare_geometry(), and render_story_box().
CVideo& storyscreen::part_ui::video_ [private] |
Definition at line 71 of file render.hpp.
Referenced by prepare_background(), prepare_geometry(), render_background(), render_floating_images(), render_story_box(), render_story_box_borders(), and render_title_box().
| Generated by doxygen 1.7.1 on Thu May 24 2012 01:26:05 for The Battle for Wesnoth | Gna! | Forum | Wiki | CIA | devdocs |