From 89f0b59945e7d373621259e0f97c515929d758d5 Mon Sep 17 00:00:00 2001 From: Tyler Hardy Date: Thu, 9 Nov 2017 21:04:40 -0500 Subject: [PATCH] runelite-client: add runelite config with tooltip config --- .../java/net/runelite/client/RuneLite.java | 13 +++++- .../client/config/RuneliteConfig.java | 43 +++++++++++++++++++ 2 files changed, 54 insertions(+), 2 deletions(-) create mode 100644 runelite-client/src/main/java/net/runelite/client/config/RuneliteConfig.java diff --git a/runelite-client/src/main/java/net/runelite/client/RuneLite.java b/runelite-client/src/main/java/net/runelite/client/RuneLite.java index d5cc92b3f4..1150027870 100644 --- a/runelite-client/src/main/java/net/runelite/client/RuneLite.java +++ b/runelite-client/src/main/java/net/runelite/client/RuneLite.java @@ -55,6 +55,7 @@ import net.runelite.api.Client; import net.runelite.api.Query; import net.runelite.client.account.AccountSession; import net.runelite.client.config.ConfigManager; +import net.runelite.client.config.RuneliteConfig; import net.runelite.client.events.SessionClose; import net.runelite.client.events.SessionOpen; import net.runelite.client.game.ItemManager; @@ -86,6 +87,7 @@ public class RuneLite private final RuneliteProperties properties = new RuneliteProperties(); private ClientUI gui; + private RuneliteConfig config; private PluginManager pluginManager; private final MenuManager menuManager = new MenuManager(this); private OverlayRenderer renderer; @@ -152,8 +154,12 @@ public class RuneLite configManager.load(); + config = configManager.getConfig(RuneliteConfig.class); + eventBus.register(menuManager); + renderer = new OverlayRenderer(); + // Load the plugins, but does not start them yet. // This will initialize configuration pluginManager = new PluginManager(this); @@ -166,8 +172,6 @@ public class RuneLite // Start plugins pluginManager.start(); - renderer = new OverlayRenderer(); - loadSession(); } @@ -425,6 +429,11 @@ public class RuneLite return configManager; } + public RuneliteConfig getConfig() + { + return config; + } + public ItemManager getItemManager() { return itemManager; diff --git a/runelite-client/src/main/java/net/runelite/client/config/RuneliteConfig.java b/runelite-client/src/main/java/net/runelite/client/config/RuneliteConfig.java new file mode 100644 index 0000000000..df75212c40 --- /dev/null +++ b/runelite-client/src/main/java/net/runelite/client/config/RuneliteConfig.java @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2017, Tyler + * 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.config; + +@ConfigGroup( + keyName = "runelite", + name = "Runelite", + description = "Configuration for Runelite client options" +) +public interface RuneliteConfig +{ + @ConfigItem( + keyName = "tooltipLeft", + name = "Tooltip left of mouse?", + description = "Places the tooltip on the left side of the mouse" + ) + default boolean tooltipLeft() + { + return false; + } +}