mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-01-24 18:05:33 +07:00
Update ModsDialog.java
This commit is contained in:
parent
dfcd94c4bc
commit
7bfbca7234
@ -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();
|
||||
}
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user