Ejemplo n.º 1
0
        private void FillBuiltIn(uint type, ListView list, TabPage tab)
        {
            list.Items.Clear();
            ListViewItem lvi;

            uint i = 0;

            foreach (string s in BhavWiz.readStr(pjse.GS.BhavStr.Primitives))
            {
                if (!s.StartsWith("~"))
                {
                    lvi     = new ListViewItem(new string[] { "0x" + SimPe.Helper.HexString((ushort)i), s });
                    lvi.Tag = i;
                    list.Items.Add(lvi);
                }
                i++;
            }

            this.tcResources.TabPages.Add(tab);
            list.ListViewItemSorter = new ListViewItemComparer();
            if (list.Items.Count > 0)
            {
                list.SelectedIndices.Add(0);
            }
        }
Ejemplo n.º 2
0
        private void setInstanceLabel()
        {
            if (lbInstance != null)
            {
                string s = "";
                if (inst != null)
                {
                    List <string> labels = null;
                    if (useFlagNames && dataOwner == 0x07 && flagsFor != null)
                    {
                        labels = BhavWiz.flagNames(flagsFor.DataOwner, flagsFor.Value);
                        if (labels != null)
                        {
                            labels = new List <string>(labels);
                            labels.Insert(0, "[0: " + pjse.Localization.GetString("invalid") + "]");
                        }
                    }
                    else if (dataOwner == 0x00 || dataOwner == 0x01)
                    {
                        labels = inst.GetAttrNames(Scope.Private);
                    }
                    else if (dataOwner == 0x02 || dataOwner == 0x05)
                    {
                        labels = inst.GetAttrNames(Scope.SemiGlobal);
                    }
                    else if (dataOwner == 0x09 || dataOwner == 0x16 || dataOwner == 0x32) // Param
                    {
                        labels = inst.GetTPRPnames(false);
                    }
                    else if (dataOwner == 0x19) // Local
                    {
                        labels = inst.GetTPRPnames(true);
                    }
                    else if (dataOwner >= 0x29 && dataOwner <= 0x2F)
                    {
                        labels = inst.GetArrayNames();
                    }
                    else if (BhavWiz.doidGStr[dataOwner] != null)
                    {
                        labels = BhavWiz.readStr((GS.BhavStr)BhavWiz.doidGStr[dataOwner]);
                    }

                    if (labels != null)
                    {
                        if (instance < labels.Count)
                        {
                            s = cbDataOwner.Text + ": " + labels[instance];
                        }
                    }
                    else if (dataOwner == 0x1a)
                    {
                        ushort[] bcon = BhavWiz.ExpandBCON(instance, false);
                        s = ((BhavWiz)inst).readBcon(bcon[0], bcon[1], false, true);
                    }
                }
                lbInstance.Text = s;
            }
        }
Ejemplo n.º 3
0
        public UI()
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            cbLocation.Items.AddRange(BhavWiz.readStr(GS.BhavStr.RelativeLocations).ToArray());
            cbDirection.Items.AddRange(BhavWiz.readStr(GS.BhavStr.RelativeDirections).ToArray());
        }
Ejemplo n.º 4
0
        public UI()
        {
            //
            // Erforderlich für die Windows Form-Designerunterstützung
            //
            InitializeComponent();

            cbOperator.Items.Clear();
            cbOperator.Items.AddRange(BhavWiz.readStr(GS.BhavStr.Operators).ToArray());

            labelledDataOwner2.Decimal           = labelledDataOwner1.Decimal = pjse.Settings.PJSE.DecimalDOValue;
            labelledDataOwner2.UseInstancePicker = labelledDataOwner1.UseInstancePicker = pjse.Settings.PJSE.InstancePickerAsText;
        }
Ejemplo n.º 5
0
        public UI()
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            this.cbRTBNType.Items.Clear();
            this.cbRTBNType.Items.AddRange(BhavWiz.readStr(GS.BhavStr.RTBNType).ToArray());

            ldocArg3.Decimal           = ldocArg2.Decimal = ldocArg1.Decimal = pjse.Settings.PJSE.DecimalDOValue;
            ldocArg3.UseInstancePicker = ldocArg2.UseInstancePicker = ldocArg1.UseInstancePicker = pjse.Settings.PJSE.InstancePickerAsText;
        }
Ejemplo n.º 6
0
        public void Execute(Instruction inst)
        {
            byte operand0 = inst.Operands[0];

            this.cbGenericSimsCall.Items.Clear();
            for (byte i = 0; i < BhavWiz.readStr(GS.BhavStr.Generics).Count; i++)
            {
                this.cbGenericSimsCall.Items.Add("0x" + SimPe.Helper.HexString(i) + ": " + BhavWiz.readStr(GS.BhavStr.Generics, i));
            }
            this.lbGenericSimsCallparms.Text = "Should never see this";

            lbGenericSimsCallparms.Text     = genericSimsCallparamText(operand0);
            cbGenericSimsCall.SelectedIndex = (operand0 < cbGenericSimsCall.Items.Count) ? operand0 : -1;
        }
Ejemplo n.º 7
0
        public UI()
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            this.tbGUID.Visible     = false;
            this.tbGUID.Left        = this.cbToNext.Left + this.cbToNext.Width + 3;
            this.tbLocalVar.Visible = false;
            this.tbLocalVar.Left    = this.cbToNext.Left + this.cbToNext.Width + 3;

            this.cbToNext.Items.AddRange(BhavWiz.readStr(GS.BhavStr.NextObject).ToArray());
            this.cbWhere.Items.AddRange(BhavWiz.readStr(GS.BhavStr.DataLabels).ToArray());
        }
Ejemplo n.º 8
0
        private void SetDataOwner()
        {
            if (internalchg)
            {
                return;
            }

            internalchg = true;

            if (cbDataOwner != null && cbDataOwner.SelectedIndex != dataOwner)
            {
                dataOwner = (byte)cbDataOwner.SelectedIndex;
                setTextBoxLength();
                tbValue.Text = tbValueConverter(instance);
                OnDataOwnerControlChanged(this, new EventArgs());
            }

            #region pickerNames
            List <String> pickerNames = null;
            if (useInstancePicker && cbPicker != null)
            {
                if (useFlagNames && dataOwner == 0x07 && flagsFor != null)
                {
                    pickerNames = BhavWiz.flagNames(flagsFor.DataOwner, flagsFor.Value);
                    if (pickerNames != null)
                    {
                        pickerNames = new List <string>(pickerNames);
                        pickerNames.Insert(0, "[0: " + pjse.Localization.GetString("invalid") + "]");
                    }
                }
                else if (inst != null && useInstancePicker && (dataOwner == 0x00 || dataOwner == 0x01))
                {
                    pickerNames = inst.GetAttrNames(Scope.Private);
                }
                else if (inst != null && useInstancePicker && (dataOwner == 0x02 || dataOwner == 0x05))
                {
                    pickerNames = inst.GetAttrNames(Scope.SemiGlobal);
                }
                else if (inst != null && dataOwner == 0x09 || dataOwner == 0x16 || dataOwner == 0x32) // Param
                {
                    pickerNames = inst.GetTPRPnames(false);
                }
                else if (inst != null && dataOwner == 0x19) // Local
                {
                    pickerNames = inst.GetTPRPnames(true);
                }
                else if (inst != null && useInstancePicker && (dataOwner >= 0x29 && dataOwner <= 0x2F))
                {
                    pickerNames = inst.GetArrayNames();
                }
                else if (BhavWiz.doidGStr[dataOwner] != null)
                {
                    pickerNames = BhavWiz.readStr((GS.BhavStr)BhavWiz.doidGStr[dataOwner]);
                }
            }
            #endregion


            if (pickerNames != null && pickerNames.Count > 0)
            {
                if (tbValue != null)
                {
                    tbValue.TabStop = tbValue.Visible = false;
                }
                cbPicker.TabStop = cbPicker.Visible = true;
                cbPicker.Items.Clear();
                cbPicker.Items.AddRange(pickerNames.ToArray());
                cbPicker.SelectedIndex = (cbPicker.Items.Count > instance) ? instance : -1;
            }
            else
            {
                if (cbPicker != null)
                {
                    cbPicker.TabStop = cbPicker.Visible = false;
                }
                if (tbValue != null)
                {
                    tbValue.TabStop = tbValue.Visible = true;
                }
            }

            setInstanceLabel();

            internalchg = false;
        }
Ejemplo n.º 9
0
        public void SetDataOwnerControl(BhavWiz inst, ComboBox cbDataOwner, ComboBox cbPicker, TextBox tbValue,
                                        CheckBox ckbDecimal, CheckBox ckbUseInstancePicker, Label lbInstance, byte dataOwner, ushort instance)
        {
            this.Dispose();
            this.inst                 = inst;
            this.cbDataOwner          = cbDataOwner;
            this.cbPicker             = cbPicker;
            this.tbValue              = tbValue;
            this.ckbDecimal           = ckbDecimal;
            this.ckbUseInstancePicker = ckbUseInstancePicker;
            this.lbInstance           = lbInstance;
            this.dataOwner            = dataOwner;
            this.instance             = instance;

            this.flagsFor = null;

            internalchg = true;
            if (this.cbDataOwner != null)
            {
                this.cbDataOwner.Items.Clear();
                this.cbDataOwner.Items.AddRange(BhavWiz.readStr(GS.BhavStr.DataOwners).ToArray());
                if (cbDataOwner.Items.Count > dataOwner)
                {
                    cbDataOwner.SelectedIndex = dataOwner;
                }
                this.cbDataOwner.SelectedIndexChanged += new System.EventHandler(this.cbDataOwner_SelectedIndexChanged);
            }

            if (this.cbPicker != null)
            {
                this.cbPicker.SelectedIndexChanged += new System.EventHandler(this.cbPicker_SelectedIndexChanged);
            }

            if (this.tbValue != null)
            {
                this.tbValue.Text         = this.tbValueConverter(instance);
                this.tbValue.Validating  += new System.ComponentModel.CancelEventHandler(this.tbValue_Validating);
                this.tbValue.Validated   += new System.EventHandler(this.tbValue_Validated);
                this.tbValue.TextChanged += new System.EventHandler(this.tbValue_TextChanged);
                this.tbValue.Enter       += new System.EventHandler(this.tbValue_Enter);
            }

            pjse.Settings.PJSE.DecimalDOValueChanged += new EventHandler(PJSE_DecimalDOValueChanged);
            Decimal = pjse.Settings.PJSE.DecimalDOValue;
            if (this.ckbDecimal != null)
            {
                this.ckbDecimal.Checked         = Decimal;
                this.ckbDecimal.CheckedChanged += new System.EventHandler(this.ckbDecimal_CheckedChanged);
            }

            pjse.Settings.PJSE.InstancePickerAsTextChanged += new EventHandler(PJSE_InstancePickerAsTextChanged);
            UseInstancePicker = pjse.Settings.PJSE.InstancePickerAsText;
            if (this.ckbUseInstancePicker != null)
            {
                this.ckbUseInstancePicker.Checked         = UseInstancePicker;
                this.ckbUseInstancePicker.CheckedChanged += new System.EventHandler(this.ckbUseAttrPicker_CheckedChanged);
            }

            internalchg = false;

            SetDataOwner();

            setTextBoxLength();
            setInstanceLabel();
        }
Ejemplo n.º 10
0
 private string genericSimsCallparamText(int i)
 {
     return(BhavWiz.readStr(GS.BhavStr.GenericsDesc, (ushort)i));
 }