Hide Prayers update
optional toggles: rapid heal rapid restore steel skin incredible reflex redemption preserve
This commit is contained in:
@@ -1,35 +1,118 @@
|
|||||||
package net.runelite.client.plugins.hideprayers;
|
/*
|
||||||
|
* Copyright (c) 2018, https://runelitepl.us
|
||||||
import net.runelite.client.config.Config;
|
* All rights reserved.
|
||||||
import net.runelite.client.config.ConfigGroup;
|
*
|
||||||
import net.runelite.client.config.ConfigItem;
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
@ConfigGroup("hideprayers")
|
*
|
||||||
public interface HidePrayersConfig extends Config
|
* 1. Redistributions of source code must retain the above copyright notice, this
|
||||||
{
|
* list of conditions and the following disclaimer.
|
||||||
@ConfigItem(
|
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||||
position = 0,
|
* this list of conditions and the following disclaimer in the documentation
|
||||||
keyName = "pk prayers",
|
* and/or other materials provided with the distribution.
|
||||||
name = "Hides none pk prayers",
|
*
|
||||||
description = "Hides widget icons."
|
* 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
|
||||||
default boolean showPrayers() { return false; }
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
|
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
||||||
@ConfigItem(
|
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
position = 1,
|
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
keyName = "eagle/mystic",
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||||
name = "Shows eagle and mystic prayers",
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
description = "Hides widget icons."
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
)
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
default boolean showEagleMystic() { return false; }
|
*/
|
||||||
|
|
||||||
@ConfigItem(
|
package net.runelite.client.plugins.hideprayers;
|
||||||
position = 1,
|
|
||||||
keyName = "ultstr",
|
import net.runelite.client.config.Config;
|
||||||
name = "Shows ultimate strength",
|
import net.runelite.client.config.ConfigGroup;
|
||||||
description = "Hides widget icons."
|
import net.runelite.client.config.ConfigItem;
|
||||||
)
|
|
||||||
default boolean showUltStrength() { return false; }
|
@ConfigGroup("hideprayers")
|
||||||
|
public interface HidePrayersConfig extends Config
|
||||||
}
|
{
|
||||||
|
@ConfigItem
|
||||||
|
(
|
||||||
|
position = 0,
|
||||||
|
keyName = "pk prayers",
|
||||||
|
name = "Hides none pk prayers",
|
||||||
|
description = "Hides widget icons."
|
||||||
|
)
|
||||||
|
default boolean showPrayers()
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ConfigItem
|
||||||
|
(
|
||||||
|
position = 1,
|
||||||
|
keyName = "eagle/mystic",
|
||||||
|
name = "Shows Eagle and Mystic Prayers",
|
||||||
|
description = "Hides widget icons."
|
||||||
|
)
|
||||||
|
default boolean showEagleMystic()
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ConfigItem
|
||||||
|
(
|
||||||
|
position = 2,
|
||||||
|
keyName = "ultstr",
|
||||||
|
name = "Shows Ultimate Strength/Incredible Reflex/Steel Skin",
|
||||||
|
description = "Hides widget icons."
|
||||||
|
)
|
||||||
|
default boolean showUltStrength()
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ConfigItem
|
||||||
|
(
|
||||||
|
position = 3,
|
||||||
|
keyName = "preserve",
|
||||||
|
name = "Shows Preserve",
|
||||||
|
description = "unides widget icons."
|
||||||
|
)
|
||||||
|
default boolean showPreserve()
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ConfigItem
|
||||||
|
(
|
||||||
|
position = 4,
|
||||||
|
keyName = "redemption",
|
||||||
|
name = "Shows Redemption",
|
||||||
|
description = "unides widget icons."
|
||||||
|
)
|
||||||
|
default boolean showRedemption()
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ConfigItem
|
||||||
|
(
|
||||||
|
position = 5,
|
||||||
|
keyName = "rapidheal",
|
||||||
|
name = "Shows Rapid Heal",
|
||||||
|
description = "unides widget icons."
|
||||||
|
)
|
||||||
|
default boolean showRapidHeal()
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ConfigItem
|
||||||
|
(
|
||||||
|
position = 6,
|
||||||
|
keyName = "rapidRestore",
|
||||||
|
name = "Shows Rapid restore",
|
||||||
|
description = "unides widget icons."
|
||||||
|
)
|
||||||
|
default boolean showRapidRestore()
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,171 +1,297 @@
|
|||||||
package net.runelite.client.plugins.hideprayers;
|
/*
|
||||||
|
* Copyright (c) 2018, https://runelitepl.us
|
||||||
import com.google.common.collect.ImmutableList;
|
* All rights reserved.
|
||||||
import net.runelite.client.eventbus.Subscribe;
|
*
|
||||||
import com.google.inject.Provides;
|
* Redistribution and use in source and binary forms, with or without
|
||||||
import net.runelite.api.*;
|
* modification, are permitted provided that the following conditions are met:
|
||||||
import net.runelite.api.events.ConfigChanged;
|
*
|
||||||
import net.runelite.api.events.GameStateChanged;
|
* 1. Redistributions of source code must retain the above copyright notice, this
|
||||||
import net.runelite.api.events.WidgetLoaded;
|
* list of conditions and the following disclaimer.
|
||||||
import net.runelite.api.widgets.Widget;
|
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||||
import net.runelite.api.widgets.WidgetID;
|
* this list of conditions and the following disclaimer in the documentation
|
||||||
import net.runelite.api.widgets.WidgetInfo;
|
* and/or other materials provided with the distribution.
|
||||||
import net.runelite.client.config.ConfigManager;
|
*
|
||||||
import net.runelite.client.plugins.Plugin;
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
import net.runelite.client.plugins.PluginDescriptor;
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
import net.runelite.client.plugins.PluginType;
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
|
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
||||||
import javax.inject.Inject;
|
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
import java.util.List;
|
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
import java.util.Objects;
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||||
import java.util.stream.Collectors;
|
* 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
|
||||||
@PluginDescriptor(
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
name = "Hide Prayers",
|
*/
|
||||||
description = "Hides specific Prayers in the Prayer tab.",
|
|
||||||
type = PluginType.UTILITY
|
package net.runelite.client.plugins.hideprayers;
|
||||||
)
|
|
||||||
public class HidePrayersPlugin extends Plugin {
|
import com.google.common.collect.ImmutableList;
|
||||||
private static final int PRAYER_COUNT = Prayer.values().length;
|
import net.runelite.client.eventbus.Subscribe;
|
||||||
|
import com.google.inject.Provides;
|
||||||
private static final List<WidgetInfo> PRAYER_WIDGET_INFO_LIST = ImmutableList.of(WidgetInfo.PRAYER_THICK_SKIN,
|
import net.runelite.api.*;
|
||||||
WidgetInfo.PRAYER_BURST_OF_STRENGTH, WidgetInfo.PRAYER_CLARITY_OF_THOUGHT, WidgetInfo.PRAYER_SHARP_EYE,
|
import net.runelite.api.events.ConfigChanged;
|
||||||
WidgetInfo.PRAYER_MYSTIC_WILL, WidgetInfo.PRAYER_ROCK_SKIN, WidgetInfo.PRAYER_SUPERHUMAN_STRENGTH,
|
import net.runelite.api.events.GameStateChanged;
|
||||||
WidgetInfo.PRAYER_IMPROVED_REFLEXES, WidgetInfo.PRAYER_RAPID_RESTORE, WidgetInfo.PRAYER_RAPID_HEAL,
|
import net.runelite.api.events.WidgetLoaded;
|
||||||
WidgetInfo.PRAYER_PROTECT_ITEM, WidgetInfo.PRAYER_HAWK_EYE, WidgetInfo.PRAYER_MYSTIC_LORE,
|
import net.runelite.api.widgets.Widget;
|
||||||
WidgetInfo.PRAYER_STEEL_SKIN, WidgetInfo.PRAYER_ULTIMATE_STRENGTH, WidgetInfo.PRAYER_INCREDIBLE_REFLEXES,
|
import net.runelite.api.widgets.WidgetID;
|
||||||
WidgetInfo.PRAYER_PROTECT_FROM_MAGIC, WidgetInfo.PRAYER_PROTECT_FROM_MISSILES,
|
import net.runelite.api.widgets.WidgetInfo;
|
||||||
WidgetInfo.PRAYER_PROTECT_FROM_MELEE, WidgetInfo.PRAYER_EAGLE_EYE, WidgetInfo.PRAYER_MYSTIC_MIGHT,
|
import net.runelite.client.config.ConfigManager;
|
||||||
WidgetInfo.PRAYER_RETRIBUTION, WidgetInfo.PRAYER_REDEMPTION, WidgetInfo.PRAYER_SMITE,
|
import net.runelite.client.plugins.Plugin;
|
||||||
WidgetInfo.PRAYER_PRESERVE, WidgetInfo.PRAYER_CHIVALRY, WidgetInfo.PRAYER_PIETY, WidgetInfo.PRAYER_RIGOUR,
|
import net.runelite.client.plugins.PluginDescriptor;
|
||||||
WidgetInfo.PRAYER_AUGURY);
|
import net.runelite.client.plugins.PluginType;
|
||||||
|
import javax.inject.Inject;
|
||||||
@Inject
|
import java.util.List;
|
||||||
private Client client;
|
import java.util.Objects;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
@Inject
|
|
||||||
private HidePrayersConfig config;
|
@PluginDescriptor
|
||||||
|
(
|
||||||
@Provides
|
name = "Hide Prayers",
|
||||||
HidePrayersConfig provideConfig(ConfigManager configManager) {
|
description = "Hides specific Prayers in the Prayer tab.",
|
||||||
return configManager.getConfig(HidePrayersConfig.class);
|
type = PluginType.UTILITY
|
||||||
}
|
)
|
||||||
|
public class HidePrayersPlugin extends Plugin
|
||||||
@Override
|
{
|
||||||
protected void startUp() throws Exception {
|
private static final int PRAYER_COUNT = Prayer.values().length;
|
||||||
hidePrayers();
|
|
||||||
}
|
private static final List<WidgetInfo> PRAYER_WIDGET_INFO_LIST = ImmutableList.of(
|
||||||
|
WidgetInfo.PRAYER_THICK_SKIN, //0
|
||||||
@Override
|
WidgetInfo.PRAYER_BURST_OF_STRENGTH, //1
|
||||||
protected void shutDown() throws Exception {
|
WidgetInfo.PRAYER_CLARITY_OF_THOUGHT, //2
|
||||||
restorePrayers();
|
WidgetInfo.PRAYER_SHARP_EYE, //3
|
||||||
}
|
WidgetInfo.PRAYER_MYSTIC_WILL, //4
|
||||||
|
WidgetInfo.PRAYER_ROCK_SKIN, //5
|
||||||
@Subscribe
|
WidgetInfo.PRAYER_SUPERHUMAN_STRENGTH, //6
|
||||||
public void onGameStateChanged(GameStateChanged event) {
|
WidgetInfo.PRAYER_IMPROVED_REFLEXES, //7
|
||||||
if (event.getGameState() == GameState.LOGGED_IN) {
|
WidgetInfo.PRAYER_RAPID_RESTORE, //8
|
||||||
hidePrayers();
|
WidgetInfo.PRAYER_RAPID_HEAL, //9
|
||||||
}
|
WidgetInfo.PRAYER_PROTECT_ITEM, //10
|
||||||
}
|
WidgetInfo.PRAYER_HAWK_EYE, //11
|
||||||
|
WidgetInfo.PRAYER_MYSTIC_LORE, //12
|
||||||
@Subscribe
|
WidgetInfo.PRAYER_STEEL_SKIN, //13
|
||||||
public void onConfigChanged(ConfigChanged event) {
|
WidgetInfo.PRAYER_ULTIMATE_STRENGTH, //14
|
||||||
if (event.getGroup().equals("hideprayers")) {
|
WidgetInfo.PRAYER_INCREDIBLE_REFLEXES, //15
|
||||||
hidePrayers();
|
WidgetInfo.PRAYER_PROTECT_FROM_MAGIC, //16
|
||||||
}
|
WidgetInfo.PRAYER_PROTECT_FROM_MISSILES, //17
|
||||||
}
|
WidgetInfo.PRAYER_PROTECT_FROM_MELEE, //18
|
||||||
|
WidgetInfo.PRAYER_EAGLE_EYE, //19
|
||||||
@Subscribe
|
WidgetInfo.PRAYER_MYSTIC_MIGHT, //20
|
||||||
public void onWidgetLoaded(WidgetLoaded event) {
|
WidgetInfo.PRAYER_RETRIBUTION, //21
|
||||||
if (event.getGroupId() == WidgetID.PRAYER_GROUP_ID || event.getGroupId() == WidgetID.QUICK_PRAYERS_GROUP_ID) {
|
WidgetInfo.PRAYER_REDEMPTION, //22
|
||||||
hidePrayers();
|
WidgetInfo.PRAYER_SMITE, //23
|
||||||
}
|
WidgetInfo.PRAYER_PRESERVE, //24
|
||||||
}
|
WidgetInfo.PRAYER_CHIVALRY, //25
|
||||||
|
WidgetInfo.PRAYER_PIETY, //26
|
||||||
private PrayerTabState getPrayerTabState() {
|
WidgetInfo.PRAYER_RIGOUR, //27
|
||||||
HashTable<WidgetNode> componentTable = client.getComponentTable();
|
WidgetInfo.PRAYER_AUGURY); //28
|
||||||
for (WidgetNode widgetNode : componentTable.getNodes()) {
|
|
||||||
if (widgetNode.getId() == WidgetID.PRAYER_GROUP_ID) {
|
@Inject
|
||||||
return PrayerTabState.PRAYERS;
|
private Client client;
|
||||||
} else if (widgetNode.getId() == WidgetID.QUICK_PRAYERS_GROUP_ID) {
|
|
||||||
return PrayerTabState.QUICK_PRAYERS;
|
@Inject
|
||||||
}
|
private HidePrayersConfig config;
|
||||||
}
|
|
||||||
return PrayerTabState.NONE;
|
@Provides
|
||||||
}
|
HidePrayersConfig provideConfig(ConfigManager configManager)
|
||||||
|
{
|
||||||
private void restorePrayers() {
|
return configManager.getConfig(HidePrayersConfig.class);
|
||||||
if (client.getGameState() != GameState.LOGGED_IN)
|
}
|
||||||
return;
|
|
||||||
|
@Override
|
||||||
PrayerTabState prayerTabState = getPrayerTabState();
|
protected void startUp() throws Exception
|
||||||
|
{
|
||||||
if (prayerTabState == PrayerTabState.PRAYERS) {
|
hidePrayers();
|
||||||
List<Widget> prayerWidgets = PRAYER_WIDGET_INFO_LIST.stream().map(client::getWidget)
|
}
|
||||||
.filter(Objects::nonNull).collect(Collectors.toList());
|
|
||||||
|
@Override
|
||||||
if (prayerWidgets.size() != PRAYER_WIDGET_INFO_LIST.size())
|
protected void shutDown() throws Exception
|
||||||
return;
|
{
|
||||||
|
restorePrayers();
|
||||||
for (int index = 0; index < PRAYER_COUNT; index++)
|
}
|
||||||
prayerWidgets.get(Prayer.values()[index].ordinal()).setHidden(false);
|
|
||||||
}
|
@Subscribe
|
||||||
}
|
public void onGameStateChanged(GameStateChanged event)
|
||||||
|
{
|
||||||
private void hidePrayers() {
|
if (event.getGameState() == GameState.LOGGED_IN)
|
||||||
if (client.getGameState() != GameState.LOGGED_IN)
|
{
|
||||||
return;
|
hidePrayers();
|
||||||
|
}
|
||||||
PrayerTabState prayerTabState = getPrayerTabState();
|
}
|
||||||
|
|
||||||
if (prayerTabState == PrayerTabState.PRAYERS) {
|
@Subscribe
|
||||||
List<Widget> prayerWidgets = PRAYER_WIDGET_INFO_LIST.stream().map(client::getWidget)
|
public void onConfigChanged(ConfigChanged event)
|
||||||
.filter(Objects::nonNull).collect(Collectors.toList());
|
{
|
||||||
|
if (event.getGroup().equals("hideprayers"))
|
||||||
if (prayerWidgets.size() != PRAYER_WIDGET_INFO_LIST.size())
|
{
|
||||||
return;
|
hidePrayers();
|
||||||
|
}
|
||||||
for (int index = 0; index < PRAYER_COUNT; index++) {
|
}
|
||||||
Prayer prayer = Prayer.values()[index];
|
|
||||||
Widget prayerWidget = prayerWidgets.get(prayer.ordinal());
|
@Subscribe
|
||||||
|
public void onWidgetLoaded(WidgetLoaded event)
|
||||||
if (!config.showPrayers() && !config.showEagleMystic())
|
{
|
||||||
prayerWidget.setHidden(false);
|
if (event.getGroupId() == WidgetID.PRAYER_GROUP_ID || event.getGroupId() == WidgetID.QUICK_PRAYERS_GROUP_ID)
|
||||||
|
{
|
||||||
if (config.showPrayers()) {
|
hidePrayers();
|
||||||
prayerWidget.setHidden(true);
|
}
|
||||||
prayerWidgets.get(Prayer.values()[10].ordinal()).setHidden(false);// protect item
|
}
|
||||||
prayerWidgets.get(Prayer.values()[16].ordinal()).setHidden(false);// mage
|
|
||||||
prayerWidgets.get(Prayer.values()[17].ordinal()).setHidden(false);// range
|
private PrayerTabState getPrayerTabState()
|
||||||
prayerWidgets.get(Prayer.values()[18].ordinal()).setHidden(false);// melee
|
{
|
||||||
prayerWidgets.get(Prayer.values()[23].ordinal()).setHidden(false);// smite
|
HashTable<WidgetNode> componentTable = client.getComponentTable();
|
||||||
if (config.showEagleMystic()) {
|
for (WidgetNode widgetNode : componentTable.getNodes())
|
||||||
prayerWidgets.get(Prayer.values()[27].ordinal()).setHidden(true);// rigour
|
{
|
||||||
prayerWidgets.get(Prayer.values()[28].ordinal()).setHidden(true);// augury
|
if (widgetNode.getId() == WidgetID.PRAYER_GROUP_ID)
|
||||||
} else {
|
{
|
||||||
prayerWidgets.get(Prayer.values()[27].ordinal()).setHidden(false);// rigour
|
return PrayerTabState.PRAYERS;
|
||||||
prayerWidgets.get(Prayer.values()[28].ordinal()).setHidden(false);// augury
|
}
|
||||||
}
|
else if (widgetNode.getId() == WidgetID.QUICK_PRAYERS_GROUP_ID)
|
||||||
if (config.showUltStrength()) {
|
{
|
||||||
prayerWidgets.get(Prayer.values()[26].ordinal()).setHidden(true);// piety
|
return PrayerTabState.QUICK_PRAYERS;
|
||||||
} else {
|
}
|
||||||
prayerWidgets.get(Prayer.values()[26].ordinal()).setHidden(false);// piety
|
}
|
||||||
}
|
return PrayerTabState.NONE;
|
||||||
}
|
}
|
||||||
if (config.showEagleMystic()) {
|
|
||||||
prayerWidget.setHidden(true);
|
private void restorePrayers()
|
||||||
prayerWidgets.get(Prayer.values()[19].ordinal()).setHidden(false);// eagle
|
{
|
||||||
prayerWidgets.get(Prayer.values()[20].ordinal()).setHidden(false);// mystic
|
if (client.getGameState() != GameState.LOGGED_IN)
|
||||||
prayerWidgets.get(Prayer.values()[27].ordinal()).setHidden(true);// rigour
|
return;
|
||||||
prayerWidgets.get(Prayer.values()[28].ordinal()).setHidden(true);// augury
|
|
||||||
}
|
PrayerTabState prayerTabState = getPrayerTabState();
|
||||||
if (config.showUltStrength()) {
|
|
||||||
prayerWidget.setHidden(true);
|
if (prayerTabState == PrayerTabState.PRAYERS)
|
||||||
prayerWidgets.get(Prayer.values()[14].ordinal()).setHidden(false);// Ult Strength
|
{
|
||||||
prayerWidgets.get(Prayer.values()[26].ordinal()).setHidden(true);// piety
|
List<Widget> prayerWidgets = PRAYER_WIDGET_INFO_LIST.stream().map(client::getWidget)
|
||||||
}
|
.filter(Objects::nonNull).collect(Collectors.toList());
|
||||||
|
|
||||||
}
|
if (prayerWidgets.size() != PRAYER_WIDGET_INFO_LIST.size())
|
||||||
}
|
return;
|
||||||
}
|
|
||||||
}
|
for (int index = 0; index < PRAYER_COUNT; index++)
|
||||||
|
prayerWidgets.get(Prayer.values()[index].ordinal()).setHidden(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void hidePrayers()
|
||||||
|
{
|
||||||
|
if (client.getGameState() != GameState.LOGGED_IN)
|
||||||
|
return;
|
||||||
|
|
||||||
|
PrayerTabState prayerTabState = getPrayerTabState();
|
||||||
|
|
||||||
|
if (prayerTabState == PrayerTabState.PRAYERS)
|
||||||
|
{
|
||||||
|
List<Widget> prayerWidgets = PRAYER_WIDGET_INFO_LIST.stream().map(client::getWidget)
|
||||||
|
.filter(Objects::nonNull).collect(Collectors.toList());
|
||||||
|
|
||||||
|
if (prayerWidgets.size() != PRAYER_WIDGET_INFO_LIST.size())
|
||||||
|
return;
|
||||||
|
|
||||||
|
for (int index = 0; index < PRAYER_COUNT; index++)
|
||||||
|
{
|
||||||
|
Prayer prayer = Prayer.values()[index];
|
||||||
|
Widget prayerWidget = prayerWidgets.get(prayer.ordinal());
|
||||||
|
|
||||||
|
if (!config.showPrayers() && !config.showEagleMystic())
|
||||||
|
prayerWidget.setHidden(false);
|
||||||
|
|
||||||
|
if (config.showPrayers())
|
||||||
|
{
|
||||||
|
prayerWidget.setHidden(true);
|
||||||
|
prayerWidgets.get(Prayer.values()[10].ordinal()).setHidden(false);// protect item
|
||||||
|
prayerWidgets.get(Prayer.values()[16].ordinal()).setHidden(false);// mage
|
||||||
|
prayerWidgets.get(Prayer.values()[17].ordinal()).setHidden(false);// range
|
||||||
|
prayerWidgets.get(Prayer.values()[18].ordinal()).setHidden(false);// melee
|
||||||
|
prayerWidgets.get(Prayer.values()[23].ordinal()).setHidden(false);// smite
|
||||||
|
if (config.showEagleMystic())
|
||||||
|
{
|
||||||
|
prayerWidgets.get(Prayer.values()[27].ordinal()).setHidden(true);// rigour
|
||||||
|
prayerWidgets.get(Prayer.values()[28].ordinal()).setHidden(true);// augury
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
prayerWidgets.get(Prayer.values()[27].ordinal()).setHidden(false);// rigour
|
||||||
|
prayerWidgets.get(Prayer.values()[28].ordinal()).setHidden(false);// augury
|
||||||
|
}
|
||||||
|
if (config.showUltStrength())
|
||||||
|
{
|
||||||
|
prayerWidgets.get(Prayer.values()[26].ordinal()).setHidden(true);// piety
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
prayerWidgets.get(Prayer.values()[26].ordinal()).setHidden(false);// piety
|
||||||
|
}
|
||||||
|
if (config.showPreserve())
|
||||||
|
{
|
||||||
|
prayerWidgets.get(Prayer.values()[24].ordinal()).setHidden(true);// Preserve
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
prayerWidgets.get(Prayer.values()[24].ordinal()).setHidden(false);// Preserve
|
||||||
|
}
|
||||||
|
if (config.showRedemption())
|
||||||
|
{
|
||||||
|
prayerWidgets.get(Prayer.values()[22].ordinal()).setHidden(true);// Redemption
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
prayerWidgets.get(Prayer.values()[22].ordinal()).setHidden(false);// Redemption
|
||||||
|
}
|
||||||
|
if (config.showRapidRestore())
|
||||||
|
{
|
||||||
|
prayerWidgets.get(Prayer.values()[8].ordinal()).setHidden(true);// Rapid Restore
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
prayerWidgets.get(Prayer.values()[8].ordinal()).setHidden(false);// Rapid Restore
|
||||||
|
}
|
||||||
|
if (config.showRapidHeal())
|
||||||
|
{
|
||||||
|
prayerWidgets.get(Prayer.values()[9].ordinal()).setHidden(true);// Rapid Heal
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
prayerWidgets.get(Prayer.values()[9].ordinal()).setHidden(false);// Rapid Heal
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (config.showEagleMystic())
|
||||||
|
{
|
||||||
|
prayerWidget.setHidden(true);
|
||||||
|
prayerWidgets.get(Prayer.values()[19].ordinal()).setHidden(false);// eagle
|
||||||
|
prayerWidgets.get(Prayer.values()[20].ordinal()).setHidden(false);// mystic
|
||||||
|
prayerWidgets.get(Prayer.values()[27].ordinal()).setHidden(true);// rigour
|
||||||
|
prayerWidgets.get(Prayer.values()[28].ordinal()).setHidden(true);// augury
|
||||||
|
}
|
||||||
|
if (config.showUltStrength())
|
||||||
|
{
|
||||||
|
prayerWidget.setHidden(true);
|
||||||
|
prayerWidgets.get(Prayer.values()[13].ordinal()).setHidden(false);// Steel Skin
|
||||||
|
prayerWidgets.get(Prayer.values()[14].ordinal()).setHidden(false);// Ult Strength
|
||||||
|
prayerWidgets.get(Prayer.values()[15].ordinal()).setHidden(false);// Incredible Reflexes
|
||||||
|
prayerWidgets.get(Prayer.values()[26].ordinal()).setHidden(true);// piety
|
||||||
|
}
|
||||||
|
if (config.showPreserve())
|
||||||
|
{
|
||||||
|
prayerWidget.setHidden(true);
|
||||||
|
prayerWidgets.get(Prayer.values()[24].ordinal()).setHidden(false);// Preserve
|
||||||
|
}
|
||||||
|
if (config.showRedemption())
|
||||||
|
{
|
||||||
|
prayerWidget.setHidden(true);
|
||||||
|
prayerWidgets.get(Prayer.values()[22].ordinal()).setHidden(false);// Redemption
|
||||||
|
}
|
||||||
|
if (config.showRapidRestore())
|
||||||
|
{
|
||||||
|
prayerWidget.setHidden(true);
|
||||||
|
prayerWidgets.get(Prayer.values()[8].ordinal()).setHidden(false);// Rapid Restore
|
||||||
|
}
|
||||||
|
if (config.showRapidHeal())
|
||||||
|
{
|
||||||
|
prayerWidget.setHidden(true);
|
||||||
|
prayerWidgets.get(Prayer.values()[9].ordinal()).setHidden(false);// Rapid Heal
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,8 +1,33 @@
|
|||||||
package net.runelite.client.plugins.hideprayers;
|
/*
|
||||||
|
* Copyright (c) 2018, https://runelitepl.us
|
||||||
public enum PrayerTabState
|
* All rights reserved.
|
||||||
{
|
*
|
||||||
NONE,
|
* Redistribution and use in source and binary forms, with or without
|
||||||
PRAYERS,
|
* modification, are permitted provided that the following conditions are met:
|
||||||
QUICK_PRAYERS
|
*
|
||||||
}
|
* 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.hideprayers;
|
||||||
|
|
||||||
|
public enum PrayerTabState
|
||||||
|
{
|
||||||
|
NONE,
|
||||||
|
PRAYERS,
|
||||||
|
QUICK_PRAYERS
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user