Add new hotkeys to the title screen buttons.

This commit is contained in:
Mark de Wever 2010-09-20 19:29:48 +00:00
parent 9139cee975
commit 0e5225043a
4 changed files with 145 additions and 0 deletions

View file

@ -282,4 +282,14 @@
command=title_screen__reload_wml
key=F5
[/hotkey]
[hotkey]
command=title_screen__next_tip
key=right
[/hotkey]
[hotkey]
command=title_screen__previous_tip
key=left
[/hotkey]
#undef IF_APPLE_CMD_ELSE_CTRL

View file

@ -210,6 +210,72 @@ void ttitle_screen::post_build(CVideo& video, twindow& window)
&hotkey
, boost::ref(window)
, gui::EDIT_PREFERENCES));
static const boost::function<void()> next_tip_wrapper = boost::bind(
&ttitle_screen::update_tip
, this
, boost::ref(window)
, true);
window.register_hotkey(hotkey::TITLE_SCREEN__NEXT_TIP
, boost::bind(function_wrapper<bool, boost::function<void()> >
, true
, boost::cref(next_tip_wrapper)));
static const boost::function<void()> previous_tip_wrapper = boost::bind(
&ttitle_screen::update_tip
, this
, boost::ref(window)
, false);
window.register_hotkey(hotkey::TITLE_SCREEN__PREVIOUS_TIP
, boost::bind(function_wrapper<bool, boost::function<void()> >
, true
, boost::cref(previous_tip_wrapper)));
window.register_hotkey(hotkey::TITLE_SCREEN__TUTORIAL
, boost::bind(
&hotkey
, boost::ref(window)
, gui::TUTORIAL));
window.register_hotkey(hotkey::TITLE_SCREEN__TUTORIAL
, boost::bind(
&hotkey
, boost::ref(window)
, gui::TUTORIAL));
window.register_hotkey(hotkey::TITLE_SCREEN__CAMPAIGN
, boost::bind(
&hotkey
, boost::ref(window)
, gui::NEW_CAMPAIGN));
window.register_hotkey(hotkey::TITLE_SCREEN__MULTIPLAYER
, boost::bind(
&hotkey
, boost::ref(window)
, gui::MULTIPLAYER));
window.register_hotkey(hotkey::TITLE_SCREEN__ADDONS
, boost::bind(
&hotkey
, boost::ref(window)
, gui::GET_ADDONS));
#ifndef DISABLE_EDITOR
window.register_hotkey(hotkey::TITLE_SCREEN__EDITOR
, boost::bind(
&hotkey
, boost::ref(window)
, gui::START_MAP_EDITOR));
#endif
window.register_hotkey(hotkey::TITLE_SCREEN__CREDITS
, boost::bind(
&hotkey
, boost::ref(window)
, gui::SHOW_ABOUT));
}
void ttitle_screen::pre_show(CVideo& video, twindow& window)

View file

@ -211,6 +211,65 @@ const struct {
, true
, hotkey::SCOPE_GENERAL
},
{
hotkey::TITLE_SCREEN__NEXT_TIP
, "title_screen__next_tip"
, N_("Next tip of the day")
, false
, hotkey::SCOPE_GENERAL
},
{
hotkey::TITLE_SCREEN__PREVIOUS_TIP
, "title_screen__previous_tip"
, N_("Previous tip of the day")
, false
, hotkey::SCOPE_GENERAL
},
{
hotkey::TITLE_SCREEN__TUTORIAL
, "title_screen__tutorial"
, N_("Start tutorial")
, false
, hotkey::SCOPE_GENERAL
},
{
hotkey::TITLE_SCREEN__CAMPAIGN
, "title_screen__campaign"
, N_("Start a campaign")
, false
, hotkey::SCOPE_GENERAL
},
{
hotkey::TITLE_SCREEN__MULTIPLAYER
, "title_screen__multiplayer"
, N_("Start a multiplayer game")
, false
, hotkey::SCOPE_GENERAL
},
{
hotkey::TITLE_SCREEN__ADDONS
, "title_screen__addons"
, N_("Manage addons")
, false
, hotkey::SCOPE_GENERAL
},
#ifndef DISABLE_EDITOR
{
hotkey::TITLE_SCREEN__EDITOR
, "title_screen__editor"
, N_("Start the editor")
, false
, hotkey::SCOPE_GENERAL
},
#endif
{
hotkey::TITLE_SCREEN__CREDITS
, "title_screen__credits"
, N_("Show the credits")
, false
, hotkey::SCOPE_GENERAL
},
{ hotkey::HOTKEY_NULL, NULL, NULL, true, hotkey::SCOPE_GENERAL }
};

View file

@ -110,6 +110,16 @@ enum HOTKEY_COMMAND {
#endif
/* Gui2 specific hotkeys. */
TITLE_SCREEN__RELOAD_WML,
TITLE_SCREEN__NEXT_TIP,
TITLE_SCREEN__PREVIOUS_TIP,
TITLE_SCREEN__TUTORIAL,
TITLE_SCREEN__CAMPAIGN,
TITLE_SCREEN__MULTIPLAYER,
TITLE_SCREEN__ADDONS,
#ifndef DISABLE_EDITOR
TITLE_SCREEN__EDITOR,
#endif
TITLE_SCREEN__CREDITS,
HOTKEY_NULL
};