diff --git a/data/gui/default/widget/button_default.cfg b/data/gui/default/widget/button_default.cfg index 746203fa..22c4d8ff 100644 --- a/data/gui/default/widget/button_default.cfg +++ b/data/gui/default/widget/button_default.cfg @@ -26,8 +26,10 @@ [draw] [image] - w = "(width)" - h = "(height)" + x = 3 + y = 2 + w = "(width - 6)" + h = "(height - 4)" name = "buttons/{BASE_NAME}.png" [/image] @@ -42,8 +44,10 @@ [draw] [image] - w = "(width)" - h = "(height)" + x = 3 + y = 2 + w = "(width - 6)" + h = "(height - 4)" name = "buttons/{BASE_NAME}-disabled.png" [/image] @@ -58,8 +62,10 @@ [draw] [image] - w = "(width)" - h = "(height)" + x = 3 + y = 2 + w = "(width - 6)" + h = "(height - 4)" name = "buttons/{BASE_NAME}-pressed.png" [/image] @@ -74,8 +80,10 @@ [draw] [image] - w = "(width)" - h = "(height)" + x = 3 + y = 2 + w = "(width - 6)" + h = "(height - 4)" name = "buttons/{BASE_NAME}-active.png" [/image] @@ -91,23 +99,21 @@ [button_definition] id = "default" - description = "Default button" + description = "Touch button" # Tiny gui sizes haven't been tested yet so might need some tuning. - {_GUI_RESOLUTION ({GUI_TINY__RESOLUTION}) 20 54 11 6 2 ({GUI_TINY__FONT_SIZE__SMALL}) "button" } - {_GUI_RESOLUTION () 40 108 22 13 4 ({GUI_NORMAL__FONT_SIZE__SMALL}) "button" } + {_GUI_RESOLUTION () 114 114 44 0 22 ({GUI_NORMAL__FONT_SIZE__DEFAULT}) "button" } [/button_definition] [button_definition] id = "transparent" - description = "Default transparent button" + description = "Touch transparent button" # Tiny gui sizes haven't been tested yet so might need some tuning. - {_GUI_RESOLUTION ({GUI_TINY__RESOLUTION}) 20 54 11 6 2 ({GUI_TINY__FONT_SIZE__SMALL}) "button_transparent" } - {_GUI_RESOLUTION () 40 108 22 13 4 ({GUI_NORMAL__FONT_SIZE__SMALL}) "button_transparent" } + {_GUI_RESOLUTION () 114 114 44 0 22 ({GUI_NORMAL__FONT_SIZE__DEFAULT}) "button_transparent" } [/button_definition] -#undef _GUI_RESOLUTION +#undef _GUI_RESOLUTION diff --git a/data/gui/default/widget/button_touch.cfg b/data/gui/default/widget/button_touch.cfg new file mode 100644 index 00000000..369d549b --- /dev/null +++ b/data/gui/default/widget/button_touch.cfg @@ -0,0 +1,152 @@ +#textdomain wesnoth-lib +### +### Definition of the default button. +### + +#define _GUI_BUTTON_TEXT FONT_SIZE FONT_STYLE FONT_COLOR + [text] + x = {GUI__TEXT_HORIZONTALLY_CENTRED} + y = {GUI__TEXT_VERTICALLY_CENTRED} + w = "(text_width)" + h = "(text_height)" + font_size = {FONT_SIZE} + font_style = {FONT_STYLE} + colour = {FONT_COLOR} + text = "(text)" + [/text] +#enddef + +#define _GUI_BUTTON_PRESSED_TEXT FONT_SIZE FONT_STYLE FONT_COLOR + [text] + x = "(if(text_width < width, ((width - text_width ) / 2) + 1, 0))" + y = "(if(text_height < height, ((height - text_height + 1) / 2) + 1, 0))" + w = "(text_width)" + h = "(text_height)" + font_size = {FONT_SIZE} + font_style = {FONT_STYLE} + colour = {FONT_COLOR} + text = "(text)" + [/text] +#enddef + + +#define _GUI_RESOLUTION RESOLUTION MIN_WIDTH DEFAULT_WIDTH HEIGHT EXTRA_WIDTH EXTRA_HEIGHT FONT_SIZE BASE_NAME + [resolution] + + {RESOLUTION} + + min_width = {MIN_WIDTH} + min_height = {HEIGHT} + + default_width = {DEFAULT_WIDTH} + default_height = {HEIGHT} + + max_width = 0 + max_height = {HEIGHT} + + text_extra_width = {EXTRA_WIDTH} + text_extra_height = {EXTRA_HEIGHT} + text_font_size = {FONT_SIZE} + + [state_enabled] + + [draw] + + [image] + x = 3 + y = 2 + w = "(width - 6)" + h = "(height - 4)" + name = "buttons/{BASE_NAME}.png" + [/image] + + {_GUI_BUTTON_TEXT ({FONT_SIZE}) () ({GUI__FONT_COLOR_ENABLED__TITLE})} + + [/draw] + + [/state_enabled] + + [state_disabled] + + [draw] + + [image] + x = 3 + y = 2 + w = "(width - 6)" + h = "(height - 4)" + name = "buttons/{BASE_NAME}-disabled.png" + [/image] + + {GUI__CENTERED_TEXT ({FONT_SIZE}) () ({GUI__FONT_COLOR_DISABLED__TITLE})} + [/draw] + + [/state_disabled] + + [state_pressed] + + [draw] + + [image] + x = 3 + y = 2 + w = "(width - 6)" + h = "(height - 4)" + name = "buttons/{BASE_NAME}-pressed.png" + [/image] + + {_GUI_BUTTON_PRESSED_TEXT ({FONT_SIZE}) () ({GUI__FONT_COLOR_ENABLED__TITLE})} + + [/draw] + + [/state_pressed] + + [state_focussed] + + [draw] + + [image] + x = 3 + y = 2 + w = "(width - 6)" + h = "(height - 4)" + name = "buttons/{BASE_NAME}-active.png" + [/image] + + {GUI__CENTERED_TEXT ({FONT_SIZE}) () ({GUI__FONT_COLOR_ENABLED__TITLE})} + + [/draw] + + [/state_focussed] + + [/resolution] +#enddef + +[button_definition] + id = "touch_fixed" + description = "Touch button" + {_GUI_RESOLUTION () 114 114 44 0 0 ({GUI_NORMAL__FONT_SIZE__DEFAULT}) "button" } +[/button_definition] + +[button_definition] + id = "touch_transparent_fixed" + description = "Touch transparent button" + {_GUI_RESOLUTION () 114 114 44 0 0 ({GUI_NORMAL__FONT_SIZE__DEFAULT}) "button_transparent" } +[/button_definition] + +[button_definition] + id = "touch" + description = "Touch button" + + {_GUI_RESOLUTION () 114 114 44 50 0 ({GUI_NORMAL__FONT_SIZE__DEFAULT}) "button" } +[/button_definition] + +[button_definition] + + id = "touch_transparent" + description = "Touch transparent button" + {_GUI_RESOLUTION () 114 114 44 50 0 ({GUI_NORMAL__FONT_SIZE__DEFAULT}) "button_transparent" } + +[/button_definition] + +#undef _GUI_RESOLUTION diff --git a/data/gui/default/window/game_load.cfg b/data/gui/default/window/game_load.cfg index df9bd1ce..7ce87987 100644 --- a/data/gui/default/window/game_load.cfg +++ b/data/gui/default/window/game_load.cfg @@ -414,7 +414,7 @@ [/row] [row] - grow_factor = 0 + grow_factor = 1 [column] grow_factor = 1 @@ -432,7 +432,7 @@ [button] id = "ok" - definition = "default" + definition = "touch" size_text = _ "OK" label = _ "OK" @@ -446,7 +446,7 @@ [button] id = "cancel" - definition = "default" + definition = "touch" label = _ "Cancel" [/button] diff --git a/data/gui/default/window/title_screen.cfg b/data/gui/default/window/title_screen.cfg index f95bad52..05549b0f 100644 --- a/data/gui/default/window/title_screen.cfg +++ b/data/gui/default/window/title_screen.cfg @@ -199,7 +199,7 @@ [column] border = "all" - border_size = 5 + border_size = 0 horizontal_grow = "true" [button] id = {ID} diff --git a/data/gui/default/window/touch_game_menu.cfg b/data/gui/default/window/touch_game_menu.cfg new file mode 100644 index 00000000..7929e1f3 --- /dev/null +++ b/data/gui/default/window/touch_game_menu.cfg @@ -0,0 +1,166 @@ +#textdomain wesnoth-lib +### +### Definition of the window to ask for the savegame filename +### + +#define BUTTON ID LABEL +[button] + id = "{ID}" + definition = "touch_fixed" + label = _ "{LABEL}" +[/button] +#enddef + +[window] + id = "touch_game_menu" + description = "touch menu" + + [resolution] + definition = "default" + + automatic_placement = "true" + vertical_placement = "center" + horizontal_placement = "center" + + [tooltip] + id = "tooltip_large" + [/tooltip] + + [helptip] + id = "tooltip_large" + [/helptip] + + [grid] + + [row] + grow_factor = 0 + + [column] + grow_factor = 1 + [spacer] + definition = "default" + [/spacer] + [/column] + [column] + grow_factor = 1 + [spacer] + definition = "default" + [/spacer] + [/column] + [/row] + + [row] + grow_factor = 1 + + [column] + [button] + id = "button0" + definition = "default" + label = _ "Save Game" + [/button] + [/column] + [column] + [button] + id = "button6" + definition = "default" + label = _ "Statistics" + [/button] + [/column] + [/row] + + [row] + grow_factor = 1 + + [column] + [button] + id = "button1" + definition = "default" + label = _ "Load Game" + [/button] + [/column] + [column] + [button] + id = "button7" + definition = "default" + label = _ "Unit List" + [/button] + [/column] + [/row] + + [row] + grow_factor = 1 + + [column] + [button] + id = "button2" + definition = "default" + label = _ "Quit Game" + [/button] + [/column] + [column] + [button] + id = "button8" + definition = "default" + label = _ "Enemy Moves" + [/button] + [/column] + [/row] + [row] + grow_factor = 1 + + [column] + [button] + id = "button3" + definition = "default" + label = _ "Objectives" + [/button] + [/column] + [column] + [button] + id = "button9" + definition = "default" + label = _ "Preferences" + [/button] + [/column] + [/row] + [row] + grow_factor = 1 + + [column] + [button] + id = "button4" + definition = "default" + label = _ "Recall Unit" + [/button] + [/column] + [column] + [button] + id = "button10" + definition = "default" + label = _ "Undo" + [/button] + [/column] + [/row] + [row] + grow_factor = 1 + + [column] + [button] + id = "button5" + definition = "default" + label = _ "Recruit Unit" + [/button] + [/column] + [column] + [button] + id = "button11" + definition = "default" + label = _ "Redo" + [/button] + [/column] + [/row] + [/grid] + [/resolution] +[/window] + +#undef BUTTON diff --git a/data/themes/default.cfg b/data/themes/default.cfg index 21ed6957..a8e280c1 100644 --- a/data/themes/default.cfg +++ b/data/themes/default.cfg @@ -116,27 +116,6 @@ yanchor=bottom [/panel] - [menu] - id=menu-main - title= _ "Menu" - image=lite - items=objectives,statistics,unitlist,statustable,save,savereplay,savemap,load,preferences,chatlog,AUTOSAVES,help,stopnetwork,startnetwork,quit - ref=top-panel - rect="=+3,=+1,+100,=-4" - xanchor=fixed - yanchor=fixed - [/menu] - - [menu] - id=actions-menu - title= _ "Actions" - image=lite - items=undo,redo,wbexecuteallactions,wbexecuteaction,wbdeleteaction,cycle,speak,recruit,recall,showenemymoves,bestenemymoves,wbtoggle,delayshroud,updateshroud,endturn - rect="+2,=,+100,=" - xanchor=fixed - yanchor=fixed - [/menu] - [menu] is_context_menu=true items=wml,undo,redo,wbexecuteaction,wbdeleteaction,wbbumpupaction,wbbumpdownaction,wbsupposedead,describeunit,renameunit,createunit,changeside,labelteamterrain,labelterrain,clearlabels,speak,continue,recruit,recall,wbtoggle,delayshroud,updateshroud,cycle,endturn @@ -151,7 +130,7 @@ [menu] id=button-endturn - image=large-button + image=button title= _ "End Turn" title2= _ "End Scenario" items=endturn @@ -164,8 +143,8 @@ [panel] id=turn-panel image=themes/status-bg.png - ref=actions-menu - rect="+5,=+1,+80,+19" + ref=top-panel + rect="=+3,=+1,+80,+19" xanchor=fixed yanchor=fixed [/panel] @@ -562,11 +541,10 @@ id=unit-image rect="=+9,=+175,+72,+72" [/change] - [change] - id=button-endturn - image=button - rect="=+17,=+3,+80,+20" - [/change] + [change] + id=bottom-right-panel + rect="=,-20,=,768" + [/change] # adjust allowed heigth for displaying weapon stuff [change] id=unit-weapons diff --git a/images/buttons/button-active.png b/images/buttons/button-active.png index c986d5ea..adf367c5 100644 Binary files a/images/buttons/button-active.png and b/images/buttons/button-active.png differ diff --git a/images/buttons/button-disabled.png b/images/buttons/button-disabled.png index b8b9be8c..47951687 100644 Binary files a/images/buttons/button-disabled.png and b/images/buttons/button-disabled.png differ diff --git a/images/buttons/button-pressed.png b/images/buttons/button-pressed.png index cf36f57f..51502c50 100644 Binary files a/images/buttons/button-pressed.png and b/images/buttons/button-pressed.png differ diff --git a/images/buttons/button.png b/images/buttons/button.png index b77e52f5..e2cea68d 100644 Binary files a/images/buttons/button.png and b/images/buttons/button.png differ diff --git a/images/buttons/button_transparent-active.png b/images/buttons/button_transparent-active.png index 1838b025..eecc4d05 100644 Binary files a/images/buttons/button_transparent-active.png and b/images/buttons/button_transparent-active.png differ diff --git a/images/buttons/button_transparent-disabled.png b/images/buttons/button_transparent-disabled.png index 6f195f42..29d9ca72 100644 Binary files a/images/buttons/button_transparent-disabled.png and b/images/buttons/button_transparent-disabled.png differ diff --git a/images/buttons/button_transparent-pressed.png b/images/buttons/button_transparent-pressed.png index adf8f20a..26d6d077 100644 Binary files a/images/buttons/button_transparent-pressed.png and b/images/buttons/button_transparent-pressed.png differ diff --git a/images/buttons/button_transparent.png b/images/buttons/button_transparent.png index b1809468..883fff3a 100644 Binary files a/images/buttons/button_transparent.png and b/images/buttons/button_transparent.png differ diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 578c9971..10285162 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -500,6 +500,7 @@ set(wesnoth-main_SRC gui/dialogs/simple_item_selector.cpp gui/dialogs/tip.cpp gui/dialogs/title_screen.cpp + gui/dialogs/touch_game_menu.cpp gui/dialogs/transient_message.cpp gui/dialogs/unit_attack.cpp gui/dialogs/unit_create.cpp diff --git a/src/SConscript b/src/SConscript index 0f0576ba..3f3e4038 100644 --- a/src/SConscript +++ b/src/SConscript @@ -335,6 +335,7 @@ wesnoth_sources = Split(""" gui/dialogs/simple_item_selector.cpp gui/dialogs/tip.cpp gui/dialogs/title_screen.cpp + gui/dialogs/touch_game_menu.cpp gui/dialogs/transient_message.cpp gui/dialogs/unit_attack.cpp gui/dialogs/unit_create.cpp @@ -368,7 +369,7 @@ wesnoth_sources = Split(""" gui/widgets/text.cpp gui/widgets/text_box.cpp gui/widgets/toggle_button.cpp - gui/widgets/toggle_panel.cpp + gui/widgets/toggle_panel.cpp gui/widgets/tree_view.cpp gui/widgets/tree_view_node.cpp gui/widgets/vertical_scrollbar.cpp diff --git a/src/controller_base.cpp b/src/controller_base.cpp index 3fb91d17..29d0b76c 100644 --- a/src/controller_base.cpp +++ b/src/controller_base.cpp @@ -109,6 +109,9 @@ void controller_base::handle_event(const SDL_Event& event) } } break; + case SDL_USEREVENT: + hotkey::swipe_menu_event(get_display(),this); + break; default: break; } diff --git a/src/gui/dialogs/touch_game_menu.cpp b/src/gui/dialogs/touch_game_menu.cpp new file mode 100644 index 00000000..55b9b15b --- /dev/null +++ b/src/gui/dialogs/touch_game_menu.cpp @@ -0,0 +1,139 @@ +/* $Id: game_save.cpp 48450 2011-02-08 20:55:18Z mordante $ */ +/* + Copyright (C) 2008 - 2011 by Jörg Hinrichs + Part of the Battle for Wesnoth Project http://www.wesnoth.org/ + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License version 2 + or at your option any later version. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY. + + See the COPYING file for more details. +*/ + +#define GETTEXT_DOMAIN "wesnoth-lib" + +#include "gui/dialogs/touch_game_menu.hpp" + +#include "gui/dialogs/field.hpp" +#include "gui/widgets/button.hpp" +#include "gui/widgets/label.hpp" +#include "gui/widgets/settings.hpp" + +#include "gui/auxiliary/log.hpp" + +#include "dialogs.hpp" +#include "sdl_utils.hpp" + +#include + +namespace gui2 { + +REGISTER_DIALOG(touch_game_menu); + +ttouch_game_menu::ttouch_game_menu() +{ +} + +void outside_click_dismiss(twindow* wnd, const tpoint& ev) { + SDL_Rect r = wnd->get_rect(); + int buf = 10; + r.x -= buf; r.y -= buf; + r.w += 2 * buf; r.h += 2 * buf; + if (!point_in_rect(ev.x, ev.y, r)) { + wnd->close(); + } +} + +twindow* ttouch_game_menu::build_window(CVideo& video) +{ + video_ = &video; + twindow* ret = build(video, window_id()); + + ret->connect_signal(boost::bind(&outside_click_dismiss, ret, _5)); + + change_page(0, ret); + //tbutton* btn = dynamic_cast(ret->find("button0",false)); + //assert(btn); + //btn->set_retval(SAVE_GAME); + //btn->set_label("Save Game"); + return ret; +} + +namespace { + template + void change_page_callback(twidget* caller) { + ttouch_game_menu* dialog = dynamic_cast(caller->dialog()); + assert(dialog); + twindow* window = dynamic_cast(caller->get_window()); + assert(window); + dialog->change_page(N, window); + } + + void change_button(twindow* window, const std::string& bname, ttouch_game_menu::action retval, const std::string& label) { + tbutton* btn = dynamic_cast(window->find(bname, false)); + assert(btn); + btn->set_retval(retval); + btn->set_label(label); + } +} + +void ttouch_game_menu::change_page(int page, twindow* window) { + switch (page) { + case 0: { + change_button(window, "button0", SAVE_GAME, "Save Game"); + change_button(window, "button1", LOAD_GAME, "Load Game"); + change_button(window, "button2", QUIT_GAME, "Quit Game"); + change_button(window, "button3", OBJECTIVES, "Objectives"); + change_button(window, "button4", RECALL, "Recall Unit"); + change_button(window, "button5", RECRUIT, "Recruit Unit"); + change_button(window, "button6", NOTHING, "Next Page"); + + tbutton* btn = dynamic_cast(window->find("button6", false)); + assert(btn); +// btn->set_callback_mouse_left_click(change_page_callback<1>); + break; + } + case 1: { + change_button(window, "button0", STATISTICS, "Statistics"); + change_button(window, "button1", UNIT_LIST, "Unit List"); + change_button(window, "button2", ENEMY_MOVES, "Enemy Moves"); + change_button(window, "button3", PREFERENCES, "Preferences"); + change_button(window, "button4", UNDO, "Undo"); + change_button(window, "button5", REDO, "Redo"); + change_button(window, "button6", NOTHING, "Previous Page"); + + tbutton* btn = dynamic_cast(window->find("button6", false)); + assert(btn); +// btn->set_callback_mouse_left_click(change_page_callback<0>); + + break; + } + } +} + +void ttouch_game_menu::pre_show(CVideo& /*video*/, twindow& window) +{ + window.connect_signal(boost::bind(&outside_click_dismiss, &window, _5)); + + change_button(&window, "button0", SAVE_GAME, "Save Game"); + change_button(&window, "button1", LOAD_GAME, "Load Game"); + change_button(&window, "button2", QUIT_GAME, "Quit Game"); + change_button(&window, "button3", OBJECTIVES, "Objectives"); + change_button(&window, "button4", RECALL, "Recall"); + change_button(&window, "button5", RECRUIT, "Recruit"); + change_button(&window, "button6", STATISTICS, "Statistics"); + change_button(&window, "button7", UNIT_LIST, "Unit List"); + change_button(&window, "button8", ENEMY_MOVES, "Enemy Moves"); + change_button(&window, "button9", PREFERENCES, "Preferences"); + change_button(&window, "button10", UNDO, "Undo"); + change_button(&window, "button11", REDO, "Redo"); +} + +void ttouch_game_menu::post_show(twindow& /*window*/) +{ +} + +} // namespace gui2 + diff --git a/src/gui/dialogs/touch_game_menu.hpp b/src/gui/dialogs/touch_game_menu.hpp new file mode 100644 index 00000000..9fbe9d56 --- /dev/null +++ b/src/gui/dialogs/touch_game_menu.hpp @@ -0,0 +1,64 @@ +/* $Id: touch_game_menu.hpp 48450 2011-02-08 20:55:18Z hopman $ */ +/* + Copyright (C) 2008 - 2011 by Jörg Hinrichs + Part of the Battle for Wesnoth Project http://www.wesnoth.org/ + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License version 2 + or at your option any later version. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY. + + See the COPYING file for more details. +*/ + +#ifndef GUI_DIALOGS_TOUCH_GAME_MENU_HPP_INCLUDED +#define GUI_DIALOGS_TOUCH_GAME_MENU_HPP_INCLUDED + +#include "gui/dialogs/dialog.hpp" +#include "tstring.hpp" +#include + + +namespace gui2 { + +class ttouch_game_menu : public tdialog +{ +public: + enum action { + NOTHING = 0, + LOAD_GAME, + SAVE_GAME, + QUIT_GAME, + PREFERENCES, + OBJECTIVES, + UNDO, + REDO, + RECALL, + RECRUIT, + ENEMY_MOVES, + UNIT_LIST, + STATISTICS, + }; + explicit ttouch_game_menu(); + + void change_page(int page, twindow* window); +protected: + /** Inherited from tdialog. */ + void pre_show(CVideo& video, twindow& window); + + /** Inherited from tdialog. */ + void post_show(twindow& window); + +private: + CVideo* video_; + /** Inherited from tdialog. */ + twindow* build_window(CVideo& video); + + virtual const std::string& window_id() const; +}; + +} + +#endif + diff --git a/src/hotkeys.cpp b/src/hotkeys.cpp index c9bdbfe9..4c927057 100644 --- a/src/hotkeys.cpp +++ b/src/hotkeys.cpp @@ -26,6 +26,7 @@ #include "gettext.hpp" #include "gui/dialogs/message.hpp" #include "gui/dialogs/transient_message.hpp" +#include "gui/dialogs/touch_game_menu.hpp" #include "gui/widgets/window.hpp" #include "filesystem.hpp" #include "log.hpp" @@ -883,6 +884,65 @@ void key_event(display& disp, const SDL_KeyboardEvent& event, command_executor* key_event_execute(disp,event,executor); } +void swipe_menu_event(display& disp, command_executor* executor) +{ + gui2::ttouch_game_menu dlg; + + try { + dlg.show(disp.video()); + } catch(twml_exception& e) { + e.show(disp); + } + + switch (dlg.get_retval()) { + case gui2::ttouch_game_menu::SAVE_GAME: + executor->save_game(); + break; + case gui2::ttouch_game_menu::LOAD_GAME: + executor->load_game(); + break; + case gui2::ttouch_game_menu::QUIT_GAME: + { + const int res = gui::dialog(disp,_("Quit"),_("Do you really want to quit?"),gui::YES_NO).show(); + if(res == 0) + throw end_level_exception(QUIT); + break; + } + case gui2::ttouch_game_menu::OBJECTIVES: + executor->objectives(); + break; + case gui2::ttouch_game_menu::RECALL: + executor->recall(); + break; + case gui2::ttouch_game_menu::RECRUIT: + executor->recruit(); + break; + case gui2::ttouch_game_menu::UNDO: + executor->undo(); + break; + case gui2::ttouch_game_menu::REDO: + executor->redo(); + break; + case gui2::ttouch_game_menu::PREFERENCES: + executor->preferences(); + break; + case gui2::ttouch_game_menu::UNIT_LIST: + executor->unit_list(); + break; + case gui2::ttouch_game_menu::ENEMY_MOVES: + executor->show_enemy_moves(false); + break; + case gui2::ttouch_game_menu::STATISTICS: + executor->show_statistics(); + break; + case gui2::ttouch_game_menu::NOTHING: + default: + break; + } + return; + //execute_command(disp,HOTKEY_SCREENSHOT,executor); +} + void button_event_execute(display& disp, const SDL_JoyButtonEvent& event, command_executor* executor) { const hotkey_item* hk = &get_hotkey(event); diff --git a/src/hotkeys.hpp b/src/hotkeys.hpp index 17144bd4..6673499c 100644 --- a/src/hotkeys.hpp +++ b/src/hotkeys.hpp @@ -367,6 +367,7 @@ class command_executor void key_event(display& disp, const SDL_KeyboardEvent& event, command_executor* executor); void button_event(display& disp, const SDL_JoyButtonEvent& event, command_executor* executor); void hat_event(display& disp, const SDL_JoyHatEvent& event, command_executor* executor); +void swipe_menu_event(display& disp, command_executor* executor); void execute_command(display& disp, HOTKEY_COMMAND command, command_executor* executor, int index=-1);