Merge branch 'master' of https://github.com/Anuken/Mindustry into 7.0-features

 Conflicts:
	gradle.properties
This commit is contained in:
Anuken
2021-06-28 18:57:27 -04:00
86 changed files with 1926 additions and 1025 deletions

View File

@@ -6,6 +6,7 @@ import arc.graphics.*;
import arc.input.*;
import arc.math.*;
import arc.scene.ui.*;
import arc.scene.ui.TextButton.*;
import arc.scene.ui.layout.*;
import arc.struct.*;
import arc.util.*;
@@ -34,6 +35,7 @@ public class JoinDialog extends BaseDialog{
int totalHosts;
int refreshes;
boolean showHidden;
TextButtonStyle style;
String lastIp;
int lastPort;
@@ -42,6 +44,15 @@ public class JoinDialog extends BaseDialog{
public JoinDialog(){
super("@joingame");
style = new TextButtonStyle(){{
over = Styles.flatOver;
font = Fonts.def;
fontColor = Color.white;
disabledFontColor = Color.gray;
down = Styles.flatOver;
up = Styles.black5;
}};
loadServers();
if(!steam) buttons.add().width(60f);
@@ -119,7 +130,7 @@ public class JoinDialog extends BaseDialog{
//why are java lambdas this bad
TextButton[] buttons = {null};
TextButton button = buttons[0] = remote.button("[accent]" + server.displayIP(), Styles.cleart, () -> {
TextButton button = buttons[0] = remote.button("[accent]" + server.displayIP(), style, () -> {
if(!buttons[0].childrenPressed()){
if(server.lastHost != null){
Events.fire(new ClientPreConnectEvent(server.lastHost));
@@ -405,7 +416,7 @@ public class JoinDialog extends BaseDialog{
float w = targetWidth();
//TODO looks bad
container.button(b -> buildServer(host, b), Styles.cleart, () -> {
container.button(b -> buildServer(host, b), style, () -> {
Events.fire(new ClientPreConnectEvent(host));
if(!Core.settings.getBool("server-disclaimer", false)){
ui.showCustomConfirm("@warning", "@servers.disclaimer", "@ok", "@back", () -> {
@@ -442,7 +453,7 @@ public class JoinDialog extends BaseDialog{
local.row();
local.button(b -> buildServer(host, b), Styles.cleart, () -> {
local.button(b -> buildServer(host, b), style, () -> {
Events.fire(new ClientPreConnectEvent(host));
safeConnect(host.address, host.port, host.version);
}).width(w);

View File

@@ -72,7 +72,6 @@ public class KeybindDialog extends Dialog{
}
if(sections.length != 1){
//TODO toggle style
TextButton button = new TextButton(bundle.get("section." + section.name + ".name", Strings.capitalize(section.name))/*, "toggle"*/);
if(section.equals(this.section))
button.toggle();

View File

@@ -324,7 +324,6 @@ public class ModsDialog extends BaseDialog{
if(showImport) dialog.buttons.button("@mods.browser.reinstall", Icon.download, () -> githubImportMod(mod.getRepo(), mod.isJava()));
}
//TODO improve this menu later
dialog.cont.pane(desc -> {
desc.center();
desc.defaults().padTop(10).left();

View File

@@ -241,7 +241,7 @@ public class PlanetDialog extends BaseDialog implements PlanetInterfaceRenderer{
dialog.add("@sectors.captured");
}
//TODO
//TODO unimplemented, cutscene needed
public void showPlanetLaunch(Sector sector, Cons<Sector> listener){
selected = null;
hovered = null;

View File

@@ -423,12 +423,17 @@ public class SettingsMenuDialog extends Dialog{
}
});
graphics.checkPref("linear", !mobile, b -> {
for(Texture tex : Core.atlas.getTextures()){
TextureFilter filter = b ? TextureFilter.linear : TextureFilter.nearest;
tex.setFilter(filter, filter);
}
});
//iOS (and possibly Android) devices do not support linear filtering well, so disable it
if(!ios){
graphics.checkPref("linear", !mobile, b -> {
for(Texture tex : Core.atlas.getTextures()){
TextureFilter filter = b ? TextureFilter.linear : TextureFilter.nearest;
tex.setFilter(filter, filter);
}
});
}else{
settings.put("linear", false);
}
if(Core.settings.getBool("linear")){
for(Texture tex : Core.atlas.getTextures()){

View File

@@ -267,6 +267,7 @@ public class HudFragment extends Fragment{
//core info
parent.fill(t -> {
t.top();
t.visible(() -> shown);
t.name = "coreinfo";