From e78948e548bd64ed4fd7443621bca99f5b65de3b Mon Sep 17 00:00:00 2001 From: DeltaNedas Date: Tue, 4 Aug 2020 01:44:05 +0100 Subject: [PATCH 1/3] fix some issues with mods ui --- core/src/mindustry/ui/dialogs/ModsDialog.java | 64 ++++++++++--------- 1 file changed, 35 insertions(+), 29 deletions(-) diff --git a/core/src/mindustry/ui/dialogs/ModsDialog.java b/core/src/mindustry/ui/dialogs/ModsDialog.java index ddb72815b4..0a76179154 100644 --- a/core/src/mindustry/ui/dialogs/ModsDialog.java +++ b/core/src/mindustry/ui/dialogs/ModsDialog.java @@ -166,43 +166,42 @@ public class ModsDialog extends BaseDialog{ t.top().left(); t.margin(12f); - t.add(new BorderImage(){ - { - if(mod.iconTexture != null){ - setDrawable(new TextureRegion(mod.iconTexture)); - }else{ - setDrawable(Tex.clear); - } - } - - @Override - public void draw(){ - super.draw(); - - if(mod.iconTexture == null){ - Fonts.def.draw(letter, x + width/2f, y + height/2f, Align.center); - } - } - }.border(Pal.accent)).size(h - 8f).padTop(-8f).padLeft(-8f).padRight(2f); - t.defaults().left().top(); t.table(title -> { title.left(); + + title.add(new BorderImage(){ + { + if(mod.iconTexture != null){ + setDrawable(new TextureRegion(mod.iconTexture)); + }else{ + setDrawable(Tex.clear); + } + border(Pal.accent); + } + + @Override + public void draw(){ + super.draw(); + + if(mod.iconTexture == null){ + Fonts.def.draw(letter, x + width/2f, y + height/2f, Align.center); + } + } + }).size(h - 8f).padTop(-8f).padLeft(-8f).padRight(8f); + title.add("" + mod.meta.displayName() + "\n[lightgray]v" + mod.meta.version + (mod.enabled() ? "" : "\n" + Core.bundle.get("mod.disabled") + "")).wrap().width(170f).growX(); title.add().growX(); + }).growX().left(); - title.button(mod.enabled() ? "$mod.disable" : "$mod.enable", mod.enabled() ? Icon.downOpen : Icon.upOpen, Styles.transt, () -> { + t.table(right -> { + right.right(); + right.button(mod.enabled() ? "$mod.disable" : "$mod.enable", mod.enabled() ? Icon.downOpen : Icon.upOpen, Styles.transt, () -> { mods.setEnabled(mod, !mod.enabled()); setup(); }).height(50f).margin(8f).width(130f).disabled(!mod.isSupported()); - if(steam && !mod.hasSteamID()){ - title.button(Icon.download, Styles.clearTransi, () -> { - platform.publish(mod); - }).size(50f); - } - - title.button(mod.hasSteamID() ? Icon.link : Icon.trash, Styles.clearPartiali, () -> { + right.button(mod.hasSteamID() ? Icon.link : Icon.trash, Styles.clearPartiali, () -> { if(!mod.hasSteamID()){ ui.showConfirm("$confirm", "$mod.remove.confirm", () -> { mods.removeMod(mod); @@ -212,7 +211,14 @@ public class ModsDialog extends BaseDialog{ platform.viewListing(mod); } }).size(50f); - }).growX().left(); + + if(steam && !mod.hasSteamID()){ + right.row(); + right.button(Icon.download, Styles.clearTransi, () -> { + platform.publish(mod); + }).size(50f); + } + }).growX().right(); t.row(); if(!mod.isSupported()){ @@ -225,7 +231,7 @@ public class ModsDialog extends BaseDialog{ t.labelWrap("$mod.erroredcontent").growX(); t.row(); } - }, Styles.clearPartialt, () -> showMod(mod)).size(w, h); + }, Styles.clearPartialt, () -> showMod(mod)).size(w, h).pad(4f); table.row(); } }); From 1589b8a72b777d2342a79e89492e456c0a1fa5c9 Mon Sep 17 00:00:00 2001 From: DeltaNedas Date: Tue, 4 Aug 2020 01:46:26 +0100 Subject: [PATCH 2/3] grow each mod --- core/src/mindustry/ui/dialogs/ModsDialog.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/mindustry/ui/dialogs/ModsDialog.java b/core/src/mindustry/ui/dialogs/ModsDialog.java index 0a76179154..c188524039 100644 --- a/core/src/mindustry/ui/dialogs/ModsDialog.java +++ b/core/src/mindustry/ui/dialogs/ModsDialog.java @@ -231,7 +231,7 @@ public class ModsDialog extends BaseDialog{ t.labelWrap("$mod.erroredcontent").growX(); t.row(); } - }, Styles.clearPartialt, () -> showMod(mod)).size(w, h).pad(4f); + }, Styles.clearPartialt, () -> showMod(mod)).size(w, h).growX().pad(4f); table.row(); } }); From 49f6b9bb05e9bbca6bb12e9f283f4a6807feeae5 Mon Sep 17 00:00:00 2001 From: Anuken Date: Mon, 3 Aug 2020 21:57:20 -0400 Subject: [PATCH 3/3] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index aab377402d..7f0e6208bc 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ Server builds are bundled with each released build (in Releases). If you'd rathe 1. Install the Android SDK [here.](https://developer.android.com/studio#downloads) Make sure you're downloading the "Command line tools only", as Android Studio is not required. 2. Create a file named `local.properties` inside the Mindustry directory, with its contents looking like this: `sdk.dir=`. For example, if you're on Windows and installed the tools to C:\\tools, your local.properties would contain `sdk.dir=C:\\tools` (*note the double backslashes are required instead of single ones!*). 3. Run `gradlew android:assembleDebug` (or `./gradlew` if on linux/mac). This will create an unsigned APK in `android/build/outputs/apk`. -4. (Optional) To debug the application on a connected phone, do `gradlew android:installDebug android:run`. It is **highly recommended** to use IntelliJ for this instead, however. +4. (Optional) To debug the application on a connected phone, do `gradlew android:installDebug android:run`. It is **highly recommended** to use IntelliJ for this instead. ##### Troubleshooting