Overhaul transmitter rendering, to make everything look a little nicer. Turn-offable by config in case people prefer the "classic" look.

This commit is contained in:
Ben Spiers 2014-08-15 03:27:04 +01:00
parent 3fcce24bac
commit 8f9a2d31ee
19 changed files with 47 additions and 8 deletions

View file

@ -44,6 +44,7 @@ public class MekanismConfig
public static boolean holidays = true;
public static double baseSoundVolume = 1;
public static boolean machineEffects = true;
public static boolean oldTransmitterRender = false;
}
public static class usage

View file

@ -188,6 +188,7 @@ public class ClientProxy extends CommonProxy
client.holidays = Mekanism.configuration.get("client", "Holidays", true).getBoolean(true);
client.baseSoundVolume = Mekanism.configuration.get("client", "SoundVolume", 1D).getDouble(1D);
client.machineEffects = Mekanism.configuration.get("client", "MachineEffects", true).getBoolean(true);
client.oldTransmitterRender = Mekanism.configuration.get("client", "OldTransmitterRender", false).getBoolean();
if(Mekanism.configuration.hasChanged())
Mekanism.configuration.save();

View file

@ -503,7 +503,6 @@ public class RenderPartTransmitter implements IIconSelfRegister
public void renderSide(ForgeDirection side, PartSidedPipe transmitter)
{
boolean connected = PartTransmitter.connectionMapContainsSide(transmitter.getAllCurrentConnections(), side);
IIcon renderIcon = transmitter.getIconForSide(side);
Colour c = null;

View file

@ -30,7 +30,7 @@ public class PartMechanicalPipe extends PartTransmitter<FluidNetwork> implements
/** The fake tank used for fluid transfer calculations. */
public FluidTank dummyTank = new FluidTank(FluidContainerRegistry.BUCKET_VOLUME);
public static TransmitterIcons pipeIcons = new TransmitterIcons(4, 1);
public static TransmitterIcons pipeIcons = new TransmitterIcons(4, 2);
public float currentScale;
@ -200,7 +200,7 @@ public class PartMechanicalPipe extends PartTransmitter<FluidNetwork> implements
{
pipeIcons.registerCenterIcons(register, new String[] {"MechanicalPipeBasic", "MechanicalPipeAdvanced",
"MechanicalPipeElite", "MechanicalPipeUltimate"});
pipeIcons.registerSideIcons(register, new String[] {"MechanicalPipeSide"});
pipeIcons.registerSideIcons(register, new String[] {"MechanicalPipeVertical", "MechanicalPipeHorizontal"});
}
@Override
@ -215,6 +215,12 @@ public class PartMechanicalPipe extends PartTransmitter<FluidNetwork> implements
return pipeIcons.getSideIcon(0);
}
@Override
public IIcon getSideIconRotated()
{
return pipeIcons.getSideIcon(1);
}
@Override
public TransmissionType getTransmissionType()
{

View file

@ -23,7 +23,7 @@ import cpw.mods.fml.relauncher.SideOnly;
public class PartPressurizedTube extends PartTransmitter<GasNetwork> implements IGasHandler
{
public static TransmitterIcons tubeIcons = new TransmitterIcons(1, 1);
public static TransmitterIcons tubeIcons = new TransmitterIcons(1, 2);
public float currentScale;
@ -199,7 +199,7 @@ public class PartPressurizedTube extends PartTransmitter<GasNetwork> implements
public static void registerIcons(IIconRegister register)
{
tubeIcons.registerCenterIcons(register, new String[] {"PressurizedTube"});
tubeIcons.registerSideIcons(register, new String[] {"TransmitterSideSmall"});
tubeIcons.registerSideIcons(register, new String[] {"SmallTransmitterVertical", "SmallTransmitterHorizontal"});
}
@Override
@ -214,6 +214,12 @@ public class PartPressurizedTube extends PartTransmitter<GasNetwork> implements
return tubeIcons.getSideIcon(0);
}
@Override
public IIcon getSideIconRotated()
{
return tubeIcons.getSideIcon(1);
}
@Override
public TransmissionType getTransmissionType()
{

View file

@ -25,7 +25,13 @@ public class PartRestrictiveTransporter extends PartLogisticalTransporter
@Override
public IIcon getSideIcon()
{
return transporterIcons.getSideIcon(1);
return transporterIcons.getSideIcon(2);
}
@Override
public IIcon getSideIconRotated()
{
return transporterIcons.getSideIcon(3);
}
@Override

View file

@ -12,6 +12,7 @@ import java.util.Set;
import mekanism.api.Coord4D;
import mekanism.api.EnumColor;
import mekanism.api.IConfigurable;
import mekanism.api.MekanismConfig.client;
import mekanism.api.transmitters.IBlockableConnection;
import mekanism.api.transmitters.ITransmitter;
import mekanism.api.transmitters.TransmissionType;
@ -133,6 +134,8 @@ public abstract class PartSidedPipe extends TMultiPart implements TSlottedPart,
public abstract IIcon getSideIcon();
public abstract IIcon getSideIconRotated();
@Override
public void update()
{
@ -162,6 +165,17 @@ public abstract class PartSidedPipe extends TMultiPart implements TSlottedPart,
if(type == ConnectionType.NONE)
{
if(client.oldTransmitterRender)
return getCenterIcon();
if(getAllCurrentConnections() == 3 && side != ForgeDirection.DOWN && side != ForgeDirection.UP)
return getSideIcon();
if(getAllCurrentConnections() == 12 && (side == ForgeDirection.DOWN || side == ForgeDirection.UP))
return getSideIcon();
if(getAllCurrentConnections() == 12 && (side == ForgeDirection.EAST || side == ForgeDirection.WEST))
return getSideIconRotated();
if(getAllCurrentConnections() == 48 && side != ForgeDirection.EAST && side != ForgeDirection.WEST)
return getSideIconRotated();
return getCenterIcon();
}
else {

View file

@ -44,7 +44,7 @@ public class PartUniversalCable extends PartTransmitter<EnergyNetwork> implement
/** A fake power handler used to initiate energy transfer calculations. */
public PowerHandler powerHandler;
public static TransmitterIcons cableIcons = new TransmitterIcons(4, 1);
public static TransmitterIcons cableIcons = new TransmitterIcons(4, 2);
public double currentPower = 0;
@ -176,7 +176,7 @@ public class PartUniversalCable extends PartTransmitter<EnergyNetwork> implement
{
cableIcons.registerCenterIcons(register, new String[] {"UniversalCableBasic", "UniversalCableAdvanced",
"UniversalCableElite", "UniversalCableUltimate"});
cableIcons.registerSideIcons(register, new String[] {"TransmitterSideSmall"});
cableIcons.registerSideIcons(register, new String[] {"SmallTransmitterVertical", "SmallTransmitterHorizontal"});
}
@Override
@ -198,6 +198,12 @@ public class PartUniversalCable extends PartTransmitter<EnergyNetwork> implement
return cableIcons.getSideIcon(0);
}
@Override
public IIcon getSideIconRotated()
{
return cableIcons.getSideIcon(1);
}
@Override
public TransmissionType getTransmissionType()
{

Binary file not shown.

After

Width:  |  Height:  |  Size: 220 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 244 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 257 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 223 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 242 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 280 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 273 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 249 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 272 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB