private void InitInventory(UnitWrapper2 unit, ItemPanel itemPanel) { itemPanel.Controls.Clear(); try { CharacterInventoryType inv = unit.CharacterWrapper.CharacterInventory.GetInventoryById((int)INVENTORYTYPE); if (inv == null) { return; } foreach (CharacterItems item in inv.Items) { //Unit.StatBlock.Stat atat = item.Stats.GetStatById((int)ItemValueNames.applied_affix); itemPanel.IsMale = _isMale; InventoryItem iItem = new InventoryItem(item); iItem.InitButton(_displayNamesAndQuantity); itemPanel.AddItem(iItem, true); } } catch (Exception ex) { MessageBox.Show(ex.Message, "InitInventory: " + unit.Name); } }
//// todo: rewrite public CharacterShop(TableDataSet dataSet, TableFiles tableFiles) //{ // InitializeComponent(); // this.Text += " - Location: " + InventoryType; // _itemHelpFunctions = new UnitHelpFunctions(dataSet); // _characterFolder = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\My Games\\Hellgate\\Save\\Singleplayer"; // _tableFiles = tableFiles; // _dataSet = dataSet; // string[] characters = LoadCharacterNames(); // cb_selectCharacter.DataSource = characters; // _characterItemPanel = new ItemPanel(false, null, null); // _characterItemPanel.NewItemSelected_Event += _characterItemPanel_NewItemSelected_Event; // _characterItemPanel.ItemUnitSize = ItemUnitSize; // _characterItemPanel.Size = new Size(InventoryWidth * ItemUnitSize, InventoryHeight * ItemUnitSize); // _characterItemPanel.Location = new Point(16, 18); // SetCharacterStatus(CharacterStatus, CharacterStatus.NotLoaded, p_status, l_status); // // use inventory panels, as a normal groupBox doesn't provide the option "AutoScroll" // p_inventory.Controls.Add(_characterItemPanel); //} void _characterItemPanel_NewItemSelected_Event(ItemPanel sender, InventoryItem item) { _selectedItem = item; l_selectedItem.Text = item.Item.Name; if (item.Item.StackSize > 1) { l_selectedItem.Text += " (x" + item.Item.StackSize + ")"; } l_selectedItem.Tag = item; }
private void _characterItemPanel_NewItemSelected_Event(ItemPanel sender, InventoryItem item) { _eventSender = sender; l_selectedItem.Text = item.Item.Name; if (item.Item.StackSize > 1) { l_selectedItem.Text += " (x" + item.Item.StackSize.ToString() + ")"; } l_selectedItem.Tag = item; }
private void InitInventory(UnitObject unit, ItemPanel itemPanel) { itemPanel.Controls.Clear(); try { foreach (UnitObject item in unit.Items) { if (item.InventoryLocationIndex == (int)InventoryType) { //InventoryItem iItem = new InventoryItem(item); //iItem.InitButton(false); //itemPanel.AddItem(iItem, true); } } } catch (Exception ex) { MessageBox.Show(ex.Message, "InitInventory: " + unit.Name); } }
private void _characterItemPanel_NewItemSelected_Event(ItemPanel sender, InventoryItem item) { _eventSender = sender; l_selectedItem.Text = item.Item.Name; if (item.Item.StackSize > 1) { l_selectedItem.Text += " (x" + item.Item.StackSize.ToString() + ")"; } l_selectedItem.Tag = item; }
private void InitInventory(UnitWrapper2 unit, ItemPanel itemPanel) { itemPanel.Controls.Clear(); try { CharacterInventoryType inv = unit.CharacterWrapper.CharacterInventory.GetInventoryById((int)INVENTORYTYPE); if (inv == null) return; foreach (CharacterItems item in inv.Items) { //Unit.StatBlock.Stat atat = item.Stats.GetStatById((int)ItemValueNames.applied_affix); itemPanel.IsMale = _isMale; InventoryItem iItem = new InventoryItem(item); iItem.InitButton(_displayNamesAndQuantity); itemPanel.AddItem(iItem, true); } } catch (Exception ex) { MessageBox.Show(ex.Message, "InitInventory: " + unit.Name); } }
//_debug = true; #endif #region Constructors public ItemTransferForm(FileManager fileManager) { InitializeComponent(); this.fileManager = fileManager; _previewManager = new PreviewManager(fileManager); //if (File.Exists(Path.Combine(Directory.GetCurrentDirectory(), "trading.xml"))) //{ // ItemTradingOptions options = XmlUtilities<ItemTradingOptions>.Deserialize("trading.xml"); // INVENTORYTYPE = options.InventoryToUse; // INVENTORYHEIGHT = options.InventoryHeight; // _enableItemPreview = options.EnableItemPreview; // _enablePalladiumTrading = options.EnablePalladiumTrading; // _backupCharacters = options.BackupCharacters; // _displayItemIcons = options.DisplayItemIcons; // _displayNamesAndQuantity = options.DisplayNamesAndQuantity; // _debug = options.Debug; //} //ItemTradingOptions options2 = new ItemTradingOptions(); //options2.EnableItemPreview = true; //options2.EnablePalladiumTrading = true; //options2.BackupCharacters = true; //options2.InventoryHeight = 6; //options2.InventoryToUse = InventoryTypes.Inventory; //XmlUtilities<ItemTradingOptions>.Serialize(options2, "trading2.xml"); this.Text += " - Location: " + INVENTORYTYPE.ToString(); _characterItemPanel1 = new ItemPanel(_displayItemIcons, _previewManager, fileManager); _characterItemPanel2 = new ItemPanel(_displayItemIcons, _previewManager, fileManager); _characterItemPanel1.NewItemSelected_Event += new ItemPanel.NewItemSelected(_characterItemPanel_NewItemSelected_Event); _characterItemPanel2.NewItemSelected_Event += new ItemPanel.NewItemSelected(_characterItemPanel_NewItemSelected_Event); _characterItemPanel1.ItemUnitSize = ITEMUNITSIZE; _characterItemPanel2.ItemUnitSize = ITEMUNITSIZE; SetPanelSize(); _characterItemPanel1.Location = new Point(16, 18); _characterItemPanel2.Location = new Point(16, 18); SetCharacterStatus(_characterStatus1, CharacterStatus.NotLoaded, p_status1, l_status1); SetCharacterStatus(_characterStatus2, CharacterStatus.NotLoaded, p_status2, l_status2); // use inventory panels, as a normal groupBox doesn't provide the option "AutoScroll" p_inventory1.Controls.Add(_characterItemPanel1); p_inventory2.Controls.Add(_characterItemPanel2); EnableComboBoxes(true, true); if (_debug) { InitDebugControls(); } ts_debugControl.Enabled = _debug; ts_debugControl.Visible = _debug; cb_isMale.Visible = _debug; EnableTradingControls(false); _characterFolder = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "My Games\\Hellgate\\Save\\Singleplayer"); //adding the character names triggers the cb_selectCharacter1_SelectedIndexChanged event which will load the first character string[] characters = LoadCharacterNames(); cb_selectCharacter1.DataSource = characters; cb_selectCharacter2.DataSource = characters.Clone(); }
public ItemTransferForm(FileManager fileManager) { InitializeComponent(); this.fileManager = fileManager; _previewManager = new PreviewManager(fileManager); //if (File.Exists(Path.Combine(Directory.GetCurrentDirectory(), "trading.xml"))) //{ // ItemTradingOptions options = XmlUtilities<ItemTradingOptions>.Deserialize("trading.xml"); // INVENTORYTYPE = options.InventoryToUse; // INVENTORYHEIGHT = options.InventoryHeight; // _enableItemPreview = options.EnableItemPreview; // _enablePalladiumTrading = options.EnablePalladiumTrading; // _backupCharacters = options.BackupCharacters; // _displayItemIcons = options.DisplayItemIcons; // _displayNamesAndQuantity = options.DisplayNamesAndQuantity; // _debug = options.Debug; //} //ItemTradingOptions options2 = new ItemTradingOptions(); //options2.EnableItemPreview = true; //options2.EnablePalladiumTrading = true; //options2.BackupCharacters = true; //options2.InventoryHeight = 6; //options2.InventoryToUse = InventoryTypes.Inventory; //XmlUtilities<ItemTradingOptions>.Serialize(options2, "trading2.xml"); this.Text += " - Location: " + INVENTORYTYPE.ToString(); _characterItemPanel1 = new ItemPanel(_displayItemIcons, _previewManager, fileManager); _characterItemPanel2 = new ItemPanel(_displayItemIcons, _previewManager, fileManager); _characterItemPanel1.NewItemSelected_Event += new ItemPanel.NewItemSelected(_characterItemPanel_NewItemSelected_Event); _characterItemPanel2.NewItemSelected_Event += new ItemPanel.NewItemSelected(_characterItemPanel_NewItemSelected_Event); _characterItemPanel1.ItemUnitSize = ITEMUNITSIZE; _characterItemPanel2.ItemUnitSize = ITEMUNITSIZE; SetPanelSize(); _characterItemPanel1.Location = new Point(16, 18); _characterItemPanel2.Location = new Point(16, 18); SetCharacterStatus(_characterStatus1, CharacterStatus.NotLoaded, p_status1, l_status1); SetCharacterStatus(_characterStatus2, CharacterStatus.NotLoaded, p_status2, l_status2); // use inventory panels, as a normal groupBox doesn't provide the option "AutoScroll" p_inventory1.Controls.Add(_characterItemPanel1); p_inventory2.Controls.Add(_characterItemPanel2); EnableComboBoxes(true, true); if (_debug) { InitDebugControls(); } ts_debugControl.Enabled = _debug; ts_debugControl.Visible = _debug; cb_isMale.Visible = _debug; EnableTradingControls(false); _characterFolder = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "My Games\\Hellgate\\Save\\Singleplayer"); //adding the character names triggers the cb_selectCharacter1_SelectedIndexChanged event which will load the first character string[] characters = LoadCharacterNames(); cb_selectCharacter1.DataSource = characters; cb_selectCharacter2.DataSource = characters.Clone(); }