private void map_Changed(object sender, FileSystemEventArgs e) { if (!cvFormClosing) { string[] files = Directory.GetFiles(Global.MapFolder, "*.*"); if (files.Length < 1) { tabPageMap.Controls.Clear(); } if (Path.GetExtension(files[0]) != ".tmp" && Path.GetExtension(files[0]) != ".ini") { Invoke((MethodInvoker) delegate() { while (IsFileLocked(files[0])) { Thread.Sleep(1000); } using (FileStream stream = new FileStream(files[0], FileMode.Open, FileAccess.Read)) { this.cvMap.MapImageFile = Image.FromStream(stream); ChatboxMessages.MapAvailable(); } this.cvMap.Refresh(); }); } } }
private void btnSell_Click(object sender, EventArgs e) { try { ItemSellRequest sellReq = new ItemSellRequest(_sellSelectedItemName, _sellSelectedItemCost, Player.Name, _sellSelectedID, _sellItemType); ChatboxMessages.PlayerRequestSell(Player.Name, _sellSelectedItemName); } catch (Exception) { throw; } }
private void btnBuy_Click(object sender, EventArgs e) { try { ItemBuyRequest buyReq = new ItemBuyRequest(_buySelectedItemName, _buySelectedItemCost, Player.Name, _buyItemType); ChatboxMessages.PlayerRequestPurchase(Player.Name, _buySelectedItemName); } catch (Exception) { throw; } }
private void btnConfirm_Click(object sender, EventArgs e) { if (chkSuccess.Checked) { switch (ddlDamageType.Text) { case "Bash": CharacterUpdate.Damage(Convert.ToInt32(numDamage.Value), Global.DamageType.Bash, cvXmlFile); break; case "Lethal": CharacterUpdate.Damage(Convert.ToInt32(numDamage.Value), Global.DamageType.Lethal, cvXmlFile); break; case "Aggravated": CharacterUpdate.Damage(Convert.ToInt32(numDamage.Value), Global.DamageType.Aggravated, cvXmlFile); break; default: break; } } if (lstWeapons.SelectedItem != null) { ChatboxMessages.CombatDamageWeapon(lstActors.SelectedValue.ToString(), lblEffectedActor.Text, lstWeapons.SelectedItem.ToString(), chkSuccess.Checked, Convert.ToInt32(numDamage.Value)); } else if (lstAbilities.SelectedItem != null) { ChatboxMessages.CombatDamageAbility(lstActors.SelectedValue.ToString(), lblEffectedActor.Text, lstAbilities.SelectedItem.ToString(), chkSuccess.Checked, Convert.ToInt32(numDamage.Value)); } else { ChatboxMessages.CombatDamageGeneral(lstActors.SelectedValue.ToString(), lblEffectedActor.Text, chkSuccess.Checked, Convert.ToInt32(numDamage.Value)); } this.Parent.Hide(); }