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) ); }
/// <summary> /// ポーズメニュー(デバッグ用) /// </summary> private void DebugPause() { DDMain.KeepMainScreen(); DDSimpleMenu simpleMenu = new DDSimpleMenu() { Color = new I3Color(255, 255, 255), BorderColor = new I3Color(0, 128, 64), WallPicture = DDGround.KeptMainScreen.ToPicture(), WallCurtain = -0.5, }; int selectIndex = 0; for (; ;) { selectIndex = simpleMenu.Perform( "デバッグ用メニュー", new string[] { "----", "----", "----", "ゲームに戻る", }, selectIndex, true, true ); switch (selectIndex) { case 0: // none break; case 1: // none break; case 2: // none break; case 3: goto endLoop; default: throw null; // never } //DDEngine.EachFrame(); // 不要 } endLoop: DDEngine.FreezeInput(); // 寧ろやりにくい //DDInput.A.FreezeInputUntilRelease = true; //DDInput.B.FreezeInputUntilRelease = true; }
public static void SaveGame(GameStatus gameStatus) { SaveGame_幕間(); DDEngine.FreezeInput(); DDCurtain.SetCurtain(); DDEngine.FreezeInput(); DDSimpleMenu simpleMenu = new DDSimpleMenu(); simpleMenu.BorderColor = new I3Color(0, 128, 0); simpleMenu.WallColor = new I3Color(128, 64, 0); int selectIndex = 0; for (; ;) { // セーブしたら戻ってくるので、毎回更新する。 string[] items = Ground.I.SaveDataSlots.Select(v => v.GameStatus == null ? "----" : "[" + v.TimeStamp + "] " + v.Description).Concat(new string[] { "戻る" }).ToArray(); selectIndex = simpleMenu.Perform("セーブ画面", items, selectIndex); if (selectIndex < Consts.SAVE_DATA_SLOT_NUM) { if (new Confirm() { BorderColor = Ground.I.SaveDataSlots[selectIndex].GameStatus != null ? new I3Color(200, 0, 0) : new I3Color(100, 100, 0) } .Perform( Ground.I.SaveDataSlots[selectIndex].GameStatus != null ? "スロット " + (selectIndex + 1) + " のデータを上書きします。" : "スロット " + (selectIndex + 1) + " にセーブします。", "はい", "いいえ") == 0) { Ground.P_SaveDataSlot saveDataSlot = Ground.I.SaveDataSlots[selectIndex]; saveDataSlot.TimeStamp = DateTime.Now.ToString("yyyy/MM/dd (ddd) HH:mm:ss"); saveDataSlot.Description = "@@@~~~@@@~~~@@@~~~@@@~~~@@@"; saveDataSlot.MapName = GameCommon.GetMapName(Game.I.Map.MapFile, "t0001"); saveDataSlot.GameStatus = gameStatus; } } else // [戻る] { break; } //DDEngine.EachFrame(); // 不要 } SaveGame_幕間(); DDEngine.FreezeInput(); }
private static Ground.P_SaveDataSlot LoadGame() // ret: null == キャンセル, ret.GameStatus を使用する際は GetClone を忘れずに! { Ground.P_SaveDataSlot saveDataSlot = null; DDEngine.FreezeInput(); DDCurtain.SetCurtain(); DDEngine.FreezeInput(); DDSimpleMenu simpleMenu = new DDSimpleMenu() { BorderColor = new I3Color(0, 128, 0), WallDrawer = () => { DDDraw.SetBright(new I3Color(64, 64, 128)); DDDraw.DrawRect(Ground.I.Picture.WhiteBox, 0, 0, DDConsts.Screen_W, DDConsts.Screen_H); DDDraw.Reset(); }, }; string[] items = Ground.I.SaveDataSlots.Select(v => v.GameStatus == null ? "----" : "[" + v.TimeStamp + "] " + v.Description).Concat(new string[] { "戻る" }).ToArray(); int selectIndex = 0; for (; ;) { selectIndex = simpleMenu.Perform(18, 18, 32, 24, "ロード", items, selectIndex); if (selectIndex < Consts.SAVE_DATA_SLOT_NUM) { if (Ground.I.SaveDataSlots[selectIndex].GameStatus != null) { if (new Confirm() { BorderColor = new I3Color(50, 100, 200) } .Perform("スロット " + (selectIndex + 1) + " のデータをロードします。", "はい", "いいえ") == 0) { saveDataSlot = Ground.I.SaveDataSlots[selectIndex]; break; } } } else // [戻る] { break; } //DDEngine.EachFrame(); // 不要 } DDEngine.FreezeInput(); return(saveDataSlot); }
/// <summary> /// ポーズメニュー /// </summary> private void Pause() { DDMain.KeepMainScreen(); DDSimpleMenu simpleMenu = new DDSimpleMenu() { Color = new I3Color(255, 255, 255), BorderColor = new I3Color(0, 64, 128), WallPicture = DDGround.KeptMainScreen.ToPicture(), WallCurtain = -0.5, }; int selectIndex = 0; for (; ;) { selectIndex = simpleMenu.Perform( "PAUSE", new string[] { "最初からやり直す", "タイトルに戻る", "ゲームに戻る", }, selectIndex, true, true ); switch (selectIndex) { case 0: this.Pause_RestartGame = true; goto endLoop; case 1: this.Pause_ReturnToTitleMenu = true; goto endLoop; case 2: goto endLoop; default: throw null; // never } //DDEngine.EachFrame(); // 不要 } endLoop: DDEngine.FreezeInput(); // 寧ろやりにくい //DDInput.A.FreezeInputUntilRelease = true; //DDInput.B.FreezeInputUntilRelease = true; }
/// <summary> /// システムメニュー画面 /// </summary> private void SystemMenu() { this.SystemMenu_ReturnToTitleMenu = false; // reset DDSimpleMenu simpleMenu = new DDSimpleMenu() { Color = new I3Color(255, 255, 255), BorderColor = new I3Color(0, 64, 0), WallPicture = Ground.I.Picture.星屑物語04, WallCurtain = -0.5, }; int selectIndex = 0; for (; ;) { selectIndex = simpleMenu.Perform( "システムメニュー", new string[] { "設定", "タイトルに戻る", "ゲームに戻る", }, selectIndex ); switch (selectIndex) { case 0: TitleMenu.I.PublicSetting(); break; case 1: if (new Confirm().Perform("タイトル画面に戻ります。", "はい", "いいえ") == 0) { this.SystemMenu_ReturnToTitleMenu = true; goto endLoop; } break; case 2: goto endLoop; default: throw null; // never } //DDEngine.EachFrame(); // 不要 } endLoop: DDEngine.FreezeInput(GameConsts.LONG_INPUT_SLEEP); }
/// <summary> /// システムメニュー画面 /// </summary> private void SystemMenu() { this.SystemMenu_ReturnToTitleMenu = false; // reset DDSimpleMenu simpleMenu = new DDSimpleMenu() { Color = new I3Color(255, 255, 255), BorderColor = new I3Color(0, 64, 0), WallColor = new I3Color(32, 96, 32), }; int selectIndex = 0; for (; ;) { selectIndex = simpleMenu.Perform( "システムメニュー", new string[] { "タイトルに戻る", "ゲームに戻る", }, selectIndex ); switch (selectIndex) { case 0: this.SystemMenu_ReturnToTitleMenu = true; goto endLoop; case 1: goto endLoop; default: throw null; // never } //DDEngine.EachFrame(); // 不要 } endLoop: DDEngine.FreezeInput(NovelConsts.LONG_INPUT_SLEEP); }
// <---- prm public int Perform(string prompt, params string[] options) { DDMain.KeepMainScreen(); DDSimpleMenu simpleMenu = new DDSimpleMenu() { BorderColor = this.BorderColor, WallDrawer = () => { DDDraw.DrawSimple(DDGround.KeptMainScreen.ToPicture(), 0, 0); DDDraw.SetAlpha(0.7); DDDraw.SetBright(0, 0, 0); DDDraw.DrawRect(Ground.I.Picture.WhiteBox, this.BackBoardRect.ToD4Rect()); DDDraw.Reset(); }, }; return(simpleMenu.Perform(Text_L, Text_T, 40, 24, prompt, options, 0)); }
public void Perform() { DDCurtain.SetCurtain(0, -1.0); DDCurtain.SetCurtain(); DDEngine.FreezeInput(); Ground.I.Music.Title.Play(); string[] items = new string[] { "ゲームスタート(ほむら)", "ゲームスタート(さやか)", "コンテニュー", "設定", "終了", }; int selectIndex = 0; this.SimpleMenu = new DDSimpleMenu(); this.SimpleMenu.BorderColor = new I3Color(64, 0, 0); //this.SimpleMenu.WallColor = new I3Color(96, 0, 0); this.SimpleMenu.WallPicture = Ground.I.Picture.Title; this.SimpleMenu.WallCurtain = -0.8; for (; ;) { selectIndex = this.SimpleMenu.Perform("横スクロール アクションゲーム タイプ-K テストコード / タイトルメニュー", items, selectIndex); switch (selectIndex) { case 0: { this.LeaveTitleMenu(); using (new WorldGameMaster()) { WorldGameMaster.I.World = new World("t0001"); // 仮? WorldGameMaster.I.Status = new GameStatus(); WorldGameMaster.I.Perform(); } this.ReturnTitleMenu(); } break; case 1: { this.LeaveTitleMenu(); using (new WorldGameMaster()) { WorldGameMaster.I.World = new World("t0001"); // 仮? WorldGameMaster.I.Status = new GameStatus() { StartChara = Player.Chara_e.SAYAKA, }; WorldGameMaster.I.Perform(); } this.ReturnTitleMenu(); } break; case 2: { Ground.P_SaveDataSlot saveDataSlot = LoadGame(); if (saveDataSlot != null) { this.LeaveTitleMenu(); using (new WorldGameMaster()) { WorldGameMaster.I.World = new World(saveDataSlot.MapName); WorldGameMaster.I.Status = saveDataSlot.GameStatus.GetClone(); WorldGameMaster.I.Status.StartPointDirection = 101; // スタート地点を「ロード地点」にする。 WorldGameMaster.I.Perform(); } this.ReturnTitleMenu(); } } break; case 3: this.Setting(); break; case 4: goto endMenu; default: throw new DDError(); } } endMenu: DDMusicUtils.Fade(); DDCurtain.SetCurtain(30, -1.0); foreach (DDScene scene in DDSceneUtils.Create(40)) { this.SimpleMenu.DrawWall(); DDEngine.EachFrame(); } DDEngine.FreezeInput(); }
public void Perform() { DDCurtain.SetCurtain(0, -1.0); DDCurtain.SetCurtain(); DDEngine.FreezeInput(); Ground.I.Music.Title.Play(); this.SimpleMenu = new DDSimpleMenu() { BorderColor = new I3Color(64, 0, 0), WallDrawer = this.DrawWall.Execute, }; this.TopMenu.SelectIndex = 0; for (; ;) { bool cheatFlag; { int bk_freezeInputFrame = DDEngine.FreezeInputFrame; DDEngine.FreezeInputFrame = 0; cheatFlag = 1 <= DDInput.DIR_6.GetInput(); DDEngine.FreezeInputFrame = bk_freezeInputFrame; } if (DDInput.DIR_8.IsPound()) { this.TopMenu.SelectIndex--; } if (DDInput.DIR_2.IsPound()) { this.TopMenu.SelectIndex++; } this.TopMenu.SelectIndex += TopMenuTask.ITEM_NUM; this.TopMenu.SelectIndex %= TopMenuTask.ITEM_NUM; if (DDInput.A.GetInput() == 1) // ? 決定ボタン押下 { switch (this.TopMenu.SelectIndex) { case 0: if (DDConfig.LOG_ENABLED && cheatFlag) { this.DrawWall.TopMenuLeaved = true; this.CheatMainMenu(); this.DrawWall.TopMenuLeaved = false; // restore } else { this.LeaveTitleMenu(); using (new GameProgressMaster()) { GameProgressMaster.I.Perform(); } this.ReturnTitleMenu(); } break; case 1: { this.LeaveTitleMenu(); using (new GameProgressMaster()) { GameProgressMaster.I.Perform_コンテニュー(); } this.ReturnTitleMenu(); } break; case 2: { this.DrawWall.TopMenuLeaved = true; using (new SettingMenu()) { SettingMenu.I.SimpleMenu = this.SimpleMenu; SettingMenu.I.Perform(); } this.DrawWall.TopMenuLeaved = false; // restore } break; case 3: goto endMenu; default: throw new DDError(); } } if (DDInput.B.GetInput() == 1) // ? キャンセルボタン押下 { if (this.TopMenu.SelectIndex == TopMenuTask.ITEM_NUM - 1) { break; } this.TopMenu.SelectIndex = TopMenuTask.ITEM_NUM - 1; } this.DrawWall.Execute(); this.TopMenu.Execute(); DDEngine.EachFrame(); } endMenu: DDMusicUtils.Fade(); DDCurtain.SetCurtain(30, -1.0); foreach (DDScene scene in DDSceneUtils.Create(40)) { this.SimpleMenu.WallDrawer(); DDEngine.EachFrame(); } DDEngine.FreezeInput(); }
public void Perform() { DDCurtain.SetCurtain(0, -1.0); DDCurtain.SetCurtain(); DDEngine.FreezeInput(); Ground.I.Music.Title.Play(); string[] items = new string[] { "ゲームスタート", "コンテニュー(未実装)", "設定", "終了", }; int selectIndex = 0; this.SimpleMenu = new DDSimpleMenu(); this.SimpleMenu.BorderColor = new I3Color(0, 64, 128); //this.SimpleMenu.WallColor = new I3Color(60, 120, 130); //this.SimpleMenu.WallPicture = Ground.I.Picture.P_TITLE_WALL; //this.SimpleMenu.WallCurtain = -0.8; this.SimpleMenu.WallDrawer = this.背景.Execute; for (; ;) { selectIndex = this.SimpleMenu.Perform("横シュー・テストコード / タイトルメニュー", items, selectIndex); switch (selectIndex) { case 0: { this.LeaveTitleMenu(); using (new Game()) { Game.I.Script = new Script_Bステージ0001(); // 仮? Game.I.Perform(); } this.ReturnTitleMenu(); } break; case 1: // TODO break; case 2: this.Setting(); break; case 3: goto endMenu; default: throw new DDError(); } } endMenu: DDMusicUtils.Fade(); DDCurtain.SetCurtain(30, -1.0); foreach (DDScene scene in DDSceneUtils.Create(40)) { this.SimpleMenu.DrawWall(); DDEngine.EachFrame(); } DDEngine.FreezeInput(); }
/// <summary> /// ポーズメニュー(デバッグ用) /// </summary> private void DebugPause() { DDMain.KeepMainScreen(); DDSimpleMenu simpleMenu = new DDSimpleMenu() { BorderColor = new I3Color(0, 128, 64), WallDrawer = () => { DDDraw.DrawSimple(DDGround.KeptMainScreen.ToPicture(), 0, 0); DDCurtain.DrawCurtain(-0.5); }, }; DDEngine.FreezeInput(); int selectIndex = 0; for (; ;) { selectIndex = simpleMenu.Perform( 40, 40, 40, 24, "デバッグ用メニュー", new string[] { "装備している武器の切り替え [ 現在装備している武器:" + Player.武器_e_Names[(int)this.Player.武器] + " ]", "強制遅延 [ 現在の設定:" + DDEngine.SlowdownLevel + " ]", "当たり判定表示 [ 現在の設定:" + this.当たり判定表示 + " ]", "ゲームに戻る", }, selectIndex, true, true ); switch (selectIndex) { case 0: this.Player.武器 = (Player.武器_e)(((int)this.Player.武器 + 1) % Enum.GetValues(typeof(Player.武器_e)).Length); break; case 1: if (DDEngine.SlowdownLevel == 0) { DDEngine.SlowdownLevel = 1; } else { DDEngine.SlowdownLevel *= 2; } DDEngine.SlowdownLevel %= 16; break; case 2: this.当たり判定表示 = !this.当たり判定表示; break; case 3: goto endLoop; default: throw null; // never } //DDEngine.EachFrame(); // 不要 } endLoop: DDEngine.FreezeInput(); DDInput.A.FreezeInputUntilRelease = true; DDInput.B.FreezeInputUntilRelease = true; }
/// <summary> /// ポーズメニュー /// </summary> private void Pause() { DDMain.KeepMainScreen(); SCommon.Swap(ref DDGround.KeptMainScreen, ref Pause_KeptMainScreen); DDSimpleMenu simpleMenu = new DDSimpleMenu() { BorderColor = new I3Color(0, 64, 128), WallDrawer = () => { DDDraw.DrawSimple(Pause_KeptMainScreen.ToPicture(), 0, 0); DDDraw.SetAlpha(0.5); DDDraw.SetBright(0, 0, 0); DDDraw.DrawRect(Ground.I.Picture.WhiteBox, 0, DDConsts.Screen_H / 4, DDConsts.Screen_W, DDConsts.Screen_H / 2); DDDraw.Reset(); }, }; DDEngine.FreezeInput(); int selectIndex = 0; for (; ;) { selectIndex = simpleMenu.Perform( 100, 180, 50, 24, "システムメニュー", new string[] { "設定", "タイトルに戻る", "ゲームに戻る", }, selectIndex, true ); switch (selectIndex) { case 0: using (new SettingMenu() { SimpleMenu = new DDSimpleMenu() { BorderColor = new I3Color(0, 64, 128), WallDrawer = () => { DDDraw.DrawSimple(Pause_KeptMainScreen.ToPicture(), 0, 0); DDCurtain.DrawCurtain(-0.7); }, }, }) { SettingMenu.I.Perform(); } break; case 1: if (new Confirm() { BorderColor = new I3Color(0, 0, 200), }.Perform("タイトル画面に戻ります。", "はい", "いいえ") == 0) { this.Pause_ReturnToTitleMenu = true; goto endLoop; } break; case 2: goto endLoop; default: throw null; // never } //DDEngine.EachFrame(); // 不要 } endLoop: DDEngine.FreezeInput(); DDInput.A.FreezeInputUntilRelease = true; DDInput.B.FreezeInputUntilRelease = true; }
public void Perform() { DDCurtain.SetCurtain(0, -1.0); DDCurtain.SetCurtain(); DDEngine.FreezeInput(); Ground.I.Music.Title.Play(); string[] items = new string[] { "ゲームスタート", "コンテニュー", "設定", "終了", }; int selectIndex = 0; this.SimpleMenu = new DDSimpleMenu() { BorderColor = new I3Color(64, 0, 0), WallDrawer = () => { DDPicture picture = Ground.I.Picture.Title; DDDraw.DrawRect( picture, DDUtils.AdjustRectExterior(picture.GetSize().ToD2Size(), new D4Rect(0, 0, DDConsts.Screen_W, DDConsts.Screen_H)) ); DDDraw.SetMosaic(); DDDraw.DrawBegin( Ground.I.Picture.PlayerStands[DDEngine.ProcFrame / 120 % 2][DDEngine.ProcFrame / 30 % 2], 610, 392 ); DDDraw.DrawZoom_X(-1.0); DDDraw.DrawZoom(14.0); DDDraw.DrawEnd(); DDDraw.Reset(); DDCurtain.DrawCurtain(-0.4); }, }; for (; ;) { selectIndex = this.SimpleMenu.Perform(40, 40, 40, 24, "横スクロール アクション ゲーム(仮)", items, selectIndex); bool cheatFlag; { int bk_freezeInputFrame = DDEngine.FreezeInputFrame; DDEngine.FreezeInputFrame = 0; cheatFlag = 1 <= DDInput.DIR_6.GetInput(); DDEngine.FreezeInputFrame = bk_freezeInputFrame; } switch (selectIndex) { case 0: if (DDConfig.LOG_ENABLED && cheatFlag) { this.CheatMainMenu(); } else { this.LeaveTitleMenu(); using (new WorldGameMaster()) { WorldGameMaster.I.World = new World("Start"); WorldGameMaster.I.Status = new GameStatus(); WorldGameMaster.I.Perform(); } this.ReturnTitleMenu(); } break; case 1: { Ground.P_SaveDataSlot saveDataSlot = LoadGame(); if (saveDataSlot != null) { this.LeaveTitleMenu(); using (new WorldGameMaster()) { WorldGameMaster.I.World = new World(saveDataSlot.MapName); WorldGameMaster.I.Status = saveDataSlot.GameStatus.GetClone(); WorldGameMaster.I.Status.StartPointDirection = 101; // スタート地点を「ロード地点」にする。 WorldGameMaster.I.Perform(); } this.ReturnTitleMenu(); } } break; case 2: using (new SettingMenu() { SimpleMenu = this.SimpleMenu, }) { SettingMenu.I.Perform(); } break; case 3: goto endMenu; default: throw new DDError(); } } endMenu: DDMusicUtils.Fade(); DDCurtain.SetCurtain(30, -1.0); foreach (DDScene scene in DDSceneUtils.Create(40)) { this.SimpleMenu.WallDrawer(); DDEngine.EachFrame(); } DDEngine.FreezeInput(); }
public void Perform() { DDCurtain.SetCurtain(0, -1.0); DDCurtain.SetCurtain(); DDEngine.FreezeInput(); Ground.I.Music.Title.Play(); this.SimpleMenu = new DDSimpleMenu() { BorderColor = new I3Color(0, 96, 0), WallDrawer = this.DrawWall.Execute, }; this.TopMenu.SelectIndex = 0; for (; ;) { if (DDInput.DIR_8.IsPound()) { this.TopMenu.SelectIndex--; } if (DDInput.DIR_2.IsPound()) { this.TopMenu.SelectIndex++; } this.TopMenu.SelectIndex += TopMenuTask.ITEM_NUM; this.TopMenu.SelectIndex %= TopMenuTask.ITEM_NUM; if (DDInput.A.GetInput() == 1) // ? 決定ボタン押下 { switch (this.TopMenu.SelectIndex) { case 0: { this.LeaveTitleMenu(); using (new WorldGameMaster()) { WorldGameMaster.I.World = new World("Start"); WorldGameMaster.I.Status = new GameStatus(); WorldGameMaster.I.Perform(); } this.ReturnTitleMenu(); } break; case 1: { this.DrawWall.DeepConfigEntered = true; Ground.P_SaveDataSlot saveDataSlot = LoadGame(); this.DrawWall.DeepConfigEntered = false; if (saveDataSlot != null) { this.LeaveTitleMenu(); using (new WorldGameMaster()) { WorldGameMaster.I.World = new World(saveDataSlot.MapName); WorldGameMaster.I.Status = saveDataSlot.GameStatus.GetClone(); WorldGameMaster.I.Status.StartPointDirection = 101; // スタート地点を「ロード地点」にする。 WorldGameMaster.I.Perform(); } this.ReturnTitleMenu(); } } break; case 2: this.DrawWall.TopMenuLeaved = true; using (new SettingMenu() { SimpleMenu = this.SimpleMenu, SetDeepConfigEntered = flag => this.DrawWall.DeepConfigEntered = flag, }) { SettingMenu.I.Perform(); } this.DrawWall.TopMenuLeaved = false; break; case 3: goto endMenu; default: throw new DDError(); } } if (DDInput.B.GetInput() == 1) // ? キャンセルボタン押下 { if (this.TopMenu.SelectIndex == TopMenuTask.ITEM_NUM - 1) { break; } this.TopMenu.SelectIndex = TopMenuTask.ITEM_NUM - 1; } this.DrawWall.Execute(); this.TopMenu.Execute(); DDEngine.EachFrame(); } endMenu: DDMusicUtils.Fade(); DDCurtain.SetCurtain(30, -1.0); foreach (DDScene scene in DDSceneUtils.Create(40)) { this.SimpleMenu.WallDrawer(); DDEngine.EachFrame(); } DDEngine.FreezeInput(); }
/// <summary> /// ゲーム中のセーブ・ロード画面 /// </summary> /// <param name="saveMode">セーブモードであるか</param> private void SaveOrLoadMenu(bool saveMode) { DDSimpleMenu simpleMenu = new DDSimpleMenu() { Color = new I3Color(255, 255, 255), BorderColor = saveMode ? new I3Color(192, 0, 0) : new I3Color(0, 0, 192), WallPicture = Ground.I.Picture.星屑物語02, WallCurtain = -0.5, }; int selectIndex = 0; for (; ;) { selectIndex = simpleMenu.Perform( saveMode ? "セーブメニュー" : "ロードメニュー", Ground.I.SaveDataSlots.Select(saveDataSlot => saveDataSlot.SavedTime.Year == 1 ? "----" : "[" + saveDataSlot.SavedTime.ToString() + "] " + saveDataSlot.Description).Concat(new string[] { "戻る" }).ToArray(), selectIndex ); if (selectIndex < Consts.SAVE_DATA_SLOT_NUM) { if (saveMode) // ? セーブモード { if (new Confirm() { BorderColor = Ground.I.SaveDataSlots[selectIndex].SerializedGameStatus != null ? new I3Color(255, 0, 0) : new I3Color(150, 150, 0) } .Perform( Ground.I.SaveDataSlots[selectIndex].SerializedGameStatus != null ? "スロット " + (selectIndex + 1) + " のデータを上書きします。" : "スロット " + (selectIndex + 1) + " にセーブします。", "はい", "いいえ") == 0) { string description = "シナリオ:" + this.Status.Scenario.Name + " の " + (this.Status.CurrPageIndex + 1) + " 頁"; Ground.I.SaveDataSlots[selectIndex].SerializedGameStatus = this.Status.Serialize(); Ground.I.SaveDataSlots[selectIndex].SavedTime = new SCommon.SimpleDateTime(SCommon.TimeStampToSec.ToSec(DateTime.Now)); Ground.I.SaveDataSlots[selectIndex].Description = description; } } else // ? ロードモード { if (Ground.I.SaveDataSlots[selectIndex].SerializedGameStatus != null) // ロードする。 { if (new Confirm() { BorderColor = new I3Color(50, 100, 200) } .Perform("スロット " + (selectIndex + 1) + " のデータをロードします。", "はい", "いいえ") == 0) { this.Status = GameStatus.Deserialize(Ground.I.SaveDataSlots[selectIndex].SerializedGameStatus); this.CurrPage = this.Status.Scenario.Pages[this.Status.CurrPageIndex]; this.DispSubtitleCharCount = 0; this.DispCharCount = 0; this.DispPageEndedCount = 0; this.DispFastMode = false; break; } } } } else // [戻る] { break; } //DDEngine.EachFrame(); // 不要 } DDEngine.FreezeInput(GameConsts.LONG_INPUT_SLEEP); }
public void Perform() { DDCurtain.SetCurtain(); DDEngine.FreezeInput(); //Ground.I.Music.Title.Play(); string[] items = new string[] { "テスト01", "テスト02", "テスト03", "設定", "終了", }; int selectIndex = 0; this.SimpleMenu = new DDSimpleMenu(); this.SimpleMenu.WallColor = new I3Color(0, 0, 64); //this.SimpleMenu.WallPicture = Ground.I.Picture.TitleWall; for (; ;) { selectIndex = this.SimpleMenu.Perform("Donut3", items, selectIndex); switch (selectIndex) { case 0: this.LeaveTitleMenu(); new GameTest0001().Perform(); this.ReturnTitleMenu(); break; case 1: this.LeaveTitleMenu(); new GameTest0002().Perform(); this.ReturnTitleMenu(); break; case 2: this.LeaveTitleMenu(); new GameTest0003().Perform(); this.ReturnTitleMenu(); break; case 3: this.Setting(); break; case 4: goto endMenu; default: throw new DDError(); } } endMenu: DDEngine.FreezeInput(); DDMusicUtils.Fade(); DDCurtain.SetCurtain(30, -1.0); foreach (DDScene scene in DDSceneUtils.Create(40)) { this.DrawWall(); DDEngine.EachFrame(); } }
/// <summary> /// ポーズメニュー(デバッグ用) /// </summary> private void DebugPause() { DDMain.KeepMainScreen(); DDSimpleMenu simpleMenu = new DDSimpleMenu() { BorderColor = new I3Color(0, 128, 64), WallDrawer = () => { DDDraw.DrawSimple(DDGround.KeptMainScreen.ToPicture(), 0, 0); DDCurtain.DrawCurtain(-0.5); }, }; DDEngine.FreezeInput(); int selectIndex = 0; for (; ;) { string 現在のキャラクタ; 現在のキャラクタ = "標準(Actor83)"; selectIndex = simpleMenu.Perform( 40, 40, 40, 24, "デバッグ用メニュー", new string[] { "キャラクタ切り替え [ 現在のキャラクタ:" + 現在のキャラクタ + " ] (Lホールド=逆順)", "デバッグ強制遅延 [ 現在の設定:" + DDEngine.SlowdownLevel + " ]", "当たり判定表示 [ 現在の設定:" + this.当たり判定表示 + " ]", "ゲームに戻る", }, selectIndex, true, true ); switch (selectIndex) { case 0: // noop break; case 1: if (DDEngine.SlowdownLevel == 0) { DDEngine.SlowdownLevel++; } else { DDEngine.SlowdownLevel *= 2; } DDEngine.SlowdownLevel %= 16; break; case 2: this.当たり判定表示 = !this.当たり判定表示; break; case 3: goto endLoop; default: throw null; // never } //DDEngine.EachFrame(); // 不要 } endLoop: DDEngine.FreezeInput(); DDInput.A.FreezeInputUntilRelease = true; DDInput.B.FreezeInputUntilRelease = true; }
public void Perform() { DDCurtain.SetCurtain(0, -1.0); DDCurtain.SetCurtain(); DDEngine.FreezeInput(); Ground.I.Music.Title.Play(); string[] items = new string[] { "ゲームスタート", "コンテニュー", "設定", "終了", }; int selectIndex = 0; this.SimpleMenu = new DDSimpleMenu(); this.SimpleMenu.BorderColor = new I3Color(0, 64, 128); this.SimpleMenu.WallDrawer = this.背景.Execute; for (; ;) { selectIndex = this.SimpleMenu.Perform(40, 40, 40, 24, "シューティング ゲーム(仮)", items, selectIndex); bool cheatFlag; { int bk_freezeInputFrame = DDEngine.FreezeInputFrame; DDEngine.FreezeInputFrame = 0; cheatFlag = 1 <= DDInput.DIR_6.GetInput(); DDEngine.FreezeInputFrame = bk_freezeInputFrame; } switch (selectIndex) { case 0: if (DDConfig.LOG_ENABLED && cheatFlag) { this.CheatMainMenu(); } else { this.LeaveTitleMenu(); using (new GameProgressMaster()) { GameProgressMaster.I.Perform(); } this.ReturnTitleMenu(); } break; case 1: { this.LeaveTitleMenu(); using (new GameProgressMaster()) { GameProgressMaster.I.Perform_コンテニュー(); } this.ReturnTitleMenu(); } break; case 2: using (new SettingMenu() { SimpleMenu = this.SimpleMenu, }) { SettingMenu.I.Perform(); } break; case 3: goto endMenu; default: throw new DDError(); } } endMenu: DDMusicUtils.Fade(); DDCurtain.SetCurtain(30, -1.0); foreach (DDScene scene in DDSceneUtils.Create(40)) { this.SimpleMenu.WallDrawer(); DDEngine.EachFrame(); } DDEngine.FreezeInput(); }
/// <summary> /// ポーズメニュー(デバッグ用) /// </summary> private void DebugPause() { DDMain.KeepMainScreen(); DDSimpleMenu simpleMenu = new DDSimpleMenu() { BorderColor = new I3Color(0, 128, 64), WallDrawer = () => { DDDraw.DrawSimple(DDGround.KeptMainScreen.ToPicture(), 0, 0); DDCurtain.DrawCurtain(-0.5); }, }; DDEngine.FreezeInput(); int selectIndex = 0; for (; ;) { string 現在のキャラクタ; if (this.Status.東方キャラ選択中) { 現在のキャラクタ = ResourcePicture2.Player_e_Names[(int)this.Status.東方キャラ]; } else { 現在のキャラクタ = "標準(Actor83)"; } selectIndex = simpleMenu.Perform( 40, 40, 40, 24, "デバッグ用メニュー", new string[] { "キャラクタ切り替え [ 現在のキャラクタ:" + 現在のキャラクタ + " ] (Lホールド=逆順)", "デバッグ強制遅延 [ 現在の設定:" + DDEngine.SlowdownLevel + " ]", "当たり判定表示 [ 現在の設定:" + this.当たり判定表示 + " ]", "ゲームに戻る", }, selectIndex, true, true ); switch (selectIndex) { case 0: { bool backMode; { int bk_freezeInputFrame = DDEngine.FreezeInputFrame; DDEngine.FreezeInputFrame = 0; backMode = 1 <= DDInput.L.GetInput(); DDEngine.FreezeInputFrame = bk_freezeInputFrame; } if (this.Status.東方キャラ選択中) { int chara = (int)this.Status.東方キャラ; if (backMode) { chara--; } else { chara++; } if (0 <= chara && chara < ResourcePicture2.Player_e_Length) { this.Status.東方キャラ = (ResourcePicture2.Player_e)chara; } else { this.Status.東方キャラ選択中 = false; this.Status.東方キャラ = ResourcePicture2.Player_e.Alice; // 適当なキャラを設定しておく } } else { this.Status.東方キャラ選択中 = true; if (backMode) { this.Status.東方キャラ = (ResourcePicture2.Player_e)(ResourcePicture2.Player_e_Length - 1); // 最後のキャラ } else { this.Status.東方キャラ = (ResourcePicture2.Player_e) 0; // 最初のキャラ } } } break; case 1: if (DDEngine.SlowdownLevel == 0) { DDEngine.SlowdownLevel++; } else { DDEngine.SlowdownLevel *= 2; } DDEngine.SlowdownLevel %= 16; break; case 2: this.当たり判定表示 = !this.当たり判定表示; break; case 3: goto endLoop; default: throw null; // never } //DDEngine.EachFrame(); // 不要 } endLoop: DDEngine.FreezeInput(); DDInput.A.FreezeInputUntilRelease = true; DDInput.B.FreezeInputUntilRelease = true; }
public void Perform() { DDCurtain.SetCurtain(0, -1.0); DDCurtain.SetCurtain(); DDEngine.FreezeInput(); Ground.I.Music.Title.Play(); this.SimpleMenu = new DDSimpleMenu(); this.SimpleMenu.BorderColor = new I3Color(0, 96, 192); this.SimpleMenu.WallDrawer = this.DrawWall.Execute; for (; ;) { if (DDInput.DIR_8.IsPound()) { this.TopMenu.SelectIndex--; } if (DDInput.DIR_2.IsPound()) { this.TopMenu.SelectIndex++; } this.TopMenu.SelectIndex += TopMenuTask.ITEM_NUM; this.TopMenu.SelectIndex %= TopMenuTask.ITEM_NUM; if (DDConfig.LOG_ENABLED && DDKey.GetInput(DX.KEY_INPUT_Q) == 1) // (開発デバッグ用)ロック解除 { Ground.I.ReachedStageIndex = 10; } if (DDInput.A.GetInput() == 1) // ? 決定ボタン押下 { switch (this.TopMenu.SelectIndex) { case 0: if (DDConfig.LOG_ENABLED && 1 <= DDInput.DIR_6.GetInput()) { this.DrawWall.TopMenuLeaved = true; this.CheatMainMenu(); this.DrawWall.TopMenuLeaved = false; } else { this.LeaveTitleMenu(); using (new GameProgressMaster()) { GameProgressMaster.I.StartStageIndex = 1; GameProgressMaster.I.Perform(); } this.ReturnTitleMenu(); } break; case 1: this.DrawWall.TopMenuLeaved = true; this.SelectStage(); this.DrawWall.TopMenuLeaved = false; break; case 2: this.DrawWall.TopMenuLeaved = true; this.Setting(); this.DrawWall.TopMenuLeaved = false; break; case 3: goto endMenu; default: throw new DDError(); } } if (DDInput.B.GetInput() == 1) // ? キャンセルボタン押下 { if (this.TopMenu.SelectIndex == TopMenuTask.ITEM_NUM - 1) { break; } this.TopMenu.SelectIndex = TopMenuTask.ITEM_NUM - 1; } this.DrawWall.Execute(); this.TopMenu.Execute(); DDEngine.EachFrame(); } endMenu: DDMusicUtils.Fade(); DDCurtain.SetCurtain(30, -1.0); foreach (DDScene scene in DDSceneUtils.Create(40)) { //this.SimpleMenu.DrawWall(); this.DrawWall.Execute(); DDEngine.EachFrame(); } DDEngine.FreezeInput(); }
public void Perform() { DDCurtain.SetCurtain(); DDEngine.FreezeInput(); Ground.I.Music.Title.Play(); string[] items = new string[] { "ゲームスタート", "迷路の設定", "設定", "終了", }; int selectIndex = 0; this.SimpleMenu = new DDSimpleMenu(); this.SimpleMenu.WallColor = WALL_COLOR; this.SimpleMenu.BorderColor = new I3Color(30, 30, 30); //this.SimpleMenu.WallPicture = Ground.I.Picture.TitleWall; for (; ;) { selectIndex = this.SimpleMenu.Perform("Dungeon", items, selectIndex); switch (selectIndex) { case 0: { DungeonMap dungMap = null; ThreadEx th = new ThreadEx(() => { dungMap = new DungeonMapMaker().MakeDungeonMap( Ground.I.MakeMap_W, Ground.I.MakeMap_H, Ground.I.MakeMap_Seed ); }); for (int c = 0; ; c++) { if (30 < c && th.IsEnded()) { break; } this.DrawWall(); DDPrint.SetPrint(10, 10); DDPrint.SetBorder(new I3Color(128, 64, 0)); DDPrint.Print("マップデータ作成中..."); DDPrint.Reset(); DDEngine.EachFrame(); } this.LeaveTitleMenu(); using (Game game = new Game()) { game.Map = MapLoader.Load(dungMap); game.Perform(); } this.ReturnTitleMenu(); } break; case 1: this.MakeMapSetting(); break; case 2: this.Setting(); break; case 3: goto endMenu; default: throw new DDError(); } } endMenu: DDEngine.FreezeInput(); DDMusicUtils.Fade(); DDCurtain.SetCurtain(30, -1.0); foreach (DDScene scene in DDSceneUtils.Create(40)) { this.DrawWall(); DDEngine.EachFrame(); } }
/// <summary> /// システムメニュー画面 /// </summary> private void SystemMenu() { this.SystemMenu_ReturnToTitleMenu = false; // reset DDSimpleMenu simpleMenu = new DDSimpleMenu() { Color = new I3Color(255, 255, 255), BorderColor = new I3Color(0, 64, 0), //WallPicture = Ground.I.Picture.Title, //WallCurtain = -0.5, WallDrawer = () => { DDPicture picture = Ground.I.Picture.Title; DDDraw.DrawRect( picture, DDUtils.AdjustRectExterior(picture.GetSize().ToD2Size(), new D4Rect(0, 0, DDConsts.Screen_W, DDConsts.Screen_H)) ); DDDraw.SetAlpha(0.5); DDDraw.SetBright(0, 0, 0); DDDraw.DrawRect(Ground.I.Picture.WhiteBox, 0, DDConsts.Screen_H / 4, DDConsts.Screen_W, DDConsts.Screen_H / 2); DDDraw.Reset(); }, X = 150, Y = DDConsts.Screen_H / 4 + 150, }; int selectIndex = 0; for (; ;) { selectIndex = simpleMenu.Perform( "システムメニュー", new string[] { "設定", "タイトルに戻る", "ゲームに戻る", }, selectIndex ); switch (selectIndex) { case 0: using (new SettingMenu()) { SettingMenu.I.Perform(() => { DDPicture picture = Ground.I.Picture.Title; DDDraw.DrawRect( picture, DDUtils.AdjustRectExterior(picture.GetSize().ToD2Size(), new D4Rect(0, 0, DDConsts.Screen_W, DDConsts.Screen_H)) ); DDCurtain.DrawCurtain(-0.5); }); } break; case 1: if (new Confirm().Perform("タイトル画面に戻ります。", "はい", "いいえ") == 0) { this.SystemMenu_ReturnToTitleMenu = true; goto endLoop; } break; case 2: goto endLoop; default: throw null; // never } //DDEngine.EachFrame(); // 不要 } endLoop: DDEngine.FreezeInput(GameConsts.LONG_INPUT_SLEEP); }
private void CheckInputPadButtonKey(bool キー設定Flag, DDInput.Button targetButton) { DDInput.Button[] buttons = new DDInput.Button[] { DDInput.DIR_2, DDInput.DIR_4, DDInput.DIR_6, DDInput.DIR_8, DDInput.A, DDInput.B, DDInput.L, }; if (キー設定Flag) { int pressKeyId = -1; foreach (int keyId in DDSimpleMenu.GetAllKeyId()) { if (DDKey.GetInput(keyId) == 1) { pressKeyId = keyId; } } if (pressKeyId != -1) { // 他ボタンとの重複回避 foreach (DDInput.Button button in buttons) { button.KeyIds = button.KeyIds.Where(keyId => keyId != pressKeyId).ToArray(); } targetButton.KeyIds = targetButton.KeyIds.Concat(new int[] { pressKeyId }).ToArray(); } } else { int pressBtnId = -1; for (int padId = 0; padId < DDPad.GetPadCount(); padId++) { for (int btnId = 0; btnId < DDPad.PAD_BUTTON_MAX; btnId++) { if (DDPad.GetInput(padId, btnId) == 1) { pressBtnId = btnId; } } } if (pressBtnId != -1) { // 他ボタンとの重複回避 foreach (DDInput.Button button in buttons) { button.BtnIds = button.BtnIds.Where(btnId => btnId != pressBtnId).ToArray(); } targetButton.BtnIds = targetButton.BtnIds.Concat(new int[] { pressBtnId }).ToArray(); } } }
public void Perform() { DDCurtain.SetCurtain(); DDEngine.FreezeInput(); //Ground.I.Music.Title.Play(); string[] items = new string[] { "ゲームスタート", "コンテニュー?", "設定", "終了", }; int selectIndex = 0; this.SimpleMenu = new DDSimpleMenu(); this.SimpleMenu.WallColor = WALL_COLOR; //this.SimpleMenu.WallPicture = Ground.I.Picture.TitleWall; for (; ;) { selectIndex = this.SimpleMenu.Perform("Donut2", items, selectIndex); switch (selectIndex) { case 0: { this.LeaveTitleMenu(); using (World world = new World()) { world.Scenarios = new IScenario[] { new Scenario0001(), }; world.Perform(); } this.ReturnTitleMenu(); } break; case 1: // TODO break; case 2: this.Setting(); break; case 3: goto endMenu; default: throw new DDError(); } } endMenu: DDEngine.FreezeInput(); DDMusicUtils.Fade(); DDCurtain.SetCurtain(30, -1.0); foreach (DDScene scene in DDSceneUtils.Create(40)) { this.DrawWall(); DDEngine.EachFrame(); } }
public void Perform() { DDCurtain.SetCurtain(0, -1.0); DDCurtain.SetCurtain(); DDEngine.FreezeInput(); Ground.I.Music.Title.Play(); string[] items = new string[] { "ゲームスタート", "コンテニュー", "設定", "終了", }; int selectIndex = 0; this.SimpleMenu = new DDSimpleMenu() { BorderColor = new I3Color(64, 0, 0), WallDrawer = () => { DDPicture picture = Ground.I.Picture.Title; DDDraw.DrawRect( picture, DDUtils.AdjustRectExterior(picture.GetSize().ToD2Size(), new D4Rect(0, 0, DDConsts.Screen_W, DDConsts.Screen_H)) ); DDCurtain.DrawCurtain(-0.4); }, }; for (; ;) { selectIndex = this.SimpleMenu.Perform(40, 40, 40, 24, "横スクロール アクションゲーム タイプ-M テストコード / タイトルメニュー", items, selectIndex); switch (selectIndex) { case 0: { this.LeaveTitleMenu(); using (new WorldGameMaster()) { WorldGameMaster.I.World = new World("t0001"); // マップ名_仮? WorldGameMaster.I.Status = new GameStatus(); WorldGameMaster.I.Perform(); } this.ReturnTitleMenu(); } break; case 1: { Ground.P_SaveDataSlot saveDataSlot = LoadGame(); if (saveDataSlot != null) { this.LeaveTitleMenu(); using (new WorldGameMaster()) { WorldGameMaster.I.World = new World(saveDataSlot.MapName); WorldGameMaster.I.Status = saveDataSlot.GameStatus.GetClone(); WorldGameMaster.I.Status.StartPointDirection = 101; // スタート地点を「ロード地点」にする。 WorldGameMaster.I.Perform(); } this.ReturnTitleMenu(); } } break; case 2: using (new SettingMenu() { SimpleMenu = this.SimpleMenu, }) { SettingMenu.I.Perform(); } break; case 3: goto endMenu; default: throw new DDError(); } } endMenu: DDMusicUtils.Fade(); DDCurtain.SetCurtain(30, -1.0); foreach (DDScene scene in DDSceneUtils.Create(40)) { this.SimpleMenu.WallDrawer(); DDEngine.EachFrame(); } DDEngine.FreezeInput(); }
/// <summary> /// ポーズメニュー(デバッグ用) /// </summary> private void DebugPause() { DDMain.KeepMainScreen(); DDSimpleMenu simpleMenu = new DDSimpleMenu() { Color = new I3Color(255, 255, 255), BorderColor = new I3Color(0, 128, 64), WallPicture = DDGround.KeptMainScreen.ToPicture(), WallCurtain = -0.5, }; DDEngine.FreezeInput(); int selectIndex = 0; for (; ;) { selectIndex = simpleMenu.Perform( "デバッグ用メニュー", new string[] { "キャラクタ切り替え [ 現在のキャラクタ:---- ]", "デバッグ強制遅延 [ 現在の設定:" + DDEngine.SlowdownLevel + " ]", "当たり判定表示 [ 現在の設定:" + this.当たり判定表示 + " ]", "ゲームに戻る", }, selectIndex, true, true ); switch (selectIndex) { case 0: break; case 1: if (DDEngine.SlowdownLevel == 0) { DDEngine.SlowdownLevel++; } else { DDEngine.SlowdownLevel *= 2; } DDEngine.SlowdownLevel %= 16; break; case 2: this.当たり判定表示 = !this.当たり判定表示; break; case 3: goto endLoop; default: throw null; // never } //DDEngine.EachFrame(); // 不要 } endLoop: DDEngine.FreezeInput(); DDInput.A.FreezeInputUntilRelease = true; DDInput.B.FreezeInputUntilRelease = true; }
public void Perform() { DDUtils.SetMouseDispMode(true); // 2bs -- 既にマウス有効であるはず DDCurtain.SetCurtain(0, -1.0); DDCurtain.SetCurtain(); DDEngine.FreezeInput(); Ground.I.Music.Title.Play(); this.SimpleMenu = new DDSimpleMenu(); this.SimpleMenu.Color = new I3Color(255, 255, 128); this.SimpleMenu.BorderColor = new I3Color(0, 0, 100); this.SimpleMenu.WallDrawer = this.DrawWall.Execute; for (; ;) { this.DrawWall.Execute(); this.TopMenu.Execute(); int moving = 0; if (DDInput.DIR_8.IsPound()) { moving = -1; } if (DDInput.DIR_2.IsPound()) { moving = 1; } if (moving != 0) { if (this.TopMenu.SelectIndex == -1) { this.TopMenu.SelectIndex = moving == 1 ? 0 : TopMenuTask.ITEM_NUM - 1; } else { this.TopMenu.SelectIndex += moving; this.TopMenu.SelectIndex += TopMenuTask.ITEM_NUM; this.TopMenu.SelectIndex %= TopMenuTask.ITEM_NUM; } this.TopMenu.Items[this.TopMenu.SelectIndex].マウスカーソルをここへ移動(); } if ( this.TopMenu.SelectIndex != -1 && ( DDMouse.L.GetInput() == -1 || DDInput.A.GetInput() == 1 ) ) { switch (this.TopMenu.SelectIndex) { case 0: { this.LeaveTitleMenu(); using (new Game()) { Game.I.Status.Scenario = new Scenario(GameConsts.FIRST_SCENARIO_NAME); Game.I.Perform(); } this.ReturnTitleMenu(); } break; case 1: { #if true this.DrawWall.TopMenuLeaved = true; SaveDataSlot saveDataSlot; using (new SaveOrLoadMenu()) { saveDataSlot = SaveOrLoadMenu.I.Load(this.DrawWall.Execute); } this.DrawWall.TopMenuLeaved = false; #else // old this.DrawWall.TopMenuLeaved = true; SaveDataSlot saveDataSlot = this.LoadGame(); this.DrawWall.TopMenuLeaved = false; #endif if (saveDataSlot != null) { this.LeaveTitleMenu(); using (new Game()) { Game.I.Status = GameStatus.Deserialize(saveDataSlot.SerializedGameStatus); Game.I.Perform(true); } this.ReturnTitleMenu(); } } break; case 2: #if true this.DrawWall.TopMenuLeaved = true; using (new SettingMenu()) { SettingMenu.I.Perform(this.DrawWall.Execute); } this.DrawWall.TopMenuLeaved = false; #else // old this.DrawWall.TopMenuLeaved = true; this.Setting(); this.DrawWall.TopMenuLeaved = false; #endif break; case 3: goto endMenu; default: throw null; // never } } if (DDMouse.R.GetInput() == -1) { goto endMenu; } if (DDInput.B.GetInput() == 1) { if (this.TopMenu.SelectIndex == TopMenuTask.ITEM_NUM - 1) { goto endMenu; } this.TopMenu.Items[TopMenuTask.ITEM_NUM - 1].マウスカーソルをここへ移動(); } DDEngine.EachFrame(); } endMenu: DDMusicUtils.Fade(); DDCurtain.SetCurtain(30, -1.0); foreach (DDScene scene in DDSceneUtils.Create(40)) { this.SimpleMenu.DrawWall(); DDEngine.EachFrame(); } DDEngine.FreezeInput(); }
private bool CheckInputPadButtonKey(bool キー設定Flag, DDInput.Button targetButton) // ret: 設定した。 { DDInput.Button[] buttons = new DDInput.Button[] { DDInput.DIR_2, DDInput.DIR_4, DDInput.DIR_6, DDInput.DIR_8, DDInput.A, DDInput.B, DDInput.L, }; if (キー設定Flag) { int pressKeyId = -1; foreach (int keyId in DDSimpleMenu.GetAllKeyId()) { if (DDKey.GetInput(keyId) == 1) { pressKeyId = keyId; } } if (pressKeyId != -1) { int[] keyIds; switch (pressKeyId) { case DX.KEY_INPUT_LCONTROL: case DX.KEY_INPUT_RCONTROL: keyIds = new int[] { DX.KEY_INPUT_LCONTROL, DX.KEY_INPUT_RCONTROL }; break; case DX.KEY_INPUT_LSHIFT: case DX.KEY_INPUT_RSHIFT: keyIds = new int[] { DX.KEY_INPUT_LSHIFT, DX.KEY_INPUT_RSHIFT }; break; case DX.KEY_INPUT_LALT: case DX.KEY_INPUT_RALT: keyIds = new int[] { DX.KEY_INPUT_LALT, DX.KEY_INPUT_RALT }; break; default: keyIds = new int[] { pressKeyId }; break; } // 他ボタンとの重複回避 if (SCommon.Comp(targetButton.KeyIds, keyIds, SCommon.Comp) != 0) // ? 違う { foreach (DDInput.Button button in buttons) { if (SCommon.Comp(button.KeyIds, keyIds, SCommon.Comp) == 0) // ? 同じ { button.KeyIds = targetButton.KeyIds; } } } targetButton.KeyIds = keyIds; return(true); } } else { int pressBtnId = -1; for (int padId = 0; padId < DDPad.GetPadCount(); padId++) { for (int btnId = 0; btnId < DDPad.PAD_BUTTON_MAX; btnId++) { if (DDPad.GetInput(padId, btnId) == 1) { pressBtnId = btnId; } } } if (pressBtnId != -1) { int[] btnIds = new int[] { pressBtnId }; // 他ボタンとの重複回避 if (SCommon.Comp(targetButton.BtnIds, btnIds, SCommon.Comp) != 0) // ? 違う { foreach (DDInput.Button button in buttons) { if (SCommon.Comp(button.BtnIds, btnIds, SCommon.Comp) == 0) // ? 同じ { button.BtnIds = targetButton.BtnIds; } } } targetButton.BtnIds = btnIds; return(true); } } return(false); }
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) ); }