// Start is called before the first frame update void Start() { RAMOffset.text = MapAddress; RAMOffset.onValueChanged.AddListener(delegate { MapAddress = RAMOffset.text; }); ButtonLabel.text = $"Remove every {currentRemovalItem.ToString().ToLower()}"; RemoveItemMode.ClearOptions(); string[] riChoices = Enum.GetNames(typeof(RemovalItem)); foreach (string ri in riChoices) { Dropdown.OptionData newVal = new Dropdown.OptionData(); newVal.text = ri; RemoveItemMode.options.Add(newVal); } RemoveItemMode.onValueChanged.AddListener(delegate { currentRemovalItem = (RemovalItem)RemoveItemMode.value; ButtonLabel.text = $"Remove every {currentRemovalItem.ToString().ToLower()}"; }); RemoveItemMode.value = 0; RemoveItemMode.RefreshShownValue(); }
private bool DeleteType(Item i, RemovalItem toRemove) { ushort toSearch = i.ItemId; if (i.ItemId == Item.EXTENSION) { toSearch = i.ExtensionItemId; } var removable = toSearch.GetRemovalItemType(); if (removable.HasValue) { if (removable.Value == toRemove) { i.Delete(); return(true); } } return(false); }