private void invertCheckOrSelectAll(ItemChoices ic) { foreach (ListViewItem item in gameListView.Items) { switch (ic) { case ItemChoices.CHECKED: item.Checked = !item.Checked; break; case ItemChoices.SELECTED: item.Selected = !item.Selected; break; } } }
///// CHECK ITEMS ///// private void checkOrSelectAll(ItemChoices checkOrSelect, bool checkOrSelectItems) { foreach (ListViewItem item in gameListView.Items) { switch (checkOrSelect) { case ItemChoices.CHECKED: item.Checked = checkOrSelectItems; break; case ItemChoices.SELECTED: item.Selected = checkOrSelectItems; break; } } }
///// REMOVE ITEMS ///// private void removeItems(ItemChoices i) { DialogResult result = DialogResult.No; if (i == ItemChoices.CHECKED && CountCheckedItems() > 0) { result = MessageBox.Show("Are you sure you want to remove " + Utilities.Plural(CountCheckedItems(), "this item", "these items") + "?\n(Once you save the configuration, " + Utilities.Plural(CountCheckedItems(), "this item", "these items") + " will be lost.", "Remove?", MessageBoxButtons.YesNo); } if (i == ItemChoices.SELECTED && CountSelectedItems() > 0) { result = MessageBox.Show("Are you sure you want to remove " + Utilities.Plural(CountSelectedItems(), "this item", "these items") + "?\n(Once you save the configuration, " + Utilities.Plural(CountSelectedItems(), "this item", "these items") + " will be lost.", "Remove?", MessageBoxButtons.YesNo); } if (result == DialogResult.Yes) { foreach (ListViewItem item in gameListView.Items) { switch (i) { case ItemChoices.CHECKED: if (item.Checked) { gameListView.Items.Remove(item); } break; case ItemChoices.SELECTED: if (item.Selected) { gameListView.Items.Remove(item); } break; } } } }
public void HandleItemChoice(ItemChoices itemChoice, int itemSlotId) { switch (itemChoice) { case ItemChoices.Stick: StickSticker( (Script_Sticker)inventory.GetItemInSlot(itemSlotId), equipment, inventory, itemSlotId ); break; case ItemChoices.Examine: Examine( (Script_Collectible)items.GetItemInSlot(itemSlotId) ); break; case ItemChoices.Drop: Drop(items.GetItemInSlot(itemSlotId), itemSlotId); break; case ItemChoices.Use: Use( (Script_Usable)items.GetItemInSlot(itemSlotId), itemSlotId ); /// DON'T EnterInventory() here in case we need to exit on successful use /// CutScene will exit for us break; /// Cancel handled here, Submenu Input Controller uses this default: HideItemChoices(); EnterInventory(); print("DEFAULT CASE"); break; } }