Elin Modding Docs Doc
Loading...
Searching...
No Matches
LayerRegisterHotbar.cs
1using System;
2using System.Collections.Generic;
3using UnityEngine;
4using UnityEngine.UI;
5
6// Token: 0x020005BA RID: 1466
8{
9 // Token: 0x06002826 RID: 10278 RVA: 0x000E2F26 File Offset: 0x000E1126
10 public void SetItem(SourceElement.Row act)
11 {
12 this.SetItem(new HotItemAct
13 {
14 id = act.id
15 });
16 }
17
18 // Token: 0x06002827 RID: 10279 RVA: 0x000E2F40 File Offset: 0x000E1140
19 public LayerRegisterHotbar SetItem(Thing t)
20 {
21 return this.SetItem(t.trait.GetHotItem());
22 }
23
24 // Token: 0x06002828 RID: 10280 RVA: 0x000E2F53 File Offset: 0x000E1153
25 public void SetItem(Chara c)
26 {
27 this.SetItem(new HotItemChara
28 {
29 uid = c.uid
30 });
31 }
32
33 // Token: 0x06002829 RID: 10281 RVA: 0x000E2F6D File Offset: 0x000E116D
34 public LayerRegisterHotbar SetItem(HotItem item)
35 {
36 WidgetHotbar.registeringItem = item;
37 this.Show();
38 return this;
39 }
40
41 // Token: 0x0600282A RID: 10282 RVA: 0x000E2F7C File Offset: 0x000E117C
42 public void Show()
43 {
44 WidgetHotbar.registering = true;
45 foreach (Widget widget in ELayer.ui.widgets.list)
46 {
47 WidgetHotbar widgetHotbar = widget as WidgetHotbar;
48 if (!(widgetHotbar == null) && widgetHotbar.CanRegisterItem && !widgetHotbar.hotbar.IsLocked)
49 {
50 if (!widgetHotbar.Visible)
51 {
52 widgetHotbar.ToggleVisible();
53 }
54 widgetHotbar.transform.SetParent(base.transform, false);
55 this.hotbars.Add(widgetHotbar);
56 }
57 }
58 }
59
60 // Token: 0x0600282B RID: 10283 RVA: 0x000E3028 File Offset: 0x000E1228
61 public ButtonHotItem GetButton()
62 {
63 foreach (WidgetHotbar widgetHotbar in this.hotbars)
64 {
65 foreach (ButtonHotItem buttonHotItem in widgetHotbar.buttons)
66 {
67 if (InputModuleEX.IsPointerOver(buttonHotItem))
68 {
69 return buttonHotItem;
70 }
71 }
72 }
73 return null;
74 }
75
76 // Token: 0x0600282C RID: 10284 RVA: 0x000E30BC File Offset: 0x000E12BC
77 public bool OnEndDrag()
78 {
79 ButtonHotItem button = this.GetButton();
80 if (button)
81 {
82 button.onClick.Invoke();
83 return true;
84 }
85 return false;
86 }
87
88 // Token: 0x0600282D RID: 10285 RVA: 0x000E30E8 File Offset: 0x000E12E8
89 public override void OnKill()
90 {
91 foreach (WidgetHotbar widgetHotbar in this.hotbars)
92 {
93 widgetHotbar.transform.SetParent(ELayer.ui.widgets.transform, false);
94 }
95 foreach (Image image in this.covers)
96 {
97 UnityEngine.Object.DestroyImmediate(image.gameObject);
98 }
99 WidgetHotbar.registering = false;
100 WidgetHotbar.registeringItem = null;
101 }
102
103 // Token: 0x0400165C RID: 5724
104 public Image moldCover;
105
106 // Token: 0x0400165D RID: 5725
107 private List<WidgetHotbar> hotbars = new List<WidgetHotbar>();
108
109 // Token: 0x0400165E RID: 5726
110 private List<Image> covers = new List<Image>();
111}
Definition Chara.cs:12
Definition Thing.cs:10