Merge remote-tracking branch 'runelite/master' into master

This commit is contained in:
Owain van Brakel
2020-08-28 02:11:26 +02:00
22 changed files with 909 additions and 329 deletions

View File

@@ -205,14 +205,15 @@ public class Notifier
public void processFlash(final Graphics2D graphics)
{
if (flashStart == null || client.getGameState() != GameState.LOGGED_IN)
FlashNotification flashNotification = runeLiteConfig.flashNotification();
if (flashStart == null || client.getGameState() != GameState.LOGGED_IN
|| flashNotification == FlashNotification.DISABLED)
{
flashStart = null;
return;
}
FlashNotification flashNotification = runeLiteConfig.flashNotification();
if (Instant.now().minusMillis(MINIMUM_FLASH_DURATION_MILLIS).isAfter(flashStart))
{
switch (flashNotification)

View File

@@ -182,12 +182,15 @@ public class DiscordService implements AutoCloseable
*
* @param userId The id of the user to respond to
* @param reply The reply type
* @see DiscordRPC#DISCORD_REPLY_NO
* @see DiscordRPC#DISCORD_REPLY_YES
* @see DiscordRPC#DISCORD_REPLY_IGNORE
*/
public void respondToRequest(String userId, DiscordReplyType reply)
public void respondToRequest(String userId, int reply)
{
if (discordRPC != null)
{
discordRPC.Discord_Respond(userId, reply.ordinal());
discordRPC.Discord_Respond(userId, reply);
}
}
@@ -204,6 +207,7 @@ public class DiscordService implements AutoCloseable
private void disconnected(int errorCode, String message)
{
log.debug("Discord disconnected {}: {}", errorCode, message);
eventBus.post(DiscordDisconnected.class, new DiscordDisconnected(errorCode, message));
}
@@ -215,16 +219,19 @@ public class DiscordService implements AutoCloseable
private void joinGame(String joinSecret)
{
log.debug("Discord join game: {}", joinSecret);
eventBus.post(DiscordJoinGame.class, new DiscordJoinGame(joinSecret));
}
private void spectateGame(String spectateSecret)
{
log.debug("Discord spectate game: {}", spectateSecret);
eventBus.post(DiscordSpectateGame.class, new DiscordSpectateGame(spectateSecret));
}
private void joinRequest(DiscordUser user)
{
log.debug("Discord join request: {}", user);
eventBus.post(DiscordJoinRequest.class, new DiscordJoinRequest(
user.userId,
user.username,

View File

@@ -189,7 +189,7 @@ public enum ItemMapping
ITEM_VIGGORAS_CHAINMACE(VIGGORAS_CHAINMACE_U, VIGGORAS_CHAINMACE),
ITEM_THAMMARONS_SCEPTRE(THAMMARONS_SCEPTRE_U, THAMMARONS_SCEPTRE),
ITEM_BRYOPHYTAS_STAFF(BRYOPHYTAS_STAFF_UNCHARGED, BRYOPHYTAS_STAFF),
ITEM_RING_OF_ENDURANCE(RING_OF_ENDURANCE_UNCHARGED, RING_OF_ENDURANCE),
ITEM_RING_OF_ENDURANCE(RING_OF_ENDURANCE_UNCHARGED_24844, RING_OF_ENDURANCE),
// Infinity colour kits
ITEM_INFINITY_TOP(INFINITY_TOP, INFINITY_TOP_10605, INFINITY_TOP_20574, DARK_INFINITY_TOP, LIGHT_INFINITY_TOP),

View File

@@ -55,6 +55,7 @@ public class WorldMapOverlay extends Overlay
private static final int TOOLTIP_OFFSET_WIDTH = 5;
private static final int TOOLTIP_PADDING_HEIGHT = 1;
private static final int TOOLTIP_PADDING_WIDTH = 2;
private static final int TOOLTIP_TEXT_OFFSET_HEIGHT = -2;
private static final Splitter TOOLTIP_SPLITTER = Splitter.on("<br>").trimResults().omitEmptyStrings();
@@ -290,7 +291,7 @@ public class WorldMapOverlay extends Overlay
graphics.setColor(JagexColors.TOOLTIP_TEXT);
for (int i = 0; i < rows.size(); i++)
{
graphics.drawString(rows.get(i), drawPoint.getX(), drawPoint.getY() + (i + 1) * height);
graphics.drawString(rows.get(i), drawPoint.getX(), drawPoint.getY() + TOOLTIP_TEXT_OFFSET_HEIGHT + (i + 1) * height);
}
}

View File

@@ -65,7 +65,7 @@ public class PartyService
private UUID localPartyId = UUID.randomUUID();
@Getter
private UUID partyId = localPartyId;
private UUID partyId;
@Setter
private String username;
@@ -97,7 +97,6 @@ public class PartyService
if (partyId == null)
{
localPartyId = UUID.randomUUID(); // cycle local party id so that a new party is created now
partyId = localPartyId;
// close the websocket if the session id isn't for an account
if (sessionManager.getAccountSession() == null)
@@ -122,7 +121,7 @@ public class PartyService
wsClient.send(new Join(partyId, username));
}
private void onUserJoin(final UserJoin message)
public void onUserJoin(final UserJoin message)
{
if (!partyId.equals(message.getPartyId()))
{
@@ -206,8 +205,13 @@ public class PartyService
return Collections.unmodifiableList(members);
}
public boolean isOwner()
public boolean isInParty()
{
return partyId == null || localPartyId.equals(partyId);
return partyId != null;
}
public boolean isPartyOwner()
{
return localPartyId.equals(partyId);
}
}