mirror of
https://github.com/glest/glest-source.git
synced 2025-08-21 23:45:14 +02:00
make queued commandcount configurable
This commit is contained in:
@@ -235,6 +235,7 @@ Unit::Unit(int id, UnitPathInterface *unitpath, const Vec2i &pos, const UnitType
|
|||||||
|
|
||||||
Config &config= Config::getInstance();
|
Config &config= Config::getInstance();
|
||||||
showUnitParticles = config.getBool("UnitParticles","true");
|
showUnitParticles = config.getBool("UnitParticles","true");
|
||||||
|
maxQueuedCommandDisplayCount = config.getInt("MaxQueuedCommandDisplayCount","5");
|
||||||
|
|
||||||
lastPos= pos;
|
lastPos= pos;
|
||||||
progress= 0;
|
progress= 0;
|
||||||
@@ -1471,18 +1472,15 @@ string Unit::getDesc() const {
|
|||||||
|
|
||||||
//command info
|
//command info
|
||||||
if(commands.empty() == false) {
|
if(commands.empty() == false) {
|
||||||
str+= "\n" + commands.front()->getCommandType()->getName();
|
|
||||||
if(commands.size() > 1) {
|
|
||||||
str += "\n" + lang.get("OrdersOnQueue") + ": " + intToStr(commands.size());
|
str += "\n" + lang.get("OrdersOnQueue") + ": " + intToStr(commands.size());
|
||||||
Commands::const_iterator it= commands.begin();
|
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();
|
const CommandType *ct = (*it)->getCommandType();
|
||||||
//str += "\n" + ct->getDesc(this->getTotalUpgrade());
|
//str += "\n" + ct->getDesc(this->getTotalUpgrade());
|
||||||
str += "\n#" + intToStr(i+1) + " " + ct->getName();
|
str += "\n#" + intToStr(i+1) + " " + ct->getName();
|
||||||
it++;
|
it++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else {
|
else {
|
||||||
//can store
|
//can store
|
||||||
if(getType()->getStoredResourceCount() > 0) {
|
if(getType()->getStoredResourceCount() > 0) {
|
||||||
|
@@ -339,6 +339,7 @@ private:
|
|||||||
uint32 lastPathfindFailedFrame;
|
uint32 lastPathfindFailedFrame;
|
||||||
Vec2i lastPathfindFailedPos;
|
Vec2i lastPathfindFailedPos;
|
||||||
bool usePathfinderExtendedMaxNodes;
|
bool usePathfinderExtendedMaxNodes;
|
||||||
|
int maxQueuedCommandDisplayCount;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Unit(int id, UnitPathInterface *path, const Vec2i &pos, const UnitType *type, Faction *faction, Map *map, CardinalDir placeFacing);
|
Unit(int id, UnitPathInterface *path, const Vec2i &pos, const UnitType *type, Faction *faction, Map *map, CardinalDir placeFacing);
|
||||||
|
Reference in New Issue
Block a user