summaryrefslogtreecommitdiff
path: root/Client/Assets/Scripts/XMainClient/UI/AuctionWrapContentGroup.cs
blob: c30f58462a29d644c313c2650bedd9f19d0d9e31 (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
using System;
using UILib;
using UnityEngine;

namespace XMainClient.UI
{
	internal class AuctionWrapContentGroup
	{
		public int rowLines
		{
			get
			{
				return this.m_itemWrapContent.widthDimension;
			}
		}

		public int maxCount
		{
			get
			{
				return this.m_itemWrapContent.maxItemCount;
			}
		}

		public bool Active
		{
			get
			{
				return this.m_active;
			}
		}

		private IXUIScrollView m_itemScrollView;

		private IXUIWrapContent m_itemWrapContent;

		private Transform m_curTransform;

		private bool m_active = false;

		public void SetAuctionWrapContentTemp(Transform temp, WrapItemUpdateEventHandler handler)
		{
			this.m_curTransform = temp;
			this.m_itemScrollView = (temp.gameObject.GetComponent("XUIScrollView") as IXUIScrollView);
			this.m_itemWrapContent = (temp.transform.Find("Table").GetComponent("XUIWrapContent") as IXUIWrapContent);
			this.m_itemWrapContent.RegisterItemUpdateEventHandler(handler);
		}

		public void SetWrapContentSize(int listSize)
		{
			listSize = ((listSize % 2 == 1) ? (listSize + 1) : listSize);
			this.m_itemWrapContent.SetContentCount(listSize, false);
			this.m_itemScrollView.ResetPosition();
		}

		public void SetVisible(bool active)
		{
			this.m_active = active;
			this.m_curTransform.gameObject.SetActive(active);
		}
	}
}