Add a F5 hotkey to the gui2 title screen.

This makes 2010-09-02T20:02:54Z!alinkmaze@gmail.com no longer needed and that commit will be
reverted with the next commit.
This commit is contained in:
Mark de Wever 2010-09-12 20:07:34 +00:00
parent 846f06de11
commit d8c362bff8
5 changed files with 33 additions and 0 deletions

View file

@ -278,4 +278,8 @@
key="page down"
[/hotkey]
[hotkey]
command=title_screen__reload_wml
key=F5
[/hotkey]
#undef IF_APPLE_CMD_ELSE_CTRL

View file

@ -110,6 +110,13 @@ void show_language_dialog(CVideo& video, twindow& window)
REGISTER_WINDOW(title_screen)
static bool hotkey(twindow& window, const gui::TITLE_RESULT title_result)
{
window.set_retval(static_cast<twindow::tretval>(title_result));
return true;
}
ttitle_screen::ttitle_screen()
: video_(NULL)
, tips_()
@ -149,6 +156,16 @@ static void animate_logo(
}
}
void ttitle_screen::post_build(CVideo&, twindow& window)
{
/** @todo Should become a title screen hotkey. */
window.register_hotkey(hotkey::TITLE_SCREEN__RELOAD_WML
, boost::bind(
&hotkey
, boost::ref(window)
, gui::RELOAD_GAME_DATA));
}
void ttitle_screen::pre_show(CVideo& video, twindow& window)
{
assert(!video_);

View file

@ -38,6 +38,9 @@ private:
/** Inherited from tdialog, implemented by REGISTER_WINDOW. */
virtual const std::string& window_id() const;
/** Inherited from tdialog. */
virtual void post_build(CVideo& video, twindow& window);
/** Inherited from tdialog. */
void pre_show(CVideo& video, twindow& window);

View file

@ -203,6 +203,13 @@ const struct {
{ hotkey::HOTKEY_USER_CMD_2, "usercommand#2", N_("User-Command#2"), false, hotkey::SCOPE_GAME },
{ hotkey::HOTKEY_USER_CMD_3, "usercommand#3", N_("User-Command#3"), false, hotkey::SCOPE_GAME },
#endif
{
hotkey::TITLE_SCREEN__RELOAD_WML
, "title_screen__reload_wml"
, N_("Refresh WML")
, true
, hotkey::SCOPE_GENERAL
},
{ hotkey::HOTKEY_NULL, NULL, NULL, true, hotkey::SCOPE_GENERAL }
};

View file

@ -107,6 +107,8 @@ enum HOTKEY_COMMAND {
HOTKEY_USER_CMD_2,
HOTKEY_USER_CMD_3,
#endif
/* Gui2 specific hotkeys. */
TITLE_SCREEN__RELOAD_WML,
HOTKEY_NULL
};