mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-02-10 18:57:39 +07:00
Sector land announcement
This commit is contained in:
parent
b801093597
commit
2a0af620be
@ -181,6 +181,12 @@ public class Control implements ApplicationListener, Loadable{
|
||||
Time.run(Fx.coreLand.lifetime, () -> {
|
||||
Fx.launch.at(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);
|
||||
}
|
||||
|
||||
@Remote(variants = Variant.both)
|
||||
public static void announce(String message){
|
||||
if(message == null) return;
|
||||
|
||||
ui.announce(message);
|
||||
}
|
||||
|
||||
@Remote(variants = Variant.both)
|
||||
public static void infoMessage(String message){
|
||||
if(message == null) return;
|
||||
|
@ -487,13 +487,19 @@ public class UI implements ApplicationListener, Loadable{
|
||||
dialog.show();
|
||||
}
|
||||
|
||||
/** Display text in the middle of the screen, then fade out. */
|
||||
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.background(Styles.black3).margin(8f)
|
||||
.add(text).style(Styles.outlineLabel).labelAlign(Align.center);
|
||||
t.margin(8f).add(text).style(Styles.outlineLabel).labelAlign(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);
|
||||
}
|
||||
|
||||
|
@ -331,7 +331,6 @@ public class World{
|
||||
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.sort(Structs.comps(Structs.comparing(Content::getContentType), Structs.comparingInt(c -> c.id)));
|
||||
sector.saveInfo();
|
||||
|
@ -382,8 +382,6 @@ public class PlanetDialog extends BaseDialog implements PlanetInterfaceRenderer{
|
||||
stable.row();
|
||||
}
|
||||
|
||||
Log.info("sector resources = @ / @", sector.info.resources, sector.info.hashCode());
|
||||
|
||||
if(sector.save != null && sector.info.resources.any()){
|
||||
stable.add("@sectors.resources").row();
|
||||
stable.table(t -> {
|
||||
|
Loading…
Reference in New Issue
Block a user