Merge pull request #2888 from open-osrs/upstream-staging
upstream: to 4ca8ef4d40
@@ -43,11 +43,30 @@ public interface DrawCallbacks
|
|||||||
SceneTileModel model, int tileZ, int tileX, int tileY,
|
SceneTileModel model, int tileZ, int tileX, int tileY,
|
||||||
int zoom, int centerX, int centerY);
|
int zoom, int centerX, int centerY);
|
||||||
|
|
||||||
void draw();
|
/**
|
||||||
|
* Called when a frame should be drawn.
|
||||||
|
*
|
||||||
|
* @param overlayColor Color of full-viewport overlays, if any
|
||||||
|
*/
|
||||||
|
void draw(int overlayColor);
|
||||||
|
|
||||||
boolean drawFace(Model model, int face);
|
boolean drawFace(Model model, int face);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called before the scene is drawn
|
||||||
|
* @param cameraX
|
||||||
|
* @param cameraY
|
||||||
|
* @param cameraZ
|
||||||
|
* @param cameraPitch
|
||||||
|
* @param cameraYaw
|
||||||
|
* @param plane
|
||||||
|
*/
|
||||||
void drawScene(int cameraX, int cameraY, int cameraZ, int cameraPitch, int cameraYaw, int plane);
|
void drawScene(int cameraX, int cameraY, int cameraZ, int cameraPitch, int cameraYaw, int plane);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called after the scene has been drawn
|
||||||
|
*/
|
||||||
|
void postDrawScene();
|
||||||
|
|
||||||
void animate(Texture texture, int diff);
|
void animate(Texture texture, int diff);
|
||||||
}
|
}
|
||||||
@@ -141,7 +141,7 @@ public class WidgetID
|
|||||||
public static final int LOOTING_BAG_GROUP_ID = 81;
|
public static final int LOOTING_BAG_GROUP_ID = 81;
|
||||||
public static final int SKOTIZO_GROUP_ID = 308;
|
public static final int SKOTIZO_GROUP_ID = 308;
|
||||||
public static final int ENTERING_HOUSE_GROUP_ID = 71;
|
public static final int ENTERING_HOUSE_GROUP_ID = 71;
|
||||||
public static final int FULLSCREEN_MAP_GROUP_ID = 165;
|
public static final int FULLSCREEN_CONTAINER_TLI = 165;
|
||||||
public static final int QUESTLIST_GROUP_ID = 399;
|
public static final int QUESTLIST_GROUP_ID = 399;
|
||||||
public static final int SKILLS_GROUP_ID = 320;
|
public static final int SKILLS_GROUP_ID = 320;
|
||||||
public static final int DIALOG_SPRITE2_ID = 11;
|
public static final int DIALOG_SPRITE2_ID = 11;
|
||||||
|
|||||||
@@ -827,7 +827,7 @@ public enum WidgetInfo
|
|||||||
MULTICOMBAT_FIXED(WidgetID.FIXED_VIEWPORT_GROUP_ID, WidgetID.FixedViewport.MULTICOMBAT_INDICATOR),
|
MULTICOMBAT_FIXED(WidgetID.FIXED_VIEWPORT_GROUP_ID, WidgetID.FixedViewport.MULTICOMBAT_INDICATOR),
|
||||||
MULTICOMBAT_RESIZEABLE(WidgetID.RESIZABLE_VIEWPORT_BOTTOM_LINE_GROUP_ID, WidgetID.ResizableViewport.MULTICOMBAT_INDICATOR),
|
MULTICOMBAT_RESIZEABLE(WidgetID.RESIZABLE_VIEWPORT_BOTTOM_LINE_GROUP_ID, WidgetID.ResizableViewport.MULTICOMBAT_INDICATOR),
|
||||||
|
|
||||||
FULLSCREEN_MAP_ROOT(WidgetID.FULLSCREEN_MAP_GROUP_ID, WidgetID.FullScreenMap.ROOT),
|
FULLSCREEN_MAP_ROOT(WidgetID.FULLSCREEN_CONTAINER_TLI, WidgetID.FullScreenMap.ROOT),
|
||||||
|
|
||||||
QUESTLIST_BOX(WidgetID.QUESTLIST_GROUP_ID, WidgetID.QuestList.BOX),
|
QUESTLIST_BOX(WidgetID.QUESTLIST_GROUP_ID, WidgetID.QuestList.BOX),
|
||||||
QUESTLIST_CONTAINER(WidgetID.QUESTLIST_GROUP_ID, WidgetID.QuestList.CONTAINER),
|
QUESTLIST_CONTAINER(WidgetID.QUESTLIST_GROUP_ID, WidgetID.QuestList.CONTAINER),
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ import net.runelite.client.ui.ColorScheme;
|
|||||||
import net.runelite.client.ui.FontManager;
|
import net.runelite.client.ui.FontManager;
|
||||||
import com.openosrs.client.ui.OpenOSRSSplashScreen;
|
import com.openosrs.client.ui.OpenOSRSSplashScreen;
|
||||||
import net.runelite.client.util.ImageUtil;
|
import net.runelite.client.util.ImageUtil;
|
||||||
import net.runelite.client.util.LinkBrowser;
|
import com.openosrs.client.util.LinkBrowser;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class InfoPanel extends JPanel
|
public class InfoPanel extends JPanel
|
||||||
|
|||||||
@@ -0,0 +1,83 @@
|
|||||||
|
package com.openosrs.client.util;
|
||||||
|
|
||||||
|
import java.awt.Desktop;
|
||||||
|
import java.awt.Toolkit;
|
||||||
|
import java.awt.datatransfer.StringSelection;
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.IOException;
|
||||||
|
import javax.swing.JOptionPane;
|
||||||
|
import javax.swing.SwingUtilities;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
public class LinkBrowser extends net.runelite.client.util.LinkBrowser
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Tries to open the specified {@code File} with the systems default text editor. If operation fails
|
||||||
|
* an error message is displayed with the option to copy the absolute file path to clipboard.
|
||||||
|
*
|
||||||
|
* @param file the File instance of the log file
|
||||||
|
* @return did the file open successfully?
|
||||||
|
*/
|
||||||
|
public static boolean openLocalFile(final File file)
|
||||||
|
{
|
||||||
|
if (file == null || !file.exists())
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (attemptOpenLocalFile(file))
|
||||||
|
{
|
||||||
|
log.debug("Opened log file through Desktop#edit to {}", file);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
showMessageBox("Unable to open log file. Press 'OK' and the file path will be copied to your clipboard", file.getAbsolutePath());
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static boolean attemptOpenLocalFile(final File file)
|
||||||
|
{
|
||||||
|
if (!Desktop.isDesktopSupported())
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
final Desktop desktop = Desktop.getDesktop();
|
||||||
|
|
||||||
|
if (!desktop.isSupported(Desktop.Action.OPEN))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
desktop.open(file);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
catch (IOException ex)
|
||||||
|
{
|
||||||
|
log.warn("Failed to open Desktop#edit {}", file, ex);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Open swing message box with specified message and copy data to clipboard
|
||||||
|
* @param message message to show
|
||||||
|
*/
|
||||||
|
private static void showMessageBox(final String message, final String data)
|
||||||
|
{
|
||||||
|
SwingUtilities.invokeLater(() ->
|
||||||
|
{
|
||||||
|
final int result = JOptionPane.showConfirmDialog(null, message, "Message",
|
||||||
|
JOptionPane.OK_CANCEL_OPTION);
|
||||||
|
|
||||||
|
if (result == JOptionPane.OK_OPTION)
|
||||||
|
{
|
||||||
|
final StringSelection stringSelection = new StringSelection(data);
|
||||||
|
Toolkit.getDefaultToolkit().getSystemClipboard().setContents(stringSelection, null);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -45,6 +45,7 @@ import java.util.ArrayList;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.concurrent.ScheduledExecutorService;
|
import java.util.concurrent.ScheduledExecutorService;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
import javax.inject.Named;
|
||||||
import javax.inject.Singleton;
|
import javax.inject.Singleton;
|
||||||
import javax.sound.sampled.AudioInputStream;
|
import javax.sound.sampled.AudioInputStream;
|
||||||
import javax.sound.sampled.AudioSystem;
|
import javax.sound.sampled.AudioSystem;
|
||||||
@@ -101,8 +102,6 @@ public class Notifier
|
|||||||
private static final int MINIMUM_FLASH_DURATION_MILLIS = 2000;
|
private static final int MINIMUM_FLASH_DURATION_MILLIS = 2000;
|
||||||
private static final int MINIMUM_FLASH_DURATION_TICKS = MINIMUM_FLASH_DURATION_MILLIS / Constants.CLIENT_TICK_LENGTH;
|
private static final int MINIMUM_FLASH_DURATION_TICKS = MINIMUM_FLASH_DURATION_MILLIS / Constants.CLIENT_TICK_LENGTH;
|
||||||
|
|
||||||
private static final String appName = RuneLiteProperties.getTitle();
|
|
||||||
|
|
||||||
private static final File NOTIFICATION_FILE = new File(RuneLite.RUNELITE_DIR, "notification.wav");
|
private static final File NOTIFICATION_FILE = new File(RuneLite.RUNELITE_DIR, "notification.wav");
|
||||||
private static final long CLIP_MTIME_UNLOADED = -2;
|
private static final long CLIP_MTIME_UNLOADED = -2;
|
||||||
private static final long CLIP_MTIME_BUILTIN = -1;
|
private static final long CLIP_MTIME_BUILTIN = -1;
|
||||||
@@ -113,6 +112,7 @@ public class Notifier
|
|||||||
private final ScheduledExecutorService executorService;
|
private final ScheduledExecutorService executorService;
|
||||||
private final ChatMessageManager chatMessageManager;
|
private final ChatMessageManager chatMessageManager;
|
||||||
private final EventBus eventBus;
|
private final EventBus eventBus;
|
||||||
|
private final String appName;
|
||||||
private final Path notifyIconPath;
|
private final Path notifyIconPath;
|
||||||
private boolean terminalNotifierAvailable;
|
private boolean terminalNotifierAvailable;
|
||||||
private Instant flashStart;
|
private Instant flashStart;
|
||||||
@@ -127,7 +127,9 @@ public class Notifier
|
|||||||
final RuneLiteConfig runeliteConfig,
|
final RuneLiteConfig runeliteConfig,
|
||||||
final ScheduledExecutorService executorService,
|
final ScheduledExecutorService executorService,
|
||||||
final ChatMessageManager chatMessageManager,
|
final ChatMessageManager chatMessageManager,
|
||||||
final EventBus eventBus)
|
final EventBus eventBus,
|
||||||
|
@Named("runelite.title") final String appName
|
||||||
|
)
|
||||||
{
|
{
|
||||||
this.client = client;
|
this.client = client;
|
||||||
this.clientUI = clientUI;
|
this.clientUI = clientUI;
|
||||||
@@ -135,6 +137,7 @@ public class Notifier
|
|||||||
this.executorService = executorService;
|
this.executorService = executorService;
|
||||||
this.chatMessageManager = chatMessageManager;
|
this.chatMessageManager = chatMessageManager;
|
||||||
this.eventBus = eventBus;
|
this.eventBus = eventBus;
|
||||||
|
this.appName = appName;
|
||||||
this.notifyIconPath = RuneLite.RUNELITE_DIR.toPath().resolve("icon.png");
|
this.notifyIconPath = RuneLite.RUNELITE_DIR.toPath().resolve("icon.png");
|
||||||
|
|
||||||
// First check if we are running in launcher
|
// First check if we are running in launcher
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ import com.openosrs.client.config.OpenOSRSConfig;
|
|||||||
import com.openosrs.client.util.NonScheduledExecutorServiceExceptionLogger;
|
import com.openosrs.client.util.NonScheduledExecutorServiceExceptionLogger;
|
||||||
import java.applet.Applet;
|
import java.applet.Applet;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
import java.util.Properties;
|
||||||
import java.util.concurrent.ExecutorService;
|
import java.util.concurrent.ExecutorService;
|
||||||
import java.util.concurrent.Executors;
|
import java.util.concurrent.Executors;
|
||||||
import java.util.concurrent.LinkedBlockingQueue;
|
import java.util.concurrent.LinkedBlockingQueue;
|
||||||
@@ -75,6 +76,12 @@ public class RuneLiteModule extends AbstractModule
|
|||||||
@Override
|
@Override
|
||||||
protected void configure()
|
protected void configure()
|
||||||
{
|
{
|
||||||
|
Properties properties = RuneLiteProperties.getProperties();
|
||||||
|
for (String key : properties.stringPropertyNames())
|
||||||
|
{
|
||||||
|
String value = properties.getProperty(key);
|
||||||
|
bindConstant().annotatedWith(Names.named(key)).to(value);
|
||||||
|
}
|
||||||
bindConstant().annotatedWith(Names.named("developerMode")).to(developerMode);
|
bindConstant().annotatedWith(Names.named("developerMode")).to(developerMode);
|
||||||
bindConstant().annotatedWith(Names.named("safeMode")).to(safeMode);
|
bindConstant().annotatedWith(Names.named("safeMode")).to(safeMode);
|
||||||
bind(File.class).annotatedWith(Names.named("sessionfile")).toInstance(sessionfile);
|
bind(File.class).annotatedWith(Names.named("sessionfile")).toInstance(sessionfile);
|
||||||
|
|||||||
@@ -28,18 +28,14 @@ import java.io.IOException;
|
|||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
|
import lombok.AccessLevel;
|
||||||
|
import lombok.Getter;
|
||||||
import okhttp3.HttpUrl;
|
import okhttp3.HttpUrl;
|
||||||
|
|
||||||
public class RuneLiteProperties
|
public class RuneLiteProperties
|
||||||
{
|
{
|
||||||
private static final String RUNELITE_TITLE = "runelite.title";
|
|
||||||
private static final String RUNELITE_VERSION = "runelite.version";
|
private static final String RUNELITE_VERSION = "runelite.version";
|
||||||
private static final String RUNESCAPE_VERSION = "runescape.version";
|
|
||||||
private static final String DISCORD_APP_ID = "runelite.discord.appid";
|
|
||||||
private static final String DISCORD_INVITE = "runelite.discord.invite";
|
private static final String DISCORD_INVITE = "runelite.discord.invite";
|
||||||
private static final String GITHUB_LINK = "runelite.github.link";
|
|
||||||
private static final String WIKI_LINK = "runelite.wiki.link";
|
|
||||||
private static final String PATREON_LINK = "runelite.patreon.link";
|
|
||||||
private static final String LAUNCHER_VERSION_PROPERTY = "runelite.launcher.version";
|
private static final String LAUNCHER_VERSION_PROPERTY = "runelite.launcher.version";
|
||||||
private static final String INSECURE_SKIP_TLS_VERIFICATION_PROPERTY = "runelite.insecure-skip-tls-verification";
|
private static final String INSECURE_SKIP_TLS_VERIFICATION_PROPERTY = "runelite.insecure-skip-tls-verification";
|
||||||
private static final String TROUBLESHOOTING_LINK = "runelite.wiki.troubleshooting.link";
|
private static final String TROUBLESHOOTING_LINK = "runelite.wiki.troubleshooting.link";
|
||||||
@@ -49,8 +45,8 @@ public class RuneLiteProperties
|
|||||||
private static final String JAV_CONFIG_BACKUP = "runelite.jav_config_backup";
|
private static final String JAV_CONFIG_BACKUP = "runelite.jav_config_backup";
|
||||||
private static final String PLUGINHUB_BASE = "runelite.pluginhub.url";
|
private static final String PLUGINHUB_BASE = "runelite.pluginhub.url";
|
||||||
private static final String PLUGINHUB_VERSION = "runelite.pluginhub.version";
|
private static final String PLUGINHUB_VERSION = "runelite.pluginhub.version";
|
||||||
private static final String IMGUR_CLIENT_ID = "runelite.imgur.client.id";
|
|
||||||
|
|
||||||
|
@Getter(AccessLevel.PACKAGE)
|
||||||
private static final Properties properties = new Properties();
|
private static final Properties properties = new Properties();
|
||||||
|
|
||||||
static
|
static
|
||||||
@@ -65,46 +61,16 @@ public class RuneLiteProperties
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getTitle()
|
|
||||||
{
|
|
||||||
return properties.getProperty(RUNELITE_TITLE);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String getVersion()
|
public static String getVersion()
|
||||||
{
|
{
|
||||||
return properties.getProperty(RUNELITE_VERSION);
|
return properties.getProperty(RUNELITE_VERSION);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getRunescapeVersion()
|
|
||||||
{
|
|
||||||
return properties.getProperty(RUNESCAPE_VERSION);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String getDiscordAppId()
|
|
||||||
{
|
|
||||||
return properties.getProperty(DISCORD_APP_ID);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String getDiscordInvite()
|
public static String getDiscordInvite()
|
||||||
{
|
{
|
||||||
return properties.getProperty(DISCORD_INVITE);
|
return properties.getProperty(DISCORD_INVITE);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getGithubLink()
|
|
||||||
{
|
|
||||||
return properties.getProperty(GITHUB_LINK);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String getWikiLink()
|
|
||||||
{
|
|
||||||
return properties.getProperty(WIKI_LINK);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String getPatreonLink()
|
|
||||||
{
|
|
||||||
return properties.getProperty(PATREON_LINK);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
public static String getLauncherVersion()
|
public static String getLauncherVersion()
|
||||||
{
|
{
|
||||||
@@ -146,9 +112,4 @@ public class RuneLiteProperties
|
|||||||
String version = System.getProperty(PLUGINHUB_VERSION, properties.getProperty(PLUGINHUB_VERSION));
|
String version = System.getProperty(PLUGINHUB_VERSION, properties.getProperty(PLUGINHUB_VERSION));
|
||||||
return HttpUrl.parse(properties.get(PLUGINHUB_BASE) + "/" + version);
|
return HttpUrl.parse(properties.get(PLUGINHUB_BASE) + "/" + version);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getImgurClientId()
|
|
||||||
{
|
|
||||||
return properties.getProperty(IMGUR_CLIENT_ID);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -28,10 +28,10 @@ import com.google.common.base.Strings;
|
|||||||
import java.util.concurrent.ScheduledExecutorService;
|
import java.util.concurrent.ScheduledExecutorService;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
import javax.inject.Named;
|
||||||
import javax.inject.Singleton;
|
import javax.inject.Singleton;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import net.runelite.client.RuneLiteProperties;
|
|
||||||
import net.runelite.client.discord.events.DiscordDisconnected;
|
import net.runelite.client.discord.events.DiscordDisconnected;
|
||||||
import net.runelite.client.discord.events.DiscordErrored;
|
import net.runelite.client.discord.events.DiscordErrored;
|
||||||
import net.runelite.client.discord.events.DiscordJoinGame;
|
import net.runelite.client.discord.events.DiscordJoinGame;
|
||||||
@@ -50,6 +50,7 @@ public class DiscordService implements AutoCloseable
|
|||||||
{
|
{
|
||||||
private final EventBus eventBus;
|
private final EventBus eventBus;
|
||||||
private final ScheduledExecutorService executorService;
|
private final ScheduledExecutorService executorService;
|
||||||
|
private final String discordAppId;
|
||||||
private final DiscordRPC discordRPC;
|
private final DiscordRPC discordRPC;
|
||||||
|
|
||||||
// Hold a reference to the event handlers to prevent the garbage collector from deleting them
|
// Hold a reference to the event handlers to prevent the garbage collector from deleting them
|
||||||
@@ -61,11 +62,14 @@ public class DiscordService implements AutoCloseable
|
|||||||
@Inject
|
@Inject
|
||||||
private DiscordService(
|
private DiscordService(
|
||||||
final EventBus eventBus,
|
final EventBus eventBus,
|
||||||
final ScheduledExecutorService executorService)
|
final ScheduledExecutorService executorService,
|
||||||
|
@Named("runelite.discord.appid") final String discordAppId
|
||||||
|
)
|
||||||
{
|
{
|
||||||
|
|
||||||
this.eventBus = eventBus;
|
this.eventBus = eventBus;
|
||||||
this.executorService = executorService;
|
this.executorService = executorService;
|
||||||
|
this.discordAppId = discordAppId;
|
||||||
|
|
||||||
DiscordRPC discordRPC = null;
|
DiscordRPC discordRPC = null;
|
||||||
DiscordEventHandlers discordEventHandlers = null;
|
DiscordEventHandlers discordEventHandlers = null;
|
||||||
@@ -103,7 +107,7 @@ public class DiscordService implements AutoCloseable
|
|||||||
discordEventHandlers.joinGame = this::joinGame;
|
discordEventHandlers.joinGame = this::joinGame;
|
||||||
discordEventHandlers.spectateGame = this::spectateGame;
|
discordEventHandlers.spectateGame = this::spectateGame;
|
||||||
discordEventHandlers.joinRequest = this::joinRequest;
|
discordEventHandlers.joinRequest = this::joinRequest;
|
||||||
discordRPC.Discord_Initialize(RuneLiteProperties.getDiscordAppId(), discordEventHandlers, true, null);
|
discordRPC.Discord_Initialize(discordAppId, discordEventHandlers, true, null);
|
||||||
executorService.scheduleAtFixedRate(discordRPC::Discord_RunCallbacks, 0, 2, TimeUnit.SECONDS);
|
executorService.scheduleAtFixedRate(discordRPC::Discord_RunCallbacks, 0, 2, TimeUnit.SECONDS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -69,6 +69,7 @@ public class ExternalPluginClient
|
|||||||
.newBuilder()
|
.newBuilder()
|
||||||
.addPathSegments("manifest.js")
|
.addPathSegments("manifest.js")
|
||||||
.build();
|
.build();
|
||||||
|
System.out.println(manifest.uri());
|
||||||
try (Response res = okHttpClient.newCall(new Request.Builder().url(manifest).build()).execute())
|
try (Response res = okHttpClient.newCall(new Request.Builder().url(manifest).build()).execute())
|
||||||
{
|
{
|
||||||
if (res.code() != 200)
|
if (res.code() != 200)
|
||||||
|
|||||||
@@ -34,13 +34,13 @@ import java.util.regex.Matcher;
|
|||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
import javax.inject.Named;
|
||||||
import net.runelite.api.ChatMessageType;
|
import net.runelite.api.ChatMessageType;
|
||||||
import net.runelite.api.Client;
|
import net.runelite.api.Client;
|
||||||
import net.runelite.api.MessageNode;
|
import net.runelite.api.MessageNode;
|
||||||
import net.runelite.api.events.ChatMessage;
|
import net.runelite.api.events.ChatMessage;
|
||||||
import net.runelite.api.events.GameStateChanged;
|
import net.runelite.api.events.GameStateChanged;
|
||||||
import net.runelite.client.Notifier;
|
import net.runelite.client.Notifier;
|
||||||
import net.runelite.client.RuneLiteProperties;
|
|
||||||
import net.runelite.client.chat.ChatColorType;
|
import net.runelite.client.chat.ChatColorType;
|
||||||
import net.runelite.client.chat.ChatMessageManager;
|
import net.runelite.client.chat.ChatMessageManager;
|
||||||
import net.runelite.client.config.ConfigManager;
|
import net.runelite.client.config.ConfigManager;
|
||||||
@@ -70,6 +70,10 @@ public class ChatNotificationsPlugin extends Plugin
|
|||||||
@Inject
|
@Inject
|
||||||
private Notifier notifier;
|
private Notifier notifier;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
@Named("runelite.title")
|
||||||
|
private String runeliteTitle;
|
||||||
|
|
||||||
//Custom Highlights
|
//Custom Highlights
|
||||||
private Pattern usernameMatcher = null;
|
private Pattern usernameMatcher = null;
|
||||||
private String usernameReplacer = "";
|
private String usernameReplacer = "";
|
||||||
@@ -163,7 +167,7 @@ public class ChatNotificationsPlugin extends Plugin
|
|||||||
break;
|
break;
|
||||||
case CONSOLE:
|
case CONSOLE:
|
||||||
// Don't notify for notification messages
|
// Don't notify for notification messages
|
||||||
if (chatMessage.getName().equals(RuneLiteProperties.getTitle()))
|
if (chatMessage.getName().equals(runeliteTitle))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ public class WidgetInspectorOverlay extends Overlay
|
|||||||
setPosition(OverlayPosition.DYNAMIC);
|
setPosition(OverlayPosition.DYNAMIC);
|
||||||
setLayer(OverlayLayer.ABOVE_WIDGETS);
|
setLayer(OverlayLayer.ABOVE_WIDGETS);
|
||||||
setPriority(OverlayPriority.HIGHEST);
|
setPriority(OverlayPriority.HIGHEST);
|
||||||
drawAfterInterface(WidgetID.FULLSCREEN_MAP_GROUP_ID);
|
drawAfterInterface(WidgetID.FULLSCREEN_CONTAINER_TLI);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -121,7 +121,7 @@ enum DiscordGameEventType
|
|||||||
CITY_JATIZSO("Jatizso" , DiscordAreaType.CITIES, 9531),
|
CITY_JATIZSO("Jatizso" , DiscordAreaType.CITIES, 9531),
|
||||||
CITY_KELDAGRIM("Keldagrim" , DiscordAreaType.CITIES, 11423, 11422, 11679, 11678),
|
CITY_KELDAGRIM("Keldagrim" , DiscordAreaType.CITIES, 11423, 11422, 11679, 11678),
|
||||||
CITY_LANDS_END("Land's End", DiscordAreaType.CITIES, 5941),
|
CITY_LANDS_END("Land's End", DiscordAreaType.CITIES, 5941),
|
||||||
CITY_LLETYA("Lletya" , DiscordAreaType.CITIES, 9265),
|
CITY_LLETYA("Lletya" , DiscordAreaType.CITIES, 9265, 11103),
|
||||||
CITY_LOVAKENGJ_HOUSE("Lovakengj" , DiscordAreaType.CITIES, 5692, 5691, 5947, 6203, 6202, 5690, 5946),
|
CITY_LOVAKENGJ_HOUSE("Lovakengj" , DiscordAreaType.CITIES, 5692, 5691, 5947, 6203, 6202, 5690, 5946),
|
||||||
CITY_LUMBRIDGE("Lumbridge" , DiscordAreaType.CITIES, 12850),
|
CITY_LUMBRIDGE("Lumbridge" , DiscordAreaType.CITIES, 12850),
|
||||||
CITY_LUNAR_ISLE("Lunar Isle" , DiscordAreaType.CITIES, 8253, 8252, 8509, 8508),
|
CITY_LUNAR_ISLE("Lunar Isle" , DiscordAreaType.CITIES, 8253, 8252, 8509, 8508),
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ import java.util.HashMap;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import javax.imageio.ImageIO;
|
import javax.imageio.ImageIO;
|
||||||
|
import javax.inject.Named;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import net.runelite.api.Client;
|
import net.runelite.api.Client;
|
||||||
import net.runelite.api.GameState;
|
import net.runelite.api.GameState;
|
||||||
@@ -46,7 +47,6 @@ import net.runelite.api.coords.WorldPoint;
|
|||||||
import net.runelite.api.events.GameStateChanged;
|
import net.runelite.api.events.GameStateChanged;
|
||||||
import net.runelite.api.events.StatChanged;
|
import net.runelite.api.events.StatChanged;
|
||||||
import net.runelite.api.events.VarbitChanged;
|
import net.runelite.api.events.VarbitChanged;
|
||||||
import net.runelite.client.RuneLiteProperties;
|
|
||||||
import net.runelite.client.config.ConfigManager;
|
import net.runelite.client.config.ConfigManager;
|
||||||
import net.runelite.client.discord.DiscordService;
|
import net.runelite.client.discord.DiscordService;
|
||||||
import net.runelite.client.discord.events.DiscordJoinGame;
|
import net.runelite.client.discord.events.DiscordJoinGame;
|
||||||
@@ -106,6 +106,10 @@ public class DiscordPlugin extends Plugin
|
|||||||
@Inject
|
@Inject
|
||||||
private OkHttpClient okHttpClient;
|
private OkHttpClient okHttpClient;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
@Named("runelite.discord.invite")
|
||||||
|
private String discordInvite;
|
||||||
|
|
||||||
private final Map<Skill, Integer> skillExp = new HashMap<>();
|
private final Map<Skill, Integer> skillExp = new HashMap<>();
|
||||||
private NavigationButton discordButton;
|
private NavigationButton discordButton;
|
||||||
private boolean loginFlag;
|
private boolean loginFlag;
|
||||||
@@ -125,7 +129,7 @@ public class DiscordPlugin extends Plugin
|
|||||||
.tab(false)
|
.tab(false)
|
||||||
.tooltip("Join Discord")
|
.tooltip("Join Discord")
|
||||||
.icon(icon)
|
.icon(icon)
|
||||||
.onClick(() -> LinkBrowser.browse(RuneLiteProperties.getDiscordInvite()))
|
.onClick(() -> LinkBrowser.browse(discordInvite))
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
clientToolbar.addNavigation(discordButton);
|
clientToolbar.addNavigation(discordButton);
|
||||||
|
|||||||
@@ -35,8 +35,8 @@ import java.util.UUID;
|
|||||||
import java.util.concurrent.atomic.AtomicBoolean;
|
import java.util.concurrent.atomic.AtomicBoolean;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
import javax.inject.Named;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import net.runelite.client.RuneLiteProperties;
|
|
||||||
import net.runelite.client.discord.DiscordPresence;
|
import net.runelite.client.discord.DiscordPresence;
|
||||||
import net.runelite.client.discord.DiscordService;
|
import net.runelite.client.discord.DiscordService;
|
||||||
import net.runelite.client.ws.PartyService;
|
import net.runelite.client.ws.PartyService;
|
||||||
@@ -60,14 +60,24 @@ class DiscordState
|
|||||||
private final DiscordService discordService;
|
private final DiscordService discordService;
|
||||||
private final DiscordConfig config;
|
private final DiscordConfig config;
|
||||||
private final PartyService party;
|
private final PartyService party;
|
||||||
|
private final String runeliteTitle;
|
||||||
|
private final String runeliteVersion;
|
||||||
private DiscordPresence lastPresence;
|
private DiscordPresence lastPresence;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private DiscordState(final DiscordService discordService, final DiscordConfig config, final PartyService party)
|
private DiscordState(
|
||||||
|
final DiscordService discordService,
|
||||||
|
final DiscordConfig config,
|
||||||
|
final PartyService party,
|
||||||
|
@Named("runelite.title") final String runeliteTitle,
|
||||||
|
@Named("runelite.version") final String runeliteVersion
|
||||||
|
)
|
||||||
{
|
{
|
||||||
this.discordService = discordService;
|
this.discordService = discordService;
|
||||||
this.config = config;
|
this.config = config;
|
||||||
this.party = party;
|
this.party = party;
|
||||||
|
this.runeliteTitle = runeliteTitle;
|
||||||
|
this.runeliteVersion = runeliteVersion;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -188,12 +198,12 @@ class DiscordState
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Replace snapshot with + to make tooltip shorter (so it will span only 1 line)
|
// Replace snapshot with + to make tooltip shorter (so it will span only 1 line)
|
||||||
final String versionShortHand = RuneLiteProperties.getVersion().replace("-SNAPSHOT", "+");
|
final String versionShortHand = runeliteVersion.replace("-SNAPSHOT", "+");
|
||||||
|
|
||||||
final DiscordPresence.DiscordPresenceBuilder presenceBuilder = DiscordPresence.builder()
|
final DiscordPresence.DiscordPresenceBuilder presenceBuilder = DiscordPresence.builder()
|
||||||
.state(MoreObjects.firstNonNull(state, ""))
|
.state(MoreObjects.firstNonNull(state, ""))
|
||||||
.details(MoreObjects.firstNonNull(details, ""))
|
.details(MoreObjects.firstNonNull(details, ""))
|
||||||
.largeImageText(RuneLiteProperties.getTitle() + " v" + versionShortHand)
|
.largeImageText(runeliteTitle + " v" + versionShortHand)
|
||||||
.smallImageKey(imageKey)
|
.smallImageKey(imageKey)
|
||||||
.partyMax(PARTY_MAX)
|
.partyMax(PARTY_MAX)
|
||||||
.partySize(party.getMembers().size());
|
.partySize(party.getMembers().size());
|
||||||
|
|||||||
@@ -242,8 +242,6 @@ public class GpuPlugin extends Plugin implements DrawCallbacks
|
|||||||
private AntiAliasingMode lastAntiAliasingMode;
|
private AntiAliasingMode lastAntiAliasingMode;
|
||||||
private int lastAnisotropicFilteringLevel = -1;
|
private int lastAnisotropicFilteringLevel = -1;
|
||||||
|
|
||||||
private int centerX;
|
|
||||||
private int centerY;
|
|
||||||
private int yaw;
|
private int yaw;
|
||||||
private int pitch;
|
private int pitch;
|
||||||
// fields for non-compute draw
|
// fields for non-compute draw
|
||||||
@@ -264,6 +262,7 @@ public class GpuPlugin extends Plugin implements DrawCallbacks
|
|||||||
private int uniTexSamplingMode;
|
private int uniTexSamplingMode;
|
||||||
private int uniTexSourceDimensions;
|
private int uniTexSourceDimensions;
|
||||||
private int uniTexTargetDimensions;
|
private int uniTexTargetDimensions;
|
||||||
|
private int uniUiAlphaOverlay;
|
||||||
private int uniTextures;
|
private int uniTextures;
|
||||||
private int uniTextureOffsets;
|
private int uniTextureOffsets;
|
||||||
private int uniBlockSmall;
|
private int uniBlockSmall;
|
||||||
@@ -545,6 +544,7 @@ public class GpuPlugin extends Plugin implements DrawCallbacks
|
|||||||
uniTexTargetDimensions = gl.glGetUniformLocation(glUiProgram, "targetDimensions");
|
uniTexTargetDimensions = gl.glGetUniformLocation(glUiProgram, "targetDimensions");
|
||||||
uniTexSourceDimensions = gl.glGetUniformLocation(glUiProgram, "sourceDimensions");
|
uniTexSourceDimensions = gl.glGetUniformLocation(glUiProgram, "sourceDimensions");
|
||||||
uniUiColorBlindMode = gl.glGetUniformLocation(glUiProgram, "colorBlindMode");
|
uniUiColorBlindMode = gl.glGetUniformLocation(glUiProgram, "colorBlindMode");
|
||||||
|
uniUiAlphaOverlay = gl.glGetUniformLocation(glUiProgram, "alphaOverlay");
|
||||||
uniTextures = gl.glGetUniformLocation(glProgram, "textures");
|
uniTextures = gl.glGetUniformLocation(glProgram, "textures");
|
||||||
uniTextureOffsets = gl.glGetUniformLocation(glProgram, "textureOffsets");
|
uniTextureOffsets = gl.glGetUniformLocation(glProgram, "textureOffsets");
|
||||||
|
|
||||||
@@ -774,13 +774,149 @@ public class GpuPlugin extends Plugin implements DrawCallbacks
|
|||||||
@Override
|
@Override
|
||||||
public void drawScene(int cameraX, int cameraY, int cameraZ, int cameraPitch, int cameraYaw, int plane)
|
public void drawScene(int cameraX, int cameraY, int cameraZ, int cameraPitch, int cameraYaw, int plane)
|
||||||
{
|
{
|
||||||
centerX = client.getCenterX();
|
|
||||||
centerY = client.getCenterY();
|
|
||||||
yaw = client.getCameraYaw();
|
yaw = client.getCameraYaw();
|
||||||
pitch = client.getCameraPitch();
|
pitch = client.getCameraPitch();
|
||||||
|
|
||||||
final Scene scene = client.getScene();
|
final Scene scene = client.getScene();
|
||||||
scene.setDrawDistance(getDrawDistance());
|
scene.setDrawDistance(getDrawDistance());
|
||||||
|
|
||||||
|
invokeOnMainThread(() ->
|
||||||
|
{
|
||||||
|
// UBO. Only the first 32 bytes get modified here, the rest is the constant sin/cos table.
|
||||||
|
gl.glBindBuffer(gl.GL_UNIFORM_BUFFER, uniformBufferId);
|
||||||
|
uniformBuffer.clear();
|
||||||
|
uniformBuffer
|
||||||
|
.put(yaw)
|
||||||
|
.put(pitch)
|
||||||
|
.put(client.getCenterX())
|
||||||
|
.put(client.getCenterY())
|
||||||
|
.put(client.getScale())
|
||||||
|
.put(client.getCameraX2())
|
||||||
|
.put(client.getCameraY2())
|
||||||
|
.put(client.getCameraZ2());
|
||||||
|
uniformBuffer.flip();
|
||||||
|
|
||||||
|
gl.glBufferSubData(gl.GL_UNIFORM_BUFFER, 0, uniformBuffer.limit() * Integer.BYTES, uniformBuffer);
|
||||||
|
gl.glBindBuffer(gl.GL_UNIFORM_BUFFER, 0);
|
||||||
|
|
||||||
|
gl.glBindBufferBase(gl.GL_UNIFORM_BUFFER, 0, uniformBufferId);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void postDrawScene()
|
||||||
|
{
|
||||||
|
invokeOnMainThread(this::postDraw);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void postDraw()
|
||||||
|
{
|
||||||
|
if (!useComputeShaders)
|
||||||
|
{
|
||||||
|
// Upload buffers
|
||||||
|
vertexBuffer.flip();
|
||||||
|
uvBuffer.flip();
|
||||||
|
|
||||||
|
IntBuffer vertexBuffer = this.vertexBuffer.getBuffer();
|
||||||
|
FloatBuffer uvBuffer = this.uvBuffer.getBuffer();
|
||||||
|
|
||||||
|
gl.glBindBuffer(gl.GL_ARRAY_BUFFER, tmpBufferId);
|
||||||
|
gl.glBufferData(gl.GL_ARRAY_BUFFER, vertexBuffer.limit() * Integer.BYTES, vertexBuffer, gl.GL_DYNAMIC_DRAW);
|
||||||
|
|
||||||
|
gl.glBindBuffer(gl.GL_ARRAY_BUFFER, tmpUvBufferId);
|
||||||
|
gl.glBufferData(gl.GL_ARRAY_BUFFER, uvBuffer.limit() * Float.BYTES, uvBuffer, gl.GL_DYNAMIC_DRAW);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Upload buffers
|
||||||
|
vertexBuffer.flip();
|
||||||
|
uvBuffer.flip();
|
||||||
|
modelBuffer.flip();
|
||||||
|
modelBufferSmall.flip();
|
||||||
|
modelBufferUnordered.flip();
|
||||||
|
|
||||||
|
IntBuffer vertexBuffer = this.vertexBuffer.getBuffer();
|
||||||
|
FloatBuffer uvBuffer = this.uvBuffer.getBuffer();
|
||||||
|
IntBuffer modelBuffer = this.modelBuffer.getBuffer();
|
||||||
|
IntBuffer modelBufferSmall = this.modelBufferSmall.getBuffer();
|
||||||
|
IntBuffer modelBufferUnordered = this.modelBufferUnordered.getBuffer();
|
||||||
|
|
||||||
|
gl.glBindBuffer(gl.GL_ARRAY_BUFFER, tmpBufferId);
|
||||||
|
gl.glBufferData(gl.GL_ARRAY_BUFFER, vertexBuffer.limit() * Integer.BYTES, vertexBuffer, gl.GL_DYNAMIC_DRAW);
|
||||||
|
|
||||||
|
gl.glBindBuffer(gl.GL_ARRAY_BUFFER, tmpUvBufferId);
|
||||||
|
gl.glBufferData(gl.GL_ARRAY_BUFFER, uvBuffer.limit() * Float.BYTES, uvBuffer, gl.GL_DYNAMIC_DRAW);
|
||||||
|
|
||||||
|
gl.glBindBuffer(gl.GL_ARRAY_BUFFER, tmpModelBufferId);
|
||||||
|
gl.glBufferData(gl.GL_ARRAY_BUFFER, modelBuffer.limit() * Integer.BYTES, modelBuffer, gl.GL_DYNAMIC_DRAW);
|
||||||
|
|
||||||
|
gl.glBindBuffer(gl.GL_ARRAY_BUFFER, tmpModelBufferSmallId);
|
||||||
|
gl.glBufferData(gl.GL_ARRAY_BUFFER, modelBufferSmall.limit() * Integer.BYTES, modelBufferSmall, gl.GL_DYNAMIC_DRAW);
|
||||||
|
|
||||||
|
gl.glBindBuffer(gl.GL_ARRAY_BUFFER, tmpModelBufferUnorderedId);
|
||||||
|
gl.glBufferData(gl.GL_ARRAY_BUFFER, modelBufferUnordered.limit() * Integer.BYTES, modelBufferUnordered, gl.GL_DYNAMIC_DRAW);
|
||||||
|
|
||||||
|
// Output buffers
|
||||||
|
gl.glBindBuffer(gl.GL_ARRAY_BUFFER, tmpOutBufferId);
|
||||||
|
gl.glBufferData(gl.GL_ARRAY_BUFFER,
|
||||||
|
targetBufferOffset * 16, // each vertex is an ivec4, which is 16 bytes
|
||||||
|
null,
|
||||||
|
gl.GL_STREAM_DRAW);
|
||||||
|
|
||||||
|
gl.glBindBuffer(gl.GL_ARRAY_BUFFER, tmpOutUvBufferId);
|
||||||
|
gl.glBufferData(gl.GL_ARRAY_BUFFER,
|
||||||
|
targetBufferOffset * 16,
|
||||||
|
null,
|
||||||
|
gl.GL_STREAM_DRAW);
|
||||||
|
|
||||||
|
// Bind UBO to compute programs
|
||||||
|
gl.glUniformBlockBinding(glSmallComputeProgram, uniBlockSmall, 0);
|
||||||
|
gl.glUniformBlockBinding(glComputeProgram, uniBlockLarge, 0);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Compute is split into three separate programs: 'unordered', 'small', and 'large'
|
||||||
|
* to save on GPU resources. Small will sort <= 512 faces, large will do <= 4096.
|
||||||
|
*/
|
||||||
|
|
||||||
|
// unordered
|
||||||
|
gl.glUseProgram(glUnorderedComputeProgram);
|
||||||
|
|
||||||
|
gl.glBindBufferBase(gl.GL_SHADER_STORAGE_BUFFER, 0, tmpModelBufferUnorderedId);
|
||||||
|
gl.glBindBufferBase(gl.GL_SHADER_STORAGE_BUFFER, 1, this.bufferId);
|
||||||
|
gl.glBindBufferBase(gl.GL_SHADER_STORAGE_BUFFER, 2, tmpBufferId);
|
||||||
|
gl.glBindBufferBase(gl.GL_SHADER_STORAGE_BUFFER, 3, tmpOutBufferId);
|
||||||
|
gl.glBindBufferBase(gl.GL_SHADER_STORAGE_BUFFER, 4, tmpOutUvBufferId);
|
||||||
|
gl.glBindBufferBase(gl.GL_SHADER_STORAGE_BUFFER, 5, this.uvBufferId);
|
||||||
|
gl.glBindBufferBase(gl.GL_SHADER_STORAGE_BUFFER, 6, tmpUvBufferId);
|
||||||
|
|
||||||
|
gl.glDispatchCompute(unorderedModels, 1, 1);
|
||||||
|
|
||||||
|
// small
|
||||||
|
gl.glUseProgram(glSmallComputeProgram);
|
||||||
|
|
||||||
|
gl.glBindBufferBase(gl.GL_SHADER_STORAGE_BUFFER, 0, tmpModelBufferSmallId);
|
||||||
|
gl.glBindBufferBase(gl.GL_SHADER_STORAGE_BUFFER, 1, this.bufferId);
|
||||||
|
gl.glBindBufferBase(gl.GL_SHADER_STORAGE_BUFFER, 2, tmpBufferId);
|
||||||
|
gl.glBindBufferBase(gl.GL_SHADER_STORAGE_BUFFER, 3, tmpOutBufferId);
|
||||||
|
gl.glBindBufferBase(gl.GL_SHADER_STORAGE_BUFFER, 4, tmpOutUvBufferId);
|
||||||
|
gl.glBindBufferBase(gl.GL_SHADER_STORAGE_BUFFER, 5, this.uvBufferId);
|
||||||
|
gl.glBindBufferBase(gl.GL_SHADER_STORAGE_BUFFER, 6, tmpUvBufferId);
|
||||||
|
|
||||||
|
gl.glDispatchCompute(smallModels, 1, 1);
|
||||||
|
|
||||||
|
// large
|
||||||
|
gl.glUseProgram(glComputeProgram);
|
||||||
|
|
||||||
|
gl.glBindBufferBase(gl.GL_SHADER_STORAGE_BUFFER, 0, tmpModelBufferId);
|
||||||
|
gl.glBindBufferBase(gl.GL_SHADER_STORAGE_BUFFER, 1, this.bufferId);
|
||||||
|
gl.glBindBufferBase(gl.GL_SHADER_STORAGE_BUFFER, 2, tmpBufferId);
|
||||||
|
gl.glBindBufferBase(gl.GL_SHADER_STORAGE_BUFFER, 3, tmpOutBufferId);
|
||||||
|
gl.glBindBufferBase(gl.GL_SHADER_STORAGE_BUFFER, 4, tmpOutUvBufferId);
|
||||||
|
gl.glBindBufferBase(gl.GL_SHADER_STORAGE_BUFFER, 5, this.uvBufferId);
|
||||||
|
gl.glBindBufferBase(gl.GL_SHADER_STORAGE_BUFFER, 6, tmpUvBufferId);
|
||||||
|
|
||||||
|
gl.glDispatchCompute(largeModels, 1, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -855,9 +991,9 @@ public class GpuPlugin extends Plugin implements DrawCallbacks
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void draw()
|
public void draw(int overlayColor)
|
||||||
{
|
{
|
||||||
invokeOnMainThread(this::drawFrame);
|
invokeOnMainThread(() -> drawFrame(overlayColor));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void resize(int canvasWidth, int canvasHeight, int viewportWidth, int viewportHeight)
|
private void resize(int canvasWidth, int canvasHeight, int viewportWidth, int viewportHeight)
|
||||||
@@ -883,7 +1019,7 @@ public class GpuPlugin extends Plugin implements DrawCallbacks
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void drawFrame()
|
private void drawFrame(int overlayColor)
|
||||||
{
|
{
|
||||||
if (jawtWindow.getAWTComponent() != client.getCanvas())
|
if (jawtWindow.getAWTComponent() != client.getCanvas())
|
||||||
{
|
{
|
||||||
@@ -953,121 +1089,10 @@ public class GpuPlugin extends Plugin implements DrawCallbacks
|
|||||||
gl.glClearColor((sky >> 16 & 0xFF) / 255f, (sky >> 8 & 0xFF) / 255f, (sky & 0xFF) / 255f, 1f);
|
gl.glClearColor((sky >> 16 & 0xFF) / 255f, (sky >> 8 & 0xFF) / 255f, (sky & 0xFF) / 255f, 1f);
|
||||||
gl.glClear(gl.GL_COLOR_BUFFER_BIT);
|
gl.glClear(gl.GL_COLOR_BUFFER_BIT);
|
||||||
|
|
||||||
// Upload buffers
|
|
||||||
vertexBuffer.flip();
|
|
||||||
uvBuffer.flip();
|
|
||||||
modelBuffer.flip();
|
|
||||||
modelBufferSmall.flip();
|
|
||||||
modelBufferUnordered.flip();
|
|
||||||
|
|
||||||
IntBuffer vertexBuffer = this.vertexBuffer.getBuffer();
|
|
||||||
FloatBuffer uvBuffer = this.uvBuffer.getBuffer();
|
|
||||||
IntBuffer modelBuffer = this.modelBuffer.getBuffer();
|
|
||||||
IntBuffer modelBufferSmall = this.modelBufferSmall.getBuffer();
|
|
||||||
IntBuffer modelBufferUnordered = this.modelBufferUnordered.getBuffer();
|
|
||||||
|
|
||||||
gl.glBindBuffer(gl.GL_ARRAY_BUFFER, tmpBufferId);
|
|
||||||
gl.glBufferData(gl.GL_ARRAY_BUFFER, vertexBuffer.limit() * Integer.BYTES, vertexBuffer, gl.GL_DYNAMIC_DRAW);
|
|
||||||
|
|
||||||
gl.glBindBuffer(gl.GL_ARRAY_BUFFER, tmpUvBufferId);
|
|
||||||
gl.glBufferData(gl.GL_ARRAY_BUFFER, uvBuffer.limit() * Float.BYTES, uvBuffer, gl.GL_DYNAMIC_DRAW);
|
|
||||||
|
|
||||||
gl.glBindBuffer(gl.GL_ARRAY_BUFFER, tmpModelBufferId);
|
|
||||||
gl.glBufferData(gl.GL_ARRAY_BUFFER, modelBuffer.limit() * Integer.BYTES, modelBuffer, gl.GL_DYNAMIC_DRAW);
|
|
||||||
|
|
||||||
gl.glBindBuffer(gl.GL_ARRAY_BUFFER, tmpModelBufferSmallId);
|
|
||||||
gl.glBufferData(gl.GL_ARRAY_BUFFER, modelBufferSmall.limit() * Integer.BYTES, modelBufferSmall, gl.GL_DYNAMIC_DRAW);
|
|
||||||
|
|
||||||
gl.glBindBuffer(gl.GL_ARRAY_BUFFER, tmpModelBufferUnorderedId);
|
|
||||||
gl.glBufferData(gl.GL_ARRAY_BUFFER, modelBufferUnordered.limit() * Integer.BYTES, modelBufferUnordered, gl.GL_DYNAMIC_DRAW);
|
|
||||||
|
|
||||||
gl.glBindBuffer(gl.GL_ARRAY_BUFFER, tmpOutBufferId);
|
|
||||||
gl.glBufferData(gl.GL_ARRAY_BUFFER,
|
|
||||||
targetBufferOffset * 16, // each vertex is an ivec4, which is 16 bytes
|
|
||||||
null,
|
|
||||||
gl.GL_STREAM_DRAW);
|
|
||||||
|
|
||||||
gl.glBindBuffer(gl.GL_ARRAY_BUFFER, tmpOutUvBufferId);
|
|
||||||
gl.glBufferData(gl.GL_ARRAY_BUFFER,
|
|
||||||
targetBufferOffset * 16,
|
|
||||||
null,
|
|
||||||
gl.GL_STREAM_DRAW);
|
|
||||||
|
|
||||||
// UBO. Only the first 32 bytes get modified here, the rest is the constant sin/cos table.
|
|
||||||
gl.glBindBuffer(gl.GL_UNIFORM_BUFFER, uniformBufferId);
|
|
||||||
uniformBuffer.clear();
|
|
||||||
uniformBuffer
|
|
||||||
.put(yaw)
|
|
||||||
.put(pitch)
|
|
||||||
.put(centerX)
|
|
||||||
.put(centerY)
|
|
||||||
.put(client.getScale())
|
|
||||||
.put(client.getCameraX2())
|
|
||||||
.put(client.getCameraY2())
|
|
||||||
.put(client.getCameraZ2());
|
|
||||||
uniformBuffer.flip();
|
|
||||||
|
|
||||||
gl.glBufferSubData(gl.GL_UNIFORM_BUFFER, 0, uniformBuffer.limit() * Integer.BYTES, uniformBuffer);
|
|
||||||
gl.glBindBuffer(gl.GL_UNIFORM_BUFFER, 0);
|
|
||||||
|
|
||||||
gl.glBindBufferBase(gl.GL_UNIFORM_BUFFER, 0, uniformBufferId);
|
|
||||||
|
|
||||||
// Draw 3d scene
|
// Draw 3d scene
|
||||||
final TextureProvider textureProvider = client.getTextureProvider();
|
final TextureProvider textureProvider = client.getTextureProvider();
|
||||||
if (textureProvider != null)
|
if (textureProvider != null)
|
||||||
{
|
{
|
||||||
if (useComputeShaders)
|
|
||||||
{
|
|
||||||
gl.glUniformBlockBinding(glSmallComputeProgram, uniBlockSmall, 0);
|
|
||||||
gl.glUniformBlockBinding(glComputeProgram, uniBlockLarge, 0);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Compute is split into two separate programs 'small' and 'large' to
|
|
||||||
* save on GPU resources. Small will sort <= 512 faces, large will do <= 4096.
|
|
||||||
*/
|
|
||||||
|
|
||||||
// unordered
|
|
||||||
gl.glUseProgram(glUnorderedComputeProgram);
|
|
||||||
|
|
||||||
gl.glBindBufferBase(gl.GL_SHADER_STORAGE_BUFFER, 0, tmpModelBufferUnorderedId);
|
|
||||||
gl.glBindBufferBase(gl.GL_SHADER_STORAGE_BUFFER, 1, this.bufferId);
|
|
||||||
gl.glBindBufferBase(gl.GL_SHADER_STORAGE_BUFFER, 2, tmpBufferId);
|
|
||||||
gl.glBindBufferBase(gl.GL_SHADER_STORAGE_BUFFER, 3, tmpOutBufferId);
|
|
||||||
gl.glBindBufferBase(gl.GL_SHADER_STORAGE_BUFFER, 4, tmpOutUvBufferId);
|
|
||||||
gl.glBindBufferBase(gl.GL_SHADER_STORAGE_BUFFER, 5, this.uvBufferId);
|
|
||||||
gl.glBindBufferBase(gl.GL_SHADER_STORAGE_BUFFER, 6, tmpUvBufferId);
|
|
||||||
|
|
||||||
gl.glDispatchCompute(unorderedModels, 1, 1);
|
|
||||||
|
|
||||||
// small
|
|
||||||
gl.glUseProgram(glSmallComputeProgram);
|
|
||||||
|
|
||||||
gl.glBindBufferBase(gl.GL_SHADER_STORAGE_BUFFER, 0, tmpModelBufferSmallId);
|
|
||||||
gl.glBindBufferBase(gl.GL_SHADER_STORAGE_BUFFER, 1, this.bufferId);
|
|
||||||
gl.glBindBufferBase(gl.GL_SHADER_STORAGE_BUFFER, 2, tmpBufferId);
|
|
||||||
gl.glBindBufferBase(gl.GL_SHADER_STORAGE_BUFFER, 3, tmpOutBufferId);
|
|
||||||
gl.glBindBufferBase(gl.GL_SHADER_STORAGE_BUFFER, 4, tmpOutUvBufferId);
|
|
||||||
gl.glBindBufferBase(gl.GL_SHADER_STORAGE_BUFFER, 5, this.uvBufferId);
|
|
||||||
gl.glBindBufferBase(gl.GL_SHADER_STORAGE_BUFFER, 6, tmpUvBufferId);
|
|
||||||
|
|
||||||
gl.glDispatchCompute(smallModels, 1, 1);
|
|
||||||
|
|
||||||
// large
|
|
||||||
gl.glUseProgram(glComputeProgram);
|
|
||||||
|
|
||||||
gl.glBindBufferBase(gl.GL_SHADER_STORAGE_BUFFER, 0, tmpModelBufferId);
|
|
||||||
gl.glBindBufferBase(gl.GL_SHADER_STORAGE_BUFFER, 1, this.bufferId);
|
|
||||||
gl.glBindBufferBase(gl.GL_SHADER_STORAGE_BUFFER, 2, tmpBufferId);
|
|
||||||
gl.glBindBufferBase(gl.GL_SHADER_STORAGE_BUFFER, 3, tmpOutBufferId);
|
|
||||||
gl.glBindBufferBase(gl.GL_SHADER_STORAGE_BUFFER, 4, tmpOutUvBufferId);
|
|
||||||
gl.glBindBufferBase(gl.GL_SHADER_STORAGE_BUFFER, 5, this.uvBufferId);
|
|
||||||
gl.glBindBufferBase(gl.GL_SHADER_STORAGE_BUFFER, 6, tmpUvBufferId);
|
|
||||||
|
|
||||||
gl.glDispatchCompute(largeModels, 1, 1);
|
|
||||||
|
|
||||||
gl.glMemoryBarrier(gl.GL_SHADER_STORAGE_BARRIER_BIT);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (textureArrayId == -1)
|
if (textureArrayId == -1)
|
||||||
{
|
{
|
||||||
// lazy init textures as they may not be loaded at plugin start.
|
// lazy init textures as they may not be loaded at plugin start.
|
||||||
@@ -1166,14 +1191,28 @@ public class GpuPlugin extends Plugin implements DrawCallbacks
|
|||||||
// Draw buffers
|
// Draw buffers
|
||||||
gl.glBindVertexArray(vaoHandle);
|
gl.glBindVertexArray(vaoHandle);
|
||||||
|
|
||||||
// When using compute shaders, draw using the output buffer of the compute. Otherwise
|
int vertexBuffer, uvBuffer;
|
||||||
// only use the temporary buffers, which will contain the full scene.
|
if (useComputeShaders)
|
||||||
|
{
|
||||||
|
// Before reading the SSBOs written to from postDrawScene() we must insert a barrier
|
||||||
|
gl.glMemoryBarrier(gl.GL_SHADER_STORAGE_BARRIER_BIT);
|
||||||
|
// Draw using the output buffer of the compute
|
||||||
|
vertexBuffer = tmpOutBufferId;
|
||||||
|
uvBuffer = tmpOutUvBufferId;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Only use the temporary buffers, which will contain the full scene
|
||||||
|
vertexBuffer = tmpBufferId;
|
||||||
|
uvBuffer = tmpUvBufferId;
|
||||||
|
}
|
||||||
|
|
||||||
gl.glEnableVertexAttribArray(0);
|
gl.glEnableVertexAttribArray(0);
|
||||||
gl.glBindBuffer(gl.GL_ARRAY_BUFFER, useComputeShaders ? tmpOutBufferId : tmpBufferId);
|
gl.glBindBuffer(gl.GL_ARRAY_BUFFER, vertexBuffer);
|
||||||
gl.glVertexAttribIPointer(0, 4, gl.GL_INT, 0, 0);
|
gl.glVertexAttribIPointer(0, 4, gl.GL_INT, 0, 0);
|
||||||
|
|
||||||
gl.glEnableVertexAttribArray(1);
|
gl.glEnableVertexAttribArray(1);
|
||||||
gl.glBindBuffer(gl.GL_ARRAY_BUFFER, useComputeShaders ? tmpOutUvBufferId : tmpUvBufferId);
|
gl.glBindBuffer(gl.GL_ARRAY_BUFFER, uvBuffer);
|
||||||
gl.glVertexAttribPointer(1, 4, gl.GL_FLOAT, false, 0, 0);
|
gl.glVertexAttribPointer(1, 4, gl.GL_FLOAT, false, 0, 0);
|
||||||
|
|
||||||
gl.glDrawArrays(gl.GL_TRIANGLES, 0, targetBufferOffset);
|
gl.glDrawArrays(gl.GL_TRIANGLES, 0, targetBufferOffset);
|
||||||
@@ -1208,7 +1247,7 @@ public class GpuPlugin extends Plugin implements DrawCallbacks
|
|||||||
tempUvOffset = 0;
|
tempUvOffset = 0;
|
||||||
|
|
||||||
// Texture on UI
|
// Texture on UI
|
||||||
drawUi(canvasHeight, canvasWidth);
|
drawUi(overlayColor, canvasHeight, canvasWidth);
|
||||||
|
|
||||||
glDrawable.swapBuffers();
|
glDrawable.swapBuffers();
|
||||||
|
|
||||||
@@ -1226,7 +1265,7 @@ public class GpuPlugin extends Plugin implements DrawCallbacks
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
private void drawUi(final int canvasHeight, final int canvasWidth)
|
private void drawUi(final int overlayColor, final int canvasHeight, final int canvasWidth)
|
||||||
{
|
{
|
||||||
final BufferProvider bufferProvider = client.getBufferProvider();
|
final BufferProvider bufferProvider = client.getBufferProvider();
|
||||||
final int[] pixels = bufferProvider.getPixels();
|
final int[] pixels = bufferProvider.getPixels();
|
||||||
@@ -1254,6 +1293,12 @@ public class GpuPlugin extends Plugin implements DrawCallbacks
|
|||||||
gl.glUniform1i(uniTexSamplingMode, uiScalingMode.getMode());
|
gl.glUniform1i(uniTexSamplingMode, uiScalingMode.getMode());
|
||||||
gl.glUniform2i(uniTexSourceDimensions, canvasWidth, canvasHeight);
|
gl.glUniform2i(uniTexSourceDimensions, canvasWidth, canvasHeight);
|
||||||
gl.glUniform1i(uniUiColorBlindMode, config.colorBlindMode().ordinal());
|
gl.glUniform1i(uniUiColorBlindMode, config.colorBlindMode().ordinal());
|
||||||
|
gl.glUniform4f(uniUiAlphaOverlay,
|
||||||
|
(overlayColor >> 16 & 0xFF) / 255f,
|
||||||
|
(overlayColor >> 8 & 0xFF) / 255f,
|
||||||
|
(overlayColor & 0xFF) / 255f,
|
||||||
|
(overlayColor >>> 24) / 255f
|
||||||
|
);
|
||||||
|
|
||||||
if (client.isStretchedEnabled())
|
if (client.isStretchedEnabled())
|
||||||
{
|
{
|
||||||
@@ -1449,14 +1494,20 @@ public class GpuPlugin extends Plugin implements DrawCallbacks
|
|||||||
Model model = renderable instanceof Model ? (Model) renderable : renderable.getModel();
|
Model model = renderable instanceof Model ? (Model) renderable : renderable.getModel();
|
||||||
if (model != null)
|
if (model != null)
|
||||||
{
|
{
|
||||||
|
// Apply height to renderable from the model
|
||||||
|
if (model != renderable)
|
||||||
|
{
|
||||||
|
renderable.setModelHeight(model.getModelHeight());
|
||||||
|
}
|
||||||
|
|
||||||
model.calculateBoundsCylinder();
|
model.calculateBoundsCylinder();
|
||||||
model.calculateExtreme(orientation);
|
|
||||||
|
|
||||||
if (!isVisible(model, orientation, pitchSin, pitchCos, yawSin, yawCos, x, y, z, hash))
|
if (!isVisible(model, orientation, pitchSin, pitchCos, yawSin, yawCos, x, y, z, hash))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
model.calculateExtreme(orientation);
|
||||||
client.checkClickbox(model, orientation, pitchSin, pitchCos, yawSin, yawCos, x, y, z, hash);
|
client.checkClickbox(model, orientation, pitchSin, pitchCos, yawSin, yawCos, x, y, z, hash);
|
||||||
|
|
||||||
modelX = x + client.getCameraX2();
|
modelX = x + client.getCameraX2();
|
||||||
@@ -1480,13 +1531,13 @@ public class GpuPlugin extends Plugin implements DrawCallbacks
|
|||||||
Model model = (Model) renderable;
|
Model model = (Model) renderable;
|
||||||
|
|
||||||
model.calculateBoundsCylinder();
|
model.calculateBoundsCylinder();
|
||||||
model.calculateExtreme(orientation);
|
|
||||||
|
|
||||||
if (!isVisible(model, orientation, pitchSin, pitchCos, yawSin, yawCos, x, y, z, hash))
|
if (!isVisible(model, orientation, pitchSin, pitchCos, yawSin, yawCos, x, y, z, hash))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
model.calculateExtreme(orientation);
|
||||||
client.checkClickbox(model, orientation, pitchSin, pitchCos, yawSin, yawCos, x, y, z, hash);
|
client.checkClickbox(model, orientation, pitchSin, pitchCos, yawSin, yawCos, x, y, z, hash);
|
||||||
|
|
||||||
int tc = Math.min(MAX_TRIANGLE, model.getTrianglesCount());
|
int tc = Math.min(MAX_TRIANGLE, model.getTrianglesCount());
|
||||||
@@ -1512,16 +1563,19 @@ public class GpuPlugin extends Plugin implements DrawCallbacks
|
|||||||
if (model != null)
|
if (model != null)
|
||||||
{
|
{
|
||||||
// Apply height to renderable from the model
|
// Apply height to renderable from the model
|
||||||
model.setModelHeight(model.getModelHeight());
|
if (model != renderable)
|
||||||
|
{
|
||||||
|
renderable.setModelHeight(model.getModelHeight());
|
||||||
|
}
|
||||||
|
|
||||||
model.calculateBoundsCylinder();
|
model.calculateBoundsCylinder();
|
||||||
model.calculateExtreme(orientation);
|
|
||||||
|
|
||||||
if (!isVisible(model, orientation, pitchSin, pitchCos, yawSin, yawCos, x, y, z, hash))
|
if (!isVisible(model, orientation, pitchSin, pitchCos, yawSin, yawCos, x, y, z, hash))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
model.calculateExtreme(orientation);
|
||||||
client.checkClickbox(model, orientation, pitchSin, pitchCos, yawSin, yawCos, x, y, z, hash);
|
client.checkClickbox(model, orientation, pitchSin, pitchCos, yawSin, yawCos, x, y, z, hash);
|
||||||
|
|
||||||
boolean hasUv = model.getFaceTextures() != null;
|
boolean hasUv = model.getFaceTextures() != null;
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ public interface GrandExchangeConfig extends Config
|
|||||||
position = 1,
|
position = 1,
|
||||||
keyName = "quickLookup",
|
keyName = "quickLookup",
|
||||||
name = "Hotkey lookup (Alt + Left click)",
|
name = "Hotkey lookup (Alt + Left click)",
|
||||||
description = "Configures whether to enable the hotkey lookup for ge searches"
|
description = "Configures whether to enable the hotkey lookup for GE searches"
|
||||||
)
|
)
|
||||||
default boolean quickLookup()
|
default boolean quickLookup()
|
||||||
{
|
{
|
||||||
@@ -59,7 +59,7 @@ public interface GrandExchangeConfig extends Config
|
|||||||
position = 3,
|
position = 3,
|
||||||
keyName = "enableOsbPrices",
|
keyName = "enableOsbPrices",
|
||||||
name = "Enable OSB actively traded prices",
|
name = "Enable OSB actively traded prices",
|
||||||
description = "Shows the OSBuddy actively traded price at the GE"
|
description = "Shows the OSBuddy actively traded price on the GE buy interface"
|
||||||
)
|
)
|
||||||
default boolean enableOsbPrices()
|
default boolean enableOsbPrices()
|
||||||
{
|
{
|
||||||
@@ -92,8 +92,8 @@ public interface GrandExchangeConfig extends Config
|
|||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
position = 6,
|
position = 6,
|
||||||
keyName = "showTotal",
|
keyName = "showTotal",
|
||||||
name = "Show grand exchange total",
|
name = "Show GE total",
|
||||||
description = "Show grand exchange total"
|
description = "Display the total value of all trades at the top of the GE interface"
|
||||||
)
|
)
|
||||||
default boolean showTotal()
|
default boolean showTotal()
|
||||||
{
|
{
|
||||||
@@ -104,7 +104,7 @@ public interface GrandExchangeConfig extends Config
|
|||||||
position = 7,
|
position = 7,
|
||||||
keyName = "showExact",
|
keyName = "showExact",
|
||||||
name = "Show exact total value",
|
name = "Show exact total value",
|
||||||
description = "Show exact total value"
|
description = "When enabled along with the ‘Show GE total’ option, the unabbreviated value will be displayed"
|
||||||
)
|
)
|
||||||
default boolean showExact()
|
default boolean showExact()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ import java.awt.event.MouseAdapter;
|
|||||||
import java.awt.event.MouseEvent;
|
import java.awt.event.MouseEvent;
|
||||||
import java.util.concurrent.ScheduledExecutorService;
|
import java.util.concurrent.ScheduledExecutorService;
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
|
import javax.inject.Named;
|
||||||
import javax.inject.Singleton;
|
import javax.inject.Singleton;
|
||||||
import javax.swing.Box;
|
import javax.swing.Box;
|
||||||
import javax.swing.ImageIcon;
|
import javax.swing.ImageIcon;
|
||||||
@@ -91,6 +92,26 @@ public class InfoPanel extends PluginPanel
|
|||||||
@Inject
|
@Inject
|
||||||
private ConfigManager configManager;
|
private ConfigManager configManager;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
@Named("runelite.version")
|
||||||
|
private String runeliteVersion;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
@Named("runelite.github.link")
|
||||||
|
private String githubLink;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
@Named("runelite.discord.invite")
|
||||||
|
private String discordInvite;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
@Named("runelite.patreon.link")
|
||||||
|
private String patreonLink;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
@Named("runelite.wiki.link")
|
||||||
|
private String wikiLink;
|
||||||
|
|
||||||
static
|
static
|
||||||
{
|
{
|
||||||
ARROW_RIGHT_ICON = new ImageIcon(ImageUtil.getResourceStreamFromClass(InfoPanel.class, "/util/arrow_right.png"));
|
ARROW_RIGHT_ICON = new ImageIcon(ImageUtil.getResourceStreamFromClass(InfoPanel.class, "/util/arrow_right.png"));
|
||||||
@@ -114,7 +135,7 @@ public class InfoPanel extends PluginPanel
|
|||||||
|
|
||||||
final Font smallFont = FontManager.getRunescapeSmallFont();
|
final Font smallFont = FontManager.getRunescapeSmallFont();
|
||||||
|
|
||||||
JLabel version = new JLabel(htmlLabel("RuneLite version: ", RuneLiteProperties.getVersion()));
|
JLabel version = new JLabel(htmlLabel("RuneLite version: ", runeliteVersion));
|
||||||
version.setFont(smallFont);
|
version.setFont(smallFont);
|
||||||
|
|
||||||
JLabel revision = new JLabel();
|
JLabel revision = new JLabel();
|
||||||
@@ -173,10 +194,10 @@ public class InfoPanel extends PluginPanel
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
actionsContainer.add(buildLinkPanel(GITHUB_ICON, "Report an issue or", "make a suggestion", RuneLiteProperties.getGithubLink()));
|
actionsContainer.add(buildLinkPanel(GITHUB_ICON, "Report an issue or", "make a suggestion", githubLink));
|
||||||
actionsContainer.add(buildLinkPanel(DISCORD_ICON, "Talk to us on our", "Discord server", RuneLiteProperties.getDiscordInvite()));
|
actionsContainer.add(buildLinkPanel(DISCORD_ICON, "Talk to us on our", "Discord server", discordInvite));
|
||||||
actionsContainer.add(buildLinkPanel(PATREON_ICON, "Become a patron to", "help support RuneLite", RuneLiteProperties.getPatreonLink()));
|
actionsContainer.add(buildLinkPanel(PATREON_ICON, "Become a patron to", "help support RuneLite", patreonLink));
|
||||||
actionsContainer.add(buildLinkPanel(WIKI_ICON, "Information about", "RuneLite and plugins", RuneLiteProperties.getWikiLink()));
|
actionsContainer.add(buildLinkPanel(WIKI_ICON, "Information about", "RuneLite and plugins", wikiLink));
|
||||||
|
|
||||||
add(versionPanel, BorderLayout.NORTH);
|
add(versionPanel, BorderLayout.NORTH);
|
||||||
add(actionsContainer, BorderLayout.CENTER);
|
add(actionsContainer, BorderLayout.CENTER);
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ public class ItemStatChanges
|
|||||||
add(food(3), SHRIMPS, COOKED_MEAT, COOKED_CHICKEN, ROE, CHOCOLATE_BAR);
|
add(food(3), SHRIMPS, COOKED_MEAT, COOKED_CHICKEN, ROE, CHOCOLATE_BAR);
|
||||||
add(food(4), SARDINE, CAKE, _23_CAKE, SLICE_OF_CAKE, CHOCOLATEY_MILK, BAKED_POTATO, EDIBLE_SEAWEED, MOONLIGHT_MEAD);
|
add(food(4), SARDINE, CAKE, _23_CAKE, SLICE_OF_CAKE, CHOCOLATEY_MILK, BAKED_POTATO, EDIBLE_SEAWEED, MOONLIGHT_MEAD);
|
||||||
add(food(5), BREAD, HERRING, CHOCOLATE_CAKE, _23_CHOCOLATE_CAKE, CHOCOLATE_SLICE, COOKED_RABBIT, CHILLI_CON_CARNE,
|
add(food(5), BREAD, HERRING, CHOCOLATE_CAKE, _23_CHOCOLATE_CAKE, CHOCOLATE_SLICE, COOKED_RABBIT, CHILLI_CON_CARNE,
|
||||||
FRIED_MUSHROOMS, FRIED_ONIONS, REDBERRY_PIE, HALF_A_REDBERRY_PIE, CAVIAR, PYSK_FISH_0);
|
FRIED_MUSHROOMS, FRIED_ONIONS, REDBERRY_PIE, HALF_A_REDBERRY_PIE, CAVIAR, PYSK_FISH_0, COOKED_MYSTERY_MEAT);
|
||||||
add(food(6), CHOCICE, MACKEREL, MEAT_PIE, HALF_A_MEAT_PIE, GUANIC_BAT_0, ROAST_BIRD_MEAT,
|
add(food(6), CHOCICE, MACKEREL, MEAT_PIE, HALF_A_MEAT_PIE, GUANIC_BAT_0, ROAST_BIRD_MEAT,
|
||||||
SQUARE_SANDWICH, ROLL, BAGUETTE, TRIANGLE_SANDWICH, GIANT_CARP);
|
SQUARE_SANDWICH, ROLL, BAGUETTE, TRIANGLE_SANDWICH, GIANT_CARP);
|
||||||
add(food(7), TROUT, COD, PLAIN_PIZZA, _12_PLAIN_PIZZA, APPLE_PIE, HALF_AN_APPLE_PIE, ROAST_RABBIT,
|
add(food(7), TROUT, COD, PLAIN_PIZZA, _12_PLAIN_PIZZA, APPLE_PIE, HALF_AN_APPLE_PIE, ROAST_RABBIT,
|
||||||
@@ -111,6 +111,7 @@ public class ItemStatChanges
|
|||||||
add(combo(2, food(5), boost(STRENGTH, 4), heal(ATTACK, -3)), PREMADE_SGG, SHORT_GREEN_GUY);
|
add(combo(2, food(5), boost(STRENGTH, 4), heal(ATTACK, -3)), PREMADE_SGG, SHORT_GREEN_GUY);
|
||||||
add(combo(2, food(5), boost(STRENGTH, 7), heal(ATTACK, -4)), PREMADE_DR_DRAGON, DRUNK_DRAGON);
|
add(combo(2, food(5), boost(STRENGTH, 7), heal(ATTACK, -4)), PREMADE_DR_DRAGON, DRUNK_DRAGON);
|
||||||
add(combo(2, food(5), boost(STRENGTH, 7), heal(ATTACK, -4)), PREMADE_CHOC_SDY, CHOC_SATURDAY);
|
add(combo(2, food(5), boost(STRENGTH, 7), heal(ATTACK, -4)), PREMADE_CHOC_SDY, CHOC_SATURDAY);
|
||||||
|
add(combo(4, boost(ATTACK, 5), boost(STRENGTH, 5), heal(MAGIC, -5), heal(PRAYER, -5)), BLOOD_PINT);
|
||||||
|
|
||||||
// Sq'irk Juice
|
// Sq'irk Juice
|
||||||
add(heal(RUN_ENERGY, 5), WINTER_SQIRKJUICE);
|
add(heal(RUN_ENERGY, 5), WINTER_SQIRKJUICE);
|
||||||
|
|||||||
@@ -125,7 +125,7 @@ public class MenuEntrySwapperPlugin extends Plugin
|
|||||||
|
|
||||||
private static final Set<String> ESSENCE_MINE_NPCS = ImmutableSet.of(
|
private static final Set<String> ESSENCE_MINE_NPCS = ImmutableSet.of(
|
||||||
"aubury",
|
"aubury",
|
||||||
"wizard sedridor",
|
"sedridor",
|
||||||
"wizard distentor",
|
"wizard distentor",
|
||||||
"wizard cromperty",
|
"wizard cromperty",
|
||||||
"brimstail"
|
"brimstail"
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ import net.runelite.api.VarClientInt;
|
|||||||
import net.runelite.api.widgets.WidgetID;
|
import net.runelite.api.widgets.WidgetID;
|
||||||
import net.runelite.api.widgets.WidgetInfo;
|
import net.runelite.api.widgets.WidgetInfo;
|
||||||
import net.runelite.client.ui.overlay.Overlay;
|
import net.runelite.client.ui.overlay.Overlay;
|
||||||
|
import net.runelite.client.ui.overlay.OverlayLayer;
|
||||||
import net.runelite.client.ui.overlay.OverlayPosition;
|
import net.runelite.client.ui.overlay.OverlayPosition;
|
||||||
import net.runelite.client.ui.overlay.tooltip.Tooltip;
|
import net.runelite.client.ui.overlay.tooltip.Tooltip;
|
||||||
import net.runelite.client.ui.overlay.tooltip.TooltipManager;
|
import net.runelite.client.ui.overlay.tooltip.TooltipManager;
|
||||||
@@ -80,6 +81,9 @@ class MouseHighlightOverlay extends Overlay
|
|||||||
MouseHighlightOverlay(Client client, TooltipManager tooltipManager, MouseHighlightConfig config)
|
MouseHighlightOverlay(Client client, TooltipManager tooltipManager, MouseHighlightConfig config)
|
||||||
{
|
{
|
||||||
setPosition(OverlayPosition.DYNAMIC);
|
setPosition(OverlayPosition.DYNAMIC);
|
||||||
|
setLayer(OverlayLayer.ABOVE_WIDGETS);
|
||||||
|
// additionally allow tooltips above the full screen world map and welcome screen
|
||||||
|
drawAfterInterface(WidgetID.FULLSCREEN_CONTAINER_TLI);
|
||||||
this.client = client;
|
this.client = client;
|
||||||
this.tooltipManager = tooltipManager;
|
this.tooltipManager = tooltipManager;
|
||||||
this.config = config;
|
this.config = config;
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ import java.awt.Graphics2D;
|
|||||||
import java.time.Duration;
|
import java.time.Duration;
|
||||||
import java.time.Instant;
|
import java.time.Instant;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
import net.runelite.api.ObjectID;
|
||||||
import net.runelite.api.Point;
|
import net.runelite.api.Point;
|
||||||
import net.runelite.client.ui.overlay.Overlay;
|
import net.runelite.client.ui.overlay.Overlay;
|
||||||
import net.runelite.client.ui.overlay.OverlayLayer;
|
import net.runelite.client.ui.overlay.OverlayLayer;
|
||||||
@@ -39,6 +40,7 @@ import net.runelite.client.ui.overlay.components.ProgressPieComponent;
|
|||||||
class TearsOfGuthixOverlay extends Overlay
|
class TearsOfGuthixOverlay extends Overlay
|
||||||
{
|
{
|
||||||
private static final Color CYAN_ALPHA = new Color(Color.CYAN.getRed(), Color.CYAN.getGreen(), Color.CYAN.getBlue(), 100);
|
private static final Color CYAN_ALPHA = new Color(Color.CYAN.getRed(), Color.CYAN.getGreen(), Color.CYAN.getBlue(), 100);
|
||||||
|
private static final Color GREEN_ALPHA = new Color(Color.GREEN.getRed(), Color.GREEN.getGreen(), Color.GREEN.getBlue(), 100);
|
||||||
private static final Duration MAX_TIME = Duration.ofSeconds(9);
|
private static final Duration MAX_TIME = Duration.ofSeconds(9);
|
||||||
private final TearsOfGuthixPlugin plugin;
|
private final TearsOfGuthixPlugin plugin;
|
||||||
|
|
||||||
@@ -64,8 +66,20 @@ class TearsOfGuthixOverlay extends Overlay
|
|||||||
|
|
||||||
final ProgressPieComponent progressPie = new ProgressPieComponent();
|
final ProgressPieComponent progressPie = new ProgressPieComponent();
|
||||||
progressPie.setDiameter(15);
|
progressPie.setDiameter(15);
|
||||||
progressPie.setFill(CYAN_ALPHA);
|
|
||||||
progressPie.setBorderColor(Color.CYAN);
|
if (object.getId() == ObjectID.BLUE_TEARS ||
|
||||||
|
object.getId() == ObjectID.BLUE_TEARS_6665)
|
||||||
|
{
|
||||||
|
progressPie.setFill(CYAN_ALPHA);
|
||||||
|
progressPie.setBorderColor(Color.CYAN);
|
||||||
|
}
|
||||||
|
else if (object.getId() == ObjectID.GREEN_TEARS ||
|
||||||
|
object.getId() == ObjectID.GREEN_TEARS_6666)
|
||||||
|
{
|
||||||
|
progressPie.setFill(GREEN_ALPHA);
|
||||||
|
progressPie.setBorderColor(Color.GREEN);
|
||||||
|
}
|
||||||
|
|
||||||
progressPie.setPosition(position);
|
progressPie.setPosition(position);
|
||||||
|
|
||||||
final Duration duration = Duration.between(timer, Instant.now());
|
final Duration duration = Duration.between(timer, Instant.now());
|
||||||
|
|||||||
@@ -92,7 +92,9 @@ public class TearsOfGuthixPlugin extends Plugin
|
|||||||
DecorativeObject object = event.getDecorativeObject();
|
DecorativeObject object = event.getDecorativeObject();
|
||||||
|
|
||||||
if (object.getId() == ObjectID.BLUE_TEARS ||
|
if (object.getId() == ObjectID.BLUE_TEARS ||
|
||||||
object.getId() == ObjectID.BLUE_TEARS_6665)
|
object.getId() == ObjectID.BLUE_TEARS_6665 ||
|
||||||
|
object.getId() == ObjectID.GREEN_TEARS ||
|
||||||
|
object.getId() == ObjectID.GREEN_TEARS_6666)
|
||||||
{
|
{
|
||||||
if (client.getLocalPlayer().getWorldLocation().getRegionID() == TOG_REGION)
|
if (client.getLocalPlayer().getWorldLocation().getRegionID() == TOG_REGION)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ enum GameTimer
|
|||||||
OVERLOAD_RAID(ItemID.OVERLOAD_4_20996, GameTimerImageType.ITEM, "Overload", 5, ChronoUnit.MINUTES, true),
|
OVERLOAD_RAID(ItemID.OVERLOAD_4_20996, GameTimerImageType.ITEM, "Overload", 5, ChronoUnit.MINUTES, true),
|
||||||
PRAYER_ENHANCE(ItemID.PRAYER_ENHANCE_4, GameTimerImageType.ITEM, "Prayer enhance", 290, ChronoUnit.SECONDS, true),
|
PRAYER_ENHANCE(ItemID.PRAYER_ENHANCE_4, GameTimerImageType.ITEM, "Prayer enhance", 290, ChronoUnit.SECONDS, true),
|
||||||
GOD_WARS_ALTAR(SpriteID.SKILL_PRAYER, GameTimerImageType.SPRITE, "God wars altar", 10, ChronoUnit.MINUTES),
|
GOD_WARS_ALTAR(SpriteID.SKILL_PRAYER, GameTimerImageType.SPRITE, "God wars altar", 10, ChronoUnit.MINUTES),
|
||||||
CHARGE(SpriteID.SPELL_CHARGE, GameTimerImageType.SPRITE, "Charge", 6, ChronoUnit.MINUTES),
|
CHARGE(SpriteID.SPELL_CHARGE, GameTimerImageType.SPRITE, "Charge", 7, ChronoUnit.MINUTES),
|
||||||
STAFF_OF_THE_DEAD(ItemID.STAFF_OF_THE_DEAD, GameTimerImageType.ITEM, "Staff of the Dead", 1, ChronoUnit.MINUTES),
|
STAFF_OF_THE_DEAD(ItemID.STAFF_OF_THE_DEAD, GameTimerImageType.ITEM, "Staff of the Dead", 1, ChronoUnit.MINUTES),
|
||||||
ABYSSAL_SIRE_STUN(ItemID.ABYSSAL_ORPHAN, GameTimerImageType.ITEM, "Abyssal Sire Stun", 30, ChronoUnit.SECONDS, true),
|
ABYSSAL_SIRE_STUN(ItemID.ABYSSAL_ORPHAN, GameTimerImageType.ITEM, "Abyssal Sire Stun", 30, ChronoUnit.SECONDS, true),
|
||||||
HOME_TELEPORT(SpriteID.SPELL_LUMBRIDGE_HOME_TELEPORT, GameTimerImageType.SPRITE, "Home Teleport", 30, ChronoUnit.MINUTES),
|
HOME_TELEPORT(SpriteID.SPELL_LUMBRIDGE_HOME_TELEPORT, GameTimerImageType.SPRITE, "Home Teleport", 30, ChronoUnit.MINUTES),
|
||||||
|
|||||||
@@ -219,7 +219,7 @@ class FarmingWorld
|
|||||||
|
|
||||||
add(new FarmingRegion("Lletya", 9265,
|
add(new FarmingRegion("Lletya", 9265,
|
||||||
new FarmingPatch("", Varbits.FARMING_4771, PatchImplementation.FRUIT_TREE)
|
new FarmingPatch("", Varbits.FARMING_4771, PatchImplementation.FRUIT_TREE)
|
||||||
));
|
), 11103);
|
||||||
|
|
||||||
add(new FarmingRegion("Lumbridge", 12851,
|
add(new FarmingRegion("Lumbridge", 12851,
|
||||||
new FarmingPatch("", Varbits.FARMING_4771, PatchImplementation.HOPS)
|
new FarmingPatch("", Varbits.FARMING_4771, PatchImplementation.HOPS)
|
||||||
|
|||||||
@@ -71,7 +71,6 @@ import net.runelite.api.Point;
|
|||||||
import net.runelite.api.events.GameStateChanged;
|
import net.runelite.api.events.GameStateChanged;
|
||||||
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.RuneLiteProperties;
|
|
||||||
import net.runelite.client.callback.ClientThread;
|
import net.runelite.client.callback.ClientThread;
|
||||||
import net.runelite.client.config.ConfigManager;
|
import net.runelite.client.config.ConfigManager;
|
||||||
import net.runelite.client.config.ExpandResizeType;
|
import net.runelite.client.config.ExpandResizeType;
|
||||||
@@ -122,6 +121,7 @@ public class ClientUI
|
|||||||
private final Provider<ClientThread> clientThreadProvider;
|
private final Provider<ClientThread> clientThreadProvider;
|
||||||
private final EventBus eventBus;
|
private final EventBus eventBus;
|
||||||
private final boolean safeMode;
|
private final boolean safeMode;
|
||||||
|
private final String title;
|
||||||
|
|
||||||
private final CardLayout cardLayout = new CardLayout();
|
private final CardLayout cardLayout = new CardLayout();
|
||||||
private final Rectangle sidebarButtonPosition = new Rectangle();
|
private final Rectangle sidebarButtonPosition = new Rectangle();
|
||||||
@@ -152,7 +152,9 @@ public class ClientUI
|
|||||||
ConfigManager configManager,
|
ConfigManager configManager,
|
||||||
Provider<ClientThread> clientThreadProvider,
|
Provider<ClientThread> clientThreadProvider,
|
||||||
EventBus eventBus,
|
EventBus eventBus,
|
||||||
@Named("safeMode") boolean safeMode)
|
@Named("safeMode") boolean safeMode,
|
||||||
|
@Named("runelite.title") String title
|
||||||
|
)
|
||||||
{
|
{
|
||||||
this.config = config;
|
this.config = config;
|
||||||
this.keyManager = keyManager;
|
this.keyManager = keyManager;
|
||||||
@@ -162,6 +164,7 @@ public class ClientUI
|
|||||||
this.clientThreadProvider = clientThreadProvider;
|
this.clientThreadProvider = clientThreadProvider;
|
||||||
this.eventBus = eventBus;
|
this.eventBus = eventBus;
|
||||||
this.safeMode = safeMode;
|
this.safeMode = safeMode;
|
||||||
|
this.title = title;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Subscribe
|
@Subscribe
|
||||||
@@ -294,7 +297,7 @@ public class ClientUI
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
frame.setTitle(RuneLiteProperties.getTitle() + " - " + name);
|
frame.setTitle(title + " - " + name);
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -321,7 +324,7 @@ public class ClientUI
|
|||||||
// Try to enable fullscreen on OSX
|
// Try to enable fullscreen on OSX
|
||||||
OSXUtil.tryEnableFullscreen(frame);
|
OSXUtil.tryEnableFullscreen(frame);
|
||||||
|
|
||||||
frame.setTitle(RuneLiteProperties.getTitle());
|
frame.setTitle(title);
|
||||||
frame.setIconImage(ICON);
|
frame.setIconImage(ICON);
|
||||||
frame.getLayeredPane().setCursor(Cursor.getDefaultCursor()); // Prevent substance from using a resize cursor for pointing
|
frame.getLayeredPane().setCursor(Cursor.getDefaultCursor()); // Prevent substance from using a resize cursor for pointing
|
||||||
frame.setLocationRelativeTo(frame.getOwner());
|
frame.setLocationRelativeTo(frame.getOwner());
|
||||||
@@ -507,7 +510,7 @@ public class ClientUI
|
|||||||
frame.revalidateMinimumSize();
|
frame.revalidateMinimumSize();
|
||||||
|
|
||||||
// Create tray icon (needs to be created after frame is packed)
|
// Create tray icon (needs to be created after frame is packed)
|
||||||
trayIcon = SwingUtil.createTrayIcon(ICON, RuneLiteProperties.getTitle(), frame);
|
trayIcon = SwingUtil.createTrayIcon(ICON, title, frame);
|
||||||
|
|
||||||
// Move frame around (needs to be done after frame is packed)
|
// Move frame around (needs to be done after frame is packed)
|
||||||
if (config.rememberScreenBounds() && !safeMode)
|
if (config.rememberScreenBounds() && !safeMode)
|
||||||
@@ -1034,12 +1037,12 @@ public class ClientUI
|
|||||||
|
|
||||||
if (player != null && player.getName() != null)
|
if (player != null && player.getName() != null)
|
||||||
{
|
{
|
||||||
frame.setTitle(RuneLiteProperties.getTitle() + " - " + player.getName());
|
frame.setTitle(title + " - " + player.getName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
frame.setTitle(RuneLiteProperties.getTitle());
|
frame.setTitle(title);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (frame.isAlwaysOnTopSupported())
|
if (frame.isAlwaysOnTopSupported())
|
||||||
@@ -1118,4 +1121,4 @@ public class ClientUI
|
|||||||
configManager.setConfiguration(CONFIG_GROUP, CONFIG_CLIENT_BOUNDS, bounds);
|
configManager.setConfiguration(CONFIG_GROUP, CONFIG_CLIENT_BOUNDS, bounds);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -61,8 +61,8 @@ public class TooltipOverlay extends Overlay
|
|||||||
setPosition(OverlayPosition.TOOLTIP);
|
setPosition(OverlayPosition.TOOLTIP);
|
||||||
setPriority(OverlayPriority.HIGHEST);
|
setPriority(OverlayPriority.HIGHEST);
|
||||||
setLayer(OverlayLayer.ABOVE_WIDGETS);
|
setLayer(OverlayLayer.ABOVE_WIDGETS);
|
||||||
// additionally allow tooltips above the world map
|
// additionally allow tooltips above the full screen world map and welcome screen
|
||||||
drawAfterInterface(WidgetID.WORLD_MAP_GROUP_ID);
|
drawAfterInterface(WidgetID.FULLSCREEN_CONTAINER_TLI);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -45,6 +45,7 @@ import java.util.EnumSet;
|
|||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
import javax.imageio.ImageIO;
|
import javax.imageio.ImageIO;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
import javax.inject.Named;
|
||||||
import javax.inject.Singleton;
|
import javax.inject.Singleton;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
@@ -53,7 +54,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.client.RuneLiteProperties;
|
|
||||||
import net.runelite.http.api.RuneLiteAPI;
|
import net.runelite.http.api.RuneLiteAPI;
|
||||||
import okhttp3.Call;
|
import okhttp3.Call;
|
||||||
import okhttp3.Callback;
|
import okhttp3.Callback;
|
||||||
@@ -72,14 +72,24 @@ public class ImageCapture
|
|||||||
private static final HttpUrl IMGUR_IMAGE_UPLOAD_URL = HttpUrl.parse("https://api.imgur.com/3/image");
|
private static final HttpUrl IMGUR_IMAGE_UPLOAD_URL = HttpUrl.parse("https://api.imgur.com/3/image");
|
||||||
private static final MediaType JSON = MediaType.parse("application/json");
|
private static final MediaType JSON = MediaType.parse("application/json");
|
||||||
|
|
||||||
@Inject
|
private final Client client;
|
||||||
private Client client;
|
private final Notifier notifier;
|
||||||
|
private final OkHttpClient okHttpClient;
|
||||||
|
private final String imgurClientId;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private Notifier notifier;
|
private ImageCapture(
|
||||||
|
final Client client,
|
||||||
@Inject
|
final Notifier notifier,
|
||||||
private OkHttpClient okHttpClient;
|
final OkHttpClient okHttpClient,
|
||||||
|
@Named("runelite.imgur.client.id") final String imgurClientId
|
||||||
|
)
|
||||||
|
{
|
||||||
|
this.client = client;
|
||||||
|
this.notifier = notifier;
|
||||||
|
this.okHttpClient = okHttpClient;
|
||||||
|
this.imgurClientId = imgurClientId;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Saves a screenshot of the client window to the screenshot folder as a PNG,
|
* Saves a screenshot of the client window to the screenshot folder as a PNG,
|
||||||
@@ -198,7 +208,7 @@ public class ImageCapture
|
|||||||
|
|
||||||
Request request = new Request.Builder()
|
Request request = new Request.Builder()
|
||||||
.url(IMGUR_IMAGE_UPLOAD_URL)
|
.url(IMGUR_IMAGE_UPLOAD_URL)
|
||||||
.addHeader("Authorization", "Client-ID " + RuneLiteProperties.getImgurClientId())
|
.addHeader("Authorization", "Client-ID " + imgurClientId)
|
||||||
.post(RequestBody.create(JSON, json))
|
.post(RequestBody.create(JSON, json))
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
|
|||||||
@@ -207,55 +207,4 @@ public class LinkBrowser
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Tries to open the specified {@code File} with the systems default text editor. If operation fails
|
|
||||||
* an error message is displayed with the option to copy the absolute file path to clipboard.
|
|
||||||
*
|
|
||||||
* @param file the File instance of the log file
|
|
||||||
* @return did the file open successfully?
|
|
||||||
*/
|
|
||||||
public static boolean openLocalFile(final File file)
|
|
||||||
{
|
|
||||||
if (file == null || !file.exists())
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (attemptOpenLocalFile(file))
|
|
||||||
{
|
|
||||||
log.debug("Opened log file through Desktop#edit to {}", file);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
showMessageBox("Unable to open log file. Press 'OK' and the file path will be copied to your clipboard", file.getAbsolutePath());
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static boolean attemptOpenLocalFile(final File file)
|
|
||||||
{
|
|
||||||
if (!Desktop.isDesktopSupported())
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
final Desktop desktop = Desktop.getDesktop();
|
|
||||||
|
|
||||||
if (!desktop.isSupported(Desktop.Action.OPEN))
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
desktop.open(file);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
catch (IOException ex)
|
|
||||||
{
|
|
||||||
log.warn("Failed to open Desktop#edit {}", file, ex);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 15 KiB |
@@ -1,15 +0,0 @@
|
|||||||
runelite.version=@project.version@
|
|
||||||
runescape.version=@rs.version@
|
|
||||||
open.osrs.discord.appid=627741263881568257
|
|
||||||
runelite.discord.invite=https://discord.gg/openosrs
|
|
||||||
runelite.github.link=https://github.com/open-osrs/runelite
|
|
||||||
runelite.wiki.link=https://github.com/open-osrs/runelite/wiki
|
|
||||||
runelite.patreon.link=https://www.patreon.com/openosrs
|
|
||||||
open.osrs.title=OpenOSRS
|
|
||||||
open.osrs.version=@open.osrs.version@
|
|
||||||
open.osrs.builddate=@open.osrs.builddate@
|
|
||||||
runelite.wiki.troubleshooting.link=https://github.com/open-osrs/runelite/wiki/Troubleshooting-problems-with-the-client
|
|
||||||
runelite.wiki.building.link=https://github.com/open-osrs/runelite/wiki/Building-with-IntelliJ-IDEA
|
|
||||||
runelite.dnschange.link=https://1.1.1.1/dns/
|
|
||||||
plugin.path=@plugin.path@
|
|
||||||
runelite.imgur.client.id=30d71e5f6860809
|
|
||||||
|
Before Width: | Height: | Size: 211 B |
@@ -29,8 +29,6 @@
|
|||||||
|
|
||||||
layout(local_size_x = 6) in;
|
layout(local_size_x = 6) in;
|
||||||
|
|
||||||
#include common.glsl
|
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
uint groupId = gl_WorkGroupID.x;
|
uint groupId = gl_WorkGroupID.x;
|
||||||
uint localId = gl_LocalInvocationID.x;
|
uint localId = gl_LocalInvocationID.x;
|
||||||
@@ -41,7 +39,6 @@ void main() {
|
|||||||
int outOffset = minfo.idx;
|
int outOffset = minfo.idx;
|
||||||
int uvOffset = minfo.uvOffset;
|
int uvOffset = minfo.uvOffset;
|
||||||
int flags = minfo.flags;
|
int flags = minfo.flags;
|
||||||
int orientation = flags & 0x7ff;
|
|
||||||
ivec4 pos = ivec4(minfo.x, minfo.y, minfo.z, 0);
|
ivec4 pos = ivec4(minfo.x, minfo.y, minfo.z, 0);
|
||||||
|
|
||||||
if (localId >= size) {
|
if (localId >= size) {
|
||||||
@@ -62,16 +59,12 @@ void main() {
|
|||||||
thisC = tempvb[offset + ssboOffset * 3 + 2];
|
thisC = tempvb[offset + ssboOffset * 3 + 2];
|
||||||
}
|
}
|
||||||
|
|
||||||
ivec4 thisrvA = rotate(thisA, orientation);
|
|
||||||
ivec4 thisrvB = rotate(thisB, orientation);
|
|
||||||
ivec4 thisrvC = rotate(thisC, orientation);
|
|
||||||
|
|
||||||
uint myOffset = localId;
|
uint myOffset = localId;
|
||||||
|
|
||||||
// position vertices in scene and write to out buffer
|
// position vertices in scene and write to out buffer
|
||||||
vout[outOffset + myOffset * 3] = pos + thisrvA;
|
vout[outOffset + myOffset * 3] = pos + thisA;
|
||||||
vout[outOffset + myOffset * 3 + 1] = pos + thisrvB;
|
vout[outOffset + myOffset * 3 + 1] = pos + thisB;
|
||||||
vout[outOffset + myOffset * 3 + 2] = pos + thisrvC;
|
vout[outOffset + myOffset * 3 + 2] = pos + thisC;
|
||||||
|
|
||||||
if (uvOffset < 0) {
|
if (uvOffset < 0) {
|
||||||
uvout[outOffset + myOffset * 3] = vec4(0, 0, 0, 0);
|
uvout[outOffset + myOffset * 3] = vec4(0, 0, 0, 0);
|
||||||
|
|||||||
@@ -43,26 +43,29 @@ out vec4 FragColor;
|
|||||||
#include colorblind.glsl
|
#include colorblind.glsl
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
int hsl = int(fHsl);
|
vec4 c;
|
||||||
vec3 rgb = hslToRgb(hsl) * smoothBanding + Color.rgb * (1.f - smoothBanding);
|
|
||||||
vec4 smoothColor = vec4(rgb, Color.a);
|
|
||||||
|
|
||||||
if (textureId > 0) {
|
if (textureId > 0) {
|
||||||
int textureIdx = textureId - 1;
|
int textureIdx = textureId - 1;
|
||||||
|
|
||||||
vec2 uv = fUv;
|
vec2 animatedUv = fUv + textureOffsets[textureIdx];
|
||||||
vec2 animatedUv = uv + textureOffsets[textureIdx];
|
|
||||||
|
|
||||||
vec4 textureColor = texture(textures, vec3(animatedUv, float(textureIdx)));
|
vec4 textureColor = texture(textures, vec3(animatedUv, float(textureIdx)));
|
||||||
vec4 textureColorBrightness = pow(textureColor, vec4(brightness, brightness, brightness, 1.0f));
|
vec4 textureColorBrightness = pow(textureColor, vec4(brightness, brightness, brightness, 1.0f));
|
||||||
|
|
||||||
smoothColor = textureColorBrightness * smoothColor;
|
// textured triangles hsl is a 7 bit lightness 2-126
|
||||||
|
float light = fHsl / 127.f;
|
||||||
|
c = textureColorBrightness * vec4(light, light, light, 1.f);
|
||||||
|
} else {
|
||||||
|
// pick interpolated hsl or rgb depending on smooth banding setting
|
||||||
|
vec3 rgb = hslToRgb(int(fHsl)) * smoothBanding + Color.rgb * (1.f - smoothBanding);
|
||||||
|
c = vec4(rgb, Color.a);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (colorBlindMode > 0) {
|
if (colorBlindMode > 0) {
|
||||||
smoothColor.rgb = colorblind(colorBlindMode, smoothColor.rgb);
|
c.rgb = colorblind(colorBlindMode, c.rgb);
|
||||||
}
|
}
|
||||||
|
|
||||||
vec3 mixedColor = mix(smoothColor.rgb, fogColor.rgb, fogAmount);
|
vec3 mixedColor = mix(c.rgb, fogColor.rgb, fogAmount);
|
||||||
FragColor = vec4(mixedColor, smoothColor.a);
|
FragColor = vec4(mixedColor, c.a);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ uniform int samplingMode;
|
|||||||
uniform ivec2 sourceDimensions;
|
uniform ivec2 sourceDimensions;
|
||||||
uniform ivec2 targetDimensions;
|
uniform ivec2 targetDimensions;
|
||||||
uniform int colorBlindMode;
|
uniform int colorBlindMode;
|
||||||
|
uniform vec4 alphaOverlay;
|
||||||
|
|
||||||
#include scale/bicubic.glsl
|
#include scale/bicubic.glsl
|
||||||
#include scale/xbr_lv2_frag.glsl
|
#include scale/xbr_lv2_frag.glsl
|
||||||
@@ -44,6 +45,13 @@ in XBRTable xbrTable;
|
|||||||
|
|
||||||
out vec4 FragColor;
|
out vec4 FragColor;
|
||||||
|
|
||||||
|
vec4 alphaBlend(vec4 src, vec4 dst) {
|
||||||
|
return vec4(
|
||||||
|
src.rgb + dst.rgb * (1.0f - src.a),
|
||||||
|
src.a + dst.a * (1.0f - src.a)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
vec4 c;
|
vec4 c;
|
||||||
|
|
||||||
@@ -51,14 +59,17 @@ void main() {
|
|||||||
case SAMPLING_CATROM:
|
case SAMPLING_CATROM:
|
||||||
case SAMPLING_MITCHELL:
|
case SAMPLING_MITCHELL:
|
||||||
c = textureCubic(tex, TexCoord, samplingMode);
|
c = textureCubic(tex, TexCoord, samplingMode);
|
||||||
|
c = alphaBlend(c, alphaOverlay);
|
||||||
c.rgb = colorblind(colorBlindMode, c.rgb);
|
c.rgb = colorblind(colorBlindMode, c.rgb);
|
||||||
break;
|
break;
|
||||||
case SAMPLING_XBR:
|
case SAMPLING_XBR:
|
||||||
c = textureXBR(tex, TexCoord, xbrTable, ceil(1.0 * targetDimensions.x / sourceDimensions.x));
|
c = textureXBR(tex, TexCoord, xbrTable, ceil(1.0 * targetDimensions.x / sourceDimensions.x));
|
||||||
|
c = alphaBlend(c, alphaOverlay);
|
||||||
c.rgb = colorblind(colorBlindMode, c.rgb);
|
c.rgb = colorblind(colorBlindMode, c.rgb);
|
||||||
break;
|
break;
|
||||||
default: // NEAREST or LINEAR, which uses GL_TEXTURE_MIN_FILTER/GL_TEXTURE_MAG_FILTER to affect sampling
|
default: // NEAREST or LINEAR, which uses GL_TEXTURE_MIN_FILTER/GL_TEXTURE_MAG_FILTER to affect sampling
|
||||||
c = texture(tex, TexCoord);
|
c = texture(tex, TexCoord);
|
||||||
|
c = alphaBlend(c, alphaOverlay);
|
||||||
c.rgb = colorblind(colorBlindMode, c.rgb);
|
c.rgb = colorblind(colorBlindMode, c.rgb);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 673 B |
|
Before Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 121 B |
|
Before Width: | Height: | Size: 384 B |
|
Before Width: | Height: | Size: 299 B |
|
Before Width: | Height: | Size: 312 B |
|
Before Width: | Height: | Size: 580 B |
@@ -360,6 +360,12 @@
|
|||||||
"name": "Extended Antifire (3)",
|
"name": "Extended Antifire (3)",
|
||||||
"xp": 82.5
|
"xp": 82.5
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"level": 84,
|
||||||
|
"icon": 11951,
|
||||||
|
"name": "Extended Antifire (4)",
|
||||||
|
"xp": 110
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"level": 86,
|
"level": 86,
|
||||||
"icon": 24635,
|
"icon": 24635,
|
||||||
@@ -378,6 +384,12 @@
|
|||||||
"name": "Anti-venom(3)",
|
"name": "Anti-venom(3)",
|
||||||
"xp": 90
|
"xp": 90
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"level": 87,
|
||||||
|
"icon": 12905,
|
||||||
|
"name": "Anti-venom(4)",
|
||||||
|
"xp": 120
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"level": 90,
|
"level": 90,
|
||||||
"icon": 12695,
|
"icon": 12695,
|
||||||
@@ -386,14 +398,14 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"level": 92,
|
"level": 92,
|
||||||
"icon": 21981,
|
"icon": 21978,
|
||||||
"name": "Super Antifire (3)",
|
"name": "Super Antifire (4)",
|
||||||
"xp": 130
|
"xp": 130
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"level": 94,
|
"level": 94,
|
||||||
"icon": 12915,
|
"icon": 12913,
|
||||||
"name": "Anti-venom+(3)",
|
"name": "Anti-venom+(4)",
|
||||||
"xp": 125
|
"xp": 125
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -974,7 +974,7 @@ c 7 4
|
|||||||
#100
|
#100
|
||||||
R 19 19 21 20
|
R 19 19 21 20
|
||||||
|
|
||||||
// Cosmic renderable's plane
|
// Cosmic entity's plane
|
||||||
#040404
|
#040404
|
||||||
r 32 75
|
r 32 75
|
||||||
|
|
||||||
|
|||||||
@@ -246,6 +246,9 @@ public abstract class RSClientMixin implements RSClient
|
|||||||
@Inject
|
@Inject
|
||||||
private static ArrayList<WidgetItem> widgetItems = new ArrayList<>();
|
private static ArrayList<WidgetItem> widgetItems = new ArrayList<>();
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
private static ArrayList<Widget> hiddenWidgets = new ArrayList<>();
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
@Override
|
@Override
|
||||||
public void setPrintMenuActions(boolean yes)
|
public void setPrintMenuActions(boolean yes)
|
||||||
@@ -1549,6 +1552,30 @@ public abstract class RSClientMixin implements RSClient
|
|||||||
widget.setRenderX(renderX);
|
widget.setRenderX(renderX);
|
||||||
widget.setRenderY(renderY);
|
widget.setRenderY(renderY);
|
||||||
|
|
||||||
|
if (widget.getContentType() == WidgetType.VIEWPORT)
|
||||||
|
{
|
||||||
|
client.setViewportColor(0);
|
||||||
|
}
|
||||||
|
else if (widget.getContentType() == WidgetType.RECTANGLE)
|
||||||
|
{
|
||||||
|
if (renderX == client.getViewportXOffset() && renderY == client.getViewportYOffset()
|
||||||
|
&& widget.getWidth() == client.getViewportWidth() && widget.getHeight() == client.getViewportHeight()
|
||||||
|
&& widget.getOpacity() > 0 && widget.isFilled() && client.isGpu())
|
||||||
|
{
|
||||||
|
int textColor = widget.getTextColor();
|
||||||
|
int alpha = widget.getOpacity() & 0xFF;
|
||||||
|
int inverseAlpha = 256 - alpha;
|
||||||
|
int viewportColor = client.getViewportColor();
|
||||||
|
int c1 = (alpha * (textColor & 0xff00ff) >> 8 & 0xFF00FF) + (alpha * (textColor & 0x00FF00) >> 8 & 0x00FF00);
|
||||||
|
int c2 = (inverseAlpha * (viewportColor & 0xff00ff) >> 8 & 0xFF00FF) + (inverseAlpha * (viewportColor & 0x00FF00) >> 8 & 0x00FF00);
|
||||||
|
int outAlpha = alpha + ((viewportColor >>> 24) * (255 - alpha) * 0x8081 >>> 23);
|
||||||
|
client.setViewportColor(outAlpha << 24 | c1 + c2);
|
||||||
|
widget.setHidden(true);
|
||||||
|
hiddenWidgets.add(widget);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
WidgetNode childNode = componentTable.get(widget.getId());
|
WidgetNode childNode = componentTable.get(widget.getId());
|
||||||
if (childNode != null)
|
if (childNode != null)
|
||||||
@@ -1565,10 +1592,6 @@ public abstract class RSClientMixin implements RSClient
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1649,6 +1672,15 @@ public abstract class RSClientMixin implements RSClient
|
|||||||
|
|
||||||
callbacks.drawInterface(group, widgetItems);
|
callbacks.drawInterface(group, widgetItems);
|
||||||
widgetItems.clear();
|
widgetItems.clear();
|
||||||
|
for (int i = hiddenWidgets.size() - 1; i >= 0; i--)
|
||||||
|
{
|
||||||
|
Widget widget = hiddenWidgets.get(i);
|
||||||
|
if (WidgetInfo.TO_GROUP(widget.getId()) == group)
|
||||||
|
{
|
||||||
|
widget.setHidden(false);
|
||||||
|
hiddenWidgets.remove(i);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ public abstract class RSGameShellMixin implements RSGameShell
|
|||||||
DrawCallbacks drawCallbacks = client.getDrawCallbacks();
|
DrawCallbacks drawCallbacks = client.getDrawCallbacks();
|
||||||
if (drawCallbacks != null)
|
if (drawCallbacks != null)
|
||||||
{
|
{
|
||||||
drawCallbacks.draw();
|
drawCallbacks.draw(client.getViewportColor());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -313,13 +313,19 @@ public abstract class RSSceneMixin implements RSScene
|
|||||||
client.setViewportWalking(false);
|
client.setViewportWalking(false);
|
||||||
}
|
}
|
||||||
client.getCallbacks().drawScene();
|
client.getCallbacks().drawScene();
|
||||||
|
|
||||||
|
if (client.getDrawCallbacks() != null)
|
||||||
|
{
|
||||||
|
client.getDrawCallbacks().postDrawScene();
|
||||||
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
outer:
|
||||||
for (int z = minLevel; z < maxY; ++z)
|
for (int z = minLevel; z < maxY; ++z)
|
||||||
{
|
{
|
||||||
RSTile[][] planeTiles = tiles[z];
|
RSTile[][] planeTiles = tiles[z];
|
||||||
@@ -378,17 +384,8 @@ public abstract class RSSceneMixin implements RSScene
|
|||||||
|
|
||||||
if (client.getTileUpdateCount() == 0)
|
if (client.getTileUpdateCount() == 0)
|
||||||
{
|
{
|
||||||
if (!isGpu && (client.getOculusOrbState() != 0 && !client.getComplianceValue("orbInteraction")))
|
// exit the loop early and go straight to "if (!isGpu && (client..."
|
||||||
{
|
break outer;
|
||||||
client.setEntitiesAtMouseCount(0);
|
|
||||||
}
|
|
||||||
client.setCheckClick(false);
|
|
||||||
if (!checkClick)
|
|
||||||
{
|
|
||||||
client.setViewportWalking(false);
|
|
||||||
}
|
|
||||||
client.getCallbacks().drawScene();
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -407,6 +404,10 @@ public abstract class RSSceneMixin implements RSScene
|
|||||||
client.setViewportWalking(false);
|
client.setViewportWalking(false);
|
||||||
}
|
}
|
||||||
client.getCallbacks().drawScene();
|
client.getCallbacks().drawScene();
|
||||||
|
if (client.getDrawCallbacks() != null)
|
||||||
|
{
|
||||||
|
client.getDrawCallbacks().postDrawScene();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Copy("newWallDecoration")
|
@Copy("newWallDecoration")
|
||||||
@@ -799,9 +800,9 @@ public abstract class RSSceneMixin implements RSScene
|
|||||||
@MethodHook(value = "addTile", end = true)
|
@MethodHook(value = "addTile", end = true)
|
||||||
@Inject
|
@Inject
|
||||||
public void rl$addTile(int z, int x, int y, int shape, int rotation, int texture, int heightSw, int heightNw,
|
public void rl$addTile(int z, int x, int y, int shape, int rotation, int texture, int heightSw, int heightNw,
|
||||||
int heightNe, int heightSe, int underlaySwColor, int underlayNwColor, int underlayNeColor,
|
int heightNe, int heightSe, int underlaySwColor, int underlayNwColor, int underlayNeColor,
|
||||||
int underlaySeColor, int overlaySwColor, int overlayNwColor, int overlayNeColor,
|
int underlaySeColor, int overlaySwColor, int overlayNwColor, int overlayNeColor,
|
||||||
int overlaySeColor, int underlayRgb, int overlayRgb)
|
int overlaySeColor, int underlayRgb, int overlayRgb)
|
||||||
{
|
{
|
||||||
if (shape != 0 && shape != 1)
|
if (shape != 0 && shape != 1)
|
||||||
{
|
{
|
||||||
@@ -938,28 +939,28 @@ public abstract class RSSceneMixin implements RSScene
|
|||||||
{
|
{
|
||||||
int lig = 0xFF - ((seLightness >> 1) * (seLightness >> 1) >> 8);
|
int lig = 0xFF - ((seLightness >> 1) * (seLightness >> 1) >> 8);
|
||||||
pixels[pixelOffset] = ((overlayRgb & 0xFF00FF) * lig & ~0xFF00FF) +
|
pixels[pixelOffset] = ((overlayRgb & 0xFF00FF) * lig & ~0xFF00FF) +
|
||||||
((overlayRgb & 0xFF00) * lig & 0xFF0000) >> 8;
|
((overlayRgb & 0xFF00) * lig & 0xFF0000) >> 8;
|
||||||
}
|
}
|
||||||
if (points[indices[shapeOffset++]] != 0)
|
if (points[indices[shapeOffset++]] != 0)
|
||||||
{
|
{
|
||||||
int lig = 0xFF - ((seLightness * 3 + neLightness >> 3) *
|
int lig = 0xFF - ((seLightness * 3 + neLightness >> 3) *
|
||||||
(seLightness * 3 + neLightness >> 3) >> 8);
|
(seLightness * 3 + neLightness >> 3) >> 8);
|
||||||
pixels[pixelOffset + 1] = ((overlayRgb & 0xFF00FF) * lig & ~0xFF00FF) +
|
pixels[pixelOffset + 1] = ((overlayRgb & 0xFF00FF) * lig & ~0xFF00FF) +
|
||||||
((overlayRgb & 0xFF00) * lig & 0xFF0000) >> 8;
|
((overlayRgb & 0xFF00) * lig & 0xFF0000) >> 8;
|
||||||
}
|
}
|
||||||
if (points[indices[shapeOffset++]] != 0)
|
if (points[indices[shapeOffset++]] != 0)
|
||||||
{
|
{
|
||||||
int lig = 0xFF - ((seLightness + neLightness >> 2) *
|
int lig = 0xFF - ((seLightness + neLightness >> 2) *
|
||||||
(seLightness + neLightness >> 2) >> 8);
|
(seLightness + neLightness >> 2) >> 8);
|
||||||
pixels[pixelOffset + 2] = ((overlayRgb & 0xFF00FF) * lig & ~0xFF00FF) +
|
pixels[pixelOffset + 2] = ((overlayRgb & 0xFF00FF) * lig & ~0xFF00FF) +
|
||||||
((overlayRgb & 0xFF00) * lig & 0xFF0000) >> 8;
|
((overlayRgb & 0xFF00) * lig & 0xFF0000) >> 8;
|
||||||
}
|
}
|
||||||
if (points[indices[shapeOffset++]] != 0)
|
if (points[indices[shapeOffset++]] != 0)
|
||||||
{
|
{
|
||||||
int lig = 0xFF - ((seLightness + neLightness * 3 >> 3) *
|
int lig = 0xFF - ((seLightness + neLightness * 3 >> 3) *
|
||||||
(seLightness + neLightness * 3 >> 3) >> 8);
|
(seLightness + neLightness * 3 >> 3) >> 8);
|
||||||
pixels[pixelOffset + 3] = ((overlayRgb & 0xFF00FF) * lig & ~0xFF00FF) +
|
pixels[pixelOffset + 3] = ((overlayRgb & 0xFF00FF) * lig & ~0xFF00FF) +
|
||||||
((overlayRgb & 0xFF00) * lig & 0xFF0000) >> 8;
|
((overlayRgb & 0xFF00) * lig & 0xFF0000) >> 8;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
seLightness += southDeltaLightness;
|
seLightness += southDeltaLightness;
|
||||||
@@ -1009,11 +1010,11 @@ public abstract class RSSceneMixin implements RSScene
|
|||||||
{
|
{
|
||||||
pixels[pixelOffset] = points[indices[shapeOffset++]] != 0 ? overlayRgb : underlayRgb;
|
pixels[pixelOffset] = points[indices[shapeOffset++]] != 0 ? overlayRgb : underlayRgb;
|
||||||
pixels[pixelOffset + 1] =
|
pixels[pixelOffset + 1] =
|
||||||
points[indices[shapeOffset++]] != 0 ? overlayRgb : underlayRgb;
|
points[indices[shapeOffset++]] != 0 ? overlayRgb : underlayRgb;
|
||||||
pixels[pixelOffset + 2] =
|
pixels[pixelOffset + 2] =
|
||||||
points[indices[shapeOffset++]] != 0 ? overlayRgb : underlayRgb;
|
points[indices[shapeOffset++]] != 0 ? overlayRgb : underlayRgb;
|
||||||
pixels[pixelOffset + 3] =
|
pixels[pixelOffset + 3] =
|
||||||
points[indices[shapeOffset++]] != 0 ? overlayRgb : underlayRgb;
|
points[indices[shapeOffset++]] != 0 ? overlayRgb : underlayRgb;
|
||||||
pixelOffset += width;
|
pixelOffset += width;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1042,4 +1043,4 @@ public abstract class RSSceneMixin implements RSScene
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1308,4 +1308,10 @@ public interface RSClient extends RSGameShell, Client
|
|||||||
|
|
||||||
@Import("pcmSampleLength")
|
@Import("pcmSampleLength")
|
||||||
void setPcmSampleLength(int var0);
|
void setPcmSampleLength(int var0);
|
||||||
|
|
||||||
|
@Import("viewportColor")
|
||||||
|
int getViewportColor();
|
||||||
|
|
||||||
|
@Import("viewportColor")
|
||||||
|
void setViewportColor(int i);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -929,7 +929,8 @@ public final class Client extends GameShell implements Usernamed {
|
|||||||
@ObfuscatedGetter(
|
@ObfuscatedGetter(
|
||||||
intValue = -380994417
|
intValue = -380994417
|
||||||
)
|
)
|
||||||
public static int field730;
|
@Export("viewportColor")
|
||||||
|
public static int viewportColor;
|
||||||
@ObfuscatedName("il")
|
@ObfuscatedName("il")
|
||||||
static boolean field649;
|
static boolean field649;
|
||||||
@ObfuscatedName("im")
|
@ObfuscatedName("im")
|
||||||
@@ -1366,7 +1367,7 @@ public final class Client extends GameShell implements Usernamed {
|
|||||||
field788 = 0; // L: 374
|
field788 = 0; // L: 374
|
||||||
oculusOrbNormalSpeed = 12; // L: 376
|
oculusOrbNormalSpeed = 12; // L: 376
|
||||||
oculusOrbSlowedSpeed = 6; // L: 377
|
oculusOrbSlowedSpeed = 6; // L: 377
|
||||||
field730 = 0; // L: 378
|
viewportColor = 0; // L: 378
|
||||||
field649 = false; // L: 379
|
field649 = false; // L: 379
|
||||||
field732 = 0; // L: 380
|
field732 = 0; // L: 380
|
||||||
field843 = false; // L: 381
|
field843 = false; // L: 381
|
||||||
@@ -5622,8 +5623,8 @@ public final class Client extends GameShell implements Usernamed {
|
|||||||
|
|
||||||
if (ServerPacket.field2146 == var1.serverPacket) { // L: 6617
|
if (ServerPacket.field2146 == var1.serverPacket) { // L: 6617
|
||||||
var16 = var3.readInt(); // L: 6618
|
var16 = var3.readInt(); // L: 6618
|
||||||
if (var16 != field730) { // L: 6619
|
if (var16 != viewportColor) { // L: 6619
|
||||||
field730 = var16; // L: 6620
|
viewportColor = var16; // L: 6620
|
||||||
WorldMapCacheName.method664(); // L: 6621
|
WorldMapCacheName.method664(); // L: 6621
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -202,7 +202,7 @@ public class SecureRandomFuture {
|
|||||||
var17 = (Decimator.oculusOrbFocalPointY >> 7) + class41.baseY; // L: 4384
|
var17 = (Decimator.oculusOrbFocalPointY >> 7) + class41.baseY; // L: 4384
|
||||||
PacketBufferNode var18 = ItemContainer.getPacketBufferNode(ClientPacket.field2269, Client.packetWriter.isaacCipher); // L: 4387
|
PacketBufferNode var18 = ItemContainer.getPacketBufferNode(ClientPacket.field2269, Client.packetWriter.isaacCipher); // L: 4387
|
||||||
var18.packetBuffer.method5578(var16); // L: 4388
|
var18.packetBuffer.method5578(var16); // L: 4388
|
||||||
var18.packetBuffer.method5587(Client.field730); // L: 4389
|
var18.packetBuffer.method5587(Client.viewportColor); // L: 4389
|
||||||
var18.packetBuffer.method5739(var17); // L: 4390
|
var18.packetBuffer.method5739(var17); // L: 4390
|
||||||
var18.packetBuffer.writeByte(var15); // L: 4391
|
var18.packetBuffer.writeByte(var15); // L: 4391
|
||||||
Client.packetWriter.addNode(var18); // L: 4392
|
Client.packetWriter.addNode(var18); // L: 4392
|
||||||
|
|||||||