mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-23 03:23:17 -04:00
Buildings are now divided by type in city screen
This commit is contained in:
parent
7b0b0b2f3b
commit
ab2b33318b
@ -29,7 +29,7 @@
|
||||
},
|
||||
{
|
||||
name:"Stone Works",
|
||||
description: "Stone and marble provide +1 production.",
|
||||
description: "",
|
||||
happiness:1,
|
||||
production:1
|
||||
requiredNearbyImprovedResources:["Marble","Stone"]
|
||||
@ -110,6 +110,15 @@
|
||||
requiredBuildingInAllCities:"Library",
|
||||
requiredTech:"Civil Service"
|
||||
},
|
||||
{
|
||||
name:"Chichen Itza",
|
||||
description: "Length of golden ages increased +50%",
|
||||
culture:1,
|
||||
greatPersonPoints:{production:1},
|
||||
isWonder:true,
|
||||
unique:"GoldenAgeLengthIncrease",
|
||||
requiredTech:"Civil Service"
|
||||
},
|
||||
{
|
||||
name:"Stable",
|
||||
description: "",
|
||||
@ -181,15 +190,6 @@
|
||||
unique:"GreatPersonGenerationIncrease",
|
||||
requiredTech:"Theology"
|
||||
},
|
||||
{
|
||||
name:"Chichen Itza",
|
||||
description: "Length of golden ages increased +50%",
|
||||
culture:1,
|
||||
greatPersonPoints:{production:1},
|
||||
isWonder:true,
|
||||
unique:"GoldenAgeLengthIncrease",
|
||||
requiredTech:"Currency"
|
||||
},
|
||||
{
|
||||
name:"Mint",
|
||||
description: "",
|
||||
@ -229,7 +229,7 @@
|
||||
},
|
||||
{
|
||||
name:"Forge",
|
||||
description: "Iron provides +1 production",
|
||||
description: "",
|
||||
maintainance:1,
|
||||
hurryCostModifier:25,
|
||||
requiredNearbyImprovedResources:["Iron"],
|
||||
|
@ -178,7 +178,7 @@
|
||||
},
|
||||
{
|
||||
name:"Humanism",
|
||||
description:"+1 happiness from every university, observtory and public school",
|
||||
description:"+1 happiness from every university, observatory and public school",
|
||||
row:1,
|
||||
column:5
|
||||
},
|
||||
|
@ -160,6 +160,12 @@
|
||||
prerequisites:["Horseback Riding","Philosophy"],
|
||||
description:"Enables the Chichen Itza wonder, which increases the length of golden ages, and the National College, increasing science"
|
||||
},
|
||||
{
|
||||
name:"Physics",
|
||||
row:8,
|
||||
prerequisites:["Engineering"],
|
||||
description:"Enables construction of the Porcelain Tower, increasing production to science production"
|
||||
},
|
||||
{
|
||||
name:"Metal Casting",
|
||||
row:10,
|
||||
@ -197,14 +203,8 @@
|
||||
{
|
||||
name:"Machinery",
|
||||
row:8,
|
||||
prerequisites:["Physics"],
|
||||
prerequisites:["Physics","Metal Casting"],
|
||||
description:"Speeds movement speed on roads and allows you to construct the Ironworks wonder, which gives a massive boost in production"
|
||||
},
|
||||
{
|
||||
name:"Physics",
|
||||
row:9,
|
||||
prerequisites:["Engineering","Metal Casting"],
|
||||
description:"Enables construction of the Porcelain Tower, increasing production to science production"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
@ -21,7 +21,7 @@ android {
|
||||
applicationId "com.unciv.game"
|
||||
minSdkVersion 9
|
||||
targetSdkVersion 25
|
||||
versionCode 12
|
||||
versionCode 13
|
||||
versionName "0.9"
|
||||
}
|
||||
buildTypes {
|
||||
|
@ -21,7 +21,6 @@ public class CityInfo {
|
||||
public int population = 1;
|
||||
public int foodStored = 0;
|
||||
public LinqHashMap<String,FullStats> buildingsSpecialists = new LinqHashMap<String, FullStats>();
|
||||
public FullStats specialists = new FullStats();
|
||||
|
||||
public FullStats cityStats; // This is so we won't have to calculate this multiple times - takes a lot of time, especially on phones!
|
||||
|
||||
|
@ -24,6 +24,7 @@ import com.unciv.game.pickerscreens.ImprovementPickerScreen;
|
||||
import com.unciv.game.utils.CameraStageBaseScreen;
|
||||
import com.unciv.game.utils.HexMath;
|
||||
import com.unciv.game.utils.ImageGetter;
|
||||
import com.unciv.models.LinqCollection;
|
||||
import com.unciv.models.gamebasics.Building;
|
||||
import com.unciv.models.gamebasics.GameBasics;
|
||||
import com.unciv.models.gamebasics.TileImprovement;
|
||||
@ -33,6 +34,8 @@ import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashMap;
|
||||
|
||||
import javax.print.attribute.standard.MediaSize;
|
||||
|
||||
public class CityScreen extends CameraStageBaseScreen {
|
||||
|
||||
TileInfo selectedTile = null;
|
||||
@ -119,35 +122,68 @@ public class CityScreen extends CameraStageBaseScreen {
|
||||
private void updateBuildingsTable(){
|
||||
BuildingsTable.clear();
|
||||
|
||||
for(Building building : getCity().cityConstructions.getBuiltBuildings()){
|
||||
BuildingsTable.add(new Label(building.name,skin)).pad(10);
|
||||
if(building.specialistSlots==null) BuildingsTable.add();
|
||||
else {
|
||||
Table specialists = new Table();
|
||||
specialists.row().size(20).pad(10);
|
||||
if(!getCity().buildingsSpecialists.containsKey(building.name))
|
||||
getCity().buildingsSpecialists.put(building.name, new FullStats());
|
||||
FullStats currentBuildingSpecialists = getCity().buildingsSpecialists.get(building.name);
|
||||
for (int i = 0; i < building.specialistSlots.production; i++) {
|
||||
specialists.add(getSpecialistIcon("StatIcons/populationBrown.png",building.name,
|
||||
currentBuildingSpecialists.production > i, new FullStats(){{production=1;}}) );
|
||||
}
|
||||
for (int i = 0; i < building.specialistSlots.science; i++) {
|
||||
specialists.add(getSpecialistIcon("StatIcons/populationBlue.png",building.name,
|
||||
currentBuildingSpecialists.science > i, new FullStats(){{science=1;}}) );
|
||||
}
|
||||
for (int i = 0; i < building.specialistSlots.culture; i++) {
|
||||
specialists.add(getSpecialistIcon("StatIcons/populationPurple.png",building.name,
|
||||
currentBuildingSpecialists.culture > i, new FullStats(){{culture=1;}}) );
|
||||
}
|
||||
for (int i = 0; i < building.specialistSlots.gold; i++) {
|
||||
specialists.add(getSpecialistIcon("StatIcons/populationYellow.png",building.name,
|
||||
currentBuildingSpecialists.gold > i, new FullStats(){{gold=1;}}) );
|
||||
}
|
||||
BuildingsTable.add(specialists);
|
||||
}
|
||||
BuildingsTable.row();
|
||||
|
||||
LinqCollection<Building> Wonders = new LinqCollection<Building>();
|
||||
LinqCollection<Building> SpecialistBuildings = new LinqCollection<Building>();
|
||||
LinqCollection<Building> Others = new LinqCollection<Building>();
|
||||
|
||||
for(Building building : getCity().cityConstructions.getBuiltBuildings()) {
|
||||
if (building.isWonder) Wonders.add(building);
|
||||
else if (building.specialistSlots != null) SpecialistBuildings.add(building);
|
||||
else Others.add(building);
|
||||
}
|
||||
|
||||
Label label = new Label("Wonders",skin);
|
||||
label.setFontScale(1.5f);
|
||||
label.setColor(Color.GREEN);
|
||||
BuildingsTable.add(label).pad(5).row();
|
||||
for(Building building:Wonders) BuildingsTable.add(new Label(building.name,skin)).pad(5).row();
|
||||
|
||||
label = new Label("Specialist Buildings",skin);
|
||||
label.setFontScale(1.5f);
|
||||
label.setColor(Color.GREEN);
|
||||
BuildingsTable.add(label).pad(5).row();
|
||||
for(Building building:SpecialistBuildings) {
|
||||
BuildingsTable.add(new Label(building.name, skin)).pad(5);
|
||||
Table specialists = new Table();
|
||||
specialists.row().size(20).pad(5);
|
||||
if (!getCity().buildingsSpecialists.containsKey(building.name))
|
||||
getCity().buildingsSpecialists.put(building.name, new FullStats());
|
||||
FullStats currentBuildingSpecialists = getCity().buildingsSpecialists.get(building.name);
|
||||
for (int i = 0; i < building.specialistSlots.production; i++) {
|
||||
specialists.add(getSpecialistIcon("StatIcons/populationBrown.png", building.name,
|
||||
currentBuildingSpecialists.production > i, new FullStats() {{
|
||||
production = 1;
|
||||
}}));
|
||||
}
|
||||
for (int i = 0; i < building.specialistSlots.science; i++) {
|
||||
specialists.add(getSpecialistIcon("StatIcons/populationBlue.png", building.name,
|
||||
currentBuildingSpecialists.science > i, new FullStats() {{
|
||||
science = 1;
|
||||
}}));
|
||||
}
|
||||
for (int i = 0; i < building.specialistSlots.culture; i++) {
|
||||
specialists.add(getSpecialistIcon("StatIcons/populationPurple.png", building.name,
|
||||
currentBuildingSpecialists.culture > i, new FullStats() {{
|
||||
culture = 1;
|
||||
}}));
|
||||
}
|
||||
for (int i = 0; i < building.specialistSlots.gold; i++) {
|
||||
specialists.add(getSpecialistIcon("StatIcons/populationYellow.png", building.name,
|
||||
currentBuildingSpecialists.gold > i, new FullStats() {{
|
||||
gold = 1;
|
||||
}}));
|
||||
}
|
||||
BuildingsTable.add(specialists).row();
|
||||
}
|
||||
|
||||
label = new Label("Buildings",skin);
|
||||
|
||||
label.setFontScale(1.5f);
|
||||
label.setColor(Color.GREEN);
|
||||
BuildingsTable.add(label).pad(5).row();
|
||||
for(Building building:Others) BuildingsTable.add(new Label(building.name,skin)).pad(5).row();
|
||||
|
||||
BuildingsTable.pack();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user