private void lbItems_SelectionChanged(object sender, SelectionChangedEventArgs e) { CCBStoreItem selItem = GetCurrentItem(); if (null != selItem) { SetTextboxInt(tbCost, selItem.Cost); if (-1 == selItem.Count) { labelLimit.Visibility = Visibility.Hidden; tbLimit.Visibility = Visibility.Hidden; } else { labelLimit.Visibility = Visibility.Visible; tbLimit.Visibility = Visibility.Visible; SetTextboxInt(tbLimit, selItem.Count); } btnDeleteItem.IsEnabled = true; } else { btnDeleteItem.IsEnabled = false; } }
private void AddItemsToStore(CCBStore store, CCBStorePlaceType place, Random rnd) { foreach (CCBPotentialStoreItem maybeItem in place.StoreItems.Items) { if (maybeItem.IncludeInStore(rnd)) { CCBStoreItem newItem = new CCBStoreItem(maybeItem.Item); newItem.Cost = maybeItem.GetCost(rnd); newItem.Count = maybeItem.GetLimit(rnd); if (0 == newItem.Count) { store.Add(new CCBStoreItemOmitted(maybeItem.Item, "Limited")); } else { store.Add(newItem); } } else { store.Add(new CCBStoreItemOmitted(maybeItem.Item, "Chance")); } } }
private void btnDeleteItem_Click(object sender, RoutedEventArgs e) { CCBStoreItem item = GetCurrentItem(); if (null != item) { int ixCur = lbItems.SelectedIndex; m_store.RemoveItem(item); lbItems.Items.RemoveAt(ixCur); SelectListboxItem(lbItems, ixCur); } }
private void Save() { CCBStoreItem item = GetCurrentItem(); if (null != item) { item.Cost = IntFromTextbox(tbCost); if (tbLimit.IsVisible) { item.Count = IntFromTextbox(tbLimit); } } }
public StoreItemViewer(CCBBagItem bagItem) { m_item = (CCBStoreItem)bagItem; }
public StoreItemViewer(CCBStoreItem storeItem) { m_item = storeItem; }
private void AddStoreItem(CCBStoreItem storeItem) { lbItems.Items.Add(storeItem); }