fix: non-uniform selection

shows attack as empty position
This commit is contained in:
pavanvo 2022-09-02 11:04:31 +04:00
parent 1c1dd0a393
commit d3c19ce9a5
No known key found for this signature in database
GPG Key ID: 34C1C36681B4AD84
1 changed files with 3 additions and 4 deletions

View File

@ -1028,13 +1028,12 @@ void Gui::computeDisplay(){
//non uniform selection
int basicPos = CommandHelper::getRowPos(crBasics);
// First row is always empty
for (int i = 0; i < 5; i++)
// Cores row is always empty
for (int i = CommandHelper::getRowPos(crCores); i < basicPos; i++)
emptyPosIndexes.push_back(i);
// only basics can be shared
for(auto &&cc : CommandHelper::getBasicsCC()){
//printf("computeDisplay i = %d cc = %d isshared = %d basicPos = %d\n",i,cc,isSharedCommandClass(cc),basicPos);
const Unit* attackingUnit = NULL;
@ -1044,7 +1043,7 @@ void Gui::computeDisplay(){
auto ccPos = CommandHelper::getBasicPos(cc);
if((cc == ccAttack && attackingUnit != NULL) || (isSharedCommandClass(cc) && cc != ccBuild)){
if((cc == ccAttack && attackingUnit != NULL) || isSharedCommandClass(cc)) {
display.setDownLighted(basicPos + ccPos, true);
if (cc == ccAttack && attackingUnit != NULL) {