Beispiel #1
0
        private void CenterGeomTextBox_TextChanged(object sender, EventArgs e)
        {
            if (CollisionGeom == null)
            {
                return;
            }
            if (populatingui)
            {
                return;
            }
            var v = FloatUtil.ParseVector3String(CenterGeomTextBox.Text);

            lock (ProjectForm.ProjectSyncRoot)
            {
                if (CollisionGeom.CenterGeom != v)
                {
                    CollisionGeom.CenterGeom = v;
                    ProjectForm.SetYbnHasChanged(true);
                }
            }
        }
Beispiel #2
0
        private void UnkVectorTextBox_TextChanged(object sender, EventArgs e)
        {
            if (CollisionBounds == null)
            {
                return;
            }
            if (populatingui)
            {
                return;
            }
            var v = FloatUtil.ParseVector3String(UnkVectorTextBox.Text);

            lock (ProjectForm.ProjectSyncRoot)
            {
                if (CollisionBounds.Unknown_60h != v)
                {
                    CollisionBounds.Unknown_60h = v;
                    ProjectForm.SetYbnHasChanged(true);
                }
            }
        }
Beispiel #3
0
        private void CylVertex2TextBox_TextChanged(object sender, EventArgs e)
        {
            if (CollisionCylinder == null)
            {
                return;
            }
            if (populatingui)
            {
                return;
            }
            var v = FloatUtil.ParseVector3String(CylVertex2TextBox.Text);

            lock (ProjectForm.ProjectSyncRoot)
            {
                if (CollisionCylinder.Vertex2 != v)
                {
                    CollisionCylinder.Vertex2 = v;
                    ProjectForm.SetYbnHasChanged(true);
                }
            }
        }
Beispiel #4
0
        private void SphPositionTextBox_TextChanged(object sender, EventArgs e)
        {
            if (CollisionSphere == null)
            {
                return;
            }
            if (populatingui)
            {
                return;
            }
            var v = FloatUtil.ParseVector3String(SphPositionTextBox.Text);

            lock (ProjectForm.ProjectSyncRoot)
            {
                if (CollisionSphere.Position != v)
                {
                    CollisionSphere.Position = v;
                    ProjectForm.SetYbnHasChanged(true);
                }
            }
        }
Beispiel #5
0
        private void YmapStreamingExtentsMaxTextBox_TextChanged(object sender, EventArgs e)
        {
            if (populatingui)
            {
                return;
            }
            if (Ymap == null)
            {
                return;
            }
            Vector3 v = FloatUtil.ParseVector3String(YmapStreamingExtentsMaxTextBox.Text);

            lock (ProjectForm.ProjectSyncRoot)
            {
                if (Ymap._CMapData.streamingExtentsMax != v)
                {
                    Ymap._CMapData.streamingExtentsMax = v;
                    SetYmapHasChanged(true);
                }
            }
        }
Beispiel #6
0
        private void PositionTextBox_TextChanged(object sender, EventArgs e)
        {
            if (Items == null)
            {
                return;
            }
            if (populatingui)
            {
                return;
            }
            var v = FloatUtil.ParseVector3String(PositionTextBox.Text);

            var wf = ProjectForm.WorldForm;

            if (wf != null)
            {
                wf.BeginInvoke(new Action(() =>
                {
                    wf.ChangeMultiPosition(Items, v, false);
                }));
            }
        }
Beispiel #7
0
        private void YnvAABBSizeTextBox_TextChanged(object sender, EventArgs e)
        {
            if (populatingui)
            {
                return;
            }
            if (Ynv?.Nav == null)
            {
                return;
            }
            Vector3 v = FloatUtil.ParseVector3String(YnvAABBSizeTextBox.Text);

            lock (ProjectForm.ProjectSyncRoot)
            {
                if (Ynv.Nav.AABBSize != v)
                {
                    Ynv.Nav.AABBSize = v;
                    ProjectForm.SetYnvHasChanged(true);
                }
            }
            UpdateFormTitleYnvChanged();
        }
        private void EntityPositionTextBox_TextChanged(object sender, EventArgs e)
        {
            if (populatingui)
            {
                return;
            }
            if (CurrentEntity == null)
            {
                return;
            }
            Vector3 v = FloatUtil.ParseVector3String(EntityPositionTextBox.Text);

            lock (ProjectForm.ProjectSyncRoot)
            {
                if (CurrentEntity.MloParent != null)
                {
                    v = CurrentEntity.MloParent.Position + CurrentEntity.MloParent.Orientation.Multiply(v);
                    CurrentEntity.SetPosition(v);
                    ProjectItemChanged();
                }
                else
                {
                    if (CurrentEntity.Position != v)
                    {
                        CurrentEntity.SetPosition(v);
                        ProjectItemChanged();
                        var wf = ProjectForm.WorldForm;
                        if (wf != null)
                        {
                            wf.BeginInvoke(new Action(() =>
                            {
                                wf.SetWidgetPosition(CurrentEntity.WidgetPosition, true);
                            }));
                        }
                    }
                }
            }
        }
        private void SizeTextBox_TextChanged(object sender, EventArgs e)
        {
            if (populatingui)
            {
                return;
            }
            if (CurrentBoxOccluder == null)
            {
                return;
            }
            var v = FloatUtil.ParseVector3String(SizeTextBox.Text);

            lock (ProjectForm.ProjectSyncRoot)
            {
                if (CurrentBoxOccluder.Size != v)
                {
                    CurrentBoxOccluder.SetSize(v);
                    UpdateGraphics();
                    ProjectForm.SetYmapHasChanged(true);
                    ProjectForm.WorldForm?.SetWidgetScale(v);
                }
            }
        }
Beispiel #10
0
        private void TriangleCorner3TextBox_TextChanged(object sender, EventArgs e)
        {
            if (populatingui)
            {
                return;
            }
            if (CurrentTriangle == null)
            {
                return;
            }
            var v = FloatUtil.ParseVector3String(TriangleCorner3TextBox.Text);

            lock (ProjectForm.ProjectSyncRoot)
            {
                if (CurrentTriangle.Corner3 != v)
                {
                    CurrentTriangle.Corner3 = v;
                    UpdateGraphics();
                    ProjectForm.SetYmapHasChanged(true);
                    ProjectForm.WorldForm?.SetWidgetPosition(CurrentTriangle.Center);
                }
            }
        }
Beispiel #11
0
        private void CarPositionTextBox_TextChanged(object sender, EventArgs e)
        {
            if (populatingui)
            {
                return;
            }
            if (CurrentCarGen == null)
            {
                return;
            }
            Vector3 v = FloatUtil.ParseVector3String(CarPositionTextBox.Text);

            lock (ProjectForm.ProjectSyncRoot)
            {
                if (CurrentCarGen.Position != v)
                {
                    CurrentCarGen.SetPosition(v);
                    ProjectForm.SetYmapHasChanged(true);
                    ProjectForm.WorldForm?.SetWidgetPosition(v);
                }
            }

            ProjectForm.ProjectExplorer?.UpdateCarGenTreeNode(CurrentCarGen);
        }
Beispiel #12
0
        private void EntityPositionTextBox_TextChanged(object sender, EventArgs e)
        {
            if (populatingui)
            {
                return;
            }
            if (CurrentEntity == null)
            {
                return;
            }
            Vector3 v = FloatUtil.ParseVector3String(EntityPositionTextBox.Text);

            lock (ProjectForm.ProjectSyncRoot)
            {
                if (CurrentEntity.MloParent != null)
                {
                    //TODO: positioning for interior entities!
                }
                else
                {
                    if (CurrentEntity.Position != v)
                    {
                        CurrentEntity.SetPosition(v);
                        ProjectForm.SetYmapHasChanged(true);
                        var wf = ProjectForm.WorldForm;
                        if (wf != null)
                        {
                            wf.BeginInvoke(new Action(() =>
                            {
                                wf.SetWidgetPosition(CurrentEntity.WidgetPosition, true);
                            }));
                        }
                    }
                }
            }
        }
Beispiel #13
0
        private void NormalizeDirectionButton_Click(object sender, EventArgs e)
        {
            Vector3 d = Vector3.Normalize(FloatUtil.ParseVector3String(DirectionTextBox.Text));

            DirectionTextBox.Text = FloatUtil.GetVector3String(d);
        }
Beispiel #14
0
        private void NormalizeTangentButton_Click(object sender, EventArgs e)
        {
            Vector3 t = Vector3.Normalize(FloatUtil.ParseVector3String(TangentTextBox.Text));

            TangentTextBox.Text = FloatUtil.GetVector3String(t);
        }