Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
UITooltip.cs
Go to the documentation of this file.
1using System;
2using UnityEngine;
3using UnityEngine.UI;
4
5public class UITooltip : MonoBehaviour
6{
7 public enum FollowType
8 {
9 None,
10 Button,
11 Mouse,
12 Pivot
13 }
14
16
18
20
21 public UINote note;
22
23 public Image imageMain;
24
25 public Image imageSub;
26
27 public Image icon;
28
29 public Vector3 offset;
30
32
33 public bool follow;
34
35 public bool delayHide;
36
37 public bool altSkin;
38
39 public Vector2 orgPivot;
40
41 public CanvasGroup cg;
42
43 public Func<bool> hideFunc;
44
45 public LayoutElement layout;
46
47 private void Awake()
48 {
49 orgPivot = this.Rect().pivot;
50 }
51
52 public void SetData(TooltipData _data)
53 {
54 bool flag = data != _data;
55 data = _data;
56 if ((bool)note)
57 {
58 this.Rect().sizeDelta = new Vector2(500f, 0f);
59 if (altSkin && flag)
60 {
61 SkinManager.tempSkin = SkinManager.CurrentSkin.colors.skinTooltip;
62 }
63 }
64 if ((bool)layout)
65 {
66 layout.enabled = true;
67 }
68 if ((bool)textMain)
69 {
70 textMain.text = (data.lang.IsEmpty() ? data.text : Lang.Get(data.lang));
71 }
72 if (data.onShowTooltip != null)
73 {
74 data.onShowTooltip(this);
75 }
76 if ((bool)icon)
77 {
78 icon.SetActive(data.icon);
79 }
80 UIImage[] componentsInChildren = GetComponentsInChildren<UIImage>(includeInactive: true);
81 for (int i = 0; i < componentsInChildren.Length; i++)
82 {
83 componentsInChildren[i].ApplySkin();
84 }
85 this.RebuildLayout(recursive: true);
86 }
87}
Definition: Lang.cs:6
static string Get(string id)
Definition: Lang.cs:91
static SkinRootStatic CurrentSkin
Definition: SkinManager.cs:82
SkinRootStatic skinTooltip
SkinColors colors
string lang
Definition: TooltipData.cs:15
Action< UITooltip > onShowTooltip
Definition: TooltipData.cs:19
void ApplySkin()
Definition: UIImage.cs:24
Definition: UINote.cs:6
Definition: UIText.cs:6
Func< bool > hideFunc
Definition: UITooltip.cs:43
TooltipData data
Definition: UITooltip.cs:15
Image imageSub
Definition: UITooltip.cs:25
CanvasGroup cg
Definition: UITooltip.cs:41
Vector3 offset
Definition: UITooltip.cs:29
UINote note
Definition: UITooltip.cs:21
void SetData(TooltipData _data)
Definition: UITooltip.cs:52
UIText textSub
Definition: UITooltip.cs:19
bool delayHide
Definition: UITooltip.cs:35
LayoutElement layout
Definition: UITooltip.cs:45
bool altSkin
Definition: UITooltip.cs:37
Vector2 orgPivot
Definition: UITooltip.cs:39
Image imageMain
Definition: UITooltip.cs:23
UIText textMain
Definition: UITooltip.cs:17
FollowType followType
Definition: UITooltip.cs:31
void Awake()
Definition: UITooltip.cs:47
Image icon
Definition: UITooltip.cs:27
bool follow
Definition: UITooltip.cs:33