blob: 765b891d8522111b458bcbfaa4120192d07e4ba5 (
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
|
using System;
using UILib;
using UnityEngine;
using XUtliPoolLib;
namespace XMainClient.UI
{
internal class FashionStotageDisplayHandle : DlgHandlerBase
{
private IXUIScrollView m_fashionBagView;
private IXUIWrapContent m_fashionWrapContent;
private IFashionStorageSelect m_Select;
private XFashionStorageDocument m_doc;
protected override void Init()
{
base.Init();
this.m_doc = XDocuments.GetSpecificDocument<XFashionStorageDocument>(XFashionStorageDocument.uuID);
this.m_fashionBagView = (base.transform.GetComponent("XUIScrollView") as IXUIScrollView);
this.m_fashionWrapContent = (base.FindInChild("XUIWrapContent", "WrapContent") as IXUIWrapContent);
this.m_fashionWrapContent.RegisterItemUpdateEventHandler(new WrapItemUpdateEventHandler(this.ItemWrapContentUpdate));
}
protected override void OnShow()
{
base.OnShow();
}
private void ItemWrapContentUpdate(Transform t, int index)
{
uint num = (this.m_Select != null && index >= 0 && index < this.m_Select.GetItems().Count) ? this.m_Select.GetItems()[index] : 0u;
IXUISprite ixuisprite = t.GetComponent("XUISprite") as IXUISprite;
IXUISprite ixuisprite2 = t.Find("RedPoint").GetComponent("XUISprite") as IXUISprite;
XSingleton<XItemDrawerMgr>.singleton.normalItemDrawer.DrawItem(t.gameObject, (int)num, 0, false);
ixuisprite.ID = (ulong)num;
ixuisprite.RegisterSpriteClickEventHandler(new SpriteClickEventHandler(this.ItemClick));
ixuisprite2.SetAlpha(this.m_doc.FashionInBody((int)num) ? 1f : 0f);
}
private void ItemClick(IXUISprite iconSprite)
{
bool flag = iconSprite.ID == 0UL;
if (!flag)
{
int itemID = (int)iconSprite.ID;
XItem item = XBagDocument.MakeXItem(itemID, true);
XSingleton<UiUtility>.singleton.ShowOutLookDialog(item, iconSprite, 0u);
}
}
public void SetFashionStorageSelect(IFashionStorageSelect select = null)
{
this.m_Select = select;
int num = (this.m_Select == null) ? 0 : this.m_Select.GetItems().Count;
int num2 = this.m_fashionWrapContent.widthDimension * this.m_fashionWrapContent.heightDimensionMax;
bool flag = num > this.m_fashionWrapContent.widthDimension * this.m_fashionWrapContent.heightDimensionMax;
if (flag)
{
bool flag2 = num % this.m_fashionWrapContent.widthDimension > 0;
if (flag2)
{
num = (num / this.m_fashionWrapContent.widthDimension + 1) * this.m_fashionWrapContent.widthDimension;
}
}
else
{
num = num2;
}
this.m_fashionWrapContent.SetContentCount(num, false);
this.m_fashionBagView.ResetPosition();
}
}
}
|