Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
ButtonGrid.cs
Go to the documentation of this file.
1using System;
2using System.Collections.Generic;
3using UnityEngine;
4using UnityEngine.UI;
5
7{
8 public enum Mode
9 {
10 Default,
11 Grid,
13 Recipe,
15 Search
16 }
17
18 public Area area;
19
20 public Recipe recipe;
21
23
24 public Card card;
25
26 public int index;
27
29
30 public bool keepBg;
31
32 [NonSerialized]
33 public List<Transform> listAttach = new List<Transform>();
34
35 private int rightAttachCount;
36
38
39 public Card Card
40 {
41 get
42 {
43 if (card == null || card.isDestroyed)
44 {
45 return null;
46 }
47 return card;
48 }
49 }
50
51 public virtual float extFixY => 0f;
52
53 public override string ToString()
54 {
55 return card?.ToString();
56 }
57
58 public T Attach<T>(string id, bool rightAttach = true) where T : Component
59 {
60 return Attach(id, rightAttach).GetComponent<T>();
61 }
62
63 public Transform Attach(string id, bool rightAttach = true)
64 {
65 Transform transform = PoolManager.Spawn<Transform>("attach_" + id, "UI/Element/Grid/Attach/" + id, base.transform);
66 listAttach.Add(transform);
67 if (rightAttach)
68 {
69 RectTransform rectTransform = transform.Rect();
70 rectTransform.anchoredPosition = new Vector2(rectTransform.anchoredPosition.x, -8 - 8 * rightAttachCount);
71 transform.tag = "RightAttach";
73 }
74 transform.name = id;
75 return transform;
76 }
77
78 public void Dettach(string id)
79 {
80 listAttach.ForeachReverse(delegate(Transform t)
81 {
82 if (t.name == id)
83 {
84 if (t.tag.Contains("RightAttach"))
85 {
86 rightAttachCount--;
87 }
88 listAttach.Remove(t);
90 }
91 });
92 }
93
94 public void Reset()
95 {
96 base.image.color = Color.white;
97 if (listAttach.Count > 0)
98 {
99 foreach (Transform item in listAttach)
100 {
102 }
103 listAttach.Clear();
104 }
105 if ((bool)icon)
106 {
107 icon.enabled = true;
108 }
109 rightAttachCount = 0;
110 }
111
112 protected override void OnDestroy()
113 {
114 if (listAttach.Count > 0)
115 {
116 Reset();
117 }
118 rightAttachCount = 0;
119 }
120
121 public void SetBodySlot(BodySlot b, InvOwner owner, bool showIndex = false)
122 {
123 SetCardGrid(b.thing, owner);
124 imageCheck.sprite = SpriteSheet.Get("Media/Graphics/Icon/Element/", "eq_" + b.element.alias);
125 imageCheck.SetNativeSize();
126 imageCheck.SetAlpha((b.thing == null) ? 1f : 0.4f);
127 if ((bool)subText)
128 {
129 if (showIndex)
130 {
131 owner.owner.Chara.body.SetBodyIndexText(b, subText);
132 }
133 else
134 {
135 subText.SetActive(enable: false);
136 }
137 }
138 }
139
140 public void Redraw()
141 {
142 SetCardGrid(card, invOwner);
143 }
144
145 public void SetCardGrid(Card c, InvOwner owner = null)
146 {
147 if (owner != null)
148 {
149 invOwner = owner;
150 }
151 if (c != null && !c.isDestroyed)
152 {
153 base.interactable = true;
154 }
155 SetCard(c, Mode.Grid, delegate(UINote n)
156 {
157 invOwner?.OnWriteNote(this, n);
158 });
159 onRightClick = delegate
160 {
161 if (EClass.ui.AllowInventoryInteractions && invOwner != null)
162 {
163 InvOwner.clickTimer = 0f;
164 invOwner.OnRightClick(this);
165 UIButton.onPressed = delegate
166 {
167 invOwner.OnRightPressed(this);
168 };
169 EInput.Consume();
171 }
172 };
173 this.SetOnClick(delegate
174 {
175 if (EClass.ui.AllowInventoryInteractions)
176 {
177 invOwner?.OnClick(this);
178 EInput.Consume();
179 UIButton.TryShowTip();
180 }
181 });
182 }
183
184 public void SetCard(Card c, Mode mode = Mode.Default, Action<UINote> onWriteNote = null)
185 {
186 Reset();
188 card = c;
189 bool showNew = invOwner?.ShowNew ?? false;
190 if (c == null || c.isDestroyed)
191 {
192 if (mode != Mode.Ingredient)
193 {
194 RefreshBG();
195 icon.sprite = EClass.core.refs.icons.trans;
196 mainText.text = "";
197 if ((bool)subText)
198 {
199 subText.text = "";
200 }
201 }
202 else
203 {
204 icon.sprite = Core.Instance.refs.spriteNoIng;
205 }
206 icon.SetNativeSize();
207 if (invOwner == null || !invOwner.AlwaysShowTooltip || onWriteNote == null)
208 {
209 SetTooltip(null, enable: false);
210 return;
211 }
212 SetTooltip("note", delegate(UITooltip t)
213 {
214 onWriteNote(t.note);
215 });
216 return;
217 }
218 SetTooltip("note", delegate(UITooltip t)
219 {
220 if (c.isNew)
221 {
222 c.isNew = false;
223 RefreshBG();
224 }
225 c.WriteNote(t.note, onWriteNote);
226 if (ing != null)
227 {
228 t.note.Space();
229 t.note.AddText("mark_ing".lang() + (ing.optional ? "opIngredient" : "reqIng").lang(ing.GetName()));
230 }
231 });
232 c.SetImage(icon);
233 if (c == EClass.pc.held && c.invY != 1)
234 {
235 Attach("held");
236 }
237 if (c.trait is TraitAbility && (c.trait as TraitAbility).CanUse(EClass.pc))
238 {
239 Attach<Image>("target_self").sprite = (c.trait as TraitAbility).act.TargetType.IconType;
240 }
242 {
243 SourceElement.Row refElement = c.trait.GetRefElement();
244 if (refElement != null)
245 {
246 if ((bool)refElement.GetSprite())
247 {
248 Image image = Attach<Image>("reficon", rightAttach: false);
249 refElement.SetImage(image);
250 }
251 }
252 else
253 {
254 Sprite refSprite = c.trait.GetRefSprite();
255 if ((bool)refSprite)
256 {
257 Image obj = Attach<Image>("reficon", rightAttach: false);
258 obj.sprite = refSprite;
259 obj.color = Color.white;
260 }
261 }
262 }
263 if (c.qualityTier > 0)
264 {
265 Attach<Image>("quality", rightAttach: false).sprite = EClass.core.refs.icons.quality[Mathf.Clamp(c.qualityTier - 1, 0, EClass.core.refs.icons.quality.Count - 1)];
266 }
267 if (c.c_equippedSlot != 0 && invOwner != null && invOwner.owner.isChara && !invOwner.owner.IsPC)
268 {
269 Attach("equip", rightAttach: false);
270 }
271 if (c.isNPCProperty || c.isGifted)
272 {
273 Attach("npcProperty");
274 }
275 if (mode != Mode.Search)
276 {
277 c.trait.OnSetCardGrid(this);
278 }
279 switch (mode)
280 {
281 case Mode.Grid:
282 case Mode.Search:
283 RefreshBG();
284 if (c.IsContainer && c.c_indexContainerIcon != 0)
285 {
286 Attach("icon_container", rightAttach: false).GetComponent<Image>().sprite = EClass.core.refs.spritesContainerIcon[c.c_indexContainerIcon];
287 }
288 if (c.IsIdentified)
289 {
290 BlessedState blessedState2 = c.blessedState;
291 if (blessedState2 != 0)
292 {
293 Attach("status_" + blessedState2);
294 }
295 }
296 else
297 {
298 Attach("status_unidentified");
299 }
300 if (c.IsDecayed)
301 {
302 Attach("rotten");
303 }
304 else if (c.IsRotting)
305 {
306 Attach("rotting");
307 }
308 c.trait.SetMainText(mainText, hotitem: false);
309 if (mode == Mode.Search)
310 {
311 Card rootCard = c.GetRootCard();
312 if (rootCard != EClass.pc)
313 {
314 Attach((rootCard == c) ? "searched" : "searched_container", rightAttach: false);
315 }
316 }
317 break;
318 case Mode.Default:
319 {
320 Color c2 = Colors.Skin.textUnidentified;
321 if (c.IsIdentified)
322 {
323 c2 = c.blessedState switch
324 {
325 BlessedState.Blessed => Colors.Skin.textBlessed,
326 BlessedState.Doomed => Colors.Skin.textDoomed,
327 BlessedState.Cursed => Colors.Skin.textCursed,
328 _ => Colors.Skin.textIdentified,
329 };
330 }
331 mainText.SetText(c.Name, c2);
332 if ((bool)subText)
333 {
334 subText.SetText(Lang._weight(c.ChildrenAndSelfWeight));
335 }
336 break;
337 }
338 case Mode.Ingredient:
339 if (c.IsIdentified)
340 {
341 BlessedState blessedState = c.blessedState;
342 if (blessedState != 0)
343 {
344 Attach("status_" + blessedState);
345 }
346 }
347 else
348 {
349 Attach("status_unidentified");
350 }
351 if (c.IsDecayed)
352 {
353 Attach("rotten");
354 }
355 else if (c.IsRotting)
356 {
357 Attach("rotting");
358 }
359 break;
360 }
361 if (c.c_isImportant)
362 {
363 Attach("important");
364 }
365 void RefreshBG()
366 {
367 if (!keepBg)
368 {
369 if (c == null)
370 {
371 base.image.sprite = refs.bgDefault;
372 }
373 else
374 {
375 Sprite sprite = refs.bgDefault;
376 if (c.rarity >= Rarity.Superior && c.IsIdentified && c.IsEquipmentOrRangedOrAmmo)
377 {
378 sprite = ((c.rarity >= Rarity.Artifact) ? refs.bgArtifact : ((c.rarity >= Rarity.Mythical) ? refs.bgMythical : ((c.rarity < Rarity.Legendary) ? refs.bgSuperior : refs.bgLegendary)));
379 }
380 else if (showNew && c.isNew && c.invY != 1)
381 {
382 sprite = refs.bgNew;
383 }
384 base.image.sprite = sprite;
385 }
386 }
387 }
388 }
389
390 public void SetArea(Area a)
391 {
392 Reset();
393 icon.sprite = SpriteSheet.Get("icon_area");
394 icon.SetNativeSize();
395 mainText.SetActive(enable: false);
396 }
397
398 public void SetItem(GridItem i)
399 {
400 Reset();
401 mainText.SetActive(enable: true);
402 i.SetButton(this);
403 }
404
405 public void SetObject(object o)
406 {
407 if (o is Area)
408 {
409 SetArea(o as Area);
410 }
411 else if (o is Card)
412 {
413 SetCard(o as Card);
414 }
415 }
416
417 public void SetDummy()
418 {
419 Reset();
420 icon.enabled = false;
421 mainText.SetActive(enable: false);
422 base.onClick.RemoveAllListeners();
423 base.onClick.AddListener(delegate
424 {
425 SE.BeepSmall();
426 });
427 tooltip.enable = false;
428 base.image.color = new Color(1f, 1f, 1f, 0.3f);
429 }
430
431 public virtual void SetDragParent(IDragParent p)
432 {
433 }
434
436 {
437 if (_ing.id.IsEmpty())
438 {
439 SetDummy();
440 return;
441 }
442 mainText.SetActive(enable: true);
443 base.image.color = Color.white;
444 ing = _ing;
445 if (ing.thing != null && (ing.thing.isDestroyed || ing.thing.Num == 0))
446 {
447 ing.thing = null;
448 }
449 Thing thing = ing.thing;
450 SetCard(thing, Mode.Ingredient);
451 if (r != null && r.source.colorIng != 0 && r.ingredients != null && r.ingredients.Count > 0 && r.ingredients.IndexOf(_ing) == r.source.colorIng)
452 {
453 Attach("ing_color", rightAttach: false);
454 }
455 if (ing.optional)
456 {
457 UIButton componentInChildren = Attach("ing_option", rightAttach: false).GetComponentInChildren<UIButton>(includeInactive: true);
458 componentInChildren.SetActive(ing.thing != null);
459 componentInChildren.SetOnClick(delegate
460 {
461 SE.Trash();
462 ing.thing = null;
463 SetIngredient(r, _ing);
466 if ((bool)LayerCraft.Instance)
467 {
469 }
470 });
471 }
473 int num = thing?.Num ?? 0;
474 int num2 = summary.countValid;
475 if (num2 == 0)
476 {
477 num2 = 1;
478 }
479 num2 *= ing.req;
480 if (ing.optional && num == 0)
481 {
482 num2 = 0;
483 }
484 bool flag = num < num2 && !ing.optional;
485 string text = (num.ToString() ?? "").TagColor(Colors.colorIngPredict) + (" -" + num2).TagColor(flag ? Colors.colorIngCost : Colors.colorIngReq);
486 mainText.text = text;
487 if (thing == null)
488 {
489 SetTooltip("note", delegate(UITooltip tt)
490 {
491 tt.note.Clear();
492 tt.note.Space(16);
493 tt.note.AddText("mark_ing".lang() + (ing.optional ? "opIngredient" : "noIngredient").lang(_ing.GetName()), ing.optional ? FontColor.Good : FontColor.Bad);
494 tt.note.Build();
495 });
496 EClass.sources.cards.map[ing.IdThing].SetImage(icon);
497 icon.SetAlpha(0.5f);
498 }
499 else if (thing.GetRootCard() != EClass.pc)
500 {
501 Attach("pcInv", rightAttach: false);
502 }
503 }
504
505 public void SetIngredient(Recipe r, Thing t)
506 {
507 SetCard(t, Mode.Ingredient);
508 int num = t.Num;
509 mainText.text = num.ToString() ?? "";
510 mainText.SetActive(enable: true);
511 ing = null;
512 if (t.GetRootCard() != EClass.pc)
513 {
514 Attach("pcInv", rightAttach: false);
515 }
516 }
517
519 {
520 Reset();
521 Recipe recipe = a.recipe;
522 if (recipe.UseStock && !recipe.VirtualBlock && recipe.ingredients[0].thing != null)
523 {
524 recipe.ingredients[0].thing.SetImage(icon, a.dir, recipe.ingredients[0].thing.trait.IdSkin);
525 }
526 else
527 {
528 recipe.renderRow.SetImage(icon, null, recipe.renderRow.GetColorInt(recipe.GetColorMaterial()), setNativeSize: true, a.dir, recipe.idSkin);
529 }
530 mainText.SetActive(enable: false);
531 }
532
533 public void SetRecipe()
534 {
535 SetRecipe(recipe);
536 }
537
538 public void SetRecipe(Area a)
539 {
540 Reset();
541 area = a;
542 icon.sprite = Core.Instance.refs.spriteArea;
543 icon.SetNativeSize();
544 mainText.SetActive(enable: false);
545 }
546
547 public void SetRecipe(Recipe r)
548 {
549 Reset();
550 recipe = r;
551 if (r.UseStock)
552 {
553 recipe.ingredients[0].RefreshThing();
554 Thing thing = recipe.ingredients[0].thing;
555 mainText.SetText(thing.Num.ToString() ?? "", SkinManager.CurrentColors.buttonGrid);
556 if (r.VirtualBlock)
557 {
558 r.renderRow.SetImage(icon, null, r.GetDefaultColor(), setNativeSize: true, 0, thing.trait.IdSkin);
559 }
560 else
561 {
562 thing.SetImage(icon);
563 }
564 }
565 else
566 {
567 r.renderRow.SetImage(icon, null, r.GetDefaultColor(), setNativeSize: true, 0, r.idSkin);
568 }
569 mainText.SetActive(r.UseStock);
570 if (r.UseStock && r.ingredients[0].thing?.GetRootCard() != EClass.pc)
571 {
572 Attach("pcInv", rightAttach: false);
573 }
574 }
575
576 public void RefreshCraftable()
577 {
578 ThingStack thingStack = EClass.pc.things.GetThingStack(recipe.GetIdThing(), recipe.GetRefVal());
579 bool flag = recipe.IsCraftable();
580 mainText.SetText(recipe.Name, flag ? FontColor.Good : FontColor.Bad);
581 subText.text = thingStack.count.ToString() ?? "";
582 recipe.SetTextDifficulty(subText2);
583 }
584
585 public void SetCraftRecipe(Recipe r, Mode mode, bool tooltip = false)
586 {
587 Reset();
588 recipe = r;
589 if (mode == Mode.Recipe)
590 {
591 RefreshCraftable();
592 }
593 else
594 {
595 mainText.SetActive(enable: false);
596 }
597 RecipeCard rCard = r as RecipeCard;
598 if (rCard != null)
599 {
600 r.SetImage(icon);
601 }
602 else
603 {
604 r.SetImage(icon);
605 }
606 if (!tooltip)
607 {
608 return;
609 }
610 SetTooltip("note", delegate(UITooltip t)
611 {
612 if (r.ingredients.Count == 0)
613 {
614 r.BuildIngredientList();
615 }
617 Dettach("recipe_new");
618 if (rCard != null)
619 {
620 if (mode == Mode.RecipeGrid && rCard._mold == null)
621 {
622 CardBlueprint.SetNormalRarity();
623 rCard._mold = ThingGen.Create(r.id);
624 }
625 rCard.Mold.WriteNote(t.note, delegate(UINote n)
626 {
627 n.Space();
628 WriteReqMat(n, r);
629 }, IInspect.NoteMode.Product, r);
630 }
631 else
632 {
633 UINote note = t.note;
634 note.Clear();
635 note.AddHeaderCard(r.GetName(), icon.sprite);
636 if (!r.GetDetail().IsEmpty())
637 {
638 note.AddText(r.GetDetail());
639 }
640 WriteReqMat(note, r);
641 t.note.Build();
642 }
643 });
644 }
645
646 public void WriteReqMat(UINote n, Recipe r)
647 {
648 r.WriteReqFactory(n);
649 r.WriteReqSkill(n);
650 n.AddHeaderTopic("reqMat");
651 foreach (Recipe.Ingredient ingredient in r.ingredients)
652 {
653 int count = EClass._map.Stocked.ListThingStack(ingredient, StockSearchMode.AroundPC).count;
654 Color c = ((count >= ingredient.req) ? SkinManager.CurrentColors.textGood : SkinManager.CurrentColors.textBad);
655 string text = "<color=" + c.ToHex() + ">" + ingredient.GetName() + " x " + ingredient.req + " (" + count + ")</color>";
656 if (ingredient.optional)
657 {
658 text = "opIngredient".lang(text);
659 }
660 n.AddText(text).text1.SetSize(-1);
661 }
662 }
663
664 public bool ShowMouseHintLeft()
665 {
666 if (invOwner != null && card != null)
667 {
668 if (!invOwner.CanShiftClick(this) && !invOwner.CanCtrlClick(this))
669 {
670 return invOwner.CanAltClick(this);
671 }
672 return true;
673 }
674 return false;
675 }
676
677 public string GetTextMouseHintLeft()
678 {
679 if (!invOwner.CanShiftClick(this))
680 {
681 if (!invOwner.CanCtrlClick(this))
682 {
683 if (!invOwner.CanAltClick(this))
684 {
685 return "";
686 }
687 return invOwner.GetTextAltClick(this);
688 }
689 return invOwner.GetTextCtrlClick(this);
690 }
691 return invOwner.GetTextShiftClick(this);
692 }
693
694 public bool ShowMouseHintRight()
695 {
696 if (invOwner != null && card != null)
697 {
698 return invOwner.AllowAutouse;
699 }
700 return false;
701 }
702
703 public string GetTextMouseHintRight()
704 {
705 return invOwner.GetAutoUseLang(this) ?? "";
706 }
707
709 {
710 if (refObj is RenderRow)
711 {
712 return (RenderRow)refObj;
713 }
714 if (recipe == null)
715 {
716 if (card == null)
717 {
718 return null;
719 }
720 return card.sourceCard;
721 }
722 return recipe.renderRow;
723 }
724
725 public void OnRefreshPref()
726 {
727 if (refObj is RenderRow renderRow)
728 {
729 renderRow.SetImage(icon, null, 0, setNativeSize: false);
730 }
731 if (recipe != null)
732 {
733 SetRecipe(recipe);
734 }
735 else if (card != null)
736 {
737 SetCard(card);
738 }
739 }
740
741 public override bool CanMiddleClick()
742 {
743 if (invOwner != null && card != null)
744 {
745 return EClass.ui.AllowInventoryInteractions;
746 }
747 return false;
748 }
749
750 public override void OnMiddleClick(bool forceClick)
751 {
752 Thing t = card.Thing;
753 InvOwner o = invOwner;
754 if ((forceClick || EInput.middleMouse.clicked) && o.AllowContext)
755 {
756 o.ShowContextMenu(this);
757 }
758 EInput.middleMouse.pressedLongAction = delegate
759 {
760 if (EClass.ui.AllowInventoryInteractions && EClass.core.config.game.holdMiddleButtonToHold && o.TryHold(t))
761 {
762 if (!(t.trait is TraitAbility) && t.trait.IsTool)
763 {
764 HotItemHeld.disableTool = true;
765 }
766 if (EClass.ui.contextMenu.isActive)
767 {
768 EClass.ui.contextMenu.currentMenu.Hide();
769 }
770 EInput.Consume();
771 }
772 };
773 }
774}
BlessedState
Definition: BlessedState.cs:2
FontColor
Definition: FontColor.cs:2
Rarity
Definition: Rarity.cs:2
StockSearchMode
if(item3.idFile==idFirstFile &&item3.id==idFirstTopic)
Definition: UIBook.cs:627
Definition: Area.cs:4
BaseTileSelector tileSelector
Thing thing
Definition: BodySlot.cs:8
SourceElement.Row element
Definition: BodySlot.cs:16
void OnRefreshPref()
Definition: ButtonGrid.cs:725
bool keepBg
Definition: ButtonGrid.cs:30
string GetTextMouseHintRight()
Definition: ButtonGrid.cs:703
bool ShowMouseHintLeft()
Definition: ButtonGrid.cs:664
Card card
Definition: ButtonGrid.cs:24
override bool CanMiddleClick()
Definition: ButtonGrid.cs:741
int rightAttachCount
Definition: ButtonGrid.cs:35
Area area
Definition: ButtonGrid.cs:18
void SetRecipe(Recipe r)
Definition: ButtonGrid.cs:547
RenderRow GetRenderRow()
Definition: ButtonGrid.cs:708
InvOwner invOwner
Definition: ButtonGrid.cs:28
void SetCraftRecipe(Recipe r, Mode mode, bool tooltip=false)
Definition: ButtonGrid.cs:585
bool ShowMouseHintRight()
Definition: ButtonGrid.cs:694
void SetCard(Card c, Mode mode=Mode.Default, Action< UINote > onWriteNote=null)
Definition: ButtonGrid.cs:184
void SetObject(object o)
Definition: ButtonGrid.cs:405
void Redraw()
Definition: ButtonGrid.cs:140
override void OnMiddleClick(bool forceClick)
Definition: ButtonGrid.cs:750
override void OnDestroy()
Definition: ButtonGrid.cs:112
void SetRecipe()
Definition: ButtonGrid.cs:533
void SetRecipe(Area a)
Definition: ButtonGrid.cs:538
void Reset()
Definition: ButtonGrid.cs:94
string GetTextMouseHintLeft()
Definition: ButtonGrid.cs:677
virtual float extFixY
Definition: ButtonGrid.cs:51
void SetIngredient(Recipe r, Thing t)
Definition: ButtonGrid.cs:505
virtual void SetDragParent(IDragParent p)
Definition: ButtonGrid.cs:431
void SetArea(Area a)
Definition: ButtonGrid.cs:390
void SetBodySlot(BodySlot b, InvOwner owner, bool showIndex=false)
Definition: ButtonGrid.cs:121
void SetItem(GridItem i)
Definition: ButtonGrid.cs:398
void SetCardGrid(Card c, InvOwner owner=null)
Definition: ButtonGrid.cs:145
void SetDummy()
Definition: ButtonGrid.cs:417
ColorProfile Colors
Definition: ButtonGrid.cs:37
void WriteReqMat(UINote n, Recipe r)
Definition: ButtonGrid.cs:646
Transform Attach(string id, bool rightAttach=true)
Definition: ButtonGrid.cs:63
List< Transform > listAttach
Definition: ButtonGrid.cs:33
T Attach< T >(string id, bool rightAttach=true)
Definition: ButtonGrid.cs:58
Recipe recipe
Definition: ButtonGrid.cs:20
override string ToString()
Definition: ButtonGrid.cs:53
void SetIngredient(Recipe r, Recipe.Ingredient _ing)
Definition: ButtonGrid.cs:435
void SetRecipeVariation(UIRecipeInfo.RecipeVariation a)
Definition: ButtonGrid.cs:518
void Dettach(string id)
Definition: ButtonGrid.cs:78
void RefreshCraftable()
Definition: ButtonGrid.cs:576
Recipe.Ingredient ing
Definition: ButtonGrid.cs:22
bool clicked
Definition: ButtonState.cs:37
Definition: Card.cs:11
bool isDestroyed
Definition: Card.cs:71
bool IsDecayed
Definition: Card.cs:2147
virtual Chara Chara
Definition: Card.cs:1946
bool isNPCProperty
Definition: Card.cs:526
int c_equippedSlot
Definition: Card.cs:912
bool IsRotting
Definition: Card.cs:2149
int c_indexContainerIcon
Definition: Card.cs:1325
int qualityTier
Definition: Card.cs:394
bool IsEquipmentOrRangedOrAmmo
Definition: Card.cs:2090
int invY
Definition: Card.cs:1831
Rarity rarity
Definition: Card.cs:298
string Name
Definition: Card.cs:2013
override string ToString()
Definition: Card.cs:2347
Trait trait
Definition: Card.cs:49
bool isNew
Definition: Card.cs:454
bool c_isImportant
Definition: Card.cs:984
ThingContainer things
Definition: Card.cs:34
Card GetRootCard()
Definition: Card.cs:3173
virtual void WriteNote(UINote n, Action< UINote > onWriteNote=null, IInspect.NoteMode mode=IInspect.NoteMode.Default, Recipe recipe=null)
Definition: Card.cs:6958
bool isGifted
Definition: Card.cs:754
BlessedState blessedState
Definition: Card.cs:262
void SetImage(Image image, int dir, int idSkin=0)
Definition: Card.cs:5355
int ChildrenAndSelfWeight
Definition: Card.cs:1917
int Num
Definition: Card.cs:154
bool IsIdentified
Definition: Card.cs:2237
bool IsContainer
Definition: Card.cs:1965
void SetBodyIndexText(BodySlot b, UIText t)
Definition: CharaBody.cs:475
CharaBody body
Definition: Chara.cs:91
Card held
Definition: Chara.cs:67
new GameConfig game
Definition: CoreConfig.cs:596
List< Sprite > quality
Definition: CoreRef.cs:136
Sprite trans
Definition: CoreRef.cs:106
List< Sprite > spritesContainerIcon
Definition: CoreRef.cs:363
Icons icons
Definition: CoreRef.cs:339
ButtonAssets buttonAssets
Definition: CoreRef.cs:333
Sprite spriteArea
Definition: CoreRef.cs:377
Sprite spriteNoIng
Definition: CoreRef.cs:379
Definition: Core.cs:14
CoreRef refs
Definition: Core.cs:51
static new Core Instance
Definition: Core.cs:15
ColorProfile Colors
Definition: Core.cs:53
BaseGameScreen screen
Definition: Core.cs:67
CoreConfig config
Definition: Core.cs:70
Definition: EClass.cs:5
static Core core
Definition: EClass.cs:6
static Map _map
Definition: EClass.cs:18
static SourceManager sources
Definition: EClass.cs:42
static Player player
Definition: EClass.cs:12
static Chara pc
Definition: EClass.cs:14
static UI ui
Definition: EClass.cs:16
Definition: EInput.cs:8
static ButtonState middleMouse
Definition: EInput.cs:353
static void Consume(int _skipFrame)
Definition: EInput.cs:656
virtual void SetButton(ButtonGrid b)
Definition: GridItem.cs:3
int countValid
Definition: HitSummary.cs:10
Card owner
Definition: InvOwner.cs:538
void ShowContextMenu(ButtonGrid button)
Definition: InvOwner.cs:1713
bool TryHold(Thing t)
Definition: InvOwner.cs:1481
virtual bool AllowContext
Definition: InvOwner.cs:560
Definition: Lang.cs:6
static string _weight(int a, int b, bool showUnit=true, int unitSize=0)
Definition: Lang.cs:172
void OnChangeIngredient()
Definition: LayerCraft.cs:406
static LayerCraft Instance
Definition: LayerCraft.cs:8
PropsStocked Stocked
Definition: Map.cs:121
RecipeManager recipes
Definition: Player.cs:898
static void Despawn(Component c)
Definition: PoolManager.cs:128
static Transform Spawn(string id, string path, Transform parent)
Definition: PoolManager.cs:86
ThingStack ListThingStack(Recipe.Ingredient ing, StockSearchMode searchMode)
Definition: Props.cs:204
override Card Mold
Definition: RecipeCard.cs:32
Card _mold
Definition: RecipeCard.cs:18
HashSet< string > hoveredRecipes
Definition: Recipe.cs:7
string id
Definition: Recipe.cs:161
void WriteReqSkill(UINote n)
Definition: Recipe.cs:802
void WriteReqFactory(UINote n, bool hasFactory=true)
Definition: Recipe.cs:793
virtual RenderRow renderRow
Definition: Recipe.cs:193
RecipeSource source
Definition: Recipe.cs:187
void SaveLastIngredients()
Definition: Recipe.cs:975
List< Ingredient > ingredients
Definition: Recipe.cs:164
bool VirtualBlock
Definition: Recipe.cs:173
virtual void OnChangeIngredient()
Definition: Recipe.cs:532
virtual string GetDetail()
Definition: Recipe.cs:782
bool UseStock
Definition: Recipe.cs:167
int GetDefaultColor()
Definition: Recipe.cs:457
int idSkin
Definition: Recipe.cs:181
string GetName()
Definition: Recipe.cs:760
virtual void SetImage(Image icon)
Definition: Recipe.cs:882
virtual SourceMaterial.Row GetColorMaterial()
Definition: Recipe.cs:481
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
static SkinColorProfile CurrentColors
Definition: SkinManager.cs:84
Dictionary< string, CardRow > map
Definition: SourceCard.cs:8
void SetImage(Image image)
SourceCard cards
static Sprite Get(string id)
Definition: SpriteSheet.cs:28
ThingStack GetThingStack(string id, int refVal=-1)
int count
Definition: ThingStack.cs:7
Definition: Thing.cs:8
override bool CanUse(Chara c)
virtual void SetMainText(UIText t, bool hotitem)
Definition: Trait.cs:1394
virtual void OnSetCardGrid(ButtonGrid b)
Definition: Trait.cs:1022
virtual bool IsTool
Definition: Trait.cs:355
virtual Sprite GetRefSprite()
Definition: Trait.cs:577
virtual int IdSkin
Definition: Trait.cs:44
virtual SourceElement.Row GetRefElement()
Definition: Trait.cs:572
static void TryShowTip(Transform root=null, bool highlight=true, bool ignoreWhenRightClick=true)
Definition: UIButton.cs:778
UIText text1
Definition: UIItem.cs:6
Definition: UINote.cs:6
UIItem AddHeaderCard(string text, Sprite sprite=null)
Definition: UINote.cs:84
UIItem AddHeaderTopic(string text, Sprite sprite=null)
Definition: UINote.cs:89
void Clear()
Definition: UINote.cs:35
UIItem AddText(string text, FontColor color=FontColor.DontChange)
Definition: UINote.cs:113
void Space(int sizeY=0, int sizeX=1)
Definition: UINote.cs:62
void Build()
Definition: UINote.cs:49
UIText SetSize(int a)
Definition: UIText.cs:227
UINote note
Definition: UITooltip.cs:21
NoteMode
Definition: IInspect.cs:7