blob: 4362e5e1c707fd8ff5863faa0ea8df912b18965e (
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
142
143
144
145
146
147
148
149
150
151
152
153
|
using System;
using UILib;
using UnityEngine;
using XMainClient.UI;
using XMainClient.UI.UICommon;
using XUtliPoolLib;
namespace XMainClient
{
internal class YorozuyaDlg : DlgBase<YorozuyaDlg, YorozuyaBehaviour>
{
public override string fileName
{
get
{
return "GameSystem/YorozuyaDlg";
}
}
public override int layer
{
get
{
return 1;
}
}
public override bool autoload
{
get
{
return true;
}
}
public override bool hideMainMenu
{
get
{
return true;
}
}
public override bool pushstack
{
get
{
return true;
}
}
public override bool fullscreenui
{
get
{
return true;
}
}
public override int sysid
{
get
{
return 440;
}
}
private XYorozuyaDocument m_doc;
protected override void OnLoad()
{
base.OnLoad();
}
public override void RegisterEvent()
{
base.RegisterEvent();
base.uiBehaviour.m_closedBtn.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnClickClosedBtn));
}
protected override void OnUnload()
{
base.OnUnload();
}
protected override void Init()
{
base.Init();
this.m_doc = XYorozuyaDocument.Doc;
}
protected override void OnHide()
{
base.OnHide();
XSingleton<XInput>.singleton.Freezed = false;
}
protected override void OnShow()
{
base.OnShow();
this.FillContent();
}
private void FillContent()
{
base.uiBehaviour.m_itemPool.ReturnAll(true);
for (int i = 0; i < this.m_doc.YorozuyaTab.Table.Length; i++)
{
YorozuyaTable.RowData rowData = this.m_doc.YorozuyaTab.Table[i];
bool flag = rowData == null;
if (!flag)
{
GameObject gameObject = base.uiBehaviour.m_itemPool.FetchGameObject(false);
gameObject.transform.parent = base.uiBehaviour.m_parentTra;
gameObject.transform.localScale = Vector3.one;
gameObject.transform.localPosition = base.uiBehaviour.m_itemPool.TplPos + new Vector3((float)(i % 3 * base.uiBehaviour.m_itemPool.TplWidth), (float)(-(float)(i / 3) * base.uiBehaviour.m_itemPool.TplHeight), 0f);
IXUISprite ixuisprite = gameObject.transform.GetComponent("XUISprite") as IXUISprite;
ixuisprite.ID = (ulong)rowData.ID;
ixuisprite.RegisterSpriteClickEventHandler(new SpriteClickEventHandler(this.OnClickIcon));
IXUILabel ixuilabel = gameObject.transform.Find("shopname").GetComponent("XUILabel") as IXUILabel;
ixuilabel.SetText(rowData.Name);
IXUITexture ixuitexture = gameObject.transform.Find("Icon").GetComponent("XUITexture") as IXUITexture;
ixuitexture.SetTexturePath(rowData.IconName);
ixuitexture.SetEnabled(rowData.IsOpen == 0);
}
}
}
private bool OnClickClosedBtn(IXUIButton btn)
{
this.SetVisibleWithAnimation(false, null);
return true;
}
private void OnClickIcon(IXUISprite spr)
{
YorozuyaTable.RowData rowData = this.m_doc.GetRowData((byte)spr.ID);
bool flag = rowData == null;
if (!flag)
{
bool flag2 = rowData.IsOpen == 1;
if (flag2)
{
XSingleton<UiUtility>.singleton.ShowSystemTip(XSingleton<XStringTable>.singleton.GetString("ERR_CUSTOM_NOTOPEN"), "fece00");
}
else
{
this.m_doc.ReqEnterScene((int)spr.ID);
}
}
}
}
}
|