build command had no colored icons
This commit is contained in:
parent
011f38912e
commit
e978dd3561
|
@ -97,7 +97,7 @@ public:
|
|||
void setCommandClass(int i, const CommandClass cc) {commandClasses[i]= cc;}
|
||||
void setDownLighted(int i, bool lighted) {downImageColor[i]=lighted?Vec3f(1.f, 1.f, 1.f):Vec3f(0.3f, 0.3f, 0.3);}
|
||||
void setDownRedLighted(int i) {downImageColor[i]=Vec3f(1.0f, 0.0f, 0.0);}
|
||||
void setDownOrangeLighted(int i) {downImageColor[i]=Vec3f(1.0f, 0.8f, 0.3);}
|
||||
void setDownOrangeLighted(int i) {downImageColor[i]=Vec3f(1.0f, 0.7f, 0.2);}
|
||||
void setProgressBar(int i) {progressBar= i;}
|
||||
void setDownSelectedPos(int i) {downSelectedPos= i;}
|
||||
|
||||
|
|
|
@ -1014,19 +1014,29 @@ void Gui::computeDisplay(){
|
|||
}
|
||||
}
|
||||
}
|
||||
else{
|
||||
else if (activeCommandType != NULL && activeCommandType->getClass() == ccBuild) {
|
||||
const Unit *u = selection.getFrontUnit();
|
||||
const BuildCommandType* bct = static_cast<const BuildCommandType*>(activeCommandType);
|
||||
for (int i = 0; i < bct->getBuildingCount(); ++i) {
|
||||
display.setDownImage(i, bct->getBuilding(i)->getImage());
|
||||
|
||||
//selecting building
|
||||
const Unit *unit= selection.getFrontUnit();
|
||||
if(activeCommandType != NULL && activeCommandType->getClass() == ccBuild){
|
||||
const BuildCommandType* bct= static_cast<const BuildCommandType*> (activeCommandType);
|
||||
for(int i= 0; i < bct->getBuildingCount(); ++i){
|
||||
display.setDownImage(i, bct->getBuilding(i)->getImage());
|
||||
display.setDownLighted(i, unit->getFaction()->reqsOk(bct->getBuilding(i)));
|
||||
const UnitType *produced = bct->getBuilding(i);
|
||||
int possibleAmount = 1;
|
||||
if (produced != NULL) {
|
||||
possibleAmount = u->getFaction()->getAmountOfProducable(produced, bct);
|
||||
}
|
||||
bool reqOk = u->getFaction()->reqsOk(produced);
|
||||
display.setDownLighted(i, reqOk);
|
||||
|
||||
if (reqOk && produced != NULL) {
|
||||
if (possibleAmount == 0) {
|
||||
display.setDownRedLighted(i);
|
||||
}
|
||||
}
|
||||
display.setDownImage(cancelPos, selection.getFrontUnit()->getType()->getCancelImage());
|
||||
display.setDownLighted(cancelPos, true);
|
||||
}
|
||||
|
||||
display.setDownImage(cancelPos, selection.getFrontUnit()->getType()->getCancelImage());
|
||||
display.setDownLighted(cancelPos, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue