Fixed #7643
This commit is contained in:
@@ -59,7 +59,7 @@ public class GameState{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean hasSpawns(){
|
public boolean hasSpawns(){
|
||||||
return rules.waves && !(isCampaign() && rules.attackMode);
|
return rules.waves && ((rules.waveTeam.cores().size > 0 && rules.attackMode) || rules.spawns.size > 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Note that being in a campaign does not necessarily mean having a sector. */
|
/** Note that being in a campaign does not necessarily mean having a sector. */
|
||||||
|
|||||||
@@ -381,11 +381,9 @@ public class ResearchDialog extends BaseDialog{
|
|||||||
this.parent = parent;
|
this.parent = parent;
|
||||||
this.width = this.height = nodeSize;
|
this.width = this.height = nodeSize;
|
||||||
nodes.add(this);
|
nodes.add(this);
|
||||||
if(node.children != null){
|
children = new TechTreeNode[node.children.size];
|
||||||
children = new TechTreeNode[node.children.size];
|
for(int i = 0; i < children.length; i++){
|
||||||
for(int i = 0; i < children.length; i++){
|
children[i] = new TechTreeNode(node.children.get(i), this);
|
||||||
children[i] = new TechTreeNode(node.children.get(i), this);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ public interface TreeLayout{
|
|||||||
public T parent;
|
public T parent;
|
||||||
|
|
||||||
//internal stuff
|
//internal stuff
|
||||||
public float mode, prelim, change, shift;
|
public float mode, prelim, change, shift, cachedWidth = -1f;
|
||||||
public int number = -1, leaves;
|
public int number = -1, leaves;
|
||||||
public TreeNode thread, ancestor;
|
public TreeNode thread, ancestor;
|
||||||
|
|
||||||
@@ -21,12 +21,13 @@ public interface TreeLayout{
|
|||||||
|
|
||||||
public float calcWidth(){
|
public float calcWidth(){
|
||||||
if(children == null) return width;
|
if(children == null) return width;
|
||||||
|
if(cachedWidth > 0) return cachedWidth;
|
||||||
|
|
||||||
float cWidth = 0;
|
float cWidth = 0;
|
||||||
for(T node : children){
|
for(T node : children){
|
||||||
cWidth += node.calcWidth();
|
cWidth += node.calcWidth();
|
||||||
}
|
}
|
||||||
return Math.max(width, cWidth);
|
return cachedWidth = Math.max(width, cWidth);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user