/// <summary> /// エレメント情報変更処理 /// </summary> /// <param name="clElem">変更対象となるエレメント</param> /// <param name="enTypeOption">オプションタイプ</param> /// <param name="inSelectFrameNo">フレーム番号</param> /// <param name="isExistKeyFrame">キーフレーム存在フラグ</param> /// <param name="isEnable1">有効フラグ1</param> /// <param name="isEnable2">有効フラグ2</param> /// <param name="clTween1">トゥイーン1</param> /// <param name="clTween2">トゥイーン2</param> /// <param name="clValue1">値1</param> /// <param name="clValue2">値2</param> private void ChangeElem(ClsDatElem clElem, EnmTypeOption enTypeOption, int inSelectFrameNo, bool isExistKeyFrame, bool isEnable1, bool isEnable2, ClsDatTween clTween1, ClsDatTween clTween2, object clValue1, object clValue2) { ClsDatOption clOption = null; if (inSelectFrameNo == 0) { clElem.SetOption(enTypeOption, isEnable1, isEnable2, clTween1, clTween2, clValue1, clValue2); } else { bool isExist = clElem.IsExistOption(enTypeOption); if (isExist) { clOption = clElem.GetOption(enTypeOption); } else { clValue1 = ClsParam.GetDefaultValue1(enTypeOption); clValue2 = ClsParam.GetDefaultValue2(enTypeOption); clElem.SetOption(enTypeOption, isEnable1, isEnable2, clTween1, clTween2, clValue1, clValue2); clOption = clElem.GetOption(enTypeOption); } if (isExistKeyFrame) { clOption.SetKeyFrame(inSelectFrameNo, isEnable1, isEnable2, clTween1, clTween2, clValue1, clValue2); //追加または更新 } else { clOption.RemoveKeyFrame(inSelectFrameNo); } } }
private void ColorPanel_Click(object sender, EventArgs e) { //PickUP ColorDialog ColorDialog dlg = new ColorDialog(); dlg.Color = this.button_C.BackColor; DialogResult enREsult = dlg.ShowDialog(); if (enREsult != DialogResult.OK) { return; } this.button_C.BackColor = dlg.Color; int inColor = dlg.Color.ToArgb(); inColor &= 0x00FFFFFF; textBox_C.Text = $"{inColor:X6}"; //RGB if (!this.mLocked) { ClsParam clParam = this.GetParam(); this.ChangeElemFromParam(clParam); } }
/// <summary> /// マトリクス設定処理 /// </summary> /// <param name="clParam">各パラメーター管理クラス</param> /// <param name="pflMatParent">親のマトリクス</param> public float[] SetElemMatrix(ClsParam clParam, float[] pflMatParent) { float[] pflMat = new float[16]; //以下、マトリクス初期化処理 Gl.glLoadIdentity(); //以下、親のマトリクス設定 Gl.glLoadMatrixf(pflMatParent); //以下、ローカル座標設定 float flX = clParam.mX; float flY = clParam.mY; Gl.glTranslatef(flX, flY, 0.0f); //以下、ローカル回転設定 float flRZ = clParam.mRZ; Gl.glRotatef(flRZ, 0.0f, 0.0f, 1.0f); //以下、ローカルスケール設定 float flSX = clParam.mSX; float flSY = clParam.mSY; Gl.glScalef(flSX, flSY, 1.0f); //以下、マトリクス取得処理 Gl.glGetFloatv(Gl.GL_MODELVIEW_MATRIX, pflMat); return(pflMat); }
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(); }
public string mUserData; //ユーザーデータ /// <summary> /// コンストラクタ /// </summary> public ClsParam() { this.mDisplayKeyFrame = false; this.mDisplay = (bool)ClsParam.GetDefaultValue(EnmTypeParam.DISPLAY); this.mPositionKeyFrame = false; this.mX = (float)ClsParam.GetDefaultValue(EnmTypeParam.POSITION_X); this.mY = (float)ClsParam.GetDefaultValue(EnmTypeParam.POSITION_Y); this.mRotationKeyFrame = false; this.mRZ = (float)ClsParam.GetDefaultValue(EnmTypeParam.ROTATION_Z); this.mScaleKeyFrame = false; this.mSX = (float)ClsParam.GetDefaultValue(EnmTypeParam.SCALE_X); this.mSY = (float)ClsParam.GetDefaultValue(EnmTypeParam.SCALE_Y); this.mOffsetKeyFrame = false; this.mCX = (float)ClsParam.GetDefaultValue(EnmTypeParam.OFFSET_X); this.mCY = (float)ClsParam.GetDefaultValue(EnmTypeParam.OFFSET_Y); this.mFlipKeyFrame = false; this.mFlipH = (bool)ClsParam.GetDefaultValue(EnmTypeParam.FLIP_HORIZONAL); this.mFlipV = (bool)ClsParam.GetDefaultValue(EnmTypeParam.FLIP_VERTICAL); this.mTransKeyFrame = false; this.mTrans = (int)ClsParam.GetDefaultValue(EnmTypeParam.TRANSPARENCY); this.mColorKeyFrame = false; this.mColor = (int)ClsParam.GetDefaultValue(EnmTypeParam.COLOR); this.mUserDataKeyFrame = false; this.mUserData = (string)ClsParam.GetDefaultValue(EnmTypeParam.USER_DATA); }
/// <summary> /// 読み込み処理 /// </summary> /// <param name="clXmlNode">xmlノード</param> public void Load(XmlNode clXmlNode) { XmlNodeList clListNode = clXmlNode.ChildNodes; string clTypeOption = ClsTool.GetStringFromXmlNodeList(clListNode, "TypeOption"); this.mTypeOption = (EnmTypeOption)Enum.Parse(typeof(EnmTypeOption), clTypeOption); //以下、各管理クラス作成処理 foreach (XmlNode clNode in clListNode) { if (!"KeyFrame".Equals(clNode.Name)) { continue; } bool isEnable1 = false; bool isEnable2 = false; object clValue1 = ClsParam.GetDefaultValue1(this.mTypeOption); object clValue2 = ClsParam.GetDefaultValue2(this.mTypeOption); ClsDatKeyFrame clDatKeyFrame = new ClsDatKeyFrame(this.mTypeOption, 0, isEnable1, isEnable2, null, null, clValue1, clValue2); clDatKeyFrame.Load(clNode); this.mDicKeyFrame[clDatKeyFrame.mFrameNo] = clDatKeyFrame; continue; } }
/// <summary> /// マテリアル設定 /// </summary> /// <param name="clParam"></param> public void SetMaterial(ClsParam clParam) { //以下、マテリアル色設定 float flAlpha = clParam.mTrans / 255.0f; Color stColor = Color.FromArgb(clParam.mColor); Gl.glColor4f(stColor.R / 255.0f, stColor.G / 255.0f, stColor.B / 255.0f, flAlpha); }
/// <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(); }
/// <summary> /// デフォルトの値2取得処理 /// </summary> /// <param name="enTypeOption">オプションタイプ</param> /// <returns>デフォルトの値2</returns> public static object GetDefaultValue2(EnmTypeOption enTypeOption) { object clValue = null; switch (enTypeOption) { case EnmTypeOption.NONE: clValue = null; break; case EnmTypeOption.DISPLAY: clValue = null; break; case EnmTypeOption.POSITION: clValue = ClsParam.GetDefaultValue(EnmTypeParam.POSITION_Y); break; case EnmTypeOption.ROTATION: clValue = null; break; case EnmTypeOption.SCALE: clValue = ClsParam.GetDefaultValue(EnmTypeParam.SCALE_Y); break; case EnmTypeOption.OFFSET: clValue = ClsParam.GetDefaultValue(EnmTypeParam.OFFSET_Y); break; case EnmTypeOption.FLIP: clValue = ClsParam.GetDefaultValue(EnmTypeParam.FLIP_VERTICAL); break; case EnmTypeOption.TRANSPARENCY: clValue = null; break; case EnmTypeOption.COLOR: clValue = null; break; case EnmTypeOption.USER_DATA: clValue = null; break; } return(clValue); }
/// <summary> /// プレビュー上のパーツの描画処理 /// </summary> /// <param name="clGL">OpenGLコンポーネント</param> /// <param name="inFrameNo">フレーム番号</param> /// <param name="inMaxFrameNum">フレーム数</param> public void DrawPreview(ComponentOpenGL clGL, int inFrameNo, int inMaxFrameNum) { int inCnt, inMax = this.mListElem.Count; for (inCnt = 0; inCnt < inMax; inCnt++) { //以下、マトリクス初期化処理 float[] pflMat = clGL.InitElemMatrix(); //以下、エレメント描画処理 ClsDatElem clElem = this.mListElem[inCnt]; ClsParam clParam = new ClsParam(); clElem.DrawPreview(clGL, inFrameNo, inMaxFrameNum, clParam, pflMat); } }
private void ToolStripMenuItem_AddKeyFrame_Click(object sender, EventArgs e) { int inIndex = (int)this.numericUpDown_NowFlame.Value; if (inIndex <= 0) { return; //0フレーム目には作成できない } ClsDatMotion clMotion = ClsSystem.GetSelectMotion(); if (clMotion == null) { return; } ClsDatOption clOption = ClsSystem.GetOptionFromSelectLineNo(); if (clOption == null) { return; } //以下、キーフレーム作成・更新処理 ClsDatElem clElem = clOption.mElemParent; bool isParentFlag = ClsParam.GetDefaultParentFlag(clElem.mElem, clOption.mTypeOption); //以下、現在の値を取得する処理 object clValue1 = clOption.GetValue1(inIndex); object clValue2 = clOption.GetValue2(inIndex); ClsDatKeyFrame clKeyFrame = new ClsDatKeyFrame(clOption.mTypeOption, inIndex, false, false, null, null, clValue1, clValue2); clOption.SetKeyFrame(inIndex, false, false, null, null, clValue1, clValue2); //存在していたら更新、存在していなかったら追加 //以下、コントロール更新処理 this.RefreshControl(); this.panel_Control.Refresh(); this.panel_Time.Refresh(); this.mFormMain.Refresh(); }
/// <summary> /// 初期化処理 /// </summary> /// <param name="clElem">選択中のエレメント</param> /// <param name="inSelectFrameNo">選択中のフレーム番号</param> /// <param name="inMaxFrameNum">フレーム数</param> public void Init(ClsDatElem clElem, int inSelectFrameNo, int inMaxFrameNum) { if (clElem == null) { this.Text = "Attribute"; this.groupBox_Param.Enabled = false; this.mSelectElem = null; this.mSelectFrameNo = 0; } else { this.Text = ClsTool.GetWindowName("Attribute", clElem, inSelectFrameNo); this.groupBox_Param.Enabled = true; this.mSelectElem = clElem; this.mSelectFrameNo = inSelectFrameNo; //以下、チェック状態の設定 if (!this.mLocked) { ClsParam clParam = clElem.GetParamNow(inSelectFrameNo, inMaxFrameNum); this.SetParam(clParam, inSelectFrameNo); } } }
/// <summary> /// フォームにパラメータをセットします /// </summary> /// <param name="clParam">パラメータ</param> /// <param name="inSelectFrameNo">選択中のフレーム番号</param> private void SetParam(ClsParam clParam, int inSelectFrameNo) { //変更終わるまでロックしないと毎回ChangeValueが発生してしまう this.mLocked = true; if (inSelectFrameNo == 0) { this.checkBox_DisplayKeyFrame.Enabled = false; this.checkBox_PositionKeyFrame.Enabled = false; this.checkBox_RotationKeyFrame.Enabled = false; this.checkBox_ScaleKeyFrame.Enabled = false; this.checkBox_FlipKeyFrame.Enabled = false; this.checkBox_TransKeyFrame.Enabled = false; this.checkBox_ColorKeyFrame.Enabled = false; this.checkBox_OffsetKeyFrame.Enabled = false; this.checkBox_UserDataKeyFrame.Enabled = false; } else { this.checkBox_DisplayKeyFrame.Enabled = true; this.checkBox_PositionKeyFrame.Enabled = true; } this.checkBox_DisplayKeyFrame.Checked = clParam.mDisplayKeyFrame; this.checkBox_Display.Checked = clParam.mDisplay; this.checkBox_PositionKeyFrame.Checked = clParam.mPositionKeyFrame; this.checkBox_TweenPositionX.Checked = clParam.mPositionXTween; this.button_TweenX.Image = (clParam.mTweenPositionX == null) ? null : clParam.mTweenPositionX.mImage; this.button_TweenX.Tag = clParam.mTweenPositionX; this.UDnumX.Value = (int)clParam.mX; this.checkBox_TweenPositionY.Checked = clParam.mPositionYTween; this.button_TweenY.Image = (clParam.mTweenPositionY == null) ? null : clParam.mTweenPositionY.mImage; this.button_TweenY.Tag = clParam.mTweenPositionY; this.UDnumY.Value = (int)clParam.mY; this.checkBox_RotationKeyFrame.Checked = clParam.mRotationKeyFrame; this.checkBox_TweenRotation.Checked = clParam.mRotationTween; this.button_TweenRZ.Image = (clParam.mTweenRotation == null) ? null : clParam.mTweenRotation.mImage; this.button_TweenRZ.Tag = clParam.mTweenRotation; this.UDnumRot.Value = (decimal)clParam.mRZ; this.checkBox_ScaleKeyFrame.Checked = clParam.mScaleKeyFrame; this.checkBox_TweenScaleX.Checked = clParam.mScaleXTween; this.button_TweenSX.Image = (clParam.mTweenScaleX == null) ? null : clParam.mTweenScaleX.mImage; this.button_TweenSX.Tag = clParam.mTweenScaleX; this.UDnumSX.Value = (decimal)clParam.mSX; this.checkBox_TweenScaleY.Checked = clParam.mScaleYTween; this.button_TweenSY.Image = (clParam.mTweenScaleY == null) ? null : clParam.mTweenScaleY.mImage; this.button_TweenSY.Tag = clParam.mTweenScaleY; this.UDnumSY.Value = (decimal)clParam.mSY; this.checkBox_OffsetKeyFrame.Checked = clParam.mOffsetKeyFrame; this.checkBox_TweenOffsetX.Checked = clParam.mOffsetXTween; this.button_TweenCX.Image = (clParam.mTweenOffsetX == null) ? null : clParam.mTweenOffsetX.mImage; this.button_TweenCX.Tag = clParam.mTweenOffsetX; this.UDnumXoff.Value = (int)clParam.mCX; this.checkBox_TweenOffsetY.Checked = clParam.mOffsetYTween; this.button_TweenCY.Image = (clParam.mTweenOffsetY == null) ? null : clParam.mTweenOffsetY.mImage; this.button_TweenCY.Tag = clParam.mTweenOffsetY; this.UDnumYoff.Value = (int)clParam.mCY; this.checkBox_FlipKeyFrame.Checked = clParam.mFlipKeyFrame; this.checkBox_FlipH.Checked = clParam.mFlipH; this.checkBox_FlipV.Checked = clParam.mFlipV; this.checkBox_TransKeyFrame.Checked = clParam.mTransKeyFrame; this.checkBox_TweenTrans.Checked = clParam.mTransTween; this.button_TweenT.Image = (clParam.mTweenTrans == null) ? null : clParam.mTweenTrans.mImage; this.button_TweenT.Tag = clParam.mTweenTrans; this.UDnumT.Value = (decimal)clParam.mTrans; this.checkBox_ColorKeyFrame.Checked = clParam.mColorKeyFrame; this.checkBox_TweenColor.Checked = clParam.mColorTween; this.button_TweenC.Image = (clParam.mTweenColor == null) ? null : clParam.mTweenColor.mImage; this.button_TweenC.Tag = clParam.mTweenColor; this.textBox_C.Text = $"{clParam.mColor:X6}"; this.checkBox_UserDataKeyFrame.Checked = clParam.mUserDataKeyFrame; this.textBox_UT.Text = clParam.mUserData; //以下、リフレッシュ処理 this.Refresh(); //変更完了 this.mLocked = false; }
/// <summary> /// 指定フレームの値2を取得する処理 /// </summary> /// <param name="inFrameNo">フレームNo</param> /// <returns>値2</returns> public object GetValue2(int inFrameNo) { ClsDatMotion clMotion = ClsSystem.GetSelectMotion(); if (clMotion == null) { goto RETURN_DEFAULT2; } int inMaxFrameNum = clMotion.GetMaxFrameNum(); int inFrameNoBefore = 0; int inFrameNoAfter = 0; this.GetKeyFrameNo(inFrameNo, inMaxFrameNum, out inFrameNoBefore, out inFrameNoAfter); //以下、キーフレーム存在チェック bool isExist = this.mDicKeyFrame.ContainsKey(inFrameNoBefore); if (!isExist) { goto RETURN_DEFAULT2; } isExist = this.mDicKeyFrame.ContainsKey(inFrameNoAfter); if (!isExist) { goto RETURN_DEFAULT2; } //以下、キーフレーム取得処理 ClsDatKeyFrame clKeyFrameBefore = this.mDicKeyFrame[inFrameNoBefore]; if (clKeyFrameBefore == null) { goto RETURN_DEFAULT2; } if (clKeyFrameBefore.mTween2 == null) { object clValueTmp = clKeyFrameBefore.mValue2; return(clValueTmp); } ClsDatKeyFrame clKeyFrameAfter = this.mDicKeyFrame[inFrameNoAfter]; if (clKeyFrameAfter == null) { goto RETURN_DEFAULT2; } //以下、キーフレームの値取得処理 object clValueBefore = clKeyFrameBefore.mValue2; if (clValueBefore == null) { goto RETURN_DEFAULT2; } if (clValueBefore is bool && clValueBefore is string) { return(clValueBefore); } object clValueAfter = clKeyFrameAfter.mValue2; if (clValueAfter == null) { goto RETURN_DEFAULT2; } if (clValueAfter is bool && clValueAfter is string) { goto RETURN_DEFAULT2; } //以下、現在フレームの値(トゥイーン込みの)計算処理 if (clValueBefore is int && clValueAfter is int) { //Tweenを見て値を分割する処理 } else if (clValueBefore is float && clValueAfter is float) { //Tweenを見て値を分割する処理 } RETURN_DEFAULT2: object clValue = ClsParam.GetDefaultValue2(this.mTypeOption); return(clValue); }
/// <summary> /// 指定フレームの値1を取得する処理 /// </summary> /// <param name="inFrameNo">フレームNo</param> /// <returns>値1</returns> public object GetValue1(int inFrameNo) { ClsDatMotion clMotion = ClsSystem.GetSelectMotion(); if (clMotion == null) { goto RETURN_DEFAULT1; } int inMaxFrameNum = clMotion.GetMaxFrameNum(); int inFrameNoBefore = 0; int inFrameNoAfter = 0; this.GetKeyFrameNo(inFrameNo, inMaxFrameNum, out inFrameNoBefore, out inFrameNoAfter); ClsDatKeyFrame clKeyFrameBefore = this.mDicKeyFrame[inFrameNoBefore]; if (clKeyFrameBefore == null) { goto RETURN_DEFAULT1; } if (clKeyFrameBefore.mTween1 == null) { object clValueTmp = clKeyFrameBefore.mValue1; return(clValueTmp); } bool isExist = this.mDicKeyFrame.ContainsKey(inFrameNoAfter); if (!isExist) { goto RETURN_DEFAULT1; } ClsDatKeyFrame clKeyFrameAfter = this.mDicKeyFrame[inFrameNoAfter]; if (clKeyFrameAfter == null) { goto RETURN_DEFAULT1; } object clValueBefore = clKeyFrameBefore.mValue1; if (clValueBefore == null) { goto RETURN_DEFAULT1; } if (clValueBefore is bool && clValueBefore is string) { return(clValueBefore); } object clValueAfter = clKeyFrameAfter.mValue1; if (clValueAfter == null) { goto RETURN_DEFAULT1; } if (clValueAfter is bool && clValueAfter is string) { goto RETURN_DEFAULT1; } //以下、現在フレームの値(トゥイーン込みの)計算処理 if (clValueBefore is int && clValueAfter is int) { //Tweenを見て値を分割する処理 //clKeyFrameBefore.mTween1.GetRate //←中でその場で256の重みリストを作成してない? //もしそうなら、そのリストをメンバ内に保持するようにする } else if (clValueBefore is float && clValueAfter is float) { //Tweenを見て値を分割する処理 //clKeyFrameBefore.mTween1.GetRate //←中でその場で256の重みリストを作成してない? //もしそうなら、そのリストをメンバ内に保持するようにする } RETURN_DEFAULT1: object clValue = ClsParam.GetDefaultValue1(this.mTypeOption); return(clValue); }
/// <summary> /// フォーム上パラメータを取得します /// </summary> public ClsParam GetParam() { //以下、パラメーター取得処理 ClsParam clParam = new ClsParam(); clParam.mName = this.mSelectElem.mName; clParam.mDisplayKeyFrame = this.checkBox_DisplayKeyFrame.Checked; clParam.mDisplay = this.checkBox_Display.Checked; clParam.mPositionKeyFrame = this.checkBox_PositionKeyFrame.Checked; clParam.mPositionXTween = this.checkBox_TweenPositionX.Checked; clParam.mTweenPositionX = this.button_TweenX.Tag as ClsDatTween; clParam.mX = (int)this.UDnumX.Value; clParam.mPositionYTween = this.checkBox_TweenPositionY.Checked; clParam.mTweenPositionY = this.button_TweenY.Tag as ClsDatTween; clParam.mY = (int)this.UDnumY.Value; clParam.mRotationKeyFrame = this.checkBox_RotationKeyFrame.Checked; clParam.mRotationTween = this.checkBox_TweenRotation.Checked; clParam.mTweenRotation = this.button_TweenRZ.Tag as ClsDatTween; clParam.mRZ = (float)this.UDnumRot.Value; clParam.mScaleKeyFrame = this.checkBox_ScaleKeyFrame.Checked; clParam.mScaleXTween = this.checkBox_TweenScaleX.Checked; clParam.mTweenScaleX = this.button_TweenSX.Tag as ClsDatTween; clParam.mSX = (float)this.UDnumSX.Value; clParam.mScaleYTween = this.checkBox_TweenScaleY.Checked; clParam.mTweenScaleY = this.button_TweenSY.Tag as ClsDatTween; clParam.mSY = (float)this.UDnumSY.Value; clParam.mOffsetKeyFrame = this.checkBox_OffsetKeyFrame.Checked; clParam.mOffsetXTween = this.checkBox_TweenOffsetX.Checked; clParam.mTweenOffsetX = this.button_TweenCX.Tag as ClsDatTween; clParam.mCX = (int)this.UDnumXoff.Value; clParam.mOffsetYTween = this.checkBox_TweenOffsetY.Checked; clParam.mTweenOffsetY = this.button_TweenCY.Tag as ClsDatTween; clParam.mCY = (int)this.UDnumYoff.Value; clParam.mFlipKeyFrame = this.checkBox_FlipKeyFrame.Checked; clParam.mFlipH = this.checkBox_FlipH.Checked; clParam.mFlipV = this.checkBox_FlipV.Checked; clParam.mTransKeyFrame = this.checkBox_TransKeyFrame.Checked; clParam.mTransTween = this.checkBox_TweenTrans.Checked; clParam.mTweenTrans = this.button_TweenT.Tag as ClsDatTween; clParam.mTrans = (int)this.UDnumT.Value; clParam.mColorKeyFrame = this.checkBox_ColorKeyFrame.Checked; clParam.mColorTween = this.checkBox_TweenColor.Checked; clParam.mTweenColor = this.button_TweenC.Tag as ClsDatTween; clParam.mColor = this.button_C.BackColor.ToArgb() & 0x00FFFFFF; clParam.mUserDataKeyFrame = this.checkBox_UserDataKeyFrame.Checked; clParam.mUserData = this.textBox_UT.Text; return(clParam); }
private void ColorCode_TextChanged(object sender, EventArgs e) { //PreViewColor string clTextSrc = textBox_C.Text; if (string.IsNullOrEmpty(textBox_C.Text)) { clTextSrc = ""; } if (clTextSrc.Length > 6) { clTextSrc = clTextSrc.Substring(0, 6); textBox_C.Text = clTextSrc; } //以下、色テキスト設定処理 clTextSrc = clTextSrc.ToUpper(); int inCnt; string clTextDst = ""; for (inCnt = 0; inCnt < clTextSrc.Length; inCnt++) { char chChar = clTextSrc[inCnt]; bool isOK = false; if (chChar == '0') { isOK = true; } if (chChar == '1') { isOK = true; } if (chChar == '2') { isOK = true; } if (chChar == '3') { isOK = true; } if (chChar == '4') { isOK = true; } if (chChar == '5') { isOK = true; } if (chChar == '6') { isOK = true; } if (chChar == '7') { isOK = true; } if (chChar == '8') { isOK = true; } if (chChar == '9') { isOK = true; } if (chChar == 'A') { isOK = true; } if (chChar == 'B') { isOK = true; } if (chChar == 'C') { isOK = true; } if (chChar == 'D') { isOK = true; } if (chChar == 'E') { isOK = true; } if (chChar == 'F') { isOK = true; } if (!isOK) { continue; } clTextDst += clTextSrc[inCnt]; } string clTextColor = clTextDst.PadLeft(6, '0'); //以下、色設定処理 string clR = clTextColor.Substring(0, 2); int inR = Convert.ToInt32(clR, 16); string clG = clTextColor.Substring(2, 2); int inG = Convert.ToInt32(clG, 16); string clB = clTextColor.Substring(4, 2); int inB = Convert.ToInt32(clB, 16); this.button_C.BackColor = Color.FromArgb(255, inR, inG, inB); if (!this.mLocked) { ClsParam clParam = this.GetParam(); this.ChangeElemFromParam(clParam); } }
/// <summary> /// 各コントロールが変更になったら呼ばれる関数 /// </summary> /// <param name="sender">コントロール</param> /// <param name="e">イベント引数</param> private void Param_ValueChanged(object sender, EventArgs e) { if (this.mSelectFrameNo == 0) { this.checkBox_DisplayKeyFrame.Checked = true; this.checkBox_PositionKeyFrame.Checked = true; this.checkBox_RotationKeyFrame.Checked = true; this.checkBox_ScaleKeyFrame.Checked = true; this.checkBox_OffsetKeyFrame.Checked = true; this.checkBox_FlipKeyFrame.Checked = true; this.checkBox_TransKeyFrame.Checked = true; this.checkBox_ColorKeyFrame.Checked = true; this.checkBox_UserDataKeyFrame.Checked = true; } if (!this.mLocked) { ClsParam clParam = this.GetParam(); this.ChangeElemFromParam(clParam); } //以下、表示設定 bool isCheckKeyFrame = this.checkBox_DisplayKeyFrame.Checked; this.label_Display.Enabled = isCheckKeyFrame; this.checkBox_Display.Enabled = isCheckKeyFrame; //以下、座標設定 isCheckKeyFrame = this.checkBox_PositionKeyFrame.Checked; this.label_X.Enabled = isCheckKeyFrame; this.label_Y.Enabled = isCheckKeyFrame; this.UDnumX.Enabled = isCheckKeyFrame; this.UDnumY.Enabled = isCheckKeyFrame; this.checkBox_TweenPositionX.Enabled = isCheckKeyFrame; this.checkBox_TweenPositionY.Enabled = isCheckKeyFrame; this.button_TweenX.Enabled = this.checkBox_TweenPositionX.Checked; this.button_TweenY.Enabled = this.checkBox_TweenPositionY.Checked; //以下、回転設定 isCheckKeyFrame = this.checkBox_RotationKeyFrame.Checked; this.checkBox_RotationKeyFrame.Enabled = (this.mSelectFrameNo != 0); this.label_RZ.Enabled = (isCheckKeyFrame); this.UDnumRot.Enabled = (isCheckKeyFrame); this.checkBox_TweenRotation.Enabled = (isCheckKeyFrame); this.button_TweenRZ.Enabled = this.checkBox_TweenRotation.Checked; //以下、スケール設定 isCheckKeyFrame = this.checkBox_ScaleKeyFrame.Checked; this.checkBox_ScaleKeyFrame.Enabled = (this.mSelectFrameNo != 0); this.label_SX.Enabled = (isCheckKeyFrame); this.label_SY.Enabled = (isCheckKeyFrame); this.UDnumSX.Enabled = (isCheckKeyFrame); this.UDnumSY.Enabled = (isCheckKeyFrame); this.checkBox_TweenScaleX.Enabled = (isCheckKeyFrame); this.checkBox_TweenScaleY.Enabled = (isCheckKeyFrame); this.button_TweenSX.Enabled = this.checkBox_TweenScaleX.Checked; this.button_TweenSY.Enabled = this.checkBox_TweenScaleY.Checked; //以下、オフセット設定 isCheckKeyFrame = this.checkBox_OffsetKeyFrame.Checked; this.checkBox_OffsetKeyFrame.Enabled = (this.mSelectFrameNo != 0); this.label_CX.Enabled = (isCheckKeyFrame); this.label_CY.Enabled = (isCheckKeyFrame); this.UDnumXoff.Enabled = (isCheckKeyFrame); this.UDnumYoff.Enabled = (isCheckKeyFrame); this.checkBox_TweenOffsetX.Enabled = (isCheckKeyFrame); this.checkBox_TweenOffsetY.Enabled = (isCheckKeyFrame); this.button_TweenCX.Enabled = this.checkBox_TweenOffsetX.Checked; this.button_TweenCY.Enabled = this.checkBox_TweenOffsetY.Checked; //以下、反転設定 isCheckKeyFrame = this.checkBox_FlipKeyFrame.Checked; this.checkBox_FlipKeyFrame.Enabled = (this.mSelectFrameNo != 0); this.label_FlipH.Enabled = (isCheckKeyFrame); this.label_FlipV.Enabled = (isCheckKeyFrame); this.checkBox_FlipH.Enabled = (isCheckKeyFrame); this.checkBox_FlipV.Enabled = (isCheckKeyFrame); //以下、透明値設定 isCheckKeyFrame = this.checkBox_TransKeyFrame.Checked; this.checkBox_TransKeyFrame.Enabled = (this.mSelectFrameNo != 0); this.label_T.Enabled = (isCheckKeyFrame); this.UDnumT.Enabled = (isCheckKeyFrame); this.checkBox_TweenTrans.Enabled = (isCheckKeyFrame); this.button_TweenT.Enabled = this.checkBox_TweenTrans.Checked; //以下、色設定 isCheckKeyFrame = this.checkBox_ColorKeyFrame.Checked; this.checkBox_ColorKeyFrame.Enabled = (this.mSelectFrameNo != 0); this.label_C.Enabled = (isCheckKeyFrame); this.button_C.Enabled = (isCheckKeyFrame); this.textBox_C.Enabled = (isCheckKeyFrame); this.checkBox_TweenColor.Enabled = (isCheckKeyFrame); this.button_TweenC.Enabled = this.checkBox_TweenColor.Checked; //以下、ユーザーデータ設定 isCheckKeyFrame = this.checkBox_UserDataKeyFrame.Checked; this.checkBox_UserDataKeyFrame.Enabled = (this.mSelectFrameNo != 0); this.label_UT.Enabled = (isCheckKeyFrame); this.textBox_UT.Enabled = (isCheckKeyFrame); }