12 public virtual WidgetCodex.SearchType type
21 public override void OnActivate()
23 this.field.onValueChanged.AddListener(
new UnityAction<string>(this.Search));
24 this.field.onSubmit.AddListener(
new UnityAction<string>(this.Search));
25 this.lastSearch =
null;
27 if (
EMono._zone.isStarted)
40 public virtual void Search(
string s)
43 this.buttonClear.SetActive(this.field.text !=
"");
44 if (s == this.lastSearch)
49 HashSet<Recipe> hashSet =
new HashSet<Recipe>();
52 using (List<RecipeSource>.Enumerator enumerator =
RecipeManager.list.GetEnumerator())
54 while (enumerator.MoveNext())
57 if (!recipeSource.isChara && !recipeSource.noListing && !recipeSource.isBridgePillar && (recipeSource.row.GetSearchName(
false).Contains(s) || recipeSource.row.GetSearchName(
true).Contains(s)) && (
EMono.player.recipes.knownRecipes.ContainsKey(recipeSource.id) || recipeSource.alwaysKnown))
59 hashSet.Add(
Recipe.Create(recipeSource, -1,
null));
67 if (!recipeSource2.isChara && !recipeSource2.noListing && !recipeSource2.isBridgePillar && (
EMono.player.recipes.knownRecipes.ContainsKey(recipeSource2.id) || recipeSource2.alwaysKnown))
69 hashSet.Add(
Recipe.Create(recipeSource2, -1,
null));
73 if (!hashSet.SetEquals(
this.recipes))
75 this.recipes = hashSet;
82 public virtual void RefreshList()
84 BaseList baseList = this.list;
91 b.SetCraftRecipe(a,
ButtonGrid.Mode.RecipeGrid,
true);
93 callback.onList = delegate(UIList.SortMode m)
95 foreach (
Recipe o
in this.recipes)
100 baseList.callbacks = callback;
102 this.list.dsv.OnResize();
106 private void Update()
109 if (Input.GetKeyDown(KeyCode.Escape))
112 EInput.Consume(
false, 5);
115 int functionkeyDown = EInput.GetFunctionkeyDown();
116 if (this.count > 10 && functionkeyDown != -1)
122 if (hotItemWidget !=
null && hotItemWidget.id == base.ID)
125 EInput.Consume(
false, 5);
130 if (this.CheckClose())
133 EInput.Consume(
false, 1);
138 public virtual bool CheckClose()
144 public InputField field;
150 public UIDynamicList list;
153 public HashSet<Recipe> recipes =
new HashSet<Recipe>();
156 public string lastSearch;
159 public UIButton buttonClear;
162 public Transform transResult;
168 public enum SearchType