summaryrefslogtreecommitdiff
path: root/Client/Assets/Scripts/XMainClient/RecruitMemberHandler.cs
blob: eab77d5147dd51017ff3b13555af0330f307eb90 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
using System;
using System.Collections.Generic;
using UILib;
using UnityEngine;
using XMainClient.UI;
using XMainClient.UI.UICommon;
using XUtliPoolLib;

namespace XMainClient
{
	internal class RecruitMemberHandler : RecruitListHandler
	{
		private bool bubbleValid
		{
			get
			{
				XOptionsDocument specificDocument = XDocuments.GetSpecificDocument<XOptionsDocument>(XOptionsDocument.uuID);
				bool flag = specificDocument.GetValue(XOptionsDefine.OD_RECRUIT_FIRST_MEMBER) == 1;
				bool result;
				if (flag)
				{
					specificDocument.SetValue(XOptionsDefine.OD_RECRUIT_FIRST_MEMBER, 0, false);
					result = true;
				}
				else
				{
					result = false;
				}
				return result;
			}
		}

		private IXUIButton m_btnMember;

		private IXUILabel m_BubbleTips;

		private ulong _SelectIssueIndex = 0UL;

		private RecruitSelectGroupHandler _SelectGroupHandler;

		public override void OnReSelect()
		{
			this._doc.SendGroupChatFindRoleInfoList(this.m_titleBar.filter);
		}

		protected override List<GroupMember> GetMemberList()
		{
			return this._doc.RecruitMember;
		}

		protected override void Init()
		{
			base.Init();
			this.m_btnMember = (base.transform.Find("Info/Btn_Member").GetComponent("XUIButton") as IXUIButton);
			this.m_BubbleTips = (base.transform.Find("Info/Message/Btn_Member_LivenessTips").GetComponent("XUILabel") as IXUILabel);
			this.m_BubbleTips.SetText(XStringDefineProxy.GetString("GroupRecruit_MemberBubble"));
			this.m_btnMember.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnMemberClick));
			this._SelectGroupHandler = DlgHandlerBase.EnsureCreate<RecruitSelectGroupHandler>(ref this._SelectGroupHandler, base.transform.Find("SelectGroup").gameObject, null, false);
			this._SelectGroupHandler.Setup(new RecruitSelectGroupUpdate(this.OnSelectGroupHandle));
		}

		protected override void OnHide()
		{
			bool flag = this._SelectGroupHandler != null && this._SelectGroupHandler.IsVisible();
			if (flag)
			{
				this._SelectGroupHandler.SetVisible(false);
			}
			base.OnHide();
		}

		public override void RefreshData()
		{
			bool flag = this._doc.RecruitMember != null;
			if (flag)
			{
				GroupMember.dir = this.m_titleBar.direction;
				GroupMember.sortSeletor = this.m_titleBar.selector;
				this._doc.RecruitMember.Sort();
			}
			base.RefreshData();
		}

		protected override void SetupOtherInfo(Transform t, GroupMember member)
		{
			base.SetupOtherInfo(t, member);
			IXUIButton ixuibutton = t.Find("BtnRecruit").GetComponent("XUIButton") as IXUIButton;
			ixuibutton.SetVisible(false);
			ixuibutton.ID = member.issueIndex;
			ixuibutton.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnRecruitClick));
			ixuibutton.SetVisible(member.userID != XSingleton<XAttributeMgr>.singleton.XPlayerData.RoleID);
		}

		private bool OnRecruitClick(IXUIButton btn)
		{
			this._SelectIssueIndex = btn.ID;
			bool flag = this._SelectGroupHandler != null;
			if (flag)
			{
				this._SelectGroupHandler.SetVisible(true);
			}
			return true;
		}

		private void OnSelectGroupHandle()
		{
			bool flag = this._SelectGroupHandler == null || this._SelectGroupHandler.SelectGroup == null;
			if (flag)
			{
				XSingleton<UiUtility>.singleton.ShowSystemTip(XStringDefineProxy.GetString("GroupChat_UnSelectGroup"), "fece00");
				bool flag2 = this._SelectGroupHandler != null;
				if (flag2)
				{
					this._SelectGroupHandler.SetVisible(false);
				}
			}
			else
			{
				this._doc.SendZMLeaderAddRole(this._SelectIssueIndex, this._SelectGroupHandler.SelectGroup.id);
				this._SelectGroupHandler.SetVisible(false);
			}
		}

		protected override void SetInfo(IXUILabel label)
		{
			int @int = XSingleton<XGlobalConfig>.singleton.GetInt("GroupChatMaxZMRoleIssue");
			int curUserMemberCount = (int)this._doc.CurUserMemberCount;
			label.SetText(((curUserMemberCount < @int) ? (@int - curUserMemberCount) : 0).ToString());
			this.m_BubbleTips.SetVisible(this.bubbleValid);
		}

		private bool OnMemberClick(IXUIButton btn)
		{
			DlgBase<RecruitPlayerPublishView, RecruitPlayerPublishBehaviour>.singleton.SetVisibleWithAnimation(true, null);
			return true;
		}
	}
}