Skip to content
This repository has been archived by the owner on Apr 8, 2023. It is now read-only.

project: Merge upstream #2313

Merged
merged 22 commits into from
Feb 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
b34d59a
plugins: add reset configuration method on plugin
raiyni Oct 4, 2019
04ec36a
banktags: reset tagtabs and banktags when reset button is clicked
raiyni Oct 4, 2019
00fb20e
config: add support for integer config items to have units
Enriath Jan 26, 2020
bed56b9
plugins: add units to configs
Enriath Jan 28, 2020
1bab5a5
widgetid: fix LMS INFO
raiyni Jan 29, 2020
273ebde
Add ability and config to swap Lookup and Search in wiki plugin (#10690)
hjdarnel Feb 1, 2020
d8d6ed3
client: add configuration for tooltip position
Crypthead Jan 25, 2020
6107493
idle notifier: add fishing animations
Alexsuperfly Apr 7, 2019
3f1120d
idle notifier: prevent double notifications for anim and interact
Alexsuperfly Jan 31, 2020
d1ac14a
wintertodt: fix interrupt notification firing when already idle
Adam- Feb 2, 2020
bbdb812
Merge pull request #10662 from Hydrox6/config-units
Adam- Feb 2, 2020
437a1a2
move capturing of screenshots to ImageCapture utility
Alexsuperfly Nov 27, 2019
bbdf76a
Raids: Add clan chat and world to scouting overlay
Alexsuperfly Nov 27, 2019
ecbfd9c
Raids: Enable screenshotting of scouting overlay
Alexsuperfly Nov 27, 2019
8c5197c
cache: update sequence definition
Adam- Feb 1, 2020
9a103f8
widget item: clip overlay to parent bounds
Adam- Feb 2, 2020
5216b03
screenmarkers: prevent null marker creation
Adam- Feb 4, 2020
1dfad03
Merge pull request #9973 from raiyni/additional-reset
Adam- Feb 5, 2020
9552b54
Merge pull request #10687 from raiyni/lms-info
Adam- Feb 6, 2020
f71de0e
Merge remote-tracking branch 'runelite/master'
Owain94 Feb 6, 2020
817c27e
client: Add more config units
Owain94 Feb 6, 2020
236243e
scripts: Update spec redraw
Owain94 Feb 6, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,17 @@ public class SequenceDefinition
{
private final int id;
public int[] frameIDs; // top 16 bits are FrameDefinition ids
public int[] field3048;
public int[] chatFrameIds;
public int[] frameLenghts;
public int rightHandItem = -1;
public int[] frameSounds;
public int frameStep = -1;
public int[] interleaveLeave;
public boolean stretches = false;
public int forcedPriority = 5;
public int leftHandItem = -1;
public int rightHandItem = -1;
public int maxLoops = 99;
public int[] field3056;
public int precedenceAnimating = -1;
public int leftHandItem = -1;
public int replyMode = 2;
public int frameStep = -1;
public int priority = -1;
public int replyMode = 2;
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,9 @@

import net.runelite.cache.definitions.SequenceDefinition;
import net.runelite.cache.io.InputStream;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class SequenceLoader
{
private static final Logger logger = LoggerFactory.getLogger(SequenceLoader.class);

public SequenceDefinition load(int id, byte[] b)
{
SequenceDefinition def = new SequenceDefinition(id);
Expand Down Expand Up @@ -129,26 +125,26 @@ else if (opcode == 11)
else if (opcode == 12)
{
var3 = stream.readUnsignedByte();
def.field3048 = new int[var3];
def.chatFrameIds = new int[var3];

for (var4 = 0; var4 < var3; ++var4)
{
def.field3048[var4] = stream.readUnsignedShort();
def.chatFrameIds[var4] = stream.readUnsignedShort();
}

for (var4 = 0; var4 < var3; ++var4)
{
def.field3048[var4] += stream.readUnsignedShort() << 16;
def.chatFrameIds[var4] += stream.readUnsignedShort() << 16;
}
}
else if (opcode == 13)
{
var3 = stream.readUnsignedByte();
def.field3056 = new int[var3];
def.frameSounds = new int[var3];

for (var4 = 0; var4 < var3; ++var4)
{
def.field3056[var4] = stream.read24BitInt();
def.frameSounds[var4] = stream.read24BitInt();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1180,8 +1180,9 @@ static class ExplorersRing

static class Lms
{
static final int INFO = 2;
static final int INFO = 3;
}

static class LmsKDA
{
static final int INFO = 4;
Expand Down Expand Up @@ -1213,4 +1214,4 @@ static class Skills
{
static final int CONTAINER = 0;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public class RuneLiteProperties
private static final String TROUBLESHOOTING_LINK = "runelite.wiki.troubleshooting.link";
private static final String BUILDING_LINK = "runelite.wiki.building.link";
private static final String DNS_CHANGE_LINK = "runelite.dnschange.link";
private static final String IMGUR_CLIENT_ID = "runelite.imgur.client.id";

private static final Properties properties = new Properties();

Expand Down Expand Up @@ -137,4 +138,9 @@ public static String getLauncherVersion()
String launcherVersion = properties.getProperty(LAUNCHER_VERSION_PROPERTY);
return launcherVersion.equals("-1") ? null : launcherVersion;
}

public static String getImgurClientId()
{
return properties.getProperty(IMGUR_CLIENT_ID);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,5 @@ public class ConfigItemDescriptor
private final Class<?> type;
private final Range range;
private final Alpha alpha;
private final Units units;
}
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,8 @@ public ConfigDescriptor getConfigDescriptor(Object configurationProxy)
m.getDeclaredAnnotation(ConfigItem.class),
m.getReturnType(),
m.getDeclaredAnnotation(Range.class),
m.getDeclaredAnnotation(Alpha.class)
m.getDeclaredAnnotation(Alpha.class),
m.getDeclaredAnnotation(Units.class)
))
.sorted((a, b) -> ComparisonChain.start()
.compare(a.getItem().position(), b.getItem().position())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,7 @@ default boolean enableOpacity()
position = 19,
titleSection = "opacityTitle"
)
@Units(Units.PERCENT)
default int opacityPercentage()
{
return 100;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ default Title uiTitle()
position = 2,
titleSection = "uiTitle"
)
@Units(Units.PIXELS)
default Dimension gameSize()
{
return Constants.GAME_FIXED_SIZE;
Expand Down Expand Up @@ -174,6 +175,7 @@ default WarningOnExit warningOnExit()
position = 12,
titleSection = "miscTitle"
)
@Units(Units.PERCENT)
default int volume()
{
return 100;
Expand Down Expand Up @@ -332,6 +334,17 @@ default boolean menuEntryShift()
return true;
}

@ConfigItem(
keyName = "tooltipPosition",
name = "Tooltip Position",
description = "Configures whether to show the tooltip above or under the cursor",
position = 35
)
default TooltipPositionType tooltipPosition()
{
return TooltipPositionType.UNDER_CURSOR;
}

@ConfigItem(
keyName = "infoBoxVertical",
name = "Display infoboxes vertically",
Expand All @@ -358,11 +371,12 @@ default int infoBoxWrap()

@ConfigItem(
keyName = "infoBoxSize",
name = "Infobox size (px)",
name = "Infobox size",
description = "Configures the size of each infobox in pixels",
position = 28,
titleSection = "infoboxTitle"
)
@Units(Units.PIXELS)
default int infoBoxSize()
{
return 35;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019, Alexsuperfly <https://github.com/Alexsuperfly>
* Copyright (c) 2020, Crypthead <https://github.com/Crypthead>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand All @@ -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.screenshot;
package net.runelite.client.config;

import lombok.RequiredArgsConstructor;
import lombok.Getter;

@Getter
@RequiredArgsConstructor
public enum UploadStyle
public enum TooltipPositionType
{
NEITHER("Neither"),
IMGUR("Imgur"),
CLIPBOARD("Clipboard");
ABOVE_CURSOR("Above cursor"),
UNDER_CURSOR("Under cursor");

private final String name;
private final String type;

@Override
public String toString()
{
return name;
return type;
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/*
* Copyright (c) 2020, Hydrox6 <ikada@protonmail.ch>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 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.config;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
* Used with ConfigItem, defines what units are shown to the side of the box.
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
@Documented
public @interface Units
{
String MILLISECONDS = "ms";
String MINUTES = " mins";
String PERCENT = "%";
String PIXELS = "px";
String POINTS = "pt";
String SECONDS = "s";
String TICKS = " ticks";
String LEVELS = " lvls";
String FPS = " fps";
String GP = " GP";

String value();
}
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,8 @@ private void addSubs(EventBus eventBus, Collection<Subscription> subs)
{
subs.forEach(s -> s.subscribe(eventBus, this));
}

public void resetConfiguration()
{
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import net.runelite.client.config.ConfigItem;
import net.runelite.client.config.ConfigTitleSection;
import net.runelite.client.config.Title;
import net.runelite.client.config.Units;

@ConfigGroup("agility")
public interface AgilityConfig extends Config
Expand Down Expand Up @@ -91,6 +92,7 @@ default boolean showLapCount()
hidden = true,
unhide = "showLapCount"
)
@Units(Units.MINUTES)
default int lapTimeout()
{
return 5;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import net.runelite.client.config.ConfigTitleSection;
import net.runelite.client.config.Range;
import net.runelite.client.config.Title;
import net.runelite.client.config.Units;

@ConfigGroup("aoe")
public interface AoeWarningConfig extends Config
Expand Down Expand Up @@ -124,6 +125,7 @@ default boolean isOutlineEnabled()
titleSection = "overlayTitle",
position = 4
)
@Units(Units.MILLISECONDS)
default int delay()
{
return 300;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import com.google.common.annotations.VisibleForTesting;
import com.google.common.collect.HashMultiset;
import com.google.common.collect.Multiset;
import com.google.common.collect.Lists;
import com.google.inject.Provides;
import java.awt.event.KeyEvent;
import java.awt.event.MouseWheelEvent;
Expand Down Expand Up @@ -100,6 +101,7 @@ public class BankTagsPlugin extends Plugin implements MouseWheelListener, KeyLis
public static final String CONFIG_GROUP = "banktags";
public static final String TAG_SEARCH = "tag:";
public static final String ICON_SEARCH = "icon_";
public static final String TAG_TABS_CONFIG = "tagtabs";
public static final String VAR_TAG_SUFFIX = "*";
private static final String EDIT_TAGS_MENU_OPTION = "Edit-tags";
private static final String NUMBER_REGEX = "[0-9]+(\\.[0-9]+)?[kmb]?";
Expand Down Expand Up @@ -162,6 +164,36 @@ BankTagsConfig getConfig(ConfigManager configManager)
return configManager.getConfig(BankTagsConfig.class);
}

@Override
public void resetConfiguration()
{
List<String> extraKeys = Lists.newArrayList(
CONFIG_GROUP + "." + TagManager.ITEM_KEY_PREFIX,
CONFIG_GROUP + "." + ICON_SEARCH,
CONFIG_GROUP + "." + TAG_TABS_CONFIG
);

for (String prefix : extraKeys)
{
List<String> keys = configManager.getConfigurationKeys(prefix);
for (String key : keys)
{
String[] str = key.split("\\.", 2);
if (str.length == 2)
{
configManager.unsetConfiguration(str[0], str[1]);
}
}
}

clientThread.invokeLater(() ->
{
tabInterface.destroy();
tabInterface.init();
});
}


@Override
public void startUp()
{
Expand Down Expand Up @@ -481,7 +513,7 @@ private void onItemContainerChanged(ItemContainerChanged event)
@Subscribe
private void onConfigChanged(ConfigChanged configChanged)
{
if (configChanged.getGroup().equals("banktags") && configChanged.getKey().equals("useTabs"))
if (configChanged.getGroup().equals(CONFIG_GROUP) && configChanged.getKey().equals("useTabs"))
{
if (config.tabs())
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
@Singleton
public class TagManager
{
private static final String ITEM_KEY_PREFIX = "item_";
static final String ITEM_KEY_PREFIX = "item_";
private final ConfigManager configManager;
private final ItemManager itemManager;
private final ClueScrollService clueScrollService;
Expand Down
Loading