10 public override WidgetCodex.SearchType type
19 public override void OnActivate()
22 WidgetSearch.Instance =
this;
23 WidgetSearch.selected =
null;
28 public override bool CheckClose()
30 return Input.GetKey(KeyCode.LeftControl) && Input.GetKeyDown(KeyCode.F);
34 public override void Search(
string s)
37 this.buttonClear.SetActive(this.field.text !=
"");
38 if (s == this.lastSearch)
42 HashSet<Card> newCards =
new HashSet<Card>();
45 if (
EMono._zone.IsTown ||
EMono._zone.IsPCFaction)
49 if (chara.IsNeutralOrAbove() && (chara.Name.Contains(s) || chara.sourceCard.GetSearchName(
false).Contains(s)))
55 if (
EMono._zone.IsPCFaction)
59 if (thing.Name.Contains(s) || thing.sourceCard.GetSearchName(
false).Contains(s))
64 foreach (
Card card
in EMono._map.props.stocked.all.Values)
66 if (card.parent is
Thing && (card.parent as
Thing).c_lockLv <= 0 && (card.Name.Contains(s) || card.sourceCard.GetSearchName(
false).Contains(s)))
73 for (
int i = 0; i < 2; i++)
77 if ((i != 0 || chara2 !=
EMono.pc) && (i != 1 || chara2 ==
EMono.pc) && chara2.IsPCFactionOrMinion)
81 if ((action = <>9__0) ==
null)
83 action = (<>9__0 = delegate(
Thing t)
90 if (t.Name.Contains(s) || t.source.GetSearchName(
false).Contains(s))
96 things.Foreach(action,
true);
101 if (!newCards.SetEquals(
this.cards))
103 this.cards = newCards;
106 this.cgResult.alpha = ((this.list.ItemCount > 0) ? 1f : 0f);
111 public override void RefreshList()
114 WidgetSearch.selected =
null;
115 BaseList list = this.list;
119 Card rootCard = a.GetRootCard();
120 if (rootCard ==
EMono.pc)
123 WidgetSearch.selected = a;
127 if (!
EMono.pc.ai.IsNoGoal)
132 if (a.isDestroyed || !rootCard.pos.IsValid)
135 this.Search(this.field.text);
139 WidgetSearch.selected =
null;
140 EMono.pc.SetAIImmediate(
new AI_Goto(rootCard.pos.Copy(), 0,
false,
false));
148 callback.onList = delegate(UIList.SortMode m)
150 foreach (
Card o
in this.cards)
155 list.callbacks = callback;
157 this.list.dsv.OnResize();
161 public override void OnDeactivate()
171 public HashSet<Card> cards =
new HashSet<Card>();
174 public static Card selected;
177 public CanvasGroup cgResult;