stored preform stage added & heat/cool prediction state machine filters only gameobject actions

previously, when preform is stored in storage, plugin assumes it's time to talk to kovac for new commision.

previously, any menu action will interupt and stop the heat/cooling statemachine state.
This commit is contained in:
Louis Hong
2024-11-09 01:28:17 -08:00
parent 547c2b40f0
commit dd73d961c0
4 changed files with 87 additions and 33 deletions

View File

@@ -1,7 +1,6 @@
package com.toofifty.easygiantsfoundry;
import static com.toofifty.easygiantsfoundry.EasyGiantsFoundryClientIDs.VARBIT_GAME_STAGE;
import static com.toofifty.easygiantsfoundry.EasyGiantsFoundryClientIDs.WIDGET_PROGRESS_PARENT;
import static com.toofifty.easygiantsfoundry.EasyGiantsFoundryClientIDs.*;
import static com.toofifty.easygiantsfoundry.EasyGiantsFoundryHelper.getHeatColor;
import static com.toofifty.easygiantsfoundry.MouldHelper.SWORD_TYPE_1_VARBIT;
import static com.toofifty.easygiantsfoundry.MouldHelper.SWORD_TYPE_2_VARBIT;
@@ -42,6 +41,7 @@ public class FoundryOverlay3D extends Overlay
GameObject waterfall;
GameObject mouldJig;
GameObject crucible;
GameObject storage;
NPC kovac;
private final Client client;
@@ -111,6 +111,15 @@ public class FoundryOverlay3D extends Overlay
drawKovacIfHandIn(graphics);
}
if (client.getVarbitValue(VARBIT_PREFORM_STORED) == 1)
{
if (config.highlightStorage())
{
drawStorage(graphics);
}
return null;
}
if (state.getCurrentStage() == null)
{
if (config.highlightMould())
@@ -127,7 +136,6 @@ public class FoundryOverlay3D extends Overlay
drawPreformScoreIfPoured(graphics);
}
return null;
}
@@ -486,6 +494,19 @@ public class FoundryOverlay3D extends Overlay
}
}
private void drawStorage(Graphics2D graphics)
{
Shape shape = storage.getConvexHull();
if (shape != null)
{
Color color = config.generalHighlight();
graphics.setColor(color);
graphics.draw(shape);
graphics.setColor(new Color(color.getRed(), color.getGreen(), color.getBlue(), 20));
graphics.fill(shape);
}
}
private void drawKovacIfHandIn(Graphics2D graphics)
{
Widget handInWidget = client.getWidget(HAND_IN_WIDGET);