Sector land announcement
This commit is contained in:
@@ -181,6 +181,12 @@ public class Control implements ApplicationListener, Loadable{
|
|||||||
Time.run(Fx.coreLand.lifetime, () -> {
|
Time.run(Fx.coreLand.lifetime, () -> {
|
||||||
Fx.launch.at(core);
|
Fx.launch.at(core);
|
||||||
Effect.shake(5f, 5f, core);
|
Effect.shake(5f, 5f, core);
|
||||||
|
|
||||||
|
if(state.isCampaign()){
|
||||||
|
ui.announce("[accent]" + state.rules.sector.name() + "\n" +
|
||||||
|
(state.rules.sector.info.resources.any() ? "[lightgray]" + bundle.get("sectors.resources") + "[white] " +
|
||||||
|
state.rules.sector.info.resources.toString(" ", u -> u.emoji()) : ""), 5);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -293,6 +293,13 @@ public class NetClient implements ApplicationListener{
|
|||||||
setHudText(message);
|
setHudText(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Remote(variants = Variant.both)
|
||||||
|
public static void announce(String message){
|
||||||
|
if(message == null) return;
|
||||||
|
|
||||||
|
ui.announce(message);
|
||||||
|
}
|
||||||
|
|
||||||
@Remote(variants = Variant.both)
|
@Remote(variants = Variant.both)
|
||||||
public static void infoMessage(String message){
|
public static void infoMessage(String message){
|
||||||
if(message == null) return;
|
if(message == null) return;
|
||||||
|
|||||||
@@ -487,13 +487,19 @@ public class UI implements ApplicationListener, Loadable{
|
|||||||
dialog.show();
|
dialog.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Display text in the middle of the screen, then fade out. */
|
||||||
public void announce(String text){
|
public void announce(String text){
|
||||||
Table t = new Table();
|
announce(text, 3);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Display text in the middle of the screen, then fade out. */
|
||||||
|
public void announce(String text, float duration){
|
||||||
|
Table t = new Table(Styles.black3);
|
||||||
t.touchable = Touchable.disabled;
|
t.touchable = Touchable.disabled;
|
||||||
t.background(Styles.black3).margin(8f)
|
t.margin(8f).add(text).style(Styles.outlineLabel).labelAlign(Align.center);
|
||||||
.add(text).style(Styles.outlineLabel).labelAlign(Align.center);
|
|
||||||
t.update(() -> t.setPosition(Core.graphics.getWidth()/2f, Core.graphics.getHeight()/2f, Align.center));
|
t.update(() -> t.setPosition(Core.graphics.getWidth()/2f, Core.graphics.getHeight()/2f, Align.center));
|
||||||
t.actions(Actions.fadeOut(3, Interp.pow4In), Actions.remove());
|
t.actions(Actions.fadeOut(duration, Interp.pow4In), Actions.remove());
|
||||||
|
t.pack();
|
||||||
Core.scene.add(t);
|
Core.scene.add(t);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -331,7 +331,6 @@ public class World{
|
|||||||
state.rules.weather.add(new WeatherEntry(Weathers.sporestorm));
|
state.rules.weather.add(new WeatherEntry(Weathers.sporestorm));
|
||||||
}
|
}
|
||||||
|
|
||||||
Log.info("saving resources as @ -> @ / @", sector.info.resources, content.asArray(), sector.info.hashCode());
|
|
||||||
sector.info.resources = content.asArray();
|
sector.info.resources = content.asArray();
|
||||||
sector.info.resources.sort(Structs.comps(Structs.comparing(Content::getContentType), Structs.comparingInt(c -> c.id)));
|
sector.info.resources.sort(Structs.comps(Structs.comparing(Content::getContentType), Structs.comparingInt(c -> c.id)));
|
||||||
sector.saveInfo();
|
sector.saveInfo();
|
||||||
|
|||||||
@@ -382,8 +382,6 @@ public class PlanetDialog extends BaseDialog implements PlanetInterfaceRenderer{
|
|||||||
stable.row();
|
stable.row();
|
||||||
}
|
}
|
||||||
|
|
||||||
Log.info("sector resources = @ / @", sector.info.resources, sector.info.hashCode());
|
|
||||||
|
|
||||||
if(sector.save != null && sector.info.resources.any()){
|
if(sector.save != null && sector.info.resources.any()){
|
||||||
stable.add("@sectors.resources").row();
|
stable.add("@sectors.resources").row();
|
||||||
stable.table(t -> {
|
stable.table(t -> {
|
||||||
|
|||||||
Reference in New Issue
Block a user