Skip to content

Commit b7fa811

Browse files
committed
Use the cancel icon for the unused grid locations
1 parent 6705c24 commit b7fa811

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

source/glest_game/gui/gui.cpp

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -981,7 +981,12 @@ void Gui::computeDisplay(){
981981
for(int i= 0; i < ut->getCommandTypeSortedCount(); ++i){
982982
int displayPos= i;
983983
const CommandType *ct= ut->getCommandTypeSorted(i);
984-
if(ct == NULL) continue;
984+
if(ct == NULL) {
985+
display.setDownImage(displayPos, ut->getCancelImage());
986+
display.setCommandType(displayPos, ct);
987+
display.setDownLighted(displayPos,false);
988+
continue;
989+
}
985990
if(ct->getClass() == ccMorph) {
986991
displayPos= morphPos++;
987992
}
@@ -1031,6 +1036,14 @@ void Gui::computeDisplay(){
10311036
//printf("selection.isUniform() == FALSE\n");
10321037
//non uniform selection
10331038
int basicPos= CommandHelper::getBasicPos();
1039+
1040+
// First row is always empty
1041+
for (int i = 0; i < 5; i++) {
1042+
display.setDownImage(i, ut->getCancelImage());
1043+
display.setCommandType(i, NULL);
1044+
display.setDownLighted(i,false);
1045+
}
1046+
10341047
// only basics can be shared
10351048
for(auto &&cc : CommandHelper::getBasicsCC()){
10361049

@@ -1041,6 +1054,10 @@ void Gui::computeDisplay(){
10411054
display.setDownLighted(basicPos + ccPos, true);
10421055
display.setDownImage(basicPos + ccPos, ut->getFirstCtOfClass(cc)->getImage());
10431056
display.setCommandClass(basicPos + ccPos, cc);
1057+
} else {
1058+
display.setDownImage(basicPos+ccPos, ut->getCancelImage());
1059+
display.setCommandType(basicPos+ccPos, NULL);
1060+
display.setDownLighted(basicPos+ccPos,false);
10441061
}
10451062
}
10461063
}

0 commit comments

Comments
 (0)