Exemplo n.º 1
0
        public LayoutEditor()
        {
            InitializeComponent();

            layoutSystem = new LayoutEditorSystem
            {
                autoUnkBytes = checkBoxAutoBytes.Checked
            };

            layoutSystem.BindControl(listBoxObjects);

#if !DEBUG
            importSALayoutFileToolStripMenuItem.Visible = false;
#endif
            NumericPosX.Maximum = decimal.MaxValue;
            NumericPosX.Minimum = decimal.MinValue;
            NumericPosY.Maximum = decimal.MaxValue;
            NumericPosY.Minimum = decimal.MinValue;
            NumericPosZ.Maximum = decimal.MaxValue;
            NumericPosZ.Minimum = decimal.MinValue;

            NumericRotX.Maximum = decimal.MaxValue;
            NumericRotX.Minimum = decimal.MinValue;
            NumericRotY.Maximum = decimal.MaxValue;
            NumericRotY.Minimum = decimal.MinValue;
            NumericRotZ.Maximum = decimal.MaxValue;
            NumericRotZ.Minimum = decimal.MinValue;

            gizmos    = new Gizmo[3];
            gizmos[0] = new Gizmo(GizmoType.X);
            gizmos[1] = new Gizmo(GizmoType.Y);
            gizmos[2] = new Gizmo(GizmoType.Z);
        }
Exemplo n.º 2
0
        private void UpdateObjectComboBox()
        {
            ComboBoxObject.Items.Clear();
            ComboBoxObject.Items.AddRange(LayoutEditorSystem.GetActiveObjectEntries());

            UpdateList();
        }
Exemplo n.º 3
0
        public LayoutEditor()
        {
            InitializeComponent();

            layoutSystem = new LayoutEditorSystem
            {
                autoUnkBytes = checkBoxAutoBytes.Checked
            };

            layoutSystem.BindControl(listBoxObjects);

            NumericPosX.Maximum = decimal.MaxValue;
            NumericPosX.Minimum = decimal.MinValue;
            NumericPosY.Maximum = decimal.MaxValue;
            NumericPosY.Minimum = decimal.MinValue;
            NumericPosZ.Maximum = decimal.MaxValue;
            NumericPosZ.Minimum = decimal.MinValue;

            NumericRotX.Maximum = decimal.MaxValue;
            NumericRotX.Minimum = decimal.MinValue;
            NumericRotY.Maximum = decimal.MaxValue;
            NumericRotY.Minimum = decimal.MinValue;
            NumericRotZ.Maximum = decimal.MaxValue;
            NumericRotZ.Minimum = decimal.MinValue;

            gizmos    = new Gizmo[3];
            gizmos[0] = new Gizmo(GizmoType.X);
            gizmos[1] = new Gizmo(GizmoType.Y);
            gizmos[2] = new Gizmo(GizmoType.Z);
        }
Exemplo n.º 4
0
        public LayoutEditor()
        {
            InitializeComponent();

            try
            {
                layoutSystem = new LayoutEditorSystem();
            }
            catch (FileNotFoundException)
            {
                MessageBox.Show("Error: failed to load one or more files during startup. Program will not work correctly.");
            }

            NumericPosX.Maximum = decimal.MaxValue;
            NumericPosX.Minimum = decimal.MinValue;
            NumericPosY.Maximum = decimal.MaxValue;
            NumericPosY.Minimum = decimal.MinValue;
            NumericPosZ.Maximum = decimal.MaxValue;
            NumericPosZ.Minimum = decimal.MinValue;

            NumericRotX.Maximum = decimal.MaxValue;
            NumericRotX.Minimum = decimal.MinValue;
            NumericRotY.Maximum = decimal.MaxValue;
            NumericRotY.Minimum = decimal.MinValue;
            NumericRotZ.Maximum = decimal.MaxValue;
            NumericRotZ.Minimum = decimal.MinValue;
        }
Exemplo n.º 5
0
        public SetObjectHeroes()
        {
            FindObjectEntry(LayoutEditorSystem.GetActiveObjectEntries());

            UnkBytes = new byte[8];

            objectManager = FindObjectManager();
            objectManager.MiscSettings = new byte[36];
        }
Exemplo n.º 6
0
        public SetObjectShadow(byte List, byte Type, Vector3 Position, Vector3 Rotation, byte Link, byte Rend, int MiscSettingCount, byte[] UnkBytes = null)
        {
            this.List = List;
            this.Type = Type;
            FindObjectEntry(LayoutEditorSystem.GetActiveObjectEntries());
            this.Position = Position;
            this.Rotation = Rotation;
            this.Link     = Link;
            this.Rend     = Rend;

            this.UnkBytes         = UnkBytes ?? new byte[8];
            this.MiscSettingCount = MiscSettingCount;

            isSelected = false;

            objectManager = FindObjectManager();
            objectManager.MiscSettings = new byte[MiscSettingCount];
        }
Exemplo n.º 7
0
        public SetObjectHeroes(byte List, byte Type, Vector3 Position, Vector3 Rotation, byte Link, byte Rend, byte[] UnkBytes = null)
        {
            this.List = List;
            this.Type = Type;
            FindObjectEntry(LayoutEditorSystem.GetActiveObjectEntries());
            this.Position = Position;
            this.Rotation = Rotation;
            this.Link     = Link;
            this.Rend     = Rend;

            this.UnkBytes = UnkBytes ?? new byte[8];

            isSelected = false;

            objectManager = FindObjectManager();
            objectManager.MiscSettings = new byte[36];
            CreateTransformMatrix();
        }
Exemplo n.º 8
0
        private void UpdateDisplayData()
        {
            if (listBoxObjects.SelectedIndices.Count == 1)
            {
                if (displayDataDisabled)
                {
                    EnableDisplayData();
                }

                ProgramIsChangingStuff = true;

                NumericPosX.Value = layoutSystem.GetPosX(listBoxObjects.SelectedIndex);
                NumericPosY.Value = layoutSystem.GetPosY(listBoxObjects.SelectedIndex);
                NumericPosZ.Value = layoutSystem.GetPosZ(listBoxObjects.SelectedIndex);
                NumericRotX.Value = layoutSystem.GetRotX(listBoxObjects.SelectedIndex);
                NumericRotY.Value = layoutSystem.GetRotY(listBoxObjects.SelectedIndex);
                NumericRotZ.Value = layoutSystem.GetRotZ(listBoxObjects.SelectedIndex);

                foreach (ObjectEntry o in LayoutEditorSystem.GetActiveObjectEntries())
                {
                    if (o.List == layoutSystem.GetSetObjectAt(listBoxObjects.SelectedIndex).List&& o.Type == layoutSystem.GetSetObjectAt(listBoxObjects.SelectedIndex).Type)
                    {
                        ComboBoxObject.SelectedItem = o;
                    }
                }

                NumericObjLink.Value = layoutSystem.GetObjectLink(listBoxObjects.SelectedIndex);
                NumericObjRend.Value = layoutSystem.GetObjectRend(listBoxObjects.SelectedIndex);

                numericUnkB1.Value = layoutSystem.GetUnkBytes(listBoxObjects.SelectedIndex)[0];
                numericUnkB2.Value = layoutSystem.GetUnkBytes(listBoxObjects.SelectedIndex)[1];
                numericUnkB3.Value = layoutSystem.GetUnkBytes(listBoxObjects.SelectedIndex)[2];
                numericUnkB4.Value = layoutSystem.GetUnkBytes(listBoxObjects.SelectedIndex)[3];
                numericUnkB5.Value = layoutSystem.GetUnkBytes(listBoxObjects.SelectedIndex)[4];
                numericUnkB6.Value = layoutSystem.GetUnkBytes(listBoxObjects.SelectedIndex)[5];
                numericUnkB7.Value = layoutSystem.GetUnkBytes(listBoxObjects.SelectedIndex)[6];
                numericUnkB8.Value = layoutSystem.GetUnkBytes(listBoxObjects.SelectedIndex)[7];

                PropertyGridMisc.SelectedObject = layoutSystem.GetSetObjectAt(listBoxObjects.SelectedIndex);
                ProgramIsChangingStuff          = false;
            }

            UpdateObjectAmountLabel();
        }