From 7bfbca7234342feacd2549c165910aefeb0e47bf Mon Sep 17 00:00:00 2001 From: ThePythonGuy <45978337+ThePythonGuy3@users.noreply.github.com> Date: Tue, 4 Aug 2020 11:17:13 +0200 Subject: [PATCH] Update ModsDialog.java --- 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 f916899894..bea3cddd9c 100644 --- a/core/src/mindustry/ui/dialogs/ModsDialog.java +++ b/core/src/mindustry/ui/dialogs/ModsDialog.java @@ -287,43 +287,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); @@ -333,7 +332,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()){ @@ -346,7 +352,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).growX().pad(4f); table.row(); } });