Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
LayerDragGrid Class Reference
Inheritance diagram for LayerDragGrid:
LayerBaseCraft ELayer Layer IUISkin

Classes

class  PutbackInfo
 

Public Member Functions

void OnOpen ()
 
LayerDragGrid SetInv (InvOwnerDraglet owner, bool refuelFromLayerDragGrid=false)
 
int GetPrice ()
 
void RefreshCost ()
 
bool IsAllGridSet ()
 
override void ClearButtons ()
 
override void RefreshCurrentGrid ()
 
override List< ThingGetTargets ()
 
void Validate ()
 
void Redraw ()
 
void AddPutBack (Thing t, Thing container)
 
void TryPutBack ()
 
override void OnEndCraft ()
 
override void OnKill ()
 
override void OnUpdateInput ()
 
override void OnRightClick ()
 
- Public Member Functions inherited from LayerBaseCraft
virtual List< ThingGetTargets ()
 
virtual int GetReqIngredient (int index)
 
virtual void RefreshCurrentGrid ()
 
virtual void ClearButtons ()
 
virtual void OnEndCraft ()
 
- Public Member Functions inherited from ELayer
override void OnBeforeAddLayer ()
 
void InitInspector ()
 
sealed override void Init ()
 
override void OnAfterAddLayer ()
 
void TryShowHelp ()
 
void AddLayerToUI (string id)
 
void TryShowHint (string _langHint=null)
 
void TalkHomeMemeber (string id)
 
void TalkMaid (string id)
 
override void OnRightClick ()
 
- Public Member Functions inherited from Layer
virtual string GetTextHeader (Window window)
 
virtual bool HeaderIsListOf (int id)
 
virtual void Init ()
 
virtual void OnInit ()
 
virtual void OnAfterInit ()
 
virtual void ApplySkin ()
 
void ShowScreenLock (string id)
 
void UpdateInput ()
 
virtual void OnUpdateInput ()
 
virtual void OnRightClick ()
 
virtual bool OnBack ()
 
virtual void OnChangeLayer ()
 
virtual void OnCreate ()
 
void _AddLayer (string id)
 
Layer AddLayer (string id)
 
AddLayer< T > ()
 
AddLayer< T > (string id)
 
AddLayerDontCloseOthers< T > ()
 
Layer AddLayerDontCloseOthers (Layer l)
 
GetOrAddLayer< T > ()
 
virtual void OnBeforeAddLayer ()
 
virtual void OnAfterAddLayer ()
 
Layer AddLayer (Layer l)
 
void ToggleLayer (string id)
 
ToggleLayer< T > (string id=null)
 
void WaitAndClose ()
 
void OnClickClose ()
 
virtual void Close ()
 
void CloseLayers ()
 
void RemoveLayers (bool removeImportant=false)
 
bool RemoveLayer< T > ()
 
void RemoveLayer (Layer l)
 
virtual void OnKill ()
 
Layer SetOnKill (Action action)
 
void DisableClose ()
 
void Delay (float duration=0.05f)
 
Layer SetDelay (float d)
 
Layer GetLayer (string id)
 
GetLayer< T > (bool fromTop=false)
 
Layer GetTopLayer ()
 
void SwitchContent (int idWindow, int i)
 
virtual void OnSwitchContent (Window window)
 
Layer SetTitles (string langList, string idHeaderRow=null)
 
bool IsBlockWidgetClick ()
 
bool IsHideHud ()
 
bool IsAllowGeneralInput ()
 
bool IsUseBlur ()
 
bool IsPointerOnLayer ()
 
void ApplySkin ()
 

Static Public Member Functions

static LayerDragGrid Create (InvOwnerDraglet owner, bool refuelFromLayerDragGrid=false)
 
static LayerDragGrid CreateChaosOffering (TraitAltarChaos altar)
 
static LayerDragGrid CreateOffering (TraitAltar altar)
 
static LayerDragGrid CreateDeliver (InvOwnerDeliver.Mode mode=InvOwnerDeliver.Mode.Default, Card owner=null)
 
static LayerDragGrid CreateGive (Chara c)
 
static LayerDragGrid CreateCraft (TraitCrafter crafter)
 
static LayerDragGrid CreateRecycle (TraitRecycle recycle)
 
static LayerDragGrid CreateGacha (TraitGacha gacha)
 
static LayerDragGrid TryProc (Chara cc, InvOwnerEffect owner)
 
static LayerDragGrid CreateIdentify (Chara cc, bool superior=false, BlessedState state=BlessedState.Normal, int price=0, int count=1)
 
static LayerDragGrid CreateEnchant (Chara cc, bool armor, bool superior=false, BlessedState state=BlessedState.Normal, 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)
 
static LayerDragGrid CreateUncurse (Chara cc, BlessedState state=BlessedState.Normal, int price=0, int count=1)
 
static LayerDragGrid CreateLighten (Chara cc, BlessedState state=BlessedState.Normal, int price=0, int count=1)
 
static LayerDragGrid CreateReconstruction (Chara cc, BlessedState state=BlessedState.Normal, int price=0, int count=1)
 
- Static Public Member Functions inherited from ELayer
static int rnd (int a)
 
- Static Public Member Functions inherited from Layer
static T Create< T > ()
 
static T Create< T > (string path)
 
static Layer Create (string path)
 

Public Attributes

List< PutbackInfoputBacks = new List<PutbackInfo>()
 
UIItem itemCost
 
Image imageOwner
 
UIText textTitle
 
UIText textFuel
 
Transform transIndex
 
List< ButtonGridbuttons
 
ButtonGrid buttonOwner
 
UIButton buttonRefuel
 
UIButton buttonAutoRefuel
 
UIButton buttonAlly
 
UIButton buttonStock
 
InvOwnerDraglet owner
 
UICurrency uiCurrency
 
int currentIndex
 
UIDragGridInfo info
 
UIList listAlly
 
UIDragGridIngredients uiIngredients
 
- Public Attributes inherited from Layer
Option option
 
UnityEvent onKill
 
Anime animeIn
 
Anime animeOut
 
bool closeOthers
 
bool defaultActionMode = true
 
Button screenLock
 
Layer parent
 
string idLayer
 
List< Layerlayers = new List<Layer>()
 
Vector2 lastParentPos
 
List< Windowwindows = new List<Window>()
 
string langHint
 

Static Public Attributes

static LayerDragGrid Instance
 
- Static Public Attributes inherited from Layer
static int skipInput
 
static bool closeOnRightClick
 
static bool rightClicked
 
static bool cancelKeyDown
 
static bool ignoreSounds
 
static Transform blurStopInstance
 
static string[] searchPath = new string[3] { "Layer", "Layer/Dialog", "Layer/LayerHome" }
 

Properties

ButtonGrid CurrentButton [get]
 
override bool CanCancelAI [get]
 
override bool RepeatAI [get]
 
- Properties inherited from LayerBaseCraft
virtual bool CanCancelAI [get]
 
virtual bool RepeatAI [get]
 
- Properties inherited from ELayer
static Core core [get]
 
static Game game [get]
 
static bool AdvMode [get]
 
static Player player [get]
 
static Chara pc [get]
 
static FactionBranch Branch [get]
 
static Faction Home [get]
 
static UI ui [get]
 
static Map _map [get]
 
static Zone _zone [get]
 
static Scene scene [get]
 
static BaseGameScreen screen [get]
 
static CoreConfig config [get]
 
static GameSetting setting [get]
 
static ColorProfile Colors [get]
 
static SourceManager sources [get]
 
static World world [get]
 
static SoundManager Sound [get]
 
static CoreDebug debug [get]
 
bool IsFloat [get]
 
virtual string IdHelp [get]
 
- Properties inherited from Layer
Layer TopLayer [get]
 
string uid [get]
 
virtual RectTransform rectLayers [get]
 
virtual bool blockWidgetClick [get]
 

Private Member Functions

void Update ()
 

Private Attributes

bool wasInventoryOpen
 
int lastNum
 

Additional Inherited Members

- Protected Member Functions inherited from ELayer
sealed override void _Close ()
 
sealed override void Kill ()
 
- Protected Member Functions inherited from Layer
virtual void Awake ()
 
virtual void _Close ()
 
virtual void Kill ()
 
- Protected Attributes inherited from Layer
RectTransform _rect
 
bool isDestroyed
 

Detailed Description

Definition at line 5 of file LayerDragGrid.cs.

Member Function Documentation

◆ AddPutBack()

void LayerDragGrid.AddPutBack ( Thing  t,
Thing  container 
)
inline

Definition at line 314 of file LayerDragGrid.cs.

315 {
316 if (container != null)
317 {
318 putBacks.Add(new PutbackInfo
319 {
320 thing = t,
321 container = container
322 });
323 }
324 }
List< PutbackInfo > putBacks

Referenced by UIDragGridIngredients.Refresh(), and UIDragGridIngredients.Update().

◆ ClearButtons()

override void LayerDragGrid.ClearButtons ( )
inlinevirtual

Reimplemented from LayerBaseCraft.

Definition at line 239 of file LayerDragGrid.cs.

240 {
241 for (int i = 0; i < owner.numDragGrid; i++)
242 {
243 buttons[i].SetCardGrid(null);
244 }
247 }
virtual int numDragGrid
Definition: InvOwner.cs:624
InvOwnerDraglet owner
UIDragGridIngredients uiIngredients
List< ButtonGrid > buttons
override void RefreshCurrentGrid()

References InvOwner.numDragGrid, and UIDragGridIngredients.Refresh().

Referenced by InvOwnerDraglet.OnClick().

◆ Create()

static LayerDragGrid LayerDragGrid.Create ( InvOwnerDraglet  owner,
bool  refuelFromLayerDragGrid = false 
)
inlinestatic

Definition at line 381 of file LayerDragGrid.cs.

382 {
383 return ELayer.ui.AddLayer<LayerDragGrid>("LayerInventory/LayerDragGrid").SetInv(owner, refuelFromLayerDragGrid);
384 }
Definition: ELayer.cs:4
static UI ui
Definition: ELayer.cs:21
LayerDragGrid SetInv(InvOwnerDraglet owner, bool refuelFromLayerDragGrid=false)

References ELayer.ui.

Referenced by ActPlan._Update(), TraitMod.OnUse(), LayerCraft.SetFactory(), and Trait.TrySetToggleAct().

◆ CreateChangeMaterial()

static LayerDragGrid LayerDragGrid.CreateChangeMaterial ( Chara  cc,
Thing  consume,
SourceMaterial::Row  mat,
EffectId  idEffect,
BlessedState  state = BlessedState::Normal,
int  price = 0,
int  count = 1 
)
inlinestatic

Definition at line 499 of file LayerDragGrid.cs.

500 {
501 return TryProc(cc, new InvOwnerChangeMaterial
502 {
503 consume = consume,
504 mat = mat,
505 state = state,
506 price = price,
507 count = count,
508 idEffect = idEffect
509 });
510 }
static LayerDragGrid TryProc(Chara cc, InvOwnerEffect owner)

Referenced by ActEffect.Proc().

◆ CreateChaosOffering()

static LayerDragGrid LayerDragGrid.CreateChaosOffering ( TraitAltarChaos  altar)
inlinestatic

Definition at line 386 of file LayerDragGrid.cs.

387 {
388 Msg.Say("offer_what");
389 return Create(new InvOwnerChaosOffering(altar.owner)
390 {
391 altar = altar
392 });
393 }
static LayerDragGrid Create(InvOwnerDraglet owner, bool refuelFromLayerDragGrid=false)
Definition: Msg.cs:5
static string Say(string idLang, string ref1, string ref2=null, string ref3=null, string ref4=null)
Definition: Msg.cs:58
Card owner
Definition: Trait.cs:26

References Trait.owner, and Msg.Say().

Referenced by TraitAltarChaos.TrySetAct().

◆ CreateCraft()

static LayerDragGrid LayerDragGrid.CreateCraft ( TraitCrafter  crafter)
inlinestatic

Definition at line 425 of file LayerDragGrid.cs.

426 {
427 return Create(new InvOwnerCraft(crafter.owner)
428 {
429 crafter = crafter
430 });
431 }

References Trait.owner.

Referenced by TraitCrafter.OnUse(), and TraitCrafter.TrySetAct().

◆ CreateDeliver()

static LayerDragGrid LayerDragGrid.CreateDeliver ( InvOwnerDeliver::Mode  mode = InvOwnerDeliver::Mode::Default,
Card  owner = null 
)
inlinestatic

Definition at line 404 of file LayerDragGrid.cs.

405 {
406 if (mode == InvOwnerDeliver.Mode.Tax)
407 {
408 Msg.Say("bills", ELayer.player.taxBills.ToString() ?? "");
409 }
410 Msg.Say("deliver_what");
411 return Create(new InvOwnerDeliver(owner)
412 {
413 mode = mode
414 });
415 }
static Player player
Definition: ELayer.cs:13
int taxBills
Definition: Player.cs:715

References ELayer.player, Msg.Say(), and Player.taxBills.

Referenced by TraitBank.OnUse(), TraitFarmChest.OnUse(), and TraitTaxChest.OnUse().

◆ CreateEnchant()

static LayerDragGrid LayerDragGrid.CreateEnchant ( Chara  cc,
bool  armor,
bool  superior = false,
BlessedState  state = BlessedState::Normal,
int  count = 1 
)
inlinestatic

Definition at line 488 of file LayerDragGrid.cs.

489 {
490 return TryProc(cc, new InvOwnerEnchant
491 {
492 armor = armor,
493 state = state,
494 superior = superior,
495 count = count
496 });
497 }

References armor.

Referenced by ActEffect.Proc().

◆ CreateGacha()

static LayerDragGrid LayerDragGrid.CreateGacha ( TraitGacha  gacha)
inlinestatic

Definition at line 442 of file LayerDragGrid.cs.

443 {
444 Msg.Say("target_what");
445 return Create(new InvOwnerGacha(gacha.owner)
446 {
447 gacha = gacha
448 });
449 }

References Trait.owner, and Msg.Say().

Referenced by TraitGacha.TrySetAct().

◆ CreateGive()

static LayerDragGrid LayerDragGrid.CreateGive ( Chara  c)
inlinestatic

Definition at line 417 of file LayerDragGrid.cs.

418 {
419 return Create(new InvOwnerGive(c)
420 {
421 chara = c
422 });
423 }

◆ CreateIdentify()

static LayerDragGrid LayerDragGrid.CreateIdentify ( Chara  cc,
bool  superior = false,
BlessedState  state = BlessedState::Normal,
int  price = 0,
int  count = 1 
)
inlinestatic

Definition at line 477 of file LayerDragGrid.cs.

478 {
479 return TryProc(cc, new InvOwnerIdentify
480 {
481 state = state,
482 price = price,
483 count = count,
484 superior = superior
485 });
486 }

Referenced by ActEffect.Proc().

◆ CreateLighten()

static LayerDragGrid LayerDragGrid.CreateLighten ( Chara  cc,
BlessedState  state = BlessedState::Normal,
int  price = 0,
int  count = 1 
)
inlinestatic

Definition at line 522 of file LayerDragGrid.cs.

523 {
524 return TryProc(cc, new InvOwnerLighten
525 {
526 state = state,
527 price = price,
528 count = count
529 });
530 }

Referenced by ActEffect.Proc().

◆ CreateOffering()

static LayerDragGrid LayerDragGrid.CreateOffering ( TraitAltar  altar)
inlinestatic

Definition at line 395 of file LayerDragGrid.cs.

396 {
397 Msg.Say("offer_what");
398 return Create(new InvOwnerOffering(altar.owner)
399 {
400 altar = altar
401 });
402 }

References Trait.owner, and Msg.Say().

Referenced by TraitAltar.TrySetAct().

◆ CreateReconstruction()

static LayerDragGrid LayerDragGrid.CreateReconstruction ( Chara  cc,
BlessedState  state = BlessedState::Normal,
int  price = 0,
int  count = 1 
)
inlinestatic

Definition at line 532 of file LayerDragGrid.cs.

533 {
534 return TryProc(cc, new InvOwnerReconstruction
535 {
536 state = state,
537 price = price,
538 count = count
539 });
540 }

Referenced by ActEffect.Proc().

◆ CreateRecycle()

static LayerDragGrid LayerDragGrid.CreateRecycle ( TraitRecycle  recycle)
inlinestatic

Definition at line 433 of file LayerDragGrid.cs.

434 {
435 Msg.Say("recycle_what");
436 return Create(new InvOwnerRecycle(recycle.owner)
437 {
438 recycle = recycle
439 });
440 }

References Trait.owner, and Msg.Say().

Referenced by TraitRecycle.OnUse().

◆ CreateUncurse()

static LayerDragGrid LayerDragGrid.CreateUncurse ( Chara  cc,
BlessedState  state = BlessedState::Normal,
int  price = 0,
int  count = 1 
)
inlinestatic

Definition at line 512 of file LayerDragGrid.cs.

513 {
514 return TryProc(cc, new InvOwnerUncurse
515 {
516 state = state,
517 price = price,
518 count = count
519 });
520 }

Referenced by ActEffect.Proc().

◆ GetPrice()

int LayerDragGrid.GetPrice ( )
inline

Definition at line 206 of file LayerDragGrid.cs.

207 {
208 return owner.price;
209 }

References InvOwnerDraglet.price.

◆ GetTargets()

override List< Thing > LayerDragGrid.GetTargets ( )
inlinevirtual

Reimplemented from LayerBaseCraft.

Definition at line 272 of file LayerDragGrid.cs.

273 {
274 List<Thing> list = new List<Thing>();
275 TraitCrafter traitCrafter = owner.owner.trait as TraitCrafter;
276 for (int i = 0; i < traitCrafter.numIng; i++)
277 {
278 list.Add(buttons[i].card?.Thing ?? null);
279 }
280 return list;
281 }
Definition: Thing.cs:8
virtual int numIng
Definition: TraitCrafter.cs:33

References card, and TraitCrafter.numIng.

◆ IsAllGridSet()

bool LayerDragGrid.IsAllGridSet ( )
inline

Definition at line 227 of file LayerDragGrid.cs.

228 {
229 for (int i = 0; i < owner.numDragGrid; i++)
230 {
231 if (buttons[i].card == null)
232 {
233 return false;
234 }
235 }
236 return true;
237 }

References card, and InvOwner.numDragGrid.

Referenced by InvOwnerDraglet.OnProcess().

◆ OnEndCraft()

override void LayerDragGrid.OnEndCraft ( )
inlinevirtual

Reimplemented from LayerBaseCraft.

Definition at line 339 of file LayerDragGrid.cs.

340 {
341 TryPutBack();
342 }

◆ OnKill()

override void LayerDragGrid.OnKill ( )
inlinevirtual

Reimplemented from Layer.

Definition at line 344 of file LayerDragGrid.cs.

345 {
346 EInput.haltInput = false;
348 InvOwner.Trader = null;
349 if (!wasInventoryOpen && ELayer.ui.IsInventoryOpen)
350 {
351 ELayer.ui.ToggleInventory();
352 }
355 {
356 ELayer.pc.ai.Cancel();
357 }
358 }
virtual bool IsRunning
Definition: AIAct.cs:31
virtual Status Cancel()
Definition: AIAct.cs:291
AIAct ai
Definition: Chara.cs:187
static Chara pc
Definition: ELayer.cs:15
bool wasInventoryOpen
static bool CloseAllyInv(Chara c)
static void SetDirtyAll(bool immediate=false)

References Chara.ai, AIAct.Cancel(), LayerInventory.CloseAllyInv(), AIAct.IsRunning, ELayer.pc, LayerInventory.SetDirtyAll(), and ELayer.ui.

◆ OnOpen()

void LayerDragGrid.OnOpen ( )
inline

Definition at line 62 of file LayerDragGrid.cs.

63 {
64 Instance = this;
65 InvOwner.Trader = owner;
66 wasInventoryOpen = ELayer.ui.IsInventoryOpen;
68 {
69 ELayer.ui.OpenFloatInv(ignoreSound: true);
70 }
71 }
static LayerDragGrid Instance

References Instance, owner, ELayer.ui, and wasInventoryOpen.

Referenced by SetInv().

◆ OnRightClick()

override void LayerDragGrid.OnRightClick ( )
inlinevirtual

Reimplemented from ELayer.

Definition at line 373 of file LayerDragGrid.cs.

374 {
375 if (InputModuleEX.GetComponentOf<ButtonGrid>() == null)
376 {
377 Close();
378 }
379 }
virtual void Close()
Definition: Layer.cs:463

◆ OnUpdateInput()

override void LayerDragGrid.OnUpdateInput ( )
inlinevirtual

Reimplemented from Layer.

Definition at line 360 of file LayerDragGrid.cs.

361 {
362 if (EInput.action == EAction.MenuInventory || Input.GetKeyDown(KeyCode.Tab))
363 {
364 Close();
366 }
367 else
368 {
369 base.OnUpdateInput();
370 }
371 }
EAction
Definition: EAction.cs:2
Definition: EInput.cs:8
static void WaitReleaseKey()
Definition: EInput.cs:650
static EAction action
Definition: EInput.cs:259

References EInput.action, and EInput.WaitReleaseKey().

◆ Redraw()

void LayerDragGrid.Redraw ( )
inline

Definition at line 302 of file LayerDragGrid.cs.

303 {
304 foreach (ButtonGrid button in buttons)
305 {
306 if (button.gameObject.activeSelf)
307 {
308 button.Redraw();
309 }
310 }
311 LayerInventory.SetDirtyAll(immediate: true);
312 }
void Redraw()
Definition: ButtonGrid.cs:140

References ButtonGrid.Redraw(), and LayerInventory.SetDirtyAll().

Referenced by AI_UseCrafter.Run().

◆ RefreshCost()

void LayerDragGrid.RefreshCost ( )
inline

Definition at line 211 of file LayerDragGrid.cs.

212 {
213 buttonAutoRefuel.mainText.text = (owner.owner.autoRefuel ? "On" : "Off");
214 buttonAutoRefuel.icon.SetAlpha(owner.owner.autoRefuel ? 1f : 0.4f);
215 buttonStock.mainText.text = ((!owner.owner.c_isDisableStockUse) ? "On" : "Off");
216 buttonStock.icon.SetAlpha((!owner.owner.c_isDisableStockUse) ? 1f : 0.4f);
217 textFuel.text = (int)((float)owner.owner.c_charges / (float)owner.owner.trait.MaxFuel * 100f) + "%";
218 int price = GetPrice();
219 itemCost.transform.parent.SetActive(price != 0);
220 if (price != 0)
221 {
223 itemCost.image1.sprite = SpriteSheet.Get("icon_" + owner.IDCurrency);
224 }
225 }
FontColor
Definition: FontColor.cs:2
int GetCurrency(string id="money")
Definition: Card.cs:3652
bool autoRefuel
Definition: Card.cs:598
Trait trait
Definition: Card.cs:49
bool c_isDisableStockUse
Definition: Card.cs:1044
Card owner
Definition: InvOwner.cs:538
string IDCurrency
Definition: InvOwner.cs:642
Definition: Lang.cs:6
static string _currency(object a, string IDCurrency)
Definition: Lang.cs:162
UIButton buttonAutoRefuel
UIButton buttonStock
static Sprite Get(string id)
Definition: SpriteSheet.cs:28
virtual int MaxFuel
Definition: Trait.cs:436
Image icon
Definition: UIButton.cs:110
UIText text1
Definition: UIItem.cs:6
void SetText(string s)
Definition: UIText.cs:159

References Lang._currency(), Card.autoRefuel, Card.c_isDisableStockUse, SpriteSheet.Get(), Card.GetCurrency(), UIButton.icon, InvOwner.IDCurrency, Trait.MaxFuel, InvOwner.owner, ELayer.pc, UIText.SetText(), UIItem.text1, and Card.trait.

Referenced by InvOwnerDraglet.RedrawButton(), and SetInv().

◆ RefreshCurrentGrid()

override void LayerDragGrid.RefreshCurrentGrid ( )
inlinevirtual

Reimplemented from LayerBaseCraft.

Definition at line 249 of file LayerDragGrid.cs.

250 {
251 int num = -1;
252 for (int i = 0; i < buttons.Count; i++)
253 {
254 bool flag = buttons[i].Card != null;
255 if (num == -1 && (!flag || i == owner.numDragGrid - 1))
256 {
257 num = i;
258 }
259 buttons[i].interactable = flag || num == i;
260 buttons[i].GetComponent<CanvasGroup>().alpha = (buttons[i].interactable ? 1f : 0.5f);
261 }
262 currentIndex = num;
263 bool flag2 = num >= 0 && num < owner.numDragGrid;
264 if (flag2)
265 {
266 transIndex.position = buttons[num].transform.position;
267 }
268 transIndex.SetActive(flag2);
269 Redraw();
270 }
Transform transIndex

References InvOwner.numDragGrid.

Referenced by InvOwnerDraglet.OnClick(), InvOwnerDraglet.OnProcess(), InvOwnerDraglet.RedrawButton(), and SetInv().

◆ SetInv()

LayerDragGrid LayerDragGrid.SetInv ( InvOwnerDraglet  owner,
bool  refuelFromLayerDragGrid = false 
)
inline

Definition at line 73 of file LayerDragGrid.cs.

74 {
75 owner.Init();
77 this.owner = owner;
78 textTitle.text = owner.langTransfer.lang();
79 OnOpen();
82 for (int j = 0; j < buttons.Count; j++)
83 {
84 buttons[j].gameObject.AddComponent<CanvasGroup>();
85 if (owner.numDragGrid > j)
86 {
87 buttons[j].SetCardGrid(null, owner);
88 buttons[j].index = j;
89 owner.buttons.Add(buttons[j]);
90 }
91 else
92 {
93 buttons[j].SetActive(enable: false);
94 }
95 }
99 InvokeRepeating("RefreshCost", 0f, 0.2f);
100 this.RebuildLayout(recursive: true);
102 RefreshCost();
103 this.RebuildLayout(recursive: true);
104 buttonRefuel.SetActive(owner.ShowFuel);
107 if (owner.CanTargetAlly && ELayer.pc.party.members.Count > 1)
108 {
109 listAlly.callbacks = new UIList.Callback<Chara, UIButton>
110 {
111 onInstantiate = delegate(Chara a, UIButton b)
112 {
113 a.SetImage(b.icon);
114 b.SetTooltipLang(a.Name);
115 },
116 onClick = delegate(Chara c, UIButton i)
117 {
119 {
120 SE.PopInventory();
122 }
123 },
124 onSort = delegate(Chara a, UIList.SortMode m)
125 {
126 a.SetSortVal(m);
127 return -a.sortVal;
128 },
129 onList = delegate
130 {
131 foreach (Chara member in ELayer.pc.party.members)
132 {
133 if (!member.IsPC)
134 {
135 listAlly.Add(member);
136 }
137 }
138 }
139 };
140 listAlly.List();
141 }
142 else
143 {
144 listAlly.SetActive(enable: false);
145 }
146 buttonRefuel.SetOnClick(delegate
147 {
148 if (!ELayer.pc.HasNoGoal)
149 {
150 SE.BeepSmall();
151 }
152 else
153 {
154 windows[0].SetInteractable(enable: false, 0f);
155 info.InitFuel(owner.owner);
156 Create(new InvOwnerRefuel(owner.owner), refuelFromLayerDragGrid: true).SetOnKill(delegate
157 {
158 if (!isDestroyed)
159 {
160 windows[0].SetInteractable(enable: true);
161 info.Init(owner.owner);
162 OnOpen();
163 RefreshCurrentGrid();
164 Redraw();
165 owner.OnAfterRefuel();
166 }
167 });
168 }
169 });
170 buttonAutoRefuel.SetOnClick(delegate
171 {
172 SE.Click();
173 owner.owner.autoRefuel = !owner.owner.autoRefuel;
174 RefreshCost();
176 {
178 }
179 });
180 buttonStock.SetOnClick(delegate
181 {
182 SE.Click();
183 owner.owner.c_isDisableStockUse = !owner.owner.c_isDisableStockUse;
185 RefreshCost();
186 });
187 if (owner is InvOwnerRefuel)
188 {
189 if (refuelFromLayerDragGrid)
190 {
191 info.SetActive(enable: false);
192 }
193 else
194 {
195 Debug.Log(owner.owner);
197 }
198 }
199 else
200 {
202 }
203 return this;
204 }
void SetCardGrid(Card c, InvOwner owner=null)
Definition: ButtonGrid.cs:145
string Name
Definition: Card.cs:2013
int sortVal
Definition: Card.cs:97
ThingContainer things
Definition: Card.cs:34
void SetImage(Image image, int dir, int idSkin=0)
Definition: Card.cs:5355
Definition: Chara.cs:10
override void SetSortVal(UIList.SortMode m, CurrencyType currency=CurrencyType.Money)
Definition: Chara.cs:6593
override bool IsPC
Definition: Chara.cs:597
Party party
Definition: Chara.cs:43
bool HasNoGoal
Definition: Chara.cs:821
virtual bool CanTargetAlly
virtual bool AllowStockIngredients
override void BuildUICurrency(UICurrency uiCurrency, bool canReroll=false)
virtual void OnAfterRefuel()
virtual bool ShowFuel
void Init()
Definition: InvOwner.cs:743
Card Container
Definition: InvOwner.cs:540
List< ButtonGrid > buttons
Definition: InvOwner.cs:542
virtual string langTransfer
Definition: InvOwner.cs:592
UIDragGridInfo info
UIButton buttonRefuel
void RefreshCost()
UICurrency uiCurrency
ButtonGrid buttonOwner
static LayerInventory CreateContainerAlly(Chara owner, Card container)
List< Chara > members
Definition: Party.cs:18
bool IsRequireFuel
Definition: Trait.cs:451
bool IsFuelEnough(int num=1, List< Thing > excludes=null, bool tryRefuel=true)
Definition: Trait.cs:1269
void SetTooltipLang(string lang=null)
Definition: UIButton.cs:373
void Init(Card _owner)
void InitFuel(Card _owner)
Definition: UIList.cs:9
SortMode
Definition: UIList.cs:27
override void Add(object item)
Definition: UIList.cs:302
override void List()
Definition: UIList.cs:717

References UIList.Add(), InvOwnerDraglet.AllowStockIngredients, InvOwnerDraglet.BuildUICurrency(), buttonAutoRefuel, buttonOwner, buttonRefuel, InvOwner.buttons, buttons, buttonStock, InvOwnerDraglet.CanTargetAlly, LayerInventory.CloseAllyInv(), InvOwner.Container, LayerInventory.CreateContainerAlly(), Chara.HasNoGoal, UIButton.icon, imageOwner, InvOwner.Init(), Chara.IsPC, Trait.IsRequireFuel, InvOwner.langTransfer, UIList.List(), listAlly, Party.members, Card.Name, InvOwner.numDragGrid, OnOpen(), InvOwner.owner, owner, Chara.party, ELayer.pc, UIDragGridIngredients.Refresh(), RefreshCost(), RefreshCurrentGrid(), ThingContainer.RefreshGrid(), ButtonGrid.SetCardGrid(), Card.SetImage(), Chara.SetSortVal(), UIButton.SetTooltipLang(), InvOwnerDraglet.ShowFuel, Card.sortVal, textFuel, Card.things, Card.trait, uiCurrency, and uiIngredients.

◆ TryProc()

static LayerDragGrid LayerDragGrid.TryProc ( Chara  cc,
InvOwnerEffect  owner 
)
inlinestatic

Definition at line 451 of file LayerDragGrid.cs.

452 {
453 owner.cc = cc;
454 if (cc.IsPC)
455 {
456 return Create(owner);
457 }
458 int num = ((owner.count == -1) ? 1 : owner.count);
459 for (int i = 0; i < num; i++)
460 {
461 List<Thing> list = cc.things.List((Thing t) => owner.ShouldShowGuide(t));
462 if (list.Count > 0)
463 {
464 Thing t2 = list.RandomItem();
465 owner._OnProcess(t2);
466 continue;
467 }
468 if (i == 0)
469 {
471 }
472 break;
473 }
474 return null;
475 }
void SayNothingHappans()
Definition: Card.cs:6041
virtual void _OnProcess(Thing t)
virtual bool ShouldShowGuide(Thing t)
Definition: InvOwner.cs:686
List< Thing > List(Func< Thing, bool > func, bool onlyAccessible=false)

References InvOwnerDraglet._OnProcess(), InvOwnerDraglet.count, Chara.IsPC, ThingContainer.List(), Card.SayNothingHappans(), InvOwner.ShouldShowGuide(), and Card.things.

◆ TryPutBack()

void LayerDragGrid.TryPutBack ( )
inline

Definition at line 326 of file LayerDragGrid.cs.

327 {
328 foreach (PutbackInfo putBack in putBacks)
329 {
330 if (!putBack.thing.isDestroyed && putBack.thing.Num != 0 && putBack.thing.parent != putBack.container && !putBack.container.isDestroyed)
331 {
332 putBack.container.AddCard(putBack.thing);
333 }
334 }
335 putBacks.Clear();
337 }

References Card.AddCard(), LayerDragGrid.PutbackInfo.container, Card.isDestroyed, Card.Num, Card.parent, and LayerDragGrid.PutbackInfo.thing.

Referenced by InvOwnerDraglet.OnClick().

◆ Update()

void LayerDragGrid.Update ( )
inlineprivate

Definition at line 283 of file LayerDragGrid.cs.

284 {
285 Validate();
286 }

◆ Validate()

void LayerDragGrid.Validate ( )
inline

Definition at line 288 of file LayerDragGrid.cs.

289 {
291 if (card.Num != lastNum)
292 {
293 lastNum = card.Num;
295 }
296 if (card == null || card.isDestroyed)
297 {
298 Close();
299 }
300 }
Card card
Definition: ButtonGrid.cs:24
Definition: Card.cs:11

References ButtonGrid.card, card, InvOwner.owner, and ButtonGrid.SetCardGrid().

Member Data Documentation

◆ buttonAlly

UIButton LayerDragGrid.buttonAlly

Definition at line 36 of file LayerDragGrid.cs.

◆ buttonAutoRefuel

UIButton LayerDragGrid.buttonAutoRefuel

Definition at line 34 of file LayerDragGrid.cs.

Referenced by SetInv().

◆ buttonOwner

ButtonGrid LayerDragGrid.buttonOwner

Definition at line 30 of file LayerDragGrid.cs.

Referenced by SetInv().

◆ buttonRefuel

UIButton LayerDragGrid.buttonRefuel

Definition at line 32 of file LayerDragGrid.cs.

Referenced by SetInv().

◆ buttons

◆ buttonStock

UIButton LayerDragGrid.buttonStock

Definition at line 38 of file LayerDragGrid.cs.

Referenced by SetInv().

◆ currentIndex

◆ imageOwner

Image LayerDragGrid.imageOwner

Definition at line 20 of file LayerDragGrid.cs.

Referenced by SetInv().

◆ info

UIDragGridInfo LayerDragGrid.info

Definition at line 46 of file LayerDragGrid.cs.

Referenced by TraitCrafter.Craft().

◆ Instance

◆ itemCost

UIItem LayerDragGrid.itemCost

Definition at line 18 of file LayerDragGrid.cs.

◆ lastNum

int LayerDragGrid.lastNum
private

Definition at line 54 of file LayerDragGrid.cs.

◆ listAlly

UIList LayerDragGrid.listAlly

Definition at line 48 of file LayerDragGrid.cs.

Referenced by SetInv().

◆ owner

◆ putBacks

List<PutbackInfo> LayerDragGrid.putBacks = new List<PutbackInfo>()

Definition at line 16 of file LayerDragGrid.cs.

◆ textFuel

UIText LayerDragGrid.textFuel

Definition at line 24 of file LayerDragGrid.cs.

Referenced by SetInv().

◆ textTitle

UIText LayerDragGrid.textTitle

Definition at line 22 of file LayerDragGrid.cs.

◆ transIndex

Transform LayerDragGrid.transIndex

Definition at line 26 of file LayerDragGrid.cs.

◆ uiCurrency

UICurrency LayerDragGrid.uiCurrency

Definition at line 42 of file LayerDragGrid.cs.

Referenced by SetInv().

◆ uiIngredients

UIDragGridIngredients LayerDragGrid.uiIngredients

Definition at line 50 of file LayerDragGrid.cs.

Referenced by InvOwnerDraglet.OnClick(), InvOwnerDraglet.OnProcess(), and SetInv().

◆ wasInventoryOpen

bool LayerDragGrid.wasInventoryOpen
private

Definition at line 52 of file LayerDragGrid.cs.

Referenced by OnOpen().

Property Documentation

◆ CanCancelAI

override bool LayerDragGrid.CanCancelAI
get

Definition at line 58 of file LayerDragGrid.cs.

◆ CurrentButton

ButtonGrid LayerDragGrid.CurrentButton
get

◆ RepeatAI

override bool LayerDragGrid.RepeatAI
get

Definition at line 60 of file LayerDragGrid.cs.


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