Esempio n. 1
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;
            }
        }
Esempio n. 2
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;
     }
 }