Elin Decompiled Documentation EA 23.102 Nightly
All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Events Pages
UIDragGridIngredients Class Reference
Inheritance diagram for UIDragGridIngredients:
EMono

Public Member Functions

void Update ()
 
void Refresh ()
 

Public Attributes

LayerDragGrid layer
 
UIList list
 
UIScrollView view
 
GameObject goList
 

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 4 of file UIDragGridIngredients.cs.

Member Function Documentation

◆ Refresh()

void UIDragGridIngredients.Refresh ( )
inline

Definition at line 44 of file UIDragGridIngredients.cs.

45 {
46 Debug.Log("Refreshing uiDragGridIngredients");
47 List<Thing> list = new List<Thing>();
49 {
50 foreach (Thing thing in EMono._map.Stocked.Things)
51 {
53 {
54 Window.SaveData windowSaveData = thing.parentCard.GetWindowSaveData();
55 if (windowSaveData == null || !windowSaveData.excludeCraft)
56 {
57 list.Add(thing);
58 }
59 }
60 }
61 list.Sort(UIList.SortMode.ByCategory);
62 }
63 this.list.callbacks = new UIList.Callback<Thing, ButtonGrid>
64 {
65 onClick = delegate(Thing a, ButtonGrid b)
66 {
67 int currentIndex = layer.currentIndex;
68 layer.buttons[currentIndex].SetCardGrid(a, layer.owner);
71 },
72 onInstantiate = delegate(Thing a, ButtonGrid b)
73 {
74 b.SetCard(a, ButtonGrid.Mode.Grid);
75 b.SetOnClick(delegate
76 {
77 });
78 b.onRightClick = delegate
79 {
80 this.list.callbacks.OnClick(a, b);
81 };
82 }
83 };
84 this.list.Clear();
85 foreach (Thing item in list)
86 {
87 this.list.Add(item);
88 }
89 this.list.Refresh();
90 }
void SetCard(Card c, Mode mode=Mode.Default, Action< UINote > onWriteNote=null)
Definition: ButtonGrid.cs:184
ICardParent parent
Definition: Card.cs:51
Window.SaveData GetWindowSaveData()
Definition: Card.cs:2376
Card parentCard
Definition: Card.cs:99
bool c_isDisableStockUse
Definition: Card.cs:1044
Definition: EMono.cs:4
static Map _map
Definition: EMono.cs:17
virtual bool AllowStockIngredients
sealed override void OnProcess(Thing t)
Card owner
Definition: InvOwner.cs:538
virtual bool ShouldShowGuide(Thing t)
Definition: InvOwner.cs:686
void AddPutBack(Thing t, Thing container)
InvOwnerDraglet owner
List< ButtonGrid > buttons
PropsStocked Stocked
Definition: Map.cs:121
List< Thing > Things
Definition: Props.cs:37
bool ShouldListAsResource(Thing t)
Definition: Props.cs:174
Definition: Thing.cs:8
Definition: UIList.cs:9
SortMode
Definition: UIList.cs:27
override void Add(object item)
Definition: UIList.cs:302
void Sort()
Definition: UIList.cs:697
bool excludeCraft
Definition: Window.cs:379

References EMono._map, UIList.Add(), LayerDragGrid.AddPutBack(), InvOwnerDraglet.AllowStockIngredients, LayerDragGrid.buttons, Card.c_isDisableStockUse, LayerDragGrid.currentIndex, Debug, Window.SaveData.excludeCraft, Card.GetWindowSaveData(), item, layer, list, InvOwnerDraglet.OnProcess(), InvOwner.owner, LayerDragGrid.owner, Card.parent, Card.parentCard, ButtonGrid.SetCard(), Props.ShouldListAsResource(), InvOwner.ShouldShowGuide(), UIList.Sort(), Map.Stocked, and Props.Things.

Referenced by LayerDragGrid.ClearButtons(), InvOwnerDraglet.OnClick(), InvOwnerDraglet.OnProcess(), LayerDragGrid.SetInv(), and Update().

◆ Update()

void UIDragGridIngredients.Update ( )
inline

Definition at line 14 of file UIDragGridIngredients.cs.

15 {
16 bool activeSelf = goList.activeSelf;
17 bool flag = EMono.pc.ai.IsNoGoal || !EMono.pc.ai.IsRunning;
18 goList.SetActive(flag);
19 if (activeSelf != flag)
20 {
21 Refresh();
22 }
24 {
25 return;
26 }
27 ButtonGrid componentOf = InputModuleEX.GetComponentOf<ButtonGrid>();
28 if ((bool)componentOf && (bool)componentOf.GetComponentInParent<UIDragGridIngredients>())
29 {
30 Thing t = componentOf.card.Thing;
31 Thing container = t.parent as Thing;
32 t.ShowSplitMenu2(componentOf, "actPutIn", delegate(int n)
33 {
34 Thing t2 = t.Split(n);
35 t2 = EMono.pc.Pick(t2, msg: true, tryStack: false);
36 int currentIndex = layer.currentIndex;
37 layer.AddPutBack(t2, container);
38 layer.buttons[currentIndex].SetCardGrid(t2, layer.owner);
40 });
41 }
42 }
virtual bool IsRunning
Definition: AIAct.cs:31
Card card
Definition: ButtonGrid.cs:24
Thing Split(int a)
Definition: Card.cs:3231
virtual Thing Thing
Definition: Card.cs:1934
AIAct ai
Definition: Chara.cs:187
Thing Pick(Thing t, bool msg=true, bool tryStack=true)
Definition: Chara.cs:3920
Definition: EInput.cs:8
static ButtonState middleMouse
Definition: EInput.cs:353
static Chara pc
Definition: EMono.cs:13
void ShowSplitMenu2(ButtonGrid button, string lang, Action< int > onSplit=null)
Definition: Thing.cs:1782

References LayerDragGrid.AddPutBack(), Chara.ai, LayerDragGrid.buttons, ButtonGrid.card, LayerDragGrid.currentIndex, ButtonState.down, goList, AIAct.IsRunning, layer, EInput.middleMouse, InvOwnerDraglet.OnProcess(), LayerDragGrid.owner, EMono.pc, Chara.Pick(), Refresh(), Thing.ShowSplitMenu2(), Card.Split(), and Card.Thing.

Member Data Documentation

◆ goList

GameObject UIDragGridIngredients.goList

Definition at line 12 of file UIDragGridIngredients.cs.

Referenced by Update().

◆ layer

LayerDragGrid UIDragGridIngredients.layer

Definition at line 6 of file UIDragGridIngredients.cs.

Referenced by Refresh(), and Update().

◆ list

UIList UIDragGridIngredients.list

Definition at line 8 of file UIDragGridIngredients.cs.

Referenced by Refresh().

◆ view

UIScrollView UIDragGridIngredients.view

Definition at line 10 of file UIDragGridIngredients.cs.


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