Merge remote-tracking branch 'github/master'
This commit is contained in:
@@ -57,6 +57,9 @@ import net.runelite.http.api.item.ItemPrice;
|
|||||||
public class GroundItemsOverlay extends Overlay
|
public class GroundItemsOverlay extends Overlay
|
||||||
{
|
{
|
||||||
private static final int REGION_SIZE = 104;
|
private static final int REGION_SIZE = 104;
|
||||||
|
// We must offset the text on the z-axis such that
|
||||||
|
// it doesn't obscure the ground items below it.
|
||||||
|
private static final int OFFSET_Z = 20;
|
||||||
// The game won't send anything higher than this value to the plugin -
|
// The game won't send anything higher than this value to the plugin -
|
||||||
// so we replace any item quantity higher with "Lots" instead.
|
// so we replace any item quantity higher with "Lots" instead.
|
||||||
private static final int MAX_QUANTITY = 65535;
|
private static final int MAX_QUANTITY = 65535;
|
||||||
@@ -197,7 +200,7 @@ public class GroundItemsOverlay extends Overlay
|
|||||||
|
|
||||||
for (int i = 0; i < itemIds.size(); ++i)
|
for (int i = 0; i < itemIds.size(); ++i)
|
||||||
{
|
{
|
||||||
Point point = itemLayer.getCanvasLocation(itemLayer.getHeight());
|
Point point = itemLayer.getCanvasLocation(itemLayer.getHeight() + OFFSET_Z);
|
||||||
// if the item is offscreen, don't bother drawing it
|
// if the item is offscreen, don't bother drawing it
|
||||||
if (point == null)
|
if (point == null)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -36,141 +36,11 @@ import net.runelite.client.config.ConfigItem;
|
|||||||
public interface PohConfig extends Config
|
public interface PohConfig extends Config
|
||||||
{
|
{
|
||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
keyName = "showVarrock",
|
keyName = "showPortals",
|
||||||
name = "Show Varrock portal",
|
name = "Show Portals",
|
||||||
description = "Configures whether or not the Varrock portal is displayed"
|
description = "Configures whether to display teleport portals"
|
||||||
)
|
)
|
||||||
default boolean showVarrock()
|
default boolean showPortals()
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@ConfigItem(
|
|
||||||
keyName = "showFalador",
|
|
||||||
name = "Show Falador portal",
|
|
||||||
description = "Configures whether or not the Camelot portal is displayed"
|
|
||||||
)
|
|
||||||
default boolean showFalador()
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@ConfigItem(
|
|
||||||
keyName = "showLumbridge",
|
|
||||||
name = "Show Lumbridge portal",
|
|
||||||
description = "Configures whether or not the Lumbridge portal is displayed"
|
|
||||||
)
|
|
||||||
default boolean showLumbridge()
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@ConfigItem(
|
|
||||||
keyName = "showCamelot",
|
|
||||||
name = "Show Camelot portal",
|
|
||||||
description = "Configures whether or not the Camelot portal is displayed"
|
|
||||||
)
|
|
||||||
default boolean showCamelot()
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@ConfigItem(
|
|
||||||
keyName = "showArdougne",
|
|
||||||
name = "Show Ardougne portal",
|
|
||||||
description = "Configures whether or not the Ardougne portal is displayed"
|
|
||||||
)
|
|
||||||
default boolean showArdougne()
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@ConfigItem(
|
|
||||||
keyName = "showYanille",
|
|
||||||
name = "Show Yanille portal",
|
|
||||||
description = "Configures whether or not the Yanille portal is displayed"
|
|
||||||
)
|
|
||||||
default boolean showYanille()
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@ConfigItem(
|
|
||||||
keyName = "showLunarIsle",
|
|
||||||
name = "Show Lunar isle portal",
|
|
||||||
description = "Configures whether or not the Lunar isle portal is displayed"
|
|
||||||
)
|
|
||||||
default boolean showLunarIsle()
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@ConfigItem(
|
|
||||||
keyName = "showWaterBirth",
|
|
||||||
name = "Show Waterbirth portal",
|
|
||||||
description = "Configures whether or not the Waterbirth portal is displayed"
|
|
||||||
)
|
|
||||||
default boolean showWaterBirth()
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@ConfigItem(
|
|
||||||
keyName = "showFishingGuild",
|
|
||||||
name = "Show Fishing guild portal",
|
|
||||||
description = "Configures whether or not the Fishing guild portal is displayed"
|
|
||||||
)
|
|
||||||
default boolean showFishingGuild()
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@ConfigItem(
|
|
||||||
keyName = "showSenntisten",
|
|
||||||
name = "Show Senntisten portal",
|
|
||||||
description = "Configures whether or not the Senntisten portal is displayed"
|
|
||||||
)
|
|
||||||
default boolean showSenntisten()
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@ConfigItem(
|
|
||||||
keyName = "showKharyll",
|
|
||||||
name = "Show Kharyll portal",
|
|
||||||
description = "Configures whether or not the Kharyll portal is displayed"
|
|
||||||
)
|
|
||||||
default boolean showKharyll()
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@ConfigItem(
|
|
||||||
keyName = "showAnnakarl",
|
|
||||||
name = "Show Annakarl portal",
|
|
||||||
description = "Configures whether or not the Annakarl portal is displayed"
|
|
||||||
)
|
|
||||||
default boolean showAnnakarl()
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@ConfigItem(
|
|
||||||
keyName = "showKourend",
|
|
||||||
name = "Show Kourend portal",
|
|
||||||
description = "Configures whether or not the Kourend portal is displayed"
|
|
||||||
)
|
|
||||||
default boolean showKourend()
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@ConfigItem(
|
|
||||||
keyName = "showMarim",
|
|
||||||
name = "Show Marim portal",
|
|
||||||
description = "Configures whether or not the Marim portal is displayed"
|
|
||||||
)
|
|
||||||
default boolean showMarim()
|
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,37 +27,26 @@ package net.runelite.client.plugins.poh;
|
|||||||
import java.awt.Dimension;
|
import java.awt.Dimension;
|
||||||
import java.awt.Graphics2D;
|
import java.awt.Graphics2D;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import net.runelite.api.Client;
|
import net.runelite.api.Client;
|
||||||
import net.runelite.api.Perspective;
|
import net.runelite.api.Perspective;
|
||||||
import net.runelite.api.Point;
|
import net.runelite.api.Point;
|
||||||
import static net.runelite.client.plugins.poh.PohIcons.ALTAR;
|
|
||||||
import static net.runelite.client.plugins.poh.PohIcons.ANNAKARL;
|
|
||||||
import static net.runelite.client.plugins.poh.PohIcons.ARDOUGNE;
|
|
||||||
import static net.runelite.client.plugins.poh.PohIcons.CAMELOT;
|
|
||||||
import static net.runelite.client.plugins.poh.PohIcons.EXITPORTAL;
|
|
||||||
import static net.runelite.client.plugins.poh.PohIcons.FALADOR;
|
|
||||||
import static net.runelite.client.plugins.poh.PohIcons.FISHINGGUILD;
|
|
||||||
import static net.runelite.client.plugins.poh.PohIcons.GLORY;
|
|
||||||
import static net.runelite.client.plugins.poh.PohIcons.KHARYLL;
|
|
||||||
import static net.runelite.client.plugins.poh.PohIcons.KOUREND;
|
|
||||||
import static net.runelite.client.plugins.poh.PohIcons.LUMBRIDGE;
|
|
||||||
import static net.runelite.client.plugins.poh.PohIcons.LUNARISLE;
|
|
||||||
import static net.runelite.client.plugins.poh.PohIcons.MARIM;
|
|
||||||
import static net.runelite.client.plugins.poh.PohIcons.POOLS;
|
|
||||||
import static net.runelite.client.plugins.poh.PohIcons.REPAIR;
|
|
||||||
import static net.runelite.client.plugins.poh.PohIcons.SENNTISTEN;
|
|
||||||
import static net.runelite.client.plugins.poh.PohIcons.VARROCK;
|
|
||||||
import static net.runelite.client.plugins.poh.PohIcons.WATERBIRTH;
|
|
||||||
import static net.runelite.client.plugins.poh.PohIcons.YANILLE;
|
|
||||||
import net.runelite.client.ui.overlay.Overlay;
|
import net.runelite.client.ui.overlay.Overlay;
|
||||||
import net.runelite.client.ui.overlay.OverlayLayer;
|
import net.runelite.client.ui.overlay.OverlayLayer;
|
||||||
import net.runelite.client.ui.overlay.OverlayPosition;
|
import net.runelite.client.ui.overlay.OverlayPosition;
|
||||||
|
|
||||||
public class PohOverlay extends Overlay
|
public class PohOverlay extends Overlay
|
||||||
{
|
{
|
||||||
|
private static final PohIcons[] PORTALS = new PohIcons[]
|
||||||
|
{
|
||||||
|
PohIcons.LUMBRIDGE, PohIcons.FALADOR, PohIcons.VARROCK, PohIcons.CAMELOT, PohIcons.ARDOUGNE,
|
||||||
|
PohIcons.YANILLE, PohIcons.LUNARISLE, PohIcons.WATERBIRTH, PohIcons.FISHINGGUILD,
|
||||||
|
PohIcons.SENNTISTEN, PohIcons.KHARYLL, PohIcons.ANNAKARL, PohIcons.KOUREND, PohIcons.MARIM
|
||||||
|
};
|
||||||
|
|
||||||
private static final int MAX_DISTANCE = 2350;
|
private static final int MAX_DISTANCE = 2350;
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@@ -106,81 +95,29 @@ public class PohOverlay extends Overlay
|
|||||||
public void updateConfig()
|
public void updateConfig()
|
||||||
{
|
{
|
||||||
iconList.clear();
|
iconList.clear();
|
||||||
if (config.showLumbridge())
|
if (config.showPortals())
|
||||||
{
|
{
|
||||||
iconList.add(LUMBRIDGE);
|
Collections.addAll(iconList, PORTALS);
|
||||||
}
|
|
||||||
if (config.showFalador())
|
|
||||||
{
|
|
||||||
iconList.add(FALADOR);
|
|
||||||
}
|
|
||||||
if (config.showVarrock())
|
|
||||||
{
|
|
||||||
iconList.add(VARROCK);
|
|
||||||
}
|
|
||||||
if (config.showCamelot())
|
|
||||||
{
|
|
||||||
iconList.add(CAMELOT);
|
|
||||||
}
|
|
||||||
if (config.showArdougne())
|
|
||||||
{
|
|
||||||
iconList.add(ARDOUGNE);
|
|
||||||
}
|
|
||||||
if (config.showYanille())
|
|
||||||
{
|
|
||||||
iconList.add(YANILLE);
|
|
||||||
}
|
|
||||||
if (config.showLunarIsle())
|
|
||||||
{
|
|
||||||
iconList.add(LUNARISLE);
|
|
||||||
}
|
|
||||||
if (config.showWaterBirth())
|
|
||||||
{
|
|
||||||
iconList.add(WATERBIRTH);
|
|
||||||
}
|
|
||||||
if (config.showFishingGuild())
|
|
||||||
{
|
|
||||||
iconList.add(FISHINGGUILD);
|
|
||||||
}
|
|
||||||
if (config.showSenntisten())
|
|
||||||
{
|
|
||||||
iconList.add(SENNTISTEN);
|
|
||||||
}
|
|
||||||
if (config.showKharyll())
|
|
||||||
{
|
|
||||||
iconList.add(KHARYLL);
|
|
||||||
}
|
|
||||||
if (config.showAnnakarl())
|
|
||||||
{
|
|
||||||
iconList.add(ANNAKARL);
|
|
||||||
}
|
|
||||||
if (config.showKourend())
|
|
||||||
{
|
|
||||||
iconList.add(KOUREND);
|
|
||||||
}
|
|
||||||
if (config.showMarim())
|
|
||||||
{
|
|
||||||
iconList.add(MARIM);
|
|
||||||
}
|
}
|
||||||
if (config.showAltar())
|
if (config.showAltar())
|
||||||
{
|
{
|
||||||
iconList.add(ALTAR);
|
iconList.add(PohIcons.ALTAR);
|
||||||
}
|
}
|
||||||
if (config.showGlory())
|
if (config.showGlory())
|
||||||
{
|
{
|
||||||
iconList.add(GLORY);
|
iconList.add(PohIcons.GLORY);
|
||||||
}
|
}
|
||||||
if (config.showRepairStand())
|
if (config.showRepairStand())
|
||||||
{
|
{
|
||||||
iconList.add(REPAIR);
|
iconList.add(PohIcons.REPAIR);
|
||||||
}
|
}
|
||||||
if (config.showPools())
|
if (config.showPools())
|
||||||
{
|
{
|
||||||
iconList.add(POOLS);
|
iconList.add(PohIcons.POOLS);
|
||||||
}
|
}
|
||||||
if (config.showExitPortal())
|
if (config.showExitPortal())
|
||||||
{
|
{
|
||||||
iconList.add(EXITPORTAL);
|
iconList.add(PohIcons.EXITPORTAL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -264,7 +264,7 @@ public class OverlayRenderer
|
|||||||
final Dimension dimension = MoreObjects.firstNonNull(safeRender(overlay, surfaceGraphics, subPosition), new Dimension());
|
final Dimension dimension = MoreObjects.firstNonNull(safeRender(overlay, surfaceGraphics, subPosition), new Dimension());
|
||||||
if (dimension.width == 0 && dimension.height == 0)
|
if (dimension.width == 0 && dimension.height == 0)
|
||||||
{
|
{
|
||||||
return;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
final BufferedImage clippedImage = surface.getSubimage(0, 0, dimension.width, dimension.height);
|
final BufferedImage clippedImage = surface.getSubimage(0, 0, dimension.width, dimension.height);
|
||||||
|
|||||||
Reference in New Issue
Block a user