예제 #1
0
        void EditShowNPCFlagButton_Click(object sender, EventArgs e)
        {
            CreatureEdit.NPCFlags npc_flags = new CreatureEdit.NPCFlags(Convert.ToInt32(EditBox_npcflag.Text));

            if (npc_flags.ShowDialog() == DialogResult.OK)
            {
                EditBox_npcflag.Text = npc_flags.ToString();
            }
        }
예제 #2
0
        void LocationNPCFlagsButton_Click(object sender, EventArgs e)
        {
            if (LocationDataGrid.SelectedCells.Count == 0)
            {
                MessageBox.Show("Error: Row is not selected!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else
            {
                int current_flags = 0;

                if (LocationDataGrid.Rows[LocationDataGrid.CurrentCell.RowIndex].Cells[17].Value != null)
                {
                    current_flags = Convert.ToInt32(LocationDataGrid.Rows[LocationDataGrid.CurrentCell.RowIndex].Cells[17].Value.ToString());
                }

                CreatureEdit.NPCFlags npc_flags = new CreatureEdit.NPCFlags(current_flags);

                if (npc_flags.ShowDialog() == DialogResult.OK)
                {
                    LocationDataGrid.Rows[LocationDataGrid.CurrentCell.RowIndex].Cells[17].Value = npc_flags.ToString();
                }
            }
        }