(svn r20065) -Feature: customizable hotkeys for the main toolbar

This commit is contained in:
yexo
2010-07-03 19:35:54 +00:00
parent ed4fdd4a7b
commit ddf11b7d3f
2 changed files with 114 additions and 40 deletions

View File

@@ -49,6 +49,10 @@ static const KeycodeNames _keycode_to_name[] = {
{"PAUSE", WKC_PAUSE},
{"PLUS", (WindowKeyCodes)'+'},
{"COMMA", (WindowKeyCodes)','},
{"NUM_PLUS", WKC_NUM_PLUS},
{"NUM_PLUS", WKC_NUM_MINUS},
{"=", WKC_EQUALS},
{"-", WKC_MINUS},
};
/**
@@ -200,7 +204,7 @@ void LoadHotkeyGroup(IniGroup *group, T *hotkey_list)
IniItem *item = group->GetItem(hotkey->name, false);
if (item != NULL) {
hotkey->keycodes.Clear();
ParseHotkeys(hotkey, item->value);
if (item->value != NULL) ParseHotkeys(hotkey, item->value);
}
}
}
@@ -233,6 +237,7 @@ struct ScenarioEditorLandscapeGenerationWindow;
struct OrdersWindow;
struct BuildAirToolbarWindow;
struct BuildDocksToolbarWindow;
struct MainToolbarWindow;
static void SaveLoadHotkeys(bool save)
{
@@ -252,6 +257,7 @@ static void SaveLoadHotkeys(bool save)
SL_HOTKEYS(order, OrdersWindow);
SL_HOTKEYS(airtoolbar, BuildAirToolbarWindow);
SL_HOTKEYS(dockstoolbar, BuildDocksToolbarWindow);
SL_HOTKEYS(maintoolbar, MainToolbarWindow);
#undef SL_HOTKEYS