Add highlighting of waterfall/lava pool when wrong temperature
This commit is contained in:
@@ -175,4 +175,33 @@ public class EasyGiantsFoundryState
|
||||
|
||||
return Heat.NONE;
|
||||
}
|
||||
|
||||
public int getHeatChangeNeeded()
|
||||
{
|
||||
Heat requiredHeat = getCurrentStage().getHeat();
|
||||
int heat = getHeatAmount();
|
||||
|
||||
int[] range;
|
||||
switch (requiredHeat)
|
||||
{
|
||||
case LOW:
|
||||
range = getLowHeatRange();
|
||||
break;
|
||||
case MED:
|
||||
range = getMedHeatRange();
|
||||
break;
|
||||
case HIGH:
|
||||
range = getHighHeatRange();
|
||||
break;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (heat < range[0])
|
||||
return range[0] - heat;
|
||||
else if (heat > range[1])
|
||||
return range[1] - heat;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -105,30 +105,66 @@ public class FoundryOverlay3D extends Overlay {
|
||||
Stage stage = state.getCurrentStage();
|
||||
|
||||
GameObject stageObject = getStageObject(stage);
|
||||
if (stageObject != null)
|
||||
if (stageObject == null)
|
||||
{
|
||||
Color color = getObjectColor(stage, heat);
|
||||
Shape objectClickbox = stageObject.getClickbox();
|
||||
if (objectClickbox != null)
|
||||
return null;
|
||||
}
|
||||
|
||||
Color color = getObjectColor(stage, heat);
|
||||
Shape objectClickbox = stageObject.getClickbox();
|
||||
if (objectClickbox != null)
|
||||
{
|
||||
Point mousePosition = client.getMouseCanvasPosition();
|
||||
if (objectClickbox.contains(mousePosition.getX(), mousePosition.getY()))
|
||||
{
|
||||
Point mousePosition = client.getMouseCanvasPosition();
|
||||
if (objectClickbox.contains(mousePosition.getX(), mousePosition.getY()))
|
||||
{
|
||||
graphics.setColor(color.darker());
|
||||
}
|
||||
else
|
||||
{
|
||||
graphics.setColor(color);
|
||||
}
|
||||
graphics.draw(objectClickbox);
|
||||
graphics.setColor(new Color(color.getRed(), color.getGreen(), color.getBlue(), 20));
|
||||
graphics.fill(objectClickbox);
|
||||
graphics.setColor(color.darker());
|
||||
}
|
||||
else
|
||||
{
|
||||
graphics.setColor(color);
|
||||
}
|
||||
graphics.draw(objectClickbox);
|
||||
graphics.setColor(new Color(color.getRed(), color.getGreen(), color.getBlue(), 20));
|
||||
graphics.fill(objectClickbox);
|
||||
}
|
||||
|
||||
if (color.equals(ColorScheme.PROGRESS_ERROR_COLOR))
|
||||
{
|
||||
drawHeatChangers(graphics);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private void drawHeatChangers(Graphics2D graphics)
|
||||
{
|
||||
int change = state.getHeatChangeNeeded();
|
||||
Shape shape = null;
|
||||
if (change < 0)
|
||||
{
|
||||
shape = waterfall.getClickbox();
|
||||
} else if (change > 0)
|
||||
{
|
||||
shape = lavaPool.getClickbox();
|
||||
}
|
||||
if (shape != null)
|
||||
{
|
||||
Point mousePosition = client.getMouseCanvasPosition();
|
||||
Color color = ColorScheme.PROGRESS_COMPLETE_COLOR;
|
||||
if (shape.contains(mousePosition.getX(), mousePosition.getY()))
|
||||
{
|
||||
graphics.setColor(color.darker());
|
||||
}
|
||||
else
|
||||
{
|
||||
graphics.setColor(color);
|
||||
}
|
||||
graphics.draw(shape);
|
||||
graphics.setColor(new Color(color.getRed(), color.getGreen(), color.getBlue(), 20));
|
||||
graphics.fill(shape);
|
||||
}
|
||||
}
|
||||
|
||||
private void drawCrucibleIfMouldSet(Graphics2D graphics)
|
||||
{
|
||||
if (client.getVarbitValue(MouldHelper.SWORD_TYPE_1_VARBIT) == 0)
|
||||
|
||||
Reference in New Issue
Block a user