Presence / Test Removal

This commit is contained in:
zeruth
2019-06-07 01:03:11 -04:00
parent 79658edfef
commit aa0476aa62
7 changed files with 11 additions and 294 deletions

View File

@@ -300,7 +300,7 @@ public class Notifier
{
if (OSType.getOSType() == OSType.Linux && !Files.exists(notifyIconPath))
{
try (InputStream stream = Notifier.class.getResourceAsStream("/runelite.png"))
try (InputStream stream = Notifier.class.getResourceAsStream("/runeliteplus.png"))
{
Files.copy(stream, notifyIconPath);
}

View File

@@ -34,22 +34,11 @@ import net.runelite.client.config.Range;
@ConfigGroup("runeliteplus")
public interface RuneLitePlusConfig extends Config
{
@ConfigItem(
position = 0,
keyName = "customPresence",
name = "RL+ Presence",
description = "Represent RL+ with a custom icon and discord presence."
)
default boolean customPresence()
{
return false;
}
@ConfigItem(
keyName = "enableOpacity",
name = "Enable opacity",
description = "Enables opacity for the whole window.<br>NOTE: This only stays enabled if your pc supports this!",
position = 1
position = 0
)
default boolean enableOpacity()
{
@@ -64,7 +53,7 @@ public interface RuneLitePlusConfig extends Config
keyName = "opacityPercentage",
name = "Opacity percentage",
description = "Changes the opacity of the window if opacity is enabled",
position = 2
position = 1
)
default int opacityPercentage()
{
@@ -75,21 +64,10 @@ public interface RuneLitePlusConfig extends Config
keyName = "keyboardPin",
name = "Keyboard bank pin",
description = "Enables you to type your bank pin",
position = 3
position = 2
)
default boolean keyboardPin()
{
return false;
}
@ConfigItem(
keyName = "logOpt",
name = "Send logs",
description = "Send logs to help us analyze errors",
position = 4
)
default boolean logOpt()
{
return false;
}
}

View File

@@ -158,28 +158,14 @@ public class RuneLitePlusPlugin extends Plugin
@Override
protected void startUp() throws Exception
{
entered = -1;
enterIdx = 0;
if (getConfig(configManager).customPresence())
{
ClientUI.currentPresenceName = ("RuneLitePlus");
ClientUI.frame.setTitle(ClientUI.currentPresenceName);
}
if (config.customPresence())
{
RuneLiteProperties.discordAppID = rlPlusDiscordApp;
discordService.close();
discordService.init();
}
else
{
RuneLiteProperties.discordAppID = rlDiscordApp;
discordService.close();
discordService.init();
}
entered = -1;
enterIdx = 0;
}
@Subscribe
@@ -190,33 +176,7 @@ public class RuneLitePlusPlugin extends Plugin
return;
}
if (event.getKey().equals("customPresence"))
{
if (config.customPresence())
{
ClientUI.currentPresenceName = ("RuneLitePlus");
ClientUI.frame.setTitle(ClientUI.currentPresenceName);
}
else
{
ClientUI.currentPresenceName = ("RuneLite");
ClientUI.frame.setTitle(ClientUI.currentPresenceName);
}
if (config.customPresence())
{
RuneLiteProperties.discordAppID = rlPlusDiscordApp;
discordService.close();
discordService.init();
}
else
{
RuneLiteProperties.discordAppID = rlDiscordApp;
discordService.close();
discordService.init();
}
}
else if (!config.keyboardPin())
if (!config.keyboardPin())
{
entered = -1;
enterIdx = 0;

View File

@@ -1,111 +0,0 @@
/*
* Copyright (c) 2018, https://runelitepl.us
* 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.test;
import api.Client;
import api.events.ChatMessage;
import api.events.ClientTick;
import api.events.GameTick;
import api.events.MenuOpened;
import api.events.VarbitChanged;
import com.google.common.eventbus.Subscribe;
import com.google.inject.Binder;
import javax.inject.Inject;
import javax.inject.Singleton;
import com.google.inject.Provides;
import lombok.extern.slf4j.Slf4j;
import net.runelite.client.config.ConfigManager;
import net.runelite.client.plugins.Plugin;
import net.runelite.client.plugins.PluginDescriptor;
import net.runelite.client.ui.overlay.OverlayManager;
/**
* Authors gazivodag longstreet
*/
@PluginDescriptor(
name = "Test",
description = "Testing plugin for building functionality",
tags = {}
)
@Singleton
@Slf4j
public class Test extends Plugin
{
@Provides
TestConfig getConfig(ConfigManager configManager)
{
return configManager.getConfig(TestConfig.class);
}
@Inject
private TestOverlay testOverlay;
@Inject
private TestConfig config;
@Inject
private Client client;
@Inject
private OverlayManager overlayManager;
@Override
public void configure(Binder binder)
{
}
@Override
protected void startUp() throws Exception
{
overlayManager.add(testOverlay);
System.out.println("Test Plugin started");
}
@Override
protected void shutDown() throws Exception
{
}
@Subscribe
public void onMenuOpened(MenuOpened event)
{
System.out.println("[Test Plugin] Menu Opened");
}
@Subscribe
public void onChatMessage(ChatMessage chatMessage)
{
System.out.println("[Test Plugin] Chat Message");
}
@Subscribe
public void onVarbitChanged(VarbitChanged event)
{
System.out.println("[Test Plugin] Varbit Changed");
}
}

View File

@@ -1,47 +0,0 @@
/*
* Copyright (c) 2018, Cas <https://github.com/casvandongen>
* 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.test;
import net.runelite.client.config.Config;
import net.runelite.client.config.ConfigGroup;
import net.runelite.client.config.ConfigItem;
import java.awt.*;
@ConfigGroup("test")
public interface TestConfig extends Config
{
@ConfigItem(
keyName = "Testing 1",
name = "Test option",
description = "Enable/disable nothing",
position = 1
)
default boolean tested()
{
return true;
}
}

View File

@@ -1,63 +0,0 @@
/*
* Copyright (c) 2018, Adam <Adam@sigterm.info>
* Copyright (c) 2018, Cas <https://github.com/casvandongen>
* 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.test;
import api.Client;
import net.runelite.client.ui.overlay.Overlay;
import net.runelite.client.ui.overlay.OverlayLayer;
import net.runelite.client.ui.overlay.OverlayPosition;
import javax.inject.Inject;
import java.awt.*;
class TestOverlay extends Overlay
{
private static final Color SHORTCUT_HIGH_LEVEL_COLOR = Color.ORANGE;
private final Client client;
private final Test plugin;
private final TestConfig config;
@Inject
private TestOverlay(Client client, Test plugin, TestConfig config)
{
super(plugin);
setPosition(OverlayPosition.DYNAMIC);
setLayer(OverlayLayer.ABOVE_SCENE);
this.client = client;
this.plugin = plugin;
this.config = config;
}
@Override
public Dimension render(Graphics2D graphics)
{
System.out.println("Rendered Test");
graphics.setColor(Color.RED);
graphics.drawString("Hello World", 20, 20);
return null;
}
}

View File

@@ -117,7 +117,7 @@ public class ClientUI
private static final int CLIENT_WELL_HIDDEN_MARGIN_TOP = 10;
public static boolean allowInput = false;
public static String currentPresenceName = "RuneLite";
public static final BufferedImage ICON = ImageUtil.getResourceStreamFromClass(ClientUI.class, "/runelite.png");
public static final BufferedImage ICON = ImageUtil.getResourceStreamFromClass(ClientUI.class, "/runeliteplus.png");
@Getter
private TrayIcon trayIcon;