Block drawer icon system fix
This commit is contained in:
@@ -890,7 +890,7 @@ public class Blocks{
|
|||||||
size = 2;
|
size = 2;
|
||||||
hasPower = true;
|
hasPower = true;
|
||||||
hasLiquids = false;
|
hasLiquids = false;
|
||||||
drawer = new DrawMulti(new DrawBlock(), new DrawFlame(Color.valueOf("ffef99")));
|
drawer = new DrawMulti(new DrawDefault(), new DrawFlame(Color.valueOf("ffef99")));
|
||||||
ambientSound = Sounds.smelter;
|
ambientSound = Sounds.smelter;
|
||||||
ambientSoundVolume = 0.07f;
|
ambientSoundVolume = 0.07f;
|
||||||
|
|
||||||
@@ -908,7 +908,7 @@ public class Blocks{
|
|||||||
hasLiquids = false;
|
hasLiquids = false;
|
||||||
itemCapacity = 30;
|
itemCapacity = 30;
|
||||||
boostScale = 0.15f;
|
boostScale = 0.15f;
|
||||||
drawer = new DrawMulti(new DrawBlock(), new DrawFlame(Color.valueOf("ffef99")));
|
drawer = new DrawMulti(new DrawDefault(), new DrawFlame(Color.valueOf("ffef99")));
|
||||||
ambientSound = Sounds.smelter;
|
ambientSound = Sounds.smelter;
|
||||||
ambientSoundVolume = 0.07f;
|
ambientSoundVolume = 0.07f;
|
||||||
|
|
||||||
@@ -927,8 +927,7 @@ public class Blocks{
|
|||||||
envEnabled |= Env.space | Env.underwater;
|
envEnabled |= Env.space | Env.underwater;
|
||||||
envDisabled = Env.none;
|
envDisabled = Env.none;
|
||||||
itemCapacity = 30;
|
itemCapacity = 30;
|
||||||
drawer = new DrawMulti(new DrawRegion("-bottom"), new DrawArcSmelt(), new DrawBlock());
|
drawer = new DrawMulti(new DrawRegion("-bottom"), new DrawArcSmelt(), new DrawDefault());
|
||||||
drawer.iconOverride = new String[]{"-bottom", ""};
|
|
||||||
fogRadius = 3;
|
fogRadius = 3;
|
||||||
researchCost = with(Items.beryllium, 150, Items.graphite, 50);
|
researchCost = with(Items.beryllium, 150, Items.graphite, 50);
|
||||||
|
|
||||||
@@ -943,7 +942,7 @@ public class Blocks{
|
|||||||
craftTime = 30f;
|
craftTime = 30f;
|
||||||
size = 2;
|
size = 2;
|
||||||
hasPower = hasItems = true;
|
hasPower = hasItems = true;
|
||||||
drawer = new DrawMulti(new DrawBlock(), new DrawFlame(Color.valueOf("ffc099")));
|
drawer = new DrawMulti(new DrawDefault(), new DrawFlame(Color.valueOf("ffc099")));
|
||||||
ambientSound = Sounds.smelter;
|
ambientSound = Sounds.smelter;
|
||||||
ambientSoundVolume = 0.07f;
|
ambientSoundVolume = 0.07f;
|
||||||
|
|
||||||
@@ -962,7 +961,7 @@ public class Blocks{
|
|||||||
hasPower = hasLiquids = true;
|
hasPower = hasLiquids = true;
|
||||||
craftEffect = Fx.formsmoke;
|
craftEffect = Fx.formsmoke;
|
||||||
updateEffect = Fx.plasticburn;
|
updateEffect = Fx.plasticburn;
|
||||||
drawer = new DrawMulti(new DrawBlock(), new DrawFade());
|
drawer = new DrawMulti(new DrawDefault(), new DrawFade());
|
||||||
|
|
||||||
consumeLiquid(Liquids.oil, 0.25f);
|
consumeLiquid(Liquids.oil, 0.25f);
|
||||||
consumePower(3f);
|
consumePower(3f);
|
||||||
@@ -976,8 +975,7 @@ public class Blocks{
|
|||||||
craftTime = 120f;
|
craftTime = 120f;
|
||||||
size = 2;
|
size = 2;
|
||||||
hasPower = true;
|
hasPower = true;
|
||||||
drawer = new DrawMulti(new DrawRegion("-bottom"), new DrawWeave(), new DrawBlock());
|
drawer = new DrawMulti(new DrawRegion("-bottom"), new DrawWeave(), new DrawDefault());
|
||||||
drawer.iconOverride = new String[]{"-bottom", "-weave", ""};
|
|
||||||
envEnabled |= Env.space;
|
envEnabled |= Env.space;
|
||||||
|
|
||||||
ambientSound = Sounds.techloop;
|
ambientSound = Sounds.techloop;
|
||||||
@@ -996,7 +994,7 @@ public class Blocks{
|
|||||||
size = 3;
|
size = 3;
|
||||||
hasPower = true;
|
hasPower = true;
|
||||||
itemCapacity = 20;
|
itemCapacity = 20;
|
||||||
drawer = new DrawMulti(new DrawBlock(), new DrawFlame());
|
drawer = new DrawMulti(new DrawDefault(), new DrawFlame());
|
||||||
|
|
||||||
consumePower(4f);
|
consumePower(4f);
|
||||||
consumeItems(with(Items.copper, 3, Items.lead, 4, Items.titanium, 2, Items.silicon, 3));
|
consumeItems(with(Items.copper, 3, Items.lead, 4, Items.titanium, 2, Items.silicon, 3));
|
||||||
@@ -1013,8 +1011,7 @@ public class Blocks{
|
|||||||
solid = true;
|
solid = true;
|
||||||
outputsLiquid = true;
|
outputsLiquid = true;
|
||||||
envEnabled = Env.any;
|
envEnabled = Env.any;
|
||||||
drawer = new DrawMulti(new DrawRegion("-bottom"), new DrawLiquidTile(Liquids.cryofluid), new DrawBlock());
|
drawer = new DrawMulti(new DrawRegion("-bottom"), new DrawLiquidTile(Liquids.cryofluid), new DrawDefault());
|
||||||
drawer.iconOverride = new String[]{"-bottom", ""};
|
|
||||||
liquidCapacity = 24f;
|
liquidCapacity = 24f;
|
||||||
|
|
||||||
consumePower(1f);
|
consumePower(1f);
|
||||||
@@ -1053,7 +1050,7 @@ public class Blocks{
|
|||||||
outputLiquid = new LiquidStack(Liquids.slag, 12f / 60f);
|
outputLiquid = new LiquidStack(Liquids.slag, 12f / 60f);
|
||||||
craftTime = 1f;
|
craftTime = 1f;
|
||||||
hasLiquids = hasPower = true;
|
hasLiquids = hasPower = true;
|
||||||
drawer = new DrawMulti(new DrawBlock(), new DrawLiquidRegion());
|
drawer = new DrawMulti(new DrawDefault(), new DrawLiquidRegion());
|
||||||
|
|
||||||
consumePower(1f);
|
consumePower(1f);
|
||||||
consumeItem(Items.scrap, 1);
|
consumeItem(Items.scrap, 1);
|
||||||
@@ -1103,14 +1100,12 @@ public class Blocks{
|
|||||||
hasPower = true;
|
hasPower = true;
|
||||||
craftEffect = Fx.none;
|
craftEffect = Fx.none;
|
||||||
drawer = new DrawMulti(
|
drawer = new DrawMulti(
|
||||||
new DrawBlock(),
|
new DrawDefault(),
|
||||||
new DrawFrames(),
|
new DrawFrames(),
|
||||||
new DrawLiquidRegion(),
|
new DrawLiquidRegion(),
|
||||||
new DrawRegion("-top")
|
new DrawRegion("-top")
|
||||||
);
|
);
|
||||||
|
|
||||||
drawer.iconOverride = new String[]{"", "-top"};
|
|
||||||
|
|
||||||
consumeItem(Items.sporePod, 1);
|
consumeItem(Items.sporePod, 1);
|
||||||
consumePower(0.7f);
|
consumePower(0.7f);
|
||||||
}};
|
}};
|
||||||
@@ -1122,11 +1117,10 @@ public class Blocks{
|
|||||||
craftTime = 40f;
|
craftTime = 40f;
|
||||||
updateEffect = Fx.pulverizeSmall;
|
updateEffect = Fx.pulverizeSmall;
|
||||||
hasItems = hasPower = true;
|
hasItems = hasPower = true;
|
||||||
drawer = new DrawMulti(new DrawBlock(), new DrawRegion("-rotator"){{
|
drawer = new DrawMulti(new DrawDefault(), new DrawRegion("-rotator"){{
|
||||||
spinSprite = true;
|
spinSprite = true;
|
||||||
rotateSpeed = 2f;
|
rotateSpeed = 2f;
|
||||||
}}, new DrawRegion("-top"));
|
}}, new DrawRegion("-top"));
|
||||||
drawer.iconOverride = new String[]{"", "-rotator", "-top"};
|
|
||||||
ambientSound = Sounds.grinding;
|
ambientSound = Sounds.grinding;
|
||||||
ambientSoundVolume = 0.025f;
|
ambientSoundVolume = 0.025f;
|
||||||
|
|
||||||
@@ -1188,7 +1182,6 @@ public class Blocks{
|
|||||||
}}
|
}}
|
||||||
);
|
);
|
||||||
|
|
||||||
drawer.iconOverride = new String[]{"-bottom", ""};
|
|
||||||
regionRotated1 = 3;
|
regionRotated1 = 3;
|
||||||
outputLiquids = LiquidStack.with(Liquids.ozone, 4f / 60, Liquids.hydrogen, 6f / 60);
|
outputLiquids = LiquidStack.with(Liquids.ozone, 4f / 60, Liquids.hydrogen, 6f / 60);
|
||||||
liquidOutputDirections = new int[]{1, 3};
|
liquidOutputDirections = new int[]{1, 3};
|
||||||
@@ -1199,7 +1192,7 @@ public class Blocks{
|
|||||||
size = 3;
|
size = 3;
|
||||||
hasLiquids = true;
|
hasLiquids = true;
|
||||||
|
|
||||||
drawer = new DrawMulti(new DrawRegion("-bottom"), new DrawLiquidTile(Liquids.nitrogen, 4.1f), new DrawBlock(), new DrawHeatInput(),
|
drawer = new DrawMulti(new DrawRegion("-bottom"), new DrawLiquidTile(Liquids.nitrogen, 4.1f), new DrawDefault(), new DrawHeatInput(),
|
||||||
new DrawParticles(){{
|
new DrawParticles(){{
|
||||||
color = Color.valueOf("d4f0ff");
|
color = Color.valueOf("d4f0ff");
|
||||||
alpha = 0.6f;
|
alpha = 0.6f;
|
||||||
@@ -1232,8 +1225,7 @@ public class Blocks{
|
|||||||
|
|
||||||
rotateDraw = false;
|
rotateDraw = false;
|
||||||
|
|
||||||
drawer = new DrawMulti(new DrawRegion("-bottom"), new DrawLiquidRegion(), new DrawBlock(), new DrawHeatOutput());
|
drawer = new DrawMulti(new DrawRegion("-bottom"), new DrawLiquidRegion(), new DrawDefault(), new DrawHeatOutput());
|
||||||
drawer.iconOverride = new String[]{"-bottom", "", "-top1"};
|
|
||||||
|
|
||||||
regionRotated1 = 2;
|
regionRotated1 = 2;
|
||||||
craftTime = 60f * 3f;
|
craftTime = 60f * 3f;
|
||||||
@@ -1246,9 +1238,8 @@ public class Blocks{
|
|||||||
|
|
||||||
researchCostMultiplier = 4f;
|
researchCostMultiplier = 4f;
|
||||||
|
|
||||||
drawer = new DrawMulti(new DrawHeatOutput(true));
|
drawer = new DrawMulti(new DrawDefault(), new DrawHeatOutput());
|
||||||
rotateDraw = false;
|
rotateDraw = false;
|
||||||
drawer.iconOverride = new String[]{""};
|
|
||||||
size = 2;
|
size = 2;
|
||||||
heatOutput = 3f;
|
heatOutput = 3f;
|
||||||
regionRotated1 = 1;
|
regionRotated1 = 1;
|
||||||
@@ -1258,8 +1249,7 @@ public class Blocks{
|
|||||||
phaseHeater = new HeatProducer("phase-heater"){{
|
phaseHeater = new HeatProducer("phase-heater"){{
|
||||||
requirements(Category.crafting, with(Items.oxide, 30, Items.carbide, 30, Items.beryllium, 30));
|
requirements(Category.crafting, with(Items.oxide, 30, Items.carbide, 30, Items.beryllium, 30));
|
||||||
|
|
||||||
drawer = new DrawMulti(new DrawHeatOutput(true));
|
drawer = new DrawMulti(new DrawDefault(), new DrawHeatOutput());
|
||||||
drawer.iconOverride = new String[]{""};
|
|
||||||
size = 2;
|
size = 2;
|
||||||
heatOutput = 10f;
|
heatOutput = 10f;
|
||||||
craftTime = 60f * 8f;
|
craftTime = 60f * 8f;
|
||||||
@@ -1273,7 +1263,7 @@ public class Blocks{
|
|||||||
researchCostMultiplier = 10f;
|
researchCostMultiplier = 10f;
|
||||||
|
|
||||||
size = 3;
|
size = 3;
|
||||||
drawer = new DrawMulti(new DrawHeatOutput(true), new DrawHeatInput("-heat"));
|
drawer = new DrawMulti(new DrawDefault(), new DrawHeatOutput(), new DrawHeatInput("-heat"));
|
||||||
regionRotated1 = 1;
|
regionRotated1 = 1;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
@@ -1291,8 +1281,7 @@ public class Blocks{
|
|||||||
size = 3;
|
size = 3;
|
||||||
itemCapacity = 20;
|
itemCapacity = 20;
|
||||||
hasPower = hasItems = true;
|
hasPower = hasItems = true;
|
||||||
drawer = new DrawMulti(new DrawRegion("-bottom"), new DrawCrucibleFlame(), new DrawBlock(), new DrawHeatInput());
|
drawer = new DrawMulti(new DrawRegion("-bottom"), new DrawCrucibleFlame(), new DrawDefault(), new DrawHeatInput());
|
||||||
drawer.iconOverride = new String[]{"-bottom", ""};
|
|
||||||
ambientSound = Sounds.smelter;
|
ambientSound = Sounds.smelter;
|
||||||
ambientSoundVolume = 0.07f;
|
ambientSoundVolume = 0.07f;
|
||||||
|
|
||||||
@@ -1324,8 +1313,7 @@ public class Blocks{
|
|||||||
}});
|
}});
|
||||||
}
|
}
|
||||||
|
|
||||||
drawer = new DrawMulti(drawers.and(new DrawBlock()));
|
drawer = new DrawMulti(drawers.and(new DrawDefault()));
|
||||||
drawer.iconOverride = new String[]{"-bottom", ""};
|
|
||||||
|
|
||||||
craftTime = 60f * 2f;
|
craftTime = 60f * 2f;
|
||||||
|
|
||||||
@@ -1357,14 +1345,13 @@ public class Blocks{
|
|||||||
strokeMax = 2.5f;
|
strokeMax = 2.5f;
|
||||||
radius = 10f;
|
radius = 10f;
|
||||||
amount = 3;
|
amount = 3;
|
||||||
}}, new DrawLiquidRegion(Liquids.slag), new DrawBlock(), new DrawHeatInput(),
|
}}, new DrawLiquidRegion(Liquids.slag), new DrawDefault(), new DrawHeatInput(),
|
||||||
new DrawHeatRegion(){{
|
new DrawHeatRegion(){{
|
||||||
color = Color.valueOf("ff6060ff");
|
color = Color.valueOf("ff6060ff");
|
||||||
}},
|
}},
|
||||||
new DrawHeatRegion("-vents"){{
|
new DrawHeatRegion("-vents"){{
|
||||||
color.a = 1f;
|
color.a = 1f;
|
||||||
}});
|
}});
|
||||||
drawer.iconOverride = new String[]{"-bottom", ""};
|
|
||||||
|
|
||||||
consumeItem(Items.silicon, 3);
|
consumeItem(Items.silicon, 3);
|
||||||
//TODO must consume from 2 pumps, 1, or 1.5?
|
//TODO must consume from 2 pumps, 1, or 1.5?
|
||||||
@@ -1389,9 +1376,7 @@ public class Blocks{
|
|||||||
particleLife = 200f;
|
particleLife = 200f;
|
||||||
reverse = true;
|
reverse = true;
|
||||||
particleSizeInterp = Interp.one;
|
particleSizeInterp = Interp.one;
|
||||||
}}, new DrawBlock(), new DrawHeatInput(), new DrawHeatRegion("-heat-top"));
|
}}, new DrawDefault(), new DrawHeatInput(), new DrawHeatRegion("-heat-top"));
|
||||||
|
|
||||||
drawer.iconOverride = new String[]{"-bottom", ""};
|
|
||||||
|
|
||||||
size = 3;
|
size = 3;
|
||||||
|
|
||||||
@@ -1428,10 +1413,9 @@ public class Blocks{
|
|||||||
layerSpeed = -0.9f;
|
layerSpeed = -0.9f;
|
||||||
}}, new DrawMultiWeave(){{
|
}}, new DrawMultiWeave(){{
|
||||||
glowColor = new Color(1f, 0.4f, 0.4f, 0.8f);
|
glowColor = new Color(1f, 0.4f, 0.4f, 0.8f);
|
||||||
}}, new DrawBlock(), new DrawHeatInput(), new DrawHeatRegion("-vents"){{
|
}}, new DrawDefault(), new DrawHeatInput(), new DrawHeatRegion("-vents"){{
|
||||||
color = new Color(1f, 0.4f, 0.3f, 1f);
|
color = new Color(1f, 0.4f, 0.3f, 1f);
|
||||||
}});
|
}});
|
||||||
drawer.iconOverride = new String[]{"-bottom", "-weave", ""};
|
|
||||||
|
|
||||||
consumeItems(with(Items.thorium, 2, Items.sand, 6));
|
consumeItems(with(Items.thorium, 2, Items.sand, 6));
|
||||||
consumeLiquid(Liquids.ozone, 2f / 60f);
|
consumeLiquid(Liquids.ozone, 2f / 60f);
|
||||||
@@ -1738,7 +1722,7 @@ public class Blocks{
|
|||||||
|
|
||||||
Color col = Color.valueOf("8ca9e8");
|
Color col = Color.valueOf("8ca9e8");
|
||||||
|
|
||||||
drawer = new DrawMulti(new DrawRegion("-bottom"), new DrawLiquidTile(Liquids.hydrogen, 9f / 4f), new DrawBlock(), new DrawGlowRegion(){{
|
drawer = new DrawMulti(new DrawRegion("-bottom"), new DrawLiquidTile(Liquids.hydrogen, 9f / 4f), new DrawDefault(), new DrawGlowRegion(){{
|
||||||
color = Color.sky;
|
color = Color.sky;
|
||||||
}}, new DrawPulseShape(false){{
|
}}, new DrawPulseShape(false){{
|
||||||
layer = Layer.effect;
|
layer = Layer.effect;
|
||||||
@@ -2191,7 +2175,7 @@ public class Blocks{
|
|||||||
consume(new ConsumeItemFlammable());
|
consume(new ConsumeItemFlammable());
|
||||||
consume(new ConsumeItemExplode());
|
consume(new ConsumeItemExplode());
|
||||||
|
|
||||||
drawer = new DrawMulti(new DrawBlock(), new DrawWarmupRegion());
|
drawer = new DrawMulti(new DrawDefault(), new DrawWarmupRegion());
|
||||||
}};
|
}};
|
||||||
|
|
||||||
thermalGenerator = new ThermalGenerator("thermal-generator"){{
|
thermalGenerator = new ThermalGenerator("thermal-generator"){{
|
||||||
@@ -2212,7 +2196,6 @@ public class Blocks{
|
|||||||
consumeLiquid(Liquids.water, 0.1f);
|
consumeLiquid(Liquids.water, 0.1f);
|
||||||
hasLiquids = true;
|
hasLiquids = true;
|
||||||
size = 2;
|
size = 2;
|
||||||
drawer.iconOverride = new String[]{"", "-turbine0", "-turbine1"};
|
|
||||||
generateEffect = Fx.generatespark;
|
generateEffect = Fx.generatespark;
|
||||||
|
|
||||||
ambientSound = Sounds.smelter;
|
ambientSound = Sounds.smelter;
|
||||||
@@ -2221,7 +2204,7 @@ public class Blocks{
|
|||||||
consume(new ConsumeItemFlammable());
|
consume(new ConsumeItemFlammable());
|
||||||
consume(new ConsumeItemExplode());
|
consume(new ConsumeItemExplode());
|
||||||
|
|
||||||
drawer = new DrawMulti(new DrawBlock(), new DrawWarmupRegion(), new DrawTurbines());
|
drawer = new DrawMulti(new DrawDefault(), new DrawWarmupRegion(), new DrawTurbines());
|
||||||
}};
|
}};
|
||||||
|
|
||||||
differentialGenerator = new ConsumeGenerator("differential-generator"){{
|
differentialGenerator = new ConsumeGenerator("differential-generator"){{
|
||||||
@@ -2235,7 +2218,7 @@ public class Blocks{
|
|||||||
generateEffect = Fx.generatespark;
|
generateEffect = Fx.generatespark;
|
||||||
ambientSoundVolume = 0.03f;
|
ambientSoundVolume = 0.03f;
|
||||||
|
|
||||||
drawer = new DrawMulti(new DrawBlock(), new DrawWarmupRegion());
|
drawer = new DrawMulti(new DrawDefault(), new DrawWarmupRegion());
|
||||||
|
|
||||||
consumeItem(Items.pyratite);
|
consumeItem(Items.pyratite);
|
||||||
consumeLiquid(Liquids.cryofluid, 0.1f);
|
consumeLiquid(Liquids.cryofluid, 0.1f);
|
||||||
@@ -2249,7 +2232,7 @@ public class Blocks{
|
|||||||
envEnabled = Env.any;
|
envEnabled = Env.any;
|
||||||
generateEffect = Fx.generatespark;
|
generateEffect = Fx.generatespark;
|
||||||
|
|
||||||
drawer = new DrawMulti(new DrawBlock(), new DrawWarmupRegion());
|
drawer = new DrawMulti(new DrawDefault(), new DrawWarmupRegion());
|
||||||
consume(new ConsumeItemRadioactive());
|
consume(new ConsumeItemRadioactive());
|
||||||
}};
|
}};
|
||||||
|
|
||||||
@@ -2356,12 +2339,11 @@ public class Blocks{
|
|||||||
drawer = new DrawMulti(new DrawRegion("-bottom"), new DrawPistons(){{
|
drawer = new DrawMulti(new DrawRegion("-bottom"), new DrawPistons(){{
|
||||||
sinMag = 3f;
|
sinMag = 3f;
|
||||||
sinScl = 5f;
|
sinScl = 5f;
|
||||||
}}, new DrawRegion("-mid"), new DrawLiquidTile(Liquids.arkycite, 37f / 4f), new DrawBlock(), new DrawGlowRegion(){{
|
}}, new DrawRegion("-mid"), new DrawLiquidTile(Liquids.arkycite, 37f / 4f), new DrawDefault(), new DrawGlowRegion(){{
|
||||||
alpha = 1f;
|
alpha = 1f;
|
||||||
glowScale = 5f;
|
glowScale = 5f;
|
||||||
color = Color.valueOf("c967b099");
|
color = Color.valueOf("c967b099");
|
||||||
}});
|
}});
|
||||||
drawer.iconOverride = new String[]{"-bottom", ""};
|
|
||||||
generateEffect = Fx.none;
|
generateEffect = Fx.none;
|
||||||
|
|
||||||
liquidCapacity = 20f * 5;
|
liquidCapacity = 20f * 5;
|
||||||
@@ -2381,7 +2363,7 @@ public class Blocks{
|
|||||||
sinScl = 5f;
|
sinScl = 5f;
|
||||||
sides = 8;
|
sides = 8;
|
||||||
sideOffset = Mathf.PI / 2f;
|
sideOffset = Mathf.PI / 2f;
|
||||||
}}, new DrawRegion("-mid"), new DrawLiquidTile(Liquids.arkycite, 38f / 4f), new DrawBlock(), new DrawGlowRegion(){{
|
}}, new DrawRegion("-mid"), new DrawLiquidTile(Liquids.arkycite, 38f / 4f), new DrawDefault(), new DrawGlowRegion(){{
|
||||||
alpha = 1f;
|
alpha = 1f;
|
||||||
glowScale = 5f;
|
glowScale = 5f;
|
||||||
color = Pal.slagOrange;
|
color = Pal.slagOrange;
|
||||||
@@ -2395,7 +2377,6 @@ public class Blocks{
|
|||||||
|
|
||||||
liquidOutput = new LiquidStack(Liquids.water, 5f / 60f);
|
liquidOutput = new LiquidStack(Liquids.water, 5f / 60f);
|
||||||
|
|
||||||
drawer.iconOverride = new String[]{"-bottom", ""};
|
|
||||||
generateEffect = Fx.none;
|
generateEffect = Fx.none;
|
||||||
|
|
||||||
ambientSound = Sounds.smelter;
|
ambientSound = Sounds.smelter;
|
||||||
@@ -2487,11 +2468,10 @@ public class Blocks{
|
|||||||
|
|
||||||
legacyReadWarmup = true;
|
legacyReadWarmup = true;
|
||||||
drawer = new DrawMulti(
|
drawer = new DrawMulti(
|
||||||
new DrawBlock(),
|
new DrawDefault(),
|
||||||
new DrawCultivator(),
|
new DrawCultivator(),
|
||||||
new DrawRegion("-top")
|
new DrawRegion("-top")
|
||||||
);
|
);
|
||||||
drawer.iconOverride = new String[]{"", "-top"};
|
|
||||||
maxBoost = 2f;
|
maxBoost = 2f;
|
||||||
|
|
||||||
consumePower(80f / 60f);
|
consumePower(80f / 60f);
|
||||||
@@ -2523,8 +2503,7 @@ public class Blocks{
|
|||||||
baseEfficiency = 0f;
|
baseEfficiency = 0f;
|
||||||
displayEfficiency = false;
|
displayEfficiency = false;
|
||||||
craftEffect = Fx.turbinegenerate;
|
craftEffect = Fx.turbinegenerate;
|
||||||
drawer = new DrawMulti(new DrawRegion("-bottom"), new DrawBlurSpin("-rotator", 6f), new DrawRegion("-mid"), new DrawLiquidTile(Liquids.water, 38f / 4f), new DrawBlock());
|
drawer = new DrawMulti(new DrawRegion("-bottom"), new DrawBlurSpin("-rotator", 6f), new DrawRegion("-mid"), new DrawLiquidTile(Liquids.water, 38f / 4f), new DrawDefault());
|
||||||
drawer.iconOverride = new String[]{"-bottom", "-rotator", ""};
|
|
||||||
craftTime = 120f;
|
craftTime = 120f;
|
||||||
size = 3;
|
size = 3;
|
||||||
ambientSound = Sounds.hum;
|
ambientSound = Sounds.hum;
|
||||||
|
|||||||
@@ -415,11 +415,10 @@ public class ClassMap{
|
|||||||
classes.put("DrawLiquidTile", mindustry.world.draw.DrawLiquidTile.class);
|
classes.put("DrawLiquidTile", mindustry.world.draw.DrawLiquidTile.class);
|
||||||
classes.put("DrawMulti", mindustry.world.draw.DrawMulti.class);
|
classes.put("DrawMulti", mindustry.world.draw.DrawMulti.class);
|
||||||
classes.put("DrawMultiWeave", mindustry.world.draw.DrawMultiWeave.class);
|
classes.put("DrawMultiWeave", mindustry.world.draw.DrawMultiWeave.class);
|
||||||
classes.put("DrawPartial", mindustry.world.draw.DrawPartial.class);
|
|
||||||
classes.put("DrawParticles", mindustry.world.draw.DrawParticles.class);
|
classes.put("DrawParticles", mindustry.world.draw.DrawParticles.class);
|
||||||
classes.put("DrawPistons", mindustry.world.draw.DrawPistons.class);
|
classes.put("DrawPistons", mindustry.world.draw.DrawPistons.class);
|
||||||
classes.put("DrawPulseShape", mindustry.world.draw.DrawPulseShape.class);
|
classes.put("DrawPulseShape", mindustry.world.draw.DrawPulseShape.class);
|
||||||
classes.put("DrawPump", mindustry.world.draw.DrawPump.class);
|
classes.put("DrawPump", DrawPumpLiquid.class);
|
||||||
classes.put("DrawRegion", mindustry.world.draw.DrawRegion.class);
|
classes.put("DrawRegion", mindustry.world.draw.DrawRegion.class);
|
||||||
classes.put("DrawShape", mindustry.world.draw.DrawShape.class);
|
classes.put("DrawShape", mindustry.world.draw.DrawShape.class);
|
||||||
classes.put("DrawSideRegion", mindustry.world.draw.DrawSideRegion.class);
|
classes.put("DrawSideRegion", mindustry.world.draw.DrawSideRegion.class);
|
||||||
|
|||||||
@@ -135,7 +135,7 @@ public class ContentParser{
|
|||||||
if(data.isArray()){
|
if(data.isArray()){
|
||||||
return new DrawMulti(parser.readValue(DrawBlock[].class, data));
|
return new DrawMulti(parser.readValue(DrawBlock[].class, data));
|
||||||
}
|
}
|
||||||
var bc = resolve(data.getString("type", ""), DrawBlock.class);
|
var bc = resolve(data.getString("type", ""), DrawDefault.class);
|
||||||
data.remove("type");
|
data.remove("type");
|
||||||
var result = make(bc);
|
var result = make(bc);
|
||||||
readFields(result, data);
|
readFields(result, data);
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ public class RegenProjector extends Block{
|
|||||||
public float optionalMultiplier = 2f;
|
public float optionalMultiplier = 2f;
|
||||||
public float optionalUseTime = 60f * 8f;
|
public float optionalUseTime = 60f * 8f;
|
||||||
|
|
||||||
public DrawBlock drawer = new DrawMulti(new DrawRegion("-bottom"), new DrawSideRegion(true));
|
public DrawBlock drawer = new DrawDefault();
|
||||||
|
|
||||||
public float effectChance = 0.003f;
|
public float effectChance = 0.003f;
|
||||||
public Color baseColor = Pal.accent;
|
public Color baseColor = Pal.accent;
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import mindustry.world.draw.*;
|
|||||||
|
|
||||||
public class HeatConductor extends Block{
|
public class HeatConductor extends Block{
|
||||||
public float visualMaxHeat = 15f;
|
public float visualMaxHeat = 15f;
|
||||||
public DrawBlock drawer = new DrawBlock();
|
public DrawBlock drawer = new DrawDefault();
|
||||||
|
|
||||||
public HeatConductor(String name){
|
public HeatConductor(String name){
|
||||||
super(name);
|
super(name);
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ public class HeatProducer extends GenericCrafter{
|
|||||||
public HeatProducer(String name){
|
public HeatProducer(String name){
|
||||||
super(name);
|
super(name);
|
||||||
|
|
||||||
drawer = new DrawHeatOutput(true);
|
drawer = new DrawMulti(new DrawDefault(), new DrawHeatOutput());
|
||||||
rotateDraw = false;
|
rotateDraw = false;
|
||||||
rotate = true;
|
rotate = true;
|
||||||
canOverdrive = false;
|
canOverdrive = false;
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ public class PowerGenerator extends PowerDistributor{
|
|||||||
/** The amount of power produced per tick in case of an efficiency of 1.0, which represents 100%. */
|
/** The amount of power produced per tick in case of an efficiency of 1.0, which represents 100%. */
|
||||||
public float powerProduction;
|
public float powerProduction;
|
||||||
public Stat generationType = Stat.basePowerGeneration;
|
public Stat generationType = Stat.basePowerGeneration;
|
||||||
public DrawBlock drawer = new DrawBlock();
|
public DrawBlock drawer = new DrawDefault();
|
||||||
|
|
||||||
public PowerGenerator(String name){
|
public PowerGenerator(String name){
|
||||||
super(name);
|
super(name);
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ public class GenericCrafter extends Block{
|
|||||||
/** Only used for legacy cultivator blocks. */
|
/** Only used for legacy cultivator blocks. */
|
||||||
public boolean legacyReadWarmup = false;
|
public boolean legacyReadWarmup = false;
|
||||||
|
|
||||||
public DrawBlock drawer = new DrawBlock();
|
public DrawBlock drawer = new DrawDefault();
|
||||||
|
|
||||||
public GenericCrafter(String name){
|
public GenericCrafter(String name){
|
||||||
super(name);
|
super(name);
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ public class Pump extends LiquidBlock{
|
|||||||
public float pumpAmount = 0.2f;
|
public float pumpAmount = 0.2f;
|
||||||
/** Interval in-between item consumptions, if applicable. */
|
/** Interval in-between item consumptions, if applicable. */
|
||||||
public float consumeTime = 60f * 5f;
|
public float consumeTime = 60f * 5f;
|
||||||
public DrawBlock draw = new DrawPump();
|
public DrawBlock draw = new DrawMulti(new DrawDefault(), new DrawPumpLiquid());
|
||||||
|
|
||||||
public Pump(String name){
|
public Pump(String name){
|
||||||
super(name);
|
super(name);
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import arc.math.*;
|
|||||||
import arc.util.*;
|
import arc.util.*;
|
||||||
import mindustry.gen.*;
|
import mindustry.gen.*;
|
||||||
|
|
||||||
public class DrawArcSmelt extends DrawPartial{
|
public class DrawArcSmelt extends DrawBlock{
|
||||||
public Color flameColor = Color.valueOf("f58349"), midColor = Color.valueOf("f2d585");
|
public Color flameColor = Color.valueOf("f58349"), midColor = Color.valueOf("f2d585");
|
||||||
public float flameRad = 1f, circleSpace = 2f, flameRadiusScl = 3f, flameRadiusMag = 0.3f, circleStroke = 1.5f;
|
public float flameRad = 1f, circleSpace = 2f, flameRadiusScl = 3f, flameRadiusMag = 0.3f, circleStroke = 1.5f;
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import mindustry.world.blocks.production.*;
|
|||||||
|
|
||||||
/** An implementation of custom rendering behavior for a crafter block.
|
/** An implementation of custom rendering behavior for a crafter block.
|
||||||
* This is used mostly for mods. */
|
* This is used mostly for mods. */
|
||||||
public class DrawBlock{
|
public abstract class DrawBlock{
|
||||||
protected static final Rand rand = new Rand();
|
protected static final Rand rand = new Rand();
|
||||||
|
|
||||||
/** If set, the icon is overridden to be these strings, in order. Each string is a suffix. */
|
/** If set, the icon is overridden to be these strings, in order. Each string is a suffix. */
|
||||||
@@ -24,7 +24,7 @@ public class DrawBlock{
|
|||||||
|
|
||||||
/** Draws the block itself. */
|
/** Draws the block itself. */
|
||||||
public void draw(Building build){
|
public void draw(Building build){
|
||||||
Draw.rect(build.block.region, build.x, build.y, build.drawrot());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Draws any extra light for the block. */
|
/** Draws any extra light for the block. */
|
||||||
@@ -34,7 +34,7 @@ public class DrawBlock{
|
|||||||
|
|
||||||
/** Draws the planned version of this block. */
|
/** Draws the planned version of this block. */
|
||||||
public void drawPlan(Block block, BuildPlan plan, Eachable<BuildPlan> list){
|
public void drawPlan(Block block, BuildPlan plan, Eachable<BuildPlan> list){
|
||||||
block.drawDefaultPlanRegion(plan, list);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Load any relevant texture regions. */
|
/** Load any relevant texture regions. */
|
||||||
|
|||||||
@@ -2,8 +2,6 @@ package mindustry.world.draw;
|
|||||||
|
|
||||||
import arc.*;
|
import arc.*;
|
||||||
import arc.graphics.g2d.*;
|
import arc.graphics.g2d.*;
|
||||||
import arc.util.*;
|
|
||||||
import mindustry.entities.units.*;
|
|
||||||
import mindustry.gen.*;
|
import mindustry.gen.*;
|
||||||
import mindustry.graphics.*;
|
import mindustry.graphics.*;
|
||||||
import mindustry.world.*;
|
import mindustry.world.*;
|
||||||
@@ -28,8 +26,8 @@ public class DrawBlurSpin extends DrawBlock{
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawPlan(Block block, BuildPlan plan, Eachable<BuildPlan> list){
|
public TextureRegion[] icons(Block block){
|
||||||
Draw.rect(region, plan.drawx(), plan.drawy());
|
return new TextureRegion[]{region};
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import arc.graphics.g2d.*;
|
|||||||
import arc.util.*;
|
import arc.util.*;
|
||||||
import mindustry.gen.*;
|
import mindustry.gen.*;
|
||||||
|
|
||||||
public class DrawBubbles extends DrawPartial{
|
public class DrawBubbles extends DrawBlock{
|
||||||
public Color color = Color.valueOf("7457ce");
|
public Color color = Color.valueOf("7457ce");
|
||||||
|
|
||||||
public int amount = 12, sides = 8;
|
public int amount = 12, sides = 8;
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import arc.math.*;
|
|||||||
import arc.util.*;
|
import arc.util.*;
|
||||||
import mindustry.gen.*;
|
import mindustry.gen.*;
|
||||||
|
|
||||||
public class DrawCircles extends DrawPartial{
|
public class DrawCircles extends DrawBlock{
|
||||||
public Color color = Color.valueOf("7457ce");
|
public Color color = Color.valueOf("7457ce");
|
||||||
|
|
||||||
public int amount = 5, sides = 15;
|
public int amount = 5, sides = 15;
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import arc.math.Interp.*;
|
|||||||
import arc.util.*;
|
import arc.util.*;
|
||||||
import mindustry.gen.*;
|
import mindustry.gen.*;
|
||||||
|
|
||||||
public class DrawCrucibleFlame extends DrawPartial{
|
public class DrawCrucibleFlame extends DrawBlock{
|
||||||
public Color flameColor = Color.valueOf("f58349"), midColor = Color.valueOf("f2d585");
|
public Color flameColor = Color.valueOf("f58349"), midColor = Color.valueOf("f2d585");
|
||||||
public float flameRad = 1f, circleSpace = 2f, flameRadiusScl = 10f, flameRadiusMag = 0.6f, circleStroke = 1.5f;
|
public float flameRad = 1f, circleSpace = 2f, flameRadiusScl = 10f, flameRadiusMag = 0.6f, circleStroke = 1.5f;
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import mindustry.gen.*;
|
|||||||
import mindustry.graphics.*;
|
import mindustry.graphics.*;
|
||||||
import mindustry.world.*;
|
import mindustry.world.*;
|
||||||
|
|
||||||
public class DrawCultivator extends DrawPartial{
|
public class DrawCultivator extends DrawBlock{
|
||||||
public Color plantColor = Color.valueOf("5541b1");
|
public Color plantColor = Color.valueOf("5541b1");
|
||||||
public Color plantColorLight = Color.valueOf("7457ce");
|
public Color plantColorLight = Color.valueOf("7457ce");
|
||||||
public Color bottomColor = Color.valueOf("474747");
|
public Color bottomColor = Color.valueOf("474747");
|
||||||
|
|||||||
20
core/src/mindustry/world/draw/DrawDefault.java
Normal file
20
core/src/mindustry/world/draw/DrawDefault.java
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
package mindustry.world.draw;
|
||||||
|
|
||||||
|
import arc.graphics.g2d.*;
|
||||||
|
import arc.util.*;
|
||||||
|
import mindustry.entities.units.*;
|
||||||
|
import mindustry.gen.*;
|
||||||
|
import mindustry.world.*;
|
||||||
|
|
||||||
|
public class DrawDefault extends DrawBlock{
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void draw(Building build){
|
||||||
|
Draw.rect(build.block.region, build.x, build.y, build.drawrot());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void drawPlan(Block block, BuildPlan plan, Eachable<BuildPlan> list){
|
||||||
|
block.drawDefaultPlanRegion(plan, list);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -10,7 +10,7 @@ import mindustry.graphics.*;
|
|||||||
import mindustry.world.*;
|
import mindustry.world.*;
|
||||||
|
|
||||||
//TODO remake/remove
|
//TODO remake/remove
|
||||||
public class DrawFlame extends DrawPartial{
|
public class DrawFlame extends DrawBlock{
|
||||||
public Color flameColor = Color.valueOf("ffc999");
|
public Color flameColor = Color.valueOf("ffc999");
|
||||||
public TextureRegion top;
|
public TextureRegion top;
|
||||||
public float lightRadius = 60f, lightAlpha = 0.65f, lightSinScl = 10f, lightSinMag = 5;
|
public float lightRadius = 60f, lightAlpha = 0.65f, lightSinScl = 10f, lightSinMag = 5;
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import arc.math.*;
|
|||||||
import mindustry.gen.*;
|
import mindustry.gen.*;
|
||||||
import mindustry.world.*;
|
import mindustry.world.*;
|
||||||
|
|
||||||
public class DrawFrames extends DrawPartial{
|
public class DrawFrames extends DrawBlock{
|
||||||
/** Number of frames to draw. */
|
/** Number of frames to draw. */
|
||||||
public int frames = 3;
|
public int frames = 3;
|
||||||
/** Ticks between frames. */
|
/** Ticks between frames. */
|
||||||
@@ -24,6 +24,11 @@ public class DrawFrames extends DrawPartial{
|
|||||||
build.x, build.y);
|
build.x, build.y);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TextureRegion[] icons(Block block){
|
||||||
|
return new TextureRegion[]{regions[0]};
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void load(Block block){
|
public void load(Block block){
|
||||||
regions = new TextureRegion[frames];
|
regions = new TextureRegion[frames];
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import mindustry.graphics.*;
|
|||||||
import mindustry.world.*;
|
import mindustry.world.*;
|
||||||
|
|
||||||
/** Not standalone. */
|
/** Not standalone. */
|
||||||
public class DrawGlowRegion extends DrawPartial{
|
public class DrawGlowRegion extends DrawBlock{
|
||||||
public Blending blending = Blending.additive;
|
public Blending blending = Blending.additive;
|
||||||
public String suffix = "-glow";
|
public String suffix = "-glow";
|
||||||
public float alpha = 0.9f, glowScale = 10f, glowIntensity = 0.5f;
|
public float alpha = 0.9f, glowScale = 10f, glowIntensity = 0.5f;
|
||||||
|
|||||||
@@ -47,7 +47,6 @@ public class DrawHeatInput extends DrawBlock{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
Draw.z(Layer.block);
|
Draw.z(Layer.block);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -16,19 +16,9 @@ public class DrawHeatOutput extends DrawBlock{
|
|||||||
|
|
||||||
public Color heatColor = new Color(1f, 0.22f, 0.22f, 0.8f);
|
public Color heatColor = new Color(1f, 0.22f, 0.22f, 0.8f);
|
||||||
public float heatPulse = 0.3f, heatPulseScl = 10f, glowMult = 1.2f;
|
public float heatPulse = 0.3f, heatPulseScl = 10f, glowMult = 1.2f;
|
||||||
public boolean drawRegion = false;
|
|
||||||
|
|
||||||
public DrawHeatOutput(){
|
|
||||||
}
|
|
||||||
|
|
||||||
public DrawHeatOutput(boolean drawRegion){
|
|
||||||
this.drawRegion = drawRegion;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void draw(Building build){
|
public void draw(Building build){
|
||||||
if(drawRegion) Draw.rect(build.block.region, build.x, build.y);
|
|
||||||
|
|
||||||
Draw.rect(build.rotation > 1 ? top2 : top1, build.x, build.y, build.rotdeg());
|
Draw.rect(build.rotation > 1 ? top2 : top1, build.x, build.y, build.rotdeg());
|
||||||
|
|
||||||
if(build instanceof HeatBlock heater && heater.heat() > 0){
|
if(build instanceof HeatBlock heater && heater.heat() > 0){
|
||||||
@@ -45,7 +35,6 @@ public class DrawHeatOutput extends DrawBlock{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawPlan(Block block, BuildPlan plan, Eachable<BuildPlan> list){
|
public void drawPlan(Block block, BuildPlan plan, Eachable<BuildPlan> list){
|
||||||
if(drawRegion) Draw.rect(block.region, plan.drawx(), plan.drawy());
|
|
||||||
Draw.rect(plan.rotation > 1 ? top2 : top1, plan.drawx(), plan.drawy(), plan.rotation * 90);
|
Draw.rect(plan.rotation > 1 ? top2 : top1, plan.drawx(), plan.drawy(), plan.rotation * 90);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -57,9 +46,6 @@ public class DrawHeatOutput extends DrawBlock{
|
|||||||
top2 = Core.atlas.find(block.name + "-top2");
|
top2 = Core.atlas.find(block.name + "-top2");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
//TODO currently no icons due to concerns with rotation
|
||||||
public TextureRegion[] icons(Block block){
|
|
||||||
return new TextureRegion[]{block.region, top1};
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,7 +26,6 @@ public class DrawHeatRegion extends DrawBlock{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void draw(Building build){
|
public void draw(Building build){
|
||||||
|
|
||||||
Draw.z(Layer.blockAdditive);
|
Draw.z(Layer.blockAdditive);
|
||||||
if(build instanceof HeatCrafterBuild hc && hc.heat > 0){
|
if(build instanceof HeatCrafterBuild hc && hc.heat > 0){
|
||||||
Draw.blend(Blending.additive);
|
Draw.blend(Blending.additive);
|
||||||
@@ -36,7 +35,6 @@ public class DrawHeatRegion extends DrawBlock{
|
|||||||
Draw.color();
|
Draw.color();
|
||||||
}
|
}
|
||||||
Draw.z(Layer.block);
|
Draw.z(Layer.block);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -54,9 +54,9 @@ public class DrawLiquidOutputs extends DrawBlock{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO
|
//can't display these properly
|
||||||
@Override
|
@Override
|
||||||
public TextureRegion[] icons(Block block){
|
public TextureRegion[] icons(Block block){
|
||||||
return super.icons(block);
|
return new TextureRegion[]{};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,14 +2,13 @@ package mindustry.world.draw;
|
|||||||
|
|
||||||
import arc.*;
|
import arc.*;
|
||||||
import arc.graphics.g2d.*;
|
import arc.graphics.g2d.*;
|
||||||
import arc.util.*;
|
|
||||||
import mindustry.gen.*;
|
import mindustry.gen.*;
|
||||||
import mindustry.graphics.*;
|
import mindustry.graphics.*;
|
||||||
import mindustry.type.*;
|
import mindustry.type.*;
|
||||||
import mindustry.world.*;
|
import mindustry.world.*;
|
||||||
|
|
||||||
/** Not standalone. */
|
/** Not standalone. */
|
||||||
public class DrawLiquidRegion extends DrawPartial{
|
public class DrawLiquidRegion extends DrawBlock{
|
||||||
public Liquid drawLiquid;
|
public Liquid drawLiquid;
|
||||||
public TextureRegion liquid;
|
public TextureRegion liquid;
|
||||||
public String suffix = "-liquid";
|
public String suffix = "-liquid";
|
||||||
@@ -31,6 +30,7 @@ public class DrawLiquidRegion extends DrawPartial{
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void load(Block block){
|
public void load(Block block){
|
||||||
if(!block.hasLiquids){
|
if(!block.hasLiquids){
|
||||||
throw new RuntimeException("Block '" + block + "' has a DrawLiquidRegion, but hasLiquids is false! Make sure it is true.");
|
throw new RuntimeException("Block '" + block + "' has a DrawLiquidRegion, but hasLiquids is false! Make sure it is true.");
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import mindustry.type.*;
|
|||||||
import mindustry.world.blocks.liquid.*;
|
import mindustry.world.blocks.liquid.*;
|
||||||
|
|
||||||
/** Not standalone. */
|
/** Not standalone. */
|
||||||
public class DrawLiquidTile extends DrawPartial{
|
public class DrawLiquidTile extends DrawBlock{
|
||||||
public Liquid drawLiquid;
|
public Liquid drawLiquid;
|
||||||
public float padding;
|
public float padding;
|
||||||
public float alpha = 1f;
|
public float alpha = 1f;
|
||||||
|
|||||||
@@ -10,8 +10,6 @@ import mindustry.world.*;
|
|||||||
/** combined several DrawBlocks into one */
|
/** combined several DrawBlocks into one */
|
||||||
public class DrawMulti extends DrawBlock{
|
public class DrawMulti extends DrawBlock{
|
||||||
public DrawBlock[] drawers = {};
|
public DrawBlock[] drawers = {};
|
||||||
/** specifies the drawer index that sources the icon (since there can only be one icon source) */
|
|
||||||
public int iconIndex = 0;
|
|
||||||
|
|
||||||
public DrawMulti(){
|
public DrawMulti(){
|
||||||
}
|
}
|
||||||
@@ -61,6 +59,10 @@ public class DrawMulti extends DrawBlock{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TextureRegion[] icons(Block block){
|
public TextureRegion[] icons(Block block){
|
||||||
return drawers.length <= iconIndex ? super.icons(block) : drawers[iconIndex].icons(block);
|
var result = new Seq<TextureRegion>();
|
||||||
|
for(var draw : drawers){
|
||||||
|
result.addAll(draw.icons(block));
|
||||||
|
}
|
||||||
|
return result.toArray(TextureRegion.class);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,6 +30,11 @@ public class DrawMultiWeave extends DrawBlock{
|
|||||||
Draw.reset();
|
Draw.reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TextureRegion[] icons(Block block){
|
||||||
|
return new TextureRegion[]{weave};
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void load(Block block){
|
public void load(Block block){
|
||||||
weave = Core.atlas.find(block.name + "-weave");
|
weave = Core.atlas.find(block.name + "-weave");
|
||||||
|
|||||||
@@ -1,11 +0,0 @@
|
|||||||
package mindustry.world.draw;
|
|
||||||
|
|
||||||
import arc.util.*;
|
|
||||||
import mindustry.entities.units.*;
|
|
||||||
import mindustry.world.*;
|
|
||||||
|
|
||||||
public abstract class DrawPartial extends DrawBlock{
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void drawPlan(Block block, BuildPlan plan, Eachable<BuildPlan> list){}
|
|
||||||
}
|
|
||||||
@@ -10,7 +10,7 @@ import mindustry.graphics.*;
|
|||||||
|
|
||||||
import static mindustry.Vars.*;
|
import static mindustry.Vars.*;
|
||||||
|
|
||||||
public class DrawPulseShape extends DrawPartial{
|
public class DrawPulseShape extends DrawBlock{
|
||||||
public Color color = Pal.accent.cpy();
|
public Color color = Pal.accent.cpy();
|
||||||
public float stroke = 2f, timeScl = 100f, minStroke = 0.2f;
|
public float stroke = 2f, timeScl = 100f, minStroke = 0.2f;
|
||||||
public float radiusScl = 1f;
|
public float radiusScl = 1f;
|
||||||
|
|||||||
@@ -7,13 +7,11 @@ import mindustry.graphics.*;
|
|||||||
import mindustry.world.*;
|
import mindustry.world.*;
|
||||||
import mindustry.world.blocks.production.Pump.*;
|
import mindustry.world.blocks.production.Pump.*;
|
||||||
|
|
||||||
public class DrawPump extends DrawBlock{
|
public class DrawPumpLiquid extends DrawBlock{
|
||||||
public TextureRegion liquid;
|
public TextureRegion liquid;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void draw(Building build){
|
public void draw(Building build){
|
||||||
Draw.rect(build.block.region, build.x, build.y);
|
|
||||||
|
|
||||||
if(!(build instanceof PumpBuild pump) || pump.liquidDrop == null) return;
|
if(!(build instanceof PumpBuild pump) || pump.liquidDrop == null) return;
|
||||||
|
|
||||||
Drawf.liquid(liquid, build.x, build.y, build.liquids.get(pump.liquidDrop) / build.block.liquidCapacity, pump.liquidDrop.color);
|
Drawf.liquid(liquid, build.x, build.y, build.liquids.get(pump.liquidDrop) / build.block.liquidCapacity, pump.liquidDrop.color);
|
||||||
@@ -43,6 +43,11 @@ public class DrawRegion extends DrawBlock{
|
|||||||
Draw.rect(region, plan.drawx(), plan.drawy());
|
Draw.rect(region, plan.drawx(), plan.drawy());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TextureRegion[] icons(Block block){
|
||||||
|
return new TextureRegion[]{region};
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void load(Block block){
|
public void load(Block block){
|
||||||
region = Core.atlas.find(block.name + suffix);
|
region = Core.atlas.find(block.name + suffix);
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import arc.graphics.g2d.*;
|
|||||||
import mindustry.gen.*;
|
import mindustry.gen.*;
|
||||||
import mindustry.graphics.*;
|
import mindustry.graphics.*;
|
||||||
|
|
||||||
public class DrawShape extends DrawPartial{
|
public class DrawShape extends DrawBlock{
|
||||||
public Color color = Pal.accent.cpy();
|
public Color color = Pal.accent.cpy();
|
||||||
public int sides = 4;
|
public int sides = 4;
|
||||||
public float radius = 2f, timeScl = 1f, layer = -1f, x, y;
|
public float radius = 2f, timeScl = 1f, layer = -1f, x, y;
|
||||||
|
|||||||
@@ -8,26 +8,16 @@ import mindustry.gen.*;
|
|||||||
import mindustry.world.*;
|
import mindustry.world.*;
|
||||||
|
|
||||||
public class DrawSideRegion extends DrawBlock{
|
public class DrawSideRegion extends DrawBlock{
|
||||||
public boolean drawRegion = false;
|
|
||||||
public TextureRegion top1, top2;
|
public TextureRegion top1, top2;
|
||||||
|
|
||||||
public DrawSideRegion(){
|
|
||||||
}
|
|
||||||
|
|
||||||
public DrawSideRegion(boolean drawRegion){
|
|
||||||
this.drawRegion = drawRegion;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void draw(Building build){
|
public void draw(Building build){
|
||||||
if(drawRegion) Draw.rect(build.block.region, build.x, build.y);
|
|
||||||
|
|
||||||
Draw.rect(build.rotation > 1 ? top2 : top1, build.x, build.y, build.rotdeg());
|
Draw.rect(build.rotation > 1 ? top2 : top1, build.x, build.y, build.rotdeg());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawPlan(Block block, BuildPlan plan, Eachable<BuildPlan> list){
|
public void drawPlan(Block block, BuildPlan plan, Eachable<BuildPlan> list){
|
||||||
if(drawRegion) Draw.rect(block.region, plan.drawx(), plan.drawy());
|
|
||||||
Draw.rect(plan.rotation > 1 ? top2 : top1, plan.drawx(), plan.drawy(), plan.rotation * 90);
|
Draw.rect(plan.rotation > 1 ? top2 : top1, plan.drawx(), plan.drawy(), plan.rotation * 90);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -39,7 +29,7 @@ public class DrawSideRegion extends DrawBlock{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TextureRegion[] icons(Block block){
|
public TextureRegion[] icons(Block block){
|
||||||
return new TextureRegion[]{block.region, top1};
|
return new TextureRegion[]{top1};
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import arc.graphics.*;
|
|||||||
import arc.graphics.g2d.*;
|
import arc.graphics.g2d.*;
|
||||||
import mindustry.gen.*;
|
import mindustry.gen.*;
|
||||||
|
|
||||||
public class DrawSpikes extends DrawPartial{
|
public class DrawSpikes extends DrawBlock{
|
||||||
public Color color = Color.valueOf("7457ce");
|
public Color color = Color.valueOf("7457ce");
|
||||||
|
|
||||||
public int amount = 10, layers = 1;
|
public int amount = 10, layers = 1;
|
||||||
|
|||||||
@@ -2,12 +2,10 @@ package mindustry.world.draw;
|
|||||||
|
|
||||||
import arc.*;
|
import arc.*;
|
||||||
import arc.graphics.g2d.*;
|
import arc.graphics.g2d.*;
|
||||||
import arc.util.*;
|
|
||||||
import mindustry.entities.units.*;
|
|
||||||
import mindustry.gen.*;
|
import mindustry.gen.*;
|
||||||
import mindustry.world.*;
|
import mindustry.world.*;
|
||||||
|
|
||||||
public class DrawTurbines extends DrawPartial{
|
public class DrawTurbines extends DrawBlock{
|
||||||
public TextureRegion[] turbines = new TextureRegion[2];
|
public TextureRegion[] turbines = new TextureRegion[2];
|
||||||
public TextureRegion cap;
|
public TextureRegion cap;
|
||||||
public float turbineSpeed = 2f;
|
public float turbineSpeed = 2f;
|
||||||
@@ -33,4 +31,9 @@ public class DrawTurbines extends DrawPartial{
|
|||||||
turbines[i] = Core.atlas.find(block.name + "-turbine" + i);
|
turbines[i] = Core.atlas.find(block.name + "-turbine" + i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TextureRegion[] icons(Block block){
|
||||||
|
return new TextureRegion[]{turbines[0], turbines[1]};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import mindustry.gen.*;
|
|||||||
import mindustry.graphics.*;
|
import mindustry.graphics.*;
|
||||||
import mindustry.world.*;
|
import mindustry.world.*;
|
||||||
|
|
||||||
public class DrawWeave extends DrawPartial{
|
public class DrawWeave extends DrawBlock{
|
||||||
public TextureRegion weave;
|
public TextureRegion weave;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user