mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-24 03:53:12 -04:00
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:
parent
c579215743
commit
727aad337a
@ -59,7 +59,7 @@ public class CivilizationInfo {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public void nextTurn()//out boolean displayTech)
|
public void nextTurn()
|
||||||
{
|
{
|
||||||
notifications.clear();
|
notifications.clear();
|
||||||
CivStats nextTurnStats = getStatsForNextTurn();
|
CivStats nextTurnStats = getStatsForNextTurn();
|
||||||
|
@ -48,6 +48,7 @@ public class HexMath
|
|||||||
|
|
||||||
public static ArrayList<Vector2> GetVectorsAtDistance(Vector2 origin, int distance){
|
public static ArrayList<Vector2> GetVectorsAtDistance(Vector2 origin, int distance){
|
||||||
ArrayList<Vector2> vectors = new ArrayList<Vector2>();
|
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
|
Vector2 Current = origin.cpy().sub(distance,distance); // start at 6 o clock
|
||||||
for (int i = 0; i < distance; i++) { // From 6 to 8
|
for (int i = 0; i < distance; i++) { // From 6 to 8
|
||||||
vectors.add(Current.cpy());
|
vectors.add(Current.cpy());
|
||||||
@ -62,7 +63,7 @@ public class HexMath
|
|||||||
for (int i = 0; i < distance; i++) { // 10 to 12
|
for (int i = 0; i < distance; i++) { // 10 to 12
|
||||||
vectors.add(Current.cpy());
|
vectors.add(Current.cpy());
|
||||||
vectors.add(origin.cpy().scl(2).sub(Current)); // Get vector on other side of cloick
|
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;
|
return vectors;
|
||||||
}
|
}
|
||||||
|
@ -96,7 +96,6 @@ public class WorldScreen extends CameraStageBaseScreen {
|
|||||||
public void update(){
|
public void update(){
|
||||||
if(game.civInfo.tech.freeTechs!=0) {
|
if(game.civInfo.tech.freeTechs!=0) {
|
||||||
game.setScreen(new TechPickerScreen(game, true));
|
game.setScreen(new TechPickerScreen(game, true));
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
updateTechButton();
|
updateTechButton();
|
||||||
updateTileTable();
|
updateTileTable();
|
||||||
|
@ -93,14 +93,10 @@ public class TechPickerScreen extends PickerScreen {
|
|||||||
StringBuilder text = new StringBuilder(techName);
|
StringBuilder text = new StringBuilder(techName);
|
||||||
|
|
||||||
if (selectedTech != null) {
|
if (selectedTech != null) {
|
||||||
Technology thisTech = GameBasics.Technologies.get(techName);
|
|
||||||
if (techName.equals(selectedTech.name)) {
|
if (techName.equals(selectedTech.name)) {
|
||||||
TB.setChecked(true);
|
TB.setChecked(true);
|
||||||
TB.setColor(TB.getColor().lerp(Color.LIGHT_GRAY, 0.5f));
|
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)) {
|
if (techsToResearch.contains(techName)) {
|
||||||
text.append(" (").append(techsToResearch.indexOf(techName)).append(")");
|
text.append(" (").append(techsToResearch.indexOf(techName)).append(")");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user