Example #1
0
        /// <summary>
        /// mObjUDFrameNo_ValueChanged(), mObjHSFrame_ValueChanged()から使用
        /// </summary>
        private void ChangedFrameNum()
        {
            if (m_bInitializeing || mObjUDFrameNo.Value == mObjHSFrame.Value)
            {
                return;
            }

            ImageRect rIF = null;

            //mObjBtnRightAdd.Enabled = false;
            //objLBRightAdd.Enabled = false;
            //mObjBtnLeftAdd.Enabled = false;
            //objLBLeftAdd.Enabled = false;
            //
            objLBWait.Enabled  = true;
            mObjUDWait.Enabled = true;

            if (mObjUDFrameNo.Value != mObjHSFrame.Value)
            {
                mObjUDFrameNo.Value = mObjHSFrame.Value;
                //this.ChengeAnmFrams();
                mObjUDWait.Value = m_rAR.aARF[mObjHSFrame.Value].wait;
            }
            //mObjXNAScreen.SetBackGroudColorChange(true);
            //
            AnimationRectFrame rTmp = m_rAR.aARF[mObjHSFrame.Value];

            rIF = m_com.D2Stage.FindRectFromIndex(rTmp.imageFileNo);
            //mObjXNAScreen.SetImgRect(rIF, rTmp.imageRectNo);
            mObjLBFileNameOut.Text = m_com.D2Stage.RectFilePathFromIndex(rTmp.imageFileNo);
            mObjLBRectNoOut.Text   = rTmp.imageRectNo + "";
        }
Example #2
0
        /// <summary>
        /// 現在のフレームを削除
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void mObjBtnDelete_Click(object sender, EventArgs e)
        {
            if (m_rAR == null)
            {
                return;
            }
            if (m_rAR.FrameCount == 0)
            {
                return;
            }

            AnimationRectFrame rARF = null;
            ImageRect          rIF  = null;
            int target = mObjHSFrame.Value;

            // リストビューに反映
            if (m_rAR.FrameCount == 1)
            {
                mObjLFramePos.Text    = "--";
                mObjHSFrame.Maximum   = 0;
                mObjUDFrameNo.Maximum = 0;
                mObjHSFrame.Value     = 0;
                mObjLVRECT.Items[m_SelectAnimaRectNo].SubItems[1].Text = "0";
                mObjLBFileNameOut.Text = "----";
                mObjLBRectNoOut.Text   = "--";
                mObjBtnDelete.Enabled  = false;
                objLBDelete.Enabled    = false;
                mObjUDWait.Enabled     = false;
                //mObjXNAScreen.SetImgRectEmpty();
            }
            else
            {
                if (target != 0)
                {
                    rARF = m_rAR.aARF[target - 1];
                    mObjHSFrame.Value -= 1;
                }
                else
                {
                    rARF = m_rAR.aARF[target + 1];
                }

                mObjLFramePos.Text     = (m_rAR.FrameCount - 1) + "";
                mObjHSFrame.Maximum   -= 1;
                mObjUDFrameNo.Maximum -= 1;
                mObjLVRECT.Items[m_SelectAnimaRectNo].SubItems[1].Text = (m_rAR.FrameCount - 1) + "";
                rIF = m_com.D2Stage.FindRectFromIndex(rARF.imageFileNo);
                //mObjXNAScreen.SetImgRect(rIF, rARF.imageRectNo);
                mObjLBFileNameOut.Text = m_com.D2Stage.RectFilePathFromIndex(rARF.imageFileNo);
                mObjLBRectNoOut.Text   = rARF.imageRectNo + "";
            }

            // RECTイメージ削除
            m_rAR.Del(target);
        }
Example #3
0
        /// <summary>
        /// mObjBtnRightAdd_Click(), mObjBtnLeftAdd_Click()
        /// 右または左へのフレーム追加
        /// </summary>
        /// <param name="nLR"></param>
        private bool LR_FrameAdd(int nLR)
        {
            mObjBtnRightAdd.Enabled = false;
            objLBRightAdd.Enabled   = false;
            mObjBtnLeftAdd.Enabled  = false;
            objLBLeftAdd.Enabled    = false;

            mObjUDFrameNo.Enabled = true;
            mObjHSFrame.Enabled   = true;
            //
            objLBWait.Enabled  = true;
            mObjUDWait.Enabled = true;
            // 選択解除
            if (mObjLVImageRectInfo.SelectedItems.Count > 0)
            {
                mObjLVImageRectInfo.SelectedItems[0].Selected = false;
            }
            //mObjLVImageRectInfo.SelectedItems.Clear();



            // アニメーション
            AnimationRectFrame tlARF = new AnimationRectFrame();

            tlARF.wait        = 1;
            tlARF.imageFileNo = (short)m_imageFileNo;
            tlARF.imageRectNo = (short)m_imageRectNo;
            if (nLR == 1)
            {   // 左
                m_rAR.aARF.Insert(mObjHSFrame.Value, tlARF);
            }
            else
            {
                // 右
                int n = mObjHSFrame.Value + 1;
                if (m_rAR.FrameCount == n || m_rAR.FrameCount == 0)
                {
                    m_rAR.aARF.Add(tlARF);
                }
                else
                {
                    m_rAR.aARF.Insert(n, tlARF);
                }
            }
            int i = m_rAR.FrameCount;

            // 削除ボタンの有効
            if (i > 1)
            {
                mObjBtnDelete.Enabled = true;
                objLBDelete.Enabled   = true;
            }
            // 最大値の変更
            mObjUDFrameNo.Maximum = i - 1;
            mObjHSFrame.Maximum   = i - 1;
            // フレーム数の表示再設定
            mObjLFramePos.Text = "" + i;
            if (nLR == 0 && i > 1)
            {
                // 右
                //mObjUDFrameNo.Value += 1;
                mObjHSFrame.Value += 1;
            }

            mObjUDWait.Value = m_rAR.aARF[mObjHSFrame.Value].wait;
            // リストビューに反映
            mObjLVRECT.Items[m_SelectAnimaRectNo].SubItems[1].Text = m_rAR.FrameCount + "";
            //
            m_rIF = m_com.D2Stage.FindRectFromIndex(tlARF.imageFileNo);
            //mObjXNAScreen.SetImgRect(m_rIF, tlARF.imageRectNo);
            mObjLBFileNameOut.Text = m_com.D2Stage.RectFilePathFromIndex(tlARF.imageFileNo);
            mObjLBRectNoOut.Text   = tlARF.imageRectNo + "";
            return(true);
        }
Example #4
0
        /// <summary>
        /// アニメーションリストをダブルクリックした
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void mObjLVRECT_DoubleClick(object sender, EventArgs e)
        {
            Point eM = mObjLVRECT.PointToClient(MousePosition);

            ListViewItem item = mObjLVRECT.GetItemAt(eM.X, eM.Y);

            if (item != null)
            {
                m_bInitializeing = true;

                this.BasicFormInit();
                m_SelectAnimaRectNo = int.Parse(item.Text);
                // TABメニュー移動
                mObjTab01.SelectedIndex = 1;
                m_rAR = m_raAnimaRect[m_SelectAnimaRectNo];
                mObjGBoxAEdit.Enabled = true;
                //
                mObjLFramePos.Text = m_rAR.FrameCount + "";

                // フレームが存在しないか
                if (m_rAR.FrameCount == 0)
                {
                    //
                    mObjBtnRightAdd.Enabled = false;
                    objLBRightAdd.Enabled   = false;
                    mObjBtnLeftAdd.Enabled  = false;
                    objLBLeftAdd.Enabled    = false;
                    mObjBtnDelete.Enabled   = false;
                    objLBDelete.Enabled     = false;

                    objLBWait.Enabled  = false;
                    mObjUDWait.Enabled = false;
                    //
                    mObjLBFileNameOut.Text    = "----";
                    mObjLBFileName.Enabled    = false;
                    mObjLBFileNameOut.Enabled = false;
                    mObjLBRectNoOut.Text      = "--";
                    mObjLBRectNo.Enabled      = false;
                    mObjLBRectNoOut.Enabled   = false;


                    mObjUDFrameNo.Enabled = false;
                    mObjHSFrame.Enabled   = false;
                    ////mObjXNAScreen.SetImgRectEmpty();
                }
                else
                {
                    // 0フレーム選択状態
                    mObjBtnRightAdd.Enabled = false;
                    objLBRightAdd.Enabled   = false;
                    mObjBtnLeftAdd.Enabled  = false;
                    objLBLeftAdd.Enabled    = false;

                    objLBWait.Enabled  = true;
                    mObjUDWait.Enabled = true;
                    //
                    mObjLBFileName.Enabled    = true;
                    mObjLBFileNameOut.Enabled = true;
                    mObjLBRectNo.Enabled      = true;
                    mObjLBRectNoOut.Enabled   = true;

                    mObjUDFrameNo.Enabled = true;
                    mObjHSFrame.Enabled   = true;

                    mObjUDFrameNo.Maximum = m_rAR.FrameCount - 1;
                    mObjHSFrame.Maximum   = m_rAR.FrameCount - 1;
                    AnimationRectFrame rTmp = m_rAR.aARF[0];
                    m_rIF = m_com.D2Stage.FindRectFromIndex(rTmp.imageFileNo);
                    //mObjXNAScreen.SetImgRect(m_rIF, rTmp.imageRectNo);
                    mObjLBFileNameOut.Text = m_com.D2Stage.RectFilePathFromIndex((int)rTmp.imageFileNo);
                    mObjLBRectNoOut.Text   = rTmp.imageRectNo + "";
                }

                m_bInitializeing = false;
            }
        }