Elin Modding Docs Doc
Loading...
Searching...
No Matches
ContentQuest.cs
1using System;
2using UnityEngine;
3using UnityEngine.UI;
4
5// Token: 0x02000589 RID: 1417
6public class ContentQuest : EContent
7{
8 // Token: 0x0600270F RID: 9999 RVA: 0x000DD850 File Offset: 0x000DBA50
9 public override void OnSwitchContent(int idTab)
10 {
11 this.list.sortMode = UIList.SortMode.ByValue;
12 BaseList baseList = this.list;
13 UIList.Callback<Quest, ItemGeneral> callback = new UIList.Callback<Quest, ItemGeneral>();
14 callback.onInstantiate = delegate(Quest a, ItemGeneral b)
15 {
16 b.SetSound(null);
17 string text = a.GetTitle();
18 if (EClass.debug.showExtra)
19 {
20 text = text + "(" + a.phase.ToString() + ")";
21 }
22 b.button1.mainText.SetText(a.TitlePrefix + text);
23 b.SetSubText(a.TextDeadline, 260, FontColor.Default, TextAnchor.MiddleRight);
24 b.button2.SetActive(EClass.debug.enable && a.CanAutoAdvance);
25 if (EClass.debug.enable && a.CanAutoAdvance)
26 {
27 b.button2.SetOnClick(delegate
28 {
29 if (a.task != null)
30 {
31 a.CompleteTask();
32 }
33 else if (a is QuestSequence)
34 {
35 a.NextPhase();
36 }
37 else
38 {
39 a.Complete();
40 }
41 this.list.List(false);
42 });
43 }
44 b.button3.SetOnClick(delegate
45 {
46 a.track = !a.track;
47 if (!WidgetQuestTracker.Instance)
48 {
49 EClass.player.questTracker = true;
50 EClass.ui.widgets.ActivateWidget("QuestTracker");
51 WidgetHotbar.RefreshButtons();
52 }
53 WidgetQuestTracker.Instance.Refresh();
54 this.list.Select(a, false);
55 this.SelectQuest(a);
56 this.RefreshTrackButtons();
57 });
58 };
59 callback.onClick = delegate(Quest a, ItemGeneral b)
60 {
61 this.SelectQuest(a);
62 };
63 callback.onList = delegate(UIList.SortMode m)
64 {
65 foreach (Quest o in EClass.game.quests.list)
66 {
67 this.list.Add(o);
68 }
69 };
70 callback.onSort = ((Quest a, UIList.SortMode m) => -EClass.sources.quests.rows.IndexOf(a.source));
71 baseList.callbacks = callback;
72 this.list.List(false);
73 this.SelectQuest(this.list.items[0] as Quest);
74 this.RefreshTrackButtons();
75 }
76
77 // Token: 0x06002710 RID: 10000 RVA: 0x000DD904 File Offset: 0x000DBB04
78 public void RefreshTrackButtons()
79 {
80 foreach (UIList.ButtonPair buttonPair in this.list.buttons)
81 {
82 Quest quest = buttonPair.obj as Quest;
83 (buttonPair.component as ItemGeneral).button3.icon.SetActive(quest.track);
84 }
85 }
86
87 // Token: 0x06002711 RID: 10001 RVA: 0x000DD980 File Offset: 0x000DBB80
88 public void SelectQuest(Quest q)
89 {
90 this.buttonAbandon.SetActive(q.CanAbandon);
91 Action <>9__1;
92 this.buttonAbandon.SetOnClick(delegate
93 {
94 string langDetail = "dialog_abandonQuest";
95 Action actionYes;
96 if ((actionYes = <>9__1) == null)
97 {
98 actionYes = (<>9__1 = delegate()
99 {
100 Msg.Say("questAbandon", q.GetTitle(), null, null, null);
101 q.Fail();
102 this.OnSwitchContent(0);
103 });
104 }
105 Dialog.YesNo(langDetail, actionYes, null, "yes", "no");
106 });
107 this.textClient.text = q.person.NameBraced;
108 this.textReward.SetText(q.GetRewardText());
109 string text = q.GetDetail(true);
110 if (EClass.debug.showExtra && q.person != null)
111 {
112 text += Environment.NewLine;
113 string[] array = new string[7];
114 array[0] = text;
115 array[1] = q.person.id;
116 array[2] = "/";
117 array[3] = q.person.name;
118 array[4] = "/";
119 int num = 5;
120 Chara chara = q.person.chara;
121 array[num] = ((chara != null) ? chara.ToString() : null);
122 array[6] = Environment.NewLine;
123 text = string.Concat(array);
124 QuestDeliver questDeliver = q as QuestDeliver;
125 if (questDeliver != null)
126 {
127 string str = text;
128 string str2 = questDeliver.uidDest.ToString();
129 string str3 = "/";
130 Chara destChara = questDeliver.DestChara;
131 text = str + str2 + str3 + ((destChara != null) ? destChara.ToString() : null);
132 }
133 }
134 this.textDetail.SetText(text);
135 this.textHours.text = q.TextDeadline;
136 Text text2 = this.textZone;
137 Zone clientZone = q.ClientZone;
138 text2.text = (((clientZone != null) ? clientZone.Name : null) ?? "-");
139 this.portrait.SetPerson(q.person);
140 this.RebuildLayout(true);
141 }
142
143 // Token: 0x04001598 RID: 5528
144 public UIList list;
145
146 // Token: 0x04001599 RID: 5529
147 public UIText textClient;
148
149 // Token: 0x0400159A RID: 5530
150 public UIText textTitle;
151
152 // Token: 0x0400159B RID: 5531
153 public UIText textDetail;
154
155 // Token: 0x0400159C RID: 5532
156 public UIText textHours;
157
158 // Token: 0x0400159D RID: 5533
159 public UIText textNote;
160
161 // Token: 0x0400159E RID: 5534
162 public UIText textReward;
163
164 // Token: 0x0400159F RID: 5535
165 public UIText textZone;
166
167 // Token: 0x040015A0 RID: 5536
168 public Portrait portrait;
169
170 // Token: 0x040015A1 RID: 5537
171 public UIButton buttonAbandon;
172}
Definition Chara.cs:12
Definition Msg.cs:7
Definition Quest.cs:8
Definition Zone.cs:14