Closes #10302
This commit is contained in:
@@ -17,7 +17,7 @@ import static mindustry.Vars.*;
|
|||||||
public class Team implements Comparable<Team>, Senseable{
|
public class Team implements Comparable<Team>, Senseable{
|
||||||
public final int id;
|
public final int id;
|
||||||
public final Color color;
|
public final Color color;
|
||||||
public final Color[] palette;
|
public final Color[] palette = {new Color(), new Color(), new Color()};
|
||||||
public final int[] palettei = new int[3];
|
public final int[] palettei = new int[3];
|
||||||
public String emoji = "";
|
public String emoji = "";
|
||||||
public boolean hasPalette;
|
public boolean hasPalette;
|
||||||
@@ -64,27 +64,15 @@ public class Team implements Comparable<Team>, Senseable{
|
|||||||
if(id < 6) baseTeams[id] = this;
|
if(id < 6) baseTeams[id] = this;
|
||||||
all[id] = this;
|
all[id] = this;
|
||||||
|
|
||||||
palette = new Color[3];
|
setPalette(color);
|
||||||
palette[0] = color;
|
|
||||||
palette[1] = color.cpy().mul(0.75f);
|
|
||||||
palette[2] = color.cpy().mul(0.5f);
|
|
||||||
|
|
||||||
for(int i = 0; i < 3; i++){
|
|
||||||
palettei[i] = palette[i].rgba();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Specifies a 3-color team palette. */
|
/** Specifies a 3-color team palette. */
|
||||||
protected Team(int id, String name, Color color, Color pal1, Color pal2, Color pal3){
|
protected Team(int id, String name, Color color, Color pal1, Color pal2, Color pal3){
|
||||||
this(id, name, color);
|
this(id, name, color);
|
||||||
|
|
||||||
palette[0] = pal1;
|
setPalette(pal1, pal2, pal3);
|
||||||
palette[1] = pal2;
|
this.color.set(color);
|
||||||
palette[2] = pal3;
|
|
||||||
for(int i = 0; i < 3; i++){
|
|
||||||
palettei[i] = palette[i].rgba();
|
|
||||||
}
|
|
||||||
hasPalette = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @return the core items for this team, or an empty item module.
|
/** @return the core items for this team, or an empty item module.
|
||||||
@@ -144,6 +132,22 @@ public class Team implements Comparable<Team>, Senseable{
|
|||||||
return emoji + "[#" + color + "]" + localized() + "[]";
|
return emoji + "[#" + color + "]" + localized() + "[]";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setPalette(Color color){
|
||||||
|
setPalette(color, color.cpy().mul(0.75f), color.cpy().mul(0.5f));
|
||||||
|
hasPalette = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPalette(Color pal1, Color pal2, Color pal3){
|
||||||
|
color.set(pal1);
|
||||||
|
palette[0].set(pal1);
|
||||||
|
palette[1].set(pal2);
|
||||||
|
palette[2].set(pal3);
|
||||||
|
for(int i = 0; i < 3; i++){
|
||||||
|
palettei[i] = palette[i].rgba();
|
||||||
|
}
|
||||||
|
hasPalette = true;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int compareTo(Team team){
|
public int compareTo(Team team){
|
||||||
return Integer.compare(id, team.id);
|
return Integer.compare(id, team.id);
|
||||||
|
|||||||
@@ -208,10 +208,7 @@ public class Mods implements Loadable{
|
|||||||
regionName = baseName.contains(".") ? baseName.substring(0, baseName.indexOf(".")) : baseName;
|
regionName = baseName.contains(".") ? baseName.substring(0, baseName.indexOf(".")) : baseName;
|
||||||
|
|
||||||
if(!prefix && !Core.atlas.has(regionName)){
|
if(!prefix && !Core.atlas.has(regionName)){
|
||||||
Log.warn("Sprite '@' in mod '@' attempts to override a non-existent sprite. Ignoring.", regionName, mod.name);
|
Log.warn("Sprite '@' in mod '@' attempts to override a non-existent sprite.", regionName, mod.name);
|
||||||
continue;
|
|
||||||
|
|
||||||
//(horrible code below)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//read and bleed pixmaps in parallel
|
//read and bleed pixmaps in parallel
|
||||||
|
|||||||
Reference in New Issue
Block a user