Skip to content

Commit a5438f6

Browse files
committed
Use the cancel icon for the unused grid locations
1 parent e277c47 commit a5438f6

File tree

1 file changed

+19
-4
lines changed

1 file changed

+19
-4
lines changed

source/glest_game/gui/gui.cpp

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -993,7 +993,12 @@ void Gui::computeDisplay(){
993993
for(int i= 0; i < ut->getCommandTypeSortedCount(); ++i){
994994
int displayPos= i;
995995
const CommandType *ct= ut->getCommandTypeSorted(i);
996-
if(ct == NULL) continue;
996+
if(ct == NULL) {
997+
display.setDownImage(displayPos, ut->getCancelImage());
998+
display.setCommandType(displayPos, ct);
999+
display.setDownLighted(displayPos,false);
1000+
continue;
1001+
}
9971002
if(ct->getClass() == ccMorph) {
9981003
displayPos= morphPos++;
9991004
}
@@ -1042,7 +1047,15 @@ void Gui::computeDisplay(){
10421047
else{
10431048
//printf("selection.isUniform() == FALSE\n");
10441049
//non uniform selection
1045-
int basicPos= CommandHelper::getRowPos(crBasics);
1050+
int basicPos = CommandHelper::getRowPos(crBasics);
1051+
1052+
// First row is always empty
1053+
for (int i = 0; i < 5; i++) {
1054+
display.setDownImage(i, ut->getCancelImage());
1055+
display.setCommandType(i, NULL);
1056+
display.setDownLighted(i,false);
1057+
}
1058+
10461059
// only basics can be shared
10471060
for(auto &&cc : CommandHelper::getBasicsCC()){
10481061

@@ -1064,8 +1077,10 @@ void Gui::computeDisplay(){
10641077
display.setDownImage(basicPos + ccPos, ut->getFirstCtOfClass(cc)->getImage());
10651078
}
10661079
display.setCommandClass(basicPos + ccPos, cc);
1067-
display.setCommandClass(lastCommand, cc);
1068-
lastCommand++;
1080+
} else {
1081+
display.setDownImage(basicPos+ccPos, ut->getCancelImage());
1082+
display.setCommandType(basicPos+ccPos, NULL);
1083+
display.setDownLighted(basicPos+ccPos,false);
10691084
}
10701085
}
10711086
}

0 commit comments

Comments
 (0)