blob: 29049f7070bc304a6739044c2b0444e53978e4ae (
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
|
using System;
using UILib;
using UnityEngine;
using XUtliPoolLib;
namespace XMainClient.UI
{
internal class GVGHallBase : DlgHandlerBase
{
private IXUIWrapContent _rankWrapContent;
private IXUIScrollView _rankScrollView;
private Transform _selfTransform;
private XUIPool m_ItemPool = new XUIPool(XSingleton<XGameUI>.singleton.m_uiTool);
private Transform m_ItemReward;
protected IXUILabel m_HelpText;
protected ulong selfGuildID = 0UL;
protected int selfIndex = -1;
protected override void Init()
{
Transform transform = base.PanelObject.transform.Find("Reward/item");
this.m_ItemPool.SetupPool(transform.parent.gameObject, transform.gameObject, 3u, false);
this.m_ItemReward = base.PanelObject.transform.Find("Reward");
this._rankScrollView = (base.PanelObject.transform.Find("RankList/ScrollView").GetComponent("XUIScrollView") as IXUIScrollView);
this._rankWrapContent = (base.PanelObject.transform.Find("RankList/ScrollView/WrapContent").GetComponent("XUIWrapContent") as IXUIWrapContent);
this._selfTransform = base.PanelObject.transform.Find("MyRank/Detail");
this._rankWrapContent.RegisterItemUpdateEventHandler(new WrapItemUpdateEventHandler(this.OnItemWrapUpdate));
this.m_HelpText = (base.PanelObject.transform.Find("help/Intro/Text").GetComponent("XUILabel") as IXUILabel);
}
protected override void OnShow()
{
base.OnShow();
this.RefreshData();
}
public override void RefreshData()
{
base.RefreshData();
this.SetupRankList();
}
private void SetupRankList()
{
this.selfIndex = -1;
XGuildDocument specificDocument = XDocuments.GetSpecificDocument<XGuildDocument>(XGuildDocument.uuID);
this.selfGuildID = specificDocument.BasicData.uid;
this._rankWrapContent.SetContentCount(this.GetContentSize(), false);
this._rankScrollView.ResetPosition();
this.SetSelfGuildInfo(this.selfIndex);
}
protected virtual int GetContentSize()
{
return 0;
}
protected void SetSelfGuildInfo(int index)
{
this.OnItemWrapUpdate(this._selfTransform, index);
}
protected virtual void OnItemWrapUpdate(Transform t, int index)
{
}
protected virtual void SetupRewardList(string[] values)
{
int num = values.Length;
this.m_ItemPool.ReturnAll(false);
for (int i = 0; i < num; i++)
{
GameObject gameObject = this.m_ItemPool.FetchGameObject(false);
gameObject.transform.parent = this.m_ItemReward;
gameObject.transform.localPosition = new Vector3((float)(i * 80), 0f);
int num2 = int.Parse(values[i]);
XSingleton<XItemDrawerMgr>.singleton.normalItemDrawer.DrawItem(gameObject, num2, 0, false);
IXUISprite ixuisprite = gameObject.transform.Find("Icon").GetComponent("XUISprite") as IXUISprite;
ixuisprite.ID = (ulong)((long)num2);
ixuisprite.RegisterSpriteClickEventHandler(new SpriteClickEventHandler(XSingleton<UiUtility>.singleton.OnItemClick));
}
}
}
}
|