project: merge upstream

This commit is contained in:
Owain van Brakel
2019-10-30 04:22:38 +01:00
parent 13fc1f6554
commit 2655654c9f
23 changed files with 206 additions and 141 deletions

View File

@@ -31,38 +31,37 @@ import lombok.Data;
@Data @Data
public class NpcDefinition public class NpcDefinition
{ {
public final int id; public final int id;
public short[] recolorToFind;
public int rotation = 32;
public String name = "null"; public String name = "null";
public short[] recolorToReplace; public int size = 1;
public int[] models; public int[] models;
public int[] models_2; public int[] chatheadModels;
public int stanceAnimation = -1; public int standingAnimation = -1;
public int anInt2165 = -1; public int rotateLeftAnimation = -1;
public int tileSpacesOccupied = 1; public int rotateRightAnimation = -1;
public int walkAnimation = -1; public int walkingAnimation = -1;
public short[] retextureToReplace;
public int rotate90RightAnimation = -1;
public boolean aBool2170 = true;
public int resizeX = 128;
public int contrast = 0;
public int rotate180Animation = -1; public int rotate180Animation = -1;
public int varbitIndex = -1; public int rotate90RightAnimation = -1;
public String[] options = new String[5];
public boolean renderOnMinimap = true;
public int combatLevel = -1;
public int rotate90LeftAnimation = -1; public int rotate90LeftAnimation = -1;
public int resizeY = 128; public short[] recolorToFind;
public boolean hasRenderPriority = false; public short[] recolorToReplace;
public int ambient = 0;
public int headIcon = -1;
public int[] configs;
public short[] retextureToFind; public short[] retextureToFind;
public short[] retextureToReplace;
public String[] actions = new String[5];
public boolean isMinimapVisible = true;
public int combatLevel = -1;
public int widthScale = 128;
public int heightScale = 128;
public boolean hasRenderPriority;
public int ambient;
public int contrast;
public int headIcon = -1;
public int rotationSpeed = 32;
public int[] configs;
public int varbitId = -1;
public int varpIndex = -1; public int varpIndex = -1;
public boolean isClickable = true; public boolean isInteractable = true;
public int anInt2189 = -1; public boolean rotationFlag = true;
public boolean aBool2190 = false; public boolean isPet;
public Map<Integer, Object> params = null; public Map<Integer, Object> params;
} }

View File

@@ -24,13 +24,12 @@
*/ */
package net.runelite.cache.definitions.loaders; package net.runelite.cache.definitions.loaders;
import java.util.HashMap;
import net.runelite.cache.definitions.NpcDefinition; import net.runelite.cache.definitions.NpcDefinition;
import net.runelite.cache.io.InputStream; import net.runelite.cache.io.InputStream;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import java.util.HashMap;
public class NpcLoader public class NpcLoader
{ {
private static final Logger logger = LoggerFactory.getLogger(NpcLoader.class); private static final Logger logger = LoggerFactory.getLogger(NpcLoader.class);
@@ -67,7 +66,6 @@ public class NpcLoader
{ {
def.models[index] = stream.readUnsignedShort(); def.models[index] = stream.readUnsignedShort();
} }
} }
else if (opcode == 2) else if (opcode == 2)
{ {
@@ -75,37 +73,37 @@ public class NpcLoader
} }
else if (opcode == 12) else if (opcode == 12)
{ {
def.tileSpacesOccupied = stream.readUnsignedByte(); def.size = stream.readUnsignedByte();
} }
else if (opcode == 13) else if (opcode == 13)
{ {
def.stanceAnimation = stream.readUnsignedShort(); def.standingAnimation = stream.readUnsignedShort();
} }
else if (opcode == 14) else if (opcode == 14)
{ {
def.walkAnimation = stream.readUnsignedShort(); def.walkingAnimation = stream.readUnsignedShort();
} }
else if (opcode == 15) else if (opcode == 15)
{ {
def.anInt2165 = stream.readUnsignedShort(); def.rotateLeftAnimation = stream.readUnsignedShort();
} }
else if (opcode == 16) else if (opcode == 16)
{ {
def.anInt2189 = stream.readUnsignedShort(); def.rotateRightAnimation = stream.readUnsignedShort();
} }
else if (opcode == 17) else if (opcode == 17)
{ {
def.walkAnimation = stream.readUnsignedShort(); def.walkingAnimation = stream.readUnsignedShort();
def.rotate180Animation = stream.readUnsignedShort(); def.rotate180Animation = stream.readUnsignedShort();
def.rotate90RightAnimation = stream.readUnsignedShort(); def.rotate90RightAnimation = stream.readUnsignedShort();
def.rotate90LeftAnimation = stream.readUnsignedShort(); def.rotate90LeftAnimation = stream.readUnsignedShort();
} }
else if (opcode >= 30 && opcode < 35) else if (opcode >= 30 && opcode < 35)
{ {
def.options[opcode - 30] = stream.readString(); def.actions[opcode - 30] = stream.readString();
if (def.options[opcode - 30].equalsIgnoreCase("Hidden")) if (def.actions[opcode - 30].equalsIgnoreCase("Hidden"))
{ {
def.options[opcode - 30] = null; def.actions[opcode - 30] = null;
} }
} }
else if (opcode == 40) else if (opcode == 40)
@@ -137,17 +135,17 @@ public class NpcLoader
else if (opcode == 60) else if (opcode == 60)
{ {
length = stream.readUnsignedByte(); length = stream.readUnsignedByte();
def.models_2 = new int[length]; def.chatheadModels = new int[length];
for (index = 0; index < length; ++index) for (index = 0; index < length; ++index)
{ {
def.models_2[index] = stream.readUnsignedShort(); def.chatheadModels[index] = stream.readUnsignedShort();
} }
} }
else if (opcode == 93) else if (opcode == 93)
{ {
def.renderOnMinimap = false; def.isMinimapVisible = false;
} }
else if (opcode == 95) else if (opcode == 95)
{ {
@@ -155,11 +153,11 @@ public class NpcLoader
} }
else if (opcode == 97) else if (opcode == 97)
{ {
def.resizeX = stream.readUnsignedShort(); def.widthScale = stream.readUnsignedShort();
} }
else if (opcode == 98) else if (opcode == 98)
{ {
def.resizeY = stream.readUnsignedShort(); def.heightScale = stream.readUnsignedShort();
} }
else if (opcode == 99) else if (opcode == 99)
{ {
@@ -179,18 +177,18 @@ public class NpcLoader
} }
else if (opcode == 103) else if (opcode == 103)
{ {
def.rotation = stream.readUnsignedShort(); def.rotationSpeed = stream.readUnsignedShort();
} }
else if (opcode == 106) else if (opcode == 106)
{ {
def.varbitIndex = stream.readUnsignedShort(); def.varbitId = stream.readUnsignedShort();
if ('\uffff' == def.varbitIndex) if (def.varbitId == 65535)
{ {
def.varbitIndex = -1; def.varbitId = -1;
} }
def.varpIndex = stream.readUnsignedShort(); def.varpIndex = stream.readUnsignedShort();
if ('\uffff' == def.varpIndex) if (def.varpIndex == 65535)
{ {
def.varpIndex = -1; def.varpIndex = -1;
} }
@@ -212,26 +210,26 @@ public class NpcLoader
} }
else if (opcode == 107) else if (opcode == 107)
{ {
def.isClickable = false; def.isInteractable = false;
} }
else if (opcode == 109) else if (opcode == 109)
{ {
def.aBool2170 = false; def.rotationFlag = false;
} }
else if (opcode == 111) else if (opcode == 111)
{ {
def.aBool2190 = true; def.isPet = true;
} }
else if (opcode == 118) else if (opcode == 118)
{ {
def.varbitIndex = stream.readUnsignedShort(); def.varbitId = stream.readUnsignedShort();
if ('\uffff' == def.varbitIndex) if (def.varbitId == 65535)
{ {
def.varbitIndex = -1; def.varbitId = -1;
} }
def.varpIndex = stream.readUnsignedShort(); def.varpIndex = stream.readUnsignedShort();
if ('\uffff' == def.varpIndex) if (def.varpIndex == 65535)
{ {
def.varpIndex = -1; def.varpIndex = -1;
} }

View File

@@ -47,45 +47,45 @@ public class NpcSaver
out.writeByte(2); out.writeByte(2);
out.writeString(npc.name); out.writeString(npc.name);
} }
if (npc.tileSpacesOccupied != 1) if (npc.size != 1)
{ {
out.writeByte(12); out.writeByte(12);
out.writeByte(npc.tileSpacesOccupied); out.writeByte(npc.size);
} }
if (npc.stanceAnimation != -1) if (npc.standingAnimation != -1)
{ {
out.writeByte(13); out.writeByte(13);
out.writeShort(npc.stanceAnimation); out.writeShort(npc.standingAnimation);
} }
if (npc.walkAnimation != -1) if (npc.walkingAnimation != -1)
{ {
out.writeByte(14); out.writeByte(14);
out.writeShort(npc.walkAnimation); out.writeShort(npc.walkingAnimation);
} }
if (npc.anInt2165 != -1) if (npc.rotateLeftAnimation != -1)
{ {
out.writeByte(15); out.writeByte(15);
out.writeShort(npc.anInt2165); out.writeShort(npc.rotateLeftAnimation);
} }
if (npc.anInt2189 != -1) if (npc.rotateRightAnimation != -1)
{ {
out.writeByte(16); out.writeByte(16);
out.writeShort(npc.anInt2189); out.writeShort(npc.rotateRightAnimation);
} }
if (npc.rotate180Animation != -1 || npc.rotate90LeftAnimation != -1 || npc.rotate90RightAnimation != -1) if (npc.rotate180Animation != -1 || npc.rotate90LeftAnimation != -1 || npc.rotate90RightAnimation != -1)
{ {
out.writeByte(17); out.writeByte(17);
out.writeShort(npc.walkAnimation); out.writeShort(npc.walkingAnimation);
out.writeShort(npc.rotate180Animation); out.writeShort(npc.rotate180Animation);
out.writeShort(npc.rotate90RightAnimation); out.writeShort(npc.rotate90RightAnimation);
out.writeShort(npc.rotate90LeftAnimation); out.writeShort(npc.rotate90LeftAnimation);
} }
for (int i = 0; i < 5; ++i) for (int i = 0; i < 5; ++i)
{ {
if (npc.options[i] != null) if (npc.actions[i] != null)
{ {
out.writeByte(30 + i); out.writeByte(30 + i);
out.writeString(npc.options[i]); out.writeString(npc.actions[i]);
} }
} }
if (npc.recolorToFind != null && npc.recolorToReplace != null) if (npc.recolorToFind != null && npc.recolorToReplace != null)
@@ -108,16 +108,16 @@ public class NpcSaver
out.writeShort(npc.retextureToReplace[i]); out.writeShort(npc.retextureToReplace[i]);
} }
} }
if (npc.models_2 != null) if (npc.chatheadModels != null)
{ {
out.writeByte(60); out.writeByte(60);
out.writeByte(npc.models_2.length); out.writeByte(npc.chatheadModels.length);
for (int modelId : npc.models_2) for (int modelId : npc.chatheadModels)
{ {
out.writeShort(modelId); out.writeShort(modelId);
} }
} }
if (!npc.renderOnMinimap) if (!npc.isMinimapVisible)
{ {
out.writeByte(93); out.writeByte(93);
} }
@@ -127,9 +127,9 @@ public class NpcSaver
out.writeShort(npc.combatLevel); out.writeShort(npc.combatLevel);
} }
out.writeByte(97); out.writeByte(97);
out.writeShort(npc.resizeX); out.writeShort(npc.widthScale);
out.writeByte(98); out.writeByte(98);
out.writeShort(npc.resizeY); out.writeShort(npc.heightScale);
if (npc.hasRenderPriority) if (npc.hasRenderPriority)
{ {
out.writeByte(99); out.writeByte(99);
@@ -144,23 +144,23 @@ public class NpcSaver
out.writeShort(npc.headIcon); out.writeShort(npc.headIcon);
} }
out.writeByte(103); out.writeByte(103);
out.writeShort(npc.rotation); out.writeShort(npc.rotationSpeed);
if (!npc.isClickable) if (!npc.isInteractable)
{ {
out.writeByte(107); out.writeByte(107);
} }
if (!npc.aBool2170) if (!npc.rotationFlag)
{ {
out.writeByte(109); out.writeByte(109);
} }
if (npc.aBool2190) if (npc.isPet)
{ {
out.writeByte(111); out.writeByte(111);
} }
if (npc.configs != null) if (npc.configs != null)
{ {
out.writeByte(118); out.writeByte(118);
out.writeShort(npc.varbitIndex); out.writeShort(npc.varbitId);
out.writeShort(npc.varpIndex); out.writeShort(npc.varpIndex);
int[] c = npc.configs; int[] c = npc.configs;

View File

@@ -51,6 +51,7 @@ import net.runelite.http.api.config.ConfigEntry;
import net.runelite.http.api.config.Configuration; import net.runelite.http.api.config.Configuration;
import org.bson.Document; import org.bson.Document;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@Service @Service
@@ -66,11 +67,12 @@ public class ConfigService
@Autowired @Autowired
public ConfigService( public ConfigService(
MongoClient mongoClient MongoClient mongoClient,
@Value("${mongo.database}") String databaseName
) )
{ {
MongoDatabase database = mongoClient.getDatabase("config"); MongoDatabase database = mongoClient.getDatabase(databaseName);
MongoCollection<Document> collection = database.getCollection("config"); MongoCollection<Document> collection = database.getCollection("config");
this.mongoCollection = collection; this.mongoCollection = collection;

View File

@@ -32,6 +32,7 @@ redis:
mongo: mongo:
jndiName: java:comp/env/mongodb/runelite jndiName: java:comp/env/mongodb/runelite
database: runelite
# Twitter client for feed # Twitter client for feed
runelite: runelite:

View File

@@ -24,14 +24,25 @@
*/ */
package net.runelite.api.events; package net.runelite.api.events;
import javax.annotation.Nullable;
import lombok.Data; import lombok.Data;
import net.runelite.api.Actor;
@Data @Data
public class AreaSoundEffectPlayed implements Event public class AreaSoundEffectPlayed implements Event
{ {
@Nullable
private final Actor source;
private int soundId; private int soundId;
private int sceneX; private int sceneX;
private int sceneY; private int sceneY;
private int range; private int range;
private int delay; private int delay;
private boolean consumed;
public void consume()
{
consumed = true;
}
} }

View File

@@ -24,11 +24,22 @@
*/ */
package net.runelite.api.events; package net.runelite.api.events;
import javax.annotation.Nullable;
import lombok.Data; import lombok.Data;
import net.runelite.api.Actor;
@Data @Data
public class SoundEffectPlayed implements Event public class SoundEffectPlayed implements Event
{ {
@Nullable
private final Actor source;
private int soundId; private int soundId;
private int delay; private int delay;
private boolean consumed;
public void consume()
{
consumed = true;
}
} }

View File

@@ -1,15 +1,16 @@
/* /*
* Copyright (c) 2017, Adam <Adam@sigterm.info> * Copyright (c) 2019, Adam <Adam@sigterm.info>
*
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met: * modification, are permitted provided that the following conditions are met:
* *
* 1. Redistributions of source code must retain the above copyright notice, this * 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer. * list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice, * 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation * this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution. * and/or other materials provided with the distribution.
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
@@ -24,12 +25,17 @@
*/ */
package net.runelite.api.events; package net.runelite.api.events;
import lombok.Value;
@Value
public class VolumeChanged implements Event public class VolumeChanged implements Event
{ {
public static final VolumeChanged INSTANCE = new VolumeChanged(); public enum Type
private VolumeChanged()
{ {
// noop MUSIC,
EFFECTS,
AREA
} }
}
private final Type type;
}

View File

@@ -110,6 +110,7 @@ class SoundEffectOverlay extends Overlay
String text = String text =
"Id: " + event.getSoundId() + "Id: " + event.getSoundId() +
" - S: " + (event.getSource() != null ? event.getSource().getName() : "<none>") +
" - L: " + event.getSceneX() + "," + event.getSceneY() + " - L: " + event.getSceneX() + "," + event.getSceneY() +
" - R: " + event.getRange() + " - R: " + event.getRange() +
" - D: " + event.getDelay(); " - D: " + event.getDelay();

View File

@@ -27,7 +27,9 @@ package net.runelite.client.plugins.gpu;
import com.jogamp.opengl.GL4; import com.jogamp.opengl.GL4;
import java.io.InputStream; import java.io.InputStream;
import java.util.Scanner; import java.util.Scanner;
import lombok.extern.slf4j.Slf4j;
@Slf4j
class GLUtil class GLUtil
{ {
private static final int ERR_LEN = 1024; private static final int ERR_LEN = 1024;
@@ -197,6 +199,7 @@ class GLUtil
else else
{ {
String err = glGetShaderInfoLog(gl, shader); String err = glGetShaderInfoLog(gl, shader);
log.info(String.valueOf(program));
throw new ShaderException(err); throw new ShaderException(err);
} }
} }

View File

@@ -31,6 +31,16 @@ import net.runelite.client.config.ConfigItem;
@ConfigGroup("music") @ConfigGroup("music")
public interface MusicConfig extends Config public interface MusicConfig extends Config
{ {
@ConfigItem(
keyName = "muteOtherAreaSounds",
name = "Mute others' area sounds",
description = "Mute area sounds caused from other players"
)
default boolean muteOtherAreaSounds()
{
return false;
}
@ConfigItem( @ConfigItem(
keyName = "musicVolume", keyName = "musicVolume",
name = "", name = "",
@@ -60,6 +70,7 @@ public interface MusicConfig extends Config
{ {
return 0; return 0;
} }
@ConfigItem( @ConfigItem(
keyName = "soundEffectVolume", keyName = "soundEffectVolume",
name = "", name = "",

View File

@@ -38,13 +38,16 @@ import lombok.Getter;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.Setter; import lombok.Setter;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import net.runelite.api.Actor;
import net.runelite.api.Client; import net.runelite.api.Client;
import net.runelite.api.GameState; import net.runelite.api.GameState;
import net.runelite.api.Player;
import net.runelite.api.ScriptID; import net.runelite.api.ScriptID;
import net.runelite.api.SoundEffectID; import net.runelite.api.SoundEffectID;
import net.runelite.api.SpriteID; import net.runelite.api.SpriteID;
import net.runelite.api.VarClientInt; import net.runelite.api.VarClientInt;
import net.runelite.api.VarPlayer; import net.runelite.api.VarPlayer;
import net.runelite.api.events.AreaSoundEffectPlayed;
import net.runelite.api.events.ConfigChanged; import net.runelite.api.events.ConfigChanged;
import net.runelite.api.events.GameStateChanged; import net.runelite.api.events.GameStateChanged;
import net.runelite.api.events.ScriptCallbackEvent; import net.runelite.api.events.ScriptCallbackEvent;
@@ -138,6 +141,7 @@ public class MusicPlugin extends Plugin
eventBus.subscribe(VarClientIntChanged.class, this, this::onVarClientIntChanged); eventBus.subscribe(VarClientIntChanged.class, this, this::onVarClientIntChanged);
eventBus.subscribe(VolumeChanged.class, this, this::onVolumeChanged); eventBus.subscribe(VolumeChanged.class, this, this::onVolumeChanged);
eventBus.subscribe(ScriptCallbackEvent.class, this, this::onScriptCallbackEvent); eventBus.subscribe(ScriptCallbackEvent.class, this, this::onScriptCallbackEvent);
eventBus.subscribe(AreaSoundEffectPlayed.class, this, this::onAreaSoundEffectPlayed);
} }
private void onGameStateChanged(GameStateChanged gameStateChanged) private void onGameStateChanged(GameStateChanged gameStateChanged)
@@ -216,6 +220,7 @@ public class MusicPlugin extends Plugin
private void onVolumeChanged(VolumeChanged volumeChanged) private void onVolumeChanged(VolumeChanged volumeChanged)
{ {
log.info(volumeChanged.getType().toString());
applyMusicVolumeConfig(); applyMusicVolumeConfig();
} }
@@ -229,8 +234,6 @@ public class MusicPlugin extends Plugin
private void applyMusicVolumeConfig() private void applyMusicVolumeConfig()
{ {
log.info("applyMusicVolumeConfig");
int musicVolume = musicConfig.getMusicVolume(); int musicVolume = musicConfig.getMusicVolume();
if (musicVolume > 0) if (musicVolume > 0)
{ {
@@ -546,4 +549,15 @@ public class MusicPlugin extends Plugin
client.getIntStack()[client.getIntStackSize() - 1] = -1; client.getIntStack()[client.getIntStackSize() - 1] = -1;
} }
} }
private void onAreaSoundEffectPlayed(AreaSoundEffectPlayed areaSoundEffectPlayed)
{
Actor source = areaSoundEffectPlayed.getSource();
if (source != client.getLocalPlayer()
&& source instanceof Player
&& musicConfig.muteOtherAreaSounds())
{
areaSoundEffectPlayed.consume();
}
}
} }

View File

@@ -203,7 +203,7 @@ public interface RaidsConfig extends Config
) )
default boolean displayLayoutMessage() default boolean displayLayoutMessage()
{ {
return true; return false;
} }
@ConfigTitleSection( @ConfigTitleSection(

View File

@@ -41,6 +41,7 @@ import lombok.AccessLevel;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
import net.runelite.api.Client; import net.runelite.api.Client;
import static net.runelite.api.MenuOpcode.RUNELITE_OVERLAY;
import static net.runelite.api.MenuOpcode.RUNELITE_OVERLAY_CONFIG; import static net.runelite.api.MenuOpcode.RUNELITE_OVERLAY_CONFIG;
import net.runelite.api.SpriteID; import net.runelite.api.SpriteID;
import net.runelite.api.widgets.WidgetInfo; import net.runelite.api.widgets.WidgetInfo;
@@ -72,6 +73,7 @@ public class RaidsOverlay extends Overlay
private static final int SMALL_ICON_SIZE = 21; private static final int SMALL_ICON_SIZE = 21;
private static final int TITLE_COMPONENT_HEIGHT = 20; private static final int TITLE_COMPONENT_HEIGHT = 20;
private static final int LINE_COMPONENT_HEIGHT = 16; private static final int LINE_COMPONENT_HEIGHT = 16;
static final String BROADCAST_ACTION = "Broadcast layout";
private final PanelComponent panelComponent = new PanelComponent(); private final PanelComponent panelComponent = new PanelComponent();
private final ItemManager itemManager; private final ItemManager itemManager;
private final SpriteManager spriteManager; private final SpriteManager spriteManager;
@@ -101,6 +103,7 @@ public class RaidsOverlay extends Overlay
this.itemManager = itemManager; this.itemManager = itemManager;
this.spriteManager = spriteManager; this.spriteManager = spriteManager;
getMenuEntries().add(new OverlayMenuEntry(RUNELITE_OVERLAY_CONFIG, OPTION_CONFIGURE, "Raids overlay")); getMenuEntries().add(new OverlayMenuEntry(RUNELITE_OVERLAY_CONFIG, OPTION_CONFIGURE, "Raids overlay"));
getMenuEntries().add(new OverlayMenuEntry(RUNELITE_OVERLAY, BROADCAST_ACTION, "Raids overlay"));
} }
@Override @Override

View File

@@ -550,21 +550,27 @@ public class RaidsPlugin extends Plugin
private void onOverlayMenuClicked(OverlayMenuClicked event) private void onOverlayMenuClicked(OverlayMenuClicked event)
{ {
OverlayMenuEntry entry = event.getEntry(); OverlayMenuEntry entry = event.getEntry();
if (entry.getMenuOpcode() == MenuOpcode.RUNELITE_OVERLAY && if (entry.getMenuOpcode() == MenuOpcode.RUNELITE_OVERLAY)
entry.getTarget().equals("Raids party overlay"))
{ {
switch (entry.getOption()) if (entry.getTarget().equals("Raids party overlay"))
{ {
case RaidsPartyOverlay.PARTY_OVERLAY_RESET: switch (entry.getOption())
startingPartyMembers.clear(); {
updatePartyMembers(true); case RaidsPartyOverlay.PARTY_OVERLAY_RESET:
missingPartyMembers.clear(); startingPartyMembers.clear();
break; updatePartyMembers(true);
case RaidsPartyOverlay.PARTY_OVERLAY_REFRESH: missingPartyMembers.clear();
updatePartyMembers(true); break;
break; case RaidsPartyOverlay.PARTY_OVERLAY_REFRESH:
default: updatePartyMembers(true);
break; break;
default:
break;
}
}
else if (entry.getOption().equals(RaidsOverlay.BROADCAST_ACTION) && event.getOverlay() == overlay)
{
sendRaidLayoutMessage();
} }
} }
} }
@@ -670,7 +676,10 @@ public class RaidsPlugin extends Plugin
raid.updateLayout(layout); raid.updateLayout(layout);
RotationSolver.solve(raid.getCombatRooms()); RotationSolver.solve(raid.getCombatRooms());
setOverlayStatus(true); setOverlayStatus(true);
sendRaidLayoutMessage(); if (this.displayLayoutMessage)
{
sendRaidLayoutMessage();
}
Matcher puzzleMatch = PUZZLES.matcher(raid.getFullRotationString()); Matcher puzzleMatch = PUZZLES.matcher(raid.getFullRotationString());
final List<String> puzzles = new ArrayList<>(); final List<String> puzzles = new ArrayList<>();
while (puzzleMatch.find()) while (puzzleMatch.find())
@@ -709,11 +718,6 @@ public class RaidsPlugin extends Plugin
private void sendRaidLayoutMessage() private void sendRaidLayoutMessage()
{ {
if (!this.displayLayoutMessage)
{
return;
}
final String layout = getRaid().getLayout().toCodeString(); final String layout = getRaid().getLayout().toCodeString();
final String rooms = getRaid().toRoomString(); final String rooms = getRaid().toRoomString();
final String raidData = "[" + layout + "]: " + rooms; final String raidData = "[" + layout + "]: " + rooms;

View File

@@ -58,7 +58,7 @@ enum QuestStartLocation
//Members' Quests //Members' Quests
ANIMAL_MAGNETISM(Quest.ANIMAL_MAGNETISM, new WorldPoint(3094, 3360, 0)), ANIMAL_MAGNETISM(Quest.ANIMAL_MAGNETISM, new WorldPoint(3094, 3360, 0)),
ANOTHER_SLICE_OF_HAM(Quest.ANOTHER_SLICE_OF_HAM, new WorldPoint(2799, 5428, 0)), ANOTHER_SLICE_OF_HAM(Quest.ANOTHER_SLICE_OF_HAM, new WorldPoint(2799, 5428, 0)),
THE_ASCENT_OF_ARCEUUS(Quest.THE_ASCENT_OF_ARCEUUS, new WorldPoint(1700, 3742, 0)), THE_ASCENT_OF_ARCEUUS(Quest.THE_ASCENT_OF_ARCEUUS, new WorldPoint(1699, 3742, 0)),
BETWEEN_A_ROCK(Quest.BETWEEN_A_ROCK, new WorldPoint(2823, 10168, 0)), BETWEEN_A_ROCK(Quest.BETWEEN_A_ROCK, new WorldPoint(2823, 10168, 0)),
BIG_CHOMPY_BIRD_HUNTING(Quest.BIG_CHOMPY_BIRD_HUNTING, new WorldPoint(2629, 2981, 0)), BIG_CHOMPY_BIRD_HUNTING(Quest.BIG_CHOMPY_BIRD_HUNTING, new WorldPoint(2629, 2981, 0)),
BIOHAZARD(Quest.BIOHAZARD, new WorldPoint(2591, 3335, 0)), BIOHAZARD(Quest.BIOHAZARD, new WorldPoint(2591, 3335, 0)),
@@ -72,7 +72,7 @@ enum QuestStartLocation
DARKNESS_OF_HALLOWVALE(Quest.DARKNESS_OF_HALLOWVALE, new WorldPoint(3494, 9628, 0)), DARKNESS_OF_HALLOWVALE(Quest.DARKNESS_OF_HALLOWVALE, new WorldPoint(3494, 9628, 0)),
DEATH_PLATEAU_TROLL_STRONGHOLD(new Quest[]{Quest.DEATH_PLATEAU, Quest.TROLL_STRONGHOLD}, new WorldPoint(2895, 3528, 0)), DEATH_PLATEAU_TROLL_STRONGHOLD(new Quest[]{Quest.DEATH_PLATEAU, Quest.TROLL_STRONGHOLD}, new WorldPoint(2895, 3528, 0)),
DEATH_TO_THE_DORGESHUUN(Quest.DEATH_TO_THE_DORGESHUUN, new WorldPoint(3316, 9613, 0)), DEATH_TO_THE_DORGESHUUN(Quest.DEATH_TO_THE_DORGESHUUN, new WorldPoint(3316, 9613, 0)),
THE_DEPTHS_OF_DESPAIR(Quest.THE_DEPTHS_OF_DESPAIR, new WorldPoint(1780, 3569, 0)), THE_DEPTHS_OF_DESPAIR(Quest.THE_DEPTHS_OF_DESPAIR, new WorldPoint(1781, 3570, 0)),
DESERT_TREASURE(Quest.DESERT_TREASURE, new WorldPoint(3177, 3043, 0)), DESERT_TREASURE(Quest.DESERT_TREASURE, new WorldPoint(3177, 3043, 0)),
DEVIOUS_MINDS(Quest.DEVIOUS_MINDS, new WorldPoint(3405, 3492, 0)), DEVIOUS_MINDS(Quest.DEVIOUS_MINDS, new WorldPoint(3405, 3492, 0)),
THE_DIG_SITE(Quest.THE_DIG_SITE, new WorldPoint(3363, 3337, 0)), THE_DIG_SITE(Quest.THE_DIG_SITE, new WorldPoint(3363, 3337, 0)),

View File

@@ -74,9 +74,9 @@ bool face_visible(ivec4 vA, ivec4 vB, ivec4 vC, ivec4 position, int cameraYaw, i
vB += position - cameraPos; vB += position - cameraPos;
vC += position - cameraPos; vC += position - cameraPos;
ivec3 sA = toScreen(vA.xyz, cameraYaw, cameraPitch, centerX, centerY, zoom); vec3 sA = toScreen(vA.xyz, cameraYaw, cameraPitch, centerX, centerY, zoom);
ivec3 sB = toScreen(vB.xyz, cameraYaw, cameraPitch, centerX, centerY, zoom); vec3 sB = toScreen(vB.xyz, cameraYaw, cameraPitch, centerX, centerY, zoom);
ivec3 sC = toScreen(vC.xyz, cameraYaw, cameraPitch, centerX, centerY, zoom); vec3 sC = toScreen(vC.xyz, cameraYaw, cameraPitch, centerX, centerY, zoom);
return (sA.x - sB.x) * (sC.y - sB.y) - (sC.x - sB.x) * (sA.y - sB.y) > 0; return (sA.x - sB.x) * (sC.y - sB.y) - (sC.x - sB.x) * (sA.y - sB.y) > 0;
} }

View File

@@ -74,9 +74,9 @@ bool face_visible(ivec4 vA, ivec4 vB, ivec4 vC, ivec4 position, int cameraYaw, i
vB += position - cameraPos; vB += position - cameraPos;
vC += position - cameraPos; vC += position - cameraPos;
ivec3 sA = toScreen(vA.xyz, cameraYaw, cameraPitch, centerX, centerY, zoom); vec3 sA = toScreen(vA.xyz, cameraYaw, cameraPitch, centerX, centerY, zoom);
ivec3 sB = toScreen(vB.xyz, cameraYaw, cameraPitch, centerX, centerY, zoom); vec3 sB = toScreen(vB.xyz, cameraYaw, cameraPitch, centerX, centerY, zoom);
ivec3 sC = toScreen(vC.xyz, cameraYaw, cameraPitch, centerX, centerY, zoom); vec3 sC = toScreen(vC.xyz, cameraYaw, cameraPitch, centerX, centerY, zoom);
return (sA.x - sB.x) * (sC.y - sB.y) - (sC.x - sB.x) * (sA.y - sB.y) > 0; return (sA.x - sB.x) * (sC.y - sB.y) - (sC.x - sB.x) * (sA.y - sB.y) > 0;
} }

View File

@@ -60,9 +60,9 @@ out float fogAmount;
void main() { void main() {
ivec3 cameraPos = ivec3(cameraX, cameraY, cameraZ); ivec3 cameraPos = ivec3(cameraX, cameraY, cameraZ);
ivec3 screenA = toScreen(vPosition[0] - cameraPos, cameraYaw, cameraPitch, centerX, centerY, zoom); vec3 screenA = toScreen(vPosition[0] - cameraPos, cameraYaw, cameraPitch, centerX, centerY, zoom);
ivec3 screenB = toScreen(vPosition[1] - cameraPos, cameraYaw, cameraPitch, centerX, centerY, zoom); vec3 screenB = toScreen(vPosition[1] - cameraPos, cameraYaw, cameraPitch, centerX, centerY, zoom);
ivec3 screenC = toScreen(vPosition[2] - cameraPos, cameraYaw, cameraPitch, centerX, centerY, zoom); vec3 screenC = toScreen(vPosition[2] - cameraPos, cameraYaw, cameraPitch, centerX, centerY, zoom);
if (-screenA.z < 50 || -screenB.z < 50 || -screenC.z < 50) { if (-screenA.z < 50 || -screenB.z < 50 || -screenC.z < 50) {
// the client does not draw a triangle if any vertex distance is <50 // the client does not draw a triangle if any vertex distance is <50

View File

@@ -26,22 +26,22 @@
/* /*
* Convert a vertex to screen space * Convert a vertex to screen space
*/ */
ivec3 toScreen(ivec3 vertex, int cameraYaw, int cameraPitch, int centerX, int centerY, int zoom) { vec3 toScreen(ivec3 vertex, int cameraYaw, int cameraPitch, int centerX, int centerY, int zoom) {
int yawSin = int(65536.0f * sin(cameraYaw * UNIT)); float yawSin = sin(cameraYaw * UNIT);
int yawCos = int(65536.0f * cos(cameraYaw * UNIT)); float yawCos = cos(cameraYaw * UNIT);
int pitchSin = int(65536.0f * sin(cameraPitch * UNIT)); float pitchSin = sin(cameraPitch * UNIT);
int pitchCos = int(65536.0f * cos(cameraPitch * UNIT)); float pitchCos = cos(cameraPitch * UNIT);
int rotatedX = ((vertex.z * yawSin) + (vertex.x * yawCos)) >> 16; float rotatedX = (vertex.z * yawSin) + (vertex.x * yawCos);
int rotatedZ = ((vertex.z * yawCos) - (vertex.x * yawSin)) >> 16; float rotatedZ = (vertex.z * yawCos) - (vertex.x * yawSin);
int var13 = ((vertex.y * pitchCos) - (rotatedZ * pitchSin)) >> 16; float var13 = (vertex.y * pitchCos) - (rotatedZ * pitchSin);
int var12 = ((vertex.y * pitchSin) + (rotatedZ * pitchCos)) >> 16; float var12 = (vertex.y * pitchSin) + (rotatedZ * pitchCos);
int x = rotatedX * zoom / var12 + centerX; float x = rotatedX * zoom / var12 + centerX;
int y = var13 * zoom / var12 + centerY; float y = var13 * zoom / var12 + centerY;
int z = -var12; // in OpenGL depth is negative float z = -var12; // in OpenGL depth is negative
return ivec3(x, y, z); return vec3(x, y, z);
} }

View File

@@ -1798,7 +1798,8 @@ public abstract class RSClientMixin implements RSClient
int type = client.getVarpDefinition(var0).getType(); int type = client.getVarpDefinition(var0).getType();
if (type == 3 || type == 4 || type == 10) if (type == 3 || type == 4 || type == 10)
{ {
client.getCallbacks().post(VolumeChanged.class, VolumeChanged.INSTANCE); VolumeChanged volumeChanged = new VolumeChanged(null);
client.getCallbacks().post(VolumeChanged.class, volumeChanged);
} }
} }
} }

View File

@@ -120,7 +120,7 @@ public abstract class SoundEffectMixin implements RSClient
{ {
// Regular sound effect // Regular sound effect
SoundEffectPlayed event = new SoundEffectPlayed(); SoundEffectPlayed event = new SoundEffectPlayed(null);
event.setSoundId(client.getQueuedSoundEffectIDs()[soundIndex]); event.setSoundId(client.getQueuedSoundEffectIDs()[soundIndex]);
event.setDelay(client.getQueuedSoundEffectDelays()[soundIndex]); event.setDelay(client.getQueuedSoundEffectDelays()[soundIndex]);
client.getCallbacks().post(SoundEffectPlayed.class, event); client.getCallbacks().post(SoundEffectPlayed.class, event);
@@ -133,7 +133,7 @@ public abstract class SoundEffectMixin implements RSClient
int y = (packedLocation >> 8) & 0xFF; int y = (packedLocation >> 8) & 0xFF;
int range = (packedLocation) & 0xFF; int range = (packedLocation) & 0xFF;
AreaSoundEffectPlayed event = new AreaSoundEffectPlayed(); AreaSoundEffectPlayed event = new AreaSoundEffectPlayed(null);
event.setSoundId(client.getQueuedSoundEffectIDs()[soundIndex]); event.setSoundId(client.getQueuedSoundEffectIDs()[soundIndex]);
event.setSceneX(x); event.setSceneX(x);
event.setSceneY(y); event.setSceneY(y);

View File

@@ -260,7 +260,7 @@ public class NpcStatsDumper
private static boolean isAttackableNpc(final NpcDefinition n) private static boolean isAttackableNpc(final NpcDefinition n)
{ {
for (final String s : n.getOptions()) for (final String s : n.getActions())
{ {
if ("attack".equalsIgnoreCase(s)) if ("attack".equalsIgnoreCase(s))
{ {