No longer displays information for unexplored tiles

This commit is contained in:
Yair Morgenstern 2018-01-01 22:45:21 +02:00
parent c0927cf49f
commit 74f1b6837b
2 changed files with 164 additions and 159 deletions

View File

@ -99,7 +99,7 @@ public class CityScreen extends CameraStageBaseScreen {
private Image getSpecialistIcon(String imageName, final String building, final boolean isFilled, final FullStats specialistType) {
Image specialist = ImageGetter.getImage(imageName);
specialist.setSize(40,40);
specialist.setSize(50,50);
if(!isFilled) specialist.setColor(Color.GRAY);
specialist.addListener(new ClickListener(){
@Override

View File

@ -121,8 +121,7 @@ public class WorldScreen extends CameraStageBaseScreen {
})) {
selectIdleUnitButton.setColor(Color.WHITE);
selectIdleUnitButton.setTouchable(Touchable.enabled);
}
else {
} else {
selectIdleUnitButton.setColor(Color.GRAY);
selectIdleUnitButton.setTouchable(Touchable.disabled);
}
@ -130,8 +129,7 @@ public class WorldScreen extends CameraStageBaseScreen {
private void updateNotificationsList() {
notificationsTable.clearChildren();
for(String notification : game.civInfo.notifications)
{
for (String notification : game.civInfo.notifications) {
Label label = new Label(notification, skin);
label.setColor(Color.WHITE);
notificationsTable.add(label).pad(10).fill();
@ -259,8 +257,10 @@ public class WorldScreen extends CameraStageBaseScreen {
scienceLabel.setAlignment(Align.center);
civTable.add(scienceLabel);
String happinessText = "Happiness: " + Math.round(game.civInfo.getHappinessForNextTurn());
if(game.civInfo.isGoldenAge()) happinessText+="\r\n GOLDEN AGE ("+game.civInfo.turnsLeftForCurrentGoldenAge+")";
else happinessText+= "\r\n ("+(int)game.civInfo.civStats.happiness+"/"+game.civInfo.happinessRequiredForNextGoldenAge()+")";
if (game.civInfo.isGoldenAge())
happinessText += "\r\n GOLDEN AGE (" + game.civInfo.turnsLeftForCurrentGoldenAge + ")";
else
happinessText += "\r\n (" + (int) game.civInfo.civStats.happiness + "/" + game.civInfo.happinessRequiredForNextGoldenAge() + ")";
Label happinessLabel = new Label(happinessText, skin);
happinessLabel.setAlignment(Align.center);
civTable.add(happinessLabel);
@ -318,8 +318,7 @@ public class WorldScreen extends CameraStageBaseScreen {
LinqHashMap<TileInfo, Float> distanceToTiles = game.civInfo.tileMap.getDistanceToTilesWithinTurn(unitTile.position, unitTile.unit.currentMovement);
if (distanceToTiles.containsKey(selectedTile)) {
unitTile.moveUnitToTile(group.tileInfo, distanceToTiles.get(selectedTile));
}
else {
} else {
unitTile.unit.action = "moveTo " + ((int) selectedTile.position.x) + "," + ((int) selectedTile.position.y);
unitTile.unit.doAction(unitTile);
}
@ -392,6 +391,7 @@ public class WorldScreen extends CameraStageBaseScreen {
tileTable.add(cityStatsHeader).colspan(2).pad(10);
tileTable.row();
if (selectedTile.explored) {
tileTable.add(new Label(selectedTile.toString(), skin)).colspan(2);
tileTable.row();
@ -404,11 +404,13 @@ public class WorldScreen extends CameraStageBaseScreen {
TileStatsValues.put("Culture", stats.culture);
for (String key : TileStatsValues.keySet()) {
if(TileStatsValues.get(key) == 0) continue; // this tile gives nothing of this stat, so why even display it?
if (TileStatsValues.get(key) == 0)
continue; // this tile gives nothing of this stat, so why even display it?
tileTable.add(com.unciv.game.utils.ImageGetter.getStatIcon(key)).align(Align.right);
tileTable.add(new Label(Math.round(TileStatsValues.get(key)) + "", skin)).align(Align.left);
tileTable.row();
}
}
if (selectedTile.unit != null) {
@ -474,7 +476,9 @@ public class WorldScreen extends CameraStageBaseScreen {
, new ClickListener() {
@Override
public void clicked(InputEvent event, float x, float y) {game.setScreen(new ImprovementPickerScreen(selectedTile));}
public void clicked(InputEvent event, float x, float y) {
game.setScreen(new ImprovementPickerScreen(selectedTile));
}
});
addUnitAction(tileTable, "automation".equals(selectedTile.unit.action) ? "Stop automation" : "Automate", true,
new ClickListener() {
@ -601,7 +605,8 @@ public class WorldScreen extends CameraStageBaseScreen {
private void updateTiles() {
for (WorldTileGroup WG : tileGroups.linqValues()) WG.update(this);
if(unitTile!=null) return; // While we're in "unit move" mode, no tiles but the tiles the unit can move to will be "visible"
if (unitTile != null)
return; // While we're in "unit move" mode, no tiles but the tiles the unit can move to will be "visible"
// YES A TRIPLE FOR, GOT PROBLEMS WITH THAT?
// Seriously though, there is probably a more efficient way of doing this, probably?