mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-23 03:23:17 -04:00
City stats now update when adopting policy
This commit is contained in:
parent
80e3d16895
commit
dd6805d179
@ -56,6 +56,10 @@ public class PolicyManager {
|
|||||||
if (policiesCompleteInBranch == branch.policies.size() - 1) { // All done apart from branch completion
|
if (policiesCompleteInBranch == branch.policies.size() - 1) { // All done apart from branch completion
|
||||||
adopt(branch.policies.get(branch.policies.size() - 1)); // add branch completion!
|
adopt(branch.policies.get(branch.policies.size() - 1)); // add branch completion!
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for(CityInfo cityInfo : CivilizationInfo.current().cities)
|
||||||
|
cityInfo.cityStats.update();
|
||||||
|
|
||||||
if (policy.name.equals("Collective Rule"))
|
if (policy.name.equals("Collective Rule"))
|
||||||
CivilizationInfo.current().tileMap.
|
CivilizationInfo.current().tileMap.
|
||||||
placeUnitNearTile(CivilizationInfo.current().getCapital().cityLocation, "Settler");
|
placeUnitNearTile(CivilizationInfo.current().getCapital().cityLocation, "Settler");
|
||||||
|
@ -199,7 +199,6 @@ public class CityScreen extends CameraStageBaseScreen {
|
|||||||
|
|
||||||
if(!Others.isEmpty()) {
|
if(!Others.isEmpty()) {
|
||||||
Label label = new Label("Buildings", skin);
|
Label label = new Label("Buildings", skin);
|
||||||
|
|
||||||
label.setFontScale(1.5f);
|
label.setFontScale(1.5f);
|
||||||
label.setColor(Color.GREEN);
|
label.setColor(Color.GREEN);
|
||||||
BuildingsTable.add(label).pad(5).row();
|
BuildingsTable.add(label).pad(5).row();
|
||||||
|
@ -8,15 +8,13 @@ import com.badlogic.gdx.scenes.scene2d.ui.Image;
|
|||||||
import com.badlogic.gdx.scenes.scene2d.ui.Table;
|
import com.badlogic.gdx.scenes.scene2d.ui.Table;
|
||||||
import com.badlogic.gdx.scenes.scene2d.ui.TextButton;
|
import com.badlogic.gdx.scenes.scene2d.ui.TextButton;
|
||||||
import com.badlogic.gdx.scenes.scene2d.utils.ClickListener;
|
import com.badlogic.gdx.scenes.scene2d.utils.ClickListener;
|
||||||
import com.badlogic.gdx.utils.Predicate;
|
|
||||||
import com.unciv.logic.city.CityInfo;
|
|
||||||
import com.unciv.logic.civilization.CivilizationInfo;
|
|
||||||
import com.unciv.logic.civilization.PolicyManager;
|
import com.unciv.logic.civilization.PolicyManager;
|
||||||
import com.unciv.models.linq.Linq;
|
import com.unciv.models.linq.Linq;
|
||||||
import com.unciv.models.gamebasics.GameBasics;
|
import com.unciv.models.gamebasics.GameBasics;
|
||||||
import com.unciv.models.gamebasics.Policy;
|
import com.unciv.models.gamebasics.Policy;
|
||||||
import com.unciv.models.gamebasics.PolicyBranch;
|
import com.unciv.models.gamebasics.PolicyBranch;
|
||||||
import com.unciv.models.gamebasics.StringUtils;
|
import com.unciv.models.gamebasics.StringUtils;
|
||||||
|
import com.unciv.ui.utils.ImageGetter;
|
||||||
|
|
||||||
public class PolicyPickerScreen extends PickerScreen {
|
public class PolicyPickerScreen extends PickerScreen {
|
||||||
|
|
||||||
@ -111,7 +109,7 @@ public class PolicyPickerScreen extends PickerScreen {
|
|||||||
public Button getPolicyButton(final Policy policy, boolean image) {
|
public Button getPolicyButton(final Policy policy, boolean image) {
|
||||||
Button toReturn = new Button(skin);
|
Button toReturn = new Button(skin);
|
||||||
if (image) {
|
if (image) {
|
||||||
Image policyImage = com.unciv.ui.utils.ImageGetter.getImage("PolicyIcons/" + policy.name.replace(" ", "_") + "_(Civ5).png");
|
Image policyImage = ImageGetter.getImage("PolicyIcons/" + policy.name.replace(" ", "_") + "_(Civ5).png");
|
||||||
toReturn.add(policyImage).size(30);
|
toReturn.add(policyImage).size(30);
|
||||||
} else toReturn = new TextButton(policy.name, skin);
|
} else toReturn = new TextButton(policy.name, skin);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user