Attack key ("a") cycles through attack types if you have a uniform selection of units
This commit is contained in:
parent
af89f4c5ed
commit
2bc2555c22
|
@ -613,6 +613,27 @@ void Gui::mouseDownDisplayUnitSkills(int posDisplay) {
|
|||
//uniform selection
|
||||
if(selection.isUniform()) {
|
||||
const CommandType *ct = display.getCommandType(posDisplay);
|
||||
if(activeCommandClass == ccAttack)
|
||||
{// try to switch to next attack type
|
||||
int maxI=unit->getType()->getCommandTypeCount();
|
||||
int i=activeCommandType->getId();
|
||||
int k=i+1;
|
||||
while(k!=i)
|
||||
{
|
||||
if(k>=maxI)
|
||||
{
|
||||
k=0;
|
||||
}
|
||||
const CommandType *ctype=display.getCommandType(k);
|
||||
if(ctype->getClass() == ccAttack)
|
||||
{
|
||||
posDisplay=k;
|
||||
break;
|
||||
}
|
||||
k++;
|
||||
}
|
||||
}
|
||||
|
||||
if(ct != NULL && unit->getFaction()->reqsOk(ct)) {
|
||||
activeCommandType= display.getCommandType(posDisplay);
|
||||
activeCommandClass= activeCommandType->getClass();
|
||||
|
|
Loading…
Reference in New Issue