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

Nice insider info btw, be nice if you shared it, so-called "open source" client.
This commit is contained in:
ThatGamerBlue
2021-05-28 21:39:25 +01:00
481 changed files with 53410 additions and 51723 deletions

View File

@@ -98,6 +98,8 @@ public class ChatCommandManager implements ChatboxInputListener
case PRIVATECHAT:
case MODPRIVATECHAT:
case PRIVATECHATOUT:
case CLAN_CHAT:
case CLAN_GUEST_CHAT:
break;
default:
return;

View File

@@ -119,7 +119,7 @@ public class ChatMessageManager
boolean isChatboxTransparent = client.isResized() && client.getVar(Varbits.TRANSPARENT_CHATBOX) == 1;
Color usernameColor = null;
Color senderColor;
Color senderColor = null;
switch (chatMessageType)
{
@@ -147,12 +147,22 @@ public class ChatMessageManager
break;
}
case FRIENDSCHAT:
case FRIENDSCHATNOTIFICATION:
usernameColor = isChatboxTransparent ? chatColorConfig.transparentFriendsChatUsernames() : chatColorConfig.opaqueFriendsChatUsernames();
senderColor = isChatboxTransparent ? chatColorConfig.transparentFriendsChatChannelName() : chatColorConfig.opaqueFriendsChatChannelName();
break;
case CLAN_CHAT:
case CLAN_MESSAGE:
usernameColor = isChatboxTransparent ? chatColorConfig.transparentClanChatUsernames() : chatColorConfig.opaqueClanChatUsernames();
senderColor = isChatboxTransparent ? chatColorConfig.transparentClanChannelName() : chatColorConfig.opaqueClanChannelName();
break;
case CLAN_GUEST_CHAT:
case CLAN_GUEST_MESSAGE:
usernameColor = isChatboxTransparent ? chatColorConfig.transparentClanChatGuestUsernames() : chatColorConfig.opaqueClanChatGuestUsernames();
senderColor = isChatboxTransparent ? chatColorConfig.transparentClanChannelGuestName() : chatColorConfig.opaqueClanGuestChatChannelName();
break;
}
senderColor = isChatboxTransparent ? chatColorConfig.transparentFriendsChatChannelName() : chatColorConfig.opaqueFriendsChatChannelName();
if (usernameColor != null)
{
messageNode.setName(ColorUtil.wrapWithColorTag(messageNode.getName(), usernameColor));
@@ -186,12 +196,14 @@ public class ChatMessageManager
{
final String eventName = scriptCallbackEvent.getEventName();
boolean wrap;
switch (eventName)
{
case "privateChatFrom":
case "privateChatTo":
case "privateChatSplitFrom":
case "privateChatSplitTo":
case "splitPrivChatUsernameColor":
wrap = false;
break;
case "privChatUsername":
wrap = true;
break;
default:
return;
@@ -206,10 +218,17 @@ public class ChatMessageManager
final String[] stringStack = client.getStringStack();
final int stringStackSize = client.getStringStackSize();
// Stack is: To/From playername :
String toFrom = stringStack[stringStackSize - 3];
stringStack[stringStackSize - 3] = ColorUtil.prependColorTag(toFrom, usernameColor);
String fromToUsername = stringStack[stringStackSize - 1];
if (wrap)
{
fromToUsername = ColorUtil.wrapWithColorTag(fromToUsername, usernameColor);
}
else
{
fromToUsername = ColorUtil.colorTag(usernameColor);
}
stringStack[stringStackSize - 1] = fromToUsername;
}
private static Color getDefaultColor(ChatMessageType type, boolean transparent)
@@ -226,12 +245,16 @@ public class ChatMessageManager
case PRIVATECHAT:
return JagexColors.CHAT_PRIVATE_MESSAGE_TEXT_OPAQUE_BACKGROUND;
case FRIENDSCHAT:
case CLAN_CHAT:
case CLAN_GUEST_CHAT:
return JagexColors.CHAT_FC_TEXT_OPAQUE_BACKGROUND;
case ITEM_EXAMINE:
case OBJECT_EXAMINE:
case NPC_EXAMINE:
case CONSOLE:
case FRIENDSCHATNOTIFICATION:
case CLAN_MESSAGE:
case CLAN_GUEST_MESSAGE:
return JagexColors.CHAT_GAME_EXAMINE_TEXT_OPAQUE_BACKGROUND;
}
}
@@ -247,12 +270,16 @@ public class ChatMessageManager
case PRIVATECHAT:
return JagexColors.CHAT_PRIVATE_MESSAGE_TEXT_TRANSPARENT_BACKGROUND;
case FRIENDSCHAT:
case CLAN_CHAT:
case CLAN_GUEST_CHAT:
return JagexColors.CHAT_FC_TEXT_TRANSPARENT_BACKGROUND;
case ITEM_EXAMINE:
case OBJECT_EXAMINE:
case NPC_EXAMINE:
case CONSOLE:
case FRIENDSCHATNOTIFICATION:
case CLAN_MESSAGE:
case CLAN_GUEST_MESSAGE:
return JagexColors.CHAT_GAME_EXAMINE_TEXT_TRANSPARENT_BACKGROUND;
}
}
@@ -341,6 +368,49 @@ public class ChatMessageManager
cacheColor(new ChatColor(ChatColorType.HIGHLIGHT, chatColorConfig.opaqueFriendsChatMessageHighlight(), false),
ChatMessageType.FRIENDSCHAT);
}
//region opaque clanchat
if (chatColorConfig.opaqueClanChatInfo() != null)
{
cacheColor(new ChatColor(ChatColorType.NORMAL, chatColorConfig.opaqueClanChatInfo(), false),
ChatMessageType.CLAN_MESSAGE);
}
if (chatColorConfig.opaqueClanChatInfoHighlight() != null)
{
cacheColor(new ChatColor(ChatColorType.HIGHLIGHT, chatColorConfig.opaqueClanChatInfoHighlight(), false),
ChatMessageType.CLAN_MESSAGE);
}
if (chatColorConfig.opaqueClanChatMessage() != null)
{
cacheColor(new ChatColor(ChatColorType.NORMAL, chatColorConfig.opaqueClanChatMessage(), false),
ChatMessageType.CLAN_CHAT);
}
if (chatColorConfig.opaqueClanChatMessageHighlight() != null)
{
cacheColor(new ChatColor(ChatColorType.HIGHLIGHT, chatColorConfig.opaqueClanChatMessageHighlight(), false),
ChatMessageType.CLAN_CHAT);
}
if (chatColorConfig.opaqueClanChatGuestInfo() != null)
{
cacheColor(new ChatColor(ChatColorType.NORMAL, chatColorConfig.opaqueClanChatGuestInfo(), false),
ChatMessageType.CLAN_GUEST_MESSAGE);
}
if (chatColorConfig.opaqueClanChatGuestInfoHighlight() != null)
{
cacheColor(new ChatColor(ChatColorType.HIGHLIGHT, chatColorConfig.opaqueClanChatGuestInfoHighlight(), false),
ChatMessageType.CLAN_GUEST_MESSAGE);
}
if (chatColorConfig.opaqueClanChatGuestMessage() != null)
{
cacheColor(new ChatColor(ChatColorType.NORMAL, chatColorConfig.opaqueClanChatGuestMessage(), false),
ChatMessageType.CLAN_GUEST_CHAT);
}
if (chatColorConfig.opaqueClanChatGuestMessageHighlight() != null)
{
cacheColor(new ChatColor(ChatColorType.HIGHLIGHT, chatColorConfig.opaqueClanChatGuestMessageHighlight(), false),
ChatMessageType.CLAN_GUEST_CHAT);
}
//endregion
if (chatColorConfig.opaqueAutochatMessage() != null)
{
cacheColor(new ChatColor(ChatColorType.NORMAL, chatColorConfig.opaqueAutochatMessage(), false),
@@ -454,6 +524,7 @@ public class ChatMessageManager
cacheColor(new ChatColor(ChatColorType.HIGHLIGHT, chatColorConfig.transparentPrivateMessageReceivedHighlight(), true),
ChatMessageType.MODPRIVATECHAT);
}
//region transpaprent friends chat
if (chatColorConfig.transparentFriendsChatInfo() != null)
{
cacheColor(new ChatColor(ChatColorType.NORMAL, chatColorConfig.transparentFriendsChatInfo(), true),
@@ -474,6 +545,50 @@ public class ChatMessageManager
cacheColor(new ChatColor(ChatColorType.HIGHLIGHT, chatColorConfig.transparentFriendsChatMessageHighlight(), true),
ChatMessageType.FRIENDSCHAT);
}
//endregion
//region transparent clanchat
if (chatColorConfig.transparentClanChatInfo() != null)
{
cacheColor(new ChatColor(ChatColorType.NORMAL, chatColorConfig.transparentClanChatInfo(), true),
ChatMessageType.CLAN_MESSAGE);
}
if (chatColorConfig.transparentClanChatInfoHighlight() != null)
{
cacheColor(new ChatColor(ChatColorType.HIGHLIGHT, chatColorConfig.transparentClanChatInfoHighlight(), true),
ChatMessageType.CLAN_MESSAGE);
}
if (chatColorConfig.transparentClanChatMessage() != null)
{
cacheColor(new ChatColor(ChatColorType.NORMAL, chatColorConfig.transparentClanChatMessage(), true),
ChatMessageType.CLAN_CHAT);
}
if (chatColorConfig.transparentClanChatMessageHighlight() != null)
{
cacheColor(new ChatColor(ChatColorType.HIGHLIGHT, chatColorConfig.transparentClanChatMessageHighlight(), true),
ChatMessageType.CLAN_CHAT);
}
if (chatColorConfig.transparentClanChatGuestInfo() != null)
{
cacheColor(new ChatColor(ChatColorType.NORMAL, chatColorConfig.transparentClanChatGuestInfo(), true),
ChatMessageType.CLAN_GUEST_MESSAGE);
}
if (chatColorConfig.transparentClanChatGuestInfoHighlight() != null)
{
cacheColor(new ChatColor(ChatColorType.HIGHLIGHT, chatColorConfig.transparentClanChatGuestInfoHighlight(), true),
ChatMessageType.CLAN_GUEST_MESSAGE);
}
if (chatColorConfig.transparentClanChatGuestMessage() != null)
{
cacheColor(new ChatColor(ChatColorType.NORMAL, chatColorConfig.transparentClanChatGuestMessage(), true),
ChatMessageType.CLAN_GUEST_CHAT);
}
if (chatColorConfig.transparentClanChatGuestMessageHighlight() != null)
{
cacheColor(new ChatColor(ChatColorType.HIGHLIGHT, chatColorConfig.transparentClanChatGuestMessageHighlight(), true),
ChatMessageType.CLAN_GUEST_CHAT);
}
//endregion
if (chatColorConfig.transparentAutochatMessage() != null)
{
cacheColor(new ChatColor(ChatColorType.NORMAL, chatColorConfig.transparentAutochatMessage(), true),

View File

@@ -108,6 +108,7 @@ public interface ChatColorConfig extends Config
return Color.decode("#002783");
}
//region opaque friends chat
@ConfigItem(
position = 7,
keyName = "opaqueFriendsChatInfo",
@@ -149,9 +150,96 @@ public interface ChatColorConfig extends Config
{
return Color.decode("#000000");
}
//endregion
//region opaque clan chat
@ConfigItem(
position = 11,
keyName = "opaqueClanInfo",
name = "Clan chat info",
description = "Clan Chat Information (eg. when joining a channel)",
section = opaqueSection
)
Color opaqueClanChatInfo();
@ConfigItem(
position = 12,
keyName = "opaqueClanInfoHighlight",
name = "Clan chat info highlight",
description = "Clan Chat Information highlight",
section = opaqueSection
)
default Color opaqueClanChatInfoHighlight()
{
return Color.RED;
}
@ConfigItem(
position = 13,
keyName = "opaqueClanMessage",
name = "Clan chat message",
description = "Color of Clan chat messages",
section = opaqueSection
)
Color opaqueClanChatMessage();
@ConfigItem(
position = 14,
keyName = "opaqueClanChatMessageHighlight",
name = "Clan chat message highlight",
description = "Color of highlights in Clan Chat messages",
section = opaqueSection
)
default Color opaqueClanChatMessageHighlight()
{
return Color.decode("#000000");
}
@ConfigItem(
position = 15,
keyName = "opaqueClanGuestInfo",
name = "Guest Clan chat info",
description = "Guest Clan Chat Information (eg. when joining a channel)",
section = opaqueSection
)
Color opaqueClanChatGuestInfo();
@ConfigItem(
position = 16,
keyName = "opaqueClanGuestInfoHighlight",
name = "Guest Clan chat info highlight",
description = "Guest Clan Chat Information highlight",
section = opaqueSection
)
default Color opaqueClanChatGuestInfoHighlight()
{
return Color.RED;
}
@ConfigItem(
position = 17,
keyName = "opaqueClanGuestMessage",
name = "Guest Clan chat message",
description = "Color of Guest Clan chat messages",
section = opaqueSection
)
Color opaqueClanChatGuestMessage();
@ConfigItem(
position = 18,
keyName = "opaqueClanChatGuestMessageHighlight",
name = "Guest Clan chat message highlight",
description = "Color of highlights in Guest Clan Chat messages",
section = opaqueSection
)
default Color opaqueClanChatGuestMessageHighlight()
{
return Color.decode("#000000");
}
//endregion
@ConfigItem(
position = 19,
keyName = "opaqueAutochatMessage",
name = "Autochat",
description = "Color of Autochat messages",
@@ -160,7 +248,7 @@ public interface ChatColorConfig extends Config
Color opaqueAutochatMessage();
@ConfigItem(
position = 12,
position = 20,
keyName = "opaqueAutochatMessageHighlight",
name = "Autochat highlight",
description = "Color of highlights in Autochat messages",
@@ -169,7 +257,7 @@ public interface ChatColorConfig extends Config
Color opaqueAutochatMessageHighlight();
@ConfigItem(
position = 13,
position = 21,
keyName = "opaqueTradeChatMessage",
name = "Trade chat",
description = "Color of Trade Chat Messages",
@@ -178,7 +266,7 @@ public interface ChatColorConfig extends Config
Color opaqueTradeChatMessage();
@ConfigItem(
position = 14,
position = 22,
keyName = "opaqueTradeChatMessageHighlight",
name = "Trade chat highlight",
description = "Color of highlights in Trade Chat Messages",
@@ -187,7 +275,7 @@ public interface ChatColorConfig extends Config
Color opaqueTradeChatMessageHighlight();
@ConfigItem(
position = 15,
position = 23,
keyName = "opaqueServerMessage",
name = "Server message",
description = "Color of Server Messages (eg. 'Welcome to RuneScape')",
@@ -196,7 +284,7 @@ public interface ChatColorConfig extends Config
Color opaqueServerMessage();
@ConfigItem(
position = 16,
position = 24,
keyName = "opaqueServerMessageHighlight",
name = "Server message highlight",
description = "Color of highlights in Server Messages",
@@ -205,7 +293,7 @@ public interface ChatColorConfig extends Config
Color opaqueServerMessageHighlight();
@ConfigItem(
position = 17,
position = 25,
keyName = "opaqueGameMessage",
name = "Game message",
description = "Color of Game Messages",
@@ -214,7 +302,7 @@ public interface ChatColorConfig extends Config
Color opaqueGameMessage();
@ConfigItem(
position = 18,
position = 26,
keyName = "opaqueGameMessageHighlight",
name = "Game message highlight",
description = "Color of highlights in Game Messages",
@@ -226,7 +314,7 @@ public interface ChatColorConfig extends Config
}
@ConfigItem(
position = 19,
position = 27,
keyName = "opaqueExamine",
name = "Examine",
description = "Color of Examine Text",
@@ -235,7 +323,7 @@ public interface ChatColorConfig extends Config
Color opaqueExamine();
@ConfigItem(
position = 20,
position = 28,
keyName = "opaqueExamineHighlight",
name = "Examine highlight",
description = "Color of highlights in Examine Text",
@@ -247,7 +335,7 @@ public interface ChatColorConfig extends Config
}
@ConfigItem(
position = 21,
position = 29,
keyName = "opaqueFiltered",
name = "Filtered",
description = "Color of Filtered Text (messages that aren't shown when Game messages are filtered)",
@@ -256,7 +344,7 @@ public interface ChatColorConfig extends Config
Color opaqueFiltered();
@ConfigItem(
position = 22,
position = 30,
keyName = "opaqueFilteredHighlight",
name = "Filtered highlight",
description = "Color of highlights in Filtered Text",
@@ -265,7 +353,7 @@ public interface ChatColorConfig extends Config
Color opaqueFilteredHighlight();
@ConfigItem(
position = 23,
position = 31,
keyName = "opaqueUsername",
name = "Usernames",
description = "Color of Usernames",
@@ -274,7 +362,7 @@ public interface ChatColorConfig extends Config
Color opaqueUsername();
@ConfigItem(
position = 24,
position = 32,
keyName = "opaquePrivateUsernames",
name = "Private chat usernames",
description = "Color of Usernames in Private Chat",
@@ -283,16 +371,34 @@ public interface ChatColorConfig extends Config
Color opaquePrivateUsernames();
@ConfigItem(
position = 25,
position = 33,
keyName = "opaqueClanChannelName",
name = "Friends chat channel name",
name = "Friends Chat channel name",
description = "Color of Friends chat channel name",
section = opaqueSection
)
Color opaqueFriendsChatChannelName();
@ConfigItem(
position = 26,
position = 34,
keyName = "opaqueClanChatChannelName",
name = "Clan Chat channel name",
description = "Color of Clan chat channel name",
section = opaqueSection
)
Color opaqueClanChannelName();
@ConfigItem(
position = 35,
keyName = "opaqueClanChatGuestChannelName",
name = "Guest Clan Chat channel name",
description = "Color of Guest clan chat channel name",
section = opaqueSection
)
Color opaqueClanGuestChatChannelName();
@ConfigItem(
position = 36,
keyName = "opaqueClanUsernames",
name = "Friends chat usernames",
description = "Color of usernames in Friends chat",
@@ -301,7 +407,25 @@ public interface ChatColorConfig extends Config
Color opaqueFriendsChatUsernames();
@ConfigItem(
position = 27,
position = 37,
keyName = "opaqueClanChatUsernames",
name = "Clan chat usernames",
description = "Color of usernames in Clan chat",
section = opaqueSection
)
Color opaqueClanChatUsernames();
@ConfigItem(
position = 38,
keyName = "opaqueClanChatGuestUsernames",
name = "Guest Clan chat usernames",
description = "Color of usernames in Guest Clan chat",
section = opaqueSection
)
Color opaqueClanChatGuestUsernames();
@ConfigItem(
position = 39,
keyName = "opaquePublicFriendUsernames",
name = "Public friend usernames",
description = "Color of Friend Usernames in Public Chat",
@@ -310,7 +434,7 @@ public interface ChatColorConfig extends Config
Color opaquePublicFriendUsernames();
@ConfigItem(
position = 28,
position = 40,
keyName = "opaquePlayerUsername",
name = "Your username",
description = "Color of your username",
@@ -381,6 +505,7 @@ public interface ChatColorConfig extends Config
return Color.decode("#FFFFFF");
}
//region transparent friends chat
@ConfigItem(
position = 57,
keyName = "transparentFriendsChatInfo",
@@ -422,9 +547,96 @@ public interface ChatColorConfig extends Config
{
return Color.decode("#FFFFFF");
}
//endregion
//region transparent clan chat
@ConfigItem(
position = 61,
keyName = "transparentClanInfo",
name = "Clan chat info (transparent)",
description = "Clan Chat Information (eg. when joining a channel) (transparent)",
section = transparentSection
)
Color transparentClanChatInfo();
@ConfigItem(
position = 62,
keyName = "transparentClanInfoHighlight",
name = "Clan chat info highlight (transparent)",
description = "Clan Chat Information highlight (transparent)",
section = transparentSection
)
default Color transparentClanChatInfoHighlight()
{
return Color.RED;
}
@ConfigItem(
position = 63,
keyName = "transparentClanMessage",
name = "Clan chat message (transparent)",
description = "Color of Clan chat messages (transparent)",
section = transparentSection
)
Color transparentClanChatMessage();
@ConfigItem(
position = 64,
keyName = "transparentClanChatMessageHighlight",
name = "Clan chat message highlight (transparent)",
description = "Color of highlights in Clan Chat messages (transparent)",
section = transparentSection
)
default Color transparentClanChatMessageHighlight()
{
return Color.decode("#FFFFFF");
}
@ConfigItem(
position = 65,
keyName = "transparentClanGuestInfo",
name = "Guest Clan chat info (transparent)",
description = "Guest Clan Chat Information (eg. when joining a channel) (transparent)",
section = transparentSection
)
Color transparentClanChatGuestInfo();
@ConfigItem(
position = 66,
keyName = "transparentClanGuestInfoHighlight",
name = "Guest Clan chat info highlight (transparent)",
description = "Guest Clan Chat Information highlight (transparent)",
section = transparentSection
)
default Color transparentClanChatGuestInfoHighlight()
{
return Color.RED;
}
@ConfigItem(
position = 67,
keyName = "transparentClanGuestMessage",
name = "Guest Clan chat message (transparent)",
description = "Color of Guest Clan chat messages (transparent)",
section = transparentSection
)
Color transparentClanChatGuestMessage();
@ConfigItem(
position = 68,
keyName = "transparentClanChatGuestMessageHighlight",
name = "Guest Clan chat message highlight (transparent)",
description = "Color of highlights in Guest Clan Chat messages (transparent)",
section = transparentSection
)
default Color transparentClanChatGuestMessageHighlight()
{
return Color.decode("#FFFFFF");
}
//endregion
@ConfigItem(
position = 69,
keyName = "transparentAutochatMessage",
name = "Autochat (transparent)",
description = "Color of Autochat messages (transparent)",
@@ -433,7 +645,7 @@ public interface ChatColorConfig extends Config
Color transparentAutochatMessage();
@ConfigItem(
position = 62,
position = 70,
keyName = "transparentAutochatMessageHighlight",
name = "Autochat highlight (transparent)",
description = "Color of highlights in Autochat messages (transparent)",
@@ -442,7 +654,7 @@ public interface ChatColorConfig extends Config
Color transparentAutochatMessageHighlight();
@ConfigItem(
position = 63,
position = 71,
keyName = "transparentTradeChatMessage",
name = "Trade chat (transparent)",
description = "Color of Trade Chat Messages (transparent)",
@@ -451,7 +663,7 @@ public interface ChatColorConfig extends Config
Color transparentTradeChatMessage();
@ConfigItem(
position = 64,
position = 72,
keyName = "transparentTradeChatMessageHighlight",
name = "Trade chat highlight (transparent)",
description = "Color of highlights in Trade Chat Messages (transparent)",
@@ -460,7 +672,7 @@ public interface ChatColorConfig extends Config
Color transparentTradeChatMessageHighlight();
@ConfigItem(
position = 65,
position = 73,
keyName = "transparentServerMessage",
name = "Server message (transparent)",
description = "Color of Server Messages (eg. 'Welcome to RuneScape') (transparent)",
@@ -469,7 +681,7 @@ public interface ChatColorConfig extends Config
Color transparentServerMessage();
@ConfigItem(
position = 66,
position = 74,
keyName = "transparentServerMessageHighlight",
name = "Server message highlight (transparent)",
description = "Color of highlights in Server Messages (transparent)",
@@ -478,7 +690,7 @@ public interface ChatColorConfig extends Config
Color transparentServerMessageHighlight();
@ConfigItem(
position = 67,
position = 75,
keyName = "transparentGameMessage",
name = "Game message (transparent)",
description = "Color of Game Messages (transparent)",
@@ -487,7 +699,7 @@ public interface ChatColorConfig extends Config
Color transparentGameMessage();
@ConfigItem(
position = 68,
position = 76,
keyName = "transparentGameMessageHighlight",
name = "Game message highlight (transparent)",
description = "Color of highlights in Game Messages (transparent)",
@@ -499,7 +711,7 @@ public interface ChatColorConfig extends Config
}
@ConfigItem(
position = 69,
position = 77,
keyName = "transparentExamine",
name = "Examine (transparent)",
description = "Color of Examine Text (transparent)",
@@ -508,7 +720,7 @@ public interface ChatColorConfig extends Config
Color transparentExamine();
@ConfigItem(
position = 70,
position = 78,
keyName = "transparentExamineHighlight",
name = "Examine highlight (transparent)",
description = "Color of highlights in Examine Text (transparent)",
@@ -520,7 +732,7 @@ public interface ChatColorConfig extends Config
}
@ConfigItem(
position = 71,
position = 79,
keyName = "transparentFiltered",
name = "Filtered (transparent)",
description = "Color of Filtered Text (messages that aren't shown when Game messages are filtered) (transparent)",
@@ -529,7 +741,7 @@ public interface ChatColorConfig extends Config
Color transparentFiltered();
@ConfigItem(
position = 72,
position = 80,
keyName = "transparentFilteredHighlight",
name = "Filtered highlight (transparent)",
description = "Color of highlights in Filtered Text (transparent)",
@@ -538,7 +750,7 @@ public interface ChatColorConfig extends Config
Color transparentFilteredHighlight();
@ConfigItem(
position = 73,
position = 81,
keyName = "transparentUsername",
name = "Usernames (transparent)",
description = "Color of Usernames (transparent)",
@@ -547,7 +759,7 @@ public interface ChatColorConfig extends Config
Color transparentUsername();
@ConfigItem(
position = 74,
position = 82,
keyName = "transparentPrivateUsernames",
name = "Private chat usernames (transparent)",
description = "Color of Usernames in Private Chat (transparent)",
@@ -556,16 +768,34 @@ public interface ChatColorConfig extends Config
Color transparentPrivateUsernames();
@ConfigItem(
position = 75,
position = 83,
keyName = "transparentClanChannelName",
name = "Friends chat channel name (transparent)",
name = "Friends Chat channel name (transparent)",
description = "Color of Friends chat channel name (transparent)",
section = transparentSection
)
Color transparentFriendsChatChannelName();
@ConfigItem(
position = 76,
position = 84,
keyName = "transparentClanChatChannelName",
name = "Clan Chat channel name (transparent)",
description = "Color of Clan chat channel name (transparent)",
section = transparentSection
)
Color transparentClanChannelName();
@ConfigItem(
position = 85,
keyName = "transparentClanChatGuestChannelName",
name = "Guest Clan Chat channel name (transparent)",
description = "Color of Guest clan chat channel name (transparent)",
section = transparentSection
)
Color transparentClanChannelGuestName();
@ConfigItem(
position = 86,
keyName = "transparentClanUsernames",
name = "Friends chat usernames (transparent)",
description = "Color of usernames in Friends chat (transparent)",
@@ -574,7 +804,25 @@ public interface ChatColorConfig extends Config
Color transparentFriendsChatUsernames();
@ConfigItem(
position = 77,
position = 87,
keyName = "transparentClanClanUsernames",
name = "Clan chat usernames (transparent)",
description = "Color of usernames in Clan chat (transparent)",
section = transparentSection
)
Color transparentClanChatUsernames();
@ConfigItem(
position = 88,
keyName = "transparentClanClanGuestUsernames",
name = "Guest Clan chat usernames (transparent)",
description = "Color of usernames in Guest Clan chat (transparent)",
section = transparentSection
)
Color transparentClanChatGuestUsernames();
@ConfigItem(
position = 89,
keyName = "transparentPublicFriendUsernames",
name = "Public friend usernames (transparent)",
description = "Color of Friend Usernames in Public Chat (transparent)",
@@ -583,7 +831,7 @@ public interface ChatColorConfig extends Config
Color transparentPublicFriendUsernames();
@ConfigItem(
position = 78,
position = 90,
keyName = "transparentPlayerUsername",
name = "Your username (transparent)",
description = "Color of your username (transparent)",

View File

@@ -37,6 +37,7 @@ import net.runelite.api.EnumID;
import net.runelite.api.FriendsChatRank;
import net.runelite.api.GameState;
import net.runelite.api.IndexedSprite;
import net.runelite.api.clan.ClanTitle;
import net.runelite.api.events.GameStateChanged;
import net.runelite.client.eventbus.EventBus;
import net.runelite.client.eventbus.Subscribe;
@@ -52,8 +53,10 @@ public class ChatIconManager
private final SpriteManager spriteManager;
private BufferedImage[] friendsChatRankImages;
private BufferedImage[] clanRankImages;
private int friendsChatOffset;
private int clanOffset;
@Inject
private ChatIconManager(Client client, SpriteManager spriteManager, EventBus eventBus)
@@ -74,11 +77,25 @@ public class ChatIconManager
return friendsChatRankImages[friendsChatRank.ordinal() - 1];
}
@Nullable
public BufferedImage getRankImage(final ClanTitle clanTitle)
{
int rank = clanTitle.getId();
int idx = clanRankToIdx(rank);
return clanRankImages[idx];
}
public int getIconNumber(final FriendsChatRank friendsChatRank)
{
return friendsChatOffset + friendsChatRank.ordinal() - 1;
}
public int getIconNumber(final ClanTitle clanTitle)
{
int rank = clanTitle.getId();
return clanOffset + clanRankToIdx(rank);
}
@Subscribe
public void onGameStateChanged(GameStateChanged gameStateChanged)
{
@@ -91,22 +108,25 @@ public class ChatIconManager
private void loadRankIcons()
{
final EnumComposition friendsChatIcons = client.getEnum(EnumID.FRIENDS_CHAT_RANK_ICONS);
final EnumComposition clanIcons = client.getEnum(EnumID.CLAN_RANK_GRAPHIC);
{
IndexedSprite[] modIcons = client.getModIcons();
friendsChatOffset = modIcons.length;
clanOffset = friendsChatOffset + friendsChatIcons.size();
IndexedSprite blank = ImageUtil.getImageIndexedSprite(
new BufferedImage(modIcons[0].getWidth(), modIcons[0].getHeight(), BufferedImage.TYPE_INT_ARGB),
client);
modIcons = Arrays.copyOf(modIcons, friendsChatOffset + friendsChatIcons.size());
modIcons = Arrays.copyOf(modIcons, friendsChatOffset + friendsChatIcons.size() + clanIcons.size());
Arrays.fill(modIcons, friendsChatOffset, modIcons.length, blank);
client.setModIcons(modIcons);
}
friendsChatRankImages = new BufferedImage[friendsChatIcons.size()];
clanRankImages = new BufferedImage[clanIcons.size()];
final IndexedSprite[] modIcons = client.getModIcons();
@@ -120,6 +140,21 @@ public class ChatIconManager
modIcons[friendsChatOffset + fi] = ImageUtil.getImageIndexedSprite(friendsChatRankImages[fi], client);
});
}
for (int i = 0; i < clanIcons.size(); i++)
{
final int key = clanIcons.getKeys()[i];
final int idx = clanRankToIdx(key);
assert idx >= 0 && idx < clanIcons.size();
spriteManager.getSpriteAsync(clanIcons.getIntValue(key), 0, sprite ->
{
final BufferedImage img = ImageUtil.resizeCanvas(sprite, IMAGE_DIMENSION.width, IMAGE_DIMENSION.height);
clanRankImages[idx] = img;
modIcons[clanOffset + idx] = ImageUtil.getImageIndexedSprite(img, client);
});
}
}
private static BufferedImage friendsChatImageFromSprite(final BufferedImage sprite)
@@ -127,4 +162,10 @@ public class ChatIconManager
final BufferedImage canvas = ImageUtil.resizeCanvas(sprite, IMAGE_DIMENSION.width, IMAGE_DIMENSION.height);
return ImageUtil.outlineImage(canvas, IMAGE_OUTLINE_COLOR);
}
private static int clanRankToIdx(int key)
{
// keys are -5 to 264, with no 0
return key < 0 ? ~key : (key + 4);
}
}

View File

@@ -34,7 +34,7 @@ import net.runelite.api.GameState;
import net.runelite.api.ScriptID;
import net.runelite.api.VarClientInt;
import net.runelite.api.events.GameStateChanged;
import net.runelite.api.events.ScriptCallbackEvent;
import net.runelite.api.events.ScriptPreFired;
import net.runelite.api.vars.InputType;
import net.runelite.api.widgets.JavaScriptCallback;
import net.runelite.api.widgets.Widget;
@@ -153,9 +153,9 @@ public class ChatboxPanelManager
}
@Subscribe
public void onScriptCallbackEvent(ScriptCallbackEvent ev)
public void onScriptPreFired(ScriptPreFired ev)
{
if (currentInput != null && "resetChatboxInput".equals(ev.getEventName()))
if (currentInput != null && ev.getScriptId() == ScriptID.MESSAGE_LAYER_CLOSE)
{
killCurrentPanel();
}

View File

@@ -22,7 +22,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.runelite.client.plugins.friendschat;
package net.runelite.client.plugins.chatchannel;
enum ActivityType
{

View File

@@ -22,22 +22,58 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.runelite.client.plugins.friendschat;
package net.runelite.client.plugins.chatchannel;
import java.awt.Color;
import net.runelite.api.FriendsChatRank;
import net.runelite.client.config.Config;
import net.runelite.client.config.ConfigGroup;
import net.runelite.client.config.ConfigItem;
import net.runelite.client.config.ConfigSection;
@ConfigGroup("clanchat") // group name from the old plugin
public interface FriendsChatConfig extends Config
@ConfigGroup(ChatChannelConfig.GROUP)
public interface ChatChannelConfig extends Config
{
String GROUP = "clanchat"; // group name from the old plugin
@ConfigSection(
name = "Friends Chat",
description = "Configuration for friends chat",
position = 10
)
String friendsChatSection = "friendsChat";
@ConfigSection(
name = "Clan Chat",
description = "Configuration for clan chat",
position = 20
)
String clanChatSection = "clanChat";
@ConfigSection(
name = "Guest Clan Chat",
description = "Configuration for guest clan chat",
position = 30
)
String guestClanChatSection = "guestClanChat";
@ConfigItem(
keyName = "joinLeaveTimeout",
name = "Join/Leave timeout",
description = "Set the timeout duration of join/leave messages. A value of 0 will make the messages permanent.",
position = 0
)
default int joinLeaveTimeout()
{
return 20;
}
@ConfigItem(
keyName = "clanChatIcons",
name = "Chat Icons",
description = "Show rank icons next to friends chat members.",
position = 1
position = 1,
section = friendsChatSection
)
default boolean chatIcons()
{
@@ -48,7 +84,8 @@ public interface FriendsChatConfig extends Config
keyName = "recentChats",
name = "Recent Chats",
description = "Show recent friends chats.",
position = 2
position = 2,
section = friendsChatSection
)
default boolean recentChats()
{
@@ -59,7 +96,8 @@ public interface FriendsChatConfig extends Config
keyName = "clanCounter",
name = "Members Counter",
description = "Show the amount of friends chat members near you.",
position = 3
position = 3,
section = friendsChatSection
)
default boolean showCounter()
{
@@ -88,7 +126,8 @@ public interface FriendsChatConfig extends Config
keyName = "showJoinLeave",
name = "Show Join/Leave",
description = "Adds a temporary message notifying when a member joins or leaves.",
position = 4
position = 4,
section = friendsChatSection
)
default boolean showJoinLeave()
{
@@ -99,29 +138,20 @@ public interface FriendsChatConfig extends Config
keyName = "joinLeaveRank",
name = "Join/Leave rank",
description = "Only show join/leave messages for members at or above this rank.",
position = 5
position = 5,
section = friendsChatSection
)
default FriendsChatRank joinLeaveRank()
{
return FriendsChatRank.UNRANKED;
}
@ConfigItem(
keyName = "joinLeaveTimeout",
name = "Join/Leave timeout",
description = "Set the timeout duration of join/leave messages. A value of 0 will make the messages permanent.",
position = 6
)
default int joinLeaveTimeout()
{
return 20;
}
@ConfigItem(
keyName = "privateMessageIcons",
name = "Private Message Icons",
description = "Add rank icons to private messages received from members.",
position = 7
position = 7,
section = friendsChatSection
)
default boolean privateMessageIcons()
{
@@ -132,7 +162,8 @@ public interface FriendsChatConfig extends Config
keyName = "publicChatIcons",
name = "Public Chat Icons",
description = "Add rank icons to public chat messages from members.",
position = 8
position = 8,
section = friendsChatSection
)
default boolean publicChatIcons()
{
@@ -143,7 +174,8 @@ public interface FriendsChatConfig extends Config
keyName = "confirmKicks",
name = "Confirm Kicks",
description = "Shows a chat prompt to confirm kicks",
position = 10
position = 10,
section = friendsChatSection
)
default boolean confirmKicks()
{
@@ -154,7 +186,8 @@ public interface FriendsChatConfig extends Config
keyName = "showIgnores",
name = "Recolor ignored players",
description = "Recolor members who are on your ignore list",
position = 11
position = 11,
section = friendsChatSection
)
default boolean showIgnores()
{
@@ -165,10 +198,35 @@ public interface FriendsChatConfig extends Config
keyName = "showIgnoresColor",
name = "Ignored color",
description = "Allows you to change the color of the ignored players in your friends chat",
position = 12
position = 12,
section = friendsChatSection
)
default Color showIgnoresColor()
{
return Color.RED;
}
@ConfigItem(
keyName = "clanChatShowJoinLeave",
name = "Show Join/Leave",
description = "Adds a temporary message notifying when a member joins or leaves.",
position = 0,
section = clanChatSection
)
default boolean clanChatShowJoinLeave()
{
return false;
}
@ConfigItem(
keyName = "guestClanChatShowJoinLeave",
name = "Show Join/Leave",
description = "Adds a temporary message notifying when a member joins or leaves.",
position = 0,
section = guestClanChatSection
)
default boolean guestClanChatShowJoinLeave()
{
return false;
}
}

View File

@@ -24,7 +24,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.runelite.client.plugins.friendschat;
package net.runelite.client.plugins.chatchannel;
import com.google.common.base.MoreObjects;
import com.google.common.base.Strings;
@@ -36,13 +36,15 @@ import java.awt.image.BufferedImage;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Deque;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import javax.inject.Inject;
import lombok.AllArgsConstructor;
import net.runelite.api.ChatLineBuffer;
import net.runelite.api.ChatMessageType;
import net.runelite.api.ChatPlayer;
import net.runelite.api.Client;
import net.runelite.api.FriendsChatManager;
import net.runelite.api.FriendsChatMember;
@@ -56,7 +58,14 @@ import net.runelite.api.ScriptID;
import net.runelite.api.SpriteID;
import net.runelite.api.VarClientStr;
import net.runelite.api.Varbits;
import net.runelite.api.clan.ClanChannel;
import net.runelite.api.clan.ClanChannelMember;
import net.runelite.api.clan.ClanRank;
import net.runelite.api.clan.ClanSettings;
import net.runelite.api.clan.ClanTitle;
import net.runelite.api.events.ChatMessage;
import net.runelite.api.events.ClanMemberJoined;
import net.runelite.api.events.ClanMemberLeft;
import net.runelite.api.events.FriendsChatChanged;
import net.runelite.api.events.FriendsChatMemberJoined;
import net.runelite.api.events.FriendsChatMemberLeft;
@@ -72,6 +81,8 @@ import net.runelite.api.widgets.WidgetInfo;
import net.runelite.api.widgets.WidgetType;
import net.runelite.client.callback.ClientThread;
import net.runelite.client.chat.ChatMessageBuilder;
import net.runelite.client.chat.ChatMessageManager;
import net.runelite.client.chat.QueuedMessage;
import net.runelite.client.config.ChatColorConfig;
import net.runelite.client.config.ConfigManager;
import net.runelite.client.eventbus.Subscribe;
@@ -89,11 +100,11 @@ import net.runelite.client.ui.overlay.infobox.InfoBoxManager;
import net.runelite.client.util.Text;
@PluginDescriptor(
name = "Friends Chat",
description = "Add rank icons to users talking in friends chat",
tags = {"icons", "rank", "recent", "clan"}
name = "Chat Channels",
description = "Improvements for friends chat and clan chat.",
tags = {"icons", "rank", "recent", "clan", "friend", "channel"}
)
public class FriendsChatPlugin extends Plugin
public class ChatChannelPlugin extends Plugin
{
private static final int MAX_CHATS = 10;
private static final String RECENT_TITLE = "Recent FCs";
@@ -106,7 +117,7 @@ public class FriendsChatPlugin extends Plugin
private ChatIconManager chatIconManager;
@Inject
private FriendsChatConfig config;
private ChatChannelConfig config;
@Inject
private InfoBoxManager infoBoxManager;
@@ -123,22 +134,40 @@ public class FriendsChatPlugin extends Plugin
@Inject
private ChatColorConfig chatColorConfig;
private List<String> chats = new ArrayList<>();
@Inject
private ChatMessageManager chatMessageManager;
private List<String> chats;
private final List<Player> members = new ArrayList<>();
private MembersIndicator membersIndicator;
/**
* queue of temporary messages added to the client
*/
private final Deque<MemberJoinMessage> joinMessages = new ArrayDeque<>();
private final Map<String, MemberActivity> activityBuffer = new HashMap<>();
private final Map<ChatPlayer, MemberActivity> activityBuffer = new LinkedHashMap<>();
private int joinedTick;
private boolean kickConfirmed = false;
@Provides
FriendsChatConfig getConfig(ConfigManager configManager)
private boolean inputWarning;
@AllArgsConstructor
private enum InputMode
{
return configManager.getConfig(FriendsChatConfig.class);
FRIEND("Friends Chat", ChatMessageType.FRIENDSCHAT),
CLAN("Clan Chat", ChatMessageType.CLAN_CHAT),
GUEST("Guest Clan Chat", ChatMessageType.CLAN_GUEST_CHAT);
private final String prompt;
private final ChatMessageType chatMessageType;
}
private InputMode inputMode;
@Provides
ChatChannelConfig getConfig(ConfigManager configManager)
{
return configManager.getConfig(ChatChannelConfig.class);
}
@Override
@@ -155,16 +184,18 @@ public class FriendsChatPlugin extends Plugin
@Override
public void shutDown()
{
chats = null;
clientThread.invoke(() -> colorIgnoredPlayers(Color.WHITE));
members.clear();
resetCounter();
rebuildFriendsChat();
inputMode = null;
}
@Subscribe
public void onConfigChanged(ConfigChanged configChanged)
{
if (configChanged.getGroup().equals("clanchat"))
if (configChanged.getGroup().equals(ChatChannelConfig.GROUP))
{
if (!config.recentChats())
{
@@ -219,16 +250,7 @@ public class FriendsChatPlugin extends Plugin
}
// attempt to filter out world hopping joins
if (!activityBuffer.containsKey(member.getName()))
{
MemberActivity joinActivity = new MemberActivity(ActivityType.JOINED,
member, client.getTickCount());
activityBuffer.put(member.getName(), joinActivity);
}
else
{
activityBuffer.remove(member.getName());
}
queueJoin(member, MemberActivity.ChatType.FRIENDS_CHAT);
}
@Subscribe
@@ -263,15 +285,75 @@ public class FriendsChatPlugin extends Plugin
return;
}
if (!activityBuffer.containsKey(member.getName()))
queueLeave(member, MemberActivity.ChatType.FRIENDS_CHAT);
}
@Subscribe
public void onClanMemberJoined(ClanMemberJoined clanMemberJoined)
{
MemberActivity.ChatType chatType = clanChannelToChatType(clanMemberJoined.getClanChannel());
if (chatType != null && clanChannelJoinLeaveEnabled(chatType))
{
MemberActivity leaveActivity = new MemberActivity(ActivityType.LEFT,
queueJoin(clanMemberJoined.getClanMember(), chatType);
}
}
@Subscribe
public void onClanMemberLeft(ClanMemberLeft clanMemberLeft)
{
MemberActivity.ChatType chatType = clanChannelToChatType(clanMemberLeft.getClanChannel());
if (chatType != null && clanChannelJoinLeaveEnabled(chatType))
{
queueLeave(clanMemberLeft.getClanMember(), chatType);
}
}
private MemberActivity.ChatType clanChannelToChatType(ClanChannel clanChannel)
{
return clanChannel == client.getClanChannel() ? MemberActivity.ChatType.CLAN_CHAT :
clanChannel == client.getGuestClanChannel() ? MemberActivity.ChatType.GUEST_CHAT :
null;
}
private boolean clanChannelJoinLeaveEnabled(MemberActivity.ChatType chatType)
{
switch (chatType)
{
case CLAN_CHAT:
return config.clanChatShowJoinLeave();
case GUEST_CHAT:
return config.guestClanChatShowJoinLeave();
default:
return false;
}
}
private void queueJoin(ChatPlayer member, MemberActivity.ChatType chatType)
{
// attempt to filter out world hopping joins
if (!activityBuffer.containsKey(member))
{
MemberActivity joinActivity = new MemberActivity(ActivityType.JOINED, chatType,
member, client.getTickCount());
activityBuffer.put(member.getName(), leaveActivity);
activityBuffer.put(member, joinActivity);
}
else
{
activityBuffer.remove(member.getName());
activityBuffer.remove(member);
}
}
private void queueLeave(ChatPlayer member, MemberActivity.ChatType chatType)
{
if (!activityBuffer.containsKey(member))
{
MemberActivity leaveActivity = new MemberActivity(ActivityType.LEFT, chatType,
member, client.getTickCount());
activityBuffer.put(member, leaveActivity);
}
else
{
activityBuffer.remove(member);
}
}
@@ -334,7 +416,7 @@ public class FriendsChatPlugin extends Plugin
// If this message has been reused since, it will get a different id
if (joinMessage.getGetMessageId() == messageNode.getId())
{
ChatLineBuffer ccInfoBuffer = client.getChatLineMap().get(ChatMessageType.FRIENDSCHATNOTIFICATION.getType());
ChatLineBuffer ccInfoBuffer = client.getChatLineMap().get(messageNode.getType().getType());
if (ccInfoBuffer != null)
{
ccInfoBuffer.removeMessageNode(messageNode);
@@ -357,8 +439,7 @@ public class FriendsChatPlugin extends Plugin
private void addActivityMessages()
{
FriendsChatManager friendsChatManager = client.getFriendsChatManager();
if (friendsChatManager == null || activityBuffer.isEmpty())
if (activityBuffer.isEmpty())
{
return;
}
@@ -372,13 +453,28 @@ public class FriendsChatPlugin extends Plugin
if (activity.getTick() < client.getTickCount() - MESSAGE_DELAY)
{
activityIt.remove();
addActivityMessage(friendsChatManager, activity.getMember(), activity.getActivityType());
switch (activity.getChatType())
{
case FRIENDS_CHAT:
addActivityMessage((FriendsChatMember) activity.getMember(), activity.getActivityType());
break;
case CLAN_CHAT:
case GUEST_CHAT:
addClanActivityMessage((ClanChannelMember) activity.getMember(), activity.getActivityType(), activity.getChatType());
break;
}
}
}
}
private void addActivityMessage(FriendsChatManager friendsChatManager, FriendsChatMember member, ActivityType activityType)
private void addActivityMessage(FriendsChatMember member, ActivityType activityType)
{
final FriendsChatManager friendsChatManager = client.getFriendsChatManager();
if (friendsChatManager == null)
{
return;
}
final String activityMessage = activityType == ActivityType.JOINED ? " has joined." : " has left.";
final FriendsChatRank rank = member.getRank();
final Color textColor, channelColor;
@@ -421,6 +517,55 @@ public class FriendsChatPlugin extends Plugin
joinMessages.addLast(joinMessage);
}
private void addClanActivityMessage(ClanChannelMember member, ActivityType activityType, MemberActivity.ChatType chatType)
{
ClanSettings clanSettings = chatType == MemberActivity.ChatType.CLAN_CHAT ? client.getClanSettings() : client.getGuestClanSettings();
ClanRank rank = member.getRank();
if (rank == null || clanSettings == null)
{
return;
}
ClanTitle clanTitle = clanSettings.titleForRank(rank);
int rankIcon = -1;
if (clanTitle != null)
{
// Clan ranks are always included in chat messages, so we'll just always include it in join messages.
rankIcon = chatIconManager.getIconNumber(clanTitle);
}
final Color textColor;
// Use configured clan chat info colors if set, otherwise default to the jagex text and fc name colors
if (client.isResized() && client.getVar(Varbits.TRANSPARENT_CHATBOX) == 1)
{
textColor = MoreObjects.firstNonNull(
chatType == MemberActivity.ChatType.CLAN_CHAT ? chatColorConfig.transparentClanChatInfo() : chatColorConfig.transparentClanChatGuestInfo(),
CHAT_FC_TEXT_TRANSPARENT_BACKGROUND);
}
else
{
textColor = MoreObjects.firstNonNull(
chatType == MemberActivity.ChatType.CLAN_CHAT ? chatColorConfig.opaqueClanChatInfo() : chatColorConfig.opaqueClanChatGuestInfo(),
CHAT_FC_TEXT_OPAQUE_BACKGROUND);
}
ChatMessageBuilder message = new ChatMessageBuilder();
if (rankIcon > -1)
{
message.img(rankIcon);
}
message.append(textColor, member.getName() + (activityType == ActivityType.JOINED ? " has joined." : " has left."));
final String messageString = message.build();
final MessageNode line = client.addChatMessage(
chatType == MemberActivity.ChatType.CLAN_CHAT ? ChatMessageType.CLAN_MESSAGE : ChatMessageType.CLAN_GUEST_MESSAGE,
"", messageString, "");
MemberJoinMessage joinMessage = new MemberJoinMessage(line, line.getId(), client.getTickCount());
joinMessages.addLast(joinMessage);
}
@Subscribe
public void onVarClientStrChanged(VarClientStrChanged strChanged)
{
@@ -551,6 +696,67 @@ public class FriendsChatPlugin extends Plugin
clientThread.invokeLater(() -> confirmKickPlayer(kickPlayerName));
break;
}
case "preChatSendpublic":
{
final String chatboxInput = client.getVar(VarClientStr.CHATBOX_TYPED_TEXT);
switch (chatboxInput)
{
case "/p":
switchTypingMode(null);
break;
case "/f":
switchTypingMode(InputMode.FRIEND);
break;
case "/c":
switchTypingMode(InputMode.CLAN);
break;
case "/g":
switchTypingMode(InputMode.GUEST);
break;
default:
if (inputMode != null)
{
final int[] intStack = client.getIntStack();
final int intStackSize = client.getIntStackSize();
intStack[intStackSize - 1] = inputMode.chatMessageType.getType(); // chat message type
intStack[intStackSize - 2] = 0; // prefix length
}
break;
}
break;
}
case "setChatboxInput":
{
Widget chatboxInput = client.getWidget(WidgetInfo.CHATBOX_INPUT);
if (chatboxInput != null && inputMode != null)
{
String text = chatboxInput.getText();
int idx = text.indexOf(": ");
if (idx != -1)
{
String newText = inputMode.prompt + ": " + text.substring(idx + 2);
chatboxInput.setText(newText);
}
}
break;
}
}
}
private void switchTypingMode(InputMode mode)
{
inputMode = mode;
client.setVar(VarClientStr.CHATBOX_TYPED_TEXT, "");
if (mode != null && !inputWarning)
{
inputWarning = true;
chatMessageManager.queue(QueuedMessage.builder()
.type(ChatMessageType.CONSOLE)
.runeLiteFormattedMessage("You've entered " + inputMode.prompt + " typing mode. All typed messages will be sent to your " +
inputMode.prompt.toLowerCase() + ". Use /p to reset to public chat.")
.build());
}
}

View File

@@ -22,17 +22,25 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.runelite.client.plugins.friendschat;
package net.runelite.client.plugins.chatchannel;
import lombok.AllArgsConstructor;
import lombok.Value;
import net.runelite.api.FriendsChatMember;
import net.runelite.api.ChatPlayer;
@Value
@AllArgsConstructor
class MemberActivity
{
enum ChatType
{
FRIENDS_CHAT,
CLAN_CHAT,
GUEST_CHAT
}
private ActivityType activityType;
private FriendsChatMember member;
private ChatType chatType;
private ChatPlayer member;
private Integer tick;
}

View File

@@ -22,7 +22,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.runelite.client.plugins.friendschat;
package net.runelite.client.plugins.chatchannel;
import lombok.Value;
import net.runelite.api.MessageNode;

View File

@@ -22,7 +22,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.runelite.client.plugins.friendschat;
package net.runelite.client.plugins.chatchannel;
import java.awt.Color;
import java.awt.image.BufferedImage;
@@ -30,9 +30,9 @@ import net.runelite.client.ui.overlay.infobox.Counter;
class MembersIndicator extends Counter
{
private final FriendsChatPlugin plugin;
private final ChatChannelPlugin plugin;
MembersIndicator(BufferedImage image, FriendsChatPlugin plugin)
MembersIndicator(BufferedImage image, ChatChannelPlugin plugin)
{
super(image, plugin, plugin.getMembersSize());
this.plugin = plugin;

View File

@@ -110,11 +110,22 @@ public interface ChatFilterConfig extends Config
return false;
}
@ConfigItem(
keyName = "filterClanChat",
name = "Filter clan Chat Members",
description = "Filter your clan chat members' messages",
position = 7
)
default boolean filterClanChat()
{
return false;
}
@ConfigItem(
keyName = "filterLogin",
name = "Filter Logged In/Out Messages",
description = "Filter your private chat to remove logged in/out messages",
position = 7
position = 8
)
default boolean filterLogin()
{
@@ -125,7 +136,7 @@ public interface ChatFilterConfig extends Config
keyName = "filterGameChat",
name = "Filter Game Chat",
description = "Filter your game chat messages",
position = 8
position = 9
)
default boolean filterGameChat()
{
@@ -136,7 +147,7 @@ public interface ChatFilterConfig extends Config
keyName = "collapseGameChat",
name = "Collapse Game Chat",
description = "Collapse duplicate game chat messages into a single line",
position = 9
position = 10
)
default boolean collapseGameChat()
{
@@ -147,7 +158,7 @@ public interface ChatFilterConfig extends Config
keyName = "collapsePlayerChat",
name = "Collapse Player Chat",
description = "Collapse duplicate player chat messages into a single line",
position = 10
position = 11
)
default boolean collapsePlayerChat()
{
@@ -158,7 +169,7 @@ public interface ChatFilterConfig extends Config
keyName = "maxRepeatedPublicChats",
name = "Repeat filter",
description = "Block player chat message if repeated this many times. 0 is off",
position = 11
position = 12
)
default int maxRepeatedPublicChats()
{

View File

@@ -53,6 +53,7 @@ import net.runelite.api.Client;
import net.runelite.api.FriendsChatManager;
import net.runelite.api.MessageNode;
import net.runelite.api.Player;
import net.runelite.api.clan.ClanChannel;
import net.runelite.api.events.ChatMessage;
import net.runelite.api.events.OverheadTextChanged;
import net.runelite.api.events.ScriptCallbackEvent;
@@ -170,6 +171,8 @@ public class ChatFilterPlugin extends Plugin
case PRIVATECHAT:
case MODPRIVATECHAT:
case FRIENDSCHAT:
case CLAN_CHAT:
case CLAN_GUEST_CHAT:
if (shouldFilterPlayerMessage(Text.removeTags(name)))
{
message = censorMessage(name, message);
@@ -271,7 +274,8 @@ public class ChatFilterPlugin extends Plugin
boolean isMessageFromSelf = playerName.equals(client.getLocalPlayer().getName());
return !isMessageFromSelf &&
(config.filterFriends() || !client.isFriended(playerName, false)) &&
(config.filterFriendsChat() || !isFriendsChatMember(playerName));
(config.filterFriendsChat() || !isFriendsChatMember(playerName)) &&
(config.filterClanChat() || !isClanChatMember(playerName));
}
private boolean isFriendsChatMember(String name)
@@ -280,6 +284,23 @@ public class ChatFilterPlugin extends Plugin
return friendsChatManager != null && friendsChatManager.findByName(name) != null;
}
private boolean isClanChatMember(String name)
{
ClanChannel clanChannel = client.getClanChannel();
if (clanChannel != null && clanChannel.findMember(name) != null)
{
return true;
}
clanChannel = client.getGuestClanChannel();
if (clanChannel != null && clanChannel.findMember(name) != null)
{
return true;
}
return false;
}
String censorMessage(final String username, final String message)
{
String strippedMessage = jagexPrintableCharMatcher.retainFrom(message)

View File

@@ -209,6 +209,8 @@ public class ChatNotificationsPlugin extends Plugin
case MODCHAT:
case PUBLICCHAT:
case FRIENDSCHAT:
case CLAN_CHAT:
case CLAN_GUEST_CHAT:
case AUTOTYPER:
case MODAUTOTYPER:
if (client.getLocalPlayer() != null && Text.toJagexName(Text.removeTags(chatMessage.getName())).equals(client.getLocalPlayer().getName()))
@@ -250,7 +252,9 @@ public class ChatNotificationsPlugin extends Plugin
|| chatMessage.getType() == ChatMessageType.PRIVATECHAT
|| chatMessage.getType() == ChatMessageType.FRIENDSCHAT
|| chatMessage.getType() == ChatMessageType.MODCHAT
|| chatMessage.getType() == ChatMessageType.MODPRIVATECHAT))
|| chatMessage.getType() == ChatMessageType.MODPRIVATECHAT
|| chatMessage.getType() == ChatMessageType.CLAN_CHAT
|| chatMessage.getType() == ChatMessageType.CLAN_GUEST_CHAT))
{
sendNotification(chatMessage);
}

View File

@@ -124,6 +124,8 @@ public class EmojiPlugin extends Plugin
case PUBLICCHAT:
case MODCHAT:
case FRIENDSCHAT:
case CLAN_CHAT:
case CLAN_GUEST_CHAT:
case PRIVATECHAT:
case PRIVATECHATOUT:
case MODPRIVATECHAT:

View File

@@ -342,8 +342,7 @@ public class FriendNotesPlugin extends Plugin
switch (event.getEventName())
{
case "friend_cc_settext":
case "ignore_cc_settext":
case "friendsChatSetText":
String[] stringStack = client.getStringStack();
int stringStackSize = client.getStringStackSize();
final String rsn = stringStack[stringStackSize - 1];
@@ -354,8 +353,7 @@ public class FriendNotesPlugin extends Plugin
stringStack[stringStackSize - 1] = rsn + " <img=" + iconIdx + ">";
}
break;
case "friend_cc_setposition":
case "ignore_cc_setposition":
case "friendsChatSetPosition":
if (currentlyLayouting == null || getFriendNote(currentlyLayouting) == null)
{
return;

View File

@@ -95,7 +95,7 @@ public interface PlayerIndicatorsConfig extends Config
description = "Configures if friends chat members should be highlighted",
section = highlightSection
)
default boolean drawFriendsChatMemberNames()
default boolean highlightFriendsChat()
{
return true;
}
@@ -138,6 +138,30 @@ public interface PlayerIndicatorsConfig extends Config
@ConfigItem(
position = 8,
keyName = "drawClanChatMemberNames",
name = "Highlight clan members",
description = "Configures whether or not clan members should be highlighted",
section = highlightSection
)
default boolean highlightClanMembers()
{
return true;
}
@ConfigItem(
position = 9,
keyName = "clanChatMemberColor",
name = "Clan member",
description = "Color of clan members",
section = highlightSection
)
default Color getClanMemberColor()
{
return new Color(36, 15, 171);
}
@ConfigItem(
position = 10,
keyName = "drawNonClanMemberNames",
name = "Highlight others",
description = "Configures whether or not other players should be highlighted",
@@ -149,7 +173,7 @@ public interface PlayerIndicatorsConfig extends Config
}
@ConfigItem(
position = 9,
position = 11,
keyName = "nonClanMemberColor",
name = "Others",
description = "Color of other players names",
@@ -214,4 +238,15 @@ public interface PlayerIndicatorsConfig extends Config
{
return true;
}
@ConfigItem(
position = 15,
keyName = "clanchatMenuIcons",
name = "Show clan chat ranks",
description = "Add clan chat rank to right click menu and next to player names"
)
default boolean showClanChatRanks()
{
return true;
}
}

View File

@@ -34,6 +34,7 @@ import javax.inject.Singleton;
import net.runelite.api.FriendsChatRank;
import net.runelite.api.Player;
import net.runelite.api.Point;
import net.runelite.api.clan.ClanTitle;
import net.runelite.client.game.ChatIconManager;
import net.runelite.client.ui.overlay.Overlay;
import net.runelite.client.ui.overlay.OverlayPosition;
@@ -108,40 +109,49 @@ public class PlayerIndicatorsOverlay extends Overlay
return;
}
if (actor.isFriendsChatMember() && config.showFriendsChatRanks())
BufferedImage rankImage = null;
if (actor.isFriendsChatMember() && config.highlightFriendsChat() && config.showFriendsChatRanks())
{
final FriendsChatRank rank = playerIndicatorsService.getFriendsChatRank(actor);
if (rank != FriendsChatRank.UNRANKED)
{
final BufferedImage rankImage = chatIconManager.getRankImage(rank);
if (rankImage != null)
{
final int imageWidth = rankImage.getWidth();
final int imageTextMargin;
final int imageNegativeMargin;
if (drawPlayerNamesConfig == PlayerNameLocation.MODEL_RIGHT)
{
imageTextMargin = imageWidth;
imageNegativeMargin = 0;
}
else
{
imageTextMargin = imageWidth / 2;
imageNegativeMargin = imageWidth / 2;
}
final int textHeight = graphics.getFontMetrics().getHeight() - graphics.getFontMetrics().getMaxDescent();
final Point imageLocation = new Point(textLocation.getX() - imageNegativeMargin - 1, textLocation.getY() - textHeight / 2 - rankImage.getHeight() / 2);
OverlayUtil.renderImageLocation(graphics, imageLocation, rankImage);
// move text
textLocation = new Point(textLocation.getX() + imageTextMargin, textLocation.getY());
}
rankImage = chatIconManager.getRankImage(rank);
}
}
else if (actor.isClanMember() && config.highlightClanMembers() && config.showClanChatRanks())
{
ClanTitle clanTitle = playerIndicatorsService.getClanTitle(actor);
if (clanTitle != null)
{
rankImage = chatIconManager.getRankImage(clanTitle);
}
}
if (rankImage != null)
{
final int imageWidth = rankImage.getWidth();
final int imageTextMargin;
final int imageNegativeMargin;
if (drawPlayerNamesConfig == PlayerNameLocation.MODEL_RIGHT)
{
imageTextMargin = imageWidth;
imageNegativeMargin = 0;
}
else
{
imageTextMargin = imageWidth / 2;
imageNegativeMargin = imageWidth / 2;
}
final int textHeight = graphics.getFontMetrics().getHeight() - graphics.getFontMetrics().getMaxDescent();
final Point imageLocation = new Point(textLocation.getX() - imageNegativeMargin - 1, textLocation.getY() - textHeight / 2 - rankImage.getHeight() / 2);
OverlayUtil.renderImageLocation(graphics, imageLocation, rankImage);
// move text
textLocation = new Point(textLocation.getX() + imageTextMargin, textLocation.getY());
}
OverlayUtil.renderTextLocation(graphics, textLocation, name, color);
}

View File

@@ -46,6 +46,7 @@ import static net.runelite.api.MenuAction.SPELL_CAST_ON_PLAYER;
import static net.runelite.api.MenuAction.WALK;
import net.runelite.api.MenuEntry;
import net.runelite.api.Player;
import net.runelite.api.clan.ClanTitle;
import net.runelite.api.events.ClientTick;
import net.runelite.client.config.ConfigManager;
import net.runelite.client.eventbus.Subscribe;
@@ -189,11 +190,11 @@ public class PlayerIndicatorsPlugin extends Plugin
int image = -1;
Color color = null;
if (config.highlightFriends() && player.isFriend())
if (player.isFriend() && config.highlightFriends())
{
color = config.getFriendColor();
}
else if (config.drawFriendsChatMemberNames() && player.isFriendsChatMember())
else if (player.isFriendsChatMember() && config.highlightFriendsChat())
{
color = config.getFriendsChatMemberColor();
@@ -206,12 +207,24 @@ public class PlayerIndicatorsPlugin extends Plugin
}
}
}
else if (config.highlightTeamMembers()
&& player.getTeam() > 0 && client.getLocalPlayer().getTeam() == player.getTeam())
else if (player.getTeam() > 0 && client.getLocalPlayer().getTeam() == player.getTeam() && config.highlightTeamMembers())
{
color = config.getTeamMemberColor();
}
else if (config.highlightOthers() && !player.isFriendsChatMember())
else if (player.isClanMember() && config.highlightClanMembers())
{
color = config.getClanMemberColor();
if (config.showClanChatRanks())
{
ClanTitle clanTitle = playerIndicatorsService.getClanTitle(player);
if (clanTitle != null)
{
image = chatIconManager.getIconNumber(clanTitle);
}
}
}
else if (!player.isFriendsChatMember() && !player.isClanMember() && config.highlightOthers())
{
color = config.getOthersColor();
}

View File

@@ -33,6 +33,11 @@ import net.runelite.api.FriendsChatManager;
import net.runelite.api.FriendsChatMember;
import net.runelite.api.FriendsChatRank;
import net.runelite.api.Player;
import net.runelite.api.clan.ClanChannel;
import net.runelite.api.clan.ClanChannelMember;
import net.runelite.api.clan.ClanRank;
import net.runelite.api.clan.ClanSettings;
import net.runelite.api.clan.ClanTitle;
@Singleton
public class PlayerIndicatorsService
@@ -49,8 +54,9 @@ public class PlayerIndicatorsService
public void forEachPlayer(final BiConsumer<Player, Color> consumer)
{
if (!config.highlightOwnPlayer() && !config.drawFriendsChatMemberNames()
&& !config.highlightFriends() && !config.highlightOthers())
if (!config.highlightOwnPlayer() && !config.highlightFriendsChat()
&& !config.highlightFriends() && !config.highlightOthers()
&& !config.highlightClanMembers())
{
return;
}
@@ -65,6 +71,7 @@ public class PlayerIndicatorsService
}
boolean isFriendsChatMember = player.isFriendsChatMember();
boolean isClanMember = player.isClanMember();
if (player == localPlayer)
{
@@ -77,7 +84,7 @@ public class PlayerIndicatorsService
{
consumer.accept(player, config.getFriendColor());
}
else if (config.drawFriendsChatMemberNames() && isFriendsChatMember)
else if (config.highlightFriendsChat() && isFriendsChatMember)
{
consumer.accept(player, config.getFriendsChatMemberColor());
}
@@ -85,13 +92,36 @@ public class PlayerIndicatorsService
{
consumer.accept(player, config.getTeamMemberColor());
}
else if (config.highlightOthers() && !isFriendsChatMember)
else if (config.highlightClanMembers() && isClanMember)
{
consumer.accept(player, config.getClanMemberColor());
}
else if (config.highlightOthers() && !isFriendsChatMember && !isClanMember)
{
consumer.accept(player, config.getOthersColor());
}
}
}
ClanTitle getClanTitle(Player player)
{
ClanChannel clanChannel = client.getClanChannel();
ClanSettings clanSettings = client.getClanSettings();
if (clanChannel == null || clanSettings == null)
{
return null;
}
ClanChannelMember member = clanChannel.findMember(player.getName());
if (member == null)
{
return null;
}
ClanRank rank = member.getRank();
return clanSettings.titleForRank(rank);
}
FriendsChatRank getFriendsChatRank(Player player)
{
final FriendsChatManager friendsChatManager = client.getFriendsChatManager();

View File

@@ -36,7 +36,9 @@ import javax.inject.Inject;
import lombok.Getter;
import net.runelite.api.Client;
import net.runelite.api.MessageNode;
import net.runelite.api.ScriptID;
import net.runelite.api.Varbits;
import net.runelite.api.events.ScriptPreFired;
import net.runelite.client.events.ConfigChanged;
import net.runelite.api.events.ScriptCallbackEvent;
import net.runelite.client.config.ConfigManager;
@@ -62,6 +64,8 @@ public class TimestampPlugin extends Plugin
@Getter
private SimpleDateFormat formatter;
private MessageNode currentlyBuildingMessage = null;
@Provides
public TimestampConfig provideConfig(final ConfigManager configManager)
{
@@ -90,32 +94,59 @@ public class TimestampPlugin extends Plugin
}
@Subscribe
public void onScriptCallbackEvent(ScriptCallbackEvent event)
private void onScriptCallbackEvent(ScriptCallbackEvent event)
{
if (!event.getEventName().equals("addTimestamp"))
if (!"chatMessageBuilding".equals(event.getEventName()))
{
return;
}
int[] intStack = client.getIntStack();
int intStackSize = client.getIntStackSize();
int uid = client.getIntStack()[client.getIntStackSize() - 1];
currentlyBuildingMessage = client.getMessages().get(uid);
}
@Subscribe
private void onScriptPreFired(ScriptPreFired ev)
{
int numStringArgs;
int messagePrefixArg = 0;
switch (ev.getScriptId())
{
case ScriptID.CHATBOX_BUILD_LINE_WITHOUT_USER:
numStringArgs = 1;
break;
case ScriptID.CHATBOX_BUILD_LINE_WITH_USER:
numStringArgs = 2;
break;
case ScriptID.CHATBOX_BUILD_LINE_WITH_CLAN:
numStringArgs = 3;
break;
default:
return;
}
if (currentlyBuildingMessage == null)
{
return;
}
MessageNode messageNode = currentlyBuildingMessage;
currentlyBuildingMessage = null;
String[] stringStack = client.getStringStack();
int stringStackSize = client.getStringStackSize();
int messageId = intStack[intStackSize - 1];
MessageNode messageNode = client.getMessages().get(messageId);
int stringArgStart = client.getStringStackSize() - numStringArgs;
String timestamp = generateTimestamp(messageNode.getTimestamp(), ZoneId.systemDefault()) + " ";
Color timestampColour = getTimestampColour();
if (timestampColour != null)
{
timestamp = ColorUtil.wrapWithColorTag(timestamp, timestampColour);
}
stringStack[stringStackSize - 1] = timestamp;
String segment = stringStack[stringArgStart + messagePrefixArg];
segment = timestamp + segment;
stringStack[stringArgStart + messagePrefixArg] = segment;
}
private Color getTimestampColour()

View File

@@ -56,6 +56,8 @@ import net.runelite.api.MenuAction;
import net.runelite.api.MenuEntry;
import net.runelite.api.NameableContainer;
import net.runelite.api.Varbits;
import net.runelite.api.clan.ClanChannel;
import net.runelite.api.clan.ClanChannelMember;
import net.runelite.api.events.ChatMessage;
import net.runelite.api.events.GameStateChanged;
import net.runelite.api.events.GameTick;
@@ -353,10 +355,12 @@ public class WorldHopperPlugin extends Plugin
return;
}
int groupId = WidgetInfo.TO_GROUP(event.getActionParam1());
final int componentId = event.getActionParam1();
int groupId = WidgetInfo.TO_GROUP(componentId);
String option = event.getOption();
if (groupId == WidgetInfo.FRIENDS_LIST.getGroupId() || groupId == WidgetInfo.FRIENDS_CHAT.getGroupId())
if (groupId == WidgetInfo.FRIENDS_LIST.getGroupId() || groupId == WidgetInfo.FRIENDS_CHAT.getGroupId()
|| componentId == WidgetInfo.CLAN_MEMBER_LIST.getId() || componentId == WidgetInfo.CLAN_GUEST_MEMBER_LIST.getId())
{
boolean after;
@@ -744,6 +748,26 @@ public class WorldHopperPlugin extends Plugin
}
}
ClanChannel clanChannel = client.getClanChannel();
if (clanChannel != null)
{
ClanChannelMember member = clanChannel.findMember(cleanName);
if (member != null)
{
return member;
}
}
clanChannel = client.getGuestClanChannel();
if (clanChannel != null)
{
ClanChannelMember member = clanChannel.findMember(cleanName);
if (member != null)
{
return member;
}
}
NameableContainer<Friend> friendContainer = client.getFriendContainer();
if (friendContainer != null)
{

View File

@@ -990,6 +990,8 @@ R 49 193 51 194
// Braindeath Island
#8AD2DF
R 33 79 33 80
// Clan Hall
r 27 85
// Nightmare dungeon (Morytania underground)
#0a0a0a

View File

@@ -765,7 +765,7 @@ LABEL681:
jump LABEL726
LABEL685:
get_varc_string 359 ; Skip truncating of varcstr 22 by not calling 280
lowercase ; instead get the var directly and lowercase it
lowercase ; instead get the var directly and lowercase it
sstore 0
sload 0
string_length

View File

@@ -111,11 +111,11 @@
iload 19
iload 20
sconst "iiiIIIIIIIIIIIIIIIII"
cc_setonop
iload 0 ; button component id
iload 1 ; 0-9
cc_setonop
iload 0 ; button component id
iload 1 ; 0-9
sconst "bankpinButtonSetup"
runelite_callback
runelite_callback
pop_int ; 0-9
pop_int ; button component id
return

View File

@@ -208,19 +208,19 @@ LABEL165:
iconst 126
istore 20
iconst 0
3801
activeclansettings_find_affined
iconst 1
if_icmpeq LABEL202
jump LABEL222
LABEL202:
iconst 0
3851
activeclanchannel_find_affined
iconst 1
if_icmpeq LABEL207
jump LABEL222
LABEL207:
sload 0
3860
activeclanchannel_getuserslot
istore 17
iload 17
iconst -1
@@ -228,10 +228,10 @@ LABEL207:
jump LABEL217
LABEL214:
iload 17
3857
activeclanchannel_getuserrank
istore 18
LABEL217:
3853
activeclanchannel_getrankkick
iconst 2956
invoke 4456
istore 20
@@ -288,6 +288,10 @@ LABEL245:
if_icmpeq LABEL256
jump LABEL1266
LABEL256:
iload 10 ; message uid
sconst "chatMessageBuilding"
runelite_callback
pop_int ; pop uid
iload 11
switch
1: LABEL259
@@ -312,14 +316,9 @@ LABEL256:
91: LABEL280
jump LABEL928
LABEL259:
iload 10 ; The id of the messageNode of the message being built
sconst ""
sconst "addTimestamp"
runelite_callback
pop_int ; pop message id
sload 12
sconst ":"
join_string 3 ; + 1 for timestamp
join_string 2
sload 1
sload 14
sconst "</col>"
@@ -339,14 +338,9 @@ LABEL259:
istore 7
jump LABEL942
LABEL280:
iload 10 ; The id of the messageNode of the message being built
sconst ""
sconst "addTimestamp"
runelite_callback
pop_int ; pop message id
sload 12
sconst ":"
join_string 3 ; + 1 for timestamp
join_string 2
sload 3
sload 14
sconst "</col>"
@@ -366,17 +360,12 @@ LABEL280:
istore 7
jump LABEL942
LABEL301:
iload 10 ; The id of the messageNode of the message being built
sconst ""
sconst "addTimestamp"
runelite_callback
pop_int ; pop message id
sconst "From "
sload 12
sconst ":"
sconst "privateChatFrom"
runelite_callback ; for prepending color tags
join_string 4 ; + 1 for timestamp
join_string 3
sconst "privChatUsername"
runelite_callback
sload 2
sload 14
sconst "</col>"
@@ -396,15 +385,10 @@ LABEL301:
istore 7
jump LABEL942
LABEL323:
iload 10 ; The id of the messageNode of the message being built
sconst ""
sconst "addTimestamp"
runelite_callback
pop_int ; pop message id
sload 9
sload 14
sconst "</col>"
join_string 4 ; + 1 for timestamp
join_string 3
iload 8
iload 9
iconst 10616888
@@ -420,15 +404,10 @@ LABEL323:
istore 7
jump LABEL942
LABEL341:
iload 10 ; The id of the messageNode of the message being built
sconst ""
sconst "addTimestamp"
runelite_callback
pop_int ; pop message id
sload 2
sload 14
sconst "</col>"
join_string 4 ; + 1 for timestamp
join_string 3
iload 8
iload 9
iconst 10616888
@@ -461,17 +440,12 @@ LABEL362:
LABEL373:
jump LABEL942
LABEL374:
iload 10 ; The id of the messageNode of the message being built
sconst ""
sconst "addTimestamp"
runelite_callback
pop_int ; pop message id
sconst "To "
sload 12
sconst ":"
sconst "privateChatTo"
runelite_callback ; for chat recolors
join_string 4 ; + 1 for timestamp
join_string 3
sconst "privChatUsername"
runelite_callback
sload 2
sload 14
sconst "</col>"
@@ -529,11 +503,6 @@ LABEL414:
istore 7
jump LABEL942
LABEL432:
iload 10 ; The id of the messageNode of the message being built
sconst ""
sconst "addTimestamp"
runelite_callback
pop_int ; pop message id
sconst "["
sload 5
sload 13
@@ -541,7 +510,7 @@ LABEL432:
sconst "] "
sload 12
sconst ":"
join_string 8 ; + 1 for time stamp
join_string 7
sload 6
sload 14
sconst "</col>"
@@ -562,20 +531,20 @@ LABEL432:
jump LABEL942
LABEL458:
iconst 0
3801
activeclansettings_find_affined
iconst 1
if_icmpeq LABEL463
jump LABEL583
LABEL463:
iconst 0
3851
activeclanchannel_find_affined
iconst 1
if_icmpeq LABEL468
jump LABEL583
LABEL468:
sload 12
removetags
3860
activeclanchannel_getuserslot
istore 17
iload 17
iconst -1
@@ -583,7 +552,7 @@ LABEL468:
jump LABEL549
LABEL476:
iload 17
3857
activeclanchannel_getuserrank
invoke 4302
istore 16
sstore 16
@@ -623,17 +592,12 @@ LABEL485:
istore 7
jump LABEL548
LABEL515:
iload 10 ; The id of the messageNode of the message being built
sconst ""
sconst "addTimestamp"
runelite_callback
pop_int ; pop message id
sconst "["
sload 7
sload 13
sconst "</col>"
sconst "]"
join_string 6 ; + 1 for timestamp
join_string 5
iconst -1
iconst 0
iconst 0
@@ -732,19 +696,19 @@ LABEL583:
LABEL612:
jump LABEL942
LABEL613:
3800
activeclansettings_find_listened
iconst 1
if_icmpeq LABEL617
jump LABEL736
LABEL617:
3850
activeclanchannel_find_listened
iconst 1
if_icmpeq LABEL621
jump LABEL736
LABEL621:
sload 12
removetags
3860
activeclanchannel_getuserslot
istore 17
iload 17
iconst -1
@@ -752,7 +716,7 @@ LABEL621:
jump LABEL702
LABEL629:
iload 17
3857
activeclanchannel_getuserrank
invoke 4302
istore 16
sstore 16
@@ -897,14 +861,14 @@ LABEL765:
jump LABEL942
LABEL766:
iconst 0
3851
activeclanchannel_find_affined
iconst 1
if_icmpeq LABEL771
jump LABEL796
LABEL771:
sconst "["
sload 7
3852
activeclanchannel_getclanname
sconst "</col>"
sconst "]"
join_string 5
@@ -950,14 +914,14 @@ LABEL796:
LABEL815:
jump LABEL942
LABEL816:
3850
activeclanchannel_find_listened
iconst 1
if_icmpeq LABEL820
jump LABEL845
LABEL820:
sconst "["
sload 7
3852
activeclanchannel_getclanname
sconst "</col>"
sconst "]"
join_string 5
@@ -1003,13 +967,7 @@ LABEL845:
LABEL864:
jump LABEL942
LABEL865:
iload 10 ; The id of the messageNode of the message being built
sconst ""
sconst "addTimestamp"
runelite_callback
pop_int ; pop message id
sload 14
join_string 2
invoke 2066
istore 13
sstore 15
@@ -1077,13 +1035,7 @@ LABEL913:
LABEL927:
jump LABEL942
LABEL928:
iload 10 ; The id of the messageNode of the message being built
sconst ""
sconst "addTimestamp"
runelite_callback
pop_int ; pop message id
sload 14
join_string 2 ; prepend the timestamp
iload 8
iload 9
iconst 10616888
@@ -1207,20 +1159,20 @@ LABEL1017:
jump LABEL1050
LABEL1021:
iconst 0
3851
activeclanchannel_find_affined
iconst 1
if_icmpeq LABEL1026
jump LABEL1050
LABEL1026:
sload 12
removetags
3860
activeclanchannel_getuserslot
istore 17
iload 17
iconst -1
if_icmpeq LABEL1038
iload 17
3857
activeclanchannel_getuserrank
iconst -1
if_icmple LABEL1038
jump LABEL1050

View File

@@ -400,6 +400,10 @@ CHAT_FILTER:
if_icmpeq LABEL356 ; Check if we are building this message
jump LABEL530
LABEL356:
iload 12 ; message uid
sconst "chatMessageBuilding"
runelite_callback
pop_int
iload 17
switch
3: LABEL359
@@ -409,19 +413,14 @@ LABEL356:
jump LABEL446
LABEL359:
iload 7
iload 12 ; Load the id of the messageNode
sconst "" ; Push a container for the timestamp
sconst "addTimestamp" ; Push event name
runelite_callback ; Invoke callback
pop_int ; Pop the id of the messageNode
sload 4
sconst "splitPrivChatUsernameColor"
runelite_callback
sconst "From "
sload 1
sconst ":"
sconst "privateChatSplitFrom"
runelite_callback
sconst "</col>"
join_string 6 ; Add the timestamp to the message
join_string 5
sload 4
sload 0
sconst "</col>"
@@ -443,19 +442,14 @@ LABEL359:
jump LABEL462
LABEL385:
iload 7
iload 12 ; Load the id of the messageNode
sconst "" ; Push container for the timestamp
sconst "addTimestamp" ; Push event name
runelite_callback ; Invoke callback
pop_int ; Pop the id of the messageNode
sload 4
sconst "splitPrivChatUsernameColor"
runelite_callback
sconst "To "
sload 1
sconst ":"
sconst "privateChatSplitTo"
runelite_callback
sconst "</col>"
join_string 6 ; Add the timestamp to the message
join_string 5
sload 4
sload 0
sconst "</col>"
@@ -477,15 +471,10 @@ LABEL385:
jump LABEL462
LABEL411:
iload 7
iload 12 ; Load the id of the messageNode
sconst "" ; Push a container for the timestamp
sconst "addTimestamp" ; Push event name
runelite_callback ; Invoke callback
pop_int ; Pop the id of the messageNode
sload 4 ; Load the log in/out message
sload 4
sload 0
sconst "</col>"
join_string 4
join_string 3
iload 9
iload 10
iconst 10682368

View File

@@ -10,9 +10,9 @@
pop_int ; pop chat type
string_length ; get string length of chat message
iconst 0 ; load 0
if_icmpne LABEL100 ; if length is not 0, continue
if_icmpne CONTINUE ; if length is not 0, continue
return
LABEL100:
CONTINUE:
get_varbit 4394
iconst 1
if_icmpeq LABEL4
@@ -53,7 +53,7 @@ LABEL31:
sload 0
iload 0
iconst 0
5010
chat_sendclan
jump LABEL39
LABEL36:
sload 0

View File

@@ -270,17 +270,27 @@ LABEL222:
istore 5
istore 6
LABEL226:
iload 6 ; prefix length
iload 5 ; chat type
sconst "preChatSendpublic"
runelite_callback
istore 5 ; chat type
istore 6 ; prefix length
get_varc_string 335 ; load input string
string_length ; get length
iconst 0 ; load 0
if_icmpeq LABEL420 ; if (%varcstring355 == 0) jump to script223 call
iload 5
iconst 44
if_icmpeq LABEL230
jump LABEL260
LABEL230:
3800
activeclansettings_find_listened
iconst 1
if_icmpeq LABEL234
jump LABEL257
LABEL234:
3850
activeclanchannel_find_listened
iconst 1
if_icmpeq LABEL238
jump LABEL257
@@ -292,7 +302,7 @@ LABEL238:
LABEL242:
return
LABEL243:
3803
activeclansettings_getallowunaffined
iconst 1
if_icmpeq LABEL247
jump LABEL254
@@ -321,7 +331,7 @@ LABEL260:
jump LABEL307
LABEL264:
iconst 0
3851
activeclanchannel_find_affined
iconst 1
if_icmpeq LABEL269
jump LABEL304
@@ -340,7 +350,7 @@ LABEL277:
LABEL278:
chat_playername
removetags
3860
activeclanchannel_getuserslot
istore 7
iload 7
iconst -1
@@ -348,8 +358,8 @@ LABEL278:
jump LABEL298
LABEL286:
iload 7
3857
3854
activeclanchannel_getuserrank
activeclanchannel_getranktalk
if_icmpge LABEL291
jump LABEL298
LABEL291:

View File

@@ -35,7 +35,7 @@ LABEL24:
iload 3
sconst "destroyOnOpKey" ; load event name
runelite_callback ; invoke callback
pop_int
pop_int
iconst 2266
iconst 1
iconst 0

View File

@@ -3,10 +3,10 @@
.string_stack_count 0
.int_var_count 16
.string_var_count 2
; callback "friend_cc_settext"
; callback "friendsChatSetText"
; Fired just before the client pops the name off the stack
; Modified by the friendnotes plugin to show the icon
; callback "friend_cc_setposition"
; callback "friendsChatSetPosition"
; Fired just before the client sets the position of "friend changed their name" icon
; Modified by the friendnotes plugin to offset the name changed icon
iload 1
@@ -300,7 +300,7 @@ LABEL234:
add
istore 10
sload 0
sconst "friend_cc_settext"
sconst "friendsChatSetText"
runelite_callback
cc_settext
iconst 0
@@ -382,7 +382,7 @@ LABEL293:
add
iconst 0
iconst 0
sconst "friend_cc_setposition"
sconst "friendsChatSetPosition"
runelite_callback
cc_setposition 1
iconst 1093

View File

@@ -10,6 +10,7 @@
iconst 1
if_icmpeq LABEL4
jump CONFIRM_KICK ; Jump to our new label instead
jump LABEL7
LABEL4:
sconst "You can't kick players from your team during Wilderness Wars."
mes
@@ -20,8 +21,7 @@ LABEL7:
invoke 96
sload 0
clan_kickuser
jump LABEL73
LABEL73:
RETURN:
return
CONFIRM_KICK:
sload 0 ; Username we are trying to kick
@@ -30,5 +30,5 @@ CONFIRM_KICK:
runelite_callback
pop_string ; Pop username
iconst 0 ; Compare against zero
if_icmpgt LABEL73 ; Early return for chatbox panel confirmation
if_icmpgt RETURN ; Early return for chatbox panel confirmation
jump LABEL7

View File

@@ -7,13 +7,13 @@
invoke 41
get_varbit 4439
iconst 1
sub
sub
istore 7
iconst 105
iconst 118
iconst 150
iload 7
enum
enum
istore 8
iload 8
iconst -1
@@ -22,19 +22,19 @@
LABEL16:
iconst 1
iload 2
if_sethide
if_sethide
iconst 0
iload 3
if_sethide
if_sethide
iconst 1
iload 4
if_sethide
if_sethide
iconst 1
iload 5
if_sethide
if_sethide
iload 0
iload 1
cc_find
cc_find
iconst 1
if_icmpeq LABEL34
jump LABEL36
@@ -42,16 +42,16 @@ LABEL34:
sconst "Grand Exchange"
sconst "setGETitle" ;
runelite_callback ;
cc_settext
cc_settext
LABEL36:
return
return
LABEL37:
iconst 0
iload 2
if_sethide
if_sethide
iconst 0
iload 2
if_settrans
if_settrans
iload 7
stockmarket_isofferempty
iconst 1
@@ -60,42 +60,42 @@ LABEL37:
LABEL48:
iconst 1
iload 3
if_sethide
if_sethide
iconst 1
iload 4
if_sethide
if_sethide
iconst 0
iload 5
if_sethide
if_sethide
iload 0
iload 1
cc_find
cc_find
iconst 1
if_icmpeq LABEL63
jump LABEL65
LABEL63:
sconst "Grand Exchange: Set up offer"
cc_settext
cc_settext
LABEL65:
return
return
LABEL66:
iconst 1
iload 3
if_sethide
if_sethide
iconst 0
iload 4
if_sethide
if_sethide
iconst 1
iload 5
if_sethide
if_sethide
iload 0
iload 1
cc_find
cc_find
iconst 1
if_icmpeq LABEL81
jump LABEL83
LABEL81:
sconst "Grand Exchange: Offer status"
cc_settext
cc_settext
LABEL83:
return
return

View File

@@ -3,10 +3,10 @@
.string_stack_count 0
.int_var_count 13
.string_var_count 2
; callback "ignore_cc_settext"
; callback "friendsChatSetText"
; Fired just before the client pops the name off the stack
; Modified by the friendnotes plugin to show the icon
; callback "ignore_cc_setposition"
; callback "friendsChatSetPosition"
; Fired just before the client sets the position of "ignored person changed their name" icon
; Modified by the friendnotes plugin to offset the name changed icon
iload 1
@@ -157,7 +157,7 @@ LABEL117:
add
istore 8
sload 0
sconst "ignore_cc_settext"
sconst "friendsChatSetText"
runelite_callback
cc_settext
iconst 0
@@ -216,7 +216,7 @@ LABEL117:
add
iconst 0
iconst 0
sconst "ignore_cc_setposition"
sconst "friendsChatSetPosition"
runelite_callback
cc_setposition 1
iconst 1093

View File

@@ -43,7 +43,8 @@ LABEL9:
sconst "forceStackStones" ; push event name
runelite_callback ; invoke callback
iconst 0 ; if 0 is returned, continue normal layout
if_icmpeq LABEL49
if_icmpne LABEL29
jump LABEL49
LABEL29:
iconst 0
iload 3

View File

@@ -5,7 +5,7 @@
.string_var_count 0
iconst 896
sconst "innerZoomLimit"
runelite_callback
runelite_callback
iconst 128
sconst "outerZoomLimit"
runelite_callback
@@ -13,7 +13,7 @@
istore 5
iconst 896
sconst "innerZoomLimit"
runelite_callback
runelite_callback
iconst 128
sconst "outerZoomLimit"
runelite_callback
@@ -40,7 +40,7 @@ LABEL25:
get_varc_int 74
iconst 128
sconst "outerZoomLimit"
runelite_callback
runelite_callback
sub
iload 7
multiply
@@ -52,7 +52,7 @@ LABEL34:
get_varc_int 73
iconst 128
sconst "outerZoomLimit"
runelite_callback
runelite_callback
sub
iload 7
multiply

View File

@@ -1 +0,0 @@
FDFF71BAC7D5E10C1E88F445D60100552D0C5B14A66F8648FFEC39573ECFBE8E

View File

@@ -1,269 +0,0 @@
.id 299
.int_stack_count 2
.string_stack_count 0
.int_var_count 3
.string_var_count 0
sconst "resetChatboxInput"
runelite_callback
iconst 1
iconst 10616869
if_sethide
iconst 0
iconst 10616885
if_sethide
invoke 923
iconst 0
istore 2
iload 1
iconst 1
if_icmpeq LABEL13
jump LABEL27
LABEL13:
invoke 553
istore 2
iload 2
invoke 84
iload 2
invoke 89
invoke 223
iconst 1
invoke 927
invoke 1972
iconst 1
if_icmpeq LABEL26
jump LABEL27
LABEL26:
invoke 1984
LABEL27:
invoke 1972
iconst 1
if_icmpeq LABEL31
jump LABEL32
LABEL31:
invoke 2581
LABEL32:
get_varc_int 5
switch
19: LABEL35
20: LABEL41
21: LABEL41
7: LABEL35
8: LABEL38
9: LABEL41
15: LABEL41
jump LABEL43
LABEL35:
sconst "0"
resume_countdialog
jump LABEL43
LABEL38:
sconst ""
resume_namedialog
jump LABEL43
LABEL41:
sconst ""
resume_stringdialog
LABEL43:
iconst 0
set_varc_int 5
iload 0
iconst 1
if_icmpeq LABEL49
jump LABEL51
LABEL49:
sconst ""
set_varc_string 359
LABEL51:
iconst 0
iconst -8
iconst 1
iconst 1
iconst 10616873
if_setposition
iconst 0
iconst 40
iconst 1
iconst 0
iconst 10616873
if_setsize
iconst 0
iconst 22
iconst 1
iconst 1
iconst 10616874
if_setposition
iconst 0
iconst 20
iconst 1
iconst 0
iconst 10616874
if_setsize
iconst 0
iconst 10616873
if_sethide
iconst 0
iconst 10616874
if_sethide
iconst 1
iconst 10616878
if_sethide
iconst 1
iconst 10616884
if_sethide
iconst 0
iconst 0
iconst 10616882
if_setscrollpos
iconst 10616882
cc_deleteall
iconst 10616883
cc_deleteall
iconst 0
iconst -8
iconst 1
iconst 1
iconst 10616873
if_setposition
iconst 0
iconst 40
iconst 1
iconst 0
iconst 10616873
if_setsize
iconst 1
iconst 1
iconst 0
iconst 10616873
if_settextalign
iconst 496
iconst 10616873
if_settextfont
iconst 496
iconst 10616874
if_settextfont
iconst 128
iconst 10616874
if_setcolour
iconst -1
sconst ""
iconst 10616874
if_setonmouseover
iconst -1
sconst ""
iconst 10616874
if_setonmouseleave
sconst ""
iconst 10616874
if_settext
iconst 0
iconst 22
iconst 1
iconst 1
iconst 10616874
if_setposition
iconst -1
sconst ""
iconst 10616869
if_setonclick
iconst -1
sconst ""
iconst 10616874
if_setonclick
iconst -1
sconst ""
iconst 10616874
if_setonkey
iconst 1
iconst 10616871
if_sethide
iconst -1
sconst ""
iconst 10616869
if_setonclick
iconst -1
sconst ""
iconst 10616869
if_setontimer
iconst 10616869
cc_deleteall
iconst 10616875
cc_deleteall
iconst 10616876
cc_deleteall
iconst 10616877
cc_deleteall
iconst 1
iconst 10616875
if_sethide
iconst 1
iconst 10616876
if_sethide
iconst 1
iconst 10616877
if_sethide
iconst -1
sconst ""
iconst 10616875
if_setonmouserepeat
iconst -1
sconst ""
iconst 10616876
if_setonmouserepeat
iconst -1
sconst ""
iconst 10616877
if_setonmouserepeat
iconst -1
sconst ""
iconst 10616875
if_setonmouseleave
iconst -1
sconst ""
iconst 10616876
if_setonmouseleave
iconst -1
sconst ""
iconst 10616877
if_setonmouseleave
iconst -1
sconst ""
iconst 10616875
if_setontimer
iconst -1
sconst ""
iconst 10616876
if_setontimer
iconst -1
sconst ""
iconst 10616877
if_setontimer
iconst -1
sconst ""
iconst 10616875
if_setonclick
iconst -1
sconst ""
iconst 10616876
if_setonclick
iconst -1
sconst ""
iconst 10616877
if_setonclick
get_varc_int 41
iconst 1337
if_icmpeq LABEL230
jump LABEL234
LABEL230:
invoke 2526
pop_int
clientclock
set_varc_int 384
LABEL234:
invoke 1972
iconst 1
if_icmpeq LABEL238
jump LABEL239
LABEL238:
invoke 2581
LABEL239:
return

View File

@@ -11,8 +11,8 @@
iconst 0
iload 0
iconst 25
sconst "scrollWheelZoomIncrement"
runelite_callback
sconst "scrollWheelZoomIncrement"
runelite_callback
multiply
sub
istore 1

View File

@@ -21,6 +21,7 @@
sconst "skillTabBaseLevel" ; push event name
runelite_callback ; invoke callback
istore 4 ; store the (possibly) edited real skill level
pop_int ; pop the skill id we pushed
iload 4
tostring
cc_settext 1

View File

@@ -212,7 +212,7 @@ LABEL177:
if_setnoclickthrough
iconst 1
iconst 10616867
2006
if_setnoscrollthrough
LABEL183:
iconst 0
istore 4

View File

@@ -18,13 +18,13 @@ LABEL10:
return
LABEL11:
; switch on op index
iload 0
switch
iload 0
switch
1: LOOK_NORTH
2: LOOK_SOUTH
3: LOOK_EAST
4: LOOK_WEST
jump LABEL10
jump LABEL10
LOOK_NORTH:
iconst 0
istore 1
@@ -48,10 +48,10 @@ LOOK:
sound_synth
iconst 225
sconst "lookPreservePitch"
runelite_callback
runelite_callback
iconst 5
randominc
add
add
iload 1 ; load target angle
cam_forceangle
cam_forceangle
return

View File

@@ -9,12 +9,12 @@
iconst 0 ; load active boolean
sconst "getSearchingTagTab" ; push event name
runelite_callback ; invoke callback
if_icmpne LABEL2
if_icmpne RELAYOUT
; Let layout continue if current bank tab is 0
get_varbit 4150
iconst 0
if_icmpeq LABEL2
if_icmpeq RELAYOUT
; Reset the current bank tab to 0 otherwise
iconst 0
@@ -24,7 +24,7 @@
sconst "debug"
runelite_callback
LABEL2:
RELAYOUT:
iload 0
iload 1
iload 2