Esempio n. 1
0
        public void OperandUpdated()
        {
            uint guid = Convert.ToUInt32(OpUtils.GetOperandProperty(Operand, GUIDProperty));
            var  obj  = Content.GameContent.Get.WorldObjects.Get(guid);

            ObjectLabel.Text = (obj == null) ? ("0x" + guid.ToString("X8")) : obj.OBJ.ChunkLabel;
        }
Esempio n. 2
0
        public void OperandUpdated()
        {
            ValueNames = ValueProvider.GetNamedProperties(Scope, Operand);
            int value = Convert.ToInt32(OpUtils.GetOperandProperty(Operand, Property));

            IgnoreSet = true;

            ComboSelect.Items.Clear();
            bool found = false;

            foreach (var pair in ValueNames)
            {
                ComboSelect.Items.Add(new ComboNameValuePair(pair));
                if (pair.Key == value)
                {
                    ComboSelect.SelectedIndex = ComboSelect.Items.Count - 1;
                    found = true;
                }
            }
            IgnoreSet           = false;
            ComboSelect.Enabled = ComboSelect.Items.Count > 0;
            if (ComboSelect.Enabled && (!found))
            {
                ComboSelect.SelectedIndex = 0;                                  //force update with new index
            }
        }
Esempio n. 3
0
        private void ComboSelect_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (IgnoreSet)
            {
                return;
            }
            OpUtils.SetOperandProperty(Operand, Property, ((ComboNameValuePair)ComboSelect.SelectedItem).Value);

            Master.SignalOperandUpdate();
        }
Esempio n. 4
0
        private void ValueEntry_ValueChanged(object sender, EventArgs e)
        {
            if (IgnoreSet)
            {
                return;
            }
            OpUtils.SetOperandProperty(Operand, Property, ValueEntry.Value);

            Master.SignalOperandUpdate();
        }
Esempio n. 5
0
        private void EditButton_Click(object sender, EventArgs e)
        {
            var popup = new VarObjectSelect();

            popup.ShowDialog();
            if (popup.DialogResult == DialogResult.OK)
            {
                OpUtils.SetOperandProperty(Operand, GUIDProperty, popup.GUIDResult);
            }
            Master.SignalOperandUpdate();
        }
Esempio n. 6
0
        private void EditButton_Click(object sender, EventArgs e)
        {
            var popup = new VarScopeSelect(Scope, Convert.ToByte(OpUtils.GetOperandProperty(Operand, SourceProperty)), Convert.ToInt16(OpUtils.GetOperandProperty(Operand, DataProperty)));

            popup.ShowDialog();
            if (popup.DialogResult == DialogResult.OK)
            {
                OpUtils.SetOperandProperty(Operand, SourceProperty, popup.SelectedSource);
                OpUtils.SetOperandProperty(Operand, DataProperty, popup.SelectedData);
            }
            Master.SignalOperandUpdate();
        }
Esempio n. 7
0
        private void Check_CheckedChanged(object sender, EventArgs e)
        {
            if (IgnoreSet)
            {
                return;
            }
            var check = (CheckBox)sender;
            var flag  = CheckToFlag[check];

            OpUtils.SetOperandProperty(Operand, flag.Property, check.Checked);

            Master.SignalOperandUpdate();
        }
Esempio n. 8
0
        public void OperandUpdated()
        {
            var bounds = BoundsProvider.GetBounds(Scope, Operand);

            ValueEntry.Minimum = bounds[0];
            ValueEntry.Maximum = bounds[1];

            var prop = OpUtils.GetOperandProperty(Operand, Property);

            if (prop.GetType() == typeof(uint))
            {
                prop = unchecked ((int)Convert.ToUInt32(prop));
            }
            int value = Convert.ToInt32(prop);

            IgnoreSet        = true;
            ValueEntry.Value = value;
            IgnoreSet        = false;
        }
Esempio n. 9
0
        public void OperandUpdated()
        {
            int value = Convert.ToInt32(OpUtils.GetOperandProperty(Operand, SourceProperty));

            ScopeLabel.Text = Scope.GetVarName((VMVariableScope)value, Convert.ToInt16(OpUtils.GetOperandProperty(Operand, DataProperty)));
        }