blob: 12cb20d8c9052ebbf08bdd58b7263c8f506e4a64 (
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
|
using System;
using System.Collections.Generic;
using UILib;
using UnityEngine;
namespace XMainClient
{
internal class RecruitListHandler : DlgHandlerBase
{
protected GroupChatDocument _doc;
protected RecruitTitleBar m_titleBar;
protected Transform m_empty;
protected IXUILabel m_info;
private IXUIScrollView _MemberList;
private IXUIWrapContent _MemberWrapContent;
private GroupMemberDisplay _memberDisplay;
private bool m_response = false;
protected override void Init()
{
this._doc = XDocuments.GetSpecificDocument<GroupChatDocument>(GroupChatDocument.uuID);
this.m_titleBar = DlgHandlerBase.EnsureCreate<RecruitTitleBar>(ref this.m_titleBar, base.transform.Find("Title").gameObject, this, true);
this.m_titleBar.RegisterTitleChange(new RecruitTitleChange(this.OnTitleChange));
this.m_titleBar.RegisterTitleReSelect(new RecruitTitleReSelect(this.OnReSelect));
this._MemberList = (base.transform.Find("MemberList").GetComponent("XUIScrollView") as IXUIScrollView);
this._MemberWrapContent = (base.transform.Find("MemberList/WrapContent").GetComponent("XUIWrapContent") as IXUIWrapContent);
this._MemberWrapContent.RegisterItemUpdateEventHandler(new WrapItemUpdateEventHandler(this.OnWrapContent));
this.m_empty = base.transform.Find("Empty");
this.m_info = (base.transform.Find("Info/Info/Time").GetComponent("XUILabel") as IXUILabel);
}
public virtual void RefreshRedPoint()
{
}
protected virtual List<GroupMember> GetMemberList()
{
return null;
}
protected override void OnShow()
{
base.OnShow();
this.m_response = true;
this.OnReSelect();
this.RefreshInfo();
this.RefreshRedPoint();
}
protected void RefreshInfo()
{
this.SetInfo(this.m_info);
}
public override void OnUnload()
{
bool flag = this._memberDisplay != null;
if (flag)
{
this._memberDisplay.Release();
this._memberDisplay = null;
}
DlgHandlerBase.EnsureUnload<RecruitTitleBar>(ref this.m_titleBar);
base.OnUnload();
}
public override void RefreshData()
{
this.RefreshInfo();
List<GroupMember> memberList = this.GetMemberList();
bool flag = memberList == null || memberList.Count == 0;
if (flag)
{
this.m_empty.gameObject.SetActive(true);
this._MemberWrapContent.SetContentCount(0, false);
}
else
{
this.m_empty.gameObject.SetActive(false);
this._MemberWrapContent.SetContentCount(memberList.Count, false);
}
bool response = this.m_response;
if (response)
{
this.m_response = false;
this._MemberList.ResetPosition();
}
base.RefreshData();
}
protected virtual void OnWrapContent(Transform t, int index)
{
List<GroupMember> memberList = this.GetMemberList();
bool flag = memberList == null;
if (!flag)
{
bool flag2 = this._memberDisplay == null;
if (flag2)
{
this._memberDisplay = new GroupMemberDisplay();
}
GroupMember member = memberList[index];
this._memberDisplay.Init(t);
this._memberDisplay.Setup(member);
this.SetupOtherInfo(t, member);
}
}
protected virtual void SetupOtherInfo(Transform t, GroupMember member)
{
}
protected virtual void OnTitleChange()
{
this.RefreshData();
}
public virtual void OnReSelect()
{
}
protected virtual void SetInfo(IXUILabel label)
{
}
}
}
|