60 lines
1.8 KiB
C#
60 lines
1.8 KiB
C#
using System;
|
|
using Cute;
|
|
using UnityEngine;
|
|
|
|
namespace Wizard;
|
|
|
|
public class GatheringMemberPlate : UserPlateBase
|
|
{
|
|
[SerializeField]
|
|
private UIButton _friendRequestButton;
|
|
|
|
[SerializeField]
|
|
private UIButton _dropOutButton;
|
|
|
|
[SerializeField]
|
|
private UIButton _kickButton;
|
|
|
|
[SerializeField]
|
|
private UILabel _ownerOrGuestLabel;
|
|
|
|
[SerializeField]
|
|
private GameObject _friendRequestSending;
|
|
|
|
[SerializeField]
|
|
private GameObject _friendIcon;
|
|
|
|
public Action<GatheringUserInfo> OnClickFriendRequest;
|
|
|
|
public Action OnClickDropOut;
|
|
|
|
public Action<GatheringUserInfo> OnClickKick;
|
|
|
|
public void Initialize(GatheringInfo info, GatheringUserInfo userInfo)
|
|
{
|
|
InitializeBase(userInfo);
|
|
_dropOutButton.gameObject.SetActive(info.Role == GatheringRule.eRole.GUEST && userInfo.IsSelf);
|
|
_friendRequestButton.gameObject.SetActive(userInfo.IsFriend == false && !userInfo.IsSelf && userInfo.IsFriendRequestSending == false);
|
|
_friendIcon.SetActive(userInfo.IsFriend.Value);
|
|
_friendRequestSending.SetActive(userInfo.IsFriendRequestSending.Value);
|
|
_kickButton.gameObject.SetActive(info.Role == GatheringRule.eRole.OWNER && !userInfo.IsSelf);
|
|
_friendRequestButton.onClick.Clear();
|
|
_dropOutButton.onClick.Clear();
|
|
_kickButton.onClick.Clear();
|
|
_friendRequestButton.onClick.Add(new EventDelegate(delegate
|
|
{
|
|
OnClickFriendRequest.Call(userInfo);
|
|
}));
|
|
_dropOutButton.onClick.Add(new EventDelegate(delegate
|
|
{
|
|
OnClickDropOut.Call();
|
|
}));
|
|
_kickButton.onClick.Add(new EventDelegate(delegate
|
|
{
|
|
OnClickKick.Call(userInfo);
|
|
}));
|
|
SystemText systemText = Data.SystemText;
|
|
_ownerOrGuestLabel.text = (userInfo.IsOwner ? systemText.Get("Gathering_Information_0013") : systemText.Get("Gathering_Member_0001"));
|
|
}
|
|
}
|