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(); }
/// <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="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); } } }
public object mValue2; //値(何の値かはタイプに依存する Y座標など) /* * //以下、表示設定 * EnmTypeOption.DISPLAY * mValue1 = clParam.mDisplay * mValue2 = null * * //以下、座標設定 * EnmTypeOption.POSITION * mValue1 = clParam.mX * mValue2 = clParam.mY * * //以下、回転設定 * EnmTypeOption.ROTATION * mValue1 = clParam.mRZ * mValue2 = null * * //以下、スケール設定 * EnmTypeOption.SCALE * mValue1 = clParam.mSX * mValue2 = clParam.mSY * * //以下、オフセット設定 * EnmTypeOption.OFFSET * mValue1 = clParam.mCX * mValue2 = clParam.mCY * * //以下、反転設定 * EnmTypeOption.FLIP * mValue1 = clParam.mFlipH * mValue2 = clParam.mFlipV * * //以下、透明設定 * EnmTypeOption.TRANSPARENCY * mValue1 = clParam.mTrans * mValue2 = null * * //以下、カラー設定 * EnmTypeOption.COLOR * mValue1 = clParam.mColor * mValue2 = null * * //以下、ユーザーデータ設定 * EnmTypeOption.USER_DATA * mValue1 = clParam.mUserData * mValue2 = null */ /// <summary> /// コンストラクタ /// </summary> /// <param name="enTypeOption">オプションタイプ</param> /// <param name="inFrame">フレームNo</param> /// <param name="isEnable1">有効フラグ</param> /// <param name="isEnable2">有効フラグ</param> /// <param name="clTween1">トゥイーン1</param> /// <param name="clTween2">トゥイーン2</param> /// <param name="clValue1">値1</param> /// <param name="clValue2">値2</param> public ClsDatKeyFrame(EnmTypeOption enTypeOption, int inFrameNo, bool isEnable1, bool isEnable2, ClsDatTween clTween1, ClsDatTween clTween2, object clValue1, object clValue2) { this.mFrameNo = inFrameNo; this.mTypeOption = enTypeOption; this.mEnable1 = isEnable1; this.mEnable2 = isEnable2; this.mTween1 = clTween1; this.mTween2 = clTween2; this.mValue1 = clValue1; this.mValue2 = clValue2; }
/// <summary> /// デフォルトの親に影響を受けるかどうか /// </summary> /// <param name="clElem">親エレメント</param> /// <param name="enTypeOption">オプションタイプ</param> /// <returns>デフォルトの値</returns> public static bool GetDefaultParentFlag(ClsDatElem clElem, EnmTypeOption enTypeOption) { if (clElem == null) { return(false); } bool isParent = false; switch (enTypeOption) { case EnmTypeOption.NONE: isParent = false; break; case EnmTypeOption.DISPLAY: isParent = true; break; case EnmTypeOption.POSITION: isParent = true; break; case EnmTypeOption.ROTATION: isParent = true; break; case EnmTypeOption.SCALE: isParent = true; break; case EnmTypeOption.OFFSET: isParent = false; break; case EnmTypeOption.FLIP: isParent = true; break; case EnmTypeOption.TRANSPARENCY: isParent = true; break; case EnmTypeOption.COLOR: isParent = false; break; case EnmTypeOption.USER_DATA: isParent = false; break; } return(isParent); }
/// <summary> /// コントロールに表示するかチェックする処理 /// </summary> /// <param name="enType">オプション種別</param> /// <returns>表示フラグ</returns> public static bool IsDraw(EnmTypeOption enTypeOption) { if (enTypeOption == EnmTypeOption.NONE) { return(false); } if (enTypeOption == EnmTypeOption.DISPLAY) { return(false); //DISPLAYはエレメントとして描画するので、オプションとしては描画しない } return(true); }
private Dictionary <int, ClsDatKeyFrame> mDicKeyFrame; //キーはフレーム番号 値はキーフレーム管理クラス /// <summary> /// コンストラクタ /// </summary> /// <param name="clElemParent">親エレメント</param> /// <param name="enType">オプションタイプ</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> public ClsDatOption(ClsDatElem clElemParent, EnmTypeOption enTypeOption, bool isEnable1, bool isEnable2, ClsDatTween clTween1, ClsDatTween clTween2, object clValue1, object clValue2) { this.mTypeItem = TYPE_ITEM.OPTION; this.mElemParent = clElemParent; this.mTypeOption = enTypeOption; this.mDicKeyFrame = new Dictionary <int, ClsDatKeyFrame>(); //以下、0フレーム目にキーフレームを登録する処理(0フレーム目には必ずキーフレームが存在する) ClsDatKeyFrame clKeyFrame = new ClsDatKeyFrame(enTypeOption, 0, isEnable1, isEnable2, clTween1, clTween2, clValue1, clValue2); this.mDicKeyFrame.Add(0, clKeyFrame); }
/// <summary> /// オプションタイプから文字列に変更する処理 /// </summary> /// <param name="enTypeOption">オプションタイプ</param> /// <returns>オプションタイプの名称</returns> public static string CnvTypeOption2Name(EnmTypeOption enTypeOption) { string clName = ""; switch (enTypeOption) { case EnmTypeOption.NONE: case EnmTypeOption.DISPLAY: clName = ""; break; case EnmTypeOption.POSITION: clName = "Position"; break; case EnmTypeOption.ROTATION: clName = "Rotation"; break; case EnmTypeOption.SCALE: clName = "Scale"; break; case EnmTypeOption.OFFSET: clName = "Offset"; break; case EnmTypeOption.FLIP: clName = "Flip"; break; case EnmTypeOption.TRANSPARENCY: clName = "Transparency"; break; case EnmTypeOption.COLOR: clName = "Color"; break; case EnmTypeOption.USER_DATA: clName = "User data(text)"; break; default: break; } return(clName); }
/// <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="enTypeOption">オプション種別</param> /// <returns>削除可能フラグ</returns> public static bool IsRemoveOK(EnmTypeOption enTypeOption) { if (enTypeOption == EnmTypeOption.NONE) { return(false); } if (enTypeOption == EnmTypeOption.DISPLAY) { return(false); } if (enTypeOption == EnmTypeOption.POSITION) { return(false); } return(true); }