Exemplo n.º 1
0
        public void updateData()
        {
            if ((mData == null) || (mNode == null))
            {
                return;
            }

            // Move control data to data (CONTROL DATA -> DATA)
            //
            visualModelAnimAssetTag afterChanges = new visualModelAnimAssetTag();

            afterChanges.copy(mData);
            afterChanges.position      = (decimal)positionSliderEdit.Value;
            afterChanges.force         = (decimal)forceSliderEdit.Value;
            afterChanges.tobone        = (string)toBoneComboBox.SelectedItem;
            afterChanges.lifespan      = (decimal)durationSliderEdit.Value;
            afterChanges.checkSelected = (bool)selectedCheckBox.Checked;

            // Add/Execute undo action
            UndoRedoChangeDataAction undoAction = new UndoRedoChangeDataAction(mData, afterChanges);

            mVisualEditorPage.mUndoRedoManager.addUndoRedoActionAndExecute(undoAction);


            // Update animation slider
            mVisualEditorPage.setAnimationControlState(AnimationControl.AnimControlStateEnum.ePaused);
            mVisualEditorPage.setAnimationControlNormalizedTime((float)afterChanges.position);
        }
Exemplo n.º 2
0
        public void bindData(visualModelAnimAssetTag model, TreeNode treeNode)
        {
            mIsBindingData = true;

            mData = model;
            mNode = treeNode;

            // Move data to control data (DATA -> CONTROL DATA)
            //
            refreshComboBoxItems();

            positionSliderEdit.Value = (float)mData.position;
            attach.Checked           = mData.attach;

            bool found = false;

            for (int i = 0; i < toBoneComboBox.Items.Count; i++)
            {
                if (String.Compare(mData.tobone, (string)toBoneComboBox.Items[i], true) == 0)
                {
                    toBoneComboBox.SelectedIndex = i;
                    found = true;
                    break;
                }
            }

            if (!found)
            {
                toBoneComboBox.SelectedIndex = -1;
                toBoneComboBox.SelectedItem  = null;
                toBoneComboBox.Text          = null;
            }

            mIsBindingData = false;
        }
Exemplo n.º 3
0
        public void updateData()
        {
            if ((mData == null) || (mNode == null))
            {
                return;
            }

            // Move control data to data (CONTROL DATA -> DATA)
            //
            visualModelAnimAssetTag afterChanges = new visualModelAnimAssetTag();

            afterChanges.copy(mData);
            afterChanges.position = (decimal)floatSliderEdit1.Value;

            float sizeX = sizeXFloatSliderEdit.Value;
            float sizeZ = sizeZFloatSliderEdit.Value;

            string userData;

            ConvertUserDataValuesToString(out userData, sizeX, sizeZ);
            afterChanges.userData = userData;

            // Add/Execute undo action
            UndoRedoChangeDataAction undoAction = new UndoRedoChangeDataAction(mData, afterChanges);

            mVisualEditorPage.mUndoRedoManager.addUndoRedoActionAndExecute(undoAction);


            // Update animation slider
            mVisualEditorPage.setAnimationControlState(AnimationControl.AnimControlStateEnum.ePaused);
            mVisualEditorPage.setAnimationControlNormalizedTime((float)afterChanges.position);
        }
Exemplo n.º 4
0
        public void bindData(visualModelAnimAssetTag model, TreeNode treeNode)
        {
            mIsBindingData = true;

            mData = model;
            mNode = treeNode;

            // Move data to control data (DATA -> CONTROL DATA)
            //

            floatSliderEdit1.Value = (float)mData.position;

            if (!String.IsNullOrEmpty(mData.userData))
            {
                float sizeX;
                float sizeZ;

                ConvertUserDataStringToValues(mData.userData, out sizeX, out sizeZ);

                sizeXFloatSliderEdit.Value = sizeX;
                sizeZFloatSliderEdit.Value = sizeZ;
            }


            mIsBindingData = false;
        }
Exemplo n.º 5
0
        public void updateData()
        {
            if ((mData == null) || (mNode == null))
            {
                return;
            }

            // Move control data to data (CONTROL DATA -> DATA)
            //
            visualModelAnimAssetTag afterChanges = new visualModelAnimAssetTag();

            afterChanges.copy(mData);
            afterChanges.position     = (decimal)floatSliderEdit1.Value;
            afterChanges.name         = soundBrowseControl1.FileName;
            afterChanges.tobone       = (string)toBoneComboBox.SelectedItem;
            afterChanges.checkvisible = visibleCheckBox.Checked;
            afterChanges.checkFOW     = checkBoxFOW.Checked;

            // Add/Execute undo action
            UndoRedoChangeDataAction undoAction = new UndoRedoChangeDataAction(mData, afterChanges);

            mVisualEditorPage.mUndoRedoManager.addUndoRedoActionAndExecute(undoAction);


            // Update and Pause animation slider
            mVisualEditorPage.setAnimationControlState(AnimationControl.AnimControlStateEnum.ePaused);
            mVisualEditorPage.setAnimationControlNormalizedTime((float)afterChanges.position);
        }
Exemplo n.º 6
0
        public void updateData()
        {
            if ((mData == null) || (mNode == null))
            {
                return;
            }

            // Move control data to data (CONTROL DATA -> DATA)
            //
            visualModelAnimAssetTag afterChanges = new visualModelAnimAssetTag();

            afterChanges.copy(mData);
            afterChanges.position = (decimal)floatSliderEdit1.Value;
            afterChanges.tobone   = (string)toBoneComboBox.SelectedItem;

            float sizeX       = sizeXFloatSliderEdit.Value;
            float sizeZ       = sizeZFloatSliderEdit.Value;
            bool  targetValue = (targetValueComboBox.SelectedIndex > 0) ? false : true;
            bool  shape       = (fillShapeComboBox.SelectedIndex > 0) ? true : false;

            string userData;

            ConvertUserDataValuesToString(out userData, sizeX, sizeZ, targetValue, shape);
            afterChanges.userData = userData;

            // Add/Execute undo action
            UndoRedoChangeDataAction undoAction = new UndoRedoChangeDataAction(mData, afterChanges);

            mVisualEditorPage.mUndoRedoManager.addUndoRedoActionAndExecute(undoAction);


            // Update animation slider
            mVisualEditorPage.setAnimationControlState(AnimationControl.AnimControlStateEnum.ePaused);
            mVisualEditorPage.setAnimationControlNormalizedTime((float)afterChanges.position);
        }
Exemplo n.º 7
0
        public void bindData(visualModelAnimAssetTag model, TreeNode treeNode)
        {
            mIsBindingData = true;

            mData = model;
            mNode = treeNode;

            // Move data to control data (DATA -> CONTROL DATA)
            //
            refreshComboBoxItems();

            positionSliderEdit.Value      = (float)mData.position;
            leftStrengthSliderEdit.Value  = (float)mData.force;
            rightStrengthSliderEdit.Value = (float)mData.force2;
            durationSliderEdit.Value      = (float)mData.lifespan;
            loopCheckBox.Checked          = (bool)mData.loop;
            selectedCheckBox.Checked      = (bool)mData.checkSelected;

            bool found = false;

            for (int i = 0; i < leftRumbleComboBox.Items.Count; i++)
            {
                if (String.Compare(mData.leftRumbleType, (string)leftRumbleComboBox.Items[i], true) == 0)
                {
                    leftRumbleComboBox.SelectedIndex = i;
                    found = true;
                    break;
                }
            }
            if (!found)
            {
                leftRumbleComboBox.SelectedIndex = -1;
                leftRumbleComboBox.SelectedItem  = null;
                leftRumbleComboBox.Text          = null;
            }

            found = false;
            for (int i = 0; i < rightRumbleComboBox.Items.Count; i++)
            {
                if (String.Compare(mData.rightRumbleType, (string)rightRumbleComboBox.Items[i], true) == 0)
                {
                    rightRumbleComboBox.SelectedIndex = i;
                    found = true;
                    break;
                }
            }
            if (!found)
            {
                rightRumbleComboBox.SelectedIndex = -1;
                rightRumbleComboBox.SelectedItem  = null;
                rightRumbleComboBox.Text          = null;
            }

            mIsBindingData = false;
        }
Exemplo n.º 8
0
        public void bindData(visualModelAnimAssetTag model, TreeNode treeNode)
        {
            mIsBindingData = true;

            mData = model;
            mNode = treeNode;

            // Move data to control data (DATA -> CONTROL DATA)
            //
            refreshComboBoxItems();

            floatSliderEdit1.Value = (float)mData.position;

            if (!String.IsNullOrEmpty(mData.userData))
            {
                float sizeX;
                float sizeZ;
                bool  fillShape;
                bool  destValue;

                ConvertUserDataStringToValues(mData.userData, out fillShape, out sizeX, out sizeZ, out destValue);

                sizeXFloatSliderEdit.Value        = sizeX;
                sizeZFloatSliderEdit.Value        = sizeZ;
                targetValueComboBox.SelectedIndex = destValue?0:1;
                fillShapeComboBox.SelectedIndex   = fillShape ? 1 : 0;
            }

            bool found = false;

            for (int i = 0; i < toBoneComboBox.Items.Count; i++)
            {
                if (String.Compare(mData.tobone, (string)toBoneComboBox.Items[i], true) == 0)
                {
                    toBoneComboBox.SelectedIndex = i;
                    found = true;
                    break;
                }
            }

            if (!found)
            {
                toBoneComboBox.SelectedIndex = -1;
                toBoneComboBox.SelectedItem  = null;
                toBoneComboBox.Text          = null;
            }

            mIsBindingData = false;
        }
Exemplo n.º 9
0
        public void bindData(visualModelAnimAssetTag model, TreeNode treeNode)
        {
            mIsBindingData = true;

            mData = model;
            mNode = treeNode;

            // Move data to control data (DATA -> CONTROL DATA)
            //
            refreshComboBoxItems();

            floatSliderEdit1.Value = (float)mData.position;

            bool found = false;

            for (int i = 0; i < toBoneComboBox.Items.Count; i++)
            {
                if (String.Compare(mData.tobone, (string)toBoneComboBox.Items[i], true) == 0)
                {
                    toBoneComboBox.SelectedIndex = i;
                    found = true;
                    break;
                }
            }

            if (!found)
            {
                toBoneComboBox.SelectedIndex = -1;
                toBoneComboBox.SelectedItem  = null;
                toBoneComboBox.Text          = null;
            }

            int selectedIndex = System.Convert.ToInt32(mData.start);

            if (selectedIndex < 0 || selectedIndex > 2)
            {
                selectedIndex = 0;
            }
            typeComboBox.SelectedIndex = selectedIndex;
            xTextBox.Text            = mData.force.ToString();
            yTextBox.Text            = mData.force2.ToString();
            zTextBox.Text            = mData.lifespan.ToString();
            attachedCheckBox.Checked = mData.checkSelected;

            mIsBindingData = false;
        }
Exemplo n.º 10
0
        public void bindData(visualModelAnimAssetTag model, TreeNode treeNode)
        {
            mIsBindingData = true;

            mData = model;
            mNode = treeNode;

            // Move data to control data (DATA -> CONTROL DATA)
            //
            refreshComboBoxItems();

            floatSliderEdit1.Value      = (float)mData.position;
            fileBrowseControl1.FileName = mData.name;
            disregardBoneOrientationCheckBox.Checked = mData.disregardorient;
            lifespanFloatSliderEdit.Value            = (float)mData.lifespan;

            bool found = false;

            for (int i = 0; i < toBoneComboBox.Items.Count; i++)
            {
                if (String.Compare(mData.tobone, (string)toBoneComboBox.Items[i], true) == 0)
                {
                    toBoneComboBox.SelectedIndex = i;
                    found = true;
                    break;
                }
            }

            if (!found)
            {
                toBoneComboBox.SelectedIndex = -1;
                toBoneComboBox.SelectedItem  = null;
                toBoneComboBox.Text          = null;
            }

            mIsBindingData = false;
        }