In-game block team display / Editor bugfix

This commit is contained in:
Anuken
2019-01-22 15:46:22 -05:00
parent 6229f99a2e
commit 5459a646b3
9 changed files with 19 additions and 12 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 83 B

After

Width:  |  Height:  |  Size: 149 B

View File

@ -8577,7 +8577,7 @@ bar-top
rotate: false
xy: 915, 683
size: 27, 36
split: 9, 9, 9, 9
split: 9, 10, 9, 10
orig: 27, 36
offset: 0, 0
index: -1

Binary file not shown.

Before

Width:  |  Height:  |  Size: 989 KiB

After

Width:  |  Height:  |  Size: 989 KiB

View File

@ -10,7 +10,7 @@ import io.anuke.mindustry.type.Zone;
import io.anuke.mindustry.world.Block;
public class Zones implements ContentList{
public Zone groundZero, craters, frozenForest, ruinousShores, crags, stainedMountains,
public static Zone groundZero, craters, frozenForest, ruinousShores, crags, stainedMountains,
impact, desolateRift, arcticDesert, dryWastes, nuclearComplex, moltenFault;
@Override
@ -24,7 +24,7 @@ public class Zones implements ContentList{
rules = () -> new Rules(){{
waves = true;
waveTimer = true;
waveSpacing = 60 * 60;
waveSpacing = 60 * 60 * 2; //2 mins
spawns = Array.with(
new SpawnGroup(UnitTypes.dagger){{
unitScaling = 2;

View File

@ -112,7 +112,7 @@ public class MapRenderer implements Disposable{
TextureRegion region;
if(bw != 0){
region = wall.icon(Icon.full);
region = wall.icon(Icon.full) == Core.atlas.find("____") ? Core.atlas.find("clear") : wall.icon(Icon.full);
if(wall.rotate){
mesh.draw((wx % chunksize) + (wy % chunksize) * chunksize, region,

View File

@ -47,7 +47,7 @@ public class SpawnGroup{
}
float scaling = this.unitScaling;
return Math.min(unitAmount - 1 + Math.max((int) ((wave / spacing) / scaling), 1), max);
return Math.min(unitAmount - 1 + Math.max((int) (((wave - begin) / spacing) / scaling), 1), max);
}
/**

View File

@ -170,7 +170,7 @@ public class Waves{
return spawns;
}
public static void testWaves(int from, int to){
public static void testWaves(Array<SpawnGroup> spawns, int from, int to){
for(int i = from; i <= to; i++){
System.out.print(i + ": ");
int total = 0;

View File

@ -163,8 +163,13 @@ public class BlockRenderer{
if(req.layer == Layer.shadow){
block.drawShadow(req.tile);
}else if(req.layer == Layer.block){
}else if(req.layer == Layer.block){
block.draw(req.tile);
if(block.synthetic() && req.tile.getTeam() != players[0].getTeam()){
Draw.color(req.tile.getTeam().color);
Draw.rect("block-border", req.tile.drawx() - block.size * tilesize/2f + 4, req.tile.drawy() - block.size * tilesize/2f + 4);
Draw.color();
}
}else if(req.layer == block.layer){
block.drawLayer(req.tile);
}else if(req.layer == block.layer2){

View File

@ -220,11 +220,13 @@ public class PlacementFragment extends Fragment{
t.add(new Image(lastDisplay.getDisplayIcon(hoverTile))).size(8 * 4);
t.labelWrap(lastDisplay.getDisplayName(hoverTile)).left().width(190f).padLeft(5);
}).growX().left();
topTable.row();
topTable.table(t -> {
t.left().defaults().left();
lastDisplay.display(hoverTile, t);
}).left().growX();
if(hoverTile.getTeam() == players[0].getTeam()){
topTable.row();
topTable.table(t -> {
t.left().defaults().left();
lastDisplay.display(hoverTile, t);
}).left().growX();
}
}
});
}).colspan(3).fillX().visible(() -> getSelected() != null || tileDisplayBlock() != null).touchable(Touchable.enabled);