The Battle for Wesnoth  1.15.0-dev
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
gui2::dialogs::title_screen Class Reference

This class implements the title screen. More...

#include <title_screen.hpp>

Inheritance diagram for gui2::dialogs::title_screen:
Inheritance graph

Public Types

enum  result {
  REDRAW_BACKGROUND = 0, LAUNCH_GAME, MP_CONNECT, MP_HOST,
  MP_LOCAL, MAP_EDITOR, SHOW_ABOUT, QUIT_GAME,
  RELOAD_GAME_DATA
}
 Values for actions which leave the title screen. More...
 

Public Member Functions

 title_screen (game_launcher &game)
 
 ~title_screen ()
 
- Public Member Functions inherited from gui2::dialogs::modal_dialog
 modal_dialog ()
 
virtual ~modal_dialog ()
 
bool show (const unsigned auto_close_time=0)
 Shows the window. More...
 
windowget_window () const
 Returns a pointer to the dialog's window. More...
 
int get_retval () const
 
void set_always_save_fields (const bool always_save_fields)
 
void set_allow_plugin_skip (const bool allow_plugin_skip)
 
void set_show_even_without_video (const bool show_even_without_video)
 

Private Member Functions

virtual const std::string & window_id () const override
 Inherited from modal_dialog, implemented by REGISTER_DIALOG. More...
 
virtual void pre_show (window &window) override
 Inherited from modal_dialog. More...
 
void on_resize (window &window)
 
void update_tip (window &window, const bool previous)
 Updates the tip of day widget. More...
 
void show_debug_clock_window ()
 Shows the debug clock. More...
 
void hotkey_callback_select_tests (window &window)
 
void button_callback_multiplayer (window &window)
 
void button_callback_cores ()
 

Private Attributes

std::unique_ptr< modeless_dialogdebug_clock_
 Holds the debug clock dialog. More...
 
game_launchergame_
 

Additional Inherited Members

- Protected Member Functions inherited from gui2::dialogs::modal_dialog
field_boolregister_bool (const std::string &id, const bool mandatory, const std::function< bool()> callback_load_value=nullptr, const std::function< void(bool)> callback_save_value=nullptr, const std::function< void(widget &)> callback_change=nullptr, const bool initial_fire=false)
 Creates a new boolean field. More...
 
field_boolregister_bool (const std::string &id, const bool mandatory, bool &linked_variable, const std::function< void(widget &)> callback_change=nullptr, const bool initial_fire=false)
 Creates a new boolean field. More...
 
field_integerregister_integer (const std::string &id, const bool mandatory, const std::function< int()> callback_load_value=nullptr, const std::function< void(int)> callback_save_value=nullptr)
 Creates a new integer field. More...
 
field_integerregister_integer (const std::string &id, const bool mandatory, int &linked_variable)
 Creates a new integer field. More...
 
field_textregister_text (const std::string &id, const bool mandatory, const std::function< std::string()> callback_load_value=nullptr, const std::function< void(const std::string &)> callback_save_value=nullptr, const bool capture_focus=false)
 Creates a new text field. More...
 
field_textregister_text (const std::string &id, const bool mandatory, std::string &linked_variable, const bool capture_focus=false)
 Creates a new text field. More...
 
field_labelregister_label (const std::string &id, const bool mandatory, const std::string &text, const bool use_markup=false)
 Registers a new styled_widget as a label. More...
 
field_labelregister_image (const std::string &id, const bool mandatory, const std::string &filename)
 Registers a new styled_widget as image. More...
 
- Protected Attributes inherited from gui2::dialogs::modal_dialog
window_ptr_t window_
 The window object build for this dialog. More...
 

Detailed Description

This class implements the title screen.

The menu buttons return a result back to the caller with the button pressed. So at the moment it only handles the tips itself.

Definition at line 37 of file title_screen.hpp.

Member Enumeration Documentation

◆ result

Values for actions which leave the title screen.

Actions that merely show a dialog are not included here.

Enumerator
REDRAW_BACKGROUND 
LAUNCH_GAME 
MP_CONNECT 
MP_HOST 
MP_LOCAL 
MAP_EDITOR 
SHOW_ABOUT 
QUIT_GAME 
RELOAD_GAME_DATA 

Definition at line 48 of file title_screen.hpp.

Constructor & Destructor Documentation

◆ title_screen()

gui2::dialogs::title_screen::title_screen ( game_launcher game)

Definition at line 134 of file title_screen.cpp.

◆ ~title_screen()

gui2::dialogs::title_screen::~title_screen ( )

Definition at line 142 of file title_screen.cpp.

Member Function Documentation

◆ button_callback_cores()

void gui2::dialogs::title_screen::button_callback_cores ( )
private

◆ button_callback_multiplayer()

void gui2::dialogs::title_screen::button_callback_multiplayer ( window window)
private

◆ hotkey_callback_select_tests()

void gui2::dialogs::title_screen::hotkey_callback_select_tests ( window window)
private

◆ on_resize()

void gui2::dialogs::title_screen::on_resize ( window window)
private

Definition at line 394 of file title_screen.cpp.

References REDRAW_BACKGROUND, and gui2::window::set_retval().

Referenced by pre_show().

◆ pre_show()

void gui2::dialogs::title_screen::pre_show ( window window)
overrideprivatevirtual

Inherited from modal_dialog.

Reimplemented from gui2::dialogs::modal_dialog.

Definition at line 190 of file title_screen.cpp.

References gui2::multi_page::add_page(), button_callback_cores(), button_callback_multiplayer(), game_launcher::change_language(), game_launcher::clear_loaded_game(), gui2::event::dispatcher::connect_signal(), e, ERR_CF, image::flush_cache(), gui2::event::dispatcher::front_child, game_, game_config::images::game_logo, game_config::images::game_logo_background, game_config::images::game_title, game_config::images::game_title_background, game_config_manager::get(), gui2::styled_widget::get_canvas(), hotkey_callback_select_tests(), hotkey::HOTKEY_HELP, hotkey::HOTKEY_LANGUAGE, hotkey::HOTKEY_LOAD_GAME, hotkey::HOTKEY_NULL, hotkey::HOTKEY_PREFERENCES, hotkey::HOTKEY_QUIT_TO_DESKTOP, gui2::widget::invisible, LAUNCH_GAME, gui2::dialogs::launch_lua_console(), game_launcher::load_game(), hotkey::LUA_CONSOLE, manage_addons(), MAP_EDITOR, game_launcher::new_campaign(), on_resize(), QUIT_GAME, gui2::dialogs::register_button(), gui2::event::dispatcher::register_hotkey(), game_config_manager::reload_changed_game_config(), RELOAD_GAME_DATA, t_string::reset_translations(), game_config::revision, gui2::event::SDL_MOUSE_MOTION, gui2::event::SDL_VIDEO_RESIZE, gui2::window::set_click_dismiss(), gui2::window::set_enter_disabled(), gui2::window::set_escape_disabled(), gui2::window::set_retval(), game_launcher::set_tutorial(), gui2::canvas::set_variable(), SHOW_ABOUT, gui2::dialogs::show_debug_clock_button, show_debug_clock_window(), gui2::show_error_message(), help::show_help(), game_launcher::show_preferences(), gui2::tip_of_the_day::shuffle(), utf8::size(), gui2::dialogs::tip::tip(), gui2::settings::tips, hotkey::TITLE_SCREEN__ADDONS, hotkey::TITLE_SCREEN__CAMPAIGN, hotkey::TITLE_SCREEN__CORES, hotkey::TITLE_SCREEN__CREDITS, hotkey::TITLE_SCREEN__EDITOR, hotkey::TITLE_SCREEN__MULTIPLAYER, hotkey::TITLE_SCREEN__NEXT_TIP, hotkey::TITLE_SCREEN__PREVIOUS_TIP, hotkey::TITLE_SCREEN__RELOAD_WML, hotkey::TITLE_SCREEN__TEST, hotkey::TITLE_SCREEN__TUTORIAL, update_tip(), VGETTEXT, gui2::widget::visible, game::error::what(), and WRN_CF.

◆ show_debug_clock_window()

void gui2::dialogs::title_screen::show_debug_clock_window ( )
private

Shows the debug clock.

Definition at line 422 of file title_screen.cpp.

References debug_clock_, and gui2::dialogs::show_debug_clock_button.

Referenced by pre_show().

◆ update_tip()

void gui2::dialogs::title_screen::update_tip ( window window,
const bool  previous 
)
private

Updates the tip of day widget.

Parameters
windowThe window being shown.
previousShow the previous tip, else shows the next one.

Definition at line 399 of file title_screen.cpp.

References gui2::multi_page::get_page_count(), gui2::multi_page::get_selected_page(), gui2::multi_page::select_page(), and gui2::settings::tips.

Referenced by pre_show().

◆ window_id()

virtual const std::string& gui2::dialogs::title_screen::window_id ( ) const
overrideprivatevirtual

Inherited from modal_dialog, implemented by REGISTER_DIALOG.

Implements gui2::dialogs::modal_dialog.

Member Data Documentation

◆ debug_clock_

std::unique_ptr<modeless_dialog> gui2::dialogs::title_screen::debug_clock_
private

Holds the debug clock dialog.

Definition at line 98 of file title_screen.hpp.

Referenced by show_debug_clock_window().

◆ game_

game_launcher& gui2::dialogs::title_screen::game_
private

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