too many things to list
This commit is contained in:
@@ -76,13 +76,15 @@ public class HostDialog extends BaseDialog{
|
||||
platform.updateLobby();
|
||||
});
|
||||
}));
|
||||
|
||||
if(Version.modifier.contains("beta") || Version.modifier.contains("alpha")){
|
||||
Core.settings.put("publichost", false);
|
||||
platform.updateLobby();
|
||||
Core.settings.getBoolOnce("betapublic", () -> ui.showInfo("@public.beta"));
|
||||
}
|
||||
}
|
||||
|
||||
if(Version.modifier.contains("beta")){
|
||||
Core.settings.put("publichost", false);
|
||||
platform.updateLobby();
|
||||
Core.settings.getBoolOnce("betapublic", () -> ui.showInfo("@public.beta"));
|
||||
}
|
||||
|
||||
}catch(IOException e){
|
||||
ui.showException("@server.error", e);
|
||||
}
|
||||
|
||||
@@ -367,8 +367,10 @@ public class JoinDialog extends BaseDialog{
|
||||
|
||||
local.row();
|
||||
|
||||
TextButton button = local.button("", Styles.cleart, () -> safeConnect(host.address, host.port, host.version))
|
||||
.width(w).pad(5f).get();
|
||||
TextButton button = local.button("", Styles.cleart, () -> {
|
||||
Events.fire(new ClientPreConnectEvent(host));
|
||||
safeConnect(host.address, host.port, host.version);
|
||||
}).width(w).pad(5f).get();
|
||||
button.clearChildren();
|
||||
buildServer(host, button);
|
||||
}
|
||||
@@ -379,8 +381,10 @@ public class JoinDialog extends BaseDialog{
|
||||
|
||||
global.row();
|
||||
|
||||
TextButton button = global.button("", Styles.cleart, () -> safeConnect(host.address, host.port, host.version))
|
||||
.width(w).pad(5f).get();
|
||||
TextButton button = global.button("", Styles.cleart, () -> {
|
||||
Events.fire(new ClientPreConnectEvent(host));
|
||||
safeConnect(host.address, host.port, host.version);
|
||||
}).width(w).pad(5f).get();
|
||||
button.clearChildren();
|
||||
buildServer(host, button);
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package mindustry.ui.dialogs;
|
||||
|
||||
import arc.*;
|
||||
import arc.func.*;
|
||||
import arc.input.*;
|
||||
import arc.scene.ui.*;
|
||||
import arc.scene.ui.layout.*;
|
||||
import arc.struct.*;
|
||||
@@ -33,7 +34,14 @@ public class LaunchLoadoutDialog extends BaseDialog{
|
||||
cont.clear();
|
||||
buttons.clear();
|
||||
|
||||
addCloseButton();
|
||||
buttons.defaults().size(160f, 64f);
|
||||
buttons.button("@back", Icon.left, this::hide);
|
||||
|
||||
keyDown(key -> {
|
||||
if(key == KeyCode.escape || key == KeyCode.back){
|
||||
Core.app.post(this::hide);
|
||||
}
|
||||
});
|
||||
|
||||
//updates sum requirements
|
||||
Runnable update = () -> {
|
||||
@@ -79,7 +87,7 @@ public class LaunchLoadoutDialog extends BaseDialog{
|
||||
update.run();
|
||||
rebuildItems.run();
|
||||
});
|
||||
});
|
||||
}).width(204);
|
||||
|
||||
buttons.button("@launch.text", Icon.ok, () -> {
|
||||
universe.updateLoadout(core, selected);
|
||||
|
||||
@@ -34,12 +34,11 @@ public class PausedDialog extends BaseDialog{
|
||||
});
|
||||
|
||||
if(!mobile){
|
||||
//TODO localize
|
||||
//TODO capturing is disabled, remove?
|
||||
//cont.label(() -> state.getSector() == null ? "" :
|
||||
//("[lightgray]Next turn in [accent]" + state.getSector().displayTimeRemaining() +
|
||||
// (state.rules.winWave > 0 && !state.getSector().isCaptured() ? "\n[lightgray]Reach wave[accent] " + state.rules.winWave + "[] to capture" : "")))
|
||||
// .visible(() -> state.getSector() != null).colspan(2);
|
||||
//TODO localize + move to other wave menu
|
||||
cont.label(() -> state.getSector() == null || state.rules.winWave <= 0 || state.getSector().isCaptured() ? "" :
|
||||
(state.rules.winWave > 0 && !state.getSector().isCaptured() ?
|
||||
(state.wave >= state.rules.winWave ? "\n[lightgray]Defeat remaining enemies to capture" : "\n[lightgray]Reach wave[accent] " + state.rules.winWave + "[] to capture") : ""))
|
||||
.visible(() -> state.getSector() != null).colspan(2);
|
||||
cont.row();
|
||||
|
||||
float dw = 220f;
|
||||
@@ -89,7 +88,7 @@ public class PausedDialog extends BaseDialog{
|
||||
cont.buttonRow("@launchcore", Icon.up, () -> {
|
||||
hide();
|
||||
ui.planet.showLaunch(state.getSector(), player.team().core());
|
||||
}).disabled(b -> player.team().core() == null);
|
||||
}).disabled(b -> player.team().core() == null || net.client());
|
||||
|
||||
cont.row();
|
||||
|
||||
@@ -101,7 +100,11 @@ public class PausedDialog extends BaseDialog{
|
||||
cont.row();
|
||||
}
|
||||
|
||||
cont.buttonRow("@hostserver.mobile", Icon.host, ui.host::show).disabled(b -> net.active());
|
||||
if(state.isCampaign() && net.active()){
|
||||
cont.buttonRow("@research", Icon.tree, ui.research::show);
|
||||
}else{
|
||||
cont.buttonRow("@hostserver.mobile", Icon.host, ui.host::show).disabled(b -> net.active());
|
||||
}
|
||||
|
||||
cont.buttonRow("@quit", Icon.exit, this::showQuitConfirm).update(s -> {
|
||||
s.setText(control.saves.getCurrent() != null && control.saves.getCurrent().isAutosave() ? "@save.quit" : "@quit");
|
||||
|
||||
@@ -217,9 +217,9 @@ public class PlanetDialog extends BaseDialog implements PlanetInterfaceRenderer{
|
||||
public void renderProjections(){
|
||||
if(hovered != null){
|
||||
planets.drawPlane(hovered, () -> {
|
||||
Draw.color(Color.white, Pal.accent, Mathf.absin(5f, 1f));
|
||||
Draw.color(hovered.isUnderAttack() ? Pal.remove : Color.white, Pal.accent, Mathf.absin(5f, 1f));
|
||||
|
||||
TextureRegion icon = hovered.locked() && !canSelect(hovered) ? Icon.lock.getRegion() : null;
|
||||
TextureRegion icon = hovered.locked() && !canSelect(hovered) ? Icon.lock.getRegion() : hovered.isUnderAttack() ? Icon.warning.getRegion() : null;
|
||||
|
||||
if(icon != null){
|
||||
Draw.rect(icon, 0, 0);
|
||||
@@ -355,20 +355,18 @@ public class PlanetDialog extends BaseDialog implements PlanetInterfaceRenderer{
|
||||
stable.add("[accent]" + (sector.preset == null ? sector.id : sector.preset.localizedName)).row();
|
||||
stable.image().color(Pal.accent).fillX().height(3f).pad(3f).row();
|
||||
stable.add(sector.save != null ? sector.save.getPlayTime() : "@sectors.unexplored").row();
|
||||
if(sector.hasWaves() || sector.hasEnemyBase()){
|
||||
if(sector.isUnderAttack() || sector.hasEnemyBase()){
|
||||
stable.add("[accent]Difficulty: " + (int)(sector.baseCoverage * 10)).row();
|
||||
}
|
||||
|
||||
//TODO sector damage is disabled, remove when finalized
|
||||
/*
|
||||
if(sector.hasBase() && sector.hasWaves()){
|
||||
if(sector.isUnderAttack()){
|
||||
//TODO localize when finalized
|
||||
//these mechanics are likely to change and as such are not added to the bundle
|
||||
stable.add("[scarlet]Under attack!");
|
||||
stable.row();
|
||||
stable.add("[accent]" + Mathf.ceil(sectorDestructionTurns - (sector.getSecondsPassed() * 60) / turnDuration) + " turn(s)\nuntil destruction");
|
||||
stable.add("[accent]" + (int)(sector.getDamage() * 100) + "% damaged");
|
||||
stable.row();
|
||||
}*/
|
||||
}
|
||||
|
||||
if(sector.save != null){
|
||||
stable.add("@sectors.resources").row();
|
||||
|
||||
@@ -164,13 +164,10 @@ public class ResearchDialog extends BaseDialog{
|
||||
|
||||
@Override
|
||||
public Dialog show(){
|
||||
Core.app.post(() -> {
|
||||
if(net.client()){
|
||||
//TODO make this not display every time
|
||||
//TODO rework this in the future
|
||||
ui.showInfo("@campaign.multiplayer");
|
||||
}
|
||||
});
|
||||
if(net.client()){
|
||||
ui.showInfo("@research.multiplayer");
|
||||
return null;
|
||||
}
|
||||
|
||||
return super.show();
|
||||
}
|
||||
|
||||
@@ -250,7 +250,6 @@ public class SettingsMenuDialog extends SettingsDialog{
|
||||
if(!mobile){
|
||||
game.checkPref("buildautopause", false);
|
||||
}
|
||||
game.checkPref("mapcenter", true);
|
||||
|
||||
if(steam){
|
||||
game.sliderPref("playerlimit", 16, 2, 32, i -> {
|
||||
|
||||
Reference in New Issue
Block a user