Elin Decompiled Documentation EA 23.130 Nightly
Loading...
Searching...
No Matches
UIDragGridInfo Class Reference
Inheritance diagram for UIDragGridInfo:
EMono

Public Member Functions

void Refresh ()
 
void Init (Card _owner)
 
void InitFuel (Card _owner)
 

Public Attributes

Window window
 
UIText textHeader
 
Transform transMold
 
Transform moldThing
 
Transform moldPlus
 
Transform moldEqual
 
Transform moldOr
 
Transform moldCat
 
Transform moldUnknown
 
UIList list
 
Card owner
 
UINote note
 

Private Member Functions

void Awake ()
 

Additional Inherited Members

- Static Public Member Functions inherited from EMono
static int rnd (int a)
 
- Static Public Attributes inherited from EMono
static Core core
 
- Properties inherited from EMono
static Game game [get]
 
static bool AdvMode [get]
 
static Player player [get]
 
static Chara pc [get]
 
static UI ui [get]
 
static Map _map [get]
 
static Zone _zone [get]
 
static FactionBranch Branch [get]
 
static FactionBranch BranchOrHomeBranch [get]
 
static Faction Home [get]
 
static Scene scene [get]
 
static BaseGameScreen screen [get]
 
static GameSetting setting [get]
 
static GameData gamedata [get]
 
static ColorProfile Colors [get]
 
static World world [get]
 
static SoundManager Sound [get]
 
static SourceManager sources [get]
 
static SourceManager editorSources [get]
 
static CoreDebug debug [get]
 

Detailed Description

Definition at line 6 of file UIDragGridInfo.cs.

Member Function Documentation

◆ Awake()

void UIDragGridInfo.Awake ( )
inlineprivate

Definition at line 32 of file UIDragGridInfo.cs.

33 {
34 window.SetActive(enable: false);
35 transMold.SetActive(enable: false);
36 }
Transform transMold

References transMold, and window.

◆ Init()

void UIDragGridInfo.Init ( Card  _owner)
inline

Definition at line 43 of file UIDragGridInfo.cs.

44 {
45 owner = _owner;
46 TraitCrafter crafter = owner.trait as TraitCrafter;
47 if (crafter == null)
48 {
49 return;
50 }
51 textHeader.text = "knownRecipe".lang();
52 List<SourceRecipe.Row> recipes = EMono.sources.recipes.rows.Where((SourceRecipe.Row r) => r.factory == crafter.IdSource).ToList();
53 if (recipes.Count == 0)
54 {
55 return;
56 }
57 list.callbacks = new UIList.Callback<SourceRecipe.Row, LayoutGroup>
58 {
59 onClick = delegate
60 {
61 },
62 onInstantiate = delegate(SourceRecipe.Row a, LayoutGroup b)
63 {
64 for (int i = 0; i < crafter.numIng; i++)
65 {
66 if (i != 0)
67 {
69 }
70 string[] array2 = i switch
71 {
72 1 => a.ing2,
73 0 => a.ing1,
74 _ => a.ing3,
75 };
76 if (array2.IsEmpty())
77 {
78 break;
79 }
80 string[] array3 = array2;
81 foreach (string text2 in array3)
82 {
83 if (text2 != array2[0])
84 {
86 }
87 AddThing(text2, null);
88 }
89 }
91 AddThing(a.thing, (a.type == "FixedResource") ? "noInherit" : null);
92 },
93 onList = delegate
94 {
95 foreach (SourceRecipe.Row item in recipes)
96 {
97 if (item.tag.Contains("known") || EMono.player.knownCraft.Contains(item.id) || EMono.debug.godCraft)
98 {
99 list.Add(item);
100 }
101 }
102 }
103 };
104 list.List();
105 TraitRollingFortune traitRollingFortune = owner.trait as TraitRollingFortune;
106 note.SetActive(traitRollingFortune != null);
107 if (traitRollingFortune != null)
108 {
110 }
111 window.SetActive(enable: true);
112 window.RebuildLayout(recursive: true);
113 void AddThing(string id, string lang)
114 {
115 if (id.IsEmpty() || id == "notImplemented" || id == "any")
116 {
117 Util.Instantiate(moldUnknown, P_2.b).GetComponentInChildren<UIButton>().tooltip.lang = "???";
118 }
119 else
120 {
121 id = id.Replace("%", "@");
122 string[] array = id.Split('@');
123 string text = "";
124 id = array[0];
125 if (id.StartsWith('#'))
126 {
127 text = id.Replace("#", "");
128 id = EMono.sources.categories.map[text].GetIdThing();
129 }
130 CardRow cardRow = EMono.sources.cards.map[id];
132 if (array.Length >= 2)
133 {
134 mat = ((!(array[1] == "gelatin")) ? EMono.sources.materials.alias[array[1]] : EMono.sources.materials.alias["jelly"]);
135 }
136 Transform transform = Util.Instantiate(moldThing, P_2.b);
137 Image componentInChildren = transform.GetComponentInChildren<Image>();
138 UIButton component = componentInChildren.GetComponent<UIButton>();
139 cardRow.SetImage(componentInChildren, null, cardRow.GetColorInt(mat));
140 string s = cardRow.GetName();
141 if (!text.IsEmpty() || lang != null)
142 {
143 Util.Instantiate(moldCat, transform).GetComponentInChildren<UIText>().SetText((lang ?? "category").lang());
144 if (lang == null)
145 {
146 string @ref = EMono.sources.categories.map[text].GetName();
147 s = "ingCat".lang(@ref);
148 }
149 }
150 component.tooltip.lang = s.ToTitleCase();
151 }
152 }
153 }
virtual string GetName(int i)
Definition: CardRow.cs:95
bool godCraft
Definition: CoreDebug.cs:180
Definition: EMono.cs:4
static Player player
Definition: EMono.cs:11
static Zone _zone
Definition: EMono.cs:19
static CoreDebug debug
Definition: EMono.cs:45
static SourceManager sources
Definition: EMono.cs:41
void WriteNote(UINote n)
HashSet< int > knownCraft
Definition: Player.cs:892
int GetColorInt(SourceMaterial.Row mat)
Definition: RenderRow.cs:422
void SetImage(Image image, Sprite sprite=null, int matCol=0, bool setNativeSize=true, int dir=0, int idSkin=0)
Definition: RenderRow.cs:351
SourceMaterial.Row DefaultMaterial
Definition: RenderRow.cs:86
Dictionary< string, CardRow > map
Definition: SourceCard.cs:8
SourceMaterial materials
SourceCard cards
SourceRecipe recipes
SourceCategory categories
virtual string IdSource
Definition: TraitCrafter.cs:36
virtual int numIng
Definition: TraitCrafter.cs:34
Transform moldPlus
Transform moldUnknown
Transform moldCat
Transform moldOr
Transform moldEqual
Transform moldThing
Definition: UIList.cs:9
override void Add(object item)
Definition: UIList.cs:302
override void List()
Definition: UIList.cs:717
Definition: UIText.cs:6
Definition: Util.cs:10
static Transform Instantiate(string path, Component parent=null)
Definition: Util.cs:67
FortuneRollData GetOrCreateFortuneRollData(bool refresh=true)
Definition: Zone.cs:3556

References EMono._zone, UIList.Add(), SourceManager.cards, SourceManager.categories, EMono.debug, RenderRow.DefaultMaterial, RenderRow.GetColorInt(), CardRow.GetName(), Zone.GetOrCreateFortuneRollData(), CoreDebug.godCraft, TraitCrafter.IdSource, item, Player.knownCraft, UIList.List(), list, SourceCard.map, SourceManager.materials, moldCat, moldEqual, moldOr, moldPlus, moldThing, moldUnknown, note, TraitCrafter.numIng, owner, EMono.player, SourceManager.recipes, RenderRow.SetImage(), EMono.sources, Util, window, and FortuneRollData.WriteNote().

Referenced by Refresh().

◆ InitFuel()

void UIDragGridInfo.InitFuel ( Card  _owner)
inline

Definition at line 155 of file UIDragGridInfo.cs.

156 {
157 owner = _owner;
158 textHeader.text = "knownFuel".lang();
159 List<SourceThing.Row> fuels = new List<SourceThing.Row>();
160 foreach (SourceThing.Row row in EMono.sources.things.rows)
161 {
162 if (owner.trait.IsFuel(row.id))
163 {
164 fuels.Add(row);
165 }
166 }
167 list.callbacks = new UIList.Callback<SourceThing.Row, LayoutGroup>
168 {
169 onClick = delegate
170 {
171 },
172 onInstantiate = delegate(SourceThing.Row a, LayoutGroup b)
173 {
174 AddThing(a.id);
176 AddThing(owner.id);
177 },
178 onList = delegate
179 {
180 foreach (SourceThing.Row item in fuels)
181 {
182 list.Add(item);
183 }
184 }
185 };
186 list.List();
187 window.SetActive(enable: true);
188 window.RebuildLayout(recursive: true);
189 void AddThing(string id)
190 {
191 if (id.IsEmpty() || id == "notImplemented" || id == "any")
192 {
193 Util.Instantiate(moldUnknown, P_1.b).GetComponentInChildren<UIButton>().tooltip.lang = "???";
194 }
195 else
196 {
197 id = id.Replace("%", "@");
198 string[] array = id.Split('@');
199 string cat = "";
200 id = array[0];
201 if (id.StartsWith('#'))
202 {
203 cat = id.Replace("#", "");
204 List<CardRow> obj = EMono.sources.cards.rows.Where((CardRow r) => r.Category.IsChildOf(cat)).ToList();
205 obj.Sort((CardRow a, CardRow b) => a.value - b.value);
206 id = obj[0].id;
207 }
208 CardRow cardRow = EMono.sources.cards.map[id];
210 if (array.Length >= 2)
211 {
212 mat = ((!(array[1] == "gelatin")) ? EMono.sources.materials.alias[array[1]] : EMono.sources.materials.alias["jelly"]);
213 }
214 Transform transform = Util.Instantiate(moldThing, P_1.b);
215 Image componentInChildren = transform.GetComponentInChildren<Image>();
216 UIButton component = componentInChildren.GetComponent<UIButton>();
217 cardRow.SetImage(componentInChildren, null, cardRow.GetColorInt(mat));
218 string s = cardRow.GetName();
219 if (!cat.IsEmpty())
220 {
221 Transform obj2 = Util.Instantiate(moldCat, transform);
222 string @ref = EMono.sources.categories.map[cat].GetName();
223 obj2.GetComponentInChildren<UIText>().SetText("(" + "category".lang() + ")");
224 s = "ingCat".lang(@ref);
225 }
226 component.tooltip.lang = s.ToTitleCase();
227 }
228 }
229 }
string id
Definition: Card.cs:31
Trait trait
Definition: Card.cs:49
SourceCategory.Row Category
Definition: RenderRow.cs:119
int value
Definition: RenderRow.cs:20
List< CardRow > rows
Definition: SourceCard.cs:6
SourceThing things
bool IsFuel(string s)
Definition: Trait.cs:1316
string lang
Definition: UIText.cs:9

References UIList.Add(), SourceManager.cards, SourceManager.categories, RenderRow.Category, RenderRow.DefaultMaterial, RenderRow.GetColorInt(), CardRow.GetName(), Card.id, Trait.IsFuel(), item, UIText.lang, UIList.List(), list, SourceCard.map, SourceManager.materials, moldCat, moldEqual, moldThing, moldUnknown, owner, SourceCard.rows, RenderRow.SetImage(), EMono.sources, SourceManager.things, Card.trait, Util, RenderRow.value, and window.

◆ Refresh()

void UIDragGridInfo.Refresh ( )
inline

Definition at line 38 of file UIDragGridInfo.cs.

39 {
40 Init(owner);
41 }
void Init(Card _owner)

References Init(), and owner.

Referenced by TraitCrafter.Craft().

Member Data Documentation

◆ list

UIList UIDragGridInfo.list

Definition at line 26 of file UIDragGridInfo.cs.

Referenced by Init(), and InitFuel().

◆ moldCat

Transform UIDragGridInfo.moldCat

Definition at line 22 of file UIDragGridInfo.cs.

Referenced by Init(), and InitFuel().

◆ moldEqual

Transform UIDragGridInfo.moldEqual

Definition at line 18 of file UIDragGridInfo.cs.

Referenced by Init(), and InitFuel().

◆ moldOr

Transform UIDragGridInfo.moldOr

Definition at line 20 of file UIDragGridInfo.cs.

Referenced by Init().

◆ moldPlus

Transform UIDragGridInfo.moldPlus

Definition at line 16 of file UIDragGridInfo.cs.

Referenced by Init().

◆ moldThing

Transform UIDragGridInfo.moldThing

Definition at line 14 of file UIDragGridInfo.cs.

Referenced by Init(), and InitFuel().

◆ moldUnknown

Transform UIDragGridInfo.moldUnknown

Definition at line 24 of file UIDragGridInfo.cs.

Referenced by Init(), and InitFuel().

◆ note

UINote UIDragGridInfo.note

Definition at line 30 of file UIDragGridInfo.cs.

Referenced by Init().

◆ owner

Card UIDragGridInfo.owner

Definition at line 28 of file UIDragGridInfo.cs.

Referenced by Init(), InitFuel(), and Refresh().

◆ textHeader

UIText UIDragGridInfo.textHeader

Definition at line 10 of file UIDragGridInfo.cs.

◆ transMold

Transform UIDragGridInfo.transMold

Definition at line 12 of file UIDragGridInfo.cs.

Referenced by Awake().

◆ window

Window UIDragGridInfo.window

Definition at line 8 of file UIDragGridInfo.cs.

Referenced by Awake(), Init(), and InitFuel().


The documentation for this class was generated from the following file: