mirror of
https://github.com/Melledy/LunarCore.git
synced 2025-12-12 13:24:36 +01:00
Add support for adding multiple display avatars for the server console friend
This commit is contained in:
@@ -160,8 +160,18 @@ public class Config {
|
||||
public int level = 1;
|
||||
public int headIcon = 201001;
|
||||
public int chatBubbleId = 0;
|
||||
public int displayAvatarId = 1001;
|
||||
public int displayAvatarLevel = 1;
|
||||
public List<ServerDisplayAvatar> displayAvatars = List.of(new ServerDisplayAvatar(1001, 1));
|
||||
|
||||
@Getter
|
||||
public static class ServerDisplayAvatar {
|
||||
public int avatarId;
|
||||
public int level;
|
||||
|
||||
public ServerDisplayAvatar(int avatarId, int level) {
|
||||
this.avatarId = avatarId;
|
||||
this.level = level;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Getter
|
||||
|
||||
@@ -30,12 +30,27 @@ public class PacketGetFriendListInfoScRsp extends BasePacket {
|
||||
.setChatBubbleId(serverFriendInfo.getChatBubbleId())
|
||||
.setOnlineStatus(FriendOnlineStatus.FRIEND_ONLINE_STATUS_ONLINE)
|
||||
.setPlatformType(PlatformType.PC)
|
||||
.addAssistSimpleInfo(AssistSimpleInfo.newInstance().setAvatarId(serverFriendInfo.getDisplayAvatarId()).setLevel(serverFriendInfo.getDisplayAvatarLevel()))
|
||||
.setHeadIcon(serverFriendInfo.getHeadIcon());
|
||||
|
||||
// Add server display avatars
|
||||
if (serverFriendInfo.getDisplayAvatars() != null) {
|
||||
for (int pos = 0; pos < serverFriendInfo.getDisplayAvatars().size(); pos++) {
|
||||
var displayAvatar = serverFriendInfo.getDisplayAvatars().get(pos);
|
||||
|
||||
var info = AssistSimpleInfo.newInstance()
|
||||
.setAvatarId(displayAvatar.getAvatarId())
|
||||
.setLevel(displayAvatar.getLevel())
|
||||
.setPos(pos);
|
||||
|
||||
consoleFriend.addAssistSimpleInfo(info);
|
||||
}
|
||||
}
|
||||
|
||||
// Create proto and add the server console info to it
|
||||
var data = GetFriendListInfoScRsp.newInstance()
|
||||
.addFriendList(FriendListInfo.newInstance().setSimpleInfo(consoleFriend));
|
||||
|
||||
// Add friend infos
|
||||
for (var friendship : friendList.getFriends().values()) {
|
||||
var friend = friendList.getServer().getPlayerByUid(friendship.getFriendUid(), true);
|
||||
if (friend == null) continue;
|
||||
|
||||
Reference in New Issue
Block a user