Merge branch 'master' into ThePythonGuy3-patch-1

This commit is contained in:
Anuken
2020-12-23 10:51:56 -05:00
97 changed files with 329 additions and 141 deletions

View File

@@ -284,19 +284,23 @@ public class CustomRulesDialog extends BaseDialog{
f.defaults().padRight(4).left();
f.add("@rules.weather.duration");
field(f, entry.minDuration / toMinutes, v -> entry.minDuration = v * toMinutes);
field(f, entry.minDuration / toMinutes, v -> entry.minDuration = v * toMinutes).disabled(v -> entry.always);
f.add("@waves.to");
field(f, entry.maxDuration / toMinutes, v -> entry.maxDuration = v * toMinutes);
field(f, entry.maxDuration / toMinutes, v -> entry.maxDuration = v * toMinutes).disabled(v -> entry.always);
f.add("@unit.minutes");
f.row();
f.add("@rules.weather.frequency");
field(f, entry.minFrequency / toMinutes, v -> entry.minFrequency = v * toMinutes);
field(f, entry.minFrequency / toMinutes, v -> entry.minFrequency = v * toMinutes).disabled(v -> entry.always);
f.add("@waves.to");
field(f, entry.maxFrequency / toMinutes, v -> entry.maxFrequency = v * toMinutes);
field(f, entry.maxFrequency / toMinutes, v -> entry.maxFrequency = v * toMinutes).disabled(v -> entry.always);
f.add("@unit.minutes");
f.row();
f.check("@rules.weather.always", val -> entry.always = val).checked(cc -> entry.always).padBottom(4);
//intensity can't currently be customized
}).grow().left().pad(6).top();
@@ -314,8 +318,8 @@ public class CustomRulesDialog extends BaseDialog{
dialog.addCloseButton();
dialog.buttons.button("@add", Icon.add, () -> {
BaseDialog addd = new BaseDialog("@add");
addd.cont.pane(t -> {
BaseDialog add = new BaseDialog("@add");
add.cont.pane(t -> {
t.background(Tex.button);
int i = 0;
for(Weather weather : content.<Weather>getBy(ContentType.weather)){
@@ -324,13 +328,13 @@ public class CustomRulesDialog extends BaseDialog{
rules.weather.add(new WeatherEntry(weather));
rebuild[0].run();
addd.hide();
add.hide();
}).size(140f, 50f);
if(++i % 2 == 0) t.row();
}
});
addd.addCloseButton();
addd.show();
add.addCloseButton();
add.show();
}).width(170f);
//reset cooldown to random number

View File

@@ -67,10 +67,15 @@ public class HostDialog extends BaseDialog{
player.admin(true);
if(steam){
Core.app.post(() -> Core.settings.getBoolOnce("steampublic2", () -> {
Core.app.post(() -> Core.settings.getBoolOnce("steampublic3", () -> {
ui.showCustomConfirm("@setting.publichost.name", "@public.confirm", "@yes", "@no", () -> {
Core.settings.put("publichost", true);
platform.updateLobby();
ui.showCustomConfirm("@setting.publichost.name", "@public.confirm.really", "@no", "@yes", () -> {
Core.settings.put("publichost", true);
platform.updateLobby();
}, () -> {
Core.settings.put("publichost", false);
platform.updateLobby();
});
}, () -> {
Core.settings.put("publichost", false);
platform.updateLobby();

View File

@@ -399,6 +399,7 @@ public class PlanetDialog extends BaseDialog implements PlanetInterfaceRenderer{
void setup(){
zoom = planets.zoom = 1f;
selectAlpha = 1f;
ui.minimapfrag.hide();
clearChildren();

View File

@@ -32,9 +32,9 @@ import static mindustry.Vars.net;
import static mindustry.Vars.*;
public class SettingsMenuDialog extends SettingsDialog{
private SettingsTable graphics;
private SettingsTable game;
private SettingsTable sound;
public SettingsTable graphics;
public SettingsTable game;
public SettingsTable sound;
private Table prefs;
private Table menu;

View File

@@ -110,6 +110,10 @@ public class MinimapFragment extends Fragment{
return shown;
}
public void hide(){
shown = false;
}
public void toggle(){
float size = baseSize * zoom * world.width();
float ratio = (float)renderer.minimap.getTexture().height / renderer.minimap.getTexture().width;