Elin Decompiled Documentation EA 23.312 Nightly Patch 4
Loading...
Searching...
No Matches
InvOwnerDraglet.cs
Go to the documentation of this file.
1using DG.Tweening;
2using UnityEngine;
3
5{
6 public enum ProcessType
7 {
8 None,
10 }
11
12 public int count = -1;
13
15
16 public int price;
17
18 public virtual ProcessType processType => ProcessType.None;
19
20 public virtual bool ShowFuel => false;
21
22 public virtual bool CanTargetAlly => false;
23
24 public virtual string langWhat => "";
25
26 public virtual bool AllowStockIngredients => false;
27
28 public virtual bool ShowButtonDeliver => false;
29
30 public override bool AllowTransfer => true;
31
32 public override bool AllowAutouse => false;
33
34 public override bool AllowContext => false;
35
36 public override bool UseGuide => true;
37
38 public override bool CopyOnTransfer => true;
39
40 public override bool InvertSell => true;
41
42 public override bool DenyImportant => false;
43
45
46 public override bool AllowHold(Thing t)
47 {
48 return false;
49 }
50
51 public InvOwnerDraglet(Card owner = null, Card container = null, CurrencyType _currency = CurrencyType.Money)
52 : base(owner, container, _currency)
53 {
54 }
55
56 public override void OnInit()
57 {
58 if (price == 0)
59 {
61 }
62 if (!langWhat.IsEmpty())
63 {
65 }
66 }
67
68 public override void OnClick(ButtonGrid button)
69 {
70 if (button.card != null)
71 {
72 if (button.index == 0)
73 {
75 }
76 else
77 {
78 button.SetCard(null);
80 }
83 SE.Equip();
85 {
87 }
88 }
89 }
90
91 public override void OnRightClick(ButtonGrid button)
92 {
93 OnClick(button);
94 }
95
96 public override int GetPrice(Thing t, CurrencyType currency, int num, bool sell)
97 {
98 return price;
99 }
100
101 public override string GetTextDetail(Thing t, CurrencyType currency, int num, bool sell)
102 {
103 int num2 = GetPrice(t, currency, num, sell);
104 return "invInteraction2".lang(num.ToString() ?? "", langTransfer.lang()) + ((num2 == 0) ? "" : "invInteraction3".lang(num2.ToString() ?? "", EClass.sources.things.map[base.IDCurrency].GetName()));
105 }
106
107 public virtual void OnWriteNote(Thing t, UINote n)
108 {
109 }
110
111 public sealed override void OnProcess(Thing t)
112 {
113 if (!dragGrid.IsAllGridSet())
114 {
117 t.PlaySoundDrop(spatial: false);
118 return;
119 }
120 _OnProcess(t);
123 if (processType == ProcessType.Consume)
124 {
125 EInput.haltInput = true;
126 foreach (ButtonGrid b in dragGrid.buttons)
127 {
128 b.icon.rectTransform.DOScale(0f, 0.3f).SetEase(Ease.InBack).OnComplete(delegate
129 {
130 if (b.transform != null)
131 {
132 b.icon.rectTransform.localScale = Vector3.one;
133 b.SetCardGrid(null, b.invOwner);
134 RedrawButton();
135 }
136 EInput.haltInput = false;
137 });
138 }
139 }
140 else
141 {
142 RedrawButton();
143 }
145 if (count > 0)
146 {
147 count--;
148 if (count == 0)
149 {
150 dragGrid.Close();
151 }
152 else if (!langWhat.IsEmpty())
153 {
155 }
156 }
157 }
158
159 public virtual void _OnProcess(Thing t)
160 {
161 }
162
163 public virtual void OnAfterRefuel()
164 {
165 }
166
167 public void RedrawButton()
168 {
171 }
172
173 public override void BuildUICurrency(UICurrency uiCurrency, bool canReroll = false)
174 {
175 base.BuildUICurrency(uiCurrency);
176 uiCurrency.SetActive(price != 0);
177 }
178}
BlessedState
Definition: BlessedState.cs:2
CurrencyType
Definition: CurrencyType.cs:2
Status Success(Action action=null)
Definition: AIAct.cs:266
virtual bool IsRunning
Definition: AIAct.cs:31
Card card
Definition: ButtonGrid.cs:24
void SetCard(Card c, Mode mode=Mode.Default, Action< UINote > onWriteNote=null)
Definition: ButtonGrid.cs:184
Definition: Card.cs:11
void PlaySoundDrop(bool spatial=true)
Definition: Card.cs:6515
AIAct ai
Definition: Chara.cs:206
Definition: EClass.cs:6
static SourceManager sources
Definition: EClass.cs:43
static Chara pc
Definition: EClass.cs:15
Definition: EInput.cs:8
static bool haltInput
Definition: EInput.cs:286
virtual bool CanTargetAlly
override bool AllowContext
LayerDragGrid dragGrid
virtual bool AllowStockIngredients
override bool AllowTransfer
override int GetPrice(Thing t, CurrencyType currency, int num, bool sell)
override void OnClick(ButtonGrid button)
virtual void _OnProcess(Thing t)
override bool CopyOnTransfer
virtual string langWhat
BlessedState state
override void BuildUICurrency(UICurrency uiCurrency, bool canReroll=false)
override string GetTextDetail(Thing t, CurrencyType currency, int num, bool sell)
override bool DenyImportant
virtual void OnWriteNote(Thing t, UINote n)
virtual void OnAfterRefuel()
override void OnRightClick(ButtonGrid button)
override bool AllowHold(Thing t)
override void OnInit()
sealed override void OnProcess(Thing t)
virtual ProcessType processType
virtual bool ShowButtonDeliver
InvOwnerDraglet(Card owner=null, Card container=null, CurrencyType _currency=CurrencyType.Money)
override bool InvertSell
virtual bool ShowFuel
override bool AllowAutouse
override bool UseGuide
Card owner
Definition: InvOwner.cs:533
CurrencyType currency
Definition: InvOwner.cs:527
virtual string langTransfer
Definition: InvOwner.cs:587
override void ClearButtons()
UIDragGridIngredients uiIngredients
List< ButtonGrid > buttons
void RefreshCost()
bool IsAllGridSet()
static LayerDragGrid Instance
override void RefreshCurrentGrid()
static void SetDirty(Thing t)
virtual void Close()
Definition: Layer.cs:463
Definition: Msg.cs:5
static string Say(string idLang, string ref1, string ref2=null, string ref3=null, string ref4=null)
Definition: Msg.cs:58
SourceThing things
Definition: Thing.cs:8
Image icon
Definition: UIButton.cs:110
static void TryShowTip(Transform root=null, bool highlight=true, bool ignoreWhenRightClick=true)
Definition: UIButton.cs:778
Definition: UINote.cs:6