runelite-client: use british english spelling of jewellery
Also rename plugin to be JewelleryCountPlugin
This commit is contained in:
@@ -22,15 +22,15 @@
|
|||||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
package net.runelite.client.plugins.jewelrycount;
|
package net.runelite.client.plugins.jewellerycount;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import static net.runelite.api.ItemID.*;
|
import static net.runelite.api.ItemID.*;
|
||||||
import static net.runelite.client.plugins.jewelrycount.JewelryType.*;
|
import static net.runelite.client.plugins.jewellerycount.JewelleryType.*;
|
||||||
|
|
||||||
public enum JewelryCharges
|
public enum JewelleryCharges
|
||||||
{
|
{
|
||||||
GLORY1(GLORY, AMULET_OF_GLORY1, 1),
|
GLORY1(GLORY, AMULET_OF_GLORY1, 1),
|
||||||
GLORY2(GLORY, AMULET_OF_GLORY2, 2),
|
GLORY2(GLORY, AMULET_OF_GLORY2, 2),
|
||||||
@@ -110,28 +110,28 @@ public enum JewelryCharges
|
|||||||
TCRYSTAL2(TCRYSTAL, TELEPORT_CRYSTAL_2, 2),
|
TCRYSTAL2(TCRYSTAL, TELEPORT_CRYSTAL_2, 2),
|
||||||
TCRYSTAL1(TCRYSTAL, TELEPORT_CRYSTAL_1, 1);
|
TCRYSTAL1(TCRYSTAL, TELEPORT_CRYSTAL_1, 1);
|
||||||
|
|
||||||
private final JewelryType type;
|
private final JewelleryType type;
|
||||||
private final int id;
|
private final int id;
|
||||||
private final int charges;
|
private final int charges;
|
||||||
|
|
||||||
private static final Map<Integer, JewelryCharges> ITEM_ID = new HashMap<>();
|
private static final Map<Integer, JewelleryCharges> ITEM_ID = new HashMap<>();
|
||||||
|
|
||||||
static
|
static
|
||||||
{
|
{
|
||||||
for (JewelryCharges s : values())
|
for (JewelleryCharges s : values())
|
||||||
{
|
{
|
||||||
ITEM_ID.put(s.getId(), s);
|
ITEM_ID.put(s.getId(), s);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
JewelryCharges(JewelryType type, int ID, int charges)
|
JewelleryCharges(JewelleryType type, int ID, int charges)
|
||||||
{
|
{
|
||||||
this.type = type;
|
this.type = type;
|
||||||
this.id = ID;
|
this.id = ID;
|
||||||
this.charges = charges;
|
this.charges = charges;
|
||||||
}
|
}
|
||||||
|
|
||||||
public JewelryType getType()
|
public JewelleryType getType()
|
||||||
{
|
{
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
@@ -146,7 +146,7 @@ public enum JewelryCharges
|
|||||||
return charges;
|
return charges;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static JewelryCharges getCharges(int id)
|
public static JewelleryCharges getCharges(int id)
|
||||||
{
|
{
|
||||||
return ITEM_ID.get(id);
|
return ITEM_ID.get(id);
|
||||||
}
|
}
|
||||||
@@ -22,23 +22,23 @@
|
|||||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
package net.runelite.client.plugins.jewelrycount;
|
package net.runelite.client.plugins.jewellerycount;
|
||||||
|
|
||||||
import net.runelite.client.config.Config;
|
import net.runelite.client.config.Config;
|
||||||
import net.runelite.client.config.ConfigGroup;
|
import net.runelite.client.config.ConfigGroup;
|
||||||
import net.runelite.client.config.ConfigItem;
|
import net.runelite.client.config.ConfigItem;
|
||||||
|
|
||||||
@ConfigGroup(
|
@ConfigGroup(
|
||||||
keyName = "jewelrycount",
|
keyName = "jewellerycount",
|
||||||
name = "Jewelry Count",
|
name = "Jewellery Count",
|
||||||
description = "Configuration for the jewelry count plugin"
|
description = "Configuration for the jewellery count plugin"
|
||||||
)
|
)
|
||||||
public interface JewelryCountConfig extends Config
|
public interface JewelleryCountConfig extends Config
|
||||||
{
|
{
|
||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
keyName = "enabled",
|
keyName = "enabled",
|
||||||
name = "Enable",
|
name = "Enable",
|
||||||
description = "Configures whether or not the jewelry count plugin is displayed"
|
description = "Configures whether or not the jewellery count plugin is displayed"
|
||||||
)
|
)
|
||||||
default boolean enabled()
|
default boolean enabled()
|
||||||
{
|
{
|
||||||
@@ -22,7 +22,7 @@
|
|||||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
package net.runelite.client.plugins.jewelrycount;
|
package net.runelite.client.plugins.jewellerycount;
|
||||||
|
|
||||||
import java.awt.Color;
|
import java.awt.Color;
|
||||||
import java.awt.Dimension;
|
import java.awt.Dimension;
|
||||||
@@ -46,14 +46,14 @@ import net.runelite.client.ui.FontManager;
|
|||||||
import net.runelite.client.ui.overlay.Overlay;
|
import net.runelite.client.ui.overlay.Overlay;
|
||||||
import net.runelite.client.ui.overlay.OverlayPosition;
|
import net.runelite.client.ui.overlay.OverlayPosition;
|
||||||
|
|
||||||
class JewelryCountOverlay extends Overlay
|
class JewelleryCountOverlay extends Overlay
|
||||||
{
|
{
|
||||||
private final RuneLite runelite;
|
private final RuneLite runelite;
|
||||||
private final JewelryCountConfig config;
|
private final JewelleryCountConfig config;
|
||||||
private final Font font = FontManager.getRunescapeSmallFont().deriveFont(Font.PLAIN, 16);
|
private final Font font = FontManager.getRunescapeSmallFont().deriveFont(Font.PLAIN, 16);
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
JewelryCountOverlay(RuneLite runelite, JewelryCountConfig config)
|
JewelleryCountOverlay(RuneLite runelite, JewelleryCountConfig config)
|
||||||
{
|
{
|
||||||
super(OverlayPosition.DYNAMIC);
|
super(OverlayPosition.DYNAMIC);
|
||||||
this.runelite = runelite;
|
this.runelite = runelite;
|
||||||
@@ -74,9 +74,9 @@ class JewelryCountOverlay extends Overlay
|
|||||||
|
|
||||||
graphics.setFont(font);
|
graphics.setFont(font);
|
||||||
|
|
||||||
for (WidgetItem item : getJewelryWidgetItems())
|
for (WidgetItem item : getJewelleryWidgetItems())
|
||||||
{
|
{
|
||||||
JewelryCharges charges = JewelryCharges.getCharges(item.getId());
|
JewelleryCharges charges = JewelleryCharges.getCharges(item.getId());
|
||||||
|
|
||||||
if (charges == null)
|
if (charges == null)
|
||||||
{
|
{
|
||||||
@@ -90,7 +90,7 @@ class JewelryCountOverlay extends Overlay
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Collection<WidgetItem> getJewelryWidgetItems()
|
private Collection<WidgetItem> getJewelleryWidgetItems()
|
||||||
{
|
{
|
||||||
Query inventoryQuery = new InventoryItemQuery();
|
Query inventoryQuery = new InventoryItemQuery();
|
||||||
WidgetItem[] inventoryWidgetItems = runelite.runQuery(inventoryQuery);
|
WidgetItem[] inventoryWidgetItems = runelite.runQuery(inventoryQuery);
|
||||||
@@ -102,10 +102,10 @@ class JewelryCountOverlay extends Overlay
|
|||||||
);
|
);
|
||||||
WidgetItem[] equipmentWidgetItems = runelite.runQuery(equipmentQuery);
|
WidgetItem[] equipmentWidgetItems = runelite.runQuery(equipmentQuery);
|
||||||
|
|
||||||
Collection<WidgetItem> jewelry = new ArrayList<>();
|
Collection<WidgetItem> jewellery = new ArrayList<>();
|
||||||
jewelry.addAll(Arrays.asList(inventoryWidgetItems));
|
jewellery.addAll(Arrays.asList(inventoryWidgetItems));
|
||||||
jewelry.addAll(Arrays.asList(equipmentWidgetItems));
|
jewellery.addAll(Arrays.asList(equipmentWidgetItems));
|
||||||
return jewelry;
|
return jewellery;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void renderWidgetText(Graphics2D graphics, Rectangle bounds, int charges, Color color)
|
private void renderWidgetText(Graphics2D graphics, Rectangle bounds, int charges, Color color)
|
||||||
@@ -22,7 +22,7 @@
|
|||||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
package net.runelite.client.plugins.jewelrycount;
|
package net.runelite.client.plugins.jewellerycount;
|
||||||
|
|
||||||
import com.google.inject.Binder;
|
import com.google.inject.Binder;
|
||||||
import com.google.inject.Provides;
|
import com.google.inject.Provides;
|
||||||
@@ -30,34 +30,27 @@ import javax.inject.Inject;
|
|||||||
import net.runelite.client.config.ConfigManager;
|
import net.runelite.client.config.ConfigManager;
|
||||||
import net.runelite.client.plugins.Plugin;
|
import net.runelite.client.plugins.Plugin;
|
||||||
import net.runelite.client.plugins.PluginDescriptor;
|
import net.runelite.client.plugins.PluginDescriptor;
|
||||||
import net.runelite.client.ui.overlay.Overlay;
|
|
||||||
|
|
||||||
@PluginDescriptor(
|
@PluginDescriptor(
|
||||||
name = "Jewelry plugin"
|
name = "Jewellery count plugin"
|
||||||
)
|
)
|
||||||
public class JewelryCount extends Plugin
|
public class JewelleryCountPlugin extends Plugin
|
||||||
{
|
{
|
||||||
@Inject
|
@Inject
|
||||||
JewelryCountConfig config;
|
JewelleryCountConfig config;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
JewelryCountOverlay overlay;
|
JewelleryCountOverlay overlay;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void configure(Binder binder)
|
public void configure(Binder binder)
|
||||||
{
|
{
|
||||||
binder.bind(JewelryCountOverlay.class);
|
binder.bind(JewelleryCountOverlay.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
JewelryCountConfig getConfig(ConfigManager configManager)
|
JewelleryCountConfig getConfig(ConfigManager configManager)
|
||||||
{
|
{
|
||||||
return configManager.getConfig(JewelryCountConfig.class);
|
return configManager.getConfig(JewelleryCountConfig.class);
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Overlay getOverlay()
|
|
||||||
{
|
|
||||||
return overlay;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -22,9 +22,9 @@
|
|||||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
package net.runelite.client.plugins.jewelrycount;
|
package net.runelite.client.plugins.jewellerycount;
|
||||||
|
|
||||||
public enum JewelryType
|
public enum JewelleryType
|
||||||
{
|
{
|
||||||
GLORY,
|
GLORY,
|
||||||
ROD,
|
ROD,
|
||||||
Reference in New Issue
Block a user