staging
This commit is contained in:
@@ -43,11 +43,30 @@ public interface DrawCallbacks
|
||||
SceneTileModel model, int tileZ, int tileX, int tileY,
|
||||
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);
|
||||
|
||||
/**
|
||||
* 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);
|
||||
|
||||
/**
|
||||
* Called after the scene has been drawn
|
||||
*/
|
||||
void postDrawScene();
|
||||
|
||||
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 SKOTIZO_GROUP_ID = 308;
|
||||
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 SKILLS_GROUP_ID = 320;
|
||||
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_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_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 com.openosrs.client.ui.OpenOSRSSplashScreen;
|
||||
import net.runelite.client.util.ImageUtil;
|
||||
import net.runelite.client.util.LinkBrowser;
|
||||
import com.openosrs.client.util.LinkBrowser;
|
||||
|
||||
@Slf4j
|
||||
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.concurrent.ScheduledExecutorService;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import javax.inject.Named;
|
||||
import javax.inject.Singleton;
|
||||
import javax.sound.sampled.AudioInputStream;
|
||||
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_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 long CLIP_MTIME_UNLOADED = -2;
|
||||
private static final long CLIP_MTIME_BUILTIN = -1;
|
||||
@@ -113,6 +112,7 @@ public class Notifier
|
||||
private final ScheduledExecutorService executorService;
|
||||
private final ChatMessageManager chatMessageManager;
|
||||
private final EventBus eventBus;
|
||||
private final String appName;
|
||||
private final Path notifyIconPath;
|
||||
private boolean terminalNotifierAvailable;
|
||||
private Instant flashStart;
|
||||
@@ -127,7 +127,9 @@ public class Notifier
|
||||
final RuneLiteConfig runeliteConfig,
|
||||
final ScheduledExecutorService executorService,
|
||||
final ChatMessageManager chatMessageManager,
|
||||
final EventBus eventBus)
|
||||
final EventBus eventBus,
|
||||
@Named("runelite.title") final String appName
|
||||
)
|
||||
{
|
||||
this.client = client;
|
||||
this.clientUI = clientUI;
|
||||
@@ -135,6 +137,7 @@ public class Notifier
|
||||
this.executorService = executorService;
|
||||
this.chatMessageManager = chatMessageManager;
|
||||
this.eventBus = eventBus;
|
||||
this.appName = appName;
|
||||
this.notifyIconPath = RuneLite.RUNELITE_DIR.toPath().resolve("icon.png");
|
||||
|
||||
// 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 java.applet.Applet;
|
||||
import java.io.File;
|
||||
import java.util.Properties;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.LinkedBlockingQueue;
|
||||
@@ -75,6 +76,12 @@ public class RuneLiteModule extends AbstractModule
|
||||
@Override
|
||||
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("safeMode")).to(safeMode);
|
||||
bind(File.class).annotatedWith(Names.named("sessionfile")).toInstance(sessionfile);
|
||||
|
||||
@@ -28,18 +28,14 @@ import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.Properties;
|
||||
import javax.annotation.Nullable;
|
||||
import lombok.AccessLevel;
|
||||
import lombok.Getter;
|
||||
import okhttp3.HttpUrl;
|
||||
|
||||
public class RuneLiteProperties
|
||||
{
|
||||
private static final String RUNELITE_TITLE = "runelite.title";
|
||||
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 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 INSECURE_SKIP_TLS_VERIFICATION_PROPERTY = "runelite.insecure-skip-tls-verification";
|
||||
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 PLUGINHUB_BASE = "runelite.pluginhub.url";
|
||||
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();
|
||||
|
||||
static
|
||||
@@ -65,46 +61,16 @@ public class RuneLiteProperties
|
||||
}
|
||||
}
|
||||
|
||||
public static String getTitle()
|
||||
{
|
||||
return properties.getProperty(RUNELITE_TITLE);
|
||||
}
|
||||
|
||||
public static String getVersion()
|
||||
{
|
||||
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()
|
||||
{
|
||||
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
|
||||
public static String getLauncherVersion()
|
||||
{
|
||||
@@ -146,9 +112,4 @@ public class RuneLiteProperties
|
||||
String version = System.getProperty(PLUGINHUB_VERSION, properties.getProperty(PLUGINHUB_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.TimeUnit;
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Named;
|
||||
import javax.inject.Singleton;
|
||||
import lombok.Getter;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.runelite.client.RuneLiteProperties;
|
||||
import net.runelite.client.discord.events.DiscordDisconnected;
|
||||
import net.runelite.client.discord.events.DiscordErrored;
|
||||
import net.runelite.client.discord.events.DiscordJoinGame;
|
||||
@@ -50,6 +50,7 @@ public class DiscordService implements AutoCloseable
|
||||
{
|
||||
private final EventBus eventBus;
|
||||
private final ScheduledExecutorService executorService;
|
||||
private final String discordAppId;
|
||||
private final DiscordRPC discordRPC;
|
||||
|
||||
// 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
|
||||
private DiscordService(
|
||||
final EventBus eventBus,
|
||||
final ScheduledExecutorService executorService)
|
||||
final ScheduledExecutorService executorService,
|
||||
@Named("runelite.discord.appid") final String discordAppId
|
||||
)
|
||||
{
|
||||
|
||||
this.eventBus = eventBus;
|
||||
this.executorService = executorService;
|
||||
this.discordAppId = discordAppId;
|
||||
|
||||
DiscordRPC discordRPC = null;
|
||||
DiscordEventHandlers discordEventHandlers = null;
|
||||
@@ -103,7 +107,7 @@ public class DiscordService implements AutoCloseable
|
||||
discordEventHandlers.joinGame = this::joinGame;
|
||||
discordEventHandlers.spectateGame = this::spectateGame;
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
@@ -34,13 +34,13 @@ import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Named;
|
||||
import net.runelite.api.ChatMessageType;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.api.MessageNode;
|
||||
import net.runelite.api.events.ChatMessage;
|
||||
import net.runelite.api.events.GameStateChanged;
|
||||
import net.runelite.client.Notifier;
|
||||
import net.runelite.client.RuneLiteProperties;
|
||||
import net.runelite.client.chat.ChatColorType;
|
||||
import net.runelite.client.chat.ChatMessageManager;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
@@ -70,6 +70,10 @@ public class ChatNotificationsPlugin extends Plugin
|
||||
@Inject
|
||||
private Notifier notifier;
|
||||
|
||||
@Inject
|
||||
@Named("runelite.title")
|
||||
private String runeliteTitle;
|
||||
|
||||
//Custom Highlights
|
||||
private Pattern usernameMatcher = null;
|
||||
private String usernameReplacer = "";
|
||||
@@ -163,7 +167,7 @@ public class ChatNotificationsPlugin extends Plugin
|
||||
break;
|
||||
case CONSOLE:
|
||||
// Don't notify for notification messages
|
||||
if (chatMessage.getName().equals(RuneLiteProperties.getTitle()))
|
||||
if (chatMessage.getName().equals(runeliteTitle))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ public class WidgetInspectorOverlay extends Overlay
|
||||
setPosition(OverlayPosition.DYNAMIC);
|
||||
setLayer(OverlayLayer.ABOVE_WIDGETS);
|
||||
setPriority(OverlayPriority.HIGHEST);
|
||||
drawAfterInterface(WidgetID.FULLSCREEN_MAP_GROUP_ID);
|
||||
drawAfterInterface(WidgetID.FULLSCREEN_CONTAINER_TLI);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -121,7 +121,7 @@ enum DiscordGameEventType
|
||||
CITY_JATIZSO("Jatizso" , DiscordAreaType.CITIES, 9531),
|
||||
CITY_KELDAGRIM("Keldagrim" , DiscordAreaType.CITIES, 11423, 11422, 11679, 11678),
|
||||
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_LUMBRIDGE("Lumbridge" , DiscordAreaType.CITIES, 12850),
|
||||
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.UUID;
|
||||
import javax.imageio.ImageIO;
|
||||
import javax.inject.Named;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.runelite.api.Client;
|
||||
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.StatChanged;
|
||||
import net.runelite.api.events.VarbitChanged;
|
||||
import net.runelite.client.RuneLiteProperties;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.discord.DiscordService;
|
||||
import net.runelite.client.discord.events.DiscordJoinGame;
|
||||
@@ -106,6 +106,10 @@ public class DiscordPlugin extends Plugin
|
||||
@Inject
|
||||
private OkHttpClient okHttpClient;
|
||||
|
||||
@Inject
|
||||
@Named("runelite.discord.invite")
|
||||
private String discordInvite;
|
||||
|
||||
private final Map<Skill, Integer> skillExp = new HashMap<>();
|
||||
private NavigationButton discordButton;
|
||||
private boolean loginFlag;
|
||||
@@ -125,7 +129,7 @@ public class DiscordPlugin extends Plugin
|
||||
.tab(false)
|
||||
.tooltip("Join Discord")
|
||||
.icon(icon)
|
||||
.onClick(() -> LinkBrowser.browse(RuneLiteProperties.getDiscordInvite()))
|
||||
.onClick(() -> LinkBrowser.browse(discordInvite))
|
||||
.build();
|
||||
|
||||
clientToolbar.addNavigation(discordButton);
|
||||
|
||||
@@ -35,8 +35,8 @@ import java.util.UUID;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import java.util.stream.Collectors;
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Named;
|
||||
import lombok.Data;
|
||||
import net.runelite.client.RuneLiteProperties;
|
||||
import net.runelite.client.discord.DiscordPresence;
|
||||
import net.runelite.client.discord.DiscordService;
|
||||
import net.runelite.client.ws.PartyService;
|
||||
@@ -60,14 +60,24 @@ class DiscordState
|
||||
private final DiscordService discordService;
|
||||
private final DiscordConfig config;
|
||||
private final PartyService party;
|
||||
private final String runeliteTitle;
|
||||
private final String runeliteVersion;
|
||||
private DiscordPresence lastPresence;
|
||||
|
||||
@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.config = config;
|
||||
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)
|
||||
final String versionShortHand = RuneLiteProperties.getVersion().replace("-SNAPSHOT", "+");
|
||||
final String versionShortHand = runeliteVersion.replace("-SNAPSHOT", "+");
|
||||
|
||||
final DiscordPresence.DiscordPresenceBuilder presenceBuilder = DiscordPresence.builder()
|
||||
.state(MoreObjects.firstNonNull(state, ""))
|
||||
.details(MoreObjects.firstNonNull(details, ""))
|
||||
.largeImageText(RuneLiteProperties.getTitle() + " v" + versionShortHand)
|
||||
.largeImageText(runeliteTitle + " v" + versionShortHand)
|
||||
.smallImageKey(imageKey)
|
||||
.partyMax(PARTY_MAX)
|
||||
.partySize(party.getMembers().size());
|
||||
|
||||
@@ -242,8 +242,6 @@ public class GpuPlugin extends Plugin implements DrawCallbacks
|
||||
private AntiAliasingMode lastAntiAliasingMode;
|
||||
private int lastAnisotropicFilteringLevel = -1;
|
||||
|
||||
private int centerX;
|
||||
private int centerY;
|
||||
private int yaw;
|
||||
private int pitch;
|
||||
// fields for non-compute draw
|
||||
@@ -264,6 +262,7 @@ public class GpuPlugin extends Plugin implements DrawCallbacks
|
||||
private int uniTexSamplingMode;
|
||||
private int uniTexSourceDimensions;
|
||||
private int uniTexTargetDimensions;
|
||||
private int uniUiAlphaOverlay;
|
||||
private int uniTextures;
|
||||
private int uniTextureOffsets;
|
||||
private int uniBlockSmall;
|
||||
@@ -545,6 +544,7 @@ public class GpuPlugin extends Plugin implements DrawCallbacks
|
||||
uniTexTargetDimensions = gl.glGetUniformLocation(glUiProgram, "targetDimensions");
|
||||
uniTexSourceDimensions = gl.glGetUniformLocation(glUiProgram, "sourceDimensions");
|
||||
uniUiColorBlindMode = gl.glGetUniformLocation(glUiProgram, "colorBlindMode");
|
||||
uniUiAlphaOverlay = gl.glGetUniformLocation(glUiProgram, "alphaOverlay");
|
||||
uniTextures = gl.glGetUniformLocation(glProgram, "textures");
|
||||
uniTextureOffsets = gl.glGetUniformLocation(glProgram, "textureOffsets");
|
||||
|
||||
@@ -774,13 +774,149 @@ public class GpuPlugin extends Plugin implements DrawCallbacks
|
||||
@Override
|
||||
public void drawScene(int cameraX, int cameraY, int cameraZ, int cameraPitch, int cameraYaw, int plane)
|
||||
{
|
||||
centerX = client.getCenterX();
|
||||
centerY = client.getCenterY();
|
||||
yaw = client.getCameraYaw();
|
||||
pitch = client.getCameraPitch();
|
||||
|
||||
final Scene scene = client.getScene();
|
||||
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
|
||||
@@ -855,9 +991,9 @@ public class GpuPlugin extends Plugin implements DrawCallbacks
|
||||
}
|
||||
|
||||
@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)
|
||||
@@ -883,7 +1019,7 @@ public class GpuPlugin extends Plugin implements DrawCallbacks
|
||||
}
|
||||
}
|
||||
|
||||
private void drawFrame()
|
||||
private void drawFrame(int overlayColor)
|
||||
{
|
||||
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.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
|
||||
final TextureProvider textureProvider = client.getTextureProvider();
|
||||
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)
|
||||
{
|
||||
// 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
|
||||
gl.glBindVertexArray(vaoHandle);
|
||||
|
||||
// When using compute shaders, draw using the output buffer of the compute. Otherwise
|
||||
// only use the temporary buffers, which will contain the full scene.
|
||||
int vertexBuffer, uvBuffer;
|
||||
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.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.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.glDrawArrays(gl.GL_TRIANGLES, 0, targetBufferOffset);
|
||||
@@ -1208,7 +1247,7 @@ public class GpuPlugin extends Plugin implements DrawCallbacks
|
||||
tempUvOffset = 0;
|
||||
|
||||
// Texture on UI
|
||||
drawUi(canvasHeight, canvasWidth);
|
||||
drawUi(overlayColor, canvasHeight, canvasWidth);
|
||||
|
||||
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 int[] pixels = bufferProvider.getPixels();
|
||||
@@ -1254,6 +1293,12 @@ public class GpuPlugin extends Plugin implements DrawCallbacks
|
||||
gl.glUniform1i(uniTexSamplingMode, uiScalingMode.getMode());
|
||||
gl.glUniform2i(uniTexSourceDimensions, canvasWidth, canvasHeight);
|
||||
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())
|
||||
{
|
||||
@@ -1449,14 +1494,20 @@ public class GpuPlugin extends Plugin implements DrawCallbacks
|
||||
Model model = renderable instanceof Model ? (Model) renderable : renderable.getModel();
|
||||
if (model != null)
|
||||
{
|
||||
// Apply height to renderable from the model
|
||||
if (model != renderable)
|
||||
{
|
||||
renderable.setModelHeight(model.getModelHeight());
|
||||
}
|
||||
|
||||
model.calculateBoundsCylinder();
|
||||
model.calculateExtreme(orientation);
|
||||
|
||||
if (!isVisible(model, orientation, pitchSin, pitchCos, yawSin, yawCos, x, y, z, hash))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
model.calculateExtreme(orientation);
|
||||
client.checkClickbox(model, orientation, pitchSin, pitchCos, yawSin, yawCos, x, y, z, hash);
|
||||
|
||||
modelX = x + client.getCameraX2();
|
||||
@@ -1480,13 +1531,13 @@ public class GpuPlugin extends Plugin implements DrawCallbacks
|
||||
Model model = (Model) renderable;
|
||||
|
||||
model.calculateBoundsCylinder();
|
||||
model.calculateExtreme(orientation);
|
||||
|
||||
if (!isVisible(model, orientation, pitchSin, pitchCos, yawSin, yawCos, x, y, z, hash))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
model.calculateExtreme(orientation);
|
||||
client.checkClickbox(model, orientation, pitchSin, pitchCos, yawSin, yawCos, x, y, z, hash);
|
||||
|
||||
int tc = Math.min(MAX_TRIANGLE, model.getTrianglesCount());
|
||||
@@ -1512,16 +1563,19 @@ public class GpuPlugin extends Plugin implements DrawCallbacks
|
||||
if (model != null)
|
||||
{
|
||||
// Apply height to renderable from the model
|
||||
model.setModelHeight(model.getModelHeight());
|
||||
if (model != renderable)
|
||||
{
|
||||
renderable.setModelHeight(model.getModelHeight());
|
||||
}
|
||||
|
||||
model.calculateBoundsCylinder();
|
||||
model.calculateExtreme(orientation);
|
||||
|
||||
if (!isVisible(model, orientation, pitchSin, pitchCos, yawSin, yawCos, x, y, z, hash))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
model.calculateExtreme(orientation);
|
||||
client.checkClickbox(model, orientation, pitchSin, pitchCos, yawSin, yawCos, x, y, z, hash);
|
||||
|
||||
boolean hasUv = model.getFaceTextures() != null;
|
||||
|
||||
@@ -37,7 +37,7 @@ public interface GrandExchangeConfig extends Config
|
||||
position = 1,
|
||||
keyName = "quickLookup",
|
||||
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()
|
||||
{
|
||||
@@ -59,7 +59,7 @@ public interface GrandExchangeConfig extends Config
|
||||
position = 3,
|
||||
keyName = "enableOsbPrices",
|
||||
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()
|
||||
{
|
||||
@@ -92,8 +92,8 @@ public interface GrandExchangeConfig extends Config
|
||||
@ConfigItem(
|
||||
position = 6,
|
||||
keyName = "showTotal",
|
||||
name = "Show grand exchange total",
|
||||
description = "Show grand exchange total"
|
||||
name = "Show GE total",
|
||||
description = "Display the total value of all trades at the top of the GE interface"
|
||||
)
|
||||
default boolean showTotal()
|
||||
{
|
||||
@@ -104,7 +104,7 @@ public interface GrandExchangeConfig extends Config
|
||||
position = 7,
|
||||
keyName = "showExact",
|
||||
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()
|
||||
{
|
||||
|
||||
@@ -36,6 +36,7 @@ import java.awt.event.MouseAdapter;
|
||||
import java.awt.event.MouseEvent;
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
import javax.annotation.Nullable;
|
||||
import javax.inject.Named;
|
||||
import javax.inject.Singleton;
|
||||
import javax.swing.Box;
|
||||
import javax.swing.ImageIcon;
|
||||
@@ -91,6 +92,26 @@ public class InfoPanel extends PluginPanel
|
||||
@Inject
|
||||
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
|
||||
{
|
||||
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();
|
||||
|
||||
JLabel version = new JLabel(htmlLabel("RuneLite version: ", RuneLiteProperties.getVersion()));
|
||||
JLabel version = new JLabel(htmlLabel("RuneLite version: ", runeliteVersion));
|
||||
version.setFont(smallFont);
|
||||
|
||||
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(DISCORD_ICON, "Talk to us on our", "Discord server", RuneLiteProperties.getDiscordInvite()));
|
||||
actionsContainer.add(buildLinkPanel(PATREON_ICON, "Become a patron to", "help support RuneLite", RuneLiteProperties.getPatreonLink()));
|
||||
actionsContainer.add(buildLinkPanel(WIKI_ICON, "Information about", "RuneLite and plugins", RuneLiteProperties.getWikiLink()));
|
||||
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", discordInvite));
|
||||
actionsContainer.add(buildLinkPanel(PATREON_ICON, "Become a patron to", "help support RuneLite", patreonLink));
|
||||
actionsContainer.add(buildLinkPanel(WIKI_ICON, "Information about", "RuneLite and plugins", wikiLink));
|
||||
|
||||
add(versionPanel, BorderLayout.NORTH);
|
||||
add(actionsContainer, BorderLayout.CENTER);
|
||||
|
||||
@@ -60,7 +60,7 @@ public class ItemStatChanges
|
||||
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(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,
|
||||
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,
|
||||
@@ -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, 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(4, boost(ATTACK, 5), boost(STRENGTH, 5), heal(MAGIC, -5), heal(PRAYER, -5)), BLOOD_PINT);
|
||||
|
||||
// Sq'irk Juice
|
||||
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(
|
||||
"aubury",
|
||||
"wizard sedridor",
|
||||
"sedridor",
|
||||
"wizard distentor",
|
||||
"wizard cromperty",
|
||||
"brimstail"
|
||||
|
||||
@@ -37,6 +37,7 @@ import net.runelite.api.VarClientInt;
|
||||
import net.runelite.api.widgets.WidgetID;
|
||||
import net.runelite.api.widgets.WidgetInfo;
|
||||
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.tooltip.Tooltip;
|
||||
import net.runelite.client.ui.overlay.tooltip.TooltipManager;
|
||||
@@ -80,6 +81,9 @@ class MouseHighlightOverlay extends Overlay
|
||||
MouseHighlightOverlay(Client client, TooltipManager tooltipManager, MouseHighlightConfig config)
|
||||
{
|
||||
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.tooltipManager = tooltipManager;
|
||||
this.config = config;
|
||||
|
||||
@@ -30,6 +30,7 @@ import java.awt.Graphics2D;
|
||||
import java.time.Duration;
|
||||
import java.time.Instant;
|
||||
import javax.inject.Inject;
|
||||
import net.runelite.api.ObjectID;
|
||||
import net.runelite.api.Point;
|
||||
import net.runelite.client.ui.overlay.Overlay;
|
||||
import net.runelite.client.ui.overlay.OverlayLayer;
|
||||
@@ -39,6 +40,7 @@ import net.runelite.client.ui.overlay.components.ProgressPieComponent;
|
||||
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 GREEN_ALPHA = new Color(Color.GREEN.getRed(), Color.GREEN.getGreen(), Color.GREEN.getBlue(), 100);
|
||||
private static final Duration MAX_TIME = Duration.ofSeconds(9);
|
||||
private final TearsOfGuthixPlugin plugin;
|
||||
|
||||
@@ -64,8 +66,20 @@ class TearsOfGuthixOverlay extends Overlay
|
||||
|
||||
final ProgressPieComponent progressPie = new ProgressPieComponent();
|
||||
progressPie.setDiameter(15);
|
||||
|
||||
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);
|
||||
|
||||
final Duration duration = Duration.between(timer, Instant.now());
|
||||
|
||||
@@ -92,7 +92,9 @@ public class TearsOfGuthixPlugin extends Plugin
|
||||
DecorativeObject object = event.getDecorativeObject();
|
||||
|
||||
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)
|
||||
{
|
||||
|
||||
@@ -60,7 +60,7 @@ enum GameTimer
|
||||
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),
|
||||
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),
|
||||
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),
|
||||
|
||||
@@ -219,7 +219,7 @@ class FarmingWorld
|
||||
|
||||
add(new FarmingRegion("Lletya", 9265,
|
||||
new FarmingPatch("", Varbits.FARMING_4771, PatchImplementation.FRUIT_TREE)
|
||||
));
|
||||
), 11103);
|
||||
|
||||
add(new FarmingRegion("Lumbridge", 12851,
|
||||
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.widgets.Widget;
|
||||
import net.runelite.api.widgets.WidgetInfo;
|
||||
import net.runelite.client.RuneLiteProperties;
|
||||
import net.runelite.client.callback.ClientThread;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.config.ExpandResizeType;
|
||||
@@ -122,6 +121,7 @@ public class ClientUI
|
||||
private final Provider<ClientThread> clientThreadProvider;
|
||||
private final EventBus eventBus;
|
||||
private final boolean safeMode;
|
||||
private final String title;
|
||||
|
||||
private final CardLayout cardLayout = new CardLayout();
|
||||
private final Rectangle sidebarButtonPosition = new Rectangle();
|
||||
@@ -152,7 +152,9 @@ public class ClientUI
|
||||
ConfigManager configManager,
|
||||
Provider<ClientThread> clientThreadProvider,
|
||||
EventBus eventBus,
|
||||
@Named("safeMode") boolean safeMode)
|
||||
@Named("safeMode") boolean safeMode,
|
||||
@Named("runelite.title") String title
|
||||
)
|
||||
{
|
||||
this.config = config;
|
||||
this.keyManager = keyManager;
|
||||
@@ -162,6 +164,7 @@ public class ClientUI
|
||||
this.clientThreadProvider = clientThreadProvider;
|
||||
this.eventBus = eventBus;
|
||||
this.safeMode = safeMode;
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
@@ -294,7 +297,7 @@ public class ClientUI
|
||||
return false;
|
||||
}
|
||||
|
||||
frame.setTitle(RuneLiteProperties.getTitle() + " - " + name);
|
||||
frame.setTitle(title + " - " + name);
|
||||
return true;
|
||||
});
|
||||
}
|
||||
@@ -321,7 +324,7 @@ public class ClientUI
|
||||
// Try to enable fullscreen on OSX
|
||||
OSXUtil.tryEnableFullscreen(frame);
|
||||
|
||||
frame.setTitle(RuneLiteProperties.getTitle());
|
||||
frame.setTitle(title);
|
||||
frame.setIconImage(ICON);
|
||||
frame.getLayeredPane().setCursor(Cursor.getDefaultCursor()); // Prevent substance from using a resize cursor for pointing
|
||||
frame.setLocationRelativeTo(frame.getOwner());
|
||||
@@ -507,7 +510,7 @@ public class ClientUI
|
||||
frame.revalidateMinimumSize();
|
||||
|
||||
// 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)
|
||||
if (config.rememberScreenBounds() && !safeMode)
|
||||
@@ -1034,12 +1037,12 @@ public class ClientUI
|
||||
|
||||
if (player != null && player.getName() != null)
|
||||
{
|
||||
frame.setTitle(RuneLiteProperties.getTitle() + " - " + player.getName());
|
||||
frame.setTitle(title + " - " + player.getName());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
frame.setTitle(RuneLiteProperties.getTitle());
|
||||
frame.setTitle(title);
|
||||
}
|
||||
|
||||
if (frame.isAlwaysOnTopSupported())
|
||||
|
||||
@@ -61,8 +61,8 @@ public class TooltipOverlay extends Overlay
|
||||
setPosition(OverlayPosition.TOOLTIP);
|
||||
setPriority(OverlayPriority.HIGHEST);
|
||||
setLayer(OverlayLayer.ABOVE_WIDGETS);
|
||||
// additionally allow tooltips above the world map
|
||||
drawAfterInterface(WidgetID.WORLD_MAP_GROUP_ID);
|
||||
// additionally allow tooltips above the full screen world map and welcome screen
|
||||
drawAfterInterface(WidgetID.FULLSCREEN_CONTAINER_TLI);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -45,6 +45,7 @@ import java.util.EnumSet;
|
||||
import javax.annotation.Nullable;
|
||||
import javax.imageio.ImageIO;
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Named;
|
||||
import javax.inject.Singleton;
|
||||
import lombok.Data;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -53,7 +54,6 @@ import net.runelite.api.GameState;
|
||||
import net.runelite.api.WorldType;
|
||||
import net.runelite.client.Notifier;
|
||||
import static net.runelite.client.RuneLite.SCREENSHOT_DIR;
|
||||
import net.runelite.client.RuneLiteProperties;
|
||||
import net.runelite.http.api.RuneLiteAPI;
|
||||
import okhttp3.Call;
|
||||
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 MediaType JSON = MediaType.parse("application/json");
|
||||
|
||||
@Inject
|
||||
private Client client;
|
||||
private final Client client;
|
||||
private final Notifier notifier;
|
||||
private final OkHttpClient okHttpClient;
|
||||
private final String imgurClientId;
|
||||
|
||||
@Inject
|
||||
private Notifier notifier;
|
||||
|
||||
@Inject
|
||||
private OkHttpClient okHttpClient;
|
||||
private ImageCapture(
|
||||
final Client client,
|
||||
final Notifier notifier,
|
||||
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,
|
||||
@@ -198,7 +208,7 @@ public class ImageCapture
|
||||
|
||||
Request request = new Request.Builder()
|
||||
.url(IMGUR_IMAGE_UPLOAD_URL)
|
||||
.addHeader("Authorization", "Client-ID " + RuneLiteProperties.getImgurClientId())
|
||||
.addHeader("Authorization", "Client-ID " + imgurClientId)
|
||||
.post(RequestBody.create(JSON, json))
|
||||
.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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,8 +29,6 @@
|
||||
|
||||
layout(local_size_x = 6) in;
|
||||
|
||||
#include common.glsl
|
||||
|
||||
void main() {
|
||||
uint groupId = gl_WorkGroupID.x;
|
||||
uint localId = gl_LocalInvocationID.x;
|
||||
@@ -41,9 +39,7 @@ void main() {
|
||||
int outOffset = minfo.idx;
|
||||
int uvOffset = minfo.uvOffset;
|
||||
int flags = minfo.flags;
|
||||
int orientation = flags & 0x7ff;
|
||||
ivec4 pos = ivec4(minfo.x, minfo.y, minfo.z, 0);
|
||||
|
||||
if (localId >= size) {
|
||||
return;
|
||||
}
|
||||
@@ -62,16 +58,12 @@ void main() {
|
||||
thisC = tempvb[offset + ssboOffset * 3 + 2];
|
||||
}
|
||||
|
||||
ivec4 thisrvA = rotate(thisA, orientation);
|
||||
ivec4 thisrvB = rotate(thisB, orientation);
|
||||
ivec4 thisrvC = rotate(thisC, orientation);
|
||||
|
||||
uint myOffset = localId;
|
||||
|
||||
// position vertices in scene and write to out buffer
|
||||
vout[outOffset + myOffset * 3] = pos + thisrvA;
|
||||
vout[outOffset + myOffset * 3 + 1] = pos + thisrvB;
|
||||
vout[outOffset + myOffset * 3 + 2] = pos + thisrvC;
|
||||
vout[outOffset + myOffset * 3] = pos + thisA;
|
||||
vout[outOffset + myOffset * 3 + 1] = pos + thisB;
|
||||
vout[outOffset + myOffset * 3 + 2] = pos + thisC;
|
||||
|
||||
if (uvOffset < 0) {
|
||||
uvout[outOffset + myOffset * 3] = vec4(0, 0, 0, 0);
|
||||
|
||||
@@ -246,6 +246,9 @@ public abstract class RSClientMixin implements RSClient
|
||||
@Inject
|
||||
private static ArrayList<WidgetItem> widgetItems = new ArrayList<>();
|
||||
|
||||
@Inject
|
||||
private static ArrayList<Widget> hiddenWidgets = new ArrayList<>();
|
||||
|
||||
@Inject
|
||||
@Override
|
||||
public void setPrintMenuActions(boolean yes)
|
||||
@@ -1549,6 +1552,30 @@ public abstract class RSClientMixin implements RSClient
|
||||
widget.setRenderX(renderX);
|
||||
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());
|
||||
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);
|
||||
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();
|
||||
if (drawCallbacks != null)
|
||||
{
|
||||
drawCallbacks.draw();
|
||||
drawCallbacks.draw(client.getViewportColor());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -244,7 +244,7 @@ public abstract class RSSceneMixin implements RSScene
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
outer:
|
||||
for (int z = minLevel; z < maxY; ++z)
|
||||
{
|
||||
RSTile[][] planeTiles = tiles[z];
|
||||
@@ -303,17 +303,8 @@ public abstract class RSSceneMixin implements RSScene
|
||||
|
||||
if (client.getTileUpdateCount() == 0)
|
||||
{
|
||||
if (!isGpu && (client.getOculusOrbState() != 0 && !client.getComplianceValue("orbInteraction")))
|
||||
{
|
||||
client.setEntitiesAtMouseCount(0);
|
||||
}
|
||||
client.setCheckClick(false);
|
||||
if (!checkClick)
|
||||
{
|
||||
client.setViewportWalking(false);
|
||||
}
|
||||
client.getCallbacks().drawScene();
|
||||
return;
|
||||
// exit the loop early and go straight to "if (!isGpu && (client..."
|
||||
break outer;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1308,4 +1308,10 @@ public interface RSClient extends RSGameShell, Client
|
||||
|
||||
@Import("pcmSampleLength")
|
||||
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(
|
||||
intValue = -380994417
|
||||
)
|
||||
public static int field730;
|
||||
@Export("viewportColor")
|
||||
public static int viewportColor;
|
||||
@ObfuscatedName("il")
|
||||
static boolean field649;
|
||||
@ObfuscatedName("im")
|
||||
@@ -1366,7 +1367,7 @@ public final class Client extends GameShell implements Usernamed {
|
||||
field788 = 0; // L: 374
|
||||
oculusOrbNormalSpeed = 12; // L: 376
|
||||
oculusOrbSlowedSpeed = 6; // L: 377
|
||||
field730 = 0; // L: 378
|
||||
viewportColor = 0; // L: 378
|
||||
field649 = false; // L: 379
|
||||
field732 = 0; // L: 380
|
||||
field843 = false; // L: 381
|
||||
@@ -5622,8 +5623,8 @@ public final class Client extends GameShell implements Usernamed {
|
||||
|
||||
if (ServerPacket.field2146 == var1.serverPacket) { // L: 6617
|
||||
var16 = var3.readInt(); // L: 6618
|
||||
if (var16 != field730) { // L: 6619
|
||||
field730 = var16; // L: 6620
|
||||
if (var16 != viewportColor) { // L: 6619
|
||||
viewportColor = var16; // L: 6620
|
||||
WorldMapCacheName.method664(); // L: 6621
|
||||
}
|
||||
|
||||
|
||||
@@ -202,7 +202,7 @@ public class SecureRandomFuture {
|
||||
var17 = (Decimator.oculusOrbFocalPointY >> 7) + class41.baseY; // L: 4384
|
||||
PacketBufferNode var18 = ItemContainer.getPacketBufferNode(ClientPacket.field2269, Client.packetWriter.isaacCipher); // L: 4387
|
||||
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.writeByte(var15); // L: 4391
|
||||
Client.packetWriter.addNode(var18); // L: 4392
|
||||
|
||||
Reference in New Issue
Block a user