runelite-client: use british english spelling of jewellery

Also rename plugin to be JewelleryCountPlugin
This commit is contained in:
honeyhoney
2017-11-13 18:40:29 -05:00
committed by Adam
parent fda56fb235
commit 8dbe5777ff
5 changed files with 36 additions and 43 deletions

View File

@@ -22,15 +22,15 @@
* (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.jewelrycount;
package net.runelite.client.plugins.jewellerycount;
import java.util.HashMap;
import java.util.Map;
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),
GLORY2(GLORY, AMULET_OF_GLORY2, 2),
@@ -110,28 +110,28 @@ public enum JewelryCharges
TCRYSTAL2(TCRYSTAL, TELEPORT_CRYSTAL_2, 2),
TCRYSTAL1(TCRYSTAL, TELEPORT_CRYSTAL_1, 1);
private final JewelryType type;
private final JewelleryType type;
private final int id;
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
{
for (JewelryCharges s : values())
for (JewelleryCharges s : values())
{
ITEM_ID.put(s.getId(), s);
}
}
JewelryCharges(JewelryType type, int ID, int charges)
JewelleryCharges(JewelleryType type, int ID, int charges)
{
this.type = type;
this.id = ID;
this.charges = charges;
}
public JewelryType getType()
public JewelleryType getType()
{
return type;
}
@@ -146,7 +146,7 @@ public enum JewelryCharges
return charges;
}
public static JewelryCharges getCharges(int id)
public static JewelleryCharges getCharges(int id)
{
return ITEM_ID.get(id);
}

View File

@@ -22,23 +22,23 @@
* (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.jewelrycount;
package net.runelite.client.plugins.jewellerycount;
import net.runelite.client.config.Config;
import net.runelite.client.config.ConfigGroup;
import net.runelite.client.config.ConfigItem;
@ConfigGroup(
keyName = "jewelrycount",
name = "Jewelry Count",
description = "Configuration for the jewelry count plugin"
keyName = "jewellerycount",
name = "Jewellery Count",
description = "Configuration for the jewellery count plugin"
)
public interface JewelryCountConfig extends Config
public interface JewelleryCountConfig extends Config
{
@ConfigItem(
keyName = "enabled",
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()
{

View File

@@ -22,7 +22,7 @@
* (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.jewelrycount;
package net.runelite.client.plugins.jewellerycount;
import java.awt.Color;
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.OverlayPosition;
class JewelryCountOverlay extends Overlay
class JewelleryCountOverlay extends Overlay
{
private final RuneLite runelite;
private final JewelryCountConfig config;
private final JewelleryCountConfig config;
private final Font font = FontManager.getRunescapeSmallFont().deriveFont(Font.PLAIN, 16);
@Inject
JewelryCountOverlay(RuneLite runelite, JewelryCountConfig config)
JewelleryCountOverlay(RuneLite runelite, JewelleryCountConfig config)
{
super(OverlayPosition.DYNAMIC);
this.runelite = runelite;
@@ -74,9 +74,9 @@ class JewelryCountOverlay extends Overlay
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)
{
@@ -90,7 +90,7 @@ class JewelryCountOverlay extends Overlay
return null;
}
private Collection<WidgetItem> getJewelryWidgetItems()
private Collection<WidgetItem> getJewelleryWidgetItems()
{
Query inventoryQuery = new InventoryItemQuery();
WidgetItem[] inventoryWidgetItems = runelite.runQuery(inventoryQuery);
@@ -102,10 +102,10 @@ class JewelryCountOverlay extends Overlay
);
WidgetItem[] equipmentWidgetItems = runelite.runQuery(equipmentQuery);
Collection<WidgetItem> jewelry = new ArrayList<>();
jewelry.addAll(Arrays.asList(inventoryWidgetItems));
jewelry.addAll(Arrays.asList(equipmentWidgetItems));
return jewelry;
Collection<WidgetItem> jewellery = new ArrayList<>();
jewellery.addAll(Arrays.asList(inventoryWidgetItems));
jewellery.addAll(Arrays.asList(equipmentWidgetItems));
return jewellery;
}
private void renderWidgetText(Graphics2D graphics, Rectangle bounds, int charges, Color color)

View File

@@ -22,7 +22,7 @@
* (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.jewelrycount;
package net.runelite.client.plugins.jewellerycount;
import com.google.inject.Binder;
import com.google.inject.Provides;
@@ -30,34 +30,27 @@ import javax.inject.Inject;
import net.runelite.client.config.ConfigManager;
import net.runelite.client.plugins.Plugin;
import net.runelite.client.plugins.PluginDescriptor;
import net.runelite.client.ui.overlay.Overlay;
@PluginDescriptor(
name = "Jewelry plugin"
name = "Jewellery count plugin"
)
public class JewelryCount extends Plugin
public class JewelleryCountPlugin extends Plugin
{
@Inject
JewelryCountConfig config;
JewelleryCountConfig config;
@Inject
JewelryCountOverlay overlay;
JewelleryCountOverlay overlay;
@Override
public void configure(Binder binder)
{
binder.bind(JewelryCountOverlay.class);
binder.bind(JewelleryCountOverlay.class);
}
@Provides
JewelryCountConfig getConfig(ConfigManager configManager)
JewelleryCountConfig getConfig(ConfigManager configManager)
{
return configManager.getConfig(JewelryCountConfig.class);
}
@Override
public Overlay getOverlay()
{
return overlay;
return configManager.getConfig(JewelleryCountConfig.class);
}
}

View File

@@ -22,9 +22,9 @@
* (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.jewelrycount;
package net.runelite.client.plugins.jewellerycount;
public enum JewelryType
public enum JewelleryType
{
GLORY,
ROD,