public LevelBoolValueEditor(Value value, int x, int y)
            : base(value, x, y)
        {
            Definition = (BoolValueDefinition)value.Definition;
            InitializeComponent();

            nameLabel.Text = Definition.Name;
            valueCheckBox.Checked = Convert.ToBoolean(Value.Content);
        }
Example #2
0
        public FloatValueEditor(Value value, int x, int y)
            : base(value, x, y)
        {
            Definition = (FloatValueDefinition)value.Definition;
            InitializeComponent();

            nameLabel.Text = Definition.Name;
            valueTextBox.Text = Value.Content;
        }
        public LevelColorValueEditor(Value value, int x, int y)
            : base(value, x, y)
        {
            Definition = (ColorValueDefinition)value.Definition;
            InitializeComponent();

            nameLabel.Text = Definition.Name;
            colorChooser.Color = Value.Content;
        }
Example #4
0
        public BoolValueEditor(Value value, int x, int y)
            : base(value, x, y)
        {
            Definition = (BoolValueDefinition)value.Definition;
            InitializeComponent();

            valueCheckBox.Text = Definition.Name;
            valueCheckBox.Location = new Point(64 - valueCheckBox.Size.Width / 2, 5);
            valueCheckBox.Checked = Convert.ToBoolean(Value.Content);
        }
        public LevelEnumValueEditor(Value value, int x, int y)
            : base(value, x, y)
        {
            Definition = (EnumValueDefinition)value.Definition;
            InitializeComponent();

            nameLabel.Text = Definition.Name;

            //Init the combo box
            for (int i = 0; i < Definition.Elements.Length; i++)
            {
                valueComboBox.Items.Add(Definition.Elements[i]);
                if (Value.Content == Definition.Elements[i])
                    valueComboBox.SelectedIndex = i;
            }
        }
        public LevelStringValueEditor(Value value, int x, int y)
            : base(value, x, y)
        {
            Definition = (StringValueDefinition)value.Definition;
            InitializeComponent();

            //Init the textbox
            if (Definition.MultiLine)
            {
                valueTextBox.Multiline = true;
                valueTextBox.Size = new Size(valueTextBox.Width, valueTextBox.Height * 3);
                Size = new Size(Size.Width, 64);
            }
            nameLabel.Text = Definition.Name;

            valueTextBox.Text = Value.Content;
        }
        public LevelIntValueEditor(Value value, int x, int y)
            : base(value, x, y)
        {
            Definition = (IntValueDefinition)value.Definition;
            InitializeComponent();

            nameLabel.Text = Definition.Name;
            valueTextBox.Text = Value.Content;

            //Deal with the slider
            if (Definition.ShowSlider)
            {
                valueTrackBar.Minimum = Definition.Min;
                valueTrackBar.Maximum = Definition.Max;
                valueTrackBar.Value = Convert.ToInt32(Value.Content);
                valueTrackBar.TickFrequency = (Definition.Max - Definition.Min) / 10;
            }
            else
            {
                Controls.Remove(valueTrackBar);
                valueTrackBar = null;
            }
        }
 public EntitySetValueAction(EntityLayer entityLayer, Value value, string setTo)
     : base(entityLayer)
 {
     this.value = value;
     this.setTo = setTo;
 }
 public override ValueEditor GetInstanceLevelEditor(Value instance, int x, int y)
 {
     return new LevelBoolValueEditor(instance, x, y);
 }
 public override ValueEditor GetInstanceEditor(Value instance, int x, int y)
 {
     return new FloatValueEditor(instance, x, y);
 }
Example #11
0
 public virtual ValueEditor GetInstanceLevelEditor(Value instance, int x, int y)
 {
     throw new NotImplementedException();
 }
Example #12
0
 public ValueEditor(Value value, int x, int y)
 {
     Value = value;
     Location = new Point(x, y);
 }
Example #13
0
 public Value(Value value)
 {
     Definition = value.Definition;
     Content = value.Content;
 }