Merge branch 'seth'

This commit is contained in:
Adam
2017-06-29 17:36:12 -04:00
7 changed files with 120 additions and 10 deletions

View File

@@ -25,12 +25,14 @@
package net.runelite.client.plugins.boosts;
import net.runelite.client.RuneLite;
import net.runelite.client.plugins.Plugin;
import net.runelite.client.ui.overlay.Overlay;
public class Boosts extends Plugin
{
private final Overlay overlay = new BoostsOverlay();
private final BoostsConfig config = RuneLite.getRunelite().getConfigManager().getConfig(BoostsConfig.class);
private final Overlay overlay = new BoostsOverlay(this);
@Override
public Overlay getOverlay()
@@ -47,4 +49,9 @@ public class Boosts extends Plugin
protected void shutDown() throws Exception
{
}
public BoostsConfig getConfig()
{
return config;
}
}

View File

@@ -0,0 +1,46 @@
/*
* Copyright (c) 2017, Seth <Sethtroll3@gmail.com>
* 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.boosts;
import net.runelite.client.config.ConfigGroup;
import net.runelite.client.config.ConfigItem;
@ConfigGroup(
keyName = "boosts",
name = "Boosts Info",
description = "Configuration for the Boosts plugin"
)
public interface BoostsConfig
{
@ConfigItem(
keyName = "enabled",
name = "Enabled",
description = "Configures whether or not boost info is displayed"
)
default boolean enabled()
{
return true;
}
}

View File

@@ -50,10 +50,13 @@ class BoostsOverlay extends Overlay
private static final int RIGHT_BORDER = 2;
private static final int SEPARATOR = 2;
BoostsOverlay()
private final BoostsConfig config;
BoostsOverlay(Boosts plugin)
{
super(OverlayPosition.TOP_LEFT, OverlayPriority.MED);
this.config = plugin.getConfig();
}
@Override
@@ -61,7 +64,7 @@ class BoostsOverlay extends Overlay
{
Client client = RuneLite.getClient();
if (client.getGameState() != GameState.LOGGED_IN)
if (client.getGameState() != GameState.LOGGED_IN || !config.enabled())
return null;
FontMetrics metrics = graphics.getFontMetrics();

View File

@@ -24,12 +24,14 @@
*/
package net.runelite.client.plugins.mousehighlight;
import net.runelite.client.RuneLite;
import net.runelite.client.plugins.Plugin;
import net.runelite.client.ui.overlay.Overlay;
public class MouseHighlight extends Plugin
{
private final Overlay overlay = new MouseHighlightOverlay();
private final MouseHighlightConfig config = RuneLite.getRunelite().getConfigManager().getConfig(MouseHighlightConfig.class);
private final Overlay overlay = new MouseHighlightOverlay(this);
@Override
public Overlay getOverlay()
@@ -48,4 +50,9 @@ public class MouseHighlight extends Plugin
{
}
public MouseHighlightConfig getConfig()
{
return config;
}
}

View File

@@ -0,0 +1,46 @@
/*
* Copyright (c) 2017, Seth <Sethtroll3@gmail.com>
* 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.mousehighlight;
import net.runelite.client.config.ConfigGroup;
import net.runelite.client.config.ConfigItem;
@ConfigGroup(
keyName = "mousehighlight",
name = "Mouse Highlighting",
description = "Configuration for the mouse Highlight plugin"
)
public interface MouseHighlightConfig
{
@ConfigItem(
keyName = "enabled",
name = "Enabled",
description = "Configures whether or not mouse hover info is displayed"
)
default boolean enabled()
{
return true;
}
}

View File

@@ -37,23 +37,24 @@ import net.runelite.client.RuneLite;
import net.runelite.client.ui.overlay.Overlay;
import net.runelite.client.ui.overlay.OverlayPosition;
public class MouseHighlightOverlay extends Overlay
class MouseHighlightOverlay extends Overlay
{
// Grabs the colour and name from a target string
// <col=ffffff>Player1
private final Pattern p = Pattern.compile("^<col=([^>]+)>([^<]*)");
private final MouseHighlightConfig config;
public MouseHighlightOverlay()
MouseHighlightOverlay(MouseHighlight plugin)
{
super(OverlayPosition.DYNAMIC);
this.config = plugin.getConfig();
}
@Override
public Dimension render(Graphics2D graphics)
{
Client client = RuneLite.getClient();
if (client.getGameState() != GameState.LOGGED_IN)
if (client.getGameState() != GameState.LOGGED_IN || !config.enabled())
{
return null;
}

View File

@@ -44,6 +44,6 @@
"name": "Corporeal Beast",
"spawnTime": 30
}, {
"name": "Giant mole",
"name": "Giant Mole",
"spawnTime": 10
}]