Elin Modding Docs Doc
Loading...
Searching...
No Matches
UIAutoTurn.cs
1using System;
2using UnityEngine;
3using UnityEngine.UI;
4
5// Token: 0x020005E2 RID: 1506
6public class UIAutoTurn : EMono
7{
8 // Token: 0x06002964 RID: 10596 RVA: 0x000E954D File Offset: 0x000E774D
9 private void Awake()
10 {
11 base.InvokeRepeating("_Update", 0f, 0.05f);
12 }
13
14 // Token: 0x06002965 RID: 10597 RVA: 0x000E9564 File Offset: 0x000E7764
15 private void _Update()
16 {
17 float now = 0f;
18 float num = 0f;
19 this.hint = null;
20 if (EMono.core.IsGameStarted)
21 {
22 if (EMono.pc.WillConsumeTurn())
23 {
24 num = 1f;
25 for (int i = EMono.pc.conditions.Count - 1; i >= 0; i--)
26 {
27 if (EMono.pc.conditions[i].ConsumeTurn)
28 {
29 this.hint = EMono.pc.conditions[i].GetText().ToTitleCase(false);
30 }
31 }
32 }
33 else if (!EMono.pc.HasNoGoal)
34 {
35 AIProgress progress = EMono.pc.ai.GetProgress();
36 if (EMono.pc.ai.IsAutoTurn || progress != null)
37 {
38 if (progress != null)
39 {
40 this.hint = progress.TextHint;
41 num = (float)(progress.ShowProgress ? progress.MaxProgress : 0);
42 now = (float)(progress.ShowProgress ? progress.progress : 0);
43 }
44 else
45 {
46 num = (float)EMono.pc.ai.MaxProgress;
47 now = (float)(EMono.pc.ai.ShowProgress ? EMono.pc.ai.CurrentProgress : 0);
48 }
49 }
50 }
51 }
52 if (!this.gauge.gameObject.activeSelf & num != 0f)
53 {
54 this.gauge.bar.rectTransform.sizeDelta = new Vector2(0f, this.gauge.bar.rectTransform.sizeDelta.y);
55 }
56 this.gauge.SetActive(num != 0f);
57 if (num == 0f)
58 {
59 return;
60 }
61 this.gauge.textNow.SetActive(this.hint != null);
62 this.count++;
63 this.gauge.UpdateValue(now, num);
64 if (this.hint != null)
65 {
66 this.gauge.textNow.SetText(this.hint);
67 }
68 this.icon.sprite = this.iconSprites[this.count / 5 % 2];
69 }
70
71 // Token: 0x0400174E RID: 5966
72 public Image icon;
73
74 // Token: 0x0400174F RID: 5967
75 public Sprite[] iconSprites;
76
77 // Token: 0x04001750 RID: 5968
78 public Gauge gauge;
79
80 // Token: 0x04001751 RID: 5969
81 public string hint;
82
83 // Token: 0x04001752 RID: 5970
84 private int count;
85}
Definition EMono.cs:6