private bool CheckManualItem(object sender, EventArgs e) { var CheckedObject = ManualSelect[0]; LogicObjects.LogicEntry SelectedItem = new LogicObjects.LogicEntry { ID = -1 }; if (sender == LBItemSelect) { if (!(LBItemSelect.SelectedItem is LogicObjects.LogicEntry)) { return(false); } SelectedItem = LBItemSelect.SelectedItem as LogicObjects.LogicEntry; } CheckedObject.Checked = true; if (LogicObjects.MainTrackerInstance.Options.IsMultiWorld) { CheckedObject.PlayerData.ItemBelongedToPlayer = (int)numericUpDown1.Value; } if (SelectedItem.ID < 0) { CheckedObject.RandomizedItem = -1; return(true); } CheckedObject.RandomizedItem = SelectedItem.ID; if (!LogicObjects.MainTrackerInstance.Options.IsMultiWorld || CheckedObject.ItemBelongsToMe()) { Instance.Logic[SelectedItem.ID].Aquired = true; } LogicEditing.CheckEntrancePair(CheckedObject, Instance, true); return(true); }
//Automatic Checks public bool CheckAutoSelectItems() { bool ItemStateChanged = false; foreach (var CheckedObject in AutoSelect) { //Check if the items checked status has been changed, most likely by CheckEntrancePair. if (ActionDic.ContainsKey(CheckedObject.ID) && ActionDic[CheckedObject.ID] != CheckedObject.Checked && CheckedObject.IsEntrance()) { continue; } if (CheckedObject.ID < -1) { continue; } if (CheckedObject.Checked && CheckedObject.RandomizedItem > -2) { if (Instance.ItemInRange(CheckedObject.RandomizedItem) && !Tools.SameItemMultipleChecks(CheckedObject.RandomizedItem, Instance) && CheckedObject.ItemBelongsToMe()) { Instance.Logic[CheckedObject.RandomizedItem].Aquired = false; LogicEditing.CheckEntrancePair(CheckedObject, Instance, false); } CheckedObject.Checked = false; if (!KeepChecked) { CheckedObject.RandomizedItem = -2; } ItemStateChanged = true; continue; } if (CheckedObject.SpoilerRandom > -2 || CheckedObject.RandomizedItem > -2 || CheckedObject.RandomizedState() == 2) { CheckedObject.Checked = true; if (CheckedObject.RandomizedState() == 2) { CheckedObject.RandomizedItem = CheckedObject.ID; } if (CheckedObject.SpoilerRandom > -2) { CheckedObject.RandomizedItem = CheckedObject.SpoilerRandom; } if (CheckedObject.RandomizedItem < 0) { CheckedObject.RandomizedItem = -1; ItemStateChanged = true; continue; } if (CheckedObject.ItemBelongsToMe()) { Instance.Logic[CheckedObject.RandomizedItem].Aquired = true; } Instance.Logic[CheckedObject.RandomizedItem].PlayerData.ItemCameFromPlayer = FromNetPlayer; LogicEditing.CheckEntrancePair(CheckedObject, Instance, true); ItemStateChanged = true; continue; } } return(ItemStateChanged); }