Elin Decompiled Documentation EA 23.183 Nightly Patch 1
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 [NonSerialized]
48 public float hideTimer;
49
50 private void Awake()
51 {
52 orgPivot = this.Rect().pivot;
53 }
54
55 public void SetData(TooltipData _data)
56 {
57 bool flag = data != _data;
58 data = _data;
59 if ((bool)note)
60 {
61 this.Rect().sizeDelta = new Vector2(500f, 0f);
62 if (altSkin && flag)
63 {
64 SkinManager.tempSkin = SkinManager.CurrentSkin.colors.skinTooltip;
65 }
66 }
67 if ((bool)layout)
68 {
69 layout.enabled = true;
70 }
71 if ((bool)textMain)
72 {
73 textMain.text = (data.lang.IsEmpty() ? data.text : Lang.Get(data.lang));
74 }
75 if (data.onShowTooltip != null)
76 {
77 data.onShowTooltip(this);
78 }
79 if ((bool)icon)
80 {
81 icon.SetActive(data.icon);
82 }
83 UIImage[] componentsInChildren = GetComponentsInChildren<UIImage>(includeInactive: true);
84 for (int i = 0; i < componentsInChildren.Length; i++)
85 {
86 componentsInChildren[i].ApplySkin();
87 }
88 this.RebuildLayout(recursive: true);
89 }
90}
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
float hideTimer
Definition: UITooltip.cs:48
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:55
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:50
Image icon
Definition: UITooltip.cs:27
bool follow
Definition: UITooltip.cs:33