Implemented #2177
BIN
core/assets-raw/sprites/blocks/campaign/data-processor-2.png
Normal file
|
After Width: | Height: | Size: 836 B |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 989 B After Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 780 B After Width: | Height: | Size: 778 B |
|
Before Width: | Height: | Size: 404 KiB After Width: | Height: | Size: 394 KiB |
|
Before Width: | Height: | Size: 655 KiB After Width: | Height: | Size: 676 KiB |
|
Before Width: | Height: | Size: 128 KiB After Width: | Height: | Size: 126 KiB |
|
Before Width: | Height: | Size: 295 KiB After Width: | Height: | Size: 295 KiB |
|
Before Width: | Height: | Size: 934 KiB After Width: | Height: | Size: 934 KiB |
|
Before Width: | Height: | Size: 1.1 MiB After Width: | Height: | Size: 1.1 MiB |
|
Before Width: | Height: | Size: 128 KiB After Width: | Height: | Size: 126 KiB |
|
Before Width: | Height: | Size: 290 KiB After Width: | Height: | Size: 290 KiB |
|
Before Width: | Height: | Size: 982 KiB After Width: | Height: | Size: 982 KiB |
@@ -357,7 +357,7 @@ public class TechTree implements ContentList{
|
||||
this.content = content;
|
||||
this.requirements = requirements;
|
||||
this.depth = parent == null ? 0 : parent.depth + 1;
|
||||
this.progress = Core.settings.getFloat("research-" + content.name, 0f);
|
||||
this.progress = Core.settings == null ? 0 : Core.settings.getFloat("research-" + content.name, 0f);
|
||||
|
||||
map.put(content, this);
|
||||
context = this;
|
||||
|
||||
@@ -29,7 +29,7 @@ public abstract class UnlockableContent extends MappableContent{
|
||||
|
||||
this.localizedName = Core.bundle.get(getContentType() + "." + this.name + ".name", this.name);
|
||||
this.description = Core.bundle.getOrNull(getContentType() + "." + this.name + ".description");
|
||||
this.unlocked = Core.settings.getBool(name + "-unlocked", false);
|
||||
this.unlocked = Core.settings != null && Core.settings.getBool(name + "-unlocked", false);
|
||||
}
|
||||
|
||||
public String displayDescription(){
|
||||
|
||||
@@ -741,6 +741,16 @@ abstract class TileComp implements Posc, Teamc, Healthc, Tilec, Timerc, QuadTree
|
||||
|
||||
public void draw(){
|
||||
Draw.rect(block.region, x, y, block.rotate ? rotdeg() : 0);
|
||||
|
||||
drawTeamTop();
|
||||
}
|
||||
|
||||
public void drawTeamTop(){
|
||||
if(block.teamRegion.found()){
|
||||
if(block.teamRegions[team.uid] == block.teamRegion) Draw.color(team.color);
|
||||
Draw.rect(block.teamRegions[team.uid], x, y);
|
||||
Draw.color();
|
||||
}
|
||||
}
|
||||
|
||||
public void drawLight(){
|
||||
@@ -761,7 +771,7 @@ abstract class TileComp implements Posc, Teamc, Healthc, Tilec, Timerc, QuadTree
|
||||
}
|
||||
|
||||
public void drawTeam(){
|
||||
Draw.color(team().color);
|
||||
Draw.color(team.color);
|
||||
Draw.rect("block-border", x - block.size * tilesize / 2f + 4, y - block.size * tilesize / 2f + 4);
|
||||
Draw.color();
|
||||
}
|
||||
|
||||
@@ -17,6 +17,8 @@ public class Team implements Comparable<Team>{
|
||||
public final byte id;
|
||||
public final int uid;
|
||||
public final Color color;
|
||||
public final Color[] palette;
|
||||
public boolean hasPalette;
|
||||
public String name;
|
||||
|
||||
/** All 256 registered teams. */
|
||||
@@ -26,8 +28,10 @@ public class Team implements Comparable<Team>{
|
||||
|
||||
public final static Team
|
||||
derelict = new Team(0, "derelict", Color.valueOf("4d4e58")),
|
||||
sharded = new Team(1, "sharded", Pal.accent.cpy()),
|
||||
crux = new Team(2, "crux", Color.valueOf("f25555")),
|
||||
sharded = new Team(1, "sharded", Pal.accent.cpy(),
|
||||
Color.valueOf("ffd37f"), Color.valueOf("eab678"), Color.valueOf("d4816b")),
|
||||
crux = new Team(2, "crux", Color.valueOf("f25555"),
|
||||
Color.valueOf("fc8e6c"), Color.valueOf("f25555"), Color.valueOf("a04553")),
|
||||
green = new Team(3, "green", Color.valueOf("4dd98b")),
|
||||
purple = new Team(4, "purple", Color.valueOf("9a4bdf")),
|
||||
blue = new Team(5, "blue", Color.royal.cpy());
|
||||
@@ -54,6 +58,21 @@ public class Team implements Comparable<Team>{
|
||||
uid = us;
|
||||
if(us < 6) baseTeams[us] = this;
|
||||
all[us] = this;
|
||||
|
||||
palette = new Color[3];
|
||||
palette[0] = color;
|
||||
palette[1] = color.cpy().mul(0.75f);
|
||||
palette[2] = color.cpy().mul(0.5f);
|
||||
}
|
||||
|
||||
/** Specifies a 3-color team palette. */
|
||||
protected Team(int id, String name, Color color, Color pal1, Color pal2, Color pal3){
|
||||
this(id, name, color);
|
||||
|
||||
palette[0] = pal1;
|
||||
palette[1] = pal2;
|
||||
palette[2] = pal3;
|
||||
hasPalette = true;
|
||||
}
|
||||
|
||||
/** @return the team-specific rules. */
|
||||
|
||||
@@ -178,7 +178,10 @@ public class Block extends UnlockableContent{
|
||||
//TODO move
|
||||
protected TextureRegion[] generatedIcons;
|
||||
protected TextureRegion[] variantRegions, editorVariantRegions;
|
||||
|
||||
public TextureRegion region, editorIcon;
|
||||
public @Load("@-team") TextureRegion teamRegion;
|
||||
public TextureRegion[] teamRegions;
|
||||
|
||||
//TODO move
|
||||
public static TextureRegion[][] cracks;
|
||||
@@ -622,6 +625,16 @@ public class Block extends UnlockableContent{
|
||||
}
|
||||
|
||||
ContentRegions.loadRegions(this);
|
||||
|
||||
//load specific team regions
|
||||
teamRegions = new TextureRegion[Team.all.length];
|
||||
for(Team team : Team.all){
|
||||
if(team.hasPalette){
|
||||
teamRegions[team.uid] = Core.atlas.find(name + "-team-" + team.name);
|
||||
}else{
|
||||
teamRegions[team.uid] = teamRegion;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -9,6 +9,7 @@ import arc.struct.*;
|
||||
import arc.util.*;
|
||||
import arc.util.noise.*;
|
||||
import mindustry.ctype.*;
|
||||
import mindustry.game.*;
|
||||
import mindustry.gen.*;
|
||||
import mindustry.graphics.*;
|
||||
import mindustry.tools.ImagePacker.*;
|
||||
@@ -115,6 +116,28 @@ public class Generators{
|
||||
}
|
||||
}
|
||||
|
||||
Image shardTeamTop = null;
|
||||
|
||||
if(block.teamRegion.found()){
|
||||
Image teamr = ImagePacker.get(block.teamRegion);
|
||||
|
||||
for(Team team : Team.all){
|
||||
if(team.hasPalette){
|
||||
Image out = new Image(teamr.width, teamr.height);
|
||||
teamr.each((x, y) -> {
|
||||
int color = teamr.getColor(x, y).rgba8888();
|
||||
int index = color == 0xffffffff ? 0 : color == 0xdcc6c6ff ? 1 : color == 0x9d7f7fff ? 2 : -1;
|
||||
out.draw(x, y, index == -1 ? teamr.getColor(x, y) : team.palette[index]);
|
||||
});
|
||||
out.save(block.name + "-team-" + team.name);
|
||||
|
||||
if(team == Team.sharded){
|
||||
shardTeamTop = out;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(regions.length == 0){
|
||||
continue;
|
||||
}
|
||||
@@ -164,9 +187,14 @@ public class Generators{
|
||||
}else{
|
||||
image.draw(last);
|
||||
}
|
||||
|
||||
//draw shard (default team top) on top of first sprite
|
||||
if(i == 1 && shardTeamTop != null){
|
||||
image.draw(shardTeamTop);
|
||||
}
|
||||
}
|
||||
|
||||
if(!(regions.length == 1 && regions[0] == Core.atlas.find(block.name))){
|
||||
if(!(regions.length == 1 && regions[0] == Core.atlas.find(block.name) && shardTeamTop == null)){
|
||||
image.save("block-" + block.name + "-full");
|
||||
}
|
||||
|
||||
|
||||