Rename clan chat to friends chat
This commit is contained in:
@@ -69,11 +69,11 @@ public enum ChatMessageType
|
|||||||
*/
|
*/
|
||||||
MODPRIVATECHAT(7),
|
MODPRIVATECHAT(7),
|
||||||
/**
|
/**
|
||||||
* A message received in clan chat.
|
* A message received in friends chat.
|
||||||
*/
|
*/
|
||||||
FRIENDSCHAT(9),
|
FRIENDSCHAT(9),
|
||||||
/**
|
/**
|
||||||
* A message received with information about the current clan chat.
|
* A message received with information about the current friends chat.
|
||||||
*/
|
*/
|
||||||
FRIENDSCHATNOTIFICATION(11),
|
FRIENDSCHATNOTIFICATION(11),
|
||||||
/**
|
/**
|
||||||
@@ -133,7 +133,7 @@ public enum ChatMessageType
|
|||||||
*/
|
*/
|
||||||
CHALREQ_TRADE(103),
|
CHALREQ_TRADE(103),
|
||||||
/**
|
/**
|
||||||
* A message received when someone sends a clan challenge offer.
|
* A message received when someone sends a friends chat challenge offer.
|
||||||
*/
|
*/
|
||||||
CHALREQ_FRIENDSCHAT(104),
|
CHALREQ_FRIENDSCHAT(104),
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1152,12 +1152,12 @@ public interface Client extends GameEngine
|
|||||||
boolean isFriended(String name, boolean mustBeLoggedIn);
|
boolean isFriended(String name, boolean mustBeLoggedIn);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieve the clan member manager
|
* Retrieve the friends chat manager
|
||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Nullable
|
@Nullable
|
||||||
ClanMemberManager getClanMemberManager();
|
FriendsChatManager getFriendsChatManager();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieve the nameable container containing friends
|
* Retrieve the nameable container containing friends
|
||||||
@@ -1466,11 +1466,11 @@ public interface Client extends GameEngine
|
|||||||
void setFriendsHidden(boolean state);
|
void setFriendsHidden(boolean state);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets whether or not clan mates are hidden.
|
* Sets whether or not friends chat members are hidden.
|
||||||
*
|
*
|
||||||
* @param state the new clan mates hidden state
|
* @param state the new friends chat member hidden state
|
||||||
*/
|
*/
|
||||||
void setClanMatesHidden(boolean state);
|
void setFriendsChatMembersHidden(boolean state);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets whether the local player is hidden.
|
* Sets whether the local player is hidden.
|
||||||
|
|||||||
@@ -24,19 +24,19 @@
|
|||||||
*/
|
*/
|
||||||
package net.runelite.api;
|
package net.runelite.api;
|
||||||
|
|
||||||
public interface ClanMemberManager extends NameableContainer<ClanMember>
|
public interface FriendsChatManager extends NameableContainer<FriendsChatMember>
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Gets the clan owner of the currently joined clan chat
|
* Gets the owner of the currently joined friends chat
|
||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
String getClanOwner();
|
String getOwner();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the clan chat name of the currently joined clan chat
|
* Gets the name of the currently joined friends chat
|
||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
String getClanChatName();
|
String getName();
|
||||||
}
|
}
|
||||||
@@ -25,9 +25,9 @@
|
|||||||
package net.runelite.api;
|
package net.runelite.api;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents a clan member.
|
* Represents a friends chat member.
|
||||||
*/
|
*/
|
||||||
public interface ClanMember extends ChatPlayer
|
public interface FriendsChatMember extends ChatPlayer
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Gets the world the member is in.
|
* Gets the world the member is in.
|
||||||
@@ -37,9 +37,9 @@ public interface ClanMember extends ChatPlayer
|
|||||||
int getWorld();
|
int getWorld();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the rank of the clan member.
|
* Gets the rank of the friends chat member.
|
||||||
*
|
*
|
||||||
* @return the rank
|
* @return the rank
|
||||||
*/
|
*/
|
||||||
ClanMemberRank getRank();
|
FriendsChatRank getRank();
|
||||||
}
|
}
|
||||||
@@ -30,14 +30,14 @@ import lombok.AllArgsConstructor;
|
|||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An enumeration of ranks of clan members.
|
* An enumeration of ranks of friends chat members.
|
||||||
*/
|
*/
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@Getter
|
@Getter
|
||||||
public enum ClanMemberRank
|
public enum FriendsChatRank
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Not in a clan.
|
* Not ranked.
|
||||||
*/
|
*/
|
||||||
UNRANKED(-1),
|
UNRANKED(-1),
|
||||||
/**
|
/**
|
||||||
@@ -77,30 +77,30 @@ public enum ClanMemberRank
|
|||||||
*/
|
*/
|
||||||
JMOD(127);
|
JMOD(127);
|
||||||
|
|
||||||
private static final Map<Integer, ClanMemberRank> RANKS = new HashMap<>();
|
private static final Map<Integer, FriendsChatRank> RANKS = new HashMap<>();
|
||||||
|
|
||||||
static
|
static
|
||||||
{
|
{
|
||||||
for (final ClanMemberRank clanMemberRank : ClanMemberRank.values())
|
for (final FriendsChatRank friendsChatRank : FriendsChatRank.values())
|
||||||
{
|
{
|
||||||
RANKS.put(clanMemberRank.value, clanMemberRank);
|
RANKS.put(friendsChatRank.value, friendsChatRank);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Utility method that maps the rank value to its respective
|
* Utility method that maps the rank value to its respective
|
||||||
* {@link ClanMemberRank} value.
|
* {@link FriendsChatRank} value.
|
||||||
*
|
*
|
||||||
* @param rank the rank value
|
* @param rank the rank value
|
||||||
* @return rank type
|
* @return rank type
|
||||||
*/
|
*/
|
||||||
public static ClanMemberRank valueOf(int rank)
|
public static FriendsChatRank valueOf(int rank)
|
||||||
{
|
{
|
||||||
return RANKS.get(rank);
|
return RANKS.get(rank);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The value of the clan rank.
|
* The value of the rank.
|
||||||
*/
|
*/
|
||||||
private final int value;
|
private final int value;
|
||||||
}
|
}
|
||||||
@@ -58,7 +58,7 @@ public interface MessageNode extends Node
|
|||||||
void setName(String name);
|
void setName(String name);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the sender of the message (ie. clan name).
|
* Gets the sender of the message (ie. friends chat name).
|
||||||
*
|
*
|
||||||
* @return the message sender
|
* @return the message sender
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -57,12 +57,12 @@ public interface Player extends Actor
|
|||||||
int getTeam();
|
int getTeam();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks whether this player is a member of the same clan as
|
* Checks whether this player is a member of the same friends chat
|
||||||
* the local player.
|
* the local player.
|
||||||
*
|
*
|
||||||
* @return true if the player is a clan member, false otherwise
|
* @return true if the player is a friends chat member, false otherwise
|
||||||
*/
|
*/
|
||||||
boolean isClanMember();
|
boolean isFriendsChatMember();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks whether this player is a friend of the local player.
|
* Checks whether this player is a friend of the local player.
|
||||||
|
|||||||
@@ -196,13 +196,13 @@ public final class ScriptID
|
|||||||
public static final int XPDROP_DISABLED = 2091;
|
public static final int XPDROP_DISABLED = 2091;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Attempts to kick the specified player from the Clan Chat
|
* Attempts to kick the specified player from the friends chat
|
||||||
* <ul>
|
* <ul>
|
||||||
* <li>String Players in-game name</li>
|
* <li>String Players in-game name</li>
|
||||||
* </ul>
|
* </ul>
|
||||||
*/
|
*/
|
||||||
@ScriptArguments(string = 1)
|
@ScriptArguments(string = 1)
|
||||||
public static final int CLAN_SEND_KICK = 215;
|
public static final int FRIENDS_CHAT_SEND_KICK = 215;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Builds the items kept on death widget
|
* Builds the items kept on death widget
|
||||||
@@ -211,10 +211,10 @@ public final class ScriptID
|
|||||||
public static final int DEATH_KEEP_BUILD = 1601;
|
public static final int DEATH_KEEP_BUILD = 1601;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Builds the widget that holds all of the players inside a clan chat
|
* Builds the widget that holds all of the players inside a friends chat
|
||||||
*/
|
*/
|
||||||
@ScriptArguments(integer = 15)
|
@ScriptArguments(integer = 15)
|
||||||
public static final int CLAN_CHAT_CHANNEL_BUILD = 1658;
|
public static final int FRIENDS_CHAT_CHANNEL_REBUILD = 1658;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Builds the widget for making an offer in Grand Exchange
|
* Builds the widget for making an offer in Grand Exchange
|
||||||
|
|||||||
@@ -776,7 +776,7 @@ public final class SpriteID
|
|||||||
public static final int RS2_TAB_EQUIPMENT = 778;
|
public static final int RS2_TAB_EQUIPMENT = 778;
|
||||||
public static final int RS2_TAB_PRAYER = 779;
|
public static final int RS2_TAB_PRAYER = 779;
|
||||||
public static final int TAB_MAGIC = 780;
|
public static final int TAB_MAGIC = 780;
|
||||||
public static final int RS2_TAB_CLAN_CHAT = 781;
|
public static final int RS2_TAB_FRIENDS_CHAT = 781;
|
||||||
public static final int TAB_FRIENDS = 782;
|
public static final int TAB_FRIENDS = 782;
|
||||||
public static final int TAB_IGNORES = 783;
|
public static final int TAB_IGNORES = 783;
|
||||||
public static final int RS2_TAB_LOGOUT = 784;
|
public static final int RS2_TAB_LOGOUT = 784;
|
||||||
@@ -888,7 +888,7 @@ public final class SpriteID
|
|||||||
public static final int TAB_EQUIPMENT = 901;
|
public static final int TAB_EQUIPMENT = 901;
|
||||||
public static final int TAB_PRAYER = 902;
|
public static final int TAB_PRAYER = 902;
|
||||||
public static final int UNUSED_TAB_MAGIC_903 = 903;
|
public static final int UNUSED_TAB_MAGIC_903 = 903;
|
||||||
public static final int TAB_CLAN_CHAT = 904;
|
public static final int TAB_FRIENDS_CHAT = 904;
|
||||||
public static final int TAB_LOGOUT = 907;
|
public static final int TAB_LOGOUT = 907;
|
||||||
public static final int TAB_OPTIONS = 908;
|
public static final int TAB_OPTIONS = 908;
|
||||||
public static final int TAB_EMOTES = 909;
|
public static final int TAB_EMOTES = 909;
|
||||||
@@ -977,15 +977,15 @@ public final class SpriteID
|
|||||||
public static final int STASH_UNITS_SLANTED_TAB_EDGE_LEFT_HOVERED = 1001;
|
public static final int STASH_UNITS_SLANTED_TAB_EDGE_LEFT_HOVERED = 1001;
|
||||||
public static final int STASH_UNITS_SLANTED_TAB_MIDDLE_HOVERED = 1002;
|
public static final int STASH_UNITS_SLANTED_TAB_MIDDLE_HOVERED = 1002;
|
||||||
public static final int STASH_UNITS_SLANTED_TAB_EDGE_RIGHT_HOVERED = 1003;
|
public static final int STASH_UNITS_SLANTED_TAB_EDGE_RIGHT_HOVERED = 1003;
|
||||||
public static final int CLAN_CHAT_RANK_SMILEY_FRIEND = 1004;
|
public static final int FRIENDS_CHAT_RANK_SMILEY_FRIEND = 1004;
|
||||||
public static final int CLAN_CHAT_RANK_CROWN_JAGEX_MODERATOR = 1005;
|
public static final int FRIENDS_CHAT_RANK_CROWN_JAGEX_MODERATOR = 1005;
|
||||||
public static final int CLAN_CHAT_RANK_KEY_CHANNEL_OWNER = 1006;
|
public static final int FRIENDS_CHAT_RANK_KEY_CHANNEL_OWNER = 1006;
|
||||||
public static final int CLAN_CHAT_RANK_GOLD_STAR_GENERAL = 1007;
|
public static final int FRIENDS_CHAT_RANK_GOLD_STAR_GENERAL = 1007;
|
||||||
public static final int CLAN_CHAT_RANK_SILVER_STAR_CAPTAIN = 1008;
|
public static final int FRIENDS_CHAT_RANK_SILVER_STAR_CAPTAIN = 1008;
|
||||||
public static final int CLAN_CHAT_RANK_BRONZE_STAR_LIEUTENANT = 1009;
|
public static final int FRIENDS_CHAT_RANK_BRONZE_STAR_LIEUTENANT = 1009;
|
||||||
public static final int CLAN_CHAT_RANK_TRIPLE_CHEVRON_SERGEANT = 1010;
|
public static final int FRIENDS_CHAT_RANK_TRIPLE_CHEVRON_SERGEANT = 1010;
|
||||||
public static final int CLAN_CHAT_RANK_DOUBLE_CHEVRON_CORPORAL = 1011;
|
public static final int FRIENDS_CHAT_RANK_DOUBLE_CHEVRON_CORPORAL = 1011;
|
||||||
public static final int CLAN_CHAT_RANK_SINGLE_CHEVRON_RECRUIT = 1012;
|
public static final int FRIENDS_CHAT_RANK_SINGLE_CHEVRON_RECRUIT = 1012;
|
||||||
public static final int UNKNOWN_BUTTON_METAL_CORNERS = 1013;
|
public static final int UNKNOWN_BUTTON_METAL_CORNERS = 1013;
|
||||||
public static final int UNKNOWN_BUTTON_METAL_CORNERS_HOVERED = 1014;
|
public static final int UNKNOWN_BUTTON_METAL_CORNERS_HOVERED = 1014;
|
||||||
public static final int UNKNOWN_SLANTED_TAB_LONG = 1015;
|
public static final int UNKNOWN_SLANTED_TAB_LONG = 1015;
|
||||||
@@ -1017,7 +1017,7 @@ public final class SpriteID
|
|||||||
public static final int BANK_DEPOSIT_INVENTORY = 1041;
|
public static final int BANK_DEPOSIT_INVENTORY = 1041;
|
||||||
public static final int BANK_DEPOSIT_EQUIPMENT = 1042;
|
public static final int BANK_DEPOSIT_EQUIPMENT = 1042;
|
||||||
public static final int BANK_SEARCH = 1043;
|
public static final int BANK_SEARCH = 1043;
|
||||||
public static final int MINIMAP_MARKER_PURPLE_PLAYER_CLAN_CHAT = 1044;
|
public static final int MINIMAP_MARKER_PURPLE_PLAYER_FRIENDS_CHAT = 1044;
|
||||||
public static final int OPTIONS_PROFANITY_FILTER = 1045;
|
public static final int OPTIONS_PROFANITY_FILTER = 1045;
|
||||||
public static final int PLAYER_KILLER_SKULL_1046 = 1046;
|
public static final int PLAYER_KILLER_SKULL_1046 = 1046;
|
||||||
public static final int PLAYER_KILLING_DISABLED_OVERLAY = 1047;
|
public static final int PLAYER_KILLING_DISABLED_OVERLAY = 1047;
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ public enum VarClientStr
|
|||||||
CHATBOX_TYPED_TEXT(335),
|
CHATBOX_TYPED_TEXT(335),
|
||||||
INPUT_TEXT(359),
|
INPUT_TEXT(359),
|
||||||
PRIVATE_MESSAGE_TARGET(360),
|
PRIVATE_MESSAGE_TARGET(360),
|
||||||
RECENT_CLAN_CHAT(362);
|
RECENT_FRIENDS_CHAT(362);
|
||||||
|
|
||||||
private final int index;
|
private final int index;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,11 +57,11 @@ public enum VarPlayer
|
|||||||
/**
|
/**
|
||||||
* The ID of the party. This Var is only set in the raid bank area and the raid lobby
|
* The ID of the party. This Var is only set in the raid bank area and the raid lobby
|
||||||
*
|
*
|
||||||
* This gets set to -1 when the raid starts. This is first set when the first player of the clan forms a party
|
* This gets set to -1 when the raid starts. This is first set when the first player of the friends chat forms a party
|
||||||
* on the recruiting board and it changes again when the first person actually enters the raid.
|
* on the recruiting board and it changes again when the first person actually enters the raid.
|
||||||
*
|
*
|
||||||
* -1 : Not in a party or in the middle of an ongoing raid
|
* -1 : Not in a party or in the middle of an ongoing raid
|
||||||
* Anything else : This means that your clan has a raid party being formed and has not started yet
|
* Anything else : This means that your friends chat has a raid party being formed and has not started yet
|
||||||
*/
|
*/
|
||||||
IN_RAID_PARTY(1427),
|
IN_RAID_PARTY(1427),
|
||||||
|
|
||||||
|
|||||||
@@ -62,8 +62,8 @@ public class ChatMessage
|
|||||||
/**
|
/**
|
||||||
* The sender of the message.
|
* The sender of the message.
|
||||||
* <p>
|
* <p>
|
||||||
* This field is only used for clan messages and refers to the
|
* This field is only used for friends chat messages and refers to the
|
||||||
* current name of the clan chat the client is in.
|
* current name of the friends chat the client is in.
|
||||||
*/
|
*/
|
||||||
private String sender;
|
private String sender;
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -27,13 +27,13 @@ package net.runelite.api.events;
|
|||||||
import lombok.Value;
|
import lombok.Value;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An event where the client has joined or left a clan chat.
|
* An event where the client has joined or left a friends chat.
|
||||||
*/
|
*/
|
||||||
@Value
|
@Value
|
||||||
public class ClanChanged
|
public class FriendsChatChanged
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Whether or not the client is now in a clan chat.
|
* Whether or not the client is now in a friends chat.
|
||||||
*/
|
*/
|
||||||
private boolean joined;
|
private boolean joined;
|
||||||
}
|
}
|
||||||
@@ -25,13 +25,13 @@
|
|||||||
package net.runelite.api.events;
|
package net.runelite.api.events;
|
||||||
|
|
||||||
import lombok.Value;
|
import lombok.Value;
|
||||||
import net.runelite.api.ClanMember;
|
import net.runelite.api.FriendsChatMember;
|
||||||
|
|
||||||
@Value
|
@Value
|
||||||
public class ClanMemberJoined
|
public class FriendsChatMemberJoined
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* The ClanMember that joined
|
* The member that joined
|
||||||
*/
|
*/
|
||||||
private ClanMember member;
|
private FriendsChatMember member;
|
||||||
}
|
}
|
||||||
@@ -25,13 +25,13 @@
|
|||||||
package net.runelite.api.events;
|
package net.runelite.api.events;
|
||||||
|
|
||||||
import lombok.Value;
|
import lombok.Value;
|
||||||
import net.runelite.api.ClanMember;
|
import net.runelite.api.FriendsChatMember;
|
||||||
|
|
||||||
@Value
|
@Value
|
||||||
public class ClanMemberLeft
|
public class FriendsChatMemberLeft
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* The ClanMember that left
|
* The member that left
|
||||||
*/
|
*/
|
||||||
private ClanMember member;
|
private FriendsChatMember member;
|
||||||
}
|
}
|
||||||
@@ -57,7 +57,7 @@ public class WidgetID
|
|||||||
public static final int ACHIEVEMENT_DIARY_GROUP_ID = 259;
|
public static final int ACHIEVEMENT_DIARY_GROUP_ID = 259;
|
||||||
public static final int PEST_CONTROL_BOAT_GROUP_ID = 407;
|
public static final int PEST_CONTROL_BOAT_GROUP_ID = 407;
|
||||||
public static final int PEST_CONTROL_GROUP_ID = 408;
|
public static final int PEST_CONTROL_GROUP_ID = 408;
|
||||||
public static final int CLAN_CHAT_GROUP_ID = 7;
|
public static final int FRIENDS_CHAT_GROUP_ID = 7;
|
||||||
public static final int MINIMAP_GROUP_ID = 160;
|
public static final int MINIMAP_GROUP_ID = 160;
|
||||||
public static final int LOGIN_CLICK_TO_PLAY_GROUP_ID = 378;
|
public static final int LOGIN_CLICK_TO_PLAY_GROUP_ID = 378;
|
||||||
public static final int CLUE_SCROLL_GROUP_ID = 203;
|
public static final int CLUE_SCROLL_GROUP_ID = 203;
|
||||||
@@ -239,7 +239,7 @@ public class WidgetID
|
|||||||
static final int PREVIOUS_NAME_HOLDER = 16;
|
static final int PREVIOUS_NAME_HOLDER = 16;
|
||||||
}
|
}
|
||||||
|
|
||||||
static class ClanChat
|
static class FriendsChat
|
||||||
{
|
{
|
||||||
static final int TITLE = 1;
|
static final int TITLE = 1;
|
||||||
static final int NAME = 4;
|
static final int NAME = 4;
|
||||||
@@ -361,14 +361,14 @@ public class WidgetID
|
|||||||
{
|
{
|
||||||
static final int MINIMAP = 3;
|
static final int MINIMAP = 3;
|
||||||
static final int MINIMAP_DRAW_AREA = 8;
|
static final int MINIMAP_DRAW_AREA = 8;
|
||||||
static final int CLAN_CHAT_TAB = 33;
|
static final int FRIENDS_CHAT_TAB = 33;
|
||||||
static final int FRIENDS_TAB = 35;
|
static final int FRIENDS_TAB = 35;
|
||||||
static final int IGNORES_TAB = 34;
|
static final int IGNORES_TAB = 34;
|
||||||
static final int LOGOUT_TAB = 36;
|
static final int LOGOUT_TAB = 36;
|
||||||
static final int OPTIONS_TAB = 37;
|
static final int OPTIONS_TAB = 37;
|
||||||
static final int EMOTES_TAB = 38;
|
static final int EMOTES_TAB = 38;
|
||||||
static final int MUSIC_TAB = 39;
|
static final int MUSIC_TAB = 39;
|
||||||
static final int CLAN_CHAT_ICON = 40;
|
static final int FRIENDS_CHAT_ICON = 40;
|
||||||
static final int FRIENDS_ICON = 42;
|
static final int FRIENDS_ICON = 42;
|
||||||
static final int IGNORES_ICON = 41;
|
static final int IGNORES_ICON = 41;
|
||||||
static final int LOGOUT_ICON = 43;
|
static final int LOGOUT_ICON = 43;
|
||||||
@@ -397,14 +397,14 @@ public class WidgetID
|
|||||||
|
|
||||||
static class ResizableViewport
|
static class ResizableViewport
|
||||||
{
|
{
|
||||||
static final int CLAN_CHAT_TAB = 37;
|
static final int FRIENDS_CHAT_TAB = 37;
|
||||||
static final int FRIENDS_TAB = 39;
|
static final int FRIENDS_TAB = 39;
|
||||||
static final int IGNORES_TAB = 38;
|
static final int IGNORES_TAB = 38;
|
||||||
static final int LOGOUT_TAB = 40;
|
static final int LOGOUT_TAB = 40;
|
||||||
static final int OPTIONS_TAB = 41;
|
static final int OPTIONS_TAB = 41;
|
||||||
static final int EMOTES_TAB = 42;
|
static final int EMOTES_TAB = 42;
|
||||||
static final int MUSIC_TAB = 43;
|
static final int MUSIC_TAB = 43;
|
||||||
static final int CLAN_CHAT_ICON = 44;
|
static final int FRIENDS_CHAT_ICON = 44;
|
||||||
static final int FRIENDS_ICON = 46;
|
static final int FRIENDS_ICON = 46;
|
||||||
static final int IGNORES_ICON = 45;
|
static final int IGNORES_ICON = 45;
|
||||||
static final int LOGOUT_ICON = 47;
|
static final int LOGOUT_ICON = 47;
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ public enum WidgetInfo
|
|||||||
INVENTORY(WidgetID.INVENTORY_GROUP_ID, 0),
|
INVENTORY(WidgetID.INVENTORY_GROUP_ID, 0),
|
||||||
FRIENDS_LIST(WidgetID.FRIENDS_LIST_GROUP_ID, 0),
|
FRIENDS_LIST(WidgetID.FRIENDS_LIST_GROUP_ID, 0),
|
||||||
IGNORE_LIST(WidgetID.IGNORE_LIST_GROUP_ID, 0),
|
IGNORE_LIST(WidgetID.IGNORE_LIST_GROUP_ID, 0),
|
||||||
CLAN_CHAT(WidgetID.CLAN_CHAT_GROUP_ID, 0),
|
FRIENDS_CHAT(WidgetID.FRIENDS_CHAT_GROUP_ID, 0),
|
||||||
RAIDING_PARTY(WidgetID.RAIDING_PARTY_GROUP_ID, 0),
|
RAIDING_PARTY(WidgetID.RAIDING_PARTY_GROUP_ID, 0),
|
||||||
|
|
||||||
WORLD_MAP_VIEW(WidgetID.WORLD_MAP_GROUP_ID, WidgetID.WorldMap.MAPVIEW),
|
WORLD_MAP_VIEW(WidgetID.WORLD_MAP_GROUP_ID, WidgetID.WorldMap.MAPVIEW),
|
||||||
@@ -125,10 +125,10 @@ public enum WidgetInfo
|
|||||||
|
|
||||||
EXPLORERS_RING_ALCH_INVENTORY(WidgetID.EXPLORERS_RING_ALCH_GROUP_ID, WidgetID.ExplorersRing.INVENTORY),
|
EXPLORERS_RING_ALCH_INVENTORY(WidgetID.EXPLORERS_RING_ALCH_GROUP_ID, WidgetID.ExplorersRing.INVENTORY),
|
||||||
|
|
||||||
CLAN_CHAT_TITLE(WidgetID.CLAN_CHAT_GROUP_ID, WidgetID.ClanChat.TITLE),
|
FRIENDS_CHAT_TITLE(WidgetID.FRIENDS_CHAT_GROUP_ID, WidgetID.FriendsChat.TITLE),
|
||||||
CLAN_CHAT_NAME(WidgetID.CLAN_CHAT_GROUP_ID, WidgetID.ClanChat.NAME),
|
FRIENDS_CHAT_NAME(WidgetID.FRIENDS_CHAT_GROUP_ID, WidgetID.FriendsChat.NAME),
|
||||||
CLAN_CHAT_OWNER(WidgetID.CLAN_CHAT_GROUP_ID, WidgetID.ClanChat.OWNER),
|
FRIENDS_CHAT_OWNER(WidgetID.FRIENDS_CHAT_GROUP_ID, WidgetID.FriendsChat.OWNER),
|
||||||
CLAN_CHAT_LIST(WidgetID.CLAN_CHAT_GROUP_ID, WidgetID.ClanChat.LIST),
|
FRIENDS_CHAT_LIST(WidgetID.FRIENDS_CHAT_GROUP_ID, WidgetID.FriendsChat.LIST),
|
||||||
|
|
||||||
BANK_CONTAINER(WidgetID.BANK_GROUP_ID, WidgetID.Bank.BANK_CONTAINER),
|
BANK_CONTAINER(WidgetID.BANK_GROUP_ID, WidgetID.Bank.BANK_CONTAINER),
|
||||||
BANK_SEARCH_BUTTON_BACKGROUND(WidgetID.BANK_GROUP_ID, WidgetID.Bank.SEARCH_BUTTON_BACKGROUND),
|
BANK_SEARCH_BUTTON_BACKGROUND(WidgetID.BANK_GROUP_ID, WidgetID.Bank.SEARCH_BUTTON_BACKGROUND),
|
||||||
@@ -198,7 +198,7 @@ public enum WidgetInfo
|
|||||||
FIXED_VIEWPORT_EQUIPMENT_TAB(WidgetID.FIXED_VIEWPORT_GROUP_ID, WidgetID.FixedViewport.EQUIPMENT_TAB),
|
FIXED_VIEWPORT_EQUIPMENT_TAB(WidgetID.FIXED_VIEWPORT_GROUP_ID, WidgetID.FixedViewport.EQUIPMENT_TAB),
|
||||||
FIXED_VIEWPORT_PRAYER_TAB(WidgetID.FIXED_VIEWPORT_GROUP_ID, WidgetID.FixedViewport.PRAYER_TAB),
|
FIXED_VIEWPORT_PRAYER_TAB(WidgetID.FIXED_VIEWPORT_GROUP_ID, WidgetID.FixedViewport.PRAYER_TAB),
|
||||||
FIXED_VIEWPORT_MAGIC_TAB(WidgetID.FIXED_VIEWPORT_GROUP_ID, WidgetID.FixedViewport.MAGIC_TAB),
|
FIXED_VIEWPORT_MAGIC_TAB(WidgetID.FIXED_VIEWPORT_GROUP_ID, WidgetID.FixedViewport.MAGIC_TAB),
|
||||||
FIXED_VIEWPORT_CLAN_CHAT_TAB(WidgetID.FIXED_VIEWPORT_GROUP_ID, WidgetID.FixedViewport.CLAN_CHAT_TAB),
|
FIXED_VIEWPORT_FRIENDS_CHAT_TAB(WidgetID.FIXED_VIEWPORT_GROUP_ID, WidgetID.FixedViewport.FRIENDS_CHAT_TAB),
|
||||||
FIXED_VIEWPORT_FRIENDS_TAB(WidgetID.FIXED_VIEWPORT_GROUP_ID, WidgetID.FixedViewport.FRIENDS_TAB),
|
FIXED_VIEWPORT_FRIENDS_TAB(WidgetID.FIXED_VIEWPORT_GROUP_ID, WidgetID.FixedViewport.FRIENDS_TAB),
|
||||||
FIXED_VIEWPORT_IGNORES_TAB(WidgetID.FIXED_VIEWPORT_GROUP_ID, WidgetID.FixedViewport.IGNORES_TAB),
|
FIXED_VIEWPORT_IGNORES_TAB(WidgetID.FIXED_VIEWPORT_GROUP_ID, WidgetID.FixedViewport.IGNORES_TAB),
|
||||||
FIXED_VIEWPORT_LOGOUT_TAB(WidgetID.FIXED_VIEWPORT_GROUP_ID, WidgetID.FixedViewport.LOGOUT_TAB),
|
FIXED_VIEWPORT_LOGOUT_TAB(WidgetID.FIXED_VIEWPORT_GROUP_ID, WidgetID.FixedViewport.LOGOUT_TAB),
|
||||||
@@ -212,7 +212,7 @@ public enum WidgetInfo
|
|||||||
FIXED_VIEWPORT_EQUIPMENT_ICON(WidgetID.FIXED_VIEWPORT_GROUP_ID, WidgetID.FixedViewport.EQUIPMENT_ICON),
|
FIXED_VIEWPORT_EQUIPMENT_ICON(WidgetID.FIXED_VIEWPORT_GROUP_ID, WidgetID.FixedViewport.EQUIPMENT_ICON),
|
||||||
FIXED_VIEWPORT_PRAYER_ICON(WidgetID.FIXED_VIEWPORT_GROUP_ID, WidgetID.FixedViewport.PRAYER_ICON),
|
FIXED_VIEWPORT_PRAYER_ICON(WidgetID.FIXED_VIEWPORT_GROUP_ID, WidgetID.FixedViewport.PRAYER_ICON),
|
||||||
FIXED_VIEWPORT_MAGIC_ICON(WidgetID.FIXED_VIEWPORT_GROUP_ID, WidgetID.FixedViewport.MAGIC_ICON),
|
FIXED_VIEWPORT_MAGIC_ICON(WidgetID.FIXED_VIEWPORT_GROUP_ID, WidgetID.FixedViewport.MAGIC_ICON),
|
||||||
FIXED_VIEWPORT_CLAN_CHAT_ICON(WidgetID.FIXED_VIEWPORT_GROUP_ID, WidgetID.FixedViewport.CLAN_CHAT_ICON),
|
FIXED_VIEWPORT_FRIENDS_CHAT_ICON(WidgetID.FIXED_VIEWPORT_GROUP_ID, WidgetID.FixedViewport.FRIENDS_CHAT_ICON),
|
||||||
FIXED_VIEWPORT_FRIENDS_ICON(WidgetID.FIXED_VIEWPORT_GROUP_ID, WidgetID.FixedViewport.FRIENDS_ICON),
|
FIXED_VIEWPORT_FRIENDS_ICON(WidgetID.FIXED_VIEWPORT_GROUP_ID, WidgetID.FixedViewport.FRIENDS_ICON),
|
||||||
FIXED_VIEWPORT_IGNORES_ICON(WidgetID.FIXED_VIEWPORT_GROUP_ID, WidgetID.FixedViewport.IGNORES_ICON),
|
FIXED_VIEWPORT_IGNORES_ICON(WidgetID.FIXED_VIEWPORT_GROUP_ID, WidgetID.FixedViewport.IGNORES_ICON),
|
||||||
FIXED_VIEWPORT_LOGOUT_ICON(WidgetID.FIXED_VIEWPORT_GROUP_ID, WidgetID.FixedViewport.LOGOUT_ICON),
|
FIXED_VIEWPORT_LOGOUT_ICON(WidgetID.FIXED_VIEWPORT_GROUP_ID, WidgetID.FixedViewport.LOGOUT_ICON),
|
||||||
@@ -243,7 +243,7 @@ public enum WidgetInfo
|
|||||||
RESIZABLE_VIEWPORT_EQUIPMENT_TAB(WidgetID.RESIZABLE_VIEWPORT_OLD_SCHOOL_BOX_GROUP_ID, WidgetID.ResizableViewport.EQUIPMENT_TAB),
|
RESIZABLE_VIEWPORT_EQUIPMENT_TAB(WidgetID.RESIZABLE_VIEWPORT_OLD_SCHOOL_BOX_GROUP_ID, WidgetID.ResizableViewport.EQUIPMENT_TAB),
|
||||||
RESIZABLE_VIEWPORT_PRAYER_TAB(WidgetID.RESIZABLE_VIEWPORT_OLD_SCHOOL_BOX_GROUP_ID, WidgetID.ResizableViewport.PRAYER_TAB),
|
RESIZABLE_VIEWPORT_PRAYER_TAB(WidgetID.RESIZABLE_VIEWPORT_OLD_SCHOOL_BOX_GROUP_ID, WidgetID.ResizableViewport.PRAYER_TAB),
|
||||||
RESIZABLE_VIEWPORT_MAGIC_TAB(WidgetID.RESIZABLE_VIEWPORT_OLD_SCHOOL_BOX_GROUP_ID, WidgetID.ResizableViewport.MAGIC_TAB),
|
RESIZABLE_VIEWPORT_MAGIC_TAB(WidgetID.RESIZABLE_VIEWPORT_OLD_SCHOOL_BOX_GROUP_ID, WidgetID.ResizableViewport.MAGIC_TAB),
|
||||||
RESIZABLE_VIEWPORT_CLAN_CHAT_TAB(WidgetID.RESIZABLE_VIEWPORT_OLD_SCHOOL_BOX_GROUP_ID, WidgetID.ResizableViewport.CLAN_CHAT_TAB),
|
RESIZABLE_VIEWPORT_FRIENDS_CHAT_TAB(WidgetID.RESIZABLE_VIEWPORT_OLD_SCHOOL_BOX_GROUP_ID, WidgetID.ResizableViewport.FRIENDS_CHAT_TAB),
|
||||||
RESIZABLE_VIEWPORT_FRIENDS_TAB(WidgetID.RESIZABLE_VIEWPORT_OLD_SCHOOL_BOX_GROUP_ID, WidgetID.ResizableViewport.FRIENDS_TAB),
|
RESIZABLE_VIEWPORT_FRIENDS_TAB(WidgetID.RESIZABLE_VIEWPORT_OLD_SCHOOL_BOX_GROUP_ID, WidgetID.ResizableViewport.FRIENDS_TAB),
|
||||||
RESIZABLE_VIEWPORT_IGNORES_TAB(WidgetID.RESIZABLE_VIEWPORT_OLD_SCHOOL_BOX_GROUP_ID, WidgetID.ResizableViewport.IGNORES_TAB),
|
RESIZABLE_VIEWPORT_IGNORES_TAB(WidgetID.RESIZABLE_VIEWPORT_OLD_SCHOOL_BOX_GROUP_ID, WidgetID.ResizableViewport.IGNORES_TAB),
|
||||||
RESIZABLE_VIEWPORT_LOGOUT_TAB(WidgetID.RESIZABLE_VIEWPORT_OLD_SCHOOL_BOX_GROUP_ID, WidgetID.ResizableViewport.LOGOUT_TAB),
|
RESIZABLE_VIEWPORT_LOGOUT_TAB(WidgetID.RESIZABLE_VIEWPORT_OLD_SCHOOL_BOX_GROUP_ID, WidgetID.ResizableViewport.LOGOUT_TAB),
|
||||||
@@ -257,7 +257,7 @@ public enum WidgetInfo
|
|||||||
RESIZABLE_VIEWPORT_EQUIPMENT_ICON(WidgetID.RESIZABLE_VIEWPORT_OLD_SCHOOL_BOX_GROUP_ID, WidgetID.ResizableViewport.EQUIPMENT_ICON),
|
RESIZABLE_VIEWPORT_EQUIPMENT_ICON(WidgetID.RESIZABLE_VIEWPORT_OLD_SCHOOL_BOX_GROUP_ID, WidgetID.ResizableViewport.EQUIPMENT_ICON),
|
||||||
RESIZABLE_VIEWPORT_PRAYER_ICON(WidgetID.RESIZABLE_VIEWPORT_OLD_SCHOOL_BOX_GROUP_ID, WidgetID.ResizableViewport.PRAYER_ICON),
|
RESIZABLE_VIEWPORT_PRAYER_ICON(WidgetID.RESIZABLE_VIEWPORT_OLD_SCHOOL_BOX_GROUP_ID, WidgetID.ResizableViewport.PRAYER_ICON),
|
||||||
RESIZABLE_VIEWPORT_MAGIC_ICON(WidgetID.RESIZABLE_VIEWPORT_OLD_SCHOOL_BOX_GROUP_ID, WidgetID.ResizableViewport.MAGIC_ICON),
|
RESIZABLE_VIEWPORT_MAGIC_ICON(WidgetID.RESIZABLE_VIEWPORT_OLD_SCHOOL_BOX_GROUP_ID, WidgetID.ResizableViewport.MAGIC_ICON),
|
||||||
RESIZABLE_VIEWPORT_CLAN_CHAT_ICON(WidgetID.RESIZABLE_VIEWPORT_OLD_SCHOOL_BOX_GROUP_ID, WidgetID.ResizableViewport.CLAN_CHAT_ICON),
|
RESIZABLE_VIEWPORT_FRIENDS_CHAT_ICON(WidgetID.RESIZABLE_VIEWPORT_OLD_SCHOOL_BOX_GROUP_ID, WidgetID.ResizableViewport.FRIENDS_CHAT_ICON),
|
||||||
RESIZABLE_VIEWPORT_FRIENDS_ICON(WidgetID.RESIZABLE_VIEWPORT_OLD_SCHOOL_BOX_GROUP_ID, WidgetID.ResizableViewport.FRIENDS_ICON),
|
RESIZABLE_VIEWPORT_FRIENDS_ICON(WidgetID.RESIZABLE_VIEWPORT_OLD_SCHOOL_BOX_GROUP_ID, WidgetID.ResizableViewport.FRIENDS_ICON),
|
||||||
RESIZABLE_VIEWPORT_IGNORES_ICON(WidgetID.RESIZABLE_VIEWPORT_OLD_SCHOOL_BOX_GROUP_ID, WidgetID.ResizableViewport.IGNORES_ICON),
|
RESIZABLE_VIEWPORT_IGNORES_ICON(WidgetID.RESIZABLE_VIEWPORT_OLD_SCHOOL_BOX_GROUP_ID, WidgetID.ResizableViewport.IGNORES_ICON),
|
||||||
RESIZABLE_VIEWPORT_LOGOUT_ICON(WidgetID.RESIZABLE_VIEWPORT_OLD_SCHOOL_BOX_GROUP_ID, WidgetID.ResizableViewport.LOGOUT_ICON),
|
RESIZABLE_VIEWPORT_LOGOUT_ICON(WidgetID.RESIZABLE_VIEWPORT_OLD_SCHOOL_BOX_GROUP_ID, WidgetID.ResizableViewport.LOGOUT_ICON),
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ import net.runelite.client.config.ConfigManager;
|
|||||||
import net.runelite.client.discord.DiscordService;
|
import net.runelite.client.discord.DiscordService;
|
||||||
import net.runelite.client.eventbus.EventBus;
|
import net.runelite.client.eventbus.EventBus;
|
||||||
import net.runelite.client.externalplugins.ExternalPluginManager;
|
import net.runelite.client.externalplugins.ExternalPluginManager;
|
||||||
import net.runelite.client.game.ClanManager;
|
import net.runelite.client.game.FriendChatManager;
|
||||||
import net.runelite.client.game.ItemManager;
|
import net.runelite.client.game.ItemManager;
|
||||||
import net.runelite.client.game.LootManager;
|
import net.runelite.client.game.LootManager;
|
||||||
import net.runelite.client.game.chatbox.ChatboxPanelManager;
|
import net.runelite.client.game.chatbox.ChatboxPanelManager;
|
||||||
@@ -137,7 +137,7 @@ public class RuneLite
|
|||||||
private Provider<OverlayRenderer> overlayRenderer;
|
private Provider<OverlayRenderer> overlayRenderer;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private Provider<ClanManager> clanManager;
|
private Provider<FriendChatManager> friendsChatManager;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private Provider<ChatMessageManager> chatMessageManager;
|
private Provider<ChatMessageManager> chatMessageManager;
|
||||||
@@ -347,7 +347,7 @@ public class RuneLite
|
|||||||
|
|
||||||
eventBus.register(partyService.get());
|
eventBus.register(partyService.get());
|
||||||
eventBus.register(overlayRenderer.get());
|
eventBus.register(overlayRenderer.get());
|
||||||
eventBus.register(clanManager.get());
|
eventBus.register(friendsChatManager.get());
|
||||||
eventBus.register(itemManager.get());
|
eventBus.register(itemManager.get());
|
||||||
eventBus.register(menuManager.get());
|
eventBus.register(menuManager.get());
|
||||||
eventBus.register(chatMessageManager.get());
|
eventBus.register(chatMessageManager.get());
|
||||||
|
|||||||
@@ -133,7 +133,7 @@ public class ChatCommandManager implements ChatboxInputListener
|
|||||||
String message = chatboxInput.getValue();
|
String message = chatboxInput.getValue();
|
||||||
if (message.startsWith("/"))
|
if (message.startsWith("/"))
|
||||||
{
|
{
|
||||||
message = message.substring(1); // clan chat input
|
message = message.substring(1); // friends chat input
|
||||||
}
|
}
|
||||||
|
|
||||||
String command = extractCommand(message);
|
String command = extractCommand(message);
|
||||||
|
|||||||
@@ -139,11 +139,11 @@ public class ChatMessageManager
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case FRIENDSCHAT:
|
case FRIENDSCHAT:
|
||||||
usernameColor = isChatboxTransparent ? chatColorConfig.transparentClanUsernames() : chatColorConfig.opaqueClanUsernames();
|
usernameColor = isChatboxTransparent ? chatColorConfig.transparentFriendsChatUsernames() : chatColorConfig.opaqueFriendsChatUsernames();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
senderColor = isChatboxTransparent ? chatColorConfig.transparentClanChannelName() : chatColorConfig.opaqueClanChannelName();
|
senderColor = isChatboxTransparent ? chatColorConfig.transparentFriendsChatChannelName() : chatColorConfig.opaqueFriendsChatChannelName();
|
||||||
|
|
||||||
if (usernameColor != null)
|
if (usernameColor != null)
|
||||||
{
|
{
|
||||||
@@ -218,7 +218,7 @@ public class ChatMessageManager
|
|||||||
case PRIVATECHAT:
|
case PRIVATECHAT:
|
||||||
return JagexColors.CHAT_PRIVATE_MESSAGE_TEXT_OPAQUE_BACKGROUND;
|
return JagexColors.CHAT_PRIVATE_MESSAGE_TEXT_OPAQUE_BACKGROUND;
|
||||||
case FRIENDSCHAT:
|
case FRIENDSCHAT:
|
||||||
return JagexColors.CHAT_CLAN_TEXT_OPAQUE_BACKGROUND;
|
return JagexColors.CHAT_FC_TEXT_OPAQUE_BACKGROUND;
|
||||||
case ITEM_EXAMINE:
|
case ITEM_EXAMINE:
|
||||||
case OBJECT_EXAMINE:
|
case OBJECT_EXAMINE:
|
||||||
case NPC_EXAMINE:
|
case NPC_EXAMINE:
|
||||||
@@ -238,7 +238,7 @@ public class ChatMessageManager
|
|||||||
case PRIVATECHAT:
|
case PRIVATECHAT:
|
||||||
return JagexColors.CHAT_PRIVATE_MESSAGE_TEXT_TRANSPARENT_BACKGROUND;
|
return JagexColors.CHAT_PRIVATE_MESSAGE_TEXT_TRANSPARENT_BACKGROUND;
|
||||||
case FRIENDSCHAT:
|
case FRIENDSCHAT:
|
||||||
return JagexColors.CHAT_CLAN_TEXT_TRANSPARENT_BACKGROUND;
|
return JagexColors.CHAT_FC_TEXT_TRANSPARENT_BACKGROUND;
|
||||||
case ITEM_EXAMINE:
|
case ITEM_EXAMINE:
|
||||||
case OBJECT_EXAMINE:
|
case OBJECT_EXAMINE:
|
||||||
case NPC_EXAMINE:
|
case NPC_EXAMINE:
|
||||||
@@ -311,24 +311,24 @@ public class ChatMessageManager
|
|||||||
cacheColor(new ChatColor(ChatColorType.HIGHLIGHT, chatColorConfig.opaquePrivateMessageReceivedHighlight(), false),
|
cacheColor(new ChatColor(ChatColorType.HIGHLIGHT, chatColorConfig.opaquePrivateMessageReceivedHighlight(), false),
|
||||||
ChatMessageType.MODPRIVATECHAT);
|
ChatMessageType.MODPRIVATECHAT);
|
||||||
}
|
}
|
||||||
if (chatColorConfig.opaqueClanChatInfo() != null)
|
if (chatColorConfig.opaqueFriendsChatInfo() != null)
|
||||||
{
|
{
|
||||||
cacheColor(new ChatColor(ChatColorType.NORMAL, chatColorConfig.opaqueClanChatInfo(), false),
|
cacheColor(new ChatColor(ChatColorType.NORMAL, chatColorConfig.opaqueFriendsChatInfo(), false),
|
||||||
ChatMessageType.FRIENDSCHATNOTIFICATION);
|
ChatMessageType.FRIENDSCHATNOTIFICATION);
|
||||||
}
|
}
|
||||||
if (chatColorConfig.opaqueClanChatInfoHighlight() != null)
|
if (chatColorConfig.opaqueFriendsChatInfoHighlight() != null)
|
||||||
{
|
{
|
||||||
cacheColor(new ChatColor(ChatColorType.HIGHLIGHT, chatColorConfig.opaqueClanChatInfoHighlight(), false),
|
cacheColor(new ChatColor(ChatColorType.HIGHLIGHT, chatColorConfig.opaqueFriendsChatInfoHighlight(), false),
|
||||||
ChatMessageType.FRIENDSCHATNOTIFICATION);
|
ChatMessageType.FRIENDSCHATNOTIFICATION);
|
||||||
}
|
}
|
||||||
if (chatColorConfig.opaqueClanChatMessage() != null)
|
if (chatColorConfig.opaqueFriendsChatMessage() != null)
|
||||||
{
|
{
|
||||||
cacheColor(new ChatColor(ChatColorType.NORMAL, chatColorConfig.opaqueClanChatMessage(), false),
|
cacheColor(new ChatColor(ChatColorType.NORMAL, chatColorConfig.opaqueFriendsChatMessage(), false),
|
||||||
ChatMessageType.FRIENDSCHAT);
|
ChatMessageType.FRIENDSCHAT);
|
||||||
}
|
}
|
||||||
if (chatColorConfig.opaqueClanChatMessageHighlight() != null)
|
if (chatColorConfig.opaqueFriendsChatMessageHighlight() != null)
|
||||||
{
|
{
|
||||||
cacheColor(new ChatColor(ChatColorType.HIGHLIGHT, chatColorConfig.opaqueClanChatMessageHighlight(), false),
|
cacheColor(new ChatColor(ChatColorType.HIGHLIGHT, chatColorConfig.opaqueFriendsChatMessageHighlight(), false),
|
||||||
ChatMessageType.FRIENDSCHAT);
|
ChatMessageType.FRIENDSCHAT);
|
||||||
}
|
}
|
||||||
if (chatColorConfig.opaqueAutochatMessage() != null)
|
if (chatColorConfig.opaqueAutochatMessage() != null)
|
||||||
@@ -444,24 +444,24 @@ public class ChatMessageManager
|
|||||||
cacheColor(new ChatColor(ChatColorType.HIGHLIGHT, chatColorConfig.transparentPrivateMessageReceivedHighlight(), true),
|
cacheColor(new ChatColor(ChatColorType.HIGHLIGHT, chatColorConfig.transparentPrivateMessageReceivedHighlight(), true),
|
||||||
ChatMessageType.MODPRIVATECHAT);
|
ChatMessageType.MODPRIVATECHAT);
|
||||||
}
|
}
|
||||||
if (chatColorConfig.transparentClanChatInfo() != null)
|
if (chatColorConfig.transparentFriendsChatInfo() != null)
|
||||||
{
|
{
|
||||||
cacheColor(new ChatColor(ChatColorType.NORMAL, chatColorConfig.transparentClanChatInfo(), true),
|
cacheColor(new ChatColor(ChatColorType.NORMAL, chatColorConfig.transparentFriendsChatInfo(), true),
|
||||||
ChatMessageType.FRIENDSCHATNOTIFICATION);
|
ChatMessageType.FRIENDSCHATNOTIFICATION);
|
||||||
}
|
}
|
||||||
if (chatColorConfig.transparentClanChatInfoHighlight() != null)
|
if (chatColorConfig.transparentFriendsChatInfoHighlight() != null)
|
||||||
{
|
{
|
||||||
cacheColor(new ChatColor(ChatColorType.HIGHLIGHT, chatColorConfig.transparentClanChatInfoHighlight(), true),
|
cacheColor(new ChatColor(ChatColorType.HIGHLIGHT, chatColorConfig.transparentFriendsChatInfoHighlight(), true),
|
||||||
ChatMessageType.FRIENDSCHATNOTIFICATION);
|
ChatMessageType.FRIENDSCHATNOTIFICATION);
|
||||||
}
|
}
|
||||||
if (chatColorConfig.transparentClanChatMessage() != null)
|
if (chatColorConfig.transparentFriendsChatMessage() != null)
|
||||||
{
|
{
|
||||||
cacheColor(new ChatColor(ChatColorType.NORMAL, chatColorConfig.transparentClanChatMessage(), true),
|
cacheColor(new ChatColor(ChatColorType.NORMAL, chatColorConfig.transparentFriendsChatMessage(), true),
|
||||||
ChatMessageType.FRIENDSCHAT);
|
ChatMessageType.FRIENDSCHAT);
|
||||||
}
|
}
|
||||||
if (chatColorConfig.transparentClanChatMessageHighlight() != null)
|
if (chatColorConfig.transparentFriendsChatMessageHighlight() != null)
|
||||||
{
|
{
|
||||||
cacheColor(new ChatColor(ChatColorType.HIGHLIGHT, chatColorConfig.transparentClanChatMessageHighlight(), true),
|
cacheColor(new ChatColor(ChatColorType.HIGHLIGHT, chatColorConfig.transparentFriendsChatMessageHighlight(), true),
|
||||||
ChatMessageType.FRIENDSCHAT);
|
ChatMessageType.FRIENDSCHAT);
|
||||||
}
|
}
|
||||||
if (chatColorConfig.transparentAutochatMessage() != null)
|
if (chatColorConfig.transparentAutochatMessage() != null)
|
||||||
|
|||||||
@@ -112,11 +112,11 @@ public interface ChatColorConfig extends Config
|
|||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
position = 7,
|
position = 7,
|
||||||
keyName = "opaqueClanChatInfo",
|
keyName = "opaqueClanChatInfo",
|
||||||
name = "Clan chat info",
|
name = "Friends chat info",
|
||||||
description = "Clan Chat Information (eg. when joining a channel)",
|
description = "Friends Chat Information (eg. when joining a channel)",
|
||||||
section = opaqueSection
|
section = opaqueSection
|
||||||
)
|
)
|
||||||
default Color opaqueClanChatInfo()
|
default Color opaqueFriendsChatInfo()
|
||||||
{
|
{
|
||||||
return JagexColors.CHAT_GAME_EXAMINE_TEXT_OPAQUE_BACKGROUND;
|
return JagexColors.CHAT_GAME_EXAMINE_TEXT_OPAQUE_BACKGROUND;
|
||||||
}
|
}
|
||||||
@@ -124,11 +124,11 @@ public interface ChatColorConfig extends Config
|
|||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
position = 8,
|
position = 8,
|
||||||
keyName = "opaqueClanChatInfoHighlight",
|
keyName = "opaqueClanChatInfoHighlight",
|
||||||
name = "Clan chat info highlight",
|
name = "Friends chat info highlight",
|
||||||
description = "Clan Chat Information highlight (used for the Raids plugin)",
|
description = "Friends Chat Information highlight (used for the Raids plugin)",
|
||||||
section = opaqueSection
|
section = opaqueSection
|
||||||
)
|
)
|
||||||
default Color opaqueClanChatInfoHighlight()
|
default Color opaqueFriendsChatInfoHighlight()
|
||||||
{
|
{
|
||||||
return Color.RED;
|
return Color.RED;
|
||||||
}
|
}
|
||||||
@@ -136,20 +136,20 @@ public interface ChatColorConfig extends Config
|
|||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
position = 9,
|
position = 9,
|
||||||
keyName = "opaqueClanChatMessage",
|
keyName = "opaqueClanChatMessage",
|
||||||
name = "Clan chat message",
|
name = "Friends chat message",
|
||||||
description = "Color of Clan Chat Messages",
|
description = "Color of Friends chat messages",
|
||||||
section = opaqueSection
|
section = opaqueSection
|
||||||
)
|
)
|
||||||
Color opaqueClanChatMessage();
|
Color opaqueFriendsChatMessage();
|
||||||
|
|
||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
position = 10,
|
position = 10,
|
||||||
keyName = "opaqueClanChatMessageHighlight",
|
keyName = "opaqueClanChatMessageHighlight",
|
||||||
name = "Clan chat message highlight",
|
name = "Friends chat message highlight",
|
||||||
description = "Color of highlights in Clan Chat Messages",
|
description = "Color of highlights in Friends Chat messages",
|
||||||
section = opaqueSection
|
section = opaqueSection
|
||||||
)
|
)
|
||||||
default Color opaqueClanChatMessageHighlight()
|
default Color opaqueFriendsChatMessageHighlight()
|
||||||
{
|
{
|
||||||
return Color.decode("#000000");
|
return Color.decode("#000000");
|
||||||
}
|
}
|
||||||
@@ -289,20 +289,20 @@ public interface ChatColorConfig extends Config
|
|||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
position = 25,
|
position = 25,
|
||||||
keyName = "opaqueClanChannelName",
|
keyName = "opaqueClanChannelName",
|
||||||
name = "Clan channel name",
|
name = "Friends chat channel name",
|
||||||
description = "Color of Clan Channel Name",
|
description = "Color of Friends chat channel name",
|
||||||
section = opaqueSection
|
section = opaqueSection
|
||||||
)
|
)
|
||||||
Color opaqueClanChannelName();
|
Color opaqueFriendsChatChannelName();
|
||||||
|
|
||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
position = 26,
|
position = 26,
|
||||||
keyName = "opaqueClanUsernames",
|
keyName = "opaqueClanUsernames",
|
||||||
name = "Clan usernames",
|
name = "Friends chat usernames",
|
||||||
description = "Color of Usernames in Clan Chat",
|
description = "Color of usernames in Friends chat",
|
||||||
section = opaqueSection
|
section = opaqueSection
|
||||||
)
|
)
|
||||||
Color opaqueClanUsernames();
|
Color opaqueFriendsChatUsernames();
|
||||||
|
|
||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
position = 27,
|
position = 27,
|
||||||
@@ -379,11 +379,11 @@ public interface ChatColorConfig extends Config
|
|||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
position = 57,
|
position = 57,
|
||||||
keyName = "transparentClanChatInfo",
|
keyName = "transparentClanChatInfo",
|
||||||
name = "Clan chat info (transparent)",
|
name = "Friends chat info (transparent)",
|
||||||
description = "Clan Chat Information (eg. when joining a channel) (transparent)",
|
description = "Friends chat information (eg. when joining a channel) (transparent)",
|
||||||
section = transparentSection
|
section = transparentSection
|
||||||
)
|
)
|
||||||
default Color transparentClanChatInfo()
|
default Color transparentFriendsChatInfo()
|
||||||
{
|
{
|
||||||
return JagexColors.CHAT_GAME_EXAMINE_TEXT_TRANSPARENT_BACKGROUND;
|
return JagexColors.CHAT_GAME_EXAMINE_TEXT_TRANSPARENT_BACKGROUND;
|
||||||
}
|
}
|
||||||
@@ -391,11 +391,11 @@ public interface ChatColorConfig extends Config
|
|||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
position = 58,
|
position = 58,
|
||||||
keyName = "transparentClanChatInfoHighlight",
|
keyName = "transparentClanChatInfoHighlight",
|
||||||
name = "Clan chat info highlight (transparent)",
|
name = "Friends chat info highlight (transparent)",
|
||||||
description = "Clan Chat Information highlight (used for the Raids plugin) (transparent)",
|
description = "Friends chat information highlight (used for the Raids plugin) (transparent)",
|
||||||
section = transparentSection
|
section = transparentSection
|
||||||
)
|
)
|
||||||
default Color transparentClanChatInfoHighlight()
|
default Color transparentFriendsChatInfoHighlight()
|
||||||
{
|
{
|
||||||
return Color.RED;
|
return Color.RED;
|
||||||
}
|
}
|
||||||
@@ -403,20 +403,20 @@ public interface ChatColorConfig extends Config
|
|||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
position = 59,
|
position = 59,
|
||||||
keyName = "transparentClanChatMessage",
|
keyName = "transparentClanChatMessage",
|
||||||
name = "Clan chat message (transparent)",
|
name = "Friends chat message (transparent)",
|
||||||
description = "Color of Clan Chat Messages (transparent)",
|
description = "Color of Friends chat messages (transparent)",
|
||||||
section = transparentSection
|
section = transparentSection
|
||||||
)
|
)
|
||||||
Color transparentClanChatMessage();
|
Color transparentFriendsChatMessage();
|
||||||
|
|
||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
position = 60,
|
position = 60,
|
||||||
keyName = "transparentClanChatMessageHighlight",
|
keyName = "transparentClanChatMessageHighlight",
|
||||||
name = "Clan chat message highlight (transparent)",
|
name = "Friends chat message highlight (transparent)",
|
||||||
description = "Color of highlights in Clan Chat Messages (transparent)",
|
description = "Color of highlights in Friends chat messages (transparent)",
|
||||||
section = transparentSection
|
section = transparentSection
|
||||||
)
|
)
|
||||||
default Color transparentClanChatMessageHighlight()
|
default Color transparentFriendsChatMessageHighlight()
|
||||||
{
|
{
|
||||||
return Color.decode("#FFFFFF");
|
return Color.decode("#FFFFFF");
|
||||||
}
|
}
|
||||||
@@ -556,20 +556,20 @@ public interface ChatColorConfig extends Config
|
|||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
position = 75,
|
position = 75,
|
||||||
keyName = "transparentClanChannelName",
|
keyName = "transparentClanChannelName",
|
||||||
name = "Clan channel name (transparent)",
|
name = "Friends chat channel name (transparent)",
|
||||||
description = "Color of Clan Channel Name (transparent)",
|
description = "Color of Friends chat channel name (transparent)",
|
||||||
section = transparentSection
|
section = transparentSection
|
||||||
)
|
)
|
||||||
Color transparentClanChannelName();
|
Color transparentFriendsChatChannelName();
|
||||||
|
|
||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
position = 76,
|
position = 76,
|
||||||
keyName = "transparentClanUsernames",
|
keyName = "transparentClanUsernames",
|
||||||
name = "Clan usernames (transparent)",
|
name = "Friends chat usernames (transparent)",
|
||||||
description = "Color of Usernames in Clan Chat (transparent)",
|
description = "Color of usernames in Friends chat (transparent)",
|
||||||
section = transparentSection
|
section = transparentSection
|
||||||
)
|
)
|
||||||
Color transparentClanUsernames();
|
Color transparentFriendsChatUsernames();
|
||||||
|
|
||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
position = 77,
|
position = 77,
|
||||||
|
|||||||
@@ -36,94 +36,94 @@ import javax.annotation.Nonnull;
|
|||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
import javax.inject.Singleton;
|
import javax.inject.Singleton;
|
||||||
import net.runelite.api.ClanMember;
|
import net.runelite.api.FriendsChatMember;
|
||||||
import net.runelite.api.ClanMemberManager;
|
import net.runelite.api.FriendsChatManager;
|
||||||
import net.runelite.api.ClanMemberRank;
|
import net.runelite.api.FriendsChatRank;
|
||||||
import net.runelite.api.Client;
|
import net.runelite.api.Client;
|
||||||
import net.runelite.api.GameState;
|
import net.runelite.api.GameState;
|
||||||
import net.runelite.api.IndexedSprite;
|
import net.runelite.api.IndexedSprite;
|
||||||
import net.runelite.api.SpriteID;
|
import net.runelite.api.SpriteID;
|
||||||
import net.runelite.api.events.ClanChanged;
|
import net.runelite.api.events.FriendsChatChanged;
|
||||||
import net.runelite.api.events.GameStateChanged;
|
import net.runelite.api.events.GameStateChanged;
|
||||||
import net.runelite.client.eventbus.Subscribe;
|
import net.runelite.client.eventbus.Subscribe;
|
||||||
import net.runelite.client.util.ImageUtil;
|
import net.runelite.client.util.ImageUtil;
|
||||||
import net.runelite.client.util.Text;
|
import net.runelite.client.util.Text;
|
||||||
|
|
||||||
@Singleton
|
@Singleton
|
||||||
public class ClanManager
|
public class FriendChatManager
|
||||||
{
|
{
|
||||||
private static final int[] CLANCHAT_IMAGES =
|
private static final int[] RANK_IMAGES =
|
||||||
{
|
{
|
||||||
SpriteID.CLAN_CHAT_RANK_SMILEY_FRIEND,
|
SpriteID.FRIENDS_CHAT_RANK_SMILEY_FRIEND,
|
||||||
SpriteID.CLAN_CHAT_RANK_SINGLE_CHEVRON_RECRUIT,
|
SpriteID.FRIENDS_CHAT_RANK_SINGLE_CHEVRON_RECRUIT,
|
||||||
SpriteID.CLAN_CHAT_RANK_DOUBLE_CHEVRON_CORPORAL,
|
SpriteID.FRIENDS_CHAT_RANK_DOUBLE_CHEVRON_CORPORAL,
|
||||||
SpriteID.CLAN_CHAT_RANK_TRIPLE_CHEVRON_SERGEANT,
|
SpriteID.FRIENDS_CHAT_RANK_TRIPLE_CHEVRON_SERGEANT,
|
||||||
SpriteID.CLAN_CHAT_RANK_BRONZE_STAR_LIEUTENANT,
|
SpriteID.FRIENDS_CHAT_RANK_BRONZE_STAR_LIEUTENANT,
|
||||||
SpriteID.CLAN_CHAT_RANK_SILVER_STAR_CAPTAIN,
|
SpriteID.FRIENDS_CHAT_RANK_SILVER_STAR_CAPTAIN,
|
||||||
SpriteID.CLAN_CHAT_RANK_GOLD_STAR_GENERAL,
|
SpriteID.FRIENDS_CHAT_RANK_GOLD_STAR_GENERAL,
|
||||||
SpriteID.CLAN_CHAT_RANK_KEY_CHANNEL_OWNER,
|
SpriteID.FRIENDS_CHAT_RANK_KEY_CHANNEL_OWNER,
|
||||||
SpriteID.CLAN_CHAT_RANK_CROWN_JAGEX_MODERATOR,
|
SpriteID.FRIENDS_CHAT_RANK_CROWN_JAGEX_MODERATOR,
|
||||||
};
|
};
|
||||||
private static final Dimension CLANCHAT_IMAGE_DIMENSION = new Dimension(11, 11);
|
private static final Dimension IMAGE_DIMENSION = new Dimension(11, 11);
|
||||||
private static final Color CLANCHAT_IMAGE_OUTLINE_COLOR = new Color(33, 33, 33);
|
private static final Color IMAGE_OUTLINE_COLOR = new Color(33, 33, 33);
|
||||||
|
|
||||||
private final Client client;
|
private final Client client;
|
||||||
private final SpriteManager spriteManager;
|
private final SpriteManager spriteManager;
|
||||||
private final BufferedImage[] clanChatImages = new BufferedImage[CLANCHAT_IMAGES.length];
|
private final BufferedImage[] rankImages = new BufferedImage[RANK_IMAGES.length];
|
||||||
|
|
||||||
private final LoadingCache<String, ClanMemberRank> clanRanksCache = CacheBuilder.newBuilder()
|
private final LoadingCache<String, FriendsChatRank> ranksCache = CacheBuilder.newBuilder()
|
||||||
.maximumSize(100)
|
.maximumSize(100)
|
||||||
.expireAfterWrite(1, TimeUnit.MINUTES)
|
.expireAfterWrite(1, TimeUnit.MINUTES)
|
||||||
.build(new CacheLoader<String, ClanMemberRank>()
|
.build(new CacheLoader<String, FriendsChatRank>()
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
public ClanMemberRank load(@Nonnull String key)
|
public FriendsChatRank load(@Nonnull String key)
|
||||||
{
|
{
|
||||||
final ClanMemberManager clanMemberManager = client.getClanMemberManager();
|
final FriendsChatManager friendsChatManager = client.getFriendsChatManager();
|
||||||
if (clanMemberManager == null)
|
if (friendsChatManager == null)
|
||||||
{
|
{
|
||||||
return ClanMemberRank.UNRANKED;
|
return FriendsChatRank.UNRANKED;
|
||||||
}
|
}
|
||||||
|
|
||||||
ClanMember clanMember = clanMemberManager.findByName(sanitize(key));
|
FriendsChatMember friendsChatMember = friendsChatManager.findByName(sanitize(key));
|
||||||
return clanMember != null ? clanMember.getRank() : ClanMemberRank.UNRANKED;
|
return friendsChatMember != null ? friendsChatMember.getRank() : FriendsChatRank.UNRANKED;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
private int offset;
|
private int offset;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private ClanManager(Client client, SpriteManager spriteManager)
|
private FriendChatManager(Client client, SpriteManager spriteManager)
|
||||||
{
|
{
|
||||||
this.client = client;
|
this.client = client;
|
||||||
this.spriteManager = spriteManager;
|
this.spriteManager = spriteManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isClanMember(String name)
|
public boolean isMember(String name)
|
||||||
{
|
{
|
||||||
ClanMemberManager clanMemberManager = client.getClanMemberManager();
|
FriendsChatManager friendsChatManager = client.getFriendsChatManager();
|
||||||
return clanMemberManager != null && clanMemberManager.findByName(name) != null;
|
return friendsChatManager != null && friendsChatManager.findByName(name) != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ClanMemberRank getRank(String playerName)
|
public FriendsChatRank getRank(String playerName)
|
||||||
{
|
{
|
||||||
return clanRanksCache.getUnchecked(playerName);
|
return ranksCache.getUnchecked(playerName);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
public BufferedImage getClanImage(final ClanMemberRank clanMemberRank)
|
public BufferedImage getRankImage(final FriendsChatRank friendsChatRank)
|
||||||
{
|
{
|
||||||
if (clanMemberRank == ClanMemberRank.UNRANKED)
|
if (friendsChatRank == FriendsChatRank.UNRANKED)
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return clanChatImages[clanMemberRank.ordinal() - 1];
|
return rankImages[friendsChatRank.ordinal() - 1];
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getIconNumber(final ClanMemberRank clanMemberRank)
|
public int getIconNumber(final FriendsChatRank friendsChatRank)
|
||||||
{
|
{
|
||||||
return offset + clanMemberRank.ordinal() - 1;
|
return offset + friendsChatRank.ordinal() - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Subscribe
|
@Subscribe
|
||||||
@@ -131,17 +131,17 @@ public class ClanManager
|
|||||||
{
|
{
|
||||||
if (gameStateChanged.getGameState() == GameState.LOGIN_SCREEN && offset == 0)
|
if (gameStateChanged.getGameState() == GameState.LOGIN_SCREEN && offset == 0)
|
||||||
{
|
{
|
||||||
loadClanChatIcons();
|
loadRankIcons();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Subscribe
|
@Subscribe
|
||||||
public void onClanChanged(ClanChanged clanChanged)
|
public void onFriendsChatChanged(FriendsChatChanged friendsChatChanged)
|
||||||
{
|
{
|
||||||
clanRanksCache.invalidateAll();
|
ranksCache.invalidateAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void loadClanChatIcons()
|
private void loadRankIcons()
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
IndexedSprite[] modIcons = client.getModIcons();
|
IndexedSprite[] modIcons = client.getModIcons();
|
||||||
@@ -151,21 +151,21 @@ public class ClanManager
|
|||||||
new BufferedImage(modIcons[0].getWidth(), modIcons[0].getHeight(), BufferedImage.TYPE_INT_ARGB),
|
new BufferedImage(modIcons[0].getWidth(), modIcons[0].getHeight(), BufferedImage.TYPE_INT_ARGB),
|
||||||
client);
|
client);
|
||||||
|
|
||||||
modIcons = Arrays.copyOf(modIcons, offset + CLANCHAT_IMAGES.length);
|
modIcons = Arrays.copyOf(modIcons, offset + RANK_IMAGES.length);
|
||||||
Arrays.fill(modIcons, offset, modIcons.length, blank);
|
Arrays.fill(modIcons, offset, modIcons.length, blank);
|
||||||
|
|
||||||
client.setModIcons(modIcons);
|
client.setModIcons(modIcons);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < CLANCHAT_IMAGES.length; i++)
|
for (int i = 0; i < RANK_IMAGES.length; i++)
|
||||||
{
|
{
|
||||||
final int fi = i;
|
final int fi = i;
|
||||||
|
|
||||||
spriteManager.getSpriteAsync(CLANCHAT_IMAGES[i], 0, sprite ->
|
spriteManager.getSpriteAsync(RANK_IMAGES[i], 0, sprite ->
|
||||||
{
|
{
|
||||||
IndexedSprite[] modIcons = client.getModIcons();
|
IndexedSprite[] modIcons = client.getModIcons();
|
||||||
clanChatImages[fi] = clanChatImageFromSprite(sprite);
|
rankImages[fi] = friendsChatImageFromSprite(sprite);
|
||||||
modIcons[offset + fi] = ImageUtil.getImageIndexedSprite(clanChatImages[fi], client);
|
modIcons[offset + fi] = ImageUtil.getImageIndexedSprite(rankImages[fi], client);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -176,9 +176,9 @@ public class ClanManager
|
|||||||
return cleaned.replace('\u00A0', ' ');
|
return cleaned.replace('\u00A0', ' ');
|
||||||
}
|
}
|
||||||
|
|
||||||
private static BufferedImage clanChatImageFromSprite(final BufferedImage clanSprite)
|
private static BufferedImage friendsChatImageFromSprite(final BufferedImage sprite)
|
||||||
{
|
{
|
||||||
final BufferedImage clanChatCanvas = ImageUtil.resizeCanvas(clanSprite, CLANCHAT_IMAGE_DIMENSION.width, CLANCHAT_IMAGE_DIMENSION.height);
|
final BufferedImage canvas = ImageUtil.resizeCanvas(sprite, IMAGE_DIMENSION.width, IMAGE_DIMENSION.height);
|
||||||
return ImageUtil.outlineImage(clanChatCanvas, CLANCHAT_IMAGE_OUTLINE_COLOR);
|
return ImageUtil.outlineImage(canvas, IMAGE_OUTLINE_COLOR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -89,11 +89,11 @@ public interface ChatFilterConfig extends Config
|
|||||||
|
|
||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
keyName = "filterClan",
|
keyName = "filterClan",
|
||||||
name = "Filter Clan Chat Members",
|
name = "Filter Friends Chat Members",
|
||||||
description = "Filter your clan chat members' messages",
|
description = "Filter your friends chat members' messages",
|
||||||
position = 6
|
position = 6
|
||||||
)
|
)
|
||||||
default boolean filterClan()
|
default boolean filterFriendsChat()
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ import net.runelite.api.events.ScriptCallbackEvent;
|
|||||||
import net.runelite.client.config.ConfigManager;
|
import net.runelite.client.config.ConfigManager;
|
||||||
import net.runelite.client.eventbus.Subscribe;
|
import net.runelite.client.eventbus.Subscribe;
|
||||||
import net.runelite.client.events.ConfigChanged;
|
import net.runelite.client.events.ConfigChanged;
|
||||||
import net.runelite.client.game.ClanManager;
|
import net.runelite.client.game.FriendChatManager;
|
||||||
import net.runelite.client.plugins.Plugin;
|
import net.runelite.client.plugins.Plugin;
|
||||||
import net.runelite.client.plugins.PluginDescriptor;
|
import net.runelite.client.plugins.PluginDescriptor;
|
||||||
import net.runelite.client.util.Text;
|
import net.runelite.client.util.Text;
|
||||||
@@ -118,7 +118,7 @@ public class ChatFilterPlugin extends Plugin
|
|||||||
private ChatFilterConfig config;
|
private ChatFilterConfig config;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private ClanManager clanManager;
|
private FriendChatManager friendChatManager;
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
ChatFilterConfig provideConfig(ConfigManager configManager)
|
ChatFilterConfig provideConfig(ConfigManager configManager)
|
||||||
@@ -262,7 +262,7 @@ public class ChatFilterPlugin extends Plugin
|
|||||||
boolean isMessageFromSelf = playerName.equals(client.getLocalPlayer().getName());
|
boolean isMessageFromSelf = playerName.equals(client.getLocalPlayer().getName());
|
||||||
return !isMessageFromSelf &&
|
return !isMessageFromSelf &&
|
||||||
(config.filterFriends() || !client.isFriended(playerName, false)) &&
|
(config.filterFriends() || !client.isFriended(playerName, false)) &&
|
||||||
(config.filterClan() || !clanManager.isClanMember(playerName));
|
(config.filterFriendsChat() || !friendChatManager.isMember(playerName));
|
||||||
}
|
}
|
||||||
|
|
||||||
String censorMessage(final String username, final String message)
|
String censorMessage(final String username, final String message)
|
||||||
|
|||||||
@@ -68,10 +68,10 @@ public interface EntityHiderConfig extends Config
|
|||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
position = 4,
|
position = 4,
|
||||||
keyName = "hideClanMates",
|
keyName = "hideClanMates",
|
||||||
name = "Hide Clan Mates",
|
name = "Hide Friends Chat members",
|
||||||
description = "Configures whether or not clan mates are hidden"
|
description = "Configures whether or not friends chat members are hidden"
|
||||||
)
|
)
|
||||||
default boolean hideClanMates()
|
default boolean hideFriendsChatMembers()
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ public class EntityHiderPlugin extends Plugin
|
|||||||
client.setPlayersHidden2D(config.hidePlayers2D());
|
client.setPlayersHidden2D(config.hidePlayers2D());
|
||||||
|
|
||||||
client.setFriendsHidden(config.hideFriends());
|
client.setFriendsHidden(config.hideFriends());
|
||||||
client.setClanMatesHidden(config.hideClanMates());
|
client.setFriendsChatMembersHidden(config.hideFriendsChatMembers());
|
||||||
|
|
||||||
client.setLocalPlayerHidden(config.hideLocalPlayer());
|
client.setLocalPlayerHidden(config.hideLocalPlayer());
|
||||||
client.setLocalPlayerHidden2D(config.hideLocalPlayer2D());
|
client.setLocalPlayerHidden2D(config.hideLocalPlayer2D());
|
||||||
@@ -111,7 +111,7 @@ public class EntityHiderPlugin extends Plugin
|
|||||||
client.setPlayersHidden2D(false);
|
client.setPlayersHidden2D(false);
|
||||||
|
|
||||||
client.setFriendsHidden(false);
|
client.setFriendsHidden(false);
|
||||||
client.setClanMatesHidden(false);
|
client.setFriendsChatMembersHidden(false);
|
||||||
|
|
||||||
client.setLocalPlayerHidden(false);
|
client.setLocalPlayerHidden(false);
|
||||||
client.setLocalPlayerHidden2D(false);
|
client.setLocalPlayerHidden2D(false);
|
||||||
|
|||||||
@@ -22,9 +22,9 @@
|
|||||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
package net.runelite.client.plugins.clanchat;
|
package net.runelite.client.plugins.friendschat;
|
||||||
|
|
||||||
enum ClanActivityType
|
enum ActivityType
|
||||||
{
|
{
|
||||||
JOINED,
|
JOINED,
|
||||||
LEFT
|
LEFT
|
||||||
@@ -22,24 +22,24 @@
|
|||||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
package net.runelite.client.plugins.clanchat;
|
package net.runelite.client.plugins.friendschat;
|
||||||
|
|
||||||
import java.awt.Color;
|
import java.awt.Color;
|
||||||
import net.runelite.api.ClanMemberRank;
|
import net.runelite.api.FriendsChatRank;
|
||||||
import net.runelite.client.config.Config;
|
import net.runelite.client.config.Config;
|
||||||
import net.runelite.client.config.ConfigGroup;
|
import net.runelite.client.config.ConfigGroup;
|
||||||
import net.runelite.client.config.ConfigItem;
|
import net.runelite.client.config.ConfigItem;
|
||||||
|
|
||||||
@ConfigGroup("clanchat")
|
@ConfigGroup("clanchat") // group name from the old plugin
|
||||||
public interface ClanChatConfig extends Config
|
public interface FriendsChatConfig extends Config
|
||||||
{
|
{
|
||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
keyName = "clanChatIcons",
|
keyName = "clanChatIcons",
|
||||||
name = "Clan Chat Icons",
|
name = "Chat Icons",
|
||||||
description = "Show clan chat icons next to clan members.",
|
description = "Show friends chat chat icons next to members.",
|
||||||
position = 1
|
position = 1
|
||||||
)
|
)
|
||||||
default boolean clanChatIcons()
|
default boolean chatIcons()
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -47,7 +47,7 @@ public interface ClanChatConfig extends Config
|
|||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
keyName = "recentChats",
|
keyName = "recentChats",
|
||||||
name = "Recent Chats",
|
name = "Recent Chats",
|
||||||
description = "Show recent clan chats.",
|
description = "Show recent friends chats.",
|
||||||
position = 2
|
position = 2
|
||||||
)
|
)
|
||||||
default boolean recentChats()
|
default boolean recentChats()
|
||||||
@@ -57,11 +57,11 @@ public interface ClanChatConfig extends Config
|
|||||||
|
|
||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
keyName = "clanCounter",
|
keyName = "clanCounter",
|
||||||
name = "Clan Members Counter",
|
name = "Members Counter",
|
||||||
description = "Show the amount of clan members near you.",
|
description = "Show the amount of friends chat members near you.",
|
||||||
position = 3
|
position = 3
|
||||||
)
|
)
|
||||||
default boolean showClanCounter()
|
default boolean showCounter()
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -101,15 +101,15 @@ public interface ClanChatConfig extends Config
|
|||||||
description = "Only show join/leave messages for members at or above this rank.",
|
description = "Only show join/leave messages for members at or above this rank.",
|
||||||
position = 5
|
position = 5
|
||||||
)
|
)
|
||||||
default ClanMemberRank joinLeaveRank()
|
default FriendsChatRank joinLeaveRank()
|
||||||
{
|
{
|
||||||
return ClanMemberRank.UNRANKED;
|
return FriendsChatRank.UNRANKED;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
keyName = "privateMessageIcons",
|
keyName = "privateMessageIcons",
|
||||||
name = "Private Message Icons",
|
name = "Private Message Icons",
|
||||||
description = "Add clan chat rank icons to private messages received from clan mates.",
|
description = "Add rank icons to private messages received from members.",
|
||||||
position = 6
|
position = 6
|
||||||
)
|
)
|
||||||
default boolean privateMessageIcons()
|
default boolean privateMessageIcons()
|
||||||
@@ -120,7 +120,7 @@ public interface ClanChatConfig extends Config
|
|||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
keyName = "publicChatIcons",
|
keyName = "publicChatIcons",
|
||||||
name = "Public Chat Icons",
|
name = "Public Chat Icons",
|
||||||
description = "Add clan chat rank icons to public chat messages from clan mates.",
|
description = "Add rank icons to public chat messages from members.",
|
||||||
position = 7
|
position = 7
|
||||||
)
|
)
|
||||||
default boolean publicChatIcons()
|
default boolean publicChatIcons()
|
||||||
@@ -130,11 +130,11 @@ public interface ClanChatConfig extends Config
|
|||||||
|
|
||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
keyName = "clanTabChat",
|
keyName = "clanTabChat",
|
||||||
name = "Clan Tab Chat",
|
name = "Tab Chat",
|
||||||
description = "Allows clan chat without prepending '/' to messages when on clan tab",
|
description = "Allows friends chat chat without prepending '/' to messages when on the friends chat tab",
|
||||||
position = 8
|
position = 8
|
||||||
)
|
)
|
||||||
default boolean clanTabChat()
|
default boolean friendsChatTabChat()
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -164,7 +164,7 @@ public interface ClanChatConfig extends Config
|
|||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
keyName = "showIgnoresColor",
|
keyName = "showIgnoresColor",
|
||||||
name = "Ignored color",
|
name = "Ignored color",
|
||||||
description = "Allows you to change the color of the ignored players in your clan chat",
|
description = "Allows you to change the color of the ignored players in your friends chat",
|
||||||
position = 11
|
position = 11
|
||||||
)
|
)
|
||||||
default Color showIgnoresColor()
|
default Color showIgnoresColor()
|
||||||
@@ -24,7 +24,7 @@
|
|||||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
package net.runelite.client.plugins.clanchat;
|
package net.runelite.client.plugins.friendschat;
|
||||||
|
|
||||||
import com.google.common.base.Strings;
|
import com.google.common.base.Strings;
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
@@ -42,9 +42,9 @@ import java.util.Map;
|
|||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
import net.runelite.api.ChatLineBuffer;
|
import net.runelite.api.ChatLineBuffer;
|
||||||
import net.runelite.api.ChatMessageType;
|
import net.runelite.api.ChatMessageType;
|
||||||
import net.runelite.api.ClanMember;
|
import net.runelite.api.FriendsChatMember;
|
||||||
import net.runelite.api.ClanMemberManager;
|
import net.runelite.api.FriendsChatManager;
|
||||||
import net.runelite.api.ClanMemberRank;
|
import net.runelite.api.FriendsChatRank;
|
||||||
import net.runelite.api.Client;
|
import net.runelite.api.Client;
|
||||||
import net.runelite.api.GameState;
|
import net.runelite.api.GameState;
|
||||||
import net.runelite.api.Ignore;
|
import net.runelite.api.Ignore;
|
||||||
@@ -56,9 +56,9 @@ import net.runelite.api.SpriteID;
|
|||||||
import net.runelite.api.VarClientStr;
|
import net.runelite.api.VarClientStr;
|
||||||
import net.runelite.api.Varbits;
|
import net.runelite.api.Varbits;
|
||||||
import net.runelite.api.events.ChatMessage;
|
import net.runelite.api.events.ChatMessage;
|
||||||
import net.runelite.api.events.ClanChanged;
|
import net.runelite.api.events.FriendsChatChanged;
|
||||||
import net.runelite.api.events.ClanMemberJoined;
|
import net.runelite.api.events.FriendsChatMemberJoined;
|
||||||
import net.runelite.api.events.ClanMemberLeft;
|
import net.runelite.api.events.FriendsChatMemberLeft;
|
||||||
import net.runelite.api.events.GameStateChanged;
|
import net.runelite.api.events.GameStateChanged;
|
||||||
import net.runelite.api.events.GameTick;
|
import net.runelite.api.events.GameTick;
|
||||||
import net.runelite.api.events.PlayerDespawned;
|
import net.runelite.api.events.PlayerDespawned;
|
||||||
@@ -74,28 +74,28 @@ import net.runelite.client.chat.ChatMessageBuilder;
|
|||||||
import net.runelite.client.config.ConfigManager;
|
import net.runelite.client.config.ConfigManager;
|
||||||
import net.runelite.client.eventbus.Subscribe;
|
import net.runelite.client.eventbus.Subscribe;
|
||||||
import net.runelite.client.events.ConfigChanged;
|
import net.runelite.client.events.ConfigChanged;
|
||||||
import net.runelite.client.game.ClanManager;
|
import net.runelite.client.game.FriendChatManager;
|
||||||
import net.runelite.client.game.SpriteManager;
|
import net.runelite.client.game.SpriteManager;
|
||||||
import net.runelite.client.game.chatbox.ChatboxPanelManager;
|
import net.runelite.client.game.chatbox.ChatboxPanelManager;
|
||||||
import net.runelite.client.plugins.Plugin;
|
import net.runelite.client.plugins.Plugin;
|
||||||
import net.runelite.client.plugins.PluginDescriptor;
|
import net.runelite.client.plugins.PluginDescriptor;
|
||||||
import static net.runelite.client.ui.JagexColors.CHAT_CLAN_NAME_OPAQUE_BACKGROUND;
|
import static net.runelite.client.ui.JagexColors.CHAT_FC_NAME_OPAQUE_BACKGROUND;
|
||||||
import static net.runelite.client.ui.JagexColors.CHAT_CLAN_NAME_TRANSPARENT_BACKGROUND;
|
import static net.runelite.client.ui.JagexColors.CHAT_FC_NAME_TRANSPARENT_BACKGROUND;
|
||||||
import static net.runelite.client.ui.JagexColors.CHAT_CLAN_TEXT_OPAQUE_BACKGROUND;
|
import static net.runelite.client.ui.JagexColors.CHAT_FC_TEXT_OPAQUE_BACKGROUND;
|
||||||
import static net.runelite.client.ui.JagexColors.CHAT_CLAN_TEXT_TRANSPARENT_BACKGROUND;
|
import static net.runelite.client.ui.JagexColors.CHAT_FC_TEXT_TRANSPARENT_BACKGROUND;
|
||||||
import net.runelite.client.ui.overlay.infobox.InfoBoxManager;
|
import net.runelite.client.ui.overlay.infobox.InfoBoxManager;
|
||||||
import net.runelite.client.util.Text;
|
import net.runelite.client.util.Text;
|
||||||
|
|
||||||
@PluginDescriptor(
|
@PluginDescriptor(
|
||||||
name = "Clan Chat",
|
name = "Friends Chat",
|
||||||
description = "Add rank icons to users talking in clan chat",
|
description = "Add rank icons to users talking in friends chat",
|
||||||
tags = {"icons", "rank", "recent"}
|
tags = {"icons", "rank", "recent", "clan"}
|
||||||
)
|
)
|
||||||
public class ClanChatPlugin extends Plugin
|
public class FriendsChatPlugin extends Plugin
|
||||||
{
|
{
|
||||||
private static final int MAX_CHATS = 10;
|
private static final int MAX_CHATS = 10;
|
||||||
private static final String CLAN_CHAT_TITLE = "CC";
|
private static final String TITLE = "FC";
|
||||||
private static final String RECENT_TITLE = "Recent CCs";
|
private static final String RECENT_TITLE = "Recent FCs";
|
||||||
private static final int JOIN_LEAVE_DURATION = 20;
|
private static final int JOIN_LEAVE_DURATION = 20;
|
||||||
private static final int MESSAGE_DELAY = 10;
|
private static final int MESSAGE_DELAY = 10;
|
||||||
|
|
||||||
@@ -103,10 +103,10 @@ public class ClanChatPlugin extends Plugin
|
|||||||
private Client client;
|
private Client client;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private ClanManager clanManager;
|
private FriendChatManager friendChatManager;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private ClanChatConfig config;
|
private FriendsChatConfig config;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private InfoBoxManager infoBoxManager;
|
private InfoBoxManager infoBoxManager;
|
||||||
@@ -121,21 +121,21 @@ public class ClanChatPlugin extends Plugin
|
|||||||
private ChatboxPanelManager chatboxPanelManager;
|
private ChatboxPanelManager chatboxPanelManager;
|
||||||
|
|
||||||
private List<String> chats = new ArrayList<>();
|
private List<String> chats = new ArrayList<>();
|
||||||
private List<Player> clanMembers = new ArrayList<>();
|
private List<Player> members = new ArrayList<>();
|
||||||
private ClanChatIndicator clanMemberCounter;
|
private MembersIndicator membersIndicator;
|
||||||
/**
|
/**
|
||||||
* queue of temporary messages added to the client
|
* queue of temporary messages added to the client
|
||||||
*/
|
*/
|
||||||
private final Deque<ClanJoinMessage> clanJoinMessages = new ArrayDeque<>();
|
private final Deque<MemberJoinMessage> joinMessages = new ArrayDeque<>();
|
||||||
private Map<String, ClanMemberActivity> activityBuffer = new HashMap<>();
|
private Map<String, MemberActivity> activityBuffer = new HashMap<>();
|
||||||
private int clanJoinedTick;
|
private int joinedTick;
|
||||||
|
|
||||||
private boolean kickConfirmed = false;
|
private boolean kickConfirmed = false;
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
ClanChatConfig getConfig(ConfigManager configManager)
|
FriendsChatConfig getConfig(ConfigManager configManager)
|
||||||
{
|
{
|
||||||
return configManager.getConfig(ClanChatConfig.class);
|
return configManager.getConfig(FriendsChatConfig.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -153,9 +153,9 @@ public class ClanChatPlugin extends Plugin
|
|||||||
public void shutDown()
|
public void shutDown()
|
||||||
{
|
{
|
||||||
clientThread.invoke(() -> colorIgnoredPlayers(Color.WHITE));
|
clientThread.invoke(() -> colorIgnoredPlayers(Color.WHITE));
|
||||||
clanMembers.clear();
|
members.clear();
|
||||||
removeClanCounter();
|
resetCounter();
|
||||||
resetClanChats();
|
resetChats();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Subscribe
|
@Subscribe
|
||||||
@@ -165,16 +165,16 @@ public class ClanChatPlugin extends Plugin
|
|||||||
{
|
{
|
||||||
if (!config.recentChats())
|
if (!config.recentChats())
|
||||||
{
|
{
|
||||||
resetClanChats();
|
resetChats();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config.showClanCounter())
|
if (config.showCounter())
|
||||||
{
|
{
|
||||||
clientThread.invoke(this::addClanCounter);
|
clientThread.invoke(this::addCounter);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
removeClanCounter();
|
resetCounter();
|
||||||
}
|
}
|
||||||
|
|
||||||
Color ignoreColor = config.showIgnores() ? config.showIgnoresColor() : Color.WHITE;
|
Color ignoreColor = config.showIgnores() ? config.showIgnoresColor() : Color.WHITE;
|
||||||
@@ -183,9 +183,9 @@ public class ClanChatPlugin extends Plugin
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Subscribe
|
@Subscribe
|
||||||
public void onClanMemberJoined(ClanMemberJoined event)
|
public void onFriendsChatMemberJoined(FriendsChatMemberJoined event)
|
||||||
{
|
{
|
||||||
final ClanMember member = event.getMember();
|
final FriendsChatMember member = event.getMember();
|
||||||
|
|
||||||
if (member.getWorld() == client.getWorld())
|
if (member.getWorld() == client.getWorld())
|
||||||
{
|
{
|
||||||
@@ -196,15 +196,15 @@ public class ClanChatPlugin extends Plugin
|
|||||||
{
|
{
|
||||||
if (player != null && player != local && memberName.equals(Text.toJagexName(player.getName())))
|
if (player != null && player != local && memberName.equals(Text.toJagexName(player.getName())))
|
||||||
{
|
{
|
||||||
clanMembers.add(player);
|
members.add(player);
|
||||||
addClanCounter();
|
addCounter();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// clan members getting initialized isn't relevant
|
// members getting initialized isn't relevant
|
||||||
if (clanJoinedTick == client.getTickCount())
|
if (joinedTick == client.getTickCount())
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -218,7 +218,7 @@ public class ClanChatPlugin extends Plugin
|
|||||||
// attempt to filter out world hopping joins
|
// attempt to filter out world hopping joins
|
||||||
if (!activityBuffer.containsKey(member.getName()))
|
if (!activityBuffer.containsKey(member.getName()))
|
||||||
{
|
{
|
||||||
ClanMemberActivity joinActivity = new ClanMemberActivity(ClanActivityType.JOINED,
|
MemberActivity joinActivity = new MemberActivity(ActivityType.JOINED,
|
||||||
member, client.getTickCount());
|
member, client.getTickCount());
|
||||||
activityBuffer.put(member.getName(), joinActivity);
|
activityBuffer.put(member.getName(), joinActivity);
|
||||||
}
|
}
|
||||||
@@ -229,14 +229,14 @@ public class ClanChatPlugin extends Plugin
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Subscribe
|
@Subscribe
|
||||||
public void onClanMemberLeft(ClanMemberLeft event)
|
public void onFriendsChatMemberLeft(FriendsChatMemberLeft event)
|
||||||
{
|
{
|
||||||
final ClanMember member = event.getMember();
|
final FriendsChatMember member = event.getMember();
|
||||||
|
|
||||||
if (member.getWorld() == client.getWorld())
|
if (member.getWorld() == client.getWorld())
|
||||||
{
|
{
|
||||||
final String memberName = Text.toJagexName(member.getName());
|
final String memberName = Text.toJagexName(member.getName());
|
||||||
final Iterator<Player> each = clanMembers.iterator();
|
final Iterator<Player> each = members.iterator();
|
||||||
|
|
||||||
while (each.hasNext())
|
while (each.hasNext())
|
||||||
{
|
{
|
||||||
@@ -244,9 +244,9 @@ public class ClanChatPlugin extends Plugin
|
|||||||
{
|
{
|
||||||
each.remove();
|
each.remove();
|
||||||
|
|
||||||
if (clanMembers.isEmpty())
|
if (members.isEmpty())
|
||||||
{
|
{
|
||||||
removeClanCounter();
|
resetCounter();
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
@@ -262,7 +262,7 @@ public class ClanChatPlugin extends Plugin
|
|||||||
|
|
||||||
if (!activityBuffer.containsKey(member.getName()))
|
if (!activityBuffer.containsKey(member.getName()))
|
||||||
{
|
{
|
||||||
ClanMemberActivity leaveActivity = new ClanMemberActivity(ClanActivityType.LEFT,
|
MemberActivity leaveActivity = new MemberActivity(ActivityType.LEFT,
|
||||||
member, client.getTickCount());
|
member, client.getTickCount());
|
||||||
activityBuffer.put(member.getName(), leaveActivity);
|
activityBuffer.put(member.getName(), leaveActivity);
|
||||||
}
|
}
|
||||||
@@ -280,21 +280,21 @@ public class ClanChatPlugin extends Plugin
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget clanChatTitleWidget = client.getWidget(WidgetInfo.CLAN_CHAT_TITLE);
|
Widget chatTitleWidget = client.getWidget(WidgetInfo.FRIENDS_CHAT_TITLE);
|
||||||
if (clanChatTitleWidget != null)
|
if (chatTitleWidget != null)
|
||||||
{
|
{
|
||||||
Widget clanChatList = client.getWidget(WidgetInfo.CLAN_CHAT_LIST);
|
Widget chatList = client.getWidget(WidgetInfo.FRIENDS_CHAT_LIST);
|
||||||
Widget owner = client.getWidget(WidgetInfo.CLAN_CHAT_OWNER);
|
Widget owner = client.getWidget(WidgetInfo.FRIENDS_CHAT_OWNER);
|
||||||
ClanMemberManager clanMemberManager = client.getClanMemberManager();
|
FriendsChatManager friendsChatManager = client.getFriendsChatManager();
|
||||||
if (clanMemberManager != null && clanMemberManager.getCount() > 0)
|
if (friendsChatManager != null && friendsChatManager.getCount() > 0)
|
||||||
{
|
{
|
||||||
clanChatTitleWidget.setText(CLAN_CHAT_TITLE + " (" + clanMemberManager.getCount() + "/100)");
|
chatTitleWidget.setText(TITLE + " (" + friendsChatManager.getCount() + "/100)");
|
||||||
}
|
}
|
||||||
else if (config.recentChats() && clanChatList.getChildren() == null && !Strings.isNullOrEmpty(owner.getText()))
|
else if (config.recentChats() && chatList.getChildren() == null && !Strings.isNullOrEmpty(owner.getText()))
|
||||||
{
|
{
|
||||||
clanChatTitleWidget.setText(RECENT_TITLE);
|
chatTitleWidget.setText(RECENT_TITLE);
|
||||||
|
|
||||||
loadClanChats();
|
loadFriendsChats();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -303,32 +303,32 @@ public class ClanChatPlugin extends Plugin
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
timeoutClanMessages();
|
timeoutMessages();
|
||||||
|
|
||||||
addClanActivityMessages();
|
addActivityMessages();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void timeoutClanMessages()
|
private void timeoutMessages()
|
||||||
{
|
{
|
||||||
if (clanJoinMessages.isEmpty())
|
if (joinMessages.isEmpty())
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean removed = false;
|
boolean removed = false;
|
||||||
|
|
||||||
for (Iterator<ClanJoinMessage> it = clanJoinMessages.iterator(); it.hasNext(); )
|
for (Iterator<MemberJoinMessage> it = joinMessages.iterator(); it.hasNext(); )
|
||||||
{
|
{
|
||||||
ClanJoinMessage clanJoinMessage = it.next();
|
MemberJoinMessage joinMessage = it.next();
|
||||||
MessageNode messageNode = clanJoinMessage.getMessageNode();
|
MessageNode messageNode = joinMessage.getMessageNode();
|
||||||
final int createdTick = clanJoinMessage.getTick();
|
final int createdTick = joinMessage.getTick();
|
||||||
|
|
||||||
if (client.getTickCount() > createdTick + JOIN_LEAVE_DURATION)
|
if (client.getTickCount() > createdTick + JOIN_LEAVE_DURATION)
|
||||||
{
|
{
|
||||||
it.remove();
|
it.remove();
|
||||||
|
|
||||||
// If this message has been reused since, it will get a different id
|
// If this message has been reused since, it will get a different id
|
||||||
if (clanJoinMessage.getGetMessageId() == messageNode.getId())
|
if (joinMessage.getGetMessageId() == messageNode.getId())
|
||||||
{
|
{
|
||||||
ChatLineBuffer ccInfoBuffer = client.getChatLineMap().get(ChatMessageType.FRIENDSCHATNOTIFICATION.getType());
|
ChatLineBuffer ccInfoBuffer = client.getChatLineMap().get(ChatMessageType.FRIENDSCHATNOTIFICATION.getType());
|
||||||
if (ccInfoBuffer != null)
|
if (ccInfoBuffer != null)
|
||||||
@@ -351,50 +351,50 @@ public class ClanChatPlugin extends Plugin
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addClanActivityMessages()
|
private void addActivityMessages()
|
||||||
{
|
{
|
||||||
ClanMemberManager clanMemberManager = client.getClanMemberManager();
|
FriendsChatManager friendsChatManager = client.getFriendsChatManager();
|
||||||
if (clanMemberManager == null || activityBuffer.isEmpty())
|
if (friendsChatManager == null || activityBuffer.isEmpty())
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Iterator<ClanMemberActivity> activityIt = activityBuffer.values().iterator();
|
Iterator<MemberActivity> activityIt = activityBuffer.values().iterator();
|
||||||
|
|
||||||
while (activityIt.hasNext())
|
while (activityIt.hasNext())
|
||||||
{
|
{
|
||||||
ClanMemberActivity activity = activityIt.next();
|
MemberActivity activity = activityIt.next();
|
||||||
|
|
||||||
if (activity.getTick() < client.getTickCount() - MESSAGE_DELAY)
|
if (activity.getTick() < client.getTickCount() - MESSAGE_DELAY)
|
||||||
{
|
{
|
||||||
activityIt.remove();
|
activityIt.remove();
|
||||||
addActivityMessage(clanMemberManager, activity.getMember(), activity.getActivityType());
|
addActivityMessage(friendsChatManager, activity.getMember(), activity.getActivityType());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addActivityMessage(ClanMemberManager clanMemberManager, ClanMember member, ClanActivityType activityType)
|
private void addActivityMessage(FriendsChatManager friendsChatManager, FriendsChatMember member, ActivityType activityType)
|
||||||
{
|
{
|
||||||
final String activityMessage = activityType == ClanActivityType.JOINED ? " has joined." : " has left.";
|
final String activityMessage = activityType == ActivityType.JOINED ? " has joined." : " has left.";
|
||||||
final ClanMemberRank rank = member.getRank();
|
final FriendsChatRank rank = member.getRank();
|
||||||
Color textColor = CHAT_CLAN_TEXT_OPAQUE_BACKGROUND;
|
Color textColor = CHAT_FC_TEXT_OPAQUE_BACKGROUND;
|
||||||
Color channelColor = CHAT_CLAN_NAME_OPAQUE_BACKGROUND;
|
Color channelColor = CHAT_FC_NAME_OPAQUE_BACKGROUND;
|
||||||
int rankIcon = -1;
|
int rankIcon = -1;
|
||||||
|
|
||||||
if (client.isResized() && client.getVar(Varbits.TRANSPARENT_CHATBOX) == 1)
|
if (client.isResized() && client.getVar(Varbits.TRANSPARENT_CHATBOX) == 1)
|
||||||
{
|
{
|
||||||
textColor = CHAT_CLAN_TEXT_TRANSPARENT_BACKGROUND;
|
textColor = CHAT_FC_TEXT_TRANSPARENT_BACKGROUND;
|
||||||
channelColor = CHAT_CLAN_NAME_TRANSPARENT_BACKGROUND;
|
channelColor = CHAT_FC_NAME_TRANSPARENT_BACKGROUND;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config.clanChatIcons() && rank != null && rank != ClanMemberRank.UNRANKED)
|
if (config.chatIcons() && rank != null && rank != FriendsChatRank.UNRANKED)
|
||||||
{
|
{
|
||||||
rankIcon = clanManager.getIconNumber(rank);
|
rankIcon = friendChatManager.getIconNumber(rank);
|
||||||
}
|
}
|
||||||
|
|
||||||
ChatMessageBuilder message = new ChatMessageBuilder()
|
ChatMessageBuilder message = new ChatMessageBuilder()
|
||||||
.append("[")
|
.append("[")
|
||||||
.append(channelColor, clanMemberManager.getClanChatName());
|
.append(channelColor, friendsChatManager.getName());
|
||||||
if (rankIcon > -1)
|
if (rankIcon > -1)
|
||||||
{
|
{
|
||||||
message
|
message
|
||||||
@@ -412,16 +412,16 @@ public class ClanChatPlugin extends Plugin
|
|||||||
final MessageNode[] lines = chatLineBuffer.getLines();
|
final MessageNode[] lines = chatLineBuffer.getLines();
|
||||||
final MessageNode line = lines[0];
|
final MessageNode line = lines[0];
|
||||||
|
|
||||||
ClanJoinMessage clanJoinMessage = new ClanJoinMessage(line, line.getId(), client.getTickCount());
|
MemberJoinMessage joinMessage = new MemberJoinMessage(line, line.getId(), client.getTickCount());
|
||||||
clanJoinMessages.addLast(clanJoinMessage);
|
joinMessages.addLast(joinMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Subscribe
|
@Subscribe
|
||||||
public void onVarClientStrChanged(VarClientStrChanged strChanged)
|
public void onVarClientStrChanged(VarClientStrChanged strChanged)
|
||||||
{
|
{
|
||||||
if (strChanged.getIndex() == VarClientStr.RECENT_CLAN_CHAT.getIndex() && config.recentChats())
|
if (strChanged.getIndex() == VarClientStr.RECENT_FRIENDS_CHAT.getIndex() && config.recentChats())
|
||||||
{
|
{
|
||||||
updateRecentChat(client.getVar(VarClientStr.RECENT_CLAN_CHAT));
|
updateRecentChat(client.getVar(VarClientStr.RECENT_FRIENDS_CHAT));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -433,8 +433,8 @@ public class ClanChatPlugin extends Plugin
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ClanMemberManager clanMemberManager = client.getClanMemberManager();
|
FriendsChatManager friendsChatManager = client.getFriendsChatManager();
|
||||||
if (clanMemberManager == null || clanMemberManager.getCount() == 0)
|
if (friendsChatManager == null || friendsChatManager.getCount() == 0)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -456,7 +456,7 @@ public class ClanChatPlugin extends Plugin
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case FRIENDSCHAT:
|
case FRIENDSCHAT:
|
||||||
if (!config.clanChatIcons())
|
if (!config.chatIcons())
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -465,7 +465,7 @@ public class ClanChatPlugin extends Plugin
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
insertClanRankIcon(chatMessage);
|
insertRankIcon(chatMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Subscribe
|
@Subscribe
|
||||||
@@ -475,10 +475,10 @@ public class ClanChatPlugin extends Plugin
|
|||||||
|
|
||||||
if (gameState == GameState.LOGIN_SCREEN || gameState == GameState.CONNECTION_LOST || gameState == GameState.HOPPING)
|
if (gameState == GameState.LOGIN_SCREEN || gameState == GameState.CONNECTION_LOST || gameState == GameState.HOPPING)
|
||||||
{
|
{
|
||||||
clanMembers.clear();
|
members.clear();
|
||||||
removeClanCounter();
|
resetCounter();
|
||||||
|
|
||||||
clanJoinMessages.clear();
|
joinMessages.clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -488,33 +488,33 @@ public class ClanChatPlugin extends Plugin
|
|||||||
final Player local = client.getLocalPlayer();
|
final Player local = client.getLocalPlayer();
|
||||||
final Player player = event.getPlayer();
|
final Player player = event.getPlayer();
|
||||||
|
|
||||||
if (player != local && player.isClanMember())
|
if (player != local && player.isFriendsChatMember())
|
||||||
{
|
{
|
||||||
clanMembers.add(player);
|
members.add(player);
|
||||||
addClanCounter();
|
addCounter();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Subscribe
|
@Subscribe
|
||||||
public void onPlayerDespawned(PlayerDespawned event)
|
public void onPlayerDespawned(PlayerDespawned event)
|
||||||
{
|
{
|
||||||
if (clanMembers.remove(event.getPlayer()) && clanMembers.isEmpty())
|
if (members.remove(event.getPlayer()) && members.isEmpty())
|
||||||
{
|
{
|
||||||
removeClanCounter();
|
resetCounter();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Subscribe
|
@Subscribe
|
||||||
public void onClanChanged(ClanChanged event)
|
public void onFriendsChatChanged(FriendsChatChanged event)
|
||||||
{
|
{
|
||||||
if (event.isJoined())
|
if (event.isJoined())
|
||||||
{
|
{
|
||||||
clanJoinedTick = client.getTickCount();
|
joinedTick = client.getTickCount();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
clanMembers.clear();
|
members.clear();
|
||||||
removeClanCounter();
|
resetCounter();
|
||||||
}
|
}
|
||||||
|
|
||||||
activityBuffer.clear();
|
activityBuffer.clear();
|
||||||
@@ -525,16 +525,16 @@ public class ClanChatPlugin extends Plugin
|
|||||||
{
|
{
|
||||||
switch (scriptCallbackEvent.getEventName())
|
switch (scriptCallbackEvent.getEventName())
|
||||||
{
|
{
|
||||||
case "clanchatInput":
|
case "friendsChatInput":
|
||||||
{
|
{
|
||||||
final int[] intStack = client.getIntStack();
|
final int[] intStack = client.getIntStack();
|
||||||
final int size = client.getIntStackSize();
|
final int size = client.getIntStackSize();
|
||||||
// If the user accidentally adds a / when the config and the clan chat tab is active, handle it like a normal message
|
// If the user accidentally adds a / when the config and the friends chat chat tab is active, handle it like a normal message
|
||||||
boolean alterClanChatDispatch = config.clanTabChat() && !client.getVar(VarClientStr.CHATBOX_TYPED_TEXT).startsWith("/");
|
boolean alterDispatch = config.friendsChatTabChat() && !client.getVar(VarClientStr.CHATBOX_TYPED_TEXT).startsWith("/");
|
||||||
intStack[size - 1] = alterClanChatDispatch ? 1 : 0;
|
intStack[size - 1] = alterDispatch ? 1 : 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case "confirmClanKick":
|
case "confirmFriendsChatKick":
|
||||||
{
|
{
|
||||||
if (!config.confirmKicks() || kickConfirmed)
|
if (!config.confirmKicks() || kickConfirmed)
|
||||||
{
|
{
|
||||||
@@ -561,24 +561,24 @@ public class ClanChatPlugin extends Plugin
|
|||||||
@Subscribe
|
@Subscribe
|
||||||
public void onScriptPostFired(ScriptPostFired event)
|
public void onScriptPostFired(ScriptPostFired event)
|
||||||
{
|
{
|
||||||
if (event.getScriptId() == ScriptID.CLAN_CHAT_CHANNEL_BUILD && config.showIgnores())
|
if (event.getScriptId() == ScriptID.FRIENDS_CHAT_CHANNEL_REBUILD && config.showIgnores())
|
||||||
{
|
{
|
||||||
colorIgnoredPlayers(config.showIgnoresColor());
|
colorIgnoredPlayers(config.showIgnoresColor());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int getClanAmount()
|
int getMembersSize()
|
||||||
{
|
{
|
||||||
return clanMembers.size();
|
return members.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void insertClanRankIcon(final ChatMessage message)
|
private void insertRankIcon(final ChatMessage message)
|
||||||
{
|
{
|
||||||
final ClanMemberRank rank = clanManager.getRank(message.getName());
|
final FriendsChatRank rank = friendChatManager.getRank(message.getName());
|
||||||
|
|
||||||
if (rank != null && rank != ClanMemberRank.UNRANKED)
|
if (rank != null && rank != FriendsChatRank.UNRANKED)
|
||||||
{
|
{
|
||||||
int iconNumber = clanManager.getIconNumber(rank);
|
int iconNumber = friendChatManager.getIconNumber(rank);
|
||||||
final String img = "<img=" + iconNumber + ">";
|
final String img = "<img=" + iconNumber + ">";
|
||||||
if (message.getType() == ChatMessageType.FRIENDSCHAT)
|
if (message.getType() == ChatMessageType.FRIENDSCHAT)
|
||||||
{
|
{
|
||||||
@@ -594,38 +594,38 @@ public class ClanChatPlugin extends Plugin
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void resetClanChats()
|
private void resetChats()
|
||||||
{
|
{
|
||||||
Widget clanChatList = client.getWidget(WidgetInfo.CLAN_CHAT_LIST);
|
Widget chatList = client.getWidget(WidgetInfo.FRIENDS_CHAT_LIST);
|
||||||
Widget clanChatTitleWidget = client.getWidget(WidgetInfo.CLAN_CHAT_TITLE);
|
Widget chatTitleWidget = client.getWidget(WidgetInfo.FRIENDS_CHAT_TITLE);
|
||||||
|
|
||||||
if (clanChatList == null)
|
if (chatList == null)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ClanMemberManager clanMemberManager = client.getClanMemberManager();
|
FriendsChatManager friendsChatManager = client.getFriendsChatManager();
|
||||||
if (clanMemberManager == null || clanMemberManager.getCount() == 0)
|
if (friendsChatManager == null || friendsChatManager.getCount() == 0)
|
||||||
{
|
{
|
||||||
clanChatList.setChildren(null);
|
chatList.setChildren(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
clanChatTitleWidget.setText(CLAN_CHAT_TITLE);
|
chatTitleWidget.setText(TITLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void loadClanChats()
|
private void loadFriendsChats()
|
||||||
{
|
{
|
||||||
Widget clanChatList = client.getWidget(WidgetInfo.CLAN_CHAT_LIST);
|
Widget chatList = client.getWidget(WidgetInfo.FRIENDS_CHAT_LIST);
|
||||||
if (clanChatList == null)
|
if (chatList == null)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
int y = 2;
|
int y = 2;
|
||||||
clanChatList.setChildren(null);
|
chatList.setChildren(null);
|
||||||
for (String chat : Lists.reverse(chats))
|
for (String chat : Lists.reverse(chats))
|
||||||
{
|
{
|
||||||
Widget widget = clanChatList.createChild(-1, WidgetType.TEXT);
|
Widget widget = chatList.createChild(-1, WidgetType.TEXT);
|
||||||
widget.setFontId(494);
|
widget.setFontId(494);
|
||||||
widget.setTextColor(0xffffff);
|
widget.setTextColor(0xffffff);
|
||||||
widget.setText(chat);
|
widget.setText(chat);
|
||||||
@@ -659,22 +659,22 @@ public class ClanChatPlugin extends Plugin
|
|||||||
config.chatsData(Text.toCSV(chats));
|
config.chatsData(Text.toCSV(chats));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void removeClanCounter()
|
private void resetCounter()
|
||||||
{
|
{
|
||||||
infoBoxManager.removeInfoBox(clanMemberCounter);
|
infoBoxManager.removeInfoBox(membersIndicator);
|
||||||
clanMemberCounter = null;
|
membersIndicator = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addClanCounter()
|
private void addCounter()
|
||||||
{
|
{
|
||||||
if (!config.showClanCounter() || clanMemberCounter != null || clanMembers.isEmpty())
|
if (!config.showCounter() || membersIndicator != null || members.isEmpty())
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
final BufferedImage image = spriteManager.getSprite(SpriteID.TAB_CLAN_CHAT, 0);
|
final BufferedImage image = spriteManager.getSprite(SpriteID.TAB_FRIENDS_CHAT, 0);
|
||||||
clanMemberCounter = new ClanChatIndicator(image, this);
|
membersIndicator = new MembersIndicator(image, this);
|
||||||
infoBoxManager.addInfoBox(clanMemberCounter);
|
infoBoxManager.addInfoBox(membersIndicator);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void confirmKickPlayer(final String kickPlayerName)
|
private void confirmKickPlayer(final String kickPlayerName)
|
||||||
@@ -684,7 +684,7 @@ public class ClanChatPlugin extends Plugin
|
|||||||
clientThread.invoke(() ->
|
clientThread.invoke(() ->
|
||||||
{
|
{
|
||||||
kickConfirmed = true;
|
kickConfirmed = true;
|
||||||
client.runScript(ScriptID.CLAN_SEND_KICK, kickPlayerName);
|
client.runScript(ScriptID.FRIENDS_CHAT_SEND_KICK, kickPlayerName);
|
||||||
kickConfirmed = false;
|
kickConfirmed = false;
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
@@ -694,19 +694,19 @@ public class ClanChatPlugin extends Plugin
|
|||||||
|
|
||||||
private void colorIgnoredPlayers(Color ignoreColor)
|
private void colorIgnoredPlayers(Color ignoreColor)
|
||||||
{
|
{
|
||||||
Widget clanChatList = client.getWidget(WidgetInfo.CLAN_CHAT_LIST);
|
Widget chatList = client.getWidget(WidgetInfo.FRIENDS_CHAT_LIST);
|
||||||
if (clanChatList == null || clanChatList.getChildren() == null)
|
if (chatList == null || chatList.getChildren() == null)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
NameableContainer<Ignore> ignoreContainer = client.getIgnoreContainer();
|
NameableContainer<Ignore> ignoreContainer = client.getIgnoreContainer();
|
||||||
// Iterate every 3 widgets, since the order of widgets is name, world, icon
|
// Iterate every 3 widgets, since the order of widgets is name, world, icon
|
||||||
for (int i = 0; i < clanChatList.getChildren().length; i += 3)
|
for (int i = 0; i < chatList.getChildren().length; i += 3)
|
||||||
{
|
{
|
||||||
Widget listWidget = clanChatList.getChild(i);
|
Widget listWidget = chatList.getChild(i);
|
||||||
String clanMemberName = listWidget.getText();
|
String memberName = listWidget.getText();
|
||||||
if (clanMemberName.isEmpty() || ignoreContainer.findByName(clanMemberName) == null)
|
if (memberName.isEmpty() || ignoreContainer.findByName(memberName) == null)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -22,17 +22,17 @@
|
|||||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
package net.runelite.client.plugins.clanchat;
|
package net.runelite.client.plugins.friendschat;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Value;
|
import lombok.Value;
|
||||||
import net.runelite.api.ClanMember;
|
import net.runelite.api.FriendsChatMember;
|
||||||
|
|
||||||
@Value
|
@Value
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
class ClanMemberActivity
|
class MemberActivity
|
||||||
{
|
{
|
||||||
private ClanActivityType activityType;
|
private ActivityType activityType;
|
||||||
private ClanMember member;
|
private FriendsChatMember member;
|
||||||
private Integer tick;
|
private Integer tick;
|
||||||
}
|
}
|
||||||
@@ -22,13 +22,13 @@
|
|||||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
package net.runelite.client.plugins.clanchat;
|
package net.runelite.client.plugins.friendschat;
|
||||||
|
|
||||||
import lombok.Value;
|
import lombok.Value;
|
||||||
import net.runelite.api.MessageNode;
|
import net.runelite.api.MessageNode;
|
||||||
|
|
||||||
@Value
|
@Value
|
||||||
class ClanJoinMessage
|
class MemberJoinMessage
|
||||||
{
|
{
|
||||||
private final MessageNode messageNode;
|
private final MessageNode messageNode;
|
||||||
private final int getMessageId;
|
private final int getMessageId;
|
||||||
@@ -22,32 +22,32 @@
|
|||||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
package net.runelite.client.plugins.clanchat;
|
package net.runelite.client.plugins.friendschat;
|
||||||
|
|
||||||
import java.awt.Color;
|
import java.awt.Color;
|
||||||
import java.awt.image.BufferedImage;
|
import java.awt.image.BufferedImage;
|
||||||
import net.runelite.client.ui.overlay.infobox.Counter;
|
import net.runelite.client.ui.overlay.infobox.Counter;
|
||||||
|
|
||||||
class ClanChatIndicator extends Counter
|
class MembersIndicator extends Counter
|
||||||
{
|
{
|
||||||
private final ClanChatPlugin plugin;
|
private final FriendsChatPlugin plugin;
|
||||||
|
|
||||||
ClanChatIndicator(BufferedImage image, ClanChatPlugin plugin)
|
MembersIndicator(BufferedImage image, FriendsChatPlugin plugin)
|
||||||
{
|
{
|
||||||
super(image, plugin, plugin.getClanAmount());
|
super(image, plugin, plugin.getMembersSize());
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getCount()
|
public int getCount()
|
||||||
{
|
{
|
||||||
return plugin.getClanAmount();
|
return plugin.getMembersSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getTooltip()
|
public String getTooltip()
|
||||||
{
|
{
|
||||||
return plugin.getClanAmount() + " clan member(s) near you";
|
return plugin.getMembersSize() + " friends chat member(s) near you";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -155,7 +155,7 @@ public class HiscorePlugin extends Plugin
|
|||||||
int groupId = WidgetInfo.TO_GROUP(event.getActionParam1());
|
int groupId = WidgetInfo.TO_GROUP(event.getActionParam1());
|
||||||
String option = event.getOption();
|
String option = event.getOption();
|
||||||
|
|
||||||
if (groupId == WidgetInfo.FRIENDS_LIST.getGroupId() || groupId == WidgetInfo.CLAN_CHAT.getGroupId() ||
|
if (groupId == WidgetInfo.FRIENDS_LIST.getGroupId() || groupId == WidgetInfo.FRIENDS_CHAT.getGroupId() ||
|
||||||
groupId == WidgetInfo.CHATBOX.getGroupId() && !KICK_OPTION.equals(option) || //prevent from adding for Kick option (interferes with the raiding party one)
|
groupId == WidgetInfo.CHATBOX.getGroupId() && !KICK_OPTION.equals(option) || //prevent from adding for Kick option (interferes with the raiding party one)
|
||||||
groupId == WidgetInfo.RAIDING_PARTY.getGroupId() || groupId == WidgetInfo.PRIVATE_CHAT_MESSAGE.getGroupId() ||
|
groupId == WidgetInfo.RAIDING_PARTY.getGroupId() || groupId == WidgetInfo.PRIVATE_CHAT_MESSAGE.getGroupId() ||
|
||||||
groupId == WidgetInfo.IGNORE_LIST.getGroupId())
|
groupId == WidgetInfo.IGNORE_LIST.getGroupId())
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ import javax.swing.text.Document;
|
|||||||
import javax.swing.text.JTextComponent;
|
import javax.swing.text.JTextComponent;
|
||||||
import lombok.NonNull;
|
import lombok.NonNull;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import net.runelite.api.ClanMemberManager;
|
import net.runelite.api.FriendsChatManager;
|
||||||
import net.runelite.api.Client;
|
import net.runelite.api.Client;
|
||||||
import net.runelite.api.Friend;
|
import net.runelite.api.Friend;
|
||||||
import net.runelite.api.Nameable;
|
import net.runelite.api.Nameable;
|
||||||
@@ -222,20 +222,20 @@ class NameAutocompleter implements KeyListener
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Search clan if a friend wasn't found
|
// Search friends chat if a friend wasn't found
|
||||||
if (!autocompleteName.isPresent())
|
if (!autocompleteName.isPresent())
|
||||||
{
|
{
|
||||||
final ClanMemberManager clanMemberManager = client.getClanMemberManager();
|
final FriendsChatManager friendsChatManager = client.getFriendsChatManager();
|
||||||
if (clanMemberManager != null)
|
if (friendsChatManager != null)
|
||||||
{
|
{
|
||||||
autocompleteName = Arrays.stream(clanMemberManager.getMembers())
|
autocompleteName = Arrays.stream(friendsChatManager.getMembers())
|
||||||
.map(Nameable::getName)
|
.map(Nameable::getName)
|
||||||
.filter(n -> pattern.matcher(n).matches())
|
.filter(n -> pattern.matcher(n).matches())
|
||||||
.findFirst();
|
.findFirst();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Search cached players if a clannie wasn't found.
|
// Search cached players if a friend wasn't found
|
||||||
if (!autocompleteName.isPresent())
|
if (!autocompleteName.isPresent())
|
||||||
{
|
{
|
||||||
final Player[] cachedPlayers = client.getCachedPlayers();
|
final Player[] cachedPlayers = client.getCachedPlayers();
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ enum SpriteOverride
|
|||||||
TAB_MAGIC_SPELLBOOK_ANCIENT_MAGICKS(SpriteID.TAB_MAGIC_SPELLBOOK_ANCIENT_MAGICKS, AROUND_2005),
|
TAB_MAGIC_SPELLBOOK_ANCIENT_MAGICKS(SpriteID.TAB_MAGIC_SPELLBOOK_ANCIENT_MAGICKS, AROUND_2005),
|
||||||
TAB_MAGIC_SPELLBOOK_LUNAR(SpriteID.TAB_MAGIC_SPELLBOOK_LUNAR, AROUND_2005),
|
TAB_MAGIC_SPELLBOOK_LUNAR(SpriteID.TAB_MAGIC_SPELLBOOK_LUNAR, AROUND_2005),
|
||||||
TAB_MAGIC_SPELLBOOK_ARCEUUS(SpriteID.TAB_MAGIC_SPELLBOOK_ARCEUUS, AROUND_2005),
|
TAB_MAGIC_SPELLBOOK_ARCEUUS(SpriteID.TAB_MAGIC_SPELLBOOK_ARCEUUS, AROUND_2005),
|
||||||
TAB_CLAN_CHAT(SpriteID.TAB_CLAN_CHAT, AROUND_2005, AROUND_2010),
|
TAB_CLAN_CHAT(SpriteID.TAB_FRIENDS_CHAT, AROUND_2005, AROUND_2010),
|
||||||
TAB_FRIENDS(SpriteID.TAB_FRIENDS, AROUND_2005, AROUND_2010),
|
TAB_FRIENDS(SpriteID.TAB_FRIENDS, AROUND_2005, AROUND_2010),
|
||||||
TAB_IGNORES(SpriteID.TAB_IGNORES, AROUND_2005, AROUND_2010),
|
TAB_IGNORES(SpriteID.TAB_IGNORES, AROUND_2005, AROUND_2010),
|
||||||
TAB_LOGOUT(SpriteID.TAB_LOGOUT, AROUND_2005, AROUND_2010),
|
TAB_LOGOUT(SpriteID.TAB_LOGOUT, AROUND_2005, AROUND_2010),
|
||||||
|
|||||||
@@ -46,8 +46,8 @@ enum WidgetOffset
|
|||||||
RESIZABLE_2010_PRAYER_ICON(Skin.AROUND_2010, WidgetInfo.RESIZABLE_VIEWPORT_PRAYER_ICON, 172, 1, null, null),
|
RESIZABLE_2010_PRAYER_ICON(Skin.AROUND_2010, WidgetInfo.RESIZABLE_VIEWPORT_PRAYER_ICON, 172, 1, null, null),
|
||||||
RESIZABLE_2010_MAGIC_HIGHLIGHT(Skin.AROUND_2010, WidgetInfo.RESIZABLE_VIEWPORT_MAGIC_TAB, 205, 1, null, null),
|
RESIZABLE_2010_MAGIC_HIGHLIGHT(Skin.AROUND_2010, WidgetInfo.RESIZABLE_VIEWPORT_MAGIC_TAB, 205, 1, null, null),
|
||||||
RESIZABLE_2010_MAGIC_ICON(Skin.AROUND_2010, WidgetInfo.RESIZABLE_VIEWPORT_MAGIC_ICON, 206, null, null, null),
|
RESIZABLE_2010_MAGIC_ICON(Skin.AROUND_2010, WidgetInfo.RESIZABLE_VIEWPORT_MAGIC_ICON, 206, null, null, null),
|
||||||
RESIZABLE_2010_CLAN_CHAT_HIGHLIGHT(Skin.AROUND_2010, WidgetInfo.RESIZABLE_VIEWPORT_CLAN_CHAT_TAB, -4, 1, null, null),
|
RESIZABLE_2010_FRENDS_CHAT_HIGHLIGHT(Skin.AROUND_2010, WidgetInfo.RESIZABLE_VIEWPORT_FRIENDS_CHAT_TAB, -4, 1, null, null),
|
||||||
RESIZABLE_2010_CLAN_CHAT_ICON(Skin.AROUND_2010, WidgetInfo.RESIZABLE_VIEWPORT_CLAN_CHAT_ICON, 2, 1, null, null),
|
RESIZABLE_2010_FRIENDS_CHAT_ICON(Skin.AROUND_2010, WidgetInfo.RESIZABLE_VIEWPORT_FRIENDS_CHAT_ICON, 2, 1, null, null),
|
||||||
RESIZABLE_2010_FRIENDS_HIGHLIGHT(Skin.AROUND_2010, WidgetInfo.RESIZABLE_VIEWPORT_FRIENDS_TAB, 35, 1, null, null),
|
RESIZABLE_2010_FRIENDS_HIGHLIGHT(Skin.AROUND_2010, WidgetInfo.RESIZABLE_VIEWPORT_FRIENDS_TAB, 35, 1, null, null),
|
||||||
RESIZABLE_2010_FRIENDS_ICON(Skin.AROUND_2010, WidgetInfo.RESIZABLE_VIEWPORT_FRIENDS_ICON, 37, 1, null, null),
|
RESIZABLE_2010_FRIENDS_ICON(Skin.AROUND_2010, WidgetInfo.RESIZABLE_VIEWPORT_FRIENDS_ICON, 37, 1, null, null),
|
||||||
RESIZABLE_2010_IGNORES_HIGHLIGHT(Skin.AROUND_2010, WidgetInfo.RESIZABLE_VIEWPORT_IGNORES_TAB, 69, 1, null, null),
|
RESIZABLE_2010_IGNORES_HIGHLIGHT(Skin.AROUND_2010, WidgetInfo.RESIZABLE_VIEWPORT_IGNORES_TAB, 69, 1, null, null),
|
||||||
@@ -87,8 +87,8 @@ enum WidgetOffset
|
|||||||
FIXED_2010_PRAYER_ICON(Skin.AROUND_2010, WidgetInfo.FIXED_VIEWPORT_PRAYER_ICON, 178, 1, null, null),
|
FIXED_2010_PRAYER_ICON(Skin.AROUND_2010, WidgetInfo.FIXED_VIEWPORT_PRAYER_ICON, 178, 1, null, null),
|
||||||
FIXED_2010_MAGIC_HIGHLIGHT(Skin.AROUND_2010, WidgetInfo.FIXED_VIEWPORT_MAGIC_TAB, 211, 1, null, null),
|
FIXED_2010_MAGIC_HIGHLIGHT(Skin.AROUND_2010, WidgetInfo.FIXED_VIEWPORT_MAGIC_TAB, 211, 1, null, null),
|
||||||
FIXED_2010_MAGIC_ICON(Skin.AROUND_2010, WidgetInfo.FIXED_VIEWPORT_MAGIC_ICON, 212, 1, null, null),
|
FIXED_2010_MAGIC_ICON(Skin.AROUND_2010, WidgetInfo.FIXED_VIEWPORT_MAGIC_ICON, 212, 1, null, null),
|
||||||
FIXED_2010_CLAN_CHAT_HIGHLIGHT(Skin.AROUND_2010, WidgetInfo.FIXED_VIEWPORT_CLAN_CHAT_TAB, 0, 1, null, null),
|
FIXED_2010_FRIENDS_CHAT_HIGHLIGHT(Skin.AROUND_2010, WidgetInfo.FIXED_VIEWPORT_FRIENDS_CHAT_TAB, 0, 1, null, null),
|
||||||
FIXED_2010_CLAN_CHAT_ICON(Skin.AROUND_2010, WidgetInfo.FIXED_VIEWPORT_CLAN_CHAT_ICON, 5, null, null, null),
|
FIXED_2010_FRIENDS_CHAT_ICON(Skin.AROUND_2010, WidgetInfo.FIXED_VIEWPORT_FRIENDS_CHAT_ICON, 5, null, null, null),
|
||||||
FIXED_2010_FRIENDS_HIGHLIGHT(Skin.AROUND_2010, WidgetInfo.FIXED_VIEWPORT_FRIENDS_TAB, 38, 1, 33, null),
|
FIXED_2010_FRIENDS_HIGHLIGHT(Skin.AROUND_2010, WidgetInfo.FIXED_VIEWPORT_FRIENDS_TAB, 38, 1, 33, null),
|
||||||
FIXED_2010_FRIENDS_ICON(Skin.AROUND_2010, WidgetInfo.FIXED_VIEWPORT_FRIENDS_ICON, 40, null, null, null),
|
FIXED_2010_FRIENDS_ICON(Skin.AROUND_2010, WidgetInfo.FIXED_VIEWPORT_FRIENDS_ICON, 40, null, null, null),
|
||||||
FIXED_2010_IGNORES_HIGHLIGHT(Skin.AROUND_2010, WidgetInfo.FIXED_VIEWPORT_IGNORES_TAB, 72, 1, null, null),
|
FIXED_2010_IGNORES_HIGHLIGHT(Skin.AROUND_2010, WidgetInfo.FIXED_VIEWPORT_IGNORES_TAB, 72, 1, null, null),
|
||||||
@@ -131,8 +131,8 @@ enum WidgetOffset
|
|||||||
FIXED_2005_PRAYER_ICON(Skin.AROUND_2005, WidgetInfo.FIXED_VIEWPORT_PRAYER_ICON, 178, null, null, null),
|
FIXED_2005_PRAYER_ICON(Skin.AROUND_2005, WidgetInfo.FIXED_VIEWPORT_PRAYER_ICON, 178, null, null, null),
|
||||||
FIXED_2005_MAGIC_HIGHLIGHT(Skin.AROUND_2005, WidgetInfo.FIXED_VIEWPORT_MAGIC_TAB, 209, 1, 30, null),
|
FIXED_2005_MAGIC_HIGHLIGHT(Skin.AROUND_2005, WidgetInfo.FIXED_VIEWPORT_MAGIC_TAB, 209, 1, 30, null),
|
||||||
FIXED_2005_MAGIC_ICON(Skin.AROUND_2005, WidgetInfo.FIXED_VIEWPORT_MAGIC_ICON, 206, 2, null, null),
|
FIXED_2005_MAGIC_ICON(Skin.AROUND_2005, WidgetInfo.FIXED_VIEWPORT_MAGIC_ICON, 206, 2, null, null),
|
||||||
FIXED_2005_CLAN_CHAT_HIGHLIGHT(Skin.AROUND_2005, WidgetInfo.FIXED_VIEWPORT_CLAN_CHAT_TAB, 15, null, null, null),
|
FIXED_2005_FRIENDS_CHAT_HIGHLIGHT(Skin.AROUND_2005, WidgetInfo.FIXED_VIEWPORT_FRIENDS_CHAT_TAB, 15, null, null, null),
|
||||||
FIXED_2005_CLAN_CHAT_ICON(Skin.AROUND_2005, WidgetInfo.FIXED_VIEWPORT_CLAN_CHAT_ICON, 22, 0, null, null),
|
FIXED_2005_FRIENDS_CHAT_ICON(Skin.AROUND_2005, WidgetInfo.FIXED_VIEWPORT_FRIENDS_CHAT_ICON, 22, 0, null, null),
|
||||||
FIXED_2005_FRIENDS_HIGHLIGHT(Skin.AROUND_2005, WidgetInfo.FIXED_VIEWPORT_FRIENDS_TAB, 51, null, 30, null),
|
FIXED_2005_FRIENDS_HIGHLIGHT(Skin.AROUND_2005, WidgetInfo.FIXED_VIEWPORT_FRIENDS_TAB, 51, null, 30, null),
|
||||||
FIXED_2005_FRIENDS_ICON(Skin.AROUND_2005, WidgetInfo.FIXED_VIEWPORT_FRIENDS_ICON, 49, -1, null, null),
|
FIXED_2005_FRIENDS_ICON(Skin.AROUND_2005, WidgetInfo.FIXED_VIEWPORT_FRIENDS_ICON, 49, -1, null, null),
|
||||||
FIXED_2005_IGNORES_HIGHLIGHT(Skin.AROUND_2005, WidgetInfo.FIXED_VIEWPORT_IGNORES_TAB, 79, null, 30, null),
|
FIXED_2005_IGNORES_HIGHLIGHT(Skin.AROUND_2005, WidgetInfo.FIXED_VIEWPORT_IGNORES_TAB, 79, null, 30, null),
|
||||||
@@ -163,8 +163,8 @@ enum WidgetOffset
|
|||||||
FIXED_2006_PRAYER_ICON(Skin.AROUND_2006, WidgetInfo.FIXED_VIEWPORT_PRAYER_ICON, 180, 2, null, null),
|
FIXED_2006_PRAYER_ICON(Skin.AROUND_2006, WidgetInfo.FIXED_VIEWPORT_PRAYER_ICON, 180, 2, null, null),
|
||||||
FIXED_2006_MAGIC_HIGHLIGHT(Skin.AROUND_2006, WidgetInfo.FIXED_VIEWPORT_MAGIC_TAB, 209, 1, 30, null),
|
FIXED_2006_MAGIC_HIGHLIGHT(Skin.AROUND_2006, WidgetInfo.FIXED_VIEWPORT_MAGIC_TAB, 209, 1, 30, null),
|
||||||
FIXED_2006_MAGIC_ICON(Skin.AROUND_2006, WidgetInfo.FIXED_VIEWPORT_MAGIC_ICON, 207, 4, null, null),
|
FIXED_2006_MAGIC_ICON(Skin.AROUND_2006, WidgetInfo.FIXED_VIEWPORT_MAGIC_ICON, 207, 4, null, null),
|
||||||
FIXED_2006_CLAN_CHAT_HIGHLIGHT(Skin.AROUND_2006, WidgetInfo.FIXED_VIEWPORT_CLAN_CHAT_TAB, 15, null, null, null),
|
FIXED_2006_FRIENDS_CHAT_HIGHLIGHT(Skin.AROUND_2006, WidgetInfo.FIXED_VIEWPORT_FRIENDS_CHAT_TAB, 15, null, null, null),
|
||||||
FIXED_2006_CLAN_CHAT_ICON(Skin.AROUND_2006, WidgetInfo.FIXED_VIEWPORT_CLAN_CHAT_ICON, 22, -1, null, null),
|
FIXED_2006_FRIENDS_CHAT_ICON(Skin.AROUND_2006, WidgetInfo.FIXED_VIEWPORT_FRIENDS_CHAT_ICON, 22, -1, null, null),
|
||||||
FIXED_2006_FRIENDS_HIGHLIGHT(Skin.AROUND_2006, WidgetInfo.FIXED_VIEWPORT_FRIENDS_TAB, 51, null, 30, null),
|
FIXED_2006_FRIENDS_HIGHLIGHT(Skin.AROUND_2006, WidgetInfo.FIXED_VIEWPORT_FRIENDS_TAB, 51, null, 30, null),
|
||||||
FIXED_2006_FRIENDS_ICON(Skin.AROUND_2006, WidgetInfo.FIXED_VIEWPORT_FRIENDS_ICON, 49, 1, null, null),
|
FIXED_2006_FRIENDS_ICON(Skin.AROUND_2006, WidgetInfo.FIXED_VIEWPORT_FRIENDS_ICON, 49, 1, null, null),
|
||||||
FIXED_2006_IGNORES_HIGHLIGHT(Skin.AROUND_2006, WidgetInfo.FIXED_VIEWPORT_IGNORES_TAB, 79, null, 30, null),
|
FIXED_2006_IGNORES_HIGHLIGHT(Skin.AROUND_2006, WidgetInfo.FIXED_VIEWPORT_IGNORES_TAB, 79, null, 30, null),
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ enum WidgetOverride
|
|||||||
{
|
{
|
||||||
FIXED_CORNER_TOP_LEFT_2005(Skin.AROUND_2005, "1026", WidgetInfo.FIXED_VIEWPORT_COMBAT_TAB),
|
FIXED_CORNER_TOP_LEFT_2005(Skin.AROUND_2005, "1026", WidgetInfo.FIXED_VIEWPORT_COMBAT_TAB),
|
||||||
FIXED_CORNER_TOP_RIGHT_2005(Skin.AROUND_2005, "1027", WidgetInfo.FIXED_VIEWPORT_MAGIC_TAB),
|
FIXED_CORNER_TOP_RIGHT_2005(Skin.AROUND_2005, "1027", WidgetInfo.FIXED_VIEWPORT_MAGIC_TAB),
|
||||||
FIXED_CORNER_BOTTOM_LEFT_2005(Skin.AROUND_2005, "1028", WidgetInfo.FIXED_VIEWPORT_CLAN_CHAT_TAB),
|
FIXED_CORNER_BOTTOM_LEFT_2005(Skin.AROUND_2005, "1028", WidgetInfo.FIXED_VIEWPORT_FRIENDS_CHAT_TAB),
|
||||||
FIXED_CORNER_BOTTOM_RIGHT_2005(Skin.AROUND_2005, "1029", WidgetInfo.FIXED_VIEWPORT_MUSIC_TAB),
|
FIXED_CORNER_BOTTOM_RIGHT_2005(Skin.AROUND_2005, "1029", WidgetInfo.FIXED_VIEWPORT_MUSIC_TAB),
|
||||||
FIXED_TOP_LEFT_2005(Skin.AROUND_2005, "1030_top_left", WidgetInfo.FIXED_VIEWPORT_STATS_TAB, WidgetInfo.FIXED_VIEWPORT_QUESTS_TAB),
|
FIXED_TOP_LEFT_2005(Skin.AROUND_2005, "1030_top_left", WidgetInfo.FIXED_VIEWPORT_STATS_TAB, WidgetInfo.FIXED_VIEWPORT_QUESTS_TAB),
|
||||||
FIXED_TOP_RIGHT_2005(Skin.AROUND_2005, "1030_top_right", WidgetInfo.FIXED_VIEWPORT_EQUIPMENT_TAB, WidgetInfo.FIXED_VIEWPORT_PRAYER_TAB),
|
FIXED_TOP_RIGHT_2005(Skin.AROUND_2005, "1030_top_right", WidgetInfo.FIXED_VIEWPORT_EQUIPMENT_TAB, WidgetInfo.FIXED_VIEWPORT_PRAYER_TAB),
|
||||||
|
|||||||
@@ -30,8 +30,8 @@ import java.util.Arrays;
|
|||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import net.runelite.api.ChatPlayer;
|
import net.runelite.api.ChatPlayer;
|
||||||
import net.runelite.api.ClanMember;
|
import net.runelite.api.FriendsChatMember;
|
||||||
import net.runelite.api.ClanMemberManager;
|
import net.runelite.api.FriendsChatManager;
|
||||||
import net.runelite.api.Client;
|
import net.runelite.api.Client;
|
||||||
import net.runelite.api.Friend;
|
import net.runelite.api.Friend;
|
||||||
import net.runelite.api.GameState;
|
import net.runelite.api.GameState;
|
||||||
@@ -145,7 +145,7 @@ public class LeagueChatIconsPlugin extends Plugin
|
|||||||
{
|
{
|
||||||
case PRIVATECHAT:
|
case PRIVATECHAT:
|
||||||
case MODPRIVATECHAT:
|
case MODPRIVATECHAT:
|
||||||
// Note this is unable to change icon on PMs if they are not a friend or in clan chat
|
// Note this is unable to change icon on PMs if they are not a friend or in friends chat
|
||||||
case FRIENDSCHAT:
|
case FRIENDSCHAT:
|
||||||
String name = Text.removeTags(chatMessage.getName());
|
String name = Text.removeTags(chatMessage.getName());
|
||||||
if (isChatPlayerOnLeague(name))
|
if (isChatPlayerOnLeague(name))
|
||||||
@@ -265,7 +265,7 @@ public class LeagueChatIconsPlugin extends Plugin
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if a player name is a friend or clan member on a league world.
|
* Checks if a player name is a friend or friends chat member on a league world.
|
||||||
*
|
*
|
||||||
* @param name name of player to check.
|
* @param name name of player to check.
|
||||||
* @return boolean true/false.
|
* @return boolean true/false.
|
||||||
@@ -325,22 +325,22 @@ public class LeagueChatIconsPlugin extends Plugin
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets a ChatPlayer object from a clean name by searching clan and friends list.
|
* Gets a ChatPlayer object from a clean name by searching friends chat and friends list.
|
||||||
*
|
*
|
||||||
* @param name name of player to find.
|
* @param name name of player to find.
|
||||||
* @return ChatPlayer if found, else null.
|
* @return ChatPlayer if found, else null.
|
||||||
*/
|
*/
|
||||||
private ChatPlayer getChatPlayerFromName(String name)
|
private ChatPlayer getChatPlayerFromName(String name)
|
||||||
{
|
{
|
||||||
// Search clan members first, because if a friend is in the clan chat but their private
|
// Search friends chat members first, because we will be able to get the world if their private
|
||||||
// chat is 'off', then we won't know the world
|
// is off.
|
||||||
ClanMemberManager clanMemberManager = client.getClanMemberManager();
|
FriendsChatManager friendsChatManager = client.getFriendsChatManager();
|
||||||
if (clanMemberManager != null)
|
if (friendsChatManager != null)
|
||||||
{
|
{
|
||||||
ClanMember clanMember = clanMemberManager.findByName(name);
|
FriendsChatMember member = friendsChatManager.findByName(name);
|
||||||
if (clanMember != null)
|
if (member != null)
|
||||||
{
|
{
|
||||||
return clanMember;
|
return member;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -84,10 +84,10 @@ public interface MinimapConfig extends Config
|
|||||||
|
|
||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
keyName = "clan",
|
keyName = "clan",
|
||||||
name = "Clan color",
|
name = "Friends Chat color",
|
||||||
description = "Set the minimap color your clan is drawn in"
|
description = "Set the minimap color your friends chat members are drawn in"
|
||||||
)
|
)
|
||||||
default Color clanColor() //mapdot 5
|
default Color friendsChatColor() //mapdot 5
|
||||||
{
|
{
|
||||||
return new Color(170, 0, 190);
|
return new Color(170, 0, 190);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -164,7 +164,7 @@ public class MinimapPlugin extends Plugin
|
|||||||
colors[2] = config.playerColor();
|
colors[2] = config.playerColor();
|
||||||
colors[3] = config.friendColor();
|
colors[3] = config.friendColor();
|
||||||
colors[4] = config.teamColor();
|
colors[4] = config.teamColor();
|
||||||
colors[5] = config.clanColor();
|
colors[5] = config.friendsChatColor();
|
||||||
return colors;
|
return colors;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -91,11 +91,11 @@ public interface PlayerIndicatorsConfig extends Config
|
|||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
position = 4,
|
position = 4,
|
||||||
keyName = "drawClanMemberNames",
|
keyName = "drawClanMemberNames",
|
||||||
name = "Highlight clan members",
|
name = "Highlight friends chat members",
|
||||||
description = "Configures whether or clan members should be highlighted",
|
description = "Configures if friends chat members should be highlighted",
|
||||||
section = highlightSection
|
section = highlightSection
|
||||||
)
|
)
|
||||||
default boolean drawClanMemberNames()
|
default boolean drawFriendsChatMemberNames()
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -103,11 +103,11 @@ public interface PlayerIndicatorsConfig extends Config
|
|||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
position = 5,
|
position = 5,
|
||||||
keyName = "clanMemberColor",
|
keyName = "clanMemberColor",
|
||||||
name = "Clan member color",
|
name = "Friends chat member color",
|
||||||
description = "Color of clan members",
|
description = "Color of friends chat members",
|
||||||
section = highlightSection
|
section = highlightSection
|
||||||
)
|
)
|
||||||
default Color getClanMemberColor()
|
default Color getFriendsChatMemberColor()
|
||||||
{
|
{
|
||||||
return new Color(170, 0, 255);
|
return new Color(170, 0, 255);
|
||||||
}
|
}
|
||||||
@@ -139,11 +139,11 @@ public interface PlayerIndicatorsConfig extends Config
|
|||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
position = 8,
|
position = 8,
|
||||||
keyName = "drawNonClanMemberNames",
|
keyName = "drawNonClanMemberNames",
|
||||||
name = "Highlight non-clan members",
|
name = "Highlight others",
|
||||||
description = "Configures whether or not non-clan members should be highlighted",
|
description = "Configures whether or not other players should be highlighted",
|
||||||
section = highlightSection
|
section = highlightSection
|
||||||
)
|
)
|
||||||
default boolean highlightNonClanMembers()
|
default boolean highlightOthers()
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -151,11 +151,11 @@ public interface PlayerIndicatorsConfig extends Config
|
|||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
position = 9,
|
position = 9,
|
||||||
keyName = "nonClanMemberColor",
|
keyName = "nonClanMemberColor",
|
||||||
name = "Non-clan member color",
|
name = "Others color",
|
||||||
description = "Color of non-clan member names",
|
description = "Color of other players names",
|
||||||
section = highlightSection
|
section = highlightSection
|
||||||
)
|
)
|
||||||
default Color getNonClanMemberColor()
|
default Color getOthersColor()
|
||||||
{
|
{
|
||||||
return Color.RED;
|
return Color.RED;
|
||||||
}
|
}
|
||||||
@@ -207,10 +207,10 @@ public interface PlayerIndicatorsConfig extends Config
|
|||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
position = 14,
|
position = 14,
|
||||||
keyName = "clanMenuIcons",
|
keyName = "clanMenuIcons",
|
||||||
name = "Show clan ranks",
|
name = "Show friends chat ranks",
|
||||||
description = "Add clan rank to right click menu and next to player names"
|
description = "Add friends chat rank to right click menu and next to player names"
|
||||||
)
|
)
|
||||||
default boolean showClanRanks()
|
default boolean showFriendsChatRanks()
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,10 +31,10 @@ import java.awt.Graphics2D;
|
|||||||
import java.awt.image.BufferedImage;
|
import java.awt.image.BufferedImage;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
import javax.inject.Singleton;
|
import javax.inject.Singleton;
|
||||||
import net.runelite.api.ClanMemberRank;
|
import net.runelite.api.FriendsChatRank;
|
||||||
import net.runelite.api.Player;
|
import net.runelite.api.Player;
|
||||||
import net.runelite.api.Point;
|
import net.runelite.api.Point;
|
||||||
import net.runelite.client.game.ClanManager;
|
import net.runelite.client.game.FriendChatManager;
|
||||||
import net.runelite.client.ui.overlay.Overlay;
|
import net.runelite.client.ui.overlay.Overlay;
|
||||||
import net.runelite.client.ui.overlay.OverlayPosition;
|
import net.runelite.client.ui.overlay.OverlayPosition;
|
||||||
import net.runelite.client.ui.overlay.OverlayPriority;
|
import net.runelite.client.ui.overlay.OverlayPriority;
|
||||||
@@ -49,15 +49,15 @@ public class PlayerIndicatorsOverlay extends Overlay
|
|||||||
|
|
||||||
private final PlayerIndicatorsService playerIndicatorsService;
|
private final PlayerIndicatorsService playerIndicatorsService;
|
||||||
private final PlayerIndicatorsConfig config;
|
private final PlayerIndicatorsConfig config;
|
||||||
private final ClanManager clanManager;
|
private final FriendChatManager friendChatManager;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private PlayerIndicatorsOverlay(PlayerIndicatorsConfig config, PlayerIndicatorsService playerIndicatorsService,
|
private PlayerIndicatorsOverlay(PlayerIndicatorsConfig config, PlayerIndicatorsService playerIndicatorsService,
|
||||||
ClanManager clanManager)
|
FriendChatManager friendChatManager)
|
||||||
{
|
{
|
||||||
this.config = config;
|
this.config = config;
|
||||||
this.playerIndicatorsService = playerIndicatorsService;
|
this.playerIndicatorsService = playerIndicatorsService;
|
||||||
this.clanManager = clanManager;
|
this.friendChatManager = friendChatManager;
|
||||||
setPosition(OverlayPosition.DYNAMIC);
|
setPosition(OverlayPosition.DYNAMIC);
|
||||||
setPriority(OverlayPriority.MED);
|
setPriority(OverlayPriority.MED);
|
||||||
}
|
}
|
||||||
@@ -108,37 +108,37 @@ public class PlayerIndicatorsOverlay extends Overlay
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config.showClanRanks() && actor.isClanMember())
|
if (config.showFriendsChatRanks() && actor.isFriendsChatMember())
|
||||||
{
|
{
|
||||||
final ClanMemberRank rank = clanManager.getRank(name);
|
final FriendsChatRank rank = friendChatManager.getRank(name);
|
||||||
|
|
||||||
if (rank != ClanMemberRank.UNRANKED)
|
if (rank != FriendsChatRank.UNRANKED)
|
||||||
{
|
{
|
||||||
final BufferedImage clanchatImage = clanManager.getClanImage(rank);
|
final BufferedImage rankImage = friendChatManager.getRankImage(rank);
|
||||||
|
|
||||||
if (clanchatImage != null)
|
if (rankImage != null)
|
||||||
{
|
{
|
||||||
final int clanImageWidth = clanchatImage.getWidth();
|
final int imageWidth = rankImage.getWidth();
|
||||||
final int clanImageTextMargin;
|
final int imageTextMargin;
|
||||||
final int clanImageNegativeMargin;
|
final int imageNegativeMargin;
|
||||||
|
|
||||||
if (drawPlayerNamesConfig == PlayerNameLocation.MODEL_RIGHT)
|
if (drawPlayerNamesConfig == PlayerNameLocation.MODEL_RIGHT)
|
||||||
{
|
{
|
||||||
clanImageTextMargin = clanImageWidth;
|
imageTextMargin = imageWidth;
|
||||||
clanImageNegativeMargin = 0;
|
imageNegativeMargin = 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
clanImageTextMargin = clanImageWidth / 2;
|
imageTextMargin = imageWidth / 2;
|
||||||
clanImageNegativeMargin = clanImageWidth / 2;
|
imageNegativeMargin = imageWidth / 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
final int textHeight = graphics.getFontMetrics().getHeight() - graphics.getFontMetrics().getMaxDescent();
|
final int textHeight = graphics.getFontMetrics().getHeight() - graphics.getFontMetrics().getMaxDescent();
|
||||||
final Point imageLocation = new Point(textLocation.getX() - clanImageNegativeMargin - 1, textLocation.getY() - textHeight / 2 - clanchatImage.getHeight() / 2);
|
final Point imageLocation = new Point(textLocation.getX() - imageNegativeMargin - 1, textLocation.getY() - textHeight / 2 - rankImage.getHeight() / 2);
|
||||||
OverlayUtil.renderImageLocation(graphics, imageLocation, clanchatImage);
|
OverlayUtil.renderImageLocation(graphics, imageLocation, rankImage);
|
||||||
|
|
||||||
// move text
|
// move text
|
||||||
textLocation = new Point(textLocation.getX() + clanImageTextMargin, textLocation.getY());
|
textLocation = new Point(textLocation.getX() + imageTextMargin, textLocation.getY());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,8 +28,8 @@ import com.google.inject.Provides;
|
|||||||
import java.awt.Color;
|
import java.awt.Color;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
import lombok.Value;
|
import lombok.Value;
|
||||||
import net.runelite.api.ClanMemberRank;
|
import net.runelite.api.FriendsChatRank;
|
||||||
import static net.runelite.api.ClanMemberRank.UNRANKED;
|
import static net.runelite.api.FriendsChatRank.UNRANKED;
|
||||||
import net.runelite.api.Client;
|
import net.runelite.api.Client;
|
||||||
import static net.runelite.api.MenuAction.*;
|
import static net.runelite.api.MenuAction.*;
|
||||||
import net.runelite.api.MenuEntry;
|
import net.runelite.api.MenuEntry;
|
||||||
@@ -37,7 +37,7 @@ import net.runelite.api.Player;
|
|||||||
import net.runelite.api.events.ClientTick;
|
import net.runelite.api.events.ClientTick;
|
||||||
import net.runelite.client.config.ConfigManager;
|
import net.runelite.client.config.ConfigManager;
|
||||||
import net.runelite.client.eventbus.Subscribe;
|
import net.runelite.client.eventbus.Subscribe;
|
||||||
import net.runelite.client.game.ClanManager;
|
import net.runelite.client.game.FriendChatManager;
|
||||||
import net.runelite.client.plugins.Plugin;
|
import net.runelite.client.plugins.Plugin;
|
||||||
import net.runelite.client.plugins.PluginDescriptor;
|
import net.runelite.client.plugins.PluginDescriptor;
|
||||||
import net.runelite.client.ui.overlay.OverlayManager;
|
import net.runelite.client.ui.overlay.OverlayManager;
|
||||||
@@ -69,7 +69,7 @@ public class PlayerIndicatorsPlugin extends Plugin
|
|||||||
private Client client;
|
private Client client;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private ClanManager clanManager;
|
private FriendChatManager friendChatManager;
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
PlayerIndicatorsConfig provideConfig(ConfigManager configManager)
|
PlayerIndicatorsConfig provideConfig(ConfigManager configManager)
|
||||||
@@ -178,14 +178,14 @@ public class PlayerIndicatorsPlugin extends Plugin
|
|||||||
{
|
{
|
||||||
color = config.getFriendColor();
|
color = config.getFriendColor();
|
||||||
}
|
}
|
||||||
else if (config.drawClanMemberNames() && player.isClanMember())
|
else if (config.drawFriendsChatMemberNames() && player.isFriendsChatMember())
|
||||||
{
|
{
|
||||||
color = config.getClanMemberColor();
|
color = config.getFriendsChatMemberColor();
|
||||||
|
|
||||||
ClanMemberRank rank = clanManager.getRank(player.getName());
|
FriendsChatRank rank = friendChatManager.getRank(player.getName());
|
||||||
if (rank != UNRANKED)
|
if (rank != UNRANKED)
|
||||||
{
|
{
|
||||||
image = clanManager.getIconNumber(rank);
|
image = friendChatManager.getIconNumber(rank);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (config.highlightTeamMembers()
|
else if (config.highlightTeamMembers()
|
||||||
@@ -193,9 +193,9 @@ public class PlayerIndicatorsPlugin extends Plugin
|
|||||||
{
|
{
|
||||||
color = config.getTeamMemberColor();
|
color = config.getTeamMemberColor();
|
||||||
}
|
}
|
||||||
else if (config.highlightNonClanMembers() && !player.isClanMember())
|
else if (config.highlightOthers() && !player.isFriendsChatMember())
|
||||||
{
|
{
|
||||||
color = config.getNonClanMemberColor();
|
color = config.getOthersColor();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (image == -1 && color == null)
|
if (image == -1 && color == null)
|
||||||
@@ -222,7 +222,7 @@ public class PlayerIndicatorsPlugin extends Plugin
|
|||||||
newTarget = ColorUtil.prependColorTag(newTarget, decorations.getColor());
|
newTarget = ColorUtil.prependColorTag(newTarget, decorations.getColor());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (decorations.getImage() != -1 && config.showClanRanks())
|
if (decorations.getImage() != -1 && config.showFriendsChatRanks())
|
||||||
{
|
{
|
||||||
newTarget = "<img=" + decorations.getImage() + ">" + newTarget;
|
newTarget = "<img=" + decorations.getImage() + ">" + newTarget;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,8 +46,8 @@ public class PlayerIndicatorsService
|
|||||||
|
|
||||||
public void forEachPlayer(final BiConsumer<Player, Color> consumer)
|
public void forEachPlayer(final BiConsumer<Player, Color> consumer)
|
||||||
{
|
{
|
||||||
if (!config.highlightOwnPlayer() && !config.drawClanMemberNames()
|
if (!config.highlightOwnPlayer() && !config.drawFriendsChatMemberNames()
|
||||||
&& !config.highlightFriends() && !config.highlightNonClanMembers())
|
&& !config.highlightFriends() && !config.highlightOthers())
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -61,7 +61,7 @@ public class PlayerIndicatorsService
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean isClanMember = player.isClanMember();
|
boolean isFriendsChatMember = player.isFriendsChatMember();
|
||||||
|
|
||||||
if (player == localPlayer)
|
if (player == localPlayer)
|
||||||
{
|
{
|
||||||
@@ -74,17 +74,17 @@ public class PlayerIndicatorsService
|
|||||||
{
|
{
|
||||||
consumer.accept(player, config.getFriendColor());
|
consumer.accept(player, config.getFriendColor());
|
||||||
}
|
}
|
||||||
else if (config.drawClanMemberNames() && isClanMember)
|
else if (config.drawFriendsChatMemberNames() && isFriendsChatMember)
|
||||||
{
|
{
|
||||||
consumer.accept(player, config.getClanMemberColor());
|
consumer.accept(player, config.getFriendsChatMemberColor());
|
||||||
}
|
}
|
||||||
else if (config.highlightTeamMembers() && localPlayer.getTeam() > 0 && localPlayer.getTeam() == player.getTeam())
|
else if (config.highlightTeamMembers() && localPlayer.getTeam() > 0 && localPlayer.getTeam() == player.getTeam())
|
||||||
{
|
{
|
||||||
consumer.accept(player, config.getTeamMemberColor());
|
consumer.accept(player, config.getTeamMemberColor());
|
||||||
}
|
}
|
||||||
else if (config.highlightNonClanMembers() && !isClanMember)
|
else if (config.highlightOthers() && !isFriendsChatMember)
|
||||||
{
|
{
|
||||||
consumer.accept(player, config.getNonClanMemberColor());
|
consumer.accept(player, config.getOthersColor());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -91,10 +91,10 @@ public interface RaidsConfig extends Config
|
|||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
position = 5,
|
position = 5,
|
||||||
keyName = "ccDisplay",
|
keyName = "ccDisplay",
|
||||||
name = "CC and World in scout overlay",
|
name = "FC and World in scout overlay",
|
||||||
description = "Display current Clan Chat and World in scouting overlay"
|
description = "Display current Friends Chat and World in scouting overlay"
|
||||||
)
|
)
|
||||||
default boolean ccDisplay()
|
default boolean fcDisplay()
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ import java.awt.FontMetrics;
|
|||||||
import java.awt.Graphics2D;
|
import java.awt.Graphics2D;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import net.runelite.api.ClanMemberManager;
|
import net.runelite.api.FriendsChatManager;
|
||||||
import net.runelite.api.Client;
|
import net.runelite.api.Client;
|
||||||
import static net.runelite.api.MenuAction.RUNELITE_OVERLAY;
|
import static net.runelite.api.MenuAction.RUNELITE_OVERLAY;
|
||||||
import static net.runelite.api.MenuAction.RUNELITE_OVERLAY_CONFIG;
|
import static net.runelite.api.MenuAction.RUNELITE_OVERLAY_CONFIG;
|
||||||
@@ -101,10 +101,10 @@ public class RaidsOverlay extends OverlayPanel
|
|||||||
.color(color)
|
.color(color)
|
||||||
.build());
|
.build());
|
||||||
|
|
||||||
if (config.ccDisplay())
|
if (config.fcDisplay())
|
||||||
{
|
{
|
||||||
color = Color.RED;
|
color = Color.RED;
|
||||||
ClanMemberManager clanMemberManager = client.getClanMemberManager();
|
FriendsChatManager friendsChatManager = client.getFriendsChatManager();
|
||||||
FontMetrics metrics = graphics.getFontMetrics();
|
FontMetrics metrics = graphics.getFontMetrics();
|
||||||
|
|
||||||
String worldString = "W" + client.getWorld();
|
String worldString = "W" + client.getWorld();
|
||||||
@@ -120,17 +120,17 @@ public class RaidsOverlay extends OverlayPanel
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
String clanOwner = "Join a CC";
|
String owner = "Join a FC";
|
||||||
if (clanMemberManager != null)
|
if (friendsChatManager != null)
|
||||||
{
|
{
|
||||||
clanOwner = clanMemberManager.getClanOwner();
|
owner = friendsChatManager.getOwner();
|
||||||
color = Color.ORANGE;
|
color = Color.ORANGE;
|
||||||
}
|
}
|
||||||
|
|
||||||
panelComponent.setPreferredSize(new Dimension(Math.max(ComponentConstants.STANDARD_WIDTH, metrics.stringWidth(worldString) + metrics.stringWidth(clanOwner) + 14), 0));
|
panelComponent.setPreferredSize(new Dimension(Math.max(ComponentConstants.STANDARD_WIDTH, metrics.stringWidth(worldString) + metrics.stringWidth(owner) + 14), 0));
|
||||||
panelComponent.getChildren().add(LineComponent.builder()
|
panelComponent.getChildren().add(LineComponent.builder()
|
||||||
.left(worldString)
|
.left(worldString)
|
||||||
.right(clanOwner)
|
.right(owner)
|
||||||
.leftColor(Color.ORANGE)
|
.leftColor(Color.ORANGE)
|
||||||
.rightColor(color)
|
.rightColor(color)
|
||||||
.build());
|
.build());
|
||||||
|
|||||||
@@ -201,8 +201,8 @@ public class RaidsPlugin extends Plugin
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* if the player is in a raid party or not
|
* if the player is in a raid party or not
|
||||||
* This will be set when someone in the clan chat clicks the "make party" button on the raids widget
|
* This will be set when someone in the friends chat clicks the "make party" button on the raids widget
|
||||||
* It will change again when someone from your clan enters the raid to generate it
|
* It will change again when someone from your friends chat enters the raid to generate it
|
||||||
* It will be reset when the raid starts but not if they leave the raid while it has not started yet
|
* It will be reset when the raid starts but not if they leave the raid while it has not started yet
|
||||||
*/
|
*/
|
||||||
@Getter
|
@Getter
|
||||||
|
|||||||
@@ -172,7 +172,7 @@ public interface ScreenshotConfig extends Config
|
|||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
keyName = "friendDeath",
|
keyName = "friendDeath",
|
||||||
name = "Screenshot Friend Deaths",
|
name = "Screenshot Friend Deaths",
|
||||||
description = "Configures whether or not screenshots are automatically taken when friends or clan members die.",
|
description = "Configures whether or not screenshots are automatically taken when friends or friends chat members die.",
|
||||||
position = 11,
|
position = 11,
|
||||||
section = whatSection
|
section = whatSection
|
||||||
)
|
)
|
||||||
@@ -219,12 +219,12 @@ public interface ScreenshotConfig extends Config
|
|||||||
|
|
||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
keyName = "ccKick",
|
keyName = "ccKick",
|
||||||
name = "Screenshot Kicks from CC",
|
name = "Screenshot Kicks from FC",
|
||||||
description = "Take a screenshot when you kick a user from a clan chat.",
|
description = "Take a screenshot when you kick a user from a friends chat.",
|
||||||
position = 15,
|
position = 15,
|
||||||
section = whatSection
|
section = whatSection
|
||||||
)
|
)
|
||||||
default boolean screenshotCcKick()
|
default boolean screenshotKick()
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -261,7 +261,7 @@ public class ScreenshotPlugin extends Plugin
|
|||||||
{
|
{
|
||||||
takeScreenshot("Death", "Deaths");
|
takeScreenshot("Death", "Deaths");
|
||||||
}
|
}
|
||||||
else if (player != client.getLocalPlayer() && (player.isClanMember() || player.isFriend()) && config.screenshotFriendDeath() && player.getCanvasTilePoly() != null)
|
else if (player != client.getLocalPlayer() && (player.isFriendsChatMember() || player.isFriend()) && config.screenshotFriendDeath() && player.getCanvasTilePoly() != null)
|
||||||
{
|
{
|
||||||
takeScreenshot("Death " + player.getName(), "Deaths");
|
takeScreenshot("Death " + player.getName(), "Deaths");
|
||||||
}
|
}
|
||||||
@@ -282,7 +282,7 @@ public class ScreenshotPlugin extends Plugin
|
|||||||
@Subscribe
|
@Subscribe
|
||||||
public void onScriptCallbackEvent(ScriptCallbackEvent e)
|
public void onScriptCallbackEvent(ScriptCallbackEvent e)
|
||||||
{
|
{
|
||||||
if (!"confirmClanKick".equals(e.getEventName()))
|
if (!"confirmFriendsChatKick".equals(e.getEventName()))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -356,14 +356,14 @@ public class ScreenshotPlugin extends Plugin
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config.screenshotCcKick() && chatMessage.equals("Your request to kick/ban this user was successful."))
|
if (config.screenshotKick() && chatMessage.equals("Your request to kick/ban this user was successful."))
|
||||||
{
|
{
|
||||||
if (kickPlayerName == null)
|
if (kickPlayerName == null)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
takeScreenshot("Kick " + kickPlayerName, "Clan Chat Kicks");
|
takeScreenshot("Kick " + kickPlayerName, "Friends Chat Kicks");
|
||||||
kickPlayerName = null;
|
kickPlayerName = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -117,7 +117,7 @@ public interface WorldHopperConfig extends Config
|
|||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
keyName = "menuOption",
|
keyName = "menuOption",
|
||||||
name = "Show Hop-to menu option",
|
name = "Show Hop-to menu option",
|
||||||
description = "Adds Hop-to menu option to the friends list and clan members list",
|
description = "Adds Hop-to menu option to the friends list and friends chat members list",
|
||||||
position = 7
|
position = 7
|
||||||
)
|
)
|
||||||
default boolean menuOption()
|
default boolean menuOption()
|
||||||
|
|||||||
@@ -48,8 +48,8 @@ import lombok.Getter;
|
|||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import net.runelite.api.ChatMessageType;
|
import net.runelite.api.ChatMessageType;
|
||||||
import net.runelite.api.ChatPlayer;
|
import net.runelite.api.ChatPlayer;
|
||||||
import net.runelite.api.ClanMember;
|
import net.runelite.api.FriendsChatMember;
|
||||||
import net.runelite.api.ClanMemberManager;
|
import net.runelite.api.FriendsChatManager;
|
||||||
import net.runelite.api.Client;
|
import net.runelite.api.Client;
|
||||||
import net.runelite.api.Friend;
|
import net.runelite.api.Friend;
|
||||||
import net.runelite.api.GameState;
|
import net.runelite.api.GameState;
|
||||||
@@ -356,7 +356,7 @@ public class WorldHopperPlugin extends Plugin
|
|||||||
int groupId = WidgetInfo.TO_GROUP(event.getActionParam1());
|
int groupId = WidgetInfo.TO_GROUP(event.getActionParam1());
|
||||||
String option = event.getOption();
|
String option = event.getOption();
|
||||||
|
|
||||||
if (groupId == WidgetInfo.FRIENDS_LIST.getGroupId() || groupId == WidgetInfo.CLAN_CHAT.getGroupId())
|
if (groupId == WidgetInfo.FRIENDS_LIST.getGroupId() || groupId == WidgetInfo.FRIENDS_CHAT.getGroupId())
|
||||||
{
|
{
|
||||||
boolean after;
|
boolean after;
|
||||||
|
|
||||||
@@ -730,15 +730,15 @@ public class WorldHopperPlugin extends Plugin
|
|||||||
{
|
{
|
||||||
String cleanName = Text.removeTags(name);
|
String cleanName = Text.removeTags(name);
|
||||||
|
|
||||||
// Search clan members first, because if a friend is in the clan chat but their private
|
// Search friends chat members first, because we can always get their world;
|
||||||
// chat is 'off', then the hop-to option will not get shown in the menu (issue #5679).
|
// friends worlds may be hidden if they have private off. (#5679)
|
||||||
ClanMemberManager clanMemberManager = client.getClanMemberManager();
|
FriendsChatManager friendsChatManager = client.getFriendsChatManager();
|
||||||
if (clanMemberManager != null)
|
if (friendsChatManager != null)
|
||||||
{
|
{
|
||||||
ClanMember clanMember = clanMemberManager.findByName(cleanName);
|
FriendsChatMember member = friendsChatManager.findByName(cleanName);
|
||||||
if (clanMember != null)
|
if (member != null)
|
||||||
{
|
{
|
||||||
return clanMember;
|
return member;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -36,8 +36,8 @@ public class JagexColors
|
|||||||
*/
|
*/
|
||||||
public static final Color CHAT_PUBLIC_TEXT_OPAQUE_BACKGROUND = Color.BLUE;
|
public static final Color CHAT_PUBLIC_TEXT_OPAQUE_BACKGROUND = Color.BLUE;
|
||||||
public static final Color CHAT_PRIVATE_MESSAGE_TEXT_OPAQUE_BACKGROUND = Color.CYAN;
|
public static final Color CHAT_PRIVATE_MESSAGE_TEXT_OPAQUE_BACKGROUND = Color.CYAN;
|
||||||
public static final Color CHAT_CLAN_TEXT_OPAQUE_BACKGROUND = new Color(127, 0, 0);
|
public static final Color CHAT_FC_TEXT_OPAQUE_BACKGROUND = new Color(127, 0, 0);
|
||||||
public static final Color CHAT_CLAN_NAME_OPAQUE_BACKGROUND = Color.BLUE;
|
public static final Color CHAT_FC_NAME_OPAQUE_BACKGROUND = Color.BLUE;
|
||||||
public static final Color CHAT_GAME_EXAMINE_TEXT_OPAQUE_BACKGROUND = Color.BLACK;
|
public static final Color CHAT_GAME_EXAMINE_TEXT_OPAQUE_BACKGROUND = Color.BLACK;
|
||||||
public static final Color CHAT_TYPED_TEXT_OPAQUE_BACKGROUND = Color.BLUE;
|
public static final Color CHAT_TYPED_TEXT_OPAQUE_BACKGROUND = Color.BLUE;
|
||||||
|
|
||||||
@@ -46,8 +46,8 @@ public class JagexColors
|
|||||||
*/
|
*/
|
||||||
public static final Color CHAT_PUBLIC_TEXT_TRANSPARENT_BACKGROUND = new Color(144, 144, 255);
|
public static final Color CHAT_PUBLIC_TEXT_TRANSPARENT_BACKGROUND = new Color(144, 144, 255);
|
||||||
public static final Color CHAT_PRIVATE_MESSAGE_TEXT_TRANSPARENT_BACKGROUND = Color.CYAN;
|
public static final Color CHAT_PRIVATE_MESSAGE_TEXT_TRANSPARENT_BACKGROUND = Color.CYAN;
|
||||||
public static final Color CHAT_CLAN_TEXT_TRANSPARENT_BACKGROUND = new Color(239, 80, 80);
|
public static final Color CHAT_FC_TEXT_TRANSPARENT_BACKGROUND = new Color(239, 80, 80);
|
||||||
public static final Color CHAT_CLAN_NAME_TRANSPARENT_BACKGROUND = new Color(144, 112, 255);
|
public static final Color CHAT_FC_NAME_TRANSPARENT_BACKGROUND = new Color(144, 112, 255);
|
||||||
public static final Color CHAT_GAME_EXAMINE_TEXT_TRANSPARENT_BACKGROUND = Color.WHITE;
|
public static final Color CHAT_GAME_EXAMINE_TEXT_TRANSPARENT_BACKGROUND = Color.WHITE;
|
||||||
public static final Color CHAT_TYPED_TEXT_TRANSPARENT_BACKGROUND = new Color(144, 144, 255);
|
public static final Color CHAT_TYPED_TEXT_TRANSPARENT_BACKGROUND = new Color(144, 144, 255);
|
||||||
|
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ LABEL20:
|
|||||||
iconst 1
|
iconst 1
|
||||||
if_icmpeq LABEL31
|
if_icmpeq LABEL31
|
||||||
iconst 0 ; Modified to enable clanchat input
|
iconst 0 ; Modified to enable clanchat input
|
||||||
sconst "clanchatInput"
|
sconst "friendsChatInput"
|
||||||
runelite_callback
|
runelite_callback
|
||||||
iconst 1
|
iconst 1
|
||||||
if_icmpeq LABEL31 ; Compare to 1
|
if_icmpeq LABEL31 ; Compare to 1
|
||||||
|
|||||||
@@ -3,9 +3,9 @@
|
|||||||
.string_stack_count 1
|
.string_stack_count 1
|
||||||
.int_var_count 0
|
.int_var_count 0
|
||||||
.string_var_count 1
|
.string_var_count 1
|
||||||
; callback "confirmClanKick"
|
; callback "confirmFriendsChatKick"
|
||||||
; Used by the ClanChat plugin to show a chatbox panel confirming the requested kick
|
; Used by the friends chat plugin to show a chatbox panel confirming the requested kick
|
||||||
; Also requires the "confirmKicks" option of ClanChatConfig to be enabled
|
; Also requires the "confirmKicks" option of FriendsChatConfig to be enabled
|
||||||
invoke 1942
|
invoke 1942
|
||||||
iconst 1
|
iconst 1
|
||||||
if_icmpeq LABEL4
|
if_icmpeq LABEL4
|
||||||
@@ -26,7 +26,7 @@ LABEL73:
|
|||||||
CONFIRM_KICK:
|
CONFIRM_KICK:
|
||||||
sload 0 ; Username we are trying to kick
|
sload 0 ; Username we are trying to kick
|
||||||
iconst 0 ; Modified if we are confirming the kick inside the plugin
|
iconst 0 ; Modified if we are confirming the kick inside the plugin
|
||||||
sconst "confirmClanKick"
|
sconst "confirmFriendsChatKick"
|
||||||
runelite_callback
|
runelite_callback
|
||||||
pop_string ; Pop username
|
pop_string ; Pop username
|
||||||
iconst 0 ; Compare against zero
|
iconst 0 ; Compare against zero
|
||||||
@@ -36,7 +36,7 @@ import net.runelite.api.MessageNode;
|
|||||||
import net.runelite.api.Player;
|
import net.runelite.api.Player;
|
||||||
import net.runelite.api.events.ChatMessage;
|
import net.runelite.api.events.ChatMessage;
|
||||||
import net.runelite.api.events.ScriptCallbackEvent;
|
import net.runelite.api.events.ScriptCallbackEvent;
|
||||||
import net.runelite.client.game.ClanManager;
|
import net.runelite.client.game.FriendChatManager;
|
||||||
import static net.runelite.client.plugins.chatfilter.ChatFilterPlugin.CENSOR_MESSAGE;
|
import static net.runelite.client.plugins.chatfilter.ChatFilterPlugin.CENSOR_MESSAGE;
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
import static org.junit.Assert.assertFalse;
|
import static org.junit.Assert.assertFalse;
|
||||||
@@ -63,7 +63,7 @@ public class ChatFilterPluginTest
|
|||||||
|
|
||||||
@Mock
|
@Mock
|
||||||
@Bind
|
@Bind
|
||||||
private ClanManager clanManager;
|
private FriendChatManager friendChatManager;
|
||||||
|
|
||||||
@Mock
|
@Mock
|
||||||
private Player localPlayer;
|
private Player localPlayer;
|
||||||
@@ -186,7 +186,7 @@ public class ChatFilterPluginTest
|
|||||||
@Test
|
@Test
|
||||||
public void testMessageFromFriendIsFiltered()
|
public void testMessageFromFriendIsFiltered()
|
||||||
{
|
{
|
||||||
when(clanManager.isClanMember("Iron Mammal")).thenReturn(false);
|
when(friendChatManager.isMember("Iron Mammal")).thenReturn(false);
|
||||||
when(chatFilterConfig.filterFriends()).thenReturn(true);
|
when(chatFilterConfig.filterFriends()).thenReturn(true);
|
||||||
assertTrue(chatFilterPlugin.shouldFilterPlayerMessage("Iron Mammal"));
|
assertTrue(chatFilterPlugin.shouldFilterPlayerMessage("Iron Mammal"));
|
||||||
}
|
}
|
||||||
@@ -200,18 +200,18 @@ public class ChatFilterPluginTest
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testMessageFromClanIsFiltered()
|
public void testMessageFromFriendsChatIsFiltered()
|
||||||
{
|
{
|
||||||
when(client.isFriended("B0aty", false)).thenReturn(false);
|
when(client.isFriended("B0aty", false)).thenReturn(false);
|
||||||
when(chatFilterConfig.filterClan()).thenReturn(true);
|
when(chatFilterConfig.filterFriendsChat()).thenReturn(true);
|
||||||
assertTrue(chatFilterPlugin.shouldFilterPlayerMessage("B0aty"));
|
assertTrue(chatFilterPlugin.shouldFilterPlayerMessage("B0aty"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testMessageFromClanIsNotFiltered()
|
public void testMessageFromFriendsChatIsNotFiltered()
|
||||||
{
|
{
|
||||||
when(clanManager.isClanMember("B0aty")).thenReturn(true);
|
when(friendChatManager.isMember("B0aty")).thenReturn(true);
|
||||||
when(chatFilterConfig.filterClan()).thenReturn(false);
|
when(chatFilterConfig.filterFriendsChat()).thenReturn(false);
|
||||||
assertFalse(chatFilterPlugin.shouldFilterPlayerMessage("B0aty"));
|
assertFalse(chatFilterPlugin.shouldFilterPlayerMessage("B0aty"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -223,10 +223,10 @@ public class ChatFilterPluginTest
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testMessageFromNonFriendNonClanIsFiltered()
|
public void testMessageFromNonFriendNonFCIsFiltered()
|
||||||
{
|
{
|
||||||
when(client.isFriended("Woox", false)).thenReturn(false);
|
when(client.isFriended("Woox", false)).thenReturn(false);
|
||||||
when(clanManager.isClanMember("Woox")).thenReturn(false);
|
when(friendChatManager.isMember("Woox")).thenReturn(false);
|
||||||
assertTrue(chatFilterPlugin.shouldFilterPlayerMessage("Woox"));
|
assertTrue(chatFilterPlugin.shouldFilterPlayerMessage("Woox"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user