Merge remote-tracking branch 'upstream/master' into runelite-master-1
# Conflicts: # runelite-api/src/main/java/net/runelite/api/Varbits.java # runelite-client/src/test/java/net/runelite/client/plugins/cluescrolls/clues/hotcold/HotColdTemperatureTest.java
This commit is contained in:
@@ -296,17 +296,18 @@ public class HotColdClue extends ClueScroll implements LocationClueScroll, Locat
|
||||
else
|
||||
{
|
||||
location = null;
|
||||
|
||||
final HotColdTemperatureChange temperatureChange = HotColdTemperatureChange.of(message);
|
||||
hotColdSolver.signal(localWorld, temperature, temperatureChange);
|
||||
}
|
||||
|
||||
final HotColdTemperatureChange temperatureChange = HotColdTemperatureChange.of(message);
|
||||
hotColdSolver.signal(localWorld, temperature, temperatureChange);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reset()
|
||||
{
|
||||
location = null;
|
||||
initializeSolver();
|
||||
}
|
||||
|
||||
@@ -339,7 +340,6 @@ public class HotColdClue extends ClueScroll implements LocationClueScroll, Locat
|
||||
private void markFinalSpot(WorldPoint wp)
|
||||
{
|
||||
this.location = wp;
|
||||
reset();
|
||||
}
|
||||
|
||||
public String[] getNpcs()
|
||||
|
||||
@@ -32,6 +32,7 @@ import java.util.Set;
|
||||
import javax.annotation.Nullable;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import net.runelite.client.util.Text;
|
||||
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
@@ -93,11 +94,12 @@ public enum HotColdTemperature
|
||||
return null;
|
||||
}
|
||||
|
||||
final String messageStart = Text.fromCSV(message).get(0);
|
||||
final List<HotColdTemperature> possibleTemperatures = new ArrayList<>();
|
||||
|
||||
for (final HotColdTemperature temperature : temperatureSet)
|
||||
{
|
||||
if (message.contains(temperature.getText()))
|
||||
if (messageStart.contains(temperature.getText()))
|
||||
{
|
||||
possibleTemperatures.add(temperature);
|
||||
}
|
||||
|
||||
@@ -33,6 +33,7 @@ public enum CustomCursor
|
||||
RS3_GOLD("RS3 Gold", "cursor-rs3-gold.png"),
|
||||
RS3_SILVER("RS3 Silver", "cursor-rs3-silver.png"),
|
||||
DRAGON_DAGGER("Dragon Dagger", "cursor-dragon-dagger.png"),
|
||||
DRAGON_DAGGER_POISON("Dragon Dagger (p)", "cursor-dragon-dagger-p.png"),
|
||||
TROUT("Trout", "cursor-trout.png"),
|
||||
DRAGON_SCIMITAR("Dragon Scimitar", "cursor-dragon-scimitar.png"),
|
||||
ARMADYL_GODSWORD("Armadyl Godsword", "cursor-armadyl-godsword.png"),
|
||||
|
||||
@@ -29,6 +29,7 @@ import java.awt.Color;
|
||||
import net.runelite.client.config.Config;
|
||||
import net.runelite.client.config.ConfigGroup;
|
||||
import net.runelite.client.config.ConfigItem;
|
||||
import net.runelite.client.config.Range;
|
||||
import net.runelite.client.plugins.wintertodt.config.WintertodtNotifyMode;
|
||||
|
||||
@ConfigGroup("wintertodt")
|
||||
@@ -55,4 +56,18 @@ public interface WintertodtConfig extends Config
|
||||
{
|
||||
return Color.CYAN;
|
||||
}
|
||||
|
||||
@ConfigItem(
|
||||
position = 3,
|
||||
keyName = "roundNotification",
|
||||
name = "Wintertodt round notification",
|
||||
description = "Notifies you before the round starts (in seconds)"
|
||||
)
|
||||
@Range(
|
||||
max = 60
|
||||
)
|
||||
default int roundNotification()
|
||||
{
|
||||
return 5;
|
||||
}
|
||||
}
|
||||
@@ -42,10 +42,12 @@ import static net.runelite.api.ItemID.BRUMA_KINDLING;
|
||||
import static net.runelite.api.ItemID.BRUMA_ROOT;
|
||||
import net.runelite.api.MessageNode;
|
||||
import net.runelite.api.Player;
|
||||
import net.runelite.api.Varbits;
|
||||
import net.runelite.api.events.AnimationChanged;
|
||||
import net.runelite.api.events.ChatMessage;
|
||||
import net.runelite.api.events.GameTick;
|
||||
import net.runelite.api.events.ItemContainerChanged;
|
||||
import net.runelite.api.events.VarbitChanged;
|
||||
import net.runelite.client.Notifier;
|
||||
import net.runelite.client.chat.ChatMessageManager;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
@@ -100,6 +102,8 @@ public class WintertodtPlugin extends Plugin
|
||||
|
||||
private Instant lastActionTime;
|
||||
|
||||
private int previousTimerValue;
|
||||
|
||||
@Provides
|
||||
WintertodtConfig getConfig(ConfigManager configManager)
|
||||
{
|
||||
@@ -163,6 +167,30 @@ public class WintertodtPlugin extends Plugin
|
||||
checkActionTimeout();
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onVarbitChanged(VarbitChanged varbitChanged)
|
||||
{
|
||||
int timerValue = client.getVar(Varbits.WINTERTODT_TIMER);
|
||||
if (timerValue != previousTimerValue)
|
||||
{
|
||||
int timeToNotify = config.roundNotification();
|
||||
if (timeToNotify > 0)
|
||||
{
|
||||
int timeInSeconds = timerValue * 30 / 50;
|
||||
int prevTimeInSeconds = previousTimerValue * 30 / 50;
|
||||
|
||||
log.debug("Seconds left until round start: {}", timeInSeconds);
|
||||
|
||||
if (prevTimeInSeconds > timeToNotify && timeInSeconds <= timeToNotify)
|
||||
{
|
||||
notifier.notify("Wintertodt round is about to start");
|
||||
}
|
||||
}
|
||||
|
||||
previousTimerValue = timerValue;
|
||||
}
|
||||
}
|
||||
|
||||
private void checkActionTimeout()
|
||||
{
|
||||
if (currentActivity == WintertodtActivity.IDLE)
|
||||
|
||||
@@ -102,11 +102,22 @@ public interface WorldHopperConfig extends Config
|
||||
return true;
|
||||
}
|
||||
|
||||
@ConfigItem(
|
||||
keyName = "menuOption",
|
||||
name = "Show Hop-to menu option",
|
||||
description = "Adds Hop-to menu option to the friends list and clan members list",
|
||||
position = 6
|
||||
)
|
||||
default boolean menuOption()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@ConfigItem(
|
||||
keyName = "subscriptionFilter",
|
||||
name = "Show subscription types",
|
||||
description = "Only show free worlds, member worlds, or both types of worlds in sidebar",
|
||||
position = 6
|
||||
position = 7
|
||||
)
|
||||
default SubscriptionFilterMode subscriptionFilter()
|
||||
{
|
||||
|
||||
@@ -327,6 +327,11 @@ public class WorldHopperPlugin extends Plugin
|
||||
@Subscribe
|
||||
public void onMenuEntryAdded(MenuEntryAdded event)
|
||||
{
|
||||
if (!config.menuOption())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
int groupId = WidgetInfo.TO_GROUP(event.getActionParam1());
|
||||
String option = event.getOption();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user