Merge branch 'upstream-master' into runelite

# Conflicts:
#	deobfuscator/src/test/java/net/runelite/deob/deobfuscators/gson/ColorTypeAdapterTest.java
#	deobfuscator/src/test/java/net/runelite/deob/deobfuscators/gson/InstantTypeAdapterTest.java
#	runelite-client/src/main/java/net/runelite/client/RuneLiteModule.java
This commit is contained in:
zeruth
2021-02-01 12:06:49 -05:00
74 changed files with 470 additions and 115 deletions

View File

@@ -25,10 +25,16 @@
package net.runelite.http.api; package net.runelite.http.api;
import com.google.gson.Gson; import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import java.awt.Color;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.time.Instant;
import java.util.Properties; import java.util.Properties;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import net.runelite.http.api.gson.ColorTypeAdapter;
import net.runelite.http.api.gson.InstantTypeAdapter;
import net.runelite.http.api.gson.IllegalReflectionExclusion;
import okhttp3.HttpUrl; import okhttp3.HttpUrl;
import okhttp3.Interceptor; import okhttp3.Interceptor;
import okhttp3.MediaType; import okhttp3.MediaType;
@@ -46,7 +52,7 @@ public class RuneLiteAPI
public static final String RUNELITE_MACHINEID = "RUNELITE-MACHINEID"; public static final String RUNELITE_MACHINEID = "RUNELITE-MACHINEID";
public static final OkHttpClient CLIENT; public static final OkHttpClient CLIENT;
public static final Gson GSON = new Gson(); public static final Gson GSON;
public static final MediaType JSON = MediaType.parse("application/json"); public static final MediaType JSON = MediaType.parse("application/json");
public static String userAgent; public static String userAgent;
@@ -96,6 +102,23 @@ public class RuneLiteAPI
} }
}) })
.build(); .build();
GsonBuilder gsonBuilder = new GsonBuilder();
gsonBuilder
.registerTypeAdapter(Instant.class, new InstantTypeAdapter())
.registerTypeAdapter(Color.class, new ColorTypeAdapter());
boolean assertionsEnabled = false;
assert assertionsEnabled = true;
if (assertionsEnabled)
{
IllegalReflectionExclusion jbe = new IllegalReflectionExclusion();
gsonBuilder.addSerializationExclusionStrategy(jbe);
gsonBuilder.addDeserializationExclusionStrategy(jbe);
}
GSON = gsonBuilder.create();
} }
public static HttpUrl getSessionBase() public static HttpUrl getSessionBase()

View File

@@ -0,0 +1,80 @@
/*
* Copyright (c) 2020 Abex
* 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.http.api.gson;
import com.google.gson.TypeAdapter;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonToken;
import com.google.gson.stream.JsonWriter;
import java.awt.Color;
import java.io.IOException;
public class ColorTypeAdapter extends TypeAdapter<Color>
{
@Override
public void write(JsonWriter out, Color value) throws IOException
{
if (value == null)
{
out.nullValue();
return;
}
int rgba = value.getRGB();
out.beginObject()
.name("value")
.value(rgba)
.endObject();
}
@Override
public Color read(JsonReader in) throws IOException
{
switch (in.peek())
{
case NULL:
in.nextNull();
return null;
case BEGIN_OBJECT:
in.beginObject();
double value = 0;
while (in.peek() != JsonToken.END_OBJECT)
{
switch (in.nextName())
{
case "value":
value = in.nextDouble();
break;
default:
in.skipValue();
break;
}
}
in.endObject();
return new Color((int) value, true);
}
return null; // throws
}
}

View File

@@ -0,0 +1,58 @@
/*
* Copyright (c) 2020 Abex
* 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.http.api.gson;
import com.google.gson.ExclusionStrategy;
import com.google.gson.FieldAttributes;
import java.lang.reflect.Modifier;
public class IllegalReflectionExclusion implements ExclusionStrategy
{
@Override
public boolean shouldSkipField(FieldAttributes f)
{
if (f.getDeclaringClass().getName().startsWith("net.runelite"))
{
return false;
}
assert !Modifier.isPrivate(f.getDeclaringClass().getModifiers()) : "gsoning private class " + f.getDeclaringClass().getName();
try
{
f.getDeclaringClass().getField(f.getName());
}
catch (NoSuchFieldException e)
{
throw new AssertionError("gsoning private field " + f.getDeclaringClass() + "." + f.getName());
}
return false;
}
@Override
public boolean shouldSkipClass(Class<?> clazz)
{
return false;
}
}

View File

@@ -0,0 +1,82 @@
/*
* Copyright (c) 2020 Abex
* 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.http.api.gson;
import com.google.gson.TypeAdapter;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonToken;
import com.google.gson.stream.JsonWriter;
import java.io.IOException;
import java.time.Instant;
// Just add water!
public class InstantTypeAdapter extends TypeAdapter<Instant>
{
@Override
public void write(JsonWriter out, Instant value) throws IOException
{
if (value == null)
{
out.nullValue();
return;
}
out.beginObject()
.name("seconds")
.value(value.getEpochSecond())
.name("nanos")
.value(value.getNano())
.endObject();
}
@Override
public Instant read(JsonReader in) throws IOException
{
if (in.peek() == JsonToken.NULL)
{
in.nextNull();
return null;
}
long seconds = 0;
int nanos = 0;
in.beginObject();
while (in.peek() != JsonToken.END_OBJECT)
{
switch (in.nextName())
{
case "nanos":
nanos = in.nextInt();
break;
case "seconds":
seconds = in.nextLong();
break;
}
}
in.endObject();
return Instant.ofEpochSecond(seconds, nanos);
}
}

View File

@@ -25,11 +25,11 @@
package net.runelite.http.api.ws; package net.runelite.http.api.ws;
import com.google.gson.Gson; import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collection; import java.util.Collection;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import net.runelite.http.api.RuneLiteAPI;
import net.runelite.http.api.ws.messages.Handshake; import net.runelite.http.api.ws.messages.Handshake;
import net.runelite.http.api.ws.messages.LoginResponse; import net.runelite.http.api.ws.messages.LoginResponse;
import net.runelite.http.api.ws.messages.party.Join; import net.runelite.http.api.ws.messages.party.Join;
@@ -76,7 +76,7 @@ public class WebsocketGsonFactory
public static Gson build(final RuntimeTypeAdapterFactory<WebsocketMessage> factory) public static Gson build(final RuntimeTypeAdapterFactory<WebsocketMessage> factory)
{ {
return new GsonBuilder() return RuneLiteAPI.GSON.newBuilder()
.registerTypeAdapterFactory(factory) .registerTypeAdapterFactory(factory)
.create(); .create();
} }

View File

@@ -59,6 +59,13 @@ public interface Tile extends TileObject
*/ */
GroundObject getGroundObject(); GroundObject getGroundObject();
/**
* Sets the object on the ground layer of the tile.
*
* @param groundObject the ground object
*/
void setGroundObject(GroundObject groundObject);
/** /**
* Gets the wall of the tile. * Gets the wall of the tile.
* *

View File

@@ -25,6 +25,7 @@
package net.runelite.client; package net.runelite.client;
import com.google.common.util.concurrent.ThreadFactoryBuilder; import com.google.common.util.concurrent.ThreadFactoryBuilder;
import com.google.gson.Gson;
import com.google.inject.AbstractModule; import com.google.inject.AbstractModule;
import com.google.inject.Provides; import com.google.inject.Provides;
import com.google.inject.name.Names; import com.google.inject.name.Names;
@@ -58,6 +59,7 @@ import net.runelite.client.plugins.PluginManager;
import net.runelite.client.task.Scheduler; import net.runelite.client.task.Scheduler;
import net.runelite.client.util.DeferredEventBus; import net.runelite.client.util.DeferredEventBus;
import net.runelite.client.util.ExecutorServiceExceptionLogger; import net.runelite.client.util.ExecutorServiceExceptionLogger;
import net.runelite.http.api.RuneLiteAPI;
import net.runelite.http.api.chat.ChatClient; import net.runelite.http.api.chat.ChatClient;
import okhttp3.OkHttpClient; import okhttp3.OkHttpClient;
import org.slf4j.Logger; import org.slf4j.Logger;
@@ -95,6 +97,8 @@ public class RuneLiteModule extends AbstractModule
bind(PluginManager.class); bind(PluginManager.class);
bind(SessionManager.class); bind(SessionManager.class);
bind(Gson.class).toInstance(RuneLiteAPI.GSON);
bind(Callbacks.class).to(Hooks.class); bind(Callbacks.class).to(Hooks.class);
bind(EventBus.class) bind(EventBus.class)

View File

@@ -64,6 +64,7 @@ public class SessionManager
private final WSClient wsClient; private final WSClient wsClient;
private final File sessionFile; private final File sessionFile;
private final AccountClient accountClient; private final AccountClient accountClient;
private final Gson gson;
@Inject @Inject
private SessionManager( private SessionManager(
@@ -71,13 +72,15 @@ public class SessionManager
ConfigManager configManager, ConfigManager configManager,
EventBus eventBus, EventBus eventBus,
WSClient wsClient, WSClient wsClient,
OkHttpClient okHttpClient) OkHttpClient okHttpClient,
Gson gson)
{ {
this.configManager = configManager; this.configManager = configManager;
this.eventBus = eventBus; this.eventBus = eventBus;
this.wsClient = wsClient; this.wsClient = wsClient;
this.sessionFile = sessionfile; this.sessionFile = sessionfile;
this.accountClient = new AccountClient(okHttpClient); this.accountClient = new AccountClient(okHttpClient);
this.gson = gson;
eventBus.register(this); eventBus.register(this);
} }
@@ -94,7 +97,7 @@ public class SessionManager
try (FileInputStream in = new FileInputStream(sessionFile)) try (FileInputStream in = new FileInputStream(sessionFile))
{ {
session = new Gson().fromJson(new InputStreamReader(in, StandardCharsets.UTF_8), AccountSession.class); session = gson.fromJson(new InputStreamReader(in, StandardCharsets.UTF_8), AccountSession.class);
log.debug("Loaded session for {}", session.getUsername()); log.debug("Loaded session for {}", session.getUsername());
} }
@@ -124,7 +127,7 @@ public class SessionManager
try (Writer fw = new OutputStreamWriter(new FileOutputStream(sessionFile), StandardCharsets.UTF_8)) try (Writer fw = new OutputStreamWriter(new FileOutputStream(sessionFile), StandardCharsets.UTF_8))
{ {
new Gson().toJson(accountSession, fw); gson.toJson(accountSession, fw);
log.debug("Saved session to {}", sessionFile); log.debug("Saved session to {}", sessionFile);
} }

View File

@@ -159,7 +159,7 @@ public class Keybind
String mod = ""; String mod = "";
if (modifiers != 0) if (modifiers != 0)
{ {
mod = getModifiersExText(modifiers); mod = InputEvent.getModifiersExText(modifiers);
} }
if (mod.isEmpty() && key.isEmpty()) if (mod.isEmpty() && key.isEmpty())
@@ -177,33 +177,6 @@ public class Keybind
return mod; return mod;
} }
public static String getModifiersExText(int modifiers)
{
StringBuilder buf = new StringBuilder();
if ((modifiers & InputEvent.META_DOWN_MASK) != 0)
{
buf.append("Meta+");
}
if ((modifiers & InputEvent.CTRL_DOWN_MASK) != 0)
{
buf.append("Ctrl+");
}
if ((modifiers & InputEvent.ALT_DOWN_MASK) != 0)
{
buf.append("Alt+");
}
if ((modifiers & InputEvent.SHIFT_DOWN_MASK) != 0)
{
buf.append("Shift+");
}
if (buf.length() > 0)
{
buf.setLength(buf.length() - 1); // remove trailing '+'
}
return buf.toString();
}
@Nullable @Nullable
public static Integer getModifierForKeyCode(int keyCode) public static Integer getModifierForKeyCode(int keyCode)
{ {

View File

@@ -24,18 +24,32 @@
*/ */
package net.runelite.client.externalplugins; package net.runelite.client.externalplugins;
import java.lang.invoke.MethodHandles;
import java.net.URL; import java.net.URL;
import java.net.URLClassLoader; import java.net.URLClassLoader;
import lombok.Getter; import lombok.Getter;
import lombok.Setter;
import net.runelite.client.util.ReflectUtil;
class ExternalPluginClassLoader extends URLClassLoader class ExternalPluginClassLoader extends URLClassLoader implements ReflectUtil.PrivateLookupableClassLoader
{ {
@Getter @Getter
private final ExternalPluginManifest manifest; private final ExternalPluginManifest manifest;
@Getter
@Setter
private MethodHandles.Lookup lookup;
ExternalPluginClassLoader(ExternalPluginManifest manifest, URL[] urls) ExternalPluginClassLoader(ExternalPluginManifest manifest, URL[] urls)
{ {
super(urls, ExternalPluginClassLoader.class.getClassLoader()); super(urls, ExternalPluginClassLoader.class.getClassLoader());
this.manifest = manifest; this.manifest = manifest;
ReflectUtil.installLookupHelper(this);
}
@Override
public Class<?> defineClass0(String name, byte[] b, int off, int len) throws ClassFormatError
{
return super.defineClass(name, b, off, len);
} }
} }

View File

@@ -25,6 +25,7 @@
package net.runelite.client.externalplugins; package net.runelite.client.externalplugins;
import com.google.common.reflect.TypeToken; import com.google.common.reflect.TypeToken;
import com.google.gson.Gson;
import com.google.gson.JsonSyntaxException; import com.google.gson.JsonSyntaxException;
import java.awt.image.BufferedImage; import java.awt.image.BufferedImage;
import java.io.ByteArrayInputStream; import java.io.ByteArrayInputStream;
@@ -59,11 +60,13 @@ import okio.BufferedSource;
public class ExternalPluginClient public class ExternalPluginClient
{ {
private final OkHttpClient okHttpClient; private final OkHttpClient okHttpClient;
private final Gson gson;
@Inject @Inject
private ExternalPluginClient(OkHttpClient okHttpClient) private ExternalPluginClient(OkHttpClient okHttpClient, Gson gson)
{ {
this.okHttpClient = okHttpClient; this.okHttpClient = okHttpClient;
this.gson = gson;
} }
public List<ExternalPluginManifest> downloadManifest() throws IOException, VerificationException public List<ExternalPluginManifest> downloadManifest() throws IOException, VerificationException
@@ -94,7 +97,7 @@ public class ExternalPluginClient
throw new VerificationException("Unable to verify external plugin manifest"); throw new VerificationException("Unable to verify external plugin manifest");
} }
return RuneLiteAPI.GSON.fromJson(new String(data, StandardCharsets.UTF_8), return gson.fromJson(new String(data, StandardCharsets.UTF_8),
new TypeToken<List<ExternalPluginManifest>>() new TypeToken<List<ExternalPluginManifest>>()
{ {
}.getType()); }.getType());
@@ -156,7 +159,7 @@ public class ExternalPluginClient
Request request = new Request.Builder() Request request = new Request.Builder()
.url(url) .url(url)
.post(RequestBody.create(RuneLiteAPI.JSON, RuneLiteAPI.GSON.toJson(plugins))) .post(RequestBody.create(RuneLiteAPI.JSON, gson.toJson(plugins)))
.build(); .build();
okHttpClient.newCall(request).enqueue(new Callback() okHttpClient.newCall(request).enqueue(new Callback()
@@ -190,7 +193,7 @@ public class ExternalPluginClient
} }
// CHECKSTYLE:OFF // CHECKSTYLE:OFF
return RuneLiteAPI.GSON.fromJson(new InputStreamReader(res.body().byteStream()), new TypeToken<Map<String, Integer>>(){}.getType()); return gson.fromJson(new InputStreamReader(res.body().byteStream()), new TypeToken<Map<String, Integer>>(){}.getType());
// CHECKSTYLE:ON // CHECKSTYLE:ON
} }
catch (JsonSyntaxException ex) catch (JsonSyntaxException ex)

View File

@@ -34,6 +34,7 @@ import static net.runelite.api.MenuAction.RUNELITE_OVERLAY_CONFIG;
import net.runelite.api.Varbits; import net.runelite.api.Varbits;
import net.runelite.api.widgets.Widget; import net.runelite.api.widgets.Widget;
import net.runelite.api.widgets.WidgetInfo; import net.runelite.api.widgets.WidgetInfo;
import net.runelite.client.ui.FontManager;
import static net.runelite.client.ui.overlay.OverlayManager.OPTION_CONFIGURE; import static net.runelite.client.ui.overlay.OverlayManager.OPTION_CONFIGURE;
import net.runelite.client.ui.overlay.OverlayMenuEntry; import net.runelite.client.ui.overlay.OverlayMenuEntry;
import net.runelite.client.ui.overlay.OverlayPanel; import net.runelite.client.ui.overlay.OverlayPanel;
@@ -82,6 +83,7 @@ public class BarrowsBrotherSlainOverlay extends OverlayPanel
panelComponent.getChildren().add(LineComponent.builder() panelComponent.getChildren().add(LineComponent.builder()
.left(brother.getName()) .left(brother.getName())
.right(slain) .right(slain)
.rightFont(FontManager.getDefaultFont())
.rightColor(brotherSlain ? Color.GREEN : Color.RED) .rightColor(brotherSlain ? Color.GREEN : Color.RED)
.build()); .build());
} }

View File

@@ -45,6 +45,7 @@ import net.runelite.api.coords.LocalPoint;
import net.runelite.api.coords.WorldPoint; import net.runelite.api.coords.WorldPoint;
import static net.runelite.client.plugins.cluescrolls.ClueScrollOverlay.TITLED_CONTENT_COLOR; import static net.runelite.client.plugins.cluescrolls.ClueScrollOverlay.TITLED_CONTENT_COLOR;
import net.runelite.client.plugins.cluescrolls.ClueScrollPlugin; import net.runelite.client.plugins.cluescrolls.ClueScrollPlugin;
import static net.runelite.client.plugins.cluescrolls.clues.Enemy.*;
import net.runelite.client.plugins.cluescrolls.clues.emote.Emote; import net.runelite.client.plugins.cluescrolls.clues.emote.Emote;
import static net.runelite.client.plugins.cluescrolls.clues.emote.Emote.*; import static net.runelite.client.plugins.cluescrolls.clues.emote.Emote.*;
import static net.runelite.client.plugins.cluescrolls.clues.emote.Emote.BULL_ROARER; import static net.runelite.client.plugins.cluescrolls.clues.emote.Emote.BULL_ROARER;
@@ -53,7 +54,7 @@ import static net.runelite.client.plugins.cluescrolls.clues.emote.STASHUnit.*;
import static net.runelite.client.plugins.cluescrolls.clues.emote.STASHUnit.SHANTAY_PASS; import static net.runelite.client.plugins.cluescrolls.clues.emote.STASHUnit.SHANTAY_PASS;
import net.runelite.client.plugins.cluescrolls.clues.item.ItemRequirement; import net.runelite.client.plugins.cluescrolls.clues.item.ItemRequirement;
import static net.runelite.client.plugins.cluescrolls.clues.item.ItemRequirements.*; import static net.runelite.client.plugins.cluescrolls.clues.item.ItemRequirements.*;
import static net.runelite.client.plugins.cluescrolls.clues.Enemy.*; import net.runelite.client.ui.FontManager;
import net.runelite.client.ui.overlay.OverlayUtil; import net.runelite.client.ui.overlay.OverlayUtil;
import net.runelite.client.ui.overlay.components.LineComponent; import net.runelite.client.ui.overlay.components.LineComponent;
import net.runelite.client.ui.overlay.components.PanelComponent; import net.runelite.client.ui.overlay.components.PanelComponent;
@@ -258,6 +259,7 @@ public class EmoteClue extends ClueScroll implements TextClueScroll, LocationClu
panelComponent.getChildren().add(LineComponent.builder() panelComponent.getChildren().add(LineComponent.builder()
.left("STASH Unit:") .left("STASH Unit:")
.right(stashUnitBuilt ? UNICODE_CHECK_MARK : UNICODE_BALLOT_X) .right(stashUnitBuilt ? UNICODE_CHECK_MARK : UNICODE_BALLOT_X)
.rightFont(FontManager.getDefaultFont())
.rightColor(stashUnitBuilt ? Color.GREEN : Color.RED) .rightColor(stashUnitBuilt ? Color.GREEN : Color.RED)
.build()); .build());
} }
@@ -292,6 +294,7 @@ public class EmoteClue extends ClueScroll implements TextClueScroll, LocationClu
.left(requirement.getCollectiveName(client)) .left(requirement.getCollectiveName(client))
.leftColor(TITLED_CONTENT_COLOR) .leftColor(TITLED_CONTENT_COLOR)
.right(combinedFulfilled ? UNICODE_CHECK_MARK : UNICODE_BALLOT_X) .right(combinedFulfilled ? UNICODE_CHECK_MARK : UNICODE_BALLOT_X)
.rightFont(FontManager.getDefaultFont())
.rightColor(equipmentFulfilled ? Color.GREEN : (combinedFulfilled ? Color.ORANGE : Color.RED)) .rightColor(equipmentFulfilled ? Color.GREEN : (combinedFulfilled ? Color.ORANGE : Color.RED))
.build()); .build());
} }

View File

@@ -41,6 +41,7 @@ import net.runelite.client.plugins.cluescrolls.clues.item.AnyRequirementCollecti
import net.runelite.client.plugins.cluescrolls.clues.item.ItemRequirement; import net.runelite.client.plugins.cluescrolls.clues.item.ItemRequirement;
import net.runelite.client.plugins.cluescrolls.clues.item.RangeItemRequirement; import net.runelite.client.plugins.cluescrolls.clues.item.RangeItemRequirement;
import net.runelite.client.plugins.cluescrolls.clues.item.SingleItemRequirement; import net.runelite.client.plugins.cluescrolls.clues.item.SingleItemRequirement;
import net.runelite.client.ui.FontManager;
import net.runelite.client.ui.overlay.OverlayUtil; import net.runelite.client.ui.overlay.OverlayUtil;
import net.runelite.client.ui.overlay.components.LineComponent; import net.runelite.client.ui.overlay.components.LineComponent;
import net.runelite.client.ui.overlay.components.PanelComponent; import net.runelite.client.ui.overlay.components.PanelComponent;
@@ -134,6 +135,7 @@ public class FaloTheBardClue extends ClueScroll implements TextClueScroll, NpcCl
.left(requirement.getCollectiveName(plugin.getClient())) .left(requirement.getCollectiveName(plugin.getClient()))
.leftColor(TITLED_CONTENT_COLOR) .leftColor(TITLED_CONTENT_COLOR)
.right(inventoryFulfilled ? "\u2713" : "\u2717") .right(inventoryFulfilled ? "\u2713" : "\u2717")
.rightFont(FontManager.getDefaultFont())
.rightColor(inventoryFulfilled ? Color.GREEN : Color.RED) .rightColor(inventoryFulfilled ? Color.GREEN : Color.RED)
.build()); .build());
} }

View File

@@ -25,6 +25,11 @@
package net.runelite.client.plugins.cluescrolls.clues; package net.runelite.client.plugins.cluescrolls.clues;
import com.google.common.collect.ImmutableSet; import com.google.common.collect.ImmutableSet;
import java.awt.Color;
import java.awt.Graphics2D;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
@@ -34,25 +39,21 @@ import net.runelite.api.ItemID;
import net.runelite.api.NPC; import net.runelite.api.NPC;
import net.runelite.api.Point; import net.runelite.api.Point;
import net.runelite.api.TileObject; import net.runelite.api.TileObject;
import static net.runelite.client.plugins.cluescrolls.ClueScrollOverlay.TITLED_CONTENT_COLOR;
import net.runelite.client.plugins.cluescrolls.ClueScrollPlugin; import net.runelite.client.plugins.cluescrolls.ClueScrollPlugin;
import static net.runelite.client.plugins.cluescrolls.ClueScrollWorldOverlay.CLICKBOX_BORDER_COLOR; import static net.runelite.client.plugins.cluescrolls.ClueScrollWorldOverlay.CLICKBOX_BORDER_COLOR;
import static net.runelite.client.plugins.cluescrolls.ClueScrollWorldOverlay.CLICKBOX_FILL_COLOR; import static net.runelite.client.plugins.cluescrolls.ClueScrollWorldOverlay.CLICKBOX_FILL_COLOR;
import static net.runelite.client.plugins.cluescrolls.ClueScrollWorldOverlay.CLICKBOX_HOVER_BORDER_COLOR; import static net.runelite.client.plugins.cluescrolls.ClueScrollWorldOverlay.CLICKBOX_HOVER_BORDER_COLOR;
import static net.runelite.client.plugins.cluescrolls.ClueScrollWorldOverlay.IMAGE_Z_OFFSET;
import net.runelite.client.plugins.cluescrolls.clues.item.AnyRequirementCollection; import net.runelite.client.plugins.cluescrolls.clues.item.AnyRequirementCollection;
import static net.runelite.client.plugins.cluescrolls.clues.item.ItemRequirements.*;
import net.runelite.client.plugins.cluescrolls.clues.item.ItemRequirement; import net.runelite.client.plugins.cluescrolls.clues.item.ItemRequirement;
import static net.runelite.client.plugins.cluescrolls.clues.item.ItemRequirements.*;
import net.runelite.client.plugins.cluescrolls.clues.item.SingleItemRequirement; import net.runelite.client.plugins.cluescrolls.clues.item.SingleItemRequirement;
import net.runelite.client.ui.FontManager;
import net.runelite.client.ui.overlay.OverlayUtil; import net.runelite.client.ui.overlay.OverlayUtil;
import net.runelite.client.ui.overlay.components.LineComponent; import net.runelite.client.ui.overlay.components.LineComponent;
import net.runelite.client.ui.overlay.components.PanelComponent; import net.runelite.client.ui.overlay.components.PanelComponent;
import net.runelite.client.ui.overlay.components.TitleComponent; import net.runelite.client.ui.overlay.components.TitleComponent;
import java.awt.Color;
import java.awt.Graphics2D;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import static net.runelite.client.plugins.cluescrolls.ClueScrollOverlay.TITLED_CONTENT_COLOR;
import static net.runelite.client.plugins.cluescrolls.ClueScrollWorldOverlay.IMAGE_Z_OFFSET;
@Getter @Getter
public class SkillChallengeClue extends ClueScroll implements NpcClueScroll, NamedObjectClueScroll public class SkillChallengeClue extends ClueScroll implements NpcClueScroll, NamedObjectClueScroll
@@ -379,6 +380,7 @@ public class SkillChallengeClue extends ClueScroll implements NpcClueScroll, Nam
.left(requirement.getCollectiveName(plugin.getClient())) .left(requirement.getCollectiveName(plugin.getClient()))
.leftColor(TITLED_CONTENT_COLOR) .leftColor(TITLED_CONTENT_COLOR)
.right(combinedFulfilled ? "\u2713" : "\u2717") .right(combinedFulfilled ? "\u2713" : "\u2717")
.rightFont(FontManager.getDefaultFont())
.rightColor(equipmentFulfilled || (combinedFulfilled && !requireEquipped) ? Color.GREEN : (combinedFulfilled ? Color.ORANGE : Color.RED)) .rightColor(equipmentFulfilled || (combinedFulfilled && !requireEquipped) ? Color.GREEN : (combinedFulfilled ? Color.ORANGE : Color.RED))
.build()); .build());
} }

View File

@@ -32,6 +32,7 @@ import javax.swing.JButton;
import lombok.Getter; import lombok.Getter;
import net.runelite.client.config.Keybind; import net.runelite.client.config.Keybind;
import net.runelite.client.config.ModifierlessKeybind; import net.runelite.client.config.ModifierlessKeybind;
import net.runelite.client.ui.FontManager;
class HotkeyButton extends JButton class HotkeyButton extends JButton
{ {
@@ -40,6 +41,7 @@ class HotkeyButton extends JButton
public HotkeyButton(Keybind value, boolean modifierless) public HotkeyButton(Keybind value, boolean modifierless)
{ {
setFont(FontManager.getDefaultFont().deriveFont(12.f));
setValue(value); setValue(value);
addMouseListener(new MouseAdapter() addMouseListener(new MouseAdapter()
{ {

View File

@@ -32,7 +32,6 @@ import java.util.List;
import javax.inject.Inject; import javax.inject.Inject;
import javax.inject.Singleton; import javax.inject.Singleton;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import net.runelite.http.api.RuneLiteAPI;
import okhttp3.Call; import okhttp3.Call;
import okhttp3.Callback; import okhttp3.Callback;
import okhttp3.MediaType; import okhttp3.MediaType;
@@ -47,11 +46,13 @@ public class CrowdsourcingManager
{ {
private static final String CROWDSOURCING_BASE = "https://crowdsource.runescape.wiki/runelite"; private static final String CROWDSOURCING_BASE = "https://crowdsource.runescape.wiki/runelite";
private static final MediaType JSON = MediaType.parse("application/json; charset=utf-8"); private static final MediaType JSON = MediaType.parse("application/json; charset=utf-8");
private static final Gson GSON = RuneLiteAPI.GSON;
@Inject @Inject
private OkHttpClient okHttpClient; private OkHttpClient okHttpClient;
@Inject
private Gson gson;
private List<Object> data = new ArrayList<>(); private List<Object> data = new ArrayList<>();
public void storeEvent(Object event) public void storeEvent(Object event)
@@ -77,7 +78,7 @@ public class CrowdsourcingManager
Request r = new Request.Builder() Request r = new Request.Builder()
.url(CROWDSOURCING_BASE) .url(CROWDSOURCING_BASE)
.post(RequestBody.create(JSON, GSON.toJson(temp))) .post(RequestBody.create(JSON, gson.toJson(temp)))
.build(); .build();
okHttpClient.newCall(r).enqueue(new Callback() okHttpClient.newCall(r).enqueue(new Callback()

View File

@@ -128,7 +128,6 @@ public class GrandExchangePlugin extends Plugin
private static final String BUY_LIMIT_GE_TEXT = "<br>Buy limit: "; private static final String BUY_LIMIT_GE_TEXT = "<br>Buy limit: ";
private static final String BUY_LIMIT_KEY = "buylimit"; private static final String BUY_LIMIT_KEY = "buylimit";
private static final Gson GSON = new Gson();
private static final Duration BUY_LIMIT_RESET = Duration.ofHours(4); private static final Duration BUY_LIMIT_RESET = Duration.ofHours(4);
static final String SEARCH_GRAND_EXCHANGE = "Search Grand Exchange"; static final String SEARCH_GRAND_EXCHANGE = "Search Grand Exchange";
@@ -183,6 +182,9 @@ public class GrandExchangePlugin extends Plugin
@Inject @Inject
private ConfigManager configManager; private ConfigManager configManager;
@Inject
private Gson gson;
private Widget grandExchangeText; private Widget grandExchangeText;
private Widget grandExchangeItem; private Widget grandExchangeItem;
private String grandExchangeExamine; private String grandExchangeExamine;
@@ -253,12 +255,12 @@ public class GrandExchangePlugin extends Plugin
{ {
return null; return null;
} }
return GSON.fromJson(offer, SavedOffer.class); return gson.fromJson(offer, SavedOffer.class);
} }
private void setOffer(int slot, SavedOffer offer) private void setOffer(int slot, SavedOffer offer)
{ {
configManager.setRSProfileConfiguration("geoffer", Integer.toString(slot), GSON.toJson(offer)); configManager.setRSProfileConfiguration("geoffer", Integer.toString(slot), gson.toJson(offer));
} }
private void deleteOffer(int slot) private void deleteOffer(int slot)

View File

@@ -73,8 +73,6 @@ public class GroundMarkerPlugin extends Plugin
private static final String WALK_HERE = "Walk here"; private static final String WALK_HERE = "Walk here";
private static final String REGION_PREFIX = "region_"; private static final String REGION_PREFIX = "region_";
private static final Gson GSON = new Gson();
@Getter(AccessLevel.PACKAGE) @Getter(AccessLevel.PACKAGE)
private final List<ColorTileMarker> points = new ArrayList<>(); private final List<ColorTileMarker> points = new ArrayList<>();
@@ -105,6 +103,9 @@ public class GroundMarkerPlugin extends Plugin
@Inject @Inject
private GroundMarkerSharingManager sharingManager; private GroundMarkerSharingManager sharingManager;
@Inject
private Gson gson;
void savePoints(int regionId, Collection<GroundMarkerPoint> points) void savePoints(int regionId, Collection<GroundMarkerPoint> points)
{ {
if (points == null || points.isEmpty()) if (points == null || points.isEmpty())
@@ -113,7 +114,7 @@ public class GroundMarkerPlugin extends Plugin
return; return;
} }
String json = GSON.toJson(points); String json = gson.toJson(points);
configManager.setConfiguration(CONFIG_GROUP, REGION_PREFIX + regionId, json); configManager.setConfiguration(CONFIG_GROUP, REGION_PREFIX + regionId, json);
} }
@@ -126,7 +127,7 @@ public class GroundMarkerPlugin extends Plugin
} }
// CHECKSTYLE:OFF // CHECKSTYLE:OFF
return GSON.fromJson(json, new TypeToken<List<GroundMarkerPoint>>(){}.getType()); return gson.fromJson(json, new TypeToken<List<GroundMarkerPoint>>(){}.getType());
// CHECKSTYLE:ON // CHECKSTYLE:ON
} }

View File

@@ -53,7 +53,6 @@ import net.runelite.client.eventbus.Subscribe;
import net.runelite.client.game.chatbox.ChatboxPanelManager; import net.runelite.client.game.chatbox.ChatboxPanelManager;
import net.runelite.client.menus.MenuManager; import net.runelite.client.menus.MenuManager;
import net.runelite.client.menus.WidgetMenuOption; import net.runelite.client.menus.WidgetMenuOption;
import net.runelite.http.api.RuneLiteAPI;
@Slf4j @Slf4j
class GroundMarkerSharingManager class GroundMarkerSharingManager
@@ -61,22 +60,23 @@ class GroundMarkerSharingManager
private static final WidgetMenuOption EXPORT_MARKERS_OPTION = new WidgetMenuOption("Export", "Ground Markers", WORLD_MAP_OPTION); private static final WidgetMenuOption EXPORT_MARKERS_OPTION = new WidgetMenuOption("Export", "Ground Markers", WORLD_MAP_OPTION);
private static final WidgetMenuOption IMPORT_MARKERS_OPTION = new WidgetMenuOption("Import", "Ground Markers", WORLD_MAP_OPTION); private static final WidgetMenuOption IMPORT_MARKERS_OPTION = new WidgetMenuOption("Import", "Ground Markers", WORLD_MAP_OPTION);
private static final Gson GSON = RuneLiteAPI.GSON;
private final GroundMarkerPlugin plugin; private final GroundMarkerPlugin plugin;
private final Client client; private final Client client;
private final MenuManager menuManager; private final MenuManager menuManager;
private final ChatMessageManager chatMessageManager; private final ChatMessageManager chatMessageManager;
private final ChatboxPanelManager chatboxPanelManager; private final ChatboxPanelManager chatboxPanelManager;
private final Gson gson;
@Inject @Inject
private GroundMarkerSharingManager(GroundMarkerPlugin plugin, Client client, MenuManager menuManager, ChatMessageManager chatMessageManager, ChatboxPanelManager chatboxPanelManager) private GroundMarkerSharingManager(GroundMarkerPlugin plugin, Client client, MenuManager menuManager,
ChatMessageManager chatMessageManager, ChatboxPanelManager chatboxPanelManager, Gson gson)
{ {
this.plugin = plugin; this.plugin = plugin;
this.client = client; this.client = client;
this.menuManager = menuManager; this.menuManager = menuManager;
this.chatMessageManager = chatMessageManager; this.chatMessageManager = chatMessageManager;
this.chatboxPanelManager = chatboxPanelManager; this.chatboxPanelManager = chatboxPanelManager;
this.gson = gson;
} }
void addMenuOptions() void addMenuOptions()
@@ -135,7 +135,7 @@ class GroundMarkerSharingManager
return; return;
} }
final String exportDump = GSON.toJson(activePoints); final String exportDump = gson.toJson(activePoints);
log.debug("Exported ground markers: {}", exportDump); log.debug("Exported ground markers: {}", exportDump);
@@ -173,7 +173,7 @@ class GroundMarkerSharingManager
try try
{ {
// CHECKSTYLE:OFF // CHECKSTYLE:OFF
importPoints = GSON.fromJson(clipboardText, new TypeToken<List<GroundMarkerPoint>>(){}.getType()); importPoints = gson.fromJson(clipboardText, new TypeToken<List<GroundMarkerPoint>>(){}.getType());
// CHECKSTYLE:ON // CHECKSTYLE:ON
} }
catch (JsonSyntaxException e) catch (JsonSyntaxException e)

View File

@@ -88,7 +88,6 @@ public class ObjectIndicatorsPlugin extends Plugin
private static final String MARK = "Mark object"; private static final String MARK = "Mark object";
private static final String UNMARK = "Unmark object"; private static final String UNMARK = "Unmark object";
private final Gson GSON = new Gson();
@Getter(AccessLevel.PACKAGE) @Getter(AccessLevel.PACKAGE)
private final List<ColorTileObject> objects = new ArrayList<>(); private final List<ColorTileObject> objects = new ArrayList<>();
private final Map<Integer, Set<ObjectPoint>> points = new HashMap<>(); private final Map<Integer, Set<ObjectPoint>> points = new HashMap<>();
@@ -108,6 +107,9 @@ public class ObjectIndicatorsPlugin extends Plugin
@Inject @Inject
private ObjectIndicatorsConfig config; private ObjectIndicatorsConfig config;
@Inject
private Gson gson;
@Provides @Provides
ObjectIndicatorsConfig provideConfig(ConfigManager configManager) ObjectIndicatorsConfig provideConfig(ConfigManager configManager)
{ {
@@ -428,7 +430,7 @@ public class ObjectIndicatorsPlugin extends Plugin
} }
else else
{ {
final String json = GSON.toJson(points); final String json = gson.toJson(points);
configManager.setConfiguration(CONFIG_GROUP, "region_" + id, json); configManager.setConfiguration(CONFIG_GROUP, "region_" + id, json);
} }
} }
@@ -442,7 +444,7 @@ public class ObjectIndicatorsPlugin extends Plugin
return null; return null;
} }
Set<ObjectPoint> points = GSON.fromJson(json, new TypeToken<Set<ObjectPoint>>() Set<ObjectPoint> points = gson.fromJson(json, new TypeToken<Set<ObjectPoint>>()
{ {
}.getType()); }.getType());
// Prior to multiloc support the plugin would mark objects named "null", which breaks // Prior to multiloc support the plugin would mark objects named "null", which breaks

View File

@@ -88,6 +88,9 @@ public class ScreenMarkerPlugin extends Plugin
@Inject @Inject
private ScreenMarkerCreationOverlay overlay; private ScreenMarkerCreationOverlay overlay;
@Inject
private Gson gson;
@Getter @Getter
@Inject @Inject
private ColorPickerManager colorPickerManager; private ColorPickerManager colorPickerManager;
@@ -266,7 +269,6 @@ public class ScreenMarkerPlugin extends Plugin
return; return;
} }
final Gson gson = new Gson();
final String json = gson final String json = gson
.toJson(screenMarkers.stream().map(ScreenMarkerOverlay::getMarker).collect(Collectors.toList())); .toJson(screenMarkers.stream().map(ScreenMarkerOverlay::getMarker).collect(Collectors.toList()));
configManager.setConfiguration(CONFIG_GROUP, CONFIG_KEY, json); configManager.setConfiguration(CONFIG_GROUP, CONFIG_KEY, json);
@@ -279,7 +281,6 @@ public class ScreenMarkerPlugin extends Plugin
return Stream.empty(); return Stream.empty();
} }
final Gson gson = new Gson();
final List<ScreenMarker> screenMarkerData = gson.fromJson(json, new TypeToken<ArrayList<ScreenMarker>>() final List<ScreenMarker> screenMarkerData = gson.fromJson(json, new TypeToken<ArrayList<ScreenMarker>>()
{ {
}.getType()); }.getType());

View File

@@ -53,6 +53,9 @@ public class ClockManager
@Inject @Inject
private Notifier notifier; private Notifier notifier;
@Inject
private Gson gson;
@Getter @Getter
private final List<Timer> timers = new CopyOnWriteArrayList<>(); private final List<Timer> timers = new CopyOnWriteArrayList<>();
@@ -183,7 +186,6 @@ public class ClockManager
if (!Strings.isNullOrEmpty(timersJson)) if (!Strings.isNullOrEmpty(timersJson))
{ {
final Gson gson = new Gson();
final List<Timer> timers = gson.fromJson(timersJson, new TypeToken<ArrayList<Timer>>() final List<Timer> timers = gson.fromJson(timersJson, new TypeToken<ArrayList<Timer>>()
{ {
}.getType()); }.getType());
@@ -200,7 +202,6 @@ public class ClockManager
if (!Strings.isNullOrEmpty(stopwatchesJson)) if (!Strings.isNullOrEmpty(stopwatchesJson))
{ {
final Gson gson = new Gson();
final List<Stopwatch> stopwatches = gson.fromJson(stopwatchesJson, new TypeToken<ArrayList<Stopwatch>>() final List<Stopwatch> stopwatches = gson.fromJson(stopwatchesJson, new TypeToken<ArrayList<Stopwatch>>()
{ {
}.getType()); }.getType());
@@ -227,14 +228,12 @@ public class ClockManager
void saveTimers() void saveTimers()
{ {
final Gson gson = new Gson();
final String json = gson.toJson(timers); final String json = gson.toJson(timers);
configManager.setConfiguration(TimeTrackingConfig.CONFIG_GROUP, TimeTrackingConfig.TIMERS, json); configManager.setConfiguration(TimeTrackingConfig.CONFIG_GROUP, TimeTrackingConfig.TIMERS, json);
} }
void saveStopwatches() void saveStopwatches()
{ {
final Gson gson = new Gson();
final String json = gson.toJson(stopwatches); final String json = gson.toJson(stopwatches);
configManager.setConfiguration(TimeTrackingConfig.CONFIG_GROUP, TimeTrackingConfig.STOPWATCHES, json); configManager.setConfiguration(TimeTrackingConfig.CONFIG_GROUP, TimeTrackingConfig.STOPWATCHES, json);
} }

View File

@@ -67,7 +67,6 @@ public class WikiSearchChatboxTextInput extends ChatboxTextInput
private static final int PREDICTION_DEBOUNCE_DELAY_MS = 200; private static final int PREDICTION_DEBOUNCE_DELAY_MS = 200;
private final ChatboxPanelManager chatboxPanelManager; private final ChatboxPanelManager chatboxPanelManager;
private final Gson gson = new Gson();
private Future<?> runningRequest = null; private Future<?> runningRequest = null;
private List<String> predictions = ImmutableList.of(); private List<String> predictions = ImmutableList.of();
@@ -78,7 +77,7 @@ public class WikiSearchChatboxTextInput extends ChatboxTextInput
@Inject @Inject
public WikiSearchChatboxTextInput(ChatboxPanelManager chatboxPanelManager, ClientThread clientThread, public WikiSearchChatboxTextInput(ChatboxPanelManager chatboxPanelManager, ClientThread clientThread,
ScheduledExecutorService scheduledExecutorService, @Named("developerMode") final boolean developerMode, ScheduledExecutorService scheduledExecutorService, @Named("developerMode") final boolean developerMode,
OkHttpClient okHttpClient) OkHttpClient okHttpClient, Gson gson)
{ {
super(chatboxPanelManager, clientThread); super(chatboxPanelManager, clientThread);
this.chatboxPanelManager = chatboxPanelManager; this.chatboxPanelManager = chatboxPanelManager;

View File

@@ -24,17 +24,25 @@
*/ */
package net.runelite.client.ui; package net.runelite.client.ui;
import javax.swing.text.StyleContext;
import java.awt.Font; import java.awt.Font;
import java.awt.FontFormatException; import java.awt.FontFormatException;
import java.awt.GraphicsEnvironment; import java.awt.GraphicsEnvironment;
import java.io.IOException; import java.io.IOException;
import javax.swing.text.StyleContext;
import lombok.Getter;
public class FontManager public class FontManager
{ {
@Getter
private static final Font runescapeFont; private static final Font runescapeFont;
@Getter
private static final Font runescapeSmallFont; private static final Font runescapeSmallFont;
@Getter
private static final Font runescapeBoldFont; private static final Font runescapeBoldFont;
@Getter
private static final Font defaultFont;
@Getter
private static final Font defaultBoldFont;
static static
{ {
@@ -48,7 +56,7 @@ public class FontManager
ge.registerFont(font); ge.registerFont(font);
runescapeFont = StyleContext.getDefaultStyleContext() runescapeFont = StyleContext.getDefaultStyleContext()
.getFont(font.getName(), Font.PLAIN, 16); .getFont(font.getName(), Font.PLAIN, 16);
ge.registerFont(runescapeFont); ge.registerFont(runescapeFont);
Font smallFont = Font.createFont(Font.TRUETYPE_FONT, Font smallFont = Font.createFont(Font.TRUETYPE_FONT,
@@ -57,16 +65,16 @@ public class FontManager
ge.registerFont(smallFont); ge.registerFont(smallFont);
runescapeSmallFont = StyleContext.getDefaultStyleContext() runescapeSmallFont = StyleContext.getDefaultStyleContext()
.getFont(smallFont.getName(), Font.PLAIN, 16); .getFont(smallFont.getName(), Font.PLAIN, 16);
ge.registerFont(runescapeSmallFont); ge.registerFont(runescapeSmallFont);
Font boldFont = Font.createFont(Font.TRUETYPE_FONT, Font boldFont = Font.createFont(Font.TRUETYPE_FONT,
FontManager.class.getResourceAsStream("runescape_bold.ttf")) FontManager.class.getResourceAsStream("runescape_bold.ttf"))
.deriveFont(Font.BOLD, 16); .deriveFont(Font.BOLD, 16);
ge.registerFont(boldFont); ge.registerFont(boldFont);
runescapeBoldFont = StyleContext.getDefaultStyleContext() runescapeBoldFont = StyleContext.getDefaultStyleContext()
.getFont(boldFont.getName(), Font.BOLD, 16); .getFont(boldFont.getName(), Font.BOLD, 16);
ge.registerFont(runescapeBoldFont); ge.registerFont(runescapeBoldFont);
} }
catch (FontFormatException ex) catch (FontFormatException ex)
@@ -77,20 +85,8 @@ public class FontManager
{ {
throw new RuntimeException("Font file not found.", ex); throw new RuntimeException("Font file not found.", ex);
} }
}
public static Font getRunescapeFont() defaultFont = new Font(Font.DIALOG, Font.PLAIN, 16);
{ defaultBoldFont = new Font(Font.DIALOG, Font.BOLD, 16);
return runescapeFont;
}
public static Font getRunescapeSmallFont()
{
return runescapeSmallFont;
}
public static Font getRunescapeBoldFont()
{
return runescapeBoldFont;
} }
} }

View File

@@ -29,6 +29,7 @@ package net.runelite.client.ui.components;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Color; import java.awt.Color;
import java.awt.Dimension; import java.awt.Dimension;
import java.awt.Font;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.awt.event.FocusAdapter; import java.awt.event.FocusAdapter;
import java.awt.event.FocusEvent; import java.awt.event.FocusEvent;
@@ -125,7 +126,7 @@ public class IconTextField extends JPanel
textField.addMouseListener(hoverEffect); textField.addMouseListener(hoverEffect);
innerTxt.addMouseListener(hoverEffect); innerTxt.addMouseListener(hoverEffect);
clearButton = createRHSButton(ColorScheme.PROGRESS_ERROR_COLOR, Color.PINK); clearButton = createRHSButton(ColorScheme.PROGRESS_ERROR_COLOR, Color.PINK, FontManager.getRunescapeBoldFont());
clearButton.setText("×"); clearButton.setText("×");
clearButton.addActionListener(evt -> clearButton.addActionListener(evt ->
{ {
@@ -192,7 +193,7 @@ public class IconTextField extends JPanel
} }
}); });
suggestionButton = createRHSButton(ColorScheme.LIGHT_GRAY_COLOR, ColorScheme.MEDIUM_GRAY_COLOR); suggestionButton = createRHSButton(ColorScheme.LIGHT_GRAY_COLOR, ColorScheme.MEDIUM_GRAY_COLOR, FontManager.getDefaultBoldFont());
suggestionButton.setText(""); suggestionButton.setText("");
suggestionButton.addActionListener(e -> suggestionButton.addActionListener(e ->
{ {
@@ -237,11 +238,11 @@ public class IconTextField extends JPanel
add(rhsButtons, BorderLayout.EAST); add(rhsButtons, BorderLayout.EAST);
} }
private JButton createRHSButton(Color fg, Color rollover) private JButton createRHSButton(Color fg, Color rollover, Font font)
{ {
JButton b = new JButton(); JButton b = new JButton();
b.setPreferredSize(new Dimension(30, 0)); b.setPreferredSize(new Dimension(30, 0));
b.setFont(FontManager.getRunescapeBoldFont()); b.setFont(font);
b.setBorder(null); b.setBorder(null);
b.setRolloverEnabled(true); b.setRolloverEnabled(true);
SwingUtil.removeButtonDecorations(b); SwingUtil.removeButtonDecorations(b);

View File

@@ -28,6 +28,7 @@ import com.google.common.base.MoreObjects;
import com.google.common.base.Strings; import com.google.common.base.Strings;
import java.awt.Color; import java.awt.Color;
import java.awt.Dimension; import java.awt.Dimension;
import java.awt.Font;
import java.awt.FontMetrics; import java.awt.FontMetrics;
import java.awt.Graphics2D; import java.awt.Graphics2D;
import java.awt.Point; import java.awt.Point;
@@ -50,6 +51,10 @@ public class LineComponent implements LayoutableRenderableEntity
@Builder.Default @Builder.Default
private Color rightColor = Color.WHITE; private Color rightColor = Color.WHITE;
private Font leftFont;
private Font rightFont;
@Builder.Default @Builder.Default
private Point preferredLocation = new Point(); private Point preferredLocation = new Point();
@@ -67,13 +72,16 @@ public class LineComponent implements LayoutableRenderableEntity
final String left = MoreObjects.firstNonNull(this.left, ""); final String left = MoreObjects.firstNonNull(this.left, "");
final String right = MoreObjects.firstNonNull(this.right, ""); final String right = MoreObjects.firstNonNull(this.right, "");
final FontMetrics metrics = graphics.getFontMetrics(); final Font leftFont = MoreObjects.firstNonNull(this.leftFont, graphics.getFont());
final Font rightFont = MoreObjects.firstNonNull(this.rightFont, graphics.getFont());
final FontMetrics lfm = graphics.getFontMetrics(leftFont), rfm = graphics.getFontMetrics(rightFont);
final int fmHeight = Math.max(lfm.getHeight(), rfm.getHeight());
final int baseX = preferredLocation.x; final int baseX = preferredLocation.x;
final int baseY = preferredLocation.y + metrics.getHeight(); final int baseY = preferredLocation.y + fmHeight;
int x = baseX; int x = baseX;
int y = baseY; int y = baseY;
final int leftFullWidth = getLineWidth(left, metrics); final int leftFullWidth = getLineWidth(left, lfm);
final int rightFullWidth = getLineWidth(right, metrics); final int rightFullWidth = getLineWidth(right, rfm);
final TextComponent textComponent = new TextComponent(); final TextComponent textComponent = new TextComponent();
if (preferredSize.width < leftFullWidth + rightFullWidth) if (preferredSize.width < leftFullWidth + rightFullWidth)
@@ -87,8 +95,8 @@ public class LineComponent implements LayoutableRenderableEntity
leftSmallWidth -= rightSmallWidth; leftSmallWidth -= rightSmallWidth;
} }
final String[] leftSplitLines = lineBreakText(left, leftSmallWidth, metrics); final String[] leftSplitLines = lineBreakText(left, leftSmallWidth, lfm);
final String[] rightSplitLines = lineBreakText(right, rightSmallWidth, metrics); final String[] rightSplitLines = lineBreakText(right, rightSmallWidth, rfm);
int lineCount = Math.max(leftSplitLines.length, rightSplitLines.length); int lineCount = Math.max(leftSplitLines.length, rightSplitLines.length);
@@ -100,19 +108,21 @@ public class LineComponent implements LayoutableRenderableEntity
textComponent.setPosition(new Point(x, y)); textComponent.setPosition(new Point(x, y));
textComponent.setText(leftText); textComponent.setText(leftText);
textComponent.setColor(leftColor); textComponent.setColor(leftColor);
textComponent.setFont(leftFont);
textComponent.render(graphics); textComponent.render(graphics);
} }
if (i < rightSplitLines.length) if (i < rightSplitLines.length)
{ {
final String rightText = rightSplitLines[i]; final String rightText = rightSplitLines[i];
textComponent.setPosition(new Point(x + preferredSize.width - getLineWidth(rightText, metrics), y)); textComponent.setPosition(new Point(x + preferredSize.width - getLineWidth(rightText, rfm), y));
textComponent.setText(rightText); textComponent.setText(rightText);
textComponent.setColor(rightColor); textComponent.setColor(rightColor);
textComponent.setFont(rightFont);
textComponent.render(graphics); textComponent.render(graphics);
} }
y += metrics.getHeight(); y += fmHeight;
} }
final Dimension dimension = new Dimension(preferredSize.width, y - baseY); final Dimension dimension = new Dimension(preferredSize.width, y - baseY);
@@ -126,6 +136,7 @@ public class LineComponent implements LayoutableRenderableEntity
textComponent.setPosition(new Point(x, y)); textComponent.setPosition(new Point(x, y));
textComponent.setText(left); textComponent.setText(left);
textComponent.setColor(leftColor); textComponent.setColor(leftColor);
textComponent.setFont(leftFont);
textComponent.render(graphics); textComponent.render(graphics);
} }
@@ -134,10 +145,11 @@ public class LineComponent implements LayoutableRenderableEntity
textComponent.setPosition(new Point(x + preferredSize.width - rightFullWidth, y)); textComponent.setPosition(new Point(x + preferredSize.width - rightFullWidth, y));
textComponent.setText(right); textComponent.setText(right);
textComponent.setColor(rightColor); textComponent.setColor(rightColor);
textComponent.setFont(rightFont);
textComponent.render(graphics); textComponent.render(graphics);
} }
y += metrics.getHeight(); y += fmHeight;
final Dimension dimension = new Dimension(preferredSize.width, y - baseY); final Dimension dimension = new Dimension(preferredSize.width, y - baseY);
bounds.setLocation(preferredLocation); bounds.setLocation(preferredLocation);

View File

@@ -26,10 +26,12 @@ package net.runelite.client.ui.overlay.components;
import java.awt.Color; import java.awt.Color;
import java.awt.Dimension; import java.awt.Dimension;
import java.awt.Font;
import java.awt.FontMetrics; import java.awt.FontMetrics;
import java.awt.Graphics2D; import java.awt.Graphics2D;
import java.awt.Point; import java.awt.Point;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import javax.annotation.Nullable;
import lombok.Setter; import lombok.Setter;
import net.runelite.client.ui.overlay.RenderableEntity; import net.runelite.client.ui.overlay.RenderableEntity;
import net.runelite.client.util.ColorUtil; import net.runelite.client.util.ColorUtil;
@@ -45,10 +47,22 @@ public class TextComponent implements RenderableEntity
private Point position = new Point(); private Point position = new Point();
private Color color = Color.WHITE; private Color color = Color.WHITE;
private boolean outline; private boolean outline;
/**
* The text font.
*/
@Nullable
private Font font;
@Override @Override
public Dimension render(Graphics2D graphics) public Dimension render(Graphics2D graphics)
{ {
Font originalFont = null;
if (font != null)
{
originalFont = graphics.getFont();
graphics.setFont(font);
}
final FontMetrics fontMetrics = graphics.getFontMetrics(); final FontMetrics fontMetrics = graphics.getFontMetrics();
if (COL_TAG_PATTERN_W_LOOKAHEAD.matcher(text).find()) if (COL_TAG_PATTERN_W_LOOKAHEAD.matcher(text).find())
@@ -105,6 +119,14 @@ public class TextComponent implements RenderableEntity
graphics.drawString(text, position.x, position.y); graphics.drawString(text, position.x, position.y);
} }
return new Dimension(fontMetrics.stringWidth(text), fontMetrics.getHeight()); int width = fontMetrics.stringWidth(text);
int height = fontMetrics.getHeight();
if (originalFont != null)
{
graphics.setFont(originalFont);
}
return new Dimension(width, height);
} }
} }

View File

@@ -26,6 +26,7 @@
package net.runelite.client.util; package net.runelite.client.util;
import com.google.common.base.Strings; import com.google.common.base.Strings;
import com.google.gson.Gson;
import java.awt.Toolkit; import java.awt.Toolkit;
import java.awt.TrayIcon; import java.awt.TrayIcon;
import java.awt.datatransfer.Clipboard; import java.awt.datatransfer.Clipboard;
@@ -54,7 +55,6 @@ import net.runelite.api.GameState;
import net.runelite.api.WorldType; import net.runelite.api.WorldType;
import net.runelite.client.Notifier; import net.runelite.client.Notifier;
import static net.runelite.client.RuneLite.SCREENSHOT_DIR; import static net.runelite.client.RuneLite.SCREENSHOT_DIR;
import net.runelite.http.api.RuneLiteAPI;
import okhttp3.Call; import okhttp3.Call;
import okhttp3.Callback; import okhttp3.Callback;
import okhttp3.HttpUrl; import okhttp3.HttpUrl;
@@ -75,6 +75,7 @@ public class ImageCapture
private final Client client; private final Client client;
private final Notifier notifier; private final Notifier notifier;
private final OkHttpClient okHttpClient; private final OkHttpClient okHttpClient;
private final Gson gson;
private final String imgurClientId; private final String imgurClientId;
@Inject @Inject
@@ -82,12 +83,14 @@ public class ImageCapture
final Client client, final Client client,
final Notifier notifier, final Notifier notifier,
final OkHttpClient okHttpClient, final OkHttpClient okHttpClient,
final Gson gson,
@Named("runelite.imgur.client.id") final String imgurClientId @Named("runelite.imgur.client.id") final String imgurClientId
) )
{ {
this.client = client; this.client = client;
this.notifier = notifier; this.notifier = notifier;
this.okHttpClient = okHttpClient; this.okHttpClient = okHttpClient;
this.gson = gson;
this.imgurClientId = imgurClientId; this.imgurClientId = imgurClientId;
} }
@@ -204,7 +207,7 @@ public class ImageCapture
*/ */
private void uploadScreenshot(File screenshotFile, boolean notify) throws IOException private void uploadScreenshot(File screenshotFile, boolean notify) throws IOException
{ {
String json = RuneLiteAPI.GSON.toJson(new ImageUploadRequest(screenshotFile)); String json = gson.toJson(new ImageUploadRequest(screenshotFile));
Request request = new Request.Builder() Request request = new Request.Builder()
.url(IMGUR_IMAGE_UPLOAD_URL) .url(IMGUR_IMAGE_UPLOAD_URL)
@@ -225,8 +228,8 @@ public class ImageCapture
{ {
try (InputStream in = response.body().byteStream()) try (InputStream in = response.body().byteStream())
{ {
ImageUploadResponse imageUploadResponse = RuneLiteAPI.GSON ImageUploadResponse imageUploadResponse =
.fromJson(new InputStreamReader(in, StandardCharsets.UTF_8), ImageUploadResponse.class); gson.fromJson(new InputStreamReader(in, StandardCharsets.UTF_8), ImageUploadResponse.class);
if (imageUploadResponse.isSuccess()) if (imageUploadResponse.isSuccess())
{ {

View File

@@ -25,6 +25,8 @@
*/ */
package net.runelite.client.util; package net.runelite.client.util;
import com.google.common.io.ByteStreams;
import java.io.IOException;
import java.lang.invoke.MethodHandles; import java.lang.invoke.MethodHandles;
import java.lang.reflect.Field; import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException; import java.lang.reflect.InvocationTargetException;
@@ -36,7 +38,7 @@ public class ReflectUtil
{ {
} }
public static MethodHandles.Lookup privateLookupIn(Class clazz) public static MethodHandles.Lookup privateLookupIn(Class<?> clazz)
{ {
try try
{ {
@@ -44,7 +46,16 @@ public class ReflectUtil
// we need to access it via reflection. This is preferred way because it's Java 9+ public api and is // we need to access it via reflection. This is preferred way because it's Java 9+ public api and is
// likely to not change // likely to not change
final Method privateLookupIn = MethodHandles.class.getMethod("privateLookupIn", Class.class, MethodHandles.Lookup.class); final Method privateLookupIn = MethodHandles.class.getMethod("privateLookupIn", Class.class, MethodHandles.Lookup.class);
return (MethodHandles.Lookup) privateLookupIn.invoke(null, clazz, MethodHandles.lookup()); MethodHandles.Lookup caller;
if (clazz.getClassLoader() instanceof PrivateLookupableClassLoader)
{
caller = ((PrivateLookupableClassLoader) clazz.getClassLoader()).getLookup();
}
else
{
caller = MethodHandles.lookup();
}
return (MethodHandles.Lookup) privateLookupIn.invoke(null, clazz, caller);
} }
catch (InvocationTargetException | IllegalAccessException e) catch (InvocationTargetException | IllegalAccessException e)
{ {
@@ -69,4 +80,51 @@ public class ReflectUtil
} }
} }
} }
public interface PrivateLookupableClassLoader
{
// define class is protected final so this needs a different name to become public
Class<?> defineClass0(String name, byte[] b, int off, int len) throws ClassFormatError;
MethodHandles.Lookup getLookup();
void setLookup(MethodHandles.Lookup lookup);
}
/**
* Allows private Lookups to be created for classes in this ClassLoader
* <p>
* Due to JDK-8173978 it is impossible to create get a lookup with module scoped permissions when teleporting
* between modules. Since external plugins are loaded in a separate classloader to us they are contained in unique
* unnamed modules. Since we (via LambdaMetafactory) are creating a hidden class in that module, we require module
* scoped access to it, and since the methods can be private, we also require private access. The only way to get
* MODULE|PRIVATE is to either 1) invokedynamic in that class, 2) call MethodHandles.lookup() from that class, or
* 3) call privateLookupIn with an existing lookup with PRIVATE|MODULE created from a class in the same module.
* Our solution is to make classloaders call this method which will define a class in the classloader's unnamed
* module that calls MethodHandles.lookup() and stores it in the classloader for later use.
*/
public static void installLookupHelper(PrivateLookupableClassLoader cl)
{
try
{
String name = PrivateLookupHelper.class.getName();
byte[] classData = ByteStreams.toByteArray(ReflectUtil.class.getResourceAsStream("/" + name.replace('.', '/') + ".class"));
Class<?> clazz = cl.defineClass0(name, classData, 0, classData.length);
// force <clinit> to run
clazz.getConstructor().newInstance();
}
catch (IOException | ReflectiveOperationException e)
{
throw new RuntimeException("unable to install lookup helper", e);
}
}
public static class PrivateLookupHelper
{
static
{
PrivateLookupableClassLoader pcl = (PrivateLookupableClassLoader) PrivateLookupHelper.class.getClassLoader();
pcl.setLookup(MethodHandles.lookup());
}
}
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 876 B

After

Width:  |  Height:  |  Size: 687 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 435 B

After

Width:  |  Height:  |  Size: 366 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 272 B

After

Width:  |  Height:  |  Size: 251 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 594 B

After

Width:  |  Height:  |  Size: 493 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 364 B

After

Width:  |  Height:  |  Size: 315 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 291 B

After

Width:  |  Height:  |  Size: 276 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 518 B

After

Width:  |  Height:  |  Size: 398 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 510 B

After

Width:  |  Height:  |  Size: 358 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 471 B

After

Width:  |  Height:  |  Size: 341 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 515 B

After

Width:  |  Height:  |  Size: 371 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 616 B

After

Width:  |  Height:  |  Size: 497 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 861 B

After

Width:  |  Height:  |  Size: 600 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 863 B

After

Width:  |  Height:  |  Size: 568 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 384 B

After

Width:  |  Height:  |  Size: 336 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 382 B

After

Width:  |  Height:  |  Size: 338 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 352 B

After

Width:  |  Height:  |  Size: 317 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 368 B

After

Width:  |  Height:  |  Size: 323 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 531 B

After

Width:  |  Height:  |  Size: 430 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 422 B

After

Width:  |  Height:  |  Size: 357 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 332 B

After

Width:  |  Height:  |  Size: 288 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 478 B

After

Width:  |  Height:  |  Size: 399 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 422 B

After

Width:  |  Height:  |  Size: 364 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 331 B

After

Width:  |  Height:  |  Size: 304 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 351 B

After

Width:  |  Height:  |  Size: 294 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 407 B

After

Width:  |  Height:  |  Size: 343 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 549 B

After

Width:  |  Height:  |  Size: 449 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 403 B

After

Width:  |  Height:  |  Size: 363 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 609 B

After

Width:  |  Height:  |  Size: 492 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 627 B

After

Width:  |  Height:  |  Size: 389 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 488 B

After

Width:  |  Height:  |  Size: 409 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 333 B

After

Width:  |  Height:  |  Size: 282 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 473 B

After

Width:  |  Height:  |  Size: 382 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 546 B

After

Width:  |  Height:  |  Size: 419 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 618 B

After

Width:  |  Height:  |  Size: 510 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 613 B

After

Width:  |  Height:  |  Size: 487 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 543 B

After

Width:  |  Height:  |  Size: 462 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 583 B

After

Width:  |  Height:  |  Size: 370 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 315 B

After

Width:  |  Height:  |  Size: 292 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 378 B

After

Width:  |  Height:  |  Size: 341 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 391 B

After

Width:  |  Height:  |  Size: 347 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 597 B

After

Width:  |  Height:  |  Size: 478 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 873 B

After

Width:  |  Height:  |  Size: 759 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 485 B

After

Width:  |  Height:  |  Size: 407 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 374 B

After

Width:  |  Height:  |  Size: 346 B