mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-31 15:19:29 +07:00
Notifications are scrollable, workers do automated action when button is clicked
This commit is contained in:
@ -45,7 +45,7 @@ public class MapUnit{
|
||||
}
|
||||
}
|
||||
|
||||
private void doAutomatedAction(TileInfo tile){
|
||||
public void doAutomatedAction(TileInfo tile){
|
||||
if(tile.owner!=null && tile.improvement==null // We'll be working this tile
|
||||
&& (tile.workingCity!=null || tile.resource!=null || tile.improvementInProgress!=null)
|
||||
&& tile.canBuildImprovement(GameBasics.TileImprovements.get(chooseImprovement(tile))))
|
||||
|
@ -96,7 +96,7 @@ public class CityScreen extends CameraStageBaseScreen {
|
||||
|
||||
private Image getSpecialistIcon(String imageName, final boolean isFilled, final FullStats specialistType) {
|
||||
Image specialist = ImageGetter.getImage(imageName);
|
||||
specialist.setSize(30,30);
|
||||
specialist.setSize(40,40);
|
||||
if(!isFilled) specialist.setColor(Color.GRAY);
|
||||
specialist.addListener(new ClickListener(){
|
||||
@Override
|
||||
|
@ -71,7 +71,10 @@ public class WorldScreen extends CameraStageBaseScreen {
|
||||
|
||||
stage.addActor(civTable);
|
||||
stage.addActor(techButton);
|
||||
stage.addActor(notificationsTable);
|
||||
|
||||
ScrollPane notificationsScroll = new ScrollPane(notificationsTable);
|
||||
notificationsScroll.setSize(stage.getWidth()/3, stage.getHeight()/3);
|
||||
stage.addActor(notificationsScroll);
|
||||
addSelectIdleUnitButton();
|
||||
update();
|
||||
|
||||
@ -473,7 +476,10 @@ public class WorldScreen extends CameraStageBaseScreen {
|
||||
public void clicked(InputEvent event, float x, float y) {
|
||||
if ("automation".equals(selectedTile.unit.action))
|
||||
selectedTile.unit.action = null;
|
||||
else selectedTile.unit.action = "automation";
|
||||
else {
|
||||
selectedTile.unit.action = "automation";
|
||||
selectedTile.unit.doAutomatedAction(selectedTile);
|
||||
}
|
||||
update();
|
||||
}
|
||||
});
|
||||
|
Reference in New Issue
Block a user