add hotkeybuild1

This commit is contained in:
Rampoina 2022-07-15 03:54:55 +02:00
parent 22a474b93b
commit ff9c9ad864
1 changed files with 13 additions and 0 deletions

View File

@ -447,6 +447,19 @@ void Gui::hotKey(SDL_KeyboardEvent key) {
else if(isKeyPressed(configKeys.getSDLKey("HotKeySelectedUnitsStop"),key) == true) {
clickCommonCommand(ccStop);
}
else if(isKeyPressed(configKeys.getSDLKey("HotKeyBuild1"),key) == true) {
const CommandType *ct;
for(int i=0; i<selection.getCount(); ++i){
const Unit *unit= selection.getUnit(i);
ct= unit->getType()->getFirstCtOfClass(ccBuild);
if(ct != NULL) {
break;
}
}
clickCommonCommand(ct->getClass());
}
}
void Gui::switchToNextDisplayColor(){