From b7fa8112f922e3d39a43ede8182fff35992f606e Mon Sep 17 00:00:00 2001 From: Rampoina Date: Thu, 11 Aug 2022 17:26:59 +0200 Subject: [PATCH] Use the cancel icon for the unused grid locations --- source/glest_game/gui/gui.cpp | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/source/glest_game/gui/gui.cpp b/source/glest_game/gui/gui.cpp index 6e05d5507..06cea3495 100644 --- a/source/glest_game/gui/gui.cpp +++ b/source/glest_game/gui/gui.cpp @@ -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++; } @@ -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()){ @@ -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); } } }