Fixed crash caused by invalid NinePatch sprites
This commit is contained in:
@@ -87,14 +87,14 @@ public class AssetsProcess extends BaseProcessor{
|
|||||||
filename = filename.substring(0, filename.indexOf("."));
|
filename = filename.substring(0, filename.indexOf("."));
|
||||||
|
|
||||||
String sfilen = filename;
|
String sfilen = filename;
|
||||||
String dtype = p.name().endsWith(".9.png") ? "arc.scene.style.NinePatchDrawable" : "arc.scene.style.TextureRegionDrawable";
|
String dtype = "arc.scene.style.Drawable";
|
||||||
|
|
||||||
String varname = capitalize(sfilen);
|
String varname = capitalize(sfilen);
|
||||||
|
|
||||||
if(SourceVersion.isKeyword(varname)) varname += "s";
|
if(SourceVersion.isKeyword(varname)) varname += "s";
|
||||||
|
|
||||||
type.addField(ClassName.bestGuess(dtype), varname, Modifier.STATIC, Modifier.PUBLIC);
|
type.addField(ClassName.bestGuess(dtype), varname, Modifier.STATIC, Modifier.PUBLIC);
|
||||||
load.addStatement(varname + " = (" + dtype + ")arc.Core.atlas.drawable($S)", sfilen);
|
load.addStatement(varname + " = arc.Core.atlas.drawable($S)", sfilen);
|
||||||
});
|
});
|
||||||
|
|
||||||
for(Element elem : elements){
|
for(Element elem : elements){
|
||||||
|
|||||||
@@ -20,9 +20,9 @@ void main(){
|
|||||||
vec4 color = texture2D(u_texture, c);
|
vec4 color = texture2D(u_texture, c);
|
||||||
|
|
||||||
if(noise > 0.54 && noise < 0.68){
|
if(noise > 0.54 && noise < 0.68){
|
||||||
color.rgb *= 1.4;
|
color.rgb *= vec3(1.4);
|
||||||
}else if(!(noise > 0.40 && noise < 0.54)){
|
}else if(!(noise > 0.40 && noise < 0.54)){
|
||||||
color.rgb *= 1.2;
|
color.rgb *= vec3(1.2);
|
||||||
}
|
}
|
||||||
|
|
||||||
gl_FragColor = color;
|
gl_FragColor = color;
|
||||||
|
|||||||
@@ -659,12 +659,12 @@ public class Blocks implements ContentList{
|
|||||||
}};
|
}};
|
||||||
|
|
||||||
disassembler = new Separator("disassembler"){{
|
disassembler = new Separator("disassembler"){{
|
||||||
requirements(Category.crafting, with(Items.graphite, 140, Items.titanium, 100, Items.silicon, 150, Items.surgeAlloy, 70));
|
requirements(Category.crafting, with(Items.plastanium, 40, Items.titanium, 100, Items.silicon, 150, Items.thorium, 80));
|
||||||
results = with(
|
results = with(
|
||||||
Items.sand, 4,
|
Items.sand, 4,
|
||||||
Items.graphite, 2,
|
Items.graphite, 2,
|
||||||
Items.titanium, 2,
|
Items.titanium, 2,
|
||||||
Items.thorium, 1
|
Items.thorium, 2
|
||||||
);
|
);
|
||||||
hasPower = true;
|
hasPower = true;
|
||||||
craftTime = 15f;
|
craftTime = 15f;
|
||||||
|
|||||||
@@ -39,6 +39,8 @@ public class Styles{
|
|||||||
public static TreeStyle defaultTree;
|
public static TreeStyle defaultTree;
|
||||||
|
|
||||||
public static void load(){
|
public static void load(){
|
||||||
|
var whiteui = (TextureRegionDrawable)Tex.whiteui;
|
||||||
|
|
||||||
black = whiteui.tint(0f, 0f, 0f, 1f);
|
black = whiteui.tint(0f, 0f, 0f, 1f);
|
||||||
black9 = whiteui.tint(0f, 0f, 0f, 0.9f);
|
black9 = whiteui.tint(0f, 0f, 0f, 0.9f);
|
||||||
black8 = whiteui.tint(0f, 0f, 0f, 0.8f);
|
black8 = whiteui.tint(0f, 0f, 0f, 0.8f);
|
||||||
|
|||||||
@@ -423,7 +423,7 @@ public class ModsDialog extends BaseDialog{
|
|||||||
|
|
||||||
//textures are only requested when the rendering happens; this assists with culling
|
//textures are only requested when the rendering happens; this assists with culling
|
||||||
if(!textureCache.containsKey(repo)){
|
if(!textureCache.containsKey(repo)){
|
||||||
textureCache.put(repo, last = Tex.nomap.getRegion());
|
textureCache.put(repo, last = Core.atlas.find("nomap"));
|
||||||
Core.net.httpGet("https://raw.githubusercontent.com/Anuken/MindustryMods/master/icons/" + repo.replace("/", "_"), res -> {
|
Core.net.httpGet("https://raw.githubusercontent.com/Anuken/MindustryMods/master/icons/" + repo.replace("/", "_"), res -> {
|
||||||
if(res.getStatus() == HttpStatus.OK){
|
if(res.getStatus() == HttpStatus.OK){
|
||||||
Pixmap pix = new Pixmap(res.getResult());
|
Pixmap pix = new Pixmap(res.getResult());
|
||||||
|
|||||||
Reference in New Issue
Block a user