1using System.Collections.Generic;
16 public List<PutbackInfo>
putBacks =
new List<PutbackInfo>();
67 InvOwner.Trader =
owner;
71 ELayer.
ui.OpenFloatInv(ignoreSound:
true);
84 for (
int j = 0; j <
buttons.Count; j++)
86 buttons[j].gameObject.AddComponent<CanvasGroup>();
95 buttons[j].SetActive(enable:
false);
101 InvokeRepeating(
"RefreshCost", 0f, 0.2f);
102 this.RebuildLayout(recursive:
true);
105 this.RebuildLayout(recursive:
true);
157 windows[0].SetInteractable(enable: false, 0f);
158 info.InitFuel(owner.owner);
159 Create(new InvOwnerRefuel(owner.owner), refuelFromLayerDragGrid: true).SetOnKill(delegate
163 windows[0].SetInteractable(enable: true);
164 info.Init(owner.owner);
166 RefreshCurrentGrid();
168 owner.OnAfterRefuel();
195 if (questHarvest !=
null)
200 questHarvest.weightDelivered += item.SelfWeight *
item.Num;
217 if (refuelFromLayerDragGrid)
219 info.SetActive(enable:
false);
241 buttonAutoRefuel.mainText.text = (owner.owner.autoRefuel ?
"On" :
"Off");
245 textFuel.text = (int)((
float)owner.owner.c_charges / (float)owner.
owner.
trait.
MaxFuel * 100f) +
"%";
246 int price = GetPrice();
247 itemCost.transform.parent.SetActive(price != 0);
259 if (buttons[i].
card ==
null)
271 buttons[i].SetCardGrid(
null);
273 RefreshCurrentGrid();
280 for (
int i = 0; i < buttons.Count; i++)
282 bool flag = buttons[i].Card !=
null;
283 if (num == -1 && (!flag || i == owner.
numDragGrid - 1))
287 buttons[i].interactable = flag || num == i;
288 buttons[i].GetComponent<CanvasGroup>().alpha = (buttons[i].interactable ? 1f : 0.5f);
294 transIndex.position = buttons[num].transform.position;
296 transIndex.SetActive(flag2);
302 List<Thing> list =
new List<Thing>();
304 for (
int i = 0; i < traitCrafter.
numIng; i++)
306 list.Add(buttons[i].
card?.
Thing ??
null);
319 if (
card.Num != lastNum)
324 if (
card ==
null ||
card.isDestroyed)
334 if (button.gameObject.activeSelf)
344 if (container !=
null)
349 container = container
364 RefreshCurrentGrid();
374 EInput.haltInput =
false;
376 InvOwner.Trader =
null;
377 if (!wasInventoryOpen &&
ELayer.
ui.IsInventoryOpen)
397 base.OnUpdateInput();
411 return ELayer.
ui.AddLayer<
LayerDragGrid>(
"LayerInventory/LayerDragGrid").SetInv(owner, refuelFromLayerDragGrid);
484 return Create(owner);
486 int num = ((owner.count == -1) ? 1 : owner.
count);
487 for (
int i = 0; i < num; i++)
492 Thing t2 = list.RandomItem();
int GetCurrency(string id="money")
void SetImage(Image image, int dir, int idSkin=0)
override void SetSortVal(UIList.SortMode m, CurrencyType currency=CurrencyType.Money)
override bool ShouldShowGuide(Thing t)
virtual bool CanTargetAlly
virtual bool AllowStockIngredients
virtual void _OnProcess(Thing t)
override void BuildUICurrency(UICurrency uiCurrency, bool canReroll=false)
virtual void OnAfterRefuel()
virtual bool ShowButtonDeliver
List< ButtonGrid > buttons
virtual string langTransfer
virtual bool ShouldShowGuide(Thing t)
static string _weight(int a, int b, bool showUnit=true, int unitSize=0)
static string _currency(object a, string IDCurrency)
void AddPutBack(Thing t, Thing container)
static LayerDragGrid CreateDeliver(InvOwnerDeliver.Mode mode=InvOwnerDeliver.Mode.Default, Card owner=null)
override void ClearButtons()
static LayerDragGrid CreateOffering(TraitAltar altar)
static LayerDragGrid CreateGacha(TraitGacha gacha)
static LayerDragGrid CreateGive(Chara c)
static LayerDragGrid CreateEnchant(Chara cc, bool armor, bool superior=false, BlessedState state=BlessedState.Normal, int count=1)
UIButton buttonAutoRefuel
static LayerDragGrid CreateChangeRarity(Chara cc, Thing consume, EffectId idEffect, BlessedState state=BlessedState.Normal, int price=0, int count=1)
static LayerDragGrid CreateChangeMaterial(Chara cc, Thing consume, SourceMaterial.Row mat, EffectId idEffect, BlessedState state=BlessedState.Normal, int price=0, int count=1)
override List< Thing > GetTargets()
static LayerDragGrid CreateLighten(Chara cc, BlessedState state=BlessedState.Normal, int price=0, int count=1)
override void OnEndCraft()
static LayerDragGrid TryProc(Chara cc, InvOwnerEffect owner)
List< PutbackInfo > putBacks
static LayerDragGrid Create(InvOwnerDraglet owner, bool refuelFromLayerDragGrid=false)
LayerDragGrid SetInv(InvOwnerDraglet owner, bool refuelFromLayerDragGrid=false)
UIDragGridIngredients uiIngredients
List< ButtonGrid > buttons
override void OnUpdateInput()
static LayerDragGrid Instance
static LayerDragGrid CreateUncurse(Chara cc, BlessedState state=BlessedState.Normal, int price=0, int count=1)
override void RefreshCurrentGrid()
override bool CanCancelAI
static LayerDragGrid CreateReconstruction(Chara cc, BlessedState state=BlessedState.Normal, int power=100, int price=0, int count=1)
static LayerDragGrid CreateChaosOffering(TraitAltarChaos altar)
static LayerDragGrid CreateRecycle(TraitRecycle recycle)
override void OnRightClick()
static LayerDragGrid CreateCraft(TraitCrafter crafter)
static LayerDragGrid CreateIdentify(Chara cc, bool superior=false, BlessedState state=BlessedState.Normal, int price=0, int count=1)
static bool CloseAllyInv(Chara c)
static LayerInventory CreateContainerAlly(Chara owner, Card container)
static void SetDirtyAll(bool immediate=false)
static string Say(string idLang, string ref1, string ref2=null, string ref3=null, string ref4=null)
static Sprite Get(string id)
List< Thing > List(Func< Thing, bool > func, bool onlyAccessible=false)
bool IsFuelEnough(int num=1, List< Thing > excludes=null, bool tryRefuel=true)
void InitFuel(Card _owner)
override void Add(object item)