Check the number of shared commands before trying to click from a hotkey
This commit is contained in:
parent
e9b771241f
commit
5783db3033
|
@ -97,6 +97,7 @@ Gui::Gui(){
|
||||||
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s] START\n",__FILE__,__FUNCTION__);
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s] START\n",__FILE__,__FUNCTION__);
|
||||||
|
|
||||||
lastGroupRecall = -1;
|
lastGroupRecall = -1;
|
||||||
|
commonCommands=0;
|
||||||
posObjWorld= Vec2i(54, 14);
|
posObjWorld= Vec2i(54, 14);
|
||||||
validPosObjWorld= false;
|
validPosObjWorld= false;
|
||||||
activeCommandType= NULL;
|
activeCommandType= NULL;
|
||||||
|
@ -453,8 +454,10 @@ void Gui::hotKey(SDL_KeyboardEvent key) {
|
||||||
if(isKeyPressed(configKeys.getSDLKey(name.c_str()),key) == true) {
|
if(isKeyPressed(configKeys.getSDLKey(name.c_str()),key) == true) {
|
||||||
if(activeCommandType != NULL && activeCommandType->getClass() == ccBuild) {
|
if(activeCommandType != NULL && activeCommandType->getClass() == ccBuild) {
|
||||||
mouseDownDisplayUnitBuild(i);
|
mouseDownDisplayUnitBuild(i);
|
||||||
|
break;
|
||||||
} else {
|
} else {
|
||||||
mouseDownDisplayUnitSkills(i);
|
if (i < commonCommands) mouseDownDisplayUnitSkills(i);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1056,6 +1059,7 @@ void Gui::computeDisplay(){
|
||||||
lastCommand++;
|
lastCommand++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
commonCommands = lastCommand;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (activeCommandType != NULL && activeCommandType->getClass() == ccBuild) {
|
else if (activeCommandType != NULL && activeCommandType->getClass() == ccBuild) {
|
||||||
|
|
|
@ -124,6 +124,7 @@ private:
|
||||||
CommandClass activeCommandClass;
|
CommandClass activeCommandClass;
|
||||||
int activePos;
|
int activePos;
|
||||||
int lastPosDisplay;
|
int lastPosDisplay;
|
||||||
|
int commonCommands;
|
||||||
|
|
||||||
//composite
|
//composite
|
||||||
Display display;
|
Display display;
|
||||||
|
|
Loading…
Reference in New Issue