mirror of
https://github.com/GTNewHorizons/Applied-Energistics-2-Unofficial.git
synced 2026-10-25 20:22:23 +00:00
red tint when something stuck in interface (#1078)
This commit is contained in:
1 parent
f0f28dd8b4
commit
00bc546ec8
4 files changed
+37
-4
No files matched your search
@@ -19,6 +19,7 @@ import appeng.block.misc.BlockInterface;
|
||||
import appeng.client.render.BaseBlockRender;
|
||||
import appeng.client.render.BlockRenderInfo;
|
||||
import appeng.client.texture.ExtraBlockTextures;
|
||||
import appeng.core.AEConfig;
|
||||
import appeng.tile.misc.TileInterface;
|
||||
|
||||
public class RenderBlockInterface extends BaseBlockRender<BlockInterface, TileInterface> {
|
||||
@@ -44,7 +45,15 @@ public class RenderBlockInterface extends BaseBlockRender<BlockInterface, TileIn
|
||||
side);
|
||||
}
|
||||
|
||||
final boolean fz = super.renderInWorld(block, world, x, y, z, renderer);
|
||||
this.preRenderInWorld(block, world, x, y, z, renderer);
|
||||
boolean fz;
|
||||
if (AEConfig.instance.redTintWhenSomethingStuckInInterface && ti != null && ti.somethingStuck) {
|
||||
fz = renderer.renderStandardBlockWithColorMultiplier(block, x, y, z, 0.75f, 0.5f, 0.5f);
|
||||
} else {
|
||||
fz = renderer.renderStandardBlock(block, x, y, z);
|
||||
}
|
||||
|
||||
this.postRenderInWorld(renderer);
|
||||
|
||||
info.setTemporaryRenderIcon(null);
|
||||
|
||||
|
||||
@@ -93,6 +93,7 @@ public final class AEConfig extends Configuration implements IConfigurableObject
|
||||
public boolean showContainerInteractionTooltips = true;
|
||||
public int MEMonitorableSmallSize = 6;
|
||||
public int InterfaceTerminalSmallSize = 6;
|
||||
public boolean redTintWhenSomethingStuckInInterface = true;
|
||||
|
||||
public boolean debugLogTiming = false;
|
||||
public boolean debugPathFinding = false;
|
||||
@@ -351,6 +352,8 @@ public final class AEConfig extends Configuration implements IConfigurableObject
|
||||
.get("Client", "showOnlyInterfacesWithFreeSlotsInInterfaceTerminal", false).getBoolean(false);
|
||||
this.showContainerInteractionTooltips = this.get("Client", "showContainerInteractionTooltips", true)
|
||||
.getBoolean(true);
|
||||
this.redTintWhenSomethingStuckInInterface = this.get("Client", "redTintWhenSomethingStuckInInterface", true)
|
||||
.getBoolean(true);
|
||||
this.MEMonitorableSmallSize = this.get("Client", "MEMonitorableSmallSize", 6).getInt(6);
|
||||
this.InterfaceTerminalSmallSize = this.get("Client", "InterfaceTerminalSmallSize", 6).getInt(6);
|
||||
// load buttons..
|
||||
|
||||
@@ -107,6 +107,7 @@ import appeng.tile.inventory.AppEngInternalAEInventory;
|
||||
import appeng.tile.inventory.AppEngInternalInventory;
|
||||
import appeng.tile.inventory.IAEAppEngInventory;
|
||||
import appeng.tile.inventory.InvOperation;
|
||||
import appeng.tile.misc.TileInterface;
|
||||
import appeng.tile.networking.TileCableBus;
|
||||
import appeng.util.ConfigManager;
|
||||
import appeng.util.IConfigManagerHost;
|
||||
@@ -169,6 +170,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn
|
||||
private int lastInputHash = 0;
|
||||
private final boolean isFluidInterface;
|
||||
private ScheduledReason scheduledReason = ScheduledReason.UNDEFINED;
|
||||
public boolean somethingStuck = false;
|
||||
|
||||
public DualityInterface(final AENetworkProxy networkProxy, final IInterfaceHost ih) {
|
||||
this.gridProxy = networkProxy;
|
||||
@@ -774,10 +776,18 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn
|
||||
|
||||
if (this.waitingToSend.isEmpty()) {
|
||||
this.waitingToSend = null;
|
||||
}
|
||||
this.toggleTint(false);
|
||||
} else this.toggleTint(true);
|
||||
return sentSomething;
|
||||
}
|
||||
|
||||
private void toggleTint(boolean stuck) {
|
||||
if (stuck != this.somethingStuck && this.iHost instanceof TileInterface ti) {
|
||||
this.somethingStuck = stuck;
|
||||
ti.markForUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
private boolean updateStorage() {
|
||||
boolean didSomething = false;
|
||||
|
||||
|
||||
@@ -78,6 +78,7 @@ public class TileInterface extends AENetworkInvTile
|
||||
private static final int CHANNEL_FLAG = 2;
|
||||
private static final int BOOTING_FLAG = 4;
|
||||
private int clientFlags = 0; // sent as byte.
|
||||
public boolean somethingStuck = false;
|
||||
|
||||
@MENetworkEventSubscribe
|
||||
public void stateChange(final MENetworkChannelsChanged c) {
|
||||
@@ -298,12 +299,21 @@ public class TileInterface extends AENetworkInvTile
|
||||
@TileEvent(TileEventType.NETWORK_READ)
|
||||
public boolean readFromStream_TileInterface(final ByteBuf data) {
|
||||
int newState = data.readByte();
|
||||
boolean somethingChanged = false;
|
||||
if (newState != clientFlags) {
|
||||
clientFlags = newState;
|
||||
this.markForUpdate();
|
||||
return true;
|
||||
somethingChanged = true;
|
||||
}
|
||||
return false;
|
||||
|
||||
final boolean oldSomethingStuck = this.somethingStuck;
|
||||
this.somethingStuck = data.readBoolean();
|
||||
if (oldSomethingStuck != somethingStuck) {
|
||||
worldObj.markBlockRangeForRenderUpdate(xCoord, yCoord, zCoord, xCoord, yCoord, zCoord);
|
||||
somethingChanged = true;
|
||||
}
|
||||
|
||||
return somethingChanged;
|
||||
}
|
||||
|
||||
@TileEvent(TileEventType.NETWORK_WRITE)
|
||||
@@ -320,6 +330,7 @@ public class TileInterface extends AENetworkInvTile
|
||||
}
|
||||
|
||||
data.writeByte(clientFlags);
|
||||
data.writeBoolean(duality.somethingStuck);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in new issue
Block a user