Elin Decompiled Documentation EA 23.102 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);
88 }
89 }
91 AddThing(a.thing);
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)
114 {
115 if (id.IsEmpty() || id == "notImplemented" || id == "any")
116 {
117 Util.Instantiate(moldUnknown, P_1.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_1.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())
142 {
143 Transform obj = Util.Instantiate(moldCat, transform);
144 string @ref = EMono.sources.categories.map[text].GetName();
145 obj.GetComponentInChildren<UIText>().SetText("category".lang());
146 s = "ingCat".lang(@ref);
147 }
148 component.tooltip.lang = s.ToTitleCase();
149 }
150 }
151 }
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:877
int GetColorInt(SourceMaterial.Row mat)
Definition: RenderRow.cs:417
void SetImage(Image image, Sprite sprite=null, int matCol=0, bool setNativeSize=true, int dir=0, int idSkin=0)
Definition: RenderRow.cs:346
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:35
virtual int numIng
Definition: TraitCrafter.cs:33
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
string lang
Definition: UIText.cs:9
Definition: Util.cs:10
static Transform Instantiate(string path, Component parent=null)
Definition: Util.cs:67
FortuneRollData GetOrCreateFortuneRollData(bool refresh=true)
Definition: Zone.cs:3536

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, UIText.lang, 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 153 of file UIDragGridInfo.cs.

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

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: