mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-09 07:18:57 +07:00
Added techs and buildings up to industral era
Added option to remove jungles, forests and marshes
This commit is contained in:
@ -105,10 +105,10 @@ public class TileInfo
|
||||
return resource != null && getTileResource().improvement.equals(improvement.name);
|
||||
}
|
||||
|
||||
public void startWorkingOnImprovement(TileImprovement improvement)
|
||||
public void startWorkingOnImprovement(String improvementName,int turnsToBuild)
|
||||
{
|
||||
improvementInProgress = improvement.name;
|
||||
turnsToImprovement = improvement.turnsToBuild;
|
||||
improvementInProgress = improvementName;
|
||||
turnsToImprovement = turnsToBuild;
|
||||
}
|
||||
|
||||
public void stopWorkingOnImprovement()
|
||||
|
@ -8,7 +8,7 @@ import com.badlogic.gdx.scenes.scene2d.ui.Image;
|
||||
import java.util.HashMap;
|
||||
|
||||
public class ImageGetter {
|
||||
static HashMap<String, TextureRegion> textureRegionByFileName = new HashMap<String, TextureRegion>();
|
||||
public static HashMap<String, TextureRegion> textureRegionByFileName = new HashMap<String, TextureRegion>();
|
||||
|
||||
public static Image getImageByFilename(String fileName) {
|
||||
if (!textureRegionByFileName.containsKey(fileName))
|
||||
|
@ -6,6 +6,8 @@ import com.badlogic.gdx.scenes.scene2d.Group;
|
||||
import com.badlogic.gdx.scenes.scene2d.ui.Container;
|
||||
import com.badlogic.gdx.scenes.scene2d.ui.Image;
|
||||
import com.badlogic.gdx.scenes.scene2d.ui.TextButton;
|
||||
import com.badlogic.gdx.scenes.scene2d.utils.Drawable;
|
||||
import com.badlogic.gdx.scenes.scene2d.utils.TextureRegionDrawable;
|
||||
import com.unciv.civinfo.CivilizationInfo;
|
||||
import com.unciv.civinfo.RoadStatus;
|
||||
import com.unciv.civinfo.TileInfo;
|
||||
@ -48,6 +50,9 @@ public class TileGroup extends Group {
|
||||
|
||||
void update() {
|
||||
|
||||
String terrainFileName ="TerrainIcons/" + tileInfo.getLastTerrain().name.replace(' ','_') + "_(Civ5).png";
|
||||
terrainImage.setDrawable(new TextureRegionDrawable(ImageGetter.textureRegionByFileName.get(terrainFileName))); // In case we e.g. removed a jungle
|
||||
|
||||
if (tileInfo.hasViewableResource() && resourceImage == null) { // Need to add the resource image!
|
||||
String fileName = "ResourceIcons/" + tileInfo.resource + "_(Civ5).png";
|
||||
Image image = ImageGetter.getImageByFilename(fileName);
|
||||
|
@ -82,8 +82,8 @@ public class UnCivGame extends Game {
|
||||
GameBasics.Technologies.put(tech.name,tech);
|
||||
}
|
||||
}
|
||||
for(Building building : GameBasics.Buildings.values()){
|
||||
if(building.requiredTech == null) continue;
|
||||
for(Building building : GameBasics.Buildings.values()) {
|
||||
if (building.requiredTech == null) continue;
|
||||
TechColumn column = building.GetRequiredTech().column;
|
||||
building.cost = building.isWonder ? column.wonderCost : column.buildingCost;
|
||||
}
|
||||
|
@ -180,12 +180,12 @@ public class WorldScreen extends CameraStageBaseScreen {
|
||||
|
||||
CivStats nextTurnStats = game.civInfo.getStatsForNextTurn();
|
||||
|
||||
CivTable.add(new Label("gold: " + Math.round(currentStats.gold)
|
||||
CivTable.add(new Label("Gold: " + Math.round(currentStats.gold)
|
||||
+ "(" +(nextTurnStats.gold >0?"+":"") + Math.round(nextTurnStats.gold) +")", skin));
|
||||
|
||||
CivTable.add(new Label("science: +" + Math.round(nextTurnStats.science), skin));
|
||||
CivTable.add(new Label("happiness: " + Math.round(nextTurnStats.happiness), skin));
|
||||
CivTable.add(new Label("culture: " + Math.round(currentStats.culture) + "(+" + Math.round(nextTurnStats.culture) +")", skin));
|
||||
CivTable.add(new Label("Science: +" + Math.round(nextTurnStats.science), skin));
|
||||
CivTable.add(new Label("Happiness: " + Math.round(nextTurnStats.happiness), skin));
|
||||
CivTable.add(new Label("Culture: " + Math.round(currentStats.culture) + "(+" + Math.round(nextTurnStats.culture) +")", skin));
|
||||
|
||||
CivTable.pack();
|
||||
|
||||
|
@ -6,12 +6,14 @@ import com.badlogic.gdx.scenes.scene2d.Touchable;
|
||||
import com.badlogic.gdx.scenes.scene2d.ui.TextButton;
|
||||
import com.badlogic.gdx.scenes.scene2d.ui.VerticalGroup;
|
||||
import com.badlogic.gdx.scenes.scene2d.utils.ClickListener;
|
||||
import com.unciv.civinfo.CivilizationInfo;
|
||||
import com.unciv.game.UnCivGame;
|
||||
import com.unciv.models.gamebasics.GameBasics;
|
||||
import com.unciv.models.gamebasics.TileImprovement;
|
||||
|
||||
public class ImprovementPickerScreen extends PickerScreen {
|
||||
TileImprovement SelectedImprovement;
|
||||
String SelectedImprovement;
|
||||
int TurnsToImprovement;
|
||||
|
||||
public ImprovementPickerScreen(final UnCivGame game, final com.unciv.civinfo.TileInfo tileInfo) {
|
||||
super(game);
|
||||
@ -21,7 +23,7 @@ public class ImprovementPickerScreen extends PickerScreen {
|
||||
rightSideButton.addListener(new ClickListener(){
|
||||
@Override
|
||||
public void clicked(InputEvent event, float x, float y) {
|
||||
tileInfo.startWorkingOnImprovement(SelectedImprovement);
|
||||
tileInfo.startWorkingOnImprovement(SelectedImprovement, TurnsToImprovement);
|
||||
game.setWorldScreen();
|
||||
dispose();
|
||||
}
|
||||
@ -38,9 +40,10 @@ public class ImprovementPickerScreen extends PickerScreen {
|
||||
TB.addListener(new ClickListener(){
|
||||
@Override
|
||||
public void clicked(InputEvent event, float x, float y) {
|
||||
SelectedImprovement = improvement;
|
||||
SelectedImprovement = improvement.name;
|
||||
TurnsToImprovement = improvement.turnsToBuild;
|
||||
rightSideButton.setTouchable(Touchable.enabled);
|
||||
rightSideButton.setText("Construct "+improvement.name);
|
||||
rightSideButton.setText(improvement.name);
|
||||
rightSideButton.setColor(Color.WHITE);
|
||||
descriptionLabel.setText(improvement.getDescription());
|
||||
}
|
||||
|
@ -100,14 +100,14 @@ public class TechPickerScreen extends PickerScreen {
|
||||
}
|
||||
|
||||
for (Technology technology : GameBasics.Technologies.linqValues()) {
|
||||
techMatrix[technology.column.columnNumber][technology.row - 1] = technology;
|
||||
techMatrix[technology.column.columnNumber-1][technology.row - 1] = technology;
|
||||
}
|
||||
|
||||
// Table topTable = new Table();
|
||||
for (int i = 0; i < 10; i++) {
|
||||
topTable.row().pad(5);
|
||||
|
||||
for (int j = 0; j < 8; j++) {
|
||||
for (int j = 0; j < 9; j++) {
|
||||
final Technology tech = techMatrix[j][i];
|
||||
if (tech == null) topTable.add(); // empty cell
|
||||
else {
|
||||
|
Reference in New Issue
Block a user