Elin Modding Docs Doc
Loading...
Searching...
No Matches
ItemResearch.cs
1using System;
2using UnityEngine.UI;
3
4// Token: 0x02000554 RID: 1364
5public class ItemResearch : UIItem
6{
7 // Token: 0x06002506 RID: 9478 RVA: 0x000D1BBC File Offset: 0x000CFDBC
8 public void SetPlan(ResearchPlan p, UIList list, FactionBranch branch, LayerTech layer)
9 {
10 bool isFinished = !branch.researches.plans.Contains(p);
11 this.plan = p;
12 this.button1.mainText.text = p.Name;
13 this.goFocus.SetActive(branch.researches.focused == p);
14 string text = p.source.tech.ToString("#,0").TagColorGoodBad(() => branch.researches.CanCompletePlan(p), false);
15 this.button1.subText.text = text;
16 this.button1.subText.SetActive(!isFinished);
17 this.imageExp.fillAmount = (float)branch.resources.knowledge.value / (float)p.source.tech;
18 this.button1.tooltip.onShowTooltip = delegate(UITooltip tp)
19 {
20 p.WriteNote(tp.note);
21 };
22 Action <>9__3;
23 this.button1.onClick.AddListener(delegate()
24 {
25 if (isFinished)
26 {
27 return;
28 }
29 if (!branch.researches.CanCompletePlan(p))
30 {
31 SE.Beep();
32 return;
33 }
34 UIContextMenu uicontextMenu = EClass.ui.CreateContextMenuInteraction().SetHighlightTarget(this.button1);
35 string idLang = "buy";
36 Action action;
37 if ((action = <>9__3) == null)
38 {
39 action = (<>9__3 = delegate()
40 {
41 branch.resources.knowledge.Mod(-p.source.tech, true);
42 branch.researches.CompletePlan(p);
43 layer.RefreshTech();
44 });
45 }
46 uicontextMenu.AddButton(idLang, action, true);
47 uicontextMenu.Show();
48 });
49 }
50
51 // Token: 0x04001493 RID: 5267
52 public Image imageExp;
53
54 // Token: 0x04001494 RID: 5268
55 public Image goFocus;
56
57 // Token: 0x04001495 RID: 5269
58 public ResearchPlan plan;
59}