Exemplo n.º 1
0
        private void ToolStripMenuItem_Add_Click(object sender, EventArgs e)
        {
            ClsDatMotion clMotion = ClsSystem.GetSelectMotion();

            if (clMotion == null)
            {
                return;
            }

            ClsDatElem clElem = ClsSystem.GetElemFromSelectLineNo();

            if (clElem == null)
            {
                return;
            }

            //以下、オプション追加処理
            ToolStripMenuItem clITem       = sender as ToolStripMenuItem;
            EnmTypeOption     enTypeOption = (EnmTypeOption)clITem.Tag;
            object            clValue1     = ClsParam.GetDefaultValue1(enTypeOption);
            object            clValue2     = ClsParam.GetDefaultValue2(enTypeOption);

            clElem.SetOption(enTypeOption, false, false, null, null, clValue1, clValue2);

            //以下、行番号振り直し処理
            clMotion.RefreshLineNo();

            //以下、コントロール更新処理
            this.RefreshControl();
            this.panel_Control.Refresh();
            this.panel_Time.Refresh();
            this.mFormMain.Refresh();
        }
Exemplo n.º 2
0
        /// <summary>
        /// オプションの情報を修正する処理
        /// </summary>
        /// <param name="clParam">パラメーター情報</param>
        public void ChangeElemFromParam(ClsParam clParam)
        {
            ClsDatMotion clMotion = ClsSystem.GetSelectMotion();

            if (clMotion == null)
            {
                return;
            }

            ClsDatElem clElem = ClsSystem.GetElemFromSelectLineNo();

            if (clElem == null)
            {
                return;
            }

            int inSelectFrameNo = ClsSystem.GetSelectFrameNo();

            //以下、表示設定
            object clValue2 = ClsParam.GetDefaultValue2(EnmTypeOption.DISPLAY);

            this.ChangeElem(clElem, EnmTypeOption.DISPLAY, inSelectFrameNo, clParam.mDisplayKeyFrame, false, false, null, null, clParam.mDisplay, clValue2);

            //以下、座標設定
            this.ChangeElem(clElem, EnmTypeOption.POSITION, inSelectFrameNo, clParam.mPositionKeyFrame, clParam.mPositionXTween, clParam.mPositionYTween, clParam.mTweenPositionX, clParam.mTweenPositionY, clParam.mX, clParam.mY);

            //以下、回転設定
            clValue2 = ClsParam.GetDefaultValue2(EnmTypeOption.ROTATION);
            this.ChangeElem(clElem, EnmTypeOption.ROTATION, inSelectFrameNo, clParam.mRotationKeyFrame, clParam.mRotationTween, false, clParam.mTweenRotation, null, clParam.mRZ, clValue2);

            //以下、スケール設定
            this.ChangeElem(clElem, EnmTypeOption.SCALE, inSelectFrameNo, clParam.mScaleKeyFrame, clParam.mScaleXTween, clParam.mScaleYTween, clParam.mTweenScaleX, clParam.mTweenScaleY, clParam.mSX, clParam.mSY);

            //以下、オフセット設定
            this.ChangeElem(clElem, EnmTypeOption.OFFSET, inSelectFrameNo, clParam.mOffsetKeyFrame, clParam.mOffsetXTween, clParam.mOffsetYTween, clParam.mTweenOffsetX, clParam.mTweenOffsetY, clParam.mCX, clParam.mCY);

            //以下、反転設定
            this.ChangeElem(clElem, EnmTypeOption.FLIP, inSelectFrameNo, clParam.mFlipKeyFrame, false, false, null, null, clParam.mFlipH, clParam.mFlipV);

            //以下、透明設定
            clValue2 = ClsParam.GetDefaultValue2(EnmTypeOption.TRANSPARENCY);
            this.ChangeElem(clElem, EnmTypeOption.TRANSPARENCY, inSelectFrameNo, clParam.mTransKeyFrame, clParam.mTransTween, false, clParam.mTweenTrans, null, clParam.mTrans, clValue2);

            //以下、カラー設定
            clValue2 = ClsParam.GetDefaultValue2(EnmTypeOption.COLOR);
            this.ChangeElem(clElem, EnmTypeOption.COLOR, inSelectFrameNo, clParam.mColorKeyFrame, clParam.mColorTween, false, clParam.mTweenColor, null, clParam.mColor, clValue2);

            //以下、ユーザーデータ設定
            clValue2 = ClsParam.GetDefaultValue2(EnmTypeOption.USER_DATA);
            this.ChangeElem(clElem, EnmTypeOption.USER_DATA, inSelectFrameNo, clParam.mUserDataKeyFrame, false, false, null, null, clParam.mUserData, clValue2);

            //以下、行番号を振り直す処理
            clMotion.RefreshLineNo();

            //以下、メインウィンドウ更新処理
            this.mFormMain.RefreshAll();
        }
Exemplo n.º 3
0
        private void ToolStripMenuItem_AddOption_DropDownOpening(object sender, EventArgs e)
        {
            ClsDatElem clElem = ClsSystem.GetElemFromSelectLineNo();

            if (clElem == null)
            {
                return;
            }

            Dictionary <EnmTypeOption, ToolStripMenuItem> clDic = new Dictionary <EnmTypeOption, ToolStripMenuItem>();

            clDic[EnmTypeOption.ROTATION]     = this.ToolStripMenuItem_AddRotation;
            clDic[EnmTypeOption.SCALE]        = this.ToolStripMenuItem_AddScale;
            clDic[EnmTypeOption.OFFSET]       = this.ToolStripMenuItem_AddOffset;
            clDic[EnmTypeOption.FLIP]         = this.ToolStripMenuItem_AddFlip;
            clDic[EnmTypeOption.TRANSPARENCY] = this.ToolStripMenuItem_AddTransparency;
            clDic[EnmTypeOption.COLOR]        = this.ToolStripMenuItem_AddColor;
            clDic[EnmTypeOption.USER_DATA]    = this.ToolStripMenuItem_AddUserDataText;

            foreach (EnmTypeOption enTypeOption in Enum.GetValues(typeof(EnmTypeOption)))
            {
                bool isExist = clDic.ContainsKey(enTypeOption);
                if (!isExist)
                {
                    continue;
                }

                ToolStripMenuItem clMenuItem = clDic[enTypeOption] as ToolStripMenuItem;
                if (clMenuItem == null)
                {
                    continue;
                }

                isExist            = clElem.mDicOption.ContainsKey(enTypeOption);
                clMenuItem.Enabled = !isExist;
            }
        }
Exemplo n.º 4
0
        private void RefreshControl()
        {
            ClsDatMotion clMotion = ClsSystem.GetSelectMotion();

            if (clMotion == null)
            {
                return;
            }

            int        inSelectFrameNo = ClsSystem.GetSelectFrameNo();
            int        inMaxFrameNum   = clMotion.GetMaxFrameNum();
            int        inSelectLineNo  = ClsSystem.GetSelectLineNo();
            ClsDatItem clItem          = clMotion.GetItemFromLineNo(inSelectLineNo);

            //以下、削除ボタン有効化設定
            bool isEnable = false;

            if (clItem != null)
            {
                if (clItem.mTypeItem == ClsDatItem.TYPE_ITEM.ELEM)
                {
                    isEnable = true;
                }
                else if (clItem.mTypeItem == ClsDatItem.TYPE_ITEM.OPTION)
                {
                    ClsDatOption clOption = clItem as ClsDatOption;
                    isEnable = clOption.IsRemoveOK();
                }
            }
            this.button_ItemRemove.Enabled = isEnable;

            //以下、アトリビュートウィンドウ設定
            if (this.mFormMain != null)
            {
                if (this.mFormMain.mFormAttribute != null)
                {
                    ClsDatElem clElem = ClsSystem.GetElemFromSelectLineNo();
                    this.mFormMain.mFormAttribute.Init(clElem, inSelectFrameNo, inMaxFrameNum);
                }
            }

            //以下、上ボタン有効化設定
            isEnable = false;
            if (clItem != null)
            {
                ClsDatElem clElem = null;
                if (clItem.mTypeItem == ClsDatItem.TYPE_ITEM.ELEM)
                {
                    clElem = clItem as ClsDatElem;
                    if (clElem.mElem == null)
                    {
                        isEnable = clMotion.CanMoveUp(clElem);
                    }
                    else
                    {
                        //isEnable = clElem.mElem.CanMoveUp(clElem);    //自分が長男かチェックする
                    }
                }

/*
 *              else if (clItem.mTypeItem == ClsDatItem.TYPE_ITEM.OPTION)
 *              {
 *                  ClsDatOption clOption = clItem as ClsDatOption;
 *                  clElem = clOption.mElem;
 * //                  isEnable = clElem.CanMoveUp(clOption);
 *              }
 */
            }
            this.button_ItemUp.Enabled = isEnable;

            //以下、下ボタン有効化設定
            isEnable = false;
            if (clItem != null)
            {
                ClsDatElem clElem = null;
                if (clItem.mTypeItem == ClsDatItem.TYPE_ITEM.ELEM)
                {
                    clElem = clItem as ClsDatElem;
                    if (clElem.mElem == null)
                    {
                        isEnable = clMotion.CanMoveDown(clElem);
                    }
                    else
                    {
                    }
                }

/*
 *              else if (clItem.mTypeItem == ClsDatItem.TYPE_ITEM.OPTION)
 *              {
 *                  ClsDatOption clOption = clItem as ClsDatOption;
 *                  clElem = clOption.mElem;
 * //                  isEnable = clElem.CanMoveDown(clOption);
 *              }
 */
            }
            this.button_ItemDown.Enabled = isEnable;
        }