1
0
mirror of https://github.com/Anuken/Mindustry.git synced 2024-11-13 07:15:28 +03:00

Better mod dialog layout / Less obnoxious button sound

This commit is contained in:
Anuken 2020-08-15 10:12:34 -04:00
parent 97aca84b26
commit 0cc5945331
8 changed files with 18 additions and 36 deletions

View File

@ -121,7 +121,7 @@ public class AndroidRhinoContext{
}
return loadClass(dex, name);
}catch(IOException | ClassNotFoundException e){
throw new FatalLoadingException(e);
throw new RuntimeException("Failed to define class", e);
}
}
@ -151,14 +151,6 @@ public class AndroidRhinoContext{
}
}
/** Might be thrown in any Rhino method that loads bytecode if the loading failed. */
public static class FatalLoadingException extends RuntimeException{
FatalLoadingException(Throwable t){
super("Failed to define class", t);
}
}
static class FileAndroidClassLoader extends BaseAndroidClassLoader{
private static int instanceCounter = 0;
private final File dexFile;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.6 KiB

After

Width:  |  Height:  |  Size: 9.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.4 KiB

After

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

View File

@ -780,7 +780,7 @@ public class NetServer implements ApplicationListener{
syncStream.reset();
short sent = 0;
for(Building entity : Groups.tile){
for(Building entity : Groups.build){
if(!entity.block().sync) continue;
sent ++;

View File

@ -8,7 +8,7 @@ class GroupDefs<G>{
@GroupDef(value = Playerc.class, mapping = true) G player;
@GroupDef(value = Bulletc.class, spatial = true, collide = true) G bullet;
@GroupDef(value = Unitc.class, spatial = true, mapping = true) G unit;
@GroupDef(value = Buildingc.class) G tile;
@GroupDef(value = Buildingc.class) G build;
@GroupDef(value = Syncc.class, mapping = true) G sync;
@GroupDef(value = Drawc.class) G draw;
@GroupDef(value = WeatherStatec.class) G weather;

View File

@ -52,7 +52,7 @@ public class ModsDialog extends BaseDialog{
void setup(){
float h = 110f;
float w = mobile ? 430f : 524f;
float w = mobile ? 440f : 524f;
cont.clear();
cont.defaults().width(mobile ? 500 : 560f).pad(4);
@ -153,7 +153,6 @@ public class ModsDialog extends BaseDialog{
boolean anyDisabled = false;
for(LoadedMod mod : mods.list()){
String letter = (Strings.stripColors(mod.name).charAt(0) + "").toUpperCase();
if(!mod.enabled() && !anyDisabled && mods.list().size > 0){
anyDisabled = true;
@ -170,36 +169,27 @@ public class ModsDialog extends BaseDialog{
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);
title.add(new BorderImage(){{
if(mod.iconTexture != null){
setDrawable(new TextureRegion(mod.iconTexture));
}else{
setDrawable(Tex.nomap);
}
border(Pal.accent);
}}).size(h - 8f).padTop(-8f).padLeft(-8f).padRight(8f);
@Override
public void draw(){
super.draw();
title.add("" + mod.meta.displayName() + "\n[lightgray]v" + mod.meta.version + (mod.enabled() ? "" : "\n" + Core.bundle.get("mod.disabled") + ""))
.wrap().top().width(170f).growX().left();
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();
}).growX().growY().left();
t.table(right -> {
right.right();
right.button(mod.enabled() ? "@mod.disable" : "@mod.enable", mod.enabled() ? Icon.downOpen : Icon.upOpen, Styles.transt, () -> {
right.button(mod.enabled() ? Icon.downOpen : Icon.upOpen, Styles.clearPartiali, () -> {
mods.setEnabled(mod, !mod.enabled());
setup();
}).height(50f).margin(8f).width(130f).disabled(!mod.isSupported());
}).size(50f).disabled(!mod.isSupported());
right.button(mod.hasSteamID() ? Icon.link : Icon.trash, Styles.clearPartiali, () -> {
if(!mod.hasSteamID()){
@ -218,7 +208,7 @@ public class ModsDialog extends BaseDialog{
platform.publish(mod);
}).size(50f);
}
}).growX().right();
}).growX().right().padRight(-8f).padTop(-8f);
t.row();
if(!mod.isSupported()){

View File

@ -11,7 +11,7 @@ import mindustry.world.Tile;
public class TreeBlock extends Block{
public @Load("@-shadow") TextureRegion shadow;
public float shadowOffset = -3f;
public float shadowOffset = -4f;
public TreeBlock(String name){
super(name);