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:
@@ -23,6 +23,8 @@ public class EasyGiantsFoundryClientIDs
|
|||||||
// 3 -
|
// 3 -
|
||||||
protected static final int VARBIT_GAME_STAGE = 13914;
|
protected static final int VARBIT_GAME_STAGE = 13914;
|
||||||
|
|
||||||
|
protected static final int VARBIT_PREFORM_STORED = 13947;
|
||||||
|
|
||||||
protected static final int WIDGET_HEAT_PARENT = 49414153;
|
protected static final int WIDGET_HEAT_PARENT = 49414153;
|
||||||
protected static final int WIDGET_LOW_HEAT_PARENT = 49414163;
|
protected static final int WIDGET_LOW_HEAT_PARENT = 49414163;
|
||||||
protected static final int WIDGET_MED_HEAT_PARENT = 49414164;
|
protected static final int WIDGET_MED_HEAT_PARENT = 49414164;
|
||||||
|
|||||||
@@ -247,6 +247,18 @@ public interface EasyGiantsFoundryConfig extends Config
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ConfigItem(
|
||||||
|
keyName = "storageHighlight",
|
||||||
|
name = "Highlight Preform Storage",
|
||||||
|
description = "Highlight Storage when it contains a preform.",
|
||||||
|
position = 10,
|
||||||
|
section = highlightList
|
||||||
|
)
|
||||||
|
default boolean highlightStorage()
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
@ConfigSection(
|
@ConfigSection(
|
||||||
name = "Info Panel",
|
name = "Info Panel",
|
||||||
description = "Settings for the Info Panel overlay",
|
description = "Settings for the Info Panel overlay",
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ import net.runelite.api.GameState;
|
|||||||
import net.runelite.api.InventoryID;
|
import net.runelite.api.InventoryID;
|
||||||
import net.runelite.api.Item;
|
import net.runelite.api.Item;
|
||||||
import net.runelite.api.ItemContainer;
|
import net.runelite.api.ItemContainer;
|
||||||
|
import net.runelite.api.MenuAction;
|
||||||
import net.runelite.api.Skill;
|
import net.runelite.api.Skill;
|
||||||
import net.runelite.api.events.GameObjectDespawned;
|
import net.runelite.api.events.GameObjectDespawned;
|
||||||
import net.runelite.api.events.GameObjectSpawned;
|
import net.runelite.api.events.GameObjectSpawned;
|
||||||
@@ -58,6 +59,7 @@ public class EasyGiantsFoundryPlugin extends Plugin
|
|||||||
|
|
||||||
private static final int CRUCIBLE = 44776;
|
private static final int CRUCIBLE = 44776;
|
||||||
private static final int MOULD_JIG = 44777;
|
private static final int MOULD_JIG = 44777;
|
||||||
|
private static final int STORAGE = 44778;
|
||||||
|
|
||||||
private static final int KOVAC_NPC = 11472;
|
private static final int KOVAC_NPC = 11472;
|
||||||
|
|
||||||
@@ -156,10 +158,47 @@ public class EasyGiantsFoundryPlugin extends Plugin
|
|||||||
case CRUCIBLE:
|
case CRUCIBLE:
|
||||||
overlay3d.crucible = gameObject;
|
overlay3d.crucible = gameObject;
|
||||||
break;
|
break;
|
||||||
|
case STORAGE:
|
||||||
|
overlay3d.storage = gameObject;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Subscribe
|
||||||
|
public void onGameObjectDespawned(GameObjectDespawned event)
|
||||||
|
{
|
||||||
|
GameObject gameObject = event.getGameObject();
|
||||||
|
switch (gameObject.getId())
|
||||||
|
{
|
||||||
|
case POLISHING_WHEEL:
|
||||||
|
state.setEnabled(false);
|
||||||
|
overlay3d.polishingWheel = null;
|
||||||
|
break;
|
||||||
|
case GRINDSTONE:
|
||||||
|
overlay3d.grindstone = null;
|
||||||
|
break;
|
||||||
|
case LAVA_POOL:
|
||||||
|
overlay3d.lavaPool = null;
|
||||||
|
break;
|
||||||
|
case WATERFALL:
|
||||||
|
overlay3d.waterfall = null;
|
||||||
|
break;
|
||||||
|
case TRIP_HAMMER:
|
||||||
|
overlay3d.tripHammer = null;
|
||||||
|
break;
|
||||||
|
case MOULD_JIG:
|
||||||
|
overlay3d.mouldJig = null;
|
||||||
|
break;
|
||||||
|
case CRUCIBLE:
|
||||||
|
overlay3d.crucible = null;
|
||||||
|
break;
|
||||||
|
case STORAGE:
|
||||||
|
overlay3d.storage = null;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Subscribe
|
@Subscribe
|
||||||
public void onGameStateChanged(GameStateChanged event)
|
public void onGameStateChanged(GameStateChanged event)
|
||||||
{
|
{
|
||||||
@@ -202,36 +241,6 @@ public class EasyGiantsFoundryPlugin extends Plugin
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Subscribe
|
|
||||||
public void onGameObjectDespawned(GameObjectDespawned event)
|
|
||||||
{
|
|
||||||
GameObject gameObject = event.getGameObject();
|
|
||||||
switch (gameObject.getId())
|
|
||||||
{
|
|
||||||
case POLISHING_WHEEL:
|
|
||||||
state.setEnabled(false);
|
|
||||||
overlay3d.polishingWheel = null;
|
|
||||||
break;
|
|
||||||
case GRINDSTONE:
|
|
||||||
overlay3d.grindstone = null;
|
|
||||||
break;
|
|
||||||
case LAVA_POOL:
|
|
||||||
overlay3d.lavaPool = null;
|
|
||||||
break;
|
|
||||||
case WATERFALL:
|
|
||||||
overlay3d.waterfall = null;
|
|
||||||
break;
|
|
||||||
case TRIP_HAMMER:
|
|
||||||
overlay3d.tripHammer = null;
|
|
||||||
break;
|
|
||||||
case MOULD_JIG:
|
|
||||||
overlay3d.mouldJig = null;
|
|
||||||
break;
|
|
||||||
case CRUCIBLE:
|
|
||||||
overlay3d.crucible = null;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Subscribe
|
@Subscribe
|
||||||
public void onNpcSpawned(NpcSpawned event)
|
public void onNpcSpawned(NpcSpawned event)
|
||||||
@@ -271,6 +280,16 @@ public class EasyGiantsFoundryPlugin extends Plugin
|
|||||||
@Subscribe
|
@Subscribe
|
||||||
public void onMenuOptionClicked(MenuOptionClicked event)
|
public void onMenuOptionClicked(MenuOptionClicked event)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
if (!(event.getMenuAction() == MenuAction.GAME_OBJECT_FIRST_OPTION
|
||||||
|
|| event.getMenuAction() == MenuAction.GAME_OBJECT_SECOND_OPTION
|
||||||
|
|| event.getMenuAction() == MenuAction.GAME_OBJECT_THIRD_OPTION
|
||||||
|
|| event.getMenuAction() == MenuAction.GAME_OBJECT_FOURTH_OPTION
|
||||||
|
|| event.getMenuAction() == MenuAction.GAME_OBJECT_FIFTH_OPTION))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!state.isEnabled()) return;
|
if (!state.isEnabled()) return;
|
||||||
|
|
||||||
if (event.getMenuTarget().contains("Crucible "))
|
if (event.getMenuTarget().contains("Crucible "))
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package com.toofifty.easygiantsfoundry;
|
package com.toofifty.easygiantsfoundry;
|
||||||
|
|
||||||
import static com.toofifty.easygiantsfoundry.EasyGiantsFoundryClientIDs.VARBIT_GAME_STAGE;
|
import static com.toofifty.easygiantsfoundry.EasyGiantsFoundryClientIDs.*;
|
||||||
import static com.toofifty.easygiantsfoundry.EasyGiantsFoundryClientIDs.WIDGET_PROGRESS_PARENT;
|
|
||||||
import static com.toofifty.easygiantsfoundry.EasyGiantsFoundryHelper.getHeatColor;
|
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_1_VARBIT;
|
||||||
import static com.toofifty.easygiantsfoundry.MouldHelper.SWORD_TYPE_2_VARBIT;
|
import static com.toofifty.easygiantsfoundry.MouldHelper.SWORD_TYPE_2_VARBIT;
|
||||||
@@ -42,6 +41,7 @@ public class FoundryOverlay3D extends Overlay
|
|||||||
GameObject waterfall;
|
GameObject waterfall;
|
||||||
GameObject mouldJig;
|
GameObject mouldJig;
|
||||||
GameObject crucible;
|
GameObject crucible;
|
||||||
|
GameObject storage;
|
||||||
NPC kovac;
|
NPC kovac;
|
||||||
|
|
||||||
private final Client client;
|
private final Client client;
|
||||||
@@ -111,6 +111,15 @@ public class FoundryOverlay3D extends Overlay
|
|||||||
drawKovacIfHandIn(graphics);
|
drawKovacIfHandIn(graphics);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (client.getVarbitValue(VARBIT_PREFORM_STORED) == 1)
|
||||||
|
{
|
||||||
|
if (config.highlightStorage())
|
||||||
|
{
|
||||||
|
drawStorage(graphics);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
if (state.getCurrentStage() == null)
|
if (state.getCurrentStage() == null)
|
||||||
{
|
{
|
||||||
if (config.highlightMould())
|
if (config.highlightMould())
|
||||||
@@ -127,7 +136,6 @@ public class FoundryOverlay3D extends Overlay
|
|||||||
drawPreformScoreIfPoured(graphics);
|
drawPreformScoreIfPoured(graphics);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return null;
|
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)
|
private void drawKovacIfHandIn(Graphics2D graphics)
|
||||||
{
|
{
|
||||||
Widget handInWidget = client.getWidget(HAND_IN_WIDGET);
|
Widget handInWidget = client.getWidget(HAND_IN_WIDGET);
|
||||||
|
|||||||
Reference in New Issue
Block a user