Rename Setting to VarPlayer
This commit is contained in:
@@ -166,9 +166,9 @@ public interface Client extends GameEngine
|
|||||||
|
|
||||||
Varcs getVarcs();
|
Varcs getVarcs();
|
||||||
|
|
||||||
int getSetting(Setting setting);
|
int getVar(VarPlayer varPlayer);
|
||||||
|
|
||||||
int getSetting(Varbits varbit);
|
int getVar(Varbits varbit);
|
||||||
|
|
||||||
@VisibleForDevtools
|
@VisibleForDevtools
|
||||||
void setSetting(Varbits varbit, int value);
|
void setSetting(Varbits varbit, int value);
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ import lombok.Getter;
|
|||||||
|
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@Getter
|
@Getter
|
||||||
public enum Setting
|
public enum VarPlayer
|
||||||
{
|
{
|
||||||
ATTACK_STYLE(43),
|
ATTACK_STYLE(43),
|
||||||
|
|
||||||
@@ -69,7 +69,7 @@ public class ChatMessageManager
|
|||||||
@Subscribe
|
@Subscribe
|
||||||
public void onVarbitChanged(VarbitChanged event)
|
public void onVarbitChanged(VarbitChanged event)
|
||||||
{
|
{
|
||||||
int setting = clientProvider.get().getSetting(Varbits.TRANSPARENT_CHATBOX);
|
int setting = clientProvider.get().getVar(Varbits.TRANSPARENT_CHATBOX);
|
||||||
|
|
||||||
if (transparencyVarbit != setting)
|
if (transparencyVarbit != setting)
|
||||||
{
|
{
|
||||||
@@ -140,7 +140,7 @@ public class ChatMessageManager
|
|||||||
}
|
}
|
||||||
|
|
||||||
final Client client = clientProvider.get();
|
final Client client = clientProvider.get();
|
||||||
final boolean transparent = client.isResized() && client.getSetting(Varbits.TRANSPARENT_CHATBOX) != 0;
|
final boolean transparent = client.isResized() && client.getVar(Varbits.TRANSPARENT_CHATBOX) != 0;
|
||||||
final Set<ChatColor> chatColors = colorCache.get(target.getType());
|
final Set<ChatColor> chatColors = colorCache.get(target.getType());
|
||||||
|
|
||||||
// If we do not have any colors cached, simply set clean message
|
// If we do not have any colors cached, simply set clean message
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ import javax.inject.Inject;
|
|||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import net.runelite.api.Client;
|
import net.runelite.api.Client;
|
||||||
import net.runelite.api.GameState;
|
import net.runelite.api.GameState;
|
||||||
import net.runelite.api.Setting;
|
import net.runelite.api.VarPlayer;
|
||||||
import net.runelite.api.Skill;
|
import net.runelite.api.Skill;
|
||||||
import net.runelite.api.Varbits;
|
import net.runelite.api.Varbits;
|
||||||
import net.runelite.api.events.ConfigChanged;
|
import net.runelite.api.events.ConfigChanged;
|
||||||
@@ -100,9 +100,9 @@ public class AttackStylesPlugin extends Plugin
|
|||||||
updateWarnedSkills(config.warnForRanged(), Skill.RANGED);
|
updateWarnedSkills(config.warnForRanged(), Skill.RANGED);
|
||||||
updateWarnedSkills(config.warnForMagic(), Skill.MAGIC);
|
updateWarnedSkills(config.warnForMagic(), Skill.MAGIC);
|
||||||
updateAttackStyle(
|
updateAttackStyle(
|
||||||
client.getSetting(Varbits.EQUIPPED_WEAPON_TYPE),
|
client.getVar(Varbits.EQUIPPED_WEAPON_TYPE),
|
||||||
client.getSetting(Setting.ATTACK_STYLE),
|
client.getVar(VarPlayer.ATTACK_STYLE),
|
||||||
client.getSetting(Varbits.DEFENSIVE_CASTING_MODE));
|
client.getVar(Varbits.DEFENSIVE_CASTING_MODE));
|
||||||
updateWarning(false);
|
updateWarning(false);
|
||||||
processWidgets();
|
processWidgets();
|
||||||
}
|
}
|
||||||
@@ -173,11 +173,11 @@ public class AttackStylesPlugin extends Plugin
|
|||||||
@Subscribe
|
@Subscribe
|
||||||
public void onAttackStyleChange(VarbitChanged event)
|
public void onAttackStyleChange(VarbitChanged event)
|
||||||
{
|
{
|
||||||
if (attackStyleVarbit == -1 || attackStyleVarbit != client.getSetting(Setting.ATTACK_STYLE))
|
if (attackStyleVarbit == -1 || attackStyleVarbit != client.getVar(VarPlayer.ATTACK_STYLE))
|
||||||
{
|
{
|
||||||
attackStyleVarbit = client.getSetting(Setting.ATTACK_STYLE);
|
attackStyleVarbit = client.getVar(VarPlayer.ATTACK_STYLE);
|
||||||
updateAttackStyle(client.getSetting(Varbits.EQUIPPED_WEAPON_TYPE), attackStyleVarbit,
|
updateAttackStyle(client.getVar(Varbits.EQUIPPED_WEAPON_TYPE), attackStyleVarbit,
|
||||||
client.getSetting(Varbits.DEFENSIVE_CASTING_MODE));
|
client.getVar(Varbits.DEFENSIVE_CASTING_MODE));
|
||||||
updateWarning(false);
|
updateWarning(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -185,11 +185,11 @@ public class AttackStylesPlugin extends Plugin
|
|||||||
@Subscribe
|
@Subscribe
|
||||||
public void onEquippedWeaponTypeChange(VarbitChanged event)
|
public void onEquippedWeaponTypeChange(VarbitChanged event)
|
||||||
{
|
{
|
||||||
if (equippedWeaponTypeVarbit == -1 || equippedWeaponTypeVarbit != client.getSetting(Varbits.EQUIPPED_WEAPON_TYPE))
|
if (equippedWeaponTypeVarbit == -1 || equippedWeaponTypeVarbit != client.getVar(Varbits.EQUIPPED_WEAPON_TYPE))
|
||||||
{
|
{
|
||||||
equippedWeaponTypeVarbit = client.getSetting(Varbits.EQUIPPED_WEAPON_TYPE);
|
equippedWeaponTypeVarbit = client.getVar(Varbits.EQUIPPED_WEAPON_TYPE);
|
||||||
updateAttackStyle(equippedWeaponTypeVarbit, client.getSetting(Setting.ATTACK_STYLE),
|
updateAttackStyle(equippedWeaponTypeVarbit, client.getVar(VarPlayer.ATTACK_STYLE),
|
||||||
client.getSetting(Varbits.DEFENSIVE_CASTING_MODE));
|
client.getVar(Varbits.DEFENSIVE_CASTING_MODE));
|
||||||
updateWarning(true);
|
updateWarning(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -197,10 +197,10 @@ public class AttackStylesPlugin extends Plugin
|
|||||||
@Subscribe
|
@Subscribe
|
||||||
public void onCastingModeChange(VarbitChanged event)
|
public void onCastingModeChange(VarbitChanged event)
|
||||||
{
|
{
|
||||||
if (castingModeVarbit == -1 || castingModeVarbit != client.getSetting(Varbits.DEFENSIVE_CASTING_MODE))
|
if (castingModeVarbit == -1 || castingModeVarbit != client.getVar(Varbits.DEFENSIVE_CASTING_MODE))
|
||||||
{
|
{
|
||||||
castingModeVarbit = client.getSetting(Varbits.DEFENSIVE_CASTING_MODE);
|
castingModeVarbit = client.getVar(Varbits.DEFENSIVE_CASTING_MODE);
|
||||||
updateAttackStyle(client.getSetting(Varbits.EQUIPPED_WEAPON_TYPE), client.getSetting(Setting.ATTACK_STYLE),
|
updateAttackStyle(client.getVar(Varbits.EQUIPPED_WEAPON_TYPE), client.getVar(VarPlayer.ATTACK_STYLE),
|
||||||
castingModeVarbit);
|
castingModeVarbit);
|
||||||
updateWarning(false);
|
updateWarning(false);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ public class BarbarianAssaultPlugin extends Plugin
|
|||||||
@Subscribe
|
@Subscribe
|
||||||
public void onGameTick(GameTick event)
|
public void onGameTick(GameTick event)
|
||||||
{
|
{
|
||||||
if (client.getSetting(Varbits.IN_GAME_BA) == 1 &&
|
if (client.getVar(Varbits.IN_GAME_BA) == 1 &&
|
||||||
overlay.getCurrentRound() == null &&
|
overlay.getCurrentRound() == null &&
|
||||||
client.getLocalPlayer() != null)
|
client.getLocalPlayer() != null)
|
||||||
{
|
{
|
||||||
@@ -115,7 +115,7 @@ public class BarbarianAssaultPlugin extends Plugin
|
|||||||
@Subscribe
|
@Subscribe
|
||||||
public void onVarbitChange(VarbitChanged event)
|
public void onVarbitChange(VarbitChanged event)
|
||||||
{
|
{
|
||||||
int inGame = client.getSetting(Varbits.IN_GAME_BA);
|
int inGame = client.getVar(Varbits.IN_GAME_BA);
|
||||||
|
|
||||||
if (inGameBit != inGame && inGameBit == 1)
|
if (inGameBit != inGame && inGameBit == 1)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ public class BarrowsBrotherSlainOverlay extends Overlay
|
|||||||
|
|
||||||
for (BarrowsBrothers brother : BarrowsBrothers.values())
|
for (BarrowsBrothers brother : BarrowsBrothers.values())
|
||||||
{
|
{
|
||||||
String slain = client.getSetting(brother.getKilledVarbit()) > 0 ? "✓" : "";
|
String slain = client.getVar(brother.getKilledVarbit()) > 0 ? "✓" : "";
|
||||||
panelComponent.getLines().add(new PanelComponent.Line(
|
panelComponent.getLines().add(new PanelComponent.Line(
|
||||||
brother.getName(),
|
brother.getName(),
|
||||||
Color.WHITE,
|
Color.WHITE,
|
||||||
|
|||||||
@@ -178,7 +178,7 @@ class BarrowsOverlay extends Overlay
|
|||||||
graphics.setColor(Color.black);
|
graphics.setColor(Color.black);
|
||||||
graphics.drawString(brotherLetter, minimapText.getX() + 1, minimapText.getY() + 1);
|
graphics.drawString(brotherLetter, minimapText.getX() + 1, minimapText.getY() + 1);
|
||||||
|
|
||||||
if (client.getSetting(brother.getKilledVarbit()) > 0)
|
if (client.getVar(brother.getKilledVarbit()) > 0)
|
||||||
{
|
{
|
||||||
graphics.setColor(config.deadBrotherLocColor());
|
graphics.setColor(config.deadBrotherLocColor());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ class BlastFurnaceCofferOverlay extends Overlay
|
|||||||
|
|
||||||
panelComponent.getLines().add(new PanelComponent.Line(
|
panelComponent.getLines().add(new PanelComponent.Line(
|
||||||
"Coffer:",
|
"Coffer:",
|
||||||
StackFormatter.quantityToStackSize(client.getSetting(BLAST_FURNACE_COFFER)) + " gp"
|
StackFormatter.quantityToStackSize(client.getVar(BLAST_FURNACE_COFFER)) + " gp"
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
return panelComponent.render(graphics);
|
return panelComponent.render(graphics);
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ class BlastFurnaceOverlay extends Overlay
|
|||||||
|
|
||||||
for (BarsOres varbit : BarsOres.values())
|
for (BarsOres varbit : BarsOres.values())
|
||||||
{
|
{
|
||||||
int amount = client.getSetting(varbit.getVarbit());
|
int amount = client.getVar(varbit.getVarbit());
|
||||||
|
|
||||||
if (amount == 0)
|
if (amount == 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -127,19 +127,19 @@ public class DailyTasksPlugin extends Plugin
|
|||||||
|
|
||||||
private boolean checkCanCollectHerbBox()
|
private boolean checkCanCollectHerbBox()
|
||||||
{
|
{
|
||||||
int value = client.getSetting(Varbits.DAILY_HERB_BOX);
|
int value = client.getVar(Varbits.DAILY_HERB_BOX);
|
||||||
return value < 15; // < 15 can claim
|
return value < 15; // < 15 can claim
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean checkCanCollectStaves()
|
private boolean checkCanCollectStaves()
|
||||||
{
|
{
|
||||||
int value = client.getSetting(Varbits.DAILY_STAVES);
|
int value = client.getVar(Varbits.DAILY_STAVES);
|
||||||
return value == 0; // 1 = can't claim
|
return value == 0; // 1 = can't claim
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean checkCanCollectEssence()
|
private boolean checkCanCollectEssence()
|
||||||
{
|
{
|
||||||
int value = client.getSetting(Varbits.DAILY_ESSENCE);
|
int value = client.getVar(Varbits.DAILY_ESSENCE);
|
||||||
return value == 0; // 1 = can't claim
|
return value == 0; // 1 = can't claim
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -126,7 +126,7 @@ public class XpDropPlugin extends Plugin
|
|||||||
|
|
||||||
private void resetTextColor(Widget widget)
|
private void resetTextColor(Widget widget)
|
||||||
{
|
{
|
||||||
int defaultColorIdx = client.getSetting(Varbits.EXPERIENCE_DROP_COLOR);
|
int defaultColorIdx = client.getVar(Varbits.EXPERIENCE_DROP_COLOR);
|
||||||
int defaultColor = DefaultColors.values()[defaultColorIdx].getColor().getRGB();
|
int defaultColor = DefaultColors.values()[defaultColorIdx].getColor().getRGB();
|
||||||
widget.setTextColor(defaultColor);
|
widget.setTextColor(defaultColor);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -73,8 +73,8 @@ public class FairyRingPlugin extends Plugin
|
|||||||
String destination;
|
String destination;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
FairyRings fairyRingDestination = getFairyRingDestination(client.getSetting(Varbits.FAIRY_RING_DIAL_ADCB),
|
FairyRings fairyRingDestination = getFairyRingDestination(client.getVar(Varbits.FAIRY_RING_DIAL_ADCB),
|
||||||
client.getSetting(Varbits.FAIRY_RIGH_DIAL_ILJK), client.getSetting(Varbits.FAIRY_RING_DIAL_PSRQ));
|
client.getVar(Varbits.FAIRY_RIGH_DIAL_ILJK), client.getVar(Varbits.FAIRY_RING_DIAL_PSRQ));
|
||||||
destination = fairyRingDestination.getDestination();
|
destination = fairyRingDestination.getDestination();
|
||||||
}
|
}
|
||||||
catch (IllegalArgumentException ex)
|
catch (IllegalArgumentException ex)
|
||||||
|
|||||||
@@ -137,7 +137,7 @@ public class FarmingTrackerPlugin extends Plugin
|
|||||||
|
|
||||||
{
|
{
|
||||||
String group = FarmingTrackerConfig.KEY_NAME + "." + client.getUsername();
|
String group = FarmingTrackerConfig.KEY_NAME + "." + client.getUsername();
|
||||||
String autoweed = Integer.toString(client.getSetting(Varbits.AUTOWEED));
|
String autoweed = Integer.toString(client.getVar(Varbits.AUTOWEED));
|
||||||
if (!autoweed.equals(configManager.getConfiguration(group, FarmingTrackerConfig.AUTOWEED)))
|
if (!autoweed.equals(configManager.getConfiguration(group, FarmingTrackerConfig.AUTOWEED)))
|
||||||
{
|
{
|
||||||
configManager.setConfiguration(group, FarmingTrackerConfig.AUTOWEED, autoweed);
|
configManager.setConfiguration(group, FarmingTrackerConfig.AUTOWEED, autoweed);
|
||||||
@@ -156,7 +156,7 @@ public class FarmingTrackerPlugin extends Plugin
|
|||||||
{
|
{
|
||||||
// Write the config value if it doesn't match what is current, or it is more than 5 minutes old
|
// Write the config value if it doesn't match what is current, or it is more than 5 minutes old
|
||||||
String key = Integer.toString(varbit.getId());
|
String key = Integer.toString(varbit.getId());
|
||||||
String strVarbit = Integer.toString(client.getSetting(varbit));
|
String strVarbit = Integer.toString(client.getVar(varbit));
|
||||||
String storedValue = configManager.getConfiguration(group, key);
|
String storedValue = configManager.getConfiguration(group, key);
|
||||||
if (storedValue != null)
|
if (storedValue != null)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -160,7 +160,7 @@ public class HerbiboarPlugin extends Plugin
|
|||||||
for (HerbiboarTrail trail : HerbiboarTrail.values())
|
for (HerbiboarTrail trail : HerbiboarTrail.values())
|
||||||
{
|
{
|
||||||
int trailId = trail.getTrailId();
|
int trailId = trail.getTrailId();
|
||||||
int value = client.getSetting(trail.getVarbit());
|
int value = client.getVar(trail.getVarbit());
|
||||||
|
|
||||||
if (value > 0)
|
if (value > 0)
|
||||||
{
|
{
|
||||||
@@ -175,7 +175,7 @@ public class HerbiboarPlugin extends Plugin
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get finish data
|
// Get finish data
|
||||||
finishId = client.getSetting(Varbits.HB_FINISH);
|
finishId = client.getVar(Varbits.HB_FINISH);
|
||||||
if (finishId > 0 && currentTrail != null)
|
if (finishId > 0 && currentTrail != null)
|
||||||
{
|
{
|
||||||
shownTrails.add(currentTrail.getTrailId());
|
shownTrails.add(currentTrail.getTrailId());
|
||||||
@@ -184,7 +184,7 @@ public class HerbiboarPlugin extends Plugin
|
|||||||
currentPath = -1;
|
currentPath = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int started = client.getSetting(Varbits.HB_STARTED);
|
int started = client.getVar(Varbits.HB_STARTED);
|
||||||
if (currentPath == -1 && finishId == 0 && started == 0)
|
if (currentPath == -1 && finishId == 0 && started == 0)
|
||||||
{
|
{
|
||||||
resetTrailData();
|
resetTrailData();
|
||||||
|
|||||||
@@ -41,10 +41,10 @@ public class SpicyStew implements Effect
|
|||||||
/*
|
/*
|
||||||
* Spice boosts listed in the colour order of [Spicy stew -> Smell]
|
* Spice boosts listed in the colour order of [Spicy stew -> Smell]
|
||||||
*/
|
*/
|
||||||
int redBoost = spiceBoostOf(client.getSetting(Varbits.SPICY_STEW_RED_SPICES));
|
int redBoost = spiceBoostOf(client.getVar(Varbits.SPICY_STEW_RED_SPICES));
|
||||||
int yellowBoost = spiceBoostOf(client.getSetting(Varbits.SPICY_STEW_YELLOW_SPICES));
|
int yellowBoost = spiceBoostOf(client.getVar(Varbits.SPICY_STEW_YELLOW_SPICES));
|
||||||
int orangeBoost = spiceBoostOf(client.getSetting(Varbits.SPICY_STEW_ORANGE_SPICES));
|
int orangeBoost = spiceBoostOf(client.getVar(Varbits.SPICY_STEW_ORANGE_SPICES));
|
||||||
int brownBoost = spiceBoostOf(client.getSetting(Varbits.SPICY_STEW_BROWN_SPICES));
|
int brownBoost = spiceBoostOf(client.getVar(Varbits.SPICY_STEW_BROWN_SPICES));
|
||||||
|
|
||||||
List<StatChange> changes = new ArrayList<>();
|
List<StatChange> changes = new ArrayList<>();
|
||||||
|
|
||||||
|
|||||||
@@ -79,8 +79,8 @@ public class KingdomPlugin extends Plugin
|
|||||||
@Subscribe
|
@Subscribe
|
||||||
public void onVarbitChanged(VarbitChanged event)
|
public void onVarbitChanged(VarbitChanged event)
|
||||||
{
|
{
|
||||||
favor = client.getSetting(Varbits.KINGDOM_FAVOR);
|
favor = client.getVar(Varbits.KINGDOM_FAVOR);
|
||||||
coffer = client.getSetting(Varbits.KINGDOM_COFFER);
|
coffer = client.getVar(Varbits.KINGDOM_COFFER);
|
||||||
processInfobox();
|
processInfobox();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -130,7 +130,7 @@ public class KingdomPlugin extends Plugin
|
|||||||
|
|
||||||
private boolean hasCompletedQuest()
|
private boolean hasCompletedQuest()
|
||||||
{
|
{
|
||||||
return client.getSetting(Varbits.THRONE_OF_MISCELLANIA_QUEST) == 1;
|
return client.getVar(Varbits.THRONE_OF_MISCELLANIA_QUEST) == 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int getFavorPercent(int favor)
|
static int getFavorPercent(int favor)
|
||||||
|
|||||||
@@ -154,8 +154,8 @@ public class MotherlodePlugin extends Plugin
|
|||||||
{
|
{
|
||||||
if (inMlm)
|
if (inMlm)
|
||||||
{
|
{
|
||||||
curSackSize = client.getSetting(Varbits.SACK_NUMBER);
|
curSackSize = client.getVar(Varbits.SACK_NUMBER);
|
||||||
boolean sackUpgraded = client.getSetting(Varbits.SACK_UPGRADED) == 1;
|
boolean sackUpgraded = client.getVar(Varbits.SACK_UPGRADED) == 1;
|
||||||
maxSackSize = sackUpgraded ? SACK_LARGE_SIZE : SACK_SIZE;
|
maxSackSize = sackUpgraded ? SACK_LARGE_SIZE : SACK_SIZE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ class MotherlodeSackOverlay extends Overlay
|
|||||||
panelComponent.getLines().add(new PanelComponent.Line(
|
panelComponent.getLines().add(new PanelComponent.Line(
|
||||||
"Pay-dirt in sack:",
|
"Pay-dirt in sack:",
|
||||||
Color.WHITE,
|
Color.WHITE,
|
||||||
String.valueOf(client.getSetting(Varbits.SACK_NUMBER)),
|
String.valueOf(client.getVar(Varbits.SACK_NUMBER)),
|
||||||
Color.WHITE
|
Color.WHITE
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ class NightmareZoneOverlay extends Overlay
|
|||||||
panelComponent.getLines().add(new PanelComponent.Line(
|
panelComponent.getLines().add(new PanelComponent.Line(
|
||||||
"Points: ",
|
"Points: ",
|
||||||
Color.WHITE,
|
Color.WHITE,
|
||||||
StackFormatter.formatNumber(client.getSetting(Varbits.NMZ_POINTS)),
|
StackFormatter.formatNumber(client.getVar(Varbits.NMZ_POINTS)),
|
||||||
Color.WHITE
|
Color.WHITE
|
||||||
));
|
));
|
||||||
|
|
||||||
@@ -109,7 +109,7 @@ class NightmareZoneOverlay extends Overlay
|
|||||||
|
|
||||||
private void renderAbsorptionCounter()
|
private void renderAbsorptionCounter()
|
||||||
{
|
{
|
||||||
int absorptionPoints = client.getSetting(Varbits.NMZ_ABSORPTION);
|
int absorptionPoints = client.getVar(Varbits.NMZ_ABSORPTION);
|
||||||
if (absorptionPoints == 0)
|
if (absorptionPoints == 0)
|
||||||
{
|
{
|
||||||
if (absorptionCounter != null)
|
if (absorptionCounter != null)
|
||||||
|
|||||||
@@ -151,7 +151,7 @@ public class NightmareZonePlugin extends Plugin
|
|||||||
|
|
||||||
private void checkAbsorption()
|
private void checkAbsorption()
|
||||||
{
|
{
|
||||||
int absorptionPoints = client.getSetting(Varbits.NMZ_ABSORPTION);
|
int absorptionPoints = client.getVar(Varbits.NMZ_ABSORPTION);
|
||||||
|
|
||||||
if (!absorptionNotificationSend)
|
if (!absorptionNotificationSend)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -126,7 +126,7 @@ class OpponentInfoOverlay extends Overlay
|
|||||||
|
|
||||||
Actor opponentsOpponent = opponent.getInteracting();
|
Actor opponentsOpponent = opponent.getInteracting();
|
||||||
if (opponentsOpponent != null
|
if (opponentsOpponent != null
|
||||||
&& (opponentsOpponent != client.getLocalPlayer() || client.getSetting(Varbits.MULTICOMBAT_AREA) == 1))
|
&& (opponentsOpponent != client.getLocalPlayer() || client.getVar(Varbits.MULTICOMBAT_AREA) == 1))
|
||||||
{
|
{
|
||||||
opponentsOpponentName = Text.removeTags(opponentsOpponent.getName());
|
opponentsOpponentName = Text.removeTags(opponentsOpponent.getName());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ import net.runelite.api.GameState;
|
|||||||
import net.runelite.api.InstanceTemplates;
|
import net.runelite.api.InstanceTemplates;
|
||||||
import net.runelite.api.ObjectID;
|
import net.runelite.api.ObjectID;
|
||||||
import net.runelite.api.Point;
|
import net.runelite.api.Point;
|
||||||
import net.runelite.api.Setting;
|
import net.runelite.api.VarPlayer;
|
||||||
import net.runelite.api.Tile;
|
import net.runelite.api.Tile;
|
||||||
import net.runelite.api.Varbits;
|
import net.runelite.api.Varbits;
|
||||||
import static net.runelite.api.Perspective.SCENE_SIZE;
|
import static net.runelite.api.Perspective.SCENE_SIZE;
|
||||||
@@ -152,7 +152,7 @@ public class RaidsPlugin extends Plugin
|
|||||||
{
|
{
|
||||||
if (client.getGameState() == GameState.LOGGED_IN)
|
if (client.getGameState() == GameState.LOGGED_IN)
|
||||||
{
|
{
|
||||||
inRaidChambers = client.getSetting(Varbits.IN_RAID) == 1;
|
inRaidChambers = client.getVar(Varbits.IN_RAID) == 1;
|
||||||
updateInfoBoxState();
|
updateInfoBoxState();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -226,7 +226,7 @@ public class RaidsPlugin extends Plugin
|
|||||||
@Subscribe
|
@Subscribe
|
||||||
public void onVarbitChange(VarbitChanged event)
|
public void onVarbitChange(VarbitChanged event)
|
||||||
{
|
{
|
||||||
boolean setting = client.getSetting(Varbits.IN_RAID) == 1;
|
boolean setting = client.getVar(Varbits.IN_RAID) == 1;
|
||||||
|
|
||||||
if (inRaidChambers != setting)
|
if (inRaidChambers != setting)
|
||||||
{
|
{
|
||||||
@@ -262,7 +262,7 @@ public class RaidsPlugin extends Plugin
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (client.getSetting(Setting.IN_RAID_PARTY) == -1)
|
if (client.getVar(VarPlayer.IN_RAID_PARTY) == -1)
|
||||||
{
|
{
|
||||||
overlay.setScoutOverlayShown(false);
|
overlay.setScoutOverlayShown(false);
|
||||||
raid = null;
|
raid = null;
|
||||||
@@ -297,8 +297,8 @@ public class RaidsPlugin extends Plugin
|
|||||||
|
|
||||||
if (config.pointsMessage())
|
if (config.pointsMessage())
|
||||||
{
|
{
|
||||||
int totalPoints = client.getSetting(Varbits.TOTAL_POINTS);
|
int totalPoints = client.getVar(Varbits.TOTAL_POINTS);
|
||||||
int personalPoints = client.getSetting(Varbits.PERSONAL_POINTS);
|
int personalPoints = client.getVar(Varbits.PERSONAL_POINTS);
|
||||||
|
|
||||||
double percentage = personalPoints / (totalPoints / 100.0);
|
double percentage = personalPoints / (totalPoints / 100.0);
|
||||||
|
|
||||||
|
|||||||
@@ -61,8 +61,8 @@ public class RaidsPointsOverlay extends Overlay
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
int totalPoints = client.getSetting(Varbits.TOTAL_POINTS);
|
int totalPoints = client.getVar(Varbits.TOTAL_POINTS);
|
||||||
int personalPoints = client.getSetting(Varbits.PERSONAL_POINTS);
|
int personalPoints = client.getVar(Varbits.PERSONAL_POINTS);
|
||||||
|
|
||||||
panel.getLines().clear();
|
panel.getLines().clear();
|
||||||
panel.getLines().add(new PanelComponent.Line(
|
panel.getLines().add(new PanelComponent.Line(
|
||||||
@@ -72,7 +72,7 @@ public class RaidsPointsOverlay extends Overlay
|
|||||||
client.getLocalPlayer().getName() + ":", Color.WHITE, POINTS_FORMAT.format(personalPoints), Color.WHITE
|
client.getLocalPlayer().getName() + ":", Color.WHITE, POINTS_FORMAT.format(personalPoints), Color.WHITE
|
||||||
));
|
));
|
||||||
panel.getLines().add(new PanelComponent.Line(
|
panel.getLines().add(new PanelComponent.Line(
|
||||||
"Party size:", Color.WHITE, String.valueOf(client.getSetting(Varbits.RAID_PARTY_SIZE)), Color.WHITE
|
"Party size:", Color.WHITE, String.valueOf(client.getVar(Varbits.RAID_PARTY_SIZE)), Color.WHITE
|
||||||
));
|
));
|
||||||
|
|
||||||
return panel.render(graphics);
|
return panel.render(graphics);
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ import lombok.Getter;
|
|||||||
import net.runelite.api.Client;
|
import net.runelite.api.Client;
|
||||||
import net.runelite.api.GameState;
|
import net.runelite.api.GameState;
|
||||||
import net.runelite.api.Prayer;
|
import net.runelite.api.Prayer;
|
||||||
import net.runelite.api.Setting;
|
import net.runelite.api.VarPlayer;
|
||||||
import net.runelite.api.Skill;
|
import net.runelite.api.Skill;
|
||||||
import net.runelite.api.events.GameStateChanged;
|
import net.runelite.api.events.GameStateChanged;
|
||||||
import net.runelite.api.events.GameTick;
|
import net.runelite.api.events.GameTick;
|
||||||
@@ -108,7 +108,7 @@ public class RegenMeterPlugin extends Plugin
|
|||||||
@Subscribe
|
@Subscribe
|
||||||
private void onTick(GameTick event)
|
private void onTick(GameTick event)
|
||||||
{
|
{
|
||||||
if (client.getSetting(Setting.SPECIAL_ATTACK_PERCENT) == 1000)
|
if (client.getVar(VarPlayer.SPECIAL_ATTACK_PERCENT) == 1000)
|
||||||
{
|
{
|
||||||
// The recharge doesn't tick when at 100%
|
// The recharge doesn't tick when at 100%
|
||||||
ticksSinceSpecRegen = 0;
|
ticksSinceSpecRegen = 0;
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ public class RunecraftOverlay extends Overlay
|
|||||||
final Rectangle bounds = item.getCanvasBounds();
|
final Rectangle bounds = item.getCanvasBounds();
|
||||||
final TextComponent textComponent = new TextComponent();
|
final TextComponent textComponent = new TextComponent();
|
||||||
textComponent.setPosition(new Point(bounds.x, bounds.y + 16));
|
textComponent.setPosition(new Point(bounds.x, bounds.y + 16));
|
||||||
textComponent.setText(String.valueOf(client.getSetting(varbits)));
|
textComponent.setText(String.valueOf(client.getVar(varbits)));
|
||||||
textComponent.render(graphics);
|
textComponent.render(graphics);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -105,14 +105,14 @@ public class RunepouchOverlay extends Overlay
|
|||||||
{
|
{
|
||||||
Varbits amountVarbit = AMOUNT_VARBITS[i];
|
Varbits amountVarbit = AMOUNT_VARBITS[i];
|
||||||
|
|
||||||
int amount = client.getSetting(amountVarbit);
|
int amount = client.getVar(amountVarbit);
|
||||||
if (amount <= 0)
|
if (amount <= 0)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
Varbits runeVarbit = RUNE_VARBITS[i];
|
Varbits runeVarbit = RUNE_VARBITS[i];
|
||||||
int runeId = client.getSetting(runeVarbit);
|
int runeId = client.getVar(runeVarbit);
|
||||||
Runes rune = Runes.getRune(runeId);
|
Runes rune = Runes.getRune(runeId);
|
||||||
if (rune == null)
|
if (rune == null)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -109,7 +109,7 @@ public class TimersPlugin extends Plugin
|
|||||||
@Subscribe
|
@Subscribe
|
||||||
public void onVarbitChange(VarbitChanged event)
|
public void onVarbitChange(VarbitChanged event)
|
||||||
{
|
{
|
||||||
int raidVarb = client.getSetting(Varbits.IN_RAID);
|
int raidVarb = client.getVar(Varbits.IN_RAID);
|
||||||
if (lastRaidVarb != raidVarb)
|
if (lastRaidVarb != raidVarb)
|
||||||
{
|
{
|
||||||
removeGameTimer(OVERLOAD_RAID);
|
removeGameTimer(OVERLOAD_RAID);
|
||||||
@@ -321,7 +321,7 @@ public class TimersPlugin extends Plugin
|
|||||||
|
|
||||||
if (config.showOverload() && event.getMessage().startsWith("You drink some of your") && event.getMessage().contains("overload"))
|
if (config.showOverload() && event.getMessage().startsWith("You drink some of your") && event.getMessage().contains("overload"))
|
||||||
{
|
{
|
||||||
if (client.getSetting(Varbits.IN_RAID) == 1)
|
if (client.getVar(Varbits.IN_RAID) == 1)
|
||||||
{
|
{
|
||||||
createGameTimer(OVERLOAD_RAID);
|
createGameTimer(OVERLOAD_RAID);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -65,11 +65,11 @@ class TitheFarmSackOverlay extends Overlay
|
|||||||
{
|
{
|
||||||
panelComponent.getLines().add(new PanelComponent.Line(
|
panelComponent.getLines().add(new PanelComponent.Line(
|
||||||
"Fruits in sack:",
|
"Fruits in sack:",
|
||||||
String.valueOf(client.getSetting(Varbits.TITHE_FARM_SACK_AMOUNT))
|
String.valueOf(client.getVar(Varbits.TITHE_FARM_SACK_AMOUNT))
|
||||||
));
|
));
|
||||||
panelComponent.getLines().add(new PanelComponent.Line(
|
panelComponent.getLines().add(new PanelComponent.Line(
|
||||||
"Points:",
|
"Points:",
|
||||||
String.valueOf(client.getSetting(Varbits.TITHE_FARM_POINTS))
|
String.valueOf(client.getVar(Varbits.TITHE_FARM_POINTS))
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ import com.google.inject.testing.fieldbinder.BoundFieldModule;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
import net.runelite.api.Client;
|
import net.runelite.api.Client;
|
||||||
import net.runelite.api.Setting;
|
import net.runelite.api.VarPlayer;
|
||||||
import net.runelite.api.Skill;
|
import net.runelite.api.Skill;
|
||||||
import net.runelite.api.Varbits;
|
import net.runelite.api.Varbits;
|
||||||
import net.runelite.api.events.ConfigChanged;
|
import net.runelite.api.events.ConfigChanged;
|
||||||
@@ -85,14 +85,14 @@ public class AttackStylesPluginTest
|
|||||||
assertTrue(warnedSkills.contains(Skill.ATTACK));
|
assertTrue(warnedSkills.contains(Skill.ATTACK));
|
||||||
|
|
||||||
// Set mock client to attack in style that gives attack xp
|
// Set mock client to attack in style that gives attack xp
|
||||||
when(client.getSetting(Setting.ATTACK_STYLE)).thenReturn(AttackStyle.ACCURATE.ordinal());
|
when(client.getVar(VarPlayer.ATTACK_STYLE)).thenReturn(AttackStyle.ACCURATE.ordinal());
|
||||||
|
|
||||||
// verify that earning xp in a warned skill will display red text on the widget
|
// verify that earning xp in a warned skill will display red text on the widget
|
||||||
attackPlugin.onAttackStyleChange(new VarbitChanged());
|
attackPlugin.onAttackStyleChange(new VarbitChanged());
|
||||||
assertTrue(attackPlugin.isWarnedSkillSelected());
|
assertTrue(attackPlugin.isWarnedSkillSelected());
|
||||||
|
|
||||||
// Switch to attack style that doesn't give attack xp
|
// Switch to attack style that doesn't give attack xp
|
||||||
when(client.getSetting(Setting.ATTACK_STYLE)).thenReturn(AttackStyle.AGGRESSIVE.ordinal());
|
when(client.getVar(VarPlayer.ATTACK_STYLE)).thenReturn(AttackStyle.AGGRESSIVE.ordinal());
|
||||||
|
|
||||||
// Verify the widget will now display white text
|
// Verify the widget will now display white text
|
||||||
attackPlugin.onAttackStyleChange(new VarbitChanged());
|
attackPlugin.onAttackStyleChange(new VarbitChanged());
|
||||||
@@ -123,7 +123,7 @@ public class AttackStylesPluginTest
|
|||||||
when(strWidget.isHidden()).thenAnswer(x -> isStrHidden());
|
when(strWidget.isHidden()).thenAnswer(x -> isStrHidden());
|
||||||
|
|
||||||
// equip type_4 weapon type on player
|
// equip type_4 weapon type on player
|
||||||
when(client.getSetting(Varbits.EQUIPPED_WEAPON_TYPE)).thenReturn(WeaponType.TYPE_4.ordinal());
|
when(client.getVar(Varbits.EQUIPPED_WEAPON_TYPE)).thenReturn(WeaponType.TYPE_4.ordinal());
|
||||||
attackPlugin.onEquippedWeaponTypeChange(new VarbitChanged());
|
attackPlugin.onEquippedWeaponTypeChange(new VarbitChanged());
|
||||||
|
|
||||||
// Verify there is a warned skill
|
// Verify there is a warned skill
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ import net.runelite.api.Player;
|
|||||||
import net.runelite.api.Point;
|
import net.runelite.api.Point;
|
||||||
import net.runelite.api.Prayer;
|
import net.runelite.api.Prayer;
|
||||||
import net.runelite.api.Projectile;
|
import net.runelite.api.Projectile;
|
||||||
import net.runelite.api.Setting;
|
import net.runelite.api.VarPlayer;
|
||||||
import net.runelite.api.Skill;
|
import net.runelite.api.Skill;
|
||||||
import net.runelite.api.SpritePixels;
|
import net.runelite.api.SpritePixels;
|
||||||
import net.runelite.api.Tile;
|
import net.runelite.api.Tile;
|
||||||
@@ -316,17 +316,17 @@ public abstract class RSClientMixin implements RSClient
|
|||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
@Override
|
@Override
|
||||||
public int getSetting(Setting setting)
|
public int getVar(VarPlayer varPlayer)
|
||||||
{
|
{
|
||||||
int[] varps = getVarps();
|
int[] varps = getVarps();
|
||||||
return varps[setting.getId()];
|
return varps[varPlayer.getId()];
|
||||||
}
|
}
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
@Override
|
@Override
|
||||||
public boolean isPrayerActive(Prayer prayer)
|
public boolean isPrayerActive(Prayer prayer)
|
||||||
{
|
{
|
||||||
return getSetting(prayer.getVarbit()) == 1;
|
return getVar(prayer.getVarbit()) == 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -380,7 +380,7 @@ public abstract class RSClientMixin implements RSClient
|
|||||||
{
|
{
|
||||||
if (isResized())
|
if (isResized())
|
||||||
{
|
{
|
||||||
if (getSetting(Varbits.SIDE_PANELS) == 1)
|
if (getVar(Varbits.SIDE_PANELS) == 1)
|
||||||
{
|
{
|
||||||
return getWidget(WidgetInfo.RESIZABLE_VIEWPORT_BOTTOM_LINE);
|
return getWidget(WidgetInfo.RESIZABLE_VIEWPORT_BOTTOM_LINE);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ public abstract class VarbitMixin implements RSClient
|
|||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
@Override
|
@Override
|
||||||
public int getSetting(Varbits varbit)
|
public int getVar(Varbits varbit)
|
||||||
{
|
{
|
||||||
int varbitId = varbit.getId();
|
int varbitId = varbit.getId();
|
||||||
return getVarbitValue(varbitId);
|
return getVarbitValue(varbitId);
|
||||||
|
|||||||
Reference in New Issue
Block a user