Merge branch 'master' of https://github.com/Anuken/Mindustry into 7.0-features

 Conflicts:
	core/src/mindustry/ui/dialogs/PlanetDialog.java
This commit is contained in:
Anuken
2021-08-18 15:04:30 -04:00
86 changed files with 942 additions and 740 deletions

View File

@@ -77,9 +77,10 @@ public class ContentParser{
}
});
put(StatusEffect.class, (type, data) -> {
Object result = fieldOpt(StatusEffects.class, data);
if(result != null){
return result;
if(data.isString()){
StatusEffect result = locate(ContentType.status, data.asString());
if(result != null) return result;
throw new IllegalArgumentException("Unknown status effect: '" + data.asString() + "'");
}
StatusEffect effect = new StatusEffect(currentMod.name + "-" + data.getString("name"));
readFields(effect, data);
@@ -99,7 +100,7 @@ public class ContentParser{
put(AmmoType.class, (type, data) -> {
//string -> item
//if liquid ammo support is added, this should scan for liquids as well
if(data.isString()) return find(ContentType.item, data.asString());
if(data.isString()) return new ItemAmmoType(find(ContentType.item, data.asString()));
//number -> power
if(data.isNumber()) return new PowerAmmoType(data.asFloat());

View File

@@ -267,6 +267,7 @@ public class Mods implements Loadable{
TextureFilter filter = Core.settings.getBool("linear") ? TextureFilter.linear : TextureFilter.nearest;
Time.mark();
//generate new icons
for(Seq<Content> arr : content.getContentMap()){
arr.each(c -> {
@@ -277,6 +278,7 @@ public class Mods implements Loadable{
}
});
}
Log.debug("Time to generate icons: @", Time.elapsed());
//dispose old atlas data
Core.atlas = packer.flush(filter, new TextureAtlas());
@@ -287,7 +289,7 @@ public class Mods implements Loadable{
packer.dispose();
packer = null;
Log.debug("Time to update textures: @", Time.elapsed());
Log.debug("Total time to generate & flush textures synchronously: @", Time.elapsed());
}
private PageType getPage(AtlasRegion region){

View File

@@ -21,10 +21,10 @@ import java.net.*;
import java.util.regex.*;
public class Scripts implements Disposable{
private final Context context;
private final Scriptable scope;
private boolean errored;
public final Context context;
public final Scriptable scope;
private boolean errored;
LoadedMod currentMod = null;
public Scripts(){