|
|
|
@ -35,6 +35,7 @@
|
|
|
|
|
#include <map>
|
|
|
|
|
#include <boost/foreach.hpp>
|
|
|
|
|
#include <boost/algorithm/string/join.hpp>
|
|
|
|
|
#include <boost/ptr_container/ptr_vector.hpp>
|
|
|
|
|
|
|
|
|
|
static lg::log_domain log_config("config");
|
|
|
|
|
#define ERR_G LOG_STREAM(err, lg::general)
|
|
|
|
@ -45,6 +46,7 @@ static lg::log_domain log_config("config");
|
|
|
|
|
namespace {
|
|
|
|
|
|
|
|
|
|
std::vector<hotkey::hotkey_item> hotkeys_;
|
|
|
|
|
// the size_t are indexes for known_hotkeys, because known_hotkeys begins with input_list_, they are also indexes for input_list_.
|
|
|
|
|
std::map<std::string, size_t> command_map_;
|
|
|
|
|
|
|
|
|
|
hotkey::hotkey_item null_hotkey_("null");
|
|
|
|
@ -52,120 +54,127 @@ hotkey::hotkey_item null_hotkey_("null");
|
|
|
|
|
std::vector<bool> scope_active_(hotkey::SCOPE_COUNT, false);
|
|
|
|
|
|
|
|
|
|
config default_hotkey_cfg_;
|
|
|
|
|
// contains copys of hotkey_list_ and all current active wml menau hotkeys
|
|
|
|
|
// maybe known_hotkeys is not a fitting name anymore.
|
|
|
|
|
boost::ptr_vector<hotkey::hotkey_command> known_hotkeys;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
namespace hotkey {
|
|
|
|
|
|
|
|
|
|
//what is this for??
|
|
|
|
|
const input_controll input_list_[] = {
|
|
|
|
|
{ hotkey::INPUT_SCROLL_HORIZONTAL, "scroll-horizontal", N_("Scroll Viewport Horizontally"), false, hotkey::SCOPE_GENERAL },
|
|
|
|
|
{ hotkey::INPUT_SCROLL_VERTICAL, "scroll-vertical", N_("Scroll Viewport Vertically"), false, hotkey::SCOPE_GENERAL }
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const hotkey_command hotkey_list_[] = {
|
|
|
|
|
//msvc cannot collapse this otherwise
|
|
|
|
|
#pragma region hotkey_list_
|
|
|
|
|
// this contains all static hotkeys
|
|
|
|
|
|
|
|
|
|
{ hotkey::HOTKEY_CANCEL, "cancel", N_("Cancel"), false, hotkey::SCOPE_GENERAL, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_LEFT_MOUSE_CLICK, "leftmouseclick", N_("Left Mouse Click"), false, hotkey::SCOPE_GENERAL, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_RIGHT_MOUSE_CLICK, "rightmouseclick", N_("Right Mouse Click"), false, hotkey::SCOPE_GENERAL, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_ANIMATE_MAP, "animatemap", N_("Animate Map"), false, hotkey::SCOPE_GENERAL, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_CYCLE_UNITS, "cycle", N_("Next Unit"), false, hotkey::SCOPE_GAME, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_CYCLE_BACK_UNITS, "cycleback", N_("Previous Unit"), false, hotkey::SCOPE_GAME, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_UNIT_HOLD_POSITION, "holdposition", N_("Hold Position"), false, hotkey::SCOPE_GAME, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_END_UNIT_TURN, "endunitturn", N_("End Unit Turn"), false, hotkey::SCOPE_GAME, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_LEADER, "leader", N_("Leader"), false, hotkey::SCOPE_GAME, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_UNDO, "undo", N_("Undo"), false, hotkey::SCOPE_GENERAL, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_REDO, "redo", N_("Redo"), false, hotkey::SCOPE_GENERAL, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_ZOOM_IN, "zoomin", N_("Zoom In"), false, hotkey::SCOPE_GENERAL, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_ZOOM_OUT, "zoomout", N_("Zoom Out"), false, hotkey::SCOPE_GENERAL, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_ZOOM_DEFAULT, "zoomdefault", N_("Default Zoom"), false, hotkey::SCOPE_GENERAL, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_FULLSCREEN, "fullscreen", N_("Toggle Full Screen"), false, hotkey::SCOPE_GENERAL, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_SCREENSHOT, "screenshot", N_("Screenshot"), false, hotkey::SCOPE_GENERAL, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_MAP_SCREENSHOT, "mapscreenshot", N_("Map Screenshot"), false, hotkey::SCOPE_GENERAL, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_ACCELERATED, "accelerated", N_("Accelerated"), false, hotkey::SCOPE_GAME, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_UNIT_DESCRIPTION, "describeunit", N_("Unit Description"), false, hotkey::SCOPE_GENERAL, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_RENAME_UNIT, "renameunit", N_("Rename Unit"), false, hotkey::SCOPE_GENERAL, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_DELETE_UNIT, "editor-deleteunit", N_("Delete Unit"), false, hotkey::SCOPE_GENERAL, NULL },
|
|
|
|
|
hotkey_command_temp hotkey_list_[] = {
|
|
|
|
|
|
|
|
|
|
{ hotkey::HOTKEY_SAVE_GAME, "save", N_("Save Game"), false, hotkey::SCOPE_GAME, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_SAVE_REPLAY, "savereplay", N_("Save Replay"), false, hotkey::SCOPE_GAME, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_SAVE_MAP, "savemap", N_("Save Map"), false, hotkey::SCOPE_GAME, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_LOAD_GAME, "load", N_("Load Game"), false, hotkey::SCOPE_GAME, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_RECRUIT, "recruit", N_("Recruit"), false, hotkey::SCOPE_GAME, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_REPEAT_RECRUIT, "repeatrecruit", N_("Repeat Recruit"), false, hotkey::SCOPE_GAME, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_RECALL, "recall", N_("Recall"), false, hotkey::SCOPE_GAME, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_ENDTURN, "endturn", N_("End Turn"), false, hotkey::SCOPE_GAME, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_TOGGLE_ELLIPSES, "toggleellipses", N_("Toggle Ellipses"), false, hotkey::SCOPE_GENERAL, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_TOGGLE_GRID, "togglegrid", N_("Toggle Grid"), false, hotkey::SCOPE_GENERAL, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_MOUSE_SCROLL, "mousescroll", N_("Mouse Scrolling"), false, hotkey::SCOPE_GENERAL, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_STATUS_TABLE, "statustable", N_("Status Table"), false, hotkey::SCOPE_GAME, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_MUTE, "mute", N_("Mute"), false, hotkey::SCOPE_GENERAL, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_SPEAK, "speak", N_("Speak"), false, hotkey::SCOPE_GAME, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_CREATE_UNIT, "createunit", N_("Create Unit (Debug!)"), false, hotkey::SCOPE_GAME, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_CHANGE_SIDE, "changeside", N_("Change Side (Debug!)"), false, hotkey::SCOPE_GAME, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_KILL_UNIT, "killunit", N_("Kill Unit (Debug!)"), false, hotkey::SCOPE_GAME, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_PREFERENCES, "preferences", N_("Preferences"), false, hotkey::SCOPE_GENERAL, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_OBJECTIVES, "objectives", N_("Scenario Objectives"), false, hotkey::SCOPE_GAME, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_UNIT_LIST, "unitlist", N_("Unit List"), false, hotkey::SCOPE_GENERAL, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_STATISTICS, "statistics", N_("Statistics"), false, hotkey::SCOPE_GAME, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_STOP_NETWORK, "stopnetwork", N_("Pause Network Game"), false, hotkey::SCOPE_GAME, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_START_NETWORK, "startnetwork", N_("Continue Network Game"), false, hotkey::SCOPE_GAME, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_QUIT_GAME, "quit", N_("Quit Game"), false, hotkey::SCOPE_GENERAL, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_QUIT_GAME, "quit-editor", N_("Quit Editor"), true, hotkey::SCOPE_EDITOR, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_LABEL_TEAM_TERRAIN, "labelteamterrain", N_("Set Team Label"), false, hotkey::SCOPE_GAME, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_LABEL_TERRAIN, "labelterrain", N_("Set Label"), false, hotkey::SCOPE_GAME, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_CLEAR_LABELS, "clearlabels", N_("Clear Labels"), false, hotkey::SCOPE_GAME, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_SHOW_ENEMY_MOVES, "showenemymoves", N_("Show Enemy Moves"), false, hotkey::SCOPE_GAME, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_BEST_ENEMY_MOVES, "bestenemymoves", N_("Best Possible Enemy Moves"), false, hotkey::SCOPE_GAME, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_PLAY_REPLAY, "playreplay", N_("Play Replay"), false, hotkey::SCOPE_GAME, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_RESET_REPLAY, "resetreplay", N_("Reset Replay"), false, hotkey::SCOPE_GAME, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_STOP_REPLAY, "stopreplay", N_("Stop Replay"), false, hotkey::SCOPE_GAME, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_REPLAY_NEXT_TURN, "replaynextturn", N_("Next Turn"), false, hotkey::SCOPE_GAME, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_REPLAY_NEXT_SIDE, "replaynextside", N_("Next Side"), false, hotkey::SCOPE_GAME, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_REPLAY_SHOW_EVERYTHING, "replayshoweverything", N_("Full Map"), false, hotkey::SCOPE_GAME, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_REPLAY_SHOW_EACH, "replayshoweach", N_("Each Team"), false, hotkey::SCOPE_GAME, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_REPLAY_SHOW_TEAM1, "replayshowteam1", N_("Team 1"), false, hotkey::SCOPE_GAME, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_REPLAY_SKIP_ANIMATION, "replayskipanimation", N_("Skip Animation"), false, hotkey::SCOPE_GAME, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_CANCEL, N_("cancel"), N_("Cancel"), false, hotkey::SCOPE_GENERAL, "" },
|
|
|
|
|
{ hotkey::HOTKEY_LEFT_MOUSE_CLICK, "leftmouseclick", N_("Left Mouse Click"), false, hotkey::SCOPE_GENERAL, "" },
|
|
|
|
|
{ hotkey::HOTKEY_RIGHT_MOUSE_CLICK, "rightmouseclick", N_("Right Mouse Click"), false, hotkey::SCOPE_GENERAL, "" },
|
|
|
|
|
{ hotkey::HOTKEY_ANIMATE_MAP, "animatemap", N_("Animate Map"), false, hotkey::SCOPE_GENERAL, "" },
|
|
|
|
|
{ hotkey::HOTKEY_CYCLE_UNITS, "cycle", N_("Next Unit"), false, hotkey::SCOPE_GAME, "" },
|
|
|
|
|
{ hotkey::HOTKEY_CYCLE_BACK_UNITS, "cycleback", N_("Previous Unit"), false, hotkey::SCOPE_GAME, "" },
|
|
|
|
|
{ hotkey::HOTKEY_UNIT_HOLD_POSITION, "holdposition", N_("Hold Position"), false, hotkey::SCOPE_GAME, "" },
|
|
|
|
|
{ hotkey::HOTKEY_END_UNIT_TURN, "endunitturn", N_("End Unit Turn"), false, hotkey::SCOPE_GAME, "" },
|
|
|
|
|
{ hotkey::HOTKEY_LEADER, "leader", N_("Leader"), false, hotkey::SCOPE_GAME, "" },
|
|
|
|
|
{ hotkey::HOTKEY_UNDO, "undo", N_("Undo"), false, hotkey::SCOPE_GENERAL, "" },
|
|
|
|
|
{ hotkey::HOTKEY_REDO, "redo", N_("Redo"), false, hotkey::SCOPE_GENERAL, "" },
|
|
|
|
|
{ hotkey::HOTKEY_ZOOM_IN, "zoomin", N_("Zoom In"), false, hotkey::SCOPE_GENERAL, "" },
|
|
|
|
|
{ hotkey::HOTKEY_ZOOM_OUT, "zoomout", N_("Zoom Out"), false, hotkey::SCOPE_GENERAL, "" },
|
|
|
|
|
{ hotkey::HOTKEY_ZOOM_DEFAULT, "zoomdefault", N_("Default Zoom"), false, hotkey::SCOPE_GENERAL, "" },
|
|
|
|
|
{ hotkey::HOTKEY_FULLSCREEN, "fullscreen", N_("Toggle Full Screen"), false, hotkey::SCOPE_GENERAL, "" },
|
|
|
|
|
{ hotkey::HOTKEY_SCREENSHOT, "screenshot", N_("Screenshot"), false, hotkey::SCOPE_GENERAL, "" },
|
|
|
|
|
{ hotkey::HOTKEY_MAP_SCREENSHOT, "mapscreenshot", N_("Map Screenshot"), false, hotkey::SCOPE_GENERAL, "" },
|
|
|
|
|
{ hotkey::HOTKEY_ACCELERATED, "accelerated", N_("Accelerated"), false, hotkey::SCOPE_GAME, "" },
|
|
|
|
|
{ hotkey::HOTKEY_UNIT_DESCRIPTION, "describeunit", N_("Unit Description"), false, hotkey::SCOPE_GENERAL, "" },
|
|
|
|
|
{ hotkey::HOTKEY_RENAME_UNIT, "renameunit", N_("Rename Unit"), false, hotkey::SCOPE_GENERAL, "" },
|
|
|
|
|
{ hotkey::HOTKEY_DELETE_UNIT, "editor-deleteunit", N_("Delete Unit"), false, hotkey::SCOPE_GENERAL, "" },
|
|
|
|
|
|
|
|
|
|
{ hotkey::HOTKEY_SAVE_GAME, "save", N_("Save Game"), false, hotkey::SCOPE_GAME, "" },
|
|
|
|
|
{ hotkey::HOTKEY_SAVE_REPLAY, "savereplay", N_("Save Replay"), false, hotkey::SCOPE_GAME, "" },
|
|
|
|
|
{ hotkey::HOTKEY_SAVE_MAP, "savemap", N_("Save Map"), false, hotkey::SCOPE_GAME, "" },
|
|
|
|
|
{ hotkey::HOTKEY_LOAD_GAME, "load", N_("Load Game"), false, hotkey::SCOPE_GAME, "" },
|
|
|
|
|
{ hotkey::HOTKEY_RECRUIT, "recruit", N_("Recruit"), false, hotkey::SCOPE_GAME, "" },
|
|
|
|
|
{ hotkey::HOTKEY_REPEAT_RECRUIT, "repeatrecruit", N_("Repeat Recruit"), false, hotkey::SCOPE_GAME, "" },
|
|
|
|
|
{ hotkey::HOTKEY_RECALL, "recall", N_("Recall"), false, hotkey::SCOPE_GAME, "" },
|
|
|
|
|
{ hotkey::HOTKEY_ENDTURN, "endturn", N_("End Turn"), false, hotkey::SCOPE_GAME, "" },
|
|
|
|
|
{ hotkey::HOTKEY_TOGGLE_ELLIPSES, "toggleellipses", N_("Toggle Ellipses"), false, hotkey::SCOPE_GENERAL, "" },
|
|
|
|
|
{ hotkey::HOTKEY_TOGGLE_GRID, "togglegrid", N_("Toggle Grid"), false, hotkey::SCOPE_GENERAL, "" },
|
|
|
|
|
{ hotkey::HOTKEY_MOUSE_SCROLL, "mousescroll", N_("Mouse Scrolling"), false, hotkey::SCOPE_GENERAL, "" },
|
|
|
|
|
{ hotkey::HOTKEY_STATUS_TABLE, "statustable", N_("Status Table"), false, hotkey::SCOPE_GAME, "" },
|
|
|
|
|
{ hotkey::HOTKEY_MUTE, "mute", N_("Mute"), false, hotkey::SCOPE_GENERAL, "" },
|
|
|
|
|
{ hotkey::HOTKEY_SPEAK, "speak", N_("Speak"), false, hotkey::SCOPE_GAME, "" },
|
|
|
|
|
{ hotkey::HOTKEY_CREATE_UNIT, "createunit", N_("Create Unit (Debug!)"), false, hotkey::SCOPE_GAME, "" },
|
|
|
|
|
{ hotkey::HOTKEY_CHANGE_SIDE, "changeside", N_("Change Side (Debug!)"), false, hotkey::SCOPE_GAME, "" },
|
|
|
|
|
{ hotkey::HOTKEY_KILL_UNIT, "killunit", N_("Kill Unit (Debug!)"), false, hotkey::SCOPE_GAME, "" },
|
|
|
|
|
{ hotkey::HOTKEY_PREFERENCES, "preferences", N_("Preferences"), false, hotkey::SCOPE_GENERAL, "" },
|
|
|
|
|
{ hotkey::HOTKEY_OBJECTIVES, "objectives", N_("Scenario Objectives"), false, hotkey::SCOPE_GAME, "" },
|
|
|
|
|
{ hotkey::HOTKEY_UNIT_LIST, "unitlist", N_("Unit List"), false, hotkey::SCOPE_GENERAL, "" },
|
|
|
|
|
{ hotkey::HOTKEY_STATISTICS, "statistics", N_("Statistics"), false, hotkey::SCOPE_GAME, "" },
|
|
|
|
|
{ hotkey::HOTKEY_STOP_NETWORK, "stopnetwork", N_("Pause Network Game"), false, hotkey::SCOPE_GAME, "" },
|
|
|
|
|
{ hotkey::HOTKEY_START_NETWORK, "startnetwork", N_("Continue Network Game"), false, hotkey::SCOPE_GAME, "" },
|
|
|
|
|
{ hotkey::HOTKEY_QUIT_GAME, "quit", N_("Quit Game"), false, hotkey::SCOPE_GENERAL, "" },
|
|
|
|
|
{ hotkey::HOTKEY_QUIT_GAME, "quit-editor", N_("Quit Editor"), true, hotkey::SCOPE_EDITOR, "" },
|
|
|
|
|
{ hotkey::HOTKEY_LABEL_TEAM_TERRAIN, "labelteamterrain", N_("Set Team Label"), false, hotkey::SCOPE_GAME, "" },
|
|
|
|
|
{ hotkey::HOTKEY_LABEL_TERRAIN, "labelterrain", N_("Set Label"), false, hotkey::SCOPE_GAME, "" },
|
|
|
|
|
{ hotkey::HOTKEY_CLEAR_LABELS, "clearlabels", N_("Clear Labels"), false, hotkey::SCOPE_GAME, "" },
|
|
|
|
|
{ hotkey::HOTKEY_SHOW_ENEMY_MOVES, "showenemymoves", N_("Show Enemy Moves"), false, hotkey::SCOPE_GAME, "" },
|
|
|
|
|
{ hotkey::HOTKEY_BEST_ENEMY_MOVES, "bestenemymoves", N_("Best Possible Enemy Moves"), false, hotkey::SCOPE_GAME, "" },
|
|
|
|
|
{ hotkey::HOTKEY_PLAY_REPLAY, "playreplay", N_("Play Replay"), false, hotkey::SCOPE_GAME, "" },
|
|
|
|
|
{ hotkey::HOTKEY_RESET_REPLAY, "resetreplay", N_("Reset Replay"), false, hotkey::SCOPE_GAME, "" },
|
|
|
|
|
{ hotkey::HOTKEY_STOP_REPLAY, "stopreplay", N_("Stop Replay"), false, hotkey::SCOPE_GAME, "" },
|
|
|
|
|
{ hotkey::HOTKEY_REPLAY_NEXT_TURN, "replaynextturn", N_("Next Turn"), false, hotkey::SCOPE_GAME, "" },
|
|
|
|
|
{ hotkey::HOTKEY_REPLAY_NEXT_SIDE, "replaynextside", N_("Next Side"), false, hotkey::SCOPE_GAME, "" },
|
|
|
|
|
{ hotkey::HOTKEY_REPLAY_SHOW_EVERYTHING, "replayshoweverything", N_("Full Map"), false, hotkey::SCOPE_GAME, "" },
|
|
|
|
|
{ hotkey::HOTKEY_REPLAY_SHOW_EACH, "replayshoweach", N_("Each Team"), false, hotkey::SCOPE_GAME, "" },
|
|
|
|
|
{ hotkey::HOTKEY_REPLAY_SHOW_TEAM1, "replayshowteam1", N_("Team 1"), false, hotkey::SCOPE_GAME, "" },
|
|
|
|
|
{ hotkey::HOTKEY_REPLAY_SKIP_ANIMATION, "replayskipanimation", N_("Skip Animation"), false, hotkey::SCOPE_GAME, "" },
|
|
|
|
|
// Whiteboard commands
|
|
|
|
|
// TRANSLATORS: whiteboard menu entry: toggle planning mode
|
|
|
|
|
{ hotkey::HOTKEY_WB_TOGGLE, "wbtoggle", N_("whiteboard^Planning Mode"), false, hotkey::SCOPE_GAME, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_WB_TOGGLE, "wbtoggle", N_("whiteboard^Planning Mode"), false, hotkey::SCOPE_GAME, "" },
|
|
|
|
|
// TRANSLATORS: whiteboard menu entry: execute planned action
|
|
|
|
|
{ hotkey::HOTKEY_WB_EXECUTE_ACTION, "wbexecuteaction", N_("whiteboard^Execute Action"), false, hotkey::SCOPE_GAME, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_WB_EXECUTE_ACTION, "wbexecuteaction", N_("whiteboard^Execute Action"), false, hotkey::SCOPE_GAME, "" },
|
|
|
|
|
// TRANSLATORS: whiteboard menu entry: execute all planned actions
|
|
|
|
|
{ hotkey::HOTKEY_WB_EXECUTE_ALL_ACTIONS, "wbexecuteallactions", N_("whiteboard^Execute All Actions"), false, hotkey::SCOPE_GAME, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_WB_EXECUTE_ALL_ACTIONS, "wbexecuteallactions", N_("whiteboard^Execute All Actions"), false, hotkey::SCOPE_GAME, "" },
|
|
|
|
|
// TRANSLATORS: whiteboard menu entry: delete planned action
|
|
|
|
|
{ hotkey::HOTKEY_WB_DELETE_ACTION, "wbdeleteaction", N_("whiteboard^Delete Action"), false, hotkey::SCOPE_GAME, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_WB_DELETE_ACTION, "wbdeleteaction", N_("whiteboard^Delete Action"), false, hotkey::SCOPE_GAME, "" },
|
|
|
|
|
// TRANSLATORS: whiteboard menu entry: move planned action up queue
|
|
|
|
|
{ hotkey::HOTKEY_WB_BUMP_UP_ACTION, "wbbumpupaction", N_("whiteboard^Move Action Up"), false, hotkey::SCOPE_GAME, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_WB_BUMP_UP_ACTION, "wbbumpupaction", N_("whiteboard^Move Action Up"), false, hotkey::SCOPE_GAME, "" },
|
|
|
|
|
// TRANSLATORS: whiteboard menu entry: move planned action down queue
|
|
|
|
|
{ hotkey::HOTKEY_WB_BUMP_DOWN_ACTION, "wbbumpdownaction", N_("whiteboard^Move Action Down"), false, hotkey::SCOPE_GAME, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_WB_BUMP_DOWN_ACTION, "wbbumpdownaction", N_("whiteboard^Move Action Down"), false, hotkey::SCOPE_GAME, "" },
|
|
|
|
|
// TRANSLATORS: whiteboard menu entry: plan as though the chosen unit were dead
|
|
|
|
|
{ hotkey::HOTKEY_WB_SUPPOSE_DEAD, "wbsupposedead", N_("whiteboard^Suppose Dead"), false, hotkey::SCOPE_GAME, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_WB_SUPPOSE_DEAD, "wbsupposedead", N_("whiteboard^Suppose Dead"), false, hotkey::SCOPE_GAME, "" },
|
|
|
|
|
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_QUIT_TO_DESKTOP, "editor-quit-to-desktop", N_("Quit to Desktop"), false, hotkey::SCOPE_EDITOR, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_CLOSE_MAP, "editor-close-map", N_("Close Map"), false, hotkey::SCOPE_EDITOR, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_SWITCH_MAP, "editor-switch-map", N_("Switch Map"), false, hotkey::SCOPE_EDITOR, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_SWITCH_AREA, "editor-switch-area", N_("Switch Area"), false, hotkey::SCOPE_EDITOR, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_QUIT_TO_DESKTOP, "editor-quit-to-desktop", N_("Quit to Desktop"), false, hotkey::SCOPE_EDITOR, "" },
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_CLOSE_MAP, "editor-close-map", N_("Close Map"), false, hotkey::SCOPE_EDITOR, "" },
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_SWITCH_MAP, "editor-switch-map", N_("Switch Map"), false, hotkey::SCOPE_EDITOR, "" },
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_SWITCH_AREA, "editor-switch-area", N_("Switch Area"), false, hotkey::SCOPE_EDITOR, "" },
|
|
|
|
|
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_CUSTOM_TODS, "editor-custom-tods", N_("Custom Time of Day Creator"), false, hotkey::SCOPE_EDITOR, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_PARTIAL_UNDO, "editor-partial-undo", N_("Partial Undo"), false, hotkey::SCOPE_EDITOR, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_MAP_NEW, "editor-map-new", N_("New Map"), false, hotkey::SCOPE_EDITOR, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_MAP_LOAD, "editor-map-load", N_("Load Map"), false, hotkey::SCOPE_EDITOR, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_MAP_SAVE, "editor-map-save", N_("Save Map"), false, hotkey::SCOPE_EDITOR, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_MAP_SAVE_AS, "editor-map-save-as", N_("Save Map As"), false, hotkey::SCOPE_EDITOR, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_MAP_SAVE_ALL, "editor-map-save-all", N_("Save All Maps"), false, hotkey::SCOPE_EDITOR, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_MAP_REVERT, "editor-map-revert", N_("Revert All Changes"), false, hotkey::SCOPE_EDITOR, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_MAP_INFO, "editor-map-info", N_("Map Information"), false, hotkey::SCOPE_EDITOR, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_SIDE_NEW, "editor-side-new", N_("Add New Side"), false, hotkey::SCOPE_EDITOR, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_SIDE_SWITCH, "editor-switch-side", N_("Switch Side"), false, hotkey::SCOPE_EDITOR, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_PALETTE_ITEM_SWAP, "editor-terrain-palette-swap", N_("Swap Foreground/Background Palette Item"), false, hotkey::SCOPE_EDITOR, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_PALETTE_GROUPS, "editor-palette-groups", N_("Change Palette Group"), false, hotkey::SCOPE_EDITOR, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_PALETTE_UPSCROLL, "editor-palette-upscroll", N_("Scroll Palette Left"), false, hotkey::SCOPE_EDITOR, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_PALETTE_DOWNSCROLL, "editor-palette-downscroll", N_("Scroll Palette Right"), false, hotkey::SCOPE_EDITOR, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_CUSTOM_TODS, "editor-custom-tods", N_("Custom Time of Day Creator"), false, hotkey::SCOPE_EDITOR, "" },
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_PARTIAL_UNDO, "editor-partial-undo", N_("Partial Undo"), false, hotkey::SCOPE_EDITOR, "" },
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_MAP_NEW, "editor-map-new", N_("New Map"), false, hotkey::SCOPE_EDITOR, "" },
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_MAP_LOAD, "editor-map-load", N_("Load Map"), false, hotkey::SCOPE_EDITOR, "" },
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_MAP_SAVE, "editor-map-save", N_("Save Map"), false, hotkey::SCOPE_EDITOR, "" },
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_MAP_SAVE_AS, "editor-map-save-as", N_("Save Map As"), false, hotkey::SCOPE_EDITOR, "" },
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_MAP_SAVE_ALL, "editor-map-save-all", N_("Save All Maps"), false, hotkey::SCOPE_EDITOR, "" },
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_MAP_REVERT, "editor-map-revert", N_("Revert All Changes"), false, hotkey::SCOPE_EDITOR, "" },
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_MAP_INFO, "editor-map-info", N_("Map Information"), false, hotkey::SCOPE_EDITOR, "" },
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_SIDE_NEW, "editor-side-new", N_("Add New Side"), false, hotkey::SCOPE_EDITOR, "" },
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_SIDE_SWITCH, "editor-switch-side", N_("Switch Side"), false, hotkey::SCOPE_EDITOR, "" },
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_PALETTE_ITEM_SWAP, "editor-terrain-palette-swap", N_("Swap Foreground/Background Palette Item"), false, hotkey::SCOPE_EDITOR, "" },
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_PALETTE_GROUPS, "editor-palette-groups", N_("Change Palette Group"), false, hotkey::SCOPE_EDITOR, "" },
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_PALETTE_UPSCROLL, "editor-palette-upscroll", N_("Scroll Palette Left"), false, hotkey::SCOPE_EDITOR, "" },
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_PALETTE_DOWNSCROLL, "editor-palette-downscroll", N_("Scroll Palette Right"), false, hotkey::SCOPE_EDITOR, "" },
|
|
|
|
|
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_SWITCH_TIME, "editor-switch-time", N_("Switch Time of Day"), false, hotkey::SCOPE_EDITOR, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_SWITCH_TIME, "editor-switch-time", N_("Switch Time of Day"), false, hotkey::SCOPE_EDITOR, "" },
|
|
|
|
|
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_TOOL_NEXT, "editor-tool-next", N_("Next Tool"), false, hotkey::SCOPE_EDITOR, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_TOOL_NEXT, "editor-tool-next", N_("Next Tool"), false, hotkey::SCOPE_EDITOR, "" },
|
|
|
|
|
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_TOOL_PAINT, "editor-tool-paint", N_("Paint Tool"), false, hotkey::SCOPE_EDITOR, N_("Use left/right mouse button to draw fore-/background terrain. Hold Shift to paint base layer only. Ctrl+click to sample terrain under cursor.") },
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_TOOL_FILL, "editor-tool-fill", N_("Fill Tool"), false, hotkey::SCOPE_EDITOR, N_("Use left/right mouse button to draw fore-/background terrain. Hold Shift to paint base layer only. Ctrl+click to sample terrain under cursor.") },
|
|
|
|
@ -180,86 +189,91 @@ const hotkey_command hotkey_list_[] = {
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_UNIT_TOGGLE_CANRECRUIT, "editor-toggle-canrecruit", N_("Canrecruit"), false, hotkey::SCOPE_EDITOR, N_("Toggle the recruit attribute of a unit.") },
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_UNIT_TOGGLE_RENAMEABLE, "editor-toggle-renameable", N_("Can be renamed"), false, hotkey::SCOPE_EDITOR, N_("Toggle the unit being renameable.") },
|
|
|
|
|
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_UNIT_CHANGE_ID, "editor-change-unitid", N_("Change Unit ID"), false, hotkey::SCOPE_EDITOR, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_UNIT_TOGGLE_LOYAL, "editor-unit-toggle-loyal", N_("Loyal"), false, hotkey::SCOPE_EDITOR, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_UNIT_CHANGE_ID, "editor-change-unitid", N_("Change Unit ID"), false, hotkey::SCOPE_EDITOR, "" },
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_UNIT_TOGGLE_LOYAL, "editor-unit-toggle-loyal", N_("Loyal"), false, hotkey::SCOPE_EDITOR, "" },
|
|
|
|
|
|
|
|
|
|
{ hotkey::HOTKEY_MINIMAP_COLOR_CODING, "minimap-color-coding", N_("Toggle Minimap color coding"), false, hotkey::SCOPE_GENERAL, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_MINIMAP_COLOR_CODING, "minimap-color-coding", N_("Toggle Minimap color coding"), false, hotkey::SCOPE_GENERAL, "" },
|
|
|
|
|
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_BRUSH_NEXT, "editor-brush-next", N_("Next Brush"), false, hotkey::SCOPE_EDITOR, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_BRUSH_DEFAULT, "editor-brush-default", N_("Default Brush"), false, hotkey::SCOPE_EDITOR, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_BRUSH_1, "editor-brush-1", N_("Single Tile"), false, hotkey::SCOPE_EDITOR, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_BRUSH_2, "editor-brush-2", N_("Radius One"), false, hotkey::SCOPE_EDITOR, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_BRUSH_3, "editor-brush-3", N_("Radius Two"), false, hotkey::SCOPE_EDITOR, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_BRUSH_NW_SE, "editor-brush-nw-se", N_("Brush NW-SE"), false, hotkey::SCOPE_EDITOR, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_BRUSH_SW_NE, "editor-brush-sw-ne", N_("Brush SW-NE"), false, hotkey::SCOPE_EDITOR, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_CUT, "editor-cut", N_("Cut"), false, hotkey::SCOPE_EDITOR, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_COPY, "editor-copy", N_("Copy"), false, hotkey::SCOPE_EDITOR, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_BRUSH_NEXT, "editor-brush-next", N_("Next Brush"), false, hotkey::SCOPE_EDITOR, "" },
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_BRUSH_DEFAULT, "editor-brush-default", N_("Default Brush"), false, hotkey::SCOPE_EDITOR, "" },
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_BRUSH_1, "editor-brush-1", N_("Single Tile"), false, hotkey::SCOPE_EDITOR, "" },
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_BRUSH_2, "editor-brush-2", N_("Radius One"), false, hotkey::SCOPE_EDITOR, "" },
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_BRUSH_3, "editor-brush-3", N_("Radius Two"), false, hotkey::SCOPE_EDITOR, "" },
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_BRUSH_NW_SE, "editor-brush-nw-se", N_("Brush NW-SE"), false, hotkey::SCOPE_EDITOR, "" },
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_BRUSH_SW_NE, "editor-brush-sw-ne", N_("Brush SW-NE"), false, hotkey::SCOPE_EDITOR, "" },
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_CUT, "editor-cut", N_("Cut"), false, hotkey::SCOPE_EDITOR, "" },
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_COPY, "editor-copy", N_("Copy"), false, hotkey::SCOPE_EDITOR, "" },
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_PASTE, "editor-paste", N_("Paste"), false, hotkey::SCOPE_EDITOR, N_("Left mouse button pastes from the clipboard, right brings up a context menu.") },
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_EXPORT_SELECTION_COORDS, "editor-export-selection-coords", N_("Export Selected Coordinates to System Clipboard"), true, hotkey::SCOPE_EDITOR, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_SELECT_ALL, "editor-select-all", N_("Select All"), false, hotkey::SCOPE_EDITOR, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_SELECT_INVERSE, "editor-select-inverse", N_("Select Inverse"), false, hotkey::SCOPE_EDITOR, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_SELECT_NONE, "editor-select-none", N_("Select None"), false, hotkey::SCOPE_EDITOR, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_CLIPBOARD_ROTATE_CW, "editor-clipboard-rotate-cw", N_("Rotate Clipboard Clockwise"), false, hotkey::SCOPE_EDITOR, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_CLIPBOARD_ROTATE_CCW, "editor-clipboard-rotate-ccw", N_("Rotate Clipboard Counter-Clockwise"), false, hotkey::SCOPE_EDITOR, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_CLIPBOARD_FLIP_HORIZONTAL, "editor-clipboard-flip-horizontal", N_("Flip Clipboard Horizontally"), false, hotkey::SCOPE_EDITOR, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_CLIPBOARD_FLIP_VERTICAL, "editor-clipboard-flip-vertical", N_("Flip Clipboard Vertically"), false, hotkey::SCOPE_EDITOR, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_SELECTION_ROTATE, "editor-selection-rotate", N_("Rotate Selection"), false, hotkey::SCOPE_EDITOR, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_SELECTION_FLIP, "editor-selection-flip", N_("Flip Selection"), false, hotkey::SCOPE_EDITOR, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_SELECTION_FILL, "editor-selection-fill", N_("Fill Selection"), false, hotkey::SCOPE_EDITOR, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_SELECTION_GENERATE, "editor-selection-generate", N_("Generate Tiles In Selection"), false, hotkey::SCOPE_EDITOR, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_SELECTION_RANDOMIZE, "editor-selection-randomize", N_("Randomize Tiles In Selection"), false, hotkey::SCOPE_EDITOR, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_MAP_RESIZE, "editor-map-resize", N_("Resize Map"), false, hotkey::SCOPE_EDITOR, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_MAP_ROTATE, "editor-map-rotate", N_("Rotate Map"), false, hotkey::SCOPE_EDITOR, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_MAP_GENERATE, "editor-map-generate", N_("Generate Map"), false, hotkey::SCOPE_EDITOR, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_MAP_APPLY_MASK, "editor-map-apply-mask", N_("Apply a Mask"), false, hotkey::SCOPE_EDITOR, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_MAP_CREATE_MASK_TO, "editor-map-create-mask-to", N_("Create Mask"), false, hotkey::SCOPE_EDITOR, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_REFRESH, "editor-refresh", N_("Refresh Display"), false, hotkey::SCOPE_EDITOR, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_UPDATE_TRANSITIONS, "editor-update-transitions", N_("Update Terrain Transitions"), false, hotkey::SCOPE_EDITOR, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_EXPORT_SELECTION_COORDS, "editor-export-selection-coords", N_("Export Selected Coordinates to System Clipboard"), true, hotkey::SCOPE_EDITOR, "" },
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_SELECT_ALL, "editor-select-all", N_("Select All"), false, hotkey::SCOPE_EDITOR, "" },
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_SELECT_INVERSE, "editor-select-inverse", N_("Select Inverse"), false, hotkey::SCOPE_EDITOR, "" },
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_SELECT_NONE, "editor-select-none", N_("Select None"), false, hotkey::SCOPE_EDITOR, "" },
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_CLIPBOARD_ROTATE_CW, "editor-clipboard-rotate-cw", N_("Rotate Clipboard Clockwise"), false, hotkey::SCOPE_EDITOR, "" },
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_CLIPBOARD_ROTATE_CCW, "editor-clipboard-rotate-ccw", N_("Rotate Clipboard Counter-Clockwise"), false, hotkey::SCOPE_EDITOR, "" },
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_CLIPBOARD_FLIP_HORIZONTAL, "editor-clipboard-flip-horizontal", N_("Flip Clipboard Horizontally"), false, hotkey::SCOPE_EDITOR, "" },
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_CLIPBOARD_FLIP_VERTICAL, "editor-clipboard-flip-vertical", N_("Flip Clipboard Vertically"), false, hotkey::SCOPE_EDITOR, "" },
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_SELECTION_ROTATE, "editor-selection-rotate", N_("Rotate Selection"), false, hotkey::SCOPE_EDITOR, "" },
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_SELECTION_FLIP, "editor-selection-flip", N_("Flip Selection"), false, hotkey::SCOPE_EDITOR, "" },
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_SELECTION_FILL, "editor-selection-fill", N_("Fill Selection"), false, hotkey::SCOPE_EDITOR, "" },
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_SELECTION_GENERATE, "editor-selection-generate", N_("Generate Tiles In Selection"), false, hotkey::SCOPE_EDITOR, "" },
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_SELECTION_RANDOMIZE, "editor-selection-randomize", N_("Randomize Tiles In Selection"), false, hotkey::SCOPE_EDITOR, "" },
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_MAP_RESIZE, "editor-map-resize", N_("Resize Map"), false, hotkey::SCOPE_EDITOR, "" },
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_MAP_ROTATE, "editor-map-rotate", N_("Rotate Map"), false, hotkey::SCOPE_EDITOR, "" },
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_MAP_GENERATE, "editor-map-generate", N_("Generate Map"), false, hotkey::SCOPE_EDITOR, "" },
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_MAP_APPLY_MASK, "editor-map-apply-mask", N_("Apply a Mask"), false, hotkey::SCOPE_EDITOR, "" },
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_MAP_CREATE_MASK_TO, "editor-map-create-mask-to", N_("Create Mask"), false, hotkey::SCOPE_EDITOR, "" },
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_REFRESH, "editor-refresh", N_("Refresh Display"), false, hotkey::SCOPE_EDITOR, "" },
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_UPDATE_TRANSITIONS, "editor-update-transitions", N_("Update Terrain Transitions"), false, hotkey::SCOPE_EDITOR, "" },
|
|
|
|
|
// This item is for binding in the preferences
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_TOGGLE_TRANSITIONS, "editor-toggle-transitions", N_("Toggle Terrain Transition Update"), true, hotkey::SCOPE_EDITOR, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_AUTO_UPDATE_TRANSITIONS, "editor-auto-update-transitions", N_("Auto-update Terrain Transitions"), false, hotkey::SCOPE_EDITOR, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_TOGGLE_TRANSITIONS, "editor-toggle-transitions", N_("Toggle Terrain Transition Update"), true, hotkey::SCOPE_EDITOR, "" },
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_AUTO_UPDATE_TRANSITIONS, "editor-auto-update-transitions", N_("Auto-update Terrain Transitions"), false, hotkey::SCOPE_EDITOR, "" },
|
|
|
|
|
// The next three are for displaying the different states in the menu
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_NO_UPDATE_TRANSITIONS, "editor-no-update-transitions", N_("Auto-update Terrain Transitions: No"), true, hotkey::SCOPE_EDITOR, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_PARTIAL_UPDATE_TRANSITIONS, "editor-partial-update-transitions", N_("Auto-update Terrain Transitions: Partial"), true, hotkey::SCOPE_EDITOR, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_NO_UPDATE_TRANSITIONS, "editor-no-update-transitions", N_("Auto-update Terrain Transitions: No"), true, hotkey::SCOPE_EDITOR, "" },
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_PARTIAL_UPDATE_TRANSITIONS, "editor-partial-update-transitions", N_("Auto-update Terrain Transitions: Partial"), true, hotkey::SCOPE_EDITOR, "" },
|
|
|
|
|
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_REFRESH_IMAGE_CACHE, "editor-refresh-image-cache", N_("Refresh Image Cache"), false, hotkey::SCOPE_EDITOR, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_DRAW_COORDINATES, "editor-draw-coordinates", N_("Draw Hex Coordinates"), false, hotkey::SCOPE_EDITOR, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_DRAW_TERRAIN_CODES, "editor-draw-terrain-codes", N_("Draw Terrain Codes"), false, hotkey::SCOPE_EDITOR, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_REFRESH_IMAGE_CACHE, "editor-refresh-image-cache", N_("Refresh Image Cache"), false, hotkey::SCOPE_EDITOR, "" },
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_DRAW_COORDINATES, "editor-draw-coordinates", N_("Draw Hex Coordinates"), false, hotkey::SCOPE_EDITOR, "" },
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_DRAW_TERRAIN_CODES, "editor-draw-terrain-codes", N_("Draw Terrain Codes"), false, hotkey::SCOPE_EDITOR, "" },
|
|
|
|
|
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_AREA_DEFINE, "editor-define-area", N_("Define (Time) Area"), false, hotkey::SCOPE_EDITOR, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_EDITOR_AREA_DEFINE, "editor-define-area", N_("Define (Time) Area"), false, hotkey::SCOPE_EDITOR, "" },
|
|
|
|
|
|
|
|
|
|
{ hotkey::HOTKEY_DELAY_SHROUD, "delayshroud", N_("Delay Shroud Updates"), false, hotkey::SCOPE_GAME, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_UPDATE_SHROUD, "updateshroud", N_("Update Shroud Now"), false, hotkey::SCOPE_GAME, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_CONTINUE_MOVE, "continue", N_("Continue Move"), false, hotkey::SCOPE_GAME, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_SEARCH, "search", N_("Find Label or Unit"), false, hotkey::SCOPE_GAME, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_SPEAK_ALLY, "speaktoally", N_("Speak to Ally"), false, hotkey::SCOPE_GAME, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_SPEAK_ALL, "speaktoall", N_("Speak to All"), false, hotkey::SCOPE_GAME, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_HELP, "help", N_("Help"), false, hotkey::SCOPE_GENERAL, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_CHAT_LOG, "chatlog", N_("View Chat Log"), false, hotkey::SCOPE_GAME, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_LANGUAGE, "changelanguage", N_("Change Language"), false, hotkey::SCOPE_GENERAL, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_USER_CMD, "command", N_("Enter User Command"), false, hotkey::SCOPE_GENERAL, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_CUSTOM_CMD, "customcommand", N_("Custom Command"), false, hotkey::SCOPE_GAME, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_AI_FORMULA, "aiformula", N_("Run Formula"), false, hotkey::SCOPE_GAME, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_CLEAR_MSG, "clearmessages", N_("Clear Messages"), false, hotkey::SCOPE_GAME, NULL },
|
|
|
|
|
{ hotkey::TITLE_SCREEN__RELOAD_WML, "title_screen__reload_wml", N_("Refresh WML"), true ,hotkey::SCOPE_GENERAL, NULL },
|
|
|
|
|
{ hotkey::TITLE_SCREEN__NEXT_TIP, "title_screen__next_tip", N_("Next Tip of the Day"), false, hotkey::SCOPE_GENERAL, NULL },
|
|
|
|
|
{ hotkey::TITLE_SCREEN__PREVIOUS_TIP, "title_screen__previous_tip", N_("Previous Tip of the Day"), false, hotkey::SCOPE_GENERAL, NULL },
|
|
|
|
|
{ hotkey::TITLE_SCREEN__TUTORIAL, "title_screen__tutorial", N_("Start Tutorial"), false , hotkey::SCOPE_GENERAL, NULL },
|
|
|
|
|
{ hotkey::TITLE_SCREEN__CAMPAIGN, "title_screen__campaign", N_("Start Campaign"), false , hotkey::SCOPE_GENERAL, NULL },
|
|
|
|
|
{ hotkey::TITLE_SCREEN__MULTIPLAYER, "title_screen__multiplayer", N_("Start Multiplayer Game"), false, hotkey::SCOPE_GENERAL, NULL },
|
|
|
|
|
{ hotkey::TITLE_SCREEN__ADDONS, "title_screen__addons", N_("Manage Add-ons"), false , hotkey::SCOPE_GENERAL, NULL },
|
|
|
|
|
{ hotkey::TITLE_SCREEN__EDITOR, "title_screen__editor", N_("Start Editor"), false, hotkey::SCOPE_GENERAL, NULL },
|
|
|
|
|
{ hotkey::TITLE_SCREEN__CREDITS, "title_screen__credits", N_("Show Credits"), false , hotkey::SCOPE_GENERAL, NULL },
|
|
|
|
|
{ hotkey::GLOBAL__HELPTIP, "global__helptip", N_("Show Helptip"), false, hotkey::SCOPE_GENERAL, NULL },
|
|
|
|
|
{ hotkey::HOTKEY_DELAY_SHROUD, "delayshroud", N_("Delay Shroud Updates"), false, hotkey::SCOPE_GAME, "" },
|
|
|
|
|
{ hotkey::HOTKEY_UPDATE_SHROUD, "updateshroud", N_("Update Shroud Now"), false, hotkey::SCOPE_GAME, "" },
|
|
|
|
|
{ hotkey::HOTKEY_CONTINUE_MOVE, "continue", N_("Continue Move"), false, hotkey::SCOPE_GAME, "" },
|
|
|
|
|
{ hotkey::HOTKEY_SEARCH, "search", N_("Find Label or Unit"), false, hotkey::SCOPE_GAME, "" },
|
|
|
|
|
{ hotkey::HOTKEY_SPEAK_ALLY, "speaktoally", N_("Speak to Ally"), false, hotkey::SCOPE_GAME, "" },
|
|
|
|
|
{ hotkey::HOTKEY_SPEAK_ALL, "speaktoall", N_("Speak to All"), false, hotkey::SCOPE_GAME, "" },
|
|
|
|
|
{ hotkey::HOTKEY_HELP, "help", N_("Help"), false, hotkey::SCOPE_GENERAL, "" },
|
|
|
|
|
{ hotkey::HOTKEY_CHAT_LOG, "chatlog", N_("View Chat Log"), false, hotkey::SCOPE_GAME, "" },
|
|
|
|
|
{ hotkey::HOTKEY_LANGUAGE, "changelanguage", N_("Change Language"), false, hotkey::SCOPE_GENERAL, "" },
|
|
|
|
|
{ hotkey::HOTKEY_USER_CMD, "command", N_("Enter User Command"), false, hotkey::SCOPE_GENERAL, "" },
|
|
|
|
|
{ hotkey::HOTKEY_CUSTOM_CMD, "customcommand", N_("Custom Command"), false, hotkey::SCOPE_GAME, "" },
|
|
|
|
|
{ hotkey::HOTKEY_AI_FORMULA, "aiformula", N_("Run Formula"), false, hotkey::SCOPE_GAME, "" },
|
|
|
|
|
{ hotkey::HOTKEY_CLEAR_MSG, "clearmessages", N_("Clear Messages"), false, hotkey::SCOPE_GAME, "" },
|
|
|
|
|
{ hotkey::TITLE_SCREEN__RELOAD_WML, "title_screen__reload_wml", N_("Refresh WML"), 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 Campaign"), false , hotkey::SCOPE_GENERAL, "" },
|
|
|
|
|
{ hotkey::TITLE_SCREEN__MULTIPLAYER, "title_screen__multiplayer", N_("Start Multiplayer Game"), false, hotkey::SCOPE_GENERAL, "" },
|
|
|
|
|
{ hotkey::TITLE_SCREEN__ADDONS, "title_screen__addons", N_("Manage Add-ons"), false , hotkey::SCOPE_GENERAL, "" },
|
|
|
|
|
{ hotkey::TITLE_SCREEN__EDITOR, "title_screen__editor", N_("Start Editor"), false, hotkey::SCOPE_GENERAL, "" },
|
|
|
|
|
{ hotkey::TITLE_SCREEN__CREDITS, "title_screen__credits", N_("Show Credits"), false , hotkey::SCOPE_GENERAL, "" },
|
|
|
|
|
{ hotkey::GLOBAL__HELPTIP, "global__helptip", N_("Show Helptip"), false, hotkey::SCOPE_GENERAL, "" },
|
|
|
|
|
|
|
|
|
|
//This list item must stay at the end since it is used as terminator for iterating.
|
|
|
|
|
{ hotkey::HOTKEY_NULL, "null", N_("Unrecognized Command"), true, hotkey::SCOPE_GENERAL, NULL }
|
|
|
|
|
{ hotkey::HOTKEY_NULL, "null", N_("Unrecognized Command"), true, hotkey::SCOPE_GENERAL, "" }
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const hotkey_command* get_hotkey_commands() {
|
|
|
|
|
return hotkey_list_;
|
|
|
|
|
#pragma endregion
|
|
|
|
|
|
|
|
|
|
const boost::ptr_vector<hotkey_command>& get_hotkey_commands()
|
|
|
|
|
{
|
|
|
|
|
int i = 9;
|
|
|
|
|
return known_hotkeys;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void deactivate_all_scopes()
|
|
|
|
|
{
|
|
|
|
|
for (int i = 0; i < hotkey::SCOPE_COUNT; ++i) {
|
|
|
|
@ -282,18 +296,33 @@ static void jbutton_event_execute(display& disp, const SDL_JoyButtonEvent& event
|
|
|
|
|
static void jhat_event_execute(display& disp, const SDL_JoyHatEvent& event, command_executor* executor);
|
|
|
|
|
static void mbutton_event_execute(display& disp, const SDL_MouseButtonEvent& event, command_executor* executor);
|
|
|
|
|
|
|
|
|
|
const std::string CLEARED_TEXT = "__none__";
|
|
|
|
|
|
|
|
|
|
scope hotkey_item::get_scope() const {
|
|
|
|
|
return hotkey_list_[command_map_[get_command()]].scope;
|
|
|
|
|
scope hotkey_item::get_scope() const
|
|
|
|
|
{
|
|
|
|
|
return hotkey::get_hotkey_command(get_command()).scope;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
HOTKEY_COMMAND hotkey_item::get_id() const {
|
|
|
|
|
return hotkey_list_[command_map_[get_command()]].id;
|
|
|
|
|
HOTKEY_COMMAND hotkey_item::get_id() const
|
|
|
|
|
{
|
|
|
|
|
return hotkey::get_id(get_command());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const std::string hotkey_item::get_description() const {
|
|
|
|
|
hotkey_command& hotkey_item::get_hotkey_command() const
|
|
|
|
|
{
|
|
|
|
|
return hotkey::get_hotkey_command(get_command());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool hotkey_item::active() const
|
|
|
|
|
{
|
|
|
|
|
return !(command_ == "null" || get_hotkey_command().command == "null");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool hotkey_item::valid() const
|
|
|
|
|
{
|
|
|
|
|
return (character_ | keycode_ | joystick_ | mouse_ | button_ | hat_ | value_) != 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const std::string hotkey_item::get_description() const
|
|
|
|
|
{
|
|
|
|
|
return hotkey::get_description(get_command());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -376,7 +405,6 @@ void hotkey_item::set_command(const std::string& command) {
|
|
|
|
|
command_ = command;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
std::string hotkey_item::get_name() const
|
|
|
|
|
{
|
|
|
|
|
std::stringstream str;
|
|
|
|
@ -436,7 +464,6 @@ void hotkey_item::clear()
|
|
|
|
|
command_ = "null";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void hotkey_item::save(config& item)
|
|
|
|
|
{
|
|
|
|
|
if (get_button() >= 0) item["button"] = get_button();
|
|
|
|
@ -537,16 +564,42 @@ manager::manager()
|
|
|
|
|
|
|
|
|
|
void manager::init()
|
|
|
|
|
{
|
|
|
|
|
size_t i;
|
|
|
|
|
for (i = 0; hotkey_list_[i].id != hotkey::HOTKEY_NULL; ++i) {
|
|
|
|
|
command_map_[hotkey_list_[i].command] = i;
|
|
|
|
|
}
|
|
|
|
|
//size_t i;
|
|
|
|
|
//for (i = 0; hotkey_list_[i].id != hotkey::HOTKEY_NULL; ++i) {
|
|
|
|
|
// command_map_[hotkey_list_[i].command] = i;
|
|
|
|
|
//}
|
|
|
|
|
//TODO find a clever way to extend the loop and remove the next line.
|
|
|
|
|
command_map_[hotkey_list_[i].command] = i;
|
|
|
|
|
//command_map_[hotkey_list_[i].command] = i;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//the size value is just random set.
|
|
|
|
|
boost::ptr_vector<hotkey_command> known_hotkeys_temp(200);
|
|
|
|
|
known_hotkeys = known_hotkeys_temp;
|
|
|
|
|
|
|
|
|
|
size_t i = 0;
|
|
|
|
|
BOOST_FOREACH(hotkey_command_temp& cmd, hotkey_list_)
|
|
|
|
|
{
|
|
|
|
|
known_hotkeys.push_back( new hotkey_command(cmd.id, cmd.command, t_string(cmd.description, "wesnoth-lib"), cmd.hidden, cmd.scope, t_string(cmd.tooltip, "wesnoth-lib")));
|
|
|
|
|
command_map_[cmd.command] = i;
|
|
|
|
|
i++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void manager::wipe()
|
|
|
|
|
{
|
|
|
|
|
delete_all_wml_hotkeys();
|
|
|
|
|
/* not needed anymore
|
|
|
|
|
while(!known_hotkeys.empty())
|
|
|
|
|
{
|
|
|
|
|
if(known_hotkeys.begin()->id == HOTKEY_WML)
|
|
|
|
|
{
|
|
|
|
|
ERR_G << "a wml menu hotkey wasn't correct deleted";
|
|
|
|
|
}
|
|
|
|
|
//these are pointers to hotkey_list_. The destructor of known_hotkeys would try to delete them.
|
|
|
|
|
//hotkey_command* ptr =
|
|
|
|
|
known_hotkeys.release(known_hotkeys.begin()).release();
|
|
|
|
|
}
|
|
|
|
|
*/
|
|
|
|
|
hotkeys_.clear();
|
|
|
|
|
command_map_.clear();
|
|
|
|
|
}
|
|
|
|
@ -615,30 +668,146 @@ void save_hotkeys(config& cfg)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const std::string get_description(const std::string& command) {
|
|
|
|
|
std::string tmp(command);
|
|
|
|
|
if (command_map_.find(tmp) == command_map_.end()) {
|
|
|
|
|
tmp = "null";
|
|
|
|
|
}
|
|
|
|
|
return t_string(hotkey_list_[command_map_[tmp]].description,
|
|
|
|
|
PACKAGE "-lib");
|
|
|
|
|
//std::string tmp(command);
|
|
|
|
|
//if (command_map_.find(tmp) == command_map_.end()) {
|
|
|
|
|
// tmp = "null";
|
|
|
|
|
//}
|
|
|
|
|
return get_hotkey_command(command).description;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const std::string get_tooltip(const std::string& command) {
|
|
|
|
|
if (command_map_.find(command) == command_map_.end()) {
|
|
|
|
|
return std::string();
|
|
|
|
|
}
|
|
|
|
|
if (hotkey_list_[command_map_[command]].tooltip != NULL)
|
|
|
|
|
return t_string(hotkey_list_[command_map_[command]].tooltip,
|
|
|
|
|
PACKAGE "-lib");
|
|
|
|
|
else return std::string();
|
|
|
|
|
const std::string get_tooltip(const std::string& command)
|
|
|
|
|
{
|
|
|
|
|
// the null hotkey_command has the "" tooltip
|
|
|
|
|
return get_hotkey_command(command).tooltip;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
HOTKEY_COMMAND get_id(const std::string& command) {
|
|
|
|
|
if (command_map_.find(command) == command_map_.end()) {
|
|
|
|
|
return HOTKEY_NULL;
|
|
|
|
|
bool hotkey_command::null() const
|
|
|
|
|
{
|
|
|
|
|
if(id == HOTKEY_NULL || command == "null")
|
|
|
|
|
{
|
|
|
|
|
hotkey_command& null_cmd = null_command();
|
|
|
|
|
if(id == null_cmd.id && command == null_cmd.command && scope == null_cmd.scope && description == null_cmd.description)
|
|
|
|
|
return true;
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
ERR_G << "the hotkey command seems to be the null command but it is not 100% sure. This shouldn't happen";
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
hotkey_command::hotkey_command()
|
|
|
|
|
: id(HOTKEY_NULL), command(""), description(""), hidden(true), scope(SCOPE_GENERAL), tooltip("")
|
|
|
|
|
{
|
|
|
|
|
ERR_G << "hotkey_command's default constructor called. This shouldn't happen, because all its members are const.";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
hotkey_command::hotkey_command(hotkey::HOTKEY_COMMAND cmd, const std::string& id_, const t_string& desc, bool hid, hotkey::scope scop, const t_string& toolt)
|
|
|
|
|
: id(cmd), command(id_), description(desc), hidden(hid), scope(scop), tooltip(toolt)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
hotkey_command& hotkey_command::null_command()
|
|
|
|
|
{
|
|
|
|
|
return get_hotkey_null();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
hotkey_command& hotkey_command::get_command_by_command(hotkey::HOTKEY_COMMAND command)
|
|
|
|
|
{
|
|
|
|
|
BOOST_FOREACH(hotkey_command& cmd, known_hotkeys)
|
|
|
|
|
{
|
|
|
|
|
if(cmd.id == command)
|
|
|
|
|
return cmd;
|
|
|
|
|
}
|
|
|
|
|
ERR_G << " \"get_command_by_command\" returned get_hotkey_null() because no hotkey_command had the requested number:" << command;
|
|
|
|
|
return get_hotkey_null();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
hotkey_command& get_hotkey_null()
|
|
|
|
|
{
|
|
|
|
|
//it is the last entry in that array, and the indexes in hotkey_list_ and known_hotkeys are the same.
|
|
|
|
|
return known_hotkeys[sizeof(hotkey_list_) / sizeof(hotkey_list_[0]) - 1];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool has_hotkey_command(const std::string& id)
|
|
|
|
|
{
|
|
|
|
|
return get_hotkey_command(id).id != hotkey::HOTKEY_NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool has_hotkey_item(const std::string& command)
|
|
|
|
|
{
|
|
|
|
|
BOOST_FOREACH(hotkey_item& item, hotkeys_)
|
|
|
|
|
{
|
|
|
|
|
if(item.get_command() == command)
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void delete_all_wml_hotkeys()
|
|
|
|
|
{
|
|
|
|
|
while(known_hotkeys.back().id == hotkey::HOTKEY_WML)
|
|
|
|
|
{
|
|
|
|
|
command_map_.erase(known_hotkeys.back().command);
|
|
|
|
|
//according to some page in the internet .back() returns a reference not an iterator, so i use this.
|
|
|
|
|
boost::ptr_vector<hotkey_command>::iterator last_element = known_hotkeys.end();
|
|
|
|
|
--last_element;
|
|
|
|
|
//boost::ptr_vector<hotkey_command> will manage the deleting of the object for me.
|
|
|
|
|
known_hotkeys.erase(last_element);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void add_wml_hotkey(const std::string& id, const t_string& description, const config& default_hotkey)
|
|
|
|
|
{
|
|
|
|
|
if(has_hotkey_command(id) || id == "null")
|
|
|
|
|
{
|
|
|
|
|
LOG_G << "coudn't add wml hotkey with id=" + id + " and description" + description.base_str();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
DBG_G << "added wml hotkey with id=" + id + " and description" + description.base_str();
|
|
|
|
|
//i think i dont need the temp anymore.
|
|
|
|
|
hotkey_command temp_command(hotkey::HOTKEY_WML, id, description, false, hotkey::SCOPE_GAME, t_string(""));
|
|
|
|
|
known_hotkeys.push_back(new hotkey_command(temp_command));
|
|
|
|
|
|
|
|
|
|
command_map_[id] = known_hotkeys.size() - 1;
|
|
|
|
|
|
|
|
|
|
if(!default_hotkey.empty() && !has_hotkey_item(id))
|
|
|
|
|
{
|
|
|
|
|
hotkey_item new_item(default_hotkey);
|
|
|
|
|
new_item.set_command(id);
|
|
|
|
|
if(new_item.valid())
|
|
|
|
|
{
|
|
|
|
|
DBG_G << "added default description for the wml hotkey with id=" + id;
|
|
|
|
|
add_hotkey(new_item);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
ERR_CF << "failed to add default hotkey with id=" + id;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
/// returns hotkey_commands the hotkey command with the given identifier.
|
|
|
|
|
hotkey_command& get_hotkey_command(const std::string& command)
|
|
|
|
|
{
|
|
|
|
|
if (command_map_.find(command) == command_map_.end())
|
|
|
|
|
{
|
|
|
|
|
return get_hotkey_null();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return hotkey_list_[command_map_[command]].id;
|
|
|
|
|
return known_hotkeys[command_map_[command]];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
HOTKEY_COMMAND get_id(const std::string& command)
|
|
|
|
|
{
|
|
|
|
|
return get_hotkey_command(command).id;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
std::string get_names(HOTKEY_COMMAND id) {
|
|
|
|
@ -666,14 +835,6 @@ std::string get_names(std::string id) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
HOTKEY_COMMAND get_hotkey_command(const std::string& command)
|
|
|
|
|
{
|
|
|
|
|
if (command_map_.find(command) != command_map_.end()) {
|
|
|
|
|
return HOTKEY_NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return hotkey_list_[command_map_[command]].id;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
hotkey_item& get_hotkey(int mouse, int joystick, int button, int hat, int value,
|
|
|
|
|
bool shift, bool ctrl, bool cmd, bool alt)
|
|
|
|
@ -682,7 +843,7 @@ hotkey_item& get_hotkey(int mouse, int joystick, int button, int hat, int value,
|
|
|
|
|
|
|
|
|
|
for (itor = hotkeys_.begin(); itor != hotkeys_.end(); ++itor) {
|
|
|
|
|
|
|
|
|
|
if (!(itor->is_in_active_scope())) {
|
|
|
|
|
if (!(itor->is_in_active_scope() && itor->active())) {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -737,7 +898,7 @@ hotkey_item& get_hotkey(int character, int keycode,
|
|
|
|
|
if (ctrl == itor->get_ctrl()
|
|
|
|
|
&& cmd == itor->get_cmd()
|
|
|
|
|
&& alt == itor->get_alt()) {
|
|
|
|
|
if (itor->is_in_active_scope()) {
|
|
|
|
|
if (itor->is_in_active_scope() && itor->active()) {
|
|
|
|
|
DBG_G << "Could match by character..." << "yes\n";
|
|
|
|
|
found = true;
|
|
|
|
|
break;
|
|
|
|
@ -753,7 +914,7 @@ hotkey_item& get_hotkey(int character, int keycode,
|
|
|
|
|
&& ctrl == itor->get_ctrl()
|
|
|
|
|
&& cmd == itor->get_cmd()
|
|
|
|
|
&& alt == itor->get_alt()) {
|
|
|
|
|
if (itor->is_in_active_scope()) {
|
|
|
|
|
if (itor->is_in_active_scope() && itor->active()) {
|
|
|
|
|
DBG_G << "Could match by keycode..." << "yes\n";
|
|
|
|
|
found = true;
|
|
|
|
|
break;
|
|
|
|
@ -868,7 +1029,6 @@ void mbutton_event(display& disp, const SDL_MouseButtonEvent& event, command_exe
|
|
|
|
|
mbutton_event_execute(disp, event, executor);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void jbutton_event(display& disp, const SDL_JoyButtonEvent& event, command_executor* executor)
|
|
|
|
|
{
|
|
|
|
|
jbutton_event_execute(disp, event, executor);
|
|
|
|
@ -898,37 +1058,36 @@ void key_event(display& disp, const SDL_KeyboardEvent& event, command_executor*
|
|
|
|
|
void mbutton_event_execute(display& disp, const SDL_MouseButtonEvent& event, command_executor* executor)
|
|
|
|
|
{
|
|
|
|
|
const hotkey_item* hk = &get_hotkey(event);
|
|
|
|
|
if (hk->null()) {
|
|
|
|
|
if (!hk->active()) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
execute_command(disp, hk->get_id(), executor);
|
|
|
|
|
execute_command(disp, hotkey::get_hotkey_command(hk->get_command()), executor);
|
|
|
|
|
executor->set_button_state(disp);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void jbutton_event_execute(display& disp, const SDL_JoyButtonEvent& event, command_executor* executor)
|
|
|
|
|
{
|
|
|
|
|
const hotkey_item* hk = &get_hotkey(event);
|
|
|
|
|
if (hk->null()) {
|
|
|
|
|
if (!hk->active()) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
execute_command(disp, hk->get_id(), executor);
|
|
|
|
|
execute_command(disp, hk->get_hotkey_command(), executor);
|
|
|
|
|
executor->set_button_state(disp);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void jhat_event_execute(display& disp, const SDL_JoyHatEvent& event, command_executor* executor)
|
|
|
|
|
{
|
|
|
|
|
const hotkey_item* hk = &get_hotkey(event);
|
|
|
|
|
if (hk->null()) {
|
|
|
|
|
if (!hk->active()) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
execute_command(disp, hk->get_id(), executor);
|
|
|
|
|
execute_command(disp, hk->get_hotkey_command(), executor);
|
|
|
|
|
executor->set_button_state(disp);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void key_event_execute(display& disp, const SDL_KeyboardEvent& event, command_executor* executor)
|
|
|
|
|
{
|
|
|
|
|
const hotkey_item* hk = &get_hotkey(event);
|
|
|
|
@ -941,17 +1100,17 @@ void key_event_execute(display& disp, const SDL_KeyboardEvent& event, command_ex
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
if (hk->null()) {
|
|
|
|
|
if (!hk->active()) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
execute_command(disp, hk->get_id(), executor);
|
|
|
|
|
execute_command(disp, hk->get_hotkey_command(), executor);
|
|
|
|
|
executor->set_button_state(disp);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool command_executor::execute_command(HOTKEY_COMMAND command, int /*index*/)
|
|
|
|
|
bool command_executor::execute_command(const hotkey_command& cmd, int /*index*/)
|
|
|
|
|
{
|
|
|
|
|
switch(command) {
|
|
|
|
|
switch(cmd.id) {
|
|
|
|
|
case HOTKEY_CYCLE_UNITS:
|
|
|
|
|
cycle_units();
|
|
|
|
|
break;
|
|
|
|
@ -1156,7 +1315,7 @@ bool command_executor::execute_command(HOTKEY_COMMAND command, int /*index*/)
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void execute_command(display& disp, HOTKEY_COMMAND command, command_executor* executor, int index)
|
|
|
|
|
void execute_command(display& disp, hotkey_command& command, command_executor* executor, int index)
|
|
|
|
|
{
|
|
|
|
|
const int zoom_amount = 4;
|
|
|
|
|
bool map_screenshot = false;
|
|
|
|
@ -1167,7 +1326,7 @@ void execute_command(display& disp, HOTKEY_COMMAND command, command_executor* ex
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
switch (command) {
|
|
|
|
|
switch (command.id) {
|
|
|
|
|
case HOTKEY_MINIMAP_COLOR_CODING:
|
|
|
|
|
preferences::toggle_minimap_color_coding();
|
|
|
|
|
disp.redraw_minimap();
|
|
|
|
@ -1249,7 +1408,7 @@ void execute_command(display& disp, HOTKEY_COMMAND command, command_executor* ex
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
default:
|
|
|
|
|
DBG_G << "command_executor: unknown command number " << command << ", ignoring.\n";
|
|
|
|
|
DBG_G << "command_executor: unknown command number " << command.id << ", ignoring.\n";
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -1263,19 +1422,19 @@ void command_executor::set_button_state(display& disp) {
|
|
|
|
|
int i = 0;
|
|
|
|
|
BOOST_FOREACH(const std::string& command, action.items()) {
|
|
|
|
|
|
|
|
|
|
hotkey::HOTKEY_COMMAND command_id = hotkey::get_id(command);
|
|
|
|
|
hotkey::hotkey_command& command_obj = hotkey::get_hotkey_command(command);
|
|
|
|
|
std::string tooltip = action.tooltip(i);
|
|
|
|
|
if (file_exists(game_config::path + "/images/icons/action/" + command + "_30.png" ))
|
|
|
|
|
button->set_overlay("icons/action/" + command);
|
|
|
|
|
if (!tooltip.empty())
|
|
|
|
|
button->set_tooltip_string(tooltip);
|
|
|
|
|
|
|
|
|
|
bool can_execute = can_execute_command(command_id);
|
|
|
|
|
bool can_execute = can_execute_command(command_obj);
|
|
|
|
|
i++;
|
|
|
|
|
if (!can_execute) continue;
|
|
|
|
|
enabled = true;
|
|
|
|
|
|
|
|
|
|
ACTION_STATE state = get_action_state(command_id, -1);
|
|
|
|
|
ACTION_STATE state = get_action_state(command_obj.id, -1);
|
|
|
|
|
switch (state) {
|
|
|
|
|
case ACTION_SELECTED:
|
|
|
|
|
case ACTION_ON:
|
|
|
|
@ -1318,7 +1477,7 @@ void command_executor::show_menu(const std::vector<std::string>& items_arg, int
|
|
|
|
|
SDL_GetMouseState(&x,&y);
|
|
|
|
|
this->show_menu(submenu->items(), x, y, submenu->is_context(), gui);
|
|
|
|
|
} else {
|
|
|
|
|
const hotkey::HOTKEY_COMMAND cmd = hotkey::get_id(items[res]);
|
|
|
|
|
hotkey::hotkey_command& cmd = hotkey::get_hotkey_command(items[res]);
|
|
|
|
|
hotkey::execute_command(gui,cmd,this,res);
|
|
|
|
|
set_button_state(gui);
|
|
|
|
|
}
|
|
|
|
@ -1331,10 +1490,9 @@ void command_executor::execute_action(const std::vector<std::string>& items_arg,
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
hotkey::HOTKEY_COMMAND command;
|
|
|
|
|
std::vector<std::string>::iterator i = items.begin();
|
|
|
|
|
while(i != items.end()) {
|
|
|
|
|
command = hotkey::get_id(*i);
|
|
|
|
|
hotkey_command &command = hotkey::get_hotkey_command(*i);
|
|
|
|
|
if (can_execute_command(command)) {
|
|
|
|
|
hotkey::execute_command(gui, command, this);
|
|
|
|
|
set_button_state(gui);
|
|
|
|
|