private void UIToCfg(thCom th, ref byte[] data) { th.inData(data); // Game-specific if (th is th06) { ((th06)th).dontUseTrialVerMenuColor = chkNoTrialMenuColor.Checked; ((th06)th).initialBomb = (int)numBomb.Value; } if (th is th09) { ((th09)th).controlType_1P = (rdoTh09_1P_pad1.Checked ? thCom.CONTROL_TYPE.GAMEPAD1 : (rdoTh09_1P_pad2.Checked ? thCom.CONTROL_TYPE.GAMEPAD2 : (rdoTh09_1P_all.Checked ? thCom.CONTROL_TYPE.KEYBOARD_ALL : (rdoTh09_1P_left.Checked ? thCom.CONTROL_TYPE.KEYBOARD_LEFT : thCom.CONTROL_TYPE.KEYBOARD_RIGHT )))); ((th09)th).chargeViaShift_1P = rdoTh09_1P_charge.Checked; ((th09)th).controlType_2P = (rdoTh09_2P_pad1.Checked ? thCom.CONTROL_TYPE.GAMEPAD1 : (rdoTh09_2P_pad2.Checked ? thCom.CONTROL_TYPE.GAMEPAD2 : (rdoTh09_2P_all.Checked ? thCom.CONTROL_TYPE.KEYBOARD_ALL : (rdoTh09_2P_left.Checked ? thCom.CONTROL_TYPE.KEYBOARD_LEFT : thCom.CONTROL_TYPE.KEYBOARD_RIGHT )))); ((th09)th).chargeViaShift_2P = rdoTh09_2P_charge.Checked; } if (th is th10) { ((th10)th).showFaithMeterNearPlayer = chkFaithMeterNearPlayer.Checked; } // BGM & SE th.bgmMode = (rdoNoBGM.Checked ? thCom.BGM.OFF : ( rdoWAV.Checked ? thCom.BGM.WAV : thCom.BGM.MID )); th.seEnabled = chkSEenabled.Checked; if (!(th is th06 | th is th07)) { th.bgmVol = (int)numBGMvol.Value; th.seVol = (int)numSEvol.Value; } // Color & FPS & Joypad sen th.color = (rdo32bitColor.Checked ? thCom.COLOR._32BIT : thCom.COLOR._16BIT); th.fps = (rdo60fps.Checked ? thCom.FPS._60FPS : ( rdo30fps.Checked ? thCom.FPS._30FPS : thCom.FPS._20FPS )); th.joypadSen = (int)numJoySen.Value; // Display & InputLat & WinPos if (th is thCom_th11) { var _11 = (thCom_th11)th; // TH14++ use DISP3 instead if (th is th14) { var _14 = (th14)th; if (chkFullscreen.Checked) { _14.display = (rdoLowRes.Checked ? thCom.DISP3.LOW : ( rdoMedRes.Checked ? thCom.DISP3.MED : thCom.DISP3.HIGH )); } else { _14.display = (rdoLowRes.Checked ? thCom.DISP3.LOW_WIN : ( rdoMedRes.Checked ? thCom.DISP3.MED_WIN : thCom.DISP3.HIGH_WIN )); } } else { if (chkFullscreen.Checked) { _11.display = thCom.DISP2.FULL; } else { _11.display = (rdoLowRes.Checked ? thCom.DISP2.LOW_WIN : ( rdoMedRes.Checked ? thCom.DISP2.MED_WIN : thCom.DISP2.HIGH_WIN )); } } _11.inputLatency = (rdoStableIL.Checked ? thCom.INPUT_LAT.STABLE : ( rdoNormalIL.Checked ? thCom.INPUT_LAT.NORMAL : ( rdoAutoIL.Checked ? thCom.INPUT_LAT.AUTO : thCom.INPUT_LAT.FAST ))); _11.winPosX = (int)numWinPosX.Value; _11.winPosY = (int)numWinPosY.Value; } else // th06 ~ th10 { th.display = (chkFullscreen.Checked ? thCom.DISP.FULL : thCom.DISP.WIN); } // Default Diffi & Initial Life if (th is thCom_oldGen & !(th is th095)) { var _og = (thCom_oldGen)th; _og.defDifficulty = (rdoEasyDiffi.Checked ? thCom.DIFFICULTY.EASY : ( rdoNormalDiffi.Checked ? thCom.DIFFICULTY.NORMAL : ( rdoHardDiffi.Checked ? thCom.DIFFICULTY.HARD : thCom.DIFFICULTY.LUNATIC ))); _og.initialLife = (int)numLife.Value; } // OLDFLAGS if (th is thCom_th06_07_08) { var _678 = (thCom_th06_07_08)th; _678.clearBackbufferOnRefresh = chkClearBackbuffer.Checked; _678.force60frames = chkForce60frames.Checked; _678.noColorCompoToTextures = chkNoColorCompo.Checked; _678.noDepthTest = chkNoDepthTest.Checked; _678.noDirectInputForJoypad = chkNoDirectInput.Checked; _678.noFog = chkNoFog.Checked; _678.noVertexBuffer = chkNoVertexBuffer.Checked; _678.showMinGraphics = chkMinGraphics.Checked; _678.use16bitTextures = chkUse16bitTextures.Checked; _678.useLesserGouraudShading = chkUseLesserGS.Checked; _678.useRefRasterizer = chkUseRefRasterizer.Checked; if (th is thCom_th07_th08) { var _78 = (thCom_th07_th08)th; _78.focusWhileShot = chkFocusShot.Checked; _78.fullyRedrawOnRefresh = chkFullyRedraw.Checked; _78.loadBGMintoRAM = chkLoadBGMintoRAM.Checked; _78.noVerticalSync = chkNoVerticalSync.Checked; _78.slowMode = chkSlowMode.Checked; } } if (th is thCom_th09_th095) { var _09x = (thCom_th09_th095)th; _09x.loadBGMintoRAM = chkLoadBGMintoRAM.Checked; _09x.noDirectInputForJoypad = chkNoDirectInput.Checked; _09x.noFog = chkNoFog.Checked; _09x.noVerticalSync = chkNoVerticalSync.Checked; _09x.use16bitTextures = chkUse16bitTextures.Checked; _09x.useRefRasterizer = chkUseRefRasterizer.Checked; } // FLAGS if (th is thCom_th10) { var _10 = (thCom_th10)th; _10.askAtStartup = chkAskAtStartup.Checked; _10.focusWhileShot = chkFocusShot.Checked; _10.noDirectInputForJoypad = chkNoDirectInput.Checked; } data = th.outData(); }
private void CfgToUI(thCom th, byte[] data) { th.inData(data); // Game-specific if (th is th06) { chkNoTrialMenuColor.Checked = ((th06)th).dontUseTrialVerMenuColor; numBomb.Value = ((th06)th).initialBomb; } if (th is th09) { switch (((th09)th).controlType_1P) { case thCom.CONTROL_TYPE.GAMEPAD1: rdoTh09_1P_pad1.Checked = true; break; case thCom.CONTROL_TYPE.GAMEPAD2: rdoTh09_1P_pad2.Checked = true; break; case thCom.CONTROL_TYPE.KEYBOARD_ALL: rdoTh09_1P_all.Checked = true; break; case thCom.CONTROL_TYPE.KEYBOARD_LEFT: rdoTh09_1P_left.Checked = true; break; case thCom.CONTROL_TYPE.KEYBOARD_RIGHT: rdoTh09_1P_right.Checked = true; break; } (((th09)th).chargeViaShift_1P ? rdoTh09_1P_charge : rdoTh09_1P_slow ).Checked = true; switch (((th09)th).controlType_2P) { case thCom.CONTROL_TYPE.GAMEPAD1: rdoTh09_2P_pad1.Checked = true; break; case thCom.CONTROL_TYPE.GAMEPAD2: rdoTh09_2P_pad2.Checked = true; break; case thCom.CONTROL_TYPE.KEYBOARD_ALL: rdoTh09_2P_all.Checked = true; break; case thCom.CONTROL_TYPE.KEYBOARD_LEFT: rdoTh09_2P_left.Checked = true; break; case thCom.CONTROL_TYPE.KEYBOARD_RIGHT: rdoTh09_2P_right.Checked = true; break; } (((th09)th).chargeViaShift_2P ? rdoTh09_2P_charge : rdoTh09_2P_slow).Checked = true; } if (th is th10) { chkFaithMeterNearPlayer.Checked = ((th10)th).showFaithMeterNearPlayer; } // BGM & SE switch (th.bgmMode) { case thCom.BGM.OFF: rdoNoBGM.Checked = true; break; case thCom.BGM.WAV: rdoWAV.Checked = true; break; case thCom.BGM.MID: rdoMIDI.Checked = true; break; } chkSEenabled.Checked = th.seEnabled; if (!(th is th06 | th is th07)) { numBGMvol.Value = th.bgmVol; numSEvol.Value = th.seVol; } // Color & FPS & Joypad sen (th.color == thCom.COLOR._32BIT ? rdo32bitColor : rdo16bitColor).Checked = true; switch (th.fps) { case thCom.FPS._60FPS: rdo60fps.Checked = true; break; case thCom.FPS._30FPS: rdo30fps.Checked = true; break; case thCom.FPS._20FPS: rdo20fps.Checked = true; break; } numJoySen.Value = th.joypadSen; // Display & InputLat & WinPos if (th is thCom_th11) { var _11 = (thCom_th11)th; // TH14++ use DISP3 instead if (th is th14) { var _14 = (th14)th; switch (_14.display) { case thCom.DISP3.LOW: chkFullscreen.Checked = true; rdoLowRes.Checked = true; break; case thCom.DISP3.MED: chkFullscreen.Checked = true; rdoMedRes.Checked = true; break; case thCom.DISP3.HIGH: chkFullscreen.Checked = true; rdoHighRes.Checked = true; break; case thCom.DISP3.LOW_WIN: chkFullscreen.Checked = false; rdoLowRes.Checked = true; break; case thCom.DISP3.MED_WIN: chkFullscreen.Checked = false; rdoMedRes.Checked = true; break; case thCom.DISP3.HIGH_WIN: chkFullscreen.Checked = false; rdoHighRes.Checked = true; break; } } else { switch (_11.display) { case thCom.DISP2.FULL: chkFullscreen.Checked = true; rdoLowRes.Checked = true; break; case thCom.DISP2.LOW_WIN: chkFullscreen.Checked = false; rdoLowRes.Checked = true; break; case thCom.DISP2.MED_WIN: chkFullscreen.Checked = false; rdoMedRes.Checked = true; break; case thCom.DISP2.HIGH_WIN: chkFullscreen.Checked = false; rdoHighRes.Checked = true; break; } } switch (_11.inputLatency) { case thCom.INPUT_LAT.STABLE: rdoStableIL.Checked = true; break; case thCom.INPUT_LAT.NORMAL: rdoNormalIL.Checked = true; break; case thCom.INPUT_LAT.AUTO: rdoAutoIL.Checked = true; break; case thCom.INPUT_LAT.FAST: rdoFastIL.Checked = true; break; } numWinPosX.Value = _11.winPosX; numWinPosY.Value = _11.winPosY; } else // th06 ~ th10 { chkFullscreen.Checked = (th.display == thCom.DISP.FULL); } // Default Diffi & Initial Life if (th is thCom_oldGen & !(th is th095)) { var _og = (thCom_oldGen)th; switch (_og.defDifficulty) { case thCom.DIFFICULTY.EASY: rdoEasyDiffi.Checked = true; break; case thCom.DIFFICULTY.NORMAL: rdoNormalDiffi.Checked = true; break; case thCom.DIFFICULTY.HARD: rdoHardDiffi.Checked = true; break; case thCom.DIFFICULTY.LUNATIC: rdoLunaticDiffi.Checked = true; break; } numLife.Value = _og.initialLife; } // OLDFLAGS if (th is thCom_th06_07_08) { var _678 = (thCom_th06_07_08)th; chkClearBackbuffer.Checked = _678.clearBackbufferOnRefresh; chkForce60frames.Checked = _678.force60frames; chkNoColorCompo.Checked = _678.noColorCompoToTextures; chkNoDepthTest.Checked = _678.noDepthTest; chkNoDirectInput.Checked = _678.noDirectInputForJoypad; chkNoFog.Checked = _678.noFog; chkNoVertexBuffer.Checked = _678.noVertexBuffer; chkMinGraphics.Checked = _678.showMinGraphics; chkUse16bitTextures.Checked = _678.use16bitTextures; chkUseLesserGS.Checked = _678.useLesserGouraudShading; chkUseRefRasterizer.Checked = _678.useRefRasterizer; if (th is thCom_th07_th08) { var _78 = (thCom_th07_th08)th; chkFocusShot.Checked = _78.focusWhileShot; chkFullyRedraw.Checked = _78.fullyRedrawOnRefresh; chkLoadBGMintoRAM.Checked = _78.loadBGMintoRAM; chkNoVerticalSync.Checked = _78.noVerticalSync; chkSlowMode.Checked = _78.slowMode; } } if (th is thCom_th09_th095) { var _09x = (thCom_th09_th095)th; chkLoadBGMintoRAM.Checked = _09x.loadBGMintoRAM; chkNoDirectInput.Checked = _09x.noDirectInputForJoypad; chkNoFog.Checked = _09x.noFog; chkNoVerticalSync.Checked = _09x.noVerticalSync; chkUse16bitTextures.Checked = _09x.use16bitTextures; chkUseRefRasterizer.Checked = _09x.useRefRasterizer; } // FLAGS if (th is thCom_th10) { var _10 = (thCom_th10)th; chkAskAtStartup.Checked = _10.askAtStartup; chkFocusShot.Checked = _10.focusWhileShot; chkNoDirectInput.Checked = _10.noDirectInputForJoypad; } }