mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-24 03:53:12 -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",
|
name:"Stone Works",
|
||||||
description: "Stone and marble provide +1 production.",
|
description: "",
|
||||||
happiness:1,
|
happiness:1,
|
||||||
production:1
|
production:1
|
||||||
requiredNearbyImprovedResources:["Marble","Stone"]
|
requiredNearbyImprovedResources:["Marble","Stone"]
|
||||||
@ -110,6 +110,15 @@
|
|||||||
requiredBuildingInAllCities:"Library",
|
requiredBuildingInAllCities:"Library",
|
||||||
requiredTech:"Civil Service"
|
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",
|
name:"Stable",
|
||||||
description: "",
|
description: "",
|
||||||
@ -181,15 +190,6 @@
|
|||||||
unique:"GreatPersonGenerationIncrease",
|
unique:"GreatPersonGenerationIncrease",
|
||||||
requiredTech:"Theology"
|
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",
|
name:"Mint",
|
||||||
description: "",
|
description: "",
|
||||||
@ -229,7 +229,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
name:"Forge",
|
name:"Forge",
|
||||||
description: "Iron provides +1 production",
|
description: "",
|
||||||
maintainance:1,
|
maintainance:1,
|
||||||
hurryCostModifier:25,
|
hurryCostModifier:25,
|
||||||
requiredNearbyImprovedResources:["Iron"],
|
requiredNearbyImprovedResources:["Iron"],
|
||||||
|
@ -178,7 +178,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
name:"Humanism",
|
name:"Humanism",
|
||||||
description:"+1 happiness from every university, observtory and public school",
|
description:"+1 happiness from every university, observatory and public school",
|
||||||
row:1,
|
row:1,
|
||||||
column:5
|
column:5
|
||||||
},
|
},
|
||||||
|
@ -160,6 +160,12 @@
|
|||||||
prerequisites:["Horseback Riding","Philosophy"],
|
prerequisites:["Horseback Riding","Philosophy"],
|
||||||
description:"Enables the Chichen Itza wonder, which increases the length of golden ages, and the National College, increasing science"
|
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",
|
name:"Metal Casting",
|
||||||
row:10,
|
row:10,
|
||||||
@ -197,14 +203,8 @@
|
|||||||
{
|
{
|
||||||
name:"Machinery",
|
name:"Machinery",
|
||||||
row:8,
|
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"
|
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"
|
applicationId "com.unciv.game"
|
||||||
minSdkVersion 9
|
minSdkVersion 9
|
||||||
targetSdkVersion 25
|
targetSdkVersion 25
|
||||||
versionCode 12
|
versionCode 13
|
||||||
versionName "0.9"
|
versionName "0.9"
|
||||||
}
|
}
|
||||||
buildTypes {
|
buildTypes {
|
||||||
|
@ -21,7 +21,6 @@ public class CityInfo {
|
|||||||
public int population = 1;
|
public int population = 1;
|
||||||
public int foodStored = 0;
|
public int foodStored = 0;
|
||||||
public LinqHashMap<String,FullStats> buildingsSpecialists = new LinqHashMap<String, FullStats>();
|
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!
|
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.CameraStageBaseScreen;
|
||||||
import com.unciv.game.utils.HexMath;
|
import com.unciv.game.utils.HexMath;
|
||||||
import com.unciv.game.utils.ImageGetter;
|
import com.unciv.game.utils.ImageGetter;
|
||||||
|
import com.unciv.models.LinqCollection;
|
||||||
import com.unciv.models.gamebasics.Building;
|
import com.unciv.models.gamebasics.Building;
|
||||||
import com.unciv.models.gamebasics.GameBasics;
|
import com.unciv.models.gamebasics.GameBasics;
|
||||||
import com.unciv.models.gamebasics.TileImprovement;
|
import com.unciv.models.gamebasics.TileImprovement;
|
||||||
@ -33,6 +34,8 @@ import java.util.ArrayList;
|
|||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.LinkedHashMap;
|
import java.util.LinkedHashMap;
|
||||||
|
|
||||||
|
import javax.print.attribute.standard.MediaSize;
|
||||||
|
|
||||||
public class CityScreen extends CameraStageBaseScreen {
|
public class CityScreen extends CameraStageBaseScreen {
|
||||||
|
|
||||||
TileInfo selectedTile = null;
|
TileInfo selectedTile = null;
|
||||||
@ -119,35 +122,68 @@ public class CityScreen extends CameraStageBaseScreen {
|
|||||||
private void updateBuildingsTable(){
|
private void updateBuildingsTable(){
|
||||||
BuildingsTable.clear();
|
BuildingsTable.clear();
|
||||||
|
|
||||||
for(Building building : getCity().cityConstructions.getBuiltBuildings()){
|
|
||||||
BuildingsTable.add(new Label(building.name,skin)).pad(10);
|
LinqCollection<Building> Wonders = new LinqCollection<Building>();
|
||||||
if(building.specialistSlots==null) BuildingsTable.add();
|
LinqCollection<Building> SpecialistBuildings = new LinqCollection<Building>();
|
||||||
else {
|
LinqCollection<Building> Others = new LinqCollection<Building>();
|
||||||
Table specialists = new Table();
|
|
||||||
specialists.row().size(20).pad(10);
|
for(Building building : getCity().cityConstructions.getBuiltBuildings()) {
|
||||||
if(!getCity().buildingsSpecialists.containsKey(building.name))
|
if (building.isWonder) Wonders.add(building);
|
||||||
getCity().buildingsSpecialists.put(building.name, new FullStats());
|
else if (building.specialistSlots != null) SpecialistBuildings.add(building);
|
||||||
FullStats currentBuildingSpecialists = getCity().buildingsSpecialists.get(building.name);
|
else Others.add(building);
|
||||||
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();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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();
|
BuildingsTable.pack();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user