Elin Modding Docs Doc
Loading...
Searching...
No Matches
ItemQuestTracker.cs
1using System;
2using UnityEngine;
3
4// Token: 0x020005ED RID: 1517
5public class ItemQuestTracker : EMono
6{
7 // Token: 0x060029C2 RID: 10690 RVA: 0x000EB970 File Offset: 0x000E9B70
8 public void Refresh()
9 {
10 if (!this.quest.track || !EMono.game.quests.list.Contains(this.quest))
11 {
12 this.Kill();
13 return;
14 }
15 this.sb.Clear();
16 if (this.quest.deadline > 0 && !this.quest.UseInstanceZone)
17 {
18 this.sb.Append("- " + "days1".lang() + this.quest.TextDeadline);
19 this.sb.Append(Environment.NewLine);
20 }
21 string value = this.quest.GetTrackerText().TrimEnd(Environment.NewLine.ToCharArray());
22 this.sb.Append(value);
23 bool enable = false;
24 if (this.quest is QuestDeliver)
25 {
26 QuestDeliver questDeliver = this.quest as QuestDeliver;
27 if (!questDeliver.IsDeliver || EMono._zone == questDeliver.DestZone)
28 {
29 ItemQuestTracker.<>c__DisplayClass7_0 CS$<>8__locals1 = new ItemQuestTracker.<>c__DisplayClass7_0();
30 ItemQuestTracker.<>c__DisplayClass7_0 CS$<>8__locals2 = CS$<>8__locals1;
31 Map map = EMono._map;
32 int uid;
33 if (!questDeliver.IsDeliver)
34 {
35 Chara chara = questDeliver.person.chara;
36 uid = ((chara != null) ? chara.uid : 0);
37 }
38 else
39 {
40 uid = questDeliver.uidTarget;
41 }
42 CS$<>8__locals2.tg = map.FindChara(uid);
43 if (CS$<>8__locals1.tg != null)
44 {
45 enable = true;
46 this.buttonGoto.SetOnClick(delegate
47 {
48 if (!EMono.pc.HasNoGoal)
49 {
50 SE.BeepSmall();
51 return;
52 }
53 EMono.pc.SetAIImmediate(new AI_Goto(CS$<>8__locals1.tg, 1, false, false));
54 });
55 }
56 }
57 }
58 this.buttonGoto.SetActive(enable);
59 if (this.sb.Equals(this.lastSb))
60 {
61 return;
62 }
63 this.SetActive(true);
64 this.textTitle.SetText(this.quest.GetTitle().TagColor(this.colorTitle));
65 this.text.SetText(this.sb.ToString());
66 this.lastSb.Set(this.sb);
67 this.RebuildLayout(false);
68 }
69
70 // Token: 0x060029C3 RID: 10691 RVA: 0x000EBB3C File Offset: 0x000E9D3C
71 public void OnClickClose()
72 {
73 if (EMono.ui.GetLayer<LayerJournal>(false))
74 {
75 return;
76 }
77 this.quest.track = false;
78 this.Kill();
79 SE.Trash();
80 }
81
82 // Token: 0x060029C4 RID: 10692 RVA: 0x000EBB68 File Offset: 0x000E9D68
83 public void Kill()
84 {
85 if (!WidgetQuestTracker.Instance)
86 {
87 return;
88 }
89 WidgetQuestTracker.Instance.items.Remove(this);
90 UnityEngine.Object.DestroyImmediate(base.gameObject);
91 }
92
93 // Token: 0x0400179B RID: 6043
94 private FastString sb = new FastString(32);
95
96 // Token: 0x0400179C RID: 6044
97 private FastString lastSb = new FastString(32);
98
99 // Token: 0x0400179D RID: 6045
100 public Color colorTitle;
101
102 // Token: 0x0400179E RID: 6046
103 public Quest quest;
104
105 // Token: 0x0400179F RID: 6047
106 public UIText text;
107
108 // Token: 0x040017A0 RID: 6048
109 public UIText textTitle;
110
111 // Token: 0x040017A1 RID: 6049
112 public UIButton buttonGoto;
113}
Definition Chara.cs:12
Definition EMono.cs:6
Definition Map.cs:15
Definition Quest.cs:8