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