12 public override void OnActivate()
14 WidgetMouseover.Instance =
this;
21 this.timer += Core.delta;
23 if (!mouseTarget.hasTargetChanged &&
this.timer < 0.1f)
28 bool flag = EInput.isShiftDown && mouseTarget.pos.Equals(
EMono.pc.pos) && (EMono.pc.ride !=
null || EMono.pc.parasite !=
null);
29 if ((!flag && mouseTarget.target ==
null) || (
ActionMode.IsAdv && Input.GetMouseButton(0)))
35 Card card = mouseTarget.card;
38 if (
EMono.pc.ride !=
null)
40 text +=
EMono.pc.ride.GetHoverText();
41 text +=
EMono.pc.ride.GetHoverText2();
43 if (
EMono.pc.parasite !=
null)
45 if (
EMono.pc.ride !=
null)
47 text += Environment.NewLine;
49 text +=
EMono.pc.parasite.GetHoverText();
50 text +=
EMono.pc.parasite.GetHoverText2();
53 else if (card !=
null)
55 text = card.GetHoverText();
56 int count =
EMono.scene.mouseTarget.cards.Count;
59 text +=
"otherCards".lang((count - 1).ToString() ??
"",
null,
null,
null,
null);
61 text += card.GetHoverText2();
62 if (mouseTarget.target != card)
64 text = text + Environment.NewLine + mouseTarget.target.InspectName;
69 text = mouseTarget.target.InspectName;
75 public void Show(
string s)
77 this.layout.SetActive(
true);
79 TweenUtil.KillTween(ref this.tween,
false);
80 this.textName.text = s;
81 RectPosition anchor = this.Rect().GetAnchor();
82 if (anchor <= RectPosition.TopRIGHT)
84 if (anchor != RectPosition.TopLEFT)
86 if (anchor != RectPosition.TopRIGHT)
93 else if (anchor != RectPosition.BottomLEFT)
95 if (anchor != RectPosition.BottomRIGHT)
101 this.layout.childAlignment = TextAnchor.MiddleLeft;
104 this.layout.childAlignment = TextAnchor.MiddleRight;
107 this.layout.childAlignment = TextAnchor.MiddleCenter;
109 this.layout.RebuildLayout(
false);
113 public void Hide(
bool immediate =
false)
115 this.imageBG.raycastTarget =
false;
118 this.layout.SetActive(
false);
121 TweenUtil.KillTween(ref this.tween,
false);
122 this.tween = this.cg.DOFade(0f, 0.3f).OnComplete(delegate
126 this.layout.SetActive(
false);
128 }).SetEase(Ease.InQuad);
132 public override void OnManagerActivate()
134 base.OnManagerActivate();
135 this.imageBG.raycastTarget =
true;
136 this.Show(
"[" + Lang.Get(
"WidgetMouseover") +
"]");
140 public override void OnManagerDeactivate()
142 base.OnManagerDeactivate();
150 public UIText textName;
153 public LayoutGroup layout;
156 public CanvasGroup cg;