Example #1
0
        private string GetSectionChar(CProgressSection cProgressSection)
        {
            string ret = "0";

            if (cProgressSection.bIsAttempted)
            {
                if (cProgressSection.nChipCount > 0)
                {
                    if (cProgressSection.nHitCount == cProgressSection.nChipCount)
                    {
                        ret = "2";
                    }
                    else
                    {
                        ret = "1";
                    }
                }
                else
                {
                    //TODO: May need to check for nHitCount == nChipCount here too
                    ret = "3";
                }
            }

            return(ret);
        }
Example #2
0
        private void tプログレス配列から区間情報を設定する(char[] arrプログレス)
        {
            if (arrプログレス.Length == nSectionIntervalCount)
            {
                _ = nHeight / nSectionIntervalCount;
                for (int i = 0; i < nSectionIntervalCount; i++)
                {
                    CProgressSection cSection = listProgressSection[(int)epartプレイ楽器][i];

                    /* AL definition
                     *
                     * '0': No chips (Yellow)
                     * '1': Has chips with some misses (Blue)
                     * '2': Has chips with no misses (Yellow)
                     *
                     * to be changed to
                     *
                     * '0': Section Not attempted (Black)
                     * '1': Has chips with some misses (Blue)
                     * '2': Has chips with no misses (Yellow)
                     * '3': No chips aka Free Pass (Yellow)
                     *
                     */
                    cSection.bIsAttempted = arrプログレス[i] != '0';
                    cSection.nChipCount   = ((arrプログレス[i] == '1' || arrプログレス[i] == '2') ? 1 : 0);
                    cSection.nHitCount    = ((arrプログレス[i] == '2') ? 1 : 0);
                    _ = (double)n楽器毎のチップ数基準値[(int)epartプレイ楽器] / (double)nブロック最大数 / (double)nSectionIntervalCount;
                    int num = ((cSection.nChipCount > 0) ? nブロック最大数 : 0);
                    cSection.rectDrawingFrame.Width = num * (nWidth / nブロック最大数);
                }
            }
        }
Example #3
0
        public string GetScoreIniString(EInstrumentPart inst)
        {
            string text = "";

            for (int i = 0; i < nSectionIntervalCount; i++)
            {
                CProgressSection c区間 = listProgressSection[(int)inst][i];
                //text += ((c区間.nChipCount > 0) ? ((c区間.nHitCount == c区間.nChipCount) ? "2" : "1") : "0");
                text += GetSectionChar(c区間);
            }
            return(text);
        }
Example #4
0
 public void t演奏記録から区間情報を設定する(STDGBVALUE <CScoreIni.CPerformanceEntry> stPerformanceEntry, EInstrumentPart eInstrumentPart)
 {
     for (EInstrumentPart ePart = EInstrumentPart.DRUMS; ePart <= EInstrumentPart.BASS; ePart++)
     {
         for (int i = 0; i < nSectionIntervalCount; i++)
         {
             CProgressSection c区間 = listProgressSection[(int)ePart][i];
             c区間.nChipCount             = 0;
             c区間.nHitCount              = 0;
             c区間.rectDrawingFrame.Width = 0;
         }
     }
     epartプレイ楽器 = eInstrumentPart;            //CDTXMania.stageSongSelection.tオートを参考にこれからプレイするであろうパートを推測する();
     if (epartプレイ楽器 >= EInstrumentPart.DRUMS && epartプレイ楽器 <= EInstrumentPart.BASS && stPerformanceEntry[(int)epartプレイ楽器] != null)
     {
         char[] arrプログレス = stPerformanceEntry[(int)epartプレイ楽器].strProgress.ToCharArray();
         tプログレス配列から区間情報を設定する(arrプログレス);
     }
 }
Example #5
0
        public void t選択曲が変更された()
        {
            if (base.bNotActivated)
            {
                return;
            }
            for (EInstrumentPart ePart = EInstrumentPart.DRUMS; ePart <= EInstrumentPart.BASS; ePart++)
            {
                for (int i = 0; i < nSectionIntervalCount; i++)
                {
                    CProgressSection c区間 = listProgressSection[(int)ePart][i];
                    c区間.nChipCount             = 0;
                    c区間.nHitCount              = 0;
                    c区間.rectDrawingFrame.Width = 0;
                }
            }
            CScore r現在選択中のスコア = CDTXMania.stageSongSelection.rSelectedScore;

            if (r現在選択中のスコア != null)
            {
                //Use config.ini Drums / Guitar enabled to decide
                epartプレイ楽器 = EInstrumentPart.UNKNOWN;
                if (CDTXMania.ConfigIni.bDrumsEnabled)
                {
                    epartプレイ楽器 = EInstrumentPart.DRUMS;
                }
                else
                {
                    epartプレイ楽器 = EInstrumentPart.GUITAR;
                    if (CDTXMania.ConfigIni.bIsSwappedGuitarBass)
                    {
                        epartプレイ楽器 = EInstrumentPart.BASS;
                    }
                }
                //epartプレイ楽器 = CDTXMania.stageSongSelection.tオートを参考にこれからプレイするであろうパートを推測する();
                //epartプレイ楽器 = CDTXMania.ConfigIni.GetFlipInst(epartプレイ楽器);
                if (epartプレイ楽器 >= EInstrumentPart.DRUMS && epartプレイ楽器 <= EInstrumentPart.BASS && r現在選択中のスコア.SongInformation.progress[(int)epartプレイ楽器] != null)
                {
                    char[] arrプログレス = r現在選択中のスコア.SongInformation.progress[(int)epartプレイ楽器].ToCharArray();
                    tプログレス配列から区間情報を設定する(arrプログレス);
                }
            }
        }
Example #6
0
 public void t表示レイアウトを設定する(int 本体x, int 本体y, int グラフ部w, int グラフ部h)
 {
     if (!b演奏画面以外からの呼び出し)
     {
         return;
     }
     nWidth  = グラフ部w;
     nHeight = グラフ部h;
     tサイズが絡むテクスチャの生成();
     for (EInstrumentPart ePart = EInstrumentPart.DRUMS; ePart <= EInstrumentPart.BASS; ePart++)
     {
         p表示位置[(int)ePart] = new Point(本体x, 本体y);
         int y = nHeight;
         for (int i = 0; i < nSectionIntervalCount; i++)
         {
             CProgressSection c区間 = listProgressSection[(int)ePart][i];
             c区間.rectDrawingFrame.Y      = (int)Math.Round((double)nHeight - ((double)i + 1.0) * (double)nHeight / (double)nSectionIntervalCount);
             c区間.rectDrawingFrame.Height = y - c区間.rectDrawingFrame.Y;
             y = c区間.rectDrawingFrame.Y;
         }
     }
 }
Example #7
0
        // CActivity 実装

        public override void OnActivate()
        {
            if (this.bActivated)
            {
                return;
            }

            this.ct登場用      = null;
            this.epartプレイ楽器 = EInstrumentPart.DRUMS;
            this.nWidth     = 20;
            this.nHeight    = 540;          //1080;

            //
            this.pBarPosition[(int)EInstrumentPart.DRUMS]  = new Point(855, 15);
            this.pBarPosition[(int)EInstrumentPart.GUITAR] = new Point(334, 85);
            this.pBarPosition[(int)EInstrumentPart.BASS]   = new Point(1204, 85);

            //n区間分割数 = 54;
            this.nブロック最大数            = 10;
            this.n楽器毎のチップ数基準値.Drums  = 1600;
            this.n楽器毎のチップ数基準値.Guitar = 800;
            this.n楽器毎のチップ数基準値.Bass   = 800;

            try
            {
                for (EInstrumentPart ePart = EInstrumentPart.DRUMS; ePart <= EInstrumentPart.BASS; ePart++)
                {
                    listProgressSection[(int)ePart] = new List <CProgressSection>();
                    for (int i = 0; i < nSectionIntervalCount; i++)
                    {
                        listProgressSection[(int)ePart].Add(new CProgressSection());
                    }
                    if (!b演奏画面以外からの呼び出し && CDTXMania.ConfigIni.bInstrumentAvailable(ePart) && CDTXMania.DTX.bチップがある[(int)ePart])
                    {
                        int x = this.pBarPosition[(int)ePart].X;                        //(int)CDTXMania.Instance.ConfigIni.cdInstX[ePart][CDTXMania.Instance.ConfigIni.eActiveInst] + CDTXMania.Instance.ConfigIni.n楽器W_チップ倍率反映済(ePart);
                        int y = 0;
                        p表示位置[(int)ePart] = new Point(x, y);
                    }
                    else
                    {
                        p表示位置[(int)ePart] = new Point(0, 0);
                    }
                }

                //Compute duration for each time-slice in L区間
                if (!b演奏画面以外からの呼び出し)
                {
                    nLastChipTime = CDTXMania.DTX.listChip[CDTXMania.DTX.listChip.Count - 1].nPlaybackTimeMs;
                    foreach (CChip item in CDTXMania.DTX.listChip)
                    {
                        if (item.eInstrumentPart >= EInstrumentPart.DRUMS && item.eInstrumentPart <= EInstrumentPart.BASS)
                        {
                            int index = item.nPlaybackTimeMs * nSectionIntervalCount / nLastChipTime;
                            listProgressSection[(int)item.eInstrumentPart][index].nChipCount++;
                        }
                    }
                }
                for (EInstrumentPart ePart2 = EInstrumentPart.DRUMS; ePart2 <= EInstrumentPart.BASS; ePart2++)
                {
                    double num = (double)n楽器毎のチップ数基準値[(int)ePart2] / (double)nブロック最大数 / (double)nSectionIntervalCount;
                    int    y2  = nHeight;
                    for (int j = 0; j < nSectionIntervalCount; j++)
                    {
                        CProgressSection c区間 = listProgressSection[(int)ePart2][j];
                        int num2             = (int)((double)c区間.nChipCount / num) + 1;
                        if (num2 > nブロック最大数)
                        {
                            num2 = nブロック最大数;
                        }
                        c区間.rectDrawingFrame.Y      = (int)Math.Round((double)nHeight - ((double)j + 1.0) * (double)nHeight / (double)nSectionIntervalCount);
                        c区間.rectDrawingFrame.Width  = num2 * (nWidth / nブロック最大数);
                        c区間.rectDrawingFrame.Height = y2 - c区間.rectDrawingFrame.Y;
                        y2 = c区間.rectDrawingFrame.Y;
                    }
                }
            }
            catch (Exception ex)
            {
                Trace.TraceError("プログレスバー活性化で例外が発生しました。");
                Trace.TraceError("例外 : " + ex.Message);
            }

            base.OnActivate();
        }
Example #8
0
        public override int OnUpdateAndDraw()
        {
            if (!base.bNotActivated)
            {
                //if (base.bJustStartedUpdate)
                //{
                //	//Put First time initialization code here
                //	base.bJustStartedUpdate = false;
                //}

                //Put drawing code here
                if (b演奏画面以外からの呼び出し)
                {
                    if (base.bJustStartedUpdate)
                    {
                        ct登場用 = new CCounter(0, 100, 3, CDTXMania.Timer);
                        base.bJustStartedUpdate = false;
                    }
                    CCounter obj = ct登場用;
                    if (obj != null)
                    {
                        obj.tUpdate();
                    }
                }
                for (EInstrumentPart ePart = EInstrumentPart.DRUMS; ePart <= EInstrumentPart.BASS; ePart++)
                {
                    if ((!b演奏画面以外からの呼び出し && (b演奏画面以外からの呼び出し ||
                                             !CDTXMania.ConfigIni.bInstrumentAvailable(ePart) ||
                                             !CDTXMania.DTX.bチップがある[(int)ePart] ||
                                             (EDarkMode)CDTXMania.ConfigIni.eDark == EDarkMode.FULL)) ||
                        (b演奏画面以外からの呼び出し && epartプレイ楽器 != ePart && (epartプレイ楽器 != EInstrumentPart.UNKNOWN || ePart != 0)))
                    {
                        continue;
                    }
                    int num  = p表示位置[(int)ePart].X + (b演奏画面以外からの呼び出し ? 20 : 0);
                    int num2 = p表示位置[(int)ePart].Y + (b演奏画面以外からの呼び出し ? 20 : 0) + this.pBarPosition[(int)ePart].Y;
                    if (b演奏画面以外からの呼び出し)
                    {
                        num += (int)((double)(-60 - p表示位置[(int)ePart].X) * Math.Cos(Math.PI / 200.0 * (double)ct登場用.nCurrentValue));
                    }
                    if (b演奏画面以外からの呼び出し)
                    {
                        txパネル用.tDraw2D(CDTXMania.app.Device, num - 20, num2 - 20);
                    }

                    if (ePart == EInstrumentPart.DRUMS)
                    {
                        txProgressBarBackgroundDrums.tDraw2D(CDTXMania.app.Device, num - 2, num2 - 15);
                    }
                    else
                    {
                        txProgressBarBackgroundGuitar.tDraw2D(CDTXMania.app.Device, num - 2, num2 - 70);
                    }

                    tx背景.tDraw2D(CDTXMania.app.Device, num, num2);

                    //Draw Best Record
                    if (txBestProgressBarRecord[(int)ePart] != null)
                    {
                        txBestProgressBarRecord[(int)ePart].tDraw2D(CDTXMania.app.Device, num + 22, num2);
                    }
                    if (epartプレイ楽器 == EInstrumentPart.UNKNOWN)
                    {
                        continue;
                    }
                    if (!b演奏画面以外からの呼び出し)
                    {
                        tx縦線.tDraw2D(CDTXMania.app.Device, num + nWidth, num2);
                        int num3 = (int)((double)((CTimerBase)CDTXMania.Timer).n現在時刻ms / (double)nLastChipTime * nHeightFactor);
                        if (num3 > nHeight)
                        {
                            num3 = nHeight;
                        }
                        Rectangle rectangle = new Rectangle(0, 0, tx進捗.szTextureSize.Width, num3);
                        num2 = nHeight - num3 + this.pBarPosition[(int)ePart].Y;
                        tx進捗.tDraw2D(CDTXMania.app.Device, num, num2, rectangle);
                    }
                    for (int i = 0; i < nSectionIntervalCount; i++)
                    {
                        CProgressSection c区間 = listProgressSection[(int)ePart][i];
                        num2 = p表示位置[(int)ePart].Y + (b演奏画面以外からの呼び出し ? 20 : 0) + c区間.rectDrawingFrame.Y + this.pBarPosition[(int)ePart].Y;
                        //if (c区間.nChipCount <= 0)
                        //{
                        //	continue;
                        //}
                        if (!CDTXMania.ConfigIni.bIsAutoPlay(ePart) || b演奏画面以外からの呼び出し)
                        {
                            if ((i + 1) * nLastChipTime / nSectionIntervalCount - 1 > ((CTimerBase)CDTXMania.Timer).n現在時刻ms && !b演奏画面以外からの呼び出し)
                            {
                                tx灰.tDraw2D(CDTXMania.app.Device, num, num2, c区間.rectDrawingFrame);
                            }
                            else
                            {
                                if (!c区間.bIsAttempted)
                                {
                                    c区間.bIsAttempted = true;
                                }

                                if (c区間.nChipCount > 0)
                                {
                                    if (c区間.nHitCount == c区間.nChipCount)
                                    {
                                        tx黄.tDraw2D(CDTXMania.app.Device, num, num2, c区間.rectDrawingFrame);
                                    }
                                    else
                                    {
                                        tx青.tDraw2D(CDTXMania.app.Device, num, num2, c区間.rectDrawingFrame);
                                    }
                                }
                            }
                        }
                        else
                        {
                            if (c区間.nChipCount > 0)
                            {
                                tx灰.tDraw2D(CDTXMania.app.Device, num, num2, c区間.rectDrawingFrame);
                            }
                        }
                    }
                }
            }
            return(0);
        }