Beispiel #1
0
        private void buttonCreate_Click(object sender, EventArgs e)
        {
            string errorString;

            if (!AreFieldsValid(out errorString))
            {
                this.logger.Error(errorString);
                return;
            }

            var npc = new NpcData();

            npc.Id = NpcData.GenerateId(int.Parse(labelNpcId.Text));

            if (this.StoreNpc(npc))
            {
                var node = this.treeViewNpcs.Nodes[this.comboBoxNpcZone.SelectedIndex].Nodes[(int)this.comboBoxNpcType.SelectedIndex].Nodes.Add(npc.Guid.ToString(), npc.Name);
                this.logger.LogFormat("New Npc Created. Id = {0} Name = {1} ", npc.Guid, npc.Name);
                this.ResetFields();
            }
        }