#include <contrib_world_menu.hpp>
Inherits Menu.
Public Member Functions | |
ContribWorldMenu (const World ¤t_world) | |
void | check_menu () |
Private Member Functions | |
ContribWorldMenu (const ContribWorldMenu &) | |
ContribWorldMenu & | operator= (const ContribWorldMenu &) |
Private Attributes | |
const World & | m_current_world |
Definition at line 24 of file contrib_world_menu.hpp.
ContribWorldMenu::ContribWorldMenu | ( | const World & | current_world | ) |
Definition at line 27 of file contrib_world_menu.cpp.
References _(), Menu::add_back(), Menu::add_entry(), Menu::add_hl(), Menu::add_label(), World::get_level_filename(), TitleScreen::get_level_name(), World::get_num_levels(), World::get_title(), and m_current_world.
00027 : 00028 m_current_world(current_world) 00029 { 00030 add_label(m_current_world.get_title()); 00031 add_hl(); 00032 00033 for (unsigned int i = 0; i < m_current_world.get_num_levels(); ++i) 00034 { 00036 std::string filename = m_current_world.get_level_filename(i); 00037 std::string title = TitleScreen::get_level_name(filename); 00038 add_entry(i, title); 00039 } 00040 00041 add_hl(); 00042 add_back(_("Back")); 00043 }
ContribWorldMenu::ContribWorldMenu | ( | const ContribWorldMenu & | ) | [private] |
void ContribWorldMenu::check_menu | ( | ) | [virtual] |
Implements Menu.
Definition at line 46 of file contrib_world_menu.cpp.
References Menu::check(), g_screen_manager, Menu::get_item_by_id(), World::get_level_filename(), World::get_player_status(), m_current_world, MN_ACTION, ScreenManager::push_screen(), sound_manager, and SoundManager::stop_music().
00047 { 00048 int index = check(); 00049 if (index != -1) { 00050 if (get_item_by_id(index).kind == MN_ACTION) 00051 { 00052 sound_manager->stop_music(); 00053 GameSession* session = new GameSession(m_current_world.get_level_filename(index), m_current_world.get_player_status()); 00054 g_screen_manager->push_screen(session); 00055 } 00056 } 00057 }
ContribWorldMenu& ContribWorldMenu::operator= | ( | const ContribWorldMenu & | ) | [private] |
const World& ContribWorldMenu::m_current_world [private] |
Definition at line 27 of file contrib_world_menu.hpp.
Referenced by check_menu(), and ContribWorldMenu().