Classes | Public Member Functions | Protected Member Functions | Private Attributes

mp::gamebrowser Class Reference

#include <multiplayer_lobby.hpp>

Inheritance diagram for mp::gamebrowser:
Inheritance graph
[legend]
Collaboration diagram for mp::gamebrowser:
Collaboration graph
[legend]

List of all members.

Classes

struct  game_item

Public Member Functions

 gamebrowser (CVideo &video, const config &map_hashes)
void scroll (unsigned int pos)
void handle_event (const SDL_Event &event)
void set_inner_location (const SDL_Rect &rect)
void set_item_height (unsigned int height)
void set_game_items (const config &cfg, const config &game_config)
void draw ()
void draw_contents ()
void draw_row (const size_t row_index, const SDL_Rect &rect, ROW_TYPE type)
SDL_Rect get_item_rect (size_t index) const
bool empty () const
bool selection_is_joinable () const
bool selection_is_observable () const
bool selected () const
void reset_selection ()
int selection () const
game_item selected_game ()
void select_game (const std::string &id)
bool game_matches_filter (const game_item &i, const config &cfg)

Protected Member Functions

unsigned int row_height () const

Private Attributes

image::locator gold_icon_locator_
image::locator xp_icon_locator_
image::locator vision_icon_locator_
image::locator time_limit_icon_locator_
image::locator observer_icon_locator_
image::locator no_observer_icon_locator_
image::locator shuffle_sides_icon_locator_
const configmap_hashes_
unsigned int item_height_
int margin_
int minimap_size_
int h_padding_
int header_height_
size_t selected_
std::pair< size_t, size_t > visible_range_
std::vector< game_itemgames_
std::vector< size_t > redraw_items_
std::vector< int > widths_
bool double_clicked_
bool ignore_next_doubleclick_
bool last_was_doubleclick_

Detailed Description

Definition at line 36 of file multiplayer_lobby.hpp.


Constructor & Destructor Documentation

mp::gamebrowser::gamebrowser ( CVideo video,
const config map_hashes 
)

Definition at line 45 of file multiplayer_lobby.cpp.

References gui::menu::set_numeric_keypress_selection().

Here is the call graph for this function:


Member Function Documentation

void mp::gamebrowser::draw (  )  [virtual]
void mp::gamebrowser::draw_contents (  )  [virtual]

Reimplemented from gui::menu.

Definition at line 117 of file multiplayer_lobby.cpp.

References _, gui::menu::style::draw_row(), font::draw_text(), games_, get_item_rect(), gui::scrollarea::inner_location(), margin_, font::NORMAL_COLOR, gui::menu::NORMAL_ROW, selected_, gui::menu::SELECTED_ROW, font::SIZE_NORMAL, gui::menu::style_, gui::widget::video(), and visible_range_.

Referenced by draw().

Here is the call graph for this function:

Here is the caller graph for this function:

void mp::gamebrowser::draw_row ( const size_t  row_index,
const SDL_Rect &  rect,
ROW_TYPE  type 
) [virtual]
bool mp::gamebrowser::empty (  )  const [inline]

Definition at line 101 of file multiplayer_lobby.hpp.

References games_.

Referenced by mp::lobby::process_event(), select_game(), selected(), selection_is_joinable(), selection_is_observable(), and set_game_items().

Here is the caller graph for this function:

bool mp::gamebrowser::game_matches_filter ( const game_item i,
const config cfg 
)
SDL_Rect mp::gamebrowser::get_item_rect ( size_t  index  )  const

Definition at line 89 of file multiplayer_lobby.cpp.

References gui2::create_rect(), gui::scrollarea::inner_location(), row_height(), and visible_range_.

Referenced by draw_contents(), and handle_event().

Here is the call graph for this function:

Here is the caller graph for this function:

void mp::gamebrowser::handle_event ( const SDL_Event &  event  )  [virtual]
void mp::gamebrowser::reset_selection (  )  [inline]

Reimplemented from gui::menu.

Definition at line 107 of file multiplayer_lobby.hpp.

References double_clicked_.

Referenced by mp::lobby::process_event().

Here is the caller graph for this function:

unsigned int mp::gamebrowser::row_height (  )  const [inline, protected]

Definition at line 113 of file multiplayer_lobby.hpp.

References gui::menu::style::get_thickness(), item_height_, and gui::menu::style_.

Referenced by get_item_rect(), scroll(), set_game_items(), and set_inner_location().

Here is the call graph for this function:

Here is the caller graph for this function:

void mp::gamebrowser::scroll ( unsigned int  pos  )  [virtual]

Reimplemented from gui::menu.

Definition at line 80 of file multiplayer_lobby.cpp.

References games_, gui::scrollarea::inner_location(), row_height(), gui::widget::set_dirty(), and visible_range_.

Referenced by set_game_items(), and set_inner_location().

Here is the call graph for this function:

Here is the caller graph for this function:

void mp::gamebrowser::select_game ( const std::string &  id  ) 

Definition at line 621 of file multiplayer_lobby.cpp.

References gui::scrollarea::adjust_position(), empty(), games_, selected_, and gui::widget::set_dirty().

Referenced by mp::lobby::process_event().

Here is the call graph for this function:

Here is the caller graph for this function:

bool mp::gamebrowser::selected (  )  const [inline]

Definition at line 106 of file multiplayer_lobby.hpp.

References double_clicked_, and empty().

Referenced by mp::lobby::process_event().

Here is the call graph for this function:

Here is the caller graph for this function:

game_item mp::gamebrowser::selected_game (  )  [inline]

Definition at line 109 of file multiplayer_lobby.hpp.

References games_, and selected_.

Referenced by mp::lobby::process_event(), and set_game_items().

Here is the caller graph for this function:

int mp::gamebrowser::selection (  )  const [inline]

Reimplemented from gui::menu.

Definition at line 108 of file multiplayer_lobby.hpp.

References selected_.

Referenced by mp::lobby::process_event().

Here is the caller graph for this function:

bool mp::gamebrowser::selection_is_joinable (  )  const [inline]

Definition at line 102 of file multiplayer_lobby.hpp.

References empty(), games_, and selected_.

Referenced by mp::lobby::gamelist_updated(), handle_event(), and mp::lobby::process_event().

Here is the call graph for this function:

Here is the caller graph for this function:

bool mp::gamebrowser::selection_is_observable (  )  const [inline]

Definition at line 105 of file multiplayer_lobby.hpp.

References empty(), games_, preferences::is_authenticated(), and selected_.

Referenced by mp::lobby::gamelist_updated(), handle_event(), and mp::lobby::process_event().

Here is the call graph for this function:

Here is the caller graph for this function:

void mp::gamebrowser::set_game_items ( const config cfg,
const config game_config 
)
void mp::gamebrowser::set_inner_location ( const SDL_Rect &  rect  )  [virtual]

Reimplemented from gui::menu.

Definition at line 72 of file multiplayer_lobby.cpp.

References gui::widget::bg_register(), games_, gui::scrollarea::get_position(), row_height(), scroll(), gui::scrollarea::set_full_size(), and gui::scrollarea::set_shown_size().

Here is the call graph for this function:

void mp::gamebrowser::set_item_height ( unsigned int  height  ) 

Member Data Documentation

Reimplemented from gui::menu.

Definition at line 135 of file multiplayer_lobby.hpp.

Referenced by handle_event(), reset_selection(), and selected().

std::vector<game_item> mp::gamebrowser::games_ [private]

Definition at line 115 of file multiplayer_lobby.hpp.

Referenced by draw_row().

Definition at line 128 of file multiplayer_lobby.hpp.

Referenced by draw_row().

Definition at line 129 of file multiplayer_lobby.hpp.

Reimplemented from gui::menu.

Definition at line 136 of file multiplayer_lobby.hpp.

Referenced by handle_event().

unsigned int mp::gamebrowser::item_height_ [private]

Reimplemented from gui::menu.

Definition at line 125 of file multiplayer_lobby.hpp.

Referenced by row_height(), and set_game_items().

Reimplemented from gui::menu.

Definition at line 137 of file multiplayer_lobby.hpp.

Referenced by handle_event().

Definition at line 123 of file multiplayer_lobby.hpp.

Referenced by set_game_items().

int mp::gamebrowser::margin_ [private]

Definition at line 126 of file multiplayer_lobby.hpp.

Referenced by draw_contents(), and draw_row().

Definition at line 127 of file multiplayer_lobby.hpp.

Referenced by draw_row(), and set_game_items().

Definition at line 120 of file multiplayer_lobby.hpp.

Referenced by draw_row().

Definition at line 119 of file multiplayer_lobby.hpp.

Referenced by draw_row().

std::vector<size_t> mp::gamebrowser::redraw_items_ [private]

Definition at line 133 of file multiplayer_lobby.hpp.

size_t mp::gamebrowser::selected_ [private]

Definition at line 121 of file multiplayer_lobby.hpp.

Referenced by draw_row().

Definition at line 118 of file multiplayer_lobby.hpp.

Referenced by draw_row().

std::pair<size_t, size_t> mp::gamebrowser::visible_range_ [private]

Definition at line 117 of file multiplayer_lobby.hpp.

Referenced by draw_row().

std::vector<int> mp::gamebrowser::widths_ [private]

Definition at line 134 of file multiplayer_lobby.hpp.

Definition at line 116 of file multiplayer_lobby.hpp.

Referenced by draw_row().


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:24:51 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs