private void デフォルトに戻す() { { const int def_screen_w = DDConsts.Screen_W / 2; const int def_screen_h = DDConsts.Screen_H / 2; DDMain.SetScreenSize(def_screen_w, def_screen_h); } DDGround.MusicVolume = 0.45; DDGround.SEVolume = 0.45; Ground.I.MessageSpeed = GameConsts.MESSAGE_SPEED_DEF; Ground.I.MessageWindow_A_Pct = GameConsts.MESSAGE_WINDOW_A_PCT_DEF; // 設定値変更を反映 DDMusicUtils.UpdateVolume(); DDSEUtils.UpdateVolume(); // ボタン設定 { DDInput.DIR_2.BtnIds = new int[] { 0 }; DDInput.DIR_4.BtnIds = new int[] { 1 }; DDInput.DIR_6.BtnIds = new int[] { 2 }; DDInput.DIR_8.BtnIds = new int[] { 3 }; DDInput.A.BtnIds = new int[] { 4 }; DDInput.B.BtnIds = new int[] { 7 }; DDInput.L.BtnIds = new int[] { 10 }; } // キー設定 { DDInput.DIR_2.KeyIds = new int[] { DX.KEY_INPUT_DOWN }; DDInput.DIR_4.KeyIds = new int[] { DX.KEY_INPUT_LEFT }; DDInput.DIR_6.KeyIds = new int[] { DX.KEY_INPUT_RIGHT }; DDInput.DIR_8.KeyIds = new int[] { DX.KEY_INPUT_UP }; DDInput.A.KeyIds = new int[] { DX.KEY_INPUT_RETURN }; DDInput.B.KeyIds = new int[] { DX.KEY_INPUT_DELETE }; DDInput.L.KeyIds = new int[] { DX.KEY_INPUT_LCONTROL, DX.KEY_INPUT_RCONTROL }; } }
private void 基本設定() { DDSE[] seSamples = new DDSE[] { Ground.I.SE.Poka01, Ground.I.SE.Poka02, }; DDEngine.FreezeInput(); for (; ;) { // ==== // 入力判定ここから // ==== if ( DDInput.A.GetInput() == 1 || DDInput.B.GetInput() == 1 || DDMouse.R.GetInput() == -1 ) { this.Mode = Mode_e.END; break; } if (DDMouse.L.GetInput() == -1) { if (this.GetTabTitleCrash_拡張設定().IsCrashed(DDCrashUtils.Point(new D2Point(DDMouse.X, DDMouse.Y)))) { this.Mode = Mode_e.拡張設定; break; } if (this.LastHoveringButton == Ground.I.Picture.SettingButton_フルスクリーン) { DDMain.SetFullScreen(); } if (this.LastHoveringButton == Ground.I.Picture.SettingButton_ウィンドウ) { const int def_screen_w = DDConsts.Screen_W / 2; const int def_screen_h = DDConsts.Screen_H / 2; DDMain.SetScreenSize(def_screen_w, def_screen_h); } if (this.LastHoveringButton == Ground.I.Picture.SettingButton_デフォルトに戻す) { this.デフォルトに戻す(); } if (this.LastHoveringButton == Ground.I.Picture.SettingButton_戻る) { this.Mode = Mode_e.END; break; } } // ==== // 入力判定ここまで // ==== // ==== // 描画ここから // ==== this.BeforeDrawContents(); DDDraw.DrawSimple(Ground.I.Picture.基本設定枠, 0, 0); this.DrawTabTitles(false); this.DrawPrompt(100, 250, "画面モード"); this.DrawPrompt(100, 380, "BGM音量"); this.DrawPrompt(100, 510, "SE音量"); this.DrawPrompt(100, 640, "メッセージ表示速度"); this.DrawPrompt(100, 770, "メッセージウィンドウ透明度"); bool fullScreenFlag = DDGround.RealScreen_W == DDGround.MonitorRect.W && DDGround.RealScreen_H == DDGround.MonitorRect.H; this.DrawButton(1100, 280, Ground.I.Picture.SettingButton_フルスクリーン, fullScreenFlag); this.DrawButton(1550, 280, Ground.I.Picture.SettingButton_ウィンドウ, !fullScreenFlag); this.DrawTrackBar(1325, 410, "小", "大", DDGround.MusicVolume, volume => { DDGround.MusicVolume = volume; DDMusicUtils.UpdateVolume(); }); this.DrawTrackBar(1325, 540, "小", "大", DDGround.SEVolume, volume => { DDGround.SEVolume = volume; //DDSEUtils.UpdateVolume(); // v_20210215 -- メソッド終了時に全て更新する。 foreach (DDSE se in seSamples) { se.UpdateVolume(); } }, () => { DDUtils.Random.ChooseOne(seSamples).Play(); }); this.DrawTrackBar(1325, 670, "遅い", "速い", DDUtils.RateAToB(GameConsts.MESSAGE_SPEED_MIN, GameConsts.MESSAGE_SPEED_MAX, Ground.I.MessageSpeed), value => Ground.I.MessageSpeed = SCommon.ToInt( DDUtils.AToBRate(GameConsts.MESSAGE_SPEED_MIN, GameConsts.MESSAGE_SPEED_MAX, value) ) ); this.DrawTrackBar(1325, 800, "透明", "不透明", DDUtils.RateAToB(0, 100, Ground.I.MessageWindow_A_Pct), value => Ground.I.MessageWindow_A_Pct = SCommon.ToInt( DDUtils.AToBRate(0, 100, value) ) ); this.DrawUnderButtons(); // ==== // 描画ここまで // ==== DDEngine.EachFrame(); } DDEngine.FreezeInput(); DDSEUtils.UpdateVolume(); // v_20210215 }
private void 画面サイズ設定() { DDEngine.FreezeInput(); for (; ;) { // ==== // 入力判定ここから // ==== if ( DDInput.A.GetInput() == 1 || DDInput.B.GetInput() == 1 || DDMouse.R.GetInput() == -1 ) { this.Mode = Mode_e.拡張設定; break; } if (DDMouse.L.GetInput() == -1) { if (this.LastHoveringButton == Ground.I.Picture.SettingButton_960x540) { DDMain.SetScreenSize(960, 540); } if (this.LastHoveringButton == Ground.I.Picture.SettingButton_1080x607) { DDMain.SetScreenSize(1080, 607); } if (this.LastHoveringButton == Ground.I.Picture.SettingButton_1200x675) { DDMain.SetScreenSize(1200, 675); } if (this.LastHoveringButton == Ground.I.Picture.SettingButton_1320x742) { DDMain.SetScreenSize(1320, 742); } if (this.LastHoveringButton == Ground.I.Picture.SettingButton_1440x810) { DDMain.SetScreenSize(1440, 810); } if (this.LastHoveringButton == Ground.I.Picture.SettingButton_1560x877) { DDMain.SetScreenSize(1560, 877); } if (this.LastHoveringButton == Ground.I.Picture.SettingButton_1680x945) { DDMain.SetScreenSize(1680, 945); } if (this.LastHoveringButton == Ground.I.Picture.SettingButton_1800x1012) { DDMain.SetScreenSize(1800, 1012); } if (this.LastHoveringButton == Ground.I.Picture.SettingButton_1920x1080) { DDMain.SetScreenSize(1920, 1080); } if (this.LastHoveringButton == Ground.I.Picture.SettingButton_2040x1147) { DDMain.SetScreenSize(2040, 1147); } if (this.LastHoveringButton == Ground.I.Picture.SettingButton_2160x1215) { DDMain.SetScreenSize(2160, 1215); } if (this.LastHoveringButton == Ground.I.Picture.SettingButton_2280x1282) { DDMain.SetScreenSize(2280, 1282); } if (this.LastHoveringButton == Ground.I.Picture.SettingButton_フルスクリーン画面に合わせる) { DDMain.SetScreenSize(DDGround.MonitorRect.W, DDGround.MonitorRect.H); } if (this.LastHoveringButton == Ground.I.Picture.SettingButton_フルスクリーン縦横比を維持する) { DDMain.SetFullScreen(); } if (this.LastHoveringButton == Ground.I.Picture.SettingButton_デフォルトに戻す) { this.デフォルトに戻す(); } if (this.LastHoveringButton == Ground.I.Picture.SettingButton_戻る) { this.Mode = Mode_e.拡張設定; break; } } // ==== // 入力判定ここまで // ==== // ==== // 描画ここから // ==== this.BeforeDrawContents(); DDDraw.DrawSimple(Ground.I.Picture.詳細設定枠, 0, 0); DrawTabTitle(610, 70, "ウィンドウサイズ設定", true); this.DrawButton(300, 300, Ground.I.Picture.SettingButton_960x540, true); this.DrawButton(740, 300, Ground.I.Picture.SettingButton_1080x607, true); this.DrawButton(1180, 300, Ground.I.Picture.SettingButton_1200x675, true); this.DrawButton(1620, 300, Ground.I.Picture.SettingButton_1320x742, true); this.DrawButton(300, 420, Ground.I.Picture.SettingButton_1440x810, true); this.DrawButton(740, 420, Ground.I.Picture.SettingButton_1560x877, true); this.DrawButton(1180, 420, Ground.I.Picture.SettingButton_1680x945, true); this.DrawButton(1620, 420, Ground.I.Picture.SettingButton_1800x1012, true); this.DrawButton(300, 540, Ground.I.Picture.SettingButton_1920x1080, true); this.DrawButton(740, 540, Ground.I.Picture.SettingButton_2040x1147, true); this.DrawButton(1180, 540, Ground.I.Picture.SettingButton_2160x1215, true); this.DrawButton(1620, 540, Ground.I.Picture.SettingButton_2280x1282, true); this.DrawButton(960, 660, Ground.I.Picture.SettingButton_フルスクリーン画面に合わせる, true); this.DrawButton(960, 780, Ground.I.Picture.SettingButton_フルスクリーン縦横比を維持する, true); this.DrawUnderButtons(); // ==== // 描画ここまで // ==== DDEngine.EachFrame(); } DDEngine.FreezeInput(); }
private static void TitleConfig() { P_TitleBackWDest = DDConsts.Screen_W; DDEngine.FreezeInput(); for (; ;) { DDMouse.UpdatePos(); if (DDUtils.IsPound(DDMouse.L.GetInput())) { int x = DDMouse.X; int y = DDMouse.Y; if (DDUtils.IsOut(new D2Point(x, y), D4Rect.LTRB(270, 120, 470, 160)) == false) // [960x540] { DDMain.SetScreenSize(960, 540); } else if (DDUtils.IsOut(new D2Point(x, y), D4Rect.LTRB(530, 120, 800, 160)) == false) // [1440x810] { DDMain.SetScreenSize(1440, 810); } else if (DDUtils.IsOut(new D2Point(x, y), D4Rect.LTRB(270, 160, 470, 200)) == false) // [1920x1080] { DDMain.SetScreenSize(1920, 1080); } else if (DDUtils.IsOut(new D2Point(x, y), D4Rect.LTRB(530, 160, 800, 200)) == false) // [フルスクリーン] { int w = DDGround.MonitorRect.W; int h = (DDConsts.Screen_H * DDGround.MonitorRect.W) / DDConsts.Screen_W; if (DDGround.MonitorRect.H < h) { h = DDGround.MonitorRect.H; w = (DDConsts.Screen_W * DDGround.MonitorRect.H) / DDConsts.Screen_H; if (DDGround.MonitorRect.W < w) { throw new DDError(); } } DDMain.SetScreenSize(DDGround.MonitorRect.W, DDGround.MonitorRect.H); DDGround.RealScreenDraw_L = (DDGround.MonitorRect.W - w) / 2; DDGround.RealScreenDraw_T = (DDGround.MonitorRect.H - h) / 2; DDGround.RealScreenDraw_W = w; DDGround.RealScreenDraw_H = h; } else if (DDUtils.IsOut(new D2Point(x, y), D4Rect.LTRB(400, 240, 530, 280)) == false) { DDGround.MusicVolume += 0.01; } else if (DDUtils.IsOut(new D2Point(x, y), D4Rect.LTRB(550, 240, 690, 280)) == false) { DDGround.MusicVolume -= 0.01; } else if (DDUtils.IsOut(new D2Point(x, y), D4Rect.LTRB(700, 240, 900, 280)) == false) { DDGround.MusicVolume = DDConsts.DefaultVolume; } else if (DDUtils.IsOut(new D2Point(x, y), D4Rect.LTRB(400, 320, 530, 360)) == false) { DDGround.SEVolume += 0.01; } else if (DDUtils.IsOut(new D2Point(x, y), D4Rect.LTRB(550, 320, 690, 360)) == false) { DDGround.SEVolume -= 0.01; } else if (DDUtils.IsOut(new D2Point(x, y), D4Rect.LTRB(700, 320, 900, 360)) == false) { DDGround.SEVolume = DDConsts.DefaultVolume; } else if (DDUtils.IsOut(new D2Point(x, y), D4Rect.LTRB(270, 400, 600, 440)) == false) { TitleConfigResetPlayData(); } else if (DDUtils.IsOut(new D2Point(x, y), D4Rect.LTRB(830, 480, 930, 520)) == false) { break; } DDGround.MusicVolume = DoubleTools.ToRange(DDGround.MusicVolume, 0.0, 1.0); DDGround.SEVolume = DoubleTools.ToRange(DDGround.SEVolume, 0.0, 1.0); } DrawWall(); DrawTitleBack(); PrintByFont.SetPrint(); PrintByFont.Print(""); PrintByFont.Print(" 設定"); PrintByFont.Print(""); PrintByFont.Print(" 画面サイズ [960x540] [1440x810]"); PrintByFont.Print(" [1920x1080] [フルスクリーン]"); PrintByFont.Print(""); PrintByFont.Print(string.Format(" BGM音量 {0:F2} [上げる] [下げる] [デフォルト]", DDGround.MusicVolume)); PrintByFont.Print(""); PrintByFont.Print(string.Format(" SE音量 {0:F2} [上げる] [下げる] [デフォルト]", DDGround.SEVolume)); PrintByFont.Print(""); PrintByFont.Print(" プレイデータリセット"); PrintByFont.Print(""); PrintByFont.Print(" [戻る]"); DDEngine.EachFrame(); } }