From 1cf90b4feb9cc93d36e0147adc4e45647d731275 Mon Sep 17 00:00:00 2001 From: Max Weber Date: Tue, 18 May 2021 13:24:47 -0600 Subject: [PATCH] friendschat: remove user count this widget is gone, we can find a new place for it in the future maybe --- .../friendschat/FriendsChatPlugin.java | 26 +++++-------------- 1 file changed, 6 insertions(+), 20 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/friendschat/FriendsChatPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/friendschat/FriendsChatPlugin.java index b8cace077a..9ac986f02b 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/friendschat/FriendsChatPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/friendschat/FriendsChatPlugin.java @@ -284,27 +284,16 @@ public class FriendsChatPlugin extends Plugin return; } - Widget chatTitleWidget = client.getWidget(WidgetInfo.FRIENDS_CHAT_TITLE); - if (chatTitleWidget != null) + Widget chatList = client.getWidget(WidgetInfo.FRIENDS_CHAT_LIST); + if (chatList != null) { - Widget chatList = client.getWidget(WidgetInfo.FRIENDS_CHAT_LIST); Widget owner = client.getWidget(WidgetInfo.FRIENDS_CHAT_OWNER); FriendsChatManager friendsChatManager = client.getFriendsChatManager(); - if (friendsChatManager != null && friendsChatManager.getCount() > 0) + if ((friendsChatManager == null || friendsChatManager.getCount() <= 0) + && chatList.getChildren() == null && !Strings.isNullOrEmpty(owner.getText()) + && config.recentChats()) { - chatTitleWidget.setText(TITLE + " (" + friendsChatManager.getCount() + "/100)"); - } - else if (chatList.getChildren() == null && !Strings.isNullOrEmpty(owner.getText())) - { - if (config.recentChats()) - { - chatTitleWidget.setText(RECENT_TITLE); - loadFriendsChats(); - } - else - { - chatTitleWidget.setText(TITLE); - } + loadFriendsChats(); } } @@ -605,7 +594,6 @@ public class FriendsChatPlugin extends Plugin private void resetChats() { Widget chatList = client.getWidget(WidgetInfo.FRIENDS_CHAT_LIST); - Widget chatTitleWidget = client.getWidget(WidgetInfo.FRIENDS_CHAT_TITLE); if (chatList == null) { @@ -617,8 +605,6 @@ public class FriendsChatPlugin extends Plugin { chatList.setChildren(null); } - - chatTitleWidget.setText(TITLE); } private void loadFriendsChats()