private void Setting() { DDCurtain.SetCurtain(); DDEngine.FreezeInput(); string[] items = new string[] { "ゲームパッドのボタン設定", "キーボードのキー設定", "ウィンドウサイズ変更", "BGM音量", "SE音量", "スナップショット・ストック数", "戻る", }; DDSE[] seSamples = new DDSE[] { Ground.I.SE.Dummy, // TODO }; int selectIndex = 0; for (; ;) { selectIndex = this.SimpleMenu.Perform("設定", items, selectIndex, false, 282, 48, 60); switch (selectIndex) { case 0: this.SimpleMenu.PadConfig(); break; case 1: this.SimpleMenu.PadConfig(true); break; case 2: this.SimpleMenu.WindowSizeConfig(); break; case 3: this.SimpleMenu.VolumeConfig("BGM音量", DDGround.MusicVolume, 0, 100, 1, 10, volume => { DDGround.MusicVolume = volume; DDMusicUtils.UpdateVolume(); }, () => { } ); break; case 4: this.SimpleMenu.VolumeConfig("SE音量", DDGround.SEVolume, 0, 100, 1, 10, volume => { DDGround.SEVolume = volume; //DDSEUtils.UpdateVolume(); // old foreach (DDSE se in seSamples) // サンプルのみ音量更新 { se.UpdateVolume(); } }, () => { DDUtils.Random.ChooseOne(seSamples).Play(); } ); DDSEUtils.UpdateVolume(); // 全音量更新 break; case 5: this.Setting_SnapshotCountMax(); break; case 6: goto endMenu; default: throw new DDError(); } } endMenu: DDEngine.FreezeInput(); }
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 Setting() { DDCurtain.SetCurtain(); DDEngine.FreezeInput(); string[] items = new string[] { "ゲームパッドのボタン設定", "キーボードのキー設定", "ウィンドウサイズ変更", "BGM音量", "SE音量", "ノベルパートのメッセージ表示速度", "戻る", }; DDSE[] seSamples = new DDSE[] { Ground.I.SE.Dummy, // TODO }; int selectIndex = 0; for (; ;) { selectIndex = this.SimpleMenu.Perform("設定", items, selectIndex); switch (selectIndex) { case 0: this.SimpleMenu.PadConfig(); break; case 1: this.SimpleMenu.PadConfig(true); break; case 2: this.SimpleMenu.WindowSizeConfig(); break; case 3: this.SimpleMenu.VolumeConfig("BGM音量", DDGround.MusicVolume, 0, 100, 1, 10, volume => { DDGround.MusicVolume = volume; DDMusicUtils.UpdateVolume(); }, () => { } ); break; case 4: this.SimpleMenu.VolumeConfig("SE音量", DDGround.SEVolume, 0, 100, 1, 10, volume => { DDGround.SEVolume = volume; //DDSEUtils.UpdateVolume(); // old foreach (DDSE se in seSamples) // サンプルのみ音量更新 { se.UpdateVolume(); } }, () => { DDUtils.Random.ChooseOne(seSamples).Play(); } ); DDSEUtils.UpdateVolume(); // 全音量更新 break; case 5: this.SimpleMenu.IntVolumeConfig( "ノベルパートのメッセージ表示速度", Ground.I.NovelMessageSpeed, NovelConsts.MESSAGE_SPEED_MIN, NovelConsts.MESSAGE_SPEED_MAX, 1, 2, speed => Ground.I.NovelMessageSpeed = speed, () => { } ); break; case 6: goto endMenu; default: throw new DDError(); } } endMenu: DDEngine.FreezeInput(); }