Skip to content

Commit

Permalink
Use the cancel icon for the unused grid locations
Browse files Browse the repository at this point in the history
  • Loading branch information
Rampoina committed Aug 14, 2022
1 parent 9cf0eb7 commit 449b944
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions source/glest_game/gui/gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -993,7 +993,12 @@ void Gui::computeDisplay(){
for(int i= 0; i < ut->getCommandTypeSortedCount(); ++i){
int displayPos= i;
const CommandType *ct= ut->getCommandTypeSorted(i);
if(ct == NULL) continue;
if(ct == NULL) {
display.setDownImage(displayPos, ut->getCancelImage());
display.setCommandType(displayPos, ct);
display.setDownLighted(displayPos,false);
continue;
}
if(ct->getClass() == ccMorph) {
displayPos= morphPos++;
}
Expand Down Expand Up @@ -1042,7 +1047,15 @@ void Gui::computeDisplay(){
else{
//printf("selection.isUniform() == FALSE\n");
//non uniform selection
int basicPos= CommandHelper::getRowPos(crBasics);
int basicPos= CommandHelper::getBasicPos();

// First row is always empty
for (int i = 0; i < 5; i++) {
display.setDownImage(i, ut->getCancelImage());
display.setCommandType(i, NULL);
display.setDownLighted(i,false);
}

// only basics can be shared
for(auto &&cc : CommandHelper::getBasicsCC()){

Expand All @@ -1066,8 +1079,10 @@ void Gui::computeDisplay(){
display.setDownImage(basicPos + ccPos, ut->getFirstCtOfClass(cc)->getImage());
}
display.setCommandClass(basicPos + ccPos, cc);
display.setCommandClass(lastCommand, cc);
lastCommand++;
} else {
display.setDownImage(basicPos+ccPos, ut->getCancelImage());
display.setCommandType(basicPos+ccPos, NULL);
display.setDownLighted(basicPos+ccPos,false);
}
}
}
Expand Down

0 comments on commit 449b944

Please sign in to comment.