Packer compile fix / Mapping fix
|
After Width: | Height: | Size: 198 B |
BIN
core/assets-raw/sprites/blocks/defense/overdrive-projector.png
Normal file
|
After Width: | Height: | Size: 467 B |
|
Before Width: | Height: | Size: 208 B After Width: | Height: | Size: 208 B |
|
Before Width: | Height: | Size: 201 B After Width: | Height: | Size: 201 B |
|
Before Width: | Height: | Size: 292 B After Width: | Height: | Size: 292 B |
|
Before Width: | Height: | Size: 208 B After Width: | Height: | Size: 208 B |
|
Before Width: | Height: | Size: 283 B After Width: | Height: | Size: 283 B |
|
Before Width: | Height: | Size: 201 B After Width: | Height: | Size: 201 B |
|
Before Width: | Height: | Size: 210 B After Width: | Height: | Size: 210 B |
@@ -623,6 +623,7 @@ block.surge-wall-large.name=Large Surge Wall
|
|||||||
block.cyclone.name=Cyclone
|
block.cyclone.name=Cyclone
|
||||||
block.fuse.name=Fuse
|
block.fuse.name=Fuse
|
||||||
block.shock-mine.name=Shock Mine
|
block.shock-mine.name=Shock Mine
|
||||||
|
block.overdrive-projector.name=Overdrive Projector
|
||||||
|
|
||||||
unit.alpha-drone.name=Alpha Drone
|
unit.alpha-drone.name=Alpha Drone
|
||||||
unit.drone.name=Drone
|
unit.drone.name=Drone
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 98 KiB After Width: | Height: | Size: 100 KiB |
@@ -35,6 +35,7 @@ public class Recipes implements ContentList{
|
|||||||
|
|
||||||
//projectors
|
//projectors
|
||||||
new Recipe(defense, DefenseBlocks.mendProjector, new ItemStack(Items.lead, 200), new ItemStack(Items.densealloy, 150), new ItemStack(Items.titanium, 150), new ItemStack(Items.silicon, 250));
|
new Recipe(defense, DefenseBlocks.mendProjector, new ItemStack(Items.lead, 200), new ItemStack(Items.densealloy, 150), new ItemStack(Items.titanium, 150), new ItemStack(Items.silicon, 250));
|
||||||
|
new Recipe(defense, DefenseBlocks.overdriveProjector, new ItemStack(Items.lead, 200), new ItemStack(Items.densealloy, 150), new ItemStack(Items.titanium, 150), new ItemStack(Items.silicon, 250));
|
||||||
|
|
||||||
//extra blocks
|
//extra blocks
|
||||||
new Recipe(defense, DefenseBlocks.shockMine, new ItemStack(Items.lead, 50), new ItemStack(Items.silicon, 25))
|
new Recipe(defense, DefenseBlocks.shockMine, new ItemStack(Items.lead, 50), new ItemStack(Items.silicon, 25))
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import io.anuke.mindustry.world.blocks.defense.*;
|
|||||||
|
|
||||||
public class DefenseBlocks extends BlockList implements ContentList{
|
public class DefenseBlocks extends BlockList implements ContentList{
|
||||||
public static Block copperWall, copperWallLarge, compositeWall, compositeWallLarge, thoriumWall, thoriumWallLarge, door, doorLarge,
|
public static Block copperWall, copperWallLarge, compositeWall, compositeWallLarge, thoriumWall, thoriumWallLarge, door, doorLarge,
|
||||||
phaseWall, phaseWallLarge, surgeWall, surgeWallLarge, mendProjector, shockMine;
|
phaseWall, phaseWallLarge, surgeWall, surgeWallLarge, mendProjector, overdriveProjector, shockMine;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void load(){
|
public void load(){
|
||||||
@@ -72,7 +72,12 @@ public class DefenseBlocks extends BlockList implements ContentList{
|
|||||||
|
|
||||||
mendProjector = new MendProjector("mend-projector"){{
|
mendProjector = new MendProjector("mend-projector"){{
|
||||||
consumes.power(0.25f);
|
consumes.power(0.25f);
|
||||||
health = 100 * 4 * wallHealthMultiplier;
|
size = 2;
|
||||||
|
consumes.item(Items.phasematter).optional(true);
|
||||||
|
}};
|
||||||
|
|
||||||
|
overdriveProjector = new OverdriveProjector("overdrive-projector"){{
|
||||||
|
consumes.power(0.25f);
|
||||||
size = 2;
|
size = 2;
|
||||||
consumes.item(Items.phasematter).optional(true);
|
consumes.item(Items.phasematter).optional(true);
|
||||||
}};
|
}};
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import io.anuke.mindustry.world.blocks.units.*;
|
|||||||
public class UnitBlocks extends BlockList implements ContentList{
|
public class UnitBlocks extends BlockList implements ContentList{
|
||||||
public static Block repairPoint, dronePad,
|
public static Block repairPoint, dronePad,
|
||||||
fabricatorPad, interceptorPad, monsoonPad, daggerPad, titanPad,
|
fabricatorPad, interceptorPad, monsoonPad, daggerPad, titanPad,
|
||||||
dropPoint, reconstructor, overdriveProjector, shieldProjector, commandCenter;
|
reconstructor, commandCenter;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void load(){
|
public void load(){
|
||||||
@@ -64,11 +64,6 @@ public class UnitBlocks extends BlockList implements ContentList{
|
|||||||
consumes.items(new ItemStack[]{new ItemStack(Items.silicon, 20), new ItemStack(Items.thorium, 30)});
|
consumes.items(new ItemStack[]{new ItemStack(Items.silicon, 20), new ItemStack(Items.thorium, 30)});
|
||||||
}};
|
}};
|
||||||
|
|
||||||
dropPoint = new DropPoint("drop-point"){{
|
|
||||||
shadow = "shadow-round-1";
|
|
||||||
itemCapacity = 40;
|
|
||||||
}};
|
|
||||||
|
|
||||||
repairPoint = new RepairPoint("repair-point"){{
|
repairPoint = new RepairPoint("repair-point"){{
|
||||||
shadow = "shadow-round-1";
|
shadow = "shadow-round-1";
|
||||||
repairSpeed = 0.1f;
|
repairSpeed = 0.1f;
|
||||||
@@ -78,14 +73,6 @@ public class UnitBlocks extends BlockList implements ContentList{
|
|||||||
size = 2;
|
size = 2;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
overdriveProjector = new OverdriveProjector("overdrive-projector"){{
|
|
||||||
size = 2;
|
|
||||||
}};
|
|
||||||
|
|
||||||
shieldProjector = new ShieldProjector("shield-projector"){{
|
|
||||||
size = 2;
|
|
||||||
}};
|
|
||||||
|
|
||||||
commandCenter = new CommandCenter("command-center"){{
|
commandCenter = new CommandCenter("command-center"){{
|
||||||
size = 2;
|
size = 2;
|
||||||
}};
|
}};
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package io.anuke.mindustry.core;
|
package io.anuke.mindustry.core;
|
||||||
|
|
||||||
import com.badlogic.gdx.utils.Array;
|
import com.badlogic.gdx.utils.Array;
|
||||||
import com.badlogic.gdx.utils.IntMap;
|
|
||||||
import com.badlogic.gdx.utils.ObjectMap;
|
import com.badlogic.gdx.utils.ObjectMap;
|
||||||
import com.badlogic.gdx.utils.ObjectSet;
|
import com.badlogic.gdx.utils.ObjectSet;
|
||||||
import io.anuke.mindustry.content.*;
|
import io.anuke.mindustry.content.*;
|
||||||
@@ -38,7 +37,7 @@ public class ContentLoader{
|
|||||||
|
|
||||||
private ObjectMap<String, MappableContent>[] contentNameMap = new ObjectMap[ContentType.values().length];
|
private ObjectMap<String, MappableContent>[] contentNameMap = new ObjectMap[ContentType.values().length];
|
||||||
private Array<Content>[] contentMap = new Array[ContentType.values().length];
|
private Array<Content>[] contentMap = new Array[ContentType.values().length];
|
||||||
private IntMap<IntMap<MappableContent>> temporaryMapper;
|
private MappableContent[][] temporaryMapper;
|
||||||
private ObjectSet<Consumer<Content>> initialization = new ObjectSet<>();
|
private ObjectSet<Consumer<Content>> initialization = new ObjectSet<>();
|
||||||
private ContentList[] content = {
|
private ContentList[] content = {
|
||||||
//effects
|
//effects
|
||||||
@@ -183,7 +182,7 @@ public class ContentLoader{
|
|||||||
contentMap[content.getContentType().ordinal()].add(content);
|
contentMap[content.getContentType().ordinal()].add(content);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setTemporaryMapper(IntMap<IntMap<MappableContent>> temporaryMapper){
|
public void setTemporaryMapper(MappableContent[][] temporaryMapper){
|
||||||
this.temporaryMapper = temporaryMapper;
|
this.temporaryMapper = temporaryMapper;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -199,13 +198,13 @@ public class ContentLoader{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public <T extends Content> T getByID(ContentType type, int id){
|
public <T extends Content> T getByID(ContentType type, int id){
|
||||||
if(temporaryMapper != null && temporaryMapper.containsKey(type.ordinal()) && temporaryMapper.get(type.ordinal()).containsKey(id)){
|
|
||||||
return (T)temporaryMapper.get(type.ordinal()).get(id);
|
|
||||||
}
|
|
||||||
|
|
||||||
//offset negative values by 256, as they are probably a product of byte overflow
|
//offset negative values by 256, as they are probably a product of byte overflow
|
||||||
if(id < 0) id += 256;
|
if(id < 0) id += 256;
|
||||||
|
|
||||||
|
if(temporaryMapper != null && temporaryMapper[type.ordinal()] != null){
|
||||||
|
return (T)temporaryMapper[type.ordinal()][id];
|
||||||
|
}
|
||||||
|
|
||||||
if(id >= contentMap[type.ordinal()].size || id < 0){
|
if(id >= contentMap[type.ordinal()].size || id < 0){
|
||||||
throw new RuntimeException("No " + type.name() + " with ID '" + id + "' found!");
|
throw new RuntimeException("No " + type.name() + " with ID '" + id + "' found!");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package io.anuke.mindustry.io;
|
package io.anuke.mindustry.io;
|
||||||
|
|
||||||
import com.badlogic.gdx.utils.Array;
|
import com.badlogic.gdx.utils.Array;
|
||||||
import com.badlogic.gdx.utils.IntMap;
|
|
||||||
import io.anuke.mindustry.game.Content;
|
import io.anuke.mindustry.game.Content;
|
||||||
import io.anuke.mindustry.game.Difficulty;
|
import io.anuke.mindustry.game.Difficulty;
|
||||||
import io.anuke.mindustry.game.MappableContent;
|
import io.anuke.mindustry.game.MappableContent;
|
||||||
@@ -32,19 +31,20 @@ public abstract class SaveFileVersion{
|
|||||||
return new SaveMeta(version, time, playtime, build, sector, mode, map, wave, Difficulty.values()[difficulty]);
|
return new SaveMeta(version, time, playtime, build, sector, mode, map, wave, Difficulty.values()[difficulty]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public IntMap<IntMap<MappableContent>> readContentHeader(DataInputStream stream) throws IOException{
|
public MappableContent[][] readContentHeader(DataInputStream stream) throws IOException{
|
||||||
IntMap<IntMap<MappableContent>> map = new IntMap<>();
|
|
||||||
|
|
||||||
byte mapped = stream.readByte();
|
byte mapped = stream.readByte();
|
||||||
|
|
||||||
|
MappableContent[][] map = new MappableContent[mapped][0];
|
||||||
|
|
||||||
for (int i = 0; i < mapped; i++) {
|
for (int i = 0; i < mapped; i++) {
|
||||||
ContentType type = ContentType.values()[stream.readByte()];
|
ContentType type = ContentType.values()[stream.readByte()];
|
||||||
map.put(type.ordinal(), new IntMap<>());
|
|
||||||
short total = stream.readShort();
|
short total = stream.readShort();
|
||||||
|
map[i] = new MappableContent[total];
|
||||||
|
|
||||||
for (int j = 0; j < total; j++) {
|
for (int j = 0; j < total; j++) {
|
||||||
int id = stream.readUnsignedByte();
|
|
||||||
String name = stream.readUTF();
|
String name = stream.readUTF();
|
||||||
if(content.getContentMap()[type.ordinal()].size == 0) continue;
|
map[i][j] = content.getByName(type, name);
|
||||||
map.get(type.ordinal()).put(id, content.getByName(type, name));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -69,10 +69,7 @@ public abstract class SaveFileVersion{
|
|||||||
stream.writeByte(arr.first().getContentType().ordinal());
|
stream.writeByte(arr.first().getContentType().ordinal());
|
||||||
stream.writeShort(arr.size);
|
stream.writeShort(arr.size);
|
||||||
for(Content c : arr){
|
for(Content c : arr){
|
||||||
MappableContent m = (MappableContent)c;
|
stream.writeUTF(((MappableContent)c).getContentName());
|
||||||
if(m.id > 255) throw new RuntimeException("Content " + c + " has ID > 255!");
|
|
||||||
stream.writeByte(m.id);
|
|
||||||
stream.writeUTF(m.getContentName());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,105 @@
|
|||||||
package io.anuke.mindustry.world.blocks.defense;
|
package io.anuke.mindustry.world.blocks.defense;
|
||||||
|
|
||||||
|
import com.badlogic.gdx.graphics.Color;
|
||||||
|
import com.badlogic.gdx.graphics.g2d.TextureRegion;
|
||||||
|
import io.anuke.mindustry.content.StatusEffects;
|
||||||
|
import io.anuke.mindustry.content.fx.BlockFx;
|
||||||
|
import io.anuke.mindustry.entities.TileEntity;
|
||||||
|
import io.anuke.mindustry.entities.Units;
|
||||||
import io.anuke.mindustry.world.Block;
|
import io.anuke.mindustry.world.Block;
|
||||||
|
import io.anuke.mindustry.world.Tile;
|
||||||
|
import io.anuke.ucore.core.Effects;
|
||||||
|
import io.anuke.ucore.core.Graphics;
|
||||||
|
import io.anuke.ucore.core.Timers;
|
||||||
|
import io.anuke.ucore.graphics.Draw;
|
||||||
|
import io.anuke.ucore.graphics.Hue;
|
||||||
|
import io.anuke.ucore.graphics.Lines;
|
||||||
|
import io.anuke.ucore.util.Mathf;
|
||||||
|
|
||||||
public class OverdriveProjector extends Block {
|
public class OverdriveProjector extends Block{
|
||||||
|
private static Color color = Color.valueOf("feb380");
|
||||||
|
private static Color phase = Color.valueOf("ffd59e");
|
||||||
|
|
||||||
public OverdriveProjector(String name) {
|
protected int timerUse = timers ++;
|
||||||
|
|
||||||
|
protected TextureRegion topRegion;
|
||||||
|
protected float reload = 250f;
|
||||||
|
protected float range = 50f;
|
||||||
|
protected float healPercent = 6f;
|
||||||
|
protected float phaseBoost = 10f;
|
||||||
|
protected float useTime = 300f;
|
||||||
|
|
||||||
|
public OverdriveProjector(String name){
|
||||||
super(name);
|
super(name);
|
||||||
|
solid = true;
|
||||||
|
update = true;
|
||||||
|
hasPower = true;
|
||||||
|
hasItems = true;
|
||||||
|
itemCapacity = 10;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
@Override
|
||||||
|
public void load(){
|
||||||
|
super.load();
|
||||||
|
topRegion = Draw.region(name + "-top");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void update(Tile tile){
|
||||||
|
OverdriveEntity entity = tile.entity();
|
||||||
|
entity.heat = Mathf.lerpDelta(entity.heat, entity.cons.valid() ? 1f : 0f, 0.08f);
|
||||||
|
entity.charge += entity.heat * Timers.delta();
|
||||||
|
|
||||||
|
entity.phaseHeat = Mathf.lerpDelta(entity.phaseHeat, (float)entity.items.get(consumes.item()) / itemCapacity, 0.1f);
|
||||||
|
|
||||||
|
if(entity.timer.get(timerUse, useTime) && entity.items.total() > 0){
|
||||||
|
entity.items.remove(consumes.item(), 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(entity.charge >= reload){
|
||||||
|
float realRange = range + entity.phaseHeat * 20f;
|
||||||
|
|
||||||
|
Effects.effect(BlockFx.commandSend, Hue.mix(color, phase, entity.phaseHeat), tile.drawx(), tile.drawy(), realRange);
|
||||||
|
Units.getNearby(tile.getTeam(), tile.drawx(), tile.drawy(), realRange, unit -> unit.applyEffect(StatusEffects.overdrive, 1f));
|
||||||
|
entity.charge = 0f;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void drawSelect(Tile tile){
|
||||||
|
Draw.color(color);
|
||||||
|
Lines.dashCircle(tile.drawx(), tile.drawy() - 1f, range);
|
||||||
|
Draw.color();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void draw(Tile tile){
|
||||||
|
super.draw(tile);
|
||||||
|
|
||||||
|
OverdriveEntity entity = tile.entity();
|
||||||
|
float f = 1f - (Timers.time() / 100f) % 1f;
|
||||||
|
|
||||||
|
Draw.color(color, phase, entity.phaseHeat);
|
||||||
|
Draw.alpha(entity.heat * Mathf.absin(Timers.time(), 10f, 1f) * 0.5f);
|
||||||
|
Graphics.setAdditiveBlending();
|
||||||
|
Draw.rect(topRegion, tile.drawx(), tile.drawy());
|
||||||
|
|
||||||
|
Graphics.setNormalBlending();
|
||||||
|
Draw.alpha(1f);
|
||||||
|
Lines.stroke((2f * f + 0.2f)* entity.heat);
|
||||||
|
Lines.circle(tile.drawx(), tile.drawy(), (1f-f) * 9f);
|
||||||
|
|
||||||
|
Draw.reset();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TileEntity getEntity(){
|
||||||
|
return new OverdriveEntity();
|
||||||
|
}
|
||||||
|
|
||||||
|
class OverdriveEntity extends TileEntity{
|
||||||
|
float heat;
|
||||||
|
float charge;
|
||||||
|
float phaseHeat;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
package io.anuke.mindustry.world.blocks.units;
|
|
||||||
|
|
||||||
import io.anuke.mindustry.content.StatusEffects;
|
|
||||||
|
|
||||||
public class OverdriveProjector extends Projector{
|
|
||||||
|
|
||||||
public OverdriveProjector(String name){
|
|
||||||
super(name);
|
|
||||||
|
|
||||||
status = StatusEffects.overdrive;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,62 +0,0 @@
|
|||||||
package io.anuke.mindustry.world.blocks.units;
|
|
||||||
|
|
||||||
import io.anuke.mindustry.entities.TileEntity;
|
|
||||||
import io.anuke.mindustry.entities.Units;
|
|
||||||
import io.anuke.mindustry.graphics.Palette;
|
|
||||||
import io.anuke.mindustry.type.StatusEffect;
|
|
||||||
import io.anuke.mindustry.world.Block;
|
|
||||||
import io.anuke.mindustry.world.Tile;
|
|
||||||
import io.anuke.ucore.core.Timers;
|
|
||||||
import io.anuke.ucore.graphics.Draw;
|
|
||||||
import io.anuke.ucore.graphics.Lines;
|
|
||||||
import io.anuke.ucore.util.Mathf;
|
|
||||||
|
|
||||||
public abstract class Projector extends Block{
|
|
||||||
protected final int timerApply = timers++;
|
|
||||||
protected final float applyTime = 4f;
|
|
||||||
|
|
||||||
protected float range = 80f;
|
|
||||||
|
|
||||||
protected StatusEffect status;
|
|
||||||
protected float intensity = 1f;
|
|
||||||
|
|
||||||
public Projector(String name){
|
|
||||||
super(name);
|
|
||||||
hasPower = true;
|
|
||||||
update = true;
|
|
||||||
solid = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void drawSelect(Tile tile){
|
|
||||||
Draw.color(Palette.accent);
|
|
||||||
Lines.dashCircle(tile.drawx(), tile.drawy(), range);
|
|
||||||
Draw.reset();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void update(Tile tile){
|
|
||||||
ProjectorEntity entity = tile.entity();
|
|
||||||
|
|
||||||
if(entity.cons.valid()){
|
|
||||||
entity.heat = Mathf.lerpDelta(entity.heat, 1f, 0.01f);
|
|
||||||
}else{
|
|
||||||
entity.heat = Mathf.lerpDelta(entity.heat, 0f, 0.01f);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(entity.heat > 0.6f && Timers.get(timerApply, applyTime)){
|
|
||||||
Units.getNearby(tile.getTeam(), tile.drawx(), tile.drawy(), range, unit -> {
|
|
||||||
unit.applyEffect(status, intensity);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public TileEntity getEntity(){
|
|
||||||
return new ProjectorEntity();
|
|
||||||
}
|
|
||||||
|
|
||||||
public class ProjectorEntity extends TileEntity{
|
|
||||||
public float heat;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
package io.anuke.mindustry.world.blocks.units;
|
|
||||||
|
|
||||||
import io.anuke.mindustry.content.StatusEffects;
|
|
||||||
|
|
||||||
public class ShieldProjector extends Projector{
|
|
||||||
|
|
||||||
public ShieldProjector(String name){
|
|
||||||
super(name);
|
|
||||||
|
|
||||||
status = StatusEffects.shielded;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -3,6 +3,7 @@ package io.anuke.mindustry;
|
|||||||
import com.badlogic.gdx.graphics.Color;
|
import com.badlogic.gdx.graphics.Color;
|
||||||
import com.badlogic.gdx.graphics.g2d.TextureRegion;
|
import com.badlogic.gdx.graphics.g2d.TextureRegion;
|
||||||
import io.anuke.mindustry.entities.units.UnitType;
|
import io.anuke.mindustry.entities.units.UnitType;
|
||||||
|
import io.anuke.mindustry.type.ContentType;
|
||||||
import io.anuke.mindustry.type.Item;
|
import io.anuke.mindustry.type.Item;
|
||||||
import io.anuke.mindustry.type.Liquid;
|
import io.anuke.mindustry.type.Liquid;
|
||||||
import io.anuke.mindustry.type.Mech;
|
import io.anuke.mindustry.type.Mech;
|
||||||
@@ -11,6 +12,7 @@ import io.anuke.mindustry.world.blocks.Floor;
|
|||||||
import io.anuke.mindustry.world.blocks.OreBlock;
|
import io.anuke.mindustry.world.blocks.OreBlock;
|
||||||
import io.anuke.ucore.graphics.Draw;
|
import io.anuke.ucore.graphics.Draw;
|
||||||
import io.anuke.ucore.graphics.Hue;
|
import io.anuke.ucore.graphics.Hue;
|
||||||
|
import static io.anuke.mindustry.Vars.*;
|
||||||
|
|
||||||
public class Generators {
|
public class Generators {
|
||||||
|
|
||||||
@@ -71,7 +73,7 @@ public class Generators {
|
|||||||
});
|
});
|
||||||
|
|
||||||
context.generate("mech-icons", () -> {
|
context.generate("mech-icons", () -> {
|
||||||
for(Mech mech : Mech.all()){
|
for(Mech mech : content.<Mech>getBy(ContentType.mech)){
|
||||||
|
|
||||||
mech.load();
|
mech.load();
|
||||||
mech.weapon.load();
|
mech.weapon.load();
|
||||||
@@ -96,7 +98,7 @@ public class Generators {
|
|||||||
});
|
});
|
||||||
|
|
||||||
context.generate("unit-icons", () -> {
|
context.generate("unit-icons", () -> {
|
||||||
for(UnitType type : UnitType.all()){
|
for(UnitType type : content.<UnitType>getBy(ContentType.unit)){
|
||||||
|
|
||||||
type.load();
|
type.load();
|
||||||
type.weapon.load();
|
type.weapon.load();
|
||||||
@@ -124,7 +126,7 @@ public class Generators {
|
|||||||
});
|
});
|
||||||
|
|
||||||
context.generate("liquid-icons", () -> {
|
context.generate("liquid-icons", () -> {
|
||||||
for(Liquid liquid : Liquid.all()){
|
for(Liquid liquid : content.liquids()){
|
||||||
Image image = context.get("liquid-icon");
|
Image image = context.get("liquid-icon");
|
||||||
for (int x = 0; x < image.width(); x++) {
|
for (int x = 0; x < image.width(); x++) {
|
||||||
for (int y = 0; y < image.height(); y++) {
|
for (int y = 0; y < image.height(); y++) {
|
||||||
|
|||||||
@@ -23,7 +23,8 @@ public class ImageContext {
|
|||||||
|
|
||||||
public void load() throws IOException{
|
public void load() throws IOException{
|
||||||
Log.setLogger(new NoopLogHandler());
|
Log.setLogger(new NoopLogHandler());
|
||||||
ContentLoader.load();
|
Vars.content = new ContentLoader();
|
||||||
|
Vars.content.load();
|
||||||
Log.setLogger(new LogHandler());
|
Log.setLogger(new LogHandler());
|
||||||
|
|
||||||
String spritesFolder = new File("../../../assets/sprites").getAbsolutePath();
|
String spritesFolder = new File("../../../assets/sprites").getAbsolutePath();
|
||||||
|
|||||||