Rename Setting to VarPlayer
This commit is contained in:
@@ -166,9 +166,9 @@ public interface Client extends GameEngine
|
||||
|
||||
Varcs getVarcs();
|
||||
|
||||
int getSetting(Setting setting);
|
||||
int getVar(VarPlayer varPlayer);
|
||||
|
||||
int getSetting(Varbits varbit);
|
||||
int getVar(Varbits varbit);
|
||||
|
||||
@VisibleForDevtools
|
||||
void setSetting(Varbits varbit, int value);
|
||||
|
||||
@@ -29,7 +29,7 @@ import lombok.Getter;
|
||||
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum Setting
|
||||
public enum VarPlayer
|
||||
{
|
||||
ATTACK_STYLE(43),
|
||||
|
||||
@@ -69,7 +69,7 @@ public class ChatMessageManager
|
||||
@Subscribe
|
||||
public void onVarbitChanged(VarbitChanged event)
|
||||
{
|
||||
int setting = clientProvider.get().getSetting(Varbits.TRANSPARENT_CHATBOX);
|
||||
int setting = clientProvider.get().getVar(Varbits.TRANSPARENT_CHATBOX);
|
||||
|
||||
if (transparencyVarbit != setting)
|
||||
{
|
||||
@@ -140,7 +140,7 @@ public class ChatMessageManager
|
||||
}
|
||||
|
||||
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());
|
||||
|
||||
// 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 net.runelite.api.Client;
|
||||
import net.runelite.api.GameState;
|
||||
import net.runelite.api.Setting;
|
||||
import net.runelite.api.VarPlayer;
|
||||
import net.runelite.api.Skill;
|
||||
import net.runelite.api.Varbits;
|
||||
import net.runelite.api.events.ConfigChanged;
|
||||
@@ -100,9 +100,9 @@ public class AttackStylesPlugin extends Plugin
|
||||
updateWarnedSkills(config.warnForRanged(), Skill.RANGED);
|
||||
updateWarnedSkills(config.warnForMagic(), Skill.MAGIC);
|
||||
updateAttackStyle(
|
||||
client.getSetting(Varbits.EQUIPPED_WEAPON_TYPE),
|
||||
client.getSetting(Setting.ATTACK_STYLE),
|
||||
client.getSetting(Varbits.DEFENSIVE_CASTING_MODE));
|
||||
client.getVar(Varbits.EQUIPPED_WEAPON_TYPE),
|
||||
client.getVar(VarPlayer.ATTACK_STYLE),
|
||||
client.getVar(Varbits.DEFENSIVE_CASTING_MODE));
|
||||
updateWarning(false);
|
||||
processWidgets();
|
||||
}
|
||||
@@ -173,11 +173,11 @@ public class AttackStylesPlugin extends Plugin
|
||||
@Subscribe
|
||||
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);
|
||||
updateAttackStyle(client.getSetting(Varbits.EQUIPPED_WEAPON_TYPE), attackStyleVarbit,
|
||||
client.getSetting(Varbits.DEFENSIVE_CASTING_MODE));
|
||||
attackStyleVarbit = client.getVar(VarPlayer.ATTACK_STYLE);
|
||||
updateAttackStyle(client.getVar(Varbits.EQUIPPED_WEAPON_TYPE), attackStyleVarbit,
|
||||
client.getVar(Varbits.DEFENSIVE_CASTING_MODE));
|
||||
updateWarning(false);
|
||||
}
|
||||
}
|
||||
@@ -185,11 +185,11 @@ public class AttackStylesPlugin extends Plugin
|
||||
@Subscribe
|
||||
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);
|
||||
updateAttackStyle(equippedWeaponTypeVarbit, client.getSetting(Setting.ATTACK_STYLE),
|
||||
client.getSetting(Varbits.DEFENSIVE_CASTING_MODE));
|
||||
equippedWeaponTypeVarbit = client.getVar(Varbits.EQUIPPED_WEAPON_TYPE);
|
||||
updateAttackStyle(equippedWeaponTypeVarbit, client.getVar(VarPlayer.ATTACK_STYLE),
|
||||
client.getVar(Varbits.DEFENSIVE_CASTING_MODE));
|
||||
updateWarning(true);
|
||||
}
|
||||
}
|
||||
@@ -197,10 +197,10 @@ public class AttackStylesPlugin extends Plugin
|
||||
@Subscribe
|
||||
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);
|
||||
updateAttackStyle(client.getSetting(Varbits.EQUIPPED_WEAPON_TYPE), client.getSetting(Setting.ATTACK_STYLE),
|
||||
castingModeVarbit = client.getVar(Varbits.DEFENSIVE_CASTING_MODE);
|
||||
updateAttackStyle(client.getVar(Varbits.EQUIPPED_WEAPON_TYPE), client.getVar(VarPlayer.ATTACK_STYLE),
|
||||
castingModeVarbit);
|
||||
updateWarning(false);
|
||||
}
|
||||
|
||||
@@ -90,7 +90,7 @@ public class BarbarianAssaultPlugin extends Plugin
|
||||
@Subscribe
|
||||
public void onGameTick(GameTick event)
|
||||
{
|
||||
if (client.getSetting(Varbits.IN_GAME_BA) == 1 &&
|
||||
if (client.getVar(Varbits.IN_GAME_BA) == 1 &&
|
||||
overlay.getCurrentRound() == null &&
|
||||
client.getLocalPlayer() != null)
|
||||
{
|
||||
@@ -115,7 +115,7 @@ public class BarbarianAssaultPlugin extends Plugin
|
||||
@Subscribe
|
||||
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)
|
||||
{
|
||||
|
||||
@@ -70,7 +70,7 @@ public class BarrowsBrotherSlainOverlay extends Overlay
|
||||
|
||||
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(
|
||||
brother.getName(),
|
||||
Color.WHITE,
|
||||
|
||||
@@ -178,7 +178,7 @@ class BarrowsOverlay extends Overlay
|
||||
graphics.setColor(Color.black);
|
||||
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());
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ class BlastFurnaceCofferOverlay extends Overlay
|
||||
|
||||
panelComponent.getLines().add(new PanelComponent.Line(
|
||||
"Coffer:",
|
||||
StackFormatter.quantityToStackSize(client.getSetting(BLAST_FURNACE_COFFER)) + " gp"
|
||||
StackFormatter.quantityToStackSize(client.getVar(BLAST_FURNACE_COFFER)) + " gp"
|
||||
));
|
||||
}
|
||||
return panelComponent.render(graphics);
|
||||
|
||||
@@ -63,7 +63,7 @@ class BlastFurnaceOverlay extends Overlay
|
||||
|
||||
for (BarsOres varbit : BarsOres.values())
|
||||
{
|
||||
int amount = client.getSetting(varbit.getVarbit());
|
||||
int amount = client.getVar(varbit.getVarbit());
|
||||
|
||||
if (amount == 0)
|
||||
{
|
||||
|
||||
@@ -127,19 +127,19 @@ public class DailyTasksPlugin extends Plugin
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
private boolean checkCanCollectStaves()
|
||||
{
|
||||
int value = client.getSetting(Varbits.DAILY_STAVES);
|
||||
int value = client.getVar(Varbits.DAILY_STAVES);
|
||||
return value == 0; // 1 = can't claim
|
||||
}
|
||||
|
||||
private boolean checkCanCollectEssence()
|
||||
{
|
||||
int value = client.getSetting(Varbits.DAILY_ESSENCE);
|
||||
int value = client.getVar(Varbits.DAILY_ESSENCE);
|
||||
return value == 0; // 1 = can't claim
|
||||
}
|
||||
|
||||
|
||||
@@ -126,7 +126,7 @@ public class XpDropPlugin extends Plugin
|
||||
|
||||
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();
|
||||
widget.setTextColor(defaultColor);
|
||||
}
|
||||
|
||||
@@ -73,8 +73,8 @@ public class FairyRingPlugin extends Plugin
|
||||
String destination;
|
||||
try
|
||||
{
|
||||
FairyRings fairyRingDestination = getFairyRingDestination(client.getSetting(Varbits.FAIRY_RING_DIAL_ADCB),
|
||||
client.getSetting(Varbits.FAIRY_RIGH_DIAL_ILJK), client.getSetting(Varbits.FAIRY_RING_DIAL_PSRQ));
|
||||
FairyRings fairyRingDestination = getFairyRingDestination(client.getVar(Varbits.FAIRY_RING_DIAL_ADCB),
|
||||
client.getVar(Varbits.FAIRY_RIGH_DIAL_ILJK), client.getVar(Varbits.FAIRY_RING_DIAL_PSRQ));
|
||||
destination = fairyRingDestination.getDestination();
|
||||
}
|
||||
catch (IllegalArgumentException ex)
|
||||
|
||||
@@ -137,7 +137,7 @@ public class FarmingTrackerPlugin extends Plugin
|
||||
|
||||
{
|
||||
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)))
|
||||
{
|
||||
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
|
||||
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);
|
||||
if (storedValue != null)
|
||||
{
|
||||
|
||||
@@ -160,7 +160,7 @@ public class HerbiboarPlugin extends Plugin
|
||||
for (HerbiboarTrail trail : HerbiboarTrail.values())
|
||||
{
|
||||
int trailId = trail.getTrailId();
|
||||
int value = client.getSetting(trail.getVarbit());
|
||||
int value = client.getVar(trail.getVarbit());
|
||||
|
||||
if (value > 0)
|
||||
{
|
||||
@@ -175,7 +175,7 @@ public class HerbiboarPlugin extends Plugin
|
||||
}
|
||||
|
||||
// Get finish data
|
||||
finishId = client.getSetting(Varbits.HB_FINISH);
|
||||
finishId = client.getVar(Varbits.HB_FINISH);
|
||||
if (finishId > 0 && currentTrail != null)
|
||||
{
|
||||
shownTrails.add(currentTrail.getTrailId());
|
||||
@@ -184,7 +184,7 @@ public class HerbiboarPlugin extends Plugin
|
||||
currentPath = -1;
|
||||
}
|
||||
|
||||
int started = client.getSetting(Varbits.HB_STARTED);
|
||||
int started = client.getVar(Varbits.HB_STARTED);
|
||||
if (currentPath == -1 && finishId == 0 && started == 0)
|
||||
{
|
||||
resetTrailData();
|
||||
|
||||
@@ -41,10 +41,10 @@ public class SpicyStew implements Effect
|
||||
/*
|
||||
* Spice boosts listed in the colour order of [Spicy stew -> Smell]
|
||||
*/
|
||||
int redBoost = spiceBoostOf(client.getSetting(Varbits.SPICY_STEW_RED_SPICES));
|
||||
int yellowBoost = spiceBoostOf(client.getSetting(Varbits.SPICY_STEW_YELLOW_SPICES));
|
||||
int orangeBoost = spiceBoostOf(client.getSetting(Varbits.SPICY_STEW_ORANGE_SPICES));
|
||||
int brownBoost = spiceBoostOf(client.getSetting(Varbits.SPICY_STEW_BROWN_SPICES));
|
||||
int redBoost = spiceBoostOf(client.getVar(Varbits.SPICY_STEW_RED_SPICES));
|
||||
int yellowBoost = spiceBoostOf(client.getVar(Varbits.SPICY_STEW_YELLOW_SPICES));
|
||||
int orangeBoost = spiceBoostOf(client.getVar(Varbits.SPICY_STEW_ORANGE_SPICES));
|
||||
int brownBoost = spiceBoostOf(client.getVar(Varbits.SPICY_STEW_BROWN_SPICES));
|
||||
|
||||
List<StatChange> changes = new ArrayList<>();
|
||||
|
||||
|
||||
@@ -79,8 +79,8 @@ public class KingdomPlugin extends Plugin
|
||||
@Subscribe
|
||||
public void onVarbitChanged(VarbitChanged event)
|
||||
{
|
||||
favor = client.getSetting(Varbits.KINGDOM_FAVOR);
|
||||
coffer = client.getSetting(Varbits.KINGDOM_COFFER);
|
||||
favor = client.getVar(Varbits.KINGDOM_FAVOR);
|
||||
coffer = client.getVar(Varbits.KINGDOM_COFFER);
|
||||
processInfobox();
|
||||
}
|
||||
|
||||
@@ -130,7 +130,7 @@ public class KingdomPlugin extends Plugin
|
||||
|
||||
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)
|
||||
|
||||
@@ -154,8 +154,8 @@ public class MotherlodePlugin extends Plugin
|
||||
{
|
||||
if (inMlm)
|
||||
{
|
||||
curSackSize = client.getSetting(Varbits.SACK_NUMBER);
|
||||
boolean sackUpgraded = client.getSetting(Varbits.SACK_UPGRADED) == 1;
|
||||
curSackSize = client.getVar(Varbits.SACK_NUMBER);
|
||||
boolean sackUpgraded = client.getVar(Varbits.SACK_UPGRADED) == 1;
|
||||
maxSackSize = sackUpgraded ? SACK_LARGE_SIZE : SACK_SIZE;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@ class MotherlodeSackOverlay extends Overlay
|
||||
panelComponent.getLines().add(new PanelComponent.Line(
|
||||
"Pay-dirt in sack:",
|
||||
Color.WHITE,
|
||||
String.valueOf(client.getSetting(Varbits.SACK_NUMBER)),
|
||||
String.valueOf(client.getVar(Varbits.SACK_NUMBER)),
|
||||
Color.WHITE
|
||||
));
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@ class NightmareZoneOverlay extends Overlay
|
||||
panelComponent.getLines().add(new PanelComponent.Line(
|
||||
"Points: ",
|
||||
Color.WHITE,
|
||||
StackFormatter.formatNumber(client.getSetting(Varbits.NMZ_POINTS)),
|
||||
StackFormatter.formatNumber(client.getVar(Varbits.NMZ_POINTS)),
|
||||
Color.WHITE
|
||||
));
|
||||
|
||||
@@ -109,7 +109,7 @@ class NightmareZoneOverlay extends Overlay
|
||||
|
||||
private void renderAbsorptionCounter()
|
||||
{
|
||||
int absorptionPoints = client.getSetting(Varbits.NMZ_ABSORPTION);
|
||||
int absorptionPoints = client.getVar(Varbits.NMZ_ABSORPTION);
|
||||
if (absorptionPoints == 0)
|
||||
{
|
||||
if (absorptionCounter != null)
|
||||
|
||||
@@ -151,7 +151,7 @@ public class NightmareZonePlugin extends Plugin
|
||||
|
||||
private void checkAbsorption()
|
||||
{
|
||||
int absorptionPoints = client.getSetting(Varbits.NMZ_ABSORPTION);
|
||||
int absorptionPoints = client.getVar(Varbits.NMZ_ABSORPTION);
|
||||
|
||||
if (!absorptionNotificationSend)
|
||||
{
|
||||
|
||||
@@ -126,7 +126,7 @@ class OpponentInfoOverlay extends Overlay
|
||||
|
||||
Actor opponentsOpponent = opponent.getInteracting();
|
||||
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());
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ import net.runelite.api.GameState;
|
||||
import net.runelite.api.InstanceTemplates;
|
||||
import net.runelite.api.ObjectID;
|
||||
import net.runelite.api.Point;
|
||||
import net.runelite.api.Setting;
|
||||
import net.runelite.api.VarPlayer;
|
||||
import net.runelite.api.Tile;
|
||||
import net.runelite.api.Varbits;
|
||||
import static net.runelite.api.Perspective.SCENE_SIZE;
|
||||
@@ -152,7 +152,7 @@ public class RaidsPlugin extends Plugin
|
||||
{
|
||||
if (client.getGameState() == GameState.LOGGED_IN)
|
||||
{
|
||||
inRaidChambers = client.getSetting(Varbits.IN_RAID) == 1;
|
||||
inRaidChambers = client.getVar(Varbits.IN_RAID) == 1;
|
||||
updateInfoBoxState();
|
||||
}
|
||||
|
||||
@@ -226,7 +226,7 @@ public class RaidsPlugin extends Plugin
|
||||
@Subscribe
|
||||
public void onVarbitChange(VarbitChanged event)
|
||||
{
|
||||
boolean setting = client.getSetting(Varbits.IN_RAID) == 1;
|
||||
boolean setting = client.getVar(Varbits.IN_RAID) == 1;
|
||||
|
||||
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);
|
||||
raid = null;
|
||||
@@ -297,8 +297,8 @@ public class RaidsPlugin extends Plugin
|
||||
|
||||
if (config.pointsMessage())
|
||||
{
|
||||
int totalPoints = client.getSetting(Varbits.TOTAL_POINTS);
|
||||
int personalPoints = client.getSetting(Varbits.PERSONAL_POINTS);
|
||||
int totalPoints = client.getVar(Varbits.TOTAL_POINTS);
|
||||
int personalPoints = client.getVar(Varbits.PERSONAL_POINTS);
|
||||
|
||||
double percentage = personalPoints / (totalPoints / 100.0);
|
||||
|
||||
|
||||
@@ -61,8 +61,8 @@ public class RaidsPointsOverlay extends Overlay
|
||||
return null;
|
||||
}
|
||||
|
||||
int totalPoints = client.getSetting(Varbits.TOTAL_POINTS);
|
||||
int personalPoints = client.getSetting(Varbits.PERSONAL_POINTS);
|
||||
int totalPoints = client.getVar(Varbits.TOTAL_POINTS);
|
||||
int personalPoints = client.getVar(Varbits.PERSONAL_POINTS);
|
||||
|
||||
panel.getLines().clear();
|
||||
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
|
||||
));
|
||||
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);
|
||||
|
||||
@@ -33,7 +33,7 @@ import lombok.Getter;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.api.GameState;
|
||||
import net.runelite.api.Prayer;
|
||||
import net.runelite.api.Setting;
|
||||
import net.runelite.api.VarPlayer;
|
||||
import net.runelite.api.Skill;
|
||||
import net.runelite.api.events.GameStateChanged;
|
||||
import net.runelite.api.events.GameTick;
|
||||
@@ -108,7 +108,7 @@ public class RegenMeterPlugin extends Plugin
|
||||
@Subscribe
|
||||
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%
|
||||
ticksSinceSpecRegen = 0;
|
||||
|
||||
@@ -103,7 +103,7 @@ public class RunecraftOverlay extends Overlay
|
||||
final Rectangle bounds = item.getCanvasBounds();
|
||||
final TextComponent textComponent = new TextComponent();
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
@@ -105,14 +105,14 @@ public class RunepouchOverlay extends Overlay
|
||||
{
|
||||
Varbits amountVarbit = AMOUNT_VARBITS[i];
|
||||
|
||||
int amount = client.getSetting(amountVarbit);
|
||||
int amount = client.getVar(amountVarbit);
|
||||
if (amount <= 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
Varbits runeVarbit = RUNE_VARBITS[i];
|
||||
int runeId = client.getSetting(runeVarbit);
|
||||
int runeId = client.getVar(runeVarbit);
|
||||
Runes rune = Runes.getRune(runeId);
|
||||
if (rune == null)
|
||||
{
|
||||
|
||||
@@ -109,7 +109,7 @@ public class TimersPlugin extends Plugin
|
||||
@Subscribe
|
||||
public void onVarbitChange(VarbitChanged event)
|
||||
{
|
||||
int raidVarb = client.getSetting(Varbits.IN_RAID);
|
||||
int raidVarb = client.getVar(Varbits.IN_RAID);
|
||||
if (lastRaidVarb != raidVarb)
|
||||
{
|
||||
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 (client.getSetting(Varbits.IN_RAID) == 1)
|
||||
if (client.getVar(Varbits.IN_RAID) == 1)
|
||||
{
|
||||
createGameTimer(OVERLOAD_RAID);
|
||||
}
|
||||
|
||||
@@ -65,11 +65,11 @@ class TitheFarmSackOverlay extends Overlay
|
||||
{
|
||||
panelComponent.getLines().add(new PanelComponent.Line(
|
||||
"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(
|
||||
"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 javax.inject.Inject;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.api.Setting;
|
||||
import net.runelite.api.VarPlayer;
|
||||
import net.runelite.api.Skill;
|
||||
import net.runelite.api.Varbits;
|
||||
import net.runelite.api.events.ConfigChanged;
|
||||
@@ -85,14 +85,14 @@ public class AttackStylesPluginTest
|
||||
assertTrue(warnedSkills.contains(Skill.ATTACK));
|
||||
|
||||
// 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
|
||||
attackPlugin.onAttackStyleChange(new VarbitChanged());
|
||||
assertTrue(attackPlugin.isWarnedSkillSelected());
|
||||
|
||||
// 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
|
||||
attackPlugin.onAttackStyleChange(new VarbitChanged());
|
||||
@@ -123,7 +123,7 @@ public class AttackStylesPluginTest
|
||||
when(strWidget.isHidden()).thenAnswer(x -> isStrHidden());
|
||||
|
||||
// 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());
|
||||
|
||||
// Verify there is a warned skill
|
||||
|
||||
@@ -51,7 +51,7 @@ import net.runelite.api.Player;
|
||||
import net.runelite.api.Point;
|
||||
import net.runelite.api.Prayer;
|
||||
import net.runelite.api.Projectile;
|
||||
import net.runelite.api.Setting;
|
||||
import net.runelite.api.VarPlayer;
|
||||
import net.runelite.api.Skill;
|
||||
import net.runelite.api.SpritePixels;
|
||||
import net.runelite.api.Tile;
|
||||
@@ -316,17 +316,17 @@ public abstract class RSClientMixin implements RSClient
|
||||
|
||||
@Inject
|
||||
@Override
|
||||
public int getSetting(Setting setting)
|
||||
public int getVar(VarPlayer varPlayer)
|
||||
{
|
||||
int[] varps = getVarps();
|
||||
return varps[setting.getId()];
|
||||
return varps[varPlayer.getId()];
|
||||
}
|
||||
|
||||
@Inject
|
||||
@Override
|
||||
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 (getSetting(Varbits.SIDE_PANELS) == 1)
|
||||
if (getVar(Varbits.SIDE_PANELS) == 1)
|
||||
{
|
||||
return getWidget(WidgetInfo.RESIZABLE_VIEWPORT_BOTTOM_LINE);
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ public abstract class VarbitMixin implements RSClient
|
||||
|
||||
@Inject
|
||||
@Override
|
||||
public int getSetting(Varbits varbit)
|
||||
public int getVar(Varbits varbit)
|
||||
{
|
||||
int varbitId = varbit.getId();
|
||||
return getVarbitValue(varbitId);
|
||||
|
||||
Reference in New Issue
Block a user