Fixed bug in GetVectorsAtDistance and bug where if you started the game with free techs to pick the next turn button would not be visible

This commit is contained in:
Yair Morgenstern 2017-12-10 22:48:16 +02:00
parent c579215743
commit 727aad337a
4 changed files with 3 additions and 7 deletions

View file

@ -59,7 +59,7 @@ public class CivilizationInfo {
});
}
public void nextTurn()//out boolean displayTech)
public void nextTurn()
{
notifications.clear();
CivStats nextTurnStats = getStatsForNextTurn();

View file

@ -48,6 +48,7 @@ public class HexMath
public static ArrayList<Vector2> GetVectorsAtDistance(Vector2 origin, int distance){
ArrayList<Vector2> vectors = new ArrayList<Vector2>();
if(distance==0){vectors.add(origin.cpy()); return vectors;}
Vector2 Current = origin.cpy().sub(distance,distance); // start at 6 o clock
for (int i = 0; i < distance; i++) { // From 6 to 8
vectors.add(Current.cpy());
@ -62,7 +63,7 @@ public class HexMath
for (int i = 0; i < distance; i++) { // 10 to 12
vectors.add(Current.cpy());
vectors.add(origin.cpy().scl(2).sub(Current)); // Get vector on other side of cloick
Current.add(1,1);
Current.add(0,1);
};
return vectors;
}

View file

@ -96,7 +96,6 @@ public class WorldScreen extends CameraStageBaseScreen {
public void update(){
if(game.civInfo.tech.freeTechs!=0) {
game.setScreen(new TechPickerScreen(game, true));
return;
}
updateTechButton();
updateTileTable();

View file

@ -93,14 +93,10 @@ public class TechPickerScreen extends PickerScreen {
StringBuilder text = new StringBuilder(techName);
if (selectedTech != null) {
Technology thisTech = GameBasics.Technologies.get(techName);
if (techName.equals(selectedTech.name)) {
TB.setChecked(true);
TB.setColor(TB.getColor().lerp(Color.LIGHT_GRAY, 0.5f));
}
if (thisTech.prerequisites.contains(selectedTech.name)) text.insert(0, "*");
else if (selectedTech.prerequisites.contains(techName)) text.append("*");
}
if (techsToResearch.contains(techName)) {
text.append(" (").append(techsToResearch.indexOf(techName)).append(")");