what's so funny about sussus amogus

This commit is contained in:
HbmMods 2026-05-28 22:14:54 +02:00
parent f1350701e0
commit 0df1aa65b0
3 changed files with 26 additions and 2 deletions

View File

@ -29,7 +29,7 @@ public class GUIScreenRadioAUTOCAL extends GuiScreen {
protected TileEntityRadioAUTOCAL autocal;
protected int xSize = 170;
protected int ySize = 90;
protected int ySize = 138;
protected int guiLeft;
protected int guiTop;
@ -143,6 +143,12 @@ public class GUIScreenRadioAUTOCAL extends GuiScreen {
}
private void drawGuiContainerForegroundLayer(int x, int y) {
for(int i = 0; i < autocal.history.length; i++) {
String line = autocal.history[i];
if(line == null || line.isEmpty()) continue;
this.fontRendererObj.drawString(line, guiLeft + 7, guiTop + 73 + i * 10, 0x00ff00);
}
if(checkClick(x, y, 8, 36, 18, 18)) this.func_146283_a(Arrays.asList(new String[] {EnumChatFormatting.RED + "ON/OFF"}), x, y);
if(checkClick(x, y, 28, 36, 18, 18)) this.func_146283_a(Arrays.asList(new String[] {EnumChatFormatting.RED + "Ignore Errors", "Skips instructions that error,", "leaving the computer turned on.", "May cause unintended behavior", "and inconsistencies."}), x, y);

View File

@ -8,6 +8,7 @@ import com.hbm.module.IParse.ParseContext;
import com.hbm.module.ParseMSES1;
import com.hbm.tileentity.IGUIProvider;
import com.hbm.tileentity.TileEntityTickingBase;
import com.hbm.util.BufferUtil;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@ -29,6 +30,8 @@ public class TileEntityRadioAUTOCAL extends TileEntityTickingBase implements ICo
public String[] script = new String[0];
public IParse msesv1 = new ParseMSES1();
public ParseContext ctx;
public String[] history = new String[] {"", "", "", "", "", ""};
@Override
public String getInventoryName() {
@ -63,7 +66,10 @@ public class TileEntityRadioAUTOCAL extends TileEntityTickingBase implements ICo
try {
int index = this.ctx.current;
this.ctx.current ++;
EnumStatementReturn ret = msesv1.eval(ctx, this.script[index]);
String line = this.script[index];
EnumStatementReturn ret = msesv1.eval(ctx, line);
if(ret != EnumStatementReturn.SKIP) pushMsg(index + ": " + line);
this.history[0] = "Buffer: " + ctx.buffer;
if(ret == EnumStatementReturn.END_TICK) break;
if(ret == EnumStatementReturn.SHUTDOWN) this.stop("Program requested shutdown");
if(!this.ignoreError) {
@ -82,9 +88,19 @@ public class TileEntityRadioAUTOCAL extends TileEntityTickingBase implements ICo
}
}
public void pushMsg(String msg) {
for(int i = 2; i < history.length; i++) {
history[i - 1] = history[i];
}
history[history.length - 1] = msg;
}
public void stop(String reason) {
this.isOn = false;
this.ctx.turnOff();
this.pushMsg(reason);
}
@Override
@ -93,6 +109,7 @@ public class TileEntityRadioAUTOCAL extends TileEntityTickingBase implements ICo
buf.writeBoolean(isOn);
buf.writeBoolean(ignoreError);
buf.writeBoolean(autoReboot);
for(int i = 0; i < history.length; i++) BufferUtil.writeString(buf, this.history[i]);
}
@Override
@ -101,6 +118,7 @@ public class TileEntityRadioAUTOCAL extends TileEntityTickingBase implements ICo
this.isOn = buf.readBoolean();
this.ignoreError = buf.readBoolean();
this.autoReboot = buf.readBoolean();
for(int i = 0; i < history.length; i++) this.history[i] = BufferUtil.readString(buf);
}
@Override

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB