Exemplo n.º 1
0
        private void PrintPadButtonKeySetting(bool キー設定Flag, int padButtonIndex, string title, DDInput.Button button)
        {
            int y = 230 + padButtonIndex * 90;

            string setting;

            if (キー設定Flag)
            {
                setting = string.Join(" , ", button.KeyIds.Select(keyId => DDSimpleMenu.GetKeyName(keyId)));
            }
            else
            {
                setting = string.Join(" , ", button.BtnIds.Select(btnId => DDSimpleMenu.GetPadButtonName(btnId)));
            }

            this.DrawButton(300, y + 25, Ground.I.Picture.SettingButton_変更, true);

            if (this.LastButtonHoveringFlag && DDMouse.L.GetInput() == -1)
            {
                InputPadButtonKeySetting(キー設定Flag, title, button);
            }

            DDFontUtils.DrawString(
                550,
                y,
                "「" + title + "」 = " + setting,
                DDFontUtils.GetFont("Kゴシック", 50),
                false,
                キー設定Flag ? new I3Color(192, 255, 128) : new I3Color(255, 192, 128),
                キー設定Flag ? new I3Color(50, 100, 0) : new I3Color(100, 50, 0)
                );
        }
Exemplo n.º 2
0
        private IEnumerable <bool> DrawString(int x, int y, string text, int frameMax = 600)
        {
            double b     = 0.0;
            double bTarg = 1.0;

            foreach (DDScene scene in DDSceneUtils.Create(frameMax))
            {
                if (scene.Numer == scene.Denom - 300)
                {
                    bTarg = 0.0;
                }

                DDUtils.Approach(ref b, bTarg, 0.99);

                I3Color color = new I3Color(
                    SCommon.ToInt(b * 255),
                    SCommon.ToInt(b * 255),
                    SCommon.ToInt(b * 255)
                    );

                DDFontUtils.DrawString(x, y, text, DDFontUtils.GetFont("03\u711a\u706b-Regular", 30), false, color);

                yield return(true);
            }
        }
Exemplo n.º 3
0
        public static void Print(string line)
        {
            if (P_X == -1)
            {
                throw new DDError();
            }

            DDFontUtils.DrawString(P_X, P_Y, line, DDFontUtils.GetFont(P_FontName, P_FontSize));
            P_Y += P_YStep;
        }
Exemplo n.º 4
0
        private void InputPadButtonKeySetting(bool キー設定Flag, string title, DDInput.Button button)
        {
            DDEngine.FreezeInput();

            for (; ;)
            {
                if (
                    //DDInput.A.GetInput() == 1 || // ... 現在の割り当てボタン・キーに反応してしまうんでない?
                    //DDInput.B.GetInput() == 1 ||
                    DDMouse.R.GetInput() == -1
                    )
                {
                    break;
                }

                if (CheckInputPadButtonKey(キー設定Flag, button))
                {
                    DDEngine.FreezeInput(GameConsts.LONG_INPUT_SLEEP);                     // 決定・キャンセルを変更した場合を考慮して、長めにフリーズしておく
                    break;
                }
                this.DrawWall();

                DDDraw.DrawSimple(Ground.I.Picture.詳細設定枠, 0, 0);

                if (キー設定Flag)
                {
                    DrawTabTitle(480, 70, "キーボードのキー設定 / 変更", true);
                }
                else
                {
                    DrawTabTitle(400, 70, "ゲームパッドのボタン設定 / 変更", true);
                }

                DDFontUtils.DrawString(
                    100,
                    520,
                    "「" + title + "」に割り当てる" + (キー設定Flag ? "キー" : "ボタン") + "を押して下さい。",
                    DDFontUtils.GetFont("Kゴシック", 50),
                    false,
                    new I3Color(255, 255, 255),
                    new I3Color(100, 100, 0)
                    );

                this.DrawButton(1630, 950, Ground.I.Picture.SettingButton_キャンセル, true);

                if (this.LastButtonHoveringFlag && DDMouse.L.GetInput() == -1)
                {
                    break;
                }

                DDEngine.EachFrame();
            }
            DDEngine.FreezeInput();
        }
Exemplo n.º 5
0
 private void DrawTabTitle(int x, int y, string line, bool activeFlag)
 {
     DDFontUtils.DrawString(
         x,
         y,
         line,
         DDFontUtils.GetFont("Kゴシック", 70),
         false,
         activeFlag ? new I3Color(100, 255, 255) : new I3Color(150, 150, 150),
         activeFlag ? new I3Color(50, 100, 100) : new I3Color(100, 100, 100)
         );
 }
Exemplo n.º 6
0
 private void DrawPrompt(int x, int y, string line)
 {
     DDFontUtils.DrawString(
         x,
         y,
         line,
         DDFontUtils.GetFont("Kゴシック", 50),
         false,
         new I3Color(255, 255, 255),
         new I3Color(0, 0, 100)
         );
 }
Exemplo n.º 7
0
        public override IEnumerable <bool> E_Draw()
        {
            for (; ;)
            {
                DDUtils.Approach(ref this.A, this.IsVisible ? 1.0 : 0.0, 0.9);
                DDUtils.Approach(ref this.X_Zure, 0.0, 0.93);
                DDUtils.Approach(ref this.Y_Zure, 0.0, 0.93);

                DDDraw.SetAlpha(this.A);
                DDDraw.DrawBegin(
                    this.Thinking ? Ground.I.Picture.Novel_吹き出しThink : Ground.I.Picture.Novel_吹き出し,
                    this.X + this.X_Zure,
                    this.Y + this.Y_Zure
                    );
                DDDraw.DrawZoom_X(1.2);
                DDDraw.DrawZoom_X(this.Mirrored ? -1 : 1);
                DDDraw.DrawEnd();
                DDDraw.Reset();

#if false // 廃止
                // サブタイトル文字列
                {
                    int    dispSubtitleLength = Math.Min(Novel.I.DispSubtitleCharCount, Novel.I.CurrPage.Subtitle.Length);
                    string dispSubtitle       = Novel.I.CurrPage.Subtitle.Substring(0, dispSubtitleLength);

                    DDFontUtils.DrawString(10, 413, dispSubtitle, DDFontUtils.GetFont("Kゴシック", 16));
                }
#endif

                // シナリオのテキスト文字列
                if (this.IsVisible)
                {
                    int      dispTextLength = Math.Min(Novel.I.DispCharCount, Novel.I.CurrPage.Text.Length);
                    string   dispText       = Novel.I.CurrPage.Text.Substring(0, dispTextLength);
                    string[] dispLines      = dispText.Split('\n');

                    for (int index = 0; index < dispLines.Length; index++)
                    {
                        double x = this.X - 240;
                        double y = this.Y - 60 + index * 30;

                        x += this.X_Zure;
                        y += this.Y_Zure;

                        DDFontUtils.DrawString((int)x, (int)y, dispLines[index], DDFontUtils.GetFont("Kゴシック", 16), false, new I3Color(110, 100, 90));
                    }
                }

                yield return(true);
            }
        }
Exemplo n.º 8
0
        private IEnumerable <bool> GetLayer03(string imgFile)
        {
            DDPicture img = DDPictureLoaders.Standard(imgFile);             // g

            double a = 0.0;
            double z = 2.0;

            double t1x = 100;
            double t2x = 100;
            double t3x = 100;

            for (int frmcnt = 0; ; frmcnt++)
            {
                DDDraw.DrawBegin(img, DDConsts.Screen_W / 2, DDConsts.Screen_H / 2);
                DDDraw.DrawZoom(1.353);
                DDDraw.SetAlpha(a);
                DDDraw.DrawEnd();

                DDDraw.DrawBegin(img, DDConsts.Screen_W / 2, DDConsts.Screen_H / 2);
                DDDraw.DrawZoom(1.353 * z);
                DDDraw.SetAlpha(a / 2.0);
                DDDraw.DrawEnd();

                I3Color color = new I3Color((int)(255 * a), (int)(255 * a), (int)(255 * a));

                if (10 < frmcnt)
                {
                    DDFontUtils.DrawString((int)(1000 + t1x), 620, "TOKYO", DDFontUtils.GetFont("Ink Free", 100), false, color);

                    DDUtils.Approach(ref t1x, 0.0, 0.8);
                }
                if (15 < frmcnt)
                {
                    DDFontUtils.DrawString((int)(1200 + t2x), 720, "LOVE", DDFontUtils.GetFont("Ink Free", 200), false, color);

                    DDUtils.Approach(ref t2x, 0.0, 0.8);
                }
                if (20 < frmcnt)
                {
                    DDFontUtils.DrawString((int)(1000 + t3x), 900, "STORY    1991", DDFontUtils.GetFont("Ink Free", 100), false, color);

                    DDUtils.Approach(ref t3x, 0.0, 0.8);
                }

                DDUtils.Approach(ref a, 1.0, 0.98);
                DDUtils.Approach(ref z, 1.0, 0.98);

                yield return(true);
            }
        }
Exemplo n.º 9
0
        public override IEnumerable <bool> E_Draw()
        {
            const int h = 136;

            for (; ;)
            {
                DDUtils.Approach(ref this.A, Hide ? 0.0 : 1.0, 0.9);

                DDDraw.SetAlpha(this.A);
                DDDraw.DrawRect(Ground.I.Picture.MessageFrame_Message, 0, DDConsts.Screen_H - h, DDConsts.Screen_W, h);
                DDDraw.Reset();

                if (!Hide)
                {
                    // サブタイトル文字列
                    {
                        int    dispSubtitleLength = Math.Min(Novel.I.DispSubtitleCharCount, Novel.I.CurrPage.Subtitle.Length);
                        string dispSubtitle       = Novel.I.CurrPage.Subtitle.Substring(0, dispSubtitleLength);

                        DDFontUtils.DrawString(
                            10,
                            413,
                            dispSubtitle,
                            DDFontUtils.GetFont("Kゴシック", 16)
                            );
                    }

                    // シナリオのテキスト文字列
                    {
                        int      dispTextLength = Math.Min(Novel.I.DispCharCount, Novel.I.CurrPage.Text.Length);
                        string   dispText       = Novel.I.CurrPage.Text.Substring(0, dispTextLength);
                        string[] dispLines      = dispText.Split('\n');

                        for (int index = 0; index < dispLines.Length; index++)
                        {
                            DDFontUtils.DrawString(
                                10,
                                450 + index * 30,
                                dispLines[index],
                                DDFontUtils.GetFont("Kゴシック", 16), false, new I3Color(110, 100, 90)
                                );
                        }
                    }
                }

                yield return(true);
            }
        }
Exemplo n.º 10
0
        /// <summary>
        /// 選択肢表示テスト
        /// </summary>
        public void Test01()
        {
            for (; ;)
            {
                DDCurtain.DrawCurtain();

                // メッセージ枠
                {
                    const int h = 136;

                    DDDraw.SetAlpha(0.9);
                    DDDraw.DrawRect(Ground.I.Picture.MessageFrame29_Message, 0, DDConsts.Screen_H - h, DDConsts.Screen_W, h);
                    DDDraw.Reset();
                }

                // 選択項目 x3
                {
                    const int x     = 290;
                    const int y     = 70;
                    const int yStep = 100;

                    DDDraw.DrawSimple(Ground.I.Picture.MessageFrame29_Button2, x, y + yStep * 0);
                    DDDraw.DrawSimple(Ground.I.Picture.MessageFrame29_Button2, x, y + yStep * 1);
                    DDDraw.DrawSimple(Ground.I.Picture.MessageFrame29_Button2, x, y + yStep * 2);

                    string[] items = new string[]
                    {
                        "ここに最初の選択肢の文字列を表示します。",
                        "ここに真ん中の選択肢の文字列を表示します。",
                        "ここに最後の選択肢の文字列を表示します。",
                    };

                    const int item_x = 80;
                    const int item_y = 28;

                    DDFontUtils.DrawString(x + item_x, y + yStep * 0 + item_y, items[0], DDFontUtils.GetFont("Kゴシック", 16), false, new I3Color(110, 100, 90));
                    DDFontUtils.DrawString(x + item_x, y + yStep * 1 + item_y, items[1], DDFontUtils.GetFont("Kゴシック", 16), false, new I3Color(110, 100, 90));
                    DDFontUtils.DrawString(x + item_x, y + yStep * 2 + item_y, items[2], DDFontUtils.GetFont("Kゴシック", 16), false, new I3Color(110, 100, 90));
                }

                DDEngine.EachFrame();
            }
        }
Exemplo n.º 11
0
        private void PrintPadButtonKeySetting(bool キー設定Flag, int padButtonIndex, string title, DDInput.Button button)
        {
            int y = 230 + padButtonIndex * 90;

            Func <DDInput.Button, string> getSetting;

            {
                Func <string, string> w = s => Common.FirstNotEmpty(s, "割り当てナシ");

                if (キー設定Flag)
                {
                    getSetting = btn => w(string.Join(" , ", btn.KeyIds.Select(keyId => DDSimpleMenu.GetKeyName(keyId))));
                }
                else
                {
                    getSetting = btn => w(string.Join(" , ", btn.BtnIds.Select(btnId => DDSimpleMenu.GetPadButtonName(btnId))));
                }
            }

            this.DrawButton(300, y + 25, Ground.I.Picture.SettingButton_変更, true);

            if (this.LastButtonHoveringFlag && DDMouse.L.GetInput() == -1)
            {
                InputPadButtonKeySetting(キー設定Flag, title, button, getSetting);
            }

            DDFontUtils.DrawString(
                550,
                y,
                "「" + title + "」 = " + getSetting(button),
                DDFontUtils.GetFont("Kゴシック", 50),
                false,
                キー設定Flag ? new I3Color(192, 255, 128) : new I3Color(255, 192, 128),
                キー設定Flag ? new I3Color(50, 100, 0) : new I3Color(100, 50, 0)
                );
        }
Exemplo n.º 12
0
        public void Perform()
        {
            DDCurtain.SetCurtain();
            DDEngine.FreezeInput();

            Ground.I.Music.Filed_01.Play();

            long frmProcMilAvgNumer = 0L;
            long frmProcMilAvgDenom = 0L;

            int effectPerFrm = 10;
            int effectCount  = 1;

            for (; ;)
            {
                if (DDInput.PAUSE.IsPound())
                {
                    break;
                }
                if (DDInput.A.IsPound())
                {
                    effectPerFrm--;
                }
                if (DDInput.B.IsPound())
                {
                    effectPerFrm++;
                }
                if (DDInput.C.IsPound())
                {
                    effectCount++;
                }
                if (DDInput.D.IsPound())
                {
                    effectCount--;
                }
                effectPerFrm = IntTools.ToRange(effectPerFrm, 1, 10);
                effectCount  = IntTools.ToRange(effectCount, 1, 100);

                if (DDEngine.ProcFrame % effectPerFrm == 0)
                {
                    for (int c = 0; c < effectCount; c++)
                    {
                        new DDCommonEffect(DDGround.GeneralResource.Dummy)
                        {
                            X     = 400.0,
                            Y     = 300.0,
                            Z     = 0.5,
                            XAdd2 = Math.Cos(DDEngine.ProcFrame / 100.0 + c) * 0.1,
                            YAdd2 = Math.Sin(DDEngine.ProcFrame / 100.0 + c) * 0.1,
                        }
                        .Fire();
                    }
                }
                this.DrawWall();



                // フォントのテスト
                DDFontUtils.DrawString_XCenter(
                    400, 20,
                    "げんかいみんちょう",
                    DDFontUtils.GetFont("源界明朝", 70, 6, true, 2)
                    );
                DDFontUtils.DrawString_XCenter(
                    400, 520,
                    "りいてがき",
                    DDFontUtils.GetFont("りいてがき筆", 50, 6, true, 2)
                    );



                frmProcMilAvgNumer += DDEngine.FrameProcessingMillis;
                frmProcMilAvgDenom++;

                double frmProcMilAvg = (double)frmProcMilAvgNumer / frmProcMilAvgDenom;

                if (DDEngine.ProcFrame % 100 == 0)
                {
                    frmProcMilAvgNumer /= 2;
                    frmProcMilAvgDenom /= 2;
                }

                DDDraw.SetTaskList(DDGround.EL);
                DDDraw.SetAlpha(0.5);
                DDDraw.SetBright(new I3Color(0, 0, 0));
                DDDraw.DrawRect(DDGround.GeneralResource.WhiteBox, 0, 0, DDConsts.Screen_W, 16);
                DDDraw.Reset();

                DDPrint.SetPrint();
                DDPrint.SetTaskList(DDGround.EL);
                DDPrint.SetColor(new I3Color(255, 128, 0));
                DDPrint.Print(string.Format(
                                  "FST={0},HCT={1},FPM={2},FPW={3},FPMA={4:F3}(EPF={5},EC={6},ELC={7})"
                                  , DDEngine.FrameStartTime
                                  , DDEngine.HzChaserTime
                                  , DDEngine.FrameProcessingMillis
                                  , DDEngine.FrameProcessingMillis_Worst
                                  , frmProcMilAvg
                                  , effectPerFrm
                                  , effectCount
                                  , DDGround.EL.Count
                                  ));
                DDPrint.Reset();



                DDEngine.EachFrame();
            }
            DDEngine.FreezeInput();
            DDMusicUtils.Fade();
            DDCurtain.SetCurtain(30, -1.0);

            foreach (DDScene scene in DDSceneUtils.Create(40))
            {
                this.DrawWall();
                DDEngine.EachFrame();
            }
            DDGround.EL.Clear();
        }
Exemplo n.º 13
0
        public void Draw(double[] spectra)
        {
            if (spectra.Length != 90)
            {
                throw null;                 // souteigai !!!
            }
            if (this.ShadowSpectra == null)
            {
                this.ShadowSpectra = new ShadowSpectraData();
            }

            this.ShadowSpectra.Projection(spectra);

            DDSubScreenUtils.ChangeDrawScreen(this.GraphScreen);
            DX.ClearDrawScreen();

            for (int c = 0; c < 30; c++)
            {
                double v =
                    this.ShadowSpectra.ShadowSpectra[c * 3 + 0] +
                    this.ShadowSpectra.ShadowSpectra[c * 3 + 1] +
                    this.ShadowSpectra.ShadowSpectra[c * 3 + 2];

                v /= 3.0;

                int x1 = c * 30;
                int x2 = x1 + 10;
                int y1 = (int)((1.0 - v) * 600);
                int y2 = 600;

                if (y1 + 1 < y2)
                {
                    DDDraw.SetBright(0.4, 0.5, 0.6);
                    DDDraw.DrawRect(DDGround.GeneralResource.WhiteBox, x1, y1, x2 - x1, y2 - y1);
                    DDDraw.Reset();
                }
            }
            for (int c = 0; c < 30; c++)
            {
                double v =
                    spectra[c * 3 + 0] +
                    spectra[c * 3 + 1] +
                    spectra[c * 3 + 2];

                v /= 3.0;

                int x1 = c * 30;
                int x2 = x1 + 10;
                int y1 = (int)((1.0 - v) * 600);
                int y2 = 600;

                if (y1 + 1 < y2)
                {
                    DDDraw.DrawRect(DDGround.GeneralResource.WhiteBox, x1, y1, x2 - x1, y2 - y1);
                }
            }

            DDDraw.DrawRect(DDGround.GeneralResource.WhiteBox, 0, 620, 880, 10);

            DDFontUtils.DrawString(0,
                                   640, "小田和正", DDFontUtils.GetFont("メイリオ", 80));
            DDFontUtils.DrawString(270,
                                   740, "ラブ・ストーリーは突然に", DDFontUtils.GetFont("メイリオ", 50));
            DDFontUtils.DrawString(30,
                                   840, "『 東京ラブストーリー ( 1991 ) 』 主題歌", DDFontUtils.GetFont("メイリオ", 40));

            DDSubScreenUtils.ChangeDrawScreen(this.Screen);
            DX.ClearDrawScreen();

            DDDraw.DrawBegin(DDPictureLoaders2.Wrapper(this.GraphScreen), 500, 500);
            DDDraw.SetBright(0, 0, 0);
            DDDraw.DrawEnd();
            DDDraw.Reset();

            DX.GraphFilter(this.Screen.GetHandle(), DX.DX_GRAPH_FILTER_GAUSS, 16, 1000);

            DDDraw.DrawCenter(DDPictureLoaders2.Wrapper(this.GraphScreen), 500, 500);

            DDSubScreenUtils.RestoreDrawScreen();
        }
Exemplo n.º 14
0
        /// <summary>
        /// 過去ログ
        /// </summary>
        private void BackLog()
        {
            List <string> logLines = new List <string>();

            for (int index = 0; index < this.Status.CurrPageIndex; index++)
            {
                foreach (string line in this.Status.Scenario.Pages[index].Lines)
                {
                    logLines.Add(line);
                }
            }

            DDEngine.FreezeInput(NovelConsts.SHORT_INPUT_SLEEP);

            int backIndex = 0;

            for (; ;)
            {
                if (
                    DDMouse.L.GetInput() == -1 ||
                    DDInput.A.GetInput() == 1
                    )
                {
                    break;
                }

                if (
                    DDInput.DIR_8.IsPound() ||
                    0 < DDMouse.Rot
                    )
                {
                    backIndex++;
                }

                if (
                    DDInput.DIR_2.IsPound() ||
                    DDMouse.Rot < 0
                    )
                {
                    backIndex--;
                }

                if (
                    DDInput.DIR_6.GetInput() == 1
                    )
                {
                    backIndex = -1;
                }

                DDUtils.ToRange(ref backIndex, -1, logLines.Count - 1);

                if (backIndex < 0)
                {
                    break;
                }

                this.DrawSurfaces();
                DDCurtain.DrawCurtain(-0.8);

                for (int c = 1; c <= 17; c++)
                {
                    int i = logLines.Count - backIndex - c;

                    if (0 <= i)
                    {
                        DDFontUtils.DrawString(8, DDConsts.Screen_H - c * 30 - 8, logLines[i], DDFontUtils.GetFont("Kゴシック", 16));
                    }
                }
                DDEngine.EachFrame();
            }
            DDEngine.FreezeInput(NovelConsts.SHORT_INPUT_SLEEP);
        }
Exemplo n.º 15
0
        private void InputPadButtonKeySetting(bool キー設定Flag, string title, DDInput.Button button, Func <DDInput.Button, string> getSetting)
        {
            DDEngine.FreezeInput();

            button.Backup();

            if (キー設定Flag)
            {
                button.KeyIds = new int[0];
            }
            else
            {
                button.BtnIds = new int[0];
            }

            for (; ;)
            {
                CheckInputPadButtonKey(キー設定Flag, button);

                this.DrawWall();

                DDDraw.DrawSimple(Ground.I.Picture.詳細設定枠, 0, 0);

                if (キー設定Flag)
                {
                    DrawTabTitle(480, 70, "キーボードのキー設定 / 変更", true);
                }
                else
                {
                    DrawTabTitle(400, 70, "ゲームパッドのボタン設定 / 変更", true);
                }

                DDFontUtils.DrawString(
                    100,
                    400,
                    "「" + title + "」に割り当てる" + (キー設定Flag ? "キー" : "ボタン") + "を押して下さい。(複数可)",
                    DDFontUtils.GetFont("Kゴシック", 50),
                    false,
                    new I3Color(255, 255, 255),
                    new I3Color(100, 100, 0)
                    );
                DDFontUtils.DrawString(
                    100,
                    475,
                    "入力が終わったら「決定」をクリックして下さい。",
                    DDFontUtils.GetFont("Kゴシック", 50),
                    false,
                    new I3Color(255, 255, 255),
                    new I3Color(100, 100, 0)
                    );
                DDFontUtils.DrawString(
                    100,
                    600,
                    "現在の割り当て:" + getSetting(button),
                    DDFontUtils.GetFont("Kゴシック", 50),
                    false,
                    new I3Color(255, 255, 255),
                    new I3Color(100, 0, 100)
                    );

                bool inputDone;

                if (キー設定Flag)
                {
                    inputDone = 1 <= button.KeyIds.Length;
                }
                else
                {
                    inputDone = 1 <= button.BtnIds.Length;
                }

                this.DrawButton(1200, 950, Ground.I.Picture.SettingButton_決定, inputDone);

                if (this.LastButtonHoveringFlag && DDMouse.L.GetInput() == -1 && inputDone)
                {
                    break;
                }

                this.DrawButton(1630, 950, Ground.I.Picture.SettingButton_キャンセル, true);

                if (this.LastButtonHoveringFlag && DDMouse.L.GetInput() == -1 || DDMouse.R.GetInput() == -1)
                {
                    button.Restore();
                    break;
                }
                DDEngine.EachFrame();
            }
            DDEngine.FreezeInput();
        }
Exemplo n.º 16
0
        public override IEnumerable <bool> E_Draw()
        {
            Game.I.SkipMode = false;

            for (; ;)
            {
                //Game.I.CancelSkipAutoMode();

                if (
                    this.Options.Count < GameConsts.SELECT_OPTION_MIN ||
                    this.Options.Count > GameConsts.SELECT_OPTION_MAX
                    )
                {
                    throw new DDError("選択肢の個数に問題があります。");
                }

                // ---- 入力ここから

                if (!Game.I.BacklogMode)
                {
                    int moving = 0;

                    if (DDInput.DIR_8.IsPound())
                    {
                        moving = -1;
                    }

                    if (DDInput.DIR_2.IsPound())
                    {
                        moving = 1;
                    }

                    if (moving != 0)
                    {
                        int optIndex = this.GetMouseFocusedIndex();

                        if (optIndex == -1)
                        {
                            optIndex = 0;
                        }
                        else
                        {
                            optIndex += this.Options.Count + moving;
                            optIndex %= this.Options.Count;
                        }

                        DDMouse.X =
                            GameConsts.SELECT_FRAME_L +
                            Ground.I.Picture.MessageFrame_Button2.Get_W() * 2 -
                            10;
                        DDMouse.Y =
                            GameConsts.SELECT_FRAME_T + GameConsts.SELECT_FRAME_T_STEP * optIndex +
                            Ground.I.Picture.MessageFrame_Button2.Get_H() * 2 -
                            10;

                        DDMouse.PosChanged();
                    }
                }

                // ---- ここから描画

                if (!Hide)
                {
                    for (int index = 0; index < GameConsts.SELECT_FRAME_NUM; index++)
                    {
                        DDPicture picture = Ground.I.Picture.MessageFrame_Button;

                        if (index < this.Options.Count)
                        {
                            picture = Ground.I.Picture.MessageFrame_Button2;

                            if (this.Options[index].MouseFocused)
                            {
                                picture = Ground.I.Picture.MessageFrame_Button3;
                            }
                        }

                        DDDraw.DrawBeginRect(
                            picture,
                            GameConsts.SELECT_FRAME_L,
                            GameConsts.SELECT_FRAME_T + GameConsts.SELECT_FRAME_T_STEP * index,
                            picture.Get_W() * 2.0,
                            picture.Get_H() * 2.0
                            );
                        DDCrash drawedCrash = DDDraw.DrawGetCrash();
                        DDDraw.DrawEnd();

                        // フォーカスしている選択項目を再設定
                        {
                            if (index < this.Options.Count)
                            {
                                bool mouseIn = drawedCrash.IsCrashed(DDCrashUtils.Point(new D2Point(DDMouse.X, DDMouse.Y)));

                                this.Options[index].MouseFocused = mouseIn;
                            }
                        }
                    }
                    for (int index = 0; index < this.Options.Count; index++)
                    {
                        const int title_x = 160;
                        const int title_y = 56;

                        DDFontUtils.DrawString(
                            GameConsts.SELECT_FRAME_L + title_x,
                            GameConsts.SELECT_FRAME_T + GameConsts.SELECT_FRAME_T_STEP * index + title_y,
                            this.Options[index].Title,
                            DDFontUtils.GetFont("Kゴシック", 32),
                            false,
                            new I3Color(110, 100, 90)
                            );
                    }
                }

                // 隠しているなら選択出来ない。
                if (Hide)
                {
                    foreach (OptionInfo option in this.Options)
                    {
                        option.MouseFocused = false;
                    }
                }

                yield return(true);
            }
        }
Exemplo n.º 17
0
        private IEnumerable <bool> DrawString(int x, int y, string text, int frameMax = 600)
        {
            DDSubScreen subScreenTmp = new DDSubScreen(DDConsts.Screen_W, DDConsts.Screen_H, true);
            DDSubScreen subScreen    = new DDSubScreen(DDConsts.Screen_W, DDConsts.Screen_H, true);

            SubScreens.Add(subScreenTmp);
            SubScreens.Add(subScreen);

            using (subScreenTmp.Section())
            {
                DX.ClearDrawScreen();

                DDFontUtils.DrawString_XCenter(x, y, text, DDFontUtils.GetFont("K\u30b4\u30b7\u30c3\u30af", 30));

                ぼかし効果.Perform(0.01);
            }
            for (int c = 0; c < 3; c++)
            {
                using (subScreen.Section())
                {
                    DX.ClearDrawScreen();

                    for (int d = 0; d < 30; d++)
                    {
                        DDDraw.SetBlendAdd(1.0);
                        DDDraw.DrawSimple(subScreenTmp.ToPicture(), 0, 0);
                        DDDraw.Reset();
                    }
                    ぼかし効果.Perform(0.01);
                }
                SCommon.Swap(ref subScreen, ref subScreenTmp);
            }
            using (subScreen.Section())
            {
                DX.ClearDrawScreen();

                DDDraw.SetBright(0.0, 0.1, 0.2);
                DDDraw.DrawSimple(subScreenTmp.ToPicture(), 0, 0);
                DDDraw.Reset();

                DDFontUtils.DrawString_XCenter(x, y, text, DDFontUtils.GetFont("K\u30b4\u30b7\u30c3\u30af", 30));
            }

            double a     = 0.0;
            double aTarg = 1.0;

            foreach (DDScene scene in DDSceneUtils.Create(frameMax))
            {
                if (scene.Numer == scene.Denom - 300)
                {
                    aTarg = 0.0;
                }

                DDUtils.Approach(ref a, aTarg, 0.985);

                DDDraw.SetAlpha(a);
                DDDraw.DrawSimple(subScreen.ToPicture(), 0, 0);
                DDDraw.Reset();

                yield return(true);
            }
        }
Exemplo n.º 18
0
        /// <summary>
        /// レイヤ表示を実行する。
        /// ステージ番号:
        /// -- 1~9 == 各ステージ
        /// </summary>
        /// <param name="stageNo">ステージ番号</param>
        /// <param name="themeColor">このステージの印象的な色</param>
        public static void Perform(int stageNo, I3Color themeColor)
        {
            int layerNo = 10 - stageNo;

            DDCurtain.SetCurtain(0, -1.0);
            DDCurtain.SetCurtain();

            using (DDSubScreen tmpScreen = new DDSubScreen(400, 200))
            {
                foreach (DDScene scene in DDSceneUtils.Create(210))
                {
                    if (scene.Numer + 30 == scene.Denom)
                    {
                        DDCurtain.SetCurtain(30, -1.0);
                    }

                    DDCurtain.DrawCurtain();

                    int bure  = (int)(scene.Rate * scene.Rate * 20);
                    int xBure = DDUtils.Random.GetRange(-bure, bure);
                    int yBure = DDUtils.Random.GetRange(-bure, bure);
#if true
                    DDFontUtils.DrawString_XCenter(
                        DDConsts.Screen_W / 2 + xBure,
                        DDConsts.Screen_H / 2 + yBure - 50,
                        "LAYER " + layerNo,
                        DDFontUtils.GetFont("03焚火-Regular", 100)
                        );
#else
                    using (tmpScreen.Section())
                    {
                        DDPrint.SetColor(new I3Color(60, 60, 60));
                        DDPrint.SetBorder(new I3Color(255, 255, 255));
                        DDPrint.SetPrint(tmpScreen.GetSize().W / 2 - 60, tmpScreen.GetSize().H / 2 - 8);
                        DDPrint.Print("L A Y E R : " + layerNo);
                        DDPrint.Reset();
                    }
                    DDDraw.SetMosaic();
                    DDDraw.DrawBegin(
                        tmpScreen.ToPicture(),
                        DDConsts.Screen_W / 2 + xBure,
                        DDConsts.Screen_H / 2 + yBure
                        );
                    DDDraw.DrawZoom(6.0);
                    DDDraw.DrawEnd();
                    DDDraw.Reset();
#endif

                    if (0.5 < scene.Rate)
                    {
                        const int c_max = 300;

                        for (int c = (int)(scene.Rate * scene.Rate * c_max); 0 < c; c--)
                        {
                            double c_rate = (double)c / c_max;

                            DDDraw.SetAlpha(scene.Rate * 0.5);
                            //DDDraw.SetBright(new I3Color(c, c, c)); // old
                            DDDraw.SetBright(new I3Color(
                                                 (int)(themeColor.R * c_rate),
                                                 (int)(themeColor.G * c_rate),
                                                 (int)(themeColor.B * c_rate)
                                                 ));
                            DDDraw.DrawBegin(
                                Ground.I.Picture.WhiteBox,
                                DDUtils.Random.GetInt(DDConsts.Screen_W),
                                DDUtils.Random.GetInt(DDConsts.Screen_H)
                                );
                            DDDraw.DrawSetSize(
                                DDUtils.Random.GetRange(40, (int)(400 * scene.Rate)),
                                DDUtils.Random.GetRange(20, (int)(200 * scene.Rate))
                                );
                            DDDraw.DrawEnd();
                            DDDraw.Reset();
                        }
                    }

                    DDEngine.EachFrame();
                }
            }

            DDCurtain.SetCurtain(0);
        }
Exemplo n.º 19
0
        public void Perform()
        {
            DDCurtain.SetCurtain(0, -1.0);
            DDCurtain.SetCurtain();

restartCurrPage:
            this.CurrPage = this.Status.Scenario.Pages[this.Status.CurrPageIndex];

            foreach (ScenarioCommand command in this.CurrPage.Commands)
            {
                command.Invoke();
            }

            int  dispSubtitleCharCount = 0;
            int  dispCharCount         = 0;
            int  dispPageEndedCount    = 0;
            bool dispFastMode          = false;

            DDEngine.FreezeInput();

            for (; ;)
            {
                DDMouse.UpdatePos();

                // キー押下は 1 マウス押下は -1 で判定する。

                // 入力:シナリオを進める。
                if (
                    DDMouse.L.GetInput() == -1 ||
                    DDInput.A.GetInput() == 1 ||
                    DDKey.GetInput(DX.KEY_INPUT_SPACE) == 1 ||
                    DDKey.GetInput(DX.KEY_INPUT_RETURN) == 1
                    )
                {
                    if (dispPageEndedCount < NEXT_PAGE_KEY_INTERVAL)                     // ? ページ表示_未完了 -> ページ表示_高速化
                    {
                        dispFastMode = true;
                    }
                    else                     // ? ページ表示_完了 -> 次ページ
                    {
                        this.Status.CurrPageIndex++;

                        if (this.Status.Scenario.Pages.Count <= this.Status.CurrPageIndex)
                        {
                            break;
                        }

                        goto restartCurrPage;
                    }
                }

                if (
                    this.CurrPage.Subtitle.Length < dispSubtitleCharCount &&
                    this.CurrPage.Text.Length < dispCharCount
                    )
                {
                    dispPageEndedCount++;
                }

                if (dispFastMode)
                {
                    dispSubtitleCharCount += 2;
                    dispCharCount         += 2;
                }
                else
                {
                    if (DDEngine.ProcFrame % 2 == 0)
                    {
                        dispSubtitleCharCount++;
                    }

                    if (DDEngine.ProcFrame % 3 == 0)
                    {
                        dispCharCount++;
                    }
                }
                DDUtils.ToRange(ref dispSubtitleCharCount, 0, IntTools.IMAX);
                DDUtils.ToRange(ref dispCharCount, 0, IntTools.IMAX);

                // ====
                // 描画ここから
                // ====

                this.DrawSurfaces();

                // メッセージ枠
                {
                    const int h = 136;

                    DDDraw.SetAlpha(0.9);
                    DDDraw.DrawRect(Ground.I.Picture.MessageFrame_Message, 0, DDConsts.Screen_H - h, DDConsts.Screen_W, h);
                    DDDraw.Reset();
                }

                // システムボタン
                {
                    const double BUTTON_L      = 530.5;                // 素材の幅が奇数なので n + 0.5
                    const double BUTTON_T      = 412.5;                // 素材の高さも奇数なので n + 0.5
                    const double BUTTON_X_STEP = 78.0;

                    DDPicture[] buttons = new DDPicture[]
                    {
                        Ground.I.Picture.MessageFrame_Save,
                        Ground.I.Picture.MessageFrame_Load,
                        Ground.I.Picture.MessageFrame_Skip,
                        Ground.I.Picture.MessageFrame_Auto,
                        Ground.I.Picture.MessageFrame_Log,
                        Ground.I.Picture.MessageFrame_Menu,
                        //Ground.I.Picture.MessageFrame_Close,
                        //Ground.I.Picture.MessageFrame_Config,
                        //Ground.I.Picture.MessageFrame_QLoad,
                        //Ground.I.Picture.MessageFrame_QSave,
                        //Ground.I.Picture.MessageFrame_Screen,
                        //Ground.I.Picture.MessageFrame_Title,
                    };

                    for (int index = 0; index < buttons.Length; index++)
                    {
                        DDDraw.DrawCenter(buttons[index], BUTTON_L + index * BUTTON_X_STEP, BUTTON_T);
                    }
                }

                // サブタイトル文字列
                {
                    int    dispSubtitleLength = Math.Min(dispCharCount, this.CurrPage.Subtitle.Length);
                    string dispSubtitle       = this.CurrPage.Subtitle.Substring(0, dispSubtitleLength);

                    DDFontUtils.DrawString(120, 320, dispSubtitle, DDFontUtils.GetFont("Kゴシック", 16));
                }

                // シナリオのテキスト文字列
                {
                    int      dispTextLength = Math.Min(dispCharCount, this.CurrPage.Text.Length);
                    string   dispText       = this.CurrPage.Text.Substring(0, dispTextLength);
                    string[] dispLines      = dispText.Split('\n');

                    for (int index = 0; index < dispLines.Length; index++)
                    {
                        DDFontUtils.DrawString(10, 450 + index * 30, dispLines[index], DDFontUtils.GetFont("Kゴシック", 16), false, new I3Color(110, 100, 90));
                    }
                }

                DDEngine.EachFrame();
            }

            DDCurtain.SetCurtain(30, -1.0);
            DDMusicUtils.Fade();

            foreach (DDScene scene in DDSceneUtils.Create(40))
            {
                this.DrawSurfaces();

                DDEngine.EachFrame();
            }

            DDEngine.FreezeInput();
        }