make queued commandcount configurable

This commit is contained in:
Mark Vejvoda 2011-04-28 00:16:26 +00:00
parent 4a20646d37
commit c747a7c037
2 changed files with 16 additions and 17 deletions

View File

@ -235,6 +235,7 @@ Unit::Unit(int id, UnitPathInterface *unitpath, const Vec2i &pos, const UnitType
Config &config= Config::getInstance();
showUnitParticles = config.getBool("UnitParticles","true");
maxQueuedCommandDisplayCount = config.getInt("MaxQueuedCommandDisplayCount","5");
lastPos= pos;
progress= 0;
@ -1471,18 +1472,15 @@ string Unit::getDesc() const {
//command info
if(commands.empty() == false) {
str+= "\n" + commands.front()->getCommandType()->getName();
if(commands.size() > 1) {
str += "\n" + lang.get("OrdersOnQueue") + ": " + intToStr(commands.size());
Commands::const_iterator it= commands.begin();
for(unsigned int i = 1; i < min((size_t)6,commands.size()); ++i) {
for(unsigned int i = 0; i < min((size_t)maxQueuedCommandDisplayCount,commands.size()); ++i) {
const CommandType *ct = (*it)->getCommandType();
//str += "\n" + ct->getDesc(this->getTotalUpgrade());
str += "\n#" + intToStr(i+1) + " " + ct->getName();
it++;
}
}
}
else {
//can store
if(getType()->getStoredResourceCount() > 0) {

View File

@ -339,6 +339,7 @@ private:
uint32 lastPathfindFailedFrame;
Vec2i lastPathfindFailedPos;
bool usePathfinderExtendedMaxNodes;
int maxQueuedCommandDisplayCount;
public:
Unit(int id, UnitPathInterface *path, const Vec2i &pos, const UnitType *type, Faction *faction, Map *map, CardinalDir placeFacing);