Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
UIInventory.cs
Go to the documentation of this file.
1using System;
2using System.Collections.Generic;
3using UnityEngine;
4using UnityEngine.UI;
5
6public class UIInventory : EMono
7{
8 public class Transaction
9 {
10 public Thing thing;
11
12 public int num;
13
14 public int price;
15
16 public Mode mode;
17
18 public Card from;
19 }
20
21 public enum Mode
22 {
23 Default,
24 Equip,
25 Buy,
26 Sell,
27 Gear,
28 Other,
29 Select,
30 Food,
31 Item,
33 Read,
34 Hold,
35 Tool,
36 Put,
37 Take,
38 Give,
39 Trade,
40 All,
41 Offer,
43 Drink,
44 Deliver,
48 }
49
50 public enum SubMode
51 {
52 Default,
55 }
56
57 public enum InteractMode
58 {
59 Auto,
60 Hold,
61 Drop
62 }
63
64 public class Tab
65 {
66 public Card dest;
67
69
70 public Mode mode;
71
73
74 public string textTab;
75
76 public bool smallTab;
77 }
78
79 public UIList list;
80
82
84
85 public Transform headerRow;
86
87 public Transform transOverflow;
88
89 public string idMold;
90
91 public Func<Thing, bool> funcList;
92
93 public Action<Thing> actionClick;
94
95 public Window window;
96
98
100
102
104
105 public bool floatMode;
106
107 public bool dirty;
108
109 public bool isList;
110
112
113 public Image imageHighlight;
114
115 public Image imageHighlightGrid;
116
118
120
122
124
126
127 private int destNum;
128
129 private int lastNum;
130
132
133 public List<Tab> tabs = new List<Tab>();
134
135 public bool wasDirty;
136
137 public InvOwner owner => (currentTab ?? tabs[0]).owner;
138
140
141 public bool UseBG
142 {
143 get
144 {
145 if (!window.saveData.useBG)
146 {
147 return !UseGrid;
148 }
149 return true;
150 }
151 }
152
154
155 public bool IsMagicChest => owner.Container.trait is TraitMagicChest;
156
157 public bool IsToolbelt => owner.Container.trait is TraitToolBelt;
158
159 public bool IsShop => owner.Container.trait is TraitChestMerchant;
160
162
164
165 public bool IsMainMode
166 {
167 get
168 {
169 switch (currentTab.mode)
170 {
171 case Mode.Gear:
172 case Mode.Food:
173 case Mode.Item:
174 case Mode.Resource:
175 case Mode.Read:
176 case Mode.Hold:
177 case Mode.Tool:
178 case Mode.All:
179 case Mode.Drink:
180 case Mode.HoldFurniture:
181 case Mode.HoldBlock:
182 return true;
183 default:
184 return false;
185 }
186 }
187 }
188
189 public CurrencyType CurrencyType => currentTab.owner.currency;
190
191 public string IDCurrency => CurrencyType switch
192 {
193 CurrencyType.Medal => "medal",
194 CurrencyType.Ecopo => "ecopo",
195 _ => "money",
196 };
197
198 public static void RefreshAllList()
199 {
200 UIInventory[] componentsInChildren = EMono.ui.rectLayers.GetComponentsInChildren<UIInventory>();
201 for (int i = 0; i < componentsInChildren.Length; i++)
202 {
203 componentsInChildren[i].list.Redraw();
204 }
205 }
206
207 public void SetHeader(string s)
208 {
209 window.SetCaption(s.lang());
210 }
211
212 public Tab AddTab(Card c, Mode mode, Thing container = null)
213 {
214 return AddTab(new InvOwner(c, container), mode);
215 }
216
217 public Tab AddTab(InvOwner owner, Mode mode = Mode.All)
218 {
219 owner.Init();
220 Tab tab = new Tab
221 {
222 mode = mode,
223 owner = owner
224 };
225 tabs.Add(tab);
226 return tab;
227 }
228
229 public void OnInit()
230 {
231 interactMode = EMono.player.pref.interactMode;
232 foreach (Tab t in tabs)
233 {
234 string text = t.textTab.IsEmpty("inv" + t.mode);
235 if (!floatMode)
236 {
237 text = text.lang() + " - " + (t.owner.owner.IsPC ? "you".lang().ToTitleCase() : (t.owner.Chara?.Name ?? t.owner.Container.Name));
238 }
239 Window.Setting.Tab tab = window.AddTab(text, content, delegate
240 {
241 SwitchTab(t);
243 if (t.smallTab)
244 {
245 tab.customTab = moldSmallTab;
246 }
247 }
248 if ((bool)layer.mini)
249 {
250 layer.mini.SetActive(owner.Container.isChara);
251 if (owner.Container.isChara)
252 {
253 layer.mini.SetChara(owner.Container.Chara);
254 }
255 }
256 if ((bool)uiMagic)
257 {
258 uiMagic.SetActive(IsMagicChest);
259 if (IsMagicChest)
260 {
261 uiMagic.Init();
262 }
263 }
264 if (IsMagicChest)
265 {
266 TooltipManager.Instance.disableTimer = 0.1f;
267 }
268 }
269
270 public void RefreshWindow()
271 {
272 if (window.saveData == null)
273 {
274 window.saveData = Window.dictData.TryGetValue(window.idWindow) ?? new Window.SaveData
275 {
276 useBG = EMono.core.config.game.showInvBG
277 };
278 }
279 window.setting.allowMove = !window.saveData.fixedPos;
280 window.bgCollider.raycastTarget = !window.saveData.fixedPos || window.saveData.useBG;
281 window.imageBG.SetActive(UseBG);
282 CoreRef.InventoryStyle inventoryStyle = EMono.core.refs.invStyle[owner.Container.trait.IDInvStyle];
283 if (UseBG)
284 {
285 window.imageBG.sprite = inventoryStyle.bg;
286 window.imageBG.rectTransform.anchoredPosition = inventoryStyle.posFix;
287 window.imageBG.rectTransform.sizeDelta = inventoryStyle.sizeDelta;
288 window.imageBG.alphaHitTestMinimumThreshold = 1f;
289 }
290 if (IsToolbelt)
291 {
292 window.cgFloatMenu.SetActive(enable: false);
293 window.cgFloatMenu = null;
294 window.bgCollider.rectTransform.anchoredPosition = new Vector2(-2.5f, 0f);
295 window.bgCollider.rectTransform.sizeDelta = new Vector2(-20f, -20f);
296 }
297 if (EMono.core.config.ui.showFloatButtons && (bool)window.cgFloatMenu)
298 {
299 window.cgFloatMenu.alpha = 1f;
300 window.cgFloatMenu.enabled = false;
301 window.cgFloatMenu.SetActive(enable: true);
302 }
303 }
304
305 public void Close()
306 {
307 if (!floatMode)
308 {
309 layer.Close();
310 }
311 }
312
313 public void SwitchTab(Tab tab)
314 {
315 if (currentTab == tab)
316 {
317 return;
318 }
319 currentTab = tab;
320 RefreshWindow();
321 destNum = (lastNum = (DestNumIsMax() ? (-1) : 0));
322 if (isList)
323 {
324 RefreshList();
325 }
326 else
327 {
328 RefreshGrid();
329 }
330 if (IsShop || window.saveData.alwaysSort)
331 {
332 Sort();
333 }
334 if ((bool)layer.uiCurrency)
335 {
336 tab.owner.BuildUICurrency(layer.uiCurrency, tab.owner.owner.trait.CostRerollShop != 0 || EMono.debug.enable);
337 }
338 layer.TryShowHint("h_inv" + tab.mode);
339 if ((bool)headerRow)
340 {
341 UIHeader[] componentsInChildren = headerRow.GetComponentsInChildren<UIHeader>(includeInactive: true);
342 componentsInChildren[0].SetText("headerItem");
343 switch (tab.mode)
344 {
345 case Mode.Buy:
346 case Mode.Sell:
347 case Mode.Identify:
348 componentsInChildren[1].SetText("headerPrice".lang(IDCurrency.lang()));
349 break;
350 default:
351 componentsInChildren[1].SetText("headerWeight");
352 break;
353 case Mode.Recycle:
354 componentsInChildren[1].SetText("headerRecycle");
355 break;
356 }
357 }
358 }
359
360 public void DoAct(Act act)
361 {
362 if (!EMono.pc.HasNoGoal || (act.LocalAct && EMono._zone.IsRegion))
363 {
364 SE.Beep();
365 return;
366 }
367 EMono.player.hotItemToRestore = EMono.player.currentHotItem;
368 if (act.IsAct)
369 {
370 act.Perform(EMono.pc);
371 return;
372 }
373 currentAct = act as AIAct;
374 EMono.pc.SetAI(currentAct);
376 if (!floatMode)
377 {
378 Close();
379 }
380 }
381
382 private void Update()
383 {
384 if (owner.Container.isDestroyed)
385 {
386 Close();
387 return;
388 }
389 imageHighlightGrid.SetActive(LayerInventory.highlightInv == owner);
390 CheckDirty();
391 if (EInput.action == EAction.GetAll && (bool)buttonTakeAll && !IsMagicChest)
392 {
393 buttonTakeAll.onClick.Invoke();
394 }
395 if ((IsMagicChest || window.saveData.alwaysSort) && wasDirty && (Input.GetMouseButtonUp(1) || Input.GetKeyUp(KeyCode.LeftShift) || Input.GetKeyUp(KeyCode.RightShift)))
396 {
397 list.Redraw();
398 if (!Input.GetMouseButton(1) && !Input.GetKey(KeyCode.LeftShift) && !Input.GetKey(KeyCode.RightShift))
399 {
400 wasDirty = false;
402 }
403 }
404 if (Input.GetMouseButtonDown(1))
405 {
406 firstMouseRightDown = true;
407 }
408 }
409
410 public void CheckDirty()
411 {
412 if (dirty)
413 {
414 wasDirty = true;
415 if (UseGrid)
416 {
417 list.Redraw();
418 }
419 else
420 {
421 list.List();
422 }
424 }
425 }
426
427 public void RefreshDestNum()
428 {
429 if (destNum <= 0)
430 {
431 destNum = ((!DestNumIsMax()) ? (EInput.isShiftDown ? (-1) : 0) : ((!EInput.isShiftDown) ? (-1) : 0));
432 if (destNum != lastNum)
433 {
434 lastNum = destNum;
435 list.Redraw();
436 }
437 }
438 }
439
440 public bool DestNumIsMax()
441 {
442 Mode mode = currentTab.mode;
443 if ((uint)(mode - 2) <= 1u)
444 {
445 return false;
446 }
447 return true;
448 }
449
450 public void RefreshMenu()
451 {
452 UIButton b2 = window.buttonSort;
453 Window.SaveData data = window.saveData;
454 if ((bool)b2)
455 {
456 b2.onClick.RemoveAllListeners();
457 b2.onClick.AddListener(delegate
458 {
459 UIContextMenu uIContextMenu = EMono.ui.CreateContextMenuInteraction();
460 uIContextMenu.layoutGroup.childAlignment = TextAnchor.UpperLeft;
461 uIContextMenu.alwaysPopLeft = true;
462 UIContextMenu uIContextMenu2 = uIContextMenu.AddChild("sort", TextAnchor.UpperRight);
463 UIList.SortMode[] sorts = list.sorts;
464 foreach (UIList.SortMode sortMode in sorts)
465 {
466 UIList.SortMode _sort = sortMode;
467 uIContextMenu2.AddButton((((IsShop ? EMono.player.pref.sortInvShop : (IsAdvSort ? data.sortMode : EMono.player.pref.sortInv)) == _sort) ? "context_checker".lang() : "") + _sort.ToString().lang(), delegate
468 {
469 if (IsShop)
470 {
471 EMono.player.pref.sortInvShop = _sort;
472 }
473 else
474 {
475 EMono.player.pref.sortInv = _sort;
476 }
477 data.sortMode = _sort;
478 Sort();
479 SE.Click();
480 });
481 }
482 uIContextMenu2.AddToggle("sort_ascending", IsShop ? EMono.player.pref.sort_ascending_shop : (IsAdvSort ? data.sort_ascending : EMono.player.pref.sort_ascending), delegate(bool a)
483 {
484 if (IsShop)
485 {
486 EMono.player.pref.sort_ascending_shop = a;
487 }
488 else
489 {
490 EMono.player.pref.sort_ascending = a;
491 }
492 data.sort_ascending = a;
493 Sort();
494 SE.Click();
495 });
496 if (!IsMagicChest)
497 {
498 uIContextMenu2.AddToggle("sort_always", data.alwaysSort, delegate(bool a)
499 {
500 data.alwaysSort = a;
501 if (data.alwaysSort)
502 {
503 Sort();
504 }
505 SE.Click();
506 });
507 }
508 if (IsMagicChest)
509 {
510 UIContextMenu uIContextMenu3 = uIContextMenu.AddChild("catFilterType", TextAnchor.UpperRight);
512 {
514 uIContextMenu3.AddButton(((data.category == item) ? "context_checker".lang() : "") + ("catFilterType_" + _c2).lang(), delegate
515 {
516 data.category = _c2;
517 uiMagic.idCat = "";
518 list.Redraw();
519 SE.Click();
520 });
521 }
522 }
523 Card con2 = owner.Container;
524 bool flag4 = (!con2.isNPCProperty && !con2.isChara && (con2.trait is TraitShippingChest || (con2.GetRoot() is Zone && EMono._zone.IsPCFaction) || con2.GetRootCard() == EMono.pc)) || EMono._zone is Zone_Tent;
525 if (con2.IsPC)
526 {
527 flag4 = true;
528 }
529 if (con2.trait is TraitChestMerchant)
530 {
531 flag4 = false;
532 }
533 UIContextMenu dis2;
534 Transform dist2;
535 Transform distAdv2;
536 if (flag4)
537 {
538 dis2 = uIContextMenu.AddChild("distribution", TextAnchor.UpperRight);
539 dis2.AddSlider("priority_hint", (float a) => a.ToString() ?? "", data.priority, delegate(float a)
540 {
541 data.priority = (int)a;
542 }, -5f, 20f, isInt: true, hideOther: false);
543 dist2 = ShowDistribution(dis2, data);
544 distAdv2 = ShowAdvDistribution(dis2, data);
545 RefreshDist();
547 {
548 dis2.AddToggle("onlyRottable", data.onlyRottable, delegate(bool a)
549 {
550 data.onlyRottable = a;
551 SE.ClickOk();
552 });
553 }
554 dis2.AddToggle("noRotten", data.noRotten, delegate(bool a)
555 {
556 data.noRotten = a;
557 SE.ClickOk();
558 });
559 dis2.AddToggle("advDistribution", data.advDistribution, delegate(bool a)
560 {
561 data.advDistribution = a;
562 RefreshDist();
563 SE.ClickOk();
564 });
566 {
567 dis2.AddButton(data.filter.IsEmpty() ? "distFilter" : "distFilter2".lang(data.filter), delegate
568 {
569 Dialog.InputName("distFilter3", data.filter.IsEmpty(""), delegate(bool cancel, string s)
570 {
571 if (!cancel)
572 {
573 data._filterStrs = null;
574 data.filter = s;
575 }
576 }, Dialog.InputType.DistributionFilter);
577 });
578 }
579 }
580 Window.SaveData data2;
581 UIContextMenu dis;
582 Transform dist;
583 Transform distAdv;
585 {
586 data2 = EMono.player.dataPick;
587 dis = uIContextMenu.AddChild("autopick", TextAnchor.UpperRight);
588 dist = ShowDistribution(dis, data2);
589 distAdv = ShowAdvDistribution(dis, data2);
590 RefreshDist();
591 dis.AddToggle("noRotten", data2.noRotten, delegate(bool a)
592 {
593 data2.noRotten = a;
594 SE.ClickOk();
595 });
596 dis.AddToggle("advDistribution", data2.advDistribution, delegate(bool a)
597 {
598 data2.advDistribution = a;
599 RefreshDist();
600 SE.ClickOk();
601 });
603 {
604 dis.AddButton(data2.filter.IsEmpty() ? "distFilter" : "distFilter2".lang(data2.filter), delegate
605 {
606 Dialog.InputName("distFilter3", data2.filter.IsEmpty(""), delegate(bool cancel, string s)
607 {
608 if (!cancel)
609 {
610 data2._filterStrs = null;
611 data2.filter = s;
612 }
613 }, Dialog.InputType.DistributionFilter);
614 });
615 }
616 }
618 {
619 UIContextMenu uIContextMenu4 = uIContextMenu.AddChild("autodump", TextAnchor.UpperRight);
620 foreach (AutodumpFlag item2 in new List<AutodumpFlag>
621 {
622 AutodumpFlag.existing,
623 AutodumpFlag.sameCategory,
624 AutodumpFlag.distribution,
625 AutodumpFlag.none
626 })
627 {
628 string text2 = ((data.autodump == item2) ? "context_checker".lang() : "");
629 AutodumpFlag _e = item2;
630 UIButton uIButton = uIContextMenu4.AddButton(text2 + ("dump_" + item2).lang(), delegate
631 {
632 SE.Click();
633 data.autodump = _e;
634 });
635 if (item2 != AutodumpFlag.none)
636 {
637 uIButton.SetTooltipLang("dump_" + item2.ToString() + "_tip");
638 }
639 }
640 }
641 if (con2.IsPC || (con2.isThing && !(con2.trait is TraitChestMerchant) && !con2.isNPCProperty))
642 {
643 UIContextMenu uIContextMenu5 = uIContextMenu.AddChild("config", TextAnchor.UpperRight);
644 uIContextMenu5.AddToggle("toggleExcludeCraft", data.excludeCraft, delegate(bool a)
645 {
646 data.excludeCraft = a;
647 SE.ClickOk();
648 });
649 if (con2.GetRootCard() == EMono.pc)
650 {
651 uIContextMenu5.AddToggle("toggleDump", data.excludeDump, delegate(bool a)
652 {
653 data.excludeDump = a;
654 SE.ClickOk();
655 });
656 }
658 {
659 if (!con2.IsPC)
660 {
661 uIContextMenu5.AddToggle("noRightClickClose", data.noRightClickClose, delegate(bool a)
662 {
663 data.noRightClickClose = a;
664 SE.ClickOk();
665 });
666 }
667 uIContextMenu5.AddToggle("fixedPos", data.fixedPos, delegate(bool a)
668 {
669 data.fixedPos = a;
670 RefreshWindow();
671 SE.ClickOk();
672 });
673 uIContextMenu5.AddToggle("toggleItemCompress", data.compress, delegate(bool a)
674 {
675 data.compress = a;
676 SE.ClickOk();
677 });
678 if (!con2.IsPC)
679 {
680 uIContextMenu5.AddToggle("toggleShiftToShowMenu", data.shiftToShowMenu, delegate(bool a)
681 {
682 data.shiftToShowMenu = a;
683 SE.ClickOk();
684 });
685 }
686 }
687 if (con2.IsPC)
688 {
689 uIContextMenu5.AddToggle("placeContainerCenter", EMono.player.openContainerCenter, delegate(bool a)
690 {
691 EMono.player.openContainerCenter = a;
692 SE.ClickOk();
693 });
694 }
695 if (!con2.isChara && !con2.trait.IsSpecialContainer)
696 {
697 uIContextMenu5.AddButton("changeName", delegate
698 {
699 Dialog.InputName("dialogChangeName", con2.c_altName.IsEmpty(""), delegate(bool cancel, string text)
700 {
701 if (!cancel)
702 {
703 con2.c_altName = text;
704 }
705 }, Dialog.InputType.Item);
706 });
707 }
709 {
710 uIContextMenu5.AddButton("copyContainer", delegate
711 {
712 SE.ClickOk();
713 EMono.player.windowDataCopy = IO.DeepCopy(data);
714 EMono.player.windowDataName = con2.Name;
715 });
716 if (EMono.player.windowDataCopy != null && !con2.IsPC)
717 {
718 uIContextMenu5.AddButton("pasteContainer".lang(EMono.player.windowDataName), delegate
719 {
720 SE.ClickOk();
721 window.saveData.CopyFrom(EMono.player.windowDataCopy);
722 RefreshWindow();
723 RefreshGrid();
724 });
725 }
726 }
727 }
728 UIContextMenu uIContextMenu6 = uIContextMenu.AddChild("appearanceWindow", TextAnchor.UpperRight);
729 uIContextMenu6.AddToggle("toggleBG", data.useBG, delegate(bool a)
730 {
731 data.useBG = a;
732 data.color = InvStyle.gridColor;
733 RefreshWindow();
734 RefreshGrid();
735 SE.ClickOk();
736 });
737 uIContextMenu6.AddSlider("size", (float a) => a.ToString() ?? "", data.size, delegate(float b)
738 {
739 data.size = (int)b;
740 RefreshGrid();
741 }, -25f, 25f, isInt: true, hideOther: false);
742 if (EMono.core.config.game.advancedMenu && !IsMagicChest)
743 {
744 uIContextMenu6.AddSlider("columns", (float a) => a.ToString() ?? "", data.columns, delegate(float b)
745 {
746 data.columns = (int)b;
747 RefreshGrid();
748 }, 0f, 20f, isInt: true, hideOther: false);
749 }
750 uIContextMenu6.AddButton("colorGrid", delegate
751 {
752 EMono.ui.AddLayer<LayerColorPicker>().SetColor(data.color, InvStyle.gridColor, delegate(PickerState state, Color _c)
753 {
754 data.color = _c;
755 list.bgGrid.color = _c;
756 if (data.color.a == 0)
757 {
758 list.bgGrid.color = InvStyle.gridColor;
759 }
760 });
761 });
762 if (!con2.isChara)
763 {
764 uIContextMenu6.AddButton("changeIcon", delegate
765 {
766 EMono.ui.contextMenu.currentMenu.Hide();
767 UIContextMenu uIContextMenu9 = EMono.ui.CreateContextMenuInteraction();
768 GridLayoutGroup parent = uIContextMenu9.AddGridLayout();
769 int num = 0;
770 foreach (Sprite item3 in EMono.core.refs.spritesContainerIcon)
771 {
772 _ = item3;
773 UIButton uIButton2 = Util.Instantiate<UIButton>("UI/Element/Button/ButtonContainerIcon", parent);
774 int _i = num;
775 uIButton2.icon.sprite = EMono.core.refs.spritesContainerIcon[_i];
776 uIButton2.SetOnClick(delegate
777 {
778 SE.Click();
779 owner.Container.c_indexContainerIcon = _i;
780 LayerInventory.SetDirty(owner.Container.Thing);
781 EMono.ui.contextMenu.currentMenu.Hide();
782 });
783 num++;
784 }
785 uIContextMenu9.Show();
786 });
787 }
789 {
790 UIContextMenu uIContextMenu7 = uIContextMenu.AddChild("anchor");
791 foreach (RectPosition p in Util.EnumToList<RectPosition>())
792 {
793 uIContextMenu7.AddButton(((data.customAnchor == p) ? "★ " : "") + p.ToString().lang(), delegate
794 {
795 data.customAnchor = p;
796 window.UpdateSaveData();
797 SE.ClickGeneral();
798 });
799 }
800 }
801 if (EMono.debug.enable)
802 {
803 UIContextMenu uIContextMenu8 = uIContextMenu.AddChild("debug", TextAnchor.UpperRight);
804 uIContextMenu8.AddToggle("toggleGrid", EMono.core.config.game.useGrid, delegate(bool a)
805 {
806 EMono.core.config.game.useGrid = a;
807 foreach (LayerInventory item4 in LayerInventory.listInv)
808 {
809 item4.invs[0].RefreshWindow();
810 item4.invs[0].RefreshGrid();
811 }
812 });
813 uIContextMenu8.AddSlider("iconSize", (float a) => a.ToString() ?? "", EMono.game.config.gridIconSize, delegate(float b)
814 {
815 EMono.game.config.gridIconSize = (int)b;
816 RefreshGrid();
817 }, 100f, 150f, isInt: true, hideOther: false);
818 }
819 uIContextMenu.Show();
820 uIContextMenu.hideOnMouseLeave = false;
821 void RefreshDist()
822 {
823 dist2.SetActive(!data.advDistribution);
824 distAdv2.SetActive(data.advDistribution);
825 dis2.layoutGroup.RebuildLayout();
826 }
827 void RefreshDist()
828 {
829 dist.SetActive(!data2.advDistribution);
830 distAdv.SetActive(data2.advDistribution);
831 dis.layoutGroup.RebuildLayout();
832 }
833 });
834 }
835 b2 = window.buttonQuickSort;
836 if ((bool)b2)
837 {
838 b2.onClick.RemoveAllListeners();
839 b2.onClick.AddListener(delegate
840 {
841 Sort();
842 SE.Click();
843 });
844 }
845 b2 = window.buttonExtra;
846 if ((bool)b2)
847 {
848 b2.SetActive(owner.Container.IsPC);
849 b2.onClick.RemoveAllListeners();
850 b2.onClick.AddListener(delegate
851 {
853 });
854 }
855 b2 = window.buttonShared;
856 if ((bool)b2)
857 {
858 Card con = owner.Container;
859 bool flag = !con.isChara && ((con.IsInstalled && EMono._zone.IsPCFaction) || owner.owner.IsPC);
860 b2.SetActive(flag);
861 if (flag)
862 {
863 RefreshShareButton();
864 b2.SetOnClick(delegate
865 {
866 bool flag3 = data.sharedType == ContainerSharedType.Shared;
867 SE.ClickOk();
868 Msg.Say("changePermission", con, (flag3 ? "stPersonal" : "stShared").lang());
869 data.sharedType = ((!flag3) ? ContainerSharedType.Shared : ContainerSharedType.Personal);
870 RefreshShareButton();
871 });
872 }
873 }
874 Mode mode = currentTab.mode;
875 WindowMenu menuBottom = window.menuBottom;
876 menuBottom.Clear();
877 switch (mode)
878 {
879 case Mode.Take:
880 if (owner.Container.isNPCProperty || owner.Container.isChara || IsMagicChest)
881 {
882 break;
883 }
884 buttonTakeAll = menuBottom.AddButton("takeAll".lang(EInput.keys.getAll.key.ToString().ToLower()), delegate
885 {
886 owner.Container.things.ForeachReverse(delegate(Thing t)
887 {
888 if (!EMono.pc.things.IsFull(t))
889 {
890 EMono.pc.Pick(t, msg: false);
891 }
892 });
893 if (owner.Container.things.Count > 0)
894 {
895 SE.Beep();
896 }
897 else
898 {
899 SE.Play("pick_thing");
900 Close();
901 }
902 });
903 break;
904 case Mode.Buy:
905 {
906 Card _owner = owner.owner;
907 int cost = _owner.trait.CostRerollShop;
908 if (cost <= 0)
909 {
910 break;
911 }
912 menuBottom.AddButton("rerollShop".lang(cost.ToString() ?? ""), delegate
913 {
914 if (EMono._zone.influence < cost)
915 {
916 SE.Beep();
917 Msg.Say("notEnoughInfluence");
918 }
919 else
920 {
921 SE.Dice();
922 EMono._zone.influence -= cost;
923 _owner.c_dateStockExpire = 0;
924 _owner.trait.OnBarter();
925 RefreshGrid();
926 Sort();
927 SE.Play("shop_open");
928 }
929 });
930 break;
931 }
932 }
933 void RefreshShareButton()
934 {
935 bool flag2 = data.sharedType == ContainerSharedType.Shared;
936 b2.image.sprite = (flag2 ? EMono.core.refs.icons.shared : EMono.core.refs.icons.personal);
937 b2.tooltip.lang = (flag2 ? "hintShared" : "hintPrivate");
939 }
940 }
941
942 public Transform ShowDistribution(UIContextMenu dis, Window.SaveData data)
943 {
944 List<UIContextMenuItem> items = new List<UIContextMenuItem>();
945 UIContextMenuItem itemAll = null;
946 List<ContainerFlag> obj = Util.EnumToList<ContainerFlag>();
947 obj.Remove(ContainerFlag.none);
948 GridLayoutGroup gridLayoutGroup = dis.AddGridLayout("Context_LayoutDistribution");
949 itemAll = dis.AddToggle("all", isOn: false, delegate(bool a)
950 {
951 foreach (UIContextMenuItem item in items)
952 {
953 item.toggle.isOn = a;
954 }
955 Refresh();
956 SE.ClickOk();
957 });
958 foreach (ContainerFlag f2 in obj)
959 {
960 SourceCategory.Row row = EMono.sources.categories.map[f2.ToString()];
961 items.Add(dis.AddToggle(row.GetName(), !data.flag.HasFlag(f2), delegate(bool a)
962 {
963 SetOn(f2, !a);
964 Refresh();
965 SE.ClickOk();
966 }));
967 }
968 itemAll.transform.SetParent(gridLayoutGroup.transform);
969 itemAll.GetComponentInChildren<UIText>().SetText("all".lang(), FontColor.Topic);
970 foreach (UIContextMenuItem item2 in items)
971 {
972 item2.transform.SetParent(gridLayoutGroup.transform);
973 }
974 Refresh();
975 return gridLayoutGroup.transform;
976 void Refresh()
977 {
978 bool isOnWithoutNotify = true;
979 foreach (UIContextMenuItem item3 in items)
980 {
981 if (!item3.toggle.isOn)
982 {
983 isOnWithoutNotify = false;
984 }
985 }
986 itemAll.toggle.SetIsOnWithoutNotify(isOnWithoutNotify);
987 }
988 void SetOn(ContainerFlag f, bool on)
989 {
990 if (!on && data.flag.HasFlag(f))
991 {
992 data.flag &= ~f;
993 }
994 else if (on && !data.flag.HasFlag(f))
995 {
996 data.flag |= f;
997 }
998 }
999 }
1000
1002 {
1003 UIDistribution uIDistribution = Util.Instantiate<UIDistribution>("UI/Layer/UIDistribution");
1004 uIDistribution.SetContainer(owner.Container, data);
1005 return dis.AddGameObject(uIDistribution).transform;
1006 }
1007
1008 public void Sort(bool redraw = true)
1009 {
1010 UIList.SortMode m = (IsShop ? EMono.player.pref.sortInvShop : (IsAdvSort ? window.saveData.sortMode : EMono.player.pref.sortInv));
1011 bool flag = true;
1012 while (flag)
1013 {
1014 flag = false;
1015 foreach (Thing thing in owner.Container.things)
1016 {
1017 if (thing.invY == 1)
1018 {
1019 continue;
1020 }
1021 foreach (Thing thing2 in owner.Container.things)
1022 {
1023 if (thing != thing2 && thing2.invY != 1 && thing.TryStackTo(thing2))
1024 {
1025 flag = true;
1026 break;
1027 }
1028 }
1029 if (flag)
1030 {
1031 break;
1032 }
1033 }
1034 }
1035 int num = 0;
1036 foreach (Thing thing3 in owner.Container.things)
1037 {
1038 if (thing3.invY != 1)
1039 {
1040 thing3.invY = 0;
1041 thing3.invX = -1;
1042 }
1043 num++;
1044 }
1045 owner.Container.things.Sort(m, IsShop ? EMono.player.pref.sort_ascending_shop : (IsAdvSort ? window.saveData.sort_ascending : EMono.player.pref.sort_ascending));
1046 if (!UseGrid)
1047 {
1048 int num2 = 0;
1049 int num3 = 0;
1050 Vector2 sizeDelta = list.Rect().sizeDelta;
1051 sizeDelta.x -= 60f;
1052 sizeDelta.y -= 60f;
1053 foreach (Thing thing4 in owner.Container.things)
1054 {
1055 if (thing4.invY != 0)
1056 {
1057 continue;
1058 }
1059 thing4.posInvX = num2 + 30;
1060 thing4.posInvY = (int)sizeDelta.y - num3 + 30;
1061 num2 += 40;
1062 if ((float)num2 > sizeDelta.x)
1063 {
1064 num2 = 0;
1065 num3 += 40;
1066 if ((float)num3 > sizeDelta.y)
1067 {
1068 num3 = 20;
1069 }
1070 }
1071 }
1072 }
1073 if (redraw)
1074 {
1075 list.Redraw();
1076 }
1077 }
1078
1079 public void RefreshList()
1080 {
1081 Mode mode = currentTab.mode;
1082 _ = currentTab.subMode;
1083 RefreshMenu();
1084 list.Clear();
1086 {
1087 onClick = delegate(Thing a, ButtonGrid b)
1088 {
1089 if (destNum != 0)
1090 {
1091 if (destNum != -1)
1092 {
1093 _ = destNum;
1094 }
1095 else
1096 {
1097 _ = a.Num;
1098 }
1099 }
1100 if (actionClick != null)
1101 {
1102 actionClick(a);
1103 Close();
1104 }
1105 else
1106 {
1107 EMono.pc.HoldCard(a);
1108 SE.SelectHotitem();
1109 }
1110 },
1111 onInstantiate = delegate(Thing a, ButtonGrid b)
1112 {
1113 _ = a.Name;
1114 bool flag = mode == Mode.Buy || mode == Mode.Sell || mode == Mode.Identify;
1115 int num2 = ((destNum != -1) ? 1 : a.Num);
1116 int cost = (flag ? (a.GetPrice(CurrencyType, mode == Mode.Sell) * num2) : 0);
1117 bool canPay = cost < EMono.pc.GetCurrency(IDCurrency);
1118 if (mode == Mode.Identify)
1119 {
1120 cost = 100;
1121 }
1122 b.SetCard(a, ButtonGrid.Mode.Default, delegate(UINote n)
1123 {
1124 Mode mode2 = mode;
1125 if ((uint)(mode2 - 2) <= 1u)
1126 {
1127 n.Space(8);
1128 UIItem uIItem = n.AddExtra<UIItem>("costPrice");
1129 uIItem.text1.SetText(Lang._currency(cost), canPay ? FontColor.Good : FontColor.Bad);
1130 uIItem.image1.sprite = SpriteSheet.Get("icon_" + IDCurrency);
1131 }
1132 });
1133 if (flag && (bool)b.subText)
1134 {
1135 b.subText.SetText((cost.ToString() ?? "").TagColorGoodBad(() => mode == Mode.Sell || cost <= EMono.pc.GetCurrency(IDCurrency)));
1136 }
1137 },
1138 onList = delegate
1139 {
1140 dirty = false;
1141 List<Thing> list = new List<Thing>();
1142 foreach (Thing thing in owner.Things)
1143 {
1144 if (thing != null && (funcList == null || funcList(thing)) && !thing.HasTag(CTAG.noDrop) && (thing.c_equippedSlot == 0 || mode == Mode.Equip || mode == Mode.Identify) && (!(thing.category.id == "currency") || (mode != Mode.Buy && mode != Mode.Sell)))
1145 {
1146 list.Add(thing);
1147 }
1148 }
1149 int num = 0;
1150 _ = this.list;
1151 foreach (Thing item in list)
1152 {
1153 num += item.ChildrenAndSelfWeight;
1154 this.list.Add(item);
1155 }
1156 string text = "";
1157 text = "statsInv".lang(owner.Container.things.Count.ToString() ?? "", this.list.ItemCount.ToString() ?? "", Lang._weight(num));
1158 layer.windows[0].textStats.SetText(text);
1159 },
1160 onSort = null
1161 };
1162 list.callbacks = callbacks;
1163 list.List();
1164 }
1165
1166 public void RefreshHighlight()
1167 {
1168 if (!imageHighlight)
1169 {
1170 return;
1171 }
1172 imageHighlight.SetActive(enable: false);
1173 if (EMono.game.altInv)
1174 {
1176 if (currentTab.mode == Mode.All && thing != null && !thing.isDestroyed)
1177 {
1178 _ = thing.parent;
1179 _ = owner.Container;
1180 }
1181 }
1182 }
1183
1184 public void RefreshGrid()
1185 {
1186 _ = currentTab.mode;
1187 _ = currentTab.subMode;
1188 CoreRef.InventoryStyle style = InvStyle;
1189 RefreshMenu();
1190 GridLayoutGroup g = list.GetComponent<GridLayoutGroup>();
1191 ContentSizeFitter component = list.GetComponent<ContentSizeFitter>();
1192 if (UseGrid)
1193 {
1194 g.constraintCount = ((window.saveData.columns == 0) ? owner.Container.things.width : window.saveData.columns);
1195 Vector2 cellSize = style.gridSize * (100 + window.saveData.size) / 100f;
1196 g.cellSize = cellSize;
1197 GridLayoutGroup gridLayoutGroup = g;
1198 bool flag2 = (component.enabled = true);
1199 gridLayoutGroup.enabled = flag2;
1200 }
1201 else
1202 {
1203 GridLayoutGroup gridLayoutGroup2 = g;
1204 bool flag2 = (component.enabled = false);
1205 gridLayoutGroup2.enabled = flag2;
1206 list.Rect().sizeDelta = style.sizeContainer;
1207 }
1208 list.Clear();
1209 int maxCapacity = (IsMagicChest ? owner.Container.things.MaxCapacity : 0);
1211 {
1212 onRedraw = delegate(Thing a, ButtonGrid b, int i)
1213 {
1214 b.index = i;
1215 bool flag4 = i >= owner.Things.Count;
1216 if (IsMagicChest)
1217 {
1218 flag4 = uiMagic.page * uiMagic.GridSize + i >= maxCapacity;
1219 }
1220 if (UseGrid)
1221 {
1222 b.SetCardGrid(a, flag4 ? null : owner);
1223 }
1224 else
1225 {
1226 b.SetCardGrid(a, owner);
1227 if (a != null)
1228 {
1229 b.Rect().anchoredPosition = new Vector2(a.posInvX, a.posInvY);
1230 }
1231 float num3 = 0.01f * (float)EMono.game.config.gridIconSize;
1232 b.icon.Rect().localScale = new Vector3(num3, num3, 1f);
1233 b.Rect().sizeDelta = b.icon.rectTransform.sizeDelta;
1234 }
1235 if (flag4)
1236 {
1237 b.interactable = false;
1238 b.image.sprite = null;
1239 b.image.color = new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, 120);
1240 b.image.raycastTarget = true;
1241 }
1242 else
1243 {
1244 b.image.raycastTarget = true;
1245 }
1246 },
1247 onList = delegate
1248 {
1249 list.bgType = (UseGrid ? UIList.BGType.grid : UIList.BGType.none);
1250 if ((bool)list.bgGrid)
1251 {
1252 list.bgGrid.SetActive(UseGrid);
1253 list.bgGrid.color = style.gridColor;
1254 if (window.saveData.color.a != 0)
1255 {
1256 list.bgGrid.color = window.saveData.color;
1257 }
1258 }
1259 if (IsMagicChest)
1260 {
1261 owner.Container.things.RefreshGrid(uiMagic, window.saveData);
1262 }
1263 else
1264 {
1265 owner.Container.things.RefreshGrid();
1266 }
1267 if (UseGrid)
1268 {
1269 if (IsMagicChest)
1270 {
1271 for (int k = 0; k < owner.Container.things.GridSize; k++)
1272 {
1273 list.Add(owner.Things[k]);
1274 }
1275 }
1276 else
1277 {
1278 int count = owner.Things.Count;
1279 int num2 = (int)Mathf.Ceil(count / g.constraintCount + ((count % g.constraintCount != 0) ? 1 : 0)) * g.constraintCount;
1280 for (int l = 0; l < num2; l++)
1281 {
1282 list.Add((l < count) ? owner.Things[l] : null);
1283 }
1284 }
1285 }
1286 else
1287 {
1288 Vector2 sizeDelta2 = list.Rect().sizeDelta;
1289 foreach (Thing thing2 in owner.Things)
1290 {
1291 if (thing2 != null)
1292 {
1293 list.Add(thing2);
1294 if (thing2.posInvX == 0 && thing2.posInvY == 0)
1295 {
1296 thing2.posInvX = EMono.rnd((int)sizeDelta2.x - 60) + 30;
1297 thing2.posInvY = EMono.rnd((int)sizeDelta2.y - 60) + 30;
1298 }
1299 }
1300 }
1301 }
1302 if (floatMode)
1303 {
1304 window.setting.tabs[0].idLang = "captionInvFloat".lang(owner.Container.IsPC ? "" : owner.Container.Name, ((float)owner.Container.ChildrenWeight / 1000f).ToString("F1") + "/" + ((float)owner.Container.WeightLimit / 1000f).ToString("F1"));
1305 }
1306 }
1307 };
1308 bool sorted = false;
1309 list.callbacks = callback;
1310 list.onBeforeRedraw = delegate
1311 {
1312 if (IsMagicChest)
1313 {
1314 if (firstMouseRightDown || (!Input.GetMouseButton(1) && !Input.GetKey(KeyCode.LeftShift) && !Input.GetKey(KeyCode.RightShift)))
1315 {
1316 Sort(redraw: false);
1317 firstMouseRightDown = false;
1318 owner.Container.things.RefreshGrid(uiMagic, window.saveData);
1319 }
1320 }
1321 else
1322 {
1323 if (window.saveData.alwaysSort && !sorted && (firstMouseRightDown || (!Input.GetMouseButton(1) && !Input.GetKey(KeyCode.LeftShift) && !Input.GetKey(KeyCode.RightShift))))
1324 {
1325 sorted = true;
1326 Sort();
1327 sorted = false;
1328 firstMouseRightDown = false;
1329 }
1330 owner.Container.things.RefreshGrid();
1331 }
1332 dirty = false;
1333 if (UseGrid)
1334 {
1335 UIList uIList = list;
1336 for (int j = 0; j < uIList.buttons.Count; j++)
1337 {
1338 UIList.ButtonPair value = uIList.buttons[j];
1339 value.obj = ((j < owner.Container.things.grid.Count) ? owner.Container.things.grid[j] : null);
1340 uIList.buttons[j] = value;
1341 }
1342 }
1343 };
1344 list.onAfterRedraw = delegate
1345 {
1346 if (!layer.floatInv)
1347 {
1348 int num = 0;
1349 foreach (UIList.ButtonPair button in list.buttons)
1350 {
1351 if ((button.component as ButtonGrid).card is Thing thing)
1352 {
1353 num += thing.ChildrenAndSelfWeight;
1354 }
1355 }
1356 string text = "";
1357 text = "statsInv2".lang(owner.Container.things.Count.ToString() ?? "", list.ItemCount.ToString() ?? "", Lang._weight(num) + "/" + Lang._weight(owner.Container.WeightLimit));
1358 layer.windows[0].textStats.SetText(text);
1359 }
1360 if (owner.Container.things.IsOverflowing())
1361 {
1362 if (!transOverflow)
1363 {
1364 transOverflow = Util.Instantiate("UI/Element/Other/InvOverflow", window.transform);
1365 }
1366 }
1367 else if ((bool)transOverflow)
1368 {
1369 UnityEngine.Object.Destroy(transOverflow.gameObject);
1370 }
1372 if ((bool)layer.mini)
1373 {
1374 layer.mini.Refresh(layer.mini.window.idTab);
1375 }
1376 if ((bool)uiMagic)
1377 {
1378 uiMagic.OnAfterRedraw();
1379 }
1381 };
1382 callback.mold = (UseGrid ? moldButtonGrid : moldButtonGridless);
1383 if (!UseGrid && !window.saveData.firstSorted)
1384 {
1385 Vector2 sizeDelta = list.Rect().sizeDelta;
1386 foreach (Thing thing3 in owner.Things)
1387 {
1388 if (thing3 != null)
1389 {
1390 thing3.posInvX = EMono.rnd((int)sizeDelta.x - 60) + 30;
1391 thing3.posInvY = EMono.rnd((int)sizeDelta.y - 60) + 30;
1392 }
1393 }
1394 window.saveData.firstSorted = true;
1395 }
1396 list.List();
1397 g.RebuildLayoutTo<Layer>();
1398 list.onAfterRedraw();
1399 if ((bool)list.bgGrid)
1400 {
1401 list.bgGrid.color = style.gridColor;
1402 if (window.saveData.color.a != 0)
1403 {
1404 list.bgGrid.color = window.saveData.color;
1405 }
1406 }
1407 if (owner == InvOwner.Trader && owner.UseGuide)
1408 {
1410 }
1411 }
1412}
AutodumpFlag
Definition: AutodumpFlag.cs:2
CTAG
Definition: CTAG.cs:2
ContainerFlag
Definition: ContainerFlag.cs:5
ContainerSharedType
CurrencyType
Definition: CurrencyType.cs:2
EAction
Definition: EAction.cs:2
FontColor
Definition: FontColor.cs:2
PickerState
Definition: PickerState.cs:2
RectPosition
Definition: RectPosition.cs:2
list. Refresh()
if(item3.idFile==idFirstFile &&item3.id==idFirstTopic)
Definition: UIBook.cs:627
Definition: AIAct.cs:6
void SetTurbo(int mtp=-1)
Definition: AM_Adv.cs:1040
Definition: ACT.cs:62
virtual bool Perform()
Definition: ACT.cs:264
virtual bool LocalAct
Definition: ACT.cs:169
virtual bool IsAct
Definition: ACT.cs:99
static AM_Adv Adv
Definition: ActionMode.cs:15
void SetCard(Card c, Mode mode=Mode.Default, Action< UINote > onWriteNote=null)
Definition: ButtonGrid.cs:184
void SetCardGrid(Card c, InvOwner owner=null)
Definition: ButtonGrid.cs:145
Definition: Card.cs:11
bool isDestroyed
Definition: Card.cs:71
virtual bool isThing
Definition: Card.cs:1957
int posInvY
Definition: Card.cs:334
bool isNPCProperty
Definition: Card.cs:526
int c_equippedSlot
Definition: Card.cs:912
ICardParent GetRoot()
Definition: Card.cs:3164
string c_altName
Definition: Card.cs:1493
virtual int GetPrice(CurrencyType currency=CurrencyType.Money, bool sell=false, PriceType priceType=PriceType.Default, Chara c=null)
Definition: Card.cs:6449
int invY
Definition: Card.cs:1831
string Name
Definition: Card.cs:2013
ICardParent parent
Definition: Card.cs:51
int GetCurrency(string id="money")
Definition: Card.cs:3652
bool HasTag(CTAG tag)
Definition: Card.cs:2455
Trait trait
Definition: Card.cs:49
ThingContainer things
Definition: Card.cs:34
bool IsInstalled
Definition: Card.cs:2241
virtual bool IsPC
Definition: Card.cs:2019
virtual bool isChara
Definition: Card.cs:1959
Card GetRootCard()
Definition: Card.cs:3173
bool TryStackTo(Thing to)
Definition: Card.cs:3144
int Num
Definition: Card.cs:154
SourceCategory.Row category
Definition: Card.cs:1925
int posInvX
Definition: Card.cs:322
void HoldCard(Card t, int num=-1)
Definition: Chara.cs:4084
AIAct SetAI(AIAct g)
Definition: Chara.cs:8045
bool HasNoGoal
Definition: Chara.cs:821
new GameConfig game
Definition: CoreConfig.cs:596
new UISetting ui
Definition: CoreConfig.cs:588
bool enable
Definition: CoreDebug.cs:285
UDInvTab invTab
Definition: CoreRef.cs:132
Sprite personal
Definition: CoreRef.cs:126
Vector2 sizeContainer
Definition: CoreRef.cs:32
List< Sprite > spritesContainerIcon
Definition: CoreRef.cs:363
Icons icons
Definition: CoreRef.cs:339
UDInvStyle invStyle
Definition: CoreRef.cs:371
CoreRef refs
Definition: Core.cs:51
CoreConfig config
Definition: Core.cs:70
Definition: Dialog.cs:7
static Dialog InputName(string langDetail, string text, Action< bool, string > onClose, InputType inputType=InputType.Default)
Definition: Dialog.cs:528
InputType
Definition: Dialog.cs:9
KeyCode key
Definition: EInput.cs:14
Definition: EInput.cs:8
static KeyMapManager keys
Definition: EInput.cs:367
static bool isShiftDown
Definition: EInput.cs:261
static EAction action
Definition: EInput.cs:259
Definition: EMono.cs:4
static Core core
Definition: EMono.cs:5
static Chara pc
Definition: EMono.cs:13
static Player player
Definition: EMono.cs:11
static Zone _zone
Definition: EMono.cs:19
static Game game
Definition: EMono.cs:7
static int rnd(int a)
Definition: EMono.cs:47
static UI ui
Definition: EMono.cs:15
static CoreDebug debug
Definition: EMono.cs:45
static SourceManager sources
Definition: EMono.cs:41
int gridIconSize
Definition: Game.cs:78
bool altInv
Definition: Game.cs:263
Config config
Definition: Game.cs:215
virtual Thing Thing
Definition: HotItem.cs:38
static InvOwner Trader
Definition: InvOwner.cs:524
void Init()
Definition: InvOwner.cs:743
virtual void BuildUICurrency(UICurrency uiCurrency, bool canReroll=false)
Definition: InvOwner.cs:705
Card owner
Definition: InvOwner.cs:538
Card Container
Definition: InvOwner.cs:540
virtual bool UseGuide
Definition: InvOwner.cs:576
Chara Chara
Definition: InvOwner.cs:618
Definition: Lang.cs:6
static string _weight(int a, int b, bool showUnit=true, int unitSize=0)
Definition: Lang.cs:172
static string _currency(object a, string IDCurrency)
Definition: Lang.cs:162
static InvOwner highlightInv
List< UIInventory > invs
static void SetDirty(Thing t)
static void SetDirtyAll(bool immediate=false)
static List< LayerInventory > listInv
static void TryShowGuide(UIList list)
Definition: Layer.cs:9
Definition: Msg.cs:5
static string Say(string idLang, string ref1, string ref2=null, string ref3=null, string ref4=null)
Definition: Msg.cs:58
bool sort_ascending
Definition: Player.cs:39
bool sort_ascending_shop
Definition: Player.cs:41
UIList.SortMode sortInv
Definition: Player.cs:49
UIInventory.InteractMode interactMode
Definition: Player.cs:57
Pref pref
Definition: Player.cs:814
Window.SaveData dataPick
Definition: Player.cs:835
HotItem currentHotItem
Definition: Player.cs:901
Window.SaveData windowDataCopy
Definition: Player.cs:940
bool openContainerCenter
Definition: Player.cs:799
string windowDataName
Definition: Player.cs:942
SourceCategory categories
virtual bool IsRegion
Definition: Spatial.cs:501
int influence
Definition: Spatial.cs:214
static Sprite Get(string id)
Definition: SpriteSheet.cs:28
static void TryPerform()
Definition: TaskDump.cs:6
bool IsFull(int y=0)
Definition: Thing.cs:8
void OnBarter()
Definition: Trait.cs:1463
virtual string IDInvStyle
Definition: Trait.cs:165
virtual int CostRerollShop
Definition: Trait.cs:492
virtual bool IsSpecialContainer
Definition: Trait.cs:237
virtual bool IsFridge
Definition: Trait.cs:121
bool TryGetValue(TKey key, out TValue value)
Definition: UDictionary.cs:178
UIText subText
Definition: UIButton.cs:104
Image icon
Definition: UIButton.cs:110
void ShowTooltipForced(bool ignoreWhenRightClick=true)
Definition: UIButton.cs:387
void SetTooltipLang(string lang=null)
Definition: UIButton.cs:373
static void TryShowTip(Transform root=null, bool highlight=true, bool ignoreWhenRightClick=true)
Definition: UIButton.cs:778
UIContextMenuItem AddToggle(string idLang="", bool isOn=false, UnityAction< bool > action=null)
VerticalLayoutGroup layoutGroup
UIContextMenuItem AddSlider(string text, Func< float, string > textFunc, float value, Action< float > action, float min=0f, float max=1f, bool isInt=false, bool hideOther=true, bool useInput=false)
void AddButton(Func< string > funcText, UnityAction action=null)
GridLayoutGroup AddGridLayout()
UIContextMenu AddChild(string idLang, TextAnchor anchor)
void SetContainer(Card t, Window.SaveData d)
void SetText(string s)
Definition: UIHeader.cs:24
InvOwner owner
Definition: UIInventory.cs:68
SubMode subMode
Definition: UIInventory.cs:72
void RefreshHighlight()
UIButton buttonTakeAll
Definition: UIInventory.cs:123
void RefreshGrid()
bool firstMouseRightDown
Definition: UIInventory.cs:131
void Close()
Definition: UIInventory.cs:305
InvOwner owner
Definition: UIInventory.cs:137
CoreRef.InventoryStyle InvStyle
Definition: UIInventory.cs:163
static void RefreshAllList()
Definition: UIInventory.cs:198
Transform ShowAdvDistribution(UIContextMenu dis, Window.SaveData data)
bool IsMainMode
Definition: UIInventory.cs:166
void Sort(bool redraw=true)
void RefreshDestNum()
Definition: UIInventory.cs:427
ButtonGrid moldButtonGrid
Definition: UIInventory.cs:119
void Update()
Definition: UIInventory.cs:382
void RefreshMenu()
Definition: UIInventory.cs:450
void RefreshWindow()
Definition: UIInventory.cs:270
void SetHeader(string s)
Definition: UIInventory.cs:207
Transaction lastTransaction
Definition: UIInventory.cs:111
bool IsMagicChest
Definition: UIInventory.cs:155
bool IsToolbelt
Definition: UIInventory.cs:157
void RefreshList()
BodySlot bodySlot
Definition: UIInventory.cs:81
Transform transOverflow
Definition: UIInventory.cs:87
AIAct currentAct
Definition: UIInventory.cs:101
LayerInventory layer
Definition: UIInventory.cs:83
Tab AddTab(InvOwner owner, Mode mode=Mode.All)
Definition: UIInventory.cs:217
Image imageHighlightGrid
Definition: UIInventory.cs:115
Image imageHighlight
Definition: UIInventory.cs:113
void DoAct(Act act)
Definition: UIInventory.cs:360
bool DestNumIsMax()
Definition: UIInventory.cs:440
Transform headerRow
Definition: UIInventory.cs:85
Func< Thing, bool > funcList
Definition: UIInventory.cs:91
void OnInit()
Definition: UIInventory.cs:229
List< Tab > tabs
Definition: UIInventory.cs:133
InteractMode interactMode
Definition: UIInventory.cs:103
void SwitchTab(Tab tab)
Definition: UIInventory.cs:313
void CheckDirty()
Definition: UIInventory.cs:410
UIButton moldSmallTab
Definition: UIInventory.cs:117
string idMold
Definition: UIInventory.cs:89
Tab currentTab
Definition: UIInventory.cs:99
ButtonGrid moldButtonGridless
Definition: UIInventory.cs:121
Transform ShowDistribution(UIContextMenu dis, Window.SaveData data)
Definition: UIInventory.cs:942
UIMagicChest uiMagic
Definition: UIInventory.cs:125
Window window
Definition: UIInventory.cs:95
bool IsAdvSort
Definition: UIInventory.cs:161
bool floatMode
Definition: UIInventory.cs:105
Tab AddTab(Card c, Mode mode, Thing container=null)
Definition: UIInventory.cs:212
UIContent content
Definition: UIInventory.cs:97
UIList list
Definition: UIInventory.cs:79
Action< Thing > actionClick
Definition: UIInventory.cs:93
Definition: UIItem.cs:5
UIText text1
Definition: UIItem.cs:6
Definition: UIList.cs:9
List< ButtonPair > buttons
Definition: UIList.cs:244
BGType
Definition: UIList.cs:16
SortMode
Definition: UIList.cs:27
override void Redraw()
Definition: UIList.cs:740
Definition: UINote.cs:6
void Space(int sizeY=0, int sizeX=1)
Definition: UINote.cs:62
Definition: UIText.cs:6
void SetText(string s)
Definition: UIText.cs:159
void Clear()
Definition: WindowMenu.cs:44
UIButton AddButton(string idLang, Action< UIButton > onClick, Sprite sprite=null, string idButton="Default")
Definition: WindowMenu.cs:54
CategoryType category
Definition: Window.cs:303
bool shiftToShowMenu
Definition: Window.cs:487
bool excludeDump
Definition: Window.cs:367
bool sort_ascending
Definition: Window.cs:475
RectPosition customAnchor
Definition: Window.cs:291
bool excludeCraft
Definition: Window.cs:379
string filter
Definition: Window.cs:122
bool noRightClickClose
Definition: Window.cs:391
bool compress
Definition: Window.cs:415
bool noRotten
Definition: Window.cs:439
bool fixedPos
Definition: Window.cs:403
bool onlyRottable
Definition: Window.cs:451
bool advDistribution
Definition: Window.cs:427
bool alwaysSort
Definition: Window.cs:463
Color32 color
Definition: Window.cs:231
Definition: Window.cs:13
SaveData saveData
Definition: Window.cs:724
static Dictionary< string, SaveData > dictData
Definition: Window.cs:594
Definition: Zone.cs:12
bool IsPCFaction
Definition: Zone.cs:464