Elin Modding Docs Doc
Loading...
Searching...
No Matches
ButtonRoster.cs
1using System;
2using UnityEngine;
3using UnityEngine.UI;
4
5// Token: 0x02000501 RID: 1281
6public class ButtonRoster : UIButton
7{
8 // Token: 0x17000B09 RID: 2825
9 // (get) Token: 0x06002247 RID: 8775 RVA: 0x000BEA84 File Offset: 0x000BCC84
10 public WidgetRoster roster
11 {
12 get
13 {
14 return WidgetRoster.Instance;
15 }
16 }
17
18 // Token: 0x06002248 RID: 8776 RVA: 0x000BEA8C File Offset: 0x000BCC8C
19 public void SetChara(Chara c)
20 {
21 this.chara = c;
22 this.chara.SetImage(this.icon);
23 bool flag = this.roster.extra.portrait && !this.chara.GetIdPortrait().IsEmpty();
24 this.portrait.SetChara(c, null);
25 this.portrait.SetActive(flag && !this.roster.extra.onlyName);
26 this.icon.enabled = (!flag && !this.roster.extra.onlyName);
27 this.icon.rectTransform.anchoredPosition = new Vector2(0f, (float)(this.roster.extra.width / 2));
28 this.Refresh();
29 }
30
31 // Token: 0x06002249 RID: 8777 RVA: 0x000BEB64 File Offset: 0x000BCD64
32 public void Refresh()
33 {
34 if (ButtonRoster.gradient == null)
35 {
36 ButtonRoster.gradient = EClass.Colors.Dark.gradients["mood"];
37 }
38 float num = Mathf.Clamp((float)this.chara.hp / (float)this.chara.MaxHP, 0f, 1f);
39 this.barMood.Rect().localScale = new Vector3(num, 1f, 1f);
40 this.barMood.color = ButtonRoster.gradient.Evaluate(num);
41 Color c = EClass.Colors.Dark.gradientHP.Evaluate((float)this.chara.hp / (float)this.chara.MaxHP);
42 this.mainText.text = "".TagColor(c, this.chara.hp.ToString() ?? "");
43 this.mainText.SetActive(this.roster.extra.showHP);
44 if (this.roster.extra.showHP)
45 {
46 this.textName.SetText(this.chara.NameSimple);
47 }
48 else
49 {
50 this.textName.text = "".TagColor(c, this.chara.NameSimple);
51 }
52 this.textName.SetActive(this.roster.extra.onlyName);
53 }
54
55 // Token: 0x040011CC RID: 4556
56 public Chara chara;
57
58 // Token: 0x040011CD RID: 4557
59 public float iconPivot;
60
61 // Token: 0x040011CE RID: 4558
62 private bool dragged;
63
64 // Token: 0x040011CF RID: 4559
65 public Image barMood;
66
67 // Token: 0x040011D0 RID: 4560
68 public UIText textName;
69
70 // Token: 0x040011D1 RID: 4561
71 public RectTransform rect;
72
73 // Token: 0x040011D2 RID: 4562
74 public Portrait portrait;
75
76 // Token: 0x040011D3 RID: 4563
77 private static Gradient gradient;
78}
Definition Chara.cs:12