blob: 255de3263edd8a124e7e50554120a537c80ebd90 (
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
139
140
141
|
using System;
using System.Collections.Generic;
using UILib;
using UnityEngine;
using XUtliPoolLib;
namespace XMainClient.UI
{
internal class ForgeAttrPreViewHandler : DlgHandlerBase
{
private XForgeDocument m_doc;
private IXUISprite m_closeBtn;
private IXUIScrollView m_scrollView;
private GameObject m_detailGo;
private GameObject m_WithoutAttrGo;
private GameObject m_WithAttrGo;
private XUIPool m_itemPool = new XUIPool(XSingleton<XGameUI>.singleton.m_uiTool);
protected override void Init()
{
base.Init();
this.m_doc = XForgeDocument.Doc;
this.m_closeBtn = (base.PanelObject.transform.Find("Close").GetComponent("XUISprite") as IXUISprite);
this.m_scrollView = (base.PanelObject.transform.Find("Detail").GetComponent("XUIScrollView") as IXUIScrollView);
this.m_detailGo = base.PanelObject.transform.Find("Detail").gameObject;
this.m_itemPool.SetupPool(base.PanelObject, base.PanelObject.transform.Find("Tpl").gameObject, 3u, true);
this.m_WithoutAttrGo = base.PanelObject.transform.Find("Withoutattr").gameObject;
this.m_WithAttrGo = base.PanelObject.transform.Find("Withattr").gameObject;
}
public override void RegisterEvent()
{
base.RegisterEvent();
this.m_closeBtn.RegisterSpriteClickEventHandler(new SpriteClickEventHandler(this.OnCloseClicked));
}
protected override void OnShow()
{
base.OnShow();
this.FillContent();
}
protected override void OnHide()
{
this.m_itemPool.ReturnAll(false);
base.OnHide();
}
public override void OnUnload()
{
this.m_doc.View = null;
base.OnUnload();
}
private void FillContent()
{
this.m_itemPool.ReturnAll(true);
XItem itemByUID = XBagDocument.BagDoc.GetItemByUID(this.m_doc.CurUid);
bool flag = itemByUID == null;
if (!flag)
{
XEquipItem xequipItem = itemByUID as XEquipItem;
bool flag2 = xequipItem.forgeAttrInfo.ForgeAttr.Count == 0;
if (flag2)
{
this.m_WithoutAttrGo.SetActive(true);
this.m_WithAttrGo.SetActive(false);
}
else
{
this.m_WithoutAttrGo.SetActive(false);
this.m_WithAttrGo.SetActive(true);
}
EquipSlotAttrDatas attrData = XForgeDocument.ForgeAttrMgr.GetAttrData((uint)itemByUID.itemID);
bool flag3 = attrData == null;
if (!flag3)
{
EquipSlotAttrData attrData2 = attrData.GetAttrData(1);
bool flag4 = attrData2 == null;
if (!flag4)
{
int num = 0;
for (int i = 0; i < attrData2.AttrDataList.Count; i++)
{
EquipAttrData equipAttrData = attrData2.AttrDataList[i];
bool flag5 = equipAttrData.Prob == 0u;
if (!flag5)
{
string text = XAttributeCommon.GetAttrStr((int)equipAttrData.AttrId);
bool flag6 = XSingleton<XAttributeMgr>.singleton.XPlayerData != null;
if (flag6)
{
ProfessionTable.RowData byProfID = XSingleton<XEntityMgr>.singleton.RoleInfo.GetByProfID(XSingleton<XAttributeMgr>.singleton.XPlayerData.BasicTypeID);
bool flag7 = byProfID != null;
if (flag7)
{
List<int> list;
bool flag8 = this.m_doc.AttackTypeDic.TryGetValue((int)byProfID.AttackType, out list);
if (flag8)
{
for (int j = 0; j < list.Count; j++)
{
bool flag9 = (long)list[j] == (long)((ulong)equipAttrData.AttrId);
if (flag9)
{
text = string.Empty;
break;
}
}
}
}
}
bool flag10 = text == string.Empty;
if (!flag10)
{
GameObject gameObject = this.m_itemPool.FetchGameObject(false);
gameObject.transform.parent = this.m_detailGo.transform;
gameObject.transform.localPosition = this.m_itemPool.TplPos + new Vector3((float)(this.m_itemPool.TplWidth * (num % 2)), (float)(-(float)this.m_itemPool.TplHeight * (num / 2)), 0f);
IXUILabel ixuilabel = gameObject.transform.Find("AttrName").GetComponent("XUILabel") as IXUILabel;
ixuilabel.SetText(text);
num++;
}
}
}
}
}
}
}
private void OnCloseClicked(IXUISprite spr)
{
base.SetVisible(false);
}
}
}
|