Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
ObjInfo.cs
Go to the documentation of this file.
1using System;
2
3public class ObjInfo : BaseInspectPos
4{
5 public static ObjInfo Temp = new ObjInfo();
6
7 public static ObjInfo TempList = new ObjInfo();
8
9 public static VirtualDate TempDate = new VirtualDate();
10
12
13 public override bool CanInspect => _CanInspect(pos);
14
15 public override string InspectName
16 {
17 get
18 {
19 string text = pos.cell.GetObjName() + (EClass.debug.showExtra ? (" " + pos.cell.matObj.alias) : "");
20 if (pos.growth != null)
21 {
22 if (pos.growth.CanHarvest())
23 {
24 text = "growth_harvest".lang(text);
25 }
26 else if (pos.growth.IsWithered())
27 {
28 text = "growth_withered".lang(text);
29 }
30 else if (pos.growth.IsMature)
31 {
32 text = "growth_mature".lang(text);
33 }
34 if ((EClass._zone.IsPCFaction || EClass._zone is Zone_Tent) && pos.growth.NeedSunlight && !pos.growth.CanGrow(TempDate))
35 {
36 text = "growth_nosun".lang(text);
37 if (pos.cell.HasRoof)
38 {
39 text = "growth_roof".lang(text);
40 }
41 }
42 }
43 return text;
44 }
45 }
46
47 public static ObjInfo GetTemp(Point _pos)
48 {
49 if (!Temp.pos.Equals(_pos))
50 {
51 TempDate = new VirtualDate();
52 }
53 Temp.pos.Set(_pos);
54 return Temp;
55 }
56
57 public static ObjInfo GetTempList(Point _pos)
58 {
59 if (!TempList.pos.Equals(_pos))
60 {
61 TempList = new ObjInfo();
62 }
63 TempList.pos.Set(_pos);
64 return TempList;
65 }
66
67 public static bool _CanInspect(Point pos)
68 {
69 if (pos.HasObj)
70 {
72 {
73 return pos.sourceObj.tileType.IsBlockMount;
74 }
75 return true;
76 }
77 return false;
78 }
79
80 public override void WriteNote(UINote n, Action<UINote> onWriteNote = null, IInspect.NoteMode mode = IInspect.NoteMode.Default, Recipe recipe = null)
81 {
82 n.Clear();
83 UIItem uIItem = n.AddHeaderCard(source.GetName());
84 source.SetImage(uIItem.image2, null, source.GetColorInt(pos.cell.matObj));
85 n.AddText("isMadeOf".lang(source.GetText()));
86 n.Build();
87 }
88}
SourceMaterial.Row matObj
Definition: Cell.cs:1036
bool HasRoof
Definition: Cell.cs:648
string GetObjName()
Definition: Cell.cs:1600
bool HasFullBlock
Definition: Cell.cs:817
Definition: EClass.cs:5
static Zone _zone
Definition: EClass.cs:20
bool CanHarvest()
Definition: GrowSystem.cs:482
bool IsWithered()
Definition: GrowSystem.cs:473
virtual bool IsMature
Definition: GrowSystem.cs:99
bool CanGrow(VirtualDate date)
Definition: GrowSystem.cs:264
SourceObj.Row source
Definition: ObjInfo.cs:11
static ObjInfo GetTemp(Point _pos)
Definition: ObjInfo.cs:47
static VirtualDate TempDate
Definition: ObjInfo.cs:9
override string InspectName
Definition: ObjInfo.cs:16
static ObjInfo TempList
Definition: ObjInfo.cs:7
static ObjInfo Temp
Definition: ObjInfo.cs:5
override void WriteNote(UINote n, Action< UINote > onWriteNote=null, IInspect.NoteMode mode=IInspect.NoteMode.Default, Recipe recipe=null)
Definition: ObjInfo.cs:80
override bool CanInspect
Definition: ObjInfo.cs:13
static bool _CanInspect(Point pos)
Definition: ObjInfo.cs:67
static ObjInfo GetTempList(Point _pos)
Definition: ObjInfo.cs:57
Definition: Point.cs:9
Point Set(int _x, int _z)
Definition: Point.cs:479
SourceObj.Row sourceObj
Definition: Point.cs:69
bool Equals(int _x, int _z)
Definition: Point.cs:924
bool HasObj
Definition: Point.cs:137
Cell cell
Definition: Point.cs:51
GrowSystem growth
Definition: Point.cs:77
Definition: Recipe.cs:7
string GetName(int id)
Definition: SourceObj.cs:149
Definition: UIItem.cs:5
Image image2
Definition: UIItem.cs:16
Definition: UINote.cs:6
UIItem AddHeaderCard(string text, Sprite sprite=null)
Definition: UINote.cs:84
void Clear()
Definition: UINote.cs:35
UIItem AddText(string text, FontColor color=FontColor.DontChange)
Definition: UINote.cs:113
void Build()
Definition: UINote.cs:49
bool IsPCFaction
Definition: Zone.cs:464
NoteMode
Definition: IInspect.cs:7