Skip to content
This repository has been archived by the owner on Apr 8, 2023. It is now read-only.

Commit

Permalink
Plugin: Stealing Artefacts (#2178)
Browse files Browse the repository at this point in the history
Plugin: Stealing Artefacts
  • Loading branch information
Owain94 authored Jan 12, 2020
2 parents a0fe78b + d8069b0 commit 9f2bdf9
Show file tree
Hide file tree
Showing 5 changed files with 747 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
/*
* Copyright (c) 2020, Dutta64 <https://github.com/dutta64>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.runelite.client.plugins.stealingartefacts;

import net.runelite.client.config.Config;
import net.runelite.client.config.ConfigGroup;
import net.runelite.client.config.ConfigItem;

@ConfigGroup("stealingartefacts")
public interface StealingArtefactsConfig extends Config
{
@ConfigItem(
keyName = "houseInfoBox",
name = "Display InfoBox",
description = "Shows the artefact house cardinal location.<br>See RuneLite plugin for generic InfoBox " +
"settings.",
position = 0
)
default boolean displayHouseInfoBox()
{
return true;
}

@ConfigItem(
keyName = "displayHintArrow",
name = "Display Hint Arrow",
description = "Hint arrow pointing to the artefact house.",
position = 1
)
default boolean displayHintArrow()
{
return true;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
/*
* Copyright (c) 2020, Dutta64 <https://github.com/dutta64>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.runelite.client.plugins.stealingartefacts;

import java.util.Objects;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import net.runelite.api.coords.WorldPoint;

@RequiredArgsConstructor
enum StealingArtefactsHouse
{
NORTH("Northern", "North", new WorldPoint(1767, 3751, 0)),
NORTH_WESTERN("North-Western", "N.West", new WorldPoint(1750, 3763, 1)),
SOUTH("Southern", "South", new WorldPoint(1764, 3735, 1)),
SOUTH_EASTERN("South-Eastern", "S.East", new WorldPoint(1774, 3730, 1)),
SOUTH_WESTERN("South-Western", "S.West", new WorldPoint(1749, 3735, 1)),
WEST("Western", "West", new WorldPoint(1747, 3749, 1)),
CAPTAIN_KHALED("Captain Khaled", "N/A", new WorldPoint(1845, 3752, 0));

private final String name;

@Getter(AccessLevel.PACKAGE)
private final String shortName;

@Getter(AccessLevel.PACKAGE)
private final WorldPoint worldPoint;

@Override
public String toString()
{
return this.name;
}

public static StealingArtefactsHouse fromName(String name)
{
StealingArtefactsHouse stealingArtefactsHouse = null;

for (StealingArtefactsHouse house : StealingArtefactsHouse.values())
{
if (Objects.equals(house.name, name))
{
stealingArtefactsHouse = house;
break;
}
}

if (stealingArtefactsHouse == null)
{
throw new IllegalArgumentException();
}

return stealingArtefactsHouse;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/*
* Copyright (c) 2020, Dutta64 <https://github.com/dutta64>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.runelite.client.plugins.stealingartefacts;

import java.awt.Color;
import java.awt.image.BufferedImage;
import net.runelite.client.ui.overlay.infobox.InfoBox;
import net.runelite.client.ui.overlay.infobox.InfoBoxPriority;

class StealingArtefactsInfoBox extends InfoBox
{
private final StealingArtefactsPlugin stealingArtefactsPlugin;

StealingArtefactsInfoBox(BufferedImage image, StealingArtefactsPlugin stealingArtefactsPlugin)
{
super(image, stealingArtefactsPlugin);
this.stealingArtefactsPlugin = stealingArtefactsPlugin;
setTooltip("Stealing Artefacts");
setPriority(InfoBoxPriority.NONE);
}

@Override
public String getText()
{
return stealingArtefactsPlugin.getStealingArtefactsHouse().getShortName();
}

@Override
public Color getTextColor()
{
return Color.CYAN;
}
}
Loading

0 comments on commit 9f2bdf9

Please sign in to comment.