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 11, 2022
1 parent 6705c24 commit b7fa811
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion source/glest_game/gui/gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -981,7 +981,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 @@ -1031,6 +1036,14 @@ void Gui::computeDisplay(){
//printf("selection.isUniform() == FALSE\n");
//non uniform selection
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 @@ -1041,6 +1054,10 @@ void Gui::computeDisplay(){
display.setDownLighted(basicPos + ccPos, true);
display.setDownImage(basicPos + ccPos, ut->getFirstCtOfClass(cc)->getImage());
display.setCommandClass(basicPos + ccPos, cc);
} else {
display.setDownImage(basicPos+ccPos, ut->getCancelImage());
display.setCommandType(basicPos+ccPos, NULL);
display.setDownLighted(basicPos+ccPos,false);
}
}
}
Expand Down

0 comments on commit b7fa811

Please sign in to comment.