Better mod dialog layout / Less obnoxious button sound
This commit is contained in:
@@ -121,7 +121,7 @@ public class AndroidRhinoContext{
|
|||||||
}
|
}
|
||||||
return loadClass(dex, name);
|
return loadClass(dex, name);
|
||||||
}catch(IOException | ClassNotFoundException e){
|
}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{
|
static class FileAndroidClassLoader extends BaseAndroidClassLoader{
|
||||||
private static int instanceCounter = 0;
|
private static int instanceCounter = 0;
|
||||||
private final File dexFile;
|
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.
@@ -780,7 +780,7 @@ public class NetServer implements ApplicationListener{
|
|||||||
syncStream.reset();
|
syncStream.reset();
|
||||||
|
|
||||||
short sent = 0;
|
short sent = 0;
|
||||||
for(Building entity : Groups.tile){
|
for(Building entity : Groups.build){
|
||||||
if(!entity.block().sync) continue;
|
if(!entity.block().sync) continue;
|
||||||
sent ++;
|
sent ++;
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ class GroupDefs<G>{
|
|||||||
@GroupDef(value = Playerc.class, mapping = true) G player;
|
@GroupDef(value = Playerc.class, mapping = true) G player;
|
||||||
@GroupDef(value = Bulletc.class, spatial = true, collide = true) G bullet;
|
@GroupDef(value = Bulletc.class, spatial = true, collide = true) G bullet;
|
||||||
@GroupDef(value = Unitc.class, spatial = true, mapping = true) G unit;
|
@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 = Syncc.class, mapping = true) G sync;
|
||||||
@GroupDef(value = Drawc.class) G draw;
|
@GroupDef(value = Drawc.class) G draw;
|
||||||
@GroupDef(value = WeatherStatec.class) G weather;
|
@GroupDef(value = WeatherStatec.class) G weather;
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ public class ModsDialog extends BaseDialog{
|
|||||||
|
|
||||||
void setup(){
|
void setup(){
|
||||||
float h = 110f;
|
float h = 110f;
|
||||||
float w = mobile ? 430f : 524f;
|
float w = mobile ? 440f : 524f;
|
||||||
|
|
||||||
cont.clear();
|
cont.clear();
|
||||||
cont.defaults().width(mobile ? 500 : 560f).pad(4);
|
cont.defaults().width(mobile ? 500 : 560f).pad(4);
|
||||||
@@ -153,7 +153,6 @@ public class ModsDialog extends BaseDialog{
|
|||||||
|
|
||||||
boolean anyDisabled = false;
|
boolean anyDisabled = false;
|
||||||
for(LoadedMod mod : mods.list()){
|
for(LoadedMod mod : mods.list()){
|
||||||
String letter = (Strings.stripColors(mod.name).charAt(0) + "").toUpperCase();
|
|
||||||
|
|
||||||
if(!mod.enabled() && !anyDisabled && mods.list().size > 0){
|
if(!mod.enabled() && !anyDisabled && mods.list().size > 0){
|
||||||
anyDisabled = true;
|
anyDisabled = true;
|
||||||
@@ -170,36 +169,27 @@ public class ModsDialog extends BaseDialog{
|
|||||||
t.table(title -> {
|
t.table(title -> {
|
||||||
title.left();
|
title.left();
|
||||||
|
|
||||||
title.add(new BorderImage(){
|
title.add(new BorderImage(){{
|
||||||
{
|
if(mod.iconTexture != null){
|
||||||
if(mod.iconTexture != null){
|
setDrawable(new TextureRegion(mod.iconTexture));
|
||||||
setDrawable(new TextureRegion(mod.iconTexture));
|
}else{
|
||||||
}else{
|
setDrawable(Tex.nomap);
|
||||||
setDrawable(Tex.clear);
|
|
||||||
}
|
|
||||||
border(Pal.accent);
|
|
||||||
}
|
}
|
||||||
|
border(Pal.accent);
|
||||||
|
}}).size(h - 8f).padTop(-8f).padLeft(-8f).padRight(8f);
|
||||||
|
|
||||||
@Override
|
title.add("" + mod.meta.displayName() + "\n[lightgray]v" + mod.meta.version + (mod.enabled() ? "" : "\n" + Core.bundle.get("mod.disabled") + ""))
|
||||||
public void draw(){
|
.wrap().top().width(170f).growX().left();
|
||||||
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();
|
title.add().growX();
|
||||||
}).growX().left();
|
}).growX().growY().left();
|
||||||
|
|
||||||
t.table(right -> {
|
t.table(right -> {
|
||||||
right.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());
|
mods.setEnabled(mod, !mod.enabled());
|
||||||
setup();
|
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, () -> {
|
right.button(mod.hasSteamID() ? Icon.link : Icon.trash, Styles.clearPartiali, () -> {
|
||||||
if(!mod.hasSteamID()){
|
if(!mod.hasSteamID()){
|
||||||
@@ -218,7 +208,7 @@ public class ModsDialog extends BaseDialog{
|
|||||||
platform.publish(mod);
|
platform.publish(mod);
|
||||||
}).size(50f);
|
}).size(50f);
|
||||||
}
|
}
|
||||||
}).growX().right();
|
}).growX().right().padRight(-8f).padTop(-8f);
|
||||||
|
|
||||||
t.row();
|
t.row();
|
||||||
if(!mod.isSupported()){
|
if(!mod.isSupported()){
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import mindustry.world.Tile;
|
|||||||
|
|
||||||
public class TreeBlock extends Block{
|
public class TreeBlock extends Block{
|
||||||
public @Load("@-shadow") TextureRegion shadow;
|
public @Load("@-shadow") TextureRegion shadow;
|
||||||
public float shadowOffset = -3f;
|
public float shadowOffset = -4f;
|
||||||
|
|
||||||
public TreeBlock(String name){
|
public TreeBlock(String name){
|
||||||
super(name);
|
super(name);
|
||||||
|
|||||||
Reference in New Issue
Block a user