示例#1
0
        private void btnFindValue2_Click(object sender, EventArgs e)
        {
            switch (_type)
            {
            case ObjTemplate.ObjectType.switch_trigger:
            {
                SelectRoom dlg = new SelectRoom(_area);
                if (dlg.ShowDialog() == DialogResult.OK)
                {
                    txtValue2.Text = dlg.GetIndexNumberString();
                }
            }
                return;

            case ObjTemplate.ObjectType.container:
            case ObjTemplate.ObjectType.quiver:
            {
                int value = 0;
                Int32.TryParse(txtValue1.Text, out value);
                FlagEditor dlg = new FlagEditor(BitvectorFlagType.ContainerFlags, value, 0);
                dlg.ShowDialog();
                if (dlg.DialogResult == DialogResult.OK)
                {
                    txtValue2.Text = dlg.Value.ToString();
                }
            }
                return;

            default:
                return;
            }
        }
示例#2
0
        private void btnFindValue3_Click(object sender, EventArgs e)
        {
            switch ((String)cbCommand.SelectedItem)
            {
            case "F":
            case "G":
            case "M":
            case "O":
            case "R":     // Room Number
            {
                SelectRoom dlg = new SelectRoom(_area);
                dlg.ShowDialog();
                if (dlg.DialogResult == DialogResult.OK)
                {
                    txtArg3.Text = dlg.GetIndexNumberString();
                }
            }
            break;

            case "E":     // Equipment Slot
            {
                SelectEquipmentSlot dlg = new SelectEquipmentSlot();
                dlg.ShowDialog();
                if (dlg.DialogResult == DialogResult.OK)
                {
                    txtArg3.Text = dlg.GetNumber().ToString();
                }
            }
            break;

            case "P":     // Object Number
            {
                SelectObject dlg = new SelectObject(_area);
                dlg.ShowDialog();
                if (dlg.DialogResult == DialogResult.OK)
                {
                    txtArg3.Text = dlg.GetIndexNumberString();
                }
            }
            break;

            case "D":     // Door State
            {
                FlagEditor   dlg    = new FlagEditor(BitvectorFlagType.ExitFlags, 0, 0);
                DialogResult result = dlg.ShowDialog();
                if (result == DialogResult.OK)
                {
                    dlg.Text = dlg.Value.ToString();
                }
            }
            break;

            default:
                return;
            }
        }
示例#3
0
        private void btnEditFlags_Click(object sender, EventArgs e)
        {
            int          value  = 0;
            bool         parsed = Int32.TryParse(txtAreaFlags.Text, out value);
            FlagEditor   editor = new FlagEditor(BitvectorFlagType.AreaFlags, value, 0);
            DialogResult result = editor.ShowDialog();

            if (result == DialogResult.OK)
            {
                txtAreaFlags.Text = editor.Value.ToString();
            }
        }
示例#4
0
        private void btnEditFlags2_Click(object sender, EventArgs e)
        {
            if (roomList.SelectedIndex == -1)
            {
                MessageBox.Show("You can't edit room flags without first selecting or creating a room.");
                return;
            }
            int          value  = 0;
            bool         parsed = Int32.TryParse(txtFlags2.Text, out value);
            FlagEditor   editor = new FlagEditor(BitvectorFlagType.RoomFlags, value, 1);
            DialogResult result = editor.ShowDialog();

            if (result == DialogResult.OK)
            {
                txtFlags2.Text = editor.Value.ToString();
            }
        }
示例#5
0
 private void btnEditFlags2_Click( object sender, EventArgs e )
 {
     if( roomList.SelectedIndex == -1 )
     {
         MessageBox.Show( "You can't edit room flags without first selecting or creating a room." );
         return;
     }
     int value = 0;
     bool parsed = Int32.TryParse( txtFlags2.Text, out value );
     FlagEditor editor = new FlagEditor( BitvectorFlagType.RoomFlags, value, 1 );
     DialogResult result = editor.ShowDialog();
     if( result == DialogResult.OK )
     {
         txtFlags2.Text = editor.Value.ToString();
     }
 }
示例#6
0
 private void btnEditAffectFlags5_Click(object sender, EventArgs e)
 {
     int value = 0;
     bool parsed = Int32.TryParse(txtAffectFlags5.Text, out value);
     FlagEditor editor = new FlagEditor(BitvectorFlagType.AffectFlags, value, 4);
     DialogResult result = editor.ShowDialog();
     if (result == DialogResult.OK)
     {
         txtAffectFlags5.Text = editor.Value.ToString();
     }
 }
示例#7
0
 private void btnFindValue3_Click(object sender, EventArgs e)
 {
     switch ((String)cbCommand.SelectedItem)
     {
         case "F":
         case "G":
         case "M":
         case "O":
         case "R": // Room Number
             {
                 SelectRoom dlg = new SelectRoom(_area);
                 dlg.ShowDialog();
                 if (dlg.DialogResult == DialogResult.OK)
                 {
                     txtArg3.Text = dlg.GetIndexNumberString();
                 }
             }
             break;
         case "E": // Equipment Slot
             {
                 SelectEquipmentSlot dlg = new SelectEquipmentSlot();
                 dlg.ShowDialog();
                 if (dlg.DialogResult == DialogResult.OK)
                 {
                     txtArg3.Text = dlg.GetNumber().ToString();
                 }
             }
             break;
         case "P": // Object Number
             {
                 SelectObject dlg = new SelectObject(_area);
                 dlg.ShowDialog();
                 if (dlg.DialogResult == DialogResult.OK)
                 {
                     txtArg3.Text = dlg.GetIndexNumberString();
                 }
             }
             break;
         case "D": // Door State
             {
                 FlagEditor dlg = new FlagEditor(BitvectorFlagType.ExitFlags, 0, 0);
                 DialogResult result = dlg.ShowDialog();
                 if (result == DialogResult.OK)
                 {
                     dlg.Text = dlg.Value.ToString();
                 }
             }
             break;
         default:
             return;
     }
 }
示例#8
0
        private void btnFindValue1_Click(object sender, EventArgs e)
        {
            switch (_type)
            {
            case ObjTemplate.ObjectType.weapon:
            {
                SelectWeaponType dlg = new SelectWeaponType();
                dlg.ShowDialog();
                if (dlg.DialogResult == DialogResult.OK)
                {
                    txtValue1.Text = dlg.GetNumber().ToString();
                }
            }
                return;

            case ObjTemplate.ObjectType.totem:
            {
                int value = 0;
                Int32.TryParse(txtValue1.Text, out value);
                FlagEditor dlg = new FlagEditor(BitvectorFlagType.TotemFlags, value, 0);
                dlg.ShowDialog();
                if (dlg.DialogResult == DialogResult.OK)
                {
                    txtValue1.Text = dlg.Value.ToString();
                }
            }
                return;

            case ObjTemplate.ObjectType.teleport:
            {
                SelectRoom dlg = new SelectRoom(_area);
                if (dlg.ShowDialog() == DialogResult.OK)
                {
                    txtValue1.Text = dlg.GetIndexNumberString();
                }
            }
                return;

            case ObjTemplate.ObjectType.note:
            {
                SelectLanguage dlg = new SelectLanguage();
                if (dlg.ShowDialog() == DialogResult.OK)
                {
                    txtValue1.Text = ((int)dlg.GetLanguage()).ToString();
                }
            }
                return;

            case ObjTemplate.ObjectType.instrument:
            {
                SelectInstrumentType dlg = new SelectInstrumentType();
                if (dlg.ShowDialog() == DialogResult.OK)
                {
                    txtValue1.Text = dlg.GetInstrumentType().ToString();
                }
            }
                return;

            default:
                return;
            }
        }
示例#9
0
 private void btnFindValue1_Click(object sender, EventArgs e)
 {
     switch (_type)
     {
         case ObjTemplate.ObjectType.weapon:
             {
                 SelectWeaponType dlg = new SelectWeaponType();
                 dlg.ShowDialog();
                 if (dlg.DialogResult == DialogResult.OK)
                 {
                     txtValue1.Text = dlg.GetNumber().ToString();
                 }
             }
             return;
         case ObjTemplate.ObjectType.totem:
             {
                 int value = 0;
                 Int32.TryParse(txtValue1.Text, out value);
                 FlagEditor dlg = new FlagEditor(BitvectorFlagType.TotemFlags, value, 0);
                 dlg.ShowDialog();
                 if (dlg.DialogResult == DialogResult.OK)
                 {
                     txtValue1.Text = dlg.Value.ToString();
                 }
             }
             return;
         case ObjTemplate.ObjectType.teleport:
             {
                 SelectRoom dlg = new SelectRoom(_area);
                 if (dlg.ShowDialog() == DialogResult.OK)
                 {
                     txtValue1.Text = dlg.GetIndexNumberString();
                 }
             }
             return;
         case ObjTemplate.ObjectType.note:
             {
                 SelectLanguage dlg = new SelectLanguage();
                 if (dlg.ShowDialog() == DialogResult.OK)
                 {
                     txtValue1.Text = ((int)dlg.GetLanguage()).ToString();
                 }
             }
             return;
         case ObjTemplate.ObjectType.instrument:
             {
                 SelectInstrumentType dlg = new SelectInstrumentType();
                 if (dlg.ShowDialog() == DialogResult.OK)
                 {
                     txtValue1.Text = dlg.GetInstrumentType().ToString();
                 }
             }
             return;
         default:
             return;
     }
 }
示例#10
0
 private void btnFindValue2_Click(object sender, EventArgs e)
 {
     switch (_type)
     {
         case ObjTemplate.ObjectType.switch_trigger:
             {
                 SelectRoom dlg = new SelectRoom(_area);
                 if (dlg.ShowDialog() == DialogResult.OK)
                 {
                     txtValue2.Text = dlg.GetIndexNumberString();
                 }
             }
             return;
         case ObjTemplate.ObjectType.container:
         case ObjTemplate.ObjectType.quiver:
             {
                 int value = 0;
                 Int32.TryParse(txtValue1.Text, out value);
                 FlagEditor dlg = new FlagEditor(BitvectorFlagType.ContainerFlags, value, 0);
                 dlg.ShowDialog();
                 if (dlg.DialogResult == DialogResult.OK)
                 {
                     txtValue2.Text = dlg.Value.ToString();
                 }
             }
             return;
         default:
             return;
     }
 }