City stats now update when adopting policy

This commit is contained in:
Yair Morgenstern 2018-01-20 23:23:30 +02:00
parent 80e3d16895
commit dd6805d179
3 changed files with 6 additions and 5 deletions

View file

@ -56,6 +56,10 @@ public class PolicyManager {
if (policiesCompleteInBranch == branch.policies.size() - 1) { // All done apart from 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"))
CivilizationInfo.current().tileMap.
placeUnitNearTile(CivilizationInfo.current().getCapital().cityLocation, "Settler");

View file

@ -199,7 +199,6 @@ public class CityScreen extends CameraStageBaseScreen {
if(!Others.isEmpty()) {
Label label = new Label("Buildings", skin);
label.setFontScale(1.5f);
label.setColor(Color.GREEN);
BuildingsTable.add(label).pad(5).row();

View file

@ -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.TextButton;
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.models.linq.Linq;
import com.unciv.models.gamebasics.GameBasics;
import com.unciv.models.gamebasics.Policy;
import com.unciv.models.gamebasics.PolicyBranch;
import com.unciv.models.gamebasics.StringUtils;
import com.unciv.ui.utils.ImageGetter;
public class PolicyPickerScreen extends PickerScreen {
@ -111,7 +109,7 @@ public class PolicyPickerScreen extends PickerScreen {
public Button getPolicyButton(final Policy policy, boolean image) {
Button toReturn = new Button(skin);
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);
} else toReturn = new TextButton(policy.name, skin);