void tlobby_main::post_build(twindow& window) { /** @todo Should become a global hotkey after 1.8, then remove it here. */ window.register_hotkey(hotkey::HOTKEY_FULLSCREEN, std::bind(fullscreen, std::ref(window.video()))); /*** Local hotkeys. ***/ window.register_hotkey(hotkey::HOTKEY_PREFERENCES, [this](event::tdispatcher& win, hotkey::HOTKEY_COMMAND)->bool { show_preferences_button_callback(dynamic_cast<twindow&>(win)); return true; }); }
void tlobby_main::post_build(twindow& window) { /** @todo Should become a global hotkey after 1.8, then remove it here. */ window.register_hotkey(hotkey::HOTKEY_FULLSCREEN, std::bind(fullscreen, std::ref(window.video()))); /*** Local hotkeys. ***/ preferences_wrapper_ = std::bind(&tlobby_main::show_preferences_button_callback, this, std::ref(window)); window.register_hotkey( hotkey::HOTKEY_PREFERENCES, std::bind(function_wrapper<bool, std::function<void()> >, true, std::cref(preferences_wrapper_))); }
void ttitle_screen::post_build(CVideo& video, twindow& window) { /** @todo Should become a title screen hotkey. */ window.register_hotkey(hotkey::TITLE_SCREEN__RELOAD_WML , boost::bind( &hotkey , boost::ref(window) , RELOAD_GAME_DATA)); window.register_hotkey(hotkey::HOTKEY_FULLSCREEN , boost::bind(fullscreen, boost::ref(video))); window.register_hotkey(hotkey::HOTKEY_LANGUAGE , boost::bind( &hotkey , boost::ref(window) , CHANGE_LANGUAGE)); window.register_hotkey(hotkey::HOTKEY_LOAD_GAME , boost::bind( &hotkey , boost::ref(window) , LOAD_GAME)); window.register_hotkey(hotkey::HOTKEY_HELP , boost::bind( &hotkey , boost::ref(window) , SHOW_HELP)); window.register_hotkey(hotkey::HOTKEY_PREFERENCES , boost::bind( &hotkey , boost::ref(window) , 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) , TUTORIAL)); window.register_hotkey(hotkey::TITLE_SCREEN__TUTORIAL , boost::bind( &hotkey , boost::ref(window) , TUTORIAL)); window.register_hotkey(hotkey::TITLE_SCREEN__CAMPAIGN , boost::bind( &hotkey , boost::ref(window) , NEW_CAMPAIGN)); window.register_hotkey(hotkey::TITLE_SCREEN__MULTIPLAYER , boost::bind( &hotkey , boost::ref(window) , MULTIPLAYER)); window.register_hotkey(hotkey::TITLE_SCREEN__ADDONS , boost::bind( &hotkey , boost::ref(window) , GET_ADDONS)); window.register_hotkey(hotkey::TITLE_SCREEN__EDITOR , boost::bind( &hotkey , boost::ref(window) , START_MAP_EDITOR)); window.register_hotkey(hotkey::TITLE_SCREEN__CREDITS , boost::bind( &hotkey , boost::ref(window) , SHOW_ABOUT)); window.register_hotkey(hotkey::HOTKEY_QUIT_GAME , boost::bind( &hotkey , boost::ref(window) , QUIT_GAME)); }
void ttitle_screen::post_build(twindow& window) { /** @todo Should become a title screen hotkey. */ window.register_hotkey( hotkey::TITLE_SCREEN__RELOAD_WML, std::bind(&hotkey, std::ref(window), RELOAD_GAME_DATA)); window.register_hotkey(hotkey::HOTKEY_FULLSCREEN, std::bind(fullscreen, std::ref(window.video()))); window.register_hotkey( hotkey::HOTKEY_LANGUAGE, std::bind(&hotkey, std::ref(window), CHANGE_LANGUAGE)); window.register_hotkey(hotkey::HOTKEY_LOAD_GAME, std::bind(&hotkey, std::ref(window), LOAD_GAME)); window.register_hotkey(hotkey::HOTKEY_HELP, std::bind(&hotkey, std::ref(window), SHOW_HELP)); window.register_hotkey( hotkey::HOTKEY_PREFERENCES, std::bind(&hotkey, std::ref(window), EDIT_PREFERENCES)); std::function<void()> next_tip_wrapper = std::bind( &ttitle_screen::update_tip, this, std::ref(window), true); window.register_hotkey( hotkey::TITLE_SCREEN__NEXT_TIP, std::bind(function_wrapper<bool, std::function<void()> >, true, next_tip_wrapper)); std::function<void()> previous_tip_wrapper = std::bind( &ttitle_screen::update_tip, this, std::ref(window), false); window.register_hotkey( hotkey::TITLE_SCREEN__PREVIOUS_TIP, std::bind(function_wrapper<bool, std::function<void()> >, true, previous_tip_wrapper)); window.register_hotkey(hotkey::TITLE_SCREEN__TUTORIAL, std::bind(&hotkey, std::ref(window), TUTORIAL)); window.register_hotkey( hotkey::TITLE_SCREEN__CAMPAIGN, std::bind(&hotkey, std::ref(window), NEW_CAMPAIGN)); window.register_hotkey( hotkey::TITLE_SCREEN__MULTIPLAYER, std::bind(&hotkey, std::ref(window), MULTIPLAYER)); window.register_hotkey( hotkey::TITLE_SCREEN__ADDONS, std::bind(&hotkey, std::ref(window), GET_ADDONS)); window.register_hotkey(hotkey::TITLE_SCREEN__CORES, std::bind(&hotkey, std::ref(window), CORES)); window.register_hotkey( hotkey::TITLE_SCREEN__EDITOR, std::bind(&hotkey, std::ref(window), START_MAP_EDITOR)); window.register_hotkey( hotkey::TITLE_SCREEN__CREDITS, std::bind(&hotkey, std::ref(window), SHOW_ABOUT)); window.register_hotkey(hotkey::HOTKEY_QUIT_TO_DESKTOP, std::bind(&hotkey, std::ref(window), QUIT_GAME)); window.register_hotkey( hotkey::LUA_CONSOLE, std::bind(&launch_lua_console, std::ref(window))); }