From fcf4f80b34d339a20ff9104a17d19e9a497661a4 Mon Sep 17 00:00:00 2001 From: Julian Holfeld Date: Wed, 23 Oct 2024 17:37:21 +0200 Subject: [PATCH] File Scoped Namespace Declarations (#716) * refactor: file-scoped namespace OpenTaiko * refactor: file-scoped namespace FDK * refactor: dotnet format --- FDK/src/00.Common/CActivity.cs | 292 +- FDK/src/00.Common/CConversion.cs | 462 +- FDK/src/00.Common/CCounter.cs | 536 +- FDK/src/00.Common/CFPS.cs | 114 +- FDK/src/00.Common/CIniFile.cs | 175 +- FDK/src/00.Common/CIntervalProcessing.cs | 76 +- FDK/src/00.Common/CJudgeTextEncoding.cs | 118 +- FDK/src/00.Common/CTimer.cs | 270 +- FDK/src/00.Common/CTimerBase.cs | 280 +- FDK/src/00.Common/CTraceLogListener.cs | 208 +- FDK/src/00.Common/CUtility.cs | 194 +- FDK/src/00.Common/Color4.cs | 36 +- .../ExtensionMethods/DoubleExtensions.cs | 10 +- .../ExtensionMethods/Int32Extensions.cs | 10 +- FDK/src/01.Framework/Core/Game.cs | 879 +- FDK/src/01.Framework/Core/GameWindowSize.cs | 10 +- FDK/src/01.Framework/Rendering/Angle/Egl.cs | 634 +- FDK/src/02.Input/CInputGamepad.cs | 274 +- FDK/src/02.Input/CInputJoystick.cs | 290 +- FDK/src/02.Input/CInputKeyboard.cs | 270 +- FDK/src/02.Input/CInputMIDI.cs | 206 +- FDK/src/02.Input/CInputManager.cs | 380 +- FDK/src/02.Input/CInputMouse.cs | 254 +- FDK/src/02.Input/DeviceConstantConverter.cs | 330 +- FDK/src/02.Input/IInputDevice.cs | 60 +- FDK/src/02.Input/InputDeviceType.cs | 19 +- FDK/src/02.Input/STInputEvent.cs | 19 +- FDK/src/02.Input/SlimDXKeys.cs | 322 +- FDK/src/03.Sound/CSound.cs | 1339 +- FDK/src/03.Sound/CSoundDeviceASIO.cs | 740 +- FDK/src/03.Sound/CSoundDeviceBASS.cs | 392 +- FDK/src/03.Sound/CSoundDeviceWASAPI.cs | 776 +- FDK/src/03.Sound/CSoundTimer.cs | 184 +- FDK/src/03.Sound/ESoundDeviceType.cs | 16 +- FDK/src/03.Sound/ESoundGroup.cs | 16 +- .../ExtensionMethods/BassMixExtensions.cs | 22 +- FDK/src/03.Sound/ISoundDevice.cs | 24 +- FDK/src/03.Sound/LoudnessMetadata.cs | 28 +- FDK/src/03.Sound/LoudnessMetadataScanner.cs | 496 +- FDK/src/03.Sound/Lufs.cs | 56 +- FDK/src/03.Sound/SongGainController.cs | 42 +- FDK/src/03.Sound/SoundGroupLevelController.cs | 188 +- FDK/src/03.Sound/SoundManager.cs | 730 +- FDK/src/04.Graphics/BitmapUtil.cs | 106 +- FDK/src/04.Graphics/CDecodedFrame.cs | 72 +- FDK/src/04.Graphics/CFrameConverter.cs | 106 +- FDK/src/04.Graphics/CTexture.cs | 1666 +- FDK/src/04.Graphics/CTextureAutofold.cs | 312 +- .../CTextureCreateFailedException.cs | 32 +- FDK/src/04.Graphics/CVideoDecoder.cs | 472 +- .../TextRenderer/CCachedFontRenderer.cs | 464 +- .../04.Graphics/TextRenderer/CFontRenderer.cs | 459 +- .../TextRenderer/CSkiaSharpTextRenderer.cs | 510 +- .../04.Graphics/TextRenderer/ITextRenderer.cs | 12 +- OpenTaiko/src/Animations/Animator.cs | 172 +- OpenTaiko/src/Animations/EaseIn.cs | 50 +- OpenTaiko/src/Animations/EaseInOut.cs | 60 +- OpenTaiko/src/Animations/EaseOut.cs | 52 +- OpenTaiko/src/Animations/FadeIn.cs | 42 +- OpenTaiko/src/Animations/FadeOut.cs | 42 +- OpenTaiko/src/Animations/IAnimatable.cs | 50 +- OpenTaiko/src/Animations/Linear.cs | 50 +- OpenTaiko/src/Character/CMenuCharacter.cs | 464 +- OpenTaiko/src/Character/CResultCharacter.cs | 390 +- OpenTaiko/src/Character/PuchiChara.cs | 186 +- OpenTaiko/src/Common/BestPlayRecords.cs | 372 +- OpenTaiko/src/Common/CConfigIni.cs | 7060 +++--- OpenTaiko/src/Common/CConstants.cs | 747 +- OpenTaiko/src/Common/CCrypto.cs | 34 +- OpenTaiko/src/Common/CHitSounds.cs | 104 +- OpenTaiko/src/Common/CPad.cs | 328 +- OpenTaiko/src/Common/CSavableT.cs | 52 +- OpenTaiko/src/Common/CSkin.cs | 18537 ++++++++-------- OpenTaiko/src/Common/CSongDict.cs | 530 +- OpenTaiko/src/Common/CTextConsole.cs | 178 +- .../ConfigIniToSongGainControllerBinder.cs | 56 +- ...figIniToSoundGroupLevelControllerBinder.cs | 106 +- OpenTaiko/src/Common/ConfigManager.cs | 74 +- OpenTaiko/src/Common/Easing.cs | 358 +- OpenTaiko/src/Common/Favorites.cs | 81 +- OpenTaiko/src/Common/ImGuiDebugWindow.cs | 962 +- .../KeyboardSoundGroupLevelControlHandler.cs | 82 +- OpenTaiko/src/Common/LogNotification.cs | 76 +- OpenTaiko/src/Common/Modal.cs | 92 +- OpenTaiko/src/Common/ModalQueue.cs | 82 +- OpenTaiko/src/Common/NamePlateConfig.cs | 412 +- OpenTaiko/src/Common/OpenTaiko.cs | 4564 ++-- OpenTaiko/src/Common/Program.cs | 276 +- OpenTaiko/src/Common/RecentlyPlayedSongs.cs | 73 +- OpenTaiko/src/Common/SaveFile.cs | 608 +- OpenTaiko/src/Common/TitleTextureKey.cs | 251 +- OpenTaiko/src/Components/CGimmickValue.cs | 6 +- OpenTaiko/src/Components/CLocalizationData.cs | 38 +- OpenTaiko/src/Components/CSongReplay.cs | 954 +- OpenTaiko/src/Components/CVisualLogManager.cs | 90 +- OpenTaiko/src/Databases/DBCDN.cs | 102 +- OpenTaiko/src/Databases/DBCharacter.cs | 162 +- .../src/Databases/DBEncyclopediaMenus.cs | 32 +- .../src/Databases/DBNameplateUnlockables.cs | 146 +- OpenTaiko/src/Databases/DBPuchichara.cs | 150 +- OpenTaiko/src/Databases/DBSaves.cs | 630 +- OpenTaiko/src/Databases/DBSkinPreset.cs | 86 +- OpenTaiko/src/Databases/DBSongUnlockables.cs | 168 +- OpenTaiko/src/Databases/DBUnlockables.cs | 892 +- OpenTaiko/src/Databases/Databases.cs | 24 +- OpenTaiko/src/Helpers/HDatabaseHelpers.cs | 26 +- OpenTaiko/src/Helpers/HEasingMethods.cs | 572 +- OpenTaiko/src/Helpers/HGaugeMethods.cs | 1320 +- OpenTaiko/src/Helpers/HGenreBar.cs | 20 +- OpenTaiko/src/Helpers/HLocalizedPath.cs | 34 +- OpenTaiko/src/Helpers/HPrivateFastFont.cs | 50 +- OpenTaiko/src/Helpers/HRarity.cs | 124 +- OpenTaiko/src/Helpers/HScenePreset.cs | 118 +- OpenTaiko/src/Helpers/HSongTraverse.cs | 32 +- .../src/Helpers/LocalizedStringConverter.cs | 30 +- OpenTaiko/src/Helpers/SevenZipHelper.cs | 313 +- OpenTaiko/src/I18N/CLang.cs | 202 +- OpenTaiko/src/I18N/ILang.cs | 148 +- OpenTaiko/src/Items/CItemBase.cs | 218 +- OpenTaiko/src/Items/CItemInteger.cs | 200 +- OpenTaiko/src/Items/CItemList.cs | 227 +- OpenTaiko/src/Items/CItemThreeState.cs | 222 +- OpenTaiko/src/Items/CItemToggle.cs | 164 +- OpenTaiko/src/Lua/CLuaScript.cs | 450 +- OpenTaiko/src/Lua/Infos/CLuaFps.cs | 10 +- OpenTaiko/src/Lua/Infos/CLuaInfo.cs | 22 +- OpenTaiko/src/Lua/Scripts/CLuaModalScript.cs | 68 +- .../src/Lua/Scripts/CLuaNamePlateScript.cs | 86 +- OpenTaiko/src/Songs/CBoxDef.cs | 218 +- OpenTaiko/src/Songs/CCourse.cs | 56 +- OpenTaiko/src/Songs/CDTX.cs | 13288 +++++------ .../src/Songs/CDTXCompanionFileFinder.cs | 326 +- OpenTaiko/src/Songs/CDTXStyleExtractor.cs | 828 +- OpenTaiko/src/Songs/CScoreIni.cs | 28 +- OpenTaiko/src/Songs/CScoreIni_Importer.cs | 416 +- OpenTaiko/src/Songs/CSongListNode.cs | 248 +- OpenTaiko/src/Songs/CSongUniqueID.cs | 98 +- OpenTaiko/src/Songs/CSong管理.cs | 1753 +- OpenTaiko/src/Songs/CStrジャンルtoNum.cs | 104 +- OpenTaiko/src/Songs/Cスコア.cs | 510 +- .../C曲リストノードComparers/ComparerChain.cs | 36 +- .../C曲リストノードComparerAC15.cs | 10 +- .../C曲リストノードComparerAC8_14.cs | 10 +- .../C曲リストノードComparerLevel.cs | 38 +- .../C曲リストノードComparerLevelIcon.cs | 38 +- .../C曲リストノードComparerSubtitle.cs | 18 +- .../C曲リストノードComparerタイトル.cs | 18 +- .../C曲リストノードComparerノード種別.cs | 42 +- .../C曲リストノードComparer絶対パス.cs | 44 +- OpenTaiko/src/Songs/Dan-C.cs | 626 +- OpenTaiko/src/Songs/Extended/CSongObject.cs | 166 +- OpenTaiko/src/Songs/GaugeIncreaseMode.cs | 48 +- OpenTaiko/src/Songs/VTTParser.cs | 826 +- OpenTaiko/src/Stages/01.StartUp/CCharacter.cs | 110 +- .../src/Stages/01.StartUp/CPuchichara.cs | 134 +- OpenTaiko/src/Stages/01.StartUp/CStage起動.cs | 408 +- .../src/Stages/01.StartUp/TextureLoader.cs | 5432 ++--- .../src/Stages/02.Title/CActEnumSongs.cs | 204 +- .../Stages/02.Title/CActScanningLoudness.cs | 60 +- OpenTaiko/src/Stages/02.Title/CEnumSongs.cs | 794 +- OpenTaiko/src/Stages/02.Title/CMainMenuTab.cs | 322 +- .../src/Stages/02.Title/CStageタイトル.cs | 1732 +- .../Stages/04.Config/CActCalibrationMode.cs | 386 +- .../Stages/04.Config/CActConfigKeyAssign.cs | 754 +- .../src/Stages/04.Config/CActConfigList.cs | 3196 +-- .../src/Stages/04.Config/CStageコンフィグ.cs | 1184 +- .../05.DaniSelect/CActSelect段位リスト.cs | 1781 +- .../CActSelect段位挑戦選択画面.cs | 152 +- .../Stages/05.DaniSelect/CStage段位選択.cs | 606 +- OpenTaiko/src/Stages/05.SongSelect/AnimeBG.cs | 36 +- .../Stages/05.SongSelect/CActPlayOption.cs | 1264 +- .../05.SongSelect/CActSelectArtistComment.cs | 404 +- .../Stages/05.SongSelect/CActSelectDanInfo.cs | 300 +- .../CActSelectExExtraTransAnime.cs | 228 +- .../05.SongSelect/CActSelectInformation.cs | 222 +- .../05.SongSelect/CActSelectPopupMenu.cs | 870 +- .../05.SongSelect/CActSelectPreimageパネル.cs | 290 +- .../05.SongSelect/CActSelectPresound.cs | 380 +- .../05.SongSelect/CActSelectQuickConfig.cs | 372 +- .../CActSelectShowCurrentPosition.cs | 118 +- .../05.SongSelect/CActSelectSongInfo.cs | 162 +- .../05.SongSelect/CActSelectTowerInfo.cs | 82 +- .../CActSelectステータスパネル.cs | 80 +- .../05.SongSelect/CActSelect曲リスト.cs | 5738 ++--- .../05.SongSelect/CActSelect演奏履歴パネル.cs | 348 +- .../05.SongSelect/CActSelect難易度選択画面.cs | 920 +- .../src/Stages/05.SongSelect/CActSortSongs.cs | 150 +- .../src/Stages/05.SongSelect/CStage選曲.cs | 2917 +-- .../Stages/06.SongLoading/CStage曲読み込み.cs | 948 +- .../src/Stages/06.SongLoading/FastRender.cs | 40 +- OpenTaiko/src/Stages/07.Game/CAct演奏AVI.cs | 180 +- .../src/Stages/07.Game/CAct演奏Combo共通.cs | 1264 +- .../src/Stages/07.Game/CAct演奏Combo音声.cs | 320 +- .../src/Stages/07.Game/CAct演奏PauseMenu.cs | 256 +- .../src/Stages/07.Game/CAct演奏ゲージ共通.cs | 840 +- .../Stages/07.Game/CAct演奏スクロール速度.cs | 140 +- .../src/Stages/07.Game/CAct演奏スコア共通.cs | 628 +- .../Stages/07.Game/CAct演奏ステージ失敗.cs | 424 +- .../Stages/07.Game/CAct演奏パネル文字列.cs | 498 +- .../src/Stages/07.Game/CAct演奏演奏情報.cs | 168 +- .../src/Stages/07.Game/CFloorManagement.cs | 106 +- .../src/Stages/07.Game/CInvisibleChip.cs | 286 +- OpenTaiko/src/Stages/07.Game/CLagLogger.cs | 136 +- .../src/Stages/07.Game/CStage演奏画面共通.cs | 8824 ++++---- .../src/Stages/07.Game/Taiko/AIBattle.cs | 392 +- .../07.Game/Taiko/CActImplBackground.cs | 1108 +- .../Stages/07.Game/Taiko/CActImplBalloon.cs | 498 +- .../Stages/07.Game/Taiko/CActImplCharacter.cs | 1691 +- .../07.Game/Taiko/CActImplChipEffects.cs | 226 +- .../07.Game/Taiko/CActImplClearAnimation.cs | 1414 +- .../src/Stages/07.Game/Taiko/CActImplCombo.cs | 12 +- .../07.Game/Taiko/CActImplComboBalloon.cs | 270 +- .../Stages/07.Game/Taiko/CActImplDancer.cs | 582 +- .../Stages/07.Game/Taiko/CActImplFireworks.cs | 755 +- .../Stages/07.Game/Taiko/CActImplFooter.cs | 110 +- .../src/Stages/07.Game/Taiko/CActImplGauge.cs | 686 +- .../Stages/07.Game/Taiko/CActImplJudgeText.cs | 204 +- .../src/Stages/07.Game/Taiko/CActImplLane.cs | 304 +- .../Stages/07.Game/Taiko/CActImplLaneTaiko.cs | 1572 +- .../src/Stages/07.Game/Taiko/CActImplMob.cs | 160 +- .../Stages/07.Game/Taiko/CActImplMtaiko.cs | 1045 +- .../src/Stages/07.Game/Taiko/CActImplPad.cs | 190 +- .../src/Stages/07.Game/Taiko/CActImplRoll.cs | 240 +- .../07.Game/Taiko/CActImplRollEffect.cs | 286 +- .../Stages/07.Game/Taiko/CActImplRunner.cs | 382 +- .../src/Stages/07.Game/Taiko/CActImplScore.cs | 386 +- .../Stages/07.Game/Taiko/CActImplScoreRank.cs | 438 +- .../07.Game/Taiko/CActImplTrainingMode.cs | 1001 +- .../Taiko/CAct演奏Drumsゲームモード.cs | 1504 +- .../07.Game/Taiko/CStage演奏ドラム画面.cs | 4212 ++-- .../src/Stages/07.Game/Taiko/Dan_Cert.cs | 1948 +- .../Stages/07.Game/Taiko/EndAnimeScript.cs | 94 +- .../src/Stages/07.Game/Taiko/FireWorks.cs | 147 +- .../src/Stages/07.Game/Taiko/FlyingNotes.cs | 338 +- .../src/Stages/07.Game/Taiko/GoGoSplash.cs | 110 +- .../Stages/07.Game/Taiko/KusudamaScript.cs | 72 +- .../src/Stages/07.Game/Taiko/LaneFlash.cs | 106 +- .../src/Stages/07.Game/Taiko/ModIcons.cs | 336 +- .../src/Stages/07.Game/Taiko/NotesManager.cs | 861 +- OpenTaiko/src/Stages/07.Game/Taiko/Rainbow.cs | 252 +- .../src/Stages/07.Game/Taiko/ScriptBG.cs | 508 +- .../Stages/07.Game/Taiko/TaikoLaneFlash.cs | 128 +- .../src/Stages/08.Result/CActResultImage.cs | 156 +- .../08.Result/CActResultParameterPanel.cs | 2254 +- .../src/Stages/08.Result/CActResultRank.cs | 92 +- .../src/Stages/08.Result/CActResultSongBar.cs | 156 +- OpenTaiko/src/Stages/08.Result/CStage結果.cs | 3094 +-- OpenTaiko/src/Stages/08.Result/ResultBG.cs | 34 +- OpenTaiko/src/Stages/09.Ending/CStage終了.cs | 204 +- .../Stages/10.ChangeSkin/CStageChangeSkin.cs | 144 +- .../11.Heya/CHeyaDisplayAssetInformations.cs | 182 +- OpenTaiko/src/Stages/11.Heya/CStageHeya.cs | 1696 +- OpenTaiko/src/Stages/12.OnlineLounge/API.cs | 220 +- .../12.OnlineLounge/CStageOnlineLounge.cs | 1368 +- .../13.TowerSelect/CStageTowerSelect.cs | 552 +- OpenTaiko/src/Stages/CActDFPFont.cs | 1134 +- OpenTaiko/src/Stages/CActFIFOBlack.cs | 96 +- OpenTaiko/src/Stages/CActFIFOResult.cs | 128 +- OpenTaiko/src/Stages/CActFIFOStart.cs | 442 +- OpenTaiko/src/Stages/CActFIFOWhite.cs | 112 +- OpenTaiko/src/Stages/CActLVLNFont.cs | 176 +- OpenTaiko/src/Stages/CActNewHeya.cs | 1227 +- OpenTaiko/src/Stages/CActオプションパネル.cs | 206 +- OpenTaiko/src/Stages/CNamePlate.cs | 134 +- OpenTaiko/src/Stages/CStage.cs | 114 +- .../src/Stages/XX.Templates/CStageTemplate.cs | 134 +- 266 files changed, 83679 insertions(+), 83708 deletions(-) diff --git a/FDK/src/00.Common/CActivity.cs b/FDK/src/00.Common/CActivity.cs index 0ea5f7ff..ac662aeb 100644 --- a/FDK/src/00.Common/CActivity.cs +++ b/FDK/src/00.Common/CActivity.cs @@ -1,151 +1,151 @@ -namespace FDK { - public class CActivity { - // Properties +namespace FDK; - public bool IsActivated { get; private set; } - public bool IsDeActivated { - get { - return !this.IsActivated; - } - set { - this.IsActivated = !value; - } +public class CActivity { + // Properties + + public bool IsActivated { get; private set; } + public bool IsDeActivated { + get { + return !this.IsActivated; } - public List ChildActivities; - - /// - /// 初めて On進行描画() を呼び出す場合に true を示す。(On活性化() 内で true にセットされる。) - /// このフラグは、On活性化() では行えないタイミングのシビアな初期化を On進行描画() で行うために準備されている。利用は必須ではない。 - /// On進行描画() 側では、必要な初期化を追えたら false をセットすること。 - /// - protected bool IsFirstDraw = true; - - - // Constructor - - public CActivity() { - this.IsDeActivated = true; - this.ChildActivities = new List(); + set { + this.IsActivated = !value; } - - - // ライフサイクルメソッド - - #region [ 子クラスで必要なもののみ override すること。] - //----------------- - - public virtual void Activate() { - // すでに活性化してるなら何もしない。 - if (this.IsActivated) - return; - - this.IsActivated = true; // このフラグは、以下の処理をする前にセットする。 - - // 自身のリソースを作成する。 - //this.CreateManagedResource(); - //this.CreateUnmanagedResource(); - - // すべての子 Activity を活性化する。 - foreach (CActivity activity in this.ChildActivities) - activity.Activate(); - - // その他の初期化 - this.IsFirstDraw = true; - } - public virtual void DeActivate() { - // 活性化してないなら何もしない。 - if (this.IsDeActivated) - return; - - // 自身のリソースを解放する。 - //this.ReleaseUnmanagedResource(); - //this.ReleaseManagedResource(); - - // すべての 子Activity を非活性化する。 - foreach (CActivity activity in this.ChildActivities) - activity.DeActivate(); - - this.IsDeActivated = true; // このフラグは、以上のメソッドを呼び出した後にセットする。 - } - - /// - /// Managed リソースの作成を行う。 - /// Direct3D デバイスが作成された直後に呼び出されるので、自分が活性化している時に限り、 - /// Managed リソースを作成(または再構築)すること。 - /// いつどのタイミングで呼び出されるか(いつDirect3Dが再作成されるか)分からないので、 - /// いつ何時呼び出されても問題無いようにコーディングしておくこと。 - /// - public virtual void CreateManagedResource() { - // すべての 子Activity の Managed リソースを作成する。 - foreach (CActivity activity in this.ChildActivities) - activity.CreateManagedResource(); - } - - /// - /// Unmanaged リソースの作成を行う。 - /// Direct3D デバイスが作成またはリセットされた直後に呼び出されるので、自分が活性化している時に限り、 - /// Unmanaged リソースを作成(または再構築)すること。 - /// いつどのタイミングで呼び出されるか(いつDirect3Dが再作成またはリセットされるか)分からないので、 - /// いつ何時呼び出されても問題無いようにコーディングしておくこと。 - /// - public virtual void CreateUnmanagedResource() { - // すべての 子Activity の Unmanaged リソースを作成する。 - foreach (CActivity activity in this.ChildActivities) - activity.CreateUnmanagedResource(); - } - - /// - /// Unmanaged リソースの解放を行う。 - /// Direct3D デバイスの解放直前またはリセット直前に呼び出される。 - /// いつどのタイミングで呼び出されるか(いつDirect3Dが解放またはリセットされるか)分からないので、 - /// いつ何時呼び出されても問題無いようにコーディングしておくこと。 - /// - public virtual void ReleaseUnmanagedResource() { - // 活性化してないなら何もしない。 - if (this.IsDeActivated) - return; - - // すべての 子Activity の Unmanaged リソースを解放する。 - foreach (CActivity activity in this.ChildActivities) - activity.ReleaseUnmanagedResource(); - } - - /// - /// Managed リソースの解放を行う。 - /// Direct3D デバイスの解放直前に呼び出される。 - /// (Unmanaged リソースとは異なり、Direct3D デバイスのリセット時には呼び出されない。) - /// いつどのタイミングで呼び出されるか(いつDirect3Dが解放されるか)分からないので、 - /// いつ何時呼び出されても問題無いようにコーディングしておくこと。 - /// - public virtual void ReleaseManagedResource() { - // 活性化してないなら何もしない。 - if (this.IsDeActivated) - return; - - // すべての 子Activity の Managed リソースを解放する。 - foreach (CActivity activity in this.ChildActivities) - activity.ReleaseManagedResource(); - } - - /// - /// 進行と描画を行う。(これらは分離されず、この1つのメソッドだけで実装する。) - /// このメソッドは BeginScene() の後に呼び出されるので、メソッド内でいきなり描画を行ってかまわない。 - /// - /// 任意の整数。呼び出し元との整合性を合わせておくこと。 - public virtual int Draw() { - // 活性化してないなら何もしない。 - if (this.IsDeActivated) - return 0; - - - /* ここで進行と描画を行う。*/ - - - // 戻り値とその意味は子クラスで自由に決めていい。 - return 0; - } - - //----------------- - #endregion } + public List ChildActivities; + + /// + /// 初めて On進行描画() を呼び出す場合に true を示す。(On活性化() 内で true にセットされる。) + /// このフラグは、On活性化() では行えないタイミングのシビアな初期化を On進行描画() で行うために準備されている。利用は必須ではない。 + /// On進行描画() 側では、必要な初期化を追えたら false をセットすること。 + /// + protected bool IsFirstDraw = true; + + + // Constructor + + public CActivity() { + this.IsDeActivated = true; + this.ChildActivities = new List(); + } + + + // ライフサイクルメソッド + + #region [ 子クラスで必要なもののみ override すること。] + //----------------- + + public virtual void Activate() { + // すでに活性化してるなら何もしない。 + if (this.IsActivated) + return; + + this.IsActivated = true; // このフラグは、以下の処理をする前にセットする。 + + // 自身のリソースを作成する。 + //this.CreateManagedResource(); + //this.CreateUnmanagedResource(); + + // すべての子 Activity を活性化する。 + foreach (CActivity activity in this.ChildActivities) + activity.Activate(); + + // その他の初期化 + this.IsFirstDraw = true; + } + public virtual void DeActivate() { + // 活性化してないなら何もしない。 + if (this.IsDeActivated) + return; + + // 自身のリソースを解放する。 + //this.ReleaseUnmanagedResource(); + //this.ReleaseManagedResource(); + + // すべての 子Activity を非活性化する。 + foreach (CActivity activity in this.ChildActivities) + activity.DeActivate(); + + this.IsDeActivated = true; // このフラグは、以上のメソッドを呼び出した後にセットする。 + } + + /// + /// Managed リソースの作成を行う。 + /// Direct3D デバイスが作成された直後に呼び出されるので、自分が活性化している時に限り、 + /// Managed リソースを作成(または再構築)すること。 + /// いつどのタイミングで呼び出されるか(いつDirect3Dが再作成されるか)分からないので、 + /// いつ何時呼び出されても問題無いようにコーディングしておくこと。 + /// + public virtual void CreateManagedResource() { + // すべての 子Activity の Managed リソースを作成する。 + foreach (CActivity activity in this.ChildActivities) + activity.CreateManagedResource(); + } + + /// + /// Unmanaged リソースの作成を行う。 + /// Direct3D デバイスが作成またはリセットされた直後に呼び出されるので、自分が活性化している時に限り、 + /// Unmanaged リソースを作成(または再構築)すること。 + /// いつどのタイミングで呼び出されるか(いつDirect3Dが再作成またはリセットされるか)分からないので、 + /// いつ何時呼び出されても問題無いようにコーディングしておくこと。 + /// + public virtual void CreateUnmanagedResource() { + // すべての 子Activity の Unmanaged リソースを作成する。 + foreach (CActivity activity in this.ChildActivities) + activity.CreateUnmanagedResource(); + } + + /// + /// Unmanaged リソースの解放を行う。 + /// Direct3D デバイスの解放直前またはリセット直前に呼び出される。 + /// いつどのタイミングで呼び出されるか(いつDirect3Dが解放またはリセットされるか)分からないので、 + /// いつ何時呼び出されても問題無いようにコーディングしておくこと。 + /// + public virtual void ReleaseUnmanagedResource() { + // 活性化してないなら何もしない。 + if (this.IsDeActivated) + return; + + // すべての 子Activity の Unmanaged リソースを解放する。 + foreach (CActivity activity in this.ChildActivities) + activity.ReleaseUnmanagedResource(); + } + + /// + /// Managed リソースの解放を行う。 + /// Direct3D デバイスの解放直前に呼び出される。 + /// (Unmanaged リソースとは異なり、Direct3D デバイスのリセット時には呼び出されない。) + /// いつどのタイミングで呼び出されるか(いつDirect3Dが解放されるか)分からないので、 + /// いつ何時呼び出されても問題無いようにコーディングしておくこと。 + /// + public virtual void ReleaseManagedResource() { + // 活性化してないなら何もしない。 + if (this.IsDeActivated) + return; + + // すべての 子Activity の Managed リソースを解放する。 + foreach (CActivity activity in this.ChildActivities) + activity.ReleaseManagedResource(); + } + + /// + /// 進行と描画を行う。(これらは分離されず、この1つのメソッドだけで実装する。) + /// このメソッドは BeginScene() の後に呼び出されるので、メソッド内でいきなり描画を行ってかまわない。 + /// + /// 任意の整数。呼び出し元との整合性を合わせておくこと。 + public virtual int Draw() { + // 活性化してないなら何もしない。 + if (this.IsDeActivated) + return 0; + + + /* ここで進行と描画を行う。*/ + + + // 戻り値とその意味は子クラスで自由に決めていい。 + return 0; + } + + //----------------- + #endregion } diff --git a/FDK/src/00.Common/CConversion.cs b/FDK/src/00.Common/CConversion.cs index 436d42d5..292d1dac 100644 --- a/FDK/src/00.Common/CConversion.cs +++ b/FDK/src/00.Common/CConversion.cs @@ -1,237 +1,237 @@ -namespace FDK { - public class CConversion { - // Properties +namespace FDK; - public static readonly string HexChars = "0123456789ABCDEFabcdef"; - public static readonly string Base36Chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; +public class CConversion { + // Properties - // Methods + public static readonly string HexChars = "0123456789ABCDEFabcdef"; + public static readonly string Base36Chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; - public static bool bONorOFF(char c) { - return (c != '0'); - } + // Methods - public static double DegreeToRadian(double angle) { - return ((Math.PI * angle) / 180.0); - } - public static double RadianToDegree(double angle) { - return (angle * 180.0 / Math.PI); - } - public static float DegreeToRadian(float angle) { - return (float)DegreeToRadian((double)angle); - } - public static float RadianToDegree(float angle) { - return (float)RadianToDegree((double)angle); - } - - public static int ClampValue(int value, int min, int max) { - if (value < min) - return min; - - if (value > max) - return max; - - return value; - } - - public static int ParseIntInRange(string text, int min, int max, int defaultValue) { - int num; - if ((int.TryParse(text, out num) && (num >= min)) && (num <= max)) - return num; - - return defaultValue; - } - - public static double ParseDoubleInRange(string text, double min, double max, double defaultValue) { - double num; - if ((double.TryParse(text, out num) && (num >= min)) && (num <= max)) - return num; - - return defaultValue; - } - - public static int ParseIntInRangeAndClamp(string text, int min, int max, int defaultValue) { - int num; - if (int.TryParse(text, out num)) { - if ((num >= min) && (num <= max)) - return num; - if (num < min) - return min; - if (num > max) - return max; - } - - return defaultValue; - } - - public static int StringToInt(string text, int defaultValue) { - int num; - if (!int.TryParse(text, out num)) - num = defaultValue; - - return num; - } - - public static int HexStringToInt(string strNum) { - if (strNum.Length < 2) - return -1; - - int digit2 = HexChars.IndexOf(strNum[0]); - if (digit2 < 0) - return -1; - - if (digit2 >= 16) - digit2 -= (16 - 10); // A,B,C... -> 1,2,3... - - int digit1 = HexChars.IndexOf(strNum[1]); - if (digit1 < 0) - return -1; - - if (digit1 >= 16) - digit1 -= (16 - 10); - - return digit2 * 16 + digit1; - } - - public static int Base36StringToInt(string strNum) { - if (strNum.Length < 2) - return -1; - - int digit2 = Base36Chars.IndexOf(strNum[0]); - if (digit2 < 0) - return -1; - - if (digit2 >= 36) - digit2 -= (36 - 10); // A,B,C... -> 1,2,3... - - int digit1 = Base36Chars.IndexOf(strNum[1]); - if (digit1 < 0) - return -1; - - if (digit1 >= 36) - digit1 -= (36 - 10); - - return digit2 * 36 + digit1; - } - - public static int ParseSectionNumber(string strNum) { - if (strNum.Length >= 3) { - int digit3 = Base36Chars.IndexOf(strNum[0]); - if (digit3 < 0) - return -1; - - if (digit3 >= 36) // 3桁目は36進数 - digit3 -= (36 - 10); - - int digit2 = HexChars.IndexOf(strNum[1]); // 2桁目は10進数 - if ((digit2 < 0) || (digit2 > 9)) - return -1; - - int digit1 = HexChars.IndexOf(strNum[2]); // 1桁目も10進数 - if ((digit1 >= 0) && (digit1 <= 9)) - return digit3 * 100 + digit2 * 10 + digit1; - } - return -1; - } - - public static string SectionNumberToString(int num) { - if ((num < 0) || (num >= 3600)) // 3600 == Z99 + 1 - return "000"; - - int digit4 = num / 100; - int digit2 = (num % 100) / 10; - int digit1 = (num % 100) % 10; - char ch3 = Base36Chars[digit4]; - char ch2 = HexChars[digit2]; - char ch1 = HexChars[digit1]; - return (ch3.ToString() + ch2.ToString() + ch1.ToString()); - } - - public static string IntToHexString(int num) { - if ((num < 0) || (num >= 0x100)) - return "00"; - - char ch2 = HexChars[num / 0x10]; - char ch1 = HexChars[num % 0x10]; - return (ch2.ToString() + ch1.ToString()); - } - - public static string IntToBase36String(int num) { - if ((num < 0) || (num >= 36 * 36)) - return "00"; - - char ch2 = Base36Chars[num / 36]; - char ch1 = Base36Chars[num % 36]; - return (ch2.ToString() + ch1.ToString()); - } - - public static int[] StringToIntArray(string str) { - //0,1,2 ...の形式で書かれたstringをint配列に変換する。 - //一応実装はしたものの、例外処理などはまだ完成していない。 - //str = "0,1,2"; - if (String.IsNullOrEmpty(str)) - return null; - - string[] strArray = str.Split(','); - List listIntArray; - listIntArray = new List(); - - for (int n = 0; n < strArray.Length; n++) { - int n追加する数値 = Convert.ToInt32(strArray[n]); - listIntArray.Add(n追加する数値); - } - int[] nArray = new int[] { 1 }; - nArray = listIntArray.ToArray(); - - return nArray; - } - - /// - /// Converts a percentage value to a value on a scale of 255 (for opacity). - /// - /// - /// - public static int PercentageTo255(double num) { - return (int)(255.0 * num); - } - - /// - /// Converts a value from a scale of 255 to a percentage. - /// - /// - /// - public static int N255ToPercentage(int num) { - return (int)(100.0 / num); - } - - public static Color4 N255ToColor4(int nR, int nG, int nB) { - float fR = N255ToPercentage(nR); - float fG = N255ToPercentage(nG); - float fB = N255ToPercentage(nB); - - return new Color4(fR, fG, fB, 1f); - } - - public static Color4 ColorToColor4(System.Drawing.Color col) { - return new Color4(col.R / 255f, col.G / 255f, col.B / 255f, col.A / 255f); - } - - public static int[] SeparateDigits(int num) { - int[] digits = new int[num.ToString().Length]; - for (int i = 0; i < digits.Length; i++) { - digits[i] = num % 10; - num /= 10; - } - return digits; - } - - #region [ private ] - //----------------- - - // private コンストラクタでインスタンス生成を禁止する。 - private CConversion() { - } - //----------------- - #endregion + public static bool bONorOFF(char c) { + return (c != '0'); } + + public static double DegreeToRadian(double angle) { + return ((Math.PI * angle) / 180.0); + } + public static double RadianToDegree(double angle) { + return (angle * 180.0 / Math.PI); + } + public static float DegreeToRadian(float angle) { + return (float)DegreeToRadian((double)angle); + } + public static float RadianToDegree(float angle) { + return (float)RadianToDegree((double)angle); + } + + public static int ClampValue(int value, int min, int max) { + if (value < min) + return min; + + if (value > max) + return max; + + return value; + } + + public static int ParseIntInRange(string text, int min, int max, int defaultValue) { + int num; + if ((int.TryParse(text, out num) && (num >= min)) && (num <= max)) + return num; + + return defaultValue; + } + + public static double ParseDoubleInRange(string text, double min, double max, double defaultValue) { + double num; + if ((double.TryParse(text, out num) && (num >= min)) && (num <= max)) + return num; + + return defaultValue; + } + + public static int ParseIntInRangeAndClamp(string text, int min, int max, int defaultValue) { + int num; + if (int.TryParse(text, out num)) { + if ((num >= min) && (num <= max)) + return num; + if (num < min) + return min; + if (num > max) + return max; + } + + return defaultValue; + } + + public static int StringToInt(string text, int defaultValue) { + int num; + if (!int.TryParse(text, out num)) + num = defaultValue; + + return num; + } + + public static int HexStringToInt(string strNum) { + if (strNum.Length < 2) + return -1; + + int digit2 = HexChars.IndexOf(strNum[0]); + if (digit2 < 0) + return -1; + + if (digit2 >= 16) + digit2 -= (16 - 10); // A,B,C... -> 1,2,3... + + int digit1 = HexChars.IndexOf(strNum[1]); + if (digit1 < 0) + return -1; + + if (digit1 >= 16) + digit1 -= (16 - 10); + + return digit2 * 16 + digit1; + } + + public static int Base36StringToInt(string strNum) { + if (strNum.Length < 2) + return -1; + + int digit2 = Base36Chars.IndexOf(strNum[0]); + if (digit2 < 0) + return -1; + + if (digit2 >= 36) + digit2 -= (36 - 10); // A,B,C... -> 1,2,3... + + int digit1 = Base36Chars.IndexOf(strNum[1]); + if (digit1 < 0) + return -1; + + if (digit1 >= 36) + digit1 -= (36 - 10); + + return digit2 * 36 + digit1; + } + + public static int ParseSectionNumber(string strNum) { + if (strNum.Length >= 3) { + int digit3 = Base36Chars.IndexOf(strNum[0]); + if (digit3 < 0) + return -1; + + if (digit3 >= 36) // 3桁目は36進数 + digit3 -= (36 - 10); + + int digit2 = HexChars.IndexOf(strNum[1]); // 2桁目は10進数 + if ((digit2 < 0) || (digit2 > 9)) + return -1; + + int digit1 = HexChars.IndexOf(strNum[2]); // 1桁目も10進数 + if ((digit1 >= 0) && (digit1 <= 9)) + return digit3 * 100 + digit2 * 10 + digit1; + } + return -1; + } + + public static string SectionNumberToString(int num) { + if ((num < 0) || (num >= 3600)) // 3600 == Z99 + 1 + return "000"; + + int digit4 = num / 100; + int digit2 = (num % 100) / 10; + int digit1 = (num % 100) % 10; + char ch3 = Base36Chars[digit4]; + char ch2 = HexChars[digit2]; + char ch1 = HexChars[digit1]; + return (ch3.ToString() + ch2.ToString() + ch1.ToString()); + } + + public static string IntToHexString(int num) { + if ((num < 0) || (num >= 0x100)) + return "00"; + + char ch2 = HexChars[num / 0x10]; + char ch1 = HexChars[num % 0x10]; + return (ch2.ToString() + ch1.ToString()); + } + + public static string IntToBase36String(int num) { + if ((num < 0) || (num >= 36 * 36)) + return "00"; + + char ch2 = Base36Chars[num / 36]; + char ch1 = Base36Chars[num % 36]; + return (ch2.ToString() + ch1.ToString()); + } + + public static int[] StringToIntArray(string str) { + //0,1,2 ...の形式で書かれたstringをint配列に変換する。 + //一応実装はしたものの、例外処理などはまだ完成していない。 + //str = "0,1,2"; + if (String.IsNullOrEmpty(str)) + return null; + + string[] strArray = str.Split(','); + List listIntArray; + listIntArray = new List(); + + for (int n = 0; n < strArray.Length; n++) { + int n追加する数値 = Convert.ToInt32(strArray[n]); + listIntArray.Add(n追加する数値); + } + int[] nArray = new int[] { 1 }; + nArray = listIntArray.ToArray(); + + return nArray; + } + + /// + /// Converts a percentage value to a value on a scale of 255 (for opacity). + /// + /// + /// + public static int PercentageTo255(double num) { + return (int)(255.0 * num); + } + + /// + /// Converts a value from a scale of 255 to a percentage. + /// + /// + /// + public static int N255ToPercentage(int num) { + return (int)(100.0 / num); + } + + public static Color4 N255ToColor4(int nR, int nG, int nB) { + float fR = N255ToPercentage(nR); + float fG = N255ToPercentage(nG); + float fB = N255ToPercentage(nB); + + return new Color4(fR, fG, fB, 1f); + } + + public static Color4 ColorToColor4(System.Drawing.Color col) { + return new Color4(col.R / 255f, col.G / 255f, col.B / 255f, col.A / 255f); + } + + public static int[] SeparateDigits(int num) { + int[] digits = new int[num.ToString().Length]; + for (int i = 0; i < digits.Length; i++) { + digits[i] = num % 10; + num /= 10; + } + return digits; + } + + #region [ private ] + //----------------- + + // private コンストラクタでインスタンス生成を禁止する。 + private CConversion() { + } + //----------------- + #endregion } diff --git a/FDK/src/00.Common/CCounter.cs b/FDK/src/00.Common/CCounter.cs index c6beea38..8c37c7d7 100644 --- a/FDK/src/00.Common/CCounter.cs +++ b/FDK/src/00.Common/CCounter.cs @@ -1,271 +1,271 @@ -namespace FDK { - /// - /// 一定間隔で単純増加する整数(カウント値)を扱う。 - /// - /// - /// ○使い方 - /// 1.CCounterの変数をつくる。 - /// 2.CCounterを生成 - /// ctCounter = new CCounter( 0, 3, 10, CDTXMania.Timer ); - /// 3.進行メソッドを使用する。 - /// 4.ウマー。 - /// - /// double値を使う場合、t進行db、t進行LoopDbを使うこと。 - /// また、double版では間隔の値はミリ秒単位ではなく、通常の秒単位になります。 - /// - public class CCounter { - public bool IsStarted { - get; - set; - } - // 値プロパティ - public double BeginValue { - get; - private set; - } - public double EndValue { - get; - set; - } - public int CurrentValue { - get; - set; - } +namespace FDK; - public double _Interval { - get { - return this.Interval; - } - set { - this.Interval = value >= 0 ? value : value * -1; - } - } - - public double NowTime { - get; - set; - } - // 状態プロパティ - - public bool IsTicked { - get { return (this.NowTime != -1); } - } - public bool IsStoped { - get { return !this.IsTicked; } - } - public bool IsEnded { - get { return (this.CurrentValue >= this.EndValue); } - } - public bool IsUnEnded { - get { return !this.IsEnded; } - } - - // Constructor - - public CCounter() { - this.NormalTimer = null; - this.BeginValue = 0; - this.EndValue = 0; - this.CurrentValue = 0; - this.CurrentValue = 0; - this.NowTime = CSoundTimer.UnusedNum; - } - - /// 生成と同時に開始する。 - public CCounter(double begin, double end, double interval, CTimer timer) - : this() { - this.Start(begin, end, interval, timer); - } - - /// 生成と同時に開始する。(double版) - public CCounter(double begin, double end, double interval, CSoundTimer timer) - : this() { - this.Start(begin, end, interval * 1000.0f, timer); - } - - - // 状態操作メソッド - - /// - /// カウントを開始する。 - /// - /// 最初のカウント値。 - /// 最後のカウント値。 - /// カウント値を1増加させるのにかける時間(ミリ秒単位)。 - /// カウントに使用するタイマ。 - public void Start(double begin, double end, double interval, CTimer timer) { - this.BeginValue = begin; - this.EndValue = end; - this._Interval = interval; - this.NormalTimer = timer; - this.NowTime = this.NormalTimer.NowTime; - this.CurrentValue = (int)begin; - this.IsStarted = true; - } - - /// - /// カウントを開始する。(double版) - /// - /// 最初のカウント値。 - /// 最後のカウント値。 - /// カウント値を1増加させるのにかける時間(秒単位)。 - /// カウントに使用するタイマ。 - public void Start(double begin, double end, double interval, CSoundTimer timer) { - this.BeginValue = begin; - this.EndValue = end; - this._Interval = interval; - this.TimerDB = timer; - this.NowTime = this.TimerDB.SystemTime_Double; - this.CurrentValue = (int)begin; - this.IsStarted = true; - } - - /// - /// 前回の t進行() の呼び出しからの経過時間をもとに、必要なだけカウント値を増加させる。 - /// カウント値が終了値に達している場合は、それ以上増加しない(終了値を維持する)。 - /// - public void Tick() { - if ((this.NormalTimer != null) && (this.NowTime != CTimer.UnusedNum)) { - long num = this.NormalTimer.NowTime; - if (num < this.NowTime) - this.NowTime = num; - - while ((num - this.NowTime) >= this.Interval) { - if (++this.CurrentValue > this.EndValue) - this.CurrentValue = (int)this.EndValue; - - this.NowTime += this.Interval; - } - } - } - - /// - /// 前回の t進行() の呼び出しからの経過時間をもとに、必要なだけカウント値を増加させる。 - /// カウント値が終了値に達している場合は、それ以上増加しない(終了値を維持する)。 - /// - public void TickDB() { - if ((this.TimerDB != null) && (this.NowTime != CSoundTimer.UnusedNum)) { - double num = this.TimerDB.NowTime; - if (num < this.NowTime) - this.NowTime = num; - - while ((num - this.NowTime) >= this.Interval) { - if (++this.CurrentValue > this.EndValue) - this.CurrentValue = (int)this.EndValue; - - this.NowTime += this.Interval; - } - } - } - - /// - /// 前回の t進行Loop() の呼び出しからの経過時間をもとに、必要なだけカウント値を増加させる。 - /// カウント値が終了値に達している場合は、次の増加タイミングで開始値に戻る(値がループする)。 - /// - public void TickLoop() { - if ((this.NormalTimer != null) && (this.NowTime != CTimer.UnusedNum)) { - long num = this.NormalTimer.NowTime; - if (num < this.NowTime) - this.NowTime = num; - - while ((num - this.NowTime) >= this.Interval) { - if (++this.CurrentValue > this.EndValue) - this.CurrentValue = (int)this.BeginValue; - - this.NowTime += this.Interval; - } - } - } - - /// - /// 前回の t進行Loop() の呼び出しからの経過時間をもとに、必要なだけカウント値を増加させる。 - /// カウント値が終了値に達している場合は、次の増加タイミングで開始値に戻る(値がループする)。 - /// - public void TickLoopDB() { - if ((this.TimerDB != null) && (this.NowTime != CSoundTimer.UnusedNum)) { - double num = this.TimerDB.NowTime; - if (num < this.NowTime) - this.NowTime = num; - - while ((num - this.NowTime) >= this.Interval) { - if (++this.CurrentValue > this.EndValue) - this.CurrentValue = (int)this.BeginValue; - - this.NowTime += this.Interval; - } - } - } - - /// - /// カウントを停止する。 - /// これ以降に t進行() や t進行Loop() を呼び出しても何も処理されない。 - /// - public void Stop() { - this.NowTime = CTimer.UnusedNum; - } - - public void ChangeInterval(double Value) { - this._Interval = Value; - } - - // その他 - - #region [ 応用:キーの反復入力をエミュレーションする ] - //----------------- - - /// - /// 「bキー押下」引数が true の間中、「tキー処理」デリゲート引数を呼び出す。 - /// ただし、2回目の呼び出しは1回目から 200ms の間を開けてから行い、3回目以降の呼び出しはそれぞれ 30ms の間隔で呼び出す。 - /// 「bキー押下」が false の場合は何もせず、呼び出し回数を 0 にリセットする。 - /// - /// キーが押下されている場合は true。 - /// キーが押下されている場合に実行する処理。 - public void KeyIntervalFunc(bool pressFlag, KeyProcess keyProcess) { - const int first = 0; - const int second = 1; - const int later = 2; - - if (pressFlag) { - switch (this.CurrentValue) { - case first: - - keyProcess(); - this.CurrentValue = second; - this.NowTime = this.NormalTimer.NowTime; - return; - - case second: - - if ((this.NormalTimer.NowTime - this.NowTime) > 200) { - keyProcess(); - this.NowTime = this.NormalTimer.NowTime; - this.CurrentValue = later; - } - return; - - case later: - - if ((this.NormalTimer.NowTime - this.NowTime) > 30) { - keyProcess(); - this.NowTime = this.NormalTimer.NowTime; - } - return; - } - } else { - this.CurrentValue = first; - } - } - public delegate void KeyProcess(); - - //----------------- - #endregion - - #region [ private ] - //----------------- - private CTimer NormalTimer; - private CSoundTimer TimerDB; - private double Interval; - //----------------- - #endregion +/// +/// 一定間隔で単純増加する整数(カウント値)を扱う。 +/// +/// +/// ○使い方 +/// 1.CCounterの変数をつくる。 +/// 2.CCounterを生成 +/// ctCounter = new CCounter( 0, 3, 10, CDTXMania.Timer ); +/// 3.進行メソッドを使用する。 +/// 4.ウマー。 +/// +/// double値を使う場合、t進行db、t進行LoopDbを使うこと。 +/// また、double版では間隔の値はミリ秒単位ではなく、通常の秒単位になります。 +/// +public class CCounter { + public bool IsStarted { + get; + set; } + // 値プロパティ + public double BeginValue { + get; + private set; + } + public double EndValue { + get; + set; + } + public int CurrentValue { + get; + set; + } + + public double _Interval { + get { + return this.Interval; + } + set { + this.Interval = value >= 0 ? value : value * -1; + } + } + + public double NowTime { + get; + set; + } + // 状態プロパティ + + public bool IsTicked { + get { return (this.NowTime != -1); } + } + public bool IsStoped { + get { return !this.IsTicked; } + } + public bool IsEnded { + get { return (this.CurrentValue >= this.EndValue); } + } + public bool IsUnEnded { + get { return !this.IsEnded; } + } + + // Constructor + + public CCounter() { + this.NormalTimer = null; + this.BeginValue = 0; + this.EndValue = 0; + this.CurrentValue = 0; + this.CurrentValue = 0; + this.NowTime = CSoundTimer.UnusedNum; + } + + /// 生成と同時に開始する。 + public CCounter(double begin, double end, double interval, CTimer timer) + : this() { + this.Start(begin, end, interval, timer); + } + + /// 生成と同時に開始する。(double版) + public CCounter(double begin, double end, double interval, CSoundTimer timer) + : this() { + this.Start(begin, end, interval * 1000.0f, timer); + } + + + // 状態操作メソッド + + /// + /// カウントを開始する。 + /// + /// 最初のカウント値。 + /// 最後のカウント値。 + /// カウント値を1増加させるのにかける時間(ミリ秒単位)。 + /// カウントに使用するタイマ。 + public void Start(double begin, double end, double interval, CTimer timer) { + this.BeginValue = begin; + this.EndValue = end; + this._Interval = interval; + this.NormalTimer = timer; + this.NowTime = this.NormalTimer.NowTime; + this.CurrentValue = (int)begin; + this.IsStarted = true; + } + + /// + /// カウントを開始する。(double版) + /// + /// 最初のカウント値。 + /// 最後のカウント値。 + /// カウント値を1増加させるのにかける時間(秒単位)。 + /// カウントに使用するタイマ。 + public void Start(double begin, double end, double interval, CSoundTimer timer) { + this.BeginValue = begin; + this.EndValue = end; + this._Interval = interval; + this.TimerDB = timer; + this.NowTime = this.TimerDB.SystemTime_Double; + this.CurrentValue = (int)begin; + this.IsStarted = true; + } + + /// + /// 前回の t進行() の呼び出しからの経過時間をもとに、必要なだけカウント値を増加させる。 + /// カウント値が終了値に達している場合は、それ以上増加しない(終了値を維持する)。 + /// + public void Tick() { + if ((this.NormalTimer != null) && (this.NowTime != CTimer.UnusedNum)) { + long num = this.NormalTimer.NowTime; + if (num < this.NowTime) + this.NowTime = num; + + while ((num - this.NowTime) >= this.Interval) { + if (++this.CurrentValue > this.EndValue) + this.CurrentValue = (int)this.EndValue; + + this.NowTime += this.Interval; + } + } + } + + /// + /// 前回の t進行() の呼び出しからの経過時間をもとに、必要なだけカウント値を増加させる。 + /// カウント値が終了値に達している場合は、それ以上増加しない(終了値を維持する)。 + /// + public void TickDB() { + if ((this.TimerDB != null) && (this.NowTime != CSoundTimer.UnusedNum)) { + double num = this.TimerDB.NowTime; + if (num < this.NowTime) + this.NowTime = num; + + while ((num - this.NowTime) >= this.Interval) { + if (++this.CurrentValue > this.EndValue) + this.CurrentValue = (int)this.EndValue; + + this.NowTime += this.Interval; + } + } + } + + /// + /// 前回の t進行Loop() の呼び出しからの経過時間をもとに、必要なだけカウント値を増加させる。 + /// カウント値が終了値に達している場合は、次の増加タイミングで開始値に戻る(値がループする)。 + /// + public void TickLoop() { + if ((this.NormalTimer != null) && (this.NowTime != CTimer.UnusedNum)) { + long num = this.NormalTimer.NowTime; + if (num < this.NowTime) + this.NowTime = num; + + while ((num - this.NowTime) >= this.Interval) { + if (++this.CurrentValue > this.EndValue) + this.CurrentValue = (int)this.BeginValue; + + this.NowTime += this.Interval; + } + } + } + + /// + /// 前回の t進行Loop() の呼び出しからの経過時間をもとに、必要なだけカウント値を増加させる。 + /// カウント値が終了値に達している場合は、次の増加タイミングで開始値に戻る(値がループする)。 + /// + public void TickLoopDB() { + if ((this.TimerDB != null) && (this.NowTime != CSoundTimer.UnusedNum)) { + double num = this.TimerDB.NowTime; + if (num < this.NowTime) + this.NowTime = num; + + while ((num - this.NowTime) >= this.Interval) { + if (++this.CurrentValue > this.EndValue) + this.CurrentValue = (int)this.BeginValue; + + this.NowTime += this.Interval; + } + } + } + + /// + /// カウントを停止する。 + /// これ以降に t進行() や t進行Loop() を呼び出しても何も処理されない。 + /// + public void Stop() { + this.NowTime = CTimer.UnusedNum; + } + + public void ChangeInterval(double Value) { + this._Interval = Value; + } + + // その他 + + #region [ 応用:キーの反復入力をエミュレーションする ] + //----------------- + + /// + /// 「bキー押下」引数が true の間中、「tキー処理」デリゲート引数を呼び出す。 + /// ただし、2回目の呼び出しは1回目から 200ms の間を開けてから行い、3回目以降の呼び出しはそれぞれ 30ms の間隔で呼び出す。 + /// 「bキー押下」が false の場合は何もせず、呼び出し回数を 0 にリセットする。 + /// + /// キーが押下されている場合は true。 + /// キーが押下されている場合に実行する処理。 + public void KeyIntervalFunc(bool pressFlag, KeyProcess keyProcess) { + const int first = 0; + const int second = 1; + const int later = 2; + + if (pressFlag) { + switch (this.CurrentValue) { + case first: + + keyProcess(); + this.CurrentValue = second; + this.NowTime = this.NormalTimer.NowTime; + return; + + case second: + + if ((this.NormalTimer.NowTime - this.NowTime) > 200) { + keyProcess(); + this.NowTime = this.NormalTimer.NowTime; + this.CurrentValue = later; + } + return; + + case later: + + if ((this.NormalTimer.NowTime - this.NowTime) > 30) { + keyProcess(); + this.NowTime = this.NormalTimer.NowTime; + } + return; + } + } else { + this.CurrentValue = first; + } + } + public delegate void KeyProcess(); + + //----------------- + #endregion + + #region [ private ] + //----------------- + private CTimer NormalTimer; + private CSoundTimer TimerDB; + private double Interval; + //----------------- + #endregion } diff --git a/FDK/src/00.Common/CFPS.cs b/FDK/src/00.Common/CFPS.cs index 13c15967..9180c12f 100644 --- a/FDK/src/00.Common/CFPS.cs +++ b/FDK/src/00.Common/CFPS.cs @@ -1,61 +1,61 @@ -namespace FDK { - public class CFPS { - // Properties +namespace FDK; - public int NowFPS { - get; - private set; - } - public double DeltaTime { - get; - private set; - } - public bool ChangedFPS { - get; - private set; - } +public class CFPS { + // Properties - - // Constructor - - public CFPS() { - this.NowFPS = 0; - this.DeltaTime = 0; - this.FPSTimer = new CTimer(CTimer.TimerType.MultiMedia); - this.BeginTime = this.FPSTimer.NowTime; - this.CoreFPS = 0; - this.ChangedFPS = false; - } - - - // メソッド - - public void Update() { - this.FPSTimer.Update(); - this.ChangedFPS = false; - - const long INTERVAL = 1000; - this.DeltaTime = (this.FPSTimer.NowTime - this.PrevFrameTime) / 1000.0; - PrevFrameTime = this.FPSTimer.NowTime; - while ((this.FPSTimer.NowTime - this.BeginTime) >= INTERVAL) { - this.NowFPS = this.CoreFPS; - this.CoreFPS = 0; - this.ChangedFPS = true; - this.BeginTime += INTERVAL; - } - this.CoreFPS++; - } - - - // その他 - - #region [ private ] - //----------------- - private CTimer FPSTimer; - private long BeginTime; - private long PrevFrameTime; - private int CoreFPS; - //----------------- - #endregion + public int NowFPS { + get; + private set; } + public double DeltaTime { + get; + private set; + } + public bool ChangedFPS { + get; + private set; + } + + + // Constructor + + public CFPS() { + this.NowFPS = 0; + this.DeltaTime = 0; + this.FPSTimer = new CTimer(CTimer.TimerType.MultiMedia); + this.BeginTime = this.FPSTimer.NowTime; + this.CoreFPS = 0; + this.ChangedFPS = false; + } + + + // メソッド + + public void Update() { + this.FPSTimer.Update(); + this.ChangedFPS = false; + + const long INTERVAL = 1000; + this.DeltaTime = (this.FPSTimer.NowTime - this.PrevFrameTime) / 1000.0; + PrevFrameTime = this.FPSTimer.NowTime; + while ((this.FPSTimer.NowTime - this.BeginTime) >= INTERVAL) { + this.NowFPS = this.CoreFPS; + this.CoreFPS = 0; + this.ChangedFPS = true; + this.BeginTime += INTERVAL; + } + this.CoreFPS++; + } + + + // その他 + + #region [ private ] + //----------------- + private CTimer FPSTimer; + private long BeginTime; + private long PrevFrameTime; + private int CoreFPS; + //----------------- + #endregion } diff --git a/FDK/src/00.Common/CIniFile.cs b/FDK/src/00.Common/CIniFile.cs index 5971b3a6..ffcbd77f 100644 --- a/FDK/src/00.Common/CIniFile.cs +++ b/FDK/src/00.Common/CIniFile.cs @@ -1,112 +1,111 @@ using System.Text; -namespace FDK { - /// - /// 汎用的な .iniファイルを扱う。 - /// +namespace FDK; - public class CIniFile { - // Properties +/// +/// 汎用的な .iniファイルを扱う。 +/// +public class CIniFile { + // Properties - public string FileName { - get; - private set; - } - public List Sections { - get; - set; - } - public class CSection { - public string SectionName = ""; - public List> Parameters = new List>(); - } + public string FileName { + get; + private set; + } + public List Sections { + get; + set; + } + public class CSection { + public string SectionName = ""; + public List> Parameters = new List>(); + } - // Constructor + // Constructor - public CIniFile() { - this.FileName = ""; - this.Sections = new List(); - } - public CIniFile(string fileName) - : this() { - this.tRead(fileName); - } + public CIniFile() { + this.FileName = ""; + this.Sections = new List(); + } + public CIniFile(string fileName) + : this() { + this.tRead(fileName); + } - // メソッド + // メソッド - public void tRead(string fileName) { - this.FileName = fileName; + public void tRead(string fileName) { + this.FileName = fileName; - StreamReader sr = null; - CSection section = null; - try { - sr = new StreamReader(this.FileName, Encoding.GetEncoding("Shift_JIS")); // ファイルが存在しない場合は例外発生。 + StreamReader sr = null; + CSection section = null; + try { + sr = new StreamReader(this.FileName, Encoding.GetEncoding("Shift_JIS")); // ファイルが存在しない場合は例外発生。 - string line; - while ((line = sr.ReadLine()) != null) { - line = line.Replace('\t', ' ').TrimStart(new char[] { '\t', ' ' }); - if (string.IsNullOrEmpty(line) || line[0] == ';') // ';'以降はコメントとして無視 - continue; + string line; + while ((line = sr.ReadLine()) != null) { + line = line.Replace('\t', ' ').TrimStart(new char[] { '\t', ' ' }); + if (string.IsNullOrEmpty(line) || line[0] == ';') // ';'以降はコメントとして無視 + continue; - if (line[0] == '[') { - #region [ セクションの変更 ] - //----------------------------- - var builder = new StringBuilder(32); - int num = 1; - while ((num < line.Length) && (line[num] != ']')) - builder.Append(line[num++]); + if (line[0] == '[') { + #region [ セクションの変更 ] + //----------------------------- + var builder = new StringBuilder(32); + int num = 1; + while ((num < line.Length) && (line[num] != ']')) + builder.Append(line[num++]); - // 変数 section が使用中の場合は、List に追加して新しい section を作成する。 - if (section != null) - this.Sections.Add(section); + // 変数 section が使用中の場合は、List に追加して新しい section を作成する。 + if (section != null) + this.Sections.Add(section); - section = new CSection(); - section.SectionName = builder.ToString(); - //----------------------------- - #endregion + section = new CSection(); + section.SectionName = builder.ToString(); + //----------------------------- + #endregion - continue; - } - - string[] strArray = line.Split(new char[] { '=' }); - if (strArray.Length != 2) - continue; - - string key = strArray[0].Trim(); - string value = strArray[1].Trim(); - - if (section != null && !string.IsNullOrEmpty(key) && !string.IsNullOrEmpty(value)) - section.Parameters.Add(new KeyValuePair(key, value)); + continue; } - if (section != null) - this.Sections.Add(section); - } finally { - if (sr != null) - sr.Close(); - } - } - public void tWrite(string fileName) { - this.FileName = fileName; - this.tWrite(); - } - public void tWrite() { - StreamWriter sw = null; - try { - sw = new StreamWriter(this.FileName, false, Encoding.GetEncoding("Shift_JIS")); // オープン失敗の場合は例外発生。 + string[] strArray = line.Split(new char[] { '=' }); + if (strArray.Length != 2) + continue; - foreach (CSection section in this.Sections) { - sw.WriteLine("[{0}]", section.SectionName); + string key = strArray[0].Trim(); + string value = strArray[1].Trim(); - foreach (KeyValuePair kvp in section.Parameters) - sw.WriteLine("{0}={1}", kvp.Key, kvp.Value); - } - } finally { - if (sw != null) - sw.Close(); + if (section != null && !string.IsNullOrEmpty(key) && !string.IsNullOrEmpty(value)) + section.Parameters.Add(new KeyValuePair(key, value)); } + + if (section != null) + this.Sections.Add(section); + } finally { + if (sr != null) + sr.Close(); + } + } + public void tWrite(string fileName) { + this.FileName = fileName; + this.tWrite(); + } + public void tWrite() { + StreamWriter sw = null; + try { + sw = new StreamWriter(this.FileName, false, Encoding.GetEncoding("Shift_JIS")); // オープン失敗の場合は例外発生。 + + foreach (CSection section in this.Sections) { + sw.WriteLine("[{0}]", section.SectionName); + + foreach (KeyValuePair kvp in section.Parameters) + sw.WriteLine("{0}={1}", kvp.Key, kvp.Value); + } + } finally { + if (sw != null) + sw.Close(); } } } diff --git a/FDK/src/00.Common/CIntervalProcessing.cs b/FDK/src/00.Common/CIntervalProcessing.cs index 2681119e..4b961ce5 100644 --- a/FDK/src/00.Common/CIntervalProcessing.cs +++ b/FDK/src/00.Common/CIntervalProcessing.cs @@ -1,52 +1,52 @@ -namespace FDK { - /// - /// 一定の間隔で処理を行うテンプレートパターンの定義。 - /// たとえば、t進行() で 5ms ごとに行う処理を前回のt進行()の呼び出しから 15ms 後に呼び出した場合は、処理が 3回 実行される。 - /// - public class CIntervalProcessing : IDisposable { - public delegate void dgProc(); - public void Tick(long interval, dgProc proc) { - // タイマ更新 +namespace FDK; - if (this.timer == null) - return; - this.timer.Update(); +/// +/// 一定の間隔で処理を行うテンプレートパターンの定義。 +/// たとえば、t進行() で 5ms ごとに行う処理を前回のt進行()の呼び出しから 15ms 後に呼び出した場合は、処理が 3回 実行される。 +/// +public class CIntervalProcessing : IDisposable { + public delegate void dgProc(); + public void Tick(long interval, dgProc proc) { + // タイマ更新 + + if (this.timer == null) + return; + this.timer.Update(); - // 初めての進行処理 + // 初めての進行処理 - if (this.PrevTime == CTimer.UnusedNum) - this.PrevTime = this.timer.NowTimeMs; + if (this.PrevTime == CTimer.UnusedNum) + this.PrevTime = this.timer.NowTimeMs; - // タイマが一回りしてしまった時のため…… + // タイマが一回りしてしまった時のため…… - if (this.timer.NowTimeMs < this.PrevTime) - this.PrevTime = this.timer.NowTimeMs; + if (this.timer.NowTimeMs < this.PrevTime) + this.PrevTime = this.timer.NowTimeMs; - // 時間内の処理を実行。 + // 時間内の処理を実行。 - while ((this.timer.NowTimeMs - this.PrevTime) >= interval) { - proc(); + while ((this.timer.NowTimeMs - this.PrevTime) >= interval) { + proc(); - this.PrevTime += interval; - } + this.PrevTime += interval; } - - #region [ IDisposable 実装 ] - //----------------- - public void Dispose() { - timer.Dispose(); - } - //----------------- - #endregion - - #region [ protected ] - //----------------- - protected CTimer timer = new CTimer(CTimer.TimerType.MultiMedia); - protected long PrevTime = CTimer.UnusedNum; - //----------------- - #endregion } + + #region [ IDisposable 実装 ] + //----------------- + public void Dispose() { + timer.Dispose(); + } + //----------------- + #endregion + + #region [ protected ] + //----------------- + protected CTimer timer = new CTimer(CTimer.TimerType.MultiMedia); + protected long PrevTime = CTimer.UnusedNum; + //----------------- + #endregion } diff --git a/FDK/src/00.Common/CJudgeTextEncoding.cs b/FDK/src/00.Common/CJudgeTextEncoding.cs index f100c8bf..afa4d417 100644 --- a/FDK/src/00.Common/CJudgeTextEncoding.cs +++ b/FDK/src/00.Common/CJudgeTextEncoding.cs @@ -1,69 +1,69 @@ using System.Diagnostics; using System.Text; -namespace OpenTaiko { - public class CJudgeTextEncoding { - /// - /// Hnc8様のReadJEncを使用して文字コードの判別をする。 - /// - public static Encoding JudgeFileEncoding(string path) { - if (!File.Exists(path)) return null; - Encoding enc; - FileInfo file = new FileInfo(path); +namespace OpenTaiko; - using (Hnx8.ReadJEnc.FileReader reader = new Hnx8.ReadJEnc.FileReader(file)) { - // 判別読み出し実行。判別結果はReadメソッドの戻り値で把握できます - Hnx8.ReadJEnc.CharCode c = reader.Read(file); - // 戻り値のNameプロパティから文字コード名を取得できます - string name = c.Name; - Console.WriteLine("【" + name + "】" + file.Name); - // GetEncoding()を呼び出すと、エンコーディングを取得できます - enc = c.GetEncoding(); - } - Debug.Print(path + " Encoding=" + enc.CodePage); +public class CJudgeTextEncoding { + /// + /// Hnc8様のReadJEncを使用して文字コードの判別をする。 + /// + public static Encoding JudgeFileEncoding(string path) { + if (!File.Exists(path)) return null; + Encoding enc; + FileInfo file = new FileInfo(path); - if (enc == null) { - enc = Encoding.GetEncoding(932); - } - return enc; + using (Hnx8.ReadJEnc.FileReader reader = new Hnx8.ReadJEnc.FileReader(file)) { + // 判別読み出し実行。判別結果はReadメソッドの戻り値で把握できます + Hnx8.ReadJEnc.CharCode c = reader.Read(file); + // 戻り値のNameプロパティから文字コード名を取得できます + string name = c.Name; + Console.WriteLine("【" + name + "】" + file.Name); + // GetEncoding()を呼び出すと、エンコーディングを取得できます + enc = c.GetEncoding(); } - /// - /// Hnc8様のReadJEncを使用してテキストファイルを読み込む。 - /// 改行文字は、勝手に\nに統一する - /// - /// - /// - public static string ReadTextFile(string path) { - if (!File.Exists(path)) return null; - string str = null; - FileInfo file = new FileInfo(path); + Debug.Print(path + " Encoding=" + enc.CodePage); - using (Hnx8.ReadJEnc.FileReader reader = new Hnx8.ReadJEnc.FileReader(file)) { - reader.Read(file); - str = reader.Text; - } - - str = str.Replace(JudgeNewLine(str), "\n"); - - return str; + if (enc == null) { + enc = Encoding.GetEncoding(932); } - - /// - /// Environment.NewLineはプラットフォーム依存である。 - /// だが、ファイルごとに改行コードは違うので、使用すべきではない。 - /// なので、勝手に改行文字を判断する。 - /// - /// - /// - public static string JudgeNewLine(string str) { - if (str.Contains("\r\n")) - return ("\r\n"); - - if (str.Contains("\r")) - return ("\r"); - - return ("\n"); - } - + return enc; } + /// + /// Hnc8様のReadJEncを使用してテキストファイルを読み込む。 + /// 改行文字は、勝手に\nに統一する + /// + /// + /// + public static string ReadTextFile(string path) { + if (!File.Exists(path)) return null; + string str = null; + FileInfo file = new FileInfo(path); + + using (Hnx8.ReadJEnc.FileReader reader = new Hnx8.ReadJEnc.FileReader(file)) { + reader.Read(file); + str = reader.Text; + } + + str = str.Replace(JudgeNewLine(str), "\n"); + + return str; + } + + /// + /// Environment.NewLineはプラットフォーム依存である。 + /// だが、ファイルごとに改行コードは違うので、使用すべきではない。 + /// なので、勝手に改行文字を判断する。 + /// + /// + /// + public static string JudgeNewLine(string str) { + if (str.Contains("\r\n")) + return ("\r\n"); + + if (str.Contains("\r")) + return ("\r"); + + return ("\n"); + } + } diff --git a/FDK/src/00.Common/CTimer.cs b/FDK/src/00.Common/CTimer.cs index d630afee..1554797d 100644 --- a/FDK/src/00.Common/CTimer.cs +++ b/FDK/src/00.Common/CTimer.cs @@ -1,156 +1,156 @@ -namespace FDK { - public class CTimer : CTimerBase { - public enum TimerType { - Unknown = -1, - PerformanceCounter = 0, - MultiMedia = 1, - GetTickCount = 2, - } - public TimerType CurrentTimerType { - get; - protected set; - } +namespace FDK; + +public class CTimer : CTimerBase { + public enum TimerType { + Unknown = -1, + PerformanceCounter = 0, + MultiMedia = 1, + GetTickCount = 2, + } + public TimerType CurrentTimerType { + get; + protected set; + } - public override long SystemTimeMs { - get { - /* - switch( this.eタイマ種別 ) - { - case E種別.PerformanceCounter: - { - double num = 0.0; - if( this.n現在の周波数 != 0L ) - { - long x = 0L; - QueryPerformanceCounter( ref x ); - num = ( (double) x ) / ( ( (double) this.n現在の周波数 ) / 1000.0 ); - } - return (long) num; - } - case E種別.MultiMedia: - return (long) timeGetTime(); - - case E種別.GetTickCount: - return (long) Environment.TickCount; - } - return 0; - */ - return SampleFramework.Game.TimeMs; - } - } - - public CTimer(TimerType timerType) - : base() { - this.CurrentTimerType = timerType; - + public override long SystemTimeMs { + get { /* - if( n参照カウント[ (int) this.eタイマ種別 ] == 0 ) + switch( this.eタイマ種別 ) { - switch( this.eタイマ種別 ) - { - case E種別.PerformanceCounter: - if( !this.b確認と設定_PerformanceCounter() && !this.b確認と設定_MultiMedia() ) - this.b確認と設定_GetTickCount(); - break; + case E種別.PerformanceCounter: + { + double num = 0.0; + if( this.n現在の周波数 != 0L ) + { + long x = 0L; + QueryPerformanceCounter( ref x ); + num = ( (double) x ) / ( ( (double) this.n現在の周波数 ) / 1000.0 ); + } + return (long) num; + } + case E種別.MultiMedia: + return (long) timeGetTime(); - case E種別.MultiMedia: - if( !this.b確認と設定_MultiMedia() && !this.b確認と設定_PerformanceCounter() ) - this.b確認と設定_GetTickCount(); - break; - - case E種別.GetTickCount: - this.b確認と設定_GetTickCount(); - break; - - default: - throw new ArgumentException( string.Format( "未知のタイマ種別です。[{0}]", this.eタイマ種別 ) ); - } + case E種別.GetTickCount: + return (long) Environment.TickCount; } + return 0; */ - - base.Reset(); - - ReferenceCount[(int)this.CurrentTimerType]++; + return SampleFramework.Game.TimeMs; } + } - public override void Dispose() { - if (this.CurrentTimerType == TimerType.Unknown) - return; + public CTimer(TimerType timerType) + : base() { + this.CurrentTimerType = timerType; - int type = (int)this.CurrentTimerType; + /* + if( n参照カウント[ (int) this.eタイマ種別 ] == 0 ) + { + switch( this.eタイマ種別 ) + { + case E種別.PerformanceCounter: + if( !this.b確認と設定_PerformanceCounter() && !this.b確認と設定_MultiMedia() ) + this.b確認と設定_GetTickCount(); + break; - ReferenceCount[type] = Math.Max(ReferenceCount[type] - 1, 0); + case E種別.MultiMedia: + if( !this.b確認と設定_MultiMedia() && !this.b確認と設定_PerformanceCounter() ) + this.b確認と設定_GetTickCount(); + break; - if (ReferenceCount[type] == 0) { - /* - if( this.eタイマ種別 == E種別.MultiMedia ) - timeEndPeriod( this.timeCaps.wPeriodMin ); - */ + case E種別.GetTickCount: + this.b確認と設定_GetTickCount(); + break; + + default: + throw new ArgumentException( string.Format( "未知のタイマ種別です。[{0}]", this.eタイマ種別 ) ); } + } + */ - this.CurrentTimerType = TimerType.Unknown; + base.Reset(); + + ReferenceCount[(int)this.CurrentTimerType]++; + } + + public override void Dispose() { + if (this.CurrentTimerType == TimerType.Unknown) + return; + + int type = (int)this.CurrentTimerType; + + ReferenceCount[type] = Math.Max(ReferenceCount[type] - 1, 0); + + if (ReferenceCount[type] == 0) { + /* + if( this.eタイマ種別 == E種別.MultiMedia ) + timeEndPeriod( this.timeCaps.wPeriodMin ); + */ } - #region [ protected ] - //----------------- - protected long CurrentFrequency; - protected static int[] ReferenceCount = new int[3]; - //protected TimeCaps timeCaps; + this.CurrentTimerType = TimerType.Unknown; + } - protected bool GetSetTickCount() { - this.CurrentTimerType = TimerType.GetTickCount; + #region [ protected ] + //----------------- + protected long CurrentFrequency; + protected static int[] ReferenceCount = new int[3]; + //protected TimeCaps timeCaps; + + protected bool GetSetTickCount() { + this.CurrentTimerType = TimerType.GetTickCount; + return true; + } + /* + protected bool b確認と設定_MultiMedia() + { + this.timeCaps = new TimeCaps(); + if( ( timeGetDevCaps( out this.timeCaps, (uint) Marshal.SizeOf( typeof( TimeCaps ) ) ) == 0 ) && ( this.timeCaps.wPeriodMin < 10 ) ) + { + this.eタイマ種別 = E種別.MultiMedia; + timeBeginPeriod( this.timeCaps.wPeriodMin ); return true; } - /* - protected bool b確認と設定_MultiMedia() - { - this.timeCaps = new TimeCaps(); - if( ( timeGetDevCaps( out this.timeCaps, (uint) Marshal.SizeOf( typeof( TimeCaps ) ) ) == 0 ) && ( this.timeCaps.wPeriodMin < 10 ) ) - { - this.eタイマ種別 = E種別.MultiMedia; - timeBeginPeriod( this.timeCaps.wPeriodMin ); - return true; - } - return false; - } - protected bool b確認と設定_PerformanceCounter() - { - if( QueryPerformanceFrequency( ref this.n現在の周波数 ) != 0 ) - { - this.eタイマ種別 = E種別.PerformanceCounter; - return true; - } - return false; - } - */ - //----------------- - #endregion - - #region [ DllImport ] - //----------------- - /* - [DllImport( "kernel32.dll" )] - protected static extern short QueryPerformanceCounter( ref long x ); - [DllImport( "kernel32.dll" )] - protected static extern short QueryPerformanceFrequency( ref long x ); - [DllImport( "winmm.dll" )] - protected static extern void timeBeginPeriod( uint x ); - [DllImport( "winmm.dll" )] - protected static extern void timeEndPeriod( uint x ); - [DllImport( "winmm.dll" )] - protected static extern uint timeGetDevCaps( out TimeCaps timeCaps, uint size ); - [DllImport( "winmm.dll" )] - protected static extern uint timeGetTime(); - - [StructLayout( LayoutKind.Sequential )] - protected struct TimeCaps - { - public uint wPeriodMin; - public uint wPeriodMax; - } - */ - //----------------- - #endregion + return false; } + protected bool b確認と設定_PerformanceCounter() + { + if( QueryPerformanceFrequency( ref this.n現在の周波数 ) != 0 ) + { + this.eタイマ種別 = E種別.PerformanceCounter; + return true; + } + return false; + } + */ + //----------------- + #endregion + + #region [ DllImport ] + //----------------- + /* + [DllImport( "kernel32.dll" )] + protected static extern short QueryPerformanceCounter( ref long x ); + [DllImport( "kernel32.dll" )] + protected static extern short QueryPerformanceFrequency( ref long x ); + [DllImport( "winmm.dll" )] + protected static extern void timeBeginPeriod( uint x ); + [DllImport( "winmm.dll" )] + protected static extern void timeEndPeriod( uint x ); + [DllImport( "winmm.dll" )] + protected static extern uint timeGetDevCaps( out TimeCaps timeCaps, uint size ); + [DllImport( "winmm.dll" )] + protected static extern uint timeGetTime(); + + [StructLayout( LayoutKind.Sequential )] + protected struct TimeCaps + { + public uint wPeriodMin; + public uint wPeriodMax; + } + */ + //----------------- + #endregion } diff --git a/FDK/src/00.Common/CTimerBase.cs b/FDK/src/00.Common/CTimerBase.cs index 6b17aee9..3c42b57d 100644 --- a/FDK/src/00.Common/CTimerBase.cs +++ b/FDK/src/00.Common/CTimerBase.cs @@ -1,144 +1,144 @@ -namespace FDK { - /// - /// タイマの抽象クラス。 - /// このクラスを継承し、override したクラスを作成することで、任意のクロックを持つタイマを作成できる。 - /// - public abstract class CTimerBase : IDisposable { - public const long UnusedNum = -1; +namespace FDK; - // この2つを override する。 - public abstract long SystemTimeMs { - get; - } - public double SystemTimeMs_Double { - get; - set; - } - public abstract void Dispose(); +/// +/// タイマの抽象クラス。 +/// このクラスを継承し、override したクラスを作成することで、任意のクロックを持つタイマを作成できる。 +/// +public abstract class CTimerBase : IDisposable { + public const long UnusedNum = -1; - #region [ DTXMania用に、語尾にmsのつかない宣言を追加 ] - public long SystemTime { - get { return SystemTimeMs; } - } - public long NowTime { - get { return NowTimeMs; } - set { NowTimeMs = value; } - } - public long PrevResetTime { - get { return PrevResetTimeMs; } - } - - //double - public double SystemTime_Double { - get { return SystemTimeMs_Double; } - } - public double NowTime_Double { - get { return NowTimeMs_Double; } - set { NowTimeMs_Double = value; } - } - public double PrevResetTime_Double { - get { return PrevResetTimeMs_Double; } - } - #endregion - - public long NowTimeMs { - get { - if (this.StopCount > 0) - return (this.PauseSystemTimeMs - this.PrevResetTimeMs); - - return (this.UpdateSystemTime - this.PrevResetTimeMs); - } - set { - if (this.StopCount > 0) - this.PrevResetTimeMs = this.PauseSystemTimeMs - value; - else - this.PrevResetTimeMs = this.UpdateSystemTime - value; - } - } - public long RealNowTimeMs { - get { - if (this.StopCount > 0) - return (this.PauseSystemTimeMs - this.PrevResetTimeMs); - - return (this.SystemTimeMs - this.PrevResetTimeMs); - } - } - public long PrevResetTimeMs { - get; - protected set; - } - - - public double NowTimeMs_Double { - get { - if (this.StopCount > 0) - return (this.PauseSystemTimeMs_Double - this.PrevResetTimeMs_Double); - - return (this.UpdateSystemTime_Double - this.PrevResetTimeMs_Double); - } - set { - if (this.StopCount > 0) - this.PrevResetTimeMs_Double = this.PauseSystemTimeMs_Double - value; - else - this.PrevResetTimeMs_Double = this.UpdateSystemTime_Double - value; - } - } - public double RealNowTimeMs_Double { - get { - if (this.StopCount > 0) - return (this.PauseSystemTimeMs_Double - this.PrevResetTimeMs_Double); - - return (this.SystemTimeMs_Double - this.PrevResetTimeMs_Double); - } - } - public double PrevResetTimeMs_Double { - get; - protected set; - } - - public bool IsUnStoped { - get { - return (this.StopCount == 0); - } - } - - public void Reset() { - this.Update(); - this.PrevResetTimeMs = this.UpdateSystemTime; - this.PauseSystemTimeMs = this.UpdateSystemTime; - this.StopCount = 0; - } - public void Pause() { - if (this.StopCount == 0) { - this.PauseSystemTimeMs = this.UpdateSystemTime; - this.PauseSystemTimeMs_Double = this.UpdateSystemTime_Double; - } - - this.StopCount++; - } - public void Update() { - this.UpdateSystemTime = this.SystemTimeMs; - this.UpdateSystemTime_Double = this.SystemTimeMs_Double; - } - public void Resume() { - if (this.StopCount > 0) { - this.StopCount--; - if (this.StopCount == 0) { - this.Update(); - this.PrevResetTimeMs += this.UpdateSystemTime - this.PauseSystemTimeMs; - this.PrevResetTimeMs_Double += this.UpdateSystemTime_Double - this.PauseSystemTimeMs_Double; - } - } - } - - #region [ protected ] - //----------------- - protected long PauseSystemTimeMs = 0; - protected long UpdateSystemTime = 0; - protected double PauseSystemTimeMs_Double = 0; - protected double UpdateSystemTime_Double = 0; - protected int StopCount = 0; - //----------------- - #endregion + // この2つを override する。 + public abstract long SystemTimeMs { + get; } + public double SystemTimeMs_Double { + get; + set; + } + public abstract void Dispose(); + + #region [ DTXMania用に、語尾にmsのつかない宣言を追加 ] + public long SystemTime { + get { return SystemTimeMs; } + } + public long NowTime { + get { return NowTimeMs; } + set { NowTimeMs = value; } + } + public long PrevResetTime { + get { return PrevResetTimeMs; } + } + + //double + public double SystemTime_Double { + get { return SystemTimeMs_Double; } + } + public double NowTime_Double { + get { return NowTimeMs_Double; } + set { NowTimeMs_Double = value; } + } + public double PrevResetTime_Double { + get { return PrevResetTimeMs_Double; } + } + #endregion + + public long NowTimeMs { + get { + if (this.StopCount > 0) + return (this.PauseSystemTimeMs - this.PrevResetTimeMs); + + return (this.UpdateSystemTime - this.PrevResetTimeMs); + } + set { + if (this.StopCount > 0) + this.PrevResetTimeMs = this.PauseSystemTimeMs - value; + else + this.PrevResetTimeMs = this.UpdateSystemTime - value; + } + } + public long RealNowTimeMs { + get { + if (this.StopCount > 0) + return (this.PauseSystemTimeMs - this.PrevResetTimeMs); + + return (this.SystemTimeMs - this.PrevResetTimeMs); + } + } + public long PrevResetTimeMs { + get; + protected set; + } + + + public double NowTimeMs_Double { + get { + if (this.StopCount > 0) + return (this.PauseSystemTimeMs_Double - this.PrevResetTimeMs_Double); + + return (this.UpdateSystemTime_Double - this.PrevResetTimeMs_Double); + } + set { + if (this.StopCount > 0) + this.PrevResetTimeMs_Double = this.PauseSystemTimeMs_Double - value; + else + this.PrevResetTimeMs_Double = this.UpdateSystemTime_Double - value; + } + } + public double RealNowTimeMs_Double { + get { + if (this.StopCount > 0) + return (this.PauseSystemTimeMs_Double - this.PrevResetTimeMs_Double); + + return (this.SystemTimeMs_Double - this.PrevResetTimeMs_Double); + } + } + public double PrevResetTimeMs_Double { + get; + protected set; + } + + public bool IsUnStoped { + get { + return (this.StopCount == 0); + } + } + + public void Reset() { + this.Update(); + this.PrevResetTimeMs = this.UpdateSystemTime; + this.PauseSystemTimeMs = this.UpdateSystemTime; + this.StopCount = 0; + } + public void Pause() { + if (this.StopCount == 0) { + this.PauseSystemTimeMs = this.UpdateSystemTime; + this.PauseSystemTimeMs_Double = this.UpdateSystemTime_Double; + } + + this.StopCount++; + } + public void Update() { + this.UpdateSystemTime = this.SystemTimeMs; + this.UpdateSystemTime_Double = this.SystemTimeMs_Double; + } + public void Resume() { + if (this.StopCount > 0) { + this.StopCount--; + if (this.StopCount == 0) { + this.Update(); + this.PrevResetTimeMs += this.UpdateSystemTime - this.PauseSystemTimeMs; + this.PrevResetTimeMs_Double += this.UpdateSystemTime_Double - this.PauseSystemTimeMs_Double; + } + } + } + + #region [ protected ] + //----------------- + protected long PauseSystemTimeMs = 0; + protected long UpdateSystemTime = 0; + protected double PauseSystemTimeMs_Double = 0; + protected double UpdateSystemTime_Double = 0; + protected int StopCount = 0; + //----------------- + #endregion } diff --git a/FDK/src/00.Common/CTraceLogListener.cs b/FDK/src/00.Common/CTraceLogListener.cs index 227b7c50..6b562137 100644 --- a/FDK/src/00.Common/CTraceLogListener.cs +++ b/FDK/src/00.Common/CTraceLogListener.cs @@ -1,109 +1,109 @@ using System.Diagnostics; -namespace FDK { - public class CTraceLogListener : TraceListener { - public CTraceLogListener(StreamWriter stream) { - this.LogStreamWriter = stream; - } +namespace FDK; - public override void Flush() { - if (this.LogStreamWriter != null) { - try { - this.LogStreamWriter.Flush(); - } catch (ObjectDisposedException) { - } - } - } - public override void TraceEvent(TraceEventCache eventCache, string source, TraceEventType eventType, int id, string message) { - if (this.LogStreamWriter != null) { - try { - this.LogEventType(eventType); - this.LogIndent(); - this.LogStreamWriter.WriteLine(message); - } catch (ObjectDisposedException) { - } - } - } - public override void TraceEvent(TraceEventCache eventCache, string source, TraceEventType eventType, int id, string format, params object[] args) { - if (this.LogStreamWriter != null) { - try { - this.LogEventType(eventType); - this.LogIndent(); - this.LogStreamWriter.WriteLine(string.Format(format, args)); - } catch (ObjectDisposedException) { - } - } - } - public override void Write(string message) { - if (this.LogStreamWriter != null) { - try { - this.LogStreamWriter.Write(message); - } catch (ObjectDisposedException) { - } - } - } - public override void WriteLine(string message) { - if (this.LogStreamWriter != null) { - try { - this.LogStreamWriter.WriteLine(message); - } catch (ObjectDisposedException) { - } - } - } - - protected override void Dispose(bool disposing) { - if (this.LogStreamWriter != null) { - try { - this.LogStreamWriter.Close(); - } catch { - } - this.LogStreamWriter = null; - } - base.Dispose(disposing); - } - - #region [ private ] - //----------------- - private StreamWriter LogStreamWriter; - - private void LogEventType(TraceEventType eventType) { - if (this.LogStreamWriter != null) { - try { - var now = DateTime.Now; - this.LogStreamWriter.Write(string.Format("{0:D4}/{1:D2}/{2:D2} {3:D2}:{4:D2}:{5:D2}.{6:D3} ", new object[] { now.Year, now.Month, now.Day, now.Hour, now.Minute, now.Second, now.Millisecond })); - switch (eventType) { - case TraceEventType.Error: - this.LogStreamWriter.Write("[ERROR] "); - return; - - case (TraceEventType.Error | TraceEventType.Critical): - return; - - case TraceEventType.Warning: - this.LogStreamWriter.Write("[WARNING] "); - return; - - case TraceEventType.Information: - break; - - default: - return; - } - this.LogStreamWriter.Write("[INFO] "); - } catch (ObjectDisposedException) { - } - } - } - private void LogIndent() { - if ((this.LogStreamWriter != null) && (base.IndentLevel > 0)) { - try { - for (int i = 0; i < base.IndentLevel; i++) - this.LogStreamWriter.Write(" "); - } catch (ObjectDisposedException) { - } - } - } - //----------------- - #endregion +public class CTraceLogListener : TraceListener { + public CTraceLogListener(StreamWriter stream) { + this.LogStreamWriter = stream; } + + public override void Flush() { + if (this.LogStreamWriter != null) { + try { + this.LogStreamWriter.Flush(); + } catch (ObjectDisposedException) { + } + } + } + public override void TraceEvent(TraceEventCache eventCache, string source, TraceEventType eventType, int id, string message) { + if (this.LogStreamWriter != null) { + try { + this.LogEventType(eventType); + this.LogIndent(); + this.LogStreamWriter.WriteLine(message); + } catch (ObjectDisposedException) { + } + } + } + public override void TraceEvent(TraceEventCache eventCache, string source, TraceEventType eventType, int id, string format, params object[] args) { + if (this.LogStreamWriter != null) { + try { + this.LogEventType(eventType); + this.LogIndent(); + this.LogStreamWriter.WriteLine(string.Format(format, args)); + } catch (ObjectDisposedException) { + } + } + } + public override void Write(string message) { + if (this.LogStreamWriter != null) { + try { + this.LogStreamWriter.Write(message); + } catch (ObjectDisposedException) { + } + } + } + public override void WriteLine(string message) { + if (this.LogStreamWriter != null) { + try { + this.LogStreamWriter.WriteLine(message); + } catch (ObjectDisposedException) { + } + } + } + + protected override void Dispose(bool disposing) { + if (this.LogStreamWriter != null) { + try { + this.LogStreamWriter.Close(); + } catch { + } + this.LogStreamWriter = null; + } + base.Dispose(disposing); + } + + #region [ private ] + //----------------- + private StreamWriter LogStreamWriter; + + private void LogEventType(TraceEventType eventType) { + if (this.LogStreamWriter != null) { + try { + var now = DateTime.Now; + this.LogStreamWriter.Write(string.Format("{0:D4}/{1:D2}/{2:D2} {3:D2}:{4:D2}:{5:D2}.{6:D3} ", new object[] { now.Year, now.Month, now.Day, now.Hour, now.Minute, now.Second, now.Millisecond })); + switch (eventType) { + case TraceEventType.Error: + this.LogStreamWriter.Write("[ERROR] "); + return; + + case (TraceEventType.Error | TraceEventType.Critical): + return; + + case TraceEventType.Warning: + this.LogStreamWriter.Write("[WARNING] "); + return; + + case TraceEventType.Information: + break; + + default: + return; + } + this.LogStreamWriter.Write("[INFO] "); + } catch (ObjectDisposedException) { + } + } + } + private void LogIndent() { + if ((this.LogStreamWriter != null) && (base.IndentLevel > 0)) { + try { + for (int i = 0; i < base.IndentLevel; i++) + this.LogStreamWriter.Write(" "); + } catch (ObjectDisposedException) { + } + } + } + //----------------- + #endregion } diff --git a/FDK/src/00.Common/CUtility.cs b/FDK/src/00.Common/CUtility.cs index d311b541..577c033e 100644 --- a/FDK/src/00.Common/CUtility.cs +++ b/FDK/src/00.Common/CUtility.cs @@ -1,109 +1,109 @@ using System.Diagnostics; using System.Text; -namespace FDK { - public class CUtility { +namespace FDK; - public static void RunCompleteGC() { - GC.Collect(); // アクセス不可能なオブジェクトを除去し、ファイナライぜーション実施。 - GC.WaitForPendingFinalizers(); // ファイナライゼーションが終わるまでスレッドを待機。 - GC.Collect(); // ファイナライズされたばかりのオブジェクトに関連するメモリを開放。 +public class CUtility { - // 出展: http://msdn.microsoft.com/ja-jp/library/ms998547.aspx#scalenetchapt05_topic10 - } + public static void RunCompleteGC() { + GC.Collect(); // アクセス不可能なオブジェクトを除去し、ファイナライぜーション実施。 + GC.WaitForPendingFinalizers(); // ファイナライゼーションが終わるまでスレッドを待機。 + GC.Collect(); // ファイナライズされたばかりのオブジェクトに関連するメモリを開放。 + + // 出展: http://msdn.microsoft.com/ja-jp/library/ms998547.aspx#scalenetchapt05_topic10 + } - // ログ + // ログ - public static void LogBlock(string name, Action method) { + public static void LogBlock(string name, Action method) { + Trace.TraceInformation("--------------------"); + Trace.TraceInformation("開始 - " + name); + Trace.Indent(); + try { + method(); + } finally { + Trace.Unindent(); + Trace.TraceInformation("終了 - " + name); Trace.TraceInformation("--------------------"); - Trace.TraceInformation("開始 - " + name); - Trace.Indent(); - try { - method(); - } finally { - Trace.Unindent(); - Trace.TraceInformation("終了 - " + name); - Trace.TraceInformation("--------------------"); - } - } - public static void LogException(Exception e) { - Trace.WriteLine("---例外ここから----"); - Trace.WriteLine(e.ToString()); - Trace.WriteLine("---例外ここまで----"); - } - - - // IO - - public static string t指定した拡張子を持つファイルを検索し最初に見つけたファイルの絶対パスを返す(string strフォルダパス, List extensions) { - string[] files = Directory.GetFiles(strフォルダパス); // GetFiles() は完全パスを返す。 - - - // ファイル順より拡張子順を優先して検索する。→ 拡張子リストの前方の拡張子ほど先に発見されるようにするため。 - - foreach (string ext in extensions) { - foreach (string file in files) { - string fileExt = Path.GetExtension(file); - - if (fileExt.Equals(ext, StringComparison.OrdinalIgnoreCase)) - return file; // あった - } - } - - return null; // なかった - } - - public static void ReadXML(string fileName, out T xmlObject) { - xmlObject = default(T); - - FileStream fs = null; - StreamReader sr = null; - try { - fs = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite); // FileShare を付けとかないと、Close() 後もロックがかかる。 - sr = new StreamReader(fs, Encoding.UTF8); - var xmlsl = new System.Xml.Serialization.XmlSerializer(typeof(T)); - xmlObject = (T)xmlsl.Deserialize(sr); - } finally { - if (sr != null) - sr.Close(); // fr も一緒にClose()される - } - } - public static void WriteXML(string fileName, T xmlObject) { - FileStream fs = null; - StreamWriter sw = null; - try { - fs = new FileStream(fileName, FileMode.Create, FileAccess.Write, FileShare.ReadWrite); // FileShare を付けとかないと、Close() 後もロックがかかる。 - sw = new StreamWriter(fs, Encoding.UTF8); - var xmlsl = new System.Xml.Serialization.XmlSerializer(typeof(T)); - xmlsl.Serialize(sw, xmlObject); - } finally { - if (sw != null) - sw.Close(); // fs も一緒にClose()される - } - } - - - // 数学 - - public static double DegreeToRadian(double angle) { - return ((Math.PI * angle) / 180.0); - } - public static double RadianToDegree(double angle) { - return (angle * 180.0 / Math.PI); - } - public static float DegreeToRadian(float angle) { - return (float)DegreeToRadian((double)angle); - } - public static float RadianToDegree(float angle) { - return (float)RadianToDegree((double)angle); - } - - public static bool ToggleBoolian(ref bool bFlag) { - if (bFlag == true) bFlag = false; - else if (bFlag == false) bFlag = true; - - return true; } } + public static void LogException(Exception e) { + Trace.WriteLine("---例外ここから----"); + Trace.WriteLine(e.ToString()); + Trace.WriteLine("---例外ここまで----"); + } + + + // IO + + public static string t指定した拡張子を持つファイルを検索し最初に見つけたファイルの絶対パスを返す(string strフォルダパス, List extensions) { + string[] files = Directory.GetFiles(strフォルダパス); // GetFiles() は完全パスを返す。 + + + // ファイル順より拡張子順を優先して検索する。→ 拡張子リストの前方の拡張子ほど先に発見されるようにするため。 + + foreach (string ext in extensions) { + foreach (string file in files) { + string fileExt = Path.GetExtension(file); + + if (fileExt.Equals(ext, StringComparison.OrdinalIgnoreCase)) + return file; // あった + } + } + + return null; // なかった + } + + public static void ReadXML(string fileName, out T xmlObject) { + xmlObject = default(T); + + FileStream fs = null; + StreamReader sr = null; + try { + fs = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite); // FileShare を付けとかないと、Close() 後もロックがかかる。 + sr = new StreamReader(fs, Encoding.UTF8); + var xmlsl = new System.Xml.Serialization.XmlSerializer(typeof(T)); + xmlObject = (T)xmlsl.Deserialize(sr); + } finally { + if (sr != null) + sr.Close(); // fr も一緒にClose()される + } + } + public static void WriteXML(string fileName, T xmlObject) { + FileStream fs = null; + StreamWriter sw = null; + try { + fs = new FileStream(fileName, FileMode.Create, FileAccess.Write, FileShare.ReadWrite); // FileShare を付けとかないと、Close() 後もロックがかかる。 + sw = new StreamWriter(fs, Encoding.UTF8); + var xmlsl = new System.Xml.Serialization.XmlSerializer(typeof(T)); + xmlsl.Serialize(sw, xmlObject); + } finally { + if (sw != null) + sw.Close(); // fs も一緒にClose()される + } + } + + + // 数学 + + public static double DegreeToRadian(double angle) { + return ((Math.PI * angle) / 180.0); + } + public static double RadianToDegree(double angle) { + return (angle * 180.0 / Math.PI); + } + public static float DegreeToRadian(float angle) { + return (float)DegreeToRadian((double)angle); + } + public static float RadianToDegree(float angle) { + return (float)RadianToDegree((double)angle); + } + + public static bool ToggleBoolian(ref bool bFlag) { + if (bFlag == true) bFlag = false; + else if (bFlag == false) bFlag = true; + + return true; + } } diff --git a/FDK/src/00.Common/Color4.cs b/FDK/src/00.Common/Color4.cs index 5ddf24e4..0e76dff1 100644 --- a/FDK/src/00.Common/Color4.cs +++ b/FDK/src/00.Common/Color4.cs @@ -1,22 +1,22 @@ -namespace FDK { - public class Color4 { - public float Red; - public float Green; - public float Blue; - public float Alpha; +namespace FDK; - public Color4(float r, float g, float b, float a) { - Red = r; - Green = g; - Blue = b; - Alpha = a; - } +public class Color4 { + public float Red; + public float Green; + public float Blue; + public float Alpha; - public Color4(int rgba) { - Alpha = ((rgba >> 24) & 255) / 255.0f; - Blue = ((rgba >> 16) & 255) / 255.0f; - Green = ((rgba >> 8) & 255) / 255.0f; - Red = (rgba & 255) / 255.0f; - } + public Color4(float r, float g, float b, float a) { + Red = r; + Green = g; + Blue = b; + Alpha = a; + } + + public Color4(int rgba) { + Alpha = ((rgba >> 24) & 255) / 255.0f; + Blue = ((rgba >> 16) & 255) / 255.0f; + Green = ((rgba >> 8) & 255) / 255.0f; + Red = (rgba & 255) / 255.0f; } } diff --git a/FDK/src/00.Common/ExtensionMethods/DoubleExtensions.cs b/FDK/src/00.Common/ExtensionMethods/DoubleExtensions.cs index 64358c68..36d2fd2e 100644 --- a/FDK/src/00.Common/ExtensionMethods/DoubleExtensions.cs +++ b/FDK/src/00.Common/ExtensionMethods/DoubleExtensions.cs @@ -1,7 +1,7 @@ -namespace FDK.ExtensionMethods { - public static class DoubleExtensions { - public static double Clamp(this double value, double min, double max) { - return Math.Min(Math.Max(value, min), max); - } +namespace FDK.ExtensionMethods; + +public static class DoubleExtensions { + public static double Clamp(this double value, double min, double max) { + return Math.Min(Math.Max(value, min), max); } } diff --git a/FDK/src/00.Common/ExtensionMethods/Int32Extensions.cs b/FDK/src/00.Common/ExtensionMethods/Int32Extensions.cs index 7530e63c..c661ab79 100644 --- a/FDK/src/00.Common/ExtensionMethods/Int32Extensions.cs +++ b/FDK/src/00.Common/ExtensionMethods/Int32Extensions.cs @@ -1,7 +1,7 @@ -namespace FDK.ExtensionMethods { - public static class Int32Extensions { - public static int Clamp(this int value, int min, int max) { - return Math.Min(Math.Max(value, min), max); - } +namespace FDK.ExtensionMethods; + +public static class Int32Extensions { + public static int Clamp(this int value, int min, int max) { + return Math.Min(Math.Max(value, min), max); } } diff --git a/FDK/src/01.Framework/Core/Game.cs b/FDK/src/01.Framework/Core/Game.cs index 06b389f0..bc8f12d7 100644 --- a/FDK/src/01.Framework/Core/Game.cs +++ b/FDK/src/01.Framework/Core/Game.cs @@ -32,456 +32,455 @@ using Silk.NET.OpenGLES.Extensions.ImGui; using Silk.NET.Windowing; using SkiaSharp; -namespace SampleFramework { - /// - /// Presents an easy to use wrapper for making games and samples. - /// - public abstract class Game : IDisposable { - public static GL Gl { get; private set; } - public static Silk.NET.Core.Contexts.IGLContext Context { get; private set; } +namespace SampleFramework; - public static ImGuiController ImGuiController { get; private set; } - public static ImGuiIOPtr ImGuiIO { get; private set; } - private static CTexture ImGuiFontAtlas; +/// +/// Presents an easy to use wrapper for making games and samples. +/// +public abstract class Game : IDisposable { + public static GL Gl { get; private set; } + public static Silk.NET.Core.Contexts.IGLContext Context { get; private set; } - static string _test = ""; - public static void InitImGuiController(IView window, IInputContext context) { - if (ImGuiController != null) return; + public static ImGuiController ImGuiController { get; private set; } + public static ImGuiIOPtr ImGuiIO { get; private set; } + private static CTexture ImGuiFontAtlas; - ImGuiController = new ImGuiController(Gl, window, context); - ImGuiIO = ImGui.GetIO(); - ImGui.StyleColorsDark(); + static string _test = ""; + public static void InitImGuiController(IView window, IInputContext context) { + if (ImGuiController != null) return; + + ImGuiController = new ImGuiController(Gl, window, context); + ImGuiIO = ImGui.GetIO(); + ImGui.StyleColorsDark(); #if DEBUG - try { - ImGuiIO.Fonts.Clear(); - unsafe { - Stream data = Assembly.GetExecutingAssembly().GetManifestResourceStream(@"FDK.mplus-1p-medium.ttf"); - byte[] stream_data = new byte[data.Length]; - data.Read(stream_data); - fixed (byte* stream = stream_data) { - ImFontConfigPtr config = new ImFontConfigPtr(ImGuiNative.ImFontConfig_ImFontConfig()); - ImGuiIO.Fonts.AddFontFromMemoryTTF((IntPtr)stream, 64, 16.0f, config, ImGuiIO.Fonts.GetGlyphRangesDefault()); - config.MergeMode = true; - ImGuiIO.Fonts.AddFontFromMemoryTTF((IntPtr)stream, 64, 16.0f, config, ImGuiIO.Fonts.GetGlyphRangesJapanese()); + try { + ImGuiIO.Fonts.Clear(); + unsafe { + Stream data = Assembly.GetExecutingAssembly().GetManifestResourceStream(@"FDK.mplus-1p-medium.ttf"); + byte[] stream_data = new byte[data.Length]; + data.Read(stream_data); + fixed (byte* stream = stream_data) { + ImFontConfigPtr config = new ImFontConfigPtr(ImGuiNative.ImFontConfig_ImFontConfig()); + ImGuiIO.Fonts.AddFontFromMemoryTTF((IntPtr)stream, 64, 16.0f, config, ImGuiIO.Fonts.GetGlyphRangesDefault()); + config.MergeMode = true; + ImGuiIO.Fonts.AddFontFromMemoryTTF((IntPtr)stream, 64, 16.0f, config, ImGuiIO.Fonts.GetGlyphRangesJapanese()); - ImGuiIO.Fonts.GetTexDataAsRGBA32(out byte* out_pixels, out int width, out int height); + ImGuiIO.Fonts.GetTexDataAsRGBA32(out byte* out_pixels, out int width, out int height); - using (SKImage image = SKImage.FromPixels(new SKImageInfo(width, height, SKColorType.Rgba8888, SKAlphaType.Opaque), (IntPtr)out_pixels)) { - using (SKBitmap bitmap = SKBitmap.FromImage(image)) { - ImGuiFontAtlas?.Dispose(); - ImGuiFontAtlas = new CTexture(bitmap); - } + using (SKImage image = SKImage.FromPixels(new SKImageInfo(width, height, SKColorType.Rgba8888, SKAlphaType.Opaque), (IntPtr)out_pixels)) { + using (SKBitmap bitmap = SKBitmap.FromImage(image)) { + ImGuiFontAtlas?.Dispose(); + ImGuiFontAtlas = new CTexture(bitmap); } - Marshal.FreeHGlobal((IntPtr)out_pixels); - - ImGuiIO.Fonts.SetTexID((nint)ImGuiFontAtlas.Pointer); } + Marshal.FreeHGlobal((IntPtr)out_pixels); + + ImGuiIO.Fonts.SetTexID((nint)ImGuiFontAtlas.Pointer); } } - catch (Exception ex) { - ImGuiIO.Fonts.Clear(); - ImGuiIO.Fonts.AddFontDefault(); - } + } catch (Exception ex) { + ImGuiIO.Fonts.Clear(); + ImGuiIO.Fonts.AddFontDefault(); + } #endif - } - - public static List AsyncActions { get; private set; } = new(); - - private string strIconFileName; - - protected string _Text = ""; - protected string Text { - get { - return _Text; - } - set { - _Text = value; - if (Window_ != null) { - Window_.Title = value; - } - } - } - - public static AnglePlatformType GraphicsDeviceType_ = AnglePlatformType.OpenGL; - - public IWindow Window_; - - private Vector2D _WindowSize; - public Vector2D WindowSize { - get { - return _WindowSize; - } - set { - _WindowSize = value; - if (Window_ != null) { - Window_.Size = value; - } - } - } - - private Vector2D _WindowPosition; - public Vector2D WindowPosition { - get { - return _WindowPosition; - } - set { - _WindowPosition = value; - if (Window_ != null) { - Window_.Position = value; - } - } - } - - private int _Framerate; - - public int Framerate { - get { - return _Framerate; - } - set { - _Framerate = value; - if (Window_ != null) { - UpdateWindowFramerate(VSync, value); - } - } - } - - private bool _FullScreen; - public bool FullScreen { - get { - return _FullScreen; - } - set { - _FullScreen = value; - if (Window_ != null) { - Window_.WindowState = value ? WindowState.Fullscreen : WindowState.Normal; - } - } - } - - private bool _VSync; - public bool VSync { - get { - return _VSync; - } - set { - _VSync = value; - if (Window_ != null) { - UpdateWindowFramerate(value, Framerate); - Window_.VSync = value; - } - } - } - - public static int MainThreadID { get; private set; } - - private Vector2D ViewPortSize = new Vector2D(); - private Vector2D ViewPortOffset = new Vector2D(); - - public unsafe SKBitmap GetScreenShot() { - int ViewportWidth = ViewPortSize.X; - int ViewportHeight = ViewPortSize.Y; - fixed (uint* pixels = new uint[(uint)ViewportWidth * (uint)ViewportHeight]) { - Gl.ReadBuffer(GLEnum.Front); - Gl.ReadPixels(ViewPortOffset.X, ViewPortOffset.Y, (uint)ViewportWidth, (uint)ViewportHeight, PixelFormat.Bgra, GLEnum.UnsignedByte, pixels); - - fixed (uint* pixels2 = new uint[(uint)ViewportWidth * (uint)ViewportHeight]) { - for (int x = 0; x < ViewportWidth; x++) { - for (int y = 1; y < ViewportHeight; y++) { - int pos = x + ((y - 1) * ViewportWidth); - int pos2 = x + ((ViewportHeight - y) * ViewportWidth); - var p = pixels[pos2]; - pixels2[pos] = p; - } - } - - using SKBitmap sKBitmap = new(ViewportWidth, ViewportHeight - 1); - sKBitmap.SetPixels((IntPtr)pixels2); - return sKBitmap.Copy(); - } - } - } - - public unsafe void GetScreenShotAsync(Action action) { - int ViewportWidth = ViewPortSize.X; - int ViewportHeight = ViewPortSize.Y; - byte[] pixels = new byte[(uint)ViewportWidth * (uint)ViewportHeight * 4]; - Gl.ReadBuffer(GLEnum.Front); - fixed (byte* pix = pixels) { - Gl.ReadPixels(ViewPortOffset.X, ViewPortOffset.Y, (uint)ViewportWidth, (uint)ViewportHeight, PixelFormat.Bgra, GLEnum.UnsignedByte, pix); - } - - Task.Run(() => { - fixed (byte* pixels2 = new byte[(uint)ViewportWidth * (uint)ViewportHeight * 4]) { - for (int x = 0; x < ViewportWidth; x++) { - for (int y = 1; y < ViewportHeight; y++) { - int pos = x + ((y - 1) * ViewportWidth); - int pos2 = x + ((ViewportHeight - y) * ViewportWidth); - pixels2[(pos * 4) + 0] = pixels[(pos2 * 4) + 0]; - pixels2[(pos * 4) + 1] = pixels[(pos2 * 4) + 1]; - pixels2[(pos * 4) + 2] = pixels[(pos2 * 4) + 2]; - pixels2[(pos * 4) + 3] = 255; - } - } - - using SKBitmap sKBitmap = new(ViewportWidth, ViewportHeight - 1); - sKBitmap.SetPixels((IntPtr)pixels2); - - using SKBitmap scaledBitmap = new(GameWindowSize.Width, GameWindowSize.Height); - if (sKBitmap.ScalePixels(scaledBitmap, SKFilterQuality.High)) action(scaledBitmap); - else action(sKBitmap); - } - }); - } - - public static long TimeMs; - - public static Matrix4X4 Camera; - - public static float ScreenAspect { - get { - return (float)GameWindowSize.Width / GameWindowSize.Height; - } - } - - //[DllImportAttribute("libEGL", EntryPoint = "eglGetError")] - //public static extern Silk.NET.OpenGLES.ErrorCode GetError(); - - /// - /// Initializes the class. - /// - static Game() { - //GlfwProvider.UninitializedGLFW.Value.InitHint(InitHint.AnglePlatformType, (int)AnglePlatformType.OpenGL); - //GlfwProvider.UninitializedGLFW.Value.Init(); - //GetError(); - } - - private RawImage GetIconData(string fileName) { - SKCodec codec = SKCodec.Create(fileName); - using SKBitmap bitmap = SKBitmap.Decode(codec, new SKImageInfo(codec.Info.Width, codec.Info.Height, SKColorType.Rgba8888)); - return new RawImage(bitmap.Width, bitmap.Height, bitmap.GetPixelSpan().ToArray()); - } - - /// - /// Initializes a new instance of the class. - /// - protected Game(string iconFileName) { - strIconFileName = iconFileName; - - MainThreadID = Thread.CurrentThread.ManagedThreadId; - Configuration(); - - //GlfwProvider.GLFW.Value.WindowHint(WindowHintContextApi.ContextCreationApi, ContextApi.EglContextApi); - - WindowOptions options = WindowOptions.Default; - - options.Size = WindowSize; - options.Position = WindowPosition; - options.UpdatesPerSecond = VSync ? 0 : Framerate; - options.FramesPerSecond = VSync ? 0 : Framerate; - options.WindowState = FullScreen ? WindowState.Fullscreen : WindowState.Normal; - options.VSync = VSync; - //options.API = new GraphicsAPI( ContextAPI.OpenGLES, ContextProfile.Core, ContextFlags.Default, new APIVersion(2, 0)); - options.API = GraphicsAPI.None; - options.WindowBorder = WindowBorder.Resizable; - options.Title = Text; - - - Silk.NET.Windowing.Glfw.GlfwWindowing.Use(); - //Silk.NET.Windowing.Sdl.SdlWindowing.Use(); - - Window_ = Window.Create(options); - - ViewPortSize.X = Window_.Size.X; - ViewPortSize.Y = Window_.Size.Y; - ViewPortOffset.X = 0; - ViewPortOffset.Y = 0; - - Window_.Load += Window_Load; - Window_.Closing += Window_Closing; - Window_.Update += Window_Update; - Window_.Render += Window_Render; - Window_.Resize += Window_Resize; - Window_.Move += Window_Move; - Window_.FramebufferResize += Window_FramebufferResize; - } - - private void UpdateWindowFramerate(bool vsync, int value) { - if (vsync) { - Window_.UpdatesPerSecond = 0; - Window_.FramesPerSecond = 0; - Context.SwapInterval(1); - } else { - Window_.UpdatesPerSecond = value; - Window_.FramesPerSecond = value; - Context.SwapInterval(0); - } - } - - /// - /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. - /// - public void Dispose() { - Window_.Dispose(); - } - - public void Exit() { - Window_.Close(); - } - - protected void ToggleWindowMode() { - /* - DeviceSettings settings = base.GraphicsDeviceManager.CurrentSettings.Clone(); - if ( ( ConfigIni != null ) && ( ConfigIni.bウィンドウモード != settings.Windowed ) ) - { - settings.Windowed = ConfigIni.bウィンドウモード; - if ( ConfigIni.bウィンドウモード == false ) // #23510 2010.10.27 yyagi: backup current window size before going fullscreen mode - { - currentClientSize = this.Window.ClientSize; - ConfigIni.nウインドウwidth = this.Window.ClientSize.Width; - ConfigIni.nウインドウheight = this.Window.ClientSize.Height; -// FDK.CTaskBar.ShowTaskBar( false ); - } - base.GraphicsDeviceManager.ChangeDevice( settings ); - if ( ConfigIni.bウィンドウモード == true ) // #23510 2010.10.27 yyagi: to resume window size from backuped value - { - base.Window.ClientSize = - new Size( currentClientSize.Width, currentClientSize.Height ); - base.Window.Icon = Properties.Resources.tjap3; -// FDK.CTaskBar.ShowTaskBar( true ); - } - } - */ - - FullScreen = !FullScreen; - } - - /// - /// Runs the game. - /// - public void Run() { - Window_.Run(); - } - - protected virtual void Configuration() { - - } - - protected virtual void Initialize() { - - } - - - protected virtual void LoadContent() { - - } - - protected virtual void UnloadContent() { - - } - - protected virtual void OnExiting() { - - } - - protected virtual void Update() { - - } - - protected virtual void Draw() { - - } - - /// - /// Releases unmanaged and - optionally - managed resources - /// - /// true to release both managed and unmanaged resources; false to release only unmanaged resources. - protected internal virtual void Dispose(bool disposing) { - - } - - - public void Window_Load() { - Window_.SetWindowIcon(new ReadOnlySpan(GetIconData(strIconFileName))); - - Context = new AngleContext(GraphicsDeviceType_, Window_); - Context.MakeCurrent(); - - Gl = GL.GetApi(Context); - //Gl = Window_.CreateOpenGLES(); - Gl.Enable(GLEnum.Blend); - BlendHelper.SetBlend(BlendType.Normal); - CTexture.Init(); - - Gl.ClearColor(0.0f, 0.0f, 0.0f, 1.0f); - - Gl.Viewport(0, 0, (uint)Window_.Size.X, (uint)Window_.Size.Y); - Context.SwapInterval(VSync ? 1 : 0); - - Initialize(); - LoadContent(); - } - - public void Window_Closing() { - CTexture.Terminate(); - - UnloadContent(); - OnExiting(); - - Context.Dispose(); - } - - public void Window_Update(double deltaTime) { - double fps = 1.0f / deltaTime; - TimeMs = (long)(Window_.Time * 1000); - - Update(); - - ImGuiController?.Update((float)deltaTime); - } - - public void Window_Render(double deltaTime) { - Camera = Matrix4X4.Identity; - - if (AsyncActions.Count > 0) { - AsyncActions[0]?.Invoke(); - AsyncActions.Remove(AsyncActions[0]); - } - Gl.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit); - - Draw(); - - double fps = 1.0f / deltaTime; - -#if DEBUG - ImGuiController?.Render(); -#endif - - Context.SwapBuffers(); - } - - public void Window_Resize(Vector2D size) { - if (size.X > 0 && size.Y > 0) { - float resolutionAspect = (float)GameWindowSize.Width / GameWindowSize.Height; - float windowAspect = (float)size.X / size.Y; - if (windowAspect > resolutionAspect) { - ViewPortSize.X = (int)(size.Y * resolutionAspect); - ViewPortSize.Y = size.Y; - } else { - ViewPortSize.X = size.X; - ViewPortSize.Y = (int)(size.X / resolutionAspect); - } - } - - ViewPortOffset.X = (size.X - ViewPortSize.X) / 2; - ViewPortOffset.Y = (size.Y - ViewPortSize.Y) / 2; - - - Gl.Viewport(ViewPortOffset.X, ViewPortOffset.Y, (uint)ViewPortSize.X, (uint)ViewPortSize.Y); - } - - public void Window_Move(Vector2D size) { } - - public void Window_FramebufferResize(Vector2D size) { } } + + public static List AsyncActions { get; private set; } = new(); + + private string strIconFileName; + + protected string _Text = ""; + protected string Text { + get { + return _Text; + } + set { + _Text = value; + if (Window_ != null) { + Window_.Title = value; + } + } + } + + public static AnglePlatformType GraphicsDeviceType_ = AnglePlatformType.OpenGL; + + public IWindow Window_; + + private Vector2D _WindowSize; + public Vector2D WindowSize { + get { + return _WindowSize; + } + set { + _WindowSize = value; + if (Window_ != null) { + Window_.Size = value; + } + } + } + + private Vector2D _WindowPosition; + public Vector2D WindowPosition { + get { + return _WindowPosition; + } + set { + _WindowPosition = value; + if (Window_ != null) { + Window_.Position = value; + } + } + } + + private int _Framerate; + + public int Framerate { + get { + return _Framerate; + } + set { + _Framerate = value; + if (Window_ != null) { + UpdateWindowFramerate(VSync, value); + } + } + } + + private bool _FullScreen; + public bool FullScreen { + get { + return _FullScreen; + } + set { + _FullScreen = value; + if (Window_ != null) { + Window_.WindowState = value ? WindowState.Fullscreen : WindowState.Normal; + } + } + } + + private bool _VSync; + public bool VSync { + get { + return _VSync; + } + set { + _VSync = value; + if (Window_ != null) { + UpdateWindowFramerate(value, Framerate); + Window_.VSync = value; + } + } + } + + public static int MainThreadID { get; private set; } + + private Vector2D ViewPortSize = new Vector2D(); + private Vector2D ViewPortOffset = new Vector2D(); + + public unsafe SKBitmap GetScreenShot() { + int ViewportWidth = ViewPortSize.X; + int ViewportHeight = ViewPortSize.Y; + fixed (uint* pixels = new uint[(uint)ViewportWidth * (uint)ViewportHeight]) { + Gl.ReadBuffer(GLEnum.Front); + Gl.ReadPixels(ViewPortOffset.X, ViewPortOffset.Y, (uint)ViewportWidth, (uint)ViewportHeight, PixelFormat.Bgra, GLEnum.UnsignedByte, pixels); + + fixed (uint* pixels2 = new uint[(uint)ViewportWidth * (uint)ViewportHeight]) { + for (int x = 0; x < ViewportWidth; x++) { + for (int y = 1; y < ViewportHeight; y++) { + int pos = x + ((y - 1) * ViewportWidth); + int pos2 = x + ((ViewportHeight - y) * ViewportWidth); + var p = pixels[pos2]; + pixels2[pos] = p; + } + } + + using SKBitmap sKBitmap = new(ViewportWidth, ViewportHeight - 1); + sKBitmap.SetPixels((IntPtr)pixels2); + return sKBitmap.Copy(); + } + } + } + + public unsafe void GetScreenShotAsync(Action action) { + int ViewportWidth = ViewPortSize.X; + int ViewportHeight = ViewPortSize.Y; + byte[] pixels = new byte[(uint)ViewportWidth * (uint)ViewportHeight * 4]; + Gl.ReadBuffer(GLEnum.Front); + fixed (byte* pix = pixels) { + Gl.ReadPixels(ViewPortOffset.X, ViewPortOffset.Y, (uint)ViewportWidth, (uint)ViewportHeight, PixelFormat.Bgra, GLEnum.UnsignedByte, pix); + } + + Task.Run(() => { + fixed (byte* pixels2 = new byte[(uint)ViewportWidth * (uint)ViewportHeight * 4]) { + for (int x = 0; x < ViewportWidth; x++) { + for (int y = 1; y < ViewportHeight; y++) { + int pos = x + ((y - 1) * ViewportWidth); + int pos2 = x + ((ViewportHeight - y) * ViewportWidth); + pixels2[(pos * 4) + 0] = pixels[(pos2 * 4) + 0]; + pixels2[(pos * 4) + 1] = pixels[(pos2 * 4) + 1]; + pixels2[(pos * 4) + 2] = pixels[(pos2 * 4) + 2]; + pixels2[(pos * 4) + 3] = 255; + } + } + + using SKBitmap sKBitmap = new(ViewportWidth, ViewportHeight - 1); + sKBitmap.SetPixels((IntPtr)pixels2); + + using SKBitmap scaledBitmap = new(GameWindowSize.Width, GameWindowSize.Height); + if (sKBitmap.ScalePixels(scaledBitmap, SKFilterQuality.High)) action(scaledBitmap); + else action(sKBitmap); + } + }); + } + + public static long TimeMs; + + public static Matrix4X4 Camera; + + public static float ScreenAspect { + get { + return (float)GameWindowSize.Width / GameWindowSize.Height; + } + } + + //[DllImportAttribute("libEGL", EntryPoint = "eglGetError")] + //public static extern Silk.NET.OpenGLES.ErrorCode GetError(); + + /// + /// Initializes the class. + /// + static Game() { + //GlfwProvider.UninitializedGLFW.Value.InitHint(InitHint.AnglePlatformType, (int)AnglePlatformType.OpenGL); + //GlfwProvider.UninitializedGLFW.Value.Init(); + //GetError(); + } + + private RawImage GetIconData(string fileName) { + SKCodec codec = SKCodec.Create(fileName); + using SKBitmap bitmap = SKBitmap.Decode(codec, new SKImageInfo(codec.Info.Width, codec.Info.Height, SKColorType.Rgba8888)); + return new RawImage(bitmap.Width, bitmap.Height, bitmap.GetPixelSpan().ToArray()); + } + + /// + /// Initializes a new instance of the class. + /// + protected Game(string iconFileName) { + strIconFileName = iconFileName; + + MainThreadID = Thread.CurrentThread.ManagedThreadId; + Configuration(); + + //GlfwProvider.GLFW.Value.WindowHint(WindowHintContextApi.ContextCreationApi, ContextApi.EglContextApi); + + WindowOptions options = WindowOptions.Default; + + options.Size = WindowSize; + options.Position = WindowPosition; + options.UpdatesPerSecond = VSync ? 0 : Framerate; + options.FramesPerSecond = VSync ? 0 : Framerate; + options.WindowState = FullScreen ? WindowState.Fullscreen : WindowState.Normal; + options.VSync = VSync; + //options.API = new GraphicsAPI( ContextAPI.OpenGLES, ContextProfile.Core, ContextFlags.Default, new APIVersion(2, 0)); + options.API = GraphicsAPI.None; + options.WindowBorder = WindowBorder.Resizable; + options.Title = Text; + + + Silk.NET.Windowing.Glfw.GlfwWindowing.Use(); + //Silk.NET.Windowing.Sdl.SdlWindowing.Use(); + + Window_ = Window.Create(options); + + ViewPortSize.X = Window_.Size.X; + ViewPortSize.Y = Window_.Size.Y; + ViewPortOffset.X = 0; + ViewPortOffset.Y = 0; + + Window_.Load += Window_Load; + Window_.Closing += Window_Closing; + Window_.Update += Window_Update; + Window_.Render += Window_Render; + Window_.Resize += Window_Resize; + Window_.Move += Window_Move; + Window_.FramebufferResize += Window_FramebufferResize; + } + + private void UpdateWindowFramerate(bool vsync, int value) { + if (vsync) { + Window_.UpdatesPerSecond = 0; + Window_.FramesPerSecond = 0; + Context.SwapInterval(1); + } else { + Window_.UpdatesPerSecond = value; + Window_.FramesPerSecond = value; + Context.SwapInterval(0); + } + } + + /// + /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. + /// + public void Dispose() { + Window_.Dispose(); + } + + public void Exit() { + Window_.Close(); + } + + protected void ToggleWindowMode() { + /* + DeviceSettings settings = base.GraphicsDeviceManager.CurrentSettings.Clone(); + if ( ( ConfigIni != null ) && ( ConfigIni.bウィンドウモード != settings.Windowed ) ) + { + settings.Windowed = ConfigIni.bウィンドウモード; + if ( ConfigIni.bウィンドウモード == false ) // #23510 2010.10.27 yyagi: backup current window size before going fullscreen mode + { + currentClientSize = this.Window.ClientSize; + ConfigIni.nウインドウwidth = this.Window.ClientSize.Width; + ConfigIni.nウインドウheight = this.Window.ClientSize.Height; +// FDK.CTaskBar.ShowTaskBar( false ); + } + base.GraphicsDeviceManager.ChangeDevice( settings ); + if ( ConfigIni.bウィンドウモード == true ) // #23510 2010.10.27 yyagi: to resume window size from backuped value + { + base.Window.ClientSize = + new Size( currentClientSize.Width, currentClientSize.Height ); + base.Window.Icon = Properties.Resources.tjap3; +// FDK.CTaskBar.ShowTaskBar( true ); + } + } + */ + + FullScreen = !FullScreen; + } + + /// + /// Runs the game. + /// + public void Run() { + Window_.Run(); + } + + protected virtual void Configuration() { + + } + + protected virtual void Initialize() { + + } + + + protected virtual void LoadContent() { + + } + + protected virtual void UnloadContent() { + + } + + protected virtual void OnExiting() { + + } + + protected virtual void Update() { + + } + + protected virtual void Draw() { + + } + + /// + /// Releases unmanaged and - optionally - managed resources + /// + /// true to release both managed and unmanaged resources; false to release only unmanaged resources. + protected internal virtual void Dispose(bool disposing) { + + } + + + public void Window_Load() { + Window_.SetWindowIcon(new ReadOnlySpan(GetIconData(strIconFileName))); + + Context = new AngleContext(GraphicsDeviceType_, Window_); + Context.MakeCurrent(); + + Gl = GL.GetApi(Context); + //Gl = Window_.CreateOpenGLES(); + Gl.Enable(GLEnum.Blend); + BlendHelper.SetBlend(BlendType.Normal); + CTexture.Init(); + + Gl.ClearColor(0.0f, 0.0f, 0.0f, 1.0f); + + Gl.Viewport(0, 0, (uint)Window_.Size.X, (uint)Window_.Size.Y); + Context.SwapInterval(VSync ? 1 : 0); + + Initialize(); + LoadContent(); + } + + public void Window_Closing() { + CTexture.Terminate(); + + UnloadContent(); + OnExiting(); + + Context.Dispose(); + } + + public void Window_Update(double deltaTime) { + double fps = 1.0f / deltaTime; + TimeMs = (long)(Window_.Time * 1000); + + Update(); + + ImGuiController?.Update((float)deltaTime); + } + + public void Window_Render(double deltaTime) { + Camera = Matrix4X4.Identity; + + if (AsyncActions.Count > 0) { + AsyncActions[0]?.Invoke(); + AsyncActions.Remove(AsyncActions[0]); + } + Gl.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit); + + Draw(); + + double fps = 1.0f / deltaTime; + +#if DEBUG + ImGuiController?.Render(); +#endif + + Context.SwapBuffers(); + } + + public void Window_Resize(Vector2D size) { + if (size.X > 0 && size.Y > 0) { + float resolutionAspect = (float)GameWindowSize.Width / GameWindowSize.Height; + float windowAspect = (float)size.X / size.Y; + if (windowAspect > resolutionAspect) { + ViewPortSize.X = (int)(size.Y * resolutionAspect); + ViewPortSize.Y = size.Y; + } else { + ViewPortSize.X = size.X; + ViewPortSize.Y = (int)(size.X / resolutionAspect); + } + } + + ViewPortOffset.X = (size.X - ViewPortSize.X) / 2; + ViewPortOffset.Y = (size.Y - ViewPortSize.Y) / 2; + + + Gl.Viewport(ViewPortOffset.X, ViewPortOffset.Y, (uint)ViewPortSize.X, (uint)ViewPortSize.Y); + } + + public void Window_Move(Vector2D size) { } + + public void Window_FramebufferResize(Vector2D size) { } } diff --git a/FDK/src/01.Framework/Core/GameWindowSize.cs b/FDK/src/01.Framework/Core/GameWindowSize.cs index deae733a..619ccf8b 100644 --- a/FDK/src/01.Framework/Core/GameWindowSize.cs +++ b/FDK/src/01.Framework/Core/GameWindowSize.cs @@ -1,6 +1,6 @@ -namespace SampleFramework { - public static class GameWindowSize { - public static int Width = 1280; - public static int Height = 720; - } +namespace SampleFramework; + +public static class GameWindowSize { + public static int Width = 1280; + public static int Height = 720; } diff --git a/FDK/src/01.Framework/Rendering/Angle/Egl.cs b/FDK/src/01.Framework/Rendering/Angle/Egl.cs index cbe91664..4ab2cb88 100644 --- a/FDK/src/01.Framework/Rendering/Angle/Egl.cs +++ b/FDK/src/01.Framework/Rendering/Angle/Egl.cs @@ -30,376 +30,376 @@ using System.Runtime.InteropServices; #pragma warning disable 1591 // Missing XML comments -namespace OpenTK.Graphics.Egl { - using EGLClientBuffer = IntPtr; - using EGLConfig = IntPtr; - using EGLContext = IntPtr; - using EGLDisplay = IntPtr; - using EGLNativeDisplayType = IntPtr; - using EGLNativePixmapType = IntPtr; - using EGLNativeWindowType = IntPtr; - using EGLSurface = IntPtr; +namespace OpenTK.Graphics.Egl; - public enum RenderApi { - ES = Egl.OPENGL_ES_API, - GL = Egl.OPENGL_API, - VG = Egl.OPENVG_API - } +using EGLClientBuffer = IntPtr; +using EGLConfig = IntPtr; +using EGLContext = IntPtr; +using EGLDisplay = IntPtr; +using EGLNativeDisplayType = IntPtr; +using EGLNativePixmapType = IntPtr; +using EGLNativeWindowType = IntPtr; +using EGLSurface = IntPtr; - [Flags] - public enum RenderableFlags { - ES = Egl.OPENGL_ES_BIT, - ES2 = Egl.OPENGL_ES2_BIT, - ES3 = Egl.OPENGL_ES3_BIT, - GL = Egl.OPENGL_BIT, - VG = Egl.OPENVG_BIT, - } +public enum RenderApi { + ES = Egl.OPENGL_ES_API, + GL = Egl.OPENGL_API, + VG = Egl.OPENVG_API +} - public enum ErrorCode { - SUCCESS = 12288, - NOT_INITIALIZED = 12289, - BAD_ACCESS = 12290, - BAD_ALLOC = 12291, - BAD_ATTRIBUTE = 12292, - BAD_CONFIG = 12293, - BAD_CONTEXT = 12294, - BAD_CURRENT_SURFACE = 12295, - BAD_DISPLAY = 12296, - BAD_MATCH = 12297, - BAD_NATIVE_PIXMAP = 12298, - BAD_NATIVE_WINDOW = 12299, - BAD_PARAMETER = 12300, - BAD_SURFACE = 12301, - CONTEXT_LOST = 12302, - } +[Flags] +public enum RenderableFlags { + ES = Egl.OPENGL_ES_BIT, + ES2 = Egl.OPENGL_ES2_BIT, + ES3 = Egl.OPENGL_ES3_BIT, + GL = Egl.OPENGL_BIT, + VG = Egl.OPENVG_BIT, +} - public enum SurfaceType { - PBUFFER_BIT = 0x0001, - PIXMAP_BIT = 0x0002, - WINDOW_BIT = 0x0004, - VG_COLORSPACE_LINEAR_BIT = 0x0020, - VG_ALPHA_FORMAT_PRE_BIT = 0x0040, - MULTISAMPLE_RESOLVE_BOX_BIT = 0x0200, - SWAP_BEHAVIOR_PRESERVED_BIT = 0x0400, - } +public enum ErrorCode { + SUCCESS = 12288, + NOT_INITIALIZED = 12289, + BAD_ACCESS = 12290, + BAD_ALLOC = 12291, + BAD_ATTRIBUTE = 12292, + BAD_CONFIG = 12293, + BAD_CONTEXT = 12294, + BAD_CURRENT_SURFACE = 12295, + BAD_DISPLAY = 12296, + BAD_MATCH = 12297, + BAD_NATIVE_PIXMAP = 12298, + BAD_NATIVE_WINDOW = 12299, + BAD_PARAMETER = 12300, + BAD_SURFACE = 12301, + CONTEXT_LOST = 12302, +} - public class EglException : Exception { - public EglException() : base() { } +public enum SurfaceType { + PBUFFER_BIT = 0x0001, + PIXMAP_BIT = 0x0002, + WINDOW_BIT = 0x0004, + VG_COLORSPACE_LINEAR_BIT = 0x0020, + VG_ALPHA_FORMAT_PRE_BIT = 0x0040, + MULTISAMPLE_RESOLVE_BOX_BIT = 0x0200, + SWAP_BEHAVIOR_PRESERVED_BIT = 0x0400, +} - public EglException(string message) : base(message) { } - } +public class EglException : Exception { + public EglException() : base() { } - public static partial class Egl { - public const int CONTEXT_MAJOR_VERSION = 0x3098; - public const int CONTEXT_MINOR_VERSION = 0x30FB; + public EglException(string message) : base(message) { } +} - public const int VERSION_1_0 = 1; - public const int VERSION_1_1 = 1; - public const int VERSION_1_2 = 1; - public const int VERSION_1_3 = 1; - public const int VERSION_1_4 = 1; - public const int FALSE = 0; - public const int TRUE = 1; - public const int DONT_CARE = -1; - public const int CONTEXT_LOST = 12302; - public const int BUFFER_SIZE = 12320; - public const int ALPHA_SIZE = 12321; - public const int BLUE_SIZE = 12322; - public const int GREEN_SIZE = 12323; - public const int RED_SIZE = 12324; - public const int DEPTH_SIZE = 12325; - public const int STENCIL_SIZE = 12326; - public const int CONFIG_CAVEAT = 12327; - public const int CONFIG_ID = 12328; - public const int LEVEL = 12329; - public const int MAX_PBUFFER_HEIGHT = 12330; - public const int MAX_PBUFFER_PIXELS = 12331; - public const int MAX_PBUFFER_WIDTH = 12332; - public const int NATIVE_RENDERABLE = 12333; - public const int NATIVE_VISUAL_ID = 12334; - public const int NATIVE_VISUAL_TYPE = 12335; - public const int PRESERVED_RESOURCES = 12336; - public const int SAMPLES = 12337; - public const int SAMPLE_BUFFERS = 12338; - public const int SURFACE_TYPE = 12339; - public const int TRANSPARENT_TYPE = 12340; - public const int TRANSPARENT_BLUE_VALUE = 12341; - public const int TRANSPARENT_GREEN_VALUE = 12342; - public const int TRANSPARENT_RED_VALUE = 12343; - public const int NONE = 12344; - public const int BIND_TO_TEXTURE_RGB = 12345; - public const int BIND_TO_TEXTURE_RGBA = 12346; - public const int MIN_SWAP_INTERVAL = 12347; - public const int MAX_SWAP_INTERVAL = 12348; - public const int LUMINANCE_SIZE = 12349; - public const int ALPHA_MASK_SIZE = 12350; - public const int COLOR_BUFFER_TYPE = 12351; - public const int RENDERABLE_TYPE = 12352; - public const int MATCH_NATIVE_PIXMAP = 12353; - public const int CONFORMANT = 12354; - public const int SLOW_CONFIG = 12368; - public const int NON_CONFORMANT_CONFIG = 12369; - public const int TRANSPARENT_RGB = 12370; - public const int RGB_BUFFER = 12430; - public const int LUMINANCE_BUFFER = 12431; - public const int NO_TEXTURE = 12380; - public const int TEXTURE_RGB = 12381; - public const int TEXTURE_RGBA = 12382; - public const int TEXTURE_2D = 12383; - public const int PBUFFER_BIT = 1; - public const int PIXMAP_BIT = 2; - public const int WINDOW_BIT = 4; - public const int VG_COLORSPACE_LINEAR_BIT = 32; - public const int VG_ALPHA_FORMAT_PRE_BIT = 64; - public const int MULTISAMPLE_RESOLVE_BOX_BIT = 512; - public const int SWAP_BEHAVIOR_PRESERVED_BIT = 1024; - public const int OPENGL_ES_BIT = 1; - public const int OPENVG_BIT = 2; - public const int OPENGL_ES2_BIT = 4; - public const int OPENGL_BIT = 8; - public const int OPENGL_ES3_BIT = 64; - public const int VENDOR = 12371; - public const int VERSION = 12372; - public const int EXTENSIONS = 12373; - public const int CLIENT_APIS = 12429; - public const int HEIGHT = 12374; - public const int WIDTH = 12375; - public const int LARGEST_PBUFFER = 12376; - public const int TEXTURE_FORMAT = 12416; - public const int TEXTURE_TARGET = 12417; - public const int MIPMAP_TEXTURE = 12418; - public const int MIPMAP_LEVEL = 12419; - public const int RENDER_BUFFER = 12422; - public const int VG_COLORSPACE = 12423; - public const int VG_ALPHA_FORMAT = 12424; - public const int HORIZONTAL_RESOLUTION = 12432; - public const int VERTICAL_RESOLUTION = 12433; - public const int PIXEL_ASPECT_RATIO = 12434; - public const int SWAP_BEHAVIOR = 12435; - public const int MULTISAMPLE_RESOLVE = 12441; - public const int BACK_BUFFER = 12420; - public const int SINGLE_BUFFER = 12421; - public const int VG_COLORSPACE_sRGB = 12425; - public const int VG_COLORSPACE_LINEAR = 12426; - public const int VG_ALPHA_FORMAT_NONPRE = 12427; - public const int VG_ALPHA_FORMAT_PRE = 12428; - public const int DISPLAY_SCALING = 10000; - public const int UNKNOWN = -1; - public const int BUFFER_PRESERVED = 12436; - public const int BUFFER_DESTROYED = 12437; - public const int OPENVG_IMAGE = 12438; - public const int CONTEXT_CLIENT_TYPE = 12439; - public const int CONTEXT_CLIENT_VERSION = 12440; - public const int MULTISAMPLE_RESOLVE_DEFAULT = 12442; - public const int MULTISAMPLE_RESOLVE_BOX = 12443; - public const int OPENGL_ES_API = 12448; - public const int OPENVG_API = 12449; - public const int OPENGL_API = 12450; - public const int DRAW = 12377; - public const int READ = 12378; - public const int CORE_NATIVE_ENGINE = 12379; - public const int COLORSPACE = VG_COLORSPACE; - public const int ALPHA_FORMAT = VG_ALPHA_FORMAT; - public const int COLORSPACE_sRGB = VG_COLORSPACE_sRGB; - public const int COLORSPACE_LINEAR = VG_COLORSPACE_LINEAR; - public const int ALPHA_FORMAT_NONPRE = VG_ALPHA_FORMAT_NONPRE; - public const int ALPHA_FORMAT_PRE = VG_ALPHA_FORMAT_PRE; +public static partial class Egl { + public const int CONTEXT_MAJOR_VERSION = 0x3098; + public const int CONTEXT_MINOR_VERSION = 0x30FB; - // EGL_ANGLE_d3d_share_handle_client_buffer - public const int D3D_TEXTURE_2D_SHARE_HANDLE_ANGLE = 0x3200; - // EGL_ANGLE_window_fixed_size - public const int FIXED_SIZE_ANGLE = 0x3201; - // EGL_ANGLE_query_surface_pointer - [DllImport("libEGL", EntryPoint = "eglQuerySurfacePointerANGLE")] - public static extern bool QuerySurfacePointerANGLE(EGLDisplay display, EGLSurface surface, int attribute, out IntPtr value); + public const int VERSION_1_0 = 1; + public const int VERSION_1_1 = 1; + public const int VERSION_1_2 = 1; + public const int VERSION_1_3 = 1; + public const int VERSION_1_4 = 1; + public const int FALSE = 0; + public const int TRUE = 1; + public const int DONT_CARE = -1; + public const int CONTEXT_LOST = 12302; + public const int BUFFER_SIZE = 12320; + public const int ALPHA_SIZE = 12321; + public const int BLUE_SIZE = 12322; + public const int GREEN_SIZE = 12323; + public const int RED_SIZE = 12324; + public const int DEPTH_SIZE = 12325; + public const int STENCIL_SIZE = 12326; + public const int CONFIG_CAVEAT = 12327; + public const int CONFIG_ID = 12328; + public const int LEVEL = 12329; + public const int MAX_PBUFFER_HEIGHT = 12330; + public const int MAX_PBUFFER_PIXELS = 12331; + public const int MAX_PBUFFER_WIDTH = 12332; + public const int NATIVE_RENDERABLE = 12333; + public const int NATIVE_VISUAL_ID = 12334; + public const int NATIVE_VISUAL_TYPE = 12335; + public const int PRESERVED_RESOURCES = 12336; + public const int SAMPLES = 12337; + public const int SAMPLE_BUFFERS = 12338; + public const int SURFACE_TYPE = 12339; + public const int TRANSPARENT_TYPE = 12340; + public const int TRANSPARENT_BLUE_VALUE = 12341; + public const int TRANSPARENT_GREEN_VALUE = 12342; + public const int TRANSPARENT_RED_VALUE = 12343; + public const int NONE = 12344; + public const int BIND_TO_TEXTURE_RGB = 12345; + public const int BIND_TO_TEXTURE_RGBA = 12346; + public const int MIN_SWAP_INTERVAL = 12347; + public const int MAX_SWAP_INTERVAL = 12348; + public const int LUMINANCE_SIZE = 12349; + public const int ALPHA_MASK_SIZE = 12350; + public const int COLOR_BUFFER_TYPE = 12351; + public const int RENDERABLE_TYPE = 12352; + public const int MATCH_NATIVE_PIXMAP = 12353; + public const int CONFORMANT = 12354; + public const int SLOW_CONFIG = 12368; + public const int NON_CONFORMANT_CONFIG = 12369; + public const int TRANSPARENT_RGB = 12370; + public const int RGB_BUFFER = 12430; + public const int LUMINANCE_BUFFER = 12431; + public const int NO_TEXTURE = 12380; + public const int TEXTURE_RGB = 12381; + public const int TEXTURE_RGBA = 12382; + public const int TEXTURE_2D = 12383; + public const int PBUFFER_BIT = 1; + public const int PIXMAP_BIT = 2; + public const int WINDOW_BIT = 4; + public const int VG_COLORSPACE_LINEAR_BIT = 32; + public const int VG_ALPHA_FORMAT_PRE_BIT = 64; + public const int MULTISAMPLE_RESOLVE_BOX_BIT = 512; + public const int SWAP_BEHAVIOR_PRESERVED_BIT = 1024; + public const int OPENGL_ES_BIT = 1; + public const int OPENVG_BIT = 2; + public const int OPENGL_ES2_BIT = 4; + public const int OPENGL_BIT = 8; + public const int OPENGL_ES3_BIT = 64; + public const int VENDOR = 12371; + public const int VERSION = 12372; + public const int EXTENSIONS = 12373; + public const int CLIENT_APIS = 12429; + public const int HEIGHT = 12374; + public const int WIDTH = 12375; + public const int LARGEST_PBUFFER = 12376; + public const int TEXTURE_FORMAT = 12416; + public const int TEXTURE_TARGET = 12417; + public const int MIPMAP_TEXTURE = 12418; + public const int MIPMAP_LEVEL = 12419; + public const int RENDER_BUFFER = 12422; + public const int VG_COLORSPACE = 12423; + public const int VG_ALPHA_FORMAT = 12424; + public const int HORIZONTAL_RESOLUTION = 12432; + public const int VERTICAL_RESOLUTION = 12433; + public const int PIXEL_ASPECT_RATIO = 12434; + public const int SWAP_BEHAVIOR = 12435; + public const int MULTISAMPLE_RESOLVE = 12441; + public const int BACK_BUFFER = 12420; + public const int SINGLE_BUFFER = 12421; + public const int VG_COLORSPACE_sRGB = 12425; + public const int VG_COLORSPACE_LINEAR = 12426; + public const int VG_ALPHA_FORMAT_NONPRE = 12427; + public const int VG_ALPHA_FORMAT_PRE = 12428; + public const int DISPLAY_SCALING = 10000; + public const int UNKNOWN = -1; + public const int BUFFER_PRESERVED = 12436; + public const int BUFFER_DESTROYED = 12437; + public const int OPENVG_IMAGE = 12438; + public const int CONTEXT_CLIENT_TYPE = 12439; + public const int CONTEXT_CLIENT_VERSION = 12440; + public const int MULTISAMPLE_RESOLVE_DEFAULT = 12442; + public const int MULTISAMPLE_RESOLVE_BOX = 12443; + public const int OPENGL_ES_API = 12448; + public const int OPENVG_API = 12449; + public const int OPENGL_API = 12450; + public const int DRAW = 12377; + public const int READ = 12378; + public const int CORE_NATIVE_ENGINE = 12379; + public const int COLORSPACE = VG_COLORSPACE; + public const int ALPHA_FORMAT = VG_ALPHA_FORMAT; + public const int COLORSPACE_sRGB = VG_COLORSPACE_sRGB; + public const int COLORSPACE_LINEAR = VG_COLORSPACE_LINEAR; + public const int ALPHA_FORMAT_NONPRE = VG_ALPHA_FORMAT_NONPRE; + public const int ALPHA_FORMAT_PRE = VG_ALPHA_FORMAT_PRE; - [DllImport("libEGL", EntryPoint = "eglGetPlatformDisplayEXT")] - public static extern EGLDisplay GetPlatformDisplay(int platform, EGLNativeDisplayType displayId, int[] attribList); + // EGL_ANGLE_d3d_share_handle_client_buffer + public const int D3D_TEXTURE_2D_SHARE_HANDLE_ANGLE = 0x3200; + // EGL_ANGLE_window_fixed_size + public const int FIXED_SIZE_ANGLE = 0x3201; + // EGL_ANGLE_query_surface_pointer + [DllImport("libEGL", EntryPoint = "eglQuerySurfacePointerANGLE")] + public static extern bool QuerySurfacePointerANGLE(EGLDisplay display, EGLSurface surface, int attribute, out IntPtr value); - // EGL_ANGLE_software_display - public static readonly EGLNativeDisplayType SOFTWARE_DISPLAY_ANGLE = new EGLNativeDisplayType(-1); - // EGL_ANGLE_direct3d_display - public static readonly EGLNativeDisplayType D3D11_ELSE_D3D9_DISPLAY_ANGLE = new EGLNativeDisplayType(-2); - public static readonly EGLNativeDisplayType D3D11_ONLY_DISPLAY_ANGLE = new EGLNativeDisplayType(-3); - // EGL_ANGLE_device_d3d - public const int D3D9_DEVICE_ANGLE = 0x33A0; - public const int D3D11_DEVICE_ANGLE = 0x33A1; - // EGL_ANGLE_platform_angle - public const int PLATFORM_ANGLE_ANGLE = 0x3202; - public const int PLATFORM_ANGLE_TYPE_ANGLE = 0x3203; - public const int PLATFORM_ANGLE_MAX_VERSION_MAJOR_ANGLE = 0x3204; - public const int PLATFORM_ANGLE_MAX_VERSION_MINOR_ANGLE = 0x3205; - public const int PLATFORM_ANGLE_TYPE_DEFAULT_ANGLE = 0x3206; - // EGL_ANGLE_platform_angle_d3d - public const int PLATFORM_ANGLE_TYPE_D3D9_ANGLE = 0x3207; - public const int PLATFORM_ANGLE_TYPE_D3D11_ANGLE = 0x3208; - public const int PLATFORM_ANGLE_TYPE_VULKAN_ANGLE = 0x3450; - public const int PLATFORM_ANGLE_TYPE_METAL_ANGLE = 0x3489; - public const int PLATFORM_ANGLE_DEVICE_TYPE_ANGLE = 0x3209; - public const int PLATFORM_ANGLE_DEVICE_TYPE_HARDWARE_ANGLE = 0x320A; - public const int PLATFORM_ANGLE_DEVICE_TYPE_WARP_ANGLE = 0x320B; - public const int PLATFORM_ANGLE_DEVICE_TYPE_REFERENCE_ANGLE = 0x320C; - public const int PLATFORM_ANGLE_ENABLE_AUTOMATIC_TRIM_ANGLE = 0x320F; - // EGL_ANGLE_platform_angle_opengl - public const int PLATFORM_ANGLE_TYPE_OPENGL_ANGLE = 0x320D; - public const int PLATFORM_ANGLE_TYPE_OPENGLES_ANGLE = 0x320E; - // See EGL_ANGLE_surface_d3d_texture_2d_share_handle - public const int EGL_D3D_TEXTURE_2D_SHARE_HANDLE_ANGLE = 0x3200; + [DllImport("libEGL", EntryPoint = "eglGetPlatformDisplayEXT")] + public static extern EGLDisplay GetPlatformDisplay(int platform, EGLNativeDisplayType displayId, int[] attribList); - [DllImportAttribute("libEGL", EntryPoint = "eglGetError")] - public static extern ErrorCode GetError(); + // EGL_ANGLE_software_display + public static readonly EGLNativeDisplayType SOFTWARE_DISPLAY_ANGLE = new EGLNativeDisplayType(-1); + // EGL_ANGLE_direct3d_display + public static readonly EGLNativeDisplayType D3D11_ELSE_D3D9_DISPLAY_ANGLE = new EGLNativeDisplayType(-2); + public static readonly EGLNativeDisplayType D3D11_ONLY_DISPLAY_ANGLE = new EGLNativeDisplayType(-3); + // EGL_ANGLE_device_d3d + public const int D3D9_DEVICE_ANGLE = 0x33A0; + public const int D3D11_DEVICE_ANGLE = 0x33A1; + // EGL_ANGLE_platform_angle + public const int PLATFORM_ANGLE_ANGLE = 0x3202; + public const int PLATFORM_ANGLE_TYPE_ANGLE = 0x3203; + public const int PLATFORM_ANGLE_MAX_VERSION_MAJOR_ANGLE = 0x3204; + public const int PLATFORM_ANGLE_MAX_VERSION_MINOR_ANGLE = 0x3205; + public const int PLATFORM_ANGLE_TYPE_DEFAULT_ANGLE = 0x3206; + // EGL_ANGLE_platform_angle_d3d + public const int PLATFORM_ANGLE_TYPE_D3D9_ANGLE = 0x3207; + public const int PLATFORM_ANGLE_TYPE_D3D11_ANGLE = 0x3208; + public const int PLATFORM_ANGLE_TYPE_VULKAN_ANGLE = 0x3450; + public const int PLATFORM_ANGLE_TYPE_METAL_ANGLE = 0x3489; + public const int PLATFORM_ANGLE_DEVICE_TYPE_ANGLE = 0x3209; + public const int PLATFORM_ANGLE_DEVICE_TYPE_HARDWARE_ANGLE = 0x320A; + public const int PLATFORM_ANGLE_DEVICE_TYPE_WARP_ANGLE = 0x320B; + public const int PLATFORM_ANGLE_DEVICE_TYPE_REFERENCE_ANGLE = 0x320C; + public const int PLATFORM_ANGLE_ENABLE_AUTOMATIC_TRIM_ANGLE = 0x320F; + // EGL_ANGLE_platform_angle_opengl + public const int PLATFORM_ANGLE_TYPE_OPENGL_ANGLE = 0x320D; + public const int PLATFORM_ANGLE_TYPE_OPENGLES_ANGLE = 0x320E; + // See EGL_ANGLE_surface_d3d_texture_2d_share_handle + public const int EGL_D3D_TEXTURE_2D_SHARE_HANDLE_ANGLE = 0x3200; - [DllImportAttribute("libEGL", EntryPoint = "eglGetDisplay")] - public static extern EGLDisplay GetDisplay(EGLNativeDisplayType display_id); + [DllImportAttribute("libEGL", EntryPoint = "eglGetError")] + public static extern ErrorCode GetError(); - [DllImportAttribute("libEGL", EntryPoint = "eglInitialize")] - //[return: MarshalAs(UnmanagedType.I1)] - public static extern bool Initialize(EGLDisplay dpy, out int major, out int minor); + [DllImportAttribute("libEGL", EntryPoint = "eglGetDisplay")] + public static extern EGLDisplay GetDisplay(EGLNativeDisplayType display_id); - [DllImportAttribute("libEGL", EntryPoint = "eglTerminate")] - //[return: MarshalAs(UnmanagedType.I1)] - public static extern bool Terminate(EGLDisplay dpy); + [DllImportAttribute("libEGL", EntryPoint = "eglInitialize")] + //[return: MarshalAs(UnmanagedType.I1)] + public static extern bool Initialize(EGLDisplay dpy, out int major, out int minor); - [DllImportAttribute("libEGL", EntryPoint = "eglQueryString")] - public static extern IntPtr QueryString(EGLDisplay dpy, int name); + [DllImportAttribute("libEGL", EntryPoint = "eglTerminate")] + //[return: MarshalAs(UnmanagedType.I1)] + public static extern bool Terminate(EGLDisplay dpy); - [DllImportAttribute("libEGL", EntryPoint = "eglGetConfigs")] - [return: MarshalAs(UnmanagedType.I1)] - public static extern bool GetConfigs(EGLDisplay dpy, EGLConfig[] configs, int config_size, out int num_config); + [DllImportAttribute("libEGL", EntryPoint = "eglQueryString")] + public static extern IntPtr QueryString(EGLDisplay dpy, int name); - [DllImportAttribute("libEGL", EntryPoint = "eglChooseConfig")] - [return: MarshalAs(UnmanagedType.I1)] - public static extern bool ChooseConfig(EGLDisplay dpy, int[] attrib_list, [In, Out] EGLConfig[] configs, int config_size, out int num_config); + [DllImportAttribute("libEGL", EntryPoint = "eglGetConfigs")] + [return: MarshalAs(UnmanagedType.I1)] + public static extern bool GetConfigs(EGLDisplay dpy, EGLConfig[] configs, int config_size, out int num_config); - [DllImportAttribute("libEGL", EntryPoint = "eglChooseConfig")] - [return: MarshalAs(UnmanagedType.I1)] - public unsafe static extern bool ChooseConfig(EGLDisplay dpy, int[] attrib_list, EGLConfig* configs, int config_size, out int num_config); + [DllImportAttribute("libEGL", EntryPoint = "eglChooseConfig")] + [return: MarshalAs(UnmanagedType.I1)] + public static extern bool ChooseConfig(EGLDisplay dpy, int[] attrib_list, [In, Out] EGLConfig[] configs, int config_size, out int num_config); - [DllImportAttribute("libEGL", EntryPoint = "eglGetConfigAttrib")] - [return: MarshalAs(UnmanagedType.I1)] - public static extern bool GetConfigAttrib(EGLDisplay dpy, EGLConfig config, int attribute, out int value); + [DllImportAttribute("libEGL", EntryPoint = "eglChooseConfig")] + [return: MarshalAs(UnmanagedType.I1)] + public unsafe static extern bool ChooseConfig(EGLDisplay dpy, int[] attrib_list, EGLConfig* configs, int config_size, out int num_config); - [DllImportAttribute("libEGL", EntryPoint = "eglCreateWindowSurface")] - public static extern EGLSurface CreateWindowSurface(EGLDisplay dpy, EGLConfig config, IntPtr win, IntPtr attrib_list); + [DllImportAttribute("libEGL", EntryPoint = "eglGetConfigAttrib")] + [return: MarshalAs(UnmanagedType.I1)] + public static extern bool GetConfigAttrib(EGLDisplay dpy, EGLConfig config, int attribute, out int value); - [DllImportAttribute("libEGL", EntryPoint = "eglCreatePbufferSurface")] - public static extern EGLSurface CreatePbufferSurface(EGLDisplay dpy, EGLConfig config, int[] attrib_list); + [DllImportAttribute("libEGL", EntryPoint = "eglCreateWindowSurface")] + public static extern EGLSurface CreateWindowSurface(EGLDisplay dpy, EGLConfig config, IntPtr win, IntPtr attrib_list); - [DllImportAttribute("libEGL", EntryPoint = "eglCreatePixmapSurface")] - public static extern EGLSurface CreatePixmapSurface(EGLDisplay dpy, EGLConfig config, EGLNativePixmapType pixmap, int[] attrib_list); + [DllImportAttribute("libEGL", EntryPoint = "eglCreatePbufferSurface")] + public static extern EGLSurface CreatePbufferSurface(EGLDisplay dpy, EGLConfig config, int[] attrib_list); - [DllImportAttribute("libEGL", EntryPoint = "eglDestroySurface")] - [return: MarshalAs(UnmanagedType.I1)] - public static extern bool DestroySurface(EGLDisplay dpy, EGLSurface surface); + [DllImportAttribute("libEGL", EntryPoint = "eglCreatePixmapSurface")] + public static extern EGLSurface CreatePixmapSurface(EGLDisplay dpy, EGLConfig config, EGLNativePixmapType pixmap, int[] attrib_list); - [DllImportAttribute("libEGL", EntryPoint = "eglQuerySurface")] - [return: MarshalAs(UnmanagedType.I1)] - public static extern bool QuerySurface(EGLDisplay dpy, EGLSurface surface, int attribute, out int value); + [DllImportAttribute("libEGL", EntryPoint = "eglDestroySurface")] + [return: MarshalAs(UnmanagedType.I1)] + public static extern bool DestroySurface(EGLDisplay dpy, EGLSurface surface); - [DllImportAttribute("libEGL", EntryPoint = "eglBindAPI")] - [return: MarshalAs(UnmanagedType.I1)] - public static extern bool BindAPI(RenderApi api); + [DllImportAttribute("libEGL", EntryPoint = "eglQuerySurface")] + [return: MarshalAs(UnmanagedType.I1)] + public static extern bool QuerySurface(EGLDisplay dpy, EGLSurface surface, int attribute, out int value); - [DllImportAttribute("libEGL", EntryPoint = "eglQueryAPI")] - public static extern int QueryAPI(); + [DllImportAttribute("libEGL", EntryPoint = "eglBindAPI")] + [return: MarshalAs(UnmanagedType.I1)] + public static extern bool BindAPI(RenderApi api); - [DllImportAttribute("libEGL", EntryPoint = "eglWaitClient")] - [return: MarshalAs(UnmanagedType.I1)] - public static extern bool WaitClient(); + [DllImportAttribute("libEGL", EntryPoint = "eglQueryAPI")] + public static extern int QueryAPI(); - [DllImportAttribute("libEGL", EntryPoint = "eglReleaseThread")] - [return: MarshalAs(UnmanagedType.I1)] - public static extern bool ReleaseThread(); + [DllImportAttribute("libEGL", EntryPoint = "eglWaitClient")] + [return: MarshalAs(UnmanagedType.I1)] + public static extern bool WaitClient(); - [DllImportAttribute("libEGL", EntryPoint = "eglCreatePbufferFromClientBuffer")] - public static extern EGLSurface CreatePbufferFromClientBuffer(EGLDisplay dpy, int buftype, EGLClientBuffer buffer, EGLConfig config, int[] attrib_list); + [DllImportAttribute("libEGL", EntryPoint = "eglReleaseThread")] + [return: MarshalAs(UnmanagedType.I1)] + public static extern bool ReleaseThread(); - [DllImportAttribute("libEGL", EntryPoint = "eglSurfaceAttrib")] - [return: MarshalAs(UnmanagedType.I1)] - public static extern bool SurfaceAttrib(EGLDisplay dpy, EGLSurface surface, int attribute, int value); + [DllImportAttribute("libEGL", EntryPoint = "eglCreatePbufferFromClientBuffer")] + public static extern EGLSurface CreatePbufferFromClientBuffer(EGLDisplay dpy, int buftype, EGLClientBuffer buffer, EGLConfig config, int[] attrib_list); - [DllImportAttribute("libEGL", EntryPoint = "eglBindTexImage")] - [return: MarshalAs(UnmanagedType.I1)] - public static extern bool BindTexImage(EGLDisplay dpy, EGLSurface surface, int buffer); + [DllImportAttribute("libEGL", EntryPoint = "eglSurfaceAttrib")] + [return: MarshalAs(UnmanagedType.I1)] + public static extern bool SurfaceAttrib(EGLDisplay dpy, EGLSurface surface, int attribute, int value); - [DllImportAttribute("libEGL", EntryPoint = "eglReleaseTexImage")] - [return: MarshalAs(UnmanagedType.I1)] - public static extern bool ReleaseTexImage(EGLDisplay dpy, EGLSurface surface, int buffer); + [DllImportAttribute("libEGL", EntryPoint = "eglBindTexImage")] + [return: MarshalAs(UnmanagedType.I1)] + public static extern bool BindTexImage(EGLDisplay dpy, EGLSurface surface, int buffer); - [DllImportAttribute("libEGL", EntryPoint = "eglSwapInterval")] - [return: MarshalAs(UnmanagedType.I1)] - public static extern bool SwapInterval(EGLDisplay dpy, int interval); + [DllImportAttribute("libEGL", EntryPoint = "eglReleaseTexImage")] + [return: MarshalAs(UnmanagedType.I1)] + public static extern bool ReleaseTexImage(EGLDisplay dpy, EGLSurface surface, int buffer); - [DllImportAttribute("libEGL", EntryPoint = "eglCreateContext")] - private static extern IntPtr eglCreateContext(EGLDisplay dpy, EGLConfig config, EGLContext share_context, int[] attrib_list); + [DllImportAttribute("libEGL", EntryPoint = "eglSwapInterval")] + [return: MarshalAs(UnmanagedType.I1)] + public static extern bool SwapInterval(EGLDisplay dpy, int interval); - public static EGLContext CreateContext(EGLDisplay dpy, EGLConfig config, EGLContext share_context, int[] attrib_list) { - IntPtr ptr = eglCreateContext(dpy, config, share_context, attrib_list); - if (ptr == IntPtr.Zero) { - throw new EglException(string.Format("Failed to create EGL context, error: {0}.", Egl.GetError())); - } - return ptr; + [DllImportAttribute("libEGL", EntryPoint = "eglCreateContext")] + private static extern IntPtr eglCreateContext(EGLDisplay dpy, EGLConfig config, EGLContext share_context, int[] attrib_list); + + public static EGLContext CreateContext(EGLDisplay dpy, EGLConfig config, EGLContext share_context, int[] attrib_list) { + IntPtr ptr = eglCreateContext(dpy, config, share_context, attrib_list); + if (ptr == IntPtr.Zero) { + throw new EglException(string.Format("Failed to create EGL context, error: {0}.", Egl.GetError())); } + return ptr; + } - [DllImportAttribute("libEGL", EntryPoint = "eglDestroyContext")] - [return: MarshalAs(UnmanagedType.I1)] - public static extern bool DestroyContext(EGLDisplay dpy, EGLContext ctx); + [DllImportAttribute("libEGL", EntryPoint = "eglDestroyContext")] + [return: MarshalAs(UnmanagedType.I1)] + public static extern bool DestroyContext(EGLDisplay dpy, EGLContext ctx); - [DllImportAttribute("libEGL", EntryPoint = "eglMakeCurrent")] - [return: MarshalAs(UnmanagedType.I1)] - public static extern bool MakeCurrent(EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx); + [DllImportAttribute("libEGL", EntryPoint = "eglMakeCurrent")] + [return: MarshalAs(UnmanagedType.I1)] + public static extern bool MakeCurrent(EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx); - [DllImportAttribute("libEGL", EntryPoint = "eglGetCurrentContext")] - public static extern EGLContext GetCurrentContext(); + [DllImportAttribute("libEGL", EntryPoint = "eglGetCurrentContext")] + public static extern EGLContext GetCurrentContext(); - [DllImportAttribute("libEGL", EntryPoint = "eglGetCurrentSurface")] - public static extern EGLSurface GetCurrentSurface(int readdraw); + [DllImportAttribute("libEGL", EntryPoint = "eglGetCurrentSurface")] + public static extern EGLSurface GetCurrentSurface(int readdraw); - [DllImportAttribute("libEGL", EntryPoint = "eglGetCurrentDisplay")] - public static extern EGLDisplay GetCurrentDisplay(); + [DllImportAttribute("libEGL", EntryPoint = "eglGetCurrentDisplay")] + public static extern EGLDisplay GetCurrentDisplay(); - [DllImportAttribute("libEGL", EntryPoint = "eglQueryContext")] - [return: MarshalAs(UnmanagedType.I1)] - public static extern bool QueryContext(EGLDisplay dpy, EGLContext ctx, int attribute, out int value); + [DllImportAttribute("libEGL", EntryPoint = "eglQueryContext")] + [return: MarshalAs(UnmanagedType.I1)] + public static extern bool QueryContext(EGLDisplay dpy, EGLContext ctx, int attribute, out int value); - [DllImportAttribute("libEGL", EntryPoint = "eglWaitGL")] - [return: MarshalAs(UnmanagedType.I1)] - public static extern bool WaitGL(); + [DllImportAttribute("libEGL", EntryPoint = "eglWaitGL")] + [return: MarshalAs(UnmanagedType.I1)] + public static extern bool WaitGL(); - [DllImportAttribute("libEGL", EntryPoint = "eglWaitNative")] - [return: MarshalAs(UnmanagedType.I1)] - public static extern bool WaitNative(int engine); + [DllImportAttribute("libEGL", EntryPoint = "eglWaitNative")] + [return: MarshalAs(UnmanagedType.I1)] + public static extern bool WaitNative(int engine); - [DllImportAttribute("libEGL", EntryPoint = "eglSwapBuffers")] - [return: MarshalAs(UnmanagedType.I1)] - public static extern bool SwapBuffers(EGLDisplay dpy, EGLSurface surface); + [DllImportAttribute("libEGL", EntryPoint = "eglSwapBuffers")] + [return: MarshalAs(UnmanagedType.I1)] + public static extern bool SwapBuffers(EGLDisplay dpy, EGLSurface surface); - [DllImportAttribute("libEGL", EntryPoint = "eglCopyBuffers")] - [return: MarshalAs(UnmanagedType.I1)] - public static extern bool CopyBuffers(EGLDisplay dpy, EGLSurface surface, EGLNativePixmapType target); + [DllImportAttribute("libEGL", EntryPoint = "eglCopyBuffers")] + [return: MarshalAs(UnmanagedType.I1)] + public static extern bool CopyBuffers(EGLDisplay dpy, EGLSurface surface, EGLNativePixmapType target); - [DllImportAttribute("libEGL", EntryPoint = "eglGetProcAddress")] - public static extern IntPtr GetProcAddress(string funcname); + [DllImportAttribute("libEGL", EntryPoint = "eglGetProcAddress")] + public static extern IntPtr GetProcAddress(string funcname); - [DllImportAttribute("libEGL", EntryPoint = "eglGetProcAddress")] - public static extern IntPtr GetProcAddress(IntPtr funcname); + [DllImportAttribute("libEGL", EntryPoint = "eglGetProcAddress")] + public static extern IntPtr GetProcAddress(IntPtr funcname); - // EGL_EXT_platform_base - [DllImport("libEGL", EntryPoint = "eglGetPlatformDisplayEXT")] - public static extern EGLDisplay GetPlatformDisplayEXT(int platform, EGLNativeDisplayType native_display, int[] attrib_list); + // EGL_EXT_platform_base + [DllImport("libEGL", EntryPoint = "eglGetPlatformDisplayEXT")] + public static extern EGLDisplay GetPlatformDisplayEXT(int platform, EGLNativeDisplayType native_display, int[] attrib_list); - [DllImport("libEGL", EntryPoint = "eglCreatePlatformWindowSurfaceEXT")] - public static extern EGLSurface CreatePlatformWindowSurfaceEXT(EGLDisplay dpy, EGLConfig config, EGLNativeWindowType native_window, int[] attrib_list); + [DllImport("libEGL", EntryPoint = "eglCreatePlatformWindowSurfaceEXT")] + public static extern EGLSurface CreatePlatformWindowSurfaceEXT(EGLDisplay dpy, EGLConfig config, EGLNativeWindowType native_window, int[] attrib_list); - [DllImport("libEGL", EntryPoint = "eglCreatePlatformPixmapSurfaceEXT")] - public static extern EGLSurface CreatePlatformPixmapSurfaceEXT(EGLDisplay dpy, EGLConfig config, EGLNativePixmapType native_pixmap, int[] attrib_list); + [DllImport("libEGL", EntryPoint = "eglCreatePlatformPixmapSurfaceEXT")] + public static extern EGLSurface CreatePlatformPixmapSurfaceEXT(EGLDisplay dpy, EGLConfig config, EGLNativePixmapType native_pixmap, int[] attrib_list); - // Returns true if Egl drivers exist on the system. - public static bool IsSupported { - get { - try { GetCurrentContext(); } catch (Exception) { return false; } - return true; - } + // Returns true if Egl drivers exist on the system. + public static bool IsSupported { + get { + try { GetCurrentContext(); } catch (Exception) { return false; } + return true; } } } diff --git a/FDK/src/02.Input/CInputGamepad.cs b/FDK/src/02.Input/CInputGamepad.cs index 94857464..1253ed85 100644 --- a/FDK/src/02.Input/CInputGamepad.cs +++ b/FDK/src/02.Input/CInputGamepad.cs @@ -1,146 +1,146 @@ using Silk.NET.Input; -namespace FDK { - public class CInputGamepad : IInputDevice, IDisposable { - // Constructor +namespace FDK; - private IGamepad Gamepad { get; set; } +public class CInputGamepad : IInputDevice, IDisposable { + // Constructor - public CInputGamepad(IGamepad gamepad) { - this.Gamepad = gamepad; - this.CurrentType = InputDeviceType.Gamepad; - this.GUID = gamepad.Index.ToString(); - this.ID = gamepad.Index; - this.Name = gamepad.Name; + private IGamepad Gamepad { get; set; } - this.InputEvents = new List(32); + public CInputGamepad(IGamepad gamepad) { + this.Gamepad = gamepad; + this.CurrentType = InputDeviceType.Gamepad; + this.GUID = gamepad.Index.ToString(); + this.ID = gamepad.Index; + this.Name = gamepad.Name; - gamepad.ButtonDown += Joystick_ButtonDown; - gamepad.ButtonUp += Joystick_ButtonUp; - } + this.InputEvents = new List(32); - - // メソッド - - public void SetID(int nID) { - this.ID = nID; - } - - #region [ IInputDevice 実装 ] - //----------------- - public InputDeviceType CurrentType { - get; - private set; - } - public string GUID { - get; - private set; - } - public int ID { - get; - private set; - } - public string Name { - get; - private set; - } - public List InputEvents { - get; - private set; - } - public string strDeviceName { - get; - set; - } - - public void Polling(bool useBufferInput) { - InputEvents.Clear(); - - for (int i = 0; i < ButtonStates.Length; i++) { - if (ButtonStates[i].Item1) { - if (ButtonStates[i].Item2 >= 1) { - ButtonStates[i].Item2 = 2; - } else { - ButtonStates[i].Item2 = 1; - - InputEvents.Add( - new STInputEvent() { - nKey = i, - Pressed = true, - Released = false, - nTimeStamp = SampleFramework.Game.TimeMs, - nVelocity = 0, - } - ); - } - } else { - if (ButtonStates[i].Item2 <= -1) { - ButtonStates[i].Item2 = -2; - } else { - ButtonStates[i].Item2 = -1; - - InputEvents.Add( - new STInputEvent() { - nKey = i, - Pressed = false, - Released = true, - nTimeStamp = SampleFramework.Game.TimeMs, - nVelocity = 0, - } - ); - } - } - } - } - - public bool KeyPressed(int nButton) { - return ButtonStates[nButton].Item2 == 1; - } - public bool KeyPressing(int nButton) { - return ButtonStates[nButton].Item2 >= 1; - } - public bool KeyReleased(int nButton) { - return ButtonStates[nButton].Item2 == -1; - } - public bool KeyReleasing(int nButton) { - return ButtonStates[nButton].Item2 <= -1; - } - //----------------- - #endregion - - #region [ IDisposable 実装 ] - //----------------- - public void Dispose() { - if (!this.IsDisposed) { - if (this.InputEvents != null) { - this.InputEvents = null; - } - this.IsDisposed = true; - } - } - //----------------- - #endregion - - - // その他 - - #region [ private ] - //----------------- - public (bool, int)[] ButtonStates { get; private set; } = new (bool, int)[15]; - private bool IsDisposed; - - private void Joystick_ButtonDown(IGamepad joystick, Button button) { - if (button.Name != ButtonName.Unknown) { - ButtonStates[(int)button.Name].Item1 = true; - } - } - - private void Joystick_ButtonUp(IGamepad joystick, Button button) { - if (button.Name != ButtonName.Unknown) { - ButtonStates[(int)button.Name].Item1 = false; - } - } - //----------------- - #endregion + gamepad.ButtonDown += Joystick_ButtonDown; + gamepad.ButtonUp += Joystick_ButtonUp; } + + + // メソッド + + public void SetID(int nID) { + this.ID = nID; + } + + #region [ IInputDevice 実装 ] + //----------------- + public InputDeviceType CurrentType { + get; + private set; + } + public string GUID { + get; + private set; + } + public int ID { + get; + private set; + } + public string Name { + get; + private set; + } + public List InputEvents { + get; + private set; + } + public string strDeviceName { + get; + set; + } + + public void Polling(bool useBufferInput) { + InputEvents.Clear(); + + for (int i = 0; i < ButtonStates.Length; i++) { + if (ButtonStates[i].Item1) { + if (ButtonStates[i].Item2 >= 1) { + ButtonStates[i].Item2 = 2; + } else { + ButtonStates[i].Item2 = 1; + + InputEvents.Add( + new STInputEvent() { + nKey = i, + Pressed = true, + Released = false, + nTimeStamp = SampleFramework.Game.TimeMs, + nVelocity = 0, + } + ); + } + } else { + if (ButtonStates[i].Item2 <= -1) { + ButtonStates[i].Item2 = -2; + } else { + ButtonStates[i].Item2 = -1; + + InputEvents.Add( + new STInputEvent() { + nKey = i, + Pressed = false, + Released = true, + nTimeStamp = SampleFramework.Game.TimeMs, + nVelocity = 0, + } + ); + } + } + } + } + + public bool KeyPressed(int nButton) { + return ButtonStates[nButton].Item2 == 1; + } + public bool KeyPressing(int nButton) { + return ButtonStates[nButton].Item2 >= 1; + } + public bool KeyReleased(int nButton) { + return ButtonStates[nButton].Item2 == -1; + } + public bool KeyReleasing(int nButton) { + return ButtonStates[nButton].Item2 <= -1; + } + //----------------- + #endregion + + #region [ IDisposable 実装 ] + //----------------- + public void Dispose() { + if (!this.IsDisposed) { + if (this.InputEvents != null) { + this.InputEvents = null; + } + this.IsDisposed = true; + } + } + //----------------- + #endregion + + + // その他 + + #region [ private ] + //----------------- + public (bool, int)[] ButtonStates { get; private set; } = new (bool, int)[15]; + private bool IsDisposed; + + private void Joystick_ButtonDown(IGamepad joystick, Button button) { + if (button.Name != ButtonName.Unknown) { + ButtonStates[(int)button.Name].Item1 = true; + } + } + + private void Joystick_ButtonUp(IGamepad joystick, Button button) { + if (button.Name != ButtonName.Unknown) { + ButtonStates[(int)button.Name].Item1 = false; + } + } + //----------------- + #endregion } diff --git a/FDK/src/02.Input/CInputJoystick.cs b/FDK/src/02.Input/CInputJoystick.cs index 18699bdc..9f5c201b 100644 --- a/FDK/src/02.Input/CInputJoystick.cs +++ b/FDK/src/02.Input/CInputJoystick.cs @@ -1,154 +1,154 @@ using Silk.NET.Input; -namespace FDK { - public class CInputJoystick : IInputDevice, IDisposable { - // Constructor +namespace FDK; - public IJoystick Joystick { get; private set; } +public class CInputJoystick : IInputDevice, IDisposable { + // Constructor - public CInputJoystick(IJoystick joystick) { - this.Joystick = joystick; - this.CurrentType = InputDeviceType.Joystick; - this.GUID = joystick.Index.ToString(); - this.ID = joystick.Index; - this.Name = joystick.Name; + public IJoystick Joystick { get; private set; } - this.InputEvents = new List(32); + public CInputJoystick(IJoystick joystick) { + this.Joystick = joystick; + this.CurrentType = InputDeviceType.Joystick; + this.GUID = joystick.Index.ToString(); + this.ID = joystick.Index; + this.Name = joystick.Name; - joystick.ButtonDown += Joystick_ButtonDown; - joystick.ButtonUp += Joystick_ButtonUp; - } + this.InputEvents = new List(32); - - // メソッド - - public void SetID(int nID) { - this.ID = nID; - } - - #region [ IInputDevice 実装 ] - //----------------- - public InputDeviceType CurrentType { - get; - private set; - } - public string GUID { - get; - private set; - } - public int ID { - get; - private set; - } - public string Name { - get; - private set; - } - public List InputEvents { - get; - private set; - } - public string strDeviceName { - get; - set; - } - - public void Polling(bool useBufferInput) { - InputEvents.Clear(); - - // BUG: In Silk.NET, GLFW input does not fire events, so we have to poll - // them instead. - // https://github.com/dotnet/Silk.NET/issues/1889 - foreach (var button in Joystick.Buttons) { - // also, in GLFW the buttons don't have names, so the indices are the names - ButtonStates[button.Index].Item1 = button.Pressed; - } - - for (int i = 0; i < ButtonStates.Length; i++) { - if (ButtonStates[i].Item1) { - if (ButtonStates[i].Item2 >= 1) { - ButtonStates[i].Item2 = 2; - } else { - ButtonStates[i].Item2 = 1; - - InputEvents.Add( - new STInputEvent() { - nKey = i, - Pressed = true, - Released = false, - nTimeStamp = SampleFramework.Game.TimeMs, - nVelocity = 0, - } - ); - } - } else { - if (ButtonStates[i].Item2 <= -1) { - ButtonStates[i].Item2 = -2; - } else { - ButtonStates[i].Item2 = -1; - - InputEvents.Add( - new STInputEvent() { - nKey = i, - Pressed = false, - Released = true, - nTimeStamp = SampleFramework.Game.TimeMs, - nVelocity = 0, - } - ); - } - } - } - } - - public bool KeyPressed(int nButton) { - return ButtonStates[nButton].Item2 == 1; - } - public bool KeyPressing(int nButton) { - return ButtonStates[nButton].Item2 >= 1; - } - public bool KeyReleased(int nButton) { - return ButtonStates[nButton].Item2 == -1; - } - public bool KeyReleasing(int nButton) { - return ButtonStates[nButton].Item2 <= -1; - } - //----------------- - #endregion - - #region [ IDisposable 実装 ] - //----------------- - public void Dispose() { - if (!this.IsDisposed) { - if (this.InputEvents != null) { - this.InputEvents = null; - } - this.IsDisposed = true; - } - } - //----------------- - #endregion - - - // その他 - - #region [ private ] - //----------------- - public (bool, int)[] ButtonStates { get; private set; } = new (bool, int)[18]; - private bool IsDisposed; - - private void Joystick_ButtonDown(IJoystick joystick, Button button) { - if (button.Name != ButtonName.Unknown) { - ButtonStates[(int)button.Name].Item1 = true; - } - } - - private void Joystick_ButtonUp(IJoystick joystick, Button button) { - if (button.Name != ButtonName.Unknown) { - ButtonStates[(int)button.Name].Item1 = false; - } - } - //----------------- - #endregion + joystick.ButtonDown += Joystick_ButtonDown; + joystick.ButtonUp += Joystick_ButtonUp; } + + + // メソッド + + public void SetID(int nID) { + this.ID = nID; + } + + #region [ IInputDevice 実装 ] + //----------------- + public InputDeviceType CurrentType { + get; + private set; + } + public string GUID { + get; + private set; + } + public int ID { + get; + private set; + } + public string Name { + get; + private set; + } + public List InputEvents { + get; + private set; + } + public string strDeviceName { + get; + set; + } + + public void Polling(bool useBufferInput) { + InputEvents.Clear(); + + // BUG: In Silk.NET, GLFW input does not fire events, so we have to poll + // them instead. + // https://github.com/dotnet/Silk.NET/issues/1889 + foreach (var button in Joystick.Buttons) { + // also, in GLFW the buttons don't have names, so the indices are the names + ButtonStates[button.Index].Item1 = button.Pressed; + } + + for (int i = 0; i < ButtonStates.Length; i++) { + if (ButtonStates[i].Item1) { + if (ButtonStates[i].Item2 >= 1) { + ButtonStates[i].Item2 = 2; + } else { + ButtonStates[i].Item2 = 1; + + InputEvents.Add( + new STInputEvent() { + nKey = i, + Pressed = true, + Released = false, + nTimeStamp = SampleFramework.Game.TimeMs, + nVelocity = 0, + } + ); + } + } else { + if (ButtonStates[i].Item2 <= -1) { + ButtonStates[i].Item2 = -2; + } else { + ButtonStates[i].Item2 = -1; + + InputEvents.Add( + new STInputEvent() { + nKey = i, + Pressed = false, + Released = true, + nTimeStamp = SampleFramework.Game.TimeMs, + nVelocity = 0, + } + ); + } + } + } + } + + public bool KeyPressed(int nButton) { + return ButtonStates[nButton].Item2 == 1; + } + public bool KeyPressing(int nButton) { + return ButtonStates[nButton].Item2 >= 1; + } + public bool KeyReleased(int nButton) { + return ButtonStates[nButton].Item2 == -1; + } + public bool KeyReleasing(int nButton) { + return ButtonStates[nButton].Item2 <= -1; + } + //----------------- + #endregion + + #region [ IDisposable 実装 ] + //----------------- + public void Dispose() { + if (!this.IsDisposed) { + if (this.InputEvents != null) { + this.InputEvents = null; + } + this.IsDisposed = true; + } + } + //----------------- + #endregion + + + // その他 + + #region [ private ] + //----------------- + public (bool, int)[] ButtonStates { get; private set; } = new (bool, int)[18]; + private bool IsDisposed; + + private void Joystick_ButtonDown(IJoystick joystick, Button button) { + if (button.Name != ButtonName.Unknown) { + ButtonStates[(int)button.Name].Item1 = true; + } + } + + private void Joystick_ButtonUp(IJoystick joystick, Button button) { + if (button.Name != ButtonName.Unknown) { + ButtonStates[(int)button.Name].Item1 = false; + } + } + //----------------- + #endregion } diff --git a/FDK/src/02.Input/CInputKeyboard.cs b/FDK/src/02.Input/CInputKeyboard.cs index d3067597..d69027f0 100644 --- a/FDK/src/02.Input/CInputKeyboard.cs +++ b/FDK/src/02.Input/CInputKeyboard.cs @@ -1,144 +1,144 @@ using Silk.NET.Input; -namespace FDK { - public class CInputKeyboard : IInputDevice, IDisposable { - // Constructor +namespace FDK; - public CInputKeyboard(IReadOnlyList keyboards) { - this.CurrentType = InputDeviceType.Keyboard; - this.GUID = ""; - this.ID = 0; - this.Name = keyboards.Count > 0 ? keyboards[0].Name : ""; +public class CInputKeyboard : IInputDevice, IDisposable { + // Constructor - foreach (var keyboard in keyboards) { - keyboard.KeyDown += KeyDown; - keyboard.KeyUp += KeyUp; - keyboard.KeyChar += KeyChar; - } + public CInputKeyboard(IReadOnlyList keyboards) { + this.CurrentType = InputDeviceType.Keyboard; + this.GUID = ""; + this.ID = 0; + this.Name = keyboards.Count > 0 ? keyboards[0].Name : ""; - //this.timer = new CTimer( CTimer.E種別.MultiMedia ); - this.InputEvents = new List(32); - // this.ct = new CTimer( CTimer.E種別.PerformanceCounter ); + foreach (var keyboard in keyboards) { + keyboard.KeyDown += KeyDown; + keyboard.KeyUp += KeyUp; + keyboard.KeyChar += KeyChar; } - - // メソッド - - #region [ IInputDevice 実装 ] - //----------------- - public InputDeviceType CurrentType { get; private set; } - public string GUID { get; private set; } - public int ID { get; private set; } - public string Name { get; private set; } - public List InputEvents { get; private set; } - public string strDeviceName { get; set; } - - public void Polling(bool useBufferInput) { - InputEvents.Clear(); - - for (int i = 0; i < KeyStates.Length; i++) { - if (KeyStates[i].Item1) { - if (KeyStates[i].Item2 >= 1) { - KeyStates[i].Item2 = 2; - } else { - KeyStates[i].Item2 = 1; - InputEvents.Add( - new STInputEvent() { - nKey = i, - Pressed = true, - Released = false, - nTimeStamp = SampleFramework.Game.TimeMs, - nVelocity = 0, - } - ); - } - } else { - if (KeyStates[i].Item2 <= -1) { - KeyStates[i].Item2 = -2; - } else { - KeyStates[i].Item2 = -1; - InputEvents.Add( - new STInputEvent() { - nKey = i, - Pressed = false, - Released = true, - nTimeStamp = SampleFramework.Game.TimeMs, - nVelocity = 0, - } - ); - } - } - } - } - /// - /// 調べる SlimDX.DirectInput.Key を int にキャストした値。(SharpDX.DirectInput.Key ではないので注意。) - /// - public bool KeyPressed(int nKey) { - return KeyStates[nKey].Item2 == 1; - } - /// - /// 調べる SlimDX.DirectInput.Key を int にキャストした値。(SharpDX.DirectInput.Key ではないので注意。) - /// - public bool KeyPressing(int nKey) { - return KeyStates[nKey].Item2 >= 1; - } - /// - /// 調べる SlimDX.DirectInput.Key を int にキャストした値。(SharpDX.DirectInput.Key ではないので注意。) - /// - public bool KeyReleased(int nKey) { - return KeyStates[nKey].Item2 == -1; - } - /// - /// 調べる SlimDX.DirectInput.Key を int にキャストした値。(SharpDX.DirectInput.Key ではないので注意。) - /// - public bool KeyReleasing(int nKey) { - return KeyStates[nKey].Item2 <= -1; - } - //----------------- - #endregion - - #region [ IDisposable 実装 ] - //----------------- - public void Dispose() { - if (!this.IsDisposed) { - if (this.InputEvents != null) { - this.InputEvents = null; - } - this.IsDisposed = true; - } - } - //----------------- - #endregion - - - // その他 - - #region [ private ] - //----------------- - public (bool, int)[] KeyStates { get; private set; } = new (bool, int)[144]; - private bool IsDisposed; - //private CTimer timer; - //private CTimer ct; - - - private void KeyDown(IKeyboard keyboard, Key key, int keyCode) { - if (key != Key.Unknown) { - var keyNum = DeviceConstantConverter.DIKtoKey(key); - KeyStates[(int)keyNum].Item1 = true; - } - } - - private void KeyUp(IKeyboard keyboard, Key key, int keyCode) { - if (key != Key.Unknown) { - var keyNum = DeviceConstantConverter.DIKtoKey(key); - KeyStates[(int)keyNum].Item1 = false; - } - } - - private void KeyChar(IKeyboard keyboard, char ch) { - - } - //----------------- - #endregion + //this.timer = new CTimer( CTimer.E種別.MultiMedia ); + this.InputEvents = new List(32); + // this.ct = new CTimer( CTimer.E種別.PerformanceCounter ); } + + + // メソッド + + #region [ IInputDevice 実装 ] + //----------------- + public InputDeviceType CurrentType { get; private set; } + public string GUID { get; private set; } + public int ID { get; private set; } + public string Name { get; private set; } + public List InputEvents { get; private set; } + public string strDeviceName { get; set; } + + public void Polling(bool useBufferInput) { + InputEvents.Clear(); + + for (int i = 0; i < KeyStates.Length; i++) { + if (KeyStates[i].Item1) { + if (KeyStates[i].Item2 >= 1) { + KeyStates[i].Item2 = 2; + } else { + KeyStates[i].Item2 = 1; + InputEvents.Add( + new STInputEvent() { + nKey = i, + Pressed = true, + Released = false, + nTimeStamp = SampleFramework.Game.TimeMs, + nVelocity = 0, + } + ); + } + } else { + if (KeyStates[i].Item2 <= -1) { + KeyStates[i].Item2 = -2; + } else { + KeyStates[i].Item2 = -1; + InputEvents.Add( + new STInputEvent() { + nKey = i, + Pressed = false, + Released = true, + nTimeStamp = SampleFramework.Game.TimeMs, + nVelocity = 0, + } + ); + } + } + } + } + /// + /// 調べる SlimDX.DirectInput.Key を int にキャストした値。(SharpDX.DirectInput.Key ではないので注意。) + /// + public bool KeyPressed(int nKey) { + return KeyStates[nKey].Item2 == 1; + } + /// + /// 調べる SlimDX.DirectInput.Key を int にキャストした値。(SharpDX.DirectInput.Key ではないので注意。) + /// + public bool KeyPressing(int nKey) { + return KeyStates[nKey].Item2 >= 1; + } + /// + /// 調べる SlimDX.DirectInput.Key を int にキャストした値。(SharpDX.DirectInput.Key ではないので注意。) + /// + public bool KeyReleased(int nKey) { + return KeyStates[nKey].Item2 == -1; + } + /// + /// 調べる SlimDX.DirectInput.Key を int にキャストした値。(SharpDX.DirectInput.Key ではないので注意。) + /// + public bool KeyReleasing(int nKey) { + return KeyStates[nKey].Item2 <= -1; + } + //----------------- + #endregion + + #region [ IDisposable 実装 ] + //----------------- + public void Dispose() { + if (!this.IsDisposed) { + if (this.InputEvents != null) { + this.InputEvents = null; + } + this.IsDisposed = true; + } + } + //----------------- + #endregion + + + // その他 + + #region [ private ] + //----------------- + public (bool, int)[] KeyStates { get; private set; } = new (bool, int)[144]; + private bool IsDisposed; + //private CTimer timer; + //private CTimer ct; + + + private void KeyDown(IKeyboard keyboard, Key key, int keyCode) { + if (key != Key.Unknown) { + var keyNum = DeviceConstantConverter.DIKtoKey(key); + KeyStates[(int)keyNum].Item1 = true; + } + } + + private void KeyUp(IKeyboard keyboard, Key key, int keyCode) { + if (key != Key.Unknown) { + var keyNum = DeviceConstantConverter.DIKtoKey(key); + KeyStates[(int)keyNum].Item1 = false; + } + } + + private void KeyChar(IKeyboard keyboard, char ch) { + + } + //----------------- + #endregion } diff --git a/FDK/src/02.Input/CInputMIDI.cs b/FDK/src/02.Input/CInputMIDI.cs index 9b126185..0bfaca32 100644 --- a/FDK/src/02.Input/CInputMIDI.cs +++ b/FDK/src/02.Input/CInputMIDI.cs @@ -1,109 +1,109 @@ -namespace FDK { - public class CInputMIDI : IInputDevice, IDisposable { - // Properties +namespace FDK; - public IntPtr MidiInPtr; - public List EventBuffers; +public class CInputMIDI : IInputDevice, IDisposable { + // Properties - // Constructor + public IntPtr MidiInPtr; + public List EventBuffers; - public CInputMIDI(uint nID) { - this.MidiInPtr = IntPtr.Zero; - this.EventBuffers = new List(32); - this.InputEvents = new List(32); - this.CurrentType = InputDeviceType.MidiIn; - this.GUID = ""; - this.ID = (int)nID; - this.Name = ""; - this.strDeviceName = ""; // CInput管理で初期化する - } + // Constructor - - // メソッド - - public void tメッセージからMIDI信号のみ受信(uint wMsg, IntPtr dwInstance, IntPtr dwParam1, IntPtr dwParam2, long n受信システム時刻) { - /* - if (wMsg == CWin32.MIM_DATA) - { - int nMIDIevent = (int)dwParam1 & 0xF0; - int nPara1 = ((int)dwParam1 >> 8) & 0xFF; - int nPara2 = ((int)dwParam1 >> 16) & 0xFF; - int nPara3 = ((int)dwParam2 >> 8) & 0xFF; - int nPara4 = ((int)dwParam2 >> 16) & 0xFF; - - // Trace.TraceInformation( "MIDIevent={0:X2} para1={1:X2} para2={2:X2}", nMIDIevent, nPara1, nPara2 ,nPara3,nPara4); - - if ((nMIDIevent == 0x90) && (nPara2 != 0)) // Note ON - { - STInputEvent item = new STInputEvent(); - item.nKey = nPara1; - item.b押された = true; - item.nTimeStamp = n受信システム時刻; - item.nVelocity = nPara2; - this.listEventBuffer.Add(item); - } - //else if ( ( nMIDIevent == 0xB0 ) && ( nPara1 == 4 ) ) // Ctrl Chg #04: Foot Controller - //{ - // STInputEvent item = new STInputEvent(); - // item.nKey = nPara1; - // item.b押された = true; - // item.nTimeStamp = n受信システム時刻; - // item.nVelocity = nPara2; - // this.listEventBuffer.Add( item ); - //} - } - */ - } - - #region [ IInputDevice 実装 ] - //----------------- - public InputDeviceType CurrentType { get; private set; } - public string GUID { get; private set; } - public int ID { get; private set; } - public string Name { get; private set; } - public List InputEvents { get; private set; } - public string strDeviceName { get; set; } - - public void Polling(bool bWindowがアクティブ中) { - // this.list入力イベント = new List( 32 ); - this.InputEvents.Clear(); // #xxxxx 2012.6.11 yyagi; To optimize, I removed new(); - - for (int i = 0; i < this.EventBuffers.Count; i++) - this.InputEvents.Add(this.EventBuffers[i]); - - this.EventBuffers.Clear(); - } - public bool KeyPressed(int nKey) { - foreach (STInputEvent event2 in this.InputEvents) { - if ((event2.nKey == nKey) && event2.Pressed) { - return true; - } - } - return false; - } - public bool KeyPressing(int nKey) { - return false; - } - public bool KeyReleased(int nKey) { - return false; - } - public bool KeyReleasing(int nKey) { - return false; - } - //----------------- - #endregion - - #region [ IDisposable 実装 ] - //----------------- - public void Dispose() { - if (this.EventBuffers != null) { - this.EventBuffers = null; - } - if (this.InputEvents != null) { - this.InputEvents = null; - } - } - //----------------- - #endregion + public CInputMIDI(uint nID) { + this.MidiInPtr = IntPtr.Zero; + this.EventBuffers = new List(32); + this.InputEvents = new List(32); + this.CurrentType = InputDeviceType.MidiIn; + this.GUID = ""; + this.ID = (int)nID; + this.Name = ""; + this.strDeviceName = ""; // CInput管理で初期化する } + + + // メソッド + + public void tメッセージからMIDI信号のみ受信(uint wMsg, IntPtr dwInstance, IntPtr dwParam1, IntPtr dwParam2, long n受信システム時刻) { + /* + if (wMsg == CWin32.MIM_DATA) + { + int nMIDIevent = (int)dwParam1 & 0xF0; + int nPara1 = ((int)dwParam1 >> 8) & 0xFF; + int nPara2 = ((int)dwParam1 >> 16) & 0xFF; + int nPara3 = ((int)dwParam2 >> 8) & 0xFF; + int nPara4 = ((int)dwParam2 >> 16) & 0xFF; + + // Trace.TraceInformation( "MIDIevent={0:X2} para1={1:X2} para2={2:X2}", nMIDIevent, nPara1, nPara2 ,nPara3,nPara4); + + if ((nMIDIevent == 0x90) && (nPara2 != 0)) // Note ON + { + STInputEvent item = new STInputEvent(); + item.nKey = nPara1; + item.b押された = true; + item.nTimeStamp = n受信システム時刻; + item.nVelocity = nPara2; + this.listEventBuffer.Add(item); + } + //else if ( ( nMIDIevent == 0xB0 ) && ( nPara1 == 4 ) ) // Ctrl Chg #04: Foot Controller + //{ + // STInputEvent item = new STInputEvent(); + // item.nKey = nPara1; + // item.b押された = true; + // item.nTimeStamp = n受信システム時刻; + // item.nVelocity = nPara2; + // this.listEventBuffer.Add( item ); + //} + } + */ + } + + #region [ IInputDevice 実装 ] + //----------------- + public InputDeviceType CurrentType { get; private set; } + public string GUID { get; private set; } + public int ID { get; private set; } + public string Name { get; private set; } + public List InputEvents { get; private set; } + public string strDeviceName { get; set; } + + public void Polling(bool bWindowがアクティブ中) { + // this.list入力イベント = new List( 32 ); + this.InputEvents.Clear(); // #xxxxx 2012.6.11 yyagi; To optimize, I removed new(); + + for (int i = 0; i < this.EventBuffers.Count; i++) + this.InputEvents.Add(this.EventBuffers[i]); + + this.EventBuffers.Clear(); + } + public bool KeyPressed(int nKey) { + foreach (STInputEvent event2 in this.InputEvents) { + if ((event2.nKey == nKey) && event2.Pressed) { + return true; + } + } + return false; + } + public bool KeyPressing(int nKey) { + return false; + } + public bool KeyReleased(int nKey) { + return false; + } + public bool KeyReleasing(int nKey) { + return false; + } + //----------------- + #endregion + + #region [ IDisposable 実装 ] + //----------------- + public void Dispose() { + if (this.EventBuffers != null) { + this.EventBuffers = null; + } + if (this.InputEvents != null) { + this.InputEvents = null; + } + } + //----------------- + #endregion } diff --git a/FDK/src/02.Input/CInputManager.cs b/FDK/src/02.Input/CInputManager.cs index de7bdd48..791e605b 100644 --- a/FDK/src/02.Input/CInputManager.cs +++ b/FDK/src/02.Input/CInputManager.cs @@ -2,199 +2,199 @@ using Silk.NET.Input; using Silk.NET.Windowing; -namespace FDK { - public class CInputManager : IDisposable { - // 定数 +namespace FDK; - public static int DefaultVolume = 110; +public class CInputManager : IDisposable { + // 定数 + + public static int DefaultVolume = 110; - // Properties + // Properties - public List InputDevices { - get; - private set; - } - public IInputDevice Keyboard { - get { - if (this._Keyboard != null) { - return this._Keyboard; - } - foreach (IInputDevice device in this.InputDevices) { - if (device.CurrentType == InputDeviceType.Keyboard) { - this._Keyboard = device; - return device; - } - } - return null; - } - } - public IInputDevice Mouse { - get { - if (this._Mouse != null) { - return this._Mouse; - } - foreach (IInputDevice device in this.InputDevices) { - if (device.CurrentType == InputDeviceType.Mouse) { - this._Mouse = device; - return device; - } - } - return null; - } - } - - - // Constructor - public CInputManager(IWindow window, bool bUseMidiIn = true) { - Initialize(window, bUseMidiIn); - } - - public void Initialize(IWindow window, bool bUseMidiIn) { - Context = window.CreateInput(); - - this.InputDevices = new List(10); - #region [ Enumerate keyboard/mouse: exception is masked if keyboard/mouse is not connected ] - CInputKeyboard cinputkeyboard = null; - CInputMouse cinputmouse = null; - try { - cinputkeyboard = new CInputKeyboard(Context.Keyboards); - cinputmouse = new CInputMouse(Context.Mice[0]); - } catch { - } - if (cinputkeyboard != null) { - this.InputDevices.Add(cinputkeyboard); - } - if (cinputmouse != null) { - this.InputDevices.Add(cinputmouse); - } - #endregion - #region [ Enumerate joypad ] - foreach (var joysticks in Context.Joysticks) { - this.InputDevices.Add(new CInputJoystick(joysticks)); - } - foreach (var gamepad in Context.Gamepads) { - this.InputDevices.Add(new CInputGamepad(gamepad)); - } - #endregion - Trace.TraceInformation("Found {0} Input Device{1}", InputDevices.Count, InputDevices.Count != 1 ? "s:" : ":"); - for (int i = 0; i < InputDevices.Count; i++) { - try { - Trace.TraceInformation("Input Device #" + i + " (" + InputDevices[i].CurrentType.ToString() + " - " + InputDevices[i].Name + ")"); - } catch { } - } - - SampleFramework.Game.InitImGuiController(window, Context); - } - - - // メソッド - - public IInputDevice Joystick(int ID) { - foreach (IInputDevice device in this.InputDevices) { - if ((device.CurrentType == InputDeviceType.Joystick) && (device.ID == ID)) { - return device; - } - } - return null; - } - public IInputDevice Joystick(string GUID) { - foreach (IInputDevice device in this.InputDevices) { - if ((device.CurrentType == InputDeviceType.Joystick) && device.GUID.Equals(GUID)) { - return device; - } - } - return null; - } - public IInputDevice Gamepad(int ID) { - foreach (IInputDevice device in this.InputDevices) { - if ((device.CurrentType == InputDeviceType.Gamepad) && (device.ID == ID)) { - return device; - } - } - return null; - } - public IInputDevice Gamepad(string GUID) { - foreach (IInputDevice device in this.InputDevices) { - if ((device.CurrentType == InputDeviceType.Gamepad) && device.GUID.Equals(GUID)) { - return device; - } - } - return null; - } - public IInputDevice MidiIn(int ID) { - foreach (IInputDevice device in this.InputDevices) { - if ((device.CurrentType == InputDeviceType.MidiIn) && (device.ID == ID)) { - return device; - } - } - return null; - } - public void Polling(bool useBufferInput) { - lock (this.objMidiIn排他用) { - // foreach( IInputDevice device in this.list入力デバイス ) - for (int i = this.InputDevices.Count - 1; i >= 0; i--) // #24016 2011.1.6 yyagi: change not to use "foreach" to avoid InvalidOperation exception by Remove(). - { - IInputDevice device = this.InputDevices[i]; - try { - device.Polling(useBufferInput); - } catch (Exception e) // #24016 2011.1.6 yyagi: catch exception for unplugging USB joystick, and remove the device object from the polling items. - { - this.InputDevices.Remove(device); - device.Dispose(); - Trace.TraceError("tポーリング時に対象deviceが抜かれており例外発生。同deviceをポーリング対象からRemoveしました。"); - } - } - } - } - - #region [ IDisposable+α ] - //----------------- - public void Dispose() { - this.Dispose(true); - } - public void Dispose(bool disposeManagedObjects) { - if (!this.bDisposed済み) { - if (disposeManagedObjects) { - foreach (IInputDevice device in this.InputDevices) { - CInputMIDI tmidi = device as CInputMIDI; - if (tmidi != null) { - Trace.TraceInformation("MIDI In: [{0}] を停止しました。", new object[] { tmidi.ID }); - } - } - foreach (IInputDevice device2 in this.InputDevices) { - device2.Dispose(); - } - lock (this.objMidiIn排他用) { - this.InputDevices.Clear(); - } - - Context.Dispose(); - } - this.bDisposed済み = true; - } - } - ~CInputManager() { - this.Dispose(false); - GC.KeepAlive(this); - } - //----------------- - #endregion - - - // その他 - - #region [ private ] - //----------------- - private IInputContext Context; - private IInputDevice _Keyboard; - private IInputDevice _Mouse; - private bool bDisposed済み; - private List listHMIDIIN = new List(8); - private object objMidiIn排他用 = new object(); - //private CTimer timer; - - //----------------- - #endregion + public List InputDevices { + get; + private set; } + public IInputDevice Keyboard { + get { + if (this._Keyboard != null) { + return this._Keyboard; + } + foreach (IInputDevice device in this.InputDevices) { + if (device.CurrentType == InputDeviceType.Keyboard) { + this._Keyboard = device; + return device; + } + } + return null; + } + } + public IInputDevice Mouse { + get { + if (this._Mouse != null) { + return this._Mouse; + } + foreach (IInputDevice device in this.InputDevices) { + if (device.CurrentType == InputDeviceType.Mouse) { + this._Mouse = device; + return device; + } + } + return null; + } + } + + + // Constructor + public CInputManager(IWindow window, bool bUseMidiIn = true) { + Initialize(window, bUseMidiIn); + } + + public void Initialize(IWindow window, bool bUseMidiIn) { + Context = window.CreateInput(); + + this.InputDevices = new List(10); + #region [ Enumerate keyboard/mouse: exception is masked if keyboard/mouse is not connected ] + CInputKeyboard cinputkeyboard = null; + CInputMouse cinputmouse = null; + try { + cinputkeyboard = new CInputKeyboard(Context.Keyboards); + cinputmouse = new CInputMouse(Context.Mice[0]); + } catch { + } + if (cinputkeyboard != null) { + this.InputDevices.Add(cinputkeyboard); + } + if (cinputmouse != null) { + this.InputDevices.Add(cinputmouse); + } + #endregion + #region [ Enumerate joypad ] + foreach (var joysticks in Context.Joysticks) { + this.InputDevices.Add(new CInputJoystick(joysticks)); + } + foreach (var gamepad in Context.Gamepads) { + this.InputDevices.Add(new CInputGamepad(gamepad)); + } + #endregion + Trace.TraceInformation("Found {0} Input Device{1}", InputDevices.Count, InputDevices.Count != 1 ? "s:" : ":"); + for (int i = 0; i < InputDevices.Count; i++) { + try { + Trace.TraceInformation("Input Device #" + i + " (" + InputDevices[i].CurrentType.ToString() + " - " + InputDevices[i].Name + ")"); + } catch { } + } + + SampleFramework.Game.InitImGuiController(window, Context); + } + + + // メソッド + + public IInputDevice Joystick(int ID) { + foreach (IInputDevice device in this.InputDevices) { + if ((device.CurrentType == InputDeviceType.Joystick) && (device.ID == ID)) { + return device; + } + } + return null; + } + public IInputDevice Joystick(string GUID) { + foreach (IInputDevice device in this.InputDevices) { + if ((device.CurrentType == InputDeviceType.Joystick) && device.GUID.Equals(GUID)) { + return device; + } + } + return null; + } + public IInputDevice Gamepad(int ID) { + foreach (IInputDevice device in this.InputDevices) { + if ((device.CurrentType == InputDeviceType.Gamepad) && (device.ID == ID)) { + return device; + } + } + return null; + } + public IInputDevice Gamepad(string GUID) { + foreach (IInputDevice device in this.InputDevices) { + if ((device.CurrentType == InputDeviceType.Gamepad) && device.GUID.Equals(GUID)) { + return device; + } + } + return null; + } + public IInputDevice MidiIn(int ID) { + foreach (IInputDevice device in this.InputDevices) { + if ((device.CurrentType == InputDeviceType.MidiIn) && (device.ID == ID)) { + return device; + } + } + return null; + } + public void Polling(bool useBufferInput) { + lock (this.objMidiIn排他用) { + // foreach( IInputDevice device in this.list入力デバイス ) + for (int i = this.InputDevices.Count - 1; i >= 0; i--) // #24016 2011.1.6 yyagi: change not to use "foreach" to avoid InvalidOperation exception by Remove(). + { + IInputDevice device = this.InputDevices[i]; + try { + device.Polling(useBufferInput); + } catch (Exception e) // #24016 2011.1.6 yyagi: catch exception for unplugging USB joystick, and remove the device object from the polling items. + { + this.InputDevices.Remove(device); + device.Dispose(); + Trace.TraceError("tポーリング時に対象deviceが抜かれており例外発生。同deviceをポーリング対象からRemoveしました。"); + } + } + } + } + + #region [ IDisposable+α ] + //----------------- + public void Dispose() { + this.Dispose(true); + } + public void Dispose(bool disposeManagedObjects) { + if (!this.bDisposed済み) { + if (disposeManagedObjects) { + foreach (IInputDevice device in this.InputDevices) { + CInputMIDI tmidi = device as CInputMIDI; + if (tmidi != null) { + Trace.TraceInformation("MIDI In: [{0}] を停止しました。", new object[] { tmidi.ID }); + } + } + foreach (IInputDevice device2 in this.InputDevices) { + device2.Dispose(); + } + lock (this.objMidiIn排他用) { + this.InputDevices.Clear(); + } + + Context.Dispose(); + } + this.bDisposed済み = true; + } + } + ~CInputManager() { + this.Dispose(false); + GC.KeepAlive(this); + } + //----------------- + #endregion + + + // その他 + + #region [ private ] + //----------------- + private IInputContext Context; + private IInputDevice _Keyboard; + private IInputDevice _Mouse; + private bool bDisposed済み; + private List listHMIDIIN = new List(8); + private object objMidiIn排他用 = new object(); + //private CTimer timer; + + //----------------- + #endregion } diff --git a/FDK/src/02.Input/CInputMouse.cs b/FDK/src/02.Input/CInputMouse.cs index 30bdbeee..85baf932 100644 --- a/FDK/src/02.Input/CInputMouse.cs +++ b/FDK/src/02.Input/CInputMouse.cs @@ -2,138 +2,138 @@ using System.Numerics; using Silk.NET.Input; -namespace FDK { - public class CInputMouse : IInputDevice, IDisposable { - // 定数 +namespace FDK; - public const int MouseButtonCount = 8; +public class CInputMouse : IInputDevice, IDisposable { + // 定数 + + public const int MouseButtonCount = 8; - // Constructor + // Constructor - public CInputMouse(IMouse mouse) { - this.CurrentType = InputDeviceType.Mouse; - this.GUID = ""; - this.ID = 0; - this.Name = mouse.Name; + public CInputMouse(IMouse mouse) { + this.CurrentType = InputDeviceType.Mouse; + this.GUID = ""; + this.ID = 0; + this.Name = mouse.Name; - mouse.Click += Mouse_Click; - mouse.DoubleClick += Mouse_DoubleClick; - mouse.MouseDown += Mouse_MouseDown; - mouse.MouseUp += Mouse_MouseUp; - mouse.MouseMove += Mouse_MouseMove; + mouse.Click += Mouse_Click; + mouse.DoubleClick += Mouse_DoubleClick; + mouse.MouseDown += Mouse_MouseDown; + mouse.MouseUp += Mouse_MouseUp; + mouse.MouseMove += Mouse_MouseMove; - this.InputEvents = new List(32); - } - - - // メソッド - - #region [ IInputDevice 実装 ] - //----------------- - public InputDeviceType CurrentType { get; private set; } - public string GUID { get; private set; } - public int ID { get; private set; } - public string Name { get; private set; } - public List InputEvents { get; private set; } - - public void Polling(bool useBufferInput) { - InputEvents.Clear(); - - for (int i = 0; i < MouseStates.Length; i++) { - if (MouseStates[i].Item1) { - if (MouseStates[i].Item2 >= 1) { - MouseStates[i].Item2 = 2; - } else { - MouseStates[i].Item2 = 1; - InputEvents.Add( - new STInputEvent() { - nKey = i, - Pressed = true, - Released = false, - nTimeStamp = SampleFramework.Game.TimeMs, - nVelocity = 0, - } - ); - } - } else { - if (MouseStates[i].Item2 <= -1) { - MouseStates[i].Item2 = -2; - } else { - MouseStates[i].Item2 = -1; - InputEvents.Add( - new STInputEvent() { - nKey = i, - Pressed = false, - Released = true, - nTimeStamp = SampleFramework.Game.TimeMs, - nVelocity = 0, - } - ); - } - } - } - } - public bool KeyPressed(int nButton) { - return MouseStates[nButton].Item2 == 1; - } - public bool KeyPressing(int nButton) { - return MouseStates[nButton].Item2 >= 1; - } - public bool KeyReleased(int nButton) { - return MouseStates[nButton].Item2 == -1; - } - public bool KeyReleasing(int nButton) { - return MouseStates[nButton].Item2 <= -1; - } - //----------------- - #endregion - - #region [ IDisposable 実装 ] - //----------------- - public void Dispose() { - if (!this.IsDisposed) { - if (this.InputEvents != null) { - this.InputEvents = null; - } - this.IsDisposed = true; - } - } - //----------------- - #endregion - - - // その他 - - #region [ private ] - //----------------- - public (bool, int)[] MouseStates { get; private set; } = new (bool, int)[12]; - private bool IsDisposed; - - private void Mouse_Click(IMouse mouse, MouseButton mouseButton, Vector2 vector2) { - - } - - private void Mouse_DoubleClick(IMouse mouse, MouseButton mouseButton, Vector2 vector2) { - - } - - private void Mouse_MouseDown(IMouse mouse, MouseButton mouseButton) { - if (mouseButton != MouseButton.Unknown) { - MouseStates[(int)mouseButton].Item1 = true; - } - } - - private void Mouse_MouseUp(IMouse mouse, MouseButton mouseButton) { - if (mouseButton != MouseButton.Unknown) { - MouseStates[(int)mouseButton].Item1 = false; - } - } - - private void Mouse_MouseMove(IMouse mouse, Vector2 vector2) { - - } - //----------------- - #endregion + this.InputEvents = new List(32); } + + + // メソッド + + #region [ IInputDevice 実装 ] + //----------------- + public InputDeviceType CurrentType { get; private set; } + public string GUID { get; private set; } + public int ID { get; private set; } + public string Name { get; private set; } + public List InputEvents { get; private set; } + + public void Polling(bool useBufferInput) { + InputEvents.Clear(); + + for (int i = 0; i < MouseStates.Length; i++) { + if (MouseStates[i].Item1) { + if (MouseStates[i].Item2 >= 1) { + MouseStates[i].Item2 = 2; + } else { + MouseStates[i].Item2 = 1; + InputEvents.Add( + new STInputEvent() { + nKey = i, + Pressed = true, + Released = false, + nTimeStamp = SampleFramework.Game.TimeMs, + nVelocity = 0, + } + ); + } + } else { + if (MouseStates[i].Item2 <= -1) { + MouseStates[i].Item2 = -2; + } else { + MouseStates[i].Item2 = -1; + InputEvents.Add( + new STInputEvent() { + nKey = i, + Pressed = false, + Released = true, + nTimeStamp = SampleFramework.Game.TimeMs, + nVelocity = 0, + } + ); + } + } + } + } + public bool KeyPressed(int nButton) { + return MouseStates[nButton].Item2 == 1; + } + public bool KeyPressing(int nButton) { + return MouseStates[nButton].Item2 >= 1; + } + public bool KeyReleased(int nButton) { + return MouseStates[nButton].Item2 == -1; + } + public bool KeyReleasing(int nButton) { + return MouseStates[nButton].Item2 <= -1; + } + //----------------- + #endregion + + #region [ IDisposable 実装 ] + //----------------- + public void Dispose() { + if (!this.IsDisposed) { + if (this.InputEvents != null) { + this.InputEvents = null; + } + this.IsDisposed = true; + } + } + //----------------- + #endregion + + + // その他 + + #region [ private ] + //----------------- + public (bool, int)[] MouseStates { get; private set; } = new (bool, int)[12]; + private bool IsDisposed; + + private void Mouse_Click(IMouse mouse, MouseButton mouseButton, Vector2 vector2) { + + } + + private void Mouse_DoubleClick(IMouse mouse, MouseButton mouseButton, Vector2 vector2) { + + } + + private void Mouse_MouseDown(IMouse mouse, MouseButton mouseButton) { + if (mouseButton != MouseButton.Unknown) { + MouseStates[(int)mouseButton].Item1 = true; + } + } + + private void Mouse_MouseUp(IMouse mouse, MouseButton mouseButton) { + if (mouseButton != MouseButton.Unknown) { + MouseStates[(int)mouseButton].Item1 = false; + } + } + + private void Mouse_MouseMove(IMouse mouse, Vector2 vector2) { + + } + //----------------- + #endregion } diff --git a/FDK/src/02.Input/DeviceConstantConverter.cs b/FDK/src/02.Input/DeviceConstantConverter.cs index f88a2221..8e5c5af7 100644 --- a/FDK/src/02.Input/DeviceConstantConverter.cs +++ b/FDK/src/02.Input/DeviceConstantConverter.cs @@ -2,172 +2,172 @@ using SlimDXKey = SlimDXKeys.Key; -namespace FDK { - public static class DeviceConstantConverter { - // メソッド +namespace FDK; - public static Key DIKtoKey(Silk.NET.Input.Key key) { - return _DIKtoKey[key]; - } +public static class DeviceConstantConverter { + // メソッド - - /// - /// DIK (SharpDX.DirectInput.Key) から SlimDX.DirectInput.Key への変換表。 - /// - private static Dictionary _DIKtoKey = new Dictionary() { - { Silk.NET.Input.Key.Unknown, SlimDXKey.Unknown }, - { Silk.NET.Input.Key.Escape, SlimDXKey.Escape }, - { Silk.NET.Input.Key.Number1, SlimDXKey.D1 }, - { Silk.NET.Input.Key.Number2, SlimDXKey.D2 }, - { Silk.NET.Input.Key.Number3, SlimDXKey.D3 }, - { Silk.NET.Input.Key.Number4, SlimDXKey.D4 }, - { Silk.NET.Input.Key.Number5, SlimDXKey.D5 }, - { Silk.NET.Input.Key.Number6, SlimDXKey.D6 }, - { Silk.NET.Input.Key.Number7, SlimDXKey.D7 }, - { Silk.NET.Input.Key.Number8, SlimDXKey.D8 }, - { Silk.NET.Input.Key.Number9, SlimDXKey.D9 }, - { Silk.NET.Input.Key.Number0, SlimDXKey.D0 }, - { Silk.NET.Input.Key.Minus, SlimDXKey.Minus }, - { Silk.NET.Input.Key.Equal, SlimDXKey.Equals }, - { Silk.NET.Input.Key.Backspace, SlimDXKey.Backspace }, - { Silk.NET.Input.Key.Tab, SlimDXKey.Tab }, - { Silk.NET.Input.Key.Q, SlimDXKey.Q }, - { Silk.NET.Input.Key.W, SlimDXKey.W }, - { Silk.NET.Input.Key.E, SlimDXKey.E }, - { Silk.NET.Input.Key.R, SlimDXKey.R }, - { Silk.NET.Input.Key.T, SlimDXKey.T }, - { Silk.NET.Input.Key.Y, SlimDXKey.Y }, - { Silk.NET.Input.Key.U, SlimDXKey.U }, - { Silk.NET.Input.Key.I, SlimDXKey.I }, - { Silk.NET.Input.Key.O, SlimDXKey.O }, - { Silk.NET.Input.Key.P, SlimDXKey.P }, - { Silk.NET.Input.Key.LeftBracket, SlimDXKey.LeftBracket }, - { Silk.NET.Input.Key.RightBracket, SlimDXKey.RightBracket }, - { Silk.NET.Input.Key.Enter, SlimDXKey.Return }, - { Silk.NET.Input.Key.ControlLeft, SlimDXKey.LeftControl }, - { Silk.NET.Input.Key.A, SlimDXKey.A }, - { Silk.NET.Input.Key.S, SlimDXKey.S }, - { Silk.NET.Input.Key.D, SlimDXKey.D }, - { Silk.NET.Input.Key.F, SlimDXKey.F }, - { Silk.NET.Input.Key.G, SlimDXKey.G }, - { Silk.NET.Input.Key.H, SlimDXKey.H }, - { Silk.NET.Input.Key.J, SlimDXKey.J }, - { Silk.NET.Input.Key.K, SlimDXKey.K }, - { Silk.NET.Input.Key.L, SlimDXKey.L }, - { Silk.NET.Input.Key.Semicolon, SlimDXKey.Semicolon }, - { Silk.NET.Input.Key.Apostrophe, SlimDXKey.Apostrophe }, - { Silk.NET.Input.Key.GraveAccent, SlimDXKey.Grave }, - { Silk.NET.Input.Key.ShiftLeft, SlimDXKey.LeftShift }, - { Silk.NET.Input.Key.BackSlash, SlimDXKey.Backslash }, - { Silk.NET.Input.Key.Z, SlimDXKey.Z }, - { Silk.NET.Input.Key.X, SlimDXKey.X }, - { Silk.NET.Input.Key.C, SlimDXKey.C }, - { Silk.NET.Input.Key.V, SlimDXKey.V }, - { Silk.NET.Input.Key.B, SlimDXKey.B }, - { Silk.NET.Input.Key.N, SlimDXKey.N }, - { Silk.NET.Input.Key.M, SlimDXKey.M }, - { Silk.NET.Input.Key.Comma, SlimDXKey.Comma }, - { Silk.NET.Input.Key.Period, SlimDXKey.Period }, - { Silk.NET.Input.Key.Slash, SlimDXKey.Slash }, - { Silk.NET.Input.Key.ShiftRight, SlimDXKey.RightShift }, - { Silk.NET.Input.Key.KeypadMultiply, SlimDXKey.NumberPadStar }, - { Silk.NET.Input.Key.AltLeft, SlimDXKey.LeftAlt }, - { Silk.NET.Input.Key.Space, SlimDXKey.Space }, - { Silk.NET.Input.Key.CapsLock, SlimDXKey.CapsLock }, - { Silk.NET.Input.Key.F1, SlimDXKey.F1 }, - { Silk.NET.Input.Key.F2, SlimDXKey.F2 }, - { Silk.NET.Input.Key.F3, SlimDXKey.F3 }, - { Silk.NET.Input.Key.F4, SlimDXKey.F4 }, - { Silk.NET.Input.Key.F5, SlimDXKey.F5 }, - { Silk.NET.Input.Key.F6, SlimDXKey.F6 }, - { Silk.NET.Input.Key.F7, SlimDXKey.F7 }, - { Silk.NET.Input.Key.F8, SlimDXKey.F8 }, - { Silk.NET.Input.Key.F9, SlimDXKey.F9 }, - { Silk.NET.Input.Key.F10, SlimDXKey.F10 }, - { Silk.NET.Input.Key.NumLock, SlimDXKey.NumberLock }, - { Silk.NET.Input.Key.ScrollLock, SlimDXKey.ScrollLock }, - { Silk.NET.Input.Key.Keypad7, SlimDXKey.NumberPad7 }, - { Silk.NET.Input.Key.Keypad8, SlimDXKey.NumberPad8 }, - { Silk.NET.Input.Key.Keypad9, SlimDXKey.NumberPad9 }, - { Silk.NET.Input.Key.KeypadSubtract, SlimDXKey.NumberPadMinus }, - { Silk.NET.Input.Key.Keypad4, SlimDXKey.NumberPad4 }, - { Silk.NET.Input.Key.Keypad5, SlimDXKey.NumberPad5 }, - { Silk.NET.Input.Key.Keypad6, SlimDXKey.NumberPad6 }, - { Silk.NET.Input.Key.KeypadAdd, SlimDXKey.NumberPadPlus }, - { Silk.NET.Input.Key.Keypad1, SlimDXKey.NumberPad1 }, - { Silk.NET.Input.Key.Keypad2, SlimDXKey.NumberPad2 }, - { Silk.NET.Input.Key.Keypad3, SlimDXKey.NumberPad3 }, - { Silk.NET.Input.Key.Keypad0, SlimDXKey.NumberPad0 }, - { Silk.NET.Input.Key.KeypadDecimal, SlimDXKey.NumberPadPeriod }, - { Silk.NET.Input.Key.F11, SlimDXKey.F11 }, - { Silk.NET.Input.Key.F12, SlimDXKey.F12 }, - { Silk.NET.Input.Key.F13, SlimDXKey.F13 }, - { Silk.NET.Input.Key.F14, SlimDXKey.F14 }, - { Silk.NET.Input.Key.F15, SlimDXKey.F15 }, - /* - { Silk.NET.Input.Key.Unknown, SlimDXKey.Kana }, - { Silk.NET.Input.Key.Unknown, SlimDXKey.AbntC1 }, - { Silk.NET.Input.Key.Unknown, SlimDXKey.Convert }, - { Silk.NET.Input.Key.Unknown, SlimDXKey.NoConvert }, - { Silk.NET.Input.Key.Unknown, SlimDXKey.Yen }, - { Silk.NET.Input.Key.Unknown, SlimDXKey.AbntC2 }, - */ - { Silk.NET.Input.Key.KeypadEqual, SlimDXKey.NumberPadEquals }, - /* - { Silk.NET.Input.Key.Unknown, SlimDXKey.PreviousTrack }, - { Silk.NET.Input.Key.Unknown, SlimDXKey.AT }, - */ - //{ Silk.NET.Input.Key.Semicolon, SlimDXKey.Colon }, - /* - { Silk.NET.Input.Key.Unknown, SlimDXKey.Underline }, - { Silk.NET.Input.Key.Unknown, SlimDXKey.Kanji }, - { Silk.NET.Input.Key.Unknown, SlimDXKey.Stop }, - { Silk.NET.Input.Key.Unknown, SlimDXKey.AX }, - { Silk.NET.Input.Key.Unknown, SlimDXKey.Unlabeled }, - { Silk.NET.Input.Key.Unknown, SlimDXKey.NextTrack }, - */ - { Silk.NET.Input.Key.KeypadEnter, SlimDXKey.NumberPadEnter }, - { Silk.NET.Input.Key.ControlRight, SlimDXKey.RightControl }, - /* - { Silk.NET.Input.Key.Unknown, SlimDXKey.Mute }, - { Silk.NET.Input.Key.Unknown, SlimDXKey.Calculator }, - */ - /* - { Silk.NET.Input.Key.Unknown, SlimDXKey.MediaStop }, - { Silk.NET.Input.Key.Unknown, SlimDXKey.VolumeDown }, - { Silk.NET.Input.Key.Unknown, SlimDXKey.VolumeUp }, - { Silk.NET.Input.Key.Unknown, SlimDXKey.WebHome }, - */ - { Silk.NET.Input.Key.PrintScreen, SlimDXKey.PrintScreen }, - { Silk.NET.Input.Key.AltRight, SlimDXKey.RightAlt }, - { Silk.NET.Input.Key.Pause, SlimDXKey.Pause }, - { Silk.NET.Input.Key.Home, SlimDXKey.Home }, - { Silk.NET.Input.Key.Up, SlimDXKey.UpArrow }, - { Silk.NET.Input.Key.PageUp, SlimDXKey.PageUp }, - { Silk.NET.Input.Key.Left, SlimDXKey.LeftArrow }, - { Silk.NET.Input.Key.Right, SlimDXKey.RightArrow }, - { Silk.NET.Input.Key.End, SlimDXKey.End }, - { Silk.NET.Input.Key.Down, SlimDXKey.DownArrow }, - { Silk.NET.Input.Key.PageDown, SlimDXKey.PageDown }, - { Silk.NET.Input.Key.Insert, SlimDXKey.Insert }, - { Silk.NET.Input.Key.Delete, SlimDXKey.Delete }, - { Silk.NET.Input.Key.SuperLeft, SlimDXKey.LeftWindowsKey }, - { Silk.NET.Input.Key.SuperRight, SlimDXKey.RightWindowsKey }, - { Silk.NET.Input.Key.Menu, SlimDXKey.Applications }, - /* - { Silk.NET.Input.Key.Unknown, SlimDXKey.Power }, - { Silk.NET.Input.Key.Unknown, SlimDXKey.Sleep }, - { Silk.NET.Input.Key.Unknown, SlimDXKey.Wake }, - { Silk.NET.Input.Key.Unknown, SlimDXKey.WebSearch }, - { Silk.NET.Input.Key.Unknown, SlimDXKey.WebFavorites }, - { Silk.NET.Input.Key.Unknown, SlimDXKey.WebRefresh }, - { Silk.NET.Input.Key.Unknown, SlimDXKey.WebStop }, - { Silk.NET.Input.Key.Unknown, SlimDXKey.WebForward }, - { Silk.NET.Input.Key.Unknown, SlimDXKey.WebBack }, - { Silk.NET.Input.Key.Unknown, SlimDXKey.MyComputer }, - { Silk.NET.Input.Key.Unknown, SlimDXKey.Mail }, - { Silk.NET.Input.Key.Unknown, SlimDXKey.MediaSelect }, - */ - }; + public static Key DIKtoKey(Silk.NET.Input.Key key) { + return _DIKtoKey[key]; } + + + /// + /// DIK (SharpDX.DirectInput.Key) から SlimDX.DirectInput.Key への変換表。 + /// + private static Dictionary _DIKtoKey = new Dictionary() { + { Silk.NET.Input.Key.Unknown, SlimDXKey.Unknown }, + { Silk.NET.Input.Key.Escape, SlimDXKey.Escape }, + { Silk.NET.Input.Key.Number1, SlimDXKey.D1 }, + { Silk.NET.Input.Key.Number2, SlimDXKey.D2 }, + { Silk.NET.Input.Key.Number3, SlimDXKey.D3 }, + { Silk.NET.Input.Key.Number4, SlimDXKey.D4 }, + { Silk.NET.Input.Key.Number5, SlimDXKey.D5 }, + { Silk.NET.Input.Key.Number6, SlimDXKey.D6 }, + { Silk.NET.Input.Key.Number7, SlimDXKey.D7 }, + { Silk.NET.Input.Key.Number8, SlimDXKey.D8 }, + { Silk.NET.Input.Key.Number9, SlimDXKey.D9 }, + { Silk.NET.Input.Key.Number0, SlimDXKey.D0 }, + { Silk.NET.Input.Key.Minus, SlimDXKey.Minus }, + { Silk.NET.Input.Key.Equal, SlimDXKey.Equals }, + { Silk.NET.Input.Key.Backspace, SlimDXKey.Backspace }, + { Silk.NET.Input.Key.Tab, SlimDXKey.Tab }, + { Silk.NET.Input.Key.Q, SlimDXKey.Q }, + { Silk.NET.Input.Key.W, SlimDXKey.W }, + { Silk.NET.Input.Key.E, SlimDXKey.E }, + { Silk.NET.Input.Key.R, SlimDXKey.R }, + { Silk.NET.Input.Key.T, SlimDXKey.T }, + { Silk.NET.Input.Key.Y, SlimDXKey.Y }, + { Silk.NET.Input.Key.U, SlimDXKey.U }, + { Silk.NET.Input.Key.I, SlimDXKey.I }, + { Silk.NET.Input.Key.O, SlimDXKey.O }, + { Silk.NET.Input.Key.P, SlimDXKey.P }, + { Silk.NET.Input.Key.LeftBracket, SlimDXKey.LeftBracket }, + { Silk.NET.Input.Key.RightBracket, SlimDXKey.RightBracket }, + { Silk.NET.Input.Key.Enter, SlimDXKey.Return }, + { Silk.NET.Input.Key.ControlLeft, SlimDXKey.LeftControl }, + { Silk.NET.Input.Key.A, SlimDXKey.A }, + { Silk.NET.Input.Key.S, SlimDXKey.S }, + { Silk.NET.Input.Key.D, SlimDXKey.D }, + { Silk.NET.Input.Key.F, SlimDXKey.F }, + { Silk.NET.Input.Key.G, SlimDXKey.G }, + { Silk.NET.Input.Key.H, SlimDXKey.H }, + { Silk.NET.Input.Key.J, SlimDXKey.J }, + { Silk.NET.Input.Key.K, SlimDXKey.K }, + { Silk.NET.Input.Key.L, SlimDXKey.L }, + { Silk.NET.Input.Key.Semicolon, SlimDXKey.Semicolon }, + { Silk.NET.Input.Key.Apostrophe, SlimDXKey.Apostrophe }, + { Silk.NET.Input.Key.GraveAccent, SlimDXKey.Grave }, + { Silk.NET.Input.Key.ShiftLeft, SlimDXKey.LeftShift }, + { Silk.NET.Input.Key.BackSlash, SlimDXKey.Backslash }, + { Silk.NET.Input.Key.Z, SlimDXKey.Z }, + { Silk.NET.Input.Key.X, SlimDXKey.X }, + { Silk.NET.Input.Key.C, SlimDXKey.C }, + { Silk.NET.Input.Key.V, SlimDXKey.V }, + { Silk.NET.Input.Key.B, SlimDXKey.B }, + { Silk.NET.Input.Key.N, SlimDXKey.N }, + { Silk.NET.Input.Key.M, SlimDXKey.M }, + { Silk.NET.Input.Key.Comma, SlimDXKey.Comma }, + { Silk.NET.Input.Key.Period, SlimDXKey.Period }, + { Silk.NET.Input.Key.Slash, SlimDXKey.Slash }, + { Silk.NET.Input.Key.ShiftRight, SlimDXKey.RightShift }, + { Silk.NET.Input.Key.KeypadMultiply, SlimDXKey.NumberPadStar }, + { Silk.NET.Input.Key.AltLeft, SlimDXKey.LeftAlt }, + { Silk.NET.Input.Key.Space, SlimDXKey.Space }, + { Silk.NET.Input.Key.CapsLock, SlimDXKey.CapsLock }, + { Silk.NET.Input.Key.F1, SlimDXKey.F1 }, + { Silk.NET.Input.Key.F2, SlimDXKey.F2 }, + { Silk.NET.Input.Key.F3, SlimDXKey.F3 }, + { Silk.NET.Input.Key.F4, SlimDXKey.F4 }, + { Silk.NET.Input.Key.F5, SlimDXKey.F5 }, + { Silk.NET.Input.Key.F6, SlimDXKey.F6 }, + { Silk.NET.Input.Key.F7, SlimDXKey.F7 }, + { Silk.NET.Input.Key.F8, SlimDXKey.F8 }, + { Silk.NET.Input.Key.F9, SlimDXKey.F9 }, + { Silk.NET.Input.Key.F10, SlimDXKey.F10 }, + { Silk.NET.Input.Key.NumLock, SlimDXKey.NumberLock }, + { Silk.NET.Input.Key.ScrollLock, SlimDXKey.ScrollLock }, + { Silk.NET.Input.Key.Keypad7, SlimDXKey.NumberPad7 }, + { Silk.NET.Input.Key.Keypad8, SlimDXKey.NumberPad8 }, + { Silk.NET.Input.Key.Keypad9, SlimDXKey.NumberPad9 }, + { Silk.NET.Input.Key.KeypadSubtract, SlimDXKey.NumberPadMinus }, + { Silk.NET.Input.Key.Keypad4, SlimDXKey.NumberPad4 }, + { Silk.NET.Input.Key.Keypad5, SlimDXKey.NumberPad5 }, + { Silk.NET.Input.Key.Keypad6, SlimDXKey.NumberPad6 }, + { Silk.NET.Input.Key.KeypadAdd, SlimDXKey.NumberPadPlus }, + { Silk.NET.Input.Key.Keypad1, SlimDXKey.NumberPad1 }, + { Silk.NET.Input.Key.Keypad2, SlimDXKey.NumberPad2 }, + { Silk.NET.Input.Key.Keypad3, SlimDXKey.NumberPad3 }, + { Silk.NET.Input.Key.Keypad0, SlimDXKey.NumberPad0 }, + { Silk.NET.Input.Key.KeypadDecimal, SlimDXKey.NumberPadPeriod }, + { Silk.NET.Input.Key.F11, SlimDXKey.F11 }, + { Silk.NET.Input.Key.F12, SlimDXKey.F12 }, + { Silk.NET.Input.Key.F13, SlimDXKey.F13 }, + { Silk.NET.Input.Key.F14, SlimDXKey.F14 }, + { Silk.NET.Input.Key.F15, SlimDXKey.F15 }, + /* + { Silk.NET.Input.Key.Unknown, SlimDXKey.Kana }, + { Silk.NET.Input.Key.Unknown, SlimDXKey.AbntC1 }, + { Silk.NET.Input.Key.Unknown, SlimDXKey.Convert }, + { Silk.NET.Input.Key.Unknown, SlimDXKey.NoConvert }, + { Silk.NET.Input.Key.Unknown, SlimDXKey.Yen }, + { Silk.NET.Input.Key.Unknown, SlimDXKey.AbntC2 }, + */ + { Silk.NET.Input.Key.KeypadEqual, SlimDXKey.NumberPadEquals }, + /* + { Silk.NET.Input.Key.Unknown, SlimDXKey.PreviousTrack }, + { Silk.NET.Input.Key.Unknown, SlimDXKey.AT }, + */ + //{ Silk.NET.Input.Key.Semicolon, SlimDXKey.Colon }, + /* + { Silk.NET.Input.Key.Unknown, SlimDXKey.Underline }, + { Silk.NET.Input.Key.Unknown, SlimDXKey.Kanji }, + { Silk.NET.Input.Key.Unknown, SlimDXKey.Stop }, + { Silk.NET.Input.Key.Unknown, SlimDXKey.AX }, + { Silk.NET.Input.Key.Unknown, SlimDXKey.Unlabeled }, + { Silk.NET.Input.Key.Unknown, SlimDXKey.NextTrack }, + */ + { Silk.NET.Input.Key.KeypadEnter, SlimDXKey.NumberPadEnter }, + { Silk.NET.Input.Key.ControlRight, SlimDXKey.RightControl }, + /* + { Silk.NET.Input.Key.Unknown, SlimDXKey.Mute }, + { Silk.NET.Input.Key.Unknown, SlimDXKey.Calculator }, + */ + /* + { Silk.NET.Input.Key.Unknown, SlimDXKey.MediaStop }, + { Silk.NET.Input.Key.Unknown, SlimDXKey.VolumeDown }, + { Silk.NET.Input.Key.Unknown, SlimDXKey.VolumeUp }, + { Silk.NET.Input.Key.Unknown, SlimDXKey.WebHome }, + */ + { Silk.NET.Input.Key.PrintScreen, SlimDXKey.PrintScreen }, + { Silk.NET.Input.Key.AltRight, SlimDXKey.RightAlt }, + { Silk.NET.Input.Key.Pause, SlimDXKey.Pause }, + { Silk.NET.Input.Key.Home, SlimDXKey.Home }, + { Silk.NET.Input.Key.Up, SlimDXKey.UpArrow }, + { Silk.NET.Input.Key.PageUp, SlimDXKey.PageUp }, + { Silk.NET.Input.Key.Left, SlimDXKey.LeftArrow }, + { Silk.NET.Input.Key.Right, SlimDXKey.RightArrow }, + { Silk.NET.Input.Key.End, SlimDXKey.End }, + { Silk.NET.Input.Key.Down, SlimDXKey.DownArrow }, + { Silk.NET.Input.Key.PageDown, SlimDXKey.PageDown }, + { Silk.NET.Input.Key.Insert, SlimDXKey.Insert }, + { Silk.NET.Input.Key.Delete, SlimDXKey.Delete }, + { Silk.NET.Input.Key.SuperLeft, SlimDXKey.LeftWindowsKey }, + { Silk.NET.Input.Key.SuperRight, SlimDXKey.RightWindowsKey }, + { Silk.NET.Input.Key.Menu, SlimDXKey.Applications }, + /* + { Silk.NET.Input.Key.Unknown, SlimDXKey.Power }, + { Silk.NET.Input.Key.Unknown, SlimDXKey.Sleep }, + { Silk.NET.Input.Key.Unknown, SlimDXKey.Wake }, + { Silk.NET.Input.Key.Unknown, SlimDXKey.WebSearch }, + { Silk.NET.Input.Key.Unknown, SlimDXKey.WebFavorites }, + { Silk.NET.Input.Key.Unknown, SlimDXKey.WebRefresh }, + { Silk.NET.Input.Key.Unknown, SlimDXKey.WebStop }, + { Silk.NET.Input.Key.Unknown, SlimDXKey.WebForward }, + { Silk.NET.Input.Key.Unknown, SlimDXKey.WebBack }, + { Silk.NET.Input.Key.Unknown, SlimDXKey.MyComputer }, + { Silk.NET.Input.Key.Unknown, SlimDXKey.Mail }, + { Silk.NET.Input.Key.Unknown, SlimDXKey.MediaSelect }, + */ + }; } diff --git a/FDK/src/02.Input/IInputDevice.cs b/FDK/src/02.Input/IInputDevice.cs index 349b785b..0a3c2c13 100644 --- a/FDK/src/02.Input/IInputDevice.cs +++ b/FDK/src/02.Input/IInputDevice.cs @@ -1,34 +1,34 @@ -namespace FDK { - public interface IInputDevice : IDisposable { - // Properties +namespace FDK; - InputDeviceType CurrentType { - get; - } - string GUID { - get; - } - int ID { - get; - } - string Name { - get; - } - List InputEvents { - get; - } +public interface IInputDevice : IDisposable { + // Properties - - // メソッドインターフェース - - void Polling(bool bバッファ入力を使用する); - bool KeyPressed(int nKey); - bool KeyPressed(List nKey) { return nKey.Any(key => KeyPressed(key)); } - bool KeyPressing(int nKey); - bool KeyPressing(List nKey) { return nKey.Any(key => KeyPressing(key)); } - bool KeyReleased(int nKey); - bool KeyReleased(List nKey) { return nKey.Any(key => KeyReleased(key)); } - bool KeyReleasing(int nKey); - bool KeyReleasing(List nKey) { return nKey.Any(key => KeyReleasing(key)); } + InputDeviceType CurrentType { + get; } + string GUID { + get; + } + int ID { + get; + } + string Name { + get; + } + List InputEvents { + get; + } + + + // メソッドインターフェース + + void Polling(bool bバッファ入力を使用する); + bool KeyPressed(int nKey); + bool KeyPressed(List nKey) { return nKey.Any(key => KeyPressed(key)); } + bool KeyPressing(int nKey); + bool KeyPressing(List nKey) { return nKey.Any(key => KeyPressing(key)); } + bool KeyReleased(int nKey); + bool KeyReleased(List nKey) { return nKey.Any(key => KeyReleased(key)); } + bool KeyReleasing(int nKey); + bool KeyReleasing(List nKey) { return nKey.Any(key => KeyReleasing(key)); } } diff --git a/FDK/src/02.Input/InputDeviceType.cs b/FDK/src/02.Input/InputDeviceType.cs index 54667c9b..f1844137 100644 --- a/FDK/src/02.Input/InputDeviceType.cs +++ b/FDK/src/02.Input/InputDeviceType.cs @@ -1,12 +1,11 @@ -namespace FDK { - // 定数 +namespace FDK; +// 定数 - public enum InputDeviceType { - Keyboard, - Mouse, - Joystick, - Gamepad, - MidiIn, - Unknown - } +public enum InputDeviceType { + Keyboard, + Mouse, + Joystick, + Gamepad, + MidiIn, + Unknown } diff --git a/FDK/src/02.Input/STInputEvent.cs b/FDK/src/02.Input/STInputEvent.cs index 904b7858..361ffb5f 100644 --- a/FDK/src/02.Input/STInputEvent.cs +++ b/FDK/src/02.Input/STInputEvent.cs @@ -1,14 +1,13 @@ using System.Runtime.InteropServices; -namespace FDK { - // 構造体 +namespace FDK; +// 構造体 - [StructLayout(LayoutKind.Sequential)] - public struct STInputEvent { - public int nKey { get; set; } - public bool Pressed { get; set; } - public bool Released { get; set; } - public long nTimeStamp { get; set; } - public int nVelocity { get; set; } - } +[StructLayout(LayoutKind.Sequential)] +public struct STInputEvent { + public int nKey { get; set; } + public bool Pressed { get; set; } + public bool Released { get; set; } + public long nTimeStamp { get; set; } + public int nVelocity { get; set; } } diff --git a/FDK/src/02.Input/SlimDXKeys.cs b/FDK/src/02.Input/SlimDXKeys.cs index 1d8796d2..e49f1be9 100644 --- a/FDK/src/02.Input/SlimDXKeys.cs +++ b/FDK/src/02.Input/SlimDXKeys.cs @@ -1,162 +1,162 @@ -namespace SlimDXKeys { - public enum Key { - D0 = 0, - D1 = 1, - D2 = 2, - D3 = 3, - D4 = 4, - D5 = 5, - D6 = 6, - D7 = 7, - D8 = 8, - D9 = 9, - A = 10, - B = 11, - C = 12, - D = 13, - E = 14, - F = 15, - G = 16, - H = 17, - I = 18, - J = 19, - K = 20, - L = 21, - M = 22, - N = 23, - O = 24, - P = 25, - Q = 26, - R = 27, - S = 28, - T = 29, - U = 30, - V = 31, - W = 32, - X = 33, - Y = 34, - Z = 35, - AbntC1 = 36, - AbntC2 = 37, - Apostrophe = 38, - Applications = 39, - AT = 40, - AX = 41, - Backspace = 42, - Backslash = 43, - Calculator = 44, - CapsLock = 45, - Colon = 46, - Comma = 47, - Convert = 48, - Delete = 49, - DownArrow = 50, - End = 51, - Equals = 52, - Escape = 53, - F1 = 54, - F2 = 55, - F3 = 56, - F4 = 57, - F5 = 58, - F6 = 59, - F7 = 60, - F8 = 61, - F9 = 62, - F10 = 63, - F11 = 64, - F12 = 65, - F13 = 66, - F14 = 67, - F15 = 68, - Grave = 69, - Home = 70, - Insert = 71, - Kana = 72, - Kanji = 73, - LeftBracket = 74, - LeftControl = 75, - LeftArrow = 76, - LeftAlt = 77, - LeftShift = 78, - LeftWindowsKey = 79, - Mail = 80, - MediaSelect = 81, - MediaStop = 82, - Minus = 83, - Mute = 84, - MyComputer = 85, - NextTrack = 86, - NoConvert = 87, - NumberLock = 88, - NumberPad0 = 89, - NumberPad1 = 90, - NumberPad2 = 91, - NumberPad3 = 92, - NumberPad4 = 93, - NumberPad5 = 94, - NumberPad6 = 95, - NumberPad7 = 96, - NumberPad8 = 97, - NumberPad9 = 98, - NumberPadComma = 99, - NumberPadEnter = 100, - NumberPadEquals = 101, - NumberPadMinus = 102, - NumberPadPeriod = 103, - NumberPadPlus = 104, - NumberPadSlash = 105, - NumberPadStar = 106, - Oem102 = 107, - PageDown = 108, - PageUp = 109, - Pause = 110, - Period = 111, - PlayPause = 112, - Power = 113, - PreviousTrack = 114, - RightBracket = 115, - RightControl = 116, - Return = 117, - RightArrow = 118, - RightAlt = 119, - RightShift = 120, - RightWindowsKey = 121, - ScrollLock = 122, - Semicolon = 123, - Slash = 124, - Sleep = 125, - Space = 126, - Stop = 127, - PrintScreen = 128, - Tab = 129, - Underline = 130, - Unlabeled = 131, - UpArrow = 132, - VolumeDown = 133, - VolumeUp = 134, - Wake = 135, - WebBack = 136, - WebFavorites = 137, - WebForward = 138, - WebHome = 139, - WebRefresh = 140, - WebSearch = 141, - WebStop = 142, - Yen = 143, - Unknown = 144 - } - public enum MouseObject { - Button1 = 0, - Button2 = 1, - Button3 = 2, - Button4 = 3, - Button5 = 4, - Button6 = 5, - Button7 = 6, - Button8 = 7, - XAxis = 8, - YAxis = 9, - ZAxis = 10 - } +namespace SlimDXKeys; + +public enum Key { + D0 = 0, + D1 = 1, + D2 = 2, + D3 = 3, + D4 = 4, + D5 = 5, + D6 = 6, + D7 = 7, + D8 = 8, + D9 = 9, + A = 10, + B = 11, + C = 12, + D = 13, + E = 14, + F = 15, + G = 16, + H = 17, + I = 18, + J = 19, + K = 20, + L = 21, + M = 22, + N = 23, + O = 24, + P = 25, + Q = 26, + R = 27, + S = 28, + T = 29, + U = 30, + V = 31, + W = 32, + X = 33, + Y = 34, + Z = 35, + AbntC1 = 36, + AbntC2 = 37, + Apostrophe = 38, + Applications = 39, + AT = 40, + AX = 41, + Backspace = 42, + Backslash = 43, + Calculator = 44, + CapsLock = 45, + Colon = 46, + Comma = 47, + Convert = 48, + Delete = 49, + DownArrow = 50, + End = 51, + Equals = 52, + Escape = 53, + F1 = 54, + F2 = 55, + F3 = 56, + F4 = 57, + F5 = 58, + F6 = 59, + F7 = 60, + F8 = 61, + F9 = 62, + F10 = 63, + F11 = 64, + F12 = 65, + F13 = 66, + F14 = 67, + F15 = 68, + Grave = 69, + Home = 70, + Insert = 71, + Kana = 72, + Kanji = 73, + LeftBracket = 74, + LeftControl = 75, + LeftArrow = 76, + LeftAlt = 77, + LeftShift = 78, + LeftWindowsKey = 79, + Mail = 80, + MediaSelect = 81, + MediaStop = 82, + Minus = 83, + Mute = 84, + MyComputer = 85, + NextTrack = 86, + NoConvert = 87, + NumberLock = 88, + NumberPad0 = 89, + NumberPad1 = 90, + NumberPad2 = 91, + NumberPad3 = 92, + NumberPad4 = 93, + NumberPad5 = 94, + NumberPad6 = 95, + NumberPad7 = 96, + NumberPad8 = 97, + NumberPad9 = 98, + NumberPadComma = 99, + NumberPadEnter = 100, + NumberPadEquals = 101, + NumberPadMinus = 102, + NumberPadPeriod = 103, + NumberPadPlus = 104, + NumberPadSlash = 105, + NumberPadStar = 106, + Oem102 = 107, + PageDown = 108, + PageUp = 109, + Pause = 110, + Period = 111, + PlayPause = 112, + Power = 113, + PreviousTrack = 114, + RightBracket = 115, + RightControl = 116, + Return = 117, + RightArrow = 118, + RightAlt = 119, + RightShift = 120, + RightWindowsKey = 121, + ScrollLock = 122, + Semicolon = 123, + Slash = 124, + Sleep = 125, + Space = 126, + Stop = 127, + PrintScreen = 128, + Tab = 129, + Underline = 130, + Unlabeled = 131, + UpArrow = 132, + VolumeDown = 133, + VolumeUp = 134, + Wake = 135, + WebBack = 136, + WebFavorites = 137, + WebForward = 138, + WebHome = 139, + WebRefresh = 140, + WebSearch = 141, + WebStop = 142, + Yen = 143, + Unknown = 144 +} +public enum MouseObject { + Button1 = 0, + Button2 = 1, + Button3 = 2, + Button4 = 3, + Button5 = 4, + Button6 = 5, + Button7 = 6, + Button8 = 7, + XAxis = 8, + YAxis = 9, + ZAxis = 10 } diff --git a/FDK/src/03.Sound/CSound.cs b/FDK/src/03.Sound/CSound.cs index 609d09be..f580f948 100644 --- a/FDK/src/03.Sound/CSound.cs +++ b/FDK/src/03.Sound/CSound.cs @@ -8,735 +8,734 @@ using ManagedBass.Fx; using ManagedBass.Mix; -namespace FDK { - // CSound は、サウンドデバイスが変更されたときも、インスタンスを再作成することなく、新しいデバイスで作り直せる必要がある。 - // そのため、デバイスごとに別のクラスに分割するのではなく、1つのクラスに集約するものとする。 +namespace FDK; +// CSound は、サウンドデバイスが変更されたときも、インスタンスを再作成することなく、新しいデバイスで作り直せる必要がある。 +// そのため、デバイスごとに別のクラスに分割するのではなく、1つのクラスに集約するものとする。 - public class CSound : IDisposable { - public const int MinimumSongVol = 0; - public const int MaximumSongVol = 200; // support an approximate doubling in volume. - public const int DefaultSongVol = 100; +public class CSound : IDisposable { + public const int MinimumSongVol = 0; + public const int MaximumSongVol = 200; // support an approximate doubling in volume. + public const int DefaultSongVol = 100; - // 2018-08-19 twopointzero: Note the present absence of a MinimumAutomationLevel. - // We will revisit this if/when song select BGM fade-in/fade-out needs - // updating due to changing the type or range of AutomationLevel - public const int MaximumAutomationLevel = 100; - public const int DefaultAutomationLevel = 100; + // 2018-08-19 twopointzero: Note the present absence of a MinimumAutomationLevel. + // We will revisit this if/when song select BGM fade-in/fade-out needs + // updating due to changing the type or range of AutomationLevel + public const int MaximumAutomationLevel = 100; + public const int DefaultAutomationLevel = 100; - public const int MinimumGroupLevel = 0; - public const int MaximumGroupLevel = 100; - public const int DefaultGroupLevel = 100; - public const int DefaultSoundEffectLevel = 80; - public const int DefaultVoiceLevel = 90; - public const int DefaultSongPreviewLevel = 90; - public const int DefaultSongPlaybackLevel = 90; + public const int MinimumGroupLevel = 0; + public const int MaximumGroupLevel = 100; + public const int DefaultGroupLevel = 100; + public const int DefaultSoundEffectLevel = 80; + public const int DefaultVoiceLevel = 90; + public const int DefaultSongPreviewLevel = 90; + public const int DefaultSongPlaybackLevel = 90; - public static readonly Lufs MinimumLufs = new Lufs(-100.0); - public static readonly Lufs MaximumLufs = new Lufs(10.0); // support an approximate doubling in volume. + public static readonly Lufs MinimumLufs = new Lufs(-100.0); + public static readonly Lufs MaximumLufs = new Lufs(10.0); // support an approximate doubling in volume. - private static readonly Lufs DefaultGain = new Lufs(0.0); + private static readonly Lufs DefaultGain = new Lufs(0.0); - public readonly ESoundGroup SoundGroup; + public readonly ESoundGroup SoundGroup; - #region [ DTXMania用拡張 ] + #region [ DTXMania用拡張 ] - public int TotalPlayTime { - get; - private set; + public int TotalPlayTime { + get; + private set; + } + public int SoundBufferSize // 取りあえず0固定★★★★★★★★★★★★★★★★★★★★ + { + get { return 0; } + } + public bool IsStreamPlay // 取りあえずfalse固定★★★★★★★★★★★★★★★★★★★★ + // trueにすると同一チップ音の多重再生で問題が出る(4POLY音源として動かない) + { + get { return false; } + } + public double Frequency { + get { + return _Frequency; } - public int SoundBufferSize // 取りあえず0固定★★★★★★★★★★★★★★★★★★★★ - { - get { return 0; } - } - public bool IsStreamPlay // 取りあえずfalse固定★★★★★★★★★★★★★★★★★★★★ - // trueにすると同一チップ音の多重再生で問題が出る(4POLY音源として動かない) - { - get { return false; } - } - public double Frequency { - get { - return _Frequency; + set { + if (_Frequency != value) { + _Frequency = value; + if (IsBassSound) { + Bass.ChannelSetAttribute(this.hBassStream, ChannelAttribute.Frequency, (float)(_Frequency * _PlaySpeed * nオリジナルの周波数)); + } } - set { - if (_Frequency != value) { - _Frequency = value; - if (IsBassSound) { + } + } + public double PlaySpeed { + get { + return _PlaySpeed; + } + set { + if (_PlaySpeed != value) { + _PlaySpeed = value; + IsNormalSpeed = (_PlaySpeed == 1.000f); + if (IsBassSound) { + if (_hTempoStream != 0 && !this.IsNormalSpeed) // 再生速度がx1.000のときは、TempoStreamを用いないようにして高速化する + { + this.hBassStream = _hTempoStream; + } else { + this.hBassStream = _hBassStream; + } + + if (SoundManager.bIsTimeStretch) { + Bass.ChannelSetAttribute(this.hBassStream, ChannelAttribute.Tempo, (float)(PlaySpeed * 100 - 100)); + //double seconds = Bass.BASS_ChannelBytes2Seconds( this.hTempoStream, nBytes ); + //this.n総演奏時間ms = (int) ( seconds * 1000 ); + } else { Bass.ChannelSetAttribute(this.hBassStream, ChannelAttribute.Frequency, (float)(_Frequency * _PlaySpeed * nオリジナルの周波数)); } } } } - public double PlaySpeed { - get { - return _PlaySpeed; - } - set { - if (_PlaySpeed != value) { - _PlaySpeed = value; - IsNormalSpeed = (_PlaySpeed == 1.000f); - if (IsBassSound) { - if (_hTempoStream != 0 && !this.IsNormalSpeed) // 再生速度がx1.000のときは、TempoStreamを用いないようにして高速化する - { - this.hBassStream = _hTempoStream; - } else { - this.hBassStream = _hBassStream; - } + } + #endregion - if (SoundManager.bIsTimeStretch) { - Bass.ChannelSetAttribute(this.hBassStream, ChannelAttribute.Tempo, (float)(PlaySpeed * 100 - 100)); - //double seconds = Bass.BASS_ChannelBytes2Seconds( this.hTempoStream, nBytes ); - //this.n総演奏時間ms = (int) ( seconds * 1000 ); - } else { - Bass.ChannelSetAttribute(this.hBassStream, ChannelAttribute.Frequency, (float)(_Frequency * _PlaySpeed * nオリジナルの周波数)); - } - } - } - } - } - #endregion + public bool b速度上げすぎ問題 = false; + public bool b演奏終了後も再生が続くチップである = false; // これがtrueなら、本サウンドの再生終了のコールバック時に自動でミキサーから削除する - public bool b速度上げすぎ問題 = false; - public bool b演奏終了後も再生が続くチップである = false; // これがtrueなら、本サウンドの再生終了のコールバック時に自動でミキサーから削除する + private SyncProcedure _cbEndofStream; - private SyncProcedure _cbEndofStream; + /// + /// Gain is applied "first" to the audio data, much as in a physical or + /// software mixer. Later steps in the flow of audio apply "channel" level + /// (e.g. AutomationLevel) and mixing group level (e.g. GroupLevel) before + /// the audio is output. + /// + /// This method, taking an integer representing a percent value, is used + /// for mixing in the SONGVOL value, when available. It is also used for + /// DTXViewer preview mode. + /// + public void SetGain(int songVol) { + SetGain(LinearIntegerPercentToLufs(songVol), null); + } - /// - /// Gain is applied "first" to the audio data, much as in a physical or - /// software mixer. Later steps in the flow of audio apply "channel" level - /// (e.g. AutomationLevel) and mixing group level (e.g. GroupLevel) before - /// the audio is output. - /// - /// This method, taking an integer representing a percent value, is used - /// for mixing in the SONGVOL value, when available. It is also used for - /// DTXViewer preview mode. - /// - public void SetGain(int songVol) { - SetGain(LinearIntegerPercentToLufs(songVol), null); + private static Lufs LinearIntegerPercentToLufs(int percent) { + // 2018-08-27 twopointzero: We'll use the standard conversion until an appropriate curve can be selected + return new Lufs(20.0 * Math.Log10(percent / 100.0)); + } + + /// + /// Gain is applied "first" to the audio data, much as in a physical or + /// software mixer. Later steps in the flow of audio apply "channel" level + /// (e.g. AutomationLevel) and mixing group level (e.g. GroupLevel) before + /// the audio is output. + /// + /// This method, taking a LUFS gain value and a LUFS true audio peak value, + /// is used for mixing in the loudness-metadata-base gain value, when available. + /// + public void SetGain(Lufs gain, Lufs? truePeak) { + if (Equals(_gain, gain)) { + return; } - private static Lufs LinearIntegerPercentToLufs(int percent) { - // 2018-08-27 twopointzero: We'll use the standard conversion until an appropriate curve can be selected - return new Lufs(20.0 * Math.Log10(percent / 100.0)); + _gain = gain; + _truePeak = truePeak; + + if (SoundGroup == ESoundGroup.SongPlayback) { + Trace.TraceInformation($"{nameof(CSound)}.{nameof(SetGain)}: Gain: {_gain}. True Peak: {_truePeak}"); } - /// - /// Gain is applied "first" to the audio data, much as in a physical or - /// software mixer. Later steps in the flow of audio apply "channel" level - /// (e.g. AutomationLevel) and mixing group level (e.g. GroupLevel) before - /// the audio is output. - /// - /// This method, taking a LUFS gain value and a LUFS true audio peak value, - /// is used for mixing in the loudness-metadata-base gain value, when available. - /// - public void SetGain(Lufs gain, Lufs? truePeak) { - if (Equals(_gain, gain)) { + SetVolume(); + } + + /// + /// AutomationLevel is applied "second" to the audio data, much as in a + /// physical or sofware mixer and its channel level. Before this Gain is + /// applied, and after this the mixing group level is applied. + /// + /// This is currently used only for automated fade in and out as is the + /// case right now for the song selection screen background music fade + /// in and fade out. + /// + public int AutomationLevel { + get => _automationLevel; + set { + if (_automationLevel == value) { return; } - _gain = gain; - _truePeak = truePeak; + _automationLevel = value; if (SoundGroup == ESoundGroup.SongPlayback) { - Trace.TraceInformation($"{nameof(CSound)}.{nameof(SetGain)}: Gain: {_gain}. True Peak: {_truePeak}"); + Trace.TraceInformation($"{nameof(CSound)}.{nameof(AutomationLevel)} set: {AutomationLevel}"); } SetVolume(); } + } - /// - /// AutomationLevel is applied "second" to the audio data, much as in a - /// physical or sofware mixer and its channel level. Before this Gain is - /// applied, and after this the mixing group level is applied. - /// - /// This is currently used only for automated fade in and out as is the - /// case right now for the song selection screen background music fade - /// in and fade out. - /// - public int AutomationLevel { - get => _automationLevel; - set { - if (_automationLevel == value) { - return; - } - - _automationLevel = value; - - if (SoundGroup == ESoundGroup.SongPlayback) { - Trace.TraceInformation($"{nameof(CSound)}.{nameof(AutomationLevel)} set: {AutomationLevel}"); - } - - SetVolume(); + /// + /// GroupLevel is applied "third" to the audio data, much as in the sub + /// mixer groups of a physical or software mixer. Before this both the + /// Gain and AutomationLevel are applied, and after this the audio + /// flows into the audio subsystem for mixing and output based on the + /// master volume. + /// + /// This is currently automatically managed for each sound based on the + /// configured and dynamically adjustable sound group levels for each of + /// sound effects, voice, song preview, and song playback. + /// + /// See the SoundGroupLevelController and related classes for more. + /// + public int GroupLevel { + private get => _groupLevel; + set { + if (_groupLevel == value) { + return; } - } - /// - /// GroupLevel is applied "third" to the audio data, much as in the sub - /// mixer groups of a physical or software mixer. Before this both the - /// Gain and AutomationLevel are applied, and after this the audio - /// flows into the audio subsystem for mixing and output based on the - /// master volume. - /// - /// This is currently automatically managed for each sound based on the - /// configured and dynamically adjustable sound group levels for each of - /// sound effects, voice, song preview, and song playback. - /// - /// See the SoundGroupLevelController and related classes for more. - /// - public int GroupLevel { - private get => _groupLevel; - set { - if (_groupLevel == value) { - return; - } - - _groupLevel = value; - - if (SoundGroup == ESoundGroup.SongPlayback) { - Trace.TraceInformation($"{nameof(CSound)}.{nameof(GroupLevel)} set: {GroupLevel}"); - } - - SetVolume(); - } - } - - private void SetVolume() { - var automationLevel = LinearIntegerPercentToLufs(AutomationLevel); - var groupLevel = LinearIntegerPercentToLufs(GroupLevel); - - var gain = - _gain + - automationLevel + - groupLevel; - - var safeTruePeakGain = _truePeak?.Negate() ?? new Lufs(0); - var finalGain = gain.Min(safeTruePeakGain); + _groupLevel = value; if (SoundGroup == ESoundGroup.SongPlayback) { - Trace.TraceInformation( - $"{nameof(CSound)}.{nameof(SetVolume)}: Gain:{_gain}. Automation Level: {automationLevel}. Group Level: {groupLevel}. Summed Gain: {gain}. Safe True Peak Gain: {safeTruePeakGain}. Final Gain: {finalGain}."); + Trace.TraceInformation($"{nameof(CSound)}.{nameof(GroupLevel)} set: {GroupLevel}"); } - lufs音量 = finalGain; + SetVolume(); + } + } + + private void SetVolume() { + var automationLevel = LinearIntegerPercentToLufs(AutomationLevel); + var groupLevel = LinearIntegerPercentToLufs(GroupLevel); + + var gain = + _gain + + automationLevel + + groupLevel; + + var safeTruePeakGain = _truePeak?.Negate() ?? new Lufs(0); + var finalGain = gain.Min(safeTruePeakGain); + + if (SoundGroup == ESoundGroup.SongPlayback) { + Trace.TraceInformation( + $"{nameof(CSound)}.{nameof(SetVolume)}: Gain:{_gain}. Automation Level: {automationLevel}. Group Level: {groupLevel}. Summed Gain: {gain}. Safe True Peak Gain: {safeTruePeakGain}. Final Gain: {finalGain}."); } - private Lufs lufs音量 { - set { - if (this.IsBassSound) { - var db音量 = ((value.ToDouble() / 100.0) + 1.0).Clamp(0, 1); - Bass.ChannelSetAttribute(this._hBassStream, ChannelAttribute.Volume, (float)db音量); - Bass.ChannelSetAttribute(this._hTempoStream, ChannelAttribute.Volume, (float)db音量); + lufs音量 = finalGain; + } + + private Lufs lufs音量 { + set { + if (this.IsBassSound) { + var db音量 = ((value.ToDouble() / 100.0) + 1.0).Clamp(0, 1); + Bass.ChannelSetAttribute(this._hBassStream, ChannelAttribute.Volume, (float)db音量); + Bass.ChannelSetAttribute(this._hTempoStream, ChannelAttribute.Volume, (float)db音量); + } + } + } + + /// + /// 左:-100~中央:0~100:右。set のみ。 + /// + public int SoundPosition { + get { + if (this.IsBassSound) { + float f位置 = 0.0f; + if (!Bass.ChannelGetAttribute(this.hBassStream, ChannelAttribute.Pan, out f位置)) + //if( BassMix.BASS_Mixer_ChannelGetEnvelopePos( this.hBassStream, BASSMIXEnvelope.BASS_MIXER_ENV_PAN, ref f位置 ) == -1 ) + return 0; + return (int)(f位置 * 100); + } + return -9999; + } + set { + if (this.IsBassSound) { + float f位置 = Math.Min(Math.Max(value, -100), 100) / 100.0f; // -100~100 → -1.0~1.0 + //var nodes = new BASS_MIXER_NODE[ 1 ] { new BASS_MIXER_NODE( 0, f位置 ) }; + //BassMix.BASS_Mixer_ChannelSetEnvelope( this.hBassStream, BASSMIXEnvelope.BASS_MIXER_ENV_PAN, nodes ); + Bass.ChannelSetAttribute(this.hBassStream, ChannelAttribute.Pan, f位置); + } + } + } + + /// + /// 全インスタンスリスト。 + /// ~を作成する() で追加され、t解放する() or Dispose() で解放される。 + /// + public static readonly ObservableCollection SoundInstances = new ObservableCollection(); + + public static void ShowAllCSoundFiles() { + int i = 0; + foreach (CSound cs in SoundInstances) { + Debug.WriteLine(i++.ToString("d3") + ": " + Path.GetFileName(cs.FileName)); + } + } + + public CSound(ESoundGroup soundGroup) { + SoundGroup = soundGroup; + this.SoundPosition = 0; + this._Frequency = 1.0; + this._PlaySpeed = 1.0; + // this._cbRemoveMixerChannel = new WaitCallback( RemoveMixerChannelLater ); + this._hBassStream = -1; + this._hTempoStream = 0; + } + + public void CreateBassSound(string fileName, int hMixer) { + this.CurrentSoundDeviceType = ESoundDeviceType.Bass; // 作成後に設定する。(作成に失敗してると例外発出されてここは実行されない) + this.CreateBassSound(fileName, hMixer, BassFlags.Decode); + } + public void CreateASIOSound(string fileName, int hMixer) { + this.CurrentSoundDeviceType = ESoundDeviceType.ASIO; // 作成後に設定する。(作成に失敗してると例外発出されてここは実行されない) + this.CreateBassSound(fileName, hMixer, BassFlags.Decode); + } + public void CreateWASAPISound(string fileName, int hMixer, ESoundDeviceType deviceType) { + this.CurrentSoundDeviceType = deviceType; // 作成後に設定する。(作成に失敗してると例外発出されてここは実行されない) + this.CreateBassSound(fileName, hMixer, BassFlags.Decode | BassFlags.Float); + } + + #region [ DTXMania用の変換 ] + + public void DisposeSound(CSound cs) { + cs.tDispose(); + } + public void PlayStart() { + tSetPositonToBegin(); + if (!b速度上げすぎ問題) + tPlaySound(false); + } + public void PlayStart(bool looped) { + if (IsBassSound) { + if (looped) { + Bass.ChannelFlags(this.hBassStream, BassFlags.Loop, BassFlags.Loop); + } else { + Bass.ChannelFlags(this.hBassStream, BassFlags.Default, BassFlags.Default); + } + } + tSetPositonToBegin(); + tPlaySound(looped); + } + public void Stop() { + tStopSound(); + tSetPositonToBegin(); + } + public void Pause() { + tStopSound(true); + this.PauseCount++; + } + public void Resume(long t) // ★★★★★★★★★★★★★★★★★★★★★★★★★★★★ + { + Debug.WriteLine("t再生を再開する(long " + t + ")"); + tSetPositonToBegin(t); + tPlaySound(); + this.PauseCount--; + } + public bool IsPaused { + get { + if (this.IsBassSound) { + bool ret = (!BassMixExtensions.ChannelIsPlaying(this.hBassStream)) & + (BassMix.ChannelGetPosition(this.hBassStream) > 0); + return ret; + } else { + return (this.PauseCount > 0); + } + } + } + public bool IsPlaying { + get { + // 基本的にはBASS_ACTIVE_PLAYINGなら再生中だが、最後まで再生しきったchannelも + // BASS_ACTIVE_PLAYINGのままになっているので、小細工が必要。 + bool ret = (BassMixExtensions.ChannelIsPlaying(this.hBassStream)); + if (BassMix.ChannelGetPosition(this.hBassStream) >= nBytes) { + ret = false; + } + return ret; + } + } + //public lint t時刻から位置を返す( long t ) + //{ + // double num = ( n時刻 * this.db再生速度 ) * this.db周波数倍率; + // return (int) ( ( num * 0.01 ) * this.nSamplesPerSecond ); + //} + #endregion + + + public void tDispose() { + tDispose(false); + } + + public void tDispose(bool deleteInstance) { + if (this.IsBassSound) // stream数の削減用 + { + tRemoveSoundFromMixer(); + //_cbStreamXA = null; + SoundManager.nStreams--; + } + bool disposeWithManaged = true; + this.Dispose(disposeWithManaged, deleteInstance); + //Debug.WriteLine( "Disposed: " + _bインスタンス削除 + " : " + Path.GetFileName( this.strファイル名 ) ); + } + public void tPlaySound() { + tPlaySound(false); + } + private void tPlaySound(bool bループする) { + if (this.IsBassSound) // BASSサウンド時のループ処理は、t再生を開始する()側に実装。ここでは「bループする」は未使用。 + { + //Debug.WriteLine( "再生中?: " + System.IO.Path.GetFileName(this.strファイル名) + " status=" + BassMix.BASS_Mixer_ChannelIsActive( this.hBassStream ) + " current=" + BassMix.BASS_Mixer_ChannelGetPosition( this.hBassStream ) + " nBytes=" + nBytes ); + bool b = BassMixExtensions.ChannelPlay(this.hBassStream); + if (!b) { + //Debug.WriteLine( "再生しようとしたが、Mixerに登録されていなかった: " + Path.GetFileName( this.strファイル名 ) + ", stream#=" + this.hBassStream + ", ErrCode=" + Bass.BASS_ErrorGetCode() ); + + bool bb = AddBassSoundFromMixer(); + if (!bb) { + Debug.WriteLine("Mixerへの登録に失敗: " + Path.GetFileName(this.FileName) + ", ErrCode=" + Bass.LastError); + } else { + //Debug.WriteLine( "Mixerへの登録に成功: " + Path.GetFileName( this.strファイル名 ) + ": " + Bass.BASS_ErrorGetCode() ); + } + //this.t再生位置を先頭に戻す(); + + bool bbb = BassMixExtensions.ChannelPlay(this.hBassStream); + if (!bbb) { + Debug.WriteLine("更に再生に失敗: " + Path.GetFileName(this.FileName) + ", ErrCode=" + Bass.LastError); + } else { + // Debug.WriteLine("再生成功(ミキサー追加後) : " + Path.GetFileName(this.strファイル名)); + } + } else { + //Debug.WriteLine( "再生成功: " + Path.GetFileName( this.strファイル名 ) + " (" + hBassStream + ")" ); + } + } + } + public void tStopSoundAndRemoveSoundFromMixer() { + tStopSound(false); + if (IsBassSound) { + tRemoveSoundFromMixer(); + } + } + public void tStopSound() { + tStopSound(false); + } + public void tStopSound(bool pause) { + if (this.IsBassSound) { + //Debug.WriteLine( "停止: " + System.IO.Path.GetFileName( this.strファイル名 ) + " status=" + BassMix.BASS_Mixer_ChannelIsActive( this.hBassStream ) + " current=" + BassMix.BASS_Mixer_ChannelGetPosition( this.hBassStream ) + " nBytes=" + nBytes ); + BassMixExtensions.ChannelPause(this.hBassStream); + if (!pause) { + // tBASSサウンドをミキサーから削除する(); // PAUSEと再生停止を区別できるようにすること!! + } + } + this.PauseCount = 0; + } + + public void tSetPositonToBegin() { + if (this.IsBassSound) { + BassMix.ChannelSetPosition(this.hBassStream, 0); + //pos = 0; + } + } + public void tSetPositonToBegin(long positionMs) { + if (this.IsBassSound) { + bool b = true; + try { + b = BassMix.ChannelSetPosition(this.hBassStream, Bass.ChannelSeconds2Bytes(this.hBassStream, positionMs * this.Frequency * this.PlaySpeed / 1000.0), PositionFlags.Bytes); + } catch (Exception e) { + Trace.TraceError(e.ToString()); + Trace.TraceInformation(Path.GetFileName(this.FileName) + ": Seek error: " + e.ToString() + ": " + positionMs + "ms"); + } finally { + if (!b) { + Errors be = Bass.LastError; + Trace.TraceInformation(Path.GetFileName(this.FileName) + ": Seek error: " + be.ToString() + ": " + positionMs + "MS"); } } + //if ( this.n総演奏時間ms > 5000 ) + //{ + // Trace.TraceInformation( Path.GetFileName( this.strファイル名 ) + ": Seeked to " + n位置ms + "ms = " + Bass.BASS_ChannelSeconds2Bytes( this.hBassStream, n位置ms * this.db周波数倍率 * this.db再生速度 / 1000.0 ) ); + //} } + } + /// + /// デバッグ用 + /// + /// + /// + public void tGetPlayPositon(out long positionByte, out double positionMs) { + if (this.IsBassSound) { + positionByte = BassMix.ChannelGetPosition(this.hBassStream); + positionMs = Bass.ChannelBytes2Seconds(this.hBassStream, positionByte); + } else { + positionByte = 0; + positionMs = 0.0; + } + } - /// - /// 左:-100~中央:0~100:右。set のみ。 - /// - public int SoundPosition { - get { - if (this.IsBassSound) { - float f位置 = 0.0f; - if (!Bass.ChannelGetAttribute(this.hBassStream, ChannelAttribute.Pan, out f位置)) - //if( BassMix.BASS_Mixer_ChannelGetEnvelopePos( this.hBassStream, BASSMIXEnvelope.BASS_MIXER_ENV_PAN, ref f位置 ) == -1 ) - return 0; - return (int)(f位置 * 100); - } - return -9999; - } - set { - if (this.IsBassSound) { - float f位置 = Math.Min(Math.Max(value, -100), 100) / 100.0f; // -100~100 → -1.0~1.0 - //var nodes = new BASS_MIXER_NODE[ 1 ] { new BASS_MIXER_NODE( 0, f位置 ) }; - //BassMix.BASS_Mixer_ChannelSetEnvelope( this.hBassStream, BASSMIXEnvelope.BASS_MIXER_ENV_PAN, nodes ); - Bass.ChannelSetAttribute(this.hBassStream, ChannelAttribute.Pan, f位置); - } + + public static void tResetAllSound() { + foreach (var sound in CSound.SoundInstances) { + sound.tDispose(false); + } + } + internal static void tReloadSound(ISoundDevice device) { + if (CSound.SoundInstances.Count == 0) + return; + + + // サウンドを再生する際にインスタンスリストも更新されるので、配列にコピーを取っておき、リストはクリアする。 + + var sounds = CSound.SoundInstances.ToArray(); + CSound.SoundInstances.Clear(); + + + // 配列に基づいて個々のサウンドを作成する。 + + for (int i = 0; i < sounds.Length; i++) { + switch (sounds[i].CurrnetCreateType) { + #region [ ファイルから ] + case CreateType.FromFile: + string strファイル名 = sounds[i].FileName; + sounds[i].Dispose(true, false); + device.tCreateSound(strファイル名, sounds[i]); + break; + #endregion } } + } - /// - /// 全インスタンスリスト。 - /// ~を作成する() で追加され、t解放する() or Dispose() で解放される。 - /// - public static readonly ObservableCollection SoundInstances = new ObservableCollection(); - - public static void ShowAllCSoundFiles() { - int i = 0; - foreach (CSound cs in SoundInstances) { - Debug.WriteLine(i++.ToString("d3") + ": " + Path.GetFileName(cs.FileName)); + #region [ Dispose-Finalizeパターン実装 ] + //----------------- + public void Dispose() { + this.Dispose(true, true); + GC.SuppressFinalize(this); + } + private void Dispose(bool deleteWithManaged, bool deleteInstance) { + if (this.IsBassSound) { + #region [ ASIO, WASAPI の解放 ] + //----------------- + if (_hTempoStream != 0) { + BassMix.MixerRemoveChannel(this._hTempoStream); + Bass.StreamFree(this._hTempoStream); } - } - - public CSound(ESoundGroup soundGroup) { - SoundGroup = soundGroup; - this.SoundPosition = 0; - this._Frequency = 1.0; - this._PlaySpeed = 1.0; - // this._cbRemoveMixerChannel = new WaitCallback( RemoveMixerChannelLater ); + BassMix.MixerRemoveChannel(this._hBassStream); + Bass.StreamFree(this._hBassStream); + this.hBassStream = -1; this._hBassStream = -1; this._hTempoStream = 0; + //----------------- + #endregion } - public void CreateBassSound(string fileName, int hMixer) { - this.CurrentSoundDeviceType = ESoundDeviceType.Bass; // 作成後に設定する。(作成に失敗してると例外発出されてここは実行されない) - this.CreateBassSound(fileName, hMixer, BassFlags.Decode); - } - public void CreateASIOSound(string fileName, int hMixer) { - this.CurrentSoundDeviceType = ESoundDeviceType.ASIO; // 作成後に設定する。(作成に失敗してると例外発出されてここは実行されない) - this.CreateBassSound(fileName, hMixer, BassFlags.Decode); - } - public void CreateWASAPISound(string fileName, int hMixer, ESoundDeviceType deviceType) { - this.CurrentSoundDeviceType = deviceType; // 作成後に設定する。(作成に失敗してると例外発出されてここは実行されない) - this.CreateBassSound(fileName, hMixer, BassFlags.Decode | BassFlags.Float); - } + if (deleteWithManaged) { + //int freeIndex = -1; - #region [ DTXMania用の変換 ] + //if ( CSound.listインスタンス != null ) + //{ + // freeIndex = CSound.listインスタンス.IndexOf( this ); + // if ( freeIndex == -1 ) + // { + // Debug.WriteLine( "ERR: freeIndex==-1 : Count=" + CSound.listインスタンス.Count + ", filename=" + Path.GetFileName( this.strファイル名 ) ); + // } + //} - public void DisposeSound(CSound cs) { - cs.tDispose(); - } - public void PlayStart() { - tSetPositonToBegin(); - if (!b速度上げすぎ問題) - tPlaySound(false); - } - public void PlayStart(bool looped) { - if (IsBassSound) { - if (looped) { - Bass.ChannelFlags(this.hBassStream, BassFlags.Loop, BassFlags.Loop); - } else { - Bass.ChannelFlags(this.hBassStream, BassFlags.Default, BassFlags.Default); - } - } - tSetPositonToBegin(); - tPlaySound(looped); - } - public void Stop() { - tStopSound(); - tSetPositonToBegin(); - } - public void Pause() { - tStopSound(true); - this.PauseCount++; - } - public void Resume(long t) // ★★★★★★★★★★★★★★★★★★★★★★★★★★★★ - { - Debug.WriteLine("t再生を再開する(long " + t + ")"); - tSetPositonToBegin(t); - tPlaySound(); - this.PauseCount--; - } - public bool IsPaused { - get { - if (this.IsBassSound) { - bool ret = (!BassMixExtensions.ChannelIsPlaying(this.hBassStream)) & - (BassMix.ChannelGetPosition(this.hBassStream) > 0); - return ret; - } else { - return (this.PauseCount > 0); - } - } - } - public bool IsPlaying { - get { - // 基本的にはBASS_ACTIVE_PLAYINGなら再生中だが、最後まで再生しきったchannelも - // BASS_ACTIVE_PLAYINGのままになっているので、小細工が必要。 - bool ret = (BassMixExtensions.ChannelIsPlaying(this.hBassStream)); - if (BassMix.ChannelGetPosition(this.hBassStream) >= nBytes) { - ret = false; - } - return ret; - } - } - //public lint t時刻から位置を返す( long t ) - //{ - // double num = ( n時刻 * this.db再生速度 ) * this.db周波数倍率; - // return (int) ( ( num * 0.01 ) * this.nSamplesPerSecond ); - //} - #endregion + this.CurrentSoundDeviceType = ESoundDeviceType.Unknown; - - public void tDispose() { - tDispose(false); - } - - public void tDispose(bool deleteInstance) { - if (this.IsBassSound) // stream数の削減用 - { - tRemoveSoundFromMixer(); - //_cbStreamXA = null; - SoundManager.nStreams--; - } - bool disposeWithManaged = true; - this.Dispose(disposeWithManaged, deleteInstance); - //Debug.WriteLine( "Disposed: " + _bインスタンス削除 + " : " + Path.GetFileName( this.strファイル名 ) ); - } - public void tPlaySound() { - tPlaySound(false); - } - private void tPlaySound(bool bループする) { - if (this.IsBassSound) // BASSサウンド時のループ処理は、t再生を開始する()側に実装。ここでは「bループする」は未使用。 - { - //Debug.WriteLine( "再生中?: " + System.IO.Path.GetFileName(this.strファイル名) + " status=" + BassMix.BASS_Mixer_ChannelIsActive( this.hBassStream ) + " current=" + BassMix.BASS_Mixer_ChannelGetPosition( this.hBassStream ) + " nBytes=" + nBytes ); - bool b = BassMixExtensions.ChannelPlay(this.hBassStream); + if (deleteInstance) { + //try + //{ + // CSound.listインスタンス.RemoveAt( freeIndex ); + //} + //catch + //{ + // Debug.WriteLine( "FAILED to remove CSound.listインスタンス: Count=" + CSound.listインスタンス.Count + ", filename=" + Path.GetFileName( this.strファイル名 ) ); + //} + bool b = CSound.SoundInstances.Remove(this); // これだと、Clone()したサウンドのremoveに失敗する if (!b) { - //Debug.WriteLine( "再生しようとしたが、Mixerに登録されていなかった: " + Path.GetFileName( this.strファイル名 ) + ", stream#=" + this.hBassStream + ", ErrCode=" + Bass.BASS_ErrorGetCode() ); - - bool bb = AddBassSoundFromMixer(); - if (!bb) { - Debug.WriteLine("Mixerへの登録に失敗: " + Path.GetFileName(this.FileName) + ", ErrCode=" + Bass.LastError); - } else { - //Debug.WriteLine( "Mixerへの登録に成功: " + Path.GetFileName( this.strファイル名 ) + ": " + Bass.BASS_ErrorGetCode() ); - } - //this.t再生位置を先頭に戻す(); - - bool bbb = BassMixExtensions.ChannelPlay(this.hBassStream); - if (!bbb) { - Debug.WriteLine("更に再生に失敗: " + Path.GetFileName(this.FileName) + ", ErrCode=" + Bass.LastError); - } else { - // Debug.WriteLine("再生成功(ミキサー追加後) : " + Path.GetFileName(this.strファイル名)); - } - } else { - //Debug.WriteLine( "再生成功: " + Path.GetFileName( this.strファイル名 ) + " (" + hBassStream + ")" ); + Debug.WriteLine("FAILED to remove CSound.listインスタンス: Count=" + CSound.SoundInstances.Count + ", filename=" + Path.GetFileName(this.FileName)); } + } } - public void tStopSoundAndRemoveSoundFromMixer() { - tStopSound(false); - if (IsBassSound) { - tRemoveSoundFromMixer(); - } - } - public void tStopSound() { - tStopSound(false); - } - public void tStopSound(bool pause) { - if (this.IsBassSound) { - //Debug.WriteLine( "停止: " + System.IO.Path.GetFileName( this.strファイル名 ) + " status=" + BassMix.BASS_Mixer_ChannelIsActive( this.hBassStream ) + " current=" + BassMix.BASS_Mixer_ChannelGetPosition( this.hBassStream ) + " nBytes=" + nBytes ); - BassMixExtensions.ChannelPause(this.hBassStream); - if (!pause) { - // tBASSサウンドをミキサーから削除する(); // PAUSEと再生停止を区別できるようにすること!! - } - } - this.PauseCount = 0; - } - - public void tSetPositonToBegin() { - if (this.IsBassSound) { - BassMix.ChannelSetPosition(this.hBassStream, 0); - //pos = 0; - } - } - public void tSetPositonToBegin(long positionMs) { - if (this.IsBassSound) { - bool b = true; - try { - b = BassMix.ChannelSetPosition(this.hBassStream, Bass.ChannelSeconds2Bytes(this.hBassStream, positionMs * this.Frequency * this.PlaySpeed / 1000.0), PositionFlags.Bytes); - } catch (Exception e) { - Trace.TraceError(e.ToString()); - Trace.TraceInformation(Path.GetFileName(this.FileName) + ": Seek error: " + e.ToString() + ": " + positionMs + "ms"); - } finally { - if (!b) { - Errors be = Bass.LastError; - Trace.TraceInformation(Path.GetFileName(this.FileName) + ": Seek error: " + be.ToString() + ": " + positionMs + "MS"); - } - } - //if ( this.n総演奏時間ms > 5000 ) - //{ - // Trace.TraceInformation( Path.GetFileName( this.strファイル名 ) + ": Seeked to " + n位置ms + "ms = " + Bass.BASS_ChannelSeconds2Bytes( this.hBassStream, n位置ms * this.db周波数倍率 * this.db再生速度 / 1000.0 ) ); - //} - } - } - /// - /// デバッグ用 - /// - /// - /// - public void tGetPlayPositon(out long positionByte, out double positionMs) { - if (this.IsBassSound) { - positionByte = BassMix.ChannelGetPosition(this.hBassStream); - positionMs = Bass.ChannelBytes2Seconds(this.hBassStream, positionByte); - } else { - positionByte = 0; - positionMs = 0.0; - } - } - - - public static void tResetAllSound() { - foreach (var sound in CSound.SoundInstances) { - sound.tDispose(false); - } - } - internal static void tReloadSound(ISoundDevice device) { - if (CSound.SoundInstances.Count == 0) - return; - - - // サウンドを再生する際にインスタンスリストも更新されるので、配列にコピーを取っておき、リストはクリアする。 - - var sounds = CSound.SoundInstances.ToArray(); - CSound.SoundInstances.Clear(); - - - // 配列に基づいて個々のサウンドを作成する。 - - for (int i = 0; i < sounds.Length; i++) { - switch (sounds[i].CurrnetCreateType) { - #region [ ファイルから ] - case CreateType.FromFile: - string strファイル名 = sounds[i].FileName; - sounds[i].Dispose(true, false); - device.tCreateSound(strファイル名, sounds[i]); - break; - #endregion - } - } - } - - #region [ Dispose-Finalizeパターン実装 ] - //----------------- - public void Dispose() { - this.Dispose(true, true); - GC.SuppressFinalize(this); - } - private void Dispose(bool deleteWithManaged, bool deleteInstance) { - if (this.IsBassSound) { - #region [ ASIO, WASAPI の解放 ] - //----------------- - if (_hTempoStream != 0) { - BassMix.MixerRemoveChannel(this._hTempoStream); - Bass.StreamFree(this._hTempoStream); - } - BassMix.MixerRemoveChannel(this._hBassStream); - Bass.StreamFree(this._hBassStream); - this.hBassStream = -1; - this._hBassStream = -1; - this._hTempoStream = 0; - //----------------- - #endregion - } - - if (deleteWithManaged) { - //int freeIndex = -1; - - //if ( CSound.listインスタンス != null ) - //{ - // freeIndex = CSound.listインスタンス.IndexOf( this ); - // if ( freeIndex == -1 ) - // { - // Debug.WriteLine( "ERR: freeIndex==-1 : Count=" + CSound.listインスタンス.Count + ", filename=" + Path.GetFileName( this.strファイル名 ) ); - // } - //} - - this.CurrentSoundDeviceType = ESoundDeviceType.Unknown; - - if (deleteInstance) { - //try - //{ - // CSound.listインスタンス.RemoveAt( freeIndex ); - //} - //catch - //{ - // Debug.WriteLine( "FAILED to remove CSound.listインスタンス: Count=" + CSound.listインスタンス.Count + ", filename=" + Path.GetFileName( this.strファイル名 ) ); - //} - bool b = CSound.SoundInstances.Remove(this); // これだと、Clone()したサウンドのremoveに失敗する - if (!b) { - Debug.WriteLine("FAILED to remove CSound.listインスタンス: Count=" + CSound.SoundInstances.Count + ", filename=" + Path.GetFileName(this.FileName)); - } - - } - } - } - ~CSound() { - this.Dispose(false, true); - } - //----------------- - #endregion - - #region [ protected ] - //----------------- - protected enum CreateType { FromFile, Unknown } - protected CreateType CurrnetCreateType = CreateType.Unknown; - protected ESoundDeviceType CurrentSoundDeviceType = ESoundDeviceType.Unknown; - public string FileName = null; - protected GCHandle hGC; - protected int _hTempoStream = 0; - protected int _hBassStream = -1; // ASIO, WASAPI 用 - protected int hBassStream = 0; // #31076 2013.4.1 yyagi; プロパティとして実装すると動作が低速になったため、 - // tBASSサウンドを作成する_ストリーム生成後の共通処理()のタイミングと、 - // 再生速度を変更したタイミングでのみ、 - // hBassStreamを更新するようにした。 - //{ - // get - // { - // if ( _hTempoStream != 0 && !this.bIs1倍速再生 ) // 再生速度がx1.000のときは、TempoStreamを用いないようにして高速化する - // { - // return _hTempoStream; - // } - // else - // { - // return _hBassStream; - // } - // } - // set - // { - // _hBassStream = value; - // } - //} - protected int hMixer = -1; // 設計壊してゴメン Mixerに後で登録するときに使う - //----------------- - #endregion - - #region [ private ] - //----------------- - private bool IsBassSound { - get { - return ( - this.CurrentSoundDeviceType == ESoundDeviceType.Bass || - this.CurrentSoundDeviceType == ESoundDeviceType.ASIO || - this.CurrentSoundDeviceType == ESoundDeviceType.ExclusiveWASAPI || - this.CurrentSoundDeviceType == ESoundDeviceType.SharedWASAPI); - } - } - private int _n位置 = 0; - private int _n位置db; - private Lufs _gain = DefaultGain; - private Lufs? _truePeak = null; - private int _automationLevel = DefaultAutomationLevel; - private int _groupLevel = DefaultGroupLevel; - private long nBytes = 0; - private int PauseCount = 0; - private int nオリジナルの周波数 = 0; - private double _Frequency = 1.0; - private double _PlaySpeed = 1.0; - private bool IsNormalSpeed = true; - - public void CreateBassSound(string strファイル名, int hMixer, BassFlags flags) { - this.CurrnetCreateType = CreateType.FromFile; - this.FileName = strファイル名; - - - // BASSファイルストリームを作成。 - - this._hBassStream = Bass.CreateStream(strファイル名, 0, 0, flags); - if (this._hBassStream == 0) - throw new Exception(string.Format("サウンドストリームの生成に失敗しました。(BASS_StreamCreateFile)[{0}]", Bass.LastError.ToString())); - - nBytes = Bass.ChannelGetLength(this._hBassStream); - - tBASSサウンドを作成する_ストリーム生成後の共通処理(hMixer); - } - - private void tBASSサウンドを作成する_ストリーム生成後の共通処理(int hMixer) { - SoundManager.nStreams++; - - // 個々のストリームの出力をテンポ変更のストリームに入力する。テンポ変更ストリームの出力を、Mixerに出力する。 - - // if ( CSound管理.bIsTimeStretch ) // TimeStretchのON/OFFに関わりなく、テンポ変更のストリームを生成する。後からON/OFF切り替え可能とするため。 - { - this._hTempoStream = BassFx.TempoCreate(this._hBassStream, BassFlags.Decode | BassFlags.FxFreeSource); - if (this._hTempoStream == 0) { - hGC.Free(); - throw new Exception(string.Format("サウンドストリームの生成に失敗しました。(BASS_FX_TempoCreate)[{0}]", Bass.LastError.ToString())); - } else { - Bass.ChannelSetAttribute(this._hTempoStream, ChannelAttribute.TempoUseQuickAlgorithm, 1f); // 高速化(音の品質は少し落ちる) - } - } - - if (_hTempoStream != 0 && !this.IsNormalSpeed) // 再生速度がx1.000のときは、TempoStreamを用いないようにして高速化する - { - this.hBassStream = _hTempoStream; - } else { - this.hBassStream = _hBassStream; - } - - // #32248 再生終了時に発火するcallbackを登録する (演奏終了後に再生終了するチップを非同期的にミキサーから削除するため。) - _cbEndofStream = new SyncProcedure(CallbackEndofStream); - Bass.ChannelSetSync(hBassStream, SyncFlags.End | SyncFlags.Mixtime, 0, _cbEndofStream, IntPtr.Zero); - - // n総演奏時間の取得; DTXMania用に追加。 - double seconds = Bass.ChannelBytes2Seconds(this._hBassStream, nBytes); - this.TotalPlayTime = (int)(seconds * 1000); - //this.pos = 0; - this.hMixer = hMixer; - float freq = 0.0f; - if (!Bass.ChannelGetAttribute(this._hBassStream, ChannelAttribute.Frequency, out freq)) { - hGC.Free(); - throw new Exception(string.Format("サウンドストリームの周波数取得に失敗しました。(BASS_ChannelGetAttribute)[{0}]", Bass.LastError.ToString())); - } - this.nオリジナルの周波数 = (int)freq; - - // インスタンスリストに登録。 - - CSound.SoundInstances.Add(this); - } - //----------------- - - //private int pos = 0; - //private int CallbackPlayingXA( int handle, IntPtr buffer, int length, IntPtr user ) - //{ - // int bytesread = ( pos + length > Convert.ToInt32( nBytes ) ) ? Convert.ToInt32( nBytes ) - pos : length; - - // Marshal.Copy( byArrWAVファイルイメージ, pos, buffer, bytesread ); - // pos += bytesread; - // if ( pos >= nBytes ) - // { - // // set indicator flag - // bytesread |= (int) BASSStreamProc.BASS_STREAMPROC_END; - // } - // return bytesread; - //} - /// - /// ストリームの終端まで再生したときに呼び出されるコールバック - /// - /// - /// - /// - /// - private void CallbackEndofStream(int handle, int channel, int data, IntPtr user) // #32248 2013.10.14 yyagi - { - // Trace.TraceInformation( "Callback!(remove): " + Path.GetFileName( this.strファイル名 ) ); - if (b演奏終了後も再生が続くチップである) // 演奏終了後に再生終了するチップ音のミキサー削除は、再生終了のコールバックに引っ掛けて、自前で行う。 - { // そうでないものは、ミキサー削除予定時刻に削除する。 - RemoveBassSoundFromMixer(channel); - } - } - - // mixerからの削除 - - public bool tRemoveSoundFromMixer() { - return RemoveBassSoundFromMixer(this.hBassStream); - } - public bool RemoveBassSoundFromMixer(int channel) { - bool b = BassMix.MixerRemoveChannel(channel); - if (b) { - Interlocked.Decrement(ref SoundManager.nMixing); - // Debug.WriteLine( "Removed: " + Path.GetFileName( this.strファイル名 ) + " (" + channel + ")" + " MixedStreams=" + CSound管理.nMixing ); - } - return b; - } - - - // mixer への追加 - - public bool AddBassSoundFromMixer() { - if (BassMix.ChannelGetMixer(hBassStream) == 0) { - BassFlags bf = BassFlags.SpeakerFront | BassFlags.MixerChanNoRampin | BassFlags.MixerChanPause; - Interlocked.Increment(ref SoundManager.nMixing); - - // preloadされることを期待して、敢えてflagからはBASS_MIXER_PAUSEを外してAddChannelした上で、すぐにPAUSEする - // -> ChannelUpdateでprebufferできることが分かったため、BASS_MIXER_PAUSEを使用することにした - - bool b1 = BassMix.MixerAddChannel(this.hMixer, this.hBassStream, bf); - //bool b2 = BassMix.BASS_Mixer_ChannelPause( this.hBassStream ); - tSetPositonToBegin(); // StreamAddChannelの後で再生位置を戻さないとダメ。逆だと再生位置が変わらない。 - //Trace.TraceInformation( "Add Mixer: " + Path.GetFileName( this.strファイル名 ) + " (" + hBassStream + ")" + " MixedStreams=" + CSound管理.nMixing ); - Bass.ChannelUpdate(this.hBassStream, 0); // pre-buffer - return b1; // &b2; - } - return true; - } - - #endregion } + ~CSound() { + this.Dispose(false, true); + } + //----------------- + #endregion + + #region [ protected ] + //----------------- + protected enum CreateType { FromFile, Unknown } + protected CreateType CurrnetCreateType = CreateType.Unknown; + protected ESoundDeviceType CurrentSoundDeviceType = ESoundDeviceType.Unknown; + public string FileName = null; + protected GCHandle hGC; + protected int _hTempoStream = 0; + protected int _hBassStream = -1; // ASIO, WASAPI 用 + protected int hBassStream = 0; // #31076 2013.4.1 yyagi; プロパティとして実装すると動作が低速になったため、 + // tBASSサウンドを作成する_ストリーム生成後の共通処理()のタイミングと、 + // 再生速度を変更したタイミングでのみ、 + // hBassStreamを更新するようにした。 + //{ + // get + // { + // if ( _hTempoStream != 0 && !this.bIs1倍速再生 ) // 再生速度がx1.000のときは、TempoStreamを用いないようにして高速化する + // { + // return _hTempoStream; + // } + // else + // { + // return _hBassStream; + // } + // } + // set + // { + // _hBassStream = value; + // } + //} + protected int hMixer = -1; // 設計壊してゴメン Mixerに後で登録するときに使う + //----------------- + #endregion + + #region [ private ] + //----------------- + private bool IsBassSound { + get { + return ( + this.CurrentSoundDeviceType == ESoundDeviceType.Bass || + this.CurrentSoundDeviceType == ESoundDeviceType.ASIO || + this.CurrentSoundDeviceType == ESoundDeviceType.ExclusiveWASAPI || + this.CurrentSoundDeviceType == ESoundDeviceType.SharedWASAPI); + } + } + private int _n位置 = 0; + private int _n位置db; + private Lufs _gain = DefaultGain; + private Lufs? _truePeak = null; + private int _automationLevel = DefaultAutomationLevel; + private int _groupLevel = DefaultGroupLevel; + private long nBytes = 0; + private int PauseCount = 0; + private int nオリジナルの周波数 = 0; + private double _Frequency = 1.0; + private double _PlaySpeed = 1.0; + private bool IsNormalSpeed = true; + + public void CreateBassSound(string strファイル名, int hMixer, BassFlags flags) { + this.CurrnetCreateType = CreateType.FromFile; + this.FileName = strファイル名; + + + // BASSファイルストリームを作成。 + + this._hBassStream = Bass.CreateStream(strファイル名, 0, 0, flags); + if (this._hBassStream == 0) + throw new Exception(string.Format("サウンドストリームの生成に失敗しました。(BASS_StreamCreateFile)[{0}]", Bass.LastError.ToString())); + + nBytes = Bass.ChannelGetLength(this._hBassStream); + + tBASSサウンドを作成する_ストリーム生成後の共通処理(hMixer); + } + + private void tBASSサウンドを作成する_ストリーム生成後の共通処理(int hMixer) { + SoundManager.nStreams++; + + // 個々のストリームの出力をテンポ変更のストリームに入力する。テンポ変更ストリームの出力を、Mixerに出力する。 + + // if ( CSound管理.bIsTimeStretch ) // TimeStretchのON/OFFに関わりなく、テンポ変更のストリームを生成する。後からON/OFF切り替え可能とするため。 + { + this._hTempoStream = BassFx.TempoCreate(this._hBassStream, BassFlags.Decode | BassFlags.FxFreeSource); + if (this._hTempoStream == 0) { + hGC.Free(); + throw new Exception(string.Format("サウンドストリームの生成に失敗しました。(BASS_FX_TempoCreate)[{0}]", Bass.LastError.ToString())); + } else { + Bass.ChannelSetAttribute(this._hTempoStream, ChannelAttribute.TempoUseQuickAlgorithm, 1f); // 高速化(音の品質は少し落ちる) + } + } + + if (_hTempoStream != 0 && !this.IsNormalSpeed) // 再生速度がx1.000のときは、TempoStreamを用いないようにして高速化する + { + this.hBassStream = _hTempoStream; + } else { + this.hBassStream = _hBassStream; + } + + // #32248 再生終了時に発火するcallbackを登録する (演奏終了後に再生終了するチップを非同期的にミキサーから削除するため。) + _cbEndofStream = new SyncProcedure(CallbackEndofStream); + Bass.ChannelSetSync(hBassStream, SyncFlags.End | SyncFlags.Mixtime, 0, _cbEndofStream, IntPtr.Zero); + + // n総演奏時間の取得; DTXMania用に追加。 + double seconds = Bass.ChannelBytes2Seconds(this._hBassStream, nBytes); + this.TotalPlayTime = (int)(seconds * 1000); + //this.pos = 0; + this.hMixer = hMixer; + float freq = 0.0f; + if (!Bass.ChannelGetAttribute(this._hBassStream, ChannelAttribute.Frequency, out freq)) { + hGC.Free(); + throw new Exception(string.Format("サウンドストリームの周波数取得に失敗しました。(BASS_ChannelGetAttribute)[{0}]", Bass.LastError.ToString())); + } + this.nオリジナルの周波数 = (int)freq; + + // インスタンスリストに登録。 + + CSound.SoundInstances.Add(this); + } + //----------------- + + //private int pos = 0; + //private int CallbackPlayingXA( int handle, IntPtr buffer, int length, IntPtr user ) + //{ + // int bytesread = ( pos + length > Convert.ToInt32( nBytes ) ) ? Convert.ToInt32( nBytes ) - pos : length; + + // Marshal.Copy( byArrWAVファイルイメージ, pos, buffer, bytesread ); + // pos += bytesread; + // if ( pos >= nBytes ) + // { + // // set indicator flag + // bytesread |= (int) BASSStreamProc.BASS_STREAMPROC_END; + // } + // return bytesread; + //} + /// + /// ストリームの終端まで再生したときに呼び出されるコールバック + /// + /// + /// + /// + /// + private void CallbackEndofStream(int handle, int channel, int data, IntPtr user) // #32248 2013.10.14 yyagi + { + // Trace.TraceInformation( "Callback!(remove): " + Path.GetFileName( this.strファイル名 ) ); + if (b演奏終了後も再生が続くチップである) // 演奏終了後に再生終了するチップ音のミキサー削除は、再生終了のコールバックに引っ掛けて、自前で行う。 + { // そうでないものは、ミキサー削除予定時刻に削除する。 + RemoveBassSoundFromMixer(channel); + } + } + + // mixerからの削除 + + public bool tRemoveSoundFromMixer() { + return RemoveBassSoundFromMixer(this.hBassStream); + } + public bool RemoveBassSoundFromMixer(int channel) { + bool b = BassMix.MixerRemoveChannel(channel); + if (b) { + Interlocked.Decrement(ref SoundManager.nMixing); + // Debug.WriteLine( "Removed: " + Path.GetFileName( this.strファイル名 ) + " (" + channel + ")" + " MixedStreams=" + CSound管理.nMixing ); + } + return b; + } + + + // mixer への追加 + + public bool AddBassSoundFromMixer() { + if (BassMix.ChannelGetMixer(hBassStream) == 0) { + BassFlags bf = BassFlags.SpeakerFront | BassFlags.MixerChanNoRampin | BassFlags.MixerChanPause; + Interlocked.Increment(ref SoundManager.nMixing); + + // preloadされることを期待して、敢えてflagからはBASS_MIXER_PAUSEを外してAddChannelした上で、すぐにPAUSEする + // -> ChannelUpdateでprebufferできることが分かったため、BASS_MIXER_PAUSEを使用することにした + + bool b1 = BassMix.MixerAddChannel(this.hMixer, this.hBassStream, bf); + //bool b2 = BassMix.BASS_Mixer_ChannelPause( this.hBassStream ); + tSetPositonToBegin(); // StreamAddChannelの後で再生位置を戻さないとダメ。逆だと再生位置が変わらない。 + //Trace.TraceInformation( "Add Mixer: " + Path.GetFileName( this.strファイル名 ) + " (" + hBassStream + ")" + " MixedStreams=" + CSound管理.nMixing ); + Bass.ChannelUpdate(this.hBassStream, 0); // pre-buffer + return b1; // &b2; + } + return true; + } + + #endregion } diff --git a/FDK/src/03.Sound/CSoundDeviceASIO.cs b/FDK/src/03.Sound/CSoundDeviceASIO.cs index 4edacb48..43ebf794 100644 --- a/FDK/src/03.Sound/CSoundDeviceASIO.cs +++ b/FDK/src/03.Sound/CSoundDeviceASIO.cs @@ -3,379 +3,379 @@ using ManagedBass; using ManagedBass.Asio; using ManagedBass.Mix; -namespace FDK { - /// - /// 全ASIOデバイスを列挙する静的クラス。 - /// BASS_Init()やBASS_ASIO_Init()の状態とは無関係に使用可能。 - /// - public static class CEnumerateAllAsioDevices { - public static string[] GetAllASIODevices() { - try { - string[] bassAsioDevName = new string[BassAsio.DeviceCount]; - for (int i = 0; i < bassAsioDevName.Length; i++) - bassAsioDevName[i] = BassAsio.GetDeviceInfo(i).Name; +namespace FDK; - if (bassAsioDevName.Length != 0) - return bassAsioDevName; - } catch (Exception e) { - Trace.TraceWarning($"Exception occured in GetAllASIODevices ({e})"); - } +/// +/// 全ASIOデバイスを列挙する静的クラス。 +/// BASS_Init()やBASS_ASIO_Init()の状態とは無関係に使用可能。 +/// +public static class CEnumerateAllAsioDevices { + public static string[] GetAllASIODevices() { + try { + string[] bassAsioDevName = new string[BassAsio.DeviceCount]; + for (int i = 0; i < bassAsioDevName.Length; i++) + bassAsioDevName[i] = BassAsio.GetDeviceInfo(i).Name; - return new string[] { "None" }; - } - } - - internal class CSoundDeviceASIO : ISoundDevice { - // Properties - - public ESoundDeviceType SoundDeviceType { - get; - protected set; - } - public long OutputDelay { - get; - protected set; - } - public long BufferSize { - get; - protected set; - } - public int ASIODevice { - get; - set; + if (bassAsioDevName.Length != 0) + return bassAsioDevName; + } catch (Exception e) { + Trace.TraceWarning($"Exception occured in GetAllASIODevices ({e})"); } - // CSoundTimer 用に公開しているプロパティ - - public long ElapsedTimeMs { - get; - protected set; - } - public long UpdateSystemTimeMs { - get; - protected set; - } - public CTimer SystemTimer { - get; - protected set; - } - - - // マスターボリュームの制御コードは、WASAPI/ASIOで全く同じ。 - public int nMasterVolume { - get { - float f音量 = 0.0f; - bool b = Bass.ChannelGetAttribute(this.hMixer, ChannelAttribute.Volume, out f音量); - if (!b) { - Errors be = Bass.LastError; - Trace.TraceInformation("ASIO Master Volume Get Error: " + be.ToString()); - } else { - //Trace.TraceInformation( "ASIO Master Volume Get Success: " + (f音量 * 100) ); - - } - return (int)(f音量 * 100); - } - set { - bool b = Bass.ChannelSetAttribute(this.hMixer, ChannelAttribute.Volume, (float)(value / 100.0)); - if (!b) { - Errors be = Bass.LastError; - Trace.TraceInformation("ASIO Master Volume Set Error: " + be.ToString()); - } else { - // int n = this.nMasterVolume; - // Trace.TraceInformation( "ASIO Master Volume Set Success: " + value ); - } - } - } - - // メソッド - - public CSoundDeviceASIO(long bufferSize, int deviceIndex) { - // 初期化。 - - Trace.TraceInformation("BASS (ASIO) の初期化を開始します。"); - this.SoundDeviceType = ESoundDeviceType.Unknown; - this.OutputDelay = 0; - this.ElapsedTimeMs = 0; - this.UpdateSystemTimeMs = CTimer.UnusedNum; - this.SystemTimer = new CTimer(CTimer.TimerType.MultiMedia); - this.ASIODevice = deviceIndex; - - // BASS の設定。 - - this.bIsBASSFree = true; - - if (!Bass.Configure(Configuration.UpdatePeriod, 0)) // 0:BASSストリームの自動更新を行わない。 - { - Trace.TraceWarning($"BASS_SetConfig({nameof(Configuration.UpdatePeriod)}) に失敗しました。[{Bass.LastError.ToString()}]"); - } - if (!Bass.Configure(Configuration.UpdateThreads, 0)) // 0:BASSストリームの自動更新を行わない。 - { - Trace.TraceWarning($"BASS_SetConfig({nameof(Configuration.UpdateThreads)}) に失敗しました。[{Bass.LastError.ToString()}]"); - } - - // BASS の初期化。 - - int nデバイス = 0; // 0:"no device" … BASS からはデバイスへアクセスさせない。アクセスは BASSASIO アドオンから行う。 - int n周波数 = 44100; // 仮決め。最終的な周波数はデバイス(≠ドライバ)が決める。 - if (!Bass.Init(nデバイス, n周波数, DeviceInitFlags.Default, IntPtr.Zero)) - throw new Exception(string.Format("BASS の初期化に失敗しました。(BASS_Init)[{0}]", Bass.LastError.ToString())); - - Bass.Configure(Configuration.LogarithmicVolumeCurve, true); - - //Debug.WriteLine( "BASS_Init()完了。" ); - #region [ デバッグ用: ASIOデバイスのenumerateと、ログ出力 ] - // CEnumerateAllAsioDevices.GetAllASIODevices(); - //Debug.WriteLine( "BassAsio.BASS_ASIO_GetDeviceInfo():" ); - // int a, count = 0; - // BASS_ASIO_DEVICEINFO asioDevInfo; - // for ( a = 0; ( asioDevInfo = BassAsio.BASS_ASIO_GetDeviceInfo( a ) ) != null; a++ ) - // { - // Trace.TraceInformation( "ASIO Device {0}: {1}, driver={2}", a, asioDevInfo.name, asioDevInfo.driver ); - // count++; // count it - // } - #endregion - - // BASS ASIO の初期化。 - AsioInfo asioInfo; - if (BassAsio.Init(ASIODevice, AsioInitFlags.Thread)) // 専用スレッドにて起動 - { - #region [ ASIO の初期化に成功。] - //----------------- - this.SoundDeviceType = ESoundDeviceType.ASIO; - BassAsio.GetInfo(out asioInfo); - this.n出力チャンネル数 = asioInfo.Outputs; - this.db周波数 = BassAsio.Rate; - this.fmtASIOデバイスフォーマット = BassAsio.ChannelGetFormat(false, 0); - - Trace.TraceInformation("BASS を初期化しました。(ASIO, デバイス:\"{0}\", 入力{1}, 出力{2}, {3}Hz, バッファ{4}~{6}sample ({5:0.###}~{7:0.###}ms), デバイスフォーマット:{8})", - asioInfo.Name, - asioInfo.Inputs, - asioInfo.Outputs, - this.db周波数.ToString("0.###"), - asioInfo.MinBufferLength, asioInfo.MinBufferLength * 1000 / this.db周波数, - asioInfo.MaxBufferLength, asioInfo.MaxBufferLength * 1000 / this.db周波数, - this.fmtASIOデバイスフォーマット.ToString() - ); - this.bIsBASSFree = false; - #region [ debug: channel format ] - //BASS_ASIO_CHANNELINFO chinfo = new BASS_ASIO_CHANNELINFO(); - //int chan = 0; - //while ( true ) - //{ - // if ( !BassAsio.BASS_ASIO_ChannelGetInfo( false, chan, chinfo ) ) - // break; - // Debug.WriteLine( "Ch=" + chan + ": " + chinfo.name.ToString() + ", " + chinfo.group.ToString() + ", " + chinfo.format.ToString() ); - // chan++; - //} - #endregion - //----------------- - #endregion - } else { - #region [ ASIO の初期化に失敗。] - //----------------- - Errors errcode = Bass.LastError; - string errmes = errcode.ToString(); - if (errcode == Errors.OK) { - errmes = "BASS_OK; The device may be dissconnected"; - } - Bass.Free(); - this.bIsBASSFree = true; - throw new Exception(string.Format("BASS (ASIO) の初期化に失敗しました。(BASS_ASIO_Init)[{0}]", errmes)); - //----------------- - #endregion - } - - - // ASIO 出力チャンネルの初期化。 - - this.tAsioProc = new AsioProcedure(this.tAsio処理); // アンマネージに渡す delegate は、フィールドとして保持しておかないとGCでアドレスが変わってしまう。 - if (!BassAsio.ChannelEnable(false, 0, this.tAsioProc, IntPtr.Zero)) // 出力チャンネル0 の有効化。 - { - #region [ ASIO 出力チャンネルの初期化に失敗。] - //----------------- - BassAsio.Free(); - Bass.Free(); - this.bIsBASSFree = true; - throw new Exception(string.Format("Failed BASS_ASIO_ChannelEnable() [{0}]", BassAsio.LastError.ToString())); - //----------------- - #endregion - } - for (int i = 1; i < this.n出力チャンネル数; i++) // 出力チャネルを全てチャネル0とグループ化する。 - { // チャネル1だけを0とグループ化すると、3ch以上の出力をサポートしたカードでの動作がおかしくなる - if (!BassAsio.ChannelJoin(false, i, 0)) { - #region [ 初期化に失敗。] - //----------------- - BassAsio.Free(); - Bass.Free(); - this.bIsBASSFree = true; - throw new Exception(string.Format("Failed BASS_ASIO_ChannelJoin({1}) [{0}]", BassAsio.LastError, i)); - //----------------- - #endregion - } - } - if (!BassAsio.ChannelSetFormat(false, 0, this.fmtASIOチャンネルフォーマット)) // 出力チャンネル0のフォーマット - { - #region [ ASIO 出力チャンネルの初期化に失敗。] - //----------------- - BassAsio.Free(); - Bass.Free(); - this.bIsBASSFree = true; - throw new Exception(string.Format("Failed BASS_ASIO_ChannelSetFormat() [{0}]", BassAsio.LastError.ToString())); - //----------------- - #endregion - } - - // ASIO 出力と同じフォーマットを持つ BASS ミキサーを作成。 - - var flag = BassFlags.MixerNonStop | BassFlags.Decode; // デコードのみ=発声しない。ASIO に出力されるだけ。 - if (this.fmtASIOデバイスフォーマット == AsioSampleFormat.Float) - flag |= BassFlags.Float; - this.hMixer = BassMix.CreateMixerStream((int)this.db周波数, this.n出力チャンネル数, flag); - - if (this.hMixer == 0) { - Errors err = Bass.LastError; - BassAsio.Free(); - Bass.Free(); - this.bIsBASSFree = true; - throw new Exception(string.Format("BASSミキサ(mixing)の作成に失敗しました。[{0}]", err)); - } - - // BASS ミキサーの1秒あたりのバイト数を算出。 - - var mixerInfo = Bass.ChannelGetInfo(this.hMixer); - int nサンプルサイズbyte = 0; - switch (this.fmtASIOチャンネルフォーマット) { - case AsioSampleFormat.Bit16: nサンプルサイズbyte = 2; break; - case AsioSampleFormat.Bit24: nサンプルサイズbyte = 3; break; - case AsioSampleFormat.Bit32: nサンプルサイズbyte = 4; break; - case AsioSampleFormat.Float: nサンプルサイズbyte = 4; break; - } - //long nミキサーの1サンプルあたりのバイト数 = /*mixerInfo.chans*/ 2 * nサンプルサイズbyte; - long nミキサーの1サンプルあたりのバイト数 = mixerInfo.Channels * nサンプルサイズbyte; - this.nミキサーの1秒あたりのバイト数 = nミキサーの1サンプルあたりのバイト数 * mixerInfo.Frequency; - - - // 単純に、hMixerの音量をMasterVolumeとして制御しても、 - // ChannelGetData()の内容には反映されない。 - // そのため、もう一段mixerを噛ませて、一段先のmixerからChannelGetData()することで、 - // hMixerの音量制御を反映させる。 - this.hMixer_DeviceOut = BassMix.CreateMixerStream( - (int)this.db周波数, this.n出力チャンネル数, flag); - if (this.hMixer_DeviceOut == 0) { - Errors errcode = Bass.LastError; - BassAsio.Free(); - Bass.Free(); - this.bIsBASSFree = true; - throw new Exception(string.Format("BASSミキサ(最終段)の作成に失敗しました。[{0}]", errcode)); - } - { - bool b1 = BassMix.MixerAddChannel(this.hMixer_DeviceOut, this.hMixer, BassFlags.Default); - if (!b1) { - Errors errcode = Bass.LastError; - BassAsio.Free(); - Bass.Free(); - this.bIsBASSFree = true; - throw new Exception(string.Format("BASSミキサ(最終段とmixing)の接続に失敗しました。[{0}]", errcode)); - }; - } - - - // 出力を開始。 - - this.nバッファサイズsample = (int)(bufferSize * this.db周波数 / 1000.0); - //this.nバッファサイズsample = (int) nバッファサイズbyte; - if (!BassAsio.Start(this.nバッファサイズsample)) // 範囲外の値を指定した場合は自動的にデフォルト値に設定される。 - { - Errors err = BassAsio.LastError; - BassAsio.Free(); - Bass.Free(); - this.bIsBASSFree = true; - throw new Exception("ASIO デバイス出力開始に失敗しました。" + err.ToString()); - } else { - int n遅延sample = BassAsio.GetLatency(false); // この関数は BASS_ASIO_Start() 後にしか呼び出せない。 - int n希望遅延sample = (int)(bufferSize * this.db周波数 / 1000.0); - this.BufferSize = this.OutputDelay = (long)(n遅延sample * 1000.0f / this.db周波数); - Trace.TraceInformation("ASIO デバイス出力開始:バッファ{0}sample(希望{1}) [{2}ms(希望{3}ms)]", n遅延sample, n希望遅延sample, this.OutputDelay, bufferSize); - } - } - - #region [ tサウンドを作成する() ] - public CSound tCreateSound(string strファイル名, ESoundGroup soundGroup) { - var sound = new CSound(soundGroup); - sound.CreateASIOSound(strファイル名, this.hMixer); - return sound; - } - - public void tCreateSound(string strファイル名, CSound sound) { - sound.CreateASIOSound(strファイル名, this.hMixer); - } - #endregion - - - #region [ Dispose-Finallizeパターン実装 ] - //----------------- - public void Dispose() { - this.Dispose(true); - GC.SuppressFinalize(this); - } - protected void Dispose(bool bManagedDispose) { - SoundDeviceType = ESoundDeviceType.Unknown; // まず出力停止する(Dispose中にクラス内にアクセスされることを防ぐ) - if (hMixer != -1) { - Bass.StreamFree(hMixer); - } - if (!bIsBASSFree) { - BassAsio.Free(); // システムタイマより先に呼び出すこと。(tAsio処理() の中でシステムタイマを参照してるため) - Bass.Free(); - } - - if (bManagedDispose) { - SystemTimer.Dispose(); - SystemTimer = null; - } - } - ~CSoundDeviceASIO() { - this.Dispose(false); - } - //----------------- - #endregion - - - protected int hMixer = -1; - protected int hMixer_DeviceOut = -1; - protected int n出力チャンネル数 = 0; - protected double db周波数 = 0.0; - protected int nバッファサイズsample = 0; - protected AsioSampleFormat fmtASIOデバイスフォーマット = AsioSampleFormat.Unknown; - protected AsioSampleFormat fmtASIOチャンネルフォーマット = AsioSampleFormat.Bit16; // 16bit 固定 - //protected BASSASIOFormat fmtASIOチャンネルフォーマット = BASSASIOFormat.BASS_ASIO_FORMAT_32BIT;// 16bit 固定 - protected AsioProcedure tAsioProc = null; - - protected int tAsio処理(bool input, int channel, IntPtr buffer, int length, IntPtr user) { - if (input) return 0; - - - // BASSミキサからの出力データをそのまま ASIO buffer へ丸投げ。 - - int num = Bass.ChannelGetData(this.hMixer_DeviceOut, buffer, length); // num = 実際に転送した長さ - - if (num == -1) num = 0; - - - // 経過時間を更新。 - // データの転送差分ではなく累積転送バイト数から算出する。 - - this.ElapsedTimeMs = (this.n累積転送バイト数 * 1000 / this.nミキサーの1秒あたりのバイト数) - this.OutputDelay; - this.UpdateSystemTimeMs = this.SystemTimer.SystemTimeMs; - - - // 経過時間を更新後に、今回分の累積転送バイト数を反映。 - - this.n累積転送バイト数 += num; - return num; - } - - private long nミキサーの1秒あたりのバイト数 = 0; - private long n累積転送バイト数 = 0; - private bool bIsBASSFree = true; + return new string[] { "None" }; } } + +internal class CSoundDeviceASIO : ISoundDevice { + // Properties + + public ESoundDeviceType SoundDeviceType { + get; + protected set; + } + public long OutputDelay { + get; + protected set; + } + public long BufferSize { + get; + protected set; + } + public int ASIODevice { + get; + set; + } + + // CSoundTimer 用に公開しているプロパティ + + public long ElapsedTimeMs { + get; + protected set; + } + public long UpdateSystemTimeMs { + get; + protected set; + } + public CTimer SystemTimer { + get; + protected set; + } + + + // マスターボリュームの制御コードは、WASAPI/ASIOで全く同じ。 + public int nMasterVolume { + get { + float f音量 = 0.0f; + bool b = Bass.ChannelGetAttribute(this.hMixer, ChannelAttribute.Volume, out f音量); + if (!b) { + Errors be = Bass.LastError; + Trace.TraceInformation("ASIO Master Volume Get Error: " + be.ToString()); + } else { + //Trace.TraceInformation( "ASIO Master Volume Get Success: " + (f音量 * 100) ); + + } + return (int)(f音量 * 100); + } + set { + bool b = Bass.ChannelSetAttribute(this.hMixer, ChannelAttribute.Volume, (float)(value / 100.0)); + if (!b) { + Errors be = Bass.LastError; + Trace.TraceInformation("ASIO Master Volume Set Error: " + be.ToString()); + } else { + // int n = this.nMasterVolume; + // Trace.TraceInformation( "ASIO Master Volume Set Success: " + value ); + } + } + } + + // メソッド + + public CSoundDeviceASIO(long bufferSize, int deviceIndex) { + // 初期化。 + + Trace.TraceInformation("BASS (ASIO) の初期化を開始します。"); + this.SoundDeviceType = ESoundDeviceType.Unknown; + this.OutputDelay = 0; + this.ElapsedTimeMs = 0; + this.UpdateSystemTimeMs = CTimer.UnusedNum; + this.SystemTimer = new CTimer(CTimer.TimerType.MultiMedia); + this.ASIODevice = deviceIndex; + + // BASS の設定。 + + this.bIsBASSFree = true; + + if (!Bass.Configure(Configuration.UpdatePeriod, 0)) // 0:BASSストリームの自動更新を行わない。 + { + Trace.TraceWarning($"BASS_SetConfig({nameof(Configuration.UpdatePeriod)}) に失敗しました。[{Bass.LastError.ToString()}]"); + } + if (!Bass.Configure(Configuration.UpdateThreads, 0)) // 0:BASSストリームの自動更新を行わない。 + { + Trace.TraceWarning($"BASS_SetConfig({nameof(Configuration.UpdateThreads)}) に失敗しました。[{Bass.LastError.ToString()}]"); + } + + // BASS の初期化。 + + int nデバイス = 0; // 0:"no device" … BASS からはデバイスへアクセスさせない。アクセスは BASSASIO アドオンから行う。 + int n周波数 = 44100; // 仮決め。最終的な周波数はデバイス(≠ドライバ)が決める。 + if (!Bass.Init(nデバイス, n周波数, DeviceInitFlags.Default, IntPtr.Zero)) + throw new Exception(string.Format("BASS の初期化に失敗しました。(BASS_Init)[{0}]", Bass.LastError.ToString())); + + Bass.Configure(Configuration.LogarithmicVolumeCurve, true); + + //Debug.WriteLine( "BASS_Init()完了。" ); + #region [ デバッグ用: ASIOデバイスのenumerateと、ログ出力 ] + // CEnumerateAllAsioDevices.GetAllASIODevices(); + //Debug.WriteLine( "BassAsio.BASS_ASIO_GetDeviceInfo():" ); + // int a, count = 0; + // BASS_ASIO_DEVICEINFO asioDevInfo; + // for ( a = 0; ( asioDevInfo = BassAsio.BASS_ASIO_GetDeviceInfo( a ) ) != null; a++ ) + // { + // Trace.TraceInformation( "ASIO Device {0}: {1}, driver={2}", a, asioDevInfo.name, asioDevInfo.driver ); + // count++; // count it + // } + #endregion + + // BASS ASIO の初期化。 + AsioInfo asioInfo; + if (BassAsio.Init(ASIODevice, AsioInitFlags.Thread)) // 専用スレッドにて起動 + { + #region [ ASIO の初期化に成功。] + //----------------- + this.SoundDeviceType = ESoundDeviceType.ASIO; + BassAsio.GetInfo(out asioInfo); + this.n出力チャンネル数 = asioInfo.Outputs; + this.db周波数 = BassAsio.Rate; + this.fmtASIOデバイスフォーマット = BassAsio.ChannelGetFormat(false, 0); + + Trace.TraceInformation("BASS を初期化しました。(ASIO, デバイス:\"{0}\", 入力{1}, 出力{2}, {3}Hz, バッファ{4}~{6}sample ({5:0.###}~{7:0.###}ms), デバイスフォーマット:{8})", + asioInfo.Name, + asioInfo.Inputs, + asioInfo.Outputs, + this.db周波数.ToString("0.###"), + asioInfo.MinBufferLength, asioInfo.MinBufferLength * 1000 / this.db周波数, + asioInfo.MaxBufferLength, asioInfo.MaxBufferLength * 1000 / this.db周波数, + this.fmtASIOデバイスフォーマット.ToString() + ); + this.bIsBASSFree = false; + #region [ debug: channel format ] + //BASS_ASIO_CHANNELINFO chinfo = new BASS_ASIO_CHANNELINFO(); + //int chan = 0; + //while ( true ) + //{ + // if ( !BassAsio.BASS_ASIO_ChannelGetInfo( false, chan, chinfo ) ) + // break; + // Debug.WriteLine( "Ch=" + chan + ": " + chinfo.name.ToString() + ", " + chinfo.group.ToString() + ", " + chinfo.format.ToString() ); + // chan++; + //} + #endregion + //----------------- + #endregion + } else { + #region [ ASIO の初期化に失敗。] + //----------------- + Errors errcode = Bass.LastError; + string errmes = errcode.ToString(); + if (errcode == Errors.OK) { + errmes = "BASS_OK; The device may be dissconnected"; + } + Bass.Free(); + this.bIsBASSFree = true; + throw new Exception(string.Format("BASS (ASIO) の初期化に失敗しました。(BASS_ASIO_Init)[{0}]", errmes)); + //----------------- + #endregion + } + + + // ASIO 出力チャンネルの初期化。 + + this.tAsioProc = new AsioProcedure(this.tAsio処理); // アンマネージに渡す delegate は、フィールドとして保持しておかないとGCでアドレスが変わってしまう。 + if (!BassAsio.ChannelEnable(false, 0, this.tAsioProc, IntPtr.Zero)) // 出力チャンネル0 の有効化。 + { + #region [ ASIO 出力チャンネルの初期化に失敗。] + //----------------- + BassAsio.Free(); + Bass.Free(); + this.bIsBASSFree = true; + throw new Exception(string.Format("Failed BASS_ASIO_ChannelEnable() [{0}]", BassAsio.LastError.ToString())); + //----------------- + #endregion + } + for (int i = 1; i < this.n出力チャンネル数; i++) // 出力チャネルを全てチャネル0とグループ化する。 + { // チャネル1だけを0とグループ化すると、3ch以上の出力をサポートしたカードでの動作がおかしくなる + if (!BassAsio.ChannelJoin(false, i, 0)) { + #region [ 初期化に失敗。] + //----------------- + BassAsio.Free(); + Bass.Free(); + this.bIsBASSFree = true; + throw new Exception(string.Format("Failed BASS_ASIO_ChannelJoin({1}) [{0}]", BassAsio.LastError, i)); + //----------------- + #endregion + } + } + if (!BassAsio.ChannelSetFormat(false, 0, this.fmtASIOチャンネルフォーマット)) // 出力チャンネル0のフォーマット + { + #region [ ASIO 出力チャンネルの初期化に失敗。] + //----------------- + BassAsio.Free(); + Bass.Free(); + this.bIsBASSFree = true; + throw new Exception(string.Format("Failed BASS_ASIO_ChannelSetFormat() [{0}]", BassAsio.LastError.ToString())); + //----------------- + #endregion + } + + // ASIO 出力と同じフォーマットを持つ BASS ミキサーを作成。 + + var flag = BassFlags.MixerNonStop | BassFlags.Decode; // デコードのみ=発声しない。ASIO に出力されるだけ。 + if (this.fmtASIOデバイスフォーマット == AsioSampleFormat.Float) + flag |= BassFlags.Float; + this.hMixer = BassMix.CreateMixerStream((int)this.db周波数, this.n出力チャンネル数, flag); + + if (this.hMixer == 0) { + Errors err = Bass.LastError; + BassAsio.Free(); + Bass.Free(); + this.bIsBASSFree = true; + throw new Exception(string.Format("BASSミキサ(mixing)の作成に失敗しました。[{0}]", err)); + } + + // BASS ミキサーの1秒あたりのバイト数を算出。 + + var mixerInfo = Bass.ChannelGetInfo(this.hMixer); + int nサンプルサイズbyte = 0; + switch (this.fmtASIOチャンネルフォーマット) { + case AsioSampleFormat.Bit16: nサンプルサイズbyte = 2; break; + case AsioSampleFormat.Bit24: nサンプルサイズbyte = 3; break; + case AsioSampleFormat.Bit32: nサンプルサイズbyte = 4; break; + case AsioSampleFormat.Float: nサンプルサイズbyte = 4; break; + } + //long nミキサーの1サンプルあたりのバイト数 = /*mixerInfo.chans*/ 2 * nサンプルサイズbyte; + long nミキサーの1サンプルあたりのバイト数 = mixerInfo.Channels * nサンプルサイズbyte; + this.nミキサーの1秒あたりのバイト数 = nミキサーの1サンプルあたりのバイト数 * mixerInfo.Frequency; + + + // 単純に、hMixerの音量をMasterVolumeとして制御しても、 + // ChannelGetData()の内容には反映されない。 + // そのため、もう一段mixerを噛ませて、一段先のmixerからChannelGetData()することで、 + // hMixerの音量制御を反映させる。 + this.hMixer_DeviceOut = BassMix.CreateMixerStream( + (int)this.db周波数, this.n出力チャンネル数, flag); + if (this.hMixer_DeviceOut == 0) { + Errors errcode = Bass.LastError; + BassAsio.Free(); + Bass.Free(); + this.bIsBASSFree = true; + throw new Exception(string.Format("BASSミキサ(最終段)の作成に失敗しました。[{0}]", errcode)); + } + { + bool b1 = BassMix.MixerAddChannel(this.hMixer_DeviceOut, this.hMixer, BassFlags.Default); + if (!b1) { + Errors errcode = Bass.LastError; + BassAsio.Free(); + Bass.Free(); + this.bIsBASSFree = true; + throw new Exception(string.Format("BASSミキサ(最終段とmixing)の接続に失敗しました。[{0}]", errcode)); + }; + } + + + // 出力を開始。 + + this.nバッファサイズsample = (int)(bufferSize * this.db周波数 / 1000.0); + //this.nバッファサイズsample = (int) nバッファサイズbyte; + if (!BassAsio.Start(this.nバッファサイズsample)) // 範囲外の値を指定した場合は自動的にデフォルト値に設定される。 + { + Errors err = BassAsio.LastError; + BassAsio.Free(); + Bass.Free(); + this.bIsBASSFree = true; + throw new Exception("ASIO デバイス出力開始に失敗しました。" + err.ToString()); + } else { + int n遅延sample = BassAsio.GetLatency(false); // この関数は BASS_ASIO_Start() 後にしか呼び出せない。 + int n希望遅延sample = (int)(bufferSize * this.db周波数 / 1000.0); + this.BufferSize = this.OutputDelay = (long)(n遅延sample * 1000.0f / this.db周波数); + Trace.TraceInformation("ASIO デバイス出力開始:バッファ{0}sample(希望{1}) [{2}ms(希望{3}ms)]", n遅延sample, n希望遅延sample, this.OutputDelay, bufferSize); + } + } + + #region [ tサウンドを作成する() ] + public CSound tCreateSound(string strファイル名, ESoundGroup soundGroup) { + var sound = new CSound(soundGroup); + sound.CreateASIOSound(strファイル名, this.hMixer); + return sound; + } + + public void tCreateSound(string strファイル名, CSound sound) { + sound.CreateASIOSound(strファイル名, this.hMixer); + } + #endregion + + + #region [ Dispose-Finallizeパターン実装 ] + //----------------- + public void Dispose() { + this.Dispose(true); + GC.SuppressFinalize(this); + } + protected void Dispose(bool bManagedDispose) { + SoundDeviceType = ESoundDeviceType.Unknown; // まず出力停止する(Dispose中にクラス内にアクセスされることを防ぐ) + if (hMixer != -1) { + Bass.StreamFree(hMixer); + } + if (!bIsBASSFree) { + BassAsio.Free(); // システムタイマより先に呼び出すこと。(tAsio処理() の中でシステムタイマを参照してるため) + Bass.Free(); + } + + if (bManagedDispose) { + SystemTimer.Dispose(); + SystemTimer = null; + } + } + ~CSoundDeviceASIO() { + this.Dispose(false); + } + //----------------- + #endregion + + + protected int hMixer = -1; + protected int hMixer_DeviceOut = -1; + protected int n出力チャンネル数 = 0; + protected double db周波数 = 0.0; + protected int nバッファサイズsample = 0; + protected AsioSampleFormat fmtASIOデバイスフォーマット = AsioSampleFormat.Unknown; + protected AsioSampleFormat fmtASIOチャンネルフォーマット = AsioSampleFormat.Bit16; // 16bit 固定 + //protected BASSASIOFormat fmtASIOチャンネルフォーマット = BASSASIOFormat.BASS_ASIO_FORMAT_32BIT;// 16bit 固定 + protected AsioProcedure tAsioProc = null; + + protected int tAsio処理(bool input, int channel, IntPtr buffer, int length, IntPtr user) { + if (input) return 0; + + + // BASSミキサからの出力データをそのまま ASIO buffer へ丸投げ。 + + int num = Bass.ChannelGetData(this.hMixer_DeviceOut, buffer, length); // num = 実際に転送した長さ + + if (num == -1) num = 0; + + + // 経過時間を更新。 + // データの転送差分ではなく累積転送バイト数から算出する。 + + this.ElapsedTimeMs = (this.n累積転送バイト数 * 1000 / this.nミキサーの1秒あたりのバイト数) - this.OutputDelay; + this.UpdateSystemTimeMs = this.SystemTimer.SystemTimeMs; + + + // 経過時間を更新後に、今回分の累積転送バイト数を反映。 + + this.n累積転送バイト数 += num; + return num; + } + + private long nミキサーの1秒あたりのバイト数 = 0; + private long n累積転送バイト数 = 0; + private bool bIsBASSFree = true; +} diff --git a/FDK/src/03.Sound/CSoundDeviceBASS.cs b/FDK/src/03.Sound/CSoundDeviceBASS.cs index 4d4d0d8b..7524039e 100644 --- a/FDK/src/03.Sound/CSoundDeviceBASS.cs +++ b/FDK/src/03.Sound/CSoundDeviceBASS.cs @@ -2,224 +2,224 @@ using ManagedBass; using ManagedBass.Mix; -namespace FDK { - public class CSoundDeviceBASS : ISoundDevice { - // Properties +namespace FDK; - public ESoundDeviceType SoundDeviceType { - get; - protected set; - } - public long OutputDelay { - get; - protected set; - } - public long BufferSize { - get; - protected set; - } +public class CSoundDeviceBASS : ISoundDevice { + // Properties - // CSoundTimer 用に公開しているプロパティ + public ESoundDeviceType SoundDeviceType { + get; + protected set; + } + public long OutputDelay { + get; + protected set; + } + public long BufferSize { + get; + protected set; + } - public long ElapsedTimeMs { - get; - protected set; - } - public long UpdateSystemTimeMs { - get; - protected set; - } - public CTimer SystemTimer { - get; - protected set; - } + // CSoundTimer 用に公開しているプロパティ - public float CPUUsage => (float)Bass.CPUUsage; + public long ElapsedTimeMs { + get; + protected set; + } + public long UpdateSystemTimeMs { + get; + protected set; + } + public CTimer SystemTimer { + get; + protected set; + } - // マスターボリュームの制御コードは、WASAPI/ASIOで全く同じ。 - public int nMasterVolume { - get { - float fVolume = 0.0f; - bool b = Bass.ChannelGetAttribute(this.MixerHandle, ChannelAttribute.Volume, out fVolume); - if (!b) { - Errors be = Bass.LastError; - Trace.TraceInformation("BASS Master Volume Get Error: " + be.ToString()); - } - return (int)(fVolume * 100); + public float CPUUsage => (float)Bass.CPUUsage; + + // マスターボリュームの制御コードは、WASAPI/ASIOで全く同じ。 + public int nMasterVolume { + get { + float fVolume = 0.0f; + bool b = Bass.ChannelGetAttribute(this.MixerHandle, ChannelAttribute.Volume, out fVolume); + if (!b) { + Errors be = Bass.LastError; + Trace.TraceInformation("BASS Master Volume Get Error: " + be.ToString()); } - set { - bool b = Bass.ChannelSetAttribute(this.MixerHandle, ChannelAttribute.Volume, (float)(value / 100.0)); - if (!b) { - Errors be = Bass.LastError; - Trace.TraceInformation("BASS Master Volume Set Error: " + be.ToString()); - } + return (int)(fVolume * 100); + } + set { + bool b = Bass.ChannelSetAttribute(this.MixerHandle, ChannelAttribute.Volume, (float)(value / 100.0)); + if (!b) { + Errors be = Bass.LastError; + Trace.TraceInformation("BASS Master Volume Set Error: " + be.ToString()); } } + } - public CSoundDeviceBASS(int updatePeriod, int bufferSize) { - Trace.TraceInformation("Start initialization of BASS"); - this.SoundDeviceType = ESoundDeviceType.Unknown; - this.OutputDelay = 0; - this.ElapsedTimeMs = 0; - this.UpdateSystemTimeMs = CTimer.UnusedNum; - this.SystemTimer = new CTimer(CTimer.TimerType.MultiMedia); + public CSoundDeviceBASS(int updatePeriod, int bufferSize) { + Trace.TraceInformation("Start initialization of BASS"); + this.SoundDeviceType = ESoundDeviceType.Unknown; + this.OutputDelay = 0; + this.ElapsedTimeMs = 0; + this.UpdateSystemTimeMs = CTimer.UnusedNum; + this.SystemTimer = new CTimer(CTimer.TimerType.MultiMedia); + this.IsBASSSoundFree = true; + + // BASS の初期化。 + + int freq = 44100; + + if (!Bass.Init(-1, freq, DeviceInitFlags.Default)) + throw new Exception(string.Format("BASS の初期化に失敗しました。(BASS_Init)[{0}]", Bass.LastError.ToString())); + + if (!Bass.Configure(Configuration.UpdatePeriod, updatePeriod)) { + Trace.TraceWarning($"BASS_SetConfig({nameof(Configuration.UpdatePeriod)}) に失敗しました。[{Bass.LastError}]"); + } + if (!Bass.Configure(Configuration.UpdateThreads, 1)) { + Trace.TraceWarning($"BASS_SetConfig({nameof(Configuration.UpdateThreads)}) に失敗しました。[{Bass.LastError}]"); + } + + Bass.Configure(Configuration.PlaybackBufferLength, bufferSize); + Bass.Configure(Configuration.LogarithmicVolumeCurve, true); + + this.STREAMPROC = new StreamProcedure(StreamProc); + this.MainStreamHandle = Bass.CreateStream(freq, 2, BassFlags.Default, this.STREAMPROC, IntPtr.Zero); + + var flag = BassFlags.MixerNonStop | BassFlags.Decode; // デコードのみ=発声しない。 + this.MixerHandle = BassMix.CreateMixerStream(freq, 2, flag); + + if (this.MixerHandle == 0) { + Errors err = Bass.LastError; + Bass.Free(); this.IsBASSSoundFree = true; + throw new Exception(string.Format("BASSミキサ(mixing)の作成に失敗しました。[{0}]", err)); + } - // BASS の初期化。 + // BASS ミキサーの1秒あたりのバイト数を算出。 - int freq = 44100; + this.IsBASSSoundFree = false; - if (!Bass.Init(-1, freq, DeviceInitFlags.Default)) - throw new Exception(string.Format("BASS の初期化に失敗しました。(BASS_Init)[{0}]", Bass.LastError.ToString())); + var mixerInfo = Bass.ChannelGetInfo(this.MixerHandle); + int bytesPerSample = 2; + long mixer_BlockAlign = mixerInfo.Channels * bytesPerSample; + this.Mixer_BytesPerSec = mixer_BlockAlign * mixerInfo.Frequency; - if (!Bass.Configure(Configuration.UpdatePeriod, updatePeriod)) { - Trace.TraceWarning($"BASS_SetConfig({nameof(Configuration.UpdatePeriod)}) に失敗しました。[{Bass.LastError}]"); - } - if (!Bass.Configure(Configuration.UpdateThreads, 1)) { - Trace.TraceWarning($"BASS_SetConfig({nameof(Configuration.UpdateThreads)}) に失敗しました。[{Bass.LastError}]"); - } - - Bass.Configure(Configuration.PlaybackBufferLength, bufferSize); - Bass.Configure(Configuration.LogarithmicVolumeCurve, true); - - this.STREAMPROC = new StreamProcedure(StreamProc); - this.MainStreamHandle = Bass.CreateStream(freq, 2, BassFlags.Default, this.STREAMPROC, IntPtr.Zero); - - var flag = BassFlags.MixerNonStop | BassFlags.Decode; // デコードのみ=発声しない。 - this.MixerHandle = BassMix.CreateMixerStream(freq, 2, flag); - - if (this.MixerHandle == 0) { - Errors err = Bass.LastError; - Bass.Free(); - this.IsBASSSoundFree = true; - throw new Exception(string.Format("BASSミキサ(mixing)の作成に失敗しました。[{0}]", err)); - } - - // BASS ミキサーの1秒あたりのバイト数を算出。 - - this.IsBASSSoundFree = false; - - var mixerInfo = Bass.ChannelGetInfo(this.MixerHandle); - int bytesPerSample = 2; - long mixer_BlockAlign = mixerInfo.Channels * bytesPerSample; - this.Mixer_BytesPerSec = mixer_BlockAlign * mixerInfo.Frequency; - - // 単純に、hMixerの音量をMasterVolumeとして制御しても、 - // ChannelGetData()の内容には反映されない。 - // そのため、もう一段mixerを噛ませて、一段先のmixerからChannelGetData()することで、 - // hMixerの音量制御を反映させる。 - Mixer_DeviceOut = BassMix.CreateMixerStream( - freq, 2, flag); - if (this.Mixer_DeviceOut == 0) { + // 単純に、hMixerの音量をMasterVolumeとして制御しても、 + // ChannelGetData()の内容には反映されない。 + // そのため、もう一段mixerを噛ませて、一段先のmixerからChannelGetData()することで、 + // hMixerの音量制御を反映させる。 + Mixer_DeviceOut = BassMix.CreateMixerStream( + freq, 2, flag); + if (this.Mixer_DeviceOut == 0) { + Errors errcode = Bass.LastError; + Bass.Free(); + this.IsBASSSoundFree = true; + throw new Exception(string.Format("BASSミキサ(最終段)の作成に失敗しました。[{0}]", errcode)); + } + { + bool b1 = BassMix.MixerAddChannel(this.Mixer_DeviceOut, this.MixerHandle, BassFlags.Default); + if (!b1) { Errors errcode = Bass.LastError; Bass.Free(); this.IsBASSSoundFree = true; - throw new Exception(string.Format("BASSミキサ(最終段)の作成に失敗しました。[{0}]", errcode)); - } - { - bool b1 = BassMix.MixerAddChannel(this.Mixer_DeviceOut, this.MixerHandle, BassFlags.Default); - if (!b1) { - Errors errcode = Bass.LastError; - Bass.Free(); - this.IsBASSSoundFree = true; - throw new Exception(string.Format("BASSミキサ(最終段とmixing)の接続に失敗しました。[{0}]", errcode)); - }; - } - - this.SoundDeviceType = ESoundDeviceType.Bass; - - // 出力を開始。 - - if (!Bass.Start()) // 範囲外の値を指定した場合は自動的にデフォルト値に設定される。 - { - Errors err = Bass.LastError; - Bass.Free(); - this.IsBASSSoundFree = true; - throw new Exception("BASS デバイス出力開始に失敗しました。" + err.ToString()); - } else { - Bass.GetInfo(out var info); - - this.BufferSize = this.OutputDelay = info.Latency + bufferSize;//求め方があっているのだろうか… - - Trace.TraceInformation("BASS デバイス出力開始:[{0}ms]", this.OutputDelay); - } - - Bass.ChannelPlay(this.MainStreamHandle, false); - + throw new Exception(string.Format("BASSミキサ(最終段とmixing)の接続に失敗しました。[{0}]", errcode)); + }; } - #region [ tCreateSound() ] - public CSound tCreateSound(string strFilename, ESoundGroup soundGroup) { - var sound = new CSound(soundGroup); - sound.CreateBassSound(strFilename, this.MixerHandle); - return sound; + this.SoundDeviceType = ESoundDeviceType.Bass; + + // 出力を開始。 + + if (!Bass.Start()) // 範囲外の値を指定した場合は自動的にデフォルト値に設定される。 + { + Errors err = Bass.LastError; + Bass.Free(); + this.IsBASSSoundFree = true; + throw new Exception("BASS デバイス出力開始に失敗しました。" + err.ToString()); + } else { + Bass.GetInfo(out var info); + + this.BufferSize = this.OutputDelay = info.Latency + bufferSize;//求め方があっているのだろうか… + + Trace.TraceInformation("BASS デバイス出力開始:[{0}ms]", this.OutputDelay); } - public void tCreateSound(string strFilename, CSound sound) { - sound.CreateBassSound(strFilename, this.MixerHandle); - } - #endregion + Bass.ChannelPlay(this.MainStreamHandle, false); - - #region [ Dispose-Finallizeパターン実装 ] - //----------------- - public void Dispose() { - this.Dispose(true); - GC.SuppressFinalize(this); - } - protected void Dispose(bool bManagedDispose) { - this.SoundDeviceType = ESoundDeviceType.Unknown; // まず出力停止する(Dispose中にクラス内にアクセスされることを防ぐ) - if (MainStreamHandle != -1) { - Bass.StreamFree(this.MainStreamHandle); - } - if (MixerHandle != -1) { - Bass.StreamFree(this.MixerHandle); - } - if (!this.IsBASSSoundFree) { - Bass.Stop(); - Bass.Free();// システムタイマより先に呼び出すこと。(Stream処理() の中でシステムタイマを参照してるため) - } - - if (bManagedDispose) { - SystemTimer.Dispose(); - this.SystemTimer = null; - } - } - ~CSoundDeviceBASS() { - this.Dispose(false); - } - //----------------- - #endregion - - public int StreamProc(int handle, IntPtr buffer, int length, IntPtr user) { - // BASSミキサからの出力データをそのまま ASIO buffer へ丸投げ。 - - int num = Bass.ChannelGetData(this.Mixer_DeviceOut, buffer, length); // num = 実際に転送した長さ - - if (num == -1) num = 0; - - // 経過時間を更新。 - // データの転送差分ではなく累積転送バイト数から算出する。 - - this.ElapsedTimeMs = (this.TotalByteCount * 1000 / this.Mixer_BytesPerSec) - this.OutputDelay; - this.UpdateSystemTimeMs = this.SystemTimer.SystemTimeMs; - - - // 経過時間を更新後に、今回分の累積転送バイト数を反映。 - - this.TotalByteCount += num; - return num; - } - private long Mixer_BytesPerSec = 0; - private long TotalByteCount = 0; - - protected int MainStreamHandle = -1; - protected int MixerHandle = -1; - protected int Mixer_DeviceOut = -1; - protected StreamProcedure STREAMPROC = null; - private bool IsBASSSoundFree = true; - - //WASAPIとASIOはLinuxでは使えないので、ここだけで良し } + + #region [ tCreateSound() ] + public CSound tCreateSound(string strFilename, ESoundGroup soundGroup) { + var sound = new CSound(soundGroup); + sound.CreateBassSound(strFilename, this.MixerHandle); + return sound; + } + + public void tCreateSound(string strFilename, CSound sound) { + sound.CreateBassSound(strFilename, this.MixerHandle); + } + #endregion + + + #region [ Dispose-Finallizeパターン実装 ] + //----------------- + public void Dispose() { + this.Dispose(true); + GC.SuppressFinalize(this); + } + protected void Dispose(bool bManagedDispose) { + this.SoundDeviceType = ESoundDeviceType.Unknown; // まず出力停止する(Dispose中にクラス内にアクセスされることを防ぐ) + if (MainStreamHandle != -1) { + Bass.StreamFree(this.MainStreamHandle); + } + if (MixerHandle != -1) { + Bass.StreamFree(this.MixerHandle); + } + if (!this.IsBASSSoundFree) { + Bass.Stop(); + Bass.Free();// システムタイマより先に呼び出すこと。(Stream処理() の中でシステムタイマを参照してるため) + } + + if (bManagedDispose) { + SystemTimer.Dispose(); + this.SystemTimer = null; + } + } + ~CSoundDeviceBASS() { + this.Dispose(false); + } + //----------------- + #endregion + + public int StreamProc(int handle, IntPtr buffer, int length, IntPtr user) { + // BASSミキサからの出力データをそのまま ASIO buffer へ丸投げ。 + + int num = Bass.ChannelGetData(this.Mixer_DeviceOut, buffer, length); // num = 実際に転送した長さ + + if (num == -1) num = 0; + + // 経過時間を更新。 + // データの転送差分ではなく累積転送バイト数から算出する。 + + this.ElapsedTimeMs = (this.TotalByteCount * 1000 / this.Mixer_BytesPerSec) - this.OutputDelay; + this.UpdateSystemTimeMs = this.SystemTimer.SystemTimeMs; + + + // 経過時間を更新後に、今回分の累積転送バイト数を反映。 + + this.TotalByteCount += num; + return num; + } + private long Mixer_BytesPerSec = 0; + private long TotalByteCount = 0; + + protected int MainStreamHandle = -1; + protected int MixerHandle = -1; + protected int Mixer_DeviceOut = -1; + protected StreamProcedure STREAMPROC = null; + private bool IsBASSSoundFree = true; + + //WASAPIとASIOはLinuxでは使えないので、ここだけで良し } diff --git a/FDK/src/03.Sound/CSoundDeviceWASAPI.cs b/FDK/src/03.Sound/CSoundDeviceWASAPI.cs index 251599c1..e2ba6a3f 100644 --- a/FDK/src/03.Sound/CSoundDeviceWASAPI.cs +++ b/FDK/src/03.Sound/CSoundDeviceWASAPI.cs @@ -3,426 +3,426 @@ using ManagedBass; using ManagedBass.Mix; using ManagedBass.Wasapi; -namespace FDK { - internal class CSoundDeviceWASAPI : ISoundDevice { - // Properties +namespace FDK; - public ESoundDeviceType SoundDeviceType { - get; - protected set; - } - public long OutputDelay { - get; - protected set; - } - public long BufferSize { - get; - protected set; - } +internal class CSoundDeviceWASAPI : ISoundDevice { + // Properties - // CSoundTimer 用に公開しているプロパティ + public ESoundDeviceType SoundDeviceType { + get; + protected set; + } + public long OutputDelay { + get; + protected set; + } + public long BufferSize { + get; + protected set; + } - public long ElapsedTimeMs { - get; - protected set; - } - public long UpdateSystemTimeMs { - get; - protected set; - } - public CTimer SystemTimer { - get; - protected set; - } + // CSoundTimer 用に公開しているプロパティ - public enum EWASAPIMode { Exclusion, Share } + public long ElapsedTimeMs { + get; + protected set; + } + public long UpdateSystemTimeMs { + get; + protected set; + } + public CTimer SystemTimer { + get; + protected set; + } - public int nMasterVolume { - get { - float volume = 0.0f; - //if ( BassMix.BASS_Mixer_ChannelGetEnvelopePos( this.hMixer, BASSMIXEnvelope.BASS_MIXER_ENV_VOL, ref f音量 ) == -1 ) - // return 100; - //bool b = Bass.BASS_ChannelGetAttribute( this.hMixer, BASSAttribute.BASS_ATTRIB_VOL, ref f音量 ); - bool b = Bass.ChannelGetAttribute(this.hMixer, ChannelAttribute.Volume, out volume); - if (!b) { - Errors be = Bass.LastError; - Trace.TraceInformation("WASAPI Master Volume Get Error: " + be.ToString()); - } else { - Trace.TraceInformation("WASAPI Master Volume Get Success: " + (volume * 100)); + public enum EWASAPIMode { Exclusion, Share } - } - return (int)(volume * 100); - } - set { - // bool b = Bass.BASS_SetVolume( value / 100.0f ); - // →Exclusiveモード時は無効 - - // bool b = BassWasapi.BASS_WASAPI_SetVolume( BASSWASAPIVolume.BASS_WASAPI_VOL_SESSION, (float) ( value / 100 ) ); - // bool b = BassWasapi.BASS_WASAPI_SetVolume( BASSWASAPIVolume.BASS_WASAPI_CURVE_WINDOWS, (float) ( value / 100 ) ); - bool b = Bass.ChannelSetAttribute(this.hMixer, ChannelAttribute.Volume, (float)(value / 100.0)); - // If you would like to have a volume control in exclusive mode too, and you're using the BASSmix add-on, - // you can adjust the source's BASS_ATTRIB_VOL setting via BASS_ChannelSetAttribute. - // しかし、hMixerに対するBASS_ChannelSetAttribute()でBASS_ATTRIB_VOLを変更: なぜか出力音量に反映されず - - // Bass_SetVolume(): BASS_ERROR_NOTAVIL ("no sound" deviceには適用不可) - - // Mixer_ChannelSetEnvelope(): - - //var nodes = new BASS_MIXER_NODE[ 1 ] { new BASS_MIXER_NODE( 0, (float) value ) }; - //bool b = BassMix.BASS_Mixer_ChannelSetEnvelope( this.hMixer, BASSMIXEnvelope.BASS_MIXER_ENV_VOL, nodes ); - //bool b = Bass.BASS_ChannelSetAttribute( this.hMixer, BASSAttribute.BASS_ATTRIB_VOL, value / 100.0f ); - if (!b) { - Errors be = Bass.LastError; - Trace.TraceInformation("WASAPI Master Volume Set Error: " + be.ToString()); - } else { - // int n = this.nMasterVolume; - // Trace.TraceInformation( "WASAPI Master Volume Set Success: " + value ); - - } - } - } - // メソッド - - /// - /// WASAPIの初期化 - /// - /// - /// (未使用; 本メソッド内で自動設定する) - /// (未使用; 本メソッド内で自動設定する) - public CSoundDeviceWASAPI(EWASAPIMode mode, long bufferSize, long interval) { - // 初期化。 - - Trace.TraceInformation("BASS (WASAPI) の初期化を開始します。"); - - this.SoundDeviceType = ESoundDeviceType.Unknown; - this.OutputDelay = 0; - this.ElapsedTimeMs = 0; - this.UpdateSystemTimeMs = CTimer.UnusedNum; - this.SystemTimer = new CTimer(CTimer.TimerType.MultiMedia); - this.b最初の実出力遅延算出 = true; - - // BASS の設定。 - - this.bIsBASSFree = true; - - if (!Bass.Configure(Configuration.UpdatePeriod, 0)) // 0:BASSストリームの自動更新を行わない。 - { - Trace.TraceWarning($"Configure({nameof(Configuration.UpdatePeriod)}) に失敗しました。[{Bass.LastError.ToString()}]"); - } - if (!Bass.Configure(Configuration.UpdateThreads, 0)) // 0:BASSストリームの自動更新を行わない。 - { - Trace.TraceWarning($"Configure({nameof(Configuration.UpdateThreads)}) に失敗しました。[{Bass.LastError.ToString()}]"); - } - - // BASS の初期化。 - - int nデバイス = 0; // 0:"no device" … BASS からはデバイスへアクセスさせない。アクセスは BASSWASAPI アドオンから行う。 - int n周波数 = 44100; // 仮決め。lデバイス(≠ドライバ)がネイティブに対応している周波数であれば何でもいい?ようだ。BASSWASAPIでデバイスの周波数は変えられる。いずれにしろBASSMXで自動的にリサンプリングされる。 - //if( !Bass.Init( nデバイス, n周波数, DeviceInitFlags.Default, IntPtr.Zero ) ) - // throw new Exception( string.Format( "BASS (WASAPI) の初期化に失敗しました。(BASS_Init)[{0}]", Bass.LastError.ToString() ) ); - - Bass.Configure(Configuration.LogarithmicVolumeCurve, true); - - #region [ デバッグ用: WASAPIデバイスのenumerateと、ログ出力 ] - //(デバッグ用) - Trace.TraceInformation("サウンドデバイス一覧:"); - int a; - string strDefaultSoundDeviceName = null; - DeviceInfo[] bassDevInfos = new DeviceInfo[Bass.DeviceCount]; - for (int j = 0; j < bassDevInfos.Length; j++) { - bassDevInfos[j] = Bass.GetDeviceInfo(j); - } - for (a = 0; a < bassDevInfos.GetLength(0); a++) { - { - Trace.TraceInformation("Sound Device #{0}: {1}: IsDefault={2}, isEnabled={3}", - a, - bassDevInfos[a].Name, - bassDevInfos[a].IsDefault, - bassDevInfos[a].IsEnabled - ); - if (bassDevInfos[a].IsDefault) { - // これはOS標準のdefault device。後でWASAPIのdefault deviceと比較する。 - strDefaultSoundDeviceName = bassDevInfos[a].Name; - } - } - } - #endregion - - // BASS WASAPI の初期化。 - - nデバイス = -1; - n周波数 = 0; // デフォルトデバイスの周波数 (0="mix format" sample rate) - int nチャンネル数 = 0; // デフォルトデバイスのチャンネル数 (0="mix format" channels) - this.tWasapiProc = new WasapiProcedure(this.tWASAPI処理); // アンマネージに渡す delegate は、フィールドとして保持しておかないとGCでアドレスが変わってしまう。 - - // WASAPIの更新間隔(period)は、バッファサイズにも影響を与える。 - // 更新間隔を最小にするには、BassWasapi.BASS_WASAPI_GetDeviceInfo( ndevNo ).minperiod の値を使えばよい。 - // これをやらないと、更新間隔ms=6ms となり、バッファサイズを 6ms x 4 = 24msより小さくできない。 - #region [ 既定の出力デバイスと設定されているWASAPIデバイスを検索し、更新間隔msを設定できる最小値にする ] - int nDevNo = -1; - WasapiDeviceInfo deviceInfo; - for (int n = 0; BassWasapi.GetDeviceInfo(n, out deviceInfo); n++) { - // #37940 2018.2.15: BASS_DEVICEINFOとBASS_WASAPI_DEVICEINFOで、IsDefaultとなっているデバイスが異なる場合がある。 - // (WASAPIでIsDefaultとなっているデバイスが正しくない場合がある) - // そのため、BASS_DEVICEでIsDefaultとなっているものを探し、それと同じ名前のWASAPIデバイスを使用する。 - // #39490 2019.8.19: 更に、環境によっては同じ名前のWASAPIデバイスが複数定義されている場合があるため、 - // 実際に利用可能なWASAPIデバイスのみに対象を絞り込む。 - // (具体的には、defperiod, minperiod, mixchans, mixfreqがすべて0のデバイスは使用不可のため - // これらが0でないものを選択する) - //if ( deviceInfo.IsDefault ) - if (deviceInfo.Name == strDefaultSoundDeviceName && deviceInfo.MixFrequency > 0) { - nDevNo = n; - #region [ 既定の出力デバイスの情報を表示 ] - Trace.TraceInformation("WASAPI Device #{0}: {1}: IsDefault={2}, defPeriod={3}s, minperiod={4}s, mixchans={5}, mixfreq={6}", - n, - deviceInfo.Name, - deviceInfo.IsDefault, deviceInfo.DefaultUpdatePeriod, deviceInfo.MinimumUpdatePeriod, deviceInfo.MixChannels, deviceInfo.MixFrequency); - #endregion - break; - } - } - if (nDevNo != -1) { - Trace.TraceInformation("Start Bass_Init(device=0(fixed value: no sound), deviceInfo.mixfreq=" + deviceInfo.MixFrequency + ", BASS_DEVICE_DEFAULT, Zero)"); - if (!Bass.Init(0, deviceInfo.MixFrequency, DeviceInitFlags.Default, IntPtr.Zero)) // device = 0:"no device": BASS からはデバイスへアクセスさせない。アクセスは BASSWASAPI アドオンから行う。 - throw new Exception(string.Format("BASS (WASAPI{0}) の初期化に失敗しました。(BASS_Init)[{1}]", mode.ToString(), Bass.LastError.ToString())); - - // Trace.TraceInformation( "Selected Default WASAPI Device: {0}", deviceInfo.name ); - // Trace.TraceInformation( "MinPeriod={0}, DefaultPeriod={1}", deviceInfo.minperiod, deviceInfo.defperiod ); - - // n更新間隔ms = ( mode == Eデバイスモード.排他 )? Convert.ToInt64(Math.Ceiling(deviceInfo.minperiod * 1000.0f)) : Convert.ToInt64(Math.Ceiling(deviceInfo.defperiod * 1000.0f)); - // 更新間隔として、WASAPI排他時はminperiodより大きい最小のms値を、WASAPI共有時はdefperiodより大きい最小のms値を用いる - // Win10では、更新間隔がminperiod以下だと、確実にBASS_ERROR_UNKNOWNとなる。 - - //if ( n希望バッファサイズms <= 0 || n希望バッファサイズms < n更新間隔ms + 1 ) - //{ - // n希望バッファサイズms = n更新間隔ms + 1; // 2013.4.25 #31237 yyagi; バッファサイズ設定の完全自動化。更新間隔=バッファサイズにするとBASS_ERROR_UNKNOWNになるので+1する。 - //} + public int nMasterVolume { + get { + float volume = 0.0f; + //if ( BassMix.BASS_Mixer_ChannelGetEnvelopePos( this.hMixer, BASSMIXEnvelope.BASS_MIXER_ENV_VOL, ref f音量 ) == -1 ) + // return 100; + //bool b = Bass.BASS_ChannelGetAttribute( this.hMixer, BASSAttribute.BASS_ATTRIB_VOL, ref f音量 ); + bool b = Bass.ChannelGetAttribute(this.hMixer, ChannelAttribute.Volume, out volume); + if (!b) { + Errors be = Bass.LastError; + Trace.TraceInformation("WASAPI Master Volume Get Error: " + be.ToString()); } else { - Trace.TraceError("Error: Default WASAPI Device is not found."); + Trace.TraceInformation("WASAPI Master Volume Get Success: " + (volume * 100)); + } - #endregion + return (int)(volume * 100); + } + set { + // bool b = Bass.BASS_SetVolume( value / 100.0f ); + // →Exclusiveモード時は無効 - //Retry: - var flags = (mode == EWASAPIMode.Exclusion) ? WasapiInitFlags.AutoFormat | WasapiInitFlags.Exclusive : WasapiInitFlags.Shared | WasapiInitFlags.AutoFormat; - //var flags = ( mode == Eデバイスモード.排他 ) ? BASSWASAPIInit.BASS_WASAPI_AUTOFORMAT | BASSWASAPIInit.BASS_WASAPI_EVENT | BASSWASAPIInit.BASS_WASAPI_EXCLUSIVE : BASSWASAPIInit.BASS_WASAPI_AUTOFORMAT | BASSWASAPIInit.BASS_WASAPI_EVENT; + // bool b = BassWasapi.BASS_WASAPI_SetVolume( BASSWASAPIVolume.BASS_WASAPI_VOL_SESSION, (float) ( value / 100 ) ); + // bool b = BassWasapi.BASS_WASAPI_SetVolume( BASSWASAPIVolume.BASS_WASAPI_CURVE_WINDOWS, (float) ( value / 100 ) ); + bool b = Bass.ChannelSetAttribute(this.hMixer, ChannelAttribute.Volume, (float)(value / 100.0)); + // If you would like to have a volume control in exclusive mode too, and you're using the BASSmix add-on, + // you can adjust the source's BASS_ATTRIB_VOL setting via BASS_ChannelSetAttribute. + // しかし、hMixerに対するBASS_ChannelSetAttribute()でBASS_ATTRIB_VOLを変更: なぜか出力音量に反映されず - if (BassWasapi.Init(nデバイス, n周波数, nチャンネル数, flags, (bufferSize / 1000.0f), (interval / 1000.0f), this.tWasapiProc, IntPtr.Zero)) { - if (mode == EWASAPIMode.Exclusion) { - #region [ 排他モードで作成成功。] - //----------------- - this.SoundDeviceType = ESoundDeviceType.ExclusiveWASAPI; + // Bass_SetVolume(): BASS_ERROR_NOTAVIL ("no sound" deviceには適用不可) - nDevNo = BassWasapi.CurrentDevice; - deviceInfo = BassWasapi.GetDeviceInfo(nDevNo); - BassWasapi.GetInfo(out var wasapiInfo); - int n1サンプルのバイト数 = 2 * wasapiInfo.Channels; // default; - switch (wasapiInfo.Format) // BASS WASAPI で扱うサンプルはすべて 32bit float で固定されているが、デバイスはそうとは限らない。 - { - case WasapiFormat.Bit8: n1サンプルのバイト数 = 1 * wasapiInfo.Channels; break; - case WasapiFormat.Bit16: n1サンプルのバイト数 = 2 * wasapiInfo.Channels; break; - case WasapiFormat.Bit24: n1サンプルのバイト数 = 3 * wasapiInfo.Channels; break; - case WasapiFormat.Bit32: n1サンプルのバイト数 = 4 * wasapiInfo.Channels; break; - case WasapiFormat.Float: n1サンプルのバイト数 = 4 * wasapiInfo.Channels; break; - case WasapiFormat.Unknown: throw new ArgumentOutOfRangeException($"WASAPI format error ({wasapiInfo.ToString()})"); - } - int n1秒のバイト数 = n1サンプルのバイト数 * wasapiInfo.Frequency; - this.BufferSize = (long)(wasapiInfo.BufferLength * 1000.0f / n1秒のバイト数); - this.OutputDelay = 0; // 初期値はゼロ - Trace.TraceInformation("使用デバイス: #" + nDevNo + " : " + deviceInfo.Name); - Trace.TraceInformation("BASS を初期化しました。(WASAPI排他モード, {0}Hz, {1}ch, フォーマット:{2}, バッファ{3}bytes [{4}ms(希望{5}ms)], 更新間隔{6}ms)", - wasapiInfo.Frequency, - wasapiInfo.Channels, - wasapiInfo.Format.ToString(), - wasapiInfo.BufferLength, - BufferSize.ToString(), - bufferSize.ToString(), - interval.ToString()); - Trace.TraceInformation("デバイスの最小更新時間={0}ms, 既定の更新時間={1}ms", deviceInfo.MinimumUpdatePeriod * 1000, deviceInfo.DefaultUpdatePeriod * 1000); - this.bIsBASSFree = false; - //----------------- - #endregion - } else { - #region [ 共有モードで作成成功。] - //----------------- - this.SoundDeviceType = ESoundDeviceType.SharedWASAPI; + // Mixer_ChannelSetEnvelope(): - var devInfo = BassWasapi.GetDeviceInfo(BassWasapi.CurrentDevice); - BassWasapi.GetInfo(out var wasapiInfo); - int n1サンプルのバイト数 = 2 * wasapiInfo.Channels; // default; - switch (wasapiInfo.Format) // BASS WASAPI で扱うサンプルはすべて 32bit float で固定されているが、デバイスはそうとは限らない。 - { - case WasapiFormat.Bit8: n1サンプルのバイト数 = 1 * wasapiInfo.Channels; break; - case WasapiFormat.Bit16: n1サンプルのバイト数 = 2 * wasapiInfo.Channels; break; - case WasapiFormat.Bit24: n1サンプルのバイト数 = 3 * wasapiInfo.Channels; break; - case WasapiFormat.Bit32: n1サンプルのバイト数 = 4 * wasapiInfo.Channels; break; - case WasapiFormat.Float: n1サンプルのバイト数 = 4 * wasapiInfo.Channels; break; - case WasapiFormat.Unknown: throw new ArgumentOutOfRangeException($"WASAPI format error ({wasapiInfo.ToString()})"); - } - int n1秒のバイト数 = n1サンプルのバイト数 * wasapiInfo.Frequency; - this.BufferSize = (long)(wasapiInfo.BufferLength * 1000.0f / n1秒のバイト数); + //var nodes = new BASS_MIXER_NODE[ 1 ] { new BASS_MIXER_NODE( 0, (float) value ) }; + //bool b = BassMix.BASS_Mixer_ChannelSetEnvelope( this.hMixer, BASSMIXEnvelope.BASS_MIXER_ENV_VOL, nodes ); + //bool b = Bass.BASS_ChannelSetAttribute( this.hMixer, BASSAttribute.BASS_ATTRIB_VOL, value / 100.0f ); + if (!b) { + Errors be = Bass.LastError; + Trace.TraceInformation("WASAPI Master Volume Set Error: " + be.ToString()); + } else { + // int n = this.nMasterVolume; + // Trace.TraceInformation( "WASAPI Master Volume Set Success: " + value ); - this.OutputDelay = 0; // 初期値はゼロ + } + } + } + // メソッド - Trace.TraceInformation("BASS を初期化しました。(WASAPI共有モード, {0}ms, 更新間隔{1}ms)", bufferSize, devInfo.DefaultUpdatePeriod * 1000.0f); - this.bIsBASSFree = false; - //----------------- - #endregion + /// + /// WASAPIの初期化 + /// + /// + /// (未使用; 本メソッド内で自動設定する) + /// (未使用; 本メソッド内で自動設定する) + public CSoundDeviceWASAPI(EWASAPIMode mode, long bufferSize, long interval) { + // 初期化。 + + Trace.TraceInformation("BASS (WASAPI) の初期化を開始します。"); + + this.SoundDeviceType = ESoundDeviceType.Unknown; + this.OutputDelay = 0; + this.ElapsedTimeMs = 0; + this.UpdateSystemTimeMs = CTimer.UnusedNum; + this.SystemTimer = new CTimer(CTimer.TimerType.MultiMedia); + this.b最初の実出力遅延算出 = true; + + // BASS の設定。 + + this.bIsBASSFree = true; + + if (!Bass.Configure(Configuration.UpdatePeriod, 0)) // 0:BASSストリームの自動更新を行わない。 + { + Trace.TraceWarning($"Configure({nameof(Configuration.UpdatePeriod)}) に失敗しました。[{Bass.LastError.ToString()}]"); + } + if (!Bass.Configure(Configuration.UpdateThreads, 0)) // 0:BASSストリームの自動更新を行わない。 + { + Trace.TraceWarning($"Configure({nameof(Configuration.UpdateThreads)}) に失敗しました。[{Bass.LastError.ToString()}]"); + } + + // BASS の初期化。 + + int nデバイス = 0; // 0:"no device" … BASS からはデバイスへアクセスさせない。アクセスは BASSWASAPI アドオンから行う。 + int n周波数 = 44100; // 仮決め。lデバイス(≠ドライバ)がネイティブに対応している周波数であれば何でもいい?ようだ。BASSWASAPIでデバイスの周波数は変えられる。いずれにしろBASSMXで自動的にリサンプリングされる。 + //if( !Bass.Init( nデバイス, n周波数, DeviceInitFlags.Default, IntPtr.Zero ) ) + // throw new Exception( string.Format( "BASS (WASAPI) の初期化に失敗しました。(BASS_Init)[{0}]", Bass.LastError.ToString() ) ); + + Bass.Configure(Configuration.LogarithmicVolumeCurve, true); + + #region [ デバッグ用: WASAPIデバイスのenumerateと、ログ出力 ] + //(デバッグ用) + Trace.TraceInformation("サウンドデバイス一覧:"); + int a; + string strDefaultSoundDeviceName = null; + DeviceInfo[] bassDevInfos = new DeviceInfo[Bass.DeviceCount]; + for (int j = 0; j < bassDevInfos.Length; j++) { + bassDevInfos[j] = Bass.GetDeviceInfo(j); + } + for (a = 0; a < bassDevInfos.GetLength(0); a++) { + { + Trace.TraceInformation("Sound Device #{0}: {1}: IsDefault={2}, isEnabled={3}", + a, + bassDevInfos[a].Name, + bassDevInfos[a].IsDefault, + bassDevInfos[a].IsEnabled + ); + if (bassDevInfos[a].IsDefault) { + // これはOS標準のdefault device。後でWASAPIのdefault deviceと比較する。 + strDefaultSoundDeviceName = bassDevInfos[a].Name; } - } - #region [ #31737 WASAPI排他モードのみ利用可能とし、WASAPI共有モードは使用できないようにするために、WASAPI共有モードでの初期化フローを削除する。 ] - //else if ( mode == Eデバイスモード.排他 ) + } + #endregion + + // BASS WASAPI の初期化。 + + nデバイス = -1; + n周波数 = 0; // デフォルトデバイスの周波数 (0="mix format" sample rate) + int nチャンネル数 = 0; // デフォルトデバイスのチャンネル数 (0="mix format" channels) + this.tWasapiProc = new WasapiProcedure(this.tWASAPI処理); // アンマネージに渡す delegate は、フィールドとして保持しておかないとGCでアドレスが変わってしまう。 + + // WASAPIの更新間隔(period)は、バッファサイズにも影響を与える。 + // 更新間隔を最小にするには、BassWasapi.BASS_WASAPI_GetDeviceInfo( ndevNo ).minperiod の値を使えばよい。 + // これをやらないと、更新間隔ms=6ms となり、バッファサイズを 6ms x 4 = 24msより小さくできない。 + #region [ 既定の出力デバイスと設定されているWASAPIデバイスを検索し、更新間隔msを設定できる最小値にする ] + int nDevNo = -1; + WasapiDeviceInfo deviceInfo; + for (int n = 0; BassWasapi.GetDeviceInfo(n, out deviceInfo); n++) { + // #37940 2018.2.15: BASS_DEVICEINFOとBASS_WASAPI_DEVICEINFOで、IsDefaultとなっているデバイスが異なる場合がある。 + // (WASAPIでIsDefaultとなっているデバイスが正しくない場合がある) + // そのため、BASS_DEVICEでIsDefaultとなっているものを探し、それと同じ名前のWASAPIデバイスを使用する。 + // #39490 2019.8.19: 更に、環境によっては同じ名前のWASAPIデバイスが複数定義されている場合があるため、 + // 実際に利用可能なWASAPIデバイスのみに対象を絞り込む。 + // (具体的には、defperiod, minperiod, mixchans, mixfreqがすべて0のデバイスは使用不可のため + // これらが0でないものを選択する) + //if ( deviceInfo.IsDefault ) + if (deviceInfo.Name == strDefaultSoundDeviceName && deviceInfo.MixFrequency > 0) { + nDevNo = n; + #region [ 既定の出力デバイスの情報を表示 ] + Trace.TraceInformation("WASAPI Device #{0}: {1}: IsDefault={2}, defPeriod={3}s, minperiod={4}s, mixchans={5}, mixfreq={6}", + n, + deviceInfo.Name, + deviceInfo.IsDefault, deviceInfo.DefaultUpdatePeriod, deviceInfo.MinimumUpdatePeriod, deviceInfo.MixChannels, deviceInfo.MixFrequency); + #endregion + break; + } + } + if (nDevNo != -1) { + Trace.TraceInformation("Start Bass_Init(device=0(fixed value: no sound), deviceInfo.mixfreq=" + deviceInfo.MixFrequency + ", BASS_DEVICE_DEFAULT, Zero)"); + if (!Bass.Init(0, deviceInfo.MixFrequency, DeviceInitFlags.Default, IntPtr.Zero)) // device = 0:"no device": BASS からはデバイスへアクセスさせない。アクセスは BASSWASAPI アドオンから行う。 + throw new Exception(string.Format("BASS (WASAPI{0}) の初期化に失敗しました。(BASS_Init)[{1}]", mode.ToString(), Bass.LastError.ToString())); + + // Trace.TraceInformation( "Selected Default WASAPI Device: {0}", deviceInfo.name ); + // Trace.TraceInformation( "MinPeriod={0}, DefaultPeriod={1}", deviceInfo.minperiod, deviceInfo.defperiod ); + + // n更新間隔ms = ( mode == Eデバイスモード.排他 )? Convert.ToInt64(Math.Ceiling(deviceInfo.minperiod * 1000.0f)) : Convert.ToInt64(Math.Ceiling(deviceInfo.defperiod * 1000.0f)); + // 更新間隔として、WASAPI排他時はminperiodより大きい最小のms値を、WASAPI共有時はdefperiodより大きい最小のms値を用いる + // Win10では、更新間隔がminperiod以下だと、確実にBASS_ERROR_UNKNOWNとなる。 + + //if ( n希望バッファサイズms <= 0 || n希望バッファサイズms < n更新間隔ms + 1 ) //{ - // Trace.TraceInformation("Failed to initialize setting BASS (WASAPI) mode [{0}]", Bass.BASS_ErrorGetCode().ToString() ); - // #region [ 排他モードに失敗したのなら共有モードでリトライ。] - // //----------------- - // mode = Eデバイスモード.共有; - // goto Retry; - // //----------------- - // #endregion + // n希望バッファサイズms = n更新間隔ms + 1; // 2013.4.25 #31237 yyagi; バッファサイズ設定の完全自動化。更新間隔=バッファサイズにするとBASS_ERROR_UNKNOWNになるので+1する。 //} - #endregion - else { - #region [ それでも失敗したら例外発生。] + } else { + Trace.TraceError("Error: Default WASAPI Device is not found."); + } + #endregion + + //Retry: + var flags = (mode == EWASAPIMode.Exclusion) ? WasapiInitFlags.AutoFormat | WasapiInitFlags.Exclusive : WasapiInitFlags.Shared | WasapiInitFlags.AutoFormat; + //var flags = ( mode == Eデバイスモード.排他 ) ? BASSWASAPIInit.BASS_WASAPI_AUTOFORMAT | BASSWASAPIInit.BASS_WASAPI_EVENT | BASSWASAPIInit.BASS_WASAPI_EXCLUSIVE : BASSWASAPIInit.BASS_WASAPI_AUTOFORMAT | BASSWASAPIInit.BASS_WASAPI_EVENT; + + if (BassWasapi.Init(nデバイス, n周波数, nチャンネル数, flags, (bufferSize / 1000.0f), (interval / 1000.0f), this.tWasapiProc, IntPtr.Zero)) { + if (mode == EWASAPIMode.Exclusion) { + #region [ 排他モードで作成成功。] //----------------- - Errors errcode = Bass.LastError; - Bass.Free(); - this.bIsBASSFree = true; - throw new Exception(string.Format("BASS (WASAPI) の初期化に失敗しました。(BASS_WASAPI_Init)[{0}]", errcode)); + this.SoundDeviceType = ESoundDeviceType.ExclusiveWASAPI; + + nDevNo = BassWasapi.CurrentDevice; + deviceInfo = BassWasapi.GetDeviceInfo(nDevNo); + BassWasapi.GetInfo(out var wasapiInfo); + int n1サンプルのバイト数 = 2 * wasapiInfo.Channels; // default; + switch (wasapiInfo.Format) // BASS WASAPI で扱うサンプルはすべて 32bit float で固定されているが、デバイスはそうとは限らない。 + { + case WasapiFormat.Bit8: n1サンプルのバイト数 = 1 * wasapiInfo.Channels; break; + case WasapiFormat.Bit16: n1サンプルのバイト数 = 2 * wasapiInfo.Channels; break; + case WasapiFormat.Bit24: n1サンプルのバイト数 = 3 * wasapiInfo.Channels; break; + case WasapiFormat.Bit32: n1サンプルのバイト数 = 4 * wasapiInfo.Channels; break; + case WasapiFormat.Float: n1サンプルのバイト数 = 4 * wasapiInfo.Channels; break; + case WasapiFormat.Unknown: throw new ArgumentOutOfRangeException($"WASAPI format error ({wasapiInfo.ToString()})"); + } + int n1秒のバイト数 = n1サンプルのバイト数 * wasapiInfo.Frequency; + this.BufferSize = (long)(wasapiInfo.BufferLength * 1000.0f / n1秒のバイト数); + this.OutputDelay = 0; // 初期値はゼロ + Trace.TraceInformation("使用デバイス: #" + nDevNo + " : " + deviceInfo.Name); + Trace.TraceInformation("BASS を初期化しました。(WASAPI排他モード, {0}Hz, {1}ch, フォーマット:{2}, バッファ{3}bytes [{4}ms(希望{5}ms)], 更新間隔{6}ms)", + wasapiInfo.Frequency, + wasapiInfo.Channels, + wasapiInfo.Format.ToString(), + wasapiInfo.BufferLength, + BufferSize.ToString(), + bufferSize.ToString(), + interval.ToString()); + Trace.TraceInformation("デバイスの最小更新時間={0}ms, 既定の更新時間={1}ms", deviceInfo.MinimumUpdatePeriod * 1000, deviceInfo.DefaultUpdatePeriod * 1000); + this.bIsBASSFree = false; + //----------------- + #endregion + } else { + #region [ 共有モードで作成成功。] + //----------------- + this.SoundDeviceType = ESoundDeviceType.SharedWASAPI; + + var devInfo = BassWasapi.GetDeviceInfo(BassWasapi.CurrentDevice); + BassWasapi.GetInfo(out var wasapiInfo); + int n1サンプルのバイト数 = 2 * wasapiInfo.Channels; // default; + switch (wasapiInfo.Format) // BASS WASAPI で扱うサンプルはすべて 32bit float で固定されているが、デバイスはそうとは限らない。 + { + case WasapiFormat.Bit8: n1サンプルのバイト数 = 1 * wasapiInfo.Channels; break; + case WasapiFormat.Bit16: n1サンプルのバイト数 = 2 * wasapiInfo.Channels; break; + case WasapiFormat.Bit24: n1サンプルのバイト数 = 3 * wasapiInfo.Channels; break; + case WasapiFormat.Bit32: n1サンプルのバイト数 = 4 * wasapiInfo.Channels; break; + case WasapiFormat.Float: n1サンプルのバイト数 = 4 * wasapiInfo.Channels; break; + case WasapiFormat.Unknown: throw new ArgumentOutOfRangeException($"WASAPI format error ({wasapiInfo.ToString()})"); + } + int n1秒のバイト数 = n1サンプルのバイト数 * wasapiInfo.Frequency; + this.BufferSize = (long)(wasapiInfo.BufferLength * 1000.0f / n1秒のバイト数); + + this.OutputDelay = 0; // 初期値はゼロ + + Trace.TraceInformation("BASS を初期化しました。(WASAPI共有モード, {0}ms, 更新間隔{1}ms)", bufferSize, devInfo.DefaultUpdatePeriod * 1000.0f); + this.bIsBASSFree = false; //----------------- #endregion } + } + #region [ #31737 WASAPI排他モードのみ利用可能とし、WASAPI共有モードは使用できないようにするために、WASAPI共有モードでの初期化フローを削除する。 ] + //else if ( mode == Eデバイスモード.排他 ) + //{ + // Trace.TraceInformation("Failed to initialize setting BASS (WASAPI) mode [{0}]", Bass.BASS_ErrorGetCode().ToString() ); + // #region [ 排他モードに失敗したのなら共有モードでリトライ。] + // //----------------- + // mode = Eデバイスモード.共有; + // goto Retry; + // //----------------- + // #endregion + //} + #endregion + else { + #region [ それでも失敗したら例外発生。] + //----------------- + Errors errcode = Bass.LastError; + Bass.Free(); + this.bIsBASSFree = true; + throw new Exception(string.Format("BASS (WASAPI) の初期化に失敗しました。(BASS_WASAPI_Init)[{0}]", errcode)); + //----------------- + #endregion + } - // WASAPI出力と同じフォーマットを持つ BASS ミキサーを作成。 - BassWasapi.GetInfo(out var info); - this.hMixer = BassMix.CreateMixerStream( - info.Frequency, - info.Channels, - BassFlags.MixerNonStop | BassFlags.Float | BassFlags.Decode); // デコードのみ=発声しない。WASAPIに出力されるだけ。 - if (this.hMixer == 0) { + // WASAPI出力と同じフォーマットを持つ BASS ミキサーを作成。 + + BassWasapi.GetInfo(out var info); + this.hMixer = BassMix.CreateMixerStream( + info.Frequency, + info.Channels, + BassFlags.MixerNonStop | BassFlags.Float | BassFlags.Decode); // デコードのみ=発声しない。WASAPIに出力されるだけ。 + if (this.hMixer == 0) { + Errors errcode = Bass.LastError; + BassWasapi.Free(); + Bass.Free(); + this.bIsBASSFree = true; + throw new Exception(string.Format("BASSミキサ(mixing)の作成に失敗しました。[{0}]", errcode)); + } + + + // BASS ミキサーの1秒あたりのバイト数を算出。 + + var mixerInfo = Bass.ChannelGetInfo(this.hMixer); + long nミキサーの1サンプルあたりのバイト数 = mixerInfo.Channels * 4; // 4 = sizeof(FLOAT) + this.nミキサーの1秒あたりのバイト数 = nミキサーの1サンプルあたりのバイト数 * mixerInfo.Frequency; + + + + // 単純に、hMixerの音量をMasterVolumeとして制御しても、 + // ChannelGetData()の内容には反映されない。 + // そのため、もう一段mixerを噛ませて、一段先のmixerからChannelGetData()することで、 + // hMixerの音量制御を反映させる。 + this.hMixer_DeviceOut = BassMix.CreateMixerStream( + info.Frequency, + info.Channels, + BassFlags.MixerNonStop | BassFlags.Float | BassFlags.Decode); // デコードのみ=発声しない。WASAPIに出力されるだけ。 + if (this.hMixer_DeviceOut == 0) { + Errors errcode = Bass.LastError; + BassWasapi.Free(); + Bass.Free(); + this.bIsBASSFree = true; + throw new Exception(string.Format("BASSミキサ(最終段)の作成に失敗しました。[{0}]", errcode)); + } + + { + bool b1 = BassMix.MixerAddChannel(this.hMixer_DeviceOut, this.hMixer, BassFlags.Default); + if (!b1) { Errors errcode = Bass.LastError; BassWasapi.Free(); Bass.Free(); this.bIsBASSFree = true; - throw new Exception(string.Format("BASSミキサ(mixing)の作成に失敗しました。[{0}]", errcode)); - } - - - // BASS ミキサーの1秒あたりのバイト数を算出。 - - var mixerInfo = Bass.ChannelGetInfo(this.hMixer); - long nミキサーの1サンプルあたりのバイト数 = mixerInfo.Channels * 4; // 4 = sizeof(FLOAT) - this.nミキサーの1秒あたりのバイト数 = nミキサーの1サンプルあたりのバイト数 * mixerInfo.Frequency; - - - - // 単純に、hMixerの音量をMasterVolumeとして制御しても、 - // ChannelGetData()の内容には反映されない。 - // そのため、もう一段mixerを噛ませて、一段先のmixerからChannelGetData()することで、 - // hMixerの音量制御を反映させる。 - this.hMixer_DeviceOut = BassMix.CreateMixerStream( - info.Frequency, - info.Channels, - BassFlags.MixerNonStop | BassFlags.Float | BassFlags.Decode); // デコードのみ=発声しない。WASAPIに出力されるだけ。 - if (this.hMixer_DeviceOut == 0) { - Errors errcode = Bass.LastError; - BassWasapi.Free(); - Bass.Free(); - this.bIsBASSFree = true; - throw new Exception(string.Format("BASSミキサ(最終段)の作成に失敗しました。[{0}]", errcode)); - } - - { - bool b1 = BassMix.MixerAddChannel(this.hMixer_DeviceOut, this.hMixer, BassFlags.Default); - if (!b1) { - Errors errcode = Bass.LastError; - BassWasapi.Free(); - Bass.Free(); - this.bIsBASSFree = true; - throw new Exception(string.Format("BASSミキサ(最終段とmixing)の接続に失敗しました。[{0}]", errcode)); - }; - } - - - // 出力を開始。 - - BassWasapi.Start(); - } - #region [ tサウンドを作成する() ] - public CSound tCreateSound(string strファイル名, ESoundGroup soundGroup) { - var sound = new CSound(soundGroup); - sound.CreateWASAPISound(strファイル名, this.hMixer, this.SoundDeviceType); - return sound; + throw new Exception(string.Format("BASSミキサ(最終段とmixing)の接続に失敗しました。[{0}]", errcode)); + }; } - public void tCreateSound(string strファイル名, CSound sound) { - sound.CreateWASAPISound(strファイル名, this.hMixer, this.SoundDeviceType); - } - #endregion - #region [ Dispose-Finallizeパターン実装 ] - //----------------- - public void Dispose() { - this.Dispose(true); - GC.SuppressFinalize(this); - } - protected void Dispose(bool bManagedDispose) { - SoundDeviceType = ESoundDeviceType.Unknown; // まず出力停止する(Dispose中にクラス内にアクセスされることを防ぐ) - if (hMixer != -1) { - Bass.StreamFree(hMixer); - } - if (!bIsBASSFree) { - BassWasapi.Free(); // システムタイマより先に呼び出すこと。(tWasapi処理() の中でシステムタイマを参照してるため) - Bass.Free(); - } - if (bManagedDispose) { - SystemTimer.Dispose(); - SystemTimer = null; - } - } - ~CSoundDeviceWASAPI() { - this.Dispose(false); - } - //----------------- - #endregion + // 出力を開始。 - protected int hMixer = -1; - protected int hMixer_DeviceOut = -1; - protected WasapiProcedure tWasapiProc = null; - - protected int tWASAPI処理(IntPtr buffer, int length, IntPtr user) { - // BASSミキサからの出力データをそのまま WASAPI buffer へ丸投げ。 - - int num = Bass.ChannelGetData(this.hMixer_DeviceOut, buffer, length); // num = 実際に転送した長さ - if (num == -1) num = 0; - - - // 経過時間を更新。 - // データの転送差分ではなく累積転送バイト数から算出する。 - - int n未再生バイト数 = BassWasapi.GetData(null, (int)DataFlags.Available); // 誤差削減のため、必要となるギリギリ直前に取得する。 - this.ElapsedTimeMs = (this.n累積転送バイト数 - n未再生バイト数) * 1000 / this.nミキサーの1秒あたりのバイト数; - this.UpdateSystemTimeMs = this.SystemTimer.SystemTimeMs; - - // 実出力遅延を更新。 - // 未再生バイト数の平均値。 - - long n今回の遅延ms = n未再生バイト数 * 1000 / this.nミキサーの1秒あたりのバイト数; - this.OutputDelay = (this.b最初の実出力遅延算出) ? n今回の遅延ms : (this.OutputDelay + n今回の遅延ms) / 2; - this.b最初の実出力遅延算出 = false; - - - // 経過時間を更新後に、今回分の累積転送バイト数を反映。 - - this.n累積転送バイト数 += num; - return num; - } - - private long nミキサーの1秒あたりのバイト数 = 0; - private long n累積転送バイト数 = 0; - private bool b最初の実出力遅延算出 = true; - private bool bIsBASSFree = true; + BassWasapi.Start(); } + #region [ tサウンドを作成する() ] + public CSound tCreateSound(string strファイル名, ESoundGroup soundGroup) { + var sound = new CSound(soundGroup); + sound.CreateWASAPISound(strファイル名, this.hMixer, this.SoundDeviceType); + return sound; + } + + public void tCreateSound(string strファイル名, CSound sound) { + sound.CreateWASAPISound(strファイル名, this.hMixer, this.SoundDeviceType); + } + #endregion + + #region [ Dispose-Finallizeパターン実装 ] + //----------------- + public void Dispose() { + this.Dispose(true); + GC.SuppressFinalize(this); + } + protected void Dispose(bool bManagedDispose) { + SoundDeviceType = ESoundDeviceType.Unknown; // まず出力停止する(Dispose中にクラス内にアクセスされることを防ぐ) + if (hMixer != -1) { + Bass.StreamFree(hMixer); + } + if (!bIsBASSFree) { + BassWasapi.Free(); // システムタイマより先に呼び出すこと。(tWasapi処理() の中でシステムタイマを参照してるため) + Bass.Free(); + } + if (bManagedDispose) { + SystemTimer.Dispose(); + SystemTimer = null; + } + } + ~CSoundDeviceWASAPI() { + this.Dispose(false); + } + //----------------- + #endregion + + protected int hMixer = -1; + protected int hMixer_DeviceOut = -1; + protected WasapiProcedure tWasapiProc = null; + + protected int tWASAPI処理(IntPtr buffer, int length, IntPtr user) { + // BASSミキサからの出力データをそのまま WASAPI buffer へ丸投げ。 + + int num = Bass.ChannelGetData(this.hMixer_DeviceOut, buffer, length); // num = 実際に転送した長さ + if (num == -1) num = 0; + + + // 経過時間を更新。 + // データの転送差分ではなく累積転送バイト数から算出する。 + + int n未再生バイト数 = BassWasapi.GetData(null, (int)DataFlags.Available); // 誤差削減のため、必要となるギリギリ直前に取得する。 + this.ElapsedTimeMs = (this.n累積転送バイト数 - n未再生バイト数) * 1000 / this.nミキサーの1秒あたりのバイト数; + this.UpdateSystemTimeMs = this.SystemTimer.SystemTimeMs; + + // 実出力遅延を更新。 + // 未再生バイト数の平均値。 + + long n今回の遅延ms = n未再生バイト数 * 1000 / this.nミキサーの1秒あたりのバイト数; + this.OutputDelay = (this.b最初の実出力遅延算出) ? n今回の遅延ms : (this.OutputDelay + n今回の遅延ms) / 2; + this.b最初の実出力遅延算出 = false; + + + // 経過時間を更新後に、今回分の累積転送バイト数を反映。 + + this.n累積転送バイト数 += num; + return num; + } + + private long nミキサーの1秒あたりのバイト数 = 0; + private long n累積転送バイト数 = 0; + private bool b最初の実出力遅延算出 = true; + private bool bIsBASSFree = true; } diff --git a/FDK/src/03.Sound/CSoundTimer.cs b/FDK/src/03.Sound/CSoundTimer.cs index 6251e8ce..ec01909f 100644 --- a/FDK/src/03.Sound/CSoundTimer.cs +++ b/FDK/src/03.Sound/CSoundTimer.cs @@ -1,103 +1,103 @@ using System.Diagnostics; -namespace FDK { - public class CSoundTimer : CTimerBase { - public override long SystemTimeMs { - get { - if (this.Device.SoundDeviceType == ESoundDeviceType.Bass || - this.Device.SoundDeviceType == ESoundDeviceType.ExclusiveWASAPI || - this.Device.SoundDeviceType == ESoundDeviceType.SharedWASAPI || - this.Device.SoundDeviceType == ESoundDeviceType.ASIO) { - // BASS 系の ISoundDevice.n経過時間ms はオーディオバッファの更新間隔ずつでしか更新されないため、単にこれを返すだけではとびとびの値になる。 - // そこで、更新間隔の最中に呼ばれた場合は、システムタイマを使って補間する。 - // この場合の経過時間との誤差は更新間隔以内に収まるので問題ないと判断する。 - // ただし、ASIOの場合は、転送byte数から時間算出しているため、ASIOの音声合成処理の負荷が大きすぎる場合(処理時間が実時間を超えている場合)は - // 動作がおかしくなる。(具体的には、ここで返すタイマー値の逆行が発生し、スクロールが巻き戻る) - // この場合の対策は、ASIOのバッファ量を増やして、ASIOの音声合成処理の負荷を下げること。 +namespace FDK; - if (this.Device.UpdateSystemTimeMs == CTimer.UnusedNum) // #33890 2014.5.27 yyagi +public class CSoundTimer : CTimerBase { + public override long SystemTimeMs { + get { + if (this.Device.SoundDeviceType == ESoundDeviceType.Bass || + this.Device.SoundDeviceType == ESoundDeviceType.ExclusiveWASAPI || + this.Device.SoundDeviceType == ESoundDeviceType.SharedWASAPI || + this.Device.SoundDeviceType == ESoundDeviceType.ASIO) { + // BASS 系の ISoundDevice.n経過時間ms はオーディオバッファの更新間隔ずつでしか更新されないため、単にこれを返すだけではとびとびの値になる。 + // そこで、更新間隔の最中に呼ばれた場合は、システムタイマを使って補間する。 + // この場合の経過時間との誤差は更新間隔以内に収まるので問題ないと判断する。 + // ただし、ASIOの場合は、転送byte数から時間算出しているため、ASIOの音声合成処理の負荷が大きすぎる場合(処理時間が実時間を超えている場合)は + // 動作がおかしくなる。(具体的には、ここで返すタイマー値の逆行が発生し、スクロールが巻き戻る) + // この場合の対策は、ASIOのバッファ量を増やして、ASIOの音声合成処理の負荷を下げること。 + + if (this.Device.UpdateSystemTimeMs == CTimer.UnusedNum) // #33890 2014.5.27 yyagi + { + // 環境によっては、ASIOベースの演奏タイマーが動作する前(つまりASIOのサウンド転送が始まる前)に + // DTXデータの演奏が始まる場合がある。 + // その場合、"this.Device.n経過時間を更新したシステム時刻" が正しい値でないため、 + // 演奏タイマの値が正しいものとはならない。そして、演奏タイマーの動作が始まると同時に、 + // 演奏タイマの値がすっ飛ぶ(極端な負の値になる)ため、演奏のみならず画面表示もされない状態となる。 + // (画面表示はタイマの値に連動して行われるが、0以上のタイマ値に合わせて動作するため、 + // 不の値が来ると画面に何も表示されなくなる) + + // そこで、演奏タイマが動作を始める前(this.Device.n経過時間を更新したシステム時刻ms == CTimer.n未使用)は、 + // 補正部分をゼロにして、n経過時間msだけを返すようにする。 + // こうすることで、演奏タイマが動作を始めても、破綻しなくなる。 + return this.Device.ElapsedTimeMs; + } else { + if (FDK.SoundManager.bUseOSTimer) + //if ( true ) { - // 環境によっては、ASIOベースの演奏タイマーが動作する前(つまりASIOのサウンド転送が始まる前)に - // DTXデータの演奏が始まる場合がある。 - // その場合、"this.Device.n経過時間を更新したシステム時刻" が正しい値でないため、 - // 演奏タイマの値が正しいものとはならない。そして、演奏タイマーの動作が始まると同時に、 - // 演奏タイマの値がすっ飛ぶ(極端な負の値になる)ため、演奏のみならず画面表示もされない状態となる。 - // (画面表示はタイマの値に連動して行われるが、0以上のタイマ値に合わせて動作するため、 - // 不の値が来ると画面に何も表示されなくなる) - - // そこで、演奏タイマが動作を始める前(this.Device.n経過時間を更新したシステム時刻ms == CTimer.n未使用)は、 - // 補正部分をゼロにして、n経過時間msだけを返すようにする。 - // こうすることで、演奏タイマが動作を始めても、破綻しなくなる。 - return this.Device.ElapsedTimeMs; + return ctDInputTimer.SystemTimeMs; // 仮にCSoundTimerをCTimer相当の動作にしてみた } else { - if (FDK.SoundManager.bUseOSTimer) - //if ( true ) - { - return ctDInputTimer.SystemTimeMs; // 仮にCSoundTimerをCTimer相当の動作にしてみた - } else { - return this.Device.ElapsedTimeMs - + (this.Device.SystemTimer.SystemTimeMs - this.Device.UpdateSystemTimeMs); - } + return this.Device.ElapsedTimeMs + + (this.Device.SystemTimer.SystemTimeMs - this.Device.UpdateSystemTimeMs); } } - return CTimerBase.UnusedNum; } + return CTimerBase.UnusedNum; } - - internal CSoundTimer(ISoundDevice device) { - this.Device = device; - - TimerCallback timerDelegate = new TimerCallback(SnapTimers); // CSoundTimerをシステム時刻に変換するために、 - timer = new Timer(timerDelegate, null, 0, 1000); // CSoundTimerとCTimerを両方とも走らせておき、 - ctDInputTimer = new CTimer(CTimer.TimerType.MultiMedia); // 1秒に1回時差を測定するようにしておく - } - - private void SnapTimers(object o) // 1秒に1回呼び出され、2つのタイマー間の現在値をそれぞれ保持する。 - { - try { - this.nDInputTimerCounter = this.ctDInputTimer.SystemTimeMs; - this.nSoundTimerCounter = this.SystemTimeMs; - //Debug.WriteLine( "BaseCounter: " + nDInputTimerCounter + ", " + nSoundTimerCounter ); - } catch (Exception e) - // サウンド設定変更時に、timer.Dispose()した後、timerが実際に停止する前にここに来てしまう場合があり - // その際にNullReferenceExceptionが発生する - // timerが実際に停止したことを検出してから次の設定をすべきだが、実装が難しいため、 - // ここで単に例外破棄することで代替する - { - Trace.TraceInformation(e.ToString()); - Trace.TraceInformation("FDK: CSoundTimer.SnapTimers(): 例外発生しましたが、継続します。"); - } - } - public long nサウンドタイマーのシステム時刻msへの変換(long nDInputのタイムスタンプ) { - return nDInputのタイムスタンプ - this.nDInputTimerCounter + this.nSoundTimerCounter; // Timer違いによる時差を補正する - } - - public override void Dispose() { - // 特になし; ISoundDevice の解放は呼び出し元で行うこと。 - - //sendinputスレッド削除 - if (timer != null) { - timer.Change(System.Threading.Timeout.Infinite, System.Threading.Timeout.Infinite); - // ここで、実際にtimerが停止したことを確認するコードを追加すべきだが、やり方わからず。 - // 代替策として、SnapTimers()中で、例外発生を破棄している。 - timer.Dispose(); - timer = null; - } - if (ct != null) { - ct.Pause(); - ct.Dispose(); - ct = null; - } - } - - internal ISoundDevice Device = null; // debugのため、一時的にprotectedをpublicにする。後で元に戻しておくこと。 - //protected Thread thSendInput = null; - //protected Thread thSnapTimers = null; - private CTimer ctDInputTimer = null; - private long nDInputTimerCounter = 0; - private long nSoundTimerCounter = 0; - Timer timer = null; - - private CTimer ct = null; // TESTCODE } + + internal CSoundTimer(ISoundDevice device) { + this.Device = device; + + TimerCallback timerDelegate = new TimerCallback(SnapTimers); // CSoundTimerをシステム時刻に変換するために、 + timer = new Timer(timerDelegate, null, 0, 1000); // CSoundTimerとCTimerを両方とも走らせておき、 + ctDInputTimer = new CTimer(CTimer.TimerType.MultiMedia); // 1秒に1回時差を測定するようにしておく + } + + private void SnapTimers(object o) // 1秒に1回呼び出され、2つのタイマー間の現在値をそれぞれ保持する。 + { + try { + this.nDInputTimerCounter = this.ctDInputTimer.SystemTimeMs; + this.nSoundTimerCounter = this.SystemTimeMs; + //Debug.WriteLine( "BaseCounter: " + nDInputTimerCounter + ", " + nSoundTimerCounter ); + } catch (Exception e) + // サウンド設定変更時に、timer.Dispose()した後、timerが実際に停止する前にここに来てしまう場合があり + // その際にNullReferenceExceptionが発生する + // timerが実際に停止したことを検出してから次の設定をすべきだが、実装が難しいため、 + // ここで単に例外破棄することで代替する + { + Trace.TraceInformation(e.ToString()); + Trace.TraceInformation("FDK: CSoundTimer.SnapTimers(): 例外発生しましたが、継続します。"); + } + } + public long nサウンドタイマーのシステム時刻msへの変換(long nDInputのタイムスタンプ) { + return nDInputのタイムスタンプ - this.nDInputTimerCounter + this.nSoundTimerCounter; // Timer違いによる時差を補正する + } + + public override void Dispose() { + // 特になし; ISoundDevice の解放は呼び出し元で行うこと。 + + //sendinputスレッド削除 + if (timer != null) { + timer.Change(System.Threading.Timeout.Infinite, System.Threading.Timeout.Infinite); + // ここで、実際にtimerが停止したことを確認するコードを追加すべきだが、やり方わからず。 + // 代替策として、SnapTimers()中で、例外発生を破棄している。 + timer.Dispose(); + timer = null; + } + if (ct != null) { + ct.Pause(); + ct.Dispose(); + ct = null; + } + } + + internal ISoundDevice Device = null; // debugのため、一時的にprotectedをpublicにする。後で元に戻しておくこと。 + //protected Thread thSendInput = null; + //protected Thread thSnapTimers = null; + private CTimer ctDInputTimer = null; + private long nDInputTimerCounter = 0; + private long nSoundTimerCounter = 0; + Timer timer = null; + + private CTimer ct = null; // TESTCODE } diff --git a/FDK/src/03.Sound/ESoundDeviceType.cs b/FDK/src/03.Sound/ESoundDeviceType.cs index 7bb6eece..26ad5229 100644 --- a/FDK/src/03.Sound/ESoundDeviceType.cs +++ b/FDK/src/03.Sound/ESoundDeviceType.cs @@ -1,9 +1,9 @@ -namespace FDK { - public enum ESoundDeviceType { - Bass, - ExclusiveWASAPI, - SharedWASAPI, - ASIO, - Unknown, - } +namespace FDK; + +public enum ESoundDeviceType { + Bass, + ExclusiveWASAPI, + SharedWASAPI, + ASIO, + Unknown, } diff --git a/FDK/src/03.Sound/ESoundGroup.cs b/FDK/src/03.Sound/ESoundGroup.cs index b32fa18a..e86581ac 100644 --- a/FDK/src/03.Sound/ESoundGroup.cs +++ b/FDK/src/03.Sound/ESoundGroup.cs @@ -1,9 +1,9 @@ -namespace FDK { - public enum ESoundGroup { - SoundEffect = 1, - Voice = 2, - SongPreview = 3, - SongPlayback = 4, - Unknown = 0 - } +namespace FDK; + +public enum ESoundGroup { + SoundEffect = 1, + Voice = 2, + SongPreview = 3, + SongPlayback = 4, + Unknown = 0 } diff --git a/FDK/src/03.Sound/ExtensionMethods/BassMixExtensions.cs b/FDK/src/03.Sound/ExtensionMethods/BassMixExtensions.cs index f558de39..8024b489 100644 --- a/FDK/src/03.Sound/ExtensionMethods/BassMixExtensions.cs +++ b/FDK/src/03.Sound/ExtensionMethods/BassMixExtensions.cs @@ -1,18 +1,18 @@ using ManagedBass; using ManagedBass.Mix; -namespace FDK.BassMixExtension { - public static class BassMixExtensions { - public static bool ChannelPlay(int hHandle) { - return BassMix.ChannelRemoveFlag(hHandle, BassFlags.MixerChanPause); - } +namespace FDK.BassMixExtension; - public static bool ChannelPause(int hHandle) { - return BassMix.ChannelAddFlag(hHandle, BassFlags.MixerChanPause); - } +public static class BassMixExtensions { + public static bool ChannelPlay(int hHandle) { + return BassMix.ChannelRemoveFlag(hHandle, BassFlags.MixerChanPause); + } - public static bool ChannelIsPlaying(int hHandle) { - return !BassMix.ChannelHasFlag(hHandle, BassFlags.MixerChanPause); - } + public static bool ChannelPause(int hHandle) { + return BassMix.ChannelAddFlag(hHandle, BassFlags.MixerChanPause); + } + + public static bool ChannelIsPlaying(int hHandle) { + return !BassMix.ChannelHasFlag(hHandle, BassFlags.MixerChanPause); } } diff --git a/FDK/src/03.Sound/ISoundDevice.cs b/FDK/src/03.Sound/ISoundDevice.cs index 434e2dec..c6ee8192 100644 --- a/FDK/src/03.Sound/ISoundDevice.cs +++ b/FDK/src/03.Sound/ISoundDevice.cs @@ -1,14 +1,14 @@ -namespace FDK { - internal interface ISoundDevice : IDisposable { - ESoundDeviceType SoundDeviceType { get; } - int nMasterVolume { get; set; } - long OutputDelay { get; } - long BufferSize { get; } - long ElapsedTimeMs { get; } - long UpdateSystemTimeMs { get; } - CTimer SystemTimer { get; } +namespace FDK; - CSound tCreateSound(string strファイル名, ESoundGroup soundGroup); - void tCreateSound(string strファイル名, CSound sound); - } +internal interface ISoundDevice : IDisposable { + ESoundDeviceType SoundDeviceType { get; } + int nMasterVolume { get; set; } + long OutputDelay { get; } + long BufferSize { get; } + long ElapsedTimeMs { get; } + long UpdateSystemTimeMs { get; } + CTimer SystemTimer { get; } + + CSound tCreateSound(string strファイル名, ESoundGroup soundGroup); + void tCreateSound(string strファイル名, CSound sound); } diff --git a/FDK/src/03.Sound/LoudnessMetadata.cs b/FDK/src/03.Sound/LoudnessMetadata.cs index 3d5ed629..e6002367 100644 --- a/FDK/src/03.Sound/LoudnessMetadata.cs +++ b/FDK/src/03.Sound/LoudnessMetadata.cs @@ -1,17 +1,17 @@ -namespace FDK { - /// - /// The LoudnessMetadata structure is used to carry, and assist with - /// calculations related to, integrated loudness and true peak - /// loudness. - /// - [Serializable] - public struct LoudnessMetadata { - public readonly Lufs Integrated; - public readonly Lufs? TruePeak; +namespace FDK; - public LoudnessMetadata(Lufs integrated, Lufs? truePeak) { - Integrated = integrated; - TruePeak = truePeak; - } +/// +/// The LoudnessMetadata structure is used to carry, and assist with +/// calculations related to, integrated loudness and true peak +/// loudness. +/// +[Serializable] +public struct LoudnessMetadata { + public readonly Lufs Integrated; + public readonly Lufs? TruePeak; + + public LoudnessMetadata(Lufs integrated, Lufs? truePeak) { + Integrated = integrated; + TruePeak = truePeak; } } diff --git a/FDK/src/03.Sound/LoudnessMetadataScanner.cs b/FDK/src/03.Sound/LoudnessMetadataScanner.cs index 96bd487d..7c4c485a 100644 --- a/FDK/src/03.Sound/LoudnessMetadataScanner.cs +++ b/FDK/src/03.Sound/LoudnessMetadataScanner.cs @@ -2,295 +2,295 @@ using System.Diagnostics; using System.Xml.XPath; -namespace FDK { - /// - /// The LoudnessMetadataScanner plays two roles: - /// 1. Scanning of song audio files using BS1770GAIN (http://bs1770gain.sourceforge.net/) - /// to determine their perceived loudness. Running on a background thread while not - /// in song gameplay, songs without existing loudness metadata files (e.g. *.bs1770gain.xml) - /// have their perceived loudness determined and saved into an associated metadata file - /// without modifying the original audio file. This scanning process begins running - /// with scanning jobs ordered based on the order in which songs are enumerated when - /// the application starts, but shifts to prioritize songs which are browsed and previewed - /// while on the song select screen. - /// 2. Loading of loudness metadata from the BS1770GAIN metadata file alongside each audio file. - /// This occurs when parsing .tja files, when song preview begins, and when song playback - /// begins. When no file is available on disk, a scanning job is passed to the background - /// scanning thread for processing. The loaded metadata is then passed into the - /// SongGainController for combination with a configured target loudness, resulting in a - /// gain value assigned to the sound object just before playback begins. - /// - public static class LoudnessMetadataScanner { - private const string Bs1770GainExeFileName = "bs1770gain.exe"; +namespace FDK; - private static readonly Stack Jobs = new Stack(); - private static readonly object LockObject = new object(); - private static readonly Queue RecentFileScanDurations = new Queue(); +/// +/// The LoudnessMetadataScanner plays two roles: +/// 1. Scanning of song audio files using BS1770GAIN (http://bs1770gain.sourceforge.net/) +/// to determine their perceived loudness. Running on a background thread while not +/// in song gameplay, songs without existing loudness metadata files (e.g. *.bs1770gain.xml) +/// have their perceived loudness determined and saved into an associated metadata file +/// without modifying the original audio file. This scanning process begins running +/// with scanning jobs ordered based on the order in which songs are enumerated when +/// the application starts, but shifts to prioritize songs which are browsed and previewed +/// while on the song select screen. +/// 2. Loading of loudness metadata from the BS1770GAIN metadata file alongside each audio file. +/// This occurs when parsing .tja files, when song preview begins, and when song playback +/// begins. When no file is available on disk, a scanning job is passed to the background +/// scanning thread for processing. The loaded metadata is then passed into the +/// SongGainController for combination with a configured target loudness, resulting in a +/// gain value assigned to the sound object just before playback begins. +/// +public static class LoudnessMetadataScanner { + private const string Bs1770GainExeFileName = "bs1770gain.exe"; - private static Thread ScanningThread; - private static Semaphore Semaphore; + private static readonly Stack Jobs = new Stack(); + private static readonly object LockObject = new object(); + private static readonly Queue RecentFileScanDurations = new Queue(); - public static void StartBackgroundScanning() { - var tracePrefix = $"{nameof(LoudnessMetadataScanner)}.{nameof(StartBackgroundScanning)}"; + private static Thread ScanningThread; + private static Semaphore Semaphore; - if (!IsBs1770GainAvailable()) { - Trace.TraceInformation($"{tracePrefix}: BS1770GAIN is not available. A background scanning thread will not be started."); - return; - } + public static void StartBackgroundScanning() { + var tracePrefix = $"{nameof(LoudnessMetadataScanner)}.{nameof(StartBackgroundScanning)}"; - Trace.TraceInformation($"{tracePrefix}: BS1770GAIN is available. Starting background scanning thread..."); - - lock (LockObject) { - Semaphore = new Semaphore(Jobs.Count, int.MaxValue); - ScanningThread = new Thread(Scan) { - IsBackground = true, - Name = "LoudnessMetadataScanner background scanning thread.", - Priority = ThreadPriority.Lowest - }; - ScanningThread.Start(); - } - - Trace.TraceInformation($"{tracePrefix}: Background scanning thread started."); + if (!IsBs1770GainAvailable()) { + Trace.TraceInformation($"{tracePrefix}: BS1770GAIN is not available. A background scanning thread will not be started."); + return; } - public static void StopBackgroundScanning(bool joinImmediately) { - var scanningThread = ScanningThread; + Trace.TraceInformation($"{tracePrefix}: BS1770GAIN is available. Starting background scanning thread..."); - if (scanningThread == null) { - return; - } - - var tracePrefix = $"{nameof(LoudnessMetadataScanner)}.{nameof(StopBackgroundScanning)}"; - - Trace.TraceInformation($"{tracePrefix}: Stopping background scanning thread..."); - - lock (LockObject) { - ScanningThread = null; - Semaphore.Release(); - Semaphore = null; - } - - if (joinImmediately) { - scanningThread.Join(); - } - - Trace.TraceInformation($"{tracePrefix}: Background scanning thread stopped."); + lock (LockObject) { + Semaphore = new Semaphore(Jobs.Count, int.MaxValue); + ScanningThread = new Thread(Scan) { + IsBackground = true, + Name = "LoudnessMetadataScanner background scanning thread.", + Priority = ThreadPriority.Lowest + }; + ScanningThread.Start(); } - public static LoudnessMetadata? LoadForAudioPath(string absoluteBgmPath) { - try { - var loudnessMetadataPath = GetLoudnessMetadataPath(absoluteBgmPath); + Trace.TraceInformation($"{tracePrefix}: Background scanning thread started."); + } - if (File.Exists(loudnessMetadataPath)) { - return LoadFromMetadataPath(loudnessMetadataPath); - } + public static void StopBackgroundScanning(bool joinImmediately) { + var scanningThread = ScanningThread; - SubmitForBackgroundScanning(absoluteBgmPath); - } catch (Exception e) { - var tracePrefix = $"{nameof(LoudnessMetadataScanner)}.{nameof(LoadForAudioPath)}"; - Trace.TraceError($"{tracePrefix}: Encountered an exception while attempting to load {absoluteBgmPath}"); - Trace.TraceError(e.ToString()); + if (scanningThread == null) { + return; + } + + var tracePrefix = $"{nameof(LoudnessMetadataScanner)}.{nameof(StopBackgroundScanning)}"; + + Trace.TraceInformation($"{tracePrefix}: Stopping background scanning thread..."); + + lock (LockObject) { + ScanningThread = null; + Semaphore.Release(); + Semaphore = null; + } + + if (joinImmediately) { + scanningThread.Join(); + } + + Trace.TraceInformation($"{tracePrefix}: Background scanning thread stopped."); + } + + public static LoudnessMetadata? LoadForAudioPath(string absoluteBgmPath) { + try { + var loudnessMetadataPath = GetLoudnessMetadataPath(absoluteBgmPath); + + if (File.Exists(loudnessMetadataPath)) { + return LoadFromMetadataPath(loudnessMetadataPath); } + SubmitForBackgroundScanning(absoluteBgmPath); + } catch (Exception e) { + var tracePrefix = $"{nameof(LoudnessMetadataScanner)}.{nameof(LoadForAudioPath)}"; + Trace.TraceError($"{tracePrefix}: Encountered an exception while attempting to load {absoluteBgmPath}"); + Trace.TraceError(e.ToString()); + } + + return null; + } + + private static string GetLoudnessMetadataPath(string absoluteBgmPath) { + return Path.Combine( + Path.GetDirectoryName(absoluteBgmPath), + Path.GetFileNameWithoutExtension(absoluteBgmPath) + ".bs1770gain.xml"); + } + + private static LoudnessMetadata? LoadFromMetadataPath(string loudnessMetadataPath) { + XPathDocument xPathDocument; + try { + xPathDocument = new XPathDocument(loudnessMetadataPath); + } catch (IOException) { + var tracePrefix = $"{nameof(LoudnessMetadataScanner)}.{nameof(LoadFromMetadataPath)}"; + Trace.TraceWarning($"{tracePrefix}: Encountered IOException while attempting to read {loudnessMetadataPath}. This can occur when attempting to load while scanning the same file. Returning null..."); return null; } - private static string GetLoudnessMetadataPath(string absoluteBgmPath) { - return Path.Combine( - Path.GetDirectoryName(absoluteBgmPath), - Path.GetFileNameWithoutExtension(absoluteBgmPath) + ".bs1770gain.xml"); + var trackNavigator = xPathDocument.CreateNavigator() + .SelectSingleNode(@"//bs1770gain/track[@ToTal=""1"" and @Number=""1""]"); + + var integratedLufsNode = trackNavigator?.SelectSingleNode(@"integrated/@lufs"); + var truePeakTpfsNode = trackNavigator?.SelectSingleNode(@"true-peak/@tpfs"); + + if (trackNavigator == null || integratedLufsNode == null || truePeakTpfsNode == null) { + var tracePrefix = $"{nameof(LoudnessMetadataScanner)}.{nameof(LoadFromMetadataPath)}"; + Trace.TraceWarning($"{tracePrefix}: Encountered incorrect xml element structure while parsing {loudnessMetadataPath}. Returning null..."); + return null; } - private static LoudnessMetadata? LoadFromMetadataPath(string loudnessMetadataPath) { - XPathDocument xPathDocument; - try { - xPathDocument = new XPathDocument(loudnessMetadataPath); - } catch (IOException) { - var tracePrefix = $"{nameof(LoudnessMetadataScanner)}.{nameof(LoadFromMetadataPath)}"; - Trace.TraceWarning($"{tracePrefix}: Encountered IOException while attempting to read {loudnessMetadataPath}. This can occur when attempting to load while scanning the same file. Returning null..."); - return null; - } + var integrated = integratedLufsNode.ValueAsDouble; + var truePeak = truePeakTpfsNode.ValueAsDouble; - var trackNavigator = xPathDocument.CreateNavigator() - .SelectSingleNode(@"//bs1770gain/track[@ToTal=""1"" and @Number=""1""]"); - - var integratedLufsNode = trackNavigator?.SelectSingleNode(@"integrated/@lufs"); - var truePeakTpfsNode = trackNavigator?.SelectSingleNode(@"true-peak/@tpfs"); - - if (trackNavigator == null || integratedLufsNode == null || truePeakTpfsNode == null) { - var tracePrefix = $"{nameof(LoudnessMetadataScanner)}.{nameof(LoadFromMetadataPath)}"; - Trace.TraceWarning($"{tracePrefix}: Encountered incorrect xml element structure while parsing {loudnessMetadataPath}. Returning null..."); - return null; - } - - var integrated = integratedLufsNode.ValueAsDouble; - var truePeak = truePeakTpfsNode.ValueAsDouble; - - if (integrated <= -70.0 || truePeak >= 12.04) { - var tracePrefix = $"{nameof(LoudnessMetadataScanner)}.{nameof(LoadFromMetadataPath)}"; - Trace.TraceWarning($"{tracePrefix}: Encountered evidence of extreme clipping while parsing {loudnessMetadataPath}. Returning null..."); - return null; - } - - return new LoudnessMetadata(new Lufs(integrated), new Lufs(truePeak)); + if (integrated <= -70.0 || truePeak >= 12.04) { + var tracePrefix = $"{nameof(LoudnessMetadataScanner)}.{nameof(LoadFromMetadataPath)}"; + Trace.TraceWarning($"{tracePrefix}: Encountered evidence of extreme clipping while parsing {loudnessMetadataPath}. Returning null..."); + return null; } - private static void SubmitForBackgroundScanning(string absoluteBgmPath) { - lock (LockObject) { - // Quite often, the loading process will cause the same job to be submitted many times. - // As such, we'll do a quick check as when this happens an equivalent job will often - // already be at the top of the stack and we need not add it again. - // - // Note that we will not scan the whole stack as that is an O(n) operation on the main - // thread, whereas redundant file existence checks on the background thread are not harmful. - // - // We also do not want to scan the whole stack, for example to skip pushing a new item onto it, - // because we want to re-submit jobs as the user interacts with their data, usually by - // scrolling through songs and previewing them. Their current interests should drive - // scanning priorities, and it is for this reason that a stack is used instead of a queue. - var semaphore = Semaphore; - if (semaphore != null && (Jobs.Count == 0 || Jobs.Peek() != absoluteBgmPath)) { - Jobs.Push(absoluteBgmPath); - semaphore.Release(); + return new LoudnessMetadata(new Lufs(integrated), new Lufs(truePeak)); + } + + private static void SubmitForBackgroundScanning(string absoluteBgmPath) { + lock (LockObject) { + // Quite often, the loading process will cause the same job to be submitted many times. + // As such, we'll do a quick check as when this happens an equivalent job will often + // already be at the top of the stack and we need not add it again. + // + // Note that we will not scan the whole stack as that is an O(n) operation on the main + // thread, whereas redundant file existence checks on the background thread are not harmful. + // + // We also do not want to scan the whole stack, for example to skip pushing a new item onto it, + // because we want to re-submit jobs as the user interacts with their data, usually by + // scrolling through songs and previewing them. Their current interests should drive + // scanning priorities, and it is for this reason that a stack is used instead of a queue. + var semaphore = Semaphore; + if (semaphore != null && (Jobs.Count == 0 || Jobs.Peek() != absoluteBgmPath)) { + Jobs.Push(absoluteBgmPath); + semaphore.Release(); + } + } + } + + private static void Scan() { + try { + while (true) { + RaiseScanningStateChanged(false); + + Semaphore?.WaitOne(); + + if (ScanningThread == null) { + return; } - } - } - private static void Scan() { - try { - while (true) { - RaiseScanningStateChanged(false); + RaiseScanningStateChanged(true); - Semaphore?.WaitOne(); - - if (ScanningThread == null) { - return; - } - - RaiseScanningStateChanged(true); - - int jobCount; - string absoluteBgmPath; - lock (LockObject) { - jobCount = Jobs.Count; - absoluteBgmPath = Jobs.Pop(); - } - - var tracePrefix = $"{nameof(LoudnessMetadataScanner)}.{nameof(Scan)}"; - - try { - if (!File.Exists(absoluteBgmPath)) { - Trace.TraceWarning($"{tracePrefix}: Scanning jobs outstanding: {jobCount - 1}. Missing audio file. Skipping {absoluteBgmPath}..."); - continue; - } - - var loudnessMetadataPath = GetLoudnessMetadataPath(absoluteBgmPath); - - if (File.Exists(loudnessMetadataPath)) { - Trace.TraceWarning($"{tracePrefix}: Scanning jobs outstanding: {jobCount - 1}. Pre-existing metadata. Skipping {absoluteBgmPath}..."); - continue; - } - - Trace.TraceInformation($"{tracePrefix}: Scanning jobs outstanding: {jobCount}. Scanning {absoluteBgmPath}..."); - var stopwatch = Stopwatch.StartNew(); - - File.Delete(loudnessMetadataPath); - var arguments = $"-it --xml -f \"{Path.GetFileName(loudnessMetadataPath)}\" \"{Path.GetFileName(absoluteBgmPath)}\""; - Execute(Path.GetDirectoryName(absoluteBgmPath), Bs1770GainExeFileName, arguments, true); - - var seconds = stopwatch.Elapsed.TotalSeconds; - RecentFileScanDurations.Enqueue(seconds); - while (RecentFileScanDurations.Count > 20) { - RecentFileScanDurations.Dequeue(); - } - var averageSeconds = RecentFileScanDurations.Average(); - Trace.TraceInformation($"{tracePrefix}: Scanned in {seconds}s. Estimated remaining: {(int)(averageSeconds * (jobCount - 1))}s."); - } catch (Exception e) { - Trace.TraceError($"{tracePrefix}: Encountered an exception while attempting to scan {absoluteBgmPath}"); - Trace.TraceError(e.ToString()); - } + int jobCount; + string absoluteBgmPath; + lock (LockObject) { + jobCount = Jobs.Count; + absoluteBgmPath = Jobs.Pop(); } - } catch (Exception e) { + var tracePrefix = $"{nameof(LoudnessMetadataScanner)}.{nameof(Scan)}"; - Trace.TraceError($"{tracePrefix}: caught an exception at the level of the thread method. The background scanning thread will now terminate."); - Trace.TraceError(e.ToString()); + + try { + if (!File.Exists(absoluteBgmPath)) { + Trace.TraceWarning($"{tracePrefix}: Scanning jobs outstanding: {jobCount - 1}. Missing audio file. Skipping {absoluteBgmPath}..."); + continue; + } + + var loudnessMetadataPath = GetLoudnessMetadataPath(absoluteBgmPath); + + if (File.Exists(loudnessMetadataPath)) { + Trace.TraceWarning($"{tracePrefix}: Scanning jobs outstanding: {jobCount - 1}. Pre-existing metadata. Skipping {absoluteBgmPath}..."); + continue; + } + + Trace.TraceInformation($"{tracePrefix}: Scanning jobs outstanding: {jobCount}. Scanning {absoluteBgmPath}..."); + var stopwatch = Stopwatch.StartNew(); + + File.Delete(loudnessMetadataPath); + var arguments = $"-it --xml -f \"{Path.GetFileName(loudnessMetadataPath)}\" \"{Path.GetFileName(absoluteBgmPath)}\""; + Execute(Path.GetDirectoryName(absoluteBgmPath), Bs1770GainExeFileName, arguments, true); + + var seconds = stopwatch.Elapsed.TotalSeconds; + RecentFileScanDurations.Enqueue(seconds); + while (RecentFileScanDurations.Count > 20) { + RecentFileScanDurations.Dequeue(); + } + var averageSeconds = RecentFileScanDurations.Average(); + Trace.TraceInformation($"{tracePrefix}: Scanned in {seconds}s. Estimated remaining: {(int)(averageSeconds * (jobCount - 1))}s."); + } catch (Exception e) { + Trace.TraceError($"{tracePrefix}: Encountered an exception while attempting to scan {absoluteBgmPath}"); + Trace.TraceError(e.ToString()); + } } + } catch (Exception e) { + var tracePrefix = $"{nameof(LoudnessMetadataScanner)}.{nameof(Scan)}"; + Trace.TraceError($"{tracePrefix}: caught an exception at the level of the thread method. The background scanning thread will now terminate."); + Trace.TraceError(e.ToString()); } + } - private static bool IsBs1770GainAvailable() { - try { - Execute(null, Bs1770GainExeFileName, "-h"); - return true; - } catch (Win32Exception) { - return false; - } catch (Exception e) { - var tracePrefix = $"{nameof(LoudnessMetadataScanner)}.{nameof(IsBs1770GainAvailable)}"; - Trace.TraceError($"{tracePrefix}: Encountered an exception. Returning false..."); - Trace.TraceError(e.ToString()); + private static bool IsBs1770GainAvailable() { + try { + Execute(null, Bs1770GainExeFileName, "-h"); + return true; + } catch (Win32Exception) { + return false; + } catch (Exception e) { + var tracePrefix = $"{nameof(LoudnessMetadataScanner)}.{nameof(IsBs1770GainAvailable)}"; + Trace.TraceError($"{tracePrefix}: Encountered an exception. Returning false..."); + Trace.TraceError(e.ToString()); - return false; - } + return false; } + } - private static string Execute( - string workingDirectory, string fileName, string arguments, bool shouldFailOnStdErrDataReceived = false) { - var processStartInfo = new ProcessStartInfo(fileName, arguments) { - CreateNoWindow = true, - RedirectStandardError = true, - RedirectStandardOutput = true, - UseShellExecute = false, - WorkingDirectory = workingDirectory ?? "" + private static string Execute( + string workingDirectory, string fileName, string arguments, bool shouldFailOnStdErrDataReceived = false) { + var processStartInfo = new ProcessStartInfo(fileName, arguments) { + CreateNoWindow = true, + RedirectStandardError = true, + RedirectStandardOutput = true, + UseShellExecute = false, + WorkingDirectory = workingDirectory ?? "" + }; + + var stdoutWriter = new StringWriter(); + var stderrWriter = new StringWriter(); + using (var process = Process.Start(processStartInfo)) { + process.OutputDataReceived += (s, e) => { + if (e.Data != null) { + stdoutWriter.Write(e.Data); + stdoutWriter.Write(Environment.NewLine); + } }; - var stdoutWriter = new StringWriter(); - var stderrWriter = new StringWriter(); - using (var process = Process.Start(processStartInfo)) { - process.OutputDataReceived += (s, e) => { - if (e.Data != null) { - stdoutWriter.Write(e.Data); - stdoutWriter.Write(Environment.NewLine); - } - }; + var errorDataReceived = false; + process.ErrorDataReceived += (s, e) => { + if (e.Data != null) { + errorDataReceived = true; + stderrWriter.Write(e.Data); + stderrWriter.Write(Environment.NewLine); + } + }; - var errorDataReceived = false; - process.ErrorDataReceived += (s, e) => { - if (e.Data != null) { - errorDataReceived = true; - stderrWriter.Write(e.Data); - stderrWriter.Write(Environment.NewLine); - } - }; + process.BeginOutputReadLine(); + process.BeginErrorReadLine(); + process.WaitForExit(); - process.BeginOutputReadLine(); - process.BeginErrorReadLine(); - process.WaitForExit(); - - if ((shouldFailOnStdErrDataReceived && errorDataReceived) || process.ExitCode != 0) { - var stderr = stderrWriter.ToString(); - if (string.IsNullOrEmpty(stderr)) { - stderr = stdoutWriter.ToString(); - } - - throw new Exception( - $"Execution of {processStartInfo.FileName} with arguments {processStartInfo.Arguments} failed with exit code {process.ExitCode}: {stderr}"); + if ((shouldFailOnStdErrDataReceived && errorDataReceived) || process.ExitCode != 0) { + var stderr = stderrWriter.ToString(); + if (string.IsNullOrEmpty(stderr)) { + stderr = stdoutWriter.ToString(); } - return stdoutWriter.ToString(); - } - } - - private static void RaiseScanningStateChanged(bool isActivelyScanning) { - ScanningStateChanged?.Invoke(null, new ScanningStateChangedEventArgs(isActivelyScanning)); - } - - public class ScanningStateChangedEventArgs : EventArgs { - public ScanningStateChangedEventArgs(bool isActivelyScanning) { - IsActivelyScanning = isActivelyScanning; + throw new Exception( + $"Execution of {processStartInfo.FileName} with arguments {processStartInfo.Arguments} failed with exit code {process.ExitCode}: {stderr}"); } - public bool IsActivelyScanning { get; private set; } + return stdoutWriter.ToString(); } - - public static event EventHandler ScanningStateChanged; } + + private static void RaiseScanningStateChanged(bool isActivelyScanning) { + ScanningStateChanged?.Invoke(null, new ScanningStateChangedEventArgs(isActivelyScanning)); + } + + public class ScanningStateChangedEventArgs : EventArgs { + public ScanningStateChangedEventArgs(bool isActivelyScanning) { + IsActivelyScanning = isActivelyScanning; + } + + public bool IsActivelyScanning { get; private set; } + } + + public static event EventHandler ScanningStateChanged; } diff --git a/FDK/src/03.Sound/Lufs.cs b/FDK/src/03.Sound/Lufs.cs index 179167cb..0b6f9209 100644 --- a/FDK/src/03.Sound/Lufs.cs +++ b/FDK/src/03.Sound/Lufs.cs @@ -1,37 +1,37 @@ -namespace FDK { - /// - /// The Lufs structure is used to carry, and assist with calculations related to, - /// Loudness Units relative to Full Scale. LUFS are measured in absolute scale - /// and whole values represent one decibel. - /// - [Serializable] - public struct Lufs { - private readonly double _value; +namespace FDK; - public Lufs(double value) { - _value = value; - } +/// +/// The Lufs structure is used to carry, and assist with calculations related to, +/// Loudness Units relative to Full Scale. LUFS are measured in absolute scale +/// and whole values represent one decibel. +/// +[Serializable] +public struct Lufs { + private readonly double _value; - public double ToDouble() => _value; + public Lufs(double value) { + _value = value; + } - public Lufs Min(Lufs lufs) { - return new Lufs(Math.Min(_value, lufs._value)); - } + public double ToDouble() => _value; - public Lufs Negate() { - return new Lufs(-_value); - } + public Lufs Min(Lufs lufs) { + return new Lufs(Math.Min(_value, lufs._value)); + } - public override string ToString() { - return _value.ToString(); - } + public Lufs Negate() { + return new Lufs(-_value); + } - public static Lufs operator -(Lufs left, Lufs right) { - return new Lufs(left._value - right._value); - } + public override string ToString() { + return _value.ToString(); + } - public static Lufs operator +(Lufs left, Lufs right) { - return new Lufs(left._value + right._value); - } + public static Lufs operator -(Lufs left, Lufs right) { + return new Lufs(left._value - right._value); + } + + public static Lufs operator +(Lufs left, Lufs right) { + return new Lufs(left._value + right._value); } } diff --git a/FDK/src/03.Sound/SongGainController.cs b/FDK/src/03.Sound/SongGainController.cs index c7a430bb..49ce3de7 100644 --- a/FDK/src/03.Sound/SongGainController.cs +++ b/FDK/src/03.Sound/SongGainController.cs @@ -1,26 +1,26 @@ -namespace FDK { - /// - /// SongGainController provides a central place through which song preview - /// and song playback attempt to apply BS1770GAIN-based loudness metadata - /// or .tja SONGVOL as the Gain of a song sound. - /// - /// By doing so through SongGainController instead of directly against the - /// song (preview) CSound object, SongGainController can override the Gain - /// value based on configuration or other information. - /// - public sealed class SongGainController { - public bool ApplyLoudnessMetadata { private get; set; } - public Lufs TargetLoudness { private get; set; } - public bool ApplySongVol { private get; set; } +namespace FDK; - public void Set(int songVol, LoudnessMetadata? songLoudnessMetadata, CSound sound) { - if (ApplyLoudnessMetadata && songLoudnessMetadata.HasValue) { - var gain = TargetLoudness - songLoudnessMetadata.Value.Integrated; +/// +/// SongGainController provides a central place through which song preview +/// and song playback attempt to apply BS1770GAIN-based loudness metadata +/// or .tja SONGVOL as the Gain of a song sound. +/// +/// By doing so through SongGainController instead of directly against the +/// song (preview) CSound object, SongGainController can override the Gain +/// value based on configuration or other information. +/// +public sealed class SongGainController { + public bool ApplyLoudnessMetadata { private get; set; } + public Lufs TargetLoudness { private get; set; } + public bool ApplySongVol { private get; set; } - sound.SetGain(gain, songLoudnessMetadata.Value.TruePeak); - } else { - sound.SetGain(ApplySongVol ? songVol : CSound.DefaultSongVol); - } + public void Set(int songVol, LoudnessMetadata? songLoudnessMetadata, CSound sound) { + if (ApplyLoudnessMetadata && songLoudnessMetadata.HasValue) { + var gain = TargetLoudness - songLoudnessMetadata.Value.Integrated; + + sound.SetGain(gain, songLoudnessMetadata.Value.TruePeak); + } else { + sound.SetGain(ApplySongVol ? songVol : CSound.DefaultSongVol); } } } diff --git a/FDK/src/03.Sound/SoundGroupLevelController.cs b/FDK/src/03.Sound/SoundGroupLevelController.cs index f2bf0aae..928ebc68 100644 --- a/FDK/src/03.Sound/SoundGroupLevelController.cs +++ b/FDK/src/03.Sound/SoundGroupLevelController.cs @@ -2,112 +2,112 @@ using System.Collections.Specialized; using FDK.ExtensionMethods; -namespace FDK { - /// - /// SoundGroupLevelController holds the current sound level value for each - /// of the unique sound groups, along with an increment by which they can - /// easily be adjusted. - /// - /// Configuration changes to the sound group levels are provided to the - /// controller via binding code which allows CConfigIni and - /// SoundGroupLevelController to be unaware of one another. - /// See ConfigIniToSoundGroupLevelControllerBinder for more details. - /// - /// Dynamic adjustment of sound group levels during song selection and song - /// playback are managed via a small dependency taken by the respective - /// stage classes. See KeyboardSoundGroupLevelControlHandler and its usages - /// for more details. - /// - /// As new sound objects are created, including when reloading sounds due - /// to a changer in audio output device, SoundGroupLevelController ensures - /// that they are provided with the current level for their associated - /// sound group by subscribing to notifications regarding changes to a - /// collection of sound objects provided during construction. This - /// observable collection comes from the sound manager, but without either - /// it or this class being directly aware of one another. - /// - /// As sound group levels are changed, SoundGroupLevelController updates - /// all existing sound objects group levels by iterating that same - /// observable collection. - /// - public sealed class SoundGroupLevelController { - private readonly Dictionary _levelBySoundGroup = new Dictionary { - [ESoundGroup.SoundEffect] = CSound.MaximumGroupLevel, - [ESoundGroup.Voice] = CSound.MaximumGroupLevel, - [ESoundGroup.SongPreview] = CSound.MaximumGroupLevel, - [ESoundGroup.SongPlayback] = CSound.MaximumGroupLevel, - [ESoundGroup.Unknown] = CSound.MaximumGroupLevel - }; +namespace FDK; - private readonly ObservableCollection _sounds; +/// +/// SoundGroupLevelController holds the current sound level value for each +/// of the unique sound groups, along with an increment by which they can +/// easily be adjusted. +/// +/// Configuration changes to the sound group levels are provided to the +/// controller via binding code which allows CConfigIni and +/// SoundGroupLevelController to be unaware of one another. +/// See ConfigIniToSoundGroupLevelControllerBinder for more details. +/// +/// Dynamic adjustment of sound group levels during song selection and song +/// playback are managed via a small dependency taken by the respective +/// stage classes. See KeyboardSoundGroupLevelControlHandler and its usages +/// for more details. +/// +/// As new sound objects are created, including when reloading sounds due +/// to a changer in audio output device, SoundGroupLevelController ensures +/// that they are provided with the current level for their associated +/// sound group by subscribing to notifications regarding changes to a +/// collection of sound objects provided during construction. This +/// observable collection comes from the sound manager, but without either +/// it or this class being directly aware of one another. +/// +/// As sound group levels are changed, SoundGroupLevelController updates +/// all existing sound objects group levels by iterating that same +/// observable collection. +/// +public sealed class SoundGroupLevelController { + private readonly Dictionary _levelBySoundGroup = new Dictionary { + [ESoundGroup.SoundEffect] = CSound.MaximumGroupLevel, + [ESoundGroup.Voice] = CSound.MaximumGroupLevel, + [ESoundGroup.SongPreview] = CSound.MaximumGroupLevel, + [ESoundGroup.SongPlayback] = CSound.MaximumGroupLevel, + [ESoundGroup.Unknown] = CSound.MaximumGroupLevel + }; - private int _keyboardSoundLevelIncrement; + private readonly ObservableCollection _sounds; - public SoundGroupLevelController(ObservableCollection sounds) { - _sounds = sounds; + private int _keyboardSoundLevelIncrement; - _sounds.CollectionChanged += SoundsOnCollectionChanged; + public SoundGroupLevelController(ObservableCollection sounds) { + _sounds = sounds; + + _sounds.CollectionChanged += SoundsOnCollectionChanged; + } + + public void SetLevel(ESoundGroup soundGroup, int level) { + var clampedLevel = level.Clamp(CSound.MinimumGroupLevel, CSound.MaximumGroupLevel); + + if (_levelBySoundGroup[soundGroup] == clampedLevel) { + return; } - public void SetLevel(ESoundGroup soundGroup, int level) { - var clampedLevel = level.Clamp(CSound.MinimumGroupLevel, CSound.MaximumGroupLevel); + _levelBySoundGroup[soundGroup] = clampedLevel; - if (_levelBySoundGroup[soundGroup] == clampedLevel) { - return; + foreach (var sound in _sounds) { + if (sound.SoundGroup == soundGroup) { + SetLevel(sound); } + } - _levelBySoundGroup[soundGroup] = clampedLevel; + RaiseLevelChanged(soundGroup, clampedLevel); + } - foreach (var sound in _sounds) { - if (sound.SoundGroup == soundGroup) { + public void SetKeyboardSoundLevelIncrement(int keyboardSoundLevelIncrement) { + _keyboardSoundLevelIncrement = keyboardSoundLevelIncrement; + } + + public void AdjustLevel(ESoundGroup soundGroup, bool isAdjustmentPositive) { + var adjustmentIncrement = isAdjustmentPositive + ? _keyboardSoundLevelIncrement + : -_keyboardSoundLevelIncrement; + + SetLevel(soundGroup, _levelBySoundGroup[soundGroup] + adjustmentIncrement); + } + + private void SetLevel(CSound sound) { + sound.GroupLevel = _levelBySoundGroup[sound.SoundGroup]; + } + + private void SoundsOnCollectionChanged(object sender, NotifyCollectionChangedEventArgs e) { + switch (e.Action) { + case NotifyCollectionChangedAction.Add: + case NotifyCollectionChangedAction.Replace: + foreach (CSound sound in e.NewItems) { SetLevel(sound); } - } - - RaiseLevelChanged(soundGroup, clampedLevel); + break; } - - public void SetKeyboardSoundLevelIncrement(int keyboardSoundLevelIncrement) { - _keyboardSoundLevelIncrement = keyboardSoundLevelIncrement; - } - - public void AdjustLevel(ESoundGroup soundGroup, bool isAdjustmentPositive) { - var adjustmentIncrement = isAdjustmentPositive - ? _keyboardSoundLevelIncrement - : -_keyboardSoundLevelIncrement; - - SetLevel(soundGroup, _levelBySoundGroup[soundGroup] + adjustmentIncrement); - } - - private void SetLevel(CSound sound) { - sound.GroupLevel = _levelBySoundGroup[sound.SoundGroup]; - } - - private void SoundsOnCollectionChanged(object sender, NotifyCollectionChangedEventArgs e) { - switch (e.Action) { - case NotifyCollectionChangedAction.Add: - case NotifyCollectionChangedAction.Replace: - foreach (CSound sound in e.NewItems) { - SetLevel(sound); - } - break; - } - } - - private void RaiseLevelChanged(ESoundGroup soundGroup, int level) { - LevelChanged?.Invoke(this, new LevelChangedEventArgs(soundGroup, level)); - } - - public class LevelChangedEventArgs : EventArgs { - public LevelChangedEventArgs(ESoundGroup soundGroup, int level) { - SoundGroup = soundGroup; - Level = level; - } - - public ESoundGroup SoundGroup { get; private set; } - public int Level { get; private set; } - } - - public event EventHandler LevelChanged; } + + private void RaiseLevelChanged(ESoundGroup soundGroup, int level) { + LevelChanged?.Invoke(this, new LevelChangedEventArgs(soundGroup, level)); + } + + public class LevelChangedEventArgs : EventArgs { + public LevelChangedEventArgs(ESoundGroup soundGroup, int level) { + SoundGroup = soundGroup; + Level = level; + } + + public ESoundGroup SoundGroup { get; private set; } + public int Level { get; private set; } + } + + public event EventHandler LevelChanged; } diff --git a/FDK/src/03.Sound/SoundManager.cs b/FDK/src/03.Sound/SoundManager.cs index 9ea1b82c..55283062 100644 --- a/FDK/src/03.Sound/SoundManager.cs +++ b/FDK/src/03.Sound/SoundManager.cs @@ -3,379 +3,379 @@ using ManagedBass; using Silk.NET.Windowing; -namespace FDK { - public class SoundManager // : CSound - { - private static ISoundDevice SoundDevice { - get; set; - } - private static ESoundDeviceType SoundDeviceType { - get; set; - } - public static CSoundTimer PlayTimer = null; - public static bool bUseOSTimer = false; // OSのタイマーを使うか、CSoundTimerを使うか。DTXCではfalse, DTXManiaではtrue。 - // DTXC(DirectSound)でCSoundTimerを使うと、内部で無音のループサウンドを再生するため - // サウンドデバイスを占有してしまい、Viewerとして呼び出されるDTXManiaで、ASIOが使えなくなる。 +namespace FDK; - // DTXMania単体でこれをtrueにすると、WASAPI/ASIO時に演奏タイマーとしてFDKタイマーではなく - // システムのタイマーを使うようになる。こうするとスクロールは滑らかになるが、音ズレが出るかもしれない。 +public class SoundManager // : CSound +{ + private static ISoundDevice SoundDevice { + get; set; + } + private static ESoundDeviceType SoundDeviceType { + get; set; + } + public static CSoundTimer PlayTimer = null; + public static bool bUseOSTimer = false; // OSのタイマーを使うか、CSoundTimerを使うか。DTXCではfalse, DTXManiaではtrue。 + // DTXC(DirectSound)でCSoundTimerを使うと、内部で無音のループサウンドを再生するため + // サウンドデバイスを占有してしまい、Viewerとして呼び出されるDTXManiaで、ASIOが使えなくなる。 - public static bool bIsTimeStretch = false; + // DTXMania単体でこれをtrueにすると、WASAPI/ASIO時に演奏タイマーとしてFDKタイマーではなく + // システムのタイマーを使うようになる。こうするとスクロールは滑らかになるが、音ズレが出るかもしれない。 - private static IWindow Window_; + public static bool bIsTimeStretch = false; - private static int _nMasterVolume; - public int nMasterVolume { - get { - return _nMasterVolume; - } - //get - //{ - // if ( SoundDeviceType == ESoundDeviceType.ExclusiveWASAPI || SoundDeviceType == ESoundDeviceType.ASIO ) - // { - // return Bass.BASS_GetConfig(BASSConfig.BASS_CONFIG_GVOL_STREAM ) / 100; - // } - // else - // { - // return 100; - // } - //} - //set - //{ - // if ( SoundDeviceType == ESoundDeviceType.ExclusiveWASAPI ) - // { - // // LINEARでなくWINDOWS(2)を使う必要があるが、exclusive時は使用不可、またデバイス側が対応してないと使用不可 - // bool b = BassWasapi.BASS_WASAPI_SetVolume( BASSWASAPIVolume.BASS_WASAPI_CURVE_LINEAR, value / 100.0f ); - // if ( !b ) - // { - // BASSError be = Bass.BASS_ErrorGetCode(); - // Trace.TraceInformation( "WASAPI Master Volume Set Error: " + be.ToString() ); - // } - // } - //} - //set - //{ - // if ( SoundDeviceType == ESoundDeviceType.ExclusiveWASAPI || SoundDeviceType == ESoundDeviceType.ASIO ) - // { - // bool b = Bass.BASS_SetConfig(BASSConfig.BASS_CONFIG_GVOL_STREAM, value * 100 ); - // if ( !b ) - // { - // BASSError be = Bass.BASS_ErrorGetCode(); - // Trace.TraceInformation( "Master Volume Set Error: " + be.ToString() ); - // } - // } - //} - //set - //{ - // if ( SoundDeviceType == ESoundDeviceType.ExclusiveWASAPI || SoundDeviceType == ESoundDeviceType.ASIO ) - // { - // var nodes = new BASS_MIXER_NODE[ 1 ] { new BASS_MIXER_NODE( 0, (float) value ) }; - // BassMix.BASS_Mixer_ChannelSetEnvelope( SoundDevice.hMixer, BASSMIXEnvelope.BASS_MIXER_ENV_VOL, nodes ); - // } - //} - set { - SoundDevice.nMasterVolume = value; - _nMasterVolume = value; - } - } + private static IWindow Window_; - ///// - ///// BASS時、mp3をストリーミング再生せずに、デコードしたraw wavをオンメモリ再生する場合はtrueにする。 - ///// 特殊なmp3を使用時はシークが乱れるので、必要に応じてtrueにすること。(Config.iniのNoMP3Streamingで設定可能。) - ///// ただし、trueにすると、その分再生開始までの時間が長くなる。 - ///// - //public static bool bIsMP3DecodeByWindowsCodec = false; - - public static int nMixing = 0; - public int GetMixingStreams() { - return nMixing; + private static int _nMasterVolume; + public int nMasterVolume { + get { + return _nMasterVolume; } - public static int nStreams = 0; - public int GetStreams() { - return nStreams; - } - #region [ WASAPI/ASIO/DirectSound設定値 ] - /// - /// WASAPI 排他モード出力における再生遅延[ms](の希望値)。最終的にはこの数値を基にドライバが決定する)。 - /// 0以下の値を指定すると、この数値はWASAPI初期化時に自動設定する。正数を指定すると、その値を設定しようと試みる。 - /// - public static int SoundDelayExclusiveWASAPI = 0; // SSTでは、50ms - public int GetSoundExclusiveWASAPI() { - return SoundDelayExclusiveWASAPI; - } - public void SetSoundDelayExclusiveWASAPI(int value) { - SoundDelayExclusiveWASAPI = value; - } - /// - /// WASAPI BASS出力における再生遅延[ms]。ユーザが決定する。 - /// - private static int SoundDelayBASS = 15; - /// BASSバッファの更新間隔。出力間隔ではないので注意。 - /// SoundDelay よりも小さい値であること。(小さすぎる場合はBASSによって自動修正される。) - /// - private static int SoundUpdatePeriodBASS = 1; - /// - /// WASAPI 共有モード出力における再生遅延[ms]。ユーザが決定する。 - /// - public static int SoundDelaySharedWASAPI = 100; - /// - /// 排他WASAPIバッファの更新間隔。出力間隔ではないので注意。 - /// → 自動設定されるのでSoundDelay よりも小さい値であること。(小さすぎる場合はBASSによって自動修正される。) - /// - public static int SoundUpdatePeriodExclusiveWASAPI = 6; - /// - /// 共有WASAPIバッファの更新間隔。出力間隔ではないので注意。 - /// SoundDelay よりも小さい値であること。(小さすぎる場合はBASSによって自動修正される。) - /// - public static int SoundUpdatePeriodSharedWASAPI = 6; - ///// - ///// ASIO 出力における再生遅延[ms](の希望値)。最終的にはこの数値を基にドライバが決定する)。 - ///// - //public static int SoundDelayASIO = 0; // SSTでは50ms。0にすると、デバイスの設定値をそのまま使う。 - /// - /// ASIO 出力におけるバッファサイズ。 - /// - public static int SoundDelayASIO = 0; // 0にすると、デバイスの設定値をそのまま使う。 - public int GetSoundDelayASIO() { - return SoundDelayASIO; - } - public void SetSoundDelayASIO(int value) { - SoundDelayASIO = value; - } - public static int ASIODevice = 0; - public int GetASIODevice() { - return ASIODevice; - } - public void SetASIODevice(int value) { - ASIODevice = value; - } - /// - /// DirectSound 出力における再生遅延[ms]。ユーザが決定する。 - /// - public static int SoundDelayDirectSound = 100; - - public long GetSoundDelay() { - if (SoundDevice != null) { - return SoundDevice.BufferSize; - } else { - return -1; - } - } - - #endregion - - - /// - /// DTXMania用コンストラクタ - /// - /// - /// - /// - /// - /// - public SoundManager(IWindow window, ESoundDeviceType soundDeviceType, int nSoundDelayBASS, int nSoundDelayExclusiveWASAPI, int nSoundDelayASIO, int nASIODevice, bool _bUseOSTimer) { - Window_ = window; - SoundDevice = null; - //bUseOSTimer = false; - tInitialize(soundDeviceType, nSoundDelayBASS, nSoundDelayExclusiveWASAPI, nSoundDelayASIO, nASIODevice, _bUseOSTimer); - } - public void Dispose() { - t終了(); - } - - //public static void t初期化() + //get //{ - // t初期化( ESoundDeviceType.DirectSound, 0, 0, 0 ); + // if ( SoundDeviceType == ESoundDeviceType.ExclusiveWASAPI || SoundDeviceType == ESoundDeviceType.ASIO ) + // { + // return Bass.BASS_GetConfig(BASSConfig.BASS_CONFIG_GVOL_STREAM ) / 100; + // } + // else + // { + // return 100; + // } //} - - public void tInitialize(ESoundDeviceType soundDeviceType, int _nSoundDelayBASS, int _nSoundDelayExclusiveWASAPI, int _nSoundDelayASIO, int _nASIODevice, IntPtr handle) { - //if ( !bInitialized ) - { - tInitialize(soundDeviceType, _nSoundDelayBASS, _nSoundDelayExclusiveWASAPI, _nSoundDelayASIO, _nASIODevice); - //bInitialized = true; - } - } - public void tInitialize(ESoundDeviceType soundDeviceType, int _nSoundDelayBASS, int _nSoundDelayExclusiveWASAPI, int _nSoundDelayASIO, int _nASIODevice) { - tInitialize(soundDeviceType, _nSoundDelayBASS, _nSoundDelayExclusiveWASAPI, _nSoundDelayASIO, _nASIODevice, false); - } - - public void tInitialize(ESoundDeviceType soundDeviceType, int _nSoundDelayBASS, int _nSoundDelayExclusiveWASAPI, int _nSoundDelayASIO, int _nASIODevice, bool _bUseOSTimer) { - //SoundDevice = null; // 後で再初期化することがあるので、null初期化はコンストラクタに回す - PlayTimer = null; // Global.Bass 依存(つまりユーザ依存) - nMixing = 0; - - SoundDelayBASS = _nSoundDelayBASS; - SoundDelayExclusiveWASAPI = _nSoundDelayExclusiveWASAPI; - SoundDelaySharedWASAPI = _nSoundDelayExclusiveWASAPI; - SoundDelayASIO = _nSoundDelayASIO; - ASIODevice = _nASIODevice; - bUseOSTimer = _bUseOSTimer; - - ESoundDeviceType[] ESoundDeviceTypes = new ESoundDeviceType[5] - { - ESoundDeviceType.Bass, - ESoundDeviceType.ExclusiveWASAPI, - ESoundDeviceType.SharedWASAPI, - ESoundDeviceType.ASIO, - ESoundDeviceType.Unknown - }; - - int initialDevice; - switch (soundDeviceType) { - case ESoundDeviceType.Bass: - initialDevice = 0; - break; - case ESoundDeviceType.ExclusiveWASAPI: - initialDevice = 1; - break; - case ESoundDeviceType.SharedWASAPI: - initialDevice = 2; - break; - case ESoundDeviceType.ASIO: - initialDevice = 3; - break; - default: - initialDevice = 4; - break; - } - for (SoundDeviceType = ESoundDeviceTypes[initialDevice]; ; SoundDeviceType = ESoundDeviceTypes[++initialDevice]) { - try { - tReloadSoundDeviceAndSound(); - break; - } catch (Exception e) { - Trace.TraceError(e.ToString()); - Trace.TraceError("例外が発生しましたが処理を継続します。 (2609806d-23e8-45c2-9389-b427e80915bc)"); - if (ESoundDeviceTypes[initialDevice] == ESoundDeviceType.Unknown) { - Trace.TraceError(string.Format("サウンドデバイスの初期化に失敗しました。")); - break; - } - } - } - if (soundDeviceType == ESoundDeviceType.Bass - || soundDeviceType == ESoundDeviceType.ExclusiveWASAPI - || soundDeviceType == ESoundDeviceType.SharedWASAPI - || soundDeviceType == ESoundDeviceType.ASIO) { - //Bass.BASS_SetConfig( BASSConfig.BASS_CONFIG_UPDATETHREADS, 4 ); - //Bass.BASS_SetConfig( BASSConfig.BASS_CONFIG_UPDATEPERIOD, 0 ); - - Trace.TraceInformation("BASS_CONFIG_UpdatePeriod=" + Bass.GetConfig(Configuration.UpdatePeriod)); - Trace.TraceInformation("BASS_CONFIG_UpdateThreads=" + Bass.GetConfig(Configuration.UpdateThreads)); - } - } - - public void tDisableUpdateBufferAutomatically() { - //Bass.BASS_SetConfig( BASSConfig.BASS_CONFIG_UPDATETHREADS, 0 ); - //Bass.BASS_SetConfig( BASSConfig.BASS_CONFIG_UPDATEPERIOD, 0 ); - - //Trace.TraceInformation( "BASS_CONFIG_UpdatePeriod=" + Bass.BASS_GetConfig( BASSConfig.BASS_CONFIG_UPDATEPERIOD ) ); - //Trace.TraceInformation( "BASS_CONFIG_UpdateThreads=" + Bass.BASS_GetConfig( BASSConfig.BASS_CONFIG_UPDATETHREADS ) ); - } - - - public static void t終了() { - SoundDevice.Dispose(); - PlayTimer.Dispose(); // Global.Bass を解放した後に解放すること。(Global.Bass で参照されているため) - } - - - public static void tReloadSoundDeviceAndSound() { - #region [ すでにサウンドデバイスと演奏タイマが構築されていれば解放する。] - //----------------- - if (SoundDevice != null) { - // すでに生成済みのサウンドがあれば初期状態に戻す。 - - CSound.tResetAllSound(); // リソースは解放するが、CSoundのインスタンスは残す。 - - - // サウンドデバイスと演奏タイマを解放する。 - - SoundDevice.Dispose(); - PlayTimer?.Dispose(); // Global.SoundDevice を解放した後に解放すること。(Global.SoundDevice で参照されているため) - } - //----------------- - #endregion - - #region [ 新しいサウンドデバイスを構築する。] - //----------------- - switch (SoundDeviceType) { - case ESoundDeviceType.Bass: - SoundDevice = new CSoundDeviceBASS(SoundDelayBASS, SoundUpdatePeriodBASS); - break; - - case ESoundDeviceType.ExclusiveWASAPI: - SoundDevice = new CSoundDeviceWASAPI(CSoundDeviceWASAPI.EWASAPIMode.Exclusion, SoundDelayExclusiveWASAPI, SoundUpdatePeriodExclusiveWASAPI); - break; - - case ESoundDeviceType.SharedWASAPI: - SoundDevice = new CSoundDeviceWASAPI(CSoundDeviceWASAPI.EWASAPIMode.Share, SoundDelaySharedWASAPI, SoundUpdatePeriodSharedWASAPI); - break; - - case ESoundDeviceType.ASIO: - SoundDevice = new CSoundDeviceASIO(SoundDelayASIO, ASIODevice); - break; - - default: - throw new Exception(string.Format("未対応の SoundDeviceType です。[{0}]", SoundDeviceType.ToString())); - } - //----------------- - #endregion - #region [ 新しい演奏タイマを構築する。] - //----------------- - PlayTimer = new CSoundTimer(SoundDevice); - //----------------- - #endregion - - SoundDevice.nMasterVolume = _nMasterVolume; // サウンドデバイスに対して、マスターボリュームを再設定する - - CSound.tReloadSound(SoundDevice); // すでに生成済みのサウンドがあれば作り直す。 - } - public CSound tCreateSound(string filename, ESoundGroup soundGroup) { - if (!File.Exists(filename)) { - Trace.TraceWarning($"[i18n] File does not exist: {filename}"); - return null; - } - - if (SoundDeviceType == ESoundDeviceType.Unknown) { - throw new Exception(string.Format("未対応の SoundDeviceType です。[{0}]", SoundDeviceType.ToString())); - } - return SoundDevice.tCreateSound(filename, soundGroup); - } - - private static DateTime lastUpdateTime = DateTime.MinValue; - - public void tDisposeSound(CSound csound) { - csound?.tDispose(true); // インスタンスは存続→破棄にする。 - } - - public string GetCurrentSoundDeviceType() { - switch (SoundDeviceType) { - case ESoundDeviceType.Bass: - return "Bass"; - case ESoundDeviceType.ExclusiveWASAPI: - return "Exclusive WASAPI"; - case ESoundDeviceType.SharedWASAPI: - return "Shared WASAPI"; - case ESoundDeviceType.ASIO: - return "ASIO"; - default: - return "Unknown"; - } - } - - public void AddMixer(CSound cs, double db再生速度, bool _b演奏終了後も再生が続くチップである) { - cs.b演奏終了後も再生が続くチップである = _b演奏終了後も再生が続くチップである; - cs.PlaySpeed = db再生速度; - cs.AddBassSoundFromMixer(); - } - public void AddMixer(CSound cs, double db再生速度) { - cs.PlaySpeed = db再生速度; - cs.AddBassSoundFromMixer(); - } - public void AddMixer(CSound cs) { - cs.AddBassSoundFromMixer(); - } - public void RemoveMixer(CSound cs) { - cs.tRemoveSoundFromMixer(); + //set + //{ + // if ( SoundDeviceType == ESoundDeviceType.ExclusiveWASAPI ) + // { + // // LINEARでなくWINDOWS(2)を使う必要があるが、exclusive時は使用不可、またデバイス側が対応してないと使用不可 + // bool b = BassWasapi.BASS_WASAPI_SetVolume( BASSWASAPIVolume.BASS_WASAPI_CURVE_LINEAR, value / 100.0f ); + // if ( !b ) + // { + // BASSError be = Bass.BASS_ErrorGetCode(); + // Trace.TraceInformation( "WASAPI Master Volume Set Error: " + be.ToString() ); + // } + // } + //} + //set + //{ + // if ( SoundDeviceType == ESoundDeviceType.ExclusiveWASAPI || SoundDeviceType == ESoundDeviceType.ASIO ) + // { + // bool b = Bass.BASS_SetConfig(BASSConfig.BASS_CONFIG_GVOL_STREAM, value * 100 ); + // if ( !b ) + // { + // BASSError be = Bass.BASS_ErrorGetCode(); + // Trace.TraceInformation( "Master Volume Set Error: " + be.ToString() ); + // } + // } + //} + //set + //{ + // if ( SoundDeviceType == ESoundDeviceType.ExclusiveWASAPI || SoundDeviceType == ESoundDeviceType.ASIO ) + // { + // var nodes = new BASS_MIXER_NODE[ 1 ] { new BASS_MIXER_NODE( 0, (float) value ) }; + // BassMix.BASS_Mixer_ChannelSetEnvelope( SoundDevice.hMixer, BASSMIXEnvelope.BASS_MIXER_ENV_VOL, nodes ); + // } + //} + set { + SoundDevice.nMasterVolume = value; + _nMasterVolume = value; } } + + ///// + ///// BASS時、mp3をストリーミング再生せずに、デコードしたraw wavをオンメモリ再生する場合はtrueにする。 + ///// 特殊なmp3を使用時はシークが乱れるので、必要に応じてtrueにすること。(Config.iniのNoMP3Streamingで設定可能。) + ///// ただし、trueにすると、その分再生開始までの時間が長くなる。 + ///// + //public static bool bIsMP3DecodeByWindowsCodec = false; + + public static int nMixing = 0; + public int GetMixingStreams() { + return nMixing; + } + public static int nStreams = 0; + public int GetStreams() { + return nStreams; + } + #region [ WASAPI/ASIO/DirectSound設定値 ] + /// + /// WASAPI 排他モード出力における再生遅延[ms](の希望値)。最終的にはこの数値を基にドライバが決定する)。 + /// 0以下の値を指定すると、この数値はWASAPI初期化時に自動設定する。正数を指定すると、その値を設定しようと試みる。 + /// + public static int SoundDelayExclusiveWASAPI = 0; // SSTでは、50ms + public int GetSoundExclusiveWASAPI() { + return SoundDelayExclusiveWASAPI; + } + public void SetSoundDelayExclusiveWASAPI(int value) { + SoundDelayExclusiveWASAPI = value; + } + /// + /// WASAPI BASS出力における再生遅延[ms]。ユーザが決定する。 + /// + private static int SoundDelayBASS = 15; + /// BASSバッファの更新間隔。出力間隔ではないので注意。 + /// SoundDelay よりも小さい値であること。(小さすぎる場合はBASSによって自動修正される。) + /// + private static int SoundUpdatePeriodBASS = 1; + /// + /// WASAPI 共有モード出力における再生遅延[ms]。ユーザが決定する。 + /// + public static int SoundDelaySharedWASAPI = 100; + /// + /// 排他WASAPIバッファの更新間隔。出力間隔ではないので注意。 + /// → 自動設定されるのでSoundDelay よりも小さい値であること。(小さすぎる場合はBASSによって自動修正される。) + /// + public static int SoundUpdatePeriodExclusiveWASAPI = 6; + /// + /// 共有WASAPIバッファの更新間隔。出力間隔ではないので注意。 + /// SoundDelay よりも小さい値であること。(小さすぎる場合はBASSによって自動修正される。) + /// + public static int SoundUpdatePeriodSharedWASAPI = 6; + ///// + ///// ASIO 出力における再生遅延[ms](の希望値)。最終的にはこの数値を基にドライバが決定する)。 + ///// + //public static int SoundDelayASIO = 0; // SSTでは50ms。0にすると、デバイスの設定値をそのまま使う。 + /// + /// ASIO 出力におけるバッファサイズ。 + /// + public static int SoundDelayASIO = 0; // 0にすると、デバイスの設定値をそのまま使う。 + public int GetSoundDelayASIO() { + return SoundDelayASIO; + } + public void SetSoundDelayASIO(int value) { + SoundDelayASIO = value; + } + public static int ASIODevice = 0; + public int GetASIODevice() { + return ASIODevice; + } + public void SetASIODevice(int value) { + ASIODevice = value; + } + /// + /// DirectSound 出力における再生遅延[ms]。ユーザが決定する。 + /// + public static int SoundDelayDirectSound = 100; + + public long GetSoundDelay() { + if (SoundDevice != null) { + return SoundDevice.BufferSize; + } else { + return -1; + } + } + + #endregion + + + /// + /// DTXMania用コンストラクタ + /// + /// + /// + /// + /// + /// + public SoundManager(IWindow window, ESoundDeviceType soundDeviceType, int nSoundDelayBASS, int nSoundDelayExclusiveWASAPI, int nSoundDelayASIO, int nASIODevice, bool _bUseOSTimer) { + Window_ = window; + SoundDevice = null; + //bUseOSTimer = false; + tInitialize(soundDeviceType, nSoundDelayBASS, nSoundDelayExclusiveWASAPI, nSoundDelayASIO, nASIODevice, _bUseOSTimer); + } + public void Dispose() { + t終了(); + } + + //public static void t初期化() + //{ + // t初期化( ESoundDeviceType.DirectSound, 0, 0, 0 ); + //} + + public void tInitialize(ESoundDeviceType soundDeviceType, int _nSoundDelayBASS, int _nSoundDelayExclusiveWASAPI, int _nSoundDelayASIO, int _nASIODevice, IntPtr handle) { + //if ( !bInitialized ) + { + tInitialize(soundDeviceType, _nSoundDelayBASS, _nSoundDelayExclusiveWASAPI, _nSoundDelayASIO, _nASIODevice); + //bInitialized = true; + } + } + public void tInitialize(ESoundDeviceType soundDeviceType, int _nSoundDelayBASS, int _nSoundDelayExclusiveWASAPI, int _nSoundDelayASIO, int _nASIODevice) { + tInitialize(soundDeviceType, _nSoundDelayBASS, _nSoundDelayExclusiveWASAPI, _nSoundDelayASIO, _nASIODevice, false); + } + + public void tInitialize(ESoundDeviceType soundDeviceType, int _nSoundDelayBASS, int _nSoundDelayExclusiveWASAPI, int _nSoundDelayASIO, int _nASIODevice, bool _bUseOSTimer) { + //SoundDevice = null; // 後で再初期化することがあるので、null初期化はコンストラクタに回す + PlayTimer = null; // Global.Bass 依存(つまりユーザ依存) + nMixing = 0; + + SoundDelayBASS = _nSoundDelayBASS; + SoundDelayExclusiveWASAPI = _nSoundDelayExclusiveWASAPI; + SoundDelaySharedWASAPI = _nSoundDelayExclusiveWASAPI; + SoundDelayASIO = _nSoundDelayASIO; + ASIODevice = _nASIODevice; + bUseOSTimer = _bUseOSTimer; + + ESoundDeviceType[] ESoundDeviceTypes = new ESoundDeviceType[5] + { + ESoundDeviceType.Bass, + ESoundDeviceType.ExclusiveWASAPI, + ESoundDeviceType.SharedWASAPI, + ESoundDeviceType.ASIO, + ESoundDeviceType.Unknown + }; + + int initialDevice; + switch (soundDeviceType) { + case ESoundDeviceType.Bass: + initialDevice = 0; + break; + case ESoundDeviceType.ExclusiveWASAPI: + initialDevice = 1; + break; + case ESoundDeviceType.SharedWASAPI: + initialDevice = 2; + break; + case ESoundDeviceType.ASIO: + initialDevice = 3; + break; + default: + initialDevice = 4; + break; + } + for (SoundDeviceType = ESoundDeviceTypes[initialDevice]; ; SoundDeviceType = ESoundDeviceTypes[++initialDevice]) { + try { + tReloadSoundDeviceAndSound(); + break; + } catch (Exception e) { + Trace.TraceError(e.ToString()); + Trace.TraceError("例外が発生しましたが処理を継続します。 (2609806d-23e8-45c2-9389-b427e80915bc)"); + if (ESoundDeviceTypes[initialDevice] == ESoundDeviceType.Unknown) { + Trace.TraceError(string.Format("サウンドデバイスの初期化に失敗しました。")); + break; + } + } + } + if (soundDeviceType == ESoundDeviceType.Bass + || soundDeviceType == ESoundDeviceType.ExclusiveWASAPI + || soundDeviceType == ESoundDeviceType.SharedWASAPI + || soundDeviceType == ESoundDeviceType.ASIO) { + //Bass.BASS_SetConfig( BASSConfig.BASS_CONFIG_UPDATETHREADS, 4 ); + //Bass.BASS_SetConfig( BASSConfig.BASS_CONFIG_UPDATEPERIOD, 0 ); + + Trace.TraceInformation("BASS_CONFIG_UpdatePeriod=" + Bass.GetConfig(Configuration.UpdatePeriod)); + Trace.TraceInformation("BASS_CONFIG_UpdateThreads=" + Bass.GetConfig(Configuration.UpdateThreads)); + } + } + + public void tDisableUpdateBufferAutomatically() { + //Bass.BASS_SetConfig( BASSConfig.BASS_CONFIG_UPDATETHREADS, 0 ); + //Bass.BASS_SetConfig( BASSConfig.BASS_CONFIG_UPDATEPERIOD, 0 ); + + //Trace.TraceInformation( "BASS_CONFIG_UpdatePeriod=" + Bass.BASS_GetConfig( BASSConfig.BASS_CONFIG_UPDATEPERIOD ) ); + //Trace.TraceInformation( "BASS_CONFIG_UpdateThreads=" + Bass.BASS_GetConfig( BASSConfig.BASS_CONFIG_UPDATETHREADS ) ); + } + + + public static void t終了() { + SoundDevice.Dispose(); + PlayTimer.Dispose(); // Global.Bass を解放した後に解放すること。(Global.Bass で参照されているため) + } + + + public static void tReloadSoundDeviceAndSound() { + #region [ すでにサウンドデバイスと演奏タイマが構築されていれば解放する。] + //----------------- + if (SoundDevice != null) { + // すでに生成済みのサウンドがあれば初期状態に戻す。 + + CSound.tResetAllSound(); // リソースは解放するが、CSoundのインスタンスは残す。 + + + // サウンドデバイスと演奏タイマを解放する。 + + SoundDevice.Dispose(); + PlayTimer?.Dispose(); // Global.SoundDevice を解放した後に解放すること。(Global.SoundDevice で参照されているため) + } + //----------------- + #endregion + + #region [ 新しいサウンドデバイスを構築する。] + //----------------- + switch (SoundDeviceType) { + case ESoundDeviceType.Bass: + SoundDevice = new CSoundDeviceBASS(SoundDelayBASS, SoundUpdatePeriodBASS); + break; + + case ESoundDeviceType.ExclusiveWASAPI: + SoundDevice = new CSoundDeviceWASAPI(CSoundDeviceWASAPI.EWASAPIMode.Exclusion, SoundDelayExclusiveWASAPI, SoundUpdatePeriodExclusiveWASAPI); + break; + + case ESoundDeviceType.SharedWASAPI: + SoundDevice = new CSoundDeviceWASAPI(CSoundDeviceWASAPI.EWASAPIMode.Share, SoundDelaySharedWASAPI, SoundUpdatePeriodSharedWASAPI); + break; + + case ESoundDeviceType.ASIO: + SoundDevice = new CSoundDeviceASIO(SoundDelayASIO, ASIODevice); + break; + + default: + throw new Exception(string.Format("未対応の SoundDeviceType です。[{0}]", SoundDeviceType.ToString())); + } + //----------------- + #endregion + #region [ 新しい演奏タイマを構築する。] + //----------------- + PlayTimer = new CSoundTimer(SoundDevice); + //----------------- + #endregion + + SoundDevice.nMasterVolume = _nMasterVolume; // サウンドデバイスに対して、マスターボリュームを再設定する + + CSound.tReloadSound(SoundDevice); // すでに生成済みのサウンドがあれば作り直す。 + } + public CSound tCreateSound(string filename, ESoundGroup soundGroup) { + if (!File.Exists(filename)) { + Trace.TraceWarning($"[i18n] File does not exist: {filename}"); + return null; + } + + if (SoundDeviceType == ESoundDeviceType.Unknown) { + throw new Exception(string.Format("未対応の SoundDeviceType です。[{0}]", SoundDeviceType.ToString())); + } + return SoundDevice.tCreateSound(filename, soundGroup); + } + + private static DateTime lastUpdateTime = DateTime.MinValue; + + public void tDisposeSound(CSound csound) { + csound?.tDispose(true); // インスタンスは存続→破棄にする。 + } + + public string GetCurrentSoundDeviceType() { + switch (SoundDeviceType) { + case ESoundDeviceType.Bass: + return "Bass"; + case ESoundDeviceType.ExclusiveWASAPI: + return "Exclusive WASAPI"; + case ESoundDeviceType.SharedWASAPI: + return "Shared WASAPI"; + case ESoundDeviceType.ASIO: + return "ASIO"; + default: + return "Unknown"; + } + } + + public void AddMixer(CSound cs, double db再生速度, bool _b演奏終了後も再生が続くチップである) { + cs.b演奏終了後も再生が続くチップである = _b演奏終了後も再生が続くチップである; + cs.PlaySpeed = db再生速度; + cs.AddBassSoundFromMixer(); + } + public void AddMixer(CSound cs, double db再生速度) { + cs.PlaySpeed = db再生速度; + cs.AddBassSoundFromMixer(); + } + public void AddMixer(CSound cs) { + cs.AddBassSoundFromMixer(); + } + public void RemoveMixer(CSound cs) { + cs.tRemoveSoundFromMixer(); + } } diff --git a/FDK/src/04.Graphics/BitmapUtil.cs b/FDK/src/04.Graphics/BitmapUtil.cs index 0a22a32d..67cceca8 100644 --- a/FDK/src/04.Graphics/BitmapUtil.cs +++ b/FDK/src/04.Graphics/BitmapUtil.cs @@ -1,66 +1,66 @@ using System.Runtime.InteropServices; using SkiaSharp; -namespace FDK { - public static class BitmapUtil { - // 定数 +namespace FDK; - public const uint DIB_PAL_COLORS = 1; - public const uint DIB_RGB_COLORS = 0; +public static class BitmapUtil { + // 定数 + + public const uint DIB_PAL_COLORS = 1; + public const uint DIB_RGB_COLORS = 0; - // 構造体 + // 構造体 - [StructLayout(LayoutKind.Sequential, Pack = 1)] - public struct BITMAPFILEHEADER { - public ushort bfType; - public uint bfSize; - public ushort bfReserved1; - public ushort bfReserved2; - public uint bfOffBits; - } + [StructLayout(LayoutKind.Sequential, Pack = 1)] + public struct BITMAPFILEHEADER { + public ushort bfType; + public uint bfSize; + public ushort bfReserved1; + public ushort bfReserved2; + public uint bfOffBits; + } - [StructLayout(LayoutKind.Sequential, Pack = 1)] - public struct BITMAPINFOHEADER { - public const int BI_RGB = 0; - public uint biSize構造体のサイズ; - public int biWidthビットマップの幅dot; - public int biHeightビットマップの高さdot; - public ushort biPlanes面の数; - public ushort biBitCount; - public uint biCompression圧縮形式; - public uint biSizeImage画像イメージのサイズ; - public int biXPelsPerMete水平方向の解像度; - public int biYPelsPerMeter垂直方向の解像度; - public uint biClrUsed色テーブルのインデックス数; - public uint biClrImportant表示に必要な色インデックスの数; - } + [StructLayout(LayoutKind.Sequential, Pack = 1)] + public struct BITMAPINFOHEADER { + public const int BI_RGB = 0; + public uint biSize構造体のサイズ; + public int biWidthビットマップの幅dot; + public int biHeightビットマップの高さdot; + public ushort biPlanes面の数; + public ushort biBitCount; + public uint biCompression圧縮形式; + public uint biSizeImage画像イメージのサイズ; + public int biXPelsPerMete水平方向の解像度; + public int biYPelsPerMeter垂直方向の解像度; + public uint biClrUsed色テーブルのインデックス数; + public uint biClrImportant表示に必要な色インデックスの数; + } - // メソッド + // メソッド - public static unsafe SKBitmap ToBitmap(IntPtr pBITMAPINFOHEADER) { - BITMAPFILEHEADER bitmapfileheader; - BITMAPINFOHEADER* bitmapinfoheaderPtr = (BITMAPINFOHEADER*)pBITMAPINFOHEADER; - bitmapfileheader.bfType = 0x4d42; - bitmapfileheader.bfOffBits = (uint)(sizeof(BITMAPFILEHEADER) + sizeof(BITMAPINFOHEADER)); - bitmapfileheader.bfSize = bitmapfileheader.bfOffBits + bitmapinfoheaderPtr->biSizeImage画像イメージのサイズ; - MemoryStream output = new MemoryStream(); - BinaryWriter writer = new BinaryWriter(output); - byte[] destination = new byte[sizeof(BITMAPFILEHEADER)]; - Marshal.Copy((IntPtr)(&bitmapfileheader), destination, 0, destination.Length); - writer.Write(destination); - destination = new byte[sizeof(BITMAPINFOHEADER)]; - Marshal.Copy(pBITMAPINFOHEADER, destination, 0, destination.Length); - writer.Write(destination); - destination = new byte[bitmapinfoheaderPtr->biSizeImage画像イメージのサイズ]; - bitmapinfoheaderPtr++; - Marshal.Copy((IntPtr)bitmapinfoheaderPtr, destination, 0, destination.Length); - writer.Write(destination); - writer.Flush(); - writer.BaseStream.Position = 0L; - return null; - //return new SKBitmap( writer.BaseStream ); - } + public static unsafe SKBitmap ToBitmap(IntPtr pBITMAPINFOHEADER) { + BITMAPFILEHEADER bitmapfileheader; + BITMAPINFOHEADER* bitmapinfoheaderPtr = (BITMAPINFOHEADER*)pBITMAPINFOHEADER; + bitmapfileheader.bfType = 0x4d42; + bitmapfileheader.bfOffBits = (uint)(sizeof(BITMAPFILEHEADER) + sizeof(BITMAPINFOHEADER)); + bitmapfileheader.bfSize = bitmapfileheader.bfOffBits + bitmapinfoheaderPtr->biSizeImage画像イメージのサイズ; + MemoryStream output = new MemoryStream(); + BinaryWriter writer = new BinaryWriter(output); + byte[] destination = new byte[sizeof(BITMAPFILEHEADER)]; + Marshal.Copy((IntPtr)(&bitmapfileheader), destination, 0, destination.Length); + writer.Write(destination); + destination = new byte[sizeof(BITMAPINFOHEADER)]; + Marshal.Copy(pBITMAPINFOHEADER, destination, 0, destination.Length); + writer.Write(destination); + destination = new byte[bitmapinfoheaderPtr->biSizeImage画像イメージのサイズ]; + bitmapinfoheaderPtr++; + Marshal.Copy((IntPtr)bitmapinfoheaderPtr, destination, 0, destination.Length); + writer.Write(destination); + writer.Flush(); + writer.BaseStream.Position = 0L; + return null; + //return new SKBitmap( writer.BaseStream ); } } diff --git a/FDK/src/04.Graphics/CDecodedFrame.cs b/FDK/src/04.Graphics/CDecodedFrame.cs index 08b0b851..7350c153 100644 --- a/FDK/src/04.Graphics/CDecodedFrame.cs +++ b/FDK/src/04.Graphics/CDecodedFrame.cs @@ -2,45 +2,45 @@ using System.Runtime.InteropServices; using FFmpeg.AutoGen; -namespace FDK { - public class CDecodedFrame : IDisposable { - public CDecodedFrame(Size texsize) { - this.Using = false; - this.TexSize = texsize; - this.TexPointer = Marshal.AllocHGlobal(texsize.Width * TexSize.Height * 4); - } +namespace FDK; - public bool Using { - get; - private set; - } - public double Time { - get; - private set; - } - public IntPtr TexPointer { - get; - private set; - } - public Size TexSize { - get; - private set; - } +public class CDecodedFrame : IDisposable { + public CDecodedFrame(Size texsize) { + this.Using = false; + this.TexSize = texsize; + this.TexPointer = Marshal.AllocHGlobal(texsize.Width * TexSize.Height * 4); + } - public unsafe CDecodedFrame UpdateFrame(double time, AVFrame* frame) { - this.Time = time; - Buffer.MemoryCopy(frame->data[0], (void*)this.TexPointer, frame->linesize[0] * frame->height, frame->linesize[0] * frame->height); - this.Using = true; - return this; - } + public bool Using { + get; + private set; + } + public double Time { + get; + private set; + } + public IntPtr TexPointer { + get; + private set; + } + public Size TexSize { + get; + private set; + } - public void RemoveFrame() { - this.Using = false; - } + public unsafe CDecodedFrame UpdateFrame(double time, AVFrame* frame) { + this.Time = time; + Buffer.MemoryCopy(frame->data[0], (void*)this.TexPointer, frame->linesize[0] * frame->height, frame->linesize[0] * frame->height); + this.Using = true; + return this; + } - public void Dispose() { - this.Using = false; - Marshal.FreeHGlobal(this.TexPointer); - } + public void RemoveFrame() { + this.Using = false; + } + + public void Dispose() { + this.Using = false; + Marshal.FreeHGlobal(this.TexPointer); } } diff --git a/FDK/src/04.Graphics/CFrameConverter.cs b/FDK/src/04.Graphics/CFrameConverter.cs index 514aa8cb..6ecc27f6 100644 --- a/FDK/src/04.Graphics/CFrameConverter.cs +++ b/FDK/src/04.Graphics/CFrameConverter.cs @@ -3,61 +3,61 @@ using System.Runtime.InteropServices; using FFmpeg.AutoGen; -namespace FDK { - public unsafe class CFrameConverter : IDisposable { - public CFrameConverter(Size FrameSize, AVPixelFormat pix_fmt) { - this.FrameSize = FrameSize; - if (pix_fmt != CVPxfmt) { - convert_context = ffmpeg.sws_getContext( - FrameSize.Width, - FrameSize.Height, - pix_fmt, - FrameSize.Width, - FrameSize.Height, - CVPxfmt, - ffmpeg.SWS_FAST_BILINEAR, null, null, null); - this.IsConvert = true; - if (convert_context == null) throw new ApplicationException("Could not initialize the conversion context.\n"); - } - _convertedFrameBufferPtr = Marshal.AllocHGlobal(ffmpeg.av_image_get_buffer_size(CVPxfmt, FrameSize.Width, FrameSize.Height, 1)); +namespace FDK; - _dstData = new byte_ptrArray4(); - _dstLinesize = new int_array4(); - ffmpeg.av_image_fill_arrays(ref _dstData, ref _dstLinesize, (byte*)_convertedFrameBufferPtr, CVPxfmt, FrameSize.Width, FrameSize.Height, 1); +public unsafe class CFrameConverter : IDisposable { + public CFrameConverter(Size FrameSize, AVPixelFormat pix_fmt) { + this.FrameSize = FrameSize; + if (pix_fmt != CVPxfmt) { + convert_context = ffmpeg.sws_getContext( + FrameSize.Width, + FrameSize.Height, + pix_fmt, + FrameSize.Width, + FrameSize.Height, + CVPxfmt, + ffmpeg.SWS_FAST_BILINEAR, null, null, null); + this.IsConvert = true; + if (convert_context == null) throw new ApplicationException("Could not initialize the conversion context.\n"); } + _convertedFrameBufferPtr = Marshal.AllocHGlobal(ffmpeg.av_image_get_buffer_size(CVPxfmt, FrameSize.Width, FrameSize.Height, 1)); - public AVFrame* Convert(AVFrame* framep) { - if (this.IsConvert) { - ffmpeg.sws_scale(convert_context, framep->data, framep->linesize, 0, framep->height, _dstData, _dstLinesize); - - AVFrame* tmp = ffmpeg.av_frame_alloc(); - tmp = ffmpeg.av_frame_alloc(); - tmp->best_effort_timestamp = framep->best_effort_timestamp; - tmp->width = FrameSize.Width; - tmp->height = FrameSize.Height; - tmp->data = new byte_ptrArray8(); - tmp->data.UpdateFrom(_dstData); - tmp->linesize = new int_array8(); - tmp->linesize.UpdateFrom(_dstLinesize); - - ffmpeg.av_frame_unref(framep); - return tmp; - } else { - return framep; - } - } - - public void Dispose() { - Marshal.FreeHGlobal(_convertedFrameBufferPtr); - ffmpeg.sws_freeContext(convert_context); - } - - private SwsContext* convert_context; - private readonly byte_ptrArray4 _dstData; - private readonly int_array4 _dstLinesize; - private readonly IntPtr _convertedFrameBufferPtr; - private const AVPixelFormat CVPxfmt = AVPixelFormat.AV_PIX_FMT_RGBA; - private bool IsConvert = false; - private Size FrameSize; + _dstData = new byte_ptrArray4(); + _dstLinesize = new int_array4(); + ffmpeg.av_image_fill_arrays(ref _dstData, ref _dstLinesize, (byte*)_convertedFrameBufferPtr, CVPxfmt, FrameSize.Width, FrameSize.Height, 1); } + + public AVFrame* Convert(AVFrame* framep) { + if (this.IsConvert) { + ffmpeg.sws_scale(convert_context, framep->data, framep->linesize, 0, framep->height, _dstData, _dstLinesize); + + AVFrame* tmp = ffmpeg.av_frame_alloc(); + tmp = ffmpeg.av_frame_alloc(); + tmp->best_effort_timestamp = framep->best_effort_timestamp; + tmp->width = FrameSize.Width; + tmp->height = FrameSize.Height; + tmp->data = new byte_ptrArray8(); + tmp->data.UpdateFrom(_dstData); + tmp->linesize = new int_array8(); + tmp->linesize.UpdateFrom(_dstLinesize); + + ffmpeg.av_frame_unref(framep); + return tmp; + } else { + return framep; + } + } + + public void Dispose() { + Marshal.FreeHGlobal(_convertedFrameBufferPtr); + ffmpeg.sws_freeContext(convert_context); + } + + private SwsContext* convert_context; + private readonly byte_ptrArray4 _dstData; + private readonly int_array4 _dstLinesize; + private readonly IntPtr _convertedFrameBufferPtr; + private const AVPixelFormat CVPxfmt = AVPixelFormat.AV_PIX_FMT_RGBA; + private bool IsConvert = false; + private Size FrameSize; } diff --git a/FDK/src/04.Graphics/CTexture.cs b/FDK/src/04.Graphics/CTexture.cs index 44578cf9..2dc9bf89 100644 --- a/FDK/src/04.Graphics/CTexture.cs +++ b/FDK/src/04.Graphics/CTexture.cs @@ -7,72 +7,73 @@ using Point = System.Drawing.Point; using Rectangle = System.Drawing.Rectangle; using RectangleF = System.Drawing.RectangleF; -namespace FDK { - public class CTexture : IDisposable { - /// - /// バッファの集まり - /// - private static uint VAO; +namespace FDK; - /// - /// 頂点バッファ - /// - private static uint VBO; +public class CTexture : IDisposable { + /// + /// バッファの集まり + /// + private static uint VAO; - /// - /// 頂点バッファの使用順バッファ - /// - private static uint EBO; + /// + /// 頂点バッファ + /// + private static uint VBO; - /// - /// テクスチャで使用するUV座標バッファ - /// - private static uint UVBO; + /// + /// 頂点バッファの使用順バッファ + /// + private static uint EBO; - /// - /// 頂点バッファの使用順の数 - /// - private static uint IndicesCount; + /// + /// テクスチャで使用するUV座標バッファ + /// + private static uint UVBO; - /// - /// シェーダー - /// - private static uint ShaderProgram; + /// + /// 頂点バッファの使用順の数 + /// + private static uint IndicesCount; - /// - /// 移動、回転、拡大縮小に使うMatrixのハンドル - /// - private static int MVPID; + /// + /// シェーダー + /// + private static uint ShaderProgram; - /// - /// 色合いのハンドル - /// - private static int ColorID; + /// + /// 移動、回転、拡大縮小に使うMatrixのハンドル + /// + private static int MVPID; - /// - /// 拡大率のハンドル - /// - private static int ScaleID; + /// + /// 色合いのハンドル + /// + private static int ColorID; - /// - /// テクスチャの切り抜きのハンドル - /// - private static int TextureRectID; + /// + /// 拡大率のハンドル + /// + private static int ScaleID; - private static int CameraID; + /// + /// テクスチャの切り抜きのハンドル + /// + private static int TextureRectID; - private static int NoteModeID; + private static int CameraID; - private static int NoiseEffectID; - private static int TimeID; + private static int NoteModeID; - /// - /// 描画に使用する共通のバッファを作成 - /// - public static void Init() { - //シェーダーを作成、実際のコードはCreateShaderProgramWithShaderを見てください - ShaderProgram = ShaderHelper.CreateShaderProgramFromSource( - @"#version 100 + private static int NoiseEffectID; + private static int TimeID; + + /// + /// 描画に使用する共通のバッファを作成 + /// + public static void Init() { + //シェーダーを作成、実際のコードはCreateShaderProgramWithShaderを見てください + ShaderProgram = ShaderHelper.CreateShaderProgramFromSource( + @"#version 100 precision mediump float; attribute vec3 aPosition; @@ -92,8 +93,8 @@ namespace FDK { texcoord = vec2(aUV.x, aUV.y); gl_Position = position; }" - , - @"#version 100 + , + @"#version 100 precision mediump float; uniform vec4 color; @@ -135,813 +136,812 @@ namespace FDK { gl_FragColor = texColor; }" - ); - //------ + ); + //------ - //シェーダーに値を送るためのハンドルを取得------ - MVPID = Game.Gl.GetUniformLocation(ShaderProgram, "mvp"); //拡大縮小、移動、回転のMatrix - ColorID = Game.Gl.GetUniformLocation(ShaderProgram, "color"); //色合い - ScaleID = Game.Gl.GetUniformLocation(ShaderProgram, "scale"); //スケール - TextureRectID = Game.Gl.GetUniformLocation(ShaderProgram, "textureRect"); //テクスチャの切り抜きの座標と大きさ - CameraID = Game.Gl.GetUniformLocation(ShaderProgram, "camera"); //テクスチャの切り抜きの座標と大きさ - NoteModeID = Game.Gl.GetUniformLocation(ShaderProgram, "noteMode"); //テクスチャの切り抜きの座標と大きさ - NoiseEffectID = Game.Gl.GetUniformLocation(ShaderProgram, "useNoiseEffect"); - TimeID = Game.Gl.GetUniformLocation(ShaderProgram, "time"); + //シェーダーに値を送るためのハンドルを取得------ + MVPID = Game.Gl.GetUniformLocation(ShaderProgram, "mvp"); //拡大縮小、移動、回転のMatrix + ColorID = Game.Gl.GetUniformLocation(ShaderProgram, "color"); //色合い + ScaleID = Game.Gl.GetUniformLocation(ShaderProgram, "scale"); //スケール + TextureRectID = Game.Gl.GetUniformLocation(ShaderProgram, "textureRect"); //テクスチャの切り抜きの座標と大きさ + CameraID = Game.Gl.GetUniformLocation(ShaderProgram, "camera"); //テクスチャの切り抜きの座標と大きさ + NoteModeID = Game.Gl.GetUniformLocation(ShaderProgram, "noteMode"); //テクスチャの切り抜きの座標と大きさ + NoiseEffectID = Game.Gl.GetUniformLocation(ShaderProgram, "useNoiseEffect"); + TimeID = Game.Gl.GetUniformLocation(ShaderProgram, "time"); - //------ + //------ - //2DSprite専用のバッファーを作成する... なんとVAOは一つでOK! + //2DSprite専用のバッファーを作成する... なんとVAOは一つでOK! - //VAOを作成---- - VAO = Game.Gl.GenVertexArray(); - Game.Gl.BindVertexArray(VAO); - //---- + //VAOを作成---- + VAO = Game.Gl.GenVertexArray(); + Game.Gl.BindVertexArray(VAO); + //---- - //VBOを作成----- - float[] vertices = new float[] //頂点データ - { - //x, y, z - -1.0f, 1.0f, 0.0f, - 1.0f, 1.0f, 0.0f, - -1.0f, -1.0f, 0.0f, - 1.0f, -1.0f, 0.0f, - }; - VBO = Game.Gl.GenBuffer(); //頂点バッファを作る - Game.Gl.BindBuffer(BufferTargetARB.ArrayBuffer, VBO); //頂点バッファをバインドをする - unsafe { - fixed (float* data = vertices) { - Game.Gl.BufferData(BufferTargetARB.ArrayBuffer, (nuint)(vertices.Length * sizeof(float)), data, BufferUsageARB.StaticDraw); //VRAMに頂点データを送る - } - } - - uint locationPosition = (uint)Game.Gl.GetAttribLocation(ShaderProgram, "aPosition"); - Game.Gl.EnableVertexAttribArray(locationPosition); //layout (location = 0)を使用可能に - unsafe { - Game.Gl.VertexAttribPointer(locationPosition, 3, VertexAttribPointerType.Float, false, 3 * sizeof(float), (void*)0); //float3個で一つのxyzの塊として頂点を作る - } - //----- - - - - //EBOを作成------ - //普通に四角を描画すると頂点データのxyzの塊が6個も必要だけど四つだけ作成して読み込む順番をこうやって登録すればメモリが少なくなる! - - EBO = Game.Gl.GenBuffer(); //頂点バッファの使用順バッファを作る - Game.Gl.BindBuffer(BufferTargetARB.ElementArrayBuffer, EBO); //頂点バッファの使用順バッファをバインドする - - uint[] indices = new uint[] // - { - 0, 1, 2, - 2, 1, 3 - }; - IndicesCount = (uint)indices.Length; //数を登録する - unsafe { - fixed (uint* data = indices) { - Game.Gl.BufferData(BufferTargetARB.ElementArrayBuffer, (nuint)(indices.Length * sizeof(uint)), data, BufferUsageARB.StaticDraw); //VRAMに送る - } - } - //----- - - //テクスチャの読み込みに使用するUV座標のバッファを作成、処理はVBOと大体同じ - UVBO = Game.Gl.GenBuffer(); - Game.Gl.BindBuffer(BufferTargetARB.ArrayBuffer, UVBO); - - float[] uvs = new float[] - { - 0.0f, 0.0f, - 1.0f, 0.0f, - 0.0f, 1.0f, - 1.0f, 1.0f, - }; - unsafe { - fixed (float* data = uvs) { - Game.Gl.BufferData(BufferTargetARB.ArrayBuffer, (nuint)(uvs.Length * sizeof(float)), data, BufferUsageARB.StaticDraw); - } - } - - uint locationUV = (uint)Game.Gl.GetAttribLocation(ShaderProgram, "aUV"); - Game.Gl.EnableVertexAttribArray(locationUV); - unsafe { - Game.Gl.VertexAttribPointer(locationUV, 2, VertexAttribPointerType.Float, false, 2 * sizeof(float), (void*)0); - } - //----- - - - //バインドを解除 厳密には必須ではないが何かのはずみでバインドされたままBufferSubDataでデータが更新されたらとかされたらまあ大変----- - Game.Gl.BindVertexArray(0); - Game.Gl.BindBuffer(BufferTargetARB.ArrayBuffer, 0); - Game.Gl.BindBuffer(BufferTargetARB.ElementArrayBuffer, 0); - //----- - - - } - - /// - /// 描画に使用する共通のバッファを解放 - /// - public static void Terminate() { - //ちゃんとバッファは解放すること - Game.Gl.DeleteVertexArray(VAO); - Game.Gl.DeleteBuffer(VBO); - Game.Gl.DeleteBuffer(EBO); - Game.Gl.DeleteBuffer(UVBO); - Game.Gl.DeleteProgram(ShaderProgram); - } - - // Properties - - public bool bUseNoiseEffect { - get; - set; - } - - public bool b加算合成 { - get; - set; - } - public bool b乗算合成 { - get; - set; - } - public bool b減算合成 { - get; - set; - } - public bool bスクリーン合成 { - get; - set; - } - public float fZ軸中心回転 { - get; - set; - } - public float fZRotation { - get => fZ軸中心回転; - set { fZ軸中心回転 = value; } - } - public int Opacity { - get { - return this._opacity; - } - set { - if (value < 0) { - this._opacity = 0; - } else if (value > 0xff) { - this._opacity = 0xff; - } else { - this._opacity = value; - } + //VBOを作成----- + float[] vertices = new float[] //頂点データ + { + //x, y, z + -1.0f, 1.0f, 0.0f, + 1.0f, 1.0f, 0.0f, + -1.0f, -1.0f, 0.0f, + 1.0f, -1.0f, 0.0f, + }; + VBO = Game.Gl.GenBuffer(); //頂点バッファを作る + Game.Gl.BindBuffer(BufferTargetARB.ArrayBuffer, VBO); //頂点バッファをバインドをする + unsafe { + fixed (float* data = vertices) { + Game.Gl.BufferData(BufferTargetARB.ArrayBuffer, (nuint)(vertices.Length * sizeof(float)), data, BufferUsageARB.StaticDraw); //VRAMに頂点データを送る } } - public Size szTextureSize { - get; - private set; + + uint locationPosition = (uint)Game.Gl.GetAttribLocation(ShaderProgram, "aPosition"); + Game.Gl.EnableVertexAttribArray(locationPosition); //layout (location = 0)を使用可能に + unsafe { + Game.Gl.VertexAttribPointer(locationPosition, 3, VertexAttribPointerType.Float, false, 3 * sizeof(float), (void*)0); //float3個で一つのxyzの塊として頂点を作る } - public Size sz画像サイズ { - get; - protected set; + //----- + + + + //EBOを作成------ + //普通に四角を描画すると頂点データのxyzの塊が6個も必要だけど四つだけ作成して読み込む順番をこうやって登録すればメモリが少なくなる! + + EBO = Game.Gl.GenBuffer(); //頂点バッファの使用順バッファを作る + Game.Gl.BindBuffer(BufferTargetARB.ElementArrayBuffer, EBO); //頂点バッファの使用順バッファをバインドする + + uint[] indices = new uint[] // + { + 0, 1, 2, + 2, 1, 3 + }; + IndicesCount = (uint)indices.Length; //数を登録する + unsafe { + fixed (uint* data = indices) { + Game.Gl.BufferData(BufferTargetARB.ElementArrayBuffer, (nuint)(indices.Length * sizeof(uint)), data, BufferUsageARB.StaticDraw); //VRAMに送る + } } - public Vector3D vcScaleRatio; + //----- - // 画面が変わるたび以下のプロパティを設定し治すこと。 + //テクスチャの読み込みに使用するUV座標のバッファを作成、処理はVBOと大体同じ + UVBO = Game.Gl.GenBuffer(); + Game.Gl.BindBuffer(BufferTargetARB.ArrayBuffer, UVBO); - public static Size sz論理画面 = Size.Empty; - public static Size sz物理画面 = Size.Empty; - public static Rectangle rc物理画面描画領域 = Rectangle.Empty; - /// - /// 論理画面を1とする場合の物理画面の倍率。 - /// 論理値×画面比率=物理値。 - /// - public static float f画面比率 = 1.0f; - - public uint Pointer { get; internal set; } - - // Constructor - - public CTexture() { - this.sz画像サイズ = new Size(0, 0); - this.szTextureSize = new Size(0, 0); - this._opacity = 0xff; - this.b加算合成 = false; - this.fZ軸中心回転 = 0f; - this.vcScaleRatio = new Vector3D(1f, 1f, 1f); - // this._txData = null; + float[] uvs = new float[] + { + 0.0f, 0.0f, + 1.0f, 0.0f, + 0.0f, 1.0f, + 1.0f, 1.0f, + }; + unsafe { + fixed (float* data = uvs) { + Game.Gl.BufferData(BufferTargetARB.ArrayBuffer, (nuint)(uvs.Length * sizeof(float)), data, BufferUsageARB.StaticDraw); + } } - public CTexture(CTexture tx) { - this.sz画像サイズ = tx.sz画像サイズ; - this.szTextureSize = tx.szTextureSize; - this._opacity = tx._opacity; - this.b加算合成 = tx.b加算合成; - this.fZ軸中心回転 = tx.fZ軸中心回転; - this.vcScaleRatio = tx.vcScaleRatio; - Pointer = tx.Pointer; - // this._txData = null; + uint locationUV = (uint)Game.Gl.GetAttribLocation(ShaderProgram, "aUV"); + Game.Gl.EnableVertexAttribArray(locationUV); + unsafe { + Game.Gl.VertexAttribPointer(locationUV, 2, VertexAttribPointerType.Float, false, 2 * sizeof(float), (void*)0); } + //----- - public void UpdateTexture(CTexture texture, int n幅, int n高さ) { - Pointer = texture.Pointer; + + //バインドを解除 厳密には必須ではないが何かのはずみでバインドされたままBufferSubDataでデータが更新されたらとかされたらまあ大変----- + Game.Gl.BindVertexArray(0); + Game.Gl.BindBuffer(BufferTargetARB.ArrayBuffer, 0); + Game.Gl.BindBuffer(BufferTargetARB.ElementArrayBuffer, 0); + //----- + + + } + + /// + /// 描画に使用する共通のバッファを解放 + /// + public static void Terminate() { + //ちゃんとバッファは解放すること + Game.Gl.DeleteVertexArray(VAO); + Game.Gl.DeleteBuffer(VBO); + Game.Gl.DeleteBuffer(EBO); + Game.Gl.DeleteBuffer(UVBO); + Game.Gl.DeleteProgram(ShaderProgram); + } + + // Properties + + public bool bUseNoiseEffect { + get; + set; + } + + public bool b加算合成 { + get; + set; + } + public bool b乗算合成 { + get; + set; + } + public bool b減算合成 { + get; + set; + } + public bool bスクリーン合成 { + get; + set; + } + public float fZ軸中心回転 { + get; + set; + } + public float fZRotation { + get => fZ軸中心回転; + set { fZ軸中心回転 = value; } + } + public int Opacity { + get { + return this._opacity; + } + set { + if (value < 0) { + this._opacity = 0; + } else if (value > 0xff) { + this._opacity = 0xff; + } else { + this._opacity = value; + } + } + } + public Size szTextureSize { + get; + private set; + } + public Size sz画像サイズ { + get; + protected set; + } + public Vector3D vcScaleRatio; + + // 画面が変わるたび以下のプロパティを設定し治すこと。 + + public static Size sz論理画面 = Size.Empty; + public static Size sz物理画面 = Size.Empty; + public static Rectangle rc物理画面描画領域 = Rectangle.Empty; + /// + /// 論理画面を1とする場合の物理画面の倍率。 + /// 論理値×画面比率=物理値。 + /// + public static float f画面比率 = 1.0f; + + public uint Pointer { get; internal set; } + + // Constructor + + public CTexture() { + this.sz画像サイズ = new Size(0, 0); + this.szTextureSize = new Size(0, 0); + this._opacity = 0xff; + this.b加算合成 = false; + this.fZ軸中心回転 = 0f; + this.vcScaleRatio = new Vector3D(1f, 1f, 1f); + // this._txData = null; + } + + public CTexture(CTexture tx) { + this.sz画像サイズ = tx.sz画像サイズ; + this.szTextureSize = tx.szTextureSize; + this._opacity = tx._opacity; + this.b加算合成 = tx.b加算合成; + this.fZ軸中心回転 = tx.fZ軸中心回転; + this.vcScaleRatio = tx.vcScaleRatio; + Pointer = tx.Pointer; + // this._txData = null; + } + + public void UpdateTexture(CTexture texture, int n幅, int n高さ) { + Pointer = texture.Pointer; + this.sz画像サイズ = new Size(n幅, n高さ); + this.szTextureSize = this.t指定されたサイズを超えない最適なテクスチャサイズを返す(this.sz画像サイズ); + this.rc全画像 = new Rectangle(0, 0, this.sz画像サイズ.Width, this.sz画像サイズ.Height); + } + + public void UpdateTexture(IntPtr texture, int width, int height, PixelFormat rgbaType) { + unsafe { + Game.Gl.DeleteTexture(Pointer); //解放 + void* data = texture.ToPointer(); + Pointer = GenTexture(data, (uint)width, (uint)height, rgbaType); + } + this.sz画像サイズ = new Size(width, height); + this.szTextureSize = this.t指定されたサイズを超えない最適なテクスチャサイズを返す(this.sz画像サイズ); + this.rc全画像 = new Rectangle(0, 0, this.sz画像サイズ.Width, this.sz画像サイズ.Height); + } + + /// + /// 指定されたビットマップオブジェクトから Managed テクスチャを作成する。 + /// テクスチャのサイズは、BITMAP画像のサイズ以上、かつ、D3D9デバイスで生成可能な最小のサイズに自動的に調節される。 + /// その際、テクスチャの調節後のサイズにあわせた画像の拡大縮小は行わない。 + /// その他、ミップマップ数は 1、Usage は None、Pool は Managed、イメージフィルタは Point、ミップマップフィルタは + /// None、カラーキーは 0xFFFFFFFF(完全なる黒を透過)になる。 + /// + /// Direct3D9 デバイス。 + /// 作成元のビットマップ。 + /// テクスチャのフォーマット。 + /// テクスチャの作成に失敗しました。 + public CTexture(SKBitmap bitmap) + : this() { + try { + MakeTexture(bitmap, false); + } catch (Exception e) { + this.Dispose(); + throw new CTextureCreateFailedException("ビットマップからのテクスチャの生成に失敗しました。", e); + } + } + + public CTexture(int n幅, int n高さ) + : this() { + try { this.sz画像サイズ = new Size(n幅, n高さ); this.szTextureSize = this.t指定されたサイズを超えない最適なテクスチャサイズを返す(this.sz画像サイズ); this.rc全画像 = new Rectangle(0, 0, this.sz画像サイズ.Width, this.sz画像サイズ.Height); + } catch { + this.Dispose(); + throw new CTextureCreateFailedException(string.Format("テクスチャの生成に失敗しました。\n({0}x{1}, {2})", n幅, n高さ)); } + } + + /// + /// 画像ファイルからテクスチャを生成する。 + /// 利用可能な画像形式は、BMP, JPG, PNG, TGA, DDS, PPM, DIB, HDR, PFM のいずれか。 + /// テクスチャのサイズは、画像のサイズ以上、かつ、D3D9デバイスで生成可能な最小のサイズに自動的に調節される。 + /// その際、テクスチャの調節後のサイズにあわせた画像の拡大縮小は行わない。 + /// その他、ミップマップ数は 1、Usage は None、イメージフィルタは Point、ミップマップフィルタは None になる。 + /// + /// Direct3D9 デバイス。 + /// 画像ファイル名。 + /// テクスチャのフォーマット。 + /// 画像の黒(0xFFFFFFFF)を透過させるなら true。 + /// テクスチャの管理方法。 + /// テクスチャの作成に失敗しました。 + public CTexture(string strファイル名, bool b黒を透過する) + : this() { + MakeTexture(strファイル名, b黒を透過する); + } + public void MakeTexture(string strファイル名, bool b黒を透過する) { + if (!File.Exists(strファイル名)) // #27122 2012.1.13 from: ImageInformation では FileNotFound 例外は返ってこないので、ここで自分でチェックする。わかりやすいログのために。 + throw new FileNotFoundException(string.Format("ファイルが存在しません。\n[{0}]", strファイル名)); + + SKBitmap bitmap = SKBitmap.Decode(strファイル名); + MakeTexture(bitmap, b黒を透過する); + bitmap.Dispose(); + } + + public CTexture(SKBitmap bitmap, bool b黒を透過する) + : this() { + MakeTexture(bitmap, b黒を透過する); + } + + private unsafe uint GenTexture(void* data, uint width, uint height, PixelFormat pixelFormat) { + //テクスチャハンドルの作成----- + uint handle = Game.Gl.GenTexture(); + Game.Gl.BindTexture(TextureTarget.Texture2D, handle); + //----- + + //テクスチャのデータをVramに送る + Game.Gl.TexImage2D(TextureTarget.Texture2D, 0, (int)pixelFormat, width, height, 0, pixelFormat, GLEnum.UnsignedByte, data); + //----- + + //拡大縮小の時の補完を指定------ + Game.Gl.TexParameterI(GLEnum.Texture2D, GLEnum.TextureMinFilter, (int)TextureMinFilter.Nearest); //この場合は補完しない + Game.Gl.TexParameterI(GLEnum.Texture2D, GLEnum.TextureMagFilter, (int)TextureMinFilter.Nearest); + //------ + + Game.Gl.BindTexture(TextureTarget.Texture2D, 0); //バインドを解除することを忘れないように + + return handle; + } + + public void MakeTexture(SKBitmap bitmap, bool b黒を透過する) { + try { + if (bitmap == null) { + bitmap = new SKBitmap(10, 10); + } - public void UpdateTexture(IntPtr texture, int width, int height, PixelFormat rgbaType) { unsafe { - Game.Gl.DeleteTexture(Pointer); //解放 - void* data = texture.ToPointer(); - Pointer = GenTexture(data, (uint)width, (uint)height, rgbaType); - } - this.sz画像サイズ = new Size(width, height); - this.szTextureSize = this.t指定されたサイズを超えない最適なテクスチャサイズを返す(this.sz画像サイズ); - this.rc全画像 = new Rectangle(0, 0, this.sz画像サイズ.Width, this.sz画像サイズ.Height); - } - - /// - /// 指定されたビットマップオブジェクトから Managed テクスチャを作成する。 - /// テクスチャのサイズは、BITMAP画像のサイズ以上、かつ、D3D9デバイスで生成可能な最小のサイズに自動的に調節される。 - /// その際、テクスチャの調節後のサイズにあわせた画像の拡大縮小は行わない。 - /// その他、ミップマップ数は 1、Usage は None、Pool は Managed、イメージフィルタは Point、ミップマップフィルタは - /// None、カラーキーは 0xFFFFFFFF(完全なる黒を透過)になる。 - /// - /// Direct3D9 デバイス。 - /// 作成元のビットマップ。 - /// テクスチャのフォーマット。 - /// テクスチャの作成に失敗しました。 - public CTexture(SKBitmap bitmap) - : this() { - try { - MakeTexture(bitmap, false); - } catch (Exception e) { - this.Dispose(); - throw new CTextureCreateFailedException("ビットマップからのテクスチャの生成に失敗しました。", e); - } - } - - public CTexture(int n幅, int n高さ) - : this() { - try { - this.sz画像サイズ = new Size(n幅, n高さ); - this.szTextureSize = this.t指定されたサイズを超えない最適なテクスチャサイズを返す(this.sz画像サイズ); - this.rc全画像 = new Rectangle(0, 0, this.sz画像サイズ.Width, this.sz画像サイズ.Height); - } catch { - this.Dispose(); - throw new CTextureCreateFailedException(string.Format("テクスチャの生成に失敗しました。\n({0}x{1}, {2})", n幅, n高さ)); - } - } - - /// - /// 画像ファイルからテクスチャを生成する。 - /// 利用可能な画像形式は、BMP, JPG, PNG, TGA, DDS, PPM, DIB, HDR, PFM のいずれか。 - /// テクスチャのサイズは、画像のサイズ以上、かつ、D3D9デバイスで生成可能な最小のサイズに自動的に調節される。 - /// その際、テクスチャの調節後のサイズにあわせた画像の拡大縮小は行わない。 - /// その他、ミップマップ数は 1、Usage は None、イメージフィルタは Point、ミップマップフィルタは None になる。 - /// - /// Direct3D9 デバイス。 - /// 画像ファイル名。 - /// テクスチャのフォーマット。 - /// 画像の黒(0xFFFFFFFF)を透過させるなら true。 - /// テクスチャの管理方法。 - /// テクスチャの作成に失敗しました。 - public CTexture(string strファイル名, bool b黒を透過する) - : this() { - MakeTexture(strファイル名, b黒を透過する); - } - public void MakeTexture(string strファイル名, bool b黒を透過する) { - if (!File.Exists(strファイル名)) // #27122 2012.1.13 from: ImageInformation では FileNotFound 例外は返ってこないので、ここで自分でチェックする。わかりやすいログのために。 - throw new FileNotFoundException(string.Format("ファイルが存在しません。\n[{0}]", strファイル名)); - - SKBitmap bitmap = SKBitmap.Decode(strファイル名); - MakeTexture(bitmap, b黒を透過する); - bitmap.Dispose(); - } - - public CTexture(SKBitmap bitmap, bool b黒を透過する) - : this() { - MakeTexture(bitmap, b黒を透過する); - } - - private unsafe uint GenTexture(void* data, uint width, uint height, PixelFormat pixelFormat) { - //テクスチャハンドルの作成----- - uint handle = Game.Gl.GenTexture(); - Game.Gl.BindTexture(TextureTarget.Texture2D, handle); - //----- - - //テクスチャのデータをVramに送る - Game.Gl.TexImage2D(TextureTarget.Texture2D, 0, (int)pixelFormat, width, height, 0, pixelFormat, GLEnum.UnsignedByte, data); - //----- - - //拡大縮小の時の補完を指定------ - Game.Gl.TexParameterI(GLEnum.Texture2D, GLEnum.TextureMinFilter, (int)TextureMinFilter.Nearest); //この場合は補完しない - Game.Gl.TexParameterI(GLEnum.Texture2D, GLEnum.TextureMagFilter, (int)TextureMinFilter.Nearest); - //------ - - Game.Gl.BindTexture(TextureTarget.Texture2D, 0); //バインドを解除することを忘れないように - - return handle; - } - - public void MakeTexture(SKBitmap bitmap, bool b黒を透過する) { - try { - if (bitmap == null) { - bitmap = new SKBitmap(10, 10); - } - - unsafe { - fixed (void* data = bitmap.Pixels) { - if (Thread.CurrentThread.ManagedThreadId == Game.MainThreadID) { - Pointer = GenTexture(data, (uint)bitmap.Width, (uint)bitmap.Height, PixelFormat.Bgra); - } else { - SKBitmap bm = bitmap.Copy(); - Action createInstance = () => { - fixed (void* data2 = bitmap.Pixels) { - Pointer = GenTexture(data2, (uint)bitmap.Width, (uint)bitmap.Height, PixelFormat.Bgra); - } - bm.Dispose(); - }; - Game.AsyncActions.Add(createInstance); - while (Game.AsyncActions.Contains(createInstance)) { - + fixed (void* data = bitmap.Pixels) { + if (Thread.CurrentThread.ManagedThreadId == Game.MainThreadID) { + Pointer = GenTexture(data, (uint)bitmap.Width, (uint)bitmap.Height, PixelFormat.Bgra); + } else { + SKBitmap bm = bitmap.Copy(); + Action createInstance = () => { + fixed (void* data2 = bitmap.Pixels) { + Pointer = GenTexture(data2, (uint)bitmap.Width, (uint)bitmap.Height, PixelFormat.Bgra); } + bm.Dispose(); + }; + Game.AsyncActions.Add(createInstance); + while (Game.AsyncActions.Contains(createInstance)) { + } } } - - this.sz画像サイズ = new Size(bitmap.Width, bitmap.Height); - this.rc全画像 = new Rectangle(0, 0, this.sz画像サイズ.Width, this.sz画像サイズ.Height); - this.szTextureSize = this.t指定されたサイズを超えない最適なテクスチャサイズを返す(this.sz画像サイズ); - } catch { - this.Dispose(); - // throw new CTextureCreateFailedException( string.Format( "テクスチャの生成に失敗しました。\n{0}", strファイル名 ) ); - throw new CTextureCreateFailedException(string.Format("テクスチャの生成に失敗しました。\n")); - } - } - - public void tSetScale(float x, float y) { - vcScaleRatio.X = x; - vcScaleRatio.Y = y; - } - - // メソッド - - // 2016.11.10 kairera0467 拡張 - // Rectangleを使う場合、座標調整のためにテクスチャサイズの値をそのまま使うとまずいことになるため、Rectragleから幅を取得して調整をする。 - public void t2D中心基準描画(int x, int y) { - this.t2D描画(x - (this.szTextureSize.Width / 2), y - (this.szTextureSize.Height / 2), 1f, this.rc全画像); - } - - public void t2D中心基準描画Mirrored(int x, int y) { - this.t2D左右反転描画(x - (this.szTextureSize.Width / 2), y - (this.szTextureSize.Height / 2), 1f, this.rc全画像); - } - - public void t2D中心基準描画Mirrored(float x, float y) { - this.t2D左右反転描画(x - (this.szTextureSize.Width / 2), y - (this.szTextureSize.Height / 2), 1f, this.rc全画像); - } - - public void t2D中心基準描画(int x, int y, Rectangle rc画像内の描画領域) { - this.t2D描画(x - (rc画像内の描画領域.Width / 2), y - (rc画像内の描画領域.Height / 2), 1f, rc画像内の描画領域); - } - public void t2D中心基準描画(float x, float y) { - this.t2D描画((int)x - (this.szTextureSize.Width / 2), (int)y - (this.szTextureSize.Height / 2), 1f, this.rc全画像); - } - public void t2D中心基準描画(float x, float y, Rectangle rc画像内の描画領域) { - this.t2D描画((int)x - (rc画像内の描画領域.Width / 2), (int)y - (rc画像内の描画領域.Height / 2), 1.0f, rc画像内の描画領域); - } - public void t2D中心基準描画(float x, float y, float depth, Rectangle rc画像内の描画領域) { - this.t2D描画((int)x - (rc画像内の描画領域.Width / 2), (int)y - (rc画像内の描画領域.Height / 2), depth, rc画像内の描画領域); - } - - // 下を基準にして描画する(拡大率考慮)メソッドを追加。 (AioiLight) - public void t2D拡大率考慮下基準描画(int x, int y) { - this.t2D描画(x, y - (szTextureSize.Height * this.vcScaleRatio.Y), 1f, this.rc全画像); - } - public void t2D拡大率考慮下基準描画(int x, int y, Rectangle rc画像内の描画領域) { - this.t2D描画(x, y - (rc画像内の描画領域.Height * this.vcScaleRatio.Y), 1f, rc画像内の描画領域); - } - public void t2D拡大率考慮下中心基準描画(int x, int y) { - this.t2D描画(x - (this.szTextureSize.Width / 2 * this.vcScaleRatio.X), y - (szTextureSize.Height * this.vcScaleRatio.Y), 1f, this.rc全画像); - } - - public void t2D拡大率考慮下中心基準描画Mirrored(int x, int y) { - this.t2D左右反転描画(x - (this.szTextureSize.Width / 2 * this.vcScaleRatio.X), y - (szTextureSize.Height * this.vcScaleRatio.Y), 1f, this.rc全画像); - } - public void t2D拡大率考慮下中心基準描画Mirrored(float x, float y) { - this.t2D左右反転描画(x - (this.szTextureSize.Width / 2 * this.vcScaleRatio.X), y - (szTextureSize.Height * this.vcScaleRatio.Y), 1f, this.rc全画像); - } - - public void t2D拡大率考慮下基準描画(float x, float y) { - this.t2D描画(x, y - (szTextureSize.Height * this.vcScaleRatio.Y), 1f, this.rc全画像); - } - public void t2D拡大率考慮下基準描画(float x, float y, RectangleF rc画像内の描画領域) { - this.t2D描画(x, y - (rc画像内の描画領域.Height * this.vcScaleRatio.Y), 1f, rc画像内の描画領域); - } - public void t2D拡大率考慮下中心基準描画(float x, float y) { - this.t2D拡大率考慮下中心基準描画((int)x, (int)y); - } - - public void t2D拡大率考慮下中心基準描画(int x, int y, Rectangle rc画像内の描画領域) { - this.t2D描画(x - ((rc画像内の描画領域.Width / 2)), y - (rc画像内の描画領域.Height * this.vcScaleRatio.Y), 1f, rc画像内の描画領域); - } - public void t2D拡大率考慮下中心基準描画(float x, float y, Rectangle rc画像内の描画領域) { - this.t2D拡大率考慮下中心基準描画((int)x, (int)y, rc画像内の描画領域); - } - public void t2D下中央基準描画(int x, int y) { - this.t2D描画(x - (this.szTextureSize.Width / 2), y - (szTextureSize.Height), this.rc全画像); - } - public void t2D下中央基準描画(int x, int y, Rectangle rc画像内の描画領域) { - this.t2D描画(x - (rc画像内の描画領域.Width / 2), y - (rc画像内の描画領域.Height), rc画像内の描画領域); - //this.t2D描画(devicek x, y, rc画像内の描画領域; - } - - public void t2D_DisplayImage_RollNote(int x, int y, RectangleF rc) { - this.t2D描画(x - (rc.Width / 2 * this.vcScaleRatio.X), y - (rc.Height / 2 * this.vcScaleRatio.Y), 1f, rc, true); - } - - public void t2D拡大率考慮中央基準描画(int x, int y) { - this.t2D描画(x - (this.szTextureSize.Width / 2 * this.vcScaleRatio.X), y - (szTextureSize.Height / 2 * this.vcScaleRatio.Y), 1f, this.rc全画像); - } - public void t2D拡大率考慮中央基準描画(int x, int y, RectangleF rc) { - this.t2D描画(x - (rc.Width / 2 * this.vcScaleRatio.X), y - (rc.Height / 2 * this.vcScaleRatio.Y), 1f, rc); - } - public void t2D_DisplayImage_AnchorCenterLeft(int x, int y, RectangleF rc) { - this.t2D描画(x, y - (rc.Height / 2 * this.vcScaleRatio.Y), 1f, rc); - } - public void t2D拡大率考慮上中央基準描画(int x, int y, RectangleF rc) { - this.t2D描画(x - (rc.Width / 2 * this.vcScaleRatio.X), y, 1f, rc); - } - public void t2D_DisplayImage_AnchorUpRight(int x, int y, RectangleF rc) { - this.t2D描画(x - (rc.Width * this.vcScaleRatio.X), y, 1f, rc); - } - public void t2D拡大率考慮上中央基準描画(int x, int y) { - this.t2D描画(x - (rc全画像.Width / 2 * this.vcScaleRatio.X), y, 1f, rc全画像); - } - public void t2D拡大率考慮中央基準描画(float x, float y) { - this.t2D描画(x - (this.szTextureSize.Width / 2 * this.vcScaleRatio.X), y - (szTextureSize.Height / 2 * this.vcScaleRatio.Y), 1f, this.rc全画像); - } - public void t2D拡大率考慮中央基準描画Mirrored(float x, float y) { - this.t2D左右反転描画(x - (this.szTextureSize.Width / 2 * this.vcScaleRatio.X), y - (szTextureSize.Height / 2 * this.vcScaleRatio.Y), 1f, this.rc全画像); - } - public void t2D拡大率考慮中央基準描画(float x, float y, RectangleF rc) { - this.t2D描画(x - (rc.Width / 2 * this.vcScaleRatio.X), y - (rc.Height / 2 * this.vcScaleRatio.Y), 1f, rc); - } - public void t2D拡大率考慮描画(RefPnt refpnt, float x, float y) { - this.t2D拡大率考慮描画(refpnt, x, y, rc全画像); - } - public void t2D拡大率考慮描画(RefPnt refpnt, float x, float y, Rectangle rect) { - this.t2D拡大率考慮描画(refpnt, x, y, 1f, rect); - } - public void t2D拡大率考慮描画(RefPnt refpnt, float x, float y, float depth, Rectangle rect) { - switch (refpnt) { - case RefPnt.UpLeft: - this.t2D描画(x, y, depth, rect); - break; - case RefPnt.Up: - this.t2D描画(x - (rect.Width / 2 * this.vcScaleRatio.X), y, depth, rect); - break; - case RefPnt.UpRight: - this.t2D描画(x - rect.Width * this.vcScaleRatio.X, y, depth, rect); - break; - case RefPnt.Left: - this.t2D描画(x, y - (rect.Height / 2 * this.vcScaleRatio.Y), depth, rect); - break; - case RefPnt.Center: - this.t2D描画(x - (rect.Width / 2 * this.vcScaleRatio.X), y - (rect.Height / 2 * this.vcScaleRatio.Y), depth, rect); - break; - case RefPnt.Right: - this.t2D描画(x - rect.Width * this.vcScaleRatio.X, y - (rect.Height / 2 * this.vcScaleRatio.Y), depth, rect); - break; - case RefPnt.DownLeft: - this.t2D描画(x, y - rect.Height * this.vcScaleRatio.Y, depth, rect); - break; - case RefPnt.Down: - this.t2D描画(x - (rect.Width / 2 * this.vcScaleRatio.X), y - rect.Height * this.vcScaleRatio.Y, depth, rect); - break; - case RefPnt.DownRight: - this.t2D描画(x - rect.Width * this.vcScaleRatio.X, y - rect.Height * this.vcScaleRatio.Y, depth, rect); - break; - default: - break; } + this.sz画像サイズ = new Size(bitmap.Width, bitmap.Height); + this.rc全画像 = new Rectangle(0, 0, this.sz画像サイズ.Width, this.sz画像サイズ.Height); + this.szTextureSize = this.t指定されたサイズを超えない最適なテクスチャサイズを返す(this.sz画像サイズ); + } catch { + this.Dispose(); + // throw new CTextureCreateFailedException( string.Format( "テクスチャの生成に失敗しました。\n{0}", strファイル名 ) ); + throw new CTextureCreateFailedException(string.Format("テクスチャの生成に失敗しました。\n")); } - public void t2D_DisplayImage_AnchorCenter(int x, int y) { - this.t2D描画(x - (this.rc全画像.Width / 2 * this.vcScaleRatio.X), y - (this.rc全画像.Height / 2 * this.vcScaleRatio.Y), 1f, this.rc全画像); - } - public void t2D_DisplayImage_AnchorCenter(int x, int y, Rectangle rc) { - this.t2D描画(x - (rc.Width / 2 * this.vcScaleRatio.X), y - (rc.Height / 2 * this.vcScaleRatio.Y), 1f, rc); - } - public void t2D_DisplayImage_AnchorCenter(int x, int y, RectangleF rc) { - this.t2D描画(x - (rc.Width / 2 * this.vcScaleRatio.X), y - (rc.Height / 2 * this.vcScaleRatio.Y), 1f, rc); - } - - public enum RefPnt { - UpLeft, - Up, - UpRight, - Left, - Center, - Right, - DownLeft, - Down, - DownRight, - } - - public void t2D_DisplayImage(int x, int y) { - this.t2D描画(x, y, 1f, this.rc全画像); - } - public void t2D_DisplayImage(int x, int y, Rectangle rc画像内の描画領域) { - this.t2D描画(x, y, 1f, rc画像内の描画領域); - } - public void t2D_DisplayImage(int x, int y, RectangleF rc) { - this.t2D描画(x, y, 1f, rc); - } - - /// - /// テクスチャを 2D 画像と見なして描画する。 - /// - /// Direct3D9 デバイス。 - /// 描画位置(テクスチャの左上位置の X 座標[dot])。 - /// 描画位置(テクスチャの左上位置の Y 座標[dot])。 - public void t2D描画(int x, int y) { - this.t2D描画(x, y, 1f, this.rc全画像); - } - public void t2D描画(int x, int y, RectangleF rc画像内の描画領域) { - this.t2D描画(x, y, 1f, rc画像内の描画領域); - } - public void t2D描画(float x, float y) { - this.t2D描画((int)x, (int)y, 1f, this.rc全画像); - } - public void t2D描画(float x, float y, RectangleF rc画像内の描画領域) { - this.t2D描画((int)x, (int)y, 1f, rc画像内の描画領域); - } - public void t2D描画(float x, float y, float depth, RectangleF rc画像内の描画領域, bool flipX = false, bool flipY = false, bool rollMode = false) { - this.color4.Alpha = this._opacity / 255f; - - BlendType blendType; - if (b加算合成) { - blendType = BlendType.Add; - } else if (b乗算合成) { - blendType = BlendType.Multi; - } else if (b減算合成) { - blendType = BlendType.Sub; - } else if (bスクリーン合成) { - blendType = BlendType.Screen; - } else { - blendType = BlendType.Normal; - } - - BlendHelper.SetBlend(blendType); - - Game.Gl.UseProgram(ShaderProgram);//Uniform4よりこれが先 - - Game.Gl.BindTexture(TextureTarget.Texture2D, Pointer); //テクスチャをバインド - - //MVPを設定---- - unsafe { - Matrix4X4 mvp = Matrix4X4.Identity; - - float gameAspect = (float)GameWindowSize.Width / GameWindowSize.Height; - - - //スケーリング----- - mvp *= Matrix4X4.CreateScale(rc画像内の描画領域.Width / GameWindowSize.Width, rc画像内の描画領域.Height / GameWindowSize.Height, 1) * - Matrix4X4.CreateScale(flipX ? -vcScaleRatio.X : vcScaleRatio.X, flipY ? -vcScaleRatio.Y : vcScaleRatio.Y, 1.0f); - //----- - - //回転----- - mvp *= Matrix4X4.CreateScale(1.0f * gameAspect, 1.0f, 1.0f) * //ここでアスペクト比でスケーリングしないとおかしなことになる - Matrix4X4.CreateRotationZ(fZ軸中心回転) * - Matrix4X4.CreateScale(1.0f / gameAspect, 1.0f, 1.0f);//回転した後戻してあげる - //----- - - //移動---- - float offsetX = rc画像内の描画領域.Width * vcScaleRatio.X / GameWindowSize.Width; - float offsetY = rc画像内の描画領域.Height * vcScaleRatio.Y / GameWindowSize.Height; - mvp *= Matrix4X4.CreateTranslation(offsetX, -offsetY, 0.0f); - mvp *= Matrix4X4.CreateTranslation(-1.0f, 1.0f, 0); - mvp *= Matrix4X4.CreateTranslation(x / GameWindowSize.Width * 2, -y / GameWindowSize.Height * 2, 0.0f); - //----- - - Game.Gl.UniformMatrix4(MVPID, 1, false, (float*)&mvp); //MVPに値を設定 - Matrix4X4 camera = Game.Camera; - Game.Gl.UniformMatrix4(CameraID, 1, false, (float*)&camera); - } - //------ - - Game.Gl.Uniform4(ColorID, new System.Numerics.Vector4(color4.Red, color4.Green, color4.Blue, color4.Alpha)); //変色用のカラーを設定 - Game.Gl.Uniform2(ScaleID, new System.Numerics.Vector2(vcScaleRatio.X, vcScaleRatio.Y)); //変色用のカラーを設定 - - //テクスチャの切り抜きの座標と大きさを設定 - Game.Gl.Uniform4(TextureRectID, new System.Numerics.Vector4( - rc画像内の描画領域.X / rc全画像.Width, rc画像内の描画領域.Y / rc全画像.Height, //始まり - rc画像内の描画領域.Width / rc全画像.Width, rc画像内の描画領域.Height / rc全画像.Height)); //大きさ、終わりではない - - Game.Gl.Uniform1(NoteModeID, rollMode ? 1 : 0); - - float _time = (DateTime.Now.Ticks / TimeSpan.TicksPerMillisecond) % 100; - Game.Gl.Uniform1(TimeID, _time); - Game.Gl.Uniform1(NoiseEffectID, bUseNoiseEffect ? 1 : 0); - - - //描画----- - Game.Gl.BindVertexArray(VAO); - unsafe { - Game.Gl.DrawElements(PrimitiveType.Triangles, IndicesCount, DrawElementsType.UnsignedInt, (void*)0);//描画! - } - - BlendHelper.SetBlend(BlendType.Normal); - } - public void t2D描画(int x, int y, float depth, Rectangle rc画像内の描画領域) { - t2D描画((float)x, (float)y, depth, rc画像内の描画領域); - } - public void t2D上下反転描画(int x, int y) { - this.t2D上下反転描画(x, y, 1f, this.rc全画像); - } - public void t2D上下反転描画(int x, int y, Rectangle rc画像内の描画領域) { - this.t2D上下反転描画(x, y, 1f, rc画像内の描画領域); - } - public void t2D左右反転描画(int x, int y) { - this.t2D左右反転描画(x, y, 1f, this.rc全画像); - } - public void t2D左右反転描画(float x, float y) { - this.t2D左右反転描画(x, y, 1f, this.rc全画像); - } - public void t2D左右反転描画(int x, int y, Rectangle rc画像内の描画領域) { - this.t2D左右反転描画(x, y, 1f, rc画像内の描画領域); - } - public void t2D左右反転描画(float x, float y, float depth, Rectangle rc画像内の描画領域) { - t2D描画(x, y, depth, rc画像内の描画領域, flipX: true); - } - public void t2D上下反転描画(int x, int y, float depth, Rectangle rc画像内の描画領域) { - t2D描画(x, y, depth, rc画像内の描画領域, flipY: true); - } - public void t2D上下反転描画(Point pt) { - this.t2D上下反転描画(pt.X, pt.Y, 1f, this.rc全画像); - } - public void t2D上下反転描画(Point pt, Rectangle rc画像内の描画領域) { - this.t2D上下反転描画(pt.X, pt.Y, 1f, rc画像内の描画領域); - } - public void t2D上下反転描画(Point pt, float depth, Rectangle rc画像内の描画領域) { - this.t2D上下反転描画(pt.X, pt.Y, depth, rc画像内の描画領域); - } - - public static Vector3D t論理画面座標をワールド座標へ変換する(int x, int y) { - return CTexture.t論理画面座標をワールド座標へ変換する(new Vector3D((float)x, (float)y, 0f)); - } - public static Vector3D t論理画面座標をワールド座標へ変換する(float x, float y) { - return CTexture.t論理画面座標をワールド座標へ変換する(new Vector3D(x, y, 0f)); - } - public static Vector3D t論理画面座標をワールド座標へ変換する(Point pt論理画面座標) { - return CTexture.t論理画面座標をワールド座標へ変換する(new Vector3D(pt論理画面座標.X, pt論理画面座標.Y, 0.0f)); - } - public static Vector3D t論理画面座標をワールド座標へ変換する(Vector2D v2論理画面座標) { - return CTexture.t論理画面座標をワールド座標へ変換する(new Vector3D(v2論理画面座標, 0f)); - } - public static Vector3D t論理画面座標をワールド座標へ変換する(Vector3D v3論理画面座標) { - return new Vector3D( - (v3論理画面座標.X - (CTexture.sz論理画面.Width / 2.0f)) * CTexture.f画面比率, - (-(v3論理画面座標.Y - (CTexture.sz論理画面.Height / 2.0f)) * CTexture.f画面比率), - v3論理画面座標.Z); - } - - - - - public void t2D描画SongObj(float x, float y, float xScale, float yScale) { - this.color4.Alpha = this._opacity / 255f; - - var rc画像内の描画領域 = rc全画像; - this.color4.Alpha = this._opacity / 255f; - - BlendType blendType; - if (b加算合成) { - blendType = BlendType.Add; - } else if (b乗算合成) { - blendType = BlendType.Multi; - } else if (b減算合成) { - blendType = BlendType.Sub; - } else if (bスクリーン合成) { - blendType = BlendType.Screen; - } else { - blendType = BlendType.Normal; - } - - BlendHelper.SetBlend(blendType); - - Game.Gl.UseProgram(ShaderProgram);//Uniform4よりこれが先 - - Game.Gl.BindTexture(TextureTarget.Texture2D, Pointer); //テクスチャをバインド - - //MVPを設定---- - unsafe { - Matrix4X4 mvp = Matrix4X4.Identity; - - float gameAspect = (float)GameWindowSize.Width / GameWindowSize.Height; - - - //スケーリング----- - mvp *= Matrix4X4.CreateScale((float)rc画像内の描画領域.Width / GameWindowSize.Width, (float)rc画像内の描画領域.Height / GameWindowSize.Height, 1) * - Matrix4X4.CreateScale(xScale, yScale, 1.0f); - //----- - - //回転----- - mvp *= Matrix4X4.CreateScale(1.0f * gameAspect, 1.0f, 1.0f) * //ここでアスペクト比でスケーリングしないとおかしなことになる - Matrix4X4.CreateRotationZ(fZ軸中心回転) * - Matrix4X4.CreateScale(1.0f / gameAspect, 1.0f, 1.0f);//回転した後戻してあげる - //----- - - //移動---- - float offsetX = rc画像内の描画領域.Width * xScale / GameWindowSize.Width; - float offsetY = rc画像内の描画領域.Height * yScale / GameWindowSize.Height; - mvp *= Matrix4X4.CreateTranslation(offsetX, -offsetY, 0.0f); - mvp *= Matrix4X4.CreateTranslation(-1.0f, 1.0f, 0); - mvp *= Matrix4X4.CreateTranslation(x / GameWindowSize.Width * 2, -y / GameWindowSize.Height * 2, 0.0f); - //----- - - Game.Gl.UniformMatrix4(MVPID, 1, false, (float*)&mvp); //MVPに値を設定 - Matrix4X4 camera = Game.Camera; - Game.Gl.UniformMatrix4(CameraID, 1, false, (float*)&camera); - } - //------ - - Game.Gl.Uniform4(ColorID, new System.Numerics.Vector4(color4.Red, color4.Green, color4.Blue, color4.Alpha)); //変色用のカラーを設定 - Game.Gl.Uniform2(ScaleID, new System.Numerics.Vector2(vcScaleRatio.X, vcScaleRatio.Y)); //変色用のカラーを設定 - - //テクスチャの切り抜きの座標と大きさを設定 - Game.Gl.Uniform4(TextureRectID, new System.Numerics.Vector4( - rc画像内の描画領域.X / rc全画像.Width, rc画像内の描画領域.Y / rc全画像.Height, //始まり - rc画像内の描画領域.Width / rc全画像.Width, rc画像内の描画領域.Height / rc全画像.Height)); //大きさ、終わりではない - - Game.Gl.Uniform1(NoteModeID, 0); - - float _time = (DateTime.Now.Ticks / TimeSpan.TicksPerMillisecond) % 100; - Game.Gl.Uniform1(TimeID, _time); - Game.Gl.Uniform1(NoiseEffectID, bUseNoiseEffect ? 1 : 0); - - //描画----- - Game.Gl.BindVertexArray(VAO); - unsafe { - Game.Gl.DrawElements(PrimitiveType.Triangles, IndicesCount, DrawElementsType.UnsignedInt, (void*)0);//描画! - } - - BlendHelper.SetBlend(BlendType.Normal); - } - - - #region [ IDisposable 実装 ] - //----------------- - public void Dispose() { - if (!this.bDispose完了済み) { - Game.Gl.DeleteTexture(Pointer); //解放 - - this.bDispose完了済み = true; - } - } - //----------------- - #endregion - - - // その他 - - #region [ private ] - //----------------- - private int _opacity; - private bool bDispose完了済み; - - private Size t指定されたサイズを超えない最適なテクスチャサイズを返す(Size sz指定サイズ) { - return sz指定サイズ; - } - - private int ToArgb(Color4 col4) { - uint a = (uint)(col4.Alpha * 255.0f) & 255; - uint r = (uint)(col4.Red * 255.0f) & 255; - uint g = (uint)(col4.Green * 255.0f) & 255; - uint b = (uint)(col4.Blue * 255.0f) & 255; - - uint value = b; - value |= g << 8; - value |= r << 16; - value |= a << 24; - - return (int)value; - } - - - // 2012.3.21 さらなる new の省略作戦 - - protected Rectangle rc全画像; // テクスチャ作ったらあとは不変 - public Color4 color4 = new Color4(1f, 1f, 1f, 1f); // アルファ以外は不変 - - public void tUpdateColor4(Color4 c4) { - this.color4 = c4; - } - - public void tUpdateOpacity(int o) { - this.Opacity = o; - } - //----------------- - #endregion } + + public void tSetScale(float x, float y) { + vcScaleRatio.X = x; + vcScaleRatio.Y = y; + } + + // メソッド + + // 2016.11.10 kairera0467 拡張 + // Rectangleを使う場合、座標調整のためにテクスチャサイズの値をそのまま使うとまずいことになるため、Rectragleから幅を取得して調整をする。 + public void t2D中心基準描画(int x, int y) { + this.t2D描画(x - (this.szTextureSize.Width / 2), y - (this.szTextureSize.Height / 2), 1f, this.rc全画像); + } + + public void t2D中心基準描画Mirrored(int x, int y) { + this.t2D左右反転描画(x - (this.szTextureSize.Width / 2), y - (this.szTextureSize.Height / 2), 1f, this.rc全画像); + } + + public void t2D中心基準描画Mirrored(float x, float y) { + this.t2D左右反転描画(x - (this.szTextureSize.Width / 2), y - (this.szTextureSize.Height / 2), 1f, this.rc全画像); + } + + public void t2D中心基準描画(int x, int y, Rectangle rc画像内の描画領域) { + this.t2D描画(x - (rc画像内の描画領域.Width / 2), y - (rc画像内の描画領域.Height / 2), 1f, rc画像内の描画領域); + } + public void t2D中心基準描画(float x, float y) { + this.t2D描画((int)x - (this.szTextureSize.Width / 2), (int)y - (this.szTextureSize.Height / 2), 1f, this.rc全画像); + } + public void t2D中心基準描画(float x, float y, Rectangle rc画像内の描画領域) { + this.t2D描画((int)x - (rc画像内の描画領域.Width / 2), (int)y - (rc画像内の描画領域.Height / 2), 1.0f, rc画像内の描画領域); + } + public void t2D中心基準描画(float x, float y, float depth, Rectangle rc画像内の描画領域) { + this.t2D描画((int)x - (rc画像内の描画領域.Width / 2), (int)y - (rc画像内の描画領域.Height / 2), depth, rc画像内の描画領域); + } + + // 下を基準にして描画する(拡大率考慮)メソッドを追加。 (AioiLight) + public void t2D拡大率考慮下基準描画(int x, int y) { + this.t2D描画(x, y - (szTextureSize.Height * this.vcScaleRatio.Y), 1f, this.rc全画像); + } + public void t2D拡大率考慮下基準描画(int x, int y, Rectangle rc画像内の描画領域) { + this.t2D描画(x, y - (rc画像内の描画領域.Height * this.vcScaleRatio.Y), 1f, rc画像内の描画領域); + } + public void t2D拡大率考慮下中心基準描画(int x, int y) { + this.t2D描画(x - (this.szTextureSize.Width / 2 * this.vcScaleRatio.X), y - (szTextureSize.Height * this.vcScaleRatio.Y), 1f, this.rc全画像); + } + + public void t2D拡大率考慮下中心基準描画Mirrored(int x, int y) { + this.t2D左右反転描画(x - (this.szTextureSize.Width / 2 * this.vcScaleRatio.X), y - (szTextureSize.Height * this.vcScaleRatio.Y), 1f, this.rc全画像); + } + public void t2D拡大率考慮下中心基準描画Mirrored(float x, float y) { + this.t2D左右反転描画(x - (this.szTextureSize.Width / 2 * this.vcScaleRatio.X), y - (szTextureSize.Height * this.vcScaleRatio.Y), 1f, this.rc全画像); + } + + public void t2D拡大率考慮下基準描画(float x, float y) { + this.t2D描画(x, y - (szTextureSize.Height * this.vcScaleRatio.Y), 1f, this.rc全画像); + } + public void t2D拡大率考慮下基準描画(float x, float y, RectangleF rc画像内の描画領域) { + this.t2D描画(x, y - (rc画像内の描画領域.Height * this.vcScaleRatio.Y), 1f, rc画像内の描画領域); + } + public void t2D拡大率考慮下中心基準描画(float x, float y) { + this.t2D拡大率考慮下中心基準描画((int)x, (int)y); + } + + public void t2D拡大率考慮下中心基準描画(int x, int y, Rectangle rc画像内の描画領域) { + this.t2D描画(x - ((rc画像内の描画領域.Width / 2)), y - (rc画像内の描画領域.Height * this.vcScaleRatio.Y), 1f, rc画像内の描画領域); + } + public void t2D拡大率考慮下中心基準描画(float x, float y, Rectangle rc画像内の描画領域) { + this.t2D拡大率考慮下中心基準描画((int)x, (int)y, rc画像内の描画領域); + } + public void t2D下中央基準描画(int x, int y) { + this.t2D描画(x - (this.szTextureSize.Width / 2), y - (szTextureSize.Height), this.rc全画像); + } + public void t2D下中央基準描画(int x, int y, Rectangle rc画像内の描画領域) { + this.t2D描画(x - (rc画像内の描画領域.Width / 2), y - (rc画像内の描画領域.Height), rc画像内の描画領域); + //this.t2D描画(devicek x, y, rc画像内の描画領域; + } + + public void t2D_DisplayImage_RollNote(int x, int y, RectangleF rc) { + this.t2D描画(x - (rc.Width / 2 * this.vcScaleRatio.X), y - (rc.Height / 2 * this.vcScaleRatio.Y), 1f, rc, true); + } + + public void t2D拡大率考慮中央基準描画(int x, int y) { + this.t2D描画(x - (this.szTextureSize.Width / 2 * this.vcScaleRatio.X), y - (szTextureSize.Height / 2 * this.vcScaleRatio.Y), 1f, this.rc全画像); + } + public void t2D拡大率考慮中央基準描画(int x, int y, RectangleF rc) { + this.t2D描画(x - (rc.Width / 2 * this.vcScaleRatio.X), y - (rc.Height / 2 * this.vcScaleRatio.Y), 1f, rc); + } + public void t2D_DisplayImage_AnchorCenterLeft(int x, int y, RectangleF rc) { + this.t2D描画(x, y - (rc.Height / 2 * this.vcScaleRatio.Y), 1f, rc); + } + public void t2D拡大率考慮上中央基準描画(int x, int y, RectangleF rc) { + this.t2D描画(x - (rc.Width / 2 * this.vcScaleRatio.X), y, 1f, rc); + } + public void t2D_DisplayImage_AnchorUpRight(int x, int y, RectangleF rc) { + this.t2D描画(x - (rc.Width * this.vcScaleRatio.X), y, 1f, rc); + } + public void t2D拡大率考慮上中央基準描画(int x, int y) { + this.t2D描画(x - (rc全画像.Width / 2 * this.vcScaleRatio.X), y, 1f, rc全画像); + } + public void t2D拡大率考慮中央基準描画(float x, float y) { + this.t2D描画(x - (this.szTextureSize.Width / 2 * this.vcScaleRatio.X), y - (szTextureSize.Height / 2 * this.vcScaleRatio.Y), 1f, this.rc全画像); + } + public void t2D拡大率考慮中央基準描画Mirrored(float x, float y) { + this.t2D左右反転描画(x - (this.szTextureSize.Width / 2 * this.vcScaleRatio.X), y - (szTextureSize.Height / 2 * this.vcScaleRatio.Y), 1f, this.rc全画像); + } + public void t2D拡大率考慮中央基準描画(float x, float y, RectangleF rc) { + this.t2D描画(x - (rc.Width / 2 * this.vcScaleRatio.X), y - (rc.Height / 2 * this.vcScaleRatio.Y), 1f, rc); + } + public void t2D拡大率考慮描画(RefPnt refpnt, float x, float y) { + this.t2D拡大率考慮描画(refpnt, x, y, rc全画像); + } + public void t2D拡大率考慮描画(RefPnt refpnt, float x, float y, Rectangle rect) { + this.t2D拡大率考慮描画(refpnt, x, y, 1f, rect); + } + public void t2D拡大率考慮描画(RefPnt refpnt, float x, float y, float depth, Rectangle rect) { + switch (refpnt) { + case RefPnt.UpLeft: + this.t2D描画(x, y, depth, rect); + break; + case RefPnt.Up: + this.t2D描画(x - (rect.Width / 2 * this.vcScaleRatio.X), y, depth, rect); + break; + case RefPnt.UpRight: + this.t2D描画(x - rect.Width * this.vcScaleRatio.X, y, depth, rect); + break; + case RefPnt.Left: + this.t2D描画(x, y - (rect.Height / 2 * this.vcScaleRatio.Y), depth, rect); + break; + case RefPnt.Center: + this.t2D描画(x - (rect.Width / 2 * this.vcScaleRatio.X), y - (rect.Height / 2 * this.vcScaleRatio.Y), depth, rect); + break; + case RefPnt.Right: + this.t2D描画(x - rect.Width * this.vcScaleRatio.X, y - (rect.Height / 2 * this.vcScaleRatio.Y), depth, rect); + break; + case RefPnt.DownLeft: + this.t2D描画(x, y - rect.Height * this.vcScaleRatio.Y, depth, rect); + break; + case RefPnt.Down: + this.t2D描画(x - (rect.Width / 2 * this.vcScaleRatio.X), y - rect.Height * this.vcScaleRatio.Y, depth, rect); + break; + case RefPnt.DownRight: + this.t2D描画(x - rect.Width * this.vcScaleRatio.X, y - rect.Height * this.vcScaleRatio.Y, depth, rect); + break; + default: + break; + } + + } + public void t2D_DisplayImage_AnchorCenter(int x, int y) { + this.t2D描画(x - (this.rc全画像.Width / 2 * this.vcScaleRatio.X), y - (this.rc全画像.Height / 2 * this.vcScaleRatio.Y), 1f, this.rc全画像); + } + public void t2D_DisplayImage_AnchorCenter(int x, int y, Rectangle rc) { + this.t2D描画(x - (rc.Width / 2 * this.vcScaleRatio.X), y - (rc.Height / 2 * this.vcScaleRatio.Y), 1f, rc); + } + public void t2D_DisplayImage_AnchorCenter(int x, int y, RectangleF rc) { + this.t2D描画(x - (rc.Width / 2 * this.vcScaleRatio.X), y - (rc.Height / 2 * this.vcScaleRatio.Y), 1f, rc); + } + + public enum RefPnt { + UpLeft, + Up, + UpRight, + Left, + Center, + Right, + DownLeft, + Down, + DownRight, + } + + public void t2D_DisplayImage(int x, int y) { + this.t2D描画(x, y, 1f, this.rc全画像); + } + public void t2D_DisplayImage(int x, int y, Rectangle rc画像内の描画領域) { + this.t2D描画(x, y, 1f, rc画像内の描画領域); + } + public void t2D_DisplayImage(int x, int y, RectangleF rc) { + this.t2D描画(x, y, 1f, rc); + } + + /// + /// テクスチャを 2D 画像と見なして描画する。 + /// + /// Direct3D9 デバイス。 + /// 描画位置(テクスチャの左上位置の X 座標[dot])。 + /// 描画位置(テクスチャの左上位置の Y 座標[dot])。 + public void t2D描画(int x, int y) { + this.t2D描画(x, y, 1f, this.rc全画像); + } + public void t2D描画(int x, int y, RectangleF rc画像内の描画領域) { + this.t2D描画(x, y, 1f, rc画像内の描画領域); + } + public void t2D描画(float x, float y) { + this.t2D描画((int)x, (int)y, 1f, this.rc全画像); + } + public void t2D描画(float x, float y, RectangleF rc画像内の描画領域) { + this.t2D描画((int)x, (int)y, 1f, rc画像内の描画領域); + } + public void t2D描画(float x, float y, float depth, RectangleF rc画像内の描画領域, bool flipX = false, bool flipY = false, bool rollMode = false) { + this.color4.Alpha = this._opacity / 255f; + + BlendType blendType; + if (b加算合成) { + blendType = BlendType.Add; + } else if (b乗算合成) { + blendType = BlendType.Multi; + } else if (b減算合成) { + blendType = BlendType.Sub; + } else if (bスクリーン合成) { + blendType = BlendType.Screen; + } else { + blendType = BlendType.Normal; + } + + BlendHelper.SetBlend(blendType); + + Game.Gl.UseProgram(ShaderProgram);//Uniform4よりこれが先 + + Game.Gl.BindTexture(TextureTarget.Texture2D, Pointer); //テクスチャをバインド + + //MVPを設定---- + unsafe { + Matrix4X4 mvp = Matrix4X4.Identity; + + float gameAspect = (float)GameWindowSize.Width / GameWindowSize.Height; + + + //スケーリング----- + mvp *= Matrix4X4.CreateScale(rc画像内の描画領域.Width / GameWindowSize.Width, rc画像内の描画領域.Height / GameWindowSize.Height, 1) * + Matrix4X4.CreateScale(flipX ? -vcScaleRatio.X : vcScaleRatio.X, flipY ? -vcScaleRatio.Y : vcScaleRatio.Y, 1.0f); + //----- + + //回転----- + mvp *= Matrix4X4.CreateScale(1.0f * gameAspect, 1.0f, 1.0f) * //ここでアスペクト比でスケーリングしないとおかしなことになる + Matrix4X4.CreateRotationZ(fZ軸中心回転) * + Matrix4X4.CreateScale(1.0f / gameAspect, 1.0f, 1.0f);//回転した後戻してあげる + //----- + + //移動---- + float offsetX = rc画像内の描画領域.Width * vcScaleRatio.X / GameWindowSize.Width; + float offsetY = rc画像内の描画領域.Height * vcScaleRatio.Y / GameWindowSize.Height; + mvp *= Matrix4X4.CreateTranslation(offsetX, -offsetY, 0.0f); + mvp *= Matrix4X4.CreateTranslation(-1.0f, 1.0f, 0); + mvp *= Matrix4X4.CreateTranslation(x / GameWindowSize.Width * 2, -y / GameWindowSize.Height * 2, 0.0f); + //----- + + Game.Gl.UniformMatrix4(MVPID, 1, false, (float*)&mvp); //MVPに値を設定 + Matrix4X4 camera = Game.Camera; + Game.Gl.UniformMatrix4(CameraID, 1, false, (float*)&camera); + } + //------ + + Game.Gl.Uniform4(ColorID, new System.Numerics.Vector4(color4.Red, color4.Green, color4.Blue, color4.Alpha)); //変色用のカラーを設定 + Game.Gl.Uniform2(ScaleID, new System.Numerics.Vector2(vcScaleRatio.X, vcScaleRatio.Y)); //変色用のカラーを設定 + + //テクスチャの切り抜きの座標と大きさを設定 + Game.Gl.Uniform4(TextureRectID, new System.Numerics.Vector4( + rc画像内の描画領域.X / rc全画像.Width, rc画像内の描画領域.Y / rc全画像.Height, //始まり + rc画像内の描画領域.Width / rc全画像.Width, rc画像内の描画領域.Height / rc全画像.Height)); //大きさ、終わりではない + + Game.Gl.Uniform1(NoteModeID, rollMode ? 1 : 0); + + float _time = (DateTime.Now.Ticks / TimeSpan.TicksPerMillisecond) % 100; + Game.Gl.Uniform1(TimeID, _time); + Game.Gl.Uniform1(NoiseEffectID, bUseNoiseEffect ? 1 : 0); + + + //描画----- + Game.Gl.BindVertexArray(VAO); + unsafe { + Game.Gl.DrawElements(PrimitiveType.Triangles, IndicesCount, DrawElementsType.UnsignedInt, (void*)0);//描画! + } + + BlendHelper.SetBlend(BlendType.Normal); + } + public void t2D描画(int x, int y, float depth, Rectangle rc画像内の描画領域) { + t2D描画((float)x, (float)y, depth, rc画像内の描画領域); + } + public void t2D上下反転描画(int x, int y) { + this.t2D上下反転描画(x, y, 1f, this.rc全画像); + } + public void t2D上下反転描画(int x, int y, Rectangle rc画像内の描画領域) { + this.t2D上下反転描画(x, y, 1f, rc画像内の描画領域); + } + public void t2D左右反転描画(int x, int y) { + this.t2D左右反転描画(x, y, 1f, this.rc全画像); + } + public void t2D左右反転描画(float x, float y) { + this.t2D左右反転描画(x, y, 1f, this.rc全画像); + } + public void t2D左右反転描画(int x, int y, Rectangle rc画像内の描画領域) { + this.t2D左右反転描画(x, y, 1f, rc画像内の描画領域); + } + public void t2D左右反転描画(float x, float y, float depth, Rectangle rc画像内の描画領域) { + t2D描画(x, y, depth, rc画像内の描画領域, flipX: true); + } + public void t2D上下反転描画(int x, int y, float depth, Rectangle rc画像内の描画領域) { + t2D描画(x, y, depth, rc画像内の描画領域, flipY: true); + } + public void t2D上下反転描画(Point pt) { + this.t2D上下反転描画(pt.X, pt.Y, 1f, this.rc全画像); + } + public void t2D上下反転描画(Point pt, Rectangle rc画像内の描画領域) { + this.t2D上下反転描画(pt.X, pt.Y, 1f, rc画像内の描画領域); + } + public void t2D上下反転描画(Point pt, float depth, Rectangle rc画像内の描画領域) { + this.t2D上下反転描画(pt.X, pt.Y, depth, rc画像内の描画領域); + } + + public static Vector3D t論理画面座標をワールド座標へ変換する(int x, int y) { + return CTexture.t論理画面座標をワールド座標へ変換する(new Vector3D((float)x, (float)y, 0f)); + } + public static Vector3D t論理画面座標をワールド座標へ変換する(float x, float y) { + return CTexture.t論理画面座標をワールド座標へ変換する(new Vector3D(x, y, 0f)); + } + public static Vector3D t論理画面座標をワールド座標へ変換する(Point pt論理画面座標) { + return CTexture.t論理画面座標をワールド座標へ変換する(new Vector3D(pt論理画面座標.X, pt論理画面座標.Y, 0.0f)); + } + public static Vector3D t論理画面座標をワールド座標へ変換する(Vector2D v2論理画面座標) { + return CTexture.t論理画面座標をワールド座標へ変換する(new Vector3D(v2論理画面座標, 0f)); + } + public static Vector3D t論理画面座標をワールド座標へ変換する(Vector3D v3論理画面座標) { + return new Vector3D( + (v3論理画面座標.X - (CTexture.sz論理画面.Width / 2.0f)) * CTexture.f画面比率, + (-(v3論理画面座標.Y - (CTexture.sz論理画面.Height / 2.0f)) * CTexture.f画面比率), + v3論理画面座標.Z); + } + + + + + public void t2D描画SongObj(float x, float y, float xScale, float yScale) { + this.color4.Alpha = this._opacity / 255f; + + var rc画像内の描画領域 = rc全画像; + this.color4.Alpha = this._opacity / 255f; + + BlendType blendType; + if (b加算合成) { + blendType = BlendType.Add; + } else if (b乗算合成) { + blendType = BlendType.Multi; + } else if (b減算合成) { + blendType = BlendType.Sub; + } else if (bスクリーン合成) { + blendType = BlendType.Screen; + } else { + blendType = BlendType.Normal; + } + + BlendHelper.SetBlend(blendType); + + Game.Gl.UseProgram(ShaderProgram);//Uniform4よりこれが先 + + Game.Gl.BindTexture(TextureTarget.Texture2D, Pointer); //テクスチャをバインド + + //MVPを設定---- + unsafe { + Matrix4X4 mvp = Matrix4X4.Identity; + + float gameAspect = (float)GameWindowSize.Width / GameWindowSize.Height; + + + //スケーリング----- + mvp *= Matrix4X4.CreateScale((float)rc画像内の描画領域.Width / GameWindowSize.Width, (float)rc画像内の描画領域.Height / GameWindowSize.Height, 1) * + Matrix4X4.CreateScale(xScale, yScale, 1.0f); + //----- + + //回転----- + mvp *= Matrix4X4.CreateScale(1.0f * gameAspect, 1.0f, 1.0f) * //ここでアスペクト比でスケーリングしないとおかしなことになる + Matrix4X4.CreateRotationZ(fZ軸中心回転) * + Matrix4X4.CreateScale(1.0f / gameAspect, 1.0f, 1.0f);//回転した後戻してあげる + //----- + + //移動---- + float offsetX = rc画像内の描画領域.Width * xScale / GameWindowSize.Width; + float offsetY = rc画像内の描画領域.Height * yScale / GameWindowSize.Height; + mvp *= Matrix4X4.CreateTranslation(offsetX, -offsetY, 0.0f); + mvp *= Matrix4X4.CreateTranslation(-1.0f, 1.0f, 0); + mvp *= Matrix4X4.CreateTranslation(x / GameWindowSize.Width * 2, -y / GameWindowSize.Height * 2, 0.0f); + //----- + + Game.Gl.UniformMatrix4(MVPID, 1, false, (float*)&mvp); //MVPに値を設定 + Matrix4X4 camera = Game.Camera; + Game.Gl.UniformMatrix4(CameraID, 1, false, (float*)&camera); + } + //------ + + Game.Gl.Uniform4(ColorID, new System.Numerics.Vector4(color4.Red, color4.Green, color4.Blue, color4.Alpha)); //変色用のカラーを設定 + Game.Gl.Uniform2(ScaleID, new System.Numerics.Vector2(vcScaleRatio.X, vcScaleRatio.Y)); //変色用のカラーを設定 + + //テクスチャの切り抜きの座標と大きさを設定 + Game.Gl.Uniform4(TextureRectID, new System.Numerics.Vector4( + rc画像内の描画領域.X / rc全画像.Width, rc画像内の描画領域.Y / rc全画像.Height, //始まり + rc画像内の描画領域.Width / rc全画像.Width, rc画像内の描画領域.Height / rc全画像.Height)); //大きさ、終わりではない + + Game.Gl.Uniform1(NoteModeID, 0); + + float _time = (DateTime.Now.Ticks / TimeSpan.TicksPerMillisecond) % 100; + Game.Gl.Uniform1(TimeID, _time); + Game.Gl.Uniform1(NoiseEffectID, bUseNoiseEffect ? 1 : 0); + + //描画----- + Game.Gl.BindVertexArray(VAO); + unsafe { + Game.Gl.DrawElements(PrimitiveType.Triangles, IndicesCount, DrawElementsType.UnsignedInt, (void*)0);//描画! + } + + BlendHelper.SetBlend(BlendType.Normal); + } + + + #region [ IDisposable 実装 ] + //----------------- + public void Dispose() { + if (!this.bDispose完了済み) { + Game.Gl.DeleteTexture(Pointer); //解放 + + this.bDispose完了済み = true; + } + } + //----------------- + #endregion + + + // その他 + + #region [ private ] + //----------------- + private int _opacity; + private bool bDispose完了済み; + + private Size t指定されたサイズを超えない最適なテクスチャサイズを返す(Size sz指定サイズ) { + return sz指定サイズ; + } + + private int ToArgb(Color4 col4) { + uint a = (uint)(col4.Alpha * 255.0f) & 255; + uint r = (uint)(col4.Red * 255.0f) & 255; + uint g = (uint)(col4.Green * 255.0f) & 255; + uint b = (uint)(col4.Blue * 255.0f) & 255; + + uint value = b; + value |= g << 8; + value |= r << 16; + value |= a << 24; + + return (int)value; + } + + + // 2012.3.21 さらなる new の省略作戦 + + protected Rectangle rc全画像; // テクスチャ作ったらあとは不変 + public Color4 color4 = new Color4(1f, 1f, 1f, 1f); // アルファ以外は不変 + + public void tUpdateColor4(Color4 c4) { + this.color4 = c4; + } + + public void tUpdateOpacity(int o) { + this.Opacity = o; + } + //----------------- + #endregion } diff --git a/FDK/src/04.Graphics/CTextureAutofold.cs b/FDK/src/04.Graphics/CTextureAutofold.cs index 2e3ca900..8a81b6b4 100644 --- a/FDK/src/04.Graphics/CTextureAutofold.cs +++ b/FDK/src/04.Graphics/CTextureAutofold.cs @@ -1,179 +1,179 @@ using Rectangle = System.Drawing.Rectangle; -namespace FDK { +namespace FDK; + +/// +/// 縦長_横長の画像を自動で折りたたんでテクスチャ化するCTexture。 +/// 例えば、768x30 のテクスチャファイルが入力されたら、 +/// 内部で256x90 など、2のべき乗サイズに収めるよう、内部でテクスチャ画像を自動的に折り返す。 +/// 必要に応じて、正方形テクスチャにもする。 +/// また、t2D描画は、その折り返しを加味して実行する。 +/// +public class CTextureAf : CTexture, IDisposable { + /// - /// 縦長_横長の画像を自動で折りたたんでテクスチャ化するCTexture。 - /// 例えば、768x30 のテクスチャファイルが入力されたら、 - /// 内部で256x90 など、2のべき乗サイズに収めるよう、内部でテクスチャ画像を自動的に折り返す。 - /// 必要に応じて、正方形テクスチャにもする。 - /// また、t2D描画は、その折り返しを加味して実行する。 + /// 画像ファイルからテクスチャを生成する。 + /// 利用可能な画像形式は、BMP, JPG, PNG, TGA, DDS, PPM, DIB, HDR, PFM のいずれか。 + /// テクスチャのサイズは、画像のサイズ以上、かつ、D3D9デバイスで生成可能な最小のサイズに自動的に調節される。 + /// その際、テクスチャの調節後のサイズにあわせた画像の拡大縮小は行わない。 + /// その他、ミップマップ数は 1、Usage は None、イメージフィルタは Point、ミップマップフィルタは None になる。 /// - public class CTextureAf : CTexture, IDisposable { + /// Direct3D9 デバイス。 + /// 画像ファイル名。 + /// テクスチャのフォーマット。 + /// 画像の黒(0xFFFFFFFF)を透過させるなら true。 + /// テクスチャの管理方法。 + /// テクスチャの作成に失敗しました。 + public CTextureAf(string strファイル名, bool b黒を透過する) { + MakeTexture(strファイル名, b黒を透過する); + } - /// - /// 画像ファイルからテクスチャを生成する。 - /// 利用可能な画像形式は、BMP, JPG, PNG, TGA, DDS, PPM, DIB, HDR, PFM のいずれか。 - /// テクスチャのサイズは、画像のサイズ以上、かつ、D3D9デバイスで生成可能な最小のサイズに自動的に調節される。 - /// その際、テクスチャの調節後のサイズにあわせた画像の拡大縮小は行わない。 - /// その他、ミップマップ数は 1、Usage は None、イメージフィルタは Point、ミップマップフィルタは None になる。 - /// - /// Direct3D9 デバイス。 - /// 画像ファイル名。 - /// テクスチャのフォーマット。 - /// 画像の黒(0xFFFFFFFF)を透過させるなら true。 - /// テクスチャの管理方法。 - /// テクスチャの作成に失敗しました。 - public CTextureAf(string strファイル名, bool b黒を透過する) { - MakeTexture(strファイル名, b黒を透過する); + + + + public new void MakeTexture(string strファイル名, bool b黒を透過する) { + if (!File.Exists(strファイル名)) // #27122 2012.1.13 from: ImageInformation では FileNotFound 例外は返ってこないので、ここで自分でチェックする。わかりやすいログのために。 + throw new FileNotFoundException(string.Format("ファイルが存在しません。\n[{0}]", strファイル名)); + + base.MakeTexture(strファイル名, b黒を透過する); + } + + /// + /// 横長画像を適切なサイズに折りたたんだときの最適テクスチャサイズを得る。 + /// 縦長画像に対しては、width/heightを入れ替えて呼び出すこと。 + /// + /// + /// + /// + /// + private bool GetFoldedTextureSize(ref int width, ref int height, out int foldtimes) { + int orgWidth = width, orgHeight = height; + + #region [ widthが、2のべき乗からどれくらい溢れているか確認 ] + int pow = 1; + while (orgWidth >= pow) { + pow *= 2; } - - - - - public new void MakeTexture(string strファイル名, bool b黒を透過する) { - if (!File.Exists(strファイル名)) // #27122 2012.1.13 from: ImageInformation では FileNotFound 例外は返ってこないので、ここで自分でチェックする。わかりやすいログのために。 - throw new FileNotFoundException(string.Format("ファイルが存在しません。\n[{0}]", strファイル名)); - - base.MakeTexture(strファイル名, b黒を透過する); + pow /= 2; + #endregion + #region [ まず、2のべき乗からあふれる分を折り返して、2のべき乗の正方形サイズに収まるかを確認 ] + foldtimes = (orgWidth == pow) ? 0 : 1; // 2のべき乗からの溢れがあれば、まずその溢れ分で1回折り畳む + if (foldtimes != 0) { + //Debug.WriteLine( "powちょうどではないので、溢れあり。まずは1回折りたたむ。" ); + // 試しに、widthをpowに切り詰め、1回折り返してみる。 + // width>heightを維持しているなら、テクスチャサイズはより最適な状態になったということになる。 + if (pow <= orgHeight * 2) // 新width > 新heightを維持できなくなったなら + { // 最適化不可とみなし、baseの処理に委ねる + return false; + } } - - /// - /// 横長画像を適切なサイズに折りたたんだときの最適テクスチャサイズを得る。 - /// 縦長画像に対しては、width/heightを入れ替えて呼び出すこと。 - /// - /// - /// - /// - /// - private bool GetFoldedTextureSize(ref int width, ref int height, out int foldtimes) { - int orgWidth = width, orgHeight = height; - - #region [ widthが、2のべき乗からどれくらい溢れているか確認 ] - int pow = 1; - while (orgWidth >= pow) { - pow *= 2; - } - pow /= 2; - #endregion - #region [ まず、2のべき乗からあふれる分を折り返して、2のべき乗の正方形サイズに収まるかを確認 ] - foldtimes = (orgWidth == pow) ? 0 : 1; // 2のべき乗からの溢れがあれば、まずその溢れ分で1回折り畳む - if (foldtimes != 0) { - //Debug.WriteLine( "powちょうどではないので、溢れあり。まずは1回折りたたむ。" ); - // 試しに、widthをpowに切り詰め、1回折り返してみる。 - // width>heightを維持しているなら、テクスチャサイズはより最適な状態になったということになる。 - if (pow <= orgHeight * 2) // 新width > 新heightを維持できなくなったなら - { // 最適化不可とみなし、baseの処理に委ねる - return false; - } - } - #endregion - #region [ width > height ではなくなるまで、折りたたみ続ける ] - width = pow; - height = orgHeight * 2; // 初期値=1回折りたたんだ状態 - do { - width /= 2; - foldtimes = (orgWidth / width) + ((orgWidth % width > 0) ? 1 : 0) - 1; - height = orgHeight * (foldtimes + 1); - } while (width > height); - width *= 2; + #endregion + #region [ width > height ではなくなるまで、折りたたみ続ける ] + width = pow; + height = orgHeight * 2; // 初期値=1回折りたたんだ状態 + do { + width /= 2; foldtimes = (orgWidth / width) + ((orgWidth % width > 0) ? 1 : 0) - 1; height = orgHeight * (foldtimes + 1); - #endregion + } while (width > height); + width *= 2; + foldtimes = (orgWidth / width) + ((orgWidth % width > 0) ? 1 : 0) - 1; + height = orgHeight * (foldtimes + 1); + #endregion - return true; - } + return true; + } - /// - /// テクスチャを 2D 画像と見なして描画する。 - /// - /// Direct3D9 デバイス。 - /// 描画位置(テクスチャの左上位置の X 座標[dot])。 - /// 描画位置(テクスチャの左上位置の Y 座標[dot])。 - public new void t2D描画(int x, int y) { + /// + /// テクスチャを 2D 画像と見なして描画する。 + /// + /// Direct3D9 デバイス。 + /// 描画位置(テクスチャの左上位置の X 座標[dot])。 + /// 描画位置(テクスチャの左上位置の Y 座標[dot])。 + public new void t2D描画(int x, int y) { #if TEST_FOLDTEXTURE base.t2D描画( x, y, 1f, rc全画像 ); #else - for (int n = 0; n <= _foldtimes; n++) { - Rectangle r; - if (b横長のテクスチャである) { - int currentHeight = n * _orgHeight; - r = new Rectangle(0, currentHeight, this.rc全画像.Width, _orgHeight); - base.t2D描画(x + n * this.rc全画像.Width, y, 1f, r); - } else { - int currentWidth = n * _orgWidth; - r = new Rectangle(currentWidth, 0, _orgWidth, this.rc全画像.Height); - base.t2D描画(x, y + n * this.rc全画像.Height, 1f, r); - } - } -#endif - } - public new void t2D描画(int x, int y, Rectangle rc) { + for (int n = 0; n <= _foldtimes; n++) { Rectangle r; if (b横長のテクスチャである) { - int beginFold = rc.X / this.rc全画像.Width; - int endFold = (rc.X + rc.Width) / rc全画像.Width; - for (int i = beginFold; i <= endFold; i++) { - if (i > _foldtimes) break; - - int newRcY = i * _orgHeight + rc.Y; - int newRcX = (i == beginFold) ? (rc.X % this.rc全画像.Width) : 0; - int newRcWidth = (newRcX + rc.Width > rc全画像.Width) ? rc全画像.Width - newRcX : rc.Width; - - r = new Rectangle(newRcX, newRcY, newRcWidth, rc.Height); - base.t2D描画(x, y, 1f, r); - - int deltaX = (i == beginFold) ? (i + 1) * rc全画像.Width - rc.X : rc全画像.Width; - int newWidth = rc.Width - deltaX; - x += deltaX; - rc.Width = newWidth; - } + int currentHeight = n * _orgHeight; + r = new Rectangle(0, currentHeight, this.rc全画像.Width, _orgHeight); + base.t2D描画(x + n * this.rc全画像.Width, y, 1f, r); } else { - int beginFold = rc.Y / this.rc全画像.Height; - int endFold = (rc.Y + rc.Height) / rc全画像.Height; - for (int i = beginFold; i <= endFold; i++) { - if (i > _foldtimes) break; - - int newRcX = i * _orgWidth + rc.X; - int newRcY = (i == beginFold) ? (rc.Y % this.rc全画像.Height) : 0; - int newRcHeight = (newRcY + rc.Height > rc全画像.Height) ? rc全画像.Height - newRcY : rc.Height; - - r = new Rectangle(newRcX, newRcY, rc.Width, newRcHeight); - base.t2D描画(x, y, 1f, r); - - int deltaY = (i == beginFold) ? (i + 1) * rc全画像.Height - rc.Y : rc全画像.Height; - int newHeight = rc.Height - deltaY; - y += deltaY; - rc.Height = newHeight; - } + int currentWidth = n * _orgWidth; + r = new Rectangle(currentWidth, 0, _orgWidth, this.rc全画像.Height); + base.t2D描画(x, y + n * this.rc全画像.Height, 1f, r); } - } - public new void t2D描画(float x, float y) { - t2D描画((int)x, (int)y); - } - public void t2D描画(float x, float y, Rectangle rc) { - t2D描画((int)x, (int)y, rc); - } - - #region [ private ] - //----------------- - private bool b横長のテクスチャである; - - /// - /// 元画像のWidth - /// - private int _orgWidth; - /// - /// 元画像のHeight - /// - private int _orgHeight; - /// - /// 折りたたみ回数 - /// - private int _foldtimes; - //----------------- - #endregion +#endif } + public new void t2D描画(int x, int y, Rectangle rc) { + Rectangle r; + if (b横長のテクスチャである) { + int beginFold = rc.X / this.rc全画像.Width; + int endFold = (rc.X + rc.Width) / rc全画像.Width; + for (int i = beginFold; i <= endFold; i++) { + if (i > _foldtimes) break; + + int newRcY = i * _orgHeight + rc.Y; + int newRcX = (i == beginFold) ? (rc.X % this.rc全画像.Width) : 0; + int newRcWidth = (newRcX + rc.Width > rc全画像.Width) ? rc全画像.Width - newRcX : rc.Width; + + r = new Rectangle(newRcX, newRcY, newRcWidth, rc.Height); + base.t2D描画(x, y, 1f, r); + + int deltaX = (i == beginFold) ? (i + 1) * rc全画像.Width - rc.X : rc全画像.Width; + int newWidth = rc.Width - deltaX; + x += deltaX; + rc.Width = newWidth; + } + } else { + int beginFold = rc.Y / this.rc全画像.Height; + int endFold = (rc.Y + rc.Height) / rc全画像.Height; + for (int i = beginFold; i <= endFold; i++) { + if (i > _foldtimes) break; + + int newRcX = i * _orgWidth + rc.X; + int newRcY = (i == beginFold) ? (rc.Y % this.rc全画像.Height) : 0; + int newRcHeight = (newRcY + rc.Height > rc全画像.Height) ? rc全画像.Height - newRcY : rc.Height; + + r = new Rectangle(newRcX, newRcY, rc.Width, newRcHeight); + base.t2D描画(x, y, 1f, r); + + int deltaY = (i == beginFold) ? (i + 1) * rc全画像.Height - rc.Y : rc全画像.Height; + int newHeight = rc.Height - deltaY; + y += deltaY; + rc.Height = newHeight; + } + } + + } + public new void t2D描画(float x, float y) { + t2D描画((int)x, (int)y); + } + public void t2D描画(float x, float y, Rectangle rc) { + t2D描画((int)x, (int)y, rc); + } + + #region [ private ] + //----------------- + private bool b横長のテクスチャである; + + /// + /// 元画像のWidth + /// + private int _orgWidth; + /// + /// 元画像のHeight + /// + private int _orgHeight; + /// + /// 折りたたみ回数 + /// + private int _foldtimes; + //----------------- + #endregion } diff --git a/FDK/src/04.Graphics/CTextureCreateFailedException.cs b/FDK/src/04.Graphics/CTextureCreateFailedException.cs index b5057150..2082de82 100644 --- a/FDK/src/04.Graphics/CTextureCreateFailedException.cs +++ b/FDK/src/04.Graphics/CTextureCreateFailedException.cs @@ -1,20 +1,20 @@ using System.Runtime.Serialization; -namespace FDK { - /// - /// テクスチャの作成に失敗しました。 - /// - public class CTextureCreateFailedException : Exception { - public CTextureCreateFailedException() { - } - public CTextureCreateFailedException(string message) - : base(message) { - } - public CTextureCreateFailedException(SerializationInfo info, StreamingContext context) - : base(info, context) { - } - public CTextureCreateFailedException(string message, Exception innerException) - : base(message, innerException) { - } +namespace FDK; + +/// +/// テクスチャの作成に失敗しました。 +/// +public class CTextureCreateFailedException : Exception { + public CTextureCreateFailedException() { + } + public CTextureCreateFailedException(string message) + : base(message) { + } + public CTextureCreateFailedException(SerializationInfo info, StreamingContext context) + : base(info, context) { + } + public CTextureCreateFailedException(string message, Exception innerException) + : base(message, innerException) { } } diff --git a/FDK/src/04.Graphics/CVideoDecoder.cs b/FDK/src/04.Graphics/CVideoDecoder.cs index 91bd3987..433bf12e 100644 --- a/FDK/src/04.Graphics/CVideoDecoder.cs +++ b/FDK/src/04.Graphics/CVideoDecoder.cs @@ -3,283 +3,283 @@ using System.Diagnostics; using FFmpeg.AutoGen; using Size = System.Drawing.Size; -namespace FDK { - /// - /// ビデオのデコードをするクラス - /// ファイル名・nullのCTextureをもらえれば、勝手に、CTextureに映像を格納して返す。 - /// 演奏とは別のタイマーを使用しているので、ずれる可能性がある。 - /// - public unsafe class CVideoDecoder : IDisposable { - public CVideoDecoder(string filename) { - if (!File.Exists(filename)) - throw new FileNotFoundException(filename + " not found..."); +namespace FDK; - format_context = ffmpeg.avformat_alloc_context(); - fixed (AVFormatContext** format_contexttmp = &format_context) { - if (ffmpeg.avformat_open_input(format_contexttmp, filename, null, null) != 0) - throw new FileLoadException("avformat_open_input failed\n"); +/// +/// ビデオのデコードをするクラス +/// ファイル名・nullのCTextureをもらえれば、勝手に、CTextureに映像を格納して返す。 +/// 演奏とは別のタイマーを使用しているので、ずれる可能性がある。 +/// +public unsafe class CVideoDecoder : IDisposable { + public CVideoDecoder(string filename) { + if (!File.Exists(filename)) + throw new FileNotFoundException(filename + " not found..."); - if (ffmpeg.avformat_find_stream_info(*format_contexttmp, null) < 0) - throw new FileLoadException("avformat_find_stream_info failed\n"); + format_context = ffmpeg.avformat_alloc_context(); + fixed (AVFormatContext** format_contexttmp = &format_context) { + if (ffmpeg.avformat_open_input(format_contexttmp, filename, null, null) != 0) + throw new FileLoadException("avformat_open_input failed\n"); - // find audio stream - for (int i = 0; i < (int)format_context->nb_streams; i++) { - if (format_context->streams[i]->codecpar->codec_type == AVMediaType.AVMEDIA_TYPE_VIDEO) { - video_stream = format_context->streams[i]; - break; - } + if (ffmpeg.avformat_find_stream_info(*format_contexttmp, null) < 0) + throw new FileLoadException("avformat_find_stream_info failed\n"); + + // find audio stream + for (int i = 0; i < (int)format_context->nb_streams; i++) { + if (format_context->streams[i]->codecpar->codec_type == AVMediaType.AVMEDIA_TYPE_VIDEO) { + video_stream = format_context->streams[i]; + break; } - if (video_stream == null) - throw new FileLoadException("No video stream ...\n"); - - // find decoder - AVCodec* codec = ffmpeg.avcodec_find_decoder(video_stream->codecpar->codec_id); - if (codec == null) - throw new NotSupportedException("No supported decoder ...\n"); - - codec_context = ffmpeg.avcodec_alloc_context3(codec); - - if (ffmpeg.avcodec_parameters_to_context(codec_context, video_stream->codecpar) < 0) - Trace.WriteLine("avcodec_parameters_to_context failed\n"); - - if (ffmpeg.avcodec_open2(codec_context, codec, null) != 0) - Trace.WriteLine("avcodec_open2 failed\n"); - - this.FrameSize = new Size(codec_context->width, codec_context->height); - this.Duration = (video_stream->avg_frame_rate.num / (double)video_stream->avg_frame_rate.den) * video_stream->nb_frames; - this.Framerate = video_stream->avg_frame_rate; - - frameconv = new CFrameConverter(FrameSize, codec_context->pix_fmt); - - decodedframes = new ConcurrentQueue(); - - for (int i = 0; i < framelist.Length; i++) - framelist[i] = new CDecodedFrame(new Size(codec_context->width, codec_context->height)); - - CTimer = new CTimer(CTimer.TimerType.MultiMedia); } + if (video_stream == null) + throw new FileLoadException("No video stream ...\n"); + + // find decoder + AVCodec* codec = ffmpeg.avcodec_find_decoder(video_stream->codecpar->codec_id); + if (codec == null) + throw new NotSupportedException("No supported decoder ...\n"); + + codec_context = ffmpeg.avcodec_alloc_context3(codec); + + if (ffmpeg.avcodec_parameters_to_context(codec_context, video_stream->codecpar) < 0) + Trace.WriteLine("avcodec_parameters_to_context failed\n"); + + if (ffmpeg.avcodec_open2(codec_context, codec, null) != 0) + Trace.WriteLine("avcodec_open2 failed\n"); + + this.FrameSize = new Size(codec_context->width, codec_context->height); + this.Duration = (video_stream->avg_frame_rate.num / (double)video_stream->avg_frame_rate.den) * video_stream->nb_frames; + this.Framerate = video_stream->avg_frame_rate; + + frameconv = new CFrameConverter(FrameSize, codec_context->pix_fmt); + + decodedframes = new ConcurrentQueue(); + + for (int i = 0; i < framelist.Length; i++) + framelist[i] = new CDecodedFrame(new Size(codec_context->width, codec_context->height)); + + CTimer = new CTimer(CTimer.TimerType.MultiMedia); } + } - public void Dispose() { - bDrawing = false; - close = true; - cts?.Cancel(); - while (DS != DecodingState.Stopped) ; - frameconv.Dispose(); + public void Dispose() { + bDrawing = false; + close = true; + cts?.Cancel(); + while (DS != DecodingState.Stopped) ; + frameconv.Dispose(); - ffmpeg.avcodec_flush_buffers(codec_context); - if (ffmpeg.avcodec_close(codec_context) < 0) - Trace.TraceError("codec context close error."); - video_stream = null; - fixed (AVFormatContext** format_contexttmp = &format_context) { - ffmpeg.avformat_close_input(format_contexttmp); - } - if (lastTexture != null) - lastTexture.Dispose(); - while (decodedframes.TryDequeue(out CDecodedFrame frame)) - frame.Dispose(); + ffmpeg.avcodec_flush_buffers(codec_context); + if (ffmpeg.avcodec_close(codec_context) < 0) + Trace.TraceError("codec context close error."); + video_stream = null; + fixed (AVFormatContext** format_contexttmp = &format_context) { + ffmpeg.avformat_close_input(format_contexttmp); } + if (lastTexture != null) + lastTexture.Dispose(); + while (decodedframes.TryDequeue(out CDecodedFrame frame)) + frame.Dispose(); + } - public void Start() { - CTimer.Reset(); - CTimer.Resume(); - this.bPlaying = true; - bDrawing = true; + public void Start() { + CTimer.Reset(); + CTimer.Resume(); + this.bPlaying = true; + bDrawing = true; - } + } - public void PauseControl() { - if (this.bPlaying) { - CTimer.Pause(); - this.bPlaying = false; - } else { - CTimer.Resume(); - this.bPlaying = true; - } - } - - public void Stop() { + public void PauseControl() { + if (this.bPlaying) { CTimer.Pause(); this.bPlaying = false; - bDrawing = false; + } else { + CTimer.Resume(); + this.bPlaying = true; } + } - public void InitRead() { - if (!bqueueinitialized) { - this.Seek(0); - bqueueinitialized = true; - } else - Trace.TraceError("The class has already been initialized.\n"); - } + public void Stop() { + CTimer.Pause(); + this.bPlaying = false; + bDrawing = false; + } - public void Seek(long timestampms) { - cts?.Cancel(); - while (DS != DecodingState.Stopped) ; - if (ffmpeg.av_seek_frame(format_context, video_stream->index, timestampms, ffmpeg.AVSEEK_FLAG_BACKWARD) < 0) - Trace.TraceError("av_seek_frame failed\n"); - ffmpeg.avcodec_flush_buffers(codec_context); - CTimer.NowTimeMs = timestampms; - cts?.Dispose(); - while (decodedframes.TryDequeue(out CDecodedFrame frame)) - frame.RemoveFrame(); - this.EnqueueFrames(); - if (lastTexture != null) - lastTexture.Dispose(); - lastTexture = new CTexture(FrameSize.Width, FrameSize.Height); - } + public void InitRead() { + if (!bqueueinitialized) { + this.Seek(0); + bqueueinitialized = true; + } else + Trace.TraceError("The class has already been initialized.\n"); + } - public void GetNowFrame(ref CTexture Texture) { - if (this.bPlaying && decodedframes.Count != 0) { - CTimer.Update(); - if (decodedframes.TryPeek(out CDecodedFrame frame)) { - while (frame.Time <= (CTimer.NowTimeMs * _dbPlaySpeed)) { - if (decodedframes.TryDequeue(out CDecodedFrame cdecodedframe)) { + public void Seek(long timestampms) { + cts?.Cancel(); + while (DS != DecodingState.Stopped) ; + if (ffmpeg.av_seek_frame(format_context, video_stream->index, timestampms, ffmpeg.AVSEEK_FLAG_BACKWARD) < 0) + Trace.TraceError("av_seek_frame failed\n"); + ffmpeg.avcodec_flush_buffers(codec_context); + CTimer.NowTimeMs = timestampms; + cts?.Dispose(); + while (decodedframes.TryDequeue(out CDecodedFrame frame)) + frame.RemoveFrame(); + this.EnqueueFrames(); + if (lastTexture != null) + lastTexture.Dispose(); + lastTexture = new CTexture(FrameSize.Width, FrameSize.Height); + } - if (decodedframes.Count != 0) - if (decodedframes.TryPeek(out frame)) - if (frame.Time <= (CTimer.NowTimeMs * _dbPlaySpeed)) { - cdecodedframe.RemoveFrame(); - continue; - } + public void GetNowFrame(ref CTexture Texture) { + if (this.bPlaying && decodedframes.Count != 0) { + CTimer.Update(); + if (decodedframes.TryPeek(out CDecodedFrame frame)) { + while (frame.Time <= (CTimer.NowTimeMs * _dbPlaySpeed)) { + if (decodedframes.TryDequeue(out CDecodedFrame cdecodedframe)) { - lastTexture.UpdateTexture(cdecodedframe.TexPointer, cdecodedframe.TexSize.Width, cdecodedframe.TexSize.Height, Silk.NET.OpenGLES.PixelFormat.Rgba); + if (decodedframes.Count != 0) + if (decodedframes.TryPeek(out frame)) + if (frame.Time <= (CTimer.NowTimeMs * _dbPlaySpeed)) { + cdecodedframe.RemoveFrame(); + continue; + } - cdecodedframe.RemoveFrame(); - } - break; + lastTexture.UpdateTexture(cdecodedframe.TexPointer, cdecodedframe.TexSize.Width, cdecodedframe.TexSize.Height, Silk.NET.OpenGLES.PixelFormat.Rgba); + + cdecodedframe.RemoveFrame(); } + break; } - - if (DS == DecodingState.Stopped) - this.EnqueueFrames(); } - if (lastTexture == null) - lastTexture = new CTexture(FrameSize.Width, FrameSize.Height); - - if (Texture == lastTexture) - return; - - Texture = lastTexture; - + if (DS == DecodingState.Stopped) + this.EnqueueFrames(); } - private void EnqueueFrames() { - if (DS != DecodingState.Running && !close) { - cts = new CancellationTokenSource(); - Task.Factory.StartNew(() => EnqueueOneFrame()); - } + if (lastTexture == null) + lastTexture = new CTexture(FrameSize.Width, FrameSize.Height); + + if (Texture == lastTexture) + return; + + Texture = lastTexture; + + } + + private void EnqueueFrames() { + if (DS != DecodingState.Running && !close) { + cts = new CancellationTokenSource(); + Task.Factory.StartNew(() => EnqueueOneFrame()); } + } - private void EnqueueOneFrame() { - DS = DecodingState.Running; - AVFrame* frame = ffmpeg.av_frame_alloc(); - AVPacket* packet = ffmpeg.av_packet_alloc(); - try { - while (true) { - if (cts.IsCancellationRequested || close) - return; + private void EnqueueOneFrame() { + DS = DecodingState.Running; + AVFrame* frame = ffmpeg.av_frame_alloc(); + AVPacket* packet = ffmpeg.av_packet_alloc(); + try { + while (true) { + if (cts.IsCancellationRequested || close) + return; - //2020/10/27 Mr-Ojii 閾値フレームごとにパケット生成するのは無駄だと感じたので、ループに入ったら、パケット生成し、シークによるキャンセルまたは、EOFまで無限ループ - if (decodedframes.Count < framelist.Length - 1)//-1をして、余裕を持たせておく。 - { - int error = ffmpeg.av_read_frame(format_context, packet); + //2020/10/27 Mr-Ojii 閾値フレームごとにパケット生成するのは無駄だと感じたので、ループに入ったら、パケット生成し、シークによるキャンセルまたは、EOFまで無限ループ + if (decodedframes.Count < framelist.Length - 1)//-1をして、余裕を持たせておく。 + { + int error = ffmpeg.av_read_frame(format_context, packet); - if (error >= 0) { - if (packet->stream_index == video_stream->index) { - if (ffmpeg.avcodec_send_packet(codec_context, packet) >= 0) { - if (ffmpeg.avcodec_receive_frame(codec_context, frame) == 0) { - AVFrame* outframe = null; + if (error >= 0) { + if (packet->stream_index == video_stream->index) { + if (ffmpeg.avcodec_send_packet(codec_context, packet) >= 0) { + if (ffmpeg.avcodec_receive_frame(codec_context, frame) == 0) { + AVFrame* outframe = null; - outframe = frameconv.Convert(frame); + outframe = frameconv.Convert(frame); - decodedframes.Enqueue(PickUnusedDcodedFrame().UpdateFrame((outframe->best_effort_timestamp - video_stream->start_time) * ((double)video_stream->time_base.num / (double)video_stream->time_base.den) * 1000, outframe)); + decodedframes.Enqueue(PickUnusedDcodedFrame().UpdateFrame((outframe->best_effort_timestamp - video_stream->start_time) * ((double)video_stream->time_base.num / (double)video_stream->time_base.den) * 1000, outframe)); - ffmpeg.av_frame_unref(frame); - ffmpeg.av_frame_unref(outframe); - ffmpeg.av_frame_free(&outframe); - } + ffmpeg.av_frame_unref(frame); + ffmpeg.av_frame_unref(outframe); + ffmpeg.av_frame_free(&outframe); } } - - //2020/10/27 Mr-Ojii packetが解放されない周回があった問題を修正。 - ffmpeg.av_packet_unref(packet); - } else if (error == ffmpeg.AVERROR_EOF) { - return; } - } else { - //ポーズ中に無限ループに入り、CPU使用率が異常に高くなってしまうため、1ms待つ。 - //ネットを調べると、await Task.Delay()を使えというお話が出てくるが、unsafeなので、使えない - Thread.Sleep(1); + + //2020/10/27 Mr-Ojii packetが解放されない周回があった問題を修正。 + ffmpeg.av_packet_unref(packet); + } else if (error == ffmpeg.AVERROR_EOF) { + return; } - } - } catch (Exception e) { - Trace.TraceError(e.ToString()); - } finally { - ffmpeg.av_packet_free(&packet); - ffmpeg.av_frame_unref(frame); - ffmpeg.av_free(frame); - DS = DecodingState.Stopped; - } - } - - public CDecodedFrame PickUnusedDcodedFrame() { - for (int i = 0; i < framelist.Length; i++) { - if (framelist[i].Using == false) { - return framelist[i]; - } - } - return null; - } - - public Size FrameSize { - get; - private set; - } - public double Duration { - get; - private set; - } - - public double dbPlaySpeed { - get { - return this._dbPlaySpeed; - } - set { - if (value > 0) { - this._dbPlaySpeed = value; } else { - throw new ArgumentOutOfRangeException(); + //ポーズ中に無限ループに入り、CPU使用率が異常に高くなってしまうため、1ms待つ。 + //ネットを調べると、await Task.Delay()を使えというお話が出てくるが、unsafeなので、使えない + Thread.Sleep(1); } } + } catch (Exception e) { + Trace.TraceError(e.ToString()); + } finally { + ffmpeg.av_packet_free(&packet); + ffmpeg.av_frame_unref(frame); + ffmpeg.av_free(frame); + DS = DecodingState.Stopped; } - - #region[private] - //for read & decode - private bool close = false; - private double _dbPlaySpeed = 1.0; - private static AVFormatContext* format_context; - private AVStream* video_stream; - private AVCodecContext* codec_context; - private ConcurrentQueue decodedframes; - private CancellationTokenSource cts; - private CDecodedFrame[] framelist = new CDecodedFrame[6]; - private DecodingState DS = DecodingState.Stopped; - private enum DecodingState { - Stopped, - Running - } - - //for play - public bool bPlaying { get; private set; } = false; - public bool bDrawing { get; private set; } = false; - private CTimer CTimer; - private AVRational Framerate; - private CTexture lastTexture; - private bool bqueueinitialized = false; - - //for convert - private CFrameConverter frameconv; - #endregion } + + public CDecodedFrame PickUnusedDcodedFrame() { + for (int i = 0; i < framelist.Length; i++) { + if (framelist[i].Using == false) { + return framelist[i]; + } + } + return null; + } + + public Size FrameSize { + get; + private set; + } + public double Duration { + get; + private set; + } + + public double dbPlaySpeed { + get { + return this._dbPlaySpeed; + } + set { + if (value > 0) { + this._dbPlaySpeed = value; + } else { + throw new ArgumentOutOfRangeException(); + } + } + } + + #region[private] + //for read & decode + private bool close = false; + private double _dbPlaySpeed = 1.0; + private static AVFormatContext* format_context; + private AVStream* video_stream; + private AVCodecContext* codec_context; + private ConcurrentQueue decodedframes; + private CancellationTokenSource cts; + private CDecodedFrame[] framelist = new CDecodedFrame[6]; + private DecodingState DS = DecodingState.Stopped; + private enum DecodingState { + Stopped, + Running + } + + //for play + public bool bPlaying { get; private set; } = false; + public bool bDrawing { get; private set; } = false; + private CTimer CTimer; + private AVRational Framerate; + private CTexture lastTexture; + private bool bqueueinitialized = false; + + //for convert + private CFrameConverter frameconv; + #endregion } diff --git a/FDK/src/04.Graphics/TextRenderer/CCachedFontRenderer.cs b/FDK/src/04.Graphics/TextRenderer/CCachedFontRenderer.cs index ffb48b29..8e8df725 100644 --- a/FDK/src/04.Graphics/TextRenderer/CCachedFontRenderer.cs +++ b/FDK/src/04.Graphics/TextRenderer/CCachedFontRenderer.cs @@ -3,238 +3,238 @@ using SkiaSharp; using Color = System.Drawing.Color; -namespace FDK { - /// - /// 高速描画版のCFontRendererクラス。 - /// といっても、一度レンダリングした結果をキャッシュして使いまわしているだけ。 - /// - public class CCachedFontRenderer : CFontRenderer { - #region [ コンストラクタ ] - public CCachedFontRenderer(string fontpath, int pt, CFontRenderer.FontStyle style) { - Initialize(fontpath, pt, style); - } - public CCachedFontRenderer(string fontpath, int pt) { - Initialize(fontpath, pt, CFontRenderer.FontStyle.Regular); - } - #endregion - #region [ コンストラクタから呼ばれる初期化処理 ] - protected new void Initialize(string fontpath, int pt, CFontRenderer.FontStyle style) { - this.bDisposed_CCachedFontRenderer = false; - this.listFontCache = new List(); - base.Initialize(fontpath, pt, style); - } - #endregion +namespace FDK; - - #region [ DrawTextのオーバーロード群 ] - /// - /// 文字列を描画したテクスチャを返す - /// - /// 描画文字列 - /// 描画色 - /// 縁取色 - /// 描画済テクスチャ - public new SKBitmap DrawText(string drawstr, Color fontColor, Color edgeColor, Color? secondEdgeColor, int edge_Ratio, bool keepCenter = false) { - return DrawText(drawstr, DrawMode.Edge, fontColor, edgeColor, secondEdgeColor, Color.White, Color.White, edge_Ratio, keepCenter); - } - - /// - /// 文字列を描画したテクスチャを返す - /// - /// 描画文字列 - /// 描画色 - /// 縁取色 - /// 描画済テクスチャ - public SKBitmap DrawText(string drawstr, Color fontColor, Color edgeColor, Color? secondEdgeColor, DrawMode dMode, int edge_Ratio, bool keepCenter = false) { - return DrawText(drawstr, dMode, fontColor, edgeColor, secondEdgeColor, Color.White, Color.White, edge_Ratio, keepCenter); - } - - /// - /// 文字列を描画したテクスチャを返す - /// - /// 描画文字列 - /// 描画色 - /// 縁取色 - /// グラデーション 上側の色 - /// グラデーション 下側の色 - /// 描画済テクスチャ - public new SKBitmap DrawText(string drawstr, Color fontColor, Color edgeColor, Color? secondEdgeColor, Color gradationTopColor, Color gradataionBottomColor, int edge_Ratio, bool keepCenter = false) { - return DrawText(drawstr, DrawMode.Edge | DrawMode.Gradation, fontColor, edgeColor, secondEdgeColor, gradationTopColor, gradataionBottomColor, edge_Ratio, keepCenter); - } - - /// - /// 文字列を描画したテクスチャを返す - /// - /// 描画文字列 - /// 描画色 - /// 縁取色 - /// グラデーション 上側の色 - /// グラデーション 下側の色 - /// 描画済テクスチャ - public new SKBitmap DrawText_V(string drawstr, Color fontColor, Color edgeColor, Color? secondEdgeColor, int edge_Ratio, bool keepCenter = false) { - return DrawText_V(drawstr, DrawMode.Edge, fontColor, edgeColor, secondEdgeColor, Color.Black, Color.Black, edge_Ratio, keepCenter); - } - - #endregion - - protected new SKBitmap DrawText(string drawstr, DrawMode drawmode, Color fontColor, Color edgeColor, Color? secondEdgeColor, Color gradationTopColor, Color gradationBottomColor, int edge_Ratio, bool keepCenter = false) { - #region [ 以前レンダリングしたことのある文字列/フォントか? (キャッシュにヒットするか?) ] - int index = listFontCache.FindIndex( - delegate (FontCache fontcache) { - return ( - drawstr == fontcache.drawstr && - drawmode == fontcache.drawmode && - fontColor == fontcache.fontColor && - edgeColor == fontcache.edgeColor && - secondEdgeColor == fontcache.secondEdgeColor && - gradationTopColor == fontcache.gradationTopColor && - gradationBottomColor == fontcache.gradationBottomColor && - fontcache.Vertical == false && - fontcache.KeepCenter == keepCenter - ); - } - ); - #endregion - if (index < 0) { - // キャッシュにヒットせず。 - #region [ レンダリングして、キャッシュに登録 ] - FontCache fc = new FontCache(); - fc.bmp = base.DrawText(drawstr, drawmode, fontColor, edgeColor, secondEdgeColor, gradationTopColor, gradationBottomColor, edge_Ratio, keepCenter); - fc.drawstr = drawstr; - fc.drawmode = drawmode; - fc.fontColor = fontColor; - fc.edgeColor = edgeColor; - fc.secondEdgeColor = secondEdgeColor; - fc.gradationTopColor = gradationTopColor; - fc.gradationBottomColor = gradationBottomColor; - fc.Vertical = false; - fc.KeepCenter = keepCenter; - listFontCache.Add(fc); - Debug.WriteLine(drawstr + ": Cacheにヒットせず。(cachesize=" + listFontCache.Count + ")"); - #endregion - #region [ もしキャッシュがあふれたら、最も古いキャッシュを破棄する ] - if (listFontCache.Count > MAXCACHESIZE) { - Debug.WriteLine("Cache溢れ。" + listFontCache[0].drawstr + " を解放します。"); - if (listFontCache[0].bmp != null) { - listFontCache[0].bmp.Dispose(); - } - listFontCache.RemoveAt(0); - } - #endregion - - // 呼び出し元のDispose()でキャッシュもDispose()されないように、Clone()で返す。 - return listFontCache[listFontCache.Count - 1].bmp.Copy(); - } else { - Debug.WriteLine(drawstr + ": Cacheにヒット!! index=" + index); - #region [ キャッシュにヒット。レンダリングは行わず、キャッシュ内のデータを返して終了。] - // 呼び出し元のDispose()でキャッシュもDispose()されないように、Clone()で返す。 - return listFontCache[index].bmp.Copy(); - #endregion - } - } - - protected new SKBitmap DrawText_V(string drawstr, DrawMode drawmode, Color fontColor, Color edgeColor, Color? secondEdgeColor, Color gradationTopColor, Color gradationBottomColor, int edge_Ratio, bool keepCenter = false) { - #region [ 以前レンダリングしたことのある文字列/フォントか? (キャッシュにヒットするか?) ] - int index = listFontCache.FindIndex( - delegate (FontCache fontcache) { - return ( - drawstr == fontcache.drawstr && - drawmode == fontcache.drawmode && - fontColor == fontcache.fontColor && - edgeColor == fontcache.edgeColor && - secondEdgeColor == fontcache.secondEdgeColor && - gradationTopColor == fontcache.gradationTopColor && - gradationBottomColor == fontcache.gradationBottomColor && - fontcache.Vertical == true && - fontcache.KeepCenter == keepCenter - ); - } - ); - #endregion - if (index < 0) { - // キャッシュにヒットせず。 - #region [ レンダリングして、キャッシュに登録 ] - FontCache fc = new FontCache(); - fc.bmp = base.DrawText_V(drawstr, drawmode, fontColor, edgeColor, secondEdgeColor, gradationTopColor, gradationBottomColor, edge_Ratio, keepCenter); - fc.drawstr = drawstr; - fc.fontColor = fontColor; - fc.edgeColor = edgeColor; - fc.secondEdgeColor = secondEdgeColor; - fc.gradationTopColor = gradationTopColor; - fc.gradationBottomColor = gradationBottomColor; - fc.Vertical = true; - fc.KeepCenter = keepCenter; - listFontCache.Add(fc); - Debug.WriteLine(drawstr + ": Cacheにヒットせず。(cachesize=" + listFontCache.Count + ")"); - #endregion - #region [ もしキャッシュがあふれたら、最も古いキャッシュを破棄する ] - if (listFontCache.Count > MAXCACHESIZE) { - Debug.WriteLine("Cache溢れ。" + listFontCache[0].drawstr + " を解放します。"); - if (listFontCache[0].bmp != null) { - listFontCache[0].bmp.Dispose(); - } - listFontCache.RemoveAt(0); - } - #endregion - - // 呼び出し元のDispose()でキャッシュもDispose()されないように、Clone()で返す。 - return listFontCache[listFontCache.Count - 1].bmp.Copy(); - } else { - Debug.WriteLine(drawstr + ": Cacheにヒット!! index=" + index); - #region [ キャッシュにヒット。レンダリングは行わず、キャッシュ内のデータを返して終了。] - // 呼び出し元のDispose()でキャッシュもDispose()されないように、Clone()で返す。 - return listFontCache[index].bmp.Copy(); - #endregion - } - } - - #region [ IDisposable 実装 ] - //----------------- - public new void Dispose() { - if (!this.bDisposed_CCachedFontRenderer) { - if (listFontCache != null) { - //Debug.WriteLine( "Disposing CCachedFontRenderer()" ); - #region [ キャッシュしている画像を破棄する ] - foreach (FontCache bc in listFontCache) { - if (bc.bmp != null) { - bc.bmp.Dispose(); - } - } - #endregion - listFontCache.Clear(); - listFontCache = null; - } - this.bDisposed_CCachedFontRenderer = true; - } - base.Dispose(); - } - //----------------- - #endregion - - #region [ private ] - //----------------- - /// - /// キャッシュ容量 - /// - private const int MAXCACHESIZE = 256; - - private struct FontCache { - // public Font font; - public string drawstr; - public DrawMode drawmode; - public Color fontColor; - public Color edgeColor; - public Color? secondEdgeColor; - public Color gradationTopColor; - public Color gradationBottomColor; - public SKBitmap bmp; - public bool Vertical; - public bool KeepCenter; - } - private List listFontCache; - - protected bool bDisposed_CCachedFontRenderer; - //----------------- - #endregion +/// +/// 高速描画版のCFontRendererクラス。 +/// といっても、一度レンダリングした結果をキャッシュして使いまわしているだけ。 +/// +public class CCachedFontRenderer : CFontRenderer { + #region [ コンストラクタ ] + public CCachedFontRenderer(string fontpath, int pt, CFontRenderer.FontStyle style) { + Initialize(fontpath, pt, style); } + public CCachedFontRenderer(string fontpath, int pt) { + Initialize(fontpath, pt, CFontRenderer.FontStyle.Regular); + } + #endregion + #region [ コンストラクタから呼ばれる初期化処理 ] + protected new void Initialize(string fontpath, int pt, CFontRenderer.FontStyle style) { + this.bDisposed_CCachedFontRenderer = false; + this.listFontCache = new List(); + base.Initialize(fontpath, pt, style); + } + #endregion + + + #region [ DrawTextのオーバーロード群 ] + /// + /// 文字列を描画したテクスチャを返す + /// + /// 描画文字列 + /// 描画色 + /// 縁取色 + /// 描画済テクスチャ + public new SKBitmap DrawText(string drawstr, Color fontColor, Color edgeColor, Color? secondEdgeColor, int edge_Ratio, bool keepCenter = false) { + return DrawText(drawstr, DrawMode.Edge, fontColor, edgeColor, secondEdgeColor, Color.White, Color.White, edge_Ratio, keepCenter); + } + + /// + /// 文字列を描画したテクスチャを返す + /// + /// 描画文字列 + /// 描画色 + /// 縁取色 + /// 描画済テクスチャ + public SKBitmap DrawText(string drawstr, Color fontColor, Color edgeColor, Color? secondEdgeColor, DrawMode dMode, int edge_Ratio, bool keepCenter = false) { + return DrawText(drawstr, dMode, fontColor, edgeColor, secondEdgeColor, Color.White, Color.White, edge_Ratio, keepCenter); + } + + /// + /// 文字列を描画したテクスチャを返す + /// + /// 描画文字列 + /// 描画色 + /// 縁取色 + /// グラデーション 上側の色 + /// グラデーション 下側の色 + /// 描画済テクスチャ + public new SKBitmap DrawText(string drawstr, Color fontColor, Color edgeColor, Color? secondEdgeColor, Color gradationTopColor, Color gradataionBottomColor, int edge_Ratio, bool keepCenter = false) { + return DrawText(drawstr, DrawMode.Edge | DrawMode.Gradation, fontColor, edgeColor, secondEdgeColor, gradationTopColor, gradataionBottomColor, edge_Ratio, keepCenter); + } + + /// + /// 文字列を描画したテクスチャを返す + /// + /// 描画文字列 + /// 描画色 + /// 縁取色 + /// グラデーション 上側の色 + /// グラデーション 下側の色 + /// 描画済テクスチャ + public new SKBitmap DrawText_V(string drawstr, Color fontColor, Color edgeColor, Color? secondEdgeColor, int edge_Ratio, bool keepCenter = false) { + return DrawText_V(drawstr, DrawMode.Edge, fontColor, edgeColor, secondEdgeColor, Color.Black, Color.Black, edge_Ratio, keepCenter); + } + + #endregion + + protected new SKBitmap DrawText(string drawstr, DrawMode drawmode, Color fontColor, Color edgeColor, Color? secondEdgeColor, Color gradationTopColor, Color gradationBottomColor, int edge_Ratio, bool keepCenter = false) { + #region [ 以前レンダリングしたことのある文字列/フォントか? (キャッシュにヒットするか?) ] + int index = listFontCache.FindIndex( + delegate (FontCache fontcache) { + return ( + drawstr == fontcache.drawstr && + drawmode == fontcache.drawmode && + fontColor == fontcache.fontColor && + edgeColor == fontcache.edgeColor && + secondEdgeColor == fontcache.secondEdgeColor && + gradationTopColor == fontcache.gradationTopColor && + gradationBottomColor == fontcache.gradationBottomColor && + fontcache.Vertical == false && + fontcache.KeepCenter == keepCenter + ); + } + ); + #endregion + if (index < 0) { + // キャッシュにヒットせず。 + #region [ レンダリングして、キャッシュに登録 ] + FontCache fc = new FontCache(); + fc.bmp = base.DrawText(drawstr, drawmode, fontColor, edgeColor, secondEdgeColor, gradationTopColor, gradationBottomColor, edge_Ratio, keepCenter); + fc.drawstr = drawstr; + fc.drawmode = drawmode; + fc.fontColor = fontColor; + fc.edgeColor = edgeColor; + fc.secondEdgeColor = secondEdgeColor; + fc.gradationTopColor = gradationTopColor; + fc.gradationBottomColor = gradationBottomColor; + fc.Vertical = false; + fc.KeepCenter = keepCenter; + listFontCache.Add(fc); + Debug.WriteLine(drawstr + ": Cacheにヒットせず。(cachesize=" + listFontCache.Count + ")"); + #endregion + #region [ もしキャッシュがあふれたら、最も古いキャッシュを破棄する ] + if (listFontCache.Count > MAXCACHESIZE) { + Debug.WriteLine("Cache溢れ。" + listFontCache[0].drawstr + " を解放します。"); + if (listFontCache[0].bmp != null) { + listFontCache[0].bmp.Dispose(); + } + listFontCache.RemoveAt(0); + } + #endregion + + // 呼び出し元のDispose()でキャッシュもDispose()されないように、Clone()で返す。 + return listFontCache[listFontCache.Count - 1].bmp.Copy(); + } else { + Debug.WriteLine(drawstr + ": Cacheにヒット!! index=" + index); + #region [ キャッシュにヒット。レンダリングは行わず、キャッシュ内のデータを返して終了。] + // 呼び出し元のDispose()でキャッシュもDispose()されないように、Clone()で返す。 + return listFontCache[index].bmp.Copy(); + #endregion + } + } + + protected new SKBitmap DrawText_V(string drawstr, DrawMode drawmode, Color fontColor, Color edgeColor, Color? secondEdgeColor, Color gradationTopColor, Color gradationBottomColor, int edge_Ratio, bool keepCenter = false) { + #region [ 以前レンダリングしたことのある文字列/フォントか? (キャッシュにヒットするか?) ] + int index = listFontCache.FindIndex( + delegate (FontCache fontcache) { + return ( + drawstr == fontcache.drawstr && + drawmode == fontcache.drawmode && + fontColor == fontcache.fontColor && + edgeColor == fontcache.edgeColor && + secondEdgeColor == fontcache.secondEdgeColor && + gradationTopColor == fontcache.gradationTopColor && + gradationBottomColor == fontcache.gradationBottomColor && + fontcache.Vertical == true && + fontcache.KeepCenter == keepCenter + ); + } + ); + #endregion + if (index < 0) { + // キャッシュにヒットせず。 + #region [ レンダリングして、キャッシュに登録 ] + FontCache fc = new FontCache(); + fc.bmp = base.DrawText_V(drawstr, drawmode, fontColor, edgeColor, secondEdgeColor, gradationTopColor, gradationBottomColor, edge_Ratio, keepCenter); + fc.drawstr = drawstr; + fc.fontColor = fontColor; + fc.edgeColor = edgeColor; + fc.secondEdgeColor = secondEdgeColor; + fc.gradationTopColor = gradationTopColor; + fc.gradationBottomColor = gradationBottomColor; + fc.Vertical = true; + fc.KeepCenter = keepCenter; + listFontCache.Add(fc); + Debug.WriteLine(drawstr + ": Cacheにヒットせず。(cachesize=" + listFontCache.Count + ")"); + #endregion + #region [ もしキャッシュがあふれたら、最も古いキャッシュを破棄する ] + if (listFontCache.Count > MAXCACHESIZE) { + Debug.WriteLine("Cache溢れ。" + listFontCache[0].drawstr + " を解放します。"); + if (listFontCache[0].bmp != null) { + listFontCache[0].bmp.Dispose(); + } + listFontCache.RemoveAt(0); + } + #endregion + + // 呼び出し元のDispose()でキャッシュもDispose()されないように、Clone()で返す。 + return listFontCache[listFontCache.Count - 1].bmp.Copy(); + } else { + Debug.WriteLine(drawstr + ": Cacheにヒット!! index=" + index); + #region [ キャッシュにヒット。レンダリングは行わず、キャッシュ内のデータを返して終了。] + // 呼び出し元のDispose()でキャッシュもDispose()されないように、Clone()で返す。 + return listFontCache[index].bmp.Copy(); + #endregion + } + } + + #region [ IDisposable 実装 ] + //----------------- + public new void Dispose() { + if (!this.bDisposed_CCachedFontRenderer) { + if (listFontCache != null) { + //Debug.WriteLine( "Disposing CCachedFontRenderer()" ); + #region [ キャッシュしている画像を破棄する ] + foreach (FontCache bc in listFontCache) { + if (bc.bmp != null) { + bc.bmp.Dispose(); + } + } + #endregion + listFontCache.Clear(); + listFontCache = null; + } + this.bDisposed_CCachedFontRenderer = true; + } + base.Dispose(); + } + //----------------- + #endregion + + #region [ private ] + //----------------- + /// + /// キャッシュ容量 + /// + private const int MAXCACHESIZE = 256; + + private struct FontCache { + // public Font font; + public string drawstr; + public DrawMode drawmode; + public Color fontColor; + public Color edgeColor; + public Color? secondEdgeColor; + public Color gradationTopColor; + public Color gradationBottomColor; + public SKBitmap bmp; + public bool Vertical; + public bool KeepCenter; + } + private List listFontCache; + + protected bool bDisposed_CCachedFontRenderer; + //----------------- + #endregion } diff --git a/FDK/src/04.Graphics/TextRenderer/CFontRenderer.cs b/FDK/src/04.Graphics/TextRenderer/CFontRenderer.cs index 3d898b11..4cb33834 100644 --- a/FDK/src/04.Graphics/TextRenderer/CFontRenderer.cs +++ b/FDK/src/04.Graphics/TextRenderer/CFontRenderer.cs @@ -5,258 +5,257 @@ using SkiaSharp; using static FDK.CSkiaSharpTextRenderer; using Color = System.Drawing.Color; -namespace FDK { +namespace FDK; - public class CFontRenderer : IDisposable { - #region[static系] - public static void SetTextCorrectionX_Chara_List_Vertical(string[] list) { - if (list != null) - CorrectionX_Chara_List_Vertical = list.Where(c => c != null).ToArray(); +public class CFontRenderer : IDisposable { + #region[static系] + public static void SetTextCorrectionX_Chara_List_Vertical(string[] list) { + if (list != null) + CorrectionX_Chara_List_Vertical = list.Where(c => c != null).ToArray(); + } + public static void SetTextCorrectionX_Chara_List_Value_Vertical(int[] list) { + if (list != null) + CorrectionX_Chara_List_Value_Vertical = list; + } + public static void SetTextCorrectionY_Chara_List_Vertical(string[] list) { + if (list != null) + CorrectionY_Chara_List_Vertical = list.Where(c => c != null).ToArray(); + } + public static void SetTextCorrectionY_Chara_List_Value_Vertical(int[] list) { + if (list != null) + CorrectionY_Chara_List_Value_Vertical = list; + } + public static void SetRotate_Chara_List_Vertical(string[] list) { + if (list != null) + Rotate_Chara_List_Vertical = list.Where(c => c != null).ToArray(); + } + + private static string[] CorrectionX_Chara_List_Vertical = new string[0]; + private static int[] CorrectionX_Chara_List_Value_Vertical = new int[0]; + private static string[] CorrectionY_Chara_List_Vertical = new string[0]; + private static int[] CorrectionY_Chara_List_Value_Vertical = new int[0]; + private static string[] Rotate_Chara_List_Vertical = new string[0]; + #endregion + + + + [Flags] + public enum DrawMode { + Normal = 0, + Edge, + Gradation + } + + [Flags] + public enum FontStyle { + Regular = 0, + Bold, + Italic, + Underline, + Strikeout + } + + public static string DefaultFontName { + get { + if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) + return "MS UI Gothic"; + else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) + return "ヒラギノ角ゴ Std W8";//OSX搭載PC未所持のため暫定 + else + return "Droid Sans Fallback"; } - public static void SetTextCorrectionX_Chara_List_Value_Vertical(int[] list) { - if (list != null) - CorrectionX_Chara_List_Value_Vertical = list; - } - public static void SetTextCorrectionY_Chara_List_Vertical(string[] list) { - if (list != null) - CorrectionY_Chara_List_Vertical = list.Where(c => c != null).ToArray(); - } - public static void SetTextCorrectionY_Chara_List_Value_Vertical(int[] list) { - if (list != null) - CorrectionY_Chara_List_Value_Vertical = list; - } - public static void SetRotate_Chara_List_Vertical(string[] list) { - if (list != null) - Rotate_Chara_List_Vertical = list.Where(c => c != null).ToArray(); + } + + public static bool FontExists(string fontpath) { + return SKFontManager.Default.FontFamilies.Contains(fontpath) || File.Exists(fontpath); + } + + #region [ コンストラクタ ] + public CFontRenderer(string fontpath, int pt, FontStyle style) { + Initialize(fontpath, pt, style); + } + public CFontRenderer(string fontpath, int pt) { + Initialize(fontpath, pt, FontStyle.Regular); + } + public CFontRenderer() { + //throw new ArgumentException("CFontRenderer: 引数があるコンストラクタを使用してください。"); + } + #endregion + + protected void Initialize(string fontpath, int pt, FontStyle style) { + try { + this.textRenderer = new CSkiaSharpTextRenderer(fontpath, pt, style); + return; + } catch (Exception e) { + Trace.TraceWarning("SkiaSharpでのフォント生成に失敗しました。" + e.ToString()); + this.textRenderer?.Dispose(); } - private static string[] CorrectionX_Chara_List_Vertical = new string[0]; - private static int[] CorrectionX_Chara_List_Value_Vertical = new int[0]; - private static string[] CorrectionY_Chara_List_Vertical = new string[0]; - private static int[] CorrectionY_Chara_List_Value_Vertical = new int[0]; - private static string[] Rotate_Chara_List_Vertical = new string[0]; - #endregion + try { + this.textRenderer = new CSkiaSharpTextRenderer(Assembly.GetExecutingAssembly().GetManifestResourceStream(@"FDK.mplus-1p-medium.ttf"), pt, style); + } catch (Exception e) { + Trace.TraceWarning("ビルトインフォントを使用してのフォント生成に失敗しました。" + e.ToString()); + this.textRenderer?.Dispose(); + throw; + } + } + + public SKBitmap DrawText(string drawstr, Color fontColor, bool keepCenter = false) { + return DrawText(drawstr, CFontRenderer.DrawMode.Normal, fontColor, Color.White, null, Color.White, Color.White, 0, keepCenter); + } + + public SKBitmap DrawText(string drawstr, Color fontColor, Color edgeColor, Color? secondEdgeColor, int edge_Ratio, bool keepCenter = false) { + return DrawText(drawstr, CFontRenderer.DrawMode.Edge, fontColor, edgeColor, secondEdgeColor, Color.White, Color.White, edge_Ratio, keepCenter); + } + + public SKBitmap DrawText(string drawstr, Color fontColor, Color gradationTopColor, Color gradataionBottomColor, int edge_Ratio, bool keepCenter = false) { + return DrawText(drawstr, CFontRenderer.DrawMode.Gradation, fontColor, Color.White, null, gradationTopColor, gradataionBottomColor, edge_Ratio, keepCenter); + } + + public SKBitmap DrawText(string drawstr, Color fontColor, Color edgeColor, Color? secondEdgeColor, Color gradationTopColor, Color gradataionBottomColor, int edge_Ratio, bool keepCenter = false) { + return DrawText(drawstr, CFontRenderer.DrawMode.Edge | CFontRenderer.DrawMode.Gradation, fontColor, edgeColor, secondEdgeColor, gradationTopColor, gradataionBottomColor, edge_Ratio, keepCenter); + } + protected SKBitmap DrawText(string drawstr, CFontRenderer.DrawMode drawmode, Color fontColor, Color edgeColor, Color? secondEdgeColor, Color gradationTopColor, Color gradationBottomColor, int edge_Ratio, bool keepCenter = false) { + //横書きに対してのCorrectionは廃止 + return this.textRenderer.DrawText(drawstr, drawmode, fontColor, edgeColor, secondEdgeColor, gradationTopColor, gradationBottomColor, edge_Ratio, keepCenter); + } + public SKBitmap DrawText_V(string drawstr, Color fontColor, bool keepCenter = false) { + return DrawText_V(drawstr, CFontRenderer.DrawMode.Normal, fontColor, Color.White, null, Color.White, Color.White, 0, keepCenter); + } - [Flags] - public enum DrawMode { - Normal = 0, - Edge, - Gradation + public SKBitmap DrawText_V(string drawstr, Color fontColor, Color edgeColor, Color? secondEdgeColor, int edge_Ratio, bool keepCenter = false) { + return DrawText_V(drawstr, CFontRenderer.DrawMode.Edge, fontColor, edgeColor, secondEdgeColor, Color.White, Color.White, edge_Ratio, keepCenter); + } + + public SKBitmap DrawText_V(string drawstr, Color fontColor, Color gradationTopColor, Color gradataionBottomColor, int edge_Ratio, bool keepCenter = false) { + return DrawText_V(drawstr, CFontRenderer.DrawMode.Gradation, fontColor, Color.White, null, gradationTopColor, gradataionBottomColor, edge_Ratio, keepCenter); + } + + public SKBitmap DrawText_V(string drawstr, Color fontColor, Color edgeColor, Color? secondEdgeColor, Color gradationTopColor, Color gradataionBottomColor, int edge_Ratio, bool keepCenter = false) { + return DrawText_V(drawstr, CFontRenderer.DrawMode.Edge | CFontRenderer.DrawMode.Gradation, fontColor, edgeColor, secondEdgeColor, gradationTopColor, gradataionBottomColor, edge_Ratio, keepCenter); + } + protected SKBitmap DrawText_V(string drawstr, CFontRenderer.DrawMode drawmode, Color fontColor, Color edgeColor, Color? secondEdgeColor, Color gradationTopColor, Color gradationBottomColor, int edge_Ratio, bool keepCenter = false) { + if (string.IsNullOrEmpty(drawstr)) { + //nullか""だったら、1x1を返す + return new SKBitmap(1, 1); } - [Flags] - public enum FontStyle { - Regular = 0, - Bold, - Italic, - Underline, - Strikeout - } + //グラデ(全体)にも対応したいですね? - public static string DefaultFontName { - get { - if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) - return "MS UI Gothic"; - else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) - return "ヒラギノ角ゴ Std W8";//OSX搭載PC未所持のため暫定 - else - return "Droid Sans Fallback"; - } - } + List tokens = new List(); + tokens = this.textRenderer.Tokenize(drawstr, fontColor, edgeColor, secondEdgeColor, gradationTopColor, gradationBottomColor); - public static bool FontExists(string fontpath) { - return SKFontManager.Default.FontFamilies.Contains(fontpath) || File.Exists(fontpath); - } + string purified = this.textRenderer.Purify(drawstr); + string[] strList = new string[purified.Length]; + for (int i = 0; i < purified.Length; i++) + strList[i] = purified.Substring(i, 1); + SKBitmap[] strImageList = new SKBitmap[purified.Length]; - #region [ コンストラクタ ] - public CFontRenderer(string fontpath, int pt, FontStyle style) { - Initialize(fontpath, pt, style); - } - public CFontRenderer(string fontpath, int pt) { - Initialize(fontpath, pt, FontStyle.Regular); - } - public CFontRenderer() { - //throw new ArgumentException("CFontRenderer: 引数があるコンストラクタを使用してください。"); - } - #endregion + int nWidth = 0; + int nHeight = 0; + int _idx = 0; + foreach (SStringToken tok in tokens) { + string[] splitted = new string[tok.s.Length]; + for (int i = 0; i < tok.s.Length; i++) + splitted[i] = tok.s.Substring(i, 1); - protected void Initialize(string fontpath, int pt, FontStyle style) { - try { - this.textRenderer = new CSkiaSharpTextRenderer(fontpath, pt, style); - return; - } catch (Exception e) { - Trace.TraceWarning("SkiaSharpでのフォント生成に失敗しました。" + e.ToString()); - this.textRenderer?.Dispose(); - } - - try { - this.textRenderer = new CSkiaSharpTextRenderer(Assembly.GetExecutingAssembly().GetManifestResourceStream(@"FDK.mplus-1p-medium.ttf"), pt, style); - } catch (Exception e) { - Trace.TraceWarning("ビルトインフォントを使用してのフォント生成に失敗しました。" + e.ToString()); - this.textRenderer?.Dispose(); - throw; - } - } - - public SKBitmap DrawText(string drawstr, Color fontColor, bool keepCenter = false) { - return DrawText(drawstr, CFontRenderer.DrawMode.Normal, fontColor, Color.White, null, Color.White, Color.White, 0, keepCenter); - } - - public SKBitmap DrawText(string drawstr, Color fontColor, Color edgeColor, Color? secondEdgeColor, int edge_Ratio, bool keepCenter = false) { - return DrawText(drawstr, CFontRenderer.DrawMode.Edge, fontColor, edgeColor, secondEdgeColor, Color.White, Color.White, edge_Ratio, keepCenter); - } - - public SKBitmap DrawText(string drawstr, Color fontColor, Color gradationTopColor, Color gradataionBottomColor, int edge_Ratio, bool keepCenter = false) { - return DrawText(drawstr, CFontRenderer.DrawMode.Gradation, fontColor, Color.White, null, gradationTopColor, gradataionBottomColor, edge_Ratio, keepCenter); - } - - public SKBitmap DrawText(string drawstr, Color fontColor, Color edgeColor, Color? secondEdgeColor, Color gradationTopColor, Color gradataionBottomColor, int edge_Ratio, bool keepCenter = false) { - return DrawText(drawstr, CFontRenderer.DrawMode.Edge | CFontRenderer.DrawMode.Gradation, fontColor, edgeColor, secondEdgeColor, gradationTopColor, gradataionBottomColor, edge_Ratio, keepCenter); - } - protected SKBitmap DrawText(string drawstr, CFontRenderer.DrawMode drawmode, Color fontColor, Color edgeColor, Color? secondEdgeColor, Color gradationTopColor, Color gradationBottomColor, int edge_Ratio, bool keepCenter = false) { - //横書きに対してのCorrectionは廃止 - return this.textRenderer.DrawText(drawstr, drawmode, fontColor, edgeColor, secondEdgeColor, gradationTopColor, gradationBottomColor, edge_Ratio, keepCenter); - } - - - public SKBitmap DrawText_V(string drawstr, Color fontColor, bool keepCenter = false) { - return DrawText_V(drawstr, CFontRenderer.DrawMode.Normal, fontColor, Color.White, null, Color.White, Color.White, 0, keepCenter); - } - - public SKBitmap DrawText_V(string drawstr, Color fontColor, Color edgeColor, Color? secondEdgeColor, int edge_Ratio, bool keepCenter = false) { - return DrawText_V(drawstr, CFontRenderer.DrawMode.Edge, fontColor, edgeColor, secondEdgeColor, Color.White, Color.White, edge_Ratio, keepCenter); - } - - public SKBitmap DrawText_V(string drawstr, Color fontColor, Color gradationTopColor, Color gradataionBottomColor, int edge_Ratio, bool keepCenter = false) { - return DrawText_V(drawstr, CFontRenderer.DrawMode.Gradation, fontColor, Color.White, null, gradationTopColor, gradataionBottomColor, edge_Ratio, keepCenter); - } - - public SKBitmap DrawText_V(string drawstr, Color fontColor, Color edgeColor, Color? secondEdgeColor, Color gradationTopColor, Color gradataionBottomColor, int edge_Ratio, bool keepCenter = false) { - return DrawText_V(drawstr, CFontRenderer.DrawMode.Edge | CFontRenderer.DrawMode.Gradation, fontColor, edgeColor, secondEdgeColor, gradationTopColor, gradataionBottomColor, edge_Ratio, keepCenter); - } - protected SKBitmap DrawText_V(string drawstr, CFontRenderer.DrawMode drawmode, Color fontColor, Color edgeColor, Color? secondEdgeColor, Color gradationTopColor, Color gradationBottomColor, int edge_Ratio, bool keepCenter = false) { - if (string.IsNullOrEmpty(drawstr)) { - //nullか""だったら、1x1を返す - return new SKBitmap(1, 1); - } - - //グラデ(全体)にも対応したいですね? - - List tokens = new List(); - tokens = this.textRenderer.Tokenize(drawstr, fontColor, edgeColor, secondEdgeColor, gradationTopColor, gradationBottomColor); - - string purified = this.textRenderer.Purify(drawstr); - string[] strList = new string[purified.Length]; - for (int i = 0; i < purified.Length; i++) - strList[i] = purified.Substring(i, 1); - SKBitmap[] strImageList = new SKBitmap[purified.Length]; - - int nWidth = 0; - int nHeight = 0; - int _idx = 0; - foreach (SStringToken tok in tokens) { - string[] splitted = new string[tok.s.Length]; - for (int i = 0; i < tok.s.Length; i++) - splitted[i] = tok.s.Substring(i, 1); - - for (int i = 0; i < splitted.Length; i++) { - strImageList[_idx] = this.textRenderer.DrawText(splitted[i], drawmode, tok.TextColor, tok.OutlineColor, secondEdgeColor, tok.GradiantTop, tok.GradiantBottom, edge_Ratio, false); - - //回転する文字 - if (Rotate_Chara_List_Vertical.Contains(splitted[i])) { - using (var surface = new SKCanvas(strImageList[_idx])) { - surface.RotateDegrees(90, strImageList[_idx].Width / 2, strImageList[_idx].Height / 2); - surface.DrawBitmap(strImageList[_idx], 0, 0); - } - } - - nWidth = Math.Max(nWidth, strImageList[_idx].Width); - nHeight += strImageList[_idx].Height - 25; - _idx++; - } - } - - - /* - string[] strList = new string[drawstr.Length]; - for (int i = 0; i < drawstr.Length; i++) - strList[i] = drawstr.Substring(i, 1); - SKBitmap[] strImageList = new SKBitmap[drawstr.Length]; - - //レンダリング,大きさ計測 - int nWidth = 0; - int nHeight = 0; - for (int i = 0; i < strImageList.Length; i++) { - strImageList[i] = this.textRenderer.DrawText(strList[i], drawmode, fontColor, edgeColor, secondEdgeColor, gradationTopColor, gradationBottomColor, edge_Ratio, false); + for (int i = 0; i < splitted.Length; i++) { + strImageList[_idx] = this.textRenderer.DrawText(splitted[i], drawmode, tok.TextColor, tok.OutlineColor, secondEdgeColor, tok.GradiantTop, tok.GradiantBottom, edge_Ratio, false); //回転する文字 - if (Rotate_Chara_List_Vertical.Contains(strList[i])) { - using (var surface = new SKCanvas(strImageList[i])) { - surface.RotateDegrees(90, strImageList[i].Width / 2, strImageList[i].Height / 2); - surface.DrawBitmap(strImageList[i], 0, 0); + if (Rotate_Chara_List_Vertical.Contains(splitted[i])) { + using (var surface = new SKCanvas(strImageList[_idx])) { + surface.RotateDegrees(90, strImageList[_idx].Width / 2, strImageList[_idx].Height / 2); + surface.DrawBitmap(strImageList[_idx], 0, 0); } } - nWidth = Math.Max(nWidth, strImageList[i].Width); - nHeight += strImageList[i].Height - 25; + nWidth = Math.Max(nWidth, strImageList[_idx].Width); + nHeight += strImageList[_idx].Height - 25; + _idx++; } - */ - - SKImageInfo skImageInfo = new SKImageInfo(nWidth, nHeight); - - using var skSurface = SKSurface.Create(skImageInfo); - using var skCanvas = skSurface.Canvas; - - //1文字ずつ描画したやつを全体キャンバスに描画していく - int nowHeightPos = 0; - for (int i = 0; i < strImageList.Length; i++) { - int Correction_X = 0, Correction_Y = 0; - if (CorrectionX_Chara_List_Vertical != null && CorrectionX_Chara_List_Value_Vertical != null) { - int Xindex = Array.IndexOf(CorrectionX_Chara_List_Vertical, strList[i]); - if (-1 < Xindex && Xindex < CorrectionX_Chara_List_Value_Vertical.Length && CorrectionX_Chara_List_Vertical.Contains(strList[i])) { - Correction_X = CorrectionX_Chara_List_Value_Vertical[Xindex]; - } else { - if (-1 < Xindex && CorrectionX_Chara_List_Value_Vertical.Length <= Xindex && CorrectionX_Chara_List_Vertical.Contains(strList[i])) { - Correction_X = CorrectionX_Chara_List_Value_Vertical[0]; - } else { - Correction_X = 0; - } - } - } - - if (CorrectionY_Chara_List_Vertical != null && CorrectionY_Chara_List_Value_Vertical != null) { - int Yindex = Array.IndexOf(CorrectionY_Chara_List_Vertical, strList[i]); - if (-1 < Yindex && Yindex < CorrectionY_Chara_List_Value_Vertical.Length && CorrectionY_Chara_List_Vertical.Contains(strList[i])) { - Correction_Y = CorrectionY_Chara_List_Value_Vertical[Yindex]; - } else { - if (-1 < Yindex && CorrectionY_Chara_List_Value_Vertical.Length <= Yindex && CorrectionY_Chara_List_Vertical.Contains(strList[i])) { - Correction_Y = CorrectionY_Chara_List_Value_Vertical[0]; - } else { - Correction_Y = 0; - } - } - } - skCanvas.DrawBitmap(strImageList[i], new SKPoint((nWidth - strImageList[i].Width) / 2 + Correction_X, nowHeightPos + Correction_Y)); - nowHeightPos += strImageList[i].Height - 25; - } - - //1文字ずつ描画したやつの解放 - for (int i = 0; i < strImageList.Length; i++) { - strImageList[i].Dispose(); - } - - - SKImage image = skSurface.Snapshot(); - //返します - return SKBitmap.FromImage(image); } - public void Dispose() { - this.textRenderer.Dispose(); + + /* + string[] strList = new string[drawstr.Length]; + for (int i = 0; i < drawstr.Length; i++) + strList[i] = drawstr.Substring(i, 1); + SKBitmap[] strImageList = new SKBitmap[drawstr.Length]; + + //レンダリング,大きさ計測 + int nWidth = 0; + int nHeight = 0; + for (int i = 0; i < strImageList.Length; i++) { + strImageList[i] = this.textRenderer.DrawText(strList[i], drawmode, fontColor, edgeColor, secondEdgeColor, gradationTopColor, gradationBottomColor, edge_Ratio, false); + + //回転する文字 + if (Rotate_Chara_List_Vertical.Contains(strList[i])) { + using (var surface = new SKCanvas(strImageList[i])) { + surface.RotateDegrees(90, strImageList[i].Width / 2, strImageList[i].Height / 2); + surface.DrawBitmap(strImageList[i], 0, 0); + } + } + + nWidth = Math.Max(nWidth, strImageList[i].Width); + nHeight += strImageList[i].Height - 25; + } + */ + + SKImageInfo skImageInfo = new SKImageInfo(nWidth, nHeight); + + using var skSurface = SKSurface.Create(skImageInfo); + using var skCanvas = skSurface.Canvas; + + //1文字ずつ描画したやつを全体キャンバスに描画していく + int nowHeightPos = 0; + for (int i = 0; i < strImageList.Length; i++) { + int Correction_X = 0, Correction_Y = 0; + if (CorrectionX_Chara_List_Vertical != null && CorrectionX_Chara_List_Value_Vertical != null) { + int Xindex = Array.IndexOf(CorrectionX_Chara_List_Vertical, strList[i]); + if (-1 < Xindex && Xindex < CorrectionX_Chara_List_Value_Vertical.Length && CorrectionX_Chara_List_Vertical.Contains(strList[i])) { + Correction_X = CorrectionX_Chara_List_Value_Vertical[Xindex]; + } else { + if (-1 < Xindex && CorrectionX_Chara_List_Value_Vertical.Length <= Xindex && CorrectionX_Chara_List_Vertical.Contains(strList[i])) { + Correction_X = CorrectionX_Chara_List_Value_Vertical[0]; + } else { + Correction_X = 0; + } + } + } + + if (CorrectionY_Chara_List_Vertical != null && CorrectionY_Chara_List_Value_Vertical != null) { + int Yindex = Array.IndexOf(CorrectionY_Chara_List_Vertical, strList[i]); + if (-1 < Yindex && Yindex < CorrectionY_Chara_List_Value_Vertical.Length && CorrectionY_Chara_List_Vertical.Contains(strList[i])) { + Correction_Y = CorrectionY_Chara_List_Value_Vertical[Yindex]; + } else { + if (-1 < Yindex && CorrectionY_Chara_List_Value_Vertical.Length <= Yindex && CorrectionY_Chara_List_Vertical.Contains(strList[i])) { + Correction_Y = CorrectionY_Chara_List_Value_Vertical[0]; + } else { + Correction_Y = 0; + } + } + } + skCanvas.DrawBitmap(strImageList[i], new SKPoint((nWidth - strImageList[i].Width) / 2 + Correction_X, nowHeightPos + Correction_Y)); + nowHeightPos += strImageList[i].Height - 25; } - private ITextRenderer textRenderer; + //1文字ずつ描画したやつの解放 + for (int i = 0; i < strImageList.Length; i++) { + strImageList[i].Dispose(); + } + + + SKImage image = skSurface.Snapshot(); + //返します + return SKBitmap.FromImage(image); } + + public void Dispose() { + this.textRenderer.Dispose(); + } + + private ITextRenderer textRenderer; } diff --git a/FDK/src/04.Graphics/TextRenderer/CSkiaSharpTextRenderer.cs b/FDK/src/04.Graphics/TextRenderer/CSkiaSharpTextRenderer.cs index 5e4a7dab..0cf0109e 100644 --- a/FDK/src/04.Graphics/TextRenderer/CSkiaSharpTextRenderer.cs +++ b/FDK/src/04.Graphics/TextRenderer/CSkiaSharpTextRenderer.cs @@ -3,161 +3,102 @@ using System.Text.RegularExpressions; using SkiaSharp; using Color = System.Drawing.Color; -namespace FDK { - internal class CSkiaSharpTextRenderer : ITextRenderer { - //https://monobook.org/wiki/SkiaSharp%E3%81%A7%E6%97%A5%E6%9C%AC%E8%AA%9E%E6%96%87%E5%AD%97%E5%88%97%E3%82%92%E6%8F%8F%E7%94%BB%E3%81%99%E3%82%8B - public CSkiaSharpTextRenderer(string fontpath, int pt) { - Initialize(fontpath, pt, CFontRenderer.FontStyle.Regular); +namespace FDK; + +internal class CSkiaSharpTextRenderer : ITextRenderer { + //https://monobook.org/wiki/SkiaSharp%E3%81%A7%E6%97%A5%E6%9C%AC%E8%AA%9E%E6%96%87%E5%AD%97%E5%88%97%E3%82%92%E6%8F%8F%E7%94%BB%E3%81%99%E3%82%8B + public CSkiaSharpTextRenderer(string fontpath, int pt) { + Initialize(fontpath, pt, CFontRenderer.FontStyle.Regular); + } + + public CSkiaSharpTextRenderer(string fontpath, int pt, CFontRenderer.FontStyle style) { + Initialize(fontpath, pt, style); + } + + public CSkiaSharpTextRenderer(Stream fontstream, int pt, CFontRenderer.FontStyle style) { + Initialize(fontstream, pt, style); + } + + protected void Initialize(Stream fontstream, int pt, CFontRenderer.FontStyle style) { + paint = new SKPaint(); + + //stream・filepathから生成した場合に、style設定をどうすればいいのかがわからない + paint.Typeface = SKFontManager.Default.CreateTypeface(fontstream); + + paint.TextSize = (pt * 1.3f); + paint.IsAntialias = true; + } + + protected void Initialize(string fontpath, int pt, CFontRenderer.FontStyle style) { + paint = new SKPaint(); + + SKFontStyleWeight weight = SKFontStyleWeight.Normal; + SKFontStyleWidth width = SKFontStyleWidth.Normal; + SKFontStyleSlant slant = SKFontStyleSlant.Upright; + + if (style.HasFlag(CFontRenderer.FontStyle.Bold)) { + weight = SKFontStyleWeight.Bold; + } + if (style.HasFlag(CFontRenderer.FontStyle.Italic)) { + slant = SKFontStyleSlant.Italic; + } + if (style.HasFlag(CFontRenderer.FontStyle.Strikeout)) { + paint.Style = SKPaintStyle.Stroke; + } + if (style.HasFlag(CFontRenderer.FontStyle.Underline)) { + //???? + //paint.FontMetrics.UnderlinePosition; } - public CSkiaSharpTextRenderer(string fontpath, int pt, CFontRenderer.FontStyle style) { - Initialize(fontpath, pt, style); - } + if (SKFontManager.Default.FontFamilies.Contains(fontpath)) + paint.Typeface = SKTypeface.FromFamilyName(fontpath, weight, width, slant); - public CSkiaSharpTextRenderer(Stream fontstream, int pt, CFontRenderer.FontStyle style) { - Initialize(fontstream, pt, style); - } + //stream・filepathから生成した場合に、style設定をどうすればいいのかがわからない + if (File.Exists(fontpath)) + paint.Typeface = SKTypeface.FromFile(fontpath, 0); - protected void Initialize(Stream fontstream, int pt, CFontRenderer.FontStyle style) { - paint = new SKPaint(); + if (paint.Typeface == null) + throw new FileNotFoundException(fontpath); - //stream・filepathから生成した場合に、style設定をどうすればいいのかがわからない - paint.Typeface = SKFontManager.Default.CreateTypeface(fontstream); + paint.TextSize = (pt * 1.3f); + paint.IsAntialias = true; + } - paint.TextSize = (pt * 1.3f); - paint.IsAntialias = true; - } + internal struct SStringToken { + public string s; + public Color TextColor; + public bool UseGradiant; + public Color GradiantTop; + public Color GradiantBottom; + public bool UseOutline; + public Color OutlineColor; + } - protected void Initialize(string fontpath, int pt, CFontRenderer.FontStyle style) { - paint = new SKPaint(); + // Purify is equivalent to RemoveTags on ObjectExtensions.cs, update both if changing TagRegex - SKFontStyleWeight weight = SKFontStyleWeight.Normal; - SKFontStyleWidth width = SKFontStyleWidth.Normal; - SKFontStyleSlant slant = SKFontStyleSlant.Upright; + private const string TagRegex = @"<(/?)([gc](?:\.#[0-9a-fA-F]{6})*?)>"; - if (style.HasFlag(CFontRenderer.FontStyle.Bold)) { - weight = SKFontStyleWeight.Bold; - } - if (style.HasFlag(CFontRenderer.FontStyle.Italic)) { - slant = SKFontStyleSlant.Italic; - } - if (style.HasFlag(CFontRenderer.FontStyle.Strikeout)) { - paint.Style = SKPaintStyle.Stroke; - } - if (style.HasFlag(CFontRenderer.FontStyle.Underline)) { - //???? - //paint.FontMetrics.UnderlinePosition; - } + public string Purify(string input) { + return Regex.Replace(input, TagRegex, ""); + } - if (SKFontManager.Default.FontFamilies.Contains(fontpath)) - paint.Typeface = SKTypeface.FromFamilyName(fontpath, weight, width, slant); + public List Tokenize(string input, Color fontColor, Color edgeColor, Color? secondEdgeColor, Color gradationTopColor, Color gradationBottomColor) { + List tokens = new List(); + Stack tags = new Stack(); + Stack tokenStack = new Stack(); + int lastPos = 0; - //stream・filepathから生成した場合に、style設定をどうすればいいのかがわからない - if (File.Exists(fontpath)) - paint.Typeface = SKTypeface.FromFile(fontpath, 0); + var tagRegex = new Regex(TagRegex); + var matches = tagRegex.Matches(input); - if (paint.Typeface == null) - throw new FileNotFoundException(fontpath); + foreach (Match match in matches) { + int pos = match.Index; + string text = input.Substring(lastPos, pos - lastPos); - paint.TextSize = (pt * 1.3f); - paint.IsAntialias = true; - } - - internal struct SStringToken { - public string s; - public Color TextColor; - public bool UseGradiant; - public Color GradiantTop; - public Color GradiantBottom; - public bool UseOutline; - public Color OutlineColor; - } - - // Purify is equivalent to RemoveTags on ObjectExtensions.cs, update both if changing TagRegex - - private const string TagRegex = @"<(/?)([gc](?:\.#[0-9a-fA-F]{6})*?)>"; - - public string Purify(string input) { - return Regex.Replace(input, TagRegex, ""); - } - - public List Tokenize(string input, Color fontColor, Color edgeColor, Color? secondEdgeColor, Color gradationTopColor, Color gradationBottomColor) { - List tokens = new List(); - Stack tags = new Stack(); - Stack tokenStack = new Stack(); - int lastPos = 0; - - var tagRegex = new Regex(TagRegex); - var matches = tagRegex.Matches(input); - - foreach (Match match in matches) { - int pos = match.Index; - string text = input.Substring(lastPos, pos - lastPos); - - // First - if (text.Length > 0) { - SStringToken token = new SStringToken { - s = text, - UseGradiant = tokenStack.Count > 0 && tokenStack.Peek().UseGradiant, - GradiantTop = (tokenStack.Count == 0) ? gradationTopColor : tokenStack.Peek().GradiantTop, - GradiantBottom = (tokenStack.Count == 0) ? gradationBottomColor : tokenStack.Peek().GradiantBottom, - TextColor = (tokenStack.Count == 0) ? fontColor : tokenStack.Peek().TextColor, - UseOutline = tokenStack.Count > 0 && tokenStack.Peek().UseOutline, - OutlineColor = (tokenStack.Count == 0) ? edgeColor : tokenStack.Peek().OutlineColor, - }; - tokens.Add(token); - } - - lastPos = pos + match.Length; - - if (match.Groups[1].Value == "/") { - if (tags.Count > 0) tags.Pop(); - if (tokenStack.Count > 0) tokenStack.Pop(); - } else { - tags.Push(match.Groups[2].Value); - SStringToken newToken = new SStringToken { - UseGradiant = tokenStack.Count > 0 ? tokenStack.Peek().UseGradiant : false, - GradiantTop = (tokenStack.Count == 0) ? gradationTopColor : tokenStack.Peek().GradiantTop, - GradiantBottom = (tokenStack.Count == 0) ? gradationBottomColor : tokenStack.Peek().GradiantBottom, - TextColor = (tokenStack.Count == 0) ? fontColor : tokenStack.Peek().TextColor, - UseOutline = tokenStack.Count > 0 ? tokenStack.Peek().UseOutline : false, - OutlineColor = (tokenStack.Count == 0) ? edgeColor : tokenStack.Peek().OutlineColor, - }; - - string[] _varSplit = match.Groups[2].Value.Split("."); - - if (_varSplit.Length > 0) { - switch (_varSplit[0]) { - case "g": { - if (_varSplit.Length > 2) { - newToken.UseGradiant = true; - newToken.GradiantTop = ColorTranslator.FromHtml(_varSplit[1]); - newToken.GradiantBottom = ColorTranslator.FromHtml(_varSplit[2]); - } - break; - } - case "c": { - if (_varSplit.Length > 1) { - newToken.TextColor = ColorTranslator.FromHtml(_varSplit[1]); - } - if (_varSplit.Length > 2) { - newToken.UseOutline = true; - newToken.OutlineColor = ColorTranslator.FromHtml(_varSplit[2]); - } - break; - } - - } - } - - tokenStack.Push(newToken); - } - } - - // Last - if (lastPos < input.Length) { + // First + if (text.Length > 0) { SStringToken token = new SStringToken { - s = input.Substring(lastPos), + s = text, UseGradiant = tokenStack.Count > 0 && tokenStack.Peek().UseGradiant, GradiantTop = (tokenStack.Count == 0) ? gradationTopColor : tokenStack.Peek().GradiantTop, GradiantBottom = (tokenStack.Count == 0) ? gradationBottomColor : tokenStack.Peek().GradiantBottom, @@ -168,131 +109,190 @@ namespace FDK { tokens.Add(token); } - return tokens; - } + lastPos = pos + match.Length; - public SKBitmap DrawText(string drawstr, CFontRenderer.DrawMode drawMode, Color fontColor, Color edgeColor, Color? secondEdgeColor, Color gradationTopColor, Color gradationBottomColor, int edge_Ratio, bool keepCenter) { - if (string.IsNullOrEmpty(drawstr)) { - //nullか""だったら、1x1を返す - return new SKBitmap(1, 1); - } + if (match.Groups[1].Value == "/") { + if (tags.Count > 0) tags.Pop(); + if (tokenStack.Count > 0) tokenStack.Pop(); + } else { + tags.Push(match.Groups[2].Value); + SStringToken newToken = new SStringToken { + UseGradiant = tokenStack.Count > 0 ? tokenStack.Peek().UseGradiant : false, + GradiantTop = (tokenStack.Count == 0) ? gradationTopColor : tokenStack.Peek().GradiantTop, + GradiantBottom = (tokenStack.Count == 0) ? gradationBottomColor : tokenStack.Peek().GradiantBottom, + TextColor = (tokenStack.Count == 0) ? fontColor : tokenStack.Peek().TextColor, + UseOutline = tokenStack.Count > 0 ? tokenStack.Peek().UseOutline : false, + OutlineColor = (tokenStack.Count == 0) ? edgeColor : tokenStack.Peek().OutlineColor, + }; - string[] strs = drawstr.Split("\n"); - List[] tokens = new List[strs.Length]; + string[] _varSplit = match.Groups[2].Value.Split("."); - for (int i = 0; i < strs.Length; i++) { - tokens[i] = Tokenize(strs[i], fontColor, edgeColor, secondEdgeColor, gradationTopColor, gradationBottomColor); - } + if (_varSplit.Length > 0) { + switch (_varSplit[0]) { + case "g": { + if (_varSplit.Length > 2) { + newToken.UseGradiant = true; + newToken.GradiantTop = ColorTranslator.FromHtml(_varSplit[1]); + newToken.GradiantBottom = ColorTranslator.FromHtml(_varSplit[2]); + } + break; + } + case "c": { + if (_varSplit.Length > 1) { + newToken.TextColor = ColorTranslator.FromHtml(_varSplit[1]); + } + if (_varSplit.Length > 2) { + newToken.UseOutline = true; + newToken.OutlineColor = ColorTranslator.FromHtml(_varSplit[2]); + } + break; + } - SKBitmap[] images = new SKBitmap[strs.Length]; - - for (int i = 0; i < strs.Length; i++) { - SKRect bounds = new SKRect(); - - int width = (int)Math.Ceiling(paint.MeasureText(Purify(strs[i]), ref bounds)) + 50; - int height = (int)Math.Ceiling(paint.FontMetrics.Descent - paint.FontMetrics.Ascent) + 50; - - //少し大きめにとる(定数じゃない方法を考えましょう) - SKBitmap bitmap = new SKBitmap(width, height, SKColorType.Rgba8888, SKAlphaType.Premul); - SKCanvas canvas = new SKCanvas(bitmap); - - int x_offset = 0; - - foreach (SStringToken tok in tokens[i]) { - int token_width = (int)Math.Ceiling(paint.MeasureText(tok.s, ref bounds)); - - if (drawMode.HasFlag(CFontRenderer.DrawMode.Edge) || tok.UseOutline) { - - SKPath path = paint.GetTextPath(tok.s, 25 + x_offset, -paint.FontMetrics.Ascent + 25); - - if (secondEdgeColor != null) { - SKPaint secondEdgePaint = new SKPaint(); - secondEdgePaint.StrokeWidth = paint.TextSize * 8 / edge_Ratio; - secondEdgePaint.StrokeJoin = SKStrokeJoin.Round; - secondEdgePaint.Color = new SKColor(secondEdgeColor.Value.R, secondEdgeColor.Value.G, secondEdgeColor.Value.B, secondEdgeColor.Value.A); - secondEdgePaint.Style = SKPaintStyle.Stroke; - secondEdgePaint.IsAntialias = true; - canvas.DrawPath(path, secondEdgePaint); - } - - SKPaint edgePaint = new SKPaint(); - edgePaint.StrokeWidth = paint.TextSize * (secondEdgeColor == null ? 8 : 4) / edge_Ratio; - edgePaint.StrokeJoin = SKStrokeJoin.Round; - edgePaint.Color = new SKColor(tok.OutlineColor.R, tok.OutlineColor.G, tok.OutlineColor.B, tok.OutlineColor.A); - edgePaint.Style = SKPaintStyle.Stroke; - edgePaint.IsAntialias = true; - canvas.DrawPath(path, edgePaint); } - - if (tok.UseGradiant) { - //https://docs.microsoft.com/ja-jp/xamarin/xamarin-forms/user-interface/graphics/skiasharp/effects/shaders/linear-gradient - paint.Shader = SKShader.CreateLinearGradient( - new SKPoint(0, 25), - new SKPoint(0, height - 25), - new SKColor[] { - new SKColor(tok.GradiantTop.R, tok.GradiantTop.G, tok.GradiantTop.B, tok.GradiantTop.A), - new SKColor(tok.GradiantBottom.R, tok.GradiantBottom.G, tok.GradiantBottom.B, tok.GradiantBottom.A) }, - new float[] { 0, 1 }, - SKShaderTileMode.Clamp); - paint.Color = new SKColor(0xffffffff); - } else { - paint.Shader = null; - paint.Color = new SKColor(tok.TextColor.R, tok.TextColor.G, tok.TextColor.B); - } - - canvas.DrawText(tok.s, 25 + x_offset, -paint.FontMetrics.Ascent + 25, paint); - - x_offset += token_width; } - - - - canvas.Flush(); - - images[i] = bitmap; + tokenStack.Push(newToken); } - - int ret_width = 0; - int ret_height = 0; - for (int i = 0; i < images.Length; i++) { - ret_width = Math.Max(ret_width, images[i].Width); - ret_height += images[i].Height - 25; - } - - - - - SKImageInfo skImageInfo = new SKImageInfo(ret_width, ret_height); - - using var skSurface = SKSurface.Create(skImageInfo); - using var skCanvas = skSurface.Canvas; - - - - - int height_i = -25; - for (int i = 0; i < images.Length; i++) { - if (keepCenter) { - skCanvas.DrawBitmap(images[i], new SKPoint((ret_width / 2) - (images[i].Width / 2.0f), height_i)); - } else { - skCanvas.DrawBitmap(images[i], new SKPoint(0, height_i)); - } - height_i += images[i].Height - 50; - images[i].Dispose(); - } - - - - SKImage image = skSurface.Snapshot(); - //返します - return SKBitmap.FromImage(image); } - public void Dispose() { - paint.Dispose(); + // Last + if (lastPos < input.Length) { + SStringToken token = new SStringToken { + s = input.Substring(lastPos), + UseGradiant = tokenStack.Count > 0 && tokenStack.Peek().UseGradiant, + GradiantTop = (tokenStack.Count == 0) ? gradationTopColor : tokenStack.Peek().GradiantTop, + GradiantBottom = (tokenStack.Count == 0) ? gradationBottomColor : tokenStack.Peek().GradiantBottom, + TextColor = (tokenStack.Count == 0) ? fontColor : tokenStack.Peek().TextColor, + UseOutline = tokenStack.Count > 0 && tokenStack.Peek().UseOutline, + OutlineColor = (tokenStack.Count == 0) ? edgeColor : tokenStack.Peek().OutlineColor, + }; + tokens.Add(token); } - private SKPaint paint = null; + return tokens; } + + public SKBitmap DrawText(string drawstr, CFontRenderer.DrawMode drawMode, Color fontColor, Color edgeColor, Color? secondEdgeColor, Color gradationTopColor, Color gradationBottomColor, int edge_Ratio, bool keepCenter) { + if (string.IsNullOrEmpty(drawstr)) { + //nullか""だったら、1x1を返す + return new SKBitmap(1, 1); + } + + string[] strs = drawstr.Split("\n"); + List[] tokens = new List[strs.Length]; + + for (int i = 0; i < strs.Length; i++) { + tokens[i] = Tokenize(strs[i], fontColor, edgeColor, secondEdgeColor, gradationTopColor, gradationBottomColor); + } + + SKBitmap[] images = new SKBitmap[strs.Length]; + + for (int i = 0; i < strs.Length; i++) { + SKRect bounds = new SKRect(); + + int width = (int)Math.Ceiling(paint.MeasureText(Purify(strs[i]), ref bounds)) + 50; + int height = (int)Math.Ceiling(paint.FontMetrics.Descent - paint.FontMetrics.Ascent) + 50; + + //少し大きめにとる(定数じゃない方法を考えましょう) + SKBitmap bitmap = new SKBitmap(width, height, SKColorType.Rgba8888, SKAlphaType.Premul); + SKCanvas canvas = new SKCanvas(bitmap); + + int x_offset = 0; + + foreach (SStringToken tok in tokens[i]) { + int token_width = (int)Math.Ceiling(paint.MeasureText(tok.s, ref bounds)); + + if (drawMode.HasFlag(CFontRenderer.DrawMode.Edge) || tok.UseOutline) { + + SKPath path = paint.GetTextPath(tok.s, 25 + x_offset, -paint.FontMetrics.Ascent + 25); + + if (secondEdgeColor != null) { + SKPaint secondEdgePaint = new SKPaint(); + secondEdgePaint.StrokeWidth = paint.TextSize * 8 / edge_Ratio; + secondEdgePaint.StrokeJoin = SKStrokeJoin.Round; + secondEdgePaint.Color = new SKColor(secondEdgeColor.Value.R, secondEdgeColor.Value.G, secondEdgeColor.Value.B, secondEdgeColor.Value.A); + secondEdgePaint.Style = SKPaintStyle.Stroke; + secondEdgePaint.IsAntialias = true; + canvas.DrawPath(path, secondEdgePaint); + } + + SKPaint edgePaint = new SKPaint(); + edgePaint.StrokeWidth = paint.TextSize * (secondEdgeColor == null ? 8 : 4) / edge_Ratio; + edgePaint.StrokeJoin = SKStrokeJoin.Round; + edgePaint.Color = new SKColor(tok.OutlineColor.R, tok.OutlineColor.G, tok.OutlineColor.B, tok.OutlineColor.A); + edgePaint.Style = SKPaintStyle.Stroke; + edgePaint.IsAntialias = true; + canvas.DrawPath(path, edgePaint); + } + + if (tok.UseGradiant) { + //https://docs.microsoft.com/ja-jp/xamarin/xamarin-forms/user-interface/graphics/skiasharp/effects/shaders/linear-gradient + paint.Shader = SKShader.CreateLinearGradient( + new SKPoint(0, 25), + new SKPoint(0, height - 25), + new SKColor[] { + new SKColor(tok.GradiantTop.R, tok.GradiantTop.G, tok.GradiantTop.B, tok.GradiantTop.A), + new SKColor(tok.GradiantBottom.R, tok.GradiantBottom.G, tok.GradiantBottom.B, tok.GradiantBottom.A) }, + new float[] { 0, 1 }, + SKShaderTileMode.Clamp); + paint.Color = new SKColor(0xffffffff); + } else { + paint.Shader = null; + paint.Color = new SKColor(tok.TextColor.R, tok.TextColor.G, tok.TextColor.B); + } + + canvas.DrawText(tok.s, 25 + x_offset, -paint.FontMetrics.Ascent + 25, paint); + + x_offset += token_width; + } + + + + + canvas.Flush(); + + images[i] = bitmap; + } + + int ret_width = 0; + int ret_height = 0; + for (int i = 0; i < images.Length; i++) { + ret_width = Math.Max(ret_width, images[i].Width); + ret_height += images[i].Height - 25; + } + + + + + SKImageInfo skImageInfo = new SKImageInfo(ret_width, ret_height); + + using var skSurface = SKSurface.Create(skImageInfo); + using var skCanvas = skSurface.Canvas; + + + + + int height_i = -25; + for (int i = 0; i < images.Length; i++) { + if (keepCenter) { + skCanvas.DrawBitmap(images[i], new SKPoint((ret_width / 2) - (images[i].Width / 2.0f), height_i)); + } else { + skCanvas.DrawBitmap(images[i], new SKPoint(0, height_i)); + } + height_i += images[i].Height - 50; + images[i].Dispose(); + } + + + + SKImage image = skSurface.Snapshot(); + //返します + return SKBitmap.FromImage(image); + } + + public void Dispose() { + paint.Dispose(); + } + + private SKPaint paint = null; } diff --git a/FDK/src/04.Graphics/TextRenderer/ITextRenderer.cs b/FDK/src/04.Graphics/TextRenderer/ITextRenderer.cs index 3e4947db..7413c581 100644 --- a/FDK/src/04.Graphics/TextRenderer/ITextRenderer.cs +++ b/FDK/src/04.Graphics/TextRenderer/ITextRenderer.cs @@ -2,12 +2,12 @@ using SkiaSharp; using static FDK.CSkiaSharpTextRenderer; using Color = System.Drawing.Color; -namespace FDK { - internal interface ITextRenderer : IDisposable { - SKBitmap DrawText(string drawstr, CFontRenderer.DrawMode drawmode, Color fontColor, Color edgeColor, Color? secondEdgeColor, Color gradationTopColor, Color gradationBottomColor, int edge_Ratio, bool keepCenter); +namespace FDK; - string Purify(string input); +internal interface ITextRenderer : IDisposable { + SKBitmap DrawText(string drawstr, CFontRenderer.DrawMode drawmode, Color fontColor, Color edgeColor, Color? secondEdgeColor, Color gradationTopColor, Color gradationBottomColor, int edge_Ratio, bool keepCenter); - List Tokenize(string input, Color fontColor, Color edgeColor, Color? secondEdgeColor, Color gradationTopColor, Color gradationBottomColor); - } + string Purify(string input); + + List Tokenize(string input, Color fontColor, Color edgeColor, Color? secondEdgeColor, Color gradationTopColor, Color gradationBottomColor); } diff --git a/OpenTaiko/src/Animations/Animator.cs b/OpenTaiko/src/Animations/Animator.cs index 3f40bb93..6102b04a 100644 --- a/OpenTaiko/src/Animations/Animator.cs +++ b/OpenTaiko/src/Animations/Animator.cs @@ -1,96 +1,96 @@ using FDK; -namespace OpenTaiko.Animations { - class Animator : IAnimatable { - public Animator(int startValue, int endValue, int tickInterval, bool isLoop) { - Type = CounterType.Normal; - StartValue = startValue; - EndValue = endValue; - TickInterval = tickInterval; - IsLoop = isLoop; - Counter = new CCounter(); - } - public Animator(double startValue, double endValue, double tickInterval, bool isLoop) { - Type = CounterType.Double; - StartValue = startValue; - EndValue = endValue; - TickInterval = tickInterval; - IsLoop = isLoop; - Counter = new CCounter(); - } - public void Start() { - if (Counter == null) throw new NullReferenceException(); - switch (Type) { - case CounterType.Normal: - Counter.Start((int)StartValue, (int)EndValue, (int)TickInterval, OpenTaiko.Timer); - break; - case CounterType.Double: - Counter.Start((double)StartValue, (double)EndValue, (double)TickInterval, SoundManager.PlayTimer); - break; - default: - break; - } - } - public void Stop() { - if (Counter == null) throw new NullReferenceException(); - Counter.Stop(); - } - public void Reset() { - if (Counter == null) throw new NullReferenceException(); - Start(); - } +namespace OpenTaiko.Animations; - public void Tick() { - if (Counter == null) throw new NullReferenceException(); - switch (Type) { - case CounterType.Normal: - if (IsLoop) Counter.TickLoop(); else Counter.Tick(); - if (!IsLoop && Counter.IsEnded) Stop(); - break; - case CounterType.Double: - if (IsLoop) Counter.TickLoopDB(); else Counter.TickDB(); - if (!IsLoop && Counter.IsEnded) Stop(); - break; - default: - break; - } +class Animator : IAnimatable { + public Animator(int startValue, int endValue, int tickInterval, bool isLoop) { + Type = CounterType.Normal; + StartValue = startValue; + EndValue = endValue; + TickInterval = tickInterval; + IsLoop = isLoop; + Counter = new CCounter(); + } + public Animator(double startValue, double endValue, double tickInterval, bool isLoop) { + Type = CounterType.Double; + StartValue = startValue; + EndValue = endValue; + TickInterval = tickInterval; + IsLoop = isLoop; + Counter = new CCounter(); + } + public void Start() { + if (Counter == null) throw new NullReferenceException(); + switch (Type) { + case CounterType.Normal: + Counter.Start((int)StartValue, (int)EndValue, (int)TickInterval, OpenTaiko.Timer); + break; + case CounterType.Double: + Counter.Start((double)StartValue, (double)EndValue, (double)TickInterval, SoundManager.PlayTimer); + break; + default: + break; } + } + public void Stop() { + if (Counter == null) throw new NullReferenceException(); + Counter.Stop(); + } + public void Reset() { + if (Counter == null) throw new NullReferenceException(); + Start(); + } - public virtual object GetAnimation() { - throw new NotImplementedException(); - } - - - - // Properties - public CCounter Counter { - get; - private set; - } - public CounterType Type { - get; - private set; - } - public object StartValue { - get; - private set; - } - public object EndValue { - get; - private set; - } - public object TickInterval { - get; - private set; - } - public bool IsLoop { - get; - private set; + public void Tick() { + if (Counter == null) throw new NullReferenceException(); + switch (Type) { + case CounterType.Normal: + if (IsLoop) Counter.TickLoop(); else Counter.Tick(); + if (!IsLoop && Counter.IsEnded) Stop(); + break; + case CounterType.Double: + if (IsLoop) Counter.TickLoopDB(); else Counter.TickDB(); + if (!IsLoop && Counter.IsEnded) Stop(); + break; + default: + break; } } - enum CounterType { - Normal, - Double + public virtual object GetAnimation() { + throw new NotImplementedException(); + } + + + + // Properties + public CCounter Counter { + get; + private set; + } + public CounterType Type { + get; + private set; + } + public object StartValue { + get; + private set; + } + public object EndValue { + get; + private set; + } + public object TickInterval { + get; + private set; + } + public bool IsLoop { + get; + private set; } } + +enum CounterType { + Normal, + Double +} diff --git a/OpenTaiko/src/Animations/EaseIn.cs b/OpenTaiko/src/Animations/EaseIn.cs index ffbdaeeb..b8343d7f 100644 --- a/OpenTaiko/src/Animations/EaseIn.cs +++ b/OpenTaiko/src/Animations/EaseIn.cs @@ -1,29 +1,29 @@ -namespace OpenTaiko.Animations { +namespace OpenTaiko.Animations; + +/// +/// A class that performs ease-in animation. +/// +class EaseIn : Animator { /// - /// A class that performs ease-in animation. + /// Initialize Ease-in. /// - class EaseIn : Animator { - /// - /// Initialize Ease-in. - /// - /// Starting point - /// End point - /// Time taken for easing, in milliseconds - public EaseIn(int startPoint, int endPoint, int timeMs) : base(0, timeMs, 1, false) { - StartPoint = startPoint; - EndPoint = endPoint; - Sa = EndPoint - StartPoint; - TimeMs = timeMs; - } - - public override object GetAnimation() { - var percent = Counter.CurrentValue / (double)TimeMs; - return ((double)Sa * percent * percent * percent) + StartPoint; - } - - private readonly int StartPoint; - private readonly int EndPoint; - private readonly int Sa; - private readonly int TimeMs; + /// Starting point + /// End point + /// Time taken for easing, in milliseconds + public EaseIn(int startPoint, int endPoint, int timeMs) : base(0, timeMs, 1, false) { + StartPoint = startPoint; + EndPoint = endPoint; + Sa = EndPoint - StartPoint; + TimeMs = timeMs; } + + public override object GetAnimation() { + var percent = Counter.CurrentValue / (double)TimeMs; + return ((double)Sa * percent * percent * percent) + StartPoint; + } + + private readonly int StartPoint; + private readonly int EndPoint; + private readonly int Sa; + private readonly int TimeMs; } diff --git a/OpenTaiko/src/Animations/EaseInOut.cs b/OpenTaiko/src/Animations/EaseInOut.cs index d058e923..c7d6ea78 100644 --- a/OpenTaiko/src/Animations/EaseInOut.cs +++ b/OpenTaiko/src/Animations/EaseInOut.cs @@ -1,34 +1,34 @@ -namespace OpenTaiko.Animations { +namespace OpenTaiko.Animations; + +/// +/// A class that performs ease-in-out animation. +/// +class EaseInOut : Animator { /// - /// A class that performs ease-in-out animation. + /// Initialize Ease-in-out. /// - class EaseInOut : Animator { - /// - /// Initialize Ease-in-out. - /// - /// Starting point. - /// End point. - /// Time taken for easing, in milliseconds. - public EaseInOut(int startPoint, int endPoint, int timeMs) : base(0, timeMs, 1, false) { - StartPoint = startPoint; - EndPoint = endPoint; - Sa = EndPoint - StartPoint; - TimeMs = timeMs; - } - - public override object GetAnimation() { - var percent = Counter.CurrentValue / (double)TimeMs * 2.0; - if (percent < 1) { - return ((double)Sa / 2.0 * percent * percent * percent) + StartPoint; - } else { - percent -= 2; - return ((double)Sa / 2.0 * ((percent * percent * percent) + 2)) + StartPoint; - } - } - - private readonly int StartPoint; - private readonly int EndPoint; - private readonly int Sa; - private readonly int TimeMs; + /// Starting point. + /// End point. + /// Time taken for easing, in milliseconds. + public EaseInOut(int startPoint, int endPoint, int timeMs) : base(0, timeMs, 1, false) { + StartPoint = startPoint; + EndPoint = endPoint; + Sa = EndPoint - StartPoint; + TimeMs = timeMs; } + + public override object GetAnimation() { + var percent = Counter.CurrentValue / (double)TimeMs * 2.0; + if (percent < 1) { + return ((double)Sa / 2.0 * percent * percent * percent) + StartPoint; + } else { + percent -= 2; + return ((double)Sa / 2.0 * ((percent * percent * percent) + 2)) + StartPoint; + } + } + + private readonly int StartPoint; + private readonly int EndPoint; + private readonly int Sa; + private readonly int TimeMs; } diff --git a/OpenTaiko/src/Animations/EaseOut.cs b/OpenTaiko/src/Animations/EaseOut.cs index f44b531a..c6d86581 100644 --- a/OpenTaiko/src/Animations/EaseOut.cs +++ b/OpenTaiko/src/Animations/EaseOut.cs @@ -1,30 +1,30 @@ -namespace OpenTaiko.Animations { +namespace OpenTaiko.Animations; + +/// +/// A class that performs ease-out animation. +/// +class EaseOut : Animator { /// - /// A class that performs ease-out animation. + /// Initialize Ease-out. /// - class EaseOut : Animator { - /// - /// Initialize Ease-out. - /// - /// Starting point. - /// End point. - /// Time taken for easing, in milliseconds. - public EaseOut(int startPoint, int endPoint, int timeMs) : base(0, timeMs, 1, false) { - StartPoint = startPoint; - EndPoint = endPoint; - Sa = EndPoint - StartPoint; - TimeMs = timeMs; - } - - public override object GetAnimation() { - var percent = Counter.CurrentValue / (double)TimeMs; - percent -= 1; - return (double)Sa * (percent * percent * percent + 1) + StartPoint; - } - - private readonly int StartPoint; - private readonly int EndPoint; - private readonly int Sa; - private readonly int TimeMs; + /// Starting point. + /// End point. + /// Time taken for easing, in milliseconds. + public EaseOut(int startPoint, int endPoint, int timeMs) : base(0, timeMs, 1, false) { + StartPoint = startPoint; + EndPoint = endPoint; + Sa = EndPoint - StartPoint; + TimeMs = timeMs; } + + public override object GetAnimation() { + var percent = Counter.CurrentValue / (double)TimeMs; + percent -= 1; + return (double)Sa * (percent * percent * percent + 1) + StartPoint; + } + + private readonly int StartPoint; + private readonly int EndPoint; + private readonly int Sa; + private readonly int TimeMs; } diff --git a/OpenTaiko/src/Animations/FadeIn.cs b/OpenTaiko/src/Animations/FadeIn.cs index bc738900..c50e1b6a 100644 --- a/OpenTaiko/src/Animations/FadeIn.cs +++ b/OpenTaiko/src/Animations/FadeIn.cs @@ -1,25 +1,25 @@ -namespace OpenTaiko.Animations { +namespace OpenTaiko.Animations; + +/// +/// A class that performs fade-in animation. +/// +internal class FadeIn : Animator { /// - /// A class that performs fade-in animation. + /// Initialize fade-in. /// - internal class FadeIn : Animator { - /// - /// Initialize fade-in. - /// - /// Time taken for fading, in milliseconds. - public FadeIn(int timems) : base(0, timems - 1, 1, false) { - TimeMs = timems; - } - - /// - /// Returns the opacity of the fade-in animation in 255 levels. - /// - /// Opacity of the fade-in animation. - public override object GetAnimation() { - var opacity = base.Counter.CurrentValue * 255 / TimeMs; - return opacity; - } - - private readonly int TimeMs; + /// Time taken for fading, in milliseconds. + public FadeIn(int timems) : base(0, timems - 1, 1, false) { + TimeMs = timems; } + + /// + /// Returns the opacity of the fade-in animation in 255 levels. + /// + /// Opacity of the fade-in animation. + public override object GetAnimation() { + var opacity = base.Counter.CurrentValue * 255 / TimeMs; + return opacity; + } + + private readonly int TimeMs; } diff --git a/OpenTaiko/src/Animations/FadeOut.cs b/OpenTaiko/src/Animations/FadeOut.cs index 61f6b92e..f6fc3877 100644 --- a/OpenTaiko/src/Animations/FadeOut.cs +++ b/OpenTaiko/src/Animations/FadeOut.cs @@ -1,25 +1,25 @@ -namespace OpenTaiko.Animations { +namespace OpenTaiko.Animations; + +/// +/// A class that performs fade-out animation. +/// +internal class FadeOut : Animator { /// - /// A class that performs fade-out animation. + /// Initialize fade-out. /// - internal class FadeOut : Animator { - /// - /// Initialize fade-out. - /// - /// Time taken for fading, in milliseconds. - public FadeOut(int timems) : base(0, timems - 1, 1, false) { - TimeMs = timems; - } - - /// - /// Returns the opacity of the fade-out animation in 255 levels. - /// - /// Opacity of the fade-out animation. - public override object GetAnimation() { - var opacity = (TimeMs - base.Counter.CurrentValue) * 255 / TimeMs; - return opacity; - } - - private readonly int TimeMs; + /// Time taken for fading, in milliseconds. + public FadeOut(int timems) : base(0, timems - 1, 1, false) { + TimeMs = timems; } + + /// + /// Returns the opacity of the fade-out animation in 255 levels. + /// + /// Opacity of the fade-out animation. + public override object GetAnimation() { + var opacity = (TimeMs - base.Counter.CurrentValue) * 255 / TimeMs; + return opacity; + } + + private readonly int TimeMs; } diff --git a/OpenTaiko/src/Animations/IAnimatable.cs b/OpenTaiko/src/Animations/IAnimatable.cs index ceaf3e8b..b721f6ad 100644 --- a/OpenTaiko/src/Animations/IAnimatable.cs +++ b/OpenTaiko/src/Animations/IAnimatable.cs @@ -1,28 +1,28 @@ -namespace OpenTaiko.Animations { +namespace OpenTaiko.Animations; + +/// +/// Animation interface. +/// +interface IAnimatable { /// - /// Animation interface. + /// Starts the animation. /// - interface IAnimatable { - /// - /// Starts the animation. - /// - void Start(); - /// - /// Stops the animation. - /// - void Stop(); - /// - /// Resets the animation. - /// - void Reset(); - /// - /// Advances the animation. - /// - void Tick(); - /// - /// Returns the animation parameters. - /// - /// Animation parameters. - object GetAnimation(); - } + void Start(); + /// + /// Stops the animation. + /// + void Stop(); + /// + /// Resets the animation. + /// + void Reset(); + /// + /// Advances the animation. + /// + void Tick(); + /// + /// Returns the animation parameters. + /// + /// Animation parameters. + object GetAnimation(); } diff --git a/OpenTaiko/src/Animations/Linear.cs b/OpenTaiko/src/Animations/Linear.cs index 35956584..df48e09f 100644 --- a/OpenTaiko/src/Animations/Linear.cs +++ b/OpenTaiko/src/Animations/Linear.cs @@ -1,29 +1,29 @@ -namespace OpenTaiko.Animations { +namespace OpenTaiko.Animations; + +/// +/// A class that performs linear animation. +/// +class Linear : Animator { /// - /// A class that performs linear animation. + /// Initialize linear movement. /// - class Linear : Animator { - /// - /// Initialize linear movement. - /// - /// Starting point. - /// End point. - /// Time taken for linear, in milliseconds. - public Linear(int startPoint, int endPoint, int timeMs) : base(0, timeMs, 1, false) { - StartPoint = startPoint; - EndPoint = endPoint; - Sa = EndPoint - StartPoint; - TimeMs = timeMs; - } - - public override object GetAnimation() { - var percent = Counter.CurrentValue / (double)TimeMs; - return (Sa * percent) + StartPoint; - } - - private readonly int StartPoint; - private readonly int EndPoint; - private readonly int Sa; - private readonly int TimeMs; + /// Starting point. + /// End point. + /// Time taken for linear, in milliseconds. + public Linear(int startPoint, int endPoint, int timeMs) : base(0, timeMs, 1, false) { + StartPoint = startPoint; + EndPoint = endPoint; + Sa = EndPoint - StartPoint; + TimeMs = timeMs; } + + public override object GetAnimation() { + var percent = Counter.CurrentValue / (double)TimeMs; + return (Sa * percent) + StartPoint; + } + + private readonly int StartPoint; + private readonly int EndPoint; + private readonly int Sa; + private readonly int TimeMs; } diff --git a/OpenTaiko/src/Character/CMenuCharacter.cs b/OpenTaiko/src/Character/CMenuCharacter.cs index b96f8579..40e7f748 100644 --- a/OpenTaiko/src/Character/CMenuCharacter.cs +++ b/OpenTaiko/src/Character/CMenuCharacter.cs @@ -1,273 +1,273 @@ using FDK; -namespace OpenTaiko { - class CMenuCharacter { - private static CCounter[] ctCharacterNormal = new CCounter[5] { new CCounter(), new CCounter(), new CCounter(), new CCounter(), new CCounter() }; - private static CCounter[] ctCharacterSelect = new CCounter[5] { new CCounter(), new CCounter(), new CCounter(), new CCounter(), new CCounter() }; - private static CCounter[] ctCharacterStart = new CCounter[5] { new CCounter(), new CCounter(), new CCounter(), new CCounter(), new CCounter() }; - private static CCounter[] ctCharacterWait = new CCounter[5] { new CCounter(), new CCounter(), new CCounter(), new CCounter(), new CCounter() }; - private static CCounter[] ctCharacterEntry = new CCounter[5] { new CCounter(), new CCounter(), new CCounter(), new CCounter(), new CCounter() }; - private static CCounter[] ctCharacterEntryNormal = new CCounter[5] { new CCounter(), new CCounter(), new CCounter(), new CCounter(), new CCounter() }; +namespace OpenTaiko; - public enum ECharacterAnimation { - // Song select - NORMAL, - START, - SELECT, - WAIT, - // Main menu - ENTRY, - ENTRY_NORMAL, - } +class CMenuCharacter { + private static CCounter[] ctCharacterNormal = new CCounter[5] { new CCounter(), new CCounter(), new CCounter(), new CCounter(), new CCounter() }; + private static CCounter[] ctCharacterSelect = new CCounter[5] { new CCounter(), new CCounter(), new CCounter(), new CCounter(), new CCounter() }; + private static CCounter[] ctCharacterStart = new CCounter[5] { new CCounter(), new CCounter(), new CCounter(), new CCounter(), new CCounter() }; + private static CCounter[] ctCharacterWait = new CCounter[5] { new CCounter(), new CCounter(), new CCounter(), new CCounter(), new CCounter() }; + private static CCounter[] ctCharacterEntry = new CCounter[5] { new CCounter(), new CCounter(), new CCounter(), new CCounter(), new CCounter() }; + private static CCounter[] ctCharacterEntryNormal = new CCounter[5] { new CCounter(), new CCounter(), new CCounter(), new CCounter(), new CCounter() }; + + public enum ECharacterAnimation { + // Song select + NORMAL, + START, + SELECT, + WAIT, + // Main menu + ENTRY, + ENTRY_NORMAL, + } - private static bool _usesSubstituteTexture(int player, ECharacterAnimation eca) { - int _charaId = OpenTaiko.SaveFileInstances[OpenTaiko.GetActualPlayer(player)].data.Character; + private static bool _usesSubstituteTexture(int player, ECharacterAnimation eca) { + int _charaId = OpenTaiko.SaveFileInstances[OpenTaiko.GetActualPlayer(player)].data.Character; - if (_charaId >= 0 && _charaId < OpenTaiko.Skin.Characters_Ptn) { - switch (eca) { - case (ECharacterAnimation.NORMAL): { - if (OpenTaiko.Tx.Characters_Menu_Loop[_charaId].Length > 0) - return false; - break; - } - case (ECharacterAnimation.START): { - if (OpenTaiko.Tx.Characters_Menu_Start[_charaId].Length > 0) - return false; - break; - } - case (ECharacterAnimation.SELECT): { - if (OpenTaiko.Tx.Characters_Menu_Select[_charaId].Length > 0) - return false; - break; - } - case (ECharacterAnimation.WAIT): { - if (OpenTaiko.Tx.Characters_Menu_Wait[_charaId].Length > 0) - return false; - break; - } - case (ECharacterAnimation.ENTRY): { - if (OpenTaiko.Tx.Characters_Title_Entry[_charaId].Length > 0) - return false; - break; - } - case (ECharacterAnimation.ENTRY_NORMAL): { - if (OpenTaiko.Tx.Characters_Title_Normal[_charaId].Length > 0) - return false; - break; - } - } - } - - return true; - } - - public static CTexture[] _getReferenceArray(int player, ECharacterAnimation eca) { - int _charaId = OpenTaiko.SaveFileInstances[OpenTaiko.GetActualPlayer(player)].data.Character; - - if (_charaId >= 0 && _charaId < OpenTaiko.Skin.Characters_Ptn) { - switch (eca) { - case (ECharacterAnimation.NORMAL): { - if (OpenTaiko.Tx.Characters_Menu_Loop[_charaId].Length > 0) - return OpenTaiko.Tx.Characters_Menu_Loop[_charaId]; - if (OpenTaiko.Tx.Characters_Normal[_charaId].Length > 0) - return OpenTaiko.Tx.Characters_Normal[_charaId]; - break; - } - case (ECharacterAnimation.START): { - if (OpenTaiko.Tx.Characters_Menu_Start[_charaId].Length > 0) - return OpenTaiko.Tx.Characters_Menu_Start[_charaId]; - if (OpenTaiko.Tx.Characters_10Combo[_charaId].Length > 0) - return OpenTaiko.Tx.Characters_10Combo[_charaId]; - break; - } - case (ECharacterAnimation.SELECT): { - if (OpenTaiko.Tx.Characters_Menu_Select[_charaId].Length > 0) - return OpenTaiko.Tx.Characters_Menu_Select[_charaId]; - if (OpenTaiko.Tx.Characters_10Combo[_charaId].Length > 0) - return OpenTaiko.Tx.Characters_10Combo[_charaId]; - break; - } - case (ECharacterAnimation.WAIT): { - if (OpenTaiko.Tx.Characters_Menu_Wait[_charaId].Length > 0) - return OpenTaiko.Tx.Characters_Menu_Wait[_charaId]; - if (OpenTaiko.Tx.Characters_Menu_Loop[_charaId].Length > 0) - return OpenTaiko.Tx.Characters_Menu_Loop[_charaId]; - if (OpenTaiko.Tx.Characters_GoGoTime[_charaId].Length > 0) - return OpenTaiko.Tx.Characters_GoGoTime[_charaId]; - break; - } - case (ECharacterAnimation.ENTRY): { - if (OpenTaiko.Tx.Characters_Title_Entry[_charaId].Length > 0) - return OpenTaiko.Tx.Characters_Title_Entry[_charaId]; - if (OpenTaiko.Tx.Characters_10Combo[_charaId].Length > 0) - return OpenTaiko.Tx.Characters_10Combo[_charaId]; - break; - } - case (ECharacterAnimation.ENTRY_NORMAL): { - if (OpenTaiko.Tx.Characters_Title_Normal[_charaId].Length > 0) - return OpenTaiko.Tx.Characters_Title_Normal[_charaId]; - if (OpenTaiko.Tx.Characters_Normal[_charaId].Length > 0) - return OpenTaiko.Tx.Characters_Normal[_charaId]; - break; - } - } - } - - - return null; - } - - public static CCounter[] _getReferenceCounter(ECharacterAnimation eca) { + if (_charaId >= 0 && _charaId < OpenTaiko.Skin.Characters_Ptn) { switch (eca) { case (ECharacterAnimation.NORMAL): { - return ctCharacterNormal; - } - case (ECharacterAnimation.START): { - return ctCharacterStart; - } - case (ECharacterAnimation.SELECT): { - return ctCharacterSelect; - } - case (ECharacterAnimation.WAIT): { - return ctCharacterWait; - } - case (ECharacterAnimation.ENTRY): { - return ctCharacterEntry; - } - case (ECharacterAnimation.ENTRY_NORMAL): { - return ctCharacterEntryNormal; - } - } - return null; - } - - public static int _getReferenceAnimationDuration(int player, ECharacterAnimation eca) { - int _charaId = OpenTaiko.SaveFileInstances[OpenTaiko.GetActualPlayer(player)].data.Character; - - switch (eca) { - case (ECharacterAnimation.NORMAL): { - return OpenTaiko.Skin.Characters_Menu_Loop_AnimationDuration[_charaId]; - } - case (ECharacterAnimation.START): { - return OpenTaiko.Skin.Characters_Menu_Start_AnimationDuration[_charaId]; - } - case (ECharacterAnimation.SELECT): { - return OpenTaiko.Skin.Characters_Menu_Select_AnimationDuration[_charaId]; - } - case (ECharacterAnimation.WAIT): { - return OpenTaiko.Skin.Characters_Menu_Wait_AnimationDuration[_charaId]; - } - case (ECharacterAnimation.ENTRY): { - return OpenTaiko.Skin.Characters_Title_Entry_AnimationDuration[_charaId]; - } - case (ECharacterAnimation.ENTRY_NORMAL): { - return OpenTaiko.Skin.Characters_Title_Normal_AnimationDuration[_charaId]; - } - } - return 1000; - } - - public static void tDisableCounter(ECharacterAnimation eca) { - switch (eca) { - case (ECharacterAnimation.NORMAL): { - for (int i = 0; i < 5; i++) - ctCharacterNormal[i] = new CCounter(); + if (OpenTaiko.Tx.Characters_Menu_Loop[_charaId].Length > 0) + return false; break; } case (ECharacterAnimation.START): { - for (int i = 0; i < 5; i++) - ctCharacterStart[i] = new CCounter(); + if (OpenTaiko.Tx.Characters_Menu_Start[_charaId].Length > 0) + return false; break; } case (ECharacterAnimation.SELECT): { - for (int i = 0; i < 5; i++) - ctCharacterSelect[i] = new CCounter(); + if (OpenTaiko.Tx.Characters_Menu_Select[_charaId].Length > 0) + return false; break; } case (ECharacterAnimation.WAIT): { - for (int i = 0; i < 5; i++) - ctCharacterWait[i] = new CCounter(); + if (OpenTaiko.Tx.Characters_Menu_Wait[_charaId].Length > 0) + return false; break; } case (ECharacterAnimation.ENTRY): { - for (int i = 0; i < 5; i++) - ctCharacterEntry[i] = new CCounter(); + if (OpenTaiko.Tx.Characters_Title_Entry[_charaId].Length > 0) + return false; break; } case (ECharacterAnimation.ENTRY_NORMAL): { - for (int i = 0; i < 5; i++) - ctCharacterEntryNormal[i] = new CCounter(); + if (OpenTaiko.Tx.Characters_Title_Normal[_charaId].Length > 0) + return false; break; } } - } + return true; + } - public static void tMenuResetTimer(int player, ECharacterAnimation eca) { - CTexture[] _ref = _getReferenceArray(player, eca); - CCounter[] _ctref = _getReferenceCounter(eca); - int _animeref = _getReferenceAnimationDuration(player, eca); + public static CTexture[] _getReferenceArray(int player, ECharacterAnimation eca) { + int _charaId = OpenTaiko.SaveFileInstances[OpenTaiko.GetActualPlayer(player)].data.Character; - if (_ref != null && _ref.Length > 0 && _ctref != null) { - _ctref[player] = new CCounter(0, _ref.Length - 1, _animeref / (float)_ref.Length, OpenTaiko.Timer); + if (_charaId >= 0 && _charaId < OpenTaiko.Skin.Characters_Ptn) { + switch (eca) { + case (ECharacterAnimation.NORMAL): { + if (OpenTaiko.Tx.Characters_Menu_Loop[_charaId].Length > 0) + return OpenTaiko.Tx.Characters_Menu_Loop[_charaId]; + if (OpenTaiko.Tx.Characters_Normal[_charaId].Length > 0) + return OpenTaiko.Tx.Characters_Normal[_charaId]; + break; + } + case (ECharacterAnimation.START): { + if (OpenTaiko.Tx.Characters_Menu_Start[_charaId].Length > 0) + return OpenTaiko.Tx.Characters_Menu_Start[_charaId]; + if (OpenTaiko.Tx.Characters_10Combo[_charaId].Length > 0) + return OpenTaiko.Tx.Characters_10Combo[_charaId]; + break; + } + case (ECharacterAnimation.SELECT): { + if (OpenTaiko.Tx.Characters_Menu_Select[_charaId].Length > 0) + return OpenTaiko.Tx.Characters_Menu_Select[_charaId]; + if (OpenTaiko.Tx.Characters_10Combo[_charaId].Length > 0) + return OpenTaiko.Tx.Characters_10Combo[_charaId]; + break; + } + case (ECharacterAnimation.WAIT): { + if (OpenTaiko.Tx.Characters_Menu_Wait[_charaId].Length > 0) + return OpenTaiko.Tx.Characters_Menu_Wait[_charaId]; + if (OpenTaiko.Tx.Characters_Menu_Loop[_charaId].Length > 0) + return OpenTaiko.Tx.Characters_Menu_Loop[_charaId]; + if (OpenTaiko.Tx.Characters_GoGoTime[_charaId].Length > 0) + return OpenTaiko.Tx.Characters_GoGoTime[_charaId]; + break; + } + case (ECharacterAnimation.ENTRY): { + if (OpenTaiko.Tx.Characters_Title_Entry[_charaId].Length > 0) + return OpenTaiko.Tx.Characters_Title_Entry[_charaId]; + if (OpenTaiko.Tx.Characters_10Combo[_charaId].Length > 0) + return OpenTaiko.Tx.Characters_10Combo[_charaId]; + break; + } + case (ECharacterAnimation.ENTRY_NORMAL): { + if (OpenTaiko.Tx.Characters_Title_Normal[_charaId].Length > 0) + return OpenTaiko.Tx.Characters_Title_Normal[_charaId]; + if (OpenTaiko.Tx.Characters_Normal[_charaId].Length > 0) + return OpenTaiko.Tx.Characters_Normal[_charaId]; + break; + } } } - public static void tMenuResetTimer(ECharacterAnimation eca) { - for (int i = 0; i < 5; i++) { - tMenuResetTimer(i, eca); - } - } - public static void tMenuDisplayCharacter(int player, int x, int y, ECharacterAnimation eca, int opacity = 255) { - int _charaId = OpenTaiko.SaveFileInstances[OpenTaiko.GetActualPlayer(player)].data.Character; - CTexture[] _ref = _getReferenceArray(player, eca); - CCounter[] _ctref = _getReferenceCounter(eca); - bool _substitute = _usesSubstituteTexture(player, eca); + return null; + } - if (_ctref[player] != null && _ref != null && _ctref[player].CurrentValue < _ref.Length) { - if (eca == ECharacterAnimation.NORMAL - || eca == ECharacterAnimation.WAIT - || eca == ECharacterAnimation.ENTRY - || eca == ECharacterAnimation.ENTRY_NORMAL) - _ctref[player].TickLoop(); - else - _ctref[player].Tick(); - - // Quick fix - if (_ctref[player].CurrentValue >= _ref.Length) return; - - var _tex = _ref[_ctref[player].CurrentValue]; - - _tex.Opacity = opacity; - - float resolutionRatioX = OpenTaiko.Skin.Resolution[0] / (float)OpenTaiko.Skin.Characters_Resolution[_charaId][0]; - float resolutionRatioY = OpenTaiko.Skin.Resolution[1] / (float)OpenTaiko.Skin.Characters_Resolution[_charaId][1]; - - _tex.vcScaleRatio.X *= resolutionRatioX; - _tex.vcScaleRatio.Y *= resolutionRatioY; - - float _x = x; - float _y = y; - - if (player % 2 == 0) { - _tex.t2D拡大率考慮下中心基準描画( - _x, - _y // 312 - ); - } else { - _tex.t2D拡大率考慮下中心基準描画Mirrored( - _x, - _y // 312 - ); + public static CCounter[] _getReferenceCounter(ECharacterAnimation eca) { + switch (eca) { + case (ECharacterAnimation.NORMAL): { + return ctCharacterNormal; } + case (ECharacterAnimation.START): { + return ctCharacterStart; + } + case (ECharacterAnimation.SELECT): { + return ctCharacterSelect; + } + case (ECharacterAnimation.WAIT): { + return ctCharacterWait; + } + case (ECharacterAnimation.ENTRY): { + return ctCharacterEntry; + } + case (ECharacterAnimation.ENTRY_NORMAL): { + return ctCharacterEntryNormal; + } + } + return null; + } - _tex.vcScaleRatio.X = 1f; - _tex.vcScaleRatio.Y = 1f; - _tex.Opacity = 255; + public static int _getReferenceAnimationDuration(int player, ECharacterAnimation eca) { + int _charaId = OpenTaiko.SaveFileInstances[OpenTaiko.GetActualPlayer(player)].data.Character; + + switch (eca) { + case (ECharacterAnimation.NORMAL): { + return OpenTaiko.Skin.Characters_Menu_Loop_AnimationDuration[_charaId]; + } + case (ECharacterAnimation.START): { + return OpenTaiko.Skin.Characters_Menu_Start_AnimationDuration[_charaId]; + } + case (ECharacterAnimation.SELECT): { + return OpenTaiko.Skin.Characters_Menu_Select_AnimationDuration[_charaId]; + } + case (ECharacterAnimation.WAIT): { + return OpenTaiko.Skin.Characters_Menu_Wait_AnimationDuration[_charaId]; + } + case (ECharacterAnimation.ENTRY): { + return OpenTaiko.Skin.Characters_Title_Entry_AnimationDuration[_charaId]; + } + case (ECharacterAnimation.ENTRY_NORMAL): { + return OpenTaiko.Skin.Characters_Title_Normal_AnimationDuration[_charaId]; + } + } + return 1000; + } + + public static void tDisableCounter(ECharacterAnimation eca) { + switch (eca) { + case (ECharacterAnimation.NORMAL): { + for (int i = 0; i < 5; i++) + ctCharacterNormal[i] = new CCounter(); + break; + } + case (ECharacterAnimation.START): { + for (int i = 0; i < 5; i++) + ctCharacterStart[i] = new CCounter(); + break; + } + case (ECharacterAnimation.SELECT): { + for (int i = 0; i < 5; i++) + ctCharacterSelect[i] = new CCounter(); + break; + } + case (ECharacterAnimation.WAIT): { + for (int i = 0; i < 5; i++) + ctCharacterWait[i] = new CCounter(); + break; + } + case (ECharacterAnimation.ENTRY): { + for (int i = 0; i < 5; i++) + ctCharacterEntry[i] = new CCounter(); + break; + } + case (ECharacterAnimation.ENTRY_NORMAL): { + for (int i = 0; i < 5; i++) + ctCharacterEntryNormal[i] = new CCounter(); + break; + } + } + + } + + + public static void tMenuResetTimer(int player, ECharacterAnimation eca) { + CTexture[] _ref = _getReferenceArray(player, eca); + CCounter[] _ctref = _getReferenceCounter(eca); + int _animeref = _getReferenceAnimationDuration(player, eca); + + if (_ref != null && _ref.Length > 0 && _ctref != null) { + _ctref[player] = new CCounter(0, _ref.Length - 1, _animeref / (float)_ref.Length, OpenTaiko.Timer); + } + } + + public static void tMenuResetTimer(ECharacterAnimation eca) { + for (int i = 0; i < 5; i++) { + tMenuResetTimer(i, eca); + } + } + + public static void tMenuDisplayCharacter(int player, int x, int y, ECharacterAnimation eca, int opacity = 255) { + int _charaId = OpenTaiko.SaveFileInstances[OpenTaiko.GetActualPlayer(player)].data.Character; + CTexture[] _ref = _getReferenceArray(player, eca); + CCounter[] _ctref = _getReferenceCounter(eca); + bool _substitute = _usesSubstituteTexture(player, eca); + + if (_ctref[player] != null && _ref != null && _ctref[player].CurrentValue < _ref.Length) { + if (eca == ECharacterAnimation.NORMAL + || eca == ECharacterAnimation.WAIT + || eca == ECharacterAnimation.ENTRY + || eca == ECharacterAnimation.ENTRY_NORMAL) + _ctref[player].TickLoop(); + else + _ctref[player].Tick(); + + // Quick fix + if (_ctref[player].CurrentValue >= _ref.Length) return; + + var _tex = _ref[_ctref[player].CurrentValue]; + + _tex.Opacity = opacity; + + float resolutionRatioX = OpenTaiko.Skin.Resolution[0] / (float)OpenTaiko.Skin.Characters_Resolution[_charaId][0]; + float resolutionRatioY = OpenTaiko.Skin.Resolution[1] / (float)OpenTaiko.Skin.Characters_Resolution[_charaId][1]; + + _tex.vcScaleRatio.X *= resolutionRatioX; + _tex.vcScaleRatio.Y *= resolutionRatioY; + + float _x = x; + float _y = y; + + if (player % 2 == 0) { + _tex.t2D拡大率考慮下中心基準描画( + _x, + _y // 312 + ); + } else { + _tex.t2D拡大率考慮下中心基準描画Mirrored( + _x, + _y // 312 + ); } + + _tex.vcScaleRatio.X = 1f; + _tex.vcScaleRatio.Y = 1f; + _tex.Opacity = 255; } } } diff --git a/OpenTaiko/src/Character/CResultCharacter.cs b/OpenTaiko/src/Character/CResultCharacter.cs index 62e9a03e..f3a9675d 100644 --- a/OpenTaiko/src/Character/CResultCharacter.cs +++ b/OpenTaiko/src/Character/CResultCharacter.cs @@ -1,234 +1,234 @@ using FDK; -namespace OpenTaiko { - class CResultCharacter { - private static CCounter[] ctCharacterNormal = new CCounter[5] { new CCounter(), new CCounter(), new CCounter(), new CCounter(), new CCounter() }; - private static CCounter[] ctCharacterClear = new CCounter[5] { new CCounter(), new CCounter(), new CCounter(), new CCounter(), new CCounter() }; - private static CCounter[] ctCharacterFailed = new CCounter[5] { new CCounter(), new CCounter(), new CCounter(), new CCounter(), new CCounter() }; - private static CCounter[] ctCharacterFailedIn = new CCounter[5] { new CCounter(), new CCounter(), new CCounter(), new CCounter(), new CCounter() }; +namespace OpenTaiko; - public enum ECharacterResult { - // Song select - NORMAL, - CLEAR, - FAILED, - FAILED_IN, - } +class CResultCharacter { + private static CCounter[] ctCharacterNormal = new CCounter[5] { new CCounter(), new CCounter(), new CCounter(), new CCounter(), new CCounter() }; + private static CCounter[] ctCharacterClear = new CCounter[5] { new CCounter(), new CCounter(), new CCounter(), new CCounter(), new CCounter() }; + private static CCounter[] ctCharacterFailed = new CCounter[5] { new CCounter(), new CCounter(), new CCounter(), new CCounter(), new CCounter() }; + private static CCounter[] ctCharacterFailedIn = new CCounter[5] { new CCounter(), new CCounter(), new CCounter(), new CCounter(), new CCounter() }; - public static bool tIsCounterProcessing(int player, ECharacterResult eca) { - CCounter[] _ctref = _getReferenceCounter(eca); + public enum ECharacterResult { + // Song select + NORMAL, + CLEAR, + FAILED, + FAILED_IN, + } - if (_ctref[player] != null) - return _ctref[player].IsTicked; - return false; - } + public static bool tIsCounterProcessing(int player, ECharacterResult eca) { + CCounter[] _ctref = _getReferenceCounter(eca); - public static bool tIsCounterEnded(int player, ECharacterResult eca) { - CCounter[] _ctref = _getReferenceCounter(eca); + if (_ctref[player] != null) + return _ctref[player].IsTicked; + return false; + } - if (_ctref[player] != null) - return _ctref[player].IsEnded; - return false; - } + public static bool tIsCounterEnded(int player, ECharacterResult eca) { + CCounter[] _ctref = _getReferenceCounter(eca); - private static bool _usesSubstituteTexture(int player, ECharacterResult eca) { - int _charaId = OpenTaiko.SaveFileInstances[OpenTaiko.GetActualPlayer(player)].data.Character; + if (_ctref[player] != null) + return _ctref[player].IsEnded; + return false; + } - if (_charaId >= 0 && _charaId < OpenTaiko.Skin.Characters_Ptn) { - switch (eca) { - case (ECharacterResult.NORMAL): { - if (OpenTaiko.Tx.Characters_Result_Normal[_charaId].Length > 0) - return false; - break; - } - case (ECharacterResult.CLEAR): { - if (OpenTaiko.Tx.Characters_Result_Clear[_charaId].Length > 0) - return false; - break; - } - case (ECharacterResult.FAILED): { - if (OpenTaiko.Tx.Characters_Result_Failed[_charaId].Length > 0) - return false; - break; - } - case (ECharacterResult.FAILED_IN): { - if (OpenTaiko.Tx.Characters_Result_Failed_In[_charaId].Length > 0) - return false; - break; - } - } - } + private static bool _usesSubstituteTexture(int player, ECharacterResult eca) { + int _charaId = OpenTaiko.SaveFileInstances[OpenTaiko.GetActualPlayer(player)].data.Character; - return true; - } - - public static CTexture[] _getReferenceArray(int player, ECharacterResult eca) { - int _charaId = OpenTaiko.SaveFileInstances[OpenTaiko.GetActualPlayer(player)].data.Character; - - if (_charaId >= 0 && _charaId < OpenTaiko.Skin.Characters_Ptn) { - switch (eca) { - case (ECharacterResult.NORMAL): { - if (OpenTaiko.Tx.Characters_Result_Normal[_charaId].Length > 0) - return OpenTaiko.Tx.Characters_Result_Normal[_charaId]; - if (OpenTaiko.Tx.Characters_Normal[_charaId].Length > 0) - return OpenTaiko.Tx.Characters_Normal[_charaId]; - break; - } - case (ECharacterResult.CLEAR): { - if (OpenTaiko.Tx.Characters_Result_Clear[_charaId].Length > 0) - return OpenTaiko.Tx.Characters_Result_Clear[_charaId]; - if (OpenTaiko.Tx.Characters_10Combo[_charaId].Length > 0) - return OpenTaiko.Tx.Characters_10Combo[_charaId]; - break; - } - case (ECharacterResult.FAILED): { - if (OpenTaiko.Tx.Characters_Result_Failed[_charaId].Length > 0) - return OpenTaiko.Tx.Characters_Result_Failed[_charaId]; - if (OpenTaiko.Tx.Characters_Normal[_charaId].Length > 0) - return OpenTaiko.Tx.Characters_Normal[_charaId]; - break; - } - case (ECharacterResult.FAILED_IN): { - if (OpenTaiko.Tx.Characters_Result_Failed_In[_charaId].Length > 0) - return OpenTaiko.Tx.Characters_Result_Failed_In[_charaId]; - if (OpenTaiko.Tx.Characters_Normal[_charaId].Length > 0) - return OpenTaiko.Tx.Characters_Normal[_charaId]; - break; - } - } - } - - - return null; - } - - public static CCounter[] _getReferenceCounter(ECharacterResult eca) { + if (_charaId >= 0 && _charaId < OpenTaiko.Skin.Characters_Ptn) { switch (eca) { case (ECharacterResult.NORMAL): { - return ctCharacterNormal; - } - case (ECharacterResult.CLEAR): { - return ctCharacterClear; - } - case (ECharacterResult.FAILED): { - return ctCharacterFailed; - } - case (ECharacterResult.FAILED_IN): { - return ctCharacterFailedIn; - } - } - return null; - } - - public static int _getReferenceAnimationDuration(int player, ECharacterResult eca) { - int _charaId = OpenTaiko.SaveFileInstances[OpenTaiko.GetActualPlayer(player)].data.Character; - - switch (eca) { - case (ECharacterResult.NORMAL): { - return OpenTaiko.Skin.Characters_Result_Normal_AnimationDuration[_charaId]; - } - case (ECharacterResult.CLEAR): { - return OpenTaiko.Skin.Characters_Result_Clear_AnimationDuration[_charaId]; - } - case (ECharacterResult.FAILED): { - return OpenTaiko.Skin.Characters_Result_Failed_AnimationDuration[_charaId]; - } - case (ECharacterResult.FAILED_IN): { - return OpenTaiko.Skin.Characters_Result_Failed_In_AnimationDuration[_charaId]; - } - } - return 1000; - } - - public static void tDisableCounter(ECharacterResult eca) { - switch (eca) { - case (ECharacterResult.NORMAL): { - for (int i = 0; i < 5; i++) - ctCharacterNormal[i] = new CCounter(); + if (OpenTaiko.Tx.Characters_Result_Normal[_charaId].Length > 0) + return false; break; } case (ECharacterResult.CLEAR): { - for (int i = 0; i < 5; i++) - ctCharacterClear[i] = new CCounter(); + if (OpenTaiko.Tx.Characters_Result_Clear[_charaId].Length > 0) + return false; break; } case (ECharacterResult.FAILED): { - for (int i = 0; i < 5; i++) - ctCharacterFailed[i] = new CCounter(); + if (OpenTaiko.Tx.Characters_Result_Failed[_charaId].Length > 0) + return false; break; } case (ECharacterResult.FAILED_IN): { - for (int i = 0; i < 5; i++) - ctCharacterFailedIn[i] = new CCounter(); + if (OpenTaiko.Tx.Characters_Result_Failed_In[_charaId].Length > 0) + return false; break; } } - } + return true; + } - public static void tMenuResetTimer(int player, ECharacterResult eca) { - CTexture[] _ref = _getReferenceArray(player, eca); - CCounter[] _ctref = _getReferenceCounter(eca); - int _animeref = _getReferenceAnimationDuration(player, eca); + public static CTexture[] _getReferenceArray(int player, ECharacterResult eca) { + int _charaId = OpenTaiko.SaveFileInstances[OpenTaiko.GetActualPlayer(player)].data.Character; - if (_ref != null && _ref.Length > 0 && _ctref != null) { - _ctref[player] = new CCounter(0, _ref.Length - 1, _animeref / (float)_ref.Length, OpenTaiko.Timer); + if (_charaId >= 0 && _charaId < OpenTaiko.Skin.Characters_Ptn) { + switch (eca) { + case (ECharacterResult.NORMAL): { + if (OpenTaiko.Tx.Characters_Result_Normal[_charaId].Length > 0) + return OpenTaiko.Tx.Characters_Result_Normal[_charaId]; + if (OpenTaiko.Tx.Characters_Normal[_charaId].Length > 0) + return OpenTaiko.Tx.Characters_Normal[_charaId]; + break; + } + case (ECharacterResult.CLEAR): { + if (OpenTaiko.Tx.Characters_Result_Clear[_charaId].Length > 0) + return OpenTaiko.Tx.Characters_Result_Clear[_charaId]; + if (OpenTaiko.Tx.Characters_10Combo[_charaId].Length > 0) + return OpenTaiko.Tx.Characters_10Combo[_charaId]; + break; + } + case (ECharacterResult.FAILED): { + if (OpenTaiko.Tx.Characters_Result_Failed[_charaId].Length > 0) + return OpenTaiko.Tx.Characters_Result_Failed[_charaId]; + if (OpenTaiko.Tx.Characters_Normal[_charaId].Length > 0) + return OpenTaiko.Tx.Characters_Normal[_charaId]; + break; + } + case (ECharacterResult.FAILED_IN): { + if (OpenTaiko.Tx.Characters_Result_Failed_In[_charaId].Length > 0) + return OpenTaiko.Tx.Characters_Result_Failed_In[_charaId]; + if (OpenTaiko.Tx.Characters_Normal[_charaId].Length > 0) + return OpenTaiko.Tx.Characters_Normal[_charaId]; + break; + } } } - public static void tMenuResetTimer(ECharacterResult eca) { - for (int i = 0; i < 5; i++) { - tMenuResetTimer(i, eca); - } - } - public static void tMenuDisplayCharacter(int player, int x, int y, ECharacterResult eca, int pos = 0, int opacity = 255) { - int _charaId = OpenTaiko.SaveFileInstances[OpenTaiko.GetActualPlayer(player)].data.Character; - CTexture[] _ref = _getReferenceArray(player, eca); - CCounter[] _ctref = _getReferenceCounter(eca); - bool _substitute = _usesSubstituteTexture(player, eca); + return null; + } - if (_ctref[player] != null && _ref != null && _ctref[player].CurrentValue < _ref.Length) { - if (eca == ECharacterResult.NORMAL - || eca == ECharacterResult.CLEAR - || eca == ECharacterResult.FAILED) - _ctref[player].TickLoop(); - else - _ctref[player].Tick(); - - // Quick fix - if (_ctref[player].CurrentValue >= _ref.Length) return; - - var _tex = _ref[_ctref[player].CurrentValue]; - - _tex.Opacity = opacity; - - float resolutionRatioX = OpenTaiko.Skin.Resolution[0] / (float)OpenTaiko.Skin.Characters_Resolution[_charaId][0]; - float resolutionRatioY = OpenTaiko.Skin.Resolution[1] / (float)OpenTaiko.Skin.Characters_Resolution[_charaId][1]; - - float _x = x; - float _y = y; - - _tex.vcScaleRatio.X *= resolutionRatioX; - _tex.vcScaleRatio.Y *= resolutionRatioY; - - if (pos % 2 == 0 || OpenTaiko.ConfigIni.nPlayerCount > 2) { - _tex.t2D拡大率考慮下中心基準描画( - _x, - _y - ); - } else { - _tex.t2D拡大率考慮下中心基準描画Mirrored( - _x, - _y - ); + public static CCounter[] _getReferenceCounter(ECharacterResult eca) { + switch (eca) { + case (ECharacterResult.NORMAL): { + return ctCharacterNormal; } + case (ECharacterResult.CLEAR): { + return ctCharacterClear; + } + case (ECharacterResult.FAILED): { + return ctCharacterFailed; + } + case (ECharacterResult.FAILED_IN): { + return ctCharacterFailedIn; + } + } + return null; + } - _tex.vcScaleRatio.X = 1f; - _tex.vcScaleRatio.Y = 1f; - _tex.Opacity = 255; + public static int _getReferenceAnimationDuration(int player, ECharacterResult eca) { + int _charaId = OpenTaiko.SaveFileInstances[OpenTaiko.GetActualPlayer(player)].data.Character; + + switch (eca) { + case (ECharacterResult.NORMAL): { + return OpenTaiko.Skin.Characters_Result_Normal_AnimationDuration[_charaId]; + } + case (ECharacterResult.CLEAR): { + return OpenTaiko.Skin.Characters_Result_Clear_AnimationDuration[_charaId]; + } + case (ECharacterResult.FAILED): { + return OpenTaiko.Skin.Characters_Result_Failed_AnimationDuration[_charaId]; + } + case (ECharacterResult.FAILED_IN): { + return OpenTaiko.Skin.Characters_Result_Failed_In_AnimationDuration[_charaId]; + } + } + return 1000; + } + + public static void tDisableCounter(ECharacterResult eca) { + switch (eca) { + case (ECharacterResult.NORMAL): { + for (int i = 0; i < 5; i++) + ctCharacterNormal[i] = new CCounter(); + break; + } + case (ECharacterResult.CLEAR): { + for (int i = 0; i < 5; i++) + ctCharacterClear[i] = new CCounter(); + break; + } + case (ECharacterResult.FAILED): { + for (int i = 0; i < 5; i++) + ctCharacterFailed[i] = new CCounter(); + break; + } + case (ECharacterResult.FAILED_IN): { + for (int i = 0; i < 5; i++) + ctCharacterFailedIn[i] = new CCounter(); + break; + } + } + + } + + + public static void tMenuResetTimer(int player, ECharacterResult eca) { + CTexture[] _ref = _getReferenceArray(player, eca); + CCounter[] _ctref = _getReferenceCounter(eca); + int _animeref = _getReferenceAnimationDuration(player, eca); + + if (_ref != null && _ref.Length > 0 && _ctref != null) { + _ctref[player] = new CCounter(0, _ref.Length - 1, _animeref / (float)_ref.Length, OpenTaiko.Timer); + } + } + + public static void tMenuResetTimer(ECharacterResult eca) { + for (int i = 0; i < 5; i++) { + tMenuResetTimer(i, eca); + } + } + + public static void tMenuDisplayCharacter(int player, int x, int y, ECharacterResult eca, int pos = 0, int opacity = 255) { + int _charaId = OpenTaiko.SaveFileInstances[OpenTaiko.GetActualPlayer(player)].data.Character; + CTexture[] _ref = _getReferenceArray(player, eca); + CCounter[] _ctref = _getReferenceCounter(eca); + bool _substitute = _usesSubstituteTexture(player, eca); + + if (_ctref[player] != null && _ref != null && _ctref[player].CurrentValue < _ref.Length) { + if (eca == ECharacterResult.NORMAL + || eca == ECharacterResult.CLEAR + || eca == ECharacterResult.FAILED) + _ctref[player].TickLoop(); + else + _ctref[player].Tick(); + + // Quick fix + if (_ctref[player].CurrentValue >= _ref.Length) return; + + var _tex = _ref[_ctref[player].CurrentValue]; + + _tex.Opacity = opacity; + + float resolutionRatioX = OpenTaiko.Skin.Resolution[0] / (float)OpenTaiko.Skin.Characters_Resolution[_charaId][0]; + float resolutionRatioY = OpenTaiko.Skin.Resolution[1] / (float)OpenTaiko.Skin.Characters_Resolution[_charaId][1]; + + float _x = x; + float _y = y; + + _tex.vcScaleRatio.X *= resolutionRatioX; + _tex.vcScaleRatio.Y *= resolutionRatioY; + + if (pos % 2 == 0 || OpenTaiko.ConfigIni.nPlayerCount > 2) { + _tex.t2D拡大率考慮下中心基準描画( + _x, + _y + ); + } else { + _tex.t2D拡大率考慮下中心基準描画Mirrored( + _x, + _y + ); } + + _tex.vcScaleRatio.X = 1f; + _tex.vcScaleRatio.Y = 1f; + _tex.Opacity = 255; } } } diff --git a/OpenTaiko/src/Character/PuchiChara.cs b/OpenTaiko/src/Character/PuchiChara.cs index 59710af2..f999bdf3 100644 --- a/OpenTaiko/src/Character/PuchiChara.cs +++ b/OpenTaiko/src/Character/PuchiChara.cs @@ -2,99 +2,99 @@ using Silk.NET.Maths; using Rectangle = System.Drawing.Rectangle; -namespace OpenTaiko { - class PuchiChara : CActivity { - public PuchiChara() { - base.IsDeActivated = true; - } +namespace OpenTaiko; - public override void Activate() { - Counter = new CCounter(0, OpenTaiko.Skin.Game_PuchiChara[2] - 1, OpenTaiko.Skin.Game_PuchiChara_Timer * 0.5f, OpenTaiko.Timer); - SineCounter = new CCounter(0, 360, OpenTaiko.Skin.Game_PuchiChara_SineTimer, SoundManager.PlayTimer); - SineCounterIdle = new CCounter(1, 360, (float)OpenTaiko.Skin.Game_PuchiChara_SineTimer * 2f, OpenTaiko.Timer); - this.inGame = false; - base.Activate(); - } - public override void DeActivate() { - Counter = null; - SineCounter = null; - SineCounterIdle = null; - base.DeActivate(); - } - - public static int tGetPuchiCharaIndexByName(int p) { - var _pc = OpenTaiko.SaveFileInstances[p].data.PuchiChara; - var _pcs = OpenTaiko.Skin.Puchicharas_Name; - int puriChar = 0; - if (_pcs.Contains(_pc)) - puriChar = _pcs.ToList().IndexOf(_pc); - - return puriChar; - } - - public void ChangeBPM(double bpm) { - Counter = new CCounter(0, OpenTaiko.Skin.Game_PuchiChara[2] - 1, (int)(OpenTaiko.Skin.Game_PuchiChara_Timer * bpm / OpenTaiko.Skin.Game_PuchiChara[2]), OpenTaiko.Timer); - SineCounter = new CCounter(1, 360, OpenTaiko.Skin.Game_PuchiChara_SineTimer * bpm / 180, SoundManager.PlayTimer); - this.inGame = true; - } - - public void IdleAnimation() { - this.inGame = false; - } - - /// - /// Draws Puchi Chara (small character) on the screen. Note: this is not an override. - /// - /// X coordinate (center) - /// Y coordinate (center) - /// Opacity (0-255) - /// - public int On進行描画(int x, int y, bool isGrowing, int alpha = 255, bool isBalloon = false, int player = 0, float scale = 1.0f) { - if (!OpenTaiko.ConfigIni.ShowPuchiChara) return base.Draw(); - if (Counter == null || SineCounter == null || OpenTaiko.Tx.Puchichara == null) return base.Draw(); - Counter.TickLoop(); - SineCounter.TickLoopDB(); - SineCounterIdle.TickLoop(); - - int p = OpenTaiko.GetActualPlayer(player); - - if (inGame) - sineY = (double)SineCounter.CurrentValue; - else - sineY = (double)SineCounterIdle.CurrentValue; - - sineY = Math.Sin(sineY * (Math.PI / 180)) * (OpenTaiko.Skin.Game_PuchiChara_Sine * (isBalloon ? OpenTaiko.Skin.Game_PuchiChara_Scale[1] : OpenTaiko.Skin.Game_PuchiChara_Scale[0])); - - int puriChar = PuchiChara.tGetPuchiCharaIndexByName(p); - var chara = OpenTaiko.Tx.Puchichara[puriChar].tx; - - if (chara != null) { - float puchiScale = OpenTaiko.Skin.Resolution[1] / 720.0f; - - chara.vcScaleRatio = new Vector3D((isBalloon ? OpenTaiko.Skin.Game_PuchiChara_Scale[1] * puchiScale : OpenTaiko.Skin.Game_PuchiChara_Scale[0] * puchiScale)); - chara.vcScaleRatio.X *= scale; - chara.vcScaleRatio.Y *= scale; - chara.Opacity = alpha; - - /* Todo : - ** - ** - Yellow light color filter when isGrowing is true - */ - - int adjustedX = x - 32; - int adjustedY = y - 32; - - chara.t2D拡大率考慮中央基準描画(adjustedX, adjustedY + (int)sineY, new Rectangle((Counter.CurrentValue + 2) * OpenTaiko.Skin.Game_PuchiChara[0], 0, OpenTaiko.Skin.Game_PuchiChara[0], OpenTaiko.Skin.Game_PuchiChara[1])); - } - - return base.Draw(); - } - - public double sineY; - - public CCounter Counter; - private CCounter SineCounter; - private CCounter SineCounterIdle; - private bool inGame; +class PuchiChara : CActivity { + public PuchiChara() { + base.IsDeActivated = true; } + + public override void Activate() { + Counter = new CCounter(0, OpenTaiko.Skin.Game_PuchiChara[2] - 1, OpenTaiko.Skin.Game_PuchiChara_Timer * 0.5f, OpenTaiko.Timer); + SineCounter = new CCounter(0, 360, OpenTaiko.Skin.Game_PuchiChara_SineTimer, SoundManager.PlayTimer); + SineCounterIdle = new CCounter(1, 360, (float)OpenTaiko.Skin.Game_PuchiChara_SineTimer * 2f, OpenTaiko.Timer); + this.inGame = false; + base.Activate(); + } + public override void DeActivate() { + Counter = null; + SineCounter = null; + SineCounterIdle = null; + base.DeActivate(); + } + + public static int tGetPuchiCharaIndexByName(int p) { + var _pc = OpenTaiko.SaveFileInstances[p].data.PuchiChara; + var _pcs = OpenTaiko.Skin.Puchicharas_Name; + int puriChar = 0; + if (_pcs.Contains(_pc)) + puriChar = _pcs.ToList().IndexOf(_pc); + + return puriChar; + } + + public void ChangeBPM(double bpm) { + Counter = new CCounter(0, OpenTaiko.Skin.Game_PuchiChara[2] - 1, (int)(OpenTaiko.Skin.Game_PuchiChara_Timer * bpm / OpenTaiko.Skin.Game_PuchiChara[2]), OpenTaiko.Timer); + SineCounter = new CCounter(1, 360, OpenTaiko.Skin.Game_PuchiChara_SineTimer * bpm / 180, SoundManager.PlayTimer); + this.inGame = true; + } + + public void IdleAnimation() { + this.inGame = false; + } + + /// + /// Draws Puchi Chara (small character) on the screen. Note: this is not an override. + /// + /// X coordinate (center) + /// Y coordinate (center) + /// Opacity (0-255) + /// + public int On進行描画(int x, int y, bool isGrowing, int alpha = 255, bool isBalloon = false, int player = 0, float scale = 1.0f) { + if (!OpenTaiko.ConfigIni.ShowPuchiChara) return base.Draw(); + if (Counter == null || SineCounter == null || OpenTaiko.Tx.Puchichara == null) return base.Draw(); + Counter.TickLoop(); + SineCounter.TickLoopDB(); + SineCounterIdle.TickLoop(); + + int p = OpenTaiko.GetActualPlayer(player); + + if (inGame) + sineY = (double)SineCounter.CurrentValue; + else + sineY = (double)SineCounterIdle.CurrentValue; + + sineY = Math.Sin(sineY * (Math.PI / 180)) * (OpenTaiko.Skin.Game_PuchiChara_Sine * (isBalloon ? OpenTaiko.Skin.Game_PuchiChara_Scale[1] : OpenTaiko.Skin.Game_PuchiChara_Scale[0])); + + int puriChar = PuchiChara.tGetPuchiCharaIndexByName(p); + var chara = OpenTaiko.Tx.Puchichara[puriChar].tx; + + if (chara != null) { + float puchiScale = OpenTaiko.Skin.Resolution[1] / 720.0f; + + chara.vcScaleRatio = new Vector3D((isBalloon ? OpenTaiko.Skin.Game_PuchiChara_Scale[1] * puchiScale : OpenTaiko.Skin.Game_PuchiChara_Scale[0] * puchiScale)); + chara.vcScaleRatio.X *= scale; + chara.vcScaleRatio.Y *= scale; + chara.Opacity = alpha; + + /* Todo : + ** + ** - Yellow light color filter when isGrowing is true + */ + + int adjustedX = x - 32; + int adjustedY = y - 32; + + chara.t2D拡大率考慮中央基準描画(adjustedX, adjustedY + (int)sineY, new Rectangle((Counter.CurrentValue + 2) * OpenTaiko.Skin.Game_PuchiChara[0], 0, OpenTaiko.Skin.Game_PuchiChara[0], OpenTaiko.Skin.Game_PuchiChara[1])); + } + + return base.Draw(); + } + + public double sineY; + + public CCounter Counter; + private CCounter SineCounter; + private CCounter SineCounterIdle; + private bool inGame; } diff --git a/OpenTaiko/src/Common/BestPlayRecords.cs b/OpenTaiko/src/Common/BestPlayRecords.cs index 6475e0c2..419b8c64 100644 --- a/OpenTaiko/src/Common/BestPlayRecords.cs +++ b/OpenTaiko/src/Common/BestPlayRecords.cs @@ -1,198 +1,198 @@ -namespace OpenTaiko { - internal class BestPlayRecords { +namespace OpenTaiko; - public enum EClearStatus { - NONE = 0, - ASSISTED_CLEAR = 1, - CLEAR = 2, - FC = 3, - PERFECT = 4, - TOTAL = 5 - } +internal class BestPlayRecords { - public enum EDanClearStatus { - NONE = 0, - ASSISTED_CLEAR_RED = 1, - ASSISTED_CLEAR_GOLD = 2, - CLEAR_RED = 3, - CLEAR_GOLD = 4, - FC_RED = 5, - FC_GOLD = 6, - PERFECT_RED = 7, - PERFECT_GOLD = 8, - TOTAL = 9 - } + public enum EClearStatus { + NONE = 0, + ASSISTED_CLEAR = 1, + CLEAR = 2, + FC = 3, + PERFECT = 4, + TOTAL = 5 + } - public enum ETowerClearStatus { - NONE = 0, - ASSISTED_CLEAR = 1, - PROGRESS_10 = 2, - PROGRESS_25 = 3, - PROGRESS_50 = 4, - PROGRESS_75 = 5, - CLEAR = 6, - FC = 7, - PERFECT = 8, - TOTAL = 9 - } + public enum EDanClearStatus { + NONE = 0, + ASSISTED_CLEAR_RED = 1, + ASSISTED_CLEAR_GOLD = 2, + CLEAR_RED = 3, + CLEAR_GOLD = 4, + FC_RED = 5, + FC_GOLD = 6, + PERFECT_RED = 7, + PERFECT_GOLD = 8, + TOTAL = 9 + } - public class CSongSelectTableEntry { - public int ScoreRankDifficulty = 0; - public int ScoreRank = -1; - public int ClearStatusDifficulty = 0; - public int ClearStatus = -1; - public int TowerReachedFloor = 0; - public int[] ClearStatuses = new int[(int)Difficulty.Total] { 0, 0, 0, 0, 0, 0, 0 }; - public int[] ScoreRanks = new int[(int)Difficulty.Total] { 0, 0, 0, 0, 0, 0, 0 }; - public int[] HighScore = new int[(int)Difficulty.Total] { 0, 0, 0, 0, 0, 0, 0 }; - } + public enum ETowerClearStatus { + NONE = 0, + ASSISTED_CLEAR = 1, + PROGRESS_10 = 2, + PROGRESS_25 = 3, + PROGRESS_50 = 4, + PROGRESS_75 = 5, + CLEAR = 6, + FC = 7, + PERFECT = 8, + TOTAL = 9 + } - public class CBestPlayRecord { - public string ChartUniqueId = "none"; - public string ChartGenre = "none"; - public string Charter = "none"; - public string Artist = "none"; - public Int64 PlayMods = 0; - public Int64 ChartDifficulty = 3; - public Int64 ChartLevel = 8; - public Int64 ClearStatus = -1; - public Int64 ScoreRank = -1; - public Int64 HighScore = 0; - public Int64 TowerBestFloor = 0; - public List DanExam1 = new List { -1 }; - public List DanExam2 = new List { -1 }; - public List DanExam3 = new List { -1 }; - public List DanExam4 = new List { -1 }; - public List DanExam5 = new List { -1 }; - public List DanExam6 = new List { -1 }; - public List DanExam7 = new List { -1 }; - public Int64 PlayCount = 1; - public Int64 HighScoreGoodCount = 0; - public Int64 HighScoreOkCount = 0; - public Int64 HighScoreBadCount = 0; - public Int64 HighScoreMaxCombo = 0; - public Int64 HighScoreRollCount = 0; - public Int64 HighScoreADLibCount = 0; - public Int64 HighScoreBoomCount = 0; - } + public class CSongSelectTableEntry { + public int ScoreRankDifficulty = 0; + public int ScoreRank = -1; + public int ClearStatusDifficulty = 0; + public int ClearStatus = -1; + public int TowerReachedFloor = 0; + public int[] ClearStatuses = new int[(int)Difficulty.Total] { 0, 0, 0, 0, 0, 0, 0 }; + public int[] ScoreRanks = new int[(int)Difficulty.Total] { 0, 0, 0, 0, 0, 0, 0 }; + public int[] HighScore = new int[(int)Difficulty.Total] { 0, 0, 0, 0, 0, 0, 0 }; + } - public class CBestPlayStats { - public int DistinctPlays = 0; - public int DistinctClears = 0; - public int DistinctFCs = 0; - public int DistinctPerfects = 0; - public int SongDistinctPlays = 0; - public int SongDistinctClears = 0; - public int SongDistinctFCs = 0; - public int SongDistinctPerfects = 0; - public int[][] ClearStatuses = new int[(int)Difficulty.Total][]; - public int[][] ScoreRanks = new int[(int)Difficulty.Total][]; - public Dictionary LevelPlays = new Dictionary(); - public Dictionary LevelClears = new Dictionary(); - public Dictionary LevelFCs = new Dictionary(); - public Dictionary LevelPerfects = new Dictionary(); - public Dictionary GenrePlays = new Dictionary(); - public Dictionary GenreClears = new Dictionary(); - public Dictionary GenreFCs = new Dictionary(); - public Dictionary GenrePerfects = new Dictionary(); - public Dictionary SongGenrePlays = new Dictionary(); - public Dictionary SongGenreClears = new Dictionary(); - public Dictionary SongGenreFCs = new Dictionary(); - public Dictionary SongGenrePerfects = new Dictionary(); - public Dictionary CharterPlays = new Dictionary(); - public Dictionary CharterClears = new Dictionary(); - public Dictionary CharterFCs = new Dictionary(); - public Dictionary CharterPerfects = new Dictionary(); + public class CBestPlayRecord { + public string ChartUniqueId = "none"; + public string ChartGenre = "none"; + public string Charter = "none"; + public string Artist = "none"; + public Int64 PlayMods = 0; + public Int64 ChartDifficulty = 3; + public Int64 ChartLevel = 8; + public Int64 ClearStatus = -1; + public Int64 ScoreRank = -1; + public Int64 HighScore = 0; + public Int64 TowerBestFloor = 0; + public List DanExam1 = new List { -1 }; + public List DanExam2 = new List { -1 }; + public List DanExam3 = new List { -1 }; + public List DanExam4 = new List { -1 }; + public List DanExam5 = new List { -1 }; + public List DanExam6 = new List { -1 }; + public List DanExam7 = new List { -1 }; + public Int64 PlayCount = 1; + public Int64 HighScoreGoodCount = 0; + public Int64 HighScoreOkCount = 0; + public Int64 HighScoreBadCount = 0; + public Int64 HighScoreMaxCombo = 0; + public Int64 HighScoreRollCount = 0; + public Int64 HighScoreADLibCount = 0; + public Int64 HighScoreBoomCount = 0; + } - public CBestPlayStats() { - // 0 : Not clear, 1 : Assisted clear, 2 : Clear, 3 : FC, 4 : Perfect - ClearStatuses[0] = new int[(int)EClearStatus.TOTAL] { 0, 0, 0, 0, 0 }; - ClearStatuses[1] = new int[(int)EClearStatus.TOTAL] { 0, 0, 0, 0, 0 }; - ClearStatuses[2] = new int[(int)EClearStatus.TOTAL] { 0, 0, 0, 0, 0 }; - ClearStatuses[3] = new int[(int)EClearStatus.TOTAL] { 0, 0, 0, 0, 0 }; - ClearStatuses[4] = new int[(int)EClearStatus.TOTAL] { 0, 0, 0, 0, 0 }; - ClearStatuses[5] = new int[(int)ETowerClearStatus.TOTAL] { 0, 0, 0, 0, 0, 0, 0, 0, 0 }; - ClearStatuses[6] = new int[(int)EDanClearStatus.TOTAL] { 0, 0, 0, 0, 0, 0, 0, 0, 0 }; + public class CBestPlayStats { + public int DistinctPlays = 0; + public int DistinctClears = 0; + public int DistinctFCs = 0; + public int DistinctPerfects = 0; + public int SongDistinctPlays = 0; + public int SongDistinctClears = 0; + public int SongDistinctFCs = 0; + public int SongDistinctPerfects = 0; + public int[][] ClearStatuses = new int[(int)Difficulty.Total][]; + public int[][] ScoreRanks = new int[(int)Difficulty.Total][]; + public Dictionary LevelPlays = new Dictionary(); + public Dictionary LevelClears = new Dictionary(); + public Dictionary LevelFCs = new Dictionary(); + public Dictionary LevelPerfects = new Dictionary(); + public Dictionary GenrePlays = new Dictionary(); + public Dictionary GenreClears = new Dictionary(); + public Dictionary GenreFCs = new Dictionary(); + public Dictionary GenrePerfects = new Dictionary(); + public Dictionary SongGenrePlays = new Dictionary(); + public Dictionary SongGenreClears = new Dictionary(); + public Dictionary SongGenreFCs = new Dictionary(); + public Dictionary SongGenrePerfects = new Dictionary(); + public Dictionary CharterPlays = new Dictionary(); + public Dictionary CharterClears = new Dictionary(); + public Dictionary CharterFCs = new Dictionary(); + public Dictionary CharterPerfects = new Dictionary(); - // 0 : None, 1 : E, 2 : D, 3 : C, 4 : B, 5 : A, 6 : S, 7 : Omega - ScoreRanks[0] = new int[8] { 0, 0, 0, 0, 0, 0, 0, 0 }; - ScoreRanks[1] = new int[8] { 0, 0, 0, 0, 0, 0, 0, 0 }; - ScoreRanks[2] = new int[8] { 0, 0, 0, 0, 0, 0, 0, 0 }; - ScoreRanks[3] = new int[8] { 0, 0, 0, 0, 0, 0, 0, 0 }; - ScoreRanks[4] = new int[8] { 0, 0, 0, 0, 0, 0, 0, 0 }; - } - } + public CBestPlayStats() { + // 0 : Not clear, 1 : Assisted clear, 2 : Clear, 3 : FC, 4 : Perfect + ClearStatuses[0] = new int[(int)EClearStatus.TOTAL] { 0, 0, 0, 0, 0 }; + ClearStatuses[1] = new int[(int)EClearStatus.TOTAL] { 0, 0, 0, 0, 0 }; + ClearStatuses[2] = new int[(int)EClearStatus.TOTAL] { 0, 0, 0, 0, 0 }; + ClearStatuses[3] = new int[(int)EClearStatus.TOTAL] { 0, 0, 0, 0, 0 }; + ClearStatuses[4] = new int[(int)EClearStatus.TOTAL] { 0, 0, 0, 0, 0 }; + ClearStatuses[5] = new int[(int)ETowerClearStatus.TOTAL] { 0, 0, 0, 0, 0, 0, 0, 0, 0 }; + ClearStatuses[6] = new int[(int)EDanClearStatus.TOTAL] { 0, 0, 0, 0, 0, 0, 0, 0, 0 }; - static private void InitOrAddDict(Dictionary dict, T entry) where T : notnull { - if (!dict.ContainsKey(entry)) - dict[entry] = 0; - dict[entry]++; - } - - static public CBestPlayStats tGenerateBestPlayStats( - Dictionary.ValueCollection uniqueChartBestPlays, - Dictionary.ValueCollection uniqueSongBestPlays - ) { - CBestPlayStats stats = new CBestPlayStats(); - - // Individual charts - foreach (CBestPlayRecord record in uniqueChartBestPlays) { - Int64 roundedDifficulty = Math.Max((int)Difficulty.Easy, Math.Min((int)Difficulty.Total - 1, record.ChartDifficulty)); - if (roundedDifficulty <= (int)Difficulty.Edit) { - string[] ChartersArr = record.Charter.SplitByCommas(); - Int64 roundedScoreRank = Math.Max(0, Math.Min(7, record.ScoreRank + 1)); - Int64 roundedClearStatus = Math.Max((int)EClearStatus.NONE, Math.Min((int)EClearStatus.PERFECT, record.ClearStatus + 1)); - - stats.ScoreRanks[roundedDifficulty][roundedScoreRank]++; - stats.ClearStatuses[roundedDifficulty][roundedClearStatus]++; - foreach (string Charter in ChartersArr) { - InitOrAddDict(stats.CharterPlays, Charter); - if (roundedClearStatus >= (int)EClearStatus.CLEAR) InitOrAddDict(stats.CharterClears, Charter); - if (roundedClearStatus >= (int)EClearStatus.FC) InitOrAddDict(stats.CharterFCs, Charter); - if (roundedClearStatus == (int)EClearStatus.PERFECT) InitOrAddDict(stats.CharterPerfects, Charter); - } - InitOrAddDict(stats.GenrePlays, record.ChartGenre); - if (roundedClearStatus >= (int)EClearStatus.CLEAR) InitOrAddDict(stats.GenreClears, record.ChartGenre); - if (roundedClearStatus >= (int)EClearStatus.FC) InitOrAddDict(stats.GenreFCs, record.ChartGenre); - if (roundedClearStatus == (int)EClearStatus.PERFECT) InitOrAddDict(stats.GenrePerfects, record.ChartGenre); - InitOrAddDict(stats.LevelPlays, (int)record.ChartLevel); - if (roundedClearStatus >= (int)EClearStatus.CLEAR) InitOrAddDict(stats.LevelClears, (int)record.ChartLevel); - if (roundedClearStatus >= (int)EClearStatus.FC) InitOrAddDict(stats.LevelFCs, (int)record.ChartLevel); - if (roundedClearStatus == (int)EClearStatus.PERFECT) InitOrAddDict(stats.LevelPerfects, (int)record.ChartLevel); - stats.DistinctPlays++; - if (roundedClearStatus >= (int)EClearStatus.CLEAR) stats.DistinctClears++; - if (roundedClearStatus >= (int)EClearStatus.FC) stats.DistinctFCs++; - if (roundedClearStatus == (int)EClearStatus.PERFECT) stats.DistinctPerfects++; - } else if (roundedDifficulty == (int)Difficulty.Tower) { - Int64 roundedClearStatus = Math.Clamp(record.ClearStatus + 1, (int)ETowerClearStatus.NONE, (int)ETowerClearStatus.TOTAL); - stats.ClearStatuses[roundedDifficulty][roundedClearStatus]++; - - } else if (roundedDifficulty == (int)Difficulty.Dan) { - Int64 roundedClearStatus = Math.Clamp(record.ClearStatus + 1, (int)EDanClearStatus.NONE, (int)EDanClearStatus.TOTAL); - stats.ClearStatuses[roundedDifficulty][roundedClearStatus]++; - - } - } - - // Individual songs - foreach (CBestPlayRecord record in uniqueSongBestPlays) { - Int64 roundedDifficulty = Math.Max((int)Difficulty.Easy, Math.Min((int)Difficulty.Total - 1, record.ChartDifficulty)); - - if (roundedDifficulty <= (int)Difficulty.Edit) { - Int64 roundedClearStatus = Math.Max((int)EClearStatus.NONE, Math.Min((int)EClearStatus.PERFECT, record.ClearStatus + 1)); - - InitOrAddDict(stats.SongGenrePlays, record.ChartGenre); - if (roundedClearStatus >= (int)EClearStatus.CLEAR) InitOrAddDict(stats.SongGenreClears, record.ChartGenre); - if (roundedClearStatus >= (int)EClearStatus.FC) InitOrAddDict(stats.SongGenreFCs, record.ChartGenre); - if (roundedClearStatus == (int)EClearStatus.PERFECT) InitOrAddDict(stats.SongGenrePerfects, record.ChartGenre); - stats.SongDistinctPlays++; - if (roundedClearStatus >= (int)EClearStatus.CLEAR) stats.SongDistinctClears++; - if (roundedClearStatus >= (int)EClearStatus.FC) stats.SongDistinctFCs++; - if (roundedClearStatus == (int)EClearStatus.PERFECT) stats.SongDistinctPerfects++; - } - } - - return stats; + // 0 : None, 1 : E, 2 : D, 3 : C, 4 : B, 5 : A, 6 : S, 7 : Omega + ScoreRanks[0] = new int[8] { 0, 0, 0, 0, 0, 0, 0, 0 }; + ScoreRanks[1] = new int[8] { 0, 0, 0, 0, 0, 0, 0, 0 }; + ScoreRanks[2] = new int[8] { 0, 0, 0, 0, 0, 0, 0, 0 }; + ScoreRanks[3] = new int[8] { 0, 0, 0, 0, 0, 0, 0, 0 }; + ScoreRanks[4] = new int[8] { 0, 0, 0, 0, 0, 0, 0, 0 }; } } + + static private void InitOrAddDict(Dictionary dict, T entry) where T : notnull { + if (!dict.ContainsKey(entry)) + dict[entry] = 0; + dict[entry]++; + } + + static public CBestPlayStats tGenerateBestPlayStats( + Dictionary.ValueCollection uniqueChartBestPlays, + Dictionary.ValueCollection uniqueSongBestPlays + ) { + CBestPlayStats stats = new CBestPlayStats(); + + // Individual charts + foreach (CBestPlayRecord record in uniqueChartBestPlays) { + Int64 roundedDifficulty = Math.Max((int)Difficulty.Easy, Math.Min((int)Difficulty.Total - 1, record.ChartDifficulty)); + if (roundedDifficulty <= (int)Difficulty.Edit) { + string[] ChartersArr = record.Charter.SplitByCommas(); + Int64 roundedScoreRank = Math.Max(0, Math.Min(7, record.ScoreRank + 1)); + Int64 roundedClearStatus = Math.Max((int)EClearStatus.NONE, Math.Min((int)EClearStatus.PERFECT, record.ClearStatus + 1)); + + stats.ScoreRanks[roundedDifficulty][roundedScoreRank]++; + stats.ClearStatuses[roundedDifficulty][roundedClearStatus]++; + foreach (string Charter in ChartersArr) { + InitOrAddDict(stats.CharterPlays, Charter); + if (roundedClearStatus >= (int)EClearStatus.CLEAR) InitOrAddDict(stats.CharterClears, Charter); + if (roundedClearStatus >= (int)EClearStatus.FC) InitOrAddDict(stats.CharterFCs, Charter); + if (roundedClearStatus == (int)EClearStatus.PERFECT) InitOrAddDict(stats.CharterPerfects, Charter); + } + InitOrAddDict(stats.GenrePlays, record.ChartGenre); + if (roundedClearStatus >= (int)EClearStatus.CLEAR) InitOrAddDict(stats.GenreClears, record.ChartGenre); + if (roundedClearStatus >= (int)EClearStatus.FC) InitOrAddDict(stats.GenreFCs, record.ChartGenre); + if (roundedClearStatus == (int)EClearStatus.PERFECT) InitOrAddDict(stats.GenrePerfects, record.ChartGenre); + InitOrAddDict(stats.LevelPlays, (int)record.ChartLevel); + if (roundedClearStatus >= (int)EClearStatus.CLEAR) InitOrAddDict(stats.LevelClears, (int)record.ChartLevel); + if (roundedClearStatus >= (int)EClearStatus.FC) InitOrAddDict(stats.LevelFCs, (int)record.ChartLevel); + if (roundedClearStatus == (int)EClearStatus.PERFECT) InitOrAddDict(stats.LevelPerfects, (int)record.ChartLevel); + stats.DistinctPlays++; + if (roundedClearStatus >= (int)EClearStatus.CLEAR) stats.DistinctClears++; + if (roundedClearStatus >= (int)EClearStatus.FC) stats.DistinctFCs++; + if (roundedClearStatus == (int)EClearStatus.PERFECT) stats.DistinctPerfects++; + } else if (roundedDifficulty == (int)Difficulty.Tower) { + Int64 roundedClearStatus = Math.Clamp(record.ClearStatus + 1, (int)ETowerClearStatus.NONE, (int)ETowerClearStatus.TOTAL); + stats.ClearStatuses[roundedDifficulty][roundedClearStatus]++; + + } else if (roundedDifficulty == (int)Difficulty.Dan) { + Int64 roundedClearStatus = Math.Clamp(record.ClearStatus + 1, (int)EDanClearStatus.NONE, (int)EDanClearStatus.TOTAL); + stats.ClearStatuses[roundedDifficulty][roundedClearStatus]++; + + } + } + + // Individual songs + foreach (CBestPlayRecord record in uniqueSongBestPlays) { + Int64 roundedDifficulty = Math.Max((int)Difficulty.Easy, Math.Min((int)Difficulty.Total - 1, record.ChartDifficulty)); + + if (roundedDifficulty <= (int)Difficulty.Edit) { + Int64 roundedClearStatus = Math.Max((int)EClearStatus.NONE, Math.Min((int)EClearStatus.PERFECT, record.ClearStatus + 1)); + + InitOrAddDict(stats.SongGenrePlays, record.ChartGenre); + if (roundedClearStatus >= (int)EClearStatus.CLEAR) InitOrAddDict(stats.SongGenreClears, record.ChartGenre); + if (roundedClearStatus >= (int)EClearStatus.FC) InitOrAddDict(stats.SongGenreFCs, record.ChartGenre); + if (roundedClearStatus == (int)EClearStatus.PERFECT) InitOrAddDict(stats.SongGenrePerfects, record.ChartGenre); + stats.SongDistinctPlays++; + if (roundedClearStatus >= (int)EClearStatus.CLEAR) stats.SongDistinctClears++; + if (roundedClearStatus >= (int)EClearStatus.FC) stats.SongDistinctFCs++; + if (roundedClearStatus == (int)EClearStatus.PERFECT) stats.SongDistinctPerfects++; + } + } + + return stats; + } } diff --git a/OpenTaiko/src/Common/CConfigIni.cs b/OpenTaiko/src/Common/CConfigIni.cs index 0c30c321..e8200f52 100644 --- a/OpenTaiko/src/Common/CConfigIni.cs +++ b/OpenTaiko/src/Common/CConfigIni.cs @@ -5,3691 +5,3692 @@ using System.Text; using FDK; using FDK.ExtensionMethods; -namespace OpenTaiko { - internal class CConfigIni : INotifyPropertyChanged { - private const int MinimumKeyboardSoundLevelIncrement = 1; - private const int MaximumKeyboardSoundLevelIncrement = 20; - private const int DefaultKeyboardSoundLevelIncrement = 5; +namespace OpenTaiko; - // Class +internal class CConfigIni : INotifyPropertyChanged { + private const int MinimumKeyboardSoundLevelIncrement = 1; + private const int MaximumKeyboardSoundLevelIncrement = 20; + private const int DefaultKeyboardSoundLevelIncrement = 5; - #region [ CKeyAssign ] + // Class - public class CKeyAssign { - public class CKeyAssignPad { - public CConfigIni.CKeyAssign.STKEYASSIGN[] HH { - get { return this.padHH_R; } - set { this.padHH_R = value; } - } + #region [ CKeyAssign ] - public CConfigIni.CKeyAssign.STKEYASSIGN[] R { - get { return this.padHH_R; } - set { this.padHH_R = value; } - } - - public CConfigIni.CKeyAssign.STKEYASSIGN[] SD { - get { return this.padSD_G; } - set { this.padSD_G = value; } - } - - public CConfigIni.CKeyAssign.STKEYASSIGN[] G { - get { return this.padSD_G; } - set { this.padSD_G = value; } - } - - public CConfigIni.CKeyAssign.STKEYASSIGN[] BD { - get { return this.padBD_B; } - set { this.padBD_B = value; } - } - - public CConfigIni.CKeyAssign.STKEYASSIGN[] B { - get { return this.padBD_B; } - set { this.padBD_B = value; } - } - - public CConfigIni.CKeyAssign.STKEYASSIGN[] HT { - get { return this.padHT_Pick; } - set { this.padHT_Pick = value; } - } - - public CConfigIni.CKeyAssign.STKEYASSIGN[] Pick { - get { return this.padHT_Pick; } - set { this.padHT_Pick = value; } - } - - public CConfigIni.CKeyAssign.STKEYASSIGN[] LT { - get { return this.padLT_Wail; } - set { this.padLT_Wail = value; } - } - - public CConfigIni.CKeyAssign.STKEYASSIGN[] Wail { - get { return this.padLT_Wail; } - set { this.padLT_Wail = value; } - } - - public CConfigIni.CKeyAssign.STKEYASSIGN[] FT { - get { return this.padFT_Cancel; } - set { this.padFT_Cancel = value; } - } - - public CConfigIni.CKeyAssign.STKEYASSIGN[] Cancel { - get { return this.padFT_Cancel; } - set { this.padFT_Cancel = value; } - } - - public CConfigIni.CKeyAssign.STKEYASSIGN[] CY { - get { return this.padCY_Decide; } - set { this.padCY_Decide = value; } - } - - public CConfigIni.CKeyAssign.STKEYASSIGN[] Decide { - get { return this.padCY_Decide; } - set { this.padCY_Decide = value; } - } - - public CConfigIni.CKeyAssign.STKEYASSIGN[] HHO { - get { return this.padHHO; } - set { this.padHHO = value; } - } - - public CConfigIni.CKeyAssign.STKEYASSIGN[] RD { - get { return this.padRD; } - set { this.padRD = value; } - } - - public CConfigIni.CKeyAssign.STKEYASSIGN[] LC { - get { return this.padLC; } - set { this.padLC = value; } - } - - public CConfigIni.CKeyAssign.STKEYASSIGN[] LP { - get { return this.padLP; } - set { this.padLP = value; } - } - - public CConfigIni.CKeyAssign.STKEYASSIGN[] LBD { - get { return this.padLBD; } - set { this.padLBD = value; } - } - - public CConfigIni.CKeyAssign.STKEYASSIGN[] LeftRed { - get { return this.padLRed; } - set { this.padLRed = value; } - } - - public CConfigIni.CKeyAssign.STKEYASSIGN[] RightRed { - get { return this.padRRed; } - set { this.padRRed = value; } - } - - public CConfigIni.CKeyAssign.STKEYASSIGN[] LeftBlue { - get { return this.padLBlue; } - set { this.padLBlue = value; } - } - - public CConfigIni.CKeyAssign.STKEYASSIGN[] RightBlue { - get { return this.padRBlue; } - set { this.padRBlue = value; } - } - - public CConfigIni.CKeyAssign.STKEYASSIGN[] LeftRed2P { - get { return this.padLRed2P; } - set { this.padLRed2P = value; } - } - - public CConfigIni.CKeyAssign.STKEYASSIGN[] RightRed2P { - get { return this.padRRed2P; } - set { this.padRRed2P = value; } - } - - public CConfigIni.CKeyAssign.STKEYASSIGN[] LeftBlue2P { - get { return this.padLBlue2P; } - set { this.padLBlue2P = value; } - } - - public CConfigIni.CKeyAssign.STKEYASSIGN[] RightBlue2P { - get { return this.padRBlue2P; } - set { this.padRBlue2P = value; } - } - - public CConfigIni.CKeyAssign.STKEYASSIGN[] LeftRed3P { - get { return this.padLRed3P; } - set { this.padLRed3P = value; } - } - - public CConfigIni.CKeyAssign.STKEYASSIGN[] RightRed3P { - get { return this.padRRed3P; } - set { this.padRRed3P = value; } - } - - public CConfigIni.CKeyAssign.STKEYASSIGN[] LeftBlue3P { - get { return this.padLBlue3P; } - set { this.padLBlue3P = value; } - } - - public CConfigIni.CKeyAssign.STKEYASSIGN[] RightBlue3P { - get { return this.padRBlue3P; } - set { this.padRBlue3P = value; } - } - - public CConfigIni.CKeyAssign.STKEYASSIGN[] LeftRed4P { - get { return this.padLRed4P; } - set { this.padLRed4P = value; } - } - - public CConfigIni.CKeyAssign.STKEYASSIGN[] RightRed4P { - get { return this.padRRed4P; } - set { this.padRRed4P = value; } - } - - public CConfigIni.CKeyAssign.STKEYASSIGN[] LeftBlue4P { - get { return this.padLBlue4P; } - set { this.padLBlue4P = value; } - } - - public CConfigIni.CKeyAssign.STKEYASSIGN[] RightBlue4P { - get { return this.padRBlue4P; } - set { this.padRBlue4P = value; } - } - - public CConfigIni.CKeyAssign.STKEYASSIGN[] LeftRed5P { - get { return this.padLRed5P; } - set { this.padLRed5P = value; } - } - - public CConfigIni.CKeyAssign.STKEYASSIGN[] RightRed5P { - get { return this.padRRed5P; } - set { this.padRRed5P = value; } - } - - public CConfigIni.CKeyAssign.STKEYASSIGN[] LeftBlue5P { - get { return this.padLBlue5P; } - set { this.padLBlue5P = value; } - } - - public CConfigIni.CKeyAssign.STKEYASSIGN[] RightBlue5P { - get { return this.padRBlue5P; } - set { this.padRBlue5P = value; } - } - - public CConfigIni.CKeyAssign.STKEYASSIGN[] Clap { - get { return this.padClap; } - set { this.padClap = value; } - } - - public CConfigIni.CKeyAssign.STKEYASSIGN[] Clap2P { - get { return this.padClap2P; } - set { this.padClap2P = value; } - } - - public CConfigIni.CKeyAssign.STKEYASSIGN[] Clap3P { - get { return this.padClap3P; } - set { this.padClap3P = value; } - } - - public CConfigIni.CKeyAssign.STKEYASSIGN[] Clap4P { - get { return this.padClap4P; } - set { this.padClap4P = value; } - } - - public CConfigIni.CKeyAssign.STKEYASSIGN[] Clap5P { - get { return this.padClap5P; } - set { this.padClap5P = value; } - } - - public CConfigIni.CKeyAssign.STKEYASSIGN[] LeftChange { - get { return this.padLeftChange; } - set { this.padLeftChange = value; } - } - - public CConfigIni.CKeyAssign.STKEYASSIGN[] RightChange { - get { return this.padRightChange; } - set { this.padRightChange = value; } - } - - public CConfigIni.CKeyAssign.STKEYASSIGN[] Capture { - get { return this.padCapture; } - set { this.padCapture = value; } - } - - public CConfigIni.CKeyAssign.STKEYASSIGN[] SongVolIncrease { - get { return this.padSongVolIncrease; } - set { this.padSongVolIncrease = value; } - } - - public CConfigIni.CKeyAssign.STKEYASSIGN[] SongVolDecrease { - get { return this.padSongVolDecrease; } - set { this.padSongVolDecrease = value; } - } - - public CConfigIni.CKeyAssign.STKEYASSIGN[] DisplayHits { - get { return this.padDisplayHits; } - set { this.padDisplayHits = value; } - } - - public CConfigIni.CKeyAssign.STKEYASSIGN[] DisplayDebug { - get { return this.padDisplayDebug; } - set { this.padDisplayDebug = value; } - } - - public CConfigIni.CKeyAssign.STKEYASSIGN[] QuickConfig { - get { return this.padQuickConfig; } - set { this.padQuickConfig = value; } - } - - public CConfigIni.CKeyAssign.STKEYASSIGN[] NewHeya { - get { return this.padNewHeya; } - set { this.padNewHeya = value; } - } - - public CConfigIni.CKeyAssign.STKEYASSIGN[] SortSongs { - get { return this.padSortSongs; } - set { this.padSortSongs = value; } - } - - public CConfigIni.CKeyAssign.STKEYASSIGN[] ToggleAutoP1 { - get { return this.padToggleAutoP1; } - set { this.padToggleAutoP1 = value; } - } - - public CConfigIni.CKeyAssign.STKEYASSIGN[] ToggleAutoP2 { - get { return this.padToggleAutoP2; } - set { this.padToggleAutoP2 = value; } - } - - public CConfigIni.CKeyAssign.STKEYASSIGN[] ToggleTrainingMode { - get { return this.padToggleTrainingMode; } - set { this.padToggleTrainingMode = value; } - } - - public CConfigIni.CKeyAssign.STKEYASSIGN[] CycleVideoDisplayMode { - get { return this.padCycleVideoDisplayMode; } - set { this.padCycleVideoDisplayMode = value; } - } - - public CConfigIni.CKeyAssign.STKEYASSIGN[] this[int index] { - get { - switch (index) { - case (int)EKeyConfigPad.HH: - return this.padHH_R; - - case (int)EKeyConfigPad.SD: - return this.padSD_G; - - case (int)EKeyConfigPad.BD: - return this.padBD_B; - - case (int)EKeyConfigPad.HT: - return this.padHT_Pick; - - case (int)EKeyConfigPad.LT: - return this.padLT_Wail; - - case (int)EKeyConfigPad.FT: - return this.padFT_Cancel; - - case (int)EKeyConfigPad.CY: - return this.padCY_Decide; - - case (int)EKeyConfigPad.HHO: - return this.padHHO; - - case (int)EKeyConfigPad.RD: - return this.padRD; - - case (int)EKeyConfigPad.LC: - return this.padLC; - - case (int)EKeyConfigPad.LP: // #27029 2012.1.4 from - return this.padLP; // - - case (int)EKeyConfigPad.LBD: // #27029 2012.1.4 from - return this.padLBD; // - - case (int)EKeyConfigPad.LRed: - return this.padLRed; - - case (int)EKeyConfigPad.RRed: - return this.padRRed; - - case (int)EKeyConfigPad.LBlue: - return this.padLBlue; - - case (int)EKeyConfigPad.RBlue: - return this.padRBlue; - - case (int)EKeyConfigPad.LRed2P: - return this.padLRed2P; - - case (int)EKeyConfigPad.RRed2P: - return this.padRRed2P; - - case (int)EKeyConfigPad.LBlue2P: - return this.padLBlue2P; - - case (int)EKeyConfigPad.RBlue2P: - return this.padRBlue2P; - - case (int)EKeyConfigPad.LRed3P: - return this.padLRed3P; - - case (int)EKeyConfigPad.RRed3P: - return this.padRRed3P; - - case (int)EKeyConfigPad.LBlue3P: - return this.padLBlue3P; - - case (int)EKeyConfigPad.RBlue3P: - return this.padRBlue3P; - - case (int)EKeyConfigPad.LRed4P: - return this.padLRed4P; - - case (int)EKeyConfigPad.RRed4P: - return this.padRRed4P; - - case (int)EKeyConfigPad.LBlue4P: - return this.padLBlue4P; - - case (int)EKeyConfigPad.RBlue4P: - return this.padRBlue4P; - - case (int)EKeyConfigPad.LRed5P: - return this.padLRed5P; - - case (int)EKeyConfigPad.RRed5P: - return this.padRRed5P; - - case (int)EKeyConfigPad.LBlue5P: - return this.padLBlue5P; - - case (int)EKeyConfigPad.RBlue5P: - return this.padRBlue5P; - - case (int)EKeyConfigPad.Clap: - return this.padClap; - - case (int)EKeyConfigPad.Clap2P: - return this.padClap2P; - - case (int)EKeyConfigPad.Clap3P: - return this.padClap3P; - - case (int)EKeyConfigPad.Clap4P: - return this.padClap4P; - - case (int)EKeyConfigPad.Clap5P: - return this.padClap5P; - - case (int)EKeyConfigPad.LeftChange: - return this.padLeftChange; - - case (int)EKeyConfigPad.RightChange: - return this.padRightChange; - - case (int)EKeyConfigPad.Capture: - return this.padCapture; - - case (int)EKeyConfigPad.SongVolumeIncrease: - return this.padSongVolIncrease; - - case (int)EKeyConfigPad.SongVolumeDecrease: - return this.padSongVolDecrease; - - case (int)EKeyConfigPad.DisplayHits: - return this.padDisplayHits; - - case (int)EKeyConfigPad.DisplayDebug: - return this.padDisplayDebug; - - case (int)EKeyConfigPad.QuickConfig: - return this.padQuickConfig; - - case (int)EKeyConfigPad.NewHeya: - return this.padNewHeya; - - case (int)EKeyConfigPad.SortSongs: - return this.padSortSongs; - - case (int)EKeyConfigPad.ToggleAutoP1: - return this.padToggleAutoP1; - - case (int)EKeyConfigPad.ToggleAutoP2: - return this.padToggleAutoP2; - - case (int)EKeyConfigPad.ToggleTrainingMode: - return this.padToggleTrainingMode; - - case (int)EKeyConfigPad.CycleVideoDisplayMode: - return this.padCycleVideoDisplayMode; - - case (int)EKeyConfigPad.TrainingIncreaseScrollSpeed: - return this.TrainingIncreaseScrollSpeed; - - case (int)EKeyConfigPad.TrainingIncreaseSongSpeed: - return this.TrainingIncreaseSongSpeed; - - case (int)EKeyConfigPad.TrainingDecreaseSongSpeed: - return this.TrainingDecreaseSongSpeed; - - case (int)EKeyConfigPad.TrainingDecreaseScrollSpeed: - return this.TrainingDecreaseScrollSpeed; - - case (int)EKeyConfigPad.TrainingToggleAuto: - return this.TrainingToggleAuto; - - case (int)EKeyConfigPad.TrainingBranchNormal: - return this.TrainingBranchNormal; - - case (int)EKeyConfigPad.TrainingBranchExpert: - return this.TrainingBranchExpert; - - case (int)EKeyConfigPad.TrainingBranchMaster: - return this.TrainingBranchMaster; - - case (int)EKeyConfigPad.TrainingPause: - return this.TrainingPause; - - case (int)EKeyConfigPad.TrainingBookmark: - return this.TrainingBookmark; - - case (int)EKeyConfigPad.TrainingMoveForwardMeasure: - return this.TrainingMoveForwardMeasure; - - case (int)EKeyConfigPad.TrainingMoveBackMeasure: - return this.TrainingMoveBackMeasure; - - case (int)EKeyConfigPad.TrainingSkipForwardMeasure: - return this.TrainingSkipForwardMeasure; - - case (int)EKeyConfigPad.TrainingSkipBackMeasure: - return this.TrainingSkipBackMeasure; - - case (int)EKeyConfigPad.TrainingJumpToFirstMeasure: - return this.TrainingJumpToFirstMeasure; - - case (int)EKeyConfigPad.TrainingJumpToLastMeasure: - return this.TrainingJumpToLastMeasure; - } - - throw new IndexOutOfRangeException(); - } - set { - switch (index) { - case (int)EKeyConfigPad.HH: - this.padHH_R = value; - return; - - case (int)EKeyConfigPad.SD: - this.padSD_G = value; - return; - - case (int)EKeyConfigPad.BD: - this.padBD_B = value; - return; - - case (int)EKeyConfigPad.Pick: - this.padHT_Pick = value; - return; - - case (int)EKeyConfigPad.LT: - this.padLT_Wail = value; - return; - - case (int)EKeyConfigPad.FT: - this.padFT_Cancel = value; - return; - - case (int)EKeyConfigPad.CY: - this.padCY_Decide = value; - return; - - case (int)EKeyConfigPad.HHO: - this.padHHO = value; - return; - - case (int)EKeyConfigPad.RD: - this.padRD = value; - return; - - case (int)EKeyConfigPad.LC: - this.padLC = value; - return; - - case (int)EKeyConfigPad.LP: - this.padLP = value; - return; - - case (int)EKeyConfigPad.LBD: - this.padLBD = value; - return; - - case (int)EKeyConfigPad.LRed: - this.padLRed = value; - return; - - case (int)EKeyConfigPad.RRed: - this.padRRed = value; - return; - - case (int)EKeyConfigPad.LBlue: - this.padLBlue = value; - return; - - case (int)EKeyConfigPad.RBlue: - this.padRBlue = value; - return; - - case (int)EKeyConfigPad.LRed2P: - this.padLRed2P = value; - return; - - case (int)EKeyConfigPad.RRed2P: - this.padRRed2P = value; - return; - - case (int)EKeyConfigPad.LBlue2P: - this.padLBlue2P = value; - return; - - case (int)EKeyConfigPad.RBlue2P: - this.padRBlue2P = value; - return; - - case (int)EKeyConfigPad.LRed3P: - this.padLRed3P = value; - return; - - case (int)EKeyConfigPad.RRed3P: - this.padRRed3P = value; - return; - - case (int)EKeyConfigPad.LBlue3P: - this.padLBlue3P = value; - return; - - case (int)EKeyConfigPad.RBlue3P: - this.padRBlue3P = value; - return; - - case (int)EKeyConfigPad.LRed4P: - this.padLRed4P = value; - return; - - case (int)EKeyConfigPad.RRed4P: - this.padRRed4P = value; - return; - - case (int)EKeyConfigPad.LBlue4P: - this.padLBlue4P = value; - return; - - case (int)EKeyConfigPad.RBlue4P: - this.padRBlue4P = value; - return; - - case (int)EKeyConfigPad.LRed5P: - this.padLRed5P = value; - return; - - case (int)EKeyConfigPad.RRed5P: - this.padRRed5P = value; - return; - - case (int)EKeyConfigPad.LBlue5P: - this.padLBlue5P = value; - return; - - case (int)EKeyConfigPad.RBlue5P: - this.padRBlue5P = value; - return; - - case (int)EKeyConfigPad.Clap: - this.padClap = value; - return; - - case (int)EKeyConfigPad.Clap2P: - this.padClap2P = value; - return; - - case (int)EKeyConfigPad.Clap3P: - this.padClap3P = value; - return; - - case (int)EKeyConfigPad.Clap4P: - this.padClap4P = value; - return; - - case (int)EKeyConfigPad.Clap5P: - this.padClap5P = value; - return; - - case (int)EKeyConfigPad.LeftChange: - this.padLeftChange = value; - return; - - case (int)EKeyConfigPad.RightChange: - this.padRightChange = value; - return; - - case (int)EKeyConfigPad.Capture: - this.padCapture = value; - return; - - case (int)EKeyConfigPad.SongVolumeIncrease: - this.padSongVolIncrease = value; - return; - - case (int)EKeyConfigPad.SongVolumeDecrease: - this.padSongVolDecrease = value; - return; - - case (int)EKeyConfigPad.DisplayHits: - this.padDisplayHits = value; - return; - - case (int)EKeyConfigPad.DisplayDebug: - this.padDisplayDebug = value; - return; - - case (int)EKeyConfigPad.QuickConfig: - this.padQuickConfig = value; - return; - - case (int)EKeyConfigPad.NewHeya: - this.padNewHeya = value; - return; - - case (int)EKeyConfigPad.SortSongs: - this.padSortSongs = value; - return; - - case (int)EKeyConfigPad.ToggleAutoP1: - this.padToggleAutoP1 = value; - return; - - case (int)EKeyConfigPad.ToggleAutoP2: - this.padToggleAutoP2 = value; - return; - - case (int)EKeyConfigPad.ToggleTrainingMode: - this.padToggleTrainingMode = value; - return; - - case (int)EKeyConfigPad.CycleVideoDisplayMode: - this.padCycleVideoDisplayMode = value; - return; - - case (int)EKeyConfigPad.TrainingIncreaseScrollSpeed: - this.TrainingIncreaseScrollSpeed = value; - return; - - case (int)EKeyConfigPad.TrainingDecreaseScrollSpeed: - this.TrainingDecreaseScrollSpeed = value; - return; - - case (int)EKeyConfigPad.TrainingIncreaseSongSpeed: - this.TrainingIncreaseSongSpeed = value; - return; - - case (int)EKeyConfigPad.TrainingDecreaseSongSpeed: - this.TrainingDecreaseSongSpeed = value; - return; - - case (int)EKeyConfigPad.TrainingToggleAuto: - this.TrainingToggleAuto = value; - return; - - case (int)EKeyConfigPad.TrainingBranchNormal: - this.TrainingBranchNormal = value; - return; - - case (int)EKeyConfigPad.TrainingBranchExpert: - this.TrainingBranchExpert = value; - return; - - case (int)EKeyConfigPad.TrainingBranchMaster: - this.TrainingBranchMaster = value; - return; - - case (int)EKeyConfigPad.TrainingPause: - this.TrainingPause = value; - return; - - case (int)EKeyConfigPad.TrainingBookmark: - this.TrainingBookmark = value; - return; - - case (int)EKeyConfigPad.TrainingMoveForwardMeasure: - this.TrainingMoveForwardMeasure = value; - return; - - case (int)EKeyConfigPad.TrainingMoveBackMeasure: - this.TrainingMoveBackMeasure = value; - return; - - case (int)EKeyConfigPad.TrainingSkipForwardMeasure: - this.TrainingSkipForwardMeasure = value; - return; - - case (int)EKeyConfigPad.TrainingSkipBackMeasure: - this.TrainingSkipBackMeasure = value; - return; - - case (int)EKeyConfigPad.TrainingJumpToFirstMeasure: - this.TrainingJumpToFirstMeasure = value; - return; - - case (int)EKeyConfigPad.TrainingJumpToLastMeasure: - this.TrainingJumpToLastMeasure = value; - return; - } - - throw new IndexOutOfRangeException(); - } - } - - #region [ private ] - - //----------------- - private CConfigIni.CKeyAssign.STKEYASSIGN[] padBD_B; - private CConfigIni.CKeyAssign.STKEYASSIGN[] padCY_Decide; - private CConfigIni.CKeyAssign.STKEYASSIGN[] padFT_Cancel; - private CConfigIni.CKeyAssign.STKEYASSIGN[] padHH_R; - private CConfigIni.CKeyAssign.STKEYASSIGN[] padHHO; - private CConfigIni.CKeyAssign.STKEYASSIGN[] padHT_Pick; - private CConfigIni.CKeyAssign.STKEYASSIGN[] padLC; - private CConfigIni.CKeyAssign.STKEYASSIGN[] padLT_Wail; - private CConfigIni.CKeyAssign.STKEYASSIGN[] padRD; - private CConfigIni.CKeyAssign.STKEYASSIGN[] padSD_G; - private CConfigIni.CKeyAssign.STKEYASSIGN[] padLP; - private CConfigIni.CKeyAssign.STKEYASSIGN[] padLBD; - - private CConfigIni.CKeyAssign.STKEYASSIGN[] padLRed; - private CConfigIni.CKeyAssign.STKEYASSIGN[] padLBlue; - private CConfigIni.CKeyAssign.STKEYASSIGN[] padRRed; - private CConfigIni.CKeyAssign.STKEYASSIGN[] padRBlue; - - private CConfigIni.CKeyAssign.STKEYASSIGN[] padLRed2P; - private CConfigIni.CKeyAssign.STKEYASSIGN[] padLBlue2P; - private CConfigIni.CKeyAssign.STKEYASSIGN[] padRRed2P; - private CConfigIni.CKeyAssign.STKEYASSIGN[] padRBlue2P; - - private CConfigIni.CKeyAssign.STKEYASSIGN[] padLRed3P; - private CConfigIni.CKeyAssign.STKEYASSIGN[] padLBlue3P; - private CConfigIni.CKeyAssign.STKEYASSIGN[] padRRed3P; - private CConfigIni.CKeyAssign.STKEYASSIGN[] padRBlue3P; - - private CConfigIni.CKeyAssign.STKEYASSIGN[] padLRed4P; - private CConfigIni.CKeyAssign.STKEYASSIGN[] padLBlue4P; - private CConfigIni.CKeyAssign.STKEYASSIGN[] padRRed4P; - private CConfigIni.CKeyAssign.STKEYASSIGN[] padRBlue4P; - - private CConfigIni.CKeyAssign.STKEYASSIGN[] padLRed5P; - private CConfigIni.CKeyAssign.STKEYASSIGN[] padLBlue5P; - private CConfigIni.CKeyAssign.STKEYASSIGN[] padRRed5P; - private CConfigIni.CKeyAssign.STKEYASSIGN[] padRBlue5P; - - private CConfigIni.CKeyAssign.STKEYASSIGN[] padClap; - private CConfigIni.CKeyAssign.STKEYASSIGN[] padClap2P; - private CConfigIni.CKeyAssign.STKEYASSIGN[] padClap3P; - private CConfigIni.CKeyAssign.STKEYASSIGN[] padClap4P; - private CConfigIni.CKeyAssign.STKEYASSIGN[] padClap5P; - private CConfigIni.CKeyAssign.STKEYASSIGN[] padLeftChange; - private CConfigIni.CKeyAssign.STKEYASSIGN[] padRightChange; - - private CConfigIni.CKeyAssign.STKEYASSIGN[] padCapture; - private CConfigIni.CKeyAssign.STKEYASSIGN[] padSongVolIncrease; - private CConfigIni.CKeyAssign.STKEYASSIGN[] padSongVolDecrease; - private CConfigIni.CKeyAssign.STKEYASSIGN[] padDisplayHits; - private CConfigIni.CKeyAssign.STKEYASSIGN[] padDisplayDebug; - private CConfigIni.CKeyAssign.STKEYASSIGN[] padQuickConfig; - private CConfigIni.CKeyAssign.STKEYASSIGN[] padNewHeya; - private CConfigIni.CKeyAssign.STKEYASSIGN[] padSortSongs; - private CConfigIni.CKeyAssign.STKEYASSIGN[] padToggleAutoP1; - private CConfigIni.CKeyAssign.STKEYASSIGN[] padToggleAutoP2; - private CConfigIni.CKeyAssign.STKEYASSIGN[] padToggleTrainingMode; - private CConfigIni.CKeyAssign.STKEYASSIGN[] padCycleVideoDisplayMode; - - public CConfigIni.CKeyAssign.STKEYASSIGN[] TrainingIncreaseScrollSpeed; - public CConfigIni.CKeyAssign.STKEYASSIGN[] TrainingDecreaseScrollSpeed; - public CConfigIni.CKeyAssign.STKEYASSIGN[] TrainingToggleAuto; - public CConfigIni.CKeyAssign.STKEYASSIGN[] TrainingBranchNormal; - public CConfigIni.CKeyAssign.STKEYASSIGN[] TrainingBranchExpert; - public CConfigIni.CKeyAssign.STKEYASSIGN[] TrainingBranchMaster; - public CConfigIni.CKeyAssign.STKEYASSIGN[] TrainingPause; - public CConfigIni.CKeyAssign.STKEYASSIGN[] TrainingBookmark; - public CConfigIni.CKeyAssign.STKEYASSIGN[] TrainingMoveForwardMeasure; - public CConfigIni.CKeyAssign.STKEYASSIGN[] TrainingMoveBackMeasure; - public CConfigIni.CKeyAssign.STKEYASSIGN[] TrainingSkipForwardMeasure; - public CConfigIni.CKeyAssign.STKEYASSIGN[] TrainingSkipBackMeasure; - public CConfigIni.CKeyAssign.STKEYASSIGN[] TrainingIncreaseSongSpeed; - public CConfigIni.CKeyAssign.STKEYASSIGN[] TrainingDecreaseSongSpeed; - public CConfigIni.CKeyAssign.STKEYASSIGN[] TrainingJumpToFirstMeasure; - - public CConfigIni.CKeyAssign.STKEYASSIGN[] TrainingJumpToLastMeasure; - //----------------- - - #endregion + public class CKeyAssign { + public class CKeyAssignPad { + public CConfigIni.CKeyAssign.STKEYASSIGN[] HH { + get { return this.padHH_R; } + set { this.padHH_R = value; } } - public bool KeyIsPressed(STKEYASSIGN[] pad) { - return OpenTaiko.InputManager.Keyboard.KeyPressed(pad.ToList().ConvertAll(key => key.Code)); + public CConfigIni.CKeyAssign.STKEYASSIGN[] R { + get { return this.padHH_R; } + set { this.padHH_R = value; } } - [StructLayout(LayoutKind.Sequential)] - public struct STKEYASSIGN { - public EInputDevice InputDevice; - public int ID; - public int Code; - - public STKEYASSIGN(EInputDevice DeviceType, int nID, int nCode) { - this.InputDevice = DeviceType; - this.ID = nID; - this.Code = nCode; - } + public CConfigIni.CKeyAssign.STKEYASSIGN[] SD { + get { return this.padSD_G; } + set { this.padSD_G = value; } } - public CKeyAssignPad Bass = new CKeyAssignPad(); - public CKeyAssignPad Drums = new CKeyAssignPad(); - public CKeyAssignPad Guitar = new CKeyAssignPad(); - public CKeyAssignPad Taiko = new CKeyAssignPad(); - public CKeyAssignPad System = new CKeyAssignPad(); + public CConfigIni.CKeyAssign.STKEYASSIGN[] G { + get { return this.padSD_G; } + set { this.padSD_G = value; } + } - public CKeyAssignPad this[int index] { + public CConfigIni.CKeyAssign.STKEYASSIGN[] BD { + get { return this.padBD_B; } + set { this.padBD_B = value; } + } + + public CConfigIni.CKeyAssign.STKEYASSIGN[] B { + get { return this.padBD_B; } + set { this.padBD_B = value; } + } + + public CConfigIni.CKeyAssign.STKEYASSIGN[] HT { + get { return this.padHT_Pick; } + set { this.padHT_Pick = value; } + } + + public CConfigIni.CKeyAssign.STKEYASSIGN[] Pick { + get { return this.padHT_Pick; } + set { this.padHT_Pick = value; } + } + + public CConfigIni.CKeyAssign.STKEYASSIGN[] LT { + get { return this.padLT_Wail; } + set { this.padLT_Wail = value; } + } + + public CConfigIni.CKeyAssign.STKEYASSIGN[] Wail { + get { return this.padLT_Wail; } + set { this.padLT_Wail = value; } + } + + public CConfigIni.CKeyAssign.STKEYASSIGN[] FT { + get { return this.padFT_Cancel; } + set { this.padFT_Cancel = value; } + } + + public CConfigIni.CKeyAssign.STKEYASSIGN[] Cancel { + get { return this.padFT_Cancel; } + set { this.padFT_Cancel = value; } + } + + public CConfigIni.CKeyAssign.STKEYASSIGN[] CY { + get { return this.padCY_Decide; } + set { this.padCY_Decide = value; } + } + + public CConfigIni.CKeyAssign.STKEYASSIGN[] Decide { + get { return this.padCY_Decide; } + set { this.padCY_Decide = value; } + } + + public CConfigIni.CKeyAssign.STKEYASSIGN[] HHO { + get { return this.padHHO; } + set { this.padHHO = value; } + } + + public CConfigIni.CKeyAssign.STKEYASSIGN[] RD { + get { return this.padRD; } + set { this.padRD = value; } + } + + public CConfigIni.CKeyAssign.STKEYASSIGN[] LC { + get { return this.padLC; } + set { this.padLC = value; } + } + + public CConfigIni.CKeyAssign.STKEYASSIGN[] LP { + get { return this.padLP; } + set { this.padLP = value; } + } + + public CConfigIni.CKeyAssign.STKEYASSIGN[] LBD { + get { return this.padLBD; } + set { this.padLBD = value; } + } + + public CConfigIni.CKeyAssign.STKEYASSIGN[] LeftRed { + get { return this.padLRed; } + set { this.padLRed = value; } + } + + public CConfigIni.CKeyAssign.STKEYASSIGN[] RightRed { + get { return this.padRRed; } + set { this.padRRed = value; } + } + + public CConfigIni.CKeyAssign.STKEYASSIGN[] LeftBlue { + get { return this.padLBlue; } + set { this.padLBlue = value; } + } + + public CConfigIni.CKeyAssign.STKEYASSIGN[] RightBlue { + get { return this.padRBlue; } + set { this.padRBlue = value; } + } + + public CConfigIni.CKeyAssign.STKEYASSIGN[] LeftRed2P { + get { return this.padLRed2P; } + set { this.padLRed2P = value; } + } + + public CConfigIni.CKeyAssign.STKEYASSIGN[] RightRed2P { + get { return this.padRRed2P; } + set { this.padRRed2P = value; } + } + + public CConfigIni.CKeyAssign.STKEYASSIGN[] LeftBlue2P { + get { return this.padLBlue2P; } + set { this.padLBlue2P = value; } + } + + public CConfigIni.CKeyAssign.STKEYASSIGN[] RightBlue2P { + get { return this.padRBlue2P; } + set { this.padRBlue2P = value; } + } + + public CConfigIni.CKeyAssign.STKEYASSIGN[] LeftRed3P { + get { return this.padLRed3P; } + set { this.padLRed3P = value; } + } + + public CConfigIni.CKeyAssign.STKEYASSIGN[] RightRed3P { + get { return this.padRRed3P; } + set { this.padRRed3P = value; } + } + + public CConfigIni.CKeyAssign.STKEYASSIGN[] LeftBlue3P { + get { return this.padLBlue3P; } + set { this.padLBlue3P = value; } + } + + public CConfigIni.CKeyAssign.STKEYASSIGN[] RightBlue3P { + get { return this.padRBlue3P; } + set { this.padRBlue3P = value; } + } + + public CConfigIni.CKeyAssign.STKEYASSIGN[] LeftRed4P { + get { return this.padLRed4P; } + set { this.padLRed4P = value; } + } + + public CConfigIni.CKeyAssign.STKEYASSIGN[] RightRed4P { + get { return this.padRRed4P; } + set { this.padRRed4P = value; } + } + + public CConfigIni.CKeyAssign.STKEYASSIGN[] LeftBlue4P { + get { return this.padLBlue4P; } + set { this.padLBlue4P = value; } + } + + public CConfigIni.CKeyAssign.STKEYASSIGN[] RightBlue4P { + get { return this.padRBlue4P; } + set { this.padRBlue4P = value; } + } + + public CConfigIni.CKeyAssign.STKEYASSIGN[] LeftRed5P { + get { return this.padLRed5P; } + set { this.padLRed5P = value; } + } + + public CConfigIni.CKeyAssign.STKEYASSIGN[] RightRed5P { + get { return this.padRRed5P; } + set { this.padRRed5P = value; } + } + + public CConfigIni.CKeyAssign.STKEYASSIGN[] LeftBlue5P { + get { return this.padLBlue5P; } + set { this.padLBlue5P = value; } + } + + public CConfigIni.CKeyAssign.STKEYASSIGN[] RightBlue5P { + get { return this.padRBlue5P; } + set { this.padRBlue5P = value; } + } + + public CConfigIni.CKeyAssign.STKEYASSIGN[] Clap { + get { return this.padClap; } + set { this.padClap = value; } + } + + public CConfigIni.CKeyAssign.STKEYASSIGN[] Clap2P { + get { return this.padClap2P; } + set { this.padClap2P = value; } + } + + public CConfigIni.CKeyAssign.STKEYASSIGN[] Clap3P { + get { return this.padClap3P; } + set { this.padClap3P = value; } + } + + public CConfigIni.CKeyAssign.STKEYASSIGN[] Clap4P { + get { return this.padClap4P; } + set { this.padClap4P = value; } + } + + public CConfigIni.CKeyAssign.STKEYASSIGN[] Clap5P { + get { return this.padClap5P; } + set { this.padClap5P = value; } + } + + public CConfigIni.CKeyAssign.STKEYASSIGN[] LeftChange { + get { return this.padLeftChange; } + set { this.padLeftChange = value; } + } + + public CConfigIni.CKeyAssign.STKEYASSIGN[] RightChange { + get { return this.padRightChange; } + set { this.padRightChange = value; } + } + + public CConfigIni.CKeyAssign.STKEYASSIGN[] Capture { + get { return this.padCapture; } + set { this.padCapture = value; } + } + + public CConfigIni.CKeyAssign.STKEYASSIGN[] SongVolIncrease { + get { return this.padSongVolIncrease; } + set { this.padSongVolIncrease = value; } + } + + public CConfigIni.CKeyAssign.STKEYASSIGN[] SongVolDecrease { + get { return this.padSongVolDecrease; } + set { this.padSongVolDecrease = value; } + } + + public CConfigIni.CKeyAssign.STKEYASSIGN[] DisplayHits { + get { return this.padDisplayHits; } + set { this.padDisplayHits = value; } + } + + public CConfigIni.CKeyAssign.STKEYASSIGN[] DisplayDebug { + get { return this.padDisplayDebug; } + set { this.padDisplayDebug = value; } + } + + public CConfigIni.CKeyAssign.STKEYASSIGN[] QuickConfig { + get { return this.padQuickConfig; } + set { this.padQuickConfig = value; } + } + + public CConfigIni.CKeyAssign.STKEYASSIGN[] NewHeya { + get { return this.padNewHeya; } + set { this.padNewHeya = value; } + } + + public CConfigIni.CKeyAssign.STKEYASSIGN[] SortSongs { + get { return this.padSortSongs; } + set { this.padSortSongs = value; } + } + + public CConfigIni.CKeyAssign.STKEYASSIGN[] ToggleAutoP1 { + get { return this.padToggleAutoP1; } + set { this.padToggleAutoP1 = value; } + } + + public CConfigIni.CKeyAssign.STKEYASSIGN[] ToggleAutoP2 { + get { return this.padToggleAutoP2; } + set { this.padToggleAutoP2 = value; } + } + + public CConfigIni.CKeyAssign.STKEYASSIGN[] ToggleTrainingMode { + get { return this.padToggleTrainingMode; } + set { this.padToggleTrainingMode = value; } + } + + public CConfigIni.CKeyAssign.STKEYASSIGN[] CycleVideoDisplayMode { + get { return this.padCycleVideoDisplayMode; } + set { this.padCycleVideoDisplayMode = value; } + } + + public CConfigIni.CKeyAssign.STKEYASSIGN[] this[int index] { get { switch (index) { - case (int)EKeyConfigPart.Drums: - return this.Drums; + case (int)EKeyConfigPad.HH: + return this.padHH_R; - case (int)EKeyConfigPart.Guitar: - return this.Guitar; + case (int)EKeyConfigPad.SD: + return this.padSD_G; - case (int)EKeyConfigPart.Bass: - return this.Bass; + case (int)EKeyConfigPad.BD: + return this.padBD_B; - case (int)EKeyConfigPart.Taiko: - return this.Taiko; + case (int)EKeyConfigPad.HT: + return this.padHT_Pick; - case (int)EKeyConfigPart.System: - return this.System; + case (int)EKeyConfigPad.LT: + return this.padLT_Wail; + + case (int)EKeyConfigPad.FT: + return this.padFT_Cancel; + + case (int)EKeyConfigPad.CY: + return this.padCY_Decide; + + case (int)EKeyConfigPad.HHO: + return this.padHHO; + + case (int)EKeyConfigPad.RD: + return this.padRD; + + case (int)EKeyConfigPad.LC: + return this.padLC; + + case (int)EKeyConfigPad.LP: // #27029 2012.1.4 from + return this.padLP; // + + case (int)EKeyConfigPad.LBD: // #27029 2012.1.4 from + return this.padLBD; // + + case (int)EKeyConfigPad.LRed: + return this.padLRed; + + case (int)EKeyConfigPad.RRed: + return this.padRRed; + + case (int)EKeyConfigPad.LBlue: + return this.padLBlue; + + case (int)EKeyConfigPad.RBlue: + return this.padRBlue; + + case (int)EKeyConfigPad.LRed2P: + return this.padLRed2P; + + case (int)EKeyConfigPad.RRed2P: + return this.padRRed2P; + + case (int)EKeyConfigPad.LBlue2P: + return this.padLBlue2P; + + case (int)EKeyConfigPad.RBlue2P: + return this.padRBlue2P; + + case (int)EKeyConfigPad.LRed3P: + return this.padLRed3P; + + case (int)EKeyConfigPad.RRed3P: + return this.padRRed3P; + + case (int)EKeyConfigPad.LBlue3P: + return this.padLBlue3P; + + case (int)EKeyConfigPad.RBlue3P: + return this.padRBlue3P; + + case (int)EKeyConfigPad.LRed4P: + return this.padLRed4P; + + case (int)EKeyConfigPad.RRed4P: + return this.padRRed4P; + + case (int)EKeyConfigPad.LBlue4P: + return this.padLBlue4P; + + case (int)EKeyConfigPad.RBlue4P: + return this.padRBlue4P; + + case (int)EKeyConfigPad.LRed5P: + return this.padLRed5P; + + case (int)EKeyConfigPad.RRed5P: + return this.padRRed5P; + + case (int)EKeyConfigPad.LBlue5P: + return this.padLBlue5P; + + case (int)EKeyConfigPad.RBlue5P: + return this.padRBlue5P; + + case (int)EKeyConfigPad.Clap: + return this.padClap; + + case (int)EKeyConfigPad.Clap2P: + return this.padClap2P; + + case (int)EKeyConfigPad.Clap3P: + return this.padClap3P; + + case (int)EKeyConfigPad.Clap4P: + return this.padClap4P; + + case (int)EKeyConfigPad.Clap5P: + return this.padClap5P; + + case (int)EKeyConfigPad.LeftChange: + return this.padLeftChange; + + case (int)EKeyConfigPad.RightChange: + return this.padRightChange; + + case (int)EKeyConfigPad.Capture: + return this.padCapture; + + case (int)EKeyConfigPad.SongVolumeIncrease: + return this.padSongVolIncrease; + + case (int)EKeyConfigPad.SongVolumeDecrease: + return this.padSongVolDecrease; + + case (int)EKeyConfigPad.DisplayHits: + return this.padDisplayHits; + + case (int)EKeyConfigPad.DisplayDebug: + return this.padDisplayDebug; + + case (int)EKeyConfigPad.QuickConfig: + return this.padQuickConfig; + + case (int)EKeyConfigPad.NewHeya: + return this.padNewHeya; + + case (int)EKeyConfigPad.SortSongs: + return this.padSortSongs; + + case (int)EKeyConfigPad.ToggleAutoP1: + return this.padToggleAutoP1; + + case (int)EKeyConfigPad.ToggleAutoP2: + return this.padToggleAutoP2; + + case (int)EKeyConfigPad.ToggleTrainingMode: + return this.padToggleTrainingMode; + + case (int)EKeyConfigPad.CycleVideoDisplayMode: + return this.padCycleVideoDisplayMode; + + case (int)EKeyConfigPad.TrainingIncreaseScrollSpeed: + return this.TrainingIncreaseScrollSpeed; + + case (int)EKeyConfigPad.TrainingIncreaseSongSpeed: + return this.TrainingIncreaseSongSpeed; + + case (int)EKeyConfigPad.TrainingDecreaseSongSpeed: + return this.TrainingDecreaseSongSpeed; + + case (int)EKeyConfigPad.TrainingDecreaseScrollSpeed: + return this.TrainingDecreaseScrollSpeed; + + case (int)EKeyConfigPad.TrainingToggleAuto: + return this.TrainingToggleAuto; + + case (int)EKeyConfigPad.TrainingBranchNormal: + return this.TrainingBranchNormal; + + case (int)EKeyConfigPad.TrainingBranchExpert: + return this.TrainingBranchExpert; + + case (int)EKeyConfigPad.TrainingBranchMaster: + return this.TrainingBranchMaster; + + case (int)EKeyConfigPad.TrainingPause: + return this.TrainingPause; + + case (int)EKeyConfigPad.TrainingBookmark: + return this.TrainingBookmark; + + case (int)EKeyConfigPad.TrainingMoveForwardMeasure: + return this.TrainingMoveForwardMeasure; + + case (int)EKeyConfigPad.TrainingMoveBackMeasure: + return this.TrainingMoveBackMeasure; + + case (int)EKeyConfigPad.TrainingSkipForwardMeasure: + return this.TrainingSkipForwardMeasure; + + case (int)EKeyConfigPad.TrainingSkipBackMeasure: + return this.TrainingSkipBackMeasure; + + case (int)EKeyConfigPad.TrainingJumpToFirstMeasure: + return this.TrainingJumpToFirstMeasure; + + case (int)EKeyConfigPad.TrainingJumpToLastMeasure: + return this.TrainingJumpToLastMeasure; } throw new IndexOutOfRangeException(); } set { switch (index) { - case (int)EKeyConfigPart.Drums: - this.Drums = value; + case (int)EKeyConfigPad.HH: + this.padHH_R = value; return; - case (int)EKeyConfigPart.Guitar: - this.Guitar = value; + case (int)EKeyConfigPad.SD: + this.padSD_G = value; return; - case (int)EKeyConfigPart.Bass: - this.Bass = value; + case (int)EKeyConfigPad.BD: + this.padBD_B = value; return; - case (int)EKeyConfigPart.Taiko: - this.Taiko = value; + case (int)EKeyConfigPad.Pick: + this.padHT_Pick = value; return; - case (int)EKeyConfigPart.System: - this.System = value; + case (int)EKeyConfigPad.LT: + this.padLT_Wail = value; + return; + + case (int)EKeyConfigPad.FT: + this.padFT_Cancel = value; + return; + + case (int)EKeyConfigPad.CY: + this.padCY_Decide = value; + return; + + case (int)EKeyConfigPad.HHO: + this.padHHO = value; + return; + + case (int)EKeyConfigPad.RD: + this.padRD = value; + return; + + case (int)EKeyConfigPad.LC: + this.padLC = value; + return; + + case (int)EKeyConfigPad.LP: + this.padLP = value; + return; + + case (int)EKeyConfigPad.LBD: + this.padLBD = value; + return; + + case (int)EKeyConfigPad.LRed: + this.padLRed = value; + return; + + case (int)EKeyConfigPad.RRed: + this.padRRed = value; + return; + + case (int)EKeyConfigPad.LBlue: + this.padLBlue = value; + return; + + case (int)EKeyConfigPad.RBlue: + this.padRBlue = value; + return; + + case (int)EKeyConfigPad.LRed2P: + this.padLRed2P = value; + return; + + case (int)EKeyConfigPad.RRed2P: + this.padRRed2P = value; + return; + + case (int)EKeyConfigPad.LBlue2P: + this.padLBlue2P = value; + return; + + case (int)EKeyConfigPad.RBlue2P: + this.padRBlue2P = value; + return; + + case (int)EKeyConfigPad.LRed3P: + this.padLRed3P = value; + return; + + case (int)EKeyConfigPad.RRed3P: + this.padRRed3P = value; + return; + + case (int)EKeyConfigPad.LBlue3P: + this.padLBlue3P = value; + return; + + case (int)EKeyConfigPad.RBlue3P: + this.padRBlue3P = value; + return; + + case (int)EKeyConfigPad.LRed4P: + this.padLRed4P = value; + return; + + case (int)EKeyConfigPad.RRed4P: + this.padRRed4P = value; + return; + + case (int)EKeyConfigPad.LBlue4P: + this.padLBlue4P = value; + return; + + case (int)EKeyConfigPad.RBlue4P: + this.padRBlue4P = value; + return; + + case (int)EKeyConfigPad.LRed5P: + this.padLRed5P = value; + return; + + case (int)EKeyConfigPad.RRed5P: + this.padRRed5P = value; + return; + + case (int)EKeyConfigPad.LBlue5P: + this.padLBlue5P = value; + return; + + case (int)EKeyConfigPad.RBlue5P: + this.padRBlue5P = value; + return; + + case (int)EKeyConfigPad.Clap: + this.padClap = value; + return; + + case (int)EKeyConfigPad.Clap2P: + this.padClap2P = value; + return; + + case (int)EKeyConfigPad.Clap3P: + this.padClap3P = value; + return; + + case (int)EKeyConfigPad.Clap4P: + this.padClap4P = value; + return; + + case (int)EKeyConfigPad.Clap5P: + this.padClap5P = value; + return; + + case (int)EKeyConfigPad.LeftChange: + this.padLeftChange = value; + return; + + case (int)EKeyConfigPad.RightChange: + this.padRightChange = value; + return; + + case (int)EKeyConfigPad.Capture: + this.padCapture = value; + return; + + case (int)EKeyConfigPad.SongVolumeIncrease: + this.padSongVolIncrease = value; + return; + + case (int)EKeyConfigPad.SongVolumeDecrease: + this.padSongVolDecrease = value; + return; + + case (int)EKeyConfigPad.DisplayHits: + this.padDisplayHits = value; + return; + + case (int)EKeyConfigPad.DisplayDebug: + this.padDisplayDebug = value; + return; + + case (int)EKeyConfigPad.QuickConfig: + this.padQuickConfig = value; + return; + + case (int)EKeyConfigPad.NewHeya: + this.padNewHeya = value; + return; + + case (int)EKeyConfigPad.SortSongs: + this.padSortSongs = value; + return; + + case (int)EKeyConfigPad.ToggleAutoP1: + this.padToggleAutoP1 = value; + return; + + case (int)EKeyConfigPad.ToggleAutoP2: + this.padToggleAutoP2 = value; + return; + + case (int)EKeyConfigPad.ToggleTrainingMode: + this.padToggleTrainingMode = value; + return; + + case (int)EKeyConfigPad.CycleVideoDisplayMode: + this.padCycleVideoDisplayMode = value; + return; + + case (int)EKeyConfigPad.TrainingIncreaseScrollSpeed: + this.TrainingIncreaseScrollSpeed = value; + return; + + case (int)EKeyConfigPad.TrainingDecreaseScrollSpeed: + this.TrainingDecreaseScrollSpeed = value; + return; + + case (int)EKeyConfigPad.TrainingIncreaseSongSpeed: + this.TrainingIncreaseSongSpeed = value; + return; + + case (int)EKeyConfigPad.TrainingDecreaseSongSpeed: + this.TrainingDecreaseSongSpeed = value; + return; + + case (int)EKeyConfigPad.TrainingToggleAuto: + this.TrainingToggleAuto = value; + return; + + case (int)EKeyConfigPad.TrainingBranchNormal: + this.TrainingBranchNormal = value; + return; + + case (int)EKeyConfigPad.TrainingBranchExpert: + this.TrainingBranchExpert = value; + return; + + case (int)EKeyConfigPad.TrainingBranchMaster: + this.TrainingBranchMaster = value; + return; + + case (int)EKeyConfigPad.TrainingPause: + this.TrainingPause = value; + return; + + case (int)EKeyConfigPad.TrainingBookmark: + this.TrainingBookmark = value; + return; + + case (int)EKeyConfigPad.TrainingMoveForwardMeasure: + this.TrainingMoveForwardMeasure = value; + return; + + case (int)EKeyConfigPad.TrainingMoveBackMeasure: + this.TrainingMoveBackMeasure = value; + return; + + case (int)EKeyConfigPad.TrainingSkipForwardMeasure: + this.TrainingSkipForwardMeasure = value; + return; + + case (int)EKeyConfigPad.TrainingSkipBackMeasure: + this.TrainingSkipBackMeasure = value; + return; + + case (int)EKeyConfigPad.TrainingJumpToFirstMeasure: + this.TrainingJumpToFirstMeasure = value; + return; + + case (int)EKeyConfigPad.TrainingJumpToLastMeasure: + this.TrainingJumpToLastMeasure = value; return; } throw new IndexOutOfRangeException(); } } + + #region [ private ] + + //----------------- + private CConfigIni.CKeyAssign.STKEYASSIGN[] padBD_B; + private CConfigIni.CKeyAssign.STKEYASSIGN[] padCY_Decide; + private CConfigIni.CKeyAssign.STKEYASSIGN[] padFT_Cancel; + private CConfigIni.CKeyAssign.STKEYASSIGN[] padHH_R; + private CConfigIni.CKeyAssign.STKEYASSIGN[] padHHO; + private CConfigIni.CKeyAssign.STKEYASSIGN[] padHT_Pick; + private CConfigIni.CKeyAssign.STKEYASSIGN[] padLC; + private CConfigIni.CKeyAssign.STKEYASSIGN[] padLT_Wail; + private CConfigIni.CKeyAssign.STKEYASSIGN[] padRD; + private CConfigIni.CKeyAssign.STKEYASSIGN[] padSD_G; + private CConfigIni.CKeyAssign.STKEYASSIGN[] padLP; + private CConfigIni.CKeyAssign.STKEYASSIGN[] padLBD; + + private CConfigIni.CKeyAssign.STKEYASSIGN[] padLRed; + private CConfigIni.CKeyAssign.STKEYASSIGN[] padLBlue; + private CConfigIni.CKeyAssign.STKEYASSIGN[] padRRed; + private CConfigIni.CKeyAssign.STKEYASSIGN[] padRBlue; + + private CConfigIni.CKeyAssign.STKEYASSIGN[] padLRed2P; + private CConfigIni.CKeyAssign.STKEYASSIGN[] padLBlue2P; + private CConfigIni.CKeyAssign.STKEYASSIGN[] padRRed2P; + private CConfigIni.CKeyAssign.STKEYASSIGN[] padRBlue2P; + + private CConfigIni.CKeyAssign.STKEYASSIGN[] padLRed3P; + private CConfigIni.CKeyAssign.STKEYASSIGN[] padLBlue3P; + private CConfigIni.CKeyAssign.STKEYASSIGN[] padRRed3P; + private CConfigIni.CKeyAssign.STKEYASSIGN[] padRBlue3P; + + private CConfigIni.CKeyAssign.STKEYASSIGN[] padLRed4P; + private CConfigIni.CKeyAssign.STKEYASSIGN[] padLBlue4P; + private CConfigIni.CKeyAssign.STKEYASSIGN[] padRRed4P; + private CConfigIni.CKeyAssign.STKEYASSIGN[] padRBlue4P; + + private CConfigIni.CKeyAssign.STKEYASSIGN[] padLRed5P; + private CConfigIni.CKeyAssign.STKEYASSIGN[] padLBlue5P; + private CConfigIni.CKeyAssign.STKEYASSIGN[] padRRed5P; + private CConfigIni.CKeyAssign.STKEYASSIGN[] padRBlue5P; + + private CConfigIni.CKeyAssign.STKEYASSIGN[] padClap; + private CConfigIni.CKeyAssign.STKEYASSIGN[] padClap2P; + private CConfigIni.CKeyAssign.STKEYASSIGN[] padClap3P; + private CConfigIni.CKeyAssign.STKEYASSIGN[] padClap4P; + private CConfigIni.CKeyAssign.STKEYASSIGN[] padClap5P; + private CConfigIni.CKeyAssign.STKEYASSIGN[] padLeftChange; + private CConfigIni.CKeyAssign.STKEYASSIGN[] padRightChange; + + private CConfigIni.CKeyAssign.STKEYASSIGN[] padCapture; + private CConfigIni.CKeyAssign.STKEYASSIGN[] padSongVolIncrease; + private CConfigIni.CKeyAssign.STKEYASSIGN[] padSongVolDecrease; + private CConfigIni.CKeyAssign.STKEYASSIGN[] padDisplayHits; + private CConfigIni.CKeyAssign.STKEYASSIGN[] padDisplayDebug; + private CConfigIni.CKeyAssign.STKEYASSIGN[] padQuickConfig; + private CConfigIni.CKeyAssign.STKEYASSIGN[] padNewHeya; + private CConfigIni.CKeyAssign.STKEYASSIGN[] padSortSongs; + private CConfigIni.CKeyAssign.STKEYASSIGN[] padToggleAutoP1; + private CConfigIni.CKeyAssign.STKEYASSIGN[] padToggleAutoP2; + private CConfigIni.CKeyAssign.STKEYASSIGN[] padToggleTrainingMode; + private CConfigIni.CKeyAssign.STKEYASSIGN[] padCycleVideoDisplayMode; + + public CConfigIni.CKeyAssign.STKEYASSIGN[] TrainingIncreaseScrollSpeed; + public CConfigIni.CKeyAssign.STKEYASSIGN[] TrainingDecreaseScrollSpeed; + public CConfigIni.CKeyAssign.STKEYASSIGN[] TrainingToggleAuto; + public CConfigIni.CKeyAssign.STKEYASSIGN[] TrainingBranchNormal; + public CConfigIni.CKeyAssign.STKEYASSIGN[] TrainingBranchExpert; + public CConfigIni.CKeyAssign.STKEYASSIGN[] TrainingBranchMaster; + public CConfigIni.CKeyAssign.STKEYASSIGN[] TrainingPause; + public CConfigIni.CKeyAssign.STKEYASSIGN[] TrainingBookmark; + public CConfigIni.CKeyAssign.STKEYASSIGN[] TrainingMoveForwardMeasure; + public CConfigIni.CKeyAssign.STKEYASSIGN[] TrainingMoveBackMeasure; + public CConfigIni.CKeyAssign.STKEYASSIGN[] TrainingSkipForwardMeasure; + public CConfigIni.CKeyAssign.STKEYASSIGN[] TrainingSkipBackMeasure; + public CConfigIni.CKeyAssign.STKEYASSIGN[] TrainingIncreaseSongSpeed; + public CConfigIni.CKeyAssign.STKEYASSIGN[] TrainingDecreaseSongSpeed; + public CConfigIni.CKeyAssign.STKEYASSIGN[] TrainingJumpToFirstMeasure; + + public CConfigIni.CKeyAssign.STKEYASSIGN[] TrainingJumpToLastMeasure; + //----------------- + + #endregion } - #endregion - - // - public enum ESoundDeviceTypeForConfig { - Bass, - ASIO, - WASAPI_Exclusive, - WASAPI_Shared, - Unknown = 99 + public bool KeyIsPressed(STKEYASSIGN[] pad) { + return OpenTaiko.InputManager.Keyboard.KeyPressed(pad.ToList().ConvertAll(key => key.Code)); } - // Properties - public class CAIPerformances { - public int nGoodOdds; - public int nPerfectOdds; - public int nBadOdds; - public int nRollSpeed; - public int nMineHitOdds; + [StructLayout(LayoutKind.Sequential)] + public struct STKEYASSIGN { + public EInputDevice InputDevice; + public int ID; + public int Code; - public CAIPerformances(int po, int go, int bo, int rp, int mho = 0) { - nGoodOdds = go; - nPerfectOdds = po; - nBadOdds = bo; - nRollSpeed = rp; - nMineHitOdds = mho; + public STKEYASSIGN(EInputDevice DeviceType, int nID, int nCode) { + this.InputDevice = DeviceType; + this.ID = nID; + this.Code = nCode; } } - public class CTimingZones { - public int nGoodZone; - public int nOkZone; - public int nBadZone; + public CKeyAssignPad Bass = new CKeyAssignPad(); + public CKeyAssignPad Drums = new CKeyAssignPad(); + public CKeyAssignPad Guitar = new CKeyAssignPad(); + public CKeyAssignPad Taiko = new CKeyAssignPad(); + public CKeyAssignPad System = new CKeyAssignPad(); - public CTimingZones(int gz, int oz, int bz) { - nGoodZone = gz; - nOkZone = oz; - nBadZone = bz; - } - } - - public int nBGAlpha; - public bool bEnableAVI; - public bool bEnableBGA; - public bool bBGMPlayVoiceSound; - public bool bOutputDetailedDTXLog; - public bool bOutputSongSearchLog; - public bool bOutputCreationReleaseLog; - public STDGBVALUE bReverse; - - public bool bDanTowerHide; - - public bool bTight; - public bool bIncludeSubfoldersOnRandomSelect; - public bool bOutputLogs; - public bool bDisplayDebugInfo; - public bool bEnableVSync; - public bool bFullScreen; - public bool bIgnoreSongUnlockables; - public int nWindowBaseXPosition; // #30675 2013.02.04 ikanick add - public int nWindowBaseYPosition; - public int nWindowWidth; // #23510 2010.10.31 yyagi add - public int nWindowHeight; // #23510 2010.10.31 yyagi add - public Dictionary dicJoystick; - public Dictionary dicGamepad; - public ERandomMode[] eRandom; - public CKeyAssign KeyAssign; - public int nMsSleepUnfocused; // #23568 2010.11.04 ikanick add - public int nMsSleepPerFrame; // #xxxxx 2011.11.27 yyagi add - public int nSongSpeed; - - public double SongPlaybackSpeed { - get => ((double)nSongSpeed) / 20.0; - } - - public bool bNoAudioIfNot1xSpeed; // FIXME: Negation should be removed and booleans flipped - public int nMsWaitPreviewSoundFromSongSelected; - public int nMsWaitPreviewImageFromSongSelected; - - private bool _applyLoudnessMetadata; - - public bool ApplyLoudnessMetadata { - get => _applyLoudnessMetadata; - set => SetProperty(ref _applyLoudnessMetadata, value, nameof(ApplyLoudnessMetadata)); - } - - private double _targetLoudness; - - public double TargetLoudness { - get => _targetLoudness; - set => SetProperty(ref _targetLoudness, value, nameof(TargetLoudness)); - } - - private bool _applySongVol; - - public bool ApplySongVol { - get => _applySongVol; - set => SetProperty(ref _applySongVol, value, nameof(ApplySongVol)); - } - - private int _soundEffectLevel; - - public int SoundEffectLevel { - get => _soundEffectLevel; - set => SetProperty(ref _soundEffectLevel, value, nameof(SoundEffectLevel)); - } - - private int _voiceLevel; - - public int VoiceLevel { - get => _voiceLevel; - set => SetProperty(ref _voiceLevel, value, nameof(VoiceLevel)); - } - - private int _songPreviewLevel; - - public int SongPreviewLevel { - get => _songPreviewLevel; - set => SetProperty(ref _songPreviewLevel, value, nameof(SongPreviewLevel)); - } - - private int _songPlaybackLevel; - - public int SongPlaybackLevel { - get => _songPlaybackLevel; - set => SetProperty(ref _songPlaybackLevel, value, nameof(SongPlaybackLevel)); - } - - private int _keyboardSoundLevelIncrement; - - public int KeyboardSoundLevelIncrement { - get => _keyboardSoundLevelIncrement; - set => SetProperty( - ref _keyboardSoundLevelIncrement, - value.Clamp(MinimumKeyboardSoundLevelIncrement, MaximumKeyboardSoundLevelIncrement), - nameof(KeyboardSoundLevelIncrement)); - } - - public STDGBVALUE nMinDisplayedCombo; - public int[] nScrollSpeed; - public int[] nTimingZones; - public EGameType[] nGameType; - public EFunMods[] nFunMods; - public string strSongsPath; - public string FontName; - public string BoxFontName; - public bool bBranchGuide; - public int nScoreMode; - public int nDefaultCourse; //2017.01.30 DD デフォルトでカーソルをあわせる難易度 - - private int _nPlayerCount; - public int nPreviousPlayerCount = 1; // Specific usages - - public int nPlayerCount { + public CKeyAssignPad this[int index] { get { - if (bAIBattleMode) { - return 2; - } else { - return _nPlayerCount; - } - } - set { _nPlayerCount = value; } - } + switch (index) { + case (int)EKeyConfigPart.Drums: + return this.Drums; - public bool[] bAutoPlay = new bool[5]; + case (int)EKeyConfigPart.Guitar: + return this.Guitar; - public bool bAuto先生の連打; - public int nRollsPerSec; - public int nDefaultAILevel = 4; - public int nAILevel = 4; - public bool bAIBattleMode = false; + case (int)EKeyConfigPart.Bass: + return this.Bass; - public CAIPerformances[] apAIPerformances = { - new CAIPerformances(500, 400, 100, 7, 200), - new CAIPerformances(650, 310, 40, 8, 150), - new CAIPerformances(750, 225, 25, 9, 100), - new CAIPerformances(800, 180, 20, 10, 70), - new CAIPerformances(850, 135, 15, 12, 50), - new CAIPerformances(900, 90, 10, 14, 30), - new CAIPerformances(920, 75, 5, 16, 20), - new CAIPerformances(950, 49, 1, 22, 10), - new CAIPerformances(975, 25, 0, 26, 5), - new CAIPerformances(1000, 0, 0, 30, 0) - }; + case (int)EKeyConfigPart.Taiko: + return this.Taiko; - public CTimingZones[] tzLevels = { - new CTimingZones(75, 108, 125), // Lv0 (Easy-Normal + "Loose" mod) - new CTimingZones(58, 108, 125), // Lv1 (Easy-Normal + "Lenient" mod) - new CTimingZones(42, 108, 125), // Lv2 (Easy-Normal / Tower Ama-kuchi or Hard-Extreme + "Loose" mod) - new CTimingZones(42, 75, 108), // Lv3 (Hard-Extreme + "Lenient" timing mod or Easy-Normal + "Strict" mod) - new CTimingZones(25, 75, 108), // Lv4 (Hard-Extreme / Tower Ex Kara-kuchi / Dan or Easy-Normal + "Rigorous" mod) - new CTimingZones(25, 58, 108), // Lv5 (Hard-Extreme + "Strict" mod (Tatsu)) - new CTimingZones(17, 42, 108) // Lv6 (Hard-Extreme + "Rigorous" mod) - }; - - public bool bJudgeBigNotes; - public bool bForceNormalGauge; - public int nBigNoteWaitTimems; - public int nBranchAnime; - - // I18N choosen language - public string sLang; - - // Song select screen layout type - public int nLayoutType; - - public bool bJudgeCountDisplay; - - public bool ShowExExtraAnime; - - public bool bEnableCountdownTimer; - - // Display/Hide settings for each image - public bool ShowChara; - public bool ShowDancer; - public bool ShowRunner; - public bool ShowFooter; - public bool ShowMob; - public bool ShowPuchiChara; // リザーブ - - public bool bHispeedRandom; - public EStealthMode[] eSTEALTH; - public bool bNoInfo; - - public int nDefaultSongSort; - public int nRecentlyPlayedMax; - public EGame eGameMode; - public int TokkunSkipMeasures; - public int TokkunMashInterval; - public bool bSuperHard = false; - public bool bTokkunMode = false; - public int[] bJust = new int[5] { 0, 0, 0, 0, 0 }; - - public int[] nHitSounds = new int[5] { 0, 0, 0, 0, 0 }; - - public int[][] nPanning = new int[5][] { - new int[1] { 0 }, - new int[2] { -100, 100 }, - new int[3] { -100, 0, 100 }, - new int[4] { -100, -33, 33, 100 }, - new int[5] { -100, -50, 0, 50, 100 }, - }; - - public string[] sSaveFile = new string[5] { "1P", "2P", "3P", "4P", "5P" }; - - public bool bEndingAnime = false; // 2017.01.27 DD 「また遊んでね」画面の有効/無効オプション追加 - - public STDGBVALUE JudgeTextDisplayPosition; - public int nInputAdjustTimeMs; - public int nGlobalOffsetMs; - public bool bIsAutoResultCapture; // #25399 2011.6.9 yyagi リザルト画像自動保存機能のON/OFF制御 - public int nPoliphonicSounds; // #28228 2012.5.1 yyagi レーン毎の最大同時発音数 - public bool bBufferedInputs; - public bool bIsEnabledSystemMenu; // #28200 2012.5.1 yyagi System Menuの使用可否切替 - public string strSystemSkinSubfolderFullName; // #28195 2012.5.2 yyagi Skin切替用 System/以下のサブフォルダ名 - - public void tInitializeAILevel() { - this.nAILevel = this.nDefaultAILevel; - } - - public bool bEnterIsNotUsedInKeyAssignments { - get { - for (int i = 0; i <= (int)EKeyConfigPart.System; i++) { - for (int j = 0; j < (int)EKeyConfigPad.Max; j++) { - for (int k = 0; k < 0x10; k++) { - if ((this.KeyAssign[i][j][k].InputDevice == EInputDevice.Keyboard) && - (this.KeyAssign[i][j][k].Code == (int)SlimDXKeys.Key.Return)) { - return false; - } - } - } + case (int)EKeyConfigPart.System: + return this.System; } - return true; + throw new IndexOutOfRangeException(); } - } - - public bool bWindowMode { - get { return !this.bFullScreen; } - set { this.bFullScreen = !value; } - } - - public bool bDoNotDisplayPerformanceInfos { - // FIXME: should be flipped - get { return !this.bDisplayDebugInfo; } - set { this.bDisplayDebugInfo = !value; } - } - - public int nBackgroundTransparency { - get { return this.nBGAlpha; } set { - if (value < 0) { - this.nBGAlpha = 0; - } else if (value > 0xff) { - this.nBGAlpha = 0xff; - } else { - this.nBGAlpha = value; + switch (index) { + case (int)EKeyConfigPart.Drums: + this.Drums = value; + return; + + case (int)EKeyConfigPart.Guitar: + this.Guitar = value; + return; + + case (int)EKeyConfigPart.Bass: + this.Bass = value; + return; + + case (int)EKeyConfigPart.Taiko: + this.Taiko = value; + return; + + case (int)EKeyConfigPart.System: + this.System = value; + return; } + + throw new IndexOutOfRangeException(); } } + } - public int nGraphicsDeviceType; - public int nRisky; // #23559 2011.6.20 yyagi Riskyでの残ミス数。0で閉店 - public bool bIsAllowedDoubleClickFullscreen; // #26752 2011.11.27 yyagi ダブルクリックしてもフルスクリーンに移行しない + #endregion - public int - nSoundDeviceType; // #24820 2012.12.23 yyagi 出力サウンドデバイス(0=ACM(にしたいが設計がきつそうならDirectShow), 1=ASIO, 2=WASAPI) + // + public enum ESoundDeviceTypeForConfig { + Bass, + ASIO, + WASAPI_Exclusive, + WASAPI_Shared, + Unknown = 99 + } + // Properties - public int nBassBufferSizeMs; // #24820 2013.1.15 yyagi WASAPIのバッファサイズ + public class CAIPerformances { + public int nGoodOdds; + public int nPerfectOdds; + public int nBadOdds; + public int nRollSpeed; + public int nMineHitOdds; - public int nWASAPIBufferSizeMs; // #24820 2013.1.15 yyagi WASAPIのバッファサイズ + public CAIPerformances(int po, int go, int bo, int rp, int mho = 0) { + nGoodOdds = go; + nPerfectOdds = po; + nBadOdds = bo; + nRollSpeed = rp; + nMineHitOdds = mho; + } + } - // public int nASIOBufferSizeMs; // #24820 2012.12.28 yyagi ASIOのバッファサイズ - public int nASIODevice; // #24820 2013.1.17 yyagi ASIOデバイス - public bool bUseOSTimer; // #33689 2014.6.6 yyagi 演奏タイマーの種類 - public bool bDynamicBassMixerManagement; // #24820 - public bool bTimeStretch; // #23664 2013.2.24 yyagi ピッチ変更無しで再生速度を変更するかどうか - public STDGBVALUE eInvisible; // #32072 2013.9.20 yyagi チップを非表示にする - public int nDisplayTimesMs, nFadeoutTimeMs; + public class CTimingZones { + public int nGoodZone; + public int nOkZone; + public int nBadZone; - public STDGBVALUE nViewerScrollSpeed; - public bool bViewerVSyncWait; - public bool bViewerShowDebugStatus; - public bool bViewerTimeStretch; - public bool bViewerDrums有効, bViewerGuitar有効; - public int nMasterVolume; - public bool ShinuchiMode; // 真打モード - public bool FastRender; // 事前画像描画モード - public bool ASyncTextureLoad; // 事前画像描画モード - public bool PreAssetsLoading; // 事前画像描画モード - public bool SimpleMode; // 事前画像描画モード - public int MusicPreTimeMs; // 音源再生前の待機時間ms + public CTimingZones(int gz, int oz, int bz) { + nGoodZone = gz; + nOkZone = oz; + nBadZone = bz; + } + } - public bool TJAP3FolderMode { get; private set; } + public int nBGAlpha; + public bool bEnableAVI; + public bool bEnableBGA; + public bool bBGMPlayVoiceSound; + public bool bOutputDetailedDTXLog; + public bool bOutputSongSearchLog; + public bool bOutputCreationReleaseLog; + public STDGBVALUE bReverse; + public bool bDanTowerHide; - /// - /// DiscordのRitch Presenceに再生中の.tjaファイルの情報を送信するかどうか。 - /// - public bool SendDiscordPlayingInformation; + public bool bTight; + public bool bIncludeSubfoldersOnRandomSelect; + public bool bOutputLogs; + public bool bDisplayDebugInfo; + public bool bEnableVSync; + public bool bFullScreen; + public bool bIgnoreSongUnlockables; + public int nWindowBaseXPosition; // #30675 2013.02.04 ikanick add + public int nWindowBaseYPosition; + public int nWindowWidth; // #23510 2010.10.31 yyagi add + public int nWindowHeight; // #23510 2010.10.31 yyagi add + public Dictionary dicJoystick; + public Dictionary dicGamepad; + public ERandomMode[] eRandom; + public CKeyAssign KeyAssign; + public int nMsSleepUnfocused; // #23568 2010.11.04 ikanick add + public int nMsSleepPerFrame; // #xxxxx 2011.11.27 yyagi add + public int nSongSpeed; - #region [ STRANGE ] + public double SongPlaybackSpeed { + get => ((double)nSongSpeed) / 20.0; + } - public STRANGE nHitRangeMs; + public bool bNoAudioIfNot1xSpeed; // FIXME: Negation should be removed and booleans flipped + public int nMsWaitPreviewSoundFromSongSelected; + public int nMsWaitPreviewImageFromSongSelected; - [StructLayout(LayoutKind.Sequential)] - public struct STRANGE { - public int Perfect; - public int Great; - public int Good; - public int Poor; + private bool _applyLoudnessMetadata; - public int this[int index] { - get { - switch (index) { - case 0: - return this.Perfect; + public bool ApplyLoudnessMetadata { + get => _applyLoudnessMetadata; + set => SetProperty(ref _applyLoudnessMetadata, value, nameof(ApplyLoudnessMetadata)); + } - case 1: - return this.Great; + private double _targetLoudness; - case 2: - return this.Good; + public double TargetLoudness { + get => _targetLoudness; + set => SetProperty(ref _targetLoudness, value, nameof(TargetLoudness)); + } - case 3: - return this.Poor; - } + private bool _applySongVol; - throw new IndexOutOfRangeException(); - } - set { - switch (index) { - case 0: - this.Perfect = value; - return; + public bool ApplySongVol { + get => _applySongVol; + set => SetProperty(ref _applySongVol, value, nameof(ApplySongVol)); + } - case 1: - this.Great = value; - return; + private int _soundEffectLevel; - case 2: - this.Good = value; - return; + public int SoundEffectLevel { + get => _soundEffectLevel; + set => SetProperty(ref _soundEffectLevel, value, nameof(SoundEffectLevel)); + } - case 3: - this.Poor = value; - return; - } + private int _voiceLevel; - throw new IndexOutOfRangeException(); - } + public int VoiceLevel { + get => _voiceLevel; + set => SetProperty(ref _voiceLevel, value, nameof(VoiceLevel)); + } + + private int _songPreviewLevel; + + public int SongPreviewLevel { + get => _songPreviewLevel; + set => SetProperty(ref _songPreviewLevel, value, nameof(SongPreviewLevel)); + } + + private int _songPlaybackLevel; + + public int SongPlaybackLevel { + get => _songPlaybackLevel; + set => SetProperty(ref _songPlaybackLevel, value, nameof(SongPlaybackLevel)); + } + + private int _keyboardSoundLevelIncrement; + + public int KeyboardSoundLevelIncrement { + get => _keyboardSoundLevelIncrement; + set => SetProperty( + ref _keyboardSoundLevelIncrement, + value.Clamp(MinimumKeyboardSoundLevelIncrement, MaximumKeyboardSoundLevelIncrement), + nameof(KeyboardSoundLevelIncrement)); + } + + public STDGBVALUE nMinDisplayedCombo; + public int[] nScrollSpeed; + public int[] nTimingZones; + public EGameType[] nGameType; + public EFunMods[] nFunMods; + public string strSongsPath; + public string FontName; + public string BoxFontName; + public bool bBranchGuide; + public int nScoreMode; + public int nDefaultCourse; //2017.01.30 DD デフォルトでカーソルをあわせる難易度 + + private int _nPlayerCount; + public int nPreviousPlayerCount = 1; // Specific usages + + public int nPlayerCount { + get { + if (bAIBattleMode) { + return 2; + } else { + return _nPlayerCount; } } + set { _nPlayerCount = value; } + } - #endregion + public bool[] bAutoPlay = new bool[5]; - #region [ STLANEVALUE ] + public bool bAuto先生の連打; + public int nRollsPerSec; + public int nDefaultAILevel = 4; + public int nAILevel = 4; + public bool bAIBattleMode = false; - public STLANEVALUE nVelocityMin; + public CAIPerformances[] apAIPerformances = { + new CAIPerformances(500, 400, 100, 7, 200), + new CAIPerformances(650, 310, 40, 8, 150), + new CAIPerformances(750, 225, 25, 9, 100), + new CAIPerformances(800, 180, 20, 10, 70), + new CAIPerformances(850, 135, 15, 12, 50), + new CAIPerformances(900, 90, 10, 14, 30), + new CAIPerformances(920, 75, 5, 16, 20), + new CAIPerformances(950, 49, 1, 22, 10), + new CAIPerformances(975, 25, 0, 26, 5), + new CAIPerformances(1000, 0, 0, 30, 0) + }; - [StructLayout(LayoutKind.Sequential)] - public struct STLANEVALUE { - public int LC; - public int HH; - public int SD; - public int BD; - public int HT; - public int LT; - public int FT; - public int CY; - public int RD; - public int LP; - public int LBD; - public int Guitar; - public int Bass; + public CTimingZones[] tzLevels = { + new CTimingZones(75, 108, 125), // Lv0 (Easy-Normal + "Loose" mod) + new CTimingZones(58, 108, 125), // Lv1 (Easy-Normal + "Lenient" mod) + new CTimingZones(42, 108, 125), // Lv2 (Easy-Normal / Tower Ama-kuchi or Hard-Extreme + "Loose" mod) + new CTimingZones(42, 75, 108), // Lv3 (Hard-Extreme + "Lenient" timing mod or Easy-Normal + "Strict" mod) + new CTimingZones(25, 75, 108), // Lv4 (Hard-Extreme / Tower Ex Kara-kuchi / Dan or Easy-Normal + "Rigorous" mod) + new CTimingZones(25, 58, 108), // Lv5 (Hard-Extreme + "Strict" mod (Tatsu)) + new CTimingZones(17, 42, 108) // Lv6 (Hard-Extreme + "Rigorous" mod) + }; - public int this[int index] { - get { - switch (index) { - case 0: - return this.LC; + public bool bJudgeBigNotes; + public bool bForceNormalGauge; + public int nBigNoteWaitTimems; + public int nBranchAnime; - case 1: - return this.HH; + // I18N choosen language + public string sLang; - case 2: - return this.SD; + // Song select screen layout type + public int nLayoutType; - case 3: - return this.BD; + public bool bJudgeCountDisplay; - case 4: - return this.HT; + public bool ShowExExtraAnime; - case 5: - return this.LT; + public bool bEnableCountdownTimer; - case 6: - return this.FT; + // Display/Hide settings for each image + public bool ShowChara; + public bool ShowDancer; + public bool ShowRunner; + public bool ShowFooter; + public bool ShowMob; + public bool ShowPuchiChara; // リザーブ - case 7: - return this.CY; + public bool bHispeedRandom; + public EStealthMode[] eSTEALTH; + public bool bNoInfo; - case 8: - return this.RD; + public int nDefaultSongSort; + public int nRecentlyPlayedMax; + public EGame eGameMode; + public int TokkunSkipMeasures; + public int TokkunMashInterval; + public bool bSuperHard = false; + public bool bTokkunMode = false; + public int[] bJust = new int[5] { 0, 0, 0, 0, 0 }; - case 9: - return this.LP; + public int[] nHitSounds = new int[5] { 0, 0, 0, 0, 0 }; - case 10: - return this.LBD; + public int[][] nPanning = new int[5][] { + new int[1] { 0 }, + new int[2] { -100, 100 }, + new int[3] { -100, 0, 100 }, + new int[4] { -100, -33, 33, 100 }, + new int[5] { -100, -50, 0, 50, 100 }, + }; - case 11: - return this.Guitar; + public string[] sSaveFile = new string[5] { "1P", "2P", "3P", "4P", "5P" }; - case 12: - return this.Bass; + public bool bEndingAnime = false; // 2017.01.27 DD 「また遊んでね」画面の有効/無効オプション追加 + + public STDGBVALUE JudgeTextDisplayPosition; + public int nInputAdjustTimeMs; + public int nGlobalOffsetMs; + public bool bIsAutoResultCapture; // #25399 2011.6.9 yyagi リザルト画像自動保存機能のON/OFF制御 + public int nPoliphonicSounds; // #28228 2012.5.1 yyagi レーン毎の最大同時発音数 + public bool bBufferedInputs; + public bool bIsEnabledSystemMenu; // #28200 2012.5.1 yyagi System Menuの使用可否切替 + public string strSystemSkinSubfolderFullName; // #28195 2012.5.2 yyagi Skin切替用 System/以下のサブフォルダ名 + + public void tInitializeAILevel() { + this.nAILevel = this.nDefaultAILevel; + } + + public bool bEnterIsNotUsedInKeyAssignments { + get { + for (int i = 0; i <= (int)EKeyConfigPart.System; i++) { + for (int j = 0; j < (int)EKeyConfigPad.Max; j++) { + for (int k = 0; k < 0x10; k++) { + if ((this.KeyAssign[i][j][k].InputDevice == EInputDevice.Keyboard) && + (this.KeyAssign[i][j][k].Code == (int)SlimDXKeys.Key.Return)) { + return false; + } } - - throw new IndexOutOfRangeException(); - } - set { - switch (index) { - case 0: - this.LC = value; - return; - - case 1: - this.HH = value; - return; - - case 2: - this.SD = value; - return; - - case 3: - this.BD = value; - return; - - case 4: - this.HT = value; - return; - - case 5: - this.LT = value; - return; - - case 6: - this.FT = value; - return; - - case 7: - this.CY = value; - return; - - case 8: - this.RD = value; - return; - - case 9: - this.LP = value; - return; - - case 10: - this.LBD = value; - return; - - case 11: - this.Guitar = value; - return; - - case 12: - this.Bass = value; - return; - } - - throw new IndexOutOfRangeException(); } } + + return true; + } + } + + public bool bWindowMode { + get { return !this.bFullScreen; } + set { this.bFullScreen = !value; } + } + + public bool bDoNotDisplayPerformanceInfos { + // FIXME: should be flipped + get { return !this.bDisplayDebugInfo; } + set { this.bDisplayDebugInfo = !value; } + } + + public int nBackgroundTransparency { + get { return this.nBGAlpha; } + set { + if (value < 0) { + this.nBGAlpha = 0; + } else if (value > 0xff) { + this.nBGAlpha = 0xff; + } else { + this.nBGAlpha = value; + } + } + } + + public int nGraphicsDeviceType; + public int nRisky; // #23559 2011.6.20 yyagi Riskyでの残ミス数。0で閉店 + public bool bIsAllowedDoubleClickFullscreen; // #26752 2011.11.27 yyagi ダブルクリックしてもフルスクリーンに移行しない + + public int + nSoundDeviceType; // #24820 2012.12.23 yyagi 出力サウンドデバイス(0=ACM(にしたいが設計がきつそうならDirectShow), 1=ASIO, 2=WASAPI) + + public int nBassBufferSizeMs; // #24820 2013.1.15 yyagi WASAPIのバッファサイズ + + public int nWASAPIBufferSizeMs; // #24820 2013.1.15 yyagi WASAPIのバッファサイズ + + // public int nASIOBufferSizeMs; // #24820 2012.12.28 yyagi ASIOのバッファサイズ + public int nASIODevice; // #24820 2013.1.17 yyagi ASIOデバイス + public bool bUseOSTimer; // #33689 2014.6.6 yyagi 演奏タイマーの種類 + public bool bDynamicBassMixerManagement; // #24820 + public bool bTimeStretch; // #23664 2013.2.24 yyagi ピッチ変更無しで再生速度を変更するかどうか + public STDGBVALUE eInvisible; // #32072 2013.9.20 yyagi チップを非表示にする + public int nDisplayTimesMs, nFadeoutTimeMs; + + public STDGBVALUE nViewerScrollSpeed; + public bool bViewerVSyncWait; + public bool bViewerShowDebugStatus; + public bool bViewerTimeStretch; + public bool bViewerDrums有効, bViewerGuitar有効; + public int nMasterVolume; + public bool ShinuchiMode; // 真打モード + public bool FastRender; // 事前画像描画モード + public bool ASyncTextureLoad; // 事前画像描画モード + public bool PreAssetsLoading; // 事前画像描画モード + public bool SimpleMode; // 事前画像描画モード + public int MusicPreTimeMs; // 音源再生前の待機時間ms + + public bool TJAP3FolderMode { get; private set; } + + + /// + /// DiscordのRitch Presenceに再生中の.tjaファイルの情報を送信するかどうか。 + /// + public bool SendDiscordPlayingInformation; + + #region [ STRANGE ] + + public STRANGE nHitRangeMs; + + [StructLayout(LayoutKind.Sequential)] + public struct STRANGE { + public int Perfect; + public int Great; + public int Good; + public int Poor; + + public int this[int index] { + get { + switch (index) { + case 0: + return this.Perfect; + + case 1: + return this.Great; + + case 2: + return this.Good; + + case 3: + return this.Poor; + } + + throw new IndexOutOfRangeException(); + } + set { + switch (index) { + case 0: + this.Perfect = value; + return; + + case 1: + this.Great = value; + return; + + case 2: + this.Good = value; + return; + + case 3: + this.Poor = value; + return; + } + + throw new IndexOutOfRangeException(); + } + } + } + + #endregion + + #region [ STLANEVALUE ] + + public STLANEVALUE nVelocityMin; + + [StructLayout(LayoutKind.Sequential)] + public struct STLANEVALUE { + public int LC; + public int HH; + public int SD; + public int BD; + public int HT; + public int LT; + public int FT; + public int CY; + public int RD; + public int LP; + public int LBD; + public int Guitar; + public int Bass; + + public int this[int index] { + get { + switch (index) { + case 0: + return this.LC; + + case 1: + return this.HH; + + case 2: + return this.SD; + + case 3: + return this.BD; + + case 4: + return this.HT; + + case 5: + return this.LT; + + case 6: + return this.FT; + + case 7: + return this.CY; + + case 8: + return this.RD; + + case 9: + return this.LP; + + case 10: + return this.LBD; + + case 11: + return this.Guitar; + + case 12: + return this.Bass; + } + + throw new IndexOutOfRangeException(); + } + set { + switch (index) { + case 0: + this.LC = value; + return; + + case 1: + this.HH = value; + return; + + case 2: + this.SD = value; + return; + + case 3: + this.BD = value; + return; + + case 4: + this.HT = value; + return; + + case 5: + this.LT = value; + return; + + case 6: + this.FT = value; + return; + + case 7: + this.CY = value; + return; + + case 8: + this.RD = value; + return; + + case 9: + this.LP = value; + return; + + case 10: + this.LBD = value; + return; + + case 11: + this.Guitar = value; + return; + + case 12: + this.Bass = value; + return; + } + + throw new IndexOutOfRangeException(); + } + } + } + + #endregion + + + #region[Ver.K追加オプション] + + //-------------------------- + //ゲーム内のオプションに加えて、 + //システム周りのオプションもこのブロックで記述している。 + + #region[Display] + + //-------------------------- + public EClipDispType eClipDispType; + + #endregion + + #region[Position] + + public ELaneType eLaneType; + public EMirror eMirror; + + #endregion + + #region[System] + + public bool bDirectShowMode; + + #endregion + + #region[DEBUG] + + public bool DEBUG_bShowImgui; + + #endregion + + //-------------------------- + + #endregion + + + // Constructor + + public CConfigIni() { + this.strSongsPath = "Songs" + Path.DirectorySeparatorChar; + this.bFullScreen = false; + this.bIgnoreSongUnlockables = false; + this.bEnableVSync = true; + this.nWindowBaseXPosition = 100; // #30675 2013.02.04 ikanick add + this.nWindowBaseYPosition = 100; + this.nWindowWidth = SampleFramework.GameWindowSize.Width; // #23510 2010.10.31 yyagi add + this.nWindowHeight = SampleFramework.GameWindowSize.Height; // + this.nMsSleepPerFrame = -1; // #xxxxx 2011.11.27 yyagi add + this.nMsSleepUnfocused = 1; // #23568 2010.11.04 ikanick add + this._bGuitarEnabled = true; + this._bDrumsEnabled = true; + this.nBGAlpha = 100; + this.bEnableAVI = false; + this.eClipDispType = EClipDispType.BackgroundOnly; + this.bEnableBGA = true; + this.nMsWaitPreviewSoundFromSongSelected = 1000; + this.nMsWaitPreviewImageFromSongSelected = 100; + this.bBGMPlayVoiceSound = true; + + this.bDanTowerHide = false; + + this.bIncludeSubfoldersOnRandomSelect = true; + this.nMinDisplayedCombo = new STDGBVALUE(); + this.nMinDisplayedCombo.Drums = 10; + this.nMinDisplayedCombo.Guitar = 10; + this.nMinDisplayedCombo.Bass = 10; + this.nMinDisplayedCombo.Taiko = 10; + this.nRollsPerSec = 15; + this.nAILevel = 1; + this.bAIBattleMode = false; + + this.FontName = CFontRenderer.DefaultFontName; + this.BoxFontName = CFontRenderer.DefaultFontName; + this.ApplyLoudnessMetadata = true; + this.bEnableCountdownTimer = true; + this.sLang = "ja"; + this.nLayoutType = 1; + + // 2018-08-28 twopointzero: + // There exists a particular large, well-known, well-curated, and + // regularly-updated collection of content for use with simulators. + // A statistical analysis was performed on the the integrated loudness + // and true peak loudness of the thousands of songs within this + // collection as of late August 2018. + // + // The analysis allows us to select a target loudness which + // results in the smallest total amount of loudness adjustment + // applied to the songs of that collection. The selected target + // loudness should result in the least-noticeable average + // adjustment for the most users, assuming their collection is + // similar to the exemplar. + // + // The target loudness which achieves this is -7.4 LUFS. + this.TargetLoudness = -7.4; + + this.ApplySongVol = false; + this.SoundEffectLevel = CSound.DefaultSoundEffectLevel; + this.VoiceLevel = CSound.DefaultVoiceLevel; + this.SongPreviewLevel = CSound.DefaultSongPreviewLevel; + this.SongPlaybackLevel = CSound.DefaultSongPlaybackLevel; + this.KeyboardSoundLevelIncrement = DefaultKeyboardSoundLevelIncrement; + this.bOutputLogs = true; + this.bReverse = new STDGBVALUE(); + this.eRandom = new ERandomMode[5]; + this.JudgeTextDisplayPosition = new STDGBVALUE(); + this.nScrollSpeed = new int[5] { 9, 9, 9, 9, 9 }; + this.nTimingZones = new int[5] { 2, 2, 2, 2, 2 }; + this.nGameType = new EGameType[5] { + EGameType.Taiko, EGameType.Taiko, EGameType.Taiko, EGameType.Taiko, EGameType.Taiko + }; + this.nFunMods = + new EFunMods[5] { EFunMods.None, EFunMods.None, EFunMods.None, EFunMods.None, EFunMods.None }; + this.nInputAdjustTimeMs = 0; + this.nGlobalOffsetMs = 0; + for (int i = 0; i < 3; i++) { + this.bReverse[i] = false; + this.JudgeTextDisplayPosition[i] = EJudgeTextDisplayPosition.AboveLane; + this.eInvisible[i] = EInvisible.Off; } - #endregion + for (int i = 0; i < 5; i++) { + this.eRandom[i] = ERandomMode.Off; + this.nScrollSpeed[i] = 9; + this.nTimingZones[i] = 2; + } - #region[Ver.K追加オプション] + this.nSongSpeed = 20; + this.bNoAudioIfNot1xSpeed = false; - //-------------------------- - //ゲーム内のオプションに加えて、 - //システム周りのオプションもこのブロックで記述している。 + #region [ AutoPlay ] - #region[Display] + for (int i = 0; i < 5; i++) { + this.bAutoPlay[i] = false; + } - //-------------------------- - public EClipDispType eClipDispType; + this.bAuto先生の連打 = true; #endregion - #region[Position] + this.nHitRangeMs = new STRANGE(); + this.nHitRangeMs.Perfect = 25; + this.nHitRangeMs.Great = -1; //使用しません。 + this.nHitRangeMs.Good = 75; + this.nHitRangeMs.Poor = 108; + this.ConfigIniFileName = ""; + this.dicJoystick = new Dictionary(10); + this.dicGamepad = new Dictionary(10); + this.SetDefaultKeyAssignments(); - public ELaneType eLaneType; - public EMirror eMirror; + #region [ velocityMin ] + + this.nVelocityMin.LC = 0; // #23857 2011.1.31 yyagi VelocityMin + this.nVelocityMin.HH = 20; + this.nVelocityMin.SD = 0; + this.nVelocityMin.BD = 0; + this.nVelocityMin.HT = 0; + this.nVelocityMin.LT = 0; + this.nVelocityMin.FT = 0; + this.nVelocityMin.CY = 0; + this.nVelocityMin.RD = 0; + this.nVelocityMin.LP = 0; + this.nVelocityMin.LBD = 0; #endregion - #region[System] + this.nRisky = 0; // #23539 2011.7.26 yyagi RISKYモード + this.bIsAutoResultCapture = false; // #25399 2011.6.9 yyagi リザルト画像自動保存機能ON/OFF - public bool bDirectShowMode; + this.bBufferedInputs = true; + this.bIsAllowedDoubleClickFullscreen = false; // #26752 2011.11.26 ダブルクリックでのフルスクリーンモード移行を許可 + this.nPoliphonicSounds = 4; // #28228 2012.5.1 yyagi レーン毎の最大同時発音数 + // #24820 2013.1.15 yyagi 初期値を4から2に変更。BASS.net使用時の負荷軽減のため。 + // #24820 2013.1.17 yyagi 初期値を4に戻した。動的なミキサー制御がうまく動作しているため。 + this.bIsEnabledSystemMenu = true; // #28200 2012.5.1 yyagi System Menuの利用可否切替(使用可) + this.strSystemSkinSubfolderFullName = ""; // #28195 2012.5.2 yyagi 使用中のSkinサブフォルダ名 + this.bTight = false; // #29500 2012.9.11 kairera0467 TIGHTモード + nGraphicsDeviceType = 0; + + #region [ WASAPI/ASIO ] + + // #24820 2012.12.23 yyagi 初期値はACM | #31927 2013.8.25 yyagi OSにより初期値変更 + this.nSoundDeviceType = OperatingSystem.IsWindows() + ? (int)ESoundDeviceTypeForConfig.WASAPI_Shared + : (int)ESoundDeviceTypeForConfig.Bass; + nBassBufferSizeMs = 1; + this.nWASAPIBufferSizeMs = 50; // #24820 2013.1.15 yyagi 初期値は50(0で自動設定) + this.nASIODevice = 0; // #24820 2013.1.17 yyagi + // this.nASIOBufferSizeMs = 0; // #24820 2012.12.25 yyagi 初期値は0(自動設定) + + #endregion + + // #33689 2014.6.6 yyagi 初期値はfalse (FDKのタイマー。FROM氏考案の独自タイマー) // 2024.4.27 DRT Gonna keep this on by default. Seems to cause more issues when off. + this.bUseOSTimer = true; + this.bDynamicBassMixerManagement = true; // + this.bTimeStretch = false; // #23664 2013.2.24 yyagi 初期値はfalse (再生速度変更を、ピッチ変更にて行う) + this.nDisplayTimesMs = 3000; // #32072 2013.10.24 yyagi Semi-Invisibleでの、チップ再表示期間 + this.nFadeoutTimeMs = 2000; // #32072 2013.10.24 yyagi Semi-Invisibleでの、チップフェードアウト時間 + + this.sectionProcess = new Dictionary>() { + { ESectionType.System, this.ProcessSystemSection }, + { ESectionType.AutoPlay, this.ProcessAutoPlaySection }, + { ESectionType.HitRange, this.ProcessHitRangeSection }, + { ESectionType.Log, this.ProcessLogSection }, + { ESectionType.PlayOption, this.ProcessPlayOptionSection }, + { ESectionType.ViewerOption, this.ProcessViewerOptionSection }, + { ESectionType.GUID, this.ProcessGuidSection }, + { ESectionType.DrumsKeyAssign, this.ProcessDrumKeyAssignmentSection }, + { ESectionType.SystemKeyAssign, this.ProcessSystemKeyAssignmentSection }, + { ESectionType.TrainingKeyAssign, this.ProcessTrainingKeyAssignmentSection }, + { ESectionType.DEBUG, this.ProcessDebugSection }, + }; + + bViewerVSyncWait = true; + bViewerShowDebugStatus = true; + bViewerTimeStretch = false; + bViewerDrums有効 = true; + bViewerGuitar有効 = true; + + + this.bBranchGuide = false; + this.nScoreMode = 2; + this.nDefaultCourse = (int)Difficulty.Normal; + this.nBranchAnime = 1; + + this.bJudgeBigNotes = false; + bForceNormalGauge = false; + this.nBigNoteWaitTimems = 50; + + this.bJudgeCountDisplay = false; + + ShowExExtraAnime = true; + + ShowChara = true; + ShowDancer = true; + ShowRunner = true; + ShowFooter = true; + ShowMob = true; + ShowPuchiChara = true; + + this.eSTEALTH = new EStealthMode[5]; + + for (int i = 0; i < 5; i++) + this.eSTEALTH[i] = EStealthMode.Off; + + this.bNoInfo = false; + + //this.bNoMP3Streaming = false; + this.nMasterVolume = 100; // #33700 2014.4.26 yyagi マスターボリュームの設定(WASAPI/ASIO用) + this.bHispeedRandom = false; + this.nDefaultSongSort = 2; + this.nRecentlyPlayedMax = 5; + this.eGameMode = EGame.Off; + this.TokkunMashInterval = 750; + this.bEndingAnime = false; + this.nPlayerCount = 1; //2017.08.18 kairera0467 マルチプレイ対応 + ShinuchiMode = true; // Enable gen-4 score by default + TJAP3FolderMode = false; + FastRender = true; + ASyncTextureLoad = true; + PreAssetsLoading = true; + SimpleMode = false; + MusicPreTimeMs = 1000; // 一秒 + SendDiscordPlayingInformation = true; + + #region[ Ver.K追加 ] + + this.eLaneType = ELaneType.TypeA; + this.bDirectShowMode = false; #endregion #region[DEBUG] - public bool DEBUG_bShowImgui; + DEBUG_bShowImgui = true; #endregion + } - //-------------------------- - - #endregion + public CConfigIni(string iniファイル名) + : this() { + this.LoadFromFile(iniファイル名); + } - // Constructor + // メソッド - public CConfigIni() { - this.strSongsPath = "Songs" + Path.DirectorySeparatorChar; - this.bFullScreen = false; - this.bIgnoreSongUnlockables = false; - this.bEnableVSync = true; - this.nWindowBaseXPosition = 100; // #30675 2013.02.04 ikanick add - this.nWindowBaseYPosition = 100; - this.nWindowWidth = SampleFramework.GameWindowSize.Width; // #23510 2010.10.31 yyagi add - this.nWindowHeight = SampleFramework.GameWindowSize.Height; // - this.nMsSleepPerFrame = -1; // #xxxxx 2011.11.27 yyagi add - this.nMsSleepUnfocused = 1; // #23568 2010.11.04 ikanick add - this._bGuitarEnabled = true; - this._bDrumsEnabled = true; - this.nBGAlpha = 100; - this.bEnableAVI = false; - this.eClipDispType = EClipDispType.BackgroundOnly; - this.bEnableBGA = true; - this.nMsWaitPreviewSoundFromSongSelected = 1000; - this.nMsWaitPreviewImageFromSongSelected = 100; - this.bBGMPlayVoiceSound = true; - - this.bDanTowerHide = false; - - this.bIncludeSubfoldersOnRandomSelect = true; - this.nMinDisplayedCombo = new STDGBVALUE(); - this.nMinDisplayedCombo.Drums = 10; - this.nMinDisplayedCombo.Guitar = 10; - this.nMinDisplayedCombo.Bass = 10; - this.nMinDisplayedCombo.Taiko = 10; - this.nRollsPerSec = 15; - this.nAILevel = 1; - this.bAIBattleMode = false; - - this.FontName = CFontRenderer.DefaultFontName; - this.BoxFontName = CFontRenderer.DefaultFontName; - this.ApplyLoudnessMetadata = true; - this.bEnableCountdownTimer = true; - this.sLang = "ja"; - this.nLayoutType = 1; - - // 2018-08-28 twopointzero: - // There exists a particular large, well-known, well-curated, and - // regularly-updated collection of content for use with simulators. - // A statistical analysis was performed on the the integrated loudness - // and true peak loudness of the thousands of songs within this - // collection as of late August 2018. - // - // The analysis allows us to select a target loudness which - // results in the smallest total amount of loudness adjustment - // applied to the songs of that collection. The selected target - // loudness should result in the least-noticeable average - // adjustment for the most users, assuming their collection is - // similar to the exemplar. - // - // The target loudness which achieves this is -7.4 LUFS. - this.TargetLoudness = -7.4; - - this.ApplySongVol = false; - this.SoundEffectLevel = CSound.DefaultSoundEffectLevel; - this.VoiceLevel = CSound.DefaultVoiceLevel; - this.SongPreviewLevel = CSound.DefaultSongPreviewLevel; - this.SongPlaybackLevel = CSound.DefaultSongPlaybackLevel; - this.KeyboardSoundLevelIncrement = DefaultKeyboardSoundLevelIncrement; - this.bOutputLogs = true; - this.bReverse = new STDGBVALUE(); - this.eRandom = new ERandomMode[5]; - this.JudgeTextDisplayPosition = new STDGBVALUE(); - this.nScrollSpeed = new int[5] { 9, 9, 9, 9, 9 }; - this.nTimingZones = new int[5] { 2, 2, 2, 2, 2 }; - this.nGameType = new EGameType[5] { - EGameType.Taiko, EGameType.Taiko, EGameType.Taiko, EGameType.Taiko, EGameType.Taiko - }; - this.nFunMods = - new EFunMods[5] { EFunMods.None, EFunMods.None, EFunMods.None, EFunMods.None, EFunMods.None }; - this.nInputAdjustTimeMs = 0; - this.nGlobalOffsetMs = 0; - for (int i = 0; i < 3; i++) { - this.bReverse[i] = false; - this.JudgeTextDisplayPosition[i] = EJudgeTextDisplayPosition.AboveLane; - this.eInvisible[i] = EInvisible.Off; - } - - - for (int i = 0; i < 5; i++) { - this.eRandom[i] = ERandomMode.Off; - this.nScrollSpeed[i] = 9; - this.nTimingZones[i] = 2; - } - - this.nSongSpeed = 20; - this.bNoAudioIfNot1xSpeed = false; - - #region [ AutoPlay ] - - for (int i = 0; i < 5; i++) { - this.bAutoPlay[i] = false; - } - - this.bAuto先生の連打 = true; - - #endregion - - this.nHitRangeMs = new STRANGE(); - this.nHitRangeMs.Perfect = 25; - this.nHitRangeMs.Great = -1; //使用しません。 - this.nHitRangeMs.Good = 75; - this.nHitRangeMs.Poor = 108; - this.ConfigIniFileName = ""; - this.dicJoystick = new Dictionary(10); - this.dicGamepad = new Dictionary(10); - this.SetDefaultKeyAssignments(); - - #region [ velocityMin ] - - this.nVelocityMin.LC = 0; // #23857 2011.1.31 yyagi VelocityMin - this.nVelocityMin.HH = 20; - this.nVelocityMin.SD = 0; - this.nVelocityMin.BD = 0; - this.nVelocityMin.HT = 0; - this.nVelocityMin.LT = 0; - this.nVelocityMin.FT = 0; - this.nVelocityMin.CY = 0; - this.nVelocityMin.RD = 0; - this.nVelocityMin.LP = 0; - this.nVelocityMin.LBD = 0; - - #endregion - - this.nRisky = 0; // #23539 2011.7.26 yyagi RISKYモード - this.bIsAutoResultCapture = false; // #25399 2011.6.9 yyagi リザルト画像自動保存機能ON/OFF - - this.bBufferedInputs = true; - this.bIsAllowedDoubleClickFullscreen = false; // #26752 2011.11.26 ダブルクリックでのフルスクリーンモード移行を許可 - this.nPoliphonicSounds = 4; // #28228 2012.5.1 yyagi レーン毎の最大同時発音数 - // #24820 2013.1.15 yyagi 初期値を4から2に変更。BASS.net使用時の負荷軽減のため。 - // #24820 2013.1.17 yyagi 初期値を4に戻した。動的なミキサー制御がうまく動作しているため。 - this.bIsEnabledSystemMenu = true; // #28200 2012.5.1 yyagi System Menuの利用可否切替(使用可) - this.strSystemSkinSubfolderFullName = ""; // #28195 2012.5.2 yyagi 使用中のSkinサブフォルダ名 - this.bTight = false; // #29500 2012.9.11 kairera0467 TIGHTモード - nGraphicsDeviceType = 0; - - #region [ WASAPI/ASIO ] - - // #24820 2012.12.23 yyagi 初期値はACM | #31927 2013.8.25 yyagi OSにより初期値変更 - this.nSoundDeviceType = OperatingSystem.IsWindows() - ? (int)ESoundDeviceTypeForConfig.WASAPI_Shared - : (int)ESoundDeviceTypeForConfig.Bass; - nBassBufferSizeMs = 1; - this.nWASAPIBufferSizeMs = 50; // #24820 2013.1.15 yyagi 初期値は50(0で自動設定) - this.nASIODevice = 0; // #24820 2013.1.17 yyagi - // this.nASIOBufferSizeMs = 0; // #24820 2012.12.25 yyagi 初期値は0(自動設定) - - #endregion - - // #33689 2014.6.6 yyagi 初期値はfalse (FDKのタイマー。FROM氏考案の独自タイマー) // 2024.4.27 DRT Gonna keep this on by default. Seems to cause more issues when off. - this.bUseOSTimer = true; - this.bDynamicBassMixerManagement = true; // - this.bTimeStretch = false; // #23664 2013.2.24 yyagi 初期値はfalse (再生速度変更を、ピッチ変更にて行う) - this.nDisplayTimesMs = 3000; // #32072 2013.10.24 yyagi Semi-Invisibleでの、チップ再表示期間 - this.nFadeoutTimeMs = 2000; // #32072 2013.10.24 yyagi Semi-Invisibleでの、チップフェードアウト時間 - - this.sectionProcess = new Dictionary>() { - { ESectionType.System, this.ProcessSystemSection }, - { ESectionType.AutoPlay, this.ProcessAutoPlaySection }, - { ESectionType.HitRange, this.ProcessHitRangeSection }, - { ESectionType.Log, this.ProcessLogSection }, - { ESectionType.PlayOption, this.ProcessPlayOptionSection }, - { ESectionType.ViewerOption, this.ProcessViewerOptionSection }, - { ESectionType.GUID, this.ProcessGuidSection }, - { ESectionType.DrumsKeyAssign, this.ProcessDrumKeyAssignmentSection }, - { ESectionType.SystemKeyAssign, this.ProcessSystemKeyAssignmentSection }, - { ESectionType.TrainingKeyAssign, this.ProcessTrainingKeyAssignmentSection }, - { ESectionType.DEBUG, this.ProcessDebugSection }, - }; - - bViewerVSyncWait = true; - bViewerShowDebugStatus = true; - bViewerTimeStretch = false; - bViewerDrums有効 = true; - bViewerGuitar有効 = true; - - - this.bBranchGuide = false; - this.nScoreMode = 2; - this.nDefaultCourse = (int)Difficulty.Normal; - this.nBranchAnime = 1; - - this.bJudgeBigNotes = false; - bForceNormalGauge = false; - this.nBigNoteWaitTimems = 50; - - this.bJudgeCountDisplay = false; - - ShowExExtraAnime = true; - - ShowChara = true; - ShowDancer = true; - ShowRunner = true; - ShowFooter = true; - ShowMob = true; - ShowPuchiChara = true; - - this.eSTEALTH = new EStealthMode[5]; - - for (int i = 0; i < 5; i++) - this.eSTEALTH[i] = EStealthMode.Off; - - this.bNoInfo = false; - - //this.bNoMP3Streaming = false; - this.nMasterVolume = 100; // #33700 2014.4.26 yyagi マスターボリュームの設定(WASAPI/ASIO用) - this.bHispeedRandom = false; - this.nDefaultSongSort = 2; - this.nRecentlyPlayedMax = 5; - this.eGameMode = EGame.Off; - this.TokkunMashInterval = 750; - this.bEndingAnime = false; - this.nPlayerCount = 1; //2017.08.18 kairera0467 マルチプレイ対応 - ShinuchiMode = true; // Enable gen-4 score by default - TJAP3FolderMode = false; - FastRender = true; - ASyncTextureLoad = true; - PreAssetsLoading = true; - SimpleMode = false; - MusicPreTimeMs = 1000; // 一秒 - SendDiscordPlayingInformation = true; - - #region[ Ver.K追加 ] - - this.eLaneType = ELaneType.TypeA; - this.bDirectShowMode = false; - - #endregion - - #region[DEBUG] - - DEBUG_bShowImgui = true; - - #endregion - } - - public CConfigIni(string iniファイル名) - : this() { - this.LoadFromFile(iniファイル名); - } - - - // メソッド - - public void RemoveDuplicateKeyAssignments(EInputDevice deviceType, int nID, int nCode, EKeyConfigPad pad) { - bool isMenu = pad is EKeyConfigPad.Decide or EKeyConfigPad.RightChange or EKeyConfigPad.LeftChange; - for (int i = 0; i <= (int)EKeyConfigPart.System; i++) { - // Do not restrict duplicate keybinds for System controls - for (int j = 0; j < (int)EKeyConfigPad.Capture; j++) { - bool isJMenu = j is (int)EKeyConfigPad.LeftChange - or (int)EKeyConfigPad.RightChange - or (int)EKeyConfigPad.Decide; - if (isMenu != isJMenu) { + public void RemoveDuplicateKeyAssignments(EInputDevice deviceType, int nID, int nCode, EKeyConfigPad pad) { + bool isMenu = pad is EKeyConfigPad.Decide or EKeyConfigPad.RightChange or EKeyConfigPad.LeftChange; + for (int i = 0; i <= (int)EKeyConfigPart.System; i++) { + // Do not restrict duplicate keybinds for System controls + for (int j = 0; j < (int)EKeyConfigPad.Capture; j++) { + bool isJMenu = j is (int)EKeyConfigPad.LeftChange + or (int)EKeyConfigPad.RightChange + or (int)EKeyConfigPad.Decide; + if (isMenu != isJMenu) { + continue; + } + for (int k = 0; k < 0x10; k++) { + if (this.KeyAssign[i][j][k].InputDevice != deviceType || + this.KeyAssign[i][j][k].ID != nID || + this.KeyAssign[i][j][k].Code != nCode) { continue; } - for (int k = 0; k < 0x10; k++) { - if (this.KeyAssign[i][j][k].InputDevice != deviceType || - this.KeyAssign[i][j][k].ID != nID || - this.KeyAssign[i][j][k].Code != nCode) { - continue; - } - for (int m = k; m < 15; m++) { - this.KeyAssign[i][j][m] = this.KeyAssign[i][j][m + 1]; - } - - this.KeyAssign[i][j][15].InputDevice = EInputDevice.Unknown; - this.KeyAssign[i][j][15].ID = 0; - this.KeyAssign[i][j][15].Code = 0; - k--; + for (int m = k; m < 15; m++) { + this.KeyAssign[i][j][m] = this.KeyAssign[i][j][m + 1]; } + + this.KeyAssign[i][j][15].InputDevice = EInputDevice.Unknown; + this.KeyAssign[i][j][15].ID = 0; + this.KeyAssign[i][j][15].Code = 0; + k--; } } } + } - public void t書き出し(string iniファイル名) { - StreamWriter sw = new StreamWriter(iniファイル名, false, Encoding.GetEncoding(OpenTaiko.sEncType)); - sw.WriteLine(";-------------------"); + public void t書き出し(string iniファイル名) { + StreamWriter sw = new StreamWriter(iniファイル名, false, Encoding.GetEncoding(OpenTaiko.sEncType)); + sw.WriteLine(";-------------------"); - #region [ System ] + #region [ System ] - sw.WriteLine("[System]"); - sw.WriteLine(); + sw.WriteLine("[System]"); + sw.WriteLine(); - #region [ Version ] + #region [ Version ] - sw.WriteLine("; リリースバージョン"); - sw.WriteLine("; Release Version."); - sw.WriteLine("Version={0}", OpenTaiko.VERSION); - sw.WriteLine(); + sw.WriteLine("; リリースバージョン"); + sw.WriteLine("; Release Version."); + sw.WriteLine("Version={0}", OpenTaiko.VERSION); + sw.WriteLine(); - #endregion + #endregion - #region [ TJAPath ] + #region [ TJAPath ] - sw.WriteLine("; 譜面ファイルが格納されているフォルダへのパス。"); - sw.WriteLine(@"; セミコロン(;)で区切ることにより複数のパスを指定できます。(例: d:\tja\;e:\tja2\)"); - sw.WriteLine("; Pathes for TJA data."); - sw.WriteLine(@"; You can specify many pathes separated with semicolon(;). (e.g. d:\tja\;e:\tja2\)"); - sw.WriteLine("TJAPath={0}", this.strSongsPath); - sw.WriteLine(); + sw.WriteLine("; 譜面ファイルが格納されているフォルダへのパス。"); + sw.WriteLine(@"; セミコロン(;)で区切ることにより複数のパスを指定できます。(例: d:\tja\;e:\tja2\)"); + sw.WriteLine("; Pathes for TJA data."); + sw.WriteLine(@"; You can specify many pathes separated with semicolon(;). (e.g. d:\tja\;e:\tja2\)"); + sw.WriteLine("TJAPath={0}", this.strSongsPath); + sw.WriteLine(); - #endregion + #endregion - #region [ スキン関連 ] + #region [ スキン関連 ] - #region [ Skinパスの絶対パス→相対パス変換 ] + #region [ Skinパスの絶対パス→相対パス変換 ] - Uri uriRoot = new Uri(System.IO.Path.Combine(OpenTaiko.strEXEのあるフォルダ, - "System" + System.IO.Path.DirectorySeparatorChar)); - if (strSystemSkinSubfolderFullName != null && strSystemSkinSubfolderFullName.Length == 0) { - // Config.iniが空の状態でDTXManiaをViewerとして起動_終了すると、strSystemSkinSubfolderFullName が空の状態でここに来る。 - // → 初期値として Default/ を設定する。 - strSystemSkinSubfolderFullName = System.IO.Path.Combine(OpenTaiko.strEXEのあるフォルダ, - "System" + System.IO.Path.DirectorySeparatorChar + "Default" + - System.IO.Path.DirectorySeparatorChar); - } - - Uri uriPath = new Uri(System.IO.Path.Combine(this.strSystemSkinSubfolderFullName, - "." + System.IO.Path.DirectorySeparatorChar)); - string relPath = uriRoot.MakeRelativeUri(uriPath).ToString(); // 相対パスを取得 - relPath = System.Web.HttpUtility.UrlDecode(relPath); // デコードする - relPath = relPath.Replace('/', System.IO.Path.DirectorySeparatorChar); // 区切り文字が\ではなく/なので置換する - - #endregion - - sw.WriteLine("; 使用するSkinのフォルダ名。"); - sw.WriteLine("; 例えば System\\Default\\Graphics\\... などの場合は、SkinPath=.\\Default\\ を指定します。"); - sw.WriteLine("; Skin folder path."); - sw.WriteLine("; e.g. System\\Default\\Graphics\\... -> Set SkinPath=.\\Default\\"); - sw.WriteLine("SkinPath={0}", relPath); - sw.WriteLine(); - sw.WriteLine("; 事前画像読み込み機能を使うかどうか。(0: OFF, 1: ON)"); - sw.WriteLine("; Use pre-textures load."); - sw.WriteLine("{0}={1}", nameof(PreAssetsLoading), PreAssetsLoading ? 1 : 0); - sw.WriteLine(); - sw.WriteLine("; 事前画像描画機能を使うかどうか。(0: OFF, 1: ON)"); - sw.WriteLine("; Use pre-textures render."); - sw.WriteLine("{0}={1}", nameof(FastRender), FastRender ? 1 : 0); - sw.WriteLine(); - sw.WriteLine("; 非同期画像読み込みを行うかどうか。(0: OFF, 1: ON)"); - sw.WriteLine("; Use pre-textures render."); - sw.WriteLine("{0}={1}", nameof(ASyncTextureLoad), ASyncTextureLoad ? 1 : 0); - sw.WriteLine(); - sw.WriteLine("; シンプルモードを使うかどうか。(0: OFF, 1: ON)"); - sw.WriteLine("; Use simplemode"); - sw.WriteLine("{0}={1}", nameof(SimpleMode), SimpleMode ? 1 : 0); - sw.WriteLine(); - - #endregion - - - #region [Language] - - sw.WriteLine("; プレイ中やメニューの表示される言語を変更。"); - sw.WriteLine("; Change the displayed language ingame and within the menus."); - sw.WriteLine("Lang={0}", this.sLang); - sw.WriteLine(); - - #endregion - - #region [Layout Type] - - //this.nLayoutType - - sw.WriteLine("; Change the song select screen layout type."); - sw.WriteLine("LayoutType={0}", this.nLayoutType); - sw.WriteLine(); - - #endregion - - #region [Save Files] - - sw.WriteLine("; File paths on the Saves folder."); - sw.WriteLine("SaveFileName={0}", String.Join(",", this.sSaveFile)); - sw.WriteLine(); - sw.WriteLine("; Ignore song unlockables (0: No, 1: Yes)"); - sw.WriteLine("IgnoreSongUnlockables={0}", this.bIgnoreSongUnlockables ? 1 : 0); - sw.WriteLine(); - - #endregion - - #region [ Window関連 ] - - //sw.WriteLine("; 使用する描画API(0=OpenGL, 1=DirectX9, 2=DirectX11, 3=Vulkan, 4=Metal)"); - sw.WriteLine("; 使用する描画API(0=OpenGL, 1=DirectX11, 2=Vulkan, 3=Metal)"); - sw.WriteLine("GraphicsDeviceType={0}", (int)this.nGraphicsDeviceType); - sw.WriteLine(); - sw.WriteLine("; 画面モード(0:ウィンドウ, 1:全画面)"); - sw.WriteLine("; Screen mode. (0:Window, 1:Fullscreen)"); - sw.WriteLine("FullScreen={0}", this.bFullScreen ? 1 : 0); - sw.WriteLine(); - sw.WriteLine("; ウインドウモード時の画面幅"); // #23510 2010.10.31 yyagi add - sw.WriteLine("; A width size in the window mode."); // - sw.WriteLine("WindowWidth={0}", this.nWindowWidth); // - sw.WriteLine(); // - sw.WriteLine("; ウインドウモード時の画面高さ"); // - sw.WriteLine("; A height size in the window mode."); // - sw.WriteLine("WindowHeight={0}", this.nWindowHeight); // - sw.WriteLine(); // - sw.WriteLine("; ウィンドウモード時の位置X"); // #30675 2013.02.04 ikanick add - sw.WriteLine("; X position in the window mode."); // - sw.WriteLine("WindowX={0}", this.nWindowBaseXPosition); // - sw.WriteLine(); // - sw.WriteLine("; ウィンドウモード時の位置Y"); // - sw.WriteLine("; Y position in the window mode."); // - sw.WriteLine("WindowY={0}", this.nWindowBaseYPosition); // - sw.WriteLine(); // - - sw.WriteLine("; ウインドウをダブルクリックした時にフルスクリーンに移行するか(0:移行しない,1:移行する)"); // #26752 2011.11.27 yyagi - sw.WriteLine("; Whether double click to go full screen mode or not.(0:No, 1:Yes)"); // - sw.WriteLine("DoubleClickFullScreen={0}", this.bIsAllowedDoubleClickFullscreen ? 1 : 0); // - sw.WriteLine(); // - sw.WriteLine("; ALT+SPACEのメニュー表示を抑制するかどうか(0:抑制する 1:抑制しない)"); // #28200 2012.5.1 yyagi - sw.WriteLine("; Whether ALT+SPACE menu would be masked or not.(0=masked 1=not masked)"); // - sw.WriteLine("EnableSystemMenu={0}", this.bIsEnabledSystemMenu ? 1 : 0); // - sw.WriteLine(); // - sw.WriteLine("; 非フォーカス時のsleep値[ms]"); // #23568 2011.11.04 ikanick add - sw.WriteLine("; A sleep time[ms] while the window is inactive."); // - sw.WriteLine("BackSleep={0}", this.nMsSleepUnfocused); // そのまま引用(苦笑) - sw.WriteLine(); // - - #endregion - - #region [ フォント ] - - sw.WriteLine("; フォントレンダリングに使用するフォント名"); - sw.WriteLine("; Font name used for font rendering."); - sw.WriteLine("FontName={0}", this.FontName); - sw.WriteLine(); - sw.WriteLine("; Boxの説明文のフォントレンダリングに使用するフォント名"); - sw.WriteLine("; Font name used for font rendering."); - sw.WriteLine("BoxFontName={0}", this.BoxFontName); - sw.WriteLine(); - - #endregion - - #region [ フレーム処理関連(VSync, フレーム毎のsleep) ] - - sw.WriteLine("; 垂直帰線同期(0:OFF,1:ON)"); - sw.WriteLine("VSyncWait={0}", this.bEnableVSync ? 1 : 0); - sw.WriteLine(); - sw.WriteLine("; フレーム毎のsleep値[ms] (-1でスリープ無し, 0以上で毎フレームスリープ。動画キャプチャ等で活用下さい)"); // #xxxxx 2011.11.27 yyagi add - sw.WriteLine("; A sleep time[ms] per frame."); // - sw.WriteLine("SleepTimePerFrame={0}", this.nMsSleepPerFrame); // - sw.WriteLine(); // - - #endregion - - #region [ WASAPI/ASIO関連 ] - - sw.WriteLine("; サウンド出力方式(0=ASIO, 1=WASAPI Exclusive, 2=WASAPI Shared)"); - sw.WriteLine("; WASAPIはVista以降のOSで使用可能。推奨方式はWASAPI。"); - sw.WriteLine("; なお、WASAPIが使用不可ならASIOを、ASIOが使用不可ならACMを使用します。"); - sw.WriteLine("; Sound device type(0=ASIO, 1=WASAPI Exclusive, 2=WASAPI Shared)"); - sw.WriteLine("; WASAPI can use on Vista or later OSs."); - sw.WriteLine("; If WASAPI is not available, DTXMania try to use ASIO. If ASIO can't be used, ACM is used."); - sw.WriteLine("SoundDeviceType={0}", (int)this.nSoundDeviceType); - sw.WriteLine(); - - sw.WriteLine("; Bass使用時のサウンドバッファサイズ"); - sw.WriteLine("; (0=デバイスに設定されている値を使用, 1~9999=バッファサイズ(単位:ms)の手動指定"); - sw.WriteLine("; Bass Sound Buffer Size."); - sw.WriteLine("; (0=Use system default buffer size, 1-9999=specify the buffer size(ms) by yourself)"); - sw.WriteLine("BassBufferSizeMs={0}", (int)this.nBassBufferSizeMs); - sw.WriteLine(); - - sw.WriteLine("; WASAPI使用時のサウンドバッファサイズ"); - sw.WriteLine("; (0=デバイスに設定されている値を使用, 1~9999=バッファサイズ(単位:ms)の手動指定"); - sw.WriteLine("; WASAPI Sound Buffer Size."); - sw.WriteLine("; (0=Use system default buffer size, 1-9999=specify the buffer size(ms) by yourself)"); - sw.WriteLine("WASAPIBufferSizeMs={0}", (int)this.nWASAPIBufferSizeMs); - sw.WriteLine(); - - sw.WriteLine("; ASIO使用時のサウンドデバイス"); - sw.WriteLine("; 存在しないデバイスを指定すると、DTXManiaが起動しないことがあります。"); - sw.WriteLine("; Sound device used by ASIO."); - sw.WriteLine("; Don't specify unconnected device, as the DTXMania may not bootup."); - string[] asiodev = CEnumerateAllAsioDevices.GetAllASIODevices(); - for (int i = 0; i < asiodev.Length; i++) { - sw.WriteLine("; {0}: {1}", i, asiodev[i]); - } - - sw.WriteLine("ASIODevice={0}", (int)this.nASIODevice); - sw.WriteLine(); - - //sw.WriteLine( "; ASIO使用時のサウンドバッファサイズ" ); - //sw.WriteLine( "; (0=デバイスに設定されている値を使用, 1~9999=バッファサイズ(単位:ms)の手動指定" ); - //sw.WriteLine( "; ASIO Sound Buffer Size." ); - //sw.WriteLine( "; (0=Use the value specified to the device, 1-9999=specify the buffer size(ms) by yourself)" ); - //sw.WriteLine( "ASIOBufferSizeMs={0}", (int) this.nASIOBufferSizeMs ); - //sw.WriteLine(); - - //sw.WriteLine( "; Bass.Mixの制御を動的に行うか否か。" ); - //sw.WriteLine( "; ONにすると、ギター曲などチップ音の多い曲も再生できますが、画面が少しがたつきます。" ); - //sw.WriteLine( "; (0=行わない, 1=行う)" ); - //sw.WriteLine( "DynamicBassMixerManagement={0}", this.bDynamicBassMixerManagement ? 1 : 0 ); - //sw.WriteLine(); - - sw.WriteLine("; WASAPI/ASIO時に使用する演奏タイマーの種類"); - sw.WriteLine("; Playback timer used for WASAPI/ASIO"); - sw.WriteLine("; (0=FDK Timer, 1=System Timer)"); - sw.WriteLine("SoundTimerType={0}", this.bUseOSTimer ? 1 : 0); - sw.WriteLine(); - - //sw.WriteLine( "; 全体ボリュームの設定" ); - //sw.WriteLine( "; (0=無音 ~ 100=最大。WASAPI/ASIO時のみ有効)" ); - //sw.WriteLine( "; Master volume settings" ); - //sw.WriteLine( "; (0=Silent - 100=Max)" ); - //sw.WriteLine( "MasterVolume={0}", this.nMasterVolume ); - //sw.WriteLine(); - - #endregion - - sw.WriteLine("; 背景画像の半透明割合(0:透明~255:不透明)"); - sw.WriteLine("; Transparency for background image in playing screen.(0:tranaparent - 255:no transparent)"); - sw.WriteLine("BGAlpha={0}", this.nBGAlpha); - sw.WriteLine(); - - #region [ AVI/BGA ] - - sw.WriteLine("; AVIの表示(0:OFF, 1:ON)"); - sw.WriteLine("AVI={0}", this.bEnableAVI ? 1 : 0); - sw.WriteLine(); - sw.WriteLine("; BGAの表示(0:OFF, 1:ON)"); - sw.WriteLine("BGA={0}", this.bEnableBGA ? 1 : 0); - sw.WriteLine(); - sw.WriteLine("; 動画表示モード( 0:表示しない, 1:背景のみ, 2:窓表示のみ, 3:両方)"); - sw.WriteLine("ClipDispType={0}", (int)this.eClipDispType); - sw.WriteLine(); - - #endregion - - #region [ プレビュー音 ] - - sw.WriteLine("; 曲選択からプレビュー音の再生までのウェイト[ms]"); - sw.WriteLine("PreviewSoundWait={0}", this.nMsWaitPreviewSoundFromSongSelected); - sw.WriteLine(); - sw.WriteLine("; 曲選択からプレビュー画像表示までのウェイト[ms]"); - sw.WriteLine("PreviewImageWait={0}", this.nMsWaitPreviewImageFromSongSelected); - sw.WriteLine(); - - #endregion - - //sw.WriteLine( "; Waveの再生位置自動補正(0:OFF, 1:ON)" ); - //sw.WriteLine( "AdjustWaves={0}", this.bWave再生位置自動調整機能有効 ? 1 : 0 ); - - #region [ BGM/ドラムヒット音の再生 ] - - sw.WriteLine("; BGM の再生(0:OFF, 1:ON)"); - sw.WriteLine("BGMSound={0}", this.bBGMPlayVoiceSound ? 1 : 0); - sw.WriteLine(); - - #endregion - - sw.WriteLine("; Hide Dan and Tower charts from the ensou song select screen (0:OFF, 1:ON)"); - sw.WriteLine("DanTowerHide={0}", this.bDanTowerHide ? 1 : 0); - sw.WriteLine(); - sw.WriteLine("; 最小表示コンボ数"); - sw.WriteLine("MinComboDrums={0}", this.nMinDisplayedCombo.Drums); - sw.WriteLine(); - sw.WriteLine("; RANDOM SELECT で子BOXを検索対象に含める (0:OFF, 1:ON)"); - sw.WriteLine("RandomFromSubBox={0}", this.bIncludeSubfoldersOnRandomSelect ? 1 : 0); - sw.WriteLine(); - sw.WriteLine("; 演奏情報を表示する (0:OFF, 1:ON)"); - sw.WriteLine("; Showing playing info on the playing screen. (0:OFF, 1:ON)"); - sw.WriteLine("ShowDebugStatus={0}", this.bDisplayDebugInfo ? 1 : 0); - sw.WriteLine(); - sw.WriteLine("; BS1770GAIN によるラウドネスメータの測量を適用する (0:OFF, 1:ON)"); - sw.WriteLine("; Apply BS1770GAIN loudness metadata (0:OFF, 1:ON)"); - sw.WriteLine("{0}={1}", nameof(ApplyLoudnessMetadata), this.ApplyLoudnessMetadata ? 1 : 0); - sw.WriteLine(); - sw.WriteLine($"; BS1770GAIN によるラウドネスメータの目標値 (0). ({CSound.MinimumLufs}-{CSound.MaximumLufs})"); - sw.WriteLine( - $"; Loudness Target in dB (decibels) relative to full scale (0). ({CSound.MinimumLufs}-{CSound.MaximumLufs})"); - sw.WriteLine("{0}={1}", nameof(TargetLoudness), TargetLoudness); - sw.WriteLine(); - sw.WriteLine("; .tjaファイルのSONGVOLヘッダを音源の音量に適用する (0:OFF, 1:ON)"); - sw.WriteLine("; Apply SONGVOL (0:OFF, 1:ON)"); - sw.WriteLine("{0}={1}", nameof(ApplySongVol), this.ApplySongVol ? 1 : 0); - sw.WriteLine(); - sw.WriteLine($"; 効果音の音量 ({CSound.MinimumGroupLevel}-{CSound.MaximumGroupLevel}%)"); - sw.WriteLine($"; Sound effect level ({CSound.MinimumGroupLevel}-{CSound.MaximumGroupLevel}%)"); - sw.WriteLine("{0}={1}", nameof(SoundEffectLevel), SoundEffectLevel); - sw.WriteLine(); - sw.WriteLine($"; 各ボイス、コンボボイスの音量 ({CSound.MinimumGroupLevel}-{CSound.MaximumGroupLevel}%)"); - sw.WriteLine($"; Voice level ({CSound.MinimumGroupLevel}-{CSound.MaximumGroupLevel}%)"); - sw.WriteLine("{0}={1}", nameof(VoiceLevel), VoiceLevel); - sw.WriteLine(); - sw.WriteLine($"; 選曲画面のプレビュー時の音量 ({CSound.MinimumGroupLevel}-{CSound.MaximumGroupLevel}%)"); - sw.WriteLine($"; Song preview level ({CSound.MinimumGroupLevel}-{CSound.MaximumGroupLevel}%)"); - sw.WriteLine("{0}={1}", nameof(SongPreviewLevel), SongPreviewLevel); - sw.WriteLine(); - sw.WriteLine($"; ゲーム中の音源の音量 ({CSound.MinimumGroupLevel}-{CSound.MaximumGroupLevel}%)"); - sw.WriteLine($"; Song playback level ({CSound.MinimumGroupLevel}-{CSound.MaximumGroupLevel}%)"); - sw.WriteLine("{0}={1}", nameof(SongPlaybackLevel), SongPlaybackLevel); - sw.WriteLine(); - sw.WriteLine( - $"; キーボードによる音量変更の増加量、減少量 ({MinimumKeyboardSoundLevelIncrement}-{MaximumKeyboardSoundLevelIncrement})"); - sw.WriteLine( - $"; Keyboard sound level increment ({MinimumKeyboardSoundLevelIncrement}-{MaximumKeyboardSoundLevelIncrement})"); - sw.WriteLine("{0}={1}", nameof(KeyboardSoundLevelIncrement), KeyboardSoundLevelIncrement); - sw.WriteLine($"; 音源再生前の空白時間 (ms)"); - sw.WriteLine($"; Blank time before music source to play. (ms)"); - sw.WriteLine("{0}={1}", nameof(MusicPreTimeMs), MusicPreTimeMs); - sw.WriteLine(); - sw.WriteLine("; バッファ入力モード(0:OFF, 1:ON)"); - sw.WriteLine("; Using Buffered input (0:OFF, 1:ON)"); - sw.WriteLine("BufferedInput={0}", this.bBufferedInputs ? 1 : 0); - sw.WriteLine(); - sw.WriteLine("; リザルト画像自動保存機能(0:OFF, 1:ON)"); // #25399 2011.6.9 yyagi - sw.WriteLine("; Set \"1\" if you'd like to save result screen image automatically"); // - sw.WriteLine("; when you get hiscore/hiskill."); // - sw.WriteLine("AutoResultCapture={0}", this.bIsAutoResultCapture ? 1 : 0); // - sw.WriteLine(); - sw.WriteLine("; Discordに再生中の譜面情報を送信する(0:OFF, 1:ON)"); // #25399 2011.6.9 yyagi - sw.WriteLine("; Share Playing .tja file infomation on Discord."); // - sw.WriteLine("{0}={1}", nameof(SendDiscordPlayingInformation), SendDiscordPlayingInformation ? 1 : 0); // - sw.WriteLine(); - sw.WriteLine("; 再生速度変更を、ピッチ変更で行うかどうか(0:ピッチ変更, 1:タイムストレッチ"); // #23664 2013.2.24 yyagi - sw.WriteLine("; (WASAPI/ASIO使用時のみ有効) "); - sw.WriteLine("; Set \"0\" if you'd like to use pitch shift with PlaySpeed."); // - sw.WriteLine("; Set \"1\" for time stretch."); // - sw.WriteLine("; (Only available when you're using using WASAPI or ASIO)"); // - sw.WriteLine("TimeStretch={0}", this.bTimeStretch ? 1 : 0); // - sw.WriteLine(); - //sw.WriteLine( "; WASAPI/ASIO使用時に、MP3をストリーム再生するかどうか(0:ストリーム再生する, 1:しない)" ); // - //sw.WriteLine( "; (mp3のシークがおかしくなる場合は、これを1にしてください) " ); // - //sw.WriteLine( "; Set \"0\" if you'd like to use mp3 streaming playback on WASAPI/ASIO." ); // - //sw.WriteLine( "; Set \"1\" not to use streaming playback for mp3." ); // - //sw.WriteLine( "; (If you feel illegal seek with mp3, please set it to 1.)" ); // - //sw.WriteLine( "NoMP3Streaming={0}", this.bNoMP3Streaming ? 1 : 0 ); // - //sw.WriteLine(); - sw.WriteLine("; 動画再生にDirectShowを使用する(0:OFF, 1:ON)"); - sw.WriteLine("; 動画再生にDirectShowを使うことによって、再生時の負担を軽減できます。"); - sw.WriteLine("; ただし使用時にはセットアップが必要になるのでご注意ください。"); - sw.WriteLine("DirectShowMode={0}", this.bDirectShowMode ? 1 : 0); - sw.WriteLine(); - - #region [ Adjust ] - - //sw.WriteLine( "; 判定タイミング調整(-9999~9999)[ms]" ); - //sw.WriteLine("; Revision value to adjust judgment timing."); // - //sw.WriteLine("InputAdjustTime={0}", this.nInputAdjustTimeMs); // - sw.WriteLine("GlobalOffset={0}", this.nGlobalOffsetMs); - sw.WriteLine(); - - #endregion - - sw.WriteLine("; TJAPlayer3のboxの表示をするかどうか (0:OFF, 1:ON)"); - sw.WriteLine("{0}={1}", nameof(TJAP3FolderMode), TJAP3FolderMode ? 1 : 0); - sw.WriteLine(); - sw.WriteLine("; 「また遊んでね」画面(0:OFF, 1:ON)"); - sw.WriteLine("EndingAnime={0}", this.bEndingAnime ? 1 : 0); - sw.WriteLine(); - sw.WriteLine(";-------------------"); - - #endregion - - #region [ AutoPlay ] - - sw.WriteLine("[AutoPlay]"); - sw.WriteLine(); - sw.WriteLine("; 自動演奏(0:OFF, 1:ON)"); - sw.WriteLine("Taiko={0}", this.bAutoPlay[0] ? 1 : 0); - sw.WriteLine("Taiko2P={0}", this.bAutoPlay[1] ? 1 : 0); - sw.WriteLine("Taiko3P={0}", this.bAutoPlay[2] ? 1 : 0); - sw.WriteLine("Taiko4P={0}", this.bAutoPlay[3] ? 1 : 0); - sw.WriteLine("Taiko5P={0}", this.bAutoPlay[4] ? 1 : 0); - sw.WriteLine("TaikoAutoRoll={0}", this.bAuto先生の連打 ? 1 : 0); - sw.WriteLine("RollsPerSec={0}", this.nRollsPerSec); - sw.WriteLine("DefaultAILevel={0}", this.nDefaultAILevel); - sw.WriteLine(); - sw.WriteLine(";-------------------"); - - #endregion - - #region [ Log ] - - sw.WriteLine("[Log]"); - sw.WriteLine(); - sw.WriteLine("; Log出力(0:OFF, 1:ON)"); - sw.WriteLine("OutputLog={0}", this.bOutputLogs ? 1 : 0); - sw.WriteLine(); - sw.WriteLine("; 曲データ検索に関するLog出力(0:OFF, 1:ON)"); - sw.WriteLine("TraceSongSearch={0}", this.bOutputSongSearchLog ? 1 : 0); - sw.WriteLine(); - sw.WriteLine("; 画像やサウンドの作成_解放に関するLog出力(0:OFF, 1:ON)"); - sw.WriteLine("TraceCreatedDisposed={0}", this.bOutputCreationReleaseLog ? 1 : 0); - sw.WriteLine(); - sw.WriteLine("; DTX読み込み詳細に関するLog出力(0:OFF, 1:ON)"); - sw.WriteLine("TraceDTXDetails={0}", this.bOutputDetailedDTXLog ? 1 : 0); - sw.WriteLine(); - sw.WriteLine(";-------------------"); - - #endregion - - #region [ PlayOption ] - - sw.WriteLine("[PlayOption]"); - sw.WriteLine(); - sw.WriteLine("; 各画像の表示設定"); - sw.WriteLine("; キャラクター画像を表示する (0:OFF, 1:ON)"); - sw.WriteLine("ShowChara={0}", ShowChara ? 1 : 0); - sw.WriteLine("; ダンサー画像を表示する (0:OFF, 1:ON)"); - sw.WriteLine("ShowDancer={0}", ShowDancer ? 1 : 0); - sw.WriteLine("; ランナー画像を表示する (0:OFF, 1:ON)"); - sw.WriteLine("ShowRunner={0}", ShowRunner ? 1 : 0); - sw.WriteLine("; モブ画像を表示する (0:OFF, 1:ON)"); - sw.WriteLine("ShowMob={0}", ShowMob ? 1 : 0); - sw.WriteLine("; フッター画像 (0:OFF, 1:ON)"); - sw.WriteLine("ShowFooter={0}", ShowFooter ? 1 : 0); - sw.WriteLine("; ぷちキャラ画像 (0:OFF, 1:ON)"); - sw.WriteLine("ShowPuchiChara={0}", ShowPuchiChara ? 1 : 0); - sw.WriteLine(); - sw.WriteLine("; 選曲画面でのタイマーを有効にするかどうか(0:無効,1:有効)"); - sw.WriteLine("; Enable countdown in songselect.(0:No, 1:Yes)"); - sw.WriteLine("EnableCountDownTimer={0}", this.bEnableCountdownTimer ? 1 : 0); - sw.WriteLine(); - - #region [ Invisible ] - - sw.WriteLine("; ドラムチップ非表示モード (0:OFF, 1=SEMI, 2:FULL)"); - sw.WriteLine("; Drums chip invisible mode"); - sw.WriteLine("DrumsInvisible={0}", (int)this.eInvisible.Drums); - sw.WriteLine(); - - #endregion - - sw.WriteLine("; ドラムREVERSEモード(0:OFF, 1:ON)"); - sw.WriteLine("DrumsReverse={0}", this.bReverse.Drums ? 1 : 0); - sw.WriteLine(); - sw.WriteLine("; RISKYモード(0:OFF, 1-10)"); // #23559 2011.6.23 yyagi - sw.WriteLine("; RISKY mode. 0=OFF, 1-10 is the times of misses to be Failed."); // - sw.WriteLine("Risky={0}", this.nRisky); // - sw.WriteLine(); - sw.WriteLine("; TIGHTモード(0:OFF, 1:ON)"); // #29500 2012.9.11 kairera0467 - sw.WriteLine("; TIGHT mode. 0=OFF, 1=ON "); - sw.WriteLine("DrumsTight={0}", this.bTight ? 1 : 0); - sw.WriteLine(); - sw.WriteLine("; ドラム譜面スクロール速度(0:x0.1, 9:x1.0, 14:x1.5,…,1999:x200.0)"); - sw.WriteLine("DrumsScrollSpeed1P={0}", this.nScrollSpeed[0]); - sw.WriteLine("DrumsScrollSpeed2P={0}", this.nScrollSpeed[1]); - sw.WriteLine("DrumsScrollSpeed3P={0}", this.nScrollSpeed[2]); - sw.WriteLine("DrumsScrollSpeed4P={0}", this.nScrollSpeed[3]); - sw.WriteLine("DrumsScrollSpeed5P={0}", this.nScrollSpeed[4]); - sw.WriteLine(); - sw.WriteLine("; Timing Zones (0-1 : Lenient, 2 : Regular, 3-4 : Strict)"); - sw.WriteLine("TimingZones1P={0}", this.nTimingZones[0]); - sw.WriteLine("TimingZones2P={0}", this.nTimingZones[1]); - sw.WriteLine("TimingZones3P={0}", this.nTimingZones[2]); - sw.WriteLine("TimingZones4P={0}", this.nTimingZones[3]); - sw.WriteLine("TimingZones5P={0}", this.nTimingZones[4]); - sw.WriteLine(); - sw.WriteLine("; Gametype (0 : Taiko, 1 : Bongo)"); - sw.WriteLine("Gametype1P={0}", (int)this.nGameType[0]); - sw.WriteLine("Gametype2P={0}", (int)this.nGameType[1]); - sw.WriteLine("Gametype3P={0}", (int)this.nGameType[2]); - sw.WriteLine("Gametype4P={0}", (int)this.nGameType[3]); - sw.WriteLine("Gametype5P={0}", (int)this.nGameType[4]); - sw.WriteLine(); - sw.WriteLine( - "; Fun Mods (0 : None, 1 : Avalanche (random scroll speed per note/chip), 2 : Minesweeper (replace randomly notes by bombs))"); - sw.WriteLine("FunMods1P={0}", (int)this.nFunMods[0]); - sw.WriteLine("FunMods2P={0}", (int)this.nFunMods[1]); - sw.WriteLine("FunMods3P={0}", (int)this.nFunMods[2]); - sw.WriteLine("FunMods4P={0}", (int)this.nFunMods[3]); - sw.WriteLine("FunMods5P={0}", (int)this.nFunMods[4]); - sw.WriteLine(); - sw.WriteLine("; 演奏速度(5~40)(→x5/20~x40/20)"); - sw.WriteLine("PlaySpeed={0}", this.nSongSpeed); - sw.WriteLine(); - - sw.WriteLine("; 演奏速度が一倍速であるときのみBGMを再生する(0:OFF, 1:ON)"); - sw.WriteLine("PlaySpeedNotEqualOneNoSound={0}", this.bNoAudioIfNot1xSpeed ? 1 : 0); - sw.WriteLine(); - sw.WriteLine("; デフォルトで選択される難易度"); - sw.WriteLine("DefaultCourse={0}", this.nDefaultCourse); - sw.WriteLine(); - sw.WriteLine("; スコア計算方法(0:旧配点, 1:旧筐体配点, 2:新配点)"); - sw.WriteLine("ScoreMode={0}", this.nScoreMode); - sw.WriteLine(); - sw.WriteLine("; 真打モード (0:OFF, 1:ON)"); - sw.WriteLine("; Fixed score mode (0:OFF, 1:ON)"); - sw.WriteLine("{0}={1}", nameof(ShinuchiMode), ShinuchiMode ? 1 : 0); - - sw.WriteLine("; 大音符の両手入力待機時間(ms)"); - sw.WriteLine("BigNotesWaitTime={0}", this.nBigNoteWaitTimems); - sw.WriteLine(); - sw.WriteLine("; 大音符の両手判定(0:OFF, 1:ON)"); - sw.WriteLine("BigNotesJudge={0}", this.bJudgeBigNotes ? 1 : 0); - sw.WriteLine(); - sw.WriteLine("; ゲージをNormalに強制(0:OFF, 1:ON)"); - sw.WriteLine("ForceNormalGauge={0}", this.bForceNormalGauge ? 1 : 0); - sw.WriteLine(); - sw.WriteLine("; NoInfo(0:OFF, 1:ON)"); - sw.WriteLine("NoInfo={0}", this.bNoInfo ? 1 : 0); - sw.WriteLine(); - sw.WriteLine("; 譜面分岐のアニメーション(0:7~14, 1:15)"); - sw.WriteLine("BranchAnime={0}", this.nBranchAnime); - sw.WriteLine(); - sw.WriteLine("; デフォルトの曲ソート(0:絶対パス順, 1:ジャンル名ソートOLD, 2:ジャンル名ソートNEW )"); - sw.WriteLine("0:Path, 1:GenreName(AC8~AC14), 2GenreName(AC15~)"); - sw.WriteLine("DefaultSongSort={0}", this.nDefaultSongSort); - sw.WriteLine("RecentlyPlayedMax={0}", this.nRecentlyPlayedMax); - sw.WriteLine(); - sw.WriteLine( - "; RANDOMモード(0:OFF, 1:Random (Kimagure), 2:Mirror (Abekobe) 3:SuperRandom (Detarame), 4:HyperRandom (Abekobe + Kimagure))"); - sw.WriteLine("TaikoRandom1P={0}", (int)this.eRandom[0]); - sw.WriteLine("TaikoRandom2P={0}", (int)this.eRandom[1]); - sw.WriteLine("TaikoRandom3P={0}", (int)this.eRandom[2]); - sw.WriteLine("TaikoRandom4P={0}", (int)this.eRandom[3]); - sw.WriteLine("TaikoRandom5P={0}", (int)this.eRandom[4]); - sw.WriteLine(); - sw.WriteLine("; STEALTHモード(0:OFF, 1:ドロン, 2:ステルス)"); - sw.WriteLine("TaikoStealth1P={0}", (int)this.eSTEALTH[0]); - sw.WriteLine("TaikoStealth2P={0}", (int)this.eSTEALTH[1]); - sw.WriteLine("TaikoStealth3P={0}", (int)this.eSTEALTH[2]); - sw.WriteLine("TaikoStealth4P={0}", (int)this.eSTEALTH[3]); - sw.WriteLine("TaikoStealth5P={0}", (int)this.eSTEALTH[4]); - sw.WriteLine(); - sw.WriteLine("; ゲーム(0:OFF, 1:完走!叩ききりまショー!, 2:完走!叩ききりまショー!(激辛) )"); - sw.WriteLine("GameMode={0}", (int)this.eGameMode); - sw.WriteLine(); - sw.WriteLine(); - sw.WriteLine("; 特訓モード時にPgUp/PgDnで何小節飛ばすか"); - sw.WriteLine("TokkunSkipMeasures={0}", this.TokkunSkipMeasures); - sw.WriteLine(); - sw.WriteLine("; 特訓モード時にジャンプポイントに飛ばすための時間(ms)"); - sw.WriteLine("; 指定ms以内に5回縁を叩きましょう"); - sw.WriteLine("{1}={0}", this.TokkunMashInterval, nameof(this.TokkunMashInterval)); - sw.WriteLine(); - sw.WriteLine("; JUST(0:OFF, 1:JUST, 2:SAFE)"); - sw.WriteLine("Just1P={0}", this.bJust[0]); - sw.WriteLine("Just2P={0}", this.bJust[1]); - sw.WriteLine("Just3P={0}", this.bJust[2]); - sw.WriteLine("Just4P={0}", this.bJust[3]); - sw.WriteLine(); - sw.WriteLine("; Hitsounds index (音色)"); - sw.WriteLine("HitSounds1P={0}", this.nHitSounds[0]); - sw.WriteLine("HitSounds2P={0}", this.nHitSounds[1]); - sw.WriteLine("HitSounds3P={0}", this.nHitSounds[2]); - sw.WriteLine("HitSounds4P={0}", this.nHitSounds[3]); - sw.WriteLine(); - sw.WriteLine("; 判定数の表示(0:OFF, 1:ON)"); - sw.WriteLine("JudgeCountDisplay={0}", this.bJudgeCountDisplay ? 1 : 0); - sw.WriteLine(); - sw.WriteLine("; 裏表移行アニメーションを有効する (0:OFF, 1:ON)"); - sw.WriteLine("ShowExExtraAnime={0}", this.ShowExExtraAnime ? 1 : 0); - sw.WriteLine(); - sw.WriteLine("; プレイ人数"); - sw.WriteLine("PlayerCount={0}", this.nPlayerCount); - sw.WriteLine(); - - - sw.WriteLine(";-------------------"); - - #endregion - - #region [ GUID ] - - sw.WriteLine("[GUID]"); - sw.WriteLine(); - foreach (KeyValuePair pair in this.dicJoystick) { - sw.WriteLine("JoystickID={0},{1}", pair.Key, pair.Value); - } - - foreach (KeyValuePair pair in this.dicGamepad) { - sw.WriteLine("GamepadID={0},{1}", pair.Key, pair.Value); - } - - #endregion - - #region [ DrumsKeyAssign ] - - sw.WriteLine(); - sw.WriteLine(";-------------------"); - sw.WriteLine("; キーアサイン"); - sw.WriteLine("; 項 目:Keyboard → 'K'+'0'+キーコード(10進数)"); - sw.WriteLine("; Mouse → 'N'+'0'+ボタン番号(0~7)"); - sw.WriteLine("; MIDI In → 'M'+デバイス番号1桁(0~9,A~Z)+ノート番号(10進数)"); - sw.WriteLine("; Joystick → 'J'+デバイス番号1桁(0~9,A~Z)+ 0 ...... X減少(左)ボタン"); - sw.WriteLine("; 1 ...... X増加(右)ボタン"); - sw.WriteLine("; 2 ...... Y減少(上)ボタン"); - sw.WriteLine("; 3 ...... Y増加(下)ボタン"); - sw.WriteLine("; 4 ...... Z減少(前)ボタン"); - sw.WriteLine("; 5 ...... Z増加(後)ボタン"); - sw.WriteLine("; 6~133.. ボタン1~128"); - sw.WriteLine("; これらの項目を 16 個まで指定可能(',' で区切って記述)。"); - sw.WriteLine(";"); - sw.WriteLine("; 表記例:HH=K044,M042,J16"); - sw.WriteLine("; → HiHat を Keyboard の 44 ('Z'), MidiIn#0 の 42, JoyPad#1 の 6(ボタン1) に割当て"); - sw.WriteLine(";"); - sw.WriteLine("; ※Joystick のデバイス番号とデバイスとの関係は [GUID] セクションに記してあるものが有効。"); - sw.WriteLine(";"); - sw.WriteLine(); - sw.WriteLine("[DrumsKeyAssign]"); - sw.WriteLine(); - - sw.Write("LeftRed="); - this.WriteKeyAssignment(sw, this.KeyAssign.Drums.LeftRed); - sw.WriteLine(); - sw.Write("RightRed="); - this.WriteKeyAssignment(sw, this.KeyAssign.Drums.RightRed); - sw.WriteLine(); - sw.Write("LeftBlue="); // #27029 2012.1.4 from - this.WriteKeyAssignment(sw, this.KeyAssign.Drums.LeftBlue); // - sw.WriteLine(); // - sw.Write("RightBlue="); // #27029 2012.1.4 from - this.WriteKeyAssignment(sw, this.KeyAssign.Drums.RightBlue); // - sw.WriteLine(); - - sw.Write("LeftRed2P="); - this.WriteKeyAssignment(sw, this.KeyAssign.Drums.LeftRed2P); - sw.WriteLine(); - sw.Write("RightRed2P="); - this.WriteKeyAssignment(sw, this.KeyAssign.Drums.RightRed2P); - sw.WriteLine(); - sw.Write("LeftBlue2P="); // #27029 2012.1.4 from - this.WriteKeyAssignment(sw, this.KeyAssign.Drums.LeftBlue2P); // - sw.WriteLine(); // - sw.Write("RightBlue2P="); // #27029 2012.1.4 from - this.WriteKeyAssignment(sw, this.KeyAssign.Drums.RightBlue2P); // - sw.WriteLine(); - - sw.Write("LeftRed3P="); - this.WriteKeyAssignment(sw, this.KeyAssign.Drums.LeftRed3P); - sw.WriteLine(); - sw.Write("RightRed3P="); - this.WriteKeyAssignment(sw, this.KeyAssign.Drums.RightRed3P); - sw.WriteLine(); - sw.Write("LeftBlue3P="); // #27029 2012.1.4 from - this.WriteKeyAssignment(sw, this.KeyAssign.Drums.LeftBlue3P); // - sw.WriteLine(); // - sw.Write("RightBlue3P="); // #27029 2012.1.4 from - this.WriteKeyAssignment(sw, this.KeyAssign.Drums.RightBlue3P); // - sw.WriteLine(); - - sw.Write("LeftRed4P="); - this.WriteKeyAssignment(sw, this.KeyAssign.Drums.LeftRed4P); - sw.WriteLine(); - sw.Write("RightRed4P="); - this.WriteKeyAssignment(sw, this.KeyAssign.Drums.RightRed4P); - sw.WriteLine(); - sw.Write("LeftBlue4P="); // #27029 2012.1.4 from - this.WriteKeyAssignment(sw, this.KeyAssign.Drums.LeftBlue4P); // - sw.WriteLine(); // - sw.Write("RightBlue4P="); // #27029 2012.1.4 from - this.WriteKeyAssignment(sw, this.KeyAssign.Drums.RightBlue4P); // - sw.WriteLine(); - - sw.Write("LeftRed5P="); - this.WriteKeyAssignment(sw, this.KeyAssign.Drums.LeftRed5P); - sw.WriteLine(); - sw.Write("RightRed5P="); - this.WriteKeyAssignment(sw, this.KeyAssign.Drums.RightRed5P); - sw.WriteLine(); - sw.Write("LeftBlue5P="); // #27029 2012.1.4 from - this.WriteKeyAssignment(sw, this.KeyAssign.Drums.LeftBlue5P); // - sw.WriteLine(); // - sw.Write("RightBlue5P="); // #27029 2012.1.4 from - this.WriteKeyAssignment(sw, this.KeyAssign.Drums.RightBlue5P); // - sw.WriteLine(); - - sw.Write("Clap="); - this.WriteKeyAssignment(sw, this.KeyAssign.Drums.Clap); - sw.WriteLine(); - sw.Write("Clap2P="); - this.WriteKeyAssignment(sw, this.KeyAssign.Drums.Clap2P); - sw.WriteLine(); - sw.Write("Clap3P="); - this.WriteKeyAssignment(sw, this.KeyAssign.Drums.Clap3P); - sw.WriteLine(); - sw.Write("Clap4P="); - this.WriteKeyAssignment(sw, this.KeyAssign.Drums.Clap4P); - sw.WriteLine(); - sw.Write("Clap5P="); - this.WriteKeyAssignment(sw, this.KeyAssign.Drums.Clap5P); - sw.WriteLine(); - - sw.Write("Decide="); - this.WriteKeyAssignment(sw, this.KeyAssign.Drums.Decide); - sw.WriteLine(); - sw.Write("Cancel="); - this.WriteKeyAssignment(sw, this.KeyAssign.Drums.Cancel); - sw.WriteLine(); - sw.Write("LeftChange="); - this.WriteKeyAssignment(sw, this.KeyAssign.Drums.LeftChange); - sw.WriteLine(); - sw.Write("RightChange="); - this.WriteKeyAssignment(sw, this.KeyAssign.Drums.RightChange); - sw.WriteLine(); - - sw.WriteLine(); - - #endregion - - #region [ SystemKeyAssign ] - - sw.WriteLine("[SystemKeyAssign]"); - sw.WriteLine(); - sw.Write("Capture="); - this.WriteKeyAssignment(sw, this.KeyAssign.System.Capture); - sw.WriteLine(); - sw.Write("SongVolumeIncrease="); - this.WriteKeyAssignment(sw, this.KeyAssign.System.SongVolIncrease); - sw.WriteLine(); - sw.Write("SongVolumeDecrease="); - this.WriteKeyAssignment(sw, this.KeyAssign.System.SongVolDecrease); - sw.WriteLine(); - sw.Write("DisplayHits="); - this.WriteKeyAssignment(sw, this.KeyAssign.System.DisplayHits); - sw.WriteLine(); - sw.Write("DisplayDebug="); - this.WriteKeyAssignment(sw, this.KeyAssign.System.DisplayDebug); - sw.WriteLine(); - sw.Write("QuickConfig="); - this.WriteKeyAssignment(sw, this.KeyAssign.System.QuickConfig); - sw.WriteLine(); - sw.Write("NewHeya="); - this.WriteKeyAssignment(sw, this.KeyAssign.System.NewHeya); - sw.WriteLine(); - sw.Write("SortSongs="); - this.WriteKeyAssignment(sw, this.KeyAssign.System.SortSongs); - sw.WriteLine(); - sw.Write("ToggleAutoP1="); - this.WriteKeyAssignment(sw, this.KeyAssign.System.ToggleAutoP1); - sw.WriteLine(); - sw.Write("ToggleAutoP2="); - this.WriteKeyAssignment(sw, this.KeyAssign.System.ToggleAutoP2); - sw.WriteLine(); - sw.Write("ToggleTrainingMode="); - this.WriteKeyAssignment(sw, this.KeyAssign.System.ToggleTrainingMode); - sw.WriteLine(); - sw.Write("CycleVideoDisplayMode="); - this.WriteKeyAssignment(sw, this.KeyAssign.System.CycleVideoDisplayMode); - sw.WriteLine(); - sw.WriteLine(); - - #endregion - - #region [ TrainingKeyAssign ] - - sw.WriteLine("[TrainingKeyAssign]"); - sw.WriteLine(); - sw.Write("TrainingIncreaseScrollSpeed="); - this.WriteKeyAssignment(sw, this.KeyAssign.Drums.TrainingIncreaseScrollSpeed); - sw.WriteLine(); - sw.Write("TrainingDecreaseScrollSpeed="); - this.WriteKeyAssignment(sw, this.KeyAssign.Drums.TrainingDecreaseScrollSpeed); - sw.WriteLine(); - sw.Write("TrainingIncreaseSongSpeed="); - this.WriteKeyAssignment(sw, this.KeyAssign.Drums.TrainingIncreaseSongSpeed); - sw.WriteLine(); - sw.Write("TrainingDecreaseSongSpeed="); - this.WriteKeyAssignment(sw, this.KeyAssign.Drums.TrainingDecreaseSongSpeed); - sw.WriteLine(); - sw.Write("TrainingToggleAuto="); - this.WriteKeyAssignment(sw, this.KeyAssign.Drums.TrainingToggleAuto); - sw.WriteLine(); - sw.Write("TrainingBranchNormal="); - this.WriteKeyAssignment(sw, this.KeyAssign.Drums.TrainingBranchNormal); - sw.WriteLine(); - sw.Write("TrainingBranchExpert="); - this.WriteKeyAssignment(sw, this.KeyAssign.Drums.TrainingBranchExpert); - sw.WriteLine(); - sw.Write("TrainingBranchMaster="); - this.WriteKeyAssignment(sw, this.KeyAssign.Drums.TrainingBranchMaster); - sw.WriteLine(); - sw.Write("TrainingPause="); - this.WriteKeyAssignment(sw, this.KeyAssign.Drums.TrainingPause); - sw.WriteLine(); - sw.Write("TrainingBookmark="); - this.WriteKeyAssignment(sw, this.KeyAssign.Drums.TrainingBookmark); - sw.WriteLine(); - sw.Write("TrainingMoveForwardMeasure="); - this.WriteKeyAssignment(sw, this.KeyAssign.Drums.TrainingMoveForwardMeasure); - sw.WriteLine(); - sw.Write("TrainingMoveBackMeasure="); - this.WriteKeyAssignment(sw, this.KeyAssign.Drums.TrainingMoveBackMeasure); - sw.WriteLine(); - sw.Write("TrainingSkipForwardMeasure="); - this.WriteKeyAssignment(sw, this.KeyAssign.Drums.TrainingSkipForwardMeasure); - sw.WriteLine(); - sw.Write("TrainingSkipBackMeasure="); - this.WriteKeyAssignment(sw, this.KeyAssign.Drums.TrainingSkipBackMeasure); - sw.WriteLine(); - sw.Write("TrainingJumpToFirstMeasure="); - this.WriteKeyAssignment(sw, this.KeyAssign.Drums.TrainingJumpToFirstMeasure); - sw.WriteLine(); - sw.Write("TrainingJumpToLastMeasure="); - this.WriteKeyAssignment(sw, this.KeyAssign.Drums.TrainingJumpToLastMeasure); - sw.WriteLine(); - sw.WriteLine(); - - #endregion - - #region [DEBUG] - - sw.WriteLine("[DEBUG]"); - sw.WriteLine(); - sw.WriteLine("ImGui={0}", this.DEBUG_bShowImgui ? 1 : 0); - sw.WriteLine(); - sw.WriteLine(); - - #endregion - - sw.Close(); + Uri uriRoot = new Uri(System.IO.Path.Combine(OpenTaiko.strEXEのあるフォルダ, + "System" + System.IO.Path.DirectorySeparatorChar)); + if (strSystemSkinSubfolderFullName != null && strSystemSkinSubfolderFullName.Length == 0) { + // Config.iniが空の状態でDTXManiaをViewerとして起動_終了すると、strSystemSkinSubfolderFullName が空の状態でここに来る。 + // → 初期値として Default/ を設定する。 + strSystemSkinSubfolderFullName = System.IO.Path.Combine(OpenTaiko.strEXEのあるフォルダ, + "System" + System.IO.Path.DirectorySeparatorChar + "Default" + + System.IO.Path.DirectorySeparatorChar); } - public void LoadFromFile(string iniFileName) { - this.ConfigIniFileName = iniFileName; - this.bConfigIniFileExists = File.Exists(this.ConfigIniFileName); - if (!this.bConfigIniFileExists) { - return; - } + Uri uriPath = new Uri(System.IO.Path.Combine(this.strSystemSkinSubfolderFullName, + "." + System.IO.Path.DirectorySeparatorChar)); + string relPath = uriRoot.MakeRelativeUri(uriPath).ToString(); // 相対パスを取得 + relPath = System.Web.HttpUtility.UrlDecode(relPath); // デコードする + relPath = relPath.Replace('/', System.IO.Path.DirectorySeparatorChar); // 区切り文字が\ではなく/なので置換する - string str; - this.ClearAllKeyAssignments(); - using (StreamReader reader = - new StreamReader(this.ConfigIniFileName, Encoding.GetEncoding(OpenTaiko.sEncType))) { - str = reader.ReadToEnd(); - } + #endregion - this.LoadFromString(str); + sw.WriteLine("; 使用するSkinのフォルダ名。"); + sw.WriteLine("; 例えば System\\Default\\Graphics\\... などの場合は、SkinPath=.\\Default\\ を指定します。"); + sw.WriteLine("; Skin folder path."); + sw.WriteLine("; e.g. System\\Default\\Graphics\\... -> Set SkinPath=.\\Default\\"); + sw.WriteLine("SkinPath={0}", relPath); + sw.WriteLine(); + sw.WriteLine("; 事前画像読み込み機能を使うかどうか。(0: OFF, 1: ON)"); + sw.WriteLine("; Use pre-textures load."); + sw.WriteLine("{0}={1}", nameof(PreAssetsLoading), PreAssetsLoading ? 1 : 0); + sw.WriteLine(); + sw.WriteLine("; 事前画像描画機能を使うかどうか。(0: OFF, 1: ON)"); + sw.WriteLine("; Use pre-textures render."); + sw.WriteLine("{0}={1}", nameof(FastRender), FastRender ? 1 : 0); + sw.WriteLine(); + sw.WriteLine("; 非同期画像読み込みを行うかどうか。(0: OFF, 1: ON)"); + sw.WriteLine("; Use pre-textures render."); + sw.WriteLine("{0}={1}", nameof(ASyncTextureLoad), ASyncTextureLoad ? 1 : 0); + sw.WriteLine(); + sw.WriteLine("; シンプルモードを使うかどうか。(0: OFF, 1: ON)"); + sw.WriteLine("; Use simplemode"); + sw.WriteLine("{0}={1}", nameof(SimpleMode), SimpleMode ? 1 : 0); + sw.WriteLine(); + + #endregion + + + #region [Language] + + sw.WriteLine("; プレイ中やメニューの表示される言語を変更。"); + sw.WriteLine("; Change the displayed language ingame and within the menus."); + sw.WriteLine("Lang={0}", this.sLang); + sw.WriteLine(); + + #endregion + + #region [Layout Type] + + //this.nLayoutType + + sw.WriteLine("; Change the song select screen layout type."); + sw.WriteLine("LayoutType={0}", this.nLayoutType); + sw.WriteLine(); + + #endregion + + #region [Save Files] + + sw.WriteLine("; File paths on the Saves folder."); + sw.WriteLine("SaveFileName={0}", String.Join(",", this.sSaveFile)); + sw.WriteLine(); + sw.WriteLine("; Ignore song unlockables (0: No, 1: Yes)"); + sw.WriteLine("IgnoreSongUnlockables={0}", this.bIgnoreSongUnlockables ? 1 : 0); + sw.WriteLine(); + + #endregion + + #region [ Window関連 ] + + //sw.WriteLine("; 使用する描画API(0=OpenGL, 1=DirectX9, 2=DirectX11, 3=Vulkan, 4=Metal)"); + sw.WriteLine("; 使用する描画API(0=OpenGL, 1=DirectX11, 2=Vulkan, 3=Metal)"); + sw.WriteLine("GraphicsDeviceType={0}", (int)this.nGraphicsDeviceType); + sw.WriteLine(); + sw.WriteLine("; 画面モード(0:ウィンドウ, 1:全画面)"); + sw.WriteLine("; Screen mode. (0:Window, 1:Fullscreen)"); + sw.WriteLine("FullScreen={0}", this.bFullScreen ? 1 : 0); + sw.WriteLine(); + sw.WriteLine("; ウインドウモード時の画面幅"); // #23510 2010.10.31 yyagi add + sw.WriteLine("; A width size in the window mode."); // + sw.WriteLine("WindowWidth={0}", this.nWindowWidth); // + sw.WriteLine(); // + sw.WriteLine("; ウインドウモード時の画面高さ"); // + sw.WriteLine("; A height size in the window mode."); // + sw.WriteLine("WindowHeight={0}", this.nWindowHeight); // + sw.WriteLine(); // + sw.WriteLine("; ウィンドウモード時の位置X"); // #30675 2013.02.04 ikanick add + sw.WriteLine("; X position in the window mode."); // + sw.WriteLine("WindowX={0}", this.nWindowBaseXPosition); // + sw.WriteLine(); // + sw.WriteLine("; ウィンドウモード時の位置Y"); // + sw.WriteLine("; Y position in the window mode."); // + sw.WriteLine("WindowY={0}", this.nWindowBaseYPosition); // + sw.WriteLine(); // + + sw.WriteLine("; ウインドウをダブルクリックした時にフルスクリーンに移行するか(0:移行しない,1:移行する)"); // #26752 2011.11.27 yyagi + sw.WriteLine("; Whether double click to go full screen mode or not.(0:No, 1:Yes)"); // + sw.WriteLine("DoubleClickFullScreen={0}", this.bIsAllowedDoubleClickFullscreen ? 1 : 0); // + sw.WriteLine(); // + sw.WriteLine("; ALT+SPACEのメニュー表示を抑制するかどうか(0:抑制する 1:抑制しない)"); // #28200 2012.5.1 yyagi + sw.WriteLine("; Whether ALT+SPACE menu would be masked or not.(0=masked 1=not masked)"); // + sw.WriteLine("EnableSystemMenu={0}", this.bIsEnabledSystemMenu ? 1 : 0); // + sw.WriteLine(); // + sw.WriteLine("; 非フォーカス時のsleep値[ms]"); // #23568 2011.11.04 ikanick add + sw.WriteLine("; A sleep time[ms] while the window is inactive."); // + sw.WriteLine("BackSleep={0}", this.nMsSleepUnfocused); // そのまま引用(苦笑) + sw.WriteLine(); // + + #endregion + + #region [ フォント ] + + sw.WriteLine("; フォントレンダリングに使用するフォント名"); + sw.WriteLine("; Font name used for font rendering."); + sw.WriteLine("FontName={0}", this.FontName); + sw.WriteLine(); + sw.WriteLine("; Boxの説明文のフォントレンダリングに使用するフォント名"); + sw.WriteLine("; Font name used for font rendering."); + sw.WriteLine("BoxFontName={0}", this.BoxFontName); + sw.WriteLine(); + + #endregion + + #region [ フレーム処理関連(VSync, フレーム毎のsleep) ] + + sw.WriteLine("; 垂直帰線同期(0:OFF,1:ON)"); + sw.WriteLine("VSyncWait={0}", this.bEnableVSync ? 1 : 0); + sw.WriteLine(); + sw.WriteLine("; フレーム毎のsleep値[ms] (-1でスリープ無し, 0以上で毎フレームスリープ。動画キャプチャ等で活用下さい)"); // #xxxxx 2011.11.27 yyagi add + sw.WriteLine("; A sleep time[ms] per frame."); // + sw.WriteLine("SleepTimePerFrame={0}", this.nMsSleepPerFrame); // + sw.WriteLine(); // + + #endregion + + #region [ WASAPI/ASIO関連 ] + + sw.WriteLine("; サウンド出力方式(0=ASIO, 1=WASAPI Exclusive, 2=WASAPI Shared)"); + sw.WriteLine("; WASAPIはVista以降のOSで使用可能。推奨方式はWASAPI。"); + sw.WriteLine("; なお、WASAPIが使用不可ならASIOを、ASIOが使用不可ならACMを使用します。"); + sw.WriteLine("; Sound device type(0=ASIO, 1=WASAPI Exclusive, 2=WASAPI Shared)"); + sw.WriteLine("; WASAPI can use on Vista or later OSs."); + sw.WriteLine("; If WASAPI is not available, DTXMania try to use ASIO. If ASIO can't be used, ACM is used."); + sw.WriteLine("SoundDeviceType={0}", (int)this.nSoundDeviceType); + sw.WriteLine(); + + sw.WriteLine("; Bass使用時のサウンドバッファサイズ"); + sw.WriteLine("; (0=デバイスに設定されている値を使用, 1~9999=バッファサイズ(単位:ms)の手動指定"); + sw.WriteLine("; Bass Sound Buffer Size."); + sw.WriteLine("; (0=Use system default buffer size, 1-9999=specify the buffer size(ms) by yourself)"); + sw.WriteLine("BassBufferSizeMs={0}", (int)this.nBassBufferSizeMs); + sw.WriteLine(); + + sw.WriteLine("; WASAPI使用時のサウンドバッファサイズ"); + sw.WriteLine("; (0=デバイスに設定されている値を使用, 1~9999=バッファサイズ(単位:ms)の手動指定"); + sw.WriteLine("; WASAPI Sound Buffer Size."); + sw.WriteLine("; (0=Use system default buffer size, 1-9999=specify the buffer size(ms) by yourself)"); + sw.WriteLine("WASAPIBufferSizeMs={0}", (int)this.nWASAPIBufferSizeMs); + sw.WriteLine(); + + sw.WriteLine("; ASIO使用時のサウンドデバイス"); + sw.WriteLine("; 存在しないデバイスを指定すると、DTXManiaが起動しないことがあります。"); + sw.WriteLine("; Sound device used by ASIO."); + sw.WriteLine("; Don't specify unconnected device, as the DTXMania may not bootup."); + string[] asiodev = CEnumerateAllAsioDevices.GetAllASIODevices(); + for (int i = 0; i < asiodev.Length; i++) { + sw.WriteLine("; {0}: {1}", i, asiodev[i]); } - private void LoadFromString(string strAllSettings) { - ESectionType currentSectionType = ESectionType.Unknown; - string[] delimiter = { "\n" }; - string[] strSingleLine = strAllSettings.Split(delimiter, StringSplitOptions.RemoveEmptyEntries); - foreach (string s in strSingleLine) { - string line = s.Replace('\t', ' ') - .TrimStart(new char[] { '\t', ' ' }); - if ((line.Length == 0) || (line[0] == ';')) { - continue; - } + sw.WriteLine("ASIODevice={0}", (int)this.nASIODevice); + sw.WriteLine(); - try { - if (line[0] == '[') { - StringBuilder builder = new StringBuilder(0x20); - int num = 1; - while ((num < line.Length) && (line[num] != ']')) { - builder.Append(line[num++]); - } + //sw.WriteLine( "; ASIO使用時のサウンドバッファサイズ" ); + //sw.WriteLine( "; (0=デバイスに設定されている値を使用, 1~9999=バッファサイズ(単位:ms)の手動指定" ); + //sw.WriteLine( "; ASIO Sound Buffer Size." ); + //sw.WriteLine( "; (0=Use the value specified to the device, 1-9999=specify the buffer size(ms) by yourself)" ); + //sw.WriteLine( "ASIOBufferSizeMs={0}", (int) this.nASIOBufferSizeMs ); + //sw.WriteLine(); - string sectionName = builder.ToString(); - currentSectionType = sectionName switch { - "System" => ESectionType.System, - "AutoPlay" => ESectionType.AutoPlay, - "HitRange" => ESectionType.HitRange, - "Log" => ESectionType.Log, - "PlayOption" => ESectionType.PlayOption, - "ViewerOption" => ESectionType.ViewerOption, - "GUID" => ESectionType.GUID, - "DrumsKeyAssign" => ESectionType.DrumsKeyAssign, - "SystemKeyAssign" => ESectionType.SystemKeyAssign, - "TrainingKeyAssign" => ESectionType.TrainingKeyAssign, - "DEBUG" => ESectionType.DEBUG, - "Temp" => ESectionType.Temp, - _ => ESectionType.Unknown - }; - } else { - string[] keyValuePair = line.Split(new char[] { '=' }); - if (keyValuePair.Length == 2) { - string key = keyValuePair[0].Trim(); - string value = keyValuePair[1].Trim(); - if (this.sectionProcess.TryGetValue(currentSectionType, out var processSection)) { - processSection(key, value); - } - } - } - } catch (Exception exception) { - Trace.TraceError(exception.ToString()); - Trace.TraceError("例外が発生しましたが処理を継続します。 (93c4c5cd-4996-4e8c-a82f-a179ff590b44)"); - } - } + //sw.WriteLine( "; Bass.Mixの制御を動的に行うか否か。" ); + //sw.WriteLine( "; ONにすると、ギター曲などチップ音の多い曲も再生できますが、画面が少しがたつきます。" ); + //sw.WriteLine( "; (0=行わない, 1=行う)" ); + //sw.WriteLine( "DynamicBassMixerManagement={0}", this.bDynamicBassMixerManagement ? 1 : 0 ); + //sw.WriteLine(); + + sw.WriteLine("; WASAPI/ASIO時に使用する演奏タイマーの種類"); + sw.WriteLine("; Playback timer used for WASAPI/ASIO"); + sw.WriteLine("; (0=FDK Timer, 1=System Timer)"); + sw.WriteLine("SoundTimerType={0}", this.bUseOSTimer ? 1 : 0); + sw.WriteLine(); + + //sw.WriteLine( "; 全体ボリュームの設定" ); + //sw.WriteLine( "; (0=無音 ~ 100=最大。WASAPI/ASIO時のみ有効)" ); + //sw.WriteLine( "; Master volume settings" ); + //sw.WriteLine( "; (0=Silent - 100=Max)" ); + //sw.WriteLine( "MasterVolume={0}", this.nMasterVolume ); + //sw.WriteLine(); + + #endregion + + sw.WriteLine("; 背景画像の半透明割合(0:透明~255:不透明)"); + sw.WriteLine("; Transparency for background image in playing screen.(0:tranaparent - 255:no transparent)"); + sw.WriteLine("BGAlpha={0}", this.nBGAlpha); + sw.WriteLine(); + + #region [ AVI/BGA ] + + sw.WriteLine("; AVIの表示(0:OFF, 1:ON)"); + sw.WriteLine("AVI={0}", this.bEnableAVI ? 1 : 0); + sw.WriteLine(); + sw.WriteLine("; BGAの表示(0:OFF, 1:ON)"); + sw.WriteLine("BGA={0}", this.bEnableBGA ? 1 : 0); + sw.WriteLine(); + sw.WriteLine("; 動画表示モード( 0:表示しない, 1:背景のみ, 2:窓表示のみ, 3:両方)"); + sw.WriteLine("ClipDispType={0}", (int)this.eClipDispType); + sw.WriteLine(); + + #endregion + + #region [ プレビュー音 ] + + sw.WriteLine("; 曲選択からプレビュー音の再生までのウェイト[ms]"); + sw.WriteLine("PreviewSoundWait={0}", this.nMsWaitPreviewSoundFromSongSelected); + sw.WriteLine(); + sw.WriteLine("; 曲選択からプレビュー画像表示までのウェイト[ms]"); + sw.WriteLine("PreviewImageWait={0}", this.nMsWaitPreviewImageFromSongSelected); + sw.WriteLine(); + + #endregion + + //sw.WriteLine( "; Waveの再生位置自動補正(0:OFF, 1:ON)" ); + //sw.WriteLine( "AdjustWaves={0}", this.bWave再生位置自動調整機能有効 ? 1 : 0 ); + + #region [ BGM/ドラムヒット音の再生 ] + + sw.WriteLine("; BGM の再生(0:OFF, 1:ON)"); + sw.WriteLine("BGMSound={0}", this.bBGMPlayVoiceSound ? 1 : 0); + sw.WriteLine(); + + #endregion + + sw.WriteLine("; Hide Dan and Tower charts from the ensou song select screen (0:OFF, 1:ON)"); + sw.WriteLine("DanTowerHide={0}", this.bDanTowerHide ? 1 : 0); + sw.WriteLine(); + sw.WriteLine("; 最小表示コンボ数"); + sw.WriteLine("MinComboDrums={0}", this.nMinDisplayedCombo.Drums); + sw.WriteLine(); + sw.WriteLine("; RANDOM SELECT で子BOXを検索対象に含める (0:OFF, 1:ON)"); + sw.WriteLine("RandomFromSubBox={0}", this.bIncludeSubfoldersOnRandomSelect ? 1 : 0); + sw.WriteLine(); + sw.WriteLine("; 演奏情報を表示する (0:OFF, 1:ON)"); + sw.WriteLine("; Showing playing info on the playing screen. (0:OFF, 1:ON)"); + sw.WriteLine("ShowDebugStatus={0}", this.bDisplayDebugInfo ? 1 : 0); + sw.WriteLine(); + sw.WriteLine("; BS1770GAIN によるラウドネスメータの測量を適用する (0:OFF, 1:ON)"); + sw.WriteLine("; Apply BS1770GAIN loudness metadata (0:OFF, 1:ON)"); + sw.WriteLine("{0}={1}", nameof(ApplyLoudnessMetadata), this.ApplyLoudnessMetadata ? 1 : 0); + sw.WriteLine(); + sw.WriteLine($"; BS1770GAIN によるラウドネスメータの目標値 (0). ({CSound.MinimumLufs}-{CSound.MaximumLufs})"); + sw.WriteLine( + $"; Loudness Target in dB (decibels) relative to full scale (0). ({CSound.MinimumLufs}-{CSound.MaximumLufs})"); + sw.WriteLine("{0}={1}", nameof(TargetLoudness), TargetLoudness); + sw.WriteLine(); + sw.WriteLine("; .tjaファイルのSONGVOLヘッダを音源の音量に適用する (0:OFF, 1:ON)"); + sw.WriteLine("; Apply SONGVOL (0:OFF, 1:ON)"); + sw.WriteLine("{0}={1}", nameof(ApplySongVol), this.ApplySongVol ? 1 : 0); + sw.WriteLine(); + sw.WriteLine($"; 効果音の音量 ({CSound.MinimumGroupLevel}-{CSound.MaximumGroupLevel}%)"); + sw.WriteLine($"; Sound effect level ({CSound.MinimumGroupLevel}-{CSound.MaximumGroupLevel}%)"); + sw.WriteLine("{0}={1}", nameof(SoundEffectLevel), SoundEffectLevel); + sw.WriteLine(); + sw.WriteLine($"; 各ボイス、コンボボイスの音量 ({CSound.MinimumGroupLevel}-{CSound.MaximumGroupLevel}%)"); + sw.WriteLine($"; Voice level ({CSound.MinimumGroupLevel}-{CSound.MaximumGroupLevel}%)"); + sw.WriteLine("{0}={1}", nameof(VoiceLevel), VoiceLevel); + sw.WriteLine(); + sw.WriteLine($"; 選曲画面のプレビュー時の音量 ({CSound.MinimumGroupLevel}-{CSound.MaximumGroupLevel}%)"); + sw.WriteLine($"; Song preview level ({CSound.MinimumGroupLevel}-{CSound.MaximumGroupLevel}%)"); + sw.WriteLine("{0}={1}", nameof(SongPreviewLevel), SongPreviewLevel); + sw.WriteLine(); + sw.WriteLine($"; ゲーム中の音源の音量 ({CSound.MinimumGroupLevel}-{CSound.MaximumGroupLevel}%)"); + sw.WriteLine($"; Song playback level ({CSound.MinimumGroupLevel}-{CSound.MaximumGroupLevel}%)"); + sw.WriteLine("{0}={1}", nameof(SongPlaybackLevel), SongPlaybackLevel); + sw.WriteLine(); + sw.WriteLine( + $"; キーボードによる音量変更の増加量、減少量 ({MinimumKeyboardSoundLevelIncrement}-{MaximumKeyboardSoundLevelIncrement})"); + sw.WriteLine( + $"; Keyboard sound level increment ({MinimumKeyboardSoundLevelIncrement}-{MaximumKeyboardSoundLevelIncrement})"); + sw.WriteLine("{0}={1}", nameof(KeyboardSoundLevelIncrement), KeyboardSoundLevelIncrement); + sw.WriteLine($"; 音源再生前の空白時間 (ms)"); + sw.WriteLine($"; Blank time before music source to play. (ms)"); + sw.WriteLine("{0}={1}", nameof(MusicPreTimeMs), MusicPreTimeMs); + sw.WriteLine(); + sw.WriteLine("; バッファ入力モード(0:OFF, 1:ON)"); + sw.WriteLine("; Using Buffered input (0:OFF, 1:ON)"); + sw.WriteLine("BufferedInput={0}", this.bBufferedInputs ? 1 : 0); + sw.WriteLine(); + sw.WriteLine("; リザルト画像自動保存機能(0:OFF, 1:ON)"); // #25399 2011.6.9 yyagi + sw.WriteLine("; Set \"1\" if you'd like to save result screen image automatically"); // + sw.WriteLine("; when you get hiscore/hiskill."); // + sw.WriteLine("AutoResultCapture={0}", this.bIsAutoResultCapture ? 1 : 0); // + sw.WriteLine(); + sw.WriteLine("; Discordに再生中の譜面情報を送信する(0:OFF, 1:ON)"); // #25399 2011.6.9 yyagi + sw.WriteLine("; Share Playing .tja file infomation on Discord."); // + sw.WriteLine("{0}={1}", nameof(SendDiscordPlayingInformation), SendDiscordPlayingInformation ? 1 : 0); // + sw.WriteLine(); + sw.WriteLine("; 再生速度変更を、ピッチ変更で行うかどうか(0:ピッチ変更, 1:タイムストレッチ"); // #23664 2013.2.24 yyagi + sw.WriteLine("; (WASAPI/ASIO使用時のみ有効) "); + sw.WriteLine("; Set \"0\" if you'd like to use pitch shift with PlaySpeed."); // + sw.WriteLine("; Set \"1\" for time stretch."); // + sw.WriteLine("; (Only available when you're using using WASAPI or ASIO)"); // + sw.WriteLine("TimeStretch={0}", this.bTimeStretch ? 1 : 0); // + sw.WriteLine(); + //sw.WriteLine( "; WASAPI/ASIO使用時に、MP3をストリーム再生するかどうか(0:ストリーム再生する, 1:しない)" ); // + //sw.WriteLine( "; (mp3のシークがおかしくなる場合は、これを1にしてください) " ); // + //sw.WriteLine( "; Set \"0\" if you'd like to use mp3 streaming playback on WASAPI/ASIO." ); // + //sw.WriteLine( "; Set \"1\" not to use streaming playback for mp3." ); // + //sw.WriteLine( "; (If you feel illegal seek with mp3, please set it to 1.)" ); // + //sw.WriteLine( "NoMP3Streaming={0}", this.bNoMP3Streaming ? 1 : 0 ); // + //sw.WriteLine(); + sw.WriteLine("; 動画再生にDirectShowを使用する(0:OFF, 1:ON)"); + sw.WriteLine("; 動画再生にDirectShowを使うことによって、再生時の負担を軽減できます。"); + sw.WriteLine("; ただし使用時にはセットアップが必要になるのでご注意ください。"); + sw.WriteLine("DirectShowMode={0}", this.bDirectShowMode ? 1 : 0); + sw.WriteLine(); + + #region [ Adjust ] + + //sw.WriteLine( "; 判定タイミング調整(-9999~9999)[ms]" ); + //sw.WriteLine("; Revision value to adjust judgment timing."); // + //sw.WriteLine("InputAdjustTime={0}", this.nInputAdjustTimeMs); // + sw.WriteLine("GlobalOffset={0}", this.nGlobalOffsetMs); + sw.WriteLine(); + + #endregion + + sw.WriteLine("; TJAPlayer3のboxの表示をするかどうか (0:OFF, 1:ON)"); + sw.WriteLine("{0}={1}", nameof(TJAP3FolderMode), TJAP3FolderMode ? 1 : 0); + sw.WriteLine(); + sw.WriteLine("; 「また遊んでね」画面(0:OFF, 1:ON)"); + sw.WriteLine("EndingAnime={0}", this.bEndingAnime ? 1 : 0); + sw.WriteLine(); + sw.WriteLine(";-------------------"); + + #endregion + + #region [ AutoPlay ] + + sw.WriteLine("[AutoPlay]"); + sw.WriteLine(); + sw.WriteLine("; 自動演奏(0:OFF, 1:ON)"); + sw.WriteLine("Taiko={0}", this.bAutoPlay[0] ? 1 : 0); + sw.WriteLine("Taiko2P={0}", this.bAutoPlay[1] ? 1 : 0); + sw.WriteLine("Taiko3P={0}", this.bAutoPlay[2] ? 1 : 0); + sw.WriteLine("Taiko4P={0}", this.bAutoPlay[3] ? 1 : 0); + sw.WriteLine("Taiko5P={0}", this.bAutoPlay[4] ? 1 : 0); + sw.WriteLine("TaikoAutoRoll={0}", this.bAuto先生の連打 ? 1 : 0); + sw.WriteLine("RollsPerSec={0}", this.nRollsPerSec); + sw.WriteLine("DefaultAILevel={0}", this.nDefaultAILevel); + sw.WriteLine(); + sw.WriteLine(";-------------------"); + + #endregion + + #region [ Log ] + + sw.WriteLine("[Log]"); + sw.WriteLine(); + sw.WriteLine("; Log出力(0:OFF, 1:ON)"); + sw.WriteLine("OutputLog={0}", this.bOutputLogs ? 1 : 0); + sw.WriteLine(); + sw.WriteLine("; 曲データ検索に関するLog出力(0:OFF, 1:ON)"); + sw.WriteLine("TraceSongSearch={0}", this.bOutputSongSearchLog ? 1 : 0); + sw.WriteLine(); + sw.WriteLine("; 画像やサウンドの作成_解放に関するLog出力(0:OFF, 1:ON)"); + sw.WriteLine("TraceCreatedDisposed={0}", this.bOutputCreationReleaseLog ? 1 : 0); + sw.WriteLine(); + sw.WriteLine("; DTX読み込み詳細に関するLog出力(0:OFF, 1:ON)"); + sw.WriteLine("TraceDTXDetails={0}", this.bOutputDetailedDTXLog ? 1 : 0); + sw.WriteLine(); + sw.WriteLine(";-------------------"); + + #endregion + + #region [ PlayOption ] + + sw.WriteLine("[PlayOption]"); + sw.WriteLine(); + sw.WriteLine("; 各画像の表示設定"); + sw.WriteLine("; キャラクター画像を表示する (0:OFF, 1:ON)"); + sw.WriteLine("ShowChara={0}", ShowChara ? 1 : 0); + sw.WriteLine("; ダンサー画像を表示する (0:OFF, 1:ON)"); + sw.WriteLine("ShowDancer={0}", ShowDancer ? 1 : 0); + sw.WriteLine("; ランナー画像を表示する (0:OFF, 1:ON)"); + sw.WriteLine("ShowRunner={0}", ShowRunner ? 1 : 0); + sw.WriteLine("; モブ画像を表示する (0:OFF, 1:ON)"); + sw.WriteLine("ShowMob={0}", ShowMob ? 1 : 0); + sw.WriteLine("; フッター画像 (0:OFF, 1:ON)"); + sw.WriteLine("ShowFooter={0}", ShowFooter ? 1 : 0); + sw.WriteLine("; ぷちキャラ画像 (0:OFF, 1:ON)"); + sw.WriteLine("ShowPuchiChara={0}", ShowPuchiChara ? 1 : 0); + sw.WriteLine(); + sw.WriteLine("; 選曲画面でのタイマーを有効にするかどうか(0:無効,1:有効)"); + sw.WriteLine("; Enable countdown in songselect.(0:No, 1:Yes)"); + sw.WriteLine("EnableCountDownTimer={0}", this.bEnableCountdownTimer ? 1 : 0); + sw.WriteLine(); + + #region [ Invisible ] + + sw.WriteLine("; ドラムチップ非表示モード (0:OFF, 1=SEMI, 2:FULL)"); + sw.WriteLine("; Drums chip invisible mode"); + sw.WriteLine("DrumsInvisible={0}", (int)this.eInvisible.Drums); + sw.WriteLine(); + + #endregion + + sw.WriteLine("; ドラムREVERSEモード(0:OFF, 1:ON)"); + sw.WriteLine("DrumsReverse={0}", this.bReverse.Drums ? 1 : 0); + sw.WriteLine(); + sw.WriteLine("; RISKYモード(0:OFF, 1-10)"); // #23559 2011.6.23 yyagi + sw.WriteLine("; RISKY mode. 0=OFF, 1-10 is the times of misses to be Failed."); // + sw.WriteLine("Risky={0}", this.nRisky); // + sw.WriteLine(); + sw.WriteLine("; TIGHTモード(0:OFF, 1:ON)"); // #29500 2012.9.11 kairera0467 + sw.WriteLine("; TIGHT mode. 0=OFF, 1=ON "); + sw.WriteLine("DrumsTight={0}", this.bTight ? 1 : 0); + sw.WriteLine(); + sw.WriteLine("; ドラム譜面スクロール速度(0:x0.1, 9:x1.0, 14:x1.5,…,1999:x200.0)"); + sw.WriteLine("DrumsScrollSpeed1P={0}", this.nScrollSpeed[0]); + sw.WriteLine("DrumsScrollSpeed2P={0}", this.nScrollSpeed[1]); + sw.WriteLine("DrumsScrollSpeed3P={0}", this.nScrollSpeed[2]); + sw.WriteLine("DrumsScrollSpeed4P={0}", this.nScrollSpeed[3]); + sw.WriteLine("DrumsScrollSpeed5P={0}", this.nScrollSpeed[4]); + sw.WriteLine(); + sw.WriteLine("; Timing Zones (0-1 : Lenient, 2 : Regular, 3-4 : Strict)"); + sw.WriteLine("TimingZones1P={0}", this.nTimingZones[0]); + sw.WriteLine("TimingZones2P={0}", this.nTimingZones[1]); + sw.WriteLine("TimingZones3P={0}", this.nTimingZones[2]); + sw.WriteLine("TimingZones4P={0}", this.nTimingZones[3]); + sw.WriteLine("TimingZones5P={0}", this.nTimingZones[4]); + sw.WriteLine(); + sw.WriteLine("; Gametype (0 : Taiko, 1 : Bongo)"); + sw.WriteLine("Gametype1P={0}", (int)this.nGameType[0]); + sw.WriteLine("Gametype2P={0}", (int)this.nGameType[1]); + sw.WriteLine("Gametype3P={0}", (int)this.nGameType[2]); + sw.WriteLine("Gametype4P={0}", (int)this.nGameType[3]); + sw.WriteLine("Gametype5P={0}", (int)this.nGameType[4]); + sw.WriteLine(); + sw.WriteLine( + "; Fun Mods (0 : None, 1 : Avalanche (random scroll speed per note/chip), 2 : Minesweeper (replace randomly notes by bombs))"); + sw.WriteLine("FunMods1P={0}", (int)this.nFunMods[0]); + sw.WriteLine("FunMods2P={0}", (int)this.nFunMods[1]); + sw.WriteLine("FunMods3P={0}", (int)this.nFunMods[2]); + sw.WriteLine("FunMods4P={0}", (int)this.nFunMods[3]); + sw.WriteLine("FunMods5P={0}", (int)this.nFunMods[4]); + sw.WriteLine(); + sw.WriteLine("; 演奏速度(5~40)(→x5/20~x40/20)"); + sw.WriteLine("PlaySpeed={0}", this.nSongSpeed); + sw.WriteLine(); + + sw.WriteLine("; 演奏速度が一倍速であるときのみBGMを再生する(0:OFF, 1:ON)"); + sw.WriteLine("PlaySpeedNotEqualOneNoSound={0}", this.bNoAudioIfNot1xSpeed ? 1 : 0); + sw.WriteLine(); + sw.WriteLine("; デフォルトで選択される難易度"); + sw.WriteLine("DefaultCourse={0}", this.nDefaultCourse); + sw.WriteLine(); + sw.WriteLine("; スコア計算方法(0:旧配点, 1:旧筐体配点, 2:新配点)"); + sw.WriteLine("ScoreMode={0}", this.nScoreMode); + sw.WriteLine(); + sw.WriteLine("; 真打モード (0:OFF, 1:ON)"); + sw.WriteLine("; Fixed score mode (0:OFF, 1:ON)"); + sw.WriteLine("{0}={1}", nameof(ShinuchiMode), ShinuchiMode ? 1 : 0); + + sw.WriteLine("; 大音符の両手入力待機時間(ms)"); + sw.WriteLine("BigNotesWaitTime={0}", this.nBigNoteWaitTimems); + sw.WriteLine(); + sw.WriteLine("; 大音符の両手判定(0:OFF, 1:ON)"); + sw.WriteLine("BigNotesJudge={0}", this.bJudgeBigNotes ? 1 : 0); + sw.WriteLine(); + sw.WriteLine("; ゲージをNormalに強制(0:OFF, 1:ON)"); + sw.WriteLine("ForceNormalGauge={0}", this.bForceNormalGauge ? 1 : 0); + sw.WriteLine(); + sw.WriteLine("; NoInfo(0:OFF, 1:ON)"); + sw.WriteLine("NoInfo={0}", this.bNoInfo ? 1 : 0); + sw.WriteLine(); + sw.WriteLine("; 譜面分岐のアニメーション(0:7~14, 1:15)"); + sw.WriteLine("BranchAnime={0}", this.nBranchAnime); + sw.WriteLine(); + sw.WriteLine("; デフォルトの曲ソート(0:絶対パス順, 1:ジャンル名ソートOLD, 2:ジャンル名ソートNEW )"); + sw.WriteLine("0:Path, 1:GenreName(AC8~AC14), 2GenreName(AC15~)"); + sw.WriteLine("DefaultSongSort={0}", this.nDefaultSongSort); + sw.WriteLine("RecentlyPlayedMax={0}", this.nRecentlyPlayedMax); + sw.WriteLine(); + sw.WriteLine( + "; RANDOMモード(0:OFF, 1:Random (Kimagure), 2:Mirror (Abekobe) 3:SuperRandom (Detarame), 4:HyperRandom (Abekobe + Kimagure))"); + sw.WriteLine("TaikoRandom1P={0}", (int)this.eRandom[0]); + sw.WriteLine("TaikoRandom2P={0}", (int)this.eRandom[1]); + sw.WriteLine("TaikoRandom3P={0}", (int)this.eRandom[2]); + sw.WriteLine("TaikoRandom4P={0}", (int)this.eRandom[3]); + sw.WriteLine("TaikoRandom5P={0}", (int)this.eRandom[4]); + sw.WriteLine(); + sw.WriteLine("; STEALTHモード(0:OFF, 1:ドロン, 2:ステルス)"); + sw.WriteLine("TaikoStealth1P={0}", (int)this.eSTEALTH[0]); + sw.WriteLine("TaikoStealth2P={0}", (int)this.eSTEALTH[1]); + sw.WriteLine("TaikoStealth3P={0}", (int)this.eSTEALTH[2]); + sw.WriteLine("TaikoStealth4P={0}", (int)this.eSTEALTH[3]); + sw.WriteLine("TaikoStealth5P={0}", (int)this.eSTEALTH[4]); + sw.WriteLine(); + sw.WriteLine("; ゲーム(0:OFF, 1:完走!叩ききりまショー!, 2:完走!叩ききりまショー!(激辛) )"); + sw.WriteLine("GameMode={0}", (int)this.eGameMode); + sw.WriteLine(); + sw.WriteLine(); + sw.WriteLine("; 特訓モード時にPgUp/PgDnで何小節飛ばすか"); + sw.WriteLine("TokkunSkipMeasures={0}", this.TokkunSkipMeasures); + sw.WriteLine(); + sw.WriteLine("; 特訓モード時にジャンプポイントに飛ばすための時間(ms)"); + sw.WriteLine("; 指定ms以内に5回縁を叩きましょう"); + sw.WriteLine("{1}={0}", this.TokkunMashInterval, nameof(this.TokkunMashInterval)); + sw.WriteLine(); + sw.WriteLine("; JUST(0:OFF, 1:JUST, 2:SAFE)"); + sw.WriteLine("Just1P={0}", this.bJust[0]); + sw.WriteLine("Just2P={0}", this.bJust[1]); + sw.WriteLine("Just3P={0}", this.bJust[2]); + sw.WriteLine("Just4P={0}", this.bJust[3]); + sw.WriteLine(); + sw.WriteLine("; Hitsounds index (音色)"); + sw.WriteLine("HitSounds1P={0}", this.nHitSounds[0]); + sw.WriteLine("HitSounds2P={0}", this.nHitSounds[1]); + sw.WriteLine("HitSounds3P={0}", this.nHitSounds[2]); + sw.WriteLine("HitSounds4P={0}", this.nHitSounds[3]); + sw.WriteLine(); + sw.WriteLine("; 判定数の表示(0:OFF, 1:ON)"); + sw.WriteLine("JudgeCountDisplay={0}", this.bJudgeCountDisplay ? 1 : 0); + sw.WriteLine(); + sw.WriteLine("; 裏表移行アニメーションを有効する (0:OFF, 1:ON)"); + sw.WriteLine("ShowExExtraAnime={0}", this.ShowExExtraAnime ? 1 : 0); + sw.WriteLine(); + sw.WriteLine("; プレイ人数"); + sw.WriteLine("PlayerCount={0}", this.nPlayerCount); + sw.WriteLine(); + + + sw.WriteLine(";-------------------"); + + #endregion + + #region [ GUID ] + + sw.WriteLine("[GUID]"); + sw.WriteLine(); + foreach (KeyValuePair pair in this.dicJoystick) { + sw.WriteLine("JoystickID={0},{1}", pair.Key, pair.Value); } - private void ProcessSystemSection(string key, string value) { - switch (key) { - case "TJAPath": - this.strSongsPath = value; - break; - case "Lang": - this.sLang = value; - CLangManager.langAttach(value); - break; - case "LayoutType": - this.nLayoutType = int.Parse(value); - break; - case "SaveFileName": { - var _s = value.Split(new char[] { ',' }); - - // Ignore custom save file names if duplicates - if (!_s.GroupBy(x => x).Any(g => g.Count() > 1)) { - for (int i = 0; i < Math.Min(5, _s.Length); i++) { - this.sSaveFile[i] = _s[i]; - } - } - - break; - } - case "IgnoreSongUnlockables": - this.bIgnoreSongUnlockables = CConversion.bONorOFF(value[0]); - break; - case "SkinPath": { - string absSkinPath = value; - if (!System.IO.Path.IsPathRooted(value)) { - absSkinPath = System.IO.Path.Combine(OpenTaiko.strEXEのあるフォルダ, "System"); - absSkinPath = System.IO.Path.Combine(absSkinPath, value); - Uri u = new Uri(absSkinPath); - absSkinPath = u.AbsolutePath.ToString(); // str4内に相対パスがある場合に備える - absSkinPath = System.Web.HttpUtility.UrlDecode(absSkinPath); // デコードする - absSkinPath = - absSkinPath.Replace('/', System.IO.Path.DirectorySeparatorChar); // 区切り文字が\ではなく/なので置換する - } - - if (absSkinPath[absSkinPath.Length - 1] != - System.IO.Path.DirectorySeparatorChar) // フォルダ名末尾に\を必ずつけて、CSkin側と表記を統一する - { - absSkinPath += System.IO.Path.DirectorySeparatorChar; - } - - this.strSystemSkinSubfolderFullName = absSkinPath; - break; - } - case nameof(this.PreAssetsLoading): - this.PreAssetsLoading = CConversion.bONorOFF(value[0]); - break; - case nameof(this.FastRender): - this.FastRender = CConversion.bONorOFF(value[0]); - break; - case nameof(this.ASyncTextureLoad): - this.ASyncTextureLoad = CConversion.bONorOFF(value[0]); - break; - case nameof(this.SimpleMode): - this.SimpleMode = CConversion.bONorOFF(value[0]); - break; - case "GraphicsDeviceType": - this.nGraphicsDeviceType = CConversion.ParseIntInRange(value, 0, 4, this.nGraphicsDeviceType); - break; - case "FullScreen": - this.bFullScreen = CConversion.bONorOFF(value[0]); - break; - case "WindowX": - this.nWindowBaseXPosition = CConversion.ParseIntInRange( - value, 0, 9999, this.nWindowBaseXPosition); - break; - case "WindowY": - this.nWindowBaseYPosition = CConversion.ParseIntInRange( - value, 0, 9999, this.nWindowBaseYPosition); - break; - case "WindowWidth": { - this.nWindowWidth = CConversion.ParseIntInRange(value, 1, 65535, this.nWindowWidth); - if (this.nWindowWidth <= 0) { - this.nWindowWidth = SampleFramework.GameWindowSize.Width; - } - - break; - } - case "WindowHeight": { - this.nWindowHeight = CConversion.ParseIntInRange(value, 1, 65535, this.nWindowHeight); - if (this.nWindowHeight <= 0) { - this.nWindowHeight = SampleFramework.GameWindowSize.Height; - } - - break; - } - case "DoubleClickFullScreen": - this.bIsAllowedDoubleClickFullscreen = CConversion.bONorOFF(value[0]); - break; - case "EnableSystemMenu": - this.bIsEnabledSystemMenu = CConversion.bONorOFF(value[0]); - break; - case "BackSleep": - this.nMsSleepUnfocused = CConversion.ParseIntInRangeAndClamp(value, 0, 50, this.nMsSleepUnfocused); - break; - case "SoundDeviceType": - this.nSoundDeviceType = CConversion.ParseIntInRange(value, 0, 4, this.nSoundDeviceType); - break; - case "BassBufferSizeMs": - this.nBassBufferSizeMs = CConversion.ParseIntInRange(value, 0, 9999, this.nBassBufferSizeMs); - break; - case "WASAPIBufferSizeMs": - this.nWASAPIBufferSizeMs = CConversion.ParseIntInRange(value, 0, 9999, this.nWASAPIBufferSizeMs); - break; - case "ASIODevice": { - string[] asiodev = CEnumerateAllAsioDevices.GetAllASIODevices(); - this.nASIODevice = CConversion.ParseIntInRange(value, 0, asiodev.Length - 1, this.nASIODevice); - break; - } - case "SoundTimerType": - this.bUseOSTimer = CConversion.bONorOFF(value[0]); - break; - case "FontName": - this.FontName = value; - break; - case "BoxFontName": - this.BoxFontName = value; - break; - case "VSyncWait": - this.bEnableVSync = CConversion.bONorOFF(value[0]); - break; - case "SleepTimePerFrame": - this.nMsSleepPerFrame = CConversion.ParseIntInRangeAndClamp(value, -1, 50, this.nMsSleepPerFrame); - break; - case "BGAlpha": - this.nBackgroundTransparency = - CConversion.ParseIntInRange(value, 0, 0xff, this.nBackgroundTransparency); - break; - case "AVI": - this.bEnableAVI = CConversion.bONorOFF(value[0]); - break; - case "BGA": - this.bEnableBGA = CConversion.bONorOFF(value[0]); - break; - case "ClipDispType": - this.eClipDispType = - (EClipDispType)CConversion.ParseIntInRange(value, 0, 3, (int)this.eClipDispType); - break; - case "PreviewSoundWait": - this.nMsWaitPreviewSoundFromSongSelected = CConversion.ParseIntInRange(value, 0, 0x5f5e0ff, - this.nMsWaitPreviewSoundFromSongSelected); - break; - case "PreviewImageWait": - this.nMsWaitPreviewImageFromSongSelected = CConversion.ParseIntInRange(value, 0, 0x5f5e0ff, - this.nMsWaitPreviewImageFromSongSelected); - break; - case "BGMSound": - this.bBGMPlayVoiceSound = CConversion.bONorOFF(value[0]); - break; - case "DanTowerHide": - this.bDanTowerHide = CConversion.bONorOFF(value[0]); - break; - case "RandomFromSubBox": - this.bIncludeSubfoldersOnRandomSelect = CConversion.bONorOFF(value[0]); - break; - case "MinComboDrums": - this.nMinDisplayedCombo.Drums = - CConversion.ParseIntInRange(value, 1, 0x1869f, this.nMinDisplayedCombo.Drums); - break; - case "ShowDebugStatus": - this.bDisplayDebugInfo = CConversion.bONorOFF(value[0]); - break; - case nameof(this.ApplyLoudnessMetadata): - this.ApplyLoudnessMetadata = CConversion.bONorOFF(value[0]); - break; - case nameof(this.TargetLoudness): - this.TargetLoudness = CConversion.ParseDoubleInRange(value, CSound.MinimumLufs.ToDouble(), - CSound.MaximumLufs.ToDouble(), this.TargetLoudness); - break; - case nameof(this.ApplySongVol): - this.ApplySongVol = CConversion.bONorOFF(value[0]); - break; - case nameof(this.SoundEffectLevel): - this.SoundEffectLevel = CConversion.ParseIntInRange(value, CSound.MinimumGroupLevel, - CSound.MaximumGroupLevel, this.SoundEffectLevel); - break; - case nameof(this.VoiceLevel): - this.VoiceLevel = CConversion.ParseIntInRange(value, CSound.MinimumGroupLevel, - CSound.MaximumGroupLevel, this.VoiceLevel); - break; - case nameof(this.SongPreviewLevel): - this.SongPreviewLevel = CConversion.ParseIntInRange(value, CSound.MinimumGroupLevel, - CSound.MaximumGroupLevel, this.SongPreviewLevel); - break; - case nameof(this.SongPlaybackLevel): - this.SongPlaybackLevel = CConversion.ParseIntInRange(value, CSound.MinimumGroupLevel, - CSound.MaximumGroupLevel, this.SongPlaybackLevel); - break; - case nameof(this.KeyboardSoundLevelIncrement): - this.KeyboardSoundLevelIncrement = CConversion.ParseIntInRange(value, - MinimumKeyboardSoundLevelIncrement, MaximumKeyboardSoundLevelIncrement, - this.KeyboardSoundLevelIncrement); - break; - case nameof(this.MusicPreTimeMs): - this.MusicPreTimeMs = int.Parse(value); - break; - case "AutoResultCapture": - this.bIsAutoResultCapture = CConversion.bONorOFF(value[0]); - break; - case nameof(this.SendDiscordPlayingInformation): - this.SendDiscordPlayingInformation = CConversion.bONorOFF(value[0]); - break; - case "TimeStretch": - this.bTimeStretch = CConversion.bONorOFF(value[0]); - break; - case "GlobalOffset": - this.nGlobalOffsetMs = CConversion.ParseIntInRange(value, -9999, 9999, this.nGlobalOffsetMs); - break; - case "BufferedInput": - this.bBufferedInputs = CConversion.bONorOFF(value[0]); - break; - case "PolyphonicSounds": - this.nPoliphonicSounds = CConversion.ParseIntInRange(value, 1, 8, this.nPoliphonicSounds); - break; - case "LCVelocityMin": - this.nVelocityMin.LC = CConversion.ParseIntInRange(value, 0, 127, this.nVelocityMin.LC); - break; - case "HHVelocityMin": - this.nVelocityMin.HH = CConversion.ParseIntInRange(value, 0, 127, this.nVelocityMin.HH); - break; - case "SDVelocityMin": - this.nVelocityMin.SD = CConversion.ParseIntInRange(value, 0, 127, this.nVelocityMin.SD); - break; - case "BDVelocityMin": - this.nVelocityMin.BD = CConversion.ParseIntInRange(value, 0, 127, this.nVelocityMin.BD); - break; - case "HTVelocityMin": - this.nVelocityMin.HT = CConversion.ParseIntInRange(value, 0, 127, this.nVelocityMin.HT); - break; - case "LTVelocityMin": - this.nVelocityMin.LT = CConversion.ParseIntInRange(value, 0, 127, this.nVelocityMin.LT); - break; - case "FTVelocityMin": - this.nVelocityMin.FT = CConversion.ParseIntInRange(value, 0, 127, this.nVelocityMin.FT); - break; - case "CYVelocityMin": - this.nVelocityMin.CY = CConversion.ParseIntInRange(value, 0, 127, this.nVelocityMin.CY); - break; - case "RDVelocityMin": - this.nVelocityMin.RD = CConversion.ParseIntInRange(value, 0, 127, this.nVelocityMin.RD); - break; - case "DirectShowMode": - this.bDirectShowMode = CConversion.bONorOFF(value[0]); - ; - break; - case nameof(this.TJAP3FolderMode): - this.TJAP3FolderMode = CConversion.bONorOFF(value[0]); - break; - case "EndingAnime": - this.bEndingAnime = CConversion.bONorOFF(value[0]); - break; - } + foreach (KeyValuePair pair in this.dicGamepad) { + sw.WriteLine("GamepadID={0},{1}", pair.Key, pair.Value); } - private void ProcessAutoPlaySection(string key, string value) { - switch (key) { - case "Taiko": - this.bAutoPlay[0] = CConversion.bONorOFF(value[0]); - break; - case "Taiko2P": - this.bAutoPlay[1] = CConversion.bONorOFF(value[0]); - break; - case "Taiko3P": - this.bAutoPlay[2] = CConversion.bONorOFF(value[0]); - break; - case "Taiko4P": - this.bAutoPlay[3] = CConversion.bONorOFF(value[0]); - break; - case "Taiko5P": - this.bAutoPlay[4] = CConversion.bONorOFF(value[0]); - break; - case "TaikoAutoRoll": - this.bAuto先生の連打 = CConversion.bONorOFF(value[0]); - break; - case "RollsPerSec": - this.nRollsPerSec = int.Parse(value); - break; - case "DefaultAILevel": - this.nDefaultAILevel = int.Parse(value); - this.nAILevel = this.nDefaultAILevel; - break; - } + #endregion + + #region [ DrumsKeyAssign ] + + sw.WriteLine(); + sw.WriteLine(";-------------------"); + sw.WriteLine("; キーアサイン"); + sw.WriteLine("; 項 目:Keyboard → 'K'+'0'+キーコード(10進数)"); + sw.WriteLine("; Mouse → 'N'+'0'+ボタン番号(0~7)"); + sw.WriteLine("; MIDI In → 'M'+デバイス番号1桁(0~9,A~Z)+ノート番号(10進数)"); + sw.WriteLine("; Joystick → 'J'+デバイス番号1桁(0~9,A~Z)+ 0 ...... X減少(左)ボタン"); + sw.WriteLine("; 1 ...... X増加(右)ボタン"); + sw.WriteLine("; 2 ...... Y減少(上)ボタン"); + sw.WriteLine("; 3 ...... Y増加(下)ボタン"); + sw.WriteLine("; 4 ...... Z減少(前)ボタン"); + sw.WriteLine("; 5 ...... Z増加(後)ボタン"); + sw.WriteLine("; 6~133.. ボタン1~128"); + sw.WriteLine("; これらの項目を 16 個まで指定可能(',' で区切って記述)。"); + sw.WriteLine(";"); + sw.WriteLine("; 表記例:HH=K044,M042,J16"); + sw.WriteLine("; → HiHat を Keyboard の 44 ('Z'), MidiIn#0 の 42, JoyPad#1 の 6(ボタン1) に割当て"); + sw.WriteLine(";"); + sw.WriteLine("; ※Joystick のデバイス番号とデバイスとの関係は [GUID] セクションに記してあるものが有効。"); + sw.WriteLine(";"); + sw.WriteLine(); + sw.WriteLine("[DrumsKeyAssign]"); + sw.WriteLine(); + + sw.Write("LeftRed="); + this.WriteKeyAssignment(sw, this.KeyAssign.Drums.LeftRed); + sw.WriteLine(); + sw.Write("RightRed="); + this.WriteKeyAssignment(sw, this.KeyAssign.Drums.RightRed); + sw.WriteLine(); + sw.Write("LeftBlue="); // #27029 2012.1.4 from + this.WriteKeyAssignment(sw, this.KeyAssign.Drums.LeftBlue); // + sw.WriteLine(); // + sw.Write("RightBlue="); // #27029 2012.1.4 from + this.WriteKeyAssignment(sw, this.KeyAssign.Drums.RightBlue); // + sw.WriteLine(); + + sw.Write("LeftRed2P="); + this.WriteKeyAssignment(sw, this.KeyAssign.Drums.LeftRed2P); + sw.WriteLine(); + sw.Write("RightRed2P="); + this.WriteKeyAssignment(sw, this.KeyAssign.Drums.RightRed2P); + sw.WriteLine(); + sw.Write("LeftBlue2P="); // #27029 2012.1.4 from + this.WriteKeyAssignment(sw, this.KeyAssign.Drums.LeftBlue2P); // + sw.WriteLine(); // + sw.Write("RightBlue2P="); // #27029 2012.1.4 from + this.WriteKeyAssignment(sw, this.KeyAssign.Drums.RightBlue2P); // + sw.WriteLine(); + + sw.Write("LeftRed3P="); + this.WriteKeyAssignment(sw, this.KeyAssign.Drums.LeftRed3P); + sw.WriteLine(); + sw.Write("RightRed3P="); + this.WriteKeyAssignment(sw, this.KeyAssign.Drums.RightRed3P); + sw.WriteLine(); + sw.Write("LeftBlue3P="); // #27029 2012.1.4 from + this.WriteKeyAssignment(sw, this.KeyAssign.Drums.LeftBlue3P); // + sw.WriteLine(); // + sw.Write("RightBlue3P="); // #27029 2012.1.4 from + this.WriteKeyAssignment(sw, this.KeyAssign.Drums.RightBlue3P); // + sw.WriteLine(); + + sw.Write("LeftRed4P="); + this.WriteKeyAssignment(sw, this.KeyAssign.Drums.LeftRed4P); + sw.WriteLine(); + sw.Write("RightRed4P="); + this.WriteKeyAssignment(sw, this.KeyAssign.Drums.RightRed4P); + sw.WriteLine(); + sw.Write("LeftBlue4P="); // #27029 2012.1.4 from + this.WriteKeyAssignment(sw, this.KeyAssign.Drums.LeftBlue4P); // + sw.WriteLine(); // + sw.Write("RightBlue4P="); // #27029 2012.1.4 from + this.WriteKeyAssignment(sw, this.KeyAssign.Drums.RightBlue4P); // + sw.WriteLine(); + + sw.Write("LeftRed5P="); + this.WriteKeyAssignment(sw, this.KeyAssign.Drums.LeftRed5P); + sw.WriteLine(); + sw.Write("RightRed5P="); + this.WriteKeyAssignment(sw, this.KeyAssign.Drums.RightRed5P); + sw.WriteLine(); + sw.Write("LeftBlue5P="); // #27029 2012.1.4 from + this.WriteKeyAssignment(sw, this.KeyAssign.Drums.LeftBlue5P); // + sw.WriteLine(); // + sw.Write("RightBlue5P="); // #27029 2012.1.4 from + this.WriteKeyAssignment(sw, this.KeyAssign.Drums.RightBlue5P); // + sw.WriteLine(); + + sw.Write("Clap="); + this.WriteKeyAssignment(sw, this.KeyAssign.Drums.Clap); + sw.WriteLine(); + sw.Write("Clap2P="); + this.WriteKeyAssignment(sw, this.KeyAssign.Drums.Clap2P); + sw.WriteLine(); + sw.Write("Clap3P="); + this.WriteKeyAssignment(sw, this.KeyAssign.Drums.Clap3P); + sw.WriteLine(); + sw.Write("Clap4P="); + this.WriteKeyAssignment(sw, this.KeyAssign.Drums.Clap4P); + sw.WriteLine(); + sw.Write("Clap5P="); + this.WriteKeyAssignment(sw, this.KeyAssign.Drums.Clap5P); + sw.WriteLine(); + + sw.Write("Decide="); + this.WriteKeyAssignment(sw, this.KeyAssign.Drums.Decide); + sw.WriteLine(); + sw.Write("Cancel="); + this.WriteKeyAssignment(sw, this.KeyAssign.Drums.Cancel); + sw.WriteLine(); + sw.Write("LeftChange="); + this.WriteKeyAssignment(sw, this.KeyAssign.Drums.LeftChange); + sw.WriteLine(); + sw.Write("RightChange="); + this.WriteKeyAssignment(sw, this.KeyAssign.Drums.RightChange); + sw.WriteLine(); + + sw.WriteLine(); + + #endregion + + #region [ SystemKeyAssign ] + + sw.WriteLine("[SystemKeyAssign]"); + sw.WriteLine(); + sw.Write("Capture="); + this.WriteKeyAssignment(sw, this.KeyAssign.System.Capture); + sw.WriteLine(); + sw.Write("SongVolumeIncrease="); + this.WriteKeyAssignment(sw, this.KeyAssign.System.SongVolIncrease); + sw.WriteLine(); + sw.Write("SongVolumeDecrease="); + this.WriteKeyAssignment(sw, this.KeyAssign.System.SongVolDecrease); + sw.WriteLine(); + sw.Write("DisplayHits="); + this.WriteKeyAssignment(sw, this.KeyAssign.System.DisplayHits); + sw.WriteLine(); + sw.Write("DisplayDebug="); + this.WriteKeyAssignment(sw, this.KeyAssign.System.DisplayDebug); + sw.WriteLine(); + sw.Write("QuickConfig="); + this.WriteKeyAssignment(sw, this.KeyAssign.System.QuickConfig); + sw.WriteLine(); + sw.Write("NewHeya="); + this.WriteKeyAssignment(sw, this.KeyAssign.System.NewHeya); + sw.WriteLine(); + sw.Write("SortSongs="); + this.WriteKeyAssignment(sw, this.KeyAssign.System.SortSongs); + sw.WriteLine(); + sw.Write("ToggleAutoP1="); + this.WriteKeyAssignment(sw, this.KeyAssign.System.ToggleAutoP1); + sw.WriteLine(); + sw.Write("ToggleAutoP2="); + this.WriteKeyAssignment(sw, this.KeyAssign.System.ToggleAutoP2); + sw.WriteLine(); + sw.Write("ToggleTrainingMode="); + this.WriteKeyAssignment(sw, this.KeyAssign.System.ToggleTrainingMode); + sw.WriteLine(); + sw.Write("CycleVideoDisplayMode="); + this.WriteKeyAssignment(sw, this.KeyAssign.System.CycleVideoDisplayMode); + sw.WriteLine(); + sw.WriteLine(); + + #endregion + + #region [ TrainingKeyAssign ] + + sw.WriteLine("[TrainingKeyAssign]"); + sw.WriteLine(); + sw.Write("TrainingIncreaseScrollSpeed="); + this.WriteKeyAssignment(sw, this.KeyAssign.Drums.TrainingIncreaseScrollSpeed); + sw.WriteLine(); + sw.Write("TrainingDecreaseScrollSpeed="); + this.WriteKeyAssignment(sw, this.KeyAssign.Drums.TrainingDecreaseScrollSpeed); + sw.WriteLine(); + sw.Write("TrainingIncreaseSongSpeed="); + this.WriteKeyAssignment(sw, this.KeyAssign.Drums.TrainingIncreaseSongSpeed); + sw.WriteLine(); + sw.Write("TrainingDecreaseSongSpeed="); + this.WriteKeyAssignment(sw, this.KeyAssign.Drums.TrainingDecreaseSongSpeed); + sw.WriteLine(); + sw.Write("TrainingToggleAuto="); + this.WriteKeyAssignment(sw, this.KeyAssign.Drums.TrainingToggleAuto); + sw.WriteLine(); + sw.Write("TrainingBranchNormal="); + this.WriteKeyAssignment(sw, this.KeyAssign.Drums.TrainingBranchNormal); + sw.WriteLine(); + sw.Write("TrainingBranchExpert="); + this.WriteKeyAssignment(sw, this.KeyAssign.Drums.TrainingBranchExpert); + sw.WriteLine(); + sw.Write("TrainingBranchMaster="); + this.WriteKeyAssignment(sw, this.KeyAssign.Drums.TrainingBranchMaster); + sw.WriteLine(); + sw.Write("TrainingPause="); + this.WriteKeyAssignment(sw, this.KeyAssign.Drums.TrainingPause); + sw.WriteLine(); + sw.Write("TrainingBookmark="); + this.WriteKeyAssignment(sw, this.KeyAssign.Drums.TrainingBookmark); + sw.WriteLine(); + sw.Write("TrainingMoveForwardMeasure="); + this.WriteKeyAssignment(sw, this.KeyAssign.Drums.TrainingMoveForwardMeasure); + sw.WriteLine(); + sw.Write("TrainingMoveBackMeasure="); + this.WriteKeyAssignment(sw, this.KeyAssign.Drums.TrainingMoveBackMeasure); + sw.WriteLine(); + sw.Write("TrainingSkipForwardMeasure="); + this.WriteKeyAssignment(sw, this.KeyAssign.Drums.TrainingSkipForwardMeasure); + sw.WriteLine(); + sw.Write("TrainingSkipBackMeasure="); + this.WriteKeyAssignment(sw, this.KeyAssign.Drums.TrainingSkipBackMeasure); + sw.WriteLine(); + sw.Write("TrainingJumpToFirstMeasure="); + this.WriteKeyAssignment(sw, this.KeyAssign.Drums.TrainingJumpToFirstMeasure); + sw.WriteLine(); + sw.Write("TrainingJumpToLastMeasure="); + this.WriteKeyAssignment(sw, this.KeyAssign.Drums.TrainingJumpToLastMeasure); + sw.WriteLine(); + sw.WriteLine(); + + #endregion + + #region [DEBUG] + + sw.WriteLine("[DEBUG]"); + sw.WriteLine(); + sw.WriteLine("ImGui={0}", this.DEBUG_bShowImgui ? 1 : 0); + sw.WriteLine(); + sw.WriteLine(); + + #endregion + + sw.Close(); + } + + public void LoadFromFile(string iniFileName) { + this.ConfigIniFileName = iniFileName; + this.bConfigIniFileExists = File.Exists(this.ConfigIniFileName); + if (!this.bConfigIniFileExists) { + return; } - private void ProcessHitRangeSection(string key, string value) { - switch (key) { - case "Perfect": - this.nHitRangeMs.Perfect = - CConversion.ParseIntInRange(value, 0, 0x3e7, this.nHitRangeMs.Perfect); - break; - case "Great": - this.nHitRangeMs.Great = - CConversion.ParseIntInRange(value, 0, 0x3e7, this.nHitRangeMs.Great); - break; - case "Good": - this.nHitRangeMs.Good = - CConversion.ParseIntInRange(value, 0, 0x3e7, this.nHitRangeMs.Good); - break; - case "Poor": - this.nHitRangeMs.Poor = - CConversion.ParseIntInRange(value, 0, 0x3e7, this.nHitRangeMs.Poor); - break; - } + string str; + this.ClearAllKeyAssignments(); + using (StreamReader reader = + new StreamReader(this.ConfigIniFileName, Encoding.GetEncoding(OpenTaiko.sEncType))) { + str = reader.ReadToEnd(); } - private void ProcessLogSection(string key, string value) { - switch (key) { - case "OutputLog": - this.bOutputLogs = CConversion.bONorOFF(value[0]); - break; - case "TraceCreatedDisposed": - this.bOutputCreationReleaseLog = CConversion.bONorOFF(value[0]); - break; - case "TraceDTXDetails": - this.bOutputDetailedDTXLog = CConversion.bONorOFF(value[0]); - break; - case "TraceSongSearch": - this.bOutputSongSearchLog = CConversion.bONorOFF(value[0]); - break; - } - } + this.LoadFromString(str); + } - private void ProcessPlayOptionSection(string key, string value) { - switch (key) { - case "ShowChara": - this.ShowChara = CConversion.bONorOFF(value[0]); - break; - case "ShowDancer": - this.ShowDancer = CConversion.bONorOFF(value[0]); - break; - case "ShowRunner": - this.ShowRunner = CConversion.bONorOFF(value[0]); - break; - case "ShowMob": - this.ShowMob = CConversion.bONorOFF(value[0]); - break; - case "ShowFooter": - this.ShowFooter = CConversion.bONorOFF(value[0]); - break; - case "ShowPuchiChara": - this.ShowPuchiChara = CConversion.bONorOFF(value[0]); - break; - case "EnableCountDownTimer": - this.bEnableCountdownTimer = CConversion.bONorOFF(value[0]); - break; - case "DrumsInvisible": - this.eInvisible.Drums = - (EInvisible)CConversion.ParseIntInRange(value, 0, 2, (int)this.eInvisible.Drums); - break; - case "DrumsReverse": - this.bReverse.Drums = CConversion.bONorOFF(value[0]); - break; - case "DrumsPosition": - this.JudgeTextDisplayPosition.Drums = - (EJudgeTextDisplayPosition)CConversion.ParseIntInRange(value, 0, 2, - (int)this.JudgeTextDisplayPosition.Drums); - break; - case "DrumsScrollSpeed": - case "DrumsScrollSpeed1P": - this.nScrollSpeed[0] = - CConversion.ParseIntInRange(value, 0, 0x7cf, this.nScrollSpeed[0]); - break; - case "DrumsScrollSpeed2P": - this.nScrollSpeed[1] = - CConversion.ParseIntInRange(value, 0, 0x7cf, this.nScrollSpeed[1]); - break; - case "DrumsScrollSpeed3P": - this.nScrollSpeed[2] = - CConversion.ParseIntInRange(value, 0, 0x7cf, this.nScrollSpeed[2]); - break; - case "DrumsScrollSpeed4P": - this.nScrollSpeed[3] = - CConversion.ParseIntInRange(value, 0, 0x7cf, this.nScrollSpeed[3]); - break; - case "DrumsScrollSpeed5P": - this.nScrollSpeed[4] = - CConversion.ParseIntInRange(value, 0, 0x7cf, this.nScrollSpeed[4]); - break; - case "TimingZones1P": - this.nTimingZones[0] = - CConversion.ParseIntInRange(value, 0, 4, this.nTimingZones[0]); - break; - case "TimingZones2P": - this.nTimingZones[1] = - CConversion.ParseIntInRange(value, 0, 4, this.nTimingZones[1]); - break; - case "TimingZones3P": - this.nTimingZones[2] = - CConversion.ParseIntInRange(value, 0, 4, this.nTimingZones[2]); - break; - case "TimingZones4P": - this.nTimingZones[3] = - CConversion.ParseIntInRange(value, 0, 4, this.nTimingZones[3]); - break; - case "TimingZones5P": - this.nTimingZones[4] = - CConversion.ParseIntInRange(value, 0, 4, this.nTimingZones[4]); - break; - case "Just": - case "Just1P": - this.bJust[0] = CConversion.ParseIntInRange(value, 0, 2, this.bJust[0]); - break; - case "Just2P": - this.bJust[1] = CConversion.ParseIntInRange(value, 0, 2, this.bJust[1]); - break; - case "Just3P": - this.bJust[2] = CConversion.ParseIntInRange(value, 0, 2, this.bJust[2]); - break; - case "Just4P": - this.bJust[3] = CConversion.ParseIntInRange(value, 0, 2, this.bJust[3]); - break; - case "Just5P": - this.bJust[4] = CConversion.ParseIntInRange(value, 0, 2, this.bJust[4]); - break; - case "HitSounds1P": - this.nHitSounds[0] = - CConversion.ParseIntInRange(value, 0, 9999999, this.nHitSounds[0]); - break; - case "HitSounds2P": - this.nHitSounds[1] = - CConversion.ParseIntInRange(value, 0, 9999999, this.nHitSounds[1]); - break; - case "HitSounds3P": - this.nHitSounds[2] = - CConversion.ParseIntInRange(value, 0, 9999999, this.nHitSounds[2]); - break; - case "HitSounds4P": - this.nHitSounds[3] = - CConversion.ParseIntInRange(value, 0, 9999999, this.nHitSounds[3]); - break; - case "HitSounds5P": - this.nHitSounds[4] = - CConversion.ParseIntInRange(value, 0, 9999999, this.nHitSounds[4]); - break; - case "Gametype1P": - this.nGameType[0] = - (EGameType)CConversion.ParseIntInRange(value, 0, 1, (int)this.nGameType[0]); - break; - case "Gametype2P": - this.nGameType[1] = - (EGameType)CConversion.ParseIntInRange(value, 0, 1, (int)this.nGameType[1]); - break; - case "Gametype3P": - this.nGameType[2] = - (EGameType)CConversion.ParseIntInRange(value, 0, 1, (int)this.nGameType[2]); - break; - case "Gametype4P": - this.nGameType[3] = - (EGameType)CConversion.ParseIntInRange(value, 0, 1, (int)this.nGameType[3]); - break; - case "Gametype5P": - this.nGameType[4] = - (EGameType)CConversion.ParseIntInRange(value, 0, 1, (int)this.nGameType[4]); - break; - case "FunMods1P": - this.nFunMods[0] = - (EFunMods)CConversion.ParseIntInRange(value, 0, (int)EFunMods.Total - 1, (int)this.nFunMods[0]); - break; - case "FunMods2P": - this.nFunMods[1] = - (EFunMods)CConversion.ParseIntInRange(value, 0, (int)EFunMods.Total - 1, (int)this.nFunMods[1]); - break; - case "FunMods3P": - this.nFunMods[2] = - (EFunMods)CConversion.ParseIntInRange(value, 0, (int)EFunMods.Total - 1, (int)this.nFunMods[2]); - break; - case "FunMods4P": - this.nFunMods[3] = - (EFunMods)CConversion.ParseIntInRange(value, 0, (int)EFunMods.Total - 1, (int)this.nFunMods[3]); - break; - case "FunMods5P": - this.nFunMods[4] = - (EFunMods)CConversion.ParseIntInRange(value, 0, (int)EFunMods.Total - 1, (int)this.nFunMods[4]); - break; - case "TaikoStealth1P": - case "TaikoStealth": - this.eSTEALTH[0] = - (EStealthMode)CConversion.ParseIntInRange(value, 0, 3, (int)this.eSTEALTH[0]); - break; - case "TaikoStealth2P": - this.eSTEALTH[1] = - (EStealthMode)CConversion.ParseIntInRange(value, 0, 3, (int)this.eSTEALTH[1]); - break; - case "TaikoStealth3P": - this.eSTEALTH[2] = - (EStealthMode)CConversion.ParseIntInRange(value, 0, 3, (int)this.eSTEALTH[2]); - break; - case "TaikoStealth4P": - this.eSTEALTH[3] = - (EStealthMode)CConversion.ParseIntInRange(value, 0, 3, (int)this.eSTEALTH[3]); - break; - case "TaikoStealth5P": - this.eSTEALTH[4] = - (EStealthMode)CConversion.ParseIntInRange(value, 0, 3, (int)this.eSTEALTH[4]); - break; - case "TaikoRandom1P": - case "TaikoRandom": - this.eRandom[0] = - (ERandomMode)CConversion.ParseIntInRange(value, 0, 4, (int)this.eRandom[0]); - break; - case "TaikoRandom2P": - this.eRandom[1] = - (ERandomMode)CConversion.ParseIntInRange(value, 0, 4, (int)this.eRandom[1]); - break; - case "TaikoRandom3P": - this.eRandom[2] = - (ERandomMode)CConversion.ParseIntInRange(value, 0, 4, (int)this.eRandom[2]); - break; - case "TaikoRandom4P": - this.eRandom[3] = - (ERandomMode)CConversion.ParseIntInRange(value, 0, 4, (int)this.eRandom[3]); - break; - case "TaikoRandom5P": - this.eRandom[4] = - (ERandomMode)CConversion.ParseIntInRange(value, 0, 4, (int)this.eRandom[4]); - break; - case "PlaySpeed": - this.nSongSpeed = - CConversion.ParseIntInRange(value, 5, 400, this.nSongSpeed); - break; - case "PlaySpeedNotEqualOneNoSound": - this.bNoAudioIfNot1xSpeed = CConversion.bONorOFF(value[0]); - break; - case "Risky": - this.nRisky = CConversion.ParseIntInRange(value, 0, 10, this.nRisky); - break; - case "DrumsTight": - this.bTight = CConversion.bONorOFF(value[0]); - break; - case "BranchGuide": - this.bBranchGuide = CConversion.bONorOFF(value[0]); - break; - case "DefaultCourse": - this.nDefaultCourse = - CConversion.ParseIntInRange(value, 0, 5, this.nDefaultCourse); - break; - case "ScoreMode": - this.nScoreMode = CConversion.ParseIntInRange(value, 0, 3, this.nScoreMode); - break; - case "HispeedRandom": - this.bHispeedRandom = CConversion.bONorOFF(value[0]); - break; - case "BigNotesWaitTime": - this.nBigNoteWaitTimems = - CConversion.ParseIntInRange(value, 1, 100, this.nBigNoteWaitTimems); - break; - case "BigNotesJudge": - this.bJudgeBigNotes = CConversion.bONorOFF(value[0]); - break; - case "ForceNormalGauge": - this.bForceNormalGauge = CConversion.bONorOFF(value[0]); - break; - case "BranchAnime": - this.nBranchAnime = - CConversion.ParseIntInRange(value, 0, 1, this.nBranchAnime); - break; - case "NoInfo": - this.bNoInfo = CConversion.bONorOFF(value[0]); - break; - case "DefaultSongSort": - this.nDefaultSongSort = - CConversion.ParseIntInRange(value, 0, 2, this.nDefaultSongSort); - break; - case "RecentlyPlayedMax": - this.nRecentlyPlayedMax = - CConversion.ParseIntInRange(value, 0, 9999, this.nRecentlyPlayedMax); - break; - case "GameMode": - this.eGameMode = - (EGame)CConversion.ParseIntInRange(value, 0, 2, (int)this.eGameMode); - break; - case "TokkunSkipMeasures": - this.TokkunSkipMeasures = - CConversion.ParseIntInRange(value, 0, 9999, this.TokkunSkipMeasures); - break; - case nameof(this.TokkunMashInterval): - this.TokkunMashInterval = - CConversion.ParseIntInRange(value, 0, 9999, this.TokkunMashInterval); - break; - case "JudgeCountDisplay": - this.bJudgeCountDisplay = CConversion.bONorOFF(value[0]); - break; - case "ShowExExtraAnime": - this.ShowExExtraAnime = CConversion.bONorOFF(value[0]); - break; - case "PlayerCount": - this.nPlayerCount = - CConversion.ParseIntInRange(value, 1, 5, this.nPlayerCount); - break; - case nameof(this.ShinuchiMode): - this.ShinuchiMode = CConversion.bONorOFF(value[0]); - break; - } - } - - private void ProcessViewerOptionSection(string key, string value) { - switch (key) { - case "ViewerVSyncWait": - this.bViewerVSyncWait = CConversion.bONorOFF(value[0]); - break; - case "ViewerShowDebugStatus": - this.bViewerShowDebugStatus = CConversion.bONorOFF(value[0]); - break; - case "ViewerTimeStretch": - this.bViewerTimeStretch = CConversion.bONorOFF(value[0]); - break; - case "ViewerGuitar": - this.bViewerGuitar有効 = CConversion.bONorOFF(value[0]); - break; - case "ViewerDrums": - this.bViewerDrums有効 = CConversion.bONorOFF(value[0]); - break; - } - } - - private void ProcessGuidSection(string key, string value) { - switch (key) { - case "JoystickID": - this.GetJoystickID(value); - break; - case "GamepadID": - this.GetGamepadID(value); - break; - } - } - - private void ProcessDrumKeyAssignmentSection(string key, string value) { - switch (key) { - case "LeftRed": - this.ReadAndSetKey(value, this.KeyAssign.Drums.LeftRed); - break; - case "RightRed": - this.ReadAndSetKey(value, this.KeyAssign.Drums.RightRed); - break; - case "LeftBlue": - this.ReadAndSetKey(value, this.KeyAssign.Drums.LeftBlue); - break; - case "RightBlue": - this.ReadAndSetKey(value, this.KeyAssign.Drums.RightBlue); - break; - case "LeftRed2P": - this.ReadAndSetKey(value, this.KeyAssign.Drums.LeftRed2P); - break; - case "RightRed2P": - this.ReadAndSetKey(value, this.KeyAssign.Drums.RightRed2P); - break; - case "LeftBlue2P": - this.ReadAndSetKey(value, this.KeyAssign.Drums.LeftBlue2P); - break; - case "RightBlue2P": - this.ReadAndSetKey(value, this.KeyAssign.Drums.RightBlue2P); - break; - case "LeftRed3P": - this.ReadAndSetKey(value, this.KeyAssign.Drums.LeftRed3P); - break; - case "RightRed3P": - this.ReadAndSetKey(value, this.KeyAssign.Drums.RightRed3P); - break; - case "LeftBlue3P": - this.ReadAndSetKey(value, this.KeyAssign.Drums.LeftBlue3P); - break; - case "RightBlue3P": - this.ReadAndSetKey(value, this.KeyAssign.Drums.RightBlue3P); - break; - case "LeftRed4P": - this.ReadAndSetKey(value, this.KeyAssign.Drums.LeftRed4P); - break; - case "RightRed4P": - this.ReadAndSetKey(value, this.KeyAssign.Drums.RightRed4P); - break; - case "LeftBlue4P": - this.ReadAndSetKey(value, this.KeyAssign.Drums.LeftBlue4P); - break; - case "RightBlue4P": - this.ReadAndSetKey(value, this.KeyAssign.Drums.RightBlue4P); - break; - case "LeftRed5P": - this.ReadAndSetKey(value, this.KeyAssign.Drums.LeftRed5P); - break; - case "RightRed5P": - this.ReadAndSetKey(value, this.KeyAssign.Drums.RightRed5P); - break; - case "LeftBlue5P": - this.ReadAndSetKey(value, this.KeyAssign.Drums.LeftBlue5P); - break; - case "RightBlue5P": - this.ReadAndSetKey(value, this.KeyAssign.Drums.RightBlue5P); - break; - case "Clap": - this.ReadAndSetKey(value, this.KeyAssign.Drums.Clap); - break; - case "Clap2P": - this.ReadAndSetKey(value, this.KeyAssign.Drums.Clap2P); - break; - case "Clap3P": - this.ReadAndSetKey(value, this.KeyAssign.Drums.Clap3P); - break; - case "Clap4P": - this.ReadAndSetKey(value, this.KeyAssign.Drums.Clap4P); - break; - case "Clap5P": - this.ReadAndSetKey(value, this.KeyAssign.Drums.Clap5P); - break; - case "Decide": - this.ReadAndSetKey(value, this.KeyAssign.Drums.Decide); - break; - case "Cancel": - this.ReadAndSetKey(value, this.KeyAssign.Drums.Cancel); - break; - case "LeftChange": - this.ReadAndSetKey(value, this.KeyAssign.Drums.LeftChange); - break; - case "RightChange": - this.ReadAndSetKey(value, this.KeyAssign.Drums.RightChange); - break; - } - } - - private void ProcessSystemKeyAssignmentSection(string key, string value) { - switch (key) { - case "Capture": { - this.ReadAndSetKey(value, this.KeyAssign.System.Capture); - break; - } - case "SongVolumeIncrease": { - this.ReadAndSetKey(value, this.KeyAssign.System.SongVolIncrease); - break; - } - case "SongVolumeDecrease": { - this.ReadAndSetKey(value, this.KeyAssign.System.SongVolDecrease); - break; - } - case "DisplayHits": { - this.ReadAndSetKey(value, this.KeyAssign.System.DisplayHits); - break; - } - case "DisplayDebug": { - this.ReadAndSetKey(value, this.KeyAssign.System.DisplayDebug); - break; - } - case "QuickConfig": { - this.ReadAndSetKey(value, this.KeyAssign.System.QuickConfig); - break; - } - case "NewHeya": { - this.ReadAndSetKey(value, this.KeyAssign.System.NewHeya); - break; - } - case "SortSongs": { - this.ReadAndSetKey(value, this.KeyAssign.System.SortSongs); - break; - } - case "ToggleAutoP1": { - this.ReadAndSetKey(value, this.KeyAssign.System.ToggleAutoP1); - break; - } - case "ToggleAutoP2": { - this.ReadAndSetKey(value, this.KeyAssign.System.ToggleAutoP2); - break; - } - case "ToggleTrainingMode": { - this.ReadAndSetKey(value, this.KeyAssign.System.ToggleTrainingMode); - break; - } - case "CycleVideoDisplayMode": { - this.ReadAndSetKey(value, this.KeyAssign.System.CycleVideoDisplayMode); - break; - } - } - } - - private void ProcessTrainingKeyAssignmentSection(string key, string value) { - switch (key) { - case "TrainingIncreaseScrollSpeed": { - this.ReadAndSetKey(value, this.KeyAssign.Drums.TrainingIncreaseScrollSpeed); - break; - } - case "TrainingDecreaseScrollSpeed": { - this.ReadAndSetKey(value, this.KeyAssign.Drums.TrainingDecreaseScrollSpeed); - break; - } - case "TrainingIncreaseSongSpeed": { - this.ReadAndSetKey(value, this.KeyAssign.Drums.TrainingIncreaseSongSpeed); - break; - } - case "TrainingDecreaseSongSpeed": { - this.ReadAndSetKey(value, this.KeyAssign.Drums.TrainingDecreaseSongSpeed); - break; - } - case "TrainingToggleAuto": { - this.ReadAndSetKey(value, this.KeyAssign.Drums.TrainingToggleAuto); - break; - } - case "TrainingBranchNormal": { - this.ReadAndSetKey(value, this.KeyAssign.Drums.TrainingBranchNormal); - break; - } - case "TrainingBranchExpert": { - this.ReadAndSetKey(value, this.KeyAssign.Drums.TrainingBranchExpert); - break; - } - case "TrainingBranchMaster": { - this.ReadAndSetKey(value, this.KeyAssign.Drums.TrainingBranchMaster); - break; - } - case "TrainingPause": { - this.ReadAndSetKey(value, this.KeyAssign.Drums.TrainingPause); - break; - } - case "TrainingBookmark": { - this.ReadAndSetKey(value, this.KeyAssign.Drums.TrainingBookmark); - break; - } - case "TrainingMoveForwardMeasure": { - this.ReadAndSetKey(value, this.KeyAssign.Drums.TrainingMoveForwardMeasure); - break; - } - case "TrainingMoveBackMeasure": { - this.ReadAndSetKey(value, this.KeyAssign.Drums.TrainingMoveBackMeasure); - break; - } - case "TrainingSkipForwardMeasure": { - this.ReadAndSetKey(value, this.KeyAssign.Drums.TrainingSkipForwardMeasure); - break; - } - case "TrainingSkipBackMeasure": { - this.ReadAndSetKey(value, this.KeyAssign.Drums.TrainingSkipBackMeasure); - break; - } - case "TrainingJumpToFirstMeasure": { - this.ReadAndSetKey(value, this.KeyAssign.Drums.TrainingJumpToFirstMeasure); - break; - } - case "TrainingJumpToLastMeasure": { - this.ReadAndSetKey(value, this.KeyAssign.Drums.TrainingJumpToLastMeasure); - break; - } - } - } - - private void ProcessDebugSection(string key, string value) { - switch (key) { - case "ImGui": - this.DEBUG_bShowImgui = CConversion.bONorOFF(value[0]); - break; - } - } - - #region [ private ] - - //----------------- - private enum ESectionType { - Unknown, - System, - Log, - PlayOption, - ViewerOption, - AutoPlay, - HitRange, - GUID, - DrumsKeyAssign, - SystemKeyAssign, - TrainingKeyAssign, - DEBUG, - Temp, - } - - private Dictionary> sectionProcess = new Dictionary>(); - - private bool _bDrumsEnabled; - private bool _bGuitarEnabled; - private bool bConfigIniFileExists; - private string ConfigIniFileName; - - private void GetJoystickID(string keyDescription) { - string[] strArray = keyDescription.Split(new char[] { ',' }); - if (strArray.Length < 2 || !int.TryParse(strArray[0], out int result) || result < 0 || result > 9) { - return; + private void LoadFromString(string strAllSettings) { + ESectionType currentSectionType = ESectionType.Unknown; + string[] delimiter = { "\n" }; + string[] strSingleLine = strAllSettings.Split(delimiter, StringSplitOptions.RemoveEmptyEntries); + foreach (string s in strSingleLine) { + string line = s.Replace('\t', ' ') + .TrimStart(new char[] { '\t', ' ' }); + if ((line.Length == 0) || (line[0] == ';')) { + continue; } - this.dicJoystick.Remove(result); - this.dicJoystick.Add(result, strArray[1]); - } - - private void GetGamepadID(string keyDescription) { - string[] strArray = keyDescription.Split(new char[] { ',' }); - if (strArray.Length < 2 || !int.TryParse(strArray[0], out int result) || result < 0 || result > 9) { - return; - } - - this.dicGamepad.Remove(result); - this.dicGamepad.Add(result, strArray[1]); - } - - private void ClearAllKeyAssignments() { - this.KeyAssign = new CKeyAssign(); - for (int i = 0; i <= (int)EKeyConfigPart.System; i++) { - for (int j = 0; j < (int)EKeyConfigPad.Max; j++) { - this.KeyAssign[i][j] = new CKeyAssign.STKEYASSIGN[16]; - for (int k = 0; k < 16; k++) { - this.KeyAssign[i][j][k] = new CKeyAssign.STKEYASSIGN(EInputDevice.Unknown, 0, 0); + try { + if (line[0] == '[') { + StringBuilder builder = new StringBuilder(0x20); + int num = 1; + while ((num < line.Length) && (line[num] != ']')) { + builder.Append(line[num++]); } - } - } - } - private void WriteKeyAssignment(StreamWriter sw, CKeyAssign.STKEYASSIGN[] assign) { - bool flag = true; - for (int i = 0; i < 0x10; i++) { - if (assign[i].InputDevice == EInputDevice.Unknown) { - continue; - } - - if (!flag) { - sw.Write(','); - } - - flag = false; - switch (assign[i].InputDevice) { - case EInputDevice.Keyboard: - sw.Write('K'); - break; - - case EInputDevice.MIDIInput: - sw.Write('M'); - break; - - case EInputDevice.Joypad: - sw.Write('J'); - break; - - case EInputDevice.Gamepad: - sw.Write('G'); - break; - - case EInputDevice.Mouse: - sw.Write('N'); - break; - } - - sw.Write("{0}{1}", "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".Substring(assign[i].ID, 1), - assign[i].Code); // #24166 2011.1.15 yyagi: to support ID > 10, change 2nd character from Decimal to 36-numeral system. (e.g. J1023 -> JA23) - } - } - - private void ReadAndSetKey(string keyDescription, CKeyAssign.STKEYASSIGN[] assign) { - string[] strArray = keyDescription.Split(new char[] { ',' }); - for (int i = 0; (i < strArray.Length) && (i < 0x10); i++) { - EInputDevice eInputDevice; - int id; - int code; - string str = strArray[i].Trim().ToUpper(); - if (str.Length >= 3) { - eInputDevice = EInputDevice.Unknown; - switch (str[0]) { - case 'J': - eInputDevice = EInputDevice.Joypad; - break; - - case 'G': - eInputDevice = EInputDevice.Gamepad; - break; - - case 'K': - eInputDevice = EInputDevice.Keyboard; - break; - - case 'L': - continue; - - case 'M': - eInputDevice = EInputDevice.MIDIInput; - break; - - case 'N': - eInputDevice = EInputDevice.Mouse; - break; - } + string sectionName = builder.ToString(); + currentSectionType = sectionName switch { + "System" => ESectionType.System, + "AutoPlay" => ESectionType.AutoPlay, + "HitRange" => ESectionType.HitRange, + "Log" => ESectionType.Log, + "PlayOption" => ESectionType.PlayOption, + "ViewerOption" => ESectionType.ViewerOption, + "GUID" => ESectionType.GUID, + "DrumsKeyAssign" => ESectionType.DrumsKeyAssign, + "SystemKeyAssign" => ESectionType.SystemKeyAssign, + "TrainingKeyAssign" => ESectionType.TrainingKeyAssign, + "DEBUG" => ESectionType.DEBUG, + "Temp" => ESectionType.Temp, + _ => ESectionType.Unknown + }; } else { - continue; + string[] keyValuePair = line.Split(new char[] { '=' }); + if (keyValuePair.Length == 2) { + string key = keyValuePair[0].Trim(); + string value = keyValuePair[1].Trim(); + if (this.sectionProcess.TryGetValue(currentSectionType, out var processSection)) { + processSection(key, value); + } + } } + } catch (Exception exception) { + Trace.TraceError(exception.ToString()); + Trace.TraceError("例外が発生しましたが処理を継続します。 (93c4c5cd-4996-4e8c-a82f-a179ff590b44)"); + } + } + } - id = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".IndexOf(str[1]); - if (((id >= 0) && int.TryParse(str.Substring(2), out code)) && ((code >= 0) && (code <= 0xff))) { - assign[i].InputDevice = eInputDevice; - assign[i].ID = id; - assign[i].Code = code; + private void ProcessSystemSection(string key, string value) { + switch (key) { + case "TJAPath": + this.strSongsPath = value; + break; + case "Lang": + this.sLang = value; + CLangManager.langAttach(value); + break; + case "LayoutType": + this.nLayoutType = int.Parse(value); + break; + case "SaveFileName": { + var _s = value.Split(new char[] { ',' }); + + // Ignore custom save file names if duplicates + if (!_s.GroupBy(x => x).Any(g => g.Count() > 1)) { + for (int i = 0; i < Math.Min(5, _s.Length); i++) { + this.sSaveFile[i] = _s[i]; + } + } + + break; + } + case "IgnoreSongUnlockables": + this.bIgnoreSongUnlockables = CConversion.bONorOFF(value[0]); + break; + case "SkinPath": { + string absSkinPath = value; + if (!System.IO.Path.IsPathRooted(value)) { + absSkinPath = System.IO.Path.Combine(OpenTaiko.strEXEのあるフォルダ, "System"); + absSkinPath = System.IO.Path.Combine(absSkinPath, value); + Uri u = new Uri(absSkinPath); + absSkinPath = u.AbsolutePath.ToString(); // str4内に相対パスがある場合に備える + absSkinPath = System.Web.HttpUtility.UrlDecode(absSkinPath); // デコードする + absSkinPath = + absSkinPath.Replace('/', System.IO.Path.DirectorySeparatorChar); // 区切り文字が\ではなく/なので置換する + } + + if (absSkinPath[absSkinPath.Length - 1] != + System.IO.Path.DirectorySeparatorChar) // フォルダ名末尾に\を必ずつけて、CSkin側と表記を統一する + { + absSkinPath += System.IO.Path.DirectorySeparatorChar; + } + + this.strSystemSkinSubfolderFullName = absSkinPath; + break; + } + case nameof(this.PreAssetsLoading): + this.PreAssetsLoading = CConversion.bONorOFF(value[0]); + break; + case nameof(this.FastRender): + this.FastRender = CConversion.bONorOFF(value[0]); + break; + case nameof(this.ASyncTextureLoad): + this.ASyncTextureLoad = CConversion.bONorOFF(value[0]); + break; + case nameof(this.SimpleMode): + this.SimpleMode = CConversion.bONorOFF(value[0]); + break; + case "GraphicsDeviceType": + this.nGraphicsDeviceType = CConversion.ParseIntInRange(value, 0, 4, this.nGraphicsDeviceType); + break; + case "FullScreen": + this.bFullScreen = CConversion.bONorOFF(value[0]); + break; + case "WindowX": + this.nWindowBaseXPosition = CConversion.ParseIntInRange( + value, 0, 9999, this.nWindowBaseXPosition); + break; + case "WindowY": + this.nWindowBaseYPosition = CConversion.ParseIntInRange( + value, 0, 9999, this.nWindowBaseYPosition); + break; + case "WindowWidth": { + this.nWindowWidth = CConversion.ParseIntInRange(value, 1, 65535, this.nWindowWidth); + if (this.nWindowWidth <= 0) { + this.nWindowWidth = SampleFramework.GameWindowSize.Width; + } + + break; + } + case "WindowHeight": { + this.nWindowHeight = CConversion.ParseIntInRange(value, 1, 65535, this.nWindowHeight); + if (this.nWindowHeight <= 0) { + this.nWindowHeight = SampleFramework.GameWindowSize.Height; + } + + break; + } + case "DoubleClickFullScreen": + this.bIsAllowedDoubleClickFullscreen = CConversion.bONorOFF(value[0]); + break; + case "EnableSystemMenu": + this.bIsEnabledSystemMenu = CConversion.bONorOFF(value[0]); + break; + case "BackSleep": + this.nMsSleepUnfocused = CConversion.ParseIntInRangeAndClamp(value, 0, 50, this.nMsSleepUnfocused); + break; + case "SoundDeviceType": + this.nSoundDeviceType = CConversion.ParseIntInRange(value, 0, 4, this.nSoundDeviceType); + break; + case "BassBufferSizeMs": + this.nBassBufferSizeMs = CConversion.ParseIntInRange(value, 0, 9999, this.nBassBufferSizeMs); + break; + case "WASAPIBufferSizeMs": + this.nWASAPIBufferSizeMs = CConversion.ParseIntInRange(value, 0, 9999, this.nWASAPIBufferSizeMs); + break; + case "ASIODevice": { + string[] asiodev = CEnumerateAllAsioDevices.GetAllASIODevices(); + this.nASIODevice = CConversion.ParseIntInRange(value, 0, asiodev.Length - 1, this.nASIODevice); + break; + } + case "SoundTimerType": + this.bUseOSTimer = CConversion.bONorOFF(value[0]); + break; + case "FontName": + this.FontName = value; + break; + case "BoxFontName": + this.BoxFontName = value; + break; + case "VSyncWait": + this.bEnableVSync = CConversion.bONorOFF(value[0]); + break; + case "SleepTimePerFrame": + this.nMsSleepPerFrame = CConversion.ParseIntInRangeAndClamp(value, -1, 50, this.nMsSleepPerFrame); + break; + case "BGAlpha": + this.nBackgroundTransparency = + CConversion.ParseIntInRange(value, 0, 0xff, this.nBackgroundTransparency); + break; + case "AVI": + this.bEnableAVI = CConversion.bONorOFF(value[0]); + break; + case "BGA": + this.bEnableBGA = CConversion.bONorOFF(value[0]); + break; + case "ClipDispType": + this.eClipDispType = + (EClipDispType)CConversion.ParseIntInRange(value, 0, 3, (int)this.eClipDispType); + break; + case "PreviewSoundWait": + this.nMsWaitPreviewSoundFromSongSelected = CConversion.ParseIntInRange(value, 0, 0x5f5e0ff, + this.nMsWaitPreviewSoundFromSongSelected); + break; + case "PreviewImageWait": + this.nMsWaitPreviewImageFromSongSelected = CConversion.ParseIntInRange(value, 0, 0x5f5e0ff, + this.nMsWaitPreviewImageFromSongSelected); + break; + case "BGMSound": + this.bBGMPlayVoiceSound = CConversion.bONorOFF(value[0]); + break; + case "DanTowerHide": + this.bDanTowerHide = CConversion.bONorOFF(value[0]); + break; + case "RandomFromSubBox": + this.bIncludeSubfoldersOnRandomSelect = CConversion.bONorOFF(value[0]); + break; + case "MinComboDrums": + this.nMinDisplayedCombo.Drums = + CConversion.ParseIntInRange(value, 1, 0x1869f, this.nMinDisplayedCombo.Drums); + break; + case "ShowDebugStatus": + this.bDisplayDebugInfo = CConversion.bONorOFF(value[0]); + break; + case nameof(this.ApplyLoudnessMetadata): + this.ApplyLoudnessMetadata = CConversion.bONorOFF(value[0]); + break; + case nameof(this.TargetLoudness): + this.TargetLoudness = CConversion.ParseDoubleInRange(value, CSound.MinimumLufs.ToDouble(), + CSound.MaximumLufs.ToDouble(), this.TargetLoudness); + break; + case nameof(this.ApplySongVol): + this.ApplySongVol = CConversion.bONorOFF(value[0]); + break; + case nameof(this.SoundEffectLevel): + this.SoundEffectLevel = CConversion.ParseIntInRange(value, CSound.MinimumGroupLevel, + CSound.MaximumGroupLevel, this.SoundEffectLevel); + break; + case nameof(this.VoiceLevel): + this.VoiceLevel = CConversion.ParseIntInRange(value, CSound.MinimumGroupLevel, + CSound.MaximumGroupLevel, this.VoiceLevel); + break; + case nameof(this.SongPreviewLevel): + this.SongPreviewLevel = CConversion.ParseIntInRange(value, CSound.MinimumGroupLevel, + CSound.MaximumGroupLevel, this.SongPreviewLevel); + break; + case nameof(this.SongPlaybackLevel): + this.SongPlaybackLevel = CConversion.ParseIntInRange(value, CSound.MinimumGroupLevel, + CSound.MaximumGroupLevel, this.SongPlaybackLevel); + break; + case nameof(this.KeyboardSoundLevelIncrement): + this.KeyboardSoundLevelIncrement = CConversion.ParseIntInRange(value, + MinimumKeyboardSoundLevelIncrement, MaximumKeyboardSoundLevelIncrement, + this.KeyboardSoundLevelIncrement); + break; + case nameof(this.MusicPreTimeMs): + this.MusicPreTimeMs = int.Parse(value); + break; + case "AutoResultCapture": + this.bIsAutoResultCapture = CConversion.bONorOFF(value[0]); + break; + case nameof(this.SendDiscordPlayingInformation): + this.SendDiscordPlayingInformation = CConversion.bONorOFF(value[0]); + break; + case "TimeStretch": + this.bTimeStretch = CConversion.bONorOFF(value[0]); + break; + case "GlobalOffset": + this.nGlobalOffsetMs = CConversion.ParseIntInRange(value, -9999, 9999, this.nGlobalOffsetMs); + break; + case "BufferedInput": + this.bBufferedInputs = CConversion.bONorOFF(value[0]); + break; + case "PolyphonicSounds": + this.nPoliphonicSounds = CConversion.ParseIntInRange(value, 1, 8, this.nPoliphonicSounds); + break; + case "LCVelocityMin": + this.nVelocityMin.LC = CConversion.ParseIntInRange(value, 0, 127, this.nVelocityMin.LC); + break; + case "HHVelocityMin": + this.nVelocityMin.HH = CConversion.ParseIntInRange(value, 0, 127, this.nVelocityMin.HH); + break; + case "SDVelocityMin": + this.nVelocityMin.SD = CConversion.ParseIntInRange(value, 0, 127, this.nVelocityMin.SD); + break; + case "BDVelocityMin": + this.nVelocityMin.BD = CConversion.ParseIntInRange(value, 0, 127, this.nVelocityMin.BD); + break; + case "HTVelocityMin": + this.nVelocityMin.HT = CConversion.ParseIntInRange(value, 0, 127, this.nVelocityMin.HT); + break; + case "LTVelocityMin": + this.nVelocityMin.LT = CConversion.ParseIntInRange(value, 0, 127, this.nVelocityMin.LT); + break; + case "FTVelocityMin": + this.nVelocityMin.FT = CConversion.ParseIntInRange(value, 0, 127, this.nVelocityMin.FT); + break; + case "CYVelocityMin": + this.nVelocityMin.CY = CConversion.ParseIntInRange(value, 0, 127, this.nVelocityMin.CY); + break; + case "RDVelocityMin": + this.nVelocityMin.RD = CConversion.ParseIntInRange(value, 0, 127, this.nVelocityMin.RD); + break; + case "DirectShowMode": + this.bDirectShowMode = CConversion.bONorOFF(value[0]); + ; + break; + case nameof(this.TJAP3FolderMode): + this.TJAP3FolderMode = CConversion.bONorOFF(value[0]); + break; + case "EndingAnime": + this.bEndingAnime = CConversion.bONorOFF(value[0]); + break; + } + } + + private void ProcessAutoPlaySection(string key, string value) { + switch (key) { + case "Taiko": + this.bAutoPlay[0] = CConversion.bONorOFF(value[0]); + break; + case "Taiko2P": + this.bAutoPlay[1] = CConversion.bONorOFF(value[0]); + break; + case "Taiko3P": + this.bAutoPlay[2] = CConversion.bONorOFF(value[0]); + break; + case "Taiko4P": + this.bAutoPlay[3] = CConversion.bONorOFF(value[0]); + break; + case "Taiko5P": + this.bAutoPlay[4] = CConversion.bONorOFF(value[0]); + break; + case "TaikoAutoRoll": + this.bAuto先生の連打 = CConversion.bONorOFF(value[0]); + break; + case "RollsPerSec": + this.nRollsPerSec = int.Parse(value); + break; + case "DefaultAILevel": + this.nDefaultAILevel = int.Parse(value); + this.nAILevel = this.nDefaultAILevel; + break; + } + } + + private void ProcessHitRangeSection(string key, string value) { + switch (key) { + case "Perfect": + this.nHitRangeMs.Perfect = + CConversion.ParseIntInRange(value, 0, 0x3e7, this.nHitRangeMs.Perfect); + break; + case "Great": + this.nHitRangeMs.Great = + CConversion.ParseIntInRange(value, 0, 0x3e7, this.nHitRangeMs.Great); + break; + case "Good": + this.nHitRangeMs.Good = + CConversion.ParseIntInRange(value, 0, 0x3e7, this.nHitRangeMs.Good); + break; + case "Poor": + this.nHitRangeMs.Poor = + CConversion.ParseIntInRange(value, 0, 0x3e7, this.nHitRangeMs.Poor); + break; + } + } + + private void ProcessLogSection(string key, string value) { + switch (key) { + case "OutputLog": + this.bOutputLogs = CConversion.bONorOFF(value[0]); + break; + case "TraceCreatedDisposed": + this.bOutputCreationReleaseLog = CConversion.bONorOFF(value[0]); + break; + case "TraceDTXDetails": + this.bOutputDetailedDTXLog = CConversion.bONorOFF(value[0]); + break; + case "TraceSongSearch": + this.bOutputSongSearchLog = CConversion.bONorOFF(value[0]); + break; + } + } + + private void ProcessPlayOptionSection(string key, string value) { + switch (key) { + case "ShowChara": + this.ShowChara = CConversion.bONorOFF(value[0]); + break; + case "ShowDancer": + this.ShowDancer = CConversion.bONorOFF(value[0]); + break; + case "ShowRunner": + this.ShowRunner = CConversion.bONorOFF(value[0]); + break; + case "ShowMob": + this.ShowMob = CConversion.bONorOFF(value[0]); + break; + case "ShowFooter": + this.ShowFooter = CConversion.bONorOFF(value[0]); + break; + case "ShowPuchiChara": + this.ShowPuchiChara = CConversion.bONorOFF(value[0]); + break; + case "EnableCountDownTimer": + this.bEnableCountdownTimer = CConversion.bONorOFF(value[0]); + break; + case "DrumsInvisible": + this.eInvisible.Drums = + (EInvisible)CConversion.ParseIntInRange(value, 0, 2, (int)this.eInvisible.Drums); + break; + case "DrumsReverse": + this.bReverse.Drums = CConversion.bONorOFF(value[0]); + break; + case "DrumsPosition": + this.JudgeTextDisplayPosition.Drums = + (EJudgeTextDisplayPosition)CConversion.ParseIntInRange(value, 0, 2, + (int)this.JudgeTextDisplayPosition.Drums); + break; + case "DrumsScrollSpeed": + case "DrumsScrollSpeed1P": + this.nScrollSpeed[0] = + CConversion.ParseIntInRange(value, 0, 0x7cf, this.nScrollSpeed[0]); + break; + case "DrumsScrollSpeed2P": + this.nScrollSpeed[1] = + CConversion.ParseIntInRange(value, 0, 0x7cf, this.nScrollSpeed[1]); + break; + case "DrumsScrollSpeed3P": + this.nScrollSpeed[2] = + CConversion.ParseIntInRange(value, 0, 0x7cf, this.nScrollSpeed[2]); + break; + case "DrumsScrollSpeed4P": + this.nScrollSpeed[3] = + CConversion.ParseIntInRange(value, 0, 0x7cf, this.nScrollSpeed[3]); + break; + case "DrumsScrollSpeed5P": + this.nScrollSpeed[4] = + CConversion.ParseIntInRange(value, 0, 0x7cf, this.nScrollSpeed[4]); + break; + case "TimingZones1P": + this.nTimingZones[0] = + CConversion.ParseIntInRange(value, 0, 4, this.nTimingZones[0]); + break; + case "TimingZones2P": + this.nTimingZones[1] = + CConversion.ParseIntInRange(value, 0, 4, this.nTimingZones[1]); + break; + case "TimingZones3P": + this.nTimingZones[2] = + CConversion.ParseIntInRange(value, 0, 4, this.nTimingZones[2]); + break; + case "TimingZones4P": + this.nTimingZones[3] = + CConversion.ParseIntInRange(value, 0, 4, this.nTimingZones[3]); + break; + case "TimingZones5P": + this.nTimingZones[4] = + CConversion.ParseIntInRange(value, 0, 4, this.nTimingZones[4]); + break; + case "Just": + case "Just1P": + this.bJust[0] = CConversion.ParseIntInRange(value, 0, 2, this.bJust[0]); + break; + case "Just2P": + this.bJust[1] = CConversion.ParseIntInRange(value, 0, 2, this.bJust[1]); + break; + case "Just3P": + this.bJust[2] = CConversion.ParseIntInRange(value, 0, 2, this.bJust[2]); + break; + case "Just4P": + this.bJust[3] = CConversion.ParseIntInRange(value, 0, 2, this.bJust[3]); + break; + case "Just5P": + this.bJust[4] = CConversion.ParseIntInRange(value, 0, 2, this.bJust[4]); + break; + case "HitSounds1P": + this.nHitSounds[0] = + CConversion.ParseIntInRange(value, 0, 9999999, this.nHitSounds[0]); + break; + case "HitSounds2P": + this.nHitSounds[1] = + CConversion.ParseIntInRange(value, 0, 9999999, this.nHitSounds[1]); + break; + case "HitSounds3P": + this.nHitSounds[2] = + CConversion.ParseIntInRange(value, 0, 9999999, this.nHitSounds[2]); + break; + case "HitSounds4P": + this.nHitSounds[3] = + CConversion.ParseIntInRange(value, 0, 9999999, this.nHitSounds[3]); + break; + case "HitSounds5P": + this.nHitSounds[4] = + CConversion.ParseIntInRange(value, 0, 9999999, this.nHitSounds[4]); + break; + case "Gametype1P": + this.nGameType[0] = + (EGameType)CConversion.ParseIntInRange(value, 0, 1, (int)this.nGameType[0]); + break; + case "Gametype2P": + this.nGameType[1] = + (EGameType)CConversion.ParseIntInRange(value, 0, 1, (int)this.nGameType[1]); + break; + case "Gametype3P": + this.nGameType[2] = + (EGameType)CConversion.ParseIntInRange(value, 0, 1, (int)this.nGameType[2]); + break; + case "Gametype4P": + this.nGameType[3] = + (EGameType)CConversion.ParseIntInRange(value, 0, 1, (int)this.nGameType[3]); + break; + case "Gametype5P": + this.nGameType[4] = + (EGameType)CConversion.ParseIntInRange(value, 0, 1, (int)this.nGameType[4]); + break; + case "FunMods1P": + this.nFunMods[0] = + (EFunMods)CConversion.ParseIntInRange(value, 0, (int)EFunMods.Total - 1, (int)this.nFunMods[0]); + break; + case "FunMods2P": + this.nFunMods[1] = + (EFunMods)CConversion.ParseIntInRange(value, 0, (int)EFunMods.Total - 1, (int)this.nFunMods[1]); + break; + case "FunMods3P": + this.nFunMods[2] = + (EFunMods)CConversion.ParseIntInRange(value, 0, (int)EFunMods.Total - 1, (int)this.nFunMods[2]); + break; + case "FunMods4P": + this.nFunMods[3] = + (EFunMods)CConversion.ParseIntInRange(value, 0, (int)EFunMods.Total - 1, (int)this.nFunMods[3]); + break; + case "FunMods5P": + this.nFunMods[4] = + (EFunMods)CConversion.ParseIntInRange(value, 0, (int)EFunMods.Total - 1, (int)this.nFunMods[4]); + break; + case "TaikoStealth1P": + case "TaikoStealth": + this.eSTEALTH[0] = + (EStealthMode)CConversion.ParseIntInRange(value, 0, 3, (int)this.eSTEALTH[0]); + break; + case "TaikoStealth2P": + this.eSTEALTH[1] = + (EStealthMode)CConversion.ParseIntInRange(value, 0, 3, (int)this.eSTEALTH[1]); + break; + case "TaikoStealth3P": + this.eSTEALTH[2] = + (EStealthMode)CConversion.ParseIntInRange(value, 0, 3, (int)this.eSTEALTH[2]); + break; + case "TaikoStealth4P": + this.eSTEALTH[3] = + (EStealthMode)CConversion.ParseIntInRange(value, 0, 3, (int)this.eSTEALTH[3]); + break; + case "TaikoStealth5P": + this.eSTEALTH[4] = + (EStealthMode)CConversion.ParseIntInRange(value, 0, 3, (int)this.eSTEALTH[4]); + break; + case "TaikoRandom1P": + case "TaikoRandom": + this.eRandom[0] = + (ERandomMode)CConversion.ParseIntInRange(value, 0, 4, (int)this.eRandom[0]); + break; + case "TaikoRandom2P": + this.eRandom[1] = + (ERandomMode)CConversion.ParseIntInRange(value, 0, 4, (int)this.eRandom[1]); + break; + case "TaikoRandom3P": + this.eRandom[2] = + (ERandomMode)CConversion.ParseIntInRange(value, 0, 4, (int)this.eRandom[2]); + break; + case "TaikoRandom4P": + this.eRandom[3] = + (ERandomMode)CConversion.ParseIntInRange(value, 0, 4, (int)this.eRandom[3]); + break; + case "TaikoRandom5P": + this.eRandom[4] = + (ERandomMode)CConversion.ParseIntInRange(value, 0, 4, (int)this.eRandom[4]); + break; + case "PlaySpeed": + this.nSongSpeed = + CConversion.ParseIntInRange(value, 5, 400, this.nSongSpeed); + break; + case "PlaySpeedNotEqualOneNoSound": + this.bNoAudioIfNot1xSpeed = CConversion.bONorOFF(value[0]); + break; + case "Risky": + this.nRisky = CConversion.ParseIntInRange(value, 0, 10, this.nRisky); + break; + case "DrumsTight": + this.bTight = CConversion.bONorOFF(value[0]); + break; + case "BranchGuide": + this.bBranchGuide = CConversion.bONorOFF(value[0]); + break; + case "DefaultCourse": + this.nDefaultCourse = + CConversion.ParseIntInRange(value, 0, 5, this.nDefaultCourse); + break; + case "ScoreMode": + this.nScoreMode = CConversion.ParseIntInRange(value, 0, 3, this.nScoreMode); + break; + case "HispeedRandom": + this.bHispeedRandom = CConversion.bONorOFF(value[0]); + break; + case "BigNotesWaitTime": + this.nBigNoteWaitTimems = + CConversion.ParseIntInRange(value, 1, 100, this.nBigNoteWaitTimems); + break; + case "BigNotesJudge": + this.bJudgeBigNotes = CConversion.bONorOFF(value[0]); + break; + case "ForceNormalGauge": + this.bForceNormalGauge = CConversion.bONorOFF(value[0]); + break; + case "BranchAnime": + this.nBranchAnime = + CConversion.ParseIntInRange(value, 0, 1, this.nBranchAnime); + break; + case "NoInfo": + this.bNoInfo = CConversion.bONorOFF(value[0]); + break; + case "DefaultSongSort": + this.nDefaultSongSort = + CConversion.ParseIntInRange(value, 0, 2, this.nDefaultSongSort); + break; + case "RecentlyPlayedMax": + this.nRecentlyPlayedMax = + CConversion.ParseIntInRange(value, 0, 9999, this.nRecentlyPlayedMax); + break; + case "GameMode": + this.eGameMode = + (EGame)CConversion.ParseIntInRange(value, 0, 2, (int)this.eGameMode); + break; + case "TokkunSkipMeasures": + this.TokkunSkipMeasures = + CConversion.ParseIntInRange(value, 0, 9999, this.TokkunSkipMeasures); + break; + case nameof(this.TokkunMashInterval): + this.TokkunMashInterval = + CConversion.ParseIntInRange(value, 0, 9999, this.TokkunMashInterval); + break; + case "JudgeCountDisplay": + this.bJudgeCountDisplay = CConversion.bONorOFF(value[0]); + break; + case "ShowExExtraAnime": + this.ShowExExtraAnime = CConversion.bONorOFF(value[0]); + break; + case "PlayerCount": + this.nPlayerCount = + CConversion.ParseIntInRange(value, 1, 5, this.nPlayerCount); + break; + case nameof(this.ShinuchiMode): + this.ShinuchiMode = CConversion.bONorOFF(value[0]); + break; + } + } + + private void ProcessViewerOptionSection(string key, string value) { + switch (key) { + case "ViewerVSyncWait": + this.bViewerVSyncWait = CConversion.bONorOFF(value[0]); + break; + case "ViewerShowDebugStatus": + this.bViewerShowDebugStatus = CConversion.bONorOFF(value[0]); + break; + case "ViewerTimeStretch": + this.bViewerTimeStretch = CConversion.bONorOFF(value[0]); + break; + case "ViewerGuitar": + this.bViewerGuitar有効 = CConversion.bONorOFF(value[0]); + break; + case "ViewerDrums": + this.bViewerDrums有効 = CConversion.bONorOFF(value[0]); + break; + } + } + + private void ProcessGuidSection(string key, string value) { + switch (key) { + case "JoystickID": + this.GetJoystickID(value); + break; + case "GamepadID": + this.GetGamepadID(value); + break; + } + } + + private void ProcessDrumKeyAssignmentSection(string key, string value) { + switch (key) { + case "LeftRed": + this.ReadAndSetKey(value, this.KeyAssign.Drums.LeftRed); + break; + case "RightRed": + this.ReadAndSetKey(value, this.KeyAssign.Drums.RightRed); + break; + case "LeftBlue": + this.ReadAndSetKey(value, this.KeyAssign.Drums.LeftBlue); + break; + case "RightBlue": + this.ReadAndSetKey(value, this.KeyAssign.Drums.RightBlue); + break; + case "LeftRed2P": + this.ReadAndSetKey(value, this.KeyAssign.Drums.LeftRed2P); + break; + case "RightRed2P": + this.ReadAndSetKey(value, this.KeyAssign.Drums.RightRed2P); + break; + case "LeftBlue2P": + this.ReadAndSetKey(value, this.KeyAssign.Drums.LeftBlue2P); + break; + case "RightBlue2P": + this.ReadAndSetKey(value, this.KeyAssign.Drums.RightBlue2P); + break; + case "LeftRed3P": + this.ReadAndSetKey(value, this.KeyAssign.Drums.LeftRed3P); + break; + case "RightRed3P": + this.ReadAndSetKey(value, this.KeyAssign.Drums.RightRed3P); + break; + case "LeftBlue3P": + this.ReadAndSetKey(value, this.KeyAssign.Drums.LeftBlue3P); + break; + case "RightBlue3P": + this.ReadAndSetKey(value, this.KeyAssign.Drums.RightBlue3P); + break; + case "LeftRed4P": + this.ReadAndSetKey(value, this.KeyAssign.Drums.LeftRed4P); + break; + case "RightRed4P": + this.ReadAndSetKey(value, this.KeyAssign.Drums.RightRed4P); + break; + case "LeftBlue4P": + this.ReadAndSetKey(value, this.KeyAssign.Drums.LeftBlue4P); + break; + case "RightBlue4P": + this.ReadAndSetKey(value, this.KeyAssign.Drums.RightBlue4P); + break; + case "LeftRed5P": + this.ReadAndSetKey(value, this.KeyAssign.Drums.LeftRed5P); + break; + case "RightRed5P": + this.ReadAndSetKey(value, this.KeyAssign.Drums.RightRed5P); + break; + case "LeftBlue5P": + this.ReadAndSetKey(value, this.KeyAssign.Drums.LeftBlue5P); + break; + case "RightBlue5P": + this.ReadAndSetKey(value, this.KeyAssign.Drums.RightBlue5P); + break; + case "Clap": + this.ReadAndSetKey(value, this.KeyAssign.Drums.Clap); + break; + case "Clap2P": + this.ReadAndSetKey(value, this.KeyAssign.Drums.Clap2P); + break; + case "Clap3P": + this.ReadAndSetKey(value, this.KeyAssign.Drums.Clap3P); + break; + case "Clap4P": + this.ReadAndSetKey(value, this.KeyAssign.Drums.Clap4P); + break; + case "Clap5P": + this.ReadAndSetKey(value, this.KeyAssign.Drums.Clap5P); + break; + case "Decide": + this.ReadAndSetKey(value, this.KeyAssign.Drums.Decide); + break; + case "Cancel": + this.ReadAndSetKey(value, this.KeyAssign.Drums.Cancel); + break; + case "LeftChange": + this.ReadAndSetKey(value, this.KeyAssign.Drums.LeftChange); + break; + case "RightChange": + this.ReadAndSetKey(value, this.KeyAssign.Drums.RightChange); + break; + } + } + + private void ProcessSystemKeyAssignmentSection(string key, string value) { + switch (key) { + case "Capture": { + this.ReadAndSetKey(value, this.KeyAssign.System.Capture); + break; + } + case "SongVolumeIncrease": { + this.ReadAndSetKey(value, this.KeyAssign.System.SongVolIncrease); + break; + } + case "SongVolumeDecrease": { + this.ReadAndSetKey(value, this.KeyAssign.System.SongVolDecrease); + break; + } + case "DisplayHits": { + this.ReadAndSetKey(value, this.KeyAssign.System.DisplayHits); + break; + } + case "DisplayDebug": { + this.ReadAndSetKey(value, this.KeyAssign.System.DisplayDebug); + break; + } + case "QuickConfig": { + this.ReadAndSetKey(value, this.KeyAssign.System.QuickConfig); + break; + } + case "NewHeya": { + this.ReadAndSetKey(value, this.KeyAssign.System.NewHeya); + break; + } + case "SortSongs": { + this.ReadAndSetKey(value, this.KeyAssign.System.SortSongs); + break; + } + case "ToggleAutoP1": { + this.ReadAndSetKey(value, this.KeyAssign.System.ToggleAutoP1); + break; + } + case "ToggleAutoP2": { + this.ReadAndSetKey(value, this.KeyAssign.System.ToggleAutoP2); + break; + } + case "ToggleTrainingMode": { + this.ReadAndSetKey(value, this.KeyAssign.System.ToggleTrainingMode); + break; + } + case "CycleVideoDisplayMode": { + this.ReadAndSetKey(value, this.KeyAssign.System.CycleVideoDisplayMode); + break; + } + } + } + + private void ProcessTrainingKeyAssignmentSection(string key, string value) { + switch (key) { + case "TrainingIncreaseScrollSpeed": { + this.ReadAndSetKey(value, this.KeyAssign.Drums.TrainingIncreaseScrollSpeed); + break; + } + case "TrainingDecreaseScrollSpeed": { + this.ReadAndSetKey(value, this.KeyAssign.Drums.TrainingDecreaseScrollSpeed); + break; + } + case "TrainingIncreaseSongSpeed": { + this.ReadAndSetKey(value, this.KeyAssign.Drums.TrainingIncreaseSongSpeed); + break; + } + case "TrainingDecreaseSongSpeed": { + this.ReadAndSetKey(value, this.KeyAssign.Drums.TrainingDecreaseSongSpeed); + break; + } + case "TrainingToggleAuto": { + this.ReadAndSetKey(value, this.KeyAssign.Drums.TrainingToggleAuto); + break; + } + case "TrainingBranchNormal": { + this.ReadAndSetKey(value, this.KeyAssign.Drums.TrainingBranchNormal); + break; + } + case "TrainingBranchExpert": { + this.ReadAndSetKey(value, this.KeyAssign.Drums.TrainingBranchExpert); + break; + } + case "TrainingBranchMaster": { + this.ReadAndSetKey(value, this.KeyAssign.Drums.TrainingBranchMaster); + break; + } + case "TrainingPause": { + this.ReadAndSetKey(value, this.KeyAssign.Drums.TrainingPause); + break; + } + case "TrainingBookmark": { + this.ReadAndSetKey(value, this.KeyAssign.Drums.TrainingBookmark); + break; + } + case "TrainingMoveForwardMeasure": { + this.ReadAndSetKey(value, this.KeyAssign.Drums.TrainingMoveForwardMeasure); + break; + } + case "TrainingMoveBackMeasure": { + this.ReadAndSetKey(value, this.KeyAssign.Drums.TrainingMoveBackMeasure); + break; + } + case "TrainingSkipForwardMeasure": { + this.ReadAndSetKey(value, this.KeyAssign.Drums.TrainingSkipForwardMeasure); + break; + } + case "TrainingSkipBackMeasure": { + this.ReadAndSetKey(value, this.KeyAssign.Drums.TrainingSkipBackMeasure); + break; + } + case "TrainingJumpToFirstMeasure": { + this.ReadAndSetKey(value, this.KeyAssign.Drums.TrainingJumpToFirstMeasure); + break; + } + case "TrainingJumpToLastMeasure": { + this.ReadAndSetKey(value, this.KeyAssign.Drums.TrainingJumpToLastMeasure); + break; + } + } + } + + private void ProcessDebugSection(string key, string value) { + switch (key) { + case "ImGui": + this.DEBUG_bShowImgui = CConversion.bONorOFF(value[0]); + break; + } + } + + #region [ private ] + + //----------------- + private enum ESectionType { + Unknown, + System, + Log, + PlayOption, + ViewerOption, + AutoPlay, + HitRange, + GUID, + DrumsKeyAssign, + SystemKeyAssign, + TrainingKeyAssign, + DEBUG, + Temp, + } + + private Dictionary> sectionProcess = new Dictionary>(); + + private bool _bDrumsEnabled; + private bool _bGuitarEnabled; + private bool bConfigIniFileExists; + private string ConfigIniFileName; + + private void GetJoystickID(string keyDescription) { + string[] strArray = keyDescription.Split(new char[] { ',' }); + if (strArray.Length < 2 || !int.TryParse(strArray[0], out int result) || result < 0 || result > 9) { + return; + } + + this.dicJoystick.Remove(result); + this.dicJoystick.Add(result, strArray[1]); + } + + private void GetGamepadID(string keyDescription) { + string[] strArray = keyDescription.Split(new char[] { ',' }); + if (strArray.Length < 2 || !int.TryParse(strArray[0], out int result) || result < 0 || result > 9) { + return; + } + + this.dicGamepad.Remove(result); + this.dicGamepad.Add(result, strArray[1]); + } + + private void ClearAllKeyAssignments() { + this.KeyAssign = new CKeyAssign(); + for (int i = 0; i <= (int)EKeyConfigPart.System; i++) { + for (int j = 0; j < (int)EKeyConfigPad.Max; j++) { + this.KeyAssign[i][j] = new CKeyAssign.STKEYASSIGN[16]; + for (int k = 0; k < 16; k++) { + this.KeyAssign[i][j][k] = new CKeyAssign.STKEYASSIGN(EInputDevice.Unknown, 0, 0); } } } + } - private void SetDefaultKeyAssignments() { - this.ClearAllKeyAssignments(); + private void WriteKeyAssignment(StreamWriter sw, CKeyAssign.STKEYASSIGN[] assign) { + bool flag = true; + for (int i = 0; i < 0x10; i++) { + if (assign[i].InputDevice == EInputDevice.Unknown) { + continue; + } - string strDefaultKeyAssign = @" + if (!flag) { + sw.Write(','); + } + + flag = false; + switch (assign[i].InputDevice) { + case EInputDevice.Keyboard: + sw.Write('K'); + break; + + case EInputDevice.MIDIInput: + sw.Write('M'); + break; + + case EInputDevice.Joypad: + sw.Write('J'); + break; + + case EInputDevice.Gamepad: + sw.Write('G'); + break; + + case EInputDevice.Mouse: + sw.Write('N'); + break; + } + + sw.Write("{0}{1}", "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".Substring(assign[i].ID, 1), + assign[i].Code); // #24166 2011.1.15 yyagi: to support ID > 10, change 2nd character from Decimal to 36-numeral system. (e.g. J1023 -> JA23) + } + } + + private void ReadAndSetKey(string keyDescription, CKeyAssign.STKEYASSIGN[] assign) { + string[] strArray = keyDescription.Split(new char[] { ',' }); + for (int i = 0; (i < strArray.Length) && (i < 0x10); i++) { + EInputDevice eInputDevice; + int id; + int code; + string str = strArray[i].Trim().ToUpper(); + if (str.Length >= 3) { + eInputDevice = EInputDevice.Unknown; + switch (str[0]) { + case 'J': + eInputDevice = EInputDevice.Joypad; + break; + + case 'G': + eInputDevice = EInputDevice.Gamepad; + break; + + case 'K': + eInputDevice = EInputDevice.Keyboard; + break; + + case 'L': + continue; + + case 'M': + eInputDevice = EInputDevice.MIDIInput; + break; + + case 'N': + eInputDevice = EInputDevice.Mouse; + break; + } + } else { + continue; + } + + id = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".IndexOf(str[1]); + if (((id >= 0) && int.TryParse(str.Substring(2), out code)) && ((code >= 0) && (code <= 0xff))) { + assign[i].InputDevice = eInputDevice; + assign[i].ID = id; + assign[i].Code = code; + } + } + } + + private void SetDefaultKeyAssignments() { + this.ClearAllKeyAssignments(); + + string strDefaultKeyAssign = @" [DrumsKeyAssign] LeftRed=K015 RightRed=K019 @@ -3753,28 +3754,27 @@ TrainingSkipBackMeasure=K0108 TrainingJumpToFirstMeasure=K070 TrainingJumpToLastMeasure=K051 "; - LoadFromString(strDefaultKeyAssign); + LoadFromString(strDefaultKeyAssign); + } + + //----------------- + + #endregion + + + public event PropertyChangedEventHandler PropertyChanged; + + private bool SetProperty(ref T storage, T value, string propertyName = null) { + if (Equals(storage, value)) { + return false; } - //----------------- + storage = value; + OnPropertyChanged(propertyName); + return true; + } - #endregion - - - public event PropertyChangedEventHandler PropertyChanged; - - private bool SetProperty(ref T storage, T value, string propertyName = null) { - if (Equals(storage, value)) { - return false; - } - - storage = value; - OnPropertyChanged(propertyName); - return true; - } - - private void OnPropertyChanged(string propertyName) { - PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); - } + private void OnPropertyChanged(string propertyName) { + PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); } } diff --git a/OpenTaiko/src/Common/CConstants.cs b/OpenTaiko/src/Common/CConstants.cs index e4f15419..275be1bb 100644 --- a/OpenTaiko/src/Common/CConstants.cs +++ b/OpenTaiko/src/Common/CConstants.cs @@ -1,408 +1,407 @@ using System.Runtime.InteropServices; -namespace OpenTaiko { +namespace OpenTaiko; - public enum Difficulty { - Easy, - Normal, - Hard, - Oni, - Edit, - Tower, - Dan, - Total - } +public enum Difficulty { + Easy, + Normal, + Hard, + Oni, + Edit, + Tower, + Dan, + Total +} - public enum EScrollMode { - Normal, - BMScroll, - HBScroll - } +public enum EScrollMode { + Normal, + BMScroll, + HBScroll +} - public enum EGame { - Off = 0, - Survival = 1, - SurvivalHard = 2 - } +public enum EGame { + Off = 0, + Survival = 1, + SurvivalHard = 2 +} - public enum EDifficultyDisplayType { - Off = 0, - TextOnNthSong = 1, - ImageOnMTaiko = 2, - } +public enum EDifficultyDisplayType { + Off = 0, + TextOnNthSong = 1, + ImageOnMTaiko = 2, +} - public enum EPad // 演奏用のenum。ここを修正するときは、次に出てくる EKeyConfigPad と EパッドFlag もセットで修正すること。 - { - HH = 0, - R = 0, - SD = 1, - G = 1, - BD = 2, - B = 2, - HT = 3, - Pick = 3, - LT = 4, - Wail = 4, - FT = 5, - Cancel = 5, - CY = 6, - Decide = 6, - HHO = 7, - RD = 8, - LC = 9, - LP = 10, // #27029 2012.1.4 from - LBD = 11, +public enum EPad // 演奏用のenum。ここを修正するときは、次に出てくる EKeyConfigPad と EパッドFlag もセットで修正すること。 +{ + HH = 0, + R = 0, + SD = 1, + G = 1, + BD = 2, + B = 2, + HT = 3, + Pick = 3, + LT = 4, + Wail = 4, + FT = 5, + Cancel = 5, + CY = 6, + Decide = 6, + HHO = 7, + RD = 8, + LC = 9, + LP = 10, // #27029 2012.1.4 from + LBD = 11, - LRed = 12, - RRed = 13, - LBlue = 14, - RBlue = 15, + LRed = 12, + RRed = 13, + LBlue = 14, + RBlue = 15, - LRed2P = 16, - RRed2P = 17, - LBlue2P = 18, - RBlue2P = 19, + LRed2P = 16, + RRed2P = 17, + LBlue2P = 18, + RBlue2P = 19, - LRed3P = 20, - RRed3P = 21, - LBlue3P = 22, - RBlue3P = 23, + LRed3P = 20, + RRed3P = 21, + LBlue3P = 22, + RBlue3P = 23, - LRed4P = 24, - RRed4P = 25, - LBlue4P = 26, - RBlue4P = 27, + LRed4P = 24, + RRed4P = 25, + LBlue4P = 26, + RBlue4P = 27, - LRed5P = 28, - RRed5P = 29, - LBlue5P = 30, - RBlue5P = 31, + LRed5P = 28, + RRed5P = 29, + LBlue5P = 30, + RBlue5P = 31, - Clap = 32, - Clap2P = 33, - Clap3P = 34, - Clap4P = 35, - Clap5P = 36, - LeftChange = 37, - RightChange = 38, + Clap = 32, + Clap2P = 33, + Clap3P = 34, + Clap4P = 35, + Clap5P = 36, + LeftChange = 37, + RightChange = 38, - Max, // 門番用として定義 - Unknown = 99 - } - public enum EKeyConfigPad // #24609 キーコンフィグで使うenum。capture要素あり。 - { - HH = EPad.HH, - R = EPad.R, - SD = EPad.SD, - G = EPad.G, - BD = EPad.BD, - B = EPad.B, - HT = EPad.HT, - Pick = EPad.Pick, - LT = EPad.LT, - Wail = EPad.Wail, - FT = EPad.FT, - Cancel = EPad.Cancel, - CY = EPad.CY, - Decide = EPad.Decide, - HHO = EPad.HHO, - RD = EPad.RD, - LC = EPad.LC, - LP = EPad.LP, // #27029 2012.1.4 from - LBD = EPad.LBD, - #region [Gameplay Keys] - LRed = EPad.LRed, - RRed = EPad.RRed, - LBlue = EPad.LBlue, - RBlue = EPad.RBlue, + Max, // 門番用として定義 + Unknown = 99 +} +public enum EKeyConfigPad // #24609 キーコンフィグで使うenum。capture要素あり。 +{ + HH = EPad.HH, + R = EPad.R, + SD = EPad.SD, + G = EPad.G, + BD = EPad.BD, + B = EPad.B, + HT = EPad.HT, + Pick = EPad.Pick, + LT = EPad.LT, + Wail = EPad.Wail, + FT = EPad.FT, + Cancel = EPad.Cancel, + CY = EPad.CY, + Decide = EPad.Decide, + HHO = EPad.HHO, + RD = EPad.RD, + LC = EPad.LC, + LP = EPad.LP, // #27029 2012.1.4 from + LBD = EPad.LBD, + #region [Gameplay Keys] + LRed = EPad.LRed, + RRed = EPad.RRed, + LBlue = EPad.LBlue, + RBlue = EPad.RBlue, - LRed2P = EPad.LRed2P, - RRed2P = EPad.RRed2P, - LBlue2P = EPad.LBlue2P, - RBlue2P = EPad.RBlue2P, + LRed2P = EPad.LRed2P, + RRed2P = EPad.RRed2P, + LBlue2P = EPad.LBlue2P, + RBlue2P = EPad.RBlue2P, - LRed3P = EPad.LRed3P, - RRed3P = EPad.RRed3P, - LBlue3P = EPad.LBlue3P, - RBlue3P = EPad.RBlue3P, + LRed3P = EPad.LRed3P, + RRed3P = EPad.RRed3P, + LBlue3P = EPad.LBlue3P, + RBlue3P = EPad.RBlue3P, - LRed4P = EPad.LRed4P, - RRed4P = EPad.RRed4P, - LBlue4P = EPad.LBlue4P, - RBlue4P = EPad.RBlue4P, + LRed4P = EPad.LRed4P, + RRed4P = EPad.RRed4P, + LBlue4P = EPad.LBlue4P, + RBlue4P = EPad.RBlue4P, - LRed5P = EPad.LRed5P, - RRed5P = EPad.RRed5P, - LBlue5P = EPad.LBlue5P, - RBlue5P = EPad.RBlue5P, + LRed5P = EPad.LRed5P, + RRed5P = EPad.RRed5P, + LBlue5P = EPad.LBlue5P, + RBlue5P = EPad.RBlue5P, - Clap = EPad.Clap, - Clap2P = EPad.Clap2P, - Clap3P = EPad.Clap3P, - Clap4P = EPad.Clap4P, - Clap5P = EPad.Clap5P, - LeftChange = EPad.LeftChange, - RightChange = EPad.RightChange, - #endregion - #region [System Keys] - Capture, - SongVolumeIncrease, - SongVolumeDecrease, - DisplayHits, - DisplayDebug, - #region [Song Select only] - QuickConfig, - NewHeya, - SortSongs, - ToggleAutoP1, - ToggleAutoP2, - ToggleTrainingMode, - #endregion - #region [Gameplay/Training only] - CycleVideoDisplayMode, - #endregion - #endregion - #region [Training Keys] - TrainingIncreaseScrollSpeed, - TrainingDecreaseScrollSpeed, - TrainingIncreaseSongSpeed, - TrainingDecreaseSongSpeed, - TrainingToggleAuto, - TrainingBranchNormal, - TrainingBranchExpert, - TrainingBranchMaster, - TrainingPause, - TrainingBookmark, - TrainingMoveForwardMeasure, - TrainingMoveBackMeasure, - TrainingSkipForwardMeasure, - TrainingSkipBackMeasure, - TrainingJumpToFirstMeasure, - TrainingJumpToLastMeasure, - #endregion - Max, - Unknown = EPad.Unknown - } - [Flags] - public enum EPadFlag // #24063 2011.1.16 yyagi コマンド入力用 パッド入力のフラグ化 - { - None = 0, - HH = 1, - R = 1, - SD = 2, - G = 2, - B = 4, - BD = 4, - HT = 8, - Pick = 8, - LT = 16, - Wail = 16, - FT = 32, - Cancel = 32, - CY = 64, - Decide = 128, - HHO = 128, - RD = 256, - LC = 512, - LP = 1024, // #27029 - LBD = 2048, - LRed = 0, - RRed = 1, - LBlue = 2, - RBlue = 4, - LRed2P = 8, - RRed2P = 16, - LBlue2P = 32, - RBlue2P = 64, - Unknown = 4096 - } - public enum ERandomMode { - Off, - Random, - Mirror, - SuperRandom, - MirrorRandom - } + Clap = EPad.Clap, + Clap2P = EPad.Clap2P, + Clap3P = EPad.Clap3P, + Clap4P = EPad.Clap4P, + Clap5P = EPad.Clap5P, + LeftChange = EPad.LeftChange, + RightChange = EPad.RightChange, + #endregion + #region [System Keys] + Capture, + SongVolumeIncrease, + SongVolumeDecrease, + DisplayHits, + DisplayDebug, + #region [Song Select only] + QuickConfig, + NewHeya, + SortSongs, + ToggleAutoP1, + ToggleAutoP2, + ToggleTrainingMode, + #endregion + #region [Gameplay/Training only] + CycleVideoDisplayMode, + #endregion + #endregion + #region [Training Keys] + TrainingIncreaseScrollSpeed, + TrainingDecreaseScrollSpeed, + TrainingIncreaseSongSpeed, + TrainingDecreaseSongSpeed, + TrainingToggleAuto, + TrainingBranchNormal, + TrainingBranchExpert, + TrainingBranchMaster, + TrainingPause, + TrainingBookmark, + TrainingMoveForwardMeasure, + TrainingMoveBackMeasure, + TrainingSkipForwardMeasure, + TrainingSkipBackMeasure, + TrainingJumpToFirstMeasure, + TrainingJumpToLastMeasure, + #endregion + Max, + Unknown = EPad.Unknown +} +[Flags] +public enum EPadFlag // #24063 2011.1.16 yyagi コマンド入力用 パッド入力のフラグ化 +{ + None = 0, + HH = 1, + R = 1, + SD = 2, + G = 2, + B = 4, + BD = 4, + HT = 8, + Pick = 8, + LT = 16, + Wail = 16, + FT = 32, + Cancel = 32, + CY = 64, + Decide = 128, + HHO = 128, + RD = 256, + LC = 512, + LP = 1024, // #27029 + LBD = 2048, + LRed = 0, + RRed = 1, + LBlue = 2, + RBlue = 4, + LRed2P = 8, + RRed2P = 16, + LBlue2P = 32, + RBlue2P = 64, + Unknown = 4096 +} +public enum ERandomMode { + Off, + Random, + Mirror, + SuperRandom, + MirrorRandom +} - public enum EFunMods { - None, - Avalanche, - Minesweeper, - Total, - } +public enum EFunMods { + None, + Avalanche, + Minesweeper, + Total, +} - public enum EGameType { - Taiko = 0, - Konga = 1, - } +public enum EGameType { + Taiko = 0, + Konga = 1, +} - public enum EInstrumentPad // ここを修正するときは、セットで次の EKeyConfigPart も修正すること。 - { - Drums = 0, - Guitar = 1, - Bass = 2, - Taiko = 3, - Unknown = 99 - } - public enum EKeyConfigPart // : E楽器パート - { - Drums = EInstrumentPad.Drums, - Guitar = EInstrumentPad.Guitar, - Bass = EInstrumentPad.Bass, - Taiko = EInstrumentPad.Taiko, - System, - Unknown = EInstrumentPad.Unknown - } +public enum EInstrumentPad // ここを修正するときは、セットで次の EKeyConfigPart も修正すること。 +{ + Drums = 0, + Guitar = 1, + Bass = 2, + Taiko = 3, + Unknown = 99 +} +public enum EKeyConfigPart // : E楽器パート +{ + Drums = EInstrumentPad.Drums, + Guitar = EInstrumentPad.Guitar, + Bass = EInstrumentPad.Bass, + Taiko = EInstrumentPad.Taiko, + System, + Unknown = EInstrumentPad.Unknown +} - internal enum EInputDevice { - Keyboard = 0, - MIDIInput = 1, - Joypad = 2, - Mouse = 3, - Gamepad = 4, - Unknown = -1 - } - public enum ENoteJudge { - Perfect = 0, - Great = 1, - Good = 2, - Poor = 3, - Miss = 4, - Bad = 5, - Auto = 6, - ADLIB = 7, - Mine = 8, - } - internal enum EJudgeTextDisplayPosition { - OFF, - AboveLane, - OnJudgeLine, - BelowCombo - } +internal enum EInputDevice { + Keyboard = 0, + MIDIInput = 1, + Joypad = 2, + Mouse = 3, + Gamepad = 4, + Unknown = -1 +} +public enum ENoteJudge { + Perfect = 0, + Great = 1, + Good = 2, + Poor = 3, + Miss = 4, + Bad = 5, + Auto = 6, + ADLIB = 7, + Mine = 8, +} +internal enum EJudgeTextDisplayPosition { + OFF, + AboveLane, + OnJudgeLine, + BelowCombo +} - internal enum EFIFOMode { - FadeIn, - FadeOut - } +internal enum EFIFOMode { + FadeIn, + FadeOut +} - internal enum EGameplayScreenReturnValue { - Continue, - PerformanceInterrupted, - StageFailed, - StageCleared, - ReloadAndReplay, - Replay - } - internal enum ESongLoadingScreenReturnValue { - Continue = 0, - LoadComplete, - LoadCanceled - } +internal enum EGameplayScreenReturnValue { + Continue, + PerformanceInterrupted, + StageFailed, + StageCleared, + ReloadAndReplay, + Replay +} +internal enum ESongLoadingScreenReturnValue { + Continue = 0, + LoadComplete, + LoadCanceled +} - public enum ENoteState { - None, - Wait, - Perfect, - Grade, - Bad - } +public enum ENoteState { + None, + Wait, + Perfect, + Grade, + Bad +} - public enum ERollState { - None, - Roll, - RollB, - Balloon, - Potato - } +public enum ERollState { + None, + Roll, + RollB, + Balloon, + Potato +} - public enum EStealthMode { - Off = 0, - Doron = 1, - Stealth = 2 - } +public enum EStealthMode { + Off = 0, + Doron = 1, + Stealth = 2 +} - /// - /// 透明チップの種類 - /// - public enum EInvisible { - Off, // チップを透明化しない - Semi, // Poor/Miss時だけ、一時的に透明解除する - Full // チップを常に透明化する - } +/// +/// 透明チップの種類 +/// +public enum EInvisible { + Off, // チップを透明化しない + Semi, // Poor/Miss時だけ、一時的に透明解除する + Full // チップを常に透明化する +} - /// - /// Drum/Guitar/Bass の値を扱う汎用の構造体。 - /// - /// 値の型。 - [Serializable] - [StructLayout(LayoutKind.Sequential)] - public struct STDGBVALUE // indexはE楽器パートと一致させること - { - public T Drums; - public T Guitar; - public T Bass; - public T Taiko; - public T Unknown; - public T this[int index] { - get { - return index switch { - (int)EInstrumentPad.Drums => this.Drums, - (int)EInstrumentPad.Guitar => this.Guitar, - (int)EInstrumentPad.Bass => this.Bass, - (int)EInstrumentPad.Taiko => this.Taiko, - (int)EInstrumentPad.Unknown => this.Unknown, - _ => throw new IndexOutOfRangeException() - }; - } - set { - switch (index) { - case (int)EInstrumentPad.Drums: - this.Drums = value; - return; - - case (int)EInstrumentPad.Guitar: - this.Guitar = value; - return; - - case (int)EInstrumentPad.Bass: - this.Bass = value; - return; - - case (int)EInstrumentPad.Taiko: - this.Taiko = value; - return; - - case (int)EInstrumentPad.Unknown: - this.Unknown = value; - return; - } - throw new IndexOutOfRangeException(); +/// +/// Drum/Guitar/Bass の値を扱う汎用の構造体。 +/// +/// 値の型。 +[Serializable] +[StructLayout(LayoutKind.Sequential)] +public struct STDGBVALUE // indexはE楽器パートと一致させること +{ + public T Drums; + public T Guitar; + public T Bass; + public T Taiko; + public T Unknown; + public T this[int index] { + get { + return index switch { + (int)EInstrumentPad.Drums => this.Drums, + (int)EInstrumentPad.Guitar => this.Guitar, + (int)EInstrumentPad.Bass => this.Bass, + (int)EInstrumentPad.Taiko => this.Taiko, + (int)EInstrumentPad.Unknown => this.Unknown, + _ => throw new IndexOutOfRangeException() + }; + } + set { + switch (index) { + case (int)EInstrumentPad.Drums: + this.Drums = value; + return; + + case (int)EInstrumentPad.Guitar: + this.Guitar = value; + return; + + case (int)EInstrumentPad.Bass: + this.Bass = value; + return; + + case (int)EInstrumentPad.Taiko: + this.Taiko = value; + return; + + case (int)EInstrumentPad.Unknown: + this.Unknown = value; + return; } + throw new IndexOutOfRangeException(); } } - - public enum EReturnValue : int { - Continuation, - ReturnToTitle, - SongChoosen - } - - #region[Ver.K追加] - public enum ELaneType { - TypeA, - TypeB, - TypeC, - TypeD - } - public enum EMirror { - TypeA, - TypeB - } - public enum EClipDispType { - BackgroundOnly = 1, - WindowOnly = 2, - Both = 3, - Off = 0 - } - #endregion } + +public enum EReturnValue : int { + Continuation, + ReturnToTitle, + SongChoosen +} + +#region[Ver.K追加] +public enum ELaneType { + TypeA, + TypeB, + TypeC, + TypeD +} +public enum EMirror { + TypeA, + TypeB +} +public enum EClipDispType { + BackgroundOnly = 1, + WindowOnly = 2, + Both = 3, + Off = 0 +} +#endregion diff --git a/OpenTaiko/src/Common/CCrypto.cs b/OpenTaiko/src/Common/CCrypto.cs index 6fbcfb7c..11dbdf00 100644 --- a/OpenTaiko/src/Common/CCrypto.cs +++ b/OpenTaiko/src/Common/CCrypto.cs @@ -1,25 +1,25 @@ using System.Security.Cryptography; using System.Text; -namespace OpenTaiko { - internal class CCrypto { - internal static readonly char[] chars = - "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890".ToCharArray(); +namespace OpenTaiko; - public static string GetUniqueKey(int size) { - byte[] data = new byte[4 * size]; - using (var crypto = RandomNumberGenerator.Create()) { - crypto.GetBytes(data); - } - StringBuilder result = new StringBuilder(size); - for (int i = 0; i < size; i++) { - var rnd = BitConverter.ToUInt32(data, i * 4); - var idx = rnd % chars.Length; +internal class CCrypto { + internal static readonly char[] chars = + "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890".ToCharArray(); - result.Append(chars[idx]); - } - - return result.ToString(); + public static string GetUniqueKey(int size) { + byte[] data = new byte[4 * size]; + using (var crypto = RandomNumberGenerator.Create()) { + crypto.GetBytes(data); } + StringBuilder result = new StringBuilder(size); + for (int i = 0; i < size; i++) { + var rnd = BitConverter.ToUInt32(data, i * 4); + var idx = rnd % chars.Length; + + result.Append(chars[idx]); + } + + return result.ToString(); } } diff --git a/OpenTaiko/src/Common/CHitSounds.cs b/OpenTaiko/src/Common/CHitSounds.cs index 5aba9c99..f75e6535 100644 --- a/OpenTaiko/src/Common/CHitSounds.cs +++ b/OpenTaiko/src/Common/CHitSounds.cs @@ -1,55 +1,55 @@ -namespace OpenTaiko { - class CHitSounds { - public CHitSounds(string path) { - tLoadFile(path); - for (int i = 0; i < 5; i++) { - tReloadHitSounds(OpenTaiko.ConfigIni.nHitSounds[i], i); - } +namespace OpenTaiko; + +class CHitSounds { + public CHitSounds(string path) { + tLoadFile(path); + for (int i = 0; i < 5; i++) { + tReloadHitSounds(OpenTaiko.ConfigIni.nHitSounds[i], i); } - - public bool tReloadHitSounds(int id, int player) { - if (id >= names.Length || id >= data.Length) - return false; - - string ext = this.data[id].format switch { - "WAV" => ".wav", - "OGG" => ".ogg", - _ => "" - }; - - don[player] = data[id].path + "dong" + ext; - ka[player] = data[id].path + "ka" + ext; - adlib[player] = data[id].path + "Adlib" + ext; - clap[player] = data[id].path + "clap" + ext; - - return true; - } - - public string[] names; - - public string[] don = new string[5]; - public string[] ka = new string[5]; - public string[] adlib = new string[5]; - public string[] clap = new string[5]; - - #region [private] - - private class HitSoundsData { - public string name; - public string path; - public string format; - } - - private HitSoundsData[] data; - - private void tLoadFile(string path) { - data = ConfigManager.GetConfig>(path).ToArray(); - names = new string[data.Length]; - for (int i = 0; i < data.Length; i++) { - names[i] = data[i].name; - } - } - - #endregion } + + public bool tReloadHitSounds(int id, int player) { + if (id >= names.Length || id >= data.Length) + return false; + + string ext = this.data[id].format switch { + "WAV" => ".wav", + "OGG" => ".ogg", + _ => "" + }; + + don[player] = data[id].path + "dong" + ext; + ka[player] = data[id].path + "ka" + ext; + adlib[player] = data[id].path + "Adlib" + ext; + clap[player] = data[id].path + "clap" + ext; + + return true; + } + + public string[] names; + + public string[] don = new string[5]; + public string[] ka = new string[5]; + public string[] adlib = new string[5]; + public string[] clap = new string[5]; + + #region [private] + + private class HitSoundsData { + public string name; + public string path; + public string format; + } + + private HitSoundsData[] data; + + private void tLoadFile(string path) { + data = ConfigManager.GetConfig>(path).ToArray(); + names = new string[data.Length]; + for (int i = 0; i < data.Length; i++) { + names[i] = data[i].name; + } + } + + #endregion } diff --git a/OpenTaiko/src/Common/CPad.cs b/OpenTaiko/src/Common/CPad.cs index 2bc8d591..410b50c3 100644 --- a/OpenTaiko/src/Common/CPad.cs +++ b/OpenTaiko/src/Common/CPad.cs @@ -1,104 +1,105 @@ using System.Runtime.InteropServices; using FDK; -namespace OpenTaiko { - public class CPad { - // Properties +namespace OpenTaiko; - internal STHIT detectedDevice; - [StructLayout(LayoutKind.Sequential)] - internal struct STHIT { - public bool Keyboard; - public bool MIDIIN; - public bool Joypad; - public bool Gamepad; - public bool Mouse; - public void Clear() { - this.Keyboard = false; - this.MIDIIN = false; - this.Joypad = false; - this.Mouse = false; +public class CPad { + // Properties + + internal STHIT detectedDevice; + [StructLayout(LayoutKind.Sequential)] + internal struct STHIT { + public bool Keyboard; + public bool MIDIIN; + public bool Joypad; + public bool Gamepad; + public bool Mouse; + public void Clear() { + this.Keyboard = false; + this.MIDIIN = false; + this.Joypad = false; + this.Mouse = false; + } + } + + // Constructor + internal CPad(CConfigIni configIni, CInputManager mgrInput) { + this.rConfigIni = configIni; + this.inputManager = mgrInput; + this.detectedDevice.Clear(); + } + + // Methods + public List GetEvents(EInstrumentPad part, EPad pad) { + CConfigIni.CKeyAssign.STKEYASSIGN[] stkeyassignArray = this.rConfigIni.KeyAssign[(int)part][(int)pad]; + List list = new List(); + + // すべての入力デバイスについて… + foreach (IInputDevice device in this.inputManager.InputDevices) { + if (device.InputEvents == null || device.InputEvents.Count == 0) { + continue; } - } - // Constructor - internal CPad(CConfigIni configIni, CInputManager mgrInput) { - this.rConfigIni = configIni; - this.inputManager = mgrInput; - this.detectedDevice.Clear(); - } + foreach (STInputEvent event2 in device.InputEvents) { + for (int i = 0; i < stkeyassignArray.Length; i++) { + switch (stkeyassignArray[i].InputDevice) { + case EInputDevice.Keyboard: + if ((device.CurrentType == InputDeviceType.Keyboard) && (event2.nKey == stkeyassignArray[i].Code)) { + list.Add(event2); + this.detectedDevice.Keyboard = true; + } + break; - // Methods - public List GetEvents(EInstrumentPad part, EPad pad) { - CConfigIni.CKeyAssign.STKEYASSIGN[] stkeyassignArray = this.rConfigIni.KeyAssign[(int)part][(int)pad]; - List list = new List(); + case EInputDevice.MIDIInput: + if (((device.CurrentType == InputDeviceType.MidiIn) && (device.ID == stkeyassignArray[i].ID)) && (event2.nKey == stkeyassignArray[i].Code)) { + list.Add(event2); + this.detectedDevice.MIDIIN = true; + } + break; - // すべての入力デバイスについて… - foreach (IInputDevice device in this.inputManager.InputDevices) { - if (device.InputEvents == null || device.InputEvents.Count == 0) { - continue; - } + case EInputDevice.Joypad: + if (((device.CurrentType == InputDeviceType.Joystick) && (device.ID == stkeyassignArray[i].ID)) && (event2.nKey == stkeyassignArray[i].Code)) { + list.Add(event2); + this.detectedDevice.Joypad = true; + } + break; - foreach (STInputEvent event2 in device.InputEvents) { - for (int i = 0; i < stkeyassignArray.Length; i++) { - switch (stkeyassignArray[i].InputDevice) { - case EInputDevice.Keyboard: - if ((device.CurrentType == InputDeviceType.Keyboard) && (event2.nKey == stkeyassignArray[i].Code)) { - list.Add(event2); - this.detectedDevice.Keyboard = true; - } - break; + case EInputDevice.Gamepad: + if (((device.CurrentType == InputDeviceType.Gamepad) && (device.ID == stkeyassignArray[i].ID)) && (event2.nKey == stkeyassignArray[i].Code)) { + list.Add(event2); + this.detectedDevice.Gamepad = true; + } + break; - case EInputDevice.MIDIInput: - if (((device.CurrentType == InputDeviceType.MidiIn) && (device.ID == stkeyassignArray[i].ID)) && (event2.nKey == stkeyassignArray[i].Code)) { - list.Add(event2); - this.detectedDevice.MIDIIN = true; - } - break; - - case EInputDevice.Joypad: - if (((device.CurrentType == InputDeviceType.Joystick) && (device.ID == stkeyassignArray[i].ID)) && (event2.nKey == stkeyassignArray[i].Code)) { - list.Add(event2); - this.detectedDevice.Joypad = true; - } - break; - - case EInputDevice.Gamepad: - if (((device.CurrentType == InputDeviceType.Gamepad) && (device.ID == stkeyassignArray[i].ID)) && (event2.nKey == stkeyassignArray[i].Code)) { - list.Add(event2); - this.detectedDevice.Gamepad = true; - } - break; - - case EInputDevice.Mouse: - if ((device.CurrentType == InputDeviceType.Mouse) && (event2.nKey == stkeyassignArray[i].Code)) { - list.Add(event2); - this.detectedDevice.Mouse = true; - } - break; - } + case EInputDevice.Mouse: + if ((device.CurrentType == InputDeviceType.Mouse) && (event2.nKey == stkeyassignArray[i].Code)) { + list.Add(event2); + this.detectedDevice.Mouse = true; + } + break; } } } - return list; + } + return list; + } + + public bool bPressed(EInstrumentPad part, EPad pad) { + if (part == EInstrumentPad.Unknown) { + return false; } - public bool bPressed(EInstrumentPad part, EPad pad) { - if (part == EInstrumentPad.Unknown) { - return false; - } + CConfigIni.CKeyAssign.STKEYASSIGN[] stkeyassignArray = this.rConfigIni.KeyAssign[(int)part][(int)pad]; + for (int i = 0; i < stkeyassignArray.Length; i++) { + switch (stkeyassignArray[i].InputDevice) { + case EInputDevice.Keyboard: + if (!this.inputManager.Keyboard.KeyPressed(stkeyassignArray[i].Code)) + break; - CConfigIni.CKeyAssign.STKEYASSIGN[] stkeyassignArray = this.rConfigIni.KeyAssign[(int)part][(int)pad]; - for (int i = 0; i < stkeyassignArray.Length; i++) { - switch (stkeyassignArray[i].InputDevice) { - case EInputDevice.Keyboard: - if (!this.inputManager.Keyboard.KeyPressed(stkeyassignArray[i].Code)) - break; + this.detectedDevice.Keyboard = true; + return true; - this.detectedDevice.Keyboard = true; - return true; - - case EInputDevice.MIDIInput: { + case EInputDevice.MIDIInput: { IInputDevice device2 = this.inputManager.MidiIn(stkeyassignArray[i].ID); if (device2 == null || !device2.KeyPressed(stkeyassignArray[i].Code)) break; @@ -106,7 +107,7 @@ namespace OpenTaiko { this.detectedDevice.MIDIIN = true; return true; } - case EInputDevice.Joypad: { + case EInputDevice.Joypad: { if (!this.rConfigIni.dicJoystick.ContainsKey(stkeyassignArray[i].ID)) break; @@ -117,7 +118,7 @@ namespace OpenTaiko { this.detectedDevice.Joypad = true; return true; } - case EInputDevice.Gamepad: { + case EInputDevice.Gamepad: { if (!this.rConfigIni.dicJoystick.ContainsKey(stkeyassignArray[i].ID)) break; @@ -128,86 +129,85 @@ namespace OpenTaiko { this.detectedDevice.Gamepad = true; return true; } - case EInputDevice.Mouse: - if (!this.inputManager.Mouse.KeyPressed(stkeyassignArray[i].Code)) - break; + case EInputDevice.Mouse: + if (!this.inputManager.Mouse.KeyPressed(stkeyassignArray[i].Code)) + break; - this.detectedDevice.Mouse = true; - return true; - } + this.detectedDevice.Mouse = true; + return true; } - return false; } - - public bool bPressedDGB(EPad pad) { - if (!this.bPressed(EInstrumentPad.Drums, pad) && !this.bPressed(EInstrumentPad.Guitar, pad)) { - return this.bPressed(EInstrumentPad.Bass, pad); - } - return true; - } - - public bool bPressedGB(EPad pad) { - return this.bPressed(EInstrumentPad.Guitar, pad) || this.bPressed(EInstrumentPad.Bass, pad); - } - - public bool IsPressing(EInstrumentPad part, EPad pad) { - if (part == EInstrumentPad.Unknown) { - return false; - } - - CConfigIni.CKeyAssign.STKEYASSIGN[] stkeyassignArray = this.rConfigIni.KeyAssign[(int)part][(int)pad]; - for (int i = 0; i < stkeyassignArray.Length; i++) { - switch (stkeyassignArray[i].InputDevice) { - case EInputDevice.Keyboard: - if (!this.inputManager.Keyboard.KeyPressing(stkeyassignArray[i].Code)) { - break; - } - this.detectedDevice.Keyboard = true; - return true; - - case EInputDevice.Joypad: { - if (!this.rConfigIni.dicJoystick.ContainsKey(stkeyassignArray[i].ID)) { - break; - } - IInputDevice device = this.inputManager.Joystick(stkeyassignArray[i].ID); - if (device == null || !device.KeyPressing(stkeyassignArray[i].Code)) { - break; - } - this.detectedDevice.Joypad = true; - return true; - } - - case EInputDevice.Gamepad: { - if (!this.rConfigIni.dicJoystick.ContainsKey(stkeyassignArray[i].ID)) { - break; - } - IInputDevice device = this.inputManager.Gamepad(stkeyassignArray[i].ID); - if (device == null || !device.KeyPressing(stkeyassignArray[i].Code)) { - break; - } - this.detectedDevice.Gamepad = true; - return true; - } - case EInputDevice.Mouse: - if (!this.inputManager.Mouse.KeyPressing(stkeyassignArray[i].Code)) { - break; - } - this.detectedDevice.Mouse = true; - return true; - } - } - return false; - } - - public bool IsPressingGB(EPad pad) { - return this.IsPressing(EInstrumentPad.Guitar, pad) || this.IsPressing(EInstrumentPad.Bass, pad); - } - - #region [ private ] - //----------------- - private CConfigIni rConfigIni; - private CInputManager inputManager; - //----------------- - #endregion + return false; } + + public bool bPressedDGB(EPad pad) { + if (!this.bPressed(EInstrumentPad.Drums, pad) && !this.bPressed(EInstrumentPad.Guitar, pad)) { + return this.bPressed(EInstrumentPad.Bass, pad); + } + return true; + } + + public bool bPressedGB(EPad pad) { + return this.bPressed(EInstrumentPad.Guitar, pad) || this.bPressed(EInstrumentPad.Bass, pad); + } + + public bool IsPressing(EInstrumentPad part, EPad pad) { + if (part == EInstrumentPad.Unknown) { + return false; + } + + CConfigIni.CKeyAssign.STKEYASSIGN[] stkeyassignArray = this.rConfigIni.KeyAssign[(int)part][(int)pad]; + for (int i = 0; i < stkeyassignArray.Length; i++) { + switch (stkeyassignArray[i].InputDevice) { + case EInputDevice.Keyboard: + if (!this.inputManager.Keyboard.KeyPressing(stkeyassignArray[i].Code)) { + break; + } + this.detectedDevice.Keyboard = true; + return true; + + case EInputDevice.Joypad: { + if (!this.rConfigIni.dicJoystick.ContainsKey(stkeyassignArray[i].ID)) { + break; + } + IInputDevice device = this.inputManager.Joystick(stkeyassignArray[i].ID); + if (device == null || !device.KeyPressing(stkeyassignArray[i].Code)) { + break; + } + this.detectedDevice.Joypad = true; + return true; + } + + case EInputDevice.Gamepad: { + if (!this.rConfigIni.dicJoystick.ContainsKey(stkeyassignArray[i].ID)) { + break; + } + IInputDevice device = this.inputManager.Gamepad(stkeyassignArray[i].ID); + if (device == null || !device.KeyPressing(stkeyassignArray[i].Code)) { + break; + } + this.detectedDevice.Gamepad = true; + return true; + } + case EInputDevice.Mouse: + if (!this.inputManager.Mouse.KeyPressing(stkeyassignArray[i].Code)) { + break; + } + this.detectedDevice.Mouse = true; + return true; + } + } + return false; + } + + public bool IsPressingGB(EPad pad) { + return this.IsPressing(EInstrumentPad.Guitar, pad) || this.IsPressing(EInstrumentPad.Bass, pad); + } + + #region [ private ] + //----------------- + private CConfigIni rConfigIni; + private CInputManager inputManager; + //----------------- + #endregion } diff --git a/OpenTaiko/src/Common/CSavableT.cs b/OpenTaiko/src/Common/CSavableT.cs index 34861bb4..e451a159 100644 --- a/OpenTaiko/src/Common/CSavableT.cs +++ b/OpenTaiko/src/Common/CSavableT.cs @@ -1,29 +1,29 @@ -namespace OpenTaiko { - class CSavableT where T : new() { - public virtual string _fn { - get; - protected set; - } - public void tDBInitSavable() { - if (!File.Exists(_fn)) - tSaveFile(); - - tLoadFile(); - } - - public T data = new T(); - - #region [private] - - private void tSaveFile() { - ConfigManager.SaveConfig(data, _fn); - } - - private void tLoadFile() { - data = ConfigManager.GetConfig(_fn); - } - - #endregion +namespace OpenTaiko; +class CSavableT where T : new() { + public virtual string _fn { + get; + protected set; } + public void tDBInitSavable() { + if (!File.Exists(_fn)) + tSaveFile(); + + tLoadFile(); + } + + public T data = new T(); + + #region [private] + + private void tSaveFile() { + ConfigManager.SaveConfig(data, _fn); + } + + private void tLoadFile() { + data = ConfigManager.GetConfig(_fn); + } + + #endregion + } diff --git a/OpenTaiko/src/Common/CSkin.cs b/OpenTaiko/src/Common/CSkin.cs index 721315b6..c830a5ad 100644 --- a/OpenTaiko/src/Common/CSkin.cs +++ b/OpenTaiko/src/Common/CSkin.cs @@ -3,9312 +3,9311 @@ using System.Drawing; using System.Text; using FDK; -namespace OpenTaiko { - // グローバル定数 - - public enum Eシステムサウンド { - BGMオプション画面 = 0, - BGMコンフィグ画面, - BGM起動画面, - BGM選曲画面, - SOUNDステージ失敗音, - SOUNDカーソル移動音, - SOUNDゲーム開始音, - SOUNDゲーム終了音, - SOUNDステージクリア音, - SOUNDタイトル音, - SOUNDフルコンボ音, - SOUND歓声音, - SOUND曲読込開始音, - SOUND決定音, - SOUND取消音, - SOUND変更音, - //SOUND赤, - //SOUND青, - SOUND風船, - SOUND曲決定音, - SOUND成績発表, - SOUND特訓再生, - SOUND特訓停止, - sound特訓ジャンプポイント, - sound特訓スキップ音, - SOUND特訓スクロール, - Count // システムサウンド総数の計算用 - } +namespace OpenTaiko; +// グローバル定数 - internal class CSkin : IDisposable { - // Class - - public class CSystemSound : IDisposable { - // static フィールド - - public static CSkin.CSystemSound r最後に再生した排他システムサウンド; +public enum Eシステムサウンド { + BGMオプション画面 = 0, + BGMコンフィグ画面, + BGM起動画面, + BGM選曲画面, + SOUNDステージ失敗音, + SOUNDカーソル移動音, + SOUNDゲーム開始音, + SOUNDゲーム終了音, + SOUNDステージクリア音, + SOUNDタイトル音, + SOUNDフルコンボ音, + SOUND歓声音, + SOUND曲読込開始音, + SOUND決定音, + SOUND取消音, + SOUND変更音, + //SOUND赤, + //SOUND青, + SOUND風船, + SOUND曲決定音, + SOUND成績発表, + SOUND特訓再生, + SOUND特訓停止, + sound特訓ジャンプポイント, + sound特訓スキップ音, + SOUND特訓スクロール, + Count // システムサウンド総数の計算用 +} - private readonly ESoundGroup _soundGroup; - - // フィールド、プロパティ - - public bool bPlayed; - public bool bCompact対象; - public bool bLoop; - public bool bNotLoadedYet; - public bool bLoadedSuccessfuly; - public bool bExclusive; - public string strFileName = ""; - public bool bIsPlaying { - get { - if (this.rSound[1 - this.nNextPlayingSoundNumber] == null) - return false; +internal class CSkin : IDisposable { + // Class - return this.rSound[1 - this.nNextPlayingSoundNumber].IsPlaying; - } - } - public int nPosition_CurrentlyPlayingSound { - get { - CSound sound = this.rSound[1 - this.nNextPlayingSoundNumber]; - if (sound == null) - return 0; + public class CSystemSound : IDisposable { + // static フィールド - return sound.SoundPosition; - } - set { - CSound sound = this.rSound[1 - this.nNextPlayingSoundNumber]; - if (sound != null) - sound.SoundPosition = value; - } - } - public int nPosition_NextPlayingSound { - get { - CSound sound = this.rSound[this.nNextPlayingSoundNumber]; - if (sound == null) - return 0; + public static CSkin.CSystemSound r最後に再生した排他システムサウンド; - return sound.SoundPosition; - } - set { - CSound sound = this.rSound[this.nNextPlayingSoundNumber]; - if (sound != null) - sound.SoundPosition = value; - } - } - public int nAutomationLevel_現在のサウンド { - get { - CSound sound = this.rSound[1 - this.nNextPlayingSoundNumber]; - if (sound == null) - return 0; + private readonly ESoundGroup _soundGroup; - return sound.AutomationLevel; - } - set { - CSound sound = this.rSound[1 - this.nNextPlayingSoundNumber]; - if (sound != null) { - sound.AutomationLevel = value; - } - } - } - public int n長さ_現在のサウンド { - get { - CSound sound = this.rSound[1 - this.nNextPlayingSoundNumber]; - if (sound == null) { - return 0; - } - return sound.TotalPlayTime; - } - } - public int n長さ_次に鳴るサウンド { - get { - CSound sound = this.rSound[this.nNextPlayingSoundNumber]; - if (sound == null) { - return 0; - } - return sound.TotalPlayTime; - } - } - - - /// - /// コンストラクタ - /// - /// - /// - /// - /// - public CSystemSound(string strFileName, bool bLoop, bool bExclusive, bool bCompact対象, ESoundGroup soundGroup) { - this.strFileName = strFileName; - this.bLoop = bLoop; - this.bExclusive = bExclusive; - this.bCompact対象 = bCompact対象; - _soundGroup = soundGroup; - this.bNotLoadedYet = true; - this.bPlayed = false; - } - - - // メソッド - - public void tLoading() { - this.bNotLoadedYet = false; - this.bLoadedSuccessfuly = false; - if (string.IsNullOrEmpty(this.strFileName)) - throw new InvalidOperationException("ファイル名が無効です。"); + // フィールド、プロパティ - if (!File.Exists(CSkin.Path(this.strFileName))) { - Trace.TraceWarning($"ファイルが存在しません。: {this.strFileName}"); - return; - } - - for (int i = 0; i < 2; i++) // 一旦Cloneを止めてASIO対応に専念 - { - try { - this.rSound[i] = OpenTaiko.SoundManager?.tCreateSound(CSkin.Path(this.strFileName), _soundGroup); - } catch { - this.rSound[i] = null; - throw; - } - } - this.bLoadedSuccessfuly = true; - } - public void tPlay() { - if (this.bNotLoadedYet) { - try { - tLoading(); - } catch (Exception e) { - Trace.TraceError(e.ToString()); - Trace.TraceError("例外が発生しましたが処理を継続します。 (17668977-4686-4aa7-b3f0-e0b9a44975b8)"); - this.bNotLoadedYet = false; - } - } - if (this.bExclusive) { - if (r最後に再生した排他システムサウンド != null) - r最後に再生した排他システムサウンド.tStop(); - - r最後に再生した排他システムサウンド = this; - } - CSound sound = this.rSound[this.nNextPlayingSoundNumber]; - if (sound != null) - sound.PlayStart(this.bLoop); - - this.bPlayed = true; - this.nNextPlayingSoundNumber = 1 - this.nNextPlayingSoundNumber; - } - public void tStop() { - this.bPlayed = false; - if (this.rSound[0] != null) - this.rSound[0].Stop(); - - if (this.rSound[1] != null) - this.rSound[1].Stop(); - - if (r最後に再生した排他システムサウンド == this) - r最後に再生した排他システムサウンド = null; - } - - public void tRemoveMixer() { - if (OpenTaiko.SoundManager.GetCurrentSoundDeviceType() != "DirectShow") { - for (int i = 0; i < 2; i++) { - if (this.rSound[i] != null) { - OpenTaiko.SoundManager.RemoveMixer(this.rSound[i]); - } - } - } - } - - #region [ IDisposable 実装 ] - //----------------- - public void Dispose() { - if (!this.bDisposed) { - for (int i = 0; i < 2; i++) { - if (this.rSound[i] != null) { - OpenTaiko.SoundManager.tDisposeSound(this.rSound[i]); - this.rSound[i] = null; - } - } - this.bLoadedSuccessfuly = false; - this.bDisposed = true; - } - } - //----------------- - #endregion - - #region [ private ] - //----------------- - private bool bDisposed; - private int nNextPlayingSoundNumber; - private CSound[] rSound = new CSound[2]; - //----------------- - #endregion - } - - - // Properties - - // Hitsounds - - public CHitSounds hsHitSoundsInformations = null; - - // Character specific voice samples - - // Sounds{System.IO.Path.DirectorySeparatorChar}Clear - - public CSystemSound[] voiceClearFailed = new CSystemSound[5]; - public CSystemSound[] voiceClearClear = new CSystemSound[5]; - public CSystemSound[] voiceClearFullCombo = new CSystemSound[5]; - public CSystemSound[] voiceClearAllPerfect = new CSystemSound[5]; - public CSystemSound[] voiceAIWin = new CSystemSound[5]; - public CSystemSound[] voiceAILose = new CSystemSound[5]; - - // Sounds{System.IO.Path.DirectorySeparatorChar}Menu - - public CSystemSound[] voiceMenuSongSelect = new CSystemSound[5]; - public CSystemSound[] voiceMenuSongDecide = new CSystemSound[5]; - public CSystemSound[] voiceMenuSongDecide_AI = new CSystemSound[5]; - public CSystemSound[] voiceMenuDiffSelect = new CSystemSound[5]; - public CSystemSound[] voiceMenuDanSelectStart = new CSystemSound[5]; - public CSystemSound[] voiceMenuDanSelectPrompt = new CSystemSound[5]; - public CSystemSound[] voiceMenuDanSelectConfirm = new CSystemSound[5]; - - // Sounds{System.IO.Path.DirectorySeparatorChar}Title - - public CSystemSound[] voiceTitleSanka = new CSystemSound[5]; - - // Sounds{System.IO.Path.DirectorySeparatorChar}Tower - - public CSystemSound[] voiceTowerMiss = new CSystemSound[5]; - - // Sounds{System.IO.Path.DirectorySeparatorChar}Result - - public CSystemSound[] voiceResultBestScore = new CSystemSound[5]; - public CSystemSound[] voiceResultClearFailed = new CSystemSound[5]; - public CSystemSound[] voiceResultClearSuccess = new CSystemSound[5]; - public CSystemSound[] voiceResultDanFailed = new CSystemSound[5]; - public CSystemSound[] voiceResultDanRedPass = new CSystemSound[5]; - public CSystemSound[] voiceResultDanGoldPass = new CSystemSound[5]; - - // General sound effects (Skin specific) - - public CSystemSound bgmオプション画面 = null; - public CSystemSound bgmコンフィグ画面 = null; - public CSystemSound bgm起動画面 = null; - public CSystemSound soundSTAGEFAILED音 = null; - public CSystemSound soundカーソル移動音 = null; - public CSystemSound soundゲーム開始音 = null; - public CSystemSound soundゲーム終了音 = null; - public CSystemSound soundステージクリア音 = null; - public CSystemSound soundフルコンボ音 = null; - public CSystemSound sound歓声音 = null; - public CSystemSound sound曲読込開始音 = null; - public CSystemSound soundDecideSFX = null; - public CSystemSound soundCancelSFX = null; - public CSystemSound soundChangeSFX = null; - public CSystemSound soundSongSelectChara = null; - public CSystemSound soundSkip = null; - public CSystemSound soundEntry = null; - public CSystemSound soundError = null; - public CSystemSound soundsanka = null; - public CSystemSound soundBomb = null; - //add - public CSystemSound sound曲決定音 = null; - public CSystemSound soundSongDecide_AI = null; - public CSystemSound bgmリザルトイン音 = null; - public CSystemSound bgmリザルト音 = null; - public CSystemSound bgmResultIn_AI = null; - public CSystemSound bgmResult_AI = null; - - public CSystemSound bgmDanResult = null; - - public CSystemSound bgmタイトル = null; - public CSystemSound bgmタイトルイン = null; - public CSystemSound bgm選曲画面 = null; - public CSystemSound bgm選曲画面イン = null; - public CSystemSound bgmSongSelect_AI = null; - public CSystemSound bgmSongSelect_AI_In = null; - public CSystemSound bgmリザルト = null; - public CSystemSound bgmリザルトイン = null; - - public CSystemSound SoundBanapas = null; - - public CSystemSound sound特訓再生音 = null; - public CSystemSound sound特訓停止音 = null; - public CSystemSound soundTrainingToggleBookmarkSFX = null; - public CSystemSound sound特訓スキップ音 = null; - public CSystemSound soundTrainingModeScrollSFX = null; - public CSystemSound soundPon = null; - public CSystemSound soundGauge = null; - public CSystemSound soundScoreDon = null; - public CSystemSound soundChallengeVoice = null; - public CSystemSound soundDanSelectStart = null; - public CSystemSound soundDanSongSelectCheck = null; - - public CSystemSound soundDanSongSelectIn = null; - - public CSystemSound soundDanSelectBGM = null; - public CSystemSound soundDanSongSelect = null; - - public CSystemSound soundHeyaBGM = null; - public CSystemSound soundOnlineLoungeBGM = null; - public CSystemSound soundEncyclopediaBGM = null; - public CSystemSound soundTowerSelectBGM = null; - - public CSystemSound[] soundExToExtra = null; - public CSystemSound[] soundExtraToEx = null; - - public CSystemSound calibrationTick = null; - - public CSystemSound[] soundModal = null; - - public CSystemSound soundCrownIn = null; - public CSystemSound soundRankIn = null; - - public CSystemSound soundSelectAnnounce = null; - - // Tower Sfx - public CSystemSound soundTowerMiss = null; - public CSystemSound bgmTowerResult = null; - - //public Cシステムサウンド soundRed = null; - //public Cシステムサウンド soundBlue = null; - public CSystemSound soundBalloon = null; - public CSystemSound soundKusudama = null; - public CSystemSound soundKusudamaMiss = null; - - - public readonly int nシステムサウンド数 = (int)Eシステムサウンド.Count; - public CSystemSound this[Eシステムサウンド sound] { + public bool bPlayed; + public bool bCompact対象; + public bool bLoop; + public bool bNotLoadedYet; + public bool bLoadedSuccessfuly; + public bool bExclusive; + public string strFileName = ""; + public bool bIsPlaying { get { - switch (sound) { - case Eシステムサウンド.SOUNDカーソル移動音: - return this.soundカーソル移動音; + if (this.rSound[1 - this.nNextPlayingSoundNumber] == null) + return false; - case Eシステムサウンド.SOUND決定音: - return this.soundDecideSFX; - - case Eシステムサウンド.SOUND変更音: - return this.soundChangeSFX; - - case Eシステムサウンド.SOUND取消音: - return this.soundCancelSFX; - - case Eシステムサウンド.SOUND歓声音: - return this.sound歓声音; - - case Eシステムサウンド.SOUNDステージ失敗音: - return this.soundSTAGEFAILED音; - - case Eシステムサウンド.SOUNDゲーム開始音: - return this.soundゲーム開始音; - - case Eシステムサウンド.SOUNDゲーム終了音: - return this.soundゲーム終了音; - - case Eシステムサウンド.SOUNDステージクリア音: - return this.soundステージクリア音; - - case Eシステムサウンド.SOUNDフルコンボ音: - return this.soundフルコンボ音; - - case Eシステムサウンド.SOUND曲読込開始音: - return this.sound曲読込開始音; - - case Eシステムサウンド.SOUNDタイトル音: - return this.bgmタイトル; - - case Eシステムサウンド.BGM起動画面: - return this.bgm起動画面; - - case Eシステムサウンド.BGMオプション画面: - return this.bgmオプション画面; - - case Eシステムサウンド.BGMコンフィグ画面: - return this.bgmコンフィグ画面; - - case Eシステムサウンド.BGM選曲画面: - return this.bgm選曲画面; - - //case Eシステムサウンド.SOUND赤: - // return this.soundRed; - - //case Eシステムサウンド.SOUND青: - // return this.soundBlue; - - case Eシステムサウンド.SOUND風船: - return this.soundBalloon; - - case Eシステムサウンド.SOUND曲決定音: - return this.sound曲決定音; - - case Eシステムサウンド.SOUND成績発表: - return this.bgmリザルトイン音; - - case Eシステムサウンド.SOUND特訓再生: - return this.sound特訓再生音; - - case Eシステムサウンド.SOUND特訓停止: - return this.sound特訓停止音; - - case Eシステムサウンド.sound特訓ジャンプポイント: - return this.soundTrainingToggleBookmarkSFX; - - case Eシステムサウンド.sound特訓スキップ音: - return this.sound特訓スキップ音; - - case Eシステムサウンド.SOUND特訓スクロール: - return this.soundTrainingModeScrollSFX; - - } - throw new IndexOutOfRangeException(); + return this.rSound[1 - this.nNextPlayingSoundNumber].IsPlaying; } } - public CSystemSound this[int index] { + public int nPosition_CurrentlyPlayingSound { get { - switch (index) { - case 0: - return this.soundカーソル移動音; + CSound sound = this.rSound[1 - this.nNextPlayingSoundNumber]; + if (sound == null) + return 0; - case 1: - return this.soundDecideSFX; - - case 2: - return this.soundChangeSFX; - - case 3: - return this.soundCancelSFX; - - case 4: - return this.sound歓声音; - - case 5: - return this.soundSTAGEFAILED音; - - case 6: - return this.soundゲーム開始音; - - case 7: - return this.soundゲーム終了音; - - case 8: - return this.soundステージクリア音; - - case 9: - return this.soundフルコンボ音; - - case 10: - return this.sound曲読込開始音; - - case 11: - return this.bgmタイトル; - - case 12: - return this.bgm起動画面; - - case 13: - return this.bgmオプション画面; - - case 14: - return this.bgmコンフィグ画面; - - case 15: - return this.bgm選曲画面; - - case 16: - return this.soundBalloon; - - case 17: - return this.sound曲決定音; - - case 18: - return this.bgmリザルトイン音; - - case 19: - return this.sound特訓再生音; - - case 20: - return this.sound特訓停止音; - - case 21: - return this.soundTrainingModeScrollSFX; - - case 22: - return this.soundTrainingToggleBookmarkSFX; - - case 23: - return this.sound特訓スキップ音; - } - throw new IndexOutOfRangeException(); - } - } - - - // スキンの切り替えについて___ - // - // _スキンの種類は大きく分けて2種類。Systemスキンとboxdefスキン。 - //  前者はSystem/フォルダにユーザーが自らインストールしておくスキン。 - //  後者はbox.defで指定する、曲データ制作者が提示するスキン。 - // - // _Config画面で、2種のスキンを区別無く常時使用するよう設定することができる。 - // _box.defの#SKINPATH 設定により、boxdefスキンを一時的に使用するよう設定する。 - //  (box.defの効果の及ばない他のmuxic boxでは、当該boxdefスキンの有効性が無くなる) - // - // これを実現するために___ - // _Systemスキンの設定情報と、boxdefスキンの設定情報は、分離して持つ。 - //  (strSystem~~ と、strBoxDef~~~) - // _Config画面からは前者のみ書き換えできるようにし、 - //  選曲画面からは後者のみ書き換えできるようにする。(SetCurrent...()) - // _読み出しは両者から行えるようにすると共に - //  選曲画面用に二種の情報を区別しない読み出し方法も提供する(GetCurrent...) - - private object lockBoxDefSkin; - public static bool bUseBoxDefSkin = true; // box.defからのスキン変更を許容するか否か - - public string strSystemSkinRoot = null; - public string[] strSystemSkinSubfolders = null; // ListだとignoreCaseな検索が面倒なので、配列に逃げる :-) - private string[] _strBoxDefSkinSubfolders = null; - public string[] strBoxDefSkinSubfolders { - get { - lock (lockBoxDefSkin) { - return _strBoxDefSkinSubfolders; - } + return sound.SoundPosition; } set { - lock (lockBoxDefSkin) { - _strBoxDefSkinSubfolders = value; + CSound sound = this.rSound[1 - this.nNextPlayingSoundNumber]; + if (sound != null) + sound.SoundPosition = value; + } + } + public int nPosition_NextPlayingSound { + get { + CSound sound = this.rSound[this.nNextPlayingSoundNumber]; + if (sound == null) + return 0; + + return sound.SoundPosition; + } + set { + CSound sound = this.rSound[this.nNextPlayingSoundNumber]; + if (sound != null) + sound.SoundPosition = value; + } + } + public int nAutomationLevel_現在のサウンド { + get { + CSound sound = this.rSound[1 - this.nNextPlayingSoundNumber]; + if (sound == null) + return 0; + + return sound.AutomationLevel; + } + set { + CSound sound = this.rSound[1 - this.nNextPlayingSoundNumber]; + if (sound != null) { + sound.AutomationLevel = value; } } - } // 別スレッドからも書き込みアクセスされるため、スレッドセーフなアクセス法を提供 - - private static string strSystemSkinSubfolderFullName; // Config画面で設定されたスキン - private static string strBoxDefSkinSubfolderFullName = ""; // box.defで指定されているスキン - - /// - /// スキンパス名をフルパスで取得する - /// - /// ユーザー設定用ならtrue, box.defからの設定ならfalse - /// - public string GetCurrentSkinSubfolderFullName(bool bFromUserConfig) { - if (!bUseBoxDefSkin || bFromUserConfig == true || strBoxDefSkinSubfolderFullName == "") { - return strSystemSkinSubfolderFullName; - } else { - return strBoxDefSkinSubfolderFullName; - } - } - /// - /// スキンパス名をフルパスで設定する - /// - /// スキンパス名 - /// ユーザー設定用ならtrue, box.defからの設定ならfalse - public void SetCurrentSkinSubfolderFullName(string value, bool bFromUserConfig) { - if (bFromUserConfig) { - strSystemSkinSubfolderFullName = value; - } else { - strBoxDefSkinSubfolderFullName = value; - } - } - - - // Constructor - public CSkin(string _strSkinSubfolderFullName, bool _bUseBoxDefSkin) { - lockBoxDefSkin = new object(); - strSystemSkinSubfolderFullName = _strSkinSubfolderFullName; - bUseBoxDefSkin = _bUseBoxDefSkin; - InitializeSkinPathRoot(); - ReloadSkinPaths(); - PrepareReloadSkin(); } - public CSkin() { - lockBoxDefSkin = new object(); - InitializeSkinPathRoot(); - bUseBoxDefSkin = true; - ReloadSkinPaths(); - PrepareReloadSkin(); + public int n長さ_現在のサウンド { + get { + CSound sound = this.rSound[1 - this.nNextPlayingSoundNumber]; + if (sound == null) { + return 0; + } + return sound.TotalPlayTime; + } + } + public int n長さ_次に鳴るサウンド { + get { + CSound sound = this.rSound[this.nNextPlayingSoundNumber]; + if (sound == null) { + return 0; + } + return sound.TotalPlayTime; + } } - private string InitializeSkinPathRoot() { - strSystemSkinRoot = System.IO.Path.Combine(OpenTaiko.strEXEのあるフォルダ, "System" + System.IO.Path.DirectorySeparatorChar); - return strSystemSkinRoot; - } - - /// - /// Skin(Sounds)を再読込する準備をする(再生停止,Dispose,ファイル名再設定)。 - /// あらかじめstrSkinSubfolderを適切に設定しておくこと。 - /// その後、ReloadSkinPaths()を実行し、strSkinSubfolderの正当性を確認した上で、本メソッドを呼び出すこと。 - /// 本メソッド呼び出し後に、ReloadSkin()を実行することで、システムサウンドを読み込み直す。 - /// ReloadSkin()の内容は本メソッド内に含めないこと。起動時はReloadSkin()相当の処理をCEnumSongsで行っているため。 - /// - public void PrepareReloadSkin() { - Trace.TraceInformation("SkinPath設定: {0}", - (strBoxDefSkinSubfolderFullName == "") ? - strSystemSkinSubfolderFullName : - strBoxDefSkinSubfolderFullName - ); - for (int i = 0; i < nシステムサウンド数; i++) { - if (this[i] != null && this[i].bLoadedSuccessfuly) { - this[i].tStop(); - this[i].Dispose(); + + /// + /// コンストラクタ + /// + /// + /// + /// + /// + public CSystemSound(string strFileName, bool bLoop, bool bExclusive, bool bCompact対象, ESoundGroup soundGroup) { + this.strFileName = strFileName; + this.bLoop = bLoop; + this.bExclusive = bExclusive; + this.bCompact対象 = bCompact対象; + _soundGroup = soundGroup; + this.bNotLoadedYet = true; + this.bPlayed = false; + } + + + // メソッド + + public void tLoading() { + this.bNotLoadedYet = false; + this.bLoadedSuccessfuly = false; + if (string.IsNullOrEmpty(this.strFileName)) + throw new InvalidOperationException("ファイル名が無効です。"); + + if (!File.Exists(CSkin.Path(this.strFileName))) { + Trace.TraceWarning($"ファイルが存在しません。: {this.strFileName}"); + return; + } + + for (int i = 0; i < 2; i++) // 一旦Cloneを止めてASIO対応に専念 + { + try { + this.rSound[i] = OpenTaiko.SoundManager?.tCreateSound(CSkin.Path(this.strFileName), _soundGroup); + } catch { + this.rSound[i] = null; + throw; } } - - this.soundカーソル移動音 = new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}Move.ogg", false, false, false, ESoundGroup.SoundEffect); - this.soundDecideSFX = new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}Decide.ogg", false, false, false, ESoundGroup.SoundEffect); - this.soundChangeSFX = new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}Change.ogg", false, false, false, ESoundGroup.SoundEffect); - this.soundCancelSFX = new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}Cancel.ogg", false, false, true, ESoundGroup.SoundEffect); - this.sound歓声音 = new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}Audience.ogg", false, false, true, ESoundGroup.SoundEffect); - this.soundSTAGEFAILED音 = new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}Stage failed.ogg", false, true, true, ESoundGroup.Voice); - this.soundゲーム開始音 = new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}Game start.ogg", false, false, false, ESoundGroup.Voice); - this.soundゲーム終了音 = new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}Game end.ogg", false, true, false, ESoundGroup.Voice); - this.soundステージクリア音 = new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}Stage clear.ogg", false, true, true, ESoundGroup.Voice); - this.soundフルコンボ音 = new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}Full combo.ogg", false, false, true, ESoundGroup.Voice); - this.sound曲読込開始音 = new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}Now loading.ogg", false, true, true, ESoundGroup.Unknown); - //this.bgm選曲画面 = new Cシステムサウンド(@$"Sounds{System.IO.Path.DirectorySeparatorChar}Select BGM.ogg", true, true, false, ESoundGroup.SongPlayback); - //this.soundSongSelectChara = new Cシステムサウンド(@$"Sounds{System.IO.Path.DirectorySeparatorChar}SongSelect Chara.ogg", false, false, false, ESoundGroup.SongPlayback); - this.soundSkip = new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}Skip.ogg", false, false, false, ESoundGroup.SoundEffect); - this.SoundBanapas = new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}Banapas.ogg", false, false, false, ESoundGroup.SoundEffect); - this.soundEntry = new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}Entry.ogg", true, false, false, ESoundGroup.Voice); - this.soundError = new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}Error.ogg", false, false, false, ESoundGroup.SoundEffect); - //this.soundsanka = new Cシステムサウンド(@$"Sounds{System.IO.Path.DirectorySeparatorChar}sanka.ogg", false, false, false, ESoundGroup.Voice); - this.soundBomb = new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}Bomb.ogg", false, false, false, ESoundGroup.SoundEffect); - - //this.soundRed = new Cシステムサウンド( @$"Sounds{System.IO.Path.DirectorySeparatorChar}dong.ogg", false, false, true, ESoundType.SoundEffect ); - //this.soundBlue = new Cシステムサウンド( @$"Sounds{System.IO.Path.DirectorySeparatorChar}ka.ogg", false, false, true, ESoundType.SoundEffect ); - this.soundBalloon = new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}balloon.ogg", false, false, true, ESoundGroup.SoundEffect); - this.soundKusudama = new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}Kusudama.ogg", false, false, true, ESoundGroup.SoundEffect); - this.soundKusudamaMiss = new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}KusudamaMiss.ogg", false, false, true, ESoundGroup.SoundEffect); - this.sound曲決定音 = new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}SongDecide.ogg", false, false, true, ESoundGroup.Voice); - this.soundSongDecide_AI = new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}SongDecide_AI.ogg", false, false, true, ESoundGroup.Voice); - - this.bgm起動画面 = new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}BGM{System.IO.Path.DirectorySeparatorChar}Setup.ogg", true, true, false, ESoundGroup.SongPlayback); - this.bgmタイトルイン = new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}BGM{System.IO.Path.DirectorySeparatorChar}Title_Start.ogg", false, false, true, ESoundGroup.SongPlayback); - this.bgmタイトル = new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}BGM{System.IO.Path.DirectorySeparatorChar}Title.ogg", true, false, true, ESoundGroup.SongPlayback); - this.bgmオプション画面 = new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}BGM{System.IO.Path.DirectorySeparatorChar}Option.ogg", true, true, false, ESoundGroup.SongPlayback); - this.bgmコンフィグ画面 = new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}BGM{System.IO.Path.DirectorySeparatorChar}Config.ogg", true, true, false, ESoundGroup.SongPlayback); - this.bgm選曲画面イン = new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}BGM{System.IO.Path.DirectorySeparatorChar}SongSelect_Start.ogg", false, false, true, ESoundGroup.SongPlayback); - this.bgm選曲画面 = new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}BGM{System.IO.Path.DirectorySeparatorChar}SongSelect.ogg", true, false, true, ESoundGroup.SongPlayback); - this.bgmSongSelect_AI_In = new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}BGM{System.IO.Path.DirectorySeparatorChar}SongSelect_AI_Start.ogg", false, false, true, ESoundGroup.SongPlayback); - this.bgmSongSelect_AI = new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}BGM{System.IO.Path.DirectorySeparatorChar}SongSelect_AI.ogg", true, false, true, ESoundGroup.SongPlayback); - this.bgmリザルトイン音 = new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}BGM{System.IO.Path.DirectorySeparatorChar}Result_In.ogg", false, false, true, ESoundGroup.SongPlayback); - this.bgmリザルト音 = new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}BGM{System.IO.Path.DirectorySeparatorChar}Result.ogg", true, false, true, ESoundGroup.SongPlayback); - this.bgmResultIn_AI = new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}BGM{System.IO.Path.DirectorySeparatorChar}Result_In_AI.ogg", false, false, true, ESoundGroup.SongPlayback); - this.bgmResult_AI = new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}BGM{System.IO.Path.DirectorySeparatorChar}Result_AI.ogg", true, false, true, ESoundGroup.SongPlayback); - - this.bgmDanResult = new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}Dan{System.IO.Path.DirectorySeparatorChar}Dan_Result.ogg", true, false, false, ESoundGroup.SongPlayback); - - this.bgmTowerResult = new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}Tower{System.IO.Path.DirectorySeparatorChar}Tower_Result.ogg", true, false, false, ESoundGroup.SongPlayback); - - this.soundCrownIn = new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}ResultScreen{System.IO.Path.DirectorySeparatorChar}CrownIn.ogg", false, false, false, ESoundGroup.SoundEffect); - this.soundRankIn = new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}ResultScreen{System.IO.Path.DirectorySeparatorChar}RankIn.ogg", false, false, false, ESoundGroup.SoundEffect); - - this.sound特訓再生音 = new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}Resume.ogg", false, false, false, ESoundGroup.SoundEffect); - this.sound特訓停止音 = new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}Pause.ogg", false, false, false, ESoundGroup.SoundEffect); - this.soundTrainingModeScrollSFX = new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}Scroll.ogg", false, false, false, ESoundGroup.SoundEffect); - this.soundTrainingToggleBookmarkSFX = new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}Jump Point.ogg", false, false, false, ESoundGroup.SoundEffect); - this.sound特訓スキップ音 = new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}Traning Skip.ogg", false, false, false, ESoundGroup.SoundEffect); - this.soundPon = new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}Pon.ogg", false, false, false, ESoundGroup.SoundEffect); - this.soundGauge = new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}Gauge.ogg", false, false, false, ESoundGroup.SoundEffect); - this.soundScoreDon = new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}ScoreDon.ogg", false, false, false, ESoundGroup.SoundEffect); - - this.soundDanSongSelectIn = new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}Dan{System.IO.Path.DirectorySeparatorChar}Dan_In.ogg", false, false, false, ESoundGroup.SoundEffect); - - this.soundDanSelectBGM = new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}Dan{System.IO.Path.DirectorySeparatorChar}DanSelectBGM.ogg", true, false, false, ESoundGroup.SongPlayback); - this.soundDanSongSelect = new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}Dan{System.IO.Path.DirectorySeparatorChar}DanSongSelect.ogg", false, false, false, ESoundGroup.SoundEffect); - - this.soundHeyaBGM = new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}Heya{System.IO.Path.DirectorySeparatorChar}BGM.ogg", true, false, false, ESoundGroup.SongPlayback); - this.soundOnlineLoungeBGM = new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}OnlineLounge{System.IO.Path.DirectorySeparatorChar}BGM.ogg", true, false, false, ESoundGroup.SongPlayback); - this.soundEncyclopediaBGM = new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}Encyclopedia{System.IO.Path.DirectorySeparatorChar}BGM.ogg", true, false, false, ESoundGroup.SongPlayback); - this.soundTowerSelectBGM = new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}Tower{System.IO.Path.DirectorySeparatorChar}BGM.ogg", true, false, false, ESoundGroup.SongPlayback); - - soundExToExtra = new CSystemSound[1] { new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}SongSelect{System.IO.Path.DirectorySeparatorChar}0{System.IO.Path.DirectorySeparatorChar}ExToExtra.ogg", false, false, false, ESoundGroup.SoundEffect) }; // Placeholder until Komi decides - soundExtraToEx = new CSystemSound[1] { new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}SongSelect{System.IO.Path.DirectorySeparatorChar}0{System.IO.Path.DirectorySeparatorChar}ExtraToEx.ogg", false, false, false, ESoundGroup.SoundEffect) }; // what to do with it lol - - calibrationTick = new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}Calibrate.ogg", false, false, false, ESoundGroup.SoundEffect); - - soundModal = new CSystemSound[6]; - for (int i = 0; i < soundModal.Length - 1; i++) { - soundModal[i] = new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}Modals{System.IO.Path.DirectorySeparatorChar}" + i.ToString() + ".ogg", false, false, false, ESoundGroup.SoundEffect); + this.bLoadedSuccessfuly = true; + } + public void tPlay() { + if (this.bNotLoadedYet) { + try { + tLoading(); + } catch (Exception e) { + Trace.TraceError(e.ToString()); + Trace.TraceError("例外が発生しましたが処理を継続します。 (17668977-4686-4aa7-b3f0-e0b9a44975b8)"); + this.bNotLoadedYet = false; + } } - soundModal[soundModal.Length - 1] = new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}Modals{System.IO.Path.DirectorySeparatorChar}Coin.ogg", false, false, false, ESoundGroup.SoundEffect); + if (this.bExclusive) { + if (r最後に再生した排他システムサウンド != null) + r最後に再生した排他システムサウンド.tStop(); - ReloadSkin(); - tReadSkinConfig(); - - //hsHitSoundsInformations = new CHitSounds(Path(@$"Sounds{System.IO.Path.DirectorySeparatorChar}HitSounds{System.IO.Path.DirectorySeparatorChar}HitSounds.json")); - hsHitSoundsInformations = new CHitSounds(@$"Global{System.IO.Path.DirectorySeparatorChar}HitSounds{System.IO.Path.DirectorySeparatorChar}HitSounds.json"); + r最後に再生した排他システムサウンド = this; + } + CSound sound = this.rSound[this.nNextPlayingSoundNumber]; + if (sound != null) + sound.PlayStart(this.bLoop); + + this.bPlayed = true; + this.nNextPlayingSoundNumber = 1 - this.nNextPlayingSoundNumber; + } + public void tStop() { + this.bPlayed = false; + if (this.rSound[0] != null) + this.rSound[0].Stop(); + + if (this.rSound[1] != null) + this.rSound[1].Stop(); + + if (r最後に再生した排他システムサウンド == this) + r最後に再生した排他システムサウンド = null; } - public void ReloadSkin() { - for (int i = 0; i < nシステムサウンド数; i++) { - if (!this[i].bExclusive) // BGM系以外のみ読み込む。(BGM系は必要になったときに読み込む) - { - CSystemSound cシステムサウンド = this[i]; - if (cシステムサウンド.bCompact対象) { - try { - cシステムサウンド.tLoading(); - Trace.TraceInformation("システムサウンドを読み込みました。({0})", cシステムサウンド.strFileName); - } catch (FileNotFoundException e) { - Trace.TraceWarning(e.ToString()); - Trace.TraceWarning("システムサウンドが存在しません。({0})", cシステムサウンド.strFileName); - } catch (Exception e) { - Trace.TraceWarning(e.ToString()); - Trace.TraceWarning("システムサウンドの読み込みに失敗しました。({0})", cシステムサウンド.strFileName); - } + public void tRemoveMixer() { + if (OpenTaiko.SoundManager.GetCurrentSoundDeviceType() != "DirectShow") { + for (int i = 0; i < 2; i++) { + if (this.rSound[i] != null) { + OpenTaiko.SoundManager.RemoveMixer(this.rSound[i]); } } } - } - - - /// - /// Skinの一覧を再取得する。 - /// System/*****/Graphics (やSounds/) というフォルダ構成を想定している。 - /// もし再取得の結果、現在使用中のSkinのパス(strSystemSkinSubfloderFullName)が消えていた場合は、 - /// 以下の優先順位で存在確認の上strSystemSkinSubfolderFullNameを再設定する。 + } + + #region [ IDisposable 実装 ] + //----------------- + public void Dispose() { + if (!this.bDisposed) { + for (int i = 0; i < 2; i++) { + if (this.rSound[i] != null) { + OpenTaiko.SoundManager.tDisposeSound(this.rSound[i]); + this.rSound[i] = null; + } + } + this.bLoadedSuccessfuly = false; + this.bDisposed = true; + } + } + //----------------- + #endregion + + #region [ private ] + //----------------- + private bool bDisposed; + private int nNextPlayingSoundNumber; + private CSound[] rSound = new CSound[2]; + //----------------- + #endregion + } + + + // Properties + + // Hitsounds + + public CHitSounds hsHitSoundsInformations = null; + + // Character specific voice samples + + // Sounds{System.IO.Path.DirectorySeparatorChar}Clear + + public CSystemSound[] voiceClearFailed = new CSystemSound[5]; + public CSystemSound[] voiceClearClear = new CSystemSound[5]; + public CSystemSound[] voiceClearFullCombo = new CSystemSound[5]; + public CSystemSound[] voiceClearAllPerfect = new CSystemSound[5]; + public CSystemSound[] voiceAIWin = new CSystemSound[5]; + public CSystemSound[] voiceAILose = new CSystemSound[5]; + + // Sounds{System.IO.Path.DirectorySeparatorChar}Menu + + public CSystemSound[] voiceMenuSongSelect = new CSystemSound[5]; + public CSystemSound[] voiceMenuSongDecide = new CSystemSound[5]; + public CSystemSound[] voiceMenuSongDecide_AI = new CSystemSound[5]; + public CSystemSound[] voiceMenuDiffSelect = new CSystemSound[5]; + public CSystemSound[] voiceMenuDanSelectStart = new CSystemSound[5]; + public CSystemSound[] voiceMenuDanSelectPrompt = new CSystemSound[5]; + public CSystemSound[] voiceMenuDanSelectConfirm = new CSystemSound[5]; + + // Sounds{System.IO.Path.DirectorySeparatorChar}Title + + public CSystemSound[] voiceTitleSanka = new CSystemSound[5]; + + // Sounds{System.IO.Path.DirectorySeparatorChar}Tower + + public CSystemSound[] voiceTowerMiss = new CSystemSound[5]; + + // Sounds{System.IO.Path.DirectorySeparatorChar}Result + + public CSystemSound[] voiceResultBestScore = new CSystemSound[5]; + public CSystemSound[] voiceResultClearFailed = new CSystemSound[5]; + public CSystemSound[] voiceResultClearSuccess = new CSystemSound[5]; + public CSystemSound[] voiceResultDanFailed = new CSystemSound[5]; + public CSystemSound[] voiceResultDanRedPass = new CSystemSound[5]; + public CSystemSound[] voiceResultDanGoldPass = new CSystemSound[5]; + + // General sound effects (Skin specific) + + public CSystemSound bgmオプション画面 = null; + public CSystemSound bgmコンフィグ画面 = null; + public CSystemSound bgm起動画面 = null; + public CSystemSound soundSTAGEFAILED音 = null; + public CSystemSound soundカーソル移動音 = null; + public CSystemSound soundゲーム開始音 = null; + public CSystemSound soundゲーム終了音 = null; + public CSystemSound soundステージクリア音 = null; + public CSystemSound soundフルコンボ音 = null; + public CSystemSound sound歓声音 = null; + public CSystemSound sound曲読込開始音 = null; + public CSystemSound soundDecideSFX = null; + public CSystemSound soundCancelSFX = null; + public CSystemSound soundChangeSFX = null; + public CSystemSound soundSongSelectChara = null; + public CSystemSound soundSkip = null; + public CSystemSound soundEntry = null; + public CSystemSound soundError = null; + public CSystemSound soundsanka = null; + public CSystemSound soundBomb = null; + //add + public CSystemSound sound曲決定音 = null; + public CSystemSound soundSongDecide_AI = null; + public CSystemSound bgmリザルトイン音 = null; + public CSystemSound bgmリザルト音 = null; + public CSystemSound bgmResultIn_AI = null; + public CSystemSound bgmResult_AI = null; + + public CSystemSound bgmDanResult = null; + + public CSystemSound bgmタイトル = null; + public CSystemSound bgmタイトルイン = null; + public CSystemSound bgm選曲画面 = null; + public CSystemSound bgm選曲画面イン = null; + public CSystemSound bgmSongSelect_AI = null; + public CSystemSound bgmSongSelect_AI_In = null; + public CSystemSound bgmリザルト = null; + public CSystemSound bgmリザルトイン = null; + + public CSystemSound SoundBanapas = null; + + public CSystemSound sound特訓再生音 = null; + public CSystemSound sound特訓停止音 = null; + public CSystemSound soundTrainingToggleBookmarkSFX = null; + public CSystemSound sound特訓スキップ音 = null; + public CSystemSound soundTrainingModeScrollSFX = null; + public CSystemSound soundPon = null; + public CSystemSound soundGauge = null; + public CSystemSound soundScoreDon = null; + public CSystemSound soundChallengeVoice = null; + public CSystemSound soundDanSelectStart = null; + public CSystemSound soundDanSongSelectCheck = null; + + public CSystemSound soundDanSongSelectIn = null; + + public CSystemSound soundDanSelectBGM = null; + public CSystemSound soundDanSongSelect = null; + + public CSystemSound soundHeyaBGM = null; + public CSystemSound soundOnlineLoungeBGM = null; + public CSystemSound soundEncyclopediaBGM = null; + public CSystemSound soundTowerSelectBGM = null; + + public CSystemSound[] soundExToExtra = null; + public CSystemSound[] soundExtraToEx = null; + + public CSystemSound calibrationTick = null; + + public CSystemSound[] soundModal = null; + + public CSystemSound soundCrownIn = null; + public CSystemSound soundRankIn = null; + + public CSystemSound soundSelectAnnounce = null; + + // Tower Sfx + public CSystemSound soundTowerMiss = null; + public CSystemSound bgmTowerResult = null; + + //public Cシステムサウンド soundRed = null; + //public Cシステムサウンド soundBlue = null; + public CSystemSound soundBalloon = null; + public CSystemSound soundKusudama = null; + public CSystemSound soundKusudamaMiss = null; + + + public readonly int nシステムサウンド数 = (int)Eシステムサウンド.Count; + public CSystemSound this[Eシステムサウンド sound] { + get { + switch (sound) { + case Eシステムサウンド.SOUNDカーソル移動音: + return this.soundカーソル移動音; + + case Eシステムサウンド.SOUND決定音: + return this.soundDecideSFX; + + case Eシステムサウンド.SOUND変更音: + return this.soundChangeSFX; + + case Eシステムサウンド.SOUND取消音: + return this.soundCancelSFX; + + case Eシステムサウンド.SOUND歓声音: + return this.sound歓声音; + + case Eシステムサウンド.SOUNDステージ失敗音: + return this.soundSTAGEFAILED音; + + case Eシステムサウンド.SOUNDゲーム開始音: + return this.soundゲーム開始音; + + case Eシステムサウンド.SOUNDゲーム終了音: + return this.soundゲーム終了音; + + case Eシステムサウンド.SOUNDステージクリア音: + return this.soundステージクリア音; + + case Eシステムサウンド.SOUNDフルコンボ音: + return this.soundフルコンボ音; + + case Eシステムサウンド.SOUND曲読込開始音: + return this.sound曲読込開始音; + + case Eシステムサウンド.SOUNDタイトル音: + return this.bgmタイトル; + + case Eシステムサウンド.BGM起動画面: + return this.bgm起動画面; + + case Eシステムサウンド.BGMオプション画面: + return this.bgmオプション画面; + + case Eシステムサウンド.BGMコンフィグ画面: + return this.bgmコンフィグ画面; + + case Eシステムサウンド.BGM選曲画面: + return this.bgm選曲画面; + + //case Eシステムサウンド.SOUND赤: + // return this.soundRed; + + //case Eシステムサウンド.SOUND青: + // return this.soundBlue; + + case Eシステムサウンド.SOUND風船: + return this.soundBalloon; + + case Eシステムサウンド.SOUND曲決定音: + return this.sound曲決定音; + + case Eシステムサウンド.SOUND成績発表: + return this.bgmリザルトイン音; + + case Eシステムサウンド.SOUND特訓再生: + return this.sound特訓再生音; + + case Eシステムサウンド.SOUND特訓停止: + return this.sound特訓停止音; + + case Eシステムサウンド.sound特訓ジャンプポイント: + return this.soundTrainingToggleBookmarkSFX; + + case Eシステムサウンド.sound特訓スキップ音: + return this.sound特訓スキップ音; + + case Eシステムサウンド.SOUND特訓スクロール: + return this.soundTrainingModeScrollSFX; + + } + throw new IndexOutOfRangeException(); + } + } + public CSystemSound this[int index] { + get { + switch (index) { + case 0: + return this.soundカーソル移動音; + + case 1: + return this.soundDecideSFX; + + case 2: + return this.soundChangeSFX; + + case 3: + return this.soundCancelSFX; + + case 4: + return this.sound歓声音; + + case 5: + return this.soundSTAGEFAILED音; + + case 6: + return this.soundゲーム開始音; + + case 7: + return this.soundゲーム終了音; + + case 8: + return this.soundステージクリア音; + + case 9: + return this.soundフルコンボ音; + + case 10: + return this.sound曲読込開始音; + + case 11: + return this.bgmタイトル; + + case 12: + return this.bgm起動画面; + + case 13: + return this.bgmオプション画面; + + case 14: + return this.bgmコンフィグ画面; + + case 15: + return this.bgm選曲画面; + + case 16: + return this.soundBalloon; + + case 17: + return this.sound曲決定音; + + case 18: + return this.bgmリザルトイン音; + + case 19: + return this.sound特訓再生音; + + case 20: + return this.sound特訓停止音; + + case 21: + return this.soundTrainingModeScrollSFX; + + case 22: + return this.soundTrainingToggleBookmarkSFX; + + case 23: + return this.sound特訓スキップ音; + } + throw new IndexOutOfRangeException(); + } + } + + + // スキンの切り替えについて___ + // + // _スキンの種類は大きく分けて2種類。Systemスキンとboxdefスキン。 + //  前者はSystem/フォルダにユーザーが自らインストールしておくスキン。 + //  後者はbox.defで指定する、曲データ制作者が提示するスキン。 + // + // _Config画面で、2種のスキンを区別無く常時使用するよう設定することができる。 + // _box.defの#SKINPATH 設定により、boxdefスキンを一時的に使用するよう設定する。 + //  (box.defの効果の及ばない他のmuxic boxでは、当該boxdefスキンの有効性が無くなる) + // + // これを実現するために___ + // _Systemスキンの設定情報と、boxdefスキンの設定情報は、分離して持つ。 + //  (strSystem~~ と、strBoxDef~~~) + // _Config画面からは前者のみ書き換えできるようにし、 + //  選曲画面からは後者のみ書き換えできるようにする。(SetCurrent...()) + // _読み出しは両者から行えるようにすると共に + //  選曲画面用に二種の情報を区別しない読み出し方法も提供する(GetCurrent...) + + private object lockBoxDefSkin; + public static bool bUseBoxDefSkin = true; // box.defからのスキン変更を許容するか否か + + public string strSystemSkinRoot = null; + public string[] strSystemSkinSubfolders = null; // ListだとignoreCaseな検索が面倒なので、配列に逃げる :-) + private string[] _strBoxDefSkinSubfolders = null; + public string[] strBoxDefSkinSubfolders { + get { + lock (lockBoxDefSkin) { + return _strBoxDefSkinSubfolders; + } + } + set { + lock (lockBoxDefSkin) { + _strBoxDefSkinSubfolders = value; + } + } + } // 別スレッドからも書き込みアクセスされるため、スレッドセーフなアクセス法を提供 + + private static string strSystemSkinSubfolderFullName; // Config画面で設定されたスキン + private static string strBoxDefSkinSubfolderFullName = ""; // box.defで指定されているスキン + + /// + /// スキンパス名をフルパスで取得する + /// + /// ユーザー設定用ならtrue, box.defからの設定ならfalse + /// + public string GetCurrentSkinSubfolderFullName(bool bFromUserConfig) { + if (!bUseBoxDefSkin || bFromUserConfig == true || strBoxDefSkinSubfolderFullName == "") { + return strSystemSkinSubfolderFullName; + } else { + return strBoxDefSkinSubfolderFullName; + } + } + /// + /// スキンパス名をフルパスで設定する + /// + /// スキンパス名 + /// ユーザー設定用ならtrue, box.defからの設定ならfalse + public void SetCurrentSkinSubfolderFullName(string value, bool bFromUserConfig) { + if (bFromUserConfig) { + strSystemSkinSubfolderFullName = value; + } else { + strBoxDefSkinSubfolderFullName = value; + } + } + + + // Constructor + public CSkin(string _strSkinSubfolderFullName, bool _bUseBoxDefSkin) { + lockBoxDefSkin = new object(); + strSystemSkinSubfolderFullName = _strSkinSubfolderFullName; + bUseBoxDefSkin = _bUseBoxDefSkin; + InitializeSkinPathRoot(); + ReloadSkinPaths(); + PrepareReloadSkin(); + } + public CSkin() { + lockBoxDefSkin = new object(); + InitializeSkinPathRoot(); + bUseBoxDefSkin = true; + ReloadSkinPaths(); + PrepareReloadSkin(); + } + private string InitializeSkinPathRoot() { + strSystemSkinRoot = System.IO.Path.Combine(OpenTaiko.strEXEのあるフォルダ, "System" + System.IO.Path.DirectorySeparatorChar); + return strSystemSkinRoot; + } + + /// + /// Skin(Sounds)を再読込する準備をする(再生停止,Dispose,ファイル名再設定)。 + /// あらかじめstrSkinSubfolderを適切に設定しておくこと。 + /// その後、ReloadSkinPaths()を実行し、strSkinSubfolderの正当性を確認した上で、本メソッドを呼び出すこと。 + /// 本メソッド呼び出し後に、ReloadSkin()を実行することで、システムサウンドを読み込み直す。 + /// ReloadSkin()の内容は本メソッド内に含めないこと。起動時はReloadSkin()相当の処理をCEnumSongsで行っているため。 + /// + public void PrepareReloadSkin() { + Trace.TraceInformation("SkinPath設定: {0}", + (strBoxDefSkinSubfolderFullName == "") ? + strSystemSkinSubfolderFullName : + strBoxDefSkinSubfolderFullName + ); + + for (int i = 0; i < nシステムサウンド数; i++) { + if (this[i] != null && this[i].bLoadedSuccessfuly) { + this[i].tStop(); + this[i].Dispose(); + } + } + + this.soundカーソル移動音 = new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}Move.ogg", false, false, false, ESoundGroup.SoundEffect); + this.soundDecideSFX = new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}Decide.ogg", false, false, false, ESoundGroup.SoundEffect); + this.soundChangeSFX = new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}Change.ogg", false, false, false, ESoundGroup.SoundEffect); + this.soundCancelSFX = new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}Cancel.ogg", false, false, true, ESoundGroup.SoundEffect); + this.sound歓声音 = new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}Audience.ogg", false, false, true, ESoundGroup.SoundEffect); + this.soundSTAGEFAILED音 = new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}Stage failed.ogg", false, true, true, ESoundGroup.Voice); + this.soundゲーム開始音 = new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}Game start.ogg", false, false, false, ESoundGroup.Voice); + this.soundゲーム終了音 = new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}Game end.ogg", false, true, false, ESoundGroup.Voice); + this.soundステージクリア音 = new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}Stage clear.ogg", false, true, true, ESoundGroup.Voice); + this.soundフルコンボ音 = new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}Full combo.ogg", false, false, true, ESoundGroup.Voice); + this.sound曲読込開始音 = new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}Now loading.ogg", false, true, true, ESoundGroup.Unknown); + //this.bgm選曲画面 = new Cシステムサウンド(@$"Sounds{System.IO.Path.DirectorySeparatorChar}Select BGM.ogg", true, true, false, ESoundGroup.SongPlayback); + //this.soundSongSelectChara = new Cシステムサウンド(@$"Sounds{System.IO.Path.DirectorySeparatorChar}SongSelect Chara.ogg", false, false, false, ESoundGroup.SongPlayback); + this.soundSkip = new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}Skip.ogg", false, false, false, ESoundGroup.SoundEffect); + this.SoundBanapas = new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}Banapas.ogg", false, false, false, ESoundGroup.SoundEffect); + this.soundEntry = new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}Entry.ogg", true, false, false, ESoundGroup.Voice); + this.soundError = new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}Error.ogg", false, false, false, ESoundGroup.SoundEffect); + //this.soundsanka = new Cシステムサウンド(@$"Sounds{System.IO.Path.DirectorySeparatorChar}sanka.ogg", false, false, false, ESoundGroup.Voice); + this.soundBomb = new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}Bomb.ogg", false, false, false, ESoundGroup.SoundEffect); + + //this.soundRed = new Cシステムサウンド( @$"Sounds{System.IO.Path.DirectorySeparatorChar}dong.ogg", false, false, true, ESoundType.SoundEffect ); + //this.soundBlue = new Cシステムサウンド( @$"Sounds{System.IO.Path.DirectorySeparatorChar}ka.ogg", false, false, true, ESoundType.SoundEffect ); + this.soundBalloon = new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}balloon.ogg", false, false, true, ESoundGroup.SoundEffect); + this.soundKusudama = new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}Kusudama.ogg", false, false, true, ESoundGroup.SoundEffect); + this.soundKusudamaMiss = new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}KusudamaMiss.ogg", false, false, true, ESoundGroup.SoundEffect); + this.sound曲決定音 = new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}SongDecide.ogg", false, false, true, ESoundGroup.Voice); + this.soundSongDecide_AI = new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}SongDecide_AI.ogg", false, false, true, ESoundGroup.Voice); + + this.bgm起動画面 = new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}BGM{System.IO.Path.DirectorySeparatorChar}Setup.ogg", true, true, false, ESoundGroup.SongPlayback); + this.bgmタイトルイン = new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}BGM{System.IO.Path.DirectorySeparatorChar}Title_Start.ogg", false, false, true, ESoundGroup.SongPlayback); + this.bgmタイトル = new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}BGM{System.IO.Path.DirectorySeparatorChar}Title.ogg", true, false, true, ESoundGroup.SongPlayback); + this.bgmオプション画面 = new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}BGM{System.IO.Path.DirectorySeparatorChar}Option.ogg", true, true, false, ESoundGroup.SongPlayback); + this.bgmコンフィグ画面 = new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}BGM{System.IO.Path.DirectorySeparatorChar}Config.ogg", true, true, false, ESoundGroup.SongPlayback); + this.bgm選曲画面イン = new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}BGM{System.IO.Path.DirectorySeparatorChar}SongSelect_Start.ogg", false, false, true, ESoundGroup.SongPlayback); + this.bgm選曲画面 = new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}BGM{System.IO.Path.DirectorySeparatorChar}SongSelect.ogg", true, false, true, ESoundGroup.SongPlayback); + this.bgmSongSelect_AI_In = new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}BGM{System.IO.Path.DirectorySeparatorChar}SongSelect_AI_Start.ogg", false, false, true, ESoundGroup.SongPlayback); + this.bgmSongSelect_AI = new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}BGM{System.IO.Path.DirectorySeparatorChar}SongSelect_AI.ogg", true, false, true, ESoundGroup.SongPlayback); + this.bgmリザルトイン音 = new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}BGM{System.IO.Path.DirectorySeparatorChar}Result_In.ogg", false, false, true, ESoundGroup.SongPlayback); + this.bgmリザルト音 = new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}BGM{System.IO.Path.DirectorySeparatorChar}Result.ogg", true, false, true, ESoundGroup.SongPlayback); + this.bgmResultIn_AI = new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}BGM{System.IO.Path.DirectorySeparatorChar}Result_In_AI.ogg", false, false, true, ESoundGroup.SongPlayback); + this.bgmResult_AI = new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}BGM{System.IO.Path.DirectorySeparatorChar}Result_AI.ogg", true, false, true, ESoundGroup.SongPlayback); + + this.bgmDanResult = new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}Dan{System.IO.Path.DirectorySeparatorChar}Dan_Result.ogg", true, false, false, ESoundGroup.SongPlayback); + + this.bgmTowerResult = new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}Tower{System.IO.Path.DirectorySeparatorChar}Tower_Result.ogg", true, false, false, ESoundGroup.SongPlayback); + + this.soundCrownIn = new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}ResultScreen{System.IO.Path.DirectorySeparatorChar}CrownIn.ogg", false, false, false, ESoundGroup.SoundEffect); + this.soundRankIn = new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}ResultScreen{System.IO.Path.DirectorySeparatorChar}RankIn.ogg", false, false, false, ESoundGroup.SoundEffect); + + this.sound特訓再生音 = new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}Resume.ogg", false, false, false, ESoundGroup.SoundEffect); + this.sound特訓停止音 = new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}Pause.ogg", false, false, false, ESoundGroup.SoundEffect); + this.soundTrainingModeScrollSFX = new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}Scroll.ogg", false, false, false, ESoundGroup.SoundEffect); + this.soundTrainingToggleBookmarkSFX = new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}Jump Point.ogg", false, false, false, ESoundGroup.SoundEffect); + this.sound特訓スキップ音 = new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}Traning Skip.ogg", false, false, false, ESoundGroup.SoundEffect); + this.soundPon = new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}Pon.ogg", false, false, false, ESoundGroup.SoundEffect); + this.soundGauge = new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}Gauge.ogg", false, false, false, ESoundGroup.SoundEffect); + this.soundScoreDon = new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}ScoreDon.ogg", false, false, false, ESoundGroup.SoundEffect); + + this.soundDanSongSelectIn = new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}Dan{System.IO.Path.DirectorySeparatorChar}Dan_In.ogg", false, false, false, ESoundGroup.SoundEffect); + + this.soundDanSelectBGM = new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}Dan{System.IO.Path.DirectorySeparatorChar}DanSelectBGM.ogg", true, false, false, ESoundGroup.SongPlayback); + this.soundDanSongSelect = new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}Dan{System.IO.Path.DirectorySeparatorChar}DanSongSelect.ogg", false, false, false, ESoundGroup.SoundEffect); + + this.soundHeyaBGM = new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}Heya{System.IO.Path.DirectorySeparatorChar}BGM.ogg", true, false, false, ESoundGroup.SongPlayback); + this.soundOnlineLoungeBGM = new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}OnlineLounge{System.IO.Path.DirectorySeparatorChar}BGM.ogg", true, false, false, ESoundGroup.SongPlayback); + this.soundEncyclopediaBGM = new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}Encyclopedia{System.IO.Path.DirectorySeparatorChar}BGM.ogg", true, false, false, ESoundGroup.SongPlayback); + this.soundTowerSelectBGM = new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}Tower{System.IO.Path.DirectorySeparatorChar}BGM.ogg", true, false, false, ESoundGroup.SongPlayback); + + soundExToExtra = new CSystemSound[1] { new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}SongSelect{System.IO.Path.DirectorySeparatorChar}0{System.IO.Path.DirectorySeparatorChar}ExToExtra.ogg", false, false, false, ESoundGroup.SoundEffect) }; // Placeholder until Komi decides + soundExtraToEx = new CSystemSound[1] { new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}SongSelect{System.IO.Path.DirectorySeparatorChar}0{System.IO.Path.DirectorySeparatorChar}ExtraToEx.ogg", false, false, false, ESoundGroup.SoundEffect) }; // what to do with it lol + + calibrationTick = new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}Calibrate.ogg", false, false, false, ESoundGroup.SoundEffect); + + soundModal = new CSystemSound[6]; + for (int i = 0; i < soundModal.Length - 1; i++) { + soundModal[i] = new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}Modals{System.IO.Path.DirectorySeparatorChar}" + i.ToString() + ".ogg", false, false, false, ESoundGroup.SoundEffect); + } + soundModal[soundModal.Length - 1] = new CSystemSound(@$"Sounds{System.IO.Path.DirectorySeparatorChar}Modals{System.IO.Path.DirectorySeparatorChar}Coin.ogg", false, false, false, ESoundGroup.SoundEffect); + + ReloadSkin(); + tReadSkinConfig(); + + //hsHitSoundsInformations = new CHitSounds(Path(@$"Sounds{System.IO.Path.DirectorySeparatorChar}HitSounds{System.IO.Path.DirectorySeparatorChar}HitSounds.json")); + hsHitSoundsInformations = new CHitSounds(@$"Global{System.IO.Path.DirectorySeparatorChar}HitSounds{System.IO.Path.DirectorySeparatorChar}HitSounds.json"); + } + + public void ReloadSkin() { + for (int i = 0; i < nシステムサウンド数; i++) { + if (!this[i].bExclusive) // BGM系以外のみ読み込む。(BGM系は必要になったときに読み込む) + { + CSystemSound cシステムサウンド = this[i]; + if (cシステムサウンド.bCompact対象) { + try { + cシステムサウンド.tLoading(); + Trace.TraceInformation("システムサウンドを読み込みました。({0})", cシステムサウンド.strFileName); + } catch (FileNotFoundException e) { + Trace.TraceWarning(e.ToString()); + Trace.TraceWarning("システムサウンドが存在しません。({0})", cシステムサウンド.strFileName); + } catch (Exception e) { + Trace.TraceWarning(e.ToString()); + Trace.TraceWarning("システムサウンドの読み込みに失敗しました。({0})", cシステムサウンド.strFileName); + } + } + } + } + } + + + /// + /// Skinの一覧を再取得する。 + /// System/*****/Graphics (やSounds/) というフォルダ構成を想定している。 + /// もし再取得の結果、現在使用中のSkinのパス(strSystemSkinSubfloderFullName)が消えていた場合は、 + /// 以下の優先順位で存在確認の上strSystemSkinSubfolderFullNameを再設定する。 + /// 1. System/Default/ + /// 2. System/*****/ で最初にenumerateされたもの + /// 3. System/ (従来互換) + /// + public void ReloadSkinPaths() { + #region [ まず System/*** をenumerateする ] + string[] tempSkinSubfolders = System.IO.Directory.GetDirectories(strSystemSkinRoot, "*"); + strSystemSkinSubfolders = new string[tempSkinSubfolders.Length]; + int size = 0; + for (int i = 0; i < tempSkinSubfolders.Length; i++) { + #region [ 検出したフォルダがスキンフォルダかどうか確認する] + if (!bIsValid(tempSkinSubfolders[i])) + continue; + #endregion + #region [ スキンフォルダと確認できたものを、strSkinSubfoldersに入れる ] + // フォルダ名末尾に必ず{System.IO.Path.DirectorySeparatorChar}をつけておくこと。さもないとConfig読み出し側(必ず{System.IO.Path.DirectorySeparatorChar}をつける)とマッチできない + if (tempSkinSubfolders[i][tempSkinSubfolders[i].Length - 1] != System.IO.Path.DirectorySeparatorChar) { + tempSkinSubfolders[i] += System.IO.Path.DirectorySeparatorChar; + } + strSystemSkinSubfolders[size] = tempSkinSubfolders[i]; + Trace.TraceInformation("SkinPath検出: {0}", strSystemSkinSubfolders[size]); + size++; + #endregion + } + Trace.TraceInformation("SkinPath入力: {0}", strSystemSkinSubfolderFullName); + Array.Resize(ref strSystemSkinSubfolders, size); + Array.Sort(strSystemSkinSubfolders); // BinarySearch実行前にSortが必要 + #endregion + + #region [ 現在のSkinパスがbox.defスキンをCONFIG指定していた場合のために、最初にこれが有効かチェックする。有効ならこれを使う。 ] + if (bIsValid(strSystemSkinSubfolderFullName) && + Array.BinarySearch(strSystemSkinSubfolders, strSystemSkinSubfolderFullName, + StringComparer.InvariantCultureIgnoreCase) < 0) { + strBoxDefSkinSubfolders = new string[1] { strSystemSkinSubfolderFullName }; + return; + } + #endregion + + #region [ 次に、現在のSkinパスが存在するか調べる。あれば終了。] + if (Array.BinarySearch(strSystemSkinSubfolders, strSystemSkinSubfolderFullName, + StringComparer.InvariantCultureIgnoreCase) >= 0) + return; + #endregion + #region [ カレントのSkinパスが消滅しているので、以下で再設定する。] + /// 以下の優先順位で現在使用中のSkinパスを再設定する。 /// 1. System/Default/ /// 2. System/*****/ で最初にenumerateされたもの /// 3. System/ (従来互換) - /// - public void ReloadSkinPaths() { - #region [ まず System/*** をenumerateする ] - string[] tempSkinSubfolders = System.IO.Directory.GetDirectories(strSystemSkinRoot, "*"); - strSystemSkinSubfolders = new string[tempSkinSubfolders.Length]; - int size = 0; - for (int i = 0; i < tempSkinSubfolders.Length; i++) { - #region [ 検出したフォルダがスキンフォルダかどうか確認する] - if (!bIsValid(tempSkinSubfolders[i])) - continue; - #endregion - #region [ スキンフォルダと確認できたものを、strSkinSubfoldersに入れる ] - // フォルダ名末尾に必ず{System.IO.Path.DirectorySeparatorChar}をつけておくこと。さもないとConfig読み出し側(必ず{System.IO.Path.DirectorySeparatorChar}をつける)とマッチできない - if (tempSkinSubfolders[i][tempSkinSubfolders[i].Length - 1] != System.IO.Path.DirectorySeparatorChar) { - tempSkinSubfolders[i] += System.IO.Path.DirectorySeparatorChar; - } - strSystemSkinSubfolders[size] = tempSkinSubfolders[i]; - Trace.TraceInformation("SkinPath検出: {0}", strSystemSkinSubfolders[size]); - size++; - #endregion - } - Trace.TraceInformation("SkinPath入力: {0}", strSystemSkinSubfolderFullName); - Array.Resize(ref strSystemSkinSubfolders, size); - Array.Sort(strSystemSkinSubfolders); // BinarySearch実行前にSortが必要 - #endregion - - #region [ 現在のSkinパスがbox.defスキンをCONFIG指定していた場合のために、最初にこれが有効かチェックする。有効ならこれを使う。 ] - if (bIsValid(strSystemSkinSubfolderFullName) && - Array.BinarySearch(strSystemSkinSubfolders, strSystemSkinSubfolderFullName, - StringComparer.InvariantCultureIgnoreCase) < 0) { - strBoxDefSkinSubfolders = new string[1] { strSystemSkinSubfolderFullName }; - return; - } - #endregion - - #region [ 次に、現在のSkinパスが存在するか調べる。あれば終了。] - if (Array.BinarySearch(strSystemSkinSubfolders, strSystemSkinSubfolderFullName, - StringComparer.InvariantCultureIgnoreCase) >= 0) - return; - #endregion - #region [ カレントのSkinパスが消滅しているので、以下で再設定する。] - /// 以下の優先順位で現在使用中のSkinパスを再設定する。 - /// 1. System/Default/ - /// 2. System/*****/ で最初にenumerateされたもの - /// 3. System/ (従来互換) - #region [ System/Default/ があるなら、そこにカレントSkinパスを設定する] - string tempSkinPath_default = System.IO.Path.Combine(strSystemSkinRoot, "Default" + System.IO.Path.DirectorySeparatorChar); - if (Array.BinarySearch(strSystemSkinSubfolders, tempSkinPath_default, + #region [ System/Default/ があるなら、そこにカレントSkinパスを設定する] + string tempSkinPath_default = System.IO.Path.Combine(strSystemSkinRoot, "Default" + System.IO.Path.DirectorySeparatorChar); + if (Array.BinarySearch(strSystemSkinSubfolders, tempSkinPath_default, StringComparer.InvariantCultureIgnoreCase) >= 0) { - strSystemSkinSubfolderFullName = tempSkinPath_default; - return; - } - #endregion - #region [ System/SkinFiles.*****/ で最初にenumerateされたものを、カレントSkinパスに再設定する ] - if (strSystemSkinSubfolders.Length > 0) { - strSystemSkinSubfolderFullName = strSystemSkinSubfolders[0]; - return; - } - #endregion - #region [ System/ に、カレントSkinパスを再設定する。] - strSystemSkinSubfolderFullName = strSystemSkinRoot; - strSystemSkinSubfolders = new string[1] { strSystemSkinSubfolderFullName }; - #endregion - #endregion - } - - // メソッド - - public static string Path(string strファイルの相対パス) { - if (strBoxDefSkinSubfolderFullName == "" || !bUseBoxDefSkin) { - return System.IO.Path.Combine(strSystemSkinSubfolderFullName, strファイルの相対パス); - } else { - return System.IO.Path.Combine(strBoxDefSkinSubfolderFullName, strファイルの相対パス); - } - } - - /// - /// フルパス名を与えると、スキン名として、ディレクトリ名末尾の要素を返す - /// 例: C:{System.IO.Path.DirectorySeparatorChar}foo{System.IO.Path.DirectorySeparatorChar}bar{System.IO.Path.DirectorySeparatorChar} なら、barを返す - /// - /// スキンが格納されたパス名(フルパス) - /// スキン名 - public static string GetSkinName(string skinPathFullName) { - if (skinPathFullName != null) { - if (skinPathFullName == "") // 「box.defで未定義」用 - skinPathFullName = strSystemSkinSubfolderFullName; - string[] tmp = skinPathFullName.Split(System.IO.Path.DirectorySeparatorChar); - return tmp[tmp.Length - 2]; // ディレクトリ名の最後から2番目の要素がスキン名(最後の要素はnull。元stringの末尾が{System.IO.Path.DirectorySeparatorChar}なので。) - } - return null; + strSystemSkinSubfolderFullName = tempSkinPath_default; + return; } - public static string[] GetSkinName(string[] skinPathFullNames) { - string[] ret = new string[skinPathFullNames.Length]; - for (int i = 0; i < skinPathFullNames.Length; i++) { - ret[i] = GetSkinName(skinPathFullNames[i]); - } - return ret; + #endregion + #region [ System/SkinFiles.*****/ で最初にenumerateされたものを、カレントSkinパスに再設定する ] + if (strSystemSkinSubfolders.Length > 0) { + strSystemSkinSubfolderFullName = strSystemSkinSubfolders[0]; + return; } - - - public string GetSkinSubfolderFullNameFromSkinName(string skinName) { - foreach (string s in strSystemSkinSubfolders) { - if (GetSkinName(s) == skinName) - return s; - } - foreach (string b in strBoxDefSkinSubfolders) { - if (GetSkinName(b) == skinName) - return b; - } - return null; - } - - /// - /// スキンパス名が妥当かどうか - /// (タイトル画像にアクセスできるかどうかで判定する) - /// - /// 妥当性を確認するスキンパス(フルパス) - /// 妥当ならtrue - public bool bIsValid(string skinPathFullName) { - string filePathTitle; - filePathTitle = System.IO.Path.Combine(skinPathFullName, @$"Graphics{System.IO.Path.DirectorySeparatorChar}1_Title{System.IO.Path.DirectorySeparatorChar}Background.png"); - return (File.Exists(filePathTitle)); - } - - - public void tRemoveMixerAll() { - for (int i = 0; i < nシステムサウンド数; i++) { - if (this[i] != null && this[i].bLoadedSuccessfuly) { - this[i].tStop(); - this[i].tRemoveMixer(); - } - } - - } - - /// - /// 変数の初期化 - /// - public void tSkinConfigInit() { - this.eDiffDispMode = EDifficultyDisplayType.ImageOnMTaiko; - this.b現在のステージ数を表示しない = false; - } - - public void LoadSkinConfigFromFile(string path, ref string work) { - if (!File.Exists(Path(path))) return; - using (var streamReader = new StreamReader(Path(path), Encoding.GetEncoding(OpenTaiko.sEncType))) { - while (streamReader.Peek() > -1) // 一行ずつ読み込む。 - { - var nowLine = streamReader.ReadLine(); - if (nowLine.StartsWith("#include")) { - // #include hogehoge.iniにぶち当たった - var includePath = nowLine.Substring("#include ".Length).Trim(); - LoadSkinConfigFromFile(includePath, ref work); // 再帰的に読み込む - } else { - work += nowLine + Environment.NewLine; - } - } - } - } - - public void tReadSkinConfig() { - var str = ""; - LoadSkinConfigFromFile(Path(@$"SkinConfig.ini"), ref str); - this.t文字列から読み込み(str); - - } - - private void t文字列から読み込み(string strAllSettings) // 2011.4.13 yyagi; refactored to make initial KeyConfig easier. - { - string[] delimiter = { "\n" }; - string[] strSingleLine = strAllSettings.Split(delimiter, StringSplitOptions.RemoveEmptyEntries); - foreach (string s in strSingleLine) { - string str = s.Replace('\t', ' ').TrimStart(new char[] { '\t', ' ' }); - if ((str.Length != 0) && (str[0] != ';')) { - try { - string strCommand; - string strParam; - string[] strArray = str.Split(new char[] { '=' }); - if (strArray.Length == 2) { - strCommand = strArray[0].Trim(); - strParam = strArray[1].Trim(); - - #region [Skin Settings] - - void ParseInt32(Action setValue) { - if (int.TryParse(strParam, out var unparsedValue)) { - setValue(unparsedValue); - } else { - Trace.TraceWarning($"SkinConfigの値 {strCommand} は整数値である必要があります。現在の値: {strParam}"); - } - } - switch (strCommand) { - case "Name": { - this.Skin_Name = strParam; - break; - } - case "Version": { - this.Skin_Version = strParam; - break; - } - case "Creator": { - this.Skin_Creator = strParam; - break; - } - case "Resolution": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Resolution[i] = int.Parse(strSplit[i]); - } - break; - } - #endregion - - #region [Background Scroll] - - case "Background_Scroll_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - this.Background_Scroll_Y[i] = int.Parse(strSplit[i]); - } - break; - } - - #endregion - - #region [Taiko Mode] - //----------------------------- - case "ScrollFieldP1Y": { - this.nScrollFieldY[0] = CConversion.StringToInt(strParam, 192); - break; - } - case "ScrollFieldP2Y": { - this.nScrollFieldY[1] = CConversion.StringToInt(strParam, 192); - break; - } - case "SENotesP1Y": { - this.nSENotesY[0] = CConversion.StringToInt(strParam, this.nSENotesY[0]); - break; - } - case "SENotesP2Y": { - this.nSENotesY[1] = CConversion.StringToInt(strParam, this.nSENotesY[1]); - break; - } - case "JudgePointP1Y": { - this.nJudgePointY[0] = CConversion.StringToInt(strParam, this.nJudgePointY[0]); - break; - } - case "JudgePointP2Y": { - this.nJudgePointY[1] = CConversion.StringToInt(strParam, this.nJudgePointY[1]); - break; - } - - case "DiffDispMode": { - this.eDiffDispMode = (EDifficultyDisplayType)CConversion.ParseIntInRange(strParam, 0, 2, (int)this.eDiffDispMode); - break; - } - case "NowStageDisp": { - this.b現在のステージ数を表示しない = CConversion.bONorOFF(strParam[0]); - break; - } - - //----------------------------- - #endregion - - #region [Result screen] - //----------------------------- - case "ResultPanelP1X": { - this.nResultPanelP1X = CConversion.StringToInt(strParam, 515); - break; - } - case "ResultPanelP1Y": { - this.nResultPanelP1Y = CConversion.StringToInt(strParam, 75); - break; - } - case "ResultPanelP2X": { - this.nResultPanelP2X = CConversion.StringToInt(strParam, 515); - break; - } - case "ResultPanelP2Y": { - this.nResultPanelP2Y = CConversion.StringToInt(strParam, 75); - break; - } - case "ResultScoreP1X": { - this.nResultScoreP1X = CConversion.StringToInt(strParam, 582); - break; - } - case "ResultScoreP1Y": { - this.nResultScoreP1Y = CConversion.StringToInt(strParam, 252); - break; - } - //----------------------------- - #endregion - - - #region 新・SkinConfig - - #region Startup - case nameof(StartUp_LangSelect_FontSize): { - StartUp_LangSelect_FontSize = int.Parse(strParam); - break; - } - #endregion - - #region Title - case nameof(Title_LoadingPinInstances): { - Title_LoadingPinInstances = int.Parse(strParam); - break; - } - case nameof(Title_LoadingPinFrameCount): { - Title_LoadingPinFrameCount = int.Parse(strParam); - break; - } - case nameof(Title_LoadingPinCycle): { - Title_LoadingPinCycle = int.Parse(strParam); - break; - } - case "Title_LoadingPinBase": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Title_LoadingPinBase[i] = int.Parse(strSplit[i]); - } - break; - } - case "Title_LoadingPinDiff": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Title_LoadingPinDiff[i] = int.Parse(strSplit[i]); - } - break; - } - case "Title_Entry_Bar_Text_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Title_Entry_Bar_Text_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "Title_Entry_Bar_Text_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Title_Entry_Bar_Text_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "Title_Banapas_Load_Clear_Anime": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Title_Banapas_Load_Clear_Anime[i] = int.Parse(strSplit[i]); - } - break; - } - case "Title_Entry_Player_Select_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 3; i++) { - Title_Entry_Player_Select_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "Title_Entry_Player_Select_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 3; i++) { - Title_Entry_Player_Select_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "Title_Entry_Player_Select_Rect_0_Side": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 4; i++) { - Title_Entry_Player_Select_Rect[0][0][i] = int.Parse(strSplit[i]); - } - break; - } - case "Title_Entry_Player_Select_Rect_0_Center": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 4; i++) { - Title_Entry_Player_Select_Rect[0][1][i] = int.Parse(strSplit[i]); - } - break; - } - case "Title_Entry_Player_Select_Rect_1_Side": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 4; i++) { - Title_Entry_Player_Select_Rect[1][0][i] = int.Parse(strSplit[i]); - } - break; - } - case "Title_Entry_Player_Select_Rect_1_Center": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 4; i++) { - Title_Entry_Player_Select_Rect[1][1][i] = int.Parse(strSplit[i]); - } - break; - } - case "Title_Entry_Player_Select_Rect_2_Side": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 4; i++) { - Title_Entry_Player_Select_Rect[2][0][i] = int.Parse(strSplit[i]); - } - break; - } - case "Title_Entry_Player_Select_Rect_2_Center": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 4; i++) { - Title_Entry_Player_Select_Rect[2][1][i] = int.Parse(strSplit[i]); - } - break; - } - case "Title_Entry_NamePlate": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Title_Entry_NamePlate[i] = int.Parse(strSplit[i]); - } - break; - } - case "Title_ModeSelect_Bar_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 3; i++) { - Title_ModeSelect_Bar_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "Title_ModeSelect_Bar_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 3; i++) { - Title_ModeSelect_Bar_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "Title_ModeSelect_Bar_Offset": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Title_ModeSelect_Bar_Offset[i] = int.Parse(strSplit[i]); - } - break; - } - case "Title_ModeSelect_Title_Offset": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Title_ModeSelect_Title_Offset[i] = int.Parse(strSplit[i]); - } - break; - } - case "Title_ModeSelect_Title_Scale": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Title_ModeSelect_Title_Scale[i] = int.Parse(strSplit[i]); - } - break; - } - case "Title_ModeSelect_Bar_Center_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 3; i++) { - Title_ModeSelect_Bar_Center_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "Title_ModeSelect_Bar_Center_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 3; i++) { - Title_ModeSelect_Bar_Center_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "Title_ModeSelect_Bar_Center_Rect_Up": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 4; i++) { - Title_ModeSelect_Bar_Center_Rect[0][i] = int.Parse(strSplit[i]); - } - break; - } - case "Title_ModeSelect_Bar_Center_Rect_Down": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 4; i++) { - Title_ModeSelect_Bar_Center_Rect[1][i] = int.Parse(strSplit[i]); - } - break; - } - case "Title_ModeSelect_Bar_Center_Rect_Center": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 4; i++) { - Title_ModeSelect_Bar_Center_Rect[2][i] = int.Parse(strSplit[i]); - } - break; - } - - - - - case "Title_ModeSelect_Bar_Overlay_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 3; i++) { - Title_ModeSelect_Bar_Overlay_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "Title_ModeSelect_Bar_Overlay_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 3; i++) { - Title_ModeSelect_Bar_Overlay_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "Title_ModeSelect_Bar_Overlay_Rect_Up": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 4; i++) { - Title_ModeSelect_Bar_Overlay_Rect[0][i] = int.Parse(strSplit[i]); - } - break; - } - case "Title_ModeSelect_Bar_Overlay_Rect_Down": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 4; i++) { - Title_ModeSelect_Bar_Overlay_Rect[1][i] = int.Parse(strSplit[i]); - } - break; - } - case "Title_ModeSelect_Bar_Overlay_Rect_Center": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 4; i++) { - Title_ModeSelect_Bar_Overlay_Rect[2][i] = int.Parse(strSplit[i]); - } - break; - } - case "Title_ModeSelect_Bar_Move": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Title_ModeSelect_Bar_Move[i] = int.Parse(strSplit[i]); - } - break; - } - case "Title_ModeSelect_Bar_Move_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Title_ModeSelect_Bar_Move_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "Title_ModeSelect_Overlay_Move": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Title_ModeSelect_Overlay_Move[i] = int.Parse(strSplit[i]); - } - break; - } - case "Title_ModeSelect_Overlay_Move_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Title_ModeSelect_Overlay_Move_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "Title_ModeSelect_Bar_Chara_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Title_ModeSelect_Bar_Chara_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "Title_ModeSelect_Bar_Chara_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Title_ModeSelect_Bar_Chara_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "Title_ModeSelect_Bar_Chara_Move": { - Title_ModeSelect_Bar_Chara_Move = int.Parse(strParam); - break; - } - case "Title_ModeSelect_Bar_Center_Title": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Title_ModeSelect_Bar_Center_Title[i] = int.Parse(strSplit[i]); - } - break; - } - case "Title_ModeSelect_Bar_Center_Title_Move": { - Title_ModeSelect_Bar_Center_Title_Move = int.Parse(strParam); - break; - } - case "Title_ModeSelect_Bar_Center_Title_Move_X": { - Title_ModeSelect_Bar_Center_Title_Move_X = int.Parse(strParam); - break; - } - case "Title_ModeSelect_Bar_Center_BoxText": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Title_ModeSelect_Bar_Center_BoxText[i] = int.Parse(strSplit[i]); - } - break; - } - case "Title_VerticalText": { - Title_VerticalText = CConversion.bONorOFF(strParam[0]); - break; - } - case "Title_VerticalBar": { - Title_VerticalBar = CConversion.bONorOFF(strParam[0]); - break; - } - #endregion - - #region Config - case "Config_Arrow_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Config_Arrow_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "Config_Arrow_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Config_Arrow_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "Config_Arrow_Focus_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Config_Arrow_Focus_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "Config_Arrow_Focus_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Config_Arrow_Focus_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "Config_Item_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 3; i++) { - Config_Item_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "Config_Item_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 3; i++) { - Config_Item_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "Config_Item_Width": { - Config_Item_Width = int.Parse(strParam); - break; - } - case "Config_Item_Font_Offset": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Config_Item_Font_Offset[i] = int.Parse(strSplit[i]); - } - break; - } - case "Config_Font_Scale": { - Config_Font_Scale = int.Parse(strParam); - break; - } - case "Config_Selected_Menu_Text_Grad_Color_1": { - Config_Selected_Menu_Text_Grad_Color_1 = ColorTranslator.FromHtml(strParam); - break; - } - case "Config_Selected_Menu_Text_Grad_Color_2": { - Config_Selected_Menu_Text_Grad_Color_2 = ColorTranslator.FromHtml(strParam); - break; - } - case "Config_Font_Scale_Description": { - Config_Font_Scale_Description = float.Parse(strParam); - break; - } - case "Config_ItemBox_Count": { - Config_ItemBox_Count = int.Parse(strParam); - break; - } - case "Config_ItemBox_X": { - Config_ItemBox_X = new int[Config_ItemBox_Count]; - - string[] strSplit = strParam.Split(','); - for (int i = 0; i < Config_ItemBox_Count; i++) { - Config_ItemBox_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "Config_ItemBox_Y": { - Config_ItemBox_Y = new int[Config_ItemBox_Count]; - - string[] strSplit = strParam.Split(','); - for (int i = 0; i < Config_ItemBox_Count; i++) { - Config_ItemBox_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "Config_ItemBox_Font_Offset": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Config_ItemBox_Font_Offset[i] = int.Parse(strSplit[i]); - } - break; - } - case "Config_ItemBox_ItemValue_Font_Offset": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Config_ItemBox_ItemValue_Font_Offset[i] = int.Parse(strSplit[i]); - } - break; - } - case "Config_ExplanationPanel": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Config_ExplanationPanel[i] = int.Parse(strSplit[i]); - } - break; - } - case "Config_SkinSample1": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Config_SkinSample1[i] = int.Parse(strSplit[i]); - } - break; - } - case "Config_KeyAssign": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Config_KeyAssign[i] = int.Parse(strSplit[i]); - } - break; - } - case "Config_KeyAssign_Menu_Highlight": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Config_KeyAssign_Menu_Highlight[i] = int.Parse(strSplit[i]); - } - break; - } - case "Config_KeyAssign_Font": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Config_KeyAssign_Font[i] = int.Parse(strSplit[i]); - } - break; - } - case "Config_KeyAssign_Move": { - Config_KeyAssign_Move = int.Parse(strParam); - break; - } - case nameof(Config_Calibration_OffsetText): { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Config_Calibration_OffsetText[i] = int.Parse(strSplit[i]); - } - break; - } - case nameof(Config_Calibration_InfoText): { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Config_Calibration_InfoText[i] = int.Parse(strSplit[i]); - } - break; - } - case nameof(Config_Calibration_Highlights): { - string[] strSplit = strParam.Split(','); - int recs = Math.Min(strSplit.Length, 12); - for (int i = 0; i + 3 < recs; i += 4) { - Config_Calibration_Highlights[i / 4] = new Rectangle(int.Parse(strSplit[i]), int.Parse(strSplit[i + 1]), int.Parse(strSplit[i + 2]), int.Parse(strSplit[i + 3])); - } - break; - } - #endregion - - #region [Mod Icons] - - - /* - * public int[] ModIcons_OffsetX = { 0, 30, 60, 90, 0, 30, 60, 90 }; - public int[] ModIcons_OffsetY = { 0, 0, 0, 0, 30, 30, 30, 30 }; - public int[] ModIcons_OffsetX_Menu = { 0, 30, 60, 90, 120, 150, 180, 210 }; - public int[] ModIcons_OffsetY_Menu = { 0, 0, 0, 0, 0, 0, 0, 0 }; - */ - - case "ModIcons_OffsetX": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 8; i++) { - ModIcons_OffsetX[i] = int.Parse(strSplit[i]); - } - break; - } - case "ModIcons_OffsetY": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 8; i++) { - ModIcons_OffsetY[i] = int.Parse(strSplit[i]); - } - break; - } - case "ModIcons_OffsetX_Menu": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 8; i++) { - ModIcons_OffsetX_Menu[i] = int.Parse(strSplit[i]); - } - break; - } - case "ModIcons_OffsetY_Menu": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 8; i++) { - ModIcons_OffsetY_Menu[i] = int.Parse(strSplit[i]); - } - break; - } - - #endregion - - #region SongSelect - case "SongSelect_BoxExplanation_X": { - SongSelect_BoxExplanation_X = int.Parse(strParam); - break; - } - case "SongSelect_BoxExplanation_Y": { - SongSelect_BoxExplanation_Y = int.Parse(strParam); - break; - } - case "SongSelect_BoxExplanation_Interval": { - SongSelect_BoxExplanation_Interval = int.Parse(strParam); - break; - } - case "SongSelect_GenreName": { - SongSelect_GenreName = this.strStringを配列に直す(strParam); - break; - } - case "SongSelect_Bar_Count": { - SongSelect_Bar_Count = int.Parse(strParam); - break; - } - case "SongSelect_Bar_X": { - SongSelect_Bar_X = new int[SongSelect_Bar_Count]; - - string[] strSplit = strParam.Split(','); - for (int i = 0; i < SongSelect_Bar_Count; i++) { - SongSelect_Bar_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_Bar_Y": { - SongSelect_Bar_Y = new int[SongSelect_Bar_Count]; - - string[] strSplit = strParam.Split(','); - for (int i = 0; i < SongSelect_Bar_Count; i++) { - SongSelect_Bar_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_Bar_Anim_X": { - SongSelect_Bar_Anim_X = new int[SongSelect_Bar_Count]; - - string[] strSplit = strParam.Split(','); - for (int i = 0; i < SongSelect_Bar_Count; i++) { - SongSelect_Bar_Anim_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_Bar_Anim_Y": { - SongSelect_Bar_Anim_Y = new int[SongSelect_Bar_Count]; - - string[] strSplit = strParam.Split(','); - for (int i = 0; i < SongSelect_Bar_Count; i++) { - SongSelect_Bar_Anim_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_Scroll_Interval": { - SongSelect_Scroll_Interval = float.Parse(strParam); - break; - } - case "SongSelect_DanStatus_Offset_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - SongSelect_DanStatus_Offset_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_DanStatus_Offset_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - SongSelect_DanStatus_Offset_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_TowerStatus_Offset_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - SongSelect_TowerStatus_Offset_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_TowerStatus_Offset_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - SongSelect_TowerStatus_Offset_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_RegularCrowns_Offset_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - SongSelect_RegularCrowns_Offset_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_RegularCrowns_Offset_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - SongSelect_RegularCrowns_Offset_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_RegularCrowns_ScoreRank_Offset_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - SongSelect_RegularCrowns_ScoreRank_Offset_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_RegularCrowns_ScoreRank_Offset_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - SongSelect_RegularCrowns_ScoreRank_Offset_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_RegularCrowns_Difficulty_Cymbol_Offset_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - SongSelect_RegularCrowns_Difficulty_Cymbol_Offset_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_RegularCrowns_Difficulty_Cymbol_Offset_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - SongSelect_RegularCrowns_Difficulty_Cymbol_Offset_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_FavoriteStatus_Offset": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - SongSelect_FavoriteStatus_Offset[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_Bar_Title_Offset": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - SongSelect_Bar_Title_Offset[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_Bar_Box_Offset": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - SongSelect_Bar_Box_Offset[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_Bar_BackBox_Offset": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - SongSelect_Bar_BackBox_Offset[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_Bar_Random_Offset": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - SongSelect_Bar_Random_Offset[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_Bar_SubTitle_Offset": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - SongSelect_Bar_SubTitle_Offset[i] = int.Parse(strSplit[i]); - } - break; - } - - - case "SongSelect_BoxName_Scale": { - SongSelect_BoxName_Scale = int.Parse(strParam); - break; - } - case "SongSelect_MusicName_Scale": { - SongSelect_MusicName_Scale = int.Parse(strParam); - break; - } - case "SongSelect_Subtitle_Scale": { - SongSelect_Subtitle_Scale = int.Parse(strParam); - break; - } - case "SongSelect_BoxText_Scale": { - SongSelect_BoxText_Scale = int.Parse(strParam); - break; - } - - case "SongSelect_VerticalText": { - SongSelect_VerticalText = CConversion.bONorOFF(strParam[0]); - break; - } - - case "SongSelect_Bar_Center_Move_X": { - SongSelect_Bar_Center_Move_X = int.Parse(strParam); - break; - } - - case "SongSelect_Title_MaxSize": { - SongSelect_Title_MaxSize = int.Parse(strParam); - break; - } - case "SongSelect_SubTitle_MaxSize": { - SongSelect_SubTitle_MaxSize = int.Parse(strParam); - break; - } - case "SongSelect_Maker_Show": { - SongSelect_Maker_Show = CConversion.bONorOFF(strParam[0]); - break; - } - case "SongSelect_Shorten_Frame_Fade": { - SongSelect_Shorten_Frame_Fade = CConversion.bONorOFF(strParam[0]); - break; - } - case "SongSelect_Bar_Select_Skip_Fade": { - SongSelect_Bar_Select_Skip_Fade = CConversion.bONorOFF(strParam[0]); - break; - } - case "SongSelect_Maker": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - SongSelect_Maker[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_Maker_Size": { - SongSelect_Maker_Size = int.Parse(strParam); - break; - } - case "SongSelect_Maker_MaxSize": { - SongSelect_Maker_MaxSize = int.Parse(strParam); - break; - } - - case "SongSelect_Bar_Center_Move": { - SongSelect_Bar_Center_Move = int.Parse(strParam); - break; - } - case "SongSelect_Bar_Select": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - SongSelect_Bar_Select[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_Frame_Score_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 4; i++) { - SongSelect_Frame_Score_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_Frame_Score_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 4; i++) { - SongSelect_Frame_Score_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_Level_Number_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 4; i++) { - SongSelect_Level_Number_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_Level_Number_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 4; i++) { - SongSelect_Level_Number_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_Level_Number_Tower": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - SongSelect_Level_Number_Tower[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_Tower_Side": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - SongSelect_Tower_Side[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_Level_Number_Interval": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - SongSelect_Level_Number_Interval[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_Level_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 4; i++) { - SongSelect_Level_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_Level_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 4; i++) { - SongSelect_Level_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_Level_Move": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - SongSelect_Level_Move[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_Box_Opening_Interval": { - SongSelect_Box_Opening_Interval = float.Parse(strParam); - break; - } - case "SongSelect_Unlock_Conditions_Text": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - SongSelect_Unlock_Conditions_Text[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_Difficulty_Select_Title": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - SongSelect_Difficulty_Select_Title[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_Difficulty_Select_SubTitle": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - SongSelect_Difficulty_Select_SubTitle[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_Box_Chara_Move": { - SongSelect_Box_Chara_Move = int.Parse(strParam); - break; - } - case "SongSelect_Box_Chara_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - SongSelect_Box_Chara_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_Box_Chara_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - SongSelect_Box_Chara_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_NamePlate_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 5; i++) { - SongSelect_NamePlate_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_NamePlate_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 5; i++) { - SongSelect_NamePlate_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_Auto_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - SongSelect_Auto_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_Auto_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - SongSelect_Auto_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_ModIcons_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 5; i++) { - SongSelect_ModIcons_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_ModIcons_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 5; i++) { - SongSelect_ModIcons_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_Timer": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - SongSelect_Timer[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_Timer_Interval": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - SongSelect_Timer_Interval[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_Bpm_Show": { - SongSelect_Bpm_Show = CConversion.bONorOFF(strParam[0]); - break; - } - case "SongSelect_Bpm_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 3; i++) { - SongSelect_Bpm_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_Bpm_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 3; i++) { - SongSelect_Bpm_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_Bpm_Interval": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - SongSelect_Bpm_Interval[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_BPM_Text_Show": { - SongSelect_BPM_Text_Show = CConversion.bONorOFF(strParam[0]); - break; - } - case "SongSelect_BPM_Text": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - SongSelect_BPM_Text[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_BPM_Text_Size": { - SongSelect_BPM_Text_Size = int.Parse(strParam); - break; - } - case "SongSelect_BPM_Text_MaxSize": { - SongSelect_BPM_Text_MaxSize = int.Parse(strParam); - break; - } - case "SongSelect_Explicit": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - SongSelect_Explicit[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_Movie": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - SongSelect_Movie[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_FloorNum_Show": { - SongSelect_FloorNum_Show = CConversion.bONorOFF(strParam[0]); - break; - } - case "SongSelect_FloorNum_X": { - SongSelect_FloorNum_X = int.Parse(strParam); - break; - } - case "SongSelect_FloorNum_Y": { - SongSelect_FloorNum_Y = int.Parse(strParam); - break; - } - case "SongSelect_FloorNum_Interval": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - SongSelect_FloorNum_Interval[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_DanInfo_Show": { - SongSelect_DanInfo_Show = CConversion.bONorOFF(strParam[0]); - break; - } - case "SongSelect_DanInfo_Icon_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 3; i++) { - SongSelect_DanInfo_Icon_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_DanInfo_Icon_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 3; i++) { - SongSelect_DanInfo_Icon_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_DanInfo_Icon_Scale": { - SongSelect_DanInfo_Icon_Scale = float.Parse(strParam); - break; - } - case "SongSelect_DanInfo_Difficulty_Cymbol_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 3; i++) { - SongSelect_DanInfo_Difficulty_Cymbol_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_DanInfo_Difficulty_Cymbol_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 3; i++) { - SongSelect_DanInfo_Difficulty_Cymbol_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_DanInfo_Difficulty_Cymbol_Scale": { - SongSelect_DanInfo_Difficulty_Cymbol_Scale = float.Parse(strParam); - break; - } - case "SongSelect_DanInfo_Level_Number_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 3; i++) { - SongSelect_DanInfo_Level_Number_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_DanInfo_Level_Number_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 3; i++) { - SongSelect_DanInfo_Level_Number_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_DanInfo_Level_Number_Scale": { - SongSelect_DanInfo_Level_Number_Scale = float.Parse(strParam); - break; - } - case "SongSelect_DanInfo_Title_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 3; i++) { - SongSelect_DanInfo_Title_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_DanInfo_Title_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 3; i++) { - SongSelect_DanInfo_Title_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_DanInfo_Title_Size": { - SongSelect_DanInfo_Title_Size = int.Parse(strParam); - break; - } - case "SongSelect_DanInfo_Exam_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 6; i++) { - SongSelect_DanInfo_Exam_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_DanInfo_Exam_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 6; i++) { - SongSelect_DanInfo_Exam_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_DanInfo_Exam_Size": { - SongSelect_DanInfo_Exam_Size = int.Parse(strParam); - break; - } - case "SongSelect_DanInfo_Exam_Value_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 3; i++) { - SongSelect_DanInfo_Exam_Value_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_DanInfo_Exam_Value_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 6; i++) { - SongSelect_DanInfo_Exam_Value_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_DanInfo_Exam_Value_Scale": { - SongSelect_DanInfo_Exam_Value_Scale = float.Parse(strParam); - break; - } - case "SongSelect_Table_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 5; i++) { - SongSelect_Table_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_Table_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 5; i++) { - SongSelect_Table_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_High_Score_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 5; i++) { - SongSelect_High_Score_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_High_Score_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 5; i++) { - SongSelect_High_Score_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_High_Score_Difficulty_Cymbol_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 5; i++) { - SongSelect_High_Score_Difficulty_Cymbol_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_High_Score_Difficulty_Cymbol_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 5; i++) { - SongSelect_High_Score_Difficulty_Cymbol_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_BoardNumber_1P_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 13; i++) { - SongSelect_BoardNumber_X[0][i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_BoardNumber_1P_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 13; i++) { - SongSelect_BoardNumber_Y[0][i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_BoardNumber_2P_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 13; i++) { - SongSelect_BoardNumber_X[1][i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_BoardNumber_2P_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 13; i++) { - SongSelect_BoardNumber_Y[1][i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_BoardNumber_3P_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 13; i++) { - SongSelect_BoardNumber_X[2][i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_BoardNumber_3P_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 13; i++) { - SongSelect_BoardNumber_Y[2][i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_BoardNumber_4P_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 13; i++) { - SongSelect_BoardNumber_X[3][i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_BoardNumber_4P_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 13; i++) { - SongSelect_BoardNumber_Y[3][i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_BoardNumber_5P_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 13; i++) { - SongSelect_BoardNumber_X[4][i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_BoardNumber_5P_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 13; i++) { - SongSelect_BoardNumber_Y[4][i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_BoardNumber_Interval": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - SongSelect_BoardNumber_Interval[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_SongNumber_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - SongSelect_SongNumber_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_SongNumber_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - SongSelect_SongNumber_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_SongNumber_Interval": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - SongSelect_SongNumber_Interval[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_Search_Bar_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 5; i++) { - SongSelect_Search_Bar_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_Search_Bar_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 5; i++) { - SongSelect_Search_Bar_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_Level_Offset": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - SongSelect_Level_Offset[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_Difficulty_Colors": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 7; i++) { - SongSelect_Difficulty_Colors[i] = ColorTranslator.FromHtml(strSplit[i]); - } - break; - } - case "SongSelect_Difficulty_Back": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - SongSelect_Difficulty_Back[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_Difficulty_Bar_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 7; i++) { - SongSelect_Difficulty_Bar_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_Branch_Text_Offset": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - SongSelect_Branch_Text_Offset[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_Branch_Offset": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - SongSelect_Branch_Offset[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_Difficulty_Bar_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 7; i++) { - SongSelect_Difficulty_Bar_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_Difficulty_Bar_Back_Rect": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 4; i++) { - SongSelect_Difficulty_Bar_Rect[0][i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_Difficulty_Bar_Option_Rect": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 4; i++) { - SongSelect_Difficulty_Bar_Rect[1][i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_Difficulty_Bar_Easy_Rect": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 4; i++) { - SongSelect_Difficulty_Bar_Rect[2][i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_Difficulty_Bar_Normal_Rect": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 4; i++) { - SongSelect_Difficulty_Bar_Rect[3][i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_Difficulty_Bar_Hard_Rect": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 4; i++) { - SongSelect_Difficulty_Bar_Rect[4][i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_Difficulty_Bar_Oni_Rect": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 4; i++) { - SongSelect_Difficulty_Bar_Rect[5][i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_Difficulty_Bar_Edit_Rect": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 4; i++) { - SongSelect_Difficulty_Bar_Rect[6][i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_Difficulty_Star_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 5; i++) { - SongSelect_Difficulty_Star_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_Difficulty_Star_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 5; i++) { - SongSelect_Difficulty_Star_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_Difficulty_Star_Interval": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - SongSelect_Difficulty_Star_Interval[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_Difficulty_Number_X": { - string[] strSplit = strParam.Split(','); - int max = Math.Min(strSplit.Length, 7); - for (int i = 0; i < max; i++) { - SongSelect_Difficulty_Number_X[i] = int.Parse(strSplit[i]); - if (i == 4) { - SongSelect_Difficulty_Number_X[5] = SongSelect_Difficulty_Number_X[i]; - SongSelect_Difficulty_Number_X[6] = SongSelect_Difficulty_Number_X[i]; - } - } - break; - } - case "SongSelect_Difficulty_Number_Y": { - string[] strSplit = strParam.Split(','); - int max = Math.Min(strSplit.Length, 7); - for (int i = 0; i < max; i++) { - SongSelect_Difficulty_Number_Y[i] = int.Parse(strSplit[i]); - if (i == 4) { - SongSelect_Difficulty_Number_Y[5] = SongSelect_Difficulty_Number_Y[i]; - SongSelect_Difficulty_Number_Y[6] = SongSelect_Difficulty_Number_Y[i]; - } - } - break; - } - case "SongSelect_Difficulty_Number_Interval": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - SongSelect_Difficulty_Number_Interval[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_Difficulty_Crown_1P_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 5; i++) { - SongSelect_Difficulty_Crown_X[0][i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_Difficulty_Crown_2P_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 5; i++) { - SongSelect_Difficulty_Crown_X[1][i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_Difficulty_Crown_1P_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 5; i++) { - SongSelect_Difficulty_Crown_Y[0][i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_Difficulty_Crown_2P_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 5; i++) { - SongSelect_Difficulty_Crown_Y[1][i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_Difficulty_ScoreRank_1P_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 5; i++) { - SongSelect_Difficulty_ScoreRank_X[0][i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_Difficulty_ScoreRank_2P_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 5; i++) { - SongSelect_Difficulty_ScoreRank_X[1][i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_Difficulty_ScoreRank_1P_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 5; i++) { - SongSelect_Difficulty_ScoreRank_Y[0][i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_Difficulty_ScoreRank_2P_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 5; i++) { - SongSelect_Difficulty_ScoreRank_Y[1][i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_Difficulty_Select_Bar_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 7; i++) { - SongSelect_Difficulty_Select_Bar_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_Difficulty_Select_Bar_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 7; i++) { - SongSelect_Difficulty_Select_Bar_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_Difficulty_Select_Bar_Back_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 7; i++) { - SongSelect_Difficulty_Select_Bar_Back_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_Difficulty_Select_Bar_Back_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 7; i++) { - SongSelect_Difficulty_Select_Bar_Back_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_Difficulty_Select_Bar_Cursor_Rect": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 4; i++) { - SongSelect_Difficulty_Select_Bar_Rect[0][i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_Difficulty_Select_Bar_Back1_Rect": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 4; i++) { - SongSelect_Difficulty_Select_Bar_Rect[1][i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_Difficulty_Select_Bar_Back2_Rect": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 4; i++) { - SongSelect_Difficulty_Select_Bar_Rect[2][i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_Difficulty_Select_Bar_Anime": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - SongSelect_Difficulty_Select_Bar_Anime[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_Difficulty_Select_Bar_AnimeIn": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - SongSelect_Difficulty_Select_Bar_AnimeIn[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_Difficulty_Select_Bar_Move": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - SongSelect_Difficulty_Select_Bar_Move[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_Difficulty_Bar_ExExtra_AnimeDuration": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - SongSelect_Difficulty_Bar_ExExtra_AnimeDuration[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_Preimage": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - SongSelect_Preimage[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_Preimage_Size": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - SongSelect_Preimage_Size[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_Option_Select_Offset": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - SongSelect_Option_Select_Offset[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_Option_Font_Scale": { - SongSelect_Option_Font_Scale = int.Parse(strParam); - break; - } - case "SongSelect_Option_OptionType_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - SongSelect_Option_OptionType_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_Option_OptionType_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - SongSelect_Option_OptionType_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_Option_Value_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - SongSelect_Option_Value_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_Option_Value_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - SongSelect_Option_Value_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_Option_Interval": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - SongSelect_Option_Interval[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_Option_ModMults1_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - SongSelect_Option_ModMults1_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_Option_ModMults2_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - SongSelect_Option_ModMults2_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_Option_ModMults1_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - SongSelect_Option_ModMults1_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_Option_ModMults2_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - SongSelect_Option_ModMults2_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_NewHeya_Close_Select": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - SongSelect_NewHeya_Close_Select[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_NewHeya_PlayerPlate_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 5; i++) { - SongSelect_NewHeya_PlayerPlate_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_NewHeya_PlayerPlate_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 5; i++) { - SongSelect_NewHeya_PlayerPlate_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_NewHeya_ModeBar_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 5; i++) { - SongSelect_NewHeya_ModeBar_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_NewHeya_ModeBar_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 5; i++) { - SongSelect_NewHeya_ModeBar_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_NewHeya_ModeBar_Font_Offset": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - SongSelect_NewHeya_ModeBar_Font_Offset[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_NewHeya_Box_Count": { - SongSelect_NewHeya_Box_Count = int.Parse(strParam); - break; - } - case "SongSelect_NewHeya_Box_X": { - string[] strSplit = strParam.Split(','); - SongSelect_NewHeya_Box_X = new int[SongSelect_NewHeya_Box_Count]; - for (int i = 0; i < SongSelect_NewHeya_Box_Count; i++) { - SongSelect_NewHeya_Box_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_NewHeya_Box_Y": { - string[] strSplit = strParam.Split(','); - SongSelect_NewHeya_Box_Y = new int[SongSelect_NewHeya_Box_Count]; - for (int i = 0; i < SongSelect_NewHeya_Box_Count; i++) { - SongSelect_NewHeya_Box_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_NewHeya_Box_Chara_Offset": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - SongSelect_NewHeya_Box_Chara_Offset[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_NewHeya_Box_Name_Offset": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - SongSelect_NewHeya_Box_Name_Offset[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_NewHeya_Box_Author_Offset": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - SongSelect_NewHeya_Box_Author_Offset[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_NewHeya_Lock_Offset": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - SongSelect_NewHeya_Lock_Offset[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongSelect_NewHeya_InfoSection_Offset": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - SongSelect_NewHeya_InfoSection_Offset[i] = int.Parse(strSplit[i]); - } - break; - } - - - case "SongSelect_ForeColor_JPOP": { - SongSelect_ForeColor_JPOP = ColorTranslator.FromHtml(strParam); - break; - } - case "SongSelect_ForeColor_Anime": { - SongSelect_ForeColor_Anime = ColorTranslator.FromHtml(strParam); - break; - } - case "SongSelect_ForeColor_VOCALOID": { - SongSelect_ForeColor_VOCALOID = ColorTranslator.FromHtml(strParam); - break; - } - case "SongSelect_ForeColor_Children": { - SongSelect_ForeColor_Children = ColorTranslator.FromHtml(strParam); - break; - } - case "SongSelect_ForeColor_Variety": { - SongSelect_ForeColor_Variety = ColorTranslator.FromHtml(strParam); - break; - } - case "SongSelect_ForeColor_Classic": { - SongSelect_ForeColor_Classic = ColorTranslator.FromHtml(strParam); - break; - } - case "SongSelect_ForeColor_GameMusic": { - SongSelect_ForeColor_GameMusic = ColorTranslator.FromHtml(strParam); - break; - } - case nameof(SongSelect_ForeColor_Namco): { - SongSelect_ForeColor_GameMusic = ColorTranslator.FromHtml(strParam); - break; - } - case "SongSelect_BackColor_JPOP": { - SongSelect_BackColor_JPOP = ColorTranslator.FromHtml(strParam); - break; - } - case "SongSelect_BackColor_Anime": { - SongSelect_BackColor_Anime = ColorTranslator.FromHtml(strParam); - break; - } - case "SongSelect_BackColor_VOCALOID": { - SongSelect_BackColor_VOCALOID = ColorTranslator.FromHtml(strParam); - break; - } - case "SongSelect_BackColor_Children": { - SongSelect_BackColor_Children = ColorTranslator.FromHtml(strParam); - break; - } - case "SongSelect_BackColor_Variety": { - SongSelect_BackColor_Variety = ColorTranslator.FromHtml(strParam); - break; - } - case "SongSelect_BackColor_Classic": { - SongSelect_BackColor_Classic = ColorTranslator.FromHtml(strParam); - break; - } - case "SongSelect_BackColor_GameMusic": { - SongSelect_BackColor_GameMusic = ColorTranslator.FromHtml(strParam); - break; - } - case nameof(SongSelect_BackColor_Namco): { - SongSelect_BackColor_Namco = ColorTranslator.FromHtml(strParam); - break; - } - case nameof(SongSelect_CorrectionX_Chara): { - SongSelect_CorrectionX_Chara = strParam.Split(',').ToArray(); - break; - } - case nameof(SongSelect_CorrectionY_Chara): { - SongSelect_CorrectionY_Chara = strParam.Split(',').ToArray(); - break; - } - case nameof(SongSelect_CorrectionX_Chara_Value): { - SongSelect_CorrectionX_Chara_Value = int.Parse(strParam); - break; - } - case nameof(SongSelect_CorrectionY_Chara_Value): { - SongSelect_CorrectionY_Chara_Value = int.Parse(strParam); - break; - } - case nameof(SongSelect_Rotate_Chara): { - SongSelect_Rotate_Chara = strParam.Split(',').ToArray(); - break; - } - #endregion - - #region DaniSelect - /* - case "DaniSelect_Dan_Text_X": - { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 4; i++) - { - DaniSelect_Dan_Text_X[i] = int.Parse(strSplit[i]); - } - } - case "DaniSelect_Dan_Text_Y": - { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 4; i++) - { - DaniSelect_Dan_Text_Y[i] = int.Parse(strSplit[i]); - } - } - */ - case "DaniSelect_DanSides_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - DaniSelect_DanSides_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "DaniSelect_DanSides_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - DaniSelect_DanSides_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "DaniSelect_DanPlate": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - DaniSelect_DanPlate[i] = int.Parse(strSplit[i]); - } - break; - } - case "DaniSelect_Rank": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - DaniSelect_Rank[i] = int.Parse(strSplit[i]); - } - break; - } - case "DaniSelect_Bloc2": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - DaniSelect_Bloc2[i] = int.Parse(strSplit[i]); - } - break; - } - case "DaniSelect_Text_Gauge": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - DaniSelect_Text_Gauge[i] = int.Parse(strSplit[i]); - } - break; - } - case "DaniSelect_Value_Gauge": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - DaniSelect_Value_Gauge[i] = int.Parse(strSplit[i]); - } - break; - } - case "DaniSelect_DanIcon_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 3; i++) { - DaniSelect_DanIcon_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "DaniSelect_DanIcon_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 3; i++) { - DaniSelect_DanIcon_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "DaniSelect_Title_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 3; i++) { - DaniSelect_Title_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "DaniSelect_Title_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 3; i++) { - DaniSelect_Title_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "DaniSelect_Difficulty_Cymbol_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 3; i++) { - DaniSelect_Difficulty_Cymbol_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "DaniSelect_Difficulty_Cymbol_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 3; i++) { - DaniSelect_Difficulty_Cymbol_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "DaniSelect_Level_Number_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 3; i++) { - DaniSelect_Level_Number_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "DaniSelect_Level_Number_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 3; i++) { - DaniSelect_Level_Number_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "DaniSelect_Level_Number_Interval": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - DaniSelect_Level_Number_Interval[i] = int.Parse(strSplit[i]); - } - break; - } - case "DaniSelect_Soul_Number_Interval": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - DaniSelect_Soul_Number_Interval[i] = int.Parse(strSplit[i]); - } - break; - } - case "DaniSelect_Soul_Number_Text_Width": { - DaniSelect_Soul_Number_Text_Width = int.Parse(strParam); - break; - } - case "DaniSelect_Exam_Number_Interval": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - DaniSelect_Exam_Number_Interval[i] = int.Parse(strSplit[i]); - } - break; - } - case "DaniSelect_Exam_Number_Text_Width": { - DaniSelect_Exam_Number_Text_Width = int.Parse(strParam); - break; - } - case "DaniSelect_Font_DanFolder_Size": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - DaniSelect_Font_DanFolder_Size[i] = int.Parse(strSplit[i]); - } - break; - } - case "DaniSelect_FolderText_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 4; i++) { - DaniSelect_FolderText_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "DaniSelect_FolderText_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 4; i++) { - DaniSelect_FolderText_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "DaniSelect_Font_DanSong_Size": { - DaniSelect_Font_DanSong_Size = int.Parse(strParam); - break; - } - case "DaniSelect_Font_Exam_Size": { - DaniSelect_Font_Exam_Size = int.Parse(strParam); - break; - } - case "DaniSelect_Exam_Bloc_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 3; i++) { - DaniSelect_Exam_Bloc_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "DaniSelect_Exam_Bloc_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 3; i++) { - DaniSelect_Exam_Bloc_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "DaniSelect_Exam_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 3; i++) { - DaniSelect_Exam_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "DaniSelect_Exam_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 3; i++) { - DaniSelect_Exam_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "DaniSelect_Exam_X_Ex": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 3; i++) { - DaniSelect_Exam_X_Ex[i] = int.Parse(strSplit[i]); - } - break; - } - case "DaniSelect_Exam_Y_Ex": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 3; i++) { - DaniSelect_Exam_Y_Ex[i] = int.Parse(strSplit[i]); - } - break; - } - case "DaniSelect_Exam_Interval": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 3; i++) { - DaniSelect_Exam_Interval[i] = int.Parse(strSplit[i]); - } - break; - } - case "DaniSelect_Exam_Title_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 3; i++) { - DaniSelect_Exam_Title_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "DaniSelect_Exam_Title_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 3; i++) { - DaniSelect_Exam_Title_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "DaniSelect_Challenge_Select_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 3; i++) { - DaniSelect_Challenge_Select_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "DaniSelect_Challenge_Select_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 3; i++) { - DaniSelect_Challenge_Select_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "DaniSelect_Challenge_Select_Rect_Option": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 4; i++) { - DaniSelect_Challenge_Select_Rect[0][i] = int.Parse(strSplit[i]); - } - break; - } - case "DaniSelect_Challenge_Select_Rect_Start": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 4; i++) { - DaniSelect_Challenge_Select_Rect[1][i] = int.Parse(strSplit[i]); - } - break; - } - case "DaniSelect_Challenge_Select_Rect_Back": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 4; i++) { - DaniSelect_Challenge_Select_Rect[2][i] = int.Parse(strSplit[i]); - } - break; - } - case "DaniSelect_Plate": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - DaniSelect_Plate[i] = int.Parse(strSplit[i]); - } - break; - } - case "DaniSelect_Plate_Move": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - DaniSelect_Plate_Move[i] = int.Parse(strSplit[i]); - } - break; - } - case "DaniSelect_Plate_Center_Move": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - DaniSelect_Plate_Center_Move[i] = int.Parse(strSplit[i]); - } - break; - } - case "DaniSelect_Plate_Title_Offset": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - DaniSelect_Plate_Title_Offset[i] = int.Parse(strSplit[i]); - } - break; - } - case "DaniSelect_DanIconTitle_Size": { - DaniSelect_DanIconTitle_Size = int.Parse(strParam); - break; - } - case "DaniSelect_DanIconTitle_Offset": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - DaniSelect_DanIconTitle_Offset[i] = int.Parse(strSplit[i]); - } - break; - } - case "DaniSelect_DanIcon_Color": { - string[] strSplit = strParam.Split(','); - DaniSelect_DanIcon_Color = new Color[strSplit.Length]; - for (int i = 0; i < strSplit.Length; i++) { - DaniSelect_DanIcon_Color[i] = ColorTranslator.FromHtml(strSplit[i]); - } - break; - } - #endregion - - #region SongLoading - case nameof(SongLoading_Plate_X): { - SongLoading_Plate_X = int.Parse(strParam); - break; - } - case nameof(SongLoading_Plate_Y): { - SongLoading_Plate_Y = int.Parse(strParam); - break; - } - case nameof(SongLoading_Title_X): { - SongLoading_Title_X = int.Parse(strParam); - break; - } - case nameof(SongLoading_Title_Y): { - SongLoading_Title_Y = int.Parse(strParam); - break; - } - case nameof(SongLoading_Title_MaxSize): { - SongLoading_Title_MaxSize = int.Parse(strParam); - break; - } - case nameof(SongLoading_SubTitle_X): { - SongLoading_SubTitle_X = int.Parse(strParam); - break; - } - case nameof(SongLoading_SubTitle_Y): { - SongLoading_SubTitle_Y = int.Parse(strParam); - break; - } - case nameof(SongLoading_SubTitle_MaxSize): { - SongLoading_SubTitle_MaxSize = int.Parse(strParam); - break; - } - case nameof(SongLoading_Plate_X_AI): { - SongLoading_Plate_X_AI = int.Parse(strParam); - break; - } - case nameof(SongLoading_Plate_Y_AI): { - SongLoading_Plate_Y_AI = int.Parse(strParam); - break; - } - case nameof(SongLoading_Title_X_AI): { - SongLoading_Title_X_AI = int.Parse(strParam); - break; - } - case nameof(SongLoading_Title_Y_AI): { - SongLoading_Title_Y_AI = int.Parse(strParam); - break; - } - case nameof(SongLoading_SubTitle_X_AI): { - SongLoading_SubTitle_X_AI = int.Parse(strParam); - break; - } - case nameof(SongLoading_SubTitle_Y_AI): { - SongLoading_SubTitle_Y_AI = int.Parse(strParam); - break; - } - case "SongLoading_Fade_AI_Anime_Ring": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - SongLoading_Fade_AI_Anime_Ring[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongLoading_Fade_AI_Anime_LoadBar": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - SongLoading_Fade_AI_Anime_LoadBar[i] = int.Parse(strSplit[i]); - } - break; - } - case "SongLoading_DanPlate": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - SongLoading_DanPlate[i] = int.Parse(strSplit[i]); - } - break; - } - case nameof(SongLoading_Title_FontSize): { - if (int.Parse(strParam) > 0) - SongLoading_Title_FontSize = int.Parse(strParam); - break; - } - case nameof(SongLoading_SubTitle_FontSize): { - if (int.Parse(strParam) > 0) - SongLoading_SubTitle_FontSize = int.Parse(strParam); - break; - } - case "SongLoading_Chara_Move": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - SongLoading_Chara_Move[i] = int.Parse(strSplit[i]); - } - break; - } - case nameof(SongLoading_Plate_ReferencePoint): { - SongLoading_Plate_ReferencePoint = (ReferencePoint)int.Parse(strParam); - break; - } - case nameof(SongLoading_Title_ReferencePoint): { - SongLoading_Title_ReferencePoint = (ReferencePoint)int.Parse(strParam); - break; - } - case nameof(SongLoading_SubTitle_ReferencePoint): { - SongLoading_SubTitle_ReferencePoint = (ReferencePoint)int.Parse(strParam); - break; - } - - case nameof(SongLoading_Title_ForeColor): { - SongLoading_Title_ForeColor = ColorTranslator.FromHtml(strParam); - break; - } - case nameof(SongLoading_Title_BackColor): { - SongLoading_Title_BackColor = ColorTranslator.FromHtml(strParam); - break; - } - case nameof(SongLoading_SubTitle_ForeColor): { - SongLoading_SubTitle_ForeColor = ColorTranslator.FromHtml(strParam); - break; - } - case nameof(SongLoading_SubTitle_BackColor): { - SongLoading_SubTitle_BackColor = ColorTranslator.FromHtml(strParam); - break; - } - case nameof(SongLoading_Plate_ScreenBlend): { - SongLoading_Plate_ScreenBlend = CConversion.bONorOFF(strParam[0]); - break; - } - case nameof(DaniSelect_DanPlateTitle_Size): { - DaniSelect_DanPlateTitle_Size = int.Parse(strParam); - break; - } - case "DaniSelect_DanPlateTitle_Offset": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - DaniSelect_DanPlateTitle_Offset[i] = int.Parse(strSplit[i]); - } - break; - } - #endregion - - #region Game - case "Game_Notes_Anime": { - Game_Notes_Anime = CConversion.bONorOFF(strParam[0]); - break; - } - case "Game_ScrollField_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - nScrollFieldX[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_ScrollField_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - nScrollFieldY[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_ScrollField_4P": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - nScrollField_4P[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_ScrollField_5P": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - nScrollField_5P[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_SENotes_Offset_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - nSENotesX[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_SENotes_Offset_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - nSENotesY[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_SENotes_Offset_4P": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - nSENotes_4P[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_SENotes_Offset_5P": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - nSENotes_5P[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Notes_Size": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Notes_Size[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_SENote_Size": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_SENote_Size[i] = int.Parse(strSplit[i]); - } - break; - } - case nameof(Game_Notes_Interval): { - Game_Notes_Interval = int.Parse(strParam); - break; - } - case "Game_Notes_Arm_Offset_Left_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Notes_Arm_Offset_Left_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Notes_Arm_Offset_Right_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Notes_Arm_Offset_Right_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Notes_Arm_Offset_Left_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Notes_Arm_Offset_Left_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Notes_Arm_Offset_Right_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Notes_Arm_Offset_Right_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Notes_Arm_Move": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Notes_Arm_Move[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Judge_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Judge_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Judge_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Judge_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Judge_Move": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Judge_Move[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_ScoreRank_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_ScoreRank_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_ScoreRank_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_ScoreRank_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_ScoreRank_Move": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_ScoreRank_Move[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_StageText": { - Game_StageText = strParam; - break; - } - case nameof(Game_RollColorMode): { - Game_RollColorMode = (RollColorMode)int.Parse(strParam); - break; - } - case nameof(Game_JudgeFrame_AddBlend): { - Game_JudgeFrame_AddBlend = CConversion.bONorOFF(strParam[0]); - break; - } - - - case "Game_Judge_4P": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Judge_4P[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Judge_5P": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Judge_5P[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_UIMove_4P": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_UIMove_4P[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_UIMove_5P": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_UIMove_5P[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_ScoreRank_4P": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_ScoreRank_4P[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_ScoreRank_5P": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_ScoreRank_4P[i] = int.Parse(strSplit[i]); - } - break; - } - - #region CourseSymbol - case "Game_CourseSymbol_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_CourseSymbol_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_CourseSymbol_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_CourseSymbol_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_CourseSymbol_Back_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_CourseSymbol_Back_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_CourseSymbol_Back_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_CourseSymbol_Back_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_CourseSymbol_4P": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_CourseSymbol_4P[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_CourseSymbol_5P": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_CourseSymbol_5P[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_CourseSymbol_Back_4P": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_CourseSymbol_Back_4P[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_CourseSymbol_Back_5P": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_CourseSymbol_Back_5P[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_CourseSymbol_Back_Rect_4P": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 4; i++) { - Game_CourseSymbol_Back_Rect_4P[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_CourseSymbol_Back_Rect_5P": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 4; i++) { - Game_CourseSymbol_Back_Rect_5P[i] = int.Parse(strSplit[i]); - } - break; - } - #endregion - - #region PanelFont - case nameof(Game_MusicName_X): { - Game_MusicName_X = int.Parse(strParam); - break; - } - case nameof(Game_MusicName_Y): { - Game_MusicName_Y = int.Parse(strParam); - break; - } - case nameof(Game_MusicName_FontSize): { - if (int.Parse(strParam) > 0) - Game_MusicName_FontSize = int.Parse(strParam); - break; - } - case nameof(Game_MusicName_MaxWidth): { - Game_MusicName_MaxWidth = int.Parse(strParam); - break; - } - case nameof(Game_MusicName_ReferencePoint): { - Game_MusicName_ReferencePoint = (ReferencePoint)int.Parse(strParam); - break; - } - case nameof(Game_Genre_X): { - Game_Genre_X = int.Parse(strParam); - break; - } - case nameof(Game_Genre_Y): { - Game_Genre_Y = int.Parse(strParam); - break; - } - case "Game_GenreText_Offset": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_GenreText_Offset[i] = int.Parse(strSplit[i]); - } - break; - } - case nameof(Game_GenreText_FontSize): { - Game_GenreText_FontSize = int.Parse(strParam); - break; - } - case nameof(Game_Lyric_X): { - Game_Lyric_X = int.Parse(strParam); - break; - } - case nameof(Game_Lyric_Y): { - Game_Lyric_Y = int.Parse(strParam); - break; - } - case nameof(Game_Lyric_FontName): { - strParam = strParam.Replace('/', System.IO.Path.DirectorySeparatorChar); - strParam = strParam.Replace('\\', System.IO.Path.DirectorySeparatorChar); - if (HPrivateFastFont.FontExists(strParam)) Game_Lyric_FontName = strParam; - strParam = Path(strParam); - if (HPrivateFastFont.FontExists(strParam)) Game_Lyric_FontName = strParam; - break; - } - case nameof(Game_Lyric_FontSize): { - if (int.Parse(strParam) > 0) - Game_Lyric_FontSize = int.Parse(strParam); - break; - } - case nameof(Game_Lyric_VTTRubyOffset): { - Game_Lyric_VTTRubyOffset = int.Parse(strParam); - break; - } - case nameof(Game_Lyric_VTTForeColor): { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 8; i++) { - Game_Lyric_VTTForeColor[i] = ColorTranslator.FromHtml(strSplit[i]); - } - break; - } - case nameof(Game_Lyric_VTTBackColor): { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 8; i++) { - Game_Lyric_VTTBackColor[i] = ColorTranslator.FromHtml(strSplit[i]); - } - break; - } - case nameof(Game_Lyric_ReferencePoint): { - Game_Lyric_ReferencePoint = (ReferencePoint)int.Parse(strParam); - break; - } - - case nameof(Game_MusicName_ForeColor): { - Game_MusicName_ForeColor = ColorTranslator.FromHtml(strParam); - break; - } - case nameof(Game_StageText_ForeColor): { - Game_StageText_ForeColor = ColorTranslator.FromHtml(strParam); - break; - } - case nameof(Game_Lyric_ForeColor): { - Game_Lyric_ForeColor = ColorTranslator.FromHtml(strParam); - break; - } - case nameof(Game_MusicName_BackColor): { - Game_MusicName_BackColor = ColorTranslator.FromHtml(strParam); - break; - } - case nameof(Game_StageText_BackColor): { - Game_StageText_BackColor = ColorTranslator.FromHtml(strParam); - break; - } - case nameof(Game_Lyric_BackColor): { - Game_Lyric_BackColor = ColorTranslator.FromHtml(strParam); - break; - } - case "Game_Judge_Meter": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Judge_Meter[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Judge_Meter_Perfect": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Judge_Meter_Perfect[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Judge_Meter_Good": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Judge_Meter_Good[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Judge_Meter_Miss": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Judge_Meter_Miss[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Judge_Meter_Roll": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Judge_Meter_Roll[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Judge_Meter_HitRate": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Judge_Meter_HitRate[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Judge_Meter_PerfectRate": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Judge_Meter_PerfectRate[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Judge_Meter_GoodRate": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Judge_Meter_GoodRate[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Judge_Meter_MissRate": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Judge_Meter_MissRate[i] = int.Parse(strSplit[i]); - } - break; - } - #endregion - - // Chara read - #region Chara - case "Game_Chara_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Chara_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Chara_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Chara_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Chara_Balloon_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Chara_Balloon_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Chara_Balloon_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Chara_Balloon_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case nameof(Game_Chara_Balloon_Timer): { - if (int.Parse(strParam) > 0) - Game_Chara_Balloon_Timer = int.Parse(strParam); - break; - } - case nameof(Game_Chara_Balloon_Delay): { - if (int.Parse(strParam) > 0) - Game_Chara_Balloon_Delay = int.Parse(strParam); - break; - } - case nameof(Game_Chara_Balloon_FadeOut): { - if (int.Parse(strParam) > 0) - Game_Chara_Balloon_FadeOut = int.Parse(strParam); - break; - } - // パターン数の設定はTextureLoader.csで反映されます。 - case "Game_Chara_Motion_Normal": { - Game_Chara_Motion_Normal = strParam; - break; - } - case "Game_Chara_Motion_Clear": { - Game_Chara_Motion_Clear = strParam; - break; - } - case "Game_Chara_Motion_GoGo": { - Game_Chara_Motion_GoGo = strParam; - break; - } - case "Game_Chara_Beat_Normal": { - ParseInt32(value => Game_Chara_Beat_Normal = value); - break; - } - case "Game_Chara_Beat_Clear": { - ParseInt32(value => Game_Chara_Beat_Clear = value); - break; - } - case "Game_Chara_Beat_GoGo": { - ParseInt32(value => Game_Chara_Beat_GoGo = value); - break; - } - #endregion - - #region Mob - case "Game_Mob_Beat": { - ParseInt32(value => Game_Mob_Beat = value); - break; - } - case "Game_Mob_Ptn_Beat": { - ParseInt32(value => Game_Mob_Ptn_Beat = value); - break; - } - #endregion - - #region Score - case "Game_Score_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - this.Game_Score_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Score_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - this.Game_Score_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Score_Add_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - this.Game_Score_Add_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Score_Add_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - this.Game_Score_Add_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Score_AddBonus_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - this.Game_Score_AddBonus_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Score_AddBonus_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - this.Game_Score_AddBonus_Y[i] = int.Parse(strSplit[i]); - } - break; - } - - case "Game_Score_Padding": { - ParseInt32(value => Game_Score_Padding = value); - break; - } - case "Game_Score_Size": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Score_Size[i] = int.Parse(strSplit[i]); - } - break; - } - - - case "Game_Score_4P": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Score_4P[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Score_5P": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Score_5P[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Score_Add_4P": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Score_Add_4P[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Score_Add_5P": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Score_Add_5P[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Score_AddBonus_4P": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Score_AddBonus_4P[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Score_AddBonus_5P": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Score_AddBonus_5P[i] = int.Parse(strSplit[i]); - } - break; - } - - #endregion - - #region Taiko - case "Game_Taiko_Background_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Taiko_Background_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Taiko_Background_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Taiko_Background_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Taiko_ModIcons_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Taiko_ModIcons_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Taiko_ModIcons_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Taiko_ModIcons_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Taiko_NamePlate_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Taiko_NamePlate_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Taiko_NamePlate_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Taiko_NamePlate_Y[i] = int.Parse(strSplit[i]); - } - break; - } - - case "Game_Taiko_PlayerNumber_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Taiko_PlayerNumber_X[i] = int.Parse(strSplit[i]); - } - break; - } - - case "Game_Taiko_PlayerNumber_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Taiko_PlayerNumber_Y[i] = int.Parse(strSplit[i]); - } - break; - } - - case "Game_Taiko_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Taiko_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Taiko_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Taiko_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Taiko_Combo_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Taiko_Combo_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Taiko_Combo_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Taiko_Combo_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Taiko_Combo_Ex_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Taiko_Combo_Ex_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Taiko_Combo_Ex_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Taiko_Combo_Ex_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Taiko_Combo_Ex4_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Taiko_Combo_Ex4_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Taiko_Combo_Ex4_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Taiko_Combo_Ex4_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Taiko_Combo_Padding": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 3; i++) { - Game_Taiko_Combo_Padding[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Taiko_Combo_Size": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Taiko_Combo_Size[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Taiko_Combo_Size_Ex": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Taiko_Combo_Size_Ex[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Taiko_Combo_Scale": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 3; i++) { - Game_Taiko_Combo_Scale[i] = float.Parse(strSplit[i]); - } - break; - } - case "Game_Taiko_Combo_Text_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Taiko_Combo_Text_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Taiko_Combo_Text_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Taiko_Combo_Text_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Taiko_Combo_Text_Size": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Taiko_Combo_Text_Size[i] = int.Parse(strSplit[i]); - } - break; - } - case nameof(Game_Taiko_Combo_Ex_IsJumping): { - Game_Taiko_Combo_Ex_IsJumping = CConversion.bONorOFF(strParam[0]); - break; - } - case "Game_Taiko_LevelChange_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Taiko_LevelChange_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Taiko_LevelChange_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Taiko_LevelChange_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Taiko_Frame_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Taiko_Frame_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Taiko_Frame_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Taiko_Frame_Y[i] = int.Parse(strSplit[i]); - } - break; - } - - - case "Game_Taiko_Background_4P": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Taiko_Background_4P[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Taiko_Background_5P": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Taiko_Background_5P[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Taiko_ModIcons_4P": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Taiko_ModIcons_4P[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Taiko_ModIcons_5P": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Taiko_ModIcons_5P[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Taiko_NamePlate_4P": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Taiko_NamePlate_4P[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Taiko_NamePlate_5P": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Taiko_NamePlate_5P[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Taiko_PlayerNumber_4P": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Taiko_PlayerNumber_4P[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Taiko_PlayerNumber_5P": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Taiko_PlayerNumber_5P[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Taiko_4P": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Taiko_4P[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Taiko_5P": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Taiko_5P[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Taiko_Combo_4P": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Taiko_Combo_4P[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Taiko_Combo_5P": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Taiko_Combo_5P[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Taiko_Combo_Ex_4P": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Taiko_Combo_Ex_4P[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Taiko_Combo_Ex_5P": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Taiko_Combo_Ex_5P[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Taiko_Combo_Ex4_4P": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Taiko_Combo_Ex4_4P[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Taiko_Combo_Ex4_5P": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Taiko_Combo_Ex4_5P[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Taiko_Combo_Text_4P": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Taiko_Combo_Text_4P[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Taiko_Combo_Text_5P": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Taiko_Combo_Text_5P[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Taiko_Frame_4P": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Taiko_Frame_4P[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Taiko_Frame_5P": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Taiko_Frame_5P[i] = int.Parse(strSplit[i]); - } - break; - } - #endregion - - #region Gauge - case "Game_Gauge_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Gauge_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Gauge_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Gauge_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Gauge_X_AI": { - Game_Gauge_X_AI = int.Parse(strParam); - break; - } - case "Game_Gauge_Y_AI": { - Game_Gauge_Y_AI = int.Parse(strParam); - break; - } - case "Game_Gauge_Rect": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 4; i++) { - Game_Gauge_Rect[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Gauge_ClearText_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Gauge_ClearText_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Gauge_ClearText_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Gauge_ClearText_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Gauge_ClearText_X_AI": { - Game_Gauge_ClearText_X_AI = int.Parse(strParam); - break; - } - case "Game_Gauge_ClearText_Y_AI": { - Game_Gauge_ClearText_Y_AI = int.Parse(strParam); - break; - } - case "Game_Gauge_ClearText_Rect": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 4; i++) { - Game_Gauge_ClearText_Rect[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Gauge_ClearText_Clear_Rect": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 4; i++) { - Game_Gauge_ClearText_Clear_Rect[i] = int.Parse(strSplit[i]); - } - break; - } - case "Gauge_Soul_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Gauge_Soul_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "Gauge_Soul_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Gauge_Soul_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "Gauge_Soul_X_AI": { - Gauge_Soul_X_AI = int.Parse(strParam); - break; - } - case "Gauge_Soul_Y_AI": { - Gauge_Soul_Y_AI = int.Parse(strParam); - break; - } - case "Gauge_Soul_X_Tower": { - Gauge_Soul_X_Tower = int.Parse(strParam); - break; - } - case "Gauge_Soul_Y_Tower": { - Gauge_Soul_Y_Tower = int.Parse(strParam); - break; - } - case "Gauge_Soul_Fire_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Gauge_Soul_Fire_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "Gauge_Soul_Fire_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Gauge_Soul_Fire_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "Gauge_Soul_Fire_X_AI": { - Gauge_Soul_Fire_X_AI = int.Parse(strParam); - break; - } - case "Gauge_Soul_Fire_Y_AI": { - Gauge_Soul_Fire_Y_AI = int.Parse(strParam); - break; - } - case "Gauge_Soul_Fire_X_Tower": { - Gauge_Soul_Fire_X_Tower = int.Parse(strParam); - break; - } - case "Gauge_Soul_Fire_Y_Tower": { - Gauge_Soul_Fire_Y_Tower = int.Parse(strParam); - break; - } - case "Game_Gauge_Rainbow_Timer": { - if (int.Parse(strParam) != 0) { - Game_Gauge_Rainbow_Timer = int.Parse(strParam); - } - break; - } - case "Game_Tower_Floor_Number": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Tower_Floor_Number[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Tower_Life_Number": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Tower_Life_Number[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Tower_Font_TouTatsuKaiSuu": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Tower_Font_TouTatsuKaiSuu[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Tower_Font_Kai": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Tower_Font_Kai[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Tower_Font_TowerText": { - Game_Tower_Font_TowerText = int.Parse(strParam); - break; - } - - - case "Game_Gauge_4P": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Gauge_4P[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Gauge_5P": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Gauge_5P[i] = int.Parse(strSplit[i]); - } - break; - } - case "Gauge_Soul_4P": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Gauge_Soul_4P[i] = int.Parse(strSplit[i]); - } - break; - } - case "Gauge_Soul_5P": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Gauge_Soul_5P[i] = int.Parse(strSplit[i]); - } - break; - } - case "Gauge_Soul_Fire_4P": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Gauge_Soul_Fire_4P[i] = int.Parse(strSplit[i]); - } - break; - } - case "Gauge_Soul_Fire_5P": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Gauge_Soul_Fire_5P[i] = int.Parse(strSplit[i]); - } - break; - } - #endregion - - #region Balloon - case "Game_Balloon_Combo_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Balloon_Combo_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Balloon_Combo_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Balloon_Combo_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Balloon_Combo_Number_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Balloon_Combo_Number_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Balloon_Combo_Number_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Balloon_Combo_Number_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Balloon_Combo_Number_Ex_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Balloon_Combo_Number_Ex_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Balloon_Combo_Number_Ex_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Balloon_Combo_Number_Ex_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Balloon_Combo_Number_Size": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Balloon_Combo_Number_Size[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Balloon_Combo_Number_Interval": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Balloon_Combo_Number_Interval[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Balloon_Combo_Text_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Balloon_Combo_Text_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Balloon_Combo_Text_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Balloon_Combo_Text_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Balloon_Combo_Text_Ex_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Balloon_Combo_Text_Ex_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Balloon_Combo_Text_Ex_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Balloon_Combo_Text_Ex_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Balloon_Combo_Text_Rect": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 4; i++) { - Game_Balloon_Combo_Text_Rect[i] = int.Parse(strSplit[i]); - } - break; - } - - - case "Game_Balloon_Balloon_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - this.Game_Balloon_Balloon_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Balloon_Balloon_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - this.Game_Balloon_Balloon_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Balloon_Balloon_Frame_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - this.Game_Balloon_Balloon_Frame_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Balloon_Balloon_Frame_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - this.Game_Balloon_Balloon_Frame_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Balloon_Balloon_Number_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - this.Game_Balloon_Balloon_Number_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Balloon_Balloon_Number_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - this.Game_Balloon_Balloon_Number_Y[i] = int.Parse(strSplit[i]); - } - break; - } - - case "Game_Balloon_Roll_Frame_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Balloon_Roll_Frame_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Balloon_Roll_Frame_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Balloon_Roll_Frame_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Balloon_Roll_Number_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Balloon_Roll_Number_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Balloon_Roll_Number_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Balloon_Roll_Number_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Balloon_Number_Size": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Balloon_Number_Size[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Balloon_Number_Interval": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Balloon_Number_Interval[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Balloon_Roll_Number_Scale": { - ParseInt32(value => Game_Balloon_Roll_Number_Scale = value); - break; - } - case "Game_Balloon_Balloon_Number_Scale": { - ParseInt32(value => Game_Balloon_Balloon_Number_Scale = value); - break; - } - case "Game_Kusudama_Number_X": { - ParseInt32(value => Game_Kusudama_Number_X = value); - break; - } - case "Game_Kusudama_Number_Y": { - ParseInt32(value => Game_Kusudama_Number_Y = value); - break; - } - - - case "Game_Balloon_Balloon_4P": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Balloon_Balloon_4P[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Balloon_Balloon_5P": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Balloon_Balloon_5P[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Balloon_Balloon_Frame_4P": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Balloon_Balloon_Frame_4P[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Balloon_Balloon_Frame_5P": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Balloon_Balloon_Frame_5P[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Balloon_Balloon_Number_4P": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Balloon_Balloon_Number_4P[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Balloon_Balloon_Number_5P": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Balloon_Balloon_Number_5P[i] = int.Parse(strSplit[i]); - } - break; - } - - #endregion - - #region Effects - case nameof(Game_Effect_Roll_StartPoint_X): { - Game_Effect_Roll_StartPoint_X = strParam.Split(',').Select(int.Parse).ToArray(); - break; - } - case nameof(Game_Effect_Roll_StartPoint_Y): { - Game_Effect_Roll_StartPoint_Y = strParam.Split(',').Select(int.Parse).ToArray(); - break; - } - case nameof(Game_Effect_Roll_StartPoint_1P_X): { - Game_Effect_Roll_StartPoint_1P_X = strParam.Split(',').Select(int.Parse).ToArray(); - break; - } - case nameof(Game_Effect_Roll_StartPoint_1P_Y): { - Game_Effect_Roll_StartPoint_1P_Y = strParam.Split(',').Select(int.Parse).ToArray(); - break; - } - case nameof(Game_Effect_Roll_StartPoint_2P_X): { - Game_Effect_Roll_StartPoint_2P_X = strParam.Split(',').Select(int.Parse).ToArray(); - break; - } - case nameof(Game_Effect_Roll_StartPoint_2P_Y): { - Game_Effect_Roll_StartPoint_2P_Y = strParam.Split(',').Select(int.Parse).ToArray(); - break; - } - case nameof(Game_Effect_Roll_Speed_X): { - Game_Effect_Roll_Speed_X = strParam.Split(',').Select(float.Parse).ToArray(); - break; - } - case nameof(Game_Effect_Roll_Speed_Y): { - Game_Effect_Roll_Speed_Y = strParam.Split(',').Select(float.Parse).ToArray(); - break; - } - case nameof(Game_Effect_Roll_Speed_1P_X): { - Game_Effect_Roll_Speed_1P_X = strParam.Split(',').Select(float.Parse).ToArray(); - break; - } - case nameof(Game_Effect_Roll_Speed_1P_Y): { - Game_Effect_Roll_Speed_1P_Y = strParam.Split(',').Select(float.Parse).ToArray(); - break; - } - case nameof(Game_Effect_Roll_Speed_2P_X): { - Game_Effect_Roll_Speed_2P_X = strParam.Split(',').Select(float.Parse).ToArray(); - break; - } - case nameof(Game_Effect_Roll_Speed_2P_Y): { - Game_Effect_Roll_Speed_2P_Y = strParam.Split(',').Select(float.Parse).ToArray(); - break; - } - case nameof(Game_Effect_NotesFlash): { - Game_Effect_NotesFlash = strParam.Split(',').Select(int.Parse).ToArray(); - break; - } - case nameof(Game_Effect_NotesFlash_Timer): { - Game_Effect_NotesFlash_Timer = int.Parse(strParam); - break; - } - case nameof(Game_Effect_GoGoSplash): { - Game_Effect_GoGoSplash = strParam.Split(',').Select(int.Parse).ToArray(); - break; - } - case nameof(Game_Effect_GoGoSplash_X): { - Game_Effect_GoGoSplash_X = strParam.Split(',').Select(int.Parse).ToArray(); - break; - } - case nameof(Game_Effect_GoGoSplash_Y): { - Game_Effect_GoGoSplash_Y = strParam.Split(',').Select(int.Parse).ToArray(); - break; - } - case nameof(Game_Effect_GoGoSplash_Rotate): { - Game_Effect_GoGoSplash_Rotate = CConversion.bONorOFF(strParam[0]); - break; - } - case nameof(Game_Effect_GoGoSplash_Timer): { - Game_Effect_GoGoSplash_Timer = int.Parse(strParam); - break; - } - case nameof(Game_Effect_FlyingNotes_StartPoint_X): { - Game_Effect_FlyingNotes_StartPoint_X = strParam.Split(',').Select(int.Parse).ToArray(); - break; - } - case nameof(Game_Effect_FlyingNotes_StartPoint_Y): { - Game_Effect_FlyingNotes_StartPoint_Y = strParam.Split(',').Select(int.Parse).ToArray(); - break; - } - case nameof(Game_Effect_FlyingNotes_EndPoint_X): { - Game_Effect_FlyingNotes_EndPoint_X = strParam.Split(',').Select(int.Parse).ToArray(); - break; - } - case nameof(Game_Effect_FlyingNotes_EndPoint_Y): { - Game_Effect_FlyingNotes_EndPoint_Y = strParam.Split(',').Select(int.Parse).ToArray(); - break; - } - case nameof(Game_Effect_FlyingNotes_EndPoint_X_AI): { - Game_Effect_FlyingNotes_EndPoint_X_AI = strParam.Split(',').Select(int.Parse).ToArray(); - break; - } - case nameof(Game_Effect_FlyingNotes_EndPoint_Y_AI): { - Game_Effect_FlyingNotes_EndPoint_Y_AI = strParam.Split(',').Select(int.Parse).ToArray(); - break; - } - case nameof(Game_Effect_FlyingNotes_Sine): { - Game_Effect_FlyingNotes_Sine = int.Parse(strParam); - break; - } - case nameof(Game_Effect_FlyingNotes_IsUsingEasing): { - Game_Effect_FlyingNotes_IsUsingEasing = CConversion.bONorOFF(strParam[0]); - break; - } - case nameof(Game_Effect_FlyingNotes_Timer): { - Game_Effect_FlyingNotes_Timer = int.Parse(strParam); - break; - } - case nameof(Game_Effect_FireWorks): { - Game_Effect_FireWorks = strParam.Split(',').Select(int.Parse).ToArray(); - break; - } - case nameof(Game_Effect_FireWorks_Timer): { - Game_Effect_FireWorks_Timer = int.Parse(strParam); - break; - } - case "Game_Effect_Rainbow_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - this.Game_Effect_Rainbow_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Effect_Rainbow_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - this.Game_Effect_Rainbow_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case nameof(Game_Effect_Rainbow_Timer): { - Game_Effect_Rainbow_Timer = int.Parse(strParam); - break; - } - case "Game_Effects_Hit_Explosion_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Effects_Hit_Explosion_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Effects_Hit_Explosion_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Effects_Hit_Explosion_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case nameof(Game_Effect_HitExplosion_AddBlend): { - Game_Effect_HitExplosion_AddBlend = CConversion.bONorOFF(strParam[0]); - break; - } - case nameof(Game_Effect_HitExplosionBig_AddBlend): { - Game_Effect_HitExplosionBig_AddBlend = CConversion.bONorOFF(strParam[0]); - break; - } - case "Game_Effect_Fire_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Effect_Fire_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Effect_Fire_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Effect_Fire_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case nameof(Game_Effect_FireWorks_AddBlend): { - Game_Effect_FireWorks_AddBlend = CConversion.bONorOFF(strParam[0]); - break; - } - case nameof(Game_Effect_Fire_AddBlend): { - Game_Effect_Fire_AddBlend = CConversion.bONorOFF(strParam[0]); - break; - } - case nameof(Game_Effect_GoGoSplash_AddBlend): { - Game_Effect_GoGoSplash_AddBlend = CConversion.bONorOFF(strParam[0]); - break; - } - case nameof(Game_Effect_FireWorks_Timing): { - Game_Effect_FireWorks_Timing = int.Parse(strParam); - break; - } - - - case "Game_Effects_Hit_Explosion_4P": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Effects_Hit_Explosion_4P[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Effects_Hit_Explosion_5P": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Effects_Hit_Explosion_5P[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Effect_Fire_4P": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Effect_Fire_4P[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Effect_Fire_5P": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Effect_Fire_5P[i] = int.Parse(strSplit[i]); - } - break; - } - - #endregion - - #region Lane - - case "Game_Lane_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Lane_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Lane_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Lane_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Lane_Sub_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Lane_Sub_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Lane_Sub_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Lane_Sub_Y[i] = int.Parse(strSplit[i]); - } - break; - } - - case "Game_Lane_4P": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Lane_4P[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Lane_5P": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Lane_5P[i] = int.Parse(strSplit[i]); - } - break; - } - #endregion - - #region Runner - #endregion - - #region Dan_C - case nameof(Game_DanC_Title_ForeColor): { - Game_DanC_Title_ForeColor = ColorTranslator.FromHtml(strParam); - break; - } - case nameof(Game_DanC_Title_BackColor): { - Game_DanC_Title_BackColor = ColorTranslator.FromHtml(strParam); - break; - } - case nameof(Game_DanC_SubTitle_ForeColor): { - Game_DanC_SubTitle_ForeColor = ColorTranslator.FromHtml(strParam); - break; - } - case nameof(Game_DanC_SubTitle_BackColor): { - Game_DanC_SubTitle_BackColor = ColorTranslator.FromHtml(strParam); - break; - } - case nameof(Game_DanC_X): { - Game_DanC_X = strParam.Split(',').Select(int.Parse).ToArray(); - break; - } - case nameof(Game_DanC_Y): { - Game_DanC_Y = strParam.Split(',').Select(int.Parse).ToArray(); - break; - } - case nameof(Game_DanC_Base_Offset_X): { - Game_DanC_Base_Offset_X = strParam.Split(',').Select(int.Parse).ToArray(); - break; - } - case nameof(Game_DanC_Base_Offset_Y): { - Game_DanC_Base_Offset_Y = strParam.Split(',').Select(int.Parse).ToArray(); - break; - } - case nameof(Game_DanC_SmallBase_Offset_X): { - Game_DanC_SmallBase_Offset_X = strParam.Split(',').Select(int.Parse).ToArray(); - break; - } - case nameof(Game_DanC_SmallBase_Offset_Y): { - Game_DanC_SmallBase_Offset_Y = strParam.Split(',').Select(int.Parse).ToArray(); - break; - } - - case nameof(Game_DanC_Size): { - Game_DanC_Size = strParam.Split(',').Select(int.Parse).ToArray(); - break; - } - - case nameof(Game_DanC_Padding): { - ParseInt32(value => Game_DanC_Padding = value); - break; - } - - case nameof(Game_DanC_Offset): { - Game_DanC_Offset = strParam.Split(',').Select(int.Parse).ToArray(); - break; - } - - case nameof(Game_DanC_Number_Size): { - Game_DanC_Number_Size = strParam.Split(',').Select(int.Parse).ToArray(); - break; - } - - case nameof(Game_DanC_Small_Number_Size): { - Game_DanC_Small_Number_Size = strParam.Split(',').Select(int.Parse).ToArray(); - break; - } - - case nameof(Game_DanC_MiniNumber_Size): { - Game_DanC_MiniNumber_Size = strParam.Split(',').Select(int.Parse).ToArray(); - break; - } - - case nameof(Game_DanC_Number_Padding): { - ParseInt32(value => Game_DanC_Number_Padding = value); - break; - } - - case nameof(Game_DanC_Number_Small_Scale): { - Game_DanC_Number_Small_Scale = float.Parse(strParam); - break; - } - - case nameof(Game_DanC_Number_Small_Padding): { - ParseInt32(value => Game_DanC_Number_Small_Padding = value); - break; - } - - case nameof(Game_DanC_Number_XY): { - Game_DanC_Number_XY = strParam.Split(',').Select(int.Parse).ToArray(); - break; - } - case nameof(Game_DanC_Number_Small_Number_Offset): { - Game_DanC_Number_Small_Number_Offset = strParam.Split(',').Select(int.Parse).ToArray(); - break; - } - case nameof(Game_DanC_ExamType_Size): { - Game_DanC_ExamType_Size = strParam.Split(',').Select(int.Parse).ToArray(); - break; - } - case nameof(Game_DanC_ExamRange_Size): { - Game_DanC_ExamRange_Size = strParam.Split(',').Select(int.Parse).ToArray(); - break; - } - - case nameof(Game_DanC_ExamRange_Padding): { - ParseInt32(value => Game_DanC_ExamRange_Padding = value); - break; - } - - case nameof(Game_DanC_Percent_Hit_Score_Padding): { - Game_DanC_Percent_Hit_Score_Padding = strParam.Split(',').Select(int.Parse).ToArray(); - break; - } - case nameof(Game_DanC_ExamUnit_Size): { - Game_DanC_ExamUnit_Size = strParam.Split(',').Select(int.Parse).ToArray(); - break; - } - case nameof(Game_DanC_Exam_Offset): { - Game_DanC_Exam_Offset = strParam.Split(',').Select(int.Parse).ToArray(); - break; - } - case nameof(Game_DanC_Dan_Plate): { - Game_DanC_Dan_Plate = strParam.Split(',').Select(int.Parse).ToArray(); - break; - } - case nameof(Game_DanC_DanIcon_Offset): { - Game_DanC_DanIcon_Offset = strParam.Split(',').Select(int.Parse).ToArray(); - break; - } - case nameof(Game_DanC_DanIcon_Offset_Mini): { - Game_DanC_DanIcon_Offset_Mini = strParam.Split(',').Select(int.Parse).ToArray(); - break; - } - case nameof(Game_DanC_Title_X): { - Game_DanC_Title_X = strParam.Split(',').Select(int.Parse).ToArray(); - break; - } - case nameof(Game_DanC_Title_Y): { - Game_DanC_Title_Y = strParam.Split(',').Select(int.Parse).ToArray(); - break; - } - case nameof(Game_DanC_SubTitle): { - Game_DanC_SubTitle = strParam.Split(',').Select(int.Parse).ToArray(); - break; - } - - case nameof(Game_DanC_Title_Size): { - ParseInt32(value => Game_DanC_Title_Size = value); - break; - } - case nameof(Game_DanC_SubTitle_Size): { - ParseInt32(value => Game_DanC_SubTitle_Size = value); - break; - } - case nameof(Game_DanC_ExamFont_Size): { - ParseInt32(value => Game_DanC_ExamFont_Size = value); - break; - } - case nameof(Game_DanC_Title_MaxWidth): { - ParseInt32(value => Game_DanC_Title_MaxWidth = value); - break; - } - case nameof(Game_DanC_SubTitle_MaxWidth): { - ParseInt32(value => Game_DanC_SubTitle_MaxWidth = value); - break; - } - - #endregion - - #region PuchiChara - case nameof(Game_PuchiChara_X): { - Game_PuchiChara_X = strParam.Split(',').Select(int.Parse).ToArray(); - break; - } - case nameof(Game_PuchiChara_Y): { - Game_PuchiChara_Y = strParam.Split(',').Select(int.Parse).ToArray(); - break; - } - case nameof(Game_PuchiChara_4P): { - Game_PuchiChara_4P = strParam.Split(',').Select(int.Parse).ToArray(); - break; - } - case nameof(Game_PuchiChara_5P): { - Game_PuchiChara_5P = strParam.Split(',').Select(int.Parse).ToArray(); - break; - } - case nameof(Game_PuchiChara_BalloonX): { - Game_PuchiChara_BalloonX = strParam.Split(',').Select(int.Parse).ToArray(); - break; - } - case nameof(Game_PuchiChara_BalloonY): { - Game_PuchiChara_BalloonY = strParam.Split(',').Select(int.Parse).ToArray(); - break; - } - case nameof(Game_PuchiChara_KusudamaX): { - Game_PuchiChara_KusudamaX = strParam.Split(',').Select(int.Parse).ToArray(); - break; - } - case nameof(Game_PuchiChara_KusudamaY): { - Game_PuchiChara_KusudamaY = strParam.Split(',').Select(int.Parse).ToArray(); - break; - } - case nameof(Game_PuchiChara_Scale): { - Game_PuchiChara_Scale = strParam.Split(',').Select(float.Parse).ToArray(); - break; - } - case nameof(Game_PuchiChara): { - Game_PuchiChara = strParam.Split(',').Select(int.Parse).ToArray(); - break; - } - case nameof(Game_PuchiChara_Sine): { - ParseInt32(value => Game_PuchiChara_Sine = value); - break; - } - case nameof(Game_PuchiChara_Timer): { - ParseInt32(value => Game_PuchiChara_Timer = value); - break; - } - case nameof(Game_PuchiChara_SineTimer): { - Game_PuchiChara_SineTimer = double.Parse(strParam); - break; - } - #endregion - - #region Training - case "Game_Training_DownBG": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Training_DownBG[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Training_BigTaiko": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Training_BigTaiko[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Training_Speed_Measure": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Training_Speed_Measure[i] = int.Parse(strSplit[i]); - } - break; - } - case nameof(Game_Training_ScrollTime): { - Game_Training_ScrollTime = int.Parse(strParam); - break; - } - case nameof(Game_Training_ProgressBar_XY): { - Game_Training_ProgressBar_XY = strParam.Split(',').Select(int.Parse).ToArray(); - break; - } - case nameof(Game_Training_GoGoPoint_Y): { - Game_Training_GoGoPoint_Y = int.Parse(strParam); - break; - } - case nameof(Game_Training_JumpPoint_Y): { - Game_Training_JumpPoint_Y = int.Parse(strParam); - break; - } - case nameof(Game_Training_MaxMeasureCount_XY): { - Game_Training_MaxMeasureCount_XY = strParam.Split(',').Select(int.Parse).ToArray(); - break; - } - case nameof(Game_Training_CurrentMeasureCount_XY): { - Game_Training_CurrentMeasureCount_XY = strParam.Split(',').Select(int.Parse).ToArray(); - break; - } - case nameof(Game_Training_SpeedDisplay_XY): { - Game_Training_SpeedDisplay_XY = strParam.Split(',').Select(int.Parse).ToArray(); - break; - } - case nameof(Game_Training_SmallNumber_Width): { - Game_Training_SmallNumber_Width = int.Parse(strParam); - break; - } - case nameof(Game_Training_BigNumber_Width): { - Game_Training_BigNumber_Width = int.Parse(strParam); - break; - } - #endregion - - #region Tower - case "Game_Tower_Sky_Gradient": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Tower_Sky_Gradient[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Tower_Sky_Gradient_Size": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Tower_Sky_Gradient_Size[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Tower_Floors_Body": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Tower_Floors_Body[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Tower_Floors_Deco": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Tower_Floors_Deco[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Tower_Floors_Move": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Tower_Floors_Move[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Tower_Don": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Tower_Don[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Tower_Don_Move": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Tower_Don_Move[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_Tower_Miss": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_Tower_Miss[i] = int.Parse(strSplit[i]); - } - break; - } - #endregion - - #region AIBattle - case "Game_AIBattle_CharaMove": { - Game_AIBattle_CharaMove = int.Parse(strParam); - break; - } - case "Game_AIBattle_SectionTime_Panel": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_AIBattle_SectionTime_Panel[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_AIBattle_SectionTime_Bar": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_AIBattle_SectionTime_Bar[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_AIBattle_Batch_Base": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_AIBattle_Batch_Base[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_AIBattle_Batch": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_AIBattle_Batch[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_AIBattle_Batch_Size": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_AIBattle_Batch_Size[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_AIBattle_Batch_Anime": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_AIBattle_Batch_Anime[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_AIBattle_Batch_Anime_Size": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_AIBattle_Batch_Anime_Size[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_AIBattle_Batch_Move": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_AIBattle_Batch_Move[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_AIBattle_Judge_Meter_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_AIBattle_Judge_Meter_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_AIBattle_Judge_Meter_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_AIBattle_Judge_Meter_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_AIBattle_Judge_Number_Perfect_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_AIBattle_Judge_Number_Perfect_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_AIBattle_Judge_Number_Perfect_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_AIBattle_Judge_Number_Perfect_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_AIBattle_Judge_Number_Good_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_AIBattle_Judge_Number_Good_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_AIBattle_Judge_Number_Good_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_AIBattle_Judge_Number_Good_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_AIBattle_Judge_Number_Miss_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_AIBattle_Judge_Number_Miss_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_AIBattle_Judge_Number_Miss_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_AIBattle_Judge_Number_Miss_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_AIBattle_Judge_Number_Roll_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_AIBattle_Judge_Number_Roll_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_AIBattle_Judge_Number_Roll_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_AIBattle_Judge_Number_Roll_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "Game_AIBattle_Judge_Number_Interval": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Game_AIBattle_Judge_Number_Interval[i] = int.Parse(strSplit[i]); - } - break; - } - #endregion - - #endregion - - #region Result - case "Result_Use1PUI": { - Result_Use1PUI = CConversion.bONorOFF(strParam[0]); - break; - } - case nameof(Result_Cloud_Count): { - Result_Cloud_Count = int.Parse(strParam); - break; - } - case "Result_Cloud_X": { - Result_Cloud_X = new int[Result_Cloud_Count]; - string[] strSplit = strParam.Split(','); - for (int i = 0; i < Result_Cloud_Count; i++) { - Result_Cloud_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_Result_Cloud_Y": { - Result_Cloud_Y = new int[Result_Cloud_Count]; - string[] strSplit = strParam.Split(','); - for (int i = 0; i < Result_Cloud_Count; i++) { - Result_Cloud_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_Result_Cloud_MaxMove": { - Result_Cloud_MaxMove = new int[Result_Cloud_Count]; - string[] strSplit = strParam.Split(','); - for (int i = 0; i < Result_Cloud_Count; i++) { - Result_Cloud_MaxMove[i] = int.Parse(strSplit[i]); - } - break; - } - case nameof(Result_Shine_Count): { - Result_Shine_Count = int.Parse(strParam); - break; - } - case "Result_Shine_1P_X": { - Result_Shine_X[0] = new int[Result_Shine_Count]; - string[] strSplit = strParam.Split(','); - for (int i = 0; i < Result_Shine_Count; i++) { - Result_Shine_X[0][i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_Shine_2P_X": { - Result_Shine_X[1] = new int[Result_Shine_Count]; - string[] strSplit = strParam.Split(','); - for (int i = 0; i < Result_Shine_Count; i++) { - Result_Shine_X[1][i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_Shine_1P_Y": { - Result_Shine_Y[0] = new int[Result_Shine_Count]; - string[] strSplit = strParam.Split(','); - for (int i = 0; i < Result_Shine_Count; i++) { - Result_Shine_Y[0][i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_Shine_2P_Y": { - Result_Shine_Y[1] = new int[Result_Shine_Count]; - string[] strSplit = strParam.Split(','); - for (int i = 0; i < Result_Shine_Count; i++) { - Result_Shine_Y[1][i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_Shine_Size": { - Result_Shine_Size = new float[Result_Shine_Count]; - string[] strSplit = strParam.Split(','); - for (int i = 0; i < Result_Cloud_Count; i++) { - Result_Shine_Size[i] = float.Parse(strSplit[i]); - } - break; - } - case "Result_Work_1P_X": { - Result_Work_X[0] = new int[3]; - string[] strSplit = strParam.Split(','); - for (int i = 0; i < Result_Cloud_Count; i++) { - Result_Work_X[0][i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_Work_2P_X": { - Result_Work_X[1] = new int[3]; - string[] strSplit = strParam.Split(','); - for (int i = 0; i < Result_Cloud_Count; i++) { - Result_Work_X[1][i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_Work_1P_Y": { - Result_Work_Y[0] = new int[3]; - string[] strSplit = strParam.Split(','); - for (int i = 0; i < Result_Cloud_Count; i++) { - Result_Work_Y[0][i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_Work_2P_Y": { - Result_Work_Y[1] = new int[3]; - string[] strSplit = strParam.Split(','); - for (int i = 0; i < Result_Cloud_Count; i++) { - Result_Work_Y[1][i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_DifficultyBar_Size": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Result_DifficultyBar_Size[i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_DifficultyBar_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Result_DifficultyBar_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_DifficultyBar_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Result_DifficultyBar_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_Gauge_Base_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Result_Gauge_Base_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_Gauge_Base_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Result_Gauge_Base_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_Gauge_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Result_Gauge_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_Gauge_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Result_Gauge_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_Gauge_Rect": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 4; i++) { - Result_Gauge_Rect[i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_Gauge_Rainbow_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Result_Gauge_Rainbow_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_Gauge_Rainbow_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Result_Gauge_Rainbow_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_Gauge_Rainbow_Interval": { - Result_Gauge_Rainbow_Interval = int.Parse(strParam); - break; - } - case "Result_Gauge_ClearText_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Result_Gauge_ClearText_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_Gauge_ClearText_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Result_Gauge_ClearText_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_Gauge_ClearText_Rect": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 4; i++) { - Result_Gauge_ClearText_Rect[i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_Gauge_ClearText_Clear_Rect": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 4; i++) { - Result_Gauge_ClearText_Clear_Rect[i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_Number_Interval": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Result_Number_Interval[i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_Number_Scale_4P": { - Result_Number_Scale_4P = float.Parse(strParam); - break; - } - case "Result_Number_Scale_5P": { - Result_Number_Scale_5P = float.Parse(strParam); - break; - } - case "Result_Soul_Fire_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Result_Soul_Fire_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_Soul_Fire_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Result_Soul_Fire_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_Soul_Text_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Result_Soul_Text_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_Soul_Text_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Result_Soul_Text_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_Perfect_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Result_Perfect_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_Perfect_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Result_Perfect_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_Good_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Result_Good_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_Good_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Result_Good_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_Miss_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Result_Miss_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_Miss_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Result_Miss_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_Roll_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Result_Roll_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_Roll_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Result_Roll_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_MaxCombo_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Result_MaxCombo_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_MaxCombo_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Result_MaxCombo_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_ADLib_Show": { - Result_ADLib_Show = CConversion.bONorOFF(strParam[0]); - break; - } - case "Result_ADLib_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Result_ADLib_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_ADLib_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Result_ADLib_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_Bomb_Show": { - Result_Bomb_Show = CConversion.bONorOFF(strParam[0]); - break; - } - case "Result_Bomb_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Result_Bomb_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_Bomb_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Result_Bomb_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_Score_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Result_Score_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_Score_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Result_Score_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_Score_Number_Interval": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Result_Score_Number_Interval[i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_Score_Scale_4P": { - Result_Score_Scale_4P = float.Parse(strParam); - break; - } - case "Result_Score_Scale_5P": { - Result_Score_Scale_5P = float.Parse(strParam); - break; - } - case "Result_ScoreRankEffect_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Result_ScoreRankEffect_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_ScoreRankEffect_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Result_ScoreRankEffect_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_CrownEffect_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Result_CrownEffect_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_CrownEffect_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Result_CrownEffect_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_Speech_Bubble_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Result_Speech_Bubble_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_Speech_Bubble_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Result_Speech_Bubble_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_Speech_Bubble_V2_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Result_Speech_Bubble_V2_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_Speech_Bubble_V2_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Result_Speech_Bubble_V2_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_Speech_Bubble_V2_2P_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Result_Speech_Bubble_V2_2P_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_Speech_Bubble_V2_2P_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Result_Speech_Bubble_V2_2P_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case nameof(Result_MusicName_X): { - Result_MusicName_X = int.Parse(strParam); - break; - } - case nameof(Result_MusicName_Y): { - Result_MusicName_Y = int.Parse(strParam); - break; - } - case nameof(Result_MusicName_FontSize): { - if (int.Parse(strParam) > 0) - Result_MusicName_FontSize = int.Parse(strParam); - break; - } - case nameof(Result_MusicName_MaxSize): { - Result_MusicName_MaxSize = int.Parse(strParam); - break; - } - case nameof(Result_MusicName_ReferencePoint): { - Result_MusicName_ReferencePoint = (ReferencePoint)int.Parse(strParam); - break; - } - case nameof(Result_StageText_X): { - Result_StageText_X = int.Parse(strParam); - break; - } - case nameof(Result_StageText_Y): { - Result_StageText_Y = int.Parse(strParam); - break; - } - case nameof(Result_StageText_FontSize): { - if (int.Parse(strParam) > 0) - Result_StageText_FontSize = int.Parse(strParam); - break; - } - case nameof(Result_StageText_ReferencePoint): { - Result_StageText_ReferencePoint = (ReferencePoint)int.Parse(strParam); - break; - } - - case nameof(Result_MusicName_ForeColor): { - Result_MusicName_ForeColor = ColorTranslator.FromHtml(strParam); - break; - } - case nameof(Result_StageText_ForeColor): { - Result_StageText_ForeColor = ColorTranslator.FromHtml(strParam); - break; - } - //case nameof(Result_StageText_ForeColor_Red): - //{ - // Result_StageText_ForeColor_Red = ColorTranslator.FromHtml(strParam); - //} - case nameof(Result_MusicName_BackColor): { - Result_MusicName_BackColor = ColorTranslator.FromHtml(strParam); - break; - } - case nameof(Result_StageText_BackColor): { - Result_StageText_BackColor = ColorTranslator.FromHtml(strParam); - break; - } - //case nameof(Result_StageText_BackColor_Red): - //{ - // Result_StageText_BackColor_Red = ColorTranslator.FromHtml(strParam); - //} - - case "Result_NamePlate_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Result_NamePlate_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_NamePlate_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Result_NamePlate_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_ModIcons_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Result_ModIcons_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_ModIcons_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Result_ModIcons_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_Flower_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Result_Flower_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_Flower_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Result_Flower_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_Flower_Rotate_1P_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 5; i++) { - Result_Flower_Rotate_X[0][i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_Flower_Rotate_2P_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 5; i++) { - Result_Flower_Rotate_X[1][i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_Flower_Rotate_1P_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 5; i++) { - Result_Flower_Rotate_Y[0][i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_Flower_Rotate_2P_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 5; i++) { - Result_Flower_Rotate_Y[1][i] = int.Parse(strSplit[i]); - } - break; - } - case nameof(Result_PlateShine_Count): { - Result_PlateShine_Count = int.Parse(strParam); - break; - } - case "Result_PlateShine_1P_X": { - Result_PlateShine_X[0] = new int[Result_PlateShine_Count]; - string[] strSplit = strParam.Split(','); - for (int i = 0; i < Result_PlateShine_Count; i++) { - Result_PlateShine_X[0][i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_PlateShine_2P_X": { - Result_PlateShine_X[1] = new int[Result_PlateShine_Count]; - string[] strSplit = strParam.Split(','); - for (int i = 0; i < Result_PlateShine_Count; i++) { - Result_PlateShine_X[1][i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_PlateShine_1P_Y": { - Result_PlateShine_Y[0] = new int[Result_PlateShine_Count]; - string[] strSplit = strParam.Split(','); - for (int i = 0; i < Result_PlateShine_Count; i++) { - Result_PlateShine_Y[0][i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_PlateShine_2P_Y": { - Result_PlateShine_Y[1] = new int[Result_PlateShine_Count]; - string[] strSplit = strParam.Split(','); - for (int i = 0; i < Result_PlateShine_Count; i++) { - Result_PlateShine_Y[1][i] = int.Parse(strSplit[i]); - } - break; - } - - case nameof(Result_Dan): { - Result_Dan = strParam.Split(',').Select(int.Parse).ToArray(); - break; - } - case nameof(Result_Dan_XY): { - Result_Dan_XY = strParam.Split(',').Select(int.Parse).ToArray(); - break; - } - case nameof(Result_Dan_Plate_XY): { - Result_Dan_Plate_XY = strParam.Split(',').Select(int.Parse).ToArray(); - break; - } - - - case "Result_UIMove_4P": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 4; i++) { - int moveX = int.Parse(strSplit[0]); - Result_UIMove_4P_X[i] = moveX * i; - - int moveY = int.Parse(strSplit[1]); - Result_UIMove_4P_Y[i] = moveY * i; - } - break; - } - case "Result_UIMove_5P": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 5; i++) { - int moveX = int.Parse(strSplit[0]); - Result_UIMove_5P_X[i] = moveX * i; - - int moveY = int.Parse(strSplit[1]); - Result_UIMove_5P_Y[i] = moveY * i; - } - break; - } - case "Result_UIMove_4P_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 4; i++) { - Result_UIMove_4P_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_UIMove_4P_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 4; i++) { - Result_UIMove_4P_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_UIMove_5P_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 5; i++) { - Result_UIMove_5P_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_UIMove_5P_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 5; i++) { - Result_UIMove_5P_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_DifficultyBar_4P": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Result_DifficultyBar_4P[i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_DifficultyBar_5P": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Result_DifficultyBar_5P[i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_Gauge_Base_4P": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Result_Gauge_Base_4P[i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_Gauge_Base_5P": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Result_Gauge_Base_5P[i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_Gauge_4P": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Result_Gauge_4P[i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_Gauge_5P": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Result_Gauge_5P[i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_Gauge_ClearText_4P": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Result_Gauge_ClearText_4P[i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_Gauge_ClearText_5P": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Result_Gauge_ClearText_5P[i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_Gauge_Rainbow_4P": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Result_Gauge_Rainbow_4P[i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_Gauge_Rainbow_5P": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Result_Gauge_Rainbow_5P[i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_Soul_Fire_4P": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Result_Soul_Fire_4P[i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_Soul_Fire_5P": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Result_Soul_Fire_5P[i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_Soul_Text_4P": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Result_Soul_Text_4P[i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_Soul_Text_5P": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Result_Soul_Text_5P[i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_Perfect_4P": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Result_Perfect_4P[i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_Perfect_5P": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Result_Perfect_5P[i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_Good_4P": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Result_Good_4P[i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_Good_5P": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Result_Good_5P[i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_Miss_4P": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Result_Miss_4P[i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_Miss_5P": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Result_Miss_5P[i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_Roll_4P": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Result_Roll_4P[i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_Roll_5P": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Result_Roll_5P[i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_MaxCombo_4P": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Result_MaxCombo_4P[i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_MaxCombo_5P": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Result_MaxCombo_5P[i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_ADLib_4P": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Result_ADLib_4P[i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_ADLib_5P": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Result_ADLib_5P[i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_Bomb_4P": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Result_Bomb_4P[i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_Bomb_5P": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Result_Bomb_5P[i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_Score_4P": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Result_Score_4P[i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_Score_5P": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Result_Score_5P[i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_ScoreRankEffect_4P": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Result_ScoreRankEffect_4P[i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_ScoreRankEffect_5P": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Result_ScoreRankEffect_5P[i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_CrownEffect_4P": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Result_CrownEffect_4P[i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_CrownEffect_5P": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Result_CrownEffect_5P[i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_Speech_Bubble_V2_4P": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Result_Speech_Bubble_V2_4P[i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_Speech_Bubble_V2_5P": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Result_Speech_Bubble_V2_5P[i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_Speech_Text_Offset": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Result_Speech_Text_Offset[i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_Speech_Text_Size": { - Result_Speech_Text_Size = int.Parse(strParam); - break; - } - case "Result_Speech_Text_MaxWidth": { - Result_Speech_Text_MaxWidth = int.Parse(strParam); - break; - } - case "Result_NamePlate_4P": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Result_NamePlate_4P[i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_NamePlate_5P": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Result_NamePlate_5P[i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_ModIcons_4P": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Result_ModIcons_4P[i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_ModIcons_5P": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Result_ModIcons_5P[i] = int.Parse(strSplit[i]); - } - break; - } - - #endregion - - #region AIResult - case "Result_AIBattle_Batch": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Result_AIBattle_Batch[i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_AIBattle_Batch_Move": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Result_AIBattle_Batch_Move[i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_AIBattle_SectionPlate_Offset": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Result_AIBattle_SectionPlate_Offset[i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_AIBattle_SectionText_Offset": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Result_AIBattle_SectionText_Offset[i] = int.Parse(strSplit[i]); - } - break; - } - case "Result_AIBattle_SectionText_Scale": { - Result_AIBattle_SectionText_Scale = int.Parse(strParam); - break; - } - case "Result_AIBattle_WinFlag": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Result_AIBattle_WinFlag[i] = int.Parse(strSplit[i]); - } - break; - } - #endregion - - #region DanResult - case "DanResult_StatePanel": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - DanResult_StatePanel[i] = int.Parse(strSplit[i]); - } - break; - } - case "DanResult_SongPanel_Main_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 3; i++) { - DanResult_SongPanel_Main_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "DanResult_SongPanel_Main_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 3; i++) { - DanResult_SongPanel_Main_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "DanResult_Difficulty_Cymbol_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 3; i++) { - DanResult_Difficulty_Cymbol_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "DanResult_Difficulty_Cymbol_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 3; i++) { - DanResult_Difficulty_Cymbol_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "DanResult_Level_Number_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 3; i++) { - DanResult_Level_Number_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "DanResult_Level_Number_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 3; i++) { - DanResult_Level_Number_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "DanResult_Sections_Perfect_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 3; i++) { - DanResult_Sections_Perfect_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "DanResult_Sections_Perfect_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 3; i++) { - DanResult_Sections_Perfect_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "DanResult_Sections_Good_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 3; i++) { - DanResult_Sections_Good_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "DanResult_Sections_Good_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 3; i++) { - DanResult_Sections_Good_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "DanResult_Sections_Miss_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 3; i++) { - DanResult_Sections_Miss_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "DanResult_Sections_Miss_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 3; i++) { - DanResult_Sections_Miss_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "DanResult_Sections_Roll_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 3; i++) { - DanResult_Sections_Roll_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "DanResult_Sections_Roll_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 3; i++) { - DanResult_Sections_Roll_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "DanResult_Perfect": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - DanResult_Perfect[i] = int.Parse(strSplit[i]); - } - break; - } - case "DanResult_Good": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - DanResult_Good[i] = int.Parse(strSplit[i]); - } - break; - } - case "DanResult_Miss": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - DanResult_Miss[i] = int.Parse(strSplit[i]); - } - break; - } - case "DanResult_Roll": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - DanResult_Roll[i] = int.Parse(strSplit[i]); - } - break; - } - case "DanResult_MaxCombo": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - DanResult_MaxCombo[i] = int.Parse(strSplit[i]); - } - break; - } - case "DanResult_TotalHit": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - DanResult_TotalHit[i] = int.Parse(strSplit[i]); - } - break; - } - case "DanResult_Score": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - DanResult_Score[i] = int.Parse(strSplit[i]); - } - break; - } - case "DanResult_Exam": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - DanResult_Exam[i] = int.Parse(strSplit[i]); - } - break; - } - case "DanResult_DanTitles_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 3; i++) { - DanResult_DanTitles_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "DanResult_DanTitles_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 3; i++) { - DanResult_DanTitles_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "DanResult_DanIcon_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 3; i++) { - DanResult_DanIcon_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "DanResult_DanIcon_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 3; i++) { - DanResult_DanIcon_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "DanResult_Rank": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - DanResult_Rank[i] = int.Parse(strSplit[i]); - } - break; - } - case "DanResult_Font_DanTitles_Size": { - DanResult_Font_DanTitles_Size = int.Parse(strParam); - break; - } - #endregion - - #region TowerResult - case "TowerResult_ScoreRankEffect": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - TowerResult_ScoreRankEffect[i] = int.Parse(strSplit[i]); - } - break; - } - case "TowerResult_Toutatsu": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - TowerResult_Toutatsu[i] = int.Parse(strSplit[i]); - } - break; - } - case "TowerResult_MaxFloors": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - TowerResult_MaxFloors[i] = int.Parse(strSplit[i]); - } - break; - } - case "TowerResult_Ten": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - TowerResult_Ten[i] = int.Parse(strSplit[i]); - } - break; - } - case "TowerResult_Score": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - TowerResult_Score[i] = int.Parse(strSplit[i]); - } - break; - } - case "TowerResult_CurrentFloor": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - TowerResult_CurrentFloor[i] = int.Parse(strSplit[i]); - } - break; - } - case "TowerResult_ScoreCount": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - TowerResult_ScoreCount[i] = int.Parse(strSplit[i]); - } - break; - } - case "TowerResult_RemainingLifes": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - TowerResult_RemainingLifes[i] = int.Parse(strSplit[i]); - } - break; - } - case "TowerResult_Gauge_Soul": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - TowerResult_Gauge_Soul[i] = int.Parse(strSplit[i]); - } - break; - } - case "TowerResult_Font_TowerText": { - TowerResult_Font_TowerText = int.Parse(strParam); - break; - } - case "TowerResult_Font_TowerText48": { - TowerResult_Font_TowerText48 = int.Parse(strParam); - break; - } - case "TowerResult_Font_TowerText72": { - TowerResult_Font_TowerText72 = int.Parse(strParam); - break; - } - #endregion - - #region Heya - case "Heya_Main_Menu_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 5; i++) { - Heya_Main_Menu_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "Heya_Main_Menu_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 5; i++) { - Heya_Main_Menu_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "Heya_Main_Menu_Font_Offset": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 5; i++) { - Heya_Main_Menu_Font_Offset[i] = int.Parse(strSplit[i]); - } - break; - } - case "Heya_Font_Scale": { - Heya_Font_Scale = int.Parse(strParam); - break; - } - case "Heya_Center_Menu_Box_Count": { - Heya_Center_Menu_Box_Count = int.Parse(strParam); - break; - } - case "Heya_Center_Menu_Box_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < Heya_Center_Menu_Box_Count; i++) { - Heya_Center_Menu_Box_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "Heya_Center_Menu_Box_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < Heya_Center_Menu_Box_Count; i++) { - Heya_Center_Menu_Box_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "Heya_Center_Menu_Box_Item_Offset": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Heya_Center_Menu_Box_Item_Offset[i] = int.Parse(strSplit[i]); - } - break; - } - case "Heya_Center_Menu_Box_Name_Offset": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Heya_Center_Menu_Box_Name_Offset[i] = int.Parse(strSplit[i]); - } - break; - } - case "Heya_Center_Menu_Box_Authors_Offset": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Heya_Center_Menu_Box_Authors_Offset[i] = int.Parse(strSplit[i]); - } - break; - } - case "Heya_Side_Menu_Count": { - Heya_Side_Menu_Count = int.Parse(strParam); - break; - } - case "Heya_Side_Menu_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < Heya_Side_Menu_Count; i++) { - Heya_Side_Menu_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "Heya_Side_Menu_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < Heya_Side_Menu_Count; i++) { - Heya_Side_Menu_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "Heya_Side_Menu_Font_Offset": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Heya_Side_Menu_Font_Offset[i] = int.Parse(strSplit[i]); - } - break; - } - case "Heya_InfoSection": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Heya_InfoSection[i] = int.Parse(strSplit[i]); - } - break; - } - case "Heya_DescriptionTextOrigin": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Heya_DescriptionTextOrigin[i] = int.Parse(strSplit[i]); - } - break; - } - #endregion - - #region OnlineLounge - case "OnlineLounge_Side_Menu": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - OnlineLounge_Side_Menu[i] = int.Parse(strSplit[i]); - } - break; - } - case "OnlineLounge_Side_Menu_Text_Offset": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - OnlineLounge_Side_Menu_Text_Offset[i] = int.Parse(strSplit[i]); - } - break; - } - case "OnlineLounge_Side_Menu_Move": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - OnlineLounge_Side_Menu_Move[i] = int.Parse(strSplit[i]); - } - break; - } - case "OnlineLounge_Song": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - OnlineLounge_Song[i] = int.Parse(strSplit[i]); - } - break; - } - case "OnlineLounge_Song_Title_Offset": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - OnlineLounge_Song_Title_Offset[i] = int.Parse(strSplit[i]); - } - break; - } - case "OnlineLounge_Song_SubTitle_Offset": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - OnlineLounge_Song_SubTitle_Offset[i] = int.Parse(strSplit[i]); - } - break; - } - case "OnlineLounge_Song_Move": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - OnlineLounge_Song_Move[i] = int.Parse(strSplit[i]); - } - break; - } - case "OnlineLounge_Context_Charter": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - OnlineLounge_Context_Charter[i] = int.Parse(strSplit[i]); - } - break; - } - case "OnlineLounge_Context_Genre": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - OnlineLounge_Context_Genre[i] = int.Parse(strSplit[i]); - } - break; - } - case "OnlineLounge_Context_Couse_Symbol": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - OnlineLounge_Context_Couse_Symbol[i] = int.Parse(strSplit[i]); - } - break; - } - case "OnlineLounge_Context_Level": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - OnlineLounge_Context_Level[i] = int.Parse(strSplit[i]); - } - break; - } - case "OnlineLounge_Context_Couse_Move": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - OnlineLounge_Context_Couse_Move[i] = int.Parse(strSplit[i]); - } - break; - } - case "OnlineLounge_Downloading": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - OnlineLounge_Downloading[i] = int.Parse(strSplit[i]); - } - break; - } - case "OnlineLounge_Font_OLFont": { - OnlineLounge_Font_OLFont = int.Parse(strParam); - break; - } - case "OnlineLounge_Font_OLFontLarge": { - OnlineLounge_Font_OLFontLarge = int.Parse(strParam); - break; - } - #endregion - - #region TowerSelect - case "TowerSelect_Title_Size": { - TowerSelect_Title_Size = int.Parse(strParam); - break; - } - case "TowerSelect_Title_MaxWidth": { - TowerSelect_Title_MaxWidth = int.Parse(strParam); - break; - } - case "TowerSelect_Title_Offset": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - TowerSelect_Title_Offset[i] = int.Parse(strSplit[i]); - } - break; - } - case "TowerSelect_SubTitle_Size": { - TowerSelect_SubTitle_Size = int.Parse(strParam); - break; - } - case "TowerSelect_SubTitle_MaxWidth": { - TowerSelect_SubTitle_MaxWidth = int.Parse(strParam); - break; - } - case "TowerSelect_SubTitle_Offset": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - TowerSelect_SubTitle_Offset[i] = int.Parse(strSplit[i]); - } - break; - } - case "TowerSelect_Bar_Count": { - TowerSelect_Bar_Count = int.Parse(strParam); - break; - } - case "TowerSelect_Bar_X": { - TowerSelect_Bar_X = new int[TowerSelect_Bar_Count]; - - string[] strSplit = strParam.Split(','); - for (int i = 0; i < TowerSelect_Bar_Count; i++) { - TowerSelect_Bar_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "TowerSelect_Bar_Y": { - TowerSelect_Bar_Y = new int[TowerSelect_Bar_Count]; - - string[] strSplit = strParam.Split(','); - for (int i = 0; i < TowerSelect_Bar_Count; i++) { - TowerSelect_Bar_Y[i] = int.Parse(strSplit[i]); - } - break; - } - #endregion - - #region OpenEncyclopedia - case "OpenEncyclopedia_Context_Item2": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - OpenEncyclopedia_Context_Item2[i] = int.Parse(strSplit[i]); - } - break; - } - case "OpenEncyclopedia_Context_Item3": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - OpenEncyclopedia_Context_Item3[i] = int.Parse(strSplit[i]); - } - break; - } - case "OpenEncyclopedia_Context_PageText": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - OpenEncyclopedia_Context_PageText[i] = int.Parse(strSplit[i]); - } - break; - } - case "OpenEncyclopedia_Side_Menu": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - OpenEncyclopedia_Side_Menu[i] = int.Parse(strSplit[i]); - } - break; - } - case "OpenEncyclopedia_Side_Menu_Move": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - OpenEncyclopedia_Side_Menu_Move[i] = int.Parse(strSplit[i]); - } - break; - } - case "OpenEncyclopedia_Side_Menu_Text_Offset": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - OpenEncyclopedia_Side_Menu_Text_Offset[i] = int.Parse(strSplit[i]); - } - break; - } - case "OpenEncyclopedia_Font_EncyclopediaMenu_Size": { - OpenEncyclopedia_Font_EncyclopediaMenu_Size = int.Parse(strParam); - break; - } - #endregion - - #region Exit - case "Exit_Duration": { - Exit_Duration = int.Parse(strParam); - break; - } - #endregion - - #region Font - case nameof(Font_Edge_Ratio): //Config画面や簡易メニューのフォントについて(rhimm) - { - if (int.Parse(strParam) > 0) - Font_Edge_Ratio = int.Parse(strParam); - break; - } - case nameof(Font_Edge_Ratio_Vertical): //TITLEやSUBTITLEなど、縦に書かれることのあるフォントについて(rhimm) - { - if (int.Parse(strParam) > 0) - Font_Edge_Ratio_Vertical = int.Parse(strParam); - break; - } - case nameof(Text_Correction_X): { - Text_Correction_X = int.Parse(strParam); - break; - } - case nameof(Text_Correction_Y): { - Text_Correction_Y = int.Parse(strParam); - break; - } - #endregion - - #region PopupMenu - case "PopupMenu_Menu_Title": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - PopupMenu_Menu_Title[i] = int.Parse(strSplit[i]); - } - break; - } - case "PopupMenu_Title": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - PopupMenu_Title[i] = int.Parse(strSplit[i]); - } - break; - } - case "PopupMenu_Menu_Highlight": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - PopupMenu_Menu_Highlight[i] = int.Parse(strSplit[i]); - } - break; - } - case "PopupMenu_MenuItem_Name": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - PopupMenu_MenuItem_Name[i] = int.Parse(strSplit[i]); - } - break; - } - case "PopupMenu_MenuItem_Value": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - PopupMenu_MenuItem_Value[i] = int.Parse(strSplit[i]); - } - break; - } - case "PopupMenu_Move": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - PopupMenu_Move[i] = int.Parse(strSplit[i]); - } - break; - } - case "PopupMenu_Font_Size": { - PopupMenu_Font_Size = int.Parse(strParam); - break; - } - #endregion - - #region NamePlate - case "NamePlate_Title_Offset": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - NamePlate_Title_Offset[i] = int.Parse(strSplit[i]); - } - break; - } - case "NamePlate_Dan_Offset": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - NamePlate_Dan_Offset[i] = int.Parse(strSplit[i]); - } - break; - } - case "NamePlate_Name_Offset_Normal": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - NamePlate_Name_Offset_Normal[i] = int.Parse(strSplit[i]); - } - break; - } - case "NamePlate_Name_Offset_WithTitle": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - NamePlate_Name_Offset_WithTitle[i] = int.Parse(strSplit[i]); - } - break; - } - case "NamePlate_Name_Offset_Full": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - NamePlate_Name_Offset_Full[i] = int.Parse(strSplit[i]); - } - break; - } - case "NamePlate_Name_Width_Normal": { - NamePlate_Name_Width_Normal = int.Parse(strParam); - break; - } - case "NamePlate_Name_Width_Full": { - NamePlate_Name_Width_Full = int.Parse(strParam); - break; - } - case "NamePlate_Title_Width": { - NamePlate_Title_Width = int.Parse(strParam); - break; - } - case "NamePlate_Dan_Width": { - NamePlate_Dan_Width = int.Parse(strParam); - break; - } - case "NamePlate_Font_Name_Size_Normal": { - NamePlate_Font_Name_Size_Normal = int.Parse(strParam); - break; - } - case "NamePlate_Font_Name_Size_WithTitle": { - NamePlate_Font_Name_Size_WithTitle = int.Parse(strParam); - break; - } - case "NamePlate_Font_Title_Size": { - NamePlate_Font_Title_Size = int.Parse(strParam); - break; - } - case "NamePlate_Font_Dan_Size": { - NamePlate_Font_Dan_Size = int.Parse(strParam); - break; - } - #endregion - - #region Modal - case "Modal_Title_Full": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Modal_Title_Full[i] = int.Parse(strSplit[i]); - } - break; - } - case "Modal_Title_Half_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Modal_Title_Half_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "Modal_Title_Half_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Modal_Title_Half_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "Modal_Text_Full": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Modal_Text_Full[i] = int.Parse(strSplit[i]); - } - break; - } - case "Modal_Text_Full_Move": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Modal_Text_Full_Move[i] = int.Parse(strSplit[i]); - } - break; - } - case "Modal_Text_Half_X": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Modal_Text_Half_X[i] = int.Parse(strSplit[i]); - } - break; - } - case "Modal_Text_Half_Y": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Modal_Text_Half_Y[i] = int.Parse(strSplit[i]); - } - break; - } - case "Modal_Text_Half_Move": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Modal_Text_Half_Move[i] = int.Parse(strSplit[i]); - } - break; - } - case "Modal_Font_ModalContentHalf_Size": { - Modal_Font_ModalContentHalf_Size = int.Parse(strParam); - break; - } - case "Modal_Font_ModalTitleHalf_Size": { - Modal_Font_ModalTitleHalf_Size = int.Parse(strParam); - break; - } - case "Modal_Font_ModalContentFull_Size": { - Modal_Font_ModalContentFull_Size = int.Parse(strParam); - break; - } - case "Modal_Font_ModalTitleFull_Size": { - Modal_Font_ModalTitleFull_Size = int.Parse(strParam); - break; - } - case "Modal_Title_Half_X_4P": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 4; i++) { - Modal_Title_Half_X_4P[i] = int.Parse(strSplit[i]); - } - break; - } - case "Modal_Title_Half_X_5P": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 5; i++) { - Modal_Title_Half_X_5P[i] = int.Parse(strSplit[i]); - } - break; - } - case "Modal_Title_Half_Y_4P": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 4; i++) { - Modal_Title_Half_Y_4P[i] = int.Parse(strSplit[i]); - } - break; - } - case "Modal_Title_Half_Y_5P": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 5; i++) { - Modal_Title_Half_Y_5P[i] = int.Parse(strSplit[i]); - } - break; - } - case "Modal_Text_Half_X_4P": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 4; i++) { - Modal_Text_Half_X_4P[i] = int.Parse(strSplit[i]); - } - break; - } - case "Modal_Text_Half_X_5P": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 5; i++) { - Modal_Text_Half_X_5P[i] = int.Parse(strSplit[i]); - } - break; - } - case "Modal_Text_Half_Y_4P": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 4; i++) { - Modal_Text_Half_Y_4P[i] = int.Parse(strSplit[i]); - } - break; - } - case "Modal_Text_Half_Y_5P": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 5; i++) { - Modal_Text_Half_Y_5P[i] = int.Parse(strSplit[i]); - } - break; - } - case "Modal_Text_Half_Move_4P": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Modal_Text_Half_Move_4P[i] = int.Parse(strSplit[i]); - } - break; - } - case "Modal_Text_Half_Move_5P": { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Modal_Text_Half_Move_5P[i] = int.Parse(strSplit[i]); - } - break; - } - #endregion - default: - foreach (string code in CLangManager.Langcodes) { - if (strCommand == "FontName" + code.ToUpper()) { - strParam = strParam.Replace('/', System.IO.Path.DirectorySeparatorChar); - strParam = strParam.Replace('\\', System.IO.Path.DirectorySeparatorChar); - if (HPrivateFastFont.FontExists(strParam)) _fontNameLocalized.Add(code, strParam); - strParam = Path(strParam); - if (HPrivateFastFont.FontExists(strParam)) _fontNameLocalized.Add(code, strParam); - } - if (strCommand == "BoxFontName" + code.ToUpper()) { - strParam = strParam.Replace('/', System.IO.Path.DirectorySeparatorChar); - strParam = strParam.Replace('\\', System.IO.Path.DirectorySeparatorChar); - if (HPrivateFastFont.FontExists(strParam)) _boxFontNameLocalized.Add(code, strParam); - strParam = Path(strParam); - if (HPrivateFastFont.FontExists(Path(strParam))) _boxFontNameLocalized.Add(code, strParam); - } - } - break; - - #endregion - } - } - continue; - } catch (Exception exception) { - Trace.TraceError(exception.ToString()); - Trace.TraceError("例外が発生しましたが処理を継続します。 (6a32cc37-1527-412e-968a-512c1f0135cd)"); - continue; - } - } - } - } - - private void t座標の追従設定() { - // - if (bFieldBgPointOverride == true) { - - } - } - - #region [ IDisposable 実装 ] - //----------------- - public void Dispose() { - if (!this.bDisposed済み) { - for (int i = 0; i < this.nシステムサウンド数; i++) - this[i].Dispose(); - - this.bDisposed済み = true; - } - } - //----------------- #endregion - - - // その他 - - #region [ private ] - //----------------- - private bool bDisposed済み; - //----------------- + #region [ System/ に、カレントSkinパスを再設定する。] + strSystemSkinSubfolderFullName = strSystemSkinRoot; + strSystemSkinSubfolders = new string[1] { strSystemSkinSubfolderFullName }; #endregion - - #region 背景(スクロール) - public int[] Background_Scroll_Y = new int[] { 0, 536 }; - #endregion - - - #region[ 座標 ] - //2017.08.11 kairera0467 DP実用化に向けてint配列に変更 - - //フィールド位置 Xは判定枠部分の位置。Yはフィールドの最上部の座標。 - //現時点ではノーツ画像、Senotes画像、判定枠が連動する。 - //Xは中央基準描画、Yは左上基準描画 - public int[] nScrollFieldX = new int[] { 349, 349 }; - public int[] nScrollFieldY = new int[] { 192, 368 }; - - public int[] nScrollField_4P = new int[] { 349, 46 }; - public int[] nScrollField_5P = new int[] { 349, 27 }; - - //中心座標指定 - public int[] nJudgePointX = new int[] { 413, 413, 413, 413 }; - public int[] nJudgePointY = new int[] { 256, 433, 0, 0 }; - - //フィールド背景画像 - //ScrollField座標への追従設定が可能。 - //分岐背景、ゴーゴー背景が連動する。(全て同じ大きさ、位置で作成すること。) - //左上基準描画 - public bool bFieldBgPointOverride = false; - //SEnotes - //音符座標に加算 - public int[] nSENotesX = new int[] { -2, -2 }; - public int[] nSENotesY = new int[] { 131, 131 }; - - public int[] nSENotes_4P = new int[] { -2, 100 }; - public int[] nSENotes_5P = new int[] { -2, 94 }; - - //光る太鼓部分 - public int nMtaikoBackgroundX = 0; - public int nMtaikoBackgroundY = 184; - public int nMtaikoFieldX = 0; - public int nMtaikoFieldY = 184; - public int nMtaikoMainX = 0; - public int nMtaikoMainY = 0; - - //コンボ - public int[] nComboNumberX = new int[] { 0, 0, 0, 0 }; - public int[] nComboNumberY = new int[] { 212, 388, 0, 0 }; - public int[] nComboNumberTextY = new int[] { 271, 447, 0, 0 }; - public int[] nComboNumberTextLargeY = new int[] { 270, 446, 0, 0 }; - public float fComboNumberSpacing = 0; - public float fComboNumberSpacing_l = 0; - - public EDifficultyDisplayType eDiffDispMode; - public bool b現在のステージ数を表示しない; - - //リザルト画面 - //現在のデフォルト値はダミーです。 - public int nResultPanelP1X = 0; - public int nResultPanelP1Y = 0; - public int nResultPanelP2X = 515; - public int nResultPanelP2Y = 75; - public int nResultScoreP1X = 295; - public int nResultScoreP1Y = 212; - public int nResultJudge1_P1X = 495; - public int nResultJudge1_P1Y = 182; - public int nResultJudge2_P1X = 968; - public int nResultJudge2_P1Y = 174; - - public int nResultNumberP1X = 490; - public int nResultNumberP2X = 875; - - public int nResultNumberY = 188; - public int nResultNumberYPadding = 42; - - public int nResultGaugeBaseP1X = 56; - public int nResultGaugeBaseP1Y = 141; - public int nResultGaugeBaseP2X = 555; - public int nResultGaugeBaseP2Y = 122; - public int nResultGaugeBodyP1X = 559; - public int nResultGaugeBodyP1Y = 125; - #endregion - - public string[] strStringを配列に直す(string str) { - string[] strArray = str.Split(','); - return strArray; - } - - public enum RollColorMode { - None, // PS4, Switchなど - All, // 旧筐体(旧作含む) - WithoutStart // 新筐体 - } - public enum ReferencePoint //テクスチャ描画の基準点を変更可能にするための値(rhimm) - { - Center, - Left, - Right - } - - #region 新・SkinConfig - #region General - public string Skin_Name = "Unknown"; - public string Skin_Version = "Unknown"; - public string Skin_Creator = "Unknown"; - public int[] Resolution = new int[] { 1280, 720 }; - public string FontName { get { return _fontNameLocalized.TryGetValue(CLangManager.fetchLang(), out string value) ? value : ""; } } - private Dictionary _fontNameLocalized = new Dictionary(); - public string BoxFontName { get { return _boxFontNameLocalized.TryGetValue(CLangManager.fetchLang(), out string value) ? value : ""; } } - private Dictionary _boxFontNameLocalized = new Dictionary(); - #endregion - - #region Config - - public int[] Config_Arrow_X = new int[] { 552, 552 }; - public int[] Config_Arrow_Y = new int[] { 297, 363 }; - - public int[] Config_Arrow_Focus_X = new int[] { 552, 552 }; - public int[] Config_Arrow_Focus_Y = new int[] { 279, 381 }; - - public int[] Config_Item_X = new int[] { 282, 282, 282 }; - public int[] Config_Item_Y = new int[] { 153, 192, 231 }; - public int Config_Item_Width = 100; - public int[] Config_Item_Font_Offset = new int[] { 0, 8 }; - - public int Config_Font_Scale = 20; - public float Config_Font_Scale_Description = 14.0f; - - public Color Config_Selected_Menu_Text_Grad_Color_1 = Color.Yellow; - public Color Config_Selected_Menu_Text_Grad_Color_2 = Color.OrangeRed; - - public int Config_ItemBox_Count = 10; - public int[] Config_ItemBox_X = new int[] { 602, 602, 602, 602, 602, 602, 602, 602, 602, 602 }; - public int[] Config_ItemBox_Y = new int[] { 4, 79, 154, 229, 304, 379, 454, 529, 604, 679 }; - public int[] Config_ItemBox_Font_Offset = new int[] { 20, 12 }; - public int[] Config_ItemBox_ItemValue_Font_Offset = new int[] { 400, 12 }; - - public int[] Config_ExplanationPanel = new int[] { 67, 382 }; - public int[] Config_SkinSample1 = new int[] { 124, 449 }; - - public int[] Config_KeyAssign = new int[] { 389, 215 }; - public int[] Config_KeyAssign_Menu_Highlight = new int[] { 324, 66 }; - public int[] Config_KeyAssign_Font = new int[] { 308, 64 }; - public int Config_KeyAssign_Move = 20; - - public int[] Config_Calibration_OffsetText = new int[] { 300, 288 }; - public int[] Config_Calibration_InfoText = new int[] { 8, 550 }; - public Rectangle[] Config_Calibration_Highlights = new Rectangle[] { - new Rectangle(371, 724, 371, 209), - new Rectangle(774, 724, 371, 209), - new Rectangle(1179, 724, 371, 209) - }; - - #endregion - - #region Puchichara - - public int Puchichara_Ptn; - public string[] Puchicharas_Name; - - #endregion - - #region Characters - - public int Characters_Ptn; - public string[] Characters_DirName; - public int[] Characters_Normal_Ptn, - Characters_Normal_Missed_Ptn, - Characters_Normal_MissedDown_Ptn, - Characters_Normal_Cleared_Ptn, - Characters_Normal_Maxed_Ptn, - Characters_MissIn_Ptn, - Characters_MissDownIn_Ptn, - Characters_GoGoTime_Ptn, - Characters_GoGoTime_Maxed_Ptn, - Characters_10Combo_Ptn, - Characters_10Combo_Clear_Ptn, - Characters_10Combo_Maxed_Ptn, - Characters_GoGoStart_Ptn, - Characters_GoGoStart_Clear_Ptn, - Characters_GoGoStart_Maxed_Ptn, - Characters_Become_Cleared_Ptn, - Characters_Become_Maxed_Ptn, - Characters_SoulOut_Ptn, - Characters_ClearOut_Ptn, - Characters_Return_Ptn, - Characters_Balloon_Breaking_Ptn, - Characters_Balloon_Broke_Ptn, - Characters_Balloon_Miss_Ptn, - Characters_Kusudama_Idle_Ptn, - Characters_Kusudama_Breaking_Ptn, - Characters_Kusudama_Broke_Ptn, - Characters_Kusudama_Miss_Ptn, - Characters_Title_Entry_Ptn, - Characters_Title_Normal_Ptn, - Characters_Menu_Loop_Ptn, - Characters_Menu_Select_Ptn, - Characters_Menu_Start_Ptn, - Characters_Menu_Wait_Ptn, - Characters_Result_Clear_Ptn, - Characters_Result_Failed_Ptn, - Characters_Result_Failed_In_Ptn, - Characters_Result_Normal_Ptn, - Characters_Tower_Standing_Ptn, - Characters_Tower_Climbing_Ptn, - Characters_Tower_Running_Ptn, - Characters_Tower_Clear_Ptn, - Characters_Tower_Fail_Ptn, - Characters_Tower_Standing_Tired_Ptn, - Characters_Tower_Climbing_Tired_Ptn, - Characters_Tower_Running_Tired_Ptn, - Characters_Tower_Clear_Tired_Ptn; - - // Config - - public int[][] Characters_Resolution; - public int[][] Characters_Heya_Render_Offset; - public bool[] Characters_UseResult1P; - public int[][] Characters_X; - public int[][] Characters_Y; - public int[][] Characters_4P; - public int[][] Characters_5P; - public int[][] Characters_X_AI; - public int[][] Characters_Y_AI; - public int[][] Characters_Balloon_X; - public int[][] Characters_Balloon_Y; - public int[][] Characters_Balloon_4P; - public int[][] Characters_Balloon_5P; - public int[][] Characters_Kusudama_X; - public int[][] Characters_Kusudama_Y; - public int[][] Characters_Motion_Normal, - Characters_Motion_10Combo, - Characters_Motion_10Combo_Clear, - Characters_Motion_10ComboMax, - Characters_Motion_Miss, - Characters_Motion_MissDown, - Characters_Motion_ClearIn, - Characters_Motion_Clear, - Characters_Motion_ClearMax, - Characters_Motion_MissIn, - Characters_Motion_MissDownIn, - Characters_Motion_GoGoStart, - Characters_Motion_GoGoStart_Clear, - Characters_Motion_GoGoStartMax, - Characters_Motion_GoGo, - Characters_Motion_GoGoMax, - Characters_Motion_SoulIn, - Characters_Motion_SoulOut, - Characters_Motion_ClearOut, - Characters_Motion_Return; - public float[] Characters_Beat_Normal, - Characters_Beat_10Combo, - Characters_Beat_10Combo_Clear, - Characters_Beat_10ComboMax, - Characters_Beat_Miss, - Characters_Beat_MissDown, - Characters_Beat_ClearIn, - Characters_Beat_Clear, - Characters_Beat_ClearMax, - Characters_Beat_MissIn, - Characters_Beat_MissDownIn, - Characters_Beat_GoGoStart, - Characters_Beat_GoGoStart_Clear, - Characters_Beat_GoGoStartMax, - Characters_Beat_GoGo, - Characters_Beat_GoGoMax, - Characters_Beat_SoulIn, - Characters_Beat_SoulOut, - Characters_Beat_ClearOut, - Characters_Beat_Return, - Characters_Beat_Tower_Standing, - Characters_Beat_Tower_Standing_Tired, - Characters_Beat_Tower_Fail, - Characters_Beat_Tower_Clear, - Characters_Beat_Tower_Clear_Tired; - public bool[] Characters_Tower_Clear_IsLooping, - Characters_Tower_Clear_Tired_IsLooping, - Characters_Tower_Fail_IsLooping; - public int[] Characters_Balloon_Timer; - public int[] Characters_Balloon_Delay; - public int[] Characters_Balloon_FadeOut; - - public int[] Characters_Title_Entry_AnimationDuration; - public int[] Characters_Title_Normal_AnimationDuration; - public int[] Characters_Menu_Loop_AnimationDuration; - public int[] Characters_Menu_Select_AnimationDuration; - public int[] Characters_Menu_Start_AnimationDuration; - public int[] Characters_Menu_Wait_AnimationDuration; - public int[] Characters_Result_Normal_AnimationDuration; - public int[] Characters_Result_Clear_AnimationDuration; - public int[] Characters_Result_Failed_In_AnimationDuration; - public int[] Characters_Result_Failed_AnimationDuration; - - #endregion - - #region [Adjustments] - public int[] Adjustments_MenuPuchichara_X = new int[] { -100, 100 }; - public int[] Adjustments_MenuPuchichara_Y = new int[] { -100, -100 }; - - #endregion - - #region [Startup] - public int StartUp_LangSelect_FontSize = 16; - #endregion - - #region [Title Screen] - - public int Title_LoadingPinInstances = 5; - public int Title_LoadingPinFrameCount = 8; - public int Title_LoadingPinCycle = 320; - public int[] Title_LoadingPinBase = new int[] { 480, 410 }; - public int[] Title_LoadingPinDiff = new int[] { 90, 0 }; - - public int[] Title_Entry_Bar_Text_X = new int[] { 563, 563 }; - public int[] Title_Entry_Bar_Text_Y = new int[] { 312, 430 }; - - public int[] Title_Banapas_Load_Clear_Anime = new int[] { 198, 514 }; - - public int[] Title_Entry_Player_Select_X = new int[] { 337, 529, 743 }; - public int[] Title_Entry_Player_Select_Y = new int[] { 488, 487, 486 }; - - public int[][][] Title_Entry_Player_Select_Rect = new int[][][] { - new int[][] { new int[] { 0, 0, 199, 92 } ,new int[] { 199, 0, 224, 92 } }, - new int[][] { new int[] { 0, 92, 199, 92 } ,new int[] { 199, 92, 224, 92 } }, - new int[][] { new int[] { 0, 184, 199, 92 } ,new int[] { 199, 184, 224, 92 } } - }; - public int[] Title_Entry_NamePlate = new int[] { 530, 385 }; - - public int[] Title_ModeSelect_Bar_X = new int[] { 290, 319, 356 }; - public int[] Title_ModeSelect_Bar_Y = new int[] { 107, 306, 513 }; - - public int[] Title_ModeSelect_Bar_Offset = new int[] { 20, 112 }; - - public int[] Title_ModeSelect_Title_Offset = new int[] { 311, 72 }; - public int[] Title_ModeSelect_Title_Scale = new int[] { 36, 15 }; - - public int[] Title_ModeSelect_Bar_Center_X = new int[] { 320, 320, 640 }; - public int[] Title_ModeSelect_Bar_Center_Y = new int[] { 338, 360, 360 }; - public int[][] Title_ModeSelect_Bar_Center_Rect = new int[][] { - new int[] { 0, 0, 641, 27 }, - new int[] { 0, 76, 641, 30 }, - new int[] { 0, 27, 641, 45 }, - }; - - public int[] Title_ModeSelect_Bar_Overlay_X = new int[] { 320, 320, 640 }; - public int[] Title_ModeSelect_Bar_Overlay_Y = new int[] { 306, 333, 333 }; - public int[][] Title_ModeSelect_Bar_Overlay_Rect = new int[][] { - new int[] { 0, 0, 641, 27 }, - new int[] { 0, 71, 641, 35 }, - new int[] { 0, 27, 641, 1 }, - }; - - public int[] Title_ModeSelect_Bar_Move = new int[] { 40, 100 }; - public int[] Title_ModeSelect_Bar_Move_X = new int[] { 0, 0 }; - public int[] Title_ModeSelect_Overlay_Move = new int[] { 40, 120 }; - public int[] Title_ModeSelect_Overlay_Move_X = new int[] { 0, 0 }; - - public int[] Title_ModeSelect_Bar_Chara_X = new int[] { 446, 835 }; - public int[] Title_ModeSelect_Bar_Chara_Y = new int[] { 360, 360 }; - - public int Title_ModeSelect_Bar_Chara_Move = 45; - - public int[] Title_ModeSelect_Bar_Center_Title = new int[] { 631, 379 }; - public int Title_ModeSelect_Bar_Center_Title_Move = 60; - public int Title_ModeSelect_Bar_Center_Title_Move_X = 0; - - public int[] Title_ModeSelect_Bar_Center_BoxText = new int[] { 640, 397 }; - - public bool Title_VerticalText = false; - public bool Title_VerticalBar = false; - - #endregion - - #region SongSelect - public string[] SongSelect_GenreName = { "ポップス", "アニメ", "ゲームバラエティ", "ナムコオリジナル", "クラシック", "バラエティ", "キッズ", "ボーカロイド", "最近遊んだ曲" }; - - public int SongSelect_Bar_Count = 9; - - public int[] SongSelect_Bar_X = new int[] { 214, 239, 263, 291, 324, 358, 386, 411, 436 }; - public int[] SongSelect_Bar_Y = new int[] { -127, -36, 55, 145, 314, 485, 574, 665, 756 }; - public int[] SongSelect_Bar_Anim_X = new int[] { 0, 600, 500, 400, 0, -400, -500, -600, 0 }; - public int[] SongSelect_Bar_Anim_Y = new int[] { 0, 1800, 1500, 1200, 0, -1200, -1500, -1800, 0 }; - - public float SongSelect_Scroll_Interval = 0.12f; - - public int[] SongSelect_Bar_Title_Offset = new int[] { 316, 62 }; - public int[] SongSelect_Bar_Box_Offset = new int[] { 316, 62 }; - public int[] SongSelect_Bar_BackBox_Offset = new int[] { 316, 62 }; - public int[] SongSelect_Bar_Random_Offset = new int[] { 316, 62 }; - public int[] SongSelect_Bar_SubTitle_Offset = new int[] { 316, 90 }; - - public int[] SongSelect_DanStatus_Offset_X = new int[] { 30, 602 }; - public int[] SongSelect_DanStatus_Offset_Y = new int[] { 30, 30 }; - - public int[] SongSelect_TowerStatus_Offset_X = new int[] { 30, 602 }; - public int[] SongSelect_TowerStatus_Offset_Y = new int[] { 30, 30 }; - - public int[] SongSelect_RegularCrowns_Offset_X = new int[] { 30, 602 }; - public int[] SongSelect_RegularCrowns_Offset_Y = new int[] { 30, 30 }; - - public int[] SongSelect_RegularCrowns_ScoreRank_Offset_X = new int[] { 0, 0 }; - public int[] SongSelect_RegularCrowns_ScoreRank_Offset_Y = new int[] { 0, 30 }; - - public int[] SongSelect_RegularCrowns_Difficulty_Cymbol_Offset_X = new int[] { 22, 22 }; - public int[] SongSelect_RegularCrowns_Difficulty_Cymbol_Offset_Y = new int[] { 22, 52 }; - - public int[] SongSelect_FavoriteStatus_Offset = new int[] { 90, 30 }; - - public int SongSelect_BoxName_Scale = 28; - public int SongSelect_MusicName_Scale = 22; - public int SongSelect_Subtitle_Scale = 13; - public int SongSelect_BoxText_Scale = 14; - public bool SongSelect_VerticalText = false; - - public int SongSelect_Title_MaxSize = 550; - public int SongSelect_SubTitle_MaxSize = 510; - - public bool SongSelect_Maker_Show = false; - public int[] SongSelect_Maker = new int[] { 1285, 190 }; - public int SongSelect_Maker_Size = 23; - public int SongSelect_Maker_MaxSize = 180; - - public bool SongSelect_BPM_Text_Show = false; - public int[] SongSelect_BPM_Text = new int[] { 1240, 20 }; - public int SongSelect_BPM_Text_MaxSize = 180; - public int SongSelect_BPM_Text_Size = 23; - - public bool SongSelect_Shorten_Frame_Fade = false; - public bool SongSelect_Bar_Select_Skip_Fade = false; - - public int[] SongSelect_Explicit = new int[] { 1240, 60 }; - public int[] SongSelect_Movie = new int[] { 0, 0 }; - - public int SongSelect_Bar_Center_Move = 62; - public int SongSelect_Bar_Center_Move_X = 0; - - public int[] SongSelect_Bar_Select = new int[] { 309, 235 }; - - public int[] SongSelect_Frame_Score_X = new int[] { 400, 522, 644, 766 }; - public int[] SongSelect_Frame_Score_Y = new int[] { 228, 228, 228, 228 }; - - public int[] SongSelect_Level_Number_X = new int[] { 485, 607, 729, 851 }; - public int[] SongSelect_Level_Number_Y = new int[] { 400, 400, 400, 400 }; - public int[] SongSelect_Level_Number_Tower = new int[] { 485, 400 }; - public int[] SongSelect_Tower_Side = new int[] { 485, 400 }; - - public int[] SongSelect_Level_X = new int[] { 485, 607, 729, 851 }; - public int[] SongSelect_Level_Y = new int[] { 400, 400, 400, 400 }; - public int[] SongSelect_Level_Move = new int[] { 0, -17 }; - - public int[] SongSelect_Unlock_Conditions_Text = new int[] { 72, 128 }; - - public int[] SongSelect_Level_Number_Interval = new int[] { 11, 0 }; - - public float SongSelect_Box_Opening_Interval = 1f; - - public int[] SongSelect_Difficulty_Select_Title = new int[] { 640, 140 }; - public int[] SongSelect_Difficulty_Select_SubTitle = new int[] { 640, 180 }; - - public int SongSelect_Box_Chara_Move = 114; - - public int[] SongSelect_Box_Chara_X = new int[] { 434, 846 }; - public int[] SongSelect_Box_Chara_Y = new int[] { 360, 360 }; - - public int SongSelect_BoxExplanation_X = 640; - public int SongSelect_BoxExplanation_Y = 360; - - public int SongSelect_BoxExplanation_Interval = 30; - - public int[] SongSelect_NamePlate_X = new int[] { 36, 1020, 216, 840, 396 }; - public int[] SongSelect_NamePlate_Y = new int[] { 615, 615, 561, 561, 615 }; - public int[] SongSelect_Auto_X = new int[] { 60, 950 }; - public int[] SongSelect_Auto_Y = new int[] { 650, 650 }; - public int[] SongSelect_ModIcons_X = new int[] { 40, 1020, 220, 840, 400 }; - public int[] SongSelect_ModIcons_Y = new int[] { 672, 672, 618, 618, 672 }; - - public int[] SongSelect_Timer = new int[] { 1148, 57 }; - public int[] SongSelect_Timer_Interval = new int[] { 46, 0 }; - - public bool SongSelect_Bpm_Show = false; - public int[] SongSelect_Bpm_X = new int[] { 1240, 1240, 1240 }; - public int[] SongSelect_Bpm_Y = new int[] { 20, 66, 112 }; - public int[] SongSelect_Bpm_Interval = new int[] { 22, 0 }; - - public bool SongSelect_FloorNum_Show = false; - public int SongSelect_FloorNum_X = 1200; - public int SongSelect_FloorNum_Y = 205; - public int[] SongSelect_FloorNum_Interval = new int[] { 30, 0 }; - - public bool SongSelect_DanInfo_Show = false; - public int[] SongSelect_DanInfo_Icon_X = new int[] { 1001, 1001, 1001 }; - public int[] SongSelect_DanInfo_Icon_Y = new int[] { 269, 309, 349 }; - public float SongSelect_DanInfo_Icon_Scale = 0.5f; - public int[] SongSelect_DanInfo_Difficulty_Cymbol_X = new int[] { 1028, 1028, 1028 }; - public int[] SongSelect_DanInfo_Difficulty_Cymbol_Y = new int[] { 263, 303, 343 }; - public float SongSelect_DanInfo_Difficulty_Cymbol_Scale = 0.5f; - public int[] SongSelect_DanInfo_Level_Number_X = new int[] { 1040, 1040, 1040 }; - public int[] SongSelect_DanInfo_Level_Number_Y = new int[] { 267, 307, 347 }; - public float SongSelect_DanInfo_Level_Number_Scale = 0.5f; - public int[] SongSelect_DanInfo_Title_X = new int[] { 1032, 1032, 1032 }; - public int[] SongSelect_DanInfo_Title_Y = new int[] { 258, 298, 338 }; - public int SongSelect_DanInfo_Title_Size = 12; - public int[] SongSelect_DanInfo_Exam_X = new int[] { 1030, 1030, 1030, 1030, 1030, 1030 }; - public int[] SongSelect_DanInfo_Exam_Y = new int[] { 398, 426, 454, 482, 510, 538 }; - public int SongSelect_DanInfo_Exam_Size = 10; - public int[] SongSelect_DanInfo_Exam_Value_X = new int[] { 1097, 1162, 1227 }; - public int[] SongSelect_DanInfo_Exam_Value_Y = new int[] { 388, 416, 444, 472, 500, 528 }; - public float SongSelect_DanInfo_Exam_Value_Scale = 0.5f; - - public int[] SongSelect_Table_X = new int[] { 0, 1034, 180, 854, 360 }; - public int[] SongSelect_Table_Y = new int[] { 0, 0, -204, -204, 0 }; - - public int[] SongSelect_High_Score_X = new int[] { 124, 1158, 304, 978, 484 }; - public int[] SongSelect_High_Score_Y = new int[] { 416, 416, 212, 212, 416 }; - - public int[] SongSelect_High_Score_Difficulty_Cymbol_X = new int[] { 46, 1080, 226, 900, 406 }; - public int[] SongSelect_High_Score_Difficulty_Cymbol_Y = new int[] { 418, 418, 214, 214, 418 }; - - public int[][] SongSelect_BoardNumber_X = new int[][] { - new int[] { 62, 125, 190, 62, 125, 190, 190, 62, 125, -100, 190, 74, 114 }, - new int[] { 1096, 1159, 1224, 1096, 1159, 1224, 1224, 1096, 1159, -100, 1224, 1214, 1148 }, - - new int[] { 242, 305, 370, 242, 305, 370, 370, 242, 305, -100, 370, 254, 294 }, - new int[] { 916, 979, 1044, 916, 979, 1044, 1044, 916, 979, -100, 1044, 1034, 968 }, - new int[] { 422, 485, 550, 422, 485, 550, 550, 422, 485, 550, -100, 434, 474 } - }; - public int[][] SongSelect_BoardNumber_Y = new int[][] { - new int[] { 276, 276, 276, 251, 251, 251, 226, 304, 304, -100, 304, 353, 415 }, - new int[] { 276, 276, 276, 251, 251, 251, 226, 304, 304, -100, 304, 353, 415 }, - new int[] { 72,72,72,47,47,47,22,100,100, -100, 100, 149,211 }, - new int[] { 72,72,72,47,47,47,22,100,100, -100, 100, 149,211 }, - new int[] { 276, 276, 276, 251, 251, 251, 226, 304, 304, -100, 304, 353, 415 } - }; - public int[] SongSelect_BoardNumber_Interval = new int[] { 9, 0 }; - - public int[] SongSelect_SongNumber_X = new int[] { 1090, 1183 }; - public int[] SongSelect_SongNumber_Y = new int[] { 167, 167 }; - public int[] SongSelect_SongNumber_Interval = new int[] { 16, 0 }; - - public int[] SongSelect_Search_Bar_X = new int[] { 640, 640, 640, 640, 640 }; - public int[] SongSelect_Search_Bar_Y = new int[] { 320, 420, 520, 620, 720 }; - - public int[] SongSelect_Difficulty_Back = new int[] { 640, 290 }; - public int[] SongSelect_Level_Offset = new int[] { 610, 40 }; - public Color[] SongSelect_Difficulty_Colors = new Color[] { - ColorTranslator.FromHtml("#88d2fd"), - ColorTranslator.FromHtml("#58de85"), - ColorTranslator.FromHtml("#ffc224"), - ColorTranslator.FromHtml("#d80b2c"), - ColorTranslator.FromHtml("#9065e2"), - ColorTranslator.FromHtml("#e9943b"), - ColorTranslator.FromHtml("#3b55a5") - }; - - public int[] SongSelect_Difficulty_Bar_X = new int[] { 255, 341, 426, 569, 712, 855, 855 }; - public int[] SongSelect_Difficulty_Bar_Y = new int[] { 270, 270, 270, 270, 270, 270, 270 }; - public int[] SongSelect_Branch_Text_Offset = new int[] { 276, 6 }; - public int[] SongSelect_Branch_Offset = new int[] { 6, 6 }; - - public int[][] SongSelect_Difficulty_Bar_Rect = new int[][] { - new int[] { 0, 0, 86, 236 }, - new int[] { 86, 0, 86, 236 }, - new int[] { 171, 0, 138, 236 }, - new int[] { 314, 0, 138, 236 }, - new int[] { 457, 0, 138, 236 }, - new int[] { 600, 0, 138, 236 }, - new int[] { 743, 0, 138, 236 }, - }; - - public int[] SongSelect_Difficulty_Star_X = new int[] { 444, 587, 730, 873, 873 }; - public int[] SongSelect_Difficulty_Star_Y = new int[] { 459, 459, 459, 459, 459 }; - public int[] SongSelect_Difficulty_Star_Interval = new int[] { 10, 0 }; - - public int[] SongSelect_Difficulty_Number_X = new int[] { 498, 641, 784, 927, 927, 927, 927 }; - public int[] SongSelect_Difficulty_Number_Y = new int[] { 435, 435, 435, 435, 435, 435, 435 }; - public int[] SongSelect_Difficulty_Number_Interval = new int[] { 11, 0 }; - - public int[][] SongSelect_Difficulty_Crown_X = new int[][] { - new int[] { 445, 589, 733, 877, 877 }, - new int[] { 519, 663, 807, 951, 951 }, - }; - public int[][] SongSelect_Difficulty_Crown_Y = new int[][] { - new int[] { 284, 284, 284, 284, 284 }, - new int[] { 284, 284, 284, 284, 284 }, - }; - - public int[][] SongSelect_Difficulty_ScoreRank_X = new int[][] { - new int[] { 467, 611, 755, 899, 899 }, - new int[] { 491, 635, 779, 923, 923 }, - }; - public int[][] SongSelect_Difficulty_ScoreRank_Y = new int[][] { - new int[] { 281, 281, 281, 281, 281 }, - new int[] { 281, 281, 281, 281, 281 }, - }; - - public int[] SongSelect_Difficulty_Select_Bar_X = new int[] { 163, 252, 367, 510, 653, 796, 796 }; - public int[] SongSelect_Difficulty_Select_Bar_Y = new int[] { 176, 176, 176, 176, 176, 176, 176 }; - - public int[] SongSelect_Difficulty_Select_Bar_Back_X = new int[] { 163, 252, 367, 510, 653, 796, 796 }; - public int[] SongSelect_Difficulty_Select_Bar_Back_Y = new int[] { 242, 242, 242, 242, 242, 242, 242 }; - - public int[][] SongSelect_Difficulty_Select_Bar_Rect = new int[][] { - new int[] { 0, 0, 259, 114 }, - new int[] { 0, 114, 259, 275 }, - new int[] { 0, 387, 259, 111 }, - }; - - public int[] SongSelect_Difficulty_Select_Bar_Anime = new int[] { 0, 10 }; - public int[] SongSelect_Difficulty_Select_Bar_AnimeIn = new int[] { 0, 50 }; - public int[] SongSelect_Difficulty_Select_Bar_Move = new int[] { 25, 0 }; - - public int[] SongSelect_Difficulty_Bar_ExExtra_AnimeDuration = new int[] { -1, -1 }; - - public int[] SongSelect_Preimage = new int[] { 120, 110 }; - public int[] SongSelect_Preimage_Size = new int[] { 200, 200 }; - - public int[] SongSelect_Option_Select_Offset = new int[] { 0, -286 }; - - public int SongSelect_Option_Font_Scale = 13; - public int[] SongSelect_Option_OptionType_X = new int[] { 16, 1004 }; - public int[] SongSelect_Option_OptionType_Y = new int[] { 93, 93 }; - public int[] SongSelect_Option_Value_X = new int[] { 200, 1188 }; - public int[] SongSelect_Option_Value_Y = new int[] { 93, 93 }; - public int[] SongSelect_Option_Interval = new int[] { 0, 41 }; - - public int[] SongSelect_Option_ModMults1_X = new int[] { 108, 1096 }; - public int[] SongSelect_Option_ModMults1_Y = new int[] { 11, 11 }; - - public int[] SongSelect_Option_ModMults2_X = new int[] { 108, 1096 }; - public int[] SongSelect_Option_ModMults2_Y = new int[] { 52, 52 }; - - - public int[] SongSelect_NewHeya_Close_Select = new int[] { 0, 0 }; - - public int[] SongSelect_NewHeya_PlayerPlate_X = new int[] { 0, 256, 513, 770, 1026 }; - public int[] SongSelect_NewHeya_PlayerPlate_Y = new int[] { 66, 66, 66, 66, 66 }; - - public int[] SongSelect_NewHeya_ModeBar_X = new int[] { 0, 256, 513, 770, 1026 }; - public int[] SongSelect_NewHeya_ModeBar_Y = new int[] { 200, 200, 200, 200, 200 }; - public int[] SongSelect_NewHeya_ModeBar_Font_Offset = new int[] { 128, 33 }; - - - public int SongSelect_NewHeya_Box_Count = 7; - public int[] SongSelect_NewHeya_Box_X = new int[] { -424, -120, 184, 488, 792, 1096, 1400 }; - public int[] SongSelect_NewHeya_Box_Y = new int[] { 273, 273, 273, 273, 273, 273, 273 }; - public int[] SongSelect_NewHeya_Box_Chara_Offset = new int[] { 152, 200 }; - public int[] SongSelect_NewHeya_Box_Name_Offset = new int[] { 152, 386 }; - public int[] SongSelect_NewHeya_Box_Author_Offset = new int[] { 152, 413 }; - public int[] SongSelect_NewHeya_Lock_Offset = new int[] { 0, 73 }; - public int[] SongSelect_NewHeya_InfoSection_Offset = new int[] { 152, 206 }; - - public Color SongSelect_ForeColor_JPOP = ColorTranslator.FromHtml("#FFFFFF"); - public Color SongSelect_ForeColor_Anime = ColorTranslator.FromHtml("#FFFFFF"); - public Color SongSelect_ForeColor_VOCALOID = ColorTranslator.FromHtml("#FFFFFF"); - public Color SongSelect_ForeColor_Children = ColorTranslator.FromHtml("#FFFFFF"); - public Color SongSelect_ForeColor_Variety = ColorTranslator.FromHtml("#FFFFFF"); - public Color SongSelect_ForeColor_Classic = ColorTranslator.FromHtml("#FFFFFF"); - public Color SongSelect_ForeColor_GameMusic = ColorTranslator.FromHtml("#FFFFFF"); - public Color SongSelect_ForeColor_Namco = ColorTranslator.FromHtml("#FFFFFF"); - public Color SongSelect_BackColor_JPOP = ColorTranslator.FromHtml("#01455B"); - public Color SongSelect_BackColor_Anime = ColorTranslator.FromHtml("#99001F"); - public Color SongSelect_BackColor_VOCALOID = ColorTranslator.FromHtml("#5B6278"); - public Color SongSelect_BackColor_Children = ColorTranslator.FromHtml("#9D3800"); - public Color SongSelect_BackColor_Variety = ColorTranslator.FromHtml("#366600"); - public Color SongSelect_BackColor_Classic = ColorTranslator.FromHtml("#875600"); - public Color SongSelect_BackColor_GameMusic = ColorTranslator.FromHtml("#412080"); - public Color SongSelect_BackColor_Namco = ColorTranslator.FromHtml("#980E00"); - - public string[] SongSelect_CorrectionX_Chara = { "ここにX座標を補正したい文字をカンマで区切って記入" }; - public string[] SongSelect_CorrectionY_Chara = { "ここにY座標を補正したい文字をカンマで区切って記入" }; - public int SongSelect_CorrectionX_Chara_Value = 0; - public int SongSelect_CorrectionY_Chara_Value = 0; - public string[] SongSelect_Rotate_Chara = { "ここに90℃回転させたい文字をカンマで区切って記入" }; - - #endregion - #region DaniSelect - - public int[] DaniSelect_DanSides_X = new int[] { 243, 1199 }; - public int[] DaniSelect_DanSides_Y = new int[] { 143, 143 }; - - public int[] DaniSelect_DanPlate = new int[] { 173, 301 }; - public int[] DaniSelect_Rank = new int[] { 173, 422 }; - public int[] DaniSelect_Bloc2 = new int[] { 291, 412 }; - public int[] DaniSelect_Text_Gauge = new int[] { 396, 429 }; - public int[] DaniSelect_Value_Gauge = new int[] { 370, 462 }; - - public int[] DaniSelect_DanIcon_X = new int[] { 314, 314, 314 }; - public int[] DaniSelect_DanIcon_Y = new int[] { 190, 263, 336 }; - - public int[] DaniSelect_Title_X = new int[] { 401, 401, 401 }; - public int[] DaniSelect_Title_Y = new int[] { 173, 246, 319 }; - - public int[] DaniSelect_Difficulty_Cymbol_X = new int[] { 377, 377, 377 }; - public int[] DaniSelect_Difficulty_Cymbol_Y = new int[] { 180, 253, 326 }; - - public int[] DaniSelect_Level_Number_X = new int[] { 383, 383, 383 }; - public int[] DaniSelect_Level_Number_Y = new int[] { 207, 280, 353 }; - - public int[] DaniSelect_Level_Number_Interval = new int[] { 10, 0 }; - - public int[] DaniSelect_Soul_Number_Interval = new int[] { 16, 0 }; - public int DaniSelect_Soul_Number_Text_Width = 80; - - public int[] DaniSelect_Exam_Number_Interval = new int[] { 16, 0 }; - public int DaniSelect_Exam_Number_Text_Width = 45; - - public int[] DaniSelect_Font_DanFolder_Size = new int[] { 64, 32 }; - public int[] DaniSelect_FolderText_X = new int[] { 640, 640, 640, 640 }; - public int[] DaniSelect_FolderText_Y = new int[] { 320, 413, 460, 507 }; - public int DaniSelect_Font_DanSong_Size = 24; - public int DaniSelect_Font_Exam_Size = 13; - - public int[] DaniSelect_Exam_Bloc_X = new int[] { 515, 515, 515 }; - public int[] DaniSelect_Exam_Bloc_Y = new int[] { 412, 500, 588 }; - - public int[] DaniSelect_Exam_X = new int[] { 590, 590, 590 }; - public int[] DaniSelect_Exam_Y = new int[] { 455, 543, 631 }; - - public int[] DaniSelect_Exam_X_Ex = new int[] { 536, 536, 536 }; - public int[] DaniSelect_Exam_Y_Ex = new int[] { 455, 543, 631 }; - - public int[] DaniSelect_Exam_Interval = new int[] { 220, 0 }; - - public int[] DaniSelect_Exam_Title_X = new int[] { 614, 614, 614 }; - public int[] DaniSelect_Exam_Title_Y = new int[] { 429, 517, 605 }; - - public int[] DaniSelect_Challenge_Select_X = new int[] { 228, 456, 684 }; - public int[] DaniSelect_Challenge_Select_Y = new int[] { 0, 0, 0 }; - public int[][] DaniSelect_Challenge_Select_Rect = new int[][] { - new int[] { 228, 0, 228, 720 }, - new int[] { 456, 0, 228, 720 }, - new int[] { 684, 0, 228, 720 }, - }; - - public int[] DaniSelect_Plate = new int[] { 640, 10 }; - public int[] DaniSelect_Plate_Move = new int[] { 52, 0 }; - public int[] DaniSelect_Plate_Center_Move = new int[] { 0, 15 }; - public int[] DaniSelect_Plate_Title_Offset = new int[] { 2, 36 }; - - public int DaniSelect_DanPlateTitle_Size = 60; - public int[] DaniSelect_DanPlateTitle_Offset = new int[] { 0, -50 }; - - public int DaniSelect_DanIconTitle_Size = 18; - public int[] DaniSelect_DanIconTitle_Offset = new int[] { 0, 6 }; - - public Color[] DaniSelect_DanIcon_Color = new Color[] - { - Color.Red, - Color.Green, - Color.Blue, - Color.Magenta, - Color.Yellow, - Color.Cyan, - Color.Brown, - Color.Gray, - Color.DarkGreen, - Color.Black - }; - #endregion - #region SongLoading - public int SongLoading_Plate_X = 640; - public int SongLoading_Plate_Y = 360; - public int SongLoading_Title_X = 640; - public int SongLoading_Title_Y = 280; - public int SongLoading_Title_MaxSize = 710; - public int SongLoading_SubTitle_X = 640; - public int SongLoading_SubTitle_Y = 325; - public int SongLoading_SubTitle_MaxSize = 710; - - public int SongLoading_Plate_X_AI = 640; - public int SongLoading_Plate_Y_AI = 360; - public int SongLoading_Title_X_AI = 640; - public int SongLoading_Title_Y_AI = 313; - public int SongLoading_SubTitle_X_AI = 640; - public int SongLoading_SubTitle_Y_AI = 365; - - public int[] SongLoading_Fade_AI_Anime_Ring = new int[] { 466, 185 }; - public int[] SongLoading_Fade_AI_Anime_LoadBar = new int[] { 490, 382 }; - - public int[] SongLoading_DanPlate = new int[] { 1121, 213 }; - - public int SongLoading_Title_FontSize = 31; - public int SongLoading_SubTitle_FontSize = 20; - public int[] SongLoading_Chara_Move = new int[] { 250, -80 }; - public ReferencePoint SongLoading_Plate_ReferencePoint = ReferencePoint.Center; - public ReferencePoint SongLoading_Title_ReferencePoint = ReferencePoint.Center; - public ReferencePoint SongLoading_SubTitle_ReferencePoint = ReferencePoint.Center; - public Color SongLoading_Title_ForeColor = ColorTranslator.FromHtml("#FFFFFF"); - public Color SongLoading_Title_BackColor = ColorTranslator.FromHtml("#000000"); - public Color SongLoading_SubTitle_ForeColor = ColorTranslator.FromHtml("#000000"); - public Color SongLoading_SubTitle_BackColor = ColorTranslator.FromHtml("#00000000"); - public bool SongLoading_Plate_ScreenBlend = false; - - #endregion - #region Game - - // Game parameters here - - public bool Game_Notes_Anime = false; - public int[] Game_Notes_Size = new int[] { 130, 130 }; - public int[] Game_SENote_Size = new int[] { 136, 30 }; - public int Game_Notes_Interval = 960; - - public int[] Game_Notes_Arm_Offset_Left_X = new int[] { 25, 25 }; - public int[] Game_Notes_Arm_Offset_Right_X = new int[] { 60, 60 }; - - public int[] Game_Notes_Arm_Offset_Left_Y = new int[] { 74, -44 }; - public int[] Game_Notes_Arm_Offset_Right_Y = new int[] { 104, -14 }; - public int[] Game_Notes_Arm_Move = new int[] { 0, 30 }; - - public int[] Game_Judge_X = new int[] { 364, 364 }; - public int[] Game_Judge_Y = new int[] { 152, 328 }; - public int[] Game_Judge_Move = new int[] { 0, 20 }; - public int[] Game_ScoreRank_X = new int[] { 87, 87 }; - public int[] Game_ScoreRank_Y = new int[] { 98, 622 }; - public int[] Game_ScoreRank_Move = new int[] { 0, 51 }; - public string Game_StageText = "1曲目"; - public RollColorMode Game_RollColorMode = RollColorMode.All; - public bool Game_JudgeFrame_AddBlend = true; - - public int[] Game_Judge_Meter = new int[] { 0, 360 }; - public int[] Game_Judge_Meter_Perfect = new int[] { 102, 494 }; - public int[] Game_Judge_Meter_Good = new int[] { 102, 532 }; - public int[] Game_Judge_Meter_Miss = new int[] { 102, 570 }; - public int[] Game_Judge_Meter_Roll = new int[] { 102, 634 }; - public int[] Game_Judge_Meter_HitRate = new int[] { 206, 436 }; - public int[] Game_Judge_Meter_PerfectRate = new int[] { 206, 494 }; - public int[] Game_Judge_Meter_GoodRate = new int[] { 206, 532 }; - public int[] Game_Judge_Meter_MissRate = new int[] { 206, 570 }; - - public int[] Game_Judge_4P = new int[] { 364, 32 }; - public int[] Game_Judge_5P = new int[] { 364, 24 }; - - public int[] Game_UIMove_4P = new int[] { 0, 176 }; - public int[] Game_UIMove_5P = new int[] { 0, 144 }; - - public int[] Game_ScoreRank_4P = new int[] { 87, 88 }; - public int[] Game_ScoreRank_5P = new int[] { 87, 80 }; - - public DBSkinPreset.SkinPreset Game_SkinScenes = null; - - #region Chara - - public int[] Game_Chara_X = new int[] { 0, 0 }; - public int[] Game_Chara_Y = new int[] { 0, 537 }; - public int[] Game_Chara_Balloon_X = new int[] { 240, 240, 0, 0 }; - public int[] Game_Chara_Balloon_Y = new int[] { 0, 297, 0, 0 }; - public int Game_Chara_Ptn_Normal, - Game_Chara_Ptn_GoGo, - Game_Chara_Ptn_Clear, - Game_Chara_Ptn_10combo, - Game_Chara_Ptn_10combo_Max, - Game_Chara_Ptn_GoGoStart, - Game_Chara_Ptn_GoGoStart_Max, - Game_Chara_Ptn_ClearIn, - Game_Chara_Ptn_SoulIn, - Game_Chara_Ptn_Balloon_Breaking, - Game_Chara_Ptn_Balloon_Broke, - Game_Chara_Ptn_Balloon_Miss; - public string Game_Chara_Motion_Normal, - Game_Chara_Motion_Clear, - Game_Chara_Motion_GoGo = "0"; - public int Game_Chara_Beat_Normal = 1; - public int Game_Chara_Beat_Clear = 2; - public int Game_Chara_Beat_GoGo = 2; - public int Game_Chara_Balloon_Timer = 28; - public int Game_Chara_Balloon_Delay = 500; - public int Game_Chara_Balloon_FadeOut = 84; - - #endregion - - #region Dancer - - public int[] Game_Dancer_X = new int[] { 640, 430, 856, 215, 1070 }; - public int[] Game_Dancer_Y = new int[] { 500, 500, 500, 500, 500 }; - public string Game_Dancer_Motion = "0"; - public int[] Game_Dancer_Gauge = new int[] { 0, 0, 0, 40, 80 }; - - #endregion - - #region Tower - - public int Game_Tower_Ptn; - public int[] Game_Tower_Ptn_Deco, - Game_Tower_Ptn_Base; - - public string[] Game_Tower_Names; - public int Game_Tower_Ptn_Result; - - public int Game_Tower_Ptn_Don; - - #endregion - - #region Mob - public int Game_Mob_Beat, - Game_Mob_Ptn_Beat = 1; - #endregion - #region CourseSymbol - public int[] Game_CourseSymbol_X = new int[] { -4, -4 }; - public int[] Game_CourseSymbol_Y = new int[] { 232, 582 }; - public int[] Game_CourseSymbol_Back_X = new int[] { 280, 280 }; - public int[] Game_CourseSymbol_Back_Y = new int[] { -110, 427 }; - - public int[] Game_CourseSymbol_4P = new int[] { -4, 56 }; - public int[] Game_CourseSymbol_5P = new int[] { -4, 48 }; - - public int[] Game_CourseSymbol_Back_4P = new int[] { 896, 47 }; - public int[] Game_CourseSymbol_Back_5P = new int[] { 896, 39 }; - - public int[] Game_CourseSymbol_Back_Rect_4P = new int[] { 0, 128, 384, 129 }; - public int[] Game_CourseSymbol_Back_Rect_5P = new int[] { 0, 140, 384, 105 }; - #endregion - #region PanelFont - public int Game_MusicName_X = 1260; - public int Game_MusicName_Y = 24; - public int Game_MusicName_FontSize = 27; - public int Game_MusicName_MaxWidth = 660; - public ReferencePoint Game_MusicName_ReferencePoint = ReferencePoint.Center; - public int Game_Genre_X = 1015; - public int Game_Genre_Y = 70; - public int[] Game_GenreText_Offset = new int[2] { 145, 23 }; - public int Game_GenreText_FontSize = 12; - public int Game_Lyric_X = 640; - public int Game_Lyric_Y = 630; - public string Game_Lyric_FontName = CFontRenderer.DefaultFontName; - public int Game_Lyric_FontSize = 38; - public int Game_Lyric_VTTRubyOffset = 65; - public ReferencePoint Game_Lyric_ReferencePoint = ReferencePoint.Center; - - public Color Game_MusicName_ForeColor = ColorTranslator.FromHtml("#FFFFFF"); - public Color Game_StageText_ForeColor = ColorTranslator.FromHtml("#FFFFFF"); - public Color Game_Lyric_ForeColor = ColorTranslator.FromHtml("#FFFFFF"); - public Color Game_MusicName_BackColor = ColorTranslator.FromHtml("#000000"); - public Color Game_StageText_BackColor = ColorTranslator.FromHtml("#000000"); - public Color Game_Lyric_BackColor = ColorTranslator.FromHtml("#0000FF"); - public Color[] Game_Lyric_VTTForeColor = new Color[] { Color.White, Color.Lime, Color.Cyan, Color.Red, Color.Yellow, Color.Magenta, Color.Blue, Color.Black }; - public Color[] Game_Lyric_VTTBackColor = new Color[] { Color.White, Color.Lime, Color.Cyan, Color.Red, Color.Yellow, Color.Magenta, Color.Blue, Color.Black }; - - #endregion - #region Score - public int[] Game_Score_X = new int[] { 20, 20, 0, 0 }; - public int[] Game_Score_Y = new int[] { 226, 530, 0, 0 }; - public int[] Game_Score_Add_X = new int[] { 20, 20, 0, 0 }; - public int[] Game_Score_Add_Y = new int[] { 186, 570, 0, 0 }; - public int[] Game_Score_AddBonus_X = new int[] { 20, 20, 0, 0 }; - public int[] Game_Score_AddBonus_Y = new int[] { 136, 626, 0, 0 }; - public int Game_Score_Padding = 20; - public int[] Game_Score_Size = new int[] { 24, 40 }; - - public int[] Game_Score_4P = new int[] { 20, 54 }; - public int[] Game_Score_5P = new int[] { 20, 46 }; - - public int[] Game_Score_Add_4P = new int[] { 20, 94 }; - public int[] Game_Score_Add_5P = new int[] { 20, 86 }; - - public int[] Game_Score_AddBonus_4P = new int[] { 20, 134 }; - public int[] Game_Score_AddBonus_5P = new int[] { 20, 126 }; - #endregion - #region Taiko - public int[] Game_Taiko_Background_X = new int[] { 0, 0 }; - public int[] Game_Taiko_Background_Y = new int[] { 184, 360 }; - - public int[] Game_Taiko_ModIcons_X = new int[] { 80, 80 }; - public int[] Game_Taiko_ModIcons_Y = new int[] { 236, 426 }; - public int[] Game_Taiko_NamePlate_X = new int[] { -5, -5 }; - public int[] Game_Taiko_NamePlate_Y = new int[] { 297, 371 }; - public int[] Game_Taiko_PlayerNumber_X = new int[] { 4, 4 }; - public int[] Game_Taiko_PlayerNumber_Y = new int[] { 233, 435 }; - public int[] Game_Taiko_X = new int[] { 205, 205 }; - public int[] Game_Taiko_Y = new int[] { 206, 384 }; - public int[] Game_Taiko_Combo_X = new int[] { 267, 267 }; - public int[] Game_Taiko_Combo_Y = new int[] { 272, 447 }; - public int[] Game_Taiko_Combo_Ex_X = new int[] { 267, 267 }; - public int[] Game_Taiko_Combo_Ex_Y = new int[] { 274, 451 }; - public int[] Game_Taiko_Combo_Ex4_X = new int[] { 267, 267 }; - public int[] Game_Taiko_Combo_Ex4_Y = new int[] { 269, 447 }; - public int[] Game_Taiko_Combo_Padding = new int[] { 34, 34, 30 }; - public int[] Game_Taiko_Combo_Size = new int[] { 40, 48 }; - public int[] Game_Taiko_Combo_Size_Ex = new int[] { 40, 48 }; - public float[] Game_Taiko_Combo_Scale = new float[] { 1.0f, 1.0f, 0.9f }; - public int[] Game_Taiko_Combo_Text_X = new int[] { 268, 268 }; - public int[] Game_Taiko_Combo_Text_Y = new int[] { 298, 475 }; - public int[] Game_Taiko_Combo_Text_Size = new int[] { 100, 50 }; - public bool Game_Taiko_Combo_Ex_IsJumping = true; - public int[] Game_Taiko_LevelChange_X = new int[] { 311, 311 }; - public int[] Game_Taiko_LevelChange_Y = new int[] { 154, 566 }; - public int[] Game_Taiko_Frame_X = new int[] { 329, 329 }; - public int[] Game_Taiko_Frame_Y = new int[] { 136, 360 }; - - - public int[] Game_Taiko_Background_4P = new int[] { 0, 8 }; - public int[] Game_Taiko_Background_5P = new int[] { 0, 0 }; - - public int[] Game_Taiko_ModIcons_4P = new int[] { 80, 60 }; - public int[] Game_Taiko_ModIcons_5P = new int[] { 80, 50 }; - - public int[] Game_Taiko_NamePlate_4P = new int[] { -55, 121 }; - public int[] Game_Taiko_NamePlate_5P = new int[] { -55, 97 }; - - public int[] Game_Taiko_PlayerNumber_4P = new int[] { 4, 57 }; - public int[] Game_Taiko_PlayerNumber_5P = new int[] { 4, 49 }; - - public int[] Game_Taiko_4P = new int[] { 205, 30 }; - public int[] Game_Taiko_5P = new int[] { 205, 22 }; - - public int[] Game_Taiko_Combo_4P = new int[] { 267, 73 }; - public int[] Game_Taiko_Combo_5P = new int[] { 267, 65 }; - - public int[] Game_Taiko_Combo_Ex_4P = new int[] { 267, 75 }; - public int[] Game_Taiko_Combo_Ex_5P = new int[] { 267, 67 }; - - public int[] Game_Taiko_Combo_Ex4_4P = new int[] { 267, 70 }; - public int[] Game_Taiko_Combo_Ex4_5P = new int[] { 267, 62 }; - - public int[] Game_Taiko_Combo_Text_4P = new int[] { 268, 99 }; - public int[] Game_Taiko_Combo_Text_5P = new int[] { 268, 91 }; - - public int[] Game_Taiko_Frame_4P = new int[] { 333, 8 }; - public int[] Game_Taiko_Frame_5P = new int[] { 333, 0 }; - - #endregion - #region Gauge - public int[] Game_Gauge_X = new int[] { 492, 492 }; - public int[] Game_Gauge_Y = new int[] { 144, 532 }; - public int Game_Gauge_X_AI = 650; - public int Game_Gauge_Y_AI = 153; - public int[] Game_Gauge_Rect = new int[] { 0, 0, 700, 44 }; - public int[] Game_Gauge_ClearText_X = new int[] { 1038, 1038 }; - public int[] Game_Gauge_ClearText_Y = new int[] { 144, 554 }; - public int Game_Gauge_ClearText_X_AI = 1087; - public int Game_Gauge_ClearText_Y_AI = 153; - public int[] Game_Gauge_ClearText_Rect = new int[] { 0, 44, 58, 24 }; - public int[] Game_Gauge_ClearText_Clear_Rect = new int[] { 58, 44, 58, 24 }; - public int[] Gauge_Soul_X = new int[] { 1184, 1184 }; - public int[] Gauge_Soul_Y = new int[] { 125, 516 }; - public int Gauge_Soul_X_AI = 1200; - public int Gauge_Soul_Y_AI = 140; - public int Gauge_Soul_X_Tower = 958; - public int Gauge_Soul_Y_Tower = 95; - public int[] Gauge_Soul_Fire_X = new int[] { 1112, 1112 }; - public int[] Gauge_Soul_Fire_Y = new int[] { 52, 443 }; - public int Gauge_Soul_Fire_X_AI = 1143; - public int Gauge_Soul_Fire_Y_AI = 83; - public int Gauge_Soul_Fire_X_Tower = 886; - public int Gauge_Soul_Fire_Y_Tower = 22; - public int Game_Gauge_Rainbow_Ptn; - public int Game_Gauge_Rainbow_2PGauge_Ptn; - public int Game_Gauge_Rainbow_Flat_Ptn; - public int Game_Gauge_Dan_Rainbow_Ptn; - public int Game_Gauge_Rainbow_Timer = 50; - - public int[] Game_Gauge_4P = new int[] { 492, -4 }; - public int[] Game_Gauge_5P = new int[] { 492, -12 }; - - public int[] Gauge_Soul_4P = new int[] { 1184, -12 }; - public int[] Gauge_Soul_5P = new int[] { 1184, -20 }; - - public int[] Gauge_Soul_Fire_4P = new int[] { 1112, -85 }; - public int[] Gauge_Soul_Fire_5P = new int[] { 1112, -93 }; - - #endregion - #region Balloon - public int[] Game_Balloon_Combo_X = new int[] { 253, 253 }; - public int[] Game_Balloon_Combo_Y = new int[] { -11, 538 }; - public int[] Game_Balloon_Combo_Number_X = new int[] { 257, 257 }; - public int[] Game_Balloon_Combo_Number_Y = new int[] { 54, 603 }; - public int[] Game_Balloon_Combo_Number_Ex_X = new int[] { 257, 257 }; - public int[] Game_Balloon_Combo_Number_Ex_Y = new int[] { 54, 603 }; - public int[] Game_Balloon_Combo_Number_Size = new int[] { 53, 62 }; - public int[] Game_Balloon_Combo_Number_Interval = new int[] { 45, 0 }; - public int[] Game_Balloon_Combo_Text_X = new int[] { 440, 440 }; - public int[] Game_Balloon_Combo_Text_Y = new int[] { 85, 634 }; - public int[] Game_Balloon_Combo_Text_Ex_X = new int[] { 440, 440 }; - public int[] Game_Balloon_Combo_Text_Ex_Y = new int[] { 85, 594 }; - public int[] Game_Balloon_Combo_Text_Rect = new int[] { 0, 124, 100, 30 }; - - public int[] Game_Balloon_Balloon_X = new int[] { 382, 382 }; - public int[] Game_Balloon_Balloon_Y = new int[] { 115, 290 }; - public int[] Game_Balloon_Balloon_Frame_X = new int[] { 382, 382 }; - public int[] Game_Balloon_Balloon_Frame_Y = new int[] { 80, 260 }; - public int[] Game_Balloon_Balloon_Number_X = new int[] { 423, 423 }; - public int[] Game_Balloon_Balloon_Number_Y = new int[] { 187, 373 }; - public int[] Game_Balloon_Roll_Frame_X = new int[] { 218, 218 }; - public int[] Game_Balloon_Roll_Frame_Y = new int[] { -3, 514 }; - public int[] Game_Balloon_Roll_Number_X = new int[] { 313, 313 }; - public int[] Game_Balloon_Roll_Number_Y = new int[] { 122, 633 }; - public int[] Game_Balloon_Number_Size = new int[] { 63, 75 }; - public int[] Game_Balloon_Number_Interval = new int[] { 55, 0 }; - public float Game_Balloon_Roll_Number_Scale = 1.000f; - public float Game_Balloon_Balloon_Number_Scale = 0.879f; - - public int[] Game_Balloon_Balloon_4P = new int[] { 382, -61 }; - public int[] Game_Balloon_Balloon_5P = new int[] { 382, -53 }; - - public int[] Game_Balloon_Balloon_Frame_4P = new int[] { 382, -12 }; - public int[] Game_Balloon_Balloon_Frame_5P = new int[] { 382, -4 }; - - public int[] Game_Balloon_Balloon_Number_4P = new int[] { 423, 95 }; - public int[] Game_Balloon_Balloon_Number_5P = new int[] { 423, 87 }; - - public int Game_Kusudama_Number_X = 960; - public int Game_Kusudama_Number_Y = 540; - #endregion - #region Effects - public int[] Game_Effect_Roll_StartPoint_X = new int[] { 56, -10, 200, 345, 100, 451, 600, 260, -30, 534, 156, 363 }; - public int[] Game_Effect_Roll_StartPoint_Y = new int[] { 720 }; - public int[] Game_Effect_Roll_StartPoint_1P_X = new int[] { 56, -10, 200, 345, 100, 451, 600, 260, -30, 534, 156, 363 }; - public int[] Game_Effect_Roll_StartPoint_1P_Y = new int[] { 240 }; - public int[] Game_Effect_Roll_StartPoint_2P_X = new int[] { 56, -10, 200, 345, 100, 451, 600, 260, -30, 534, 156, 363 }; - public int[] Game_Effect_Roll_StartPoint_2P_Y = new int[] { 360 }; - public float[] Game_Effect_Roll_Speed_X = new float[] { 0.6f }; - public float[] Game_Effect_Roll_Speed_Y = new float[] { -0.6f }; - public float[] Game_Effect_Roll_Speed_1P_X = new float[] { 0.6f }; - public float[] Game_Effect_Roll_Speed_1P_Y = new float[] { -0.6f }; - public float[] Game_Effect_Roll_Speed_2P_X = new float[] { 0.6f }; - public float[] Game_Effect_Roll_Speed_2P_Y = new float[] { 0.6f }; - public int Game_Effect_Roll_Ptn; - public int[] Game_Effect_NotesFlash = new int[] { 180, 180, 16 }; // Width, Height, Ptn - public int Game_Effect_NotesFlash_Timer = 20; - public int[] Game_Effect_GoGoSplash = new int[] { 300, 400, 30 }; - public int[] Game_Effect_GoGoSplash_X = new int[] { 120, 300, 520, 760, 980, 1160 }; - public int[] Game_Effect_GoGoSplash_Y = new int[] { 740, 730, 720, 720, 730, 740 }; - public bool Game_Effect_GoGoSplash_Rotate = true; - public int Game_Effect_GoGoSplash_Timer = 18; - // super-flying-notes AioiLight - public int[] Game_Effect_FlyingNotes_StartPoint_X = new int[] { 414, 414 }; - public int[] Game_Effect_FlyingNotes_StartPoint_Y = new int[] { 260, 434 }; - public int[] Game_Effect_FlyingNotes_EndPoint_X = new int[] { 1222, 1222 }; // 1P, 2P - public int[] Game_Effect_FlyingNotes_EndPoint_Y = new int[] { 164, 554 }; - public int[] Game_Effect_FlyingNotes_EndPoint_X_AI = new int[] { 1222, 1222 }; // 1P, 2P - public int[] Game_Effect_FlyingNotes_EndPoint_Y_AI = new int[] { -230, 820 }; - - public int Game_Effect_FlyingNotes_Sine = 220; - public bool Game_Effect_FlyingNotes_IsUsingEasing = true; - public int Game_Effect_FlyingNotes_Timer = 4; - public int[] Game_Effect_FireWorks = new int[] { 180, 180, 30 }; - public int Game_Effect_FireWorks_Timer = 5; - public int[] Game_Effect_Rainbow_X = new int[] { 360, 360 }; - public int[] Game_Effect_Rainbow_Y = new int[] { -100, 410 }; - public int Game_Effect_Rainbow_Timer = 8; - - public int[] Game_Effects_Hit_Explosion_X = new int[] { 284, 284 }; - public int[] Game_Effects_Hit_Explosion_Y = new int[] { 126, 303 }; - - public bool Game_Effect_HitExplosion_AddBlend = true; - public bool Game_Effect_HitExplosionBig_AddBlend = true; - - public int[] Game_Effect_Fire_X = new int[] { 240, 240 }; - public int[] Game_Effect_Fire_Y = new int[] { 71, 248 }; - - public bool Game_Effect_FireWorks_AddBlend = true; - public bool Game_Effect_Fire_AddBlend = true; - public bool Game_Effect_GoGoSplash_AddBlend = true; - public int Game_Effect_FireWorks_Timing = 8; - - public int[] Game_Effects_Hit_Explosion_4P = new int[] { 284, -20 }; - public int[] Game_Effects_Hit_Explosion_5P = new int[] { 284, -39 }; - - public int[] Game_Effect_Fire_4P = new int[] { 240, -75 }; - public int[] Game_Effect_Fire_5P = new int[] { 240, -94 }; - #endregion - #region Lane - public int[] Game_Lane_X = new int[] { 333, 333 }; - public int[] Game_Lane_Y = new int[] { 192, 368 }; - public int[] Game_Lane_Sub_X = new int[] { 333, 333 }; - public int[] Game_Lane_Sub_Y = new int[] { 326, 502 }; - - public int[] Game_Lane_4P = new int[] { 333, 46 }; - public int[] Game_Lane_5P = new int[] { 333, 39 }; - #endregion - #region Runner - #endregion - #region PuchiChara - public int[] Game_PuchiChara_X = new int[] { 100, 100 }; - public int[] Game_PuchiChara_Y = new int[] { 140, 675 }; - public int[] Game_PuchiChara_4P = new int[] { 230, 162 }; - public int[] Game_PuchiChara_5P = new int[] { 230, 150 }; - public int[] Game_PuchiChara_BalloonX = new int[] { 300, 300 }; - public int[] Game_PuchiChara_BalloonY = new int[] { 240, 500 }; - public int[] Game_PuchiChara_KusudamaX = new int[] { 290, 690, 90, 890, 490 }; - public int[] Game_PuchiChara_KusudamaY = new int[] { 420, 420, 420, 420, 420 }; - public float[] Game_PuchiChara_Scale = new float[] { 0.6f, 0.8f }; // 通常時、 ふうせん連打時 - public int[] Game_PuchiChara = new int[] { 256, 256, 2 }; // Width, Height, Ptn - public int Game_PuchiChara_Sine = 20; - public int Game_PuchiChara_Timer = 4800; - public double Game_PuchiChara_SineTimer = 2; - #endregion - #region Dan-C - public Color Game_DanC_Title_ForeColor = ColorTranslator.FromHtml("#FFFFFF"); - public Color Game_DanC_Title_BackColor = ColorTranslator.FromHtml("#000000"); - public Color Game_DanC_SubTitle_ForeColor = ColorTranslator.FromHtml("#FFFFFF"); - public Color Game_DanC_SubTitle_BackColor = ColorTranslator.FromHtml("#000000"); - - public int[] Game_DanC_Size = new int[] { 1006, 92 }; - public int[] Game_DanC_Number_Size = new int[] { 48, 58 }; - public int[] Game_DanC_Small_Number_Size = new int[] { 24, 29 }; - public int[] Game_DanC_MiniNumber_Size = new int[] { 23, 28 }; - public int[] Game_DanC_ExamType_Size = new int[] { 247, 28 }; - public int[] Game_DanC_ExamRange_Size = new int[] { 54, 30 }; - public int[] Game_DanC_ExamUnit_Size = new int[] { 30, 36 }; - - public int[] Game_DanC_Offset = new int[] { 259, 27 }; - public int[] Game_DanC_Number_Small_Number_Offset = new int[] { 285, 38 }; - public int[] Game_DanC_Exam_Offset = new int[] { 222, 27 }; - - public int[] Game_DanC_X = new int[] { 807, 70, 70, 70 }; // 329, 437 - public int[] Game_DanC_Y = new int[] { 116, 292, 292, 292 }; // { 116, 190, 236, 292 }; - public int[] Game_DanC_Base_Offset_X = new int[] { 0, 503 }; - public int[] Game_DanC_Base_Offset_Y = new int[] { 0, 0 }; - public int[] Game_DanC_SmallBase_Offset_X = new int[] { 745, 410 }; - public int[] Game_DanC_SmallBase_Offset_Y = new int[] { 119, 119 }; - public int[] Game_DanC_Number_XY = new int[] { 214, 67 }; - public int[] Game_DanC_Dan_Plate = new int[] { 149, 416 }; - - public int[] Game_DanC_DanIcon_Offset = new int[] { 44, 57 }; - public int[] Game_DanC_DanIcon_Offset_Mini = new int[] { -19, 11 }; - - public int[] Game_DanC_Title_X = new int[] { 806, 806 }; - public int[] Game_DanC_Title_Y = new int[] { 257, 237 }; - public int[] Game_DanC_SubTitle = new int[] { 806, 277 }; - - - public int Game_DanC_Title_Size = 30; - public int Game_DanC_SubTitle_Size = 22; - public int Game_DanC_ExamFont_Size = 14; - - public int Game_DanC_Title_MaxWidth = 710; - public int Game_DanC_SubTitle_MaxWidth = 710; - - public int Game_DanC_Padding = 9; - public int Game_DanC_Number_Padding = 35; - public int Game_DanC_Number_Small_Padding = 41; - public int Game_DanC_ExamRange_Padding = 49; - public int[] Game_DanC_Percent_Hit_Score_Padding = new int[] { 20, 20, 20 }; - - public float Game_DanC_Number_Small_Scale = 0.92f; - public float Game_DanC_Exam_Number_Scale = 0.47f; - - #endregion - #region Training - public int[] Game_Training_DownBG = new int[] { 0, 360 }; - public int[] Game_Training_BigTaiko = new int[] { 334, 400 }; - public int[] Game_Training_Speed_Measure = new int[] { 0, 360 }; - public int Game_Training_ScrollTime = 350; - public int[] Game_Training_ProgressBar_XY = { 333, 378 }; - public int Game_Training_GoGoPoint_Y = 396; - public int Game_Training_JumpPoint_Y = 375; - public int[] Game_Training_MaxMeasureCount_XY = { 284, 377 }; - public int[] Game_Training_CurrentMeasureCount_XY = { 254, 370 }; - public int[] Game_Training_SpeedDisplay_XY = { 110, 370 }; - public int Game_Training_SmallNumber_Width = 17; - public int Game_Training_BigNumber_Width = 20; - #endregion - #region Tower - public int[] Game_Tower_Sky_Gradient = new int[] { 0, 360 }; - public int[] Game_Tower_Sky_Gradient_Size = new int[] { 1280, 316 }; - - public int[] Game_Tower_Floors_Body = new int[] { 640, 676 }; - public int[] Game_Tower_Floors_Deco = new int[] { 460, 640 }; - public int[] Game_Tower_Floors_Move = new int[] { 0, 288 }; - - public int[] Game_Tower_Don = new int[] { 590, 648 }; - public int[] Game_Tower_Don_Move = new int[] { 300, 0 }; - - public int[] Game_Tower_Miss = new int[] { 640, 520 }; - - public int[] Game_Tower_Floor_Number = new int[] { 556, 84 }; - - public int[] Game_Tower_Life_Number = new int[] { 996, 106 }; - - public int[] Game_Tower_Font_TouTatsuKaiSuu = new int[] { 350, 32 }; - public int[] Game_Tower_Font_Kai = new int[] { 550, 104 }; - - public int Game_Tower_Font_TowerText = 28; - #endregion - #region AIBattle - public int Game_AIBattle_CharaMove = 71; - - public int[] Game_AIBattle_SectionTime_Panel = new int[] { 202, 178 }; - public int[] Game_AIBattle_SectionTime_Bar = new int[] { 205, 193 }; - - public int[] Game_AIBattle_Batch_Base = new int[] { 150, 83 }; - - public int[] Game_AIBattle_Batch = new int[] { 150, 83 }; - public int[] Game_AIBattle_Batch_Size = new int[] { 70, 70 }; - - public int[] Game_AIBattle_Batch_Anime = new int[] { 260, -35 }; - public int[] Game_AIBattle_Batch_Anime_Size = new int[] { 274, 274 }; - - public int[] Game_AIBattle_Batch_Move = new int[] { 30, 15 }; - - public int[] Game_AIBattle_Judge_Meter_X = new int[] { 3, 3 }; - public int[] Game_AIBattle_Judge_Meter_Y = new int[] { 55, 418 }; - - public int[] Game_AIBattle_Judge_Number_Perfect_X = new int[] { 107, 107 }; - public int[] Game_AIBattle_Judge_Number_Perfect_Y = new int[] { 74, 437 }; - - public int[] Game_AIBattle_Judge_Number_Good_X = new int[] { 107, 107 }; - public int[] Game_AIBattle_Judge_Number_Good_Y = new int[] { 91, 454 }; - - public int[] Game_AIBattle_Judge_Number_Miss_X = new int[] { 107, 107 }; - public int[] Game_AIBattle_Judge_Number_Miss_Y = new int[] { 108, 471 }; - - public int[] Game_AIBattle_Judge_Number_Roll_X = new int[] { 107, 107 }; - public int[] Game_AIBattle_Judge_Number_Roll_Y = new int[] { 125, 488 }; - - public int[] Game_AIBattle_Judge_Number_Interval = new int[] { 10, 0 }; - #endregion - - #endregion - #region Result - - public bool Result_Use1PUI = false; - public int[] Result_UIMove_4P_X = new int[] { 0, 320, 640, 960 }; - public int[] Result_UIMove_4P_Y = new int[] { 0, 0, 0, 0 }; - public int[] Result_UIMove_5P_X = new int[] { 0, 256, 512, 768, 1024 }; - public int[] Result_UIMove_5P_Y = new int[] { 0, 0, 0, 0, 0 }; - - public int Result_Cloud_Count = 11; - public int[] Result_Cloud_X = new int[] { 642, 612, 652, 1148, 1180, 112, 8, 1088, 1100, 32, 412 }; - public int[] Result_Cloud_Y = new int[] { 202, 424, 636, 530, 636, 636, 102, 52, 108, 326, 644 }; - public int[] Result_Cloud_MaxMove = new int[] { 150, 120, 180, 60, 90, 150, 120, 50, 45, 120, 180 }; - - public int Result_Shine_Count = 6; - public int[][] Result_Shine_X = new int[][] { - new int[] { 885, 1255, 725, 890, 1158, 1140 }, - new int[] { 395, 25, 555, 390, 122, 140 }, - }; - public int[][] Result_Shine_Y = new int[][] { - new int[] { 650, 405, 645, 420, 202, 585 }, - new int[] { 650, 405, 645, 420, 202, 585 } - }; - public float[] Result_Shine_Size = { 0.44f, 0.6f, 0.4f, 0.15f, 0.35f, 0.6f }; - - public int[][] Result_Work_X = new int[][] { - new int[] { 800, 900, 1160 }, - new int[] { 480, 380, 120 } - }; - public int[][] Result_Work_Y = new int[][] { - new int[] { 435, 185, 260 }, - new int[] { 435, 185, 260 } - }; - - public int[] Result_DifficultyBar_Size = new int[] { 185, 54 }; - public int[] Result_DifficultyBar_X = new int[] { 18, 653 }; - public int[] Result_DifficultyBar_Y = new int[] { 101, 101 }; - - public int[] Result_Gauge_Base_X = new int[] { 55, 690 }; - public int[] Result_Gauge_Base_Y = new int[] { 140, 140 }; - - public int[] Result_Gauge_X = new int[] { 57, 692 }; - public int[] Result_Gauge_Y = new int[] { 140, 140 }; - public int[] Result_Gauge_Rect = new int[] { 0, 0, 487, 36 }; - - public int[] Result_Gauge_Rainbow_X = new int[] { 57, 692 }; - public int[] Result_Gauge_Rainbow_Y = new int[] { 144, 144 }; - public int Result_Gauge_Rainbow_Ptn; - public int Result_Gauge_Rainbow_Interval = 1000 / 60; - - public int[] Result_Gauge_ClearText_X = new int[] { 441, 1076 }; - public int[] Result_Gauge_ClearText_Y = new int[] { 142, 142 }; - public int[] Result_Gauge_ClearText_Rect = new int[] { 0, 35, 42, 20 }; - public int[] Result_Gauge_ClearText_Clear_Rect = new int[] { 42, 35, 42, 20 }; - - public int[] Result_Number_Interval = new int[] { 22, 0 }; - - public float Result_Number_Scale_4P = 1.0f; - - public float Result_Number_Scale_5P = 1.0f; - - public int[] Result_Soul_Fire_X = new int[] { 576, 1211 }; - public int[] Result_Soul_Fire_Y = new int[] { 160, 160 }; - - public int[] Result_Soul_Text_X = new int[] { 575, 1210 }; - public int[] Result_Soul_Text_Y = new int[] { 159, 159 }; - - public int[] Result_Perfect_X = new int[] { 490, 1125 }; - public int[] Result_Perfect_Y = new int[] { 188, 188 }; - - public int[] Result_Good_X = new int[] { 490, 1125 }; - public int[] Result_Good_Y = new int[] { 230, 230 }; - - public int[] Result_Miss_X = new int[] { 490, 1125 }; - public int[] Result_Miss_Y = new int[] { 272, 272 }; - - public int[] Result_Roll_X = new int[] { 490, 1125 }; - public int[] Result_Roll_Y = new int[] { 314, 314 }; - - public int[] Result_MaxCombo_X = new int[] { 490, 1125 }; - public int[] Result_MaxCombo_Y = new int[] { 356, 356 }; - - public bool Result_ADLib_Show = false; - public int[] Result_ADLib_X = new int[] { 0, 0 }; - public int[] Result_ADLib_Y = new int[] { 0, 0 }; - - public bool Result_Bomb_Show = false; - public int[] Result_Bomb_X = new int[] { 0, 0 }; - public int[] Result_Bomb_Y = new int[] { 0, 0 }; - - public int[] Result_Score_X = new int[] { 295, 930 }; - public int[] Result_Score_Y = new int[] { 212, 212 }; - public int[] Result_Score_Number_Interval = new int[] { 33, 0 }; - - public float Result_Score_Scale_4P = 1.0f; - public float Result_Score_Scale_5P = 1.0f; - - public int[] Result_ScoreRankEffect_X = new int[] { 135, 770 }; - public int[] Result_ScoreRankEffect_Y = new int[] { 339, 339 }; - - public int[] Result_CrownEffect_X = new int[] { 262, 897 }; - public int[] Result_CrownEffect_Y = new int[] { 336, 336 }; - - public int[] Result_Speech_Bubble_X = new int[] { 430, 850 }; - public int[] Result_Speech_Bubble_Y = new int[] { 526, 526 }; - - public int[] Result_Speech_Bubble_V2_X = new int[] { 0, 0 }; - public int[] Result_Speech_Bubble_V2_Y = new int[] { 0, 0 }; - - public int[] Result_Speech_Bubble_V2_2P_X = new int[] { 0, 0 }; - public int[] Result_Speech_Bubble_V2_2P_Y = new int[] { 0, 0 }; - - public int[] Result_NamePlate_X = new int[] { 28, 1032 }; - public int[] Result_NamePlate_Y = new int[] { 621, 621 }; - - public int[] Result_ModIcons_X = new int[] { 32, 1028 }; - public int[] Result_ModIcons_Y = new int[] { 678, 678 }; - - public int[] Result_Flower_X = new int[] { 182, 1098 }; - public int[] Result_Flower_Y = new int[] { 602, 602 }; - - public int[][] Result_Flower_Rotate_X = new int[][] { - new int[] { 48, 125, 48, 240, 87 }, - new int[] { 964, 1041, 964, 1156, 1003 }, - }; - public int[][] Result_Flower_Rotate_Y = new int[][] { - new int[] { 549, 585, 546, 501, 509 }, - new int[] { 549, 585, 546, 501, 509 } - }; - - public int Result_PlateShine_Count = 6; - public int[][] Result_PlateShine_X = new int[][] { - new int[] { 333, 342, 184, 198, 189, 309 }, - new int[] { 1249, 1258, 1100, 1114, 1105, 1225 } - }; - public int[][] Result_PlateShine_Y = new int[][] { - new int[] { 670, 620, 650, 687, 558, 542 }, - new int[] { 670, 620, 650, 687, 558, 542 } - }; - - public int Result_MusicName_X = 640; - public int Result_MusicName_Y = 30; - public int Result_MusicName_FontSize = 25; - public int Result_MusicName_MaxSize = 660; - public ReferencePoint Result_MusicName_ReferencePoint = ReferencePoint.Center; - public int Result_StageText_X = 230; - public int Result_StageText_Y = 6; - public int Result_StageText_FontSize = 30; - public ReferencePoint Result_StageText_ReferencePoint = ReferencePoint.Left; - - public Color Result_MusicName_ForeColor = ColorTranslator.FromHtml("#FFFFFF"); - public Color Result_StageText_ForeColor = ColorTranslator.FromHtml("#FFFFFF"); - public Color Result_MusicName_BackColor = ColorTranslator.FromHtml("#000000"); - public Color Result_StageText_BackColor = ColorTranslator.FromHtml("#000000"); - - public int[] Result_Dan = new int[] { 500, 500 }; - public int[] Result_Dan_XY = new int[] { 0, 420 }; - public int[] Result_Dan_Plate_XY = new int[] { 149, 149 }; - - public int[] Result_DifficultyBar_4P = new int[] { 6, 101 }; - public int[] Result_DifficultyBar_5P = new int[] { -9, 101 }; - - public int[] Result_Gauge_Base_4P = new int[] { 25, 140 }; - public int[] Result_Gauge_Base_5P = new int[] { 4, 140 }; - - public int[] Result_Gauge_4P = new int[] { 27, 140 }; - public int[] Result_Gauge_5P = new int[] { 6, 140 }; - - public int[] Result_Gauge_ClearText_4P = new int[] { 218, 142 }; - public int[] Result_Gauge_ClearText_5P = new int[] { 197, 142 }; - - public int[] Result_Gauge_Rainbow_4P = new int[] { 26, 144 }; - public int[] Result_Gauge_Rainbow_5P = new int[] { 5, 144 }; - - public int[] Result_Soul_Fire_4P = new int[] { 284, 160 }; - public int[] Result_Soul_Fire_5P = new int[] { 232, 120 }; - - public int[] Result_Soul_Text_4P = new int[] { 283, 159 }; - public int[] Result_Soul_Text_5P = new int[] { 231, 119 }; - - public int[] Result_Perfect_4P = new int[] { 183, 251 }; - public int[] Result_Perfect_5P = new int[] { 151, 251 }; - - public int[] Result_Good_4P = new int[] { 183, 293 }; - public int[] Result_Good_5P = new int[] { 151, 293 }; - - public int[] Result_Miss_4P = new int[] { 183, 335 }; - public int[] Result_Miss_5P = new int[] { 151, 335 }; - - public int[] Result_Roll_4P = new int[] { 183, 377 }; - public int[] Result_Roll_5P = new int[] { 151, 377 }; - - public int[] Result_MaxCombo_4P = new int[] { 183, 419 }; - public int[] Result_MaxCombo_5P = new int[] { 151, 419 }; - - public int[] Result_ADLib_4P = new int[] { 0, 0 }; - public int[] Result_ADLib_5P = new int[] { 0, 0 }; - - public int[] Result_Bomb_4P = new int[] { 0, 0 }; - public int[] Result_Bomb_5P = new int[] { 0, 0 }; - - public int[] Result_Score_4P = new int[] { 253, 180 }; - public int[] Result_Score_5P = new int[] { 221, 180 }; - - public int[] Result_ScoreRankEffect_4P = new int[] { 100, 545 }; - public int[] Result_ScoreRankEffect_5P = new int[] { 68, 545 }; - - public int[] Result_CrownEffect_4P = new int[] { 220, 545 }; - public int[] Result_CrownEffect_5P = new int[] { 188, 545 }; - - - public int[] Result_Speech_Bubble_V2_4P = new int[] { 0, 0 }; - - public int[] Result_Speech_Bubble_V2_5P = new int[] { 0, 0 }; - - - public int[] Result_Speech_Text_Offset = new int[] { 0, 0 }; - public int Result_Speech_Text_Size = 60; - public int Result_Speech_Text_MaxWidth = 560; - - public int[] Result_NamePlate_4P = new int[] { 80, 621 }; - public int[] Result_NamePlate_5P = new int[] { 31, 621 }; - - public int[] Result_ModIcons_4P = new int[] { 15, 678 }; - public int[] Result_ModIcons_5P = new int[] { -17, 678 }; - #endregion - - #region AIResult - - public int[] Result_AIBattle_Batch = new int[] { 884, 188 }; - public int[] Result_AIBattle_Batch_Move = new int[] { 104, 43 }; - public int[] Result_AIBattle_SectionPlate_Offset = new int[] { 55, 8 }; - - public int[] Result_AIBattle_SectionText_Offset = new int[] { 110, 27 }; - public int Result_AIBattle_SectionText_Scale = 13; - - public int[] Result_AIBattle_WinFlag = new int[] { 946, 526 }; - - #endregion - - #region DanResult - - public int[] DanResult_StatePanel = new int[] { 0, -4 }; - - public int[] DanResult_SongPanel_Main_X = new int[] { 255, 255, 255 }; - public int[] DanResult_SongPanel_Main_Y = new int[] { 100, 283, 466 }; - - public int[] DanResult_Difficulty_Cymbol_X = new int[] { 377, 377, 377 }; - public int[] DanResult_Difficulty_Cymbol_Y = new int[] { 146, 329, 512 }; - - public int[] DanResult_Level_Number_X = new int[] { 383, 383, 383 }; - public int[] DanResult_Level_Number_Y = new int[] { 173, 356, 539 }; - - public int[] DanResult_Sections_Perfect_X = new int[] { 455, 455, 455 }; - public int[] DanResult_Sections_Perfect_Y = new int[] { 204, 387, 570 }; - - public int[] DanResult_Sections_Good_X = new int[] { 666, 666, 666 }; - public int[] DanResult_Sections_Good_Y = new int[] { 204, 387, 570 }; - - public int[] DanResult_Sections_Miss_X = new int[] { 877, 877, 877 }; - public int[] DanResult_Sections_Miss_Y = new int[] { 204, 387, 570 }; - - public int[] DanResult_Sections_Roll_X = new int[] { 1088, 1088, 1088 }; - public int[] DanResult_Sections_Roll_Y = new int[] { 204, 387, 570 }; - - - public int[] DanResult_Perfect = new int[] { 720, 95 }; - public int[] DanResult_Good = new int[] { 720, 137 }; - public int[] DanResult_Miss = new int[] { 720, 179 }; - public int[] DanResult_Roll = new int[] { 1022, 95 }; - public int[] DanResult_MaxCombo = new int[] { 1022, 137 }; - public int[] DanResult_TotalHit = new int[] { 1022, 179 }; - public int[] DanResult_Score = new int[] { 566, 119 }; - - public int[] DanResult_Exam = new int[] { 232, 254 }; - - public int[] DanResult_DanTitles_X = new int[] { 401, 401, 401 }; - public int[] DanResult_DanTitles_Y = new int[] { 139, 322, 505 }; - - public int[] DanResult_DanIcon_X = new int[] { 315, 315, 315 }; - public int[] DanResult_DanIcon_Y = new int[] { 158, 342, 526 }; - - public int[] DanResult_Rank = new int[] { 130, 380 }; - - public int DanResult_Font_DanTitles_Size = 24; - - #endregion - - #region TowerResult - - public int[] TowerResult_ScoreRankEffect = new int[] { 1000, 220 }; - - public int[] TowerResult_Toutatsu = new int[] { 196, 160 }; - public int[] TowerResult_MaxFloors = new int[] { 616, 296 }; - public int[] TowerResult_Ten = new int[] { 982, 394 }; - public int[] TowerResult_Score = new int[] { 248, 394 }; - - public int[] TowerResult_CurrentFloor = new int[] { 688, 258 }; - public int[] TowerResult_ScoreCount = new int[] { 1026, 394 }; - public int[] TowerResult_RemainingLifes = new int[] { 1068, 490 }; - - public int[] TowerResult_Gauge_Soul = new int[] { 248, 474 }; - - public int TowerResult_Font_TowerText = 28; - public int TowerResult_Font_TowerText48 = 48; - public int TowerResult_Font_TowerText72 = 72; - - #endregion - - #region Heya - - public int[] Heya_Main_Menu_X = new int[] { 164, 164, 164, 164, 164 }; - public int[] Heya_Main_Menu_Y = new int[] { 26, 106, 186, 266, 346 }; - public int[] Heya_Main_Menu_Font_Offset = new int[] { 0, 14 }; - public int Heya_Center_Menu_Box_Count = 11; - public int[] Heya_Center_Menu_Box_X = new int[] { -890, -588, -286, 16, 318, 620, 922, 1224, 1526, 1828, 2130 }; - public int[] Heya_Center_Menu_Box_Y = new int[] { 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200 }; - public int[] Heya_Center_Menu_Box_Item_Offset = new int[] { 0, 120 }; - public int[] Heya_Center_Menu_Box_Name_Offset = new int[] { 0, 234 }; - public int[] Heya_Center_Menu_Box_Authors_Offset = new int[] { 0, 260 }; - public int Heya_Side_Menu_Count = 13; - public int[] Heya_Side_Menu_X = new int[] { 670, 680, 690, 700, 710, 720, 730, 720, 710, 700, 690, 680, 670 }; - public int[] Heya_Side_Menu_Y = new int[] { -80, -10, 60, 130, 200, 270, 340, 410, 480, 550, 620, 690, 760 }; - public int[] Heya_Side_Menu_Font_Offset = new int[] { 0, 14 }; - public int[] Heya_InfoSection = new int[] { 620, 560 }; - public int[] Heya_DescriptionTextOrigin = new int[] { 0, 0 }; - public int Heya_Font_Scale = 14; - - #endregion - - #region OnlineLounge - - public int[] OnlineLounge_Side_Menu = new int[] { 640, 360 }; - public int[] OnlineLounge_Side_Menu_Text_Offset = new int[] { 0, 18 }; - public int[] OnlineLounge_Side_Menu_Move = new int[] { 0, 80 }; - - public int[] OnlineLounge_Song = new int[] { 350, 360 }; - public int[] OnlineLounge_Song_Title_Offset = new int[] { 0, 18 }; - public int[] OnlineLounge_Song_SubTitle_Offset = new int[] { 0, 46 }; - public int[] OnlineLounge_Song_Move = new int[] { 0, 100 }; - - public int[] OnlineLounge_Context_Charter = new int[] { 980, 300 }; - public int[] OnlineLounge_Context_Genre = new int[] { 980, 340 }; - public int[] OnlineLounge_Context_Couse_Symbol = new int[] { 800, 480 }; - public int[] OnlineLounge_Context_Level = new int[] { 900, 494 }; - public int[] OnlineLounge_Context_Couse_Move = new int[] { 240, 60 }; - - public int[] OnlineLounge_Downloading = new int[] { 640, 605 }; - - public int OnlineLounge_Font_OLFont = 14; - public int OnlineLounge_Font_OLFontLarge = 28; - - #endregion - - #region TowerSelect - - public int TowerSelect_Title_Size = 30; - public int TowerSelect_Title_MaxWidth = 230; - public int[] TowerSelect_Title_Offset = new int[] { 0, -30 }; - public int TowerSelect_SubTitle_Size = 30; - public int TowerSelect_SubTitle_MaxWidth = 230; - public int[] TowerSelect_SubTitle_Offset = new int[] { 0, 10 }; - public int TowerSelect_Bar_Count = 7; - public int[] TowerSelect_Bar_X = new int[] { -260, 40, 340, 640, 940, 1240, 1540 }; - public int[] TowerSelect_Bar_Y = new int[] { 420, 400, 380, 360, 380, 400, 420 }; - - #endregion - - #region OpenEncyclopedia - - public int[] OpenEncyclopedia_Context_Item2 = new int[] { 960, 180 }; - public int[] OpenEncyclopedia_Context_Item3 = new int[] { 640, 360 }; - public int[] OpenEncyclopedia_Context_PageText = new int[] { 960, 720 }; - public int[] OpenEncyclopedia_Side_Menu = new int[] { 320, 360 }; - public int[] OpenEncyclopedia_Side_Menu_Move = new int[] { 0, 90 }; - public int[] OpenEncyclopedia_Side_Menu_Text_Offset = new int[] { 0, 0 }; - public int OpenEncyclopedia_Font_EncyclopediaMenu_Size = 14; - - #endregion - - #region Exit - public int Exit_Duration = 3000; - #endregion - - #region Font - public int Font_Edge_Ratio = 30; - public int Font_Edge_Ratio_Vertical = 30; - public int Text_Correction_X = 0; - public int Text_Correction_Y = 0; - #endregion - - #region NamePlate - - public int[] NamePlate_Title_Offset = new int[] { 124, 22 }; - public int[] NamePlate_Dan_Offset = new int[] { 69, 44 }; - public int[] NamePlate_Name_Offset_Normal = new int[] { 121, 36 }; - public int[] NamePlate_Name_Offset_WithTitle = new int[] { 121, 44 }; - public int[] NamePlate_Name_Offset_Full = new int[] { 144, 44 }; - public int NamePlate_Name_Width_Normal = 220; - public int NamePlate_Name_Width_Full = 120; - public int NamePlate_Title_Width = 160; - public int NamePlate_Dan_Width = 66; - - public int NamePlate_Font_Name_Size_Normal = 15; - public int NamePlate_Font_Name_Size_WithTitle = 12; - public int NamePlate_Font_Title_Size = 11; - public int NamePlate_Font_Dan_Size = 12; - - #endregion - - #region [Mod icons] - - public int[] ModIcons_OffsetX = { 0, 30, 60, 90, 0, 30, 60, 90 }; - public int[] ModIcons_OffsetY = { 0, 0, 0, 0, 30, 30, 30, 30 }; - public int[] ModIcons_OffsetX_Menu = { 0, 30, 60, 90, 120, 150, 180, 210 }; - public int[] ModIcons_OffsetY_Menu = { 0, 0, 0, 0, 0, 0, 0, 0 }; - - #endregion - - #region Modal - - public int[] Modal_Title_Full = new int[] { 640, 140 }; - public int[] Modal_Title_Half_X = new int[] { 320, 960 }; - public int[] Modal_Title_Half_Y = new int[] { 290, 290 }; - - public int[] Modal_Text_Full = new int[] { 640, 327 };//445 - public int[] Modal_Text_Full_Move = new int[] { 0, 118 }; - public int[] Modal_Text_Half_X = new int[] { 320, 960 }; - public int[] Modal_Text_Half_Y = new int[] { 383, 383 }; - public int[] Modal_Text_Half_Move = new int[] { 0, 59 }; - - public int Modal_Font_ModalContentHalf_Size = 28; - public int Modal_Font_ModalTitleHalf_Size = 28; - public int Modal_Font_ModalContentFull_Size = 56; - public int Modal_Font_ModalTitleFull_Size = 56; - - public int[] Modal_Title_Half_X_4P = new int[] { 320, 960, 320, 960 }; - public int[] Modal_Title_Half_X_5P = new int[] { 320, 960, 320, 960, 320 }; - - public int[] Modal_Title_Half_Y_4P = new int[] { 66, 66, 426, 426 }; - public int[] Modal_Title_Half_Y_5P = new int[] { 50, 50, 290, 290, 530 }; - - public int[] Modal_Text_Half_X_4P = new int[] { 320, 960, 320, 960 }; - public int[] Modal_Text_Half_X_5P = new int[] { 320, 960, 320, 960, 320 }; - - public int[] Modal_Text_Half_Y_4P = new int[] { 159, 159, 519, 519 }; - public int[] Modal_Text_Half_Y_5P = new int[] { 107, 107, 347, 347, 587 }; - - public int[] Modal_Text_Half_Move_4P = new int[] { 0, 59 }; - public int[] Modal_Text_Half_Move_5P = new int[] { 0, 40 }; - - #endregion - - #region PopupMenu - - public int[] PopupMenu_Menu_Title = new int[2] { 460, 40 }; - public int[] PopupMenu_Title = new int[2] { 540, 44 }; - public int[] PopupMenu_Menu_Highlight = new int[2] { 480, 46 }; - public int[] PopupMenu_MenuItem_Name = new int[2] { 480, 77 }; - public int[] PopupMenu_MenuItem_Value = new int[2] { 630, 77 }; - public int[] PopupMenu_Move = new int[2] { 0, 32 }; - public int PopupMenu_Font_Size = 18; - - #endregion - #endregion } + + // メソッド + + public static string Path(string strファイルの相対パス) { + if (strBoxDefSkinSubfolderFullName == "" || !bUseBoxDefSkin) { + return System.IO.Path.Combine(strSystemSkinSubfolderFullName, strファイルの相対パス); + } else { + return System.IO.Path.Combine(strBoxDefSkinSubfolderFullName, strファイルの相対パス); + } + } + + /// + /// フルパス名を与えると、スキン名として、ディレクトリ名末尾の要素を返す + /// 例: C:{System.IO.Path.DirectorySeparatorChar}foo{System.IO.Path.DirectorySeparatorChar}bar{System.IO.Path.DirectorySeparatorChar} なら、barを返す + /// + /// スキンが格納されたパス名(フルパス) + /// スキン名 + public static string GetSkinName(string skinPathFullName) { + if (skinPathFullName != null) { + if (skinPathFullName == "") // 「box.defで未定義」用 + skinPathFullName = strSystemSkinSubfolderFullName; + string[] tmp = skinPathFullName.Split(System.IO.Path.DirectorySeparatorChar); + return tmp[tmp.Length - 2]; // ディレクトリ名の最後から2番目の要素がスキン名(最後の要素はnull。元stringの末尾が{System.IO.Path.DirectorySeparatorChar}なので。) + } + return null; + } + public static string[] GetSkinName(string[] skinPathFullNames) { + string[] ret = new string[skinPathFullNames.Length]; + for (int i = 0; i < skinPathFullNames.Length; i++) { + ret[i] = GetSkinName(skinPathFullNames[i]); + } + return ret; + } + + + public string GetSkinSubfolderFullNameFromSkinName(string skinName) { + foreach (string s in strSystemSkinSubfolders) { + if (GetSkinName(s) == skinName) + return s; + } + foreach (string b in strBoxDefSkinSubfolders) { + if (GetSkinName(b) == skinName) + return b; + } + return null; + } + + /// + /// スキンパス名が妥当かどうか + /// (タイトル画像にアクセスできるかどうかで判定する) + /// + /// 妥当性を確認するスキンパス(フルパス) + /// 妥当ならtrue + public bool bIsValid(string skinPathFullName) { + string filePathTitle; + filePathTitle = System.IO.Path.Combine(skinPathFullName, @$"Graphics{System.IO.Path.DirectorySeparatorChar}1_Title{System.IO.Path.DirectorySeparatorChar}Background.png"); + return (File.Exists(filePathTitle)); + } + + + public void tRemoveMixerAll() { + for (int i = 0; i < nシステムサウンド数; i++) { + if (this[i] != null && this[i].bLoadedSuccessfuly) { + this[i].tStop(); + this[i].tRemoveMixer(); + } + } + + } + + /// + /// 変数の初期化 + /// + public void tSkinConfigInit() { + this.eDiffDispMode = EDifficultyDisplayType.ImageOnMTaiko; + this.b現在のステージ数を表示しない = false; + } + + public void LoadSkinConfigFromFile(string path, ref string work) { + if (!File.Exists(Path(path))) return; + using (var streamReader = new StreamReader(Path(path), Encoding.GetEncoding(OpenTaiko.sEncType))) { + while (streamReader.Peek() > -1) // 一行ずつ読み込む。 + { + var nowLine = streamReader.ReadLine(); + if (nowLine.StartsWith("#include")) { + // #include hogehoge.iniにぶち当たった + var includePath = nowLine.Substring("#include ".Length).Trim(); + LoadSkinConfigFromFile(includePath, ref work); // 再帰的に読み込む + } else { + work += nowLine + Environment.NewLine; + } + } + } + } + + public void tReadSkinConfig() { + var str = ""; + LoadSkinConfigFromFile(Path(@$"SkinConfig.ini"), ref str); + this.t文字列から読み込み(str); + + } + + private void t文字列から読み込み(string strAllSettings) // 2011.4.13 yyagi; refactored to make initial KeyConfig easier. + { + string[] delimiter = { "\n" }; + string[] strSingleLine = strAllSettings.Split(delimiter, StringSplitOptions.RemoveEmptyEntries); + foreach (string s in strSingleLine) { + string str = s.Replace('\t', ' ').TrimStart(new char[] { '\t', ' ' }); + if ((str.Length != 0) && (str[0] != ';')) { + try { + string strCommand; + string strParam; + string[] strArray = str.Split(new char[] { '=' }); + if (strArray.Length == 2) { + strCommand = strArray[0].Trim(); + strParam = strArray[1].Trim(); + + #region [Skin Settings] + + void ParseInt32(Action setValue) { + if (int.TryParse(strParam, out var unparsedValue)) { + setValue(unparsedValue); + } else { + Trace.TraceWarning($"SkinConfigの値 {strCommand} は整数値である必要があります。現在の値: {strParam}"); + } + } + switch (strCommand) { + case "Name": { + this.Skin_Name = strParam; + break; + } + case "Version": { + this.Skin_Version = strParam; + break; + } + case "Creator": { + this.Skin_Creator = strParam; + break; + } + case "Resolution": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Resolution[i] = int.Parse(strSplit[i]); + } + break; + } + #endregion + + #region [Background Scroll] + + case "Background_Scroll_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + this.Background_Scroll_Y[i] = int.Parse(strSplit[i]); + } + break; + } + + #endregion + + #region [Taiko Mode] + //----------------------------- + case "ScrollFieldP1Y": { + this.nScrollFieldY[0] = CConversion.StringToInt(strParam, 192); + break; + } + case "ScrollFieldP2Y": { + this.nScrollFieldY[1] = CConversion.StringToInt(strParam, 192); + break; + } + case "SENotesP1Y": { + this.nSENotesY[0] = CConversion.StringToInt(strParam, this.nSENotesY[0]); + break; + } + case "SENotesP2Y": { + this.nSENotesY[1] = CConversion.StringToInt(strParam, this.nSENotesY[1]); + break; + } + case "JudgePointP1Y": { + this.nJudgePointY[0] = CConversion.StringToInt(strParam, this.nJudgePointY[0]); + break; + } + case "JudgePointP2Y": { + this.nJudgePointY[1] = CConversion.StringToInt(strParam, this.nJudgePointY[1]); + break; + } + + case "DiffDispMode": { + this.eDiffDispMode = (EDifficultyDisplayType)CConversion.ParseIntInRange(strParam, 0, 2, (int)this.eDiffDispMode); + break; + } + case "NowStageDisp": { + this.b現在のステージ数を表示しない = CConversion.bONorOFF(strParam[0]); + break; + } + + //----------------------------- + #endregion + + #region [Result screen] + //----------------------------- + case "ResultPanelP1X": { + this.nResultPanelP1X = CConversion.StringToInt(strParam, 515); + break; + } + case "ResultPanelP1Y": { + this.nResultPanelP1Y = CConversion.StringToInt(strParam, 75); + break; + } + case "ResultPanelP2X": { + this.nResultPanelP2X = CConversion.StringToInt(strParam, 515); + break; + } + case "ResultPanelP2Y": { + this.nResultPanelP2Y = CConversion.StringToInt(strParam, 75); + break; + } + case "ResultScoreP1X": { + this.nResultScoreP1X = CConversion.StringToInt(strParam, 582); + break; + } + case "ResultScoreP1Y": { + this.nResultScoreP1Y = CConversion.StringToInt(strParam, 252); + break; + } + //----------------------------- + #endregion + + + #region 新・SkinConfig + + #region Startup + case nameof(StartUp_LangSelect_FontSize): { + StartUp_LangSelect_FontSize = int.Parse(strParam); + break; + } + #endregion + + #region Title + case nameof(Title_LoadingPinInstances): { + Title_LoadingPinInstances = int.Parse(strParam); + break; + } + case nameof(Title_LoadingPinFrameCount): { + Title_LoadingPinFrameCount = int.Parse(strParam); + break; + } + case nameof(Title_LoadingPinCycle): { + Title_LoadingPinCycle = int.Parse(strParam); + break; + } + case "Title_LoadingPinBase": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Title_LoadingPinBase[i] = int.Parse(strSplit[i]); + } + break; + } + case "Title_LoadingPinDiff": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Title_LoadingPinDiff[i] = int.Parse(strSplit[i]); + } + break; + } + case "Title_Entry_Bar_Text_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Title_Entry_Bar_Text_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "Title_Entry_Bar_Text_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Title_Entry_Bar_Text_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "Title_Banapas_Load_Clear_Anime": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Title_Banapas_Load_Clear_Anime[i] = int.Parse(strSplit[i]); + } + break; + } + case "Title_Entry_Player_Select_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 3; i++) { + Title_Entry_Player_Select_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "Title_Entry_Player_Select_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 3; i++) { + Title_Entry_Player_Select_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "Title_Entry_Player_Select_Rect_0_Side": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 4; i++) { + Title_Entry_Player_Select_Rect[0][0][i] = int.Parse(strSplit[i]); + } + break; + } + case "Title_Entry_Player_Select_Rect_0_Center": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 4; i++) { + Title_Entry_Player_Select_Rect[0][1][i] = int.Parse(strSplit[i]); + } + break; + } + case "Title_Entry_Player_Select_Rect_1_Side": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 4; i++) { + Title_Entry_Player_Select_Rect[1][0][i] = int.Parse(strSplit[i]); + } + break; + } + case "Title_Entry_Player_Select_Rect_1_Center": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 4; i++) { + Title_Entry_Player_Select_Rect[1][1][i] = int.Parse(strSplit[i]); + } + break; + } + case "Title_Entry_Player_Select_Rect_2_Side": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 4; i++) { + Title_Entry_Player_Select_Rect[2][0][i] = int.Parse(strSplit[i]); + } + break; + } + case "Title_Entry_Player_Select_Rect_2_Center": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 4; i++) { + Title_Entry_Player_Select_Rect[2][1][i] = int.Parse(strSplit[i]); + } + break; + } + case "Title_Entry_NamePlate": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Title_Entry_NamePlate[i] = int.Parse(strSplit[i]); + } + break; + } + case "Title_ModeSelect_Bar_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 3; i++) { + Title_ModeSelect_Bar_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "Title_ModeSelect_Bar_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 3; i++) { + Title_ModeSelect_Bar_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "Title_ModeSelect_Bar_Offset": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Title_ModeSelect_Bar_Offset[i] = int.Parse(strSplit[i]); + } + break; + } + case "Title_ModeSelect_Title_Offset": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Title_ModeSelect_Title_Offset[i] = int.Parse(strSplit[i]); + } + break; + } + case "Title_ModeSelect_Title_Scale": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Title_ModeSelect_Title_Scale[i] = int.Parse(strSplit[i]); + } + break; + } + case "Title_ModeSelect_Bar_Center_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 3; i++) { + Title_ModeSelect_Bar_Center_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "Title_ModeSelect_Bar_Center_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 3; i++) { + Title_ModeSelect_Bar_Center_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "Title_ModeSelect_Bar_Center_Rect_Up": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 4; i++) { + Title_ModeSelect_Bar_Center_Rect[0][i] = int.Parse(strSplit[i]); + } + break; + } + case "Title_ModeSelect_Bar_Center_Rect_Down": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 4; i++) { + Title_ModeSelect_Bar_Center_Rect[1][i] = int.Parse(strSplit[i]); + } + break; + } + case "Title_ModeSelect_Bar_Center_Rect_Center": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 4; i++) { + Title_ModeSelect_Bar_Center_Rect[2][i] = int.Parse(strSplit[i]); + } + break; + } + + + + + case "Title_ModeSelect_Bar_Overlay_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 3; i++) { + Title_ModeSelect_Bar_Overlay_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "Title_ModeSelect_Bar_Overlay_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 3; i++) { + Title_ModeSelect_Bar_Overlay_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "Title_ModeSelect_Bar_Overlay_Rect_Up": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 4; i++) { + Title_ModeSelect_Bar_Overlay_Rect[0][i] = int.Parse(strSplit[i]); + } + break; + } + case "Title_ModeSelect_Bar_Overlay_Rect_Down": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 4; i++) { + Title_ModeSelect_Bar_Overlay_Rect[1][i] = int.Parse(strSplit[i]); + } + break; + } + case "Title_ModeSelect_Bar_Overlay_Rect_Center": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 4; i++) { + Title_ModeSelect_Bar_Overlay_Rect[2][i] = int.Parse(strSplit[i]); + } + break; + } + case "Title_ModeSelect_Bar_Move": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Title_ModeSelect_Bar_Move[i] = int.Parse(strSplit[i]); + } + break; + } + case "Title_ModeSelect_Bar_Move_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Title_ModeSelect_Bar_Move_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "Title_ModeSelect_Overlay_Move": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Title_ModeSelect_Overlay_Move[i] = int.Parse(strSplit[i]); + } + break; + } + case "Title_ModeSelect_Overlay_Move_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Title_ModeSelect_Overlay_Move_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "Title_ModeSelect_Bar_Chara_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Title_ModeSelect_Bar_Chara_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "Title_ModeSelect_Bar_Chara_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Title_ModeSelect_Bar_Chara_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "Title_ModeSelect_Bar_Chara_Move": { + Title_ModeSelect_Bar_Chara_Move = int.Parse(strParam); + break; + } + case "Title_ModeSelect_Bar_Center_Title": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Title_ModeSelect_Bar_Center_Title[i] = int.Parse(strSplit[i]); + } + break; + } + case "Title_ModeSelect_Bar_Center_Title_Move": { + Title_ModeSelect_Bar_Center_Title_Move = int.Parse(strParam); + break; + } + case "Title_ModeSelect_Bar_Center_Title_Move_X": { + Title_ModeSelect_Bar_Center_Title_Move_X = int.Parse(strParam); + break; + } + case "Title_ModeSelect_Bar_Center_BoxText": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Title_ModeSelect_Bar_Center_BoxText[i] = int.Parse(strSplit[i]); + } + break; + } + case "Title_VerticalText": { + Title_VerticalText = CConversion.bONorOFF(strParam[0]); + break; + } + case "Title_VerticalBar": { + Title_VerticalBar = CConversion.bONorOFF(strParam[0]); + break; + } + #endregion + + #region Config + case "Config_Arrow_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Config_Arrow_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "Config_Arrow_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Config_Arrow_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "Config_Arrow_Focus_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Config_Arrow_Focus_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "Config_Arrow_Focus_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Config_Arrow_Focus_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "Config_Item_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 3; i++) { + Config_Item_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "Config_Item_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 3; i++) { + Config_Item_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "Config_Item_Width": { + Config_Item_Width = int.Parse(strParam); + break; + } + case "Config_Item_Font_Offset": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Config_Item_Font_Offset[i] = int.Parse(strSplit[i]); + } + break; + } + case "Config_Font_Scale": { + Config_Font_Scale = int.Parse(strParam); + break; + } + case "Config_Selected_Menu_Text_Grad_Color_1": { + Config_Selected_Menu_Text_Grad_Color_1 = ColorTranslator.FromHtml(strParam); + break; + } + case "Config_Selected_Menu_Text_Grad_Color_2": { + Config_Selected_Menu_Text_Grad_Color_2 = ColorTranslator.FromHtml(strParam); + break; + } + case "Config_Font_Scale_Description": { + Config_Font_Scale_Description = float.Parse(strParam); + break; + } + case "Config_ItemBox_Count": { + Config_ItemBox_Count = int.Parse(strParam); + break; + } + case "Config_ItemBox_X": { + Config_ItemBox_X = new int[Config_ItemBox_Count]; + + string[] strSplit = strParam.Split(','); + for (int i = 0; i < Config_ItemBox_Count; i++) { + Config_ItemBox_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "Config_ItemBox_Y": { + Config_ItemBox_Y = new int[Config_ItemBox_Count]; + + string[] strSplit = strParam.Split(','); + for (int i = 0; i < Config_ItemBox_Count; i++) { + Config_ItemBox_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "Config_ItemBox_Font_Offset": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Config_ItemBox_Font_Offset[i] = int.Parse(strSplit[i]); + } + break; + } + case "Config_ItemBox_ItemValue_Font_Offset": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Config_ItemBox_ItemValue_Font_Offset[i] = int.Parse(strSplit[i]); + } + break; + } + case "Config_ExplanationPanel": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Config_ExplanationPanel[i] = int.Parse(strSplit[i]); + } + break; + } + case "Config_SkinSample1": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Config_SkinSample1[i] = int.Parse(strSplit[i]); + } + break; + } + case "Config_KeyAssign": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Config_KeyAssign[i] = int.Parse(strSplit[i]); + } + break; + } + case "Config_KeyAssign_Menu_Highlight": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Config_KeyAssign_Menu_Highlight[i] = int.Parse(strSplit[i]); + } + break; + } + case "Config_KeyAssign_Font": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Config_KeyAssign_Font[i] = int.Parse(strSplit[i]); + } + break; + } + case "Config_KeyAssign_Move": { + Config_KeyAssign_Move = int.Parse(strParam); + break; + } + case nameof(Config_Calibration_OffsetText): { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Config_Calibration_OffsetText[i] = int.Parse(strSplit[i]); + } + break; + } + case nameof(Config_Calibration_InfoText): { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Config_Calibration_InfoText[i] = int.Parse(strSplit[i]); + } + break; + } + case nameof(Config_Calibration_Highlights): { + string[] strSplit = strParam.Split(','); + int recs = Math.Min(strSplit.Length, 12); + for (int i = 0; i + 3 < recs; i += 4) { + Config_Calibration_Highlights[i / 4] = new Rectangle(int.Parse(strSplit[i]), int.Parse(strSplit[i + 1]), int.Parse(strSplit[i + 2]), int.Parse(strSplit[i + 3])); + } + break; + } + #endregion + + #region [Mod Icons] + + + /* + * public int[] ModIcons_OffsetX = { 0, 30, 60, 90, 0, 30, 60, 90 }; + public int[] ModIcons_OffsetY = { 0, 0, 0, 0, 30, 30, 30, 30 }; + public int[] ModIcons_OffsetX_Menu = { 0, 30, 60, 90, 120, 150, 180, 210 }; + public int[] ModIcons_OffsetY_Menu = { 0, 0, 0, 0, 0, 0, 0, 0 }; + */ + + case "ModIcons_OffsetX": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 8; i++) { + ModIcons_OffsetX[i] = int.Parse(strSplit[i]); + } + break; + } + case "ModIcons_OffsetY": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 8; i++) { + ModIcons_OffsetY[i] = int.Parse(strSplit[i]); + } + break; + } + case "ModIcons_OffsetX_Menu": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 8; i++) { + ModIcons_OffsetX_Menu[i] = int.Parse(strSplit[i]); + } + break; + } + case "ModIcons_OffsetY_Menu": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 8; i++) { + ModIcons_OffsetY_Menu[i] = int.Parse(strSplit[i]); + } + break; + } + + #endregion + + #region SongSelect + case "SongSelect_BoxExplanation_X": { + SongSelect_BoxExplanation_X = int.Parse(strParam); + break; + } + case "SongSelect_BoxExplanation_Y": { + SongSelect_BoxExplanation_Y = int.Parse(strParam); + break; + } + case "SongSelect_BoxExplanation_Interval": { + SongSelect_BoxExplanation_Interval = int.Parse(strParam); + break; + } + case "SongSelect_GenreName": { + SongSelect_GenreName = this.strStringを配列に直す(strParam); + break; + } + case "SongSelect_Bar_Count": { + SongSelect_Bar_Count = int.Parse(strParam); + break; + } + case "SongSelect_Bar_X": { + SongSelect_Bar_X = new int[SongSelect_Bar_Count]; + + string[] strSplit = strParam.Split(','); + for (int i = 0; i < SongSelect_Bar_Count; i++) { + SongSelect_Bar_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_Bar_Y": { + SongSelect_Bar_Y = new int[SongSelect_Bar_Count]; + + string[] strSplit = strParam.Split(','); + for (int i = 0; i < SongSelect_Bar_Count; i++) { + SongSelect_Bar_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_Bar_Anim_X": { + SongSelect_Bar_Anim_X = new int[SongSelect_Bar_Count]; + + string[] strSplit = strParam.Split(','); + for (int i = 0; i < SongSelect_Bar_Count; i++) { + SongSelect_Bar_Anim_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_Bar_Anim_Y": { + SongSelect_Bar_Anim_Y = new int[SongSelect_Bar_Count]; + + string[] strSplit = strParam.Split(','); + for (int i = 0; i < SongSelect_Bar_Count; i++) { + SongSelect_Bar_Anim_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_Scroll_Interval": { + SongSelect_Scroll_Interval = float.Parse(strParam); + break; + } + case "SongSelect_DanStatus_Offset_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + SongSelect_DanStatus_Offset_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_DanStatus_Offset_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + SongSelect_DanStatus_Offset_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_TowerStatus_Offset_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + SongSelect_TowerStatus_Offset_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_TowerStatus_Offset_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + SongSelect_TowerStatus_Offset_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_RegularCrowns_Offset_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + SongSelect_RegularCrowns_Offset_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_RegularCrowns_Offset_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + SongSelect_RegularCrowns_Offset_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_RegularCrowns_ScoreRank_Offset_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + SongSelect_RegularCrowns_ScoreRank_Offset_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_RegularCrowns_ScoreRank_Offset_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + SongSelect_RegularCrowns_ScoreRank_Offset_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_RegularCrowns_Difficulty_Cymbol_Offset_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + SongSelect_RegularCrowns_Difficulty_Cymbol_Offset_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_RegularCrowns_Difficulty_Cymbol_Offset_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + SongSelect_RegularCrowns_Difficulty_Cymbol_Offset_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_FavoriteStatus_Offset": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + SongSelect_FavoriteStatus_Offset[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_Bar_Title_Offset": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + SongSelect_Bar_Title_Offset[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_Bar_Box_Offset": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + SongSelect_Bar_Box_Offset[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_Bar_BackBox_Offset": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + SongSelect_Bar_BackBox_Offset[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_Bar_Random_Offset": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + SongSelect_Bar_Random_Offset[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_Bar_SubTitle_Offset": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + SongSelect_Bar_SubTitle_Offset[i] = int.Parse(strSplit[i]); + } + break; + } + + + case "SongSelect_BoxName_Scale": { + SongSelect_BoxName_Scale = int.Parse(strParam); + break; + } + case "SongSelect_MusicName_Scale": { + SongSelect_MusicName_Scale = int.Parse(strParam); + break; + } + case "SongSelect_Subtitle_Scale": { + SongSelect_Subtitle_Scale = int.Parse(strParam); + break; + } + case "SongSelect_BoxText_Scale": { + SongSelect_BoxText_Scale = int.Parse(strParam); + break; + } + + case "SongSelect_VerticalText": { + SongSelect_VerticalText = CConversion.bONorOFF(strParam[0]); + break; + } + + case "SongSelect_Bar_Center_Move_X": { + SongSelect_Bar_Center_Move_X = int.Parse(strParam); + break; + } + + case "SongSelect_Title_MaxSize": { + SongSelect_Title_MaxSize = int.Parse(strParam); + break; + } + case "SongSelect_SubTitle_MaxSize": { + SongSelect_SubTitle_MaxSize = int.Parse(strParam); + break; + } + case "SongSelect_Maker_Show": { + SongSelect_Maker_Show = CConversion.bONorOFF(strParam[0]); + break; + } + case "SongSelect_Shorten_Frame_Fade": { + SongSelect_Shorten_Frame_Fade = CConversion.bONorOFF(strParam[0]); + break; + } + case "SongSelect_Bar_Select_Skip_Fade": { + SongSelect_Bar_Select_Skip_Fade = CConversion.bONorOFF(strParam[0]); + break; + } + case "SongSelect_Maker": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + SongSelect_Maker[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_Maker_Size": { + SongSelect_Maker_Size = int.Parse(strParam); + break; + } + case "SongSelect_Maker_MaxSize": { + SongSelect_Maker_MaxSize = int.Parse(strParam); + break; + } + + case "SongSelect_Bar_Center_Move": { + SongSelect_Bar_Center_Move = int.Parse(strParam); + break; + } + case "SongSelect_Bar_Select": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + SongSelect_Bar_Select[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_Frame_Score_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 4; i++) { + SongSelect_Frame_Score_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_Frame_Score_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 4; i++) { + SongSelect_Frame_Score_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_Level_Number_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 4; i++) { + SongSelect_Level_Number_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_Level_Number_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 4; i++) { + SongSelect_Level_Number_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_Level_Number_Tower": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + SongSelect_Level_Number_Tower[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_Tower_Side": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + SongSelect_Tower_Side[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_Level_Number_Interval": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + SongSelect_Level_Number_Interval[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_Level_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 4; i++) { + SongSelect_Level_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_Level_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 4; i++) { + SongSelect_Level_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_Level_Move": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + SongSelect_Level_Move[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_Box_Opening_Interval": { + SongSelect_Box_Opening_Interval = float.Parse(strParam); + break; + } + case "SongSelect_Unlock_Conditions_Text": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + SongSelect_Unlock_Conditions_Text[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_Difficulty_Select_Title": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + SongSelect_Difficulty_Select_Title[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_Difficulty_Select_SubTitle": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + SongSelect_Difficulty_Select_SubTitle[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_Box_Chara_Move": { + SongSelect_Box_Chara_Move = int.Parse(strParam); + break; + } + case "SongSelect_Box_Chara_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + SongSelect_Box_Chara_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_Box_Chara_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + SongSelect_Box_Chara_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_NamePlate_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 5; i++) { + SongSelect_NamePlate_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_NamePlate_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 5; i++) { + SongSelect_NamePlate_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_Auto_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + SongSelect_Auto_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_Auto_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + SongSelect_Auto_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_ModIcons_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 5; i++) { + SongSelect_ModIcons_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_ModIcons_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 5; i++) { + SongSelect_ModIcons_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_Timer": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + SongSelect_Timer[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_Timer_Interval": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + SongSelect_Timer_Interval[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_Bpm_Show": { + SongSelect_Bpm_Show = CConversion.bONorOFF(strParam[0]); + break; + } + case "SongSelect_Bpm_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 3; i++) { + SongSelect_Bpm_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_Bpm_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 3; i++) { + SongSelect_Bpm_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_Bpm_Interval": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + SongSelect_Bpm_Interval[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_BPM_Text_Show": { + SongSelect_BPM_Text_Show = CConversion.bONorOFF(strParam[0]); + break; + } + case "SongSelect_BPM_Text": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + SongSelect_BPM_Text[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_BPM_Text_Size": { + SongSelect_BPM_Text_Size = int.Parse(strParam); + break; + } + case "SongSelect_BPM_Text_MaxSize": { + SongSelect_BPM_Text_MaxSize = int.Parse(strParam); + break; + } + case "SongSelect_Explicit": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + SongSelect_Explicit[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_Movie": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + SongSelect_Movie[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_FloorNum_Show": { + SongSelect_FloorNum_Show = CConversion.bONorOFF(strParam[0]); + break; + } + case "SongSelect_FloorNum_X": { + SongSelect_FloorNum_X = int.Parse(strParam); + break; + } + case "SongSelect_FloorNum_Y": { + SongSelect_FloorNum_Y = int.Parse(strParam); + break; + } + case "SongSelect_FloorNum_Interval": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + SongSelect_FloorNum_Interval[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_DanInfo_Show": { + SongSelect_DanInfo_Show = CConversion.bONorOFF(strParam[0]); + break; + } + case "SongSelect_DanInfo_Icon_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 3; i++) { + SongSelect_DanInfo_Icon_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_DanInfo_Icon_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 3; i++) { + SongSelect_DanInfo_Icon_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_DanInfo_Icon_Scale": { + SongSelect_DanInfo_Icon_Scale = float.Parse(strParam); + break; + } + case "SongSelect_DanInfo_Difficulty_Cymbol_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 3; i++) { + SongSelect_DanInfo_Difficulty_Cymbol_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_DanInfo_Difficulty_Cymbol_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 3; i++) { + SongSelect_DanInfo_Difficulty_Cymbol_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_DanInfo_Difficulty_Cymbol_Scale": { + SongSelect_DanInfo_Difficulty_Cymbol_Scale = float.Parse(strParam); + break; + } + case "SongSelect_DanInfo_Level_Number_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 3; i++) { + SongSelect_DanInfo_Level_Number_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_DanInfo_Level_Number_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 3; i++) { + SongSelect_DanInfo_Level_Number_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_DanInfo_Level_Number_Scale": { + SongSelect_DanInfo_Level_Number_Scale = float.Parse(strParam); + break; + } + case "SongSelect_DanInfo_Title_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 3; i++) { + SongSelect_DanInfo_Title_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_DanInfo_Title_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 3; i++) { + SongSelect_DanInfo_Title_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_DanInfo_Title_Size": { + SongSelect_DanInfo_Title_Size = int.Parse(strParam); + break; + } + case "SongSelect_DanInfo_Exam_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 6; i++) { + SongSelect_DanInfo_Exam_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_DanInfo_Exam_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 6; i++) { + SongSelect_DanInfo_Exam_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_DanInfo_Exam_Size": { + SongSelect_DanInfo_Exam_Size = int.Parse(strParam); + break; + } + case "SongSelect_DanInfo_Exam_Value_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 3; i++) { + SongSelect_DanInfo_Exam_Value_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_DanInfo_Exam_Value_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 6; i++) { + SongSelect_DanInfo_Exam_Value_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_DanInfo_Exam_Value_Scale": { + SongSelect_DanInfo_Exam_Value_Scale = float.Parse(strParam); + break; + } + case "SongSelect_Table_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 5; i++) { + SongSelect_Table_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_Table_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 5; i++) { + SongSelect_Table_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_High_Score_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 5; i++) { + SongSelect_High_Score_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_High_Score_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 5; i++) { + SongSelect_High_Score_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_High_Score_Difficulty_Cymbol_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 5; i++) { + SongSelect_High_Score_Difficulty_Cymbol_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_High_Score_Difficulty_Cymbol_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 5; i++) { + SongSelect_High_Score_Difficulty_Cymbol_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_BoardNumber_1P_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 13; i++) { + SongSelect_BoardNumber_X[0][i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_BoardNumber_1P_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 13; i++) { + SongSelect_BoardNumber_Y[0][i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_BoardNumber_2P_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 13; i++) { + SongSelect_BoardNumber_X[1][i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_BoardNumber_2P_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 13; i++) { + SongSelect_BoardNumber_Y[1][i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_BoardNumber_3P_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 13; i++) { + SongSelect_BoardNumber_X[2][i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_BoardNumber_3P_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 13; i++) { + SongSelect_BoardNumber_Y[2][i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_BoardNumber_4P_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 13; i++) { + SongSelect_BoardNumber_X[3][i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_BoardNumber_4P_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 13; i++) { + SongSelect_BoardNumber_Y[3][i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_BoardNumber_5P_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 13; i++) { + SongSelect_BoardNumber_X[4][i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_BoardNumber_5P_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 13; i++) { + SongSelect_BoardNumber_Y[4][i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_BoardNumber_Interval": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + SongSelect_BoardNumber_Interval[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_SongNumber_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + SongSelect_SongNumber_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_SongNumber_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + SongSelect_SongNumber_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_SongNumber_Interval": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + SongSelect_SongNumber_Interval[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_Search_Bar_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 5; i++) { + SongSelect_Search_Bar_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_Search_Bar_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 5; i++) { + SongSelect_Search_Bar_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_Level_Offset": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + SongSelect_Level_Offset[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_Difficulty_Colors": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 7; i++) { + SongSelect_Difficulty_Colors[i] = ColorTranslator.FromHtml(strSplit[i]); + } + break; + } + case "SongSelect_Difficulty_Back": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + SongSelect_Difficulty_Back[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_Difficulty_Bar_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 7; i++) { + SongSelect_Difficulty_Bar_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_Branch_Text_Offset": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + SongSelect_Branch_Text_Offset[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_Branch_Offset": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + SongSelect_Branch_Offset[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_Difficulty_Bar_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 7; i++) { + SongSelect_Difficulty_Bar_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_Difficulty_Bar_Back_Rect": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 4; i++) { + SongSelect_Difficulty_Bar_Rect[0][i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_Difficulty_Bar_Option_Rect": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 4; i++) { + SongSelect_Difficulty_Bar_Rect[1][i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_Difficulty_Bar_Easy_Rect": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 4; i++) { + SongSelect_Difficulty_Bar_Rect[2][i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_Difficulty_Bar_Normal_Rect": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 4; i++) { + SongSelect_Difficulty_Bar_Rect[3][i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_Difficulty_Bar_Hard_Rect": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 4; i++) { + SongSelect_Difficulty_Bar_Rect[4][i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_Difficulty_Bar_Oni_Rect": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 4; i++) { + SongSelect_Difficulty_Bar_Rect[5][i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_Difficulty_Bar_Edit_Rect": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 4; i++) { + SongSelect_Difficulty_Bar_Rect[6][i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_Difficulty_Star_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 5; i++) { + SongSelect_Difficulty_Star_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_Difficulty_Star_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 5; i++) { + SongSelect_Difficulty_Star_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_Difficulty_Star_Interval": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + SongSelect_Difficulty_Star_Interval[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_Difficulty_Number_X": { + string[] strSplit = strParam.Split(','); + int max = Math.Min(strSplit.Length, 7); + for (int i = 0; i < max; i++) { + SongSelect_Difficulty_Number_X[i] = int.Parse(strSplit[i]); + if (i == 4) { + SongSelect_Difficulty_Number_X[5] = SongSelect_Difficulty_Number_X[i]; + SongSelect_Difficulty_Number_X[6] = SongSelect_Difficulty_Number_X[i]; + } + } + break; + } + case "SongSelect_Difficulty_Number_Y": { + string[] strSplit = strParam.Split(','); + int max = Math.Min(strSplit.Length, 7); + for (int i = 0; i < max; i++) { + SongSelect_Difficulty_Number_Y[i] = int.Parse(strSplit[i]); + if (i == 4) { + SongSelect_Difficulty_Number_Y[5] = SongSelect_Difficulty_Number_Y[i]; + SongSelect_Difficulty_Number_Y[6] = SongSelect_Difficulty_Number_Y[i]; + } + } + break; + } + case "SongSelect_Difficulty_Number_Interval": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + SongSelect_Difficulty_Number_Interval[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_Difficulty_Crown_1P_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 5; i++) { + SongSelect_Difficulty_Crown_X[0][i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_Difficulty_Crown_2P_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 5; i++) { + SongSelect_Difficulty_Crown_X[1][i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_Difficulty_Crown_1P_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 5; i++) { + SongSelect_Difficulty_Crown_Y[0][i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_Difficulty_Crown_2P_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 5; i++) { + SongSelect_Difficulty_Crown_Y[1][i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_Difficulty_ScoreRank_1P_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 5; i++) { + SongSelect_Difficulty_ScoreRank_X[0][i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_Difficulty_ScoreRank_2P_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 5; i++) { + SongSelect_Difficulty_ScoreRank_X[1][i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_Difficulty_ScoreRank_1P_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 5; i++) { + SongSelect_Difficulty_ScoreRank_Y[0][i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_Difficulty_ScoreRank_2P_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 5; i++) { + SongSelect_Difficulty_ScoreRank_Y[1][i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_Difficulty_Select_Bar_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 7; i++) { + SongSelect_Difficulty_Select_Bar_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_Difficulty_Select_Bar_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 7; i++) { + SongSelect_Difficulty_Select_Bar_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_Difficulty_Select_Bar_Back_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 7; i++) { + SongSelect_Difficulty_Select_Bar_Back_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_Difficulty_Select_Bar_Back_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 7; i++) { + SongSelect_Difficulty_Select_Bar_Back_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_Difficulty_Select_Bar_Cursor_Rect": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 4; i++) { + SongSelect_Difficulty_Select_Bar_Rect[0][i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_Difficulty_Select_Bar_Back1_Rect": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 4; i++) { + SongSelect_Difficulty_Select_Bar_Rect[1][i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_Difficulty_Select_Bar_Back2_Rect": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 4; i++) { + SongSelect_Difficulty_Select_Bar_Rect[2][i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_Difficulty_Select_Bar_Anime": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + SongSelect_Difficulty_Select_Bar_Anime[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_Difficulty_Select_Bar_AnimeIn": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + SongSelect_Difficulty_Select_Bar_AnimeIn[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_Difficulty_Select_Bar_Move": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + SongSelect_Difficulty_Select_Bar_Move[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_Difficulty_Bar_ExExtra_AnimeDuration": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + SongSelect_Difficulty_Bar_ExExtra_AnimeDuration[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_Preimage": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + SongSelect_Preimage[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_Preimage_Size": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + SongSelect_Preimage_Size[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_Option_Select_Offset": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + SongSelect_Option_Select_Offset[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_Option_Font_Scale": { + SongSelect_Option_Font_Scale = int.Parse(strParam); + break; + } + case "SongSelect_Option_OptionType_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + SongSelect_Option_OptionType_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_Option_OptionType_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + SongSelect_Option_OptionType_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_Option_Value_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + SongSelect_Option_Value_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_Option_Value_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + SongSelect_Option_Value_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_Option_Interval": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + SongSelect_Option_Interval[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_Option_ModMults1_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + SongSelect_Option_ModMults1_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_Option_ModMults2_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + SongSelect_Option_ModMults2_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_Option_ModMults1_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + SongSelect_Option_ModMults1_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_Option_ModMults2_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + SongSelect_Option_ModMults2_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_NewHeya_Close_Select": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + SongSelect_NewHeya_Close_Select[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_NewHeya_PlayerPlate_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 5; i++) { + SongSelect_NewHeya_PlayerPlate_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_NewHeya_PlayerPlate_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 5; i++) { + SongSelect_NewHeya_PlayerPlate_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_NewHeya_ModeBar_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 5; i++) { + SongSelect_NewHeya_ModeBar_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_NewHeya_ModeBar_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 5; i++) { + SongSelect_NewHeya_ModeBar_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_NewHeya_ModeBar_Font_Offset": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + SongSelect_NewHeya_ModeBar_Font_Offset[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_NewHeya_Box_Count": { + SongSelect_NewHeya_Box_Count = int.Parse(strParam); + break; + } + case "SongSelect_NewHeya_Box_X": { + string[] strSplit = strParam.Split(','); + SongSelect_NewHeya_Box_X = new int[SongSelect_NewHeya_Box_Count]; + for (int i = 0; i < SongSelect_NewHeya_Box_Count; i++) { + SongSelect_NewHeya_Box_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_NewHeya_Box_Y": { + string[] strSplit = strParam.Split(','); + SongSelect_NewHeya_Box_Y = new int[SongSelect_NewHeya_Box_Count]; + for (int i = 0; i < SongSelect_NewHeya_Box_Count; i++) { + SongSelect_NewHeya_Box_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_NewHeya_Box_Chara_Offset": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + SongSelect_NewHeya_Box_Chara_Offset[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_NewHeya_Box_Name_Offset": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + SongSelect_NewHeya_Box_Name_Offset[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_NewHeya_Box_Author_Offset": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + SongSelect_NewHeya_Box_Author_Offset[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_NewHeya_Lock_Offset": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + SongSelect_NewHeya_Lock_Offset[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongSelect_NewHeya_InfoSection_Offset": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + SongSelect_NewHeya_InfoSection_Offset[i] = int.Parse(strSplit[i]); + } + break; + } + + + case "SongSelect_ForeColor_JPOP": { + SongSelect_ForeColor_JPOP = ColorTranslator.FromHtml(strParam); + break; + } + case "SongSelect_ForeColor_Anime": { + SongSelect_ForeColor_Anime = ColorTranslator.FromHtml(strParam); + break; + } + case "SongSelect_ForeColor_VOCALOID": { + SongSelect_ForeColor_VOCALOID = ColorTranslator.FromHtml(strParam); + break; + } + case "SongSelect_ForeColor_Children": { + SongSelect_ForeColor_Children = ColorTranslator.FromHtml(strParam); + break; + } + case "SongSelect_ForeColor_Variety": { + SongSelect_ForeColor_Variety = ColorTranslator.FromHtml(strParam); + break; + } + case "SongSelect_ForeColor_Classic": { + SongSelect_ForeColor_Classic = ColorTranslator.FromHtml(strParam); + break; + } + case "SongSelect_ForeColor_GameMusic": { + SongSelect_ForeColor_GameMusic = ColorTranslator.FromHtml(strParam); + break; + } + case nameof(SongSelect_ForeColor_Namco): { + SongSelect_ForeColor_GameMusic = ColorTranslator.FromHtml(strParam); + break; + } + case "SongSelect_BackColor_JPOP": { + SongSelect_BackColor_JPOP = ColorTranslator.FromHtml(strParam); + break; + } + case "SongSelect_BackColor_Anime": { + SongSelect_BackColor_Anime = ColorTranslator.FromHtml(strParam); + break; + } + case "SongSelect_BackColor_VOCALOID": { + SongSelect_BackColor_VOCALOID = ColorTranslator.FromHtml(strParam); + break; + } + case "SongSelect_BackColor_Children": { + SongSelect_BackColor_Children = ColorTranslator.FromHtml(strParam); + break; + } + case "SongSelect_BackColor_Variety": { + SongSelect_BackColor_Variety = ColorTranslator.FromHtml(strParam); + break; + } + case "SongSelect_BackColor_Classic": { + SongSelect_BackColor_Classic = ColorTranslator.FromHtml(strParam); + break; + } + case "SongSelect_BackColor_GameMusic": { + SongSelect_BackColor_GameMusic = ColorTranslator.FromHtml(strParam); + break; + } + case nameof(SongSelect_BackColor_Namco): { + SongSelect_BackColor_Namco = ColorTranslator.FromHtml(strParam); + break; + } + case nameof(SongSelect_CorrectionX_Chara): { + SongSelect_CorrectionX_Chara = strParam.Split(',').ToArray(); + break; + } + case nameof(SongSelect_CorrectionY_Chara): { + SongSelect_CorrectionY_Chara = strParam.Split(',').ToArray(); + break; + } + case nameof(SongSelect_CorrectionX_Chara_Value): { + SongSelect_CorrectionX_Chara_Value = int.Parse(strParam); + break; + } + case nameof(SongSelect_CorrectionY_Chara_Value): { + SongSelect_CorrectionY_Chara_Value = int.Parse(strParam); + break; + } + case nameof(SongSelect_Rotate_Chara): { + SongSelect_Rotate_Chara = strParam.Split(',').ToArray(); + break; + } + #endregion + + #region DaniSelect + /* + case "DaniSelect_Dan_Text_X": + { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 4; i++) + { + DaniSelect_Dan_Text_X[i] = int.Parse(strSplit[i]); + } + } + case "DaniSelect_Dan_Text_Y": + { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 4; i++) + { + DaniSelect_Dan_Text_Y[i] = int.Parse(strSplit[i]); + } + } + */ + case "DaniSelect_DanSides_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + DaniSelect_DanSides_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "DaniSelect_DanSides_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + DaniSelect_DanSides_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "DaniSelect_DanPlate": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + DaniSelect_DanPlate[i] = int.Parse(strSplit[i]); + } + break; + } + case "DaniSelect_Rank": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + DaniSelect_Rank[i] = int.Parse(strSplit[i]); + } + break; + } + case "DaniSelect_Bloc2": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + DaniSelect_Bloc2[i] = int.Parse(strSplit[i]); + } + break; + } + case "DaniSelect_Text_Gauge": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + DaniSelect_Text_Gauge[i] = int.Parse(strSplit[i]); + } + break; + } + case "DaniSelect_Value_Gauge": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + DaniSelect_Value_Gauge[i] = int.Parse(strSplit[i]); + } + break; + } + case "DaniSelect_DanIcon_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 3; i++) { + DaniSelect_DanIcon_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "DaniSelect_DanIcon_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 3; i++) { + DaniSelect_DanIcon_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "DaniSelect_Title_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 3; i++) { + DaniSelect_Title_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "DaniSelect_Title_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 3; i++) { + DaniSelect_Title_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "DaniSelect_Difficulty_Cymbol_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 3; i++) { + DaniSelect_Difficulty_Cymbol_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "DaniSelect_Difficulty_Cymbol_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 3; i++) { + DaniSelect_Difficulty_Cymbol_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "DaniSelect_Level_Number_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 3; i++) { + DaniSelect_Level_Number_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "DaniSelect_Level_Number_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 3; i++) { + DaniSelect_Level_Number_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "DaniSelect_Level_Number_Interval": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + DaniSelect_Level_Number_Interval[i] = int.Parse(strSplit[i]); + } + break; + } + case "DaniSelect_Soul_Number_Interval": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + DaniSelect_Soul_Number_Interval[i] = int.Parse(strSplit[i]); + } + break; + } + case "DaniSelect_Soul_Number_Text_Width": { + DaniSelect_Soul_Number_Text_Width = int.Parse(strParam); + break; + } + case "DaniSelect_Exam_Number_Interval": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + DaniSelect_Exam_Number_Interval[i] = int.Parse(strSplit[i]); + } + break; + } + case "DaniSelect_Exam_Number_Text_Width": { + DaniSelect_Exam_Number_Text_Width = int.Parse(strParam); + break; + } + case "DaniSelect_Font_DanFolder_Size": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + DaniSelect_Font_DanFolder_Size[i] = int.Parse(strSplit[i]); + } + break; + } + case "DaniSelect_FolderText_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 4; i++) { + DaniSelect_FolderText_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "DaniSelect_FolderText_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 4; i++) { + DaniSelect_FolderText_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "DaniSelect_Font_DanSong_Size": { + DaniSelect_Font_DanSong_Size = int.Parse(strParam); + break; + } + case "DaniSelect_Font_Exam_Size": { + DaniSelect_Font_Exam_Size = int.Parse(strParam); + break; + } + case "DaniSelect_Exam_Bloc_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 3; i++) { + DaniSelect_Exam_Bloc_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "DaniSelect_Exam_Bloc_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 3; i++) { + DaniSelect_Exam_Bloc_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "DaniSelect_Exam_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 3; i++) { + DaniSelect_Exam_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "DaniSelect_Exam_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 3; i++) { + DaniSelect_Exam_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "DaniSelect_Exam_X_Ex": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 3; i++) { + DaniSelect_Exam_X_Ex[i] = int.Parse(strSplit[i]); + } + break; + } + case "DaniSelect_Exam_Y_Ex": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 3; i++) { + DaniSelect_Exam_Y_Ex[i] = int.Parse(strSplit[i]); + } + break; + } + case "DaniSelect_Exam_Interval": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 3; i++) { + DaniSelect_Exam_Interval[i] = int.Parse(strSplit[i]); + } + break; + } + case "DaniSelect_Exam_Title_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 3; i++) { + DaniSelect_Exam_Title_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "DaniSelect_Exam_Title_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 3; i++) { + DaniSelect_Exam_Title_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "DaniSelect_Challenge_Select_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 3; i++) { + DaniSelect_Challenge_Select_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "DaniSelect_Challenge_Select_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 3; i++) { + DaniSelect_Challenge_Select_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "DaniSelect_Challenge_Select_Rect_Option": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 4; i++) { + DaniSelect_Challenge_Select_Rect[0][i] = int.Parse(strSplit[i]); + } + break; + } + case "DaniSelect_Challenge_Select_Rect_Start": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 4; i++) { + DaniSelect_Challenge_Select_Rect[1][i] = int.Parse(strSplit[i]); + } + break; + } + case "DaniSelect_Challenge_Select_Rect_Back": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 4; i++) { + DaniSelect_Challenge_Select_Rect[2][i] = int.Parse(strSplit[i]); + } + break; + } + case "DaniSelect_Plate": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + DaniSelect_Plate[i] = int.Parse(strSplit[i]); + } + break; + } + case "DaniSelect_Plate_Move": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + DaniSelect_Plate_Move[i] = int.Parse(strSplit[i]); + } + break; + } + case "DaniSelect_Plate_Center_Move": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + DaniSelect_Plate_Center_Move[i] = int.Parse(strSplit[i]); + } + break; + } + case "DaniSelect_Plate_Title_Offset": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + DaniSelect_Plate_Title_Offset[i] = int.Parse(strSplit[i]); + } + break; + } + case "DaniSelect_DanIconTitle_Size": { + DaniSelect_DanIconTitle_Size = int.Parse(strParam); + break; + } + case "DaniSelect_DanIconTitle_Offset": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + DaniSelect_DanIconTitle_Offset[i] = int.Parse(strSplit[i]); + } + break; + } + case "DaniSelect_DanIcon_Color": { + string[] strSplit = strParam.Split(','); + DaniSelect_DanIcon_Color = new Color[strSplit.Length]; + for (int i = 0; i < strSplit.Length; i++) { + DaniSelect_DanIcon_Color[i] = ColorTranslator.FromHtml(strSplit[i]); + } + break; + } + #endregion + + #region SongLoading + case nameof(SongLoading_Plate_X): { + SongLoading_Plate_X = int.Parse(strParam); + break; + } + case nameof(SongLoading_Plate_Y): { + SongLoading_Plate_Y = int.Parse(strParam); + break; + } + case nameof(SongLoading_Title_X): { + SongLoading_Title_X = int.Parse(strParam); + break; + } + case nameof(SongLoading_Title_Y): { + SongLoading_Title_Y = int.Parse(strParam); + break; + } + case nameof(SongLoading_Title_MaxSize): { + SongLoading_Title_MaxSize = int.Parse(strParam); + break; + } + case nameof(SongLoading_SubTitle_X): { + SongLoading_SubTitle_X = int.Parse(strParam); + break; + } + case nameof(SongLoading_SubTitle_Y): { + SongLoading_SubTitle_Y = int.Parse(strParam); + break; + } + case nameof(SongLoading_SubTitle_MaxSize): { + SongLoading_SubTitle_MaxSize = int.Parse(strParam); + break; + } + case nameof(SongLoading_Plate_X_AI): { + SongLoading_Plate_X_AI = int.Parse(strParam); + break; + } + case nameof(SongLoading_Plate_Y_AI): { + SongLoading_Plate_Y_AI = int.Parse(strParam); + break; + } + case nameof(SongLoading_Title_X_AI): { + SongLoading_Title_X_AI = int.Parse(strParam); + break; + } + case nameof(SongLoading_Title_Y_AI): { + SongLoading_Title_Y_AI = int.Parse(strParam); + break; + } + case nameof(SongLoading_SubTitle_X_AI): { + SongLoading_SubTitle_X_AI = int.Parse(strParam); + break; + } + case nameof(SongLoading_SubTitle_Y_AI): { + SongLoading_SubTitle_Y_AI = int.Parse(strParam); + break; + } + case "SongLoading_Fade_AI_Anime_Ring": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + SongLoading_Fade_AI_Anime_Ring[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongLoading_Fade_AI_Anime_LoadBar": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + SongLoading_Fade_AI_Anime_LoadBar[i] = int.Parse(strSplit[i]); + } + break; + } + case "SongLoading_DanPlate": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + SongLoading_DanPlate[i] = int.Parse(strSplit[i]); + } + break; + } + case nameof(SongLoading_Title_FontSize): { + if (int.Parse(strParam) > 0) + SongLoading_Title_FontSize = int.Parse(strParam); + break; + } + case nameof(SongLoading_SubTitle_FontSize): { + if (int.Parse(strParam) > 0) + SongLoading_SubTitle_FontSize = int.Parse(strParam); + break; + } + case "SongLoading_Chara_Move": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + SongLoading_Chara_Move[i] = int.Parse(strSplit[i]); + } + break; + } + case nameof(SongLoading_Plate_ReferencePoint): { + SongLoading_Plate_ReferencePoint = (ReferencePoint)int.Parse(strParam); + break; + } + case nameof(SongLoading_Title_ReferencePoint): { + SongLoading_Title_ReferencePoint = (ReferencePoint)int.Parse(strParam); + break; + } + case nameof(SongLoading_SubTitle_ReferencePoint): { + SongLoading_SubTitle_ReferencePoint = (ReferencePoint)int.Parse(strParam); + break; + } + + case nameof(SongLoading_Title_ForeColor): { + SongLoading_Title_ForeColor = ColorTranslator.FromHtml(strParam); + break; + } + case nameof(SongLoading_Title_BackColor): { + SongLoading_Title_BackColor = ColorTranslator.FromHtml(strParam); + break; + } + case nameof(SongLoading_SubTitle_ForeColor): { + SongLoading_SubTitle_ForeColor = ColorTranslator.FromHtml(strParam); + break; + } + case nameof(SongLoading_SubTitle_BackColor): { + SongLoading_SubTitle_BackColor = ColorTranslator.FromHtml(strParam); + break; + } + case nameof(SongLoading_Plate_ScreenBlend): { + SongLoading_Plate_ScreenBlend = CConversion.bONorOFF(strParam[0]); + break; + } + case nameof(DaniSelect_DanPlateTitle_Size): { + DaniSelect_DanPlateTitle_Size = int.Parse(strParam); + break; + } + case "DaniSelect_DanPlateTitle_Offset": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + DaniSelect_DanPlateTitle_Offset[i] = int.Parse(strSplit[i]); + } + break; + } + #endregion + + #region Game + case "Game_Notes_Anime": { + Game_Notes_Anime = CConversion.bONorOFF(strParam[0]); + break; + } + case "Game_ScrollField_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + nScrollFieldX[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_ScrollField_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + nScrollFieldY[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_ScrollField_4P": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + nScrollField_4P[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_ScrollField_5P": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + nScrollField_5P[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_SENotes_Offset_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + nSENotesX[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_SENotes_Offset_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + nSENotesY[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_SENotes_Offset_4P": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + nSENotes_4P[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_SENotes_Offset_5P": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + nSENotes_5P[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Notes_Size": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Notes_Size[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_SENote_Size": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_SENote_Size[i] = int.Parse(strSplit[i]); + } + break; + } + case nameof(Game_Notes_Interval): { + Game_Notes_Interval = int.Parse(strParam); + break; + } + case "Game_Notes_Arm_Offset_Left_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Notes_Arm_Offset_Left_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Notes_Arm_Offset_Right_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Notes_Arm_Offset_Right_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Notes_Arm_Offset_Left_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Notes_Arm_Offset_Left_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Notes_Arm_Offset_Right_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Notes_Arm_Offset_Right_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Notes_Arm_Move": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Notes_Arm_Move[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Judge_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Judge_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Judge_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Judge_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Judge_Move": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Judge_Move[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_ScoreRank_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_ScoreRank_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_ScoreRank_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_ScoreRank_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_ScoreRank_Move": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_ScoreRank_Move[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_StageText": { + Game_StageText = strParam; + break; + } + case nameof(Game_RollColorMode): { + Game_RollColorMode = (RollColorMode)int.Parse(strParam); + break; + } + case nameof(Game_JudgeFrame_AddBlend): { + Game_JudgeFrame_AddBlend = CConversion.bONorOFF(strParam[0]); + break; + } + + + case "Game_Judge_4P": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Judge_4P[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Judge_5P": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Judge_5P[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_UIMove_4P": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_UIMove_4P[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_UIMove_5P": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_UIMove_5P[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_ScoreRank_4P": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_ScoreRank_4P[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_ScoreRank_5P": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_ScoreRank_4P[i] = int.Parse(strSplit[i]); + } + break; + } + + #region CourseSymbol + case "Game_CourseSymbol_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_CourseSymbol_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_CourseSymbol_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_CourseSymbol_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_CourseSymbol_Back_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_CourseSymbol_Back_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_CourseSymbol_Back_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_CourseSymbol_Back_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_CourseSymbol_4P": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_CourseSymbol_4P[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_CourseSymbol_5P": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_CourseSymbol_5P[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_CourseSymbol_Back_4P": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_CourseSymbol_Back_4P[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_CourseSymbol_Back_5P": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_CourseSymbol_Back_5P[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_CourseSymbol_Back_Rect_4P": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 4; i++) { + Game_CourseSymbol_Back_Rect_4P[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_CourseSymbol_Back_Rect_5P": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 4; i++) { + Game_CourseSymbol_Back_Rect_5P[i] = int.Parse(strSplit[i]); + } + break; + } + #endregion + + #region PanelFont + case nameof(Game_MusicName_X): { + Game_MusicName_X = int.Parse(strParam); + break; + } + case nameof(Game_MusicName_Y): { + Game_MusicName_Y = int.Parse(strParam); + break; + } + case nameof(Game_MusicName_FontSize): { + if (int.Parse(strParam) > 0) + Game_MusicName_FontSize = int.Parse(strParam); + break; + } + case nameof(Game_MusicName_MaxWidth): { + Game_MusicName_MaxWidth = int.Parse(strParam); + break; + } + case nameof(Game_MusicName_ReferencePoint): { + Game_MusicName_ReferencePoint = (ReferencePoint)int.Parse(strParam); + break; + } + case nameof(Game_Genre_X): { + Game_Genre_X = int.Parse(strParam); + break; + } + case nameof(Game_Genre_Y): { + Game_Genre_Y = int.Parse(strParam); + break; + } + case "Game_GenreText_Offset": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_GenreText_Offset[i] = int.Parse(strSplit[i]); + } + break; + } + case nameof(Game_GenreText_FontSize): { + Game_GenreText_FontSize = int.Parse(strParam); + break; + } + case nameof(Game_Lyric_X): { + Game_Lyric_X = int.Parse(strParam); + break; + } + case nameof(Game_Lyric_Y): { + Game_Lyric_Y = int.Parse(strParam); + break; + } + case nameof(Game_Lyric_FontName): { + strParam = strParam.Replace('/', System.IO.Path.DirectorySeparatorChar); + strParam = strParam.Replace('\\', System.IO.Path.DirectorySeparatorChar); + if (HPrivateFastFont.FontExists(strParam)) Game_Lyric_FontName = strParam; + strParam = Path(strParam); + if (HPrivateFastFont.FontExists(strParam)) Game_Lyric_FontName = strParam; + break; + } + case nameof(Game_Lyric_FontSize): { + if (int.Parse(strParam) > 0) + Game_Lyric_FontSize = int.Parse(strParam); + break; + } + case nameof(Game_Lyric_VTTRubyOffset): { + Game_Lyric_VTTRubyOffset = int.Parse(strParam); + break; + } + case nameof(Game_Lyric_VTTForeColor): { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 8; i++) { + Game_Lyric_VTTForeColor[i] = ColorTranslator.FromHtml(strSplit[i]); + } + break; + } + case nameof(Game_Lyric_VTTBackColor): { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 8; i++) { + Game_Lyric_VTTBackColor[i] = ColorTranslator.FromHtml(strSplit[i]); + } + break; + } + case nameof(Game_Lyric_ReferencePoint): { + Game_Lyric_ReferencePoint = (ReferencePoint)int.Parse(strParam); + break; + } + + case nameof(Game_MusicName_ForeColor): { + Game_MusicName_ForeColor = ColorTranslator.FromHtml(strParam); + break; + } + case nameof(Game_StageText_ForeColor): { + Game_StageText_ForeColor = ColorTranslator.FromHtml(strParam); + break; + } + case nameof(Game_Lyric_ForeColor): { + Game_Lyric_ForeColor = ColorTranslator.FromHtml(strParam); + break; + } + case nameof(Game_MusicName_BackColor): { + Game_MusicName_BackColor = ColorTranslator.FromHtml(strParam); + break; + } + case nameof(Game_StageText_BackColor): { + Game_StageText_BackColor = ColorTranslator.FromHtml(strParam); + break; + } + case nameof(Game_Lyric_BackColor): { + Game_Lyric_BackColor = ColorTranslator.FromHtml(strParam); + break; + } + case "Game_Judge_Meter": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Judge_Meter[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Judge_Meter_Perfect": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Judge_Meter_Perfect[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Judge_Meter_Good": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Judge_Meter_Good[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Judge_Meter_Miss": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Judge_Meter_Miss[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Judge_Meter_Roll": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Judge_Meter_Roll[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Judge_Meter_HitRate": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Judge_Meter_HitRate[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Judge_Meter_PerfectRate": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Judge_Meter_PerfectRate[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Judge_Meter_GoodRate": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Judge_Meter_GoodRate[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Judge_Meter_MissRate": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Judge_Meter_MissRate[i] = int.Parse(strSplit[i]); + } + break; + } + #endregion + + // Chara read + #region Chara + case "Game_Chara_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Chara_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Chara_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Chara_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Chara_Balloon_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Chara_Balloon_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Chara_Balloon_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Chara_Balloon_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case nameof(Game_Chara_Balloon_Timer): { + if (int.Parse(strParam) > 0) + Game_Chara_Balloon_Timer = int.Parse(strParam); + break; + } + case nameof(Game_Chara_Balloon_Delay): { + if (int.Parse(strParam) > 0) + Game_Chara_Balloon_Delay = int.Parse(strParam); + break; + } + case nameof(Game_Chara_Balloon_FadeOut): { + if (int.Parse(strParam) > 0) + Game_Chara_Balloon_FadeOut = int.Parse(strParam); + break; + } + // パターン数の設定はTextureLoader.csで反映されます。 + case "Game_Chara_Motion_Normal": { + Game_Chara_Motion_Normal = strParam; + break; + } + case "Game_Chara_Motion_Clear": { + Game_Chara_Motion_Clear = strParam; + break; + } + case "Game_Chara_Motion_GoGo": { + Game_Chara_Motion_GoGo = strParam; + break; + } + case "Game_Chara_Beat_Normal": { + ParseInt32(value => Game_Chara_Beat_Normal = value); + break; + } + case "Game_Chara_Beat_Clear": { + ParseInt32(value => Game_Chara_Beat_Clear = value); + break; + } + case "Game_Chara_Beat_GoGo": { + ParseInt32(value => Game_Chara_Beat_GoGo = value); + break; + } + #endregion + + #region Mob + case "Game_Mob_Beat": { + ParseInt32(value => Game_Mob_Beat = value); + break; + } + case "Game_Mob_Ptn_Beat": { + ParseInt32(value => Game_Mob_Ptn_Beat = value); + break; + } + #endregion + + #region Score + case "Game_Score_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + this.Game_Score_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Score_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + this.Game_Score_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Score_Add_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + this.Game_Score_Add_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Score_Add_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + this.Game_Score_Add_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Score_AddBonus_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + this.Game_Score_AddBonus_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Score_AddBonus_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + this.Game_Score_AddBonus_Y[i] = int.Parse(strSplit[i]); + } + break; + } + + case "Game_Score_Padding": { + ParseInt32(value => Game_Score_Padding = value); + break; + } + case "Game_Score_Size": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Score_Size[i] = int.Parse(strSplit[i]); + } + break; + } + + + case "Game_Score_4P": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Score_4P[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Score_5P": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Score_5P[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Score_Add_4P": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Score_Add_4P[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Score_Add_5P": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Score_Add_5P[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Score_AddBonus_4P": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Score_AddBonus_4P[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Score_AddBonus_5P": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Score_AddBonus_5P[i] = int.Parse(strSplit[i]); + } + break; + } + + #endregion + + #region Taiko + case "Game_Taiko_Background_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Taiko_Background_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Taiko_Background_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Taiko_Background_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Taiko_ModIcons_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Taiko_ModIcons_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Taiko_ModIcons_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Taiko_ModIcons_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Taiko_NamePlate_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Taiko_NamePlate_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Taiko_NamePlate_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Taiko_NamePlate_Y[i] = int.Parse(strSplit[i]); + } + break; + } + + case "Game_Taiko_PlayerNumber_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Taiko_PlayerNumber_X[i] = int.Parse(strSplit[i]); + } + break; + } + + case "Game_Taiko_PlayerNumber_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Taiko_PlayerNumber_Y[i] = int.Parse(strSplit[i]); + } + break; + } + + case "Game_Taiko_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Taiko_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Taiko_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Taiko_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Taiko_Combo_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Taiko_Combo_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Taiko_Combo_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Taiko_Combo_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Taiko_Combo_Ex_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Taiko_Combo_Ex_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Taiko_Combo_Ex_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Taiko_Combo_Ex_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Taiko_Combo_Ex4_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Taiko_Combo_Ex4_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Taiko_Combo_Ex4_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Taiko_Combo_Ex4_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Taiko_Combo_Padding": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 3; i++) { + Game_Taiko_Combo_Padding[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Taiko_Combo_Size": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Taiko_Combo_Size[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Taiko_Combo_Size_Ex": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Taiko_Combo_Size_Ex[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Taiko_Combo_Scale": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 3; i++) { + Game_Taiko_Combo_Scale[i] = float.Parse(strSplit[i]); + } + break; + } + case "Game_Taiko_Combo_Text_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Taiko_Combo_Text_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Taiko_Combo_Text_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Taiko_Combo_Text_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Taiko_Combo_Text_Size": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Taiko_Combo_Text_Size[i] = int.Parse(strSplit[i]); + } + break; + } + case nameof(Game_Taiko_Combo_Ex_IsJumping): { + Game_Taiko_Combo_Ex_IsJumping = CConversion.bONorOFF(strParam[0]); + break; + } + case "Game_Taiko_LevelChange_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Taiko_LevelChange_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Taiko_LevelChange_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Taiko_LevelChange_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Taiko_Frame_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Taiko_Frame_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Taiko_Frame_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Taiko_Frame_Y[i] = int.Parse(strSplit[i]); + } + break; + } + + + case "Game_Taiko_Background_4P": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Taiko_Background_4P[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Taiko_Background_5P": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Taiko_Background_5P[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Taiko_ModIcons_4P": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Taiko_ModIcons_4P[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Taiko_ModIcons_5P": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Taiko_ModIcons_5P[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Taiko_NamePlate_4P": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Taiko_NamePlate_4P[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Taiko_NamePlate_5P": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Taiko_NamePlate_5P[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Taiko_PlayerNumber_4P": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Taiko_PlayerNumber_4P[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Taiko_PlayerNumber_5P": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Taiko_PlayerNumber_5P[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Taiko_4P": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Taiko_4P[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Taiko_5P": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Taiko_5P[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Taiko_Combo_4P": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Taiko_Combo_4P[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Taiko_Combo_5P": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Taiko_Combo_5P[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Taiko_Combo_Ex_4P": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Taiko_Combo_Ex_4P[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Taiko_Combo_Ex_5P": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Taiko_Combo_Ex_5P[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Taiko_Combo_Ex4_4P": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Taiko_Combo_Ex4_4P[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Taiko_Combo_Ex4_5P": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Taiko_Combo_Ex4_5P[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Taiko_Combo_Text_4P": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Taiko_Combo_Text_4P[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Taiko_Combo_Text_5P": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Taiko_Combo_Text_5P[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Taiko_Frame_4P": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Taiko_Frame_4P[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Taiko_Frame_5P": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Taiko_Frame_5P[i] = int.Parse(strSplit[i]); + } + break; + } + #endregion + + #region Gauge + case "Game_Gauge_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Gauge_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Gauge_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Gauge_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Gauge_X_AI": { + Game_Gauge_X_AI = int.Parse(strParam); + break; + } + case "Game_Gauge_Y_AI": { + Game_Gauge_Y_AI = int.Parse(strParam); + break; + } + case "Game_Gauge_Rect": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 4; i++) { + Game_Gauge_Rect[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Gauge_ClearText_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Gauge_ClearText_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Gauge_ClearText_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Gauge_ClearText_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Gauge_ClearText_X_AI": { + Game_Gauge_ClearText_X_AI = int.Parse(strParam); + break; + } + case "Game_Gauge_ClearText_Y_AI": { + Game_Gauge_ClearText_Y_AI = int.Parse(strParam); + break; + } + case "Game_Gauge_ClearText_Rect": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 4; i++) { + Game_Gauge_ClearText_Rect[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Gauge_ClearText_Clear_Rect": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 4; i++) { + Game_Gauge_ClearText_Clear_Rect[i] = int.Parse(strSplit[i]); + } + break; + } + case "Gauge_Soul_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Gauge_Soul_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "Gauge_Soul_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Gauge_Soul_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "Gauge_Soul_X_AI": { + Gauge_Soul_X_AI = int.Parse(strParam); + break; + } + case "Gauge_Soul_Y_AI": { + Gauge_Soul_Y_AI = int.Parse(strParam); + break; + } + case "Gauge_Soul_X_Tower": { + Gauge_Soul_X_Tower = int.Parse(strParam); + break; + } + case "Gauge_Soul_Y_Tower": { + Gauge_Soul_Y_Tower = int.Parse(strParam); + break; + } + case "Gauge_Soul_Fire_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Gauge_Soul_Fire_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "Gauge_Soul_Fire_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Gauge_Soul_Fire_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "Gauge_Soul_Fire_X_AI": { + Gauge_Soul_Fire_X_AI = int.Parse(strParam); + break; + } + case "Gauge_Soul_Fire_Y_AI": { + Gauge_Soul_Fire_Y_AI = int.Parse(strParam); + break; + } + case "Gauge_Soul_Fire_X_Tower": { + Gauge_Soul_Fire_X_Tower = int.Parse(strParam); + break; + } + case "Gauge_Soul_Fire_Y_Tower": { + Gauge_Soul_Fire_Y_Tower = int.Parse(strParam); + break; + } + case "Game_Gauge_Rainbow_Timer": { + if (int.Parse(strParam) != 0) { + Game_Gauge_Rainbow_Timer = int.Parse(strParam); + } + break; + } + case "Game_Tower_Floor_Number": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Tower_Floor_Number[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Tower_Life_Number": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Tower_Life_Number[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Tower_Font_TouTatsuKaiSuu": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Tower_Font_TouTatsuKaiSuu[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Tower_Font_Kai": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Tower_Font_Kai[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Tower_Font_TowerText": { + Game_Tower_Font_TowerText = int.Parse(strParam); + break; + } + + + case "Game_Gauge_4P": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Gauge_4P[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Gauge_5P": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Gauge_5P[i] = int.Parse(strSplit[i]); + } + break; + } + case "Gauge_Soul_4P": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Gauge_Soul_4P[i] = int.Parse(strSplit[i]); + } + break; + } + case "Gauge_Soul_5P": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Gauge_Soul_5P[i] = int.Parse(strSplit[i]); + } + break; + } + case "Gauge_Soul_Fire_4P": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Gauge_Soul_Fire_4P[i] = int.Parse(strSplit[i]); + } + break; + } + case "Gauge_Soul_Fire_5P": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Gauge_Soul_Fire_5P[i] = int.Parse(strSplit[i]); + } + break; + } + #endregion + + #region Balloon + case "Game_Balloon_Combo_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Balloon_Combo_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Balloon_Combo_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Balloon_Combo_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Balloon_Combo_Number_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Balloon_Combo_Number_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Balloon_Combo_Number_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Balloon_Combo_Number_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Balloon_Combo_Number_Ex_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Balloon_Combo_Number_Ex_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Balloon_Combo_Number_Ex_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Balloon_Combo_Number_Ex_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Balloon_Combo_Number_Size": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Balloon_Combo_Number_Size[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Balloon_Combo_Number_Interval": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Balloon_Combo_Number_Interval[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Balloon_Combo_Text_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Balloon_Combo_Text_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Balloon_Combo_Text_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Balloon_Combo_Text_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Balloon_Combo_Text_Ex_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Balloon_Combo_Text_Ex_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Balloon_Combo_Text_Ex_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Balloon_Combo_Text_Ex_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Balloon_Combo_Text_Rect": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 4; i++) { + Game_Balloon_Combo_Text_Rect[i] = int.Parse(strSplit[i]); + } + break; + } + + + case "Game_Balloon_Balloon_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + this.Game_Balloon_Balloon_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Balloon_Balloon_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + this.Game_Balloon_Balloon_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Balloon_Balloon_Frame_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + this.Game_Balloon_Balloon_Frame_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Balloon_Balloon_Frame_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + this.Game_Balloon_Balloon_Frame_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Balloon_Balloon_Number_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + this.Game_Balloon_Balloon_Number_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Balloon_Balloon_Number_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + this.Game_Balloon_Balloon_Number_Y[i] = int.Parse(strSplit[i]); + } + break; + } + + case "Game_Balloon_Roll_Frame_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Balloon_Roll_Frame_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Balloon_Roll_Frame_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Balloon_Roll_Frame_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Balloon_Roll_Number_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Balloon_Roll_Number_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Balloon_Roll_Number_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Balloon_Roll_Number_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Balloon_Number_Size": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Balloon_Number_Size[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Balloon_Number_Interval": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Balloon_Number_Interval[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Balloon_Roll_Number_Scale": { + ParseInt32(value => Game_Balloon_Roll_Number_Scale = value); + break; + } + case "Game_Balloon_Balloon_Number_Scale": { + ParseInt32(value => Game_Balloon_Balloon_Number_Scale = value); + break; + } + case "Game_Kusudama_Number_X": { + ParseInt32(value => Game_Kusudama_Number_X = value); + break; + } + case "Game_Kusudama_Number_Y": { + ParseInt32(value => Game_Kusudama_Number_Y = value); + break; + } + + + case "Game_Balloon_Balloon_4P": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Balloon_Balloon_4P[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Balloon_Balloon_5P": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Balloon_Balloon_5P[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Balloon_Balloon_Frame_4P": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Balloon_Balloon_Frame_4P[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Balloon_Balloon_Frame_5P": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Balloon_Balloon_Frame_5P[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Balloon_Balloon_Number_4P": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Balloon_Balloon_Number_4P[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Balloon_Balloon_Number_5P": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Balloon_Balloon_Number_5P[i] = int.Parse(strSplit[i]); + } + break; + } + + #endregion + + #region Effects + case nameof(Game_Effect_Roll_StartPoint_X): { + Game_Effect_Roll_StartPoint_X = strParam.Split(',').Select(int.Parse).ToArray(); + break; + } + case nameof(Game_Effect_Roll_StartPoint_Y): { + Game_Effect_Roll_StartPoint_Y = strParam.Split(',').Select(int.Parse).ToArray(); + break; + } + case nameof(Game_Effect_Roll_StartPoint_1P_X): { + Game_Effect_Roll_StartPoint_1P_X = strParam.Split(',').Select(int.Parse).ToArray(); + break; + } + case nameof(Game_Effect_Roll_StartPoint_1P_Y): { + Game_Effect_Roll_StartPoint_1P_Y = strParam.Split(',').Select(int.Parse).ToArray(); + break; + } + case nameof(Game_Effect_Roll_StartPoint_2P_X): { + Game_Effect_Roll_StartPoint_2P_X = strParam.Split(',').Select(int.Parse).ToArray(); + break; + } + case nameof(Game_Effect_Roll_StartPoint_2P_Y): { + Game_Effect_Roll_StartPoint_2P_Y = strParam.Split(',').Select(int.Parse).ToArray(); + break; + } + case nameof(Game_Effect_Roll_Speed_X): { + Game_Effect_Roll_Speed_X = strParam.Split(',').Select(float.Parse).ToArray(); + break; + } + case nameof(Game_Effect_Roll_Speed_Y): { + Game_Effect_Roll_Speed_Y = strParam.Split(',').Select(float.Parse).ToArray(); + break; + } + case nameof(Game_Effect_Roll_Speed_1P_X): { + Game_Effect_Roll_Speed_1P_X = strParam.Split(',').Select(float.Parse).ToArray(); + break; + } + case nameof(Game_Effect_Roll_Speed_1P_Y): { + Game_Effect_Roll_Speed_1P_Y = strParam.Split(',').Select(float.Parse).ToArray(); + break; + } + case nameof(Game_Effect_Roll_Speed_2P_X): { + Game_Effect_Roll_Speed_2P_X = strParam.Split(',').Select(float.Parse).ToArray(); + break; + } + case nameof(Game_Effect_Roll_Speed_2P_Y): { + Game_Effect_Roll_Speed_2P_Y = strParam.Split(',').Select(float.Parse).ToArray(); + break; + } + case nameof(Game_Effect_NotesFlash): { + Game_Effect_NotesFlash = strParam.Split(',').Select(int.Parse).ToArray(); + break; + } + case nameof(Game_Effect_NotesFlash_Timer): { + Game_Effect_NotesFlash_Timer = int.Parse(strParam); + break; + } + case nameof(Game_Effect_GoGoSplash): { + Game_Effect_GoGoSplash = strParam.Split(',').Select(int.Parse).ToArray(); + break; + } + case nameof(Game_Effect_GoGoSplash_X): { + Game_Effect_GoGoSplash_X = strParam.Split(',').Select(int.Parse).ToArray(); + break; + } + case nameof(Game_Effect_GoGoSplash_Y): { + Game_Effect_GoGoSplash_Y = strParam.Split(',').Select(int.Parse).ToArray(); + break; + } + case nameof(Game_Effect_GoGoSplash_Rotate): { + Game_Effect_GoGoSplash_Rotate = CConversion.bONorOFF(strParam[0]); + break; + } + case nameof(Game_Effect_GoGoSplash_Timer): { + Game_Effect_GoGoSplash_Timer = int.Parse(strParam); + break; + } + case nameof(Game_Effect_FlyingNotes_StartPoint_X): { + Game_Effect_FlyingNotes_StartPoint_X = strParam.Split(',').Select(int.Parse).ToArray(); + break; + } + case nameof(Game_Effect_FlyingNotes_StartPoint_Y): { + Game_Effect_FlyingNotes_StartPoint_Y = strParam.Split(',').Select(int.Parse).ToArray(); + break; + } + case nameof(Game_Effect_FlyingNotes_EndPoint_X): { + Game_Effect_FlyingNotes_EndPoint_X = strParam.Split(',').Select(int.Parse).ToArray(); + break; + } + case nameof(Game_Effect_FlyingNotes_EndPoint_Y): { + Game_Effect_FlyingNotes_EndPoint_Y = strParam.Split(',').Select(int.Parse).ToArray(); + break; + } + case nameof(Game_Effect_FlyingNotes_EndPoint_X_AI): { + Game_Effect_FlyingNotes_EndPoint_X_AI = strParam.Split(',').Select(int.Parse).ToArray(); + break; + } + case nameof(Game_Effect_FlyingNotes_EndPoint_Y_AI): { + Game_Effect_FlyingNotes_EndPoint_Y_AI = strParam.Split(',').Select(int.Parse).ToArray(); + break; + } + case nameof(Game_Effect_FlyingNotes_Sine): { + Game_Effect_FlyingNotes_Sine = int.Parse(strParam); + break; + } + case nameof(Game_Effect_FlyingNotes_IsUsingEasing): { + Game_Effect_FlyingNotes_IsUsingEasing = CConversion.bONorOFF(strParam[0]); + break; + } + case nameof(Game_Effect_FlyingNotes_Timer): { + Game_Effect_FlyingNotes_Timer = int.Parse(strParam); + break; + } + case nameof(Game_Effect_FireWorks): { + Game_Effect_FireWorks = strParam.Split(',').Select(int.Parse).ToArray(); + break; + } + case nameof(Game_Effect_FireWorks_Timer): { + Game_Effect_FireWorks_Timer = int.Parse(strParam); + break; + } + case "Game_Effect_Rainbow_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + this.Game_Effect_Rainbow_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Effect_Rainbow_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + this.Game_Effect_Rainbow_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case nameof(Game_Effect_Rainbow_Timer): { + Game_Effect_Rainbow_Timer = int.Parse(strParam); + break; + } + case "Game_Effects_Hit_Explosion_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Effects_Hit_Explosion_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Effects_Hit_Explosion_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Effects_Hit_Explosion_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case nameof(Game_Effect_HitExplosion_AddBlend): { + Game_Effect_HitExplosion_AddBlend = CConversion.bONorOFF(strParam[0]); + break; + } + case nameof(Game_Effect_HitExplosionBig_AddBlend): { + Game_Effect_HitExplosionBig_AddBlend = CConversion.bONorOFF(strParam[0]); + break; + } + case "Game_Effect_Fire_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Effect_Fire_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Effect_Fire_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Effect_Fire_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case nameof(Game_Effect_FireWorks_AddBlend): { + Game_Effect_FireWorks_AddBlend = CConversion.bONorOFF(strParam[0]); + break; + } + case nameof(Game_Effect_Fire_AddBlend): { + Game_Effect_Fire_AddBlend = CConversion.bONorOFF(strParam[0]); + break; + } + case nameof(Game_Effect_GoGoSplash_AddBlend): { + Game_Effect_GoGoSplash_AddBlend = CConversion.bONorOFF(strParam[0]); + break; + } + case nameof(Game_Effect_FireWorks_Timing): { + Game_Effect_FireWorks_Timing = int.Parse(strParam); + break; + } + + + case "Game_Effects_Hit_Explosion_4P": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Effects_Hit_Explosion_4P[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Effects_Hit_Explosion_5P": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Effects_Hit_Explosion_5P[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Effect_Fire_4P": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Effect_Fire_4P[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Effect_Fire_5P": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Effect_Fire_5P[i] = int.Parse(strSplit[i]); + } + break; + } + + #endregion + + #region Lane + + case "Game_Lane_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Lane_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Lane_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Lane_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Lane_Sub_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Lane_Sub_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Lane_Sub_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Lane_Sub_Y[i] = int.Parse(strSplit[i]); + } + break; + } + + case "Game_Lane_4P": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Lane_4P[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Lane_5P": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Lane_5P[i] = int.Parse(strSplit[i]); + } + break; + } + #endregion + + #region Runner + #endregion + + #region Dan_C + case nameof(Game_DanC_Title_ForeColor): { + Game_DanC_Title_ForeColor = ColorTranslator.FromHtml(strParam); + break; + } + case nameof(Game_DanC_Title_BackColor): { + Game_DanC_Title_BackColor = ColorTranslator.FromHtml(strParam); + break; + } + case nameof(Game_DanC_SubTitle_ForeColor): { + Game_DanC_SubTitle_ForeColor = ColorTranslator.FromHtml(strParam); + break; + } + case nameof(Game_DanC_SubTitle_BackColor): { + Game_DanC_SubTitle_BackColor = ColorTranslator.FromHtml(strParam); + break; + } + case nameof(Game_DanC_X): { + Game_DanC_X = strParam.Split(',').Select(int.Parse).ToArray(); + break; + } + case nameof(Game_DanC_Y): { + Game_DanC_Y = strParam.Split(',').Select(int.Parse).ToArray(); + break; + } + case nameof(Game_DanC_Base_Offset_X): { + Game_DanC_Base_Offset_X = strParam.Split(',').Select(int.Parse).ToArray(); + break; + } + case nameof(Game_DanC_Base_Offset_Y): { + Game_DanC_Base_Offset_Y = strParam.Split(',').Select(int.Parse).ToArray(); + break; + } + case nameof(Game_DanC_SmallBase_Offset_X): { + Game_DanC_SmallBase_Offset_X = strParam.Split(',').Select(int.Parse).ToArray(); + break; + } + case nameof(Game_DanC_SmallBase_Offset_Y): { + Game_DanC_SmallBase_Offset_Y = strParam.Split(',').Select(int.Parse).ToArray(); + break; + } + + case nameof(Game_DanC_Size): { + Game_DanC_Size = strParam.Split(',').Select(int.Parse).ToArray(); + break; + } + + case nameof(Game_DanC_Padding): { + ParseInt32(value => Game_DanC_Padding = value); + break; + } + + case nameof(Game_DanC_Offset): { + Game_DanC_Offset = strParam.Split(',').Select(int.Parse).ToArray(); + break; + } + + case nameof(Game_DanC_Number_Size): { + Game_DanC_Number_Size = strParam.Split(',').Select(int.Parse).ToArray(); + break; + } + + case nameof(Game_DanC_Small_Number_Size): { + Game_DanC_Small_Number_Size = strParam.Split(',').Select(int.Parse).ToArray(); + break; + } + + case nameof(Game_DanC_MiniNumber_Size): { + Game_DanC_MiniNumber_Size = strParam.Split(',').Select(int.Parse).ToArray(); + break; + } + + case nameof(Game_DanC_Number_Padding): { + ParseInt32(value => Game_DanC_Number_Padding = value); + break; + } + + case nameof(Game_DanC_Number_Small_Scale): { + Game_DanC_Number_Small_Scale = float.Parse(strParam); + break; + } + + case nameof(Game_DanC_Number_Small_Padding): { + ParseInt32(value => Game_DanC_Number_Small_Padding = value); + break; + } + + case nameof(Game_DanC_Number_XY): { + Game_DanC_Number_XY = strParam.Split(',').Select(int.Parse).ToArray(); + break; + } + case nameof(Game_DanC_Number_Small_Number_Offset): { + Game_DanC_Number_Small_Number_Offset = strParam.Split(',').Select(int.Parse).ToArray(); + break; + } + case nameof(Game_DanC_ExamType_Size): { + Game_DanC_ExamType_Size = strParam.Split(',').Select(int.Parse).ToArray(); + break; + } + case nameof(Game_DanC_ExamRange_Size): { + Game_DanC_ExamRange_Size = strParam.Split(',').Select(int.Parse).ToArray(); + break; + } + + case nameof(Game_DanC_ExamRange_Padding): { + ParseInt32(value => Game_DanC_ExamRange_Padding = value); + break; + } + + case nameof(Game_DanC_Percent_Hit_Score_Padding): { + Game_DanC_Percent_Hit_Score_Padding = strParam.Split(',').Select(int.Parse).ToArray(); + break; + } + case nameof(Game_DanC_ExamUnit_Size): { + Game_DanC_ExamUnit_Size = strParam.Split(',').Select(int.Parse).ToArray(); + break; + } + case nameof(Game_DanC_Exam_Offset): { + Game_DanC_Exam_Offset = strParam.Split(',').Select(int.Parse).ToArray(); + break; + } + case nameof(Game_DanC_Dan_Plate): { + Game_DanC_Dan_Plate = strParam.Split(',').Select(int.Parse).ToArray(); + break; + } + case nameof(Game_DanC_DanIcon_Offset): { + Game_DanC_DanIcon_Offset = strParam.Split(',').Select(int.Parse).ToArray(); + break; + } + case nameof(Game_DanC_DanIcon_Offset_Mini): { + Game_DanC_DanIcon_Offset_Mini = strParam.Split(',').Select(int.Parse).ToArray(); + break; + } + case nameof(Game_DanC_Title_X): { + Game_DanC_Title_X = strParam.Split(',').Select(int.Parse).ToArray(); + break; + } + case nameof(Game_DanC_Title_Y): { + Game_DanC_Title_Y = strParam.Split(',').Select(int.Parse).ToArray(); + break; + } + case nameof(Game_DanC_SubTitle): { + Game_DanC_SubTitle = strParam.Split(',').Select(int.Parse).ToArray(); + break; + } + + case nameof(Game_DanC_Title_Size): { + ParseInt32(value => Game_DanC_Title_Size = value); + break; + } + case nameof(Game_DanC_SubTitle_Size): { + ParseInt32(value => Game_DanC_SubTitle_Size = value); + break; + } + case nameof(Game_DanC_ExamFont_Size): { + ParseInt32(value => Game_DanC_ExamFont_Size = value); + break; + } + case nameof(Game_DanC_Title_MaxWidth): { + ParseInt32(value => Game_DanC_Title_MaxWidth = value); + break; + } + case nameof(Game_DanC_SubTitle_MaxWidth): { + ParseInt32(value => Game_DanC_SubTitle_MaxWidth = value); + break; + } + + #endregion + + #region PuchiChara + case nameof(Game_PuchiChara_X): { + Game_PuchiChara_X = strParam.Split(',').Select(int.Parse).ToArray(); + break; + } + case nameof(Game_PuchiChara_Y): { + Game_PuchiChara_Y = strParam.Split(',').Select(int.Parse).ToArray(); + break; + } + case nameof(Game_PuchiChara_4P): { + Game_PuchiChara_4P = strParam.Split(',').Select(int.Parse).ToArray(); + break; + } + case nameof(Game_PuchiChara_5P): { + Game_PuchiChara_5P = strParam.Split(',').Select(int.Parse).ToArray(); + break; + } + case nameof(Game_PuchiChara_BalloonX): { + Game_PuchiChara_BalloonX = strParam.Split(',').Select(int.Parse).ToArray(); + break; + } + case nameof(Game_PuchiChara_BalloonY): { + Game_PuchiChara_BalloonY = strParam.Split(',').Select(int.Parse).ToArray(); + break; + } + case nameof(Game_PuchiChara_KusudamaX): { + Game_PuchiChara_KusudamaX = strParam.Split(',').Select(int.Parse).ToArray(); + break; + } + case nameof(Game_PuchiChara_KusudamaY): { + Game_PuchiChara_KusudamaY = strParam.Split(',').Select(int.Parse).ToArray(); + break; + } + case nameof(Game_PuchiChara_Scale): { + Game_PuchiChara_Scale = strParam.Split(',').Select(float.Parse).ToArray(); + break; + } + case nameof(Game_PuchiChara): { + Game_PuchiChara = strParam.Split(',').Select(int.Parse).ToArray(); + break; + } + case nameof(Game_PuchiChara_Sine): { + ParseInt32(value => Game_PuchiChara_Sine = value); + break; + } + case nameof(Game_PuchiChara_Timer): { + ParseInt32(value => Game_PuchiChara_Timer = value); + break; + } + case nameof(Game_PuchiChara_SineTimer): { + Game_PuchiChara_SineTimer = double.Parse(strParam); + break; + } + #endregion + + #region Training + case "Game_Training_DownBG": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Training_DownBG[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Training_BigTaiko": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Training_BigTaiko[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Training_Speed_Measure": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Training_Speed_Measure[i] = int.Parse(strSplit[i]); + } + break; + } + case nameof(Game_Training_ScrollTime): { + Game_Training_ScrollTime = int.Parse(strParam); + break; + } + case nameof(Game_Training_ProgressBar_XY): { + Game_Training_ProgressBar_XY = strParam.Split(',').Select(int.Parse).ToArray(); + break; + } + case nameof(Game_Training_GoGoPoint_Y): { + Game_Training_GoGoPoint_Y = int.Parse(strParam); + break; + } + case nameof(Game_Training_JumpPoint_Y): { + Game_Training_JumpPoint_Y = int.Parse(strParam); + break; + } + case nameof(Game_Training_MaxMeasureCount_XY): { + Game_Training_MaxMeasureCount_XY = strParam.Split(',').Select(int.Parse).ToArray(); + break; + } + case nameof(Game_Training_CurrentMeasureCount_XY): { + Game_Training_CurrentMeasureCount_XY = strParam.Split(',').Select(int.Parse).ToArray(); + break; + } + case nameof(Game_Training_SpeedDisplay_XY): { + Game_Training_SpeedDisplay_XY = strParam.Split(',').Select(int.Parse).ToArray(); + break; + } + case nameof(Game_Training_SmallNumber_Width): { + Game_Training_SmallNumber_Width = int.Parse(strParam); + break; + } + case nameof(Game_Training_BigNumber_Width): { + Game_Training_BigNumber_Width = int.Parse(strParam); + break; + } + #endregion + + #region Tower + case "Game_Tower_Sky_Gradient": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Tower_Sky_Gradient[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Tower_Sky_Gradient_Size": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Tower_Sky_Gradient_Size[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Tower_Floors_Body": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Tower_Floors_Body[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Tower_Floors_Deco": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Tower_Floors_Deco[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Tower_Floors_Move": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Tower_Floors_Move[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Tower_Don": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Tower_Don[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Tower_Don_Move": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Tower_Don_Move[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_Tower_Miss": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_Tower_Miss[i] = int.Parse(strSplit[i]); + } + break; + } + #endregion + + #region AIBattle + case "Game_AIBattle_CharaMove": { + Game_AIBattle_CharaMove = int.Parse(strParam); + break; + } + case "Game_AIBattle_SectionTime_Panel": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_AIBattle_SectionTime_Panel[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_AIBattle_SectionTime_Bar": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_AIBattle_SectionTime_Bar[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_AIBattle_Batch_Base": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_AIBattle_Batch_Base[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_AIBattle_Batch": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_AIBattle_Batch[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_AIBattle_Batch_Size": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_AIBattle_Batch_Size[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_AIBattle_Batch_Anime": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_AIBattle_Batch_Anime[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_AIBattle_Batch_Anime_Size": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_AIBattle_Batch_Anime_Size[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_AIBattle_Batch_Move": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_AIBattle_Batch_Move[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_AIBattle_Judge_Meter_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_AIBattle_Judge_Meter_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_AIBattle_Judge_Meter_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_AIBattle_Judge_Meter_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_AIBattle_Judge_Number_Perfect_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_AIBattle_Judge_Number_Perfect_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_AIBattle_Judge_Number_Perfect_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_AIBattle_Judge_Number_Perfect_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_AIBattle_Judge_Number_Good_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_AIBattle_Judge_Number_Good_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_AIBattle_Judge_Number_Good_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_AIBattle_Judge_Number_Good_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_AIBattle_Judge_Number_Miss_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_AIBattle_Judge_Number_Miss_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_AIBattle_Judge_Number_Miss_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_AIBattle_Judge_Number_Miss_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_AIBattle_Judge_Number_Roll_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_AIBattle_Judge_Number_Roll_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_AIBattle_Judge_Number_Roll_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_AIBattle_Judge_Number_Roll_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "Game_AIBattle_Judge_Number_Interval": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Game_AIBattle_Judge_Number_Interval[i] = int.Parse(strSplit[i]); + } + break; + } + #endregion + + #endregion + + #region Result + case "Result_Use1PUI": { + Result_Use1PUI = CConversion.bONorOFF(strParam[0]); + break; + } + case nameof(Result_Cloud_Count): { + Result_Cloud_Count = int.Parse(strParam); + break; + } + case "Result_Cloud_X": { + Result_Cloud_X = new int[Result_Cloud_Count]; + string[] strSplit = strParam.Split(','); + for (int i = 0; i < Result_Cloud_Count; i++) { + Result_Cloud_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_Result_Cloud_Y": { + Result_Cloud_Y = new int[Result_Cloud_Count]; + string[] strSplit = strParam.Split(','); + for (int i = 0; i < Result_Cloud_Count; i++) { + Result_Cloud_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_Result_Cloud_MaxMove": { + Result_Cloud_MaxMove = new int[Result_Cloud_Count]; + string[] strSplit = strParam.Split(','); + for (int i = 0; i < Result_Cloud_Count; i++) { + Result_Cloud_MaxMove[i] = int.Parse(strSplit[i]); + } + break; + } + case nameof(Result_Shine_Count): { + Result_Shine_Count = int.Parse(strParam); + break; + } + case "Result_Shine_1P_X": { + Result_Shine_X[0] = new int[Result_Shine_Count]; + string[] strSplit = strParam.Split(','); + for (int i = 0; i < Result_Shine_Count; i++) { + Result_Shine_X[0][i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_Shine_2P_X": { + Result_Shine_X[1] = new int[Result_Shine_Count]; + string[] strSplit = strParam.Split(','); + for (int i = 0; i < Result_Shine_Count; i++) { + Result_Shine_X[1][i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_Shine_1P_Y": { + Result_Shine_Y[0] = new int[Result_Shine_Count]; + string[] strSplit = strParam.Split(','); + for (int i = 0; i < Result_Shine_Count; i++) { + Result_Shine_Y[0][i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_Shine_2P_Y": { + Result_Shine_Y[1] = new int[Result_Shine_Count]; + string[] strSplit = strParam.Split(','); + for (int i = 0; i < Result_Shine_Count; i++) { + Result_Shine_Y[1][i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_Shine_Size": { + Result_Shine_Size = new float[Result_Shine_Count]; + string[] strSplit = strParam.Split(','); + for (int i = 0; i < Result_Cloud_Count; i++) { + Result_Shine_Size[i] = float.Parse(strSplit[i]); + } + break; + } + case "Result_Work_1P_X": { + Result_Work_X[0] = new int[3]; + string[] strSplit = strParam.Split(','); + for (int i = 0; i < Result_Cloud_Count; i++) { + Result_Work_X[0][i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_Work_2P_X": { + Result_Work_X[1] = new int[3]; + string[] strSplit = strParam.Split(','); + for (int i = 0; i < Result_Cloud_Count; i++) { + Result_Work_X[1][i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_Work_1P_Y": { + Result_Work_Y[0] = new int[3]; + string[] strSplit = strParam.Split(','); + for (int i = 0; i < Result_Cloud_Count; i++) { + Result_Work_Y[0][i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_Work_2P_Y": { + Result_Work_Y[1] = new int[3]; + string[] strSplit = strParam.Split(','); + for (int i = 0; i < Result_Cloud_Count; i++) { + Result_Work_Y[1][i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_DifficultyBar_Size": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Result_DifficultyBar_Size[i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_DifficultyBar_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Result_DifficultyBar_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_DifficultyBar_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Result_DifficultyBar_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_Gauge_Base_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Result_Gauge_Base_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_Gauge_Base_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Result_Gauge_Base_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_Gauge_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Result_Gauge_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_Gauge_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Result_Gauge_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_Gauge_Rect": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 4; i++) { + Result_Gauge_Rect[i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_Gauge_Rainbow_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Result_Gauge_Rainbow_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_Gauge_Rainbow_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Result_Gauge_Rainbow_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_Gauge_Rainbow_Interval": { + Result_Gauge_Rainbow_Interval = int.Parse(strParam); + break; + } + case "Result_Gauge_ClearText_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Result_Gauge_ClearText_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_Gauge_ClearText_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Result_Gauge_ClearText_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_Gauge_ClearText_Rect": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 4; i++) { + Result_Gauge_ClearText_Rect[i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_Gauge_ClearText_Clear_Rect": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 4; i++) { + Result_Gauge_ClearText_Clear_Rect[i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_Number_Interval": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Result_Number_Interval[i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_Number_Scale_4P": { + Result_Number_Scale_4P = float.Parse(strParam); + break; + } + case "Result_Number_Scale_5P": { + Result_Number_Scale_5P = float.Parse(strParam); + break; + } + case "Result_Soul_Fire_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Result_Soul_Fire_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_Soul_Fire_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Result_Soul_Fire_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_Soul_Text_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Result_Soul_Text_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_Soul_Text_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Result_Soul_Text_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_Perfect_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Result_Perfect_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_Perfect_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Result_Perfect_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_Good_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Result_Good_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_Good_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Result_Good_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_Miss_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Result_Miss_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_Miss_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Result_Miss_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_Roll_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Result_Roll_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_Roll_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Result_Roll_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_MaxCombo_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Result_MaxCombo_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_MaxCombo_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Result_MaxCombo_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_ADLib_Show": { + Result_ADLib_Show = CConversion.bONorOFF(strParam[0]); + break; + } + case "Result_ADLib_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Result_ADLib_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_ADLib_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Result_ADLib_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_Bomb_Show": { + Result_Bomb_Show = CConversion.bONorOFF(strParam[0]); + break; + } + case "Result_Bomb_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Result_Bomb_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_Bomb_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Result_Bomb_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_Score_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Result_Score_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_Score_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Result_Score_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_Score_Number_Interval": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Result_Score_Number_Interval[i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_Score_Scale_4P": { + Result_Score_Scale_4P = float.Parse(strParam); + break; + } + case "Result_Score_Scale_5P": { + Result_Score_Scale_5P = float.Parse(strParam); + break; + } + case "Result_ScoreRankEffect_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Result_ScoreRankEffect_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_ScoreRankEffect_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Result_ScoreRankEffect_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_CrownEffect_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Result_CrownEffect_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_CrownEffect_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Result_CrownEffect_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_Speech_Bubble_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Result_Speech_Bubble_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_Speech_Bubble_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Result_Speech_Bubble_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_Speech_Bubble_V2_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Result_Speech_Bubble_V2_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_Speech_Bubble_V2_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Result_Speech_Bubble_V2_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_Speech_Bubble_V2_2P_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Result_Speech_Bubble_V2_2P_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_Speech_Bubble_V2_2P_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Result_Speech_Bubble_V2_2P_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case nameof(Result_MusicName_X): { + Result_MusicName_X = int.Parse(strParam); + break; + } + case nameof(Result_MusicName_Y): { + Result_MusicName_Y = int.Parse(strParam); + break; + } + case nameof(Result_MusicName_FontSize): { + if (int.Parse(strParam) > 0) + Result_MusicName_FontSize = int.Parse(strParam); + break; + } + case nameof(Result_MusicName_MaxSize): { + Result_MusicName_MaxSize = int.Parse(strParam); + break; + } + case nameof(Result_MusicName_ReferencePoint): { + Result_MusicName_ReferencePoint = (ReferencePoint)int.Parse(strParam); + break; + } + case nameof(Result_StageText_X): { + Result_StageText_X = int.Parse(strParam); + break; + } + case nameof(Result_StageText_Y): { + Result_StageText_Y = int.Parse(strParam); + break; + } + case nameof(Result_StageText_FontSize): { + if (int.Parse(strParam) > 0) + Result_StageText_FontSize = int.Parse(strParam); + break; + } + case nameof(Result_StageText_ReferencePoint): { + Result_StageText_ReferencePoint = (ReferencePoint)int.Parse(strParam); + break; + } + + case nameof(Result_MusicName_ForeColor): { + Result_MusicName_ForeColor = ColorTranslator.FromHtml(strParam); + break; + } + case nameof(Result_StageText_ForeColor): { + Result_StageText_ForeColor = ColorTranslator.FromHtml(strParam); + break; + } + //case nameof(Result_StageText_ForeColor_Red): + //{ + // Result_StageText_ForeColor_Red = ColorTranslator.FromHtml(strParam); + //} + case nameof(Result_MusicName_BackColor): { + Result_MusicName_BackColor = ColorTranslator.FromHtml(strParam); + break; + } + case nameof(Result_StageText_BackColor): { + Result_StageText_BackColor = ColorTranslator.FromHtml(strParam); + break; + } + //case nameof(Result_StageText_BackColor_Red): + //{ + // Result_StageText_BackColor_Red = ColorTranslator.FromHtml(strParam); + //} + + case "Result_NamePlate_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Result_NamePlate_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_NamePlate_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Result_NamePlate_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_ModIcons_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Result_ModIcons_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_ModIcons_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Result_ModIcons_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_Flower_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Result_Flower_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_Flower_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Result_Flower_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_Flower_Rotate_1P_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 5; i++) { + Result_Flower_Rotate_X[0][i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_Flower_Rotate_2P_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 5; i++) { + Result_Flower_Rotate_X[1][i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_Flower_Rotate_1P_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 5; i++) { + Result_Flower_Rotate_Y[0][i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_Flower_Rotate_2P_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 5; i++) { + Result_Flower_Rotate_Y[1][i] = int.Parse(strSplit[i]); + } + break; + } + case nameof(Result_PlateShine_Count): { + Result_PlateShine_Count = int.Parse(strParam); + break; + } + case "Result_PlateShine_1P_X": { + Result_PlateShine_X[0] = new int[Result_PlateShine_Count]; + string[] strSplit = strParam.Split(','); + for (int i = 0; i < Result_PlateShine_Count; i++) { + Result_PlateShine_X[0][i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_PlateShine_2P_X": { + Result_PlateShine_X[1] = new int[Result_PlateShine_Count]; + string[] strSplit = strParam.Split(','); + for (int i = 0; i < Result_PlateShine_Count; i++) { + Result_PlateShine_X[1][i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_PlateShine_1P_Y": { + Result_PlateShine_Y[0] = new int[Result_PlateShine_Count]; + string[] strSplit = strParam.Split(','); + for (int i = 0; i < Result_PlateShine_Count; i++) { + Result_PlateShine_Y[0][i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_PlateShine_2P_Y": { + Result_PlateShine_Y[1] = new int[Result_PlateShine_Count]; + string[] strSplit = strParam.Split(','); + for (int i = 0; i < Result_PlateShine_Count; i++) { + Result_PlateShine_Y[1][i] = int.Parse(strSplit[i]); + } + break; + } + + case nameof(Result_Dan): { + Result_Dan = strParam.Split(',').Select(int.Parse).ToArray(); + break; + } + case nameof(Result_Dan_XY): { + Result_Dan_XY = strParam.Split(',').Select(int.Parse).ToArray(); + break; + } + case nameof(Result_Dan_Plate_XY): { + Result_Dan_Plate_XY = strParam.Split(',').Select(int.Parse).ToArray(); + break; + } + + + case "Result_UIMove_4P": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 4; i++) { + int moveX = int.Parse(strSplit[0]); + Result_UIMove_4P_X[i] = moveX * i; + + int moveY = int.Parse(strSplit[1]); + Result_UIMove_4P_Y[i] = moveY * i; + } + break; + } + case "Result_UIMove_5P": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 5; i++) { + int moveX = int.Parse(strSplit[0]); + Result_UIMove_5P_X[i] = moveX * i; + + int moveY = int.Parse(strSplit[1]); + Result_UIMove_5P_Y[i] = moveY * i; + } + break; + } + case "Result_UIMove_4P_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 4; i++) { + Result_UIMove_4P_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_UIMove_4P_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 4; i++) { + Result_UIMove_4P_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_UIMove_5P_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 5; i++) { + Result_UIMove_5P_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_UIMove_5P_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 5; i++) { + Result_UIMove_5P_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_DifficultyBar_4P": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Result_DifficultyBar_4P[i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_DifficultyBar_5P": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Result_DifficultyBar_5P[i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_Gauge_Base_4P": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Result_Gauge_Base_4P[i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_Gauge_Base_5P": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Result_Gauge_Base_5P[i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_Gauge_4P": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Result_Gauge_4P[i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_Gauge_5P": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Result_Gauge_5P[i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_Gauge_ClearText_4P": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Result_Gauge_ClearText_4P[i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_Gauge_ClearText_5P": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Result_Gauge_ClearText_5P[i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_Gauge_Rainbow_4P": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Result_Gauge_Rainbow_4P[i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_Gauge_Rainbow_5P": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Result_Gauge_Rainbow_5P[i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_Soul_Fire_4P": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Result_Soul_Fire_4P[i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_Soul_Fire_5P": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Result_Soul_Fire_5P[i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_Soul_Text_4P": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Result_Soul_Text_4P[i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_Soul_Text_5P": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Result_Soul_Text_5P[i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_Perfect_4P": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Result_Perfect_4P[i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_Perfect_5P": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Result_Perfect_5P[i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_Good_4P": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Result_Good_4P[i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_Good_5P": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Result_Good_5P[i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_Miss_4P": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Result_Miss_4P[i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_Miss_5P": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Result_Miss_5P[i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_Roll_4P": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Result_Roll_4P[i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_Roll_5P": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Result_Roll_5P[i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_MaxCombo_4P": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Result_MaxCombo_4P[i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_MaxCombo_5P": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Result_MaxCombo_5P[i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_ADLib_4P": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Result_ADLib_4P[i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_ADLib_5P": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Result_ADLib_5P[i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_Bomb_4P": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Result_Bomb_4P[i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_Bomb_5P": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Result_Bomb_5P[i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_Score_4P": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Result_Score_4P[i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_Score_5P": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Result_Score_5P[i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_ScoreRankEffect_4P": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Result_ScoreRankEffect_4P[i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_ScoreRankEffect_5P": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Result_ScoreRankEffect_5P[i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_CrownEffect_4P": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Result_CrownEffect_4P[i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_CrownEffect_5P": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Result_CrownEffect_5P[i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_Speech_Bubble_V2_4P": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Result_Speech_Bubble_V2_4P[i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_Speech_Bubble_V2_5P": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Result_Speech_Bubble_V2_5P[i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_Speech_Text_Offset": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Result_Speech_Text_Offset[i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_Speech_Text_Size": { + Result_Speech_Text_Size = int.Parse(strParam); + break; + } + case "Result_Speech_Text_MaxWidth": { + Result_Speech_Text_MaxWidth = int.Parse(strParam); + break; + } + case "Result_NamePlate_4P": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Result_NamePlate_4P[i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_NamePlate_5P": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Result_NamePlate_5P[i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_ModIcons_4P": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Result_ModIcons_4P[i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_ModIcons_5P": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Result_ModIcons_5P[i] = int.Parse(strSplit[i]); + } + break; + } + + #endregion + + #region AIResult + case "Result_AIBattle_Batch": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Result_AIBattle_Batch[i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_AIBattle_Batch_Move": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Result_AIBattle_Batch_Move[i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_AIBattle_SectionPlate_Offset": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Result_AIBattle_SectionPlate_Offset[i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_AIBattle_SectionText_Offset": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Result_AIBattle_SectionText_Offset[i] = int.Parse(strSplit[i]); + } + break; + } + case "Result_AIBattle_SectionText_Scale": { + Result_AIBattle_SectionText_Scale = int.Parse(strParam); + break; + } + case "Result_AIBattle_WinFlag": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Result_AIBattle_WinFlag[i] = int.Parse(strSplit[i]); + } + break; + } + #endregion + + #region DanResult + case "DanResult_StatePanel": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + DanResult_StatePanel[i] = int.Parse(strSplit[i]); + } + break; + } + case "DanResult_SongPanel_Main_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 3; i++) { + DanResult_SongPanel_Main_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "DanResult_SongPanel_Main_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 3; i++) { + DanResult_SongPanel_Main_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "DanResult_Difficulty_Cymbol_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 3; i++) { + DanResult_Difficulty_Cymbol_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "DanResult_Difficulty_Cymbol_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 3; i++) { + DanResult_Difficulty_Cymbol_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "DanResult_Level_Number_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 3; i++) { + DanResult_Level_Number_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "DanResult_Level_Number_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 3; i++) { + DanResult_Level_Number_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "DanResult_Sections_Perfect_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 3; i++) { + DanResult_Sections_Perfect_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "DanResult_Sections_Perfect_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 3; i++) { + DanResult_Sections_Perfect_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "DanResult_Sections_Good_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 3; i++) { + DanResult_Sections_Good_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "DanResult_Sections_Good_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 3; i++) { + DanResult_Sections_Good_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "DanResult_Sections_Miss_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 3; i++) { + DanResult_Sections_Miss_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "DanResult_Sections_Miss_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 3; i++) { + DanResult_Sections_Miss_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "DanResult_Sections_Roll_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 3; i++) { + DanResult_Sections_Roll_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "DanResult_Sections_Roll_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 3; i++) { + DanResult_Sections_Roll_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "DanResult_Perfect": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + DanResult_Perfect[i] = int.Parse(strSplit[i]); + } + break; + } + case "DanResult_Good": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + DanResult_Good[i] = int.Parse(strSplit[i]); + } + break; + } + case "DanResult_Miss": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + DanResult_Miss[i] = int.Parse(strSplit[i]); + } + break; + } + case "DanResult_Roll": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + DanResult_Roll[i] = int.Parse(strSplit[i]); + } + break; + } + case "DanResult_MaxCombo": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + DanResult_MaxCombo[i] = int.Parse(strSplit[i]); + } + break; + } + case "DanResult_TotalHit": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + DanResult_TotalHit[i] = int.Parse(strSplit[i]); + } + break; + } + case "DanResult_Score": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + DanResult_Score[i] = int.Parse(strSplit[i]); + } + break; + } + case "DanResult_Exam": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + DanResult_Exam[i] = int.Parse(strSplit[i]); + } + break; + } + case "DanResult_DanTitles_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 3; i++) { + DanResult_DanTitles_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "DanResult_DanTitles_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 3; i++) { + DanResult_DanTitles_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "DanResult_DanIcon_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 3; i++) { + DanResult_DanIcon_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "DanResult_DanIcon_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 3; i++) { + DanResult_DanIcon_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "DanResult_Rank": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + DanResult_Rank[i] = int.Parse(strSplit[i]); + } + break; + } + case "DanResult_Font_DanTitles_Size": { + DanResult_Font_DanTitles_Size = int.Parse(strParam); + break; + } + #endregion + + #region TowerResult + case "TowerResult_ScoreRankEffect": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + TowerResult_ScoreRankEffect[i] = int.Parse(strSplit[i]); + } + break; + } + case "TowerResult_Toutatsu": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + TowerResult_Toutatsu[i] = int.Parse(strSplit[i]); + } + break; + } + case "TowerResult_MaxFloors": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + TowerResult_MaxFloors[i] = int.Parse(strSplit[i]); + } + break; + } + case "TowerResult_Ten": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + TowerResult_Ten[i] = int.Parse(strSplit[i]); + } + break; + } + case "TowerResult_Score": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + TowerResult_Score[i] = int.Parse(strSplit[i]); + } + break; + } + case "TowerResult_CurrentFloor": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + TowerResult_CurrentFloor[i] = int.Parse(strSplit[i]); + } + break; + } + case "TowerResult_ScoreCount": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + TowerResult_ScoreCount[i] = int.Parse(strSplit[i]); + } + break; + } + case "TowerResult_RemainingLifes": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + TowerResult_RemainingLifes[i] = int.Parse(strSplit[i]); + } + break; + } + case "TowerResult_Gauge_Soul": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + TowerResult_Gauge_Soul[i] = int.Parse(strSplit[i]); + } + break; + } + case "TowerResult_Font_TowerText": { + TowerResult_Font_TowerText = int.Parse(strParam); + break; + } + case "TowerResult_Font_TowerText48": { + TowerResult_Font_TowerText48 = int.Parse(strParam); + break; + } + case "TowerResult_Font_TowerText72": { + TowerResult_Font_TowerText72 = int.Parse(strParam); + break; + } + #endregion + + #region Heya + case "Heya_Main_Menu_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 5; i++) { + Heya_Main_Menu_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "Heya_Main_Menu_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 5; i++) { + Heya_Main_Menu_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "Heya_Main_Menu_Font_Offset": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 5; i++) { + Heya_Main_Menu_Font_Offset[i] = int.Parse(strSplit[i]); + } + break; + } + case "Heya_Font_Scale": { + Heya_Font_Scale = int.Parse(strParam); + break; + } + case "Heya_Center_Menu_Box_Count": { + Heya_Center_Menu_Box_Count = int.Parse(strParam); + break; + } + case "Heya_Center_Menu_Box_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < Heya_Center_Menu_Box_Count; i++) { + Heya_Center_Menu_Box_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "Heya_Center_Menu_Box_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < Heya_Center_Menu_Box_Count; i++) { + Heya_Center_Menu_Box_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "Heya_Center_Menu_Box_Item_Offset": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Heya_Center_Menu_Box_Item_Offset[i] = int.Parse(strSplit[i]); + } + break; + } + case "Heya_Center_Menu_Box_Name_Offset": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Heya_Center_Menu_Box_Name_Offset[i] = int.Parse(strSplit[i]); + } + break; + } + case "Heya_Center_Menu_Box_Authors_Offset": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Heya_Center_Menu_Box_Authors_Offset[i] = int.Parse(strSplit[i]); + } + break; + } + case "Heya_Side_Menu_Count": { + Heya_Side_Menu_Count = int.Parse(strParam); + break; + } + case "Heya_Side_Menu_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < Heya_Side_Menu_Count; i++) { + Heya_Side_Menu_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "Heya_Side_Menu_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < Heya_Side_Menu_Count; i++) { + Heya_Side_Menu_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "Heya_Side_Menu_Font_Offset": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Heya_Side_Menu_Font_Offset[i] = int.Parse(strSplit[i]); + } + break; + } + case "Heya_InfoSection": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Heya_InfoSection[i] = int.Parse(strSplit[i]); + } + break; + } + case "Heya_DescriptionTextOrigin": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Heya_DescriptionTextOrigin[i] = int.Parse(strSplit[i]); + } + break; + } + #endregion + + #region OnlineLounge + case "OnlineLounge_Side_Menu": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + OnlineLounge_Side_Menu[i] = int.Parse(strSplit[i]); + } + break; + } + case "OnlineLounge_Side_Menu_Text_Offset": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + OnlineLounge_Side_Menu_Text_Offset[i] = int.Parse(strSplit[i]); + } + break; + } + case "OnlineLounge_Side_Menu_Move": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + OnlineLounge_Side_Menu_Move[i] = int.Parse(strSplit[i]); + } + break; + } + case "OnlineLounge_Song": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + OnlineLounge_Song[i] = int.Parse(strSplit[i]); + } + break; + } + case "OnlineLounge_Song_Title_Offset": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + OnlineLounge_Song_Title_Offset[i] = int.Parse(strSplit[i]); + } + break; + } + case "OnlineLounge_Song_SubTitle_Offset": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + OnlineLounge_Song_SubTitle_Offset[i] = int.Parse(strSplit[i]); + } + break; + } + case "OnlineLounge_Song_Move": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + OnlineLounge_Song_Move[i] = int.Parse(strSplit[i]); + } + break; + } + case "OnlineLounge_Context_Charter": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + OnlineLounge_Context_Charter[i] = int.Parse(strSplit[i]); + } + break; + } + case "OnlineLounge_Context_Genre": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + OnlineLounge_Context_Genre[i] = int.Parse(strSplit[i]); + } + break; + } + case "OnlineLounge_Context_Couse_Symbol": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + OnlineLounge_Context_Couse_Symbol[i] = int.Parse(strSplit[i]); + } + break; + } + case "OnlineLounge_Context_Level": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + OnlineLounge_Context_Level[i] = int.Parse(strSplit[i]); + } + break; + } + case "OnlineLounge_Context_Couse_Move": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + OnlineLounge_Context_Couse_Move[i] = int.Parse(strSplit[i]); + } + break; + } + case "OnlineLounge_Downloading": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + OnlineLounge_Downloading[i] = int.Parse(strSplit[i]); + } + break; + } + case "OnlineLounge_Font_OLFont": { + OnlineLounge_Font_OLFont = int.Parse(strParam); + break; + } + case "OnlineLounge_Font_OLFontLarge": { + OnlineLounge_Font_OLFontLarge = int.Parse(strParam); + break; + } + #endregion + + #region TowerSelect + case "TowerSelect_Title_Size": { + TowerSelect_Title_Size = int.Parse(strParam); + break; + } + case "TowerSelect_Title_MaxWidth": { + TowerSelect_Title_MaxWidth = int.Parse(strParam); + break; + } + case "TowerSelect_Title_Offset": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + TowerSelect_Title_Offset[i] = int.Parse(strSplit[i]); + } + break; + } + case "TowerSelect_SubTitle_Size": { + TowerSelect_SubTitle_Size = int.Parse(strParam); + break; + } + case "TowerSelect_SubTitle_MaxWidth": { + TowerSelect_SubTitle_MaxWidth = int.Parse(strParam); + break; + } + case "TowerSelect_SubTitle_Offset": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + TowerSelect_SubTitle_Offset[i] = int.Parse(strSplit[i]); + } + break; + } + case "TowerSelect_Bar_Count": { + TowerSelect_Bar_Count = int.Parse(strParam); + break; + } + case "TowerSelect_Bar_X": { + TowerSelect_Bar_X = new int[TowerSelect_Bar_Count]; + + string[] strSplit = strParam.Split(','); + for (int i = 0; i < TowerSelect_Bar_Count; i++) { + TowerSelect_Bar_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "TowerSelect_Bar_Y": { + TowerSelect_Bar_Y = new int[TowerSelect_Bar_Count]; + + string[] strSplit = strParam.Split(','); + for (int i = 0; i < TowerSelect_Bar_Count; i++) { + TowerSelect_Bar_Y[i] = int.Parse(strSplit[i]); + } + break; + } + #endregion + + #region OpenEncyclopedia + case "OpenEncyclopedia_Context_Item2": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + OpenEncyclopedia_Context_Item2[i] = int.Parse(strSplit[i]); + } + break; + } + case "OpenEncyclopedia_Context_Item3": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + OpenEncyclopedia_Context_Item3[i] = int.Parse(strSplit[i]); + } + break; + } + case "OpenEncyclopedia_Context_PageText": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + OpenEncyclopedia_Context_PageText[i] = int.Parse(strSplit[i]); + } + break; + } + case "OpenEncyclopedia_Side_Menu": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + OpenEncyclopedia_Side_Menu[i] = int.Parse(strSplit[i]); + } + break; + } + case "OpenEncyclopedia_Side_Menu_Move": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + OpenEncyclopedia_Side_Menu_Move[i] = int.Parse(strSplit[i]); + } + break; + } + case "OpenEncyclopedia_Side_Menu_Text_Offset": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + OpenEncyclopedia_Side_Menu_Text_Offset[i] = int.Parse(strSplit[i]); + } + break; + } + case "OpenEncyclopedia_Font_EncyclopediaMenu_Size": { + OpenEncyclopedia_Font_EncyclopediaMenu_Size = int.Parse(strParam); + break; + } + #endregion + + #region Exit + case "Exit_Duration": { + Exit_Duration = int.Parse(strParam); + break; + } + #endregion + + #region Font + case nameof(Font_Edge_Ratio): //Config画面や簡易メニューのフォントについて(rhimm) + { + if (int.Parse(strParam) > 0) + Font_Edge_Ratio = int.Parse(strParam); + break; + } + case nameof(Font_Edge_Ratio_Vertical): //TITLEやSUBTITLEなど、縦に書かれることのあるフォントについて(rhimm) + { + if (int.Parse(strParam) > 0) + Font_Edge_Ratio_Vertical = int.Parse(strParam); + break; + } + case nameof(Text_Correction_X): { + Text_Correction_X = int.Parse(strParam); + break; + } + case nameof(Text_Correction_Y): { + Text_Correction_Y = int.Parse(strParam); + break; + } + #endregion + + #region PopupMenu + case "PopupMenu_Menu_Title": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + PopupMenu_Menu_Title[i] = int.Parse(strSplit[i]); + } + break; + } + case "PopupMenu_Title": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + PopupMenu_Title[i] = int.Parse(strSplit[i]); + } + break; + } + case "PopupMenu_Menu_Highlight": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + PopupMenu_Menu_Highlight[i] = int.Parse(strSplit[i]); + } + break; + } + case "PopupMenu_MenuItem_Name": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + PopupMenu_MenuItem_Name[i] = int.Parse(strSplit[i]); + } + break; + } + case "PopupMenu_MenuItem_Value": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + PopupMenu_MenuItem_Value[i] = int.Parse(strSplit[i]); + } + break; + } + case "PopupMenu_Move": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + PopupMenu_Move[i] = int.Parse(strSplit[i]); + } + break; + } + case "PopupMenu_Font_Size": { + PopupMenu_Font_Size = int.Parse(strParam); + break; + } + #endregion + + #region NamePlate + case "NamePlate_Title_Offset": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + NamePlate_Title_Offset[i] = int.Parse(strSplit[i]); + } + break; + } + case "NamePlate_Dan_Offset": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + NamePlate_Dan_Offset[i] = int.Parse(strSplit[i]); + } + break; + } + case "NamePlate_Name_Offset_Normal": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + NamePlate_Name_Offset_Normal[i] = int.Parse(strSplit[i]); + } + break; + } + case "NamePlate_Name_Offset_WithTitle": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + NamePlate_Name_Offset_WithTitle[i] = int.Parse(strSplit[i]); + } + break; + } + case "NamePlate_Name_Offset_Full": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + NamePlate_Name_Offset_Full[i] = int.Parse(strSplit[i]); + } + break; + } + case "NamePlate_Name_Width_Normal": { + NamePlate_Name_Width_Normal = int.Parse(strParam); + break; + } + case "NamePlate_Name_Width_Full": { + NamePlate_Name_Width_Full = int.Parse(strParam); + break; + } + case "NamePlate_Title_Width": { + NamePlate_Title_Width = int.Parse(strParam); + break; + } + case "NamePlate_Dan_Width": { + NamePlate_Dan_Width = int.Parse(strParam); + break; + } + case "NamePlate_Font_Name_Size_Normal": { + NamePlate_Font_Name_Size_Normal = int.Parse(strParam); + break; + } + case "NamePlate_Font_Name_Size_WithTitle": { + NamePlate_Font_Name_Size_WithTitle = int.Parse(strParam); + break; + } + case "NamePlate_Font_Title_Size": { + NamePlate_Font_Title_Size = int.Parse(strParam); + break; + } + case "NamePlate_Font_Dan_Size": { + NamePlate_Font_Dan_Size = int.Parse(strParam); + break; + } + #endregion + + #region Modal + case "Modal_Title_Full": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Modal_Title_Full[i] = int.Parse(strSplit[i]); + } + break; + } + case "Modal_Title_Half_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Modal_Title_Half_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "Modal_Title_Half_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Modal_Title_Half_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "Modal_Text_Full": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Modal_Text_Full[i] = int.Parse(strSplit[i]); + } + break; + } + case "Modal_Text_Full_Move": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Modal_Text_Full_Move[i] = int.Parse(strSplit[i]); + } + break; + } + case "Modal_Text_Half_X": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Modal_Text_Half_X[i] = int.Parse(strSplit[i]); + } + break; + } + case "Modal_Text_Half_Y": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Modal_Text_Half_Y[i] = int.Parse(strSplit[i]); + } + break; + } + case "Modal_Text_Half_Move": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Modal_Text_Half_Move[i] = int.Parse(strSplit[i]); + } + break; + } + case "Modal_Font_ModalContentHalf_Size": { + Modal_Font_ModalContentHalf_Size = int.Parse(strParam); + break; + } + case "Modal_Font_ModalTitleHalf_Size": { + Modal_Font_ModalTitleHalf_Size = int.Parse(strParam); + break; + } + case "Modal_Font_ModalContentFull_Size": { + Modal_Font_ModalContentFull_Size = int.Parse(strParam); + break; + } + case "Modal_Font_ModalTitleFull_Size": { + Modal_Font_ModalTitleFull_Size = int.Parse(strParam); + break; + } + case "Modal_Title_Half_X_4P": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 4; i++) { + Modal_Title_Half_X_4P[i] = int.Parse(strSplit[i]); + } + break; + } + case "Modal_Title_Half_X_5P": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 5; i++) { + Modal_Title_Half_X_5P[i] = int.Parse(strSplit[i]); + } + break; + } + case "Modal_Title_Half_Y_4P": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 4; i++) { + Modal_Title_Half_Y_4P[i] = int.Parse(strSplit[i]); + } + break; + } + case "Modal_Title_Half_Y_5P": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 5; i++) { + Modal_Title_Half_Y_5P[i] = int.Parse(strSplit[i]); + } + break; + } + case "Modal_Text_Half_X_4P": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 4; i++) { + Modal_Text_Half_X_4P[i] = int.Parse(strSplit[i]); + } + break; + } + case "Modal_Text_Half_X_5P": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 5; i++) { + Modal_Text_Half_X_5P[i] = int.Parse(strSplit[i]); + } + break; + } + case "Modal_Text_Half_Y_4P": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 4; i++) { + Modal_Text_Half_Y_4P[i] = int.Parse(strSplit[i]); + } + break; + } + case "Modal_Text_Half_Y_5P": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 5; i++) { + Modal_Text_Half_Y_5P[i] = int.Parse(strSplit[i]); + } + break; + } + case "Modal_Text_Half_Move_4P": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Modal_Text_Half_Move_4P[i] = int.Parse(strSplit[i]); + } + break; + } + case "Modal_Text_Half_Move_5P": { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Modal_Text_Half_Move_5P[i] = int.Parse(strSplit[i]); + } + break; + } + #endregion + default: + foreach (string code in CLangManager.Langcodes) { + if (strCommand == "FontName" + code.ToUpper()) { + strParam = strParam.Replace('/', System.IO.Path.DirectorySeparatorChar); + strParam = strParam.Replace('\\', System.IO.Path.DirectorySeparatorChar); + if (HPrivateFastFont.FontExists(strParam)) _fontNameLocalized.Add(code, strParam); + strParam = Path(strParam); + if (HPrivateFastFont.FontExists(strParam)) _fontNameLocalized.Add(code, strParam); + } + if (strCommand == "BoxFontName" + code.ToUpper()) { + strParam = strParam.Replace('/', System.IO.Path.DirectorySeparatorChar); + strParam = strParam.Replace('\\', System.IO.Path.DirectorySeparatorChar); + if (HPrivateFastFont.FontExists(strParam)) _boxFontNameLocalized.Add(code, strParam); + strParam = Path(strParam); + if (HPrivateFastFont.FontExists(Path(strParam))) _boxFontNameLocalized.Add(code, strParam); + } + } + break; + + #endregion + } + } + continue; + } catch (Exception exception) { + Trace.TraceError(exception.ToString()); + Trace.TraceError("例外が発生しましたが処理を継続します。 (6a32cc37-1527-412e-968a-512c1f0135cd)"); + continue; + } + } + } + } + + private void t座標の追従設定() { + // + if (bFieldBgPointOverride == true) { + + } + } + + #region [ IDisposable 実装 ] + //----------------- + public void Dispose() { + if (!this.bDisposed済み) { + for (int i = 0; i < this.nシステムサウンド数; i++) + this[i].Dispose(); + + this.bDisposed済み = true; + } + } + //----------------- + #endregion + + + // その他 + + #region [ private ] + //----------------- + private bool bDisposed済み; + //----------------- + #endregion + + #region 背景(スクロール) + public int[] Background_Scroll_Y = new int[] { 0, 536 }; + #endregion + + + #region[ 座標 ] + //2017.08.11 kairera0467 DP実用化に向けてint配列に変更 + + //フィールド位置 Xは判定枠部分の位置。Yはフィールドの最上部の座標。 + //現時点ではノーツ画像、Senotes画像、判定枠が連動する。 + //Xは中央基準描画、Yは左上基準描画 + public int[] nScrollFieldX = new int[] { 349, 349 }; + public int[] nScrollFieldY = new int[] { 192, 368 }; + + public int[] nScrollField_4P = new int[] { 349, 46 }; + public int[] nScrollField_5P = new int[] { 349, 27 }; + + //中心座標指定 + public int[] nJudgePointX = new int[] { 413, 413, 413, 413 }; + public int[] nJudgePointY = new int[] { 256, 433, 0, 0 }; + + //フィールド背景画像 + //ScrollField座標への追従設定が可能。 + //分岐背景、ゴーゴー背景が連動する。(全て同じ大きさ、位置で作成すること。) + //左上基準描画 + public bool bFieldBgPointOverride = false; + //SEnotes + //音符座標に加算 + public int[] nSENotesX = new int[] { -2, -2 }; + public int[] nSENotesY = new int[] { 131, 131 }; + + public int[] nSENotes_4P = new int[] { -2, 100 }; + public int[] nSENotes_5P = new int[] { -2, 94 }; + + //光る太鼓部分 + public int nMtaikoBackgroundX = 0; + public int nMtaikoBackgroundY = 184; + public int nMtaikoFieldX = 0; + public int nMtaikoFieldY = 184; + public int nMtaikoMainX = 0; + public int nMtaikoMainY = 0; + + //コンボ + public int[] nComboNumberX = new int[] { 0, 0, 0, 0 }; + public int[] nComboNumberY = new int[] { 212, 388, 0, 0 }; + public int[] nComboNumberTextY = new int[] { 271, 447, 0, 0 }; + public int[] nComboNumberTextLargeY = new int[] { 270, 446, 0, 0 }; + public float fComboNumberSpacing = 0; + public float fComboNumberSpacing_l = 0; + + public EDifficultyDisplayType eDiffDispMode; + public bool b現在のステージ数を表示しない; + + //リザルト画面 + //現在のデフォルト値はダミーです。 + public int nResultPanelP1X = 0; + public int nResultPanelP1Y = 0; + public int nResultPanelP2X = 515; + public int nResultPanelP2Y = 75; + public int nResultScoreP1X = 295; + public int nResultScoreP1Y = 212; + public int nResultJudge1_P1X = 495; + public int nResultJudge1_P1Y = 182; + public int nResultJudge2_P1X = 968; + public int nResultJudge2_P1Y = 174; + + public int nResultNumberP1X = 490; + public int nResultNumberP2X = 875; + + public int nResultNumberY = 188; + public int nResultNumberYPadding = 42; + + public int nResultGaugeBaseP1X = 56; + public int nResultGaugeBaseP1Y = 141; + public int nResultGaugeBaseP2X = 555; + public int nResultGaugeBaseP2Y = 122; + public int nResultGaugeBodyP1X = 559; + public int nResultGaugeBodyP1Y = 125; + #endregion + + public string[] strStringを配列に直す(string str) { + string[] strArray = str.Split(','); + return strArray; + } + + public enum RollColorMode { + None, // PS4, Switchなど + All, // 旧筐体(旧作含む) + WithoutStart // 新筐体 + } + public enum ReferencePoint //テクスチャ描画の基準点を変更可能にするための値(rhimm) + { + Center, + Left, + Right + } + + #region 新・SkinConfig + #region General + public string Skin_Name = "Unknown"; + public string Skin_Version = "Unknown"; + public string Skin_Creator = "Unknown"; + public int[] Resolution = new int[] { 1280, 720 }; + public string FontName { get { return _fontNameLocalized.TryGetValue(CLangManager.fetchLang(), out string value) ? value : ""; } } + private Dictionary _fontNameLocalized = new Dictionary(); + public string BoxFontName { get { return _boxFontNameLocalized.TryGetValue(CLangManager.fetchLang(), out string value) ? value : ""; } } + private Dictionary _boxFontNameLocalized = new Dictionary(); + #endregion + + #region Config + + public int[] Config_Arrow_X = new int[] { 552, 552 }; + public int[] Config_Arrow_Y = new int[] { 297, 363 }; + + public int[] Config_Arrow_Focus_X = new int[] { 552, 552 }; + public int[] Config_Arrow_Focus_Y = new int[] { 279, 381 }; + + public int[] Config_Item_X = new int[] { 282, 282, 282 }; + public int[] Config_Item_Y = new int[] { 153, 192, 231 }; + public int Config_Item_Width = 100; + public int[] Config_Item_Font_Offset = new int[] { 0, 8 }; + + public int Config_Font_Scale = 20; + public float Config_Font_Scale_Description = 14.0f; + + public Color Config_Selected_Menu_Text_Grad_Color_1 = Color.Yellow; + public Color Config_Selected_Menu_Text_Grad_Color_2 = Color.OrangeRed; + + public int Config_ItemBox_Count = 10; + public int[] Config_ItemBox_X = new int[] { 602, 602, 602, 602, 602, 602, 602, 602, 602, 602 }; + public int[] Config_ItemBox_Y = new int[] { 4, 79, 154, 229, 304, 379, 454, 529, 604, 679 }; + public int[] Config_ItemBox_Font_Offset = new int[] { 20, 12 }; + public int[] Config_ItemBox_ItemValue_Font_Offset = new int[] { 400, 12 }; + + public int[] Config_ExplanationPanel = new int[] { 67, 382 }; + public int[] Config_SkinSample1 = new int[] { 124, 449 }; + + public int[] Config_KeyAssign = new int[] { 389, 215 }; + public int[] Config_KeyAssign_Menu_Highlight = new int[] { 324, 66 }; + public int[] Config_KeyAssign_Font = new int[] { 308, 64 }; + public int Config_KeyAssign_Move = 20; + + public int[] Config_Calibration_OffsetText = new int[] { 300, 288 }; + public int[] Config_Calibration_InfoText = new int[] { 8, 550 }; + public Rectangle[] Config_Calibration_Highlights = new Rectangle[] { + new Rectangle(371, 724, 371, 209), + new Rectangle(774, 724, 371, 209), + new Rectangle(1179, 724, 371, 209) + }; + + #endregion + + #region Puchichara + + public int Puchichara_Ptn; + public string[] Puchicharas_Name; + + #endregion + + #region Characters + + public int Characters_Ptn; + public string[] Characters_DirName; + public int[] Characters_Normal_Ptn, + Characters_Normal_Missed_Ptn, + Characters_Normal_MissedDown_Ptn, + Characters_Normal_Cleared_Ptn, + Characters_Normal_Maxed_Ptn, + Characters_MissIn_Ptn, + Characters_MissDownIn_Ptn, + Characters_GoGoTime_Ptn, + Characters_GoGoTime_Maxed_Ptn, + Characters_10Combo_Ptn, + Characters_10Combo_Clear_Ptn, + Characters_10Combo_Maxed_Ptn, + Characters_GoGoStart_Ptn, + Characters_GoGoStart_Clear_Ptn, + Characters_GoGoStart_Maxed_Ptn, + Characters_Become_Cleared_Ptn, + Characters_Become_Maxed_Ptn, + Characters_SoulOut_Ptn, + Characters_ClearOut_Ptn, + Characters_Return_Ptn, + Characters_Balloon_Breaking_Ptn, + Characters_Balloon_Broke_Ptn, + Characters_Balloon_Miss_Ptn, + Characters_Kusudama_Idle_Ptn, + Characters_Kusudama_Breaking_Ptn, + Characters_Kusudama_Broke_Ptn, + Characters_Kusudama_Miss_Ptn, + Characters_Title_Entry_Ptn, + Characters_Title_Normal_Ptn, + Characters_Menu_Loop_Ptn, + Characters_Menu_Select_Ptn, + Characters_Menu_Start_Ptn, + Characters_Menu_Wait_Ptn, + Characters_Result_Clear_Ptn, + Characters_Result_Failed_Ptn, + Characters_Result_Failed_In_Ptn, + Characters_Result_Normal_Ptn, + Characters_Tower_Standing_Ptn, + Characters_Tower_Climbing_Ptn, + Characters_Tower_Running_Ptn, + Characters_Tower_Clear_Ptn, + Characters_Tower_Fail_Ptn, + Characters_Tower_Standing_Tired_Ptn, + Characters_Tower_Climbing_Tired_Ptn, + Characters_Tower_Running_Tired_Ptn, + Characters_Tower_Clear_Tired_Ptn; + + // Config + + public int[][] Characters_Resolution; + public int[][] Characters_Heya_Render_Offset; + public bool[] Characters_UseResult1P; + public int[][] Characters_X; + public int[][] Characters_Y; + public int[][] Characters_4P; + public int[][] Characters_5P; + public int[][] Characters_X_AI; + public int[][] Characters_Y_AI; + public int[][] Characters_Balloon_X; + public int[][] Characters_Balloon_Y; + public int[][] Characters_Balloon_4P; + public int[][] Characters_Balloon_5P; + public int[][] Characters_Kusudama_X; + public int[][] Characters_Kusudama_Y; + public int[][] Characters_Motion_Normal, + Characters_Motion_10Combo, + Characters_Motion_10Combo_Clear, + Characters_Motion_10ComboMax, + Characters_Motion_Miss, + Characters_Motion_MissDown, + Characters_Motion_ClearIn, + Characters_Motion_Clear, + Characters_Motion_ClearMax, + Characters_Motion_MissIn, + Characters_Motion_MissDownIn, + Characters_Motion_GoGoStart, + Characters_Motion_GoGoStart_Clear, + Characters_Motion_GoGoStartMax, + Characters_Motion_GoGo, + Characters_Motion_GoGoMax, + Characters_Motion_SoulIn, + Characters_Motion_SoulOut, + Characters_Motion_ClearOut, + Characters_Motion_Return; + public float[] Characters_Beat_Normal, + Characters_Beat_10Combo, + Characters_Beat_10Combo_Clear, + Characters_Beat_10ComboMax, + Characters_Beat_Miss, + Characters_Beat_MissDown, + Characters_Beat_ClearIn, + Characters_Beat_Clear, + Characters_Beat_ClearMax, + Characters_Beat_MissIn, + Characters_Beat_MissDownIn, + Characters_Beat_GoGoStart, + Characters_Beat_GoGoStart_Clear, + Characters_Beat_GoGoStartMax, + Characters_Beat_GoGo, + Characters_Beat_GoGoMax, + Characters_Beat_SoulIn, + Characters_Beat_SoulOut, + Characters_Beat_ClearOut, + Characters_Beat_Return, + Characters_Beat_Tower_Standing, + Characters_Beat_Tower_Standing_Tired, + Characters_Beat_Tower_Fail, + Characters_Beat_Tower_Clear, + Characters_Beat_Tower_Clear_Tired; + public bool[] Characters_Tower_Clear_IsLooping, + Characters_Tower_Clear_Tired_IsLooping, + Characters_Tower_Fail_IsLooping; + public int[] Characters_Balloon_Timer; + public int[] Characters_Balloon_Delay; + public int[] Characters_Balloon_FadeOut; + + public int[] Characters_Title_Entry_AnimationDuration; + public int[] Characters_Title_Normal_AnimationDuration; + public int[] Characters_Menu_Loop_AnimationDuration; + public int[] Characters_Menu_Select_AnimationDuration; + public int[] Characters_Menu_Start_AnimationDuration; + public int[] Characters_Menu_Wait_AnimationDuration; + public int[] Characters_Result_Normal_AnimationDuration; + public int[] Characters_Result_Clear_AnimationDuration; + public int[] Characters_Result_Failed_In_AnimationDuration; + public int[] Characters_Result_Failed_AnimationDuration; + + #endregion + + #region [Adjustments] + public int[] Adjustments_MenuPuchichara_X = new int[] { -100, 100 }; + public int[] Adjustments_MenuPuchichara_Y = new int[] { -100, -100 }; + + #endregion + + #region [Startup] + public int StartUp_LangSelect_FontSize = 16; + #endregion + + #region [Title Screen] + + public int Title_LoadingPinInstances = 5; + public int Title_LoadingPinFrameCount = 8; + public int Title_LoadingPinCycle = 320; + public int[] Title_LoadingPinBase = new int[] { 480, 410 }; + public int[] Title_LoadingPinDiff = new int[] { 90, 0 }; + + public int[] Title_Entry_Bar_Text_X = new int[] { 563, 563 }; + public int[] Title_Entry_Bar_Text_Y = new int[] { 312, 430 }; + + public int[] Title_Banapas_Load_Clear_Anime = new int[] { 198, 514 }; + + public int[] Title_Entry_Player_Select_X = new int[] { 337, 529, 743 }; + public int[] Title_Entry_Player_Select_Y = new int[] { 488, 487, 486 }; + + public int[][][] Title_Entry_Player_Select_Rect = new int[][][] { + new int[][] { new int[] { 0, 0, 199, 92 } ,new int[] { 199, 0, 224, 92 } }, + new int[][] { new int[] { 0, 92, 199, 92 } ,new int[] { 199, 92, 224, 92 } }, + new int[][] { new int[] { 0, 184, 199, 92 } ,new int[] { 199, 184, 224, 92 } } + }; + public int[] Title_Entry_NamePlate = new int[] { 530, 385 }; + + public int[] Title_ModeSelect_Bar_X = new int[] { 290, 319, 356 }; + public int[] Title_ModeSelect_Bar_Y = new int[] { 107, 306, 513 }; + + public int[] Title_ModeSelect_Bar_Offset = new int[] { 20, 112 }; + + public int[] Title_ModeSelect_Title_Offset = new int[] { 311, 72 }; + public int[] Title_ModeSelect_Title_Scale = new int[] { 36, 15 }; + + public int[] Title_ModeSelect_Bar_Center_X = new int[] { 320, 320, 640 }; + public int[] Title_ModeSelect_Bar_Center_Y = new int[] { 338, 360, 360 }; + public int[][] Title_ModeSelect_Bar_Center_Rect = new int[][] { + new int[] { 0, 0, 641, 27 }, + new int[] { 0, 76, 641, 30 }, + new int[] { 0, 27, 641, 45 }, + }; + + public int[] Title_ModeSelect_Bar_Overlay_X = new int[] { 320, 320, 640 }; + public int[] Title_ModeSelect_Bar_Overlay_Y = new int[] { 306, 333, 333 }; + public int[][] Title_ModeSelect_Bar_Overlay_Rect = new int[][] { + new int[] { 0, 0, 641, 27 }, + new int[] { 0, 71, 641, 35 }, + new int[] { 0, 27, 641, 1 }, + }; + + public int[] Title_ModeSelect_Bar_Move = new int[] { 40, 100 }; + public int[] Title_ModeSelect_Bar_Move_X = new int[] { 0, 0 }; + public int[] Title_ModeSelect_Overlay_Move = new int[] { 40, 120 }; + public int[] Title_ModeSelect_Overlay_Move_X = new int[] { 0, 0 }; + + public int[] Title_ModeSelect_Bar_Chara_X = new int[] { 446, 835 }; + public int[] Title_ModeSelect_Bar_Chara_Y = new int[] { 360, 360 }; + + public int Title_ModeSelect_Bar_Chara_Move = 45; + + public int[] Title_ModeSelect_Bar_Center_Title = new int[] { 631, 379 }; + public int Title_ModeSelect_Bar_Center_Title_Move = 60; + public int Title_ModeSelect_Bar_Center_Title_Move_X = 0; + + public int[] Title_ModeSelect_Bar_Center_BoxText = new int[] { 640, 397 }; + + public bool Title_VerticalText = false; + public bool Title_VerticalBar = false; + + #endregion + + #region SongSelect + public string[] SongSelect_GenreName = { "ポップス", "アニメ", "ゲームバラエティ", "ナムコオリジナル", "クラシック", "バラエティ", "キッズ", "ボーカロイド", "最近遊んだ曲" }; + + public int SongSelect_Bar_Count = 9; + + public int[] SongSelect_Bar_X = new int[] { 214, 239, 263, 291, 324, 358, 386, 411, 436 }; + public int[] SongSelect_Bar_Y = new int[] { -127, -36, 55, 145, 314, 485, 574, 665, 756 }; + public int[] SongSelect_Bar_Anim_X = new int[] { 0, 600, 500, 400, 0, -400, -500, -600, 0 }; + public int[] SongSelect_Bar_Anim_Y = new int[] { 0, 1800, 1500, 1200, 0, -1200, -1500, -1800, 0 }; + + public float SongSelect_Scroll_Interval = 0.12f; + + public int[] SongSelect_Bar_Title_Offset = new int[] { 316, 62 }; + public int[] SongSelect_Bar_Box_Offset = new int[] { 316, 62 }; + public int[] SongSelect_Bar_BackBox_Offset = new int[] { 316, 62 }; + public int[] SongSelect_Bar_Random_Offset = new int[] { 316, 62 }; + public int[] SongSelect_Bar_SubTitle_Offset = new int[] { 316, 90 }; + + public int[] SongSelect_DanStatus_Offset_X = new int[] { 30, 602 }; + public int[] SongSelect_DanStatus_Offset_Y = new int[] { 30, 30 }; + + public int[] SongSelect_TowerStatus_Offset_X = new int[] { 30, 602 }; + public int[] SongSelect_TowerStatus_Offset_Y = new int[] { 30, 30 }; + + public int[] SongSelect_RegularCrowns_Offset_X = new int[] { 30, 602 }; + public int[] SongSelect_RegularCrowns_Offset_Y = new int[] { 30, 30 }; + + public int[] SongSelect_RegularCrowns_ScoreRank_Offset_X = new int[] { 0, 0 }; + public int[] SongSelect_RegularCrowns_ScoreRank_Offset_Y = new int[] { 0, 30 }; + + public int[] SongSelect_RegularCrowns_Difficulty_Cymbol_Offset_X = new int[] { 22, 22 }; + public int[] SongSelect_RegularCrowns_Difficulty_Cymbol_Offset_Y = new int[] { 22, 52 }; + + public int[] SongSelect_FavoriteStatus_Offset = new int[] { 90, 30 }; + + public int SongSelect_BoxName_Scale = 28; + public int SongSelect_MusicName_Scale = 22; + public int SongSelect_Subtitle_Scale = 13; + public int SongSelect_BoxText_Scale = 14; + public bool SongSelect_VerticalText = false; + + public int SongSelect_Title_MaxSize = 550; + public int SongSelect_SubTitle_MaxSize = 510; + + public bool SongSelect_Maker_Show = false; + public int[] SongSelect_Maker = new int[] { 1285, 190 }; + public int SongSelect_Maker_Size = 23; + public int SongSelect_Maker_MaxSize = 180; + + public bool SongSelect_BPM_Text_Show = false; + public int[] SongSelect_BPM_Text = new int[] { 1240, 20 }; + public int SongSelect_BPM_Text_MaxSize = 180; + public int SongSelect_BPM_Text_Size = 23; + + public bool SongSelect_Shorten_Frame_Fade = false; + public bool SongSelect_Bar_Select_Skip_Fade = false; + + public int[] SongSelect_Explicit = new int[] { 1240, 60 }; + public int[] SongSelect_Movie = new int[] { 0, 0 }; + + public int SongSelect_Bar_Center_Move = 62; + public int SongSelect_Bar_Center_Move_X = 0; + + public int[] SongSelect_Bar_Select = new int[] { 309, 235 }; + + public int[] SongSelect_Frame_Score_X = new int[] { 400, 522, 644, 766 }; + public int[] SongSelect_Frame_Score_Y = new int[] { 228, 228, 228, 228 }; + + public int[] SongSelect_Level_Number_X = new int[] { 485, 607, 729, 851 }; + public int[] SongSelect_Level_Number_Y = new int[] { 400, 400, 400, 400 }; + public int[] SongSelect_Level_Number_Tower = new int[] { 485, 400 }; + public int[] SongSelect_Tower_Side = new int[] { 485, 400 }; + + public int[] SongSelect_Level_X = new int[] { 485, 607, 729, 851 }; + public int[] SongSelect_Level_Y = new int[] { 400, 400, 400, 400 }; + public int[] SongSelect_Level_Move = new int[] { 0, -17 }; + + public int[] SongSelect_Unlock_Conditions_Text = new int[] { 72, 128 }; + + public int[] SongSelect_Level_Number_Interval = new int[] { 11, 0 }; + + public float SongSelect_Box_Opening_Interval = 1f; + + public int[] SongSelect_Difficulty_Select_Title = new int[] { 640, 140 }; + public int[] SongSelect_Difficulty_Select_SubTitle = new int[] { 640, 180 }; + + public int SongSelect_Box_Chara_Move = 114; + + public int[] SongSelect_Box_Chara_X = new int[] { 434, 846 }; + public int[] SongSelect_Box_Chara_Y = new int[] { 360, 360 }; + + public int SongSelect_BoxExplanation_X = 640; + public int SongSelect_BoxExplanation_Y = 360; + + public int SongSelect_BoxExplanation_Interval = 30; + + public int[] SongSelect_NamePlate_X = new int[] { 36, 1020, 216, 840, 396 }; + public int[] SongSelect_NamePlate_Y = new int[] { 615, 615, 561, 561, 615 }; + public int[] SongSelect_Auto_X = new int[] { 60, 950 }; + public int[] SongSelect_Auto_Y = new int[] { 650, 650 }; + public int[] SongSelect_ModIcons_X = new int[] { 40, 1020, 220, 840, 400 }; + public int[] SongSelect_ModIcons_Y = new int[] { 672, 672, 618, 618, 672 }; + + public int[] SongSelect_Timer = new int[] { 1148, 57 }; + public int[] SongSelect_Timer_Interval = new int[] { 46, 0 }; + + public bool SongSelect_Bpm_Show = false; + public int[] SongSelect_Bpm_X = new int[] { 1240, 1240, 1240 }; + public int[] SongSelect_Bpm_Y = new int[] { 20, 66, 112 }; + public int[] SongSelect_Bpm_Interval = new int[] { 22, 0 }; + + public bool SongSelect_FloorNum_Show = false; + public int SongSelect_FloorNum_X = 1200; + public int SongSelect_FloorNum_Y = 205; + public int[] SongSelect_FloorNum_Interval = new int[] { 30, 0 }; + + public bool SongSelect_DanInfo_Show = false; + public int[] SongSelect_DanInfo_Icon_X = new int[] { 1001, 1001, 1001 }; + public int[] SongSelect_DanInfo_Icon_Y = new int[] { 269, 309, 349 }; + public float SongSelect_DanInfo_Icon_Scale = 0.5f; + public int[] SongSelect_DanInfo_Difficulty_Cymbol_X = new int[] { 1028, 1028, 1028 }; + public int[] SongSelect_DanInfo_Difficulty_Cymbol_Y = new int[] { 263, 303, 343 }; + public float SongSelect_DanInfo_Difficulty_Cymbol_Scale = 0.5f; + public int[] SongSelect_DanInfo_Level_Number_X = new int[] { 1040, 1040, 1040 }; + public int[] SongSelect_DanInfo_Level_Number_Y = new int[] { 267, 307, 347 }; + public float SongSelect_DanInfo_Level_Number_Scale = 0.5f; + public int[] SongSelect_DanInfo_Title_X = new int[] { 1032, 1032, 1032 }; + public int[] SongSelect_DanInfo_Title_Y = new int[] { 258, 298, 338 }; + public int SongSelect_DanInfo_Title_Size = 12; + public int[] SongSelect_DanInfo_Exam_X = new int[] { 1030, 1030, 1030, 1030, 1030, 1030 }; + public int[] SongSelect_DanInfo_Exam_Y = new int[] { 398, 426, 454, 482, 510, 538 }; + public int SongSelect_DanInfo_Exam_Size = 10; + public int[] SongSelect_DanInfo_Exam_Value_X = new int[] { 1097, 1162, 1227 }; + public int[] SongSelect_DanInfo_Exam_Value_Y = new int[] { 388, 416, 444, 472, 500, 528 }; + public float SongSelect_DanInfo_Exam_Value_Scale = 0.5f; + + public int[] SongSelect_Table_X = new int[] { 0, 1034, 180, 854, 360 }; + public int[] SongSelect_Table_Y = new int[] { 0, 0, -204, -204, 0 }; + + public int[] SongSelect_High_Score_X = new int[] { 124, 1158, 304, 978, 484 }; + public int[] SongSelect_High_Score_Y = new int[] { 416, 416, 212, 212, 416 }; + + public int[] SongSelect_High_Score_Difficulty_Cymbol_X = new int[] { 46, 1080, 226, 900, 406 }; + public int[] SongSelect_High_Score_Difficulty_Cymbol_Y = new int[] { 418, 418, 214, 214, 418 }; + + public int[][] SongSelect_BoardNumber_X = new int[][] { + new int[] { 62, 125, 190, 62, 125, 190, 190, 62, 125, -100, 190, 74, 114 }, + new int[] { 1096, 1159, 1224, 1096, 1159, 1224, 1224, 1096, 1159, -100, 1224, 1214, 1148 }, + + new int[] { 242, 305, 370, 242, 305, 370, 370, 242, 305, -100, 370, 254, 294 }, + new int[] { 916, 979, 1044, 916, 979, 1044, 1044, 916, 979, -100, 1044, 1034, 968 }, + new int[] { 422, 485, 550, 422, 485, 550, 550, 422, 485, 550, -100, 434, 474 } + }; + public int[][] SongSelect_BoardNumber_Y = new int[][] { + new int[] { 276, 276, 276, 251, 251, 251, 226, 304, 304, -100, 304, 353, 415 }, + new int[] { 276, 276, 276, 251, 251, 251, 226, 304, 304, -100, 304, 353, 415 }, + new int[] { 72,72,72,47,47,47,22,100,100, -100, 100, 149,211 }, + new int[] { 72,72,72,47,47,47,22,100,100, -100, 100, 149,211 }, + new int[] { 276, 276, 276, 251, 251, 251, 226, 304, 304, -100, 304, 353, 415 } + }; + public int[] SongSelect_BoardNumber_Interval = new int[] { 9, 0 }; + + public int[] SongSelect_SongNumber_X = new int[] { 1090, 1183 }; + public int[] SongSelect_SongNumber_Y = new int[] { 167, 167 }; + public int[] SongSelect_SongNumber_Interval = new int[] { 16, 0 }; + + public int[] SongSelect_Search_Bar_X = new int[] { 640, 640, 640, 640, 640 }; + public int[] SongSelect_Search_Bar_Y = new int[] { 320, 420, 520, 620, 720 }; + + public int[] SongSelect_Difficulty_Back = new int[] { 640, 290 }; + public int[] SongSelect_Level_Offset = new int[] { 610, 40 }; + public Color[] SongSelect_Difficulty_Colors = new Color[] { + ColorTranslator.FromHtml("#88d2fd"), + ColorTranslator.FromHtml("#58de85"), + ColorTranslator.FromHtml("#ffc224"), + ColorTranslator.FromHtml("#d80b2c"), + ColorTranslator.FromHtml("#9065e2"), + ColorTranslator.FromHtml("#e9943b"), + ColorTranslator.FromHtml("#3b55a5") + }; + + public int[] SongSelect_Difficulty_Bar_X = new int[] { 255, 341, 426, 569, 712, 855, 855 }; + public int[] SongSelect_Difficulty_Bar_Y = new int[] { 270, 270, 270, 270, 270, 270, 270 }; + public int[] SongSelect_Branch_Text_Offset = new int[] { 276, 6 }; + public int[] SongSelect_Branch_Offset = new int[] { 6, 6 }; + + public int[][] SongSelect_Difficulty_Bar_Rect = new int[][] { + new int[] { 0, 0, 86, 236 }, + new int[] { 86, 0, 86, 236 }, + new int[] { 171, 0, 138, 236 }, + new int[] { 314, 0, 138, 236 }, + new int[] { 457, 0, 138, 236 }, + new int[] { 600, 0, 138, 236 }, + new int[] { 743, 0, 138, 236 }, + }; + + public int[] SongSelect_Difficulty_Star_X = new int[] { 444, 587, 730, 873, 873 }; + public int[] SongSelect_Difficulty_Star_Y = new int[] { 459, 459, 459, 459, 459 }; + public int[] SongSelect_Difficulty_Star_Interval = new int[] { 10, 0 }; + + public int[] SongSelect_Difficulty_Number_X = new int[] { 498, 641, 784, 927, 927, 927, 927 }; + public int[] SongSelect_Difficulty_Number_Y = new int[] { 435, 435, 435, 435, 435, 435, 435 }; + public int[] SongSelect_Difficulty_Number_Interval = new int[] { 11, 0 }; + + public int[][] SongSelect_Difficulty_Crown_X = new int[][] { + new int[] { 445, 589, 733, 877, 877 }, + new int[] { 519, 663, 807, 951, 951 }, + }; + public int[][] SongSelect_Difficulty_Crown_Y = new int[][] { + new int[] { 284, 284, 284, 284, 284 }, + new int[] { 284, 284, 284, 284, 284 }, + }; + + public int[][] SongSelect_Difficulty_ScoreRank_X = new int[][] { + new int[] { 467, 611, 755, 899, 899 }, + new int[] { 491, 635, 779, 923, 923 }, + }; + public int[][] SongSelect_Difficulty_ScoreRank_Y = new int[][] { + new int[] { 281, 281, 281, 281, 281 }, + new int[] { 281, 281, 281, 281, 281 }, + }; + + public int[] SongSelect_Difficulty_Select_Bar_X = new int[] { 163, 252, 367, 510, 653, 796, 796 }; + public int[] SongSelect_Difficulty_Select_Bar_Y = new int[] { 176, 176, 176, 176, 176, 176, 176 }; + + public int[] SongSelect_Difficulty_Select_Bar_Back_X = new int[] { 163, 252, 367, 510, 653, 796, 796 }; + public int[] SongSelect_Difficulty_Select_Bar_Back_Y = new int[] { 242, 242, 242, 242, 242, 242, 242 }; + + public int[][] SongSelect_Difficulty_Select_Bar_Rect = new int[][] { + new int[] { 0, 0, 259, 114 }, + new int[] { 0, 114, 259, 275 }, + new int[] { 0, 387, 259, 111 }, + }; + + public int[] SongSelect_Difficulty_Select_Bar_Anime = new int[] { 0, 10 }; + public int[] SongSelect_Difficulty_Select_Bar_AnimeIn = new int[] { 0, 50 }; + public int[] SongSelect_Difficulty_Select_Bar_Move = new int[] { 25, 0 }; + + public int[] SongSelect_Difficulty_Bar_ExExtra_AnimeDuration = new int[] { -1, -1 }; + + public int[] SongSelect_Preimage = new int[] { 120, 110 }; + public int[] SongSelect_Preimage_Size = new int[] { 200, 200 }; + + public int[] SongSelect_Option_Select_Offset = new int[] { 0, -286 }; + + public int SongSelect_Option_Font_Scale = 13; + public int[] SongSelect_Option_OptionType_X = new int[] { 16, 1004 }; + public int[] SongSelect_Option_OptionType_Y = new int[] { 93, 93 }; + public int[] SongSelect_Option_Value_X = new int[] { 200, 1188 }; + public int[] SongSelect_Option_Value_Y = new int[] { 93, 93 }; + public int[] SongSelect_Option_Interval = new int[] { 0, 41 }; + + public int[] SongSelect_Option_ModMults1_X = new int[] { 108, 1096 }; + public int[] SongSelect_Option_ModMults1_Y = new int[] { 11, 11 }; + + public int[] SongSelect_Option_ModMults2_X = new int[] { 108, 1096 }; + public int[] SongSelect_Option_ModMults2_Y = new int[] { 52, 52 }; + + + public int[] SongSelect_NewHeya_Close_Select = new int[] { 0, 0 }; + + public int[] SongSelect_NewHeya_PlayerPlate_X = new int[] { 0, 256, 513, 770, 1026 }; + public int[] SongSelect_NewHeya_PlayerPlate_Y = new int[] { 66, 66, 66, 66, 66 }; + + public int[] SongSelect_NewHeya_ModeBar_X = new int[] { 0, 256, 513, 770, 1026 }; + public int[] SongSelect_NewHeya_ModeBar_Y = new int[] { 200, 200, 200, 200, 200 }; + public int[] SongSelect_NewHeya_ModeBar_Font_Offset = new int[] { 128, 33 }; + + + public int SongSelect_NewHeya_Box_Count = 7; + public int[] SongSelect_NewHeya_Box_X = new int[] { -424, -120, 184, 488, 792, 1096, 1400 }; + public int[] SongSelect_NewHeya_Box_Y = new int[] { 273, 273, 273, 273, 273, 273, 273 }; + public int[] SongSelect_NewHeya_Box_Chara_Offset = new int[] { 152, 200 }; + public int[] SongSelect_NewHeya_Box_Name_Offset = new int[] { 152, 386 }; + public int[] SongSelect_NewHeya_Box_Author_Offset = new int[] { 152, 413 }; + public int[] SongSelect_NewHeya_Lock_Offset = new int[] { 0, 73 }; + public int[] SongSelect_NewHeya_InfoSection_Offset = new int[] { 152, 206 }; + + public Color SongSelect_ForeColor_JPOP = ColorTranslator.FromHtml("#FFFFFF"); + public Color SongSelect_ForeColor_Anime = ColorTranslator.FromHtml("#FFFFFF"); + public Color SongSelect_ForeColor_VOCALOID = ColorTranslator.FromHtml("#FFFFFF"); + public Color SongSelect_ForeColor_Children = ColorTranslator.FromHtml("#FFFFFF"); + public Color SongSelect_ForeColor_Variety = ColorTranslator.FromHtml("#FFFFFF"); + public Color SongSelect_ForeColor_Classic = ColorTranslator.FromHtml("#FFFFFF"); + public Color SongSelect_ForeColor_GameMusic = ColorTranslator.FromHtml("#FFFFFF"); + public Color SongSelect_ForeColor_Namco = ColorTranslator.FromHtml("#FFFFFF"); + public Color SongSelect_BackColor_JPOP = ColorTranslator.FromHtml("#01455B"); + public Color SongSelect_BackColor_Anime = ColorTranslator.FromHtml("#99001F"); + public Color SongSelect_BackColor_VOCALOID = ColorTranslator.FromHtml("#5B6278"); + public Color SongSelect_BackColor_Children = ColorTranslator.FromHtml("#9D3800"); + public Color SongSelect_BackColor_Variety = ColorTranslator.FromHtml("#366600"); + public Color SongSelect_BackColor_Classic = ColorTranslator.FromHtml("#875600"); + public Color SongSelect_BackColor_GameMusic = ColorTranslator.FromHtml("#412080"); + public Color SongSelect_BackColor_Namco = ColorTranslator.FromHtml("#980E00"); + + public string[] SongSelect_CorrectionX_Chara = { "ここにX座標を補正したい文字をカンマで区切って記入" }; + public string[] SongSelect_CorrectionY_Chara = { "ここにY座標を補正したい文字をカンマで区切って記入" }; + public int SongSelect_CorrectionX_Chara_Value = 0; + public int SongSelect_CorrectionY_Chara_Value = 0; + public string[] SongSelect_Rotate_Chara = { "ここに90℃回転させたい文字をカンマで区切って記入" }; + + #endregion + #region DaniSelect + + public int[] DaniSelect_DanSides_X = new int[] { 243, 1199 }; + public int[] DaniSelect_DanSides_Y = new int[] { 143, 143 }; + + public int[] DaniSelect_DanPlate = new int[] { 173, 301 }; + public int[] DaniSelect_Rank = new int[] { 173, 422 }; + public int[] DaniSelect_Bloc2 = new int[] { 291, 412 }; + public int[] DaniSelect_Text_Gauge = new int[] { 396, 429 }; + public int[] DaniSelect_Value_Gauge = new int[] { 370, 462 }; + + public int[] DaniSelect_DanIcon_X = new int[] { 314, 314, 314 }; + public int[] DaniSelect_DanIcon_Y = new int[] { 190, 263, 336 }; + + public int[] DaniSelect_Title_X = new int[] { 401, 401, 401 }; + public int[] DaniSelect_Title_Y = new int[] { 173, 246, 319 }; + + public int[] DaniSelect_Difficulty_Cymbol_X = new int[] { 377, 377, 377 }; + public int[] DaniSelect_Difficulty_Cymbol_Y = new int[] { 180, 253, 326 }; + + public int[] DaniSelect_Level_Number_X = new int[] { 383, 383, 383 }; + public int[] DaniSelect_Level_Number_Y = new int[] { 207, 280, 353 }; + + public int[] DaniSelect_Level_Number_Interval = new int[] { 10, 0 }; + + public int[] DaniSelect_Soul_Number_Interval = new int[] { 16, 0 }; + public int DaniSelect_Soul_Number_Text_Width = 80; + + public int[] DaniSelect_Exam_Number_Interval = new int[] { 16, 0 }; + public int DaniSelect_Exam_Number_Text_Width = 45; + + public int[] DaniSelect_Font_DanFolder_Size = new int[] { 64, 32 }; + public int[] DaniSelect_FolderText_X = new int[] { 640, 640, 640, 640 }; + public int[] DaniSelect_FolderText_Y = new int[] { 320, 413, 460, 507 }; + public int DaniSelect_Font_DanSong_Size = 24; + public int DaniSelect_Font_Exam_Size = 13; + + public int[] DaniSelect_Exam_Bloc_X = new int[] { 515, 515, 515 }; + public int[] DaniSelect_Exam_Bloc_Y = new int[] { 412, 500, 588 }; + + public int[] DaniSelect_Exam_X = new int[] { 590, 590, 590 }; + public int[] DaniSelect_Exam_Y = new int[] { 455, 543, 631 }; + + public int[] DaniSelect_Exam_X_Ex = new int[] { 536, 536, 536 }; + public int[] DaniSelect_Exam_Y_Ex = new int[] { 455, 543, 631 }; + + public int[] DaniSelect_Exam_Interval = new int[] { 220, 0 }; + + public int[] DaniSelect_Exam_Title_X = new int[] { 614, 614, 614 }; + public int[] DaniSelect_Exam_Title_Y = new int[] { 429, 517, 605 }; + + public int[] DaniSelect_Challenge_Select_X = new int[] { 228, 456, 684 }; + public int[] DaniSelect_Challenge_Select_Y = new int[] { 0, 0, 0 }; + public int[][] DaniSelect_Challenge_Select_Rect = new int[][] { + new int[] { 228, 0, 228, 720 }, + new int[] { 456, 0, 228, 720 }, + new int[] { 684, 0, 228, 720 }, + }; + + public int[] DaniSelect_Plate = new int[] { 640, 10 }; + public int[] DaniSelect_Plate_Move = new int[] { 52, 0 }; + public int[] DaniSelect_Plate_Center_Move = new int[] { 0, 15 }; + public int[] DaniSelect_Plate_Title_Offset = new int[] { 2, 36 }; + + public int DaniSelect_DanPlateTitle_Size = 60; + public int[] DaniSelect_DanPlateTitle_Offset = new int[] { 0, -50 }; + + public int DaniSelect_DanIconTitle_Size = 18; + public int[] DaniSelect_DanIconTitle_Offset = new int[] { 0, 6 }; + + public Color[] DaniSelect_DanIcon_Color = new Color[] + { + Color.Red, + Color.Green, + Color.Blue, + Color.Magenta, + Color.Yellow, + Color.Cyan, + Color.Brown, + Color.Gray, + Color.DarkGreen, + Color.Black + }; + #endregion + #region SongLoading + public int SongLoading_Plate_X = 640; + public int SongLoading_Plate_Y = 360; + public int SongLoading_Title_X = 640; + public int SongLoading_Title_Y = 280; + public int SongLoading_Title_MaxSize = 710; + public int SongLoading_SubTitle_X = 640; + public int SongLoading_SubTitle_Y = 325; + public int SongLoading_SubTitle_MaxSize = 710; + + public int SongLoading_Plate_X_AI = 640; + public int SongLoading_Plate_Y_AI = 360; + public int SongLoading_Title_X_AI = 640; + public int SongLoading_Title_Y_AI = 313; + public int SongLoading_SubTitle_X_AI = 640; + public int SongLoading_SubTitle_Y_AI = 365; + + public int[] SongLoading_Fade_AI_Anime_Ring = new int[] { 466, 185 }; + public int[] SongLoading_Fade_AI_Anime_LoadBar = new int[] { 490, 382 }; + + public int[] SongLoading_DanPlate = new int[] { 1121, 213 }; + + public int SongLoading_Title_FontSize = 31; + public int SongLoading_SubTitle_FontSize = 20; + public int[] SongLoading_Chara_Move = new int[] { 250, -80 }; + public ReferencePoint SongLoading_Plate_ReferencePoint = ReferencePoint.Center; + public ReferencePoint SongLoading_Title_ReferencePoint = ReferencePoint.Center; + public ReferencePoint SongLoading_SubTitle_ReferencePoint = ReferencePoint.Center; + public Color SongLoading_Title_ForeColor = ColorTranslator.FromHtml("#FFFFFF"); + public Color SongLoading_Title_BackColor = ColorTranslator.FromHtml("#000000"); + public Color SongLoading_SubTitle_ForeColor = ColorTranslator.FromHtml("#000000"); + public Color SongLoading_SubTitle_BackColor = ColorTranslator.FromHtml("#00000000"); + public bool SongLoading_Plate_ScreenBlend = false; + + #endregion + #region Game + + // Game parameters here + + public bool Game_Notes_Anime = false; + public int[] Game_Notes_Size = new int[] { 130, 130 }; + public int[] Game_SENote_Size = new int[] { 136, 30 }; + public int Game_Notes_Interval = 960; + + public int[] Game_Notes_Arm_Offset_Left_X = new int[] { 25, 25 }; + public int[] Game_Notes_Arm_Offset_Right_X = new int[] { 60, 60 }; + + public int[] Game_Notes_Arm_Offset_Left_Y = new int[] { 74, -44 }; + public int[] Game_Notes_Arm_Offset_Right_Y = new int[] { 104, -14 }; + public int[] Game_Notes_Arm_Move = new int[] { 0, 30 }; + + public int[] Game_Judge_X = new int[] { 364, 364 }; + public int[] Game_Judge_Y = new int[] { 152, 328 }; + public int[] Game_Judge_Move = new int[] { 0, 20 }; + public int[] Game_ScoreRank_X = new int[] { 87, 87 }; + public int[] Game_ScoreRank_Y = new int[] { 98, 622 }; + public int[] Game_ScoreRank_Move = new int[] { 0, 51 }; + public string Game_StageText = "1曲目"; + public RollColorMode Game_RollColorMode = RollColorMode.All; + public bool Game_JudgeFrame_AddBlend = true; + + public int[] Game_Judge_Meter = new int[] { 0, 360 }; + public int[] Game_Judge_Meter_Perfect = new int[] { 102, 494 }; + public int[] Game_Judge_Meter_Good = new int[] { 102, 532 }; + public int[] Game_Judge_Meter_Miss = new int[] { 102, 570 }; + public int[] Game_Judge_Meter_Roll = new int[] { 102, 634 }; + public int[] Game_Judge_Meter_HitRate = new int[] { 206, 436 }; + public int[] Game_Judge_Meter_PerfectRate = new int[] { 206, 494 }; + public int[] Game_Judge_Meter_GoodRate = new int[] { 206, 532 }; + public int[] Game_Judge_Meter_MissRate = new int[] { 206, 570 }; + + public int[] Game_Judge_4P = new int[] { 364, 32 }; + public int[] Game_Judge_5P = new int[] { 364, 24 }; + + public int[] Game_UIMove_4P = new int[] { 0, 176 }; + public int[] Game_UIMove_5P = new int[] { 0, 144 }; + + public int[] Game_ScoreRank_4P = new int[] { 87, 88 }; + public int[] Game_ScoreRank_5P = new int[] { 87, 80 }; + + public DBSkinPreset.SkinPreset Game_SkinScenes = null; + + #region Chara + + public int[] Game_Chara_X = new int[] { 0, 0 }; + public int[] Game_Chara_Y = new int[] { 0, 537 }; + public int[] Game_Chara_Balloon_X = new int[] { 240, 240, 0, 0 }; + public int[] Game_Chara_Balloon_Y = new int[] { 0, 297, 0, 0 }; + public int Game_Chara_Ptn_Normal, + Game_Chara_Ptn_GoGo, + Game_Chara_Ptn_Clear, + Game_Chara_Ptn_10combo, + Game_Chara_Ptn_10combo_Max, + Game_Chara_Ptn_GoGoStart, + Game_Chara_Ptn_GoGoStart_Max, + Game_Chara_Ptn_ClearIn, + Game_Chara_Ptn_SoulIn, + Game_Chara_Ptn_Balloon_Breaking, + Game_Chara_Ptn_Balloon_Broke, + Game_Chara_Ptn_Balloon_Miss; + public string Game_Chara_Motion_Normal, + Game_Chara_Motion_Clear, + Game_Chara_Motion_GoGo = "0"; + public int Game_Chara_Beat_Normal = 1; + public int Game_Chara_Beat_Clear = 2; + public int Game_Chara_Beat_GoGo = 2; + public int Game_Chara_Balloon_Timer = 28; + public int Game_Chara_Balloon_Delay = 500; + public int Game_Chara_Balloon_FadeOut = 84; + + #endregion + + #region Dancer + + public int[] Game_Dancer_X = new int[] { 640, 430, 856, 215, 1070 }; + public int[] Game_Dancer_Y = new int[] { 500, 500, 500, 500, 500 }; + public string Game_Dancer_Motion = "0"; + public int[] Game_Dancer_Gauge = new int[] { 0, 0, 0, 40, 80 }; + + #endregion + + #region Tower + + public int Game_Tower_Ptn; + public int[] Game_Tower_Ptn_Deco, + Game_Tower_Ptn_Base; + + public string[] Game_Tower_Names; + public int Game_Tower_Ptn_Result; + + public int Game_Tower_Ptn_Don; + + #endregion + + #region Mob + public int Game_Mob_Beat, + Game_Mob_Ptn_Beat = 1; + #endregion + #region CourseSymbol + public int[] Game_CourseSymbol_X = new int[] { -4, -4 }; + public int[] Game_CourseSymbol_Y = new int[] { 232, 582 }; + public int[] Game_CourseSymbol_Back_X = new int[] { 280, 280 }; + public int[] Game_CourseSymbol_Back_Y = new int[] { -110, 427 }; + + public int[] Game_CourseSymbol_4P = new int[] { -4, 56 }; + public int[] Game_CourseSymbol_5P = new int[] { -4, 48 }; + + public int[] Game_CourseSymbol_Back_4P = new int[] { 896, 47 }; + public int[] Game_CourseSymbol_Back_5P = new int[] { 896, 39 }; + + public int[] Game_CourseSymbol_Back_Rect_4P = new int[] { 0, 128, 384, 129 }; + public int[] Game_CourseSymbol_Back_Rect_5P = new int[] { 0, 140, 384, 105 }; + #endregion + #region PanelFont + public int Game_MusicName_X = 1260; + public int Game_MusicName_Y = 24; + public int Game_MusicName_FontSize = 27; + public int Game_MusicName_MaxWidth = 660; + public ReferencePoint Game_MusicName_ReferencePoint = ReferencePoint.Center; + public int Game_Genre_X = 1015; + public int Game_Genre_Y = 70; + public int[] Game_GenreText_Offset = new int[2] { 145, 23 }; + public int Game_GenreText_FontSize = 12; + public int Game_Lyric_X = 640; + public int Game_Lyric_Y = 630; + public string Game_Lyric_FontName = CFontRenderer.DefaultFontName; + public int Game_Lyric_FontSize = 38; + public int Game_Lyric_VTTRubyOffset = 65; + public ReferencePoint Game_Lyric_ReferencePoint = ReferencePoint.Center; + + public Color Game_MusicName_ForeColor = ColorTranslator.FromHtml("#FFFFFF"); + public Color Game_StageText_ForeColor = ColorTranslator.FromHtml("#FFFFFF"); + public Color Game_Lyric_ForeColor = ColorTranslator.FromHtml("#FFFFFF"); + public Color Game_MusicName_BackColor = ColorTranslator.FromHtml("#000000"); + public Color Game_StageText_BackColor = ColorTranslator.FromHtml("#000000"); + public Color Game_Lyric_BackColor = ColorTranslator.FromHtml("#0000FF"); + public Color[] Game_Lyric_VTTForeColor = new Color[] { Color.White, Color.Lime, Color.Cyan, Color.Red, Color.Yellow, Color.Magenta, Color.Blue, Color.Black }; + public Color[] Game_Lyric_VTTBackColor = new Color[] { Color.White, Color.Lime, Color.Cyan, Color.Red, Color.Yellow, Color.Magenta, Color.Blue, Color.Black }; + + #endregion + #region Score + public int[] Game_Score_X = new int[] { 20, 20, 0, 0 }; + public int[] Game_Score_Y = new int[] { 226, 530, 0, 0 }; + public int[] Game_Score_Add_X = new int[] { 20, 20, 0, 0 }; + public int[] Game_Score_Add_Y = new int[] { 186, 570, 0, 0 }; + public int[] Game_Score_AddBonus_X = new int[] { 20, 20, 0, 0 }; + public int[] Game_Score_AddBonus_Y = new int[] { 136, 626, 0, 0 }; + public int Game_Score_Padding = 20; + public int[] Game_Score_Size = new int[] { 24, 40 }; + + public int[] Game_Score_4P = new int[] { 20, 54 }; + public int[] Game_Score_5P = new int[] { 20, 46 }; + + public int[] Game_Score_Add_4P = new int[] { 20, 94 }; + public int[] Game_Score_Add_5P = new int[] { 20, 86 }; + + public int[] Game_Score_AddBonus_4P = new int[] { 20, 134 }; + public int[] Game_Score_AddBonus_5P = new int[] { 20, 126 }; + #endregion + #region Taiko + public int[] Game_Taiko_Background_X = new int[] { 0, 0 }; + public int[] Game_Taiko_Background_Y = new int[] { 184, 360 }; + + public int[] Game_Taiko_ModIcons_X = new int[] { 80, 80 }; + public int[] Game_Taiko_ModIcons_Y = new int[] { 236, 426 }; + public int[] Game_Taiko_NamePlate_X = new int[] { -5, -5 }; + public int[] Game_Taiko_NamePlate_Y = new int[] { 297, 371 }; + public int[] Game_Taiko_PlayerNumber_X = new int[] { 4, 4 }; + public int[] Game_Taiko_PlayerNumber_Y = new int[] { 233, 435 }; + public int[] Game_Taiko_X = new int[] { 205, 205 }; + public int[] Game_Taiko_Y = new int[] { 206, 384 }; + public int[] Game_Taiko_Combo_X = new int[] { 267, 267 }; + public int[] Game_Taiko_Combo_Y = new int[] { 272, 447 }; + public int[] Game_Taiko_Combo_Ex_X = new int[] { 267, 267 }; + public int[] Game_Taiko_Combo_Ex_Y = new int[] { 274, 451 }; + public int[] Game_Taiko_Combo_Ex4_X = new int[] { 267, 267 }; + public int[] Game_Taiko_Combo_Ex4_Y = new int[] { 269, 447 }; + public int[] Game_Taiko_Combo_Padding = new int[] { 34, 34, 30 }; + public int[] Game_Taiko_Combo_Size = new int[] { 40, 48 }; + public int[] Game_Taiko_Combo_Size_Ex = new int[] { 40, 48 }; + public float[] Game_Taiko_Combo_Scale = new float[] { 1.0f, 1.0f, 0.9f }; + public int[] Game_Taiko_Combo_Text_X = new int[] { 268, 268 }; + public int[] Game_Taiko_Combo_Text_Y = new int[] { 298, 475 }; + public int[] Game_Taiko_Combo_Text_Size = new int[] { 100, 50 }; + public bool Game_Taiko_Combo_Ex_IsJumping = true; + public int[] Game_Taiko_LevelChange_X = new int[] { 311, 311 }; + public int[] Game_Taiko_LevelChange_Y = new int[] { 154, 566 }; + public int[] Game_Taiko_Frame_X = new int[] { 329, 329 }; + public int[] Game_Taiko_Frame_Y = new int[] { 136, 360 }; + + + public int[] Game_Taiko_Background_4P = new int[] { 0, 8 }; + public int[] Game_Taiko_Background_5P = new int[] { 0, 0 }; + + public int[] Game_Taiko_ModIcons_4P = new int[] { 80, 60 }; + public int[] Game_Taiko_ModIcons_5P = new int[] { 80, 50 }; + + public int[] Game_Taiko_NamePlate_4P = new int[] { -55, 121 }; + public int[] Game_Taiko_NamePlate_5P = new int[] { -55, 97 }; + + public int[] Game_Taiko_PlayerNumber_4P = new int[] { 4, 57 }; + public int[] Game_Taiko_PlayerNumber_5P = new int[] { 4, 49 }; + + public int[] Game_Taiko_4P = new int[] { 205, 30 }; + public int[] Game_Taiko_5P = new int[] { 205, 22 }; + + public int[] Game_Taiko_Combo_4P = new int[] { 267, 73 }; + public int[] Game_Taiko_Combo_5P = new int[] { 267, 65 }; + + public int[] Game_Taiko_Combo_Ex_4P = new int[] { 267, 75 }; + public int[] Game_Taiko_Combo_Ex_5P = new int[] { 267, 67 }; + + public int[] Game_Taiko_Combo_Ex4_4P = new int[] { 267, 70 }; + public int[] Game_Taiko_Combo_Ex4_5P = new int[] { 267, 62 }; + + public int[] Game_Taiko_Combo_Text_4P = new int[] { 268, 99 }; + public int[] Game_Taiko_Combo_Text_5P = new int[] { 268, 91 }; + + public int[] Game_Taiko_Frame_4P = new int[] { 333, 8 }; + public int[] Game_Taiko_Frame_5P = new int[] { 333, 0 }; + + #endregion + #region Gauge + public int[] Game_Gauge_X = new int[] { 492, 492 }; + public int[] Game_Gauge_Y = new int[] { 144, 532 }; + public int Game_Gauge_X_AI = 650; + public int Game_Gauge_Y_AI = 153; + public int[] Game_Gauge_Rect = new int[] { 0, 0, 700, 44 }; + public int[] Game_Gauge_ClearText_X = new int[] { 1038, 1038 }; + public int[] Game_Gauge_ClearText_Y = new int[] { 144, 554 }; + public int Game_Gauge_ClearText_X_AI = 1087; + public int Game_Gauge_ClearText_Y_AI = 153; + public int[] Game_Gauge_ClearText_Rect = new int[] { 0, 44, 58, 24 }; + public int[] Game_Gauge_ClearText_Clear_Rect = new int[] { 58, 44, 58, 24 }; + public int[] Gauge_Soul_X = new int[] { 1184, 1184 }; + public int[] Gauge_Soul_Y = new int[] { 125, 516 }; + public int Gauge_Soul_X_AI = 1200; + public int Gauge_Soul_Y_AI = 140; + public int Gauge_Soul_X_Tower = 958; + public int Gauge_Soul_Y_Tower = 95; + public int[] Gauge_Soul_Fire_X = new int[] { 1112, 1112 }; + public int[] Gauge_Soul_Fire_Y = new int[] { 52, 443 }; + public int Gauge_Soul_Fire_X_AI = 1143; + public int Gauge_Soul_Fire_Y_AI = 83; + public int Gauge_Soul_Fire_X_Tower = 886; + public int Gauge_Soul_Fire_Y_Tower = 22; + public int Game_Gauge_Rainbow_Ptn; + public int Game_Gauge_Rainbow_2PGauge_Ptn; + public int Game_Gauge_Rainbow_Flat_Ptn; + public int Game_Gauge_Dan_Rainbow_Ptn; + public int Game_Gauge_Rainbow_Timer = 50; + + public int[] Game_Gauge_4P = new int[] { 492, -4 }; + public int[] Game_Gauge_5P = new int[] { 492, -12 }; + + public int[] Gauge_Soul_4P = new int[] { 1184, -12 }; + public int[] Gauge_Soul_5P = new int[] { 1184, -20 }; + + public int[] Gauge_Soul_Fire_4P = new int[] { 1112, -85 }; + public int[] Gauge_Soul_Fire_5P = new int[] { 1112, -93 }; + + #endregion + #region Balloon + public int[] Game_Balloon_Combo_X = new int[] { 253, 253 }; + public int[] Game_Balloon_Combo_Y = new int[] { -11, 538 }; + public int[] Game_Balloon_Combo_Number_X = new int[] { 257, 257 }; + public int[] Game_Balloon_Combo_Number_Y = new int[] { 54, 603 }; + public int[] Game_Balloon_Combo_Number_Ex_X = new int[] { 257, 257 }; + public int[] Game_Balloon_Combo_Number_Ex_Y = new int[] { 54, 603 }; + public int[] Game_Balloon_Combo_Number_Size = new int[] { 53, 62 }; + public int[] Game_Balloon_Combo_Number_Interval = new int[] { 45, 0 }; + public int[] Game_Balloon_Combo_Text_X = new int[] { 440, 440 }; + public int[] Game_Balloon_Combo_Text_Y = new int[] { 85, 634 }; + public int[] Game_Balloon_Combo_Text_Ex_X = new int[] { 440, 440 }; + public int[] Game_Balloon_Combo_Text_Ex_Y = new int[] { 85, 594 }; + public int[] Game_Balloon_Combo_Text_Rect = new int[] { 0, 124, 100, 30 }; + + public int[] Game_Balloon_Balloon_X = new int[] { 382, 382 }; + public int[] Game_Balloon_Balloon_Y = new int[] { 115, 290 }; + public int[] Game_Balloon_Balloon_Frame_X = new int[] { 382, 382 }; + public int[] Game_Balloon_Balloon_Frame_Y = new int[] { 80, 260 }; + public int[] Game_Balloon_Balloon_Number_X = new int[] { 423, 423 }; + public int[] Game_Balloon_Balloon_Number_Y = new int[] { 187, 373 }; + public int[] Game_Balloon_Roll_Frame_X = new int[] { 218, 218 }; + public int[] Game_Balloon_Roll_Frame_Y = new int[] { -3, 514 }; + public int[] Game_Balloon_Roll_Number_X = new int[] { 313, 313 }; + public int[] Game_Balloon_Roll_Number_Y = new int[] { 122, 633 }; + public int[] Game_Balloon_Number_Size = new int[] { 63, 75 }; + public int[] Game_Balloon_Number_Interval = new int[] { 55, 0 }; + public float Game_Balloon_Roll_Number_Scale = 1.000f; + public float Game_Balloon_Balloon_Number_Scale = 0.879f; + + public int[] Game_Balloon_Balloon_4P = new int[] { 382, -61 }; + public int[] Game_Balloon_Balloon_5P = new int[] { 382, -53 }; + + public int[] Game_Balloon_Balloon_Frame_4P = new int[] { 382, -12 }; + public int[] Game_Balloon_Balloon_Frame_5P = new int[] { 382, -4 }; + + public int[] Game_Balloon_Balloon_Number_4P = new int[] { 423, 95 }; + public int[] Game_Balloon_Balloon_Number_5P = new int[] { 423, 87 }; + + public int Game_Kusudama_Number_X = 960; + public int Game_Kusudama_Number_Y = 540; + #endregion + #region Effects + public int[] Game_Effect_Roll_StartPoint_X = new int[] { 56, -10, 200, 345, 100, 451, 600, 260, -30, 534, 156, 363 }; + public int[] Game_Effect_Roll_StartPoint_Y = new int[] { 720 }; + public int[] Game_Effect_Roll_StartPoint_1P_X = new int[] { 56, -10, 200, 345, 100, 451, 600, 260, -30, 534, 156, 363 }; + public int[] Game_Effect_Roll_StartPoint_1P_Y = new int[] { 240 }; + public int[] Game_Effect_Roll_StartPoint_2P_X = new int[] { 56, -10, 200, 345, 100, 451, 600, 260, -30, 534, 156, 363 }; + public int[] Game_Effect_Roll_StartPoint_2P_Y = new int[] { 360 }; + public float[] Game_Effect_Roll_Speed_X = new float[] { 0.6f }; + public float[] Game_Effect_Roll_Speed_Y = new float[] { -0.6f }; + public float[] Game_Effect_Roll_Speed_1P_X = new float[] { 0.6f }; + public float[] Game_Effect_Roll_Speed_1P_Y = new float[] { -0.6f }; + public float[] Game_Effect_Roll_Speed_2P_X = new float[] { 0.6f }; + public float[] Game_Effect_Roll_Speed_2P_Y = new float[] { 0.6f }; + public int Game_Effect_Roll_Ptn; + public int[] Game_Effect_NotesFlash = new int[] { 180, 180, 16 }; // Width, Height, Ptn + public int Game_Effect_NotesFlash_Timer = 20; + public int[] Game_Effect_GoGoSplash = new int[] { 300, 400, 30 }; + public int[] Game_Effect_GoGoSplash_X = new int[] { 120, 300, 520, 760, 980, 1160 }; + public int[] Game_Effect_GoGoSplash_Y = new int[] { 740, 730, 720, 720, 730, 740 }; + public bool Game_Effect_GoGoSplash_Rotate = true; + public int Game_Effect_GoGoSplash_Timer = 18; + // super-flying-notes AioiLight + public int[] Game_Effect_FlyingNotes_StartPoint_X = new int[] { 414, 414 }; + public int[] Game_Effect_FlyingNotes_StartPoint_Y = new int[] { 260, 434 }; + public int[] Game_Effect_FlyingNotes_EndPoint_X = new int[] { 1222, 1222 }; // 1P, 2P + public int[] Game_Effect_FlyingNotes_EndPoint_Y = new int[] { 164, 554 }; + public int[] Game_Effect_FlyingNotes_EndPoint_X_AI = new int[] { 1222, 1222 }; // 1P, 2P + public int[] Game_Effect_FlyingNotes_EndPoint_Y_AI = new int[] { -230, 820 }; + + public int Game_Effect_FlyingNotes_Sine = 220; + public bool Game_Effect_FlyingNotes_IsUsingEasing = true; + public int Game_Effect_FlyingNotes_Timer = 4; + public int[] Game_Effect_FireWorks = new int[] { 180, 180, 30 }; + public int Game_Effect_FireWorks_Timer = 5; + public int[] Game_Effect_Rainbow_X = new int[] { 360, 360 }; + public int[] Game_Effect_Rainbow_Y = new int[] { -100, 410 }; + public int Game_Effect_Rainbow_Timer = 8; + + public int[] Game_Effects_Hit_Explosion_X = new int[] { 284, 284 }; + public int[] Game_Effects_Hit_Explosion_Y = new int[] { 126, 303 }; + + public bool Game_Effect_HitExplosion_AddBlend = true; + public bool Game_Effect_HitExplosionBig_AddBlend = true; + + public int[] Game_Effect_Fire_X = new int[] { 240, 240 }; + public int[] Game_Effect_Fire_Y = new int[] { 71, 248 }; + + public bool Game_Effect_FireWorks_AddBlend = true; + public bool Game_Effect_Fire_AddBlend = true; + public bool Game_Effect_GoGoSplash_AddBlend = true; + public int Game_Effect_FireWorks_Timing = 8; + + public int[] Game_Effects_Hit_Explosion_4P = new int[] { 284, -20 }; + public int[] Game_Effects_Hit_Explosion_5P = new int[] { 284, -39 }; + + public int[] Game_Effect_Fire_4P = new int[] { 240, -75 }; + public int[] Game_Effect_Fire_5P = new int[] { 240, -94 }; + #endregion + #region Lane + public int[] Game_Lane_X = new int[] { 333, 333 }; + public int[] Game_Lane_Y = new int[] { 192, 368 }; + public int[] Game_Lane_Sub_X = new int[] { 333, 333 }; + public int[] Game_Lane_Sub_Y = new int[] { 326, 502 }; + + public int[] Game_Lane_4P = new int[] { 333, 46 }; + public int[] Game_Lane_5P = new int[] { 333, 39 }; + #endregion + #region Runner + #endregion + #region PuchiChara + public int[] Game_PuchiChara_X = new int[] { 100, 100 }; + public int[] Game_PuchiChara_Y = new int[] { 140, 675 }; + public int[] Game_PuchiChara_4P = new int[] { 230, 162 }; + public int[] Game_PuchiChara_5P = new int[] { 230, 150 }; + public int[] Game_PuchiChara_BalloonX = new int[] { 300, 300 }; + public int[] Game_PuchiChara_BalloonY = new int[] { 240, 500 }; + public int[] Game_PuchiChara_KusudamaX = new int[] { 290, 690, 90, 890, 490 }; + public int[] Game_PuchiChara_KusudamaY = new int[] { 420, 420, 420, 420, 420 }; + public float[] Game_PuchiChara_Scale = new float[] { 0.6f, 0.8f }; // 通常時、 ふうせん連打時 + public int[] Game_PuchiChara = new int[] { 256, 256, 2 }; // Width, Height, Ptn + public int Game_PuchiChara_Sine = 20; + public int Game_PuchiChara_Timer = 4800; + public double Game_PuchiChara_SineTimer = 2; + #endregion + #region Dan-C + public Color Game_DanC_Title_ForeColor = ColorTranslator.FromHtml("#FFFFFF"); + public Color Game_DanC_Title_BackColor = ColorTranslator.FromHtml("#000000"); + public Color Game_DanC_SubTitle_ForeColor = ColorTranslator.FromHtml("#FFFFFF"); + public Color Game_DanC_SubTitle_BackColor = ColorTranslator.FromHtml("#000000"); + + public int[] Game_DanC_Size = new int[] { 1006, 92 }; + public int[] Game_DanC_Number_Size = new int[] { 48, 58 }; + public int[] Game_DanC_Small_Number_Size = new int[] { 24, 29 }; + public int[] Game_DanC_MiniNumber_Size = new int[] { 23, 28 }; + public int[] Game_DanC_ExamType_Size = new int[] { 247, 28 }; + public int[] Game_DanC_ExamRange_Size = new int[] { 54, 30 }; + public int[] Game_DanC_ExamUnit_Size = new int[] { 30, 36 }; + + public int[] Game_DanC_Offset = new int[] { 259, 27 }; + public int[] Game_DanC_Number_Small_Number_Offset = new int[] { 285, 38 }; + public int[] Game_DanC_Exam_Offset = new int[] { 222, 27 }; + + public int[] Game_DanC_X = new int[] { 807, 70, 70, 70 }; // 329, 437 + public int[] Game_DanC_Y = new int[] { 116, 292, 292, 292 }; // { 116, 190, 236, 292 }; + public int[] Game_DanC_Base_Offset_X = new int[] { 0, 503 }; + public int[] Game_DanC_Base_Offset_Y = new int[] { 0, 0 }; + public int[] Game_DanC_SmallBase_Offset_X = new int[] { 745, 410 }; + public int[] Game_DanC_SmallBase_Offset_Y = new int[] { 119, 119 }; + public int[] Game_DanC_Number_XY = new int[] { 214, 67 }; + public int[] Game_DanC_Dan_Plate = new int[] { 149, 416 }; + + public int[] Game_DanC_DanIcon_Offset = new int[] { 44, 57 }; + public int[] Game_DanC_DanIcon_Offset_Mini = new int[] { -19, 11 }; + + public int[] Game_DanC_Title_X = new int[] { 806, 806 }; + public int[] Game_DanC_Title_Y = new int[] { 257, 237 }; + public int[] Game_DanC_SubTitle = new int[] { 806, 277 }; + + + public int Game_DanC_Title_Size = 30; + public int Game_DanC_SubTitle_Size = 22; + public int Game_DanC_ExamFont_Size = 14; + + public int Game_DanC_Title_MaxWidth = 710; + public int Game_DanC_SubTitle_MaxWidth = 710; + + public int Game_DanC_Padding = 9; + public int Game_DanC_Number_Padding = 35; + public int Game_DanC_Number_Small_Padding = 41; + public int Game_DanC_ExamRange_Padding = 49; + public int[] Game_DanC_Percent_Hit_Score_Padding = new int[] { 20, 20, 20 }; + + public float Game_DanC_Number_Small_Scale = 0.92f; + public float Game_DanC_Exam_Number_Scale = 0.47f; + + #endregion + #region Training + public int[] Game_Training_DownBG = new int[] { 0, 360 }; + public int[] Game_Training_BigTaiko = new int[] { 334, 400 }; + public int[] Game_Training_Speed_Measure = new int[] { 0, 360 }; + public int Game_Training_ScrollTime = 350; + public int[] Game_Training_ProgressBar_XY = { 333, 378 }; + public int Game_Training_GoGoPoint_Y = 396; + public int Game_Training_JumpPoint_Y = 375; + public int[] Game_Training_MaxMeasureCount_XY = { 284, 377 }; + public int[] Game_Training_CurrentMeasureCount_XY = { 254, 370 }; + public int[] Game_Training_SpeedDisplay_XY = { 110, 370 }; + public int Game_Training_SmallNumber_Width = 17; + public int Game_Training_BigNumber_Width = 20; + #endregion + #region Tower + public int[] Game_Tower_Sky_Gradient = new int[] { 0, 360 }; + public int[] Game_Tower_Sky_Gradient_Size = new int[] { 1280, 316 }; + + public int[] Game_Tower_Floors_Body = new int[] { 640, 676 }; + public int[] Game_Tower_Floors_Deco = new int[] { 460, 640 }; + public int[] Game_Tower_Floors_Move = new int[] { 0, 288 }; + + public int[] Game_Tower_Don = new int[] { 590, 648 }; + public int[] Game_Tower_Don_Move = new int[] { 300, 0 }; + + public int[] Game_Tower_Miss = new int[] { 640, 520 }; + + public int[] Game_Tower_Floor_Number = new int[] { 556, 84 }; + + public int[] Game_Tower_Life_Number = new int[] { 996, 106 }; + + public int[] Game_Tower_Font_TouTatsuKaiSuu = new int[] { 350, 32 }; + public int[] Game_Tower_Font_Kai = new int[] { 550, 104 }; + + public int Game_Tower_Font_TowerText = 28; + #endregion + #region AIBattle + public int Game_AIBattle_CharaMove = 71; + + public int[] Game_AIBattle_SectionTime_Panel = new int[] { 202, 178 }; + public int[] Game_AIBattle_SectionTime_Bar = new int[] { 205, 193 }; + + public int[] Game_AIBattle_Batch_Base = new int[] { 150, 83 }; + + public int[] Game_AIBattle_Batch = new int[] { 150, 83 }; + public int[] Game_AIBattle_Batch_Size = new int[] { 70, 70 }; + + public int[] Game_AIBattle_Batch_Anime = new int[] { 260, -35 }; + public int[] Game_AIBattle_Batch_Anime_Size = new int[] { 274, 274 }; + + public int[] Game_AIBattle_Batch_Move = new int[] { 30, 15 }; + + public int[] Game_AIBattle_Judge_Meter_X = new int[] { 3, 3 }; + public int[] Game_AIBattle_Judge_Meter_Y = new int[] { 55, 418 }; + + public int[] Game_AIBattle_Judge_Number_Perfect_X = new int[] { 107, 107 }; + public int[] Game_AIBattle_Judge_Number_Perfect_Y = new int[] { 74, 437 }; + + public int[] Game_AIBattle_Judge_Number_Good_X = new int[] { 107, 107 }; + public int[] Game_AIBattle_Judge_Number_Good_Y = new int[] { 91, 454 }; + + public int[] Game_AIBattle_Judge_Number_Miss_X = new int[] { 107, 107 }; + public int[] Game_AIBattle_Judge_Number_Miss_Y = new int[] { 108, 471 }; + + public int[] Game_AIBattle_Judge_Number_Roll_X = new int[] { 107, 107 }; + public int[] Game_AIBattle_Judge_Number_Roll_Y = new int[] { 125, 488 }; + + public int[] Game_AIBattle_Judge_Number_Interval = new int[] { 10, 0 }; + #endregion + + #endregion + #region Result + + public bool Result_Use1PUI = false; + public int[] Result_UIMove_4P_X = new int[] { 0, 320, 640, 960 }; + public int[] Result_UIMove_4P_Y = new int[] { 0, 0, 0, 0 }; + public int[] Result_UIMove_5P_X = new int[] { 0, 256, 512, 768, 1024 }; + public int[] Result_UIMove_5P_Y = new int[] { 0, 0, 0, 0, 0 }; + + public int Result_Cloud_Count = 11; + public int[] Result_Cloud_X = new int[] { 642, 612, 652, 1148, 1180, 112, 8, 1088, 1100, 32, 412 }; + public int[] Result_Cloud_Y = new int[] { 202, 424, 636, 530, 636, 636, 102, 52, 108, 326, 644 }; + public int[] Result_Cloud_MaxMove = new int[] { 150, 120, 180, 60, 90, 150, 120, 50, 45, 120, 180 }; + + public int Result_Shine_Count = 6; + public int[][] Result_Shine_X = new int[][] { + new int[] { 885, 1255, 725, 890, 1158, 1140 }, + new int[] { 395, 25, 555, 390, 122, 140 }, + }; + public int[][] Result_Shine_Y = new int[][] { + new int[] { 650, 405, 645, 420, 202, 585 }, + new int[] { 650, 405, 645, 420, 202, 585 } + }; + public float[] Result_Shine_Size = { 0.44f, 0.6f, 0.4f, 0.15f, 0.35f, 0.6f }; + + public int[][] Result_Work_X = new int[][] { + new int[] { 800, 900, 1160 }, + new int[] { 480, 380, 120 } + }; + public int[][] Result_Work_Y = new int[][] { + new int[] { 435, 185, 260 }, + new int[] { 435, 185, 260 } + }; + + public int[] Result_DifficultyBar_Size = new int[] { 185, 54 }; + public int[] Result_DifficultyBar_X = new int[] { 18, 653 }; + public int[] Result_DifficultyBar_Y = new int[] { 101, 101 }; + + public int[] Result_Gauge_Base_X = new int[] { 55, 690 }; + public int[] Result_Gauge_Base_Y = new int[] { 140, 140 }; + + public int[] Result_Gauge_X = new int[] { 57, 692 }; + public int[] Result_Gauge_Y = new int[] { 140, 140 }; + public int[] Result_Gauge_Rect = new int[] { 0, 0, 487, 36 }; + + public int[] Result_Gauge_Rainbow_X = new int[] { 57, 692 }; + public int[] Result_Gauge_Rainbow_Y = new int[] { 144, 144 }; + public int Result_Gauge_Rainbow_Ptn; + public int Result_Gauge_Rainbow_Interval = 1000 / 60; + + public int[] Result_Gauge_ClearText_X = new int[] { 441, 1076 }; + public int[] Result_Gauge_ClearText_Y = new int[] { 142, 142 }; + public int[] Result_Gauge_ClearText_Rect = new int[] { 0, 35, 42, 20 }; + public int[] Result_Gauge_ClearText_Clear_Rect = new int[] { 42, 35, 42, 20 }; + + public int[] Result_Number_Interval = new int[] { 22, 0 }; + + public float Result_Number_Scale_4P = 1.0f; + + public float Result_Number_Scale_5P = 1.0f; + + public int[] Result_Soul_Fire_X = new int[] { 576, 1211 }; + public int[] Result_Soul_Fire_Y = new int[] { 160, 160 }; + + public int[] Result_Soul_Text_X = new int[] { 575, 1210 }; + public int[] Result_Soul_Text_Y = new int[] { 159, 159 }; + + public int[] Result_Perfect_X = new int[] { 490, 1125 }; + public int[] Result_Perfect_Y = new int[] { 188, 188 }; + + public int[] Result_Good_X = new int[] { 490, 1125 }; + public int[] Result_Good_Y = new int[] { 230, 230 }; + + public int[] Result_Miss_X = new int[] { 490, 1125 }; + public int[] Result_Miss_Y = new int[] { 272, 272 }; + + public int[] Result_Roll_X = new int[] { 490, 1125 }; + public int[] Result_Roll_Y = new int[] { 314, 314 }; + + public int[] Result_MaxCombo_X = new int[] { 490, 1125 }; + public int[] Result_MaxCombo_Y = new int[] { 356, 356 }; + + public bool Result_ADLib_Show = false; + public int[] Result_ADLib_X = new int[] { 0, 0 }; + public int[] Result_ADLib_Y = new int[] { 0, 0 }; + + public bool Result_Bomb_Show = false; + public int[] Result_Bomb_X = new int[] { 0, 0 }; + public int[] Result_Bomb_Y = new int[] { 0, 0 }; + + public int[] Result_Score_X = new int[] { 295, 930 }; + public int[] Result_Score_Y = new int[] { 212, 212 }; + public int[] Result_Score_Number_Interval = new int[] { 33, 0 }; + + public float Result_Score_Scale_4P = 1.0f; + public float Result_Score_Scale_5P = 1.0f; + + public int[] Result_ScoreRankEffect_X = new int[] { 135, 770 }; + public int[] Result_ScoreRankEffect_Y = new int[] { 339, 339 }; + + public int[] Result_CrownEffect_X = new int[] { 262, 897 }; + public int[] Result_CrownEffect_Y = new int[] { 336, 336 }; + + public int[] Result_Speech_Bubble_X = new int[] { 430, 850 }; + public int[] Result_Speech_Bubble_Y = new int[] { 526, 526 }; + + public int[] Result_Speech_Bubble_V2_X = new int[] { 0, 0 }; + public int[] Result_Speech_Bubble_V2_Y = new int[] { 0, 0 }; + + public int[] Result_Speech_Bubble_V2_2P_X = new int[] { 0, 0 }; + public int[] Result_Speech_Bubble_V2_2P_Y = new int[] { 0, 0 }; + + public int[] Result_NamePlate_X = new int[] { 28, 1032 }; + public int[] Result_NamePlate_Y = new int[] { 621, 621 }; + + public int[] Result_ModIcons_X = new int[] { 32, 1028 }; + public int[] Result_ModIcons_Y = new int[] { 678, 678 }; + + public int[] Result_Flower_X = new int[] { 182, 1098 }; + public int[] Result_Flower_Y = new int[] { 602, 602 }; + + public int[][] Result_Flower_Rotate_X = new int[][] { + new int[] { 48, 125, 48, 240, 87 }, + new int[] { 964, 1041, 964, 1156, 1003 }, + }; + public int[][] Result_Flower_Rotate_Y = new int[][] { + new int[] { 549, 585, 546, 501, 509 }, + new int[] { 549, 585, 546, 501, 509 } + }; + + public int Result_PlateShine_Count = 6; + public int[][] Result_PlateShine_X = new int[][] { + new int[] { 333, 342, 184, 198, 189, 309 }, + new int[] { 1249, 1258, 1100, 1114, 1105, 1225 } + }; + public int[][] Result_PlateShine_Y = new int[][] { + new int[] { 670, 620, 650, 687, 558, 542 }, + new int[] { 670, 620, 650, 687, 558, 542 } + }; + + public int Result_MusicName_X = 640; + public int Result_MusicName_Y = 30; + public int Result_MusicName_FontSize = 25; + public int Result_MusicName_MaxSize = 660; + public ReferencePoint Result_MusicName_ReferencePoint = ReferencePoint.Center; + public int Result_StageText_X = 230; + public int Result_StageText_Y = 6; + public int Result_StageText_FontSize = 30; + public ReferencePoint Result_StageText_ReferencePoint = ReferencePoint.Left; + + public Color Result_MusicName_ForeColor = ColorTranslator.FromHtml("#FFFFFF"); + public Color Result_StageText_ForeColor = ColorTranslator.FromHtml("#FFFFFF"); + public Color Result_MusicName_BackColor = ColorTranslator.FromHtml("#000000"); + public Color Result_StageText_BackColor = ColorTranslator.FromHtml("#000000"); + + public int[] Result_Dan = new int[] { 500, 500 }; + public int[] Result_Dan_XY = new int[] { 0, 420 }; + public int[] Result_Dan_Plate_XY = new int[] { 149, 149 }; + + public int[] Result_DifficultyBar_4P = new int[] { 6, 101 }; + public int[] Result_DifficultyBar_5P = new int[] { -9, 101 }; + + public int[] Result_Gauge_Base_4P = new int[] { 25, 140 }; + public int[] Result_Gauge_Base_5P = new int[] { 4, 140 }; + + public int[] Result_Gauge_4P = new int[] { 27, 140 }; + public int[] Result_Gauge_5P = new int[] { 6, 140 }; + + public int[] Result_Gauge_ClearText_4P = new int[] { 218, 142 }; + public int[] Result_Gauge_ClearText_5P = new int[] { 197, 142 }; + + public int[] Result_Gauge_Rainbow_4P = new int[] { 26, 144 }; + public int[] Result_Gauge_Rainbow_5P = new int[] { 5, 144 }; + + public int[] Result_Soul_Fire_4P = new int[] { 284, 160 }; + public int[] Result_Soul_Fire_5P = new int[] { 232, 120 }; + + public int[] Result_Soul_Text_4P = new int[] { 283, 159 }; + public int[] Result_Soul_Text_5P = new int[] { 231, 119 }; + + public int[] Result_Perfect_4P = new int[] { 183, 251 }; + public int[] Result_Perfect_5P = new int[] { 151, 251 }; + + public int[] Result_Good_4P = new int[] { 183, 293 }; + public int[] Result_Good_5P = new int[] { 151, 293 }; + + public int[] Result_Miss_4P = new int[] { 183, 335 }; + public int[] Result_Miss_5P = new int[] { 151, 335 }; + + public int[] Result_Roll_4P = new int[] { 183, 377 }; + public int[] Result_Roll_5P = new int[] { 151, 377 }; + + public int[] Result_MaxCombo_4P = new int[] { 183, 419 }; + public int[] Result_MaxCombo_5P = new int[] { 151, 419 }; + + public int[] Result_ADLib_4P = new int[] { 0, 0 }; + public int[] Result_ADLib_5P = new int[] { 0, 0 }; + + public int[] Result_Bomb_4P = new int[] { 0, 0 }; + public int[] Result_Bomb_5P = new int[] { 0, 0 }; + + public int[] Result_Score_4P = new int[] { 253, 180 }; + public int[] Result_Score_5P = new int[] { 221, 180 }; + + public int[] Result_ScoreRankEffect_4P = new int[] { 100, 545 }; + public int[] Result_ScoreRankEffect_5P = new int[] { 68, 545 }; + + public int[] Result_CrownEffect_4P = new int[] { 220, 545 }; + public int[] Result_CrownEffect_5P = new int[] { 188, 545 }; + + + public int[] Result_Speech_Bubble_V2_4P = new int[] { 0, 0 }; + + public int[] Result_Speech_Bubble_V2_5P = new int[] { 0, 0 }; + + + public int[] Result_Speech_Text_Offset = new int[] { 0, 0 }; + public int Result_Speech_Text_Size = 60; + public int Result_Speech_Text_MaxWidth = 560; + + public int[] Result_NamePlate_4P = new int[] { 80, 621 }; + public int[] Result_NamePlate_5P = new int[] { 31, 621 }; + + public int[] Result_ModIcons_4P = new int[] { 15, 678 }; + public int[] Result_ModIcons_5P = new int[] { -17, 678 }; + #endregion + + #region AIResult + + public int[] Result_AIBattle_Batch = new int[] { 884, 188 }; + public int[] Result_AIBattle_Batch_Move = new int[] { 104, 43 }; + public int[] Result_AIBattle_SectionPlate_Offset = new int[] { 55, 8 }; + + public int[] Result_AIBattle_SectionText_Offset = new int[] { 110, 27 }; + public int Result_AIBattle_SectionText_Scale = 13; + + public int[] Result_AIBattle_WinFlag = new int[] { 946, 526 }; + + #endregion + + #region DanResult + + public int[] DanResult_StatePanel = new int[] { 0, -4 }; + + public int[] DanResult_SongPanel_Main_X = new int[] { 255, 255, 255 }; + public int[] DanResult_SongPanel_Main_Y = new int[] { 100, 283, 466 }; + + public int[] DanResult_Difficulty_Cymbol_X = new int[] { 377, 377, 377 }; + public int[] DanResult_Difficulty_Cymbol_Y = new int[] { 146, 329, 512 }; + + public int[] DanResult_Level_Number_X = new int[] { 383, 383, 383 }; + public int[] DanResult_Level_Number_Y = new int[] { 173, 356, 539 }; + + public int[] DanResult_Sections_Perfect_X = new int[] { 455, 455, 455 }; + public int[] DanResult_Sections_Perfect_Y = new int[] { 204, 387, 570 }; + + public int[] DanResult_Sections_Good_X = new int[] { 666, 666, 666 }; + public int[] DanResult_Sections_Good_Y = new int[] { 204, 387, 570 }; + + public int[] DanResult_Sections_Miss_X = new int[] { 877, 877, 877 }; + public int[] DanResult_Sections_Miss_Y = new int[] { 204, 387, 570 }; + + public int[] DanResult_Sections_Roll_X = new int[] { 1088, 1088, 1088 }; + public int[] DanResult_Sections_Roll_Y = new int[] { 204, 387, 570 }; + + + public int[] DanResult_Perfect = new int[] { 720, 95 }; + public int[] DanResult_Good = new int[] { 720, 137 }; + public int[] DanResult_Miss = new int[] { 720, 179 }; + public int[] DanResult_Roll = new int[] { 1022, 95 }; + public int[] DanResult_MaxCombo = new int[] { 1022, 137 }; + public int[] DanResult_TotalHit = new int[] { 1022, 179 }; + public int[] DanResult_Score = new int[] { 566, 119 }; + + public int[] DanResult_Exam = new int[] { 232, 254 }; + + public int[] DanResult_DanTitles_X = new int[] { 401, 401, 401 }; + public int[] DanResult_DanTitles_Y = new int[] { 139, 322, 505 }; + + public int[] DanResult_DanIcon_X = new int[] { 315, 315, 315 }; + public int[] DanResult_DanIcon_Y = new int[] { 158, 342, 526 }; + + public int[] DanResult_Rank = new int[] { 130, 380 }; + + public int DanResult_Font_DanTitles_Size = 24; + + #endregion + + #region TowerResult + + public int[] TowerResult_ScoreRankEffect = new int[] { 1000, 220 }; + + public int[] TowerResult_Toutatsu = new int[] { 196, 160 }; + public int[] TowerResult_MaxFloors = new int[] { 616, 296 }; + public int[] TowerResult_Ten = new int[] { 982, 394 }; + public int[] TowerResult_Score = new int[] { 248, 394 }; + + public int[] TowerResult_CurrentFloor = new int[] { 688, 258 }; + public int[] TowerResult_ScoreCount = new int[] { 1026, 394 }; + public int[] TowerResult_RemainingLifes = new int[] { 1068, 490 }; + + public int[] TowerResult_Gauge_Soul = new int[] { 248, 474 }; + + public int TowerResult_Font_TowerText = 28; + public int TowerResult_Font_TowerText48 = 48; + public int TowerResult_Font_TowerText72 = 72; + + #endregion + + #region Heya + + public int[] Heya_Main_Menu_X = new int[] { 164, 164, 164, 164, 164 }; + public int[] Heya_Main_Menu_Y = new int[] { 26, 106, 186, 266, 346 }; + public int[] Heya_Main_Menu_Font_Offset = new int[] { 0, 14 }; + public int Heya_Center_Menu_Box_Count = 11; + public int[] Heya_Center_Menu_Box_X = new int[] { -890, -588, -286, 16, 318, 620, 922, 1224, 1526, 1828, 2130 }; + public int[] Heya_Center_Menu_Box_Y = new int[] { 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200 }; + public int[] Heya_Center_Menu_Box_Item_Offset = new int[] { 0, 120 }; + public int[] Heya_Center_Menu_Box_Name_Offset = new int[] { 0, 234 }; + public int[] Heya_Center_Menu_Box_Authors_Offset = new int[] { 0, 260 }; + public int Heya_Side_Menu_Count = 13; + public int[] Heya_Side_Menu_X = new int[] { 670, 680, 690, 700, 710, 720, 730, 720, 710, 700, 690, 680, 670 }; + public int[] Heya_Side_Menu_Y = new int[] { -80, -10, 60, 130, 200, 270, 340, 410, 480, 550, 620, 690, 760 }; + public int[] Heya_Side_Menu_Font_Offset = new int[] { 0, 14 }; + public int[] Heya_InfoSection = new int[] { 620, 560 }; + public int[] Heya_DescriptionTextOrigin = new int[] { 0, 0 }; + public int Heya_Font_Scale = 14; + + #endregion + + #region OnlineLounge + + public int[] OnlineLounge_Side_Menu = new int[] { 640, 360 }; + public int[] OnlineLounge_Side_Menu_Text_Offset = new int[] { 0, 18 }; + public int[] OnlineLounge_Side_Menu_Move = new int[] { 0, 80 }; + + public int[] OnlineLounge_Song = new int[] { 350, 360 }; + public int[] OnlineLounge_Song_Title_Offset = new int[] { 0, 18 }; + public int[] OnlineLounge_Song_SubTitle_Offset = new int[] { 0, 46 }; + public int[] OnlineLounge_Song_Move = new int[] { 0, 100 }; + + public int[] OnlineLounge_Context_Charter = new int[] { 980, 300 }; + public int[] OnlineLounge_Context_Genre = new int[] { 980, 340 }; + public int[] OnlineLounge_Context_Couse_Symbol = new int[] { 800, 480 }; + public int[] OnlineLounge_Context_Level = new int[] { 900, 494 }; + public int[] OnlineLounge_Context_Couse_Move = new int[] { 240, 60 }; + + public int[] OnlineLounge_Downloading = new int[] { 640, 605 }; + + public int OnlineLounge_Font_OLFont = 14; + public int OnlineLounge_Font_OLFontLarge = 28; + + #endregion + + #region TowerSelect + + public int TowerSelect_Title_Size = 30; + public int TowerSelect_Title_MaxWidth = 230; + public int[] TowerSelect_Title_Offset = new int[] { 0, -30 }; + public int TowerSelect_SubTitle_Size = 30; + public int TowerSelect_SubTitle_MaxWidth = 230; + public int[] TowerSelect_SubTitle_Offset = new int[] { 0, 10 }; + public int TowerSelect_Bar_Count = 7; + public int[] TowerSelect_Bar_X = new int[] { -260, 40, 340, 640, 940, 1240, 1540 }; + public int[] TowerSelect_Bar_Y = new int[] { 420, 400, 380, 360, 380, 400, 420 }; + + #endregion + + #region OpenEncyclopedia + + public int[] OpenEncyclopedia_Context_Item2 = new int[] { 960, 180 }; + public int[] OpenEncyclopedia_Context_Item3 = new int[] { 640, 360 }; + public int[] OpenEncyclopedia_Context_PageText = new int[] { 960, 720 }; + public int[] OpenEncyclopedia_Side_Menu = new int[] { 320, 360 }; + public int[] OpenEncyclopedia_Side_Menu_Move = new int[] { 0, 90 }; + public int[] OpenEncyclopedia_Side_Menu_Text_Offset = new int[] { 0, 0 }; + public int OpenEncyclopedia_Font_EncyclopediaMenu_Size = 14; + + #endregion + + #region Exit + public int Exit_Duration = 3000; + #endregion + + #region Font + public int Font_Edge_Ratio = 30; + public int Font_Edge_Ratio_Vertical = 30; + public int Text_Correction_X = 0; + public int Text_Correction_Y = 0; + #endregion + + #region NamePlate + + public int[] NamePlate_Title_Offset = new int[] { 124, 22 }; + public int[] NamePlate_Dan_Offset = new int[] { 69, 44 }; + public int[] NamePlate_Name_Offset_Normal = new int[] { 121, 36 }; + public int[] NamePlate_Name_Offset_WithTitle = new int[] { 121, 44 }; + public int[] NamePlate_Name_Offset_Full = new int[] { 144, 44 }; + public int NamePlate_Name_Width_Normal = 220; + public int NamePlate_Name_Width_Full = 120; + public int NamePlate_Title_Width = 160; + public int NamePlate_Dan_Width = 66; + + public int NamePlate_Font_Name_Size_Normal = 15; + public int NamePlate_Font_Name_Size_WithTitle = 12; + public int NamePlate_Font_Title_Size = 11; + public int NamePlate_Font_Dan_Size = 12; + + #endregion + + #region [Mod icons] + + public int[] ModIcons_OffsetX = { 0, 30, 60, 90, 0, 30, 60, 90 }; + public int[] ModIcons_OffsetY = { 0, 0, 0, 0, 30, 30, 30, 30 }; + public int[] ModIcons_OffsetX_Menu = { 0, 30, 60, 90, 120, 150, 180, 210 }; + public int[] ModIcons_OffsetY_Menu = { 0, 0, 0, 0, 0, 0, 0, 0 }; + + #endregion + + #region Modal + + public int[] Modal_Title_Full = new int[] { 640, 140 }; + public int[] Modal_Title_Half_X = new int[] { 320, 960 }; + public int[] Modal_Title_Half_Y = new int[] { 290, 290 }; + + public int[] Modal_Text_Full = new int[] { 640, 327 };//445 + public int[] Modal_Text_Full_Move = new int[] { 0, 118 }; + public int[] Modal_Text_Half_X = new int[] { 320, 960 }; + public int[] Modal_Text_Half_Y = new int[] { 383, 383 }; + public int[] Modal_Text_Half_Move = new int[] { 0, 59 }; + + public int Modal_Font_ModalContentHalf_Size = 28; + public int Modal_Font_ModalTitleHalf_Size = 28; + public int Modal_Font_ModalContentFull_Size = 56; + public int Modal_Font_ModalTitleFull_Size = 56; + + public int[] Modal_Title_Half_X_4P = new int[] { 320, 960, 320, 960 }; + public int[] Modal_Title_Half_X_5P = new int[] { 320, 960, 320, 960, 320 }; + + public int[] Modal_Title_Half_Y_4P = new int[] { 66, 66, 426, 426 }; + public int[] Modal_Title_Half_Y_5P = new int[] { 50, 50, 290, 290, 530 }; + + public int[] Modal_Text_Half_X_4P = new int[] { 320, 960, 320, 960 }; + public int[] Modal_Text_Half_X_5P = new int[] { 320, 960, 320, 960, 320 }; + + public int[] Modal_Text_Half_Y_4P = new int[] { 159, 159, 519, 519 }; + public int[] Modal_Text_Half_Y_5P = new int[] { 107, 107, 347, 347, 587 }; + + public int[] Modal_Text_Half_Move_4P = new int[] { 0, 59 }; + public int[] Modal_Text_Half_Move_5P = new int[] { 0, 40 }; + + #endregion + + #region PopupMenu + + public int[] PopupMenu_Menu_Title = new int[2] { 460, 40 }; + public int[] PopupMenu_Title = new int[2] { 540, 44 }; + public int[] PopupMenu_Menu_Highlight = new int[2] { 480, 46 }; + public int[] PopupMenu_MenuItem_Name = new int[2] { 480, 77 }; + public int[] PopupMenu_MenuItem_Value = new int[2] { 630, 77 }; + public int[] PopupMenu_Move = new int[2] { 0, 32 }; + public int PopupMenu_Font_Size = 18; + + #endregion + + #endregion } diff --git a/OpenTaiko/src/Common/CSongDict.cs b/OpenTaiko/src/Common/CSongDict.cs index ceb25ff9..9f587720 100644 --- a/OpenTaiko/src/Common/CSongDict.cs +++ b/OpenTaiko/src/Common/CSongDict.cs @@ -1,269 +1,269 @@ using System.Drawing; -namespace OpenTaiko { - internal class CSongDict { - private static Dictionary nodes = new Dictionary(); - private static HashSet urls = new HashSet(); - - public static CActSelect曲リスト.CScorePad[][] ScorePads = new CActSelect曲リスト.CScorePad[5][] - { - new CActSelect曲リスト.CScorePad[(int)Difficulty.Edit + 2] { new CActSelect曲リスト.CScorePad(), new CActSelect曲リスト.CScorePad(), new CActSelect曲リスト.CScorePad(), new CActSelect曲リスト.CScorePad(), new CActSelect曲リスト.CScorePad(), new CActSelect曲リスト.CScorePad() }, - new CActSelect曲リスト.CScorePad[(int)Difficulty.Edit + 2] { new CActSelect曲リスト.CScorePad(), new CActSelect曲リスト.CScorePad(), new CActSelect曲リスト.CScorePad(), new CActSelect曲リスト.CScorePad(), new CActSelect曲リスト.CScorePad(), new CActSelect曲リスト.CScorePad() }, - new CActSelect曲リスト.CScorePad[(int)Difficulty.Edit + 2] { new CActSelect曲リスト.CScorePad(), new CActSelect曲リスト.CScorePad(), new CActSelect曲リスト.CScorePad(), new CActSelect曲リスト.CScorePad(), new CActSelect曲リスト.CScorePad(), new CActSelect曲リスト.CScorePad() }, - new CActSelect曲リスト.CScorePad[(int)Difficulty.Edit + 2] { new CActSelect曲リスト.CScorePad(), new CActSelect曲リスト.CScorePad(), new CActSelect曲リスト.CScorePad(), new CActSelect曲リスト.CScorePad(), new CActSelect曲リスト.CScorePad(), new CActSelect曲リスト.CScorePad() }, - new CActSelect曲リスト.CScorePad[(int)Difficulty.Edit + 2] { new CActSelect曲リスト.CScorePad(), new CActSelect曲リスト.CScorePad(), new CActSelect曲リスト.CScorePad(), new CActSelect曲リスト.CScorePad(), new CActSelect曲リスト.CScorePad(), new CActSelect曲リスト.CScorePad() } - }; - - public static int tGetNodesCount() { - return nodes.Count(); - } - - public static string[] tGetNodesByGenreName(string genreName) { - return nodes.Where(_nd => _nd.Value.strジャンル == genreName).Select(_nd => _nd.Key).ToArray(); - } - - #region [General song dict methods] - - public static CSongListNode tGetNodeFromID(string id) { - if (nodes.ContainsKey(id)) - return nodes[id].Clone(); - return null; - } - - public static void tAddSongNode(CSongUniqueID sid, CSongListNode node) { - if (sid != null && sid.data.id != null && sid.data.id != "" && !nodes.ContainsKey(sid.data.id)) - nodes.Add(sid.data.id, node.Clone()); - tAddSongUrl(sid); - } - - public static bool tContainsSongUrl(string url) { - return urls.Contains(url); - } - - public static void tAddSongUrl(CSongUniqueID sid) { - var url = sid.data.url; - - if (url != null && url != "" && !urls.Contains(url)) - urls.Add(url); - } - - public static void tRemoveSongUrl(CSongUniqueID sid) { - var url = sid.data.url; - - if (url != null && url != "" && urls.Contains(url)) - urls.Remove(url); - } - - public static void tRemoveSongNode(CSongUniqueID sid) { - if (sid != null && nodes.ContainsKey(sid.data.id)) { - tRemoveSongUrl(sid); - nodes.Remove(sid.data.id); - } - } - - public static void tClearSongNodes() { - nodes.Clear(); - urls.Clear(); - } - - #endregion - - #region [Extra methods] - - // Generate a back button - public static CSongListNode tGenerateBackButton(CSongListNode parent, string path = "/", List listStrBoxDef = null) { - CSongListNode itemBack = new CSongListNode(); - itemBack.eノード種別 = CSongListNode.ENodeType.BACKBOX; - - - // とじる - itemBack.ldTitle = CLangManager.GetAllStringsAsLocalizationDataWithArgs("SONGSELECT_RETURN_PATH", path, path); - - itemBack.BackColor = ColorTranslator.FromHtml("#513009"); - itemBack.BoxColor = Color.White; - - itemBack.BgColor = parent.BgColor; - itemBack.isChangedBgColor = parent.isChangedBgColor; - itemBack.BgType = parent.BgType; - itemBack.isChangedBgType = parent.isChangedBgType; - - itemBack.strジャンル = parent.strジャンル; - itemBack.strSelectBGPath = parent.strSelectBGPath; - itemBack.nスコア数 = 1; - itemBack.rParentNode = parent; - itemBack.strSkinPath = (parent.rParentNode == null) ? - "" : parent.rParentNode.strSkinPath; - - // I guess this is used to count the number of box.def instances and only at startup, which makes using it here pretty weird - if (listStrBoxDef != null && itemBack.strSkinPath != "" && !listStrBoxDef.Contains(itemBack.strSkinPath)) { - listStrBoxDef.Add(itemBack.strSkinPath); - } - - itemBack.strBreadcrumbs = (itemBack.rParentNode == null) ? - itemBack.ldTitle.GetString("") : itemBack.rParentNode.strBreadcrumbs + " > " + itemBack.ldTitle.GetString(""); - - itemBack.arスコア[0] = new Cスコア(); - itemBack.arスコア[0].ファイル情報.フォルダの絶対パス = ""; - itemBack.arスコア[0].譜面情報.タイトル = itemBack.ldTitle.GetString(""); - itemBack.arスコア[0].譜面情報.コメント = ""; - - return (itemBack); - } - - public static CSongListNode tGenerateRandomButton(CSongListNode parent, string path = "/") { - CSongListNode itemRandom = new CSongListNode(); - itemRandom.eノード種別 = CSongListNode.ENodeType.RANDOM; - - itemRandom.ldTitle = CLangManager.GetAllStringsAsLocalizationDataWithArgs("SONGSELECT_RANDOM_PATH", path, path); - - itemRandom.nスコア数 = (int)Difficulty.Total; - itemRandom.rParentNode = parent; - - itemRandom.strBreadcrumbs = (itemRandom.rParentNode == null) ? - itemRandom.ldTitle.GetString("") : itemRandom.rParentNode.strBreadcrumbs + " > " + itemRandom.ldTitle.GetString(""); - - itemRandom.arスコア[0] = new Cスコア(); - - return itemRandom; - } - - // Reset the position of all back buttons, also adds a random button at the end - public static List tReinsertBackButtons(CSongListNode parent, List songList, string path = "/", List listStrBoxDef = null) { - // Remove all the existing back boxes currently existing - songList.RemoveAll(e => e.eノード種別 == CSongListNode.ENodeType.BACKBOX || e.eノード種別 == CSongListNode.ENodeType.RANDOM); - - int songCount = songList.Count; - - for (int index = 0; index < (songCount / 7) + 1; index++) { - var backBox = tGenerateBackButton(parent, path, listStrBoxDef); - songList.Insert(Math.Min(index * (7 + 1), songList.Count), backBox); - } - - if (songCount > 0) - songList.Add(tGenerateRandomButton(parent, path)); - - // Return the reference in case of - return songList; - } - - - private static CSongListNode tReadaptChildNote(CSongListNode parent, CSongListNode node) { - if (node != null) { - node.rParentNode = parent; - node.isChangedBgType = parent.isChangedBgType; - node.isChangedBgColor = parent.isChangedBgColor; - node.isChangedBoxType = parent.isChangedBoxType; - node.isChangedBoxColor = parent.isChangedBoxColor; - - node.ForeColor = parent.ForeColor; - node.BackColor = parent.BackColor; - node.BoxColor = parent.BoxColor; - node.BgColor = parent.BgColor; - node.BgType = parent.BgType; - node.BoxType = parent.BoxType; - - return node; - } - return null; - } - - // Generate the favorite folder content - public static List tFetchFavoriteFolder(CSongListNode parent) { - List childList = new List(); - - foreach (string id in OpenTaiko.Favorites.data.favorites[OpenTaiko.SaveFile]) { - var node = tReadaptChildNote(parent, tGetNodeFromID(id)); - if (node != null) { - childList.Add(node); - } - - } - - // Generate back buttons - - string favPath = "./" + parent.ldTitle.GetString("") + "/"; - - tReinsertBackButtons(parent, childList, favPath); - - return childList; - } - - // Generate recently played songs folder - public static List tFetchRecentlyPlayedSongsFolder(CSongListNode parent) { - List childList = new List(); - - foreach (string id in OpenTaiko.RecentlyPlayedSongs.data.recentlyplayedsongs[OpenTaiko.SaveFile].Reverse()) { - var node = tReadaptChildNote(parent, tGetNodeFromID(id)); - if (node != null) { - childList.Add(node); - } - - } - - // Generate back buttons - - string favPath = "./" + parent.ldTitle.GetString("") + "/"; - - tReinsertBackButtons(parent, childList, favPath); - - return childList; - } - - // 13 includes any higher difficulty - private static bool tLevelMatches(int check, int level) { - if (level == 13) - return check >= level; - return check == level; - } - - // Generate search by difficulty folder - public static List tFetchSongsByDifficulty(CSongListNode parent, int difficulty = (int)Difficulty.Oni, int level = 8) { - List childList = new List(); - - foreach (CSongListNode nodeT in nodes.Values) { - var score = nodeT.nLevel; - if (tLevelMatches(score[difficulty], level) - || (difficulty == (int)Difficulty.Oni && tLevelMatches(score[(int)Difficulty.Edit], level))) // Oni includes Ura - { - var node = tReadaptChildNote(parent, nodeT); - if (node != null) { - childList.Add(node); - } - } - } - - // Generate back buttons - - string favPath = "./" + parent.ldTitle.GetString("") + "/"; - - tReinsertBackButtons(parent, childList, favPath); - - return childList; - } - - #endregion - - #region [Score tables methods] - - public static void tRefreshScoreTables() { - for (int pl = 0; pl < 5; pl++) { - CActSelect曲リスト.CScorePad[] SPArrRef = ScorePads[pl]; - var BestPlayStats = OpenTaiko.SaveFileInstances[OpenTaiko.GetActualPlayer(pl)].data.bestPlaysStats; - - for (int s = 0; s <= (int)Difficulty.Edit + 1; s++) { - CActSelect曲リスト.CScorePad SPRef = SPArrRef[s]; - - if (s <= (int)Difficulty.Edit) { - SPRef.ScoreRankCount = BestPlayStats.ScoreRanks[s].Skip(1).ToArray(); ; - SPRef.CrownCount = BestPlayStats.ClearStatuses[s].Skip(1).ToArray(); ; - } else { - SPRef.ScoreRankCount = BestPlayStats.ScoreRanks[(int)Difficulty.Oni].Skip(1).Zip(BestPlayStats.ScoreRanks[(int)Difficulty.Edit].Skip(1).ToArray(), (x, y) => x + y).ToArray(); - SPRef.CrownCount = BestPlayStats.ClearStatuses[(int)Difficulty.Oni].Skip(1).Zip(BestPlayStats.ClearStatuses[(int)Difficulty.Edit].Skip(1).ToArray(), (x, y) => x + y).ToArray(); - } - } - } - } - - #endregion +namespace OpenTaiko; + +internal class CSongDict { + private static Dictionary nodes = new Dictionary(); + private static HashSet urls = new HashSet(); + + public static CActSelect曲リスト.CScorePad[][] ScorePads = new CActSelect曲リスト.CScorePad[5][] + { + new CActSelect曲リスト.CScorePad[(int)Difficulty.Edit + 2] { new CActSelect曲リスト.CScorePad(), new CActSelect曲リスト.CScorePad(), new CActSelect曲リスト.CScorePad(), new CActSelect曲リスト.CScorePad(), new CActSelect曲リスト.CScorePad(), new CActSelect曲リスト.CScorePad() }, + new CActSelect曲リスト.CScorePad[(int)Difficulty.Edit + 2] { new CActSelect曲リスト.CScorePad(), new CActSelect曲リスト.CScorePad(), new CActSelect曲リスト.CScorePad(), new CActSelect曲リスト.CScorePad(), new CActSelect曲リスト.CScorePad(), new CActSelect曲リスト.CScorePad() }, + new CActSelect曲リスト.CScorePad[(int)Difficulty.Edit + 2] { new CActSelect曲リスト.CScorePad(), new CActSelect曲リスト.CScorePad(), new CActSelect曲リスト.CScorePad(), new CActSelect曲リスト.CScorePad(), new CActSelect曲リスト.CScorePad(), new CActSelect曲リスト.CScorePad() }, + new CActSelect曲リスト.CScorePad[(int)Difficulty.Edit + 2] { new CActSelect曲リスト.CScorePad(), new CActSelect曲リスト.CScorePad(), new CActSelect曲リスト.CScorePad(), new CActSelect曲リスト.CScorePad(), new CActSelect曲リスト.CScorePad(), new CActSelect曲リスト.CScorePad() }, + new CActSelect曲リスト.CScorePad[(int)Difficulty.Edit + 2] { new CActSelect曲リスト.CScorePad(), new CActSelect曲リスト.CScorePad(), new CActSelect曲リスト.CScorePad(), new CActSelect曲リスト.CScorePad(), new CActSelect曲リスト.CScorePad(), new CActSelect曲リスト.CScorePad() } + }; + + public static int tGetNodesCount() { + return nodes.Count(); } + + public static string[] tGetNodesByGenreName(string genreName) { + return nodes.Where(_nd => _nd.Value.strジャンル == genreName).Select(_nd => _nd.Key).ToArray(); + } + + #region [General song dict methods] + + public static CSongListNode tGetNodeFromID(string id) { + if (nodes.ContainsKey(id)) + return nodes[id].Clone(); + return null; + } + + public static void tAddSongNode(CSongUniqueID sid, CSongListNode node) { + if (sid != null && sid.data.id != null && sid.data.id != "" && !nodes.ContainsKey(sid.data.id)) + nodes.Add(sid.data.id, node.Clone()); + tAddSongUrl(sid); + } + + public static bool tContainsSongUrl(string url) { + return urls.Contains(url); + } + + public static void tAddSongUrl(CSongUniqueID sid) { + var url = sid.data.url; + + if (url != null && url != "" && !urls.Contains(url)) + urls.Add(url); + } + + public static void tRemoveSongUrl(CSongUniqueID sid) { + var url = sid.data.url; + + if (url != null && url != "" && urls.Contains(url)) + urls.Remove(url); + } + + public static void tRemoveSongNode(CSongUniqueID sid) { + if (sid != null && nodes.ContainsKey(sid.data.id)) { + tRemoveSongUrl(sid); + nodes.Remove(sid.data.id); + } + } + + public static void tClearSongNodes() { + nodes.Clear(); + urls.Clear(); + } + + #endregion + + #region [Extra methods] + + // Generate a back button + public static CSongListNode tGenerateBackButton(CSongListNode parent, string path = "/", List listStrBoxDef = null) { + CSongListNode itemBack = new CSongListNode(); + itemBack.eノード種別 = CSongListNode.ENodeType.BACKBOX; + + + // とじる + itemBack.ldTitle = CLangManager.GetAllStringsAsLocalizationDataWithArgs("SONGSELECT_RETURN_PATH", path, path); + + itemBack.BackColor = ColorTranslator.FromHtml("#513009"); + itemBack.BoxColor = Color.White; + + itemBack.BgColor = parent.BgColor; + itemBack.isChangedBgColor = parent.isChangedBgColor; + itemBack.BgType = parent.BgType; + itemBack.isChangedBgType = parent.isChangedBgType; + + itemBack.strジャンル = parent.strジャンル; + itemBack.strSelectBGPath = parent.strSelectBGPath; + itemBack.nスコア数 = 1; + itemBack.rParentNode = parent; + itemBack.strSkinPath = (parent.rParentNode == null) ? + "" : parent.rParentNode.strSkinPath; + + // I guess this is used to count the number of box.def instances and only at startup, which makes using it here pretty weird + if (listStrBoxDef != null && itemBack.strSkinPath != "" && !listStrBoxDef.Contains(itemBack.strSkinPath)) { + listStrBoxDef.Add(itemBack.strSkinPath); + } + + itemBack.strBreadcrumbs = (itemBack.rParentNode == null) ? + itemBack.ldTitle.GetString("") : itemBack.rParentNode.strBreadcrumbs + " > " + itemBack.ldTitle.GetString(""); + + itemBack.arスコア[0] = new Cスコア(); + itemBack.arスコア[0].ファイル情報.フォルダの絶対パス = ""; + itemBack.arスコア[0].譜面情報.タイトル = itemBack.ldTitle.GetString(""); + itemBack.arスコア[0].譜面情報.コメント = ""; + + return (itemBack); + } + + public static CSongListNode tGenerateRandomButton(CSongListNode parent, string path = "/") { + CSongListNode itemRandom = new CSongListNode(); + itemRandom.eノード種別 = CSongListNode.ENodeType.RANDOM; + + itemRandom.ldTitle = CLangManager.GetAllStringsAsLocalizationDataWithArgs("SONGSELECT_RANDOM_PATH", path, path); + + itemRandom.nスコア数 = (int)Difficulty.Total; + itemRandom.rParentNode = parent; + + itemRandom.strBreadcrumbs = (itemRandom.rParentNode == null) ? + itemRandom.ldTitle.GetString("") : itemRandom.rParentNode.strBreadcrumbs + " > " + itemRandom.ldTitle.GetString(""); + + itemRandom.arスコア[0] = new Cスコア(); + + return itemRandom; + } + + // Reset the position of all back buttons, also adds a random button at the end + public static List tReinsertBackButtons(CSongListNode parent, List songList, string path = "/", List listStrBoxDef = null) { + // Remove all the existing back boxes currently existing + songList.RemoveAll(e => e.eノード種別 == CSongListNode.ENodeType.BACKBOX || e.eノード種別 == CSongListNode.ENodeType.RANDOM); + + int songCount = songList.Count; + + for (int index = 0; index < (songCount / 7) + 1; index++) { + var backBox = tGenerateBackButton(parent, path, listStrBoxDef); + songList.Insert(Math.Min(index * (7 + 1), songList.Count), backBox); + } + + if (songCount > 0) + songList.Add(tGenerateRandomButton(parent, path)); + + // Return the reference in case of + return songList; + } + + + private static CSongListNode tReadaptChildNote(CSongListNode parent, CSongListNode node) { + if (node != null) { + node.rParentNode = parent; + node.isChangedBgType = parent.isChangedBgType; + node.isChangedBgColor = parent.isChangedBgColor; + node.isChangedBoxType = parent.isChangedBoxType; + node.isChangedBoxColor = parent.isChangedBoxColor; + + node.ForeColor = parent.ForeColor; + node.BackColor = parent.BackColor; + node.BoxColor = parent.BoxColor; + node.BgColor = parent.BgColor; + node.BgType = parent.BgType; + node.BoxType = parent.BoxType; + + return node; + } + return null; + } + + // Generate the favorite folder content + public static List tFetchFavoriteFolder(CSongListNode parent) { + List childList = new List(); + + foreach (string id in OpenTaiko.Favorites.data.favorites[OpenTaiko.SaveFile]) { + var node = tReadaptChildNote(parent, tGetNodeFromID(id)); + if (node != null) { + childList.Add(node); + } + + } + + // Generate back buttons + + string favPath = "./" + parent.ldTitle.GetString("") + "/"; + + tReinsertBackButtons(parent, childList, favPath); + + return childList; + } + + // Generate recently played songs folder + public static List tFetchRecentlyPlayedSongsFolder(CSongListNode parent) { + List childList = new List(); + + foreach (string id in OpenTaiko.RecentlyPlayedSongs.data.recentlyplayedsongs[OpenTaiko.SaveFile].Reverse()) { + var node = tReadaptChildNote(parent, tGetNodeFromID(id)); + if (node != null) { + childList.Add(node); + } + + } + + // Generate back buttons + + string favPath = "./" + parent.ldTitle.GetString("") + "/"; + + tReinsertBackButtons(parent, childList, favPath); + + return childList; + } + + // 13 includes any higher difficulty + private static bool tLevelMatches(int check, int level) { + if (level == 13) + return check >= level; + return check == level; + } + + // Generate search by difficulty folder + public static List tFetchSongsByDifficulty(CSongListNode parent, int difficulty = (int)Difficulty.Oni, int level = 8) { + List childList = new List(); + + foreach (CSongListNode nodeT in nodes.Values) { + var score = nodeT.nLevel; + if (tLevelMatches(score[difficulty], level) + || (difficulty == (int)Difficulty.Oni && tLevelMatches(score[(int)Difficulty.Edit], level))) // Oni includes Ura + { + var node = tReadaptChildNote(parent, nodeT); + if (node != null) { + childList.Add(node); + } + } + } + + // Generate back buttons + + string favPath = "./" + parent.ldTitle.GetString("") + "/"; + + tReinsertBackButtons(parent, childList, favPath); + + return childList; + } + + #endregion + + #region [Score tables methods] + + public static void tRefreshScoreTables() { + for (int pl = 0; pl < 5; pl++) { + CActSelect曲リスト.CScorePad[] SPArrRef = ScorePads[pl]; + var BestPlayStats = OpenTaiko.SaveFileInstances[OpenTaiko.GetActualPlayer(pl)].data.bestPlaysStats; + + for (int s = 0; s <= (int)Difficulty.Edit + 1; s++) { + CActSelect曲リスト.CScorePad SPRef = SPArrRef[s]; + + if (s <= (int)Difficulty.Edit) { + SPRef.ScoreRankCount = BestPlayStats.ScoreRanks[s].Skip(1).ToArray(); ; + SPRef.CrownCount = BestPlayStats.ClearStatuses[s].Skip(1).ToArray(); ; + } else { + SPRef.ScoreRankCount = BestPlayStats.ScoreRanks[(int)Difficulty.Oni].Skip(1).Zip(BestPlayStats.ScoreRanks[(int)Difficulty.Edit].Skip(1).ToArray(), (x, y) => x + y).ToArray(); + SPRef.CrownCount = BestPlayStats.ClearStatuses[(int)Difficulty.Oni].Skip(1).Zip(BestPlayStats.ClearStatuses[(int)Difficulty.Edit].Skip(1).ToArray(), (x, y) => x + y).ToArray(); + } + } + } + } + + #endregion } diff --git a/OpenTaiko/src/Common/CTextConsole.cs b/OpenTaiko/src/Common/CTextConsole.cs index 05867c03..8c39c37e 100644 --- a/OpenTaiko/src/Common/CTextConsole.cs +++ b/OpenTaiko/src/Common/CTextConsole.cs @@ -1,95 +1,95 @@ using System.Drawing; using FDK; -namespace OpenTaiko { - internal class CTextConsole : CActivity { - public enum EFontType { - White, - Cyan, - Gray, - WhiteSlim, - CyanSlim, - GraySlim - } +namespace OpenTaiko; - public void Print(int x, int y, EFontType font, string alphanumericString) { - if (base.IsDeActivated || string.IsNullOrEmpty(alphanumericString)) { - return; - } - - int BOL = x; - foreach (var ch in alphanumericString) { - if (ch == '\n') { - x = BOL; - y += this.fontHeight; - } else { - int index = printableCharacters.IndexOf(ch); - if (index >= 0) { - if (this.fontTextures[(int)((int)font / (int)EFontType.WhiteSlim)] != null) { - this.fontTextures[(int)((int)font / (int)EFontType.WhiteSlim)].t2D描画(x, y, this.characterRectangles[(int)((int)font % (int)EFontType.WhiteSlim), index]); - } - } - - x += this.fontWidth; - } - } - } - - public override void DeActivate() { - if (this.characterRectangles != null) - this.characterRectangles = null; - - base.DeActivate(); - } - - public override void CreateManagedResource() { - if (base.IsDeActivated) { - return; - } - - this.fontTextures[0] = OpenTaiko.Tx.TxC(@"Console_Font.png"); - this.fontTextures[1] = OpenTaiko.Tx.TxC(@"Console_Font_Small.png"); - - this.fontWidth = this.fontTextures[0].szTextureSize.Width / 32; - this.fontHeight = this.fontTextures[0].szTextureSize.Height / 16; - - this.characterRectangles = new Rectangle[3, printableCharacters.Length]; - for (int i = 0; i < 3; i++) { - for (int j = 0; j < printableCharacters.Length; j++) { - int regionX = this.fontWidth * 16, regionY = this.fontHeight * 8; - this.characterRectangles[i, j].X = ((i / 2) * regionX) + ((j % 16) * this.fontWidth); - this.characterRectangles[i, j].Y = ((i % 2) * regionY) + ((j / 16) * this.fontHeight); - this.characterRectangles[i, j].Width = this.fontWidth; - this.characterRectangles[i, j].Height = this.fontHeight; - } - } - - base.CreateManagedResource(); - } - - public override void ReleaseManagedResource() { - if (base.IsDeActivated) { - return; - } - - for (int i = 0; i < 2; i++) { - if (this.fontTextures[i] == null) { - continue; - } - - this.fontTextures[i].Dispose(); - this.fontTextures[i] = null; - } - base.ReleaseManagedResource(); - } - - #region [ private ] - //----------------- - private Rectangle[,] characterRectangles; - private const string printableCharacters = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ "; - public int fontWidth = 8, fontHeight = 16; - private CTexture[] fontTextures = new CTexture[2]; - //----------------- - #endregion +internal class CTextConsole : CActivity { + public enum EFontType { + White, + Cyan, + Gray, + WhiteSlim, + CyanSlim, + GraySlim } + + public void Print(int x, int y, EFontType font, string alphanumericString) { + if (base.IsDeActivated || string.IsNullOrEmpty(alphanumericString)) { + return; + } + + int BOL = x; + foreach (var ch in alphanumericString) { + if (ch == '\n') { + x = BOL; + y += this.fontHeight; + } else { + int index = printableCharacters.IndexOf(ch); + if (index >= 0) { + if (this.fontTextures[(int)((int)font / (int)EFontType.WhiteSlim)] != null) { + this.fontTextures[(int)((int)font / (int)EFontType.WhiteSlim)].t2D描画(x, y, this.characterRectangles[(int)((int)font % (int)EFontType.WhiteSlim), index]); + } + } + + x += this.fontWidth; + } + } + } + + public override void DeActivate() { + if (this.characterRectangles != null) + this.characterRectangles = null; + + base.DeActivate(); + } + + public override void CreateManagedResource() { + if (base.IsDeActivated) { + return; + } + + this.fontTextures[0] = OpenTaiko.Tx.TxC(@"Console_Font.png"); + this.fontTextures[1] = OpenTaiko.Tx.TxC(@"Console_Font_Small.png"); + + this.fontWidth = this.fontTextures[0].szTextureSize.Width / 32; + this.fontHeight = this.fontTextures[0].szTextureSize.Height / 16; + + this.characterRectangles = new Rectangle[3, printableCharacters.Length]; + for (int i = 0; i < 3; i++) { + for (int j = 0; j < printableCharacters.Length; j++) { + int regionX = this.fontWidth * 16, regionY = this.fontHeight * 8; + this.characterRectangles[i, j].X = ((i / 2) * regionX) + ((j % 16) * this.fontWidth); + this.characterRectangles[i, j].Y = ((i % 2) * regionY) + ((j / 16) * this.fontHeight); + this.characterRectangles[i, j].Width = this.fontWidth; + this.characterRectangles[i, j].Height = this.fontHeight; + } + } + + base.CreateManagedResource(); + } + + public override void ReleaseManagedResource() { + if (base.IsDeActivated) { + return; + } + + for (int i = 0; i < 2; i++) { + if (this.fontTextures[i] == null) { + continue; + } + + this.fontTextures[i].Dispose(); + this.fontTextures[i] = null; + } + base.ReleaseManagedResource(); + } + + #region [ private ] + //----------------- + private Rectangle[,] characterRectangles; + private const string printableCharacters = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ "; + public int fontWidth = 8, fontHeight = 16; + private CTexture[] fontTextures = new CTexture[2]; + //----------------- + #endregion } diff --git a/OpenTaiko/src/Common/ConfigIniToSongGainControllerBinder.cs b/OpenTaiko/src/Common/ConfigIniToSongGainControllerBinder.cs index c9d8edb3..497c1474 100644 --- a/OpenTaiko/src/Common/ConfigIniToSongGainControllerBinder.cs +++ b/OpenTaiko/src/Common/ConfigIniToSongGainControllerBinder.cs @@ -1,33 +1,33 @@ using FDK; -namespace OpenTaiko { - /// - /// The ConfigIniToSongGainControllerBinder allows for SONGVOL and/or other - /// properties related to the Gain levels applied to song preview and - /// playback, to be applied conditionally based on settings flowing from - /// ConfigIni. This binder class allows that to take place without either - /// ConfigIni or SongGainController having awareness of one another. - /// See those classes properties, methods, and events for more details. - /// - internal static class ConfigIniToSongGainControllerBinder { - internal static void Bind(CConfigIni configIni, SongGainController songGainController) { - songGainController.ApplyLoudnessMetadata = configIni.ApplyLoudnessMetadata; - songGainController.TargetLoudness = new Lufs(configIni.TargetLoudness); - songGainController.ApplySongVol = configIni.ApplySongVol; +namespace OpenTaiko; - configIni.PropertyChanged += (sender, args) => { - switch (args.PropertyName) { - case nameof(CConfigIni.ApplyLoudnessMetadata): - songGainController.ApplyLoudnessMetadata = configIni.ApplyLoudnessMetadata; - break; - case nameof(CConfigIni.TargetLoudness): - songGainController.TargetLoudness = new Lufs(configIni.TargetLoudness); - break; - case nameof(CConfigIni.ApplySongVol): - songGainController.ApplySongVol = configIni.ApplySongVol; - break; - } - }; - } +/// +/// The ConfigIniToSongGainControllerBinder allows for SONGVOL and/or other +/// properties related to the Gain levels applied to song preview and +/// playback, to be applied conditionally based on settings flowing from +/// ConfigIni. This binder class allows that to take place without either +/// ConfigIni or SongGainController having awareness of one another. +/// See those classes properties, methods, and events for more details. +/// +internal static class ConfigIniToSongGainControllerBinder { + internal static void Bind(CConfigIni configIni, SongGainController songGainController) { + songGainController.ApplyLoudnessMetadata = configIni.ApplyLoudnessMetadata; + songGainController.TargetLoudness = new Lufs(configIni.TargetLoudness); + songGainController.ApplySongVol = configIni.ApplySongVol; + + configIni.PropertyChanged += (sender, args) => { + switch (args.PropertyName) { + case nameof(CConfigIni.ApplyLoudnessMetadata): + songGainController.ApplyLoudnessMetadata = configIni.ApplyLoudnessMetadata; + break; + case nameof(CConfigIni.TargetLoudness): + songGainController.TargetLoudness = new Lufs(configIni.TargetLoudness); + break; + case nameof(CConfigIni.ApplySongVol): + songGainController.ApplySongVol = configIni.ApplySongVol; + break; + } + }; } } diff --git a/OpenTaiko/src/Common/ConfigIniToSoundGroupLevelControllerBinder.cs b/OpenTaiko/src/Common/ConfigIniToSoundGroupLevelControllerBinder.cs index fbf0739e..bd9fdaba 100644 --- a/OpenTaiko/src/Common/ConfigIniToSoundGroupLevelControllerBinder.cs +++ b/OpenTaiko/src/Common/ConfigIniToSoundGroupLevelControllerBinder.cs @@ -1,59 +1,59 @@ using FDK; -namespace OpenTaiko { - /// - /// The ConfigIniToSoundGroupLevelControllerBinder allows for updated sound - /// group level values, and keyboard sound level adjustment increment - /// values, to flow between CConfigIni and the SoundGroupLevelController - /// without either of those two classes being aware of one another. - /// See those classes properties, methods, and events for more details. - /// - internal static class ConfigIniToSoundGroupLevelControllerBinder { - internal static void Bind(CConfigIni configIni, SoundGroupLevelController soundGroupLevelController) { - soundGroupLevelController.SetLevel(ESoundGroup.SoundEffect, configIni.SoundEffectLevel); - soundGroupLevelController.SetLevel(ESoundGroup.Voice, configIni.VoiceLevel); - soundGroupLevelController.SetLevel(ESoundGroup.SongPreview, configIni.SongPreviewLevel); - soundGroupLevelController.SetLevel(ESoundGroup.SongPlayback, configIni.SongPlaybackLevel); - soundGroupLevelController.SetKeyboardSoundLevelIncrement(configIni.KeyboardSoundLevelIncrement); +namespace OpenTaiko; - configIni.PropertyChanged += (sender, args) => { - switch (args.PropertyName) { - case nameof(CConfigIni.SoundEffectLevel): - soundGroupLevelController.SetLevel(ESoundGroup.SoundEffect, configIni.SoundEffectLevel); - break; - case nameof(CConfigIni.VoiceLevel): - soundGroupLevelController.SetLevel(ESoundGroup.Voice, configIni.VoiceLevel); - break; - case nameof(CConfigIni.SongPreviewLevel): - soundGroupLevelController.SetLevel(ESoundGroup.SongPreview, configIni.SongPreviewLevel); - break; - case nameof(CConfigIni.SongPlaybackLevel): - soundGroupLevelController.SetLevel(ESoundGroup.SongPlayback, configIni.SongPlaybackLevel); - break; - case nameof(CConfigIni.KeyboardSoundLevelIncrement): - soundGroupLevelController.SetKeyboardSoundLevelIncrement(configIni.KeyboardSoundLevelIncrement); - break; - } - }; +/// +/// The ConfigIniToSoundGroupLevelControllerBinder allows for updated sound +/// group level values, and keyboard sound level adjustment increment +/// values, to flow between CConfigIni and the SoundGroupLevelController +/// without either of those two classes being aware of one another. +/// See those classes properties, methods, and events for more details. +/// +internal static class ConfigIniToSoundGroupLevelControllerBinder { + internal static void Bind(CConfigIni configIni, SoundGroupLevelController soundGroupLevelController) { + soundGroupLevelController.SetLevel(ESoundGroup.SoundEffect, configIni.SoundEffectLevel); + soundGroupLevelController.SetLevel(ESoundGroup.Voice, configIni.VoiceLevel); + soundGroupLevelController.SetLevel(ESoundGroup.SongPreview, configIni.SongPreviewLevel); + soundGroupLevelController.SetLevel(ESoundGroup.SongPlayback, configIni.SongPlaybackLevel); + soundGroupLevelController.SetKeyboardSoundLevelIncrement(configIni.KeyboardSoundLevelIncrement); - soundGroupLevelController.LevelChanged += (sender, args) => { - switch (args.SoundGroup) { - case ESoundGroup.SoundEffect: - configIni.SoundEffectLevel = args.Level; - break; - case ESoundGroup.Voice: - configIni.VoiceLevel = args.Level; - break; - case ESoundGroup.SongPreview: - configIni.SongPreviewLevel = args.Level; - break; - case ESoundGroup.SongPlayback: - configIni.SongPlaybackLevel = args.Level; - break; - default: - throw new ArgumentOutOfRangeException(); - } - }; - } + configIni.PropertyChanged += (sender, args) => { + switch (args.PropertyName) { + case nameof(CConfigIni.SoundEffectLevel): + soundGroupLevelController.SetLevel(ESoundGroup.SoundEffect, configIni.SoundEffectLevel); + break; + case nameof(CConfigIni.VoiceLevel): + soundGroupLevelController.SetLevel(ESoundGroup.Voice, configIni.VoiceLevel); + break; + case nameof(CConfigIni.SongPreviewLevel): + soundGroupLevelController.SetLevel(ESoundGroup.SongPreview, configIni.SongPreviewLevel); + break; + case nameof(CConfigIni.SongPlaybackLevel): + soundGroupLevelController.SetLevel(ESoundGroup.SongPlayback, configIni.SongPlaybackLevel); + break; + case nameof(CConfigIni.KeyboardSoundLevelIncrement): + soundGroupLevelController.SetKeyboardSoundLevelIncrement(configIni.KeyboardSoundLevelIncrement); + break; + } + }; + + soundGroupLevelController.LevelChanged += (sender, args) => { + switch (args.SoundGroup) { + case ESoundGroup.SoundEffect: + configIni.SoundEffectLevel = args.Level; + break; + case ESoundGroup.Voice: + configIni.VoiceLevel = args.Level; + break; + case ESoundGroup.SongPreview: + configIni.SongPreviewLevel = args.Level; + break; + case ESoundGroup.SongPlayback: + configIni.SongPlaybackLevel = args.Level; + break; + default: + throw new ArgumentOutOfRangeException(); + } + }; } } diff --git a/OpenTaiko/src/Common/ConfigManager.cs b/OpenTaiko/src/Common/ConfigManager.cs index 84e67064..beb18793 100644 --- a/OpenTaiko/src/Common/ConfigManager.cs +++ b/OpenTaiko/src/Common/ConfigManager.cs @@ -2,47 +2,47 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; -namespace OpenTaiko { +namespace OpenTaiko; + +/// +/// Class for reading and writing configuration files. +/// +public static class ConfigManager { + private static readonly JsonSerializerSettings Settings = + new JsonSerializerSettings() { + ObjectCreationHandling = ObjectCreationHandling.Auto, + DefaultValueHandling = DefaultValueHandling.Include, + NullValueHandling = NullValueHandling.Ignore, + MissingMemberHandling = MissingMemberHandling.Ignore, + Converters = new StringEnumConverter[] { new StringEnumConverter() } + }; + /// - /// Class for reading and writing configuration files. + /// Reads the configuration file. If the file does not exist, it will be created. /// - public static class ConfigManager { - private static readonly JsonSerializerSettings Settings = - new JsonSerializerSettings() { - ObjectCreationHandling = ObjectCreationHandling.Auto, - DefaultValueHandling = DefaultValueHandling.Include, - NullValueHandling = NullValueHandling.Ignore, - MissingMemberHandling = MissingMemberHandling.Ignore, - Converters = new StringEnumConverter[] { new StringEnumConverter() } - }; - - /// - /// Reads the configuration file. If the file does not exist, it will be created. - /// - /// Type of the object to deserialize. - /// File name. - /// Deserialized object. - public static T GetConfig(string filePath) where T : new() { - var json = ""; - if (!System.IO.File.Exists(filePath)) { - SaveConfig(new T(), filePath); - } - using (var stream = new System.IO.StreamReader(filePath, Encoding.UTF8)) { - json = stream.ReadToEnd(); - } - return JsonConvert.DeserializeObject(json, Settings); + /// Type of the object to deserialize. + /// File name. + /// Deserialized object. + public static T GetConfig(string filePath) where T : new() { + var json = ""; + if (!System.IO.File.Exists(filePath)) { + SaveConfig(new T(), filePath); } + using (var stream = new System.IO.StreamReader(filePath, Encoding.UTF8)) { + json = stream.ReadToEnd(); + } + return JsonConvert.DeserializeObject(json, Settings); + } - /// - /// Writes the object to a file. - /// - /// Object to serialize. - /// File name. - public static void SaveConfig(object obj, string filePath) { - (new FileInfo(filePath)).Directory.Create(); - using (var stream = new System.IO.StreamWriter(filePath, false, Encoding.UTF8)) { - stream.Write(JsonConvert.SerializeObject(obj, Formatting.None, Settings)); - } + /// + /// Writes the object to a file. + /// + /// Object to serialize. + /// File name. + public static void SaveConfig(object obj, string filePath) { + (new FileInfo(filePath)).Directory.Create(); + using (var stream = new System.IO.StreamWriter(filePath, false, Encoding.UTF8)) { + stream.Write(JsonConvert.SerializeObject(obj, Formatting.None, Settings)); } } } diff --git a/OpenTaiko/src/Common/Easing.cs b/OpenTaiko/src/Common/Easing.cs index 45e2e778..73509141 100644 --- a/OpenTaiko/src/Common/Easing.cs +++ b/OpenTaiko/src/Common/Easing.cs @@ -1,188 +1,188 @@ using FDK; -namespace OpenTaiko { - class Easing { - public int EaseIn(CCounter counter, float startPoint, float endPoint, CalcType type) { - StartPoint = startPoint; - EndPoint = endPoint; - Sa = EndPoint - StartPoint; - TimeMs = (int)counter.EndValue; - Type = type; - CounterValue = counter.CurrentValue; +namespace OpenTaiko; - switch (Type) { - case CalcType.Quadratic: //Quadratic - CounterValue /= TimeMs; - Value = Sa * CounterValue * CounterValue + StartPoint; - break; - case CalcType.Cubic: //Cubic - CounterValue /= TimeMs; - Value = Sa * CounterValue * CounterValue * CounterValue + StartPoint; - break; - case CalcType.Quartic: //Quartic - CounterValue /= TimeMs; - Value = Sa * CounterValue * CounterValue * CounterValue * CounterValue + StartPoint; - break; - case CalcType.Quintic: //Quintic - CounterValue /= TimeMs; - Value = Sa * CounterValue * CounterValue * CounterValue * CounterValue * CounterValue + StartPoint; - break; - case CalcType.Sinusoidal: //Sinusoidal - Value = -Sa * Math.Cos(CounterValue / TimeMs * (Math.PI / 2)) + Sa + StartPoint; - break; - case CalcType.Exponential: //Exponential - Value = Sa * Math.Pow(2, 10 * (CounterValue / TimeMs - 1)) + StartPoint; - break; - case CalcType.Circular: //Circular - CounterValue /= TimeMs; - Value = -Sa * (Math.Sqrt(1 - CounterValue * CounterValue) - 1) + StartPoint; - break; - case CalcType.Linear: //Linear - Value = Sa * (CounterValue / TimeMs) + StartPoint; - break; - } +class Easing { + public int EaseIn(CCounter counter, float startPoint, float endPoint, CalcType type) { + StartPoint = startPoint; + EndPoint = endPoint; + Sa = EndPoint - StartPoint; + TimeMs = (int)counter.EndValue; + Type = type; + CounterValue = counter.CurrentValue; - return (int)Value; - } - public int EaseOut(CCounter counter, float startPoint, float endPoint, CalcType type) { - StartPoint = startPoint; - EndPoint = endPoint; - Sa = EndPoint - StartPoint; - TimeMs = (int)counter.EndValue; - Type = type; - CounterValue = counter.CurrentValue; - - switch (Type) { - case CalcType.Quadratic: //Quadratic - CounterValue /= TimeMs; - Value = -Sa * CounterValue * (CounterValue - 2) + StartPoint; - break; - case CalcType.Cubic: //Cubic - CounterValue /= TimeMs; - CounterValue--; - Value = Sa * (CounterValue * CounterValue * CounterValue + 1) + StartPoint; - break; - case CalcType.Quartic: //Quartic - CounterValue /= TimeMs; - CounterValue--; - Value = -Sa * (CounterValue * CounterValue * CounterValue * CounterValue - 1) + StartPoint; - break; - case CalcType.Quintic: //Quintic - CounterValue /= TimeMs; - CounterValue--; - Value = Sa * (CounterValue * CounterValue * CounterValue * CounterValue * CounterValue + 1) + StartPoint; - break; - case CalcType.Sinusoidal: //Sinusoidal - Value = Sa * Math.Sin(CounterValue / TimeMs * (Math.PI / 2)) + StartPoint; - break; - case CalcType.Exponential: //Exponential - Value = Sa * (-Math.Pow(2, -10 * CounterValue / TimeMs) + 1) + StartPoint; - break; - case CalcType.Circular: //Circular - CounterValue /= TimeMs; - CounterValue--; - Value = Sa * Math.Sqrt(1 - CounterValue * CounterValue) + StartPoint; - break; - case CalcType.Linear: //Linear - CounterValue /= TimeMs; - Value = Sa * CounterValue + StartPoint; - break; - } - - return (int)Value; - } - public float EaseInOut(CCounter counter, float startPoint, float endPoint, CalcType type) { - StartPoint = startPoint; - EndPoint = endPoint; - Sa = EndPoint - StartPoint; - TimeMs = counter.EndValue; - Type = type; - CounterValue = counter.CurrentValue; - - switch (Type) { - case CalcType.Quadratic: //Quadratic - CounterValue /= TimeMs / 2; - if (CounterValue < 1) { - Value = Sa / 2 * CounterValue * CounterValue + StartPoint; - break; - } - CounterValue--; - Value = -Sa / 2 * (CounterValue * (CounterValue - 2) - 1) + StartPoint; - break; - case CalcType.Cubic: //Cubic - CounterValue /= TimeMs / 2; - if (CounterValue < 1) { - Value = Sa / 2 * CounterValue * CounterValue * CounterValue + StartPoint; - break; - } - CounterValue -= 2; - Value = Sa / 2 * (CounterValue * CounterValue * CounterValue + 2) + StartPoint; - break; - case CalcType.Quartic: //Quartic - CounterValue /= TimeMs / 2; - if (CounterValue < 1) { - Value = Sa / 2 * CounterValue * CounterValue * CounterValue * CounterValue + StartPoint; - break; - } - CounterValue -= 2; - Value = -Sa / 2 * (CounterValue * CounterValue * CounterValue * CounterValue - 2) + StartPoint; - break; - case CalcType.Quintic: //Quintic - CounterValue /= TimeMs; - CounterValue /= TimeMs / 2; - if (CounterValue < 1) { - Value = Sa / 2 * CounterValue * CounterValue * CounterValue * CounterValue * CounterValue + StartPoint; - break; - } - CounterValue -= 2; - Value = Sa / 2 * (CounterValue * CounterValue * CounterValue * CounterValue * CounterValue + 2) + StartPoint; - break; - case CalcType.Sinusoidal: //Sinusoidal - Value = -Sa / 2 * (Math.Cos(Math.PI * CounterValue / TimeMs) - 1) + StartPoint; - break; - case CalcType.Exponential: //Exponential - CounterValue /= TimeMs / 2; - if (CounterValue < 1) { - Value = Sa / 2 * Math.Pow(2, 10 * (CounterValue - 1)) + StartPoint; - break; - } - CounterValue--; - Value = Sa / 2 * (-Math.Pow(2, -10 * CounterValue) + 2) + StartPoint; - break; - case CalcType.Circular: //Circular - CounterValue /= TimeMs / 2; - if (CounterValue < 1) { - Value = -Sa / 2 * (Math.Sqrt(1 - CounterValue * CounterValue) - 1) + StartPoint; - break; - } - CounterValue -= 2; - Value = Sa / 2 * (Math.Sqrt(1 - CounterValue * CounterValue) + 1) + StartPoint; - break; - case CalcType.Linear: //Linear - CounterValue /= TimeMs; - Value = Sa * CounterValue + StartPoint; - break; - } - - return (float)Value; + switch (Type) { + case CalcType.Quadratic: //Quadratic + CounterValue /= TimeMs; + Value = Sa * CounterValue * CounterValue + StartPoint; + break; + case CalcType.Cubic: //Cubic + CounterValue /= TimeMs; + Value = Sa * CounterValue * CounterValue * CounterValue + StartPoint; + break; + case CalcType.Quartic: //Quartic + CounterValue /= TimeMs; + Value = Sa * CounterValue * CounterValue * CounterValue * CounterValue + StartPoint; + break; + case CalcType.Quintic: //Quintic + CounterValue /= TimeMs; + Value = Sa * CounterValue * CounterValue * CounterValue * CounterValue * CounterValue + StartPoint; + break; + case CalcType.Sinusoidal: //Sinusoidal + Value = -Sa * Math.Cos(CounterValue / TimeMs * (Math.PI / 2)) + Sa + StartPoint; + break; + case CalcType.Exponential: //Exponential + Value = Sa * Math.Pow(2, 10 * (CounterValue / TimeMs - 1)) + StartPoint; + break; + case CalcType.Circular: //Circular + CounterValue /= TimeMs; + Value = -Sa * (Math.Sqrt(1 - CounterValue * CounterValue) - 1) + StartPoint; + break; + case CalcType.Linear: //Linear + Value = Sa * (CounterValue / TimeMs) + StartPoint; + break; } - private float StartPoint; - private float EndPoint; - private float Sa; - private double TimeMs; - private CalcType Type; - private double CounterValue; - private double Value; - public enum CalcType { - Quadratic, - Cubic, - Quartic, - Quintic, - Sinusoidal, - Exponential, - Circular, - Linear + return (int)Value; + } + public int EaseOut(CCounter counter, float startPoint, float endPoint, CalcType type) { + StartPoint = startPoint; + EndPoint = endPoint; + Sa = EndPoint - StartPoint; + TimeMs = (int)counter.EndValue; + Type = type; + CounterValue = counter.CurrentValue; + + switch (Type) { + case CalcType.Quadratic: //Quadratic + CounterValue /= TimeMs; + Value = -Sa * CounterValue * (CounterValue - 2) + StartPoint; + break; + case CalcType.Cubic: //Cubic + CounterValue /= TimeMs; + CounterValue--; + Value = Sa * (CounterValue * CounterValue * CounterValue + 1) + StartPoint; + break; + case CalcType.Quartic: //Quartic + CounterValue /= TimeMs; + CounterValue--; + Value = -Sa * (CounterValue * CounterValue * CounterValue * CounterValue - 1) + StartPoint; + break; + case CalcType.Quintic: //Quintic + CounterValue /= TimeMs; + CounterValue--; + Value = Sa * (CounterValue * CounterValue * CounterValue * CounterValue * CounterValue + 1) + StartPoint; + break; + case CalcType.Sinusoidal: //Sinusoidal + Value = Sa * Math.Sin(CounterValue / TimeMs * (Math.PI / 2)) + StartPoint; + break; + case CalcType.Exponential: //Exponential + Value = Sa * (-Math.Pow(2, -10 * CounterValue / TimeMs) + 1) + StartPoint; + break; + case CalcType.Circular: //Circular + CounterValue /= TimeMs; + CounterValue--; + Value = Sa * Math.Sqrt(1 - CounterValue * CounterValue) + StartPoint; + break; + case CalcType.Linear: //Linear + CounterValue /= TimeMs; + Value = Sa * CounterValue + StartPoint; + break; } + + return (int)Value; + } + public float EaseInOut(CCounter counter, float startPoint, float endPoint, CalcType type) { + StartPoint = startPoint; + EndPoint = endPoint; + Sa = EndPoint - StartPoint; + TimeMs = counter.EndValue; + Type = type; + CounterValue = counter.CurrentValue; + + switch (Type) { + case CalcType.Quadratic: //Quadratic + CounterValue /= TimeMs / 2; + if (CounterValue < 1) { + Value = Sa / 2 * CounterValue * CounterValue + StartPoint; + break; + } + CounterValue--; + Value = -Sa / 2 * (CounterValue * (CounterValue - 2) - 1) + StartPoint; + break; + case CalcType.Cubic: //Cubic + CounterValue /= TimeMs / 2; + if (CounterValue < 1) { + Value = Sa / 2 * CounterValue * CounterValue * CounterValue + StartPoint; + break; + } + CounterValue -= 2; + Value = Sa / 2 * (CounterValue * CounterValue * CounterValue + 2) + StartPoint; + break; + case CalcType.Quartic: //Quartic + CounterValue /= TimeMs / 2; + if (CounterValue < 1) { + Value = Sa / 2 * CounterValue * CounterValue * CounterValue * CounterValue + StartPoint; + break; + } + CounterValue -= 2; + Value = -Sa / 2 * (CounterValue * CounterValue * CounterValue * CounterValue - 2) + StartPoint; + break; + case CalcType.Quintic: //Quintic + CounterValue /= TimeMs; + CounterValue /= TimeMs / 2; + if (CounterValue < 1) { + Value = Sa / 2 * CounterValue * CounterValue * CounterValue * CounterValue * CounterValue + StartPoint; + break; + } + CounterValue -= 2; + Value = Sa / 2 * (CounterValue * CounterValue * CounterValue * CounterValue * CounterValue + 2) + StartPoint; + break; + case CalcType.Sinusoidal: //Sinusoidal + Value = -Sa / 2 * (Math.Cos(Math.PI * CounterValue / TimeMs) - 1) + StartPoint; + break; + case CalcType.Exponential: //Exponential + CounterValue /= TimeMs / 2; + if (CounterValue < 1) { + Value = Sa / 2 * Math.Pow(2, 10 * (CounterValue - 1)) + StartPoint; + break; + } + CounterValue--; + Value = Sa / 2 * (-Math.Pow(2, -10 * CounterValue) + 2) + StartPoint; + break; + case CalcType.Circular: //Circular + CounterValue /= TimeMs / 2; + if (CounterValue < 1) { + Value = -Sa / 2 * (Math.Sqrt(1 - CounterValue * CounterValue) - 1) + StartPoint; + break; + } + CounterValue -= 2; + Value = Sa / 2 * (Math.Sqrt(1 - CounterValue * CounterValue) + 1) + StartPoint; + break; + case CalcType.Linear: //Linear + CounterValue /= TimeMs; + Value = Sa * CounterValue + StartPoint; + break; + } + + return (float)Value; + } + + private float StartPoint; + private float EndPoint; + private float Sa; + private double TimeMs; + private CalcType Type; + private double CounterValue; + private double Value; + public enum CalcType { + Quadratic, + Cubic, + Quartic, + Quintic, + Sinusoidal, + Exponential, + Circular, + Linear } } diff --git a/OpenTaiko/src/Common/Favorites.cs b/OpenTaiko/src/Common/Favorites.cs index ea4a1994..305d49c0 100644 --- a/OpenTaiko/src/Common/Favorites.cs +++ b/OpenTaiko/src/Common/Favorites.cs @@ -1,47 +1,46 @@ -namespace OpenTaiko { - internal class Favorites { - public void tFavorites() { - if (!File.Exists("Favorite.json")) - tSaveFile(); - - tLoadFile(); - } - - #region [Auxiliary methods] - - public void tToggleFavorite(string chartID) { - if (tIsFavorite(chartID)) - data.favorites[OpenTaiko.SaveFile].Remove(chartID); - else - data.favorites[OpenTaiko.SaveFile].Add(chartID); +namespace OpenTaiko; +internal class Favorites { + public void tFavorites() { + if (!File.Exists("Favorite.json")) tSaveFile(); - } - public bool tIsFavorite(string chartID) { - return (data.favorites[OpenTaiko.SaveFile].Contains(chartID)); - } - - - #endregion - - public class Data { - public HashSet[] favorites = new HashSet[2] { new HashSet(), new HashSet() }; - } - - public Data data = new Data(); - - #region [private] - - private void tSaveFile() { - ConfigManager.SaveConfig(data, "Favorite.json"); - } - - private void tLoadFile() { - data = ConfigManager.GetConfig(@"Favorite.json"); - } - - #endregion + tLoadFile(); } + #region [Auxiliary methods] + + public void tToggleFavorite(string chartID) { + if (tIsFavorite(chartID)) + data.favorites[OpenTaiko.SaveFile].Remove(chartID); + else + data.favorites[OpenTaiko.SaveFile].Add(chartID); + + tSaveFile(); + } + + public bool tIsFavorite(string chartID) { + return (data.favorites[OpenTaiko.SaveFile].Contains(chartID)); + } + + + #endregion + + public class Data { + public HashSet[] favorites = new HashSet[2] { new HashSet(), new HashSet() }; + } + + public Data data = new Data(); + + #region [private] + + private void tSaveFile() { + ConfigManager.SaveConfig(data, "Favorite.json"); + } + + private void tLoadFile() { + data = ConfigManager.GetConfig(@"Favorite.json"); + } + + #endregion } diff --git a/OpenTaiko/src/Common/ImGuiDebugWindow.cs b/OpenTaiko/src/Common/ImGuiDebugWindow.cs index 9a711110..fd69c443 100644 --- a/OpenTaiko/src/Common/ImGuiDebugWindow.cs +++ b/OpenTaiko/src/Common/ImGuiDebugWindow.cs @@ -7,547 +7,547 @@ using FDK; using ImGuiNET; using SampleFramework; -namespace OpenTaiko { - /* - FOR DEBUGGING! This class is intended for developers only! - */ - public static class ImGuiDebugWindow { - private static bool showImGuiDemoWindow = false; - private static Assembly assemblyinfo = Assembly.GetExecutingAssembly(); +namespace OpenTaiko; - private static long memoryReadTimer = 0; - private static long pagedmemory = 0; - private static int textureMemoryUsage = 0; - private static int currentStageMemoryUsage = 0; +/* + FOR DEBUGGING! This class is intended for developers only! +*/ +public static class ImGuiDebugWindow { + private static bool showImGuiDemoWindow = false; + private static Assembly assemblyinfo = Assembly.GetExecutingAssembly(); - private static int sortType = -1; - private static readonly string[] sortNames = ["Memory Usage (Highest->Lowest)", "Memory Usage (Lowest->Highest)", "Pointer ID"]; - private static string reloadTexPath = ""; - public static void Draw() { - if (SampleFramework.Game.ImGuiController == null) return; + private static long memoryReadTimer = 0; + private static long pagedmemory = 0; + private static int textureMemoryUsage = 0; + private static int currentStageMemoryUsage = 0; - #region Fetch allocated memory - if (SoundManager.PlayTimer.SystemTimeMs - memoryReadTimer > 5000) { - memoryReadTimer = SoundManager.PlayTimer.SystemTimeMs; - Task.Factory.StartNew(() => { - using (Process process = Process.GetCurrentProcess()) { - pagedmemory = process.PagedMemorySize64; - } - }); - } + private static int sortType = -1; + private static readonly string[] sortNames = ["Memory Usage (Highest->Lowest)", "Memory Usage (Lowest->Highest)", "Pointer ID"]; + private static string reloadTexPath = ""; + public static void Draw() { + if (SampleFramework.Game.ImGuiController == null) return; + + #region Fetch allocated memory + if (SoundManager.PlayTimer.SystemTimeMs - memoryReadTimer > 5000) { + memoryReadTimer = SoundManager.PlayTimer.SystemTimeMs; + Task.Factory.StartNew(() => { + using (Process process = Process.GetCurrentProcess()) { + pagedmemory = process.PagedMemorySize64; + } + }); + } + #endregion + + ImGui.SetNextWindowPos(new System.Numerics.Vector2(0, 0), ImGuiCond.FirstUseEver); + ImGui.SetNextWindowSize(new System.Numerics.Vector2(400,300), ImGuiCond.FirstUseEver); + if (ImGui.Begin("Debug Window (Toggle Visbility with F11)###DEBUG")) { + + #region Debug Info + ImGui.Checkbox("Show ImGui Demo Window", ref showImGuiDemoWindow); + if (showImGuiDemoWindow) { ImGui.ShowDemoWindow(); } + + ImGui.Separator(); + ImGui.Text($"Game Version: {OpenTaiko.VERSION}"); + ImGui.Text($"Allocated Memory: {pagedmemory} bytes ({String.Format("{0:0.###}",(float)pagedmemory / (1024 * 1024 * 1024))}GB)"); + ImGui.Text($"FPS: {(OpenTaiko.FPS != null ? OpenTaiko.FPS.NowFPS : "???")}"); + ImGui.Text("Current Stage: " + OpenTaiko.r現在のステージ.eStageID.ToString() + " (StageID " + ((int)OpenTaiko.r現在のステージ.eStageID).ToString() + ")"); #endregion - ImGui.SetNextWindowPos(new System.Numerics.Vector2(0, 0), ImGuiCond.FirstUseEver); - ImGui.SetNextWindowSize(new System.Numerics.Vector2(400,300), ImGuiCond.FirstUseEver); - if (ImGui.Begin("Debug Window (Toggle Visbility with F11)###DEBUG")) { + ImGui.BeginTabBar("Tabs"); - #region Debug Info - ImGui.Checkbox("Show ImGui Demo Window", ref showImGuiDemoWindow); - if (showImGuiDemoWindow) { ImGui.ShowDemoWindow(); } + #region Tabs + System(); + Inputs(); + Profile(); + Stage(); + Textures(); + #endregion - ImGui.Separator(); - ImGui.Text($"Game Version: {OpenTaiko.VERSION}"); - ImGui.Text($"Allocated Memory: {pagedmemory} bytes ({String.Format("{0:0.###}",(float)pagedmemory / (1024 * 1024 * 1024))}GB)"); - ImGui.Text($"FPS: {(OpenTaiko.FPS != null ? OpenTaiko.FPS.NowFPS : "???")}"); - ImGui.Text("Current Stage: " + OpenTaiko.r現在のステージ.eStageID.ToString() + " (StageID " + ((int)OpenTaiko.r現在のステージ.eStageID).ToString() + ")"); - #endregion + ImGui.EndTabBar(); - ImGui.BeginTabBar("Tabs"); - - #region Tabs - System(); - Inputs(); - Profile(); - Stage(); - Textures(); - #endregion - - ImGui.EndTabBar(); - - ImGui.End(); - } + ImGui.End(); } - #region Tabs - private static void System() { - if (ImGui.BeginTabItem("System")) { - ImGui.TextWrapped($"Path: {(Environment.ProcessPath != null ? Environment.ProcessPath : "???")}"); - ImGui.NewLine(); - ImGui.Text($"OS Version: {Environment.OSVersion} ({RuntimeInformation.RuntimeIdentifier})"); - ImGui.Text($"OS Architecture: {RuntimeInformation.OSArchitecture}"); - ImGui.Text($"Framework Version: {RuntimeInformation.FrameworkDescription}"); - ImGui.NewLine(); - ImGui.Text("Graphics API: " + Game.GraphicsDeviceType_); - ImGui.Text("Audio Device: " + OpenTaiko.SoundManager.GetCurrentSoundDeviceType()); + } + #region Tabs + private static void System() { + if (ImGui.BeginTabItem("System")) { + ImGui.TextWrapped($"Path: {(Environment.ProcessPath != null ? Environment.ProcessPath : "???")}"); + ImGui.NewLine(); + ImGui.Text($"OS Version: {Environment.OSVersion} ({RuntimeInformation.RuntimeIdentifier})"); + ImGui.Text($"OS Architecture: {RuntimeInformation.OSArchitecture}"); + ImGui.Text($"Framework Version: {RuntimeInformation.FrameworkDescription}"); + ImGui.NewLine(); + ImGui.Text("Graphics API: " + Game.GraphicsDeviceType_); + ImGui.Text("Audio Device: " + OpenTaiko.SoundManager.GetCurrentSoundDeviceType()); - ImGui.EndTabItem(); - } + ImGui.EndTabItem(); } - private static void Inputs() { - if (ImGui.BeginTabItem("Inputs")) { + } + private static void Inputs() { + if (ImGui.BeginTabItem("Inputs")) { - ImGui.Text("Total Inputs Found: " + OpenTaiko.InputManager.InputDevices.Count()); + ImGui.Text("Total Inputs Found: " + OpenTaiko.InputManager.InputDevices.Count()); - ImGui.NewLine(); + ImGui.NewLine(); - ImGui.Text("Input Count:"); - ImGui.Indent(); - ImGui.Text("Keyboard: " + OpenTaiko.InputManager.InputDevices.Count(device => device.CurrentType == InputDeviceType.Keyboard)); - ImGui.Text("Mouse: " + OpenTaiko.InputManager.InputDevices.Count(device => device.CurrentType == InputDeviceType.Mouse)); - ImGui.Text("Gamepad: " + OpenTaiko.InputManager.InputDevices.Count(device => device.CurrentType == InputDeviceType.Gamepad)); - ImGui.Text("Joystick: " + OpenTaiko.InputManager.InputDevices.Count(device => device.CurrentType == InputDeviceType.Joystick)); - ImGui.Text("MIDI: " + OpenTaiko.InputManager.InputDevices.Count(device => device.CurrentType == InputDeviceType.MidiIn)); - ImGui.Text("Unknown: " + OpenTaiko.InputManager.InputDevices.Count(device => device.CurrentType == InputDeviceType.Unknown)); + ImGui.Text("Input Count:"); + ImGui.Indent(); + ImGui.Text("Keyboard: " + OpenTaiko.InputManager.InputDevices.Count(device => device.CurrentType == InputDeviceType.Keyboard)); + ImGui.Text("Mouse: " + OpenTaiko.InputManager.InputDevices.Count(device => device.CurrentType == InputDeviceType.Mouse)); + ImGui.Text("Gamepad: " + OpenTaiko.InputManager.InputDevices.Count(device => device.CurrentType == InputDeviceType.Gamepad)); + ImGui.Text("Joystick: " + OpenTaiko.InputManager.InputDevices.Count(device => device.CurrentType == InputDeviceType.Joystick)); + ImGui.Text("MIDI: " + OpenTaiko.InputManager.InputDevices.Count(device => device.CurrentType == InputDeviceType.MidiIn)); + ImGui.Text("Unknown: " + OpenTaiko.InputManager.InputDevices.Count(device => device.CurrentType == InputDeviceType.Unknown)); - foreach (IInputDevice device in OpenTaiko.InputManager.InputDevices) { - if (ImGui.TreeNodeEx(device.CurrentType.ToString() + " (ID " + device.ID + " / Name: " + device.Name + ")")) { - switch (device.CurrentType) { - case InputDeviceType.Keyboard: - var keyboard = (CInputKeyboard)device; - for (int i = 0; i < keyboard.KeyStates.Length; i++) { - if (keyboard.KeyPressed(i)) { ImGui.Text((SlimDXKeys.Key)i + " Pressed!"); } - if (keyboard.KeyPressing(i)) { ImGui.Text((SlimDXKeys.Key)i + " Pressing!"); } - if (keyboard.KeyReleased(i)) { ImGui.Text((SlimDXKeys.Key)i + " Released!"); } - } - break; - case InputDeviceType.Mouse: - var mouse = (CInputMouse)device; - for (int i = 0; i < mouse.MouseStates.Length; i++) { - if (mouse.KeyPressed(i)) { ImGui.Text((Silk.NET.Input.MouseButton)i + " Pressed!"); } - if (mouse.KeyPressing(i)) { ImGui.Text((Silk.NET.Input.MouseButton)i + " Pressing!"); } - if (mouse.KeyReleased(i)) { ImGui.Text((Silk.NET.Input.MouseButton)i + " Released!"); } - } - break; - case InputDeviceType.Gamepad: - var gamepad = (CInputGamepad)device; - for (int i = 0; i < gamepad.ButtonStates.Length; i++) { - if (gamepad.KeyPressed(i)) { ImGui.Text((Silk.NET.Input.ButtonName)i + " Pressed!"); } - if (gamepad.KeyPressing(i)) { ImGui.Text((Silk.NET.Input.ButtonName)i + " Pressing!"); } - if (gamepad.KeyReleased(i)) { ImGui.Text((Silk.NET.Input.ButtonName)i + " Released!"); } - } - break; - case InputDeviceType.Joystick: - var joystick = (CInputJoystick)device; - for (int i = 0; i < joystick.ButtonStates.Length; i++) { - if (joystick.KeyPressed(i)) { ImGui.Text((Silk.NET.Input.ButtonName)i + " Pressed!"); } - if (joystick.KeyPressing(i)) { ImGui.Text((Silk.NET.Input.ButtonName)i + " Pressing!"); } - if (joystick.KeyReleased(i)) { ImGui.Text((Silk.NET.Input.ButtonName)i + " Released!"); } - } - break; - case InputDeviceType.MidiIn: - var midiin = (CInputMIDI)device; - //for (int i = 0; i < midiin.InputEvents.Count; i++) { - // if (midiin.InputEvents[i].Pressed) { ImGui.Text(midiin.InputEvents[i].nKey + " Pressed!"); } - // if (midiin.KeyPressing(i)) { ImGui.Text("Pressing!"); } - // if (midiin.InputEvents[i].Released) { ImGui.Text(midiin.InputEvents[i].nKey + " Released!"); } - //} - ImGui.TextColored(new Vector4(1, 0, 0, 1), "MIDI input polling is currently disabled."); - break; - case InputDeviceType.Unknown: - ImGui.TextDisabled("Unknown input device type."); - ImGui.TextDisabled("GUID: " + device.GUID); - break; - } - ImGui.TreePop(); - } - } - - ImGui.EndTabItem(); - } - } - private static void Profile() { - if (ImGui.BeginTabItem("Profile")) { - - ImGui.BeginDisabled(OpenTaiko.r現在のステージ.eStageID == CStage.EStage.Game); - int count = OpenTaiko.ConfigIni.nPlayerCount; - if (ImGui.InputInt("Player Count", ref count)) - OpenTaiko.ConfigIni.nPlayerCount = Math.Clamp(count, 1, 5); // funny things can happen when the player count is set to 0 - ImGui.EndDisabled(); - - for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { - if (ImGui.TreeNodeEx($"Player {i + 1}###TREE_PROFILE_{i}", ImGuiTreeNodeFlags.Framed | ImGuiTreeNodeFlags.DefaultOpen)) { - int save = i == 0 ? OpenTaiko.SaveFile : i; - - if (i == 1 && OpenTaiko.ConfigIni.bAIBattleMode) - ImGui.TextColored(new System.Numerics.Vector4(0.4f, 0.8f, 1.0f, 1.0f), "2P is occupied. AI Battle is active."); - - ImGui.Text($"ID: {OpenTaiko.SaveFileInstances[save].data.SaveId}"); - ImGui.InputText("Name", ref OpenTaiko.SaveFileInstances[save].data.Name, 64); - - if (ImGui.Button("Update")) { - OpenTaiko.SaveFileInstances[save].tApplyHeyaChanges(); - OpenTaiko.NamePlate.tNamePlateRefreshTitles(save); - } - - string preview = OpenTaiko.SaveFileInstances[save].data.TitleId == 0 ? "初心者" : OpenTaiko.Databases.DBNameplateUnlockables.data[OpenTaiko.SaveFileInstances[save].data.TitleId].nameplateInfo.cld.GetString(""); - - if (ImGui.BeginCombo("Nameplate", preview)) { - foreach (long id in OpenTaiko.Databases.DBNameplateUnlockables.data.Keys) { - bool unlocked = OpenTaiko.SaveFileInstances[save].data.UnlockedNameplateIds.Contains((int)id); - - if (ImGui.Selectable(OpenTaiko.Databases.DBNameplateUnlockables.data[id].nameplateInfo.cld.GetString("") + (!unlocked ? " [Locked]" : ""), OpenTaiko.SaveFileInstances[save].data.TitleId == (int)id)) { - var nameplate = OpenTaiko.Databases.DBNameplateUnlockables.data[id]; - OpenTaiko.SaveFileInstances[save].data.TitleId = (int)id; - OpenTaiko.SaveFileInstances[save].data.Title = nameplate.nameplateInfo.cld.GetString(""); - OpenTaiko.SaveFileInstances[save].data.TitleRarityInt = HRarity.tRarityToLangInt(nameplate.rarity); - OpenTaiko.SaveFileInstances[save].data.TitleType = nameplate.nameplateInfo.iType; - - OpenTaiko.SaveFileInstances[save].tApplyHeyaChanges(); - OpenTaiko.NamePlate.tNamePlateRefreshTitles(save); - } + foreach (IInputDevice device in OpenTaiko.InputManager.InputDevices) { + if (ImGui.TreeNodeEx(device.CurrentType.ToString() + " (ID " + device.ID + " / Name: " + device.Name + ")")) { + switch (device.CurrentType) { + case InputDeviceType.Keyboard: + var keyboard = (CInputKeyboard)device; + for (int i = 0; i < keyboard.KeyStates.Length; i++) { + if (keyboard.KeyPressed(i)) { ImGui.Text((SlimDXKeys.Key)i + " Pressed!"); } + if (keyboard.KeyPressing(i)) { ImGui.Text((SlimDXKeys.Key)i + " Pressing!"); } + if (keyboard.KeyReleased(i)) { ImGui.Text((SlimDXKeys.Key)i + " Released!"); } } - ImGui.EndCombo(); - } - - if (ImGui.BeginCombo("Dan Title", OpenTaiko.SaveFileInstances[save].data.Dan)) { - foreach (var dan in OpenTaiko.SaveFileInstances[save].data.DanTitles) { - if (ImGui.Selectable(dan.Key)) { - OpenTaiko.SaveFileInstances[save].data.Dan = dan.Key; - OpenTaiko.SaveFileInstances[save].data.DanGold = dan.Value.isGold; - OpenTaiko.SaveFileInstances[save].data.DanType = dan.Value.clearStatus; - - OpenTaiko.SaveFileInstances[save].tApplyHeyaChanges(); - OpenTaiko.NamePlate.tNamePlateRefreshTitles(save); - } + break; + case InputDeviceType.Mouse: + var mouse = (CInputMouse)device; + for (int i = 0; i < mouse.MouseStates.Length; i++) { + if (mouse.KeyPressed(i)) { ImGui.Text((Silk.NET.Input.MouseButton)i + " Pressed!"); } + if (mouse.KeyPressing(i)) { ImGui.Text((Silk.NET.Input.MouseButton)i + " Pressing!"); } + if (mouse.KeyReleased(i)) { ImGui.Text((Silk.NET.Input.MouseButton)i + " Released!"); } } + break; + case InputDeviceType.Gamepad: + var gamepad = (CInputGamepad)device; + for (int i = 0; i < gamepad.ButtonStates.Length; i++) { + if (gamepad.KeyPressed(i)) { ImGui.Text((Silk.NET.Input.ButtonName)i + " Pressed!"); } + if (gamepad.KeyPressing(i)) { ImGui.Text((Silk.NET.Input.ButtonName)i + " Pressing!"); } + if (gamepad.KeyReleased(i)) { ImGui.Text((Silk.NET.Input.ButtonName)i + " Released!"); } + } + break; + case InputDeviceType.Joystick: + var joystick = (CInputJoystick)device; + for (int i = 0; i < joystick.ButtonStates.Length; i++) { + if (joystick.KeyPressed(i)) { ImGui.Text((Silk.NET.Input.ButtonName)i + " Pressed!"); } + if (joystick.KeyPressing(i)) { ImGui.Text((Silk.NET.Input.ButtonName)i + " Pressing!"); } + if (joystick.KeyReleased(i)) { ImGui.Text((Silk.NET.Input.ButtonName)i + " Released!"); } + } + break; + case InputDeviceType.MidiIn: + var midiin = (CInputMIDI)device; + //for (int i = 0; i < midiin.InputEvents.Count; i++) { + // if (midiin.InputEvents[i].Pressed) { ImGui.Text(midiin.InputEvents[i].nKey + " Pressed!"); } + // if (midiin.KeyPressing(i)) { ImGui.Text("Pressing!"); } + // if (midiin.InputEvents[i].Released) { ImGui.Text(midiin.InputEvents[i].nKey + " Released!"); } + //} + ImGui.TextColored(new Vector4(1, 0, 0, 1), "MIDI input polling is currently disabled."); + break; + case InputDeviceType.Unknown: + ImGui.TextDisabled("Unknown input device type."); + ImGui.TextDisabled("GUID: " + device.GUID); + break; + } + ImGui.TreePop(); + } + } - ImGui.EndCombo(); + ImGui.EndTabItem(); + } + } + private static void Profile() { + if (ImGui.BeginTabItem("Profile")) { + + ImGui.BeginDisabled(OpenTaiko.r現在のステージ.eStageID == CStage.EStage.Game); + int count = OpenTaiko.ConfigIni.nPlayerCount; + if (ImGui.InputInt("Player Count", ref count)) + OpenTaiko.ConfigIni.nPlayerCount = Math.Clamp(count, 1, 5); // funny things can happen when the player count is set to 0 + ImGui.EndDisabled(); + + for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { + if (ImGui.TreeNodeEx($"Player {i + 1}###TREE_PROFILE_{i}", ImGuiTreeNodeFlags.Framed | ImGuiTreeNodeFlags.DefaultOpen)) { + int save = i == 0 ? OpenTaiko.SaveFile : i; + + if (i == 1 && OpenTaiko.ConfigIni.bAIBattleMode) + ImGui.TextColored(new System.Numerics.Vector4(0.4f, 0.8f, 1.0f, 1.0f), "2P is occupied. AI Battle is active."); + + ImGui.Text($"ID: {OpenTaiko.SaveFileInstances[save].data.SaveId}"); + ImGui.InputText("Name", ref OpenTaiko.SaveFileInstances[save].data.Name, 64); + + if (ImGui.Button("Update")) { + OpenTaiko.SaveFileInstances[save].tApplyHeyaChanges(); + OpenTaiko.NamePlate.tNamePlateRefreshTitles(save); + } + + string preview = OpenTaiko.SaveFileInstances[save].data.TitleId == 0 ? "初心者" : OpenTaiko.Databases.DBNameplateUnlockables.data[OpenTaiko.SaveFileInstances[save].data.TitleId].nameplateInfo.cld.GetString(""); + + if (ImGui.BeginCombo("Nameplate", preview)) { + foreach (long id in OpenTaiko.Databases.DBNameplateUnlockables.data.Keys) { + bool unlocked = OpenTaiko.SaveFileInstances[save].data.UnlockedNameplateIds.Contains((int)id); + + if (ImGui.Selectable(OpenTaiko.Databases.DBNameplateUnlockables.data[id].nameplateInfo.cld.GetString("") + (!unlocked ? " [Locked]" : ""), OpenTaiko.SaveFileInstances[save].data.TitleId == (int)id)) { + var nameplate = OpenTaiko.Databases.DBNameplateUnlockables.data[id]; + OpenTaiko.SaveFileInstances[save].data.TitleId = (int)id; + OpenTaiko.SaveFileInstances[save].data.Title = nameplate.nameplateInfo.cld.GetString(""); + OpenTaiko.SaveFileInstances[save].data.TitleRarityInt = HRarity.tRarityToLangInt(nameplate.rarity); + OpenTaiko.SaveFileInstances[save].data.TitleType = nameplate.nameplateInfo.iType; + + OpenTaiko.SaveFileInstances[save].tApplyHeyaChanges(); + OpenTaiko.NamePlate.tNamePlateRefreshTitles(save); + } + } + ImGui.EndCombo(); + } + + if (ImGui.BeginCombo("Dan Title", OpenTaiko.SaveFileInstances[save].data.Dan)) { + foreach (var dan in OpenTaiko.SaveFileInstances[save].data.DanTitles) { + if (ImGui.Selectable(dan.Key)) { + OpenTaiko.SaveFileInstances[save].data.Dan = dan.Key; + OpenTaiko.SaveFileInstances[save].data.DanGold = dan.Value.isGold; + OpenTaiko.SaveFileInstances[save].data.DanType = dan.Value.clearStatus; + + OpenTaiko.SaveFileInstances[save].tApplyHeyaChanges(); + OpenTaiko.NamePlate.tNamePlateRefreshTitles(save); + } } - ImGui.NewLine(); - - ImGui.Text($"Total Plays: {OpenTaiko.SaveFileInstances[save].data.TotalPlaycount}"); - ImGui.Text($"Coins: {OpenTaiko.SaveFileInstances[save].data.Medals} (Lifetime: {OpenTaiko.SaveFileInstances[save].data.TotalEarnedMedals})"); - - ImGui.TreePop(); + ImGui.EndCombo(); } + + ImGui.NewLine(); + + ImGui.Text($"Total Plays: {OpenTaiko.SaveFileInstances[save].data.TotalPlaycount}"); + ImGui.Text($"Coins: {OpenTaiko.SaveFileInstances[save].data.Medals} (Lifetime: {OpenTaiko.SaveFileInstances[save].data.TotalEarnedMedals})"); + + ImGui.TreePop(); } - ImGui.EndTabItem(); } + ImGui.EndTabItem(); } - private static void Stage() { - if (ImGui.BeginTabItem("Stage")) { + } + private static void Stage() { + if (ImGui.BeginTabItem("Stage")) { - switch (OpenTaiko.r現在のステージ.eStageID) { - case CStage.EStage.SongSelect: - System.Numerics.Vector4 normal = new System.Numerics.Vector4(1, 1, 1, 1); - System.Numerics.Vector4 diff = new System.Numerics.Vector4(0.5f, 1, 0.5f, 1); + switch (OpenTaiko.r現在のステージ.eStageID) { + case CStage.EStage.SongSelect: + System.Numerics.Vector4 normal = new System.Numerics.Vector4(1, 1, 1, 1); + System.Numerics.Vector4 diff = new System.Numerics.Vector4(0.5f, 1, 0.5f, 1); - ImGui.TextColored(OpenTaiko.ConfigIni.SongPlaybackSpeed == 1 ? normal : diff, - String.Format("Song Playback Speed: {0:0.00}", OpenTaiko.ConfigIni.SongPlaybackSpeed)); + ImGui.TextColored(OpenTaiko.ConfigIni.SongPlaybackSpeed == 1 ? normal : diff, + String.Format("Song Playback Speed: {0:0.00}", OpenTaiko.ConfigIni.SongPlaybackSpeed)); - ImGui.TextColored(OpenTaiko.ConfigIni.bTokkunMode ? diff : normal, - "Training Mode: " + OpenTaiko.ConfigIni.bTokkunMode); + ImGui.TextColored(OpenTaiko.ConfigIni.bTokkunMode ? diff : normal, + "Training Mode: " + OpenTaiko.ConfigIni.bTokkunMode); - for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { + for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { - bool modifiedstats = - OpenTaiko.ConfigIni.nScrollSpeed[i] != 9 || - OpenTaiko.ConfigIni.eSTEALTH[i] != EStealthMode.Off || - OpenTaiko.ConfigIni.eRandom[i] != ERandomMode.Off || - OpenTaiko.ConfigIni.nTimingZones[i] != 2 || - OpenTaiko.ConfigIni.bJust[i] != 0 || - OpenTaiko.ConfigIni.nGameType[i] != EGameType.Taiko || - OpenTaiko.ConfigIni.nFunMods[i] != EFunMods.None; + bool modifiedstats = + OpenTaiko.ConfigIni.nScrollSpeed[i] != 9 || + OpenTaiko.ConfigIni.eSTEALTH[i] != EStealthMode.Off || + OpenTaiko.ConfigIni.eRandom[i] != ERandomMode.Off || + OpenTaiko.ConfigIni.nTimingZones[i] != 2 || + OpenTaiko.ConfigIni.bJust[i] != 0 || + OpenTaiko.ConfigIni.nGameType[i] != EGameType.Taiko || + OpenTaiko.ConfigIni.nFunMods[i] != EFunMods.None; - if (ImGui.TreeNodeEx($"Player {i + 1} {(modifiedstats ? "*" : "")}###TREE_SONGSELECT_PLAYER_{i}", ImGuiTreeNodeFlags.Framed | ImGuiTreeNodeFlags.DefaultOpen)) { + if (ImGui.TreeNodeEx($"Player {i + 1} {(modifiedstats ? "*" : "")}###TREE_SONGSELECT_PLAYER_{i}", ImGuiTreeNodeFlags.Framed | ImGuiTreeNodeFlags.DefaultOpen)) { - ImGui.TextColored(OpenTaiko.ConfigIni.nScrollSpeed[i] == 9 ? normal : diff, + ImGui.TextColored(OpenTaiko.ConfigIni.nScrollSpeed[i] == 9 ? normal : diff, String.Format("Scroll Speed: {0:0.0}", (OpenTaiko.ConfigIni.nScrollSpeed[i] + 1) / 10.0f)); - ImGui.TextColored(OpenTaiko.ConfigIni.eSTEALTH[i] == EStealthMode.Off ? normal : diff, - "Stealth: " + OpenTaiko.ConfigIni.eSTEALTH[i].ToString()); + ImGui.TextColored(OpenTaiko.ConfigIni.eSTEALTH[i] == EStealthMode.Off ? normal : diff, + "Stealth: " + OpenTaiko.ConfigIni.eSTEALTH[i].ToString()); - ImGui.TextColored(OpenTaiko.ConfigIni.eRandom[i] == ERandomMode.Off ? normal : diff, - "Random: " + OpenTaiko.ConfigIni.eRandom[i].ToString()); + ImGui.TextColored(OpenTaiko.ConfigIni.eRandom[i] == ERandomMode.Off ? normal : diff, + "Random: " + OpenTaiko.ConfigIni.eRandom[i].ToString()); - ImGui.TextColored(OpenTaiko.ConfigIni.nTimingZones[i] == 2 ? normal : diff, - "Timing: " + CLangManager.LangInstance.GetString($"MOD_TIMING{OpenTaiko.ConfigIni.nTimingZones[i] + 1}")); + ImGui.TextColored(OpenTaiko.ConfigIni.nTimingZones[i] == 2 ? normal : diff, + "Timing: " + CLangManager.LangInstance.GetString($"MOD_TIMING{OpenTaiko.ConfigIni.nTimingZones[i] + 1}")); - string[] justice = ["None", "Just", "Safe"]; - ImGui.TextColored(OpenTaiko.ConfigIni.bJust[i] == 0 ? normal : diff, - "Justice Mode: " + justice[OpenTaiko.ConfigIni.bJust[i]]); + string[] justice = ["None", "Just", "Safe"]; + ImGui.TextColored(OpenTaiko.ConfigIni.bJust[i] == 0 ? normal : diff, + "Justice Mode: " + justice[OpenTaiko.ConfigIni.bJust[i]]); - ImGui.TextColored(OpenTaiko.ConfigIni.nGameType[i] == EGameType.Taiko ? normal : diff, - "Game Type: " + OpenTaiko.ConfigIni.nGameType[i].ToString()); + ImGui.TextColored(OpenTaiko.ConfigIni.nGameType[i] == EGameType.Taiko ? normal : diff, + "Game Type: " + OpenTaiko.ConfigIni.nGameType[i].ToString()); - ImGui.TextColored(OpenTaiko.ConfigIni.bAutoPlay[i] ? diff : normal, - "Auto: " + OpenTaiko.ConfigIni.bAutoPlay[i]); + ImGui.TextColored(OpenTaiko.ConfigIni.bAutoPlay[i] ? diff : normal, + "Auto: " + OpenTaiko.ConfigIni.bAutoPlay[i]); - ImGui.Text("Hitsound: " + OpenTaiko.Skin.hsHitSoundsInformations.names[OpenTaiko.ConfigIni.nHitSounds[i]]); + ImGui.Text("Hitsound: " + OpenTaiko.Skin.hsHitSoundsInformations.names[OpenTaiko.ConfigIni.nHitSounds[i]]); - ImGui.TextColored(OpenTaiko.ConfigIni.nFunMods[i] == EFunMods.None ? normal : diff, - "Fun Mods: " + OpenTaiko.ConfigIni.nFunMods[i].ToString()); + ImGui.TextColored(OpenTaiko.ConfigIni.nFunMods[i] == EFunMods.None ? normal : diff, + "Fun Mods: " + OpenTaiko.ConfigIni.nFunMods[i].ToString()); - ImGui.TreePop(); - } + ImGui.TreePop(); } - break; - case CStage.EStage.Game: - for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { - if (ImGui.TreeNodeEx($"Player {i+1}###GAME_CHART_{i}", ImGuiTreeNodeFlags.Framed)) { - - Difficulty game_difficulty = OpenTaiko.DifficultyNumberToEnum(OpenTaiko.stageSongSelect.nChoosenSongDifficulty[i]); - var dtx = OpenTaiko.GetDTX(i); - - switch (game_difficulty) { - case Difficulty.Dan: - ImGui.SeparatorText("Dan Dojo Mode"); - break; - case Difficulty.Tower: - ImGui.SeparatorText("Tower Mode"); - ImGui.Text("Side: " + dtx.SIDE); - ImGui.Text("Life: " + dtx.LIFE); - ImGui.Text("Floor Count: " + OpenTaiko.stageSongSelect.rNowSelectedSong.arスコア[5].譜面情報.nTotalFloor); - break; - default: - ImGui.SeparatorText(OpenTaiko.ConfigIni.nGameType[i] == EGameType.Konga ? "Konga Mode" : "Taiko Mode"); - break; - - } - ImGui.TextColored(ColorToVector4(OpenTaiko.Skin.SongSelect_Difficulty_Colors[(int)game_difficulty]), $"Difficulty: {game_difficulty}"); - ImGui.Text($"Auto Play: " + OpenTaiko.ConfigIni.bAutoPlay[i]); - - ImGui.NewLine(); - - ImGui.Text("ID: " + dtx.uniqueID.data.id); - ImGui.Text("Title: " + dtx.TITLE.GetString("")); - ImGui.Text("Subtitle: " + dtx.SUBTITLE.GetString("")); - ImGui.Text("Charter: " + dtx.MAKER); - - ImGui.Text("BPM: " + dtx.BASEBPM + (dtx.listBPM.Count > 1 ? (" (Min: " + dtx.MinBPM + " / Max: " + dtx.MaxBPM + ")") : "")); - if (dtx.listBPM.Count > 1) { - if (ImGui.TreeNodeEx($"BPM List ({dtx.listBPM.Count})###GAME_BPM_LIST_{i}")) { - foreach (CDTX.CBPM bpm in dtx.listBPM.Values) { - ImGui.Text($"(Time: {String.Format("{0:0.#}s", (bpm.bpm_change_time / 1000))}) {bpm.dbBPM値}"); - } - ImGui.TreePop(); - } - } - - ImGui.Text("Lyrics: " + (dtx.usingLyricsFile ? dtx.listLyric2.Count : dtx.listLyric.Count)); - - ImGui.NewLine(); - - ImGui.Text("Note Count: "); - ImGui.Indent(); - ImGui.Text("Normal: " + dtx.nノーツ数_Branch[0] + - " / Expert: " + dtx.nノーツ数_Branch[1] + - " / Master: " + dtx.nノーツ数_Branch[2]); - ImGui.Unindent(); - - ImGui.TreePop(); - } - - } - - break; - } - - ImGui.EndTabItem(); - } - } - private static void Textures() { - if (ImGui.BeginTabItem("Textures")) { - if (ImGui.BeginCombo("Change listTexture Sort###TEXTURE_TOTAL_SORT", sortType != -1 ? sortNames[sortType] : "(Default)")) { - if (ImGui.Selectable(sortNames[0], sortType == 0)) { - OpenTaiko.Tx.listTexture.Sort((tex1, tex2) => (tex2 != null ? tex2.szTextureSize.Width * tex2.szTextureSize.Height : -1).CompareTo(tex1 != null ? tex1.szTextureSize.Width * tex1.szTextureSize.Height : -1)); - sortType = 0; } - if (ImGui.Selectable(sortNames[1], sortType == 1)) { - OpenTaiko.Tx.listTexture.Sort((tex1, tex2) => (tex1 != null ? tex1.szTextureSize.Width * tex1.szTextureSize.Height : -1).CompareTo(tex2 != null ? tex2.szTextureSize.Width * tex2.szTextureSize.Height : -1)); - sortType = 1; - } - if (ImGui.Selectable(sortNames[2], sortType == 2)) { - OpenTaiko.Tx.listTexture.Sort((tex1, tex2) => (tex1 != null ? (int)tex1.Pointer : -1).CompareTo(tex2 != null ? (int)tex2.Pointer : -1)); - sortType = 2; - } - ImGui.EndCombo(); - } - if (OpenTaiko.r現在のステージ.eStageID != CStage.EStage.StartUp) - CTextureListPopup(OpenTaiko.Tx.listTexture, "Show listTexture", "TEXTURE_ALL"); - else - ImGui.TextDisabled("To prevent crash during enumeration,\nyou can not view the texture list during StartUp stage."); + break; + case CStage.EStage.Game: + for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { + if (ImGui.TreeNodeEx($"Player {i+1}###GAME_CHART_{i}", ImGuiTreeNodeFlags.Framed)) { - currentStageMemoryUsage = 0; + Difficulty game_difficulty = OpenTaiko.DifficultyNumberToEnum(OpenTaiko.stageSongSelect.nChoosenSongDifficulty[i]); + var dtx = OpenTaiko.GetDTX(i); - #region Script.lua Memory Usage - int index = 0; - foreach (CLuaScript luascript in CLuaScript.listScripts) - currentStageMemoryUsage += CTextureListPopup(luascript.listDisposables.OfType(), - $"Module #{index}", $"MODULE{index++}_TEXTURES"); - - switch (OpenTaiko.r現在のステージ.eStageID) { - #region Game - case CStage.EStage.Game: - - currentStageMemoryUsage += CTextureListPopup(OpenTaiko.stage演奏ドラム画面.actBackground.UpScript, - "Up Background", "TEXTURE_LUA_UPBG"); - currentStageMemoryUsage += CTextureListPopup(OpenTaiko.stage演奏ドラム画面.actBackground.DownScript, - "Down Background", "TEXTURE_LUA_DOWNBG"); - currentStageMemoryUsage += CTextureListPopup(OpenTaiko.stage演奏ドラム画面.actMob.MobScript, - "Mob", "TEXTURE_LUA_MOB"); - currentStageMemoryUsage += CTextureListPopup(OpenTaiko.stage演奏ドラム画面.actBalloon.KusudamaScript, - "Kusudama", "TEXTURE_LUA_KUSUDAMA"); - - #region Endings - switch ((Difficulty)OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0]) { - case Difficulty.Tower: - currentStageMemoryUsage += CTextureListPopup(OpenTaiko.stage演奏ドラム画面.actEnd.Tower_DropoutScript, - "Tower Dropout", "TEXTURE_LUA_TOWERDROPOUT"); - currentStageMemoryUsage += CTextureListPopup(OpenTaiko.stage演奏ドラム画面.actEnd.Tower_TopReached_PassScript, - "Tower Cleared", "TEXTURE_LUA_TOWERCLEAR"); - currentStageMemoryUsage += CTextureListPopup(OpenTaiko.stage演奏ドラム画面.actEnd.Tower_TopReached_FullComboScript, - "Tower Full Combo", "TEXTURE_LUA_TOWERFC"); - currentStageMemoryUsage += CTextureListPopup(OpenTaiko.stage演奏ドラム画面.actEnd.Tower_TopReached_PerfectScript, - "Tower Perfect Combo", "TEXTURE_LUA_TOWERPFC"); - break; + switch (game_difficulty) { case Difficulty.Dan: - currentStageMemoryUsage += CTextureListPopup(OpenTaiko.stage演奏ドラム画面.actEnd.Dan_FailScript, - "Dan Clear Failed", "TEXTURE_LUA_DANFAILED"); - currentStageMemoryUsage += CTextureListPopup(OpenTaiko.stage演奏ドラム画面.actEnd.Dan_Red_PassScript, - "Dan Red Clear", "TEXTURE_LUA_DANCLEAR"); - currentStageMemoryUsage += CTextureListPopup(OpenTaiko.stage演奏ドラム画面.actEnd.Dan_Red_FullComboScript, - "Dan Red Full Combo", "TEXTURE_LUA_DANFC"); - currentStageMemoryUsage += CTextureListPopup(OpenTaiko.stage演奏ドラム画面.actEnd.Dan_Red_PerfectScript, - "Dan Red Perfect", "TEXTURE_LUA_DANPFC"); - currentStageMemoryUsage += CTextureListPopup(OpenTaiko.stage演奏ドラム画面.actEnd.Dan_Red_PassScript, - "Dan Gold Clear", "TEXTURE_LUA_DANGOLDCLEAR"); - currentStageMemoryUsage += CTextureListPopup(OpenTaiko.stage演奏ドラム画面.actEnd.Dan_Red_FullComboScript, - "Dan Gold Full Combo", "TEXTURE_LUA_DANGOLDFC"); - currentStageMemoryUsage += CTextureListPopup(OpenTaiko.stage演奏ドラム画面.actEnd.Dan_Red_PerfectScript, - "Dan Gold Perfect", "TEXTURE_LUA_DANGOLDPFC"); + ImGui.SeparatorText("Dan Dojo Mode"); + break; + case Difficulty.Tower: + ImGui.SeparatorText("Tower Mode"); + ImGui.Text("Side: " + dtx.SIDE); + ImGui.Text("Life: " + dtx.LIFE); + ImGui.Text("Floor Count: " + OpenTaiko.stageSongSelect.rNowSelectedSong.arスコア[5].譜面情報.nTotalFloor); break; default: - if (OpenTaiko.ConfigIni.bAIBattleMode) { - currentStageMemoryUsage += CTextureListPopup(OpenTaiko.stage演奏ドラム画面.actEnd.AILoseScript, - "AI Clear Failed", "TEXTURE_LUA_AIFAILED"); - currentStageMemoryUsage += CTextureListPopup(OpenTaiko.stage演奏ドラム画面.actEnd.AIWinScript, - "AI Cleared", "TEXTURE_LUA_AICLEAR"); - currentStageMemoryUsage += CTextureListPopup(OpenTaiko.stage演奏ドラム画面.actEnd.AIWin_FullComboScript, - "AI Full Combo", "TEXTURE_LUA_AIFC"); - currentStageMemoryUsage += CTextureListPopup(OpenTaiko.stage演奏ドラム画面.actEnd.AIWin_PerfectScript, - "AI Perfect Combo", "TEXTURE_LUA_AIPFC"); - } - else { - currentStageMemoryUsage += CTextureListPopup(OpenTaiko.stage演奏ドラム画面.actEnd.FailedScript, - "Clear Failed", "TEXTURE_LUA_GAMEFAILED"); - currentStageMemoryUsage += CTextureListPopup(OpenTaiko.stage演奏ドラム画面.actEnd.ClearScript, - "Cleared", "TEXTURE_LUA_GAMECLEAR"); - currentStageMemoryUsage += CTextureListPopup(OpenTaiko.stage演奏ドラム画面.actEnd.FullComboScript, - "Full Combo", "TEXTURE_LUA_GAMEFC"); - currentStageMemoryUsage += CTextureListPopup(OpenTaiko.stage演奏ドラム画面.actEnd.PerfectComboScript, - "Perfect Combo", "TEXTURE_LUA_GAMEPFC"); - } + ImGui.SeparatorText(OpenTaiko.ConfigIni.nGameType[i] == EGameType.Konga ? "Konga Mode" : "Taiko Mode"); break; + } - #endregion + ImGui.TextColored(ColorToVector4(OpenTaiko.Skin.SongSelect_Difficulty_Colors[(int)game_difficulty]), $"Difficulty: {game_difficulty}"); + ImGui.Text($"Auto Play: " + OpenTaiko.ConfigIni.bAutoPlay[i]); - #endregion + ImGui.NewLine(); - break; - } + ImGui.Text("ID: " + dtx.uniqueID.data.id); + ImGui.Text("Title: " + dtx.TITLE.GetString("")); + ImGui.Text("Subtitle: " + dtx.SUBTITLE.GetString("")); + ImGui.Text("Charter: " + dtx.MAKER); - ImGui.Text("Script.lua Tex Memory Usage: " + GetMemAllocationInMegabytes(currentStageMemoryUsage) + "MB"); - #endregion + ImGui.Text("BPM: " + dtx.BASEBPM + (dtx.listBPM.Count > 1 ? (" (Min: " + dtx.MinBPM + " / Max: " + dtx.MaxBPM + ")") : "")); + if (dtx.listBPM.Count > 1) { + if (ImGui.TreeNodeEx($"BPM List ({dtx.listBPM.Count})###GAME_BPM_LIST_{i}")) { + foreach (CDTX.CBPM bpm in dtx.listBPM.Values) { + ImGui.Text($"(Time: {String.Format("{0:0.#}s", (bpm.bpm_change_time / 1000))}) {bpm.dbBPM値}"); + } + ImGui.TreePop(); + } + } - ImGui.EndTabItem(); - } - } - #endregion + ImGui.Text("Lyrics: " + (dtx.usingLyricsFile ? dtx.listLyric2.Count : dtx.listLyric.Count)); - #region ImGui Items - private static void CTexturePopup(CTexture texture, string label) { - if (ImGui.TreeNodeEx(label, ImGuiTreeNodeFlags.Framed)) { + ImGui.NewLine(); - ImGui.BeginDisabled(); - ImGui.InputText("Path", ref reloadTexPath, 2048); - if (ImGui.Button("Reload via. Path (To-do)")) { - // To-do - } - ImGui.EndDisabled(); + ImGui.Text("Note Count: "); + ImGui.Indent(); + ImGui.Text("Normal: " + dtx.nノーツ数_Branch[0] + + " / Expert: " + dtx.nノーツ数_Branch[1] + + " / Master: " + dtx.nノーツ数_Branch[2]); + ImGui.Unindent(); + + ImGui.TreePop(); + } - ImGui.TreePop(); - } - if (ImGui.IsItemHovered(ImGuiHoveredFlags.DelayNone)) { - if (ImGui.BeginItemTooltip()) { - if (DrawCTextureForImGui(texture, 800, 800)) { - ImGui.Text("Pointer: " + texture.Pointer); - ImGui.Text("Size: x" + texture.szTextureSize.Width + ",y" + texture.szTextureSize.Height); - ImGui.Text("Memory allocated: " + String.Format("{0:0.###}",GetTextureMemAllocationInMegabytes(texture)) + "MB"); } - else { - ImGui.TextDisabled("Texture is not loaded."); - } - ImGui.EndTooltip(); - } + + break; } - } - private static int CTextureListPopup(IEnumerable textureList, string label, string id) { - if (textureList == null) return 0; - int memoryCount = GetTotalMemoryUsageFromCTextureList(textureList); - if (ImGui.TreeNodeEx($"{label} Textures: ({textureList.Count()} / {String.Format("{0:0.###}", GetMemAllocationInMegabytes(memoryCount))}MB)###{id}")) { - int index = 0; - foreach (CTexture tex in textureList) { - CTexturePopup(tex, $"Texture #{index} (Pointer: {(tex != null ? tex.Pointer : "null")})###{id}_{index++}"); - } - ImGui.TreePop(); - } - return memoryCount; + ImGui.EndTabItem(); } - private static int CTextureListPopup(ScriptBG script, string label, string id) { - return script != null ? CTextureListPopup(script.Textures.Values, label, id) : 0; - } - private static bool DrawCTextureForImGui(CTexture texture) { - if (texture == null) return false; - return DrawCTextureForImGui(texture, - new Vector2(texture.szTextureSize.Width, texture.szTextureSize.Height), - new Vector2(0,0), new Vector2(1,1)); - } - private static bool DrawCTextureForImGui(CTexture texture, int max_width, int max_height) { - if (texture == null) return false; - return DrawCTextureForImGui(texture, 0, 0, - Math.Min(texture.szTextureSize.Width, max_width), Math.Min(texture.szTextureSize.Height, max_height)); - } - private static bool DrawCTextureForImGui(CTexture texture, int x, int y, int width, int height) { - return DrawCTextureForImGui(texture, new Rectangle(x, y, width, height)); - } - private static bool DrawCTextureForImGui(CTexture texture, Rectangle rect) { - if (texture == null) return false; - return DrawCTextureForImGui(texture, - new Vector2(rect.Width, rect.Height), - new Vector2((float)rect.X / texture.szTextureSize.Width, (float)rect.Y / texture.szTextureSize.Height), - new Vector2((float)rect.Right / texture.szTextureSize.Width, (float)rect.Bottom / texture.szTextureSize.Height)); - } - /// Must be in pixels - /// Value is typically between 0.0f and 1.0f - /// Value is typically between 0.0f and 1.0f - private static bool DrawCTextureForImGui(CTexture texture, Vector2 image_size, Vector2 pos, Vector2 size) { - if (texture == null) return false; - ImGui.Image((nint)texture.Pointer, image_size, pos, size); - return true; - } - #endregion - - #region Helpers - private static float GetMemAllocationInMegabytes(int bytes) { return (float)bytes / (1024 * 1024); } - private static float GetTextureMemAllocationInMegabytes(CTexture texture) { - return (float)GetTextureMemAllocation(texture) / (1024 * 1024); - } - private static int GetTextureMemAllocation(CTexture texture) { - return texture != null ? (texture.szTextureSize.Width * texture.szTextureSize.Height * 4) : 0; - } - private static Vector4 ColorToVector4(Color color) { - return new Vector4((float)color.R / 255, (float)color.G / 255, (float)color.B / 255, (float)color.A / 255); - } - - private static int GetTotalMemoryUsageFromCTextureList(IEnumerable textureList) { - return textureList.Where(tex => tex != null).Sum(GetTextureMemAllocation); - } - private static int GetTotalMemoryUsageFromCTextureList(ScriptBG script) { - return script != null ? GetTotalMemoryUsageFromCTextureList(script.Textures.Values) : 0; - } - #endregion - } + private static void Textures() { + if (ImGui.BeginTabItem("Textures")) { + if (ImGui.BeginCombo("Change listTexture Sort###TEXTURE_TOTAL_SORT", sortType != -1 ? sortNames[sortType] : "(Default)")) { + if (ImGui.Selectable(sortNames[0], sortType == 0)) { + OpenTaiko.Tx.listTexture.Sort((tex1, tex2) => (tex2 != null ? tex2.szTextureSize.Width * tex2.szTextureSize.Height : -1).CompareTo(tex1 != null ? tex1.szTextureSize.Width * tex1.szTextureSize.Height : -1)); + sortType = 0; + } + if (ImGui.Selectable(sortNames[1], sortType == 1)) { + OpenTaiko.Tx.listTexture.Sort((tex1, tex2) => (tex1 != null ? tex1.szTextureSize.Width * tex1.szTextureSize.Height : -1).CompareTo(tex2 != null ? tex2.szTextureSize.Width * tex2.szTextureSize.Height : -1)); + sortType = 1; + } + if (ImGui.Selectable(sortNames[2], sortType == 2)) { + OpenTaiko.Tx.listTexture.Sort((tex1, tex2) => (tex1 != null ? (int)tex1.Pointer : -1).CompareTo(tex2 != null ? (int)tex2.Pointer : -1)); + sortType = 2; + } + ImGui.EndCombo(); + } + if (OpenTaiko.r現在のステージ.eStageID != CStage.EStage.StartUp) + CTextureListPopup(OpenTaiko.Tx.listTexture, "Show listTexture", "TEXTURE_ALL"); + else + ImGui.TextDisabled("To prevent crash during enumeration,\nyou can not view the texture list during StartUp stage."); + + currentStageMemoryUsage = 0; + + #region Script.lua Memory Usage + int index = 0; + foreach (CLuaScript luascript in CLuaScript.listScripts) + currentStageMemoryUsage += CTextureListPopup(luascript.listDisposables.OfType(), + $"Module #{index}", $"MODULE{index++}_TEXTURES"); + + switch (OpenTaiko.r現在のステージ.eStageID) { + #region Game + case CStage.EStage.Game: + + currentStageMemoryUsage += CTextureListPopup(OpenTaiko.stage演奏ドラム画面.actBackground.UpScript, + "Up Background", "TEXTURE_LUA_UPBG"); + currentStageMemoryUsage += CTextureListPopup(OpenTaiko.stage演奏ドラム画面.actBackground.DownScript, + "Down Background", "TEXTURE_LUA_DOWNBG"); + currentStageMemoryUsage += CTextureListPopup(OpenTaiko.stage演奏ドラム画面.actMob.MobScript, + "Mob", "TEXTURE_LUA_MOB"); + currentStageMemoryUsage += CTextureListPopup(OpenTaiko.stage演奏ドラム画面.actBalloon.KusudamaScript, + "Kusudama", "TEXTURE_LUA_KUSUDAMA"); + + #region Endings + switch ((Difficulty)OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0]) { + case Difficulty.Tower: + currentStageMemoryUsage += CTextureListPopup(OpenTaiko.stage演奏ドラム画面.actEnd.Tower_DropoutScript, + "Tower Dropout", "TEXTURE_LUA_TOWERDROPOUT"); + currentStageMemoryUsage += CTextureListPopup(OpenTaiko.stage演奏ドラム画面.actEnd.Tower_TopReached_PassScript, + "Tower Cleared", "TEXTURE_LUA_TOWERCLEAR"); + currentStageMemoryUsage += CTextureListPopup(OpenTaiko.stage演奏ドラム画面.actEnd.Tower_TopReached_FullComboScript, + "Tower Full Combo", "TEXTURE_LUA_TOWERFC"); + currentStageMemoryUsage += CTextureListPopup(OpenTaiko.stage演奏ドラム画面.actEnd.Tower_TopReached_PerfectScript, + "Tower Perfect Combo", "TEXTURE_LUA_TOWERPFC"); + break; + case Difficulty.Dan: + currentStageMemoryUsage += CTextureListPopup(OpenTaiko.stage演奏ドラム画面.actEnd.Dan_FailScript, + "Dan Clear Failed", "TEXTURE_LUA_DANFAILED"); + currentStageMemoryUsage += CTextureListPopup(OpenTaiko.stage演奏ドラム画面.actEnd.Dan_Red_PassScript, + "Dan Red Clear", "TEXTURE_LUA_DANCLEAR"); + currentStageMemoryUsage += CTextureListPopup(OpenTaiko.stage演奏ドラム画面.actEnd.Dan_Red_FullComboScript, + "Dan Red Full Combo", "TEXTURE_LUA_DANFC"); + currentStageMemoryUsage += CTextureListPopup(OpenTaiko.stage演奏ドラム画面.actEnd.Dan_Red_PerfectScript, + "Dan Red Perfect", "TEXTURE_LUA_DANPFC"); + currentStageMemoryUsage += CTextureListPopup(OpenTaiko.stage演奏ドラム画面.actEnd.Dan_Red_PassScript, + "Dan Gold Clear", "TEXTURE_LUA_DANGOLDCLEAR"); + currentStageMemoryUsage += CTextureListPopup(OpenTaiko.stage演奏ドラム画面.actEnd.Dan_Red_FullComboScript, + "Dan Gold Full Combo", "TEXTURE_LUA_DANGOLDFC"); + currentStageMemoryUsage += CTextureListPopup(OpenTaiko.stage演奏ドラム画面.actEnd.Dan_Red_PerfectScript, + "Dan Gold Perfect", "TEXTURE_LUA_DANGOLDPFC"); + break; + default: + if (OpenTaiko.ConfigIni.bAIBattleMode) { + currentStageMemoryUsage += CTextureListPopup(OpenTaiko.stage演奏ドラム画面.actEnd.AILoseScript, + "AI Clear Failed", "TEXTURE_LUA_AIFAILED"); + currentStageMemoryUsage += CTextureListPopup(OpenTaiko.stage演奏ドラム画面.actEnd.AIWinScript, + "AI Cleared", "TEXTURE_LUA_AICLEAR"); + currentStageMemoryUsage += CTextureListPopup(OpenTaiko.stage演奏ドラム画面.actEnd.AIWin_FullComboScript, + "AI Full Combo", "TEXTURE_LUA_AIFC"); + currentStageMemoryUsage += CTextureListPopup(OpenTaiko.stage演奏ドラム画面.actEnd.AIWin_PerfectScript, + "AI Perfect Combo", "TEXTURE_LUA_AIPFC"); + } + else { + currentStageMemoryUsage += CTextureListPopup(OpenTaiko.stage演奏ドラム画面.actEnd.FailedScript, + "Clear Failed", "TEXTURE_LUA_GAMEFAILED"); + currentStageMemoryUsage += CTextureListPopup(OpenTaiko.stage演奏ドラム画面.actEnd.ClearScript, + "Cleared", "TEXTURE_LUA_GAMECLEAR"); + currentStageMemoryUsage += CTextureListPopup(OpenTaiko.stage演奏ドラム画面.actEnd.FullComboScript, + "Full Combo", "TEXTURE_LUA_GAMEFC"); + currentStageMemoryUsage += CTextureListPopup(OpenTaiko.stage演奏ドラム画面.actEnd.PerfectComboScript, + "Perfect Combo", "TEXTURE_LUA_GAMEPFC"); + } + break; + } + #endregion + + #endregion + + break; + } + + ImGui.Text("Script.lua Tex Memory Usage: " + GetMemAllocationInMegabytes(currentStageMemoryUsage) + "MB"); + #endregion + + ImGui.EndTabItem(); + } + } + #endregion + + #region ImGui Items + private static void CTexturePopup(CTexture texture, string label) { + if (ImGui.TreeNodeEx(label, ImGuiTreeNodeFlags.Framed)) { + + ImGui.BeginDisabled(); + ImGui.InputText("Path", ref reloadTexPath, 2048); + if (ImGui.Button("Reload via. Path (To-do)")) { + // To-do + } + ImGui.EndDisabled(); + + ImGui.TreePop(); + } + if (ImGui.IsItemHovered(ImGuiHoveredFlags.DelayNone)) { + if (ImGui.BeginItemTooltip()) { + if (DrawCTextureForImGui(texture, 800, 800)) { + ImGui.Text("Pointer: " + texture.Pointer); + ImGui.Text("Size: x" + texture.szTextureSize.Width + ",y" + texture.szTextureSize.Height); + ImGui.Text("Memory allocated: " + String.Format("{0:0.###}",GetTextureMemAllocationInMegabytes(texture)) + "MB"); + } + else { + ImGui.TextDisabled("Texture is not loaded."); + } + ImGui.EndTooltip(); + } + } + } + private static int CTextureListPopup(IEnumerable textureList, string label, string id) { + if (textureList == null) return 0; + int memoryCount = GetTotalMemoryUsageFromCTextureList(textureList); + + if (ImGui.TreeNodeEx($"{label} Textures: ({textureList.Count()} / {String.Format("{0:0.###}", GetMemAllocationInMegabytes(memoryCount))}MB)###{id}")) { + int index = 0; + foreach (CTexture tex in textureList) { + CTexturePopup(tex, $"Texture #{index} (Pointer: {(tex != null ? tex.Pointer : "null")})###{id}_{index++}"); + } + ImGui.TreePop(); + } + return memoryCount; + } + private static int CTextureListPopup(ScriptBG script, string label, string id) { + return script != null ? CTextureListPopup(script.Textures.Values, label, id) : 0; + } + private static bool DrawCTextureForImGui(CTexture texture) { + if (texture == null) return false; + return DrawCTextureForImGui(texture, + new Vector2(texture.szTextureSize.Width, texture.szTextureSize.Height), + new Vector2(0,0), new Vector2(1,1)); + } + private static bool DrawCTextureForImGui(CTexture texture, int max_width, int max_height) { + if (texture == null) return false; + return DrawCTextureForImGui(texture, 0, 0, + Math.Min(texture.szTextureSize.Width, max_width), Math.Min(texture.szTextureSize.Height, max_height)); + } + private static bool DrawCTextureForImGui(CTexture texture, int x, int y, int width, int height) { + return DrawCTextureForImGui(texture, new Rectangle(x, y, width, height)); + } + private static bool DrawCTextureForImGui(CTexture texture, Rectangle rect) { + if (texture == null) return false; + return DrawCTextureForImGui(texture, + new Vector2(rect.Width, rect.Height), + new Vector2((float)rect.X / texture.szTextureSize.Width, (float)rect.Y / texture.szTextureSize.Height), + new Vector2((float)rect.Right / texture.szTextureSize.Width, (float)rect.Bottom / texture.szTextureSize.Height)); + } + /// Must be in pixels + /// Value is typically between 0.0f and 1.0f + /// Value is typically between 0.0f and 1.0f + private static bool DrawCTextureForImGui(CTexture texture, Vector2 image_size, Vector2 pos, Vector2 size) { + if (texture == null) return false; + ImGui.Image((nint)texture.Pointer, image_size, pos, size); + return true; + } + #endregion + + #region Helpers + private static float GetMemAllocationInMegabytes(int bytes) { return (float)bytes / (1024 * 1024); } + private static float GetTextureMemAllocationInMegabytes(CTexture texture) { + return (float)GetTextureMemAllocation(texture) / (1024 * 1024); + } + private static int GetTextureMemAllocation(CTexture texture) { + return texture != null ? (texture.szTextureSize.Width * texture.szTextureSize.Height * 4) : 0; + } + private static Vector4 ColorToVector4(Color color) { + return new Vector4((float)color.R / 255, (float)color.G / 255, (float)color.B / 255, (float)color.A / 255); + } + + private static int GetTotalMemoryUsageFromCTextureList(IEnumerable textureList) { + return textureList.Where(tex => tex != null).Sum(GetTextureMemAllocation); + } + private static int GetTotalMemoryUsageFromCTextureList(ScriptBG script) { + return script != null ? GetTotalMemoryUsageFromCTextureList(script.Textures.Values) : 0; + } + #endregion + } diff --git a/OpenTaiko/src/Common/KeyboardSoundGroupLevelControlHandler.cs b/OpenTaiko/src/Common/KeyboardSoundGroupLevelControlHandler.cs index 898a432a..10290b6f 100644 --- a/OpenTaiko/src/Common/KeyboardSoundGroupLevelControlHandler.cs +++ b/OpenTaiko/src/Common/KeyboardSoundGroupLevelControlHandler.cs @@ -1,50 +1,50 @@ using FDK; -namespace OpenTaiko { - /// - /// KeyboardSoundGroupLevelControlHandler is called by the song selection - /// and song play stages when handling keyboard input. By delegating to - /// this class they are able to support a centrally-managed and consistent - /// set of keyboard shortcuts for dynamically adjusting four sound group - /// levels: - /// - sound effect level, via Ctrl and either of the Minus or Equals keys - /// - voice level, via Shift and either of the Minus or Equals keys - /// - song preview and song playback level, via the Minus or Equals key - /// - /// When the sound group levels are adjusted in this manner, the - /// SoundGroupLevelController (and handlers bound to its events) ensure - /// that both the sound object group levels are updated and the application - /// configuration is updated. See ConfigIniToSoundGroupLevelControllerBinder - /// for more details on the latter. - /// - internal static class KeyboardSoundGroupLevelControlHandler { - internal static void Handle( - IInputDevice keyboard, - SoundGroupLevelController soundGroupLevelController, - CSkin skin, - bool isSongPreview) { - bool isAdjustmentPositive = OpenTaiko.ConfigIni.KeyAssign.KeyIsPressed(OpenTaiko.ConfigIni.KeyAssign.System.SongVolIncrease); - bool isAdjustmentNegative = OpenTaiko.ConfigIni.KeyAssign.KeyIsPressed(OpenTaiko.ConfigIni.KeyAssign.System.SongVolDecrease); +namespace OpenTaiko; - if (!(isAdjustmentPositive || isAdjustmentNegative)) return; +/// +/// KeyboardSoundGroupLevelControlHandler is called by the song selection +/// and song play stages when handling keyboard input. By delegating to +/// this class they are able to support a centrally-managed and consistent +/// set of keyboard shortcuts for dynamically adjusting four sound group +/// levels: +/// - sound effect level, via Ctrl and either of the Minus or Equals keys +/// - voice level, via Shift and either of the Minus or Equals keys +/// - song preview and song playback level, via the Minus or Equals key +/// +/// When the sound group levels are adjusted in this manner, the +/// SoundGroupLevelController (and handlers bound to its events) ensure +/// that both the sound object group levels are updated and the application +/// configuration is updated. See ConfigIniToSoundGroupLevelControllerBinder +/// for more details on the latter. +/// +internal static class KeyboardSoundGroupLevelControlHandler { + internal static void Handle( + IInputDevice keyboard, + SoundGroupLevelController soundGroupLevelController, + CSkin skin, + bool isSongPreview) { + bool isAdjustmentPositive = OpenTaiko.ConfigIni.KeyAssign.KeyIsPressed(OpenTaiko.ConfigIni.KeyAssign.System.SongVolIncrease); + bool isAdjustmentNegative = OpenTaiko.ConfigIni.KeyAssign.KeyIsPressed(OpenTaiko.ConfigIni.KeyAssign.System.SongVolDecrease); - ESoundGroup soundGroup; - CSkin.CSystemSound システムサウンド = null; + if (!(isAdjustmentPositive || isAdjustmentNegative)) return; - if (keyboard.KeyPressing((int)SlimDXKeys.Key.LeftControl) || - keyboard.KeyPressing((int)SlimDXKeys.Key.RightControl)) { - soundGroup = ESoundGroup.SoundEffect; - システムサウンド = skin.soundDecideSFX; - } else if (keyboard.KeyPressing((int)SlimDXKeys.Key.LeftShift) || - keyboard.KeyPressing((int)SlimDXKeys.Key.RightShift)) { - soundGroup = ESoundGroup.Voice; - システムサウンド = skin.soundゲーム開始音; - } else { - soundGroup = ESoundGroup.SongPlayback; - } + ESoundGroup soundGroup; + CSkin.CSystemSound システムサウンド = null; - soundGroupLevelController.AdjustLevel(soundGroup, isAdjustmentPositive); - システムサウンド?.tPlay(); + if (keyboard.KeyPressing((int)SlimDXKeys.Key.LeftControl) || + keyboard.KeyPressing((int)SlimDXKeys.Key.RightControl)) { + soundGroup = ESoundGroup.SoundEffect; + システムサウンド = skin.soundDecideSFX; + } else if (keyboard.KeyPressing((int)SlimDXKeys.Key.LeftShift) || + keyboard.KeyPressing((int)SlimDXKeys.Key.RightShift)) { + soundGroup = ESoundGroup.Voice; + システムサウンド = skin.soundゲーム開始音; + } else { + soundGroup = ESoundGroup.SongPlayback; } + + soundGroupLevelController.AdjustLevel(soundGroup, isAdjustmentPositive); + システムサウンド?.tPlay(); } } diff --git a/OpenTaiko/src/Common/LogNotification.cs b/OpenTaiko/src/Common/LogNotification.cs index c9db7097..d8f2ee1b 100644 --- a/OpenTaiko/src/Common/LogNotification.cs +++ b/OpenTaiko/src/Common/LogNotification.cs @@ -1,52 +1,52 @@ using System.Diagnostics; using FDK; -namespace OpenTaiko { - internal class LogNotification { - private static Queue Notifications = new Queue(); +namespace OpenTaiko; - public enum ENotificationType { - EINFO, - ESUCCESS, - EWARNING, - EERROR, +internal class LogNotification { + private static Queue Notifications = new Queue(); + + public enum ENotificationType { + EINFO, + ESUCCESS, + EWARNING, + EERROR, + } + + public class CLogNotification { + public CLogNotification(ENotificationType nt, string msg) { + NotificationType = nt; + Message = msg; } - public class CLogNotification { - public CLogNotification(ENotificationType nt, string msg) { - NotificationType = nt; - Message = msg; - } - - public ENotificationType NotificationType = ENotificationType.EINFO; - public string Message = ""; - public CCounter LifeTime = new CCounter(0, 1000, 1, OpenTaiko.Timer); - } + public ENotificationType NotificationType = ENotificationType.EINFO; + public string Message = ""; + public CCounter LifeTime = new CCounter(0, 1000, 1, OpenTaiko.Timer); + } - public static void PopError(string message) { - Notifications.Enqueue(new CLogNotification(ENotificationType.EERROR, message)); - Trace.TraceError(": " + message); - } + public static void PopError(string message) { + Notifications.Enqueue(new CLogNotification(ENotificationType.EERROR, message)); + Trace.TraceError(": " + message); + } - public static void PopWarning(string message) { - Notifications.Enqueue(new CLogNotification(ENotificationType.EWARNING, message)); - Trace.TraceWarning(": " + message); - } + public static void PopWarning(string message) { + Notifications.Enqueue(new CLogNotification(ENotificationType.EWARNING, message)); + Trace.TraceWarning(": " + message); + } - public static void PopSuccess(string message) { - Notifications.Enqueue(new CLogNotification(ENotificationType.ESUCCESS, message)); - Trace.TraceInformation(": " + message); - } + public static void PopSuccess(string message) { + Notifications.Enqueue(new CLogNotification(ENotificationType.ESUCCESS, message)); + Trace.TraceInformation(": " + message); + } - public static void PopInfo(string message) { - Notifications.Enqueue(new CLogNotification(ENotificationType.EINFO, message)); - Trace.TraceInformation(": " + message); - } + public static void PopInfo(string message) { + Notifications.Enqueue(new CLogNotification(ENotificationType.EINFO, message)); + Trace.TraceInformation(": " + message); + } - public static void Display() { - while (Notifications.Count > 0 && Notifications.Peek().LifeTime.IsEnded) Notifications.Dequeue(); - // Add an optimized method to display the notifications here - } + public static void Display() { + while (Notifications.Count > 0 && Notifications.Peek().LifeTime.IsEnded) Notifications.Dequeue(); + // Add an optimized method to display the notifications here } } diff --git a/OpenTaiko/src/Common/Modal.cs b/OpenTaiko/src/Common/Modal.cs index db974289..4b6a2527 100644 --- a/OpenTaiko/src/Common/Modal.cs +++ b/OpenTaiko/src/Common/Modal.cs @@ -1,49 +1,49 @@ -namespace OpenTaiko { - internal class Modal { - public Modal(EModalType mt, int ra, params object?[] re) { - modalType = mt; - rarity = ra; - reference = re; - } - - public void tRegisterModal(int player) { - OpenTaiko.stage結果.lcModal.RegisterNewModal(player, rarity, modalType, reference); - } - - #region [Enum definitions] - - public enum EModalType { - Coin = 0, - Character = 1, - Puchichara = 2, - Title = 3, - Song = 4, - Total = 5, - } - - // Full : 1P standard modal, Half : Splitted screen modal - public enum EModalFormat { - Full, - Half, - Half_4P, - Half_5P, - } - - #endregion - - #region [Public variables] - - // Coin number for coin; database/unlockable asset for puchichara, character and title; no effect on text, confirm - public object?[] reference; - - public int rarity; - public EModalType modalType; - public EModalFormat modalFormat; - - // For modalFormat = Half only - public int player; - - #endregion +namespace OpenTaiko; +internal class Modal { + public Modal(EModalType mt, int ra, params object?[] re) { + modalType = mt; + rarity = ra; + reference = re; } + + public void tRegisterModal(int player) { + OpenTaiko.stage結果.lcModal.RegisterNewModal(player, rarity, modalType, reference); + } + + #region [Enum definitions] + + public enum EModalType { + Coin = 0, + Character = 1, + Puchichara = 2, + Title = 3, + Song = 4, + Total = 5, + } + + // Full : 1P standard modal, Half : Splitted screen modal + public enum EModalFormat { + Full, + Half, + Half_4P, + Half_5P, + } + + #endregion + + #region [Public variables] + + // Coin number for coin; database/unlockable asset for puchichara, character and title; no effect on text, confirm + public object?[] reference; + + public int rarity; + public EModalType modalType; + public EModalFormat modalFormat; + + // For modalFormat = Half only + public int player; + + #endregion + } diff --git a/OpenTaiko/src/Common/ModalQueue.cs b/OpenTaiko/src/Common/ModalQueue.cs index 535d0d9e..9ee99b8d 100644 --- a/OpenTaiko/src/Common/ModalQueue.cs +++ b/OpenTaiko/src/Common/ModalQueue.cs @@ -1,44 +1,44 @@ -namespace OpenTaiko { - internal class ModalQueue { - public ModalQueue(Modal.EModalFormat mf) { - _modalQueues = new Queue[] { new Queue(), new Queue(), new Queue(), new Queue(), new Queue() }; - _modalFormat = mf; - } +namespace OpenTaiko; - // Add a single modal - public void tAddModal(Modal mp, int player) { - mp.modalFormat = _modalFormat; - mp.player = player; - - if (mp != null && player >= 0 && player < OpenTaiko.ConfigIni.nPlayerCount) - _modalQueues[player].Enqueue(mp); - } - - // 1P => 2P => 3P => 4P => 5P - public Modal? tPopModalInOrder() { - for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { - if (!tIsQueueEmpty(i)) { - Modal? _m = _modalQueues[i].Dequeue(); - _m?.tRegisterModal(i + 1); - return _m; - } - - } - return null; - } - - public bool tIsQueueEmpty(int player) { - if (player < 0 || player >= OpenTaiko.ConfigIni.nPlayerCount) - return true; - - return _modalQueues[player].Count < 1; - } - - public bool tAreBothQueuesEmpty() { - return tIsQueueEmpty(0) && tIsQueueEmpty(1) && tIsQueueEmpty(2) && tIsQueueEmpty(3) && tIsQueueEmpty(4); - } - - private Modal.EModalFormat _modalFormat; - private Queue[] _modalQueues; +internal class ModalQueue { + public ModalQueue(Modal.EModalFormat mf) { + _modalQueues = new Queue[] { new Queue(), new Queue(), new Queue(), new Queue(), new Queue() }; + _modalFormat = mf; } + + // Add a single modal + public void tAddModal(Modal mp, int player) { + mp.modalFormat = _modalFormat; + mp.player = player; + + if (mp != null && player >= 0 && player < OpenTaiko.ConfigIni.nPlayerCount) + _modalQueues[player].Enqueue(mp); + } + + // 1P => 2P => 3P => 4P => 5P + public Modal? tPopModalInOrder() { + for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { + if (!tIsQueueEmpty(i)) { + Modal? _m = _modalQueues[i].Dequeue(); + _m?.tRegisterModal(i + 1); + return _m; + } + + } + return null; + } + + public bool tIsQueueEmpty(int player) { + if (player < 0 || player >= OpenTaiko.ConfigIni.nPlayerCount) + return true; + + return _modalQueues[player].Count < 1; + } + + public bool tAreBothQueuesEmpty() { + return tIsQueueEmpty(0) && tIsQueueEmpty(1) && tIsQueueEmpty(2) && tIsQueueEmpty(3) && tIsQueueEmpty(4); + } + + private Modal.EModalFormat _modalFormat; + private Queue[] _modalQueues; } diff --git a/OpenTaiko/src/Common/NamePlateConfig.cs b/OpenTaiko/src/Common/NamePlateConfig.cs index 9982cddd..e791cc24 100644 --- a/OpenTaiko/src/Common/NamePlateConfig.cs +++ b/OpenTaiko/src/Common/NamePlateConfig.cs @@ -1,211 +1,211 @@ using Newtonsoft.Json; -namespace OpenTaiko { - class NamePlateConfig { - public void tNamePlateConfig() { - // Deprecated, only converts to new format - tLoadFile(); - } +namespace OpenTaiko; - #region [Medals] - - public void tEarnCoins(int[] amounts) { - if (amounts.Length < 2) - return; - - for (int i = 0; i < 5; i++) { - int p = OpenTaiko.GetActualPlayer(i); - - data.Medals[p] += amounts[i]; - } - tSaveFile(); - } - - // Return false if the current amount of coins is to low - public bool tSpendCoins(int amount, int player) { - if (player > 1 || player < 0) - return false; - - if (data.Medals[player] < amount) - return false; - - data.Medals[player] -= amount; - - tSaveFile(); - - return true; - } - - #endregion - - #region [Dan titles] - - public bool tUpdateDanTitle(string title, bool isGold, int clearStatus, int player) { - bool changed = false; - - bool iG = isGold; - int cs = clearStatus; - - if (OpenTaiko.NamePlateConfig.data.DanTitles[player] == null) - OpenTaiko.NamePlateConfig.data.DanTitles[player] = new Dictionary(); - - if (OpenTaiko.NamePlateConfig.data.DanTitles[player].ContainsKey(title)) { - if (OpenTaiko.NamePlateConfig.data.DanTitles[player][title].clearStatus > cs) - cs = OpenTaiko.NamePlateConfig.data.DanTitles[player][title].clearStatus; - if (OpenTaiko.NamePlateConfig.data.DanTitles[player][title].isGold) - iG = true; - } - - // Automatically set the dan to nameplate if new - // Add a function within the NamePlate.cs file to update the title texture - - if (!OpenTaiko.NamePlateConfig.data.DanTitles[player].ContainsKey(title) || cs != clearStatus || iG != isGold) { - changed = true; - } - - - SaveFile.CDanTitle danTitle = new SaveFile.CDanTitle(iG, cs); - - OpenTaiko.NamePlateConfig.data.DanTitles[player][title] = danTitle; - - tSaveFile(); - - return changed; - } - - #endregion - - #region [Auxilliary classes] - - public class CDanTitle { - public CDanTitle(bool iG, int cs) { - isGold = iG; - clearStatus = cs; - } - - [JsonProperty("isGold")] - public bool isGold; - - [JsonProperty("clearStatus")] - public int clearStatus; - } - - public class CNamePlateTitle { - public CNamePlateTitle(int type) { - iType = type; - } - - [JsonProperty("iType")] - public int iType; - } - - #endregion - - #region [Heya] - - public void tReindexCharacter(int p, string[] characterNamesList) { - string character = this.data.CharacterName[p]; - - if (characterNamesList.Contains(character)) - this.data.Character[p] = characterNamesList.ToList().IndexOf(character); - - } - - public void tUpdateCharacterName(int p, string newChara) { - this.data.CharacterName[p] = newChara; - } - - public void tApplyHeyaChanges() { - this.tSaveFile(); - } - - #endregion - - public class Data { - [JsonProperty("name")] - public string[] Name = { "プレイヤー1", "プレイヤー2", "プレイヤー3", "プレイヤー4", "プレイヤー5" }; - - [JsonProperty("title")] - public string[] Title = { "初心者", "初心者", "初心者", "初心者", "初心者" }; - - [JsonProperty("dan")] - public string[] Dan = { "新人", "新人", "新人", "新人", "新人" }; - - [JsonProperty("danGold")] - public bool[] DanGold = { false, false, false, false, false }; - - [JsonProperty("danType")] - public int[] DanType = { 0, 0, 0, 0, 0 }; - - [JsonProperty("titleType")] - public int[] TitleType = { 0, 0, 0, 0, 0 }; - - [JsonProperty("puchiChara")] - public string[] PuchiChara = { "0", "0", "0", "0", "0" }; - - [JsonProperty("medals")] - public int[] Medals = { 0, 0, 0, 0, 0 }; - - [JsonProperty("character")] - public int[] Character = { 0, 0, 0, 0, 0 }; - - [JsonProperty("characterName")] - public string[] CharacterName = { "0", "0", "0", "0", "0" }; - - [JsonProperty("danTitles")] - public Dictionary[] DanTitles = new Dictionary[5]; - - [JsonProperty("namePlateTitles")] - public Dictionary[] NamePlateTitles = new Dictionary[5]; - - [JsonProperty("unlockedPuchicharas")] - public List[] UnlockedPuchicharas = new List[5] - { - new List(), - new List(), - new List(), - new List(), - new List() - }; - - } - - public Data data = new Data(); - - #region [private] - - private void tSaveFile() { - ConfigManager.SaveConfig(data, "NamePlate.json"); - } - - private void tLoadFile() { - if (!File.Exists("NamePlate.json")) - return; - - var _data = ConfigManager.GetConfig(@"NamePlate.json"); - - for (int i = 0; i < _data.Name.Length; i++) { - var _sf = new SaveFile(); - _sf.tSaveFile((i + 1) + "P"); - _sf.data.Name = _data.Name[i]; - _sf.data.Title = _data.Title[i]; - _sf.data.Dan = _data.Dan[i]; - _sf.data.DanGold = _data.DanGold[i]; - _sf.data.DanType = _data.DanType[i]; - _sf.data.TitleType = _data.TitleType[i]; - _sf.data.PuchiChara = _data.PuchiChara[i]; - _sf.data.Medals = _data.Medals[i]; - _sf.data.Character = _data.Character[i]; - _sf.data.CharacterName = _data.CharacterName[i]; - _sf.data.DanTitles = _data.DanTitles[i]; - _sf.data.NamePlateTitles = _data.NamePlateTitles[i]; - _sf.data.UnlockedPuchicharas = _data.UnlockedPuchicharas[i]; - _sf.tApplyHeyaChanges(); - } - - System.IO.File.Move(@"NamePlate.json", @"NamePlate_old.json"); - } - - #endregion +class NamePlateConfig { + public void tNamePlateConfig() { + // Deprecated, only converts to new format + tLoadFile(); } + + #region [Medals] + + public void tEarnCoins(int[] amounts) { + if (amounts.Length < 2) + return; + + for (int i = 0; i < 5; i++) { + int p = OpenTaiko.GetActualPlayer(i); + + data.Medals[p] += amounts[i]; + } + tSaveFile(); + } + + // Return false if the current amount of coins is to low + public bool tSpendCoins(int amount, int player) { + if (player > 1 || player < 0) + return false; + + if (data.Medals[player] < amount) + return false; + + data.Medals[player] -= amount; + + tSaveFile(); + + return true; + } + + #endregion + + #region [Dan titles] + + public bool tUpdateDanTitle(string title, bool isGold, int clearStatus, int player) { + bool changed = false; + + bool iG = isGold; + int cs = clearStatus; + + if (OpenTaiko.NamePlateConfig.data.DanTitles[player] == null) + OpenTaiko.NamePlateConfig.data.DanTitles[player] = new Dictionary(); + + if (OpenTaiko.NamePlateConfig.data.DanTitles[player].ContainsKey(title)) { + if (OpenTaiko.NamePlateConfig.data.DanTitles[player][title].clearStatus > cs) + cs = OpenTaiko.NamePlateConfig.data.DanTitles[player][title].clearStatus; + if (OpenTaiko.NamePlateConfig.data.DanTitles[player][title].isGold) + iG = true; + } + + // Automatically set the dan to nameplate if new + // Add a function within the NamePlate.cs file to update the title texture + + if (!OpenTaiko.NamePlateConfig.data.DanTitles[player].ContainsKey(title) || cs != clearStatus || iG != isGold) { + changed = true; + } + + + SaveFile.CDanTitle danTitle = new SaveFile.CDanTitle(iG, cs); + + OpenTaiko.NamePlateConfig.data.DanTitles[player][title] = danTitle; + + tSaveFile(); + + return changed; + } + + #endregion + + #region [Auxilliary classes] + + public class CDanTitle { + public CDanTitle(bool iG, int cs) { + isGold = iG; + clearStatus = cs; + } + + [JsonProperty("isGold")] + public bool isGold; + + [JsonProperty("clearStatus")] + public int clearStatus; + } + + public class CNamePlateTitle { + public CNamePlateTitle(int type) { + iType = type; + } + + [JsonProperty("iType")] + public int iType; + } + + #endregion + + #region [Heya] + + public void tReindexCharacter(int p, string[] characterNamesList) { + string character = this.data.CharacterName[p]; + + if (characterNamesList.Contains(character)) + this.data.Character[p] = characterNamesList.ToList().IndexOf(character); + + } + + public void tUpdateCharacterName(int p, string newChara) { + this.data.CharacterName[p] = newChara; + } + + public void tApplyHeyaChanges() { + this.tSaveFile(); + } + + #endregion + + public class Data { + [JsonProperty("name")] + public string[] Name = { "プレイヤー1", "プレイヤー2", "プレイヤー3", "プレイヤー4", "プレイヤー5" }; + + [JsonProperty("title")] + public string[] Title = { "初心者", "初心者", "初心者", "初心者", "初心者" }; + + [JsonProperty("dan")] + public string[] Dan = { "新人", "新人", "新人", "新人", "新人" }; + + [JsonProperty("danGold")] + public bool[] DanGold = { false, false, false, false, false }; + + [JsonProperty("danType")] + public int[] DanType = { 0, 0, 0, 0, 0 }; + + [JsonProperty("titleType")] + public int[] TitleType = { 0, 0, 0, 0, 0 }; + + [JsonProperty("puchiChara")] + public string[] PuchiChara = { "0", "0", "0", "0", "0" }; + + [JsonProperty("medals")] + public int[] Medals = { 0, 0, 0, 0, 0 }; + + [JsonProperty("character")] + public int[] Character = { 0, 0, 0, 0, 0 }; + + [JsonProperty("characterName")] + public string[] CharacterName = { "0", "0", "0", "0", "0" }; + + [JsonProperty("danTitles")] + public Dictionary[] DanTitles = new Dictionary[5]; + + [JsonProperty("namePlateTitles")] + public Dictionary[] NamePlateTitles = new Dictionary[5]; + + [JsonProperty("unlockedPuchicharas")] + public List[] UnlockedPuchicharas = new List[5] + { + new List(), + new List(), + new List(), + new List(), + new List() + }; + + } + + public Data data = new Data(); + + #region [private] + + private void tSaveFile() { + ConfigManager.SaveConfig(data, "NamePlate.json"); + } + + private void tLoadFile() { + if (!File.Exists("NamePlate.json")) + return; + + var _data = ConfigManager.GetConfig(@"NamePlate.json"); + + for (int i = 0; i < _data.Name.Length; i++) { + var _sf = new SaveFile(); + _sf.tSaveFile((i + 1) + "P"); + _sf.data.Name = _data.Name[i]; + _sf.data.Title = _data.Title[i]; + _sf.data.Dan = _data.Dan[i]; + _sf.data.DanGold = _data.DanGold[i]; + _sf.data.DanType = _data.DanType[i]; + _sf.data.TitleType = _data.TitleType[i]; + _sf.data.PuchiChara = _data.PuchiChara[i]; + _sf.data.Medals = _data.Medals[i]; + _sf.data.Character = _data.Character[i]; + _sf.data.CharacterName = _data.CharacterName[i]; + _sf.data.DanTitles = _data.DanTitles[i]; + _sf.data.NamePlateTitles = _data.NamePlateTitles[i]; + _sf.data.UnlockedPuchicharas = _data.UnlockedPuchicharas[i]; + _sf.tApplyHeyaChanges(); + } + + System.IO.File.Move(@"NamePlate.json", @"NamePlate_old.json"); + } + + #endregion } diff --git a/OpenTaiko/src/Common/OpenTaiko.cs b/OpenTaiko/src/Common/OpenTaiko.cs index 8321c636..04b05d67 100755 --- a/OpenTaiko/src/Common/OpenTaiko.cs +++ b/OpenTaiko/src/Common/OpenTaiko.cs @@ -12,648 +12,922 @@ using Silk.NET.Maths; using SkiaSharp; using Rectangle = System.Drawing.Rectangle; -namespace OpenTaiko { - internal class OpenTaiko : Game { - // Properties - #region [ properties ] - public static readonly string VERSION = Assembly.GetExecutingAssembly().GetName().Version.ToString(); - public static readonly string AppDisplayThreePartVersion = GetAppDisplayThreePartVersion(); - public static readonly string AppNumericThreePartVersion = GetAppNumericThreePartVersion(); +namespace OpenTaiko; - private static string GetAppDisplayThreePartVersion() { - return $"v{GetAppNumericThreePartVersion()}"; - } +internal class OpenTaiko : Game { + // Properties + #region [ properties ] + public static readonly string VERSION = Assembly.GetExecutingAssembly().GetName().Version.ToString(); + public static readonly string AppDisplayThreePartVersion = GetAppDisplayThreePartVersion(); + public static readonly string AppNumericThreePartVersion = GetAppNumericThreePartVersion(); - private static string GetAppNumericThreePartVersion() { - var version = Assembly.GetExecutingAssembly().GetName().Version; + private static string GetAppDisplayThreePartVersion() { + return $"v{GetAppNumericThreePartVersion()}"; + } - return $"{version.Major}.{version.Minor}.{version.Build}"; - } + private static string GetAppNumericThreePartVersion() { + var version = Assembly.GetExecutingAssembly().GetName().Version; - public static readonly string AppInformationalVersion = - Assembly - .GetExecutingAssembly() - .GetCustomAttributes(typeof(AssemblyInformationalVersionAttribute), false) - .Cast() - .FirstOrDefault() - ?.InformationalVersion - ?? $"{GetAppDisplayThreePartVersion()} (unknown informational version)"; - - public static CStage latestSongSelect { - get; - private set; - } + return $"{version.Major}.{version.Minor}.{version.Build}"; + } - public static OpenTaiko app { - get; - private set; - } - public static CTextConsole actTextConsole { - get; - private set; - } - public static CConfigIni ConfigIni { - get; - private set; - } + public static readonly string AppInformationalVersion = + Assembly + .GetExecutingAssembly() + .GetCustomAttributes(typeof(AssemblyInformationalVersionAttribute), false) + .Cast() + .FirstOrDefault() + ?.InformationalVersion + ?? $"{GetAppDisplayThreePartVersion()} (unknown informational version)"; - public static CVisualLogManager VisualLogManager { - get; - private set; - } - - #region [DTX instances] - public static CDTX DTX { - get { - return dtx[0]; + public static CStage latestSongSelect { + get; + private set; + } + + public static OpenTaiko app { + get; + private set; + } + public static CTextConsole actTextConsole { + get; + private set; + } + public static CConfigIni ConfigIni { + get; + private set; + } + + public static CVisualLogManager VisualLogManager { + get; + private set; + } + + #region [DTX instances] + public static CDTX DTX { + get { + return dtx[0]; + } + set { + if ((dtx[0] != null) && (app != null)) { + dtx[0].DeActivate(); + dtx[0].ReleaseManagedResource(); + dtx[0].ReleaseUnmanagedResource(); + app.listトップレベルActivities.Remove(dtx[0]); } - set { - if ((dtx[0] != null) && (app != null)) { - dtx[0].DeActivate(); - dtx[0].ReleaseManagedResource(); - dtx[0].ReleaseUnmanagedResource(); - app.listトップレベルActivities.Remove(dtx[0]); - } - dtx[0] = value; - if ((dtx[0] != null) && (app != null)) { - app.listトップレベルActivities.Add(dtx[0]); - } + dtx[0] = value; + if ((dtx[0] != null) && (app != null)) { + app.listトップレベルActivities.Add(dtx[0]); } } - public static CDTX DTX_2P { - get { - return dtx[1]; + } + public static CDTX DTX_2P { + get { + return dtx[1]; + } + set { + if ((dtx[1] != null) && (app != null)) { + dtx[1].DeActivate(); + dtx[1].ReleaseManagedResource(); + dtx[1].ReleaseUnmanagedResource(); + app.listトップレベルActivities.Remove(dtx[1]); } - set { - if ((dtx[1] != null) && (app != null)) { - dtx[1].DeActivate(); - dtx[1].ReleaseManagedResource(); - dtx[1].ReleaseUnmanagedResource(); - app.listトップレベルActivities.Remove(dtx[1]); - } - dtx[1] = value; - if ((dtx[1] != null) && (app != null)) { - app.listトップレベルActivities.Add(dtx[1]); - } + dtx[1] = value; + if ((dtx[1] != null) && (app != null)) { + app.listトップレベルActivities.Add(dtx[1]); } } - public static CDTX DTX_3P { - get { - return dtx[2]; + } + public static CDTX DTX_3P { + get { + return dtx[2]; + } + set { + if ((dtx[2] != null) && (app != null)) { + dtx[2].DeActivate(); + dtx[2].ReleaseManagedResource(); + dtx[2].ReleaseUnmanagedResource(); + app.listトップレベルActivities.Remove(dtx[2]); } - set { - if ((dtx[2] != null) && (app != null)) { - dtx[2].DeActivate(); - dtx[2].ReleaseManagedResource(); - dtx[2].ReleaseUnmanagedResource(); - app.listトップレベルActivities.Remove(dtx[2]); - } - dtx[2] = value; - if ((dtx[2] != null) && (app != null)) { - app.listトップレベルActivities.Add(dtx[2]); - } + dtx[2] = value; + if ((dtx[2] != null) && (app != null)) { + app.listトップレベルActivities.Add(dtx[2]); } } - public static CDTX DTX_4P { - get { - return dtx[3]; + } + public static CDTX DTX_4P { + get { + return dtx[3]; + } + set { + if ((dtx[3] != null) && (app != null)) { + dtx[3].DeActivate(); + dtx[3].ReleaseManagedResource(); + dtx[3].ReleaseUnmanagedResource(); + app.listトップレベルActivities.Remove(dtx[3]); } - set { - if ((dtx[3] != null) && (app != null)) { - dtx[3].DeActivate(); - dtx[3].ReleaseManagedResource(); - dtx[3].ReleaseUnmanagedResource(); - app.listトップレベルActivities.Remove(dtx[3]); - } - dtx[3] = value; - if ((dtx[3] != null) && (app != null)) { - app.listトップレベルActivities.Add(dtx[3]); - } + dtx[3] = value; + if ((dtx[3] != null) && (app != null)) { + app.listトップレベルActivities.Add(dtx[3]); } } - public static CDTX DTX_5P { - get { - return dtx[4]; + } + public static CDTX DTX_5P { + get { + return dtx[4]; + } + set { + if ((dtx[4] != null) && (app != null)) { + dtx[4].DeActivate(); + dtx[4].ReleaseManagedResource(); + dtx[4].ReleaseUnmanagedResource(); + app.listトップレベルActivities.Remove(dtx[4]); } - set { - if ((dtx[4] != null) && (app != null)) { - dtx[4].DeActivate(); - dtx[4].ReleaseManagedResource(); - dtx[4].ReleaseUnmanagedResource(); - app.listトップレベルActivities.Remove(dtx[4]); + dtx[4] = value; + if ((dtx[4] != null) && (app != null)) { + app.listトップレベルActivities.Add(dtx[4]); + } + } + } + + public static CDTX GetDTX(int player) { + switch (player) { + case 0: + return OpenTaiko.DTX; + case 1: + return OpenTaiko.DTX_2P; + case 2: + return OpenTaiko.DTX_3P; + case 3: + return OpenTaiko.DTX_4P; + case 4: + return OpenTaiko.DTX_5P; + } + return null; + } + + #endregion + + public static CSongReplay[] ReplayInstances = new CSongReplay[5]; + + public static CFPS FPS { + get; + private set; + } + public static CInputManager InputManager { + get; + private set; + } + #region [ 入力範囲ms ] + public static int nPerfect範囲ms { + get { + if (stageSongSelect.rChoosenSong != null) { + CSongListNode c曲リストノード = stageSongSelect.rChoosenSong.rParentNode; + if (((c曲リストノード != null) && (c曲リストノード.eノード種別 == CSongListNode.ENodeType.BOX)) && (c曲リストノード.nPerfect範囲ms >= 0)) { + return c曲リストノード.nPerfect範囲ms; } - dtx[4] = value; - if ((dtx[4] != null) && (app != null)) { - app.listトップレベルActivities.Add(dtx[4]); + } + return ConfigIni.nHitRangeMs.Perfect; + } + } + public static int nGreat範囲ms { + get { + if (stageSongSelect.rChoosenSong != null) { + CSongListNode c曲リストノード = stageSongSelect.rChoosenSong.rParentNode; + if (((c曲リストノード != null) && (c曲リストノード.eノード種別 == CSongListNode.ENodeType.BOX)) && (c曲リストノード.nGreat範囲ms >= 0)) { + return c曲リストノード.nGreat範囲ms; } } + return ConfigIni.nHitRangeMs.Great; + } + } + public static int nGood範囲ms { + get { + if (stageSongSelect.rChoosenSong != null) { + CSongListNode c曲リストノード = stageSongSelect.rChoosenSong.rParentNode; + if (((c曲リストノード != null) && (c曲リストノード.eノード種別 == CSongListNode.ENodeType.BOX)) && (c曲リストノード.nGood範囲ms >= 0)) { + return c曲リストノード.nGood範囲ms; + } + } + return ConfigIni.nHitRangeMs.Good; + } + } + public static int nPoor範囲ms { + get { + if (stageSongSelect.rChoosenSong != null) { + CSongListNode c曲リストノード = stageSongSelect.rChoosenSong.rParentNode; + if (((c曲リストノード != null) && (c曲リストノード.eノード種別 == CSongListNode.ENodeType.BOX)) && (c曲リストノード.nPoor範囲ms >= 0)) { + return c曲リストノード.nPoor範囲ms; + } + } + return ConfigIni.nHitRangeMs.Poor; + } + } + #endregion + public static CPad Pad { + get; + private set; + } + public static Random Random { + get; + private set; + } + public static CSkin Skin { + get; + private set; + } + public static CSongs管理 Songs管理 { + get; + set; // 2012.1.26 yyagi private解除 CStage起動でのdesirialize読み込みのため + } + public static CEnumSongs EnumSongs { + get; + private set; + } + public static CActEnumSongs actEnumSongs { + get; + private set; + } + public static CActScanningLoudness actScanningLoudness { + get; + private set; + } + + public static SoundManager SoundManager { + get; + private set; + } + + public static SongGainController SongGainController { + get; + private set; + } + + public static SoundGroupLevelController SoundGroupLevelController { + get; + private set; + } + + public static CNamePlate NamePlate { + get; + private set; + } + + public static NamePlateConfig NamePlateConfig { + get; + private set; + } + + public static Favorites Favorites { + get; + private set; + } + + public static RecentlyPlayedSongs RecentlyPlayedSongs { + get; + private set; + } + + public static Databases Databases { + get; + private set; + } + + public static CStage起動 stage起動 { + get; + private set; + } + public static CStageタイトル stageタイトル { + get; + private set; + } + public static CStageコンフィグ stageコンフィグ { + get; + private set; + } + public static CStage選曲 stageSongSelect { + get; + private set; + } + public static CStage段位選択 stage段位選択 { + get; + private set; + } + public static CStageHeya stageHeya { + get; + private set; + } + + public static CStageOnlineLounge stageOnlineLounge { + get; + private set; + } + + public static CStageTowerSelect stageTowerSelect { + get; + private set; + } + + public static CStage曲読み込み stage曲読み込み { + get; + private set; + } + public static CStage演奏ドラム画面 stage演奏ドラム画面 { + get; + private set; + } + public static CStage結果 stage結果 { + get; + private set; + } + public static CStageChangeSkin stageChangeSkin { + get; + private set; + } + public static CStage終了 stage終了 { + get; + private set; + } + public static CStage r現在のステージ = null; + public static CStage r直前のステージ = null; + public static string strEXEのあるフォルダ { + get; + private set; + } + public static CTimer Timer { + get; + private set; + } + public bool b次のタイミングで垂直帰線同期切り替えを行う { + get; + set; + } + public bool b次のタイミングで全画面_ウィンドウ切り替えを行う { + get; + set; + } + public static DiscordRpcClient DiscordClient; + + // 0 : 1P, 1 : 2P + public static int SaveFile = 0; + + public static SaveFile[] SaveFileInstances = new SaveFile[5]; + + // 0 : Hidari, 1 : Migi (1P only) + public static int PlayerSide = 0; + + public static int GetActualPlayer(int player) { + if (SaveFile == 0 || player > 1) + return player; + if (player == 0) + return 1; + return 0; + } + + public static bool P1IsBlue() { + return (OpenTaiko.PlayerSide == 1 && OpenTaiko.ConfigIni.nPlayerCount == 1); + } + + #endregion + + // Constructor + + public OpenTaiko() : base("OpenTaiko.ico") { + OpenTaiko.app = this; + } + + public static string sEncType = "Shift_JIS"; + + public static string LargeImageKey { + get { + return "opentaiko"; + } + } + + public static string LargeImageText { + get { + return "Ver." + Assembly.GetExecutingAssembly().GetName().Version.ToString() + "(" + RuntimeInformation.RuntimeIdentifier + ")"; + } + } + + public static CCounter BeatScaling; + + /// + /// Returns true for this session if the game fails to locate Config.ini.
+ /// This could be treated as the player's first time launching the game. + ///
+ public static bool ConfigIsNew; + + + + // メソッド + + + #region [ #24609 リザルト画像をpngで保存する ] // #24609 2011.3.14 yyagi; to save result screen in case BestRank or HiSkill. + /// + /// リザルト画像のキャプチャと保存。 + /// + /// 保存するファイル名(フルパス) + public bool SaveResultScreen(string strFullPath) { + bool success = true; + + void save(SKBitmap sKBitmap) { + string strSavePath = Path.GetDirectoryName(strFullPath); + if (!Directory.Exists(strSavePath)) { + try { + Directory.CreateDirectory(strSavePath); + } catch { + Trace.TraceError(ToString()); + Trace.TraceError("例外が発生しましたが処理を継続します。 (0bfe6bff-2a56-4df4-9333-2df26d9b765b)"); + success = false; + } + } + if (!File.Exists(strFullPath)) { + using FileStream stream = File.OpenWrite(strFullPath); + sKBitmap.Encode(stream, SKEncodedImageFormat.Png, 80); + } } - public static CDTX GetDTX(int player) { - switch (player) { - case 0: - return OpenTaiko.DTX; - case 1: - return OpenTaiko.DTX_2P; - case 2: - return OpenTaiko.DTX_3P; - case 3: - return OpenTaiko.DTX_4P; - case 4: - return OpenTaiko.DTX_5P; - } - return null; - } - + GetScreenShotAsync(save); + + return success; + } + #endregion + + // Game 実装 + + + protected override void Configuration() { + #region [ strEXEのあるフォルダを決定する ] + //----------------- + strEXEのあるフォルダ = Environment.CurrentDirectory + Path.DirectorySeparatorChar; + // END #23629 2010.11.13 from + //----------------- #endregion - - public static CSongReplay[] ReplayInstances = new CSongReplay[5]; - public static CFPS FPS { - get; - private set; - } - public static CInputManager InputManager { - get; - private set; - } - #region [ 入力範囲ms ] - public static int nPerfect範囲ms { - get { - if (stageSongSelect.rChoosenSong != null) { - CSongListNode c曲リストノード = stageSongSelect.rChoosenSong.rParentNode; - if (((c曲リストノード != null) && (c曲リストノード.eノード種別 == CSongListNode.ENodeType.BOX)) && (c曲リストノード.nPerfect範囲ms >= 0)) { - return c曲リストノード.nPerfect範囲ms; - } - } - return ConfigIni.nHitRangeMs.Perfect; + ConfigIni = new CConfigIni(); + + string path = strEXEのあるフォルダ + "Config.ini"; + if (File.Exists(path)) { + try { + // Load config info + ConfigIni.LoadFromFile(path); + } catch (Exception e) { + Trace.TraceError(e.ToString()); + Trace.TraceError("例外が発生しましたが処理を継続します。 (b8d93255-bbe4-4ca3-8264-7ee5175b19f3)"); } + } else { + ConfigIsNew = true; } - public static int nGreat範囲ms { - get { - if (stageSongSelect.rChoosenSong != null) { - CSongListNode c曲リストノード = stageSongSelect.rChoosenSong.rParentNode; - if (((c曲リストノード != null) && (c曲リストノード.eノード種別 == CSongListNode.ENodeType.BOX)) && (c曲リストノード.nGreat範囲ms >= 0)) { - return c曲リストノード.nGreat範囲ms; - } - } - return ConfigIni.nHitRangeMs.Great; + + switch (ConfigIni.nGraphicsDeviceType) { + case 0: + GraphicsDeviceType_ = Silk.NET.GLFW.AnglePlatformType.OpenGL; + break; + case 1: + GraphicsDeviceType_ = Silk.NET.GLFW.AnglePlatformType.D3D11; + break; + case 2: + GraphicsDeviceType_ = Silk.NET.GLFW.AnglePlatformType.Vulkan; + break; + case 3: + GraphicsDeviceType_ = Silk.NET.GLFW.AnglePlatformType.Metal; + break; + } + + WindowPosition = new Silk.NET.Maths.Vector2D(ConfigIni.nWindowBaseXPosition, ConfigIni.nWindowBaseYPosition); + WindowSize = new Silk.NET.Maths.Vector2D(ConfigIni.nWindowWidth, ConfigIni.nWindowHeight); + FullScreen = ConfigIni.bFullScreen; + VSync = ConfigIni.bEnableVSync; + Framerate = 0; + + base.Configuration(); + } + + protected override void Initialize() { + this.t起動処理(); + } + + protected override void LoadContent() { + if (ConfigIni.bWindowMode) { + if (!this.bマウスカーソル表示中) { + this.bマウスカーソル表示中 = true; } - } - public static int nGood範囲ms { - get { - if (stageSongSelect.rChoosenSong != null) { - CSongListNode c曲リストノード = stageSongSelect.rChoosenSong.rParentNode; - if (((c曲リストノード != null) && (c曲リストノード.eノード種別 == CSongListNode.ENodeType.BOX)) && (c曲リストノード.nGood範囲ms >= 0)) { - return c曲リストノード.nGood範囲ms; - } - } - return ConfigIni.nHitRangeMs.Good; - } - } - public static int nPoor範囲ms { - get { - if (stageSongSelect.rChoosenSong != null) { - CSongListNode c曲リストノード = stageSongSelect.rChoosenSong.rParentNode; - if (((c曲リストノード != null) && (c曲リストノード.eノード種別 == CSongListNode.ENodeType.BOX)) && (c曲リストノード.nPoor範囲ms >= 0)) { - return c曲リストノード.nPoor範囲ms; - } - } - return ConfigIni.nHitRangeMs.Poor; - } - } - #endregion - public static CPad Pad { - get; - private set; - } - public static Random Random { - get; - private set; - } - public static CSkin Skin { - get; - private set; - } - public static CSongs管理 Songs管理 { - get; - set; // 2012.1.26 yyagi private解除 CStage起動でのdesirialize読み込みのため - } - public static CEnumSongs EnumSongs { - get; - private set; - } - public static CActEnumSongs actEnumSongs { - get; - private set; - } - public static CActScanningLoudness actScanningLoudness { - get; - private set; + } else if (this.bマウスカーソル表示中) { + this.bマウスカーソル表示中 = false; } - public static SoundManager SoundManager { - get; - private set; + if (this.listトップレベルActivities != null) { + foreach (CActivity activity in this.listトップレベルActivities) + activity.CreateUnmanagedResource(); } + } + protected override void UnloadContent() { + if (this.listトップレベルActivities != null) { + foreach (CActivity activity in this.listトップレベルActivities) + activity.ReleaseUnmanagedResource(); + } + } + protected override void OnExiting() { + ConfigIni.nWindowBaseXPosition = WindowPosition.X; + ConfigIni.nWindowBaseYPosition = WindowPosition.Y; + ConfigIni.nWindowWidth = WindowSize.X; + ConfigIni.nWindowHeight = WindowSize.Y; + ConfigIni.bFullScreen = FullScreen; + ConfigIni.bEnableVSync = VSync; + Framerate = 0; - public static SongGainController SongGainController { - get; - private set; - } - - public static SoundGroupLevelController SoundGroupLevelController { - get; - private set; - } - - public static CNamePlate NamePlate { - get; - private set; - } - - public static NamePlateConfig NamePlateConfig { - get; - private set; - } - - public static Favorites Favorites { - get; - private set; - } - - public static RecentlyPlayedSongs RecentlyPlayedSongs { - get; - private set; - } - - public static Databases Databases { - get; - private set; - } - - public static CStage起動 stage起動 { - get; - private set; - } - public static CStageタイトル stageタイトル { - get; - private set; - } - public static CStageコンフィグ stageコンフィグ { - get; - private set; - } - public static CStage選曲 stageSongSelect { - get; - private set; - } - public static CStage段位選択 stage段位選択 { - get; - private set; - } - public static CStageHeya stageHeya { - get; - private set; - } - - public static CStageOnlineLounge stageOnlineLounge { - get; - private set; - } - - public static CStageTowerSelect stageTowerSelect { - get; - private set; - } - - public static CStage曲読み込み stage曲読み込み { - get; - private set; - } - public static CStage演奏ドラム画面 stage演奏ドラム画面 { - get; - private set; - } - public static CStage結果 stage結果 { - get; - private set; - } - public static CStageChangeSkin stageChangeSkin { - get; - private set; - } - public static CStage終了 stage終了 { - get; - private set; - } - public static CStage r現在のステージ = null; - public static CStage r直前のステージ = null; - public static string strEXEのあるフォルダ { - get; - private set; - } - public static CTimer Timer { - get; - private set; - } - public bool b次のタイミングで垂直帰線同期切り替えを行う { - get; - set; - } - public bool b次のタイミングで全画面_ウィンドウ切り替えを行う { - get; - set; - } - public static DiscordRpcClient DiscordClient; - - // 0 : 1P, 1 : 2P - public static int SaveFile = 0; - - public static SaveFile[] SaveFileInstances = new SaveFile[5]; - - // 0 : Hidari, 1 : Migi (1P only) - public static int PlayerSide = 0; - - public static int GetActualPlayer(int player) { - if (SaveFile == 0 || player > 1) - return player; - if (player == 0) - return 1; - return 0; - } - - public static bool P1IsBlue() { - return (OpenTaiko.PlayerSide == 1 && OpenTaiko.ConfigIni.nPlayerCount == 1); - } - - #endregion - - // Constructor - - public OpenTaiko() : base("OpenTaiko.ico") { - OpenTaiko.app = this; - } - - public static string sEncType = "Shift_JIS"; - - public static string LargeImageKey { - get { - return "opentaiko"; - } - } - - public static string LargeImageText { - get { - return "Ver." + Assembly.GetExecutingAssembly().GetName().Version.ToString() + "(" + RuntimeInformation.RuntimeIdentifier + ")"; - } - } - - public static CCounter BeatScaling; - - /// - /// Returns true for this session if the game fails to locate Config.ini.
- /// This could be treated as the player's first time launching the game. - ///
- public static bool ConfigIsNew; - - - - // メソッド - - - #region [ #24609 リザルト画像をpngで保存する ] // #24609 2011.3.14 yyagi; to save result screen in case BestRank or HiSkill. - /// - /// リザルト画像のキャプチャと保存。 - /// - /// 保存するファイル名(フルパス) - public bool SaveResultScreen(string strFullPath) { - bool success = true; - - void save(SKBitmap sKBitmap) { - string strSavePath = Path.GetDirectoryName(strFullPath); - if (!Directory.Exists(strSavePath)) { - try { - Directory.CreateDirectory(strSavePath); - } catch { - Trace.TraceError(ToString()); - Trace.TraceError("例外が発生しましたが処理を継続します。 (0bfe6bff-2a56-4df4-9333-2df26d9b765b)"); - success = false; - } - } - if (!File.Exists(strFullPath)) { - using FileStream stream = File.OpenWrite(strFullPath); - sKBitmap.Encode(stream, SKEncodedImageFormat.Png, 80); - } - } - - GetScreenShotAsync(save); - - return success; - } - #endregion - - // Game 実装 - - - protected override void Configuration() { - #region [ strEXEのあるフォルダを決定する ] - //----------------- - strEXEのあるフォルダ = Environment.CurrentDirectory + Path.DirectorySeparatorChar; - // END #23629 2010.11.13 from - //----------------- - #endregion - - ConfigIni = new CConfigIni(); - - string path = strEXEのあるフォルダ + "Config.ini"; - if (File.Exists(path)) { - try { - // Load config info - ConfigIni.LoadFromFile(path); - } catch (Exception e) { - Trace.TraceError(e.ToString()); - Trace.TraceError("例外が発生しましたが処理を継続します。 (b8d93255-bbe4-4ca3-8264-7ee5175b19f3)"); - } - } else { - ConfigIsNew = true; - } - - switch (ConfigIni.nGraphicsDeviceType) { - case 0: - GraphicsDeviceType_ = Silk.NET.GLFW.AnglePlatformType.OpenGL; - break; - case 1: - GraphicsDeviceType_ = Silk.NET.GLFW.AnglePlatformType.D3D11; - break; - case 2: - GraphicsDeviceType_ = Silk.NET.GLFW.AnglePlatformType.Vulkan; - break; - case 3: - GraphicsDeviceType_ = Silk.NET.GLFW.AnglePlatformType.Metal; - break; - } - - WindowPosition = new Silk.NET.Maths.Vector2D(ConfigIni.nWindowBaseXPosition, ConfigIni.nWindowBaseYPosition); - WindowSize = new Silk.NET.Maths.Vector2D(ConfigIni.nWindowWidth, ConfigIni.nWindowHeight); - FullScreen = ConfigIni.bFullScreen; - VSync = ConfigIni.bEnableVSync; - Framerate = 0; - - base.Configuration(); - } - - protected override void Initialize() { - this.t起動処理(); - } - - protected override void LoadContent() { - if (ConfigIni.bWindowMode) { - if (!this.bマウスカーソル表示中) { - this.bマウスカーソル表示中 = true; - } - } else if (this.bマウスカーソル表示中) { - this.bマウスカーソル表示中 = false; - } - - if (this.listトップレベルActivities != null) { - foreach (CActivity activity in this.listトップレベルActivities) - activity.CreateUnmanagedResource(); - } - } - protected override void UnloadContent() { - if (this.listトップレベルActivities != null) { - foreach (CActivity activity in this.listトップレベルActivities) - activity.ReleaseUnmanagedResource(); - } - } - protected override void OnExiting() { - ConfigIni.nWindowBaseXPosition = WindowPosition.X; - ConfigIni.nWindowBaseYPosition = WindowPosition.Y; - ConfigIni.nWindowWidth = WindowSize.X; - ConfigIni.nWindowHeight = WindowSize.Y; - ConfigIni.bFullScreen = FullScreen; - ConfigIni.bEnableVSync = VSync; - Framerate = 0; - - this.t終了処理(); - base.OnExiting(); - } - protected override void Update() { - InputManager?.Polling(OpenTaiko.ConfigIni.bBufferedInputs); - } - protected override void Draw() { + this.t終了処理(); + base.OnExiting(); + } + protected override void Update() { + InputManager?.Polling(OpenTaiko.ConfigIni.bBufferedInputs); + } + protected override void Draw() { #if !DEBUG try #endif - { - Timer?.Update(); - SoundManager.PlayTimer?.Update(); - FPS?.Update(); + { + Timer?.Update(); + SoundManager.PlayTimer?.Update(); + FPS?.Update(); - if (BeatScaling != null) { - BeatScaling.Tick(); - float value = MathF.Sin((BeatScaling.CurrentValue / 1000.0f) * MathF.PI / 2.0f); - float scale = 1.0f + ((1.0f - value) / 40.0f); - Camera *= Matrix4X4.CreateScale(scale, scale, 1.0f); - if (BeatScaling.CurrentValue == BeatScaling.EndValue) BeatScaling = null; - } - - // #xxxxx 2013.4.8 yyagi; sleepの挿入位置を、EndScnene~Present間から、BeginScene前に移動。描画遅延を小さくするため。 - - if (r現在のステージ != null) { - OpenTaiko.NamePlate.lcNamePlate.Update(); - this.n進行描画の戻り値 = (r現在のステージ != null) ? r現在のステージ.Draw() : 0; + if (BeatScaling != null) { + BeatScaling.Tick(); + float value = MathF.Sin((BeatScaling.CurrentValue / 1000.0f) * MathF.PI / 2.0f); + float scale = 1.0f + ((1.0f - value) / 40.0f); + Camera *= Matrix4X4.CreateScale(scale, scale, 1.0f); + if (BeatScaling.CurrentValue == BeatScaling.EndValue) BeatScaling = null; + } - CScoreIni scoreIni = null; - - #region [ 曲検索スレッドの起動/終了 ] - // ここに"Enumerating Songs..."表示を集約 - actEnumSongs.Draw(); // "Enumerating Songs..."アイコンの描画 - - switch (r現在のステージ.eStageID) { - case CStage.EStage.Title: - case CStage.EStage.Config: - case CStage.EStage.SongSelect: - case CStage.EStage.SongLoading: - if (EnumSongs != null) { - #region [ (特定条件時) 曲検索スレッドの起動_開始 ] - if (r現在のステージ.eStageID == CStage.EStage.Title && - r直前のステージ.eStageID == CStage.EStage.StartUp && - this.n進行描画の戻り値 == (int)CStageタイトル.E戻り値.継続 && - !EnumSongs.IsSongListEnumStarted) { - actEnumSongs.Activate(); - if (!ConfigIni.PreAssetsLoading) { - actEnumSongs.CreateManagedResource(); - actEnumSongs.CreateUnmanagedResource(); - } - OpenTaiko.stageSongSelect.bIsEnumeratingSongs = true; - EnumSongs.Init(); // 取得した曲数を、新インスタンスにも与える - EnumSongs.StartEnumFromDisk(); // 曲検索スレッドの起動_開始 - } - #endregion - - #region [ 曲検索の中断と再開 ] - if (r現在のステージ.eStageID == CStage.EStage.SongSelect && !EnumSongs.IsSongListEnumCompletelyDone) { - switch (this.n進行描画の戻り値) { - case 0: // 何もない - EnumSongs.Resume(); - EnumSongs.IsSlowdown = false; - actEnumSongs.Activate(); - if (!ConfigIni.PreAssetsLoading) { - actEnumSongs.CreateManagedResource(); - actEnumSongs.CreateUnmanagedResource(); - } - break; + // #xxxxx 2013.4.8 yyagi; sleepの挿入位置を、EndScnene~Present間から、BeginScene前に移動。描画遅延を小さくするため。 - case 2: // 曲決定 - EnumSongs.Suspend(); // #27060 バックグラウンドの曲検索を一時停止 - actEnumSongs.DeActivate(); - if (!ConfigIni.PreAssetsLoading) { - actEnumSongs.ReleaseManagedResource(); - actEnumSongs.ReleaseUnmanagedResource(); - } - break; - } - } - #endregion - - #region [ 曲探索中断待ち待機 ] - if (r現在のステージ.eStageID == CStage.EStage.SongLoading && !EnumSongs.IsSongListEnumCompletelyDone && - EnumSongs.thDTXFileEnumerate != null) // #28700 2012.6.12 yyagi; at Compact mode, enumerating thread does not exist. - { - EnumSongs.WaitUntilSuspended(); // 念のため、曲検索が一時中断されるまで待機 - } - #endregion - - #region [ 曲検索が完了したら、実際の曲リストに反映する ] - // CStage選曲.On活性化() に回した方がいいかな? - if (EnumSongs.IsSongListEnumerated) { - actEnumSongs.DeActivate(); - if (!ConfigIni.PreAssetsLoading) { - actEnumSongs.ReleaseManagedResource(); - actEnumSongs.ReleaseUnmanagedResource(); - } - OpenTaiko.stageSongSelect.bIsEnumeratingSongs = false; + if (r現在のステージ != null) { + OpenTaiko.NamePlate.lcNamePlate.Update(); + this.n進行描画の戻り値 = (r現在のステージ != null) ? r現在のステージ.Draw() : 0; - bool bRemakeSongTitleBar = (r現在のステージ.eStageID == CStage.EStage.SongSelect) ? true : false; - OpenTaiko.stageSongSelect.Refresh(EnumSongs.Songs管理, bRemakeSongTitleBar); - EnumSongs.SongListEnumCompletelyDone(); - } - #endregion + CScoreIni scoreIni = null; + + #region [ 曲検索スレッドの起動/終了 ] + // ここに"Enumerating Songs..."表示を集約 + actEnumSongs.Draw(); // "Enumerating Songs..."アイコンの描画 + + switch (r現在のステージ.eStageID) { + case CStage.EStage.Title: + case CStage.EStage.Config: + case CStage.EStage.SongSelect: + case CStage.EStage.SongLoading: + if (EnumSongs != null) { + #region [ (特定条件時) 曲検索スレッドの起動_開始 ] + if (r現在のステージ.eStageID == CStage.EStage.Title && + r直前のステージ.eStageID == CStage.EStage.StartUp && + this.n進行描画の戻り値 == (int)CStageタイトル.E戻り値.継続 && + !EnumSongs.IsSongListEnumStarted) { + actEnumSongs.Activate(); + if (!ConfigIni.PreAssetsLoading) { + actEnumSongs.CreateManagedResource(); + actEnumSongs.CreateUnmanagedResource(); + } + OpenTaiko.stageSongSelect.bIsEnumeratingSongs = true; + EnumSongs.Init(); // 取得した曲数を、新インスタンスにも与える + EnumSongs.StartEnumFromDisk(); // 曲検索スレッドの起動_開始 } - break; - } - #endregion - - switch (r現在のステージ.eStageID) { - case CStage.EStage.None: - break; + #endregion - case CStage.EStage.StartUp: - #region [ *** ] - //----------------------------- - if (this.n進行描画の戻り値 != 0) { + #region [ 曲検索の中断と再開 ] + if (r現在のステージ.eStageID == CStage.EStage.SongSelect && !EnumSongs.IsSongListEnumCompletelyDone) { + switch (this.n進行描画の戻り値) { + case 0: // 何もない + EnumSongs.Resume(); + EnumSongs.IsSlowdown = false; + actEnumSongs.Activate(); + if (!ConfigIni.PreAssetsLoading) { + actEnumSongs.CreateManagedResource(); + actEnumSongs.CreateUnmanagedResource(); + } + break; + + case 2: // 曲決定 + EnumSongs.Suspend(); // #27060 バックグラウンドの曲検索を一時停止 + actEnumSongs.DeActivate(); + if (!ConfigIni.PreAssetsLoading) { + actEnumSongs.ReleaseManagedResource(); + actEnumSongs.ReleaseUnmanagedResource(); + } + break; + } + } + #endregion + + #region [ 曲探索中断待ち待機 ] + if (r現在のステージ.eStageID == CStage.EStage.SongLoading && !EnumSongs.IsSongListEnumCompletelyDone && + EnumSongs.thDTXFileEnumerate != null) // #28700 2012.6.12 yyagi; at Compact mode, enumerating thread does not exist. + { + EnumSongs.WaitUntilSuspended(); // 念のため、曲検索が一時中断されるまで待機 + } + #endregion + + #region [ 曲検索が完了したら、実際の曲リストに反映する ] + // CStage選曲.On活性化() に回した方がいいかな? + if (EnumSongs.IsSongListEnumerated) { + actEnumSongs.DeActivate(); + if (!ConfigIni.PreAssetsLoading) { + actEnumSongs.ReleaseManagedResource(); + actEnumSongs.ReleaseUnmanagedResource(); + } + OpenTaiko.stageSongSelect.bIsEnumeratingSongs = false; + + bool bRemakeSongTitleBar = (r現在のステージ.eStageID == CStage.EStage.SongSelect) ? true : false; + OpenTaiko.stageSongSelect.Refresh(EnumSongs.Songs管理, bRemakeSongTitleBar); + EnumSongs.SongListEnumCompletelyDone(); + } + #endregion + } + break; + } + #endregion + + switch (r現在のステージ.eStageID) { + case CStage.EStage.None: + break; + + case CStage.EStage.StartUp: + #region [ *** ] + //----------------------------- + if (this.n進行描画の戻り値 != 0) { + r現在のステージ.DeActivate(); + if (!ConfigIni.PreAssetsLoading) { + r現在のステージ.ReleaseManagedResource(); + r現在のステージ.ReleaseUnmanagedResource(); + } + Trace.TraceInformation("----------------------"); + Trace.TraceInformation("■ Title"); + stageタイトル.Activate(); + if (!ConfigIni.PreAssetsLoading) { + stageタイトル.CreateManagedResource(); + stageタイトル.CreateUnmanagedResource(); + } + r直前のステージ = r現在のステージ; + r現在のステージ = stageタイトル; + + this.tガベージコレクションを実行する(); + } + //----------------------------- + #endregion + break; + + case CStage.EStage.Title: + #region [ *** ] + //----------------------------- + switch (this.n進行描画の戻り値) { + case (int)CStageタイトル.E戻り値.GAMESTART: + #region [ 選曲処理へ ] + //----------------------------- + r現在のステージ.DeActivate(); + if (!ConfigIni.PreAssetsLoading) { + r現在のステージ.ReleaseManagedResource(); + r現在のステージ.ReleaseUnmanagedResource(); + } + Trace.TraceInformation("----------------------"); + Trace.TraceInformation("■ Song Select"); + stageSongSelect.Activate(); + if (!ConfigIni.PreAssetsLoading) { + stageSongSelect.CreateManagedResource(); + stageSongSelect.CreateUnmanagedResource(); + } + r直前のステージ = r現在のステージ; + r現在のステージ = stageSongSelect; + + OpenTaiko.latestSongSelect = stageSongSelect; + //----------------------------- + #endregion + break; + + case (int)CStageタイトル.E戻り値.DANGAMESTART: + #region [ 段位選択処理へ ] + //----------------------------- + r現在のステージ.DeActivate(); + if (!ConfigIni.PreAssetsLoading) { + r現在のステージ.ReleaseManagedResource(); + r現在のステージ.ReleaseUnmanagedResource(); + } + Trace.TraceInformation("----------------------"); + Trace.TraceInformation("■ Dan-i Dojo"); + stage段位選択.Activate(); + if (!ConfigIni.PreAssetsLoading) { + stage段位選択.CreateManagedResource(); + stage段位選択.CreateUnmanagedResource(); + } + r直前のステージ = r現在のステージ; + r現在のステージ = stage段位選択; + OpenTaiko.latestSongSelect = stage段位選択; + //----------------------------- + #endregion + break; + + case (int)CStageタイトル.E戻り値.TAIKOTOWERSSTART: + #region [Online Lounge] + //----------------------------- + r現在のステージ.DeActivate(); + if (!ConfigIni.PreAssetsLoading) { + r現在のステージ.ReleaseManagedResource(); + r現在のステージ.ReleaseUnmanagedResource(); + } + Trace.TraceInformation("----------------------"); + Trace.TraceInformation("■ Online Lounge"); + stageTowerSelect.Activate(); + if (!ConfigIni.PreAssetsLoading) { + stageTowerSelect.CreateManagedResource(); + stageTowerSelect.CreateUnmanagedResource(); + } + r直前のステージ = r現在のステージ; + r現在のステージ = stageTowerSelect; + //----------------------------- + #endregion + break; + + case (int)CStageタイトル.E戻り値.HEYA: + #region [Heya menu] + //----------------------------- + r現在のステージ.DeActivate(); + if (!ConfigIni.PreAssetsLoading) { + r現在のステージ.ReleaseManagedResource(); + r現在のステージ.ReleaseUnmanagedResource(); + } + Trace.TraceInformation("----------------------"); + Trace.TraceInformation("■ Taiko Heya"); + stageHeya.Activate(); + if (!ConfigIni.PreAssetsLoading) { + stageHeya.CreateManagedResource(); + stageHeya.CreateUnmanagedResource(); + } + r直前のステージ = r現在のステージ; + r現在のステージ = stageHeya; + //----------------------------- + #endregion + break; + + case (int)CStageタイトル.E戻り値.ONLINELOUNGE: + #region [Online Lounge] + //----------------------------- + r現在のステージ.DeActivate(); + if (!ConfigIni.PreAssetsLoading) { + r現在のステージ.ReleaseManagedResource(); + r現在のステージ.ReleaseUnmanagedResource(); + } + Trace.TraceInformation("----------------------"); + Trace.TraceInformation("■ Online Lounge"); + stageOnlineLounge.Activate(); + if (!ConfigIni.PreAssetsLoading) { + stageOnlineLounge.CreateManagedResource(); + stageOnlineLounge.CreateUnmanagedResource(); + } + r直前のステージ = r現在のステージ; + r現在のステージ = stageOnlineLounge; + //----------------------------- + #endregion + break; + + case (int)CStageタイトル.E戻り値.CONFIG: + #region [ *** ] + //----------------------------- + r現在のステージ.DeActivate(); + if (!ConfigIni.PreAssetsLoading) { + r現在のステージ.ReleaseManagedResource(); + r現在のステージ.ReleaseUnmanagedResource(); + } + Trace.TraceInformation("----------------------"); + Trace.TraceInformation("■ Config"); + stageコンフィグ.Activate(); + if (!ConfigIni.PreAssetsLoading) { + stageコンフィグ.CreateManagedResource(); + stageコンフィグ.CreateUnmanagedResource(); + } + r直前のステージ = r現在のステージ; + r現在のステージ = stageコンフィグ; + //----------------------------- + #endregion + break; + + case (int)CStageタイトル.E戻り値.EXIT: + #region [ *** ] + //----------------------------- + r現在のステージ.DeActivate(); + if (!ConfigIni.PreAssetsLoading) { + r現在のステージ.ReleaseManagedResource(); + r現在のステージ.ReleaseUnmanagedResource(); + } + Trace.TraceInformation("----------------------"); + Trace.TraceInformation("■ End"); + stage終了.Activate(); + if (!ConfigIni.PreAssetsLoading) { + stage終了.CreateManagedResource(); + stage終了.CreateUnmanagedResource(); + } + r直前のステージ = r現在のステージ; + r現在のステージ = stage終了; + //----------------------------- + #endregion + break; + + case (int)CStageタイトル.E戻り値.AIBATTLEMODE: + #region [ 選曲処理へ ] + //----------------------------- + r現在のステージ.DeActivate(); + if (!ConfigIni.PreAssetsLoading) { + r現在のステージ.ReleaseManagedResource(); + r現在のステージ.ReleaseUnmanagedResource(); + } + Trace.TraceInformation("----------------------"); + Trace.TraceInformation("■ Song Select"); + stageSongSelect.Activate(); + if (!ConfigIni.PreAssetsLoading) { + stageSongSelect.CreateManagedResource(); + stageSongSelect.CreateUnmanagedResource(); + } + r直前のステージ = r現在のステージ; + r現在のステージ = stageSongSelect; + + OpenTaiko.latestSongSelect = stageSongSelect; + ConfigIni.nPreviousPlayerCount = ConfigIni.nPlayerCount; + ConfigIni.nPlayerCount = 2; + ConfigIni.bAIBattleMode = true; + ConfigIni.tInitializeAILevel(); + //----------------------------- + #endregion + break; + + } + + //----------------------------- + #endregion + break; + + case CStage.EStage.Config: + #region [ *** ] + //----------------------------- + if (this.n進行描画の戻り値 != 0) { + switch (r直前のステージ.eStageID) { + case CStage.EStage.Title: + #region [ *** ] + //----------------------------- + r現在のステージ.DeActivate(); + if (!ConfigIni.PreAssetsLoading) { + r現在のステージ.ReleaseManagedResource(); + r現在のステージ.ReleaseUnmanagedResource(); + } + Trace.TraceInformation("----------------------"); + Trace.TraceInformation("■ Title"); + stageタイトル.Activate(); + if (!ConfigIni.PreAssetsLoading) { + stageタイトル.CreateManagedResource(); + stageタイトル.CreateUnmanagedResource(); + } + stageタイトル.tReloadMenus(); + r直前のステージ = r現在のステージ; + r現在のステージ = stageタイトル; + + this.tガベージコレクションを実行する(); + break; + //----------------------------- + #endregion + + case CStage.EStage.SongSelect: + #region [ *** ] + //----------------------------- + r現在のステージ.DeActivate(); + if (!ConfigIni.PreAssetsLoading) { + r現在のステージ.ReleaseManagedResource(); + r現在のステージ.ReleaseUnmanagedResource(); + } + Trace.TraceInformation("----------------------"); + Trace.TraceInformation("■ Song Select"); + stageSongSelect.Activate(); + if (!ConfigIni.PreAssetsLoading) { + stageSongSelect.CreateManagedResource(); + stageSongSelect.CreateUnmanagedResource(); + } + r直前のステージ = r現在のステージ; + r現在のステージ = stageSongSelect; + + this.tガベージコレクションを実行する(); + break; + //----------------------------- + #endregion + } + return; + } + //----------------------------- + #endregion + break; + + case CStage.EStage.SongSelect: + #region [ *** ] + //----------------------------- + switch (this.n進行描画の戻り値) { + case (int)CStage選曲.E戻り値.タイトルに戻る: + #region [ *** ] + //----------------------------- r現在のステージ.DeActivate(); if (!ConfigIni.PreAssetsLoading) { r現在のステージ.ReleaseManagedResource(); @@ -669,709 +943,232 @@ namespace OpenTaiko { r直前のステージ = r現在のステージ; r現在のステージ = stageタイトル; - this.tガベージコレクションを実行する(); - } - //----------------------------- - #endregion - break; + CSongSelectSongManager.stopSong(); + CSongSelectSongManager.enable(); - case CStage.EStage.Title: - #region [ *** ] - //----------------------------- - switch (this.n進行描画の戻り値) { - case (int)CStageタイトル.E戻り値.GAMESTART: - #region [ 選曲処理へ ] - //----------------------------- - r現在のステージ.DeActivate(); - if (!ConfigIni.PreAssetsLoading) { - r現在のステージ.ReleaseManagedResource(); - r現在のステージ.ReleaseUnmanagedResource(); - } - Trace.TraceInformation("----------------------"); - Trace.TraceInformation("■ Song Select"); - stageSongSelect.Activate(); - if (!ConfigIni.PreAssetsLoading) { - stageSongSelect.CreateManagedResource(); - stageSongSelect.CreateUnmanagedResource(); - } - r直前のステージ = r現在のステージ; - r現在のステージ = stageSongSelect; - - OpenTaiko.latestSongSelect = stageSongSelect; - //----------------------------- - #endregion - break; - - case (int)CStageタイトル.E戻り値.DANGAMESTART: - #region [ 段位選択処理へ ] - //----------------------------- - r現在のステージ.DeActivate(); - if (!ConfigIni.PreAssetsLoading) { - r現在のステージ.ReleaseManagedResource(); - r現在のステージ.ReleaseUnmanagedResource(); - } - Trace.TraceInformation("----------------------"); - Trace.TraceInformation("■ Dan-i Dojo"); - stage段位選択.Activate(); - if (!ConfigIni.PreAssetsLoading) { - stage段位選択.CreateManagedResource(); - stage段位選択.CreateUnmanagedResource(); - } - r直前のステージ = r現在のステージ; - r現在のステージ = stage段位選択; - OpenTaiko.latestSongSelect = stage段位選択; - //----------------------------- - #endregion - break; - - case (int)CStageタイトル.E戻り値.TAIKOTOWERSSTART: - #region [Online Lounge] - //----------------------------- - r現在のステージ.DeActivate(); - if (!ConfigIni.PreAssetsLoading) { - r現在のステージ.ReleaseManagedResource(); - r現在のステージ.ReleaseUnmanagedResource(); - } - Trace.TraceInformation("----------------------"); - Trace.TraceInformation("■ Online Lounge"); - stageTowerSelect.Activate(); - if (!ConfigIni.PreAssetsLoading) { - stageTowerSelect.CreateManagedResource(); - stageTowerSelect.CreateUnmanagedResource(); - } - r直前のステージ = r現在のステージ; - r現在のステージ = stageTowerSelect; - //----------------------------- - #endregion - break; - - case (int)CStageタイトル.E戻り値.HEYA: - #region [Heya menu] - //----------------------------- - r現在のステージ.DeActivate(); - if (!ConfigIni.PreAssetsLoading) { - r現在のステージ.ReleaseManagedResource(); - r現在のステージ.ReleaseUnmanagedResource(); - } - Trace.TraceInformation("----------------------"); - Trace.TraceInformation("■ Taiko Heya"); - stageHeya.Activate(); - if (!ConfigIni.PreAssetsLoading) { - stageHeya.CreateManagedResource(); - stageHeya.CreateUnmanagedResource(); - } - r直前のステージ = r現在のステージ; - r現在のステージ = stageHeya; - //----------------------------- - #endregion - break; - - case (int)CStageタイトル.E戻り値.ONLINELOUNGE: - #region [Online Lounge] - //----------------------------- - r現在のステージ.DeActivate(); - if (!ConfigIni.PreAssetsLoading) { - r現在のステージ.ReleaseManagedResource(); - r現在のステージ.ReleaseUnmanagedResource(); - } - Trace.TraceInformation("----------------------"); - Trace.TraceInformation("■ Online Lounge"); - stageOnlineLounge.Activate(); - if (!ConfigIni.PreAssetsLoading) { - stageOnlineLounge.CreateManagedResource(); - stageOnlineLounge.CreateUnmanagedResource(); - } - r直前のステージ = r現在のステージ; - r現在のステージ = stageOnlineLounge; - //----------------------------- - #endregion - break; - - case (int)CStageタイトル.E戻り値.CONFIG: - #region [ *** ] - //----------------------------- - r現在のステージ.DeActivate(); - if (!ConfigIni.PreAssetsLoading) { - r現在のステージ.ReleaseManagedResource(); - r現在のステージ.ReleaseUnmanagedResource(); - } - Trace.TraceInformation("----------------------"); - Trace.TraceInformation("■ Config"); - stageコンフィグ.Activate(); - if (!ConfigIni.PreAssetsLoading) { - stageコンフィグ.CreateManagedResource(); - stageコンフィグ.CreateUnmanagedResource(); - } - r直前のステージ = r現在のステージ; - r現在のステージ = stageコンフィグ; - //----------------------------- - #endregion - break; - - case (int)CStageタイトル.E戻り値.EXIT: - #region [ *** ] - //----------------------------- - r現在のステージ.DeActivate(); - if (!ConfigIni.PreAssetsLoading) { - r現在のステージ.ReleaseManagedResource(); - r現在のステージ.ReleaseUnmanagedResource(); - } - Trace.TraceInformation("----------------------"); - Trace.TraceInformation("■ End"); - stage終了.Activate(); - if (!ConfigIni.PreAssetsLoading) { - stage終了.CreateManagedResource(); - stage終了.CreateUnmanagedResource(); - } - r直前のステージ = r現在のステージ; - r現在のステージ = stage終了; - //----------------------------- - #endregion - break; - - case (int)CStageタイトル.E戻り値.AIBATTLEMODE: - #region [ 選曲処理へ ] - //----------------------------- - r現在のステージ.DeActivate(); - if (!ConfigIni.PreAssetsLoading) { - r現在のステージ.ReleaseManagedResource(); - r現在のステージ.ReleaseUnmanagedResource(); - } - Trace.TraceInformation("----------------------"); - Trace.TraceInformation("■ Song Select"); - stageSongSelect.Activate(); - if (!ConfigIni.PreAssetsLoading) { - stageSongSelect.CreateManagedResource(); - stageSongSelect.CreateUnmanagedResource(); - } - r直前のステージ = r現在のステージ; - r現在のステージ = stageSongSelect; - - OpenTaiko.latestSongSelect = stageSongSelect; - ConfigIni.nPreviousPlayerCount = ConfigIni.nPlayerCount; - ConfigIni.nPlayerCount = 2; - ConfigIni.bAIBattleMode = true; - ConfigIni.tInitializeAILevel(); - //----------------------------- - #endregion - break; - - } - - //----------------------------- - #endregion - break; - - case CStage.EStage.Config: - #region [ *** ] - //----------------------------- - if (this.n進行描画の戻り値 != 0) { - switch (r直前のステージ.eStageID) { - case CStage.EStage.Title: - #region [ *** ] - //----------------------------- - r現在のステージ.DeActivate(); - if (!ConfigIni.PreAssetsLoading) { - r現在のステージ.ReleaseManagedResource(); - r現在のステージ.ReleaseUnmanagedResource(); - } - Trace.TraceInformation("----------------------"); - Trace.TraceInformation("■ Title"); - stageタイトル.Activate(); - if (!ConfigIni.PreAssetsLoading) { - stageタイトル.CreateManagedResource(); - stageタイトル.CreateUnmanagedResource(); - } - stageタイトル.tReloadMenus(); - r直前のステージ = r現在のステージ; - r現在のステージ = stageタイトル; - - this.tガベージコレクションを実行する(); - break; - //----------------------------- - #endregion - - case CStage.EStage.SongSelect: - #region [ *** ] - //----------------------------- - r現在のステージ.DeActivate(); - if (!ConfigIni.PreAssetsLoading) { - r現在のステージ.ReleaseManagedResource(); - r現在のステージ.ReleaseUnmanagedResource(); - } - Trace.TraceInformation("----------------------"); - Trace.TraceInformation("■ Song Select"); - stageSongSelect.Activate(); - if (!ConfigIni.PreAssetsLoading) { - stageSongSelect.CreateManagedResource(); - stageSongSelect.CreateUnmanagedResource(); - } - r直前のステージ = r現在のステージ; - r現在のステージ = stageSongSelect; - - this.tガベージコレクションを実行する(); - break; - //----------------------------- - #endregion + if (ConfigIni.bAIBattleMode == true) { + ConfigIni.nPlayerCount = ConfigIni.nPreviousPlayerCount; + ConfigIni.bAIBattleMode = false; } - return; - } - //----------------------------- + + this.tガベージコレクションを実行する(); + break; + //----------------------------- #endregion - break; - case CStage.EStage.SongSelect: - #region [ *** ] - //----------------------------- - switch (this.n進行描画の戻り値) { - case (int)CStage選曲.E戻り値.タイトルに戻る: - #region [ *** ] - //----------------------------- - r現在のステージ.DeActivate(); - if (!ConfigIni.PreAssetsLoading) { - r現在のステージ.ReleaseManagedResource(); - r現在のステージ.ReleaseUnmanagedResource(); - } - Trace.TraceInformation("----------------------"); - Trace.TraceInformation("■ Title"); - stageタイトル.Activate(); - if (!ConfigIni.PreAssetsLoading) { - stageタイトル.CreateManagedResource(); - stageタイトル.CreateUnmanagedResource(); - } - r直前のステージ = r現在のステージ; - r現在のステージ = stageタイトル; - - CSongSelectSongManager.stopSong(); - CSongSelectSongManager.enable(); - - if (ConfigIni.bAIBattleMode == true) { - ConfigIni.nPlayerCount = ConfigIni.nPreviousPlayerCount; - ConfigIni.bAIBattleMode = false; - } - - this.tガベージコレクションを実行する(); - break; - //----------------------------- - #endregion - - case (int)CStage選曲.E戻り値.選曲した: - #region [ *** ] - //----------------------------- - r現在のステージ.DeActivate(); - if (!ConfigIni.PreAssetsLoading) { - r現在のステージ.ReleaseManagedResource(); - r現在のステージ.ReleaseUnmanagedResource(); - } - Trace.TraceInformation("----------------------"); - Trace.TraceInformation("■ Song Loading"); - stage曲読み込み.Activate(); - if (!ConfigIni.PreAssetsLoading) { - stage曲読み込み.CreateManagedResource(); - stage曲読み込み.CreateUnmanagedResource(); - } - r直前のステージ = r現在のステージ; - r現在のステージ = stage曲読み込み; - - /* - Skin.bgm選曲画面イン.t停止する(); - Skin.bgm選曲画面.t停止する(); - */ - CSongSelectSongManager.stopSong(); - CSongSelectSongManager.enable(); - - this.tガベージコレクションを実行する(); - break; - //----------------------------- - #endregion - - // case (int) CStage選曲.E戻り値.オプション呼び出し: + case (int)CStage選曲.E戻り値.選曲した: #region [ *** ] - // //----------------------------- - // r現在のステージ.On非活性化(); - // Trace.TraceInformation( "----------------------" ); - // Trace.TraceInformation( "■ オプション" ); - // stageオプション.On活性化(); - // r直前のステージ = r現在のステージ; - // r現在のステージ = stageオプション; - // - // foreach( STPlugin pg in this.listプラグイン ) - // { - // Directory.SetCurrentDirectory( pg.strプラグインフォルダ ); - // pg.plugin.Onステージ変更(); - // Directory.SetCurrentDirectory( CDTXMania.strEXEのあるフォルダ ); - // } - // - // this.tガベージコレクションを実行する(); - // break; - // //----------------------------- - #endregion - - case (int)CStage選曲.E戻り値.コンフィグ呼び出し: - #region [ *** ] - //----------------------------- - r現在のステージ.DeActivate(); - if (!ConfigIni.PreAssetsLoading) { - r現在のステージ.ReleaseManagedResource(); - r現在のステージ.ReleaseUnmanagedResource(); - } - Trace.TraceInformation("----------------------"); - Trace.TraceInformation("■ Config"); - stageコンフィグ.Activate(); - if (!ConfigIni.PreAssetsLoading) { - stageコンフィグ.CreateManagedResource(); - stageコンフィグ.CreateUnmanagedResource(); - } - r直前のステージ = r現在のステージ; - r現在のステージ = stageコンフィグ; - - CSongSelectSongManager.stopSong(); - CSongSelectSongManager.enable(); - - this.tガベージコレクションを実行する(); - break; - //----------------------------- - #endregion - - case (int)CStage選曲.E戻り値.スキン変更: - - #region [ *** ] - //----------------------------- - r現在のステージ.DeActivate(); - if (!ConfigIni.PreAssetsLoading) { - r現在のステージ.ReleaseManagedResource(); - r現在のステージ.ReleaseUnmanagedResource(); - } - Trace.TraceInformation("----------------------"); - Trace.TraceInformation("■ Skin Change"); - stageChangeSkin.Activate(); - r直前のステージ = r現在のステージ; - r現在のステージ = stageChangeSkin; - break; - //----------------------------- - #endregion - } - //----------------------------- - #endregion - break; - - case CStage.EStage.DanDojoSelect: - #region [ *** ] - switch (this.n進行描画の戻り値) { - case (int)CStage選曲.E戻り値.タイトルに戻る: - #region [ *** ] - //----------------------------- - r現在のステージ.DeActivate(); - if (!ConfigIni.PreAssetsLoading) { - r現在のステージ.ReleaseManagedResource(); - r現在のステージ.ReleaseUnmanagedResource(); - } - Trace.TraceInformation("----------------------"); - Trace.TraceInformation("■ Title"); - stageタイトル.Activate(); - if (!ConfigIni.PreAssetsLoading) { - stageタイトル.CreateManagedResource(); - stageタイトル.CreateUnmanagedResource(); - } - r直前のステージ = r現在のステージ; - r現在のステージ = stageタイトル; - - /* - Skin.bgm選曲画面イン.t停止する(); - Skin.bgm選曲画面.t停止する(); - */ - CSongSelectSongManager.stopSong(); - CSongSelectSongManager.enable(); - - this.tガベージコレクションを実行する(); - break; - //----------------------------- - #endregion - - case (int)CStage選曲.E戻り値.選曲した: - #region [ *** ] - //----------------------------- - - r現在のステージ.DeActivate(); - if (!ConfigIni.PreAssetsLoading) { - r現在のステージ.ReleaseManagedResource(); - r現在のステージ.ReleaseUnmanagedResource(); - } - Trace.TraceInformation("----------------------"); - Trace.TraceInformation("■ Song Loading"); - stage曲読み込み.Activate(); - if (!ConfigIni.PreAssetsLoading) { - stage曲読み込み.CreateManagedResource(); - stage曲読み込み.CreateUnmanagedResource(); - } - r直前のステージ = r現在のステージ; - r現在のステージ = stage曲読み込み; - - this.tガベージコレクションを実行する(); - break; - //----------------------------- - #endregion - } - #endregion - break; - - case CStage.EStage.Heya: - #region [ *** ] - switch (this.n進行描画の戻り値) { - case (int)CStage選曲.E戻り値.タイトルに戻る: - #region [ *** ] - //----------------------------- - r現在のステージ.DeActivate(); - if (!ConfigIni.PreAssetsLoading) { - r現在のステージ.ReleaseManagedResource(); - r現在のステージ.ReleaseUnmanagedResource(); - } - Trace.TraceInformation("----------------------"); - Trace.TraceInformation("■ Title"); - stageタイトル.Activate(); - if (!ConfigIni.PreAssetsLoading) { - stageタイトル.CreateManagedResource(); - stageタイトル.CreateUnmanagedResource(); - } - r直前のステージ = r現在のステージ; - r現在のステージ = stageタイトル; - - CSongSelectSongManager.stopSong(); - CSongSelectSongManager.enable(); - - this.tガベージコレクションを実行する(); - break; - //----------------------------- - #endregion - } - #endregion - break; - - case CStage.EStage.SongLoading: - #region [ *** ] - //----------------------------- - if (this.n進行描画の戻り値 != 0) { - OpenTaiko.Pad.detectedDevice.Clear(); // 入力デバイスフラグクリア(2010.9.11) - r現在のステージ.DeActivate(); - if (!ConfigIni.PreAssetsLoading) { - r現在のステージ.ReleaseManagedResource(); - r現在のステージ.ReleaseUnmanagedResource(); - } - #region [ ESC押下時は、曲の読み込みを中止して選曲画面に戻る ] - if (this.n進行描画の戻り値 == (int)ESongLoadingScreenReturnValue.LoadCanceled) { - //DTX.t全チップの再生停止(); - if (DTX != null) { - DTX.DeActivate(); - DTX.ReleaseManagedResource(); - DTX.ReleaseUnmanagedResource(); - } - - // ??? - - /* - if (stage選曲.n確定された曲の難易度[0] == (int)Difficulty.Dan) - { - Trace.TraceInformation("----------------------"); - Trace.TraceInformation("■ 段位選択"); - stage段位選択.On活性化(); - r直前のステージ = r現在のステージ; - r現在のステージ = stage段位選択; - } - else - { - Trace.TraceInformation("----------------------"); - Trace.TraceInformation("■ 選曲"); - stage選曲.On活性化(); - r直前のステージ = r現在のステージ; - r現在のステージ = stage選曲; - } - */ - - Trace.TraceInformation("----------------------"); - Trace.TraceInformation("■ Return to song select menu"); - OpenTaiko.latestSongSelect.Activate(); - if (!ConfigIni.PreAssetsLoading) { - OpenTaiko.latestSongSelect.CreateManagedResource(); - OpenTaiko.latestSongSelect.CreateUnmanagedResource(); - } - r直前のステージ = r現在のステージ; - - // Seek latest registered song select screen - r現在のステージ = OpenTaiko.latestSongSelect; - - break; - } - #endregion - - Trace.TraceInformation("----------------------"); - Trace.TraceInformation("■ Gameplay (Drum Screen)"); -#if false // #23625 2011.1.11 Config.iniからダメージ/回復値の定数変更を行う場合はここを有効にする 087リリースに合わせ機能無効化 -for (int i = 0; i < 5; i++) -{ - for (int j = 0; j < 2; j++) - { - stage演奏ドラム画面.fDamageGaugeDelta[i, j] = ConfigIni.fGaugeFactor[i, j]; - } -} -for (int i = 0; i < 3; i++) { - stage演奏ドラム画面.fDamageLevelFactor[i] = ConfigIni.fDamageLevelFactor[i]; -} -#endif - r直前のステージ = r現在のステージ; - r現在のステージ = stage演奏ドラム画面; - - this.tガベージコレクションを実行する(); - } - //----------------------------- - #endregion - break; - - case CStage.EStage.Game: - #region [ *** ] - - switch (this.n進行描画の戻り値) { - case (int)EGameplayScreenReturnValue.ReloadAndReplay: - #region [ DTXファイルを再読み込みして、再演奏 ] - DTX.t全チップの再生停止(); - DTX.DeActivate(); - DTX.ReleaseManagedResource(); - DTX.ReleaseUnmanagedResource(); - r現在のステージ.DeActivate(); - if (!ConfigIni.PreAssetsLoading) { - r現在のステージ.ReleaseManagedResource(); - r現在のステージ.ReleaseUnmanagedResource(); - } - stage曲読み込み.Activate(); - if (!ConfigIni.PreAssetsLoading) { - stage曲読み込み.CreateManagedResource(); - stage曲読み込み.CreateUnmanagedResource(); - } - r直前のステージ = r現在のステージ; - r現在のステージ = stage曲読み込み; - this.tガベージコレクションを実行する(); - break; - #endregion - - //case (int) E演奏画面の戻り値.再演奏: - #region [ 再読み込み無しで、再演奏 ] - #endregion - // break; - - case (int)EGameplayScreenReturnValue.Continue: - break; - - case (int)EGameplayScreenReturnValue.PerformanceInterrupted: - #region [ 演奏キャンセル ] - //----------------------------- - - DTX.t全チップの再生停止(); - DTX.DeActivate(); - DTX.ReleaseManagedResource(); - DTX.ReleaseUnmanagedResource(); - r現在のステージ.DeActivate(); - if (!ConfigIni.PreAssetsLoading) { - r現在のステージ.ReleaseManagedResource(); - r現在のステージ.ReleaseUnmanagedResource(); - } - - Trace.TraceInformation("----------------------"); - Trace.TraceInformation("■ Return to song select menu"); - OpenTaiko.latestSongSelect.Activate(); - if (!ConfigIni.PreAssetsLoading) { - OpenTaiko.latestSongSelect.CreateManagedResource(); - OpenTaiko.latestSongSelect.CreateUnmanagedResource(); - } - r直前のステージ = r現在のステージ; - - // Seek latest registered song select screen - r現在のステージ = OpenTaiko.latestSongSelect; - - this.tガベージコレクションを実行する(); - this.tガベージコレクションを実行する(); - break; - //----------------------------- - #endregion - - case (int)EGameplayScreenReturnValue.StageFailed: - #region [ 演奏失敗(StageFailed) ] - //----------------------------- - - DTX.t全チップの再生停止(); - DTX.DeActivate(); - DTX.ReleaseManagedResource(); - DTX.ReleaseUnmanagedResource(); - r現在のステージ.DeActivate(); - if (!ConfigIni.PreAssetsLoading) { - r現在のステージ.ReleaseManagedResource(); - r現在のステージ.ReleaseUnmanagedResource(); - } - - Trace.TraceInformation("----------------------"); - Trace.TraceInformation("■ Song Select"); - stageSongSelect.Activate(); - if (!ConfigIni.PreAssetsLoading) { - stageSongSelect.CreateManagedResource(); - stageSongSelect.CreateUnmanagedResource(); - } - r直前のステージ = r現在のステージ; - r現在のステージ = stageSongSelect; - - this.tガベージコレクションを実行する(); - break; - //----------------------------- - #endregion - - case (int)EGameplayScreenReturnValue.StageCleared: - #region [ 演奏クリア ] - //----------------------------- - - // Fetch the results of the finished play - CScoreIni.C演奏記録 c演奏記録_Drums; - stage演奏ドラム画面.t演奏結果を格納する(out c演奏記録_Drums); - - r現在のステージ.DeActivate(); - if (!ConfigIni.PreAssetsLoading) { - r現在のステージ.ReleaseManagedResource(); - r現在のステージ.ReleaseUnmanagedResource(); - } - Trace.TraceInformation("----------------------"); - Trace.TraceInformation("■ Results"); - stage結果.st演奏記録.Drums = c演奏記録_Drums; - stage結果.Activate(); - if (!ConfigIni.PreAssetsLoading) { - stage結果.CreateManagedResource(); - stage結果.CreateUnmanagedResource(); - } - r直前のステージ = r現在のステージ; - r現在のステージ = stage結果; - - break; - //----------------------------- - #endregion - } - //----------------------------- - #endregion - break; - - case CStage.EStage.Results: - #region [ *** ] - //----------------------------- - if (this.n進行描画の戻り値 != 0) { - //DTX.t全チップの再生一時停止(); - DTX.t全チップの再生停止とミキサーからの削除(); - DTX.DeActivate(); - DTX.ReleaseManagedResource(); - DTX.ReleaseUnmanagedResource(); + //----------------------------- r現在のステージ.DeActivate(); if (!ConfigIni.PreAssetsLoading) { r現在のステージ.ReleaseManagedResource(); r現在のステージ.ReleaseUnmanagedResource(); } - this.tガベージコレクションを実行する(); - - - // After result screen - + Trace.TraceInformation("----------------------"); + Trace.TraceInformation("■ Song Loading"); + stage曲読み込み.Activate(); + if (!ConfigIni.PreAssetsLoading) { + stage曲読み込み.CreateManagedResource(); + stage曲読み込み.CreateUnmanagedResource(); + } + r直前のステージ = r現在のステージ; + r現在のステージ = stage曲読み込み; + + /* + Skin.bgm選曲画面イン.t停止する(); + Skin.bgm選曲画面.t停止する(); + */ + CSongSelectSongManager.stopSong(); + CSongSelectSongManager.enable(); + + this.tガベージコレクションを実行する(); + break; + //----------------------------- + #endregion + + // case (int) CStage選曲.E戻り値.オプション呼び出し: + #region [ *** ] + // //----------------------------- + // r現在のステージ.On非活性化(); + // Trace.TraceInformation( "----------------------" ); + // Trace.TraceInformation( "■ オプション" ); + // stageオプション.On活性化(); + // r直前のステージ = r現在のステージ; + // r現在のステージ = stageオプション; + // + // foreach( STPlugin pg in this.listプラグイン ) + // { + // Directory.SetCurrentDirectory( pg.strプラグインフォルダ ); + // pg.plugin.Onステージ変更(); + // Directory.SetCurrentDirectory( CDTXMania.strEXEのあるフォルダ ); + // } + // + // this.tガベージコレクションを実行する(); + // break; + // //----------------------------- + #endregion + + case (int)CStage選曲.E戻り値.コンフィグ呼び出し: + #region [ *** ] + //----------------------------- + r現在のステージ.DeActivate(); + if (!ConfigIni.PreAssetsLoading) { + r現在のステージ.ReleaseManagedResource(); + r現在のステージ.ReleaseUnmanagedResource(); + } + Trace.TraceInformation("----------------------"); + Trace.TraceInformation("■ Config"); + stageコンフィグ.Activate(); + if (!ConfigIni.PreAssetsLoading) { + stageコンフィグ.CreateManagedResource(); + stageコンフィグ.CreateUnmanagedResource(); + } + r直前のステージ = r現在のステージ; + r現在のステージ = stageコンフィグ; + + CSongSelectSongManager.stopSong(); + CSongSelectSongManager.enable(); + + this.tガベージコレクションを実行する(); + break; + //----------------------------- + #endregion + + case (int)CStage選曲.E戻り値.スキン変更: + + #region [ *** ] + //----------------------------- + r現在のステージ.DeActivate(); + if (!ConfigIni.PreAssetsLoading) { + r現在のステージ.ReleaseManagedResource(); + r現在のステージ.ReleaseUnmanagedResource(); + } + Trace.TraceInformation("----------------------"); + Trace.TraceInformation("■ Skin Change"); + stageChangeSkin.Activate(); + r直前のステージ = r現在のステージ; + r現在のステージ = stageChangeSkin; + break; + //----------------------------- + #endregion + } + //----------------------------- + #endregion + break; + + case CStage.EStage.DanDojoSelect: + #region [ *** ] + switch (this.n進行描画の戻り値) { + case (int)CStage選曲.E戻り値.タイトルに戻る: + #region [ *** ] + //----------------------------- + r現在のステージ.DeActivate(); + if (!ConfigIni.PreAssetsLoading) { + r現在のステージ.ReleaseManagedResource(); + r現在のステージ.ReleaseUnmanagedResource(); + } + Trace.TraceInformation("----------------------"); + Trace.TraceInformation("■ Title"); + stageタイトル.Activate(); + if (!ConfigIni.PreAssetsLoading) { + stageタイトル.CreateManagedResource(); + stageタイトル.CreateUnmanagedResource(); + } + r直前のステージ = r現在のステージ; + r現在のステージ = stageタイトル; + + /* + Skin.bgm選曲画面イン.t停止する(); + Skin.bgm選曲画面.t停止する(); + */ + CSongSelectSongManager.stopSong(); + CSongSelectSongManager.enable(); + + this.tガベージコレクションを実行する(); + break; + //----------------------------- + #endregion + + case (int)CStage選曲.E戻り値.選曲した: + #region [ *** ] + //----------------------------- + + r現在のステージ.DeActivate(); + if (!ConfigIni.PreAssetsLoading) { + r現在のステージ.ReleaseManagedResource(); + r現在のステージ.ReleaseUnmanagedResource(); + } + Trace.TraceInformation("----------------------"); + Trace.TraceInformation("■ Song Loading"); + stage曲読み込み.Activate(); + if (!ConfigIni.PreAssetsLoading) { + stage曲読み込み.CreateManagedResource(); + stage曲読み込み.CreateUnmanagedResource(); + } + r直前のステージ = r現在のステージ; + r現在のステージ = stage曲読み込み; + + this.tガベージコレクションを実行する(); + break; + //----------------------------- + #endregion + } + #endregion + break; + + case CStage.EStage.Heya: + #region [ *** ] + switch (this.n進行描画の戻り値) { + case (int)CStage選曲.E戻り値.タイトルに戻る: + #region [ *** ] + //----------------------------- + r現在のステージ.DeActivate(); + if (!ConfigIni.PreAssetsLoading) { + r現在のステージ.ReleaseManagedResource(); + r現在のステージ.ReleaseUnmanagedResource(); + } + Trace.TraceInformation("----------------------"); + Trace.TraceInformation("■ Title"); + stageタイトル.Activate(); + if (!ConfigIni.PreAssetsLoading) { + stageタイトル.CreateManagedResource(); + stageタイトル.CreateUnmanagedResource(); + } + r直前のステージ = r現在のステージ; + r現在のステージ = stageタイトル; + + CSongSelectSongManager.stopSong(); + CSongSelectSongManager.enable(); + + this.tガベージコレクションを実行する(); + break; + //----------------------------- + #endregion + } + #endregion + break; + + case CStage.EStage.SongLoading: + #region [ *** ] + //----------------------------- + if (this.n進行描画の戻り値 != 0) { + OpenTaiko.Pad.detectedDevice.Clear(); // 入力デバイスフラグクリア(2010.9.11) + r現在のステージ.DeActivate(); + if (!ConfigIni.PreAssetsLoading) { + r現在のステージ.ReleaseManagedResource(); + r現在のステージ.ReleaseUnmanagedResource(); + } + #region [ ESC押下時は、曲の読み込みを中止して選曲画面に戻る ] + if (this.n進行描画の戻り値 == (int)ESongLoadingScreenReturnValue.LoadCanceled) { + //DTX.t全チップの再生停止(); + if (DTX != null) { + DTX.DeActivate(); + DTX.ReleaseManagedResource(); + DTX.ReleaseUnmanagedResource(); + } + + // ??? + /* if (stage選曲.n確定された曲の難易度[0] == (int)Difficulty.Dan) { @@ -1389,8 +1186,8 @@ for (int i = 0; i < 3; i++) { r直前のステージ = r現在のステージ; r現在のステージ = stage選曲; } - */ - + */ + Trace.TraceInformation("----------------------"); Trace.TraceInformation("■ Return to song select menu"); OpenTaiko.latestSongSelect.Activate(); @@ -1398,85 +1195,118 @@ for (int i = 0; i < 3; i++) { OpenTaiko.latestSongSelect.CreateManagedResource(); OpenTaiko.latestSongSelect.CreateUnmanagedResource(); } - r直前のステージ = r現在のステージ; - - // Seek latest registered song select screen + r直前のステージ = r現在のステージ; + + // Seek latest registered song select screen r現在のステージ = OpenTaiko.latestSongSelect; - stageSongSelect.NowSong++; - - this.tガベージコレクションを実行する(); - } - //----------------------------- + break; + } #endregion - break; + Trace.TraceInformation("----------------------"); + Trace.TraceInformation("■ Gameplay (Drum Screen)"); +#if false // #23625 2011.1.11 Config.iniからダメージ/回復値の定数変更を行う場合はここを有効にする 087リリースに合わせ機能無効化 +for (int i = 0; i < 5; i++) +{ + for (int j = 0; j < 2; j++) + { + stage演奏ドラム画面.fDamageGaugeDelta[i, j] = ConfigIni.fGaugeFactor[i, j]; + } +} +for (int i = 0; i < 3; i++) { + stage演奏ドラム画面.fDamageLevelFactor[i] = ConfigIni.fDamageLevelFactor[i]; +} +#endif + r直前のステージ = r現在のステージ; + r現在のステージ = stage演奏ドラム画面; - case CStage.EStage.TaikoTowers: - #region [ *** ] - switch (this.n進行描画の戻り値) { - case (int)EReturnValue.ReturnToTitle: - #region [ *** ] - //----------------------------- - r現在のステージ.DeActivate(); - if (!ConfigIni.PreAssetsLoading) { - r現在のステージ.ReleaseManagedResource(); - r現在のステージ.ReleaseUnmanagedResource(); - } - Trace.TraceInformation("----------------------"); - Trace.TraceInformation("■ Title"); - stageタイトル.Activate(); - r直前のステージ = r現在のステージ; - r現在のステージ = stageタイトル; - - /* - Skin.bgm選曲画面イン.t停止する(); - Skin.bgm選曲画面.t停止する(); - */ - CSongSelectSongManager.stopSong(); - CSongSelectSongManager.enable(); + this.tガベージコレクションを実行する(); + } + //----------------------------- + #endregion + break; - this.tガベージコレクションを実行する(); - break; - //----------------------------- - #endregion - - case (int)EReturnValue.SongChoosen: - #region [ *** ] - //----------------------------- - latestSongSelect = stageTowerSelect; - r現在のステージ.DeActivate(); - if (!ConfigIni.PreAssetsLoading) { - r現在のステージ.ReleaseManagedResource(); - r現在のステージ.ReleaseUnmanagedResource(); - } - Trace.TraceInformation("----------------------"); - Trace.TraceInformation("■ Song Loading"); - stage曲読み込み.Activate(); - if (!ConfigIni.PreAssetsLoading) { - stage曲読み込み.CreateManagedResource(); - stage曲読み込み.CreateUnmanagedResource(); - } - r直前のステージ = r現在のステージ; - r現在のステージ = stage曲読み込み; + case CStage.EStage.Game: + #region [ *** ] - this.tガベージコレクションを実行する(); - break; - //----------------------------- - #endregion - } - #endregion - break; - - case CStage.EStage.ChangeSkin: - #region [ *** ] - //----------------------------- - if (this.n進行描画の戻り値 != 0) { + switch (this.n進行描画の戻り値) { + case (int)EGameplayScreenReturnValue.ReloadAndReplay: + #region [ DTXファイルを再読み込みして、再演奏 ] + DTX.t全チップの再生停止(); + DTX.DeActivate(); + DTX.ReleaseManagedResource(); + DTX.ReleaseUnmanagedResource(); r現在のステージ.DeActivate(); if (!ConfigIni.PreAssetsLoading) { r現在のステージ.ReleaseManagedResource(); r現在のステージ.ReleaseUnmanagedResource(); } + stage曲読み込み.Activate(); + if (!ConfigIni.PreAssetsLoading) { + stage曲読み込み.CreateManagedResource(); + stage曲読み込み.CreateUnmanagedResource(); + } + r直前のステージ = r現在のステージ; + r現在のステージ = stage曲読み込み; + this.tガベージコレクションを実行する(); + break; + #endregion + + //case (int) E演奏画面の戻り値.再演奏: + #region [ 再読み込み無しで、再演奏 ] + #endregion + // break; + + case (int)EGameplayScreenReturnValue.Continue: + break; + + case (int)EGameplayScreenReturnValue.PerformanceInterrupted: + #region [ 演奏キャンセル ] + //----------------------------- + + DTX.t全チップの再生停止(); + DTX.DeActivate(); + DTX.ReleaseManagedResource(); + DTX.ReleaseUnmanagedResource(); + r現在のステージ.DeActivate(); + if (!ConfigIni.PreAssetsLoading) { + r現在のステージ.ReleaseManagedResource(); + r現在のステージ.ReleaseUnmanagedResource(); + } + + Trace.TraceInformation("----------------------"); + Trace.TraceInformation("■ Return to song select menu"); + OpenTaiko.latestSongSelect.Activate(); + if (!ConfigIni.PreAssetsLoading) { + OpenTaiko.latestSongSelect.CreateManagedResource(); + OpenTaiko.latestSongSelect.CreateUnmanagedResource(); + } + r直前のステージ = r現在のステージ; + + // Seek latest registered song select screen + r現在のステージ = OpenTaiko.latestSongSelect; + + this.tガベージコレクションを実行する(); + this.tガベージコレクションを実行する(); + break; + //----------------------------- + #endregion + + case (int)EGameplayScreenReturnValue.StageFailed: + #region [ 演奏失敗(StageFailed) ] + //----------------------------- + + DTX.t全チップの再生停止(); + DTX.DeActivate(); + DTX.ReleaseManagedResource(); + DTX.ReleaseUnmanagedResource(); + r現在のステージ.DeActivate(); + if (!ConfigIni.PreAssetsLoading) { + r現在のステージ.ReleaseManagedResource(); + r現在のステージ.ReleaseUnmanagedResource(); + } + Trace.TraceInformation("----------------------"); Trace.TraceInformation("■ Song Select"); stageSongSelect.Activate(); @@ -1486,153 +1316,324 @@ for (int i = 0; i < 3; i++) { } r直前のステージ = r現在のステージ; r現在のステージ = stageSongSelect; + this.tガベージコレクションを実行する(); - } - //----------------------------- + break; + //----------------------------- #endregion - break; - case CStage.EStage.End: - #region [ *** ] - //----------------------------- - if (this.n進行描画の戻り値 != 0) { - base.Exit(); - return; - } - //----------------------------- - #endregion - break; + case (int)EGameplayScreenReturnValue.StageCleared: + #region [ 演奏クリア ] + //----------------------------- - default: - #region [ *** ] - switch (this.n進行描画の戻り値) { - case (int)CStage選曲.E戻り値.タイトルに戻る: - #region [ *** ] - //----------------------------- - r現在のステージ.DeActivate(); - if (!ConfigIni.PreAssetsLoading) { - r現在のステージ.ReleaseManagedResource(); - r現在のステージ.ReleaseUnmanagedResource(); - } - Trace.TraceInformation("----------------------"); - Trace.TraceInformation("■ Title"); - stageタイトル.Activate(); - if (!ConfigIni.PreAssetsLoading) { - stageタイトル.CreateManagedResource(); - stageタイトル.CreateUnmanagedResource(); - } - r直前のステージ = r現在のステージ; - r現在のステージ = stageタイトル; + // Fetch the results of the finished play + CScoreIni.C演奏記録 c演奏記録_Drums; + stage演奏ドラム画面.t演奏結果を格納する(out c演奏記録_Drums); - CSongSelectSongManager.stopSong(); - CSongSelectSongManager.enable(); + r現在のステージ.DeActivate(); + if (!ConfigIni.PreAssetsLoading) { + r現在のステージ.ReleaseManagedResource(); + r現在のステージ.ReleaseUnmanagedResource(); + } + Trace.TraceInformation("----------------------"); + Trace.TraceInformation("■ Results"); + stage結果.st演奏記録.Drums = c演奏記録_Drums; + stage結果.Activate(); + if (!ConfigIni.PreAssetsLoading) { + stage結果.CreateManagedResource(); + stage結果.CreateUnmanagedResource(); + } + r直前のステージ = r現在のステージ; + r現在のステージ = stage結果; - this.tガベージコレクションを実行する(); - break; - //----------------------------- - #endregion - } - #endregion - break; - } - - actScanningLoudness?.Draw(); - - if (!ConfigIni.bTokkunMode) { - float screen_ratiox = OpenTaiko.Skin.Resolution[0] / 1280.0f; - float screen_ratioy = OpenTaiko.Skin.Resolution[1] / 720.0f; - - Camera *= Matrix4X4.CreateScale(fCamXScale, fCamYScale, 1f); - - Camera *= Matrix4X4.CreateScale(1.0f / ScreenAspect, 1.0f, 1.0f) * - Matrix4X4.CreateRotationZ(CConversion.DegreeToRadian(fCamRotation)) * - Matrix4X4.CreateScale(1.0f * ScreenAspect, 1.0f, 1.0f); - - Camera *= Matrix4X4.CreateTranslation(fCamXOffset / 1280, fCamYOffset / 720, 1f); - - if (OpenTaiko.DTX != null) { - //object rendering - foreach (KeyValuePair pair in OpenTaiko.DTX.listObj) { - pair.Value.tDraw(); - } + break; + //----------------------------- + #endregion } + //----------------------------- + #endregion + break; - Camera = Matrix4X4.Identity; - } - - if (r現在のステージ != null && r現在のステージ.eStageID != CStage.EStage.StartUp && OpenTaiko.Tx.Network_Connection != null) { - if (Math.Abs(SoundManager.PlayTimer.SystemTimeMs - this.前回のシステム時刻ms) > 10000) { - this.前回のシステム時刻ms = SoundManager.PlayTimer.SystemTimeMs; - Task.Factory.StartNew(() => { - //IPv4 8.8.8.8にPingを送信する(timeout 5000ms) - PingReply reply = new Ping().Send("8.8.8.8", 5000); - this.bネットワークに接続中 = reply.Status == IPStatus.Success; - }); - } - OpenTaiko.Tx.Network_Connection.t2D描画(GameWindowSize.Width - (OpenTaiko.Tx.Network_Connection.szTextureSize.Width / 2), GameWindowSize.Height - OpenTaiko.Tx.Network_Connection.szTextureSize.Height, new Rectangle((OpenTaiko.Tx.Network_Connection.szTextureSize.Width / 2) * (this.bネットワークに接続中 ? 0 : 1), 0, OpenTaiko.Tx.Network_Connection.szTextureSize.Width / 2, OpenTaiko.Tx.Network_Connection.szTextureSize.Height)); - } - // オーバレイを描画する(テクスチャの生成されていない起動ステージは例外 - - // Display log cards - VisualLogManager.Display(); - - if (r現在のステージ != null && r現在のステージ.eStageID != CStage.EStage.StartUp && OpenTaiko.Tx.Overlay != null) { - OpenTaiko.Tx.Overlay.t2D描画(0, 0); - } - } - - if (OpenTaiko.ConfigIni.KeyAssign.KeyIsPressed(OpenTaiko.ConfigIni.KeyAssign.System.Capture)) { -#if DEBUG - if (OpenTaiko.InputManager.Keyboard.KeyPressing((int)SlimDXKeys.Key.LeftControl)) { - if (r現在のステージ.eStageID != CStage.EStage.Game) { - RefreshSkin(); + case CStage.EStage.Results: + #region [ *** ] + //----------------------------- + if (this.n進行描画の戻り値 != 0) { + //DTX.t全チップの再生一時停止(); + DTX.t全チップの再生停止とミキサーからの削除(); + DTX.DeActivate(); + DTX.ReleaseManagedResource(); + DTX.ReleaseUnmanagedResource(); r現在のステージ.DeActivate(); if (!ConfigIni.PreAssetsLoading) { r現在のステージ.ReleaseManagedResource(); r現在のステージ.ReleaseUnmanagedResource(); } - r現在のステージ.Activate(); - if (!ConfigIni.PreAssetsLoading) { - r現在のステージ.CreateManagedResource(); - r現在のステージ.CreateUnmanagedResource(); + this.tガベージコレクションを実行する(); + + + // After result screen + + /* + if (stage選曲.n確定された曲の難易度[0] == (int)Difficulty.Dan) + { + Trace.TraceInformation("----------------------"); + Trace.TraceInformation("■ 段位選択"); + stage段位選択.On活性化(); + r直前のステージ = r現在のステージ; + r現在のステージ = stage段位選択; } + else + { + Trace.TraceInformation("----------------------"); + Trace.TraceInformation("■ 選曲"); + stage選曲.On活性化(); + r直前のステージ = r現在のステージ; + r現在のステージ = stage選曲; + } + */ + + Trace.TraceInformation("----------------------"); + Trace.TraceInformation("■ Return to song select menu"); + OpenTaiko.latestSongSelect.Activate(); + if (!ConfigIni.PreAssetsLoading) { + OpenTaiko.latestSongSelect.CreateManagedResource(); + OpenTaiko.latestSongSelect.CreateUnmanagedResource(); + } + r直前のステージ = r現在のステージ; + + // Seek latest registered song select screen + r現在のステージ = OpenTaiko.latestSongSelect; + + stageSongSelect.NowSong++; + + this.tガベージコレクションを実行する(); } - } else { - // Debug.WriteLine( "capture: " + string.Format( "{0:2x}", (int) e.KeyCode ) + " " + (int) e.KeyCode ); - string strFullPath = - Path.Combine(OpenTaiko.strEXEのあるフォルダ, "Capture_img"); - strFullPath = Path.Combine(strFullPath, DateTime.Now.ToString("yyyyMMddHHmmss") + ".png"); - SaveResultScreen(strFullPath); - } + //----------------------------- + #endregion + break; + + + case CStage.EStage.TaikoTowers: + #region [ *** ] + switch (this.n進行描画の戻り値) { + case (int)EReturnValue.ReturnToTitle: + #region [ *** ] + //----------------------------- + r現在のステージ.DeActivate(); + if (!ConfigIni.PreAssetsLoading) { + r現在のステージ.ReleaseManagedResource(); + r現在のステージ.ReleaseUnmanagedResource(); + } + Trace.TraceInformation("----------------------"); + Trace.TraceInformation("■ Title"); + stageタイトル.Activate(); + r直前のステージ = r現在のステージ; + r現在のステージ = stageタイトル; + + /* + Skin.bgm選曲画面イン.t停止する(); + Skin.bgm選曲画面.t停止する(); + */ + CSongSelectSongManager.stopSong(); + CSongSelectSongManager.enable(); + + this.tガベージコレクションを実行する(); + break; + //----------------------------- + #endregion + + case (int)EReturnValue.SongChoosen: + #region [ *** ] + //----------------------------- + latestSongSelect = stageTowerSelect; + r現在のステージ.DeActivate(); + if (!ConfigIni.PreAssetsLoading) { + r現在のステージ.ReleaseManagedResource(); + r現在のステージ.ReleaseUnmanagedResource(); + } + Trace.TraceInformation("----------------------"); + Trace.TraceInformation("■ Song Loading"); + stage曲読み込み.Activate(); + if (!ConfigIni.PreAssetsLoading) { + stage曲読み込み.CreateManagedResource(); + stage曲読み込み.CreateUnmanagedResource(); + } + r直前のステージ = r現在のステージ; + r現在のステージ = stage曲読み込み; + + this.tガベージコレクションを実行する(); + break; + //----------------------------- + #endregion + } + #endregion + break; + + case CStage.EStage.ChangeSkin: + #region [ *** ] + //----------------------------- + if (this.n進行描画の戻り値 != 0) { + r現在のステージ.DeActivate(); + if (!ConfigIni.PreAssetsLoading) { + r現在のステージ.ReleaseManagedResource(); + r現在のステージ.ReleaseUnmanagedResource(); + } + Trace.TraceInformation("----------------------"); + Trace.TraceInformation("■ Song Select"); + stageSongSelect.Activate(); + if (!ConfigIni.PreAssetsLoading) { + stageSongSelect.CreateManagedResource(); + stageSongSelect.CreateUnmanagedResource(); + } + r直前のステージ = r現在のステージ; + r現在のステージ = stageSongSelect; + this.tガベージコレクションを実行する(); + } + //----------------------------- + #endregion + break; + + case CStage.EStage.End: + #region [ *** ] + //----------------------------- + if (this.n進行描画の戻り値 != 0) { + base.Exit(); + return; + } + //----------------------------- + #endregion + break; + + default: + #region [ *** ] + switch (this.n進行描画の戻り値) { + case (int)CStage選曲.E戻り値.タイトルに戻る: + #region [ *** ] + //----------------------------- + r現在のステージ.DeActivate(); + if (!ConfigIni.PreAssetsLoading) { + r現在のステージ.ReleaseManagedResource(); + r現在のステージ.ReleaseUnmanagedResource(); + } + Trace.TraceInformation("----------------------"); + Trace.TraceInformation("■ Title"); + stageタイトル.Activate(); + if (!ConfigIni.PreAssetsLoading) { + stageタイトル.CreateManagedResource(); + stageタイトル.CreateUnmanagedResource(); + } + r直前のステージ = r現在のステージ; + r現在のステージ = stageタイトル; + + CSongSelectSongManager.stopSong(); + CSongSelectSongManager.enable(); + + this.tガベージコレクションを実行する(); + break; + //----------------------------- + #endregion + } + #endregion + break; + } + + actScanningLoudness?.Draw(); + + if (!ConfigIni.bTokkunMode) { + float screen_ratiox = OpenTaiko.Skin.Resolution[0] / 1280.0f; + float screen_ratioy = OpenTaiko.Skin.Resolution[1] / 720.0f; + + Camera *= Matrix4X4.CreateScale(fCamXScale, fCamYScale, 1f); + + Camera *= Matrix4X4.CreateScale(1.0f / ScreenAspect, 1.0f, 1.0f) * + Matrix4X4.CreateRotationZ(CConversion.DegreeToRadian(fCamRotation)) * + Matrix4X4.CreateScale(1.0f * ScreenAspect, 1.0f, 1.0f); + + Camera *= Matrix4X4.CreateTranslation(fCamXOffset / 1280, fCamYOffset / 720, 1f); + + if (OpenTaiko.DTX != null) { + //object rendering + foreach (KeyValuePair pair in OpenTaiko.DTX.listObj) { + pair.Value.tDraw(); + } + } + + Camera = Matrix4X4.Identity; + } + + if (r現在のステージ != null && r現在のステージ.eStageID != CStage.EStage.StartUp && OpenTaiko.Tx.Network_Connection != null) { + if (Math.Abs(SoundManager.PlayTimer.SystemTimeMs - this.前回のシステム時刻ms) > 10000) { + this.前回のシステム時刻ms = SoundManager.PlayTimer.SystemTimeMs; + Task.Factory.StartNew(() => { + //IPv4 8.8.8.8にPingを送信する(timeout 5000ms) + PingReply reply = new Ping().Send("8.8.8.8", 5000); + this.bネットワークに接続中 = reply.Status == IPStatus.Success; + }); + } + OpenTaiko.Tx.Network_Connection.t2D描画(GameWindowSize.Width - (OpenTaiko.Tx.Network_Connection.szTextureSize.Width / 2), GameWindowSize.Height - OpenTaiko.Tx.Network_Connection.szTextureSize.Height, new Rectangle((OpenTaiko.Tx.Network_Connection.szTextureSize.Width / 2) * (this.bネットワークに接続中 ? 0 : 1), 0, OpenTaiko.Tx.Network_Connection.szTextureSize.Width / 2, OpenTaiko.Tx.Network_Connection.szTextureSize.Height)); + } + // オーバレイを描画する(テクスチャの生成されていない起動ステージは例外 + + // Display log cards + VisualLogManager.Display(); + + if (r現在のステージ != null && r現在のステージ.eStageID != CStage.EStage.StartUp && OpenTaiko.Tx.Overlay != null) { + OpenTaiko.Tx.Overlay.t2D描画(0, 0); + } + } + + if (OpenTaiko.ConfigIni.KeyAssign.KeyIsPressed(OpenTaiko.ConfigIni.KeyAssign.System.Capture)) { +#if DEBUG + if (OpenTaiko.InputManager.Keyboard.KeyPressing((int)SlimDXKeys.Key.LeftControl)) { + if (r現在のステージ.eStageID != CStage.EStage.Game) { + RefreshSkin(); + r現在のステージ.DeActivate(); + if (!ConfigIni.PreAssetsLoading) { + r現在のステージ.ReleaseManagedResource(); + r現在のステージ.ReleaseUnmanagedResource(); + } + r現在のステージ.Activate(); + if (!ConfigIni.PreAssetsLoading) { + r現在のステージ.CreateManagedResource(); + r現在のステージ.CreateUnmanagedResource(); + } + } + } else { + // Debug.WriteLine( "capture: " + string.Format( "{0:2x}", (int) e.KeyCode ) + " " + (int) e.KeyCode ); + string strFullPath = + Path.Combine(OpenTaiko.strEXEのあるフォルダ, "Capture_img"); + strFullPath = Path.Combine(strFullPath, DateTime.Now.ToString("yyyyMMddHHmmss") + ".png"); + SaveResultScreen(strFullPath); + } #else string strFullPath = Path.Combine(OpenTaiko.strEXEのあるフォルダ, "Capture_img"); strFullPath = Path.Combine(strFullPath, DateTime.Now.ToString("yyyyMMddHHmmss") + ".png"); SaveResultScreen(strFullPath); #endif - } - - #region [ 全画面_ウインドウ切り替え ] - if (this.b次のタイミングで全画面_ウィンドウ切り替えを行う) { - ConfigIni.bFullScreen = !ConfigIni.bFullScreen; - app.ToggleWindowMode(); - this.b次のタイミングで全画面_ウィンドウ切り替えを行う = false; - } - #endregion - #region [ 垂直基線同期切り替え ] - if (this.b次のタイミングで垂直帰線同期切り替えを行う) { - VSync = ConfigIni.bEnableVSync; - this.b次のタイミングで垂直帰線同期切り替えを行う = false; - } - #endregion - + } + + #region [ 全画面_ウインドウ切り替え ] + if (this.b次のタイミングで全画面_ウィンドウ切り替えを行う) { + ConfigIni.bFullScreen = !ConfigIni.bFullScreen; + app.ToggleWindowMode(); + this.b次のタイミングで全画面_ウィンドウ切り替えを行う = false; + } + #endregion + #region [ 垂直基線同期切り替え ] + if (this.b次のタイミングで垂直帰線同期切り替えを行う) { + VSync = ConfigIni.bEnableVSync; + this.b次のタイミングで垂直帰線同期切り替えを行う = false; + } + #endregion + #if DEBUG - if (OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.F11)) - OpenTaiko.ConfigIni.DEBUG_bShowImgui = !OpenTaiko.ConfigIni.DEBUG_bShowImgui; - if (OpenTaiko.ConfigIni.DEBUG_bShowImgui) - ImGuiDebugWindow.Draw(); + if (OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.F11)) + OpenTaiko.ConfigIni.DEBUG_bShowImgui = !OpenTaiko.ConfigIni.DEBUG_bShowImgui; + if (OpenTaiko.ConfigIni.DEBUG_bShowImgui) + ImGuiDebugWindow.Draw(); #endif - } + } #if !DEBUG catch( Exception e ) { @@ -1644,254 +1645,254 @@ for (int i = 0; i < 3; i++) { throw e; } #endif - } - - // その他 - - #region [ 汎用ヘルパー ] - //----------------- - public static CTexture tテクスチャの生成(string fileName) { - return tテクスチャの生成(fileName, false); + } + + // その他 + + #region [ 汎用ヘルパー ] + //----------------- + public static CTexture tテクスチャの生成(string fileName) { + return tテクスチャの生成(fileName, false); + } + public static CTexture tテクスチャの生成(string fileName, bool b黒を透過する) { + if (app == null) { + return null; } - public static CTexture tテクスチャの生成(string fileName, bool b黒を透過する) { - if (app == null) { - return null; - } - try { - return new CTexture(fileName, b黒を透過する); - } catch (CTextureCreateFailedException e) { - Trace.TraceError(e.ToString()); - Trace.TraceError("Texture generation has failed. ({0})", fileName); - return null; - } catch (FileNotFoundException) { - Trace.TraceWarning("Could not find specified texture file. ({0})", fileName); - return null; - } + try { + return new CTexture(fileName, b黒を透過する); + } catch (CTextureCreateFailedException e) { + Trace.TraceError(e.ToString()); + Trace.TraceError("Texture generation has failed. ({0})", fileName); + return null; + } catch (FileNotFoundException) { + Trace.TraceWarning("Could not find specified texture file. ({0})", fileName); + return null; } - public static void tテクスチャの解放(ref CTexture tx) { - OpenTaiko.tDisposeSafely(ref tx); + } + public static void tテクスチャの解放(ref CTexture tx) { + OpenTaiko.tDisposeSafely(ref tx); + } + public static void tテクスチャの解放(ref CTextureAf tx) { + OpenTaiko.tDisposeSafely(ref tx); + } + public static CTexture tテクスチャの生成(SKBitmap bitmap) { + return tテクスチャの生成(bitmap, false); + } + public static CTexture tテクスチャの生成(SKBitmap bitmap, bool b黒を透過する) { + if (app == null) { + return null; } - public static void tテクスチャの解放(ref CTextureAf tx) { - OpenTaiko.tDisposeSafely(ref tx); + if (bitmap == null) { + Trace.TraceError("Texture generation has failed. (bitmap==null)"); + return null; } - public static CTexture tテクスチャの生成(SKBitmap bitmap) { - return tテクスチャの生成(bitmap, false); + try { + return new CTexture(bitmap, b黒を透過する); + } catch (CTextureCreateFailedException e) { + Trace.TraceError(e.ToString()); + Trace.TraceError("Texture generation has failed. (txData)"); + return null; } - public static CTexture tテクスチャの生成(SKBitmap bitmap, bool b黒を透過する) { - if (app == null) { - return null; - } - if (bitmap == null) { - Trace.TraceError("Texture generation has failed. (bitmap==null)"); - return null; - } - try { - return new CTexture(bitmap, b黒を透過する); - } catch (CTextureCreateFailedException e) { - Trace.TraceError(e.ToString()); - Trace.TraceError("Texture generation has failed. (txData)"); - return null; - } + } + + public static CTextureAf tテクスチャの生成Af(string fileName) { + return tテクスチャの生成Af(fileName, false); + } + public static CTextureAf tテクスチャの生成Af(string fileName, bool b黒を透過する) { + if (app == null) { + return null; + } + try { + return new CTextureAf(fileName, b黒を透過する); + } catch (CTextureCreateFailedException e) { + Trace.TraceError(e.ToString()); + Trace.TraceError("Texture generation has failed. ({0})", fileName); + return null; + } catch (FileNotFoundException e) { + Trace.TraceError(e.ToString()); + Trace.TraceError("Texture generation has failed. ({0})", fileName); + return null; + } + } + + /// プロパティ、インデクサには ref は使用できないので注意。 + public static void tDisposeSafely(ref T obj) { + if (obj == null) + return; + + var d = obj as IDisposable; + + if (d != null) + d.Dispose(); + + obj = default(T); + } + + public static void t安全にDisposeする(ref T[] array) where T : class, IDisposable //2020.08.01 Mr-Ojii twopointzero氏のソースコードをもとに追加 + { + if (array == null) { + return; } - public static CTextureAf tテクスチャの生成Af(string fileName) { - return tテクスチャの生成Af(fileName, false); + for (var i = 0; i < array.Length; i++) { + array[i]?.Dispose(); + array[i] = null; } - public static CTextureAf tテクスチャの生成Af(string fileName, bool b黒を透過する) { - if (app == null) { - return null; - } - try { - return new CTextureAf(fileName, b黒を透過する); - } catch (CTextureCreateFailedException e) { - Trace.TraceError(e.ToString()); - Trace.TraceError("Texture generation has failed. ({0})", fileName); - return null; - } catch (FileNotFoundException e) { - Trace.TraceError(e.ToString()); - Trace.TraceError("Texture generation has failed. ({0})", fileName); - return null; - } - } - - /// プロパティ、インデクサには ref は使用できないので注意。 - public static void tDisposeSafely(ref T obj) { - if (obj == null) - return; + } - var d = obj as IDisposable; - - if (d != null) - d.Dispose(); - - obj = default(T); + /// + /// そのフォルダの連番画像の最大値を返す。 + /// + public static int t連番画像の枚数を数える(string ディレクトリ名, string プレフィックス = "", string 拡張子 = ".png") { + int num = 0; + while (File.Exists(ディレクトリ名 + プレフィックス + num + 拡張子)) { + num++; } + return num; + } - public static void t安全にDisposeする(ref T[] array) where T : class, IDisposable //2020.08.01 Mr-Ojii twopointzero氏のソースコードをもとに追加 - { - if (array == null) { - return; - } + /// + /// 曲名テクスチャの縮小倍率を返す。 + /// + /// 曲名テクスチャ。 + /// 等倍で表示するピクセル数の最大値(デフォルト値:645) + /// 曲名テクスチャの縮小倍率。そのテクスチャがnullならば一倍(1f)を返す。 + public static float GetSongNameXScaling(ref CTexture cTexture, int samePixel = 660) { + if (cTexture == null) return 1f; + float scalingRate = (float)samePixel / (float)cTexture.szTextureSize.Width; + if (cTexture.szTextureSize.Width <= samePixel) + scalingRate = 1.0f; + return scalingRate; + } - for (var i = 0; i < array.Length; i++) { - array[i]?.Dispose(); - array[i] = null; - } - } - - /// - /// そのフォルダの連番画像の最大値を返す。 - /// - public static int t連番画像の枚数を数える(string ディレクトリ名, string プレフィックス = "", string 拡張子 = ".png") { - int num = 0; - while (File.Exists(ディレクトリ名 + プレフィックス + num + 拡張子)) { - num++; - } - return num; - } - - /// - /// 曲名テクスチャの縮小倍率を返す。 - /// - /// 曲名テクスチャ。 - /// 等倍で表示するピクセル数の最大値(デフォルト値:645) - /// 曲名テクスチャの縮小倍率。そのテクスチャがnullならば一倍(1f)を返す。 - public static float GetSongNameXScaling(ref CTexture cTexture, int samePixel = 660) { - if (cTexture == null) return 1f; - float scalingRate = (float)samePixel / (float)cTexture.szTextureSize.Width; - if (cTexture.szTextureSize.Width <= samePixel) - scalingRate = 1.0f; - return scalingRate; - } - - /// - /// 難易度を表す数字を列挙体に変換します。 - /// - /// 難易度を表す数字。 - /// Difficulty 列挙体 - public static Difficulty DifficultyNumberToEnum(int number) { - switch (number) { - case 0: - return Difficulty.Easy; - case 1: - return Difficulty.Normal; - case 2: - return Difficulty.Hard; - case 3: - return Difficulty.Oni; - case 4: - return Difficulty.Edit; - case 5: - return Difficulty.Tower; - case 6: - return Difficulty.Dan; - default: - throw new IndexOutOfRangeException(); - } - } - - //----------------- + /// + /// 難易度を表す数字を列挙体に変換します。 + /// + /// 難易度を表す数字。 + /// Difficulty 列挙体 + public static Difficulty DifficultyNumberToEnum(int number) { + switch (number) { + case 0: + return Difficulty.Easy; + case 1: + return Difficulty.Normal; + case 2: + return Difficulty.Hard; + case 3: + return Difficulty.Oni; + case 4: + return Difficulty.Edit; + case 5: + return Difficulty.Tower; + case 6: + return Difficulty.Dan; + default: + throw new IndexOutOfRangeException(); + } + } + + //----------------- + #endregion + + #region [ private ] + //----------------- + private bool bマウスカーソル表示中 = true; + private bool b終了処理完了済み; + public bool bネットワークに接続中 { get; private set; } = false; + private long 前回のシステム時刻ms = long.MinValue; + private static CDTX[] dtx = new CDTX[5]; + + public static TextureLoader Tx = new TextureLoader(); + + public List listトップレベルActivities; + private int n進行描画の戻り値; + private string strWindowTitle + // ayo komi isn't this useless code? - tfd500 + { + get { + return "OpenTaiko"; + } + } + private CSound previewSound; + public static DateTime StartupTime { + get; + private set; + } + + private void t起動処理() { + + #region [ Read Config.ini and Database files ] + //--------------------- + + // Port <= 0.5.4 NamePlate.json to Pre 0.6.0 b1 Saves\ + NamePlateConfig = new NamePlateConfig(); + NamePlateConfig.tNamePlateConfig(); + + Favorites = new Favorites(); + Favorites.tFavorites(); + + RecentlyPlayedSongs = new RecentlyPlayedSongs(); + RecentlyPlayedSongs.tRecentlyPlayedSongs(); + + Databases = new Databases(); + Databases.tDatabases(); + + VisualLogManager = new CVisualLogManager(); + + if (!File.Exists("Saves.db3")) { + File.Copy(@$".init{Path.DirectorySeparatorChar}Saves.db3", "Saves.db3"); + } + // Add a condition here (if old Saves\ format save files exist) to port them to database (?) + SaveFileInstances = DBSaves.FetchSaveInstances(); + + //--------------------- #endregion - - #region [ private ] - //----------------- - private bool bマウスカーソル表示中 = true; - private bool b終了処理完了済み; - public bool bネットワークに接続中 { get; private set; } = false; - private long 前回のシステム時刻ms = long.MinValue; - private static CDTX[] dtx = new CDTX[5]; - public static TextureLoader Tx = new TextureLoader(); - - public List listトップレベルActivities; - private int n進行描画の戻り値; - private string strWindowTitle - // ayo komi isn't this useless code? - tfd500 - { - get { - return "OpenTaiko"; + #region [ ログ出力開始 ] + //--------------------- + Trace.AutoFlush = true; + if (ConfigIni.bOutputLogs) { + try { + Trace.Listeners.Add(new CTraceLogListener(new StreamWriter(System.IO.Path.Combine(strEXEのあるフォルダ, "OpenTaiko.log"), false, Encoding.GetEncoding(OpenTaiko.sEncType)))); + } catch (System.UnauthorizedAccessException) // #24481 2011.2.20 yyagi + { + int c = (CultureInfo.CurrentUICulture.TwoLetterISOLanguageName == "ja") ? 0 : 1; + string[] mes_writeErr = { + "OpenTaiko.logへの書き込みができませんでした。書き込みできるようにしてから、再度起動してください。", + "Failed to write OpenTaiko.log. Please set your device to READ/WRITE and try again." + }; + Environment.Exit(1); } } - private CSound previewSound; - public static DateTime StartupTime { - get; - private set; - } + Trace.WriteLine(""); + Trace.WriteLine("Welcome to OpenTaiko! Starting log..."); + Trace.WriteLine(string.Format("Version: {0}", VERSION)); + Trace.WriteLine(""); + Trace.TraceInformation("----------------------"); + Trace.TraceInformation("■ Application Info:"); + Trace.TraceInformation("OS Version: " + Environment.OSVersion); + Trace.TraceInformation("Processors: " + Environment.ProcessorCount.ToString()); + Trace.TraceInformation("CLR Version: " + Environment.Version.ToString()); + //--------------------- + #endregion - private void t起動処理() { - - #region [ Read Config.ini and Database files ] - //--------------------- - - // Port <= 0.5.4 NamePlate.json to Pre 0.6.0 b1 Saves\ - NamePlateConfig = new NamePlateConfig(); - NamePlateConfig.tNamePlateConfig(); + DTX = null; - Favorites = new Favorites(); - Favorites.tFavorites(); - - RecentlyPlayedSongs = new RecentlyPlayedSongs(); - RecentlyPlayedSongs.tRecentlyPlayedSongs(); - - Databases = new Databases(); - Databases.tDatabases(); - - VisualLogManager = new CVisualLogManager(); - - if (!File.Exists("Saves.db3")) { - File.Copy(@$".init{Path.DirectorySeparatorChar}Saves.db3", "Saves.db3"); - } - // Add a condition here (if old Saves\ format save files exist) to port them to database (?) - SaveFileInstances = DBSaves.FetchSaveInstances(); - - //--------------------- - #endregion - - #region [ ログ出力開始 ] - //--------------------- - Trace.AutoFlush = true; - if (ConfigIni.bOutputLogs) { - try { - Trace.Listeners.Add(new CTraceLogListener(new StreamWriter(System.IO.Path.Combine(strEXEのあるフォルダ, "OpenTaiko.log"), false, Encoding.GetEncoding(OpenTaiko.sEncType)))); - } catch (System.UnauthorizedAccessException) // #24481 2011.2.20 yyagi - { - int c = (CultureInfo.CurrentUICulture.TwoLetterISOLanguageName == "ja") ? 0 : 1; - string[] mes_writeErr = { - "OpenTaiko.logへの書き込みができませんでした。書き込みできるようにしてから、再度起動してください。", - "Failed to write OpenTaiko.log. Please set your device to READ/WRITE and try again." - }; - Environment.Exit(1); - } - } - Trace.WriteLine(""); - Trace.WriteLine("Welcome to OpenTaiko! Starting log..."); - Trace.WriteLine(string.Format("Version: {0}", VERSION)); - Trace.WriteLine(""); - Trace.TraceInformation("----------------------"); - Trace.TraceInformation("■ Application Info:"); - Trace.TraceInformation("OS Version: " + Environment.OSVersion); - Trace.TraceInformation("Processors: " + Environment.ProcessorCount.ToString()); - Trace.TraceInformation("CLR Version: " + Environment.Version.ToString()); - //--------------------- - #endregion - - DTX = null; - - #region [ Skin の初期化 ] - //--------------------- - Trace.TraceInformation("Initializing skin..."); - Trace.Indent(); + #region [ Skin の初期化 ] + //--------------------- + Trace.TraceInformation("Initializing skin..."); + Trace.Indent(); #if !DEBUG try #endif - { - Skin = new CSkin(OpenTaiko.ConfigIni.strSystemSkinSubfolderFullName, false); - OpenTaiko.ConfigIni.strSystemSkinSubfolderFullName = OpenTaiko.Skin.GetCurrentSkinSubfolderFullName(true); // 旧指定のSkinフォルダが消滅していた場合に備える - - ChangeResolution(OpenTaiko.Skin.Resolution[0], OpenTaiko.Skin.Resolution[1]); + { + Skin = new CSkin(OpenTaiko.ConfigIni.strSystemSkinSubfolderFullName, false); + OpenTaiko.ConfigIni.strSystemSkinSubfolderFullName = OpenTaiko.Skin.GetCurrentSkinSubfolderFullName(true); // 旧指定のSkinフォルダが消滅していた場合に備える - Trace.TraceInformation("Skin successfully initialized."); - } + ChangeResolution(OpenTaiko.Skin.Resolution[0], OpenTaiko.Skin.Resolution[1]); + + Trace.TraceInformation("Skin successfully initialized."); + } #if !DEBUG catch (Exception e) { @@ -1903,586 +1904,585 @@ for (int i = 0; i < 3; i++) { Trace.Unindent(); } #endif - - //--------------------- - #endregion - //----------- - #region [ Timer の初期化 ] - //--------------------- - Trace.TraceInformation("Initializing timer..."); - Trace.Indent(); - try { - Timer = new CTimer(CTimer.TimerType.MultiMedia); - Trace.TraceInformation("Timer successfully initialized."); - } finally { - Trace.Unindent(); - } - //--------------------- - #endregion - //----------- - - #region [ FPS カウンタの初期化 ] - //--------------------- - Trace.TraceInformation("Initializing FPS counter..."); - Trace.Indent(); - try { - FPS = new CFPS(); - Trace.TraceInformation("FPS counter initialized."); - } finally { - Trace.Unindent(); - } - //--------------------- - #endregion - #region [ act文字コンソールの初期化 ] - //--------------------- - Trace.TraceInformation("Initializing console..."); - Trace.Indent(); - try { - actTextConsole = new CTextConsole(); - Trace.TraceInformation("Console initialized."); - actTextConsole.Activate(); - actTextConsole.CreateManagedResource(); - actTextConsole.CreateUnmanagedResource(); - Trace.TraceInformation("Console has been activated."); - Trace.TraceInformation("Console has finished being initialized."); - } catch (Exception exception) { - Trace.TraceError(exception.ToString()); - Trace.TraceError("Console failed to initialize."); - } finally { - Trace.Unindent(); - } - //--------------------- - #endregion - #region [ Input管理 の初期化 ] - //--------------------- - Trace.TraceInformation("Initializing DirectInput and MIDI input..."); - Trace.Indent(); - try { - bool bUseMIDIIn = true; - InputManager = new CInputManager(Window_); - foreach (IInputDevice device in InputManager.InputDevices) { - if ((device.CurrentType == InputDeviceType.Joystick) && !ConfigIni.dicJoystick.ContainsValue(device.GUID)) { - int key = 0; - while (ConfigIni.dicJoystick.ContainsKey(key)) { - key++; - } - ConfigIni.dicJoystick.Add(key, device.GUID); - } else if ((device.CurrentType == InputDeviceType.Gamepad) && !ConfigIni.dicGamepad.ContainsValue(device.GUID)) { - int key = 0; - while (ConfigIni.dicGamepad.ContainsKey(key)) { - key++; - } - ConfigIni.dicGamepad.Add(key, device.GUID); - } - } - foreach (IInputDevice device2 in InputManager.InputDevices) { - if (device2.CurrentType == InputDeviceType.Joystick) { - foreach (KeyValuePair pair in ConfigIni.dicJoystick) { - if (device2.GUID.Equals(pair.Value)) { - ((CInputJoystick)device2).SetID(pair.Key); - break; - } - } - continue; - } else if (device2.CurrentType == InputDeviceType.Gamepad) { - foreach (KeyValuePair pair in ConfigIni.dicGamepad) { - if (device2.GUID.Equals(pair.Value)) { - ((CInputGamepad)device2).SetID(pair.Key); - break; - } - } - continue; - } - } - Trace.TraceInformation("DirectInput has been initialized."); - } catch (Exception exception2) { - Trace.TraceError("DirectInput and MIDI input failed to initialize."); - throw; - } finally { - Trace.Unindent(); - } - //--------------------- - #endregion - #region [ Pad の初期化 ] - //--------------------- - Trace.TraceInformation("Initialize pad..."); - Trace.Indent(); - try { - Pad = new CPad(ConfigIni, InputManager); - Trace.TraceInformation("Pad has been initialized."); - } catch (Exception exception3) { - Trace.TraceError(exception3.ToString()); - Trace.TraceError("Pad failed to initialize."); - } finally { - Trace.Unindent(); - } - //--------------------- - #endregion - #region [ Sound管理 の初期化 ] - //--------------------- - Trace.TraceInformation("Initializing sound device..."); - Trace.Indent(); - try { - ESoundDeviceType soundDeviceType; - switch (OpenTaiko.ConfigIni.nSoundDeviceType) { - case 0: - soundDeviceType = ESoundDeviceType.Bass; - break; - case 1: - soundDeviceType = ESoundDeviceType.ASIO; - break; - case 2: - soundDeviceType = ESoundDeviceType.ExclusiveWASAPI; - break; - case 3: - soundDeviceType = ESoundDeviceType.SharedWASAPI; - break; - default: - soundDeviceType = ESoundDeviceType.Unknown; - break; - } - SoundManager = new SoundManager(Window_, - soundDeviceType, - OpenTaiko.ConfigIni.nBassBufferSizeMs, - OpenTaiko.ConfigIni.nWASAPIBufferSizeMs, - // CDTXMania.ConfigIni.nASIOBufferSizeMs, - 0, - OpenTaiko.ConfigIni.nASIODevice, - OpenTaiko.ConfigIni.bUseOSTimer - ); - //Sound管理 = FDK.CSound管理.Instance; - //Sound管理.t初期化( soundDeviceType, 0, 0, CDTXMania.ConfigIni.nASIODevice, base.Window.Handle ); - - - Trace.TraceInformation("Initializing loudness scanning, song gain control, and sound group level control..."); - Trace.Indent(); - try { - actScanningLoudness = new CActScanningLoudness(); - actScanningLoudness.Activate(); - if (!ConfigIni.PreAssetsLoading) { - actScanningLoudness.CreateManagedResource(); - actScanningLoudness.CreateUnmanagedResource(); - } - LoudnessMetadataScanner.ScanningStateChanged += - (_, args) => actScanningLoudness.bIsActivelyScanning = args.IsActivelyScanning; - LoudnessMetadataScanner.StartBackgroundScanning(); - SongGainController = new SongGainController(); - ConfigIniToSongGainControllerBinder.Bind(ConfigIni, SongGainController); - - SoundGroupLevelController = new SoundGroupLevelController(CSound.SoundInstances); - ConfigIniToSoundGroupLevelControllerBinder.Bind(ConfigIni, SoundGroupLevelController); - } finally { - Trace.Unindent(); - Trace.TraceInformation("Initialized loudness scanning, song gain control, and sound group level control."); - } - - ShowWindowTitleWithSoundType(); - FDK.SoundManager.bIsTimeStretch = OpenTaiko.ConfigIni.bTimeStretch; - SoundManager.nMasterVolume = OpenTaiko.ConfigIni.nMasterVolume; - Trace.TraceInformation("サウンドデバイスの初期化を完了しました。"); - } catch (Exception e) { - throw new NullReferenceException("No sound devices are enabled. Please check your audio settings.", e); - } finally { - Trace.Unindent(); - } - //--------------------- - #endregion - #region [ Songs管理 の初期化 ] - //--------------------- - Trace.TraceInformation("Initializing song list..."); - Trace.Indent(); - try { - Songs管理 = new CSongs管理(); - // Songs管理_裏読 = new CSongs管理(); - EnumSongs = new CEnumSongs(); - actEnumSongs = new CActEnumSongs(); - Trace.TraceInformation("Song list initialized."); - } catch (Exception e) { - Trace.TraceError(e.ToString()); - Trace.TraceError("Song list failed to initialize."); - } finally { - Trace.Unindent(); - } - //--------------------- - #endregion - #region [ Random の初期化 ] - //--------------------- - Random = new Random(); - //--------------------- - #endregion - #region [ Stages initialisation ] - //--------------------- - r現在のステージ = null; - r直前のステージ = null; - stage起動 = new CStage起動(); - stageタイトル = new CStageタイトル(); - stageコンフィグ = new CStageコンフィグ(); - stageSongSelect = new CStage選曲(); - stage段位選択 = new CStage段位選択(); - stageHeya = new CStageHeya(); - stageOnlineLounge = new CStageOnlineLounge(); - stageTowerSelect = new CStageTowerSelect(); - stage曲読み込み = new CStage曲読み込み(); - stage演奏ドラム画面 = new CStage演奏ドラム画面(); - stage結果 = new CStage結果(); - stage結果.RefreshSkin(); - stageChangeSkin = new CStageChangeSkin(); - stage終了 = new CStage終了(); - NamePlate = new CNamePlate(); - SaveFile = 0; - this.listトップレベルActivities = new List(); - this.listトップレベルActivities.Add(actEnumSongs); - this.listトップレベルActivities.Add(actTextConsole); - this.listトップレベルActivities.Add(stage起動); - this.listトップレベルActivities.Add(stageタイトル); - this.listトップレベルActivities.Add(stageコンフィグ); - this.listトップレベルActivities.Add(stageSongSelect); - this.listトップレベルActivities.Add(stage段位選択); - this.listトップレベルActivities.Add(stageHeya); - this.listトップレベルActivities.Add(stageOnlineLounge); - this.listトップレベルActivities.Add(stageTowerSelect); - this.listトップレベルActivities.Add(stage曲読み込み); - this.listトップレベルActivities.Add(stage演奏ドラム画面); - this.listトップレベルActivities.Add(stage結果); - this.listトップレベルActivities.Add(stageChangeSkin); - this.listトップレベルActivities.Add(stage終了); - //--------------------- - #endregion - - #region Discordの処理 - DiscordClient = new DiscordRpcClient("939341030141096007"); - DiscordClient?.Initialize(); - StartupTime = DateTime.UtcNow; - DiscordClient?.SetPresence(new RichPresence() { - Details = "", - State = "Startup", - Timestamps = new Timestamps(OpenTaiko.StartupTime), - Assets = new Assets() { - LargeImageKey = OpenTaiko.LargeImageKey, - LargeImageText = OpenTaiko.LargeImageText, - } - }); - #endregion - - - Trace.TraceInformation("Application successfully started."); - - - #region [ 最初のステージの起動 ] - //--------------------- - Trace.TraceInformation("----------------------"); - Trace.TraceInformation("■ Startup"); - - r現在のステージ = stage起動; - r現在のステージ.Activate(); - if (!ConfigIni.PreAssetsLoading) { - r現在のステージ.CreateManagedResource(); - r現在のステージ.CreateUnmanagedResource(); - } - - //--------------------- - #endregion + //--------------------- + #endregion + //----------- + #region [ Timer の初期化 ] + //--------------------- + Trace.TraceInformation("Initializing timer..."); + Trace.Indent(); + try { + Timer = new CTimer(CTimer.TimerType.MultiMedia); + Trace.TraceInformation("Timer successfully initialized."); + } finally { + Trace.Unindent(); } + //--------------------- + #endregion + //----------- - public void ShowWindowTitleWithSoundType() { - string delay = ""; - if (SoundManager.GetCurrentSoundDeviceType() != "DirectSound") { - delay = "(" + SoundManager.GetSoundDelay() + "ms)"; - } - AssemblyName asmApp = Assembly.GetExecutingAssembly().GetName(); - base.Text = asmApp.Name + " Ver." + VERSION + " (" + SoundManager.GetCurrentSoundDeviceType() + delay + ")"; + #region [ FPS カウンタの初期化 ] + //--------------------- + Trace.TraceInformation("Initializing FPS counter..."); + Trace.Indent(); + try { + FPS = new CFPS(); + Trace.TraceInformation("FPS counter initialized."); + } finally { + Trace.Unindent(); } - - private void t終了処理() { - if (!this.b終了処理完了済み) { - Trace.TraceInformation("----------------------"); - Trace.TraceInformation("■ Shutdown"); - #region [ 曲検索の終了処理 ] - //--------------------- - - if (actEnumSongs != null) { - Trace.TraceInformation("Ending enumeration of songs..."); - Trace.Indent(); - try { - actEnumSongs.DeActivate(); - actEnumSongs = null; - Trace.TraceInformation("Enumeration of songs closed down successfully."); - } catch (Exception e) { - Trace.TraceError(e.ToString()); - Trace.TraceError("Song enumeration could not close."); - } finally { - Trace.Unindent(); - } - } - //--------------------- - #endregion - #region [ 現在のステージの終了処理 ] - //--------------------- - if (OpenTaiko.r現在のステージ != null && OpenTaiko.r現在のステージ.IsActivated) // #25398 2011.06.07 MODIFY FROM - { - Trace.TraceInformation("Exiting stage..."); - Trace.Indent(); - try { - r現在のステージ.DeActivate(); - if (!ConfigIni.PreAssetsLoading) { - r現在のステージ.ReleaseManagedResource(); - r現在のステージ.ReleaseUnmanagedResource(); - } - Trace.TraceInformation("Stage exited."); - } finally { - Trace.Unindent(); - } - } - //--------------------- - #endregion - - #region Discordの処理 - DiscordClient?.Dispose(); - #endregion - #region [ 曲リストの終了処理 ] - //--------------------- - if (Songs管理 != null) { - Trace.TraceInformation("Ending song list..."); - Trace.Indent(); - try { -#pragma warning disable SYSLIB0011 - if (EnumSongs.IsSongListEnumCompletelyDone) { - BinaryFormatter songlistdb_ = new BinaryFormatter(); - using Stream songlistdb = File.OpenWrite($"{OpenTaiko.strEXEのあるフォルダ}songlist.db"); - songlistdb_.Serialize(songlistdb, Songs管理.listSongsDB); - } -#pragma warning restore SYSLIB0011 - - Songs管理 = null; - Trace.TraceInformation("Song list terminated."); - } catch (Exception exception) { - Trace.TraceError(exception.ToString()); - Trace.TraceError("Song list failed to terminate."); - } finally { - Trace.Unindent(); - } - } - //--------------------- - #endregion - #region TextureLoaderの処理 - Tx.DisposeTexture(); - #endregion - #region [ スキンの終了処理 ] - //--------------------- - if (Skin != null) { - Trace.TraceInformation("Terminating skin..."); - Trace.Indent(); - try { - Skin.Dispose(); - Skin = null; - Trace.TraceInformation("Skin has been terminated."); - } catch (Exception exception2) { - Trace.TraceError(exception2.ToString()); - Trace.TraceError("Skin failed to terminate."); - } finally { - Trace.Unindent(); - } - } - //--------------------- - #endregion - #region [ DirectSoundの終了処理 ] - //--------------------- - if (SoundManager != null) { - Trace.TraceInformation("Ending DirectSound devices..."); - Trace.Indent(); - try { - SoundManager.Dispose(); - SoundManager = null; - Trace.TraceInformation("DirectSound devices have been terminated."); - } catch (Exception exception3) { - Trace.TraceError(exception3.ToString()); - Trace.TraceError("DirectSound devices failed to terminate."); - } finally { - Trace.Unindent(); - } - } - //--------------------- - #endregion - #region [ パッドの終了処理 ] - //--------------------- - if (Pad != null) { - Trace.TraceInformation("Ending pads..."); - Trace.Indent(); - try { - Pad = null; - Trace.TraceInformation("Pads have been terminated."); - } catch (Exception exception4) { - Trace.TraceError(exception4.ToString()); - Trace.TraceError("Pads failed to terminate。"); - } finally { - Trace.Unindent(); - } - } - //--------------------- - #endregion - #region [ DirectInput, MIDI入力の終了処理 ] - //--------------------- - if (InputManager != null) { - Trace.TraceInformation("Ending DirectInput and MIDI devices..."); - Trace.Indent(); - try { - InputManager.Dispose(); - InputManager = null; - Trace.TraceInformation("DirectInput and MIDI devices terminated."); - } catch (Exception exception5) { - Trace.TraceError(exception5.ToString()); - Trace.TraceError("DirectInput and MIDI devices failed to terminate."); - } finally { - Trace.Unindent(); - } - } - //--------------------- - #endregion - #region [ 文字コンソールの終了処理 ] - //--------------------- - if (actTextConsole != null) { - Trace.TraceInformation("Ending console..."); - Trace.Indent(); - try { - actTextConsole.DeActivate(); - actTextConsole.ReleaseManagedResource(); - actTextConsole.ReleaseUnmanagedResource(); - actTextConsole = null; - Trace.TraceInformation("Console terminated."); - } catch (Exception exception6) { - Trace.TraceError(exception6.ToString()); - Trace.TraceError("Console failed to terminate."); - } finally { - Trace.Unindent(); - } - } - //--------------------- - #endregion - #region [ FPSカウンタの終了処理 ] - //--------------------- - Trace.TraceInformation("Ending FPS counter..."); - Trace.Indent(); - try { - if (FPS != null) { - FPS = null; - } - Trace.TraceInformation("FPS counter terminated."); - } finally { - Trace.Unindent(); - } - //--------------------- - #endregion - #region [ タイマの終了処理 ] - //--------------------- - Trace.TraceInformation("Ending timer..."); - Trace.Indent(); - try { - if (Timer != null) { - Timer.Dispose(); - Timer = null; - Trace.TraceInformation("Timer terminated."); - } else { - Trace.TraceInformation("There are no existing timers."); - } - } finally { - Trace.Unindent(); - } - //--------------------- - #endregion - #region [ Config.iniの出力 ] - //--------------------- - Trace.TraceInformation("Outputting Config.ini..."); - Trace.TraceInformation("This only needs to be done once, unless you have deleted the file!"); - string str = strEXEのあるフォルダ + "Config.ini"; - Trace.Indent(); - try { - ConfigIni.t書き出し(str); - Trace.TraceInformation("Saved succesfully. ({0})", str); - } catch (Exception e) { - Trace.TraceError(e.ToString()); - Trace.TraceError("Config.ini failed to create. ({0})", str); - } finally { - Trace.Unindent(); - } - - Trace.TraceInformation("Deinitializing loudness scanning, song gain control, and sound group level control..."); - Trace.Indent(); - try { - SoundGroupLevelController = null; - SongGainController = null; - LoudnessMetadataScanner.StopBackgroundScanning(joinImmediately: true); - actScanningLoudness.DeActivate(); - if (!ConfigIni.PreAssetsLoading) { - actScanningLoudness.ReleaseManagedResource(); - actScanningLoudness.ReleaseUnmanagedResource(); - } - actScanningLoudness = null; - } finally { - Trace.Unindent(); - Trace.TraceInformation("Deinitialized loudness scanning, song gain control, and sound group level control."); - } - - ConfigIni = null; - - //--------------------- - #endregion - Trace.TraceInformation("OpenTaiko has closed down successfully."); - this.b終了処理完了済み = true; - } - } - - private void tガベージコレクションを実行する() { - GC.Collect(GC.MaxGeneration); - GC.WaitForPendingFinalizers(); - GC.Collect(GC.MaxGeneration); - } - - private void ChangeResolution(int nWidth, int nHeight) { - GameWindowSize.Width = nWidth; - GameWindowSize.Height = nHeight; - - //WindowSize = new Silk.NET.Maths.Vector2D(nWidth, nHeight); - } - - public void RefreshSkin() { - Trace.TraceInformation("Skin Change:" + OpenTaiko.Skin.GetCurrentSkinSubfolderFullName(false)); - - OpenTaiko.actTextConsole.DeActivate(); - actTextConsole.ReleaseManagedResource(); - actTextConsole.ReleaseUnmanagedResource(); - - OpenTaiko.Skin.Dispose(); - OpenTaiko.Skin = null; - OpenTaiko.Skin = new CSkin(OpenTaiko.ConfigIni.strSystemSkinSubfolderFullName, false); - - OpenTaiko.Tx.DisposeTexture(); - - ChangeResolution(OpenTaiko.Skin.Resolution[0], OpenTaiko.Skin.Resolution[1]); - - OpenTaiko.Tx.LoadTexture(); - - OpenTaiko.actTextConsole.Activate(); + //--------------------- + #endregion + #region [ act文字コンソールの初期化 ] + //--------------------- + Trace.TraceInformation("Initializing console..."); + Trace.Indent(); + try { + actTextConsole = new CTextConsole(); + Trace.TraceInformation("Console initialized."); + actTextConsole.Activate(); actTextConsole.CreateManagedResource(); actTextConsole.CreateUnmanagedResource(); - OpenTaiko.NamePlate.RefleshSkin(); - OpenTaiko.stage結果.RefreshSkin(); - CActSelectPopupMenu.RefleshSkin(); - CActSelect段位リスト.RefleshSkin(); - } + Trace.TraceInformation("Console has been activated."); + Trace.TraceInformation("Console has finished being initialized."); + } catch (Exception exception) { + Trace.TraceError(exception.ToString()); + Trace.TraceError("Console failed to initialize."); + } finally { + Trace.Unindent(); + } + //--------------------- #endregion - - #region [ EXTENDED VARIABLES ] - public static float fCamXOffset; - public static float fCamYOffset; + #region [ Input管理 の初期化 ] + //--------------------- + Trace.TraceInformation("Initializing DirectInput and MIDI input..."); + Trace.Indent(); + try { + bool bUseMIDIIn = true; + InputManager = new CInputManager(Window_); + foreach (IInputDevice device in InputManager.InputDevices) { + if ((device.CurrentType == InputDeviceType.Joystick) && !ConfigIni.dicJoystick.ContainsValue(device.GUID)) { + int key = 0; + while (ConfigIni.dicJoystick.ContainsKey(key)) { + key++; + } + ConfigIni.dicJoystick.Add(key, device.GUID); + } else if ((device.CurrentType == InputDeviceType.Gamepad) && !ConfigIni.dicGamepad.ContainsValue(device.GUID)) { + int key = 0; + while (ConfigIni.dicGamepad.ContainsKey(key)) { + key++; + } + ConfigIni.dicGamepad.Add(key, device.GUID); + } + } + foreach (IInputDevice device2 in InputManager.InputDevices) { + if (device2.CurrentType == InputDeviceType.Joystick) { + foreach (KeyValuePair pair in ConfigIni.dicJoystick) { + if (device2.GUID.Equals(pair.Value)) { + ((CInputJoystick)device2).SetID(pair.Key); + break; + } + } + continue; + } else if (device2.CurrentType == InputDeviceType.Gamepad) { + foreach (KeyValuePair pair in ConfigIni.dicGamepad) { + if (device2.GUID.Equals(pair.Value)) { + ((CInputGamepad)device2).SetID(pair.Key); + break; + } + } + continue; + } + } + Trace.TraceInformation("DirectInput has been initialized."); + } catch (Exception exception2) { + Trace.TraceError("DirectInput and MIDI input failed to initialize."); + throw; + } finally { + Trace.Unindent(); + } + //--------------------- + #endregion + #region [ Pad の初期化 ] + //--------------------- + Trace.TraceInformation("Initialize pad..."); + Trace.Indent(); + try { + Pad = new CPad(ConfigIni, InputManager); + Trace.TraceInformation("Pad has been initialized."); + } catch (Exception exception3) { + Trace.TraceError(exception3.ToString()); + Trace.TraceError("Pad failed to initialize."); + } finally { + Trace.Unindent(); + } + //--------------------- + #endregion + #region [ Sound管理 の初期化 ] + //--------------------- + Trace.TraceInformation("Initializing sound device..."); + Trace.Indent(); + try { + ESoundDeviceType soundDeviceType; + switch (OpenTaiko.ConfigIni.nSoundDeviceType) { + case 0: + soundDeviceType = ESoundDeviceType.Bass; + break; + case 1: + soundDeviceType = ESoundDeviceType.ASIO; + break; + case 2: + soundDeviceType = ESoundDeviceType.ExclusiveWASAPI; + break; + case 3: + soundDeviceType = ESoundDeviceType.SharedWASAPI; + break; + default: + soundDeviceType = ESoundDeviceType.Unknown; + break; + } + SoundManager = new SoundManager(Window_, + soundDeviceType, + OpenTaiko.ConfigIni.nBassBufferSizeMs, + OpenTaiko.ConfigIni.nWASAPIBufferSizeMs, + // CDTXMania.ConfigIni.nASIOBufferSizeMs, + 0, + OpenTaiko.ConfigIni.nASIODevice, + OpenTaiko.ConfigIni.bUseOSTimer + ); + //Sound管理 = FDK.CSound管理.Instance; + //Sound管理.t初期化( soundDeviceType, 0, 0, CDTXMania.ConfigIni.nASIODevice, base.Window.Handle ); - public static float fCamZoomFactor = 1.0f; - public static float fCamRotation; - public static float fCamXScale = 1.0f; - public static float fCamYScale = 1.0f; + Trace.TraceInformation("Initializing loudness scanning, song gain control, and sound group level control..."); + Trace.Indent(); + try { + actScanningLoudness = new CActScanningLoudness(); + actScanningLoudness.Activate(); + if (!ConfigIni.PreAssetsLoading) { + actScanningLoudness.CreateManagedResource(); + actScanningLoudness.CreateUnmanagedResource(); + } + LoudnessMetadataScanner.ScanningStateChanged += + (_, args) => actScanningLoudness.bIsActivelyScanning = args.IsActivelyScanning; + LoudnessMetadataScanner.StartBackgroundScanning(); - public static Color4 borderColor = new Color4(1f, 0f, 0f, 0f); + SongGainController = new SongGainController(); + ConfigIniToSongGainControllerBinder.Bind(ConfigIni, SongGainController); + + SoundGroupLevelController = new SoundGroupLevelController(CSound.SoundInstances); + ConfigIniToSoundGroupLevelControllerBinder.Bind(ConfigIni, SoundGroupLevelController); + } finally { + Trace.Unindent(); + Trace.TraceInformation("Initialized loudness scanning, song gain control, and sound group level control."); + } + + ShowWindowTitleWithSoundType(); + FDK.SoundManager.bIsTimeStretch = OpenTaiko.ConfigIni.bTimeStretch; + SoundManager.nMasterVolume = OpenTaiko.ConfigIni.nMasterVolume; + Trace.TraceInformation("サウンドデバイスの初期化を完了しました。"); + } catch (Exception e) { + throw new NullReferenceException("No sound devices are enabled. Please check your audio settings.", e); + } finally { + Trace.Unindent(); + } + //--------------------- + #endregion + #region [ Songs管理 の初期化 ] + //--------------------- + Trace.TraceInformation("Initializing song list..."); + Trace.Indent(); + try { + Songs管理 = new CSongs管理(); + // Songs管理_裏読 = new CSongs管理(); + EnumSongs = new CEnumSongs(); + actEnumSongs = new CActEnumSongs(); + Trace.TraceInformation("Song list initialized."); + } catch (Exception e) { + Trace.TraceError(e.ToString()); + Trace.TraceError("Song list failed to initialize."); + } finally { + Trace.Unindent(); + } + //--------------------- + #endregion + #region [ Random の初期化 ] + //--------------------- + Random = new Random(); + //--------------------- + #endregion + #region [ Stages initialisation ] + //--------------------- + r現在のステージ = null; + r直前のステージ = null; + stage起動 = new CStage起動(); + stageタイトル = new CStageタイトル(); + stageコンフィグ = new CStageコンフィグ(); + stageSongSelect = new CStage選曲(); + stage段位選択 = new CStage段位選択(); + stageHeya = new CStageHeya(); + stageOnlineLounge = new CStageOnlineLounge(); + stageTowerSelect = new CStageTowerSelect(); + stage曲読み込み = new CStage曲読み込み(); + stage演奏ドラム画面 = new CStage演奏ドラム画面(); + stage結果 = new CStage結果(); + stage結果.RefreshSkin(); + stageChangeSkin = new CStageChangeSkin(); + stage終了 = new CStage終了(); + NamePlate = new CNamePlate(); + SaveFile = 0; + this.listトップレベルActivities = new List(); + this.listトップレベルActivities.Add(actEnumSongs); + this.listトップレベルActivities.Add(actTextConsole); + this.listトップレベルActivities.Add(stage起動); + this.listトップレベルActivities.Add(stageタイトル); + this.listトップレベルActivities.Add(stageコンフィグ); + this.listトップレベルActivities.Add(stageSongSelect); + this.listトップレベルActivities.Add(stage段位選択); + this.listトップレベルActivities.Add(stageHeya); + this.listトップレベルActivities.Add(stageOnlineLounge); + this.listトップレベルActivities.Add(stageTowerSelect); + this.listトップレベルActivities.Add(stage曲読み込み); + this.listトップレベルActivities.Add(stage演奏ドラム画面); + this.listトップレベルActivities.Add(stage結果); + this.listトップレベルActivities.Add(stageChangeSkin); + this.listトップレベルActivities.Add(stage終了); + //--------------------- + #endregion + + #region Discordの処理 + DiscordClient = new DiscordRpcClient("939341030141096007"); + DiscordClient?.Initialize(); + StartupTime = DateTime.UtcNow; + DiscordClient?.SetPresence(new RichPresence() { + Details = "", + State = "Startup", + Timestamps = new Timestamps(OpenTaiko.StartupTime), + Assets = new Assets() { + LargeImageKey = OpenTaiko.LargeImageKey, + LargeImageText = OpenTaiko.LargeImageText, + } + }); + #endregion + + + Trace.TraceInformation("Application successfully started."); + + + #region [ 最初のステージの起動 ] + //--------------------- + Trace.TraceInformation("----------------------"); + Trace.TraceInformation("■ Startup"); + + r現在のステージ = stage起動; + r現在のステージ.Activate(); + if (!ConfigIni.PreAssetsLoading) { + r現在のステージ.CreateManagedResource(); + r現在のステージ.CreateUnmanagedResource(); + } + + //--------------------- #endregion } + + public void ShowWindowTitleWithSoundType() { + string delay = ""; + if (SoundManager.GetCurrentSoundDeviceType() != "DirectSound") { + delay = "(" + SoundManager.GetSoundDelay() + "ms)"; + } + AssemblyName asmApp = Assembly.GetExecutingAssembly().GetName(); + base.Text = asmApp.Name + " Ver." + VERSION + " (" + SoundManager.GetCurrentSoundDeviceType() + delay + ")"; + } + + private void t終了処理() { + if (!this.b終了処理完了済み) { + Trace.TraceInformation("----------------------"); + Trace.TraceInformation("■ Shutdown"); + #region [ 曲検索の終了処理 ] + //--------------------- + + if (actEnumSongs != null) { + Trace.TraceInformation("Ending enumeration of songs..."); + Trace.Indent(); + try { + actEnumSongs.DeActivate(); + actEnumSongs = null; + Trace.TraceInformation("Enumeration of songs closed down successfully."); + } catch (Exception e) { + Trace.TraceError(e.ToString()); + Trace.TraceError("Song enumeration could not close."); + } finally { + Trace.Unindent(); + } + } + //--------------------- + #endregion + #region [ 現在のステージの終了処理 ] + //--------------------- + if (OpenTaiko.r現在のステージ != null && OpenTaiko.r現在のステージ.IsActivated) // #25398 2011.06.07 MODIFY FROM + { + Trace.TraceInformation("Exiting stage..."); + Trace.Indent(); + try { + r現在のステージ.DeActivate(); + if (!ConfigIni.PreAssetsLoading) { + r現在のステージ.ReleaseManagedResource(); + r現在のステージ.ReleaseUnmanagedResource(); + } + Trace.TraceInformation("Stage exited."); + } finally { + Trace.Unindent(); + } + } + //--------------------- + #endregion + + #region Discordの処理 + DiscordClient?.Dispose(); + #endregion + #region [ 曲リストの終了処理 ] + //--------------------- + if (Songs管理 != null) { + Trace.TraceInformation("Ending song list..."); + Trace.Indent(); + try { +#pragma warning disable SYSLIB0011 + if (EnumSongs.IsSongListEnumCompletelyDone) { + BinaryFormatter songlistdb_ = new BinaryFormatter(); + using Stream songlistdb = File.OpenWrite($"{OpenTaiko.strEXEのあるフォルダ}songlist.db"); + songlistdb_.Serialize(songlistdb, Songs管理.listSongsDB); + } +#pragma warning restore SYSLIB0011 + + Songs管理 = null; + Trace.TraceInformation("Song list terminated."); + } catch (Exception exception) { + Trace.TraceError(exception.ToString()); + Trace.TraceError("Song list failed to terminate."); + } finally { + Trace.Unindent(); + } + } + //--------------------- + #endregion + #region TextureLoaderの処理 + Tx.DisposeTexture(); + #endregion + #region [ スキンの終了処理 ] + //--------------------- + if (Skin != null) { + Trace.TraceInformation("Terminating skin..."); + Trace.Indent(); + try { + Skin.Dispose(); + Skin = null; + Trace.TraceInformation("Skin has been terminated."); + } catch (Exception exception2) { + Trace.TraceError(exception2.ToString()); + Trace.TraceError("Skin failed to terminate."); + } finally { + Trace.Unindent(); + } + } + //--------------------- + #endregion + #region [ DirectSoundの終了処理 ] + //--------------------- + if (SoundManager != null) { + Trace.TraceInformation("Ending DirectSound devices..."); + Trace.Indent(); + try { + SoundManager.Dispose(); + SoundManager = null; + Trace.TraceInformation("DirectSound devices have been terminated."); + } catch (Exception exception3) { + Trace.TraceError(exception3.ToString()); + Trace.TraceError("DirectSound devices failed to terminate."); + } finally { + Trace.Unindent(); + } + } + //--------------------- + #endregion + #region [ パッドの終了処理 ] + //--------------------- + if (Pad != null) { + Trace.TraceInformation("Ending pads..."); + Trace.Indent(); + try { + Pad = null; + Trace.TraceInformation("Pads have been terminated."); + } catch (Exception exception4) { + Trace.TraceError(exception4.ToString()); + Trace.TraceError("Pads failed to terminate。"); + } finally { + Trace.Unindent(); + } + } + //--------------------- + #endregion + #region [ DirectInput, MIDI入力の終了処理 ] + //--------------------- + if (InputManager != null) { + Trace.TraceInformation("Ending DirectInput and MIDI devices..."); + Trace.Indent(); + try { + InputManager.Dispose(); + InputManager = null; + Trace.TraceInformation("DirectInput and MIDI devices terminated."); + } catch (Exception exception5) { + Trace.TraceError(exception5.ToString()); + Trace.TraceError("DirectInput and MIDI devices failed to terminate."); + } finally { + Trace.Unindent(); + } + } + //--------------------- + #endregion + #region [ 文字コンソールの終了処理 ] + //--------------------- + if (actTextConsole != null) { + Trace.TraceInformation("Ending console..."); + Trace.Indent(); + try { + actTextConsole.DeActivate(); + actTextConsole.ReleaseManagedResource(); + actTextConsole.ReleaseUnmanagedResource(); + actTextConsole = null; + Trace.TraceInformation("Console terminated."); + } catch (Exception exception6) { + Trace.TraceError(exception6.ToString()); + Trace.TraceError("Console failed to terminate."); + } finally { + Trace.Unindent(); + } + } + //--------------------- + #endregion + #region [ FPSカウンタの終了処理 ] + //--------------------- + Trace.TraceInformation("Ending FPS counter..."); + Trace.Indent(); + try { + if (FPS != null) { + FPS = null; + } + Trace.TraceInformation("FPS counter terminated."); + } finally { + Trace.Unindent(); + } + //--------------------- + #endregion + #region [ タイマの終了処理 ] + //--------------------- + Trace.TraceInformation("Ending timer..."); + Trace.Indent(); + try { + if (Timer != null) { + Timer.Dispose(); + Timer = null; + Trace.TraceInformation("Timer terminated."); + } else { + Trace.TraceInformation("There are no existing timers."); + } + } finally { + Trace.Unindent(); + } + //--------------------- + #endregion + #region [ Config.iniの出力 ] + //--------------------- + Trace.TraceInformation("Outputting Config.ini..."); + Trace.TraceInformation("This only needs to be done once, unless you have deleted the file!"); + string str = strEXEのあるフォルダ + "Config.ini"; + Trace.Indent(); + try { + ConfigIni.t書き出し(str); + Trace.TraceInformation("Saved succesfully. ({0})", str); + } catch (Exception e) { + Trace.TraceError(e.ToString()); + Trace.TraceError("Config.ini failed to create. ({0})", str); + } finally { + Trace.Unindent(); + } + + Trace.TraceInformation("Deinitializing loudness scanning, song gain control, and sound group level control..."); + Trace.Indent(); + try { + SoundGroupLevelController = null; + SongGainController = null; + LoudnessMetadataScanner.StopBackgroundScanning(joinImmediately: true); + actScanningLoudness.DeActivate(); + if (!ConfigIni.PreAssetsLoading) { + actScanningLoudness.ReleaseManagedResource(); + actScanningLoudness.ReleaseUnmanagedResource(); + } + actScanningLoudness = null; + } finally { + Trace.Unindent(); + Trace.TraceInformation("Deinitialized loudness scanning, song gain control, and sound group level control."); + } + + ConfigIni = null; + + //--------------------- + #endregion + Trace.TraceInformation("OpenTaiko has closed down successfully."); + this.b終了処理完了済み = true; + } + } + + private void tガベージコレクションを実行する() { + GC.Collect(GC.MaxGeneration); + GC.WaitForPendingFinalizers(); + GC.Collect(GC.MaxGeneration); + } + + private void ChangeResolution(int nWidth, int nHeight) { + GameWindowSize.Width = nWidth; + GameWindowSize.Height = nHeight; + + //WindowSize = new Silk.NET.Maths.Vector2D(nWidth, nHeight); + } + + public void RefreshSkin() { + Trace.TraceInformation("Skin Change:" + OpenTaiko.Skin.GetCurrentSkinSubfolderFullName(false)); + + OpenTaiko.actTextConsole.DeActivate(); + actTextConsole.ReleaseManagedResource(); + actTextConsole.ReleaseUnmanagedResource(); + + OpenTaiko.Skin.Dispose(); + OpenTaiko.Skin = null; + OpenTaiko.Skin = new CSkin(OpenTaiko.ConfigIni.strSystemSkinSubfolderFullName, false); + + OpenTaiko.Tx.DisposeTexture(); + + ChangeResolution(OpenTaiko.Skin.Resolution[0], OpenTaiko.Skin.Resolution[1]); + + OpenTaiko.Tx.LoadTexture(); + + OpenTaiko.actTextConsole.Activate(); + actTextConsole.CreateManagedResource(); + actTextConsole.CreateUnmanagedResource(); + OpenTaiko.NamePlate.RefleshSkin(); + OpenTaiko.stage結果.RefreshSkin(); + CActSelectPopupMenu.RefleshSkin(); + CActSelect段位リスト.RefleshSkin(); + } + #endregion + + #region [ EXTENDED VARIABLES ] + public static float fCamXOffset; + public static float fCamYOffset; + + public static float fCamZoomFactor = 1.0f; + public static float fCamRotation; + + public static float fCamXScale = 1.0f; + public static float fCamYScale = 1.0f; + + public static Color4 borderColor = new Color4(1f, 0f, 0f, 0f); + #endregion } diff --git a/OpenTaiko/src/Common/Program.cs b/OpenTaiko/src/Common/Program.cs index 4305db8b..14dd48b6 100644 --- a/OpenTaiko/src/Common/Program.cs +++ b/OpenTaiko/src/Common/Program.cs @@ -3,107 +3,108 @@ using System.Globalization; using System.Runtime.InteropServices; using System.Text; -namespace OpenTaiko { - internal class Program { - #region [ 二重起動チェック、DLL存在チェック ] - //----------------------------- - private static Mutex mutex二重起動防止用; +namespace OpenTaiko; - private static bool tDLLの存在チェック(string strDll名, string str存在しないときに表示するエラー文字列jp, string str存在しないときに表示するエラー文字列en, bool bLoadDllCheck) { - string str存在しないときに表示するエラー文字列 = (CultureInfo.CurrentUICulture.TwoLetterISOLanguageName == "ja") ? - str存在しないときに表示するエラー文字列jp : str存在しないときに表示するエラー文字列en; - if (bLoadDllCheck) { - IntPtr hModule = LoadLibrary(strDll名); // 実際にLoadDll()してチェックする - if (hModule == IntPtr.Zero) { - return false; - } - FreeLibrary(hModule); - } else { // 単純にファイルの存在有無をチェックするだけ (プロジェクトで「参照」していたり、アンマネージドなDLLが暗黙リンクされるものはこちら) - string path = Path.Combine(System.IO.Directory.GetCurrentDirectory(), strDll名); - if (!File.Exists(path)) { - return false; - } +internal class Program { + #region [ 二重起動チェック、DLL存在チェック ] + //----------------------------- + private static Mutex mutex二重起動防止用; + + private static bool tDLLの存在チェック(string strDll名, string str存在しないときに表示するエラー文字列jp, string str存在しないときに表示するエラー文字列en, bool bLoadDllCheck) { + string str存在しないときに表示するエラー文字列 = (CultureInfo.CurrentUICulture.TwoLetterISOLanguageName == "ja") ? + str存在しないときに表示するエラー文字列jp : str存在しないときに表示するエラー文字列en; + if (bLoadDllCheck) { + IntPtr hModule = LoadLibrary(strDll名); // 実際にLoadDll()してチェックする + if (hModule == IntPtr.Zero) { + return false; + } + FreeLibrary(hModule); + } else { // 単純にファイルの存在有無をチェックするだけ (プロジェクトで「参照」していたり、アンマネージドなDLLが暗黙リンクされるものはこちら) + string path = Path.Combine(System.IO.Directory.GetCurrentDirectory(), strDll名); + if (!File.Exists(path)) { + return false; } - return true; - } - private static bool tDLLの存在チェック(string strDll名, string str存在しないときに表示するエラー文字列jp, string str存在しないときに表示するエラー文字列en) { - return true; } + return true; + } + private static bool tDLLの存在チェック(string strDll名, string str存在しないときに表示するエラー文字列jp, string str存在しないときに表示するエラー文字列en) { + return true; + } - #region [DllImport] - [DllImport("kernel32", CharSet = CharSet.Unicode, SetLastError = true)] - internal static extern void FreeLibrary(IntPtr hModule); + #region [DllImport] + [DllImport("kernel32", CharSet = CharSet.Unicode, SetLastError = true)] + internal static extern void FreeLibrary(IntPtr hModule); - [DllImport("kernel32", CharSet = CharSet.Unicode, SetLastError = true)] - internal static extern IntPtr LoadLibrary(string lpFileName); - #endregion - //----------------------------- - #endregion + [DllImport("kernel32", CharSet = CharSet.Unicode, SetLastError = true)] + internal static extern IntPtr LoadLibrary(string lpFileName); + #endregion + //----------------------------- + #endregion - [STAThread] - static void Main() { - Encoding.RegisterProvider(CodePagesEncodingProvider.Instance); + [STAThread] + static void Main() { + Encoding.RegisterProvider(CodePagesEncodingProvider.Instance); - mutex二重起動防止用 = new Mutex(false, "DTXManiaMutex"); + mutex二重起動防止用 = new Mutex(false, "DTXManiaMutex"); - if (mutex二重起動防止用.WaitOne(0, false)) { - string newLine = Environment.NewLine; - bool bDLLnotfound = false; + if (mutex二重起動防止用.WaitOne(0, false)) { + string newLine = Environment.NewLine; + bool bDLLnotfound = false; - Trace.WriteLine("Current Directory: " + Environment.CurrentDirectory); - Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture; + Trace.WriteLine("Current Directory: " + Environment.CurrentDirectory); + Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture; - { - // BEGIN #23670 2010.11.13 from: キャッチされない例外は放出せずに、ログに詳細を出力する。 - // BEGIM #24606 2011.03.08 from: DEBUG 時は例外発生箇所を直接デバッグできるようにするため、例外をキャッチしないようにする。 + { + // BEGIN #23670 2010.11.13 from: キャッチされない例外は放出せずに、ログに詳細を出力する。 + // BEGIM #24606 2011.03.08 from: DEBUG 時は例外発生箇所を直接デバッグできるようにするため、例外をキャッチしないようにする。 #if !DEBUG try #endif - { + { - string osplatform = ""; - if (OperatingSystem.IsWindows()) - osplatform = "win"; - else if (OperatingSystem.IsMacOS()) - osplatform = "osx"; - else if (OperatingSystem.IsLinux()) - osplatform = "linux"; - else - throw new PlatformNotSupportedException("OpenTaiko does not support this OS."); + string osplatform = ""; + if (OperatingSystem.IsWindows()) + osplatform = "win"; + else if (OperatingSystem.IsMacOS()) + osplatform = "osx"; + else if (OperatingSystem.IsLinux()) + osplatform = "linux"; + else + throw new PlatformNotSupportedException("OpenTaiko does not support this OS."); - string platform = ""; + string platform = ""; - switch (RuntimeInformation.ProcessArchitecture) { - case Architecture.X64: - platform = "x64"; - break; - case Architecture.X86: - platform = "x86"; - break; - case Architecture.Arm: - platform = "arm"; - break; - case Architecture.Arm64: - platform = "arm64"; - break; - default: - throw new PlatformNotSupportedException($"OpenTaiko does not support this architecture. ({RuntimeInformation.ProcessArchitecture})"); - } - - FFmpeg.AutoGen.ffmpeg.RootPath = AppContext.BaseDirectory + @"FFmpeg/" + osplatform + "-" + platform + "/"; - DirectoryInfo info = new DirectoryInfo(AppContext.BaseDirectory + @"Libs/" + osplatform + "-" + platform + "/"); - - //実行ファイルの階層にライブラリをコピー - foreach (FileInfo fileinfo in info.GetFiles()) { - fileinfo.CopyTo(AppContext.BaseDirectory + fileinfo.Name, true); - } - - using (var mania = new OpenTaiko()) - mania.Run(); - - Trace.WriteLine( "" ); - Trace.WriteLine( "Thank you for playing!" ); + switch (RuntimeInformation.ProcessArchitecture) { + case Architecture.X64: + platform = "x64"; + break; + case Architecture.X86: + platform = "x86"; + break; + case Architecture.Arm: + platform = "arm"; + break; + case Architecture.Arm64: + platform = "arm64"; + break; + default: + throw new PlatformNotSupportedException($"OpenTaiko does not support this architecture. ({RuntimeInformation.ProcessArchitecture})"); } + + FFmpeg.AutoGen.ffmpeg.RootPath = AppContext.BaseDirectory + @"FFmpeg/" + osplatform + "-" + platform + "/"; + DirectoryInfo info = new DirectoryInfo(AppContext.BaseDirectory + @"Libs/" + osplatform + "-" + platform + "/"); + + //実行ファイルの階層にライブラリをコピー + foreach (FileInfo fileinfo in info.GetFiles()) { + fileinfo.CopyTo(AppContext.BaseDirectory + fileinfo.Name, true); + } + + using (var mania = new OpenTaiko()) + mania.Run(); + + Trace.WriteLine(""); + Trace.WriteLine("Thank you for playing!"); + } #if !DEBUG catch( Exception e ) { @@ -113,66 +114,65 @@ namespace OpenTaiko { Trace.Write( e.ToString() ); } #endif - // END #24606 2011.03.08 from - // END #23670 2010.11.13 from + // END #24606 2011.03.08 from + // END #23670 2010.11.13 from - if (Trace.Listeners.Count > 1) - Trace.Listeners.RemoveAt(1); + if (Trace.Listeners.Count > 1) + Trace.Listeners.RemoveAt(1); + } + + // BEGIN #24615 2011.03.09 from: Mutex.WaitOne() が true を返した場合は、Mutex のリリースが必要である。 + + mutex二重起動防止用.ReleaseMutex(); + mutex二重起動防止用 = null; + + // END #24615 2011.03.09 from + } else // DTXManiaが既に起動中 + { + + // → 引数が0個の時はそのまま終了 + // 1個( コンパクトモード or DTXV -S) か2個 (DTXV -Nxxx ファイル名)のときは、そのプロセスにコマンドラインを丸々投げて終了する + + for (int i = 0; i < 5; i++) // 検索結果のハンドルがZeroになることがあるので、200ms間隔で5回リトライする + { + #region [ 既に起動中のDTXManiaプロセスを検索する。] + // このやり方だと、ShowInTaskbar=falseでタスクバーに表示されないパターンの時に検索に失敗するようだが + // DTXManiaでそのパターンはない?のでこのままいく。 + // FindWindowを使えばこのパターンにも対応できるが、C#でビルドするアプリはウインドウクラス名を自前指定できないので、これは使わない。 + + Process current = Process.GetCurrentProcess(); + Process[] running = Process.GetProcessesByName(current.ProcessName); + Process target = null; + foreach (Process p in running) { + if (p.Id != current.Id) // プロセス名は同じでかつ、プロセスIDが自分自身とは異なるものを探す + { + if (p.MainModule.FileName == current.MainModule.FileName && p.MainWindowHandle != IntPtr.Zero) { + target = p; + break; + } + } } + #endregion - // BEGIN #24615 2011.03.09 from: Mutex.WaitOne() が true を返した場合は、Mutex のリリースが必要である。 - - mutex二重起動防止用.ReleaseMutex(); - mutex二重起動防止用 = null; - - // END #24615 2011.03.09 from - } else // DTXManiaが既に起動中 - { - - // → 引数が0個の時はそのまま終了 - // 1個( コンパクトモード or DTXV -S) か2個 (DTXV -Nxxx ファイル名)のときは、そのプロセスにコマンドラインを丸々投げて終了する - - for (int i = 0; i < 5; i++) // 検索結果のハンドルがZeroになることがあるので、200ms間隔で5回リトライする - { - #region [ 既に起動中のDTXManiaプロセスを検索する。] - // このやり方だと、ShowInTaskbar=falseでタスクバーに表示されないパターンの時に検索に失敗するようだが - // DTXManiaでそのパターンはない?のでこのままいく。 - // FindWindowを使えばこのパターンにも対応できるが、C#でビルドするアプリはウインドウクラス名を自前指定できないので、これは使わない。 - - Process current = Process.GetCurrentProcess(); - Process[] running = Process.GetProcessesByName(current.ProcessName); - Process target = null; - foreach (Process p in running) { - if (p.Id != current.Id) // プロセス名は同じでかつ、プロセスIDが自分自身とは異なるものを探す - { - if (p.MainModule.FileName == current.MainModule.FileName && p.MainWindowHandle != IntPtr.Zero) { - target = p; - break; + #region [ 起動中のDTXManiaがいれば、そのプロセスにコマンドラインを投げる ] + if (target != null) { + string[] commandLineArgs = Environment.GetCommandLineArgs(); + if (commandLineArgs != null && commandLineArgs.Length > 1) { + string arg = null; + for (int j = 1; j < commandLineArgs.Length; j++) { + if (j == 1) { + arg += commandLineArgs[j]; + } else { + arg += " " + "\"" + commandLineArgs[j] + "\""; } } } - #endregion - - #region [ 起動中のDTXManiaがいれば、そのプロセスにコマンドラインを投げる ] - if (target != null) { - string[] commandLineArgs = Environment.GetCommandLineArgs(); - if (commandLineArgs != null && commandLineArgs.Length > 1) { - string arg = null; - for (int j = 1; j < commandLineArgs.Length; j++) { - if (j == 1) { - arg += commandLineArgs[j]; - } else { - arg += " " + "\"" + commandLineArgs[j] + "\""; - } - } - } - break; - } - #endregion - else { - Trace.TraceInformation("メッセージ送信先のプロセスが見つからず。5回リトライします。"); - Thread.Sleep(200); - } + break; + } + #endregion + else { + Trace.TraceInformation("メッセージ送信先のプロセスが見つからず。5回リトライします。"); + Thread.Sleep(200); } } } diff --git a/OpenTaiko/src/Common/RecentlyPlayedSongs.cs b/OpenTaiko/src/Common/RecentlyPlayedSongs.cs index 168a97e5..18ff4460 100644 --- a/OpenTaiko/src/Common/RecentlyPlayedSongs.cs +++ b/OpenTaiko/src/Common/RecentlyPlayedSongs.cs @@ -1,43 +1,42 @@ -namespace OpenTaiko { - internal class RecentlyPlayedSongs { - public void tRecentlyPlayedSongs() { - if (!File.Exists("RecentlyPlayedSongs.json")) - tSaveFile(); - - tLoadFile(); - } - - #region [Auxiliary methods] - - public void tAddChart(string chartID) { - if (!data.recentlyplayedsongs[OpenTaiko.SaveFile].Contains(chartID)) - data.recentlyplayedsongs[OpenTaiko.SaveFile].Enqueue(chartID); - - while (data.recentlyplayedsongs[OpenTaiko.SaveFile].Count > OpenTaiko.ConfigIni.nRecentlyPlayedMax) - data.recentlyplayedsongs[OpenTaiko.SaveFile].Dequeue(); +namespace OpenTaiko; +internal class RecentlyPlayedSongs { + public void tRecentlyPlayedSongs() { + if (!File.Exists("RecentlyPlayedSongs.json")) tSaveFile(); - } - #endregion - - public class Data { - public Queue[] recentlyplayedsongs = new Queue[2] { new Queue(), new Queue() }; - } - - public Data data = new Data(); - - #region [private] - - private void tSaveFile() { - ConfigManager.SaveConfig(data, "RecentlyPlayedSongs.json"); - } - - private void tLoadFile() { - data = ConfigManager.GetConfig(@"RecentlyPlayedSongs.json"); - } - - #endregion + tLoadFile(); } + #region [Auxiliary methods] + + public void tAddChart(string chartID) { + if (!data.recentlyplayedsongs[OpenTaiko.SaveFile].Contains(chartID)) + data.recentlyplayedsongs[OpenTaiko.SaveFile].Enqueue(chartID); + + while (data.recentlyplayedsongs[OpenTaiko.SaveFile].Count > OpenTaiko.ConfigIni.nRecentlyPlayedMax) + data.recentlyplayedsongs[OpenTaiko.SaveFile].Dequeue(); + + tSaveFile(); + } + + #endregion + + public class Data { + public Queue[] recentlyplayedsongs = new Queue[2] { new Queue(), new Queue() }; + } + + public Data data = new Data(); + + #region [private] + + private void tSaveFile() { + ConfigManager.SaveConfig(data, "RecentlyPlayedSongs.json"); + } + + private void tLoadFile() { + data = ConfigManager.GetConfig(@"RecentlyPlayedSongs.json"); + } + + #endregion } diff --git a/OpenTaiko/src/Common/SaveFile.cs b/OpenTaiko/src/Common/SaveFile.cs index 46de486c..44367d06 100644 --- a/OpenTaiko/src/Common/SaveFile.cs +++ b/OpenTaiko/src/Common/SaveFile.cs @@ -1,344 +1,344 @@ using Newtonsoft.Json; -namespace OpenTaiko { - internal class SaveFile { +namespace OpenTaiko; - public void tSaveFile(string filename) { - path = @$"Saves{Path.DirectorySeparatorChar}" + filename + @".json"; - name = filename; +internal class SaveFile { - if (!File.Exists(path)) { - this.data.Name = filename; - tSaveFile(); - } + public void tSaveFile(string filename) { + path = @$"Saves{Path.DirectorySeparatorChar}" + filename + @".json"; + name = filename; - tLoadFile(); - - tInitSaveFile(); + if (!File.Exists(path)) { + this.data.Name = filename; + tSaveFile(); } - public void tInitSaveFile() { - data.bestPlays = DBSaves.GetBestPlaysAsDict(data.SaveId); - data.tFactorizeBestPlays(); + tLoadFile(); + + tInitSaveFile(); + } + + public void tInitSaveFile() { + data.bestPlays = DBSaves.GetBestPlaysAsDict(data.SaveId); + data.tFactorizeBestPlays(); + } + + public void tLoadUnlockables() { + data.UnlockedCharacters = DBSaves.FetchStringUnlockedAsset(data.SaveId, "unlocked_characters"); + data.UnlockedPuchicharas = DBSaves.FetchStringUnlockedAsset(data.SaveId, "unlocked_puchicharas"); + data.UnlockedSongs = DBSaves.FetchStringUnlockedAsset(data.SaveId, "unlocked_songs"); + data.UnlockedNameplateIds = DBSaves.FetchUnlockedNameplateIds(data.SaveId); + data.DanTitles = DBSaves.FetchUnlockedDanTitles(data.SaveId); + } + + + #region [Medals and PlayCount] + + public void tEarnCoins(int amount) { + data.Medals += amount; + data.TotalEarnedMedals += amount; + + // Small trick here, each actual play (excluding Auto, AI, etc) are worth at least 5 coins for the player, whatever which mode it is (Dan, Tower, Taiko mode, etc) + // Earn Coins is also called once per play, so we just add 1 here to the total playcount + data.TotalPlaycount += 1; + DBSaves.AlterCoinsAndTotalPlayCount(data.SaveId, amount, 1); + } + + // Return false if the current amount of coins is to low + public bool tSpendCoins(int amount) { + if (data.Medals < amount) + return false; + + data.Medals -= amount; + DBSaves.AlterCoinsAndTotalPlayCount(data.SaveId, -amount, 0); + return true; + } + + public void tRegisterAIBattleModePlay(bool IsWon) { + data.AIBattleModePlaycount++; + if (IsWon) data.AIBattleModeWins++; + DBSaves.RegisterAIBattleModePlay(data.SaveId, IsWon); + } + + #endregion + + #region [Dan titles] + + public bool tUpdateDanTitle(string title, bool isGold, int clearStatus) { + bool changed = false; + + bool iG = isGold; + int cs = clearStatus; + + if (this.data.DanTitles == null) + this.data.DanTitles = new Dictionary(); + + if (this.data.DanTitles.ContainsKey(title)) { + if (this.data.DanTitles[title].clearStatus > cs) + cs = this.data.DanTitles[title].clearStatus; + if (this.data.DanTitles[title].isGold) + iG = true; } - public void tLoadUnlockables() { - data.UnlockedCharacters = DBSaves.FetchStringUnlockedAsset(data.SaveId, "unlocked_characters"); - data.UnlockedPuchicharas = DBSaves.FetchStringUnlockedAsset(data.SaveId, "unlocked_puchicharas"); - data.UnlockedSongs = DBSaves.FetchStringUnlockedAsset(data.SaveId, "unlocked_songs"); - data.UnlockedNameplateIds = DBSaves.FetchUnlockedNameplateIds(data.SaveId); - data.DanTitles = DBSaves.FetchUnlockedDanTitles(data.SaveId); + // Automatically set the dan to nameplate if new + // Add a function within the NamePlate.cs file to update the title texture + + if (!this.data.DanTitles.ContainsKey(title) || cs != clearStatus || iG != isGold) { + DBSaves.RegisterDanTitle(data.SaveId, title, clearStatus, isGold); + changed = true; + } + CDanTitle danTitle = new CDanTitle(iG, cs); + this.data.DanTitles[title] = danTitle; + return changed; + } + + #endregion + + #region [Auxilliary classes] + + public class CDanTitle { + public CDanTitle(bool iG, int cs) { + isGold = iG; + clearStatus = cs; } - - #region [Medals and PlayCount] - - public void tEarnCoins(int amount) { - data.Medals += amount; - data.TotalEarnedMedals += amount; - - // Small trick here, each actual play (excluding Auto, AI, etc) are worth at least 5 coins for the player, whatever which mode it is (Dan, Tower, Taiko mode, etc) - // Earn Coins is also called once per play, so we just add 1 here to the total playcount - data.TotalPlaycount += 1; - DBSaves.AlterCoinsAndTotalPlayCount(data.SaveId, amount, 1); + public CDanTitle() { + isGold = false; + clearStatus = 0; } - // Return false if the current amount of coins is to low - public bool tSpendCoins(int amount) { - if (data.Medals < amount) - return false; + [JsonProperty("isGold")] + public bool isGold; - data.Medals -= amount; - DBSaves.AlterCoinsAndTotalPlayCount(data.SaveId, -amount, 0); - return true; + [JsonProperty("clearStatus")] + public int clearStatus; + } + + public class CNamePlateTitle { + public CNamePlateTitle(int type) { + iType = type; + cld = new CLocalizationData(); } - public void tRegisterAIBattleModePlay(bool IsWon) { - data.AIBattleModePlaycount++; - if (IsWon) data.AIBattleModeWins++; - DBSaves.RegisterAIBattleModePlay(data.SaveId, IsWon); + [JsonProperty("iType")] + public int iType; + + [JsonProperty("Localization")] + public CLocalizationData cld; + } + + public class CPassStatus { + public CPassStatus() { + d = new int[5] { -1, -1, -1, -1, -1 }; } - #endregion + public int[] d; + } - #region [Dan titles] + #endregion - public bool tUpdateDanTitle(string title, bool isGold, int clearStatus) { - bool changed = false; + #region [Heya] - bool iG = isGold; - int cs = clearStatus; + public void tReindexCharacter(string[] characterNamesList) { + string character = this.data.CharacterName; - if (this.data.DanTitles == null) - this.data.DanTitles = new Dictionary(); + if (characterNamesList.Contains(character)) + this.data.Character = characterNamesList.ToList().IndexOf(character); - if (this.data.DanTitles.ContainsKey(title)) { - if (this.data.DanTitles[title].clearStatus > cs) - cs = this.data.DanTitles[title].clearStatus; - if (this.data.DanTitles[title].isGold) - iG = true; - } + } - // Automatically set the dan to nameplate if new - // Add a function within the NamePlate.cs file to update the title texture + public void tUpdateCharacterName(string newChara) { + this.data.CharacterName = newChara; + } - if (!this.data.DanTitles.ContainsKey(title) || cs != clearStatus || iG != isGold) { - DBSaves.RegisterDanTitle(data.SaveId, title, clearStatus, isGold); - changed = true; - } - CDanTitle danTitle = new CDanTitle(iG, cs); - this.data.DanTitles[title] = danTitle; - return changed; + public void tApplyHeyaChanges() { + DBSaves.ApplyChangesFromMyRoom(this); + } + + #endregion + + public class Data { + [JsonProperty("saveId")] + public Int64 SaveId = 0; + + [JsonProperty("name")] + public string Name = "プレイヤー1"; + + [JsonProperty("title")] + public string Title = "初心者"; + + [JsonProperty("dan")] + public string Dan = "新人"; + + [JsonProperty("danGold")] + public bool DanGold = false; + + [JsonProperty("danType")] + public int DanType = 0; + + [JsonProperty("titleType")] + public int TitleType = 0; + + [JsonIgnore] + public int TitleRarityInt = 1; + + [JsonIgnore] + public int TitleId = -1; + + [JsonProperty("puchiChara")] + public string PuchiChara = "0"; + + + [JsonProperty("medals")] + public Int64 Medals = 0; + + [JsonIgnore] + public Int64 TotalEarnedMedals = 0; + + [JsonIgnore] + public int TotalPlaycount = 0; + + [JsonIgnore] + public int AIBattleModePlaycount = 0; + + [JsonIgnore] + public int AIBattleModeWins = 0; + + [JsonProperty("character")] + public int Character = 0; + + [JsonProperty("characterName")] + public string CharacterName = "0"; + + [JsonProperty("danTitles")] + public Dictionary DanTitles = new Dictionary(); + + // Deprecated + [JsonProperty("namePlateTitles")] + public Dictionary NamePlateTitles = new Dictionary(); + + [JsonProperty("unlockedCharacters")] + public List UnlockedCharacters = new List(); + + [JsonProperty("unlockedPuchicharas")] + public List UnlockedPuchicharas = new List(); + + [JsonIgnore] + public List UnlockedSongs = new List(); + + [JsonIgnore] + public List UnlockedNameplateIds = new List(); + + [JsonProperty("activeTriggers")] + public HashSet ActiveTriggers = new HashSet(); + + [JsonIgnore] + public Dictionary bestPlays = new Dictionary(); + + [JsonIgnore] + public Dictionary bestPlaysDistinctCharts = new Dictionary(); + + [JsonIgnore] + public Dictionary bestPlaysDistinctSongs = new Dictionary(); + + [JsonIgnore] + public Dictionary bestPlaysSongSelectTables = new Dictionary(); + + [JsonIgnore] + public Dictionary songSelectTableEntries = new Dictionary(); + + [JsonIgnore] + public BestPlayRecords.CBestPlayStats bestPlaysStats = new BestPlayRecords.CBestPlayStats(); + + public BestPlayRecords.CSongSelectTableEntry tGetSongSelectTableEntry(string uniqueId) { + if (songSelectTableEntries.ContainsKey(uniqueId)) return songSelectTableEntries[uniqueId]; + return new BestPlayRecords.CSongSelectTableEntry(); } - #endregion + #region [Factorize best plays] - #region [Auxilliary classes] + public void tFactorizeBestPlays() { + bestPlaysDistinctCharts = new Dictionary(); - public class CDanTitle { - public CDanTitle(bool iG, int cs) { - isGold = iG; - clearStatus = cs; - } - - public CDanTitle() { - isGold = false; - clearStatus = 0; - } - - [JsonProperty("isGold")] - public bool isGold; - - [JsonProperty("clearStatus")] - public int clearStatus; - } - - public class CNamePlateTitle { - public CNamePlateTitle(int type) { - iType = type; - cld = new CLocalizationData(); - } - - [JsonProperty("iType")] - public int iType; - - [JsonProperty("Localization")] - public CLocalizationData cld; - } - - public class CPassStatus { - public CPassStatus() { - d = new int[5] { -1, -1, -1, -1, -1 }; - } - - public int[] d; - } - - #endregion - - #region [Heya] - - public void tReindexCharacter(string[] characterNamesList) { - string character = this.data.CharacterName; - - if (characterNamesList.Contains(character)) - this.data.Character = characterNamesList.ToList().IndexOf(character); - - } - - public void tUpdateCharacterName(string newChara) { - this.data.CharacterName = newChara; - } - - public void tApplyHeyaChanges() { - DBSaves.ApplyChangesFromMyRoom(this); - } - - #endregion - - public class Data { - [JsonProperty("saveId")] - public Int64 SaveId = 0; - - [JsonProperty("name")] - public string Name = "プレイヤー1"; - - [JsonProperty("title")] - public string Title = "初心者"; - - [JsonProperty("dan")] - public string Dan = "新人"; - - [JsonProperty("danGold")] - public bool DanGold = false; - - [JsonProperty("danType")] - public int DanType = 0; - - [JsonProperty("titleType")] - public int TitleType = 0; - - [JsonIgnore] - public int TitleRarityInt = 1; - - [JsonIgnore] - public int TitleId = -1; - - [JsonProperty("puchiChara")] - public string PuchiChara = "0"; - - - [JsonProperty("medals")] - public Int64 Medals = 0; - - [JsonIgnore] - public Int64 TotalEarnedMedals = 0; - - [JsonIgnore] - public int TotalPlaycount = 0; - - [JsonIgnore] - public int AIBattleModePlaycount = 0; - - [JsonIgnore] - public int AIBattleModeWins = 0; - - [JsonProperty("character")] - public int Character = 0; - - [JsonProperty("characterName")] - public string CharacterName = "0"; - - [JsonProperty("danTitles")] - public Dictionary DanTitles = new Dictionary(); - - // Deprecated - [JsonProperty("namePlateTitles")] - public Dictionary NamePlateTitles = new Dictionary(); - - [JsonProperty("unlockedCharacters")] - public List UnlockedCharacters = new List(); - - [JsonProperty("unlockedPuchicharas")] - public List UnlockedPuchicharas = new List(); - - [JsonIgnore] - public List UnlockedSongs = new List(); - - [JsonIgnore] - public List UnlockedNameplateIds = new List(); - - [JsonProperty("activeTriggers")] - public HashSet ActiveTriggers = new HashSet(); - - [JsonIgnore] - public Dictionary bestPlays = new Dictionary(); - - [JsonIgnore] - public Dictionary bestPlaysDistinctCharts = new Dictionary(); - - [JsonIgnore] - public Dictionary bestPlaysDistinctSongs = new Dictionary(); - - [JsonIgnore] - public Dictionary bestPlaysSongSelectTables = new Dictionary(); - - [JsonIgnore] - public Dictionary songSelectTableEntries = new Dictionary(); - - [JsonIgnore] - public BestPlayRecords.CBestPlayStats bestPlaysStats = new BestPlayRecords.CBestPlayStats(); - - public BestPlayRecords.CSongSelectTableEntry tGetSongSelectTableEntry(string uniqueId) { - if (songSelectTableEntries.ContainsKey(uniqueId)) return songSelectTableEntries[uniqueId]; - return new BestPlayRecords.CSongSelectTableEntry(); - } - - #region [Factorize best plays] - - public void tFactorizeBestPlays() { - bestPlaysDistinctCharts = new Dictionary(); - - foreach (BestPlayRecords.CBestPlayRecord bestPlay in bestPlays.Values) { - string key = bestPlay.ChartUniqueId + bestPlay.ChartDifficulty.ToString(); - if (!bestPlaysDistinctCharts.ContainsKey(key)) { - bestPlaysDistinctCharts[key] = bestPlay.Copy(); - } else { - if (bestPlay.HighScore > bestPlaysDistinctCharts[key].HighScore) { - bestPlaysDistinctCharts[key].HighScore = bestPlay.HighScore; - bestPlaysDistinctCharts[key].HighScoreGoodCount = bestPlay.HighScoreGoodCount; - bestPlaysDistinctCharts[key].HighScoreOkCount = bestPlay.HighScoreOkCount; - bestPlaysDistinctCharts[key].HighScoreBadCount = bestPlay.HighScoreBadCount; - bestPlaysDistinctCharts[key].HighScoreRollCount = bestPlay.HighScoreRollCount; - bestPlaysDistinctCharts[key].HighScoreBoomCount = bestPlay.HighScoreBoomCount; - bestPlaysDistinctCharts[key].HighScoreMaxCombo = bestPlay.HighScoreMaxCombo; - bestPlaysDistinctCharts[key].HighScoreADLibCount = bestPlay.HighScoreADLibCount; - } - bestPlaysDistinctCharts[key].ScoreRank = Math.Max(bestPlaysDistinctCharts[key].ScoreRank, bestPlay.ScoreRank); - bestPlaysDistinctCharts[key].ClearStatus = Math.Max(bestPlaysDistinctCharts[key].ClearStatus, bestPlay.ClearStatus); + foreach (BestPlayRecords.CBestPlayRecord bestPlay in bestPlays.Values) { + string key = bestPlay.ChartUniqueId + bestPlay.ChartDifficulty.ToString(); + if (!bestPlaysDistinctCharts.ContainsKey(key)) { + bestPlaysDistinctCharts[key] = bestPlay.Copy(); + } else { + if (bestPlay.HighScore > bestPlaysDistinctCharts[key].HighScore) { + bestPlaysDistinctCharts[key].HighScore = bestPlay.HighScore; + bestPlaysDistinctCharts[key].HighScoreGoodCount = bestPlay.HighScoreGoodCount; + bestPlaysDistinctCharts[key].HighScoreOkCount = bestPlay.HighScoreOkCount; + bestPlaysDistinctCharts[key].HighScoreBadCount = bestPlay.HighScoreBadCount; + bestPlaysDistinctCharts[key].HighScoreRollCount = bestPlay.HighScoreRollCount; + bestPlaysDistinctCharts[key].HighScoreBoomCount = bestPlay.HighScoreBoomCount; + bestPlaysDistinctCharts[key].HighScoreMaxCombo = bestPlay.HighScoreMaxCombo; + bestPlaysDistinctCharts[key].HighScoreADLibCount = bestPlay.HighScoreADLibCount; } + bestPlaysDistinctCharts[key].ScoreRank = Math.Max(bestPlaysDistinctCharts[key].ScoreRank, bestPlay.ScoreRank); + bestPlaysDistinctCharts[key].ClearStatus = Math.Max(bestPlaysDistinctCharts[key].ClearStatus, bestPlay.ClearStatus); + } + } + + bestPlaysDistinctSongs = new Dictionary(); + songSelectTableEntries = new Dictionary(); + + foreach (BestPlayRecords.CBestPlayRecord bestPlay in bestPlaysDistinctCharts.Values) { + string key = bestPlay.ChartUniqueId; + if (!bestPlaysDistinctSongs.ContainsKey(key)) { + bestPlaysDistinctSongs[key] = bestPlay.Copy(); + } else { + if (bestPlay.HighScore > bestPlaysDistinctSongs[key].HighScore) { + bestPlaysDistinctSongs[key].HighScore = bestPlay.HighScore; + bestPlaysDistinctSongs[key].HighScoreGoodCount = bestPlay.HighScoreGoodCount; + bestPlaysDistinctSongs[key].HighScoreOkCount = bestPlay.HighScoreOkCount; + bestPlaysDistinctSongs[key].HighScoreBadCount = bestPlay.HighScoreBadCount; + bestPlaysDistinctSongs[key].HighScoreRollCount = bestPlay.HighScoreRollCount; + bestPlaysDistinctSongs[key].HighScoreBoomCount = bestPlay.HighScoreBoomCount; + bestPlaysDistinctSongs[key].HighScoreMaxCombo = bestPlay.HighScoreMaxCombo; + bestPlaysDistinctSongs[key].HighScoreADLibCount = bestPlay.HighScoreADLibCount; + } + bestPlaysDistinctSongs[key].ScoreRank = Math.Max(bestPlaysDistinctSongs[key].ScoreRank, bestPlay.ScoreRank); + bestPlaysDistinctSongs[key].ClearStatus = Math.Max(bestPlaysDistinctSongs[key].ClearStatus, bestPlay.ClearStatus); } - bestPlaysDistinctSongs = new Dictionary(); - songSelectTableEntries = new Dictionary(); - - foreach (BestPlayRecords.CBestPlayRecord bestPlay in bestPlaysDistinctCharts.Values) { - string key = bestPlay.ChartUniqueId; - if (!bestPlaysDistinctSongs.ContainsKey(key)) { - bestPlaysDistinctSongs[key] = bestPlay.Copy(); - } else { - if (bestPlay.HighScore > bestPlaysDistinctSongs[key].HighScore) { - bestPlaysDistinctSongs[key].HighScore = bestPlay.HighScore; - bestPlaysDistinctSongs[key].HighScoreGoodCount = bestPlay.HighScoreGoodCount; - bestPlaysDistinctSongs[key].HighScoreOkCount = bestPlay.HighScoreOkCount; - bestPlaysDistinctSongs[key].HighScoreBadCount = bestPlay.HighScoreBadCount; - bestPlaysDistinctSongs[key].HighScoreRollCount = bestPlay.HighScoreRollCount; - bestPlaysDistinctSongs[key].HighScoreBoomCount = bestPlay.HighScoreBoomCount; - bestPlaysDistinctSongs[key].HighScoreMaxCombo = bestPlay.HighScoreMaxCombo; - bestPlaysDistinctSongs[key].HighScoreADLibCount = bestPlay.HighScoreADLibCount; - } - bestPlaysDistinctSongs[key].ScoreRank = Math.Max(bestPlaysDistinctSongs[key].ScoreRank, bestPlay.ScoreRank); - bestPlaysDistinctSongs[key].ClearStatus = Math.Max(bestPlaysDistinctSongs[key].ClearStatus, bestPlay.ClearStatus); - } - - // Entries to replace score.GPInfo on the song select menus - if (!songSelectTableEntries.ContainsKey(key)) { - songSelectTableEntries[key] = new BestPlayRecords.CSongSelectTableEntry(); - } - if (bestPlay.ChartDifficulty > songSelectTableEntries[key].ScoreRankDifficulty && bestPlay.ScoreRank >= 0) { - songSelectTableEntries[key].ScoreRankDifficulty = (int)bestPlay.ChartDifficulty; - songSelectTableEntries[key].ScoreRank = (int)bestPlay.ScoreRank; - } - if (bestPlay.ChartDifficulty > songSelectTableEntries[key].ClearStatusDifficulty && bestPlay.ClearStatus >= 0) { - songSelectTableEntries[key].ClearStatusDifficulty = (int)bestPlay.ChartDifficulty; - songSelectTableEntries[key].ClearStatus = (int)bestPlay.ClearStatus; - } - if ((int)bestPlay.ChartDifficulty == (int)Difficulty.Tower) songSelectTableEntries[key].TowerReachedFloor = (int)bestPlay.TowerBestFloor; - songSelectTableEntries[key].HighScore[(int)bestPlay.ChartDifficulty] = (int)bestPlay.HighScore; - songSelectTableEntries[key].ScoreRanks[(int)bestPlay.ChartDifficulty] = (int)bestPlay.ScoreRank + 1; // 0 start - songSelectTableEntries[key].ClearStatuses[(int)bestPlay.ChartDifficulty] = (int)bestPlay.ClearStatus + 1; // 0 start + // Entries to replace score.GPInfo on the song select menus + if (!songSelectTableEntries.ContainsKey(key)) { + songSelectTableEntries[key] = new BestPlayRecords.CSongSelectTableEntry(); } - - bestPlaysStats = BestPlayRecords.tGenerateBestPlayStats(bestPlaysDistinctCharts.Values, bestPlaysDistinctSongs.Values); + if (bestPlay.ChartDifficulty > songSelectTableEntries[key].ScoreRankDifficulty && bestPlay.ScoreRank >= 0) { + songSelectTableEntries[key].ScoreRankDifficulty = (int)bestPlay.ChartDifficulty; + songSelectTableEntries[key].ScoreRank = (int)bestPlay.ScoreRank; + } + if (bestPlay.ChartDifficulty > songSelectTableEntries[key].ClearStatusDifficulty && bestPlay.ClearStatus >= 0) { + songSelectTableEntries[key].ClearStatusDifficulty = (int)bestPlay.ChartDifficulty; + songSelectTableEntries[key].ClearStatus = (int)bestPlay.ClearStatus; + } + if ((int)bestPlay.ChartDifficulty == (int)Difficulty.Tower) songSelectTableEntries[key].TowerReachedFloor = (int)bestPlay.TowerBestFloor; + songSelectTableEntries[key].HighScore[(int)bestPlay.ChartDifficulty] = (int)bestPlay.HighScore; + songSelectTableEntries[key].ScoreRanks[(int)bestPlay.ChartDifficulty] = (int)bestPlay.ScoreRank + 1; // 0 start + songSelectTableEntries[key].ClearStatuses[(int)bestPlay.ChartDifficulty] = (int)bestPlay.ClearStatus + 1; // 0 start } - #endregion - } - - public Data data = new Data(); - public string path = "Save.json"; - public string name = "Save"; - - #region [private] - - private void tSaveFile() { - ConfigManager.SaveConfig(data, path); - } - - private void tLoadFile() { - data = ConfigManager.GetConfig(path); + bestPlaysStats = BestPlayRecords.tGenerateBestPlayStats(bestPlaysDistinctCharts.Values, bestPlaysDistinctSongs.Values); } #endregion } + + public Data data = new Data(); + public string path = "Save.json"; + public string name = "Save"; + + #region [private] + + private void tSaveFile() { + ConfigManager.SaveConfig(data, path); + } + + private void tLoadFile() { + data = ConfigManager.GetConfig(path); + } + + #endregion } diff --git a/OpenTaiko/src/Common/TitleTextureKey.cs b/OpenTaiko/src/Common/TitleTextureKey.cs index 7a2f41c9..8470f89d 100644 --- a/OpenTaiko/src/Common/TitleTextureKey.cs +++ b/OpenTaiko/src/Common/TitleTextureKey.cs @@ -1,137 +1,136 @@ using FDK; using Color = System.Drawing.Color; -namespace OpenTaiko { +namespace OpenTaiko; - public sealed class TitleTextureKey { +public sealed class TitleTextureKey { - // Static - private static readonly Dictionary _titledictionary - = new Dictionary(); + // Static + private static readonly Dictionary _titledictionary + = new Dictionary(); - public static CTexture ResolveTitleTexture(TitleTextureKey titleTextureKey) { - if (titleTextureKey == null) return null; - if (!_titledictionary.TryGetValue(titleTextureKey, out var texture)) { - texture = GenerateTitleTexture(titleTextureKey); - _titledictionary.Add(titleTextureKey, texture); + public static CTexture ResolveTitleTexture(TitleTextureKey titleTextureKey) { + if (titleTextureKey == null) return null; + if (!_titledictionary.TryGetValue(titleTextureKey, out var texture)) { + texture = GenerateTitleTexture(titleTextureKey); + _titledictionary.Add(titleTextureKey, texture); + } + + return texture; + } + + public static CTexture ResolveTitleTexture(TitleTextureKey titleTextureKey, bool bVertical, bool keepCenter = false) { + if (titleTextureKey == null) return null; + if (!_titledictionary.TryGetValue(titleTextureKey, out var texture)) { + if (bVertical) + texture = GenerateTitleTextureTate(titleTextureKey, keepCenter); + else + texture = GenerateTitleTexture(titleTextureKey, keepCenter); + _titledictionary.Add(titleTextureKey, texture); + } + + return texture; + } + + public static CTexture ResolveTitleTextureTate(TitleTextureKey titleTextureKey) { + if (titleTextureKey == null) return null; + if (!_titledictionary.TryGetValue(titleTextureKey, out var texture)) { + texture = GenerateTitleTextureTate(titleTextureKey); + _titledictionary.Add(titleTextureKey, texture); + } + + return texture; + } + + private static CTexture GenerateTitleTextureTate(TitleTextureKey titleTextureKey, bool keepCenter = false) { + if (titleTextureKey == null) return null; + using (var bmp = titleTextureKey.cPrivateFastFont.DrawText_V( + titleTextureKey.str, titleTextureKey.forecolor, titleTextureKey.backcolor, titleTextureKey.secondEdge, 30, keepCenter)) { + CTexture tx文字テクスチャ = OpenTaiko.tテクスチャの生成(bmp, false); + if (tx文字テクスチャ.szTextureSize.Height > titleTextureKey.maxWidth) { + //tx文字テクスチャ.vc拡大縮小倍率.X = (float)(((double)titleTextureKey.maxWidth) / tx文字テクスチャ.szテクスチャサイズ.Height); + tx文字テクスチャ.vcScaleRatio.X = 1.0f; + tx文字テクスチャ.vcScaleRatio.Y = (float)(((double)titleTextureKey.maxWidth) / tx文字テクスチャ.szTextureSize.Height); } - return texture; - } - - public static CTexture ResolveTitleTexture(TitleTextureKey titleTextureKey, bool bVertical, bool keepCenter = false) { - if (titleTextureKey == null) return null; - if (!_titledictionary.TryGetValue(titleTextureKey, out var texture)) { - if (bVertical) - texture = GenerateTitleTextureTate(titleTextureKey, keepCenter); - else - texture = GenerateTitleTexture(titleTextureKey, keepCenter); - _titledictionary.Add(titleTextureKey, texture); - } - - return texture; - } - - public static CTexture ResolveTitleTextureTate(TitleTextureKey titleTextureKey) { - if (titleTextureKey == null) return null; - if (!_titledictionary.TryGetValue(titleTextureKey, out var texture)) { - texture = GenerateTitleTextureTate(titleTextureKey); - _titledictionary.Add(titleTextureKey, texture); - } - - return texture; - } - - private static CTexture GenerateTitleTextureTate(TitleTextureKey titleTextureKey, bool keepCenter = false) { - if (titleTextureKey == null) return null; - using (var bmp = titleTextureKey.cPrivateFastFont.DrawText_V( - titleTextureKey.str, titleTextureKey.forecolor, titleTextureKey.backcolor, titleTextureKey.secondEdge, 30, keepCenter)) { - CTexture tx文字テクスチャ = OpenTaiko.tテクスチャの生成(bmp, false); - if (tx文字テクスチャ.szTextureSize.Height > titleTextureKey.maxWidth) { - //tx文字テクスチャ.vc拡大縮小倍率.X = (float)(((double)titleTextureKey.maxWidth) / tx文字テクスチャ.szテクスチャサイズ.Height); - tx文字テクスチャ.vcScaleRatio.X = 1.0f; - tx文字テクスチャ.vcScaleRatio.Y = (float)(((double)titleTextureKey.maxWidth) / tx文字テクスチャ.szTextureSize.Height); - } - - return tx文字テクスチャ; - } - } - - private static CTexture GenerateTitleTexture(TitleTextureKey titleTextureKey, bool keepCenter = false) { - if (titleTextureKey == null) return null; - using (var bmp = titleTextureKey.cPrivateFastFont.DrawText( - titleTextureKey.str, titleTextureKey.forecolor, titleTextureKey.backcolor, titleTextureKey.secondEdge, 30, keepCenter)) { - CTexture tx文字テクスチャ = OpenTaiko.tテクスチャの生成(bmp, false); - if (tx文字テクスチャ.szTextureSize.Width > titleTextureKey.maxWidth) { - tx文字テクスチャ.vcScaleRatio.X = (float)(((double)titleTextureKey.maxWidth) / tx文字テクスチャ.szTextureSize.Width); - tx文字テクスチャ.vcScaleRatio.Y = 1.0f;// (float) (((double) titleTextureKey.maxWidth) / tx文字テクスチャ.szテクスチャサイズ.Width); - - } - - return tx文字テクスチャ; - } - } - - private static void ClearTitleTextureCache() { - // Was initially used when disposing the song select screen (at the end of the program), probably unused - foreach (var titleTexture in _titledictionary.Values) { - titleTexture.Dispose(); - } - - _titledictionary.Clear(); - } - - // Non-static - public readonly string str; - public readonly CCachedFontRenderer cPrivateFastFont; - public readonly Color forecolor; - public readonly Color backcolor; - public readonly int maxWidth; - public readonly Color? secondEdge; - - public TitleTextureKey(string str文字, CCachedFontRenderer cPrivateFastFont, Color forecolor, Color backcolor, int maxHeight, Color? secondEdge = null) { - this.str = str文字; - this.cPrivateFastFont = cPrivateFastFont; - this.forecolor = forecolor; - this.backcolor = backcolor; - this.maxWidth = maxHeight; - this.secondEdge = secondEdge; - } - - private bool Equals(TitleTextureKey other) { - return string.Equals(str, other.str) && - cPrivateFastFont.Equals(other.cPrivateFastFont) && - forecolor.Equals(other.forecolor) && - backcolor.Equals(other.backcolor) && - secondEdge.Equals(other.secondEdge) && - maxWidth == other.maxWidth; - } - - public override bool Equals(object obj) { - if (ReferenceEquals(null, obj)) return false; - if (ReferenceEquals(this, obj)) return true; - return obj is TitleTextureKey other && Equals(other); - } - - public override int GetHashCode() { - unchecked { - var hashCode = str.GetHashCode(); - hashCode = (hashCode * 397) ^ cPrivateFastFont.GetHashCode(); - hashCode = (hashCode * 397) ^ forecolor.GetHashCode(); - hashCode = (hashCode * 397) ^ backcolor.GetHashCode(); - hashCode = (hashCode * 397) ^ maxWidth; - if (secondEdge != null) - hashCode = (hashCode * 397) ^ secondEdge.GetHashCode(); - return hashCode; - } - } - - public static bool operator ==(TitleTextureKey left, TitleTextureKey right) { - return Equals(left, right); - } - - public static bool operator !=(TitleTextureKey left, TitleTextureKey right) { - return !Equals(left, right); + return tx文字テクスチャ; } } + + private static CTexture GenerateTitleTexture(TitleTextureKey titleTextureKey, bool keepCenter = false) { + if (titleTextureKey == null) return null; + using (var bmp = titleTextureKey.cPrivateFastFont.DrawText( + titleTextureKey.str, titleTextureKey.forecolor, titleTextureKey.backcolor, titleTextureKey.secondEdge, 30, keepCenter)) { + CTexture tx文字テクスチャ = OpenTaiko.tテクスチャの生成(bmp, false); + if (tx文字テクスチャ.szTextureSize.Width > titleTextureKey.maxWidth) { + tx文字テクスチャ.vcScaleRatio.X = (float)(((double)titleTextureKey.maxWidth) / tx文字テクスチャ.szTextureSize.Width); + tx文字テクスチャ.vcScaleRatio.Y = 1.0f;// (float) (((double) titleTextureKey.maxWidth) / tx文字テクスチャ.szテクスチャサイズ.Width); + + } + + return tx文字テクスチャ; + } + } + + private static void ClearTitleTextureCache() { + // Was initially used when disposing the song select screen (at the end of the program), probably unused + foreach (var titleTexture in _titledictionary.Values) { + titleTexture.Dispose(); + } + + _titledictionary.Clear(); + } + + // Non-static + public readonly string str; + public readonly CCachedFontRenderer cPrivateFastFont; + public readonly Color forecolor; + public readonly Color backcolor; + public readonly int maxWidth; + public readonly Color? secondEdge; + + public TitleTextureKey(string str文字, CCachedFontRenderer cPrivateFastFont, Color forecolor, Color backcolor, int maxHeight, Color? secondEdge = null) { + this.str = str文字; + this.cPrivateFastFont = cPrivateFastFont; + this.forecolor = forecolor; + this.backcolor = backcolor; + this.maxWidth = maxHeight; + this.secondEdge = secondEdge; + } + + private bool Equals(TitleTextureKey other) { + return string.Equals(str, other.str) && + cPrivateFastFont.Equals(other.cPrivateFastFont) && + forecolor.Equals(other.forecolor) && + backcolor.Equals(other.backcolor) && + secondEdge.Equals(other.secondEdge) && + maxWidth == other.maxWidth; + } + + public override bool Equals(object obj) { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj is TitleTextureKey other && Equals(other); + } + + public override int GetHashCode() { + unchecked { + var hashCode = str.GetHashCode(); + hashCode = (hashCode * 397) ^ cPrivateFastFont.GetHashCode(); + hashCode = (hashCode * 397) ^ forecolor.GetHashCode(); + hashCode = (hashCode * 397) ^ backcolor.GetHashCode(); + hashCode = (hashCode * 397) ^ maxWidth; + if (secondEdge != null) + hashCode = (hashCode * 397) ^ secondEdge.GetHashCode(); + return hashCode; + } + } + + public static bool operator ==(TitleTextureKey left, TitleTextureKey right) { + return Equals(left, right); + } + + public static bool operator !=(TitleTextureKey left, TitleTextureKey right) { + return !Equals(left, right); + } } diff --git a/OpenTaiko/src/Components/CGimmickValue.cs b/OpenTaiko/src/Components/CGimmickValue.cs index a504b8a7..736a76a0 100644 --- a/OpenTaiko/src/Components/CGimmickValue.cs +++ b/OpenTaiko/src/Components/CGimmickValue.cs @@ -1,4 +1,4 @@ -namespace OpenTaiko { - internal class CGimmickValue { - } +namespace OpenTaiko; + +internal class CGimmickValue { } diff --git a/OpenTaiko/src/Components/CLocalizationData.cs b/OpenTaiko/src/Components/CLocalizationData.cs index 62108857..b511f791 100644 --- a/OpenTaiko/src/Components/CLocalizationData.cs +++ b/OpenTaiko/src/Components/CLocalizationData.cs @@ -1,26 +1,26 @@ using Newtonsoft.Json; -namespace OpenTaiko { - [Serializable] - internal class CLocalizationData { - [JsonProperty("strings")] - private Dictionary Strings = new Dictionary(); +namespace OpenTaiko; - public CLocalizationData() { - Strings = new Dictionary(); - } +[Serializable] +internal class CLocalizationData { + [JsonProperty("strings")] + private Dictionary Strings = new Dictionary(); - public string GetString(string defaultsDefault) { - string _lang = CLangManager.fetchLang(); - if (Strings.ContainsKey(_lang)) - return Strings[_lang]; - else if (Strings.ContainsKey("default")) - return Strings["default"]; - return defaultsDefault; - } + public CLocalizationData() { + Strings = new Dictionary(); + } - public void SetString(string langcode, string str) { - Strings[langcode] = str; - } + public string GetString(string defaultsDefault) { + string _lang = CLangManager.fetchLang(); + if (Strings.ContainsKey(_lang)) + return Strings[_lang]; + else if (Strings.ContainsKey("default")) + return Strings["default"]; + return defaultsDefault; + } + + public void SetString(string langcode, string str) { + Strings[langcode] = str; } } diff --git a/OpenTaiko/src/Components/CSongReplay.cs b/OpenTaiko/src/Components/CSongReplay.cs index 4534f198..3ba785a0 100644 --- a/OpenTaiko/src/Components/CSongReplay.cs +++ b/OpenTaiko/src/Components/CSongReplay.cs @@ -1,481 +1,481 @@ -namespace OpenTaiko { - class CSongReplay { - /* Game version used for the replay - * 521 = 0.5.2.1 - * 530 = 0.5.3 - * 531 = 0.5.3.1 - * 540 = 0.5.4 - * 600 = 0.6.0 - * 700 = 0.7.0 - * 1000 = 1.0.0 - */ - public int STORED_GAME_VERSION = 600; - public string REPLAY_FOLDER_NAME = "Replay"; +namespace OpenTaiko; - /* Mod Flags - * Bit Offsets (Values) : - * - 0 (1) : Mirror - * - 1 (2) : Random (Kimagure) - * - 2 (4) : Super Random (Detarame) - * - 3 (8) : Invisible (Doron) - * - 4 (16) : Perfect memory (Stealth) - * - 5 (32) : Avalanche - * - 6 (64) : Minesweeper - * - 7 (128) : Just (Ok => Bad) - * - 8 (256) : Safe (Bad => Ok) - */ - [Flags] - public enum EModFlag { - None = 0, - Mirror = 1 << 0, - Random = 1 << 1, - SuperRandom = 1 << 2, - Invisible = 1 << 3, - PerfectMemory = 1 << 4, - Avalanche = 1 << 5, - Minesweeper = 1 << 6, - Just = 1 << 7, - Safe = 1 << 8 - } +class CSongReplay { + /* Game version used for the replay + * 521 = 0.5.2.1 + * 530 = 0.5.3 + * 531 = 0.5.3.1 + * 540 = 0.5.4 + * 600 = 0.6.0 + * 700 = 0.7.0 + * 1000 = 1.0.0 + */ + public int STORED_GAME_VERSION = 600; + public string REPLAY_FOLDER_NAME = "Replay"; - public CSongReplay() { - replayFolder = ""; - storedPlayer = 0; - } - - public CSongReplay(string ChartPath, int player) { - string _chartFolder = Path.GetDirectoryName(ChartPath); - replayFolder = Path.Combine(_chartFolder, REPLAY_FOLDER_NAME); - - try { - Directory.CreateDirectory(replayFolder); - - Console.WriteLine("Folder Path: " + replayFolder); - } catch (Exception ex) { - Console.WriteLine("An error occurred: " + ex.Message); - } - - storedPlayer = player; - } - - public void tRegisterInput(double timestamp, byte keypress) { - allInputs.Add(Tuple.Create(timestamp, keypress)); - } - - #region [Dan methods] - - public void tDanRegisterSongCount(int songCount) { - DanSongCount = songCount; - IndividualGoodCount = new int[songCount]; - IndividualOkCount = new int[songCount]; - IndividualBadCount = new int[songCount]; - IndividualRollCount = new int[songCount]; - IndividualMaxCombo = new int[songCount]; - IndividualBoomCount = new int[songCount]; - IndividualADLibCount = new int[songCount]; - IndividualScore = new int[songCount]; - } - - public void tDanInputSongResults(int songNo) { - if (songNo >= DanSongCount) return; - if (songNo < 0) return; - IndividualGoodCount[songNo] = OpenTaiko.stage演奏ドラム画面.n良[songNo]; - IndividualOkCount[songNo] = OpenTaiko.stage演奏ドラム画面.n可[songNo]; - IndividualBadCount[songNo] = OpenTaiko.stage演奏ドラム画面.n不可[songNo]; - IndividualRollCount[songNo] = OpenTaiko.stage演奏ドラム画面.n連打[songNo]; - IndividualMaxCombo[songNo] = OpenTaiko.stage演奏ドラム画面.nHighestCombo[songNo]; - IndividualBoomCount[songNo] = OpenTaiko.stage演奏ドラム画面.nMine[songNo]; - IndividualADLibCount[songNo] = OpenTaiko.stage演奏ドラム画面.nADLIB[songNo]; - danAccumulatedScore = 0; - for (int acc = 0; acc < songNo; acc++) danAccumulatedScore += IndividualScore[acc]; - IndividualScore[songNo] = (int)OpenTaiko.stage演奏ドラム画面.actScore.GetScore(0) - danAccumulatedScore; - } - - #endregion - - #region [Load methods] - - private List> ConvertByteArrayToTupleList(byte[] byteArray) { - List> tupleList = new List>(); - - for (int i = 0; i < byteArray.Length; i += sizeof(double) + sizeof(byte)) { - double doubleValue = BitConverter.ToDouble(byteArray, i); - byte byteValue = byteArray[i + sizeof(double)]; - tupleList.Add(Tuple.Create(doubleValue, byteValue)); - } - - return tupleList; - } - - public void tLoadReplayFile(string optkrFilePath) { - try { - using (FileStream fileStream = new FileStream(optkrFilePath, FileMode.Open)) { - using (BinaryReader reader = new BinaryReader(fileStream)) { - GameMode = reader.ReadByte(); - GameVersion = reader.ReadInt32(); - ChartChecksum = reader.ReadString(); - PlayerName = reader.ReadString(); - GoodCount = reader.ReadInt32(); - OkCount = reader.ReadInt32(); - BadCount = reader.ReadInt32(); - RollCount = reader.ReadInt32(); - MaxCombo = reader.ReadInt32(); - BoomCount = reader.ReadInt32(); - ADLibCount = reader.ReadInt32(); - Score = reader.ReadInt32(); - CoinValue = reader.ReadInt16(); - ReachedFloor = reader.ReadInt32(); - RemainingLives = reader.ReadInt32(); - DanSongCount = reader.ReadInt32(); - for (int i = 0; i < DanSongCount; i++) { - IndividualGoodCount[i] = reader.ReadInt32(); - IndividualOkCount[i] = reader.ReadInt32(); - IndividualBadCount[i] = reader.ReadInt32(); - IndividualRollCount[i] = reader.ReadInt32(); - IndividualMaxCombo[i] = reader.ReadInt32(); - IndividualBoomCount[i] = reader.ReadInt32(); - IndividualADLibCount[i] = reader.ReadInt32(); - IndividualScore[i] = reader.ReadInt32(); - } - ClearStatus = reader.ReadByte(); - ScoreRank = reader.ReadByte(); - ScrollSpeedValue = reader.ReadInt32(); - SongSpeedValue = reader.ReadInt32(); - JudgeStrictnessAdjust = reader.ReadInt32(); - ModFlags = reader.ReadInt32(); - GaugeType = reader.ReadByte(); - GaugeFill = reader.ReadSingle(); - Timestamp = reader.ReadInt64(); - CompressedInputsSize = reader.ReadInt32(); - CompressedInputs = reader.ReadBytes(CompressedInputsSize); - var uncomp = SevenZip.Compression.LZMA.SevenZipHelper.Decompress(CompressedInputs); - allInputs = ConvertByteArrayToTupleList(uncomp); - ChartUniqueID = reader.ReadString(); - ChartDifficulty = reader.ReadByte(); - ChartLevel = reader.ReadByte(); - OnlineScoreID = reader.ReadInt64(); - } - } - } catch (Exception ex) { - - } - } - - #endregion - - #region [Save methods] - - private byte[] ConvertTupleListToByteArray(List> tupleList) { - List byteArray = new List(); - - foreach (var tuple in tupleList) { - byte[] doubleBytes = BitConverter.GetBytes(tuple.Item1); - byteArray.AddRange(doubleBytes); - byteArray.Add(tuple.Item2); - } - - return byteArray.ToArray(); - } - - public void tSaveReplayFile() { - string _path = replayFolder + @"/Replay_" + ChartUniqueID + @"_" + PlayerName + @"_" + Timestamp.ToString() + @".optkr"; - - try { - using (FileStream fileStream = new FileStream(_path, FileMode.Create)) { - using (BinaryWriter writer = new BinaryWriter(fileStream)) { - writer.Write(GameMode); - writer.Write(GameVersion); - writer.Write(ChartChecksum); - writer.Write(PlayerName); - writer.Write(GoodCount); - writer.Write(OkCount); - writer.Write(BadCount); - writer.Write(RollCount); - writer.Write(MaxCombo); - writer.Write(BoomCount); - writer.Write(ADLibCount); - writer.Write(Score); - writer.Write(CoinValue); - writer.Write(ReachedFloor); - writer.Write(RemainingLives); - writer.Write(DanSongCount); - for (int i = 0; i < DanSongCount; i++) { - writer.Write(IndividualGoodCount[i]); - writer.Write(IndividualOkCount[i]); - writer.Write(IndividualBadCount[i]); - writer.Write(IndividualRollCount[i]); - writer.Write(IndividualMaxCombo[i]); - writer.Write(IndividualBoomCount[i]); - writer.Write(IndividualADLibCount[i]); - writer.Write(IndividualScore[i]); - } - writer.Write(ClearStatus); - writer.Write(ScoreRank); - writer.Write(ScrollSpeedValue); - writer.Write(SongSpeedValue); - writer.Write(JudgeStrictnessAdjust); - writer.Write(ModFlags); - writer.Write(GaugeType); - writer.Write(GaugeFill); - writer.Write(Timestamp); - writer.Write(CompressedInputsSize); - writer.Write(CompressedInputs); - writer.Write(ChartUniqueID); - writer.Write(ChartDifficulty); - writer.Write(ChartLevel); - writer.Write(OnlineScoreID); - } - } - } catch (Exception ex) { - - } - } - - public void tResultsRegisterReplayInformations(int Coins, int Clear, int SRank) { - // Actual player (Used for saved informations) - int actualPlayer = OpenTaiko.GetActualPlayer(storedPlayer); - - // Game mode - switch (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0]) { - case (int)Difficulty.Dan: - GameMode = 1; - break; - case (int)Difficulty.Tower: - GameMode = 2; - break; - default: - GameMode = 0; - break; - } - // Game version - GameVersion = STORED_GAME_VERSION; - // Chart Checksum (temporary) - ChartChecksum = ""; - // Player Name - PlayerName = OpenTaiko.SaveFileInstances[actualPlayer].data.Name; - // Performance informations - GoodCount = OpenTaiko.stage演奏ドラム画面.CChartScore[storedPlayer].nGreat; - OkCount = OpenTaiko.stage演奏ドラム画面.CChartScore[storedPlayer].nGood; - BadCount = OpenTaiko.stage演奏ドラム画面.CChartScore[storedPlayer].nMiss; - RollCount = OpenTaiko.stage演奏ドラム画面.GetRoll(storedPlayer); - MaxCombo = OpenTaiko.stage演奏ドラム画面.actCombo.n現在のコンボ数.最高値[storedPlayer]; - BoomCount = OpenTaiko.stage演奏ドラム画面.CChartScore[storedPlayer].nMine; - ADLibCount = OpenTaiko.stage演奏ドラム画面.CChartScore[storedPlayer].nADLIB; - Score = OpenTaiko.stage演奏ドラム画面.CChartScore[storedPlayer].nScore; - CoinValue = (short)Coins; - // Tower parameters - if (GameMode == 2) { - ReachedFloor = CFloorManagement.LastRegisteredFloor; - RemainingLives = CFloorManagement.CurrentNumberOfLives; - } - // Clear status - ClearStatus = (byte)Clear; - // Score rank - ScoreRank = (byte)SRank; - // Scroll speed value (as on ConfigIni, 9 is x1) - ScrollSpeedValue = OpenTaiko.ConfigIni.nScrollSpeed[actualPlayer]; - // Song speed value (as on ConfigIni, 20 is x1) - SongSpeedValue = OpenTaiko.ConfigIni.nSongSpeed; - // Just strictess adjust mod value (as on ConfigIni, between -2 for lenient and 2 for rigorous) - JudgeStrictnessAdjust = OpenTaiko.ConfigIni.nTimingZones[actualPlayer]; - - /* Mod Flags - * Bit Offsets (Values) : - * - 0 (1) : Mirror - * - 1 (2) : Random (Kimagure) - * - 2 (4) : Super Random (Detarame) - * - 3 (8) : Invisible (Doron) - * - 4 (16) : Perfect memory (Stealth) - * - 5 (32) : Avalanche - * - 6 (64) : Minesweeper - * - 7 (128) : Just (Ok => Bad) - * - 8 (256) : Safe (Bad => Ok) - */ - ModFlags = (int)EModFlag.None; - if (OpenTaiko.ConfigIni.eRandom[actualPlayer] == ERandomMode.Mirror) ModFlags |= (int)EModFlag.Mirror; - if (OpenTaiko.ConfigIni.eRandom[actualPlayer] == ERandomMode.Random) ModFlags |= (int)EModFlag.Random; - if (OpenTaiko.ConfigIni.eRandom[actualPlayer] == ERandomMode.SuperRandom) ModFlags |= (int)EModFlag.SuperRandom; - if (OpenTaiko.ConfigIni.eRandom[actualPlayer] == ERandomMode.MirrorRandom) ModFlags |= ((int)EModFlag.Random | (int)EModFlag.Mirror); - if (OpenTaiko.ConfigIni.eSTEALTH[actualPlayer] == EStealthMode.Doron) ModFlags |= (int)EModFlag.Invisible; - if (OpenTaiko.ConfigIni.eSTEALTH[actualPlayer] == EStealthMode.Stealth) ModFlags |= (int)EModFlag.PerfectMemory; - if (OpenTaiko.ConfigIni.nFunMods[actualPlayer] == EFunMods.Avalanche) ModFlags |= (int)EModFlag.Avalanche; - if (OpenTaiko.ConfigIni.nFunMods[actualPlayer] == EFunMods.Minesweeper) ModFlags |= (int)EModFlag.Minesweeper; - if (OpenTaiko.ConfigIni.bJust[actualPlayer] == 1) ModFlags |= (int)EModFlag.Just; - if (OpenTaiko.ConfigIni.bJust[actualPlayer] == 2) ModFlags |= (int)EModFlag.Safe; - /* Gauge type - * - 0 : Normal - * - 1 : Hard - * - 2 : Extreme - */ - var chara = OpenTaiko.Tx.Characters[OpenTaiko.SaveFileInstances[actualPlayer].data.Character]; - GaugeType = (byte)HGaugeMethods.tGetGaugeTypeEnum(chara.effect.tGetGaugeType()); - // Gauge fill value - GaugeFill = (float)OpenTaiko.stage演奏ドラム画面.actGauge.db現在のゲージ値[storedPlayer]; - // Generation timestamp (in ticks) - Timestamp = DateTime.Now.Ticks; - // Compressed inputs and size - byte[] barr = ConvertTupleListToByteArray(allInputs); - CompressedInputs = SevenZip.Compression.LZMA.SevenZipHelper.Compress(barr); - CompressedInputsSize = CompressedInputs.Length; - // Chart metadata - ChartUniqueID = OpenTaiko.stageSongSelect.rChoosenSong.uniqueId.data.id; - ChartDifficulty = (byte)OpenTaiko.stageSongSelect.nChoosenSongDifficulty[storedPlayer]; - ChartLevel = (byte)Math.Min(255, OpenTaiko.stageSongSelect.rChoosenSong.arスコア[ChartDifficulty].譜面情報.nレベル[ChartDifficulty]); - // Online score ID used for online leaderboards linking, given by the server (Defaulted to 0 for now) - OnlineScoreID = 0; - // Replay Checksum (Calculate at the end) - ReplayChecksum = ""; - } - - #endregion - - #region [Helper variables] - - private string chartPath; - private string replayFolder; - private int storedPlayer; - private int danAccumulatedScore = 0; - - private List> allInputs = new List>(); - - #endregion - - #region [Replay file variables] - - /* Game mode of the replay - * 0 = Regular - * 1 = Dan - * 2 = Tower - */ - public byte GameMode = 0; - // Game version used for the replay - public int GameVersion; - // MD5 checksum of the chart - public string ChartChecksum; - // Player name - public string PlayerName; - // Replay hash - public string ReplayChecksum; - /* Performance informations - * - Good count (Int) - * - Ok count (Int) - * - Bad count (Int) - * - Roll count (Int) - * - Max combo (Int) - * - Boom count (Int) - * - ADLib count (Int) - * - Score (Int) - * - Coin value of the play (Short) - */ - public int GoodCount; - public int OkCount; - public int BadCount; - public int RollCount; - public int MaxCombo; - public int BoomCount; - public int ADLibCount; - public int Score; - public short CoinValue; - /* Performance informations (Tower only) - * - Reached floor (Int) - * - Remaining lives (Int) - */ - public int ReachedFloor = 0; - public int RemainingLives = 0; - // Individual performance informations (Dan only) - public int DanSongCount = 0; - public int[] IndividualGoodCount; - public int[] IndividualOkCount; - public int[] IndividualBadCount; - public int[] IndividualRollCount; - public int[] IndividualMaxCombo; - public int[] IndividualBoomCount; - public int[] IndividualADLibCount; - public int[] IndividualScore; - /* Clear status - * - Regular : - * > 0 : Failed (None) - * > 1 : Assisted clear (Bronze) - * > 2 : Clear (Silver) - * > 3 : Full combo (Gold) - * > 4 : Perfect (Platinum / Rainbow) - * - Tower : - * > 0 : None - * > 1 : 10% Mark (初) - * > 2 : 25% Mark (低) - * > 3 : 50% Mark (中) - * > 4 : 75% Mark (高) - * > 5 : Assisted clear (Bronze 可) - * > 6 : Clear (Silver 良) - * > 7 : Full combo (Gold 優) - * > 8 : Perfect (Platinum / Rainbow 秀) - * - Dan : - * > 0 : Failed - No dan title - * > 1 : Assisted Red clear - No dan title - * > 2 : Assisted Gold clear - No dan title - * > 3 : Red clear - Dan title - * > 4 : Gold clear - Dan title - * > 5 : Red full combo - Dan title - * > 6 : Gold full combo - Dan title - * > 7 : Red perfect - Dan title - * > 8 : Gold perfect - Dan title - */ - public byte ClearStatus; - /* Score Rank (Regular only) - * - 0 : F (Under 500k, Press F for respects) - * - 1 : E (500k ~ Under 600k, Ew...) - * - 2 : D (600k ~ Under 700k, Disappointing) - * - 3 : C (700k ~ Under 800k, Correct) - * - 4 : B (800k ~ Under 900k, Brillant!) - * - 5 : A (900k ~ Under 950k, Amazing!) - * - 6 : S (950k and more, Splendiferous!!) - * - 7 : Ω ((Around) 1M and more, Ωut-of-this-world!!!) - */ - public byte ScoreRank; - // Scroll speed value (as on ConfigIni, 9 is x1) - public int ScrollSpeedValue; - // Song speed value (as on ConfigIni, 20 is x1) - public int SongSpeedValue; - // Just strictess adjust mod value (as on ConfigIni, between -2 for lenient and 2 for rigorous) - public int JudgeStrictnessAdjust; - /* Mod Flags - * Bit Offsets (Values) : - * - 0 (1) : Mirror - * - 1 (2) : Random (Kimagure) - * - 2 (4) : Super Random (Detarame) - * - 3 (8) : Invisible (Doron) - * - 4 (16) : Perfect memory (Stealth) - * - 5 (32) : Avalanche - * - 6 (64) : Minesweeper - * - 7 (128) : Just (Ok => Bad) - * - 8 (256) : Safe (Bad => Ok) - */ - public int ModFlags; - /* Gauge type - * - 0 : Normal - * - 1 : Hard - * - 2 : Extreme - */ - public byte GaugeType; - // Gauge fill value - public float GaugeFill; - // Generation timestamp (in ticks) - public long Timestamp; - // Size in bytes of the compressed inputs (replay data) array - public int CompressedInputsSize; - // Compressed inputs (replay data) - public byte[] CompressedInputs; - /* Chart metadata - * - Chart unique ID : String - * - Chart difficulty : Byte (Between 0 and 6) - * - Chart level : Byte (Rounded to 255, usually between 0 and 13) - */ - public string ChartUniqueID; - public byte ChartDifficulty; - public byte ChartLevel; - // Online score ID used for online leaderboards linking, given by the server - public long OnlineScoreID; - - #endregion + /* Mod Flags + * Bit Offsets (Values) : + * - 0 (1) : Mirror + * - 1 (2) : Random (Kimagure) + * - 2 (4) : Super Random (Detarame) + * - 3 (8) : Invisible (Doron) + * - 4 (16) : Perfect memory (Stealth) + * - 5 (32) : Avalanche + * - 6 (64) : Minesweeper + * - 7 (128) : Just (Ok => Bad) + * - 8 (256) : Safe (Bad => Ok) + */ + [Flags] + public enum EModFlag { + None = 0, + Mirror = 1 << 0, + Random = 1 << 1, + SuperRandom = 1 << 2, + Invisible = 1 << 3, + PerfectMemory = 1 << 4, + Avalanche = 1 << 5, + Minesweeper = 1 << 6, + Just = 1 << 7, + Safe = 1 << 8 } + + public CSongReplay() { + replayFolder = ""; + storedPlayer = 0; + } + + public CSongReplay(string ChartPath, int player) { + string _chartFolder = Path.GetDirectoryName(ChartPath); + replayFolder = Path.Combine(_chartFolder, REPLAY_FOLDER_NAME); + + try { + Directory.CreateDirectory(replayFolder); + + Console.WriteLine("Folder Path: " + replayFolder); + } catch (Exception ex) { + Console.WriteLine("An error occurred: " + ex.Message); + } + + storedPlayer = player; + } + + public void tRegisterInput(double timestamp, byte keypress) { + allInputs.Add(Tuple.Create(timestamp, keypress)); + } + + #region [Dan methods] + + public void tDanRegisterSongCount(int songCount) { + DanSongCount = songCount; + IndividualGoodCount = new int[songCount]; + IndividualOkCount = new int[songCount]; + IndividualBadCount = new int[songCount]; + IndividualRollCount = new int[songCount]; + IndividualMaxCombo = new int[songCount]; + IndividualBoomCount = new int[songCount]; + IndividualADLibCount = new int[songCount]; + IndividualScore = new int[songCount]; + } + + public void tDanInputSongResults(int songNo) { + if (songNo >= DanSongCount) return; + if (songNo < 0) return; + IndividualGoodCount[songNo] = OpenTaiko.stage演奏ドラム画面.n良[songNo]; + IndividualOkCount[songNo] = OpenTaiko.stage演奏ドラム画面.n可[songNo]; + IndividualBadCount[songNo] = OpenTaiko.stage演奏ドラム画面.n不可[songNo]; + IndividualRollCount[songNo] = OpenTaiko.stage演奏ドラム画面.n連打[songNo]; + IndividualMaxCombo[songNo] = OpenTaiko.stage演奏ドラム画面.nHighestCombo[songNo]; + IndividualBoomCount[songNo] = OpenTaiko.stage演奏ドラム画面.nMine[songNo]; + IndividualADLibCount[songNo] = OpenTaiko.stage演奏ドラム画面.nADLIB[songNo]; + danAccumulatedScore = 0; + for (int acc = 0; acc < songNo; acc++) danAccumulatedScore += IndividualScore[acc]; + IndividualScore[songNo] = (int)OpenTaiko.stage演奏ドラム画面.actScore.GetScore(0) - danAccumulatedScore; + } + + #endregion + + #region [Load methods] + + private List> ConvertByteArrayToTupleList(byte[] byteArray) { + List> tupleList = new List>(); + + for (int i = 0; i < byteArray.Length; i += sizeof(double) + sizeof(byte)) { + double doubleValue = BitConverter.ToDouble(byteArray, i); + byte byteValue = byteArray[i + sizeof(double)]; + tupleList.Add(Tuple.Create(doubleValue, byteValue)); + } + + return tupleList; + } + + public void tLoadReplayFile(string optkrFilePath) { + try { + using (FileStream fileStream = new FileStream(optkrFilePath, FileMode.Open)) { + using (BinaryReader reader = new BinaryReader(fileStream)) { + GameMode = reader.ReadByte(); + GameVersion = reader.ReadInt32(); + ChartChecksum = reader.ReadString(); + PlayerName = reader.ReadString(); + GoodCount = reader.ReadInt32(); + OkCount = reader.ReadInt32(); + BadCount = reader.ReadInt32(); + RollCount = reader.ReadInt32(); + MaxCombo = reader.ReadInt32(); + BoomCount = reader.ReadInt32(); + ADLibCount = reader.ReadInt32(); + Score = reader.ReadInt32(); + CoinValue = reader.ReadInt16(); + ReachedFloor = reader.ReadInt32(); + RemainingLives = reader.ReadInt32(); + DanSongCount = reader.ReadInt32(); + for (int i = 0; i < DanSongCount; i++) { + IndividualGoodCount[i] = reader.ReadInt32(); + IndividualOkCount[i] = reader.ReadInt32(); + IndividualBadCount[i] = reader.ReadInt32(); + IndividualRollCount[i] = reader.ReadInt32(); + IndividualMaxCombo[i] = reader.ReadInt32(); + IndividualBoomCount[i] = reader.ReadInt32(); + IndividualADLibCount[i] = reader.ReadInt32(); + IndividualScore[i] = reader.ReadInt32(); + } + ClearStatus = reader.ReadByte(); + ScoreRank = reader.ReadByte(); + ScrollSpeedValue = reader.ReadInt32(); + SongSpeedValue = reader.ReadInt32(); + JudgeStrictnessAdjust = reader.ReadInt32(); + ModFlags = reader.ReadInt32(); + GaugeType = reader.ReadByte(); + GaugeFill = reader.ReadSingle(); + Timestamp = reader.ReadInt64(); + CompressedInputsSize = reader.ReadInt32(); + CompressedInputs = reader.ReadBytes(CompressedInputsSize); + var uncomp = SevenZip.Compression.LZMA.SevenZipHelper.Decompress(CompressedInputs); + allInputs = ConvertByteArrayToTupleList(uncomp); + ChartUniqueID = reader.ReadString(); + ChartDifficulty = reader.ReadByte(); + ChartLevel = reader.ReadByte(); + OnlineScoreID = reader.ReadInt64(); + } + } + } catch (Exception ex) { + + } + } + + #endregion + + #region [Save methods] + + private byte[] ConvertTupleListToByteArray(List> tupleList) { + List byteArray = new List(); + + foreach (var tuple in tupleList) { + byte[] doubleBytes = BitConverter.GetBytes(tuple.Item1); + byteArray.AddRange(doubleBytes); + byteArray.Add(tuple.Item2); + } + + return byteArray.ToArray(); + } + + public void tSaveReplayFile() { + string _path = replayFolder + @"/Replay_" + ChartUniqueID + @"_" + PlayerName + @"_" + Timestamp.ToString() + @".optkr"; + + try { + using (FileStream fileStream = new FileStream(_path, FileMode.Create)) { + using (BinaryWriter writer = new BinaryWriter(fileStream)) { + writer.Write(GameMode); + writer.Write(GameVersion); + writer.Write(ChartChecksum); + writer.Write(PlayerName); + writer.Write(GoodCount); + writer.Write(OkCount); + writer.Write(BadCount); + writer.Write(RollCount); + writer.Write(MaxCombo); + writer.Write(BoomCount); + writer.Write(ADLibCount); + writer.Write(Score); + writer.Write(CoinValue); + writer.Write(ReachedFloor); + writer.Write(RemainingLives); + writer.Write(DanSongCount); + for (int i = 0; i < DanSongCount; i++) { + writer.Write(IndividualGoodCount[i]); + writer.Write(IndividualOkCount[i]); + writer.Write(IndividualBadCount[i]); + writer.Write(IndividualRollCount[i]); + writer.Write(IndividualMaxCombo[i]); + writer.Write(IndividualBoomCount[i]); + writer.Write(IndividualADLibCount[i]); + writer.Write(IndividualScore[i]); + } + writer.Write(ClearStatus); + writer.Write(ScoreRank); + writer.Write(ScrollSpeedValue); + writer.Write(SongSpeedValue); + writer.Write(JudgeStrictnessAdjust); + writer.Write(ModFlags); + writer.Write(GaugeType); + writer.Write(GaugeFill); + writer.Write(Timestamp); + writer.Write(CompressedInputsSize); + writer.Write(CompressedInputs); + writer.Write(ChartUniqueID); + writer.Write(ChartDifficulty); + writer.Write(ChartLevel); + writer.Write(OnlineScoreID); + } + } + } catch (Exception ex) { + + } + } + + public void tResultsRegisterReplayInformations(int Coins, int Clear, int SRank) { + // Actual player (Used for saved informations) + int actualPlayer = OpenTaiko.GetActualPlayer(storedPlayer); + + // Game mode + switch (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0]) { + case (int)Difficulty.Dan: + GameMode = 1; + break; + case (int)Difficulty.Tower: + GameMode = 2; + break; + default: + GameMode = 0; + break; + } + // Game version + GameVersion = STORED_GAME_VERSION; + // Chart Checksum (temporary) + ChartChecksum = ""; + // Player Name + PlayerName = OpenTaiko.SaveFileInstances[actualPlayer].data.Name; + // Performance informations + GoodCount = OpenTaiko.stage演奏ドラム画面.CChartScore[storedPlayer].nGreat; + OkCount = OpenTaiko.stage演奏ドラム画面.CChartScore[storedPlayer].nGood; + BadCount = OpenTaiko.stage演奏ドラム画面.CChartScore[storedPlayer].nMiss; + RollCount = OpenTaiko.stage演奏ドラム画面.GetRoll(storedPlayer); + MaxCombo = OpenTaiko.stage演奏ドラム画面.actCombo.n現在のコンボ数.最高値[storedPlayer]; + BoomCount = OpenTaiko.stage演奏ドラム画面.CChartScore[storedPlayer].nMine; + ADLibCount = OpenTaiko.stage演奏ドラム画面.CChartScore[storedPlayer].nADLIB; + Score = OpenTaiko.stage演奏ドラム画面.CChartScore[storedPlayer].nScore; + CoinValue = (short)Coins; + // Tower parameters + if (GameMode == 2) { + ReachedFloor = CFloorManagement.LastRegisteredFloor; + RemainingLives = CFloorManagement.CurrentNumberOfLives; + } + // Clear status + ClearStatus = (byte)Clear; + // Score rank + ScoreRank = (byte)SRank; + // Scroll speed value (as on ConfigIni, 9 is x1) + ScrollSpeedValue = OpenTaiko.ConfigIni.nScrollSpeed[actualPlayer]; + // Song speed value (as on ConfigIni, 20 is x1) + SongSpeedValue = OpenTaiko.ConfigIni.nSongSpeed; + // Just strictess adjust mod value (as on ConfigIni, between -2 for lenient and 2 for rigorous) + JudgeStrictnessAdjust = OpenTaiko.ConfigIni.nTimingZones[actualPlayer]; + + /* Mod Flags + * Bit Offsets (Values) : + * - 0 (1) : Mirror + * - 1 (2) : Random (Kimagure) + * - 2 (4) : Super Random (Detarame) + * - 3 (8) : Invisible (Doron) + * - 4 (16) : Perfect memory (Stealth) + * - 5 (32) : Avalanche + * - 6 (64) : Minesweeper + * - 7 (128) : Just (Ok => Bad) + * - 8 (256) : Safe (Bad => Ok) + */ + ModFlags = (int)EModFlag.None; + if (OpenTaiko.ConfigIni.eRandom[actualPlayer] == ERandomMode.Mirror) ModFlags |= (int)EModFlag.Mirror; + if (OpenTaiko.ConfigIni.eRandom[actualPlayer] == ERandomMode.Random) ModFlags |= (int)EModFlag.Random; + if (OpenTaiko.ConfigIni.eRandom[actualPlayer] == ERandomMode.SuperRandom) ModFlags |= (int)EModFlag.SuperRandom; + if (OpenTaiko.ConfigIni.eRandom[actualPlayer] == ERandomMode.MirrorRandom) ModFlags |= ((int)EModFlag.Random | (int)EModFlag.Mirror); + if (OpenTaiko.ConfigIni.eSTEALTH[actualPlayer] == EStealthMode.Doron) ModFlags |= (int)EModFlag.Invisible; + if (OpenTaiko.ConfigIni.eSTEALTH[actualPlayer] == EStealthMode.Stealth) ModFlags |= (int)EModFlag.PerfectMemory; + if (OpenTaiko.ConfigIni.nFunMods[actualPlayer] == EFunMods.Avalanche) ModFlags |= (int)EModFlag.Avalanche; + if (OpenTaiko.ConfigIni.nFunMods[actualPlayer] == EFunMods.Minesweeper) ModFlags |= (int)EModFlag.Minesweeper; + if (OpenTaiko.ConfigIni.bJust[actualPlayer] == 1) ModFlags |= (int)EModFlag.Just; + if (OpenTaiko.ConfigIni.bJust[actualPlayer] == 2) ModFlags |= (int)EModFlag.Safe; + /* Gauge type + * - 0 : Normal + * - 1 : Hard + * - 2 : Extreme + */ + var chara = OpenTaiko.Tx.Characters[OpenTaiko.SaveFileInstances[actualPlayer].data.Character]; + GaugeType = (byte)HGaugeMethods.tGetGaugeTypeEnum(chara.effect.tGetGaugeType()); + // Gauge fill value + GaugeFill = (float)OpenTaiko.stage演奏ドラム画面.actGauge.db現在のゲージ値[storedPlayer]; + // Generation timestamp (in ticks) + Timestamp = DateTime.Now.Ticks; + // Compressed inputs and size + byte[] barr = ConvertTupleListToByteArray(allInputs); + CompressedInputs = SevenZip.Compression.LZMA.SevenZipHelper.Compress(barr); + CompressedInputsSize = CompressedInputs.Length; + // Chart metadata + ChartUniqueID = OpenTaiko.stageSongSelect.rChoosenSong.uniqueId.data.id; + ChartDifficulty = (byte)OpenTaiko.stageSongSelect.nChoosenSongDifficulty[storedPlayer]; + ChartLevel = (byte)Math.Min(255, OpenTaiko.stageSongSelect.rChoosenSong.arスコア[ChartDifficulty].譜面情報.nレベル[ChartDifficulty]); + // Online score ID used for online leaderboards linking, given by the server (Defaulted to 0 for now) + OnlineScoreID = 0; + // Replay Checksum (Calculate at the end) + ReplayChecksum = ""; + } + + #endregion + + #region [Helper variables] + + private string chartPath; + private string replayFolder; + private int storedPlayer; + private int danAccumulatedScore = 0; + + private List> allInputs = new List>(); + + #endregion + + #region [Replay file variables] + + /* Game mode of the replay + * 0 = Regular + * 1 = Dan + * 2 = Tower + */ + public byte GameMode = 0; + // Game version used for the replay + public int GameVersion; + // MD5 checksum of the chart + public string ChartChecksum; + // Player name + public string PlayerName; + // Replay hash + public string ReplayChecksum; + /* Performance informations + * - Good count (Int) + * - Ok count (Int) + * - Bad count (Int) + * - Roll count (Int) + * - Max combo (Int) + * - Boom count (Int) + * - ADLib count (Int) + * - Score (Int) + * - Coin value of the play (Short) + */ + public int GoodCount; + public int OkCount; + public int BadCount; + public int RollCount; + public int MaxCombo; + public int BoomCount; + public int ADLibCount; + public int Score; + public short CoinValue; + /* Performance informations (Tower only) + * - Reached floor (Int) + * - Remaining lives (Int) + */ + public int ReachedFloor = 0; + public int RemainingLives = 0; + // Individual performance informations (Dan only) + public int DanSongCount = 0; + public int[] IndividualGoodCount; + public int[] IndividualOkCount; + public int[] IndividualBadCount; + public int[] IndividualRollCount; + public int[] IndividualMaxCombo; + public int[] IndividualBoomCount; + public int[] IndividualADLibCount; + public int[] IndividualScore; + /* Clear status + * - Regular : + * > 0 : Failed (None) + * > 1 : Assisted clear (Bronze) + * > 2 : Clear (Silver) + * > 3 : Full combo (Gold) + * > 4 : Perfect (Platinum / Rainbow) + * - Tower : + * > 0 : None + * > 1 : 10% Mark (初) + * > 2 : 25% Mark (低) + * > 3 : 50% Mark (中) + * > 4 : 75% Mark (高) + * > 5 : Assisted clear (Bronze 可) + * > 6 : Clear (Silver 良) + * > 7 : Full combo (Gold 優) + * > 8 : Perfect (Platinum / Rainbow 秀) + * - Dan : + * > 0 : Failed - No dan title + * > 1 : Assisted Red clear - No dan title + * > 2 : Assisted Gold clear - No dan title + * > 3 : Red clear - Dan title + * > 4 : Gold clear - Dan title + * > 5 : Red full combo - Dan title + * > 6 : Gold full combo - Dan title + * > 7 : Red perfect - Dan title + * > 8 : Gold perfect - Dan title + */ + public byte ClearStatus; + /* Score Rank (Regular only) + * - 0 : F (Under 500k, Press F for respects) + * - 1 : E (500k ~ Under 600k, Ew...) + * - 2 : D (600k ~ Under 700k, Disappointing) + * - 3 : C (700k ~ Under 800k, Correct) + * - 4 : B (800k ~ Under 900k, Brillant!) + * - 5 : A (900k ~ Under 950k, Amazing!) + * - 6 : S (950k and more, Splendiferous!!) + * - 7 : Ω ((Around) 1M and more, Ωut-of-this-world!!!) + */ + public byte ScoreRank; + // Scroll speed value (as on ConfigIni, 9 is x1) + public int ScrollSpeedValue; + // Song speed value (as on ConfigIni, 20 is x1) + public int SongSpeedValue; + // Just strictess adjust mod value (as on ConfigIni, between -2 for lenient and 2 for rigorous) + public int JudgeStrictnessAdjust; + /* Mod Flags + * Bit Offsets (Values) : + * - 0 (1) : Mirror + * - 1 (2) : Random (Kimagure) + * - 2 (4) : Super Random (Detarame) + * - 3 (8) : Invisible (Doron) + * - 4 (16) : Perfect memory (Stealth) + * - 5 (32) : Avalanche + * - 6 (64) : Minesweeper + * - 7 (128) : Just (Ok => Bad) + * - 8 (256) : Safe (Bad => Ok) + */ + public int ModFlags; + /* Gauge type + * - 0 : Normal + * - 1 : Hard + * - 2 : Extreme + */ + public byte GaugeType; + // Gauge fill value + public float GaugeFill; + // Generation timestamp (in ticks) + public long Timestamp; + // Size in bytes of the compressed inputs (replay data) array + public int CompressedInputsSize; + // Compressed inputs (replay data) + public byte[] CompressedInputs; + /* Chart metadata + * - Chart unique ID : String + * - Chart difficulty : Byte (Between 0 and 6) + * - Chart level : Byte (Rounded to 255, usually between 0 and 13) + */ + public string ChartUniqueID; + public byte ChartDifficulty; + public byte ChartLevel; + // Online score ID used for online leaderboards linking, given by the server + public long OnlineScoreID; + + #endregion } diff --git a/OpenTaiko/src/Components/CVisualLogManager.cs b/OpenTaiko/src/Components/CVisualLogManager.cs index 6b8e8b45..6be54660 100644 --- a/OpenTaiko/src/Components/CVisualLogManager.cs +++ b/OpenTaiko/src/Components/CVisualLogManager.cs @@ -1,50 +1,50 @@ using FDK; -namespace OpenTaiko { - class CVisualLogManager { - public enum ELogCardType { - LogInfo, - LogWarning, - LogError - } +namespace OpenTaiko; - class LogCard { - public LogCard(ELogCardType type, string message) { - lct = type; - msg = message; - timeSinceCreation = new CCounter(0, 10000, 1, OpenTaiko.Timer); - } - - public void Display(int screenPosition) { - timeSinceCreation.Tick(); - - // Display stuff here - - int x = 0; - int y = 0 + (40 * screenPosition); - - OpenTaiko.actTextConsole.Print(x, y, CTextConsole.EFontType.Cyan, msg); - } - - public bool IsExpired() { - return timeSinceCreation.IsEnded; - } - - private CCounter timeSinceCreation; - private ELogCardType lct; - private string msg; - } - - public void PushCard(ELogCardType lct, string msg) { - cards.Add(new LogCard(lct, msg)); - } - - public void Display() { - for (int i = 0; i < cards.Count; i++) - cards[i].Display(i); - cards.RemoveAll(card => card.IsExpired()); - } - - private List cards = new List(); +class CVisualLogManager { + public enum ELogCardType { + LogInfo, + LogWarning, + LogError } + + class LogCard { + public LogCard(ELogCardType type, string message) { + lct = type; + msg = message; + timeSinceCreation = new CCounter(0, 10000, 1, OpenTaiko.Timer); + } + + public void Display(int screenPosition) { + timeSinceCreation.Tick(); + + // Display stuff here + + int x = 0; + int y = 0 + (40 * screenPosition); + + OpenTaiko.actTextConsole.Print(x, y, CTextConsole.EFontType.Cyan, msg); + } + + public bool IsExpired() { + return timeSinceCreation.IsEnded; + } + + private CCounter timeSinceCreation; + private ELogCardType lct; + private string msg; + } + + public void PushCard(ELogCardType lct, string msg) { + cards.Add(new LogCard(lct, msg)); + } + + public void Display() { + for (int i = 0; i < cards.Count; i++) + cards[i].Display(i); + cards.RemoveAll(card => card.IsExpired()); + } + + private List cards = new List(); } diff --git a/OpenTaiko/src/Databases/DBCDN.cs b/OpenTaiko/src/Databases/DBCDN.cs index c40e6a21..a2d578d7 100644 --- a/OpenTaiko/src/Databases/DBCDN.cs +++ b/OpenTaiko/src/Databases/DBCDN.cs @@ -1,56 +1,56 @@ using Newtonsoft.Json; -namespace OpenTaiko { - class DBCDN : CSavableT> { - public DBCDN() { - _fn = @$"{OpenTaiko.strEXEのあるフォルダ}Databases{Path.DirectorySeparatorChar}CDN.json"; - base.tDBInitSavable(); - } - - #region [Auxiliary classes] - - public class CDNHooks { - public string id = "id"; - public Dictionary title = new Dictionary() { - ["default"] = "title", - }; - public Dictionary subtitle = new Dictionary() { - ["default"] = "subtitle", - }; - public string[] difficulties = { "easy", "normal", "hard", "extreme", "extra", "tower", "dan" }; - public string life = "life"; - public string updateDate = "updateDate"; - public string creationDate = "creationDate"; - public string uploadDate = "uploadDate"; - public Dictionary md5 = new Dictionary() { - ["default"] = "md5", - }; - public string genre = "genre"; - public Dictionary genreSub = new Dictionary() { - ["default"] = "name", - }; - - public string charter = "charter"; - } - - public class CDNData { - - [JsonProperty("baseUrl")] - public string BaseUrl; - - [JsonProperty("download")] - public Dictionary Download = new Dictionary() { - ["default"] = "download/", - }; - - [JsonProperty("songList")] - public string SongList; - - [JsonProperty("hooks")] - public CDNHooks Hooks; - } - - #endregion +namespace OpenTaiko; +class DBCDN : CSavableT> { + public DBCDN() { + _fn = @$"{OpenTaiko.strEXEのあるフォルダ}Databases{Path.DirectorySeparatorChar}CDN.json"; + base.tDBInitSavable(); } + + #region [Auxiliary classes] + + public class CDNHooks { + public string id = "id"; + public Dictionary title = new Dictionary() { + ["default"] = "title", + }; + public Dictionary subtitle = new Dictionary() { + ["default"] = "subtitle", + }; + public string[] difficulties = { "easy", "normal", "hard", "extreme", "extra", "tower", "dan" }; + public string life = "life"; + public string updateDate = "updateDate"; + public string creationDate = "creationDate"; + public string uploadDate = "uploadDate"; + public Dictionary md5 = new Dictionary() { + ["default"] = "md5", + }; + public string genre = "genre"; + public Dictionary genreSub = new Dictionary() { + ["default"] = "name", + }; + + public string charter = "charter"; + } + + public class CDNData { + + [JsonProperty("baseUrl")] + public string BaseUrl; + + [JsonProperty("download")] + public Dictionary Download = new Dictionary() { + ["default"] = "download/", + }; + + [JsonProperty("songList")] + public string SongList; + + [JsonProperty("hooks")] + public CDNHooks Hooks; + } + + #endregion + } diff --git a/OpenTaiko/src/Databases/DBCharacter.cs b/OpenTaiko/src/Databases/DBCharacter.cs index 914d41aa..18475a56 100644 --- a/OpenTaiko/src/Databases/DBCharacter.cs +++ b/OpenTaiko/src/Databases/DBCharacter.cs @@ -1,92 +1,92 @@ using Newtonsoft.Json; -namespace OpenTaiko { - class DBCharacter { - public class CharacterEffect { - public CharacterEffect() { - Gauge = "Normal"; - BombFactor = 20; - FuseRollFactor = 0; - } +namespace OpenTaiko; - public float GetCoinMultiplier() { - float mult = 1f; - - if (Gauge == "Hard" && !OpenTaiko.ConfigIni.bForceNormalGauge) mult *= 1.5f; - if (Gauge == "Extreme" && !OpenTaiko.ConfigIni.bForceNormalGauge) mult *= 1.8f; - - return mult; - } - - public string tGetGaugeType() { - return OpenTaiko.ConfigIni.bForceNormalGauge || OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] >= 5 ? "Normal" : Gauge; - } - - - [JsonProperty("gauge")] - public string Gauge; - - [JsonProperty("bombFactor")] - public int BombFactor; - - [JsonProperty("fuseRollFactor")] - public int FuseRollFactor; +class DBCharacter { + public class CharacterEffect { + public CharacterEffect() { + Gauge = "Normal"; + BombFactor = 20; + FuseRollFactor = 0; } - public class CharacterData { - public CharacterData() { - Name = "(None)"; - Rarity = "Common"; - Author = "(None)"; - SpeechText = new CLocalizationData[6] { new CLocalizationData(), new CLocalizationData(), new CLocalizationData(), new CLocalizationData(), new CLocalizationData(), new CLocalizationData() }; - } + public float GetCoinMultiplier() { + float mult = 1f; - public CharacterData(string pcn, string pcr, string pca, CLocalizationData[] pcst) { - Name = pcn; - Rarity = pcr; - Author = pca; - SpeechText = pcst; - } + if (Gauge == "Hard" && !OpenTaiko.ConfigIni.bForceNormalGauge) mult *= 1.5f; + if (Gauge == "Extreme" && !OpenTaiko.ConfigIni.bForceNormalGauge) mult *= 1.8f; - public string tGetName() { - if (Name is string) return (string)Name; - else if (Name is CLocalizationData) return ((CLocalizationData)Name).GetString(""); - return ""; - } - - public string tGetAuthor() { - if (Author is string) return (string)Author; - else if (Author is CLocalizationData) return ((CLocalizationData)Author).GetString(""); - return ""; - } - - public string tGetDescription() { - if (Description is string) return (string)Description; - else if (Description is CLocalizationData) return ((CLocalizationData)Description).GetString(""); - return ""; - } - - // String or CLocalizationData - [JsonProperty("name")] - [JsonConverter(typeof(LocalizedStringConverter))] - public object Name; - - [JsonProperty("rarity")] - public string Rarity; - - // String or CLocalizationData - [JsonProperty("author")] - [JsonConverter(typeof(LocalizedStringConverter))] - public object Author; - - // String or CLocalizationData - [JsonProperty("description")] - [JsonConverter(typeof(LocalizedStringConverter))] - public object Description; - - [JsonProperty("speechtext")] - public CLocalizationData[] SpeechText; + return mult; } + public string tGetGaugeType() { + return OpenTaiko.ConfigIni.bForceNormalGauge || OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] >= 5 ? "Normal" : Gauge; + } + + + [JsonProperty("gauge")] + public string Gauge; + + [JsonProperty("bombFactor")] + public int BombFactor; + + [JsonProperty("fuseRollFactor")] + public int FuseRollFactor; } + + public class CharacterData { + public CharacterData() { + Name = "(None)"; + Rarity = "Common"; + Author = "(None)"; + SpeechText = new CLocalizationData[6] { new CLocalizationData(), new CLocalizationData(), new CLocalizationData(), new CLocalizationData(), new CLocalizationData(), new CLocalizationData() }; + } + + public CharacterData(string pcn, string pcr, string pca, CLocalizationData[] pcst) { + Name = pcn; + Rarity = pcr; + Author = pca; + SpeechText = pcst; + } + + public string tGetName() { + if (Name is string) return (string)Name; + else if (Name is CLocalizationData) return ((CLocalizationData)Name).GetString(""); + return ""; + } + + public string tGetAuthor() { + if (Author is string) return (string)Author; + else if (Author is CLocalizationData) return ((CLocalizationData)Author).GetString(""); + return ""; + } + + public string tGetDescription() { + if (Description is string) return (string)Description; + else if (Description is CLocalizationData) return ((CLocalizationData)Description).GetString(""); + return ""; + } + + // String or CLocalizationData + [JsonProperty("name")] + [JsonConverter(typeof(LocalizedStringConverter))] + public object Name; + + [JsonProperty("rarity")] + public string Rarity; + + // String or CLocalizationData + [JsonProperty("author")] + [JsonConverter(typeof(LocalizedStringConverter))] + public object Author; + + // String or CLocalizationData + [JsonProperty("description")] + [JsonConverter(typeof(LocalizedStringConverter))] + public object Description; + + [JsonProperty("speechtext")] + public CLocalizationData[] SpeechText; + } + } diff --git a/OpenTaiko/src/Databases/DBEncyclopediaMenus.cs b/OpenTaiko/src/Databases/DBEncyclopediaMenus.cs index 1916fd25..886852f9 100644 --- a/OpenTaiko/src/Databases/DBEncyclopediaMenus.cs +++ b/OpenTaiko/src/Databases/DBEncyclopediaMenus.cs @@ -1,21 +1,21 @@ using Newtonsoft.Json; -namespace OpenTaiko { - class DBEncyclopediaMenus : CSavableT { - public DBEncyclopediaMenus() { - _fn = @$"{OpenTaiko.strEXEのあるフォルダ}Encyclopedia{Path.DirectorySeparatorChar}Menus.json"; - base.tDBInitSavable(); - } +namespace OpenTaiko; - #region [Auxiliary classes] - public class EncyclopediaMenu { - [JsonProperty("menus")] - public KeyValuePair[] Menus; - - [JsonProperty("pages")] - public int[] Pages; - } - - #endregion +class DBEncyclopediaMenus : CSavableT { + public DBEncyclopediaMenus() { + _fn = @$"{OpenTaiko.strEXEのあるフォルダ}Encyclopedia{Path.DirectorySeparatorChar}Menus.json"; + base.tDBInitSavable(); } + + #region [Auxiliary classes] + public class EncyclopediaMenu { + [JsonProperty("menus")] + public KeyValuePair[] Menus; + + [JsonProperty("pages")] + public int[] Pages; + } + + #endregion } diff --git a/OpenTaiko/src/Databases/DBNameplateUnlockables.cs b/OpenTaiko/src/Databases/DBNameplateUnlockables.cs index f9ed8c95..7fdcc5f1 100644 --- a/OpenTaiko/src/Databases/DBNameplateUnlockables.cs +++ b/OpenTaiko/src/Databases/DBNameplateUnlockables.cs @@ -2,89 +2,89 @@ using Newtonsoft.Json; using static OpenTaiko.DBNameplateUnlockables; -namespace OpenTaiko { - internal class DBNameplateUnlockables : CSavableT> { - public DBNameplateUnlockables() { - _fn = @$"{OpenTaiko.strEXEのあるフォルダ}Databases{Path.DirectorySeparatorChar}NameplateUnlockables.db3"; +namespace OpenTaiko; - using (var connection = new SqliteConnection(@$"Data Source={_fn}")) { - connection.Open(); - - // Get existing languages - List _translations = HDatabaseHelpers.GetAvailableLanguage(connection, "translation"); - - // Get nameplates - var command = connection.CreateCommand(); - command.CommandText = +internal class DBNameplateUnlockables : CSavableT> { + public DBNameplateUnlockables() { + _fn = @$"{OpenTaiko.strEXEのあるフォルダ}Databases{Path.DirectorySeparatorChar}NameplateUnlockables.db3"; + + using (var connection = new SqliteConnection(@$"Data Source={_fn}")) { + connection.Open(); + + // Get existing languages + List _translations = HDatabaseHelpers.GetAvailableLanguage(connection, "translation"); + + // Get nameplates + var command = connection.CreateCommand(); + command.CommandText = @$" SELECT np.*, {String.Join(", ", _translations.Select((code, _) => $@"{code}.String AS {code}_String"))} FROM nameplates np {String.Join(Environment.NewLine, _translations.Select((code, _) => $@"LEFT JOIN translation_{code} {code} ON np.NameplateId = {code}.NameplateId"))} "; - var reader = command.ExecuteReader(); - while (reader.Read()) { - NameplateUnlockable nu = new NameplateUnlockable(); - nu.rarity = (string)reader["Rarity"]; - nu.unlockConditions = new DBUnlockables.CUnlockConditions(); - nu.unlockConditions.Condition = (string)reader["UnlockCondition"]; - nu.unlockConditions.Values = JsonConvert.DeserializeObject((string)reader["UnlockValues"]) ?? new int[] { 0 }; - nu.unlockConditions.Type = (string)reader["UnlockType"]; - nu.unlockConditions.Reference = JsonConvert.DeserializeObject((string)reader["UnlockReferences"]) ?? new string[] { "" }; - nu.nameplateInfo = new SaveFile.CNamePlateTitle((int)((Int64)reader["NameplateType"])); + var reader = command.ExecuteReader(); + while (reader.Read()) { + NameplateUnlockable nu = new NameplateUnlockable(); + nu.rarity = (string)reader["Rarity"]; + nu.unlockConditions = new DBUnlockables.CUnlockConditions(); + nu.unlockConditions.Condition = (string)reader["UnlockCondition"]; + nu.unlockConditions.Values = JsonConvert.DeserializeObject((string)reader["UnlockValues"]) ?? new int[] { 0 }; + nu.unlockConditions.Type = (string)reader["UnlockType"]; + nu.unlockConditions.Reference = JsonConvert.DeserializeObject((string)reader["UnlockReferences"]) ?? new string[] { "" }; + nu.nameplateInfo = new SaveFile.CNamePlateTitle((int)((Int64)reader["NameplateType"])); - nu.nameplateInfo.cld.SetString("default", (string)reader["DefaultString"]); - foreach (string tr in _translations) { - if (reader[@$"{tr}_String"] != DBNull.Value) - nu.nameplateInfo.cld.SetString(tr, (string)reader[@$"{tr}_String"]); - } - - data[((Int64)reader["NameplateId"])] = nu; + nu.nameplateInfo.cld.SetString("default", (string)reader["DefaultString"]); + foreach (string tr in _translations) { + if (reader[@$"{tr}_String"] != DBNull.Value) + nu.nameplateInfo.cld.SetString(tr, (string)reader[@$"{tr}_String"]); } - reader.Close(); + + data[((Int64)reader["NameplateId"])] = nu; } - } - public class NameplateUnlockable { - [JsonProperty("NameplateInfo")] - public SaveFile.CNamePlateTitle nameplateInfo; - - [JsonProperty("Rarity")] - public string rarity; - - [JsonProperty("UnlockCondition")] - public DBUnlockables.CUnlockConditions unlockConditions; - } - - public void tGetUnlockedItems(int _player, ModalQueue mq) { - int player = OpenTaiko.GetActualPlayer(_player); - var _sf = OpenTaiko.SaveFileInstances[player].data.UnlockedNameplateIds; - bool _edited = false; - - foreach (KeyValuePair item in data) { - var _npvKey = (int)item.Key; - if (!_sf.Contains(_npvKey))// !_sf.ContainsKey(_npvKey)) - { - var _fulfilled = item.Value.unlockConditions.tConditionMetWrapper(player, DBUnlockables.CUnlockConditions.EScreen.Internal).Item1; - - if (_fulfilled) { - _sf.Add(_npvKey); - _edited = true; - mq.tAddModal( - new Modal( - Modal.EModalType.Title, - HRarity.tRarityToModalInt(item.Value.rarity), - item, - OpenTaiko.NamePlate.lcNamePlate - ), - _player); - - DBSaves.RegisterUnlockedNameplate(OpenTaiko.SaveFileInstances[player].data.SaveId, _npvKey); - } - } - } - - if (_edited) - OpenTaiko.SaveFileInstances[player].tApplyHeyaChanges(); + reader.Close(); } } + public class NameplateUnlockable { + [JsonProperty("NameplateInfo")] + public SaveFile.CNamePlateTitle nameplateInfo; + + [JsonProperty("Rarity")] + public string rarity; + + [JsonProperty("UnlockCondition")] + public DBUnlockables.CUnlockConditions unlockConditions; + } + + public void tGetUnlockedItems(int _player, ModalQueue mq) { + int player = OpenTaiko.GetActualPlayer(_player); + var _sf = OpenTaiko.SaveFileInstances[player].data.UnlockedNameplateIds; + bool _edited = false; + + foreach (KeyValuePair item in data) { + var _npvKey = (int)item.Key; + if (!_sf.Contains(_npvKey))// !_sf.ContainsKey(_npvKey)) + { + var _fulfilled = item.Value.unlockConditions.tConditionMetWrapper(player, DBUnlockables.CUnlockConditions.EScreen.Internal).Item1; + + if (_fulfilled) { + _sf.Add(_npvKey); + _edited = true; + mq.tAddModal( + new Modal( + Modal.EModalType.Title, + HRarity.tRarityToModalInt(item.Value.rarity), + item, + OpenTaiko.NamePlate.lcNamePlate + ), + _player); + + DBSaves.RegisterUnlockedNameplate(OpenTaiko.SaveFileInstances[player].data.SaveId, _npvKey); + } + } + } + + if (_edited) + OpenTaiko.SaveFileInstances[player].tApplyHeyaChanges(); + } } diff --git a/OpenTaiko/src/Databases/DBPuchichara.cs b/OpenTaiko/src/Databases/DBPuchichara.cs index e91b8fe1..b291ce3d 100644 --- a/OpenTaiko/src/Databases/DBPuchichara.cs +++ b/OpenTaiko/src/Databases/DBPuchichara.cs @@ -1,84 +1,84 @@ using Newtonsoft.Json; -namespace OpenTaiko { - class DBPuchichara { - public class PuchicharaEffect { - public PuchicharaEffect() { - AllPurple = false; - Autoroll = 0; - ShowAdlib = false; - SplitLane = false; - } +namespace OpenTaiko; - public float GetCoinMultiplier() { - float mult = 1f; - if (Autoroll > 0) mult *= 0f; - if (ShowAdlib == true) mult *= 0.9f; - return mult; - } - - [JsonProperty("allpurple")] - public bool AllPurple; - - [JsonProperty("AutoRoll")] - public int Autoroll; - - [JsonProperty("showadlib")] - public bool ShowAdlib; - - [JsonProperty("splitlane")] - public bool SplitLane; +class DBPuchichara { + public class PuchicharaEffect { + public PuchicharaEffect() { + AllPurple = false; + Autoroll = 0; + ShowAdlib = false; + SplitLane = false; } - public class PuchicharaData { - public PuchicharaData() { - Name = "(None)"; - Rarity = "Common"; - Author = "(None)"; - } - - public PuchicharaData(string pcn, string pcr, string pca) { - Name = pcn; - Rarity = pcr; - Author = pca; - } - - public string tGetName() { - if (Name is string) return (string)Name; - else if (Name is CLocalizationData) return ((CLocalizationData)Name).GetString(""); - return ""; - } - - public string tGetAuthor() { - if (Author is string) return (string)Author; - else if (Author is CLocalizationData) return ((CLocalizationData)Author).GetString(""); - return ""; - } - - public string tGetDescription() { - if (Description is string) return (string)Description; - else if (Description is CLocalizationData) return ((CLocalizationData)Description).GetString(""); - return ""; - } - - // String or CLocalizationData - [JsonProperty("name")] - [JsonConverter(typeof(LocalizedStringConverter))] - public object Name; - - [JsonProperty("rarity")] - public string Rarity; - - // String or CLocalizationData - [JsonProperty("author")] - [JsonConverter(typeof(LocalizedStringConverter))] - public object Author; - - // String or CLocalizationData - [JsonProperty("description")] - [JsonConverter(typeof(LocalizedStringConverter))] - public object Description; + public float GetCoinMultiplier() { + float mult = 1f; + if (Autoroll > 0) mult *= 0f; + if (ShowAdlib == true) mult *= 0.9f; + return mult; } + [JsonProperty("allpurple")] + public bool AllPurple; + + [JsonProperty("AutoRoll")] + public int Autoroll; + + [JsonProperty("showadlib")] + public bool ShowAdlib; + + [JsonProperty("splitlane")] + public bool SplitLane; } + + public class PuchicharaData { + public PuchicharaData() { + Name = "(None)"; + Rarity = "Common"; + Author = "(None)"; + } + + public PuchicharaData(string pcn, string pcr, string pca) { + Name = pcn; + Rarity = pcr; + Author = pca; + } + + public string tGetName() { + if (Name is string) return (string)Name; + else if (Name is CLocalizationData) return ((CLocalizationData)Name).GetString(""); + return ""; + } + + public string tGetAuthor() { + if (Author is string) return (string)Author; + else if (Author is CLocalizationData) return ((CLocalizationData)Author).GetString(""); + return ""; + } + + public string tGetDescription() { + if (Description is string) return (string)Description; + else if (Description is CLocalizationData) return ((CLocalizationData)Description).GetString(""); + return ""; + } + + // String or CLocalizationData + [JsonProperty("name")] + [JsonConverter(typeof(LocalizedStringConverter))] + public object Name; + + [JsonProperty("rarity")] + public string Rarity; + + // String or CLocalizationData + [JsonProperty("author")] + [JsonConverter(typeof(LocalizedStringConverter))] + public object Author; + + // String or CLocalizationData + [JsonProperty("description")] + [JsonConverter(typeof(LocalizedStringConverter))] + public object Description; + } + } diff --git a/OpenTaiko/src/Databases/DBSaves.cs b/OpenTaiko/src/Databases/DBSaves.cs index ac3ef717..fba949e1 100644 --- a/OpenTaiko/src/Databases/DBSaves.cs +++ b/OpenTaiko/src/Databases/DBSaves.cs @@ -2,58 +2,59 @@ using Microsoft.Data.Sqlite; using Newtonsoft.Json; -namespace OpenTaiko { - internal class DBSaves { - private static string _savesDBFilename = $@"Saves.db3"; - private static string _savesDBPath = @$"{OpenTaiko.strEXEのあるフォルダ}{_savesDBFilename}"; - private static SqliteConnection SavesDBConnection = new SqliteConnection(@$"Data Source={_savesDBPath}"); +namespace OpenTaiko; - private static string _DBNotFoundError = @$"The database {_savesDBFilename} was not found or the connection failed"; +internal class DBSaves { + private static string _savesDBFilename = $@"Saves.db3"; + private static string _savesDBPath = @$"{OpenTaiko.strEXEのあるフォルダ}{_savesDBFilename}"; + private static SqliteConnection SavesDBConnection = new SqliteConnection(@$"Data Source={_savesDBPath}"); - public static SqliteConnection? GetSavesDBConnection() { - try { - if (SavesDBConnection != null && SavesDBConnection.State == ConnectionState.Closed) SavesDBConnection.Open(); - return SavesDBConnection; - } catch { - LogNotification.PopError(_DBNotFoundError); - return null; - } + private static string _DBNotFoundError = @$"The database {_savesDBFilename} was not found or the connection failed"; + + public static SqliteConnection? GetSavesDBConnection() { + try { + if (SavesDBConnection != null && SavesDBConnection.State == ConnectionState.Closed) SavesDBConnection.Open(); + return SavesDBConnection; + } catch { + LogNotification.PopError(_DBNotFoundError); + return null; } + } - public static Int64 GetPlayerSaveId(int player) { - return OpenTaiko.SaveFileInstances[OpenTaiko.GetActualPlayer(player)].data.SaveId; + public static Int64 GetPlayerSaveId(int player) { + return OpenTaiko.SaveFileInstances[OpenTaiko.GetActualPlayer(player)].data.SaveId; + } + + #region [Unlocked Dan Titles] + + public static Dictionary FetchUnlockedDanTitles(Int64 sid) { + Dictionary _dans = new Dictionary(); + SqliteConnection? connection = GetSavesDBConnection(); + if (connection == null) return _dans; + + var command = connection.CreateCommand(); + command.CommandText = @$"SELECT * FROM dan_titles WHERE SaveId={sid};"; + SqliteDataReader reader = command.ExecuteReader(); + while (reader.Read()) { + SaveFile.CDanTitle dt = new SaveFile.CDanTitle(); + + string key = (string)reader["DanTitleText"]; + dt.isGold = Convert.ToBoolean((int)(Int64)reader["DanIsGold"]); + dt.clearStatus = (int)(Int64)reader["DanClearStatus"]; + _dans[key] = dt; } + reader.Close(); - #region [Unlocked Dan Titles] + return _dans; + } - public static Dictionary FetchUnlockedDanTitles(Int64 sid) { - Dictionary _dans = new Dictionary(); - SqliteConnection? connection = GetSavesDBConnection(); - if (connection == null) return _dans; + public static void RegisterDanTitle(Int64 SaveId, string DanTitle, int DanClearStatus, bool DanIsGold) { + SqliteConnection? connection = GetSavesDBConnection(); + if (connection == null) return; - var command = connection.CreateCommand(); - command.CommandText = @$"SELECT * FROM dan_titles WHERE SaveId={sid};"; - SqliteDataReader reader = command.ExecuteReader(); - while (reader.Read()) { - SaveFile.CDanTitle dt = new SaveFile.CDanTitle(); + var command = connection.CreateCommand(); - string key = (string)reader["DanTitleText"]; - dt.isGold = Convert.ToBoolean((int)(Int64)reader["DanIsGold"]); - dt.clearStatus = (int)(Int64)reader["DanClearStatus"]; - _dans[key] = dt; - } - reader.Close(); - - return _dans; - } - - public static void RegisterDanTitle(Int64 SaveId, string DanTitle, int DanClearStatus, bool DanIsGold) { - SqliteConnection? connection = GetSavesDBConnection(); - if (connection == null) return; - - var command = connection.CreateCommand(); - - command.CommandText = $@"INSERT INTO dan_titles(DanTitleText,DanClearStatus,DanIsGold,SaveId) + command.CommandText = $@"INSERT INTO dan_titles(DanTitleText,DanClearStatus,DanIsGold,SaveId) VALUES( '{DanTitle.EscapeSingleQuotes()}', {DanClearStatus}, @@ -65,142 +66,142 @@ namespace OpenTaiko { DanIsGold = MAX(DanIsGold, EXCLUDED.DanIsGold), SaveId = EXCLUDED.SaveId ;"; - command.ExecuteNonQuery(); + command.ExecuteNonQuery(); + } + + #endregion + + #region [Unlocked Nameplates] + + public static List FetchUnlockedNameplateIds(Int64 sid) { + List _nps = new List(); + SqliteConnection? connection = GetSavesDBConnection(); + if (connection == null) return _nps; + + var command = connection.CreateCommand(); + command.CommandText = @$"SELECT * FROM nameplate_titles WHERE SaveId={sid};"; + SqliteDataReader reader = command.ExecuteReader(); + while (reader.Read()) { + _nps.Add((int)(Int64)reader["NameplateId"]); } + reader.Close(); - #endregion + return _nps; + } - #region [Unlocked Nameplates] + public static void RegisterUnlockedNameplate(Int64 SaveId, Int64 NameplateId) { + SqliteConnection? connection = GetSavesDBConnection(); + if (connection == null) return; - public static List FetchUnlockedNameplateIds(Int64 sid) { - List _nps = new List(); - SqliteConnection? connection = GetSavesDBConnection(); - if (connection == null) return _nps; + var command = connection.CreateCommand(); + command.CommandText = @$"INSERT INTO nameplate_titles(NameplateId,SaveId) VALUES({NameplateId}, {SaveId});"; + command.ExecuteNonQuery(); + } - var command = connection.CreateCommand(); - command.CommandText = @$"SELECT * FROM nameplate_titles WHERE SaveId={sid};"; - SqliteDataReader reader = command.ExecuteReader(); - while (reader.Read()) { - _nps.Add((int)(Int64)reader["NameplateId"]); - } - reader.Close(); + #endregion - return _nps; + #region [Characters and Puchicharas] + + public static List FetchStringUnlockedAsset(Int64 sid, string table) { + List _chara = new List(); + SqliteConnection? connection = GetSavesDBConnection(); + if (connection == null) return _chara; + + var command = connection.CreateCommand(); + command.CommandText = @$"SELECT * FROM {table} WHERE SaveId={sid};"; + SqliteDataReader reader = command.ExecuteReader(); + while (reader.Read()) { + _chara.Add((string)reader["Asset"]); } + reader.Close(); - public static void RegisterUnlockedNameplate(Int64 SaveId, Int64 NameplateId) { - SqliteConnection? connection = GetSavesDBConnection(); - if (connection == null) return; + return _chara; + } - var command = connection.CreateCommand(); - command.CommandText = @$"INSERT INTO nameplate_titles(NameplateId,SaveId) VALUES({NameplateId}, {SaveId});"; - command.ExecuteNonQuery(); + public static void RegisterStringUnlockedAsset(Int64 SaveId, string table, string asset) { + SqliteConnection? connection = GetSavesDBConnection(); + if (connection == null) return; + + var command = connection.CreateCommand(); + command.CommandText = @$"INSERT INTO {table}(Asset,SaveId) VALUES('{asset.EscapeSingleQuotes()}', {SaveId});"; + command.ExecuteNonQuery(); + } + + #endregion + + #region [saves Table] + + public static SaveFile[] FetchSaveInstances() { + SaveFile[] _instances = new SaveFile[5] { new SaveFile(), new SaveFile(), new SaveFile(), new SaveFile(), new SaveFile() }; + SqliteConnection? connection = GetSavesDBConnection(); + if (connection == null) return _instances; + + var command = connection.CreateCommand(); + command.CommandText = @$"SELECT * FROM saves WHERE CurrentSlot IS NOT NULL ORDER BY CurrentSlot ASC;"; + SqliteDataReader reader = command.ExecuteReader(); + int _file = 0; + while (reader.Read()) { + SaveFile sf = new SaveFile(); + + sf.data.SaveId = (Int64)reader["SaveId"]; + sf.data.Name = (string)reader["PlayerName"]; + sf.data.Title = (string)reader["PlayerNameplateTitle"]; + sf.data.Dan = (string)reader["PlayerDanTitle"]; + sf.data.DanGold = Convert.ToBoolean((Int64)reader["PlayerDanGold"]); + sf.data.DanType = (int)(Int64)reader["PlayerDanType"]; + sf.data.TitleType = (int)(Int64)reader["PlayerNameplateType"]; + sf.data.PuchiChara = (string)reader["PlayerPuchichara"]; + sf.data.Character = (int)(Int64)reader["PlayerCharacter"]; + sf.data.CharacterName = (string)reader["PlayerCharacterName"]; + sf.data.Medals = (Int64)reader["CurrentMedals"]; + sf.data.TotalEarnedMedals = (Int64)reader["TotalEarnedMedals"]; + sf.data.TotalPlaycount = (int)(Int64)reader["TotalPlaycount"]; + sf.data.AIBattleModePlaycount = (int)(Int64)reader["AIBattleModePlaycount"]; + sf.data.AIBattleModeWins = (int)(Int64)reader["AIBattleModeWins"]; + sf.data.TitleRarityInt = (int)(Int64)reader["PlayerNameplateRarityInt"]; + sf.data.TitleId = (int)(Int64)reader["PlayerNameplateId"]; + sf.tInitSaveFile(); + sf.tLoadUnlockables(); + + _instances[_file] = sf; + _file++; + if (_file >= 5) break; } + reader.Close(); - #endregion + return _instances; + } - #region [Characters and Puchicharas] + public static void AlterCoinsAndTotalPlayCount(Int64 SaveId, Int64 CoinsDelta, int PlayCountDelta) { + SqliteConnection? connection = GetSavesDBConnection(); + if (connection == null) return; - public static List FetchStringUnlockedAsset(Int64 sid, string table) { - List _chara = new List(); - SqliteConnection? connection = GetSavesDBConnection(); - if (connection == null) return _chara; + Int64 TotalEarnedCoinsDelta = Math.Max(0, CoinsDelta); - var command = connection.CreateCommand(); - command.CommandText = @$"SELECT * FROM {table} WHERE SaveId={sid};"; - SqliteDataReader reader = command.ExecuteReader(); - while (reader.Read()) { - _chara.Add((string)reader["Asset"]); - } - reader.Close(); + var command = connection.CreateCommand(); + command.CommandText = @$"UPDATE saves SET TotalPlaycount = TotalPlaycount + {PlayCountDelta}, CurrentMedals = CurrentMedals + {CoinsDelta}, TotalEarnedMedals = TotalEarnedMedals + {TotalEarnedCoinsDelta} WHERE SaveId = {SaveId};"; + command.ExecuteNonQuery(); + } - return _chara; - } + public static void RegisterAIBattleModePlay(Int64 SaveId, bool IsWon) { + SqliteConnection? connection = GetSavesDBConnection(); + if (connection == null) return; - public static void RegisterStringUnlockedAsset(Int64 SaveId, string table, string asset) { - SqliteConnection? connection = GetSavesDBConnection(); - if (connection == null) return; + Int64 AIBattleWinsDelta = (IsWon) ? 1 : 0; - var command = connection.CreateCommand(); - command.CommandText = @$"INSERT INTO {table}(Asset,SaveId) VALUES('{asset.EscapeSingleQuotes()}', {SaveId});"; - command.ExecuteNonQuery(); - } + var command = connection.CreateCommand(); + command.CommandText = @$"UPDATE saves SET AIBattleModePlaycount = AIBattleModePlaycount + 1, AIBattleModeWins = AIBattleModeWins + {AIBattleWinsDelta} WHERE SaveId = {SaveId};"; + command.ExecuteNonQuery(); + } - #endregion + public static void ApplyChangesFromMyRoom(SaveFile File) { + SqliteConnection? connection = GetSavesDBConnection(); + if (connection == null) return; - #region [saves Table] + SaveFile.Data SaveData = File.data; - public static SaveFile[] FetchSaveInstances() { - SaveFile[] _instances = new SaveFile[5] { new SaveFile(), new SaveFile(), new SaveFile(), new SaveFile(), new SaveFile() }; - SqliteConnection? connection = GetSavesDBConnection(); - if (connection == null) return _instances; - - var command = connection.CreateCommand(); - command.CommandText = @$"SELECT * FROM saves WHERE CurrentSlot IS NOT NULL ORDER BY CurrentSlot ASC;"; - SqliteDataReader reader = command.ExecuteReader(); - int _file = 0; - while (reader.Read()) { - SaveFile sf = new SaveFile(); - - sf.data.SaveId = (Int64)reader["SaveId"]; - sf.data.Name = (string)reader["PlayerName"]; - sf.data.Title = (string)reader["PlayerNameplateTitle"]; - sf.data.Dan = (string)reader["PlayerDanTitle"]; - sf.data.DanGold = Convert.ToBoolean((Int64)reader["PlayerDanGold"]); - sf.data.DanType = (int)(Int64)reader["PlayerDanType"]; - sf.data.TitleType = (int)(Int64)reader["PlayerNameplateType"]; - sf.data.PuchiChara = (string)reader["PlayerPuchichara"]; - sf.data.Character = (int)(Int64)reader["PlayerCharacter"]; - sf.data.CharacterName = (string)reader["PlayerCharacterName"]; - sf.data.Medals = (Int64)reader["CurrentMedals"]; - sf.data.TotalEarnedMedals = (Int64)reader["TotalEarnedMedals"]; - sf.data.TotalPlaycount = (int)(Int64)reader["TotalPlaycount"]; - sf.data.AIBattleModePlaycount = (int)(Int64)reader["AIBattleModePlaycount"]; - sf.data.AIBattleModeWins = (int)(Int64)reader["AIBattleModeWins"]; - sf.data.TitleRarityInt = (int)(Int64)reader["PlayerNameplateRarityInt"]; - sf.data.TitleId = (int)(Int64)reader["PlayerNameplateId"]; - sf.tInitSaveFile(); - sf.tLoadUnlockables(); - - _instances[_file] = sf; - _file++; - if (_file >= 5) break; - } - reader.Close(); - - return _instances; - } - - public static void AlterCoinsAndTotalPlayCount(Int64 SaveId, Int64 CoinsDelta, int PlayCountDelta) { - SqliteConnection? connection = GetSavesDBConnection(); - if (connection == null) return; - - Int64 TotalEarnedCoinsDelta = Math.Max(0, CoinsDelta); - - var command = connection.CreateCommand(); - command.CommandText = @$"UPDATE saves SET TotalPlaycount = TotalPlaycount + {PlayCountDelta}, CurrentMedals = CurrentMedals + {CoinsDelta}, TotalEarnedMedals = TotalEarnedMedals + {TotalEarnedCoinsDelta} WHERE SaveId = {SaveId};"; - command.ExecuteNonQuery(); - } - - public static void RegisterAIBattleModePlay(Int64 SaveId, bool IsWon) { - SqliteConnection? connection = GetSavesDBConnection(); - if (connection == null) return; - - Int64 AIBattleWinsDelta = (IsWon) ? 1 : 0; - - var command = connection.CreateCommand(); - command.CommandText = @$"UPDATE saves SET AIBattleModePlaycount = AIBattleModePlaycount + 1, AIBattleModeWins = AIBattleModeWins + {AIBattleWinsDelta} WHERE SaveId = {SaveId};"; - command.ExecuteNonQuery(); - } - - public static void ApplyChangesFromMyRoom(SaveFile File) { - SqliteConnection? connection = GetSavesDBConnection(); - if (connection == null) return; - - SaveFile.Data SaveData = File.data; - - var command = connection.CreateCommand(); - command.CommandText = $@" UPDATE saves SET + var command = connection.CreateCommand(); + command.CommandText = $@" UPDATE saves SET PlayerName = '{SaveData.Name.EscapeSingleQuotes()}', PlayerNameplateTitle = '{SaveData.Title.EscapeSingleQuotes()}', PlayerDanTitle = '{SaveData.Dan.EscapeSingleQuotes()}', @@ -214,195 +215,195 @@ namespace OpenTaiko { PlayerCharacterName = '{SaveData.CharacterName.EscapeSingleQuotes()}' WHERE SaveId = {SaveData.SaveId}; ;"; - command.ExecuteNonQuery(); - } + command.ExecuteNonQuery(); + } - #endregion + #endregion - #region [best_plays Table] + #region [best_plays Table] - public static Dictionary GetBestPlaysAsDict(Int64 saveId) { - Dictionary _bestPlays = new Dictionary(); - SqliteConnection? connection = GetSavesDBConnection(); - if (connection == null) return _bestPlays; + public static Dictionary GetBestPlaysAsDict(Int64 saveId) { + Dictionary _bestPlays = new Dictionary(); + SqliteConnection? connection = GetSavesDBConnection(); + if (connection == null) return _bestPlays; - var command = connection.CreateCommand(); - command.CommandText = + var command = connection.CreateCommand(); + command.CommandText = @$" SELECT * FROM best_plays WHERE SaveId={saveId}; "; - SqliteDataReader reader = command.ExecuteReader(); - while (reader.Read()) { - BestPlayRecords.CBestPlayRecord record = new BestPlayRecords.CBestPlayRecord(); + SqliteDataReader reader = command.ExecuteReader(); + while (reader.Read()) { + BestPlayRecords.CBestPlayRecord record = new BestPlayRecords.CBestPlayRecord(); - record.ChartUniqueId = (string)reader["ChartUniqueId"]; - record.ChartGenre = (string)reader["ChartGenre"]; - record.Charter = (string)reader["Charter"]; - record.Artist = (string)reader["Artist"]; - record.PlayMods = (Int64)reader["PlayMods"]; - record.ChartDifficulty = (Int64)reader["ChartDifficulty"]; ; - record.ChartLevel = (Int64)reader["ChartLevel"]; - record.ClearStatus = (Int64)reader["ClearStatus"]; - record.ScoreRank = (Int64)reader["ScoreRank"]; - record.HighScore = (Int64)reader["HighScore"]; - record.TowerBestFloor = (Int64)reader["TowerBestFloor"]; - record.DanExam1 = JsonConvert.DeserializeObject>((string)reader["DanExam1"] ?? "[]") ?? new List(); - record.DanExam2 = JsonConvert.DeserializeObject>((string)reader["DanExam2"] ?? "[]") ?? new List(); - record.DanExam3 = JsonConvert.DeserializeObject>((string)reader["DanExam3"] ?? "[]") ?? new List(); - record.DanExam4 = JsonConvert.DeserializeObject>((string)reader["DanExam4"] ?? "[]") ?? new List(); - record.DanExam5 = JsonConvert.DeserializeObject>((string)reader["DanExam5"] ?? "[]") ?? new List(); - record.DanExam6 = JsonConvert.DeserializeObject>((string)reader["DanExam6"] ?? "[]") ?? new List(); - record.DanExam7 = JsonConvert.DeserializeObject>((string)reader["DanExam7"] ?? "[]") ?? new List(); - record.PlayCount = (Int64)reader["PlayCount"]; - record.HighScoreGoodCount = (Int64)reader["HighScoreGoodCount"]; - record.HighScoreOkCount = (Int64)reader["HighScoreOkCount"]; - record.HighScoreBadCount = (Int64)reader["HighScoreBadCount"]; - record.HighScoreMaxCombo = (Int64)reader["HighScoreMaxCombo"]; - record.HighScoreRollCount = (Int64)reader["HighScoreRollCount"]; - record.HighScoreADLibCount = (Int64)reader["HighScoreADLibCount"]; - record.HighScoreBoomCount = (Int64)reader["HighScoreBoomCount"]; + record.ChartUniqueId = (string)reader["ChartUniqueId"]; + record.ChartGenre = (string)reader["ChartGenre"]; + record.Charter = (string)reader["Charter"]; + record.Artist = (string)reader["Artist"]; + record.PlayMods = (Int64)reader["PlayMods"]; + record.ChartDifficulty = (Int64)reader["ChartDifficulty"]; ; + record.ChartLevel = (Int64)reader["ChartLevel"]; + record.ClearStatus = (Int64)reader["ClearStatus"]; + record.ScoreRank = (Int64)reader["ScoreRank"]; + record.HighScore = (Int64)reader["HighScore"]; + record.TowerBestFloor = (Int64)reader["TowerBestFloor"]; + record.DanExam1 = JsonConvert.DeserializeObject>((string)reader["DanExam1"] ?? "[]") ?? new List(); + record.DanExam2 = JsonConvert.DeserializeObject>((string)reader["DanExam2"] ?? "[]") ?? new List(); + record.DanExam3 = JsonConvert.DeserializeObject>((string)reader["DanExam3"] ?? "[]") ?? new List(); + record.DanExam4 = JsonConvert.DeserializeObject>((string)reader["DanExam4"] ?? "[]") ?? new List(); + record.DanExam5 = JsonConvert.DeserializeObject>((string)reader["DanExam5"] ?? "[]") ?? new List(); + record.DanExam6 = JsonConvert.DeserializeObject>((string)reader["DanExam6"] ?? "[]") ?? new List(); + record.DanExam7 = JsonConvert.DeserializeObject>((string)reader["DanExam7"] ?? "[]") ?? new List(); + record.PlayCount = (Int64)reader["PlayCount"]; + record.HighScoreGoodCount = (Int64)reader["HighScoreGoodCount"]; + record.HighScoreOkCount = (Int64)reader["HighScoreOkCount"]; + record.HighScoreBadCount = (Int64)reader["HighScoreBadCount"]; + record.HighScoreMaxCombo = (Int64)reader["HighScoreMaxCombo"]; + record.HighScoreRollCount = (Int64)reader["HighScoreRollCount"]; + record.HighScoreADLibCount = (Int64)reader["HighScoreADLibCount"]; + record.HighScoreBoomCount = (Int64)reader["HighScoreBoomCount"]; - string key = record.ChartUniqueId + record.ChartDifficulty.ToString() + record.PlayMods.ToString(); - _bestPlays[key] = record; - } - reader.Close(); - - return _bestPlays; + string key = record.ChartUniqueId + record.ChartDifficulty.ToString() + record.PlayMods.ToString(); + _bestPlays[key] = record; } + reader.Close(); - public static void RegisterPlay(int player, int clearStatus, int scoreRank) { - SqliteConnection? connection = GetSavesDBConnection(); - if (connection == null) return; + return _bestPlays; + } - SaveFile.Data saveData = OpenTaiko.SaveFileInstances[OpenTaiko.GetActualPlayer(player)].data; - BestPlayRecords.CBestPlayRecord currentPlay = new BestPlayRecords.CBestPlayRecord(); - var choosenSong = OpenTaiko.stageSongSelect.rChoosenSong; - var choosenDifficulty = OpenTaiko.stageSongSelect.nChoosenSongDifficulty[player]; - var chartScore = OpenTaiko.stage演奏ドラム画面.CChartScore[player]; - List[] danResults = new List[7] { new List(), new List(), new List(), new List(), new List(), new List(), new List() }; + public static void RegisterPlay(int player, int clearStatus, int scoreRank) { + SqliteConnection? connection = GetSavesDBConnection(); + if (connection == null) return; - // Do not register the play if Dan/Tower and any mod is ON - if ((choosenDifficulty == (int)Difficulty.Tower || choosenDifficulty == (int)Difficulty.Dan) && !ModIcons.tPlayIsStock(player)) return; + SaveFile.Data saveData = OpenTaiko.SaveFileInstances[OpenTaiko.GetActualPlayer(player)].data; + BestPlayRecords.CBestPlayRecord currentPlay = new BestPlayRecords.CBestPlayRecord(); + var choosenSong = OpenTaiko.stageSongSelect.rChoosenSong; + var choosenDifficulty = OpenTaiko.stageSongSelect.nChoosenSongDifficulty[player]; + var chartScore = OpenTaiko.stage演奏ドラム画面.CChartScore[player]; + List[] danResults = new List[7] { new List(), new List(), new List(), new List(), new List(), new List(), new List() }; - // 1st step: Init best play record class + // Do not register the play if Dan/Tower and any mod is ON + if ((choosenDifficulty == (int)Difficulty.Tower || choosenDifficulty == (int)Difficulty.Dan) && !ModIcons.tPlayIsStock(player)) return; - { - currentPlay.ChartUniqueId = choosenSong.uniqueId.data.id; - currentPlay.ChartGenre = choosenSong.strジャンル; - currentPlay.Charter = choosenSong.strNotesDesigner[choosenDifficulty]; - currentPlay.Artist = choosenSong.ldSubtitle.GetString(""); // There is no direct Artist tag on the .tja format, so we directly use the subtitle as a guess - currentPlay.PlayMods = ModIcons.tModsToPlayModsFlags(player); - currentPlay.ChartDifficulty = choosenDifficulty; - currentPlay.ChartLevel = choosenSong.arスコア[choosenDifficulty].譜面情報.nレベル[choosenDifficulty]; - currentPlay.ClearStatus = clearStatus; - currentPlay.ScoreRank = scoreRank; - currentPlay.HighScore = chartScore.nScore; - if (choosenDifficulty == (int)Difficulty.Tower) currentPlay.TowerBestFloor = CFloorManagement.LastRegisteredFloor; - if (choosenDifficulty == (int)Difficulty.Dan) { - for (int i = 0; i < OpenTaiko.stageSongSelect.rChoosenSong.DanSongs.Count; i++) { - for (int j = 0; j < OpenTaiko.stageSongSelect.rChoosenSong.DanSongs[i].Dan_C.Length; j++) { - if (OpenTaiko.stageSongSelect.rChoosenSong.DanSongs[i].Dan_C[j] != null) { - int amount = OpenTaiko.stageSongSelect.rChoosenSong.DanSongs[i].Dan_C[j].GetAmount(); - danResults[j].Add(amount); - } + // 1st step: Init best play record class + + { + currentPlay.ChartUniqueId = choosenSong.uniqueId.data.id; + currentPlay.ChartGenre = choosenSong.strジャンル; + currentPlay.Charter = choosenSong.strNotesDesigner[choosenDifficulty]; + currentPlay.Artist = choosenSong.ldSubtitle.GetString(""); // There is no direct Artist tag on the .tja format, so we directly use the subtitle as a guess + currentPlay.PlayMods = ModIcons.tModsToPlayModsFlags(player); + currentPlay.ChartDifficulty = choosenDifficulty; + currentPlay.ChartLevel = choosenSong.arスコア[choosenDifficulty].譜面情報.nレベル[choosenDifficulty]; + currentPlay.ClearStatus = clearStatus; + currentPlay.ScoreRank = scoreRank; + currentPlay.HighScore = chartScore.nScore; + if (choosenDifficulty == (int)Difficulty.Tower) currentPlay.TowerBestFloor = CFloorManagement.LastRegisteredFloor; + if (choosenDifficulty == (int)Difficulty.Dan) { + for (int i = 0; i < OpenTaiko.stageSongSelect.rChoosenSong.DanSongs.Count; i++) { + for (int j = 0; j < OpenTaiko.stageSongSelect.rChoosenSong.DanSongs[i].Dan_C.Length; j++) { + if (OpenTaiko.stageSongSelect.rChoosenSong.DanSongs[i].Dan_C[j] != null) { + int amount = OpenTaiko.stageSongSelect.rChoosenSong.DanSongs[i].Dan_C[j].GetAmount(); + danResults[j].Add(amount); } } } - currentPlay.PlayCount = 1; // Will be directly added to the current instance if exists - currentPlay.HighScoreGoodCount = chartScore.nGreat; - currentPlay.HighScoreOkCount = chartScore.nGood; - currentPlay.HighScoreBadCount = chartScore.nMiss; - currentPlay.HighScoreMaxCombo = OpenTaiko.stage演奏ドラム画面.actCombo.n現在のコンボ数.最高値[player]; - currentPlay.HighScoreRollCount = chartScore.nRoll; - currentPlay.HighScoreADLibCount = chartScore.nADLIB; - currentPlay.HighScoreBoomCount = chartScore.nMine; } + currentPlay.PlayCount = 1; // Will be directly added to the current instance if exists + currentPlay.HighScoreGoodCount = chartScore.nGreat; + currentPlay.HighScoreOkCount = chartScore.nGood; + currentPlay.HighScoreBadCount = chartScore.nMiss; + currentPlay.HighScoreMaxCombo = OpenTaiko.stage演奏ドラム画面.actCombo.n現在のコンボ数.最高値[player]; + currentPlay.HighScoreRollCount = chartScore.nRoll; + currentPlay.HighScoreADLibCount = chartScore.nADLIB; + currentPlay.HighScoreBoomCount = chartScore.nMine; + } - // 2nd step: Overwrite the instance with best play results if exists - { - SqliteCommand cmd = connection.CreateCommand(); - cmd.CommandText = + // 2nd step: Overwrite the instance with best play results if exists + { + SqliteCommand cmd = connection.CreateCommand(); + cmd.CommandText = @$" SELECT * FROM best_plays WHERE ChartUniqueId='{currentPlay.ChartUniqueId}' AND PlayMods={currentPlay.PlayMods} and ChartDifficulty={currentPlay.ChartDifficulty}; "; - SqliteDataReader reader = cmd.ExecuteReader(); - while (reader.Read()) { - // Overwrite multiple variables at once if the highscore is replaced - Int64 _highscore = (Int64)reader["HighScore"]; - if (_highscore > currentPlay.HighScore) { - currentPlay.HighScore = _highscore; - currentPlay.HighScoreGoodCount = (Int64)reader["HighScoreGoodCount"]; - currentPlay.HighScoreOkCount = (Int64)reader["HighScoreOkCount"]; - currentPlay.HighScoreBadCount = (Int64)reader["HighScoreBadCount"]; - currentPlay.HighScoreMaxCombo = (Int64)reader["HighScoreMaxCombo"]; - currentPlay.HighScoreRollCount = (Int64)reader["HighScoreRollCount"]; - currentPlay.HighScoreADLibCount = (Int64)reader["HighScoreADLibCount"]; - currentPlay.HighScoreBoomCount = (Int64)reader["HighScoreBoomCount"]; - } - currentPlay.ClearStatus = Math.Max(currentPlay.ClearStatus, (Int64)reader["ClearStatus"]); - currentPlay.ScoreRank = Math.Max(currentPlay.ScoreRank, (Int64)reader["ScoreRank"]); - if (choosenDifficulty == (int)Difficulty.Tower) currentPlay.TowerBestFloor = Math.Max(currentPlay.TowerBestFloor, (Int64)reader["TowerBestFloor"]); - if (choosenDifficulty == (int)Difficulty.Dan) { - List[] oldDanResults = new List[7] - { - JsonConvert.DeserializeObject>((string)reader["DanExam1"]) ?? new List { -1 }, - JsonConvert.DeserializeObject>((string)reader["DanExam2"]) ?? new List { -1 }, - JsonConvert.DeserializeObject>((string)reader["DanExam3"]) ?? new List { -1 }, - JsonConvert.DeserializeObject>((string)reader["DanExam4"]) ?? new List { -1 }, - JsonConvert.DeserializeObject>((string)reader["DanExam5"]) ?? new List { -1 }, - JsonConvert.DeserializeObject>((string)reader["DanExam6"]) ?? new List { -1 }, - JsonConvert.DeserializeObject>((string)reader["DanExam7"]) ?? new List { -1 } - }; - for (int i = 0; i < OpenTaiko.stageSongSelect.rChoosenSong.DanSongs.Count; i++) { - for (int j = 0; j < OpenTaiko.stageSongSelect.rChoosenSong.DanSongs[i].Dan_C.Length; j++) { - if (OpenTaiko.stageSongSelect.rChoosenSong.DanSongs[i].Dan_C[j] != null) { - int amount = danResults[j][i]; + SqliteDataReader reader = cmd.ExecuteReader(); + while (reader.Read()) { + // Overwrite multiple variables at once if the highscore is replaced + Int64 _highscore = (Int64)reader["HighScore"]; + if (_highscore > currentPlay.HighScore) { + currentPlay.HighScore = _highscore; + currentPlay.HighScoreGoodCount = (Int64)reader["HighScoreGoodCount"]; + currentPlay.HighScoreOkCount = (Int64)reader["HighScoreOkCount"]; + currentPlay.HighScoreBadCount = (Int64)reader["HighScoreBadCount"]; + currentPlay.HighScoreMaxCombo = (Int64)reader["HighScoreMaxCombo"]; + currentPlay.HighScoreRollCount = (Int64)reader["HighScoreRollCount"]; + currentPlay.HighScoreADLibCount = (Int64)reader["HighScoreADLibCount"]; + currentPlay.HighScoreBoomCount = (Int64)reader["HighScoreBoomCount"]; + } + currentPlay.ClearStatus = Math.Max(currentPlay.ClearStatus, (Int64)reader["ClearStatus"]); + currentPlay.ScoreRank = Math.Max(currentPlay.ScoreRank, (Int64)reader["ScoreRank"]); + if (choosenDifficulty == (int)Difficulty.Tower) currentPlay.TowerBestFloor = Math.Max(currentPlay.TowerBestFloor, (Int64)reader["TowerBestFloor"]); + if (choosenDifficulty == (int)Difficulty.Dan) { + List[] oldDanResults = new List[7] + { + JsonConvert.DeserializeObject>((string)reader["DanExam1"]) ?? new List { -1 }, + JsonConvert.DeserializeObject>((string)reader["DanExam2"]) ?? new List { -1 }, + JsonConvert.DeserializeObject>((string)reader["DanExam3"]) ?? new List { -1 }, + JsonConvert.DeserializeObject>((string)reader["DanExam4"]) ?? new List { -1 }, + JsonConvert.DeserializeObject>((string)reader["DanExam5"]) ?? new List { -1 }, + JsonConvert.DeserializeObject>((string)reader["DanExam6"]) ?? new List { -1 }, + JsonConvert.DeserializeObject>((string)reader["DanExam7"]) ?? new List { -1 } + }; + for (int i = 0; i < OpenTaiko.stageSongSelect.rChoosenSong.DanSongs.Count; i++) { + for (int j = 0; j < OpenTaiko.stageSongSelect.rChoosenSong.DanSongs[i].Dan_C.Length; j++) { + if (OpenTaiko.stageSongSelect.rChoosenSong.DanSongs[i].Dan_C[j] != null) { + int amount = danResults[j][i]; - if (i < oldDanResults[j].Count) { - int current = oldDanResults[j][i]; - if (current == -1) { - danResults[j][i] = amount; - } else if (OpenTaiko.stageSongSelect.rChoosenSong.DanSongs[i].Dan_C[j].GetExamRange() == Exam.Range.More) { - danResults[j][i] = Math.Max(amount, current); - } else if (OpenTaiko.stageSongSelect.rChoosenSong.DanSongs[i].Dan_C[j].GetExamRange() == Exam.Range.Less) { - danResults[j][i] = Math.Min(amount, current); - } + if (i < oldDanResults[j].Count) { + int current = oldDanResults[j][i]; + if (current == -1) { + danResults[j][i] = amount; + } else if (OpenTaiko.stageSongSelect.rChoosenSong.DanSongs[i].Dan_C[j].GetExamRange() == Exam.Range.More) { + danResults[j][i] = Math.Max(amount, current); + } else if (OpenTaiko.stageSongSelect.rChoosenSong.DanSongs[i].Dan_C[j].GetExamRange() == Exam.Range.Less) { + danResults[j][i] = Math.Min(amount, current); } - } + } } } } - reader.Close(); } + reader.Close(); + } - // Intermede: Dan results to Dan exams - { - if (choosenDifficulty == (int)Difficulty.Dan) { - currentPlay.DanExam1 = danResults[0]; - currentPlay.DanExam2 = danResults[1]; - currentPlay.DanExam3 = danResults[2]; - currentPlay.DanExam4 = danResults[3]; - currentPlay.DanExam5 = danResults[4]; - currentPlay.DanExam6 = danResults[5]; - currentPlay.DanExam7 = danResults[6]; - } + // Intermede: Dan results to Dan exams + { + if (choosenDifficulty == (int)Difficulty.Dan) { + currentPlay.DanExam1 = danResults[0]; + currentPlay.DanExam2 = danResults[1]; + currentPlay.DanExam3 = danResults[2]; + currentPlay.DanExam4 = danResults[3]; + currentPlay.DanExam5 = danResults[4]; + currentPlay.DanExam6 = danResults[5]; + currentPlay.DanExam7 = danResults[6]; } + } - // Intermede: Update locally the play on the save file to reload it without requerying the database - { - string key = currentPlay.ChartUniqueId + currentPlay.ChartDifficulty.ToString() + currentPlay.PlayMods.ToString(); - saveData.bestPlays[key] = currentPlay; - saveData.tFactorizeBestPlays(); - } + // Intermede: Update locally the play on the save file to reload it without requerying the database + { + string key = currentPlay.ChartUniqueId + currentPlay.ChartDifficulty.ToString() + currentPlay.PlayMods.ToString(); + saveData.bestPlays[key] = currentPlay; + saveData.tFactorizeBestPlays(); + } - // 3rd step: Insert/Update to database - { - SqliteCommand cmd = connection.CreateCommand(); - cmd.CommandText = $@" + // 3rd step: Insert/Update to database + { + SqliteCommand cmd = connection.CreateCommand(); + cmd.CommandText = $@" INSERT INTO best_plays(ChartUniqueId,ChartGenre,Charter,Artist,PlayMods,ChartDifficulty,ChartLevel,ClearStatus,ScoreRank,HighScore,SaveId,TowerBestFloor,DanExam1,DanExam2,DanExam3,DanExam4,DanExam5,DanExam6,DanExam7,PlayCount,HighScoreGoodCount,HighScoreOkCount,HighScoreBadCount,HighScoreMaxCombo,HighScoreRollCount,HighScoreADLibCount,HighScoreBoomCount) VALUES( '{currentPlay.ChartUniqueId.EscapeSingleQuotes()}', @@ -454,10 +455,9 @@ namespace OpenTaiko { DanExam6=EXCLUDED.DanExam6, DanExam7=EXCLUDED.DanExam7 "; - cmd.ExecuteNonQuery(); - } + cmd.ExecuteNonQuery(); } - - #endregion } + + #endregion } diff --git a/OpenTaiko/src/Databases/DBSkinPreset.cs b/OpenTaiko/src/Databases/DBSkinPreset.cs index 72c4979e..af93ff8b 100644 --- a/OpenTaiko/src/Databases/DBSkinPreset.cs +++ b/OpenTaiko/src/Databases/DBSkinPreset.cs @@ -1,56 +1,56 @@ using Newtonsoft.Json; -namespace OpenTaiko { - internal class DBSkinPreset { - public class SkinScene { - public SkinScene() { - UpperBackground = null; - LowerBackground = null; - DancerSet = null; - FooterSet = null; - MobSet = null; - RunnerSet = null; - } +namespace OpenTaiko; - [JsonProperty("UP")] - public string[] UpperBackground; - - [JsonProperty("DOWN")] - public string[] LowerBackground; - - [JsonProperty("DANCER")] - public string[] DancerSet; - - [JsonProperty("FOOTER")] - public string[] FooterSet; - - [JsonProperty("MOB")] - public string[] MobSet; - - [JsonProperty("RUNNER")] - public string[] RunnerSet; +internal class DBSkinPreset { + public class SkinScene { + public SkinScene() { + UpperBackground = null; + LowerBackground = null; + DancerSet = null; + FooterSet = null; + MobSet = null; + RunnerSet = null; } - public class SkinPreset { - public SkinPreset() { - Regular = new Dictionary(); - Dan = new Dictionary(); - Tower = new Dictionary(); - AI = new Dictionary(); - } + [JsonProperty("UP")] + public string[] UpperBackground; - [JsonProperty("Regular")] - public Dictionary Regular; + [JsonProperty("DOWN")] + public string[] LowerBackground; - [JsonProperty("Dan")] - public Dictionary Dan; + [JsonProperty("DANCER")] + public string[] DancerSet; - [JsonProperty("Tower")] - public Dictionary Tower; + [JsonProperty("FOOTER")] + public string[] FooterSet; - [JsonProperty("AI")] - public Dictionary AI; + [JsonProperty("MOB")] + public string[] MobSet; + [JsonProperty("RUNNER")] + public string[] RunnerSet; + } + public class SkinPreset { + public SkinPreset() { + Regular = new Dictionary(); + Dan = new Dictionary(); + Tower = new Dictionary(); + AI = new Dictionary(); } + + + [JsonProperty("Regular")] + public Dictionary Regular; + + [JsonProperty("Dan")] + public Dictionary Dan; + + [JsonProperty("Tower")] + public Dictionary Tower; + + [JsonProperty("AI")] + public Dictionary AI; + } } diff --git a/OpenTaiko/src/Databases/DBSongUnlockables.cs b/OpenTaiko/src/Databases/DBSongUnlockables.cs index 60ee3cd8..52f3dbe9 100644 --- a/OpenTaiko/src/Databases/DBSongUnlockables.cs +++ b/OpenTaiko/src/Databases/DBSongUnlockables.cs @@ -2,112 +2,112 @@ using Newtonsoft.Json; using static OpenTaiko.DBSongUnlockables; -namespace OpenTaiko { - internal class DBSongUnlockables : CSavableT> { - /* DISPLAYED : Song displayed in song select, only a lock appearing on the side, audio preview plays - * GRAYED : Box grayed, song preview does not play - * BLURED : Like grayed, but with a glitch effect on the song title and preimage making it unreadable - * HIDDEN : Song not appears on the song select list until being unlocked - */ - public enum EHiddenIndex { - DISPLAYED = 0, - GRAYED = 1, - BLURED = 2, - HIDDEN = 3 - } +namespace OpenTaiko; - public DBSongUnlockables() { - _fn = @$"{OpenTaiko.strEXEのあるフォルダ}Databases{Path.DirectorySeparatorChar}SongUnlockables.db3"; - using (var connection = new SqliteConnection(@$"Data Source={_fn}")) { - connection.Open(); - - // Get songs info - var command = connection.CreateCommand(); - command.CommandText = +internal class DBSongUnlockables : CSavableT> { + /* DISPLAYED : Song displayed in song select, only a lock appearing on the side, audio preview plays + * GRAYED : Box grayed, song preview does not play + * BLURED : Like grayed, but with a glitch effect on the song title and preimage making it unreadable + * HIDDEN : Song not appears on the song select list until being unlocked + */ + public enum EHiddenIndex { + DISPLAYED = 0, + GRAYED = 1, + BLURED = 2, + HIDDEN = 3 + } + + public DBSongUnlockables() { + _fn = @$"{OpenTaiko.strEXEのあるフォルダ}Databases{Path.DirectorySeparatorChar}SongUnlockables.db3"; + using (var connection = new SqliteConnection(@$"Data Source={_fn}")) { + connection.Open(); + + // Get songs info + var command = connection.CreateCommand(); + command.CommandText = @$" SELECT * FROM songs; "; - var reader = command.ExecuteReader(); - while (reader.Read()) { - SongUnlockable su = new SongUnlockable(); - su.hiddenIndex = (EHiddenIndex)(Int64)reader["HiddenIndex"]; - su.rarity = (string)reader["Rarity"]; - su.unlockConditions = new DBUnlockables.CUnlockConditions(); - su.unlockConditions.Condition = (string)reader["UnlockCondition"]; - su.unlockConditions.Values = JsonConvert.DeserializeObject((string)reader["UnlockValues"]) ?? new int[] { 0 }; - su.unlockConditions.Type = (string)reader["UnlockType"]; - su.unlockConditions.Reference = JsonConvert.DeserializeObject((string)reader["UnlockReferences"]) ?? new string[] { "" }; + var reader = command.ExecuteReader(); + while (reader.Read()) { + SongUnlockable su = new SongUnlockable(); + su.hiddenIndex = (EHiddenIndex)(Int64)reader["HiddenIndex"]; + su.rarity = (string)reader["Rarity"]; + su.unlockConditions = new DBUnlockables.CUnlockConditions(); + su.unlockConditions.Condition = (string)reader["UnlockCondition"]; + su.unlockConditions.Values = JsonConvert.DeserializeObject((string)reader["UnlockValues"]) ?? new int[] { 0 }; + su.unlockConditions.Type = (string)reader["UnlockType"]; + su.unlockConditions.Reference = JsonConvert.DeserializeObject((string)reader["UnlockReferences"]) ?? new string[] { "" }; - data[((string)reader["SongUniqueId"])] = su; - } - reader.Close(); + data[((string)reader["SongUniqueId"])] = su; } - - } - public class SongUnlockable { - [JsonProperty("HiddenIndex")] - public EHiddenIndex hiddenIndex; - - [JsonProperty("Rarity")] - public string rarity; - - [JsonProperty("UnlockCondition")] - public DBUnlockables.CUnlockConditions unlockConditions; + reader.Close(); } - public void tGetUnlockedItems(int _player, ModalQueue mq) { - int player = OpenTaiko.GetActualPlayer(_player); - var _sf = OpenTaiko.SaveFileInstances[player].data.UnlockedSongs; - bool _edited = false; + } + public class SongUnlockable { + [JsonProperty("HiddenIndex")] + public EHiddenIndex hiddenIndex; - foreach (KeyValuePair item in data) { - string _npvKey = item.Key; - CSongListNode? _node = CSongDict.tGetNodeFromID(_npvKey); + [JsonProperty("Rarity")] + public string rarity; - if (!_sf.Contains(_npvKey)) { - var _fulfilled = item.Value.unlockConditions.tConditionMetWrapper(player, DBUnlockables.CUnlockConditions.EScreen.Internal).Item1; + [JsonProperty("UnlockCondition")] + public DBUnlockables.CUnlockConditions unlockConditions; + } - if (_fulfilled) { - _sf.Add(_npvKey); - _edited = true; + public void tGetUnlockedItems(int _player, ModalQueue mq) { + int player = OpenTaiko.GetActualPlayer(_player); + var _sf = OpenTaiko.SaveFileInstances[player].data.UnlockedSongs; + bool _edited = false; + + foreach (KeyValuePair item in data) { + string _npvKey = item.Key; + CSongListNode? _node = CSongDict.tGetNodeFromID(_npvKey); + + if (!_sf.Contains(_npvKey)) { + var _fulfilled = item.Value.unlockConditions.tConditionMetWrapper(player, DBUnlockables.CUnlockConditions.EScreen.Internal).Item1; + + if (_fulfilled) { + _sf.Add(_npvKey); + _edited = true; - mq.tAddModal( - new Modal( - Modal.EModalType.Song, - HRarity.tRarityToModalInt(item.Value.rarity), - _node, - OpenTaiko.stageSongSelect.actPreimageパネル.tGenerateAndGetPreimage(_node?.arスコア[0] ?? null) - ), - _player); + mq.tAddModal( + new Modal( + Modal.EModalType.Song, + HRarity.tRarityToModalInt(item.Value.rarity), + _node, + OpenTaiko.stageSongSelect.actPreimageパネル.tGenerateAndGetPreimage(_node?.arスコア[0] ?? null) + ), + _player); - DBSaves.RegisterStringUnlockedAsset(OpenTaiko.SaveFileInstances[player].data.SaveId, "unlocked_songs", _npvKey); + DBSaves.RegisterStringUnlockedAsset(OpenTaiko.SaveFileInstances[player].data.SaveId, "unlocked_songs", _npvKey); - } } } - - if (_edited) - OpenTaiko.SaveFileInstances[player].tApplyHeyaChanges(); } - public bool tIsSongLocked(CSongListNode? song) { - if (song == null || OpenTaiko.ConfigIni.bIgnoreSongUnlockables) return false; - return !OpenTaiko.SaveFileInstances[OpenTaiko.SaveFile].data.UnlockedSongs.Contains(song.tGetUniqueId()) - && data.ContainsKey(song.tGetUniqueId()); - } + if (_edited) + OpenTaiko.SaveFileInstances[player].tApplyHeyaChanges(); + } - public EHiddenIndex tGetSongHiddenIndex(CSongListNode? song) { - if (song == null || !tIsSongLocked(song)) return EHiddenIndex.DISPLAYED; - return data[song.tGetUniqueId()].hiddenIndex; - } + public bool tIsSongLocked(CSongListNode? song) { + if (song == null || OpenTaiko.ConfigIni.bIgnoreSongUnlockables) return false; + return !OpenTaiko.SaveFileInstances[OpenTaiko.SaveFile].data.UnlockedSongs.Contains(song.tGetUniqueId()) + && data.ContainsKey(song.tGetUniqueId()); + } - public SongUnlockable? tGetUnlockableByUniqueId(CSongListNode? song) { - if (song == null) return null; - if (!data.ContainsKey(song.tGetUniqueId())) return null; - return data[song.tGetUniqueId()]; - } + public EHiddenIndex tGetSongHiddenIndex(CSongListNode? song) { + if (song == null || !tIsSongLocked(song)) return EHiddenIndex.DISPLAYED; + return data[song.tGetUniqueId()].hiddenIndex; + } + + public SongUnlockable? tGetUnlockableByUniqueId(CSongListNode? song) { + if (song == null) return null; + if (!data.ContainsKey(song.tGetUniqueId())) return null; + return data[song.tGetUniqueId()]; } } diff --git a/OpenTaiko/src/Databases/DBUnlockables.cs b/OpenTaiko/src/Databases/DBUnlockables.cs index 8f599a71..d3228b0a 100644 --- a/OpenTaiko/src/Databases/DBUnlockables.cs +++ b/OpenTaiko/src/Databases/DBUnlockables.cs @@ -1,469 +1,341 @@ using Newtonsoft.Json; using static OpenTaiko.BestPlayRecords; -namespace OpenTaiko { - class DBUnlockables { - public static Dictionary RequiredArgs = new Dictionary() { - ["ch"] = 1, - ["cs"] = 1, - ["dp"] = 3, - ["lp"] = 3, - ["sp"] = 2, - ["sg"] = 2, +namespace OpenTaiko; - ["sc"] = 2, - ["ce"] = 1, - ["tp"] = 1, - ["ap"] = 1, - ["aw"] = 1, - ["ig"] = 0, - }; +class DBUnlockables { + public static Dictionary RequiredArgs = new Dictionary() { + ["ch"] = 1, + ["cs"] = 1, + ["dp"] = 3, + ["lp"] = 3, + ["sp"] = 2, + ["sg"] = 2, - public class CUnlockConditions { - public CUnlockConditions() { - Condition = ""; - Values = new int[] { 0 }; - Type = "me"; - Reference = new string[] { "" }; + ["sc"] = 2, + ["ce"] = 1, + ["tp"] = 1, + ["ap"] = 1, + ["aw"] = 1, + ["ig"] = 0, + }; + + public class CUnlockConditions { + public CUnlockConditions() { + Condition = ""; + Values = new int[] { 0 }; + Type = "me"; + Reference = new string[] { "" }; + } + public CUnlockConditions(string cd, int[] vl, string tp, string[] rf) { + Condition = cd; + Values = vl; + Type = tp; + Reference = rf; + } + + // Condition type + [JsonProperty("condition")] + public string Condition; + + // Condition values + [JsonProperty("values")] + public int[] Values; + + // Condition type + [JsonProperty("type")] + public string Type; + + // Referenced charts + [JsonProperty("references")] + public string[] Reference; + + [JsonIgnore] + private int RequiredArgCount = -1; + + public bool tHasCondition() { + return Condition != ""; + } + + /* + * (Note: Currently only me is relevant, the other types might be used in the future) + * == Types of conditions == + * l : "Less than" + * le : "Less or equal" + * e : "Equal" + * me : "More or equal" (Default) + * m : "More than" + * d : "Different" + */ + public bool tValueRequirementMet(int val1, int val2) { + switch (this.Type) { + case "l": + return (val1 < val2); + case "le": + return (val1 <= val2); + case "e": + return (val1 == val2); + case "me": + return (val1 >= val2); + case "m": + return (val1 > val2); + case "d": + return (val1 != val2); + default: + return (val1 >= val2); } - public CUnlockConditions(string cd, int[] vl, string tp, string[] rf) { - Condition = cd; - Values = vl; - Type = tp; - Reference = rf; + } + + public string GetRequiredClearStatus(int status, bool exact = false) { + switch (status) { + case (int)EClearStatus.PERFECT: + return CLangManager.LangInstance.GetString(exact ? "UNLOCK_CONDITION_REQUIRE_PERFECT" : "UNLOCK_CONDITION_REQUIRE_PERFECT_MORE"); + case (int)EClearStatus.FC: + return CLangManager.LangInstance.GetString(exact ? "UNLOCK_CONDITION_REQUIRE_FC" : "UNLOCK_CONDITION_REQUIRE_FC_MORE"); + case (int)EClearStatus.CLEAR: + return CLangManager.LangInstance.GetString(exact ? "UNLOCK_CONDITION_REQUIRE_CLEAR" : "UNLOCK_CONDITION_REQUIRE_CLEAR_MORE"); + case (int)EClearStatus.ASSISTED_CLEAR: + return CLangManager.LangInstance.GetString(exact ? "UNLOCK_CONDITION_REQUIRE_ASSIST" : "UNLOCK_CONDITION_REQUIRE_ASSIST_MORE"); + default: + return CLangManager.LangInstance.GetString(exact ? "UNLOCK_CONDITION_REQUIRE_PLAY" : "UNLOCK_CONDITION_REQUIRE_PLAY_MORE"); + } + } + + /* + * == Condition avaliable == + * ch : "Coins here", coin requirement, payable within the heya menu, 1 value : [Coin price] + * cs : "Coins shop", coin requirement, payable only within the Medal shop selection screen + * cm : "Coins menu", coin requirement, payable only within the song select screen (used only for songs) + * ce : "Coins earned", coins earned since the creation of the save file, 1 value : [Total earned coins] + * dp : "Difficulty pass", count of difficulties pass, unlock check during the results screen, condition 3 values : [Difficulty int (0~4), Clear status (0~4), Number of performances], input 1 value [Plays fitting the condition] + * lp : "Level pass", count of level pass, unlock check during the results screen, condition 3 values : [Star rating, Clear status (0~4), Number of performances], input 1 value [Plays fitting the condition] + * sp : "Song performance", count of a specific song pass, unlock check during the results screen, condition 2 x n values for n songs : [Difficulty int (0~4, if -1 : Any), Clear status (0~4), ...], input 1 value [Count of fullfiled songs], n references for n songs (Song ids) + * sg : "Song genre (performance)", count of any unique song pass within a specific genre folder, unlock check during the results screen, condition 2 x n values for n songs : [Song count, Clear status (0~4), ...], input 1 value [Count of fullfiled genres], n references for n genres (Genre names) + * sc : "Song charter (performance)", count of any chart pass by a specific charter, unlock check during the results screen, condition 2 x n values for n songs : [Song count, Clear status (0~4), ...], input 1 value [Count of fullfiled charters], n references for n charters (Charter names) + * tp : "Total plays", 1 value : [Total playcount] + * ap : "AI battle plays", 1 value : [AI battle playcount] + * aw : "AI battle wins", 1 value : [AI battle wins count] + * ig : "Impossible to Get", (not recommanded) used to be able to have content in database that is impossible to unlock, no values + * + */ + public (bool, string?) tConditionMetWrapper(int player, EScreen screen = EScreen.MyRoom) { + if (RequiredArgCount < 0 && RequiredArgs.ContainsKey(Condition)) + RequiredArgCount = RequiredArgs[Condition]; + + switch (this.Condition) { + case "ch": + case "cs": + case "cm": + if (this.Values.Length == 1) + return tConditionMet(new int[] { (int)OpenTaiko.SaveFileInstances[player].data.Medals }, screen); + else + return (false, CLangManager.LangInstance.GetString("UNLOCK_CONDITION_ERROR", this.Condition, this.RequiredArgCount.ToString())); + case "ce": + if (this.Values.Length == 1) + return tConditionMet(new int[] { (int)OpenTaiko.SaveFileInstances[player].data.TotalEarnedMedals }, screen); + else + return (false, CLangManager.LangInstance.GetString("UNLOCK_CONDITION_ERROR", this.Condition, this.RequiredArgCount.ToString())); + case "ap": + if (this.Values.Length == 1) + return tConditionMet(new int[] { (int)OpenTaiko.SaveFileInstances[player].data.AIBattleModePlaycount }, screen); + else + return (false, CLangManager.LangInstance.GetString("UNLOCK_CONDITION_ERROR", this.Condition, this.RequiredArgCount.ToString())); + case "aw": + if (this.Values.Length == 1) + return tConditionMet(new int[] { (int)OpenTaiko.SaveFileInstances[player].data.AIBattleModeWins }, screen); + else + return (false, CLangManager.LangInstance.GetString("UNLOCK_CONDITION_ERROR", this.Condition, this.RequiredArgCount.ToString())); + case "tp": + if (this.Values.Length == 1) + return tConditionMet(new int[] { (int)OpenTaiko.SaveFileInstances[player].data.TotalPlaycount }, screen); + else + return (false, CLangManager.LangInstance.GetString("UNLOCK_CONDITION_ERROR", this.Condition, this.RequiredArgCount.ToString())); + case "dp": + case "lp": + if (this.Values.Length == 3) + return tConditionMet(new int[] { tGetCountChartsPassingCondition(player) }, screen); + else + return (false, CLangManager.LangInstance.GetString("UNLOCK_CONDITION_ERROR", this.Condition, this.RequiredArgCount.ToString())); + case "sp": + case "sg": + case "sc": + if (this.Values.Length % this.RequiredArgCount == 0 + && this.Reference.Length == this.Values.Length / this.RequiredArgCount) + return tConditionMet(new int[] { tGetCountChartsPassingCondition(player) }, screen); + else + return (false, CLangManager.LangInstance.GetString("UNLOCK_CONDITION_ERROR2", this.Condition, this.RequiredArgCount.ToString())); + case "ig": + return (false, ""); } - // Condition type - [JsonProperty("condition")] - public string Condition; + return (false, CLangManager.LangInstance.GetString("UNLOCK_CONDITION_INVALID")); + } - // Condition values - [JsonProperty("values")] - public int[] Values; - - // Condition type - [JsonProperty("type")] - public string Type; - - // Referenced charts - [JsonProperty("references")] - public string[] Reference; - - [JsonIgnore] - private int RequiredArgCount = -1; - - public bool tHasCondition() { - return Condition != ""; - } - - /* - * (Note: Currently only me is relevant, the other types might be used in the future) - * == Types of conditions == - * l : "Less than" - * le : "Less or equal" - * e : "Equal" - * me : "More or equal" (Default) - * m : "More than" - * d : "Different" - */ - public bool tValueRequirementMet(int val1, int val2) { - switch (this.Type) { - case "l": - return (val1 < val2); - case "le": - return (val1 <= val2); - case "e": - return (val1 == val2); - case "me": - return (val1 >= val2); - case "m": - return (val1 > val2); - case "d": - return (val1 != val2); - default: - return (val1 >= val2); - } - } - - public string GetRequiredClearStatus(int status, bool exact = false) { - switch (status) { - case (int)EClearStatus.PERFECT: - return CLangManager.LangInstance.GetString(exact ? "UNLOCK_CONDITION_REQUIRE_PERFECT" : "UNLOCK_CONDITION_REQUIRE_PERFECT_MORE"); - case (int)EClearStatus.FC: - return CLangManager.LangInstance.GetString(exact ? "UNLOCK_CONDITION_REQUIRE_FC" : "UNLOCK_CONDITION_REQUIRE_FC_MORE"); - case (int)EClearStatus.CLEAR: - return CLangManager.LangInstance.GetString(exact ? "UNLOCK_CONDITION_REQUIRE_CLEAR" : "UNLOCK_CONDITION_REQUIRE_CLEAR_MORE"); - case (int)EClearStatus.ASSISTED_CLEAR: - return CLangManager.LangInstance.GetString(exact ? "UNLOCK_CONDITION_REQUIRE_ASSIST" : "UNLOCK_CONDITION_REQUIRE_ASSIST_MORE"); - default: - return CLangManager.LangInstance.GetString(exact ? "UNLOCK_CONDITION_REQUIRE_PLAY" : "UNLOCK_CONDITION_REQUIRE_PLAY_MORE"); - } - } - - /* - * == Condition avaliable == - * ch : "Coins here", coin requirement, payable within the heya menu, 1 value : [Coin price] - * cs : "Coins shop", coin requirement, payable only within the Medal shop selection screen - * cm : "Coins menu", coin requirement, payable only within the song select screen (used only for songs) - * ce : "Coins earned", coins earned since the creation of the save file, 1 value : [Total earned coins] - * dp : "Difficulty pass", count of difficulties pass, unlock check during the results screen, condition 3 values : [Difficulty int (0~4), Clear status (0~4), Number of performances], input 1 value [Plays fitting the condition] - * lp : "Level pass", count of level pass, unlock check during the results screen, condition 3 values : [Star rating, Clear status (0~4), Number of performances], input 1 value [Plays fitting the condition] - * sp : "Song performance", count of a specific song pass, unlock check during the results screen, condition 2 x n values for n songs : [Difficulty int (0~4, if -1 : Any), Clear status (0~4), ...], input 1 value [Count of fullfiled songs], n references for n songs (Song ids) - * sg : "Song genre (performance)", count of any unique song pass within a specific genre folder, unlock check during the results screen, condition 2 x n values for n songs : [Song count, Clear status (0~4), ...], input 1 value [Count of fullfiled genres], n references for n genres (Genre names) - * sc : "Song charter (performance)", count of any chart pass by a specific charter, unlock check during the results screen, condition 2 x n values for n songs : [Song count, Clear status (0~4), ...], input 1 value [Count of fullfiled charters], n references for n charters (Charter names) - * tp : "Total plays", 1 value : [Total playcount] - * ap : "AI battle plays", 1 value : [AI battle playcount] - * aw : "AI battle wins", 1 value : [AI battle wins count] - * ig : "Impossible to Get", (not recommanded) used to be able to have content in database that is impossible to unlock, no values - * - */ - public (bool, string?) tConditionMetWrapper(int player, EScreen screen = EScreen.MyRoom) { - if (RequiredArgCount < 0 && RequiredArgs.ContainsKey(Condition)) - RequiredArgCount = RequiredArgs[Condition]; + public (bool, string?) tConditionMet(int[] inputValues, EScreen screen) { + // Trying to unlock an item from the My Room menu (If my room buy => check if enough coints, else => Display a hint to how to get the item) + if (screen == EScreen.MyRoom) { switch (this.Condition) { + case "ch": + // Coins are strictly more or equal + this.Type = "me"; + bool fulfiled = this.tValueRequirementMet(inputValues[0], this.Values[0]); + return (fulfiled, CLangManager.LangInstance.GetString(fulfiled ? "UNLOCK_COIN_BOUGHT" : "UNLOCK_COIN_MORE")); + default: + return (false, null); // Return the same text if my room + } + } + // Unlockables from result screen or specific events (If any buy event => Invalid command, else check) + else if (screen == EScreen.Internal) { + switch (this.Condition) { + case "ch": case "cs": case "cm": - if (this.Values.Length == 1) - return tConditionMet(new int[] { (int)OpenTaiko.SaveFileInstances[player].data.Medals }, screen); - else - return (false, CLangManager.LangInstance.GetString("UNLOCK_CONDITION_ERROR", this.Condition, this.RequiredArgCount.ToString())); + return (false, CLangManager.LangInstance.GetString("UNLOCK_CONDITION_INVALID")); case "ce": - if (this.Values.Length == 1) - return tConditionMet(new int[] { (int)OpenTaiko.SaveFileInstances[player].data.TotalEarnedMedals }, screen); - else - return (false, CLangManager.LangInstance.GetString("UNLOCK_CONDITION_ERROR", this.Condition, this.RequiredArgCount.ToString())); - case "ap": - if (this.Values.Length == 1) - return tConditionMet(new int[] { (int)OpenTaiko.SaveFileInstances[player].data.AIBattleModePlaycount }, screen); - else - return (false, CLangManager.LangInstance.GetString("UNLOCK_CONDITION_ERROR", this.Condition, this.RequiredArgCount.ToString())); - case "aw": - if (this.Values.Length == 1) - return tConditionMet(new int[] { (int)OpenTaiko.SaveFileInstances[player].data.AIBattleModeWins }, screen); - else - return (false, CLangManager.LangInstance.GetString("UNLOCK_CONDITION_ERROR", this.Condition, this.RequiredArgCount.ToString())); case "tp": - if (this.Values.Length == 1) - return tConditionMet(new int[] { (int)OpenTaiko.SaveFileInstances[player].data.TotalPlaycount }, screen); - else - return (false, CLangManager.LangInstance.GetString("UNLOCK_CONDITION_ERROR", this.Condition, this.RequiredArgCount.ToString())); + case "ap": + case "aw": + bool fulfiled = this.tValueRequirementMet(inputValues[0], this.Values[0]); + return (fulfiled, ""); case "dp": case "lp": - if (this.Values.Length == 3) - return tConditionMet(new int[] { tGetCountChartsPassingCondition(player) }, screen); - else - return (false, CLangManager.LangInstance.GetString("UNLOCK_CONDITION_ERROR", this.Condition, this.RequiredArgCount.ToString())); + fulfiled = this.tValueRequirementMet(inputValues[0], this.Values[2]); + return (fulfiled, ""); case "sp": case "sg": case "sc": - if (this.Values.Length % this.RequiredArgCount == 0 - && this.Reference.Length == this.Values.Length / this.RequiredArgCount) - return tConditionMet(new int[] { tGetCountChartsPassingCondition(player) }, screen); - else - return (false, CLangManager.LangInstance.GetString("UNLOCK_CONDITION_ERROR2", this.Condition, this.RequiredArgCount.ToString())); - case "ig": - return (false, ""); + fulfiled = this.tValueRequirementMet(inputValues[0], this.Reference.Length); + return (fulfiled, ""); } - - return (false, CLangManager.LangInstance.GetString("UNLOCK_CONDITION_INVALID")); } - - - public (bool, string?) tConditionMet(int[] inputValues, EScreen screen) { - // Trying to unlock an item from the My Room menu (If my room buy => check if enough coints, else => Display a hint to how to get the item) - if (screen == EScreen.MyRoom) { - switch (this.Condition) { - case "ch": - // Coins are strictly more or equal - this.Type = "me"; - bool fulfiled = this.tValueRequirementMet(inputValues[0], this.Values[0]); - return (fulfiled, CLangManager.LangInstance.GetString(fulfiled ? "UNLOCK_COIN_BOUGHT" : "UNLOCK_COIN_MORE")); - default: - return (false, null); // Return the same text if my room - } - } - // Unlockables from result screen or specific events (If any buy event => Invalid command, else check) - else if (screen == EScreen.Internal) { - switch (this.Condition) { - - case "ch": - case "cs": - case "cm": - return (false, CLangManager.LangInstance.GetString("UNLOCK_CONDITION_INVALID")); - case "ce": - case "tp": - case "ap": - case "aw": - bool fulfiled = this.tValueRequirementMet(inputValues[0], this.Values[0]); - return (fulfiled, ""); - case "dp": - case "lp": - fulfiled = this.tValueRequirementMet(inputValues[0], this.Values[2]); - return (fulfiled, ""); - case "sp": - case "sg": - case "sc": - fulfiled = this.tValueRequirementMet(inputValues[0], this.Reference.Length); - return (fulfiled, ""); - } - } - // Trying to unlock an item from the Shop menu (If shop => check if enough coins, else => Invalid command) - else if (screen == EScreen.Shop) { - switch (this.Condition) { - case "cs": - // Coins are strictly more or equal - this.Type = "me"; - bool fulfiled = this.tValueRequirementMet(inputValues[0], this.Values[0]); - return (fulfiled, CLangManager.LangInstance.GetString(fulfiled ? "UNLOCK_COIN_BOUGHT" : "UNLOCK_COIN_MORE")); - default: - return (false, null); - } - } - // Trying to unlock an item from the Song Select screen (If song select => check if enough coins, else => Invalid command) - else if (screen == EScreen.SongSelect) { - switch (this.Condition) { - case "cm": - // Coins are strictly more or equal - this.Type = "me"; - bool fulfiled = this.tValueRequirementMet(inputValues[0], this.Values[0]); - return (fulfiled, CLangManager.LangInstance.GetString(fulfiled ? "UNLOCK_COIN_BOUGHT" : "UNLOCK_COIN_MORE")); - default: - return (false, null); - } - } - - return (false, CLangManager.LangInstance.GetString("UNLOCK_CONDITION_INVALID")); - } - - // My Room menu usage, to improve later - public string tConditionMessage(EScreen screen = EScreen.MyRoom) { - if (RequiredArgCount < 0 && RequiredArgs.ContainsKey(Condition)) - RequiredArgCount = RequiredArgs[Condition]; - - if (this.Values.Length < this.RequiredArgCount) - return CLangManager.LangInstance.GetString("UNLOCK_CONDITION_ERROR", this.Condition, this.RequiredArgCount); - - // Only the player loaded as 1P can check unlockables in real time - var SaveData = OpenTaiko.SaveFileInstances[OpenTaiko.SaveFile].data; - var ChartStats = SaveData.bestPlaysStats; - + // Trying to unlock an item from the Shop menu (If shop => check if enough coins, else => Invalid command) + else if (screen == EScreen.Shop) { switch (this.Condition) { - case "ch": { - if (screen == EScreen.MyRoom) - return CLangManager.LangInstance.GetString("UNLOCK_CONDITION_COST", this.Values[0]); - return (CLangManager.LangInstance.GetString("UNLOCK_CONDITION_INVALID")); - } - case "cs": { - if (screen == EScreen.Shop) - return CLangManager.LangInstance.GetString("UNLOCK_CONDITION_COST", this.Values[0]); - return (CLangManager.LangInstance.GetString("UNLOCK_CONDITION_SHOP")); - } - case "cm": { - if (screen == EScreen.SongSelect) - return CLangManager.LangInstance.GetString("UNLOCK_CONDITION_COST", this.Values[0]); - return (CLangManager.LangInstance.GetString("UNLOCK_CONDITION_INVALID")); - } - case "ce": - return CLangManager.LangInstance.GetString("UNLOCK_CONDITION_EARN", this.Values[0], SaveData.TotalEarnedMedals); - case "ap": - return CLangManager.LangInstance.GetString("UNLOCK_CONDITION_AIPLAY", this.Values[0], SaveData.AIBattleModePlaycount); - case "aw": - return CLangManager.LangInstance.GetString("UNLOCK_CONDITION_AIWIN", this.Values[0], SaveData.AIBattleModeWins); - case "tp": - return CLangManager.LangInstance.GetString("UNLOCK_CONDITION_PLAY", this.Values[0], SaveData.TotalPlaycount); - case "dp": { - var _aimedDifficulty = this.Values[0]; - var _aimedStatus = this.Values[1]; - - if (_aimedStatus < (int)EClearStatus.NONE || _aimedStatus >= (int)EClearStatus.TOTAL) return (CLangManager.LangInstance.GetString("UNLOCK_CONDITION_INVALID")); - if (_aimedDifficulty < (int)Difficulty.Easy || _aimedDifficulty > (int)Difficulty.Edit) return (CLangManager.LangInstance.GetString("UNLOCK_CONDITION_INVALID")); - - var _table = ChartStats.ClearStatuses[_aimedDifficulty]; - var _ura = ChartStats.ClearStatuses[(int)Difficulty.Edit]; - int _count = 0; - for (int i = _aimedStatus; i < (int)EClearStatus.TOTAL; i++) { - _count += _table[i]; - if (_aimedDifficulty == (int)Difficulty.Oni) _count += _ura[i]; - } - - var diffString = (_aimedDifficulty == (int)Difficulty.Oni) ? CLangManager.LangInstance.GetString("DIFF_EXEXTRA") : CLangManager.LangInstance.GetDifficulty(_aimedDifficulty); - var statusString = GetRequiredClearStatus(_aimedStatus); - return CLangManager.LangInstance.GetString("UNLOCK_CONDITION_PLAYDIFF", statusString, this.Values[2], diffString, _count); - } - case "lp": { - var _aimedDifficulty = this.Values[0]; - var _aimedStatus = this.Values[1]; - - if (_aimedStatus < (int)EClearStatus.NONE || _aimedStatus >= (int)EClearStatus.TOTAL) return (CLangManager.LangInstance.GetString("UNLOCK_CONDITION_INVALID")); - - int _count = 0; - if (_aimedStatus == (int)EClearStatus.NONE) _count = ChartStats.LevelPlays.TryGetValue(_aimedDifficulty, out var value) ? value : 0; - else if (_aimedStatus <= (int)EClearStatus.CLEAR) _count = ChartStats.LevelClears.TryGetValue(_aimedDifficulty, out var value) ? value : 0; - else if (_aimedStatus == (int)EClearStatus.FC) _count = ChartStats.LevelFCs.TryGetValue(_aimedDifficulty, out var value) ? value : 0; - else _count = ChartStats.LevelPerfects.TryGetValue(_aimedDifficulty, out var value) ? value : 0; - - var statusString = GetRequiredClearStatus(_aimedStatus); - return CLangManager.LangInstance.GetString("UNLOCK_CONDITION_PLAYLEVEL", statusString, this.Values[2], _aimedDifficulty, _count); - } - case "sp": { - List _rows = new List(); - var _challengeCount = this.Values.Length / this.RequiredArgCount; - - var _count = 0; - for (int i = 0; i < _challengeCount; i++) { - int _base = i * this.RequiredArgCount; - string _songId = this.Reference[i]; - var _aimedDifficulty = this.Values[_base]; - var _aimedStatus = this.Values[_base + 1]; - - var diffString = CLangManager.LangInstance.GetDifficulty(_aimedDifficulty); - var statusString = GetRequiredClearStatus(_aimedStatus); - var _songName = CSongDict.tGetNodeFromID(_songId)?.ldTitle.GetString("") ?? "[Not found]"; - - _rows.Add(CLangManager.LangInstance.GetString("UNLOCK_CONDITION_CHALLENGE_PLAYDIFF", statusString, _songName, diffString)); - - - // Safisfied count - if (_aimedDifficulty >= (int)Difficulty.Easy && _aimedDifficulty <= (int)Difficulty.Edit) { - string key = _songId + _aimedDifficulty.ToString(); - var _cht = SaveData.bestPlaysDistinctCharts.TryGetValue(key, out var value) ? value : null; - if (_cht != null && _cht.ClearStatus + 1 >= _aimedStatus) _count++; - - } else if (_aimedDifficulty < (int)Difficulty.Easy) { - for (int diff = (int)Difficulty.Easy; diff <= (int)Difficulty.Edit; diff++) { - string key = _songId + diff.ToString(); - var _cht = SaveData.bestPlaysDistinctCharts.TryGetValue(key, out var value) ? value : null; - if (_cht != null && _cht.ClearStatus + 1 >= _aimedStatus) { - _count++; - break; - } - } - } - } - - // Push front - _rows.Insert(0, CLangManager.LangInstance.GetString("UNLOCK_CONDITION_CHALLENGE", _count, _challengeCount)); - return String.Join("\n", _rows); - } - case "sg": { - List _rows = new List(); - var _challengeCount = this.Values.Length / this.RequiredArgCount; - - var _count = 0; - for (int i = 0; i < _challengeCount; i++) { - int _base = i * this.RequiredArgCount; - string _genreName = this.Reference[i]; - int _songCount = this.Values[_base]; - var _aimedStatus = this.Values[_base + 1]; - - int _satifsiedCount = 0; - if (_aimedStatus == (int)EClearStatus.NONE) _satifsiedCount = ChartStats.SongGenrePlays.TryGetValue(_genreName, out var value) ? value : 0; - else if (_aimedStatus <= (int)EClearStatus.CLEAR) _satifsiedCount = ChartStats.SongGenreClears.TryGetValue(_genreName, out var value) ? value : 0; - else if (_aimedStatus == (int)EClearStatus.FC) _satifsiedCount = ChartStats.SongGenreFCs.TryGetValue(_genreName, out var value) ? value : 0; - else _satifsiedCount = ChartStats.SongGenrePerfects.TryGetValue(_genreName, out var value) ? value : 0; - - if (_satifsiedCount >= _songCount) _count++; - - - var statusString = GetRequiredClearStatus(_aimedStatus); - _rows.Add(CLangManager.LangInstance.GetString("UNLOCK_CONDITION_CHALLENGE_PLAYGENRE", statusString, _songCount, _genreName, _satifsiedCount)); - } - - _rows.Insert(0, CLangManager.LangInstance.GetString("UNLOCK_CONDITION_CHALLENGE", _count, _challengeCount)); - return String.Join("\n", _rows); - } - case "sc": { - List _rows = new List(); - var _challengeCount = this.Values.Length / this.RequiredArgCount; - - var _count = 0; - for (int i = 0; i < _challengeCount; i++) { - int _base = i * this.RequiredArgCount; - string _charterName = this.Reference[i]; - int _songCount = this.Values[_base]; - var _aimedStatus = this.Values[_base + 1]; - - int _satifsiedCount = 0; - if (_aimedStatus == (int)EClearStatus.NONE) _satifsiedCount = ChartStats.CharterPlays.TryGetValue(_charterName, out var value) ? value : 0; - else if (_aimedStatus <= (int)EClearStatus.CLEAR) _satifsiedCount = ChartStats.CharterClears.TryGetValue(_charterName, out var value) ? value : 0; - else if (_aimedStatus == (int)EClearStatus.FC) _satifsiedCount = ChartStats.CharterFCs.TryGetValue(_charterName, out var value) ? value : 0; - else _satifsiedCount = ChartStats.CharterPerfects.TryGetValue(_charterName, out var value) ? value : 0; - - if (_satifsiedCount >= _songCount) _count++; - - - var statusString = GetRequiredClearStatus(_aimedStatus); - _rows.Add(CLangManager.LangInstance.GetString("UNLOCK_CONDITION_CHALLENGE_PLAYCHARTER", statusString, _songCount, _charterName, _satifsiedCount)); - } - - _rows.Insert(0, CLangManager.LangInstance.GetString("UNLOCK_CONDITION_CHALLENGE", _count, _challengeCount)); - return String.Join("\n", _rows); - } - + case "cs": + // Coins are strictly more or equal + this.Type = "me"; + bool fulfiled = this.tValueRequirementMet(inputValues[0], this.Values[0]); + return (fulfiled, CLangManager.LangInstance.GetString(fulfiled ? "UNLOCK_COIN_BOUGHT" : "UNLOCK_COIN_MORE")); + default: + return (false, null); } - // Includes cm or ig which are not supposed to be displayed in My Room - return (CLangManager.LangInstance.GetString("UNLOCK_CONDITION_INVALID")); } - - public enum EScreen { - MyRoom, - Shop, - SongSelect, - Internal - } - - #region [private calls] - - private int tGetCountChartsPassingCondition(int player) { - int _aimedDifficulty = 0; - int _aimedStatus = 0; - - if (this.Condition == "dp" || this.Condition == "lp") { - _aimedDifficulty = this.Values[0]; // Difficulty if dp, Level if lp - _aimedStatus = this.Values[1]; - - // dp and lp only work for regular (Dan and Tower excluded) charts - if (_aimedStatus < (int)EClearStatus.NONE || _aimedStatus >= (int)EClearStatus.TOTAL) return 0; - if (this.Condition == "dp" && (_aimedDifficulty < (int)Difficulty.Easy || _aimedDifficulty > (int)Difficulty.Edit)) return 0; - } - - var bpDistinctCharts = OpenTaiko.SaveFileInstances[player].data.bestPlaysDistinctCharts; - var chartStats = OpenTaiko.SaveFileInstances[player].data.bestPlaysStats; - + // Trying to unlock an item from the Song Select screen (If song select => check if enough coins, else => Invalid command) + else if (screen == EScreen.SongSelect) { switch (this.Condition) { - case "dp": - var _table = chartStats.ClearStatuses[_aimedDifficulty]; - var _ura = chartStats.ClearStatuses[(int)Difficulty.Edit]; + case "cm": + // Coins are strictly more or equal + this.Type = "me"; + bool fulfiled = this.tValueRequirementMet(inputValues[0], this.Values[0]); + return (fulfiled, CLangManager.LangInstance.GetString(fulfiled ? "UNLOCK_COIN_BOUGHT" : "UNLOCK_COIN_MORE")); + default: + return (false, null); + } + } + + return (false, CLangManager.LangInstance.GetString("UNLOCK_CONDITION_INVALID")); + } + + // My Room menu usage, to improve later + public string tConditionMessage(EScreen screen = EScreen.MyRoom) { + if (RequiredArgCount < 0 && RequiredArgs.ContainsKey(Condition)) + RequiredArgCount = RequiredArgs[Condition]; + + if (this.Values.Length < this.RequiredArgCount) + return CLangManager.LangInstance.GetString("UNLOCK_CONDITION_ERROR", this.Condition, this.RequiredArgCount); + + // Only the player loaded as 1P can check unlockables in real time + var SaveData = OpenTaiko.SaveFileInstances[OpenTaiko.SaveFile].data; + var ChartStats = SaveData.bestPlaysStats; + + switch (this.Condition) { + case "ch": { + if (screen == EScreen.MyRoom) + return CLangManager.LangInstance.GetString("UNLOCK_CONDITION_COST", this.Values[0]); + return (CLangManager.LangInstance.GetString("UNLOCK_CONDITION_INVALID")); + } + case "cs": { + if (screen == EScreen.Shop) + return CLangManager.LangInstance.GetString("UNLOCK_CONDITION_COST", this.Values[0]); + return (CLangManager.LangInstance.GetString("UNLOCK_CONDITION_SHOP")); + } + case "cm": { + if (screen == EScreen.SongSelect) + return CLangManager.LangInstance.GetString("UNLOCK_CONDITION_COST", this.Values[0]); + return (CLangManager.LangInstance.GetString("UNLOCK_CONDITION_INVALID")); + } + case "ce": + return CLangManager.LangInstance.GetString("UNLOCK_CONDITION_EARN", this.Values[0], SaveData.TotalEarnedMedals); + case "ap": + return CLangManager.LangInstance.GetString("UNLOCK_CONDITION_AIPLAY", this.Values[0], SaveData.AIBattleModePlaycount); + case "aw": + return CLangManager.LangInstance.GetString("UNLOCK_CONDITION_AIWIN", this.Values[0], SaveData.AIBattleModeWins); + case "tp": + return CLangManager.LangInstance.GetString("UNLOCK_CONDITION_PLAY", this.Values[0], SaveData.TotalPlaycount); + case "dp": { + var _aimedDifficulty = this.Values[0]; + var _aimedStatus = this.Values[1]; + + if (_aimedStatus < (int)EClearStatus.NONE || _aimedStatus >= (int)EClearStatus.TOTAL) return (CLangManager.LangInstance.GetString("UNLOCK_CONDITION_INVALID")); + if (_aimedDifficulty < (int)Difficulty.Easy || _aimedDifficulty > (int)Difficulty.Edit) return (CLangManager.LangInstance.GetString("UNLOCK_CONDITION_INVALID")); + + var _table = ChartStats.ClearStatuses[_aimedDifficulty]; + var _ura = ChartStats.ClearStatuses[(int)Difficulty.Edit]; int _count = 0; for (int i = _aimedStatus; i < (int)EClearStatus.TOTAL; i++) { _count += _table[i]; if (_aimedDifficulty == (int)Difficulty.Oni) _count += _ura[i]; } - return _count; - case "lp": - if (_aimedStatus == (int)EClearStatus.NONE) return chartStats.LevelPlays.TryGetValue(_aimedDifficulty, out var value) ? value : 0; - else if (_aimedStatus <= (int)EClearStatus.CLEAR) return chartStats.LevelClears.TryGetValue(_aimedDifficulty, out var value) ? value : 0; - else if (_aimedStatus == (int)EClearStatus.FC) return chartStats.LevelFCs.TryGetValue(_aimedDifficulty, out var value) ? value : 0; - else return chartStats.LevelPerfects.TryGetValue(_aimedDifficulty, out var value) ? value : 0; - case "sp": - _count = 0; - for (int i = 0; i < this.Values.Length / this.RequiredArgCount; i++) { + + var diffString = (_aimedDifficulty == (int)Difficulty.Oni) ? CLangManager.LangInstance.GetString("DIFF_EXEXTRA") : CLangManager.LangInstance.GetDifficulty(_aimedDifficulty); + var statusString = GetRequiredClearStatus(_aimedStatus); + return CLangManager.LangInstance.GetString("UNLOCK_CONDITION_PLAYDIFF", statusString, this.Values[2], diffString, _count); + } + case "lp": { + var _aimedDifficulty = this.Values[0]; + var _aimedStatus = this.Values[1]; + + if (_aimedStatus < (int)EClearStatus.NONE || _aimedStatus >= (int)EClearStatus.TOTAL) return (CLangManager.LangInstance.GetString("UNLOCK_CONDITION_INVALID")); + + int _count = 0; + if (_aimedStatus == (int)EClearStatus.NONE) _count = ChartStats.LevelPlays.TryGetValue(_aimedDifficulty, out var value) ? value : 0; + else if (_aimedStatus <= (int)EClearStatus.CLEAR) _count = ChartStats.LevelClears.TryGetValue(_aimedDifficulty, out var value) ? value : 0; + else if (_aimedStatus == (int)EClearStatus.FC) _count = ChartStats.LevelFCs.TryGetValue(_aimedDifficulty, out var value) ? value : 0; + else _count = ChartStats.LevelPerfects.TryGetValue(_aimedDifficulty, out var value) ? value : 0; + + var statusString = GetRequiredClearStatus(_aimedStatus); + return CLangManager.LangInstance.GetString("UNLOCK_CONDITION_PLAYLEVEL", statusString, this.Values[2], _aimedDifficulty, _count); + } + case "sp": { + List _rows = new List(); + var _challengeCount = this.Values.Length / this.RequiredArgCount; + + var _count = 0; + for (int i = 0; i < _challengeCount; i++) { int _base = i * this.RequiredArgCount; string _songId = this.Reference[i]; - _aimedDifficulty = this.Values[_base]; - _aimedStatus = this.Values[_base + 1]; + var _aimedDifficulty = this.Values[_base]; + var _aimedStatus = this.Values[_base + 1]; + var diffString = CLangManager.LangInstance.GetDifficulty(_aimedDifficulty); + var statusString = GetRequiredClearStatus(_aimedStatus); + var _songName = CSongDict.tGetNodeFromID(_songId)?.ldTitle.GetString("") ?? "[Not found]"; + + _rows.Add(CLangManager.LangInstance.GetString("UNLOCK_CONDITION_CHALLENGE_PLAYDIFF", statusString, _songName, diffString)); + + + // Safisfied count if (_aimedDifficulty >= (int)Difficulty.Easy && _aimedDifficulty <= (int)Difficulty.Edit) { string key = _songId + _aimedDifficulty.ToString(); - var _cht = bpDistinctCharts.TryGetValue(key, out var value) ? value : null; + var _cht = SaveData.bestPlaysDistinctCharts.TryGetValue(key, out var value) ? value : null; if (_cht != null && _cht.ClearStatus + 1 >= _aimedStatus) _count++; } else if (_aimedDifficulty < (int)Difficulty.Easy) { for (int diff = (int)Difficulty.Easy; diff <= (int)Difficulty.Edit; diff++) { string key = _songId + diff.ToString(); - var _cht = bpDistinctCharts.TryGetValue(key, out var value) ? value : null; + var _cht = SaveData.bestPlaysDistinctCharts.TryGetValue(key, out var value) ? value : null; if (_cht != null && _cht.ClearStatus + 1 >= _aimedStatus) { _count++; break; @@ -471,46 +343,174 @@ namespace OpenTaiko { } } } - return _count; - case "sg": - _count = 0; - for (int i = 0; i < this.Values.Length / this.RequiredArgCount; i++) { + + // Push front + _rows.Insert(0, CLangManager.LangInstance.GetString("UNLOCK_CONDITION_CHALLENGE", _count, _challengeCount)); + return String.Join("\n", _rows); + } + case "sg": { + List _rows = new List(); + var _challengeCount = this.Values.Length / this.RequiredArgCount; + + var _count = 0; + for (int i = 0; i < _challengeCount; i++) { int _base = i * this.RequiredArgCount; string _genreName = this.Reference[i]; int _songCount = this.Values[_base]; - _aimedStatus = this.Values[_base + 1]; + var _aimedStatus = this.Values[_base + 1]; int _satifsiedCount = 0; - if (_aimedStatus == (int)EClearStatus.NONE) _satifsiedCount = chartStats.SongGenrePlays.TryGetValue(_genreName, out var value) ? value : 0; - else if (_aimedStatus <= (int)EClearStatus.CLEAR) _satifsiedCount = chartStats.SongGenreClears.TryGetValue(_genreName, out var value) ? value : 0; - else if (_aimedStatus == (int)EClearStatus.FC) _satifsiedCount = chartStats.SongGenreFCs.TryGetValue(_genreName, out var value) ? value : 0; - else _satifsiedCount = chartStats.SongGenrePerfects.TryGetValue(_genreName, out var value) ? value : 0; + if (_aimedStatus == (int)EClearStatus.NONE) _satifsiedCount = ChartStats.SongGenrePlays.TryGetValue(_genreName, out var value) ? value : 0; + else if (_aimedStatus <= (int)EClearStatus.CLEAR) _satifsiedCount = ChartStats.SongGenreClears.TryGetValue(_genreName, out var value) ? value : 0; + else if (_aimedStatus == (int)EClearStatus.FC) _satifsiedCount = ChartStats.SongGenreFCs.TryGetValue(_genreName, out var value) ? value : 0; + else _satifsiedCount = ChartStats.SongGenrePerfects.TryGetValue(_genreName, out var value) ? value : 0; if (_satifsiedCount >= _songCount) _count++; + + + var statusString = GetRequiredClearStatus(_aimedStatus); + _rows.Add(CLangManager.LangInstance.GetString("UNLOCK_CONDITION_CHALLENGE_PLAYGENRE", statusString, _songCount, _genreName, _satifsiedCount)); } - return _count; - case "sc": - _count = 0; - for (int i = 0; i < this.Values.Length / this.RequiredArgCount; i++) { + + _rows.Insert(0, CLangManager.LangInstance.GetString("UNLOCK_CONDITION_CHALLENGE", _count, _challengeCount)); + return String.Join("\n", _rows); + } + case "sc": { + List _rows = new List(); + var _challengeCount = this.Values.Length / this.RequiredArgCount; + + var _count = 0; + for (int i = 0; i < _challengeCount; i++) { int _base = i * this.RequiredArgCount; string _charterName = this.Reference[i]; int _songCount = this.Values[_base]; - _aimedStatus = this.Values[_base + 1]; + var _aimedStatus = this.Values[_base + 1]; int _satifsiedCount = 0; - if (_aimedStatus == (int)EClearStatus.NONE) _satifsiedCount = chartStats.CharterPlays.TryGetValue(_charterName, out var value) ? value : 0; - else if (_aimedStatus <= (int)EClearStatus.CLEAR) _satifsiedCount = chartStats.CharterClears.TryGetValue(_charterName, out var value) ? value : 0; - else if (_aimedStatus == (int)EClearStatus.FC) _satifsiedCount = chartStats.CharterFCs.TryGetValue(_charterName, out var value) ? value : 0; - else _satifsiedCount = chartStats.CharterPerfects.TryGetValue(_charterName, out var value) ? value : 0; + if (_aimedStatus == (int)EClearStatus.NONE) _satifsiedCount = ChartStats.CharterPlays.TryGetValue(_charterName, out var value) ? value : 0; + else if (_aimedStatus <= (int)EClearStatus.CLEAR) _satifsiedCount = ChartStats.CharterClears.TryGetValue(_charterName, out var value) ? value : 0; + else if (_aimedStatus == (int)EClearStatus.FC) _satifsiedCount = ChartStats.CharterFCs.TryGetValue(_charterName, out var value) ? value : 0; + else _satifsiedCount = ChartStats.CharterPerfects.TryGetValue(_charterName, out var value) ? value : 0; if (_satifsiedCount >= _songCount) _count++; + + + var statusString = GetRequiredClearStatus(_aimedStatus); + _rows.Add(CLangManager.LangInstance.GetString("UNLOCK_CONDITION_CHALLENGE_PLAYCHARTER", statusString, _songCount, _charterName, _satifsiedCount)); } - return _count; - } - return -1; + + _rows.Insert(0, CLangManager.LangInstance.GetString("UNLOCK_CONDITION_CHALLENGE", _count, _challengeCount)); + return String.Join("\n", _rows); + } + + } + // Includes cm or ig which are not supposed to be displayed in My Room + return (CLangManager.LangInstance.GetString("UNLOCK_CONDITION_INVALID")); + } + + public enum EScreen { + MyRoom, + Shop, + SongSelect, + Internal + } + + #region [private calls] + + private int tGetCountChartsPassingCondition(int player) { + int _aimedDifficulty = 0; + int _aimedStatus = 0; + + if (this.Condition == "dp" || this.Condition == "lp") { + _aimedDifficulty = this.Values[0]; // Difficulty if dp, Level if lp + _aimedStatus = this.Values[1]; + + // dp and lp only work for regular (Dan and Tower excluded) charts + if (_aimedStatus < (int)EClearStatus.NONE || _aimedStatus >= (int)EClearStatus.TOTAL) return 0; + if (this.Condition == "dp" && (_aimedDifficulty < (int)Difficulty.Easy || _aimedDifficulty > (int)Difficulty.Edit)) return 0; } - #endregion + var bpDistinctCharts = OpenTaiko.SaveFileInstances[player].data.bestPlaysDistinctCharts; + var chartStats = OpenTaiko.SaveFileInstances[player].data.bestPlaysStats; + + switch (this.Condition) { + case "dp": + var _table = chartStats.ClearStatuses[_aimedDifficulty]; + var _ura = chartStats.ClearStatuses[(int)Difficulty.Edit]; + int _count = 0; + for (int i = _aimedStatus; i < (int)EClearStatus.TOTAL; i++) { + _count += _table[i]; + if (_aimedDifficulty == (int)Difficulty.Oni) _count += _ura[i]; + } + return _count; + case "lp": + if (_aimedStatus == (int)EClearStatus.NONE) return chartStats.LevelPlays.TryGetValue(_aimedDifficulty, out var value) ? value : 0; + else if (_aimedStatus <= (int)EClearStatus.CLEAR) return chartStats.LevelClears.TryGetValue(_aimedDifficulty, out var value) ? value : 0; + else if (_aimedStatus == (int)EClearStatus.FC) return chartStats.LevelFCs.TryGetValue(_aimedDifficulty, out var value) ? value : 0; + else return chartStats.LevelPerfects.TryGetValue(_aimedDifficulty, out var value) ? value : 0; + case "sp": + _count = 0; + for (int i = 0; i < this.Values.Length / this.RequiredArgCount; i++) { + int _base = i * this.RequiredArgCount; + string _songId = this.Reference[i]; + _aimedDifficulty = this.Values[_base]; + _aimedStatus = this.Values[_base + 1]; + + if (_aimedDifficulty >= (int)Difficulty.Easy && _aimedDifficulty <= (int)Difficulty.Edit) { + string key = _songId + _aimedDifficulty.ToString(); + var _cht = bpDistinctCharts.TryGetValue(key, out var value) ? value : null; + if (_cht != null && _cht.ClearStatus + 1 >= _aimedStatus) _count++; + + } else if (_aimedDifficulty < (int)Difficulty.Easy) { + for (int diff = (int)Difficulty.Easy; diff <= (int)Difficulty.Edit; diff++) { + string key = _songId + diff.ToString(); + var _cht = bpDistinctCharts.TryGetValue(key, out var value) ? value : null; + if (_cht != null && _cht.ClearStatus + 1 >= _aimedStatus) { + _count++; + break; + } + } + } + } + return _count; + case "sg": + _count = 0; + for (int i = 0; i < this.Values.Length / this.RequiredArgCount; i++) { + int _base = i * this.RequiredArgCount; + string _genreName = this.Reference[i]; + int _songCount = this.Values[_base]; + _aimedStatus = this.Values[_base + 1]; + + int _satifsiedCount = 0; + if (_aimedStatus == (int)EClearStatus.NONE) _satifsiedCount = chartStats.SongGenrePlays.TryGetValue(_genreName, out var value) ? value : 0; + else if (_aimedStatus <= (int)EClearStatus.CLEAR) _satifsiedCount = chartStats.SongGenreClears.TryGetValue(_genreName, out var value) ? value : 0; + else if (_aimedStatus == (int)EClearStatus.FC) _satifsiedCount = chartStats.SongGenreFCs.TryGetValue(_genreName, out var value) ? value : 0; + else _satifsiedCount = chartStats.SongGenrePerfects.TryGetValue(_genreName, out var value) ? value : 0; + + if (_satifsiedCount >= _songCount) _count++; + } + return _count; + case "sc": + _count = 0; + for (int i = 0; i < this.Values.Length / this.RequiredArgCount; i++) { + int _base = i * this.RequiredArgCount; + string _charterName = this.Reference[i]; + int _songCount = this.Values[_base]; + _aimedStatus = this.Values[_base + 1]; + + int _satifsiedCount = 0; + if (_aimedStatus == (int)EClearStatus.NONE) _satifsiedCount = chartStats.CharterPlays.TryGetValue(_charterName, out var value) ? value : 0; + else if (_aimedStatus <= (int)EClearStatus.CLEAR) _satifsiedCount = chartStats.CharterClears.TryGetValue(_charterName, out var value) ? value : 0; + else if (_aimedStatus == (int)EClearStatus.FC) _satifsiedCount = chartStats.CharterFCs.TryGetValue(_charterName, out var value) ? value : 0; + else _satifsiedCount = chartStats.CharterPerfects.TryGetValue(_charterName, out var value) ? value : 0; + + if (_satifsiedCount >= _songCount) _count++; + } + return _count; + } + return -1; } + + #endregion } } diff --git a/OpenTaiko/src/Databases/Databases.cs b/OpenTaiko/src/Databases/Databases.cs index 56256457..483d503a 100644 --- a/OpenTaiko/src/Databases/Databases.cs +++ b/OpenTaiko/src/Databases/Databases.cs @@ -1,15 +1,15 @@ -namespace OpenTaiko { - class Databases { - public void tDatabases() { - DBCDN = new DBCDN(); - DBEncyclopediaMenus = new DBEncyclopediaMenus(); - DBNameplateUnlockables = new DBNameplateUnlockables(); - DBSongUnlockables = new DBSongUnlockables(); - } +namespace OpenTaiko; - public DBCDN DBCDN; - public DBEncyclopediaMenus DBEncyclopediaMenus; - public DBNameplateUnlockables DBNameplateUnlockables; - public DBSongUnlockables DBSongUnlockables; +class Databases { + public void tDatabases() { + DBCDN = new DBCDN(); + DBEncyclopediaMenus = new DBEncyclopediaMenus(); + DBNameplateUnlockables = new DBNameplateUnlockables(); + DBSongUnlockables = new DBSongUnlockables(); } + + public DBCDN DBCDN; + public DBEncyclopediaMenus DBEncyclopediaMenus; + public DBNameplateUnlockables DBNameplateUnlockables; + public DBSongUnlockables DBSongUnlockables; } diff --git a/OpenTaiko/src/Helpers/HDatabaseHelpers.cs b/OpenTaiko/src/Helpers/HDatabaseHelpers.cs index fe3513b8..a440584f 100644 --- a/OpenTaiko/src/Helpers/HDatabaseHelpers.cs +++ b/OpenTaiko/src/Helpers/HDatabaseHelpers.cs @@ -1,22 +1,22 @@ using Microsoft.Data.Sqlite; -namespace OpenTaiko { - public static class HDatabaseHelpers { - public static List GetAvailableLanguage(SqliteConnection connection, string prefix) { - List _translations = new List(); - foreach (string cd in CLangManager.Langcodes) { - SqliteCommand chk = connection.CreateCommand(); - chk.CommandText = +namespace OpenTaiko; + +public static class HDatabaseHelpers { + public static List GetAvailableLanguage(SqliteConnection connection, string prefix) { + List _translations = new List(); + foreach (string cd in CLangManager.Langcodes) { + SqliteCommand chk = connection.CreateCommand(); + chk.CommandText = @$" SELECT count(*) FROM sqlite_master WHERE type='table' AND name='{prefix}_{cd}'; "; - SqliteDataReader chkreader = chk.ExecuteReader(); - while (chkreader.Read()) { - if (chkreader.GetInt32(0) > 0) - _translations.Add(cd); - } + SqliteDataReader chkreader = chk.ExecuteReader(); + while (chkreader.Read()) { + if (chkreader.GetInt32(0) > 0) + _translations.Add(cd); } - return _translations; } + return _translations; } } diff --git a/OpenTaiko/src/Helpers/HEasingMethods.cs b/OpenTaiko/src/Helpers/HEasingMethods.cs index 790b10eb..b240cff2 100644 --- a/OpenTaiko/src/Helpers/HEasingMethods.cs +++ b/OpenTaiko/src/Helpers/HEasingMethods.cs @@ -1,341 +1,341 @@ -namespace OpenTaiko { - internal class HEasingMethods { - public enum EEaseType { - IN = 0, - OUT, - INOUT, - OUTIN - } +namespace OpenTaiko; - public enum EEaseFunction { - LINEAR = 0, - SINE, - QUAD, - CUBIC, - QUART, - QUINT, - EXPO, - CIRC, - ELASTIC, - BACK, - BOUNCE - } +internal class HEasingMethods { + public enum EEaseType { + IN = 0, + OUT, + INOUT, + OUTIN + } - private static readonly Dictionary> _easeMethods = new Dictionary>() { - [EEaseFunction.LINEAR] = _easeLinear, - [EEaseFunction.SINE] = _easeSine, - [EEaseFunction.QUAD] = _easeQuad, - [EEaseFunction.CUBIC] = _easeCubic, - [EEaseFunction.QUART] = _easeQuart, - [EEaseFunction.QUINT] = _easeQuint, - [EEaseFunction.EXPO] = _easeExpo, - [EEaseFunction.CIRC] = _easeCirc, - [EEaseFunction.ELASTIC] = _easeElastic, - [EEaseFunction.BACK] = _easeBack, - [EEaseFunction.BOUNCE] = _easeBounce, - }; + public enum EEaseFunction { + LINEAR = 0, + SINE, + QUAD, + CUBIC, + QUART, + QUINT, + EXPO, + CIRC, + ELASTIC, + BACK, + BOUNCE + } - private static double _easeOut(Func f, double x) { - return 1.0 - f(1 - x); - } + private static readonly Dictionary> _easeMethods = new Dictionary>() { + [EEaseFunction.LINEAR] = _easeLinear, + [EEaseFunction.SINE] = _easeSine, + [EEaseFunction.QUAD] = _easeQuad, + [EEaseFunction.CUBIC] = _easeCubic, + [EEaseFunction.QUART] = _easeQuart, + [EEaseFunction.QUINT] = _easeQuint, + [EEaseFunction.EXPO] = _easeExpo, + [EEaseFunction.CIRC] = _easeCirc, + [EEaseFunction.ELASTIC] = _easeElastic, + [EEaseFunction.BACK] = _easeBack, + [EEaseFunction.BOUNCE] = _easeBounce, + }; - private static double _easeInOut(Func f, double x) { - return (x < 0.5) ? 0.5 * f(x * 2) : 0.5 * (1 - f((1 - x) * 2)) + 0.5; - } + private static double _easeOut(Func f, double x) { + return 1.0 - f(1 - x); + } - private static double _easeOutIn(Func f, double x) { - return (x < 0.5) ? 0.5 * (1 - f((1 - x) * 2)) : 0.5 * (1 - (1 - f(1 - (1 - x) * 2))) + 0.5; - } + private static double _easeInOut(Func f, double x) { + return (x < 0.5) ? 0.5 * f(x * 2) : 0.5 * (1 - f((1 - x) * 2)) + 0.5; + } - private static double _easeLinear(double x) { - return x; - } + private static double _easeOutIn(Func f, double x) { + return (x < 0.5) ? 0.5 * (1 - f((1 - x) * 2)) : 0.5 * (1 - (1 - f(1 - (1 - x) * 2))) + 0.5; + } - private static double _easeQuad(double x) { - return x * x; - } + private static double _easeLinear(double x) { + return x; + } - private static double _easeCubic(double x) { - return x * x * x; - } + private static double _easeQuad(double x) { + return x * x; + } - private static double _easeQuart(double x) { - return x * x * x * x; - } + private static double _easeCubic(double x) { + return x * x * x; + } - private static double _easeQuint(double x) { - return x * x * x * x * x; - } + private static double _easeQuart(double x) { + return x * x * x * x; + } - private static double _easeExpo(double x) { - return x == 0 ? 0 : Math.Pow(2, 10 * (x - 1)); - } + private static double _easeQuint(double x) { + return x * x * x * x * x; + } - private static double _easeSine(double x) { - return 1.0 - Math.Cos((x * Math.PI) / 2.0); - } + private static double _easeExpo(double x) { + return x == 0 ? 0 : Math.Pow(2, 10 * (x - 1)); + } - private static double _easeCirc(double x) { - return 1.0 - Math.Sqrt(1 - Math.Pow(x, 2)); - } + private static double _easeSine(double x) { + return 1.0 - Math.Cos((x * Math.PI) / 2.0); + } - private static double _easeBack(double x) { - return x * x * (2.7 * x - 1.7); - } + private static double _easeCirc(double x) { + return 1.0 - Math.Sqrt(1 - Math.Pow(x, 2)); + } - private static double _easeElastic(double x) { - if (x == 0 || x == 1) return x; + private static double _easeBack(double x) { + return x * x * (2.7 * x - 1.7); + } - const double c4 = (2 * Math.PI) / 3; + private static double _easeElastic(double x) { + if (x == 0 || x == 1) return x; - return -Math.Pow(2, 10 * x - 10) * Math.Sin((x * 10 - 10.75) * c4); - } + const double c4 = (2 * Math.PI) / 3; - private static double _easeBounce(double x) { - const double c1 = 2.75; - const double c2 = 7.5625; - double c3 = x * x; + return -Math.Pow(2, 10 * x - 10) * Math.Sin((x * 10 - 10.75) * c4); + } - if (x < 1.0 / c1) - return c2 * c3; - else if (x < 2.0 / c1) - return c2 * c3 + 0.75; - else if (x < 2.5 / c1) - return c2 * c3 + 0.9375; - return c2 * c3 + 0.984375; - } + private static double _easeBounce(double x) { + const double c1 = 2.75; + const double c2 = 7.5625; + double c3 = x * x; - #region [Legacy] + if (x < 1.0 / c1) + return c2 * c3; + else if (x < 2.0 / c1) + return c2 * c3 + 0.75; + else if (x < 2.5 / c1) + return c2 * c3 + 0.9375; + return c2 * c3 + 0.984375; + } - /* + #region [Legacy] - private static double _easeSine(EEaseType type, double x) - { - switch (type) { - case EEaseType.IN: - default: - return 1 - Math.Cos((x * Math.PI) / 2.0); - case EEaseType.OUT: - return Math.Sin((x * Math.PI) / 2.0); - case EEaseType.INOUT: - return -(Math.Cos(x * Math.PI) - 1) / 2.0; - case EEaseType.OUTIN: - return x; - } + /* + + private static double _easeSine(EEaseType type, double x) + { + switch (type) { + case EEaseType.IN: + default: + return 1 - Math.Cos((x * Math.PI) / 2.0); + case EEaseType.OUT: + return Math.Sin((x * Math.PI) / 2.0); + case EEaseType.INOUT: + return -(Math.Cos(x * Math.PI) - 1) / 2.0; + case EEaseType.OUTIN: + return x; } + } - private static double _easeQuad(EEaseType type, double x) + private static double _easeQuad(EEaseType type, double x) + { + switch (type) { - switch (type) - { - case EEaseType.IN: - default: - return x * x; - case EEaseType.OUT: - return 1 - (1 - x) * (1 - x); - case EEaseType.INOUT: - return x < 0.5 ? 2 * x * x : 1 - Math.Pow(-2 * x + 2, 2) / 2.0; - case EEaseType.OUTIN: - return x; - } + case EEaseType.IN: + default: + return x * x; + case EEaseType.OUT: + return 1 - (1 - x) * (1 - x); + case EEaseType.INOUT: + return x < 0.5 ? 2 * x * x : 1 - Math.Pow(-2 * x + 2, 2) / 2.0; + case EEaseType.OUTIN: + return x; } + } - private static double _easeCubic(EEaseType type, double x) + private static double _easeCubic(EEaseType type, double x) + { + switch (type) { - switch (type) - { - case EEaseType.IN: - default: - return x * x * x; - case EEaseType.OUT: - return 1 - Math.Pow(1 - x, 3); - case EEaseType.INOUT: - return x < 0.5 ? 4 * x * x * x : 1 - Math.Pow(-2 * x + 2, 3) / 2.0; - case EEaseType.OUTIN: - return x; - } + case EEaseType.IN: + default: + return x * x * x; + case EEaseType.OUT: + return 1 - Math.Pow(1 - x, 3); + case EEaseType.INOUT: + return x < 0.5 ? 4 * x * x * x : 1 - Math.Pow(-2 * x + 2, 3) / 2.0; + case EEaseType.OUTIN: + return x; } + } - private static double _easeQuart(EEaseType type, double x) + private static double _easeQuart(EEaseType type, double x) + { + switch (type) { - switch (type) - { - case EEaseType.IN: - default: - return x * x * x * x; - case EEaseType.OUT: - return 1 - Math.Pow(1 - x, 4); - case EEaseType.INOUT: - return x < 0.5 ? 8 * x * x * x * x : 1 - Math.Pow(-2 * x + 2, 4) / 2.0; - case EEaseType.OUTIN: - return x; - } + case EEaseType.IN: + default: + return x * x * x * x; + case EEaseType.OUT: + return 1 - Math.Pow(1 - x, 4); + case EEaseType.INOUT: + return x < 0.5 ? 8 * x * x * x * x : 1 - Math.Pow(-2 * x + 2, 4) / 2.0; + case EEaseType.OUTIN: + return x; } + } - private static double _easeQuint(EEaseType type, double x) + private static double _easeQuint(EEaseType type, double x) + { + switch (type) { - switch (type) - { - case EEaseType.IN: - default: - return x * x * x * x * x; - case EEaseType.OUT: - return 1 - Math.Pow(1 - x, 5); - case EEaseType.INOUT: - return x < 0.5 ? 16 * x * x * x * x * x : 1 - Math.Pow(-2 * x + 2, 5) / 2.0; - case EEaseType.OUTIN: - return x; - } + case EEaseType.IN: + default: + return x * x * x * x * x; + case EEaseType.OUT: + return 1 - Math.Pow(1 - x, 5); + case EEaseType.INOUT: + return x < 0.5 ? 16 * x * x * x * x * x : 1 - Math.Pow(-2 * x + 2, 5) / 2.0; + case EEaseType.OUTIN: + return x; } + } - private static double _easeExpo(EEaseType type, double x) + private static double _easeExpo(EEaseType type, double x) + { + switch (type) { - switch (type) - { - case EEaseType.IN: - default: - return x == 0 ? 0 : Math.Pow(2, 10 * x - 10); - case EEaseType.OUT: - return x == 1 ? 1 : 1 - Math.Pow(2, -10 * x); - case EEaseType.INOUT: - return x == 0 - ? 0 - : x == 1 - ? 1 - : x < 0.5 - ? Math.Pow(2, 20 * x - 10) / 2 - : (2 - Math.Pow(2, -20 * x + 10)) / 2; ; - case EEaseType.OUTIN: - return x; - } + case EEaseType.IN: + default: + return x == 0 ? 0 : Math.Pow(2, 10 * x - 10); + case EEaseType.OUT: + return x == 1 ? 1 : 1 - Math.Pow(2, -10 * x); + case EEaseType.INOUT: + return x == 0 + ? 0 + : x == 1 + ? 1 + : x < 0.5 + ? Math.Pow(2, 20 * x - 10) / 2 + : (2 - Math.Pow(2, -20 * x + 10)) / 2; ; + case EEaseType.OUTIN: + return x; } + } - private static double _easeCirc(EEaseType type, double x) + private static double _easeCirc(EEaseType type, double x) + { + switch (type) { - switch (type) - { - case EEaseType.IN: - default: - return 1 - Math.Sqrt(1 - Math.Pow(x, 2)); - case EEaseType.OUT: - return Math.Sqrt(1 - Math.Pow(x - 1, 2)); - case EEaseType.INOUT: - return x < 0.5 - ? (1 - Math.Sqrt(1 - Math.Pow(2 * x, 2))) / 2 - : (Math.Sqrt(1 - Math.Pow(-2 * x + 2, 2)) + 1) / 2; - case EEaseType.OUTIN: - return x; - } + case EEaseType.IN: + default: + return 1 - Math.Sqrt(1 - Math.Pow(x, 2)); + case EEaseType.OUT: + return Math.Sqrt(1 - Math.Pow(x - 1, 2)); + case EEaseType.INOUT: + return x < 0.5 + ? (1 - Math.Sqrt(1 - Math.Pow(2 * x, 2))) / 2 + : (Math.Sqrt(1 - Math.Pow(-2 * x + 2, 2)) + 1) / 2; + case EEaseType.OUTIN: + return x; } + } - private static double _easeBack(EEaseType type, double x) + private static double _easeBack(EEaseType type, double x) + { + const double c1 = 1.70158; + const double c2 = c1 * 1.525; + const double c3 = c1 + 1; + switch (type) { - const double c1 = 1.70158; - const double c2 = c1 * 1.525; - const double c3 = c1 + 1; - switch (type) - { - case EEaseType.IN: - default: - return c3 * x * x * x - c1 * x * x; - case EEaseType.OUT: - return 1 + c3 * Math.Pow(x - 1, 3) + c1 * Math.Pow(x - 1, 2); - case EEaseType.INOUT: - return x < 0.5 - ? (Math.Pow(2 * x, 2) * ((c2 + 1) * 2 * x - c2)) / 2 - : (Math.Pow(2 * x - 2, 2) * ((c2 + 1) * (x * 2 - 2) + c2) + 2) / 2; - case EEaseType.OUTIN: - return x; - } + case EEaseType.IN: + default: + return c3 * x * x * x - c1 * x * x; + case EEaseType.OUT: + return 1 + c3 * Math.Pow(x - 1, 3) + c1 * Math.Pow(x - 1, 2); + case EEaseType.INOUT: + return x < 0.5 + ? (Math.Pow(2 * x, 2) * ((c2 + 1) * 2 * x - c2)) / 2 + : (Math.Pow(2 * x - 2, 2) * ((c2 + 1) * (x * 2 - 2) + c2) + 2) / 2; + case EEaseType.OUTIN: + return x; } + } - private static double _easeElastic(EEaseType type, double x) + private static double _easeElastic(EEaseType type, double x) + { + const double c4 = (2 * Math.PI) / 3; + const double c5 = (2 * Math.PI) / 4.5; + switch (type) { - const double c4 = (2 * Math.PI) / 3; - const double c5 = (2 * Math.PI) / 4.5; - switch (type) - { - case EEaseType.IN: - default: - return x == 0 - ? 0 - : x == 1 - ? 1 - : -Math.Pow(2, 10 * x - 10) * Math.Sin((x * 10 - 10.75) * c4); - case EEaseType.OUT: - return x == 0 - ? 0 - : x == 1 - ? 1 - : Math.Pow(2, -10 * x) * Math.Sin((x * 10 - 0.75) * c4) + 1; - case EEaseType.INOUT: - return x == 0 - ? 0 - : x == 1 - ? 1 - : x < 0.5 - ? -(Math.Pow(2, 20 * x - 10) * Math.Sin((20 * x - 11.125) * c5)) / 2 - : (Math.Pow(2, -20 * x + 10) * Math.Sin((20 * x - 11.125) * c5)) / 2 + 1; - case EEaseType.OUTIN: - return x; - } + case EEaseType.IN: + default: + return x == 0 + ? 0 + : x == 1 + ? 1 + : -Math.Pow(2, 10 * x - 10) * Math.Sin((x * 10 - 10.75) * c4); + case EEaseType.OUT: + return x == 0 + ? 0 + : x == 1 + ? 1 + : Math.Pow(2, -10 * x) * Math.Sin((x * 10 - 0.75) * c4) + 1; + case EEaseType.INOUT: + return x == 0 + ? 0 + : x == 1 + ? 1 + : x < 0.5 + ? -(Math.Pow(2, 20 * x - 10) * Math.Sin((20 * x - 11.125) * c5)) / 2 + : (Math.Pow(2, -20 * x + 10) * Math.Sin((20 * x - 11.125) * c5)) / 2 + 1; + case EEaseType.OUTIN: + return x; } + } - private static double _easeOutBounce(double x) + private static double _easeOutBounce(double x) + { + const double n1 = 7.5625; + const double d1 = 2.75; + + if (x < 1 / d1) + return n1 * x * x; + else if (x < 2 / d1) + return n1 * (x -= 1.5 / d1) * x + 0.75; + else if (x < 2.5 / d1) + return n1 * (x -= 2.25 / d1) * x + 0.9375; + else + return n1 * (x -= 2.625 / d1) * x + 0.984375; + } + + private static double _easeBounce(EEaseType type, double x) + { + switch (type) { - const double n1 = 7.5625; - const double d1 = 2.75; - - if (x < 1 / d1) - return n1 * x * x; - else if (x < 2 / d1) - return n1 * (x -= 1.5 / d1) * x + 0.75; - else if (x < 2.5 / d1) - return n1 * (x -= 2.25 / d1) * x + 0.9375; - else - return n1 * (x -= 2.625 / d1) * x + 0.984375; + case EEaseType.IN: + default: + return 1 - _easeOutBounce(1 - x); + case EEaseType.OUT: + return _easeOutBounce(x); + case EEaseType.INOUT: + return x < 0.5 + ? (1 - _easeOutBounce(1 - 2 * x)) / 2 + : (1 + _easeOutBounce(2 * x - 1)) / 2; + case EEaseType.OUTIN: + return x; } + } + */ - private static double _easeBounce(EEaseType type, double x) - { - switch (type) - { - case EEaseType.IN: - default: - return 1 - _easeOutBounce(1 - x); - case EEaseType.OUT: - return _easeOutBounce(x); - case EEaseType.INOUT: - return x < 0.5 - ? (1 - _easeOutBounce(1 - 2 * x)) / 2 - : (1 + _easeOutBounce(2 * x - 1)) / 2; - case EEaseType.OUTIN: - return x; - } - } - */ + #endregion - #endregion - - public static double tCalculateEaseNorm(EEaseType type, EEaseFunction function, double ratio) { - switch (type) { - case EEaseType.IN: - default: - return _easeMethods[function](ratio); - case EEaseType.OUT: - return _easeOut(_easeMethods[function], ratio); - case EEaseType.INOUT: - return _easeInOut(_easeMethods[function], ratio); - case EEaseType.OUTIN: - return _easeOutIn(_easeMethods[function], ratio); - } - } - - public static double tCalculateEase(EEaseType type, EEaseFunction function, double timeStart, double timeEnd, double timeCurrent, double valueStart = 0, double valueEnd = 1) { - if (timeStart == timeEnd) return valueEnd; - double ratio = (timeCurrent - timeStart) / (timeEnd - timeStart); - double ratio_eased = tCalculateEaseNorm(type, function, ratio);//_easeMethods[function](type, ratio); - return valueStart + ratio_eased * (valueEnd - valueStart); + public static double tCalculateEaseNorm(EEaseType type, EEaseFunction function, double ratio) { + switch (type) { + case EEaseType.IN: + default: + return _easeMethods[function](ratio); + case EEaseType.OUT: + return _easeOut(_easeMethods[function], ratio); + case EEaseType.INOUT: + return _easeInOut(_easeMethods[function], ratio); + case EEaseType.OUTIN: + return _easeOutIn(_easeMethods[function], ratio); } } + + public static double tCalculateEase(EEaseType type, EEaseFunction function, double timeStart, double timeEnd, double timeCurrent, double valueStart = 0, double valueEnd = 1) { + if (timeStart == timeEnd) return valueEnd; + double ratio = (timeCurrent - timeStart) / (timeEnd - timeStart); + double ratio_eased = tCalculateEaseNorm(type, function, ratio);//_easeMethods[function](type, ratio); + return valueStart + ratio_eased * (valueEnd - valueStart); + } } diff --git a/OpenTaiko/src/Helpers/HGaugeMethods.cs b/OpenTaiko/src/Helpers/HGaugeMethods.cs index 60306df6..cfc81e10 100644 --- a/OpenTaiko/src/Helpers/HGaugeMethods.cs +++ b/OpenTaiko/src/Helpers/HGaugeMethods.cs @@ -2,744 +2,744 @@ using FDK; -namespace OpenTaiko { - class HGaugeMethods { - public enum EGaugeType { - NORMAL = 0, - HARD, - EXTREME - } +namespace OpenTaiko; - public static float BombDamage = 4f; - public static float FuserollDamage = 4f; - public static float HardGaugeFillRatio = 1f; - public static float ExtremeGaugeFillRatio = 1f; +class HGaugeMethods { + public enum EGaugeType { + NORMAL = 0, + HARD, + EXTREME + } - private static Dictionary DifficultyToHardGaugeDamage = new Dictionary { - [Difficulty.Easy] = 4.5f, - [Difficulty.Normal] = 5f, - [Difficulty.Hard] = 6f, - [Difficulty.Oni] = 6.5f, - [Difficulty.Edit] = 6.5f - }; + public static float BombDamage = 4f; + public static float FuserollDamage = 4f; + public static float HardGaugeFillRatio = 1f; + public static float ExtremeGaugeFillRatio = 1f; - private static Dictionary DifficultyToExtremeGaugeDamage = new Dictionary { - [Difficulty.Easy] = 4.5f, - [Difficulty.Normal] = 5f, - [Difficulty.Hard] = 6f, - [Difficulty.Oni] = 6.5f, - [Difficulty.Edit] = 6.5f - }; + private static Dictionary DifficultyToHardGaugeDamage = new Dictionary { + [Difficulty.Easy] = 4.5f, + [Difficulty.Normal] = 5f, + [Difficulty.Hard] = 6f, + [Difficulty.Oni] = 6.5f, + [Difficulty.Edit] = 6.5f + }; - private static Dictionary LevelExtraToHardGaugeDamage = new Dictionary { - [11] = 7.5f, - [12] = 8f, - [13] = 8.5f - }; + private static Dictionary DifficultyToExtremeGaugeDamage = new Dictionary { + [Difficulty.Easy] = 4.5f, + [Difficulty.Normal] = 5f, + [Difficulty.Hard] = 6f, + [Difficulty.Oni] = 6.5f, + [Difficulty.Edit] = 6.5f + }; - private static Dictionary LevelExtraToExtremeGaugeDamage = new Dictionary { - [11] = 7.5f, - [12] = 8f, - [13] = 8.5f - }; + private static Dictionary LevelExtraToHardGaugeDamage = new Dictionary { + [11] = 7.5f, + [12] = 8f, + [13] = 8.5f + }; - private static Dictionary GaugeTypeStringToEnum = new Dictionary { - ["Normal"] = EGaugeType.NORMAL, - ["Hard"] = EGaugeType.HARD, - ["Extreme"] = EGaugeType.EXTREME - }; + private static Dictionary LevelExtraToExtremeGaugeDamage = new Dictionary { + [11] = 7.5f, + [12] = 8f, + [13] = 8.5f + }; - private static Dictionary DifficultyToNorma = new Dictionary { - [Difficulty.Easy] = 60f, - [Difficulty.Normal] = 70f, - [Difficulty.Hard] = 70f, - [Difficulty.Oni] = 80f, - [Difficulty.Edit] = 80f - }; + private static Dictionary GaugeTypeStringToEnum = new Dictionary { + ["Normal"] = EGaugeType.NORMAL, + ["Hard"] = EGaugeType.HARD, + ["Extreme"] = EGaugeType.EXTREME + }; - private static Dictionary LevelExtraToNorma = new Dictionary { - [11] = 88f, - [12] = 92f, - [13] = 96f - }; + private static Dictionary DifficultyToNorma = new Dictionary { + [Difficulty.Easy] = 60f, + [Difficulty.Normal] = 70f, + [Difficulty.Hard] = 70f, + [Difficulty.Oni] = 80f, + [Difficulty.Edit] = 80f + }; - #region [General calculation] + private static Dictionary LevelExtraToNorma = new Dictionary { + [11] = 88f, + [12] = 92f, + [13] = 96f + }; - public static float tHardGaugeGetDamage(Difficulty diff, int level) { - float damage = 6.5f; + #region [General calculation] - if (DifficultyToHardGaugeDamage.ContainsKey(diff)) - damage = DifficultyToHardGaugeDamage[diff]; + public static float tHardGaugeGetDamage(Difficulty diff, int level) { + float damage = 6.5f; - int levelCaped = Math.Min(13, level); - if (LevelExtraToHardGaugeDamage.ContainsKey(levelCaped)) - damage = LevelExtraToHardGaugeDamage[levelCaped]; + if (DifficultyToHardGaugeDamage.ContainsKey(diff)) + damage = DifficultyToHardGaugeDamage[diff]; - return damage; - } + int levelCaped = Math.Min(13, level); + if (LevelExtraToHardGaugeDamage.ContainsKey(levelCaped)) + damage = LevelExtraToHardGaugeDamage[levelCaped]; - public static float tExtremeGaugeGetDamage(Difficulty diff, int level) { - float damage = 6.5f; + return damage; + } - if (DifficultyToExtremeGaugeDamage.ContainsKey(diff)) - damage = DifficultyToExtremeGaugeDamage[diff]; + public static float tExtremeGaugeGetDamage(Difficulty diff, int level) { + float damage = 6.5f; - int levelCaped = Math.Min(13, level); - if (LevelExtraToExtremeGaugeDamage.ContainsKey(levelCaped)) - damage = LevelExtraToExtremeGaugeDamage[levelCaped]; + if (DifficultyToExtremeGaugeDamage.ContainsKey(diff)) + damage = DifficultyToExtremeGaugeDamage[diff]; - return damage; - } + int levelCaped = Math.Min(13, level); + if (LevelExtraToExtremeGaugeDamage.ContainsKey(levelCaped)) + damage = LevelExtraToExtremeGaugeDamage[levelCaped]; - public static float tHardGaugeGetKillscreenRatio(Difficulty diff, int level, EGaugeType gaugeType, int perfectHits, int totalNotes) { - if (gaugeType != EGaugeType.EXTREME) return 0f; + return damage; + } - float norma = tGetCurrentGaugeNorma(diff, level); - float ratio = Math.Min(1f, Math.Max(0f, perfectHits / (float)totalNotes)); + public static float tHardGaugeGetKillscreenRatio(Difficulty diff, int level, EGaugeType gaugeType, int perfectHits, int totalNotes) { + if (gaugeType != EGaugeType.EXTREME) return 0f; - return ratio * norma; - } + float norma = tGetCurrentGaugeNorma(diff, level); + float ratio = Math.Min(1f, Math.Max(0f, perfectHits / (float)totalNotes)); - public static bool tIsDangerHardGauge(Difficulty diff, int level, EGaugeType gaugeType, float percentObtained, int perfectHits, int totalNotes) { - if (gaugeType == EGaugeType.NORMAL || diff > Difficulty.Edit) return false; - float percent = Math.Min(100f, Math.Max(0f, percentObtained)); - return percent < 100f - ((100f - tHardGaugeGetKillscreenRatio(diff, level, gaugeType, perfectHits, totalNotes)) * 0.7f); - } + return ratio * norma; + } - public static float tGetCurrentGaugeNorma(Difficulty diff, int level) { - float norma = 80f; + public static bool tIsDangerHardGauge(Difficulty diff, int level, EGaugeType gaugeType, float percentObtained, int perfectHits, int totalNotes) { + if (gaugeType == EGaugeType.NORMAL || diff > Difficulty.Edit) return false; + float percent = Math.Min(100f, Math.Max(0f, percentObtained)); + return percent < 100f - ((100f - tHardGaugeGetKillscreenRatio(diff, level, gaugeType, perfectHits, totalNotes)) * 0.7f); + } - if (DifficultyToNorma.ContainsKey(diff)) - norma = DifficultyToNorma[diff]; + public static float tGetCurrentGaugeNorma(Difficulty diff, int level) { + float norma = 80f; - int levelCaped = Math.Min(13, level); - if (LevelExtraToNorma.ContainsKey(levelCaped)) - norma = LevelExtraToNorma[levelCaped]; + if (DifficultyToNorma.ContainsKey(diff)) + norma = DifficultyToNorma[diff]; - return norma; - } + int levelCaped = Math.Min(13, level); + if (LevelExtraToNorma.ContainsKey(levelCaped)) + norma = LevelExtraToNorma[levelCaped]; - public static EGaugeType tGetGaugeTypeEnum(string gaugeType) { - EGaugeType gt = EGaugeType.NORMAL; + return norma; + } - if (GaugeTypeStringToEnum.ContainsKey(gaugeType)) - gt = GaugeTypeStringToEnum[gaugeType]; + public static EGaugeType tGetGaugeTypeEnum(string gaugeType) { + EGaugeType gt = EGaugeType.NORMAL; - return gt; - } + if (GaugeTypeStringToEnum.ContainsKey(gaugeType)) + gt = GaugeTypeStringToEnum[gaugeType]; - public static bool tNormaCheck(Difficulty diff, int level, EGaugeType gaugeType, float percentObtained, float killZonePercent) { - float percent = Math.Min(100f, Math.Max(0f, percentObtained)); - float norma = tGetCurrentGaugeNorma(diff, level); + return gt; + } - if ((gaugeType == EGaugeType.HARD || gaugeType == EGaugeType.EXTREME) && percent > killZonePercent) return true; - if (gaugeType == EGaugeType.NORMAL && percent >= norma) return true; + public static bool tNormaCheck(Difficulty diff, int level, EGaugeType gaugeType, float percentObtained, float killZonePercent) { + float percent = Math.Min(100f, Math.Max(0f, percentObtained)); + float norma = tGetCurrentGaugeNorma(diff, level); - return false; - } + if ((gaugeType == EGaugeType.HARD || gaugeType == EGaugeType.EXTREME) && percent > killZonePercent) return true; + if (gaugeType == EGaugeType.NORMAL && percent >= norma) return true; - #endregion + return false; + } - #region [Displayables] + #endregion - public static void tDrawGaugeBase(CTexture baseTexture, int x, int y, float scale_x, float scale_y) { - if (baseTexture != null) { - baseTexture.vcScaleRatio.X = scale_x; - baseTexture.vcScaleRatio.Y = scale_y; + #region [Displayables] - baseTexture.t2D描画(x, y, + public static void tDrawGaugeBase(CTexture baseTexture, int x, int y, float scale_x, float scale_y) { + if (baseTexture != null) { + baseTexture.vcScaleRatio.X = scale_x; + baseTexture.vcScaleRatio.Y = scale_y; + + baseTexture.t2D描画(x, y, new Rectangle( GaugeBox[0], GaugeBox[1], GaugeBox[2], GaugeBox[3]) - ); - } + ); } + } - public static void tDrawGaugeBaseClear(CTexture baseTexture, int x, int y, Difficulty diff, int level, EGaugeType gaugeType, float scale_x, float scale_y) { - if (gaugeType != EGaugeType.NORMAL || diff > Difficulty.Edit) return; - float norma = tGetCurrentGaugeNorma(diff, level) - 2f; // A segment flashes earlier - float revnorma = 100f - norma; + public static void tDrawGaugeBaseClear(CTexture baseTexture, int x, int y, Difficulty diff, int level, EGaugeType gaugeType, float scale_x, float scale_y) { + if (gaugeType != EGaugeType.NORMAL || diff > Difficulty.Edit) return; + float norma = tGetCurrentGaugeNorma(diff, level) - 2f; // A segment flashes earlier + float revnorma = 100f - norma; - if (baseTexture != null) { - baseTexture.vcScaleRatio.X = scale_x; - baseTexture.vcScaleRatio.Y = scale_y; + if (baseTexture != null) { + baseTexture.vcScaleRatio.X = scale_x; + baseTexture.vcScaleRatio.Y = scale_y; - int gaugeTexLength = GaugeBox[2]; - int clearPartLength = (int)(gaugeTexLength * (revnorma / 100f)); - int texStartPoint = (int)(gaugeTexLength * (norma / 100f)); - int xOff = (int)(scale_x * texStartPoint); + int gaugeTexLength = GaugeBox[2]; + int clearPartLength = (int)(gaugeTexLength * (revnorma / 100f)); + int texStartPoint = (int)(gaugeTexLength * (norma / 100f)); + int xOff = (int)(scale_x * texStartPoint); - baseTexture.t2D描画(x + xOff, y, + baseTexture.t2D描画(x + xOff, y, new Rectangle( GaugeBox[0] + texStartPoint, GaugeBox[1], clearPartLength, GaugeBox[3]) - ); - } + ); } + } - public static void tDrawGaugeFill( - CTexture fillTexture, - CTexture yellowTexture, - CTexture rainbowTexture, - int x, - int y, - int rainbow_x, - int rainbow_y, - Difficulty diff, - int level, - float currentPercent, - EGaugeType gaugeType, - float scale_x, - float scale_y, - int flashOpacity, - int perfectHits, - int totalNotes - ) { - if (diff > Difficulty.Edit) return; - float norma = tGetCurrentGaugeNorma(diff, level) - 2f; // A segment flashes earlier - float percent = Math.Min(100f, Math.Max(0f, currentPercent)); + public static void tDrawGaugeFill( + CTexture fillTexture, + CTexture yellowTexture, + CTexture rainbowTexture, + int x, + int y, + int rainbow_x, + int rainbow_y, + Difficulty diff, + int level, + float currentPercent, + EGaugeType gaugeType, + float scale_x, + float scale_y, + int flashOpacity, + int perfectHits, + int totalNotes + ) { + if (diff > Difficulty.Edit) return; + float norma = tGetCurrentGaugeNorma(diff, level) - 2f; // A segment flashes earlier + float percent = Math.Min(100f, Math.Max(0f, currentPercent)); - int gaugeTexLength = GaugeBox[2]; - float nWidth = (gaugeTexLength / 50f); - int closestTwo = (int)((int)(percent / 2) * nWidth); - int closestNorma = (gaugeType != EGaugeType.NORMAL) ? gaugeTexLength : (int)(gaugeTexLength * (norma / 100f)); + int gaugeTexLength = GaugeBox[2]; + float nWidth = (gaugeTexLength / 50f); + int closestTwo = (int)((int)(percent / 2) * nWidth); + int closestNorma = (gaugeType != EGaugeType.NORMAL) ? gaugeTexLength : (int)(gaugeTexLength * (norma / 100f)); - bool normaCheck = tNormaCheck(diff, level, gaugeType, percent, 0); - bool isRainbow = (rainbowTexture != null && percent >= 100f && gaugeType == EGaugeType.NORMAL); + bool normaCheck = tNormaCheck(diff, level, gaugeType, percent, 0); + bool isRainbow = (rainbowTexture != null && percent >= 100f && gaugeType == EGaugeType.NORMAL); - // Fill - if (fillTexture != null && !isRainbow) { - fillTexture.vcScaleRatio.X = scale_x; - fillTexture.vcScaleRatio.Y = scale_y; + // Fill + if (fillTexture != null && !isRainbow) { + fillTexture.vcScaleRatio.X = scale_x; + fillTexture.vcScaleRatio.Y = scale_y; - fillTexture.Opacity = 255; - if (gaugeType != EGaugeType.NORMAL && tIsDangerHardGauge(diff, level, gaugeType, percent, perfectHits, totalNotes)) fillTexture.Opacity = 255 - flashOpacity; - fillTexture.t2D描画(x, y, - new Rectangle( + fillTexture.Opacity = 255; + if (gaugeType != EGaugeType.NORMAL && tIsDangerHardGauge(diff, level, gaugeType, percent, perfectHits, totalNotes)) fillTexture.Opacity = 255 - flashOpacity; + fillTexture.t2D描画(x, y, + new Rectangle( GaugeBox[0], GaugeBox[1], Math.Min(closestTwo, closestNorma), GaugeBox[3]) - ); - } + ); + } - if (gaugeType != EGaugeType.NORMAL) return; - if (!normaCheck) return; + if (gaugeType != EGaugeType.NORMAL) return; + if (!normaCheck) return; - // Yellow - if (yellowTexture != null && !isRainbow) { - int texStartPoint = (int)(gaugeTexLength * (norma / 100f)); - int differencial = closestTwo - closestNorma; - int xOff = (int)(scale_x * texStartPoint); + // Yellow + if (yellowTexture != null && !isRainbow) { + int texStartPoint = (int)(gaugeTexLength * (norma / 100f)); + int differencial = closestTwo - closestNorma; + int xOff = (int)(scale_x * texStartPoint); - yellowTexture.vcScaleRatio.X = scale_x; - yellowTexture.vcScaleRatio.Y = scale_y; + yellowTexture.vcScaleRatio.X = scale_x; + yellowTexture.vcScaleRatio.Y = scale_y; - yellowTexture.Opacity = 255; - yellowTexture.t2D描画(x + xOff, y, - new Rectangle( + yellowTexture.Opacity = 255; + yellowTexture.t2D描画(x + xOff, y, + new Rectangle( GaugeBox[0] + texStartPoint, GaugeBox[1], differencial, GaugeBox[3]) + ); + } + + // Rainbow + if (rainbowTexture != null && percent >= 100f) { + rainbowTexture.vcScaleRatio.X = scale_x; + rainbowTexture.vcScaleRatio.Y = scale_y; + + rainbowTexture.t2D描画(rainbow_x, rainbow_y); + } + + } + + public static void tDrawGaugeFlash(CTexture flashTexture, int x, int y, int Opacity, Difficulty diff, int level, float currentPercent, EGaugeType gaugeType, float scale_x, float scale_y) { + if (gaugeType != EGaugeType.NORMAL || diff > Difficulty.Edit) return; + float norma = tGetCurrentGaugeNorma(diff, level) - 2f; // A segment flashes earlier + float percent = Math.Min(100f, Math.Max(0f, currentPercent)); + if (tNormaCheck(diff, level, gaugeType, percent, 0) && percent < 100.0) { + if (flashTexture != null) { + flashTexture.vcScaleRatio.X = scale_x; + flashTexture.vcScaleRatio.Y = scale_y; + + flashTexture.Opacity = Opacity; + flashTexture.t2D描画(x, y, + new Rectangle( + GaugeBox[0], + GaugeBox[1], + (int)(GaugeBox[2] * (norma / 100f)), + GaugeBox[3]) ); } - // Rainbow - if (rainbowTexture != null && percent >= 100f) { - rainbowTexture.vcScaleRatio.X = scale_x; - rainbowTexture.vcScaleRatio.Y = scale_y; - - rainbowTexture.t2D描画(rainbow_x, rainbow_y); - } - } + } - public static void tDrawGaugeFlash(CTexture flashTexture, int x, int y, int Opacity, Difficulty diff, int level, float currentPercent, EGaugeType gaugeType, float scale_x, float scale_y) { - if (gaugeType != EGaugeType.NORMAL || diff > Difficulty.Edit) return; - float norma = tGetCurrentGaugeNorma(diff, level) - 2f; // A segment flashes earlier - float percent = Math.Min(100f, Math.Max(0f, currentPercent)); - if (tNormaCheck(diff, level, gaugeType, percent, 0) && percent < 100.0) { - if (flashTexture != null) { - flashTexture.vcScaleRatio.X = scale_x; - flashTexture.vcScaleRatio.Y = scale_y; + public static void tDrawKillZone(CTexture killzoneTexture, int x, int y, Difficulty diff, int level, EGaugeType gaugeType, float scale_x, float scale_y, int perfectHits, int totalNotes) { + if (gaugeType != EGaugeType.EXTREME || diff > Difficulty.Edit) return; + float currentFill = tHardGaugeGetKillscreenRatio(diff, level, gaugeType, perfectHits, totalNotes); + if (killzoneTexture != null) { + killzoneTexture.vcScaleRatio.X = scale_x; + killzoneTexture.vcScaleRatio.Y = scale_y; - flashTexture.Opacity = Opacity; - flashTexture.t2D描画(x, y, - new Rectangle( - GaugeBox[0], - GaugeBox[1], - (int)(GaugeBox[2] * (norma / 100f)), - GaugeBox[3]) - ); - } - - } - } - - public static void tDrawKillZone(CTexture killzoneTexture, int x, int y, Difficulty diff, int level, EGaugeType gaugeType, float scale_x, float scale_y, int perfectHits, int totalNotes) { - if (gaugeType != EGaugeType.EXTREME || diff > Difficulty.Edit) return; - float currentFill = tHardGaugeGetKillscreenRatio(diff, level, gaugeType, perfectHits, totalNotes); - if (killzoneTexture != null) { - killzoneTexture.vcScaleRatio.X = scale_x; - killzoneTexture.vcScaleRatio.Y = scale_y; - - killzoneTexture.t2D描画(x, y, - new Rectangle( + killzoneTexture.t2D描画(x, y, + new Rectangle( GaugeBox[0], GaugeBox[1], (int)(GaugeBox[2] * (currentFill / 100f)), GaugeBox[3]) - ); - } + ); } - - public static void tDrawClearIcon(CTexture clearIcon, Difficulty diff, int level, float currentPercent, int text_x, int text_y, EGaugeType gaugeType, int perfectHits, int totalNotes, Rectangle clearRect, Rectangle clearRectHighlight) { - if (clearIcon == null) return; - if (diff > Difficulty.Edit) return; - - float percent = Math.Min(100f, Math.Max(0f, currentPercent)); - bool highlight = (gaugeType != EGaugeType.NORMAL) - ? tIsDangerHardGauge(diff, level, gaugeType, currentPercent, perfectHits, totalNotes) - : tNormaCheck(diff, level, gaugeType, percent, 0); - - clearIcon.Opacity = 255; - if (highlight) { - clearIcon.t2D描画(text_x, text_y, clearRectHighlight); - } else { - clearIcon.t2D描画(text_x, text_y, clearRect); - } - } - - public static void tDrawSoulFire(CTexture soulFire, Difficulty diff, int level, float currentPercent, EGaugeType gaugeType, float scale_x, float scale_y, int fire_x, int fire_y, int fireFrame) { - if (soulFire == null) return; - if (gaugeType != EGaugeType.NORMAL || diff > Difficulty.Edit) return; - float percent = Math.Min(100f, Math.Max(0f, currentPercent)); - - int soulfire_width = soulFire.szTextureSize.Width / 8; - int soulfire_height = soulFire.szTextureSize.Height; - - if (percent >= 100.0) { - soulFire.vcScaleRatio.X = scale_x; - soulFire.vcScaleRatio.Y = scale_y; - - soulFire.t2D描画(fire_x, fire_y, new Rectangle(soulfire_width * fireFrame, 0, soulfire_width, soulfire_height)); - } - } - - public static void tDrawSoulLetter(CTexture soulLetter, Difficulty diff, int level, float currentPercent, EGaugeType gaugeType, float scale_x, float scale_y, int soul_x, int soul_y) { - if (soulLetter == null) return; - if (gaugeType != EGaugeType.NORMAL || diff > Difficulty.Edit) return; - float norma = tGetCurrentGaugeNorma(diff, level); - float percent = Math.Min(100f, Math.Max(0f, currentPercent)); - - soulLetter.vcScaleRatio.X = scale_x; - soulLetter.vcScaleRatio.Y = scale_y; - - int soul_height = soulLetter.szTextureSize.Height / 2; - if (tNormaCheck(diff, level, gaugeType, percent, 0)) { - soulLetter.t2D描画(soul_x, soul_y, new Rectangle(0, 0, soulLetter.szTextureSize.Width, soul_height)); - } else { - soulLetter.t2D描画(soul_x, soul_y, new Rectangle(0, soul_height, soulLetter.szTextureSize.Width, soul_height)); - } - } - - public static void tDrawCompleteGauge( - CTexture baseTexture, - CTexture baseNormaTexture, - CTexture flashTexture, - CTexture fillTexture, - CTexture yellowTexture, - CTexture[] rainbowTextureArr, - CTexture killzoneTexture, - CTexture clearIcon, - CTexture soulLetter, - CTexture soulFire, - int x, - int y, - int rainbow_x, - int rainbow_y, - int Opacity, - int RainbowTextureIndex, - int SoulFireIndex, - Difficulty diff, - int level, - float currentPercent, - EGaugeType gaugeType, - float scale_x, - float scale_y, - int text_x, - int text_y, - int perfectHits, - int totalNotes, - int soul_x, - int soul_y, - int fire_x, - int fire_y, - Rectangle clearRect, - Rectangle clearRectHighlight - ) { - // Layers : Base - Base clear - Fill - Flash - Killzone - Clear logo - Soul fire - Soul text - tDrawGaugeBase(baseTexture, x, y, scale_x, scale_y); - tDrawGaugeBaseClear(baseNormaTexture, x, y, diff, level, gaugeType, scale_x, scale_y); - tDrawGaugeFill(fillTexture, yellowTexture, (rainbowTextureArr != null && RainbowTextureIndex < rainbowTextureArr.Length) ? rainbowTextureArr[RainbowTextureIndex] : null, x, y, rainbow_x, rainbow_y, diff, level, currentPercent, gaugeType, scale_x, scale_y, Opacity, perfectHits, totalNotes); - if (!OpenTaiko.ConfigIni.SimpleMode) tDrawGaugeFlash(flashTexture, x, y, Opacity, diff, level, currentPercent, gaugeType, scale_x, scale_y); - tDrawKillZone(killzoneTexture, x, y, diff, level, gaugeType, scale_x, scale_y, perfectHits, totalNotes); - tDrawClearIcon(clearIcon, diff, level, currentPercent, text_x, text_y, gaugeType, perfectHits, totalNotes, clearRect, clearRectHighlight); - tDrawSoulFire(soulFire, diff, level, currentPercent, gaugeType, scale_x, scale_y, fire_x, fire_y, SoulFireIndex); - tDrawSoulLetter(soulLetter, diff, level, currentPercent, gaugeType, scale_x, scale_y, soul_x, soul_y); - } - - #endregion - - // Use with caution - #region [Unsafe methods] - - public static bool UNSAFE_FastNormaCheck(int player) { - var chara = OpenTaiko.Tx.Characters[OpenTaiko.SaveFileInstances[OpenTaiko.GetActualPlayer(player)].data.Character]; - var _dif = OpenTaiko.stageSongSelect.nChoosenSongDifficulty[player]; - return tNormaCheck( - (Difficulty)_dif, - OpenTaiko.stageSongSelect.rChoosenSong.arスコア[_dif].譜面情報.nレベル[_dif], - tGetGaugeTypeEnum(chara.effect.tGetGaugeType()), - (float)OpenTaiko.stage演奏ドラム画面.actGauge.db現在のゲージ値[player], - UNSAFE_KillZonePercent(player) - ); - } - - public static bool UNSAFE_IsRainbow(int player) { - var chara = OpenTaiko.Tx.Characters[OpenTaiko.SaveFileInstances[OpenTaiko.GetActualPlayer(player)].data.Character]; - if (tGetGaugeTypeEnum(chara.effect.tGetGaugeType()) != EGaugeType.NORMAL) return false; - return (float)OpenTaiko.stage演奏ドラム画面.actGauge.db現在のゲージ値[player] >= 100f; - } - - public static float UNSAFE_KillZonePercent(int player) { - var chara = OpenTaiko.Tx.Characters[OpenTaiko.SaveFileInstances[OpenTaiko.GetActualPlayer(player)].data.Character]; - CDTX[] dtxs = - { - OpenTaiko.DTX, - OpenTaiko.DTX_2P, - OpenTaiko.DTX_3P, - OpenTaiko.DTX_4P, - OpenTaiko.DTX_5P - }; - - // Total hits and perfect hits - int perfectHits = OpenTaiko.stage演奏ドラム画面.CChartScore[player].nGreat; - int totalHits = dtxs[player].nノーツ数[3]; - - // Difficulty - int _dif = OpenTaiko.stageSongSelect.nChoosenSongDifficulty[player]; - Difficulty difficulty = (Difficulty)_dif; - int level = OpenTaiko.stageSongSelect.rChoosenSong.arスコア[_dif].譜面情報.nレベル[_dif]; - - return tHardGaugeGetKillscreenRatio( - difficulty, - level, - tGetGaugeTypeEnum(chara.effect.tGetGaugeType()), - perfectHits, - totalHits); - } - - public static void UNSAFE_DrawGaugeFast(int player, int opacity, int rainbowTextureIndex, int soulFlameIndex) { - var chara = OpenTaiko.Tx.Characters[OpenTaiko.SaveFileInstances[OpenTaiko.GetActualPlayer(player)].data.Character]; - CDTX[] dtxs = - { - OpenTaiko.DTX, - OpenTaiko.DTX_2P, - OpenTaiko.DTX_3P, - OpenTaiko.DTX_4P, - OpenTaiko.DTX_5P - }; - - // Set box - GaugeBox = new int[] { OpenTaiko.Skin.Game_Gauge_Rect[0], OpenTaiko.Skin.Game_Gauge_Rect[1], OpenTaiko.Skin.Game_Gauge_Rect[2], OpenTaiko.Skin.Game_Gauge_Rect[3] }; - - // Gauge pos - int gauge_x = 0; - int gauge_y = 0; - - if (OpenTaiko.ConfigIni.nPlayerCount == 5) { - gauge_x = OpenTaiko.Skin.Game_Gauge_5P[0] + (OpenTaiko.Skin.Game_UIMove_5P[0] * player); - gauge_y = OpenTaiko.Skin.Game_Gauge_5P[1] + (OpenTaiko.Skin.Game_UIMove_5P[1] * player); - } else if (OpenTaiko.ConfigIni.nPlayerCount == 4 || OpenTaiko.ConfigIni.nPlayerCount == 3) { - gauge_x = OpenTaiko.Skin.Game_Gauge_4P[0] + (OpenTaiko.Skin.Game_UIMove_4P[0] * player); - gauge_y = OpenTaiko.Skin.Game_Gauge_4P[1] + (OpenTaiko.Skin.Game_UIMove_4P[1] * player); - } else if (OpenTaiko.ConfigIni.bAIBattleMode) { - gauge_x = OpenTaiko.Skin.Game_Gauge_X_AI; - gauge_y = OpenTaiko.Skin.Game_Gauge_Y_AI; - } else { - gauge_x = OpenTaiko.Skin.Game_Gauge_X[player]; - gauge_y = OpenTaiko.Skin.Game_Gauge_Y[player]; - } - - // Text pos - int text_x = 0; - int text_y = 0; - if (OpenTaiko.ConfigIni.nPlayerCount <= 2) { - if (OpenTaiko.ConfigIni.bAIBattleMode) { - text_x = OpenTaiko.Skin.Game_Gauge_ClearText_X_AI; - text_y = OpenTaiko.Skin.Game_Gauge_ClearText_Y_AI; - } else { - text_x = OpenTaiko.Skin.Game_Gauge_ClearText_X[player]; - text_y = OpenTaiko.Skin.Game_Gauge_ClearText_Y[player]; - } - } - - // Soul pos - int soul_x = 0; - int soul_y = 0; - if (OpenTaiko.ConfigIni.bAIBattleMode) { - soul_x = OpenTaiko.Skin.Gauge_Soul_X_AI; - soul_y = OpenTaiko.Skin.Gauge_Soul_Y_AI; - } else { - if (OpenTaiko.ConfigIni.nPlayerCount == 5) { - soul_x = OpenTaiko.Skin.Gauge_Soul_5P[0] + (OpenTaiko.Skin.Game_UIMove_5P[0] * player); - soul_y = OpenTaiko.Skin.Gauge_Soul_5P[1] + (OpenTaiko.Skin.Game_UIMove_5P[1] * player); - } else if (OpenTaiko.ConfigIni.nPlayerCount == 4 || OpenTaiko.ConfigIni.nPlayerCount == 3) { - soul_x = OpenTaiko.Skin.Gauge_Soul_4P[0] + (OpenTaiko.Skin.Game_UIMove_4P[0] * player); - soul_y = OpenTaiko.Skin.Gauge_Soul_4P[1] + (OpenTaiko.Skin.Game_UIMove_4P[1] * player); - } else { - soul_x = OpenTaiko.Skin.Gauge_Soul_X[player]; - soul_y = OpenTaiko.Skin.Gauge_Soul_Y[player]; - } - } - - // Fire pos - int fire_x = 0; - int fire_y = 0; - if (OpenTaiko.ConfigIni.bAIBattleMode) { - fire_x = OpenTaiko.Skin.Gauge_Soul_Fire_X_AI; - fire_y = OpenTaiko.Skin.Gauge_Soul_Fire_Y_AI; - } else { - if (OpenTaiko.ConfigIni.nPlayerCount == 5) { - fire_x = OpenTaiko.Skin.Gauge_Soul_Fire_5P[0] + (OpenTaiko.Skin.Game_UIMove_5P[0] * player); - fire_y = OpenTaiko.Skin.Gauge_Soul_Fire_5P[1] + (OpenTaiko.Skin.Game_UIMove_5P[1] * player); - } else if (OpenTaiko.ConfigIni.nPlayerCount == 4 || OpenTaiko.ConfigIni.nPlayerCount == 3) { - fire_x = OpenTaiko.Skin.Gauge_Soul_Fire_4P[0] + (OpenTaiko.Skin.Game_UIMove_4P[0] * player); - fire_y = OpenTaiko.Skin.Gauge_Soul_Fire_4P[1] + (OpenTaiko.Skin.Game_UIMove_4P[1] * player); - } else { - fire_x = OpenTaiko.Skin.Gauge_Soul_Fire_X[player]; - fire_y = OpenTaiko.Skin.Gauge_Soul_Fire_Y[player]; - } - } - - // Total hits and perfect hits - int perfectHits = OpenTaiko.stage演奏ドラム画面.CChartScore[player].nGreat; - int totalHits = dtxs[player].nノーツ数[3]; - - // Scale - float scale = 1.0f; - if (OpenTaiko.ConfigIni.bAIBattleMode) { - scale = 0.8f; - } - - // Difficulty - int _dif = OpenTaiko.stageSongSelect.nChoosenSongDifficulty[player]; - Difficulty difficulty = (Difficulty)_dif; - int level = OpenTaiko.stageSongSelect.rChoosenSong.arスコア[_dif].譜面情報.nレベル[_dif]; - - // Current percent - float currentPercent = (float)OpenTaiko.stage演奏ドラム画面.actGauge.db現在のゲージ値[player]; - - // Gauge type - EGaugeType gaugeType = tGetGaugeTypeEnum(chara.effect.tGetGaugeType()); - - // Textures - int _4pGaugeIDX = (OpenTaiko.ConfigIni.nPlayerCount >= 3) ? 1 : 0; - int _usedGauge = player + 3 * _4pGaugeIDX; - if (OpenTaiko.P1IsBlue()) _usedGauge = 2; - _4pGaugeIDX = (OpenTaiko.ConfigIni.nPlayerCount >= 3) ? 2 - : (player == 1) ? 1 - : 0; - - CTexture baseTexture = OpenTaiko.Tx.Gauge_Base[_usedGauge]; - CTexture fillTexture = OpenTaiko.Tx.Gauge[_usedGauge]; - - CTexture[] rainbowTextureArr = (new CTexture[][] { OpenTaiko.Tx.Gauge_Rainbow, OpenTaiko.Tx.Gauge_Rainbow_2PGauge, OpenTaiko.Tx.Gauge_Rainbow_Flat })[_4pGaugeIDX]; - CTexture yellowTexture = OpenTaiko.Tx.Gauge_Clear[_4pGaugeIDX]; - CTexture baseNormaTexture = OpenTaiko.Tx.Gauge_Base_Norma[_4pGaugeIDX]; - CTexture killzoneTexture = OpenTaiko.Tx.Gauge_Killzone[_4pGaugeIDX]; - - CTexture flashTexture = yellowTexture; - CTexture clearIcon = (_4pGaugeIDX == 2) - ? null - : (gaugeType != EGaugeType.NORMAL) - ? OpenTaiko.Tx.Gauge_Killzone[0] - : OpenTaiko.Tx.Gauge[0]; - CTexture soulLetter = OpenTaiko.Tx.Gauge_Soul; - CTexture soulFlame = OpenTaiko.Tx.Gauge_Soul_Fire; - - // Rectangles - Rectangle clearRectHighlight = new Rectangle( - OpenTaiko.Skin.Game_Gauge_ClearText_Rect[0], - OpenTaiko.Skin.Game_Gauge_ClearText_Rect[1], - OpenTaiko.Skin.Game_Gauge_ClearText_Rect[2], - OpenTaiko.Skin.Game_Gauge_ClearText_Rect[3] - ); - - Rectangle clearRect = new Rectangle( - OpenTaiko.Skin.Game_Gauge_ClearText_Clear_Rect[0], - OpenTaiko.Skin.Game_Gauge_ClearText_Clear_Rect[1], - OpenTaiko.Skin.Game_Gauge_ClearText_Clear_Rect[2], - OpenTaiko.Skin.Game_Gauge_ClearText_Clear_Rect[3] - ); - - tDrawCompleteGauge(baseTexture, baseNormaTexture, flashTexture, fillTexture, yellowTexture, rainbowTextureArr, killzoneTexture, clearIcon, soulLetter, soulFlame, gauge_x, gauge_y, gauge_x, gauge_y, opacity, rainbowTextureIndex, soulFlameIndex, difficulty, level, currentPercent, gaugeType, scale, scale, text_x, text_y, perfectHits, totalHits, soul_x, soul_y, fire_x, fire_y, clearRect, clearRectHighlight); - } - - public static void UNSAFE_DrawResultGaugeFast(int player, int shiftPos, int pos, int segmentsDisplayed, int rainbowTextureIndex, int soulFlameIndex, int uioffset_x) { - var chara = OpenTaiko.Tx.Characters[OpenTaiko.SaveFileInstances[OpenTaiko.GetActualPlayer(player)].data.Character]; - CDTX[] dtxs = - { - OpenTaiko.DTX, - OpenTaiko.DTX_2P, - OpenTaiko.DTX_3P, - OpenTaiko.DTX_4P, - OpenTaiko.DTX_5P - }; - - // Set box - GaugeBox = new int[] { OpenTaiko.Skin.Result_Gauge_Rect[0], OpenTaiko.Skin.Result_Gauge_Rect[1], OpenTaiko.Skin.Result_Gauge_Rect[2], OpenTaiko.Skin.Result_Gauge_Rect[3] }; - - // Total hits and perfect hits - int perfectHits = OpenTaiko.stage演奏ドラム画面.CChartScore[player].nGreat; - int totalHits = dtxs[player].nノーツ数[3]; - - // Gauge type - EGaugeType gaugeType = tGetGaugeTypeEnum(chara.effect.tGetGaugeType()); - - // Current percent - float currentPercent = segmentsDisplayed * 2f; - - // Scale x - float scale_x = 1.0f; - if (OpenTaiko.ConfigIni.nPlayerCount >= 3) { - scale_x = 0.5f; - } - - // Difficulty - int _dif = OpenTaiko.stageSongSelect.nChoosenSongDifficulty[player]; - Difficulty difficulty = (Difficulty)_dif; - int level = OpenTaiko.stageSongSelect.rChoosenSong.arスコア[_dif].譜面情報.nレベル[_dif]; - - int gauge_x; - int gauge_y; - if (OpenTaiko.ConfigIni.nPlayerCount == 5) { - gauge_x = OpenTaiko.Skin.Result_Gauge_5P[0] + OpenTaiko.Skin.Result_UIMove_5P_X[pos]; - gauge_y = OpenTaiko.Skin.Result_Gauge_5P[1] + OpenTaiko.Skin.Result_UIMove_5P_Y[pos]; - } else if (OpenTaiko.ConfigIni.nPlayerCount == 4 || OpenTaiko.ConfigIni.nPlayerCount == 3) { - gauge_x = OpenTaiko.Skin.Result_Gauge_4P[0] + OpenTaiko.Skin.Result_UIMove_4P_X[pos]; - gauge_y = OpenTaiko.Skin.Result_Gauge_4P[1] + OpenTaiko.Skin.Result_UIMove_4P_Y[pos]; - } else { - gauge_x = OpenTaiko.Skin.Result_Gauge_X[pos] + uioffset_x; - gauge_y = OpenTaiko.Skin.Result_Gauge_Y[pos]; - } - - int gauge_rainbow_x; - int gauge_rainbow_y; - if (OpenTaiko.ConfigIni.nPlayerCount == 5) { - gauge_rainbow_x = OpenTaiko.Skin.Result_Gauge_Rainbow_5P[0] + OpenTaiko.Skin.Result_UIMove_5P_X[pos]; - gauge_rainbow_y = OpenTaiko.Skin.Result_Gauge_Rainbow_5P[1] + OpenTaiko.Skin.Result_UIMove_5P_Y[pos]; - } else if (OpenTaiko.ConfigIni.nPlayerCount == 4 || OpenTaiko.ConfigIni.nPlayerCount == 3) { - gauge_rainbow_x = OpenTaiko.Skin.Result_Gauge_Rainbow_4P[0] + OpenTaiko.Skin.Result_UIMove_4P_X[pos]; - gauge_rainbow_y = OpenTaiko.Skin.Result_Gauge_Rainbow_4P[1] + OpenTaiko.Skin.Result_UIMove_4P_Y[pos]; - } else { - gauge_rainbow_x = OpenTaiko.Skin.Result_Gauge_Rainbow_X[pos] + uioffset_x; - gauge_rainbow_y = OpenTaiko.Skin.Result_Gauge_Rainbow_Y[pos]; - } - - // Flame and soul - int soulText_x; - int soulText_y; - int soulFire_x; - int soulFire_y; - if (OpenTaiko.ConfigIni.nPlayerCount == 5) { - soulText_x = OpenTaiko.Skin.Result_Soul_Text_5P[0] + OpenTaiko.Skin.Result_UIMove_5P_X[pos]; - soulText_y = OpenTaiko.Skin.Result_Soul_Text_5P[1] + OpenTaiko.Skin.Result_UIMove_5P_Y[pos]; - soulFire_x = OpenTaiko.Skin.Result_Soul_Fire_5P[0] + OpenTaiko.Skin.Result_UIMove_5P_X[pos]; - soulFire_y = OpenTaiko.Skin.Result_Soul_Fire_5P[1] + OpenTaiko.Skin.Result_UIMove_5P_Y[pos]; - } else if (OpenTaiko.ConfigIni.nPlayerCount == 4 || OpenTaiko.ConfigIni.nPlayerCount == 3) { - soulText_x = OpenTaiko.Skin.Result_Soul_Text_4P[0] + OpenTaiko.Skin.Result_UIMove_4P_X[0]; - soulText_y = OpenTaiko.Skin.Result_Soul_Text_4P[1] + OpenTaiko.Skin.Result_UIMove_4P_Y[1]; - soulFire_x = OpenTaiko.Skin.Result_Soul_Fire_4P[0] + OpenTaiko.Skin.Result_UIMove_4P_X[0]; - soulFire_y = OpenTaiko.Skin.Result_Soul_Fire_4P[1] + OpenTaiko.Skin.Result_UIMove_4P_Y[1]; - } else { - soulText_x = OpenTaiko.Skin.Result_Soul_Text_X[pos] + uioffset_x; - soulText_y = OpenTaiko.Skin.Result_Soul_Text_Y[pos]; - soulFire_x = OpenTaiko.Skin.Result_Soul_Fire_X[pos] + uioffset_x; - soulFire_y = OpenTaiko.Skin.Result_Soul_Fire_Y[pos]; - } - - // Clear text - int clearText_x; - int clearText_y; - if (OpenTaiko.ConfigIni.nPlayerCount == 5) { - clearText_x = OpenTaiko.Skin.Result_Gauge_ClearText_5P[0] + OpenTaiko.Skin.Result_UIMove_5P_X[pos]; - clearText_y = OpenTaiko.Skin.Result_Gauge_ClearText_5P[1] + OpenTaiko.Skin.Result_UIMove_5P_Y[pos]; - } else if (OpenTaiko.ConfigIni.nPlayerCount == 4 || OpenTaiko.ConfigIni.nPlayerCount == 3) { - clearText_x = OpenTaiko.Skin.Result_Gauge_ClearText_4P[0] + OpenTaiko.Skin.Result_UIMove_4P_X[pos]; - clearText_y = OpenTaiko.Skin.Result_Gauge_ClearText_4P[1] + OpenTaiko.Skin.Result_UIMove_4P_Y[pos]; - } else { - clearText_x = OpenTaiko.Skin.Result_Gauge_ClearText_X[pos] + uioffset_x; - clearText_y = OpenTaiko.Skin.Result_Gauge_ClearText_Y[pos]; - } - - // Textures - int _usedGauge = shiftPos; - CTexture baseTexture = OpenTaiko.Tx.Result_Gauge_Base[_usedGauge]; - CTexture fillTexture = OpenTaiko.Tx.Result_Gauge[_usedGauge]; - - CTexture[] rainbowTextureArr = OpenTaiko.Tx.Result_Rainbow; - CTexture yellowTexture = OpenTaiko.Tx.Result_Gauge_Clear; - CTexture baseNormaTexture = OpenTaiko.Tx.Result_Gauge_Clear_Base; - CTexture killzoneTexture = OpenTaiko.Tx.Result_Gauge_Killzone; - - CTexture flashTexture = null; - CTexture clearIcon = (gaugeType != EGaugeType.NORMAL) - ? OpenTaiko.Tx.Result_Gauge_Killzone - : OpenTaiko.Tx.Result_Gauge[0]; - - CTexture soulLetter = OpenTaiko.Tx.Result_Soul_Text; - CTexture soulFlame = OpenTaiko.Tx.Result_Soul_Fire; - - // Rectangles - Rectangle clearRectHighlight = new Rectangle( - OpenTaiko.Skin.Result_Gauge_ClearText_Clear_Rect[0], - OpenTaiko.Skin.Result_Gauge_ClearText_Clear_Rect[1], - OpenTaiko.Skin.Result_Gauge_ClearText_Clear_Rect[2], - OpenTaiko.Skin.Result_Gauge_ClearText_Clear_Rect[3] - ); - - Rectangle clearRect = new Rectangle( - OpenTaiko.Skin.Result_Gauge_ClearText_Rect[0], - OpenTaiko.Skin.Result_Gauge_ClearText_Rect[1], - OpenTaiko.Skin.Result_Gauge_ClearText_Rect[2], - OpenTaiko.Skin.Result_Gauge_ClearText_Rect[3] - ); - - // Positionnings - if (soulLetter != null) { - soulText_x -= (int)((soulLetter.szTextureSize.Width / 2)); - soulText_y -= (soulLetter.szTextureSize.Height / 4); - } - if (soulFlame != null) { - soulFire_y -= (soulFlame.szTextureSize.Height / 2); - soulFire_x -= (int)((soulFlame.szTextureSize.Width / 16)); - } - - tDrawCompleteGauge(baseTexture, baseNormaTexture, flashTexture, fillTexture, yellowTexture, rainbowTextureArr, killzoneTexture, clearIcon, null, null, gauge_x, gauge_y, gauge_rainbow_x, gauge_rainbow_y, 0, rainbowTextureIndex, soulFlameIndex, difficulty, level, currentPercent, gaugeType, scale_x, 1f, clearText_x, clearText_y, perfectHits, totalHits, soulText_x, soulText_y, soulFire_x, soulFire_y, clearRect, clearRectHighlight); - tDrawSoulFire(soulFlame, difficulty, level, currentPercent, gaugeType, 1f, 1f, soulFire_x, soulFire_y, soulFlameIndex); - tDrawSoulLetter(soulLetter, difficulty, level, currentPercent, gaugeType, 1f, 1f, soulText_x, soulText_y); - } - - #endregion - - private static int[] GaugeBox = { OpenTaiko.Skin.Game_Gauge_Rect[0], OpenTaiko.Skin.Game_Gauge_Rect[1], OpenTaiko.Skin.Game_Gauge_Rect[2], OpenTaiko.Skin.Game_Gauge_Rect[3] }; - } + + public static void tDrawClearIcon(CTexture clearIcon, Difficulty diff, int level, float currentPercent, int text_x, int text_y, EGaugeType gaugeType, int perfectHits, int totalNotes, Rectangle clearRect, Rectangle clearRectHighlight) { + if (clearIcon == null) return; + if (diff > Difficulty.Edit) return; + + float percent = Math.Min(100f, Math.Max(0f, currentPercent)); + bool highlight = (gaugeType != EGaugeType.NORMAL) + ? tIsDangerHardGauge(diff, level, gaugeType, currentPercent, perfectHits, totalNotes) + : tNormaCheck(diff, level, gaugeType, percent, 0); + + clearIcon.Opacity = 255; + if (highlight) { + clearIcon.t2D描画(text_x, text_y, clearRectHighlight); + } else { + clearIcon.t2D描画(text_x, text_y, clearRect); + } + } + + public static void tDrawSoulFire(CTexture soulFire, Difficulty diff, int level, float currentPercent, EGaugeType gaugeType, float scale_x, float scale_y, int fire_x, int fire_y, int fireFrame) { + if (soulFire == null) return; + if (gaugeType != EGaugeType.NORMAL || diff > Difficulty.Edit) return; + float percent = Math.Min(100f, Math.Max(0f, currentPercent)); + + int soulfire_width = soulFire.szTextureSize.Width / 8; + int soulfire_height = soulFire.szTextureSize.Height; + + if (percent >= 100.0) { + soulFire.vcScaleRatio.X = scale_x; + soulFire.vcScaleRatio.Y = scale_y; + + soulFire.t2D描画(fire_x, fire_y, new Rectangle(soulfire_width * fireFrame, 0, soulfire_width, soulfire_height)); + } + } + + public static void tDrawSoulLetter(CTexture soulLetter, Difficulty diff, int level, float currentPercent, EGaugeType gaugeType, float scale_x, float scale_y, int soul_x, int soul_y) { + if (soulLetter == null) return; + if (gaugeType != EGaugeType.NORMAL || diff > Difficulty.Edit) return; + float norma = tGetCurrentGaugeNorma(diff, level); + float percent = Math.Min(100f, Math.Max(0f, currentPercent)); + + soulLetter.vcScaleRatio.X = scale_x; + soulLetter.vcScaleRatio.Y = scale_y; + + int soul_height = soulLetter.szTextureSize.Height / 2; + if (tNormaCheck(diff, level, gaugeType, percent, 0)) { + soulLetter.t2D描画(soul_x, soul_y, new Rectangle(0, 0, soulLetter.szTextureSize.Width, soul_height)); + } else { + soulLetter.t2D描画(soul_x, soul_y, new Rectangle(0, soul_height, soulLetter.szTextureSize.Width, soul_height)); + } + } + + public static void tDrawCompleteGauge( + CTexture baseTexture, + CTexture baseNormaTexture, + CTexture flashTexture, + CTexture fillTexture, + CTexture yellowTexture, + CTexture[] rainbowTextureArr, + CTexture killzoneTexture, + CTexture clearIcon, + CTexture soulLetter, + CTexture soulFire, + int x, + int y, + int rainbow_x, + int rainbow_y, + int Opacity, + int RainbowTextureIndex, + int SoulFireIndex, + Difficulty diff, + int level, + float currentPercent, + EGaugeType gaugeType, + float scale_x, + float scale_y, + int text_x, + int text_y, + int perfectHits, + int totalNotes, + int soul_x, + int soul_y, + int fire_x, + int fire_y, + Rectangle clearRect, + Rectangle clearRectHighlight + ) { + // Layers : Base - Base clear - Fill - Flash - Killzone - Clear logo - Soul fire - Soul text + tDrawGaugeBase(baseTexture, x, y, scale_x, scale_y); + tDrawGaugeBaseClear(baseNormaTexture, x, y, diff, level, gaugeType, scale_x, scale_y); + tDrawGaugeFill(fillTexture, yellowTexture, (rainbowTextureArr != null && RainbowTextureIndex < rainbowTextureArr.Length) ? rainbowTextureArr[RainbowTextureIndex] : null, x, y, rainbow_x, rainbow_y, diff, level, currentPercent, gaugeType, scale_x, scale_y, Opacity, perfectHits, totalNotes); + if (!OpenTaiko.ConfigIni.SimpleMode) tDrawGaugeFlash(flashTexture, x, y, Opacity, diff, level, currentPercent, gaugeType, scale_x, scale_y); + tDrawKillZone(killzoneTexture, x, y, diff, level, gaugeType, scale_x, scale_y, perfectHits, totalNotes); + tDrawClearIcon(clearIcon, diff, level, currentPercent, text_x, text_y, gaugeType, perfectHits, totalNotes, clearRect, clearRectHighlight); + tDrawSoulFire(soulFire, diff, level, currentPercent, gaugeType, scale_x, scale_y, fire_x, fire_y, SoulFireIndex); + tDrawSoulLetter(soulLetter, diff, level, currentPercent, gaugeType, scale_x, scale_y, soul_x, soul_y); + } + + #endregion + + // Use with caution + #region [Unsafe methods] + + public static bool UNSAFE_FastNormaCheck(int player) { + var chara = OpenTaiko.Tx.Characters[OpenTaiko.SaveFileInstances[OpenTaiko.GetActualPlayer(player)].data.Character]; + var _dif = OpenTaiko.stageSongSelect.nChoosenSongDifficulty[player]; + return tNormaCheck( + (Difficulty)_dif, + OpenTaiko.stageSongSelect.rChoosenSong.arスコア[_dif].譜面情報.nレベル[_dif], + tGetGaugeTypeEnum(chara.effect.tGetGaugeType()), + (float)OpenTaiko.stage演奏ドラム画面.actGauge.db現在のゲージ値[player], + UNSAFE_KillZonePercent(player) + ); + } + + public static bool UNSAFE_IsRainbow(int player) { + var chara = OpenTaiko.Tx.Characters[OpenTaiko.SaveFileInstances[OpenTaiko.GetActualPlayer(player)].data.Character]; + if (tGetGaugeTypeEnum(chara.effect.tGetGaugeType()) != EGaugeType.NORMAL) return false; + return (float)OpenTaiko.stage演奏ドラム画面.actGauge.db現在のゲージ値[player] >= 100f; + } + + public static float UNSAFE_KillZonePercent(int player) { + var chara = OpenTaiko.Tx.Characters[OpenTaiko.SaveFileInstances[OpenTaiko.GetActualPlayer(player)].data.Character]; + CDTX[] dtxs = + { + OpenTaiko.DTX, + OpenTaiko.DTX_2P, + OpenTaiko.DTX_3P, + OpenTaiko.DTX_4P, + OpenTaiko.DTX_5P + }; + + // Total hits and perfect hits + int perfectHits = OpenTaiko.stage演奏ドラム画面.CChartScore[player].nGreat; + int totalHits = dtxs[player].nノーツ数[3]; + + // Difficulty + int _dif = OpenTaiko.stageSongSelect.nChoosenSongDifficulty[player]; + Difficulty difficulty = (Difficulty)_dif; + int level = OpenTaiko.stageSongSelect.rChoosenSong.arスコア[_dif].譜面情報.nレベル[_dif]; + + return tHardGaugeGetKillscreenRatio( + difficulty, + level, + tGetGaugeTypeEnum(chara.effect.tGetGaugeType()), + perfectHits, + totalHits); + } + + public static void UNSAFE_DrawGaugeFast(int player, int opacity, int rainbowTextureIndex, int soulFlameIndex) { + var chara = OpenTaiko.Tx.Characters[OpenTaiko.SaveFileInstances[OpenTaiko.GetActualPlayer(player)].data.Character]; + CDTX[] dtxs = + { + OpenTaiko.DTX, + OpenTaiko.DTX_2P, + OpenTaiko.DTX_3P, + OpenTaiko.DTX_4P, + OpenTaiko.DTX_5P + }; + + // Set box + GaugeBox = new int[] { OpenTaiko.Skin.Game_Gauge_Rect[0], OpenTaiko.Skin.Game_Gauge_Rect[1], OpenTaiko.Skin.Game_Gauge_Rect[2], OpenTaiko.Skin.Game_Gauge_Rect[3] }; + + // Gauge pos + int gauge_x = 0; + int gauge_y = 0; + + if (OpenTaiko.ConfigIni.nPlayerCount == 5) { + gauge_x = OpenTaiko.Skin.Game_Gauge_5P[0] + (OpenTaiko.Skin.Game_UIMove_5P[0] * player); + gauge_y = OpenTaiko.Skin.Game_Gauge_5P[1] + (OpenTaiko.Skin.Game_UIMove_5P[1] * player); + } else if (OpenTaiko.ConfigIni.nPlayerCount == 4 || OpenTaiko.ConfigIni.nPlayerCount == 3) { + gauge_x = OpenTaiko.Skin.Game_Gauge_4P[0] + (OpenTaiko.Skin.Game_UIMove_4P[0] * player); + gauge_y = OpenTaiko.Skin.Game_Gauge_4P[1] + (OpenTaiko.Skin.Game_UIMove_4P[1] * player); + } else if (OpenTaiko.ConfigIni.bAIBattleMode) { + gauge_x = OpenTaiko.Skin.Game_Gauge_X_AI; + gauge_y = OpenTaiko.Skin.Game_Gauge_Y_AI; + } else { + gauge_x = OpenTaiko.Skin.Game_Gauge_X[player]; + gauge_y = OpenTaiko.Skin.Game_Gauge_Y[player]; + } + + // Text pos + int text_x = 0; + int text_y = 0; + if (OpenTaiko.ConfigIni.nPlayerCount <= 2) { + if (OpenTaiko.ConfigIni.bAIBattleMode) { + text_x = OpenTaiko.Skin.Game_Gauge_ClearText_X_AI; + text_y = OpenTaiko.Skin.Game_Gauge_ClearText_Y_AI; + } else { + text_x = OpenTaiko.Skin.Game_Gauge_ClearText_X[player]; + text_y = OpenTaiko.Skin.Game_Gauge_ClearText_Y[player]; + } + } + + // Soul pos + int soul_x = 0; + int soul_y = 0; + if (OpenTaiko.ConfigIni.bAIBattleMode) { + soul_x = OpenTaiko.Skin.Gauge_Soul_X_AI; + soul_y = OpenTaiko.Skin.Gauge_Soul_Y_AI; + } else { + if (OpenTaiko.ConfigIni.nPlayerCount == 5) { + soul_x = OpenTaiko.Skin.Gauge_Soul_5P[0] + (OpenTaiko.Skin.Game_UIMove_5P[0] * player); + soul_y = OpenTaiko.Skin.Gauge_Soul_5P[1] + (OpenTaiko.Skin.Game_UIMove_5P[1] * player); + } else if (OpenTaiko.ConfigIni.nPlayerCount == 4 || OpenTaiko.ConfigIni.nPlayerCount == 3) { + soul_x = OpenTaiko.Skin.Gauge_Soul_4P[0] + (OpenTaiko.Skin.Game_UIMove_4P[0] * player); + soul_y = OpenTaiko.Skin.Gauge_Soul_4P[1] + (OpenTaiko.Skin.Game_UIMove_4P[1] * player); + } else { + soul_x = OpenTaiko.Skin.Gauge_Soul_X[player]; + soul_y = OpenTaiko.Skin.Gauge_Soul_Y[player]; + } + } + + // Fire pos + int fire_x = 0; + int fire_y = 0; + if (OpenTaiko.ConfigIni.bAIBattleMode) { + fire_x = OpenTaiko.Skin.Gauge_Soul_Fire_X_AI; + fire_y = OpenTaiko.Skin.Gauge_Soul_Fire_Y_AI; + } else { + if (OpenTaiko.ConfigIni.nPlayerCount == 5) { + fire_x = OpenTaiko.Skin.Gauge_Soul_Fire_5P[0] + (OpenTaiko.Skin.Game_UIMove_5P[0] * player); + fire_y = OpenTaiko.Skin.Gauge_Soul_Fire_5P[1] + (OpenTaiko.Skin.Game_UIMove_5P[1] * player); + } else if (OpenTaiko.ConfigIni.nPlayerCount == 4 || OpenTaiko.ConfigIni.nPlayerCount == 3) { + fire_x = OpenTaiko.Skin.Gauge_Soul_Fire_4P[0] + (OpenTaiko.Skin.Game_UIMove_4P[0] * player); + fire_y = OpenTaiko.Skin.Gauge_Soul_Fire_4P[1] + (OpenTaiko.Skin.Game_UIMove_4P[1] * player); + } else { + fire_x = OpenTaiko.Skin.Gauge_Soul_Fire_X[player]; + fire_y = OpenTaiko.Skin.Gauge_Soul_Fire_Y[player]; + } + } + + // Total hits and perfect hits + int perfectHits = OpenTaiko.stage演奏ドラム画面.CChartScore[player].nGreat; + int totalHits = dtxs[player].nノーツ数[3]; + + // Scale + float scale = 1.0f; + if (OpenTaiko.ConfigIni.bAIBattleMode) { + scale = 0.8f; + } + + // Difficulty + int _dif = OpenTaiko.stageSongSelect.nChoosenSongDifficulty[player]; + Difficulty difficulty = (Difficulty)_dif; + int level = OpenTaiko.stageSongSelect.rChoosenSong.arスコア[_dif].譜面情報.nレベル[_dif]; + + // Current percent + float currentPercent = (float)OpenTaiko.stage演奏ドラム画面.actGauge.db現在のゲージ値[player]; + + // Gauge type + EGaugeType gaugeType = tGetGaugeTypeEnum(chara.effect.tGetGaugeType()); + + // Textures + int _4pGaugeIDX = (OpenTaiko.ConfigIni.nPlayerCount >= 3) ? 1 : 0; + int _usedGauge = player + 3 * _4pGaugeIDX; + if (OpenTaiko.P1IsBlue()) _usedGauge = 2; + _4pGaugeIDX = (OpenTaiko.ConfigIni.nPlayerCount >= 3) ? 2 + : (player == 1) ? 1 + : 0; + + CTexture baseTexture = OpenTaiko.Tx.Gauge_Base[_usedGauge]; + CTexture fillTexture = OpenTaiko.Tx.Gauge[_usedGauge]; + + CTexture[] rainbowTextureArr = (new CTexture[][] { OpenTaiko.Tx.Gauge_Rainbow, OpenTaiko.Tx.Gauge_Rainbow_2PGauge, OpenTaiko.Tx.Gauge_Rainbow_Flat })[_4pGaugeIDX]; + CTexture yellowTexture = OpenTaiko.Tx.Gauge_Clear[_4pGaugeIDX]; + CTexture baseNormaTexture = OpenTaiko.Tx.Gauge_Base_Norma[_4pGaugeIDX]; + CTexture killzoneTexture = OpenTaiko.Tx.Gauge_Killzone[_4pGaugeIDX]; + + CTexture flashTexture = yellowTexture; + CTexture clearIcon = (_4pGaugeIDX == 2) + ? null + : (gaugeType != EGaugeType.NORMAL) + ? OpenTaiko.Tx.Gauge_Killzone[0] + : OpenTaiko.Tx.Gauge[0]; + CTexture soulLetter = OpenTaiko.Tx.Gauge_Soul; + CTexture soulFlame = OpenTaiko.Tx.Gauge_Soul_Fire; + + // Rectangles + Rectangle clearRectHighlight = new Rectangle( + OpenTaiko.Skin.Game_Gauge_ClearText_Rect[0], + OpenTaiko.Skin.Game_Gauge_ClearText_Rect[1], + OpenTaiko.Skin.Game_Gauge_ClearText_Rect[2], + OpenTaiko.Skin.Game_Gauge_ClearText_Rect[3] + ); + + Rectangle clearRect = new Rectangle( + OpenTaiko.Skin.Game_Gauge_ClearText_Clear_Rect[0], + OpenTaiko.Skin.Game_Gauge_ClearText_Clear_Rect[1], + OpenTaiko.Skin.Game_Gauge_ClearText_Clear_Rect[2], + OpenTaiko.Skin.Game_Gauge_ClearText_Clear_Rect[3] + ); + + tDrawCompleteGauge(baseTexture, baseNormaTexture, flashTexture, fillTexture, yellowTexture, rainbowTextureArr, killzoneTexture, clearIcon, soulLetter, soulFlame, gauge_x, gauge_y, gauge_x, gauge_y, opacity, rainbowTextureIndex, soulFlameIndex, difficulty, level, currentPercent, gaugeType, scale, scale, text_x, text_y, perfectHits, totalHits, soul_x, soul_y, fire_x, fire_y, clearRect, clearRectHighlight); + } + + public static void UNSAFE_DrawResultGaugeFast(int player, int shiftPos, int pos, int segmentsDisplayed, int rainbowTextureIndex, int soulFlameIndex, int uioffset_x) { + var chara = OpenTaiko.Tx.Characters[OpenTaiko.SaveFileInstances[OpenTaiko.GetActualPlayer(player)].data.Character]; + CDTX[] dtxs = + { + OpenTaiko.DTX, + OpenTaiko.DTX_2P, + OpenTaiko.DTX_3P, + OpenTaiko.DTX_4P, + OpenTaiko.DTX_5P + }; + + // Set box + GaugeBox = new int[] { OpenTaiko.Skin.Result_Gauge_Rect[0], OpenTaiko.Skin.Result_Gauge_Rect[1], OpenTaiko.Skin.Result_Gauge_Rect[2], OpenTaiko.Skin.Result_Gauge_Rect[3] }; + + // Total hits and perfect hits + int perfectHits = OpenTaiko.stage演奏ドラム画面.CChartScore[player].nGreat; + int totalHits = dtxs[player].nノーツ数[3]; + + // Gauge type + EGaugeType gaugeType = tGetGaugeTypeEnum(chara.effect.tGetGaugeType()); + + // Current percent + float currentPercent = segmentsDisplayed * 2f; + + // Scale x + float scale_x = 1.0f; + if (OpenTaiko.ConfigIni.nPlayerCount >= 3) { + scale_x = 0.5f; + } + + // Difficulty + int _dif = OpenTaiko.stageSongSelect.nChoosenSongDifficulty[player]; + Difficulty difficulty = (Difficulty)_dif; + int level = OpenTaiko.stageSongSelect.rChoosenSong.arスコア[_dif].譜面情報.nレベル[_dif]; + + int gauge_x; + int gauge_y; + if (OpenTaiko.ConfigIni.nPlayerCount == 5) { + gauge_x = OpenTaiko.Skin.Result_Gauge_5P[0] + OpenTaiko.Skin.Result_UIMove_5P_X[pos]; + gauge_y = OpenTaiko.Skin.Result_Gauge_5P[1] + OpenTaiko.Skin.Result_UIMove_5P_Y[pos]; + } else if (OpenTaiko.ConfigIni.nPlayerCount == 4 || OpenTaiko.ConfigIni.nPlayerCount == 3) { + gauge_x = OpenTaiko.Skin.Result_Gauge_4P[0] + OpenTaiko.Skin.Result_UIMove_4P_X[pos]; + gauge_y = OpenTaiko.Skin.Result_Gauge_4P[1] + OpenTaiko.Skin.Result_UIMove_4P_Y[pos]; + } else { + gauge_x = OpenTaiko.Skin.Result_Gauge_X[pos] + uioffset_x; + gauge_y = OpenTaiko.Skin.Result_Gauge_Y[pos]; + } + + int gauge_rainbow_x; + int gauge_rainbow_y; + if (OpenTaiko.ConfigIni.nPlayerCount == 5) { + gauge_rainbow_x = OpenTaiko.Skin.Result_Gauge_Rainbow_5P[0] + OpenTaiko.Skin.Result_UIMove_5P_X[pos]; + gauge_rainbow_y = OpenTaiko.Skin.Result_Gauge_Rainbow_5P[1] + OpenTaiko.Skin.Result_UIMove_5P_Y[pos]; + } else if (OpenTaiko.ConfigIni.nPlayerCount == 4 || OpenTaiko.ConfigIni.nPlayerCount == 3) { + gauge_rainbow_x = OpenTaiko.Skin.Result_Gauge_Rainbow_4P[0] + OpenTaiko.Skin.Result_UIMove_4P_X[pos]; + gauge_rainbow_y = OpenTaiko.Skin.Result_Gauge_Rainbow_4P[1] + OpenTaiko.Skin.Result_UIMove_4P_Y[pos]; + } else { + gauge_rainbow_x = OpenTaiko.Skin.Result_Gauge_Rainbow_X[pos] + uioffset_x; + gauge_rainbow_y = OpenTaiko.Skin.Result_Gauge_Rainbow_Y[pos]; + } + + // Flame and soul + int soulText_x; + int soulText_y; + int soulFire_x; + int soulFire_y; + if (OpenTaiko.ConfigIni.nPlayerCount == 5) { + soulText_x = OpenTaiko.Skin.Result_Soul_Text_5P[0] + OpenTaiko.Skin.Result_UIMove_5P_X[pos]; + soulText_y = OpenTaiko.Skin.Result_Soul_Text_5P[1] + OpenTaiko.Skin.Result_UIMove_5P_Y[pos]; + soulFire_x = OpenTaiko.Skin.Result_Soul_Fire_5P[0] + OpenTaiko.Skin.Result_UIMove_5P_X[pos]; + soulFire_y = OpenTaiko.Skin.Result_Soul_Fire_5P[1] + OpenTaiko.Skin.Result_UIMove_5P_Y[pos]; + } else if (OpenTaiko.ConfigIni.nPlayerCount == 4 || OpenTaiko.ConfigIni.nPlayerCount == 3) { + soulText_x = OpenTaiko.Skin.Result_Soul_Text_4P[0] + OpenTaiko.Skin.Result_UIMove_4P_X[0]; + soulText_y = OpenTaiko.Skin.Result_Soul_Text_4P[1] + OpenTaiko.Skin.Result_UIMove_4P_Y[1]; + soulFire_x = OpenTaiko.Skin.Result_Soul_Fire_4P[0] + OpenTaiko.Skin.Result_UIMove_4P_X[0]; + soulFire_y = OpenTaiko.Skin.Result_Soul_Fire_4P[1] + OpenTaiko.Skin.Result_UIMove_4P_Y[1]; + } else { + soulText_x = OpenTaiko.Skin.Result_Soul_Text_X[pos] + uioffset_x; + soulText_y = OpenTaiko.Skin.Result_Soul_Text_Y[pos]; + soulFire_x = OpenTaiko.Skin.Result_Soul_Fire_X[pos] + uioffset_x; + soulFire_y = OpenTaiko.Skin.Result_Soul_Fire_Y[pos]; + } + + // Clear text + int clearText_x; + int clearText_y; + if (OpenTaiko.ConfigIni.nPlayerCount == 5) { + clearText_x = OpenTaiko.Skin.Result_Gauge_ClearText_5P[0] + OpenTaiko.Skin.Result_UIMove_5P_X[pos]; + clearText_y = OpenTaiko.Skin.Result_Gauge_ClearText_5P[1] + OpenTaiko.Skin.Result_UIMove_5P_Y[pos]; + } else if (OpenTaiko.ConfigIni.nPlayerCount == 4 || OpenTaiko.ConfigIni.nPlayerCount == 3) { + clearText_x = OpenTaiko.Skin.Result_Gauge_ClearText_4P[0] + OpenTaiko.Skin.Result_UIMove_4P_X[pos]; + clearText_y = OpenTaiko.Skin.Result_Gauge_ClearText_4P[1] + OpenTaiko.Skin.Result_UIMove_4P_Y[pos]; + } else { + clearText_x = OpenTaiko.Skin.Result_Gauge_ClearText_X[pos] + uioffset_x; + clearText_y = OpenTaiko.Skin.Result_Gauge_ClearText_Y[pos]; + } + + // Textures + int _usedGauge = shiftPos; + CTexture baseTexture = OpenTaiko.Tx.Result_Gauge_Base[_usedGauge]; + CTexture fillTexture = OpenTaiko.Tx.Result_Gauge[_usedGauge]; + + CTexture[] rainbowTextureArr = OpenTaiko.Tx.Result_Rainbow; + CTexture yellowTexture = OpenTaiko.Tx.Result_Gauge_Clear; + CTexture baseNormaTexture = OpenTaiko.Tx.Result_Gauge_Clear_Base; + CTexture killzoneTexture = OpenTaiko.Tx.Result_Gauge_Killzone; + + CTexture flashTexture = null; + CTexture clearIcon = (gaugeType != EGaugeType.NORMAL) + ? OpenTaiko.Tx.Result_Gauge_Killzone + : OpenTaiko.Tx.Result_Gauge[0]; + + CTexture soulLetter = OpenTaiko.Tx.Result_Soul_Text; + CTexture soulFlame = OpenTaiko.Tx.Result_Soul_Fire; + + // Rectangles + Rectangle clearRectHighlight = new Rectangle( + OpenTaiko.Skin.Result_Gauge_ClearText_Clear_Rect[0], + OpenTaiko.Skin.Result_Gauge_ClearText_Clear_Rect[1], + OpenTaiko.Skin.Result_Gauge_ClearText_Clear_Rect[2], + OpenTaiko.Skin.Result_Gauge_ClearText_Clear_Rect[3] + ); + + Rectangle clearRect = new Rectangle( + OpenTaiko.Skin.Result_Gauge_ClearText_Rect[0], + OpenTaiko.Skin.Result_Gauge_ClearText_Rect[1], + OpenTaiko.Skin.Result_Gauge_ClearText_Rect[2], + OpenTaiko.Skin.Result_Gauge_ClearText_Rect[3] + ); + + // Positionnings + if (soulLetter != null) { + soulText_x -= (int)((soulLetter.szTextureSize.Width / 2)); + soulText_y -= (soulLetter.szTextureSize.Height / 4); + } + if (soulFlame != null) { + soulFire_y -= (soulFlame.szTextureSize.Height / 2); + soulFire_x -= (int)((soulFlame.szTextureSize.Width / 16)); + } + + tDrawCompleteGauge(baseTexture, baseNormaTexture, flashTexture, fillTexture, yellowTexture, rainbowTextureArr, killzoneTexture, clearIcon, null, null, gauge_x, gauge_y, gauge_rainbow_x, gauge_rainbow_y, 0, rainbowTextureIndex, soulFlameIndex, difficulty, level, currentPercent, gaugeType, scale_x, 1f, clearText_x, clearText_y, perfectHits, totalHits, soulText_x, soulText_y, soulFire_x, soulFire_y, clearRect, clearRectHighlight); + tDrawSoulFire(soulFlame, difficulty, level, currentPercent, gaugeType, 1f, 1f, soulFire_x, soulFire_y, soulFlameIndex); + tDrawSoulLetter(soulLetter, difficulty, level, currentPercent, gaugeType, 1f, 1f, soulText_x, soulText_y); + } + + #endregion + + private static int[] GaugeBox = { OpenTaiko.Skin.Game_Gauge_Rect[0], OpenTaiko.Skin.Game_Gauge_Rect[1], OpenTaiko.Skin.Game_Gauge_Rect[2], OpenTaiko.Skin.Game_Gauge_Rect[3] }; + } diff --git a/OpenTaiko/src/Helpers/HGenreBar.cs b/OpenTaiko/src/Helpers/HGenreBar.cs index 37248603..da362162 100644 --- a/OpenTaiko/src/Helpers/HGenreBar.cs +++ b/OpenTaiko/src/Helpers/HGenreBar.cs @@ -1,17 +1,17 @@ using FDK; -namespace OpenTaiko { - class HGenreBar { - public static CTexture tGetGenreBar(string value, Dictionary textures) { - if (textures.TryGetValue($"{value}", out CTexture tex)) { - return tex; +namespace OpenTaiko; + +class HGenreBar { + public static CTexture tGetGenreBar(string value, Dictionary textures) { + if (textures.TryGetValue($"{value}", out CTexture tex)) { + return tex; + } else { + if (textures.TryGetValue("0", out CTexture tex2)) { + return tex2; } else { - if (textures.TryGetValue("0", out CTexture tex2)) { - return tex2; - } else { - return null; - } + return null; } } } diff --git a/OpenTaiko/src/Helpers/HLocalizedPath.cs b/OpenTaiko/src/Helpers/HLocalizedPath.cs index cb4ed7bd..168840cf 100644 --- a/OpenTaiko/src/Helpers/HLocalizedPath.cs +++ b/OpenTaiko/src/Helpers/HLocalizedPath.cs @@ -1,23 +1,23 @@ -namespace OpenTaiko { - public static class HLocalizedPath { - public static string GetFullPathWithoutExtension(string path) { - return System.IO.Path.Combine(System.IO.Path.GetDirectoryName(path), System.IO.Path.GetFileNameWithoutExtension(path)); - } +namespace OpenTaiko; - public static String GetLocalizedPath(String ogPath, String langCode = null) { - if (String.IsNullOrEmpty(langCode)) - langCode = CLangManager.fetchLang(); +public static class HLocalizedPath { + public static string GetFullPathWithoutExtension(string path) { + return System.IO.Path.Combine(System.IO.Path.GetDirectoryName(path), System.IO.Path.GetFileNameWithoutExtension(path)); + } - String ext = System.IO.Path.GetExtension(ogPath); - String fp = HLocalizedPath.GetFullPathWithoutExtension(ogPath); - return (fp + "_" + langCode + ext); - } + public static String GetLocalizedPath(String ogPath, String langCode = null) { + if (String.IsNullOrEmpty(langCode)) + langCode = CLangManager.fetchLang(); - public static String GetAvailableLocalizedPath(String ogPath, String langCode = null) { - string path = GetLocalizedPath(ogPath, langCode); + String ext = System.IO.Path.GetExtension(ogPath); + String fp = HLocalizedPath.GetFullPathWithoutExtension(ogPath); + return (fp + "_" + langCode + ext); + } - if (File.Exists(path)) return path; - return ogPath; - } + public static String GetAvailableLocalizedPath(String ogPath, String langCode = null) { + string path = GetLocalizedPath(ogPath, langCode); + + if (File.Exists(path)) return path; + return ogPath; } } diff --git a/OpenTaiko/src/Helpers/HPrivateFastFont.cs b/OpenTaiko/src/Helpers/HPrivateFastFont.cs index 22abfbd4..921e5991 100644 --- a/OpenTaiko/src/Helpers/HPrivateFastFont.cs +++ b/OpenTaiko/src/Helpers/HPrivateFastFont.cs @@ -1,33 +1,33 @@ using FDK; -namespace OpenTaiko { - internal class HPrivateFastFont { - static string DefaultFont = CFontRenderer.DefaultFontName; +namespace OpenTaiko; - public static bool FontExists(string fontpath) { - return CFontRenderer.FontExists(fontpath); - } +internal class HPrivateFastFont { + static string DefaultFont = CFontRenderer.DefaultFontName; - public static CCachedFontRenderer tInstantiateFont(string fontName, int scale, CFontRenderer.FontStyle style = CFontRenderer.FontStyle.Regular) { - if (FontExists(fontName)) - return (new CCachedFontRenderer(fontName, scale, style)); - return (new CCachedFontRenderer(DefaultFont, scale, style)); - } + public static bool FontExists(string fontpath) { + return CFontRenderer.FontExists(fontpath); + } - public static CCachedFontRenderer tInstantiateMainFont(int scale, CFontRenderer.FontStyle style = CFontRenderer.FontStyle.Regular) { - if (FontExists(OpenTaiko.Skin.FontName)) - return (new CCachedFontRenderer(OpenTaiko.Skin.FontName, scale, style)); - if (FontExists(CLangManager.LangInstance.FontName)) - return (new CCachedFontRenderer(CLangManager.LangInstance.FontName, scale, style)); - return (new CCachedFontRenderer(DefaultFont, scale, style)); - } + public static CCachedFontRenderer tInstantiateFont(string fontName, int scale, CFontRenderer.FontStyle style = CFontRenderer.FontStyle.Regular) { + if (FontExists(fontName)) + return (new CCachedFontRenderer(fontName, scale, style)); + return (new CCachedFontRenderer(DefaultFont, scale, style)); + } - public static CCachedFontRenderer tInstantiateBoxFont(int scale, CFontRenderer.FontStyle style = CFontRenderer.FontStyle.Regular) { - if (FontExists(OpenTaiko.Skin.BoxFontName)) - return (new CCachedFontRenderer(OpenTaiko.Skin.FontName, scale, style)); - if (FontExists(CLangManager.LangInstance.BoxFontName)) - return (new CCachedFontRenderer(CLangManager.LangInstance.FontName, scale, style)); - return (new CCachedFontRenderer(DefaultFont, scale, style)); - } + public static CCachedFontRenderer tInstantiateMainFont(int scale, CFontRenderer.FontStyle style = CFontRenderer.FontStyle.Regular) { + if (FontExists(OpenTaiko.Skin.FontName)) + return (new CCachedFontRenderer(OpenTaiko.Skin.FontName, scale, style)); + if (FontExists(CLangManager.LangInstance.FontName)) + return (new CCachedFontRenderer(CLangManager.LangInstance.FontName, scale, style)); + return (new CCachedFontRenderer(DefaultFont, scale, style)); + } + + public static CCachedFontRenderer tInstantiateBoxFont(int scale, CFontRenderer.FontStyle style = CFontRenderer.FontStyle.Regular) { + if (FontExists(OpenTaiko.Skin.BoxFontName)) + return (new CCachedFontRenderer(OpenTaiko.Skin.FontName, scale, style)); + if (FontExists(CLangManager.LangInstance.BoxFontName)) + return (new CCachedFontRenderer(CLangManager.LangInstance.FontName, scale, style)); + return (new CCachedFontRenderer(DefaultFont, scale, style)); } } diff --git a/OpenTaiko/src/Helpers/HRarity.cs b/OpenTaiko/src/Helpers/HRarity.cs index 9a09d4e2..f6fc71a8 100644 --- a/OpenTaiko/src/Helpers/HRarity.cs +++ b/OpenTaiko/src/Helpers/HRarity.cs @@ -1,83 +1,83 @@ using Color = System.Drawing.Color; -namespace OpenTaiko { - internal class HRarity { - private static Dictionary RarityToColor = new Dictionary { - ["Poor"] = Color.Gray, - ["Common"] = Color.White, - ["Uncommon"] = Color.Lime, - ["Rare"] = Color.FromArgb(0xFF, 0x00, 0x88, 0xFF), - ["Epic"] = Color.FromArgb(0xFF, 0xC8, 0x00, 0xFF), - ["Legendary"] = Color.Orange, - ["Mythical"] = Color.Pink, - }; +namespace OpenTaiko; - private static Dictionary RarityToModalInt = new Dictionary { - ["Poor"] = 0, - ["Common"] = 0, - ["Uncommon"] = 1, - ["Rare"] = 2, - ["Epic"] = 3, - ["Legendary"] = 4, - ["Mythical"] = 4, - }; +internal class HRarity { + private static Dictionary RarityToColor = new Dictionary { + ["Poor"] = Color.Gray, + ["Common"] = Color.White, + ["Uncommon"] = Color.Lime, + ["Rare"] = Color.FromArgb(0xFF, 0x00, 0x88, 0xFF), + ["Epic"] = Color.FromArgb(0xFF, 0xC8, 0x00, 0xFF), + ["Legendary"] = Color.Orange, + ["Mythical"] = Color.Pink, + }; - private static Dictionary RarityToLangInt = new Dictionary { - ["Poor"] = 0, - ["Common"] = 1, - ["Uncommon"] = 2, - ["Rare"] = 3, - ["Epic"] = 4, - ["Legendary"] = 5, - ["Mythical"] = 6, - }; + private static Dictionary RarityToModalInt = new Dictionary { + ["Poor"] = 0, + ["Common"] = 0, + ["Uncommon"] = 1, + ["Rare"] = 2, + ["Epic"] = 3, + ["Legendary"] = 4, + ["Mythical"] = 4, + }; - private static Dictionary RarityToCoinMultiplier = new Dictionary { - ["Poor"] = 1f, - ["Common"] = 1f, - ["Uncommon"] = 1f, - ["Rare"] = 1f, - ["Epic"] = 1f, - ["Legendary"] = 1f, - ["Mythical"] = 1f, - }; + private static Dictionary RarityToLangInt = new Dictionary { + ["Poor"] = 0, + ["Common"] = 1, + ["Uncommon"] = 2, + ["Rare"] = 3, + ["Epic"] = 4, + ["Legendary"] = 5, + ["Mythical"] = 6, + }; - public static Color tRarityToColor(string rarity) { + private static Dictionary RarityToCoinMultiplier = new Dictionary { + ["Poor"] = 1f, + ["Common"] = 1f, + ["Uncommon"] = 1f, + ["Rare"] = 1f, + ["Epic"] = 1f, + ["Legendary"] = 1f, + ["Mythical"] = 1f, + }; - Color textColor = Color.White; + public static Color tRarityToColor(string rarity) { - if (RarityToColor.ContainsKey(rarity)) - textColor = RarityToColor[rarity]; + Color textColor = Color.White; - return textColor; + if (RarityToColor.ContainsKey(rarity)) + textColor = RarityToColor[rarity]; - } + return textColor; - public static int tRarityToModalInt(string rarity) { - int modalInt = 0; + } - if (RarityToModalInt.ContainsKey(rarity)) - modalInt = RarityToModalInt[rarity]; + public static int tRarityToModalInt(string rarity) { + int modalInt = 0; - return modalInt; - } + if (RarityToModalInt.ContainsKey(rarity)) + modalInt = RarityToModalInt[rarity]; - public static int tRarityToLangInt(string rarity) { - int modalInt = 1; + return modalInt; + } - if (RarityToLangInt.ContainsKey(rarity)) - modalInt = RarityToLangInt[rarity]; + public static int tRarityToLangInt(string rarity) { + int modalInt = 1; - return modalInt; - } + if (RarityToLangInt.ContainsKey(rarity)) + modalInt = RarityToLangInt[rarity]; - public static float tRarityToRarityToCoinMultiplier(string rarity) { - float coinMult = 1f; + return modalInt; + } - if (RarityToCoinMultiplier.ContainsKey(rarity)) - coinMult = RarityToCoinMultiplier[rarity]; + public static float tRarityToRarityToCoinMultiplier(string rarity) { + float coinMult = 1f; - return coinMult; - } + if (RarityToCoinMultiplier.ContainsKey(rarity)) + coinMult = RarityToCoinMultiplier[rarity]; + + return coinMult; } } diff --git a/OpenTaiko/src/Helpers/HScenePreset.cs b/OpenTaiko/src/Helpers/HScenePreset.cs index 9df12677..93a883d7 100644 --- a/OpenTaiko/src/Helpers/HScenePreset.cs +++ b/OpenTaiko/src/Helpers/HScenePreset.cs @@ -1,63 +1,63 @@ -namespace OpenTaiko { - class HScenePreset { - public static DBSkinPreset.SkinScene GetBGPreset() { - string presetSection = ""; - if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Tower) { - presetSection = "Tower"; - } else if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) { - presetSection = "Dan"; - } else if (OpenTaiko.ConfigIni.bAIBattleMode) { - presetSection = "AI"; - } else { - presetSection = "Regular"; - } +namespace OpenTaiko; - object _ps = null; - - switch (presetSection) { - case "Regular": - _ps = OpenTaiko.Skin.Game_SkinScenes.Regular; - break; - case "Dan": - _ps = OpenTaiko.Skin.Game_SkinScenes.Dan; - break; - case "Tower": - _ps = OpenTaiko.Skin.Game_SkinScenes.Tower; - break; - case "AI": - _ps = OpenTaiko.Skin.Game_SkinScenes.AI; - break; - default: - break; - }; - - bool sectionIsValid = _ps != null ? ((Dictionary)_ps).Count > 0 : false; - - var preset = (sectionIsValid - && OpenTaiko.stageSongSelect.rChoosenSong.strScenePreset != null - && ((Dictionary)_ps).ContainsKey(OpenTaiko.stageSongSelect.rChoosenSong.strScenePreset)) - ? ((Dictionary)_ps)[OpenTaiko.stageSongSelect.rChoosenSong.strScenePreset] - : null; - - if (sectionIsValid - && OpenTaiko.DTX.scenePreset != null - && ((Dictionary)_ps).ContainsKey(OpenTaiko.DTX.scenePreset)) // If currently selected song has valid SCENEPRESET metadata within TJA - { - preset = ((Dictionary)_ps)[OpenTaiko.DTX.scenePreset]; - } else if (sectionIsValid - && OpenTaiko.stageSongSelect.rChoosenSong.strScenePreset != null - && ((Dictionary)_ps).ContainsKey(OpenTaiko.stageSongSelect.rChoosenSong.strScenePreset)) { - preset = ((Dictionary)_ps)[OpenTaiko.stageSongSelect.rChoosenSong.strScenePreset]; - } else if (sectionIsValid - && ((Dictionary)_ps).ContainsKey("")) { - preset = ((Dictionary)_ps)[""]; - } else if (sectionIsValid) { - var cstps = (Dictionary)_ps; - Random rand = new Random(); - preset = cstps.ElementAt(rand.Next(0, cstps.Count)).Value; - } - - return preset; +class HScenePreset { + public static DBSkinPreset.SkinScene GetBGPreset() { + string presetSection = ""; + if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Tower) { + presetSection = "Tower"; + } else if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) { + presetSection = "Dan"; + } else if (OpenTaiko.ConfigIni.bAIBattleMode) { + presetSection = "AI"; + } else { + presetSection = "Regular"; } + + object _ps = null; + + switch (presetSection) { + case "Regular": + _ps = OpenTaiko.Skin.Game_SkinScenes.Regular; + break; + case "Dan": + _ps = OpenTaiko.Skin.Game_SkinScenes.Dan; + break; + case "Tower": + _ps = OpenTaiko.Skin.Game_SkinScenes.Tower; + break; + case "AI": + _ps = OpenTaiko.Skin.Game_SkinScenes.AI; + break; + default: + break; + }; + + bool sectionIsValid = _ps != null ? ((Dictionary)_ps).Count > 0 : false; + + var preset = (sectionIsValid + && OpenTaiko.stageSongSelect.rChoosenSong.strScenePreset != null + && ((Dictionary)_ps).ContainsKey(OpenTaiko.stageSongSelect.rChoosenSong.strScenePreset)) + ? ((Dictionary)_ps)[OpenTaiko.stageSongSelect.rChoosenSong.strScenePreset] + : null; + + if (sectionIsValid + && OpenTaiko.DTX.scenePreset != null + && ((Dictionary)_ps).ContainsKey(OpenTaiko.DTX.scenePreset)) // If currently selected song has valid SCENEPRESET metadata within TJA + { + preset = ((Dictionary)_ps)[OpenTaiko.DTX.scenePreset]; + } else if (sectionIsValid + && OpenTaiko.stageSongSelect.rChoosenSong.strScenePreset != null + && ((Dictionary)_ps).ContainsKey(OpenTaiko.stageSongSelect.rChoosenSong.strScenePreset)) { + preset = ((Dictionary)_ps)[OpenTaiko.stageSongSelect.rChoosenSong.strScenePreset]; + } else if (sectionIsValid + && ((Dictionary)_ps).ContainsKey("")) { + preset = ((Dictionary)_ps)[""]; + } else if (sectionIsValid) { + var cstps = (Dictionary)_ps; + Random rand = new Random(); + preset = cstps.ElementAt(rand.Next(0, cstps.Count)).Value; + } + + return preset; } } diff --git a/OpenTaiko/src/Helpers/HSongTraverse.cs b/OpenTaiko/src/Helpers/HSongTraverse.cs index 9781cf45..ec73fe85 100644 --- a/OpenTaiko/src/Helpers/HSongTraverse.cs +++ b/OpenTaiko/src/Helpers/HSongTraverse.cs @@ -1,22 +1,22 @@ -namespace OpenTaiko { - class HSongTraverse { - public static List SpecialFolders = new List { "Favorite", "最近遊んだ曲", "SearchD" }; +namespace OpenTaiko; - public static bool IsRegularFolder(CSongListNode node) { - if (node.eノード種別 != CSongListNode.ENodeType.BOX) return false; - if (SpecialFolders.Contains(node.strジャンル)) return false; - return true; +class HSongTraverse { + public static List SpecialFolders = new List { "Favorite", "最近遊んだ曲", "SearchD" }; + public static bool IsRegularFolder(CSongListNode node) { + if (node.eノード種別 != CSongListNode.ENodeType.BOX) return false; + if (SpecialFolders.Contains(node.strジャンル)) return false; + return true; + + } + public static int GetSongsMatchingCondition(CSongListNode parentBox, Func payload) { + int count = 0; + + foreach (CSongListNode child in parentBox.list子リスト) { + if (IsRegularFolder(child)) count += GetSongsMatchingCondition(child, payload); + else if (child.eノード種別 == CSongListNode.ENodeType.SCORE && payload(child)) count += 1; } - public static int GetSongsMatchingCondition(CSongListNode parentBox, Func payload) { - int count = 0; - foreach (CSongListNode child in parentBox.list子リスト) { - if (IsRegularFolder(child)) count += GetSongsMatchingCondition(child, payload); - else if (child.eノード種別 == CSongListNode.ENodeType.SCORE && payload(child)) count += 1; - } - - return count; - } + return count; } } diff --git a/OpenTaiko/src/Helpers/LocalizedStringConverter.cs b/OpenTaiko/src/Helpers/LocalizedStringConverter.cs index f21fc928..0d87e537 100644 --- a/OpenTaiko/src/Helpers/LocalizedStringConverter.cs +++ b/OpenTaiko/src/Helpers/LocalizedStringConverter.cs @@ -1,23 +1,23 @@ using Newtonsoft.Json; using Newtonsoft.Json.Linq; -namespace OpenTaiko { - internal class LocalizedStringConverter : JsonConverter { - public override bool CanConvert(Type objectType) { - // CanConvert is not called when the [JsonConverter] attribute is used - return false; - } +namespace OpenTaiko; - public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) { - JToken token = JToken.Load(reader); - if (token.Type == JTokenType.Object) { - return token.ToObject(serializer); - } - return token.ToString(); - } +internal class LocalizedStringConverter : JsonConverter { + public override bool CanConvert(Type objectType) { + // CanConvert is not called when the [JsonConverter] attribute is used + return false; + } - public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) { - serializer.Serialize(writer, value); + public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) { + JToken token = JToken.Load(reader); + if (token.Type == JTokenType.Object) { + return token.ToObject(serializer); } + return token.ToString(); + } + + public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) { + serializer.Serialize(writer, value); } } diff --git a/OpenTaiko/src/Helpers/SevenZipHelper.cs b/OpenTaiko/src/Helpers/SevenZipHelper.cs index 0bf08095..536fbb38 100644 --- a/OpenTaiko/src/Helpers/SevenZipHelper.cs +++ b/OpenTaiko/src/Helpers/SevenZipHelper.cs @@ -1,222 +1,221 @@ // http://www.nullskull.com/a/768/7zip-lzma-inmemory-compression-with-c.aspx // http://www.7-zip.org/sdk.html -namespace SevenZip.Compression.LZMA { +namespace SevenZip.Compression.LZMA; + +public static class SevenZipHelper { + + static int dictionary = 1 << 23; + // static Int32 posStateBits = 2; + // static Int32 litContextBits = 3; // for normal files + // UInt32 litContextBits = 0; // for 32-bit data + // static Int32 litPosBits = 0; + // UInt32 litPosBits = 2; // for 32-bit data + // static Int32 algorithm = 2; + // static Int32 numFastBytes = 128; - public static class SevenZipHelper { + static bool eos = false; - static int dictionary = 1 << 23; + static CoderPropID[] propIDs = + { + CoderPropID.DictionarySize, + CoderPropID.PosStateBits, + CoderPropID.LitContextBits, + CoderPropID.LitPosBits, + CoderPropID.Algorithm, + CoderPropID.NumFastBytes, + CoderPropID.MatchFinder, + CoderPropID.EndMarker + }; - // static Int32 posStateBits = 2; - // static Int32 litContextBits = 3; // for normal files - // UInt32 litContextBits = 0; // for 32-bit data - // static Int32 litPosBits = 0; - // UInt32 litPosBits = 2; // for 32-bit data - // static Int32 algorithm = 2; - // static Int32 numFastBytes = 128; + // these are the default properties, keeping it simple for now: + static object[] properties = + { + (System.Int32)(dictionary), + (System.Int32)(2), + (System.Int32)(3), + (System.Int32)(0), + (System.Int32)(2), + (System.Int32)(128), + "bt4", + eos + }; - static bool eos = false; - static CoderPropID[] propIDs = - { - CoderPropID.DictionarySize, - CoderPropID.PosStateBits, - CoderPropID.LitContextBits, - CoderPropID.LitPosBits, - CoderPropID.Algorithm, - CoderPropID.NumFastBytes, - CoderPropID.MatchFinder, - CoderPropID.EndMarker - }; + public static byte[] Compress(byte[] inputBytes) { + byte[] retVal = null; + SevenZip.Compression.LZMA.Encoder encoder = new SevenZip.Compression.LZMA.Encoder(); + encoder.SetCoderProperties(propIDs, properties); - // these are the default properties, keeping it simple for now: - static object[] properties = - { - (System.Int32)(dictionary), - (System.Int32)(2), - (System.Int32)(3), - (System.Int32)(0), - (System.Int32)(2), - (System.Int32)(128), - "bt4", - eos - }; + using (System.IO.MemoryStream strmInStream = new System.IO.MemoryStream(inputBytes)) { + using (System.IO.MemoryStream strmOutStream = new System.IO.MemoryStream()) { + encoder.WriteCoderProperties(strmOutStream); + long fileSize = strmInStream.Length; + for (int i = 0; i < 8; i++) + strmOutStream.WriteByte((byte)(fileSize >> (8 * i))); + encoder.Code(strmInStream, strmOutStream, -1, -1, null); + retVal = strmOutStream.ToArray(); + } // End Using outStream - public static byte[] Compress(byte[] inputBytes) { - byte[] retVal = null; - SevenZip.Compression.LZMA.Encoder encoder = new SevenZip.Compression.LZMA.Encoder(); - encoder.SetCoderProperties(propIDs, properties); + } // End Using inStream - using (System.IO.MemoryStream strmInStream = new System.IO.MemoryStream(inputBytes)) { - using (System.IO.MemoryStream strmOutStream = new System.IO.MemoryStream()) { - encoder.WriteCoderProperties(strmOutStream); - long fileSize = strmInStream.Length; - for (int i = 0; i < 8; i++) - strmOutStream.WriteByte((byte)(fileSize >> (8 * i))); + return retVal; + } // End Function Compress - encoder.Code(strmInStream, strmOutStream, -1, -1, null); - retVal = strmOutStream.ToArray(); - } // End Using outStream - } // End Using inStream + public static byte[] Compress(string inFileName) { + byte[] retVal = null; + SevenZip.Compression.LZMA.Encoder encoder = new SevenZip.Compression.LZMA.Encoder(); + encoder.SetCoderProperties(propIDs, properties); - return retVal; - } // End Function Compress + using (System.IO.Stream strmInStream = new System.IO.FileStream(inFileName, System.IO.FileMode.Open, System.IO.FileAccess.Read)) { + using (System.IO.MemoryStream strmOutStream = new System.IO.MemoryStream()) { + encoder.WriteCoderProperties(strmOutStream); + long fileSize = strmInStream.Length; + for (int i = 0; i < 8; i++) + strmOutStream.WriteByte((byte)(fileSize >> (8 * i))); + encoder.Code(strmInStream, strmOutStream, -1, -1, null); + retVal = strmOutStream.ToArray(); + } // End Using outStream - public static byte[] Compress(string inFileName) { - byte[] retVal = null; - SevenZip.Compression.LZMA.Encoder encoder = new SevenZip.Compression.LZMA.Encoder(); - encoder.SetCoderProperties(propIDs, properties); + } // End Using inStream - using (System.IO.Stream strmInStream = new System.IO.FileStream(inFileName, System.IO.FileMode.Open, System.IO.FileAccess.Read)) { - using (System.IO.MemoryStream strmOutStream = new System.IO.MemoryStream()) { - encoder.WriteCoderProperties(strmOutStream); - long fileSize = strmInStream.Length; - for (int i = 0; i < 8; i++) - strmOutStream.WriteByte((byte)(fileSize >> (8 * i))); + return retVal; + } // End Function Compress - encoder.Code(strmInStream, strmOutStream, -1, -1, null); - retVal = strmOutStream.ToArray(); - } // End Using outStream - } // End Using inStream + public static void Compress(string inFileName, string outFileName) { + SevenZip.Compression.LZMA.Encoder encoder = new SevenZip.Compression.LZMA.Encoder(); + encoder.SetCoderProperties(propIDs, properties); - return retVal; - } // End Function Compress + using (System.IO.Stream strmInStream = new System.IO.FileStream(inFileName, System.IO.FileMode.Open, System.IO.FileAccess.Read)) { + using (System.IO.Stream strmOutStream = new System.IO.FileStream(outFileName, System.IO.FileMode.Create)) { + encoder.WriteCoderProperties(strmOutStream); + long fileSize = strmInStream.Length; + for (int i = 0; i < 8; i++) + strmOutStream.WriteByte((byte)(fileSize >> (8 * i))); - public static void Compress(string inFileName, string outFileName) { - SevenZip.Compression.LZMA.Encoder encoder = new SevenZip.Compression.LZMA.Encoder(); - encoder.SetCoderProperties(propIDs, properties); + encoder.Code(strmInStream, strmOutStream, -1, -1, null); - using (System.IO.Stream strmInStream = new System.IO.FileStream(inFileName, System.IO.FileMode.Open, System.IO.FileAccess.Read)) { + strmOutStream.Flush(); + strmOutStream.Close(); + } // End Using outStream - using (System.IO.Stream strmOutStream = new System.IO.FileStream(outFileName, System.IO.FileMode.Create)) { - encoder.WriteCoderProperties(strmOutStream); - long fileSize = strmInStream.Length; - for (int i = 0; i < 8; i++) - strmOutStream.WriteByte((byte)(fileSize >> (8 * i))); + } // End Using inStream - encoder.Code(strmInStream, strmOutStream, -1, -1, null); + } // End Function Compress - strmOutStream.Flush(); - strmOutStream.Close(); - } // End Using outStream - } // End Using inStream - } // End Function Compress + public static byte[] Decompress(string inFileName) { + byte[] retVal = null; + SevenZip.Compression.LZMA.Decoder decoder = new SevenZip.Compression.LZMA.Decoder(); + using (System.IO.Stream strmInStream = new System.IO.FileStream(inFileName, System.IO.FileMode.Open, System.IO.FileAccess.Read)) { + strmInStream.Seek(0, 0); - public static byte[] Decompress(string inFileName) { - byte[] retVal = null; + using (System.IO.MemoryStream strmOutStream = new System.IO.MemoryStream()) { + byte[] properties2 = new byte[5]; + if (strmInStream.Read(properties2, 0, 5) != 5) + throw (new System.Exception("input .lzma is too short")); - SevenZip.Compression.LZMA.Decoder decoder = new SevenZip.Compression.LZMA.Decoder(); + long outSize = 0; + for (int i = 0; i < 8; i++) { + int v = strmInStream.ReadByte(); + if (v < 0) + throw (new System.Exception("Can't Read 1")); + outSize |= ((long)(byte)v) << (8 * i); + } //Next i - using (System.IO.Stream strmInStream = new System.IO.FileStream(inFileName, System.IO.FileMode.Open, System.IO.FileAccess.Read)) { - strmInStream.Seek(0, 0); + decoder.SetDecoderProperties(properties2); - using (System.IO.MemoryStream strmOutStream = new System.IO.MemoryStream()) { - byte[] properties2 = new byte[5]; - if (strmInStream.Read(properties2, 0, 5) != 5) - throw (new System.Exception("input .lzma is too short")); + long compressedSize = strmInStream.Length - strmInStream.Position; + decoder.Code(strmInStream, strmOutStream, compressedSize, outSize, null); - long outSize = 0; - for (int i = 0; i < 8; i++) { - int v = strmInStream.ReadByte(); - if (v < 0) - throw (new System.Exception("Can't Read 1")); - outSize |= ((long)(byte)v) << (8 * i); - } //Next i + retVal = strmOutStream.ToArray(); + } // End Using newOutStream - decoder.SetDecoderProperties(properties2); + } // End Using newInStream - long compressedSize = strmInStream.Length - strmInStream.Position; - decoder.Code(strmInStream, strmOutStream, compressedSize, outSize, null); + return retVal; + } // End Function Decompress - retVal = strmOutStream.ToArray(); - } // End Using newOutStream - } // End Using newInStream + public static void Decompress(string inFileName, string outFileName) { + SevenZip.Compression.LZMA.Decoder decoder = new SevenZip.Compression.LZMA.Decoder(); - return retVal; - } // End Function Decompress + using (System.IO.Stream strmInStream = new System.IO.FileStream(inFileName, System.IO.FileMode.Open, System.IO.FileAccess.Read)) { + strmInStream.Seek(0, 0); + using (System.IO.Stream strmOutStream = new System.IO.FileStream(outFileName, System.IO.FileMode.Create)) { + byte[] properties2 = new byte[5]; + if (strmInStream.Read(properties2, 0, 5) != 5) + throw (new System.Exception("input .lzma is too short")); - public static void Decompress(string inFileName, string outFileName) { - SevenZip.Compression.LZMA.Decoder decoder = new SevenZip.Compression.LZMA.Decoder(); + long outSize = 0; + for (int i = 0; i < 8; i++) { + int v = strmInStream.ReadByte(); + if (v < 0) + throw (new System.Exception("Can't Read 1")); + outSize |= ((long)(byte)v) << (8 * i); + } // Next i - using (System.IO.Stream strmInStream = new System.IO.FileStream(inFileName, System.IO.FileMode.Open, System.IO.FileAccess.Read)) { - strmInStream.Seek(0, 0); + decoder.SetDecoderProperties(properties2); - using (System.IO.Stream strmOutStream = new System.IO.FileStream(outFileName, System.IO.FileMode.Create)) { - byte[] properties2 = new byte[5]; - if (strmInStream.Read(properties2, 0, 5) != 5) - throw (new System.Exception("input .lzma is too short")); + long compressedSize = strmInStream.Length - strmInStream.Position; + decoder.Code(strmInStream, strmOutStream, compressedSize, outSize, null); - long outSize = 0; - for (int i = 0; i < 8; i++) { - int v = strmInStream.ReadByte(); - if (v < 0) - throw (new System.Exception("Can't Read 1")); - outSize |= ((long)(byte)v) << (8 * i); - } // Next i + strmOutStream.Flush(); + strmOutStream.Close(); + } // End Using newOutStream - decoder.SetDecoderProperties(properties2); + } // End Using newInStream - long compressedSize = strmInStream.Length - strmInStream.Position; - decoder.Code(strmInStream, strmOutStream, compressedSize, outSize, null); + } // End Function Decompress - strmOutStream.Flush(); - strmOutStream.Close(); - } // End Using newOutStream - } // End Using newInStream + public static byte[] Decompress(byte[] inputBytes) { + byte[] retVal = null; - } // End Function Decompress + SevenZip.Compression.LZMA.Decoder decoder = new SevenZip.Compression.LZMA.Decoder(); + using (System.IO.MemoryStream strmInStream = new System.IO.MemoryStream(inputBytes)) { + strmInStream.Seek(0, 0); - public static byte[] Decompress(byte[] inputBytes) { - byte[] retVal = null; + using (System.IO.MemoryStream strmOutStream = new System.IO.MemoryStream()) { + byte[] properties2 = new byte[5]; + if (strmInStream.Read(properties2, 0, 5) != 5) + throw (new System.Exception("input .lzma is too short")); - SevenZip.Compression.LZMA.Decoder decoder = new SevenZip.Compression.LZMA.Decoder(); + long outSize = 0; + for (int i = 0; i < 8; i++) { + int v = strmInStream.ReadByte(); + if (v < 0) + throw (new System.Exception("Can't Read 1")); + outSize |= ((long)(byte)v) << (8 * i); + } // Next i - using (System.IO.MemoryStream strmInStream = new System.IO.MemoryStream(inputBytes)) { - strmInStream.Seek(0, 0); + decoder.SetDecoderProperties(properties2); - using (System.IO.MemoryStream strmOutStream = new System.IO.MemoryStream()) { - byte[] properties2 = new byte[5]; - if (strmInStream.Read(properties2, 0, 5) != 5) - throw (new System.Exception("input .lzma is too short")); + long compressedSize = strmInStream.Length - strmInStream.Position; + decoder.Code(strmInStream, strmOutStream, compressedSize, outSize, null); - long outSize = 0; - for (int i = 0; i < 8; i++) { - int v = strmInStream.ReadByte(); - if (v < 0) - throw (new System.Exception("Can't Read 1")); - outSize |= ((long)(byte)v) << (8 * i); - } // Next i + retVal = strmOutStream.ToArray(); + } // End Using newOutStream - decoder.SetDecoderProperties(properties2); + } // End Using newInStream - long compressedSize = strmInStream.Length - strmInStream.Position; - decoder.Code(strmInStream, strmOutStream, compressedSize, outSize, null); + return retVal; + } // End Function Decompress - retVal = strmOutStream.ToArray(); - } // End Using newOutStream - } // End Using newInStream +} // End Class SevenZipHelper - return retVal; - } // End Function Decompress - - } // End Class SevenZipHelper - - -} // End Namespace SevenZip.Compression.LZMA +// End Namespace SevenZip.Compression.LZMA diff --git a/OpenTaiko/src/I18N/CLang.cs b/OpenTaiko/src/I18N/CLang.cs index 35a6546e..ec4c6e84 100644 --- a/OpenTaiko/src/I18N/CLang.cs +++ b/OpenTaiko/src/I18N/CLang.cs @@ -3,117 +3,117 @@ using System.Text.Json; using System.Text.Json.Nodes; using FDK; -namespace OpenTaiko { - internal class CLang { - public string Id { get; private set; } = "foo"; - public string Language { get; private set; } = "Unknown Language"; - public Dictionary Entries { get; private set; } = new Dictionary(); - public string InvalidKey { get; set; } = "KEY NOT FOUND: {0}"; +namespace OpenTaiko; - public string FontName { - get { return File.Exists(Path.Combine(Folder, _fontName)) ? Path.Combine(Folder, _fontName) : _fontName; } - private set { _fontName = value; } - } - public string BoxFontName { - get { return File.Exists(Path.Combine(Folder, _boxFontName)) ? Path.Combine(Folder, _boxFontName) : _boxFontName; } - private set { _boxFontName = value; } - } - public string Folder { get { return @$"{OpenTaiko.strEXEのあるフォルダ}Lang{Path.DirectorySeparatorChar}{Id}{Path.DirectorySeparatorChar}"; } } +internal class CLang { + public string Id { get; private set; } = "foo"; + public string Language { get; private set; } = "Unknown Language"; + public Dictionary Entries { get; private set; } = new Dictionary(); + public string InvalidKey { get; set; } = "KEY NOT FOUND: {0}"; - private string _fontName = CFontRenderer.DefaultFontName; - private string _boxFontName = CFontRenderer.DefaultFontName; + public string FontName { + get { return File.Exists(Path.Combine(Folder, _fontName)) ? Path.Combine(Folder, _fontName) : _fontName; } + private set { _fontName = value; } + } + public string BoxFontName { + get { return File.Exists(Path.Combine(Folder, _boxFontName)) ? Path.Combine(Folder, _boxFontName) : _boxFontName; } + private set { _boxFontName = value; } + } + public string Folder { get { return @$"{OpenTaiko.strEXEのあるフォルダ}Lang{Path.DirectorySeparatorChar}{Id}{Path.DirectorySeparatorChar}"; } } - public CLang(string id) { - Id = id; - } - public static CLang GetCLang(string id) { - CLang clang = new CLang(id); - if (clang.LangPathIsValid(out string path)) { - string data = File.ReadAllText(path); + private string _fontName = CFontRenderer.DefaultFontName; + private string _boxFontName = CFontRenderer.DefaultFontName; - JsonNodeOptions options = new JsonNodeOptions() { PropertyNameCaseInsensitive = false }; - JsonDocumentOptions doc = new JsonDocumentOptions() { CommentHandling = JsonCommentHandling.Skip, AllowTrailingCommas = true }; - JsonNode node = JsonNode.Parse(data, options, doc); + public CLang(string id) { + Id = id; + } + public static CLang GetCLang(string id) { + CLang clang = new CLang(id); + if (clang.LangPathIsValid(out string path)) { + string data = File.ReadAllText(path); - clang.Id = id; - clang.Language = node["Language"].Deserialize(); - clang.Entries = node["Entries"].Deserialize>(); - clang.InvalidKey = node["InvalidKey"].Deserialize(); - clang.FontName = node["FontName"].Deserialize(); - clang.BoxFontName = node["BoxFontName"].Deserialize(); + JsonNodeOptions options = new JsonNodeOptions() { PropertyNameCaseInsensitive = false }; + JsonDocumentOptions doc = new JsonDocumentOptions() { CommentHandling = JsonCommentHandling.Skip, AllowTrailingCommas = true }; + JsonNode node = JsonNode.Parse(data, options, doc); - return clang; - } else { - Trace.TraceError(@$"Language file for {id} at {path} could not be found. Did you remember to create a lang.json file for {id}?"); - return clang; - } - } - public static string GetLanguage(string id) { - CLang clang = GetCLang(id); - return clang.Language; - } - private bool LangPathIsValid(out string out_path) { - out_path = Path.Combine(Folder, "lang.json"); - return File.Exists(out_path); - } + clang.Id = id; + clang.Language = node["Language"].Deserialize(); + clang.Entries = node["Entries"].Deserialize>(); + clang.InvalidKey = node["InvalidKey"].Deserialize(); + clang.FontName = node["FontName"].Deserialize(); + clang.BoxFontName = node["BoxFontName"].Deserialize(); - public string GetString(string key) { - return (Entries.TryGetValue(key, out string? value)) ? value : InvalidKey.SafeFormat(key); - } - public string GetString(string key, params object?[] values) { - return (Entries.TryGetValue(key, out string? value)) ? value.SafeFormat(values) : InvalidKey.SafeFormat(key); + return clang; + } else { + Trace.TraceError(@$"Language file for {id} at {path} could not be found. Did you remember to create a lang.json file for {id}?"); + return clang; } + } + public static string GetLanguage(string id) { + CLang clang = GetCLang(id); + return clang.Language; + } + private bool LangPathIsValid(out string out_path) { + out_path = Path.Combine(Folder, "lang.json"); + return File.Exists(out_path); + } - public string GetDifficulty(int diff) { - switch (diff) { - case -1: - return GetString("DIFF_ANY"); - case (int)Difficulty.Easy: - return GetString("DIFF_EASY"); - case (int)Difficulty.Normal: - return GetString("DIFF_NORMAL"); - case (int)Difficulty.Hard: - return GetString("DIFF_HARD"); - case (int)Difficulty.Oni: - return GetString("DIFF_EX"); - case (int)Difficulty.Edit: - return GetString("DIFF_EXTRA"); - case (int)Difficulty.Tower: - return GetString("DIFF_TOWER"); - case (int)Difficulty.Dan: - return GetString("DIFF_DAN"); - default: - return GetString("DIFF_UNKNOWN"); - } + public string GetString(string key) { + return (Entries.TryGetValue(key, out string? value)) ? value : InvalidKey.SafeFormat(key); + } + public string GetString(string key, params object?[] values) { + return (Entries.TryGetValue(key, out string? value)) ? value.SafeFormat(values) : InvalidKey.SafeFormat(key); + } + + public string GetDifficulty(int diff) { + switch (diff) { + case -1: + return GetString("DIFF_ANY"); + case (int)Difficulty.Easy: + return GetString("DIFF_EASY"); + case (int)Difficulty.Normal: + return GetString("DIFF_NORMAL"); + case (int)Difficulty.Hard: + return GetString("DIFF_HARD"); + case (int)Difficulty.Oni: + return GetString("DIFF_EX"); + case (int)Difficulty.Edit: + return GetString("DIFF_EXTRA"); + case (int)Difficulty.Tower: + return GetString("DIFF_TOWER"); + case (int)Difficulty.Dan: + return GetString("DIFF_DAN"); + default: + return GetString("DIFF_UNKNOWN"); } - public string GetDifficulty(Difficulty diff) { return GetDifficulty((int)diff); } - public string GetExamName(int exam) { - switch (exam) { - case 0: - return CLangManager.LangInstance.GetString("DAN_CONDITION_NAME_SOUL"); - case 1: - return CLangManager.LangInstance.GetString("DAN_CONDITION_NAME_GOOD"); - case 2: - return CLangManager.LangInstance.GetString("DAN_CONDITION_NAME_OK"); - case 3: - return CLangManager.LangInstance.GetString("DAN_CONDITION_NAME_BAD"); - case 4: - return CLangManager.LangInstance.GetString("DAN_CONDITION_NAME_SCORE"); - case 5: - return CLangManager.LangInstance.GetString("DAN_CONDITION_NAME_ROLL"); - case 6: - return CLangManager.LangInstance.GetString("DAN_CONDITION_NAME_HIT"); - case 7: - return CLangManager.LangInstance.GetString("DAN_CONDITION_NAME_COMBO"); - case 8: - return CLangManager.LangInstance.GetString("DAN_CONDITION_NAME_ACCURACY"); - case 9: - return CLangManager.LangInstance.GetString("DAN_CONDITION_NAME_ADLIB"); - case 10: - return CLangManager.LangInstance.GetString("DAN_CONDITION_NAME_BOMB"); - default: - goto case 0; - } + } + public string GetDifficulty(Difficulty diff) { return GetDifficulty((int)diff); } + public string GetExamName(int exam) { + switch (exam) { + case 0: + return CLangManager.LangInstance.GetString("DAN_CONDITION_NAME_SOUL"); + case 1: + return CLangManager.LangInstance.GetString("DAN_CONDITION_NAME_GOOD"); + case 2: + return CLangManager.LangInstance.GetString("DAN_CONDITION_NAME_OK"); + case 3: + return CLangManager.LangInstance.GetString("DAN_CONDITION_NAME_BAD"); + case 4: + return CLangManager.LangInstance.GetString("DAN_CONDITION_NAME_SCORE"); + case 5: + return CLangManager.LangInstance.GetString("DAN_CONDITION_NAME_ROLL"); + case 6: + return CLangManager.LangInstance.GetString("DAN_CONDITION_NAME_HIT"); + case 7: + return CLangManager.LangInstance.GetString("DAN_CONDITION_NAME_COMBO"); + case 8: + return CLangManager.LangInstance.GetString("DAN_CONDITION_NAME_ACCURACY"); + case 9: + return CLangManager.LangInstance.GetString("DAN_CONDITION_NAME_ADLIB"); + case 10: + return CLangManager.LangInstance.GetString("DAN_CONDITION_NAME_BOMB"); + default: + goto case 0; } } } diff --git a/OpenTaiko/src/I18N/ILang.cs b/OpenTaiko/src/I18N/ILang.cs index 5b932685..c159d4cb 100644 --- a/OpenTaiko/src/I18N/ILang.cs +++ b/OpenTaiko/src/I18N/ILang.cs @@ -1,85 +1,85 @@ -namespace OpenTaiko { - internal interface ILang { - string GetString(int idx); +namespace OpenTaiko; + +internal interface ILang { + string GetString(int idx); +} + +static internal class CLangManager { + // Cheap factory-like design pattern + + public static (string, int) DefaultLanguage = ("ja", 0); + public static CLang LangInstance { get; private set; } = new CLang(Langcodes.FirstOrDefault("ja")); + public static void langAttach(string lang) { + LangInstance = CLang.GetCLang(lang); + CLuaScript.tReloadLanguage(lang); } - static internal class CLangManager { - // Cheap factory-like design pattern + public static int langToInt(string lang) { + return Array.IndexOf(Langcodes, lang); + } - public static (string, int) DefaultLanguage = ("ja", 0); - public static CLang LangInstance { get; private set; } = new CLang(Langcodes.FirstOrDefault("ja")); - public static void langAttach(string lang) { - LangInstance = CLang.GetCLang(lang); - CLuaScript.tReloadLanguage(lang); - } + public static string fetchLang() { + return LangInstance.Id; + } - public static int langToInt(string lang) { - return Array.IndexOf(Langcodes, lang); - } + public static string intToLang(int idx) { + return Langcodes[idx]; + } - public static string fetchLang() { - return LangInstance.Id; - } - - public static string intToLang(int idx) { - return Langcodes[idx]; - } - - // temporary garbage code - public static string[] Langcodes { - get { - if (_langCodes == null) - _langCodes = Directory.GetDirectories(Path.Combine(OpenTaiko.strEXEのあるフォルダ, "Lang"), "*", SearchOption.TopDirectoryOnly) + // temporary garbage code + public static string[] Langcodes { + get { + if (_langCodes == null) + _langCodes = Directory.GetDirectories(Path.Combine(OpenTaiko.strEXEのあるフォルダ, "Lang"), "*", SearchOption.TopDirectoryOnly) .Select(result => Path.GetRelativePath(Path.Combine(OpenTaiko.strEXEのあるフォルダ, "Lang"), result)) .ToArray(); - return _langCodes; - } + return _langCodes; } - public static string[] Languages { - get { - if (_languages == null) - _languages = Langcodes.Select(result => CLang.GetLanguage(result)).ToArray(); - - return _languages; - } - } - - public static CLocalizationData GetAllStringsAsLocalizationData(string key) { - if (_cachedLocs.ContainsKey(key)) return _cachedLocs[key]; - - CLocalizationData loc = new CLocalizationData(); - loc.SetString("default", "?"); - - foreach (string lang in Langcodes) { - CLang _inst = CLang.GetCLang(lang); - - loc.SetString(lang, _inst.GetString(key)); - } - - _cachedLocs[key] = loc; - return loc; - } - - public static CLocalizationData GetAllStringsAsLocalizationDataWithArgs(string key, string keySalt, params object?[] values) { - if (_cachedLocs.ContainsKey(key + keySalt)) return _cachedLocs[key + keySalt]; - - CLocalizationData loc = new CLocalizationData(); - loc.SetString("default", "?"); - - foreach (string lang in Langcodes) { - CLang _inst = CLang.GetCLang(lang); - - loc.SetString(lang, _inst.GetString(key, values)); - } - - _cachedLocs[key + keySalt] = loc; - return loc; - } - - private static string[] _langCodes; - private static string[] _languages; - - private static Dictionary _cachedLocs = new Dictionary(); } + public static string[] Languages { + get { + if (_languages == null) + _languages = Langcodes.Select(result => CLang.GetLanguage(result)).ToArray(); + + return _languages; + } + } + + public static CLocalizationData GetAllStringsAsLocalizationData(string key) { + if (_cachedLocs.ContainsKey(key)) return _cachedLocs[key]; + + CLocalizationData loc = new CLocalizationData(); + loc.SetString("default", "?"); + + foreach (string lang in Langcodes) { + CLang _inst = CLang.GetCLang(lang); + + loc.SetString(lang, _inst.GetString(key)); + } + + _cachedLocs[key] = loc; + return loc; + } + + public static CLocalizationData GetAllStringsAsLocalizationDataWithArgs(string key, string keySalt, params object?[] values) { + if (_cachedLocs.ContainsKey(key + keySalt)) return _cachedLocs[key + keySalt]; + + CLocalizationData loc = new CLocalizationData(); + loc.SetString("default", "?"); + + foreach (string lang in Langcodes) { + CLang _inst = CLang.GetCLang(lang); + + loc.SetString(lang, _inst.GetString(key, values)); + } + + _cachedLocs[key + keySalt] = loc; + return loc; + } + + private static string[] _langCodes; + private static string[] _languages; + + private static Dictionary _cachedLocs = new Dictionary(); } diff --git a/OpenTaiko/src/Items/CItemBase.cs b/OpenTaiko/src/Items/CItemBase.cs index 6fa783a1..9f65fa63 100644 --- a/OpenTaiko/src/Items/CItemBase.cs +++ b/OpenTaiko/src/Items/CItemBase.cs @@ -1,119 +1,119 @@ using System.Globalization; -namespace OpenTaiko { - /// - /// すべてのアイテムの基本クラス。 - /// - internal class CItemBase { - // Properties +namespace OpenTaiko; - public EPanelType eパネル種別; - public enum EPanelType { - Normal, - Other - } +/// +/// すべてのアイテムの基本クラス。 +/// +internal class CItemBase { + // Properties - public E種別 e種別; - public enum E種別 { - 基本形, - ONorOFFトグル, - ONorOFFor不定スリーステート, - 整数, - リスト, - 切替リスト - } + public EPanelType eパネル種別; + public enum EPanelType { + Normal, + Other + } - public string str項目名; - public string strName { - get { - return str項目名; + public E種別 e種別; + public enum E種別 { + 基本形, + ONorOFFトグル, + ONorOFFor不定スリーステート, + 整数, + リスト, + 切替リスト + } - } - } + public string str項目名; + public string strName { + get { + return str項目名; - public string str説明文; - public string strDescription { - get { - return str説明文; - - } - } - - - // Constructor - - public CItemBase() { - this.str項目名 = ""; - this.str説明文 = ""; - } - public CItemBase(string str項目名) - : this() { - this.t初期化(str項目名); - } - public CItemBase(string str項目名, string str説明文jp) - : this() { - this.t初期化(str項目名, str説明文jp); - } - public CItemBase(string str項目名, string str説明文jp, string str説明文en) - : this() { - this.t初期化(str項目名, str説明文jp, str説明文en); - } - - public CItemBase(string str項目名, EPanelType eパネル種別) - : this() { - this.t初期化(str項目名, eパネル種別); - } - public CItemBase(string str項目名, EPanelType eパネル種別, string str説明文jp) - : this() { - this.t初期化(str項目名, eパネル種別, str説明文jp); - } - public CItemBase(string str項目名, EPanelType eパネル種別, string str説明文jp, string str説明文en) - : this() { - this.t初期化(str項目名, eパネル種別, str説明文jp, str説明文en); - } - - - // メソッド;子クラスで実装する - - public virtual void tEnter押下() { - } - public virtual void t項目値を次へ移動() { - } - public virtual void t項目値を前へ移動() { - } - public virtual void t初期化(string str項目名) { - this.t初期化(str項目名, EPanelType.Normal); - } - public virtual void t初期化(string str項目名, string str説明文jp) { - this.t初期化(str項目名, EPanelType.Normal, str説明文jp, str説明文jp); - } - public virtual void t初期化(string str項目名, string str説明文jp, string str説明文en) { - this.t初期化(str項目名, EPanelType.Normal, str説明文jp, str説明文en); - } - - public virtual void t初期化(string str項目名, EPanelType eパネル種別) { - this.t初期化(str項目名, eパネル種別, "", ""); - } - public virtual void t初期化(string str項目名, EPanelType eパネル種別, string str説明文jp) { - this.t初期化(str項目名, eパネル種別, str説明文jp, str説明文jp); - } - public virtual void t初期化(string str項目名, EPanelType eパネル種別, string str説明文jp, string str説明文en) { - this.str項目名 = str項目名; - this.eパネル種別 = eパネル種別; - this.str説明文 = (CultureInfo.CurrentUICulture.TwoLetterISOLanguageName == "ja") ? str説明文jp : str説明文en; - } - public virtual object obj現在値() { - return null; - } - - public string tGetValueText() { - object value = obj現在値(); - return value == null ? "" : value.ToString(); - } - public virtual int GetIndex() { - return 0; - } - public virtual void SetIndex(int index) { } } + + public string str説明文; + public string strDescription { + get { + return str説明文; + + } + } + + + // Constructor + + public CItemBase() { + this.str項目名 = ""; + this.str説明文 = ""; + } + public CItemBase(string str項目名) + : this() { + this.t初期化(str項目名); + } + public CItemBase(string str項目名, string str説明文jp) + : this() { + this.t初期化(str項目名, str説明文jp); + } + public CItemBase(string str項目名, string str説明文jp, string str説明文en) + : this() { + this.t初期化(str項目名, str説明文jp, str説明文en); + } + + public CItemBase(string str項目名, EPanelType eパネル種別) + : this() { + this.t初期化(str項目名, eパネル種別); + } + public CItemBase(string str項目名, EPanelType eパネル種別, string str説明文jp) + : this() { + this.t初期化(str項目名, eパネル種別, str説明文jp); + } + public CItemBase(string str項目名, EPanelType eパネル種別, string str説明文jp, string str説明文en) + : this() { + this.t初期化(str項目名, eパネル種別, str説明文jp, str説明文en); + } + + + // メソッド;子クラスで実装する + + public virtual void tEnter押下() { + } + public virtual void t項目値を次へ移動() { + } + public virtual void t項目値を前へ移動() { + } + public virtual void t初期化(string str項目名) { + this.t初期化(str項目名, EPanelType.Normal); + } + public virtual void t初期化(string str項目名, string str説明文jp) { + this.t初期化(str項目名, EPanelType.Normal, str説明文jp, str説明文jp); + } + public virtual void t初期化(string str項目名, string str説明文jp, string str説明文en) { + this.t初期化(str項目名, EPanelType.Normal, str説明文jp, str説明文en); + } + + public virtual void t初期化(string str項目名, EPanelType eパネル種別) { + this.t初期化(str項目名, eパネル種別, "", ""); + } + public virtual void t初期化(string str項目名, EPanelType eパネル種別, string str説明文jp) { + this.t初期化(str項目名, eパネル種別, str説明文jp, str説明文jp); + } + public virtual void t初期化(string str項目名, EPanelType eパネル種別, string str説明文jp, string str説明文en) { + this.str項目名 = str項目名; + this.eパネル種別 = eパネル種別; + this.str説明文 = (CultureInfo.CurrentUICulture.TwoLetterISOLanguageName == "ja") ? str説明文jp : str説明文en; + } + public virtual object obj現在値() { + return null; + } + + public string tGetValueText() { + object value = obj現在値(); + return value == null ? "" : value.ToString(); + } + public virtual int GetIndex() { + return 0; + } + public virtual void SetIndex(int index) { + } } diff --git a/OpenTaiko/src/Items/CItemInteger.cs b/OpenTaiko/src/Items/CItemInteger.cs index cd63ae2b..84b38d71 100644 --- a/OpenTaiko/src/Items/CItemInteger.cs +++ b/OpenTaiko/src/Items/CItemInteger.cs @@ -1,106 +1,106 @@ -namespace OpenTaiko { - /// - /// 「整数」を表すアイテム。 - /// - internal class CItemInteger : CItemBase { - // Properties +namespace OpenTaiko; - public int n現在の値; - public bool b値がフォーカスされている; +/// +/// 「整数」を表すアイテム。 +/// +internal class CItemInteger : CItemBase { + // Properties + + public int n現在の値; + public bool b値がフォーカスされている; - // Constructor + // Constructor - public CItemInteger() { - base.e種別 = CItemBase.E種別.整数; - this.n最小値 = 0; - this.n最大値 = 0; - this.n現在の値 = 0; - this.b値がフォーカスされている = false; - } - public CItemInteger(string str項目名, int n最小値, int n最大値, int n初期値) - : this() { - this.t初期化(str項目名, n最小値, n最大値, n初期値); - } - public CItemInteger(string str項目名, int n最小値, int n最大値, int n初期値, string str説明文jp) - : this() { - this.t初期化(str項目名, n最小値, n最大値, n初期値, str説明文jp); - } - public CItemInteger(string str項目名, int n最小値, int n最大値, int n初期値, string str説明文jp, string str説明文en) - : this() { - this.t初期化(str項目名, n最小値, n最大値, n初期値, str説明文jp, str説明文en); - } - - - public CItemInteger(string str項目名, int n最小値, int n最大値, int n初期値, CItemBase.EPanelType eパネル種別) - : this() { - this.t初期化(str項目名, n最小値, n最大値, n初期値, eパネル種別); - } - public CItemInteger(string str項目名, int n最小値, int n最大値, int n初期値, CItemBase.EPanelType eパネル種別, string str説明文jp) - : this() { - this.t初期化(str項目名, n最小値, n最大値, n初期値, eパネル種別, str説明文jp); - } - public CItemInteger(string str項目名, int n最小値, int n最大値, int n初期値, CItemBase.EPanelType eパネル種別, string str説明文jp, string str説明文en) - : this() { - this.t初期化(str項目名, n最小値, n最大値, n初期値, eパネル種別, str説明文jp, str説明文en); - } - - - // CItemBase 実装 - - public override void tEnter押下() { - this.b値がフォーカスされている = !this.b値がフォーカスされている; - } - public override void t項目値を次へ移動() { - if (++this.n現在の値 > this.n最大値) { - this.n現在の値 = this.n最大値; - } - } - public override void t項目値を前へ移動() { - if (--this.n現在の値 < this.n最小値) { - this.n現在の値 = this.n最小値; - } - } - public void t初期化(string str項目名, int n最小値, int n最大値, int n初期値) { - this.t初期化(str項目名, n最小値, n最大値, n初期値, CItemBase.EPanelType.Normal, "", ""); - } - public void t初期化(string str項目名, int n最小値, int n最大値, int n初期値, string str説明文jp) { - this.t初期化(str項目名, n最小値, n最大値, n初期値, CItemBase.EPanelType.Normal, str説明文jp, str説明文jp); - } - public void t初期化(string str項目名, int n最小値, int n最大値, int n初期値, string str説明文jp, string str説明文en) { - this.t初期化(str項目名, n最小値, n最大値, n初期値, CItemBase.EPanelType.Normal, str説明文jp, str説明文en); - } - - - public void t初期化(string str項目名, int n最小値, int n最大値, int n初期値, CItemBase.EPanelType eパネル種別) { - this.t初期化(str項目名, n最小値, n最大値, n初期値, eパネル種別, "", ""); - } - public void t初期化(string str項目名, int n最小値, int n最大値, int n初期値, CItemBase.EPanelType eパネル種別, string str説明文jp) { - this.t初期化(str項目名, n最小値, n最大値, n初期値, eパネル種別, str説明文jp, str説明文jp); - } - public void t初期化(string str項目名, int n最小値, int n最大値, int n初期値, CItemBase.EPanelType eパネル種別, string str説明文jp, string str説明文en) { - base.t初期化(str項目名, eパネル種別, str説明文jp, str説明文en); - this.n最小値 = n最小値; - this.n最大値 = n最大値; - this.n現在の値 = n初期値; - this.b値がフォーカスされている = false; - } - public override object obj現在値() { - return this.n現在の値; - } - public override int GetIndex() { - return this.n現在の値; - } - public override void SetIndex(int index) { - this.n現在の値 = index; - } - // その他 - - #region [ private ] - //----------------- - private int n最小値; - private int n最大値; - //----------------- - #endregion + public CItemInteger() { + base.e種別 = CItemBase.E種別.整数; + this.n最小値 = 0; + this.n最大値 = 0; + this.n現在の値 = 0; + this.b値がフォーカスされている = false; } + public CItemInteger(string str項目名, int n最小値, int n最大値, int n初期値) + : this() { + this.t初期化(str項目名, n最小値, n最大値, n初期値); + } + public CItemInteger(string str項目名, int n最小値, int n最大値, int n初期値, string str説明文jp) + : this() { + this.t初期化(str項目名, n最小値, n最大値, n初期値, str説明文jp); + } + public CItemInteger(string str項目名, int n最小値, int n最大値, int n初期値, string str説明文jp, string str説明文en) + : this() { + this.t初期化(str項目名, n最小値, n最大値, n初期値, str説明文jp, str説明文en); + } + + + public CItemInteger(string str項目名, int n最小値, int n最大値, int n初期値, CItemBase.EPanelType eパネル種別) + : this() { + this.t初期化(str項目名, n最小値, n最大値, n初期値, eパネル種別); + } + public CItemInteger(string str項目名, int n最小値, int n最大値, int n初期値, CItemBase.EPanelType eパネル種別, string str説明文jp) + : this() { + this.t初期化(str項目名, n最小値, n最大値, n初期値, eパネル種別, str説明文jp); + } + public CItemInteger(string str項目名, int n最小値, int n最大値, int n初期値, CItemBase.EPanelType eパネル種別, string str説明文jp, string str説明文en) + : this() { + this.t初期化(str項目名, n最小値, n最大値, n初期値, eパネル種別, str説明文jp, str説明文en); + } + + + // CItemBase 実装 + + public override void tEnter押下() { + this.b値がフォーカスされている = !this.b値がフォーカスされている; + } + public override void t項目値を次へ移動() { + if (++this.n現在の値 > this.n最大値) { + this.n現在の値 = this.n最大値; + } + } + public override void t項目値を前へ移動() { + if (--this.n現在の値 < this.n最小値) { + this.n現在の値 = this.n最小値; + } + } + public void t初期化(string str項目名, int n最小値, int n最大値, int n初期値) { + this.t初期化(str項目名, n最小値, n最大値, n初期値, CItemBase.EPanelType.Normal, "", ""); + } + public void t初期化(string str項目名, int n最小値, int n最大値, int n初期値, string str説明文jp) { + this.t初期化(str項目名, n最小値, n最大値, n初期値, CItemBase.EPanelType.Normal, str説明文jp, str説明文jp); + } + public void t初期化(string str項目名, int n最小値, int n最大値, int n初期値, string str説明文jp, string str説明文en) { + this.t初期化(str項目名, n最小値, n最大値, n初期値, CItemBase.EPanelType.Normal, str説明文jp, str説明文en); + } + + + public void t初期化(string str項目名, int n最小値, int n最大値, int n初期値, CItemBase.EPanelType eパネル種別) { + this.t初期化(str項目名, n最小値, n最大値, n初期値, eパネル種別, "", ""); + } + public void t初期化(string str項目名, int n最小値, int n最大値, int n初期値, CItemBase.EPanelType eパネル種別, string str説明文jp) { + this.t初期化(str項目名, n最小値, n最大値, n初期値, eパネル種別, str説明文jp, str説明文jp); + } + public void t初期化(string str項目名, int n最小値, int n最大値, int n初期値, CItemBase.EPanelType eパネル種別, string str説明文jp, string str説明文en) { + base.t初期化(str項目名, eパネル種別, str説明文jp, str説明文en); + this.n最小値 = n最小値; + this.n最大値 = n最大値; + this.n現在の値 = n初期値; + this.b値がフォーカスされている = false; + } + public override object obj現在値() { + return this.n現在の値; + } + public override int GetIndex() { + return this.n現在の値; + } + public override void SetIndex(int index) { + this.n現在の値 = index; + } + // その他 + + #region [ private ] + //----------------- + private int n最小値; + private int n最大値; + //----------------- + #endregion } diff --git a/OpenTaiko/src/Items/CItemList.cs b/OpenTaiko/src/Items/CItemList.cs index e6f03fb6..57c35935 100644 --- a/OpenTaiko/src/Items/CItemList.cs +++ b/OpenTaiko/src/Items/CItemList.cs @@ -1,126 +1,125 @@ -namespace OpenTaiko { - /// - /// 「リスト」(複数の固定値からの1つを選択可能)を表すアイテム。 - /// - internal class CItemList : CItemBase { - // Properties +namespace OpenTaiko; - public List list項目値; - public int n現在選択されている項目番号; +/// +/// 「リスト」(複数の固定値からの1つを選択可能)を表すアイテム。 +/// +internal class CItemList : CItemBase { + // Properties + + public List list項目値; + public int n現在選択されている項目番号; - // Constructor + // Constructor - public CItemList() { - base.e種別 = CItemBase.E種別.リスト; - this.n現在選択されている項目番号 = 0; - this.list項目値 = new List(); - } - public CItemList(string str項目名) - : this() { - this.t初期化(str項目名); - } - public CItemList(string str項目名, CItemBase.EPanelType eパネル種別) - : this() { - this.t初期化(str項目名, eパネル種別); - } - public CItemList(string str項目名, CItemBase.EPanelType eパネル種別, int n初期インデックス値, params string[] arg項目リスト) - : this() { - this.t初期化(str項目名, eパネル種別, n初期インデックス値, arg項目リスト); - } - public CItemList(string str項目名, CItemBase.EPanelType eパネル種別, int n初期インデックス値, string str説明文jp, params string[] arg項目リスト) - : this() { - this.t初期化(str項目名, eパネル種別, n初期インデックス値, str説明文jp, arg項目リスト); - } - public CItemList(string str項目名, CItemBase.EPanelType eパネル種別, int n初期インデックス値, string str説明文jp, string str説明文en, params string[] arg項目リスト) - : this() { - this.t初期化(str項目名, eパネル種別, n初期インデックス値, str説明文jp, str説明文en, arg項目リスト); - } - - - // CItemBase 実装 - - public override void tEnter押下() { - this.t項目値を次へ移動(); - } - public override void t項目値を次へ移動() { - if (++this.n現在選択されている項目番号 >= this.list項目値.Count) { - this.n現在選択されている項目番号 = 0; - } - } - public override void t項目値を前へ移動() { - if (--this.n現在選択されている項目番号 < 0) { - this.n現在選択されている項目番号 = this.list項目値.Count - 1; - } - } - public override void t初期化(string str項目名, CItemBase.EPanelType eパネル種別) { - base.t初期化(str項目名, eパネル種別); - this.n現在選択されている項目番号 = 0; - this.list項目値.Clear(); - } - public void t初期化(string str項目名, CItemBase.EPanelType eパネル種別, int n初期インデックス値, params string[] arg項目リスト) { - this.t初期化(str項目名, eパネル種別, n初期インデックス値, "", "", arg項目リスト); - } - public void t初期化(string str項目名, CItemBase.EPanelType eパネル種別, int n初期インデックス値, string str説明文jp, params string[] arg項目リスト) { - this.t初期化(str項目名, eパネル種別, n初期インデックス値, str説明文jp, str説明文jp, arg項目リスト); - } - public void t初期化(string str項目名, CItemBase.EPanelType eパネル種別, int n初期インデックス値, string str説明文jp, string str説明文en, params string[] arg項目リスト) { - base.t初期化(str項目名, eパネル種別, str説明文jp, str説明文en); - this.n現在選択されている項目番号 = n初期インデックス値; - foreach (string str in arg項目リスト) { - this.list項目値.Add(str); - } - } - public override object obj現在値() { - return this.list項目値[n現在選択されている項目番号]; - } - public override int GetIndex() { - return n現在選択されている項目番号; - } - public override void SetIndex(int index) { - n現在選択されている項目番号 = index; - } + public CItemList() { + base.e種別 = CItemBase.E種別.リスト; + this.n現在選択されている項目番号 = 0; + this.list項目値 = new List(); + } + public CItemList(string str項目名) + : this() { + this.t初期化(str項目名); + } + public CItemList(string str項目名, CItemBase.EPanelType eパネル種別) + : this() { + this.t初期化(str項目名, eパネル種別); + } + public CItemList(string str項目名, CItemBase.EPanelType eパネル種別, int n初期インデックス値, params string[] arg項目リスト) + : this() { + this.t初期化(str項目名, eパネル種別, n初期インデックス値, arg項目リスト); + } + public CItemList(string str項目名, CItemBase.EPanelType eパネル種別, int n初期インデックス値, string str説明文jp, params string[] arg項目リスト) + : this() { + this.t初期化(str項目名, eパネル種別, n初期インデックス値, str説明文jp, arg項目リスト); + } + public CItemList(string str項目名, CItemBase.EPanelType eパネル種別, int n初期インデックス値, string str説明文jp, string str説明文en, params string[] arg項目リスト) + : this() { + this.t初期化(str項目名, eパネル種別, n初期インデックス値, str説明文jp, str説明文en, arg項目リスト); } + // CItemBase 実装 - - /// - /// 簡易コンフィグの「切り替え」に使用する、「リスト」(複数の固定値からの1つを選択可能)を表すアイテム。 - /// e種別が違うのと、tEnter押下()で何もしない以外は、「リスト」そのまま。 - /// - internal class CSwitchItemList : CItemList { - // Constructor - - public CSwitchItemList() { - base.e種別 = CItemBase.E種別.切替リスト; + public override void tEnter押下() { + this.t項目値を次へ移動(); + } + public override void t項目値を次へ移動() { + if (++this.n現在選択されている項目番号 >= this.list項目値.Count) { this.n現在選択されている項目番号 = 0; - this.list項目値 = new List(); - } - public CSwitchItemList(string str項目名) - : this() { - this.t初期化(str項目名); - } - public CSwitchItemList(string str項目名, CItemBase.EPanelType eパネル種別) - : this() { - this.t初期化(str項目名, eパネル種別); - } - public CSwitchItemList(string str項目名, CItemBase.EPanelType eパネル種別, int n初期インデックス値, params string[] arg項目リスト) - : this() { - this.t初期化(str項目名, eパネル種別, n初期インデックス値, arg項目リスト); - } - public CSwitchItemList(string str項目名, CItemBase.EPanelType eパネル種別, int n初期インデックス値, string str説明文jp, params string[] arg項目リスト) - : this() { - this.t初期化(str項目名, eパネル種別, n初期インデックス値, str説明文jp, arg項目リスト); - } - public CSwitchItemList(string str項目名, CItemBase.EPanelType eパネル種別, int n初期インデックス値, string str説明文jp, string str説明文en, params string[] arg項目リスト) - : this() { - this.t初期化(str項目名, eパネル種別, n初期インデックス値, str説明文jp, str説明文en, arg項目リスト); - } - - public override void tEnter押下() { - // this.t項目値を次へ移動(); // 何もしない } } - + public override void t項目値を前へ移動() { + if (--this.n現在選択されている項目番号 < 0) { + this.n現在選択されている項目番号 = this.list項目値.Count - 1; + } + } + public override void t初期化(string str項目名, CItemBase.EPanelType eパネル種別) { + base.t初期化(str項目名, eパネル種別); + this.n現在選択されている項目番号 = 0; + this.list項目値.Clear(); + } + public void t初期化(string str項目名, CItemBase.EPanelType eパネル種別, int n初期インデックス値, params string[] arg項目リスト) { + this.t初期化(str項目名, eパネル種別, n初期インデックス値, "", "", arg項目リスト); + } + public void t初期化(string str項目名, CItemBase.EPanelType eパネル種別, int n初期インデックス値, string str説明文jp, params string[] arg項目リスト) { + this.t初期化(str項目名, eパネル種別, n初期インデックス値, str説明文jp, str説明文jp, arg項目リスト); + } + public void t初期化(string str項目名, CItemBase.EPanelType eパネル種別, int n初期インデックス値, string str説明文jp, string str説明文en, params string[] arg項目リスト) { + base.t初期化(str項目名, eパネル種別, str説明文jp, str説明文en); + this.n現在選択されている項目番号 = n初期インデックス値; + foreach (string str in arg項目リスト) { + this.list項目値.Add(str); + } + } + public override object obj現在値() { + return this.list項目値[n現在選択されている項目番号]; + } + public override int GetIndex() { + return n現在選択されている項目番号; + } + public override void SetIndex(int index) { + n現在選択されている項目番号 = index; + } +} + + + + +/// +/// 簡易コンフィグの「切り替え」に使用する、「リスト」(複数の固定値からの1つを選択可能)を表すアイテム。 +/// e種別が違うのと、tEnter押下()で何もしない以外は、「リスト」そのまま。 +/// +internal class CSwitchItemList : CItemList { + // Constructor + + public CSwitchItemList() { + base.e種別 = CItemBase.E種別.切替リスト; + this.n現在選択されている項目番号 = 0; + this.list項目値 = new List(); + } + public CSwitchItemList(string str項目名) + : this() { + this.t初期化(str項目名); + } + public CSwitchItemList(string str項目名, CItemBase.EPanelType eパネル種別) + : this() { + this.t初期化(str項目名, eパネル種別); + } + public CSwitchItemList(string str項目名, CItemBase.EPanelType eパネル種別, int n初期インデックス値, params string[] arg項目リスト) + : this() { + this.t初期化(str項目名, eパネル種別, n初期インデックス値, arg項目リスト); + } + public CSwitchItemList(string str項目名, CItemBase.EPanelType eパネル種別, int n初期インデックス値, string str説明文jp, params string[] arg項目リスト) + : this() { + this.t初期化(str項目名, eパネル種別, n初期インデックス値, str説明文jp, arg項目リスト); + } + public CSwitchItemList(string str項目名, CItemBase.EPanelType eパネル種別, int n初期インデックス値, string str説明文jp, string str説明文en, params string[] arg項目リスト) + : this() { + this.t初期化(str項目名, eパネル種別, n初期インデックス値, str説明文jp, str説明文en, arg項目リスト); + } + + public override void tEnter押下() { + // this.t項目値を次へ移動(); // 何もしない + } } diff --git a/OpenTaiko/src/Items/CItemThreeState.cs b/OpenTaiko/src/Items/CItemThreeState.cs index c92b440b..ec14f762 100644 --- a/OpenTaiko/src/Items/CItemThreeState.cs +++ b/OpenTaiko/src/Items/CItemThreeState.cs @@ -1,130 +1,130 @@ -namespace OpenTaiko { - /// - /// 「スリーステート」(ON, OFF, 不定 の3状態)を表すアイテム。 - /// - internal class CItemThreeState : CItemBase { - // Properties +namespace OpenTaiko; - public E状態 e現在の状態; - public enum E状態 { - ON, - OFF, - 不定 - } +/// +/// 「スリーステート」(ON, OFF, 不定 の3状態)を表すアイテム。 +/// +internal class CItemThreeState : CItemBase { + // Properties + + public E状態 e現在の状態; + public enum E状態 { + ON, + OFF, + 不定 + } - // Constructor + // Constructor - public CItemThreeState() { - base.e種別 = CItemBase.E種別.ONorOFFor不定スリーステート; - this.e現在の状態 = E状態.不定; - } - public CItemThreeState(string str項目名, E状態 e初期状態) - : this() { - this.t初期化(str項目名, e初期状態); - } - public CItemThreeState(string str項目名, E状態 e初期状態, string str説明文jp) - : this() { - this.t初期化(str項目名, e初期状態, str説明文jp, str説明文jp); - } - public CItemThreeState(string str項目名, E状態 e初期状態, string str説明文jp, string str説明文en) - : this() { - this.t初期化(str項目名, e初期状態, str説明文jp, str説明文en); - } + public CItemThreeState() { + base.e種別 = CItemBase.E種別.ONorOFFor不定スリーステート; + this.e現在の状態 = E状態.不定; + } + public CItemThreeState(string str項目名, E状態 e初期状態) + : this() { + this.t初期化(str項目名, e初期状態); + } + public CItemThreeState(string str項目名, E状態 e初期状態, string str説明文jp) + : this() { + this.t初期化(str項目名, e初期状態, str説明文jp, str説明文jp); + } + public CItemThreeState(string str項目名, E状態 e初期状態, string str説明文jp, string str説明文en) + : this() { + this.t初期化(str項目名, e初期状態, str説明文jp, str説明文en); + } - public CItemThreeState(string str項目名, E状態 e初期状態, CItemBase.EPanelType eパネル種別) - : this() { - this.t初期化(str項目名, e初期状態, eパネル種別); - } - public CItemThreeState(string str項目名, E状態 e初期状態, CItemBase.EPanelType eパネル種別, string str説明文jp) - : this() { - this.t初期化(str項目名, e初期状態, eパネル種別, str説明文jp, str説明文jp); - } - public CItemThreeState(string str項目名, E状態 e初期状態, CItemBase.EPanelType eパネル種別, string str説明文jp, string str説明文en) - : this() { - this.t初期化(str項目名, e初期状態, eパネル種別, str説明文jp, str説明文en); - } + public CItemThreeState(string str項目名, E状態 e初期状態, CItemBase.EPanelType eパネル種別) + : this() { + this.t初期化(str項目名, e初期状態, eパネル種別); + } + public CItemThreeState(string str項目名, E状態 e初期状態, CItemBase.EPanelType eパネル種別, string str説明文jp) + : this() { + this.t初期化(str項目名, e初期状態, eパネル種別, str説明文jp, str説明文jp); + } + public CItemThreeState(string str項目名, E状態 e初期状態, CItemBase.EPanelType eパネル種別, string str説明文jp, string str説明文en) + : this() { + this.t初期化(str項目名, e初期状態, eパネル種別, str説明文jp, str説明文en); + } - // CItemBase 実装 + // CItemBase 実装 - public override void tEnter押下() { - this.t項目値を次へ移動(); - } - public override void t項目値を次へ移動() { - switch (this.e現在の状態) { - case E状態.ON: - this.e現在の状態 = E状態.OFF; - return; + public override void tEnter押下() { + this.t項目値を次へ移動(); + } + public override void t項目値を次へ移動() { + switch (this.e現在の状態) { + case E状態.ON: + this.e現在の状態 = E状態.OFF; + return; - case E状態.OFF: - this.e現在の状態 = E状態.ON; - return; + case E状態.OFF: + this.e現在の状態 = E状態.ON; + return; - case E状態.不定: - this.e現在の状態 = E状態.ON; - return; - } + case E状態.不定: + this.e現在の状態 = E状態.ON; + return; } - public override void t項目値を前へ移動() { - switch (this.e現在の状態) { - case E状態.ON: - this.e現在の状態 = E状態.OFF; - return; + } + public override void t項目値を前へ移動() { + switch (this.e現在の状態) { + case E状態.ON: + this.e現在の状態 = E状態.OFF; + return; - case E状態.OFF: - this.e現在の状態 = E状態.ON; - return; + case E状態.OFF: + this.e現在の状態 = E状態.ON; + return; - case E状態.不定: - this.e現在の状態 = E状態.OFF; - return; - } - } - public void t初期化(string str項目名, E状態 e初期状態) { - this.t初期化(str項目名, e初期状態, CItemBase.EPanelType.Normal); - } - public void t初期化(string str項目名, E状態 e初期状態, string str説明文jp) { - this.t初期化(str項目名, e初期状態, CItemBase.EPanelType.Normal, str説明文jp, str説明文jp); - } - public void t初期化(string str項目名, E状態 e初期状態, string str説明文jp, string str説明文en) { - this.t初期化(str項目名, e初期状態, CItemBase.EPanelType.Normal, str説明文jp, str説明文en); + case E状態.不定: + this.e現在の状態 = E状態.OFF; + return; } + } + public void t初期化(string str項目名, E状態 e初期状態) { + this.t初期化(str項目名, e初期状態, CItemBase.EPanelType.Normal); + } + public void t初期化(string str項目名, E状態 e初期状態, string str説明文jp) { + this.t初期化(str項目名, e初期状態, CItemBase.EPanelType.Normal, str説明文jp, str説明文jp); + } + public void t初期化(string str項目名, E状態 e初期状態, string str説明文jp, string str説明文en) { + this.t初期化(str項目名, e初期状態, CItemBase.EPanelType.Normal, str説明文jp, str説明文en); + } - public void t初期化(string str項目名, E状態 e初期状態, CItemBase.EPanelType eパネル種別) { - this.t初期化(str項目名, e初期状態, CItemBase.EPanelType.Normal, "", ""); + public void t初期化(string str項目名, E状態 e初期状態, CItemBase.EPanelType eパネル種別) { + this.t初期化(str項目名, e初期状態, CItemBase.EPanelType.Normal, "", ""); + } + public void t初期化(string str項目名, E状態 e初期状態, CItemBase.EPanelType eパネル種別, string str説明文jp) { + this.t初期化(str項目名, e初期状態, CItemBase.EPanelType.Normal, str説明文jp, str説明文jp); + } + public void t初期化(string str項目名, E状態 e初期状態, CItemBase.EPanelType eパネル種別, string str説明文jp, string str説明文en) { + base.t初期化(str項目名, eパネル種別, str説明文jp, str説明文en); + this.e現在の状態 = e初期状態; + } + public override object obj現在値() { + if (this.e現在の状態 == E状態.不定) { + return "- -"; + } else { + return this.e現在の状態.ToString(); } - public void t初期化(string str項目名, E状態 e初期状態, CItemBase.EPanelType eパネル種別, string str説明文jp) { - this.t初期化(str項目名, e初期状態, CItemBase.EPanelType.Normal, str説明文jp, str説明文jp); - } - public void t初期化(string str項目名, E状態 e初期状態, CItemBase.EPanelType eパネル種別, string str説明文jp, string str説明文en) { - base.t初期化(str項目名, eパネル種別, str説明文jp, str説明文en); - this.e現在の状態 = e初期状態; - } - public override object obj現在値() { - if (this.e現在の状態 == E状態.不定) { - return "- -"; - } else { - return this.e現在の状態.ToString(); - } - } - public override int GetIndex() { - return (int)this.e現在の状態; - } - public override void SetIndex(int index) { - switch (index) { - case 0: - this.e現在の状態 = E状態.ON; - break; - case 1: - this.e現在の状態 = E状態.OFF; - break; - case 2: - this.e現在の状態 = E状態.不定; - break; - default: - throw new ArgumentOutOfRangeException(); - } + } + public override int GetIndex() { + return (int)this.e現在の状態; + } + public override void SetIndex(int index) { + switch (index) { + case 0: + this.e現在の状態 = E状態.ON; + break; + case 1: + this.e現在の状態 = E状態.OFF; + break; + case 2: + this.e現在の状態 = E状態.不定; + break; + default: + throw new ArgumentOutOfRangeException(); } } } diff --git a/OpenTaiko/src/Items/CItemToggle.cs b/OpenTaiko/src/Items/CItemToggle.cs index 94bb650a..1a46fc7b 100644 --- a/OpenTaiko/src/Items/CItemToggle.cs +++ b/OpenTaiko/src/Items/CItemToggle.cs @@ -1,92 +1,92 @@ -namespace OpenTaiko { - /// - /// 「トグル」(ON, OFF の2状態)を表すアイテム。 - /// - internal class CItemToggle : CItemBase { - // Properties +namespace OpenTaiko; - public bool bON; +/// +/// 「トグル」(ON, OFF の2状態)を表すアイテム。 +/// +internal class CItemToggle : CItemBase { + // Properties - // Constructor + public bool bON; - public CItemToggle() { - base.e種別 = CItemBase.E種別.ONorOFFトグル; - this.bON = false; - } - public CItemToggle(string str項目名, bool b初期状態) - : this() { - this.t初期化(str項目名, b初期状態); - } - public CItemToggle(string str項目名, bool b初期状態, string str説明文jp) - : this() { - this.t初期化(str項目名, b初期状態, str説明文jp); - } - public CItemToggle(string str項目名, bool b初期状態, string str説明文jp, string str説明文en) - : this() { - this.t初期化(str項目名, b初期状態, str説明文jp, str説明文en); - } - public CItemToggle(string str項目名, bool b初期状態, CItemBase.EPanelType eパネル種別) - : this() { - this.t初期化(str項目名, b初期状態, eパネル種別); - } - public CItemToggle(string str項目名, bool b初期状態, CItemBase.EPanelType eパネル種別, string str説明文jp) - : this() { - this.t初期化(str項目名, b初期状態, eパネル種別, str説明文jp); - } - public CItemToggle(string str項目名, bool b初期状態, CItemBase.EPanelType eパネル種別, string str説明文jp, string str説明文en) - : this() { - this.t初期化(str項目名, b初期状態, eパネル種別, str説明文jp, str説明文en); - } + // Constructor + + public CItemToggle() { + base.e種別 = CItemBase.E種別.ONorOFFトグル; + this.bON = false; + } + public CItemToggle(string str項目名, bool b初期状態) + : this() { + this.t初期化(str項目名, b初期状態); + } + public CItemToggle(string str項目名, bool b初期状態, string str説明文jp) + : this() { + this.t初期化(str項目名, b初期状態, str説明文jp); + } + public CItemToggle(string str項目名, bool b初期状態, string str説明文jp, string str説明文en) + : this() { + this.t初期化(str項目名, b初期状態, str説明文jp, str説明文en); + } + public CItemToggle(string str項目名, bool b初期状態, CItemBase.EPanelType eパネル種別) + : this() { + this.t初期化(str項目名, b初期状態, eパネル種別); + } + public CItemToggle(string str項目名, bool b初期状態, CItemBase.EPanelType eパネル種別, string str説明文jp) + : this() { + this.t初期化(str項目名, b初期状態, eパネル種別, str説明文jp); + } + public CItemToggle(string str項目名, bool b初期状態, CItemBase.EPanelType eパネル種別, string str説明文jp, string str説明文en) + : this() { + this.t初期化(str項目名, b初期状態, eパネル種別, str説明文jp, str説明文en); + } - // CItemBase 実装 + // CItemBase 実装 - public override void tEnter押下() { - this.t項目値を次へ移動(); - } - public override void t項目値を次へ移動() { - this.bON = !this.bON; - } - public override void t項目値を前へ移動() { - this.t項目値を次へ移動(); - } - public void t初期化(string str項目名, bool b初期状態) { - this.t初期化(str項目名, b初期状態, CItemBase.EPanelType.Normal); - } - public void t初期化(string str項目名, bool b初期状態, string str説明文jp) { - this.t初期化(str項目名, b初期状態, CItemBase.EPanelType.Normal, str説明文jp, str説明文jp); - } - public void t初期化(string str項目名, bool b初期状態, string str説明文jp, string str説明文en) { - this.t初期化(str項目名, b初期状態, CItemBase.EPanelType.Normal, str説明文jp, str説明文en); - } + public override void tEnter押下() { + this.t項目値を次へ移動(); + } + public override void t項目値を次へ移動() { + this.bON = !this.bON; + } + public override void t項目値を前へ移動() { + this.t項目値を次へ移動(); + } + public void t初期化(string str項目名, bool b初期状態) { + this.t初期化(str項目名, b初期状態, CItemBase.EPanelType.Normal); + } + public void t初期化(string str項目名, bool b初期状態, string str説明文jp) { + this.t初期化(str項目名, b初期状態, CItemBase.EPanelType.Normal, str説明文jp, str説明文jp); + } + public void t初期化(string str項目名, bool b初期状態, string str説明文jp, string str説明文en) { + this.t初期化(str項目名, b初期状態, CItemBase.EPanelType.Normal, str説明文jp, str説明文en); + } - public void t初期化(string str項目名, bool b初期状態, CItemBase.EPanelType eパネル種別) { - this.t初期化(str項目名, b初期状態, eパネル種別, "", ""); - } - public void t初期化(string str項目名, bool b初期状態, CItemBase.EPanelType eパネル種別, string str説明文jp) { - this.t初期化(str項目名, b初期状態, eパネル種別, str説明文jp, str説明文jp); - } - public void t初期化(string str項目名, bool b初期状態, CItemBase.EPanelType eパネル種別, string str説明文jp, string str説明文en) { - base.t初期化(str項目名, eパネル種別, str説明文jp, str説明文en); - this.bON = b初期状態; - } - public override object obj現在値() { - return (this.bON) ? "ON" : "OFF"; - } - public override int GetIndex() { - return (this.bON) ? 1 : 0; - } - public override void SetIndex(int index) { - switch (index) { - case 0: - this.bON = false; - break; - case 1: - this.bON = true; - break; - default: - throw new ArgumentOutOfRangeException(); - } + public void t初期化(string str項目名, bool b初期状態, CItemBase.EPanelType eパネル種別) { + this.t初期化(str項目名, b初期状態, eパネル種別, "", ""); + } + public void t初期化(string str項目名, bool b初期状態, CItemBase.EPanelType eパネル種別, string str説明文jp) { + this.t初期化(str項目名, b初期状態, eパネル種別, str説明文jp, str説明文jp); + } + public void t初期化(string str項目名, bool b初期状態, CItemBase.EPanelType eパネル種別, string str説明文jp, string str説明文en) { + base.t初期化(str項目名, eパネル種別, str説明文jp, str説明文en); + this.bON = b初期状態; + } + public override object obj現在値() { + return (this.bON) ? "ON" : "OFF"; + } + public override int GetIndex() { + return (this.bON) ? 1 : 0; + } + public override void SetIndex(int index) { + switch (index) { + case 0: + this.bON = false; + break; + case 1: + this.bON = true; + break; + default: + throw new ArgumentOutOfRangeException(); } } } diff --git a/OpenTaiko/src/Lua/CLuaScript.cs b/OpenTaiko/src/Lua/CLuaScript.cs index e9506709..9f394552 100644 --- a/OpenTaiko/src/Lua/CLuaScript.cs +++ b/OpenTaiko/src/Lua/CLuaScript.cs @@ -5,232 +5,232 @@ using System.Text.Json.Nodes; using FDK; using NLua; -namespace OpenTaiko { - class CLuaScript : IDisposable { - public static List listScripts { get; private set; } = new List(); - public static void tReloadLanguage(string lang) { - foreach (var item in listScripts) { - item.ReloadLanguage(lang); - } - } +namespace OpenTaiko; - - - public string strDir { get; private set; } - public string strTexturesDir { get; private set; } - public string strSounsdDir { get; private set; } - - public bool bLoadedAssets { get; private set; } - public bool bDisposed { get; private set; } - public bool bCrashed { get; protected set; } - - protected Lua LuaScript { get; private set; } - - private LuaFunction lfLoadAssets; - private LuaFunction lfReloadLanguage; - - private CLuaInfo luaInfo; - private CLuaFps luaFPS = new CLuaFps(); - - public List listDisposables { get; private set; } = new List(); - - protected bool Available { - get { - return bLoadedAssets && !bDisposed && !bCrashed; - } - } - - private double getNum(JsonValue x) { - return (double)x; - } - - private string getText(JsonValue x) { - return (string)x; - } - - private List getNumArray(JsonArray x) { - List array = new List(); - - foreach (double value in x) { - array.Add(value); - } - return array; - } - - private List getTextArray(JsonArray x) { - List array = new List(); - - foreach (string value in x) { - array.Add(value); - } - return array; - } - - protected object[] RunLuaCode(LuaFunction luaFunction, params object[] args) { - try { - if (luaFunction == null) return null; - var ret = luaFunction.Call(args); - LuaScript.State.GarbageCollector(KeraLua.LuaGC.Collect, 0); - return ret; - } catch (Exception exception) { - Crash(exception); - } - return new object[0]; - } - - private JsonNode LoadConfig(string name) { - using Stream stream = File.OpenRead($"{strDir}/{name}"); - JsonNode jsonNode = JsonNode.Parse(stream); - return jsonNode; - } - - private CTexture LoadTexture(string name) { - CTexture texture = new CTexture($"{strTexturesDir}/{name}", false); - - listDisposables.Add(texture); - return texture; - } - - private void DebugLog(string message) { - Trace.TraceInformation(": " + message); - } - - private CSound LoadSound(string name, string soundGroupName) { - ESoundGroup soundGroup; - switch (soundGroupName) { - case "soundeffect": - soundGroup = ESoundGroup.SoundEffect; - break; - case "voice": - soundGroup = ESoundGroup.Voice; - break; - case "songpreview": - soundGroup = ESoundGroup.SongPreview; - break; - case "songplayback": - soundGroup = ESoundGroup.SongPlayback; - break; - default: - soundGroup = ESoundGroup.Unknown; - break; - } - CSound sound = OpenTaiko.SoundManager?.tCreateSound($"{strSounsdDir}/{name}", soundGroup); - - listDisposables.Add(sound); - return sound; - } - - private CCachedFontRenderer LoadFontRenderer(int size, string fontStyleName) { - CFontRenderer.FontStyle fontStyle; - switch (fontStyleName) { - case "regular": - fontStyle = CFontRenderer.FontStyle.Regular; - break; - case "bold": - fontStyle = CFontRenderer.FontStyle.Bold; - break; - case "italic": - fontStyle = CFontRenderer.FontStyle.Italic; - break; - case "underline": - fontStyle = CFontRenderer.FontStyle.Underline; - break; - case "strikeout": - fontStyle = CFontRenderer.FontStyle.Strikeout; - break; - default: - fontStyle = CFontRenderer.FontStyle.Regular; - break; - } - CCachedFontRenderer fontRenderer = HPrivateFastFont.tInstantiateMainFont(size, fontStyle); - - listDisposables.Add(fontRenderer); - return fontRenderer; - } - - private string GetLocalizedString(string key, params object?[] args) { - return CLangManager.LangInstance.GetString(key, args); - } - - private TitleTextureKey CreateTitleTextureKey(string title, CCachedFontRenderer fontRenderer, int maxSize, Color? color = null, Color? edgeColor = null) { - return new TitleTextureKey(title, fontRenderer, color ?? Color.White, edgeColor ?? Color.Black, maxSize); - } - - private CTexture GetTextTex(TitleTextureKey titleTextureKey, bool vertical, bool keepCenter) { - return TitleTextureKey.ResolveTitleTexture(titleTextureKey, vertical, keepCenter); - } - - public CLuaScript(string dir, string? texturesDir = null, string? soundsDir = null, bool loadAssets = true) { - strDir = dir; - strTexturesDir = texturesDir ?? $"{dir}/Textures"; - strSounsdDir = soundsDir ?? $"{dir}/Sounds"; - - - LuaScript = new Lua(); - LuaScript.LoadCLRPackage(); - LuaScript.State.Encoding = Encoding.UTF8; - LuaScript.DoFile($"{strDir}/Script.lua"); - - LuaScript["info"] = luaInfo = new CLuaInfo(strDir); - LuaScript["fps"] = luaFPS; - - - lfLoadAssets = (LuaFunction)LuaScript["loadAssets"]; - lfReloadLanguage = (LuaFunction)LuaScript["reloadLanguage"]; - - LuaScript["loadConfig"] = LoadConfig; - LuaScript["loadTexture"] = LoadTexture; - LuaScript["loadSound"] = LoadSound; - LuaScript["loadFontRenderer"] = LoadFontRenderer; - LuaScript["createTitleTextureKey"] = CreateTitleTextureKey; - LuaScript["getTextTex"] = GetTextTex; - LuaScript["getNum"] = getNum; - LuaScript["getText"] = getText; - LuaScript["getNumArray"] = getNumArray; - LuaScript["getTextArray"] = getTextArray; - LuaScript["getLocalizedString"] = GetLocalizedString; - LuaScript["displayDanPlate"] = CActSelect段位リスト.tDisplayDanPlate; - LuaScript["debugLog"] = DebugLog; - - - if (loadAssets) LoadAssets(); - - listScripts.Add(this); - } - - public void LoadAssets(params object[] args) { - if (bLoadedAssets) return; - - RunLuaCode(lfLoadAssets, args); - - bLoadedAssets = true; - bDisposed = false; - } - - public void ReloadLanguage(params object[] args) { - RunLuaCode(lfReloadLanguage, args); - } - - public void Dispose() { - if (bDisposed) return; - - foreach (IDisposable disposable in listDisposables) { - disposable.Dispose(); - } - listDisposables.Clear(); - - LuaScript.Dispose(); - - bDisposed = true; - bLoadedAssets = false; - - listScripts.Remove(this); - } - - private void Crash(Exception exception) { - bCrashed = true; - - LogNotification.PopError($"Lua Script Error: {exception.ToString()}"); +class CLuaScript : IDisposable { + public static List listScripts { get; private set; } = new List(); + public static void tReloadLanguage(string lang) { + foreach (var item in listScripts) { + item.ReloadLanguage(lang); } } + + + + public string strDir { get; private set; } + public string strTexturesDir { get; private set; } + public string strSounsdDir { get; private set; } + + public bool bLoadedAssets { get; private set; } + public bool bDisposed { get; private set; } + public bool bCrashed { get; protected set; } + + protected Lua LuaScript { get; private set; } + + private LuaFunction lfLoadAssets; + private LuaFunction lfReloadLanguage; + + private CLuaInfo luaInfo; + private CLuaFps luaFPS = new CLuaFps(); + + public List listDisposables { get; private set; } = new List(); + + protected bool Available { + get { + return bLoadedAssets && !bDisposed && !bCrashed; + } + } + + private double getNum(JsonValue x) { + return (double)x; + } + + private string getText(JsonValue x) { + return (string)x; + } + + private List getNumArray(JsonArray x) { + List array = new List(); + + foreach (double value in x) { + array.Add(value); + } + return array; + } + + private List getTextArray(JsonArray x) { + List array = new List(); + + foreach (string value in x) { + array.Add(value); + } + return array; + } + + protected object[] RunLuaCode(LuaFunction luaFunction, params object[] args) { + try { + if (luaFunction == null) return null; + var ret = luaFunction.Call(args); + LuaScript.State.GarbageCollector(KeraLua.LuaGC.Collect, 0); + return ret; + } catch (Exception exception) { + Crash(exception); + } + return new object[0]; + } + + private JsonNode LoadConfig(string name) { + using Stream stream = File.OpenRead($"{strDir}/{name}"); + JsonNode jsonNode = JsonNode.Parse(stream); + return jsonNode; + } + + private CTexture LoadTexture(string name) { + CTexture texture = new CTexture($"{strTexturesDir}/{name}", false); + + listDisposables.Add(texture); + return texture; + } + + private void DebugLog(string message) { + Trace.TraceInformation(": " + message); + } + + private CSound LoadSound(string name, string soundGroupName) { + ESoundGroup soundGroup; + switch (soundGroupName) { + case "soundeffect": + soundGroup = ESoundGroup.SoundEffect; + break; + case "voice": + soundGroup = ESoundGroup.Voice; + break; + case "songpreview": + soundGroup = ESoundGroup.SongPreview; + break; + case "songplayback": + soundGroup = ESoundGroup.SongPlayback; + break; + default: + soundGroup = ESoundGroup.Unknown; + break; + } + CSound sound = OpenTaiko.SoundManager?.tCreateSound($"{strSounsdDir}/{name}", soundGroup); + + listDisposables.Add(sound); + return sound; + } + + private CCachedFontRenderer LoadFontRenderer(int size, string fontStyleName) { + CFontRenderer.FontStyle fontStyle; + switch (fontStyleName) { + case "regular": + fontStyle = CFontRenderer.FontStyle.Regular; + break; + case "bold": + fontStyle = CFontRenderer.FontStyle.Bold; + break; + case "italic": + fontStyle = CFontRenderer.FontStyle.Italic; + break; + case "underline": + fontStyle = CFontRenderer.FontStyle.Underline; + break; + case "strikeout": + fontStyle = CFontRenderer.FontStyle.Strikeout; + break; + default: + fontStyle = CFontRenderer.FontStyle.Regular; + break; + } + CCachedFontRenderer fontRenderer = HPrivateFastFont.tInstantiateMainFont(size, fontStyle); + + listDisposables.Add(fontRenderer); + return fontRenderer; + } + + private string GetLocalizedString(string key, params object?[] args) { + return CLangManager.LangInstance.GetString(key, args); + } + + private TitleTextureKey CreateTitleTextureKey(string title, CCachedFontRenderer fontRenderer, int maxSize, Color? color = null, Color? edgeColor = null) { + return new TitleTextureKey(title, fontRenderer, color ?? Color.White, edgeColor ?? Color.Black, maxSize); + } + + private CTexture GetTextTex(TitleTextureKey titleTextureKey, bool vertical, bool keepCenter) { + return TitleTextureKey.ResolveTitleTexture(titleTextureKey, vertical, keepCenter); + } + + public CLuaScript(string dir, string? texturesDir = null, string? soundsDir = null, bool loadAssets = true) { + strDir = dir; + strTexturesDir = texturesDir ?? $"{dir}/Textures"; + strSounsdDir = soundsDir ?? $"{dir}/Sounds"; + + + LuaScript = new Lua(); + LuaScript.LoadCLRPackage(); + LuaScript.State.Encoding = Encoding.UTF8; + LuaScript.DoFile($"{strDir}/Script.lua"); + + LuaScript["info"] = luaInfo = new CLuaInfo(strDir); + LuaScript["fps"] = luaFPS; + + + lfLoadAssets = (LuaFunction)LuaScript["loadAssets"]; + lfReloadLanguage = (LuaFunction)LuaScript["reloadLanguage"]; + + LuaScript["loadConfig"] = LoadConfig; + LuaScript["loadTexture"] = LoadTexture; + LuaScript["loadSound"] = LoadSound; + LuaScript["loadFontRenderer"] = LoadFontRenderer; + LuaScript["createTitleTextureKey"] = CreateTitleTextureKey; + LuaScript["getTextTex"] = GetTextTex; + LuaScript["getNum"] = getNum; + LuaScript["getText"] = getText; + LuaScript["getNumArray"] = getNumArray; + LuaScript["getTextArray"] = getTextArray; + LuaScript["getLocalizedString"] = GetLocalizedString; + LuaScript["displayDanPlate"] = CActSelect段位リスト.tDisplayDanPlate; + LuaScript["debugLog"] = DebugLog; + + + if (loadAssets) LoadAssets(); + + listScripts.Add(this); + } + + public void LoadAssets(params object[] args) { + if (bLoadedAssets) return; + + RunLuaCode(lfLoadAssets, args); + + bLoadedAssets = true; + bDisposed = false; + } + + public void ReloadLanguage(params object[] args) { + RunLuaCode(lfReloadLanguage, args); + } + + public void Dispose() { + if (bDisposed) return; + + foreach (IDisposable disposable in listDisposables) { + disposable.Dispose(); + } + listDisposables.Clear(); + + LuaScript.Dispose(); + + bDisposed = true; + bLoadedAssets = false; + + listScripts.Remove(this); + } + + private void Crash(Exception exception) { + bCrashed = true; + + LogNotification.PopError($"Lua Script Error: {exception.ToString()}"); + } } diff --git a/OpenTaiko/src/Lua/Infos/CLuaFps.cs b/OpenTaiko/src/Lua/Infos/CLuaFps.cs index 8b7b5fa0..98738294 100644 --- a/OpenTaiko/src/Lua/Infos/CLuaFps.cs +++ b/OpenTaiko/src/Lua/Infos/CLuaFps.cs @@ -1,6 +1,6 @@ -namespace OpenTaiko { - internal class CLuaFps { - public double deltaTime => OpenTaiko.FPS.DeltaTime; - public int fps => OpenTaiko.FPS.NowFPS; - } +namespace OpenTaiko; + +internal class CLuaFps { + public double deltaTime => OpenTaiko.FPS.DeltaTime; + public int fps => OpenTaiko.FPS.NowFPS; } diff --git a/OpenTaiko/src/Lua/Infos/CLuaInfo.cs b/OpenTaiko/src/Lua/Infos/CLuaInfo.cs index 45b0add3..59fe9034 100644 --- a/OpenTaiko/src/Lua/Infos/CLuaInfo.cs +++ b/OpenTaiko/src/Lua/Infos/CLuaInfo.cs @@ -1,15 +1,15 @@ -namespace OpenTaiko { - internal class CLuaInfo { - public int playerCount => OpenTaiko.ConfigIni.nPlayerCount; - public string lang => OpenTaiko.ConfigIni.sLang; - public bool simplemode => OpenTaiko.ConfigIni.SimpleMode; - public bool p1IsBlue => OpenTaiko.P1IsBlue(); - public bool online => OpenTaiko.app.bネットワークに接続中; +namespace OpenTaiko; - public string dir { get; init; } +internal class CLuaInfo { + public int playerCount => OpenTaiko.ConfigIni.nPlayerCount; + public string lang => OpenTaiko.ConfigIni.sLang; + public bool simplemode => OpenTaiko.ConfigIni.SimpleMode; + public bool p1IsBlue => OpenTaiko.P1IsBlue(); + public bool online => OpenTaiko.app.bネットワークに接続中; - public CLuaInfo(string dir) { - this.dir = dir; - } + public string dir { get; init; } + + public CLuaInfo(string dir) { + this.dir = dir; } } diff --git a/OpenTaiko/src/Lua/Scripts/CLuaModalScript.cs b/OpenTaiko/src/Lua/Scripts/CLuaModalScript.cs index 91298445..2bd06fd4 100644 --- a/OpenTaiko/src/Lua/Scripts/CLuaModalScript.cs +++ b/OpenTaiko/src/Lua/Scripts/CLuaModalScript.cs @@ -1,47 +1,47 @@ using NLua; -namespace OpenTaiko { - internal class CLuaModalScript : CLuaScript { - private LuaFunction lfRegisterModal; - private LuaFunction lfAnimationFinished; - private LuaFunction lfUpdate; - private LuaFunction lfDraw; +namespace OpenTaiko; - public CLuaModalScript(string dir, string? texturesDir = null, string? soundsDir = null, bool loadAssets = true) : base(dir, texturesDir, soundsDir, loadAssets) { +internal class CLuaModalScript : CLuaScript { + private LuaFunction lfRegisterModal; + private LuaFunction lfAnimationFinished; + private LuaFunction lfUpdate; + private LuaFunction lfDraw; - lfRegisterModal = (LuaFunction)LuaScript["registerNewModal"]; - lfAnimationFinished = (LuaFunction)LuaScript["isAnimationFinished"]; - lfUpdate = (LuaFunction)LuaScript["update"]; - lfDraw = (LuaFunction)LuaScript["draw"]; - } + public CLuaModalScript(string dir, string? texturesDir = null, string? soundsDir = null, bool loadAssets = true) : base(dir, texturesDir, soundsDir, loadAssets) { - // Function to retrieve if the currently playing modal animation (etc) finished playing, allowing to send the next modal - public bool AnimationFinished() { - if (!Available) return false; - bool result = (bool)RunLuaCode(lfAnimationFinished)[0]; - return result; - } + lfRegisterModal = (LuaFunction)LuaScript["registerNewModal"]; + lfAnimationFinished = (LuaFunction)LuaScript["isAnimationFinished"]; + lfUpdate = (LuaFunction)LuaScript["update"]; + lfDraw = (LuaFunction)LuaScript["draw"]; + } - // Informations of the newly added modal are initialized here - public void RegisterNewModal(int player, int rarity, Modal.EModalType modalType, params object?[] args) { - if (!Available) return; + // Function to retrieve if the currently playing modal animation (etc) finished playing, allowing to send the next modal + public bool AnimationFinished() { + if (!Available) return false; + bool result = (bool)RunLuaCode(lfAnimationFinished)[0]; + return result; + } - object[] newParams = new object[] { player, rarity, (int)modalType }; - if (args != null) newParams = newParams.Concat((object[])args).ToArray(); - RunLuaCode(lfRegisterModal, newParams); - } + // Informations of the newly added modal are initialized here + public void RegisterNewModal(int player, int rarity, Modal.EModalType modalType, params object?[] args) { + if (!Available) return; - // Handle inputs here (if necessary, like to add a shortcut to accelerate the animation etc - public void Update(params object[] args) { - if (!Available) return; + object[] newParams = new object[] { player, rarity, (int)modalType }; + if (args != null) newParams = newParams.Concat((object[])args).ToArray(); + RunLuaCode(lfRegisterModal, newParams); + } - RunLuaCode(lfUpdate, args); - } + // Handle inputs here (if necessary, like to add a shortcut to accelerate the animation etc + public void Update(params object[] args) { + if (!Available) return; - public void Draw(params object[] args) { - if (!Available) return; + RunLuaCode(lfUpdate, args); + } - RunLuaCode(lfDraw, args); - } + public void Draw(params object[] args) { + if (!Available) return; + + RunLuaCode(lfDraw, args); } } diff --git a/OpenTaiko/src/Lua/Scripts/CLuaNamePlateScript.cs b/OpenTaiko/src/Lua/Scripts/CLuaNamePlateScript.cs index f8903d26..6fc48fe1 100644 --- a/OpenTaiko/src/Lua/Scripts/CLuaNamePlateScript.cs +++ b/OpenTaiko/src/Lua/Scripts/CLuaNamePlateScript.cs @@ -1,60 +1,60 @@ using FDK; using NLua; -namespace OpenTaiko { - internal class CLuaNamePlateScript : CLuaScript { - private LuaFunction lfGetCharaOffset; - private LuaFunction lfSetInfos; - private LuaFunction lfDrawDan; - private LuaFunction lfDrawTitlePlate; - private LuaFunction lfUpdate; - private LuaFunction lfDraw; +namespace OpenTaiko; - public CLuaNamePlateScript(string dir, string? texturesDir = null, string? soundsDir = null, bool loadAssets = true) : base(dir, texturesDir, soundsDir, loadAssets) { - lfGetCharaOffset = (LuaFunction)LuaScript["getCharaOffset"]; - lfSetInfos = (LuaFunction)LuaScript["setInfos"]; - lfDrawDan = (LuaFunction)LuaScript["drawDan"]; - lfDrawTitlePlate = (LuaFunction)LuaScript["drawTitlePlate"]; - lfUpdate = (LuaFunction)LuaScript["update"]; - lfDraw = (LuaFunction)LuaScript["draw"]; - } +internal class CLuaNamePlateScript : CLuaScript { + private LuaFunction lfGetCharaOffset; + private LuaFunction lfSetInfos; + private LuaFunction lfDrawDan; + private LuaFunction lfDrawTitlePlate; + private LuaFunction lfUpdate; + private LuaFunction lfDraw; - public int GetCharaOffset() { - if (!Available) return 0; - double result = (double)RunLuaCode(lfGetCharaOffset)[0]; - return (int)result; - } + public CLuaNamePlateScript(string dir, string? texturesDir = null, string? soundsDir = null, bool loadAssets = true) : base(dir, texturesDir, soundsDir, loadAssets) { + lfGetCharaOffset = (LuaFunction)LuaScript["getCharaOffset"]; + lfSetInfos = (LuaFunction)LuaScript["setInfos"]; + lfDrawDan = (LuaFunction)LuaScript["drawDan"]; + lfDrawTitlePlate = (LuaFunction)LuaScript["drawTitlePlate"]; + lfUpdate = (LuaFunction)LuaScript["update"]; + lfDraw = (LuaFunction)LuaScript["draw"]; + } - public void SetInfos(int player, string name, string title, string dan, SaveFile.Data data) { - if (!Available) return; + public int GetCharaOffset() { + if (!Available) return 0; + double result = (double)RunLuaCode(lfGetCharaOffset)[0]; + return (int)result; + } - RunLuaCode(lfSetInfos, player, name ?? "", title ?? "", dan ?? "", data); - } + public void SetInfos(int player, string name, string title, string dan, SaveFile.Data data) { + if (!Available) return; - // For My Room - public void DrawDan(int x, int y, int opacity, int danGrade, CTexture titleTex) { - if (!Available) return; + RunLuaCode(lfSetInfos, player, name ?? "", title ?? "", dan ?? "", data); + } - RunLuaCode(lfDrawDan, x, y, opacity, danGrade, titleTex); - } + // For My Room + public void DrawDan(int x, int y, int opacity, int danGrade, CTexture titleTex) { + if (!Available) return; - // For My Room - public void DrawTitlePlate(int x, int y, int opacity, int type, CTexture titleTex, int rarity, int nameplateId) { - if (!Available) return; + RunLuaCode(lfDrawDan, x, y, opacity, danGrade, titleTex); + } - RunLuaCode(lfDrawTitlePlate, x, y, opacity, type, titleTex, rarity, nameplateId); - } + // For My Room + public void DrawTitlePlate(int x, int y, int opacity, int type, CTexture titleTex, int rarity, int nameplateId) { + if (!Available) return; - public void Update(params object[] args) { - if (!Available) return; + RunLuaCode(lfDrawTitlePlate, x, y, opacity, type, titleTex, rarity, nameplateId); + } - RunLuaCode(lfUpdate, args); - } + public void Update(params object[] args) { + if (!Available) return; - public void Draw(int x, int y, int opacity, int player, int side) { - if (!Available) return; + RunLuaCode(lfUpdate, args); + } - RunLuaCode(lfDraw, x, y, opacity, player, side); - } + public void Draw(int x, int y, int opacity, int player, int side) { + if (!Available) return; + + RunLuaCode(lfDraw, x, y, opacity, player, side); } } diff --git a/OpenTaiko/src/Songs/CBoxDef.cs b/OpenTaiko/src/Songs/CBoxDef.cs index 7f6dd9fd..424cd443 100644 --- a/OpenTaiko/src/Songs/CBoxDef.cs +++ b/OpenTaiko/src/Songs/CBoxDef.cs @@ -2,131 +2,131 @@ using System.Drawing; using System.Text; -namespace OpenTaiko { - internal class CBoxDef { - // Properties +namespace OpenTaiko; - public Color Color; - public string SelectBG; - public string Genre; - public CLocalizationData Title = new CLocalizationData(); - public CLocalizationData[] strBoxText = new CLocalizationData[3] { new CLocalizationData(), new CLocalizationData(), new CLocalizationData() }; - public Color ForeColor; - public Color BackColor; - public bool IsChangedForeColor; - public bool IsChangedBackColor; - public Color BoxColor; - public bool IsChangedBoxColor; - public Color BgColor; - public bool IsChangedBgColor; - public string BoxType; - public string BgType; - public bool IsChangedBoxType; - public bool IsChangedBgType; - public string BoxChara; - public bool IsChangedBoxChara; - public string DefaultPreimage; - public string ScenePreset; +internal class CBoxDef { + // Properties - // Constructor + public Color Color; + public string SelectBG; + public string Genre; + public CLocalizationData Title = new CLocalizationData(); + public CLocalizationData[] strBoxText = new CLocalizationData[3] { new CLocalizationData(), new CLocalizationData(), new CLocalizationData() }; + public Color ForeColor; + public Color BackColor; + public bool IsChangedForeColor; + public bool IsChangedBackColor; + public Color BoxColor; + public bool IsChangedBoxColor; + public Color BgColor; + public bool IsChangedBgColor; + public string BoxType; + public string BgType; + public bool IsChangedBoxType; + public bool IsChangedBgType; + public string BoxChara; + public bool IsChangedBoxChara; + public string DefaultPreimage; + public string ScenePreset; - public CBoxDef() { - this.Genre = ""; - ForeColor = Color.White; - BackColor = Color.Black; - BoxColor = Color.White; - BoxType = "0"; - BgType = "0"; - BoxChara = "0"; - BgColor = Color.White; - DefaultPreimage = null; - ScenePreset = ""; - } - public CBoxDef(string boxdefファイル名) - : this() { - this.t読み込み(boxdefファイル名); - } + // Constructor - // メソッド + public CBoxDef() { + this.Genre = ""; + ForeColor = Color.White; + BackColor = Color.Black; + BoxColor = Color.White; + BoxType = "0"; + BgType = "0"; + BoxChara = "0"; + BgColor = Color.White; + DefaultPreimage = null; + ScenePreset = ""; + } + public CBoxDef(string boxdefファイル名) + : this() { + this.t読み込み(boxdefファイル名); + } - public void t読み込み(string boxdefファイル名) { - StreamReader reader = new StreamReader(boxdefファイル名, Encoding.GetEncoding(OpenTaiko.sEncType)); - string str = null; - while ((str = reader.ReadLine()) != null) { - if (str.Length != 0) { - try { - char[] ignoreCharsWoColon = new char[] { ' ', '\t' }; + // メソッド - str = str.TrimStart(ignoreCharsWoColon); - if ((str[0] == '#') && (str[0] != ';')) { - if (str.IndexOf(';') != -1) { - str = str.Substring(0, str.IndexOf(';')); - } + public void t読み込み(string boxdefファイル名) { + StreamReader reader = new StreamReader(boxdefファイル名, Encoding.GetEncoding(OpenTaiko.sEncType)); + string str = null; + while ((str = reader.ReadLine()) != null) { + if (str.Length != 0) { + try { + char[] ignoreCharsWoColon = new char[] { ' ', '\t' }; - char[] ignoreChars = new char[] { ':', ' ', '\t' }; + str = str.TrimStart(ignoreCharsWoColon); + if ((str[0] == '#') && (str[0] != ';')) { + if (str.IndexOf(';') != -1) { + str = str.Substring(0, str.IndexOf(';')); + } - var split = str.Split(':'); - if (split.Length == 2) { - string key = split[0]; - string value = split[1]; + char[] ignoreChars = new char[] { ':', ' ', '\t' }; - if (key == "#TITLE") { - this.Title.SetString("default", value.Trim(ignoreChars)); - } else if (key.StartsWith("#TITLE")) { - string _lang = key.Substring(6).ToLowerInvariant(); - this.Title.SetString(_lang, value.Trim(ignoreChars)); - } else if (key == "#GENRE") { - this.Genre = value.Trim(ignoreChars); - } else if (key == "#SELECTBG") { - this.SelectBG = value.Trim(ignoreChars); - } else if (key == "#FONTCOLOR") { - this.Color = ColorTranslator.FromHtml(value.Trim(ignoreChars)); - } else if (key == "#FORECOLOR") { - this.ForeColor = ColorTranslator.FromHtml(value.Trim(ignoreChars)); - IsChangedForeColor = true; - } else if (key == "#BACKCOLOR") { - this.BackColor = ColorTranslator.FromHtml(value.Trim(ignoreChars)); - IsChangedBackColor = true; - } else if (key == "#BOXCOLOR") { - this.BoxColor = ColorTranslator.FromHtml(value.Trim(ignoreChars)); - IsChangedBoxColor = true; - } else if (key == "#BGCOLOR") { - this.BgColor = ColorTranslator.FromHtml(value.Trim(ignoreChars)); - IsChangedBgColor = true; - } else if (key == "#BGTYPE") { - this.BgType = value.Trim(ignoreChars); - IsChangedBgType = true; - } else if (key == "#BOXTYPE") { - this.BoxType = value.Trim(ignoreChars); - IsChangedBoxType = true; - } else if (key == "#BOXCHARA") { - this.BoxChara = value.Trim(ignoreChars); - IsChangedBoxChara = true; - } else if (key == "#SCENEPRESET") { - this.ScenePreset = value.Trim(ignoreChars); - } else if (key == "#DEFAULTPREIMAGE") { - this.DefaultPreimage = Path.Combine(Directory.GetParent(boxdefファイル名).FullName, value.Trim(ignoreChars)); - } else { - for (int i = 0; i < 3; i++) { - if (key == "#BOXEXPLANATION" + (i + 1).ToString()) { - this.strBoxText[i].SetString("default", value.Trim(ignoreChars)); - } else if (key.StartsWith("#BOXEXPLANATION") && key.EndsWith((i + 1).ToString())) { - string _lang = key.Substring(15)[..^1].ToLowerInvariant(); - this.strBoxText[i].SetString(_lang, value.Trim(ignoreChars)); - } + var split = str.Split(':'); + if (split.Length == 2) { + string key = split[0]; + string value = split[1]; + + if (key == "#TITLE") { + this.Title.SetString("default", value.Trim(ignoreChars)); + } else if (key.StartsWith("#TITLE")) { + string _lang = key.Substring(6).ToLowerInvariant(); + this.Title.SetString(_lang, value.Trim(ignoreChars)); + } else if (key == "#GENRE") { + this.Genre = value.Trim(ignoreChars); + } else if (key == "#SELECTBG") { + this.SelectBG = value.Trim(ignoreChars); + } else if (key == "#FONTCOLOR") { + this.Color = ColorTranslator.FromHtml(value.Trim(ignoreChars)); + } else if (key == "#FORECOLOR") { + this.ForeColor = ColorTranslator.FromHtml(value.Trim(ignoreChars)); + IsChangedForeColor = true; + } else if (key == "#BACKCOLOR") { + this.BackColor = ColorTranslator.FromHtml(value.Trim(ignoreChars)); + IsChangedBackColor = true; + } else if (key == "#BOXCOLOR") { + this.BoxColor = ColorTranslator.FromHtml(value.Trim(ignoreChars)); + IsChangedBoxColor = true; + } else if (key == "#BGCOLOR") { + this.BgColor = ColorTranslator.FromHtml(value.Trim(ignoreChars)); + IsChangedBgColor = true; + } else if (key == "#BGTYPE") { + this.BgType = value.Trim(ignoreChars); + IsChangedBgType = true; + } else if (key == "#BOXTYPE") { + this.BoxType = value.Trim(ignoreChars); + IsChangedBoxType = true; + } else if (key == "#BOXCHARA") { + this.BoxChara = value.Trim(ignoreChars); + IsChangedBoxChara = true; + } else if (key == "#SCENEPRESET") { + this.ScenePreset = value.Trim(ignoreChars); + } else if (key == "#DEFAULTPREIMAGE") { + this.DefaultPreimage = Path.Combine(Directory.GetParent(boxdefファイル名).FullName, value.Trim(ignoreChars)); + } else { + for (int i = 0; i < 3; i++) { + if (key == "#BOXEXPLANATION" + (i + 1).ToString()) { + this.strBoxText[i].SetString("default", value.Trim(ignoreChars)); + } else if (key.StartsWith("#BOXEXPLANATION") && key.EndsWith((i + 1).ToString())) { + string _lang = key.Substring(15)[..^1].ToLowerInvariant(); + this.strBoxText[i].SetString(_lang, value.Trim(ignoreChars)); } } } } - continue; - } catch (Exception e) { - Trace.TraceError(e.ToString()); - Trace.TraceError("例外が発生しましたが処理を継続します。 (178a9a36-a59e-4264-8e4c-b3c3459db43c)"); - continue; } + continue; + } catch (Exception e) { + Trace.TraceError(e.ToString()); + Trace.TraceError("例外が発生しましたが処理を継続します。 (178a9a36-a59e-4264-8e4c-b3c3459db43c)"); + continue; } } - reader.Close(); } + reader.Close(); } } diff --git a/OpenTaiko/src/Songs/CCourse.cs b/OpenTaiko/src/Songs/CCourse.cs index 9f6f3b7a..acfb9a50 100644 --- a/OpenTaiko/src/Songs/CCourse.cs +++ b/OpenTaiko/src/Songs/CCourse.cs @@ -1,39 +1,39 @@ -namespace OpenTaiko { - public class CCourse { - //2016.11.07 kairera0467 - //とりあえずメモ代わりに - // - // - //○コースデータ(.tjc) +namespace OpenTaiko; - //複数の曲を共通のゲージで連続して演奏します。 - //通常ゲージは某段位認定っぽい増減の仕方をします(補正なし)。 +public class CCourse { + //2016.11.07 kairera0467 + //とりあえずメモ代わりに + // + // + //○コースデータ(.tjc) - //また曲は自動的に再生されるため、ばいそく等のオプションの使用は出来ません。 + //複数の曲を共通のゲージで連続して演奏します。 + //通常ゲージは某段位認定っぽい増減の仕方をします(補正なし)。 - //.tjcのファイルは他の譜面(.tja等)と同様に扱われるので譜面データと同じフォルダに入れても構いません。 - // - // ●ヘッダ + //また曲は自動的に再生されるため、ばいそく等のオプションの使用は出来ません。 - // TITLE: コースの名前。 + //.tjcのファイルは他の譜面(.tja等)と同様に扱われるので譜面データと同じフォルダに入れても構いません。 + // + // ●ヘッダ - // COURSE: 「Easy」「Normal」「Hard」「Oni」「Edit」もしくは0-4の値。 - // 譜面の難易度。(コースと呼ぶとややこしいですがご諒承ください) - // 指定した譜面は全てここで指定する難易度の譜面が流れます。 - // 曲ごとの指定は(今のところ)できません。 + // TITLE: コースの名前。 - // LIFE: ライフ。省略可。 - // ここに値を入れると通常ゲージの代わりにライフ制になります。 + // COURSE: 「Easy」「Normal」「Hard」「Oni」「Edit」もしくは0-4の値。 + // 譜面の難易度。(コースと呼ぶとややこしいですがご諒承ください) + // 指定した譜面は全てここで指定する難易度の譜面が流れます。 + // 曲ごとの指定は(今のところ)できません。 - // SONG: 曲データ。 - // 演奏する曲のファイル名(.tja/.tjf)をtaikojiro.exeのあるディレクトリからの相対パスで指定。 - // 指定されたデータは上にあるものから順に演奏されます。 + // LIFE: ライフ。省略可。 + // ここに値を入れると通常ゲージの代わりにライフ制になります。 + + // SONG: 曲データ。 + // 演奏する曲のファイル名(.tja/.tjf)をtaikojiro.exeのあるディレクトリからの相対パスで指定。 + // 指定されたデータは上にあるものから順に演奏されます。 - public void t入力(string strファイル名) { - StreamReader reader = new StreamReader(strファイル名); - string str = reader.ReadToEnd(); - reader.Close(); - } + public void t入力(string strファイル名) { + StreamReader reader = new StreamReader(strファイル名); + string str = reader.ReadToEnd(); + reader.Close(); } } diff --git a/OpenTaiko/src/Songs/CDTX.cs b/OpenTaiko/src/Songs/CDTX.cs index df48dbd5..97cb0ae1 100644 --- a/OpenTaiko/src/Songs/CDTX.cs +++ b/OpenTaiko/src/Songs/CDTX.cs @@ -9,1465 +9,1489 @@ using FDK.ExtensionMethods; using SkiaSharp; using Color = System.Drawing.Color; -namespace OpenTaiko { - internal class CDTX : CActivity { - // 定数 - - public enum E種別 { DTX, GDA, G2D, BMS, BME, SMF } +namespace OpenTaiko; - public List listErrors = new List(); - private int nNowReadLine; - // Class - - public class CBPM { - public double dbBPM値; - public double bpm_change_time; - public double bpm_change_bmscroll_time; - public ECourse bpm_change_course = ECourse.eNormal; - public int n内部番号; - public int n表記上の番号; +internal class CDTX : CActivity { + // 定数 - public override string ToString() { - StringBuilder builder = new StringBuilder(0x80); - if (this.n内部番号 != this.n表記上の番号) { - builder.Append(string.Format("CBPM{0}(内部{1})", CDTX.tZZ(this.n表記上の番号), this.n内部番号)); - } else { - builder.Append(string.Format("CBPM{0}", CDTX.tZZ(this.n表記上の番号))); - } - builder.Append(string.Format(", BPM:{0}", this.dbBPM値)); - return builder.ToString(); + public enum E種別 { DTX, GDA, G2D, BMS, BME, SMF } + + public List listErrors = new List(); + private int nNowReadLine; + // Class + + public class CBPM { + public double dbBPM値; + public double bpm_change_time; + public double bpm_change_bmscroll_time; + public ECourse bpm_change_course = ECourse.eNormal; + public int n内部番号; + public int n表記上の番号; + + public override string ToString() { + StringBuilder builder = new StringBuilder(0x80); + if (this.n内部番号 != this.n表記上の番号) { + builder.Append(string.Format("CBPM{0}(内部{1})", CDTX.tZZ(this.n表記上の番号), this.n内部番号)); + } else { + builder.Append(string.Format("CBPM{0}", CDTX.tZZ(this.n表記上の番号))); } + builder.Append(string.Format(", BPM:{0}", this.dbBPM値)); + return builder.ToString(); } - public class CSCROLL { - public double dbSCROLL値; - public double dbSCROLL値Y; - public int n内部番号; - public int n表記上の番号; + } + public class CSCROLL { + public double dbSCROLL値; + public double dbSCROLL値Y; + public int n内部番号; + public int n表記上の番号; - public override string ToString() { - StringBuilder builder = new StringBuilder(0x80); - if (this.n内部番号 != this.n表記上の番号) { - builder.Append(string.Format("CSCROLL{0}(内部{1})", CDTX.tZZ(this.n表記上の番号), this.n内部番号)); - } else { - builder.Append(string.Format("CSCROLL{0}", CDTX.tZZ(this.n表記上の番号))); - } - builder.Append(string.Format(", SCROLL:{0}", this.dbSCROLL値)); - return builder.ToString(); - } - } - /// - /// 判定ライン移動命令 - /// - public class CJPOSSCROLL { - public double db移動時間; - public int n移動距離px; - public int n移動方向; //移動方向は0(左)、1(右)の2つだけ。 - public int n内部番号; - public int n表記上の番号; - public int nVerticalMove; - - public override string ToString() { - StringBuilder builder = new StringBuilder(0x80); - if (this.n内部番号 != this.n表記上の番号) { - builder.Append(string.Format("CJPOSSCROLL{0}(内部{1})", CDTX.tZZ(this.n表記上の番号), this.n内部番号)); - } else { - builder.Append(string.Format("CJPOSSCROLL{0}", CDTX.tZZ(this.n表記上の番号))); - } - builder.Append(string.Format(", JPOSSCROLL:{0}", this.db移動時間)); - return builder.ToString(); + public override string ToString() { + StringBuilder builder = new StringBuilder(0x80); + if (this.n内部番号 != this.n表記上の番号) { + builder.Append(string.Format("CSCROLL{0}(内部{1})", CDTX.tZZ(this.n表記上の番号), this.n内部番号)); + } else { + builder.Append(string.Format("CSCROLL{0}", CDTX.tZZ(this.n表記上の番号))); } + builder.Append(string.Format(", SCROLL:{0}", this.dbSCROLL値)); + return builder.ToString(); } + } + /// + /// 判定ライン移動命令 + /// + public class CJPOSSCROLL { + public double db移動時間; + public int n移動距離px; + public int n移動方向; //移動方向は0(左)、1(右)の2つだけ。 + public int n内部番号; + public int n表記上の番号; + public int nVerticalMove; - public class CDELAY { - public int nDELAY値; //格納時にはmsになっているため、doubleにはしない。 - public int n内部番号; - public int n表記上の番号; - public double delay_time; - public double delay_bmscroll_time; - public double delay_bpm; - public ECourse delay_course = ECourse.eNormal; - - public override string ToString() { - StringBuilder builder = new StringBuilder(0x80); - if (this.n内部番号 != this.n表記上の番号) { - builder.Append(string.Format("CDELAY{0}(内部{1})", CDTX.tZZ(this.n表記上の番号), this.n内部番号)); - } else { - builder.Append(string.Format("CDELAY{0}", CDTX.tZZ(this.n表記上の番号))); - } - builder.Append(string.Format(", DELAY:{0}", this.nDELAY値)); - return builder.ToString(); + public override string ToString() { + StringBuilder builder = new StringBuilder(0x80); + if (this.n内部番号 != this.n表記上の番号) { + builder.Append(string.Format("CJPOSSCROLL{0}(内部{1})", CDTX.tZZ(this.n表記上の番号), this.n内部番号)); + } else { + builder.Append(string.Format("CJPOSSCROLL{0}", CDTX.tZZ(this.n表記上の番号))); } + builder.Append(string.Format(", JPOSSCROLL:{0}", this.db移動時間)); + return builder.ToString(); } - public enum E分岐種類 { - e精度分岐, - e連打分岐, - eスコア分岐, - e大音符のみ精度分岐 - } - public class CBRANCH { - public E分岐種類 e分岐の種類; //0:精度分岐 1:連打分岐 2:スコア分岐 3:大音符のみの精度分岐 - public double n条件数値A; - public double n条件数値B; - public double db分岐時間; - public double db分岐時間ms; - public double db判定時間; - public double dbBMScrollTime; - public double dbBPM; - public double dbSCROLL; - public int n現在の小節; - public int n命令時のChipList番号; + } - public int n表記上の番号; - public int n内部番号; + public class CDELAY { + public int nDELAY値; //格納時にはmsになっているため、doubleにはしない。 + public int n内部番号; + public int n表記上の番号; + public double delay_time; + public double delay_bmscroll_time; + public double delay_bpm; + public ECourse delay_course = ECourse.eNormal; - public override string ToString() { - StringBuilder builder = new StringBuilder(0x80); - if (this.n内部番号 != this.n表記上の番号) { - builder.Append(string.Format("CBRANCH{0}(内部{1})", CDTX.tZZ(this.n表記上の番号), this.n内部番号)); - } else { - builder.Append(string.Format("CBRANCH{0}", CDTX.tZZ(this.n表記上の番号))); - } - builder.Append(string.Format(", BRANCH:{0}", this.e分岐の種類)); - return builder.ToString(); + public override string ToString() { + StringBuilder builder = new StringBuilder(0x80); + if (this.n内部番号 != this.n表記上の番号) { + builder.Append(string.Format("CDELAY{0}(内部{1})", CDTX.tZZ(this.n表記上の番号), this.n内部番号)); + } else { + builder.Append(string.Format("CDELAY{0}", CDTX.tZZ(this.n表記上の番号))); } + builder.Append(string.Format(", DELAY:{0}", this.nDELAY値)); + return builder.ToString(); } + } + public enum E分岐種類 { + e精度分岐, + e連打分岐, + eスコア分岐, + e大音符のみ精度分岐 + } + public class CBRANCH { + public E分岐種類 e分岐の種類; //0:精度分岐 1:連打分岐 2:スコア分岐 3:大音符のみの精度分岐 + public double n条件数値A; + public double n条件数値B; + public double db分岐時間; + public double db分岐時間ms; + public double db判定時間; + public double dbBMScrollTime; + public double dbBPM; + public double dbSCROLL; + public int n現在の小節; + public int n命令時のChipList番号; + public int n表記上の番号; + public int n内部番号; - public class CChip : IComparable, ICloneable { - public EScrollMode eScrollMode; - public bool bHit; - public bool b可視 = true; - public bool bHideBarLine = true; - public bool bProcessed = false; - public bool bShow; - public bool bShowRoll; - public bool bBranch = false; - public double dbチップサイズ倍率 = 1.0; - public double db実数値; - public double dbBPM; - public float fNow_Measure_s = 4.0f;//強制分岐のために追加.2020.04.21.akasoko26 - public float fNow_Measure_m = 4.0f;//強制分岐のために追加.2020.04.21.akasoko26 - public bool IsEndedBranching = false;//分岐が終わった時の連打譜面が非可視化になってしまうためフラグを追加.2020.04.21.akasoko26 - public double dbSCROLL; - public double dbSCROLL_Y; - public ECourse nコース; - public int nSenote; - public int nState; - public int nRollCount; - public int nBalloon; - public int nProcessTime; - public int nスクロール方向; - public int n描画優先度; //(特殊)現状連打との判断目的で使用 - public ENoteState eNoteState; - public EInstrumentPad e楽器パート = EInstrumentPad.Unknown; - public int nチャンネル番号; - public int VideoStartTimeMs; - public STDGBVALUE nバーからの距離dot; - public int nバーからのノーツ末端距離dot; - public int nバーからのノーツ末端距離dot_Y; - public int n整数値; - public int n文字数 = 16; - - public int n整数値_内部番号; - public int n総移動時間; - public int n透明度 = 0xff; - public int n発声位置; - public double n条件数値A; - public double n条件数値B; - public double db分岐時間のズレ; - public E分岐種類 e分岐の種類; - - public double db発声位置; // 発声時刻を格納していた変数のうちの1つをfloat型からdouble型に変更。(kairera0467) - public double fBMSCROLLTime; - public double fBMSCROLLTime_end; - public int n発声時刻ms; - public double n分岐時刻ms; - - - public double db発声時刻ms; - public int nノーツ終了位置; - public int nノーツ終了時刻ms; - public int nノーツ出現時刻ms; - public int nノーツ移動開始時刻ms; - public int n分岐回数; - public int n連打音符State; - public int nLag; // 2011.2.1 yyagi - public double db発声時刻; - public double db判定終了時刻;//連打系音符で使用 - public double dbProcess_Time; - public int nPlayerSide; - public bool bGOGOTIME = false; //2018.03.11 k1airera0467 ゴーゴータイム内のチップであるか - public int nList上の位置; - public bool IsFixedSENote; - public bool IsHitted = false; - public bool IsMissed = false; - - - - //EXTENDED COMMANDS - public int fCamTimeMs; - public string strCamEaseType; - public Easing.CalcType fCamMoveType; - - public float fCamScrollStartX; - public float fCamScrollStartY; - public float fCamScrollEndX; - public float fCamScrollEndY; - - public float fCamRotationStart; - public float fCamRotationEnd; - - public float fCamZoomStart; - public float fCamZoomEnd; - - public float fCamScaleStartX; - public float fCamScaleStartY; - public float fCamScaleEndX; - public float fCamScaleEndY; - - public Color4 borderColor; - - public int fObjTimeMs; - public string strObjName; - public string strObjEaseType; - public Easing.CalcType objCalcType; - - public float fObjX; - public float fObjY; - - public float fObjStart; - public float fObjEnd; - - public CSongObject obj; - - public string strTargetTxName; - public string strNewPath; - - public string strConfigValue; - - public double dbAnimInterval; - - public int intFrame; - - public EGameType eGameType; - // - - - public bool bBPMチップである { - get { - if (this.nチャンネル番号 == 3 || this.nチャンネル番号 == 8) { - return true; - } else { - return false; - } - } + public override string ToString() { + StringBuilder builder = new StringBuilder(0x80); + if (this.n内部番号 != this.n表記上の番号) { + builder.Append(string.Format("CBRANCH{0}(内部{1})", CDTX.tZZ(this.n表記上の番号), this.n内部番号)); + } else { + builder.Append(string.Format("CBRANCH{0}", CDTX.tZZ(this.n表記上の番号))); } - public bool b自動再生音チャンネルである { - get { - int num = this.nチャンネル番号; - if ((((num != 1) && ((0x61 > num) || (num > 0x69))) && ((0x70 > num) || (num > 0x79))) && ((0x80 > num) || (num > 0x89))) { - return ((0x90 <= num) && (num <= 0x92)); - } + builder.Append(string.Format(", BRANCH:{0}", this.e分岐の種類)); + return builder.ToString(); + } + } + + + public class CChip : IComparable, ICloneable { + public EScrollMode eScrollMode; + public bool bHit; + public bool b可視 = true; + public bool bHideBarLine = true; + public bool bProcessed = false; + public bool bShow; + public bool bShowRoll; + public bool bBranch = false; + public double dbチップサイズ倍率 = 1.0; + public double db実数値; + public double dbBPM; + public float fNow_Measure_s = 4.0f;//強制分岐のために追加.2020.04.21.akasoko26 + public float fNow_Measure_m = 4.0f;//強制分岐のために追加.2020.04.21.akasoko26 + public bool IsEndedBranching = false;//分岐が終わった時の連打譜面が非可視化になってしまうためフラグを追加.2020.04.21.akasoko26 + public double dbSCROLL; + public double dbSCROLL_Y; + public ECourse nコース; + public int nSenote; + public int nState; + public int nRollCount; + public int nBalloon; + public int nProcessTime; + public int nスクロール方向; + public int n描画優先度; //(特殊)現状連打との判断目的で使用 + public ENoteState eNoteState; + public EInstrumentPad e楽器パート = EInstrumentPad.Unknown; + public int nチャンネル番号; + public int VideoStartTimeMs; + public STDGBVALUE nバーからの距離dot; + public int nバーからのノーツ末端距離dot; + public int nバーからのノーツ末端距離dot_Y; + public int n整数値; + public int n文字数 = 16; + + public int n整数値_内部番号; + public int n総移動時間; + public int n透明度 = 0xff; + public int n発声位置; + public double n条件数値A; + public double n条件数値B; + public double db分岐時間のズレ; + public E分岐種類 e分岐の種類; + + public double db発声位置; // 発声時刻を格納していた変数のうちの1つをfloat型からdouble型に変更。(kairera0467) + public double fBMSCROLLTime; + public double fBMSCROLLTime_end; + public int n発声時刻ms; + public double n分岐時刻ms; + + + public double db発声時刻ms; + public int nノーツ終了位置; + public int nノーツ終了時刻ms; + public int nノーツ出現時刻ms; + public int nノーツ移動開始時刻ms; + public int n分岐回数; + public int n連打音符State; + public int nLag; // 2011.2.1 yyagi + public double db発声時刻; + public double db判定終了時刻;//連打系音符で使用 + public double dbProcess_Time; + public int nPlayerSide; + public bool bGOGOTIME = false; //2018.03.11 k1airera0467 ゴーゴータイム内のチップであるか + public int nList上の位置; + public bool IsFixedSENote; + public bool IsHitted = false; + public bool IsMissed = false; + + + + //EXTENDED COMMANDS + public int fCamTimeMs; + public string strCamEaseType; + public Easing.CalcType fCamMoveType; + + public float fCamScrollStartX; + public float fCamScrollStartY; + public float fCamScrollEndX; + public float fCamScrollEndY; + + public float fCamRotationStart; + public float fCamRotationEnd; + + public float fCamZoomStart; + public float fCamZoomEnd; + + public float fCamScaleStartX; + public float fCamScaleStartY; + public float fCamScaleEndX; + public float fCamScaleEndY; + + public Color4 borderColor; + + public int fObjTimeMs; + public string strObjName; + public string strObjEaseType; + public Easing.CalcType objCalcType; + + public float fObjX; + public float fObjY; + + public float fObjStart; + public float fObjEnd; + + public CSongObject obj; + + public string strTargetTxName; + public string strNewPath; + + public string strConfigValue; + + public double dbAnimInterval; + + public int intFrame; + + public EGameType eGameType; + // + + + public bool bBPMチップである { + get { + if (this.nチャンネル番号 == 3 || this.nチャンネル番号 == 8) { return true; - } - } - - - - public bool b演奏終了後も再生が続くチップである; // #32248 2013.10.14 yyagi - public CCounter RollDelay; // 18.9.22 AioiLight Add 連打時に赤くなるやつのタイマー - public CCounter RollInputTime; // 18.9.22 AioiLight Add 連打入力後、RollDelayが作動するまでのタイマー - public int RollEffectLevel; // 18.9.22 AioiLight Add 連打時に赤くなるやつの度合い - - public CChip() { - this.nバーからの距離dot = new STDGBVALUE() { - Drums = 0, - Guitar = 0, - Bass = 0, - Taiko = 0 - }; - } - public void t初期化() { - this.bBranch = false; - this.nチャンネル番号 = 0; - this.n整数値 = 0; //整数値をList上の番号として用いる。 - this.n整数値_内部番号 = 0; - this.db実数値 = 0.0; - this.n発声位置 = 0; - this.db発声位置 = 0.0D; - this.n発声時刻ms = 0; - this.db発声時刻ms = 0.0D; - this.fBMSCROLLTime = 0; - this.nノーツ終了位置 = 0; - this.nノーツ終了時刻ms = 0; - this.n描画優先度 = 0; - this.nLag = -999; - this.b演奏終了後も再生が続くチップである = false; - this.nList上の位置 = 0; - this.dbチップサイズ倍率 = 1.0; - this.bHit = false; - this.IsMissed = false; - this.b可視 = true; - this.e楽器パート = EInstrumentPad.Unknown; - this.n透明度 = 0xff; - this.nバーからの距離dot.Drums = 0; - this.nバーからの距離dot.Guitar = 0; - this.nバーからの距離dot.Bass = 0; - this.nバーからの距離dot.Taiko = 0; - this.nバーからのノーツ末端距離dot = 0; - this.nバーからのノーツ末端距離dot_Y = 0; - this.n総移動時間 = 0; - this.dbBPM = 120.0; - this.fNow_Measure_m = 4.0f; - this.fNow_Measure_s = 4.0f; - this.nスクロール方向 = 0; - this.dbSCROLL = 1.0; - this.dbSCROLL_Y = 0.0f; - } - public override string ToString() { - - //2016.10.07 kairera0467 近日中に再編成予定 - string[] chToStr = - { - //システム - "??", "バックコーラス", "小節長変更", "BPM変更", "??", "??", "??", "??", - "BPM変更(拡張)", "??", "??", "??", "??", "??", "??", "??", - - //太鼓1P(移動予定) - "??", "ドン", "カツ", "ドン(大)", "カツ(大)", "連打", "連打(大)", "ふうせん連打", - "連打終点", "芋", "ドン(手)", "カッ(手)", "Mine", "??", "??", "AD-LIB", - - //太鼓予備 - "??", "??", "??", "??", "??", "??", "??", "??", - "??", "??", "??", "??", "??", "??", "??", "??", - - //太鼓予備 - "??", "??", "??", "??", "??", "??", "??", "??", - "??", "??", "??", "??", "??", "??", "??", "??", - - //太鼓予備 - "??", "??", "??", "??", "??", "??", "??", "??", - "??", "??", "??", "??", "??", "??", "??", "??", - - //システム - "小節線", "拍線", "??", "??", "AVI", "??", "??", "??", - "??", "??", "??", "??", "??", "??", "??", "??", - - //システム(移動予定) - "SCROLL", "DELAY", "ゴーゴータイム開始", "ゴーゴータイム終了", "カメラ移動開始(縦)", "カメラ移動終了(縦)", "カメラ移動開始(横)", "カメラ移動終了(横)", - "カメラズーム開始", "カメラズーム終了", "カメラ回転開始", "カメラ回転終了", "カメラスケーリング開始(横)", "カメラスケーリング終了(横)", "カメラスケーリング開始(縦)", "カメラスケーリング終了(縦)", - - "ボーダーカラー変更", "??", "??", "??", "??", "??", "??", "??", - "??", "??", "??", "??", "??", "??", "??", "??", - - "??", "??", "??", "??", "??", "??", "??", "??", - "??", "??", "??", "??", "??", "??", "??", "??", - - //太鼓1P、システム(現行) - "??", "??", "??", "太鼓_赤", "太鼓_青", "太鼓_赤(大)", "太鼓_青(大)", "太鼓_黄", - "太鼓_黄(大)", "太鼓_風船", "太鼓_連打末端", "太鼓_芋", "??", "SCROLL", "ゴーゴータイム開始", "ゴーゴータイム終了", - - "??", "??", "??", "??", "??", "??", "??", "??", - "??", "??", "??", "??", "??", "??", "??", "太鼓 AD-LIB", - - "??", "??", "??", "??", "??", "??", "??", "??", - "??", "??", "??", "??", "??", "??", "??", "??", - - "??", "??", "??", "??", "0xC4", "0xC5", "0xC6", "??", - "??", "??", "0xCA", "??", "??", "??", "??", "0xCF", - - //システム(現行) - "0xD0", "??", "??", "??", "??", "??", "??", "??", - "??", "??", "ミキサー追加", "ミキサー削除", "DELAY", "譜面分岐リセット", "譜面分岐アニメ", "譜面分岐内部処理", - - //システム(現行) - "小節線ON/OFF", "分岐固定", "判定枠移動", "", "", "", "", "", - "", "", "", "", "", "", "", "", - - "0xF0", "歌詞", "??", "SUDDEN", "??", "??", "??", "??", - "??", "??", "??", "??", "??", "??", "??", "??", "譜面終了", - - // Extra notes - - "KaDon", "??", "??", "??", "??", "??", "??", "??", - "??", "??", "??", "??", "??", "??", "??", "??", - }; - return string.Format("CChip: 位置:{0:D4}.{1:D3}, 時刻{2:D6}, Ch:{3:X2}({4}), Pn:{5}({11})(内部{6}), Pd:{7}, Sz:{8}, BMScroll:{9}, Auto:{10}, コース:{11}", - this.n発声位置 / 384, this.n発声位置 % 384, - this.n発声時刻ms, - this.nチャンネル番号, chToStr[this.nチャンネル番号], - this.n整数値, this.n整数値_内部番号, - this.db実数値, - this.dbチップサイズ倍率, - this.fBMSCROLLTime, - this.b自動再生音チャンネルである, - this.nコース, - CDTX.tZZ(this.n整数値)); - } - /// - /// チップの再生長を取得する。現状、WAVチップとBGAチップでのみ使用可能。 - /// - /// 再生長(ms) - public int GetDuration() { - int nDuration = 0; - - if (this.nチャンネル番号 == 0x01) // WAV - { - CDTX.CWAV wc; - OpenTaiko.DTX.listWAV.TryGetValue(this.n整数値_内部番号, out wc); - if (wc == null) { - nDuration = 0; - } else { - nDuration = (wc.rSound[0] == null) ? 0 : wc.rSound[0].TotalPlayTime; - } - } else if (this.nチャンネル番号 == 0x54) // AVI - { - CVideoDecoder wc; - OpenTaiko.DTX.listVD.TryGetValue(this.n整数値_内部番号, out wc); - if (wc == null) { - nDuration = 0; - } else { - nDuration = (int)(wc.Duration * 1000); - } - } - - double _db再生速度 = OpenTaiko.DTX.db再生速度; - return (int)(nDuration / _db再生速度); - } - - #region [ IComparable 実装 ] - //----------------- - - private static readonly byte[] n優先度 = new byte[] { - 5, 5, 3, 7, 5, 5, 5, 5, 3, 5, 5, 5, 5, 5, 5, 5, //0x00 - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, //0x10 - 7, 7, 7, 7, 7, 7, 7, 7, 5, 5, 5, 5, 5, 5, 5, 5, //0x20 - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, //0x30 - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, //0x40 - 9, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, //0x50 - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, //0x60 - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, //0x70 - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, //0x80 - 5, 5, 5, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 9, 9, 9, //0x90 - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, //0xA0 - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, //0xB0 - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, //0xC0 - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 3, 4, 4, //0xD0 - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, //0xE0 - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, //0xF0 - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, //0x100 - }; - - public int CompareTo(CDTX.CChip other) { - // まずは位置で比較。 - - //BGMチップだけ発声位置 - //if( this.nチャンネル番号 == 0x01 || this.nチャンネル番号 == 0x02 ) - //{ - // if( this.n発声位置 < other.n発声位置 ) - // return -1; - - // if( this.n発声位置 > other.n発声位置 ) - // return 1; - //} - - //if( this.n発声位置 < other.n発声位置 ) - // return -1; - - //if( this.n発声位置 > other.n発声位置 ) - // return 1; - - //譜面解析メソッドV4では発声時刻msで比較する。 - var n発声時刻msCompareToResult = 0; - n発声時刻msCompareToResult = this.n発声時刻ms.CompareTo(other.n発声時刻ms); - if (n発声時刻msCompareToResult != 0) { - return n発声時刻msCompareToResult; - } - - n発声時刻msCompareToResult = this.db発声時刻ms.CompareTo(other.db発声時刻ms); - if (n発声時刻msCompareToResult != 0) { - return n発声時刻msCompareToResult; - } - - // 位置が同じなら優先度で比較。 - return n優先度[this.nチャンネル番号].CompareTo(n優先度[other.nチャンネル番号]); - } - //----------------- - #endregion - /// - /// shallow copyです。 - /// - /// - public object Clone() { - return MemberwiseClone(); - } - } - public class CWAV : IDisposable { - public bool bBGMとして使う; - public List listこのWAVを使用するチャンネル番号の集合 = new List(16); - public int nチップサイズ = 100; - public int n位置; - public long[] n一時停止時刻 = new long[OpenTaiko.ConfigIni.nPoliphonicSounds]; // 4 - public int SongVol = CSound.DefaultSongVol; - public LoudnessMetadata? SongLoudnessMetadata = null; - public int n現在再生中のサウンド番号; - public long[] n再生開始時刻 = new long[OpenTaiko.ConfigIni.nPoliphonicSounds]; // 4 - public int n内部番号; - public int n表記上の番号; - public CSound[] rSound = new CSound[OpenTaiko.ConfigIni.nPoliphonicSounds]; // 4 - public string strコメント文 = ""; - public string strファイル名 = ""; - public bool bBGMとして使わない { - get { - return !this.bBGMとして使う; - } - set { - this.bBGMとして使う = !value; - } - } - public bool bIsBassSound = false; - public bool bIsGuitarSound = false; - public bool bIsDrumsSound = false; - public bool bIsSESound = false; - public bool bIsBGMSound = false; - - public override string ToString() { - var sb = new StringBuilder(128); - - if (this.n表記上の番号 == this.n内部番号) { - sb.Append(string.Format("CWAV{0}: ", CDTX.tZZ(this.n表記上の番号))); } else { - sb.Append(string.Format("CWAV{0}(内部{1}): ", CDTX.tZZ(this.n表記上の番号), this.n内部番号)); - } - sb.Append( - $"{nameof(SongVol)}:{this.SongVol}, {nameof(LoudnessMetadata.Integrated)}:{this.SongLoudnessMetadata?.Integrated}, {nameof(LoudnessMetadata.TruePeak)}:{this.SongLoudnessMetadata?.TruePeak}, 位置:{this.n位置}, サイズ:{this.nチップサイズ}, BGM:{(this.bBGMとして使う ? 'Y' : 'N')}, File:{this.strファイル名}, Comment:{this.strコメント文}"); - - return sb.ToString(); - } - - #region [ Dispose-Finalize パターン実装 ] - //----------------- - public void Dispose() { - this.Dispose(true); - GC.SuppressFinalize(this); - } - public void Dispose(bool bManagedリソースの解放も行う) { - if (this.bDisposed済み) - return; - - if (bManagedリソースの解放も行う) { - for (int i = 0; i < OpenTaiko.ConfigIni.nPoliphonicSounds; i++) // 4 - { - if (this.rSound[i] != null) - OpenTaiko.SoundManager.tDisposeSound(this.rSound[i]); - this.rSound[i] = null; - - if ((i == 0) && OpenTaiko.ConfigIni.bOutputCreationReleaseLog) - Trace.TraceInformation("サウンドを解放しました。({0})({1})", this.strコメント文, this.strファイル名); - } - } - - this.bDisposed済み = true; - } - ~CWAV() { - this.Dispose(false); - } - //----------------- - #endregion - - #region [ private ] - //----------------- - private bool bDisposed済み; - //----------------- - #endregion - } - - [Serializable] - public class DanSongs { - [NonSerialized] - public CTexture TitleTex; - [NonSerialized] - public CTexture SubTitleTex; - public string Title; - public string SubTitle; - public string FileName; - public string Genre; - public int ScoreInit; - public int ScoreDiff; - public int Level; - public int Difficulty; - public static int Number = 0; - public bool bTitleShow; - public Dan_C[] Dan_C = new Dan_C[CExamInfo.cMaxExam]; - - [NonSerialized] - public CWAV Wave; - - public DanSongs() { - Number++; - } - } - - public struct STLYRIC { - public long Time; - public SKBitmap TextTex; - public string Text; - public int index; - } - - - // 構造体 - - public struct STLANEINT { - public int HH; - public int SD; - public int BD; - public int HT; - public int LT; - public int CY; - public int FT; - public int HHO; - public int RD; - public int LC; - public int LP; - public int LBD; - - public int Drums { - get { - return this.HH + this.SD + this.BD + this.HT + this.LT + this.CY + this.FT + this.HHO + this.RD + this.LC + this.LP + this.LBD; - } - } - public int Guitar; - public int Bass; - public int Taiko_Red; - public int Taiko_Blue; - - public int this[int index] { - get { - switch (index) { - case 0: - return this.HH; - - case 1: - return this.SD; - - case 2: - return this.BD; - - case 3: - return this.HT; - - case 4: - return this.LT; - - case 5: - return this.CY; - - case 6: - return this.FT; - - case 7: - return this.HHO; - - case 8: - return this.RD; - - case 9: - return this.LC; - - case 10: - return this.LP; - - case 11: - return this.LBD; - - case 12: - return this.Guitar; - - case 13: - return this.Bass; - - case 14: - return this.Taiko_Red; - - case 15: - return this.Taiko_Blue; - } - throw new IndexOutOfRangeException(); - } - set { - if (value < 0) { - throw new ArgumentOutOfRangeException(); - } - switch (index) { - case 0: - this.HH = value; - return; - - case 1: - this.SD = value; - return; - - case 2: - this.BD = value; - return; - - case 3: - this.HT = value; - return; - - case 4: - this.LT = value; - return; - - case 5: - this.CY = value; - return; - - case 6: - this.FT = value; - return; - - case 7: - this.HHO = value; - return; - - case 8: - this.RD = value; - return; - - case 9: - this.LC = value; - return; - - case 10: - this.LP = value; - return; - - case 11: - this.LBD = value; - return; - - case 12: - this.Guitar = value; - return; - - case 13: - this.Bass = value; - return; - - case 14: - this.Taiko_Red = value; - return; - - case 15: - this.Taiko_Blue = value; - return; - } - throw new IndexOutOfRangeException(); + return false; } } } - public struct STRESULT { - public string SS; - public string S; - public string A; - public string B; - public string C; - public string D; - public string E; - - public string this[int index] { - get { - switch (index) { - case 0: - return this.SS; - - case 1: - return this.S; - - case 2: - return this.A; - - case 3: - return this.B; - - case 4: - return this.C; - - case 5: - return this.D; - - case 6: - return this.E; - } - throw new IndexOutOfRangeException(); - } - set { - switch (index) { - case 0: - this.SS = value; - return; - - case 1: - this.S = value; - return; - - case 2: - this.A = value; - return; - - case 3: - this.B = value; - return; - - case 4: - this.C = value; - return; - - case 5: - this.D = value; - return; - - case 6: - this.E = value; - return; - } - throw new IndexOutOfRangeException(); + public bool b自動再生音チャンネルである { + get { + int num = this.nチャンネル番号; + if ((((num != 1) && ((0x61 > num) || (num > 0x69))) && ((0x70 > num) || (num > 0x79))) && ((0x80 > num) || (num > 0x89))) { + return ((0x90 <= num) && (num <= 0x92)); } + return true; } } - public struct STチップがある { - public bool Drums; - public bool Guitar; - public bool Bass; - public bool HHOpen; - public bool Ride; - public bool LeftCymbal; - public bool OpenGuitar; - public bool OpenBass; - public bool Branch; - public bool this[int index] { - get { - switch (index) { - case 0: - return this.Drums; + public bool b演奏終了後も再生が続くチップである; // #32248 2013.10.14 yyagi + public CCounter RollDelay; // 18.9.22 AioiLight Add 連打時に赤くなるやつのタイマー + public CCounter RollInputTime; // 18.9.22 AioiLight Add 連打入力後、RollDelayが作動するまでのタイマー + public int RollEffectLevel; // 18.9.22 AioiLight Add 連打時に赤くなるやつの度合い - case 1: - return this.Guitar; - - case 2: - return this.Bass; - - case 3: - return this.HHOpen; - - case 4: - return this.Ride; - - case 5: - return this.LeftCymbal; - - case 6: - return this.OpenGuitar; - - case 7: - return this.OpenBass; - - case 8: - return this.Branch; - } - throw new IndexOutOfRangeException(); - } - set { - switch (index) { - case 0: - this.Drums = value; - return; - - case 1: - this.Guitar = value; - return; - - case 2: - this.Bass = value; - return; - - case 3: - this.HHOpen = value; - return; - - case 4: - this.Ride = value; - return; - - case 5: - this.LeftCymbal = value; - return; - - case 6: - this.OpenGuitar = value; - return; - - case 7: - this.OpenBass = value; - return; - - case 8: - this.Branch = value; - return; - } - throw new IndexOutOfRangeException(); - } - } + public CChip() { + this.nバーからの距離dot = new STDGBVALUE() { + Drums = 0, + Guitar = 0, + Bass = 0, + Taiko = 0 + }; } - public enum ECourse { - eNormal, - eExpert, - eMaster + public void t初期化() { + this.bBranch = false; + this.nチャンネル番号 = 0; + this.n整数値 = 0; //整数値をList上の番号として用いる。 + this.n整数値_内部番号 = 0; + this.db実数値 = 0.0; + this.n発声位置 = 0; + this.db発声位置 = 0.0D; + this.n発声時刻ms = 0; + this.db発声時刻ms = 0.0D; + this.fBMSCROLLTime = 0; + this.nノーツ終了位置 = 0; + this.nノーツ終了時刻ms = 0; + this.n描画優先度 = 0; + this.nLag = -999; + this.b演奏終了後も再生が続くチップである = false; + this.nList上の位置 = 0; + this.dbチップサイズ倍率 = 1.0; + this.bHit = false; + this.IsMissed = false; + this.b可視 = true; + this.e楽器パート = EInstrumentPad.Unknown; + this.n透明度 = 0xff; + this.nバーからの距離dot.Drums = 0; + this.nバーからの距離dot.Guitar = 0; + this.nバーからの距離dot.Bass = 0; + this.nバーからの距離dot.Taiko = 0; + this.nバーからのノーツ末端距離dot = 0; + this.nバーからのノーツ末端距離dot_Y = 0; + this.n総移動時間 = 0; + this.dbBPM = 120.0; + this.fNow_Measure_m = 4.0f; + this.fNow_Measure_s = 4.0f; + this.nスクロール方向 = 0; + this.dbSCROLL = 1.0; + this.dbSCROLL_Y = 0.0f; } + public override string ToString() { - public enum ELevelIcon { - eMinus, - eNone, - ePlus - } + //2016.10.07 kairera0467 近日中に再編成予定 + string[] chToStr = + { + //システム + "??", "バックコーラス", "小節長変更", "BPM変更", "??", "??", "??", "??", + "BPM変更(拡張)", "??", "??", "??", "??", "??", "??", "??", - public enum ESide { - eNormal, - eEx + //太鼓1P(移動予定) + "??", "ドン", "カツ", "ドン(大)", "カツ(大)", "連打", "連打(大)", "ふうせん連打", + "連打終点", "芋", "ドン(手)", "カッ(手)", "Mine", "??", "??", "AD-LIB", + + //太鼓予備 + "??", "??", "??", "??", "??", "??", "??", "??", + "??", "??", "??", "??", "??", "??", "??", "??", + + //太鼓予備 + "??", "??", "??", "??", "??", "??", "??", "??", + "??", "??", "??", "??", "??", "??", "??", "??", + + //太鼓予備 + "??", "??", "??", "??", "??", "??", "??", "??", + "??", "??", "??", "??", "??", "??", "??", "??", + + //システム + "小節線", "拍線", "??", "??", "AVI", "??", "??", "??", + "??", "??", "??", "??", "??", "??", "??", "??", + + //システム(移動予定) + "SCROLL", "DELAY", "ゴーゴータイム開始", "ゴーゴータイム終了", "カメラ移動開始(縦)", "カメラ移動終了(縦)", "カメラ移動開始(横)", "カメラ移動終了(横)", + "カメラズーム開始", "カメラズーム終了", "カメラ回転開始", "カメラ回転終了", "カメラスケーリング開始(横)", "カメラスケーリング終了(横)", "カメラスケーリング開始(縦)", "カメラスケーリング終了(縦)", + + "ボーダーカラー変更", "??", "??", "??", "??", "??", "??", "??", + "??", "??", "??", "??", "??", "??", "??", "??", + + "??", "??", "??", "??", "??", "??", "??", "??", + "??", "??", "??", "??", "??", "??", "??", "??", + + //太鼓1P、システム(現行) + "??", "??", "??", "太鼓_赤", "太鼓_青", "太鼓_赤(大)", "太鼓_青(大)", "太鼓_黄", + "太鼓_黄(大)", "太鼓_風船", "太鼓_連打末端", "太鼓_芋", "??", "SCROLL", "ゴーゴータイム開始", "ゴーゴータイム終了", + + "??", "??", "??", "??", "??", "??", "??", "??", + "??", "??", "??", "??", "??", "??", "??", "太鼓 AD-LIB", + + "??", "??", "??", "??", "??", "??", "??", "??", + "??", "??", "??", "??", "??", "??", "??", "??", + + "??", "??", "??", "??", "0xC4", "0xC5", "0xC6", "??", + "??", "??", "0xCA", "??", "??", "??", "??", "0xCF", + + //システム(現行) + "0xD0", "??", "??", "??", "??", "??", "??", "??", + "??", "??", "ミキサー追加", "ミキサー削除", "DELAY", "譜面分岐リセット", "譜面分岐アニメ", "譜面分岐内部処理", + + //システム(現行) + "小節線ON/OFF", "分岐固定", "判定枠移動", "", "", "", "", "", + "", "", "", "", "", "", "", "", + + "0xF0", "歌詞", "??", "SUDDEN", "??", "??", "??", "??", + "??", "??", "??", "??", "??", "??", "??", "??", "譜面終了", + + // Extra notes + + "KaDon", "??", "??", "??", "??", "??", "??", "??", + "??", "??", "??", "??", "??", "??", "??", "??", + }; + return string.Format("CChip: 位置:{0:D4}.{1:D3}, 時刻{2:D6}, Ch:{3:X2}({4}), Pn:{5}({11})(内部{6}), Pd:{7}, Sz:{8}, BMScroll:{9}, Auto:{10}, コース:{11}", + this.n発声位置 / 384, this.n発声位置 % 384, + this.n発声時刻ms, + this.nチャンネル番号, chToStr[this.nチャンネル番号], + this.n整数値, this.n整数値_内部番号, + this.db実数値, + this.dbチップサイズ倍率, + this.fBMSCROLLTime, + this.b自動再生音チャンネルである, + this.nコース, + CDTX.tZZ(this.n整数値)); } - public class CLine { - public int n小節番号; - public int n文字数; - public double db発声時刻; - public double dbBMS時刻; - public ECourse nコース = ECourse.eNormal; - public int nタイプ; - } - - // Properties - - - public class CBranchStartInfo { - public int nMeasureCount; - public double dbTime; - public double dbBPM; - public double dbSCROLL; - public double dbSCROLLY; - public double dbBMScollTime; - public double db移動待機時刻; - public double db出現時刻; - public double db再生速度; - public float fMeasure_s; - public float fMeasure_m; - } - /// - /// 分岐開始時の情報を記録するためのあれ 2020.04.21 + /// チップの再生長を取得する。現状、WAVチップとBGAチップでのみ使用可能。 /// - public CBranchStartInfo cBranchStart = new CBranchStartInfo(); + /// 再生長(ms) + public int GetDuration() { + int nDuration = 0; - public int nBGMAdjust { - get; - private set; + if (this.nチャンネル番号 == 0x01) // WAV + { + CDTX.CWAV wc; + OpenTaiko.DTX.listWAV.TryGetValue(this.n整数値_内部番号, out wc); + if (wc == null) { + nDuration = 0; + } else { + nDuration = (wc.rSound[0] == null) ? 0 : wc.rSound[0].TotalPlayTime; + } + } else if (this.nチャンネル番号 == 0x54) // AVI + { + CVideoDecoder wc; + OpenTaiko.DTX.listVD.TryGetValue(this.n整数値_内部番号, out wc); + if (wc == null) { + nDuration = 0; + } else { + nDuration = (int)(wc.Duration * 1000); + } + } + + double _db再生速度 = OpenTaiko.DTX.db再生速度; + return (int)(nDuration / _db再生速度); } - public bool b分岐を一回でも開始した = false; //2020.04.22 akasoko26 分岐譜面のみ値を代入するように。 - - public int nPlayerSide; //2017.08.14 kairera0467 引数で指定する - public bool bSession譜面を読み込む; - public string ARTIST; - public string BACKGROUND; - public string BACKGROUND_GR; - public double BASEBPM; - public double BPM; - public double MinBPM; - public double MaxBPM; - public STチップがある bチップがある; - public string COMMENT; - public double db再生速度; - public string GENRE; - public string MAKER; - public string[] NOTESDESIGNER = new string[(int)Difficulty.Total] { "", "", "", "", "", "", "" }; - public bool EXPLICIT; - public string SELECTBG; - public bool HIDDENLEVEL; - public STDGBVALUE LEVEL; - public bool bLyrics; - public int[] LEVELtaiko = new int[(int)Difficulty.Total] { -1, -1, -1, -1, -1, -1, -1 }; - public ELevelIcon[] LEVELtaikoIcon = new ELevelIcon[(int)Difficulty.Total] { ELevelIcon.eNone, ELevelIcon.eNone, ELevelIcon.eNone, ELevelIcon.eNone, ELevelIcon.eNone, ELevelIcon.eNone, ELevelIcon.eNone }; - public ESide SIDE; - public CSongUniqueID uniqueID; - - // Tower lifes - public int LIFE; - public string TOWERTYPE; + #region [ IComparable 実装 ] + //----------------- - public int DANTICK = 0; - public Color DANTICKCOLOR = Color.White; + private static readonly byte[] n優先度 = new byte[] { + 5, 5, 3, 7, 5, 5, 5, 5, 3, 5, 5, 5, 5, 5, 5, 5, //0x00 + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, //0x10 + 7, 7, 7, 7, 7, 7, 7, 7, 5, 5, 5, 5, 5, 5, 5, 5, //0x20 + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, //0x30 + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, //0x40 + 9, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, //0x50 + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, //0x60 + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, //0x70 + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, //0x80 + 5, 5, 5, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 9, 9, 9, //0x90 + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, //0xA0 + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, //0xB0 + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, //0xC0 + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 3, 4, 4, //0xD0 + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, //0xE0 + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, //0xF0 + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, //0x100 + }; - public Dictionary listVD; - public Dictionary listBPM; - public List listChip; - public List[] listChip_Branch; - public Dictionary listWAV; - public Dictionary listSCROLL; - public Dictionary listSCROLL_Normal; - public Dictionary listSCROLL_Expert; - public Dictionary listSCROLL_Master; - public Dictionary listJPOSSCROLL; - public List List_DanSongs; - private EScrollMode eScrollMode; + public int CompareTo(CDTX.CChip other) { + // まずは位置で比較。 + //BGMチップだけ発声位置 + //if( this.nチャンネル番号 == 0x01 || this.nチャンネル番号 == 0x02 ) + //{ + // if( this.n発声位置 < other.n発声位置 ) + // return -1; + // if( this.n発声位置 > other.n発声位置 ) + // return 1; + //} - private double[] dbNowSCROLL_Normal; - private double[] dbNowSCROLL_Expert; - private double[] dbNowSCROLL_Master; + //if( this.n発声位置 < other.n発声位置 ) + // return -1; - private int nNextSongOffset; + //if( this.n発声位置 > other.n発声位置 ) + // return 1; - public Dictionary listDELAY; - public Dictionary listBRANCH; - public STLANEINT n可視チップ数; - public const int n最大音数 = 4; - public const int n小節の解像度 = 384; - public string PANEL; - public string PATH_WAV; - public string PREIMAGE; - public string PREVIEW; - public string strハッシュofDTXファイル; - public string strファイル名; - public string strファイル名の絶対パス; - public string strフォルダ名; - public CLocalizationData SUBTITLE = new CLocalizationData(); - public CLocalizationData TITLE = new CLocalizationData(); - public double dbDTXVPlaySpeed; - public double dbScrollSpeed; - public int nデモBGMオフセット; + //譜面解析メソッドV4では発声時刻msで比較する。 + var n発声時刻msCompareToResult = 0; + n発声時刻msCompareToResult = this.n発声時刻ms.CompareTo(other.n発声時刻ms); + if (n発声時刻msCompareToResult != 0) { + return n発声時刻msCompareToResult; + } - private int n現在の小節数 = 1; + n発声時刻msCompareToResult = this.db発声時刻ms.CompareTo(other.db発声時刻ms); + if (n発声時刻msCompareToResult != 0) { + return n発声時刻msCompareToResult; + } - private int nNowRoll = 0; - private int nNowRollCount = 0; - private int[] nNowRollCountBranch = new int[3]; - - private int[] n連打チップ_temp = new int[3]; - public int nOFFSET = 0; - private bool bOFFSETの値がマイナスである = false; - private int nMOVIEOFFSET = 0; - private bool bMOVIEOFFSETの値がマイナスである = false; - private double dbNowBPM = 120.0; - private int nDELAY = 0; - - public bool[] bHasBranch = new bool[(int)Difficulty.Total] { false, false, false, false, false, false, false }; - - public bool[] bHasBranchDan = new bool[1] { false }; - - //分岐関連 - private ECourse n現在のコース = ECourse.eNormal; - - private bool b最初の分岐である; - public int[] nノーツ数 = new int[4]; //3:共通 - - public int[] nDan_NotesCount = new int[1]; - public int[] nDan_BalloonCount = new int[1]; - // public int[] nDan_BallonCount = new int[1]; - - public int[] nノーツ数_Branch = new int[4]; // - public CChip[] pDan_LastChip; - public int[] n風船数 = new int[4]; //0~2:各コース 3:共通 - - private List listLine; - private int nLineCountTemp; //分岐開始時の小節数を記録。 - private ECourse nLineCountCourseTemp = ECourse.eNormal; //現在カウント中のコースを記録。 - - public int n参照中の難易度 = 3; - public int nScoreModeTmp = 99; //2017.01.28 DD - public int[,] nScoreInit = new int[2, (int)Difficulty.Total]; //[ x, y ] x=通常or真打 y=コース - public int[] nScoreDiff = new int[(int)Difficulty.Total]; //[y] - public bool[,] b配点が指定されている = new bool[3, (int)Difficulty.Total]; //2017.06.04 kairera0467 [ x, y ] x=通常(Init)or真打orDiff y=コース - - private double dbBarLength; - public float fNow_Measure_s = 4.0f; - public float fNow_Measure_m = 4.0f; - public double dbNowTime = 0.0; - public double dbNowBMScollTime = 0.0; - public double dbNowScroll = 1.0; - public double dbNowScrollY = 0.0; //2016.08.13 kairera0467 複素数スクロール - public double dbLastTime = 0.0; //直前の小節の開始時間 - public double dbLastBMScrollTime = 0.0; - - public int[] bBARLINECUE = new int[2]; //命令を入れた次の小節の操作を実現するためのフラグ。0 = mainflag, 1 = cuetype - public bool b小節線を挿入している = false; - - //Normal Regular Masterにしたいけどここは我慢。 - private List listBalloon_Normal; - private List listBalloon_Expert; - private List listBalloon_Master; - private List listBalloon; //旧構文用 - - public List listLyric; //歌詞を格納していくリスト。スペル忘れた(ぉい - public List listLyric2; - - //public Dictionary kusudaMAP = new Dictionary(); - - public bool usingLyricsFile; //If lyric file is used (VTT/LRC), ignore #LYRIC tags & do not parse other lyric file tags - - private int listBalloon_Normal_数値管理; - private int listBalloon_Expert_数値管理; - private int listBalloon_Master_数値管理; - - public string scenePreset; - - public bool[] b譜面が存在する = new bool[(int)Difficulty.Total]; - - private string[] dlmtSpace = { " " }; - private string[] dlmtEnter = { "\n" }; - private string[] dlmtCOURSE = { "COURSE:" }; - - private int nスクロール方向 = 0; - //2015.09.18 kairera0467 - //バタフライスライドみたいなアレをやりたいがために実装。 - //次郎2みたいな複素数とかは意味不明なので、方向を指定してスクロールさせることにした。 - //0:通常 - //1:上 - //2:下 - //3:右上 - //4:右下 - //5:左 - //6:左上 - //7:左下 - - public string strBGIMAGE_PATH; - public string strBGVIDEO_PATH; - - public double db出現時刻; - public double db移動待機時刻; - - public string strBGM_PATH; - public int SongVol; - public LoudnessMetadata? SongLoudnessMetadata; - - public bool bHIDDENBRANCH; //2016.04.01 kairera0467 選曲画面上、譜面分岐開始前まで譜面分岐の表示を隠す - public bool bGOGOTIME; //2018.03.11 kairera0467 - - public bool[] IsBranchBarDraw = new bool[4]; // 仕様変更により、黄色lineの表示法を変更.2020.04.21.akasoko26 - public bool IsEndedBranching = true; // BRANCHENDが呼び出されたかどうか - public Dan_C[] Dan_C; - - public bool IsEnabledFixSENote; - public int FixSENote; - public GaugeIncreaseMode GaugeIncreaseMode; - - #region [ EXTENDED VARiABLES ] - public Dictionary listObj; - public Dictionary listTextures; - public Dictionary listOriginalTextures; + // 位置が同じなら優先度で比較。 + return n優先度[this.nチャンネル番号].CompareTo(n優先度[other.nチャンネル番号]); + } + //----------------- #endregion - - - + /// + /// shallow copyです。 + /// + /// + public object Clone() { + return MemberwiseClone(); + } + } + public class CWAV : IDisposable { + public bool bBGMとして使う; + public List listこのWAVを使用するチャンネル番号の集合 = new List(16); + public int nチップサイズ = 100; + public int n位置; + public long[] n一時停止時刻 = new long[OpenTaiko.ConfigIni.nPoliphonicSounds]; // 4 + public int SongVol = CSound.DefaultSongVol; + public LoudnessMetadata? SongLoudnessMetadata = null; + public int n現在再生中のサウンド番号; + public long[] n再生開始時刻 = new long[OpenTaiko.ConfigIni.nPoliphonicSounds]; // 4 + public int n内部番号; + public int n表記上の番号; + public CSound[] rSound = new CSound[OpenTaiko.ConfigIni.nPoliphonicSounds]; // 4 + public string strコメント文 = ""; + public string strファイル名 = ""; + public bool bBGMとして使わない { + get { + return !this.bBGMとして使う; + } + set { + this.bBGMとして使う = !value; + } + } + public bool bIsBassSound = false; + public bool bIsGuitarSound = false; + public bool bIsDrumsSound = false; + public bool bIsSESound = false; + public bool bIsBGMSound = false; + + public override string ToString() { + var sb = new StringBuilder(128); + + if (this.n表記上の番号 == this.n内部番号) { + sb.Append(string.Format("CWAV{0}: ", CDTX.tZZ(this.n表記上の番号))); + } else { + sb.Append(string.Format("CWAV{0}(内部{1}): ", CDTX.tZZ(this.n表記上の番号), this.n内部番号)); + } + sb.Append( + $"{nameof(SongVol)}:{this.SongVol}, {nameof(LoudnessMetadata.Integrated)}:{this.SongLoudnessMetadata?.Integrated}, {nameof(LoudnessMetadata.TruePeak)}:{this.SongLoudnessMetadata?.TruePeak}, 位置:{this.n位置}, サイズ:{this.nチップサイズ}, BGM:{(this.bBGMとして使う ? 'Y' : 'N')}, File:{this.strファイル名}, Comment:{this.strコメント文}"); + + return sb.ToString(); + } + + #region [ Dispose-Finalize パターン実装 ] + //----------------- + public void Dispose() { + this.Dispose(true); + GC.SuppressFinalize(this); + } + public void Dispose(bool bManagedリソースの解放も行う) { + if (this.bDisposed済み) + return; + + if (bManagedリソースの解放も行う) { + for (int i = 0; i < OpenTaiko.ConfigIni.nPoliphonicSounds; i++) // 4 + { + if (this.rSound[i] != null) + OpenTaiko.SoundManager.tDisposeSound(this.rSound[i]); + this.rSound[i] = null; + + if ((i == 0) && OpenTaiko.ConfigIni.bOutputCreationReleaseLog) + Trace.TraceInformation("サウンドを解放しました。({0})({1})", this.strコメント文, this.strファイル名); + } + } + + this.bDisposed済み = true; + } + ~CWAV() { + this.Dispose(false); + } + //----------------- + #endregion + + #region [ private ] + //----------------- + private bool bDisposed済み; + //----------------- + #endregion + } + + [Serializable] + public class DanSongs { + [NonSerialized] + public CTexture TitleTex; + [NonSerialized] + public CTexture SubTitleTex; + public string Title; + public string SubTitle; + public string FileName; + public string Genre; + public int ScoreInit; + public int ScoreDiff; + public int Level; + public int Difficulty; + public static int Number = 0; + public bool bTitleShow; + public Dan_C[] Dan_C = new Dan_C[CExamInfo.cMaxExam]; + + [NonSerialized] + public CWAV Wave; + + public DanSongs() { + Number++; + } + } + + public struct STLYRIC { + public long Time; + public SKBitmap TextTex; + public string Text; + public int index; + } + + + // 構造体 + + public struct STLANEINT { + public int HH; + public int SD; + public int BD; + public int HT; + public int LT; + public int CY; + public int FT; + public int HHO; + public int RD; + public int LC; + public int LP; + public int LBD; + + public int Drums { + get { + return this.HH + this.SD + this.BD + this.HT + this.LT + this.CY + this.FT + this.HHO + this.RD + this.LC + this.LP + this.LBD; + } + } + public int Guitar; + public int Bass; + public int Taiko_Red; + public int Taiko_Blue; + + public int this[int index] { + get { + switch (index) { + case 0: + return this.HH; + + case 1: + return this.SD; + + case 2: + return this.BD; + + case 3: + return this.HT; + + case 4: + return this.LT; + + case 5: + return this.CY; + + case 6: + return this.FT; + + case 7: + return this.HHO; + + case 8: + return this.RD; + + case 9: + return this.LC; + + case 10: + return this.LP; + + case 11: + return this.LBD; + + case 12: + return this.Guitar; + + case 13: + return this.Bass; + + case 14: + return this.Taiko_Red; + + case 15: + return this.Taiko_Blue; + } + throw new IndexOutOfRangeException(); + } + set { + if (value < 0) { + throw new ArgumentOutOfRangeException(); + } + switch (index) { + case 0: + this.HH = value; + return; + + case 1: + this.SD = value; + return; + + case 2: + this.BD = value; + return; + + case 3: + this.HT = value; + return; + + case 4: + this.LT = value; + return; + + case 5: + this.CY = value; + return; + + case 6: + this.FT = value; + return; + + case 7: + this.HHO = value; + return; + + case 8: + this.RD = value; + return; + + case 9: + this.LC = value; + return; + + case 10: + this.LP = value; + return; + + case 11: + this.LBD = value; + return; + + case 12: + this.Guitar = value; + return; + + case 13: + this.Bass = value; + return; + + case 14: + this.Taiko_Red = value; + return; + + case 15: + this.Taiko_Blue = value; + return; + } + throw new IndexOutOfRangeException(); + } + } + } + public struct STRESULT { + public string SS; + public string S; + public string A; + public string B; + public string C; + public string D; + public string E; + + public string this[int index] { + get { + switch (index) { + case 0: + return this.SS; + + case 1: + return this.S; + + case 2: + return this.A; + + case 3: + return this.B; + + case 4: + return this.C; + + case 5: + return this.D; + + case 6: + return this.E; + } + throw new IndexOutOfRangeException(); + } + set { + switch (index) { + case 0: + this.SS = value; + return; + + case 1: + this.S = value; + return; + + case 2: + this.A = value; + return; + + case 3: + this.B = value; + return; + + case 4: + this.C = value; + return; + + case 5: + this.D = value; + return; + + case 6: + this.E = value; + return; + } + throw new IndexOutOfRangeException(); + } + } + } + public struct STチップがある { + public bool Drums; + public bool Guitar; + public bool Bass; + + public bool HHOpen; + public bool Ride; + public bool LeftCymbal; + public bool OpenGuitar; + public bool OpenBass; + + public bool Branch; + + public bool this[int index] { + get { + switch (index) { + case 0: + return this.Drums; + + case 1: + return this.Guitar; + + case 2: + return this.Bass; + + case 3: + return this.HHOpen; + + case 4: + return this.Ride; + + case 5: + return this.LeftCymbal; + + case 6: + return this.OpenGuitar; + + case 7: + return this.OpenBass; + + case 8: + return this.Branch; + } + throw new IndexOutOfRangeException(); + } + set { + switch (index) { + case 0: + this.Drums = value; + return; + + case 1: + this.Guitar = value; + return; + + case 2: + this.Bass = value; + return; + + case 3: + this.HHOpen = value; + return; + + case 4: + this.Ride = value; + return; + + case 5: + this.LeftCymbal = value; + return; + + case 6: + this.OpenGuitar = value; + return; + + case 7: + this.OpenBass = value; + return; + + case 8: + this.Branch = value; + return; + } + throw new IndexOutOfRangeException(); + } + } + } + public enum ECourse { + eNormal, + eExpert, + eMaster + } + + public enum ELevelIcon { + eMinus, + eNone, + ePlus + } + + public enum ESide { + eNormal, + eEx + } + public class CLine { + public int n小節番号; + public int n文字数; + public double db発声時刻; + public double dbBMS時刻; + public ECourse nコース = ECourse.eNormal; + public int nタイプ; + } + + // Properties + + + public class CBranchStartInfo { + public int nMeasureCount; + public double dbTime; + public double dbBPM; + public double dbSCROLL; + public double dbSCROLLY; + public double dbBMScollTime; + public double db移動待機時刻; + public double db出現時刻; + public double db再生速度; + public float fMeasure_s; + public float fMeasure_m; + } + + /// + /// 分岐開始時の情報を記録するためのあれ 2020.04.21 + /// + public CBranchStartInfo cBranchStart = new CBranchStartInfo(); + + public int nBGMAdjust { + get; + private set; + } + public bool b分岐を一回でも開始した = false; //2020.04.22 akasoko26 分岐譜面のみ値を代入するように。 + + public int nPlayerSide; //2017.08.14 kairera0467 引数で指定する + public bool bSession譜面を読み込む; + public string ARTIST; + public string BACKGROUND; + public string BACKGROUND_GR; + public double BASEBPM; + public double BPM; + public double MinBPM; + public double MaxBPM; + public STチップがある bチップがある; + public string COMMENT; + public double db再生速度; + public string GENRE; + public string MAKER; + public string[] NOTESDESIGNER = new string[(int)Difficulty.Total] { "", "", "", "", "", "", "" }; + public bool EXPLICIT; + public string SELECTBG; + public bool HIDDENLEVEL; + public STDGBVALUE LEVEL; + public bool bLyrics; + public int[] LEVELtaiko = new int[(int)Difficulty.Total] { -1, -1, -1, -1, -1, -1, -1 }; + public ELevelIcon[] LEVELtaikoIcon = new ELevelIcon[(int)Difficulty.Total] { ELevelIcon.eNone, ELevelIcon.eNone, ELevelIcon.eNone, ELevelIcon.eNone, ELevelIcon.eNone, ELevelIcon.eNone, ELevelIcon.eNone }; + public ESide SIDE; + public CSongUniqueID uniqueID; + + // Tower lifes + public int LIFE; + + public string TOWERTYPE; + + public int DANTICK = 0; + public Color DANTICKCOLOR = Color.White; + + public Dictionary listVD; + public Dictionary listBPM; + public List listChip; + public List[] listChip_Branch; + public Dictionary listWAV; + public Dictionary listSCROLL; + public Dictionary listSCROLL_Normal; + public Dictionary listSCROLL_Expert; + public Dictionary listSCROLL_Master; + public Dictionary listJPOSSCROLL; + public List List_DanSongs; + private EScrollMode eScrollMode; + + + + private double[] dbNowSCROLL_Normal; + private double[] dbNowSCROLL_Expert; + private double[] dbNowSCROLL_Master; + + private int nNextSongOffset; + + public Dictionary listDELAY; + public Dictionary listBRANCH; + public STLANEINT n可視チップ数; + public const int n最大音数 = 4; + public const int n小節の解像度 = 384; + public string PANEL; + public string PATH_WAV; + public string PREIMAGE; + public string PREVIEW; + public string strハッシュofDTXファイル; + public string strファイル名; + public string strファイル名の絶対パス; + public string strフォルダ名; + public CLocalizationData SUBTITLE = new CLocalizationData(); + public CLocalizationData TITLE = new CLocalizationData(); + public double dbDTXVPlaySpeed; + public double dbScrollSpeed; + public int nデモBGMオフセット; + + private int n現在の小節数 = 1; + + private int nNowRoll = 0; + private int nNowRollCount = 0; + private int[] nNowRollCountBranch = new int[3]; + + private int[] n連打チップ_temp = new int[3]; + public int nOFFSET = 0; + private bool bOFFSETの値がマイナスである = false; + private int nMOVIEOFFSET = 0; + private bool bMOVIEOFFSETの値がマイナスである = false; + private double dbNowBPM = 120.0; + private int nDELAY = 0; + + public bool[] bHasBranch = new bool[(int)Difficulty.Total] { false, false, false, false, false, false, false }; + + public bool[] bHasBranchDan = new bool[1] { false }; + + //分岐関連 + private ECourse n現在のコース = ECourse.eNormal; + + private bool b最初の分岐である; + public int[] nノーツ数 = new int[4]; //3:共通 + + public int[] nDan_NotesCount = new int[1]; + public int[] nDan_BalloonCount = new int[1]; + // public int[] nDan_BallonCount = new int[1]; + + public int[] nノーツ数_Branch = new int[4]; // + public CChip[] pDan_LastChip; + public int[] n風船数 = new int[4]; //0~2:各コース 3:共通 + + private List listLine; + private int nLineCountTemp; //分岐開始時の小節数を記録。 + private ECourse nLineCountCourseTemp = ECourse.eNormal; //現在カウント中のコースを記録。 + + public int n参照中の難易度 = 3; + public int nScoreModeTmp = 99; //2017.01.28 DD + public int[,] nScoreInit = new int[2, (int)Difficulty.Total]; //[ x, y ] x=通常or真打 y=コース + public int[] nScoreDiff = new int[(int)Difficulty.Total]; //[y] + public bool[,] b配点が指定されている = new bool[3, (int)Difficulty.Total]; //2017.06.04 kairera0467 [ x, y ] x=通常(Init)or真打orDiff y=コース + + private double dbBarLength; + public float fNow_Measure_s = 4.0f; + public float fNow_Measure_m = 4.0f; + public double dbNowTime = 0.0; + public double dbNowBMScollTime = 0.0; + public double dbNowScroll = 1.0; + public double dbNowScrollY = 0.0; //2016.08.13 kairera0467 複素数スクロール + public double dbLastTime = 0.0; //直前の小節の開始時間 + public double dbLastBMScrollTime = 0.0; + + public int[] bBARLINECUE = new int[2]; //命令を入れた次の小節の操作を実現するためのフラグ。0 = mainflag, 1 = cuetype + public bool b小節線を挿入している = false; + + //Normal Regular Masterにしたいけどここは我慢。 + private List listBalloon_Normal; + private List listBalloon_Expert; + private List listBalloon_Master; + private List listBalloon; //旧構文用 + + public List listLyric; //歌詞を格納していくリスト。スペル忘れた(ぉい + public List listLyric2; + + //public Dictionary kusudaMAP = new Dictionary(); + + public bool usingLyricsFile; //If lyric file is used (VTT/LRC), ignore #LYRIC tags & do not parse other lyric file tags + + private int listBalloon_Normal_数値管理; + private int listBalloon_Expert_数値管理; + private int listBalloon_Master_数値管理; + + public string scenePreset; + + public bool[] b譜面が存在する = new bool[(int)Difficulty.Total]; + + private string[] dlmtSpace = { " " }; + private string[] dlmtEnter = { "\n" }; + private string[] dlmtCOURSE = { "COURSE:" }; + + private int nスクロール方向 = 0; + //2015.09.18 kairera0467 + //バタフライスライドみたいなアレをやりたいがために実装。 + //次郎2みたいな複素数とかは意味不明なので、方向を指定してスクロールさせることにした。 + //0:通常 + //1:上 + //2:下 + //3:右上 + //4:右下 + //5:左 + //6:左上 + //7:左下 + + public string strBGIMAGE_PATH; + public string strBGVIDEO_PATH; + + public double db出現時刻; + public double db移動待機時刻; + + public string strBGM_PATH; + public int SongVol; + public LoudnessMetadata? SongLoudnessMetadata; + + public bool bHIDDENBRANCH; //2016.04.01 kairera0467 選曲画面上、譜面分岐開始前まで譜面分岐の表示を隠す + public bool bGOGOTIME; //2018.03.11 kairera0467 + + public bool[] IsBranchBarDraw = new bool[4]; // 仕様変更により、黄色lineの表示法を変更.2020.04.21.akasoko26 + public bool IsEndedBranching = true; // BRANCHENDが呼び出されたかどうか + public Dan_C[] Dan_C; + + public bool IsEnabledFixSENote; + public int FixSENote; + public GaugeIncreaseMode GaugeIncreaseMode; + + #region [ EXTENDED VARiABLES ] + public Dictionary listObj; + public Dictionary listTextures; + public Dictionary listOriginalTextures; + #endregion + + + #if TEST_NOTEOFFMODE public STLANEVALUE b演奏で直前の音を消音する; // public bool bHH演奏で直前のHHを消音する; // public bool bGUITAR演奏で直前のGUITARを消音する; // public bool bBASS演奏で直前のBASSを消音する; #endif - // Constructor - - public CDTX() { - this.nPlayerSide = 0; - this.TITLE.SetString("default", ""); - this.SUBTITLE.SetString("default", ""); - this.ARTIST = ""; - this.COMMENT = ""; - this.SIDE = ESide.eEx; - this.PANEL = ""; - this.GENRE = ""; - this.MAKER = ""; - this.EXPLICIT = false; - this.SELECTBG = ""; - this.bLyrics = false; - this.usingLyricsFile = false; - this.PREVIEW = ""; - this.PREIMAGE = ""; - this.BACKGROUND = ""; - this.BACKGROUND_GR = ""; - this.PATH_WAV = ""; - this.BPM = 120.0; - this.nOFFSET = OpenTaiko.ConfigIni.nGlobalOffsetMs; // When OFFSET isn't called (typically in Dans), it should default to the game's Global Offset to avoid desync. - this.bOFFSETの値がマイナスである = nOFFSET < 0; - STDGBVALUE stdgbvalue = new STDGBVALUE(); - stdgbvalue.Drums = 0; - stdgbvalue.Guitar = 0; - stdgbvalue.Bass = 0; - this.LEVEL = stdgbvalue; - this.bHIDDENBRANCH = false; - this.db再生速度 = 1.0; - this.bチップがある = new STチップがある(); - this.bチップがある.Drums = false; - this.bチップがある.Guitar = false; - this.bチップがある.Bass = false; - this.bチップがある.HHOpen = false; - this.bチップがある.Ride = false; - this.bチップがある.LeftCymbal = false; - this.bチップがある.OpenGuitar = false; - this.bチップがある.OpenBass = false; - this.strファイル名 = ""; - this.strフォルダ名 = ""; - this.strファイル名の絶対パス = ""; - this.n無限管理WAV = new int[36 * 36]; - this.n無限管理BPM = new int[36 * 36]; - this.n無限管理PAN = new int[36 * 36]; - this.n無限管理SIZE = new int[36 * 36]; - this.listBalloon_Normal_数値管理 = 0; - this.listBalloon_Expert_数値管理 = 0; - this.listBalloon_Master_数値管理 = 0; - this.nRESULTIMAGE用優先順位 = new int[7]; - this.nRESULTMOVIE用優先順位 = new int[7]; - this.nRESULTSOUND用優先順位 = new int[7]; - - #region [ 2011.1.1 yyagi GDA->DTX変換テーブル リファクタ後 ] - STGDAPARAM[] stgdaparamArray = new STGDAPARAM[] { // GDA->DTX conversion table - new STGDAPARAM("TC", 0x03), new STGDAPARAM("BL", 0x02), new STGDAPARAM("GS", 0x29), - new STGDAPARAM("DS", 0x30), new STGDAPARAM("FI", 0x53), new STGDAPARAM("HH", 0x11), - new STGDAPARAM("SD", 0x12), new STGDAPARAM("BD", 0x13), new STGDAPARAM("HT", 0x14), - new STGDAPARAM("LT", 0x15), new STGDAPARAM("CY", 0x16), new STGDAPARAM("G1", 0x21), - new STGDAPARAM("G2", 0x22), new STGDAPARAM("G3", 0x23), new STGDAPARAM("G4", 0x24), - new STGDAPARAM("G5", 0x25), new STGDAPARAM("G6", 0x26), new STGDAPARAM("G7", 0x27), - new STGDAPARAM("GW", 0x28), new STGDAPARAM("01", 0x61), new STGDAPARAM("02", 0x62), - new STGDAPARAM("03", 0x63), new STGDAPARAM("04", 0x64), new STGDAPARAM("05", 0x65), - new STGDAPARAM("06", 0x66), new STGDAPARAM("07", 0x67), new STGDAPARAM("08", 0x68), - new STGDAPARAM("09", 0x69), new STGDAPARAM("0A", 0x70), new STGDAPARAM("0B", 0x71), - new STGDAPARAM("0C", 0x72), new STGDAPARAM("0D", 0x73), new STGDAPARAM("0E", 0x74), - new STGDAPARAM("0F", 0x75), new STGDAPARAM("10", 0x76), new STGDAPARAM("11", 0x77), - new STGDAPARAM("12", 0x78), new STGDAPARAM("13", 0x79), new STGDAPARAM("14", 0x80), - new STGDAPARAM("15", 0x81), new STGDAPARAM("16", 0x82), new STGDAPARAM("17", 0x83), - new STGDAPARAM("18", 0x84), new STGDAPARAM("19", 0x85), new STGDAPARAM("1A", 0x86), - new STGDAPARAM("1B", 0x87), new STGDAPARAM("1C", 0x88), new STGDAPARAM("1D", 0x89), - new STGDAPARAM("1E", 0x90), new STGDAPARAM("1F", 0x91), new STGDAPARAM("20", 0x92), - new STGDAPARAM("B1", 0xA1), new STGDAPARAM("B2", 0xA2), new STGDAPARAM("B3", 0xA3), - new STGDAPARAM("B4", 0xA4), new STGDAPARAM("B5", 0xA5), new STGDAPARAM("B6", 0xA6), - new STGDAPARAM("B7", 0xA7), new STGDAPARAM("BW", 0xA8), new STGDAPARAM("G0", 0x20), - new STGDAPARAM("B0", 0xA0) - }; - this.stGDAParam = stgdaparamArray; - #endregion - this.nBGMAdjust = 0; - this.nPolyphonicSounds = OpenTaiko.ConfigIni.nPoliphonicSounds; - this.dbDTXVPlaySpeed = 1.0f; - - //this.nScoreModeTmp = 1; - for (int y = 0; y < (int)Difficulty.Total; y++) { - this.nScoreInit[0, y] = 300; - this.nScoreInit[1, y] = 1000; - this.nScoreDiff[y] = 120; - this.b配点が指定されている[0, y] = false; - this.b配点が指定されている[1, y] = false; - this.b配点が指定されている[2, y] = false; - } + // Constructor - this.dbBarLength = 1.0; + public CDTX() { + this.nPlayerSide = 0; + this.TITLE.SetString("default", ""); + this.SUBTITLE.SetString("default", ""); + this.ARTIST = ""; + this.COMMENT = ""; + this.SIDE = ESide.eEx; + this.PANEL = ""; + this.GENRE = ""; + this.MAKER = ""; + this.EXPLICIT = false; + this.SELECTBG = ""; + this.bLyrics = false; + this.usingLyricsFile = false; + this.PREVIEW = ""; + this.PREIMAGE = ""; + this.BACKGROUND = ""; + this.BACKGROUND_GR = ""; + this.PATH_WAV = ""; + this.BPM = 120.0; + this.nOFFSET = OpenTaiko.ConfigIni.nGlobalOffsetMs; // When OFFSET isn't called (typically in Dans), it should default to the game's Global Offset to avoid desync. + this.bOFFSETの値がマイナスである = nOFFSET < 0; + STDGBVALUE stdgbvalue = new STDGBVALUE(); + stdgbvalue.Drums = 0; + stdgbvalue.Guitar = 0; + stdgbvalue.Bass = 0; + this.LEVEL = stdgbvalue; + this.bHIDDENBRANCH = false; + this.db再生速度 = 1.0; + this.bチップがある = new STチップがある(); + this.bチップがある.Drums = false; + this.bチップがある.Guitar = false; + this.bチップがある.Bass = false; + this.bチップがある.HHOpen = false; + this.bチップがある.Ride = false; + this.bチップがある.LeftCymbal = false; + this.bチップがある.OpenGuitar = false; + this.bチップがある.OpenBass = false; + this.strファイル名 = ""; + this.strフォルダ名 = ""; + this.strファイル名の絶対パス = ""; + this.n無限管理WAV = new int[36 * 36]; + this.n無限管理BPM = new int[36 * 36]; + this.n無限管理PAN = new int[36 * 36]; + this.n無限管理SIZE = new int[36 * 36]; + this.listBalloon_Normal_数値管理 = 0; + this.listBalloon_Expert_数値管理 = 0; + this.listBalloon_Master_数値管理 = 0; + this.nRESULTIMAGE用優先順位 = new int[7]; + this.nRESULTMOVIE用優先順位 = new int[7]; + this.nRESULTSOUND用優先順位 = new int[7]; - this.b最初の分岐である = true; + #region [ 2011.1.1 yyagi GDA->DTX変換テーブル リファクタ後 ] + STGDAPARAM[] stgdaparamArray = new STGDAPARAM[] { // GDA->DTX conversion table + new STGDAPARAM("TC", 0x03), new STGDAPARAM("BL", 0x02), new STGDAPARAM("GS", 0x29), + new STGDAPARAM("DS", 0x30), new STGDAPARAM("FI", 0x53), new STGDAPARAM("HH", 0x11), + new STGDAPARAM("SD", 0x12), new STGDAPARAM("BD", 0x13), new STGDAPARAM("HT", 0x14), + new STGDAPARAM("LT", 0x15), new STGDAPARAM("CY", 0x16), new STGDAPARAM("G1", 0x21), + new STGDAPARAM("G2", 0x22), new STGDAPARAM("G3", 0x23), new STGDAPARAM("G4", 0x24), + new STGDAPARAM("G5", 0x25), new STGDAPARAM("G6", 0x26), new STGDAPARAM("G7", 0x27), + new STGDAPARAM("GW", 0x28), new STGDAPARAM("01", 0x61), new STGDAPARAM("02", 0x62), + new STGDAPARAM("03", 0x63), new STGDAPARAM("04", 0x64), new STGDAPARAM("05", 0x65), + new STGDAPARAM("06", 0x66), new STGDAPARAM("07", 0x67), new STGDAPARAM("08", 0x68), + new STGDAPARAM("09", 0x69), new STGDAPARAM("0A", 0x70), new STGDAPARAM("0B", 0x71), + new STGDAPARAM("0C", 0x72), new STGDAPARAM("0D", 0x73), new STGDAPARAM("0E", 0x74), + new STGDAPARAM("0F", 0x75), new STGDAPARAM("10", 0x76), new STGDAPARAM("11", 0x77), + new STGDAPARAM("12", 0x78), new STGDAPARAM("13", 0x79), new STGDAPARAM("14", 0x80), + new STGDAPARAM("15", 0x81), new STGDAPARAM("16", 0x82), new STGDAPARAM("17", 0x83), + new STGDAPARAM("18", 0x84), new STGDAPARAM("19", 0x85), new STGDAPARAM("1A", 0x86), + new STGDAPARAM("1B", 0x87), new STGDAPARAM("1C", 0x88), new STGDAPARAM("1D", 0x89), + new STGDAPARAM("1E", 0x90), new STGDAPARAM("1F", 0x91), new STGDAPARAM("20", 0x92), + new STGDAPARAM("B1", 0xA1), new STGDAPARAM("B2", 0xA2), new STGDAPARAM("B3", 0xA3), + new STGDAPARAM("B4", 0xA4), new STGDAPARAM("B5", 0xA5), new STGDAPARAM("B6", 0xA6), + new STGDAPARAM("B7", 0xA7), new STGDAPARAM("BW", 0xA8), new STGDAPARAM("G0", 0x20), + new STGDAPARAM("B0", 0xA0) + }; + this.stGDAParam = stgdaparamArray; + #endregion + this.nBGMAdjust = 0; + this.nPolyphonicSounds = OpenTaiko.ConfigIni.nPoliphonicSounds; + this.dbDTXVPlaySpeed = 1.0f; - this.SongVol = CSound.DefaultSongVol; - this.SongLoudnessMetadata = null; + //this.nScoreModeTmp = 1; + for (int y = 0; y < (int)Difficulty.Total; y++) { + this.nScoreInit[0, y] = 300; + this.nScoreInit[1, y] = 1000; + this.nScoreDiff[y] = 120; + this.b配点が指定されている[0, y] = false; + this.b配点が指定されている[1, y] = false; + this.b配点が指定されている[2, y] = false; + } + + this.dbBarLength = 1.0; + + this.b最初の分岐である = true; + + this.SongVol = CSound.DefaultSongVol; + this.SongLoudnessMetadata = null; + + GaugeIncreaseMode = GaugeIncreaseMode.Normal; - GaugeIncreaseMode = GaugeIncreaseMode.Normal; - #if TEST_NOTEOFFMODE this.bHH演奏で直前のHHを消音する = true; this.bGUITAR演奏で直前のGUITARを消音する = true; this.bBASS演奏で直前のBASSを消音する = true; #endif - - Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture; // Change default culture to invariant, fixes (Purota) - Dan_C = new Dan_C[CExamInfo.cMaxExam]; - pDan_LastChip = new CChip[1]; - DanSongs.Number = 0; - } - public CDTX(string strファイル名, bool bヘッダのみ, double db再生速度, int nBGMAdjust, int difficulty) - : this() { - this.Activate(); - this.t入力(strファイル名, bヘッダのみ, db再生速度, nBGMAdjust, 0, 0, false, difficulty); - } - public CDTX(string strファイル名, bool bヘッダのみ, double db再生速度, int nBGMAdjust, int nReadVersionUnused, int nPlayerSide, bool bSession, int difficulty) - : this() { - this.Activate(); - this.t入力(strファイル名, bヘッダのみ, db再生速度, nBGMAdjust, nReadVersionUnused, nPlayerSide, bSession, difficulty); - } - - - // メソッド - - public void tAVIの読み込み() { - if (!this.bヘッダのみ) { - if (this.listVD != null) { - foreach (CVideoDecoder cvd in this.listVD.Values) { - cvd.InitRead(); - cvd.dbPlaySpeed = OpenTaiko.ConfigIni.SongPlaybackSpeed; - } + Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture; // Change default culture to invariant, fixes (Purota) + Dan_C = new Dan_C[CExamInfo.cMaxExam]; + pDan_LastChip = new CChip[1]; + DanSongs.Number = 0; + + } + public CDTX(string strファイル名, bool bヘッダのみ, double db再生速度, int nBGMAdjust, int difficulty) + : this() { + this.Activate(); + this.t入力(strファイル名, bヘッダのみ, db再生速度, nBGMAdjust, 0, 0, false, difficulty); + } + public CDTX(string strファイル名, bool bヘッダのみ, double db再生速度, int nBGMAdjust, int nReadVersionUnused, int nPlayerSide, bool bSession, int difficulty) + : this() { + this.Activate(); + this.t入力(strファイル名, bヘッダのみ, db再生速度, nBGMAdjust, nReadVersionUnused, nPlayerSide, bSession, difficulty); + } + + + // メソッド + + public void tAVIの読み込み() { + if (!this.bヘッダのみ) { + if (this.listVD != null) { + foreach (CVideoDecoder cvd in this.listVD.Values) { + cvd.InitRead(); + cvd.dbPlaySpeed = OpenTaiko.ConfigIni.SongPlaybackSpeed; } } } + } - public void tWave再生位置自動補正() { - foreach (CWAV cwav in this.listWAV.Values) { - this.tWave再生位置自動補正(cwav); - } + public void tWave再生位置自動補正() { + foreach (CWAV cwav in this.listWAV.Values) { + this.tWave再生位置自動補正(cwav); } - public void tWave再生位置自動補正(CWAV wc) { - if (wc.rSound[0] != null && wc.rSound[0].TotalPlayTime >= 5000) { - for (int i = 0; i < nPolyphonicSounds; i++) { - if ((wc.rSound[i] != null) && (wc.rSound[i].IsPlaying)) { - long nCurrentTime = SoundManager.PlayTimer.SystemTimeMs; - if (nCurrentTime > wc.n再生開始時刻[i]) { - long nAbsTimeFromStartPlaying = nCurrentTime - wc.n再生開始時刻[i]; - // WASAPI/ASIO用↓ - if (!OpenTaiko.stage演奏ドラム画面.bPAUSE) { - if (wc.rSound[i].IsPaused) wc.rSound[i].Resume(nAbsTimeFromStartPlaying); - else wc.rSound[i].tSetPositonToBegin(nAbsTimeFromStartPlaying); - } else { - wc.rSound[i].Pause(); - } - } - } - } - } - } - public void tWavの再生停止(int nWaveの内部番号) { - tWavの再生停止(nWaveの内部番号, false); - } - public void tWavの再生停止(int nWaveの内部番号, bool bミキサーからも削除する) { - if (this.listWAV.TryGetValue(nWaveの内部番号, out CWAV cwav)) { - for (int i = 0; i < nPolyphonicSounds; i++) { - if (cwav.rSound[i] != null && cwav.rSound[i].IsPlaying) { - if (bミキサーからも削除する) { - cwav.rSound[i].tStopSoundAndRemoveSoundFromMixer(); + } + public void tWave再生位置自動補正(CWAV wc) { + if (wc.rSound[0] != null && wc.rSound[0].TotalPlayTime >= 5000) { + for (int i = 0; i < nPolyphonicSounds; i++) { + if ((wc.rSound[i] != null) && (wc.rSound[i].IsPlaying)) { + long nCurrentTime = SoundManager.PlayTimer.SystemTimeMs; + if (nCurrentTime > wc.n再生開始時刻[i]) { + long nAbsTimeFromStartPlaying = nCurrentTime - wc.n再生開始時刻[i]; + // WASAPI/ASIO用↓ + if (!OpenTaiko.stage演奏ドラム画面.bPAUSE) { + if (wc.rSound[i].IsPaused) wc.rSound[i].Resume(nAbsTimeFromStartPlaying); + else wc.rSound[i].tSetPositonToBegin(nAbsTimeFromStartPlaying); } else { - cwav.rSound[i].Stop(); + wc.rSound[i].Pause(); } } } } } - public void tWAVの読み込み(CWAV cwav) { - string str = string.IsNullOrEmpty(this.PATH_WAV) ? this.strフォルダ名 : this.PATH_WAV; - str = str + cwav.strファイル名; - - try { - #region [ 同時発音数を、チャンネルによって変える ] - - int nPoly = nPolyphonicSounds; - if (OpenTaiko.SoundManager.GetCurrentSoundDeviceType() != "DirectSound") // DShowでの再生の場合はミキシング負荷が高くないため、 - { - // チップのライフタイム管理を行わない - if (cwav.bIsBassSound) nPoly = (nPolyphonicSounds >= 2) ? 2 : 1; - else if (cwav.bIsGuitarSound) nPoly = (nPolyphonicSounds >= 2) ? 2 : 1; - else if (cwav.bIsSESound) nPoly = 1; - else if (cwav.bIsBGMSound) nPoly = 1; - } - - if (cwav.bIsBGMSound) nPoly = 1; - - #endregion - - for (int i = 0; i < nPoly; i++) { - try { - cwav.rSound[i] = OpenTaiko.SoundManager.tCreateSound(str, ESoundGroup.SongPlayback); - - if (!OpenTaiko.ConfigIni.bDynamicBassMixerManagement) { - cwav.rSound[i].AddBassSoundFromMixer(); - } - - if (OpenTaiko.ConfigIni.bOutputCreationReleaseLog) { - Trace.TraceInformation("サウンドを作成しました。({3})({0})({1})({2}bytes)", cwav.strコメント文, str, - cwav.rSound[0].SoundBufferSize, cwav.rSound[0].IsStreamPlay ? "Stream" : "OnMemory"); - } - } catch (Exception e) { - cwav.rSound[i] = null; - Trace.TraceError("サウンドの作成に失敗しました。({0})({1})", cwav.strコメント文, str); - Trace.TraceError(e.ToString()); + } + public void tWavの再生停止(int nWaveの内部番号) { + tWavの再生停止(nWaveの内部番号, false); + } + public void tWavの再生停止(int nWaveの内部番号, bool bミキサーからも削除する) { + if (this.listWAV.TryGetValue(nWaveの内部番号, out CWAV cwav)) { + for (int i = 0; i < nPolyphonicSounds; i++) { + if (cwav.rSound[i] != null && cwav.rSound[i].IsPlaying) { + if (bミキサーからも削除する) { + cwav.rSound[i].tStopSoundAndRemoveSoundFromMixer(); + } else { + cwav.rSound[i].Stop(); } } - } catch (Exception exception) { - Trace.TraceError("サウンドの生成に失敗しました。({0})({1})", cwav.strコメント文, str); - Trace.TraceError(exception.ToString()); - - for (int j = 0; j < nPolyphonicSounds; j++) { - cwav.rSound[j] = null; - } - - //continue; } } + } + public void tWAVの読み込み(CWAV cwav) { + string str = string.IsNullOrEmpty(this.PATH_WAV) ? this.strフォルダ名 : this.PATH_WAV; + str = str + cwav.strファイル名; - public static string tZZ(int n) { - if (n < 0 || n >= 36 * 36) - return "!!"; // オーバー/アンダーフロー。 - - // n を36進数2桁の文字列にして返す。 - - string str = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; - return new string(new char[] { str[n / 36], str[n % 36] }); - } + try { + #region [ 同時発音数を、チャンネルによって変える ] - public void tApplyFunMods(int player = 0) { - Random rnd = new System.Random(); + int nPoly = nPolyphonicSounds; + if (OpenTaiko.SoundManager.GetCurrentSoundDeviceType() != "DirectSound") // DShowでの再生の場合はミキシング負荷が高くないため、 + { + // チップのライフタイム管理を行わない + if (cwav.bIsBassSound) nPoly = (nPolyphonicSounds >= 2) ? 2 : 1; + else if (cwav.bIsGuitarSound) nPoly = (nPolyphonicSounds >= 2) ? 2 : 1; + else if (cwav.bIsSESound) nPoly = 1; + else if (cwav.bIsBGMSound) nPoly = 1; + } - var eFun = OpenTaiko.ConfigIni.nFunMods[OpenTaiko.GetActualPlayer(player)]; - var chara = OpenTaiko.Tx.Characters[OpenTaiko.SaveFileInstances[OpenTaiko.GetActualPlayer(player)].data.Character]; + if (cwav.bIsBGMSound) nPoly = 1; - var bombFactor = Math.Max(1, Math.Min(100, chara.effect.BombFactor)); - var fuseRollFactor = Math.Max(0, Math.Min(100, chara.effect.FuseRollFactor)); + #endregion - switch (eFun) { - case EFunMods.Minesweeper: - foreach (var chip in this.listChip) { - if (NotesManager.IsMissableNote(chip)) { - int n = rnd.Next(100); - - if (n < bombFactor) chip.nチャンネル番号 = 0x1C; - } - - if (NotesManager.IsBalloon(chip)) { - int n = rnd.Next(100); - - if (n < fuseRollFactor) chip.nチャンネル番号 = 0x1D; - } + for (int i = 0; i < nPoly; i++) { + try { + cwav.rSound[i] = OpenTaiko.SoundManager.tCreateSound(str, ESoundGroup.SongPlayback); + if (!OpenTaiko.ConfigIni.bDynamicBassMixerManagement) { + cwav.rSound[i].AddBassSoundFromMixer(); } - break; - case EFunMods.Avalanche: - foreach (var chip in this.listChip) { + + if (OpenTaiko.ConfigIni.bOutputCreationReleaseLog) { + Trace.TraceInformation("サウンドを作成しました。({3})({0})({1})({2}bytes)", cwav.strコメント文, str, + cwav.rSound[0].SoundBufferSize, cwav.rSound[0].IsStreamPlay ? "Stream" : "OnMemory"); + } + } catch (Exception e) { + cwav.rSound[i] = null; + Trace.TraceError("サウンドの作成に失敗しました。({0})({1})", cwav.strコメント文, str); + Trace.TraceError(e.ToString()); + } + } + } catch (Exception exception) { + Trace.TraceError("サウンドの生成に失敗しました。({0})({1})", cwav.strコメント文, str); + Trace.TraceError(exception.ToString()); + + for (int j = 0; j < nPolyphonicSounds; j++) { + cwav.rSound[j] = null; + } + + //continue; + } + } + + public static string tZZ(int n) { + if (n < 0 || n >= 36 * 36) + return "!!"; // オーバー/アンダーフロー。 + + // n を36進数2桁の文字列にして返す。 + + string str = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; + return new string(new char[] { str[n / 36], str[n % 36] }); + } + + public void tApplyFunMods(int player = 0) { + Random rnd = new System.Random(); + + var eFun = OpenTaiko.ConfigIni.nFunMods[OpenTaiko.GetActualPlayer(player)]; + var chara = OpenTaiko.Tx.Characters[OpenTaiko.SaveFileInstances[OpenTaiko.GetActualPlayer(player)].data.Character]; + + var bombFactor = Math.Max(1, Math.Min(100, chara.effect.BombFactor)); + var fuseRollFactor = Math.Max(0, Math.Min(100, chara.effect.FuseRollFactor)); + + switch (eFun) { + case EFunMods.Minesweeper: + foreach (var chip in this.listChip) { + if (NotesManager.IsMissableNote(chip)) { int n = rnd.Next(100); - - chip.dbSCROLL *= (n + 50) / (double)100; + if (n < bombFactor) chip.nチャンネル番号 = 0x1C; } - break; - case EFunMods.None: - default: - break; - } + + if (NotesManager.IsBalloon(chip)) { + int n = rnd.Next(100); + + if (n < fuseRollFactor) chip.nチャンネル番号 = 0x1D; + } + + } + break; + case EFunMods.Avalanche: + foreach (var chip in this.listChip) { + int n = rnd.Next(100); + + + chip.dbSCROLL *= (n + 50) / (double)100; + } + break; + case EFunMods.None: + default: + break; } + } - public void tRandomizeTaikoChips(int player = 0) { - //2016.02.11 kairera0467 - Random rnd = new System.Random(); + public void tRandomizeTaikoChips(int player = 0) { + //2016.02.11 kairera0467 + Random rnd = new System.Random(); - var eRandom = OpenTaiko.ConfigIni.eRandom[OpenTaiko.GetActualPlayer(player)]; + var eRandom = OpenTaiko.ConfigIni.eRandom[OpenTaiko.GetActualPlayer(player)]; - switch (eRandom) { - case ERandomMode.Mirror: - foreach (var chip in this.listChip) { + switch (eRandom) { + case ERandomMode.Mirror: + foreach (var chip in this.listChip) { + switch (chip.nチャンネル番号) { + case 0x11: + chip.nチャンネル番号 = 0x12; + break; + case 0x12: + chip.nチャンネル番号 = 0x11; + break; + case 0x13: + chip.nチャンネル番号 = 0x14; + chip.nSenote = 6; + break; + case 0x14: + chip.nチャンネル番号 = 0x13; + chip.nSenote = 5; + break; + } + } + break; + case ERandomMode.Random: + foreach (var chip in this.listChip) { + int n = rnd.Next(100); + + if (n >= 0 && n <= 20) { switch (chip.nチャンネル番号) { case 0x11: chip.nチャンネル番号 = 0x12; @@ -1485,3546 +1509,1175 @@ namespace OpenTaiko { break; } } - break; - case ERandomMode.Random: - foreach (var chip in this.listChip) { - int n = rnd.Next(100); - - if (n >= 0 && n <= 20) { - switch (chip.nチャンネル番号) { - case 0x11: - chip.nチャンネル番号 = 0x12; - break; - case 0x12: - chip.nチャンネル番号 = 0x11; - break; - case 0x13: - chip.nチャンネル番号 = 0x14; - chip.nSenote = 6; - break; - case 0x14: - chip.nチャンネル番号 = 0x13; - chip.nSenote = 5; - break; - } - } - } - break; - case ERandomMode.SuperRandom: - foreach (var chip in this.listChip) { - int n = rnd.Next(100); - - if (n >= 0 && n <= 50) { - switch (chip.nチャンネル番号) { - case 0x11: - chip.nチャンネル番号 = 0x12; - break; - case 0x12: - chip.nチャンネル番号 = 0x11; - break; - case 0x13: - chip.nチャンネル番号 = 0x14; - chip.nSenote = 6; - break; - case 0x14: - chip.nチャンネル番号 = 0x13; - chip.nSenote = 5; - break; - } - } - } - break; - case ERandomMode.MirrorRandom: - foreach (var chip in this.listChip) { - int n = rnd.Next(100); - - if (n >= 0 && n <= 80) { - switch (chip.nチャンネル番号) { - case 0x11: - chip.nチャンネル番号 = 0x12; - break; - case 0x12: - chip.nチャンネル番号 = 0x11; - break; - case 0x13: - chip.nチャンネル番号 = 0x14; - chip.nSenote = 6; - break; - case 0x14: - chip.nチャンネル番号 = 0x13; - chip.nSenote = 5; - break; - } - } - } - break; - case ERandomMode.Off: - default: - break; - } - - if (OpenTaiko.Tx.Puchichara[PuchiChara.tGetPuchiCharaIndexByName(OpenTaiko.GetActualPlayer(nPlayerSide))].effect.AllPurple) { + } + break; + case ERandomMode.SuperRandom: foreach (var chip in this.listChip) { - switch (chip.nチャンネル番号) { - case 0x13: - case 0x1A: - chip.nチャンネル番号 = 0x101; - break; - case 0x14: - case 0x1B: - chip.nチャンネル番号 = 0x101; - break; + int n = rnd.Next(100); + + if (n >= 0 && n <= 50) { + switch (chip.nチャンネル番号) { + case 0x11: + chip.nチャンネル番号 = 0x12; + break; + case 0x12: + chip.nチャンネル番号 = 0x11; + break; + case 0x13: + chip.nチャンネル番号 = 0x14; + chip.nSenote = 6; + break; + case 0x14: + chip.nチャンネル番号 = 0x13; + chip.nSenote = 5; + break; + } } } - } + break; + case ERandomMode.MirrorRandom: + foreach (var chip in this.listChip) { + int n = rnd.Next(100); - if (eRandom != ERandomMode.Off) { - #region[ list作成 ] - //ひとまずチップだけのリストを作成しておく。 - List list音符のみのリスト; - list音符のみのリスト = new List(); + if (n >= 0 && n <= 80) { + switch (chip.nチャンネル番号) { + case 0x11: + chip.nチャンネル番号 = 0x12; + break; + case 0x12: + chip.nチャンネル番号 = 0x11; + break; + case 0x13: + chip.nチャンネル番号 = 0x14; + chip.nSenote = 6; + break; + case 0x14: + chip.nチャンネル番号 = 0x13; + chip.nSenote = 5; + break; + } + } + } + break; + case ERandomMode.Off: + default: + break; + } + + if (OpenTaiko.Tx.Puchichara[PuchiChara.tGetPuchiCharaIndexByName(OpenTaiko.GetActualPlayer(nPlayerSide))].effect.AllPurple) { + foreach (var chip in this.listChip) { + switch (chip.nチャンネル番号) { + case 0x13: + case 0x1A: + chip.nチャンネル番号 = 0x101; + break; + case 0x14: + case 0x1B: + chip.nチャンネル番号 = 0x101; + break; + } + } + } + + if (eRandom != ERandomMode.Off) { + #region[ list作成 ] + //ひとまずチップだけのリストを作成しておく。 + List list音符のみのリスト; + list音符のみのリスト = new List(); + int nCount = 0; + int dkdkCount = 0; + + foreach (CChip chip in this.listChip) { + if (chip.nチャンネル番号 >= 0x11 && chip.nチャンネル番号 < 0x18) { + list音符のみのリスト.Add(chip); + } + } + #endregion + + this.tSenotes_Core_V2(list音符のみのリスト); + } + } + + #region [ チップの再生と停止 ] + public void tチップの再生(CChip pChip, long n再生開始システム時刻ms) { + if (OpenTaiko.ConfigIni.bNoAudioIfNot1xSpeed && OpenTaiko.ConfigIni.nSongSpeed != 20) + return; + + if (pChip.n整数値_内部番号 >= 0) { + if (this.listWAV.TryGetValue(pChip.n整数値_内部番号, out CWAV wc)) { + int index = wc.n現在再生中のサウンド番号 = (wc.n現在再生中のサウンド番号 + 1) % nPolyphonicSounds; + if ((wc.rSound[0] != null) && + (wc.rSound[0].IsStreamPlay || wc.rSound[index] == null)) { + index = wc.n現在再生中のサウンド番号 = 0; + } + CSound sound = wc.rSound[index]; + if (sound != null) { + sound.PlaySpeed = OpenTaiko.ConfigIni.SongPlaybackSpeed; + // 再生速度によって、WASAPI/ASIOで使う使用mixerが決まるため、付随情報の設定(音量/PAN)は、再生速度の設定後に行う + + // 2018-08-27 twopointzero - DON'T attempt to load (or queue scanning) loudness metadata here. + // This code is called right after loading the .tja, and that code + // will have just made such an attempt. + OpenTaiko.SongGainController.Set(wc.SongVol, wc.SongLoudnessMetadata, sound); + + sound.SoundPosition = wc.n位置; + sound.PlayStart(); + } + wc.n再生開始時刻[wc.n現在再生中のサウンド番号] = n再生開始システム時刻ms; + this.tWave再生位置自動補正(wc); + } + } + } + public void t各自動再生音チップの再生時刻を変更する(int nBGMAdjustの増減値) { + this.nBGMAdjust += nBGMAdjustの増減値; + + for (int i = 0; i < this.listChip.Count; i++) { + int nChannelNumber = this.listChip[i].nチャンネル番号; + if ((( + (nChannelNumber == 1) || + ((0x61 <= nChannelNumber) && (nChannelNumber <= 0x69)) + ) || + ((0x70 <= nChannelNumber) && (nChannelNumber <= 0x79)) + ) || + (((0x80 <= nChannelNumber) && (nChannelNumber <= 0x89)) || ((0x90 <= nChannelNumber) && (nChannelNumber <= 0x92))) + ) { + this.listChip[i].n発声時刻ms += nBGMAdjustの増減値; + } + } + foreach (CWAV cwav in this.listWAV.Values) { + for (int j = 0; j < nPolyphonicSounds; j++) { + if ((cwav.rSound[j] != null) && cwav.rSound[j].IsPlaying) { + cwav.n再生開始時刻[j] += nBGMAdjustの増減値; + } + } + } + } + public void t全チップの再生一時停止() { + foreach (CWAV cwav in this.listWAV.Values) { + for (int i = 0; i < nPolyphonicSounds; i++) { + if ((cwav.rSound[i] != null) && cwav.rSound[i].IsPlaying) { + cwav.rSound[i].Pause(); + cwav.n一時停止時刻[i] = SoundManager.PlayTimer.SystemTimeMs; + } + } + } + } + public void t全チップの再生再開() { + foreach (CWAV cwav in this.listWAV.Values) { + for (int i = 0; i < nPolyphonicSounds; i++) { + if ((cwav.rSound[i] != null) && cwav.rSound[i].IsPaused) { + cwav.rSound[i].Resume(cwav.n一時停止時刻[i] - cwav.n再生開始時刻[i]); + cwav.n再生開始時刻[i] += SoundManager.PlayTimer.SystemTimeMs - cwav.n一時停止時刻[i]; + } + } + } + } + public void t全チップの再生停止() { + foreach (CWAV cwav in this.listWAV.Values) { + this.tWavの再生停止(cwav.n内部番号); + } + } + public void t全チップの再生停止とミキサーからの削除() { + foreach (CWAV cwav in this.listWAV.Values) { + this.tWavの再生停止(cwav.n内部番号, true); + } + } + #endregion + + public void t入力(string strファイル名, bool bヘッダのみ, double db再生速度, int nBGMAdjust, int nReadVersionUnused, int nPlayerSide, bool bSession, int difficulty) { + this.bヘッダのみ = bヘッダのみ; + this.strファイル名の絶対パス = Path.GetFullPath(strファイル名); + this.strファイル名 = Path.GetFileName(this.strファイル名の絶対パス); + this.strフォルダ名 = Path.GetDirectoryName(this.strファイル名の絶対パス) + Path.DirectorySeparatorChar; + + // Unique ID parsing/generation + this.uniqueID = new CSongUniqueID(this.strフォルダ名 + @$"{Path.DirectorySeparatorChar}uniqueID.json"); + + try { + this.nPlayerSide = nPlayerSide; + this.bSession譜面を読み込む = bSession; + //次郎方式 + StreamReader reader = new StreamReader(strファイル名, Encoding.GetEncoding(OpenTaiko.sEncType)); + string str2 = reader.ReadToEnd(); + reader.Close(); + this.t入力_全入力文字列から(str2, str2, db再生速度, nBGMAdjust, difficulty); + } catch (Exception ex) { + Trace.TraceError("おや?エラーが出たようです。お兄様。"); + Trace.TraceError(ex.ToString()); + Trace.TraceError("例外が発生しましたが処理を継続します。 (79ff8639-9b3c-477f-bc4a-f2eea9784860)"); + } + } + public void t入力_全入力文字列から(string str全入力文字列, string str1Unused, double db再生速度, int nBGMAdjust, int Difficulty) { + if (!string.IsNullOrEmpty(str全入力文字列)) { + #region [ 改行カット ] + this.db再生速度 = db再生速度; + #endregion + #region [ 初期化 ] + for (int j = 0; j < 36 * 36; j++) { + this.n無限管理WAV[j] = -j; + this.n無限管理BPM[j] = -j; + this.n無限管理PAN[j] = -10000 - j; + this.n無限管理SIZE[j] = -j; + } + this.n内部番号WAV1to = 1; + this.n内部番号BPM1to = 1; + this.bstackIFからENDIFをスキップする = new Stack(); + this.bstackIFからENDIFをスキップする.Push(false); + this.n現在の乱数 = 0; + for (int k = 0; k < 7; k++) { + this.nRESULTIMAGE用優先順位[k] = 0; + this.nRESULTMOVIE用優先順位[k] = 0; + this.nRESULTSOUND用優先順位[k] = 0; + } + #endregion + #region [ 入力/行解析 ] + #region[初期化] + this.dbNowScroll = 1.0; + this.dbNowSCROLL_Normal = new double[] { 1.0, 0.0 }; + this.dbNowSCROLL_Expert = new double[] { 1.0, 0.0 }; + this.dbNowSCROLL_Master = new double[] { 1.0, 0.0 }; + this.n現在のコース = ECourse.eNormal; + #endregion + this.t入力_V4(str全入力文字列, Difficulty); + + #endregion + this.n無限管理WAV = null; + this.n無限管理BPM = null; + this.n無限管理PAN = null; + this.n無限管理SIZE = null; + if (!this.bヘッダのみ) { + #region [ BPM/BMP初期化 ] + int ch; + CBPM cbpm = null; + foreach (CBPM cbpm2 in this.listBPM.Values) { + if (cbpm2.n表記上の番号 == 0) { + cbpm = cbpm2; + break; + } + } + if (cbpm == null) { + cbpm = new CBPM(); + cbpm.n内部番号 = this.n内部番号BPM1to++; + cbpm.n表記上の番号 = 0; + cbpm.dbBPM値 = 120.0; + this.listBPM.Add(cbpm.n内部番号, cbpm); + CChip chip = new CChip(); + chip.n発声位置 = 0; + chip.nチャンネル番号 = 8; // 拡張BPM + chip.n整数値 = 0; + chip.n整数値_内部番号 = cbpm.n内部番号; + this.listChip.Insert(0, chip); + } else { + CChip chip = new CChip(); + chip.n発声位置 = 0; + chip.nチャンネル番号 = 8; // 拡張BPM + chip.n整数値 = 0; + chip.n整数値_内部番号 = cbpm.n内部番号; + this.listChip.Insert(0, chip); + } + #endregion + #region [ CWAV初期化 ] + foreach (CWAV cwav in this.listWAV.Values) { + if (cwav.nチップサイズ < 0) { + cwav.nチップサイズ = 100; + } + if (cwav.n位置 <= -10000) { + cwav.n位置 = 0; + } + } + #endregion + #region [ チップ倍率設定 ] // #28145 2012.4.22 yyagi 二重ループを1重ループに変更して高速化) + foreach (CChip chip in this.listChip) { + if (this.listWAV.TryGetValue(chip.n整数値_内部番号, out CWAV cwav)) { + chip.dbチップサイズ倍率 = ((double)cwav.nチップサイズ) / 100.0; + } + } + #endregion + #region [ 拍子_拍線の挿入 ] + if (this.listChip.Count > 0) { + this.listChip.Sort(); // 高速化のためにはこれを削りたいが、listChipの最後がn発声位置の終端である必要があるので、 + // 保守性確保を優先してここでのソートは残しておく + // なお、093時点では、このソートを削除しても動作するようにはしてある。 + // (ここまでの一部チップ登録を、listChip.Add(c)から同Insert(0,c)に変更してある) + // これにより、数ms程度ながらここでのソートも高速化されている。 + } + #endregion + #region [ C2 [拍線_小節線表示指定] の処理 ] // #28145 2012.4.21 yyagi; 2重ループをほぼ1重にして高速化 + bool bShowBeatBarLine = true; + for (int i = 0; i < this.listChip.Count; i++) { + bool bChangedBeatBarStatus = false; + if ((this.listChip[i].nチャンネル番号 == 0xc2)) { + if (this.listChip[i].n整数値 == 1) // BAR/BEAT LINE = ON + { + bShowBeatBarLine = true; + bChangedBeatBarStatus = true; + } else if (this.listChip[i].n整数値 == 2) // BAR/BEAT LINE = OFF + { + bShowBeatBarLine = false; + bChangedBeatBarStatus = true; + } + } + int startIndex = i; + if (bChangedBeatBarStatus) // C2チップの前に50/51チップが来ている可能性に配慮 + { + while (startIndex > 0 && this.listChip[startIndex].n発声位置 == this.listChip[i].n発声位置) { + startIndex--; + } + startIndex++; // 1つ小さく過ぎているので、戻す + } + for (int j = startIndex; j <= i; j++) { + if (((this.listChip[j].nチャンネル番号 == 0x50) || (this.listChip[j].nチャンネル番号 == 0x51)) && + (this.listChip[j].n整数値 == (36 * 36 - 1))) { + this.listChip[j].b可視 = bShowBeatBarLine; + } + } + } + #endregion + this.n内部番号BRANCH1to = 0; + this.n内部番号JSCROLL1to = 0; + #region [ 発声時刻の計算 ] + double bpm = 120.0; + int n発声位置 = 0; + int ms = 0; + int nBar = 0; int nCount = 0; - int dkdkCount = 0; + this.nNowRollCount = 0; + for (int i = 0; i < this.nNowRollCountBranch.Length; i++) + this.nNowRollCountBranch[i] = 0; + + List tmplistlyric = new List(); + int BGM番号 = 0; foreach (CChip chip in this.listChip) { - if (chip.nチャンネル番号 >= 0x11 && chip.nチャンネル番号 < 0x18) { - list音符のみのリスト.Add(chip); - } - } - #endregion - - this.tSenotes_Core_V2(list音符のみのリスト); - } - } - - #region [ チップの再生と停止 ] - public void tチップの再生(CChip pChip, long n再生開始システム時刻ms) { - if (OpenTaiko.ConfigIni.bNoAudioIfNot1xSpeed && OpenTaiko.ConfigIni.nSongSpeed != 20) - return; + if (chip.nチャンネル番号 == 0x02) { } else if (chip.nチャンネル番号 == 0x01) { } else if (chip.nチャンネル番号 == 0x08) { } else if (chip.nチャンネル番号 >= 0x11 && chip.nチャンネル番号 <= 0x1F) { } else if (chip.nチャンネル番号 == 0x50) { } else if (chip.nチャンネル番号 == 0x51) { } else if (chip.nチャンネル番号 == 0x54) { } else if (chip.nチャンネル番号 == 0x08) { } else if (chip.nチャンネル番号 == 0xF1) { } else if (chip.nチャンネル番号 == 0xF2) { } else if (chip.nチャンネル番号 == 0xFF) { } else if (chip.nチャンネル番号 == 0xDD) { chip.n発声時刻ms = ms + ((int)(((625 * (chip.n発声位置 - n発声位置)) * this.dbBarLength) / bpm)); } else if (chip.nチャンネル番号 == 0xDF) { chip.n発声時刻ms = ms + ((int)(((625 * (chip.n発声位置 - n発声位置)) * this.dbBarLength) / bpm)); } else if (chip.nチャンネル番号 < 0x93) + chip.n発声時刻ms = ms + ((int)(((625 * (chip.n発声位置 - n発声位置)) * this.dbBarLength) / bpm)); + else if ((chip.nチャンネル番号 > 0x9F && chip.nチャンネル番号 < 0xA0) || (chip.nチャンネル番号 >= 0xF0 && chip.nチャンネル番号 < 0xFE)) + chip.n発声時刻ms = ms + ((int)(((625 * (chip.n発声位置 - n発声位置)) * this.dbBarLength) / bpm)); + nBar = chip.n発声位置 / 384; + ch = chip.nチャンネル番号; - if (pChip.n整数値_内部番号 >= 0) { - if (this.listWAV.TryGetValue(pChip.n整数値_内部番号, out CWAV wc)) { - int index = wc.n現在再生中のサウンド番号 = (wc.n現在再生中のサウンド番号 + 1) % nPolyphonicSounds; - if ((wc.rSound[0] != null) && - (wc.rSound[0].IsStreamPlay || wc.rSound[index] == null)) { - index = wc.n現在再生中のサウンド番号 = 0; - } - CSound sound = wc.rSound[index]; - if (sound != null) { - sound.PlaySpeed = OpenTaiko.ConfigIni.SongPlaybackSpeed; - // 再生速度によって、WASAPI/ASIOで使う使用mixerが決まるため、付随情報の設定(音量/PAN)は、再生速度の設定後に行う - - // 2018-08-27 twopointzero - DON'T attempt to load (or queue scanning) loudness metadata here. - // This code is called right after loading the .tja, and that code - // will have just made such an attempt. - OpenTaiko.SongGainController.Set(wc.SongVol, wc.SongLoudnessMetadata, sound); - - sound.SoundPosition = wc.n位置; - sound.PlayStart(); - } - wc.n再生開始時刻[wc.n現在再生中のサウンド番号] = n再生開始システム時刻ms; - this.tWave再生位置自動補正(wc); - } - } - } - public void t各自動再生音チップの再生時刻を変更する(int nBGMAdjustの増減値) { - this.nBGMAdjust += nBGMAdjustの増減値; - - for (int i = 0; i < this.listChip.Count; i++) { - int nChannelNumber = this.listChip[i].nチャンネル番号; - if ((( - (nChannelNumber == 1) || - ((0x61 <= nChannelNumber) && (nChannelNumber <= 0x69)) - ) || - ((0x70 <= nChannelNumber) && (nChannelNumber <= 0x79)) - ) || - (((0x80 <= nChannelNumber) && (nChannelNumber <= 0x89)) || ((0x90 <= nChannelNumber) && (nChannelNumber <= 0x92))) - ) { - this.listChip[i].n発声時刻ms += nBGMAdjustの増減値; - } - } - foreach (CWAV cwav in this.listWAV.Values) { - for (int j = 0; j < nPolyphonicSounds; j++) { - if ((cwav.rSound[j] != null) && cwav.rSound[j].IsPlaying) { - cwav.n再生開始時刻[j] += nBGMAdjustの増減値; - } - } - } - } - public void t全チップの再生一時停止() { - foreach (CWAV cwav in this.listWAV.Values) { - for (int i = 0; i < nPolyphonicSounds; i++) { - if ((cwav.rSound[i] != null) && cwav.rSound[i].IsPlaying) { - cwav.rSound[i].Pause(); - cwav.n一時停止時刻[i] = SoundManager.PlayTimer.SystemTimeMs; - } - } - } - } - public void t全チップの再生再開() { - foreach (CWAV cwav in this.listWAV.Values) { - for (int i = 0; i < nPolyphonicSounds; i++) { - if ((cwav.rSound[i] != null) && cwav.rSound[i].IsPaused) { - cwav.rSound[i].Resume(cwav.n一時停止時刻[i] - cwav.n再生開始時刻[i]); - cwav.n再生開始時刻[i] += SoundManager.PlayTimer.SystemTimeMs - cwav.n一時停止時刻[i]; - } - } - } - } - public void t全チップの再生停止() { - foreach (CWAV cwav in this.listWAV.Values) { - this.tWavの再生停止(cwav.n内部番号); - } - } - public void t全チップの再生停止とミキサーからの削除() { - foreach (CWAV cwav in this.listWAV.Values) { - this.tWavの再生停止(cwav.n内部番号, true); - } - } - #endregion - - public void t入力(string strファイル名, bool bヘッダのみ, double db再生速度, int nBGMAdjust, int nReadVersionUnused, int nPlayerSide, bool bSession, int difficulty) { - this.bヘッダのみ = bヘッダのみ; - this.strファイル名の絶対パス = Path.GetFullPath(strファイル名); - this.strファイル名 = Path.GetFileName(this.strファイル名の絶対パス); - this.strフォルダ名 = Path.GetDirectoryName(this.strファイル名の絶対パス) + Path.DirectorySeparatorChar; - - // Unique ID parsing/generation - this.uniqueID = new CSongUniqueID(this.strフォルダ名 + @$"{Path.DirectorySeparatorChar}uniqueID.json"); - - try { - this.nPlayerSide = nPlayerSide; - this.bSession譜面を読み込む = bSession; - //次郎方式 - StreamReader reader = new StreamReader(strファイル名, Encoding.GetEncoding(OpenTaiko.sEncType)); - string str2 = reader.ReadToEnd(); - reader.Close(); - this.t入力_全入力文字列から(str2, str2, db再生速度, nBGMAdjust, difficulty); - } catch (Exception ex) { - Trace.TraceError("おや?エラーが出たようです。お兄様。"); - Trace.TraceError(ex.ToString()); - Trace.TraceError("例外が発生しましたが処理を継続します。 (79ff8639-9b3c-477f-bc4a-f2eea9784860)"); - } - } - public void t入力_全入力文字列から(string str全入力文字列, string str1Unused, double db再生速度, int nBGMAdjust, int Difficulty) { - if (!string.IsNullOrEmpty(str全入力文字列)) { - #region [ 改行カット ] - this.db再生速度 = db再生速度; - #endregion - #region [ 初期化 ] - for (int j = 0; j < 36 * 36; j++) { - this.n無限管理WAV[j] = -j; - this.n無限管理BPM[j] = -j; - this.n無限管理PAN[j] = -10000 - j; - this.n無限管理SIZE[j] = -j; - } - this.n内部番号WAV1to = 1; - this.n内部番号BPM1to = 1; - this.bstackIFからENDIFをスキップする = new Stack(); - this.bstackIFからENDIFをスキップする.Push(false); - this.n現在の乱数 = 0; - for (int k = 0; k < 7; k++) { - this.nRESULTIMAGE用優先順位[k] = 0; - this.nRESULTMOVIE用優先順位[k] = 0; - this.nRESULTSOUND用優先順位[k] = 0; - } - #endregion - #region [ 入力/行解析 ] - #region[初期化] - this.dbNowScroll = 1.0; - this.dbNowSCROLL_Normal = new double[] { 1.0, 0.0 }; - this.dbNowSCROLL_Expert = new double[] { 1.0, 0.0 }; - this.dbNowSCROLL_Master = new double[] { 1.0, 0.0 }; - this.n現在のコース = ECourse.eNormal; - #endregion - this.t入力_V4(str全入力文字列, Difficulty); - - #endregion - this.n無限管理WAV = null; - this.n無限管理BPM = null; - this.n無限管理PAN = null; - this.n無限管理SIZE = null; - if (!this.bヘッダのみ) { - #region [ BPM/BMP初期化 ] - int ch; - CBPM cbpm = null; - foreach (CBPM cbpm2 in this.listBPM.Values) { - if (cbpm2.n表記上の番号 == 0) { - cbpm = cbpm2; - break; - } - } - if (cbpm == null) { - cbpm = new CBPM(); - cbpm.n内部番号 = this.n内部番号BPM1to++; - cbpm.n表記上の番号 = 0; - cbpm.dbBPM値 = 120.0; - this.listBPM.Add(cbpm.n内部番号, cbpm); - CChip chip = new CChip(); - chip.n発声位置 = 0; - chip.nチャンネル番号 = 8; // 拡張BPM - chip.n整数値 = 0; - chip.n整数値_内部番号 = cbpm.n内部番号; - this.listChip.Insert(0, chip); - } else { - CChip chip = new CChip(); - chip.n発声位置 = 0; - chip.nチャンネル番号 = 8; // 拡張BPM - chip.n整数値 = 0; - chip.n整数値_内部番号 = cbpm.n内部番号; - this.listChip.Insert(0, chip); - } - #endregion - #region [ CWAV初期化 ] - foreach (CWAV cwav in this.listWAV.Values) { - if (cwav.nチップサイズ < 0) { - cwav.nチップサイズ = 100; - } - if (cwav.n位置 <= -10000) { - cwav.n位置 = 0; - } - } - #endregion - #region [ チップ倍率設定 ] // #28145 2012.4.22 yyagi 二重ループを1重ループに変更して高速化) - foreach (CChip chip in this.listChip) { - if (this.listWAV.TryGetValue(chip.n整数値_内部番号, out CWAV cwav)) { - chip.dbチップサイズ倍率 = ((double)cwav.nチップサイズ) / 100.0; - } - } - #endregion - #region [ 拍子_拍線の挿入 ] - if (this.listChip.Count > 0) { - this.listChip.Sort(); // 高速化のためにはこれを削りたいが、listChipの最後がn発声位置の終端である必要があるので、 - // 保守性確保を優先してここでのソートは残しておく - // なお、093時点では、このソートを削除しても動作するようにはしてある。 - // (ここまでの一部チップ登録を、listChip.Add(c)から同Insert(0,c)に変更してある) - // これにより、数ms程度ながらここでのソートも高速化されている。 - } - #endregion - #region [ C2 [拍線_小節線表示指定] の処理 ] // #28145 2012.4.21 yyagi; 2重ループをほぼ1重にして高速化 - bool bShowBeatBarLine = true; - for (int i = 0; i < this.listChip.Count; i++) { - bool bChangedBeatBarStatus = false; - if ((this.listChip[i].nチャンネル番号 == 0xc2)) { - if (this.listChip[i].n整数値 == 1) // BAR/BEAT LINE = ON - { - bShowBeatBarLine = true; - bChangedBeatBarStatus = true; - } else if (this.listChip[i].n整数値 == 2) // BAR/BEAT LINE = OFF - { - bShowBeatBarLine = false; - bChangedBeatBarStatus = true; - } - } - int startIndex = i; - if (bChangedBeatBarStatus) // C2チップの前に50/51チップが来ている可能性に配慮 - { - while (startIndex > 0 && this.listChip[startIndex].n発声位置 == this.listChip[i].n発声位置) { - startIndex--; - } - startIndex++; // 1つ小さく過ぎているので、戻す - } - for (int j = startIndex; j <= i; j++) { - if (((this.listChip[j].nチャンネル番号 == 0x50) || (this.listChip[j].nチャンネル番号 == 0x51)) && - (this.listChip[j].n整数値 == (36 * 36 - 1))) { - this.listChip[j].b可視 = bShowBeatBarLine; - } - } - } - #endregion - this.n内部番号BRANCH1to = 0; - this.n内部番号JSCROLL1to = 0; - #region [ 発声時刻の計算 ] - double bpm = 120.0; - int n発声位置 = 0; - int ms = 0; - int nBar = 0; - int nCount = 0; - this.nNowRollCount = 0; + nCount++; + this.nNowRollCount++; for (int i = 0; i < this.nNowRollCountBranch.Length; i++) - this.nNowRollCountBranch[i] = 0; + this.nNowRollCountBranch[i]++; - List tmplistlyric = new List(); - int BGM番号 = 0; + switch (ch) { + case 0x01: { + n発声位置 = chip.n発声位置; - foreach (CChip chip in this.listChip) { - if (chip.nチャンネル番号 == 0x02) { } else if (chip.nチャンネル番号 == 0x01) { } else if (chip.nチャンネル番号 == 0x08) { } else if (chip.nチャンネル番号 >= 0x11 && chip.nチャンネル番号 <= 0x1F) { } else if (chip.nチャンネル番号 == 0x50) { } else if (chip.nチャンネル番号 == 0x51) { } else if (chip.nチャンネル番号 == 0x54) { } else if (chip.nチャンネル番号 == 0x08) { } else if (chip.nチャンネル番号 == 0xF1) { } else if (chip.nチャンネル番号 == 0xF2) { } else if (chip.nチャンネル番号 == 0xFF) { } else if (chip.nチャンネル番号 == 0xDD) { chip.n発声時刻ms = ms + ((int)(((625 * (chip.n発声位置 - n発声位置)) * this.dbBarLength) / bpm)); } else if (chip.nチャンネル番号 == 0xDF) { chip.n発声時刻ms = ms + ((int)(((625 * (chip.n発声位置 - n発声位置)) * this.dbBarLength) / bpm)); } else if (chip.nチャンネル番号 < 0x93) - chip.n発声時刻ms = ms + ((int)(((625 * (chip.n発声位置 - n発声位置)) * this.dbBarLength) / bpm)); - else if ((chip.nチャンネル番号 > 0x9F && chip.nチャンネル番号 < 0xA0) || (chip.nチャンネル番号 >= 0xF0 && chip.nチャンネル番号 < 0xFE)) - chip.n発声時刻ms = ms + ((int)(((625 * (chip.n発声位置 - n発声位置)) * this.dbBarLength) / bpm)); - nBar = chip.n発声位置 / 384; - ch = chip.nチャンネル番号; + if (this.bOFFSETの値がマイナスである == false) + chip.n発声時刻ms += this.nOFFSET; + ms = chip.n発声時刻ms; - nCount++; - this.nNowRollCount++; - for (int i = 0; i < this.nNowRollCountBranch.Length; i++) - this.nNowRollCountBranch[i]++; + #region[listlyric2の時間合わせ] + for (int ind = 0; ind < listLyric2.Count; ind++) { + if (listLyric2[ind].index == BGM番号) { + STLYRIC lyrictmp = this.listLyric2[ind]; - switch (ch) { - case 0x01: { - n発声位置 = chip.n発声位置; + lyrictmp.Time += chip.n発声時刻ms; - if (this.bOFFSETの値がマイナスである == false) - chip.n発声時刻ms += this.nOFFSET; - ms = chip.n発声時刻ms; - - #region[listlyric2の時間合わせ] - for (int ind = 0; ind < listLyric2.Count; ind++) { - if (listLyric2[ind].index == BGM番号) { - STLYRIC lyrictmp = this.listLyric2[ind]; - - lyrictmp.Time += chip.n発声時刻ms; - - tmplistlyric.Add(lyrictmp); - } + tmplistlyric.Add(lyrictmp); } - - - BGM番号++; - #endregion - continue; - } - case 0x02: // BarLength - { - n発声位置 = chip.n発声位置; - if (this.bOFFSETの値がマイナスである == false) - chip.n発声時刻ms += this.nOFFSET; - ms = chip.n発声時刻ms; - dbBarLength = chip.db実数値; - continue; - } - case 0x03: // BPM - { - n発声位置 = chip.n発声位置; - if (this.bOFFSETの値がマイナスである == false) - chip.n発声時刻ms += this.nOFFSET; - ms = chip.n発声時刻ms; - bpm = this.BASEBPM + chip.n整数値; - this.dbNowBPM = bpm; - continue; - } - case 0x04: // BGA (レイヤBGA1) - case 0x07: // レイヤBGA2 - break; - - case 0x15: - case 0x16: - case 0x17: - case 0x19: - case 0x1D: - case 0x20: - case 0x21: { - if (this.bOFFSETの値がマイナスである) { - chip.n発声時刻ms += this.nOFFSET; - chip.nノーツ終了時刻ms += this.nOFFSET; - } - - this.nNowRoll = this.nNowRollCount - 1; - continue; - } - case 0x18: { - if (this.bOFFSETの値がマイナスである) { - chip.n発声時刻ms += this.nOFFSET; - } - continue; } - case 0x55: - case 0x56: - case 0x57: - case 0x58: - case 0x59: - case 0x60: - break; - case 0x50: { - if (this.bOFFSETの値がマイナスである) - chip.n発声時刻ms += this.nOFFSET; - if (this.n内部番号BRANCH1to + 1 > this.listBRANCH.Count) - continue; - - if (this.listBRANCH[this.n内部番号BRANCH1to].n現在の小節 == nBar) { - chip.bBranch = true; - this.n内部番号BRANCH1to++; - } - - continue; - } - - case 0x05: // Extended Object (非対応) - case 0x06: // Missアニメ (非対応) - case 0x5A: // 未定義 - case 0x5b: // 未定義 - case 0x5c: // 未定義 - case 0x5d: // 未定義 - case 0x5e: // 未定義 - case 0x5f: // 未定義 - { - continue; - } - case 0x08: // 拡張BPM - { - n発声位置 = chip.n発声位置; - if (this.bOFFSETの値がマイナスである == false) - chip.n発声時刻ms += this.nOFFSET; - ms = chip.n発声時刻ms; - if (this.listBPM.TryGetValue(chip.n整数値_内部番号, out CBPM cBPM)) { - bpm = (cBPM.n表記上の番号 == 0 ? 0.0 : this.BASEBPM) + cBPM.dbBPM値; - this.dbNowBPM = bpm; - } - continue; - } - case 0x54: // 動画再生 - { - if (this.bOFFSETの値がマイナスである == false) - chip.n発声時刻ms += this.nOFFSET; - if (this.bMOVIEOFFSETの値がマイナスである == false) - chip.n発声時刻ms += this.nMOVIEOFFSET; - else - chip.n発声時刻ms -= this.nMOVIEOFFSET; - continue; - } - case 0x97: - case 0x98: - case 0x99: { - if (this.bOFFSETの値がマイナスである) { - chip.n発声時刻ms += this.nOFFSET; - chip.nノーツ終了時刻ms += this.nOFFSET; - } - this.nNowRoll = this.nNowRollCount - 1; - - continue; - } - case 0x9A: { - - if (this.bOFFSETの値がマイナスである) { - chip.n発声時刻ms += this.nOFFSET; - } - continue; - } - case 0x9D: { - continue; - } - case 0xDC: { - if (this.bOFFSETの値がマイナスである) - chip.n発声時刻ms += this.nOFFSET; - continue; - } - case 0xDE: { - if (this.bOFFSETの値がマイナスである) { - chip.n発声時刻ms += this.nOFFSET; - chip.n分岐時刻ms += this.nOFFSET; - } - this.n現在のコース = chip.nコース; - continue; - } - case 0x52: { - if (this.bOFFSETの値がマイナスである) { - chip.n発声時刻ms += this.nOFFSET; - chip.n分岐時刻ms += this.nOFFSET; - } - this.n現在のコース = chip.nコース; - continue; - } - case 0xDF: { - if (this.bOFFSETの値がマイナスである) - chip.n発声時刻ms += this.nOFFSET; - continue; - } - case 0xE0: { - continue; - } - default: { - if (this.bOFFSETの値がマイナスである) - chip.n発声時刻ms += this.nOFFSET; - chip.dbBPM = this.dbNowBPM; - continue; - } - } - } - if (this.db再生速度 > 0.0) { - double _db再生速度 = this.db再生速度; - foreach (CChip chip in this.listChip) { - chip.n発声時刻ms = (int)(((double)chip.n発声時刻ms) / _db再生速度); - chip.db発声時刻ms = (((double)chip.n発声時刻ms) / _db再生速度); - chip.nノーツ終了時刻ms = (int)(((double)chip.nノーツ終了時刻ms) / _db再生速度); - } - } - #endregion - - #region[listlyricを時間順に並び替え。] - this.listLyric2 = tmplistlyric; - this.listLyric2.Sort((a, b) => a.Time.CompareTo(b.Time)); - #endregion - - this.nBGMAdjust = 0; - this.t各自動再生音チップの再生時刻を変更する(nBGMAdjust); - - #region [ 可視チップ数カウント ] - for (int n = 0; n < 14; n++) { - this.n可視チップ数[n] = 0; - } - foreach (CChip chip in this.listChip) { - int c = chip.nチャンネル番号; - if ((0x11 <= c) && (c <= 0x14)) { - if (c == 0x11 || c == 0x13) - this.n可視チップ数.Taiko_Red++; - else if (c == 0x12 || c == 0x14) - this.n可視チップ数.Taiko_Blue++; - } - } - #endregion - #region [ チップの種類を分類し、対応するフラグを立てる ] - foreach (CChip chip in this.listChip) { - if ((chip.nチャンネル番号 == 0x01 && this.listWAV.TryGetValue(chip.n整数値_内部番号, out CWAV cwav)) && !cwav.listこのWAVを使用するチャンネル番号の集合.Contains(chip.nチャンネル番号)) { - cwav.listこのWAVを使用するチャンネル番号の集合.Add(chip.nチャンネル番号); - - int c = chip.nチャンネル番号 >> 4; - switch (c) { - case 0x01: - cwav.bIsDrumsSound = true; break; - case 0x02: - cwav.bIsGuitarSound = true; break; - case 0x0A: - cwav.bIsBassSound = true; break; - case 0x06: - case 0x07: - case 0x08: - case 0x09: - cwav.bIsSESound = true; break; - case 0x00: - if (chip.nチャンネル番号 == 0x01) { - cwav.bIsBGMSound = true; break; - } - break; + BGM番号++; + #endregion + continue; } - } - } - #endregion - #region[ seNotes計算 ] - if (this.listBRANCH.Count != 0) - this.tSetSenotes_branch(); - else - this.tSetSenotes(); - - #endregion - #region [ bLogDTX詳細ログ出力 ] - if (OpenTaiko.ConfigIni.bOutputDetailedDTXLog) { - foreach (CWAV cwav in this.listWAV.Values) { - Trace.TraceInformation(cwav.ToString()); - } - foreach (CBPM cbpm3 in this.listBPM.Values) { - Trace.TraceInformation(cbpm3.ToString()); - } - foreach (CChip chip in this.listChip) { - Trace.TraceInformation(chip.ToString()); - } - } - #endregion - int n整数値管理 = 0; + case 0x02: // BarLength + { + n発声位置 = chip.n発声位置; + if (this.bOFFSETの値がマイナスである == false) + chip.n発声時刻ms += this.nOFFSET; + ms = chip.n発声時刻ms; + dbBarLength = chip.db実数値; + continue; + } + case 0x03: // BPM + { + n発声位置 = chip.n発声位置; + if (this.bOFFSETの値がマイナスである == false) + chip.n発声時刻ms += this.nOFFSET; + ms = chip.n発声時刻ms; + bpm = this.BASEBPM + chip.n整数値; + this.dbNowBPM = bpm; + continue; + } + case 0x04: // BGA (レイヤBGA1) + case 0x07: // レイヤBGA2 + break; + + case 0x15: + case 0x16: + case 0x17: + case 0x19: + case 0x1D: + case 0x20: + case 0x21: { + if (this.bOFFSETの値がマイナスである) { + chip.n発声時刻ms += this.nOFFSET; + chip.nノーツ終了時刻ms += this.nOFFSET; + } + + this.nNowRoll = this.nNowRollCount - 1; + continue; + } + case 0x18: { + if (this.bOFFSETの値がマイナスである) { + chip.n発声時刻ms += this.nOFFSET; + } + continue; + } + + case 0x55: + case 0x56: + case 0x57: + case 0x58: + case 0x59: + case 0x60: + break; + + case 0x50: { + if (this.bOFFSETの値がマイナスである) + chip.n発声時刻ms += this.nOFFSET; + if (this.n内部番号BRANCH1to + 1 > this.listBRANCH.Count) + continue; + + if (this.listBRANCH[this.n内部番号BRANCH1to].n現在の小節 == nBar) { + chip.bBranch = true; + this.n内部番号BRANCH1to++; + } + + continue; + } + + case 0x05: // Extended Object (非対応) + case 0x06: // Missアニメ (非対応) + case 0x5A: // 未定義 + case 0x5b: // 未定義 + case 0x5c: // 未定義 + case 0x5d: // 未定義 + case 0x5e: // 未定義 + case 0x5f: // 未定義 + { + continue; + } + case 0x08: // 拡張BPM + { + n発声位置 = chip.n発声位置; + if (this.bOFFSETの値がマイナスである == false) + chip.n発声時刻ms += this.nOFFSET; + ms = chip.n発声時刻ms; + if (this.listBPM.TryGetValue(chip.n整数値_内部番号, out CBPM cBPM)) { + bpm = (cBPM.n表記上の番号 == 0 ? 0.0 : this.BASEBPM) + cBPM.dbBPM値; + this.dbNowBPM = bpm; + } + continue; + } + case 0x54: // 動画再生 + { + if (this.bOFFSETの値がマイナスである == false) + chip.n発声時刻ms += this.nOFFSET; + if (this.bMOVIEOFFSETの値がマイナスである == false) + chip.n発声時刻ms += this.nMOVIEOFFSET; + else + chip.n発声時刻ms -= this.nMOVIEOFFSET; + continue; + } + case 0x97: + case 0x98: + case 0x99: { + if (this.bOFFSETの値がマイナスである) { + chip.n発声時刻ms += this.nOFFSET; + chip.nノーツ終了時刻ms += this.nOFFSET; + } + this.nNowRoll = this.nNowRollCount - 1; + + continue; + } + case 0x9A: { + + if (this.bOFFSETの値がマイナスである) { + chip.n発声時刻ms += this.nOFFSET; + } + continue; + } + case 0x9D: { + continue; + } + case 0xDC: { + if (this.bOFFSETの値がマイナスである) + chip.n発声時刻ms += this.nOFFSET; + continue; + } + case 0xDE: { + if (this.bOFFSETの値がマイナスである) { + chip.n発声時刻ms += this.nOFFSET; + chip.n分岐時刻ms += this.nOFFSET; + } + this.n現在のコース = chip.nコース; + continue; + } + case 0x52: { + if (this.bOFFSETの値がマイナスである) { + chip.n発声時刻ms += this.nOFFSET; + chip.n分岐時刻ms += this.nOFFSET; + } + this.n現在のコース = chip.nコース; + continue; + } + case 0xDF: { + if (this.bOFFSETの値がマイナスである) + chip.n発声時刻ms += this.nOFFSET; + continue; + } + case 0xE0: { + continue; + } + default: { + if (this.bOFFSETの値がマイナスである) + chip.n発声時刻ms += this.nOFFSET; + chip.dbBPM = this.dbNowBPM; + continue; + } + } + } + if (this.db再生速度 > 0.0) { + double _db再生速度 = this.db再生速度; foreach (CChip chip in this.listChip) { - if (chip.nチャンネル番号 != 0x54) - chip.n整数値 = n整数値管理; - n整数値管理++; - } - - } - } - } - - private string tコメントを削除する(string input) { - string strOutput = Regex.Replace(input, @" *//.*", ""); //2017.01.28 DD コメント前のスペースも削除するように修正 - - return strOutput; - } - - private string[] tコマンド行を削除したTJAを返す(string[] input) { - return this.tコマンド行を削除したTJAを返す(input, 0); - } - - private string[] tコマンド行を削除したTJAを返す(string[] input, int nMode) { - var sb = new StringBuilder(); - - // 18/11/11 AioiLight 譜面にSpace、スペース、Tab等が入っているとおかしくなるので修正。 - // 多分コマンドもスペースが抜かれちゃっているが、コマンド行を除く譜面を返すので大丈夫(たぶん)。 - for (int i = 0; i < input.Length; i++) { - input[i] = input[i].Trim(); - } - - for (int n = 0; n < input.Length; n++) { - if (nMode == 0) { - if (!string.IsNullOrEmpty(input[n]) && NotesManager.FastFlankedParsing(input[n]))//this.CharConvertNote(input[n].Substring(0, 1)) != -1) - { - sb.Append(input[n] + "\n"); - } - } else if (nMode == 1) { - if (!string.IsNullOrEmpty(input[n]) && - (input[n].Substring(0, 1) == "#" - || input[n].StartsWith("EXAM") - || NotesManager.FastFlankedParsing(input[n]))) { - if (input[n].StartsWith("BALLOON") || input[n].StartsWith("BPM")) { - //A~Fで始まる命令が削除されない不具合の対策 - } else { - sb.Append(input[n] + "\n"); - } - } - } else if (nMode == 2) { - if (!string.IsNullOrEmpty(input[n]) && NotesManager.FastFlankedParsing(input[n])) { - if (input[n].StartsWith("BALLOON") || input[n].StartsWith("BPM")) { - //A~Fで始まる命令が削除されない不具合の対策 - } else { - sb.Append(input[n] + "\n"); - } - } else { - if (input[n].StartsWith("#BRANCHSTART") || input[n] == "#N" || input[n] == "#E" || input[n] == "#M") { - sb.Append(input[n] + "\n"); - } - + chip.n発声時刻ms = (int)(((double)chip.n発声時刻ms) / _db再生速度); + chip.db発声時刻ms = (((double)chip.n発声時刻ms) / _db再生速度); + chip.nノーツ終了時刻ms = (int)(((double)chip.nノーツ終了時刻ms) / _db再生速度); } } + #endregion + + #region[listlyricを時間順に並び替え。] + this.listLyric2 = tmplistlyric; + this.listLyric2.Sort((a, b) => a.Time.CompareTo(b.Time)); + #endregion + + this.nBGMAdjust = 0; + this.t各自動再生音チップの再生時刻を変更する(nBGMAdjust); + + #region [ 可視チップ数カウント ] + for (int n = 0; n < 14; n++) { + this.n可視チップ数[n] = 0; + } + foreach (CChip chip in this.listChip) { + int c = chip.nチャンネル番号; + if ((0x11 <= c) && (c <= 0x14)) { + if (c == 0x11 || c == 0x13) + this.n可視チップ数.Taiko_Red++; + else if (c == 0x12 || c == 0x14) + this.n可視チップ数.Taiko_Blue++; + } + } + #endregion + #region [ チップの種類を分類し、対応するフラグを立てる ] + foreach (CChip chip in this.listChip) { + if ((chip.nチャンネル番号 == 0x01 && this.listWAV.TryGetValue(chip.n整数値_内部番号, out CWAV cwav)) && !cwav.listこのWAVを使用するチャンネル番号の集合.Contains(chip.nチャンネル番号)) { + cwav.listこのWAVを使用するチャンネル番号の集合.Add(chip.nチャンネル番号); + + int c = chip.nチャンネル番号 >> 4; + switch (c) { + case 0x01: + cwav.bIsDrumsSound = true; break; + case 0x02: + cwav.bIsGuitarSound = true; break; + case 0x0A: + cwav.bIsBassSound = true; break; + case 0x06: + case 0x07: + case 0x08: + case 0x09: + cwav.bIsSESound = true; break; + case 0x00: + if (chip.nチャンネル番号 == 0x01) { + cwav.bIsBGMSound = true; break; + } + break; + } + } + } + #endregion + #region[ seNotes計算 ] + if (this.listBRANCH.Count != 0) + this.tSetSenotes_branch(); + else + this.tSetSenotes(); + + #endregion + #region [ bLogDTX詳細ログ出力 ] + if (OpenTaiko.ConfigIni.bOutputDetailedDTXLog) { + foreach (CWAV cwav in this.listWAV.Values) { + Trace.TraceInformation(cwav.ToString()); + } + foreach (CBPM cbpm3 in this.listBPM.Values) { + Trace.TraceInformation(cbpm3.ToString()); + } + foreach (CChip chip in this.listChip) { + Trace.TraceInformation(chip.ToString()); + } + } + #endregion + int n整数値管理 = 0; + foreach (CChip chip in this.listChip) { + if (chip.nチャンネル番号 != 0x54) + chip.n整数値 = n整数値管理; + n整数値管理++; + } + } + } + } - string[] strOutput = sb.ToString().Split(this.dlmtEnter, StringSplitOptions.None); + private string tコメントを削除する(string input) { + string strOutput = Regex.Replace(input, @" *//.*", ""); //2017.01.28 DD コメント前のスペースも削除するように修正 - return strOutput; + return strOutput; + } + + private string[] tコマンド行を削除したTJAを返す(string[] input) { + return this.tコマンド行を削除したTJAを返す(input, 0); + } + + private string[] tコマンド行を削除したTJAを返す(string[] input, int nMode) { + var sb = new StringBuilder(); + + // 18/11/11 AioiLight 譜面にSpace、スペース、Tab等が入っているとおかしくなるので修正。 + // 多分コマンドもスペースが抜かれちゃっているが、コマンド行を除く譜面を返すので大丈夫(たぶん)。 + for (int i = 0; i < input.Length; i++) { + input[i] = input[i].Trim(); } - private string[] t空のstring配列を詰めたstring配列を返す(string[] input) { - var sb = new StringBuilder(); - - for (int n = 0; n < input.Length; n++) { - if (!string.IsNullOrEmpty(input[n])) { + for (int n = 0; n < input.Length; n++) { + if (nMode == 0) { + if (!string.IsNullOrEmpty(input[n]) && NotesManager.FastFlankedParsing(input[n]))//this.CharConvertNote(input[n].Substring(0, 1)) != -1) + { sb.Append(input[n] + "\n"); } - } - - string[] strOutput = sb.ToString().Split(this.dlmtEnter, StringSplitOptions.None); - - return strOutput; - } - - private string StringArrayToString(string[] input) { - return this.StringArrayToString(input, ""); - } - private string StringArrayToString(string[] input, string strデリミタ文字) { - var sb = new StringBuilder(); - - for (int n = 0; n < input.Length; n++) { - sb.Append(input[n] + strデリミタ文字); - } - - return sb.ToString(); - } - - /// - /// - /// - /// - /// 1小節内の文字数 - private int t1小節の文字数をカウントする(string InputText) { - return InputText.Length - 1; - } - - /// - /// - /// - /// - /// 1小節内の文字数 - private void t1小節の文字数をカウントしてリストに追加する(string InputText) { - int nCount = 0; - - if (InputText.StartsWith("#BRANCHSTART")) { - this.nLineCountTemp = this.n現在の小節数; - return; - } else if (InputText.StartsWith("#N")) { - this.nLineCountCourseTemp = ECourse.eNormal; - this.n現在の小節数 = this.nLineCountTemp; - return; - } else if (InputText.StartsWith("#E")) { - this.nLineCountCourseTemp = ECourse.eExpert; - this.n現在の小節数 = this.nLineCountTemp; - return; - } else if (InputText.StartsWith("#M")) { - this.nLineCountCourseTemp = ECourse.eMaster; - this.n現在の小節数 = this.nLineCountTemp; - return; - } - - var line = new CLine(); - line.nコース = this.nLineCountCourseTemp; - line.n文字数 = InputText.Length - 1; - line.n小節番号 = this.n現在の小節数; - this.listLine.Add(line); - this.n現在の小節数++; - } - - /// - /// 0:改行文字を削除して、デリミタとしてスペースを入れる。(返り値:string) - /// 1:改行文字を削除、さらにSplitして返す(返り値:string[n]) - /// - /// - /// - /// - private object str改行文字を削除する(string strInput, int nMode) { - string str = ""; - str = strInput; - - unsafe { - fixed (char* s = str) { - for (int i = 0; i < str.Length; i++) { - if (s[i] == '\t') - s[i] = ' '; - else if (s[i] == '\r') - s[i] = '\n'; - } - } - } - - if (nMode == 0) { - str = str.Replace("\n", " "); } else if (nMode == 1) { - str = str + "\n"; - - string[] strArray; - strArray = str.Split(this.dlmtEnter, StringSplitOptions.RemoveEmptyEntries); - - return strArray; - } - - return str; - } - - /// - /// コースごとに譜面を分割する。 - /// - /// - /// 各コースの譜面(string[5]) - private string[] tコースで譜面を分割する(string strTJA) { - string[] strCourseTJA = new string[(int)Difficulty.Total]; - - if (strTJA.IndexOf("COURSE", 0) != -1) { - //tja内に「COURSE」があればここを使う。 - string[] strTemp = strTJA.Split(this.dlmtCOURSE, StringSplitOptions.RemoveEmptyEntries); - - for (int n = 1; n < strTemp.Length; n++) { - int nCourse = 0; - string nNC = ""; - while (strTemp[n].Substring(0, 1) != "\n") //2017.01.29 DD COURSE単語表記に対応 - { - nNC += strTemp[n].Substring(0, 1); - strTemp[n] = strTemp[n].Remove(0, 1); - } - - if (this.strConvertCourse(nNC) != -1) { - nCourse = this.strConvertCourse(nNC); - strCourseTJA[nCourse] = strTemp[n]; + if (!string.IsNullOrEmpty(input[n]) && + (input[n].Substring(0, 1) == "#" + || input[n].StartsWith("EXAM") + || NotesManager.FastFlankedParsing(input[n]))) { + if (input[n].StartsWith("BALLOON") || input[n].StartsWith("BPM")) { + //A~Fで始まる命令が削除されない不具合の対策 + } else { + sb.Append(input[n] + "\n"); } } - } else { - strCourseTJA[3] = strTJA; - } - - return strCourseTJA; - } - - // Regexes - private static readonly Regex regexForPrefixingCommaStartingLinesWithZero = new Regex(@"^,", RegexOptions.Multiline | RegexOptions.Compiled); - private static readonly Regex regexForStrippingHeadingLines = new Regex( - @"^(?!(TITLE|LEVEL|BPM|WAVE|OFFSET|BALLOON|EXAM1|EXAM2|EXAM3|EXAM4|EXAM5|EXAM6|EXAM7|DANTICK|DANTICKCOLOR|RENREN22|RENREN23|RENREN32|RENREN33|RENREN42|RENREN43|BALLOONNOR|BALLOONEXP|BALLOONMAS|SONGVOL|SEVOL|SCOREINIT|SCOREDIFF|COURSE|STYLE|TOWERTYPE|GAME|LIFE|DEMOSTART|SIDE|SUBTITLE|SCOREMODE|GENRE|MAKER|SELECTBG|MOVIEOFFSET|BGIMAGE|BGMOVIE|HIDDENBRANCH|GAUGEINCR|LYRICFILE|#HBSCROLL|#BMSCROLL)).+\n", - RegexOptions.Multiline | RegexOptions.Compiled); - - private int nDifficulty; - - /// - /// 新型。 - /// ○未実装 - /// _「COURSE」定義が無い譜面は未対応 - ///  →ver2015082200で対応完了。 - /// - /// - /// 譜面のデータ - private void t入力_V4(string strInput, int difficulty) { - nDifficulty = difficulty; - if (!String.IsNullOrEmpty(strInput)) //空なら通さない - { - - //2017.01.31 DD カンマのみの行を0,に置き換え - strInput = regexForPrefixingCommaStartingLinesWithZero.Replace(strInput, "0,"); - - //2017.02.03 DD ヘッダ内にある命令以外の文字列を削除 - var startIndex = strInput.IndexOf("#START"); - if (startIndex < 0) { - Trace.TraceWarning($"#START命令が少なくとも1つは必要です。 ({strファイル名の絶対パス})"); - } - string strInputHeader = strInput.Remove(startIndex); - strInput = strInput.Remove(0, startIndex); - strInput = strInputHeader + "\n" + strInput; - - //どうせ使わないので先にSplitしてコメントを削除。 - var strSplitした譜面 = (string[])this.str改行文字を削除する(strInput, 1); - - for (int i = 0; strSplitした譜面.Length > i; i++) { - int idx = strSplitした譜面[i].IndexOf("//"); - if (idx >= 0) - strSplitした譜面[i] = strSplitした譜面[i].Substring(0, idx); - } - //空のstring配列を詰める - strSplitした譜面 = this.t空のstring配列を詰めたstring配列を返す(strSplitした譜面); - - #region[ヘッダ] - - //2015.05.21 kairera0467 - //ヘッダの読み込みは譜面全体から該当する命令を探す。 - //少し処理が遅くなる可能性はあるが、ここは正確性を重視する。 - //点数などの指定は後から各コースで行うので問題は無いだろう。 - - //SplitしたヘッダのLengthの回数だけ、forで回して各種情報を読み取っていく。 - for (int i = 0; strSplitした譜面.Length > i; i++) { - this.t入力_行解析ヘッダ(strSplitした譜面[i]); - } - #endregion - - #region[譜面] - - int n読み込むコース = 3; - int n譜面数 = 0; //2017.07.22 kairera0467 tjaに含まれる譜面の数 - bool b新処理 = false; - - //まずはコースごとに譜面を分割。 - strSplitした譜面 = this.tコースで譜面を分割する(this.StringArrayToString(strSplitした譜面, "\n")); - string strTest = ""; - //存在するかのフラグ作成。 - for (int i = 0; i < strSplitした譜面.Length; i++) { - if (!String.IsNullOrEmpty(strSplitした譜面[i])) { - this.b譜面が存在する[i] = true; - n譜面数++; - } else - this.b譜面が存在する[i] = false; - } - - #region[ 読み込ませるコースを決定 ] - if (this.b譜面が存在する[difficulty] == false) { - n読み込むコース = difficulty; - n読み込むコース++; - for (int n = 1; n < (int)Difficulty.Total; n++) { - if (this.b譜面が存在する[n読み込むコース] == false) { - n読み込むコース++; - if (n読み込むコース > (int)Difficulty.Total - 1) - n読み込むコース = 0; - } else - break; + } else if (nMode == 2) { + if (!string.IsNullOrEmpty(input[n]) && NotesManager.FastFlankedParsing(input[n])) { + if (input[n].StartsWith("BALLOON") || input[n].StartsWith("BPM")) { + //A~Fで始まる命令が削除されない不具合の対策 + } else { + sb.Append(input[n] + "\n"); } + } else { + if (input[n].StartsWith("#BRANCHSTART") || input[n] == "#N" || input[n] == "#E" || input[n] == "#M") { + sb.Append(input[n] + "\n"); + } + + } + } + } + + string[] strOutput = sb.ToString().Split(this.dlmtEnter, StringSplitOptions.None); + + return strOutput; + } + + private string[] t空のstring配列を詰めたstring配列を返す(string[] input) { + var sb = new StringBuilder(); + + for (int n = 0; n < input.Length; n++) { + if (!string.IsNullOrEmpty(input[n])) { + sb.Append(input[n] + "\n"); + } + } + + string[] strOutput = sb.ToString().Split(this.dlmtEnter, StringSplitOptions.None); + + return strOutput; + } + + private string StringArrayToString(string[] input) { + return this.StringArrayToString(input, ""); + } + private string StringArrayToString(string[] input, string strデリミタ文字) { + var sb = new StringBuilder(); + + for (int n = 0; n < input.Length; n++) { + sb.Append(input[n] + strデリミタ文字); + } + + return sb.ToString(); + } + + /// + /// + /// + /// + /// 1小節内の文字数 + private int t1小節の文字数をカウントする(string InputText) { + return InputText.Length - 1; + } + + /// + /// + /// + /// + /// 1小節内の文字数 + private void t1小節の文字数をカウントしてリストに追加する(string InputText) { + int nCount = 0; + + if (InputText.StartsWith("#BRANCHSTART")) { + this.nLineCountTemp = this.n現在の小節数; + return; + } else if (InputText.StartsWith("#N")) { + this.nLineCountCourseTemp = ECourse.eNormal; + this.n現在の小節数 = this.nLineCountTemp; + return; + } else if (InputText.StartsWith("#E")) { + this.nLineCountCourseTemp = ECourse.eExpert; + this.n現在の小節数 = this.nLineCountTemp; + return; + } else if (InputText.StartsWith("#M")) { + this.nLineCountCourseTemp = ECourse.eMaster; + this.n現在の小節数 = this.nLineCountTemp; + return; + } + + var line = new CLine(); + line.nコース = this.nLineCountCourseTemp; + line.n文字数 = InputText.Length - 1; + line.n小節番号 = this.n現在の小節数; + this.listLine.Add(line); + this.n現在の小節数++; + } + + /// + /// 0:改行文字を削除して、デリミタとしてスペースを入れる。(返り値:string) + /// 1:改行文字を削除、さらにSplitして返す(返り値:string[n]) + /// + /// + /// + /// + private object str改行文字を削除する(string strInput, int nMode) { + string str = ""; + str = strInput; + + unsafe { + fixed (char* s = str) { + for (int i = 0; i < str.Length; i++) { + if (s[i] == '\t') + s[i] = ' '; + else if (s[i] == '\r') + s[i] = '\n'; + } + } + } + + if (nMode == 0) { + str = str.Replace("\n", " "); + } else if (nMode == 1) { + str = str + "\n"; + + string[] strArray; + strArray = str.Split(this.dlmtEnter, StringSplitOptions.RemoveEmptyEntries); + + return strArray; + } + + return str; + } + + /// + /// コースごとに譜面を分割する。 + /// + /// + /// 各コースの譜面(string[5]) + private string[] tコースで譜面を分割する(string strTJA) { + string[] strCourseTJA = new string[(int)Difficulty.Total]; + + if (strTJA.IndexOf("COURSE", 0) != -1) { + //tja内に「COURSE」があればここを使う。 + string[] strTemp = strTJA.Split(this.dlmtCOURSE, StringSplitOptions.RemoveEmptyEntries); + + for (int n = 1; n < strTemp.Length; n++) { + int nCourse = 0; + string nNC = ""; + while (strTemp[n].Substring(0, 1) != "\n") //2017.01.29 DD COURSE単語表記に対応 + { + nNC += strTemp[n].Substring(0, 1); + strTemp[n] = strTemp[n].Remove(0, 1); + } + + if (this.strConvertCourse(nNC) != -1) { + nCourse = this.strConvertCourse(nNC); + strCourseTJA[nCourse] = strTemp[n]; + } + } + } else { + strCourseTJA[3] = strTJA; + } + + return strCourseTJA; + } + + // Regexes + private static readonly Regex regexForPrefixingCommaStartingLinesWithZero = new Regex(@"^,", RegexOptions.Multiline | RegexOptions.Compiled); + private static readonly Regex regexForStrippingHeadingLines = new Regex( + @"^(?!(TITLE|LEVEL|BPM|WAVE|OFFSET|BALLOON|EXAM1|EXAM2|EXAM3|EXAM4|EXAM5|EXAM6|EXAM7|DANTICK|DANTICKCOLOR|RENREN22|RENREN23|RENREN32|RENREN33|RENREN42|RENREN43|BALLOONNOR|BALLOONEXP|BALLOONMAS|SONGVOL|SEVOL|SCOREINIT|SCOREDIFF|COURSE|STYLE|TOWERTYPE|GAME|LIFE|DEMOSTART|SIDE|SUBTITLE|SCOREMODE|GENRE|MAKER|SELECTBG|MOVIEOFFSET|BGIMAGE|BGMOVIE|HIDDENBRANCH|GAUGEINCR|LYRICFILE|#HBSCROLL|#BMSCROLL)).+\n", + RegexOptions.Multiline | RegexOptions.Compiled); + + private int nDifficulty; + + /// + /// 新型。 + /// ○未実装 + /// _「COURSE」定義が無い譜面は未対応 + ///  →ver2015082200で対応完了。 + /// + /// + /// 譜面のデータ + private void t入力_V4(string strInput, int difficulty) { + nDifficulty = difficulty; + if (!String.IsNullOrEmpty(strInput)) //空なら通さない + { + + //2017.01.31 DD カンマのみの行を0,に置き換え + strInput = regexForPrefixingCommaStartingLinesWithZero.Replace(strInput, "0,"); + + //2017.02.03 DD ヘッダ内にある命令以外の文字列を削除 + var startIndex = strInput.IndexOf("#START"); + if (startIndex < 0) { + Trace.TraceWarning($"#START命令が少なくとも1つは必要です。 ({strファイル名の絶対パス})"); + } + string strInputHeader = strInput.Remove(startIndex); + strInput = strInput.Remove(0, startIndex); + strInput = strInputHeader + "\n" + strInput; + + //どうせ使わないので先にSplitしてコメントを削除。 + var strSplitした譜面 = (string[])this.str改行文字を削除する(strInput, 1); + + for (int i = 0; strSplitした譜面.Length > i; i++) { + int idx = strSplitした譜面[i].IndexOf("//"); + if (idx >= 0) + strSplitした譜面[i] = strSplitした譜面[i].Substring(0, idx); + } + //空のstring配列を詰める + strSplitした譜面 = this.t空のstring配列を詰めたstring配列を返す(strSplitした譜面); + + #region[ヘッダ] + + //2015.05.21 kairera0467 + //ヘッダの読み込みは譜面全体から該当する命令を探す。 + //少し処理が遅くなる可能性はあるが、ここは正確性を重視する。 + //点数などの指定は後から各コースで行うので問題は無いだろう。 + + //SplitしたヘッダのLengthの回数だけ、forで回して各種情報を読み取っていく。 + for (int i = 0; strSplitした譜面.Length > i; i++) { + this.t入力_行解析ヘッダ(strSplitした譜面[i]); + } + #endregion + + #region[譜面] + + int n読み込むコース = 3; + int n譜面数 = 0; //2017.07.22 kairera0467 tjaに含まれる譜面の数 + bool b新処理 = false; + + //まずはコースごとに譜面を分割。 + strSplitした譜面 = this.tコースで譜面を分割する(this.StringArrayToString(strSplitした譜面, "\n")); + string strTest = ""; + //存在するかのフラグ作成。 + for (int i = 0; i < strSplitした譜面.Length; i++) { + if (!String.IsNullOrEmpty(strSplitした譜面[i])) { + this.b譜面が存在する[i] = true; + n譜面数++; } else - n読み込むコース = difficulty; - #endregion - - //指定したコースの譜面の命令を消去する。 - strSplitした譜面[n読み込むコース] = CDTXStyleExtractor.tセッション譜面がある( - strSplitした譜面[n読み込むコース], - OpenTaiko.ConfigIni.nPlayerCount > 1 ? (this.nPlayerSide + 1) : 0, - this.strファイル名の絶対パス); - - //命令をすべて消去した譜面 - var str命令消去譜面 = strSplitした譜面[n読み込むコース].Split(this.dlmtEnter, StringSplitOptions.RemoveEmptyEntries); + this.b譜面が存在する[i] = false; + } + + #region[ 読み込ませるコースを決定 ] + if (this.b譜面が存在する[difficulty] == false) { + n読み込むコース = difficulty; + n読み込むコース++; + for (int n = 1; n < (int)Difficulty.Total; n++) { + if (this.b譜面が存在する[n読み込むコース] == false) { + n読み込むコース++; + if (n読み込むコース > (int)Difficulty.Total - 1) + n読み込むコース = 0; + } else + break; + } + } else + n読み込むコース = difficulty; + #endregion + + //指定したコースの譜面の命令を消去する。 + strSplitした譜面[n読み込むコース] = CDTXStyleExtractor.tセッション譜面がある( + strSplitした譜面[n読み込むコース], + OpenTaiko.ConfigIni.nPlayerCount > 1 ? (this.nPlayerSide + 1) : 0, + this.strファイル名の絶対パス); + + //命令をすべて消去した譜面 + var str命令消去譜面 = strSplitした譜面[n読み込むコース].Split(this.dlmtEnter, StringSplitOptions.RemoveEmptyEntries); - str命令消去譜面 = this.tコマンド行を削除したTJAを返す(str命令消去譜面, 2); - - //ここで1行の文字数をカウント。配列にして返す。 - var strSplit読み込むコース = strSplitした譜面[n読み込むコース].Split(this.dlmtEnter, StringSplitOptions.RemoveEmptyEntries); - string str = ""; - try { - if (n譜面数 > 0) { - //2017.07.22 kairera0467 譜面が2つ以上ある場合はCOURSE以下のBALLOON命令を使う - this.listBalloon.Clear(); - this.listBalloon_Normal.Clear(); - this.listBalloon_Expert.Clear(); - this.listBalloon_Master.Clear(); - this.listBalloon_Normal_数値管理 = 0; - this.listBalloon_Expert_数値管理 = 0; - this.listBalloon_Master_数値管理 = 0; + str命令消去譜面 = this.tコマンド行を削除したTJAを返す(str命令消去譜面, 2); + + //ここで1行の文字数をカウント。配列にして返す。 + var strSplit読み込むコース = strSplitした譜面[n読み込むコース].Split(this.dlmtEnter, StringSplitOptions.RemoveEmptyEntries); + string str = ""; + try { + if (n譜面数 > 0) { + //2017.07.22 kairera0467 譜面が2つ以上ある場合はCOURSE以下のBALLOON命令を使う + this.listBalloon.Clear(); + this.listBalloon_Normal.Clear(); + this.listBalloon_Expert.Clear(); + this.listBalloon_Master.Clear(); + this.listBalloon_Normal_数値管理 = 0; + this.listBalloon_Expert_数値管理 = 0; + this.listBalloon_Master_数値管理 = 0; + } + + for (int i = 0; i < strSplit読み込むコース.Length; i++) { + if (!String.IsNullOrEmpty(strSplit読み込むコース[i])) { + this.t難易度別ヘッダ(strSplit読み込むコース[i]); } - - for (int i = 0; i < strSplit読み込むコース.Length; i++) { - if (!String.IsNullOrEmpty(strSplit読み込むコース[i])) { - this.t難易度別ヘッダ(strSplit読み込むコース[i]); - } - } - for (int i = 0; i < str命令消去譜面.Length; i++) { - if (str命令消去譜面[i].IndexOf(',', 0) == -1 && !String.IsNullOrEmpty(str命令消去譜面[i])) { - if (str命令消去譜面[i].Substring(0, 1) == "#") { - this.t1小節の文字数をカウントしてリストに追加する(str + str命令消去譜面[i]); - } - - if (NotesManager.FastFlankedParsing(str命令消去譜面[i]))//this.CharConvertNote(str命令消去譜面[i].Substring(0, 1)) != -1) - str += str命令消去譜面[i]; - } else { + } + for (int i = 0; i < str命令消去譜面.Length; i++) { + if (str命令消去譜面[i].IndexOf(',', 0) == -1 && !String.IsNullOrEmpty(str命令消去譜面[i])) { + if (str命令消去譜面[i].Substring(0, 1) == "#") { this.t1小節の文字数をカウントしてリストに追加する(str + str命令消去譜面[i]); - str = ""; } - } - } catch (Exception ex) { - Trace.TraceError(ex.ToString()); - Trace.TraceError("例外が発生しましたが処理を継続します。 (9e401212-0b78-4073-88d0-f7e791f36a91)"); - } - - //読み込み部分本体に渡す譜面を作成。 - //0:ヘッダー情報 1:#START以降 となる。個数の定義は後からされるため、ここでは省略。 - var strSplitした後の譜面 = strSplit読み込むコース; //strSplitした譜面[ n読み込むコース ].Split( this.dlmtEnter, StringSplitOptions.RemoveEmptyEntries ); - strSplitした後の譜面 = this.tコマンド行を削除したTJAを返す(strSplitした後の譜面, 1); - this.n現在の小節数 = 1; - try { - #region[ 最初の処理 ] - //1小節の時間を挿入して開始時間を調節。 - this.dbNowTime += ((15000.0 / 120.0 * (4.0 / 4.0)) * 16.0); - #endregion - for (int i = 0; strSplitした後の譜面.Length > i; i++) { - nNowReadLine++; - str = strSplitした後の譜面[i]; - this.t入力_行解析譜面_V4(str); - } - - // Retrieve all the global exams (non individual) at the end - if (DanSongs.Number > 0) { - for (int i = 0; i < CExamInfo.cMaxExam; i++) { - if (Dan_C[i] != null && List_DanSongs[0].Dan_C[i] == null) { - List_DanSongs[0].Dan_C[i] = Dan_C[i]; - } - } - } - } catch (Exception ex) { - Trace.TraceError(ex.ToString()); - Trace.TraceError("例外が発生しましたが処理を継続します。 (2da1e880-6b63-4e82-b018-bf18c3568335)"); - } + if (NotesManager.FastFlankedParsing(str命令消去譜面[i]))//this.CharConvertNote(str命令消去譜面[i].Substring(0, 1)) != -1) + str += str命令消去譜面[i]; + } else { + this.t1小節の文字数をカウントしてリストに追加する(str + str命令消去譜面[i]); + str = ""; + } + } + } catch (Exception ex) { + Trace.TraceError(ex.ToString()); + Trace.TraceError("例外が発生しましたが処理を継続します。 (9e401212-0b78-4073-88d0-f7e791f36a91)"); + } + + //読み込み部分本体に渡す譜面を作成。 + //0:ヘッダー情報 1:#START以降 となる。個数の定義は後からされるため、ここでは省略。 + var strSplitした後の譜面 = strSplit読み込むコース; //strSplitした譜面[ n読み込むコース ].Split( this.dlmtEnter, StringSplitOptions.RemoveEmptyEntries ); + strSplitした後の譜面 = this.tコマンド行を削除したTJAを返す(strSplitした後の譜面, 1); + this.n現在の小節数 = 1; + try { + #region[ 最初の処理 ] + //1小節の時間を挿入して開始時間を調節。 + this.dbNowTime += ((15000.0 / 120.0 * (4.0 / 4.0)) * 16.0); #endregion + for (int i = 0; strSplitした後の譜面.Length > i; i++) { + nNowReadLine++; + str = strSplitした後の譜面[i]; + this.t入力_行解析譜面_V4(str); + } + + // Retrieve all the global exams (non individual) at the end + if (DanSongs.Number > 0) { + for (int i = 0; i < CExamInfo.cMaxExam; i++) { + if (Dan_C[i] != null && List_DanSongs[0].Dan_C[i] == null) { + List_DanSongs[0].Dan_C[i] = Dan_C[i]; + } + } + } + + } catch (Exception ex) { + Trace.TraceError(ex.ToString()); + Trace.TraceError("例外が発生しましたが処理を継続します。 (2da1e880-6b63-4e82-b018-bf18c3568335)"); + } + #endregion + } + } + + private CChip t発声位置から過去方向で一番近くにある指定チャンネルのチップを返す(int n発声時刻, int nチャンネル番号) { + //過去方向への検索 + for (int i = this.listChip.Count - 1; i >= 0; i--) { + if (this.listChip[i].nチャンネル番号 == nチャンネル番号) { + return this.listChip[i]; } } - private CChip t発声位置から過去方向で一番近くにある指定チャンネルのチップを返す(int n発声時刻, int nチャンネル番号) { - //過去方向への検索 - for (int i = this.listChip.Count - 1; i >= 0; i--) { - if (this.listChip[i].nチャンネル番号 == nチャンネル番号) { - return this.listChip[i]; + return null; + } + + //現在、以下のような行には対応できていません。 + //_パラメータを持つ命令がある + //_行の途中に命令がある + private int t文字数解析(string InputText) { + int n文字数 = 0; + + for (int i = 0; i < InputText.Length; i++) { + if (this.CharConvertNote(InputText.Substring(i, 1)) != -1) { + n文字数++; + } + } + + + return n文字数; + } + + private static readonly Regex CommandAndArgumentRegex = + new Regex(@"^(#[A-Z]+)(?:\s?)(.+?)?$", RegexOptions.Compiled); + + private static readonly Regex BranchStartArgumentRegex = + new Regex(@"^([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)$", RegexOptions.Compiled); + + private void AddError(string command, string argument) { + listErrors.Add($"コメントアウトを除く{(Difficulty)nDifficulty}の{nNowReadLine}行目の{command}が正しくありません。値が{argument}になっています"); + } + private void AddError_Single(string str) { + listErrors.Add($"コメントアウトを除く{(Difficulty)nDifficulty}の{nNowReadLine}行目の{str}"); + } + private void AddError(string str) { + listErrors.Add(str); + } + + private string[] SplitComma(string input) { + var result = new List(); + var workingIndex = 0; + for (int i = 0; i < input.Length; i++) { + if (input[i].Equals(',')) // カンマにぶち当たった + { + if (i - 1 >= 0)// &&演算子でも、例外が起きるので... + { + if (input[i - 1].Equals('\\')) // 1文字前がバックスラッシュ + { + input = input.Remove(i - 1, 1); + } else { + // workingIndexから今の位置までをリストにブチ込む + result.Add(input.Substring(workingIndex, i - workingIndex)); + // workingIndexに今の位置+1を代入 + workingIndex = i + 1; + } + } else { + // workingIndexから今の位置までをリストにブチ込む + result.Add(input.Substring(workingIndex, i - workingIndex)); + // workingIndexに今の位置+1を代入 + workingIndex = i + 1; } } - - return null; - } - - //現在、以下のような行には対応できていません。 - //_パラメータを持つ命令がある - //_行の途中に命令がある - private int t文字数解析(string InputText) { - int n文字数 = 0; - - for (int i = 0; i < InputText.Length; i++) { - if (this.CharConvertNote(InputText.Substring(i, 1)) != -1) { - n文字数++; - } + if (i + 1 == input.Length) // 最後に + { + result.Add(input.Substring(workingIndex, input.Length - workingIndex)); } - - - return n文字数; } + return result.ToArray(); + } - private static readonly Regex CommandAndArgumentRegex = - new Regex(@"^(#[A-Z]+)(?:\s?)(.+?)?$", RegexOptions.Compiled); + /// + /// 譜面読み込みメソッドV4で使用。 + /// + /// + private void t命令を挿入する(string InputText) { + #region [Split comma and arguments values] - private static readonly Regex BranchStartArgumentRegex = - new Regex(@"^([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)$", RegexOptions.Compiled); - - private void AddError(string command, string argument) { - listErrors.Add($"コメントアウトを除く{(Difficulty)nDifficulty}の{nNowReadLine}行目の{command}が正しくありません。値が{argument}になっています"); - } - private void AddError_Single(string str) { - listErrors.Add($"コメントアウトを除く{(Difficulty)nDifficulty}の{nNowReadLine}行目の{str}"); - } - private void AddError(string str) { - listErrors.Add(str); - } - - private string[] SplitComma(string input) { + string[] SplitComma(string input) { var result = new List(); var workingIndex = 0; for (int i = 0; i < input.Length; i++) { - if (input[i].Equals(',')) // カンマにぶち当たった + if (input[i] == ',') // カンマにぶち当たった { - if (i - 1 >= 0)// &&演算子でも、例外が起きるので... + if (input[i - 1] == '\\') // 1文字前がバックスラッシュ { - if (input[i - 1].Equals('\\')) // 1文字前がバックスラッシュ - { - input = input.Remove(i - 1, 1); - } else { - // workingIndexから今の位置までをリストにブチ込む - result.Add(input.Substring(workingIndex, i - workingIndex)); - // workingIndexに今の位置+1を代入 - workingIndex = i + 1; - } - } else { - // workingIndexから今の位置までをリストにブチ込む - result.Add(input.Substring(workingIndex, i - workingIndex)); - // workingIndexに今の位置+1を代入 + input = input.Remove(i - 1, 1); + } else { + // workingIndexから今の位置までをリストにブチ込む + result.Add(input.Substring(workingIndex, i - workingIndex)); + // workingIndexに今の位置+1を代入 workingIndex = i + 1; } } - if (i + 1 == input.Length) // 最後に + if (i + 1 == input.Length) // 最後に { result.Add(input.Substring(workingIndex, input.Length - workingIndex)); } } return result.ToArray(); - } - - /// - /// 譜面読み込みメソッドV4で使用。 - /// - /// - private void t命令を挿入する(string InputText) { - #region [Split comma and arguments values] - - string[] SplitComma(string input) { - var result = new List(); - var workingIndex = 0; - for (int i = 0; i < input.Length; i++) { - if (input[i] == ',') // カンマにぶち当たった - { - if (input[i - 1] == '\\') // 1文字前がバックスラッシュ - { - input = input.Remove(i - 1, 1); - } else { - // workingIndexから今の位置までをリストにブチ込む - result.Add(input.Substring(workingIndex, i - workingIndex)); - // workingIndexに今の位置+1を代入 - workingIndex = i + 1; - } - } - if (i + 1 == input.Length) // 最後に - { - result.Add(input.Substring(workingIndex, input.Length - workingIndex)); - } - } - return result.ToArray(); - } + } - var match = CommandAndArgumentRegex.Match(InputText); - if (!match.Success) { - return; - } + var match = CommandAndArgumentRegex.Match(InputText); + if (!match.Success) { + return; + } - var command = match.Groups[1].Value; - var argumentMatchGroup = match.Groups[2]; - var argument = argumentMatchGroup.Success ? argumentMatchGroup.Value : null; + var command = match.Groups[1].Value; + var argumentMatchGroup = match.Groups[2]; + var argument = argumentMatchGroup.Success ? argumentMatchGroup.Value : null; - while (true) {//命令の最後に,が残ってしまっているときの対応 - if (argument != null && argument[argument.Length - 1] == ',') - argument = argument.Substring(0, argument.Length - 1); - else - break; - } + while (true) {//命令の最後に,が残ってしまっているときの対応 + if (argument != null && argument[argument.Length - 1] == ',') + argument = argument.Substring(0, argument.Length - 1); + else + break; + } - char[] chDelimiter = new char[] { ' ' }; - string[] strArray = null; - - #endregion - - if (command == "#START") { - //#STARTと同時に鳴らすのはどうかと思うけどしゃーなしだな。 - AddMusicPreTimeMs(); // 音源を鳴らす前に遅延。 - var chip = new CChip(); + char[] chDelimiter = new char[] { ' ' }; + string[] strArray = null; - chip.nチャンネル番号 = 0x01; - chip.n発声位置 = 384; - chip.n発声時刻ms = (int)this.dbNowTime; - chip.fNow_Measure_m = this.fNow_Measure_m; - chip.fNow_Measure_s = this.fNow_Measure_s; - chip.fBMSCROLLTime = this.dbNowBMScollTime; - chip.n整数値 = 0x01; - chip.n整数値_内部番号 = 1; - - // チップを配置。 - this.listChip.Add(chip); + #endregion - var chip1 = new CChip(); - chip1.nチャンネル番号 = 0x54; - if (this.nMOVIEOFFSET == 0) - chip1.n発声時刻ms = (int)this.dbNowTime; - else - chip1.n発声時刻ms = (int)this.nMOVIEOFFSET; - chip1.dbBPM = this.dbNowBPM; - chip1.fNow_Measure_m = this.fNow_Measure_m; - chip1.fNow_Measure_s = this.fNow_Measure_s; - chip1.dbSCROLL = this.dbNowScroll; - chip1.n整数値 = 0x01; - chip1.n整数値_内部番号 = 1; - - // チップを配置。 - - this.listChip.Add(chip1); - } else if (command == "#END") { - //ためしに割り込む。 - var chip = new CChip(); + if (command == "#START") { + //#STARTと同時に鳴らすのはどうかと思うけどしゃーなしだな。 + AddMusicPreTimeMs(); // 音源を鳴らす前に遅延。 + var chip = new CChip(); - chip.nチャンネル番号 = 0xFF; - chip.n発声位置 = ((this.n現在の小節数 + 2) * 384); - chip.n発声時刻ms = (int)(this.dbNowTime + 1000); //2016.07.16 kairera0467 終了時から1秒後に設置するよう変更。 - chip.fNow_Measure_m = this.fNow_Measure_m; - chip.fNow_Measure_s = this.fNow_Measure_s; - chip.n整数値 = 0xFF; - chip.n整数値_内部番号 = 1; - // チップを配置。 - - if (n参照中の難易度 == (int)Difficulty.Dan) { - for (int i = listChip.Count - 1; i >= 0; i--) { - if (NotesManager.IsHittableNote(listChip[i])) { - if (DanSongs.Number != 0) { - Array.Resize(ref this.pDan_LastChip, this.pDan_LastChip.Length + 1); - this.pDan_LastChip[DanSongs.Number - 1] = listChip[i]; - break; - } - } - } - } + chip.nチャンネル番号 = 0x01; + chip.n発声位置 = 384; + chip.n発声時刻ms = (int)this.dbNowTime; + chip.fNow_Measure_m = this.fNow_Measure_m; + chip.fNow_Measure_s = this.fNow_Measure_s; + chip.fBMSCROLLTime = this.dbNowBMScollTime; + chip.n整数値 = 0x01; + chip.n整数値_内部番号 = 1; - this.listChip.Add(chip); - } else if (command == "#BPMCHANGE") { - double dbBPM; - if (!double.TryParse(argument, out dbBPM)) { - AddError(command, argument); - dbBPM = 150; - } - this.dbNowBPM = dbBPM; + // チップを配置。 + this.listChip.Add(chip); - if (dbBPM > MaxBPM) { - MaxBPM = dbBPM; - } else if (dbBPM < MinBPM) { - MinBPM = dbBPM; - } - - this.listBPM.Add(this.n内部番号BPM1to - 1, new CBPM() { n内部番号 = this.n内部番号BPM1to - 1, n表記上の番号 = 0, dbBPM値 = dbBPM, bpm_change_time = this.dbNowTime - nNextSongOffset, bpm_change_bmscroll_time = this.dbNowBMScollTime, bpm_change_course = this.n現在のコース }); - - - //チップ追加して割り込んでみる。 - var chip = new CChip(); - - chip.nチャンネル番号 = 0x08; - chip.n発声位置 = ((this.n現在の小節数) * 384); - chip.n発声時刻ms = (int)this.dbNowTime; - chip.fNow_Measure_m = this.fNow_Measure_m; - chip.fNow_Measure_s = this.fNow_Measure_s; - chip.fBMSCROLLTime = (float)this.dbNowBMScollTime; - chip.dbBPM = dbBPM; - chip.n整数値_内部番号 = this.n内部番号BPM1to - 1; - - // チップを配置。 - - this.listChip.Add(chip); - - var chip1 = new CChip(); - chip1.nチャンネル番号 = 0x9C; - chip1.n発声位置 = ((this.n現在の小節数) * 384); + var chip1 = new CChip(); + chip1.nチャンネル番号 = 0x54; + if (this.nMOVIEOFFSET == 0) chip1.n発声時刻ms = (int)this.dbNowTime; - chip.fNow_Measure_m = this.fNow_Measure_m; - chip.fNow_Measure_s = this.fNow_Measure_s; - chip1.fBMSCROLLTime = (float)this.dbNowBMScollTime; - chip1.dbBPM = dbBPM; - chip1.dbSCROLL = this.dbNowScroll; - chip1.n整数値_内部番号 = this.n内部番号BPM1to - 1; - - // チップを配置。 - - this.listChip.Add(chip1); - - this.n内部番号BPM1to++; - } else if (command == "#SCROLL") { - //2016.08.13 kairera0467 複素数スクロールもどきのテスト - if (argument.IndexOf('i') != -1) { - //iが入っていた場合、複素数スクロールとみなす。 - - double[] dbComplexNum = new double[2]; - try { - this.tParsedComplexNumber(argument, ref dbComplexNum); - } catch (Exception ex) { - AddError(command, argument); - dbComplexNum[0] = 1.0; - dbComplexNum[1] = 0.0; - } - - this.dbNowScroll = dbComplexNum[0]; - this.dbNowScrollY = dbComplexNum[1]; - - this.listSCROLL.Add(this.n内部番号SCROLL1to, new CSCROLL() { n内部番号 = this.n内部番号SCROLL1to, n表記上の番号 = 0, dbSCROLL値 = dbComplexNum[0], dbSCROLL値Y = dbComplexNum[1] }); - - switch (this.n現在のコース) { - case ECourse.eNormal: - this.dbNowSCROLL_Normal[0] = dbComplexNum[0]; - this.dbNowSCROLL_Normal[1] = dbComplexNum[1]; - break; - case ECourse.eExpert: - this.dbNowSCROLL_Expert[0] = dbComplexNum[0]; - this.dbNowSCROLL_Expert[1] = dbComplexNum[1]; - break; - case ECourse.eMaster: - this.dbNowSCROLL_Master[0] = dbComplexNum[0]; - this.dbNowSCROLL_Master[1] = dbComplexNum[1]; - break; - default: - this.dbNowSCROLL_Normal[0] = dbComplexNum[0]; - this.dbNowSCROLL_Normal[1] = dbComplexNum[1]; - break; - } - - //チップ追加して割り込んでみる。 - var chip = new CChip(); - - chip.nチャンネル番号 = 0x9D; - chip.n発声位置 = ((this.n現在の小節数) * 384) - 1; - chip.n発声時刻ms = (int)this.dbNowTime; - chip.fNow_Measure_m = this.fNow_Measure_m; - chip.fNow_Measure_s = this.fNow_Measure_s; - chip.n整数値_内部番号 = this.n内部番号SCROLL1to; - chip.dbSCROLL = dbComplexNum[0]; - chip.dbSCROLL_Y = dbComplexNum[1]; - chip.nコース = this.n現在のコース; - - // チップを配置。 - - this.listChip.Add(chip); - } else { - double dbSCROLL = 1.0; - if (!double.TryParse(argument, out dbSCROLL)) { - AddError(command, argument); - dbSCROLL = 1; - } - - this.dbNowScroll = dbSCROLL; - this.dbNowScrollY = 0.0; - - this.listSCROLL.Add(this.n内部番号SCROLL1to, new CSCROLL() { n内部番号 = this.n内部番号SCROLL1to, n表記上の番号 = 0, dbSCROLL値 = dbSCROLL, dbSCROLL値Y = 0.0 }); - - switch (this.n現在のコース) { - case ECourse.eNormal: - this.dbNowSCROLL_Normal[0] = dbSCROLL; - break; - case ECourse.eExpert: - this.dbNowSCROLL_Expert[0] = dbSCROLL; - break; - case ECourse.eMaster: - this.dbNowSCROLL_Master[0] = dbSCROLL; - break; - } - - //チップ追加して割り込んでみる。 - var chip = new CChip(); - - chip.nチャンネル番号 = 0x9D; - chip.n発声位置 = ((this.n現在の小節数) * 384) - 1; - chip.n発声時刻ms = (int)this.dbNowTime; - chip.fNow_Measure_m = this.fNow_Measure_m; - chip.fNow_Measure_s = this.fNow_Measure_s; - chip.n整数値_内部番号 = this.n内部番号SCROLL1to; - chip.dbSCROLL = dbSCROLL; - chip.dbSCROLL_Y = 0.0; - chip.nコース = this.n現在のコース; - - // チップを配置。 - - this.listChip.Add(chip); - } - this.n内部番号SCROLL1to++; - } else if (command == "#MEASURE") { - strArray = argument.Split(new char[] { '/' }); - WarnSplitLength("#MEASURE subsplit", strArray, 2); - - double[] dbLength = new double[2]; - try { - dbLength[0] = Convert.ToDouble(strArray[0]); - dbLength[1] = Convert.ToDouble(strArray[1]); - } catch (Exception ex) { - AddError(command, argument); - } - - double db小節長倍率 = dbLength[0] / dbLength[1]; - this.dbBarLength = db小節長倍率; - this.fNow_Measure_m = (float)dbLength[1]; - this.fNow_Measure_s = (float)dbLength[0]; - - var chip = new CChip(); - - chip.nチャンネル番号 = 0x02; - chip.n発声位置 = ((this.n現在の小節数) * 384); - chip.n発声時刻ms = (int)this.dbNowTime; - chip.fNow_Measure_m = this.fNow_Measure_m; - chip.fNow_Measure_s = this.fNow_Measure_s; - chip.dbSCROLL = this.dbNowScroll; - chip.db実数値 = db小節長倍率; - chip.n整数値_内部番号 = 1; - // チップを配置。 - - this.listChip.Add(chip); - } else if (command == "#DELAY") { - double nDELAY = 0; - if (!double.TryParse(argument, out nDELAY)) { - AddError(command, argument); - nDELAY = 0; - } - nDELAY *= 1000; - - this.listDELAY.Add(this.n内部番号DELAY1to, new CDELAY() { n内部番号 = this.n内部番号DELAY1to, n表記上の番号 = 0, nDELAY値 = (int)nDELAY, delay_bmscroll_time = this.dbLastBMScrollTime, delay_bpm = this.dbNowBPM, delay_course = this.n現在のコース, delay_time = this.dbLastTime }); - //チップ追加して割り込んでみる。 - var chip = new CChip(); - - chip.nチャンネル番号 = 0xDC; - chip.n発声位置 = ((this.n現在の小節数) * 384); - chip.db発声時刻ms = this.dbNowTime; - chip.fNow_Measure_m = this.fNow_Measure_m; - chip.fNow_Measure_s = this.fNow_Measure_s; - chip.nコース = this.n現在のコース; - chip.n整数値_内部番号 = this.n内部番号DELAY1to; - chip.fBMSCROLLTime = this.dbNowBMScollTime; - // チップを配置。 - - this.dbNowTime += nDELAY; - this.dbNowBMScollTime += nDELAY * this.dbNowBPM / 15000; - - this.listChip.Add(chip); - this.n内部番号DELAY1to++; - } else if (command == "#GOGOSTART") { - var chip = new CChip(); - - chip.nチャンネル番号 = 0x9E; - chip.n発声位置 = ((this.n現在の小節数) * 384); - chip.dbBPM = this.dbNowBPM; - chip.n発声時刻ms = (int)this.dbNowTime; - chip.fNow_Measure_m = this.fNow_Measure_m; - chip.fNow_Measure_s = this.fNow_Measure_s; - chip.n整数値_内部番号 = 1; - this.bGOGOTIME = true; - - // チップを配置。 - this.listChip.Add(chip); - } else if (command == "#GOGOEND") { - var chip = new CChip(); - - chip.nチャンネル番号 = 0x9F; - chip.n発声位置 = ((this.n現在の小節数) * 384); - chip.n発声時刻ms = (int)this.dbNowTime; - chip.fNow_Measure_m = this.fNow_Measure_m; - chip.fNow_Measure_s = this.fNow_Measure_s; - chip.dbBPM = this.dbNowBPM; - chip.n整数値_内部番号 = 1; - this.bGOGOTIME = false; - - // チップを配置。 - this.listChip.Add(chip); - } else if (command == "#BGAON") { - try { - var commandData = argument.Split(' '); - string listvdIndex = commandData[0]; - var bgaStartTime = commandData[1]; - int index = (10 * int.Parse(listvdIndex[0].ToString())) + int.Parse(listvdIndex[1].ToString()) + 2; - - var chip = new CChip(); - chip.nチャンネル番号 = 0x54; - chip.n発声位置 = ((this.n現在の小節数) * 384); - chip.dbBPM = this.dbNowBPM; - chip.n発声時刻ms = (int)this.dbNowTime; - chip.fNow_Measure_m = this.fNow_Measure_m; - chip.fNow_Measure_s = this.fNow_Measure_s; - chip.n整数値_内部番号 = index; - chip.n整数値 = index; - - chip.VideoStartTimeMs = (int)(float.Parse(bgaStartTime) * 1000); - - // チップを配置。 - this.listChip.Add(chip); - } catch (Exception ex) { - AddError(command, argument); - } - } else if (command == "#BGAOFF") { - int index = (10 * int.Parse(argument[0].ToString())) + int.Parse(argument[1].ToString()) + 2; - var chip = new CChip(); - chip.nチャンネル番号 = 0x55; - chip.n発声位置 = ((this.n現在の小節数) * 384); - chip.dbBPM = this.dbNowBPM; - chip.n発声時刻ms = (int)this.dbNowTime; - chip.fNow_Measure_m = this.fNow_Measure_m; - chip.fNow_Measure_s = this.fNow_Measure_s; - chip.n整数値_内部番号 = index; - chip.n整数値 = index; - - // チップを配置。 - this.listChip.Add(chip); - } else if (command == "#CAMVMOVESTART") { - if (currentCamVMoveChip == null) { - //starts vertical camera moving - //arguments: ,,, - var chip = new CChip(); - - chip.nチャンネル番号 = 0xA0; - chip.n発声位置 = ((this.n現在の小節数) * 384); - chip.dbBPM = this.dbNowBPM; - chip.n発声時刻ms = (int)this.dbNowTime; - chip.fNow_Measure_m = this.fNow_Measure_m; - chip.fNow_Measure_s = this.fNow_Measure_s; - chip.n整数値_内部番号 = 0; - - try { - string[] args = argument.Split(','); - chip.fCamScrollStartY = float.Parse(args[0]); - chip.fCamScrollEndY = float.Parse(args[1]); - chip.strCamEaseType = args[2]; - - var type = args[3]; - var eType = Easing.CalcType.Quadratic; - switch (type) { - case "CUBIC": - eType = Easing.CalcType.Cubic; - break; - case "QUARTIC": - eType = Easing.CalcType.Quartic; - break; - case "QUINTIC": - eType = Easing.CalcType.Quintic; - break; - case "SINUSOIDAL": - eType = Easing.CalcType.Sinusoidal; - break; - case "EXPONENTIAL": - eType = Easing.CalcType.Exponential; - break; - case "CIRCULAR": - eType = Easing.CalcType.Circular; - break; - case "LINEAR": - eType = Easing.CalcType.Linear; - break; - } - - chip.fCamMoveType = eType; - - currentCamVMoveChip = chip; - - // チップを配置。 - this.listChip.Add(chip); - } catch (Exception ex) { - AddError(command, argument); - } - } else { - AddError_Single("Missing #CAMVMOVEEND"); - Trace.TraceInformation("TJA ERROR: Missing #CAMVMOVEEND"); - } - } else if (command == "#CAMVMOVEEND") { - if (currentCamVMoveChip != null) { - //ends vertical camera moving - var chip = new CChip(); - - chip.nチャンネル番号 = 0xA1; - chip.n発声位置 = ((this.n現在の小節数) * 384); - chip.dbBPM = this.dbNowBPM; - chip.n発声時刻ms = (int)this.dbNowTime; - chip.fNow_Measure_m = this.fNow_Measure_m; - chip.fNow_Measure_s = this.fNow_Measure_s; - chip.n整数値_内部番号 = 1; - - var index = this.listChip.IndexOf(currentCamVMoveChip); - var msDiff = chip.n発声時刻ms - currentCamVMoveChip.n発声時刻ms; - - currentCamVMoveChip.fCamTimeMs = msDiff; - this.listChip[index] = currentCamVMoveChip; - - currentCamVMoveChip = null; - - // チップを配置。 - this.listChip.Add(chip); - } else { - AddError_Single("Missing #CAMVMOVESTART"); - Trace.TraceInformation("TJA ERROR: Missing #CAMVMOVESTART"); - } - } else if (command == "#CAMHMOVESTART") { - if (currentCamHMoveChip == null) { - //starts horizontal camera moving - //arguments: ,,, - var chip = new CChip(); - - chip.nチャンネル番号 = 0xA2; - chip.n発声位置 = ((this.n現在の小節数) * 384); - chip.dbBPM = this.dbNowBPM; - chip.n発声時刻ms = (int)this.dbNowTime; - chip.fNow_Measure_m = this.fNow_Measure_m; - chip.fNow_Measure_s = this.fNow_Measure_s; - chip.n整数値_内部番号 = 1; - - try { - string[] args = argument.Split(','); - chip.fCamScrollStartX = float.Parse(args[0]); - chip.fCamScrollEndX = float.Parse(args[1]); - chip.strCamEaseType = args[2]; - - var type = args[3]; - var eType = Easing.CalcType.Quadratic; - switch (type) { - case "CUBIC": - eType = Easing.CalcType.Cubic; - break; - case "QUARTIC": - eType = Easing.CalcType.Quartic; - break; - case "QUINTIC": - eType = Easing.CalcType.Quintic; - break; - case "SINUSOIDAL": - eType = Easing.CalcType.Sinusoidal; - break; - case "EXPONENTIAL": - eType = Easing.CalcType.Exponential; - break; - case "CIRCULAR": - eType = Easing.CalcType.Circular; - break; - case "LINEAR": - eType = Easing.CalcType.Linear; - break; - default: - break; - } - - chip.fCamMoveType = eType; - - currentCamHMoveChip = chip; - - // チップを配置。 - this.listChip.Add(chip); - } catch (Exception ex) { - AddError(command, argument); - } - } else { - AddError_Single("Missing #CAMHMOVEEND"); - Trace.TraceInformation("TJA ERROR: Missing #CAMHMOVEEND"); - } - } else if (command == "#CAMHMOVEEND") { - if (currentCamHMoveChip != null) { - //ends horizontal camera moving - var chip = new CChip(); - - chip.nチャンネル番号 = 0xA3; - chip.n発声位置 = ((this.n現在の小節数) * 384); - chip.dbBPM = this.dbNowBPM; - chip.n発声時刻ms = (int)this.dbNowTime; - chip.fNow_Measure_m = this.fNow_Measure_m; - chip.fNow_Measure_s = this.fNow_Measure_s; - chip.n整数値_内部番号 = 1; - - var index = this.listChip.IndexOf(currentCamHMoveChip); - var msDiff = chip.n発声時刻ms - currentCamHMoveChip.n発声時刻ms; - - currentCamHMoveChip.fCamTimeMs = msDiff; - this.listChip[index] = currentCamHMoveChip; - - currentCamHMoveChip = null; - - // チップを配置。 - this.listChip.Add(chip); - } else { - AddError_Single("Missing #CAMHMOVESTART"); - Trace.TraceInformation("TJA ERROR: Missing #CAMHMOVESTART"); - } - } else if (command == "#CAMZOOMSTART") { - if (currentCamZoomChip == null) { - //starts zooming in/out the screen - //arguments: ,,, - var chip = new CChip(); - - chip.nチャンネル番号 = 0xA4; - chip.n発声位置 = ((this.n現在の小節数) * 384); - chip.dbBPM = this.dbNowBPM; - chip.n発声時刻ms = (int)this.dbNowTime; - chip.fNow_Measure_m = this.fNow_Measure_m; - chip.fNow_Measure_s = this.fNow_Measure_s; - chip.n整数値_内部番号 = 1; - - try { - string[] args = argument.Split(','); - chip.fCamZoomStart = float.Parse(args[0]); - chip.fCamZoomEnd = float.Parse(args[1]); - chip.strCamEaseType = args[2]; - - var type = args[3]; - var eType = Easing.CalcType.Quadratic; - switch (type) { - case "CUBIC": - eType = Easing.CalcType.Cubic; - break; - case "QUARTIC": - eType = Easing.CalcType.Quartic; - break; - case "QUINTIC": - eType = Easing.CalcType.Quintic; - break; - case "SINUSOIDAL": - eType = Easing.CalcType.Sinusoidal; - break; - case "EXPONENTIAL": - eType = Easing.CalcType.Exponential; - break; - case "CIRCULAR": - eType = Easing.CalcType.Circular; - break; - case "LINEAR": - eType = Easing.CalcType.Linear; - break; - } - - chip.fCamMoveType = eType; - - currentCamZoomChip = chip; - - // チップを配置。 - this.listChip.Add(chip); - } catch (Exception ex) { - AddError(command, argument); - } - } else { - AddError_Single("Missing #CAMZOOMEND"); - Trace.TraceInformation("TJA ERROR: Missing #CAMZOOMEND"); - } - } else if (command == "#CAMZOOMEND") { - if (currentCamZoomChip != null) { - //stops zooming - var chip = new CChip(); - - chip.nチャンネル番号 = 0xA5; - chip.n発声位置 = ((this.n現在の小節数) * 384); - chip.dbBPM = this.dbNowBPM; - chip.n発声時刻ms = (int)this.dbNowTime; - chip.fNow_Measure_m = this.fNow_Measure_m; - chip.fNow_Measure_s = this.fNow_Measure_s; - chip.n整数値_内部番号 = 1; - - var index = this.listChip.IndexOf(currentCamZoomChip); - var msDiff = chip.n発声時刻ms - currentCamZoomChip.n発声時刻ms; - - currentCamZoomChip.fCamTimeMs = msDiff; - this.listChip[index] = currentCamZoomChip; - - currentCamZoomChip = null; - - // チップを配置。 - this.listChip.Add(chip); - } else { - AddError_Single("Missing #CAMZOOMSTART"); - Trace.TraceInformation("TJA ERROR: Missing #CAMZOOMSTART"); - } - } else if (command == "#CAMROTATIONSTART") { - if (currentCamRotateChip == null) { - //starts rotating the screen - //arguments: ,,, - var chip = new CChip(); - - chip.nチャンネル番号 = 0xA6; - chip.n発声位置 = ((this.n現在の小節数) * 384); - chip.dbBPM = this.dbNowBPM; - chip.n発声時刻ms = (int)this.dbNowTime; - chip.fNow_Measure_m = this.fNow_Measure_m; - chip.fNow_Measure_s = this.fNow_Measure_s; - chip.n整数値_内部番号 = 1; - - try { - string[] args = argument.Split(','); - chip.fCamRotationStart = float.Parse(args[0]); - chip.fCamRotationEnd = float.Parse(args[1]); - chip.strCamEaseType = args[2]; - - var type = args[3]; - var eType = Easing.CalcType.Quadratic; - switch (type) { - case "CUBIC": - eType = Easing.CalcType.Cubic; - break; - case "QUARTIC": - eType = Easing.CalcType.Quartic; - break; - case "QUINTIC": - eType = Easing.CalcType.Quintic; - break; - case "SINUSOIDAL": - eType = Easing.CalcType.Sinusoidal; - break; - case "EXPONENTIAL": - eType = Easing.CalcType.Exponential; - break; - case "CIRCULAR": - eType = Easing.CalcType.Circular; - break; - case "LINEAR": - eType = Easing.CalcType.Linear; - break; - default: - break; - } - - chip.fCamMoveType = eType; - - currentCamRotateChip = chip; - - // チップを配置。 - this.listChip.Add(chip); - } catch (Exception ex) { - AddError(command, argument); - } - } else { - AddError_Single("Missing #CAMROTATIONEND"); - Trace.TraceInformation("TJA ERROR: Missing #CAMROTATIONEND"); - } - } else if (command == "#CAMROTATIONEND") { - if (currentCamRotateChip != null) { - //stops screen rotation - var chip = new CChip(); - - chip.nチャンネル番号 = 0xA7; - chip.n発声位置 = ((this.n現在の小節数) * 384); - chip.dbBPM = this.dbNowBPM; - chip.n発声時刻ms = (int)this.dbNowTime; - chip.fNow_Measure_m = this.fNow_Measure_m; - chip.fNow_Measure_s = this.fNow_Measure_s; - chip.n整数値_内部番号 = 1; - - var index = this.listChip.IndexOf(currentCamRotateChip); - var msDiff = chip.n発声時刻ms - currentCamRotateChip.n発声時刻ms; - - currentCamRotateChip.fCamTimeMs = msDiff; - this.listChip[index] = currentCamRotateChip; - - currentCamRotateChip = null; - - // チップを配置。 - this.listChip.Add(chip); - } else { - AddError_Single("Missing #CAMROTATIONSTART"); - Trace.TraceInformation("TJA ERROR: Missing #CAMROTATIONSTART"); - } - } else if (command == "#CAMVSCALESTART") { - if (currentCamVScaleChip == null) { - //starts vertical camera scale changing - //arguments: ,,, - var chip = new CChip(); - - chip.nチャンネル番号 = 0xA8; - chip.n発声位置 = ((this.n現在の小節数) * 384); - chip.dbBPM = this.dbNowBPM; - chip.n発声時刻ms = (int)this.dbNowTime; - chip.fNow_Measure_m = this.fNow_Measure_m; - chip.fNow_Measure_s = this.fNow_Measure_s; - chip.n整数値_内部番号 = 1; - - try { - string[] args = argument.Split(','); - chip.fCamScaleStartY = float.Parse(args[0]); - chip.fCamScaleEndY = float.Parse(args[1]); - chip.strCamEaseType = args[2]; - - var type = args[3]; - var eType = Easing.CalcType.Quadratic; - switch (type) { - case "CUBIC": - eType = Easing.CalcType.Cubic; - break; - case "QUARTIC": - eType = Easing.CalcType.Quartic; - break; - case "QUINTIC": - eType = Easing.CalcType.Quintic; - break; - case "SINUSOIDAL": - eType = Easing.CalcType.Sinusoidal; - break; - case "EXPONENTIAL": - eType = Easing.CalcType.Exponential; - break; - case "CIRCULAR": - eType = Easing.CalcType.Circular; - break; - case "LINEAR": - eType = Easing.CalcType.Linear; - break; - default: - break; - } - - chip.fCamMoveType = eType; - - currentCamVScaleChip = chip; - - // チップを配置。 - this.listChip.Add(chip); - } catch (Exception ex) { - AddError(command, argument); - } - } else { - AddError_Single("Missing #CAMVSCALEEND"); - Trace.TraceInformation("TJA ERROR: Missing #CAMVSCALEEND"); - } - } else if (command == "#CAMVSCALEEND") { - if (currentCamVScaleChip != null) { - //ends vertical camera scaling - var chip = new CChip(); - - chip.nチャンネル番号 = 0xA9; - chip.n発声位置 = ((this.n現在の小節数) * 384); - chip.dbBPM = this.dbNowBPM; - chip.n発声時刻ms = (int)this.dbNowTime; - chip.fNow_Measure_m = this.fNow_Measure_m; - chip.fNow_Measure_s = this.fNow_Measure_s; - chip.n整数値_内部番号 = 1; - - var index = this.listChip.IndexOf(currentCamVScaleChip); - var msDiff = chip.n発声時刻ms - currentCamVScaleChip.n発声時刻ms; - - currentCamVScaleChip.fCamTimeMs = msDiff; - this.listChip[index] = currentCamVScaleChip; - - currentCamVScaleChip = null; - - // チップを配置。 - this.listChip.Add(chip); - } else { - AddError_Single("Missing #CAMVSCALESTART"); - Trace.TraceInformation("TJA ERROR: Missing #CAMVSCALESTART"); - } - } else if (command == "#CAMHSCALESTART") { - if (currentCamHScaleChip == null) { - //starts horizontal camera scale changing - //arguments: ,,, - var chip = new CChip(); - - chip.nチャンネル番号 = 0xB0; - chip.n発声位置 = ((this.n現在の小節数) * 384); - chip.dbBPM = this.dbNowBPM; - chip.n発声時刻ms = (int)this.dbNowTime; - chip.fNow_Measure_m = this.fNow_Measure_m; - chip.fNow_Measure_s = this.fNow_Measure_s; - chip.n整数値_内部番号 = 1; - - try { - string[] args = argument.Split(','); - chip.fCamScaleStartX = float.Parse(args[0]); - chip.fCamScaleEndX = float.Parse(args[1]); - chip.strCamEaseType = args[2]; - - var type = args[3]; - var eType = Easing.CalcType.Quadratic; - switch (type) { - case "CUBIC": - eType = Easing.CalcType.Cubic; - break; - case "QUARTIC": - eType = Easing.CalcType.Quartic; - break; - case "QUINTIC": - eType = Easing.CalcType.Quintic; - break; - case "SINUSOIDAL": - eType = Easing.CalcType.Sinusoidal; - break; - case "EXPONENTIAL": - eType = Easing.CalcType.Exponential; - break; - case "CIRCULAR": - eType = Easing.CalcType.Circular; - break; - case "LINEAR": - eType = Easing.CalcType.Linear; - break; - default: - break; - } - - chip.fCamMoveType = eType; - - currentCamHScaleChip = chip; - - // チップを配置。 - this.listChip.Add(chip); - } catch (Exception ex) { - AddError(command, argument); - } - } else { - AddError_Single("Missing #CAMHSCALEEND"); - Trace.TraceInformation("TJA ERROR: Missing #CAMHSCALEEND"); - } - } else if (command == "#CAMHSCALEEND") { - if (currentCamHScaleChip != null) { - //ends horizontal camera scaling - var chip = new CChip(); - - chip.nチャンネル番号 = 0xB1; - chip.n発声位置 = ((this.n現在の小節数) * 384); - chip.dbBPM = this.dbNowBPM; - chip.n発声時刻ms = (int)this.dbNowTime; - chip.fNow_Measure_m = this.fNow_Measure_m; - chip.fNow_Measure_s = this.fNow_Measure_s; - chip.n整数値_内部番号 = 1; - - var index = this.listChip.IndexOf(currentCamHScaleChip); - var msDiff = chip.n発声時刻ms - currentCamHScaleChip.n発声時刻ms; - - currentCamHScaleChip.fCamTimeMs = msDiff; - this.listChip[index] = currentCamHScaleChip; - - currentCamHScaleChip = null; - - // チップを配置。 - this.listChip.Add(chip); - } else { - AddError_Single("Missing #CAMHSCALESTART"); - Trace.TraceInformation("TJA ERROR: Missing #CAMHSCALESTART"); - } - } else if (command == "#BORDERCOLOR") { - //sets border color - //arguments: ,, - var chip = new CChip(); - - chip.nチャンネル番号 = 0xB2; - chip.n発声位置 = ((this.n現在の小節数) * 384); - chip.dbBPM = this.dbNowBPM; - chip.n発声時刻ms = (int)this.dbNowTime; - chip.fNow_Measure_m = this.fNow_Measure_m; - chip.fNow_Measure_s = this.fNow_Measure_s; - chip.n整数値_内部番号 = 1; - - string[] args = argument.Split(','); - chip.borderColor = new Color4(1f, float.Parse(args[0]) / 255, float.Parse(args[1]) / 255, float.Parse(args[2]) / 255); - - // チップを配置。 - this.listChip.Add(chip); - } else if (command == "#CAMHOFFSET") { - if (currentCamHMoveChip == null) { - //sets camera x offset - //argument: - var chip = new CChip(); - - chip.nチャンネル番号 = 0xB3; - chip.n発声位置 = ((this.n現在の小節数) * 384); - chip.dbBPM = this.dbNowBPM; - chip.n発声時刻ms = (int)this.dbNowTime; - chip.fNow_Measure_m = this.fNow_Measure_m; - chip.fNow_Measure_s = this.fNow_Measure_s; - chip.n整数値_内部番号 = 1; - - if (float.TryParse(argument, out float value)) { - chip.fCamScrollStartX = value; - chip.fCamScrollEndX = value; - } else { - AddError(command, argument); - } - chip.strCamEaseType = "IN_OUT"; - - // チップを配置。 - this.listChip.Add(chip); - } else { - AddError_Single("Missing #CAMHMOVEEND"); - Trace.TraceInformation("TJA ERROR: Missing #CAMHMOVEEND"); - } - } else if (command == "#CAMVOFFSET") { - if (currentCamVMoveChip == null) { - //sets camera y offset - //argument: - var chip = new CChip(); - - chip.nチャンネル番号 = 0xB4; - chip.n発声位置 = ((this.n現在の小節数) * 384); - chip.dbBPM = this.dbNowBPM; - chip.n発声時刻ms = (int)this.dbNowTime; - chip.fNow_Measure_m = this.fNow_Measure_m; - chip.fNow_Measure_s = this.fNow_Measure_s; - chip.n整数値_内部番号 = 1; - - if (float.TryParse(argument, out float value)) { - chip.fCamScrollStartY = float.Parse(argument); - chip.fCamScrollEndY = float.Parse(argument); - } else { - AddError(command, argument); - } - chip.strCamEaseType = "IN_OUT"; - - // チップを配置。 - this.listChip.Add(chip); - } else { - AddError_Single("Missing #CAMVMOVEEND"); - Trace.TraceInformation("TJA ERROR: Missing #CAMVMOVEEND"); - } - } else if (command == "#CAMZOOM") { - if (currentCamZoomChip == null) { - //sets camera zoom factor - //argument: - var chip = new CChip(); - - chip.nチャンネル番号 = 0xB5; - chip.n発声位置 = ((this.n現在の小節数) * 384); - chip.dbBPM = this.dbNowBPM; - chip.n発声時刻ms = (int)this.dbNowTime; - chip.fNow_Measure_m = this.fNow_Measure_m; - chip.fNow_Measure_s = this.fNow_Measure_s; - chip.n整数値_内部番号 = 1; - - if (float.TryParse(argument, out float value)) { - chip.fCamZoomStart = float.Parse(argument); - chip.fCamZoomEnd = float.Parse(argument); - } else { - AddError(command, argument); - } - chip.strCamEaseType = "IN_OUT"; - - // チップを配置。 - this.listChip.Add(chip); - } else { - AddError_Single("Missing #CAMZOOMEND"); - Trace.TraceInformation("TJA ERROR: Missing #CAMZOOMEND"); - } - } else if (command == "#CAMROTATION") { - if (currentCamRotateChip == null) { - //sets camera rotation - //argument: - var chip = new CChip(); - - chip.nチャンネル番号 = 0xB6; - chip.n発声位置 = ((this.n現在の小節数) * 384); - chip.dbBPM = this.dbNowBPM; - chip.n発声時刻ms = (int)this.dbNowTime; - chip.fNow_Measure_m = this.fNow_Measure_m; - chip.fNow_Measure_s = this.fNow_Measure_s; - chip.n整数値_内部番号 = 1; - - if (float.TryParse(argument, out float value)) { - chip.fCamRotationStart = float.Parse(argument); - chip.fCamRotationEnd = float.Parse(argument); - } else { - AddError(command, argument); - } - chip.strCamEaseType = "IN_OUT"; - - // チップを配置。 - this.listChip.Add(chip); - } else { - AddError_Single("Missing #CAMROTATIONEND"); - Trace.TraceInformation("TJA ERROR: Missing #CAMROTATIONEND"); - } - } else if (command == "#CAMHSCALE") { - if (currentCamHScaleChip == null) { - //sets camera x scale - //argument: - var chip = new CChip(); - - chip.nチャンネル番号 = 0xB7; - chip.n発声位置 = ((this.n現在の小節数) * 384); - chip.dbBPM = this.dbNowBPM; - chip.n発声時刻ms = (int)this.dbNowTime; - chip.fNow_Measure_m = this.fNow_Measure_m; - chip.fNow_Measure_s = this.fNow_Measure_s; - chip.n整数値_内部番号 = 1; - - if (float.TryParse(argument, out float value)) { - chip.fCamScaleStartX = float.Parse(argument); - chip.fCamScaleEndX = float.Parse(argument); - } else { - AddError(command, argument); - } - chip.strCamEaseType = "IN_OUT"; - - // チップを配置。 - this.listChip.Add(chip); - } else { - AddError_Single("Missing #CAMHSCALEEND"); - Trace.TraceInformation("TJA ERROR: Missing #CAMHSCALEEND"); - } - } else if (command == "#CAMVSCALE") { - if (currentCamVScaleChip == null) { - //sets camera y scale - //argument: - var chip = new CChip(); - - chip.nチャンネル番号 = 0xB8; - chip.n発声位置 = ((this.n現在の小節数) * 384); - chip.dbBPM = this.dbNowBPM; - chip.n発声時刻ms = (int)this.dbNowTime; - chip.fNow_Measure_m = this.fNow_Measure_m; - chip.fNow_Measure_s = this.fNow_Measure_s; - chip.n整数値_内部番号 = 1; - - if (float.TryParse(argument, out float value)) { - chip.fCamScaleStartY = float.Parse(argument); - chip.fCamScaleEndY = float.Parse(argument); - } else { - AddError(command, argument); - } - chip.strCamEaseType = "IN_OUT"; - - // チップを配置。 - this.listChip.Add(chip); - } else { - AddError_Single("Missing #CAMVSCALEEND"); - Trace.TraceInformation("TJA ERROR: Missing #CAMVSCALEEND"); - } - } else if (command == "#CAMRESET") { - //resets camera properties - var chip = new CChip(); - - chip.nチャンネル番号 = 0xB9; - chip.n発声位置 = ((this.n現在の小節数) * 384); - chip.dbBPM = this.dbNowBPM; - chip.n発声時刻ms = (int)this.dbNowTime; - chip.fNow_Measure_m = this.fNow_Measure_m; - chip.fNow_Measure_s = this.fNow_Measure_s; - chip.n整数値_内部番号 = 1; - - chip.fCamScrollStartX = 0.0f; - chip.fCamScrollEndX = 0.0f; - chip.fCamScrollStartY = 0.0f; - chip.fCamScrollEndY = 0.0f; - - chip.fCamZoomStart = 1.0f; - chip.fCamZoomEnd = 1.0f; - chip.fCamRotationStart = 0.0f; - chip.fCamRotationEnd = 0.0f; - - chip.fCamScaleStartX = 1.0f; - chip.fCamScaleEndX = 1.0f; - chip.fCamScaleStartY = 1.0f; - chip.fCamScaleEndY = 1.0f; - - chip.strCamEaseType = "IN_OUT"; - - // チップを配置。 - this.listChip.Add(chip); - } else if (command == "#ENABLEDORON") { - //resets camera properties - var chip = new CChip(); - - chip.nチャンネル番号 = 0xBA; - chip.n発声位置 = ((this.n現在の小節数) * 384); - chip.dbBPM = this.dbNowBPM; - chip.n発声時刻ms = (int)this.dbNowTime; - chip.fNow_Measure_m = this.fNow_Measure_m; - chip.fNow_Measure_s = this.fNow_Measure_s; - chip.n整数値_内部番号 = 1; - - // チップを配置。 - this.listChip.Add(chip); - } else if (command == "#DISABLEDORON") { - //resets camera properties - var chip = new CChip(); - - chip.nチャンネル番号 = 0xBB; - chip.n発声位置 = ((this.n現在の小節数) * 384); - chip.dbBPM = this.dbNowBPM; - chip.n発声時刻ms = (int)this.dbNowTime; - chip.fNow_Measure_m = this.fNow_Measure_m; - chip.fNow_Measure_s = this.fNow_Measure_s; - chip.n整数値_内部番号 = 1; - - // チップを配置。 - this.listChip.Add(chip); - } else if (command == "#ADDOBJECT") { - //adds object - var chip = new CChip(); - - chip.nチャンネル番号 = 0xBC; - chip.n発声位置 = ((this.n現在の小節数) * 384); - chip.dbBPM = this.dbNowBPM; - chip.n発声時刻ms = (int)this.dbNowTime; - chip.fNow_Measure_m = this.fNow_Measure_m; - chip.fNow_Measure_s = this.fNow_Measure_s; - chip.n整数値_内部番号 = 1; - - try { - string[] args = argument.Split(','); - - chip.strObjName = args[0]; - chip.fObjX = float.Parse(args[1]); - chip.fObjY = float.Parse(args[2]); - var txPath = this.strフォルダ名 + args[3]; - Trace.TraceInformation("" + this.bSession譜面を読み込む); - if (this.bSession譜面を読み込む) { - var obj = new CSongObject(chip.strObjName, chip.fObjX, chip.fObjY, txPath); - this.listObj.Add(args[0], obj); - } - - // チップを配置。 - this.listChip.Add(chip); - } catch (Exception ex) { - AddError(command, argument); - } - } else if (command == "#REMOVEOBJECT") { - //removes object - var chip = new CChip(); - - chip.nチャンネル番号 = 0xBD; - chip.n発声位置 = ((this.n現在の小節数) * 384); - chip.dbBPM = this.dbNowBPM; - chip.n発声時刻ms = (int)this.dbNowTime; - chip.fNow_Measure_m = this.fNow_Measure_m; - chip.fNow_Measure_s = this.fNow_Measure_s; - chip.n整数値_内部番号 = 1; - - chip.strObjName = argument; - - // チップを配置。 - this.listChip.Add(chip); - } else if (command == "#OBJVMOVESTART") { - string[] args = argument.Split(','); - - try { - string name = args[0]; - - if (!currentObjAnimations.ContainsKey("vmove_" + name)) { - //starts vertical object movement - //arguments: ,,, - var chip = new CChip(); - - chip.nチャンネル番号 = 0xBE; - chip.n発声位置 = ((this.n現在の小節数) * 384); - chip.dbBPM = this.dbNowBPM; - chip.n発声時刻ms = (int)this.dbNowTime; - chip.fNow_Measure_m = this.fNow_Measure_m; - chip.fNow_Measure_s = this.fNow_Measure_s; - chip.n整数値_内部番号 = 0; - - chip.strObjName = args[0]; - chip.fObjStart = float.Parse(args[1]); - chip.fObjEnd = float.Parse(args[2]); - chip.strObjEaseType = args[3]; - - var type = args[4]; - var eType = Easing.CalcType.Quadratic; - switch (type) { - case "CUBIC": - eType = Easing.CalcType.Cubic; - break; - case "QUARTIC": - eType = Easing.CalcType.Quartic; - break; - case "QUINTIC": - eType = Easing.CalcType.Quintic; - break; - case "SINUSOIDAL": - eType = Easing.CalcType.Sinusoidal; - break; - case "EXPONENTIAL": - eType = Easing.CalcType.Exponential; - break; - case "CIRCULAR": - eType = Easing.CalcType.Circular; - break; - case "LINEAR": - eType = Easing.CalcType.Linear; - break; - default: - break; - } - - chip.objCalcType = eType; - - currentObjAnimations.Add("vmove_" + name, chip); - - // チップを配置。 - this.listChip.Add(chip); - } else { - AddError_Single("Missing #OBJVMOVEEND"); - Trace.TraceInformation("TJA ERROR: Missing #OBJVMOVEEND"); - } - } catch (Exception ex) { - AddError(command, argument); - } - } else if (command == "#OBJVMOVEEND") { - string name = argument; - - if (currentObjAnimations.ContainsKey("vmove_" + name)) { - //ends vertical camera moving - var chip = new CChip(); - - chip.nチャンネル番号 = 0xBF; - chip.n発声位置 = ((this.n現在の小節数) * 384); - chip.dbBPM = this.dbNowBPM; - chip.n発声時刻ms = (int)this.dbNowTime; - chip.fNow_Measure_m = this.fNow_Measure_m; - chip.fNow_Measure_s = this.fNow_Measure_s; - chip.n整数値_内部番号 = 1; - chip.strObjName = argument; - - currentObjAnimations.TryGetValue("vmove_" + name, out CChip startChip); - - var index = this.listChip.IndexOf(startChip); - var msDiff = chip.n発声時刻ms - startChip.n発声時刻ms; - - startChip.fObjTimeMs = msDiff; - this.listChip[index] = startChip; - - currentObjAnimations.Remove("vmove_" + name); - - // チップを配置。 - this.listChip.Add(chip); - } else { - AddError_Single("Missing #OBJVMOVESTART"); - Trace.TraceInformation("TJA ERROR: Missing #OBJVMOVESTART"); - } - } else if (command == "#OBJHMOVESTART") { - string[] args = argument.Split(','); - try { - string name = args[0]; - - if (!currentObjAnimations.ContainsKey("hmove_" + name)) { - //starts horizontal object movement - //arguments: ,,, - var chip = new CChip(); - - chip.nチャンネル番号 = 0xC0; - chip.n発声位置 = ((this.n現在の小節数) * 384); - chip.dbBPM = this.dbNowBPM; - chip.n発声時刻ms = (int)this.dbNowTime; - chip.fNow_Measure_m = this.fNow_Measure_m; - chip.fNow_Measure_s = this.fNow_Measure_s; - chip.n整数値_内部番号 = 0; - - chip.strObjName = args[0]; - chip.fObjStart = float.Parse(args[1]); - chip.fObjEnd = float.Parse(args[2]); - chip.strObjEaseType = args[3]; - - var type = args[4]; - var eType = Easing.CalcType.Quadratic; - switch (type) { - case "CUBIC": - eType = Easing.CalcType.Cubic; - break; - case "QUARTIC": - eType = Easing.CalcType.Quartic; - break; - case "QUINTIC": - eType = Easing.CalcType.Quintic; - break; - case "SINUSOIDAL": - eType = Easing.CalcType.Sinusoidal; - break; - case "EXPONENTIAL": - eType = Easing.CalcType.Exponential; - break; - case "CIRCULAR": - eType = Easing.CalcType.Circular; - break; - case "LINEAR": - eType = Easing.CalcType.Linear; - break; - default: - break; - } - - chip.objCalcType = eType; - - currentObjAnimations.Add("hmove_" + name, chip); - - // チップを配置。 - this.listChip.Add(chip); - } else { - AddError_Single("Missing #OBJHMOVEEND"); - Trace.TraceInformation("TJA ERROR: Missing #OBJHMOVEEND"); - } - } catch (Exception ex) { - AddError(command, argument); - } - } else if (command == "#OBJHMOVEEND") { - string name = argument; - - if (currentObjAnimations.ContainsKey("hmove_" + name)) { - //ends horizontal camera moving - var chip = new CChip(); - - chip.nチャンネル番号 = 0xC1; - chip.n発声位置 = ((this.n現在の小節数) * 384); - chip.dbBPM = this.dbNowBPM; - chip.n発声時刻ms = (int)this.dbNowTime; - chip.fNow_Measure_m = this.fNow_Measure_m; - chip.fNow_Measure_s = this.fNow_Measure_s; - chip.n整数値_内部番号 = 1; - chip.strObjName = argument; - - currentObjAnimations.TryGetValue("hmove_" + name, out CChip startChip); - - var index = this.listChip.IndexOf(startChip); - var msDiff = chip.n発声時刻ms - startChip.n発声時刻ms; - - startChip.fObjTimeMs = msDiff; - this.listChip[index] = startChip; - - currentObjAnimations.Remove("hmove_" + name); - - // チップを配置。 - this.listChip.Add(chip); - } else { - AddError_Single("Missing #OBJHMOVESTART"); - Trace.TraceInformation("TJA ERROR: Missing #OBJHMOVESTART"); - } - } else if (command == "#OBJVSCALESTART") { - string[] args = argument.Split(','); - try { - string name = args[0]; - - if (!currentObjAnimations.ContainsKey("vscale_" + name)) { - var chip = new CChip(); - - chip.nチャンネル番号 = 0xC2; - chip.n発声位置 = ((this.n現在の小節数) * 384); - chip.dbBPM = this.dbNowBPM; - chip.n発声時刻ms = (int)this.dbNowTime; - chip.fNow_Measure_m = this.fNow_Measure_m; - chip.fNow_Measure_s = this.fNow_Measure_s; - chip.n整数値_内部番号 = 0; - - chip.strObjName = args[0]; - chip.fObjStart = float.Parse(args[1]); - chip.fObjEnd = float.Parse(args[2]); - chip.strObjEaseType = args[3]; - - var type = args[4]; - var eType = Easing.CalcType.Quadratic; - switch (type) { - case "CUBIC": - eType = Easing.CalcType.Cubic; - break; - case "QUARTIC": - eType = Easing.CalcType.Quartic; - break; - case "QUINTIC": - eType = Easing.CalcType.Quintic; - break; - case "SINUSOIDAL": - eType = Easing.CalcType.Sinusoidal; - break; - case "EXPONENTIAL": - eType = Easing.CalcType.Exponential; - break; - case "CIRCULAR": - eType = Easing.CalcType.Circular; - break; - case "LINEAR": - eType = Easing.CalcType.Linear; - break; - default: - break; - } - - chip.objCalcType = eType; - - currentObjAnimations.Add("vscale_" + name, chip); - - // チップを配置。 - this.listChip.Add(chip); - } else { - AddError_Single("Missing #OBJVSCALEEND"); - Trace.TraceInformation("TJA ERROR: Missing #OBJVSCALEEND"); - } - } catch (Exception ex) { - AddError(command, argument); - } - } else if (command == "#OBJVSCALEEND") { - string name = argument; - - if (currentObjAnimations.ContainsKey("vscale_" + name)) { - var chip = new CChip(); - - chip.nチャンネル番号 = 0xC3; - chip.n発声位置 = ((this.n現在の小節数) * 384); - chip.dbBPM = this.dbNowBPM; - chip.n発声時刻ms = (int)this.dbNowTime; - chip.fNow_Measure_m = this.fNow_Measure_m; - chip.fNow_Measure_s = this.fNow_Measure_s; - chip.n整数値_内部番号 = 1; - chip.strObjName = argument; - - currentObjAnimations.TryGetValue("vscale_" + name, out CChip startChip); - - var index = this.listChip.IndexOf(startChip); - var msDiff = chip.n発声時刻ms - startChip.n発声時刻ms; - - startChip.fObjTimeMs = msDiff; - this.listChip[index] = startChip; - - currentObjAnimations.Remove("vscale_" + name); - - // チップを配置。 - this.listChip.Add(chip); - } else { - AddError_Single("Missing #OBJVSCALESTART"); - Trace.TraceInformation("TJA ERROR: Missing #OBJVSCALESTART"); - } - } else if (command == "#OBJHSCALESTART") { - string[] args = argument.Split(','); - try { - string name = args[0]; - - if (!currentObjAnimations.ContainsKey("hscale_" + name)) { - var chip = new CChip(); - - chip.nチャンネル番号 = 0xC4; - chip.n発声位置 = ((this.n現在の小節数) * 384); - chip.dbBPM = this.dbNowBPM; - chip.n発声時刻ms = (int)this.dbNowTime; - chip.fNow_Measure_m = this.fNow_Measure_m; - chip.fNow_Measure_s = this.fNow_Measure_s; - chip.n整数値_内部番号 = 0; - - chip.strObjName = args[0]; - chip.fObjStart = float.Parse(args[1]); - chip.fObjEnd = float.Parse(args[2]); - chip.strObjEaseType = args[3]; - - var type = args[4]; - var eType = Easing.CalcType.Quadratic; - switch (type) { - case "CUBIC": - eType = Easing.CalcType.Cubic; - break; - case "QUARTIC": - eType = Easing.CalcType.Quartic; - break; - case "QUINTIC": - eType = Easing.CalcType.Quintic; - break; - case "SINUSOIDAL": - eType = Easing.CalcType.Sinusoidal; - break; - case "EXPONENTIAL": - eType = Easing.CalcType.Exponential; - break; - case "CIRCULAR": - eType = Easing.CalcType.Circular; - break; - case "LINEAR": - eType = Easing.CalcType.Linear; - break; - } - - chip.objCalcType = eType; - - currentObjAnimations.Add("hscale_" + name, chip); - - // チップを配置。 - this.listChip.Add(chip); - } else { - AddError_Single("Missing #OBJHSCALEEND"); - Trace.TraceInformation("TJA ERROR: Missing #OBJHSCALEEND"); - } - } catch (Exception ex) { - AddError(command, argument); - } - } else if (command == "#OBJHSCALEEND") { - string name = argument; - - if (currentObjAnimations.ContainsKey("hscale_" + name)) { - var chip = new CChip(); - - chip.nチャンネル番号 = 0xC5; - chip.n発声位置 = ((this.n現在の小節数) * 384); - chip.dbBPM = this.dbNowBPM; - chip.n発声時刻ms = (int)this.dbNowTime; - chip.fNow_Measure_m = this.fNow_Measure_m; - chip.fNow_Measure_s = this.fNow_Measure_s; - chip.n整数値_内部番号 = 1; - chip.strObjName = argument; - - currentObjAnimations.TryGetValue("hscale_" + name, out CChip startChip); - - var index = this.listChip.IndexOf(startChip); - var msDiff = chip.n発声時刻ms - startChip.n発声時刻ms; - - startChip.fObjTimeMs = msDiff; - this.listChip[index] = startChip; - - currentObjAnimations.Remove("hscale_" + name); - - // チップを配置。 - this.listChip.Add(chip); - } else { - AddError_Single("Missing #OBJHSCALESTART"); - Trace.TraceInformation("TJA ERROR: Missing #OBJHSCALESTART"); - } - } else if (command == "#OBJROTATIONSTART") { - string[] args = argument.Split(','); - try { - string name = args[0]; - - if (!currentObjAnimations.ContainsKey("rotation_" + name)) { - var chip = new CChip(); - - chip.nチャンネル番号 = 0xC6; - chip.n発声位置 = ((this.n現在の小節数) * 384); - chip.dbBPM = this.dbNowBPM; - chip.n発声時刻ms = (int)this.dbNowTime; - chip.fNow_Measure_m = this.fNow_Measure_m; - chip.fNow_Measure_s = this.fNow_Measure_s; - chip.n整数値_内部番号 = 0; - - chip.strObjName = args[0]; - chip.fObjStart = float.Parse(args[1]); - chip.fObjEnd = float.Parse(args[2]); - chip.strObjEaseType = args[3]; - - var type = args[4]; - var eType = Easing.CalcType.Quadratic; - switch (type) { - case "CUBIC": - eType = Easing.CalcType.Cubic; - break; - case "QUARTIC": - eType = Easing.CalcType.Quartic; - break; - case "QUINTIC": - eType = Easing.CalcType.Quintic; - break; - case "SINUSOIDAL": - eType = Easing.CalcType.Sinusoidal; - break; - case "EXPONENTIAL": - eType = Easing.CalcType.Exponential; - break; - case "CIRCULAR": - eType = Easing.CalcType.Circular; - break; - case "LINEAR": - eType = Easing.CalcType.Linear; - break; - default: - break; - } - - chip.objCalcType = eType; - - currentObjAnimations.Add("rotation_" + name, chip); - - // チップを配置。 - this.listChip.Add(chip); - } else { - AddError_Single("Missing #OBJROTATIONEND"); - Trace.TraceInformation("TJA ERROR: Missing #OBJROTATIONEND"); - } - } catch (Exception ex) { - AddError(command, argument); - } - } else if (command == "#OBJROTATIONEND") { - string name = argument; - - if (currentObjAnimations.ContainsKey("rotation_" + name)) { - var chip = new CChip(); - - chip.nチャンネル番号 = 0xC7; - chip.n発声位置 = ((this.n現在の小節数) * 384); - chip.dbBPM = this.dbNowBPM; - chip.n発声時刻ms = (int)this.dbNowTime; - chip.fNow_Measure_m = this.fNow_Measure_m; - chip.fNow_Measure_s = this.fNow_Measure_s; - chip.n整数値_内部番号 = 1; - chip.strObjName = argument; - - currentObjAnimations.TryGetValue("rotation_" + name, out CChip startChip); - - var index = this.listChip.IndexOf(startChip); - var msDiff = chip.n発声時刻ms - startChip.n発声時刻ms; - - startChip.fObjTimeMs = msDiff; - this.listChip[index] = startChip; - - currentObjAnimations.Remove("rotation_" + name); - - // チップを配置。 - this.listChip.Add(chip); - } else { - AddError_Single("Missing #OBJROTATIONSTART"); - Trace.TraceInformation("TJA ERROR: Missing #OBJROTATIONSTART"); - } - } else if (command == "#OBJOPACITYSTART") { - string[] args = argument.Split(','); - try { - string name = args[0]; - - if (!currentObjAnimations.ContainsKey("opacity_" + name)) { - var chip = new CChip(); - - chip.nチャンネル番号 = 0xC8; - chip.n発声位置 = ((this.n現在の小節数) * 384); - chip.dbBPM = this.dbNowBPM; - chip.n発声時刻ms = (int)this.dbNowTime; - chip.fNow_Measure_m = this.fNow_Measure_m; - chip.fNow_Measure_s = this.fNow_Measure_s; - chip.n整数値_内部番号 = 0; - - chip.strObjName = args[0]; - chip.fObjStart = float.Parse(args[1]); - chip.fObjEnd = float.Parse(args[2]); - chip.strObjEaseType = args[3]; - - var type = args[4]; - var eType = Easing.CalcType.Quadratic; - switch (type) { - case "CUBIC": - eType = Easing.CalcType.Cubic; - break; - case "QUARTIC": - eType = Easing.CalcType.Quartic; - break; - case "QUINTIC": - eType = Easing.CalcType.Quintic; - break; - case "SINUSOIDAL": - eType = Easing.CalcType.Sinusoidal; - break; - case "EXPONENTIAL": - eType = Easing.CalcType.Exponential; - break; - case "CIRCULAR": - eType = Easing.CalcType.Circular; - break; - case "LINEAR": - eType = Easing.CalcType.Linear; - break; - } - - chip.objCalcType = eType; - - currentObjAnimations.Add("opacity_" + name, chip); - - // チップを配置。 - this.listChip.Add(chip); - } else { - AddError_Single("Missing #OBJOPACITYEND"); - Trace.TraceInformation("TJA ERROR: Missing #OBJOPACITYEND"); - } - } catch (Exception ex) { - AddError(command, argument); - } - } else if (command == "#OBJOPACITYEND") { - string name = argument; - - if (currentObjAnimations.ContainsKey("opacity_" + name)) { - var chip = new CChip(); - - chip.nチャンネル番号 = 0xC9; - chip.n発声位置 = ((this.n現在の小節数) * 384); - chip.dbBPM = this.dbNowBPM; - chip.n発声時刻ms = (int)this.dbNowTime; - chip.fNow_Measure_m = this.fNow_Measure_m; - chip.fNow_Measure_s = this.fNow_Measure_s; - chip.n整数値_内部番号 = 1; - chip.strObjName = argument; - - currentObjAnimations.TryGetValue("opacity_" + name, out CChip startChip); - - var index = this.listChip.IndexOf(startChip); - var msDiff = chip.n発声時刻ms - startChip.n発声時刻ms; - - startChip.fObjTimeMs = msDiff; - this.listChip[index] = startChip; - - currentObjAnimations.Remove("opacity_" + name); - - // チップを配置。 - this.listChip.Add(chip); - } else { - AddError_Single("Missing #OBJOPACITYSTART"); - Trace.TraceInformation("TJA ERROR: Missing #OBJOPACITYSTART"); - } - } else if (command == "#OBJCOLOR") { - var chip = new CChip(); - - chip.nチャンネル番号 = 0xCA; - chip.n発声位置 = ((this.n現在の小節数) * 384); - chip.dbBPM = this.dbNowBPM; - chip.n発声時刻ms = (int)this.dbNowTime; - chip.fNow_Measure_m = this.fNow_Measure_m; - chip.fNow_Measure_s = this.fNow_Measure_s; - chip.n整数値_内部番号 = 1; - - try { - string[] args = argument.Split(','); - chip.strObjName = args[0]; - chip.borderColor = new Color4(1f, float.Parse(args[1]) / 255, float.Parse(args[2]) / 255, float.Parse(args[3]) / 255); - - // チップを配置。 - this.listChip.Add(chip); - } catch (Exception ex) { - AddError(command, argument); - } - } else if (command == "#OBJY") { - string[] args = argument.Split(','); - try { - string name = args[0]; - - if (!currentObjAnimations.ContainsKey("vmove_" + name)) { - var chip = new CChip(); - - chip.nチャンネル番号 = 0xCB; - chip.n発声位置 = ((this.n現在の小節数) * 384); - chip.dbBPM = this.dbNowBPM; - chip.n発声時刻ms = (int)this.dbNowTime; - chip.fNow_Measure_m = this.fNow_Measure_m; - chip.fNow_Measure_s = this.fNow_Measure_s; - chip.n整数値_内部番号 = 0; - - chip.strObjName = args[0]; - chip.fObjStart = float.Parse(args[1]); - chip.fObjEnd = float.Parse(args[1]); - chip.strObjEaseType = "IN_OUT"; - - // チップを配置。 - this.listChip.Add(chip); - } else { - AddError_Single("Missing #OBJVMOVEEND"); - Trace.TraceInformation("TJA ERROR: Missing #OBJVMOVEEND"); - } - } catch (Exception ex) { - AddError(command, argument); - } - } else if (command == "#OBJX") { - string[] args = argument.Split(','); - try { - string name = args[0]; - - if (!currentObjAnimations.ContainsKey("hmove_" + name)) { - var chip = new CChip(); - - chip.nチャンネル番号 = 0xCC; - chip.n発声位置 = ((this.n現在の小節数) * 384); - chip.dbBPM = this.dbNowBPM; - chip.n発声時刻ms = (int)this.dbNowTime; - chip.fNow_Measure_m = this.fNow_Measure_m; - chip.fNow_Measure_s = this.fNow_Measure_s; - chip.n整数値_内部番号 = 0; - - chip.strObjName = args[0]; - chip.fObjStart = float.Parse(args[1]); - chip.fObjEnd = float.Parse(args[1]); - chip.strObjEaseType = "IN_OUT"; - - // チップを配置。 - this.listChip.Add(chip); - } else { - AddError_Single("Missing #OBJHMOVEEND"); - Trace.TraceInformation("TJA ERROR: Missing #OBJHMOVEEND"); - } - } catch (Exception ex) { - AddError(command, argument); - } - } else if (command == "#OBJVSCALE") { - string[] args = argument.Split(','); - try { - string name = args[0]; - - if (!currentObjAnimations.ContainsKey("vscale_" + name)) { - var chip = new CChip(); - - chip.nチャンネル番号 = 0xCD; - chip.n発声位置 = ((this.n現在の小節数) * 384); - chip.dbBPM = this.dbNowBPM; - chip.n発声時刻ms = (int)this.dbNowTime; - chip.fNow_Measure_m = this.fNow_Measure_m; - chip.fNow_Measure_s = this.fNow_Measure_s; - chip.n整数値_内部番号 = 0; - - chip.strObjName = args[0]; - chip.fObjStart = float.Parse(args[1]); - chip.fObjEnd = float.Parse(args[1]); - chip.strObjEaseType = "IN_OUT"; - - // チップを配置。 - this.listChip.Add(chip); - } else { - AddError_Single("Missing #OBJVSCALEEND"); - Trace.TraceInformation("TJA ERROR: Missing #OBJVSCALEEND"); - } - } catch (Exception ex) { - AddError(command, argument); - } - } else if (command == "#OBJHSCALE") { - string[] args = argument.Split(','); - try { - string name = args[0]; - - if (!currentObjAnimations.ContainsKey("hscale_" + name)) { - var chip = new CChip(); - - chip.nチャンネル番号 = 0xCE; - chip.n発声位置 = ((this.n現在の小節数) * 384); - chip.dbBPM = this.dbNowBPM; - chip.n発声時刻ms = (int)this.dbNowTime; - chip.fNow_Measure_m = this.fNow_Measure_m; - chip.fNow_Measure_s = this.fNow_Measure_s; - chip.n整数値_内部番号 = 0; - - chip.strObjName = args[0]; - chip.fObjStart = float.Parse(args[1]); - chip.fObjEnd = float.Parse(args[1]); - chip.strObjEaseType = "IN_OUT"; - - // チップを配置。 - this.listChip.Add(chip); - } else { - AddError_Single("Missing #OBJHSCALEEND"); - Trace.TraceInformation("TJA ERROR: Missing #OBJHSCALEEND"); - } - } catch (Exception ex) { - AddError(command, argument); - } - } else if (command == "#OBJROTATION") { - string[] args = argument.Split(','); - try { - string name = args[0]; - - if (!currentObjAnimations.ContainsKey("rotation_" + name)) { - var chip = new CChip(); - - chip.nチャンネル番号 = 0xCF; - chip.n発声位置 = ((this.n現在の小節数) * 384); - chip.dbBPM = this.dbNowBPM; - chip.n発声時刻ms = (int)this.dbNowTime; - chip.fNow_Measure_m = this.fNow_Measure_m; - chip.fNow_Measure_s = this.fNow_Measure_s; - chip.n整数値_内部番号 = 0; - - chip.strObjName = args[0]; - chip.fObjStart = float.Parse(args[1]); - chip.fObjEnd = float.Parse(args[1]); - chip.strObjEaseType = "IN_OUT"; - - // チップを配置。 - this.listChip.Add(chip); - } else { - AddError_Single("Missing #OBJROTATIONEND"); - Trace.TraceInformation("TJA ERROR: Missing #OBJROTATIONEND"); - } - } catch (Exception ex) { - AddError(command, argument); - } - } else if (command == "#OBJOPACITY") { - string[] args = argument.Split(','); - try { - string name = args[0]; - - if (!currentObjAnimations.ContainsKey("opacity_" + name)) { - var chip = new CChip(); - - chip.nチャンネル番号 = 0xD0; - chip.n発声位置 = ((this.n現在の小節数) * 384); - chip.dbBPM = this.dbNowBPM; - chip.n発声時刻ms = (int)this.dbNowTime; - chip.fNow_Measure_m = this.fNow_Measure_m; - chip.fNow_Measure_s = this.fNow_Measure_s; - chip.n整数値_内部番号 = 0; - - chip.strObjName = args[0]; - chip.fObjStart = float.Parse(args[1]); - chip.fObjEnd = float.Parse(args[1]); - chip.strObjEaseType = "IN_OUT"; - - // チップを配置。 - this.listChip.Add(chip); - } else { - AddError_Single("Missing #OBJOPACITYEND"); - Trace.TraceInformation("TJA ERROR: Missing #OBJOPACITYEND"); - } - } catch (Exception ex) { - AddError(command, argument); - } - } else if (command == "#CHANGETEXTURE") { - var chip = new CChip(); - - chip.nチャンネル番号 = 0xD1; - chip.n発声位置 = ((this.n現在の小節数) * 384); - chip.dbBPM = this.dbNowBPM; - chip.n発声時刻ms = (int)this.dbNowTime; - chip.fNow_Measure_m = this.fNow_Measure_m; - chip.fNow_Measure_s = this.fNow_Measure_s; - chip.n整数値_内部番号 = 1; - - string[] args = argument.Split(','); - try { - chip.strTargetTxName = args[0].Replace("/", "\\"); - chip.strNewPath = this.strフォルダ名 + args[1]; - - if (this.bSession譜面を読み込む) { - if (!this.listOriginalTextures.ContainsKey(chip.strTargetTxName)) { - OpenTaiko.Tx.trackedTextures.TryGetValue(chip.strTargetTxName, out CTexture oldTx); - this.listOriginalTextures.Add(chip.strTargetTxName, new CTexture(oldTx)); - } - if (!this.listTextures.ContainsKey(chip.strNewPath)) { - CTexture tx = OpenTaiko.Tx.TxCSong(chip.strNewPath); - this.listTextures.Add(chip.strNewPath, tx); - } - } - - // チップを配置。 - this.listChip.Add(chip); - } catch (Exception ex) { - AddError(command, argument); - } - } else if (command == "#RESETTEXTURE") { - var chip = new CChip(); - - chip.nチャンネル番号 = 0xD2; - chip.n発声位置 = ((this.n現在の小節数) * 384); - chip.dbBPM = this.dbNowBPM; - chip.n発声時刻ms = (int)this.dbNowTime; - chip.fNow_Measure_m = this.fNow_Measure_m; - chip.fNow_Measure_s = this.fNow_Measure_s; - chip.n整数値_内部番号 = 1; - - chip.strTargetTxName = argument.Replace("/", "\\"); - - // チップを配置。 - this.listChip.Add(chip); - } else if (command == "#SETCONFIG") { - var chip = new CChip(); - - chip.nチャンネル番号 = 0xD3; - chip.n発声位置 = ((this.n現在の小節数) * 384); - chip.dbBPM = this.dbNowBPM; - chip.n発声時刻ms = (int)this.dbNowTime; - chip.fNow_Measure_m = this.fNow_Measure_m; - chip.fNow_Measure_s = this.fNow_Measure_s; - chip.n整数値_内部番号 = 1; - - chip.strConfigValue = argument; - - // チップを配置。 - this.listChip.Add(chip); - } else if (command == "#OBJANIMSTART") { - var chip = new CChip(); - - chip.nチャンネル番号 = 0xD4; - chip.n発声位置 = ((this.n現在の小節数) * 384); - chip.dbBPM = this.dbNowBPM; - chip.n発声時刻ms = (int)this.dbNowTime; - chip.fNow_Measure_m = this.fNow_Measure_m; - chip.fNow_Measure_s = this.fNow_Measure_s; - chip.n整数値_内部番号 = 1; - - string[] args = argument.Split(','); - try { - chip.strObjName = args[0]; - chip.dbAnimInterval = double.Parse(args[1]); - - // チップを配置。 - this.listChip.Add(chip); - } catch (Exception ex) { - AddError(command, argument); - } - } else if (command == "#OBJANIMSTARTLOOP") { - var chip = new CChip(); - - chip.nチャンネル番号 = 0xD5; - chip.n発声位置 = ((this.n現在の小節数) * 384); - chip.dbBPM = this.dbNowBPM; - chip.n発声時刻ms = (int)this.dbNowTime; - chip.fNow_Measure_m = this.fNow_Measure_m; - chip.fNow_Measure_s = this.fNow_Measure_s; - chip.n整数値_内部番号 = 1; - - string[] args = argument.Split(','); - try { - chip.strObjName = args[0]; - chip.dbAnimInterval = double.Parse(args[1]); - - // チップを配置。 - this.listChip.Add(chip); - } catch (Exception ex) { - AddError(command, argument); - } - } else if (command == "#OBJANIMEND") { - var chip = new CChip(); - - chip.nチャンネル番号 = 0xD6; - chip.n発声位置 = ((this.n現在の小節数) * 384); - chip.dbBPM = this.dbNowBPM; - chip.n発声時刻ms = (int)this.dbNowTime; - chip.fNow_Measure_m = this.fNow_Measure_m; - chip.fNow_Measure_s = this.fNow_Measure_s; - chip.n整数値_内部番号 = 1; - - chip.strObjName = argument; - - // チップを配置。 - this.listChip.Add(chip); - } else if (command == "#OBJFRAME") { - var chip = new CChip(); - - chip.nチャンネル番号 = 0xD7; - chip.n発声位置 = ((this.n現在の小節数) * 384); - chip.dbBPM = this.dbNowBPM; - chip.n発声時刻ms = (int)this.dbNowTime; - chip.fNow_Measure_m = this.fNow_Measure_m; - chip.fNow_Measure_s = this.fNow_Measure_s; - chip.n整数値_内部番号 = 1; - - string[] args = argument.Split(','); - try { - chip.strObjName = args[0]; - chip.intFrame = int.Parse(args[1]); - - // チップを配置。 - this.listChip.Add(chip); - } catch (Exception ex) { - AddError(command, argument); - } - } else if (command == "#GAMETYPE") { - var chip = new CChip(); - - chip.nチャンネル番号 = 0xD8; - chip.n発声位置 = ((this.n現在の小節数) * 384); - chip.dbBPM = this.dbNowBPM; - chip.n発声時刻ms = (int)this.dbNowTime; - chip.fNow_Measure_m = this.fNow_Measure_m; - chip.fNow_Measure_s = this.fNow_Measure_s; - chip.n整数値_内部番号 = 1; - switch (argument) { - case "Taiko": - chip.eGameType = EGameType.Taiko; - break; - case "Bongo": - case "Konga": - chip.eGameType = EGameType.Konga; - break; - } - - // チップを配置。 - this.listChip.Add(chip); - } else if (command == "#SPLITLANE") { - var chip = new CChip(); - - chip.nチャンネル番号 = 0xD9; - chip.n発声位置 = ((this.n現在の小節数) * 384); - chip.dbBPM = this.dbNowBPM; - chip.n発声時刻ms = (int)this.dbNowTime; - chip.fNow_Measure_m = this.fNow_Measure_m; - chip.fNow_Measure_s = this.fNow_Measure_s; - chip.n整数値_内部番号 = 1; - - // チップを配置。 - this.listChip.Add(chip); - } else if (command == "#MERGELANE") { - var chip = new CChip(); - - chip.nチャンネル番号 = 0xE3; - chip.n発声位置 = ((this.n現在の小節数) * 384); - chip.dbBPM = this.dbNowBPM; - chip.n発声時刻ms = (int)this.dbNowTime; - chip.fNow_Measure_m = this.fNow_Measure_m; - chip.fNow_Measure_s = this.fNow_Measure_s; - chip.n整数値_内部番号 = 1; - - // チップを配置。 - this.listChip.Add(chip); - } else if (command == "#BARLINE") { - var chip = new CChip(); - - chip.nチャンネル番号 = 0xE4; - chip.n発声位置 = ((this.n現在の小節数) * 384); - chip.dbBPM = this.dbNowBPM; - chip.dbSCROLL = this.dbNowScroll; - chip.dbSCROLL_Y = this.dbNowScrollY; - chip.n発声時刻ms = (int)this.dbNowTime; - chip.fNow_Measure_m = this.fNow_Measure_m; - chip.fNow_Measure_s = this.fNow_Measure_s; - chip.n整数値_内部番号 = 1; - chip.bHideBarLine = false; - - // チップを配置。 - this.listChip.Add(chip); - } else if (command == "#SECTION") { - //分岐:条件リセット - var chip = new CChip(); - - chip.nチャンネル番号 = 0xDD; - chip.n発声位置 = ((this.n現在の小節数 - 1) * 384); - chip.n発声時刻ms = (int)this.dbNowTime; - chip.fNow_Measure_m = this.fNow_Measure_m; - chip.fNow_Measure_s = this.fNow_Measure_s; - chip.n整数値_内部番号 = 1; - chip.db発声時刻ms = this.dbNowTime; - // チップを配置。 - this.listChip.Add(chip); - } else if (command == "#BRANCHSTART") { - #region [ 譜面分岐のパース方法を作り直し ] - this.bチップがある.Branch = true; - this.b最初の分岐である = false; - this.b分岐を一回でも開始した = true; - - //分岐:分岐スタート - E分岐種類 e条件; - - //条件数値。 - double[] nNum = new double[2]; - - //名前と条件Aの間に,が無いと正常に動作しなくなる.2020.04.23.akasoko26 - #region [ 名前と条件Aの間に,が無いと正常に動作しなくなる ] - //空白を削除する。 - argument = Regex.Replace(argument, @"\s", ""); - //2文字目が,か数値かをチェック - var IsNumber = bIsNumber(argument[1]); - //IsNumber == true であったら,が無いということなので,を2文字目にぶち込む・・・ - if (IsNumber) - argument = argument.Insert(1, ","); - #endregion - - var branchStartArgumentMatch = BranchStartArgumentRegex.Match(argument); - nNum[0] = Convert.ToDouble(branchStartArgumentMatch.Groups[2].Value); - nNum[1] = Convert.ToDouble(branchStartArgumentMatch.Groups[3].Value); - - switch (branchStartArgumentMatch.Groups[1].Value) { - case "p": - e条件 = E分岐種類.e精度分岐; - break; - case "r": - e条件 = E分岐種類.e連打分岐; - break; - case "s": - e条件 = E分岐種類.eスコア分岐; - break; - case "d": - e条件 = E分岐種類.e大音符のみ精度分岐; - break; - default: - e条件 = E分岐種類.e精度分岐; - break; - } - - #region [ 分岐開始時のチップ情報を記録 ] - //現在のチップ情報を記録する必要がある。 - this.t現在のチップ情報を記録する(true); - #endregion - - #region [ 一小節前の分岐開始Chip ] - //16分前に戻す計算なんか当てにしちゃだめよ。。(by Akasoko) - var c小節前の小節線情報 = c一小節前の小節線情報を返す(listChip, e条件); - CChip c小節前の連打開始位置 = null; - - var chip = new CChip(); - - if (e条件 == E分岐種類.e連打分岐) { - /* - c小節前の連打開始位置 = c一小節前の小節線情報を返す(listChip, e条件, true); - //連打分岐の位置を再現 - //この計算式はあてにならないと思うが、まあどうしようもないんでこれで - //なるべく連打のケツの部分に - var f連打の長さの半分 = (c小節前の小節線情報.n発声時刻ms - c小節前の連打開始位置.n発声時刻ms) / 2.0f; - */ - - chip.n発声時刻ms = c小節前の小節線情報.n発声時刻ms; - } else chip.n発声時刻ms = c小節前の小節線情報.n発声時刻ms; - - chip.nチャンネル番号 = 0xDE; - chip.fNow_Measure_m = c小節前の小節線情報.fNow_Measure_m; - chip.fNow_Measure_s = c小節前の小節線情報.fNow_Measure_s; - - //ノーツ * 0.5分後ろにして、ノーツが残らないようにする - chip.n分岐時刻ms = this.dbNowTime - ((15000.0 / this.dbNowBPM * (this.fNow_Measure_s / this.fNow_Measure_m)) * 0.5); - chip.e分岐の種類 = e条件; - chip.n条件数値A = nNum[0];// listに追加していたが仕様を変更。 - chip.n条件数値B = nNum[1];// "" - chip.dbSCROLL = c小節前の小節線情報.dbSCROLL; - chip.dbBPM = c小節前の小節線情報.dbBPM; - this.listChip.Add(chip); - #endregion - - for (int i = 0; i < 3; i++) - IsBranchBarDraw[i] = true;//3コース分の黄色小説線表示㋫ラブ - - IsEndedBranching = false; - #endregion - } else if (command == "#N" || command == "#E" || command == "#M")//これCourseを全部集めてあとから分岐させればいい件 - { - //開始時の情報にセット - t現在のチップ情報を記録する(false); - - if (command == "#N") - this.n現在のコース = ECourse.eNormal;//分岐:普通譜面 - else if (command == "#E") - this.n現在のコース = ECourse.eExpert;//分岐:玄人譜面 - else if (command == "#M") - this.n現在のコース = ECourse.eMaster;//分岐:達人譜面 - } else if (command == "#LEVELHOLD") { - var chip = new CChip(); - chip.nチャンネル番号 = 0xE1; - chip.n発声位置 = ((this.n現在の小節数) * 384) - 1; - chip.n発声時刻ms = (int)this.dbNowTime; - chip.fNow_Measure_m = this.fNow_Measure_m; - chip.fNow_Measure_s = this.fNow_Measure_s; - chip.n整数値_内部番号 = 1; - - this.listChip.Add(chip); - } else if (command == "#BRANCHEND") { - var GoBranch = new CChip(); - - //End用チャンネルをEmptyから引っ張ってきた。 - GoBranch.nチャンネル番号 = 0x52; - GoBranch.n発声位置 = ((this.n現在の小節数) * 384) - 1; - GoBranch.n発声時刻ms = (int)this.dbNowTime; - GoBranch.fNow_Measure_m = this.fNow_Measure_m; - GoBranch.fNow_Measure_s = this.fNow_Measure_s; - GoBranch.dbSCROLL = this.dbNowScroll; - GoBranch.dbBPM = this.dbNowBPM; - GoBranch.n整数値_内部番号 = 1; - - this.listChip.Add(GoBranch); - - //End時にも黄色い小節線あったべ? - for (int i = 0; i < 3; i++) - IsBranchBarDraw[i] = true;//3コース分の黄色小説線表示㋫ラブ - - IsEndedBranching = true; - } else if (command == "#BARLINEOFF") { - var chip = new CChip(); - - chip.nチャンネル番号 = 0xE0; - chip.n発声位置 = ((this.n現在の小節数) * 384) - 1; - chip.n発声時刻ms = (int)this.dbNowTime + 1; - chip.n整数値_内部番号 = 1; - chip.nコース = this.n現在のコース; - this.bBARLINECUE[0] = 1; - - this.listChip.Add(chip); - } else if (command == "#BARLINEON") { - var chip = new CChip(); - - chip.nチャンネル番号 = 0xE0; - chip.n発声位置 = ((this.n現在の小節数) * 384) - 1; - chip.n発声時刻ms = (int)this.dbNowTime + 1; - chip.fNow_Measure_m = this.fNow_Measure_m; - chip.fNow_Measure_s = this.fNow_Measure_s; - chip.n整数値_内部番号 = 2; - chip.nコース = this.n現在のコース; - this.bBARLINECUE[0] = 0; - - this.listChip.Add(chip); - } else if (command == "#LYRIC" && !usingLyricsFile && OpenTaiko.ConfigIni.nPlayerCount < 4) // Do not parse LYRIC tags if a lyric file is already loaded - { - if (OpenTaiko.r現在のステージ.eStageID == CStage.EStage.SongLoading)//起動時に重たくなってしまう問題の修正用 - this.listLyric.Add(this.pf歌詞フォント.DrawText(argument, OpenTaiko.Skin.Game_Lyric_ForeColor, OpenTaiko.Skin.Game_Lyric_BackColor, null, 30)); - - var chip = new CChip(); - - chip.nチャンネル番号 = 0xF1; - chip.n発声時刻ms = (int)this.dbNowTime; - chip.fNow_Measure_m = this.fNow_Measure_m; - chip.fNow_Measure_s = this.fNow_Measure_s; - chip.n整数値_内部番号 = 0; - chip.nコース = this.n現在のコース; - - // チップを配置。 - - this.listChip.Add(chip); - this.bLyrics = true; - } else if (command == "#DIRECTION") { - double dbSCROLL = Convert.ToDouble(argument); - this.nスクロール方向 = (int)dbSCROLL; - - //チップ追加して割り込んでみる。 - var chip = new CChip(); - - chip.nチャンネル番号 = 0xF2; - chip.n発声位置 = ((this.n現在の小節数) * 384) - 1; - chip.n発声時刻ms = (int)this.dbNowTime; - chip.fNow_Measure_m = this.fNow_Measure_m; - chip.fNow_Measure_s = this.fNow_Measure_s; - chip.n整数値_内部番号 = 0; - chip.nスクロール方向 = (int)dbSCROLL; - chip.nコース = this.n現在のコース; - - // チップを配置。 - - this.listChip.Add(chip); - } else if (command == "#SUDDEN") { - strArray = argument.Split(chDelimiter); - WarnSplitLength("#SUDDEN", strArray, 2); - double db出現時刻 = Convert.ToDouble(strArray[0]); - double db移動待機時刻 = Convert.ToDouble(strArray[1]); - this.db出現時刻 = db出現時刻; - this.db移動待機時刻 = db移動待機時刻; - - //チップ追加して割り込んでみる。 - var chip = new CChip(); - - chip.nチャンネル番号 = 0xF3; - chip.n発声位置 = ((this.n現在の小節数) * 384) - 1; - chip.n発声時刻ms = (int)this.dbNowTime; - chip.fNow_Measure_m = this.fNow_Measure_m; - chip.fNow_Measure_s = this.fNow_Measure_s; - chip.n整数値_内部番号 = 0; - chip.nノーツ出現時刻ms = (int)this.db出現時刻; - chip.nノーツ移動開始時刻ms = (int)this.db移動待機時刻; - chip.nコース = this.n現在のコース; - - // チップを配置。 - - this.listChip.Add(chip); - } else if (command == "#JPOSSCROLL") { - strArray = argument.Split(chDelimiter); - WarnSplitLength("#JPOSSCROLL", strArray, 2); - double db移動時刻 = Convert.ToDouble(strArray[0]); - int n移動px = 0; - int nComplexMove = 0; - if (strArray[1].IndexOf('i') != -1) { - double[] dbComplexNum = new double[2]; - this.tParsedComplexNumber(strArray[1], ref dbComplexNum); - n移動px = Convert.ToInt32(dbComplexNum[0]); - nComplexMove = Convert.ToInt32(dbComplexNum[1]); - } else - n移動px = Convert.ToInt32(strArray[1]); - - - int n移動方向 = (strArray.Length >= 3) ? Convert.ToInt32(strArray[2]) : 0; - - //チップ追加して割り込んでみる。 - var chip = new CChip(); - - chip.nチャンネル番号 = 0xE2; - chip.n発声位置 = ((this.n現在の小節数) * 384) - 1; - chip.n発声時刻ms = (int)this.dbNowTime; - chip.fNow_Measure_m = this.fNow_Measure_m; - chip.fNow_Measure_s = this.fNow_Measure_s; - chip.n整数値_内部番号 = 0; - chip.nコース = this.n現在のコース; - - // チップを配置。 - - this.listJPOSSCROLL.Add(this.n内部番号JSCROLL1to, new CJPOSSCROLL() { n内部番号 = this.n内部番号JSCROLL1to, n表記上の番号 = 0, db移動時間 = db移動時刻, n移動距離px = n移動px, n移動方向 = n移動方向, nVerticalMove = nComplexMove }); - this.listChip.Add(chip); - this.n内部番号JSCROLL1to++; - } else if (command == "#SENOTECHANGE") { - FixSENote = int.Parse(argument); - IsEnabledFixSENote = true; - } else if (command == "#NEXTSONG") { - nNextSongOffset += nOFFSET; - var delayTime = 6200.0 + nOFFSET; // 6.2秒ディレイ - //チップ追加して割り込んでみる。 - var chip = new CChip(); - - chip.nチャンネル番号 = 0x9B; - chip.n発声位置 = ((this.n現在の小節数) * 384) - 1; - chip.n発声時刻ms = (int)this.dbNowTime; - chip.fNow_Measure_m = this.fNow_Measure_m; - chip.fNow_Measure_s = this.fNow_Measure_s; - this.dbNowTime += delayTime; - this.dbNowBMScollTime += (delayTime - nOFFSET) * this.dbNowBPM / 15000; - chip.n整数値_内部番号 = 0; - chip.nコース = this.n現在のコース; - - // チップを配置。 - this.listChip.Add(chip); - - AddMusicPreTimeMs(); // 段位の幕が開いてからの遅延。 - - strArray = SplitComma(argument); // \,をエスケープ処理するメソッドだぞっ - - for (int i = listChip.Count - 1; i >= 0; i--) { - //if (listChip[i].nチャンネル番号 >= 0x11 && listChip[i].nチャンネル番号 <= 0x18) + else + chip1.n発声時刻ms = (int)this.nMOVIEOFFSET; + chip1.dbBPM = this.dbNowBPM; + chip1.fNow_Measure_m = this.fNow_Measure_m; + chip1.fNow_Measure_s = this.fNow_Measure_s; + chip1.dbSCROLL = this.dbNowScroll; + chip1.n整数値 = 0x01; + chip1.n整数値_内部番号 = 1; + + // チップを配置。 + + this.listChip.Add(chip1); + } else if (command == "#END") { + //ためしに割り込む。 + var chip = new CChip(); + + chip.nチャンネル番号 = 0xFF; + chip.n発声位置 = ((this.n現在の小節数 + 2) * 384); + chip.n発声時刻ms = (int)(this.dbNowTime + 1000); //2016.07.16 kairera0467 終了時から1秒後に設置するよう変更。 + chip.fNow_Measure_m = this.fNow_Measure_m; + chip.fNow_Measure_s = this.fNow_Measure_s; + chip.n整数値 = 0xFF; + chip.n整数値_内部番号 = 1; + // チップを配置。 + + if (n参照中の難易度 == (int)Difficulty.Dan) { + for (int i = listChip.Count - 1; i >= 0; i--) { if (NotesManager.IsHittableNote(listChip[i])) { if (DanSongs.Number != 0) { Array.Resize(ref this.pDan_LastChip, this.pDan_LastChip.Length + 1); @@ -5033,229 +2686,2688 @@ namespace OpenTaiko { } } } + } - WarnSplitLength("#NEXTSONG", strArray, 8); - var dansongs = new DanSongs(); - dansongs.Title = strArray[0]; - dansongs.SubTitle = strArray[1]; - dansongs.Genre = strArray[2]; - dansongs.FileName = strArray[3]; - dansongs.ScoreInit = int.Parse(strArray[4]); - dansongs.ScoreDiff = int.Parse(strArray[5]); + this.listChip.Add(chip); + } else if (command == "#BPMCHANGE") { + double dbBPM; + if (!double.TryParse(argument, out dbBPM)) { + AddError(command, argument); + dbBPM = 150; + } + this.dbNowBPM = dbBPM; - if (strArray.Length >= 7 && strArray[6] != "" && strArray[6] != null) - dansongs.Level = int.Parse(strArray[6]); - else if (strArray.Length < 7) - dansongs.Level = 10; + if (dbBPM > MaxBPM) { + MaxBPM = dbBPM; + } else if (dbBPM < MinBPM) { + MinBPM = dbBPM; + } - if (strArray.Length >= 8 && strArray[7] != "" && strArray[7] != null) - dansongs.Difficulty = strConvertCourse(strArray[7]); - else if (strArray.Length < 8) - dansongs.Difficulty = 3; + this.listBPM.Add(this.n内部番号BPM1to - 1, new CBPM() { n内部番号 = this.n内部番号BPM1to - 1, n表記上の番号 = 0, dbBPM値 = dbBPM, bpm_change_time = this.dbNowTime - nNextSongOffset, bpm_change_bmscroll_time = this.dbNowBMScollTime, bpm_change_course = this.n現在のコース }); - if (strArray.Length == 9 && strArray[8] != "" && strArray[8] != null) - dansongs.bTitleShow = bool.Parse(strArray[8]); - else if (strArray.Length < 9) - dansongs.bTitleShow = false; - dansongs.Wave = new CWAV { - n内部番号 = this.n内部番号WAV1to, - n表記上の番号 = this.n内部番号WAV1to, - nチップサイズ = this.n無限管理SIZE[this.n内部番号WAV1to], - n位置 = this.n無限管理PAN[this.n内部番号WAV1to], - SongVol = this.SongVol, - SongLoudnessMetadata = this.SongLoudnessMetadata, - strファイル名 = CDTXCompanionFileFinder.FindFileName(this.strフォルダ名, strファイル名, dansongs.FileName), - strコメント文 = "TJA BGM" - }; - dansongs.Wave.SongLoudnessMetadata = LoudnessMetadataScanner.LoadForAudioPath(dansongs.Wave.strファイル名); - List_DanSongs.Add(dansongs); - this.listWAV.Add(this.n内部番号WAV1to, dansongs.Wave); - this.n内部番号WAV1to++; + //チップ追加して割り込んでみる。 + var chip = new CChip(); - var nextSongnextSongChip = new CChip(); + chip.nチャンネル番号 = 0x08; + chip.n発声位置 = ((this.n現在の小節数) * 384); + chip.n発声時刻ms = (int)this.dbNowTime; + chip.fNow_Measure_m = this.fNow_Measure_m; + chip.fNow_Measure_s = this.fNow_Measure_s; + chip.fBMSCROLLTime = (float)this.dbNowBMScollTime; + chip.dbBPM = dbBPM; + chip.n整数値_内部番号 = this.n内部番号BPM1to - 1; - nextSongnextSongChip.nチャンネル番号 = 0x01; - nextSongnextSongChip.n発声位置 = 384; - nextSongnextSongChip.n発声時刻ms = (int)this.dbNowTime; - nextSongnextSongChip.fNow_Measure_m = this.fNow_Measure_m; - nextSongnextSongChip.fNow_Measure_s = this.fNow_Measure_s; - nextSongnextSongChip.n整数値 = 0x01; - nextSongnextSongChip.n整数値_内部番号 = 1 + List_DanSongs.Count; + // チップを配置。 - this.listWAV[1].strファイル名 = ""; + this.listChip.Add(chip); - Array.Resize(ref bHasBranchDan, List_DanSongs.Count); - bHasBranchDan[bHasBranchDan.Length - 1] = false; - - // チップを配置。 - this.listChip.Add(nextSongnextSongChip); - } else if (command == "#NMSCROLL") { - //チップ追加して割り込んでみる。 + var chip1 = new CChip(); + chip1.nチャンネル番号 = 0x9C; + chip1.n発声位置 = ((this.n現在の小節数) * 384); + chip1.n発声時刻ms = (int)this.dbNowTime; + chip.fNow_Measure_m = this.fNow_Measure_m; + chip.fNow_Measure_s = this.fNow_Measure_s; + chip1.fBMSCROLLTime = (float)this.dbNowBMScollTime; + chip1.dbBPM = dbBPM; + chip1.dbSCROLL = this.dbNowScroll; + chip1.n整数値_内部番号 = this.n内部番号BPM1to - 1; + + // チップを配置。 + + this.listChip.Add(chip1); + + this.n内部番号BPM1to++; + } else if (command == "#SCROLL") { + //2016.08.13 kairera0467 複素数スクロールもどきのテスト + if (argument.IndexOf('i') != -1) { + //iが入っていた場合、複素数スクロールとみなす。 + + double[] dbComplexNum = new double[2]; + try { + this.tParsedComplexNumber(argument, ref dbComplexNum); + } catch (Exception ex) { + AddError(command, argument); + dbComplexNum[0] = 1.0; + dbComplexNum[1] = 0.0; + } + + this.dbNowScroll = dbComplexNum[0]; + this.dbNowScrollY = dbComplexNum[1]; + + this.listSCROLL.Add(this.n内部番号SCROLL1to, new CSCROLL() { n内部番号 = this.n内部番号SCROLL1to, n表記上の番号 = 0, dbSCROLL値 = dbComplexNum[0], dbSCROLL値Y = dbComplexNum[1] }); + + switch (this.n現在のコース) { + case ECourse.eNormal: + this.dbNowSCROLL_Normal[0] = dbComplexNum[0]; + this.dbNowSCROLL_Normal[1] = dbComplexNum[1]; + break; + case ECourse.eExpert: + this.dbNowSCROLL_Expert[0] = dbComplexNum[0]; + this.dbNowSCROLL_Expert[1] = dbComplexNum[1]; + break; + case ECourse.eMaster: + this.dbNowSCROLL_Master[0] = dbComplexNum[0]; + this.dbNowSCROLL_Master[1] = dbComplexNum[1]; + break; + default: + this.dbNowSCROLL_Normal[0] = dbComplexNum[0]; + this.dbNowSCROLL_Normal[1] = dbComplexNum[1]; + break; + } + + //チップ追加して割り込んでみる。 var chip = new CChip(); - chip.nチャンネル番号 = 0x09; + chip.nチャンネル番号 = 0x9D; chip.n発声位置 = ((this.n現在の小節数) * 384) - 1; chip.n発声時刻ms = (int)this.dbNowTime; chip.fNow_Measure_m = this.fNow_Measure_m; chip.fNow_Measure_s = this.fNow_Measure_s; chip.n整数値_内部番号 = this.n内部番号SCROLL1to; - chip.nコース = this.n現在のコース; - - // チップを配置。 - eScrollMode = EScrollMode.Normal; + chip.dbSCROLL = dbComplexNum[0]; + chip.dbSCROLL_Y = dbComplexNum[1]; + chip.nコース = this.n現在のコース; + + // チップを配置。 this.listChip.Add(chip); - } else if (command == "#BMSCROLL") { - //チップ追加して割り込んでみる。 + } else { + double dbSCROLL = 1.0; + if (!double.TryParse(argument, out dbSCROLL)) { + AddError(command, argument); + dbSCROLL = 1; + } + + this.dbNowScroll = dbSCROLL; + this.dbNowScrollY = 0.0; + + this.listSCROLL.Add(this.n内部番号SCROLL1to, new CSCROLL() { n内部番号 = this.n内部番号SCROLL1to, n表記上の番号 = 0, dbSCROLL値 = dbSCROLL, dbSCROLL値Y = 0.0 }); + + switch (this.n現在のコース) { + case ECourse.eNormal: + this.dbNowSCROLL_Normal[0] = dbSCROLL; + break; + case ECourse.eExpert: + this.dbNowSCROLL_Expert[0] = dbSCROLL; + break; + case ECourse.eMaster: + this.dbNowSCROLL_Master[0] = dbSCROLL; + break; + } + + //チップ追加して割り込んでみる。 var chip = new CChip(); - chip.nチャンネル番号 = 0x0A; + chip.nチャンネル番号 = 0x9D; chip.n発声位置 = ((this.n現在の小節数) * 384) - 1; chip.n発声時刻ms = (int)this.dbNowTime; chip.fNow_Measure_m = this.fNow_Measure_m; chip.fNow_Measure_s = this.fNow_Measure_s; chip.n整数値_内部番号 = this.n内部番号SCROLL1to; - chip.nコース = this.n現在のコース; - - // チップを配置。 - eScrollMode = EScrollMode.BMScroll; + chip.dbSCROLL = dbSCROLL; + chip.dbSCROLL_Y = 0.0; + chip.nコース = this.n現在のコース; - this.listChip.Add(chip); - } else if (command == "#HBSCROLL") { - //チップ追加して割り込んでみる。 - var chip = new CChip(); - - chip.nチャンネル番号 = 0x0B; - chip.n発声位置 = ((this.n現在の小節数) * 384) - 1; - chip.n発声時刻ms = (int)this.dbNowTime; - chip.fNow_Measure_m = this.fNow_Measure_m; - chip.fNow_Measure_s = this.fNow_Measure_s; - chip.n整数値_内部番号 = this.n内部番号SCROLL1to; - chip.nコース = this.n現在のコース; - - // チップを配置。 - eScrollMode = EScrollMode.HBScroll; + // チップを配置。 this.listChip.Add(chip); } - } - void t現在のチップ情報を記録する(bool bInPut) { - //2020.04.21 こうなってしまったのは仕方がないな。。 - if (bInPut) { - #region [ 記録する ] - cBranchStart.dbTime = this.dbNowTime; - cBranchStart.dbSCROLL = this.dbNowScroll; - cBranchStart.dbSCROLLY = this.dbNowScrollY; - cBranchStart.dbBMScollTime = this.dbNowBMScollTime; - cBranchStart.dbBPM = this.dbNowBPM; - cBranchStart.fMeasure_s = this.fNow_Measure_s; - cBranchStart.fMeasure_m = this.fNow_Measure_m; - cBranchStart.nMeasureCount = this.n現在の小節数; - cBranchStart.db移動待機時刻 = this.db移動待機時刻; - cBranchStart.db再生速度 = this.db再生速度; - cBranchStart.db出現時刻 = this.db出現時刻; - #endregion - } else { - #region [ 記録した情報をNow~に適応 ] - this.dbNowTime = cBranchStart.dbTime; - this.dbNowScroll = cBranchStart.dbSCROLL; - this.dbNowScrollY = cBranchStart.dbSCROLLY; - this.dbNowBMScollTime = cBranchStart.dbBMScollTime; - this.dbNowBPM = cBranchStart.dbBPM; - this.fNow_Measure_s = cBranchStart.fMeasure_s; - this.fNow_Measure_m = cBranchStart.fMeasure_m; - this.n現在の小節数 = cBranchStart.nMeasureCount; - this.db移動待機時刻 = cBranchStart.db移動待機時刻; - this.db再生速度 = cBranchStart.db再生速度; - this.db出現時刻 = cBranchStart.db出現時刻; - #endregion + this.n内部番号SCROLL1to++; + } else if (command == "#MEASURE") { + strArray = argument.Split(new char[] { '/' }); + WarnSplitLength("#MEASURE subsplit", strArray, 2); + + double[] dbLength = new double[2]; + try { + dbLength[0] = Convert.ToDouble(strArray[0]); + dbLength[1] = Convert.ToDouble(strArray[1]); + } catch (Exception ex) { + AddError(command, argument); } - } - - /// - /// 一小節前の小節線情報を返すMethod 2020.04.21.akasoko26 - /// - /// - /// - private CChip c一小節前の小節線情報を返す(List listChips, E分岐種類 e分岐種類, bool b分岐前の連打開始 = false) { - //2020.04.20 c一小節前の小節線情報を返すMethodを追加 - //連打分岐時は現在の小節以降の連打の終わり部分の時刻を取得する - - int? nReturnChip = null; - - //--して取得しないとだめよ~ダメダメ💛 - //:damedane: - for (int i = listChips.Count - 1; i >= 0; i--) { - if (b分岐前の連打開始) { - //if (listChips[i].nチャンネル番号 == 0x15 || listChips[i].nチャンネル番号 == 0x16) - if (NotesManager.IsRoll(listChips[i]) || NotesManager.IsFuzeRoll(listChips[i])) { - if (nReturnChip == null) - nReturnChip = i; - - //ReturnChipがnullであったら適応 + + double db小節長倍率 = dbLength[0] / dbLength[1]; + this.dbBarLength = db小節長倍率; + this.fNow_Measure_m = (float)dbLength[1]; + this.fNow_Measure_s = (float)dbLength[0]; + + var chip = new CChip(); + + chip.nチャンネル番号 = 0x02; + chip.n発声位置 = ((this.n現在の小節数) * 384); + chip.n発声時刻ms = (int)this.dbNowTime; + chip.fNow_Measure_m = this.fNow_Measure_m; + chip.fNow_Measure_s = this.fNow_Measure_s; + chip.dbSCROLL = this.dbNowScroll; + chip.db実数値 = db小節長倍率; + chip.n整数値_内部番号 = 1; + // チップを配置。 + + this.listChip.Add(chip); + } else if (command == "#DELAY") { + double nDELAY = 0; + if (!double.TryParse(argument, out nDELAY)) { + AddError(command, argument); + nDELAY = 0; + } + nDELAY *= 1000; + + this.listDELAY.Add(this.n内部番号DELAY1to, new CDELAY() { n内部番号 = this.n内部番号DELAY1to, n表記上の番号 = 0, nDELAY値 = (int)nDELAY, delay_bmscroll_time = this.dbLastBMScrollTime, delay_bpm = this.dbNowBPM, delay_course = this.n現在のコース, delay_time = this.dbLastTime }); + //チップ追加して割り込んでみる。 + var chip = new CChip(); + + chip.nチャンネル番号 = 0xDC; + chip.n発声位置 = ((this.n現在の小節数) * 384); + chip.db発声時刻ms = this.dbNowTime; + chip.fNow_Measure_m = this.fNow_Measure_m; + chip.fNow_Measure_s = this.fNow_Measure_s; + chip.nコース = this.n現在のコース; + chip.n整数値_内部番号 = this.n内部番号DELAY1to; + chip.fBMSCROLLTime = this.dbNowBMScollTime; + // チップを配置。 + + this.dbNowTime += nDELAY; + this.dbNowBMScollTime += nDELAY * this.dbNowBPM / 15000; + + this.listChip.Add(chip); + this.n内部番号DELAY1to++; + } else if (command == "#GOGOSTART") { + var chip = new CChip(); + + chip.nチャンネル番号 = 0x9E; + chip.n発声位置 = ((this.n現在の小節数) * 384); + chip.dbBPM = this.dbNowBPM; + chip.n発声時刻ms = (int)this.dbNowTime; + chip.fNow_Measure_m = this.fNow_Measure_m; + chip.fNow_Measure_s = this.fNow_Measure_s; + chip.n整数値_内部番号 = 1; + this.bGOGOTIME = true; + + // チップを配置。 + this.listChip.Add(chip); + } else if (command == "#GOGOEND") { + var chip = new CChip(); + + chip.nチャンネル番号 = 0x9F; + chip.n発声位置 = ((this.n現在の小節数) * 384); + chip.n発声時刻ms = (int)this.dbNowTime; + chip.fNow_Measure_m = this.fNow_Measure_m; + chip.fNow_Measure_s = this.fNow_Measure_s; + chip.dbBPM = this.dbNowBPM; + chip.n整数値_内部番号 = 1; + this.bGOGOTIME = false; + + // チップを配置。 + this.listChip.Add(chip); + } else if (command == "#BGAON") { + try { + var commandData = argument.Split(' '); + string listvdIndex = commandData[0]; + var bgaStartTime = commandData[1]; + int index = (10 * int.Parse(listvdIndex[0].ToString())) + int.Parse(listvdIndex[1].ToString()) + 2; + + var chip = new CChip(); + chip.nチャンネル番号 = 0x54; + chip.n発声位置 = ((this.n現在の小節数) * 384); + chip.dbBPM = this.dbNowBPM; + chip.n発声時刻ms = (int)this.dbNowTime; + chip.fNow_Measure_m = this.fNow_Measure_m; + chip.fNow_Measure_s = this.fNow_Measure_s; + chip.n整数値_内部番号 = index; + chip.n整数値 = index; + + chip.VideoStartTimeMs = (int)(float.Parse(bgaStartTime) * 1000); + + // チップを配置。 + this.listChip.Add(chip); + } catch (Exception ex) { + AddError(command, argument); + } + } else if (command == "#BGAOFF") { + int index = (10 * int.Parse(argument[0].ToString())) + int.Parse(argument[1].ToString()) + 2; + var chip = new CChip(); + chip.nチャンネル番号 = 0x55; + chip.n発声位置 = ((this.n現在の小節数) * 384); + chip.dbBPM = this.dbNowBPM; + chip.n発声時刻ms = (int)this.dbNowTime; + chip.fNow_Measure_m = this.fNow_Measure_m; + chip.fNow_Measure_s = this.fNow_Measure_s; + chip.n整数値_内部番号 = index; + chip.n整数値 = index; + + // チップを配置。 + this.listChip.Add(chip); + } else if (command == "#CAMVMOVESTART") { + if (currentCamVMoveChip == null) { + //starts vertical camera moving + //arguments: ,,, + var chip = new CChip(); + + chip.nチャンネル番号 = 0xA0; + chip.n発声位置 = ((this.n現在の小節数) * 384); + chip.dbBPM = this.dbNowBPM; + chip.n発声時刻ms = (int)this.dbNowTime; + chip.fNow_Measure_m = this.fNow_Measure_m; + chip.fNow_Measure_s = this.fNow_Measure_s; + chip.n整数値_内部番号 = 0; + + try { + string[] args = argument.Split(','); + chip.fCamScrollStartY = float.Parse(args[0]); + chip.fCamScrollEndY = float.Parse(args[1]); + chip.strCamEaseType = args[2]; + + var type = args[3]; + var eType = Easing.CalcType.Quadratic; + switch (type) { + case "CUBIC": + eType = Easing.CalcType.Cubic; + break; + case "QUARTIC": + eType = Easing.CalcType.Quartic; + break; + case "QUINTIC": + eType = Easing.CalcType.Quintic; + break; + case "SINUSOIDAL": + eType = Easing.CalcType.Sinusoidal; + break; + case "EXPONENTIAL": + eType = Easing.CalcType.Exponential; + break; + case "CIRCULAR": + eType = Easing.CalcType.Circular; + break; + case "LINEAR": + eType = Easing.CalcType.Linear; + break; } - } else { - var Flag = e分岐種類 == E分岐種類.e連打分岐 ? 0x18 : 0x50; - if (listChips[i].nチャンネル番号 == Flag) { - if (nReturnChip == null) - nReturnChip = i; - //ReturnChipがnullであったら適応 + chip.fCamMoveType = eType; + + currentCamVMoveChip = chip; + + // チップを配置。 + this.listChip.Add(chip); + } catch (Exception ex) { + AddError(command, argument); + } + } else { + AddError_Single("Missing #CAMVMOVEEND"); + Trace.TraceInformation("TJA ERROR: Missing #CAMVMOVEEND"); + } + } else if (command == "#CAMVMOVEEND") { + if (currentCamVMoveChip != null) { + //ends vertical camera moving + var chip = new CChip(); + + chip.nチャンネル番号 = 0xA1; + chip.n発声位置 = ((this.n現在の小節数) * 384); + chip.dbBPM = this.dbNowBPM; + chip.n発声時刻ms = (int)this.dbNowTime; + chip.fNow_Measure_m = this.fNow_Measure_m; + chip.fNow_Measure_s = this.fNow_Measure_s; + chip.n整数値_内部番号 = 1; + + var index = this.listChip.IndexOf(currentCamVMoveChip); + var msDiff = chip.n発声時刻ms - currentCamVMoveChip.n発声時刻ms; + + currentCamVMoveChip.fCamTimeMs = msDiff; + this.listChip[index] = currentCamVMoveChip; + + currentCamVMoveChip = null; + + // チップを配置。 + this.listChip.Add(chip); + } else { + AddError_Single("Missing #CAMVMOVESTART"); + Trace.TraceInformation("TJA ERROR: Missing #CAMVMOVESTART"); + } + } else if (command == "#CAMHMOVESTART") { + if (currentCamHMoveChip == null) { + //starts horizontal camera moving + //arguments: ,,, + var chip = new CChip(); + + chip.nチャンネル番号 = 0xA2; + chip.n発声位置 = ((this.n現在の小節数) * 384); + chip.dbBPM = this.dbNowBPM; + chip.n発声時刻ms = (int)this.dbNowTime; + chip.fNow_Measure_m = this.fNow_Measure_m; + chip.fNow_Measure_s = this.fNow_Measure_s; + chip.n整数値_内部番号 = 1; + + try { + string[] args = argument.Split(','); + chip.fCamScrollStartX = float.Parse(args[0]); + chip.fCamScrollEndX = float.Parse(args[1]); + chip.strCamEaseType = args[2]; + + var type = args[3]; + var eType = Easing.CalcType.Quadratic; + switch (type) { + case "CUBIC": + eType = Easing.CalcType.Cubic; + break; + case "QUARTIC": + eType = Easing.CalcType.Quartic; + break; + case "QUINTIC": + eType = Easing.CalcType.Quintic; + break; + case "SINUSOIDAL": + eType = Easing.CalcType.Sinusoidal; + break; + case "EXPONENTIAL": + eType = Easing.CalcType.Exponential; + break; + case "CIRCULAR": + eType = Easing.CalcType.Circular; + break; + case "LINEAR": + eType = Easing.CalcType.Linear; + break; + default: + break; + } + + chip.fCamMoveType = eType; + + currentCamHMoveChip = chip; + + // チップを配置。 + this.listChip.Add(chip); + } catch (Exception ex) { + AddError(command, argument); + } + } else { + AddError_Single("Missing #CAMHMOVEEND"); + Trace.TraceInformation("TJA ERROR: Missing #CAMHMOVEEND"); + } + } else if (command == "#CAMHMOVEEND") { + if (currentCamHMoveChip != null) { + //ends horizontal camera moving + var chip = new CChip(); + + chip.nチャンネル番号 = 0xA3; + chip.n発声位置 = ((this.n現在の小節数) * 384); + chip.dbBPM = this.dbNowBPM; + chip.n発声時刻ms = (int)this.dbNowTime; + chip.fNow_Measure_m = this.fNow_Measure_m; + chip.fNow_Measure_s = this.fNow_Measure_s; + chip.n整数値_内部番号 = 1; + + var index = this.listChip.IndexOf(currentCamHMoveChip); + var msDiff = chip.n発声時刻ms - currentCamHMoveChip.n発声時刻ms; + + currentCamHMoveChip.fCamTimeMs = msDiff; + this.listChip[index] = currentCamHMoveChip; + + currentCamHMoveChip = null; + + // チップを配置。 + this.listChip.Add(chip); + } else { + AddError_Single("Missing #CAMHMOVESTART"); + Trace.TraceInformation("TJA ERROR: Missing #CAMHMOVESTART"); + } + } else if (command == "#CAMZOOMSTART") { + if (currentCamZoomChip == null) { + //starts zooming in/out the screen + //arguments: ,,, + var chip = new CChip(); + + chip.nチャンネル番号 = 0xA4; + chip.n発声位置 = ((this.n現在の小節数) * 384); + chip.dbBPM = this.dbNowBPM; + chip.n発声時刻ms = (int)this.dbNowTime; + chip.fNow_Measure_m = this.fNow_Measure_m; + chip.fNow_Measure_s = this.fNow_Measure_s; + chip.n整数値_内部番号 = 1; + + try { + string[] args = argument.Split(','); + chip.fCamZoomStart = float.Parse(args[0]); + chip.fCamZoomEnd = float.Parse(args[1]); + chip.strCamEaseType = args[2]; + + var type = args[3]; + var eType = Easing.CalcType.Quadratic; + switch (type) { + case "CUBIC": + eType = Easing.CalcType.Cubic; + break; + case "QUARTIC": + eType = Easing.CalcType.Quartic; + break; + case "QUINTIC": + eType = Easing.CalcType.Quintic; + break; + case "SINUSOIDAL": + eType = Easing.CalcType.Sinusoidal; + break; + case "EXPONENTIAL": + eType = Easing.CalcType.Exponential; + break; + case "CIRCULAR": + eType = Easing.CalcType.Circular; + break; + case "LINEAR": + eType = Easing.CalcType.Linear; + break; + } + + chip.fCamMoveType = eType; + + currentCamZoomChip = chip; + + // チップを配置。 + this.listChip.Add(chip); + } catch (Exception ex) { + AddError(command, argument); + } + } else { + AddError_Single("Missing #CAMZOOMEND"); + Trace.TraceInformation("TJA ERROR: Missing #CAMZOOMEND"); + } + } else if (command == "#CAMZOOMEND") { + if (currentCamZoomChip != null) { + //stops zooming + var chip = new CChip(); + + chip.nチャンネル番号 = 0xA5; + chip.n発声位置 = ((this.n現在の小節数) * 384); + chip.dbBPM = this.dbNowBPM; + chip.n発声時刻ms = (int)this.dbNowTime; + chip.fNow_Measure_m = this.fNow_Measure_m; + chip.fNow_Measure_s = this.fNow_Measure_s; + chip.n整数値_内部番号 = 1; + + var index = this.listChip.IndexOf(currentCamZoomChip); + var msDiff = chip.n発声時刻ms - currentCamZoomChip.n発声時刻ms; + + currentCamZoomChip.fCamTimeMs = msDiff; + this.listChip[index] = currentCamZoomChip; + + currentCamZoomChip = null; + + // チップを配置。 + this.listChip.Add(chip); + } else { + AddError_Single("Missing #CAMZOOMSTART"); + Trace.TraceInformation("TJA ERROR: Missing #CAMZOOMSTART"); + } + } else if (command == "#CAMROTATIONSTART") { + if (currentCamRotateChip == null) { + //starts rotating the screen + //arguments: ,,, + var chip = new CChip(); + + chip.nチャンネル番号 = 0xA6; + chip.n発声位置 = ((this.n現在の小節数) * 384); + chip.dbBPM = this.dbNowBPM; + chip.n発声時刻ms = (int)this.dbNowTime; + chip.fNow_Measure_m = this.fNow_Measure_m; + chip.fNow_Measure_s = this.fNow_Measure_s; + chip.n整数値_内部番号 = 1; + + try { + string[] args = argument.Split(','); + chip.fCamRotationStart = float.Parse(args[0]); + chip.fCamRotationEnd = float.Parse(args[1]); + chip.strCamEaseType = args[2]; + + var type = args[3]; + var eType = Easing.CalcType.Quadratic; + switch (type) { + case "CUBIC": + eType = Easing.CalcType.Cubic; + break; + case "QUARTIC": + eType = Easing.CalcType.Quartic; + break; + case "QUINTIC": + eType = Easing.CalcType.Quintic; + break; + case "SINUSOIDAL": + eType = Easing.CalcType.Sinusoidal; + break; + case "EXPONENTIAL": + eType = Easing.CalcType.Exponential; + break; + case "CIRCULAR": + eType = Easing.CalcType.Circular; + break; + case "LINEAR": + eType = Easing.CalcType.Linear; + break; + default: + break; + } + + chip.fCamMoveType = eType; + + currentCamRotateChip = chip; + + // チップを配置。 + this.listChip.Add(chip); + } catch (Exception ex) { + AddError(command, argument); + } + } else { + AddError_Single("Missing #CAMROTATIONEND"); + Trace.TraceInformation("TJA ERROR: Missing #CAMROTATIONEND"); + } + } else if (command == "#CAMROTATIONEND") { + if (currentCamRotateChip != null) { + //stops screen rotation + var chip = new CChip(); + + chip.nチャンネル番号 = 0xA7; + chip.n発声位置 = ((this.n現在の小節数) * 384); + chip.dbBPM = this.dbNowBPM; + chip.n発声時刻ms = (int)this.dbNowTime; + chip.fNow_Measure_m = this.fNow_Measure_m; + chip.fNow_Measure_s = this.fNow_Measure_s; + chip.n整数値_内部番号 = 1; + + var index = this.listChip.IndexOf(currentCamRotateChip); + var msDiff = chip.n発声時刻ms - currentCamRotateChip.n発声時刻ms; + + currentCamRotateChip.fCamTimeMs = msDiff; + this.listChip[index] = currentCamRotateChip; + + currentCamRotateChip = null; + + // チップを配置。 + this.listChip.Add(chip); + } else { + AddError_Single("Missing #CAMROTATIONSTART"); + Trace.TraceInformation("TJA ERROR: Missing #CAMROTATIONSTART"); + } + } else if (command == "#CAMVSCALESTART") { + if (currentCamVScaleChip == null) { + //starts vertical camera scale changing + //arguments: ,,, + var chip = new CChip(); + + chip.nチャンネル番号 = 0xA8; + chip.n発声位置 = ((this.n現在の小節数) * 384); + chip.dbBPM = this.dbNowBPM; + chip.n発声時刻ms = (int)this.dbNowTime; + chip.fNow_Measure_m = this.fNow_Measure_m; + chip.fNow_Measure_s = this.fNow_Measure_s; + chip.n整数値_内部番号 = 1; + + try { + string[] args = argument.Split(','); + chip.fCamScaleStartY = float.Parse(args[0]); + chip.fCamScaleEndY = float.Parse(args[1]); + chip.strCamEaseType = args[2]; + + var type = args[3]; + var eType = Easing.CalcType.Quadratic; + switch (type) { + case "CUBIC": + eType = Easing.CalcType.Cubic; + break; + case "QUARTIC": + eType = Easing.CalcType.Quartic; + break; + case "QUINTIC": + eType = Easing.CalcType.Quintic; + break; + case "SINUSOIDAL": + eType = Easing.CalcType.Sinusoidal; + break; + case "EXPONENTIAL": + eType = Easing.CalcType.Exponential; + break; + case "CIRCULAR": + eType = Easing.CalcType.Circular; + break; + case "LINEAR": + eType = Easing.CalcType.Linear; + break; + default: + break; + } + + chip.fCamMoveType = eType; + + currentCamVScaleChip = chip; + + // チップを配置。 + this.listChip.Add(chip); + } catch (Exception ex) { + AddError(command, argument); + } + } else { + AddError_Single("Missing #CAMVSCALEEND"); + Trace.TraceInformation("TJA ERROR: Missing #CAMVSCALEEND"); + } + } else if (command == "#CAMVSCALEEND") { + if (currentCamVScaleChip != null) { + //ends vertical camera scaling + var chip = new CChip(); + + chip.nチャンネル番号 = 0xA9; + chip.n発声位置 = ((this.n現在の小節数) * 384); + chip.dbBPM = this.dbNowBPM; + chip.n発声時刻ms = (int)this.dbNowTime; + chip.fNow_Measure_m = this.fNow_Measure_m; + chip.fNow_Measure_s = this.fNow_Measure_s; + chip.n整数値_内部番号 = 1; + + var index = this.listChip.IndexOf(currentCamVScaleChip); + var msDiff = chip.n発声時刻ms - currentCamVScaleChip.n発声時刻ms; + + currentCamVScaleChip.fCamTimeMs = msDiff; + this.listChip[index] = currentCamVScaleChip; + + currentCamVScaleChip = null; + + // チップを配置。 + this.listChip.Add(chip); + } else { + AddError_Single("Missing #CAMVSCALESTART"); + Trace.TraceInformation("TJA ERROR: Missing #CAMVSCALESTART"); + } + } else if (command == "#CAMHSCALESTART") { + if (currentCamHScaleChip == null) { + //starts horizontal camera scale changing + //arguments: ,,, + var chip = new CChip(); + + chip.nチャンネル番号 = 0xB0; + chip.n発声位置 = ((this.n現在の小節数) * 384); + chip.dbBPM = this.dbNowBPM; + chip.n発声時刻ms = (int)this.dbNowTime; + chip.fNow_Measure_m = this.fNow_Measure_m; + chip.fNow_Measure_s = this.fNow_Measure_s; + chip.n整数値_内部番号 = 1; + + try { + string[] args = argument.Split(','); + chip.fCamScaleStartX = float.Parse(args[0]); + chip.fCamScaleEndX = float.Parse(args[1]); + chip.strCamEaseType = args[2]; + + var type = args[3]; + var eType = Easing.CalcType.Quadratic; + switch (type) { + case "CUBIC": + eType = Easing.CalcType.Cubic; + break; + case "QUARTIC": + eType = Easing.CalcType.Quartic; + break; + case "QUINTIC": + eType = Easing.CalcType.Quintic; + break; + case "SINUSOIDAL": + eType = Easing.CalcType.Sinusoidal; + break; + case "EXPONENTIAL": + eType = Easing.CalcType.Exponential; + break; + case "CIRCULAR": + eType = Easing.CalcType.Circular; + break; + case "LINEAR": + eType = Easing.CalcType.Linear; + break; + default: + break; + } + + chip.fCamMoveType = eType; + + currentCamHScaleChip = chip; + + // チップを配置。 + this.listChip.Add(chip); + } catch (Exception ex) { + AddError(command, argument); + } + } else { + AddError_Single("Missing #CAMHSCALEEND"); + Trace.TraceInformation("TJA ERROR: Missing #CAMHSCALEEND"); + } + } else if (command == "#CAMHSCALEEND") { + if (currentCamHScaleChip != null) { + //ends horizontal camera scaling + var chip = new CChip(); + + chip.nチャンネル番号 = 0xB1; + chip.n発声位置 = ((this.n現在の小節数) * 384); + chip.dbBPM = this.dbNowBPM; + chip.n発声時刻ms = (int)this.dbNowTime; + chip.fNow_Measure_m = this.fNow_Measure_m; + chip.fNow_Measure_s = this.fNow_Measure_s; + chip.n整数値_内部番号 = 1; + + var index = this.listChip.IndexOf(currentCamHScaleChip); + var msDiff = chip.n発声時刻ms - currentCamHScaleChip.n発声時刻ms; + + currentCamHScaleChip.fCamTimeMs = msDiff; + this.listChip[index] = currentCamHScaleChip; + + currentCamHScaleChip = null; + + // チップを配置。 + this.listChip.Add(chip); + } else { + AddError_Single("Missing #CAMHSCALESTART"); + Trace.TraceInformation("TJA ERROR: Missing #CAMHSCALESTART"); + } + } else if (command == "#BORDERCOLOR") { + //sets border color + //arguments: ,, + var chip = new CChip(); + + chip.nチャンネル番号 = 0xB2; + chip.n発声位置 = ((this.n現在の小節数) * 384); + chip.dbBPM = this.dbNowBPM; + chip.n発声時刻ms = (int)this.dbNowTime; + chip.fNow_Measure_m = this.fNow_Measure_m; + chip.fNow_Measure_s = this.fNow_Measure_s; + chip.n整数値_内部番号 = 1; + + string[] args = argument.Split(','); + chip.borderColor = new Color4(1f, float.Parse(args[0]) / 255, float.Parse(args[1]) / 255, float.Parse(args[2]) / 255); + + // チップを配置。 + this.listChip.Add(chip); + } else if (command == "#CAMHOFFSET") { + if (currentCamHMoveChip == null) { + //sets camera x offset + //argument: + var chip = new CChip(); + + chip.nチャンネル番号 = 0xB3; + chip.n発声位置 = ((this.n現在の小節数) * 384); + chip.dbBPM = this.dbNowBPM; + chip.n発声時刻ms = (int)this.dbNowTime; + chip.fNow_Measure_m = this.fNow_Measure_m; + chip.fNow_Measure_s = this.fNow_Measure_s; + chip.n整数値_内部番号 = 1; + + if (float.TryParse(argument, out float value)) { + chip.fCamScrollStartX = value; + chip.fCamScrollEndX = value; + } else { + AddError(command, argument); + } + chip.strCamEaseType = "IN_OUT"; + + // チップを配置。 + this.listChip.Add(chip); + } else { + AddError_Single("Missing #CAMHMOVEEND"); + Trace.TraceInformation("TJA ERROR: Missing #CAMHMOVEEND"); + } + } else if (command == "#CAMVOFFSET") { + if (currentCamVMoveChip == null) { + //sets camera y offset + //argument: + var chip = new CChip(); + + chip.nチャンネル番号 = 0xB4; + chip.n発声位置 = ((this.n現在の小節数) * 384); + chip.dbBPM = this.dbNowBPM; + chip.n発声時刻ms = (int)this.dbNowTime; + chip.fNow_Measure_m = this.fNow_Measure_m; + chip.fNow_Measure_s = this.fNow_Measure_s; + chip.n整数値_内部番号 = 1; + + if (float.TryParse(argument, out float value)) { + chip.fCamScrollStartY = float.Parse(argument); + chip.fCamScrollEndY = float.Parse(argument); + } else { + AddError(command, argument); + } + chip.strCamEaseType = "IN_OUT"; + + // チップを配置。 + this.listChip.Add(chip); + } else { + AddError_Single("Missing #CAMVMOVEEND"); + Trace.TraceInformation("TJA ERROR: Missing #CAMVMOVEEND"); + } + } else if (command == "#CAMZOOM") { + if (currentCamZoomChip == null) { + //sets camera zoom factor + //argument: + var chip = new CChip(); + + chip.nチャンネル番号 = 0xB5; + chip.n発声位置 = ((this.n現在の小節数) * 384); + chip.dbBPM = this.dbNowBPM; + chip.n発声時刻ms = (int)this.dbNowTime; + chip.fNow_Measure_m = this.fNow_Measure_m; + chip.fNow_Measure_s = this.fNow_Measure_s; + chip.n整数値_内部番号 = 1; + + if (float.TryParse(argument, out float value)) { + chip.fCamZoomStart = float.Parse(argument); + chip.fCamZoomEnd = float.Parse(argument); + } else { + AddError(command, argument); + } + chip.strCamEaseType = "IN_OUT"; + + // チップを配置。 + this.listChip.Add(chip); + } else { + AddError_Single("Missing #CAMZOOMEND"); + Trace.TraceInformation("TJA ERROR: Missing #CAMZOOMEND"); + } + } else if (command == "#CAMROTATION") { + if (currentCamRotateChip == null) { + //sets camera rotation + //argument: + var chip = new CChip(); + + chip.nチャンネル番号 = 0xB6; + chip.n発声位置 = ((this.n現在の小節数) * 384); + chip.dbBPM = this.dbNowBPM; + chip.n発声時刻ms = (int)this.dbNowTime; + chip.fNow_Measure_m = this.fNow_Measure_m; + chip.fNow_Measure_s = this.fNow_Measure_s; + chip.n整数値_内部番号 = 1; + + if (float.TryParse(argument, out float value)) { + chip.fCamRotationStart = float.Parse(argument); + chip.fCamRotationEnd = float.Parse(argument); + } else { + AddError(command, argument); + } + chip.strCamEaseType = "IN_OUT"; + + // チップを配置。 + this.listChip.Add(chip); + } else { + AddError_Single("Missing #CAMROTATIONEND"); + Trace.TraceInformation("TJA ERROR: Missing #CAMROTATIONEND"); + } + } else if (command == "#CAMHSCALE") { + if (currentCamHScaleChip == null) { + //sets camera x scale + //argument: + var chip = new CChip(); + + chip.nチャンネル番号 = 0xB7; + chip.n発声位置 = ((this.n現在の小節数) * 384); + chip.dbBPM = this.dbNowBPM; + chip.n発声時刻ms = (int)this.dbNowTime; + chip.fNow_Measure_m = this.fNow_Measure_m; + chip.fNow_Measure_s = this.fNow_Measure_s; + chip.n整数値_内部番号 = 1; + + if (float.TryParse(argument, out float value)) { + chip.fCamScaleStartX = float.Parse(argument); + chip.fCamScaleEndX = float.Parse(argument); + } else { + AddError(command, argument); + } + chip.strCamEaseType = "IN_OUT"; + + // チップを配置。 + this.listChip.Add(chip); + } else { + AddError_Single("Missing #CAMHSCALEEND"); + Trace.TraceInformation("TJA ERROR: Missing #CAMHSCALEEND"); + } + } else if (command == "#CAMVSCALE") { + if (currentCamVScaleChip == null) { + //sets camera y scale + //argument: + var chip = new CChip(); + + chip.nチャンネル番号 = 0xB8; + chip.n発声位置 = ((this.n現在の小節数) * 384); + chip.dbBPM = this.dbNowBPM; + chip.n発声時刻ms = (int)this.dbNowTime; + chip.fNow_Measure_m = this.fNow_Measure_m; + chip.fNow_Measure_s = this.fNow_Measure_s; + chip.n整数値_内部番号 = 1; + + if (float.TryParse(argument, out float value)) { + chip.fCamScaleStartY = float.Parse(argument); + chip.fCamScaleEndY = float.Parse(argument); + } else { + AddError(command, argument); + } + chip.strCamEaseType = "IN_OUT"; + + // チップを配置。 + this.listChip.Add(chip); + } else { + AddError_Single("Missing #CAMVSCALEEND"); + Trace.TraceInformation("TJA ERROR: Missing #CAMVSCALEEND"); + } + } else if (command == "#CAMRESET") { + //resets camera properties + var chip = new CChip(); + + chip.nチャンネル番号 = 0xB9; + chip.n発声位置 = ((this.n現在の小節数) * 384); + chip.dbBPM = this.dbNowBPM; + chip.n発声時刻ms = (int)this.dbNowTime; + chip.fNow_Measure_m = this.fNow_Measure_m; + chip.fNow_Measure_s = this.fNow_Measure_s; + chip.n整数値_内部番号 = 1; + + chip.fCamScrollStartX = 0.0f; + chip.fCamScrollEndX = 0.0f; + chip.fCamScrollStartY = 0.0f; + chip.fCamScrollEndY = 0.0f; + + chip.fCamZoomStart = 1.0f; + chip.fCamZoomEnd = 1.0f; + chip.fCamRotationStart = 0.0f; + chip.fCamRotationEnd = 0.0f; + + chip.fCamScaleStartX = 1.0f; + chip.fCamScaleEndX = 1.0f; + chip.fCamScaleStartY = 1.0f; + chip.fCamScaleEndY = 1.0f; + + chip.strCamEaseType = "IN_OUT"; + + // チップを配置。 + this.listChip.Add(chip); + } else if (command == "#ENABLEDORON") { + //resets camera properties + var chip = new CChip(); + + chip.nチャンネル番号 = 0xBA; + chip.n発声位置 = ((this.n現在の小節数) * 384); + chip.dbBPM = this.dbNowBPM; + chip.n発声時刻ms = (int)this.dbNowTime; + chip.fNow_Measure_m = this.fNow_Measure_m; + chip.fNow_Measure_s = this.fNow_Measure_s; + chip.n整数値_内部番号 = 1; + + // チップを配置。 + this.listChip.Add(chip); + } else if (command == "#DISABLEDORON") { + //resets camera properties + var chip = new CChip(); + + chip.nチャンネル番号 = 0xBB; + chip.n発声位置 = ((this.n現在の小節数) * 384); + chip.dbBPM = this.dbNowBPM; + chip.n発声時刻ms = (int)this.dbNowTime; + chip.fNow_Measure_m = this.fNow_Measure_m; + chip.fNow_Measure_s = this.fNow_Measure_s; + chip.n整数値_内部番号 = 1; + + // チップを配置。 + this.listChip.Add(chip); + } else if (command == "#ADDOBJECT") { + //adds object + var chip = new CChip(); + + chip.nチャンネル番号 = 0xBC; + chip.n発声位置 = ((this.n現在の小節数) * 384); + chip.dbBPM = this.dbNowBPM; + chip.n発声時刻ms = (int)this.dbNowTime; + chip.fNow_Measure_m = this.fNow_Measure_m; + chip.fNow_Measure_s = this.fNow_Measure_s; + chip.n整数値_内部番号 = 1; + + try { + string[] args = argument.Split(','); + + chip.strObjName = args[0]; + chip.fObjX = float.Parse(args[1]); + chip.fObjY = float.Parse(args[2]); + var txPath = this.strフォルダ名 + args[3]; + Trace.TraceInformation("" + this.bSession譜面を読み込む); + if (this.bSession譜面を読み込む) { + var obj = new CSongObject(chip.strObjName, chip.fObjX, chip.fObjY, txPath); + this.listObj.Add(args[0], obj); + } + + // チップを配置。 + this.listChip.Add(chip); + } catch (Exception ex) { + AddError(command, argument); + } + } else if (command == "#REMOVEOBJECT") { + //removes object + var chip = new CChip(); + + chip.nチャンネル番号 = 0xBD; + chip.n発声位置 = ((this.n現在の小節数) * 384); + chip.dbBPM = this.dbNowBPM; + chip.n発声時刻ms = (int)this.dbNowTime; + chip.fNow_Measure_m = this.fNow_Measure_m; + chip.fNow_Measure_s = this.fNow_Measure_s; + chip.n整数値_内部番号 = 1; + + chip.strObjName = argument; + + // チップを配置。 + this.listChip.Add(chip); + } else if (command == "#OBJVMOVESTART") { + string[] args = argument.Split(','); + + try { + string name = args[0]; + + if (!currentObjAnimations.ContainsKey("vmove_" + name)) { + //starts vertical object movement + //arguments: ,,, + var chip = new CChip(); + + chip.nチャンネル番号 = 0xBE; + chip.n発声位置 = ((this.n現在の小節数) * 384); + chip.dbBPM = this.dbNowBPM; + chip.n発声時刻ms = (int)this.dbNowTime; + chip.fNow_Measure_m = this.fNow_Measure_m; + chip.fNow_Measure_s = this.fNow_Measure_s; + chip.n整数値_内部番号 = 0; + + chip.strObjName = args[0]; + chip.fObjStart = float.Parse(args[1]); + chip.fObjEnd = float.Parse(args[2]); + chip.strObjEaseType = args[3]; + + var type = args[4]; + var eType = Easing.CalcType.Quadratic; + switch (type) { + case "CUBIC": + eType = Easing.CalcType.Cubic; + break; + case "QUARTIC": + eType = Easing.CalcType.Quartic; + break; + case "QUINTIC": + eType = Easing.CalcType.Quintic; + break; + case "SINUSOIDAL": + eType = Easing.CalcType.Sinusoidal; + break; + case "EXPONENTIAL": + eType = Easing.CalcType.Exponential; + break; + case "CIRCULAR": + eType = Easing.CalcType.Circular; + break; + case "LINEAR": + eType = Easing.CalcType.Linear; + break; + default: + break; + } + + chip.objCalcType = eType; + + currentObjAnimations.Add("vmove_" + name, chip); + + // チップを配置。 + this.listChip.Add(chip); + } else { + AddError_Single("Missing #OBJVMOVEEND"); + Trace.TraceInformation("TJA ERROR: Missing #OBJVMOVEEND"); + } + } catch (Exception ex) { + AddError(command, argument); + } + } else if (command == "#OBJVMOVEEND") { + string name = argument; + + if (currentObjAnimations.ContainsKey("vmove_" + name)) { + //ends vertical camera moving + var chip = new CChip(); + + chip.nチャンネル番号 = 0xBF; + chip.n発声位置 = ((this.n現在の小節数) * 384); + chip.dbBPM = this.dbNowBPM; + chip.n発声時刻ms = (int)this.dbNowTime; + chip.fNow_Measure_m = this.fNow_Measure_m; + chip.fNow_Measure_s = this.fNow_Measure_s; + chip.n整数値_内部番号 = 1; + chip.strObjName = argument; + + currentObjAnimations.TryGetValue("vmove_" + name, out CChip startChip); + + var index = this.listChip.IndexOf(startChip); + var msDiff = chip.n発声時刻ms - startChip.n発声時刻ms; + + startChip.fObjTimeMs = msDiff; + this.listChip[index] = startChip; + + currentObjAnimations.Remove("vmove_" + name); + + // チップを配置。 + this.listChip.Add(chip); + } else { + AddError_Single("Missing #OBJVMOVESTART"); + Trace.TraceInformation("TJA ERROR: Missing #OBJVMOVESTART"); + } + } else if (command == "#OBJHMOVESTART") { + string[] args = argument.Split(','); + try { + string name = args[0]; + + if (!currentObjAnimations.ContainsKey("hmove_" + name)) { + //starts horizontal object movement + //arguments: ,,, + var chip = new CChip(); + + chip.nチャンネル番号 = 0xC0; + chip.n発声位置 = ((this.n現在の小節数) * 384); + chip.dbBPM = this.dbNowBPM; + chip.n発声時刻ms = (int)this.dbNowTime; + chip.fNow_Measure_m = this.fNow_Measure_m; + chip.fNow_Measure_s = this.fNow_Measure_s; + chip.n整数値_内部番号 = 0; + + chip.strObjName = args[0]; + chip.fObjStart = float.Parse(args[1]); + chip.fObjEnd = float.Parse(args[2]); + chip.strObjEaseType = args[3]; + + var type = args[4]; + var eType = Easing.CalcType.Quadratic; + switch (type) { + case "CUBIC": + eType = Easing.CalcType.Cubic; + break; + case "QUARTIC": + eType = Easing.CalcType.Quartic; + break; + case "QUINTIC": + eType = Easing.CalcType.Quintic; + break; + case "SINUSOIDAL": + eType = Easing.CalcType.Sinusoidal; + break; + case "EXPONENTIAL": + eType = Easing.CalcType.Exponential; + break; + case "CIRCULAR": + eType = Easing.CalcType.Circular; + break; + case "LINEAR": + eType = Easing.CalcType.Linear; + break; + default: + break; + } + + chip.objCalcType = eType; + + currentObjAnimations.Add("hmove_" + name, chip); + + // チップを配置。 + this.listChip.Add(chip); + } else { + AddError_Single("Missing #OBJHMOVEEND"); + Trace.TraceInformation("TJA ERROR: Missing #OBJHMOVEEND"); + } + } catch (Exception ex) { + AddError(command, argument); + } + } else if (command == "#OBJHMOVEEND") { + string name = argument; + + if (currentObjAnimations.ContainsKey("hmove_" + name)) { + //ends horizontal camera moving + var chip = new CChip(); + + chip.nチャンネル番号 = 0xC1; + chip.n発声位置 = ((this.n現在の小節数) * 384); + chip.dbBPM = this.dbNowBPM; + chip.n発声時刻ms = (int)this.dbNowTime; + chip.fNow_Measure_m = this.fNow_Measure_m; + chip.fNow_Measure_s = this.fNow_Measure_s; + chip.n整数値_内部番号 = 1; + chip.strObjName = argument; + + currentObjAnimations.TryGetValue("hmove_" + name, out CChip startChip); + + var index = this.listChip.IndexOf(startChip); + var msDiff = chip.n発声時刻ms - startChip.n発声時刻ms; + + startChip.fObjTimeMs = msDiff; + this.listChip[index] = startChip; + + currentObjAnimations.Remove("hmove_" + name); + + // チップを配置。 + this.listChip.Add(chip); + } else { + AddError_Single("Missing #OBJHMOVESTART"); + Trace.TraceInformation("TJA ERROR: Missing #OBJHMOVESTART"); + } + } else if (command == "#OBJVSCALESTART") { + string[] args = argument.Split(','); + try { + string name = args[0]; + + if (!currentObjAnimations.ContainsKey("vscale_" + name)) { + var chip = new CChip(); + + chip.nチャンネル番号 = 0xC2; + chip.n発声位置 = ((this.n現在の小節数) * 384); + chip.dbBPM = this.dbNowBPM; + chip.n発声時刻ms = (int)this.dbNowTime; + chip.fNow_Measure_m = this.fNow_Measure_m; + chip.fNow_Measure_s = this.fNow_Measure_s; + chip.n整数値_内部番号 = 0; + + chip.strObjName = args[0]; + chip.fObjStart = float.Parse(args[1]); + chip.fObjEnd = float.Parse(args[2]); + chip.strObjEaseType = args[3]; + + var type = args[4]; + var eType = Easing.CalcType.Quadratic; + switch (type) { + case "CUBIC": + eType = Easing.CalcType.Cubic; + break; + case "QUARTIC": + eType = Easing.CalcType.Quartic; + break; + case "QUINTIC": + eType = Easing.CalcType.Quintic; + break; + case "SINUSOIDAL": + eType = Easing.CalcType.Sinusoidal; + break; + case "EXPONENTIAL": + eType = Easing.CalcType.Exponential; + break; + case "CIRCULAR": + eType = Easing.CalcType.Circular; + break; + case "LINEAR": + eType = Easing.CalcType.Linear; + break; + default: + break; + } + + chip.objCalcType = eType; + + currentObjAnimations.Add("vscale_" + name, chip); + + // チップを配置。 + this.listChip.Add(chip); + } else { + AddError_Single("Missing #OBJVSCALEEND"); + Trace.TraceInformation("TJA ERROR: Missing #OBJVSCALEEND"); + } + } catch (Exception ex) { + AddError(command, argument); + } + } else if (command == "#OBJVSCALEEND") { + string name = argument; + + if (currentObjAnimations.ContainsKey("vscale_" + name)) { + var chip = new CChip(); + + chip.nチャンネル番号 = 0xC3; + chip.n発声位置 = ((this.n現在の小節数) * 384); + chip.dbBPM = this.dbNowBPM; + chip.n発声時刻ms = (int)this.dbNowTime; + chip.fNow_Measure_m = this.fNow_Measure_m; + chip.fNow_Measure_s = this.fNow_Measure_s; + chip.n整数値_内部番号 = 1; + chip.strObjName = argument; + + currentObjAnimations.TryGetValue("vscale_" + name, out CChip startChip); + + var index = this.listChip.IndexOf(startChip); + var msDiff = chip.n発声時刻ms - startChip.n発声時刻ms; + + startChip.fObjTimeMs = msDiff; + this.listChip[index] = startChip; + + currentObjAnimations.Remove("vscale_" + name); + + // チップを配置。 + this.listChip.Add(chip); + } else { + AddError_Single("Missing #OBJVSCALESTART"); + Trace.TraceInformation("TJA ERROR: Missing #OBJVSCALESTART"); + } + } else if (command == "#OBJHSCALESTART") { + string[] args = argument.Split(','); + try { + string name = args[0]; + + if (!currentObjAnimations.ContainsKey("hscale_" + name)) { + var chip = new CChip(); + + chip.nチャンネル番号 = 0xC4; + chip.n発声位置 = ((this.n現在の小節数) * 384); + chip.dbBPM = this.dbNowBPM; + chip.n発声時刻ms = (int)this.dbNowTime; + chip.fNow_Measure_m = this.fNow_Measure_m; + chip.fNow_Measure_s = this.fNow_Measure_s; + chip.n整数値_内部番号 = 0; + + chip.strObjName = args[0]; + chip.fObjStart = float.Parse(args[1]); + chip.fObjEnd = float.Parse(args[2]); + chip.strObjEaseType = args[3]; + + var type = args[4]; + var eType = Easing.CalcType.Quadratic; + switch (type) { + case "CUBIC": + eType = Easing.CalcType.Cubic; + break; + case "QUARTIC": + eType = Easing.CalcType.Quartic; + break; + case "QUINTIC": + eType = Easing.CalcType.Quintic; + break; + case "SINUSOIDAL": + eType = Easing.CalcType.Sinusoidal; + break; + case "EXPONENTIAL": + eType = Easing.CalcType.Exponential; + break; + case "CIRCULAR": + eType = Easing.CalcType.Circular; + break; + case "LINEAR": + eType = Easing.CalcType.Linear; + break; + } + + chip.objCalcType = eType; + + currentObjAnimations.Add("hscale_" + name, chip); + + // チップを配置。 + this.listChip.Add(chip); + } else { + AddError_Single("Missing #OBJHSCALEEND"); + Trace.TraceInformation("TJA ERROR: Missing #OBJHSCALEEND"); + } + } catch (Exception ex) { + AddError(command, argument); + } + } else if (command == "#OBJHSCALEEND") { + string name = argument; + + if (currentObjAnimations.ContainsKey("hscale_" + name)) { + var chip = new CChip(); + + chip.nチャンネル番号 = 0xC5; + chip.n発声位置 = ((this.n現在の小節数) * 384); + chip.dbBPM = this.dbNowBPM; + chip.n発声時刻ms = (int)this.dbNowTime; + chip.fNow_Measure_m = this.fNow_Measure_m; + chip.fNow_Measure_s = this.fNow_Measure_s; + chip.n整数値_内部番号 = 1; + chip.strObjName = argument; + + currentObjAnimations.TryGetValue("hscale_" + name, out CChip startChip); + + var index = this.listChip.IndexOf(startChip); + var msDiff = chip.n発声時刻ms - startChip.n発声時刻ms; + + startChip.fObjTimeMs = msDiff; + this.listChip[index] = startChip; + + currentObjAnimations.Remove("hscale_" + name); + + // チップを配置。 + this.listChip.Add(chip); + } else { + AddError_Single("Missing #OBJHSCALESTART"); + Trace.TraceInformation("TJA ERROR: Missing #OBJHSCALESTART"); + } + } else if (command == "#OBJROTATIONSTART") { + string[] args = argument.Split(','); + try { + string name = args[0]; + + if (!currentObjAnimations.ContainsKey("rotation_" + name)) { + var chip = new CChip(); + + chip.nチャンネル番号 = 0xC6; + chip.n発声位置 = ((this.n現在の小節数) * 384); + chip.dbBPM = this.dbNowBPM; + chip.n発声時刻ms = (int)this.dbNowTime; + chip.fNow_Measure_m = this.fNow_Measure_m; + chip.fNow_Measure_s = this.fNow_Measure_s; + chip.n整数値_内部番号 = 0; + + chip.strObjName = args[0]; + chip.fObjStart = float.Parse(args[1]); + chip.fObjEnd = float.Parse(args[2]); + chip.strObjEaseType = args[3]; + + var type = args[4]; + var eType = Easing.CalcType.Quadratic; + switch (type) { + case "CUBIC": + eType = Easing.CalcType.Cubic; + break; + case "QUARTIC": + eType = Easing.CalcType.Quartic; + break; + case "QUINTIC": + eType = Easing.CalcType.Quintic; + break; + case "SINUSOIDAL": + eType = Easing.CalcType.Sinusoidal; + break; + case "EXPONENTIAL": + eType = Easing.CalcType.Exponential; + break; + case "CIRCULAR": + eType = Easing.CalcType.Circular; + break; + case "LINEAR": + eType = Easing.CalcType.Linear; + break; + default: + break; + } + + chip.objCalcType = eType; + + currentObjAnimations.Add("rotation_" + name, chip); + + // チップを配置。 + this.listChip.Add(chip); + } else { + AddError_Single("Missing #OBJROTATIONEND"); + Trace.TraceInformation("TJA ERROR: Missing #OBJROTATIONEND"); + } + } catch (Exception ex) { + AddError(command, argument); + } + } else if (command == "#OBJROTATIONEND") { + string name = argument; + + if (currentObjAnimations.ContainsKey("rotation_" + name)) { + var chip = new CChip(); + + chip.nチャンネル番号 = 0xC7; + chip.n発声位置 = ((this.n現在の小節数) * 384); + chip.dbBPM = this.dbNowBPM; + chip.n発声時刻ms = (int)this.dbNowTime; + chip.fNow_Measure_m = this.fNow_Measure_m; + chip.fNow_Measure_s = this.fNow_Measure_s; + chip.n整数値_内部番号 = 1; + chip.strObjName = argument; + + currentObjAnimations.TryGetValue("rotation_" + name, out CChip startChip); + + var index = this.listChip.IndexOf(startChip); + var msDiff = chip.n発声時刻ms - startChip.n発声時刻ms; + + startChip.fObjTimeMs = msDiff; + this.listChip[index] = startChip; + + currentObjAnimations.Remove("rotation_" + name); + + // チップを配置。 + this.listChip.Add(chip); + } else { + AddError_Single("Missing #OBJROTATIONSTART"); + Trace.TraceInformation("TJA ERROR: Missing #OBJROTATIONSTART"); + } + } else if (command == "#OBJOPACITYSTART") { + string[] args = argument.Split(','); + try { + string name = args[0]; + + if (!currentObjAnimations.ContainsKey("opacity_" + name)) { + var chip = new CChip(); + + chip.nチャンネル番号 = 0xC8; + chip.n発声位置 = ((this.n現在の小節数) * 384); + chip.dbBPM = this.dbNowBPM; + chip.n発声時刻ms = (int)this.dbNowTime; + chip.fNow_Measure_m = this.fNow_Measure_m; + chip.fNow_Measure_s = this.fNow_Measure_s; + chip.n整数値_内部番号 = 0; + + chip.strObjName = args[0]; + chip.fObjStart = float.Parse(args[1]); + chip.fObjEnd = float.Parse(args[2]); + chip.strObjEaseType = args[3]; + + var type = args[4]; + var eType = Easing.CalcType.Quadratic; + switch (type) { + case "CUBIC": + eType = Easing.CalcType.Cubic; + break; + case "QUARTIC": + eType = Easing.CalcType.Quartic; + break; + case "QUINTIC": + eType = Easing.CalcType.Quintic; + break; + case "SINUSOIDAL": + eType = Easing.CalcType.Sinusoidal; + break; + case "EXPONENTIAL": + eType = Easing.CalcType.Exponential; + break; + case "CIRCULAR": + eType = Easing.CalcType.Circular; + break; + case "LINEAR": + eType = Easing.CalcType.Linear; + break; + } + + chip.objCalcType = eType; + + currentObjAnimations.Add("opacity_" + name, chip); + + // チップを配置。 + this.listChip.Add(chip); + } else { + AddError_Single("Missing #OBJOPACITYEND"); + Trace.TraceInformation("TJA ERROR: Missing #OBJOPACITYEND"); + } + } catch (Exception ex) { + AddError(command, argument); + } + } else if (command == "#OBJOPACITYEND") { + string name = argument; + + if (currentObjAnimations.ContainsKey("opacity_" + name)) { + var chip = new CChip(); + + chip.nチャンネル番号 = 0xC9; + chip.n発声位置 = ((this.n現在の小節数) * 384); + chip.dbBPM = this.dbNowBPM; + chip.n発声時刻ms = (int)this.dbNowTime; + chip.fNow_Measure_m = this.fNow_Measure_m; + chip.fNow_Measure_s = this.fNow_Measure_s; + chip.n整数値_内部番号 = 1; + chip.strObjName = argument; + + currentObjAnimations.TryGetValue("opacity_" + name, out CChip startChip); + + var index = this.listChip.IndexOf(startChip); + var msDiff = chip.n発声時刻ms - startChip.n発声時刻ms; + + startChip.fObjTimeMs = msDiff; + this.listChip[index] = startChip; + + currentObjAnimations.Remove("opacity_" + name); + + // チップを配置。 + this.listChip.Add(chip); + } else { + AddError_Single("Missing #OBJOPACITYSTART"); + Trace.TraceInformation("TJA ERROR: Missing #OBJOPACITYSTART"); + } + } else if (command == "#OBJCOLOR") { + var chip = new CChip(); + + chip.nチャンネル番号 = 0xCA; + chip.n発声位置 = ((this.n現在の小節数) * 384); + chip.dbBPM = this.dbNowBPM; + chip.n発声時刻ms = (int)this.dbNowTime; + chip.fNow_Measure_m = this.fNow_Measure_m; + chip.fNow_Measure_s = this.fNow_Measure_s; + chip.n整数値_内部番号 = 1; + + try { + string[] args = argument.Split(','); + chip.strObjName = args[0]; + chip.borderColor = new Color4(1f, float.Parse(args[1]) / 255, float.Parse(args[2]) / 255, float.Parse(args[3]) / 255); + + // チップを配置。 + this.listChip.Add(chip); + } catch (Exception ex) { + AddError(command, argument); + } + } else if (command == "#OBJY") { + string[] args = argument.Split(','); + try { + string name = args[0]; + + if (!currentObjAnimations.ContainsKey("vmove_" + name)) { + var chip = new CChip(); + + chip.nチャンネル番号 = 0xCB; + chip.n発声位置 = ((this.n現在の小節数) * 384); + chip.dbBPM = this.dbNowBPM; + chip.n発声時刻ms = (int)this.dbNowTime; + chip.fNow_Measure_m = this.fNow_Measure_m; + chip.fNow_Measure_s = this.fNow_Measure_s; + chip.n整数値_内部番号 = 0; + + chip.strObjName = args[0]; + chip.fObjStart = float.Parse(args[1]); + chip.fObjEnd = float.Parse(args[1]); + chip.strObjEaseType = "IN_OUT"; + + // チップを配置。 + this.listChip.Add(chip); + } else { + AddError_Single("Missing #OBJVMOVEEND"); + Trace.TraceInformation("TJA ERROR: Missing #OBJVMOVEEND"); + } + } catch (Exception ex) { + AddError(command, argument); + } + } else if (command == "#OBJX") { + string[] args = argument.Split(','); + try { + string name = args[0]; + + if (!currentObjAnimations.ContainsKey("hmove_" + name)) { + var chip = new CChip(); + + chip.nチャンネル番号 = 0xCC; + chip.n発声位置 = ((this.n現在の小節数) * 384); + chip.dbBPM = this.dbNowBPM; + chip.n発声時刻ms = (int)this.dbNowTime; + chip.fNow_Measure_m = this.fNow_Measure_m; + chip.fNow_Measure_s = this.fNow_Measure_s; + chip.n整数値_内部番号 = 0; + + chip.strObjName = args[0]; + chip.fObjStart = float.Parse(args[1]); + chip.fObjEnd = float.Parse(args[1]); + chip.strObjEaseType = "IN_OUT"; + + // チップを配置。 + this.listChip.Add(chip); + } else { + AddError_Single("Missing #OBJHMOVEEND"); + Trace.TraceInformation("TJA ERROR: Missing #OBJHMOVEEND"); + } + } catch (Exception ex) { + AddError(command, argument); + } + } else if (command == "#OBJVSCALE") { + string[] args = argument.Split(','); + try { + string name = args[0]; + + if (!currentObjAnimations.ContainsKey("vscale_" + name)) { + var chip = new CChip(); + + chip.nチャンネル番号 = 0xCD; + chip.n発声位置 = ((this.n現在の小節数) * 384); + chip.dbBPM = this.dbNowBPM; + chip.n発声時刻ms = (int)this.dbNowTime; + chip.fNow_Measure_m = this.fNow_Measure_m; + chip.fNow_Measure_s = this.fNow_Measure_s; + chip.n整数値_内部番号 = 0; + + chip.strObjName = args[0]; + chip.fObjStart = float.Parse(args[1]); + chip.fObjEnd = float.Parse(args[1]); + chip.strObjEaseType = "IN_OUT"; + + // チップを配置。 + this.listChip.Add(chip); + } else { + AddError_Single("Missing #OBJVSCALEEND"); + Trace.TraceInformation("TJA ERROR: Missing #OBJVSCALEEND"); + } + } catch (Exception ex) { + AddError(command, argument); + } + } else if (command == "#OBJHSCALE") { + string[] args = argument.Split(','); + try { + string name = args[0]; + + if (!currentObjAnimations.ContainsKey("hscale_" + name)) { + var chip = new CChip(); + + chip.nチャンネル番号 = 0xCE; + chip.n発声位置 = ((this.n現在の小節数) * 384); + chip.dbBPM = this.dbNowBPM; + chip.n発声時刻ms = (int)this.dbNowTime; + chip.fNow_Measure_m = this.fNow_Measure_m; + chip.fNow_Measure_s = this.fNow_Measure_s; + chip.n整数値_内部番号 = 0; + + chip.strObjName = args[0]; + chip.fObjStart = float.Parse(args[1]); + chip.fObjEnd = float.Parse(args[1]); + chip.strObjEaseType = "IN_OUT"; + + // チップを配置。 + this.listChip.Add(chip); + } else { + AddError_Single("Missing #OBJHSCALEEND"); + Trace.TraceInformation("TJA ERROR: Missing #OBJHSCALEEND"); + } + } catch (Exception ex) { + AddError(command, argument); + } + } else if (command == "#OBJROTATION") { + string[] args = argument.Split(','); + try { + string name = args[0]; + + if (!currentObjAnimations.ContainsKey("rotation_" + name)) { + var chip = new CChip(); + + chip.nチャンネル番号 = 0xCF; + chip.n発声位置 = ((this.n現在の小節数) * 384); + chip.dbBPM = this.dbNowBPM; + chip.n発声時刻ms = (int)this.dbNowTime; + chip.fNow_Measure_m = this.fNow_Measure_m; + chip.fNow_Measure_s = this.fNow_Measure_s; + chip.n整数値_内部番号 = 0; + + chip.strObjName = args[0]; + chip.fObjStart = float.Parse(args[1]); + chip.fObjEnd = float.Parse(args[1]); + chip.strObjEaseType = "IN_OUT"; + + // チップを配置。 + this.listChip.Add(chip); + } else { + AddError_Single("Missing #OBJROTATIONEND"); + Trace.TraceInformation("TJA ERROR: Missing #OBJROTATIONEND"); + } + } catch (Exception ex) { + AddError(command, argument); + } + } else if (command == "#OBJOPACITY") { + string[] args = argument.Split(','); + try { + string name = args[0]; + + if (!currentObjAnimations.ContainsKey("opacity_" + name)) { + var chip = new CChip(); + + chip.nチャンネル番号 = 0xD0; + chip.n発声位置 = ((this.n現在の小節数) * 384); + chip.dbBPM = this.dbNowBPM; + chip.n発声時刻ms = (int)this.dbNowTime; + chip.fNow_Measure_m = this.fNow_Measure_m; + chip.fNow_Measure_s = this.fNow_Measure_s; + chip.n整数値_内部番号 = 0; + + chip.strObjName = args[0]; + chip.fObjStart = float.Parse(args[1]); + chip.fObjEnd = float.Parse(args[1]); + chip.strObjEaseType = "IN_OUT"; + + // チップを配置。 + this.listChip.Add(chip); + } else { + AddError_Single("Missing #OBJOPACITYEND"); + Trace.TraceInformation("TJA ERROR: Missing #OBJOPACITYEND"); + } + } catch (Exception ex) { + AddError(command, argument); + } + } else if (command == "#CHANGETEXTURE") { + var chip = new CChip(); + + chip.nチャンネル番号 = 0xD1; + chip.n発声位置 = ((this.n現在の小節数) * 384); + chip.dbBPM = this.dbNowBPM; + chip.n発声時刻ms = (int)this.dbNowTime; + chip.fNow_Measure_m = this.fNow_Measure_m; + chip.fNow_Measure_s = this.fNow_Measure_s; + chip.n整数値_内部番号 = 1; + + string[] args = argument.Split(','); + try { + chip.strTargetTxName = args[0].Replace("/", "\\"); + chip.strNewPath = this.strフォルダ名 + args[1]; + + if (this.bSession譜面を読み込む) { + if (!this.listOriginalTextures.ContainsKey(chip.strTargetTxName)) { + OpenTaiko.Tx.trackedTextures.TryGetValue(chip.strTargetTxName, out CTexture oldTx); + this.listOriginalTextures.Add(chip.strTargetTxName, new CTexture(oldTx)); + } + if (!this.listTextures.ContainsKey(chip.strNewPath)) { + CTexture tx = OpenTaiko.Tx.TxCSong(chip.strNewPath); + this.listTextures.Add(chip.strNewPath, tx); } } - } - - //もし、nReturnChipがnullだったらlistChipのCount - 1にセットする。 - return listChips[nReturnChip == null ? listChips.Count - 1 : (int)nReturnChip]; - } - private void WarnSplitLength(string name, string[] strArray, int minimumLength) { - if (strArray.Length < minimumLength) { - Trace.TraceWarning( - $"命令 {name} のパラメータが足りません。少なくとも {minimumLength} つのパラメータが必要です。 (現在のパラメータ数: {strArray.Length}). ({strファイル名の絶対パス})"); + // チップを配置。 + this.listChip.Add(chip); + } catch (Exception ex) { + AddError(command, argument); + } + } else if (command == "#RESETTEXTURE") { + var chip = new CChip(); + + chip.nチャンネル番号 = 0xD2; + chip.n発声位置 = ((this.n現在の小節数) * 384); + chip.dbBPM = this.dbNowBPM; + chip.n発声時刻ms = (int)this.dbNowTime; + chip.fNow_Measure_m = this.fNow_Measure_m; + chip.fNow_Measure_s = this.fNow_Measure_s; + chip.n整数値_内部番号 = 1; + + chip.strTargetTxName = argument.Replace("/", "\\"); + + // チップを配置。 + this.listChip.Add(chip); + } else if (command == "#SETCONFIG") { + var chip = new CChip(); + + chip.nチャンネル番号 = 0xD3; + chip.n発声位置 = ((this.n現在の小節数) * 384); + chip.dbBPM = this.dbNowBPM; + chip.n発声時刻ms = (int)this.dbNowTime; + chip.fNow_Measure_m = this.fNow_Measure_m; + chip.fNow_Measure_s = this.fNow_Measure_s; + chip.n整数値_内部番号 = 1; + + chip.strConfigValue = argument; + + // チップを配置。 + this.listChip.Add(chip); + } else if (command == "#OBJANIMSTART") { + var chip = new CChip(); + + chip.nチャンネル番号 = 0xD4; + chip.n発声位置 = ((this.n現在の小節数) * 384); + chip.dbBPM = this.dbNowBPM; + chip.n発声時刻ms = (int)this.dbNowTime; + chip.fNow_Measure_m = this.fNow_Measure_m; + chip.fNow_Measure_s = this.fNow_Measure_s; + chip.n整数値_内部番号 = 1; + + string[] args = argument.Split(','); + try { + chip.strObjName = args[0]; + chip.dbAnimInterval = double.Parse(args[1]); + + // チップを配置。 + this.listChip.Add(chip); + } catch (Exception ex) { + AddError(command, argument); + } + } else if (command == "#OBJANIMSTARTLOOP") { + var chip = new CChip(); + + chip.nチャンネル番号 = 0xD5; + chip.n発声位置 = ((this.n現在の小節数) * 384); + chip.dbBPM = this.dbNowBPM; + chip.n発声時刻ms = (int)this.dbNowTime; + chip.fNow_Measure_m = this.fNow_Measure_m; + chip.fNow_Measure_s = this.fNow_Measure_s; + chip.n整数値_内部番号 = 1; + + string[] args = argument.Split(','); + try { + chip.strObjName = args[0]; + chip.dbAnimInterval = double.Parse(args[1]); + + // チップを配置。 + this.listChip.Add(chip); + } catch (Exception ex) { + AddError(command, argument); + } + } else if (command == "#OBJANIMEND") { + var chip = new CChip(); + + chip.nチャンネル番号 = 0xD6; + chip.n発声位置 = ((this.n現在の小節数) * 384); + chip.dbBPM = this.dbNowBPM; + chip.n発声時刻ms = (int)this.dbNowTime; + chip.fNow_Measure_m = this.fNow_Measure_m; + chip.fNow_Measure_s = this.fNow_Measure_s; + chip.n整数値_内部番号 = 1; + + chip.strObjName = argument; + + // チップを配置。 + this.listChip.Add(chip); + } else if (command == "#OBJFRAME") { + var chip = new CChip(); + + chip.nチャンネル番号 = 0xD7; + chip.n発声位置 = ((this.n現在の小節数) * 384); + chip.dbBPM = this.dbNowBPM; + chip.n発声時刻ms = (int)this.dbNowTime; + chip.fNow_Measure_m = this.fNow_Measure_m; + chip.fNow_Measure_s = this.fNow_Measure_s; + chip.n整数値_内部番号 = 1; + + string[] args = argument.Split(','); + try { + chip.strObjName = args[0]; + chip.intFrame = int.Parse(args[1]); + + // チップを配置。 + this.listChip.Add(chip); + } catch (Exception ex) { + AddError(command, argument); + } + } else if (command == "#GAMETYPE") { + var chip = new CChip(); + + chip.nチャンネル番号 = 0xD8; + chip.n発声位置 = ((this.n現在の小節数) * 384); + chip.dbBPM = this.dbNowBPM; + chip.n発声時刻ms = (int)this.dbNowTime; + chip.fNow_Measure_m = this.fNow_Measure_m; + chip.fNow_Measure_s = this.fNow_Measure_s; + chip.n整数値_内部番号 = 1; + switch (argument) { + case "Taiko": + chip.eGameType = EGameType.Taiko; + break; + case "Bongo": + case "Konga": + chip.eGameType = EGameType.Konga; + break; + } + + // チップを配置。 + this.listChip.Add(chip); + } else if (command == "#SPLITLANE") { + var chip = new CChip(); + + chip.nチャンネル番号 = 0xD9; + chip.n発声位置 = ((this.n現在の小節数) * 384); + chip.dbBPM = this.dbNowBPM; + chip.n発声時刻ms = (int)this.dbNowTime; + chip.fNow_Measure_m = this.fNow_Measure_m; + chip.fNow_Measure_s = this.fNow_Measure_s; + chip.n整数値_内部番号 = 1; + + // チップを配置。 + this.listChip.Add(chip); + } else if (command == "#MERGELANE") { + var chip = new CChip(); + + chip.nチャンネル番号 = 0xE3; + chip.n発声位置 = ((this.n現在の小節数) * 384); + chip.dbBPM = this.dbNowBPM; + chip.n発声時刻ms = (int)this.dbNowTime; + chip.fNow_Measure_m = this.fNow_Measure_m; + chip.fNow_Measure_s = this.fNow_Measure_s; + chip.n整数値_内部番号 = 1; + + // チップを配置。 + this.listChip.Add(chip); + } else if (command == "#BARLINE") { + var chip = new CChip(); + + chip.nチャンネル番号 = 0xE4; + chip.n発声位置 = ((this.n現在の小節数) * 384); + chip.dbBPM = this.dbNowBPM; + chip.dbSCROLL = this.dbNowScroll; + chip.dbSCROLL_Y = this.dbNowScrollY; + chip.n発声時刻ms = (int)this.dbNowTime; + chip.fNow_Measure_m = this.fNow_Measure_m; + chip.fNow_Measure_s = this.fNow_Measure_s; + chip.n整数値_内部番号 = 1; + chip.bHideBarLine = false; + + // チップを配置。 + this.listChip.Add(chip); + } else if (command == "#SECTION") { + //分岐:条件リセット + var chip = new CChip(); + + chip.nチャンネル番号 = 0xDD; + chip.n発声位置 = ((this.n現在の小節数 - 1) * 384); + chip.n発声時刻ms = (int)this.dbNowTime; + chip.fNow_Measure_m = this.fNow_Measure_m; + chip.fNow_Measure_s = this.fNow_Measure_s; + chip.n整数値_内部番号 = 1; + chip.db発声時刻ms = this.dbNowTime; + // チップを配置。 + this.listChip.Add(chip); + } else if (command == "#BRANCHSTART") { + #region [ 譜面分岐のパース方法を作り直し ] + this.bチップがある.Branch = true; + this.b最初の分岐である = false; + this.b分岐を一回でも開始した = true; + + //分岐:分岐スタート + E分岐種類 e条件; + + //条件数値。 + double[] nNum = new double[2]; + + //名前と条件Aの間に,が無いと正常に動作しなくなる.2020.04.23.akasoko26 + #region [ 名前と条件Aの間に,が無いと正常に動作しなくなる ] + //空白を削除する。 + argument = Regex.Replace(argument, @"\s", ""); + //2文字目が,か数値かをチェック + var IsNumber = bIsNumber(argument[1]); + //IsNumber == true であったら,が無いということなので,を2文字目にぶち込む・・・ + if (IsNumber) + argument = argument.Insert(1, ","); + #endregion + + var branchStartArgumentMatch = BranchStartArgumentRegex.Match(argument); + nNum[0] = Convert.ToDouble(branchStartArgumentMatch.Groups[2].Value); + nNum[1] = Convert.ToDouble(branchStartArgumentMatch.Groups[3].Value); + + switch (branchStartArgumentMatch.Groups[1].Value) { + case "p": + e条件 = E分岐種類.e精度分岐; + break; + case "r": + e条件 = E分岐種類.e連打分岐; + break; + case "s": + e条件 = E分岐種類.eスコア分岐; + break; + case "d": + e条件 = E分岐種類.e大音符のみ精度分岐; + break; + default: + e条件 = E分岐種類.e精度分岐; + break; + } + + #region [ 分岐開始時のチップ情報を記録 ] + //現在のチップ情報を記録する必要がある。 + this.t現在のチップ情報を記録する(true); + #endregion + + #region [ 一小節前の分岐開始Chip ] + //16分前に戻す計算なんか当てにしちゃだめよ。。(by Akasoko) + var c小節前の小節線情報 = c一小節前の小節線情報を返す(listChip, e条件); + CChip c小節前の連打開始位置 = null; + + var chip = new CChip(); + + if (e条件 == E分岐種類.e連打分岐) { + /* + c小節前の連打開始位置 = c一小節前の小節線情報を返す(listChip, e条件, true); + //連打分岐の位置を再現 + //この計算式はあてにならないと思うが、まあどうしようもないんでこれで + //なるべく連打のケツの部分に + var f連打の長さの半分 = (c小節前の小節線情報.n発声時刻ms - c小節前の連打開始位置.n発声時刻ms) / 2.0f; + */ + + chip.n発声時刻ms = c小節前の小節線情報.n発声時刻ms; + } else chip.n発声時刻ms = c小節前の小節線情報.n発声時刻ms; + + chip.nチャンネル番号 = 0xDE; + chip.fNow_Measure_m = c小節前の小節線情報.fNow_Measure_m; + chip.fNow_Measure_s = c小節前の小節線情報.fNow_Measure_s; + + //ノーツ * 0.5分後ろにして、ノーツが残らないようにする + chip.n分岐時刻ms = this.dbNowTime - ((15000.0 / this.dbNowBPM * (this.fNow_Measure_s / this.fNow_Measure_m)) * 0.5); + chip.e分岐の種類 = e条件; + chip.n条件数値A = nNum[0];// listに追加していたが仕様を変更。 + chip.n条件数値B = nNum[1];// "" + chip.dbSCROLL = c小節前の小節線情報.dbSCROLL; + chip.dbBPM = c小節前の小節線情報.dbBPM; + this.listChip.Add(chip); + #endregion + + for (int i = 0; i < 3; i++) + IsBranchBarDraw[i] = true;//3コース分の黄色小説線表示㋫ラブ + + IsEndedBranching = false; + #endregion + } else if (command == "#N" || command == "#E" || command == "#M")//これCourseを全部集めてあとから分岐させればいい件 + { + //開始時の情報にセット + t現在のチップ情報を記録する(false); + + if (command == "#N") + this.n現在のコース = ECourse.eNormal;//分岐:普通譜面 + else if (command == "#E") + this.n現在のコース = ECourse.eExpert;//分岐:玄人譜面 + else if (command == "#M") + this.n現在のコース = ECourse.eMaster;//分岐:達人譜面 + } else if (command == "#LEVELHOLD") { + var chip = new CChip(); + chip.nチャンネル番号 = 0xE1; + chip.n発声位置 = ((this.n現在の小節数) * 384) - 1; + chip.n発声時刻ms = (int)this.dbNowTime; + chip.fNow_Measure_m = this.fNow_Measure_m; + chip.fNow_Measure_s = this.fNow_Measure_s; + chip.n整数値_内部番号 = 1; + + this.listChip.Add(chip); + } else if (command == "#BRANCHEND") { + var GoBranch = new CChip(); + + //End用チャンネルをEmptyから引っ張ってきた。 + GoBranch.nチャンネル番号 = 0x52; + GoBranch.n発声位置 = ((this.n現在の小節数) * 384) - 1; + GoBranch.n発声時刻ms = (int)this.dbNowTime; + GoBranch.fNow_Measure_m = this.fNow_Measure_m; + GoBranch.fNow_Measure_s = this.fNow_Measure_s; + GoBranch.dbSCROLL = this.dbNowScroll; + GoBranch.dbBPM = this.dbNowBPM; + GoBranch.n整数値_内部番号 = 1; + + this.listChip.Add(GoBranch); + + //End時にも黄色い小節線あったべ? + for (int i = 0; i < 3; i++) + IsBranchBarDraw[i] = true;//3コース分の黄色小説線表示㋫ラブ + + IsEndedBranching = true; + } else if (command == "#BARLINEOFF") { + var chip = new CChip(); + + chip.nチャンネル番号 = 0xE0; + chip.n発声位置 = ((this.n現在の小節数) * 384) - 1; + chip.n発声時刻ms = (int)this.dbNowTime + 1; + chip.n整数値_内部番号 = 1; + chip.nコース = this.n現在のコース; + this.bBARLINECUE[0] = 1; + + this.listChip.Add(chip); + } else if (command == "#BARLINEON") { + var chip = new CChip(); + + chip.nチャンネル番号 = 0xE0; + chip.n発声位置 = ((this.n現在の小節数) * 384) - 1; + chip.n発声時刻ms = (int)this.dbNowTime + 1; + chip.fNow_Measure_m = this.fNow_Measure_m; + chip.fNow_Measure_s = this.fNow_Measure_s; + chip.n整数値_内部番号 = 2; + chip.nコース = this.n現在のコース; + this.bBARLINECUE[0] = 0; + + this.listChip.Add(chip); + } else if (command == "#LYRIC" && !usingLyricsFile && OpenTaiko.ConfigIni.nPlayerCount < 4) // Do not parse LYRIC tags if a lyric file is already loaded + { + if (OpenTaiko.r現在のステージ.eStageID == CStage.EStage.SongLoading)//起動時に重たくなってしまう問題の修正用 + this.listLyric.Add(this.pf歌詞フォント.DrawText(argument, OpenTaiko.Skin.Game_Lyric_ForeColor, OpenTaiko.Skin.Game_Lyric_BackColor, null, 30)); + + var chip = new CChip(); + + chip.nチャンネル番号 = 0xF1; + chip.n発声時刻ms = (int)this.dbNowTime; + chip.fNow_Measure_m = this.fNow_Measure_m; + chip.fNow_Measure_s = this.fNow_Measure_s; + chip.n整数値_内部番号 = 0; + chip.nコース = this.n現在のコース; + + // チップを配置。 + + this.listChip.Add(chip); + this.bLyrics = true; + } else if (command == "#DIRECTION") { + double dbSCROLL = Convert.ToDouble(argument); + this.nスクロール方向 = (int)dbSCROLL; + + //チップ追加して割り込んでみる。 + var chip = new CChip(); + + chip.nチャンネル番号 = 0xF2; + chip.n発声位置 = ((this.n現在の小節数) * 384) - 1; + chip.n発声時刻ms = (int)this.dbNowTime; + chip.fNow_Measure_m = this.fNow_Measure_m; + chip.fNow_Measure_s = this.fNow_Measure_s; + chip.n整数値_内部番号 = 0; + chip.nスクロール方向 = (int)dbSCROLL; + chip.nコース = this.n現在のコース; + + // チップを配置。 + + this.listChip.Add(chip); + } else if (command == "#SUDDEN") { + strArray = argument.Split(chDelimiter); + WarnSplitLength("#SUDDEN", strArray, 2); + double db出現時刻 = Convert.ToDouble(strArray[0]); + double db移動待機時刻 = Convert.ToDouble(strArray[1]); + this.db出現時刻 = db出現時刻; + this.db移動待機時刻 = db移動待機時刻; + + //チップ追加して割り込んでみる。 + var chip = new CChip(); + + chip.nチャンネル番号 = 0xF3; + chip.n発声位置 = ((this.n現在の小節数) * 384) - 1; + chip.n発声時刻ms = (int)this.dbNowTime; + chip.fNow_Measure_m = this.fNow_Measure_m; + chip.fNow_Measure_s = this.fNow_Measure_s; + chip.n整数値_内部番号 = 0; + chip.nノーツ出現時刻ms = (int)this.db出現時刻; + chip.nノーツ移動開始時刻ms = (int)this.db移動待機時刻; + chip.nコース = this.n現在のコース; + + // チップを配置。 + + this.listChip.Add(chip); + } else if (command == "#JPOSSCROLL") { + strArray = argument.Split(chDelimiter); + WarnSplitLength("#JPOSSCROLL", strArray, 2); + double db移動時刻 = Convert.ToDouble(strArray[0]); + int n移動px = 0; + int nComplexMove = 0; + if (strArray[1].IndexOf('i') != -1) { + double[] dbComplexNum = new double[2]; + this.tParsedComplexNumber(strArray[1], ref dbComplexNum); + n移動px = Convert.ToInt32(dbComplexNum[0]); + nComplexMove = Convert.ToInt32(dbComplexNum[1]); + } else + n移動px = Convert.ToInt32(strArray[1]); + + + int n移動方向 = (strArray.Length >= 3) ? Convert.ToInt32(strArray[2]) : 0; + + //チップ追加して割り込んでみる。 + var chip = new CChip(); + + chip.nチャンネル番号 = 0xE2; + chip.n発声位置 = ((this.n現在の小節数) * 384) - 1; + chip.n発声時刻ms = (int)this.dbNowTime; + chip.fNow_Measure_m = this.fNow_Measure_m; + chip.fNow_Measure_s = this.fNow_Measure_s; + chip.n整数値_内部番号 = 0; + chip.nコース = this.n現在のコース; + + // チップを配置。 + + this.listJPOSSCROLL.Add(this.n内部番号JSCROLL1to, new CJPOSSCROLL() { n内部番号 = this.n内部番号JSCROLL1to, n表記上の番号 = 0, db移動時間 = db移動時刻, n移動距離px = n移動px, n移動方向 = n移動方向, nVerticalMove = nComplexMove }); + this.listChip.Add(chip); + this.n内部番号JSCROLL1to++; + } else if (command == "#SENOTECHANGE") { + FixSENote = int.Parse(argument); + IsEnabledFixSENote = true; + } else if (command == "#NEXTSONG") { + nNextSongOffset += nOFFSET; + var delayTime = 6200.0 + nOFFSET; // 6.2秒ディレイ + //チップ追加して割り込んでみる。 + var chip = new CChip(); + + chip.nチャンネル番号 = 0x9B; + chip.n発声位置 = ((this.n現在の小節数) * 384) - 1; + chip.n発声時刻ms = (int)this.dbNowTime; + chip.fNow_Measure_m = this.fNow_Measure_m; + chip.fNow_Measure_s = this.fNow_Measure_s; + this.dbNowTime += delayTime; + this.dbNowBMScollTime += (delayTime - nOFFSET) * this.dbNowBPM / 15000; + chip.n整数値_内部番号 = 0; + chip.nコース = this.n現在のコース; + + // チップを配置。 + this.listChip.Add(chip); + + AddMusicPreTimeMs(); // 段位の幕が開いてからの遅延。 + + strArray = SplitComma(argument); // \,をエスケープ処理するメソッドだぞっ + + for (int i = listChip.Count - 1; i >= 0; i--) { + //if (listChip[i].nチャンネル番号 >= 0x11 && listChip[i].nチャンネル番号 <= 0x18) + if (NotesManager.IsHittableNote(listChip[i])) { + if (DanSongs.Number != 0) { + Array.Resize(ref this.pDan_LastChip, this.pDan_LastChip.Length + 1); + this.pDan_LastChip[DanSongs.Number - 1] = listChip[i]; + break; + } + } + } + + WarnSplitLength("#NEXTSONG", strArray, 8); + var dansongs = new DanSongs(); + dansongs.Title = strArray[0]; + dansongs.SubTitle = strArray[1]; + dansongs.Genre = strArray[2]; + dansongs.FileName = strArray[3]; + dansongs.ScoreInit = int.Parse(strArray[4]); + dansongs.ScoreDiff = int.Parse(strArray[5]); + + if (strArray.Length >= 7 && strArray[6] != "" && strArray[6] != null) + dansongs.Level = int.Parse(strArray[6]); + else if (strArray.Length < 7) + dansongs.Level = 10; + + if (strArray.Length >= 8 && strArray[7] != "" && strArray[7] != null) + dansongs.Difficulty = strConvertCourse(strArray[7]); + else if (strArray.Length < 8) + dansongs.Difficulty = 3; + + if (strArray.Length == 9 && strArray[8] != "" && strArray[8] != null) + dansongs.bTitleShow = bool.Parse(strArray[8]); + else if (strArray.Length < 9) + dansongs.bTitleShow = false; + + dansongs.Wave = new CWAV { + n内部番号 = this.n内部番号WAV1to, + n表記上の番号 = this.n内部番号WAV1to, + nチップサイズ = this.n無限管理SIZE[this.n内部番号WAV1to], + n位置 = this.n無限管理PAN[this.n内部番号WAV1to], + SongVol = this.SongVol, + SongLoudnessMetadata = this.SongLoudnessMetadata, + strファイル名 = CDTXCompanionFileFinder.FindFileName(this.strフォルダ名, strファイル名, dansongs.FileName), + strコメント文 = "TJA BGM" + }; + dansongs.Wave.SongLoudnessMetadata = LoudnessMetadataScanner.LoadForAudioPath(dansongs.Wave.strファイル名); + List_DanSongs.Add(dansongs); + this.listWAV.Add(this.n内部番号WAV1to, dansongs.Wave); + this.n内部番号WAV1to++; + + var nextSongnextSongChip = new CChip(); + + nextSongnextSongChip.nチャンネル番号 = 0x01; + nextSongnextSongChip.n発声位置 = 384; + nextSongnextSongChip.n発声時刻ms = (int)this.dbNowTime; + nextSongnextSongChip.fNow_Measure_m = this.fNow_Measure_m; + nextSongnextSongChip.fNow_Measure_s = this.fNow_Measure_s; + nextSongnextSongChip.n整数値 = 0x01; + nextSongnextSongChip.n整数値_内部番号 = 1 + List_DanSongs.Count; + + this.listWAV[1].strファイル名 = ""; + + Array.Resize(ref bHasBranchDan, List_DanSongs.Count); + bHasBranchDan[bHasBranchDan.Length - 1] = false; + + // チップを配置。 + this.listChip.Add(nextSongnextSongChip); + } else if (command == "#NMSCROLL") { + //チップ追加して割り込んでみる。 + var chip = new CChip(); + + chip.nチャンネル番号 = 0x09; + chip.n発声位置 = ((this.n現在の小節数) * 384) - 1; + chip.n発声時刻ms = (int)this.dbNowTime; + chip.fNow_Measure_m = this.fNow_Measure_m; + chip.fNow_Measure_s = this.fNow_Measure_s; + chip.n整数値_内部番号 = this.n内部番号SCROLL1to; + chip.nコース = this.n現在のコース; + + // チップを配置。 + eScrollMode = EScrollMode.Normal; + + this.listChip.Add(chip); + } else if (command == "#BMSCROLL") { + //チップ追加して割り込んでみる。 + var chip = new CChip(); + + chip.nチャンネル番号 = 0x0A; + chip.n発声位置 = ((this.n現在の小節数) * 384) - 1; + chip.n発声時刻ms = (int)this.dbNowTime; + chip.fNow_Measure_m = this.fNow_Measure_m; + chip.fNow_Measure_s = this.fNow_Measure_s; + chip.n整数値_内部番号 = this.n内部番号SCROLL1to; + chip.nコース = this.n現在のコース; + + // チップを配置。 + eScrollMode = EScrollMode.BMScroll; + + this.listChip.Add(chip); + } else if (command == "#HBSCROLL") { + //チップ追加して割り込んでみる。 + var chip = new CChip(); + + chip.nチャンネル番号 = 0x0B; + chip.n発声位置 = ((this.n現在の小節数) * 384) - 1; + chip.n発声時刻ms = (int)this.dbNowTime; + chip.fNow_Measure_m = this.fNow_Measure_m; + chip.fNow_Measure_s = this.fNow_Measure_s; + chip.n整数値_内部番号 = this.n内部番号SCROLL1to; + chip.nコース = this.n現在のコース; + + // チップを配置。 + eScrollMode = EScrollMode.HBScroll; + + this.listChip.Add(chip); + } + } + void t現在のチップ情報を記録する(bool bInPut) { + //2020.04.21 こうなってしまったのは仕方がないな。。 + if (bInPut) { + #region [ 記録する ] + cBranchStart.dbTime = this.dbNowTime; + cBranchStart.dbSCROLL = this.dbNowScroll; + cBranchStart.dbSCROLLY = this.dbNowScrollY; + cBranchStart.dbBMScollTime = this.dbNowBMScollTime; + cBranchStart.dbBPM = this.dbNowBPM; + cBranchStart.fMeasure_s = this.fNow_Measure_s; + cBranchStart.fMeasure_m = this.fNow_Measure_m; + cBranchStart.nMeasureCount = this.n現在の小節数; + cBranchStart.db移動待機時刻 = this.db移動待機時刻; + cBranchStart.db再生速度 = this.db再生速度; + cBranchStart.db出現時刻 = this.db出現時刻; + #endregion + } else { + #region [ 記録した情報をNow~に適応 ] + this.dbNowTime = cBranchStart.dbTime; + this.dbNowScroll = cBranchStart.dbSCROLL; + this.dbNowScrollY = cBranchStart.dbSCROLLY; + this.dbNowBMScollTime = cBranchStart.dbBMScollTime; + this.dbNowBPM = cBranchStart.dbBPM; + this.fNow_Measure_s = cBranchStart.fMeasure_s; + this.fNow_Measure_m = cBranchStart.fMeasure_m; + this.n現在の小節数 = cBranchStart.nMeasureCount; + this.db移動待機時刻 = cBranchStart.db移動待機時刻; + this.db再生速度 = cBranchStart.db再生速度; + this.db出現時刻 = cBranchStart.db出現時刻; + #endregion + } + } + + /// + /// 一小節前の小節線情報を返すMethod 2020.04.21.akasoko26 + /// + /// + /// + private CChip c一小節前の小節線情報を返す(List listChips, E分岐種類 e分岐種類, bool b分岐前の連打開始 = false) { + //2020.04.20 c一小節前の小節線情報を返すMethodを追加 + //連打分岐時は現在の小節以降の連打の終わり部分の時刻を取得する + + int? nReturnChip = null; + + //--して取得しないとだめよ~ダメダメ💛 + //:damedane: + for (int i = listChips.Count - 1; i >= 0; i--) { + if (b分岐前の連打開始) { + //if (listChips[i].nチャンネル番号 == 0x15 || listChips[i].nチャンネル番号 == 0x16) + if (NotesManager.IsRoll(listChips[i]) || NotesManager.IsFuzeRoll(listChips[i])) { + if (nReturnChip == null) + nReturnChip = i; + + //ReturnChipがnullであったら適応 + } + } else { + var Flag = e分岐種類 == E分岐種類.e連打分岐 ? 0x18 : 0x50; + + if (listChips[i].nチャンネル番号 == Flag) { + if (nReturnChip == null) + nReturnChip = i; + //ReturnChipがnullであったら適応 + } } } - private void t入力_行解析譜面_V4(string InputText) { - if (!String.IsNullOrEmpty(InputText)) { - int n文字数 = 16; - - //現在のコース、小節に当てはまるものをリストから探して文字数を返す。 - for (int i = 0; i < this.listLine.Count; i++) { - if (this.listLine[i].n小節番号 == this.n現在の小節数 && this.listLine[i].nコース == this.n現在のコース) { - n文字数 = this.listLine[i].n文字数; + //もし、nReturnChipがnullだったらlistChipのCount - 1にセットする。 + return listChips[nReturnChip == null ? listChips.Count - 1 : (int)nReturnChip]; + } + + private void WarnSplitLength(string name, string[] strArray, int minimumLength) { + if (strArray.Length < minimumLength) { + Trace.TraceWarning( + $"命令 {name} のパラメータが足りません。少なくとも {minimumLength} つのパラメータが必要です。 (現在のパラメータ数: {strArray.Length}). ({strファイル名の絶対パス})"); + } + } + + private void t入力_行解析譜面_V4(string InputText) { + if (!String.IsNullOrEmpty(InputText)) { + int n文字数 = 16; + + //現在のコース、小節に当てはまるものをリストから探して文字数を返す。 + for (int i = 0; i < this.listLine.Count; i++) { + if (this.listLine[i].n小節番号 == this.n現在の小節数 && this.listLine[i].nコース == this.n現在のコース) { + n文字数 = this.listLine[i].n文字数; + } + + } + + if (InputText.StartsWith("#")) { + // Call orders here + this.t命令を挿入する(InputText); + return; + } else if (InputText.StartsWith("EXAM")) { + this.tDanExamLoad(InputText); + return; + } else { + if (this.b小節線を挿入している == false) { + // 小節線にもやってあげないと + // IsEndedBranchingがfalseで1回 + // trueで3回だよ3回 + for (int i = 0; i < (IsEndedBranching == true ? 3 : 1); i++) { + CChip chip = new CChip(); + chip.n発声位置 = ((this.n現在の小節数) * 384); + chip.nチャンネル番号 = 0x50; + chip.n発声時刻ms = (int)this.dbNowTime; + chip.n整数値 = this.n現在の小節数; + chip.n文字数 = n文字数; + chip.n整数値_内部番号 = this.n現在の小節数; + chip.dbBPM = this.dbNowBPM; + chip.fNow_Measure_m = this.fNow_Measure_m; + chip.fNow_Measure_s = this.fNow_Measure_s; + chip.IsEndedBranching = IsEndedBranching; + chip.dbSCROLL = this.dbNowScroll; + chip.dbSCROLL_Y = this.dbNowScrollY; + chip.fBMSCROLLTime = (float)this.dbNowBMScollTime; + chip.eScrollMode = eScrollMode; + + if (IsEndedBranching) + chip.nコース = (ECourse)i; + else + chip.nコース = n現在のコース; + + chip.b可視 = true; + chip.bHideBarLine = this.bBARLINECUE[0] == 1; + #region [ 作り直し ] + if (IsEndedBranching) { + if (this.IsBranchBarDraw[i]) + chip.bBranch = true; + } else { + if (this.IsBranchBarDraw[(int)n現在のコース]) + chip.bBranch = true; + } + #endregion + + this.listChip.Add(chip); + + #region [ 作り直し ] + if (IsEndedBranching) + this.IsBranchBarDraw[i] = false; + else this.IsBranchBarDraw[(int)n現在のコース] = false; + #endregion } + + this.dbLastTime = this.dbNowTime; + this.b小節線を挿入している = true; + + #region[ 拍線チップテスト ] + //1拍の時間を計算 + double db1拍 = (60.0 / this.dbNowBPM) / 4.0; + //forループ(拍数) + for (int measure = 1; measure < this.fNow_Measure_s; measure++) { + CChip hakusen = new CChip(); + hakusen.n発声位置 = ((this.n現在の小節数) * 384); + hakusen.n発声時刻ms = (int)(this.dbNowTime + (((db1拍 * 4.0)) * measure) * 1000.0); + hakusen.nチャンネル番号 = 0x51; + hakusen.fBMSCROLLTime = this.dbNowBMScollTime; + hakusen.n整数値_内部番号 = this.n現在の小節数; + hakusen.n整数値 = 0; + hakusen.dbBPM = this.dbNowBPM; + hakusen.dbSCROLL = this.dbNowScroll; + hakusen.fNow_Measure_m = this.fNow_Measure_m; + hakusen.fNow_Measure_s = this.fNow_Measure_s; + hakusen.dbSCROLL_Y = this.dbNowScrollY; + hakusen.nコース = n現在のコース; + hakusen.eScrollMode = eScrollMode; + this.listChip.Add(hakusen); + } + + #endregion + } - if (InputText.StartsWith("#")) { - // Call orders here - this.t命令を挿入する(InputText); - return; - } else if (InputText.StartsWith("EXAM")) { - this.tDanExamLoad(InputText); - return; - } else { - if (this.b小節線を挿入している == false) { - // 小節線にもやってあげないと - // IsEndedBranchingがfalseで1回 - // trueで3回だよ3回 + for (int n = 0; n < InputText.Length; n++) { + if (InputText.Substring(n, 1) == ",") { + this.n現在の小節数++; + this.b小節線を挿入している = false; + return; + } + + if (InputText.Substring(0, 1) == "F") { + bool bTest = true; + } + + + int nObjectNum = this.CharConvertNote(InputText.Substring(n, 1)); + + if (nObjectNum != 0) { + if ((nObjectNum >= 5 && nObjectNum <= 7) || nObjectNum == 9 || nObjectNum == 13 || nObjectNum == 16 || nObjectNum == 17) { + if (nNowRoll != 0) { + this.dbNowTime += (15000.0 / this.dbNowBPM * (this.fNow_Measure_s / this.fNow_Measure_m) * (16.0 / n文字数)); + this.dbNowBMScollTime += (double)((this.dbBarLength) * (16.0 / n文字数)); + continue; + } else { + this.nNowRollCount = listChip.Count; + for (int i = 0; i < this.nNowRollCountBranch.Length; i++) + this.nNowRollCountBranch[i] = listChip_Branch[i].Count; + nNowRoll = nObjectNum; + } + } + + // IsEndedBranchingがfalseで1回 + // trueで3回だよ3回 for (int i = 0; i < (IsEndedBranching == true ? 3 : 1); i++) { - CChip chip = new CChip(); - chip.n発声位置 = ((this.n現在の小節数) * 384); - chip.nチャンネル番号 = 0x50; + var chip = new CChip(); + chip.IsMissed = false; + chip.bHit = false; + chip.b可視 = true; + chip.bShow = true; + chip.bShowRoll = true; + chip.nチャンネル番号 = 0x10 + nObjectNum; + //chip.n発声位置 = (this.n現在の小節数 * 384) + ((384 * n) / n文字数); + chip.n発声位置 = (int)((this.n現在の小節数 * 384.0) + ((384.0 * n) / n文字数)); + chip.db発声位置 = this.dbNowTime; chip.n発声時刻ms = (int)this.dbNowTime; - chip.n整数値 = this.n現在の小節数; - chip.n文字数 = n文字数; - chip.n整数値_内部番号 = this.n現在の小節数; - chip.dbBPM = this.dbNowBPM; + //chip.fBMSCROLLTime = (float)(( this.dbBarLength ) * (16.0f / this.n各小節の文字数[this.n現在の小節数])); + chip.fBMSCROLLTime = (float)this.dbNowBMScollTime; + chip.n整数値 = nObjectNum; + chip.n整数値_内部番号 = 1; + chip.IsEndedBranching = IsEndedBranching; chip.fNow_Measure_m = this.fNow_Measure_m; chip.fNow_Measure_s = this.fNow_Measure_s; - chip.IsEndedBranching = IsEndedBranching; + chip.dbBPM = this.dbNowBPM; chip.dbSCROLL = this.dbNowScroll; chip.dbSCROLL_Y = this.dbNowScrollY; - chip.fBMSCROLLTime = (float)this.dbNowBMScollTime; + chip.nスクロール方向 = this.nスクロール方向; chip.eScrollMode = eScrollMode; if (IsEndedBranching) @@ -5263,1705 +5375,1593 @@ namespace OpenTaiko { else chip.nコース = n現在のコース; - chip.b可視 = true; - chip.bHideBarLine = this.bBARLINECUE[0] == 1; - #region [ 作り直し ] - if (IsEndedBranching) { - if (this.IsBranchBarDraw[i]) - chip.bBranch = true; - } else { - if (this.IsBranchBarDraw[(int)n現在のコース]) - chip.bBranch = true; - } - #endregion - - this.listChip.Add(chip); - - #region [ 作り直し ] - if (IsEndedBranching) - this.IsBranchBarDraw[i] = false; - else this.IsBranchBarDraw[(int)n現在のコース] = false; - #endregion - } + chip.n分岐回数 = this.n内部番号BRANCH1to; + chip.e楽器パート = EInstrumentPad.Taiko; + chip.nノーツ出現時刻ms = (int)(this.db出現時刻 * 1000.0); + chip.nノーツ移動開始時刻ms = (int)(this.db移動待機時刻 * 1000.0); + chip.nPlayerSide = this.nPlayerSide; + chip.bGOGOTIME = this.bGOGOTIME; - - this.dbLastTime = this.dbNowTime; - this.b小節線を挿入している = true; - - #region[ 拍線チップテスト ] - //1拍の時間を計算 - double db1拍 = (60.0 / this.dbNowBPM) / 4.0; - //forループ(拍数) - for (int measure = 1; measure < this.fNow_Measure_s; measure++) { - CChip hakusen = new CChip(); - hakusen.n発声位置 = ((this.n現在の小節数) * 384); - hakusen.n発声時刻ms = (int)(this.dbNowTime + (((db1拍 * 4.0)) * measure) * 1000.0); - hakusen.nチャンネル番号 = 0x51; - hakusen.fBMSCROLLTime = this.dbNowBMScollTime; - hakusen.n整数値_内部番号 = this.n現在の小節数; - hakusen.n整数値 = 0; - hakusen.dbBPM = this.dbNowBPM; - hakusen.dbSCROLL = this.dbNowScroll; - hakusen.fNow_Measure_m = this.fNow_Measure_m; - hakusen.fNow_Measure_s = this.fNow_Measure_s; - hakusen.dbSCROLL_Y = this.dbNowScrollY; - hakusen.nコース = n現在のコース; - hakusen.eScrollMode = eScrollMode; - this.listChip.Add(hakusen); - } - - #endregion - - } - - for (int n = 0; n < InputText.Length; n++) { - if (InputText.Substring(n, 1) == ",") { - this.n現在の小節数++; - this.b小節線を挿入している = false; - return; - } - - if (InputText.Substring(0, 1) == "F") { - bool bTest = true; - } - - - int nObjectNum = this.CharConvertNote(InputText.Substring(n, 1)); - - if (nObjectNum != 0) { - if ((nObjectNum >= 5 && nObjectNum <= 7) || nObjectNum == 9 || nObjectNum == 13 || nObjectNum == 16 || nObjectNum == 17) { - if (nNowRoll != 0) { - this.dbNowTime += (15000.0 / this.dbNowBPM * (this.fNow_Measure_s / this.fNow_Measure_m) * (16.0 / n文字数)); - this.dbNowBMScollTime += (double)((this.dbBarLength) * (16.0 / n文字数)); - continue; + if (NotesManager.IsKusudama(chip)) { + if (IsEndedBranching) { } else { - this.nNowRollCount = listChip.Count; - for (int i = 0; i < this.nNowRollCountBranch.Length; i++) - this.nNowRollCountBranch[i] = listChip_Branch[i].Count; - nNowRoll = nObjectNum; + // Balloon in branches + chip.nチャンネル番号 = 0x19; } - } - - // IsEndedBranchingがfalseで1回 - // trueで3回だよ3回 - for (int i = 0; i < (IsEndedBranching == true ? 3 : 1); i++) { - var chip = new CChip(); - chip.IsMissed = false; - chip.bHit = false; - chip.b可視 = true; - chip.bShow = true; - chip.bShowRoll = true; - chip.nチャンネル番号 = 0x10 + nObjectNum; - //chip.n発声位置 = (this.n現在の小節数 * 384) + ((384 * n) / n文字数); - chip.n発声位置 = (int)((this.n現在の小節数 * 384.0) + ((384.0 * n) / n文字数)); - chip.db発声位置 = this.dbNowTime; - chip.n発声時刻ms = (int)this.dbNowTime; - //chip.fBMSCROLLTime = (float)(( this.dbBarLength ) * (16.0f / this.n各小節の文字数[this.n現在の小節数])); - chip.fBMSCROLLTime = (float)this.dbNowBMScollTime; - chip.n整数値 = nObjectNum; - chip.n整数値_内部番号 = 1; - chip.IsEndedBranching = IsEndedBranching; - chip.fNow_Measure_m = this.fNow_Measure_m; - chip.fNow_Measure_s = this.fNow_Measure_s; - chip.dbBPM = this.dbNowBPM; - chip.dbSCROLL = this.dbNowScroll; - chip.dbSCROLL_Y = this.dbNowScrollY; - chip.nスクロール方向 = this.nスクロール方向; - chip.eScrollMode = eScrollMode; + } - if (IsEndedBranching) - chip.nコース = (ECourse)i; - else - chip.nコース = n現在のコース; + if (NotesManager.IsGenericBalloon(chip)) { + //this.n現在のコースをswitchで分岐していたため風船の値がうまく割り当てられていない 2020.04.21 akasoko26 - chip.n分岐回数 = this.n内部番号BRANCH1to; - chip.e楽器パート = EInstrumentPad.Taiko; - chip.nノーツ出現時刻ms = (int)(this.db出現時刻 * 1000.0); - chip.nノーツ移動開始時刻ms = (int)(this.db移動待機時刻 * 1000.0); - chip.nPlayerSide = this.nPlayerSide; - chip.bGOGOTIME = this.bGOGOTIME; + #region [Balloons] - if (NotesManager.IsKusudama(chip)) { - if (IsEndedBranching) { - } else { - // Balloon in branches - chip.nチャンネル番号 = 0x19; - } - } - - if (NotesManager.IsGenericBalloon(chip)) { - //this.n現在のコースをswitchで分岐していたため風船の値がうまく割り当てられていない 2020.04.21 akasoko26 - - #region [Balloons] - - switch (chip.nコース) { - case ECourse.eNormal: - if (this.listBalloon_Normal.Count == 0) { - chip.nBalloon = 5; - break; - } - - if (this.listBalloon_Normal.Count > this.listBalloon_Normal_数値管理) { - chip.nBalloon = this.listBalloon_Normal[this.listBalloon_Normal_数値管理]; - this.listBalloon_Normal_数値管理++; - break; - } + switch (chip.nコース) { + case ECourse.eNormal: + if (this.listBalloon_Normal.Count == 0) { + chip.nBalloon = 5; break; - case ECourse.eExpert: - if (this.listBalloon_Expert.Count == 0) { - chip.nBalloon = 5; - break; - } - - if (this.listBalloon_Expert.Count > this.listBalloon_Expert_数値管理) { - chip.nBalloon = this.listBalloon_Expert[this.listBalloon_Expert_数値管理]; - this.listBalloon_Expert_数値管理++; - break; - } - break; - case ECourse.eMaster: - if (this.listBalloon_Master.Count == 0) { - chip.nBalloon = 5; - break; - } - - if (this.listBalloon_Master.Count > this.listBalloon_Master_数値管理) { - chip.nBalloon = this.listBalloon_Master[this.listBalloon_Master_数値管理]; - this.listBalloon_Master_数値管理++; - break; - } - break; - } - - #endregion - - } - if (NotesManager.IsRollEnd(chip)) { - chip.nノーツ終了位置 = (this.n現在の小節数 * 384) + ((384 * n) / n文字数); - chip.nノーツ終了時刻ms = (int)this.dbNowTime; - chip.fBMSCROLLTime_end = (float)this.dbNowBMScollTime; - - chip.nノーツ出現時刻ms = listChip[nNowRollCount].nノーツ出現時刻ms; - chip.nノーツ移動開始時刻ms = listChip[nNowRollCount].nノーツ移動開始時刻ms; - - chip.n連打音符State = nNowRoll; - - if (!IsEndedBranching || i == 0) { - listChip[nNowRollCount].nノーツ終了位置 = (this.n現在の小節数 * 384) + ((384 * n) / n文字数); - listChip[nNowRollCount].nノーツ終了時刻ms = (int)this.dbNowTime; - listChip[nNowRollCount].fBMSCROLLTime_end = (int)this.dbNowBMScollTime; - } else if (!IsEndedBranching) { - listChip_Branch[(int)chip.nコース][nNowRollCountBranch[(int)chip.nコース]].nノーツ終了位置 = (this.n現在の小節数 * 384) + ((384 * n) / n文字数); - listChip_Branch[(int)chip.nコース][nNowRollCountBranch[(int)chip.nコース]].nノーツ終了時刻ms = (int)this.dbNowTime; - listChip_Branch[(int)chip.nコース][nNowRollCountBranch[(int)chip.nコース]].fBMSCROLLTime_end = (int)this.dbNowBMScollTime; - } else { - listChip_Branch[i][nNowRollCountBranch[i]].nノーツ終了位置 = (this.n現在の小節数 * 384) + ((384 * n) / n文字数); - listChip_Branch[i][nNowRollCountBranch[i]].nノーツ終了時刻ms = (int)this.dbNowTime; - listChip_Branch[i][nNowRollCountBranch[i]].fBMSCROLLTime_end = (int)this.dbNowBMScollTime; - } - - if (!IsEndedBranching || i == 2) - nNowRoll = 0; - } - - if (IsEnabledFixSENote) { - chip.IsFixedSENote = true; - chip.nSenote = FixSENote - 1; - } - - #region[ 固定される種類のsenotesはここで設定しておく。 ] - switch (nObjectNum) { - case 3: - chip.nSenote = 5; - break; - case 4: - chip.nSenote = 6; - break; - case 5: - chip.nSenote = 7; - break; - case 6: - chip.nSenote = 0xA; - break; - case 7: - chip.nSenote = 0xB; - break; - case 8: - chip.nSenote = 0xC; - break; - case 9: - chip.nSenote = 0xB; - break; - case 0xA: - chip.nSenote = 5; - break; - case 0xB: - chip.nSenote = 6; - break; - case 0xD: - chip.nSenote = 0xB; - break; - case 0xF1: - chip.nSenote = 5; - break; - } - #endregion - - - if (NotesManager.IsMissableNote(chip)) { - #region [ 作り直し ] - //譜面分岐がない譜面でも値は加算されてしまうがしゃあない - //分岐を開始しない間は共通譜面としてみなす。 - if (IsEndedBranching) { - this.nノーツ数_Branch[i]++; - - if (i == 0) { - if (this.n参照中の難易度 == (int)Difficulty.Dan) { - this.nDan_NotesCount[DanSongs.Number - 1]++; - } - this.nノーツ数[3]++; } - } else { - this.nノーツ数_Branch[(int)chip.nコース]++; - if (this.n参照中の難易度 == (int)Difficulty.Dan && chip.nコース == ECourse.eMaster) { + + if (this.listBalloon_Normal.Count > this.listBalloon_Normal_数値管理) { + chip.nBalloon = this.listBalloon_Normal[this.listBalloon_Normal_数値管理]; + this.listBalloon_Normal_数値管理++; + break; + } + break; + case ECourse.eExpert: + if (this.listBalloon_Expert.Count == 0) { + chip.nBalloon = 5; + break; + } + + if (this.listBalloon_Expert.Count > this.listBalloon_Expert_数値管理) { + chip.nBalloon = this.listBalloon_Expert[this.listBalloon_Expert_数値管理]; + this.listBalloon_Expert_数値管理++; + break; + } + break; + case ECourse.eMaster: + if (this.listBalloon_Master.Count == 0) { + chip.nBalloon = 5; + break; + } + + if (this.listBalloon_Master.Count > this.listBalloon_Master_数値管理) { + chip.nBalloon = this.listBalloon_Master[this.listBalloon_Master_数値管理]; + this.listBalloon_Master_数値管理++; + break; + } + break; + } + + #endregion + + } + if (NotesManager.IsRollEnd(chip)) { + chip.nノーツ終了位置 = (this.n現在の小節数 * 384) + ((384 * n) / n文字数); + chip.nノーツ終了時刻ms = (int)this.dbNowTime; + chip.fBMSCROLLTime_end = (float)this.dbNowBMScollTime; + + chip.nノーツ出現時刻ms = listChip[nNowRollCount].nノーツ出現時刻ms; + chip.nノーツ移動開始時刻ms = listChip[nNowRollCount].nノーツ移動開始時刻ms; + + chip.n連打音符State = nNowRoll; + + if (!IsEndedBranching || i == 0) { + listChip[nNowRollCount].nノーツ終了位置 = (this.n現在の小節数 * 384) + ((384 * n) / n文字数); + listChip[nNowRollCount].nノーツ終了時刻ms = (int)this.dbNowTime; + listChip[nNowRollCount].fBMSCROLLTime_end = (int)this.dbNowBMScollTime; + } else if (!IsEndedBranching) { + listChip_Branch[(int)chip.nコース][nNowRollCountBranch[(int)chip.nコース]].nノーツ終了位置 = (this.n現在の小節数 * 384) + ((384 * n) / n文字数); + listChip_Branch[(int)chip.nコース][nNowRollCountBranch[(int)chip.nコース]].nノーツ終了時刻ms = (int)this.dbNowTime; + listChip_Branch[(int)chip.nコース][nNowRollCountBranch[(int)chip.nコース]].fBMSCROLLTime_end = (int)this.dbNowBMScollTime; + } else { + listChip_Branch[i][nNowRollCountBranch[i]].nノーツ終了位置 = (this.n現在の小節数 * 384) + ((384 * n) / n文字数); + listChip_Branch[i][nNowRollCountBranch[i]].nノーツ終了時刻ms = (int)this.dbNowTime; + listChip_Branch[i][nNowRollCountBranch[i]].fBMSCROLLTime_end = (int)this.dbNowBMScollTime; + } + + if (!IsEndedBranching || i == 2) + nNowRoll = 0; + } + + if (IsEnabledFixSENote) { + chip.IsFixedSENote = true; + chip.nSenote = FixSENote - 1; + } + + #region[ 固定される種類のsenotesはここで設定しておく。 ] + switch (nObjectNum) { + case 3: + chip.nSenote = 5; + break; + case 4: + chip.nSenote = 6; + break; + case 5: + chip.nSenote = 7; + break; + case 6: + chip.nSenote = 0xA; + break; + case 7: + chip.nSenote = 0xB; + break; + case 8: + chip.nSenote = 0xC; + break; + case 9: + chip.nSenote = 0xB; + break; + case 0xA: + chip.nSenote = 5; + break; + case 0xB: + chip.nSenote = 6; + break; + case 0xD: + chip.nSenote = 0xB; + break; + case 0xF1: + chip.nSenote = 5; + break; + } + #endregion + + + if (NotesManager.IsMissableNote(chip)) { + #region [ 作り直し ] + //譜面分岐がない譜面でも値は加算されてしまうがしゃあない + //分岐を開始しない間は共通譜面としてみなす。 + if (IsEndedBranching) { + this.nノーツ数_Branch[i]++; + + if (i == 0) { + if (this.n参照中の難易度 == (int)Difficulty.Dan) { this.nDan_NotesCount[DanSongs.Number - 1]++; } - - if (!this.b分岐を一回でも開始した) { - //IsEndedBranching==false = forloopが行われていないときのみ - for (int l = 0; l < 3; l++) - this.nノーツ数_Branch[l]++; - } - } - - #endregion - } else if (NotesManager.IsGenericBalloon(chip)) { - //風船はこのままでも機能しているので何もしない. - if (IsEndedBranching) { - if (this.n参照中の難易度 == (int)Difficulty.Dan) { - this.nDan_BalloonCount[DanSongs.Number - 1]++; - } - } else { - if (this.n参照中の難易度 == (int)Difficulty.Dan && chip.nコース == ECourse.eMaster) { - this.nDan_BalloonCount[DanSongs.Number - 1]++; - } + this.nノーツ数[3]++; } - - if (this.b最初の分岐である == false) { - this.n風船数[(int)this.n現在のコース]++; - } else { - this.n風船数[3]++; - } - - } - - Array.Resize(ref nDan_NotesCount, nDan_NotesCount.Length + 1); - Array.Resize(ref nDan_BalloonCount, nDan_BalloonCount.Length + 1); - if (IsEndedBranching) { - this.listChip_Branch[i].Add(chip); - if (i == 0) - this.listChip.Add(chip); } else { - this.listChip_Branch[(int)chip.nコース].Add(chip); - this.listChip.Add(chip); - } + this.nノーツ数_Branch[(int)chip.nコース]++; + if (this.n参照中の難易度 == (int)Difficulty.Dan && chip.nコース == ECourse.eMaster) { + this.nDan_NotesCount[DanSongs.Number - 1]++; + } - } - } - - if (IsEnabledFixSENote) IsEnabledFixSENote = false; - - this.dbLastTime = this.dbNowTime; - this.dbLastBMScrollTime = this.dbNowBMScollTime; - this.dbNowTime += (15000.0 / this.dbNowBPM * (this.fNow_Measure_s / this.fNow_Measure_m) * (16.0 / n文字数)); - this.dbNowBMScollTime += (((this.fNow_Measure_s / this.fNow_Measure_m)) * (16.0 / (double)n文字数)); - } - } - } - } - - /// - /// 難易度ごとによって変わるヘッダ値を読み込む。 - /// (BALLOONなど。) - /// - /// - private void t難易度別ヘッダ(string InputText) { - if (OpenTaiko.actEnumSongs != null && OpenTaiko.actEnumSongs.IsDeActivated) { - if (InputText.Equals("#NMSCROLL")) { - eScrollMode = EScrollMode.Normal; - } else if (InputText.Equals("#HBSCROLL")) { - eScrollMode = EScrollMode.HBScroll; - } - if (InputText.Equals("#BMSCROLL")) { - eScrollMode = EScrollMode.BMScroll; - } - } - - string[] strArray = InputText.Split(new char[] { ':' }); - string strCommandName = ""; - string strCommandParam = ""; - - if (strArray.Length == 2) { - strCommandName = strArray[0].Trim(); - strCommandParam = strArray[1].Trim(); - } - - void ParseOptionalInt16(Action setValue) { - this.ParseOptionalInt16(strCommandName, strCommandParam, setValue); - } - - if (strCommandName.Equals("BALLOON") || strCommandName.Equals("BALLOONNOR")) { - ParseBalloon(strCommandParam, this.listBalloon_Normal); - } else if (strCommandName.Equals("BALLOONEXP")) { - ParseBalloon(strCommandParam, this.listBalloon_Expert); - //tbBALLOON.Text = strCommandParam; - } else if (strCommandName.Equals("BALLOONMAS")) { - ParseBalloon(strCommandParam, this.listBalloon_Master); - //tbBALLOON.Text = strCommandParam; - } else if (strCommandName.Equals("SCOREMODE")) { - ParseOptionalInt16(value => this.nScoreModeTmp = value); - } else if (strCommandName.Equals("SCOREINIT")) { - if (!string.IsNullOrEmpty(strCommandParam)) { - string[] scoreinit = strCommandParam.Split(','); - - this.ParseOptionalInt16("SCOREINIT first value", scoreinit[0], value => { - this.nScoreInit[0, this.n参照中の難易度] = value; - this.b配点が指定されている[0, this.n参照中の難易度] = true; - }); - - if (scoreinit.Length == 2) { - this.ParseOptionalInt16("SCOREINIT second value", scoreinit[1], value => { - this.nScoreInit[1, this.n参照中の難易度] = value; - this.b配点が指定されている[2, this.n参照中の難易度] = true; - }); - } - } - } else if (strCommandName.Equals("SCOREDIFF")) { - ParseOptionalInt16(value => { - this.nScoreDiff[this.n参照中の難易度] = value; - this.b配点が指定されている[1, this.n参照中の難易度] = true; - }); - } else if (strCommandName.Equals("SCOREMODE")) { - if (!string.IsNullOrEmpty(strCommandParam)) { - this.nScoreModeTmp = Convert.ToInt16(strCommandParam); - } - } else if (strCommandName.Equals("SCOREINIT")) { - if (!string.IsNullOrEmpty(strCommandParam)) { - string[] scoreinit = strCommandParam.Split(','); - - this.nScoreInit[0, this.n参照中の難易度] = Convert.ToInt16(scoreinit[0]); - this.b配点が指定されている[0, this.n参照中の難易度] = true; - if (scoreinit.Length == 2) { - this.nScoreInit[1, this.n参照中の難易度] = Convert.ToInt16(scoreinit[1]); - this.b配点が指定されている[2, this.n参照中の難易度] = true; - } - } - } else if (strCommandName.Equals("SCOREDIFF")) { - if (!string.IsNullOrEmpty(strCommandParam)) { - this.nScoreDiff[this.n参照中の難易度] = Convert.ToInt16(strCommandParam); - this.b配点が指定されている[1, this.n参照中の難易度] = true; - } - } - if (this.nScoreModeTmp == 99) //2017.01.28 DD SCOREMODEを入力していない場合のみConfigで設定したモードにする - { - this.nScoreModeTmp = OpenTaiko.ConfigIni.nScoreMode; - } - if (OpenTaiko.ConfigIni.nScoreMode == 3 && !this.b配点が指定されている[2, this.n参照中の難易度]) { //2017.06.04 kairera0467 - this.nScoreModeTmp = 3; - } - } - - private void tDanExamLoad(string input) { - string[] strArray = input.Split(new char[] { ':' }); - string strCommandName = ""; - string strCommandParam = ""; - - if (strArray.Length == 2) { - strCommandName = strArray[0].Trim(); - strCommandParam = strArray[1].Trim(); - } - - // Adapt to EXAM until 7, optimise condition - - if (strCommandName.StartsWith("EXAM")) { - if (!string.IsNullOrEmpty(strCommandParam)) { - Exam.Type examType; - int[] examValue; - Exam.Range examRange; - var splitExam = strCommandParam.Split(','); - int examNumber = int.Parse(strCommandName.Substring(4)) - 1; - - if (examNumber > CExamInfo.cMaxExam) - return; - - switch (splitExam[0]) { - case "g": - examType = Exam.Type.Gauge; - break; - case "jp": - examType = Exam.Type.JudgePerfect; - break; - case "jg": - examType = Exam.Type.JudgeGood; - break; - case "jb": - examType = Exam.Type.JudgeBad; - break; - case "s": - examType = Exam.Type.Score; - break; - case "r": - examType = Exam.Type.Roll; - break; - case "h": - examType = Exam.Type.Hit; - break; - case "c": - examType = Exam.Type.Combo; - break; - case "a": - examType = Exam.Type.Accuracy; - break; - case "ja": - examType = Exam.Type.JudgeADLIB; - break; - case "jm": - examType = Exam.Type.JudgeMine; - break; - default: - examType = Exam.Type.Gauge; - break; - } - try { - examValue = new int[] { int.Parse(splitExam[1]), int.Parse(splitExam[2]) }; - } catch (Exception) { - examValue = new int[] { 100, 100 }; - } - switch (splitExam[3]) { - case "m": - examRange = Exam.Range.More; - break; - case "l": - examRange = Exam.Range.Less; - break; - default: - examRange = Exam.Range.More; - break; - } - - if (Dan_C[examNumber] == null) - Dan_C[examNumber] = new Dan_C(examType, examValue, examRange); - - if (DanSongs.Number > 0) - List_DanSongs[DanSongs.Number - 1].Dan_C[examNumber] = new Dan_C(examType, examValue, examRange); - } - } - } - - private void ParseOptionalInt16(string name, string unparsedValue, Action setValue) { - if (string.IsNullOrEmpty(unparsedValue)) { - return; - } - - if (short.TryParse(unparsedValue, out var value)) { - setValue(value); - } else { - Trace.TraceWarning($"命令名: {name} のパラメータの値が正しくないことを検知しました。値: {unparsedValue} ({strファイル名の絶対パス})"); - } - } - - - private void ParseBalloon(string strCommandParam, List listBalloon) { - string[] strParam = strCommandParam.Split(','); - for (int n = 0; n < strParam.Length; n++) { - int n打数; - try { - if (strParam[n] == null || strParam[n] == "") - break; - - n打数 = Convert.ToInt32(strParam[n]); - } catch (Exception ex) { - Trace.TraceError($"おや?エラーが出たようです。お兄様。 ({strファイル名の絶対パス})"); - Trace.TraceError(ex.ToString()); - Trace.TraceError("例外が発生しましたが処理を継続します。 (95327158-4e83-4fa9-b5e9-ad3c3d4c2a22)"); - break; - } - - listBalloon.Add(n打数); - } - } - private void t入力_行解析ヘッダ(string InputText) { - //やべー。先頭にコメント行あったらやばいやん。 - string[] strArray = InputText.Split(new char[] { ':' }, 2); - string strCommandName = ""; - string strCommandParam = ""; - - if (InputText.StartsWith("#BRANCHSTART")) { - //2015.08.18 kairera0467 - //本来はヘッダ命令ではありませんが、難易度ごとに違う項目なのでここで読み込ませます。 - //Lengthのチェックをされる前ににif文を入れています。 - this.bHasBranch[this.n参照中の難易度] = true; - - if (this.n参照中の難易度 == (int)Difficulty.Dan) { - this.bHasBranchDan[this.bHasBranchDan.Length - 1] = true; - } - } - - //まずは「:」でSplitして割り当てる。 - if (strArray.Length == 2) { - strCommandName = strArray[0].Trim(); - strCommandParam = strArray[1].Trim(); - } else if (strArray.Length > 2) { - //strArrayが2じゃない場合、ヘッダのSplitを通していない可能性がある。 - //この処理自体は「t入力」を改造したもの。STARTでSplitしていない等、一部の処理が異なる。 - - #region [Header] - InputText = InputText.Replace(Environment.NewLine, "\n"); //改行文字を別の文字列に差し替え。 - InputText = InputText.Replace('\t', ' '); //何の文字か知らないけどスペースに差し替え。 - InputText = InputText + "\n"; - - string[] strDelimiter2 = { "\n" }; - strArray = InputText.Split(strDelimiter2, StringSplitOptions.RemoveEmptyEntries); - - - strArray = strArray[0].Split(new char[] { ':' }); - WarnSplitLength("Header Name & Value", strArray, 2); - - strCommandName = strArray[0].Trim(); - strCommandParam = strArray[1].Trim(); - - #endregion - //lblMessage.Text = "おや?strArrayのLengthが2じゃないようですね。お兄様。"; - } - - void ParseOptionalInt16(Action setValue) { - this.ParseOptionalInt16(strCommandName, strCommandParam, setValue); - } - - //パラメータを分別、そこから割り当てていきます。 - if (strCommandName.Equals("TITLE")) { - this.TITLE.SetString("default", strCommandParam); - } else if (strCommandName.StartsWith("TITLE")) { - string _lang = strCommandName.Substring(5).ToLowerInvariant(); - this.TITLE.SetString(_lang, strCommandParam); - } else if (strCommandName.Equals("SUBTITLE")) { - if (strCommandParam.StartsWith("--") || strCommandParam.StartsWith("++")) - this.SUBTITLE.SetString("default", strCommandParam.Substring(2)); - else - this.SUBTITLE.SetString("default", strCommandParam); - } else if (strCommandName.StartsWith("SUBTITLE")) { - string _lang = strCommandName.Substring(8).ToLowerInvariant(); - this.SUBTITLE.SetString(_lang, strCommandParam); - } else if (strCommandName.Equals("LEVEL")) { - var level_dec = Convert.ToDouble(strCommandParam); - var level = (int)level_dec; - if (strCommandParam != level.ToString()) { - int frac_part = Int32.Parse(level_dec.ToString("0.0", CultureInfo.InvariantCulture).Split('.')[1]); - this.LEVELtaikoIcon[this.n参照中の難易度] = (frac_part >= 5) ? ELevelIcon.ePlus : ELevelIcon.eMinus; - } - this.LEVEL.Drums = (int)level; - this.LEVEL.Taiko = (int)level; - this.LEVELtaiko[this.n参照中の難易度] = (int)level; - } else if (strCommandName.StartsWith("NOTESDESIGNER")) { - this.NOTESDESIGNER[this.n参照中の難易度] = strCommandParam; - } else if (strCommandName.Equals("LIFE")) { - // LIFE here - var life = (int)Convert.ToDouble(strCommandParam); - this.LIFE = life; - } else if (strCommandName.Equals("PREIMAGE")) { - this.PREIMAGE = strCommandParam; - } else if (strCommandName.Equals("TOWERTYPE")) { - this.TOWERTYPE = strCommandParam; - } else if (strCommandName.Equals("DANTICK")) { - var tick = (int)Convert.ToDouble(strCommandParam); - this.DANTICK = tick; - } else if (strCommandName.Equals("DANTICKCOLOR")) { - var tickcolor = ColorTranslator.FromHtml(strCommandParam); - this.DANTICKCOLOR = tickcolor; - } else if (strCommandName.Equals("BPM")) { - if (strCommandParam.IndexOf(",") != -1) - strCommandParam = strCommandParam.Replace(',', '.'); - - double dbBPM = Convert.ToDouble(strCommandParam); - this.BPM = dbBPM; - this.BASEBPM = dbBPM; - this.MinBPM = dbBPM; - this.MaxBPM = dbBPM; - this.dbNowBPM = dbBPM; - - this.listBPM.Add(this.n内部番号BPM1to - 1, new CBPM() { n内部番号 = this.n内部番号BPM1to - 1, n表記上の番号 = this.n内部番号BPM1to - 1, dbBPM値 = dbBPM, }); - this.n内部番号BPM1to++; - - - //チップ追加して割り込んでみる。 - var chip = new CChip(); - - chip.nチャンネル番号 = 0x03; - chip.n発声位置 = ((this.n現在の小節数 - 1) * 384); - chip.n整数値 = 0x00; - chip.n整数値_内部番号 = 1; - - this.listChip.Add(chip); - //tbBPM.Text = strCommandParam; - } else if (strCommandName.Equals("WAVE")) { - if (strBGM_PATH != null) { - Trace.TraceWarning($"{nameof(CDTX)} is ignoring an extra WAVE header in {this.strファイル名の絶対パス}"); - } else { - this.strBGM_PATH = CDTXCompanionFileFinder.FindFileName(this.strフォルダ名, strファイル名, strCommandParam); - //tbWave.Text = strCommandParam; - if (this.listWAV != null) { - // 2018-08-27 twopointzero - DO attempt to load (or queue scanning) loudness metadata here. - // TJAP3 is either launching, enumerating songs, or is about to - // begin playing a song. If metadata is available, we want it now. - // If is not yet available then we wish to queue scanning. - var absoluteBgmPath = Path.Combine(this.strフォルダ名, this.strBGM_PATH); - this.SongLoudnessMetadata = LoudnessMetadataScanner.LoadForAudioPath(absoluteBgmPath); - - var wav = new CWAV() { - n内部番号 = this.n内部番号WAV1to, - n表記上の番号 = 1, - nチップサイズ = this.n無限管理SIZE[this.n内部番号WAV1to], - n位置 = this.n無限管理PAN[this.n内部番号WAV1to], - SongVol = this.SongVol, - SongLoudnessMetadata = this.SongLoudnessMetadata, - strファイル名 = this.strBGM_PATH, - strコメント文 = "TJA BGM", - }; - - this.listWAV.Add(this.n内部番号WAV1to, wav); - this.n内部番号WAV1to++; - } - } - } else if (strCommandName.Equals("OFFSET") && !string.IsNullOrEmpty(strCommandParam)) { - this.nOFFSET = (int)(Convert.ToDouble(strCommandParam) * 1000); - - this.bOFFSETの値がマイナスである = this.nOFFSET < 0 ? true : false; - - this.listBPM[0].bpm_change_bmscroll_time = -2000 * this.dbNowBPM / 15000; - if (this.bOFFSETの値がマイナスである == true) - this.nOFFSET = this.nOFFSET * -1; //OFFSETは秒を加算するので、必ず正の数にすること。 - //tbOFFSET.Text = strCommandParam; - - // Substract global offset - this.nOFFSET += ((this.bOFFSETの値がマイナスである == true) ? -OpenTaiko.ConfigIni.nGlobalOffsetMs : OpenTaiko.ConfigIni.nGlobalOffsetMs); - } else if (strCommandName.Equals("MOVIEOFFSET")) { - this.nMOVIEOFFSET = (int)(Convert.ToDouble(strCommandParam) * 1000); - this.bMOVIEOFFSETの値がマイナスである = this.nMOVIEOFFSET < 0 ? true : false; - - if (this.bMOVIEOFFSETの値がマイナスである == true) - this.nMOVIEOFFSET = this.nMOVIEOFFSET * -1; //OFFSETは秒を加算するので、必ず正の数にすること。 - //tbOFFSET.Text = strCommandParam; - } - #region[移動→不具合が起こるのでここも一応復活させておく] - else if (strCommandName.Equals("BALLOON") || strCommandName.Equals("BALLOONNOR")) { - ParseBalloon(strCommandParam, this.listBalloon_Normal); - } else if (strCommandName.Equals("BALLOONEXP")) { - ParseBalloon(strCommandParam, this.listBalloon_Expert); - //tbBALLOON.Text = strCommandParam; - } else if (strCommandName.Equals("BALLOONMAS")) { - ParseBalloon(strCommandParam, this.listBalloon_Master); - //tbBALLOON.Text = strCommandParam; - } else if (strCommandName.Equals("SCOREMODE")) { - ParseOptionalInt16(value => this.nScoreModeTmp = value); - } else if (strCommandName.Equals("SCOREINIT")) { - if (!string.IsNullOrEmpty(strCommandParam)) { - string[] scoreinit = strCommandParam.Split(','); - - this.ParseOptionalInt16("SCOREINIT first value", scoreinit[0], value => { - this.nScoreInit[0, this.n参照中の難易度] = value; - }); - - if (scoreinit.Length == 2) { - this.ParseOptionalInt16("SCOREINIT second value", scoreinit[1], value => { - this.nScoreInit[1, this.n参照中の難易度] = value; - }); - } - } - } else if (strCommandName.Equals("GAUGEINCR")) { - if (!string.IsNullOrEmpty(strCommandParam)) { - switch (strCommandParam.ToLower()) { - case "normal": - GaugeIncreaseMode = GaugeIncreaseMode.Normal; - break; - case "floor": - GaugeIncreaseMode = GaugeIncreaseMode.Floor; - break; - case "round": - GaugeIncreaseMode = GaugeIncreaseMode.Round; - break; - case "ceiling": - GaugeIncreaseMode = GaugeIncreaseMode.Ceiling; - break; - case "notfix": - GaugeIncreaseMode = GaugeIncreaseMode.NotFix; - break; - default: - GaugeIncreaseMode = GaugeIncreaseMode.Normal; - break; - } - } - } else if (strCommandName.Equals("SCOREDIFF")) { - ParseOptionalInt16(value => this.nScoreDiff[this.n参照中の難易度] = value); - } - #endregion - else if (strCommandName.Equals("SONGVOL") && !string.IsNullOrEmpty(strCommandParam)) { - this.SongVol = Convert.ToInt32(strCommandParam).Clamp(CSound.MinimumSongVol, CSound.MaximumSongVol); - - foreach (var kvp in this.listWAV) { - kvp.Value.SongVol = this.SongVol; - } - } else if (strCommandName.Equals("SEVOL")) { - //tbSeVol.Text = strCommandParam; - } else if (strCommandName.Equals("COURSE")) { - if (!string.IsNullOrEmpty(strCommandParam)) { - //this.n参照中の難易度 = Convert.ToInt16( strCommandParam ); - this.n参照中の難易度 = this.strConvertCourse(strCommandParam); - } - } else if (strCommandName.Equals("HEADSCROLL")) { - //新定義:初期スクロール速度設定(というよりこのシステムに合わせるには必須。) - //どうしても一番最初に1小節挿入されるから、こうするしかなかったんだ___ - - this.dbScrollSpeed = Convert.ToDouble(strCommandParam); - - this.listSCROLL.Add(this.n内部番号SCROLL1to, new CSCROLL() { n内部番号 = this.n内部番号SCROLL1to, n表記上の番号 = 0, dbSCROLL値 = this.dbScrollSpeed, }); - - - //チップ追加して割り込んでみる。 - var chip = new CChip(); - - chip.nチャンネル番号 = 0x9D; - chip.n発声位置 = ((this.n現在の小節数 - 2) * 384); - chip.n整数値 = 0x00; - chip.n整数値_内部番号 = this.n内部番号SCROLL1to; - chip.dbSCROLL = this.dbScrollSpeed; - - // チップを配置。 - - this.listChip.Add(chip); - this.n内部番号SCROLL1to++; - - //this.nScoreDiff = Convert.ToInt16( strCommandParam ); - //tbScoreDiff.Text = strCommandParam; - } else if (strCommandName.Equals("GENRE")) { - //2015.03.28 kairera0467 - //ジャンルの定義。DTXから入力もできるが、tjaからも入力できるようにする。 - //日本語名だと選曲画面でバグが出るので、そこもどうにかしていく予定。 - - if (!string.IsNullOrEmpty(strCommandParam)) { - this.GENRE = strCommandParam; - } - } else if (strCommandName.Equals("MAKER")) { - if (!string.IsNullOrEmpty(strCommandParam)) { - this.MAKER = strCommandParam; - } - } else if (strCommandName.Equals("SIDE")) { - if (!string.IsNullOrEmpty(strCommandParam) && strCommandParam.Equals("Normal")) - this.SIDE = ESide.eNormal; - } else if (strCommandName.Equals("EXPLICIT")) { - if (!string.IsNullOrEmpty(strCommandParam)) { - this.EXPLICIT = CConversion.bONorOFF(strCommandParam[0]); - } - } else if (strCommandName.Equals("SELECTBG")) { - if (!string.IsNullOrEmpty(strCommandParam)) { - this.SELECTBG = strCommandParam; - } - } else if (strCommandName.Equals("SCENEPRESET")) { - if (!string.IsNullOrEmpty(strCommandParam)) { - this.scenePreset = strCommandParam; - } - } else if (strCommandName.Equals("DEMOSTART")) { - //2015.04.10 kairera0467 - - if (!string.IsNullOrEmpty(strCommandParam)) { - int nOFFSETms; - try { - nOFFSETms = (int)(Convert.ToDouble(strCommandParam) * 1000.0); - } catch { - nOFFSETms = 0; - } - - - this.nデモBGMオフセット = nOFFSETms; - } - } else if (strCommandName.Equals("BGMOVIE")) { - //2016.02.02 kairera0467 - //背景動画の定義。DTXから入力もできるが、tjaからも入力できるようにする。 - - if (!string.IsNullOrEmpty(strCommandParam)) { - this.strBGVIDEO_PATH = - CDTXCompanionFileFinder.FindFileName(this.strフォルダ名, strファイル名, strCommandParam); - } - - string strVideoFilename; - if (!string.IsNullOrEmpty(this.PATH_WAV)) - strVideoFilename = this.PATH_WAV + this.strBGVIDEO_PATH; - else - strVideoFilename = this.strフォルダ名 + this.strBGVIDEO_PATH; - - try { - CVideoDecoder vd = new CVideoDecoder(strVideoFilename); - - if (this.listVD.ContainsKey(1)) - this.listVD.Remove(1); - - this.listVD.Add(1, vd); - } catch (Exception e) { - Trace.TraceWarning(e.ToString() + "\n" + - "動画のデコーダー生成で例外が発生しましたが、処理を継続します。"); - if (this.listVD.ContainsKey(1)) - this.listVD.Remove(1); - } - } else if (strCommandName.Contains("BGA")) { - //2016.02.02 kairera0467 - //背景動画の定義。DTXから入力もできるが、tjaからも入力できるようにする。 - - string videoPath = ""; - if (!string.IsNullOrEmpty(strCommandParam)) { - videoPath = - CDTXCompanionFileFinder.FindFileName(this.strフォルダ名, strファイル名, strCommandParam); - } - - string strVideoFilename; - if (!string.IsNullOrEmpty(this.PATH_WAV)) - strVideoFilename = this.PATH_WAV + videoPath; - else - strVideoFilename = this.strフォルダ名 + videoPath; - - try { - CVideoDecoder vd = new CVideoDecoder(strVideoFilename); - - var indexText = strCommandName.Remove(0, 3); - - this.listVD.Add((10 * int.Parse(indexText[0].ToString())) + int.Parse(indexText[1].ToString()) + 2, vd); - } catch (Exception e) { - Trace.TraceWarning(e.ToString() + "\n" + - "動画のデコーダー生成で例外が発生しましたが、処理を継続します。"); - if (this.listVD.ContainsKey(1)) - this.listVD.Remove(1); - } - } else if (strCommandName.Equals("BGIMAGE")) { - //2016.02.02 kairera0467 - if (!string.IsNullOrEmpty(strCommandParam)) { - this.strBGIMAGE_PATH = strCommandParam; - } - } else if (strCommandName.Equals("HIDDENBRANCH")) { - //2016.04.01 kairera0467 パラメーターは - if (!string.IsNullOrEmpty(strCommandParam)) { - this.bHIDDENBRANCH = true; - } - } else if (strCommandName.Equals("LYRICS") && !usingLyricsFile && OpenTaiko.ConfigIni.nPlayerCount < 4) { - if (!string.IsNullOrEmpty(strCommandParam)) { - string[] files = SplitComma(strCommandParam); - string[] filePaths = new string[files.Length]; - for (int i = 0; i < files.Length; i++) { - filePaths[i] = this.strフォルダ名 + files[i]; - - if (File.Exists(filePaths[i])) { - try { - if (OpenTaiko.r現在のステージ.eStageID == CStage.EStage.SongLoading) { - if (filePaths[i].EndsWith(".vtt")) { - using (VTTParser parser = new VTTParser()) { - this.listLyric2.AddRange(parser.ParseVTTFile(filePaths[i], 0, 0)); - } - this.bLyrics = true; - this.usingLyricsFile = true; - } else if (filePaths[i].EndsWith(".lrc")) { - this.LyricFileParser(filePaths[i], i); - this.bLyrics = true; - this.usingLyricsFile = true; + if (!this.b分岐を一回でも開始した) { + //IsEndedBranching==false = forloopが行われていないときのみ + for (int l = 0; l < 3; l++) + this.nノーツ数_Branch[l]++; } } - } catch (Exception e) { - Trace.TraceError("Something went wrong while parsing a lyric file at {0}. More details : {1}", filePaths[i], e); - } - } - } - } - } else if (strCommandName.Equals("LYRICFILE") && !usingLyricsFile && OpenTaiko.ConfigIni.nPlayerCount < 4) { - if (!string.IsNullOrEmpty(strCommandParam)) { - string[] strFiles = SplitComma(strCommandParam); - string[] strFilePath = new string[strFiles.Length]; - for (int index = 0; index < strFiles.Length; index++) { - strFilePath[index] = this.strフォルダ名 + strFiles[index]; - if (File.Exists(strFilePath[index])) { - try { - if (OpenTaiko.r現在のステージ.eStageID == CStage.EStage.SongLoading)//起動時に重たくなってしまう問題の修正用 - this.LyricFileParser(strFilePath[index], index); - this.bLyrics = true; - this.usingLyricsFile = true; - } catch { - Console.WriteLine("lrcファイルNo.{0}の読み込みに失敗しましたが、", index); - Console.WriteLine("処理を続行します。"); + + #endregion + } else if (NotesManager.IsGenericBalloon(chip)) { + //風船はこのままでも機能しているので何もしない. + if (IsEndedBranching) { + if (this.n参照中の難易度 == (int)Difficulty.Dan) { + this.nDan_BalloonCount[DanSongs.Number - 1]++; + } + } else { + if (this.n参照中の難易度 == (int)Difficulty.Dan && chip.nコース == ECourse.eMaster) { + this.nDan_BalloonCount[DanSongs.Number - 1]++; + } + } + + if (this.b最初の分岐である == false) { + this.n風船数[(int)this.n現在のコース]++; + } else { + this.n風船数[3]++; + } + } + + Array.Resize(ref nDan_NotesCount, nDan_NotesCount.Length + 1); + Array.Resize(ref nDan_BalloonCount, nDan_BalloonCount.Length + 1); + if (IsEndedBranching) { + this.listChip_Branch[i].Add(chip); + if (i == 0) + this.listChip.Add(chip); + } else { + this.listChip_Branch[(int)chip.nコース].Add(chip); + this.listChip.Add(chip); + } + } } + + if (IsEnabledFixSENote) IsEnabledFixSENote = false; + + this.dbLastTime = this.dbNowTime; + this.dbLastBMScrollTime = this.dbNowBMScollTime; + this.dbNowTime += (15000.0 / this.dbNowBPM * (this.fNow_Measure_s / this.fNow_Measure_m) * (16.0 / n文字数)); + this.dbNowBMScollTime += (((this.fNow_Measure_s / this.fNow_Measure_m)) * (16.0 / (double)n文字数)); } } - if (this.nScoreModeTmp == 99) { - //2017.01.28 DD - this.nScoreModeTmp = OpenTaiko.ConfigIni.nScoreMode; + } + } + + /// + /// 難易度ごとによって変わるヘッダ値を読み込む。 + /// (BALLOONなど。) + /// + /// + private void t難易度別ヘッダ(string InputText) { + if (OpenTaiko.actEnumSongs != null && OpenTaiko.actEnumSongs.IsDeActivated) { + if (InputText.Equals("#NMSCROLL")) { + eScrollMode = EScrollMode.Normal; + } else if (InputText.Equals("#HBSCROLL")) { + eScrollMode = EScrollMode.HBScroll; + } + if (InputText.Equals("#BMSCROLL")) { + eScrollMode = EScrollMode.BMScroll; } - } - /// - /// 指定した文字が数値かを返すメソッド - /// - /// - /// - public bool bIsNumber(char Char) { - if ((Char >= '0') && (Char <= '9')) - return true; - else - return false; - } - - /// - /// string型からint型に変換する。 - /// TJAP2から持ってきた。 - /// - private int CharConvertNote(string str) { - return (NotesManager.GetNoteValueFromChar(str)); } - private int strConvertCourse(string str) { - //2016.08.24 kairera0467 - //正規表現を使っているため、easyでもEASYでもOK。 - - // 小文字大文字区別しない正規表現で仮対応。 (AioiLight) - // 相変わらず原始的なやり方だが、正常に動作した。 - string[] Matchptn = new string[7] { "easy", "normal", "hard", "oni", "edit", "tower", "dan" }; - for (int i = 0; i < Matchptn.Length; i++) { - if (Regex.IsMatch(str, Matchptn[i], RegexOptions.IgnoreCase)) { - return i; + string[] strArray = InputText.Split(new char[] { ':' }); + string strCommandName = ""; + string strCommandParam = ""; + + if (strArray.Length == 2) { + strCommandName = strArray[0].Trim(); + strCommandParam = strArray[1].Trim(); + } + + void ParseOptionalInt16(Action setValue) { + this.ParseOptionalInt16(strCommandName, strCommandParam, setValue); + } + + if (strCommandName.Equals("BALLOON") || strCommandName.Equals("BALLOONNOR")) { + ParseBalloon(strCommandParam, this.listBalloon_Normal); + } else if (strCommandName.Equals("BALLOONEXP")) { + ParseBalloon(strCommandParam, this.listBalloon_Expert); + //tbBALLOON.Text = strCommandParam; + } else if (strCommandName.Equals("BALLOONMAS")) { + ParseBalloon(strCommandParam, this.listBalloon_Master); + //tbBALLOON.Text = strCommandParam; + } else if (strCommandName.Equals("SCOREMODE")) { + ParseOptionalInt16(value => this.nScoreModeTmp = value); + } else if (strCommandName.Equals("SCOREINIT")) { + if (!string.IsNullOrEmpty(strCommandParam)) { + string[] scoreinit = strCommandParam.Split(','); + + this.ParseOptionalInt16("SCOREINIT first value", scoreinit[0], value => { + this.nScoreInit[0, this.n参照中の難易度] = value; + this.b配点が指定されている[0, this.n参照中の難易度] = true; + }); + + if (scoreinit.Length == 2) { + this.ParseOptionalInt16("SCOREINIT second value", scoreinit[1], value => { + this.nScoreInit[1, this.n参照中の難易度] = value; + this.b配点が指定されている[2, this.n参照中の難易度] = true; + }); } } - - switch (str) { - case "0": - return 0; - case "1": - return 1; - case "2": - return 2; - case "3": - return 3; - case "4": - return 4; - case "5": - return 5; - case "6": - return 6; - default: - return 3; + } else if (strCommandName.Equals("SCOREDIFF")) { + ParseOptionalInt16(value => { + this.nScoreDiff[this.n参照中の難易度] = value; + this.b配点が指定されている[1, this.n参照中の難易度] = true; + }); + } else if (strCommandName.Equals("SCOREMODE")) { + if (!string.IsNullOrEmpty(strCommandParam)) { + this.nScoreModeTmp = Convert.ToInt16(strCommandParam); } - } - - /// - /// Lyricファイルのパースもどき - /// 自力で作ったので、うまくパースしてくれないかも - /// - /// lrcファイルのパス - private void LyricFileParser(string strFilePath, int ordnumber)//lrcファイルのパース用 + } else if (strCommandName.Equals("SCOREINIT")) { + if (!string.IsNullOrEmpty(strCommandParam)) { + string[] scoreinit = strCommandParam.Split(','); + + this.nScoreInit[0, this.n参照中の難易度] = Convert.ToInt16(scoreinit[0]); + this.b配点が指定されている[0, this.n参照中の難易度] = true; + if (scoreinit.Length == 2) { + this.nScoreInit[1, this.n参照中の難易度] = Convert.ToInt16(scoreinit[1]); + this.b配点が指定されている[2, this.n参照中の難易度] = true; + } + } + } else if (strCommandName.Equals("SCOREDIFF")) { + if (!string.IsNullOrEmpty(strCommandParam)) { + this.nScoreDiff[this.n参照中の難易度] = Convert.ToInt16(strCommandParam); + this.b配点が指定されている[1, this.n参照中の難易度] = true; + } + } + if (this.nScoreModeTmp == 99) //2017.01.28 DD SCOREMODEを入力していない場合のみConfigで設定したモードにする { - string str = CJudgeTextEncoding.ReadTextFile(strFilePath); - var strSplit後 = str.Split(this.dlmtEnter, StringSplitOptions.RemoveEmptyEntries); - Regex timeRegex = new Regex(@"^(\[)(\d{2})(:)(\d{2})([:.])(\d{2})(\])", RegexOptions.Multiline | RegexOptions.Compiled); - Regex timeRegexO = new Regex(@"^(\[)(\d{2})(:)(\d{2})(\])", RegexOptions.Multiline | RegexOptions.Compiled); - List list; - for (int i = 0; i < strSplit後.Length; i++) { - list = new List(); - if (!String.IsNullOrEmpty(strSplit後[i])) { - if (strSplit後[i].StartsWith("[")) { - Match timestring = timeRegex.Match(strSplit後[i]), timestringO = timeRegexO.Match(strSplit後[i]); - while (timestringO.Success || timestring.Success) { - long time; - if (timestring.Success) { - time = Int32.Parse(timestring.Groups[2].Value) * 60000 + Int32.Parse(timestring.Groups[4].Value) * 1000 + Int32.Parse(timestring.Groups[6].Value) * 10; - strSplit後[i] = strSplit後[i].Remove(0, 10); - } else if (timestringO.Success) { - time = Int32.Parse(timestringO.Groups[2].Value) * 60000 + Int32.Parse(timestringO.Groups[4].Value) * 1000; - strSplit後[i] = strSplit後[i].Remove(0, 7); - } else - break; - list.Add(time); - timestring = timeRegex.Match(strSplit後[i]); - timestringO = timeRegexO.Match(strSplit後[i]); - } - strSplit後[i] = strSplit後[i].Replace("\r", "").Replace("\n", ""); + this.nScoreModeTmp = OpenTaiko.ConfigIni.nScoreMode; + } + if (OpenTaiko.ConfigIni.nScoreMode == 3 && !this.b配点が指定されている[2, this.n参照中の難易度]) { //2017.06.04 kairera0467 + this.nScoreModeTmp = 3; + } + } - for (int listindex = 0; listindex < list.Count; listindex++) { - STLYRIC stlrc; - stlrc.Text = strSplit後[i]; - stlrc.TextTex = this.pf歌詞フォント.DrawText(strSplit後[i], OpenTaiko.Skin.Game_Lyric_ForeColor, OpenTaiko.Skin.Game_Lyric_BackColor, null, 30); - stlrc.Time = list[listindex]; - stlrc.index = ordnumber; - this.listLyric2.Add(stlrc); - } - } - } - } - } - - - /// - /// 複素数のパースもどき - /// - private void tParsedComplexNumber(string strScroll, ref double[] dbScroll) { - var cpx = strScroll.ParseComplex(); - dbScroll[0] = cpx[0]; - dbScroll[1] = cpx[1]; + private void tDanExamLoad(string input) { + string[] strArray = input.Split(new char[] { ':' }); + string strCommandName = ""; + string strCommandParam = ""; + + if (strArray.Length == 2) { + strCommandName = strArray[0].Trim(); + strCommandParam = strArray[1].Trim(); } - private void tSetSenotes() { - #region[ list作成 ] - //ひとまずチップだけのリストを作成しておく。 - List list音符のみのリスト; - list音符のみのリスト = new List(); - int nCount = 0; - int dkdkCount = 0; + // Adapt to EXAM until 7, optimise condition - foreach (CChip chip in this.listChip) { - if (NotesManager.IsCommonNote(chip)) { - list音符のみのリスト.Add(chip); - } - } - #endregion - - //時間判定は、「次のチップの発声時刻」から「現在(過去)のチップの発声時刻」で引く必要がある。 - //逆にしてしまうと計算がとてつもないことになるので注意。 - - try { - this.tSenotes_Core_V2(list音符のみのリスト, true); - } catch (Exception ex) { - Trace.TraceError(ex.ToString()); - Trace.TraceError("例外が発生しましたが処理を継続します。 (b67473e4-1930-44f1-b320-4ead5786e74c)"); - } + if (strCommandName.StartsWith("EXAM")) { + if (!string.IsNullOrEmpty(strCommandParam)) { + Exam.Type examType; + int[] examValue; + Exam.Range examRange; + var splitExam = strCommandParam.Split(','); + int examNumber = int.Parse(strCommandName.Substring(4)) - 1; - } - - /// - /// 譜面分岐がある場合はこちらを使う - /// - private void tSetSenotes_branch() { - #region[ list作成 ] - //ひとまずチップだけのリストを作成しておく。 - List list音符のみのリスト; - List list普通譜面のみのリスト; - List list玄人譜面のみのリスト; - List list達人譜面のみのリスト; - list音符のみのリスト = new List(); - list普通譜面のみのリスト = new List(); - list玄人譜面のみのリスト = new List(); - list達人譜面のみのリスト = new List(); - int nCount = 0; - int dkdkCount = 0; + if (examNumber > CExamInfo.cMaxExam) + return; - foreach (CChip chip in this.listChip) { - if (NotesManager.IsCommonNote(chip)) { - list音符のみのリスト.Add(chip); - - switch (chip.nコース) { - case ECourse.eNormal: - list普通譜面のみのリスト.Add(chip); - break; - case ECourse.eExpert: - list玄人譜面のみのリスト.Add(chip); - break; - case ECourse.eMaster: - list達人譜面のみのリスト.Add(chip); - break; - } - } - } - #endregion - - //forで処理。 - for (int n = 0; n < 3; n++) { - switch (n) { - case 0: - list音符のみのリスト = list普通譜面のみのリスト; + switch (splitExam[0]) { + case "g": + examType = Exam.Type.Gauge; break; - case 1: - list音符のみのリスト = list玄人譜面のみのリスト; + case "jp": + examType = Exam.Type.JudgePerfect; break; - case 2: - list音符のみのリスト = list達人譜面のみのリスト; + case "jg": + examType = Exam.Type.JudgeGood; break; - } - - this.tSenotes_Core_V2(list音符のみのリスト, true); - } - - } - - /// - /// コア部分Ver2。TJAP2から移植しただけ。 - /// - /// - private void tSenotes_Core_V2(List list音符のみのリスト, bool ignoreSENote = false) { - const int DATA = 3; - int doco_count = 0; - int[] sort = new int[7]; - double[] time = new double[7]; - double[] scroll = new double[7]; - double time_tmp; - - for (int i = 0; i < list音符のみのリスト.Count; i++) { - for (int j = 0; j < 7; j++) { - if (i + (j - 3) < 0) { - sort[j] = -1; - time[j] = -1000000000; - scroll[j] = 1.0; - } else if (i + (j - 3) >= list音符のみのリスト.Count) { - sort[j] = -1; - time[j] = 1000000000; - scroll[j] = 1.0; - } else { - sort[j] = list音符のみのリスト[i + (j - 3)].nチャンネル番号; - time[j] = list音符のみのリスト[i + (j - 3)].fBMSCROLLTime; - scroll[j] = list音符のみのリスト[i + (j - 3)].dbSCROLL; - } - } - time_tmp = time[DATA]; - for (int j = 0; j < 7; j++) { - time[j] = (time[j] - time_tmp) * scroll[j]; - if (time[j] < 0) time[j] *= -1; - } - - if (ignoreSENote && list音符のみのリスト[i].IsFixedSENote) continue; - - switch (list音符のみのリスト[i].nチャンネル番号) { - case 0x11: - - //(左2より離れている|)_右2_右ドン_右右4_右右ドン… - if ((time[DATA - 1] > 2/* || (sort[DATA-1] != 1 && time[DATA-1] >= 2 && time[DATA-2] >= 4 && time[DATA-3] <= 5)*/) && time[DATA + 1] == 2 && sort[DATA + 1] == 1 && time[DATA + 2] == 4 && sort[DATA + 2] == 0x11 && time[DATA + 3] == 6 && sort[DATA + 3] == 0x11) { - list音符のみのリスト[i].nSenote = 1; - doco_count = 1; - break; - } - //ドコドコ中_左2_右2_右ドン - else if (doco_count != 0 && time[DATA - 1] == 2 && time[DATA + 1] == 2 && (sort[DATA + 1] == 0x11 || sort[DATA + 1] == 0x11)) { - if (doco_count % 2 == 0) - list音符のみのリスト[i].nSenote = 1; - else - list音符のみのリスト[i].nSenote = 2; - doco_count++; - break; - } else { - doco_count = 0; - } - - //8分ドコドン - if ((time[DATA - 2] >= 4.1 && time[DATA - 1] == 2 && time[DATA + 1] == 2 && time[DATA + 2] >= 4.1) && (sort[DATA - 1] == 0x11 && sort[DATA + 1] == 0x11)) { - if (list音符のみのリスト[i].dbBPM >= 120.0) { - list音符のみのリスト[i - 1].nSenote = 1; - list音符のみのリスト[i].nSenote = 2; - list音符のみのリスト[i + 1].nSenote = 0; - break; - } else if (list音符のみのリスト[i].dbBPM < 120.0) { - list音符のみのリスト[i - 1].nSenote = 0; - list音符のみのリスト[i].nSenote = 0; - list音符のみのリスト[i + 1].nSenote = 0; - break; - } - } - - //BPM120以下のみ - //8分間隔の「ドドド」→「ドンドンドン」 - - if (time[DATA - 1] >= 2 && time[DATA + 1] >= 2) { - if (list音符のみのリスト[i].dbBPM < 120.0) { - list音符のみのリスト[i].nSenote = 0; - break; - } - } - - //ドコドコドン - if (time[DATA - 3] >= 3.4 && time[DATA - 2] == 2 && time[DATA - 1] == 1 && time[DATA + 1] == 1 && time[DATA + 2] == 2 && time[DATA + 3] >= 3.4 && sort[DATA - 2] == 0x11 && sort[DATA - 1] == 0x11 && sort[DATA + 1] == 0x11 && sort[DATA + 2] == 0x11) { - list音符のみのリスト[i - 2].nSenote = 1; - list音符のみのリスト[i - 1].nSenote = 2; - list音符のみのリスト[i + 0].nSenote = 1; - list音符のみのリスト[i + 1].nSenote = 2; - list音符のみのリスト[i + 2].nSenote = 0; - i += 2; - //break; - } - //ドコドン - else if (time[DATA - 2] >= 2.4 && time[DATA - 1] == 1 && time[DATA + 1] == 1 && time[DATA + 2] >= 2.4 && sort[DATA - 1] == 0x11 && sort[DATA + 1] == 0x11) { - list音符のみのリスト[i].nSenote = 2; - } - //右の音符が2以上離れている - else if (time[DATA + 1] > 2) { - list音符のみのリスト[i].nSenote = 0; - } - //右の音符が1.4以上_左の音符が1.4以内 - else if (time[DATA + 1] >= 1.4 && time[DATA - 1] <= 1.4) { - list音符のみのリスト[i].nSenote = 0; - } - //右の音符が2以上_右右の音符が3以内 - else if (time[DATA + 1] >= 2 && time[DATA + 2] <= 3) { - list音符のみのリスト[i].nSenote = 0; - } - //右の音符が2以上_大音符 - else if (time[DATA + 1] >= 2 && (sort[DATA + 1] == 0x13 || sort[DATA + 1] == 0x14)) { - list音符のみのリスト[i].nSenote = 0; - } else { - list音符のみのリスト[i].nSenote = 1; - } + case "jb": + examType = Exam.Type.JudgeBad; break; - case 0x12: - doco_count = 0; - - //BPM120以下のみ - //8分間隔の「ドドド」→「ドンドンドン」 - if (time[DATA - 1] == 2 && time[DATA + 1] == 2) { - if (list音符のみのリスト[i - 1].dbBPM < 120.0 && list音符のみのリスト[i].dbBPM < 120.0 && list音符のみのリスト[i + 1].dbBPM < 120.0) { - list音符のみのリスト[i].nSenote = 3; - break; - } - } - - //右の音符が2以上離れている - if (time[DATA + 1] > 2) { - list音符のみのリスト[i].nSenote = 3; - } - //右の音符が1.4以上_左の音符が1.4以内 - else if (time[DATA + 1] >= 1.4 && time[DATA - 1] <= 1.4) { - list音符のみのリスト[i].nSenote = 3; - } - //右の音符が2以上_右右の音符が3以内 - else if (time[DATA + 1] >= 2 && time[DATA + 2] <= 3) { - list音符のみのリスト[i].nSenote = 3; - } - //右の音符が2以上_大音符 - else if (time[DATA + 1] >= 2 && (sort[DATA + 1] == 0x13 || sort[DATA + 1] == 0x14)) { - list音符のみのリスト[i].nSenote = 3; - } else { - list音符のみのリスト[i].nSenote = 4; - } + case "s": + examType = Exam.Type.Score; + break; + case "r": + examType = Exam.Type.Roll; + break; + case "h": + examType = Exam.Type.Hit; + break; + case "c": + examType = Exam.Type.Combo; + break; + case "a": + examType = Exam.Type.Accuracy; + break; + case "ja": + examType = Exam.Type.JudgeADLIB; + break; + case "jm": + examType = Exam.Type.JudgeMine; break; default: - doco_count = 0; + examType = Exam.Type.Gauge; + break; + } + try { + examValue = new int[] { int.Parse(splitExam[1]), int.Parse(splitExam[2]) }; + } catch (Exception) { + examValue = new int[] { 100, 100 }; + } + switch (splitExam[3]) { + case "m": + examRange = Exam.Range.More; + break; + case "l": + examRange = Exam.Range.Less; + break; + default: + examRange = Exam.Range.More; + break; + } + + if (Dan_C[examNumber] == null) + Dan_C[examNumber] = new Dan_C(examType, examValue, examRange); + + if (DanSongs.Number > 0) + List_DanSongs[DanSongs.Number - 1].Dan_C[examNumber] = new Dan_C(examType, examValue, examRange); + } + } + } + + private void ParseOptionalInt16(string name, string unparsedValue, Action setValue) { + if (string.IsNullOrEmpty(unparsedValue)) { + return; + } + + if (short.TryParse(unparsedValue, out var value)) { + setValue(value); + } else { + Trace.TraceWarning($"命令名: {name} のパラメータの値が正しくないことを検知しました。値: {unparsedValue} ({strファイル名の絶対パス})"); + } + } + + + private void ParseBalloon(string strCommandParam, List listBalloon) { + string[] strParam = strCommandParam.Split(','); + for (int n = 0; n < strParam.Length; n++) { + int n打数; + try { + if (strParam[n] == null || strParam[n] == "") + break; + + n打数 = Convert.ToInt32(strParam[n]); + } catch (Exception ex) { + Trace.TraceError($"おや?エラーが出たようです。お兄様。 ({strファイル名の絶対パス})"); + Trace.TraceError(ex.ToString()); + Trace.TraceError("例外が発生しましたが処理を継続します。 (95327158-4e83-4fa9-b5e9-ad3c3d4c2a22)"); + break; + } + + listBalloon.Add(n打数); + } + } + private void t入力_行解析ヘッダ(string InputText) { + //やべー。先頭にコメント行あったらやばいやん。 + string[] strArray = InputText.Split(new char[] { ':' }, 2); + string strCommandName = ""; + string strCommandParam = ""; + + if (InputText.StartsWith("#BRANCHSTART")) { + //2015.08.18 kairera0467 + //本来はヘッダ命令ではありませんが、難易度ごとに違う項目なのでここで読み込ませます。 + //Lengthのチェックをされる前ににif文を入れています。 + this.bHasBranch[this.n参照中の難易度] = true; + + if (this.n参照中の難易度 == (int)Difficulty.Dan) { + this.bHasBranchDan[this.bHasBranchDan.Length - 1] = true; + } + } + + //まずは「:」でSplitして割り当てる。 + if (strArray.Length == 2) { + strCommandName = strArray[0].Trim(); + strCommandParam = strArray[1].Trim(); + } else if (strArray.Length > 2) { + //strArrayが2じゃない場合、ヘッダのSplitを通していない可能性がある。 + //この処理自体は「t入力」を改造したもの。STARTでSplitしていない等、一部の処理が異なる。 + + #region [Header] + InputText = InputText.Replace(Environment.NewLine, "\n"); //改行文字を別の文字列に差し替え。 + InputText = InputText.Replace('\t', ' '); //何の文字か知らないけどスペースに差し替え。 + InputText = InputText + "\n"; + + string[] strDelimiter2 = { "\n" }; + strArray = InputText.Split(strDelimiter2, StringSplitOptions.RemoveEmptyEntries); + + + strArray = strArray[0].Split(new char[] { ':' }); + WarnSplitLength("Header Name & Value", strArray, 2); + + strCommandName = strArray[0].Trim(); + strCommandParam = strArray[1].Trim(); + + #endregion + //lblMessage.Text = "おや?strArrayのLengthが2じゃないようですね。お兄様。"; + } + + void ParseOptionalInt16(Action setValue) { + this.ParseOptionalInt16(strCommandName, strCommandParam, setValue); + } + + //パラメータを分別、そこから割り当てていきます。 + if (strCommandName.Equals("TITLE")) { + this.TITLE.SetString("default", strCommandParam); + } else if (strCommandName.StartsWith("TITLE")) { + string _lang = strCommandName.Substring(5).ToLowerInvariant(); + this.TITLE.SetString(_lang, strCommandParam); + } else if (strCommandName.Equals("SUBTITLE")) { + if (strCommandParam.StartsWith("--") || strCommandParam.StartsWith("++")) + this.SUBTITLE.SetString("default", strCommandParam.Substring(2)); + else + this.SUBTITLE.SetString("default", strCommandParam); + } else if (strCommandName.StartsWith("SUBTITLE")) { + string _lang = strCommandName.Substring(8).ToLowerInvariant(); + this.SUBTITLE.SetString(_lang, strCommandParam); + } else if (strCommandName.Equals("LEVEL")) { + var level_dec = Convert.ToDouble(strCommandParam); + var level = (int)level_dec; + if (strCommandParam != level.ToString()) { + int frac_part = Int32.Parse(level_dec.ToString("0.0", CultureInfo.InvariantCulture).Split('.')[1]); + this.LEVELtaikoIcon[this.n参照中の難易度] = (frac_part >= 5) ? ELevelIcon.ePlus : ELevelIcon.eMinus; + } + this.LEVEL.Drums = (int)level; + this.LEVEL.Taiko = (int)level; + this.LEVELtaiko[this.n参照中の難易度] = (int)level; + } else if (strCommandName.StartsWith("NOTESDESIGNER")) { + this.NOTESDESIGNER[this.n参照中の難易度] = strCommandParam; + } else if (strCommandName.Equals("LIFE")) { + // LIFE here + var life = (int)Convert.ToDouble(strCommandParam); + this.LIFE = life; + } else if (strCommandName.Equals("PREIMAGE")) { + this.PREIMAGE = strCommandParam; + } else if (strCommandName.Equals("TOWERTYPE")) { + this.TOWERTYPE = strCommandParam; + } else if (strCommandName.Equals("DANTICK")) { + var tick = (int)Convert.ToDouble(strCommandParam); + this.DANTICK = tick; + } else if (strCommandName.Equals("DANTICKCOLOR")) { + var tickcolor = ColorTranslator.FromHtml(strCommandParam); + this.DANTICKCOLOR = tickcolor; + } else if (strCommandName.Equals("BPM")) { + if (strCommandParam.IndexOf(",") != -1) + strCommandParam = strCommandParam.Replace(',', '.'); + + double dbBPM = Convert.ToDouble(strCommandParam); + this.BPM = dbBPM; + this.BASEBPM = dbBPM; + this.MinBPM = dbBPM; + this.MaxBPM = dbBPM; + this.dbNowBPM = dbBPM; + + this.listBPM.Add(this.n内部番号BPM1to - 1, new CBPM() { n内部番号 = this.n内部番号BPM1to - 1, n表記上の番号 = this.n内部番号BPM1to - 1, dbBPM値 = dbBPM, }); + this.n内部番号BPM1to++; + + + //チップ追加して割り込んでみる。 + var chip = new CChip(); + + chip.nチャンネル番号 = 0x03; + chip.n発声位置 = ((this.n現在の小節数 - 1) * 384); + chip.n整数値 = 0x00; + chip.n整数値_内部番号 = 1; + + this.listChip.Add(chip); + //tbBPM.Text = strCommandParam; + } else if (strCommandName.Equals("WAVE")) { + if (strBGM_PATH != null) { + Trace.TraceWarning($"{nameof(CDTX)} is ignoring an extra WAVE header in {this.strファイル名の絶対パス}"); + } else { + this.strBGM_PATH = CDTXCompanionFileFinder.FindFileName(this.strフォルダ名, strファイル名, strCommandParam); + //tbWave.Text = strCommandParam; + if (this.listWAV != null) { + // 2018-08-27 twopointzero - DO attempt to load (or queue scanning) loudness metadata here. + // TJAP3 is either launching, enumerating songs, or is about to + // begin playing a song. If metadata is available, we want it now. + // If is not yet available then we wish to queue scanning. + var absoluteBgmPath = Path.Combine(this.strフォルダ名, this.strBGM_PATH); + this.SongLoudnessMetadata = LoudnessMetadataScanner.LoadForAudioPath(absoluteBgmPath); + + var wav = new CWAV() { + n内部番号 = this.n内部番号WAV1to, + n表記上の番号 = 1, + nチップサイズ = this.n無限管理SIZE[this.n内部番号WAV1to], + n位置 = this.n無限管理PAN[this.n内部番号WAV1to], + SongVol = this.SongVol, + SongLoudnessMetadata = this.SongLoudnessMetadata, + strファイル名 = this.strBGM_PATH, + strコメント文 = "TJA BGM", + }; + + this.listWAV.Add(this.n内部番号WAV1to, wav); + this.n内部番号WAV1to++; + } + } + } else if (strCommandName.Equals("OFFSET") && !string.IsNullOrEmpty(strCommandParam)) { + this.nOFFSET = (int)(Convert.ToDouble(strCommandParam) * 1000); + + this.bOFFSETの値がマイナスである = this.nOFFSET < 0 ? true : false; + + this.listBPM[0].bpm_change_bmscroll_time = -2000 * this.dbNowBPM / 15000; + if (this.bOFFSETの値がマイナスである == true) + this.nOFFSET = this.nOFFSET * -1; //OFFSETは秒を加算するので、必ず正の数にすること。 + //tbOFFSET.Text = strCommandParam; + + // Substract global offset + this.nOFFSET += ((this.bOFFSETの値がマイナスである == true) ? -OpenTaiko.ConfigIni.nGlobalOffsetMs : OpenTaiko.ConfigIni.nGlobalOffsetMs); + } else if (strCommandName.Equals("MOVIEOFFSET")) { + this.nMOVIEOFFSET = (int)(Convert.ToDouble(strCommandParam) * 1000); + this.bMOVIEOFFSETの値がマイナスである = this.nMOVIEOFFSET < 0 ? true : false; + + if (this.bMOVIEOFFSETの値がマイナスである == true) + this.nMOVIEOFFSET = this.nMOVIEOFFSET * -1; //OFFSETは秒を加算するので、必ず正の数にすること。 + //tbOFFSET.Text = strCommandParam; + } + #region[移動→不具合が起こるのでここも一応復活させておく] + else if (strCommandName.Equals("BALLOON") || strCommandName.Equals("BALLOONNOR")) { + ParseBalloon(strCommandParam, this.listBalloon_Normal); + } else if (strCommandName.Equals("BALLOONEXP")) { + ParseBalloon(strCommandParam, this.listBalloon_Expert); + //tbBALLOON.Text = strCommandParam; + } else if (strCommandName.Equals("BALLOONMAS")) { + ParseBalloon(strCommandParam, this.listBalloon_Master); + //tbBALLOON.Text = strCommandParam; + } else if (strCommandName.Equals("SCOREMODE")) { + ParseOptionalInt16(value => this.nScoreModeTmp = value); + } else if (strCommandName.Equals("SCOREINIT")) { + if (!string.IsNullOrEmpty(strCommandParam)) { + string[] scoreinit = strCommandParam.Split(','); + + this.ParseOptionalInt16("SCOREINIT first value", scoreinit[0], value => { + this.nScoreInit[0, this.n参照中の難易度] = value; + }); + + if (scoreinit.Length == 2) { + this.ParseOptionalInt16("SCOREINIT second value", scoreinit[1], value => { + this.nScoreInit[1, this.n参照中の難易度] = value; + }); + } + } + } else if (strCommandName.Equals("GAUGEINCR")) { + if (!string.IsNullOrEmpty(strCommandParam)) { + switch (strCommandParam.ToLower()) { + case "normal": + GaugeIncreaseMode = GaugeIncreaseMode.Normal; + break; + case "floor": + GaugeIncreaseMode = GaugeIncreaseMode.Floor; + break; + case "round": + GaugeIncreaseMode = GaugeIncreaseMode.Round; + break; + case "ceiling": + GaugeIncreaseMode = GaugeIncreaseMode.Ceiling; + break; + case "notfix": + GaugeIncreaseMode = GaugeIncreaseMode.NotFix; + break; + default: + GaugeIncreaseMode = GaugeIncreaseMode.Normal; break; } } - } - - /// - /// サウンドミキサーにサウンドを登録_削除する時刻を事前に算出する - /// - public void PlanToAddMixerChannel() { - if (OpenTaiko.SoundManager.GetCurrentSoundDeviceType() == "DirectSound") // DShowでの再生の場合はミキシング負荷が高くないため、 - { // チップのライフタイム管理を行わない - return; + } else if (strCommandName.Equals("SCOREDIFF")) { + ParseOptionalInt16(value => this.nScoreDiff[this.n参照中の難易度] = value); + } + #endregion + else if (strCommandName.Equals("SONGVOL") && !string.IsNullOrEmpty(strCommandParam)) { + this.SongVol = Convert.ToInt32(strCommandParam).Clamp(CSound.MinimumSongVol, CSound.MaximumSongVol); + + foreach (var kvp in this.listWAV) { + kvp.Value.SongVol = this.SongVol; + } + } else if (strCommandName.Equals("SEVOL")) { + //tbSeVol.Text = strCommandParam; + } else if (strCommandName.Equals("COURSE")) { + if (!string.IsNullOrEmpty(strCommandParam)) { + //this.n参照中の難易度 = Convert.ToInt16( strCommandParam ); + this.n参照中の難易度 = this.strConvertCourse(strCommandParam); + } + } else if (strCommandName.Equals("HEADSCROLL")) { + //新定義:初期スクロール速度設定(というよりこのシステムに合わせるには必須。) + //どうしても一番最初に1小節挿入されるから、こうするしかなかったんだ___ + + this.dbScrollSpeed = Convert.ToDouble(strCommandParam); + + this.listSCROLL.Add(this.n内部番号SCROLL1to, new CSCROLL() { n内部番号 = this.n内部番号SCROLL1to, n表記上の番号 = 0, dbSCROLL値 = this.dbScrollSpeed, }); + + + //チップ追加して割り込んでみる。 + var chip = new CChip(); + + chip.nチャンネル番号 = 0x9D; + chip.n発声位置 = ((this.n現在の小節数 - 2) * 384); + chip.n整数値 = 0x00; + chip.n整数値_内部番号 = this.n内部番号SCROLL1to; + chip.dbSCROLL = this.dbScrollSpeed; + + // チップを配置。 + + this.listChip.Add(chip); + this.n内部番号SCROLL1to++; + + //this.nScoreDiff = Convert.ToInt16( strCommandParam ); + //tbScoreDiff.Text = strCommandParam; + } else if (strCommandName.Equals("GENRE")) { + //2015.03.28 kairera0467 + //ジャンルの定義。DTXから入力もできるが、tjaからも入力できるようにする。 + //日本語名だと選曲画面でバグが出るので、そこもどうにかしていく予定。 + + if (!string.IsNullOrEmpty(strCommandParam)) { + this.GENRE = strCommandParam; + } + } else if (strCommandName.Equals("MAKER")) { + if (!string.IsNullOrEmpty(strCommandParam)) { + this.MAKER = strCommandParam; + } + } else if (strCommandName.Equals("SIDE")) { + if (!string.IsNullOrEmpty(strCommandParam) && strCommandParam.Equals("Normal")) + this.SIDE = ESide.eNormal; + } else if (strCommandName.Equals("EXPLICIT")) { + if (!string.IsNullOrEmpty(strCommandParam)) { + this.EXPLICIT = CConversion.bONorOFF(strCommandParam[0]); + } + } else if (strCommandName.Equals("SELECTBG")) { + if (!string.IsNullOrEmpty(strCommandParam)) { + this.SELECTBG = strCommandParam; + } + } else if (strCommandName.Equals("SCENEPRESET")) { + if (!string.IsNullOrEmpty(strCommandParam)) { + this.scenePreset = strCommandParam; + } + } else if (strCommandName.Equals("DEMOSTART")) { + //2015.04.10 kairera0467 + + if (!string.IsNullOrEmpty(strCommandParam)) { + int nOFFSETms; + try { + nOFFSETms = (int)(Convert.ToDouble(strCommandParam) * 1000.0); + } catch { + nOFFSETms = 0; + } + + + this.nデモBGMオフセット = nOFFSETms; + } + } else if (strCommandName.Equals("BGMOVIE")) { + //2016.02.02 kairera0467 + //背景動画の定義。DTXから入力もできるが、tjaからも入力できるようにする。 + + if (!string.IsNullOrEmpty(strCommandParam)) { + this.strBGVIDEO_PATH = + CDTXCompanionFileFinder.FindFileName(this.strフォルダ名, strファイル名, strCommandParam); } - List listAddMixerChannel = new List(128); ; - List listRemoveMixerChannel = new List(128); - List listRemoveTiming = new List(128); + string strVideoFilename; + if (!string.IsNullOrEmpty(this.PATH_WAV)) + strVideoFilename = this.PATH_WAV + this.strBGVIDEO_PATH; + else + strVideoFilename = this.strフォルダ名 + this.strBGVIDEO_PATH; - foreach (CChip pChip in listChip) { - switch (pChip.nチャンネル番号) { - // BGM, 演奏チャネル, 不可視サウンド, フィルインサウンド, 空打ち音はミキサー管理の対象 - // BGM: - case 0x01: - // Dr演奏チャネル - //case 0x11: case 0x12: case 0x13: case 0x14: case 0x15: case 0x16: case 0x17: case 0x18: case 0x19: case 0x1A: case 0x1B: case 0x1C: - // Gt演奏チャネル - //case 0x20: case 0x21: case 0x22: case 0x23: case 0x24: case 0x25: case 0x26: case 0x27: case 0x28: - // Bs演奏チャネル - //case 0xA0: case 0xA1: case 0xA2: case 0xA3: case 0xA4: case 0xA5: case 0xA6: case 0xA7: case 0xA8: - // Dr不可視チップ - //case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: - //case 0x38: case 0x39: case 0x3A: - // Dr/Gt/Bs空打ち - //case 0xB1: case 0xB2: case 0xB3: case 0xB4: case 0xB5: case 0xB6: case 0xB7: case 0xB8: - //case 0xB9: case 0xBA: case 0xBB: case 0xBC: - // フィルインサウンド - //case 0x1F: case 0x2F: case 0xAF: - // 自動演奏チップ - //case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: case 0x68: case 0x69: - //case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: case 0x78: case 0x79: - //case 0x80: case 0x81: case 0x82: case 0x83: case 0x84: case 0x85: case 0x86: case 0x87: case 0x88: case 0x89: - //case 0x90: case 0x91: case 0x92: - - #region [ 発音1秒前のタイミングを算出 ] - int n発音前余裕ms = 1000, n発音後余裕ms = 800; { - int ch = pChip.nチャンネル番号 >> 4; - if (ch == 0x02 || ch == 0x0A) { - n発音前余裕ms = 800; - n発音前余裕ms = 500; - } - if (ch == 0x06 || ch == 0x07 || ch == 0x08 || ch == 0x09) { - n発音前余裕ms = 200; - n発音前余裕ms = 500; - } - } - #endregion - #region [ 発音1秒前のタイミングを算出 ] - int nAddMixer時刻ms, nAddMixer位置 = 0; - t発声時刻msと発声位置を取得する(pChip.n発声時刻ms - n発音前余裕ms, out nAddMixer時刻ms, out nAddMixer位置); + try { + CVideoDecoder vd = new CVideoDecoder(strVideoFilename); - CChip c_AddMixer = new CChip() { - nチャンネル番号 = 0xDA, + if (this.listVD.ContainsKey(1)) + this.listVD.Remove(1); + + this.listVD.Add(1, vd); + } catch (Exception e) { + Trace.TraceWarning(e.ToString() + "\n" + + "動画のデコーダー生成で例外が発生しましたが、処理を継続します。"); + if (this.listVD.ContainsKey(1)) + this.listVD.Remove(1); + } + } else if (strCommandName.Contains("BGA")) { + //2016.02.02 kairera0467 + //背景動画の定義。DTXから入力もできるが、tjaからも入力できるようにする。 + + string videoPath = ""; + if (!string.IsNullOrEmpty(strCommandParam)) { + videoPath = + CDTXCompanionFileFinder.FindFileName(this.strフォルダ名, strファイル名, strCommandParam); + } + + string strVideoFilename; + if (!string.IsNullOrEmpty(this.PATH_WAV)) + strVideoFilename = this.PATH_WAV + videoPath; + else + strVideoFilename = this.strフォルダ名 + videoPath; + + try { + CVideoDecoder vd = new CVideoDecoder(strVideoFilename); + + var indexText = strCommandName.Remove(0, 3); + + this.listVD.Add((10 * int.Parse(indexText[0].ToString())) + int.Parse(indexText[1].ToString()) + 2, vd); + } catch (Exception e) { + Trace.TraceWarning(e.ToString() + "\n" + + "動画のデコーダー生成で例外が発生しましたが、処理を継続します。"); + if (this.listVD.ContainsKey(1)) + this.listVD.Remove(1); + } + } else if (strCommandName.Equals("BGIMAGE")) { + //2016.02.02 kairera0467 + if (!string.IsNullOrEmpty(strCommandParam)) { + this.strBGIMAGE_PATH = strCommandParam; + } + } else if (strCommandName.Equals("HIDDENBRANCH")) { + //2016.04.01 kairera0467 パラメーターは + if (!string.IsNullOrEmpty(strCommandParam)) { + this.bHIDDENBRANCH = true; + } + } else if (strCommandName.Equals("LYRICS") && !usingLyricsFile && OpenTaiko.ConfigIni.nPlayerCount < 4) { + if (!string.IsNullOrEmpty(strCommandParam)) { + string[] files = SplitComma(strCommandParam); + string[] filePaths = new string[files.Length]; + for (int i = 0; i < files.Length; i++) { + filePaths[i] = this.strフォルダ名 + files[i]; + + if (File.Exists(filePaths[i])) { + try { + if (OpenTaiko.r現在のステージ.eStageID == CStage.EStage.SongLoading) { + if (filePaths[i].EndsWith(".vtt")) { + using (VTTParser parser = new VTTParser()) { + this.listLyric2.AddRange(parser.ParseVTTFile(filePaths[i], 0, 0)); + } + this.bLyrics = true; + this.usingLyricsFile = true; + } else if (filePaths[i].EndsWith(".lrc")) { + this.LyricFileParser(filePaths[i], i); + this.bLyrics = true; + this.usingLyricsFile = true; + } + } + } catch (Exception e) { + Trace.TraceError("Something went wrong while parsing a lyric file at {0}. More details : {1}", filePaths[i], e); + } + } + } + } + } else if (strCommandName.Equals("LYRICFILE") && !usingLyricsFile && OpenTaiko.ConfigIni.nPlayerCount < 4) { + if (!string.IsNullOrEmpty(strCommandParam)) { + string[] strFiles = SplitComma(strCommandParam); + string[] strFilePath = new string[strFiles.Length]; + for (int index = 0; index < strFiles.Length; index++) { + strFilePath[index] = this.strフォルダ名 + strFiles[index]; + if (File.Exists(strFilePath[index])) { + try { + if (OpenTaiko.r現在のステージ.eStageID == CStage.EStage.SongLoading)//起動時に重たくなってしまう問題の修正用 + this.LyricFileParser(strFilePath[index], index); + this.bLyrics = true; + this.usingLyricsFile = true; + } catch { + Console.WriteLine("lrcファイルNo.{0}の読み込みに失敗しましたが、", index); + Console.WriteLine("処理を続行します。"); + } + } + } + } + } + if (this.nScoreModeTmp == 99) { + //2017.01.28 DD + this.nScoreModeTmp = OpenTaiko.ConfigIni.nScoreMode; + } + } + /// + /// 指定した文字が数値かを返すメソッド + /// + /// + /// + public bool bIsNumber(char Char) { + if ((Char >= '0') && (Char <= '9')) + return true; + else + return false; + } + + /// + /// string型からint型に変換する。 + /// TJAP2から持ってきた。 + /// + private int CharConvertNote(string str) { + return (NotesManager.GetNoteValueFromChar(str)); + } + + private int strConvertCourse(string str) { + //2016.08.24 kairera0467 + //正規表現を使っているため、easyでもEASYでもOK。 + + // 小文字大文字区別しない正規表現で仮対応。 (AioiLight) + // 相変わらず原始的なやり方だが、正常に動作した。 + string[] Matchptn = new string[7] { "easy", "normal", "hard", "oni", "edit", "tower", "dan" }; + for (int i = 0; i < Matchptn.Length; i++) { + if (Regex.IsMatch(str, Matchptn[i], RegexOptions.IgnoreCase)) { + return i; + } + } + + switch (str) { + case "0": + return 0; + case "1": + return 1; + case "2": + return 2; + case "3": + return 3; + case "4": + return 4; + case "5": + return 5; + case "6": + return 6; + default: + return 3; + } + } + + /// + /// Lyricファイルのパースもどき + /// 自力で作ったので、うまくパースしてくれないかも + /// + /// lrcファイルのパス + private void LyricFileParser(string strFilePath, int ordnumber)//lrcファイルのパース用 + { + string str = CJudgeTextEncoding.ReadTextFile(strFilePath); + var strSplit後 = str.Split(this.dlmtEnter, StringSplitOptions.RemoveEmptyEntries); + Regex timeRegex = new Regex(@"^(\[)(\d{2})(:)(\d{2})([:.])(\d{2})(\])", RegexOptions.Multiline | RegexOptions.Compiled); + Regex timeRegexO = new Regex(@"^(\[)(\d{2})(:)(\d{2})(\])", RegexOptions.Multiline | RegexOptions.Compiled); + List list; + for (int i = 0; i < strSplit後.Length; i++) { + list = new List(); + if (!String.IsNullOrEmpty(strSplit後[i])) { + if (strSplit後[i].StartsWith("[")) { + Match timestring = timeRegex.Match(strSplit後[i]), timestringO = timeRegexO.Match(strSplit後[i]); + while (timestringO.Success || timestring.Success) { + long time; + if (timestring.Success) { + time = Int32.Parse(timestring.Groups[2].Value) * 60000 + Int32.Parse(timestring.Groups[4].Value) * 1000 + Int32.Parse(timestring.Groups[6].Value) * 10; + strSplit後[i] = strSplit後[i].Remove(0, 10); + } else if (timestringO.Success) { + time = Int32.Parse(timestringO.Groups[2].Value) * 60000 + Int32.Parse(timestringO.Groups[4].Value) * 1000; + strSplit後[i] = strSplit後[i].Remove(0, 7); + } else + break; + list.Add(time); + timestring = timeRegex.Match(strSplit後[i]); + timestringO = timeRegexO.Match(strSplit後[i]); + } + strSplit後[i] = strSplit後[i].Replace("\r", "").Replace("\n", ""); + + for (int listindex = 0; listindex < list.Count; listindex++) { + STLYRIC stlrc; + stlrc.Text = strSplit後[i]; + stlrc.TextTex = this.pf歌詞フォント.DrawText(strSplit後[i], OpenTaiko.Skin.Game_Lyric_ForeColor, OpenTaiko.Skin.Game_Lyric_BackColor, null, 30); + stlrc.Time = list[listindex]; + stlrc.index = ordnumber; + this.listLyric2.Add(stlrc); + } + } + } + } + } + + + /// + /// 複素数のパースもどき + /// + private void tParsedComplexNumber(string strScroll, ref double[] dbScroll) { + var cpx = strScroll.ParseComplex(); + dbScroll[0] = cpx[0]; + dbScroll[1] = cpx[1]; + } + + private void tSetSenotes() { + #region[ list作成 ] + //ひとまずチップだけのリストを作成しておく。 + List list音符のみのリスト; + list音符のみのリスト = new List(); + int nCount = 0; + int dkdkCount = 0; + + foreach (CChip chip in this.listChip) { + if (NotesManager.IsCommonNote(chip)) { + list音符のみのリスト.Add(chip); + } + } + #endregion + + //時間判定は、「次のチップの発声時刻」から「現在(過去)のチップの発声時刻」で引く必要がある。 + //逆にしてしまうと計算がとてつもないことになるので注意。 + + try { + this.tSenotes_Core_V2(list音符のみのリスト, true); + } catch (Exception ex) { + Trace.TraceError(ex.ToString()); + Trace.TraceError("例外が発生しましたが処理を継続します。 (b67473e4-1930-44f1-b320-4ead5786e74c)"); + } + + } + + /// + /// 譜面分岐がある場合はこちらを使う + /// + private void tSetSenotes_branch() { + #region[ list作成 ] + //ひとまずチップだけのリストを作成しておく。 + List list音符のみのリスト; + List list普通譜面のみのリスト; + List list玄人譜面のみのリスト; + List list達人譜面のみのリスト; + list音符のみのリスト = new List(); + list普通譜面のみのリスト = new List(); + list玄人譜面のみのリスト = new List(); + list達人譜面のみのリスト = new List(); + int nCount = 0; + int dkdkCount = 0; + + foreach (CChip chip in this.listChip) { + if (NotesManager.IsCommonNote(chip)) { + list音符のみのリスト.Add(chip); + + switch (chip.nコース) { + case ECourse.eNormal: + list普通譜面のみのリスト.Add(chip); + break; + case ECourse.eExpert: + list玄人譜面のみのリスト.Add(chip); + break; + case ECourse.eMaster: + list達人譜面のみのリスト.Add(chip); + break; + } + } + } + #endregion + + //forで処理。 + for (int n = 0; n < 3; n++) { + switch (n) { + case 0: + list音符のみのリスト = list普通譜面のみのリスト; + break; + case 1: + list音符のみのリスト = list玄人譜面のみのリスト; + break; + case 2: + list音符のみのリスト = list達人譜面のみのリスト; + break; + } + + this.tSenotes_Core_V2(list音符のみのリスト, true); + } + + } + + /// + /// コア部分Ver2。TJAP2から移植しただけ。 + /// + /// + private void tSenotes_Core_V2(List list音符のみのリスト, bool ignoreSENote = false) { + const int DATA = 3; + int doco_count = 0; + int[] sort = new int[7]; + double[] time = new double[7]; + double[] scroll = new double[7]; + double time_tmp; + + for (int i = 0; i < list音符のみのリスト.Count; i++) { + for (int j = 0; j < 7; j++) { + if (i + (j - 3) < 0) { + sort[j] = -1; + time[j] = -1000000000; + scroll[j] = 1.0; + } else if (i + (j - 3) >= list音符のみのリスト.Count) { + sort[j] = -1; + time[j] = 1000000000; + scroll[j] = 1.0; + } else { + sort[j] = list音符のみのリスト[i + (j - 3)].nチャンネル番号; + time[j] = list音符のみのリスト[i + (j - 3)].fBMSCROLLTime; + scroll[j] = list音符のみのリスト[i + (j - 3)].dbSCROLL; + } + } + time_tmp = time[DATA]; + for (int j = 0; j < 7; j++) { + time[j] = (time[j] - time_tmp) * scroll[j]; + if (time[j] < 0) time[j] *= -1; + } + + if (ignoreSENote && list音符のみのリスト[i].IsFixedSENote) continue; + + switch (list音符のみのリスト[i].nチャンネル番号) { + case 0x11: + + //(左2より離れている|)_右2_右ドン_右右4_右右ドン… + if ((time[DATA - 1] > 2/* || (sort[DATA-1] != 1 && time[DATA-1] >= 2 && time[DATA-2] >= 4 && time[DATA-3] <= 5)*/) && time[DATA + 1] == 2 && sort[DATA + 1] == 1 && time[DATA + 2] == 4 && sort[DATA + 2] == 0x11 && time[DATA + 3] == 6 && sort[DATA + 3] == 0x11) { + list音符のみのリスト[i].nSenote = 1; + doco_count = 1; + break; + } + //ドコドコ中_左2_右2_右ドン + else if (doco_count != 0 && time[DATA - 1] == 2 && time[DATA + 1] == 2 && (sort[DATA + 1] == 0x11 || sort[DATA + 1] == 0x11)) { + if (doco_count % 2 == 0) + list音符のみのリスト[i].nSenote = 1; + else + list音符のみのリスト[i].nSenote = 2; + doco_count++; + break; + } else { + doco_count = 0; + } + + //8分ドコドン + if ((time[DATA - 2] >= 4.1 && time[DATA - 1] == 2 && time[DATA + 1] == 2 && time[DATA + 2] >= 4.1) && (sort[DATA - 1] == 0x11 && sort[DATA + 1] == 0x11)) { + if (list音符のみのリスト[i].dbBPM >= 120.0) { + list音符のみのリスト[i - 1].nSenote = 1; + list音符のみのリスト[i].nSenote = 2; + list音符のみのリスト[i + 1].nSenote = 0; + break; + } else if (list音符のみのリスト[i].dbBPM < 120.0) { + list音符のみのリスト[i - 1].nSenote = 0; + list音符のみのリスト[i].nSenote = 0; + list音符のみのリスト[i + 1].nSenote = 0; + break; + } + } + + //BPM120以下のみ + //8分間隔の「ドドド」→「ドンドンドン」 + + if (time[DATA - 1] >= 2 && time[DATA + 1] >= 2) { + if (list音符のみのリスト[i].dbBPM < 120.0) { + list音符のみのリスト[i].nSenote = 0; + break; + } + } + + //ドコドコドン + if (time[DATA - 3] >= 3.4 && time[DATA - 2] == 2 && time[DATA - 1] == 1 && time[DATA + 1] == 1 && time[DATA + 2] == 2 && time[DATA + 3] >= 3.4 && sort[DATA - 2] == 0x11 && sort[DATA - 1] == 0x11 && sort[DATA + 1] == 0x11 && sort[DATA + 2] == 0x11) { + list音符のみのリスト[i - 2].nSenote = 1; + list音符のみのリスト[i - 1].nSenote = 2; + list音符のみのリスト[i + 0].nSenote = 1; + list音符のみのリスト[i + 1].nSenote = 2; + list音符のみのリスト[i + 2].nSenote = 0; + i += 2; + //break; + } + //ドコドン + else if (time[DATA - 2] >= 2.4 && time[DATA - 1] == 1 && time[DATA + 1] == 1 && time[DATA + 2] >= 2.4 && sort[DATA - 1] == 0x11 && sort[DATA + 1] == 0x11) { + list音符のみのリスト[i].nSenote = 2; + } + //右の音符が2以上離れている + else if (time[DATA + 1] > 2) { + list音符のみのリスト[i].nSenote = 0; + } + //右の音符が1.4以上_左の音符が1.4以内 + else if (time[DATA + 1] >= 1.4 && time[DATA - 1] <= 1.4) { + list音符のみのリスト[i].nSenote = 0; + } + //右の音符が2以上_右右の音符が3以内 + else if (time[DATA + 1] >= 2 && time[DATA + 2] <= 3) { + list音符のみのリスト[i].nSenote = 0; + } + //右の音符が2以上_大音符 + else if (time[DATA + 1] >= 2 && (sort[DATA + 1] == 0x13 || sort[DATA + 1] == 0x14)) { + list音符のみのリスト[i].nSenote = 0; + } else { + list音符のみのリスト[i].nSenote = 1; + } + break; + case 0x12: + doco_count = 0; + + //BPM120以下のみ + //8分間隔の「ドドド」→「ドンドンドン」 + if (time[DATA - 1] == 2 && time[DATA + 1] == 2) { + if (list音符のみのリスト[i - 1].dbBPM < 120.0 && list音符のみのリスト[i].dbBPM < 120.0 && list音符のみのリスト[i + 1].dbBPM < 120.0) { + list音符のみのリスト[i].nSenote = 3; + break; + } + } + + //右の音符が2以上離れている + if (time[DATA + 1] > 2) { + list音符のみのリスト[i].nSenote = 3; + } + //右の音符が1.4以上_左の音符が1.4以内 + else if (time[DATA + 1] >= 1.4 && time[DATA - 1] <= 1.4) { + list音符のみのリスト[i].nSenote = 3; + } + //右の音符が2以上_右右の音符が3以内 + else if (time[DATA + 1] >= 2 && time[DATA + 2] <= 3) { + list音符のみのリスト[i].nSenote = 3; + } + //右の音符が2以上_大音符 + else if (time[DATA + 1] >= 2 && (sort[DATA + 1] == 0x13 || sort[DATA + 1] == 0x14)) { + list音符のみのリスト[i].nSenote = 3; + } else { + list音符のみのリスト[i].nSenote = 4; + } + break; + default: + doco_count = 0; + break; + } + } + } + + /// + /// サウンドミキサーにサウンドを登録_削除する時刻を事前に算出する + /// + public void PlanToAddMixerChannel() { + if (OpenTaiko.SoundManager.GetCurrentSoundDeviceType() == "DirectSound") // DShowでの再生の場合はミキシング負荷が高くないため、 + { // チップのライフタイム管理を行わない + return; + } + + List listAddMixerChannel = new List(128); ; + List listRemoveMixerChannel = new List(128); + List listRemoveTiming = new List(128); + + foreach (CChip pChip in listChip) { + switch (pChip.nチャンネル番号) { + // BGM, 演奏チャネル, 不可視サウンド, フィルインサウンド, 空打ち音はミキサー管理の対象 + // BGM: + case 0x01: + // Dr演奏チャネル + //case 0x11: case 0x12: case 0x13: case 0x14: case 0x15: case 0x16: case 0x17: case 0x18: case 0x19: case 0x1A: case 0x1B: case 0x1C: + // Gt演奏チャネル + //case 0x20: case 0x21: case 0x22: case 0x23: case 0x24: case 0x25: case 0x26: case 0x27: case 0x28: + // Bs演奏チャネル + //case 0xA0: case 0xA1: case 0xA2: case 0xA3: case 0xA4: case 0xA5: case 0xA6: case 0xA7: case 0xA8: + // Dr不可視チップ + //case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: + //case 0x38: case 0x39: case 0x3A: + // Dr/Gt/Bs空打ち + //case 0xB1: case 0xB2: case 0xB3: case 0xB4: case 0xB5: case 0xB6: case 0xB7: case 0xB8: + //case 0xB9: case 0xBA: case 0xBB: case 0xBC: + // フィルインサウンド + //case 0x1F: case 0x2F: case 0xAF: + // 自動演奏チップ + //case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: case 0x68: case 0x69: + //case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: case 0x78: case 0x79: + //case 0x80: case 0x81: case 0x82: case 0x83: case 0x84: case 0x85: case 0x86: case 0x87: case 0x88: case 0x89: + //case 0x90: case 0x91: case 0x92: + + #region [ 発音1秒前のタイミングを算出 ] + int n発音前余裕ms = 1000, n発音後余裕ms = 800; { + int ch = pChip.nチャンネル番号 >> 4; + if (ch == 0x02 || ch == 0x0A) { + n発音前余裕ms = 800; + n発音前余裕ms = 500; + } + if (ch == 0x06 || ch == 0x07 || ch == 0x08 || ch == 0x09) { + n発音前余裕ms = 200; + n発音前余裕ms = 500; + } + } + #endregion + #region [ 発音1秒前のタイミングを算出 ] + int nAddMixer時刻ms, nAddMixer位置 = 0; + t発声時刻msと発声位置を取得する(pChip.n発声時刻ms - n発音前余裕ms, out nAddMixer時刻ms, out nAddMixer位置); + + CChip c_AddMixer = new CChip() { + nチャンネル番号 = 0xDA, + n整数値 = pChip.n整数値, + n整数値_内部番号 = pChip.n整数値_内部番号, + n発声時刻ms = nAddMixer時刻ms, + n発声位置 = nAddMixer位置, + b演奏終了後も再生が続くチップである = false + }; + listAddMixerChannel.Add(c_AddMixer); + #endregion + + int duration = 0; + if (listWAV.TryGetValue(pChip.n整数値_内部番号, out CDTX.CWAV wc)) { + double _db再生速度 = this.db再生速度; + duration = (wc.rSound[0] == null) ? 0 : (int)(wc.rSound[0].TotalPlayTime / _db再生速度); // #23664 durationに再生速度が加味されておらず、低速再生でBGMが途切れる問題を修正 (発声時刻msは、DTX読み込み時に再生速度加味済) + } + int n新RemoveMixer時刻ms, n新RemoveMixer位置; + t発声時刻msと発声位置を取得する(pChip.n発声時刻ms + duration + n発音後余裕ms, out n新RemoveMixer時刻ms, out n新RemoveMixer位置); + if (n新RemoveMixer時刻ms < pChip.n発声時刻ms + duration) // 曲の最後でサウンドが切れるような場合は + { + CChip c_AddMixer_noremove = c_AddMixer; + c_AddMixer_noremove.b演奏終了後も再生が続くチップである = true; + listAddMixerChannel[listAddMixerChannel.Count - 1] = c_AddMixer_noremove; + break; + } + + #region [ 発音終了2秒後にmixerから削除するが、その前に再発音することになるのかを確認(再発音ならmixer削除タイミングを延期) ] + int n整数値 = pChip.n整数値; + int index = listRemoveTiming.FindIndex( + delegate (CChip cchip) { return cchip.n整数値 == n整数値; } + ); + if (index >= 0) // 過去に同じチップで発音中のものが見つかった場合 + { // 過去の発音のmixer削除を確定させるか、延期するかの2択。 + int n旧RemoveMixer時刻ms = listRemoveTiming[index].n発声時刻ms; + int n旧RemoveMixer位置 = listRemoveTiming[index].n発声位置; + + if (pChip.n発声時刻ms - n発音前余裕ms <= n旧RemoveMixer時刻ms) // mixer削除前に、同じ音の再発音がある場合は、 + { // mixer削除時刻を遅延させる(if-else後に行う) + //Debug.WriteLine( "remove TAIL of listAddMixerChannel. TAIL INDEX=" + listAddMixerChannel.Count ); + //DebugOut_CChipList( listAddMixerChannel ); + listAddMixerChannel.RemoveAt(listAddMixerChannel.Count - 1); // また、同じチップ音の「mixerへの再追加」は削除する + //Debug.WriteLine( "removed result:" ); + //DebugOut_CChipList( listAddMixerChannel ); + } else // 逆に、時間軸上、mixer削除後に再発音するような流れの場合は + { + listRemoveMixerChannel.Add(listRemoveTiming[index]); // mixer削除を確定させる + //Debug.WriteLine( "listRemoveMixerChannel:" ); + //DebugOut_CChipList( listRemoveMixerChannel ); + //listRemoveTiming.RemoveAt( index ); + } + CChip c = new CChip() // mixer削除時刻を更新(遅延)する + { + nチャンネル番号 = 0xDB, + n整数値 = listRemoveTiming[index].n整数値, + n整数値_内部番号 = listRemoveTiming[index].n整数値_内部番号, + n発声時刻ms = n新RemoveMixer時刻ms, + n発声位置 = n新RemoveMixer位置 + }; + listRemoveTiming[index] = c; + } else // 過去に同じチップを発音していないor + { // 発音していたが既にmixer削除確定していたなら + CChip c = new CChip() // 新しくmixer削除候補として追加する + { + nチャンネル番号 = 0xDB, n整数値 = pChip.n整数値, n整数値_内部番号 = pChip.n整数値_内部番号, - n発声時刻ms = nAddMixer時刻ms, - n発声位置 = nAddMixer位置, - b演奏終了後も再生が続くチップである = false + n発声時刻ms = n新RemoveMixer時刻ms, + n発声位置 = n新RemoveMixer位置 }; - listAddMixerChannel.Add(c_AddMixer); - #endregion - - int duration = 0; - if (listWAV.TryGetValue(pChip.n整数値_内部番号, out CDTX.CWAV wc)) { - double _db再生速度 = this.db再生速度; - duration = (wc.rSound[0] == null) ? 0 : (int)(wc.rSound[0].TotalPlayTime / _db再生速度); // #23664 durationに再生速度が加味されておらず、低速再生でBGMが途切れる問題を修正 (発声時刻msは、DTX読み込み時に再生速度加味済) - } - int n新RemoveMixer時刻ms, n新RemoveMixer位置; - t発声時刻msと発声位置を取得する(pChip.n発声時刻ms + duration + n発音後余裕ms, out n新RemoveMixer時刻ms, out n新RemoveMixer位置); - if (n新RemoveMixer時刻ms < pChip.n発声時刻ms + duration) // 曲の最後でサウンドが切れるような場合は - { - CChip c_AddMixer_noremove = c_AddMixer; - c_AddMixer_noremove.b演奏終了後も再生が続くチップである = true; - listAddMixerChannel[listAddMixerChannel.Count - 1] = c_AddMixer_noremove; - break; - } - - #region [ 発音終了2秒後にmixerから削除するが、その前に再発音することになるのかを確認(再発音ならmixer削除タイミングを延期) ] - int n整数値 = pChip.n整数値; - int index = listRemoveTiming.FindIndex( - delegate (CChip cchip) { return cchip.n整数値 == n整数値; } - ); - if (index >= 0) // 過去に同じチップで発音中のものが見つかった場合 - { // 過去の発音のmixer削除を確定させるか、延期するかの2択。 - int n旧RemoveMixer時刻ms = listRemoveTiming[index].n発声時刻ms; - int n旧RemoveMixer位置 = listRemoveTiming[index].n発声位置; - - if (pChip.n発声時刻ms - n発音前余裕ms <= n旧RemoveMixer時刻ms) // mixer削除前に、同じ音の再発音がある場合は、 - { // mixer削除時刻を遅延させる(if-else後に行う) - //Debug.WriteLine( "remove TAIL of listAddMixerChannel. TAIL INDEX=" + listAddMixerChannel.Count ); - //DebugOut_CChipList( listAddMixerChannel ); - listAddMixerChannel.RemoveAt(listAddMixerChannel.Count - 1); // また、同じチップ音の「mixerへの再追加」は削除する - //Debug.WriteLine( "removed result:" ); - //DebugOut_CChipList( listAddMixerChannel ); - } else // 逆に、時間軸上、mixer削除後に再発音するような流れの場合は - { - listRemoveMixerChannel.Add(listRemoveTiming[index]); // mixer削除を確定させる - //Debug.WriteLine( "listRemoveMixerChannel:" ); - //DebugOut_CChipList( listRemoveMixerChannel ); - //listRemoveTiming.RemoveAt( index ); - } - CChip c = new CChip() // mixer削除時刻を更新(遅延)する - { - nチャンネル番号 = 0xDB, - n整数値 = listRemoveTiming[index].n整数値, - n整数値_内部番号 = listRemoveTiming[index].n整数値_内部番号, - n発声時刻ms = n新RemoveMixer時刻ms, - n発声位置 = n新RemoveMixer位置 - }; - listRemoveTiming[index] = c; - } else // 過去に同じチップを発音していないor - { // 発音していたが既にmixer削除確定していたなら - CChip c = new CChip() // 新しくmixer削除候補として追加する - { - nチャンネル番号 = 0xDB, - n整数値 = pChip.n整数値, - n整数値_内部番号 = pChip.n整数値_内部番号, - n発声時刻ms = n新RemoveMixer時刻ms, - n発声位置 = n新RemoveMixer位置 - }; - listRemoveTiming.Add(c); - } - #endregion - break; - } - } - - listChip.AddRange(listAddMixerChannel); - listChip.AddRange(listRemoveMixerChannel); - listChip.AddRange(listRemoveTiming); - listChip.Sort(); - } - private void DebugOut_CChipList(List c) { - for (int i = 0; i < c.Count; i++) { - Debug.WriteLine(i + ": ch=" + c[i].nチャンネル番号.ToString("x2") + ", WAV番号=" + c[i].n整数値 + ", time=" + c[i].n発声時刻ms); - } - } - private bool t発声時刻msと発声位置を取得する(int n希望発声時刻ms, out int n新発声時刻ms, out int n新発声位置) { - // 発声時刻msから発声位置を逆算することはできないため、近似計算する。 - // 具体的には、希望発声位置前後の2つのチップの発声位置の中間を取る。 - - if (n希望発声時刻ms < 0) { - n希望発声時刻ms = 0; - } - int index_min = -1, index_max = -1; - for (int i = 0; i < listChip.Count; i++) // 希望発声位置前後の「前」の方のチップを検索 - { - if (listChip[i].n発声時刻ms >= n希望発声時刻ms) { - index_min = i; + listRemoveTiming.Add(c); + } + #endregion break; - } } - if (index_min < 0) // 希望発声時刻に至らずに曲が終了してしまう場合 - { - // listの最終項目の時刻をそのまま使用する - //___のではダメ。BGMが尻切れになる。 - // そこで、listの最終項目の発声時刻msと発生位置から、希望発声時刻に相当する希望発声位置を比例計算して求める。 - n新発声時刻ms = listChip[listChip.Count - 1].n発声時刻ms; - n新発声位置 = listChip[listChip.Count - 1].n発声位置; - return false; - } - index_max = index_min + 1; - if (index_max >= listChip.Count) { - index_max = index_min; - } - n新発声時刻ms = (listChip[index_max].n発声時刻ms + listChip[index_min].n発声時刻ms) / 2; - n新発声位置 = (listChip[index_max].n発声位置 + listChip[index_min].n発声位置) / 2; - - return true; } - public void SwapGuitarBassInfos() { - } - - // SwapGuitarBassInfos_AutoFlags()は、CDTXからCConfigIniに移動。 - - // CActivity 実装 - private CCachedFontRenderer pf歌詞フォント; - public override void Activate() { - if (OpenTaiko.r現在のステージ.eStageID == CStage.EStage.SongLoading) { - //まさかこれが原因で曲の読み込みが停止するとは思わなかった... - //どういうことかというとスキンを読み込むときに...いや厳密には - //RefleshSkinを呼び出した後一回Disposeしてnullにして解放(その後にまたインスタンスを作成する)するんだけど - //その時にここでTJAPlayer3.Skinを参照して例外が出ていたんだ.... - //いやいや! なんでTJAPlayer3.Skinをnullにした瞬間に参照されるんだ!と思った方もいるかもしれないですが - //実は曲の読み込みはマルチスレッドで実行されているのでnullにした瞬間に参照される可能性も十分にある - //それならアプリが終了するんじゃないかと思ったのだけどtryを使ってい曲の読み込みを続行していた... - //いやーマルチスレッドって難しいね! - if (!string.IsNullOrEmpty(OpenTaiko.Skin.Game_Lyric_FontName)) { - this.pf歌詞フォント = new CCachedFontRenderer(OpenTaiko.Skin.Game_Lyric_FontName, OpenTaiko.Skin.Game_Lyric_FontSize); - } else { - this.pf歌詞フォント = new CCachedFontRenderer(CFontRenderer.DefaultFontName, OpenTaiko.Skin.Game_Lyric_FontSize); - } - } - this.listWAV = new Dictionary(); - this.listBPM = new Dictionary(); - this.listSCROLL = new Dictionary(); - this.listSCROLL_Normal = new Dictionary(); - this.listSCROLL_Expert = new Dictionary(); - this.listSCROLL_Master = new Dictionary(); - this.listJPOSSCROLL = new Dictionary(); - this.listDELAY = new Dictionary(); - this.listBRANCH = new Dictionary(); - this.listVD = new Dictionary(); - this.listChip = new List(); - this.listChip_Branch = new List[3]; - this.listChip_Branch[0] = new List(); - this.listChip_Branch[1] = new List(); - this.listChip_Branch[2] = new List(); - this.listBalloon = new List(); - this.listBalloon_Normal = new List(); - this.listBalloon_Expert = new List(); - this.listBalloon_Master = new List(); - this.listLine = new List(); - this.listLyric = new List(); - this.listLyric2 = new List(); - this.List_DanSongs = new List(); - this.listObj = new Dictionary(); - this.listTextures = new Dictionary(); - this.listOriginalTextures = new Dictionary(); - this.currentObjAnimations = new Dictionary(); - base.Activate(); + listChip.AddRange(listAddMixerChannel); + listChip.AddRange(listRemoveMixerChannel); + listChip.AddRange(listRemoveTiming); + listChip.Sort(); + } + private void DebugOut_CChipList(List c) { + for (int i = 0; i < c.Count; i++) { + Debug.WriteLine(i + ": ch=" + c[i].nチャンネル番号.ToString("x2") + ", WAV番号=" + c[i].n整数値 + ", time=" + c[i].n発声時刻ms); } - public override void DeActivate() { - if (this.listWAV != null) { - foreach (CWAV cwav in this.listWAV.Values) { - cwav.Dispose(); - } - this.listWAV = null; + } + private bool t発声時刻msと発声位置を取得する(int n希望発声時刻ms, out int n新発声時刻ms, out int n新発声位置) { + // 発声時刻msから発声位置を逆算することはできないため、近似計算する。 + // 具体的には、希望発声位置前後の2つのチップの発声位置の中間を取る。 + + if (n希望発声時刻ms < 0) { + n希望発声時刻ms = 0; + } + int index_min = -1, index_max = -1; + for (int i = 0; i < listChip.Count; i++) // 希望発声位置前後の「前」の方のチップを検索 + { + if (listChip[i].n発声時刻ms >= n希望発声時刻ms) { + index_min = i; + break; } + } + if (index_min < 0) // 希望発声時刻に至らずに曲が終了してしまう場合 + { + // listの最終項目の時刻をそのまま使用する + //___のではダメ。BGMが尻切れになる。 + // そこで、listの最終項目の発声時刻msと発生位置から、希望発声時刻に相当する希望発声位置を比例計算して求める。 + n新発声時刻ms = listChip[listChip.Count - 1].n発声時刻ms; + n新発声位置 = listChip[listChip.Count - 1].n発声位置; + return false; + } + index_max = index_min + 1; + if (index_max >= listChip.Count) { + index_max = index_min; + } + n新発声時刻ms = (listChip[index_max].n発声時刻ms + listChip[index_min].n発声時刻ms) / 2; + n新発声位置 = (listChip[index_max].n発声位置 + listChip[index_min].n発声位置) / 2; + + return true; + } + + public void SwapGuitarBassInfos() { + } + + // SwapGuitarBassInfos_AutoFlags()は、CDTXからCConfigIniに移動。 + + // CActivity 実装 + private CCachedFontRenderer pf歌詞フォント; + public override void Activate() { + if (OpenTaiko.r現在のステージ.eStageID == CStage.EStage.SongLoading) { + //まさかこれが原因で曲の読み込みが停止するとは思わなかった... + //どういうことかというとスキンを読み込むときに...いや厳密には + //RefleshSkinを呼び出した後一回Disposeしてnullにして解放(その後にまたインスタンスを作成する)するんだけど + //その時にここでTJAPlayer3.Skinを参照して例外が出ていたんだ.... + //いやいや! なんでTJAPlayer3.Skinをnullにした瞬間に参照されるんだ!と思った方もいるかもしれないですが + //実は曲の読み込みはマルチスレッドで実行されているのでnullにした瞬間に参照される可能性も十分にある + //それならアプリが終了するんじゃないかと思ったのだけどtryを使ってい曲の読み込みを続行していた... + //いやーマルチスレッドって難しいね! + if (!string.IsNullOrEmpty(OpenTaiko.Skin.Game_Lyric_FontName)) { + this.pf歌詞フォント = new CCachedFontRenderer(OpenTaiko.Skin.Game_Lyric_FontName, OpenTaiko.Skin.Game_Lyric_FontSize); + } else { + this.pf歌詞フォント = new CCachedFontRenderer(CFontRenderer.DefaultFontName, OpenTaiko.Skin.Game_Lyric_FontSize); + } + } + this.listWAV = new Dictionary(); + this.listBPM = new Dictionary(); + this.listSCROLL = new Dictionary(); + this.listSCROLL_Normal = new Dictionary(); + this.listSCROLL_Expert = new Dictionary(); + this.listSCROLL_Master = new Dictionary(); + this.listJPOSSCROLL = new Dictionary(); + this.listDELAY = new Dictionary(); + this.listBRANCH = new Dictionary(); + this.listVD = new Dictionary(); + this.listChip = new List(); + this.listChip_Branch = new List[3]; + this.listChip_Branch[0] = new List(); + this.listChip_Branch[1] = new List(); + this.listChip_Branch[2] = new List(); + this.listBalloon = new List(); + this.listBalloon_Normal = new List(); + this.listBalloon_Expert = new List(); + this.listBalloon_Master = new List(); + this.listLine = new List(); + this.listLyric = new List(); + this.listLyric2 = new List(); + this.List_DanSongs = new List(); + this.listObj = new Dictionary(); + this.listTextures = new Dictionary(); + this.listOriginalTextures = new Dictionary(); + this.currentObjAnimations = new Dictionary(); + base.Activate(); + } + public override void DeActivate() { + if (this.listWAV != null) { + foreach (CWAV cwav in this.listWAV.Values) { + cwav.Dispose(); + } + this.listWAV = null; + } + if (this.listVD != null) { + foreach (CVideoDecoder cvd in this.listVD.Values) { + cvd.Dispose(); + } + this.listVD = null; + } + if (this.listBPM != null) { + this.listBPM.Clear(); + this.listBPM = null; + } + if (this.listDELAY != null) { + this.listDELAY.Clear(); + this.listDELAY = null; + } + if (this.listBRANCH != null) { + this.listBRANCH.Clear(); + this.listBRANCH = null; + } + if (this.listSCROLL != null) { + this.listSCROLL.Clear(); + this.listSCROLL = null; + } + + if (this.listSCROLL_Normal != null) { + this.listSCROLL_Normal.Clear(); + this.listSCROLL_Normal = null; + } + if (this.listSCROLL_Expert != null) { + this.listSCROLL_Expert.Clear(); + this.listSCROLL_Expert = null; + } + if (this.listSCROLL_Master != null) { + this.listSCROLL_Master.Clear(); + this.listSCROLL_Master = null; + } + if (this.listJPOSSCROLL != null) { + this.listJPOSSCROLL.Clear(); + this.listJPOSSCROLL = null; + } + if (this.List_DanSongs != null) { + this.List_DanSongs.Clear(); + this.List_DanSongs = null; + } + + if (this.listChip != null) { + this.listChip.Clear(); + } + + if (this.listBalloon != null) { + this.listBalloon.Clear(); + } + if (this.listBalloon_Normal != null) { + this.listBalloon_Normal.Clear(); + } + if (this.listBalloon_Expert != null) { + this.listBalloon_Expert.Clear(); + } + if (this.listBalloon_Master != null) { + this.listBalloon_Master.Clear(); + } + if (this.listLyric != null) { + this.listLyric.Clear(); + } + if (this.listLyric2 != null) { + this.listLyric2.Clear(); + } + + + + if (this.listObj != null) { + foreach (KeyValuePair pair in this.listObj) { + pair.Value.tDispose(); + } + this.listObj.Clear(); + } + + if (this.listOriginalTextures != null) { + foreach (KeyValuePair pair in this.listOriginalTextures) { + string txPath = pair.Key; + CTexture originalTx = pair.Value; + OpenTaiko.Tx.trackedTextures.TryGetValue(txPath, out CTexture oldTx); + + if (oldTx != originalTx) { + oldTx.UpdateTexture(originalTx, originalTx.sz画像サイズ.Width, originalTx.sz画像サイズ.Height); + } + } + this.listOriginalTextures.Clear(); + } + + if (this.listTextures != null) { + foreach (KeyValuePair pair in this.listTextures) { + pair.Value.Dispose(); + } + this.listTextures.Clear(); + } + + base.DeActivate(); + } + public override void CreateManagedResource() { + if (!base.IsDeActivated) { + this.tAVIの読み込み(); + base.CreateManagedResource(); + } + } + public override void ReleaseManagedResource() { + if (!base.IsDeActivated) { if (this.listVD != null) { foreach (CVideoDecoder cvd in this.listVD.Values) { cvd.Dispose(); } this.listVD = null; } - if (this.listBPM != null) { - this.listBPM.Clear(); - this.listBPM = null; - } - if (this.listDELAY != null) { - this.listDELAY.Clear(); - this.listDELAY = null; - } - if (this.listBRANCH != null) { - this.listBRANCH.Clear(); - this.listBRANCH = null; - } - if (this.listSCROLL != null) { - this.listSCROLL.Clear(); - this.listSCROLL = null; - } - - if (this.listSCROLL_Normal != null) { - this.listSCROLL_Normal.Clear(); - this.listSCROLL_Normal = null; - } - if (this.listSCROLL_Expert != null) { - this.listSCROLL_Expert.Clear(); - this.listSCROLL_Expert = null; - } - if (this.listSCROLL_Master != null) { - this.listSCROLL_Master.Clear(); - this.listSCROLL_Master = null; - } - if (this.listJPOSSCROLL != null) { - this.listJPOSSCROLL.Clear(); - this.listJPOSSCROLL = null; - } - if (this.List_DanSongs != null) { - this.List_DanSongs.Clear(); - this.List_DanSongs = null; - } - - if (this.listChip != null) { - this.listChip.Clear(); - } - - if (this.listBalloon != null) { - this.listBalloon.Clear(); - } - if (this.listBalloon_Normal != null) { - this.listBalloon_Normal.Clear(); - } - if (this.listBalloon_Expert != null) { - this.listBalloon_Expert.Clear(); - } - if (this.listBalloon_Master != null) { - this.listBalloon_Master.Clear(); - } - if (this.listLyric != null) { - this.listLyric.Clear(); - } - if (this.listLyric2 != null) { - this.listLyric2.Clear(); - } - - - - if (this.listObj != null) { - foreach (KeyValuePair pair in this.listObj) { - pair.Value.tDispose(); - } - this.listObj.Clear(); - } - - if (this.listOriginalTextures != null) { - foreach (KeyValuePair pair in this.listOriginalTextures) { - string txPath = pair.Key; - CTexture originalTx = pair.Value; - OpenTaiko.Tx.trackedTextures.TryGetValue(txPath, out CTexture oldTx); - - if (oldTx != originalTx) { - oldTx.UpdateTexture(originalTx, originalTx.sz画像サイズ.Width, originalTx.sz画像サイズ.Height); - } - } - this.listOriginalTextures.Clear(); - } - - if (this.listTextures != null) { - foreach (KeyValuePair pair in this.listTextures) { - pair.Value.Dispose(); - } - this.listTextures.Clear(); - } - - base.DeActivate(); + OpenTaiko.tDisposeSafely(ref this.pf歌詞フォント); + base.ReleaseManagedResource(); } - public override void CreateManagedResource() { - if (!base.IsDeActivated) { - this.tAVIの読み込み(); - base.CreateManagedResource(); - } - } - public override void ReleaseManagedResource() { - if (!base.IsDeActivated) { - if (this.listVD != null) { - foreach (CVideoDecoder cvd in this.listVD.Values) { - cvd.Dispose(); - } - this.listVD = null; - } - OpenTaiko.tDisposeSafely(ref this.pf歌詞フォント); - base.ReleaseManagedResource(); - } - } - - // その他 - - #region [ private ] - //----------------- - /// - /// GDAチャンネル番号に対応するDTXチャンネル番号。 - /// - [StructLayout(LayoutKind.Sequential)] - private struct STGDAPARAM { - public string strGDAのチャンネル文字列; - public int nDTXのチャンネル番号; - - public STGDAPARAM(string strGDAのチャンネル文字列, int nDTXのチャンネル番号) // 2011.1.1 yyagi 構造体のコンストラクタ追加(初期化簡易化のため) - { - this.strGDAのチャンネル文字列 = strGDAのチャンネル文字列; - this.nDTXのチャンネル番号 = nDTXのチャンネル番号; - } - } - - private readonly STGDAPARAM[] stGDAParam; - private bool bヘッダのみ; - private Stack bstackIFからENDIFをスキップする; - - private int n現在の行数; - private int n現在の乱数; - - private int nPolyphonicSounds = 4; // #28228 2012.5.1 yyagi - - private int n内部番号BPM1to; - private int n内部番号SCROLL1to; - private int n内部番号JSCROLL1to; - private int n内部番号DELAY1to; - private int n内部番号BRANCH1to; - private int n内部番号WAV1to; - private int[] n無限管理BPM; - private int[] n無限管理PAN; - private int[] n無限管理SIZE; - private int[] n無限管理WAV; - private int[] nRESULTIMAGE用優先順位; - private int[] nRESULTMOVIE用優先順位; - private int[] nRESULTSOUND用優先順位; - - private CChip currentCamVMoveChip; - private CChip currentCamHMoveChip; - private CChip currentCamRotateChip; - private CChip currentCamZoomChip; - private CChip currentCamVScaleChip; - private CChip currentCamHScaleChip; - - private Dictionary currentObjAnimations; - - private void t行のコメント処理(ref string strText) { - int nCommentPos = strText.IndexOf("//"); - if (nCommentPos != -1) - strText = strText.Remove(nCommentPos); - } - - /// - /// 音源再生前の空白を追加するメソッド。 - /// - private void AddMusicPreTimeMs() { - this.dbNowTime += OpenTaiko.ConfigIni.MusicPreTimeMs; - this.dbNowBMScollTime += OpenTaiko.ConfigIni.MusicPreTimeMs * this.dbNowBPM / 15000; - } - //----------------- - #endregion } + + // その他 + + #region [ private ] + //----------------- + /// + /// GDAチャンネル番号に対応するDTXチャンネル番号。 + /// + [StructLayout(LayoutKind.Sequential)] + private struct STGDAPARAM { + public string strGDAのチャンネル文字列; + public int nDTXのチャンネル番号; + + public STGDAPARAM(string strGDAのチャンネル文字列, int nDTXのチャンネル番号) // 2011.1.1 yyagi 構造体のコンストラクタ追加(初期化簡易化のため) + { + this.strGDAのチャンネル文字列 = strGDAのチャンネル文字列; + this.nDTXのチャンネル番号 = nDTXのチャンネル番号; + } + } + + private readonly STGDAPARAM[] stGDAParam; + private bool bヘッダのみ; + private Stack bstackIFからENDIFをスキップする; + + private int n現在の行数; + private int n現在の乱数; + + private int nPolyphonicSounds = 4; // #28228 2012.5.1 yyagi + + private int n内部番号BPM1to; + private int n内部番号SCROLL1to; + private int n内部番号JSCROLL1to; + private int n内部番号DELAY1to; + private int n内部番号BRANCH1to; + private int n内部番号WAV1to; + private int[] n無限管理BPM; + private int[] n無限管理PAN; + private int[] n無限管理SIZE; + private int[] n無限管理WAV; + private int[] nRESULTIMAGE用優先順位; + private int[] nRESULTMOVIE用優先順位; + private int[] nRESULTSOUND用優先順位; + + private CChip currentCamVMoveChip; + private CChip currentCamHMoveChip; + private CChip currentCamRotateChip; + private CChip currentCamZoomChip; + private CChip currentCamVScaleChip; + private CChip currentCamHScaleChip; + + private Dictionary currentObjAnimations; + + private void t行のコメント処理(ref string strText) { + int nCommentPos = strText.IndexOf("//"); + if (nCommentPos != -1) + strText = strText.Remove(nCommentPos); + } + + /// + /// 音源再生前の空白を追加するメソッド。 + /// + private void AddMusicPreTimeMs() { + this.dbNowTime += OpenTaiko.ConfigIni.MusicPreTimeMs; + this.dbNowBMScollTime += OpenTaiko.ConfigIni.MusicPreTimeMs * this.dbNowBPM / 15000; + } + //----------------- + #endregion } diff --git a/OpenTaiko/src/Songs/CDTXCompanionFileFinder.cs b/OpenTaiko/src/Songs/CDTXCompanionFileFinder.cs index cf7f28c0..7354b8d3 100644 --- a/OpenTaiko/src/Songs/CDTXCompanionFileFinder.cs +++ b/OpenTaiko/src/Songs/CDTXCompanionFileFinder.cs @@ -1,206 +1,206 @@ using System.Diagnostics; using System.Text; -namespace OpenTaiko { - internal static class CDTXCompanionFileFinder { - internal static string FindFileName( - string directory, - string mainFileName, - string expectedCompanionFileName) { - var expectedCompanionPath = Path.Combine(directory, expectedCompanionFileName); +namespace OpenTaiko; - if (File.Exists(expectedCompanionPath)) { - return expectedCompanionFileName; - } +internal static class CDTXCompanionFileFinder { + internal static string FindFileName( + string directory, + string mainFileName, + string expectedCompanionFileName) { + var expectedCompanionPath = Path.Combine(directory, expectedCompanionFileName); - // If we could not find the file by its exact provided name, in - // the vast majority of cases it has been mangled during zip - // compression by a zip tool which is not properly aware of - // multi-byte encodings, Unicode, etc. When decompressed, such - // zipped files end up a file names which are simply the raw bytes - // of the Shift-JIS encoded form. Some of these bytes will be - // invalid as characters of file names and will have been further - // mangled, usually to a single underscore character. + if (File.Exists(expectedCompanionPath)) { + return expectedCompanionFileName; + } - // To begin finding the right file, we first need to get the raw - // bytes that would comprise the file name if encoded into - // Shift-JIS. - var encodedCompanionFileNameBytes = Encoding.GetEncoding(OpenTaiko.sEncType).GetBytes(expectedCompanionFileName); + // If we could not find the file by its exact provided name, in + // the vast majority of cases it has been mangled during zip + // compression by a zip tool which is not properly aware of + // multi-byte encodings, Unicode, etc. When decompressed, such + // zipped files end up a file names which are simply the raw bytes + // of the Shift-JIS encoded form. Some of these bytes will be + // invalid as characters of file names and will have been further + // mangled, usually to a single underscore character. - // Here we have a helper method that will be used to try finding - // the file by interpreting the byte representation encoded - // just above, this time in terms of some other encoding which - // might be in use in the user's file system. - bool TryFindViaDecodedFileName(string prefix, Encoding encoding, out string foundCompanionFileName) { - var decodedCompanionFileName = DecodeToLegalFileName(encodedCompanionFileNameBytes, encoding); + // To begin finding the right file, we first need to get the raw + // bytes that would comprise the file name if encoded into + // Shift-JIS. + var encodedCompanionFileNameBytes = Encoding.GetEncoding(OpenTaiko.sEncType).GetBytes(expectedCompanionFileName); - try { - if (!File.Exists(Path.Combine(directory, decodedCompanionFileName))) { - foundCompanionFileName = null; - return false; - } - } catch { - Trace.TraceWarning( - $"{nameof(CDTXCompanionFileFinder)} could not find expected file '{expectedCompanionPath}' and could not check the existence of a file via {prefix} '{encoding.EncodingName}'. Possible illegal file path when combining directory '{directory}' with encoded file name '{decodedCompanionFileName}'."); + // Here we have a helper method that will be used to try finding + // the file by interpreting the byte representation encoded + // just above, this time in terms of some other encoding which + // might be in use in the user's file system. + bool TryFindViaDecodedFileName(string prefix, Encoding encoding, out string foundCompanionFileName) { + var decodedCompanionFileName = DecodeToLegalFileName(encodedCompanionFileNameBytes, encoding); + try { + if (!File.Exists(Path.Combine(directory, decodedCompanionFileName))) { foundCompanionFileName = null; return false; } + } catch { + Trace.TraceWarning( + $"{nameof(CDTXCompanionFileFinder)} could not find expected file '{expectedCompanionPath}' and could not check the existence of a file via {prefix} '{encoding.EncodingName}'. Possible illegal file path when combining directory '{directory}' with encoded file name '{decodedCompanionFileName}'."); - Trace.TraceInformation( - $"{nameof(CDTXCompanionFileFinder)} could not find expected file '{expectedCompanionPath}' but found '{decodedCompanionFileName}' via {prefix} '{encoding.EncodingName}', Code Page {encoding.CodePage}, Windows Code Page {encoding.WindowsCodePage}."); - - foundCompanionFileName = decodedCompanionFileName; - return true; + foundCompanionFileName = null; + return false; } - // Attempt to find the file as if the companion file's name was - // mangled into codepage 437 (effectively the legacy DOS codepage, - // and the one used by zip tools that are not unicode aware.) - // This step finds >99% of files with mangled names. - if (TryFindViaDecodedFileName( + Trace.TraceInformation( + $"{nameof(CDTXCompanionFileFinder)} could not find expected file '{expectedCompanionPath}' but found '{decodedCompanionFileName}' via {prefix} '{encoding.EncodingName}', Code Page {encoding.CodePage}, Windows Code Page {encoding.WindowsCodePage}."); + + foundCompanionFileName = decodedCompanionFileName; + return true; + } + + // Attempt to find the file as if the companion file's name was + // mangled into codepage 437 (effectively the legacy DOS codepage, + // and the one used by zip tools that are not unicode aware.) + // This step finds >99% of files with mangled names. + if (TryFindViaDecodedFileName( "Encoding.GetEncoding(437)", Encoding.GetEncoding(437), out var foundCompanionFileNameViaEncoding437)) { - return foundCompanionFileNameViaEncoding437; - } + return foundCompanionFileNameViaEncoding437; + } - // Attempt to find the file as if the companion file's name - // was mangled into this computer's default encoding. This case - // has not been observed during testing on US English computers, - // but it is safe to perform and may assist other locales. - if (TryFindViaDecodedFileName( + // Attempt to find the file as if the companion file's name + // was mangled into this computer's default encoding. This case + // has not been observed during testing on US English computers, + // but it is safe to perform and may assist other locales. + if (TryFindViaDecodedFileName( "Encoding.Default", Encoding.Default, out var foundCompanionFileNameViaEncodingDefault)) { - return foundCompanionFileNameViaEncodingDefault; - } + return foundCompanionFileNameViaEncodingDefault; + } - // If the companion file still cannot be found, try to find a file - // with the expected extension but having the same file name as the - // main file with which it is associated (in most use cases: the .tja file.) - if (TryFindViaMainFileName( + // If the companion file still cannot be found, try to find a file + // with the expected extension but having the same file name as the + // main file with which it is associated (in most use cases: the .tja file.) + if (TryFindViaMainFileName( directory, mainFileName, expectedCompanionPath, out var foundCompanionFileNameByMainFileName)) { - return foundCompanionFileNameByMainFileName; - } + return foundCompanionFileNameByMainFileName; + } - // If the file still cannot be found, try to find a single file - // with the expected supplementary file extension. (If more than - // one file is found with the same extension, we can't reliably - // choose the right one of them.) - if (TryFindViaCompanionFileExtension( + // If the file still cannot be found, try to find a single file + // with the expected supplementary file extension. (If more than + // one file is found with the same extension, we can't reliably + // choose the right one of them.) + if (TryFindViaCompanionFileExtension( directory, expectedCompanionPath, out var foundCompanionFileNameByExtension)) { - return foundCompanionFileNameByExtension; - } + return foundCompanionFileNameByExtension; + } - // If the file still cannot be found, produce a warning - // and return the original file name unchanged. + // If the file still cannot be found, produce a warning + // and return the original file name unchanged. + Trace.TraceWarning( + $"{nameof(CDTXCompanionFileFinder)} could not find expected file '{expectedCompanionPath}' by any available means."); + + return expectedCompanionFileName; + } + + private static string DecodeToLegalFileName(byte[] encodedBytes, Encoding encoding) { + // Decode and then replace characters which are illegal in file + // names in all locales, except for the backslash character which + // will be handled immediately after this. + var decodedBeforeDirectoryRemoval = encoding.GetString(encodedBytes) + .Replace('<', '_') + .Replace('>', '_') + .Replace(':', '_') + .Replace('"', '_') + .Replace('/', '_') + .Replace('|', '_') + .Replace('?', '_') + .Replace('*', '_'); + + // During decompression of incorrectly-generated zip files, + // Shift-JIS characters which encode to a representation that + // includes a backslash result in the decompressor placing the files + // in a subdirectory (or even subdirectories) based on characters + // before and between all backslashes, and then names the file based + // on the characters appearing after the final backslash. In these + // cases, we're already parsing files in one of those generated + // subdirectories and have only to deal with the file names having + // been abbreviated. We can usually find such files in the + // applicable directory via the substring after the final backslash. + var lastIndexOfBackslash = decodedBeforeDirectoryRemoval.LastIndexOf('\\'); + return lastIndexOfBackslash == -1 + ? decodedBeforeDirectoryRemoval + : decodedBeforeDirectoryRemoval.Substring(lastIndexOfBackslash + 1); + } + + private static bool TryFindViaMainFileName( + string directory, + string mainFileName, + string expectedCompanionPath, + out string foundCompanionFileName) { + var mainFilePath = Path.Combine(directory, mainFileName); + + var companionFileExtension = Path.GetExtension(expectedCompanionPath); + + var mainFilePathWithCompanionFileExtension = + Path.ChangeExtension(mainFilePath, companionFileExtension); + + // Whether mangled or not, most companion files have names which + // match the name of the main file, except for the difference in + // the file extension. We can check for these by determining what + // the file might be called when the extension is replaced with the + // appropriate one and then check for the existence of that file. + var mainFileNameWithCompanionFileExtension = + Path.GetFileName(mainFilePathWithCompanionFileExtension); + if (File.Exists(mainFilePathWithCompanionFileExtension)) { + Trace.TraceInformation( + $"{nameof(CDTXCompanionFileFinder)} could not find expected file '{expectedCompanionPath}' but found '{mainFileNameWithCompanionFileExtension}' by matching the '{mainFileName}' file name with the expected file extension."); + + foundCompanionFileName = mainFileNameWithCompanionFileExtension; + return true; + } + + foundCompanionFileName = null; + return false; + } + + private static bool TryFindViaCompanionFileExtension( + string directory, + string expectedCompanionPath, + out string foundCompanionFileName) { + var companionFileExtension = Path.GetExtension(expectedCompanionPath); + + if (string.IsNullOrEmpty(companionFileExtension)) { Trace.TraceWarning( - $"{nameof(CDTXCompanionFileFinder)} could not find expected file '{expectedCompanionPath}' by any available means."); + $"{nameof(CDTXCompanionFileFinder)} could not find expected file '{expectedCompanionPath}' and could not search for appropriate sibling files because this file has no extension."); + } else { + // If no more precise approach can find the right file, we can + // usually safely find it by looking for any file with the + // expected file extension in the same folder as the main file. + // However, if someone extracts a collection of songs into a + // single folder, we will see many files with the expected + // extension. Therefore, we will only treat the file as found + // if there is one and only one file with the expected file + // extension within in the directory in question. + var filesWithTheCompanionFileExtension = + Directory.GetFiles(directory, "*" + companionFileExtension); + if (filesWithTheCompanionFileExtension.Length == 1) { + var foundCompanionFilePath = filesWithTheCompanionFileExtension[0]; + foundCompanionFileName = Path.GetFileName(foundCompanionFilePath); - return expectedCompanionFileName; - } - - private static string DecodeToLegalFileName(byte[] encodedBytes, Encoding encoding) { - // Decode and then replace characters which are illegal in file - // names in all locales, except for the backslash character which - // will be handled immediately after this. - var decodedBeforeDirectoryRemoval = encoding.GetString(encodedBytes) - .Replace('<', '_') - .Replace('>', '_') - .Replace(':', '_') - .Replace('"', '_') - .Replace('/', '_') - .Replace('|', '_') - .Replace('?', '_') - .Replace('*', '_'); - - // During decompression of incorrectly-generated zip files, - // Shift-JIS characters which encode to a representation that - // includes a backslash result in the decompressor placing the files - // in a subdirectory (or even subdirectories) based on characters - // before and between all backslashes, and then names the file based - // on the characters appearing after the final backslash. In these - // cases, we're already parsing files in one of those generated - // subdirectories and have only to deal with the file names having - // been abbreviated. We can usually find such files in the - // applicable directory via the substring after the final backslash. - var lastIndexOfBackslash = decodedBeforeDirectoryRemoval.LastIndexOf('\\'); - return lastIndexOfBackslash == -1 - ? decodedBeforeDirectoryRemoval - : decodedBeforeDirectoryRemoval.Substring(lastIndexOfBackslash + 1); - } - - private static bool TryFindViaMainFileName( - string directory, - string mainFileName, - string expectedCompanionPath, - out string foundCompanionFileName) { - var mainFilePath = Path.Combine(directory, mainFileName); - - var companionFileExtension = Path.GetExtension(expectedCompanionPath); - - var mainFilePathWithCompanionFileExtension = - Path.ChangeExtension(mainFilePath, companionFileExtension); - - // Whether mangled or not, most companion files have names which - // match the name of the main file, except for the difference in - // the file extension. We can check for these by determining what - // the file might be called when the extension is replaced with the - // appropriate one and then check for the existence of that file. - var mainFileNameWithCompanionFileExtension = - Path.GetFileName(mainFilePathWithCompanionFileExtension); - if (File.Exists(mainFilePathWithCompanionFileExtension)) { Trace.TraceInformation( - $"{nameof(CDTXCompanionFileFinder)} could not find expected file '{expectedCompanionPath}' but found '{mainFileNameWithCompanionFileExtension}' by matching the '{mainFileName}' file name with the expected file extension."); + $"{nameof(CDTXCompanionFileFinder)} could not find expected file '{expectedCompanionPath}' but found '{foundCompanionFileName}' by searching for a single sibling file with the expected extension."); - foundCompanionFileName = mainFileNameWithCompanionFileExtension; return true; } - - foundCompanionFileName = null; - return false; } - private static bool TryFindViaCompanionFileExtension( - string directory, - string expectedCompanionPath, - out string foundCompanionFileName) { - var companionFileExtension = Path.GetExtension(expectedCompanionPath); - - if (string.IsNullOrEmpty(companionFileExtension)) { - Trace.TraceWarning( - $"{nameof(CDTXCompanionFileFinder)} could not find expected file '{expectedCompanionPath}' and could not search for appropriate sibling files because this file has no extension."); - } else { - // If no more precise approach can find the right file, we can - // usually safely find it by looking for any file with the - // expected file extension in the same folder as the main file. - // However, if someone extracts a collection of songs into a - // single folder, we will see many files with the expected - // extension. Therefore, we will only treat the file as found - // if there is one and only one file with the expected file - // extension within in the directory in question. - var filesWithTheCompanionFileExtension = - Directory.GetFiles(directory, "*" + companionFileExtension); - if (filesWithTheCompanionFileExtension.Length == 1) { - var foundCompanionFilePath = filesWithTheCompanionFileExtension[0]; - foundCompanionFileName = Path.GetFileName(foundCompanionFilePath); - - Trace.TraceInformation( - $"{nameof(CDTXCompanionFileFinder)} could not find expected file '{expectedCompanionPath}' but found '{foundCompanionFileName}' by searching for a single sibling file with the expected extension."); - - return true; - } - } - - foundCompanionFileName = null; - return false; - } + foundCompanionFileName = null; + return false; } } diff --git a/OpenTaiko/src/Songs/CDTXStyleExtractor.cs b/OpenTaiko/src/Songs/CDTXStyleExtractor.cs index 282786d6..8f74c99e 100644 --- a/OpenTaiko/src/Songs/CDTXStyleExtractor.cs +++ b/OpenTaiko/src/Songs/CDTXStyleExtractor.cs @@ -2,253 +2,211 @@ using System.Text; using System.Text.RegularExpressions; -namespace OpenTaiko { - /// - /// CDTXStyleExtractor determines if there is a session notation, and if there is then - /// it returns a sheet of music clipped according to the specified player Side. - /// - /// The process operates as follows: - /// 1. Break the string up into top-level sections of the following types: - /// a) STYLE Single - /// b) STYLE Double/Couple - /// c) STYLE unrecognized - /// d) non-STYLE - /// 2. Within the top-level sections, break each up into sub-sections of the following types: - /// a) sheet START P1 - /// b) sheet START P2 - /// c) sheet START bare - /// d) sheet START unrecognized - /// e) non-sheet - /// 3. For the current seqNo, rank the found sheets - /// using a per-seqNo set of rankings for each - /// relevant section/subsection combination. - /// 4. Determine the best-ranked sheet - /// 5. Remove sheets other than the best-ranked - /// 6. Remove top-level STYLE-type sections which no longer contain a sheet - /// 7. From supported STYLE-type sections, remove non-sheet subsections beyond - /// the selected sheet, to reduce risk of incorrect command processing. - /// 8. Reassemble the string - /// - public static class CDTXStyleExtractor { - private const RegexOptions StyleExtractorRegexOptions = - RegexOptions.Compiled | - RegexOptions.CultureInvariant | - RegexOptions.IgnoreCase | - RegexOptions.Multiline | - RegexOptions.Singleline; +namespace OpenTaiko; - private const string StylePrefixRegexPattern = @"^STYLE\s*:\s*"; - private const string SheetStartPrefixRegexPattern = @"^#START"; +/// +/// CDTXStyleExtractor determines if there is a session notation, and if there is then +/// it returns a sheet of music clipped according to the specified player Side. +/// +/// The process operates as follows: +/// 1. Break the string up into top-level sections of the following types: +/// a) STYLE Single +/// b) STYLE Double/Couple +/// c) STYLE unrecognized +/// d) non-STYLE +/// 2. Within the top-level sections, break each up into sub-sections of the following types: +/// a) sheet START P1 +/// b) sheet START P2 +/// c) sheet START bare +/// d) sheet START unrecognized +/// e) non-sheet +/// 3. For the current seqNo, rank the found sheets +/// using a per-seqNo set of rankings for each +/// relevant section/subsection combination. +/// 4. Determine the best-ranked sheet +/// 5. Remove sheets other than the best-ranked +/// 6. Remove top-level STYLE-type sections which no longer contain a sheet +/// 7. From supported STYLE-type sections, remove non-sheet subsections beyond +/// the selected sheet, to reduce risk of incorrect command processing. +/// 8. Reassemble the string +/// +public static class CDTXStyleExtractor { + private const RegexOptions StyleExtractorRegexOptions = + RegexOptions.Compiled | + RegexOptions.CultureInvariant | + RegexOptions.IgnoreCase | + RegexOptions.Multiline | + RegexOptions.Singleline; - private static readonly string StyleSingleSectionRegexMatchPattern = - $"{StylePrefixRegexPattern}(?:Single|1)"; + private const string StylePrefixRegexPattern = @"^STYLE\s*:\s*"; + private const string SheetStartPrefixRegexPattern = @"^#START"; - private static readonly string StyleDoubleSectionRegexMatchPattern = - $"{StylePrefixRegexPattern}(?:Double|Couple|2)"; + private static readonly string StyleSingleSectionRegexMatchPattern = + $"{StylePrefixRegexPattern}(?:Single|1)"; - private static readonly string StyleUnrecognizedSectionRegexMatchPattern = - $"{StylePrefixRegexPattern}"; + private static readonly string StyleDoubleSectionRegexMatchPattern = + $"{StylePrefixRegexPattern}(?:Double|Couple|2)"; - private static readonly string SheetStartBareRegexMatchPattern = - $"{SheetStartPrefixRegexPattern}$"; + private static readonly string StyleUnrecognizedSectionRegexMatchPattern = + $"{StylePrefixRegexPattern}"; - private static readonly string SheetStartP1RegexMatchPattern = - $"{SheetStartPrefixRegexPattern}\\s*P1"; + private static readonly string SheetStartBareRegexMatchPattern = + $"{SheetStartPrefixRegexPattern}$"; - private static readonly string SheetStartP2RegexMatchPattern = - $"{SheetStartPrefixRegexPattern}\\s*P2"; + private static readonly string SheetStartP1RegexMatchPattern = + $"{SheetStartPrefixRegexPattern}\\s*P1"; - private static readonly string SheetStartUnrecognizedRegexMatchPattern = - $"{SheetStartPrefixRegexPattern}.*$"; + private static readonly string SheetStartP2RegexMatchPattern = + $"{SheetStartPrefixRegexPattern}\\s*P2"; - private static readonly Regex SectionSplitRegex = new Regex($"(?={StylePrefixRegexPattern})", StyleExtractorRegexOptions); - private static readonly Regex SubSectionSplitRegex = new Regex($"(?={SheetStartPrefixRegexPattern})|(?<=#END\\n)", StyleExtractorRegexOptions); + private static readonly string SheetStartUnrecognizedRegexMatchPattern = + $"{SheetStartPrefixRegexPattern}.*$"; - private static readonly Regex StyleSingleSectionMatchRegex = new Regex(StyleSingleSectionRegexMatchPattern, StyleExtractorRegexOptions); - private static readonly Regex StyleDoubleSectionMatchRegex = new Regex(StyleDoubleSectionRegexMatchPattern, StyleExtractorRegexOptions); - private static readonly Regex StyleUnrecognizedSectionMatchRegex = new Regex(StyleUnrecognizedSectionRegexMatchPattern, StyleExtractorRegexOptions); + private static readonly Regex SectionSplitRegex = new Regex($"(?={StylePrefixRegexPattern})", StyleExtractorRegexOptions); + private static readonly Regex SubSectionSplitRegex = new Regex($"(?={SheetStartPrefixRegexPattern})|(?<=#END\\n)", StyleExtractorRegexOptions); - private static readonly Regex SheetStartPrefixMatchRegex = new Regex(SheetStartPrefixRegexPattern, StyleExtractorRegexOptions); - private static readonly Regex SheetStartBareMatchRegex = new Regex(SheetStartBareRegexMatchPattern, StyleExtractorRegexOptions); - private static readonly Regex SheetStartP1MatchRegex = new Regex(SheetStartP1RegexMatchPattern, StyleExtractorRegexOptions); - private static readonly Regex SheetStartP2MatchRegex = new Regex(SheetStartP2RegexMatchPattern, StyleExtractorRegexOptions); - private static readonly Regex SheetStartUnrecognizedMatchRegex = new Regex(SheetStartUnrecognizedRegexMatchPattern, StyleExtractorRegexOptions); + private static readonly Regex StyleSingleSectionMatchRegex = new Regex(StyleSingleSectionRegexMatchPattern, StyleExtractorRegexOptions); + private static readonly Regex StyleDoubleSectionMatchRegex = new Regex(StyleDoubleSectionRegexMatchPattern, StyleExtractorRegexOptions); + private static readonly Regex StyleUnrecognizedSectionMatchRegex = new Regex(StyleUnrecognizedSectionRegexMatchPattern, StyleExtractorRegexOptions); - private static readonly SectionKindAndSubSectionKind StyleSingleAndSheetStartBare = - new SectionKindAndSubSectionKind(SectionKind.StyleSingle, SubSectionKind.SheetStartBare); + private static readonly Regex SheetStartPrefixMatchRegex = new Regex(SheetStartPrefixRegexPattern, StyleExtractorRegexOptions); + private static readonly Regex SheetStartBareMatchRegex = new Regex(SheetStartBareRegexMatchPattern, StyleExtractorRegexOptions); + private static readonly Regex SheetStartP1MatchRegex = new Regex(SheetStartP1RegexMatchPattern, StyleExtractorRegexOptions); + private static readonly Regex SheetStartP2MatchRegex = new Regex(SheetStartP2RegexMatchPattern, StyleExtractorRegexOptions); + private static readonly Regex SheetStartUnrecognizedMatchRegex = new Regex(SheetStartUnrecognizedRegexMatchPattern, StyleExtractorRegexOptions); - private static readonly SectionKindAndSubSectionKind StyleSingleAndSheetStartP1 = - new SectionKindAndSubSectionKind(SectionKind.StyleSingle, SubSectionKind.SheetStartP1); + private static readonly SectionKindAndSubSectionKind StyleSingleAndSheetStartBare = + new SectionKindAndSubSectionKind(SectionKind.StyleSingle, SubSectionKind.SheetStartBare); - private static readonly SectionKindAndSubSectionKind StyleSingleAndSheetStartP2 = - new SectionKindAndSubSectionKind(SectionKind.StyleSingle, SubSectionKind.SheetStartP2); + private static readonly SectionKindAndSubSectionKind StyleSingleAndSheetStartP1 = + new SectionKindAndSubSectionKind(SectionKind.StyleSingle, SubSectionKind.SheetStartP1); - private static readonly SectionKindAndSubSectionKind StyleSingleAndSheetStartUnrecognized = - new SectionKindAndSubSectionKind(SectionKind.StyleSingle, SubSectionKind.SheetStartUnrecognized); + private static readonly SectionKindAndSubSectionKind StyleSingleAndSheetStartP2 = + new SectionKindAndSubSectionKind(SectionKind.StyleSingle, SubSectionKind.SheetStartP2); - private static readonly SectionKindAndSubSectionKind StyleDoubleAndSheetStartBare = - new SectionKindAndSubSectionKind(SectionKind.StyleDouble, SubSectionKind.SheetStartBare); + private static readonly SectionKindAndSubSectionKind StyleSingleAndSheetStartUnrecognized = + new SectionKindAndSubSectionKind(SectionKind.StyleSingle, SubSectionKind.SheetStartUnrecognized); - private static readonly SectionKindAndSubSectionKind StyleDoubleAndSheetStartP1 = - new SectionKindAndSubSectionKind(SectionKind.StyleDouble, SubSectionKind.SheetStartP1); + private static readonly SectionKindAndSubSectionKind StyleDoubleAndSheetStartBare = + new SectionKindAndSubSectionKind(SectionKind.StyleDouble, SubSectionKind.SheetStartBare); - private static readonly SectionKindAndSubSectionKind StyleDoubleAndSheetStartP2 = - new SectionKindAndSubSectionKind(SectionKind.StyleDouble, SubSectionKind.SheetStartP2); + private static readonly SectionKindAndSubSectionKind StyleDoubleAndSheetStartP1 = + new SectionKindAndSubSectionKind(SectionKind.StyleDouble, SubSectionKind.SheetStartP1); - private static readonly SectionKindAndSubSectionKind StyleDoubleAndSheetStartUnrecognized = - new SectionKindAndSubSectionKind(SectionKind.StyleDouble, SubSectionKind.SheetStartUnrecognized); + private static readonly SectionKindAndSubSectionKind StyleDoubleAndSheetStartP2 = + new SectionKindAndSubSectionKind(SectionKind.StyleDouble, SubSectionKind.SheetStartP2); - private static readonly SectionKindAndSubSectionKind StyleUnrecognizedAndSheetStartBare = - new SectionKindAndSubSectionKind(SectionKind.StyleUnrecognized, SubSectionKind.SheetStartBare); + private static readonly SectionKindAndSubSectionKind StyleDoubleAndSheetStartUnrecognized = + new SectionKindAndSubSectionKind(SectionKind.StyleDouble, SubSectionKind.SheetStartUnrecognized); - private static readonly SectionKindAndSubSectionKind StyleUnrecognizedAndSheetStartP1 = - new SectionKindAndSubSectionKind(SectionKind.StyleUnrecognized, SubSectionKind.SheetStartP1); + private static readonly SectionKindAndSubSectionKind StyleUnrecognizedAndSheetStartBare = + new SectionKindAndSubSectionKind(SectionKind.StyleUnrecognized, SubSectionKind.SheetStartBare); - private static readonly SectionKindAndSubSectionKind StyleUnrecognizedAndSheetStartP2 = - new SectionKindAndSubSectionKind(SectionKind.StyleUnrecognized, SubSectionKind.SheetStartP2); + private static readonly SectionKindAndSubSectionKind StyleUnrecognizedAndSheetStartP1 = + new SectionKindAndSubSectionKind(SectionKind.StyleUnrecognized, SubSectionKind.SheetStartP1); - private static readonly SectionKindAndSubSectionKind StyleUnrecognizedAndSheetStartUnrecognized = - new SectionKindAndSubSectionKind(SectionKind.StyleUnrecognized, SubSectionKind.SheetStartUnrecognized); + private static readonly SectionKindAndSubSectionKind StyleUnrecognizedAndSheetStartP2 = + new SectionKindAndSubSectionKind(SectionKind.StyleUnrecognized, SubSectionKind.SheetStartP2); - private static readonly SectionKindAndSubSectionKind NonStyleAndSheetStartBare = - new SectionKindAndSubSectionKind(SectionKind.NonStyle, SubSectionKind.SheetStartBare); + private static readonly SectionKindAndSubSectionKind StyleUnrecognizedAndSheetStartUnrecognized = + new SectionKindAndSubSectionKind(SectionKind.StyleUnrecognized, SubSectionKind.SheetStartUnrecognized); - private static readonly SectionKindAndSubSectionKind NonStyleAndSheetStartP1 = - new SectionKindAndSubSectionKind(SectionKind.NonStyle, SubSectionKind.SheetStartP1); + private static readonly SectionKindAndSubSectionKind NonStyleAndSheetStartBare = + new SectionKindAndSubSectionKind(SectionKind.NonStyle, SubSectionKind.SheetStartBare); - private static readonly SectionKindAndSubSectionKind NonStyleAndSheetStartP2 = - new SectionKindAndSubSectionKind(SectionKind.NonStyle, SubSectionKind.SheetStartP2); + private static readonly SectionKindAndSubSectionKind NonStyleAndSheetStartP1 = + new SectionKindAndSubSectionKind(SectionKind.NonStyle, SubSectionKind.SheetStartP1); - private static readonly SectionKindAndSubSectionKind NonStyleAndSheetStartUnrecognized = - new SectionKindAndSubSectionKind(SectionKind.NonStyle, SubSectionKind.SheetStartUnrecognized); + private static readonly SectionKindAndSubSectionKind NonStyleAndSheetStartP2 = + new SectionKindAndSubSectionKind(SectionKind.NonStyle, SubSectionKind.SheetStartP2); - private static readonly IDictionary[] - SeqNoSheetRanksBySectionKindAndSubSectionKind = + private static readonly SectionKindAndSubSectionKind NonStyleAndSheetStartUnrecognized = + new SectionKindAndSubSectionKind(SectionKind.NonStyle, SubSectionKind.SheetStartUnrecognized); + + private static readonly IDictionary[] + SeqNoSheetRanksBySectionKindAndSubSectionKind = + { + // seqNo 0 + new Dictionary { - // seqNo 0 - new Dictionary - { - [StyleSingleAndSheetStartBare] = 1, - [StyleSingleAndSheetStartP1] = 2, - [StyleSingleAndSheetStartUnrecognized] = 3, - [NonStyleAndSheetStartBare] = 4, - [NonStyleAndSheetStartP1] = 5, - [NonStyleAndSheetStartUnrecognized] = 6, + [StyleSingleAndSheetStartBare] = 1, + [StyleSingleAndSheetStartP1] = 2, + [StyleSingleAndSheetStartUnrecognized] = 3, + [NonStyleAndSheetStartBare] = 4, + [NonStyleAndSheetStartP1] = 5, + [NonStyleAndSheetStartUnrecognized] = 6, - [StyleUnrecognizedAndSheetStartBare] = 7, - [StyleUnrecognizedAndSheetStartUnrecognized] = 8, - [StyleUnrecognizedAndSheetStartP1] = 9, - [StyleDoubleAndSheetStartP1] = 10, - [StyleDoubleAndSheetStartBare] = 11, - [StyleDoubleAndSheetStartUnrecognized] = 12, + [StyleUnrecognizedAndSheetStartBare] = 7, + [StyleUnrecognizedAndSheetStartUnrecognized] = 8, + [StyleUnrecognizedAndSheetStartP1] = 9, + [StyleDoubleAndSheetStartP1] = 10, + [StyleDoubleAndSheetStartBare] = 11, + [StyleDoubleAndSheetStartUnrecognized] = 12, - [StyleSingleAndSheetStartP2] = 13, - [NonStyleAndSheetStartP2] = 14, - [StyleUnrecognizedAndSheetStartP2] = 15, - [StyleDoubleAndSheetStartP2] = 16, - }, - // seqNo 1 - new Dictionary - { - [StyleDoubleAndSheetStartP1] = 1, - [StyleUnrecognizedAndSheetStartP1] = 2, - [NonStyleAndSheetStartP1] = 3, - [StyleSingleAndSheetStartP1] = 4, + [StyleSingleAndSheetStartP2] = 13, + [NonStyleAndSheetStartP2] = 14, + [StyleUnrecognizedAndSheetStartP2] = 15, + [StyleDoubleAndSheetStartP2] = 16, + }, + // seqNo 1 + new Dictionary + { + [StyleDoubleAndSheetStartP1] = 1, + [StyleUnrecognizedAndSheetStartP1] = 2, + [NonStyleAndSheetStartP1] = 3, + [StyleSingleAndSheetStartP1] = 4, - [StyleDoubleAndSheetStartBare] = 5, - [StyleDoubleAndSheetStartUnrecognized] = 6, - [StyleUnrecognizedAndSheetStartBare] = 7, - [StyleUnrecognizedAndSheetStartUnrecognized] = 8, - [StyleSingleAndSheetStartBare] = 9, - [StyleSingleAndSheetStartUnrecognized] = 10, - [NonStyleAndSheetStartBare] = 11, - [NonStyleAndSheetStartUnrecognized] = 12, + [StyleDoubleAndSheetStartBare] = 5, + [StyleDoubleAndSheetStartUnrecognized] = 6, + [StyleUnrecognizedAndSheetStartBare] = 7, + [StyleUnrecognizedAndSheetStartUnrecognized] = 8, + [StyleSingleAndSheetStartBare] = 9, + [StyleSingleAndSheetStartUnrecognized] = 10, + [NonStyleAndSheetStartBare] = 11, + [NonStyleAndSheetStartUnrecognized] = 12, - [StyleDoubleAndSheetStartP2] = 13, - [StyleUnrecognizedAndSheetStartP2] = 14, - [NonStyleAndSheetStartP2] = 15, - [StyleSingleAndSheetStartP2] = 16, - }, - // seqNo 2 - new Dictionary - { - [StyleDoubleAndSheetStartP2] = 1, - [StyleUnrecognizedAndSheetStartP2] = 2, - [NonStyleAndSheetStartP2] = 3, - [StyleSingleAndSheetStartP2] = 4, + [StyleDoubleAndSheetStartP2] = 13, + [StyleUnrecognizedAndSheetStartP2] = 14, + [NonStyleAndSheetStartP2] = 15, + [StyleSingleAndSheetStartP2] = 16, + }, + // seqNo 2 + new Dictionary + { + [StyleDoubleAndSheetStartP2] = 1, + [StyleUnrecognizedAndSheetStartP2] = 2, + [NonStyleAndSheetStartP2] = 3, + [StyleSingleAndSheetStartP2] = 4, - [StyleDoubleAndSheetStartUnrecognized] = 5, - [StyleDoubleAndSheetStartBare] = 6, - [StyleUnrecognizedAndSheetStartUnrecognized] = 7, - [StyleUnrecognizedAndSheetStartBare] = 8, - [StyleSingleAndSheetStartUnrecognized] = 9, - [StyleSingleAndSheetStartBare] = 10, - [NonStyleAndSheetStartUnrecognized] = 11, - [NonStyleAndSheetStartBare] = 12, + [StyleDoubleAndSheetStartUnrecognized] = 5, + [StyleDoubleAndSheetStartBare] = 6, + [StyleUnrecognizedAndSheetStartUnrecognized] = 7, + [StyleUnrecognizedAndSheetStartBare] = 8, + [StyleSingleAndSheetStartUnrecognized] = 9, + [StyleSingleAndSheetStartBare] = 10, + [NonStyleAndSheetStartUnrecognized] = 11, + [NonStyleAndSheetStartBare] = 12, - [StyleDoubleAndSheetStartP1] = 13, - [StyleUnrecognizedAndSheetStartP1] = 14, - [NonStyleAndSheetStartP1] = 15, - [StyleSingleAndSheetStartP1] = 16, - }, - }; + [StyleDoubleAndSheetStartP1] = 13, + [StyleUnrecognizedAndSheetStartP1] = 14, + [NonStyleAndSheetStartP1] = 15, + [StyleSingleAndSheetStartP1] = 16, + }, + }; - public static string tセッション譜面がある(string strTJA, int seqNo, string strファイル名の絶対パス) { - void TraceError(string subMessage) { - Trace.TraceError(FormatTraceMessage(subMessage)); - } + public static string tセッション譜面がある(string strTJA, int seqNo, string strファイル名の絶対パス) { + void TraceError(string subMessage) { + Trace.TraceError(FormatTraceMessage(subMessage)); + } - string FormatTraceMessage(string subMessage) { - return $"{nameof(CDTXStyleExtractor)} {subMessage} (seqNo={seqNo}, {strファイル名の絶対パス})"; - } + string FormatTraceMessage(string subMessage) { + return $"{nameof(CDTXStyleExtractor)} {subMessage} (seqNo={seqNo}, {strファイル名の絶対パス})"; + } - //入力された譜面がnullでないかチェック。 - if (string.IsNullOrEmpty(strTJA)) { - TraceError("is returning its input value early due to null or empty strTJA."); - return strTJA; - } - - // 1. Break the string up into top-level sections of the following types: - // a) STYLE Single - // b) STYLE Double/Couple - // c) STYLE unrecognized - // d) non-STYLE - var sections = GetSections(strTJA); - - // 2. Within the top-level sections, break each up into sub-sections of the following types: - // a) sheet START P1 - // b) sheet START P2 - // c) sheet START bare - // d) sheet START unrecognized - // e) non-sheet - SubdivideSectionsIntoSubSections(sections); - - // 3. For the current seqNo, rank the found sheets - // using a per-seqNo set of rankings for each - // relevant section/subsection combination. - RankSheets(seqNo, sections); - - // 4. Determine the best-ranked sheet - int bestRank; - try { - bestRank = GetBestRank(sections); - } catch (Exception) { - TraceError("is returning its input value early due to an inability to determine the best rank. This can occur if a course contains no #START."); - return strTJA; - } - - // 5. Remove sheets other than the best-ranked - RemoveSheetsOtherThanTheBestRanked(sections, bestRank); - - // 6. Remove top-level STYLE-type sections which no longer contain a sheet - RemoveRecognizedStyleSectionsWithoutSheets(sections); - - // 7. From supported STYLE-type sections, remove non-sheet subsections beyond - // the selected sheet, to reduce risk of incorrect command processing. - RemoveStyleSectionSubSectionsBeyondTheSelectedSheet(sections); - - // 8. Reassemble the string - return Reassemble(sections); + //入力された譜面がnullでないかチェック。 + if (string.IsNullOrEmpty(strTJA)) { + TraceError("is returning its input value early due to null or empty strTJA."); + return strTJA; } // 1. Break the string up into top-level sections of the following types: @@ -256,47 +214,7 @@ namespace OpenTaiko { // b) STYLE Double/Couple // c) STYLE unrecognized // d) non-STYLE - private static List
GetSections(string strTJA) { - return SectionSplitRegex - .Split(strTJA) - .Select(o => new Section(GetSectionKind(o), o)) - .ToList(); - } - - private static SectionKind GetSectionKind(string section) { - if (StyleSingleSectionMatchRegex.IsMatch(section)) { - return SectionKind.StyleSingle; - } - - if (StyleDoubleSectionMatchRegex.IsMatch(section)) { - return SectionKind.StyleDouble; - } - - if (StyleUnrecognizedSectionMatchRegex.IsMatch(section)) { - return SectionKind.StyleUnrecognized; - } - - return SectionKind.NonStyle; - } - - private enum SectionKind { - StyleSingle, - StyleDouble, - StyleUnrecognized, - NonStyle - } - - private sealed class Section { - public readonly SectionKind SectionKind; - public readonly string OriginalRawValue; - - public List SubSections; - - public Section(SectionKind sectionKind, string originalRawValue) { - SectionKind = sectionKind; - OriginalRawValue = originalRawValue; - } - } + var sections = GetSections(strTJA); // 2. Within the top-level sections, break each up into sub-sections of the following types: // a) sheet START P1 @@ -304,188 +222,270 @@ namespace OpenTaiko { // c) sheet START bare // d) sheet START unrecognized // e) non-sheet - private static void SubdivideSectionsIntoSubSections(IEnumerable
sections) { - foreach (var section in sections) { - section.SubSections = SubSectionSplitRegex - .Split(section.OriginalRawValue) - .Select(o => new SubSection(GetSubsectionKind(o), o)) - .ToList(); - } - } - - private static SubSectionKind GetSubsectionKind(string subsection) { - if (SheetStartPrefixMatchRegex.IsMatch(subsection)) { - if (SheetStartBareMatchRegex.IsMatch(subsection)) { - return SubSectionKind.SheetStartBare; - } - - if (SheetStartP1MatchRegex.IsMatch(subsection)) { - return SubSectionKind.SheetStartP1; - } - - if (SheetStartP2MatchRegex.IsMatch(subsection)) { - return SubSectionKind.SheetStartP2; - } - - if (SheetStartUnrecognizedMatchRegex.IsMatch(subsection)) { - return SubSectionKind.SheetStartUnrecognized; - } - } - - return SubSectionKind.NonSheet; - } - - private enum SubSectionKind { - SheetStartP1, - SheetStartP2, - SheetStartBare, - SheetStartUnrecognized, - NonSheet - } - - private sealed class SubSection { - public readonly SubSectionKind SubSectionKind; - public readonly string OriginalRawValue; - - public int Rank; - - public SubSection(SubSectionKind subSectionKind, string originalRawValue) { - SubSectionKind = subSectionKind; - OriginalRawValue = originalRawValue; - } - } + SubdivideSectionsIntoSubSections(sections); // 3. For the current seqNo, rank the found sheets // using a per-seqNo set of rankings for each // relevant section/subsection combination. - private static void RankSheets(int seqNo, IList
sections) { - var sheetRanksBySectionKindAndSubSectionKind = SeqNoSheetRanksBySectionKindAndSubSectionKind[((seqNo - 1) % 2) + 1]; - - foreach (var section in sections) { - var sectionKind = section.SectionKind; - - foreach (var subSection in section.SubSections) { - var subSectionKind = subSection.SubSectionKind; - - if (subSectionKind == SubSectionKind.NonSheet) { - continue; - } - - var sectionKindAndSubSectionKind = new SectionKindAndSubSectionKind( - sectionKind, subSectionKind); - - subSection.Rank = sheetRanksBySectionKindAndSubSectionKind[sectionKindAndSubSectionKind]; - } - } - } - - private sealed class SectionKindAndSubSectionKind : IEquatable { - public readonly SectionKind SectionKind; - public readonly SubSectionKind SubSectionKind; - - public SectionKindAndSubSectionKind(SectionKind sectionKind, SubSectionKind subSectionKind) { - SectionKind = sectionKind; - SubSectionKind = subSectionKind; - } - - public bool Equals(SectionKindAndSubSectionKind other) { - if (ReferenceEquals(null, other)) return false; - if (ReferenceEquals(this, other)) return true; - return SectionKind == other.SectionKind && SubSectionKind == other.SubSectionKind; - } - - public override bool Equals(object obj) { - if (ReferenceEquals(null, obj)) return false; - if (ReferenceEquals(this, obj)) return true; - return obj is SectionKindAndSubSectionKind other && Equals(other); - } - - public override int GetHashCode() { - unchecked { - return ((int)SectionKind * 397) ^ (int)SubSectionKind; - } - } - - public static bool operator ==(SectionKindAndSubSectionKind left, SectionKindAndSubSectionKind right) { - return Equals(left, right); - } - - public static bool operator !=(SectionKindAndSubSectionKind left, SectionKindAndSubSectionKind right) { - return !Equals(left, right); - } - } + RankSheets(seqNo, sections); // 4. Determine the best-ranked sheet - private static int GetBestRank(IList
sections) { - return sections - .SelectMany(o => o.SubSections) - .Where(o => o.SubSectionKind != SubSectionKind.NonSheet) - .Select(o => o.Rank) - .Min(); + int bestRank; + try { + bestRank = GetBestRank(sections); + } catch (Exception) { + TraceError("is returning its input value early due to an inability to determine the best rank. This can occur if a course contains no #START."); + return strTJA; } // 5. Remove sheets other than the best-ranked - private static void RemoveSheetsOtherThanTheBestRanked(IList
sections, int bestRank) { - // We can safely remove based on > bestRank because the subsection types - // which are never removed always have a Rank value of 0. - - foreach (var section in sections) { - section.SubSections.RemoveAll(o => o.Rank > bestRank); - } - - // If there was a tie for the best sheet, - // take the first and remove the rest. - var extraBestRankedSheets = new HashSet(sections - .SelectMany(o => o.SubSections) - .Where(o => o.Rank == bestRank) - .Skip(1)); - - foreach (var section in sections) { - section.SubSections.RemoveAll(extraBestRankedSheets.Contains); - } - } + RemoveSheetsOtherThanTheBestRanked(sections, bestRank); // 6. Remove top-level STYLE-type sections which no longer contain a sheet - private static void RemoveRecognizedStyleSectionsWithoutSheets(List
sections) { - // Note that we dare not remove SectionKind.StyleUnrecognized instances without sheets. - // The reason is because there are plenty of .tja files with weird STYLE: header values - // and which are located very early in the file. Removing those sections would remove - // important information, and was one of the problems with the years-old splitting code - // which was replaced in late summer 2018 and which is now being overhauled in early fall 2018. - - sections.RemoveAll(o => - (o.SectionKind == SectionKind.StyleSingle || o.SectionKind == SectionKind.StyleDouble) && - o.SubSections.Count(subSection => subSection.SubSectionKind == SubSectionKind.NonSheet) == o.SubSections.Count); - } + RemoveRecognizedStyleSectionsWithoutSheets(sections); // 7. From supported STYLE-type sections, remove non-sheet subsections beyond // the selected sheet, to reduce risk of incorrect command processing. - private static void RemoveStyleSectionSubSectionsBeyondTheSelectedSheet(List
sections) { - foreach (var section in sections) { - if (section.SectionKind == SectionKind.StyleSingle || section.SectionKind == SectionKind.StyleDouble) { - var subSections = section.SubSections; - - var lastIndex = subSections.FindIndex(o => o.SubSectionKind != SubSectionKind.NonSheet); - var removalIndex = lastIndex + 1; - - if (lastIndex != -1 && removalIndex < subSections.Count) { - subSections.RemoveRange(removalIndex, subSections.Count - removalIndex); - } - } - } - } + RemoveStyleSectionSubSectionsBeyondTheSelectedSheet(sections); // 8. Reassemble the string - private static string Reassemble(List
sections) { - var sb = new StringBuilder(); + return Reassemble(sections); + } - foreach (var section in sections) { - foreach (var subSection in section.SubSections) { - sb.Append(subSection.OriginalRawValue); - } - } + // 1. Break the string up into top-level sections of the following types: + // a) STYLE Single + // b) STYLE Double/Couple + // c) STYLE unrecognized + // d) non-STYLE + private static List
GetSections(string strTJA) { + return SectionSplitRegex + .Split(strTJA) + .Select(o => new Section(GetSectionKind(o), o)) + .ToList(); + } - return sb.ToString(); + private static SectionKind GetSectionKind(string section) { + if (StyleSingleSectionMatchRegex.IsMatch(section)) { + return SectionKind.StyleSingle; + } + + if (StyleDoubleSectionMatchRegex.IsMatch(section)) { + return SectionKind.StyleDouble; + } + + if (StyleUnrecognizedSectionMatchRegex.IsMatch(section)) { + return SectionKind.StyleUnrecognized; + } + + return SectionKind.NonStyle; + } + + private enum SectionKind { + StyleSingle, + StyleDouble, + StyleUnrecognized, + NonStyle + } + + private sealed class Section { + public readonly SectionKind SectionKind; + public readonly string OriginalRawValue; + + public List SubSections; + + public Section(SectionKind sectionKind, string originalRawValue) { + SectionKind = sectionKind; + OriginalRawValue = originalRawValue; } } + + // 2. Within the top-level sections, break each up into sub-sections of the following types: + // a) sheet START P1 + // b) sheet START P2 + // c) sheet START bare + // d) sheet START unrecognized + // e) non-sheet + private static void SubdivideSectionsIntoSubSections(IEnumerable
sections) { + foreach (var section in sections) { + section.SubSections = SubSectionSplitRegex + .Split(section.OriginalRawValue) + .Select(o => new SubSection(GetSubsectionKind(o), o)) + .ToList(); + } + } + + private static SubSectionKind GetSubsectionKind(string subsection) { + if (SheetStartPrefixMatchRegex.IsMatch(subsection)) { + if (SheetStartBareMatchRegex.IsMatch(subsection)) { + return SubSectionKind.SheetStartBare; + } + + if (SheetStartP1MatchRegex.IsMatch(subsection)) { + return SubSectionKind.SheetStartP1; + } + + if (SheetStartP2MatchRegex.IsMatch(subsection)) { + return SubSectionKind.SheetStartP2; + } + + if (SheetStartUnrecognizedMatchRegex.IsMatch(subsection)) { + return SubSectionKind.SheetStartUnrecognized; + } + } + + return SubSectionKind.NonSheet; + } + + private enum SubSectionKind { + SheetStartP1, + SheetStartP2, + SheetStartBare, + SheetStartUnrecognized, + NonSheet + } + + private sealed class SubSection { + public readonly SubSectionKind SubSectionKind; + public readonly string OriginalRawValue; + + public int Rank; + + public SubSection(SubSectionKind subSectionKind, string originalRawValue) { + SubSectionKind = subSectionKind; + OriginalRawValue = originalRawValue; + } + } + + // 3. For the current seqNo, rank the found sheets + // using a per-seqNo set of rankings for each + // relevant section/subsection combination. + private static void RankSheets(int seqNo, IList
sections) { + var sheetRanksBySectionKindAndSubSectionKind = SeqNoSheetRanksBySectionKindAndSubSectionKind[((seqNo - 1) % 2) + 1]; + + foreach (var section in sections) { + var sectionKind = section.SectionKind; + + foreach (var subSection in section.SubSections) { + var subSectionKind = subSection.SubSectionKind; + + if (subSectionKind == SubSectionKind.NonSheet) { + continue; + } + + var sectionKindAndSubSectionKind = new SectionKindAndSubSectionKind( + sectionKind, subSectionKind); + + subSection.Rank = sheetRanksBySectionKindAndSubSectionKind[sectionKindAndSubSectionKind]; + } + } + } + + private sealed class SectionKindAndSubSectionKind : IEquatable { + public readonly SectionKind SectionKind; + public readonly SubSectionKind SubSectionKind; + + public SectionKindAndSubSectionKind(SectionKind sectionKind, SubSectionKind subSectionKind) { + SectionKind = sectionKind; + SubSectionKind = subSectionKind; + } + + public bool Equals(SectionKindAndSubSectionKind other) { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + return SectionKind == other.SectionKind && SubSectionKind == other.SubSectionKind; + } + + public override bool Equals(object obj) { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj is SectionKindAndSubSectionKind other && Equals(other); + } + + public override int GetHashCode() { + unchecked { + return ((int)SectionKind * 397) ^ (int)SubSectionKind; + } + } + + public static bool operator ==(SectionKindAndSubSectionKind left, SectionKindAndSubSectionKind right) { + return Equals(left, right); + } + + public static bool operator !=(SectionKindAndSubSectionKind left, SectionKindAndSubSectionKind right) { + return !Equals(left, right); + } + } + + // 4. Determine the best-ranked sheet + private static int GetBestRank(IList
sections) { + return sections + .SelectMany(o => o.SubSections) + .Where(o => o.SubSectionKind != SubSectionKind.NonSheet) + .Select(o => o.Rank) + .Min(); + } + + // 5. Remove sheets other than the best-ranked + private static void RemoveSheetsOtherThanTheBestRanked(IList
sections, int bestRank) { + // We can safely remove based on > bestRank because the subsection types + // which are never removed always have a Rank value of 0. + + foreach (var section in sections) { + section.SubSections.RemoveAll(o => o.Rank > bestRank); + } + + // If there was a tie for the best sheet, + // take the first and remove the rest. + var extraBestRankedSheets = new HashSet(sections + .SelectMany(o => o.SubSections) + .Where(o => o.Rank == bestRank) + .Skip(1)); + + foreach (var section in sections) { + section.SubSections.RemoveAll(extraBestRankedSheets.Contains); + } + } + + // 6. Remove top-level STYLE-type sections which no longer contain a sheet + private static void RemoveRecognizedStyleSectionsWithoutSheets(List
sections) { + // Note that we dare not remove SectionKind.StyleUnrecognized instances without sheets. + // The reason is because there are plenty of .tja files with weird STYLE: header values + // and which are located very early in the file. Removing those sections would remove + // important information, and was one of the problems with the years-old splitting code + // which was replaced in late summer 2018 and which is now being overhauled in early fall 2018. + + sections.RemoveAll(o => + (o.SectionKind == SectionKind.StyleSingle || o.SectionKind == SectionKind.StyleDouble) && + o.SubSections.Count(subSection => subSection.SubSectionKind == SubSectionKind.NonSheet) == o.SubSections.Count); + } + + // 7. From supported STYLE-type sections, remove non-sheet subsections beyond + // the selected sheet, to reduce risk of incorrect command processing. + private static void RemoveStyleSectionSubSectionsBeyondTheSelectedSheet(List
sections) { + foreach (var section in sections) { + if (section.SectionKind == SectionKind.StyleSingle || section.SectionKind == SectionKind.StyleDouble) { + var subSections = section.SubSections; + + var lastIndex = subSections.FindIndex(o => o.SubSectionKind != SubSectionKind.NonSheet); + var removalIndex = lastIndex + 1; + + if (lastIndex != -1 && removalIndex < subSections.Count) { + subSections.RemoveRange(removalIndex, subSections.Count - removalIndex); + } + } + } + } + + // 8. Reassemble the string + private static string Reassemble(List
sections) { + var sb = new StringBuilder(); + + foreach (var section in sections) { + foreach (var subSection in section.SubSections) { + sb.Append(subSection.OriginalRawValue); + } + } + + return sb.ToString(); + } } diff --git a/OpenTaiko/src/Songs/CScoreIni.cs b/OpenTaiko/src/Songs/CScoreIni.cs index 4c7e0b99..3b2aa7f2 100644 --- a/OpenTaiko/src/Songs/CScoreIni.cs +++ b/OpenTaiko/src/Songs/CScoreIni.cs @@ -1,20 +1,20 @@ -namespace OpenTaiko { +namespace OpenTaiko; + +[Serializable] +public class CScoreIni { + // Properties + [Serializable] - public class CScoreIni { - // Properties - - [Serializable] - public class C演奏記録 { - public int nOkCount; - public int nBadCount; - public int nGoodCount; - public Dan_C[] Dan_C; - - public C演奏記録() { - Dan_C = new Dan_C[CExamInfo.cMaxExam]; - } + public class C演奏記録 { + public int nOkCount; + public int nBadCount; + public int nGoodCount; + public Dan_C[] Dan_C; + public C演奏記録() { + Dan_C = new Dan_C[CExamInfo.cMaxExam]; } } + } diff --git a/OpenTaiko/src/Songs/CScoreIni_Importer.cs b/OpenTaiko/src/Songs/CScoreIni_Importer.cs index fdb60a69..a37a6cb4 100644 --- a/OpenTaiko/src/Songs/CScoreIni_Importer.cs +++ b/OpenTaiko/src/Songs/CScoreIni_Importer.cs @@ -1,207 +1,208 @@ using System.Diagnostics; using Microsoft.Data.Sqlite; -namespace OpenTaiko { - static class CScoreIni_Importer { - public static string Status { get; private set; } = ""; - private static readonly string langSUBTITLE = "SUBTITLE" + CLangManager.LangInstance.Id.ToUpper(); - public static void ImportScoreInisToSavesDb3() { - Trace.TraceInformation("Importing score.ini files to Saves.db3 database!"); +namespace OpenTaiko; - //Status = "Establishing connection to database..."; // I don't think the player needs to know this info ¯\_(ツ)_/¯ - Status = CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_IMPORTSCOREINI_STATUS1"); +static class CScoreIni_Importer { + public static string Status { get; private set; } = ""; + private static readonly string langSUBTITLE = "SUBTITLE" + CLangManager.LangInstance.Id.ToUpper(); + public static void ImportScoreInisToSavesDb3() { + Trace.TraceInformation("Importing score.ini files to Saves.db3 database!"); - SqliteConnection? connection = DBSaves.GetSavesDBConnection(); - if (connection == null) { - Trace.TraceError("Could not establish a connection to Saves.db3 database. Aborting score import."); - Status = ""; - return; - } + //Status = "Establishing connection to database..."; // I don't think the player needs to know this info ¯\_(ツ)_/¯ + Status = CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_IMPORTSCOREINI_STATUS1"); - List _scoreFiles = new List(); - foreach (string path in OpenTaiko.ConfigIni.strSongsPath.Split(';', StringSplitOptions.RemoveEmptyEntries)) { - _scoreFiles.AddRange(Directory.GetFiles(path, "*.score.ini", SearchOption.AllDirectories)); - } - Trace.TraceInformation($"{_scoreFiles.Count} score.ini files have been found. Beginning import."); + SqliteConnection? connection = DBSaves.GetSavesDBConnection(); + if (connection == null) { + Trace.TraceError("Could not establish a connection to Saves.db3 database. Aborting score import."); + Status = ""; + return; + } - int totalcount = 0; - int successcount = 0; - int skipcount = 0; - int errorcount = 0; + List _scoreFiles = new List(); + foreach (string path in OpenTaiko.ConfigIni.strSongsPath.Split(';', StringSplitOptions.RemoveEmptyEntries)) { + _scoreFiles.AddRange(Directory.GetFiles(path, "*.score.ini", SearchOption.AllDirectories)); + } + Trace.TraceInformation($"{_scoreFiles.Count} score.ini files have been found. Beginning import."); - foreach (string _score in _scoreFiles) { + int totalcount = 0; + int successcount = 0; + int skipcount = 0; + int errorcount = 0; - Status = CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_IMPORTSCOREINI_STATUS2", _scoreFiles.Count, successcount, totalcount, skipcount, errorcount, Path.GetFileName(_score)); - //Status = $"Importing {_scoreFiles.Count} scores...\n{importcount} of {totalcount} imported ({skipcount} skipped / {errorcount} failed)\n\n{Path.GetFileName(_score)}"; + foreach (string _score in _scoreFiles) { - //Trace.TraceInformation(Status); - try { - string directory = Path.GetDirectoryName(_score); - DirectoryInfo dir_parent = Directory.GetParent(directory); + Status = CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_IMPORTSCOREINI_STATUS2", _scoreFiles.Count, successcount, totalcount, skipcount, errorcount, Path.GetFileName(_score)); + //Status = $"Importing {_scoreFiles.Count} scores...\n{importcount} of {totalcount} imported ({skipcount} skipped / {errorcount} failed)\n\n{Path.GetFileName(_score)}"; - string[] TJAData = Array.Empty(); - if (File.Exists(GetTJAFile(_score))) - TJAData = File.ReadAllLines(GetTJAFile(_score)); - string[] Difficulties = TJAData.Where(str => str.StartsWith("COURSE:")).ToArray(); - string[] Levels = TJAData.Where(str => str.StartsWith("LEVEL:")).ToArray(); + //Trace.TraceInformation(Status); + try { + string directory = Path.GetDirectoryName(_score); + DirectoryInfo dir_parent = Directory.GetParent(directory); - string[] ScoreData = File.ReadAllLines(_score); + string[] TJAData = Array.Empty(); + if (File.Exists(GetTJAFile(_score))) + TJAData = File.ReadAllLines(GetTJAFile(_score)); + string[] Difficulties = TJAData.Where(str => str.StartsWith("COURSE:")).ToArray(); + string[] Levels = TJAData.Where(str => str.StartsWith("LEVEL:")).ToArray(); - CSongUniqueID UniqueId = new CSongUniqueID(Path.Combine(directory, "uniqueID.json")); - CBoxDef boxdef = new CBoxDef(); - if (File.Exists(Path.Combine(dir_parent.FullName, "box.def"))) - boxdef = new CBoxDef(Path.Combine(dir_parent.FullName, "box.def")); - //string Charter = ""; - string[] Charters = new string[8] { "", "", "", "", "", "", "", "" }; - string Artist = ""; + string[] ScoreData = File.ReadAllLines(_score); - int[] Level = { -1, -1, -1, -1, -1, -1, -1 }; - int[] Clear = { -1, -1, -1, -1, -1, -1, -1 }; - int[] Rank = { -1, -1, -1, -1, -1, -1, -1 }; - int[] HighScore = { 0, 0, 0, 0, 0, 0, 0 }; + CSongUniqueID UniqueId = new CSongUniqueID(Path.Combine(directory, "uniqueID.json")); + CBoxDef boxdef = new CBoxDef(); + if (File.Exists(Path.Combine(dir_parent.FullName, "box.def"))) + boxdef = new CBoxDef(Path.Combine(dir_parent.FullName, "box.def")); + //string Charter = ""; + string[] Charters = new string[8] { "", "", "", "", "", "", "", "" }; + string Artist = ""; - foreach (string data in TJAData) { - string[] split = data.Split(":", 2); - switch (split[0]) { - case "SUBTITLE": - Artist = split[1].StartsWith("--") || split[1].StartsWith("++") ? split[1].Substring(2) : split[1]; - break; - case "MAKER": - Charters[0] = split[1]; - break; - case "NOTESDESIGNER0": - Charters[1] = split[1]; - break; - case "NOTESDESIGNER1": - Charters[2] = split[1]; - break; - case "NOTESDESIGNER2": - Charters[3] = split[1]; - break; - case "NOTESDESIGNER3": - Charters[4] = split[1]; - break; - case "NOTESDESIGNER4": - Charters[5] = split[1]; - break; - case "NOTESDESIGNER5": - Charters[6] = split[1]; - break; - case "NOTESDESIGNER6": - Charters[7] = split[1]; - break; - default: - if (split[0] == langSUBTITLE) - Artist = split[1]; - break; - } + int[] Level = { -1, -1, -1, -1, -1, -1, -1 }; + int[] Clear = { -1, -1, -1, -1, -1, -1, -1 }; + int[] Rank = { -1, -1, -1, -1, -1, -1, -1 }; + int[] HighScore = { 0, 0, 0, 0, 0, 0, 0 }; + + foreach (string data in TJAData) { + string[] split = data.Split(":", 2); + switch (split[0]) { + case "SUBTITLE": + Artist = split[1].StartsWith("--") || split[1].StartsWith("++") ? split[1].Substring(2) : split[1]; + break; + case "MAKER": + Charters[0] = split[1]; + break; + case "NOTESDESIGNER0": + Charters[1] = split[1]; + break; + case "NOTESDESIGNER1": + Charters[2] = split[1]; + break; + case "NOTESDESIGNER2": + Charters[3] = split[1]; + break; + case "NOTESDESIGNER3": + Charters[4] = split[1]; + break; + case "NOTESDESIGNER4": + Charters[5] = split[1]; + break; + case "NOTESDESIGNER5": + Charters[6] = split[1]; + break; + case "NOTESDESIGNER6": + Charters[7] = split[1]; + break; + default: + if (split[0] == langSUBTITLE) + Artist = split[1]; + break; } + } - // Tower/Dan score data is saved in index 0 (Easy). - for (int i = 0; i < Difficulties.Length; i++) { - int diff_index = Difficulties[i].IndexOf(':') + 1; - int lvl_index = Levels[i].IndexOf(":") + 1; + // Tower/Dan score data is saved in index 0 (Easy). + for (int i = 0; i < Difficulties.Length; i++) { + int diff_index = Difficulties[i].IndexOf(':') + 1; + int lvl_index = Levels[i].IndexOf(":") + 1; - int level = int.TryParse(Levels[i].Substring(lvl_index), out int result) ? result : -1; - switch (Difficulties[i].Substring(diff_index).ToLower()) { - case "0": - case "easy": - Level[0] = level; - break; - case "1": - case "normal": - Level[1] = level; - break; - case "2": - case "hard": - Level[2] = level; - break; - case "3": - case "oni": - Level[3] = level; - break; - case "4": - case "edit": - Level[4] = level; - break; - case "5": - case "tower": - Level[5] = level; - break; - case "6": - case "dan": - Level[6] = level; - break; - } + int level = int.TryParse(Levels[i].Substring(lvl_index), out int result) ? result : -1; + switch (Difficulties[i].Substring(diff_index).ToLower()) { + case "0": + case "easy": + Level[0] = level; + break; + case "1": + case "normal": + Level[1] = level; + break; + case "2": + case "hard": + Level[2] = level; + break; + case "3": + case "oni": + Level[3] = level; + break; + case "4": + case "edit": + Level[4] = level; + break; + case "5": + case "tower": + Level[5] = level; + break; + case "6": + case "dan": + Level[6] = level; + break; } + } - foreach (string data in ScoreData) { - string[] split = data.Split('=', 2); - int num = 0; - if (split.Length == 2) num = int.TryParse(split[1], out int result) ? result : 0; - switch (split[0]) { - case "HiScore1": - HighScore[0] = num; - HighScore[5] = num; - HighScore[6] = num; - break; - case "HiScore2": - HighScore[1] = num; - break; - case "HiScore3": - HighScore[2] = num; - break; - case "HiScore4": - HighScore[3] = num; - break; - case "HiScore5": - HighScore[4] = num; - break; + foreach (string data in ScoreData) { + string[] split = data.Split('=', 2); + int num = 0; + if (split.Length == 2) num = int.TryParse(split[1], out int result) ? result : 0; + switch (split[0]) { + case "HiScore1": + HighScore[0] = num; + HighScore[5] = num; + HighScore[6] = num; + break; + case "HiScore2": + HighScore[1] = num; + break; + case "HiScore3": + HighScore[2] = num; + break; + case "HiScore4": + HighScore[3] = num; + break; + case "HiScore5": + HighScore[4] = num; + break; - case "Clear0": - Clear[0] = num == 0 ? -1 : num; - Clear[5] = num == 0 ? -1 : num; - Clear[6] = num == 0 ? -1 : num; - break; - case "Clear1": - Clear[1] = num == 0 ? -1 : num; - break; - case "Clear2": - Clear[2] = num == 0 ? -1 : num; - break; - case "Clear3": - Clear[3] = num == 0 ? -1 : num; - break; - case "Clear4": - Clear[4] = num == 0 ? -1 : num; - break; + case "Clear0": + Clear[0] = num == 0 ? -1 : num; + Clear[5] = num == 0 ? -1 : num; + Clear[6] = num == 0 ? -1 : num; + break; + case "Clear1": + Clear[1] = num == 0 ? -1 : num; + break; + case "Clear2": + Clear[2] = num == 0 ? -1 : num; + break; + case "Clear3": + Clear[3] = num == 0 ? -1 : num; + break; + case "Clear4": + Clear[4] = num == 0 ? -1 : num; + break; - case "ScoreRank0": - Rank[0] = num - 1; - Rank[5] = num - 1; - Rank[6] = num - 1; - break; - case "ScoreRank1": - Rank[1] = num - 1; - break; - case "ScoreRank2": - Rank[2] = num - 1; - break; - case "ScoreRank3": - Rank[3] = num - 1; - break; - case "ScoreRank4": - Rank[4] = num - 1; - break; - } + case "ScoreRank0": + Rank[0] = num - 1; + Rank[5] = num - 1; + Rank[6] = num - 1; + break; + case "ScoreRank1": + Rank[1] = num - 1; + break; + case "ScoreRank2": + Rank[2] = num - 1; + break; + case "ScoreRank3": + Rank[3] = num - 1; + break; + case "ScoreRank4": + Rank[4] = num - 1; + break; } + } - bool success = false; - for (int i = 0; i < Level.Length; i++) { - int score_index = i < 5 ? i : 0; - if (Level[i] != -1 && HighScore[score_index] > 0) { - SqliteCommand cmd = connection.CreateCommand(); - cmd.CommandText = $@" + bool success = false; + for (int i = 0; i < Level.Length; i++) { + int score_index = i < 5 ? i : 0; + if (Level[i] != -1 && HighScore[score_index] > 0) { + SqliteCommand cmd = connection.CreateCommand(); + cmd.CommandText = $@" INSERT INTO best_plays(ChartUniqueId,ChartGenre,Charter,Artist,PlayMods,ChartDifficulty,ChartLevel,ClearStatus,ScoreRank,HighScore,SaveId,TowerBestFloor,DanExam1,DanExam2,DanExam3,DanExam4,DanExam5,DanExam6,DanExam7,PlayCount,HighScoreGoodCount,HighScoreOkCount,HighScoreBadCount,HighScoreMaxCombo,HighScoreRollCount,HighScoreADLibCount,HighScoreBoomCount) VALUES( '{UniqueId.data.id.EscapeSingleQuotes()}', @@ -234,38 +235,37 @@ namespace OpenTaiko { ) ON CONFLICT(ChartUniqueId,ChartDifficulty,PlayMods) DO NOTHING "; - if (cmd.ExecuteNonQuery() > 0) { successcount++; success = true; } - } + if (cmd.ExecuteNonQuery() > 0) { successcount++; success = true; } } - if (!success) { skipcount++; } - } catch (Exception ex) { - Trace.TraceWarning($"Failed to import {_score} into new database. More details:\n{ex}"); - errorcount++; - } finally { totalcount++; } - } - Trace.TraceInformation($"Imported {successcount} of {_scoreFiles.Count} scores from score.ini files. ({errorcount} failed imports; {skipcount} skipped imports;)"); - Status = ""; + } + if (!success) { skipcount++; } + } catch (Exception ex) { + Trace.TraceWarning($"Failed to import {_score} into new database. More details:\n{ex}"); + errorcount++; + } finally { totalcount++; } } + Trace.TraceInformation($"Imported {successcount} of {_scoreFiles.Count} scores from score.ini files. ({errorcount} failed imports; {skipcount} skipped imports;)"); + Status = ""; + } - private static string GetTJAFile(string path) { - FileInfo info = new FileInfo(path); + private static string GetTJAFile(string path) { + FileInfo info = new FileInfo(path); - if (info.FullName.EndsWith($"{OpenTaiko.ConfigIni.sSaveFile[0]}.score.ini")) return info.FullName.Replace($"{OpenTaiko.ConfigIni.sSaveFile[0]}.score.ini", ""); - if (info.FullName.EndsWith($"{OpenTaiko.ConfigIni.sSaveFile[1]}.score.ini")) return info.FullName.Replace($"{OpenTaiko.ConfigIni.sSaveFile[1]}.score.ini", ""); - if (info.FullName.EndsWith($"{OpenTaiko.ConfigIni.sSaveFile[2]}.score.ini")) return info.FullName.Replace($"{OpenTaiko.ConfigIni.sSaveFile[2]}.score.ini", ""); - if (info.FullName.EndsWith($"{OpenTaiko.ConfigIni.sSaveFile[3]}.score.ini")) return info.FullName.Replace($"{OpenTaiko.ConfigIni.sSaveFile[3]}.score.ini", ""); - if (info.FullName.EndsWith($"{OpenTaiko.ConfigIni.sSaveFile[4]}.score.ini")) return info.FullName.Replace($"{OpenTaiko.ConfigIni.sSaveFile[4]}.score.ini", ""); - return info.FullName.Replace(".score.ini", ""); - } - private static int GetPlayerId(string path) { - FileInfo info = new FileInfo(path); + if (info.FullName.EndsWith($"{OpenTaiko.ConfigIni.sSaveFile[0]}.score.ini")) return info.FullName.Replace($"{OpenTaiko.ConfigIni.sSaveFile[0]}.score.ini", ""); + if (info.FullName.EndsWith($"{OpenTaiko.ConfigIni.sSaveFile[1]}.score.ini")) return info.FullName.Replace($"{OpenTaiko.ConfigIni.sSaveFile[1]}.score.ini", ""); + if (info.FullName.EndsWith($"{OpenTaiko.ConfigIni.sSaveFile[2]}.score.ini")) return info.FullName.Replace($"{OpenTaiko.ConfigIni.sSaveFile[2]}.score.ini", ""); + if (info.FullName.EndsWith($"{OpenTaiko.ConfigIni.sSaveFile[3]}.score.ini")) return info.FullName.Replace($"{OpenTaiko.ConfigIni.sSaveFile[3]}.score.ini", ""); + if (info.FullName.EndsWith($"{OpenTaiko.ConfigIni.sSaveFile[4]}.score.ini")) return info.FullName.Replace($"{OpenTaiko.ConfigIni.sSaveFile[4]}.score.ini", ""); + return info.FullName.Replace(".score.ini", ""); + } + private static int GetPlayerId(string path) { + FileInfo info = new FileInfo(path); - if (info.Name.EndsWith($"{OpenTaiko.ConfigIni.sSaveFile[0]}.score.ini")) return 0; - if (info.Name.EndsWith($"{OpenTaiko.ConfigIni.sSaveFile[1]}.score.ini")) return 1; - if (info.Name.EndsWith($"{OpenTaiko.ConfigIni.sSaveFile[2]}.score.ini")) return 2; - if (info.Name.EndsWith($"{OpenTaiko.ConfigIni.sSaveFile[3]}.score.ini")) return 3; - if (info.Name.EndsWith($"{OpenTaiko.ConfigIni.sSaveFile[4]}.score.ini")) return 4; - return 0; - } + if (info.Name.EndsWith($"{OpenTaiko.ConfigIni.sSaveFile[0]}.score.ini")) return 0; + if (info.Name.EndsWith($"{OpenTaiko.ConfigIni.sSaveFile[1]}.score.ini")) return 1; + if (info.Name.EndsWith($"{OpenTaiko.ConfigIni.sSaveFile[2]}.score.ini")) return 2; + if (info.Name.EndsWith($"{OpenTaiko.ConfigIni.sSaveFile[3]}.score.ini")) return 3; + if (info.Name.EndsWith($"{OpenTaiko.ConfigIni.sSaveFile[4]}.score.ini")) return 4; + return 0; } } diff --git a/OpenTaiko/src/Songs/CSongListNode.cs b/OpenTaiko/src/Songs/CSongListNode.cs index dd66e14f..7b1b789c 100644 --- a/OpenTaiko/src/Songs/CSongListNode.cs +++ b/OpenTaiko/src/Songs/CSongListNode.cs @@ -1,130 +1,130 @@ using System.Drawing; -namespace OpenTaiko { - [Serializable] - internal class CSongListNode { - // Properties +namespace OpenTaiko; - public ENodeType eノード種別 = ENodeType.UNKNOWN; - public enum ENodeType { - SCORE, - SCORE_MIDI, - BOX, - BACKBOX, - RANDOM, - UNKNOWN - } - public int nID { get; private set; } - public Cスコア[] arスコア = new Cスコア[(int)Difficulty.Total]; +[Serializable] +internal class CSongListNode { + // Properties - public string[] ar難易度ラベル = new string[(int)Difficulty.Total]; - public bool bDTXFilesで始まるフォルダ名のBOXである; - public bool bBoxDefで作成されたBOXである { - get { - return !this.bDTXFilesで始まるフォルダ名のBOXである; - } - set { - this.bDTXFilesで始まるフォルダ名のBOXである = !value; - } - } - public Color col文字色 = Color.White; - public Color ForeColor = Color.White; - public Color BackColor = Color.Black; - public Color BoxColor = Color.White; - - public Color BgColor = Color.White; - public bool isChangedBgColor; - public bool isChangedBgType; - public bool isChangedBoxType; - public string BoxType; - public string BgType; - public string BoxChara; - public bool isChangedBoxChara; - - public bool IsChangedForeColor; - public bool IsChangedBackColor; - public bool isChangedBoxColor; - public List listランダム用ノードリスト; - public List list子リスト; - public int nGood範囲ms = -1; - public int nGreat範囲ms = -1; - public int nPerfect範囲ms = -1; - public int nPoor範囲ms = -1; - public int nスコア数; - - public CSongListNode rParentNode; - - public int Openindex; - public bool bIsOpenFolder; - public string strジャンル = ""; - public string str本当のジャンル = ""; - public CLocalizationData ldTitle = new CLocalizationData(); - public List DanSongs; - public Dan_C[] Dan_C; - public CLocalizationData ldSubtitle = new CLocalizationData(); - public string strMaker = ""; - public string[] strNotesDesigner = new string[(int)Difficulty.Total] { "", "", "", "", "", "", "" }; - public CDTX.ESide nSide = CDTX.ESide.eEx; - public bool bExplicit = false; - public bool bMovie = false; - public string strBreadcrumbs = ""; // #27060 2011.2.27 yyagi; MUSIC BOXのパンくずリスト (曲リスト構造内の絶対位置捕捉のために使う) - public string strSkinPath = ""; // #28195 2012.5.4 yyagi; box.defでのスキン切り替え対応 - public bool bBranch = false; - public int[] nLevel = new int[(int)Difficulty.Total] { 0, 0, 0, 0, 0, 0, 0 }; - public CDTX.ELevelIcon[] nLevelIcon = new CDTX.ELevelIcon[(int)Difficulty.Total] { CDTX.ELevelIcon.eNone, CDTX.ELevelIcon.eNone, CDTX.ELevelIcon.eNone, CDTX.ELevelIcon.eNone, CDTX.ELevelIcon.eNone, CDTX.ELevelIcon.eNone, CDTX.ELevelIcon.eNone }; - - // Tower Lives - public int nLife = 5; - public int nTotalFloor = 140; - public string nTowerType; - - // Unique id - public CSongUniqueID uniqueId; - - public int nDanTick = 0; - public Color cDanTickColor = Color.White; - - public CLocalizationData[] strBoxText = new CLocalizationData[3] { new CLocalizationData(), new CLocalizationData(), new CLocalizationData() }; - - public string strSelectBGPath; - - // In-game visuals - - public string strScenePreset = null; - - public string tGetUniqueId() { - return uniqueId?.data.id ?? ""; - } - - // Constructor - - public CSongListNode() { - this.nID = id++; - } - - public CSongListNode Clone() { - return (CSongListNode)MemberwiseClone(); - } - - public override bool Equals(object other) { - if (other.GetType() == typeof(CSongListNode)) { - CSongListNode obj = (CSongListNode)other; - return this.nID == obj.nID; - } - return this.GetHashCode() == other.GetHashCode(); - } - - public override int GetHashCode() { - return base.GetHashCode(); - } - - - // その他 - - #region [ private ] - //----------------- - private static int id; - //----------------- - #endregion + public ENodeType eノード種別 = ENodeType.UNKNOWN; + public enum ENodeType { + SCORE, + SCORE_MIDI, + BOX, + BACKBOX, + RANDOM, + UNKNOWN } + public int nID { get; private set; } + public Cスコア[] arスコア = new Cスコア[(int)Difficulty.Total]; + + public string[] ar難易度ラベル = new string[(int)Difficulty.Total]; + public bool bDTXFilesで始まるフォルダ名のBOXである; + public bool bBoxDefで作成されたBOXである { + get { + return !this.bDTXFilesで始まるフォルダ名のBOXである; + } + set { + this.bDTXFilesで始まるフォルダ名のBOXである = !value; + } + } + public Color col文字色 = Color.White; + public Color ForeColor = Color.White; + public Color BackColor = Color.Black; + public Color BoxColor = Color.White; + + public Color BgColor = Color.White; + public bool isChangedBgColor; + public bool isChangedBgType; + public bool isChangedBoxType; + public string BoxType; + public string BgType; + public string BoxChara; + public bool isChangedBoxChara; + + public bool IsChangedForeColor; + public bool IsChangedBackColor; + public bool isChangedBoxColor; + public List listランダム用ノードリスト; + public List list子リスト; + public int nGood範囲ms = -1; + public int nGreat範囲ms = -1; + public int nPerfect範囲ms = -1; + public int nPoor範囲ms = -1; + public int nスコア数; + + public CSongListNode rParentNode; + + public int Openindex; + public bool bIsOpenFolder; + public string strジャンル = ""; + public string str本当のジャンル = ""; + public CLocalizationData ldTitle = new CLocalizationData(); + public List DanSongs; + public Dan_C[] Dan_C; + public CLocalizationData ldSubtitle = new CLocalizationData(); + public string strMaker = ""; + public string[] strNotesDesigner = new string[(int)Difficulty.Total] { "", "", "", "", "", "", "" }; + public CDTX.ESide nSide = CDTX.ESide.eEx; + public bool bExplicit = false; + public bool bMovie = false; + public string strBreadcrumbs = ""; // #27060 2011.2.27 yyagi; MUSIC BOXのパンくずリスト (曲リスト構造内の絶対位置捕捉のために使う) + public string strSkinPath = ""; // #28195 2012.5.4 yyagi; box.defでのスキン切り替え対応 + public bool bBranch = false; + public int[] nLevel = new int[(int)Difficulty.Total] { 0, 0, 0, 0, 0, 0, 0 }; + public CDTX.ELevelIcon[] nLevelIcon = new CDTX.ELevelIcon[(int)Difficulty.Total] { CDTX.ELevelIcon.eNone, CDTX.ELevelIcon.eNone, CDTX.ELevelIcon.eNone, CDTX.ELevelIcon.eNone, CDTX.ELevelIcon.eNone, CDTX.ELevelIcon.eNone, CDTX.ELevelIcon.eNone }; + + // Tower Lives + public int nLife = 5; + public int nTotalFloor = 140; + public string nTowerType; + + // Unique id + public CSongUniqueID uniqueId; + + public int nDanTick = 0; + public Color cDanTickColor = Color.White; + + public CLocalizationData[] strBoxText = new CLocalizationData[3] { new CLocalizationData(), new CLocalizationData(), new CLocalizationData() }; + + public string strSelectBGPath; + + // In-game visuals + + public string strScenePreset = null; + + public string tGetUniqueId() { + return uniqueId?.data.id ?? ""; + } + + // Constructor + + public CSongListNode() { + this.nID = id++; + } + + public CSongListNode Clone() { + return (CSongListNode)MemberwiseClone(); + } + + public override bool Equals(object other) { + if (other.GetType() == typeof(CSongListNode)) { + CSongListNode obj = (CSongListNode)other; + return this.nID == obj.nID; + } + return this.GetHashCode() == other.GetHashCode(); + } + + public override int GetHashCode() { + return base.GetHashCode(); + } + + + // その他 + + #region [ private ] + //----------------- + private static int id; + //----------------- + #endregion } diff --git a/OpenTaiko/src/Songs/CSongUniqueID.cs b/OpenTaiko/src/Songs/CSongUniqueID.cs index 10e706d6..abe2030b 100644 --- a/OpenTaiko/src/Songs/CSongUniqueID.cs +++ b/OpenTaiko/src/Songs/CSongUniqueID.cs @@ -1,53 +1,53 @@ -namespace OpenTaiko { - [Serializable()] - internal class CSongUniqueID { - public CSongUniqueID(string path) { - filePath = path; +namespace OpenTaiko; - tGenerateUniqueID(); - tSongUniqueID(); - } +[Serializable()] +internal class CSongUniqueID { + public CSongUniqueID(string path) { + filePath = path; - public void tSongUniqueID() { - if (!File.Exists(filePath)) - tSaveFile(); - - tLoadFile(); - } - - #region [Auxiliary methods] - - public void tAttachOnlineAddress(string url) { - data.url = url; - tSaveFile(); - } - - public void tGenerateUniqueID() { - data.id = CCrypto.GetUniqueKey(64); - } - - #endregion - - [Serializable] - public class Data { - public string id = ""; - public string url = ""; - } - - public Data data = new Data(); - - public string filePath; - - #region [private] - - private void tSaveFile() { - ConfigManager.SaveConfig(data, filePath); - } - - private void tLoadFile() { - data = ConfigManager.GetConfig(filePath); - } - - #endregion + tGenerateUniqueID(); + tSongUniqueID(); } + + public void tSongUniqueID() { + if (!File.Exists(filePath)) + tSaveFile(); + + tLoadFile(); + } + + #region [Auxiliary methods] + + public void tAttachOnlineAddress(string url) { + data.url = url; + tSaveFile(); + } + + public void tGenerateUniqueID() { + data.id = CCrypto.GetUniqueKey(64); + } + + #endregion + + [Serializable] + public class Data { + public string id = ""; + public string url = ""; + } + + public Data data = new Data(); + + public string filePath; + + #region [private] + + private void tSaveFile() { + ConfigManager.SaveConfig(data, filePath); + } + + private void tLoadFile() { + data = ConfigManager.GetConfig(filePath); + } + + #endregion } diff --git a/OpenTaiko/src/Songs/CSong管理.cs b/OpenTaiko/src/Songs/CSong管理.cs index 0c7b79ab..38dc5903 100644 --- a/OpenTaiko/src/Songs/CSong管理.cs +++ b/OpenTaiko/src/Songs/CSong管理.cs @@ -3,933 +3,934 @@ using System.Security.Cryptography; using System.Text; using OpenTaiko.C曲リストノードComparers; -namespace OpenTaiko { - [Serializable] - internal class CSongs管理 { - // Properties +namespace OpenTaiko; - public int nスコアキャッシュから反映できたスコア数 { - get; - set; - } - public int nファイルから反映できたスコア数 { - get; - set; - } - public int n検索されたスコア数 { - get; - set; - } - public int n検索された曲ノード数 { - get; - set; - } - public Dictionary listSongsDB; // songs.dbから構築されるlist - public List list曲ルート; // 起動時にフォルダ検索して構築されるlist - public List list曲ルート_Dan = new List(); // 起動時にフォルダ検索して構築されるlist - public List list曲ルート_Tower = new List(); // 起動時にフォルダ検索して構築されるlist - public static List listCustomBGs = new List(); - public bool bIsSuspending // 外部スレッドから、内部スレッドのsuspendを指示する時にtrueにする - { // 再開時は、これをfalseにしてから、次のautoReset.Set()を実行する - get; - set; - } - public bool bIsSlowdown // #PREMOVIE再生時に曲検索を遅くする - { - get; - set; - } - [NonSerialized] - public AutoResetEvent AutoReset; +[Serializable] +internal class CSongs管理 { + // Properties - private int searchCount; // #PREMOVIE中は検索n回実行したら少しスリープする + public int nスコアキャッシュから反映できたスコア数 { + get; + set; + } + public int nファイルから反映できたスコア数 { + get; + set; + } + public int n検索されたスコア数 { + get; + set; + } + public int n検索された曲ノード数 { + get; + set; + } + public Dictionary listSongsDB; // songs.dbから構築されるlist + public List list曲ルート; // 起動時にフォルダ検索して構築されるlist + public List list曲ルート_Dan = new List(); // 起動時にフォルダ検索して構築されるlist + public List list曲ルート_Tower = new List(); // 起動時にフォルダ検索して構築されるlist + public static List listCustomBGs = new List(); + public bool bIsSuspending // 外部スレッドから、内部スレッドのsuspendを指示する時にtrueにする + { // 再開時は、これをfalseにしてから、次のautoReset.Set()を実行する + get; + set; + } + public bool bIsSlowdown // #PREMOVIE再生時に曲検索を遅くする + { + get; + set; + } + [NonSerialized] + public AutoResetEvent AutoReset; - // Constructor + private int searchCount; // #PREMOVIE中は検索n回実行したら少しスリープする - public CSongs管理() { - this.listSongsDB = new(); - this.list曲ルート = new List(); - this.n検索された曲ノード数 = 0; - this.n検索されたスコア数 = 0; - this.bIsSuspending = false; // #27060 - this.AutoReset = new AutoResetEvent(true); // #27060 - this.searchCount = 0; - } + // Constructor + + public CSongs管理() { + this.listSongsDB = new(); + this.list曲ルート = new List(); + this.n検索された曲ノード数 = 0; + this.n検索されたスコア数 = 0; + this.bIsSuspending = false; // #27060 + this.AutoReset = new AutoResetEvent(true); // #27060 + this.searchCount = 0; + } - // メソッド + // メソッド - #region [ Fetch song list ] - //----------------- + #region [ Fetch song list ] + //----------------- - public void UpdateDownloadBox() { + public void UpdateDownloadBox() { - CSongListNode downloadBox = null; - for (int i = 0; i < OpenTaiko.Songs管理.list曲ルート.Count; i++) { - if (OpenTaiko.Songs管理.list曲ルート[i].strジャンル == "Download") { - downloadBox = OpenTaiko.Songs管理.list曲ルート[i]; - if (downloadBox.rParentNode != null) downloadBox = downloadBox.rParentNode; - } - - } - - if (downloadBox != null && downloadBox.list子リスト != null) { - - var flatten = OpenTaiko.stageSongSelect.actSongList.flattenList(downloadBox.list子リスト); - - // Works because flattenList creates a new List - for (int i = 0; i < downloadBox.list子リスト.Count; i++) { - CSongDict.tRemoveSongNode(downloadBox.list子リスト[i].uniqueId); - downloadBox.list子リスト.Remove(downloadBox.list子リスト[i]); - i--; - } - - - var path = downloadBox.arスコア[0].ファイル情報.フォルダの絶対パス; - - if (flatten.Count > 0) { - int index = list曲ルート.IndexOf(flatten[0]); - if (!list曲ルート.Contains(downloadBox)) { - this.list曲ルート = this.list曲ルート.Except(flatten).ToList(); - list曲ルート.Insert(index, downloadBox); - } - - t曲を検索してリストを作成する(path, true, downloadBox.list子リスト, downloadBox); - this.t曲リストへ後処理を適用する(downloadBox.list子リスト, $"/{downloadBox.ldTitle.GetString("")}/"); - downloadBox.list子リスト.Insert(0, CSongDict.tGenerateBackButton(downloadBox, $"/{downloadBox.ldTitle.GetString("")}/")); - } + CSongListNode downloadBox = null; + for (int i = 0; i < OpenTaiko.Songs管理.list曲ルート.Count; i++) { + if (OpenTaiko.Songs管理.list曲ルート[i].strジャンル == "Download") { + downloadBox = OpenTaiko.Songs管理.list曲ルート[i]; + if (downloadBox.rParentNode != null) downloadBox = downloadBox.rParentNode; } } - public void t曲を検索してリストを作成する(string str基点フォルダ, bool b子BOXへ再帰する) { - this.t曲を検索してリストを作成する(str基点フォルダ, b子BOXへ再帰する, this.list曲ルート, null); - } - private void t曲を検索してリストを作成する(string str基点フォルダ, bool b子BOXへ再帰する, List listノードリスト, CSongListNode node親) { - if (!str基点フォルダ.EndsWith(Path.DirectorySeparatorChar)) - str基点フォルダ = str基点フォルダ + Path.DirectorySeparatorChar; - DirectoryInfo info = new DirectoryInfo(str基点フォルダ); + if (downloadBox != null && downloadBox.list子リスト != null) { - if (OpenTaiko.ConfigIni.bOutputSongSearchLog) - Trace.TraceInformation("基点フォルダ: " + str基点フォルダ); + var flatten = OpenTaiko.stageSongSelect.actSongList.flattenList(downloadBox.list子リスト); - #region [ a.フォルダ内に set.def が存在する場合 → 1フォルダ内のtjaファイル無制限] - //----------------------------- - string path = str基点フォルダ + "set.def"; - if (File.Exists(path)) { - new FileInfo(path); - if (OpenTaiko.ConfigIni.bOutputSongSearchLog) { - Trace.TraceInformation("set.def検出 : {0}", path); - Trace.Indent(); + // Works because flattenList creates a new List + for (int i = 0; i < downloadBox.list子リスト.Count; i++) { + CSongDict.tRemoveSongNode(downloadBox.list子リスト[i].uniqueId); + downloadBox.list子リスト.Remove(downloadBox.list子リスト[i]); + i--; + } + + + var path = downloadBox.arスコア[0].ファイル情報.フォルダの絶対パス; + + if (flatten.Count > 0) { + int index = list曲ルート.IndexOf(flatten[0]); + if (!list曲ルート.Contains(downloadBox)) { + this.list曲ルート = this.list曲ルート.Except(flatten).ToList(); + list曲ルート.Insert(index, downloadBox); } - try { - foreach (FileInfo fileinfo in info.GetFiles()) { - SlowOrSuspendSearchTask(); - #region[ 拡張子を取得 ] - string strExt = fileinfo.Extension.ToLower(); - #endregion - if ((strExt.Equals(".tja") || strExt.Equals(".dtx"))) { - if (strExt.Equals(".tja")) { - //tja、dtxが両方存在していた場合、tjaを読み込まずにtjaと同名のdtxだけを使う。 - string dtxscoreini = str基点フォルダ + (fileinfo.Name.Replace(strExt, ".dtx")); - if (File.Exists(dtxscoreini)) { - continue; - } - } - #region[ 新処理 ] + t曲を検索してリストを作成する(path, true, downloadBox.list子リスト, downloadBox); + this.t曲リストへ後処理を適用する(downloadBox.list子リスト, $"/{downloadBox.ldTitle.GetString("")}/"); + downloadBox.list子リスト.Insert(0, CSongDict.tGenerateBackButton(downloadBox, $"/{downloadBox.ldTitle.GetString("")}/")); + } + } + } + public void t曲を検索してリストを作成する(string str基点フォルダ, bool b子BOXへ再帰する) { + this.t曲を検索してリストを作成する(str基点フォルダ, b子BOXへ再帰する, this.list曲ルート, null); + } + private void t曲を検索してリストを作成する(string str基点フォルダ, bool b子BOXへ再帰する, List listノードリスト, CSongListNode node親) { + if (!str基点フォルダ.EndsWith(Path.DirectorySeparatorChar)) + str基点フォルダ = str基点フォルダ + Path.DirectorySeparatorChar; - CSongListNode c曲リストノード = new CSongListNode(); - c曲リストノード.eノード種別 = CSongListNode.ENodeType.SCORE; + DirectoryInfo info = new DirectoryInfo(str基点フォルダ); - bool b = false; - for (int n = 0; n < (int)Difficulty.Total; n++) { - CDTX dtx = new CDTX(fileinfo.FullName, false, 1.0, 0, 1); - if (dtx.b譜面が存在する[n]) { - c曲リストノード.nスコア数++; - c曲リストノード.rParentNode = node親; - c曲リストノード.strBreadcrumbs = (c曲リストノード.rParentNode == null) ? - str基点フォルダ + fileinfo.Name : c曲リストノード.rParentNode.strBreadcrumbs + " > " + str基点フォルダ + fileinfo.Name; + if (OpenTaiko.ConfigIni.bOutputSongSearchLog) + Trace.TraceInformation("基点フォルダ: " + str基点フォルダ); - c曲リストノード.ldTitle = dtx.TITLE; - c曲リストノード.ldSubtitle = dtx.SUBTITLE; - c曲リストノード.strジャンル = dtx.GENRE; - c曲リストノード.strMaker = dtx.MAKER; - - c曲リストノード.strNotesDesigner = dtx.NOTESDESIGNER.Select(x => x.Equals("") ? c曲リストノード.strMaker : x).ToArray(); - - c曲リストノード.nSide = dtx.SIDE; - c曲リストノード.bExplicit = dtx.EXPLICIT; - c曲リストノード.bMovie = !string.IsNullOrEmpty(dtx.strBGVIDEO_PATH); - if (c曲リストノード.rParentNode != null && c曲リストノード.rParentNode.strジャンル != "") { - c曲リストノード.strジャンル = c曲リストノード.rParentNode.strジャンル; - } - c曲リストノード.strSelectBGPath = $@"{fileinfo.FullName}{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}{dtx.SELECTBG}"; - if (!File.Exists(c曲リストノード.strSelectBGPath)) c曲リストノード.strSelectBGPath = null; - c曲リストノード.nLevel = dtx.LEVELtaiko; - c曲リストノード.nLevelIcon = dtx.LEVELtaikoIcon; - - // LIFE here - c曲リストノード.nLife = dtx.LIFE; - - c曲リストノード.nTowerType = dtx.TOWERTYPE; - - c曲リストノード.nDanTick = dtx.DANTICK; - c曲リストノード.cDanTickColor = dtx.DANTICKCOLOR; - - // Total count of floors for a tower chart - c曲リストノード.nTotalFloor = 0; - - for (int i = 0; i < dtx.listChip.Count; i++) { - CDTX.CChip pChip = dtx.listChip[i]; - - if (pChip.n整数値_内部番号 > c曲リストノード.nTotalFloor && pChip.nチャンネル番号 == 0x50) c曲リストノード.nTotalFloor = pChip.n整数値_内部番号; - - } - c曲リストノード.nTotalFloor++; - c曲リストノード.str本当のジャンル = c曲リストノード.strジャンル; - c曲リストノード.arスコア[n] = new Cスコア(); - c曲リストノード.arスコア[n].ファイル情報.ファイルの絶対パス = str基点フォルダ + fileinfo.Name; - c曲リストノード.arスコア[n].ファイル情報.フォルダの絶対パス = str基点フォルダ; - c曲リストノード.arスコア[n].ファイル情報.ファイルサイズ = fileinfo.Length; - c曲リストノード.arスコア[n].ファイル情報.最終更新日時 = fileinfo.LastWriteTime; - - LoadChartInfo(c曲リストノード, dtx, n); - - if (b == false) { - this.n検索されたスコア数++; - listノードリスト.Add(c曲リストノード); - this.n検索された曲ノード数++; - b = true; - } - } + #region [ a.フォルダ内に set.def が存在する場合 → 1フォルダ内のtjaファイル無制限] + //----------------------------- + string path = str基点フォルダ + "set.def"; + if (File.Exists(path)) { + new FileInfo(path); + if (OpenTaiko.ConfigIni.bOutputSongSearchLog) { + Trace.TraceInformation("set.def検出 : {0}", path); + Trace.Indent(); + } + try { + foreach (FileInfo fileinfo in info.GetFiles()) { + SlowOrSuspendSearchTask(); + #region[ 拡張子を取得 ] + string strExt = fileinfo.Extension.ToLower(); + #endregion + if ((strExt.Equals(".tja") || strExt.Equals(".dtx"))) { + if (strExt.Equals(".tja")) { + //tja、dtxが両方存在していた場合、tjaを読み込まずにtjaと同名のdtxだけを使う。 + string dtxscoreini = str基点フォルダ + (fileinfo.Name.Replace(strExt, ".dtx")); + if (File.Exists(dtxscoreini)) { + continue; } } - #endregion - } - } finally { - if (OpenTaiko.ConfigIni.bOutputSongSearchLog) { - Trace.Unindent(); - } - } - } - //----------------------------- - #endregion - - #region [ b.フォルダ内に set.def が存在しない場合 → 個別ファイルからノード作成 ] - //----------------------------- - else { - foreach (FileInfo fileinfo in info.GetFiles()) { - SlowOrSuspendSearchTask(); // #27060 中断要求があったら、解除要求が来るまで待機, #PREMOVIE再生中は検索負荷を落とす - string strExt = fileinfo.Extension.ToLower(); - - if ((strExt.Equals(".tja") || strExt.Equals(".dtx"))) { - // 2017.06.02 kairera0467 廃止。 #region[ 新処理 ] - string filePath = str基点フォルダ + fileinfo.Name; - using SHA1 hashProvider = SHA1.Create(); - var fs = File.OpenRead(filePath); - byte[] rawhash = hashProvider.ComputeHash(fs); - string hash = ""; - for (int i = 0; i < rawhash.Length; i++) { - hash += string.Format("{0:X2}", rawhash[i]); - } + CSongListNode c曲リストノード = new CSongListNode(); + c曲リストノード.eノード種別 = CSongListNode.ENodeType.SCORE; - fs.Dispose(); + bool b = false; + for (int n = 0; n < (int)Difficulty.Total; n++) { + CDTX dtx = new CDTX(fileinfo.FullName, false, 1.0, 0, 1); + if (dtx.b譜面が存在する[n]) { + c曲リストノード.nスコア数++; + c曲リストノード.rParentNode = node親; + c曲リストノード.strBreadcrumbs = (c曲リストノード.rParentNode == null) ? + str基点フォルダ + fileinfo.Name : c曲リストノード.rParentNode.strBreadcrumbs + " > " + str基点フォルダ + fileinfo.Name; - if (listSongsDB.TryGetValue(filePath + hash, out CSongListNode value)) { - this.n検索されたスコア数++; - listノードリスト.Add(value); - CSongDict.tAddSongNode(value.uniqueId, value); - value.rParentNode = node親; + c曲リストノード.ldTitle = dtx.TITLE; + c曲リストノード.ldSubtitle = dtx.SUBTITLE; + c曲リストノード.strジャンル = dtx.GENRE; + c曲リストノード.strMaker = dtx.MAKER; - if (value.rParentNode != null) { - value.strScenePreset = value.rParentNode.strScenePreset; - if (value.rParentNode.IsChangedForeColor) { - value.ForeColor = value.rParentNode.ForeColor; - value.IsChangedForeColor = true; + c曲リストノード.strNotesDesigner = dtx.NOTESDESIGNER.Select(x => x.Equals("") ? c曲リストノード.strMaker : x).ToArray(); + + c曲リストノード.nSide = dtx.SIDE; + c曲リストノード.bExplicit = dtx.EXPLICIT; + c曲リストノード.bMovie = !string.IsNullOrEmpty(dtx.strBGVIDEO_PATH); + if (c曲リストノード.rParentNode != null && c曲リストノード.rParentNode.strジャンル != "") { + c曲リストノード.strジャンル = c曲リストノード.rParentNode.strジャンル; } - if (value.rParentNode.IsChangedBackColor) { - value.BackColor = value.rParentNode.BackColor; - value.IsChangedBackColor = true; + c曲リストノード.strSelectBGPath = $@"{fileinfo.FullName}{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}{dtx.SELECTBG}"; + if (!File.Exists(c曲リストノード.strSelectBGPath)) c曲リストノード.strSelectBGPath = null; + c曲リストノード.nLevel = dtx.LEVELtaiko; + c曲リストノード.nLevelIcon = dtx.LEVELtaikoIcon; + + // LIFE here + c曲リストノード.nLife = dtx.LIFE; + + c曲リストノード.nTowerType = dtx.TOWERTYPE; + + c曲リストノード.nDanTick = dtx.DANTICK; + c曲リストノード.cDanTickColor = dtx.DANTICKCOLOR; + + // Total count of floors for a tower chart + c曲リストノード.nTotalFloor = 0; + + for (int i = 0; i < dtx.listChip.Count; i++) { + CDTX.CChip pChip = dtx.listChip[i]; + + if (pChip.n整数値_内部番号 > c曲リストノード.nTotalFloor && pChip.nチャンネル番号 == 0x50) c曲リストノード.nTotalFloor = pChip.n整数値_内部番号; + } - if (value.rParentNode.isChangedBoxColor) { - value.BoxColor = value.rParentNode.BoxColor; - value.isChangedBoxColor = true; - } - if (value.rParentNode.isChangedBgColor) { - value.BgColor = value.rParentNode.BgColor; - value.isChangedBgColor = true; - } - if (value.rParentNode.isChangedBgType) { - value.BgType = value.rParentNode.BgType; - value.isChangedBgType = true; - } - if (value.rParentNode.isChangedBoxType) { - value.BoxType = value.rParentNode.BoxType; - value.isChangedBoxType = true; - } - if (value.rParentNode.isChangedBoxChara) { - value.BoxChara = value.rParentNode.BoxChara; - value.isChangedBoxChara = true; + c曲リストノード.nTotalFloor++; + c曲リストノード.str本当のジャンル = c曲リストノード.strジャンル; + c曲リストノード.arスコア[n] = new Cスコア(); + c曲リストノード.arスコア[n].ファイル情報.ファイルの絶対パス = str基点フォルダ + fileinfo.Name; + c曲リストノード.arスコア[n].ファイル情報.フォルダの絶対パス = str基点フォルダ; + c曲リストノード.arスコア[n].ファイル情報.ファイルサイズ = fileinfo.Length; + c曲リストノード.arスコア[n].ファイル情報.最終更新日時 = fileinfo.LastWriteTime; + + LoadChartInfo(c曲リストノード, dtx, n); + + if (b == false) { + this.n検索されたスコア数++; + listノードリスト.Add(c曲リストノード); + this.n検索された曲ノード数++; + b = true; } } + } + } + #endregion + } + } finally { + if (OpenTaiko.ConfigIni.bOutputSongSearchLog) { + Trace.Unindent(); + } + } + } + //----------------------------- + #endregion - this.n検索された曲ノード数++; - } else { - CDTX dtx = new CDTX(filePath, false, 1.0, 0, 0); - CSongListNode c曲リストノード = new CSongListNode(); - c曲リストノード.eノード種別 = CSongListNode.ENodeType.SCORE; + #region [ b.フォルダ内に set.def が存在しない場合 → 個別ファイルからノード作成 ] + //----------------------------- + else { + foreach (FileInfo fileinfo in info.GetFiles()) { + SlowOrSuspendSearchTask(); // #27060 中断要求があったら、解除要求が来るまで待機, #PREMOVIE再生中は検索負荷を落とす + string strExt = fileinfo.Extension.ToLower(); - bool b = false; - for (int n = 0; n < (int)Difficulty.Total; n++) { - if (dtx.b譜面が存在する[n]) { - c曲リストノード.nスコア数++; - c曲リストノード.rParentNode = node親; - c曲リストノード.strBreadcrumbs = (c曲リストノード.rParentNode == null) ? - str基点フォルダ + fileinfo.Name : c曲リストノード.rParentNode.strBreadcrumbs + " > " + str基点フォルダ + fileinfo.Name; + if ((strExt.Equals(".tja") || strExt.Equals(".dtx"))) { + // 2017.06.02 kairera0467 廃止。 - c曲リストノード.ldTitle = dtx.TITLE; - c曲リストノード.ldSubtitle = dtx.SUBTITLE; - c曲リストノード.strMaker = dtx.MAKER; - c曲リストノード.strNotesDesigner = dtx.NOTESDESIGNER.Select(x => x.Equals("") ? c曲リストノード.strMaker : x).ToArray(); - c曲リストノード.nSide = dtx.SIDE; - c曲リストノード.bExplicit = dtx.EXPLICIT; - c曲リストノード.bMovie = !string.IsNullOrEmpty(dtx.strBGVIDEO_PATH); + #region[ 新処理 ] - c曲リストノード.DanSongs = new(); - if (dtx.List_DanSongs != null) { - for (int i = 0; i < dtx.List_DanSongs.Count; i++) { - c曲リストノード.DanSongs.Add(dtx.List_DanSongs[i]); - } + string filePath = str基点フォルダ + fileinfo.Name; + + using SHA1 hashProvider = SHA1.Create(); + var fs = File.OpenRead(filePath); + byte[] rawhash = hashProvider.ComputeHash(fs); + string hash = ""; + for (int i = 0; i < rawhash.Length; i++) { + hash += string.Format("{0:X2}", rawhash[i]); + } + + fs.Dispose(); + + if (listSongsDB.TryGetValue(filePath + hash, out CSongListNode value)) { + this.n検索されたスコア数++; + listノードリスト.Add(value); + CSongDict.tAddSongNode(value.uniqueId, value); + value.rParentNode = node親; + + if (value.rParentNode != null) { + value.strScenePreset = value.rParentNode.strScenePreset; + if (value.rParentNode.IsChangedForeColor) { + value.ForeColor = value.rParentNode.ForeColor; + value.IsChangedForeColor = true; + } + if (value.rParentNode.IsChangedBackColor) { + value.BackColor = value.rParentNode.BackColor; + value.IsChangedBackColor = true; + } + if (value.rParentNode.isChangedBoxColor) { + value.BoxColor = value.rParentNode.BoxColor; + value.isChangedBoxColor = true; + } + if (value.rParentNode.isChangedBgColor) { + value.BgColor = value.rParentNode.BgColor; + value.isChangedBgColor = true; + } + if (value.rParentNode.isChangedBgType) { + value.BgType = value.rParentNode.BgType; + value.isChangedBgType = true; + } + if (value.rParentNode.isChangedBoxType) { + value.BoxType = value.rParentNode.BoxType; + value.isChangedBoxType = true; + } + if (value.rParentNode.isChangedBoxChara) { + value.BoxChara = value.rParentNode.BoxChara; + value.isChangedBoxChara = true; + } + } + + this.n検索された曲ノード数++; + } else { + CDTX dtx = new CDTX(filePath, false, 1.0, 0, 0); + CSongListNode c曲リストノード = new CSongListNode(); + c曲リストノード.eノード種別 = CSongListNode.ENodeType.SCORE; + + bool b = false; + for (int n = 0; n < (int)Difficulty.Total; n++) { + if (dtx.b譜面が存在する[n]) { + c曲リストノード.nスコア数++; + c曲リストノード.rParentNode = node親; + c曲リストノード.strBreadcrumbs = (c曲リストノード.rParentNode == null) ? + str基点フォルダ + fileinfo.Name : c曲リストノード.rParentNode.strBreadcrumbs + " > " + str基点フォルダ + fileinfo.Name; + + c曲リストノード.ldTitle = dtx.TITLE; + c曲リストノード.ldSubtitle = dtx.SUBTITLE; + c曲リストノード.strMaker = dtx.MAKER; + c曲リストノード.strNotesDesigner = dtx.NOTESDESIGNER.Select(x => x.Equals("") ? c曲リストノード.strMaker : x).ToArray(); + c曲リストノード.nSide = dtx.SIDE; + c曲リストノード.bExplicit = dtx.EXPLICIT; + c曲リストノード.bMovie = !string.IsNullOrEmpty(dtx.strBGVIDEO_PATH); + + c曲リストノード.DanSongs = new(); + if (dtx.List_DanSongs != null) { + for (int i = 0; i < dtx.List_DanSongs.Count; i++) { + c曲リストノード.DanSongs.Add(dtx.List_DanSongs[i]); } + } - if (dtx.Dan_C != null) - c曲リストノード.Dan_C = dtx.Dan_C; - - if (!string.IsNullOrEmpty(dtx.GENRE)) { - if (c曲リストノード.rParentNode != null) { - c曲リストノード.strジャンル = c曲リストノード.rParentNode.strジャンル; - c曲リストノード.str本当のジャンル = dtx.GENRE; - } else { - c曲リストノード.strジャンル = dtx.GENRE; - c曲リストノード.str本当のジャンル = dtx.GENRE; - } - } else { - c曲リストノード.strジャンル = c曲リストノード.rParentNode.strジャンル; - c曲リストノード.str本当のジャンル = c曲リストノード.rParentNode.strジャンル; - } - - if (c曲リストノード.strSelectBGPath == null || !File.Exists(str基点フォルダ + dtx.SELECTBG)) { - c曲リストノード.strSelectBGPath = c曲リストノード.rParentNode.strSelectBGPath; - } else { - c曲リストノード.strSelectBGPath = str基点フォルダ + dtx.SELECTBG; - } - if (!File.Exists(c曲リストノード.strSelectBGPath)) c曲リストノード.strSelectBGPath = null; + if (dtx.Dan_C != null) + c曲リストノード.Dan_C = dtx.Dan_C; + if (!string.IsNullOrEmpty(dtx.GENRE)) { if (c曲リストノード.rParentNode != null) { - c曲リストノード.strScenePreset = c曲リストノード.rParentNode.strScenePreset; - if (c曲リストノード.rParentNode.IsChangedForeColor) { - c曲リストノード.ForeColor = c曲リストノード.rParentNode.ForeColor; - c曲リストノード.IsChangedForeColor = true; - } - if (c曲リストノード.rParentNode.IsChangedBackColor) { - c曲リストノード.BackColor = c曲リストノード.rParentNode.BackColor; - c曲リストノード.IsChangedBackColor = true; - } - if (c曲リストノード.rParentNode.isChangedBoxColor) { - c曲リストノード.BoxColor = c曲リストノード.rParentNode.BoxColor; - c曲リストノード.isChangedBoxColor = true; - } - if (c曲リストノード.rParentNode.isChangedBgColor) { - c曲リストノード.BgColor = c曲リストノード.rParentNode.BgColor; - c曲リストノード.isChangedBgColor = true; - } - if (c曲リストノード.rParentNode.isChangedBgType) { - c曲リストノード.BgType = c曲リストノード.rParentNode.BgType; - c曲リストノード.isChangedBgType = true; - } - if (c曲リストノード.rParentNode.isChangedBoxType) { - c曲リストノード.BoxType = c曲リストノード.rParentNode.BoxType; - c曲リストノード.isChangedBoxType = true; - } - if (c曲リストノード.rParentNode.isChangedBoxChara) { - c曲リストノード.BoxChara = c曲リストノード.rParentNode.BoxChara; - c曲リストノード.isChangedBoxChara = true; - } + c曲リストノード.strジャンル = c曲リストノード.rParentNode.strジャンル; + c曲リストノード.str本当のジャンル = dtx.GENRE; + } else { + c曲リストノード.strジャンル = dtx.GENRE; + c曲リストノード.str本当のジャンル = dtx.GENRE; + } + } else { + c曲リストノード.strジャンル = c曲リストノード.rParentNode.strジャンル; + c曲リストノード.str本当のジャンル = c曲リストノード.rParentNode.strジャンル; + } + if (c曲リストノード.strSelectBGPath == null || !File.Exists(str基点フォルダ + dtx.SELECTBG)) { + c曲リストノード.strSelectBGPath = c曲リストノード.rParentNode.strSelectBGPath; + } else { + c曲リストノード.strSelectBGPath = str基点フォルダ + dtx.SELECTBG; + } + if (!File.Exists(c曲リストノード.strSelectBGPath)) c曲リストノード.strSelectBGPath = null; + if (c曲リストノード.rParentNode != null) { + c曲リストノード.strScenePreset = c曲リストノード.rParentNode.strScenePreset; + if (c曲リストノード.rParentNode.IsChangedForeColor) { + c曲リストノード.ForeColor = c曲リストノード.rParentNode.ForeColor; + c曲リストノード.IsChangedForeColor = true; + } + if (c曲リストノード.rParentNode.IsChangedBackColor) { + c曲リストノード.BackColor = c曲リストノード.rParentNode.BackColor; + c曲リストノード.IsChangedBackColor = true; + } + if (c曲リストノード.rParentNode.isChangedBoxColor) { + c曲リストノード.BoxColor = c曲リストノード.rParentNode.BoxColor; + c曲リストノード.isChangedBoxColor = true; + } + if (c曲リストノード.rParentNode.isChangedBgColor) { + c曲リストノード.BgColor = c曲リストノード.rParentNode.BgColor; + c曲リストノード.isChangedBgColor = true; + } + if (c曲リストノード.rParentNode.isChangedBgType) { + c曲リストノード.BgType = c曲リストノード.rParentNode.BgType; + c曲リストノード.isChangedBgType = true; + } + if (c曲リストノード.rParentNode.isChangedBoxType) { + c曲リストノード.BoxType = c曲リストノード.rParentNode.BoxType; + c曲リストノード.isChangedBoxType = true; + } + if (c曲リストノード.rParentNode.isChangedBoxChara) { + c曲リストノード.BoxChara = c曲リストノード.rParentNode.BoxChara; + c曲リストノード.isChangedBoxChara = true; } - switch (CStrジャンルtoNum.ForAC15(c曲リストノード.strジャンル)) { - case 0: - c曲リストノード.ForeColor = OpenTaiko.Skin.SongSelect_ForeColor_JPOP; - c曲リストノード.BackColor = OpenTaiko.Skin.SongSelect_BackColor_JPOP; - break; - case 1: - c曲リストノード.ForeColor = OpenTaiko.Skin.SongSelect_ForeColor_Anime; - c曲リストノード.BackColor = OpenTaiko.Skin.SongSelect_BackColor_Anime; - break; - case 2: - c曲リストノード.ForeColor = OpenTaiko.Skin.SongSelect_ForeColor_VOCALOID; - c曲リストノード.BackColor = OpenTaiko.Skin.SongSelect_BackColor_VOCALOID; - break; - case 3: - c曲リストノード.ForeColor = OpenTaiko.Skin.SongSelect_ForeColor_Children; - c曲リストノード.BackColor = OpenTaiko.Skin.SongSelect_BackColor_Children; - break; - case 4: - c曲リストノード.ForeColor = OpenTaiko.Skin.SongSelect_ForeColor_Variety; - c曲リストノード.BackColor = OpenTaiko.Skin.SongSelect_BackColor_Variety; - break; - case 5: - c曲リストノード.ForeColor = OpenTaiko.Skin.SongSelect_ForeColor_Classic; - c曲リストノード.BackColor = OpenTaiko.Skin.SongSelect_BackColor_Classic; - break; - case 6: - c曲リストノード.ForeColor = OpenTaiko.Skin.SongSelect_ForeColor_GameMusic; - c曲リストノード.BackColor = OpenTaiko.Skin.SongSelect_BackColor_GameMusic; - break; - case 7: - c曲リストノード.ForeColor = OpenTaiko.Skin.SongSelect_ForeColor_Namco; - c曲リストノード.BackColor = OpenTaiko.Skin.SongSelect_BackColor_Namco; - break; - default: - break; - } + } - c曲リストノード.nLevel = dtx.LEVELtaiko; - c曲リストノード.nLevelIcon = dtx.LEVELtaikoIcon; - c曲リストノード.uniqueId = dtx.uniqueID; + switch (CStrジャンルtoNum.ForAC15(c曲リストノード.strジャンル)) { + case 0: + c曲リストノード.ForeColor = OpenTaiko.Skin.SongSelect_ForeColor_JPOP; + c曲リストノード.BackColor = OpenTaiko.Skin.SongSelect_BackColor_JPOP; + break; + case 1: + c曲リストノード.ForeColor = OpenTaiko.Skin.SongSelect_ForeColor_Anime; + c曲リストノード.BackColor = OpenTaiko.Skin.SongSelect_BackColor_Anime; + break; + case 2: + c曲リストノード.ForeColor = OpenTaiko.Skin.SongSelect_ForeColor_VOCALOID; + c曲リストノード.BackColor = OpenTaiko.Skin.SongSelect_BackColor_VOCALOID; + break; + case 3: + c曲リストノード.ForeColor = OpenTaiko.Skin.SongSelect_ForeColor_Children; + c曲リストノード.BackColor = OpenTaiko.Skin.SongSelect_BackColor_Children; + break; + case 4: + c曲リストノード.ForeColor = OpenTaiko.Skin.SongSelect_ForeColor_Variety; + c曲リストノード.BackColor = OpenTaiko.Skin.SongSelect_BackColor_Variety; + break; + case 5: + c曲リストノード.ForeColor = OpenTaiko.Skin.SongSelect_ForeColor_Classic; + c曲リストノード.BackColor = OpenTaiko.Skin.SongSelect_BackColor_Classic; + break; + case 6: + c曲リストノード.ForeColor = OpenTaiko.Skin.SongSelect_ForeColor_GameMusic; + c曲リストノード.BackColor = OpenTaiko.Skin.SongSelect_BackColor_GameMusic; + break; + case 7: + c曲リストノード.ForeColor = OpenTaiko.Skin.SongSelect_ForeColor_Namco; + c曲リストノード.BackColor = OpenTaiko.Skin.SongSelect_BackColor_Namco; + break; + default: + break; + } - CSongDict.tAddSongNode(c曲リストノード.uniqueId, c曲リストノード); - c曲リストノード.arスコア[n] = new Cスコア(); - c曲リストノード.arスコア[n].ファイル情報.ファイルの絶対パス = str基点フォルダ + fileinfo.Name; - c曲リストノード.arスコア[n].ファイル情報.フォルダの絶対パス = str基点フォルダ; - c曲リストノード.arスコア[n].ファイル情報.ファイルサイズ = fileinfo.Length; - c曲リストノード.arスコア[n].ファイル情報.最終更新日時 = fileinfo.LastWriteTime; + c曲リストノード.nLevel = dtx.LEVELtaiko; + c曲リストノード.nLevelIcon = dtx.LEVELtaikoIcon; + c曲リストノード.uniqueId = dtx.uniqueID; - if (c曲リストノード.rParentNode != null && String.IsNullOrEmpty(c曲リストノード.arスコア[n].譜面情報.Preimage)) { - c曲リストノード.arスコア[n].譜面情報.Preimage = c曲リストノード.rParentNode.arスコア[0].譜面情報.Preimage; - } + CSongDict.tAddSongNode(c曲リストノード.uniqueId, c曲リストノード); - LoadChartInfo(c曲リストノード, dtx, n); + c曲リストノード.arスコア[n] = new Cスコア(); + c曲リストノード.arスコア[n].ファイル情報.ファイルの絶対パス = str基点フォルダ + fileinfo.Name; + c曲リストノード.arスコア[n].ファイル情報.フォルダの絶対パス = str基点フォルダ; + c曲リストノード.arスコア[n].ファイル情報.ファイルサイズ = fileinfo.Length; + c曲リストノード.arスコア[n].ファイル情報.最終更新日時 = fileinfo.LastWriteTime; - if (b == false) { - this.n検索されたスコア数++; - listノードリスト.Add(c曲リストノード); - if (!listSongsDB.ContainsKey(filePath + hash)) listSongsDB.Add(filePath + hash, c曲リストノード); - this.n検索された曲ノード数++; - b = true; - } + if (c曲リストノード.rParentNode != null && String.IsNullOrEmpty(c曲リストノード.arスコア[n].譜面情報.Preimage)) { + c曲リストノード.arスコア[n].譜面情報.Preimage = c曲リストノード.rParentNode.arスコア[0].譜面情報.Preimage; + } + + LoadChartInfo(c曲リストノード, dtx, n); + + if (b == false) { + this.n検索されたスコア数++; + listノードリスト.Add(c曲リストノード); + if (!listSongsDB.ContainsKey(filePath + hash)) listSongsDB.Add(filePath + hash, c曲リストノード); + this.n検索された曲ノード数++; + b = true; } } } - #endregion + } + #endregion + } + } + } + //----------------------------- + #endregion + + foreach (DirectoryInfo infoDir in info.GetDirectories()) { + SlowOrSuspendSearchTask(); // #27060 中断要求があったら、解除要求が来るまで待機, #PREMOVIE再生中は検索負荷を落とす + + + #region [ a.box.def を含むフォルダの場合 ] + //----------------------------- + if (File.Exists(infoDir.FullName + @$"{Path.DirectorySeparatorChar}box.def")) { + CBoxDef boxdef = new CBoxDef(infoDir.FullName + @$"{Path.DirectorySeparatorChar}box.def"); + CSongListNode c曲リストノード = new CSongListNode(); + c曲リストノード.eノード種別 = CSongListNode.ENodeType.BOX; + c曲リストノード.bDTXFilesで始まるフォルダ名のBOXである = false; + c曲リストノード.ldTitle = boxdef.Title; + c曲リストノード.strジャンル = boxdef.Genre; + c曲リストノード.strScenePreset = boxdef.ScenePreset; + c曲リストノード.strSelectBGPath = infoDir.FullName + Path.DirectorySeparatorChar + boxdef.SelectBG; + if (!File.Exists(c曲リストノード.strSelectBGPath)) c曲リストノード.strSelectBGPath = null; + + if (boxdef.IsChangedForeColor) { + c曲リストノード.ForeColor = boxdef.ForeColor; + c曲リストノード.IsChangedForeColor = true; + } + if (boxdef.IsChangedBackColor) { + c曲リストノード.BackColor = boxdef.BackColor; + c曲リストノード.IsChangedBackColor = true; + } + if (boxdef.IsChangedBoxColor) { + c曲リストノード.BoxColor = boxdef.BoxColor; + c曲リストノード.isChangedBoxColor = true; + } + if (boxdef.IsChangedBgColor) { + c曲リストノード.BgColor = boxdef.BgColor; + c曲リストノード.isChangedBgColor = true; + } + if (boxdef.IsChangedBgType) { + c曲リストノード.BgType = boxdef.BgType; + c曲リストノード.isChangedBgType = true; + } + if (boxdef.IsChangedBoxType) { + c曲リストノード.BoxType = boxdef.BoxType; + c曲リストノード.isChangedBoxType = true; + } + if (boxdef.IsChangedBoxChara) { + c曲リストノード.BoxChara = boxdef.BoxChara; + c曲リストノード.isChangedBoxChara = true; + } + + + + for (int i = 0; i < 3; i++) { + if ((boxdef.strBoxText[i] != null)) { + c曲リストノード.strBoxText[i] = boxdef.strBoxText[i]; + } + } + switch (CStrジャンルtoNum.ForAC15(c曲リストノード.strジャンル)) { + case 0: + c曲リストノード.ForeColor = OpenTaiko.Skin.SongSelect_ForeColor_JPOP; + c曲リストノード.BackColor = OpenTaiko.Skin.SongSelect_BackColor_JPOP; + break; + case 1: + c曲リストノード.ForeColor = OpenTaiko.Skin.SongSelect_ForeColor_Anime; + c曲リストノード.BackColor = OpenTaiko.Skin.SongSelect_BackColor_Anime; + break; + case 2: + c曲リストノード.ForeColor = OpenTaiko.Skin.SongSelect_ForeColor_VOCALOID; + c曲リストノード.BackColor = OpenTaiko.Skin.SongSelect_BackColor_VOCALOID; + break; + case 3: + c曲リストノード.ForeColor = OpenTaiko.Skin.SongSelect_ForeColor_Children; + c曲リストノード.BackColor = OpenTaiko.Skin.SongSelect_BackColor_Children; + break; + case 4: + c曲リストノード.ForeColor = OpenTaiko.Skin.SongSelect_ForeColor_Variety; + c曲リストノード.BackColor = OpenTaiko.Skin.SongSelect_BackColor_Variety; + break; + case 5: + c曲リストノード.ForeColor = OpenTaiko.Skin.SongSelect_ForeColor_Classic; + c曲リストノード.BackColor = OpenTaiko.Skin.SongSelect_BackColor_Classic; + break; + case 6: + c曲リストノード.ForeColor = OpenTaiko.Skin.SongSelect_ForeColor_GameMusic; + c曲リストノード.BackColor = OpenTaiko.Skin.SongSelect_BackColor_GameMusic; + break; + case 7: + c曲リストノード.ForeColor = OpenTaiko.Skin.SongSelect_ForeColor_Namco; + c曲リストノード.BackColor = OpenTaiko.Skin.SongSelect_BackColor_Namco; + break; + default: + break; + } + + + + c曲リストノード.nスコア数 = 1; + c曲リストノード.arスコア[0] = new Cスコア(); + c曲リストノード.arスコア[0].ファイル情報.フォルダの絶対パス = infoDir.FullName + Path.DirectorySeparatorChar; + c曲リストノード.arスコア[0].譜面情報.タイトル = boxdef.Title.GetString(""); + c曲リストノード.arスコア[0].譜面情報.ジャンル = boxdef.Genre; + if (!String.IsNullOrEmpty(boxdef.DefaultPreimage)) + c曲リストノード.arスコア[0].譜面情報.Preimage = boxdef.DefaultPreimage; + c曲リストノード.rParentNode = node親; + + + c曲リストノード.strBreadcrumbs = (c曲リストノード.rParentNode == null) ? + c曲リストノード.ldTitle.GetString("") : c曲リストノード.rParentNode.strBreadcrumbs + " > " + c曲リストノード.ldTitle.GetString(""); + + + c曲リストノード.list子リスト = new List(); + listノードリスト.Add(c曲リストノード); + if (OpenTaiko.ConfigIni.bOutputSongSearchLog) { + Trace.TraceInformation("box.def検出 : {0}", infoDir.FullName + @$"{Path.DirectorySeparatorChar}box.def"); + Trace.Indent(); + try { + StringBuilder sb = new StringBuilder(0x400); + sb.Append(string.Format("nID#{0:D3}", c曲リストノード.nID)); + if (c曲リストノード.rParentNode != null) { + sb.Append(string.Format("(in#{0:D3}):", c曲リストノード.rParentNode.nID)); + } else { + sb.Append("(onRoot):"); + } + sb.Append("BOX, Title=" + c曲リストノード.ldTitle.GetString("")); + if ((c曲リストノード.strジャンル != null) && (c曲リストノード.strジャンル.Length > 0)) { + sb.Append(", Genre=" + c曲リストノード.strジャンル); + } + if (c曲リストノード.IsChangedForeColor) { + sb.Append(", ForeColor=" + c曲リストノード.ForeColor.ToString()); + } + if (c曲リストノード.IsChangedBackColor) { + sb.Append(", BackColor=" + c曲リストノード.BackColor.ToString()); + } + if (c曲リストノード.isChangedBoxColor) { + sb.Append(", BoxColor=" + c曲リストノード.BoxColor.ToString()); + } + if (c曲リストノード.isChangedBgColor) { + sb.Append(", BgColor=" + c曲リストノード.BgColor.ToString()); + } + if (c曲リストノード.isChangedBoxType) { + sb.Append(", BoxType=" + c曲リストノード.BoxType.ToString()); + } + if (c曲リストノード.isChangedBgType) { + sb.Append(", BgType=" + c曲リストノード.BgType.ToString()); + } + if (c曲リストノード.isChangedBoxChara) { + sb.Append(", BoxChara=" + c曲リストノード.BoxChara.ToString()); + } + Trace.TraceInformation(sb.ToString()); + } finally { + Trace.Unindent(); + } + } + if (b子BOXへ再帰する) { + this.t曲を検索してリストを作成する(infoDir.FullName + Path.DirectorySeparatorChar, b子BOXへ再帰する, c曲リストノード.list子リスト, c曲リストノード); + } + } + //----------------------------- + #endregion + + #region [ c.通常フォルダの場合 ] + //----------------------------- + else { + this.t曲を検索してリストを作成する(infoDir.FullName + Path.DirectorySeparatorChar, b子BOXへ再帰する, listノードリスト, node親); + } + //----------------------------- + #endregion + } + } + //----------------- + #endregion + + private void LoadChartInfo(CSongListNode c曲リストノード, CDTX cdtx, int i) { + if ((c曲リストノード.arスコア[i] != null) && !c曲リストノード.arスコア[i].bSongDBにキャッシュがあった) { + #region [ DTX ファイルのヘッダだけ読み込み、Cスコア.譜面情報 を設定する ] + //----------------- + string path = c曲リストノード.arスコア[i].ファイル情報.ファイルの絶対パス; + if (File.Exists(path)) { + try { + c曲リストノード.arスコア[i].譜面情報.タイトル = cdtx.TITLE.GetString(""); + + + c曲リストノード.arスコア[i].譜面情報.アーティスト名 = cdtx.ARTIST; + c曲リストノード.arスコア[i].譜面情報.コメント = cdtx.COMMENT; + c曲リストノード.arスコア[i].譜面情報.ジャンル = cdtx.GENRE; + if (!String.IsNullOrEmpty(cdtx.PREIMAGE)) + c曲リストノード.arスコア[i].譜面情報.Preimage = cdtx.PREIMAGE; + c曲リストノード.arスコア[i].譜面情報.Presound = cdtx.PREVIEW; + c曲リストノード.arスコア[i].譜面情報.Backgound = ((cdtx.BACKGROUND != null) && (cdtx.BACKGROUND.Length > 0)) ? cdtx.BACKGROUND : cdtx.BACKGROUND_GR; + c曲リストノード.arスコア[i].譜面情報.レベル.Drums = cdtx.LEVEL.Drums; + c曲リストノード.arスコア[i].譜面情報.レベル.Guitar = cdtx.LEVEL.Guitar; + c曲リストノード.arスコア[i].譜面情報.レベル.Bass = cdtx.LEVEL.Bass; + c曲リストノード.arスコア[i].譜面情報.レベルを非表示にする = cdtx.HIDDENLEVEL; + c曲リストノード.arスコア[i].譜面情報.Bpm = cdtx.BPM; + c曲リストノード.arスコア[i].譜面情報.BaseBpm = cdtx.BASEBPM; + c曲リストノード.arスコア[i].譜面情報.MinBpm = cdtx.MinBPM; + c曲リストノード.arスコア[i].譜面情報.MaxBpm = cdtx.MaxBPM; + c曲リストノード.arスコア[i].譜面情報.Duration = 0; // (cdtx.listChip == null)? 0 : cdtx.listChip[ cdtx.listChip.Count - 1 ].n発声時刻ms; + c曲リストノード.arスコア[i].譜面情報.strBGMファイル名 = cdtx.strBGM_PATH; + c曲リストノード.arスコア[i].譜面情報.SongVol = cdtx.SongVol; + c曲リストノード.arスコア[i].譜面情報.SongLoudnessMetadata = cdtx.SongLoudnessMetadata; + c曲リストノード.arスコア[i].譜面情報.nデモBGMオフセット = cdtx.nデモBGMオフセット; + c曲リストノード.arスコア[i].譜面情報.strサブタイトル = cdtx.SUBTITLE.GetString(""); + for (int k = 0; k < (int)Difficulty.Total; k++) { + c曲リストノード.arスコア[i].譜面情報.b譜面分岐[k] = cdtx.bHIDDENBRANCH ? false : cdtx.bHasBranch[k]; + c曲リストノード.arスコア[i].譜面情報.nレベル[k] = cdtx.LEVELtaiko[k]; + c曲リストノード.arスコア[i].譜面情報.nLevelIcon[k] = cdtx.LEVELtaikoIcon[k]; + } + + // Tower Lives + c曲リストノード.arスコア[i].譜面情報.nLife = cdtx.LIFE; + + c曲リストノード.arスコア[i].譜面情報.nTowerType = cdtx.TOWERTYPE; + + c曲リストノード.arスコア[i].譜面情報.nDanTick = cdtx.DANTICK; + c曲リストノード.arスコア[i].譜面情報.cDanTickColor = cdtx.DANTICKCOLOR; + + c曲リストノード.arスコア[i].譜面情報.nTotalFloor = 0; + for (int k = 0; k < cdtx.listChip.Count; k++) { + CDTX.CChip pChip = cdtx.listChip[k]; + + if (pChip.n整数値_内部番号 > c曲リストノード.arスコア[i].譜面情報.nTotalFloor && pChip.nチャンネル番号 == 0x50) + c曲リストノード.arスコア[i].譜面情報.nTotalFloor = pChip.n整数値_内部番号; + } + c曲リストノード.arスコア[i].譜面情報.nTotalFloor++; + + + + this.nファイルから反映できたスコア数++; + cdtx.DeActivate(); + #region [ 曲検索ログ出力 ] + //----------------- + if (OpenTaiko.ConfigIni.bOutputSongSearchLog) { + StringBuilder sb = new StringBuilder(0x400); + sb.Append(string.Format("曲データファイルから譜面情報を転記しました。({0})", path)); + sb.Append("(title=" + c曲リストノード.arスコア[i].譜面情報.タイトル); + sb.Append(", artist=" + c曲リストノード.arスコア[i].譜面情報.アーティスト名); + sb.Append(", comment=" + c曲リストノード.arスコア[i].譜面情報.コメント); + sb.Append(", genre=" + c曲リストノード.arスコア[i].譜面情報.ジャンル); + sb.Append(", preimage=" + c曲リストノード.arスコア[i].譜面情報.Preimage); + sb.Append(", premovie=" + c曲リストノード.arスコア[i].譜面情報.Premovie); + sb.Append(", presound=" + c曲リストノード.arスコア[i].譜面情報.Presound); + sb.Append(", background=" + c曲リストノード.arスコア[i].譜面情報.Backgound); + sb.Append(", lvDr=" + c曲リストノード.arスコア[i].譜面情報.レベル.Drums); + sb.Append(", lvGt=" + c曲リストノード.arスコア[i].譜面情報.レベル.Guitar); + sb.Append(", lvBs=" + c曲リストノード.arスコア[i].譜面情報.レベル.Bass); + sb.Append(", lvHide=" + c曲リストノード.arスコア[i].譜面情報.レベルを非表示にする); + sb.Append(", type=" + c曲リストノード.arスコア[i].譜面情報.曲種別); + sb.Append(", bpm=" + c曲リストノード.arスコア[i].譜面情報.Bpm); + sb.Append(", basebpm=" + c曲リストノード.arスコア[i].譜面情報.BaseBpm); + sb.Append(", minbpm=" + c曲リストノード.arスコア[i].譜面情報.MinBpm); + sb.Append(", maxbpm=" + c曲リストノード.arスコア[i].譜面情報.MaxBpm); + // sb.Append( ", duration=" + c曲リストノード.arスコア[ i ].譜面情報.Duration ); + Trace.TraceInformation(sb.ToString()); + } + //----------------- + #endregion + } catch (Exception exception) { + Trace.TraceError(exception.ToString()); + c曲リストノード.arスコア[i] = null; + c曲リストノード.nスコア数--; + this.n検索されたスコア数--; + Trace.TraceError("曲データファイルの読み込みに失敗しました。({0})", path); + } + } + //----------------- + #endregion + } + } + + #region [ 曲リストへ後処理を適用する ] + //----------------- + public void t曲リストへ後処理を適用する() { + listStrBoxDefSkinSubfolderFullName = new List(); + if (OpenTaiko.Skin.strBoxDefSkinSubfolders != null) { + foreach (string b in OpenTaiko.Skin.strBoxDefSkinSubfolders) { + listStrBoxDefSkinSubfolderFullName.Add(b); + } + } + + this.t曲リストへ後処理を適用する(this.list曲ルート); + + for (int p = 0; p < list曲ルート.Count; p++) { + var c曲リストノード = list曲ルート[p]; + if (c曲リストノード.eノード種別 == CSongListNode.ENodeType.BOX) { + if (c曲リストノード.strジャンル == "段位道場") { + if (OpenTaiko.ConfigIni.bDanTowerHide) { + list曲ルート.Remove(c曲リストノード); + p--; + } + + // Add to dojo + list曲ルート_Dan = c曲リストノード.list子リスト; + } else if (c曲リストノード.strジャンル == "太鼓タワー") { + if (OpenTaiko.ConfigIni.bDanTowerHide) { + list曲ルート.Remove(c曲リストノード); + p--; + } + + list曲ルート_Tower = c曲リストノード.list子リスト; + } else { + for (int i = 0; i < c曲リストノード.list子リスト.Count; i++) { + if (c曲リストノード.list子リスト[i].arスコア[6] != null) { + list曲ルート_Dan.Add(c曲リストノード.list子リスト[i]); + + if (OpenTaiko.ConfigIni.bDanTowerHide) + c曲リストノード.list子リスト.Remove(c曲リストノード.list子リスト[i]); + + continue; + } + if (c曲リストノード.list子リスト[i].arスコア[5] != null) { + list曲ルート_Tower.Add(c曲リストノード.list子リスト[i]); + + if (OpenTaiko.ConfigIni.bDanTowerHide) + c曲リストノード.list子リスト.Remove(c曲リストノード.list子リスト[i]); + continue; + } + } + } + } + } + + #region [ skin名で比較して、systemスキンとboxdefスキンに重複があれば、boxdefスキン側を削除する ] + string[] systemSkinNames = CSkin.GetSkinName(OpenTaiko.Skin.strSystemSkinSubfolders); + List l = new List(listStrBoxDefSkinSubfolderFullName); + foreach (string boxdefSkinSubfolderFullName in l) { + if (Array.BinarySearch(systemSkinNames, + CSkin.GetSkinName(boxdefSkinSubfolderFullName), + StringComparer.InvariantCultureIgnoreCase) >= 0) { + listStrBoxDefSkinSubfolderFullName.Remove(boxdefSkinSubfolderFullName); + } + } + #endregion + string[] ba = listStrBoxDefSkinSubfolderFullName.ToArray(); + Array.Sort(ba); + OpenTaiko.Skin.strBoxDefSkinSubfolders = ba; + } + + + private void t曲リストへ後処理を適用する(List ノードリスト, string parentName = "/", bool isGlobal = true) { + + if (isGlobal && ノードリスト.Count > 0) { + var randomNode = CSongDict.tGenerateRandomButton(ノードリスト[0].rParentNode, parentName); + ノードリスト.Add(randomNode); + + } + + // Don't sort songs if the folder isn't global + // Call back reinsert back folders if sort called ? + if (isGlobal) { + #region [ Sort nodes ] + //----------------------------- + if (OpenTaiko.ConfigIni.nDefaultSongSort == 0) { + t曲リストのソート1_絶対パス順(ノードリスト); + } else if (OpenTaiko.ConfigIni.nDefaultSongSort == 1) { + t曲リストのソート9_ジャンル順(ノードリスト, EInstrumentPad.Taiko, 1, 0); + } else if (OpenTaiko.ConfigIni.nDefaultSongSort == 2) { + t曲リストのソート9_ジャンル順(ノードリスト, EInstrumentPad.Taiko, 2, 0); + } + //----------------------------- + #endregion + } + + // すべてのノードについて… + foreach (CSongListNode c曲リストノード in ノードリスト) { + SlowOrSuspendSearchTask(); // #27060 中断要求があったら、解除要求が来るまで待機, #PREMOVIE再生中は検索負荷を落とす + + #region [ Append "Back" buttons to the included folders ] + //----------------------------- + if (c曲リストノード.eノード種別 == CSongListNode.ENodeType.BOX) { + + #region [ Sort child nodes ] + //----------------------------- + if (OpenTaiko.ConfigIni.nDefaultSongSort == 0) { + t曲リストのソート1_絶対パス順(c曲リストノード.list子リスト); + } else if (OpenTaiko.ConfigIni.nDefaultSongSort == 1) { + t曲リストのソート9_ジャンル順(c曲リストノード.list子リスト, EInstrumentPad.Taiko, 1, 0); + } else if (OpenTaiko.ConfigIni.nDefaultSongSort == 2) { + t曲リストのソート9_ジャンル順(c曲リストノード.list子リスト, EInstrumentPad.Taiko, 2, 0); + } + //----------------------------- + #endregion + + + string newPath = parentName + c曲リストノード.ldTitle.GetString("") + "/"; + + CSongDict.tReinsertBackButtons(c曲リストノード, c曲リストノード.list子リスト, newPath, listStrBoxDefSkinSubfolderFullName); + + // Process subfolders recussively + t曲リストへ後処理を適用する(c曲リストノード.list子リスト, newPath, false); + + continue; + } + + //----------------------------- + #endregion + + #region [ If no node title found, try to fetch it within the score objects ] + //----------------------------- + if (string.IsNullOrEmpty(c曲リストノード.ldTitle.GetString(""))) { + for (int j = 0; j < (int)Difficulty.Total; j++) { + if ((c曲リストノード.arスコア[j] != null) && !string.IsNullOrEmpty(c曲リストノード.arスコア[j].譜面情報.タイトル)) { + c曲リストノード.ldTitle = new CLocalizationData(); + + if (OpenTaiko.ConfigIni.bOutputSongSearchLog) + Trace.TraceInformation("タイトルを設定しました。(nID#{0:D3}, title={1})", c曲リストノード.nID, c曲リストノード.ldTitle.GetString("")); + + break; } } } //----------------------------- #endregion - foreach (DirectoryInfo infoDir in info.GetDirectories()) { - SlowOrSuspendSearchTask(); // #27060 中断要求があったら、解除要求が来るまで待機, #PREMOVIE再生中は検索負荷を落とす - #region [ a.box.def を含むフォルダの場合 ] - //----------------------------- - if (File.Exists(infoDir.FullName + @$"{Path.DirectorySeparatorChar}box.def")) { - CBoxDef boxdef = new CBoxDef(infoDir.FullName + @$"{Path.DirectorySeparatorChar}box.def"); - CSongListNode c曲リストノード = new CSongListNode(); - c曲リストノード.eノード種別 = CSongListNode.ENodeType.BOX; - c曲リストノード.bDTXFilesで始まるフォルダ名のBOXである = false; - c曲リストノード.ldTitle = boxdef.Title; - c曲リストノード.strジャンル = boxdef.Genre; - c曲リストノード.strScenePreset = boxdef.ScenePreset; - c曲リストノード.strSelectBGPath = infoDir.FullName + Path.DirectorySeparatorChar + boxdef.SelectBG; - if (!File.Exists(c曲リストノード.strSelectBGPath)) c曲リストノード.strSelectBGPath = null; - - if (boxdef.IsChangedForeColor) { - c曲リストノード.ForeColor = boxdef.ForeColor; - c曲リストノード.IsChangedForeColor = true; - } - if (boxdef.IsChangedBackColor) { - c曲リストノード.BackColor = boxdef.BackColor; - c曲リストノード.IsChangedBackColor = true; - } - if (boxdef.IsChangedBoxColor) { - c曲リストノード.BoxColor = boxdef.BoxColor; - c曲リストノード.isChangedBoxColor = true; - } - if (boxdef.IsChangedBgColor) { - c曲リストノード.BgColor = boxdef.BgColor; - c曲リストノード.isChangedBgColor = true; - } - if (boxdef.IsChangedBgType) { - c曲リストノード.BgType = boxdef.BgType; - c曲リストノード.isChangedBgType = true; - } - if (boxdef.IsChangedBoxType) { - c曲リストノード.BoxType = boxdef.BoxType; - c曲リストノード.isChangedBoxType = true; - } - if (boxdef.IsChangedBoxChara) { - c曲リストノード.BoxChara = boxdef.BoxChara; - c曲リストノード.isChangedBoxChara = true; - } - - - - for (int i = 0; i < 3; i++) { - if ((boxdef.strBoxText[i] != null)) { - c曲リストノード.strBoxText[i] = boxdef.strBoxText[i]; - } - } - switch (CStrジャンルtoNum.ForAC15(c曲リストノード.strジャンル)) { - case 0: - c曲リストノード.ForeColor = OpenTaiko.Skin.SongSelect_ForeColor_JPOP; - c曲リストノード.BackColor = OpenTaiko.Skin.SongSelect_BackColor_JPOP; - break; - case 1: - c曲リストノード.ForeColor = OpenTaiko.Skin.SongSelect_ForeColor_Anime; - c曲リストノード.BackColor = OpenTaiko.Skin.SongSelect_BackColor_Anime; - break; - case 2: - c曲リストノード.ForeColor = OpenTaiko.Skin.SongSelect_ForeColor_VOCALOID; - c曲リストノード.BackColor = OpenTaiko.Skin.SongSelect_BackColor_VOCALOID; - break; - case 3: - c曲リストノード.ForeColor = OpenTaiko.Skin.SongSelect_ForeColor_Children; - c曲リストノード.BackColor = OpenTaiko.Skin.SongSelect_BackColor_Children; - break; - case 4: - c曲リストノード.ForeColor = OpenTaiko.Skin.SongSelect_ForeColor_Variety; - c曲リストノード.BackColor = OpenTaiko.Skin.SongSelect_BackColor_Variety; - break; - case 5: - c曲リストノード.ForeColor = OpenTaiko.Skin.SongSelect_ForeColor_Classic; - c曲リストノード.BackColor = OpenTaiko.Skin.SongSelect_BackColor_Classic; - break; - case 6: - c曲リストノード.ForeColor = OpenTaiko.Skin.SongSelect_ForeColor_GameMusic; - c曲リストノード.BackColor = OpenTaiko.Skin.SongSelect_BackColor_GameMusic; - break; - case 7: - c曲リストノード.ForeColor = OpenTaiko.Skin.SongSelect_ForeColor_Namco; - c曲リストノード.BackColor = OpenTaiko.Skin.SongSelect_BackColor_Namco; - break; - default: - break; - } - - - - c曲リストノード.nスコア数 = 1; - c曲リストノード.arスコア[0] = new Cスコア(); - c曲リストノード.arスコア[0].ファイル情報.フォルダの絶対パス = infoDir.FullName + Path.DirectorySeparatorChar; - c曲リストノード.arスコア[0].譜面情報.タイトル = boxdef.Title.GetString(""); - c曲リストノード.arスコア[0].譜面情報.ジャンル = boxdef.Genre; - if (!String.IsNullOrEmpty(boxdef.DefaultPreimage)) - c曲リストノード.arスコア[0].譜面情報.Preimage = boxdef.DefaultPreimage; - c曲リストノード.rParentNode = node親; - - - c曲リストノード.strBreadcrumbs = (c曲リストノード.rParentNode == null) ? - c曲リストノード.ldTitle.GetString("") : c曲リストノード.rParentNode.strBreadcrumbs + " > " + c曲リストノード.ldTitle.GetString(""); - - - c曲リストノード.list子リスト = new List(); - listノードリスト.Add(c曲リストノード); - if (OpenTaiko.ConfigIni.bOutputSongSearchLog) { - Trace.TraceInformation("box.def検出 : {0}", infoDir.FullName + @$"{Path.DirectorySeparatorChar}box.def"); - Trace.Indent(); - try { - StringBuilder sb = new StringBuilder(0x400); - sb.Append(string.Format("nID#{0:D3}", c曲リストノード.nID)); - if (c曲リストノード.rParentNode != null) { - sb.Append(string.Format("(in#{0:D3}):", c曲リストノード.rParentNode.nID)); - } else { - sb.Append("(onRoot):"); - } - sb.Append("BOX, Title=" + c曲リストノード.ldTitle.GetString("")); - if ((c曲リストノード.strジャンル != null) && (c曲リストノード.strジャンル.Length > 0)) { - sb.Append(", Genre=" + c曲リストノード.strジャンル); - } - if (c曲リストノード.IsChangedForeColor) { - sb.Append(", ForeColor=" + c曲リストノード.ForeColor.ToString()); - } - if (c曲リストノード.IsChangedBackColor) { - sb.Append(", BackColor=" + c曲リストノード.BackColor.ToString()); - } - if (c曲リストノード.isChangedBoxColor) { - sb.Append(", BoxColor=" + c曲リストノード.BoxColor.ToString()); - } - if (c曲リストノード.isChangedBgColor) { - sb.Append(", BgColor=" + c曲リストノード.BgColor.ToString()); - } - if (c曲リストノード.isChangedBoxType) { - sb.Append(", BoxType=" + c曲リストノード.BoxType.ToString()); - } - if (c曲リストノード.isChangedBgType) { - sb.Append(", BgType=" + c曲リストノード.BgType.ToString()); - } - if (c曲リストノード.isChangedBoxChara) { - sb.Append(", BoxChara=" + c曲リストノード.BoxChara.ToString()); - } - Trace.TraceInformation(sb.ToString()); - } finally { - Trace.Unindent(); - } - } - if (b子BOXへ再帰する) { - this.t曲を検索してリストを作成する(infoDir.FullName + Path.DirectorySeparatorChar, b子BOXへ再帰する, c曲リストノード.list子リスト, c曲リストノード); - } - } - //----------------------------- - #endregion - - #region [ c.通常フォルダの場合 ] - //----------------------------- - else { - this.t曲を検索してリストを作成する(infoDir.FullName + Path.DirectorySeparatorChar, b子BOXへ再帰する, listノードリスト, node親); - } - //----------------------------- - #endregion - } - } - //----------------- - #endregion - - private void LoadChartInfo(CSongListNode c曲リストノード, CDTX cdtx, int i) { - if ((c曲リストノード.arスコア[i] != null) && !c曲リストノード.arスコア[i].bSongDBにキャッシュがあった) { - #region [ DTX ファイルのヘッダだけ読み込み、Cスコア.譜面情報 を設定する ] - //----------------- - string path = c曲リストノード.arスコア[i].ファイル情報.ファイルの絶対パス; - if (File.Exists(path)) { - try { - c曲リストノード.arスコア[i].譜面情報.タイトル = cdtx.TITLE.GetString(""); - - - c曲リストノード.arスコア[i].譜面情報.アーティスト名 = cdtx.ARTIST; - c曲リストノード.arスコア[i].譜面情報.コメント = cdtx.COMMENT; - c曲リストノード.arスコア[i].譜面情報.ジャンル = cdtx.GENRE; - if (!String.IsNullOrEmpty(cdtx.PREIMAGE)) - c曲リストノード.arスコア[i].譜面情報.Preimage = cdtx.PREIMAGE; - c曲リストノード.arスコア[i].譜面情報.Presound = cdtx.PREVIEW; - c曲リストノード.arスコア[i].譜面情報.Backgound = ((cdtx.BACKGROUND != null) && (cdtx.BACKGROUND.Length > 0)) ? cdtx.BACKGROUND : cdtx.BACKGROUND_GR; - c曲リストノード.arスコア[i].譜面情報.レベル.Drums = cdtx.LEVEL.Drums; - c曲リストノード.arスコア[i].譜面情報.レベル.Guitar = cdtx.LEVEL.Guitar; - c曲リストノード.arスコア[i].譜面情報.レベル.Bass = cdtx.LEVEL.Bass; - c曲リストノード.arスコア[i].譜面情報.レベルを非表示にする = cdtx.HIDDENLEVEL; - c曲リストノード.arスコア[i].譜面情報.Bpm = cdtx.BPM; - c曲リストノード.arスコア[i].譜面情報.BaseBpm = cdtx.BASEBPM; - c曲リストノード.arスコア[i].譜面情報.MinBpm = cdtx.MinBPM; - c曲リストノード.arスコア[i].譜面情報.MaxBpm = cdtx.MaxBPM; - c曲リストノード.arスコア[i].譜面情報.Duration = 0; // (cdtx.listChip == null)? 0 : cdtx.listChip[ cdtx.listChip.Count - 1 ].n発声時刻ms; - c曲リストノード.arスコア[i].譜面情報.strBGMファイル名 = cdtx.strBGM_PATH; - c曲リストノード.arスコア[i].譜面情報.SongVol = cdtx.SongVol; - c曲リストノード.arスコア[i].譜面情報.SongLoudnessMetadata = cdtx.SongLoudnessMetadata; - c曲リストノード.arスコア[i].譜面情報.nデモBGMオフセット = cdtx.nデモBGMオフセット; - c曲リストノード.arスコア[i].譜面情報.strサブタイトル = cdtx.SUBTITLE.GetString(""); - for (int k = 0; k < (int)Difficulty.Total; k++) { - c曲リストノード.arスコア[i].譜面情報.b譜面分岐[k] = cdtx.bHIDDENBRANCH ? false : cdtx.bHasBranch[k]; - c曲リストノード.arスコア[i].譜面情報.nレベル[k] = cdtx.LEVELtaiko[k]; - c曲リストノード.arスコア[i].譜面情報.nLevelIcon[k] = cdtx.LEVELtaikoIcon[k]; - } - - // Tower Lives - c曲リストノード.arスコア[i].譜面情報.nLife = cdtx.LIFE; - - c曲リストノード.arスコア[i].譜面情報.nTowerType = cdtx.TOWERTYPE; - - c曲リストノード.arスコア[i].譜面情報.nDanTick = cdtx.DANTICK; - c曲リストノード.arスコア[i].譜面情報.cDanTickColor = cdtx.DANTICKCOLOR; - - c曲リストノード.arスコア[i].譜面情報.nTotalFloor = 0; - for (int k = 0; k < cdtx.listChip.Count; k++) { - CDTX.CChip pChip = cdtx.listChip[k]; - - if (pChip.n整数値_内部番号 > c曲リストノード.arスコア[i].譜面情報.nTotalFloor && pChip.nチャンネル番号 == 0x50) - c曲リストノード.arスコア[i].譜面情報.nTotalFloor = pChip.n整数値_内部番号; - } - c曲リストノード.arスコア[i].譜面情報.nTotalFloor++; - - - - this.nファイルから反映できたスコア数++; - cdtx.DeActivate(); - #region [ 曲検索ログ出力 ] - //----------------- - if (OpenTaiko.ConfigIni.bOutputSongSearchLog) { - StringBuilder sb = new StringBuilder(0x400); - sb.Append(string.Format("曲データファイルから譜面情報を転記しました。({0})", path)); - sb.Append("(title=" + c曲リストノード.arスコア[i].譜面情報.タイトル); - sb.Append(", artist=" + c曲リストノード.arスコア[i].譜面情報.アーティスト名); - sb.Append(", comment=" + c曲リストノード.arスコア[i].譜面情報.コメント); - sb.Append(", genre=" + c曲リストノード.arスコア[i].譜面情報.ジャンル); - sb.Append(", preimage=" + c曲リストノード.arスコア[i].譜面情報.Preimage); - sb.Append(", premovie=" + c曲リストノード.arスコア[i].譜面情報.Premovie); - sb.Append(", presound=" + c曲リストノード.arスコア[i].譜面情報.Presound); - sb.Append(", background=" + c曲リストノード.arスコア[i].譜面情報.Backgound); - sb.Append(", lvDr=" + c曲リストノード.arスコア[i].譜面情報.レベル.Drums); - sb.Append(", lvGt=" + c曲リストノード.arスコア[i].譜面情報.レベル.Guitar); - sb.Append(", lvBs=" + c曲リストノード.arスコア[i].譜面情報.レベル.Bass); - sb.Append(", lvHide=" + c曲リストノード.arスコア[i].譜面情報.レベルを非表示にする); - sb.Append(", type=" + c曲リストノード.arスコア[i].譜面情報.曲種別); - sb.Append(", bpm=" + c曲リストノード.arスコア[i].譜面情報.Bpm); - sb.Append(", basebpm=" + c曲リストノード.arスコア[i].譜面情報.BaseBpm); - sb.Append(", minbpm=" + c曲リストノード.arスコア[i].譜面情報.MinBpm); - sb.Append(", maxbpm=" + c曲リストノード.arスコア[i].譜面情報.MaxBpm); - // sb.Append( ", duration=" + c曲リストノード.arスコア[ i ].譜面情報.Duration ); - Trace.TraceInformation(sb.ToString()); - } - //----------------- - #endregion - } catch (Exception exception) { - Trace.TraceError(exception.ToString()); - c曲リストノード.arスコア[i] = null; - c曲リストノード.nスコア数--; - this.n検索されたスコア数--; - Trace.TraceError("曲データファイルの読み込みに失敗しました。({0})", path); - } - } - //----------------- - #endregion - } } - #region [ 曲リストへ後処理を適用する ] - //----------------- - public void t曲リストへ後処理を適用する() { - listStrBoxDefSkinSubfolderFullName = new List(); - if (OpenTaiko.Skin.strBoxDefSkinSubfolders != null) { - foreach (string b in OpenTaiko.Skin.strBoxDefSkinSubfolders) { - listStrBoxDefSkinSubfolderFullName.Add(b); - } - } + } + //----------------- + #endregion - this.t曲リストへ後処理を適用する(this.list曲ルート); + #region [ 曲リストソート ] + //----------------- - for (int p = 0; p < list曲ルート.Count; p++) { - var c曲リストノード = list曲ルート[p]; - if (c曲リストノード.eノード種別 == CSongListNode.ENodeType.BOX) { - if (c曲リストノード.strジャンル == "段位道場") { - if (OpenTaiko.ConfigIni.bDanTowerHide) { - list曲ルート.Remove(c曲リストノード); - p--; - } + public static void t曲リストのソート1_絶対パス順(List ノードリスト) { + t曲リストのソート1_絶対パス順(ノードリスト, EInstrumentPad.Taiko, 1, 0); - // Add to dojo - list曲ルート_Dan = c曲リストノード.list子リスト; - } else if (c曲リストノード.strジャンル == "太鼓タワー") { - if (OpenTaiko.ConfigIni.bDanTowerHide) { - list曲ルート.Remove(c曲リストノード); - p--; - } - - list曲ルート_Tower = c曲リストノード.list子リスト; - } else { - for (int i = 0; i < c曲リストノード.list子リスト.Count; i++) { - if (c曲リストノード.list子リスト[i].arスコア[6] != null) { - list曲ルート_Dan.Add(c曲リストノード.list子リスト[i]); - - if (OpenTaiko.ConfigIni.bDanTowerHide) - c曲リストノード.list子リスト.Remove(c曲リストノード.list子リスト[i]); - - continue; - } - if (c曲リストノード.list子リスト[i].arスコア[5] != null) { - list曲ルート_Tower.Add(c曲リストノード.list子リスト[i]); - - if (OpenTaiko.ConfigIni.bDanTowerHide) - c曲リストノード.list子リスト.Remove(c曲リストノード.list子リスト[i]); - continue; - } - } - } - } - } - - #region [ skin名で比較して、systemスキンとboxdefスキンに重複があれば、boxdefスキン側を削除する ] - string[] systemSkinNames = CSkin.GetSkinName(OpenTaiko.Skin.strSystemSkinSubfolders); - List l = new List(listStrBoxDefSkinSubfolderFullName); - foreach (string boxdefSkinSubfolderFullName in l) { - if (Array.BinarySearch(systemSkinNames, - CSkin.GetSkinName(boxdefSkinSubfolderFullName), - StringComparer.InvariantCultureIgnoreCase) >= 0) { - listStrBoxDefSkinSubfolderFullName.Remove(boxdefSkinSubfolderFullName); - } - } - #endregion - string[] ba = listStrBoxDefSkinSubfolderFullName.ToArray(); - Array.Sort(ba); - OpenTaiko.Skin.strBoxDefSkinSubfolders = ba; - } - - - private void t曲リストへ後処理を適用する(List ノードリスト, string parentName = "/", bool isGlobal = true) { - - if (isGlobal && ノードリスト.Count > 0) { - var randomNode = CSongDict.tGenerateRandomButton(ノードリスト[0].rParentNode, parentName); - ノードリスト.Add(randomNode); - - } - - // Don't sort songs if the folder isn't global - // Call back reinsert back folders if sort called ? - if (isGlobal) { - #region [ Sort nodes ] - //----------------------------- - if (OpenTaiko.ConfigIni.nDefaultSongSort == 0) { - t曲リストのソート1_絶対パス順(ノードリスト); - } else if (OpenTaiko.ConfigIni.nDefaultSongSort == 1) { - t曲リストのソート9_ジャンル順(ノードリスト, EInstrumentPad.Taiko, 1, 0); - } else if (OpenTaiko.ConfigIni.nDefaultSongSort == 2) { - t曲リストのソート9_ジャンル順(ノードリスト, EInstrumentPad.Taiko, 2, 0); - } - //----------------------------- - #endregion - } - - // すべてのノードについて… - foreach (CSongListNode c曲リストノード in ノードリスト) { - SlowOrSuspendSearchTask(); // #27060 中断要求があったら、解除要求が来るまで待機, #PREMOVIE再生中は検索負荷を落とす - - #region [ Append "Back" buttons to the included folders ] - //----------------------------- - if (c曲リストノード.eノード種別 == CSongListNode.ENodeType.BOX) { - - #region [ Sort child nodes ] - //----------------------------- - if (OpenTaiko.ConfigIni.nDefaultSongSort == 0) { - t曲リストのソート1_絶対パス順(c曲リストノード.list子リスト); - } else if (OpenTaiko.ConfigIni.nDefaultSongSort == 1) { - t曲リストのソート9_ジャンル順(c曲リストノード.list子リスト, EInstrumentPad.Taiko, 1, 0); - } else if (OpenTaiko.ConfigIni.nDefaultSongSort == 2) { - t曲リストのソート9_ジャンル順(c曲リストノード.list子リスト, EInstrumentPad.Taiko, 2, 0); - } - //----------------------------- - #endregion - - - string newPath = parentName + c曲リストノード.ldTitle.GetString("") + "/"; - - CSongDict.tReinsertBackButtons(c曲リストノード, c曲リストノード.list子リスト, newPath, listStrBoxDefSkinSubfolderFullName); - - // Process subfolders recussively - t曲リストへ後処理を適用する(c曲リストノード.list子リスト, newPath, false); - - continue; - } - - //----------------------------- - #endregion - - #region [ If no node title found, try to fetch it within the score objects ] - //----------------------------- - if (string.IsNullOrEmpty(c曲リストノード.ldTitle.GetString(""))) { - for (int j = 0; j < (int)Difficulty.Total; j++) { - if ((c曲リストノード.arスコア[j] != null) && !string.IsNullOrEmpty(c曲リストノード.arスコア[j].譜面情報.タイトル)) { - c曲リストノード.ldTitle = new CLocalizationData(); - - if (OpenTaiko.ConfigIni.bOutputSongSearchLog) - Trace.TraceInformation("タイトルを設定しました。(nID#{0:D3}, title={1})", c曲リストノード.nID, c曲リストノード.ldTitle.GetString("")); - - break; - } - } - } - //----------------------------- - #endregion - - - - } - - } - //----------------- - #endregion - - #region [ 曲リストソート ] - //----------------- - - public static void t曲リストのソート1_絶対パス順(List ノードリスト) { - t曲リストのソート1_絶対パス順(ノードリスト, EInstrumentPad.Taiko, 1, 0); - - foreach (CSongListNode c曲リストノード in ノードリスト) { - if ((c曲リストノード.list子リスト != null) && (c曲リストノード.list子リスト.Count > 1)) { - t曲リストのソート1_絶対パス順(c曲リストノード.list子リスト); - } + foreach (CSongListNode c曲リストノード in ノードリスト) { + if ((c曲リストノード.list子リスト != null) && (c曲リストノード.list子リスト.Count > 1)) { + t曲リストのソート1_絶対パス順(c曲リストノード.list子リスト); } } + } + + public static void t曲リストのソート1_絶対パス順(List ノードリスト, EInstrumentPad part, int order, params object[] p) { + var comparer = new ComparerChain( + new C曲リストノードComparerノード種別(), + new C曲リストノードComparer絶対パス(order), + new C曲リストノードComparerタイトル(order), + new C曲リストノードComparerSubtitle(order)); + + ノードリスト.Sort(comparer); + } + + public static void t曲リストのソート2_タイトル順(List ノードリスト, EInstrumentPad part, int order, params object[] p) { + var comparer = new ComparerChain( + new C曲リストノードComparerノード種別(), + new C曲リストノードComparerタイトル(order), + new C曲リストノードComparerSubtitle(order), + new C曲リストノードComparer絶対パス(order)); + + ノードリスト.Sort(comparer); + } + + public static void tSongListSortBySubtitle(List ノードリスト, EInstrumentPad part, int order, params object[] p) { + var comparer = new ComparerChain( + new C曲リストノードComparerノード種別(), + new C曲リストノードComparerSubtitle(order), + new C曲リストノードComparerタイトル(order), + new C曲リストノードComparer絶対パス(order)); + + ノードリスト.Sort(comparer); + } + + public static void tSongListSortByLevel(List ノードリスト, EInstrumentPad part, int order, params object[] p) { + var comparer = new ComparerChain( + new C曲リストノードComparerノード種別(), + new C曲リストノードComparerLevel(order), + new C曲リストノードComparerLevelIcon(order), + new C曲リストノードComparerタイトル(order), + new C曲リストノードComparerSubtitle(order), + new C曲リストノードComparer絶対パス(order)); + + ノードリスト.Sort(comparer); + } + + public static void t曲リストのソート9_ジャンル順(List ノードリスト, EInstrumentPad part, int order, params object[] p) { + try { + var acGenreComparer = order == 1 + ? (IComparer)new C曲リストノードComparerAC8_14() + : new C曲リストノードComparerAC15(); - public static void t曲リストのソート1_絶対パス順(List ノードリスト, EInstrumentPad part, int order, params object[] p) { var comparer = new ComparerChain( new C曲リストノードComparerノード種別(), - new C曲リストノードComparer絶対パス(order), - new C曲リストノードComparerタイトル(order), - new C曲リストノードComparerSubtitle(order)); + acGenreComparer, + new C曲リストノードComparer絶対パス(1), + new C曲リストノードComparerタイトル(1)); ノードリスト.Sort(comparer); + } catch (Exception ex) { + Trace.TraceError(ex.ToString()); + Trace.TraceError("例外が発生しましたが処理を継続します。 (bca6dda7-76ad-42fc-a415-250f52c0b17d)"); } - - public static void t曲リストのソート2_タイトル順(List ノードリスト, EInstrumentPad part, int order, params object[] p) { - var comparer = new ComparerChain( - new C曲リストノードComparerノード種別(), - new C曲リストノードComparerタイトル(order), - new C曲リストノードComparerSubtitle(order), - new C曲リストノードComparer絶対パス(order)); - - ノードリスト.Sort(comparer); - } - - public static void tSongListSortBySubtitle(List ノードリスト, EInstrumentPad part, int order, params object[] p) { - var comparer = new ComparerChain( - new C曲リストノードComparerノード種別(), - new C曲リストノードComparerSubtitle(order), - new C曲リストノードComparerタイトル(order), - new C曲リストノードComparer絶対パス(order)); - - ノードリスト.Sort(comparer); - } - - public static void tSongListSortByLevel(List ノードリスト, EInstrumentPad part, int order, params object[] p) { - var comparer = new ComparerChain( - new C曲リストノードComparerノード種別(), - new C曲リストノードComparerLevel(order), - new C曲リストノードComparerLevelIcon(order), - new C曲リストノードComparerタイトル(order), - new C曲リストノードComparerSubtitle(order), - new C曲リストノードComparer絶対パス(order)); - - ノードリスト.Sort(comparer); - } - - public static void t曲リストのソート9_ジャンル順(List ノードリスト, EInstrumentPad part, int order, params object[] p) { - try { - var acGenreComparer = order == 1 - ? (IComparer)new C曲リストノードComparerAC8_14() - : new C曲リストノードComparerAC15(); - - var comparer = new ComparerChain( - new C曲リストノードComparerノード種別(), - acGenreComparer, - new C曲リストノードComparer絶対パス(1), - new C曲リストノードComparerタイトル(1)); - - ノードリスト.Sort(comparer); - } catch (Exception ex) { - Trace.TraceError(ex.ToString()); - Trace.TraceError("例外が発生しましたが処理を継続します。 (bca6dda7-76ad-42fc-a415-250f52c0b17d)"); - } - } + } #if TEST_SORTBGM public static void t曲リストのソート9_BPM順( List ノードリスト, E楽器パート part, int order, params object[] p ) @@ -983,36 +984,34 @@ Debug.WriteLine( dBPM + ":" + c曲リストノード.strタイトル ); } } #endif - //----------------- - #endregion + //----------------- + #endregion - // その他 + // その他 - #region [ private ] - //----------------- - public List listStrBoxDefSkinSubfolderFullName { - get; - private set; - } - - /// - /// 検索を中断_スローダウンする - /// - private void SlowOrSuspendSearchTask() { - if (this.bIsSuspending) // #27060 中断要求があったら、解除要求が来るまで待機 - { - AutoReset.WaitOne(); - } - if (this.bIsSlowdown && ++this.searchCount > 10) // #27060 #PREMOVIE再生中は検索負荷を下げる - { - Thread.Sleep(100); - this.searchCount = 0; - } - } - - //----------------- - #endregion + #region [ private ] + //----------------- + public List listStrBoxDefSkinSubfolderFullName { + get; + private set; } -} + /// + /// 検索を中断_スローダウンする + /// + private void SlowOrSuspendSearchTask() { + if (this.bIsSuspending) // #27060 中断要求があったら、解除要求が来るまで待機 + { + AutoReset.WaitOne(); + } + if (this.bIsSlowdown && ++this.searchCount > 10) // #27060 #PREMOVIE再生中は検索負荷を下げる + { + Thread.Sleep(100); + this.searchCount = 0; + } + } + + //----------------- + #endregion +} diff --git a/OpenTaiko/src/Songs/CStrジャンルtoNum.cs b/OpenTaiko/src/Songs/CStrジャンルtoNum.cs index d0e056e2..6e2193ca 100644 --- a/OpenTaiko/src/Songs/CStrジャンルtoNum.cs +++ b/OpenTaiko/src/Songs/CStrジャンルtoNum.cs @@ -1,56 +1,56 @@ -namespace OpenTaiko { - internal static class CStrジャンルtoNum { - internal static int ForAC8_14(string strジャンル) { - switch (strジャンル) { - case "アニメ": - return 0; - case "ポップス": - return 1; - case "ゲームミュージック": - return 2; - case "ナムコオリジナル": - return 3; - case "クラシック": - return 4; - case "どうよう": - return 5; - case "バラエティ": - return 6; - case "ボーカロイド": - case "VOCALOID": - return 7; - default: - return 8; - } - } +namespace OpenTaiko; - internal static int ForAC15(string strジャンル) { - switch (strジャンル) { - case "ポップス": - case "J-POP": - case "POPS": - case "JPOP": - return 0; - case "アニメ": - return 1; - case "ボーカロイド": - case "VOCALOID": - return 2; - case "キッズ": - case "どうよう": - return 3; - case "バラエティ": - return 4; - case "クラシック": - return 5; - case "ゲームバラエティ": - case "ゲームミュージック": - return 6; - case "ナムコオリジナル": - return 7; - default: - return 8; - } +internal static class CStrジャンルtoNum { + internal static int ForAC8_14(string strジャンル) { + switch (strジャンル) { + case "アニメ": + return 0; + case "ポップス": + return 1; + case "ゲームミュージック": + return 2; + case "ナムコオリジナル": + return 3; + case "クラシック": + return 4; + case "どうよう": + return 5; + case "バラエティ": + return 6; + case "ボーカロイド": + case "VOCALOID": + return 7; + default: + return 8; + } + } + + internal static int ForAC15(string strジャンル) { + switch (strジャンル) { + case "ポップス": + case "J-POP": + case "POPS": + case "JPOP": + return 0; + case "アニメ": + return 1; + case "ボーカロイド": + case "VOCALOID": + return 2; + case "キッズ": + case "どうよう": + return 3; + case "バラエティ": + return 4; + case "クラシック": + return 5; + case "ゲームバラエティ": + case "ゲームミュージック": + return 6; + case "ナムコオリジナル": + return 7; + default: + return 8; } } } diff --git a/OpenTaiko/src/Songs/Cスコア.cs b/OpenTaiko/src/Songs/Cスコア.cs index 947b2faf..afa87cbc 100644 --- a/OpenTaiko/src/Songs/Cスコア.cs +++ b/OpenTaiko/src/Songs/Cスコア.cs @@ -2,263 +2,263 @@ using System.Runtime.InteropServices; using FDK; -namespace OpenTaiko { +namespace OpenTaiko; + +[Serializable] +internal class Cスコア { + // Properties + + public STScoreIni情報 ScoreIni情報; [Serializable] - internal class Cスコア { - // Properties + [StructLayout(LayoutKind.Sequential)] + public struct STScoreIni情報 { + public DateTime 最終更新日時; + public long ファイルサイズ; - public STScoreIni情報 ScoreIni情報; - [Serializable] - [StructLayout(LayoutKind.Sequential)] - public struct STScoreIni情報 { - public DateTime 最終更新日時; - public long ファイルサイズ; - - public STScoreIni情報(DateTime 最終更新日時, long ファイルサイズ) { - this.最終更新日時 = 最終更新日時; - this.ファイルサイズ = ファイルサイズ; - } - } - - public STファイル情報 ファイル情報; - [Serializable] - [StructLayout(LayoutKind.Sequential)] - public struct STファイル情報 { - public string ファイルの絶対パス; - public string フォルダの絶対パス; - public DateTime 最終更新日時; - public long ファイルサイズ; - - public STファイル情報(string ファイルの絶対パス, string フォルダの絶対パス, DateTime 最終更新日時, long ファイルサイズ) { - this.ファイルの絶対パス = ファイルの絶対パス; - this.フォルダの絶対パス = フォルダの絶対パス; - this.最終更新日時 = 最終更新日時; - this.ファイルサイズ = ファイルサイズ; - } - } - - public ST譜面情報 譜面情報; - - [Serializable] - [StructLayout(LayoutKind.Sequential)] - public struct ST譜面情報 { - public string タイトル; - public string アーティスト名; - public string コメント; - public string ジャンル; - public string Preimage; - public string Premovie; - public string Presound; - public string Backgound; - public STDGBVALUE レベル; - public STSKILL 最大スキル; - public STDGBVALUE フルコンボ; - public STDGBVALUE 演奏回数; - public STHISTORY 演奏履歴; - public bool レベルを非表示にする; - public CDTX.E種別 曲種別; - public double Bpm; - public double BaseBpm; - public double MinBpm; - public double MaxBpm; - public int Duration; - public string strBGMファイル名; - public int SongVol; - public LoudnessMetadata? SongLoudnessMetadata; - public int nデモBGMオフセット; - public bool[] b譜面分岐; - public int ハイスコア; - public int[] nハイスコア; - public string strサブタイトル; - public int[] nレベル; - public int[] nクリア; //0:未クリア 1:クリア 2:フルコンボ 3:ドンダフルコンボ - public int[] nスコアランク; //0:未取得 1:白粋 2:銅粋 3:銀粋 4:金雅 5:桃雅 6:紫雅 7:虹極 - public CDTX.ELevelIcon[] nLevelIcon; - - // Tower lifes - public int nLife; - public int nTotalFloor; - public string nTowerType; - - public int nDanTick; - public Color cDanTickColor; - - public List nExamResult; - - [Serializable] - [StructLayout(LayoutKind.Sequential)] - public struct STHISTORY { - public string 行1; - public string 行2; - public string 行3; - public string 行4; - public string 行5; - public string 行6; - public string 行7; - public string this[int index] { - get { - switch (index) { - case 0: - return this.行1; - - case 1: - return this.行2; - - case 2: - return this.行3; - - case 3: - return this.行4; - - case 4: - return this.行5; - case 5: - return this.行6; - case 6: - return this.行7; - } - throw new IndexOutOfRangeException(); - } - set { - switch (index) { - case 0: - this.行1 = value; - return; - - case 1: - this.行2 = value; - return; - - case 2: - this.行3 = value; - return; - - case 3: - this.行4 = value; - return; - - case 4: - this.行5 = value; - return; - case 5: - this.行6 = value; - return; - case 6: - this.行7 = value; - return; - } - throw new IndexOutOfRangeException(); - } - } - } - - [Serializable] - [StructLayout(LayoutKind.Sequential)] - public struct STRANK { - public int Drums; - public int Guitar; - public int Bass; - } - - [Serializable] - [StructLayout(LayoutKind.Sequential)] - public struct STSKILL { - public double Drums; - public double Guitar; - public double Bass; - public double this[int index] { - get { - switch (index) { - case 0: - return this.Drums; - - case 1: - return this.Guitar; - - case 2: - return this.Bass; - } - throw new IndexOutOfRangeException(); - } - set { - if ((value < 0.0) || (value > 100.0)) { - throw new ArgumentOutOfRangeException(); - } - switch (index) { - case 0: - this.Drums = value; - return; - - case 1: - this.Guitar = value; - return; - - case 2: - this.Bass = value; - return; - } - throw new IndexOutOfRangeException(); - } - } - } - } - - public bool bSongDBにキャッシュがあった; - public bool bスコアが有効である { - get { - return (((this.譜面情報.レベル[0] + this.譜面情報.レベル[1]) + this.譜面情報.レベル[2]) != 0); - } - } - - - // Constructor - - public Cスコア() { - this.ScoreIni情報 = new STScoreIni情報(DateTime.MinValue, 0L); - this.bSongDBにキャッシュがあった = false; - this.ファイル情報 = new STファイル情報("", "", DateTime.MinValue, 0L); - this.譜面情報 = new ST譜面情報(); - this.譜面情報.タイトル = ""; - this.譜面情報.アーティスト名 = ""; - this.譜面情報.コメント = ""; - this.譜面情報.ジャンル = ""; - this.譜面情報.Preimage = ""; - this.譜面情報.Premovie = ""; - this.譜面情報.Presound = ""; - this.譜面情報.Backgound = ""; - this.譜面情報.レベル = new STDGBVALUE(); - this.譜面情報.フルコンボ = new STDGBVALUE(); - this.譜面情報.演奏回数 = new STDGBVALUE(); - this.譜面情報.演奏履歴 = new ST譜面情報.STHISTORY(); - this.譜面情報.演奏履歴.行1 = ""; - this.譜面情報.演奏履歴.行2 = ""; - this.譜面情報.演奏履歴.行3 = ""; - this.譜面情報.演奏履歴.行4 = ""; - this.譜面情報.演奏履歴.行5 = ""; - this.譜面情報.演奏履歴.行6 = ""; - this.譜面情報.演奏履歴.行7 = ""; - this.譜面情報.レベルを非表示にする = false; - this.譜面情報.最大スキル = new ST譜面情報.STSKILL(); - this.譜面情報.曲種別 = CDTX.E種別.DTX; - this.譜面情報.Bpm = 120.0; - this.譜面情報.MinBpm = 120.0; - this.譜面情報.MaxBpm = 120.0; - this.譜面情報.Duration = 0; - this.譜面情報.strBGMファイル名 = ""; - this.譜面情報.SongVol = CSound.DefaultSongVol; - this.譜面情報.SongLoudnessMetadata = null; - this.譜面情報.nデモBGMオフセット = 0; - this.譜面情報.b譜面分岐 = new bool[(int)Difficulty.Total]; - this.譜面情報.ハイスコア = 0; - this.譜面情報.nハイスコア = new int[(int)Difficulty.Total]; - this.譜面情報.strサブタイトル = ""; - this.譜面情報.nレベル = new int[(int)Difficulty.Total] { -1, -1, -1, -1, -1, -1, -1 }; - this.譜面情報.nLevelIcon = new CDTX.ELevelIcon[(int)Difficulty.Total] { CDTX.ELevelIcon.eNone, CDTX.ELevelIcon.eNone, CDTX.ELevelIcon.eNone, CDTX.ELevelIcon.eNone, CDTX.ELevelIcon.eNone, CDTX.ELevelIcon.eNone, CDTX.ELevelIcon.eNone }; - this.譜面情報.nクリア = new int[5]; - this.譜面情報.nスコアランク = new int[5]; - this.譜面情報.nExamResult = new List { }; - this.譜面情報.nLife = 5; - this.譜面情報.nTotalFloor = 140; + public STScoreIni情報(DateTime 最終更新日時, long ファイルサイズ) { + this.最終更新日時 = 最終更新日時; + this.ファイルサイズ = ファイルサイズ; } } + + public STファイル情報 ファイル情報; + [Serializable] + [StructLayout(LayoutKind.Sequential)] + public struct STファイル情報 { + public string ファイルの絶対パス; + public string フォルダの絶対パス; + public DateTime 最終更新日時; + public long ファイルサイズ; + + public STファイル情報(string ファイルの絶対パス, string フォルダの絶対パス, DateTime 最終更新日時, long ファイルサイズ) { + this.ファイルの絶対パス = ファイルの絶対パス; + this.フォルダの絶対パス = フォルダの絶対パス; + this.最終更新日時 = 最終更新日時; + this.ファイルサイズ = ファイルサイズ; + } + } + + public ST譜面情報 譜面情報; + + [Serializable] + [StructLayout(LayoutKind.Sequential)] + public struct ST譜面情報 { + public string タイトル; + public string アーティスト名; + public string コメント; + public string ジャンル; + public string Preimage; + public string Premovie; + public string Presound; + public string Backgound; + public STDGBVALUE レベル; + public STSKILL 最大スキル; + public STDGBVALUE フルコンボ; + public STDGBVALUE 演奏回数; + public STHISTORY 演奏履歴; + public bool レベルを非表示にする; + public CDTX.E種別 曲種別; + public double Bpm; + public double BaseBpm; + public double MinBpm; + public double MaxBpm; + public int Duration; + public string strBGMファイル名; + public int SongVol; + public LoudnessMetadata? SongLoudnessMetadata; + public int nデモBGMオフセット; + public bool[] b譜面分岐; + public int ハイスコア; + public int[] nハイスコア; + public string strサブタイトル; + public int[] nレベル; + public int[] nクリア; //0:未クリア 1:クリア 2:フルコンボ 3:ドンダフルコンボ + public int[] nスコアランク; //0:未取得 1:白粋 2:銅粋 3:銀粋 4:金雅 5:桃雅 6:紫雅 7:虹極 + public CDTX.ELevelIcon[] nLevelIcon; + + // Tower lifes + public int nLife; + public int nTotalFloor; + public string nTowerType; + + public int nDanTick; + public Color cDanTickColor; + + public List nExamResult; + + [Serializable] + [StructLayout(LayoutKind.Sequential)] + public struct STHISTORY { + public string 行1; + public string 行2; + public string 行3; + public string 行4; + public string 行5; + public string 行6; + public string 行7; + public string this[int index] { + get { + switch (index) { + case 0: + return this.行1; + + case 1: + return this.行2; + + case 2: + return this.行3; + + case 3: + return this.行4; + + case 4: + return this.行5; + case 5: + return this.行6; + case 6: + return this.行7; + } + throw new IndexOutOfRangeException(); + } + set { + switch (index) { + case 0: + this.行1 = value; + return; + + case 1: + this.行2 = value; + return; + + case 2: + this.行3 = value; + return; + + case 3: + this.行4 = value; + return; + + case 4: + this.行5 = value; + return; + case 5: + this.行6 = value; + return; + case 6: + this.行7 = value; + return; + } + throw new IndexOutOfRangeException(); + } + } + } + + [Serializable] + [StructLayout(LayoutKind.Sequential)] + public struct STRANK { + public int Drums; + public int Guitar; + public int Bass; + } + + [Serializable] + [StructLayout(LayoutKind.Sequential)] + public struct STSKILL { + public double Drums; + public double Guitar; + public double Bass; + public double this[int index] { + get { + switch (index) { + case 0: + return this.Drums; + + case 1: + return this.Guitar; + + case 2: + return this.Bass; + } + throw new IndexOutOfRangeException(); + } + set { + if ((value < 0.0) || (value > 100.0)) { + throw new ArgumentOutOfRangeException(); + } + switch (index) { + case 0: + this.Drums = value; + return; + + case 1: + this.Guitar = value; + return; + + case 2: + this.Bass = value; + return; + } + throw new IndexOutOfRangeException(); + } + } + } + } + + public bool bSongDBにキャッシュがあった; + public bool bスコアが有効である { + get { + return (((this.譜面情報.レベル[0] + this.譜面情報.レベル[1]) + this.譜面情報.レベル[2]) != 0); + } + } + + + // Constructor + + public Cスコア() { + this.ScoreIni情報 = new STScoreIni情報(DateTime.MinValue, 0L); + this.bSongDBにキャッシュがあった = false; + this.ファイル情報 = new STファイル情報("", "", DateTime.MinValue, 0L); + this.譜面情報 = new ST譜面情報(); + this.譜面情報.タイトル = ""; + this.譜面情報.アーティスト名 = ""; + this.譜面情報.コメント = ""; + this.譜面情報.ジャンル = ""; + this.譜面情報.Preimage = ""; + this.譜面情報.Premovie = ""; + this.譜面情報.Presound = ""; + this.譜面情報.Backgound = ""; + this.譜面情報.レベル = new STDGBVALUE(); + this.譜面情報.フルコンボ = new STDGBVALUE(); + this.譜面情報.演奏回数 = new STDGBVALUE(); + this.譜面情報.演奏履歴 = new ST譜面情報.STHISTORY(); + this.譜面情報.演奏履歴.行1 = ""; + this.譜面情報.演奏履歴.行2 = ""; + this.譜面情報.演奏履歴.行3 = ""; + this.譜面情報.演奏履歴.行4 = ""; + this.譜面情報.演奏履歴.行5 = ""; + this.譜面情報.演奏履歴.行6 = ""; + this.譜面情報.演奏履歴.行7 = ""; + this.譜面情報.レベルを非表示にする = false; + this.譜面情報.最大スキル = new ST譜面情報.STSKILL(); + this.譜面情報.曲種別 = CDTX.E種別.DTX; + this.譜面情報.Bpm = 120.0; + this.譜面情報.MinBpm = 120.0; + this.譜面情報.MaxBpm = 120.0; + this.譜面情報.Duration = 0; + this.譜面情報.strBGMファイル名 = ""; + this.譜面情報.SongVol = CSound.DefaultSongVol; + this.譜面情報.SongLoudnessMetadata = null; + this.譜面情報.nデモBGMオフセット = 0; + this.譜面情報.b譜面分岐 = new bool[(int)Difficulty.Total]; + this.譜面情報.ハイスコア = 0; + this.譜面情報.nハイスコア = new int[(int)Difficulty.Total]; + this.譜面情報.strサブタイトル = ""; + this.譜面情報.nレベル = new int[(int)Difficulty.Total] { -1, -1, -1, -1, -1, -1, -1 }; + this.譜面情報.nLevelIcon = new CDTX.ELevelIcon[(int)Difficulty.Total] { CDTX.ELevelIcon.eNone, CDTX.ELevelIcon.eNone, CDTX.ELevelIcon.eNone, CDTX.ELevelIcon.eNone, CDTX.ELevelIcon.eNone, CDTX.ELevelIcon.eNone, CDTX.ELevelIcon.eNone }; + this.譜面情報.nクリア = new int[5]; + this.譜面情報.nスコアランク = new int[5]; + this.譜面情報.nExamResult = new List { }; + this.譜面情報.nLife = 5; + this.譜面情報.nTotalFloor = 140; + } } diff --git a/OpenTaiko/src/Songs/C曲リストノードComparers/ComparerChain.cs b/OpenTaiko/src/Songs/C曲リストノードComparers/ComparerChain.cs index 97e81238..31cbd943 100644 --- a/OpenTaiko/src/Songs/C曲リストノードComparers/ComparerChain.cs +++ b/OpenTaiko/src/Songs/C曲リストノードComparers/ComparerChain.cs @@ -1,25 +1,25 @@ -namespace OpenTaiko.C曲リストノードComparers { - internal sealed class ComparerChain : IComparer where T : class { - private readonly IComparer[] _comparers; +namespace OpenTaiko.C曲リストノードComparers; - public ComparerChain(params IComparer[] comparers) { - _comparers = comparers; - } +internal sealed class ComparerChain : IComparer where T : class { + private readonly IComparer[] _comparers; - public int Compare(T x, T y) { - if (ReferenceEquals(x, y)) { - return 0; - } - - for (int i = 0; i < _comparers.Length; i++) { - var result = _comparers[i].Compare(x, y); - - if (result != 0) { - return result; - } - } + public ComparerChain(params IComparer[] comparers) { + _comparers = comparers; + } + public int Compare(T x, T y) { + if (ReferenceEquals(x, y)) { return 0; } + + for (int i = 0; i < _comparers.Length; i++) { + var result = _comparers[i].Compare(x, y); + + if (result != 0) { + return result; + } + } + + return 0; } } diff --git a/OpenTaiko/src/Songs/C曲リストノードComparers/C曲リストノードComparerAC15.cs b/OpenTaiko/src/Songs/C曲リストノードComparers/C曲リストノードComparerAC15.cs index 9469dca3..cbb24cac 100644 --- a/OpenTaiko/src/Songs/C曲リストノードComparers/C曲リストノードComparerAC15.cs +++ b/OpenTaiko/src/Songs/C曲リストノードComparers/C曲リストノードComparerAC15.cs @@ -1,7 +1,7 @@ -namespace OpenTaiko.C曲リストノードComparers { - internal sealed class C曲リストノードComparerAC15 : IComparer { - public int Compare(CSongListNode n1, CSongListNode n2) { - return CStrジャンルtoNum.ForAC15(n1.strジャンル).CompareTo(CStrジャンルtoNum.ForAC15(n2.strジャンル)); - } +namespace OpenTaiko.C曲リストノードComparers; + +internal sealed class C曲リストノードComparerAC15 : IComparer { + public int Compare(CSongListNode n1, CSongListNode n2) { + return CStrジャンルtoNum.ForAC15(n1.strジャンル).CompareTo(CStrジャンルtoNum.ForAC15(n2.strジャンル)); } } diff --git a/OpenTaiko/src/Songs/C曲リストノードComparers/C曲リストノードComparerAC8_14.cs b/OpenTaiko/src/Songs/C曲リストノードComparers/C曲リストノードComparerAC8_14.cs index 8a242bb1..904a8173 100644 --- a/OpenTaiko/src/Songs/C曲リストノードComparers/C曲リストノードComparerAC8_14.cs +++ b/OpenTaiko/src/Songs/C曲リストノードComparers/C曲リストノードComparerAC8_14.cs @@ -1,7 +1,7 @@ -namespace OpenTaiko.C曲リストノードComparers { - internal sealed class C曲リストノードComparerAC8_14 : IComparer { - public int Compare(CSongListNode n1, CSongListNode n2) { - return CStrジャンルtoNum.ForAC8_14(n1.strジャンル).CompareTo(CStrジャンルtoNum.ForAC8_14(n2.strジャンル)); - } +namespace OpenTaiko.C曲リストノードComparers; + +internal sealed class C曲リストノードComparerAC8_14 : IComparer { + public int Compare(CSongListNode n1, CSongListNode n2) { + return CStrジャンルtoNum.ForAC8_14(n1.strジャンル).CompareTo(CStrジャンルtoNum.ForAC8_14(n2.strジャンル)); } } diff --git a/OpenTaiko/src/Songs/C曲リストノードComparers/C曲リストノードComparerLevel.cs b/OpenTaiko/src/Songs/C曲リストノードComparers/C曲リストノードComparerLevel.cs index d7c25fe0..67c856c0 100644 --- a/OpenTaiko/src/Songs/C曲リストノードComparers/C曲リストノードComparerLevel.cs +++ b/OpenTaiko/src/Songs/C曲リストノードComparers/C曲リストノードComparerLevel.cs @@ -1,24 +1,24 @@ -namespace OpenTaiko.C曲リストノードComparers { - internal sealed class C曲リストノードComparerLevel : IComparer { - private readonly int _order; +namespace OpenTaiko.C曲リストノードComparers; - public C曲リストノードComparerLevel(int order) { - this._order = order; +internal sealed class C曲リストノードComparerLevel : IComparer { + private readonly int _order; + + public C曲リストノードComparerLevel(int order) { + this._order = order; + } + + public int Compare(CSongListNode n1, CSongListNode n2) { + int _n1s = (n1.eノード種別 != CSongListNode.ENodeType.SCORE) ? 0 : 1; + int _n2s = (n2.eノード種別 != CSongListNode.ENodeType.SCORE) ? 0 : 1; + + + if (_n1s == 0 || _n2s == 0) { + return 0; } + return _order * _diffOf(n1).CompareTo(_diffOf(n2)); + } - public int Compare(CSongListNode n1, CSongListNode n2) { - int _n1s = (n1.eノード種別 != CSongListNode.ENodeType.SCORE) ? 0 : 1; - int _n2s = (n2.eノード種別 != CSongListNode.ENodeType.SCORE) ? 0 : 1; - - - if (_n1s == 0 || _n2s == 0) { - return 0; - } - return _order * _diffOf(n1).CompareTo(_diffOf(n2)); - } - - private int _diffOf(CSongListNode n1) { - return n1.nLevel[OpenTaiko.stageSongSelect.actSongList.tFetchDifficulty(n1)]; - } + private int _diffOf(CSongListNode n1) { + return n1.nLevel[OpenTaiko.stageSongSelect.actSongList.tFetchDifficulty(n1)]; } } diff --git a/OpenTaiko/src/Songs/C曲リストノードComparers/C曲リストノードComparerLevelIcon.cs b/OpenTaiko/src/Songs/C曲リストノードComparers/C曲リストノードComparerLevelIcon.cs index 62e30e22..2d657cf8 100644 --- a/OpenTaiko/src/Songs/C曲リストノードComparers/C曲リストノードComparerLevelIcon.cs +++ b/OpenTaiko/src/Songs/C曲リストノードComparers/C曲リストノードComparerLevelIcon.cs @@ -1,24 +1,24 @@ -namespace OpenTaiko.C曲リストノードComparers { - internal sealed class C曲リストノードComparerLevelIcon : IComparer { - private readonly int _order; +namespace OpenTaiko.C曲リストノードComparers; - public C曲リストノードComparerLevelIcon(int order) { - this._order = order; +internal sealed class C曲リストノードComparerLevelIcon : IComparer { + private readonly int _order; + + public C曲リストノードComparerLevelIcon(int order) { + this._order = order; + } + + public int Compare(CSongListNode n1, CSongListNode n2) { + int _n1s = (n1.eノード種別 != CSongListNode.ENodeType.SCORE) ? 0 : 1; + int _n2s = (n2.eノード種別 != CSongListNode.ENodeType.SCORE) ? 0 : 1; + + + if (_n1s == 0 || _n2s == 0) { + return 0; } + return _order * _diffOf(n1).CompareTo(_diffOf(n2)); + } - public int Compare(CSongListNode n1, CSongListNode n2) { - int _n1s = (n1.eノード種別 != CSongListNode.ENodeType.SCORE) ? 0 : 1; - int _n2s = (n2.eノード種別 != CSongListNode.ENodeType.SCORE) ? 0 : 1; - - - if (_n1s == 0 || _n2s == 0) { - return 0; - } - return _order * _diffOf(n1).CompareTo(_diffOf(n2)); - } - - private int _diffOf(CSongListNode n1) { - return (int)n1.nLevelIcon[OpenTaiko.stageSongSelect.actSongList.tFetchDifficulty(n1)]; - } + private int _diffOf(CSongListNode n1) { + return (int)n1.nLevelIcon[OpenTaiko.stageSongSelect.actSongList.tFetchDifficulty(n1)]; } } diff --git a/OpenTaiko/src/Songs/C曲リストノードComparers/C曲リストノードComparerSubtitle.cs b/OpenTaiko/src/Songs/C曲リストノードComparers/C曲リストノードComparerSubtitle.cs index 960bb422..41bda9a6 100644 --- a/OpenTaiko/src/Songs/C曲リストノードComparers/C曲リストノードComparerSubtitle.cs +++ b/OpenTaiko/src/Songs/C曲リストノードComparers/C曲リストノードComparerSubtitle.cs @@ -1,13 +1,13 @@ -namespace OpenTaiko.C曲リストノードComparers { - internal sealed class C曲リストノードComparerSubtitle : IComparer { - private readonly int _order; +namespace OpenTaiko.C曲リストノードComparers; - public C曲リストノードComparerSubtitle(int order) { - this._order = order; - } +internal sealed class C曲リストノードComparerSubtitle : IComparer { + private readonly int _order; - public int Compare(CSongListNode n1, CSongListNode n2) { - return _order * n1.ldSubtitle.GetString("").CompareTo(n2.ldSubtitle.GetString("")); - } + public C曲リストノードComparerSubtitle(int order) { + this._order = order; + } + + public int Compare(CSongListNode n1, CSongListNode n2) { + return _order * n1.ldSubtitle.GetString("").CompareTo(n2.ldSubtitle.GetString("")); } } diff --git a/OpenTaiko/src/Songs/C曲リストノードComparers/C曲リストノードComparerタイトル.cs b/OpenTaiko/src/Songs/C曲リストノードComparers/C曲リストノードComparerタイトル.cs index 5d7885a0..d45887df 100644 --- a/OpenTaiko/src/Songs/C曲リストノードComparers/C曲リストノードComparerタイトル.cs +++ b/OpenTaiko/src/Songs/C曲リストノードComparers/C曲リストノードComparerタイトル.cs @@ -1,13 +1,13 @@ -namespace OpenTaiko.C曲リストノードComparers { - internal sealed class C曲リストノードComparerタイトル : IComparer { - private readonly int _order; +namespace OpenTaiko.C曲リストノードComparers; - public C曲リストノードComparerタイトル(int order) { - this._order = order; - } +internal sealed class C曲リストノードComparerタイトル : IComparer { + private readonly int _order; - public int Compare(CSongListNode n1, CSongListNode n2) { - return _order * n1.ldTitle.GetString("").CompareTo(n2.ldTitle.GetString("")); - } + public C曲リストノードComparerタイトル(int order) { + this._order = order; + } + + public int Compare(CSongListNode n1, CSongListNode n2) { + return _order * n1.ldTitle.GetString("").CompareTo(n2.ldTitle.GetString("")); } } diff --git a/OpenTaiko/src/Songs/C曲リストノードComparers/C曲リストノードComparerノード種別.cs b/OpenTaiko/src/Songs/C曲リストノードComparers/C曲リストノードComparerノード種別.cs index 27b1d174..0d4f0ebf 100644 --- a/OpenTaiko/src/Songs/C曲リストノードComparers/C曲リストノードComparerノード種別.cs +++ b/OpenTaiko/src/Songs/C曲リストノードComparers/C曲リストノードComparerノード種別.cs @@ -1,25 +1,25 @@ -namespace OpenTaiko.C曲リストノードComparers { - internal sealed class C曲リストノードComparerノード種別 : IComparer { - public int Compare(CSongListNode x, CSongListNode y) { - return ToComparable(x.eノード種別).CompareTo(ToComparable(y.eノード種別)); - } +namespace OpenTaiko.C曲リストノードComparers; - private static int ToComparable(CSongListNode.ENodeType eノード種別) { - switch (eノード種別) { - case CSongListNode.ENodeType.BOX: - return 0; - case CSongListNode.ENodeType.SCORE: - case CSongListNode.ENodeType.SCORE_MIDI: - return 1; - case CSongListNode.ENodeType.UNKNOWN: - return 2; - case CSongListNode.ENodeType.RANDOM: - return 4; - case CSongListNode.ENodeType.BACKBOX: - return 3; - default: - throw new ArgumentOutOfRangeException(); - } +internal sealed class C曲リストノードComparerノード種別 : IComparer { + public int Compare(CSongListNode x, CSongListNode y) { + return ToComparable(x.eノード種別).CompareTo(ToComparable(y.eノード種別)); + } + + private static int ToComparable(CSongListNode.ENodeType eノード種別) { + switch (eノード種別) { + case CSongListNode.ENodeType.BOX: + return 0; + case CSongListNode.ENodeType.SCORE: + case CSongListNode.ENodeType.SCORE_MIDI: + return 1; + case CSongListNode.ENodeType.UNKNOWN: + return 2; + case CSongListNode.ENodeType.RANDOM: + return 4; + case CSongListNode.ENodeType.BACKBOX: + return 3; + default: + throw new ArgumentOutOfRangeException(); } } } diff --git a/OpenTaiko/src/Songs/C曲リストノードComparers/C曲リストノードComparer絶対パス.cs b/OpenTaiko/src/Songs/C曲リストノードComparers/C曲リストノードComparer絶対パス.cs index 149cad6a..1a03ed43 100644 --- a/OpenTaiko/src/Songs/C曲リストノードComparers/C曲リストノードComparer絶対パス.cs +++ b/OpenTaiko/src/Songs/C曲リストノードComparers/C曲リストノードComparer絶対パス.cs @@ -1,30 +1,30 @@ -namespace OpenTaiko.C曲リストノードComparers { - internal sealed class C曲リストノードComparer絶対パス : IComparer { - private readonly int _order; +namespace OpenTaiko.C曲リストノードComparers; - public C曲リストノードComparer絶対パス(int order) { - this._order = order; +internal sealed class C曲リストノードComparer絶対パス : IComparer { + private readonly int _order; + + public C曲リストノードComparer絶対パス(int order) { + this._order = order; + } + + public int Compare(CSongListNode n1, CSongListNode n2) { + if ((n1.eノード種別 == CSongListNode.ENodeType.BOX) && (n2.eノード種別 == CSongListNode.ENodeType.BOX)) { + return _order * n1.arスコア[0].ファイル情報.フォルダの絶対パス.CompareTo(n2.arスコア[0].ファイル情報.フォルダの絶対パス); } - public int Compare(CSongListNode n1, CSongListNode n2) { - if ((n1.eノード種別 == CSongListNode.ENodeType.BOX) && (n2.eノード種別 == CSongListNode.ENodeType.BOX)) { - return _order * n1.arスコア[0].ファイル情報.フォルダの絶対パス.CompareTo(n2.arスコア[0].ファイル情報.フォルダの絶対パス); + var str = strファイルの絶対パス(n1); + var strB = strファイルの絶対パス(n2); + + return _order * str.CompareTo(strB); + } + + private static string strファイルの絶対パス(CSongListNode c曲リストノード) { + for (int i = 0; i < (int)Difficulty.Total; i++) { + if (c曲リストノード.arスコア[i] != null) { + return c曲リストノード.arスコア[i].ファイル情報.ファイルの絶対パス ?? ""; } - - var str = strファイルの絶対パス(n1); - var strB = strファイルの絶対パス(n2); - - return _order * str.CompareTo(strB); } - private static string strファイルの絶対パス(CSongListNode c曲リストノード) { - for (int i = 0; i < (int)Difficulty.Total; i++) { - if (c曲リストノード.arスコア[i] != null) { - return c曲リストノード.arスコア[i].ファイル情報.ファイルの絶対パス ?? ""; - } - } - - return ""; - } + return ""; } } diff --git a/OpenTaiko/src/Songs/Dan-C.cs b/OpenTaiko/src/Songs/Dan-C.cs index 7489e4a9..10156442 100644 --- a/OpenTaiko/src/Songs/Dan-C.cs +++ b/OpenTaiko/src/Songs/Dan-C.cs @@ -1,346 +1,346 @@ -namespace OpenTaiko { +namespace OpenTaiko; + +/// +/// 段位認定を管理するクラス。 +/// +[Serializable] +public class Dan_C { + public Dan_C() { + + } + + public Dan_C(Dan_C dan_C) : this(dan_C.GetExamType(), new int[] { dan_C.GetValue(false), dan_C.GetValue(true) }, dan_C.GetExamRange()) { + + } + /// - /// 段位認定を管理するクラス。 + /// 段位認定の条件を初期化し、生成します。 /// - [Serializable] - public class Dan_C { - public Dan_C() { + /// 条件の種別。 + /// 条件の合格量。 + /// 条件の合格の範囲。 + public Dan_C(Exam.Type examType, int[] value, Exam.Range examRange) { + IsEnable = true; + NotReached = false; + SetExamType(examType); + SetValue(value[0], value[1]); + SetExamRange(examRange); + } + /// + /// 条件と現在の値を評価して、クリアしたかどうかを判断します。 + /// + /// その条件の現在の値。 + public bool Update(int nowValue) { + var isChangedAmount = false; + + if (nowValue < 0) + return isChangedAmount; + + if (!GetEnable()) return isChangedAmount; + if (GetAmount() < nowValue) isChangedAmount = true; + if (GetExamRange() == Exam.Range.Less && nowValue > GetValue(false)) isChangedAmount = false; // n未満でその数を超えたらfalseを返す。 + SetAmount(nowValue); + switch (GetExamType()) { + case Exam.Type.Gauge: + case Exam.Type.JudgePerfect: + case Exam.Type.JudgeGood: + case Exam.Type.JudgeBad: + case Exam.Type.Score: + case Exam.Type.Roll: + case Exam.Type.Hit: + case Exam.Type.Combo: + case Exam.Type.Accuracy: + case Exam.Type.JudgeADLIB: + case Exam.Type.JudgeMine: + SetCleared(); + break; + default: + break; } + return isChangedAmount; + } - public Dan_C(Dan_C dan_C) : this(dan_C.GetExamType(), new int[] { dan_C.GetValue(false), dan_C.GetValue(true) }, dan_C.GetExamRange()) { + /// + /// 段位認定の条件が有効であるかどうかを返します。 + /// + /// 段位認定の条件が有効であるかどうか。 + public bool GetEnable() { + return this.IsEnable; + } + /// + /// 各合格条件のボーダーを設定します。 + /// + /// 赤合格条件 + /// 金合格条件 + public void SetValue(int redValue, int goldValue) { + if (redValue != -1) this.Value[0] = redValue; + if (goldValue != -1) this.Value[1] = goldValue; + } + + /// + /// 各合格条件のボーダーを返します。 + /// + /// trueを指定すると、金合格条件を返します。 + /// 合格条件の値。 + public int GetValue(bool isGoldValue) { + return isGoldValue == true ? this.Value[1] : this.Value[0]; + } + + /// + /// 現在の値を設定します。 + /// + /// 現在の値。 + public void SetAmount(int amount) { + this.Amount = amount; + } + + /// + /// 現在の値を返します。 + /// + /// 現在の値。 + public int GetAmount() { + return this.Amount; + } + + /// + /// 条件の種別を返します。 + /// + /// 条件の種別 + public Exam.Type GetExamType() { + return this.Type; + } + + /// + /// 条件の種別を設定します。 + /// + /// 条件の種別。 + private void SetExamType(Exam.Type type) { + this.Type = type; + } + + /// + /// 条件の範囲を返します。 + /// + /// 条件の範囲 + public Exam.Range GetExamRange() { + return this.Range; + } + + /// + /// 条件の範囲を設定します。 + /// + /// + private void SetExamRange(Exam.Range range) { + this.Range = range; + } + + /// + /// 条件にクリアしているかどうか返します。 + /// + /// 条件にクリアしているかどうか。 + public bool[] GetCleared() { + return IsCleared; + } + + + /// + /// 条件と現在の値をチェックして、合格もしくは金合格をしてるか否かを更新する。 + /// + private void SetCleared() { + if (GetExamRange() == Exam.Range.More) { + if (GetAmount() >= GetValue(false)) { + IsCleared[0] = true; + if (GetAmount() >= GetValue(true)) + IsCleared[1] = true; + else + IsCleared[1] = false; + } else { + IsCleared[0] = false; + IsCleared[1] = false; + } + } else { + if (GetAmount() < GetValue(true)) { + IsCleared[1] = true; + } else { + IsCleared[1] = false; + } + if (GetAmount() < GetValue(false)) { + IsCleared[0] = true; + } else { + IsCleared[0] = false; + } } + } - /// - /// 段位認定の条件を初期化し、生成します。 - /// - /// 条件の種別。 - /// 条件の合格量。 - /// 条件の合格の範囲。 - public Dan_C(Exam.Type examType, int[] value, Exam.Range examRange) { - IsEnable = true; - NotReached = false; - SetExamType(examType); - SetValue(value[0], value[1]); - SetExamRange(examRange); + /// + /// ゲージの描画のための百分率を返す。 + /// + /// Amountの百分率。 + public int GetAmountToPercent() { + var percent = 0.0D; + if (GetValue(false) == 0) { + return 0; } - - /// - /// 条件と現在の値を評価して、クリアしたかどうかを判断します。 - /// - /// その条件の現在の値。 - public bool Update(int nowValue) { - var isChangedAmount = false; - - if (nowValue < 0) - return isChangedAmount; - - if (!GetEnable()) return isChangedAmount; - if (GetAmount() < nowValue) isChangedAmount = true; - if (GetExamRange() == Exam.Range.Less && nowValue > GetValue(false)) isChangedAmount = false; // n未満でその数を超えたらfalseを返す。 - SetAmount(nowValue); + if (GetExamRange() == Exam.Range.More) { switch (GetExamType()) { case Exam.Type.Gauge: case Exam.Type.JudgePerfect: case Exam.Type.JudgeGood: case Exam.Type.JudgeBad: + case Exam.Type.JudgeADLIB: + case Exam.Type.JudgeMine: case Exam.Type.Score: case Exam.Type.Roll: case Exam.Type.Hit: case Exam.Type.Combo: case Exam.Type.Accuracy: - case Exam.Type.JudgeADLIB: - case Exam.Type.JudgeMine: - SetCleared(); + percent = 1.0 * GetAmount() / GetValue(false); break; default: break; } - return isChangedAmount; - } - - /// - /// 段位認定の条件が有効であるかどうかを返します。 - /// - /// 段位認定の条件が有効であるかどうか。 - public bool GetEnable() { - return this.IsEnable; - } - - /// - /// 各合格条件のボーダーを設定します。 - /// - /// 赤合格条件 - /// 金合格条件 - public void SetValue(int redValue, int goldValue) { - if (redValue != -1) this.Value[0] = redValue; - if (goldValue != -1) this.Value[1] = goldValue; - } - - /// - /// 各合格条件のボーダーを返します。 - /// - /// trueを指定すると、金合格条件を返します。 - /// 合格条件の値。 - public int GetValue(bool isGoldValue) { - return isGoldValue == true ? this.Value[1] : this.Value[0]; - } - - /// - /// 現在の値を設定します。 - /// - /// 現在の値。 - public void SetAmount(int amount) { - this.Amount = amount; - } - - /// - /// 現在の値を返します。 - /// - /// 現在の値。 - public int GetAmount() { - return this.Amount; - } - - /// - /// 条件の種別を返します。 - /// - /// 条件の種別 - public Exam.Type GetExamType() { - return this.Type; - } - - /// - /// 条件の種別を設定します。 - /// - /// 条件の種別。 - private void SetExamType(Exam.Type type) { - this.Type = type; - } - - /// - /// 条件の範囲を返します。 - /// - /// 条件の範囲 - public Exam.Range GetExamRange() { - return this.Range; - } - - /// - /// 条件の範囲を設定します。 - /// - /// - private void SetExamRange(Exam.Range range) { - this.Range = range; - } - - /// - /// 条件にクリアしているかどうか返します。 - /// - /// 条件にクリアしているかどうか。 - public bool[] GetCleared() { - return IsCleared; - } - - - /// - /// 条件と現在の値をチェックして、合格もしくは金合格をしてるか否かを更新する。 - /// - private void SetCleared() { - if (GetExamRange() == Exam.Range.More) { - if (GetAmount() >= GetValue(false)) { - IsCleared[0] = true; - if (GetAmount() >= GetValue(true)) - IsCleared[1] = true; - else - IsCleared[1] = false; - } else { - IsCleared[0] = false; - IsCleared[1] = false; - } - } else { - if (GetAmount() < GetValue(true)) { - IsCleared[1] = true; - } else { - IsCleared[1] = false; - } - if (GetAmount() < GetValue(false)) { - IsCleared[0] = true; - } else { - IsCleared[0] = false; - } + } else { + switch (GetExamType()) { + case Exam.Type.Gauge: + case Exam.Type.JudgePerfect: + case Exam.Type.JudgeGood: + case Exam.Type.JudgeBad: + case Exam.Type.JudgeADLIB: + case Exam.Type.JudgeMine: + case Exam.Type.Score: + case Exam.Type.Roll: + case Exam.Type.Hit: + case Exam.Type.Combo: + case Exam.Type.Accuracy: + percent = (1.0 * (GetValue(false) - GetAmount())) / GetValue(false); + break; + default: + break; } } - - /// - /// ゲージの描画のための百分率を返す。 - /// - /// Amountの百分率。 - public int GetAmountToPercent() { - var percent = 0.0D; - if (GetValue(false) == 0) { - return 0; - } - if (GetExamRange() == Exam.Range.More) { - switch (GetExamType()) { - case Exam.Type.Gauge: - case Exam.Type.JudgePerfect: - case Exam.Type.JudgeGood: - case Exam.Type.JudgeBad: - case Exam.Type.JudgeADLIB: - case Exam.Type.JudgeMine: - case Exam.Type.Score: - case Exam.Type.Roll: - case Exam.Type.Hit: - case Exam.Type.Combo: - case Exam.Type.Accuracy: - percent = 1.0 * GetAmount() / GetValue(false); - break; - default: - break; - } - } else { - switch (GetExamType()) { - case Exam.Type.Gauge: - case Exam.Type.JudgePerfect: - case Exam.Type.JudgeGood: - case Exam.Type.JudgeBad: - case Exam.Type.JudgeADLIB: - case Exam.Type.JudgeMine: - case Exam.Type.Score: - case Exam.Type.Roll: - case Exam.Type.Hit: - case Exam.Type.Combo: - case Exam.Type.Accuracy: - percent = (1.0 * (GetValue(false) - GetAmount())) / GetValue(false); - break; - default: - break; - } - } - percent = percent * 100.0; - if (percent < 0.0) - percent = 0.0D; - if (percent > 100.0) - percent = 100.0D; - return (int)percent; - } - - /// - /// 条件に達成できる見込みがあるかどうか値を代入します。 - /// - /// 未達成かどうか。 - public void SetReached(bool notReached) { - NotReached = notReached; - } - - /// - /// 条件に達成できる見込みがあるかどうかを返します。 - /// - /// 条件に達成できる見込みがあるかどうか。 - public bool GetReached() { - return NotReached; - } - - // オーバーライドメソッド - /// - /// ToString()のオーバーライドメソッド。段位認定モードの各条件の現在状況をString型で返します。 - /// - /// 段位認定モードの各条件の現在状況。 - public override string ToString() { - return String.Format("Type: {0} / Value: {1}/{2} / Range: {3} / Amount: {4} / Clear: {5}/{6} / Percent: {7} / NotReached: {8}", GetExamType(), GetValue(false), GetValue(true), GetExamRange(), GetAmount(), GetCleared()[0], GetCleared()[1], GetAmountToPercent(), GetReached()); - } - - - // フィールド - /// - /// その条件が有効であるかどうか。 - /// - private bool IsEnable; - /// - /// 条件の種別。 - /// - private Exam.Type Type; - /// - /// 条件の範囲。 - /// - private Exam.Range Range; - /// - /// 条件の値。 - /// - public int[] Value = new int[] { 0, 0 }; - /// - /// 量。 - /// - public int Amount; - /// - /// 条件をクリアしているか否か。 - /// - public readonly bool[] IsCleared = new[] { false, false }; - - /// - /// 曲ごとの条件を格納する - /// - // public Dan_C[] SongExam = new Dan_C[3]; - - /// - /// 条件の達成見込みがなくなったら、真になる。 - /// この変数が一度trueになれば、基本的にfalseに戻ることはない。 - /// (スコア加算については、この限りではない。) - /// - private bool NotReached = false; + percent = percent * 100.0; + if (percent < 0.0) + percent = 0.0D; + if (percent > 100.0) + percent = 100.0D; + return (int)percent; } - public static class Exam { - /// - /// 段位認定の条件の種別。 - /// - public enum Type { - Gauge, - JudgePerfect, - JudgeGood, - JudgeBad, - Score, - Roll, - Hit, - Combo, - Accuracy, - JudgeADLIB, - JudgeMine, - Total, - } + /// + /// 条件に達成できる見込みがあるかどうか値を代入します。 + /// + /// 未達成かどうか。 + public void SetReached(bool notReached) { + NotReached = notReached; + } - /// - /// 段位認定の合格範囲。 - /// - public enum Range { - /// - /// 以上 - /// - More, - /// - /// 未満 - /// - Less - } + /// + /// 条件に達成できる見込みがあるかどうかを返します。 + /// + /// 条件に達成できる見込みがあるかどうか。 + public bool GetReached() { + return NotReached; + } + // オーバーライドメソッド + /// + /// ToString()のオーバーライドメソッド。段位認定モードの各条件の現在状況をString型で返します。 + /// + /// 段位認定モードの各条件の現在状況。 + public override string ToString() { + return String.Format("Type: {0} / Value: {1}/{2} / Range: {3} / Amount: {4} / Clear: {5}/{6} / Percent: {7} / NotReached: {8}", GetExamType(), GetValue(false), GetValue(true), GetExamRange(), GetAmount(), GetCleared()[0], GetCleared()[1], GetAmountToPercent(), GetReached()); + } + + + // フィールド + /// + /// その条件が有効であるかどうか。 + /// + private bool IsEnable; + /// + /// 条件の種別。 + /// + private Exam.Type Type; + /// + /// 条件の範囲。 + /// + private Exam.Range Range; + /// + /// 条件の値。 + /// + public int[] Value = new int[] { 0, 0 }; + /// + /// 量。 + /// + public int Amount; + /// + /// 条件をクリアしているか否か。 + /// + public readonly bool[] IsCleared = new[] { false, false }; + + /// + /// 曲ごとの条件を格納する + /// + // public Dan_C[] SongExam = new Dan_C[3]; + + /// + /// 条件の達成見込みがなくなったら、真になる。 + /// この変数が一度trueになれば、基本的にfalseに戻ることはない。 + /// (スコア加算については、この限りではない。) + /// + private bool NotReached = false; +} + +public static class Exam { + /// + /// 段位認定の条件の種別。 + /// + public enum Type { + Gauge, + JudgePerfect, + JudgeGood, + JudgeBad, + Score, + Roll, + Hit, + Combo, + Accuracy, + JudgeADLIB, + JudgeMine, + Total, + } + + /// + /// 段位認定の合格範囲。 + /// + public enum Range { /// - /// ステータス。 + /// 以上 /// - public enum Status { - /// - /// 不合格 - /// - Failure, - /// - /// 合格 - /// - Success, - /// - /// より良い合格 - /// - Better_Success - } + More, + /// + /// 未満 + /// + Less + } + + /// + /// ステータス。 + /// + public enum Status { + /// + /// 不合格 + /// + Failure, + /// + /// 合格 + /// + Success, + /// + /// より良い合格 + /// + Better_Success } } diff --git a/OpenTaiko/src/Songs/Extended/CSongObject.cs b/OpenTaiko/src/Songs/Extended/CSongObject.cs index 997cd862..5f2f0c2c 100644 --- a/OpenTaiko/src/Songs/Extended/CSongObject.cs +++ b/OpenTaiko/src/Songs/Extended/CSongObject.cs @@ -1,91 +1,91 @@ using FDK; -namespace OpenTaiko { - class CSongObject { - public CSongObject(string name, float x, float y, string path) { - this.name = path; - this.isVisible = false; +namespace OpenTaiko; - this.x = x; - this.y = y; - this.rotation = 0f; - this.opacity = 255; - this.xScale = 1.0f; - this.yScale = 1.0f; - this.color = new Color4(1f, 1f, 1f, 1f); - this.frame = 0; +class CSongObject { + public CSongObject(string name, float x, float y, string path) { + this.name = path; + this.isVisible = false; - FileAttributes attr = File.GetAttributes(path); + this.x = x; + this.y = y; + this.rotation = 0f; + this.opacity = 255; + this.xScale = 1.0f; + this.yScale = 1.0f; + this.color = new Color4(1f, 1f, 1f, 1f); + this.frame = 0; - if ((attr & FileAttributes.Directory) == FileAttributes.Directory) { - textures = OpenTaiko.Tx.TxCSongFolder(path); - } else { - textures = new CTexture[1]; - textures[0] = OpenTaiko.Tx.TxCSong(path); - } + FileAttributes attr = File.GetAttributes(path); + + if ((attr & FileAttributes.Directory) == FileAttributes.Directory) { + textures = OpenTaiko.Tx.TxCSongFolder(path); + } else { + textures = new CTexture[1]; + textures[0] = OpenTaiko.Tx.TxCSong(path); } - - public void tStartAnimation(double animInterval, bool loop) { - counter.Start(0, textures.Length - 1, animInterval, OpenTaiko.Timer); - counter.CurrentValue = this.frame; - - this.isLooping = loop; - this.isAnimating = true; - } - - public void tStopAnimation() { - counter.Stop(); - this.isAnimating = false; - } - - public void tDraw() { - if (isAnimating) { - if (isLooping) counter.TickLoop(); - else { - counter.Tick(); - if (counter.IsEnded) this.tStopAnimation(); - } - - frame = counter.CurrentValue; - } - - CTexture tx = this.textures[frame]; - if (frame + 1 > textures.Length) return; - if (tx == null) return; - - tx.fZ軸中心回転 = CConversion.DegreeToRadian(this.rotation); - tx.color4 = this.color; - tx.Opacity = this.opacity; - - float screen_ratiox = OpenTaiko.Skin.Resolution[0] / 1280.0f; - float screen_ratioy = OpenTaiko.Skin.Resolution[1] / 720.0f; - if (isVisible) tx.t2D描画SongObj((int)(this.x * screen_ratiox), (int)(this.y * screen_ratioy), this.xScale * screen_ratiox, this.yScale * screen_ratioy); - } - - public void tDispose() { - this.isVisible = false; - foreach (CTexture tx in textures) { - if (tx != null) tx.Dispose(); - } - } - - private CCounter counter = new CCounter(); - private bool isAnimating; - private bool isLooping; - - public CTexture[] textures; - - public string name; - public bool isVisible; - - public float x; - public float y; - public float rotation; - public int opacity; - public float xScale; - public float yScale; - public Color4 color; - - public int frame; } + + public void tStartAnimation(double animInterval, bool loop) { + counter.Start(0, textures.Length - 1, animInterval, OpenTaiko.Timer); + counter.CurrentValue = this.frame; + + this.isLooping = loop; + this.isAnimating = true; + } + + public void tStopAnimation() { + counter.Stop(); + this.isAnimating = false; + } + + public void tDraw() { + if (isAnimating) { + if (isLooping) counter.TickLoop(); + else { + counter.Tick(); + if (counter.IsEnded) this.tStopAnimation(); + } + + frame = counter.CurrentValue; + } + + CTexture tx = this.textures[frame]; + if (frame + 1 > textures.Length) return; + if (tx == null) return; + + tx.fZ軸中心回転 = CConversion.DegreeToRadian(this.rotation); + tx.color4 = this.color; + tx.Opacity = this.opacity; + + float screen_ratiox = OpenTaiko.Skin.Resolution[0] / 1280.0f; + float screen_ratioy = OpenTaiko.Skin.Resolution[1] / 720.0f; + if (isVisible) tx.t2D描画SongObj((int)(this.x * screen_ratiox), (int)(this.y * screen_ratioy), this.xScale * screen_ratiox, this.yScale * screen_ratioy); + } + + public void tDispose() { + this.isVisible = false; + foreach (CTexture tx in textures) { + if (tx != null) tx.Dispose(); + } + } + + private CCounter counter = new CCounter(); + private bool isAnimating; + private bool isLooping; + + public CTexture[] textures; + + public string name; + public bool isVisible; + + public float x; + public float y; + public float rotation; + public int opacity; + public float xScale; + public float yScale; + public Color4 color; + + public int frame; } diff --git a/OpenTaiko/src/Songs/GaugeIncreaseMode.cs b/OpenTaiko/src/Songs/GaugeIncreaseMode.cs index d6315b24..866c752d 100644 --- a/OpenTaiko/src/Songs/GaugeIncreaseMode.cs +++ b/OpenTaiko/src/Songs/GaugeIncreaseMode.cs @@ -1,27 +1,27 @@ -namespace OpenTaiko { +namespace OpenTaiko; + +/// +/// ゲージ増加量の種類。 +/// +public enum GaugeIncreaseMode { /// - /// ゲージ増加量の種類。 + /// 切り捨てる。Floorと同義。 /// - public enum GaugeIncreaseMode { - /// - /// 切り捨てる。Floorと同義。 - /// - Normal, - /// - /// 切り捨てる。 - /// - Floor, - /// - /// 四捨五入する。 - /// - Round, - /// - /// 切り上げる。 - /// - Ceiling, - /// - /// 丸め処理を行わない。 - /// - NotFix - } + Normal, + /// + /// 切り捨てる。 + /// + Floor, + /// + /// 四捨五入する。 + /// + Round, + /// + /// 切り上げる。 + /// + Ceiling, + /// + /// 丸め処理を行わない。 + /// + NotFix } diff --git a/OpenTaiko/src/Songs/VTTParser.cs b/OpenTaiko/src/Songs/VTTParser.cs index 5f98531c..9ec6afbc 100644 --- a/OpenTaiko/src/Songs/VTTParser.cs +++ b/OpenTaiko/src/Songs/VTTParser.cs @@ -6,466 +6,466 @@ using FDK; using SkiaSharp; using static OpenTaiko.CDTX; -namespace OpenTaiko { - public class VTTParser : IDisposable { - // TODO : timestamp tag support - [Flags] - private enum ParseMode { - None = 0, - Tag = 1, - TagEnd = 2, - Rt = 4 - } +namespace OpenTaiko; - internal struct LyricData { - public long timestamp; // TODO: WIP, only first timestamp is accounted for - public string Text; +public class VTTParser : IDisposable { + // TODO : timestamp tag support + [Flags] + private enum ParseMode { + None = 0, + Tag = 1, + TagEnd = 2, + Rt = 4 + } - public CCachedFontRenderer.FontStyle Style; - public Color ForeColor; - public Color BackColor; + internal struct LyricData { + public long timestamp; // TODO: WIP, only first timestamp is accounted for + public string Text; - public bool IsRuby; - public string RubyText; + public CCachedFontRenderer.FontStyle Style; + public Color ForeColor; + public Color BackColor; - public int line; - public string Language; - } + public bool IsRuby; + public string RubyText; - private static string[] _vttdelimiter; + public int line; + public string Language; + } - private static Regex regexTimestamp; + private static string[] _vttdelimiter; - private static Regex regexOffset; - private static Regex regexLang; + private static Regex regexTimestamp; - private static bool isUsingLang; + private static Regex regexOffset; + private static Regex regexLang; - private bool _isDisposed; + private static bool isUsingLang; - public VTTParser() { - _vttdelimiter = new[] { "-->", "- >", "->" }; + private bool _isDisposed; - regexTimestamp = new Regex(@"(-)?(([0-9]+):)?([0-9]+):([0-9]+)[,\\.]([0-9]+)"); + public VTTParser() { + _vttdelimiter = new[] { "-->", "- >", "->" }; - regexOffset = new Regex(@"Offset:\s*(.*?(?=;|$))"); // i.e. "WEBVTT Offset: 00:01.001;" , "WEBVTT Offset: 1.001;" - regexLang = new Regex(@"Language:\s*(.*?(?=;|$))"); // i.e. "WEBVTT Language: ja;" + regexTimestamp = new Regex(@"(-)?(([0-9]+):)?([0-9]+):([0-9]+)[,\\.]([0-9]+)"); + + regexOffset = new Regex(@"Offset:\s*(.*?(?=;|$))"); // i.e. "WEBVTT Offset: 00:01.001;" , "WEBVTT Offset: 1.001;" + regexLang = new Regex(@"Language:\s*(.*?(?=;|$))"); // i.e. "WEBVTT Language: ja;" + + isUsingLang = false; + } + + #region Dispose stuff + public void Dispose() { + Dispose(true); + GC.SuppressFinalize(this); + } + + protected virtual void Dispose(bool disposing) { + if (!_isDisposed && disposing) { + _vttdelimiter = null; + regexTimestamp = null; + + regexOffset = null; + regexLang = null; isUsingLang = false; + + _isDisposed = true; } - #region Dispose stuff - public void Dispose() { - Dispose(true); - GC.SuppressFinalize(this); - } + } + #endregion - protected virtual void Dispose(bool disposing) { - if (!_isDisposed && disposing) { - _vttdelimiter = null; - regexTimestamp = null; - - regexOffset = null; - regexLang = null; - - isUsingLang = false; - - _isDisposed = true; - } + internal List ParseVTTFile(string filepath, int order, long offset) { + List lrclist = new List(); + List lines = File.ReadAllLines(filepath).ToList(); + #region Header data + if (!lines[0].StartsWith("WEBVTT")) { + Trace.TraceWarning("Aborting VTT parse at {0}. WebVTT header does not start with \"WEBVTT\".", filepath); + return lrclist; } #endregion - internal List ParseVTTFile(string filepath, int order, long offset) { - List lrclist = new List(); - List lines = File.ReadAllLines(filepath).ToList(); + long startTime = -1; + long endTime = -1; - #region Header data - if (!lines[0].StartsWith("WEBVTT")) { - Trace.TraceWarning("Aborting VTT parse at {0}. WebVTT header does not start with \"WEBVTT\".", filepath); - return lrclist; - } - #endregion + bool ignoreLyrics = false; + bool langIsMatch = false; - long startTime = -1; - long endTime = -1; + List lyricData = new List(); - bool ignoreLyrics = false; - bool langIsMatch = false; + LyricData data = new LyricData() { + ForeColor = OpenTaiko.Skin.Game_Lyric_ForeColor, + BackColor = OpenTaiko.Skin.Game_Lyric_BackColor + }; - List lyricData = new List(); + bool readingHeader = true; + for (int i = 0; i < lines.Count; i++) { + long start; + long end; - LyricData data = new LyricData() { - ForeColor = OpenTaiko.Skin.Game_Lyric_ForeColor, - BackColor = OpenTaiko.Skin.Game_Lyric_BackColor - }; - - bool readingHeader = true; - for (int i = 0; i < lines.Count; i++) { - long start; - long end; - - if (readingHeader) { - Match languageMatch = regexLang.Match(lines[i]); - if (languageMatch.Success) { - if (!(languageMatch.Groups[1].Value.ToLower() == CLangManager.fetchLang())) { - Trace.TraceWarning("Aborting VTT parse at {0}. WebVTT header language does not match user's selected language.", filepath); - return lrclist; - } - } - Match offsetMatch = regexOffset.Match(lines[i]); - if (offsetMatch.Success && regexTimestamp.Match(offsetMatch.Groups[1].Value).Success) { - offset += ParseTimestamp(offsetMatch.Groups[1].Value); - } else if (offsetMatch.Success && float.TryParse(offsetMatch.Groups[1].Value, out float result)) { - offset += (long)(result * 1000); - } - - if (String.IsNullOrEmpty(lines[i])) - readingHeader = false; - } else { - // Check for blank (process data if true), or else check for NOTE, or else check for Timestamps, or else parse text - if (String.IsNullOrEmpty(lines[i])) { - if (!ignoreLyrics && lyricData.Count != 0) { - lyricData.RemoveAll(empty => String.IsNullOrEmpty(empty.Text)); - lrclist.Add(CreateLyric(lyricData, order)); - } - - lyricData = new List(); - data = new LyricData() { - timestamp = startTime, - ForeColor = OpenTaiko.Skin.Game_Lyric_ForeColor, - BackColor = OpenTaiko.Skin.Game_Lyric_BackColor - }; - ignoreLyrics = false; - isUsingLang = false; - langIsMatch = false; - - continue; - } - - if (lines[i].StartsWith("NOTE ")) { ignoreLyrics = true; } else if (!ignoreLyrics && TryParseTimestamp(lines[i], out start, out end)) { - lyricData = new List(); // Prevents chapters from being included by mistake - - if (start > endTime && endTime != -1) { - lrclist.Add(CreateLyric(new List() { new LyricData() { timestamp = endTime + offset } }, order)); - // If new start timestamp is greater than old end timestamp, - // it is assumed there is a gap in-between displaying lyrics. - } - - startTime = start; - endTime = end; - - data.timestamp = start + offset; - } else if (!ignoreLyrics) // If all else fails, let's assume it's a lyric. ¯\_(ツ)_/¯ - { - int j = 0; - var parseMode = ParseMode.None; - - string tagdata = String.Empty; - data.Text = String.Empty; - - for (j = 0; j < lines[i].Length; j++) { - switch (lines[i].Substring(j, 1)) { - #region HTML Tags - case "<": - parseMode |= ParseMode.Tag; - break; - case "/": - if (parseMode.HasFlag(ParseMode.Tag)) { parseMode |= ParseMode.TagEnd; } else { goto default; } - break; - case ">": - if (parseMode.HasFlag(ParseMode.TagEnd)) { - if (tagdata == ("c")) { - lyricData.Add(data); - data.Text = String.Empty; - data.ForeColor = OpenTaiko.Skin.Game_Lyric_ForeColor; - data.BackColor = OpenTaiko.Skin.Game_Lyric_BackColor; - } else if (tagdata.StartsWith("lang")) { data.Language = String.Empty; } else if (tagdata == "ruby") { - lyricData.Add(data); - data.IsRuby = false; - data.RubyText = String.Empty; - data.Text = String.Empty; - } else if (tagdata == "rt") { parseMode &= ~ParseMode.Rt; } else if (tagdata == "b") { - lyricData.Add(data); - data.Text = String.Empty; - data.Style &= ~CCachedFontRenderer.FontStyle.Bold; - } else if (tagdata == "i") { - lyricData.Add(data); - data.Text = String.Empty; - data.Style &= ~CCachedFontRenderer.FontStyle.Italic; - } else if (tagdata == "u") { - lyricData.Add(data); - data.Text = String.Empty; - data.Style &= ~CCachedFontRenderer.FontStyle.Underline; - } else if (tagdata == "s") { - lyricData.Add(data); - data.Text = String.Empty; - data.Style &= ~CCachedFontRenderer.FontStyle.Strikeout; - } - } else if (parseMode.HasFlag(ParseMode.Tag)) { - if (tagdata.StartsWith("c.")) { - lyricData.Add(data); - data.Text = String.Empty; - string[] colordata = tagdata.Split('.'); - foreach (string clr in colordata) { - switch (clr) { - case "white": - data.ForeColor = OpenTaiko.Skin.Game_Lyric_VTTForeColor[0]; - break; - case "lime": - data.ForeColor = OpenTaiko.Skin.Game_Lyric_VTTForeColor[1]; - break; - case "cyan": - data.ForeColor = OpenTaiko.Skin.Game_Lyric_VTTForeColor[2]; - break; - case "red": - data.ForeColor = OpenTaiko.Skin.Game_Lyric_VTTForeColor[3]; - break; - case "yellow": - data.ForeColor = OpenTaiko.Skin.Game_Lyric_VTTForeColor[4]; - break; - case "magenta": - data.ForeColor = OpenTaiko.Skin.Game_Lyric_VTTForeColor[5]; - break; - case "blue": - data.ForeColor = OpenTaiko.Skin.Game_Lyric_VTTForeColor[6]; - break; - case "black": - data.ForeColor = OpenTaiko.Skin.Game_Lyric_VTTForeColor[7]; - break; - case "bg_white": - data.BackColor = OpenTaiko.Skin.Game_Lyric_VTTBackColor[0]; - break; - case "bg_lime": - data.BackColor = OpenTaiko.Skin.Game_Lyric_VTTBackColor[1]; - break; - case "bg_cyan": - data.BackColor = OpenTaiko.Skin.Game_Lyric_VTTBackColor[2]; - break; - case "bg_red": - data.BackColor = OpenTaiko.Skin.Game_Lyric_VTTBackColor[3]; - break; - case "bg_yellow": - data.BackColor = OpenTaiko.Skin.Game_Lyric_VTTBackColor[4]; - break; - case "bg_magenta": - data.BackColor = OpenTaiko.Skin.Game_Lyric_VTTBackColor[5]; - break; - case "bg_blue": - data.BackColor = OpenTaiko.Skin.Game_Lyric_VTTBackColor[6]; - break; - case "bg_black": - data.BackColor = OpenTaiko.Skin.Game_Lyric_VTTBackColor[7]; - break; - default: - break; - } - } - } else if (tagdata.StartsWith("lang")) { - string[] langdata = tagdata.Split(' '); - foreach (string lng in langdata) { - if (lng != "lang") { - data.Language = lng; - isUsingLang = true; - - if (data.Language == CLangManager.fetchLang()) { data.line = 0; lyricData.Clear(); langIsMatch = true; } // Wipe current lyric data if matching lang is found - else { langIsMatch = false; } - } - } - } else if (tagdata == "ruby") { - lyricData.Add(data); - data.Text = String.Empty; - data.IsRuby = true; - } else if (tagdata == "rt") { parseMode |= ParseMode.Rt; } else if (tagdata == "b") { - lyricData.Add(data); - data.Text = String.Empty; - data.Style |= CCachedFontRenderer.FontStyle.Bold; - } else if (tagdata == "i") { - lyricData.Add(data); - data.Text = String.Empty; - data.Style |= CCachedFontRenderer.FontStyle.Italic; - } else if (tagdata == "u") { - lyricData.Add(data); - data.Text = String.Empty; - data.Style |= CCachedFontRenderer.FontStyle.Underline; - } else if (tagdata == "s") { - lyricData.Add(data); - data.Text = String.Empty; - data.Style |= CCachedFontRenderer.FontStyle.Strikeout; - } - } else { goto default; } - parseMode &= ~ParseMode.Tag & ~ParseMode.TagEnd; - tagdata = String.Empty; - break; - #endregion - default: - if (parseMode.HasFlag(ParseMode.Tag)) { tagdata += lines[i].Substring(j, 1); } else if (!isUsingLang || (isUsingLang && langIsMatch)) { - if (parseMode.HasFlag(ParseMode.Rt)) { data.RubyText += lines[i].Substring(j, 1); } else { data.Text += lines[i].Substring(j, 1); } - } - break; - } - } - string betterDecode(string sourceText) { - if (sourceText == null) return ""; - string decodeResult = ""; - for (int i = 0; i < sourceText.Length; i++) { - switch (sourceText[i]) { - case '<': - case '>': - case '&': - case ';': - decodeResult += sourceText[i]; - break; - default: - decodeResult += WebUtility.HtmlDecode(sourceText[i].ToString()); - break; - } - } - return decodeResult; - } - data.Text = betterDecode(data.Text); - data.RubyText = betterDecode(data.RubyText); - - lyricData.Add(data); - - data.line++; + if (readingHeader) { + Match languageMatch = regexLang.Match(lines[i]); + if (languageMatch.Success) { + if (!(languageMatch.Groups[1].Value.ToLower() == CLangManager.fetchLang())) { + Trace.TraceWarning("Aborting VTT parse at {0}. WebVTT header language does not match user's selected language.", filepath); + return lrclist; } } - } - // Add last lyric to list - if (lyricData.Count > 0) { - lyricData.RemoveAll(empty => String.IsNullOrEmpty(empty.Text)); - lrclist.Add(CreateLyric(lyricData, order)); - } - lrclist.Add(CreateLyric(new List() { new LyricData() { timestamp = endTime + offset } }, order)); - return lrclist; + Match offsetMatch = regexOffset.Match(lines[i]); + if (offsetMatch.Success && regexTimestamp.Match(offsetMatch.Groups[1].Value).Success) { + offset += ParseTimestamp(offsetMatch.Groups[1].Value); + } else if (offsetMatch.Success && float.TryParse(offsetMatch.Groups[1].Value, out float result)) { + offset += (long)(result * 1000); + } - } - internal bool TryParseTimestamp(string input, out long startTime, out long endTime) { - var split = input.Split(_vttdelimiter, StringSplitOptions.None); - if (split.Length == 2 && regexTimestamp.IsMatch(split[0]) && regexTimestamp.IsMatch(split[1])) { - startTime = ParseTimestamp(split[0]); - endTime = ParseTimestamp(split[1]); - return true; + if (String.IsNullOrEmpty(lines[i])) + readingHeader = false; } else { - startTime = -1; - endTime = -1; - return false; - } - } - internal long ParseTimestamp(string input) { - int hours; - int minutes; - int seconds; - int milliseconds = -1; + // Check for blank (process data if true), or else check for NOTE, or else check for Timestamps, or else parse text + if (String.IsNullOrEmpty(lines[i])) { + if (!ignoreLyrics && lyricData.Count != 0) { + lyricData.RemoveAll(empty => String.IsNullOrEmpty(empty.Text)); + lrclist.Add(CreateLyric(lyricData, order)); + } - Match match = regexTimestamp.Match(input); - if (match.Success) { - hours = !string.IsNullOrEmpty(match.Groups[3].Value) ? int.Parse(match.Groups[3].Value) : 0; // Hours are sometimes not included in timestamps. - minutes = int.Parse(match.Groups[4].Value); - seconds = int.Parse(match.Groups[5].Value); - milliseconds = int.Parse(match.Groups[6].Value); + lyricData = new List(); + data = new LyricData() { + timestamp = startTime, + ForeColor = OpenTaiko.Skin.Game_Lyric_ForeColor, + BackColor = OpenTaiko.Skin.Game_Lyric_BackColor + }; + ignoreLyrics = false; + isUsingLang = false; + langIsMatch = false; - TimeSpan result = new TimeSpan(0, hours, minutes, seconds, milliseconds); - return (long)result.TotalMilliseconds * (match.Groups[1].Value == "-" ? -1 : 1); - } + continue; + } - return -1; - } - internal STLYRIC CreateLyric(List datalist, int order) { - long timestamp = datalist[0].timestamp; // Function will change later w/ timestamp tag implementation + if (lines[i].StartsWith("NOTE ")) { ignoreLyrics = true; } else if (!ignoreLyrics && TryParseTimestamp(lines[i], out start, out end)) { + lyricData = new List(); // Prevents chapters from being included by mistake - List> textures = new List>(); - List> rubywidthoffset = new List>(); // Save for when text is combined, in case ruby text is longer than original text - List rubyheightoffset = new List(); - int linecount = datalist.Max((data => data.line)) + 1; + if (start > endTime && endTime != -1) { + lrclist.Add(CreateLyric(new List() { new LyricData() { timestamp = endTime + offset } }, order)); + // If new start timestamp is greater than old end timestamp, + // it is assumed there is a gap in-between displaying lyrics. + } - for (int i = 0; i < linecount; i++) { - textures.Add(new List()); - rubywidthoffset.Add(new List()); - rubyheightoffset.Add(0); - } + startTime = start; + endTime = end; - string text = String.Empty; + data.timestamp = start + offset; + } else if (!ignoreLyrics) // If all else fails, let's assume it's a lyric. ¯\_(ツ)_/¯ + { + int j = 0; + var parseMode = ParseMode.None; - foreach (LyricData data in datalist) { - using (CCachedFontRenderer fastdraw = HPrivateFastFont.tInstantiateFont(OpenTaiko.Skin.Game_Lyric_FontName, OpenTaiko.Skin.Game_Lyric_FontSize, data.Style)) { - SKBitmap textdrawing = fastdraw.DrawText(data.Text, data.ForeColor, data.BackColor, null, 30); // Draw main text + string tagdata = String.Empty; + data.Text = String.Empty; - if (data.IsRuby) // ruby time - { - using (CCachedFontRenderer rubydraw = HPrivateFastFont.tInstantiateFont(OpenTaiko.Skin.Game_Lyric_FontName, OpenTaiko.Skin.Game_Lyric_FontSize / 2, data.Style)) { - SKBitmap ruby = rubydraw.DrawText(data.RubyText, data.ForeColor, data.BackColor, null, 30); - Size size = new Size(textdrawing.Width > ruby.Width ? textdrawing.Width : ruby.Width, textdrawing.Height + (OpenTaiko.Skin.Game_Lyric_VTTRubyOffset + (ruby.Height / 2))); - SKBitmap fullruby = new SKBitmap(size.Width, size.Height); + for (j = 0; j < lines[i].Length; j++) { + switch (lines[i].Substring(j, 1)) { + #region HTML Tags + case "<": + parseMode |= ParseMode.Tag; + break; + case "/": + if (parseMode.HasFlag(ParseMode.Tag)) { parseMode |= ParseMode.TagEnd; } else { goto default; } + break; + case ">": + if (parseMode.HasFlag(ParseMode.TagEnd)) { + if (tagdata == ("c")) { + lyricData.Add(data); + data.Text = String.Empty; + data.ForeColor = OpenTaiko.Skin.Game_Lyric_ForeColor; + data.BackColor = OpenTaiko.Skin.Game_Lyric_BackColor; + } else if (tagdata.StartsWith("lang")) { data.Language = String.Empty; } else if (tagdata == "ruby") { + lyricData.Add(data); + data.IsRuby = false; + data.RubyText = String.Empty; + data.Text = String.Empty; + } else if (tagdata == "rt") { parseMode &= ~ParseMode.Rt; } else if (tagdata == "b") { + lyricData.Add(data); + data.Text = String.Empty; + data.Style &= ~CCachedFontRenderer.FontStyle.Bold; + } else if (tagdata == "i") { + lyricData.Add(data); + data.Text = String.Empty; + data.Style &= ~CCachedFontRenderer.FontStyle.Italic; + } else if (tagdata == "u") { + lyricData.Add(data); + data.Text = String.Empty; + data.Style &= ~CCachedFontRenderer.FontStyle.Underline; + } else if (tagdata == "s") { + lyricData.Add(data); + data.Text = String.Empty; + data.Style &= ~CCachedFontRenderer.FontStyle.Strikeout; + } + } else if (parseMode.HasFlag(ParseMode.Tag)) { + if (tagdata.StartsWith("c.")) { + lyricData.Add(data); + data.Text = String.Empty; + string[] colordata = tagdata.Split('.'); + foreach (string clr in colordata) { + switch (clr) { + case "white": + data.ForeColor = OpenTaiko.Skin.Game_Lyric_VTTForeColor[0]; + break; + case "lime": + data.ForeColor = OpenTaiko.Skin.Game_Lyric_VTTForeColor[1]; + break; + case "cyan": + data.ForeColor = OpenTaiko.Skin.Game_Lyric_VTTForeColor[2]; + break; + case "red": + data.ForeColor = OpenTaiko.Skin.Game_Lyric_VTTForeColor[3]; + break; + case "yellow": + data.ForeColor = OpenTaiko.Skin.Game_Lyric_VTTForeColor[4]; + break; + case "magenta": + data.ForeColor = OpenTaiko.Skin.Game_Lyric_VTTForeColor[5]; + break; + case "blue": + data.ForeColor = OpenTaiko.Skin.Game_Lyric_VTTForeColor[6]; + break; + case "black": + data.ForeColor = OpenTaiko.Skin.Game_Lyric_VTTForeColor[7]; + break; + case "bg_white": + data.BackColor = OpenTaiko.Skin.Game_Lyric_VTTBackColor[0]; + break; + case "bg_lime": + data.BackColor = OpenTaiko.Skin.Game_Lyric_VTTBackColor[1]; + break; + case "bg_cyan": + data.BackColor = OpenTaiko.Skin.Game_Lyric_VTTBackColor[2]; + break; + case "bg_red": + data.BackColor = OpenTaiko.Skin.Game_Lyric_VTTBackColor[3]; + break; + case "bg_yellow": + data.BackColor = OpenTaiko.Skin.Game_Lyric_VTTBackColor[4]; + break; + case "bg_magenta": + data.BackColor = OpenTaiko.Skin.Game_Lyric_VTTBackColor[5]; + break; + case "bg_blue": + data.BackColor = OpenTaiko.Skin.Game_Lyric_VTTBackColor[6]; + break; + case "bg_black": + data.BackColor = OpenTaiko.Skin.Game_Lyric_VTTBackColor[7]; + break; + default: + break; + } + } + } else if (tagdata.StartsWith("lang")) { + string[] langdata = tagdata.Split(' '); + foreach (string lng in langdata) { + if (lng != "lang") { + data.Language = lng; + isUsingLang = true; - - using (SKCanvas canvas = new SKCanvas(fullruby)) { - canvas.DrawBitmap(textdrawing, (fullruby.Width / 2) - (textdrawing.Width / 2), (fullruby.Height / 2) - (textdrawing.Height / 2)); - canvas.DrawBitmap(ruby, (fullruby.Width - ruby.Width) / 2, (fullruby.Height / 2) - (ruby.Height / 2) - OpenTaiko.Skin.Game_Lyric_VTTRubyOffset); + if (data.Language == CLangManager.fetchLang()) { data.line = 0; lyricData.Clear(); langIsMatch = true; } // Wipe current lyric data if matching lang is found + else { langIsMatch = false; } + } + } + } else if (tagdata == "ruby") { + lyricData.Add(data); + data.Text = String.Empty; + data.IsRuby = true; + } else if (tagdata == "rt") { parseMode |= ParseMode.Rt; } else if (tagdata == "b") { + lyricData.Add(data); + data.Text = String.Empty; + data.Style |= CCachedFontRenderer.FontStyle.Bold; + } else if (tagdata == "i") { + lyricData.Add(data); + data.Text = String.Empty; + data.Style |= CCachedFontRenderer.FontStyle.Italic; + } else if (tagdata == "u") { + lyricData.Add(data); + data.Text = String.Empty; + data.Style |= CCachedFontRenderer.FontStyle.Underline; + } else if (tagdata == "s") { + lyricData.Add(data); + data.Text = String.Empty; + data.Style |= CCachedFontRenderer.FontStyle.Strikeout; + } + } else { goto default; } + parseMode &= ~ParseMode.Tag & ~ParseMode.TagEnd; + tagdata = String.Empty; + break; + #endregion + default: + if (parseMode.HasFlag(ParseMode.Tag)) { tagdata += lines[i].Substring(j, 1); } else if (!isUsingLang || (isUsingLang && langIsMatch)) { + if (parseMode.HasFlag(ParseMode.Rt)) { data.RubyText += lines[i].Substring(j, 1); } else { data.Text += lines[i].Substring(j, 1); } + } + break; + } + } + string betterDecode(string sourceText) { + if (sourceText == null) return ""; + string decodeResult = ""; + for (int i = 0; i < sourceText.Length; i++) { + switch (sourceText[i]) { + case '<': + case '>': + case '&': + case ';': + decodeResult += sourceText[i]; + break; + default: + decodeResult += WebUtility.HtmlDecode(sourceText[i].ToString()); + break; } - textures[data.line].Add(fullruby); - rubywidthoffset[data.line].Add((fullruby.Width - textdrawing.Width) / 2 > 0 ? (fullruby.Width - textdrawing.Width) / 2 : 0); - rubyheightoffset[data.line] = (fullruby.Height - (fullruby.Height - ruby.Height)) / 2 > rubyheightoffset[data.line] ? (fullruby.Height - (fullruby.Height - ruby.Height)) / 2 : rubyheightoffset[data.line]; } - } else { - textures[data.line].Add(textdrawing); - rubywidthoffset[data.line].Add(0); + return decodeResult; } - } - text += data.IsRuby ? data.Text + "(" + data.RubyText + ")" : data.Text; - } + data.Text = betterDecode(data.Text); + data.RubyText = betterDecode(data.RubyText); - int[] width = new int[textures.Count]; - int[] height = new int[textures.Count]; - int[][] widths = new int[textures.Count][]; - int[][] heights = new int[textures.Count][]; - int max_width = 0; - int max_height = 0; + lyricData.Add(data); - int space = 50; - for (int i = 0; i < textures.Count; i++) { - widths[i] = new int[textures[i].Count]; - heights[i] = new int[textures[i].Count]; - for (int j = 0; j < textures[i].Count; j++) { - int nowWidth = Math.Max(textures[i][j].Width - space, 0); - int nowHeight = textures[i][j].Height; - - widths[i][j] += nowWidth; - heights[i][j] += nowHeight; - width[i] += nowWidth; - height[i] = nowHeight > height[i] ? nowHeight : height[i]; - } - width[i] += space; - max_width = (width[i] > max_width ? width[i] : max_width); - max_height += height[i]; - } - - SKBitmap lyrictex = new SKBitmap(max_width > 0 ? max_width : 1, max_height - rubyheightoffset.Sum() > 0 ? max_height - rubyheightoffset.Sum() : 1); // Prevent exception with 0x0y Bitmap - - if (textures.Count > 0) { - using (SKCanvas canvas = new SKCanvas(lyrictex)) { - canvas.Clear(); - - int y = 0; - for (int i = 0; i < textures.Count; i++) { - int x = (lyrictex.Width - width[i]) / 2; - for (int j = 0; j < textures[i].Count; j++) { - canvas.DrawBitmap(textures[i][j], x, y + ((height[i] - textures[i][j].Height) / 2) + (rubyheightoffset[i] / 2)); - x += widths[i][j]; - } - y += height[i] - rubyheightoffset[i]; - } + data.line++; } } + } + // Add last lyric to list + if (lyricData.Count > 0) { + lyricData.RemoveAll(empty => String.IsNullOrEmpty(empty.Text)); + lrclist.Add(CreateLyric(lyricData, order)); + } + lrclist.Add(CreateLyric(new List() { new LyricData() { timestamp = endTime + offset } }, order)); + return lrclist; - STLYRIC st = new STLYRIC() { - index = order, - Text = text, - TextTex = lyrictex, - Time = timestamp - }; - return st; + } + internal bool TryParseTimestamp(string input, out long startTime, out long endTime) { + var split = input.Split(_vttdelimiter, StringSplitOptions.None); + if (split.Length == 2 && regexTimestamp.IsMatch(split[0]) && regexTimestamp.IsMatch(split[1])) { + startTime = ParseTimestamp(split[0]); + endTime = ParseTimestamp(split[1]); + return true; + } else { + startTime = -1; + endTime = -1; + return false; } } + internal long ParseTimestamp(string input) { + int hours; + int minutes; + int seconds; + int milliseconds = -1; + + Match match = regexTimestamp.Match(input); + if (match.Success) { + hours = !string.IsNullOrEmpty(match.Groups[3].Value) ? int.Parse(match.Groups[3].Value) : 0; // Hours are sometimes not included in timestamps. + minutes = int.Parse(match.Groups[4].Value); + seconds = int.Parse(match.Groups[5].Value); + milliseconds = int.Parse(match.Groups[6].Value); + + TimeSpan result = new TimeSpan(0, hours, minutes, seconds, milliseconds); + return (long)result.TotalMilliseconds * (match.Groups[1].Value == "-" ? -1 : 1); + } + + return -1; + } + internal STLYRIC CreateLyric(List datalist, int order) { + long timestamp = datalist[0].timestamp; // Function will change later w/ timestamp tag implementation + + List> textures = new List>(); + List> rubywidthoffset = new List>(); // Save for when text is combined, in case ruby text is longer than original text + List rubyheightoffset = new List(); + int linecount = datalist.Max((data => data.line)) + 1; + + for (int i = 0; i < linecount; i++) { + textures.Add(new List()); + rubywidthoffset.Add(new List()); + rubyheightoffset.Add(0); + } + + string text = String.Empty; + + foreach (LyricData data in datalist) { + using (CCachedFontRenderer fastdraw = HPrivateFastFont.tInstantiateFont(OpenTaiko.Skin.Game_Lyric_FontName, OpenTaiko.Skin.Game_Lyric_FontSize, data.Style)) { + SKBitmap textdrawing = fastdraw.DrawText(data.Text, data.ForeColor, data.BackColor, null, 30); // Draw main text + + if (data.IsRuby) // ruby time + { + using (CCachedFontRenderer rubydraw = HPrivateFastFont.tInstantiateFont(OpenTaiko.Skin.Game_Lyric_FontName, OpenTaiko.Skin.Game_Lyric_FontSize / 2, data.Style)) { + SKBitmap ruby = rubydraw.DrawText(data.RubyText, data.ForeColor, data.BackColor, null, 30); + Size size = new Size(textdrawing.Width > ruby.Width ? textdrawing.Width : ruby.Width, textdrawing.Height + (OpenTaiko.Skin.Game_Lyric_VTTRubyOffset + (ruby.Height / 2))); + SKBitmap fullruby = new SKBitmap(size.Width, size.Height); + + + using (SKCanvas canvas = new SKCanvas(fullruby)) { + canvas.DrawBitmap(textdrawing, (fullruby.Width / 2) - (textdrawing.Width / 2), (fullruby.Height / 2) - (textdrawing.Height / 2)); + canvas.DrawBitmap(ruby, (fullruby.Width - ruby.Width) / 2, (fullruby.Height / 2) - (ruby.Height / 2) - OpenTaiko.Skin.Game_Lyric_VTTRubyOffset); + } + textures[data.line].Add(fullruby); + rubywidthoffset[data.line].Add((fullruby.Width - textdrawing.Width) / 2 > 0 ? (fullruby.Width - textdrawing.Width) / 2 : 0); + rubyheightoffset[data.line] = (fullruby.Height - (fullruby.Height - ruby.Height)) / 2 > rubyheightoffset[data.line] ? (fullruby.Height - (fullruby.Height - ruby.Height)) / 2 : rubyheightoffset[data.line]; + } + } else { + textures[data.line].Add(textdrawing); + rubywidthoffset[data.line].Add(0); + } + } + text += data.IsRuby ? data.Text + "(" + data.RubyText + ")" : data.Text; + } + + int[] width = new int[textures.Count]; + int[] height = new int[textures.Count]; + int[][] widths = new int[textures.Count][]; + int[][] heights = new int[textures.Count][]; + int max_width = 0; + int max_height = 0; + + int space = 50; + for (int i = 0; i < textures.Count; i++) { + widths[i] = new int[textures[i].Count]; + heights[i] = new int[textures[i].Count]; + for (int j = 0; j < textures[i].Count; j++) { + int nowWidth = Math.Max(textures[i][j].Width - space, 0); + int nowHeight = textures[i][j].Height; + + widths[i][j] += nowWidth; + heights[i][j] += nowHeight; + width[i] += nowWidth; + height[i] = nowHeight > height[i] ? nowHeight : height[i]; + } + width[i] += space; + max_width = (width[i] > max_width ? width[i] : max_width); + max_height += height[i]; + } + + SKBitmap lyrictex = new SKBitmap(max_width > 0 ? max_width : 1, max_height - rubyheightoffset.Sum() > 0 ? max_height - rubyheightoffset.Sum() : 1); // Prevent exception with 0x0y Bitmap + + if (textures.Count > 0) { + using (SKCanvas canvas = new SKCanvas(lyrictex)) { + canvas.Clear(); + + int y = 0; + for (int i = 0; i < textures.Count; i++) { + int x = (lyrictex.Width - width[i]) / 2; + for (int j = 0; j < textures[i].Count; j++) { + canvas.DrawBitmap(textures[i][j], x, y + ((height[i] - textures[i][j].Height) / 2) + (rubyheightoffset[i] / 2)); + x += widths[i][j]; + } + y += height[i] - rubyheightoffset[i]; + } + } + } + + STLYRIC st = new STLYRIC() { + index = order, + Text = text, + TextTex = lyrictex, + Time = timestamp + }; + return st; + } } diff --git a/OpenTaiko/src/Stages/01.StartUp/CCharacter.cs b/OpenTaiko/src/Stages/01.StartUp/CCharacter.cs index 84dc367e..54bd7399 100644 --- a/OpenTaiko/src/Stages/01.StartUp/CCharacter.cs +++ b/OpenTaiko/src/Stages/01.StartUp/CCharacter.cs @@ -1,71 +1,71 @@ -namespace OpenTaiko { - class CCharacter { - public DBCharacter.CharacterData metadata; - public DBCharacter.CharacterEffect effect; - public DBUnlockables.CUnlockConditions unlock; - public string _path; - public int _idx; +namespace OpenTaiko; - public float GetEffectCoinMultiplier() { - float mult = 1f; +class CCharacter { + public DBCharacter.CharacterData metadata; + public DBCharacter.CharacterEffect effect; + public DBUnlockables.CUnlockConditions unlock; + public string _path; + public int _idx; - mult *= HRarity.tRarityToRarityToCoinMultiplier(metadata.Rarity); - mult *= effect.GetCoinMultiplier(); + public float GetEffectCoinMultiplier() { + float mult = 1f; - return mult; - } + mult *= HRarity.tRarityToRarityToCoinMultiplier(metadata.Rarity); + mult *= effect.GetCoinMultiplier(); - public void tGetUnlockedItems(int _player, ModalQueue mq) { - int player = OpenTaiko.GetActualPlayer(_player); - var _sf = OpenTaiko.SaveFileInstances[player].data.UnlockedCharacters; - bool _edited = false; + return mult; + } - var _npvKey = Path.GetFileName(_path); + public void tGetUnlockedItems(int _player, ModalQueue mq) { + int player = OpenTaiko.GetActualPlayer(_player); + var _sf = OpenTaiko.SaveFileInstances[player].data.UnlockedCharacters; + bool _edited = false; - if (!_sf.Contains(_npvKey)) { - var _fulfilled = unlock?.tConditionMetWrapper(player, DBUnlockables.CUnlockConditions.EScreen.Internal).Item1 ?? false; + var _npvKey = Path.GetFileName(_path); - if (_fulfilled) { - _sf.Add(_npvKey); - _edited = true; - mq.tAddModal( - new Modal( - Modal.EModalType.Character, - HRarity.tRarityToModalInt(metadata.Rarity), - this, - OpenTaiko.Tx.Characters_Heya_Render[_idx] - ), - _player); + if (!_sf.Contains(_npvKey)) { + var _fulfilled = unlock?.tConditionMetWrapper(player, DBUnlockables.CUnlockConditions.EScreen.Internal).Item1 ?? false; - DBSaves.RegisterStringUnlockedAsset(OpenTaiko.SaveFileInstances[player].data.SaveId, "unlocked_characters", _npvKey); - } + if (_fulfilled) { + _sf.Add(_npvKey); + _edited = true; + mq.tAddModal( + new Modal( + Modal.EModalType.Character, + HRarity.tRarityToModalInt(metadata.Rarity), + this, + OpenTaiko.Tx.Characters_Heya_Render[_idx] + ), + _player); + + DBSaves.RegisterStringUnlockedAsset(OpenTaiko.SaveFileInstances[player].data.SaveId, "unlocked_characters", _npvKey); } - - if (_edited) - OpenTaiko.SaveFileInstances[player].tApplyHeyaChanges(); } - public CCharacter(string path, int i) { - _path = path; - _idx = i; + if (_edited) + OpenTaiko.SaveFileInstances[player].tApplyHeyaChanges(); + } - // Character metadata - if (File.Exists($@"{path}{Path.DirectorySeparatorChar}Metadata.json")) - metadata = ConfigManager.GetConfig($@"{path}{Path.DirectorySeparatorChar}Metadata.json"); - else - metadata = new DBCharacter.CharacterData(); + public CCharacter(string path, int i) { + _path = path; + _idx = i; - // Character metadata - if (File.Exists($@"{path}{Path.DirectorySeparatorChar}Effects.json")) - effect = ConfigManager.GetConfig($@"{path}{Path.DirectorySeparatorChar}Effects.json"); - else - effect = new DBCharacter.CharacterEffect(); + // Character metadata + if (File.Exists($@"{path}{Path.DirectorySeparatorChar}Metadata.json")) + metadata = ConfigManager.GetConfig($@"{path}{Path.DirectorySeparatorChar}Metadata.json"); + else + metadata = new DBCharacter.CharacterData(); - // Character unlockables - if (File.Exists($@"{path}{Path.DirectorySeparatorChar}Unlock.json")) - unlock = ConfigManager.GetConfig($@"{path}{Path.DirectorySeparatorChar}Unlock.json"); - else - unlock = null; - } + // Character metadata + if (File.Exists($@"{path}{Path.DirectorySeparatorChar}Effects.json")) + effect = ConfigManager.GetConfig($@"{path}{Path.DirectorySeparatorChar}Effects.json"); + else + effect = new DBCharacter.CharacterEffect(); + + // Character unlockables + if (File.Exists($@"{path}{Path.DirectorySeparatorChar}Unlock.json")) + unlock = ConfigManager.GetConfig($@"{path}{Path.DirectorySeparatorChar}Unlock.json"); + else + unlock = null; } } diff --git a/OpenTaiko/src/Stages/01.StartUp/CPuchichara.cs b/OpenTaiko/src/Stages/01.StartUp/CPuchichara.cs index ebbe2a29..654dc5cd 100644 --- a/OpenTaiko/src/Stages/01.StartUp/CPuchichara.cs +++ b/OpenTaiko/src/Stages/01.StartUp/CPuchichara.cs @@ -2,86 +2,86 @@ using Silk.NET.Maths; -namespace OpenTaiko { - class CPuchichara { - public CTexture tx; - public CTexture render; - public CSkin.CSystemSound welcome; - public DBPuchichara.PuchicharaData metadata; - public DBPuchichara.PuchicharaEffect effect; - public DBUnlockables.CUnlockConditions unlock; - public string _path; +namespace OpenTaiko; - public float GetEffectCoinMultiplier() { - float mult = 1f; +class CPuchichara { + public CTexture tx; + public CTexture render; + public CSkin.CSystemSound welcome; + public DBPuchichara.PuchicharaData metadata; + public DBPuchichara.PuchicharaEffect effect; + public DBUnlockables.CUnlockConditions unlock; + public string _path; - mult *= HRarity.tRarityToRarityToCoinMultiplier(metadata.Rarity); - mult *= effect.GetCoinMultiplier(); + public float GetEffectCoinMultiplier() { + float mult = 1f; - return mult; - } + mult *= HRarity.tRarityToRarityToCoinMultiplier(metadata.Rarity); + mult *= effect.GetCoinMultiplier(); - public void tGetUnlockedItems(int _player, ModalQueue mq) { - int player = OpenTaiko.GetActualPlayer(_player); - var _sf = OpenTaiko.SaveFileInstances[player].data.UnlockedPuchicharas; - bool _edited = false; + return mult; + } - var _npvKey = Path.GetFileName(_path); + public void tGetUnlockedItems(int _player, ModalQueue mq) { + int player = OpenTaiko.GetActualPlayer(_player); + var _sf = OpenTaiko.SaveFileInstances[player].data.UnlockedPuchicharas; + bool _edited = false; - if (!_sf.Contains(_npvKey)) { - var _fulfilled = unlock?.tConditionMetWrapper(player, DBUnlockables.CUnlockConditions.EScreen.Internal).Item1 ?? false; + var _npvKey = Path.GetFileName(_path); - if (_fulfilled) { - _sf.Add(_npvKey); - _edited = true; - mq.tAddModal( - new Modal( - Modal.EModalType.Puchichara, - HRarity.tRarityToModalInt(metadata.Rarity), - this - ), - _player); + if (!_sf.Contains(_npvKey)) { + var _fulfilled = unlock?.tConditionMetWrapper(player, DBUnlockables.CUnlockConditions.EScreen.Internal).Item1 ?? false; - DBSaves.RegisterStringUnlockedAsset(OpenTaiko.SaveFileInstances[player].data.SaveId, "unlocked_puchicharas", _npvKey); - } + if (_fulfilled) { + _sf.Add(_npvKey); + _edited = true; + mq.tAddModal( + new Modal( + Modal.EModalType.Puchichara, + HRarity.tRarityToModalInt(metadata.Rarity), + this + ), + _player); + + DBSaves.RegisterStringUnlockedAsset(OpenTaiko.SaveFileInstances[player].data.SaveId, "unlocked_puchicharas", _npvKey); } - - if (_edited) - OpenTaiko.SaveFileInstances[player].tApplyHeyaChanges(); } - public CPuchichara(string path) { - _path = path; + if (_edited) + OpenTaiko.SaveFileInstances[player].tApplyHeyaChanges(); + } - // Puchichara textures - tx = OpenTaiko.Tx.TxCAbsolute($@"{path}{Path.DirectorySeparatorChar}Chara.png"); - if (tx != null) { - tx.vcScaleRatio = new Vector3D(OpenTaiko.Skin.Game_PuchiChara_Scale[0]); - } + public CPuchichara(string path) { + _path = path; - // Heya render - render = OpenTaiko.Tx.TxCAbsolute($@"{path}{Path.DirectorySeparatorChar}Render.png"); - - // Puchichara welcome sfx - welcome = new CSkin.CSystemSound($@"{path}{Path.DirectorySeparatorChar}Welcome.ogg", false, false, true, ESoundGroup.Voice); - - // Puchichara metadata - if (File.Exists($@"{path}{Path.DirectorySeparatorChar}Metadata.json")) - metadata = ConfigManager.GetConfig($@"{path}{Path.DirectorySeparatorChar}Metadata.json"); - else - metadata = new DBPuchichara.PuchicharaData(); - - // Puchichara metadata - if (File.Exists($@"{path}{Path.DirectorySeparatorChar}Effects.json")) - effect = ConfigManager.GetConfig($@"{path}{Path.DirectorySeparatorChar}Effects.json"); - else - effect = new DBPuchichara.PuchicharaEffect(); - - // Puchichara unlockables - if (File.Exists($@"{path}{Path.DirectorySeparatorChar}Unlock.json")) - unlock = ConfigManager.GetConfig($@"{path}{Path.DirectorySeparatorChar}Unlock.json"); - else - unlock = null; + // Puchichara textures + tx = OpenTaiko.Tx.TxCAbsolute($@"{path}{Path.DirectorySeparatorChar}Chara.png"); + if (tx != null) { + tx.vcScaleRatio = new Vector3D(OpenTaiko.Skin.Game_PuchiChara_Scale[0]); } + + // Heya render + render = OpenTaiko.Tx.TxCAbsolute($@"{path}{Path.DirectorySeparatorChar}Render.png"); + + // Puchichara welcome sfx + welcome = new CSkin.CSystemSound($@"{path}{Path.DirectorySeparatorChar}Welcome.ogg", false, false, true, ESoundGroup.Voice); + + // Puchichara metadata + if (File.Exists($@"{path}{Path.DirectorySeparatorChar}Metadata.json")) + metadata = ConfigManager.GetConfig($@"{path}{Path.DirectorySeparatorChar}Metadata.json"); + else + metadata = new DBPuchichara.PuchicharaData(); + + // Puchichara metadata + if (File.Exists($@"{path}{Path.DirectorySeparatorChar}Effects.json")) + effect = ConfigManager.GetConfig($@"{path}{Path.DirectorySeparatorChar}Effects.json"); + else + effect = new DBPuchichara.PuchicharaEffect(); + + // Puchichara unlockables + if (File.Exists($@"{path}{Path.DirectorySeparatorChar}Unlock.json")) + unlock = ConfigManager.GetConfig($@"{path}{Path.DirectorySeparatorChar}Unlock.json"); + else + unlock = null; } } diff --git a/OpenTaiko/src/Stages/01.StartUp/CStage起動.cs b/OpenTaiko/src/Stages/01.StartUp/CStage起動.cs index 2539a878..7ff1237f 100644 --- a/OpenTaiko/src/Stages/01.StartUp/CStage起動.cs +++ b/OpenTaiko/src/Stages/01.StartUp/CStage起動.cs @@ -1,255 +1,256 @@ using System.Diagnostics; using FDK; -namespace OpenTaiko { - internal class CStage起動 : CStage { - // Constructor +namespace OpenTaiko; - public CStage起動() { - base.eStageID = CStage.EStage.StartUp; - base.IsDeActivated = true; - } +internal class CStage起動 : CStage { + // Constructor - public List list進行文字列; + public CStage起動() { + base.eStageID = CStage.EStage.StartUp; + base.IsDeActivated = true; + } - // CStage 実装 + public List list進行文字列; - public override void Activate() { - Trace.TraceInformation("起動ステージを活性化します。"); - Trace.Indent(); - try { - Background = new ScriptBG(CSkin.Path($"{TextureLoader.BASE}{TextureLoader.STARTUP}Script.lua")); - Background.Init(); + // CStage 実装 - if (OpenTaiko.ConfigIsNew) { - langSelectFont = HPrivateFastFont.tInstantiateMainFont(OpenTaiko.Skin.StartUp_LangSelect_FontSize); - langSelectTitle = OpenTaiko.tテクスチャの生成(langSelectFont.DrawText("Select Language:", System.Drawing.Color.White)); - langList = new CTexture[CLangManager.Languages.Length]; - langListHighlighted = new CTexture[CLangManager.Languages.Length]; + public override void Activate() { + Trace.TraceInformation("起動ステージを活性化します。"); + Trace.Indent(); + try { + Background = new ScriptBG(CSkin.Path($"{TextureLoader.BASE}{TextureLoader.STARTUP}Script.lua")); + Background.Init(); - for (int i = 0; i < langList.Length; i++) { - langList[i] = OpenTaiko.tテクスチャの生成(langSelectFont.DrawText(CLangManager.Languages[i], System.Drawing.Color.White)); - langListHighlighted[i] = OpenTaiko.tテクスチャの生成(langSelectFont.DrawText(CLangManager.Languages[i], System.Drawing.Color.Red)); - } - langSelectOffset = new int[2] { SampleFramework.GameWindowSize.Width / 2, (SampleFramework.GameWindowSize.Height - langList.Select(tex => tex.szTextureSize.Height).Sum() - langSelectTitle.szTextureSize.Height) / 2 }; + if (OpenTaiko.ConfigIsNew) { + langSelectFont = HPrivateFastFont.tInstantiateMainFont(OpenTaiko.Skin.StartUp_LangSelect_FontSize); + langSelectTitle = OpenTaiko.tテクスチャの生成(langSelectFont.DrawText("Select Language:", System.Drawing.Color.White)); + langList = new CTexture[CLangManager.Languages.Length]; + langListHighlighted = new CTexture[CLangManager.Languages.Length]; + + for (int i = 0; i < langList.Length; i++) { + langList[i] = OpenTaiko.tテクスチャの生成(langSelectFont.DrawText(CLangManager.Languages[i], System.Drawing.Color.White)); + langListHighlighted[i] = OpenTaiko.tテクスチャの生成(langSelectFont.DrawText(CLangManager.Languages[i], System.Drawing.Color.Red)); } - - this.list進行文字列 = new List(); - base.ePhaseID = CStage.EPhase.Common_NORMAL; - base.Activate(); - Trace.TraceInformation("起動ステージの活性化を完了しました。"); - } finally { - Trace.Unindent(); + langSelectOffset = new int[2] { SampleFramework.GameWindowSize.Width / 2, (SampleFramework.GameWindowSize.Height - langList.Select(tex => tex.szTextureSize.Height).Sum() - langSelectTitle.szTextureSize.Height) / 2 }; } + + this.list進行文字列 = new List(); + base.ePhaseID = CStage.EPhase.Common_NORMAL; + base.Activate(); + Trace.TraceInformation("起動ステージの活性化を完了しました。"); + } finally { + Trace.Unindent(); } - public override void DeActivate() { - Trace.TraceInformation("起動ステージを非活性化します。"); - Trace.Indent(); - try { - OpenTaiko.tDisposeSafely(ref Background); + } + public override void DeActivate() { + Trace.TraceInformation("起動ステージを非活性化します。"); + Trace.Indent(); + try { + OpenTaiko.tDisposeSafely(ref Background); - OpenTaiko.tDisposeSafely(ref langSelectFont); - OpenTaiko.tDisposeSafely(ref langSelectTitle); - if (langList != null) { - for (int i = 0; i < langList.Length; i++) { - OpenTaiko.tDisposeSafely(ref langList[i]); - OpenTaiko.tDisposeSafely(ref langListHighlighted[i]); - } + OpenTaiko.tDisposeSafely(ref langSelectFont); + OpenTaiko.tDisposeSafely(ref langSelectTitle); + if (langList != null) { + for (int i = 0; i < langList.Length; i++) { + OpenTaiko.tDisposeSafely(ref langList[i]); + OpenTaiko.tDisposeSafely(ref langListHighlighted[i]); } - - this.list進行文字列 = null; - if (es != null) { - if ((es.thDTXFileEnumerate != null) && es.thDTXFileEnumerate.IsAlive) { - Trace.TraceWarning("リスト構築スレッドを強制停止します。"); - es.thDTXFileEnumerate.Abort(); - es.thDTXFileEnumerate.Join(); - } - } - base.DeActivate(); - Trace.TraceInformation("起動ステージの非活性化を完了しました。"); - } finally { - Trace.Unindent(); } - } - public override void CreateManagedResource() { - base.CreateManagedResource(); - } - public override void ReleaseManagedResource() { - base.ReleaseManagedResource(); - } - public override int Draw() { - if (!base.IsDeActivated) { - if (base.IsFirstDraw) { - this.list進行文字列.Add("DTXManiaXG Ver.K powered by YAMAHA Silent Session Drums\n"); - this.list進行文字列.Add("Product by.kairera0467\n"); - this.list進行文字列.Add("Release: " + OpenTaiko.VERSION + " [" + System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString() + "]"); - this.list進行文字列.Add(""); - this.list進行文字列.Add("TJAPlayer3-Develop-ReWrite forked TJAPlayer3(@aioilight)"); - this.list進行文字列.Add("OpenTaiko forked TJAPlayer3-Develop-ReWrite(@TouhouRenren)"); - this.list進行文字列.Add("OpenTaiko edited by 0AuBSQ"); - this.list進行文字列.Add(""); - - es = new CEnumSongs(); - es.StartEnumFromCache(); // 曲リスト取得(別スレッドで実行される) - base.IsFirstDraw = false; - return 0; + this.list進行文字列 = null; + if (es != null) { + if ((es.thDTXFileEnumerate != null) && es.thDTXFileEnumerate.IsAlive) { + Trace.TraceWarning("リスト構築スレッドを強制停止します。"); + es.thDTXFileEnumerate.Abort(); + es.thDTXFileEnumerate.Join(); } + } + base.DeActivate(); + Trace.TraceInformation("起動ステージの非活性化を完了しました。"); + } finally { + Trace.Unindent(); + } + } + public override void CreateManagedResource() { + base.CreateManagedResource(); + } + public override void ReleaseManagedResource() { + base.ReleaseManagedResource(); + } + public override int Draw() { + if (!base.IsDeActivated) { + if (base.IsFirstDraw) { + this.list進行文字列.Add("DTXManiaXG Ver.K powered by YAMAHA Silent Session Drums\n"); + this.list進行文字列.Add("Product by.kairera0467\n"); + this.list進行文字列.Add("Release: " + OpenTaiko.VERSION + " [" + System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString() + "]"); - // CSongs管理 s管理 = CDTXMania.Songs管理; + this.list進行文字列.Add(""); + this.list進行文字列.Add("TJAPlayer3-Develop-ReWrite forked TJAPlayer3(@aioilight)"); + this.list進行文字列.Add("OpenTaiko forked TJAPlayer3-Develop-ReWrite(@TouhouRenren)"); + this.list進行文字列.Add("OpenTaiko edited by 0AuBSQ"); + this.list進行文字列.Add(""); - Background.Update(); - Background.Draw(); + es = new CEnumSongs(); + es.StartEnumFromCache(); // 曲リスト取得(別スレッドで実行される) + base.IsFirstDraw = false; + return 0; + } - #region [ this.str現在進行中 の決定 ] - //----------------- - switch (base.ePhaseID) { - case CStage.EPhase.Startup_0_CreateSystemSound: - this.str現在進行中 = "SYSTEM SOUND..."; - break; + // CSongs管理 s管理 = CDTXMania.Songs管理; - case CStage.EPhase.Startup_1_InitializeSonglist: - this.str現在進行中 = "SONG LIST..."; - break; + Background.Update(); + Background.Draw(); - case CStage.EPhase.Startup_2_EnumerateSongs: - this.str現在進行中 = string.Format("{0} ... {1}", "Enumerating songs", es.Songs管理.n検索されたスコア数); - break; + #region [ this.str現在進行中 の決定 ] + //----------------- + switch (base.ePhaseID) { + case CStage.EPhase.Startup_0_CreateSystemSound: + this.str現在進行中 = "SYSTEM SOUND..."; + break; - case CStage.EPhase.Startup_3_ApplyScoreCache: - this.str現在進行中 = string.Format("{0} ... {1}/{2}", "Loading score properties from songs.db", es.Songs管理.nスコアキャッシュから反映できたスコア数, es.Songs管理.n検索されたスコア数); - break; + case CStage.EPhase.Startup_1_InitializeSonglist: + this.str現在進行中 = "SONG LIST..."; + break; - case CStage.EPhase.Startup_4_LoadSongsNotSeenInScoreCacheAndApplyThem: - this.str現在進行中 = string.Format("{0} ... {1}/{2}", "Loading score properties from files", es.Songs管理.nファイルから反映できたスコア数, es.Songs管理.n検索されたスコア数 - es.Songs管理.nスコアキャッシュから反映できたスコア数); - break; + case CStage.EPhase.Startup_2_EnumerateSongs: + this.str現在進行中 = string.Format("{0} ... {1}", "Enumerating songs", es.Songs管理.n検索されたスコア数); + break; - case CStage.EPhase.Startup_5_PostProcessSonglist: - this.str現在進行中 = string.Format("{0} ... ", "Building songlists"); - break; + case CStage.EPhase.Startup_3_ApplyScoreCache: + this.str現在進行中 = string.Format("{0} ... {1}/{2}", "Loading score properties from songs.db", es.Songs管理.nスコアキャッシュから反映できたスコア数, es.Songs管理.n検索されたスコア数); + break; - case CStage.EPhase.Startup_6_LoadTextures: - if (!bIsLoadingTextures) { - void loadTexture() { - this.list進行文字列.Add("LOADING TEXTURES..."); + case CStage.EPhase.Startup_4_LoadSongsNotSeenInScoreCacheAndApplyThem: + this.str現在進行中 = string.Format("{0} ... {1}/{2}", "Loading score properties from files", es.Songs管理.nファイルから反映できたスコア数, es.Songs管理.n検索されたスコア数 - es.Songs管理.nスコアキャッシュから反映できたスコア数); + break; - try { - OpenTaiko.Tx.LoadTexture(); + case CStage.EPhase.Startup_5_PostProcessSonglist: + this.str現在進行中 = string.Format("{0} ... ", "Building songlists"); + break; - this.list進行文字列.Add("LOADING TEXTURES...OK"); - this.str現在進行中 = "Setup done."; - this.ePhaseID = EPhase.Startup_Complete; - OpenTaiko.Skin.bgm起動画面.tStop(); - } catch (Exception exception) { - OpenTaiko.Skin.bgm起動画面.tStop(); + case CStage.EPhase.Startup_6_LoadTextures: + if (!bIsLoadingTextures) { + void loadTexture() { + this.list進行文字列.Add("LOADING TEXTURES..."); - Trace.TraceError(exception.ToString()); - this.list進行文字列.Add("LOADING TEXTURES...NG"); - foreach (var text in exception.ToString().Split('\n')) { - this.list進行文字列.Add(text); - } - } + try { + OpenTaiko.Tx.LoadTexture(); this.list進行文字列.Add("LOADING TEXTURES...OK"); this.str現在進行中 = "Setup done."; this.ePhaseID = EPhase.Startup_Complete; OpenTaiko.Skin.bgm起動画面.tStop(); + } catch (Exception exception) { + OpenTaiko.Skin.bgm起動画面.tStop(); + + Trace.TraceError(exception.ToString()); + this.list進行文字列.Add("LOADING TEXTURES...NG"); + foreach (var text in exception.ToString().Split('\n')) { + this.list進行文字列.Add(text); + } } - if (OpenTaiko.ConfigIni.ASyncTextureLoad) { - Task.Run(loadTexture); - } else { - loadTexture(); - } + + this.list進行文字列.Add("LOADING TEXTURES...OK"); + this.str現在進行中 = "Setup done."; + this.ePhaseID = EPhase.Startup_Complete; + OpenTaiko.Skin.bgm起動画面.tStop(); } - bIsLoadingTextures = true; - break; + if (OpenTaiko.ConfigIni.ASyncTextureLoad) { + Task.Run(loadTexture); + } else { + loadTexture(); + } + } + bIsLoadingTextures = true; + break; + } + //----------------- + #endregion + + if (ePhaseID != EPhase.Startup_Complete) { + #region [ this.list進行文字列+this.現在進行中 の表示 ] + //----------------- + int x = 320; + int y = 20; + for (int i = 0; i < this.list進行文字列.Count; i++) { + OpenTaiko.actTextConsole.Print((int)(x * OpenTaiko.Skin.Resolution[0] / 1280.0), (int)(y * OpenTaiko.Skin.Resolution[1] / 720.0), CTextConsole.EFontType.White, this.list進行文字列[i]); + y += 24; } //----------------- #endregion - - if (ePhaseID != EPhase.Startup_Complete) { - #region [ this.list進行文字列+this.現在進行中 の表示 ] - //----------------- - int x = 320; - int y = 20; - for (int i = 0; i < this.list進行文字列.Count; i++) { - OpenTaiko.actTextConsole.Print((int)(x * OpenTaiko.Skin.Resolution[0] / 1280.0), (int)(y * OpenTaiko.Skin.Resolution[1] / 720.0), CTextConsole.EFontType.White, this.list進行文字列[i]); - y += 24; - } - //----------------- - #endregion - } else if (OpenTaiko.ConfigIsNew && !bLanguageSelected) // Prompt language selection if Config.ini is newly generated - { - if (OpenTaiko.Tx.Tile_Black != null) { - OpenTaiko.Tx.Tile_Black.Opacity = 255; - for (int i = 0; i <= SampleFramework.GameWindowSize.Width; i += OpenTaiko.Tx.Tile_Black.szTextureSize.Width) { - for (int j = 0; j <= SampleFramework.GameWindowSize.Height; j += OpenTaiko.Tx.Tile_Black.szTextureSize.Height) { - OpenTaiko.Tx.Tile_Black.t2D描画(i, j); - } + } else if (OpenTaiko.ConfigIsNew && !bLanguageSelected) // Prompt language selection if Config.ini is newly generated + { + if (OpenTaiko.Tx.Tile_Black != null) { + OpenTaiko.Tx.Tile_Black.Opacity = 255; + for (int i = 0; i <= SampleFramework.GameWindowSize.Width; i += OpenTaiko.Tx.Tile_Black.szTextureSize.Width) { + for (int j = 0; j <= SampleFramework.GameWindowSize.Height; j += OpenTaiko.Tx.Tile_Black.szTextureSize.Height) { + OpenTaiko.Tx.Tile_Black.t2D描画(i, j); } } - - int x = langSelectOffset[0]; - int y = langSelectOffset[1]; - - langSelectTitle.t2D中心基準描画(x, y); - y += langSelectTitle.szTextureSize.Height; - - for (int i = 0; i < langList.Length; i++) { - if (i == langSelectIndex) - langListHighlighted[i].t2D中心基準描画(x, y); - else - langList[i].t2D中心基準描画(x, y); - - y += langList[i].szTextureSize.Height; - } - - if (OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.DownArrow) || OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.RightArrow)) { - langSelectIndex = Math.Min(langSelectIndex + 1, CLangManager.Languages.Length - 1); - } else if (OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.UpArrow) || OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.LeftArrow)) { - langSelectIndex = Math.Max(langSelectIndex - 1, 0); - } else if (OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Return)) { - OpenTaiko.Skin.soundDecideSFX.tPlay(); - OpenTaiko.ConfigIni.sLang = CLangManager.intToLang(langSelectIndex); - CLangManager.langAttach(OpenTaiko.ConfigIni.sLang); - bLanguageSelected = true; - } - } else { - if (es != null && es.IsSongListEnumCompletelyDone) // 曲リスト作成が終わったら - { - OpenTaiko.Songs管理 = (es != null) ? es.Songs管理 : null; // 最後に、曲リストを拾い上げる - - if (OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Return)) { - OpenTaiko.Skin.soundDecideSFX.tPlay(); - return 1; - } - } - - OpenTaiko.Tx.Readme.t2D描画(0, 0); } + int x = langSelectOffset[0]; + int y = langSelectOffset[1]; + + langSelectTitle.t2D中心基準描画(x, y); + y += langSelectTitle.szTextureSize.Height; + + for (int i = 0; i < langList.Length; i++) { + if (i == langSelectIndex) + langListHighlighted[i].t2D中心基準描画(x, y); + else + langList[i].t2D中心基準描画(x, y); + + y += langList[i].szTextureSize.Height; + } + + if (OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.DownArrow) || OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.RightArrow)) { + langSelectIndex = Math.Min(langSelectIndex + 1, CLangManager.Languages.Length - 1); + } else if (OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.UpArrow) || OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.LeftArrow)) { + langSelectIndex = Math.Max(langSelectIndex - 1, 0); + } else if (OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Return)) { + OpenTaiko.Skin.soundDecideSFX.tPlay(); + OpenTaiko.ConfigIni.sLang = CLangManager.intToLang(langSelectIndex); + CLangManager.langAttach(OpenTaiko.ConfigIni.sLang); + bLanguageSelected = true; + } + } else { + if (es != null && es.IsSongListEnumCompletelyDone) // 曲リスト作成が終わったら + { + OpenTaiko.Songs管理 = (es != null) ? es.Songs管理 : null; // 最後に、曲リストを拾い上げる + + if (OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Return)) { + OpenTaiko.Skin.soundDecideSFX.tPlay(); + return 1; + } + } + + OpenTaiko.Tx.Readme.t2D描画(0, 0); } - return 0; + } + return 0; + } - // その他 + // その他 - #region [ private ] - //----------------- - private string str現在進行中 = ""; - private ScriptBG Background; - private CEnumSongs es; - private bool bIsLoadingTextures; + #region [ private ] + //----------------- + private string str現在進行中 = ""; + private ScriptBG Background; + private CEnumSongs es; + private bool bIsLoadingTextures; - private bool bLanguageSelected; - private int langSelectIndex = 0; + private bool bLanguageSelected; + private int langSelectIndex = 0; - private CFontRenderer langSelectFont; - private CTexture langSelectTitle; - private CTexture[] langList; - private CTexture[] langListHighlighted; - private int[] langSelectOffset; + private CFontRenderer langSelectFont; + private CTexture langSelectTitle; + private CTexture[] langList; + private CTexture[] langListHighlighted; + private int[] langSelectOffset; #if false private void t曲リストの構築() @@ -411,6 +412,5 @@ namespace OpenTaiko { } } #endif - #endregion - } + #endregion } diff --git a/OpenTaiko/src/Stages/01.StartUp/TextureLoader.cs b/OpenTaiko/src/Stages/01.StartUp/TextureLoader.cs index 17c6d2fc..18137e3d 100644 --- a/OpenTaiko/src/Stages/01.StartUp/TextureLoader.cs +++ b/OpenTaiko/src/Stages/01.StartUp/TextureLoader.cs @@ -1,2848 +1,2848 @@ using System.Diagnostics; using FDK; -namespace OpenTaiko { - class TextureLoader { - public static string BASE = @$"Graphics{Path.DirectorySeparatorChar}"; - public static string GLOBAL = @$"Global{Path.DirectorySeparatorChar}"; - - // Global assets - public static string PUCHICHARA = @$"PuchiChara{Path.DirectorySeparatorChar}"; - public static string CHARACTERS = @$"Characters{Path.DirectorySeparatorChar}"; - - // Stage - public static string STARTUP = @$"0_Startup{Path.DirectorySeparatorChar}"; - public static string TITLE = @$"1_Title{Path.DirectorySeparatorChar}"; - public static string CONFIG = @$"2_Config{Path.DirectorySeparatorChar}"; - public static string SONGSELECT = @$"3_SongSelect{Path.DirectorySeparatorChar}"; - public static string DANISELECT = @$"3_DaniSelect{Path.DirectorySeparatorChar}"; - public static string SONGLOADING = @$"4_SongLoading{Path.DirectorySeparatorChar}"; - public static string GAME = @$"5_Game{Path.DirectorySeparatorChar}"; - public static string RESULT = @$"6_Result{Path.DirectorySeparatorChar}"; - public static string EXIT = @$"7_Exit{Path.DirectorySeparatorChar}"; - public static string DANRESULT = @$"7_DanResult{Path.DirectorySeparatorChar}"; - public static string TOWERRESULT = @$"8_TowerResult{Path.DirectorySeparatorChar}"; - public static string HEYA = @$"10_Heya{Path.DirectorySeparatorChar}"; - - public static string MODALS = @$"11_Modals{Path.DirectorySeparatorChar}"; - public static string ONLINELOUNGE = @$"12_OnlineLounge{Path.DirectorySeparatorChar}"; - public static string TOWERSELECT = @$"13_TowerSelect{Path.DirectorySeparatorChar}"; - - // InGame - public static string DANCER = @$"2_Dancer{Path.DirectorySeparatorChar}"; - public static string MOB = @$"3_Mob{Path.DirectorySeparatorChar}"; - public static string COURSESYMBOL = @$"4_CourseSymbol{Path.DirectorySeparatorChar}"; - public static string BACKGROUND = @$"5_Background{Path.DirectorySeparatorChar}"; - public static string TAIKO = @$"6_Taiko{Path.DirectorySeparatorChar}"; - public static string GAUGE = @$"7_Gauge{Path.DirectorySeparatorChar}"; - public static string FOOTER = @$"8_Footer{Path.DirectorySeparatorChar}"; - public static string END = @$"9_End{Path.DirectorySeparatorChar}"; - public static string EFFECTS = @$"10_Effects{Path.DirectorySeparatorChar}"; - public static string BALLOON = @$"11_Balloon{Path.DirectorySeparatorChar}"; - public static string LANE = @$"12_Lane{Path.DirectorySeparatorChar}"; - public static string GENRE = @$"13_GENRE{Path.DirectorySeparatorChar}"; - public static string GAMEMODE = @$"14_GameMode{Path.DirectorySeparatorChar}"; - public static string FAILED = @$"15_Failed{Path.DirectorySeparatorChar}"; - public static string RUNNER = @$"16_Runner{Path.DirectorySeparatorChar}"; - public static string TRAINING = @$"19_Training{Path.DirectorySeparatorChar}"; - public static string DANC = @$"17_DanC{Path.DirectorySeparatorChar}"; - public static string TOWER = @$"20_Tower{Path.DirectorySeparatorChar}"; - public static string MODICONS = @$"21_ModIcons{Path.DirectorySeparatorChar}"; - public static string AIBATTLE = @$"22_AIBattle{Path.DirectorySeparatorChar}"; - - // Special balloons - public static string KUSUDAMA = @$"Kusudama{Path.DirectorySeparatorChar}"; - public static string FUSE = @$"Fuseroll{Path.DirectorySeparatorChar}"; - - // Tower infos - public static string TOWERDON = @$"Tower_Don{Path.DirectorySeparatorChar}"; - public static string TOWERFLOOR = @$"Tower_Floors{Path.DirectorySeparatorChar}"; - - // InGame_Effects - public static string FIRE = @$"Fire{Path.DirectorySeparatorChar}"; - public static string HIT = @$"Hit{Path.DirectorySeparatorChar}"; - public static string ROLL = @$"Roll{Path.DirectorySeparatorChar}"; - public static string SPLASH = @$"Splash{Path.DirectorySeparatorChar}"; - - public Dictionary trackedTextures = new Dictionary(); - - public TextureLoader() { - // Constructor - } - - internal CTexture TxC(string FileName, bool localize = true) { - var texpath = (localize) ? HLocalizedPath.GetAvailableLocalizedPath(CSkin.Path(BASE + FileName)) : CSkin.Path(BASE + FileName); - var tex = OpenTaiko.tテクスチャの生成(texpath, false); - - listTexture.Add(tex); - return tex; - } - - internal CTexture TxCGlobal(string FileName) { - var tex = OpenTaiko.tテクスチャの生成(OpenTaiko.strEXEのあるフォルダ + GLOBAL + FileName, false); - listTexture.Add(tex); - return tex; - } - - internal CTexture TxCAbsolute(string FileName) { - var tex = OpenTaiko.tテクスチャの生成(FileName, false); - listTexture.Add(tex); - return tex; - } - - internal CTextureAf TxCAf(string FileName) { - var tex = OpenTaiko.tテクスチャの生成Af(CSkin.Path(BASE + FileName)); - listTexture.Add(tex); - return tex; - } - internal CTexture TxCGen(string FileName) { - return OpenTaiko.tテクスチャの生成(CSkin.Path(BASE + GAME + GENRE + FileName + ".png"), false); - } - - internal CTexture TxCSong(string path) { - return TxCUntrackedSong(path); - } - - private CTexture[] TxCSong(int count, string format, int start = 0) { - return TxCSong(format, Enumerable.Range(start, count).Select(o => o.ToString()).ToArray()); - } - - private CTexture[] TxCSong(string format, params string[] parts) { - return parts.Select(o => TxCSong(string.Format(format, o))).ToArray(); - } - - public CTexture[] TxCSongFolder(string folder) { - var count = OpenTaiko.t連番画像の枚数を数える(folder); - var texture = count == 0 ? null : TxCSong(count, folder + "{0}.png"); - return texture; - } - - internal CTexture TxCUntrackedSong(string path) { - return OpenTaiko.tテクスチャの生成(path, false); - } - - public void LoadTexture() { - CalibrateFG = TxC(CONFIG + $@"Calibration{Path.DirectorySeparatorChar}FG.png"); - CalibrateBG = TxC(CONFIG + $@"Calibration{Path.DirectorySeparatorChar}BG.png"); - - #region 共通 - Tile_Black = TxC(@$"Tile_Black.png"); - Menu_Title = TxC(@$"Menu_Title.png"); - Menu_Highlight = TxC(@$"Menu_Highlight.png"); - Enum_Song = TxC(@$"Enum_Song.png"); - Loading = TxC(@$"Loading.png"); - Scanning_Loudness = TxC(@$"Scanning_Loudness.png"); - Overlay = TxC(@$"Overlay.png"); - Network_Connection = TxC(@$"Network_Connection.png"); - Readme = TxC(@$"Readme.png"); - NamePlateBase = TxC(@$"NamePlate.png"); - NamePlate_Extension = TxC(@$"NamePlate_Extension.png"); - - #endregion - - #region 1_タイトル画面 - //Title_Background = TxC(TITLE + @$"Background.png"); - Entry_Bar = TxC(TITLE + @$"Entry_Bar.png"); - Entry_Bar_Text = TxC(TITLE + @$"Entry_Bar_Text.png"); - - Banapas_Load[0] = TxC(TITLE + @$"Banapas_Load.png"); - Banapas_Load[1] = TxC(TITLE + @$"Banapas_Load_Text.png"); - Banapas_Load[2] = TxC(TITLE + @$"Banapas_Load_Anime.png"); - - Banapas_Load_Clear[0] = TxC(TITLE + @$"Banapas_Load_Clear.png"); - Banapas_Load_Clear[1] = TxC(TITLE + @$"Banapas_Load_Clear_Anime.png"); - - Banapas_Load_Failure[0] = TxC(TITLE + @$"Banapas_Load_Failure.png"); - Banapas_Load_Failure[1] = TxC(TITLE + @$"Banapas_Load_Clear_Anime.png"); - - Entry_Player[0] = TxC(TITLE + @$"Entry_Player.png"); - Entry_Player[1] = TxC(TITLE + @$"Entry_Player_Select_Bar.png"); - Entry_Player[2] = TxC(TITLE + @$"Entry_Player_Select.png"); - - ModeSelect_Bar = new CTexture[CMainMenuTab.__MenuCount + 1]; - ModeSelect_Bar_Chara = new CTexture[CMainMenuTab.__MenuCount]; - - for (int i = 0; i < CMainMenuTab.__MenuCount; i++) { - ModeSelect_Bar[i] = TxC(TITLE + @$"ModeSelect_Bar_" + i.ToString() + ".png"); - } - - for (int i = 0; i < CMainMenuTab.__MenuCount; i++) { - ModeSelect_Bar_Chara[i] = TxC(TITLE + @$"ModeSelect_Bar_Chara_" + i.ToString() + ".png"); - } - - ModeSelect_Bar[CMainMenuTab.__MenuCount] = TxC(TITLE + @$"ModeSelect_Bar_Overlay.png"); - - #endregion - - #region 2_コンフィグ画面 - //Config_Background = TxC(CONFIG + @$"Background.png"); - //Config_Header = TxC(CONFIG + @$"Header.png"); - Config_Cursor = TxC(CONFIG + @$"Cursor.png"); - Config_ItemBox = TxC(CONFIG + @$"ItemBox.png"); - Config_Arrow = TxC(CONFIG + @$"Arrow.png"); - Config_KeyAssign = TxC(CONFIG + @$"KeyAssign.png"); - Config_Font = TxC(CONFIG + @$"Font.png"); - Config_Font_Bold = TxC(CONFIG + @$"Font_Bold.png"); - Config_Enum_Song = TxC(CONFIG + @$"Enum_Song.png"); - #endregion - - #region 3_選曲画面 - SongSelect_Background = TxC(SONGSELECT + @$"Background.png"); - SongSelect_Header = TxC(SONGSELECT + @$"Header.png"); - SongSelect_Footer = TxC(SONGSELECT + @$"Footer.png"); - SongSelect_Coin_Slot[0] = TxC(SONGSELECT + @$"Coin_Slot.png"); - SongSelect_Coin_Slot[1] = TxC(SONGSELECT + @$"Coin_Slot_3P.png"); - SongSelect_Coin_Slot[2] = TxC(SONGSELECT + @$"Coin_Slot_4P.png"); - SongSelect_Coin_Slot[3] = TxC(SONGSELECT + @$"Coin_Slot_5P.png"); - - SongSelect_Auto = TxC(SONGSELECT + @$"Auto.png"); - SongSelect_Level = TxC(SONGSELECT + @$"Level.png"); - SongSelect_Branch = TxC(SONGSELECT + @$"Branch.png"); - SongSelect_Branch_Text = TxC(SONGSELECT + @$"Branch_Text.png"); - SongSelect_Bar_Center = TxC(SONGSELECT + @$"Bar_Center.png"); - SongSelect_Lock = TxC(SONGSELECT + @$"Lock.png"); - - SongSelect_Frame_Score[0] = TxC(SONGSELECT + @$"Frame_Score.png"); - SongSelect_Frame_Score[1] = TxC(SONGSELECT + @$"Frame_Score_Tower.png"); - SongSelect_Frame_Score[2] = TxC(SONGSELECT + @$"Frame_Score_Dan.png"); - - SongSelect_Tower_Side = TxC(SONGSELECT + @$"Tower_Side.png"); - - SongSelect_Frame_Box = TxC(SONGSELECT + @$"Frame_Box.png"); - SongSelect_Frame_BackBox = TxC(SONGSELECT + @$"Frame_BackBox.png"); - SongSelect_Frame_Random = TxC(SONGSELECT + @$"Frame_Random.png"); - SongSelect_Bar_Genre_Back = TxC(SONGSELECT + @$"Bar_Genre_Back.png"); - SongSelect_Bar_Genre_Locked = TxC(SONGSELECT + @$"Bar_Genre_Locked.png"); - SongSelect_Bar_Genre_Locked_Top = TxC(SONGSELECT + @$"Bar_Genre_Locked_Top.png"); - SongSelect_Bar_Genre_Random = TxC(SONGSELECT + @$"Bar_Genre_Random.png"); - SongSelect_Bar_Genre_RecentryPlaySong = TxC(SONGSELECT + @$"Bar_Genre_RecentryPlaySong.png"); - SongSelect_Bar_Select = TxC(SONGSELECT + @$"Bar_Select.png"); - SongSelect_Level_Number = TxC(SONGSELECT + @$"Level_Number.png"); - SongSelect_Level_Number_Big = TxC(SONGSELECT + @$"Level_Number_Big.png"); - SongSelect_Level_Number_Big_Colored = TxC(SONGSELECT + @$"Level_Number_Big_Colored.png"); - SongSelect_Level_Number_Colored = TxC(SONGSELECT + @$"Level_Number_Colored.png"); - SongSelect_Level_Number_Big_Icon = TxC(SONGSELECT + @$"Level_Number_Big_Icon.png"); - SongSelect_Level_Number_Icon = TxC(SONGSELECT + @$"Level_Number_Icon.png"); - SongSelect_Bpm_Number = TxC(SONGSELECT + @$"Bpm_Number.png"); - SongSelect_Floor_Number = TxC(SONGSELECT + @$"Floor_Number.png"); - SongSelect_Credit = TxC(SONGSELECT + @$"Credit.png"); - SongSelect_Timer = TxC(SONGSELECT + @$"Timer.png"); - SongSelect_Explicit = TxC(SONGSELECT + @$"Explicit.png"); - SongSelect_Movie = TxC(SONGSELECT + @$"Movie.png"); - SongSelect_Song_Number = TxC(SONGSELECT + @$"Song_Number.png"); - SongSelect_Bar_Genre_Overlay = TxC(SONGSELECT + @$"Bar_Genre_Overlay.png"); - SongSelect_Crown = TxC(SONGSELECT + @$"SongSelect_Crown.png"); - SongSelect_ScoreRank = TxC(SONGSELECT + @$"ScoreRank.png"); - SongSelect_BoardNumber = TxC(SONGSELECT + @$"BoardNumber.png"); - SongSelect_Difficulty_Cymbol = TxC(SONGSELECT + "Difficulty_Cymbol.png"); - SongSelect_Unlock_Conditions = TxC(SONGSELECT + "Unlock_Conditions.png"); - - SongSelect_Favorite = TxC(SONGSELECT + @$"Favorite.png"); - SongSelect_High_Score = TxC(SONGSELECT + @$"High_Score.png"); - - SongSelect_Level_Icons = TxC(SONGSELECT + @$"Level_Icons.png"); - SongSelect_Search_Arrow = TxC(SONGSELECT + @$"Search{Path.DirectorySeparatorChar}Search_Arrow.png"); - SongSelect_Search_Arrow_Glow = TxC(SONGSELECT + @$"Search{Path.DirectorySeparatorChar}Search_Arrow_Glow.png"); - SongSelect_Search_Window = TxC(SONGSELECT + @$"Search{Path.DirectorySeparatorChar}Search_Window.png"); - - for (int i = 0; i < (int)Difficulty.Total; i++) { - SongSelect_ScoreWindow[i] = TxC(SONGSELECT + @$"ScoreWindow_" + i.ToString() + ".png"); - } - - SongSelect_ScoreWindow_Text = TxC(SONGSELECT + @$"ScoreWindow_Text.png"); - - - - { - string[] genre_files = Directory.GetFiles(CSkin.Path(BASE + SONGSELECT + @$"Bar_Genre{Path.DirectorySeparatorChar}"), "Bar_Genre_*.png"); - SongSelect_Bar_Genre = new(); - for (int i = 0; i < genre_files.Length; i++) { - string name = Path.GetFileNameWithoutExtension(genre_files[i]).Split('_')[2]; - if (name != "Overlap") SongSelect_Bar_Genre.Add(name, TxC(SONGSELECT + @$"Bar_Genre{Path.DirectorySeparatorChar}Bar_Genre_" + name + ".png")); - } - } - { - string[] genre_files = Directory.GetFiles(CSkin.Path(BASE + SONGSELECT + @$"Bar_Genre{Path.DirectorySeparatorChar}"), "Bar_Genre_Overlap_*.png"); - SongSelect_Bar_Genre_Overlap = new(); - for (int i = 0; i < genre_files.Length; i++) { - string name = Path.GetFileNameWithoutExtension(genre_files[i]).Split('_')[3]; - SongSelect_Bar_Genre_Overlap.Add(name, TxC(SONGSELECT + @$"Bar_Genre{Path.DirectorySeparatorChar}Bar_Genre_Overlap_" + name + ".png")); - } - } - - { - string[] genre_files = Directory.GetFiles(CSkin.Path(BASE + SONGSELECT + @$"Genre_Background{Path.DirectorySeparatorChar}"), "GenreBackground_*.png"); - SongSelect_GenreBack = new(); - for (int i = 0; i < genre_files.Length; i++) { - string name = Path.GetFileNameWithoutExtension(genre_files[i]).Split('_')[1]; - SongSelect_GenreBack.Add(name, TxC(SONGSELECT + @$"Genre_Background{Path.DirectorySeparatorChar}GenreBackground_" + name + ".png")); - } - } - - { - string[] genre_files = Directory.GetFiles(CSkin.Path(BASE + SONGSELECT + @$"Box_Chara{Path.DirectorySeparatorChar}"), "Box_Chara_*.png"); - SongSelect_Box_Chara = new(); - for (int i = 0; i < genre_files.Length; i++) { - string name = Path.GetFileNameWithoutExtension(genre_files[i]).Split('_')[2]; - SongSelect_Box_Chara.Add(name, TxC(SONGSELECT + @$"Box_Chara{Path.DirectorySeparatorChar}Box_Chara_" + name + ".png")); - } - } - - for (int i = 0; i < SongSelect_Table.Length; i++) { - SongSelect_Table[i] = TxC(SONGSELECT + @$"Table{Path.DirectorySeparatorChar}" + i.ToString() + ".png"); - } - - SongSelect_Song_Panel[0] = TxC(SONGSELECT + @$"Song_Panel{Path.DirectorySeparatorChar}Song_Panel_Box.png"); - SongSelect_Song_Panel[1] = TxC(SONGSELECT + @$"Song_Panel{Path.DirectorySeparatorChar}Song_Panel_Song.png"); - SongSelect_Song_Panel[2] = TxC(SONGSELECT + @$"Song_Panel{Path.DirectorySeparatorChar}Song_Panel_Dan.png"); - SongSelect_Song_Panel[3] = TxC(SONGSELECT + @$"Song_Panel{Path.DirectorySeparatorChar}Song_Panel_Tower.png"); - SongSelect_Song_Panel[4] = TxC(SONGSELECT + @$"Song_Panel{Path.DirectorySeparatorChar}Song_Panel_Locked_Song.png"); - SongSelect_Song_Panel[5] = TxC(SONGSELECT + @$"Song_Panel{Path.DirectorySeparatorChar}Song_Panel_Locked_Asset.png"); - - #region [ 難易度選択画面 ] - Difficulty_Bar = TxC(SONGSELECT + @$"Difficulty_Select{Path.DirectorySeparatorChar}Difficulty_Bar.png"); - Difficulty_Number = TxC(SONGSELECT + @$"Difficulty_Select{Path.DirectorySeparatorChar}Difficulty_Number.png"); - Difficulty_Number_Colored = TxC(SONGSELECT + @$"Difficulty_Select{Path.DirectorySeparatorChar}Difficulty_Number_Colored.png"); - Difficulty_Number_Icon = TxC(SONGSELECT + @$"Difficulty_Select{Path.DirectorySeparatorChar}Difficulty_Number_Icon.png"); - Difficulty_Star = TxC(SONGSELECT + @$"Difficulty_Select{Path.DirectorySeparatorChar}Difficulty_Star.png"); - Difficulty_Crown = TxC(SONGSELECT + @$"Difficulty_Select{Path.DirectorySeparatorChar}Difficulty_Crown.png"); - Difficulty_Option = TxC($"{SONGSELECT}Difficulty_Select/Difficulty_Option.png"); - Difficulty_Option_Select = TxC($"{SONGSELECT}Difficulty_Select/Difficulty_Option_Select.png"); - - Difficulty_Select_Bar[0] = TxC(SONGSELECT + @$"Difficulty_Select{Path.DirectorySeparatorChar}Difficulty_Select_Bar.png"); - Difficulty_Select_Bar[1] = TxC(SONGSELECT + @$"Difficulty_Select{Path.DirectorySeparatorChar}Difficulty_Select_Bar2.png"); - Difficulty_Select_Bar[2] = TxC(SONGSELECT + @$"Difficulty_Select{Path.DirectorySeparatorChar}Difficulty_Select_Bar3.png"); - Difficulty_Select_Bar[3] = TxC(SONGSELECT + @$"Difficulty_Select{Path.DirectorySeparatorChar}Difficulty_Select_Bar4.png"); - Difficulty_Select_Bar[4] = TxC(SONGSELECT + @$"Difficulty_Select{Path.DirectorySeparatorChar}Difficulty_Select_Bar5.png"); - - { - string[] genre_files = Directory.GetFiles(CSkin.Path(BASE + SONGSELECT + @$"Difficulty_Select{Path.DirectorySeparatorChar}Difficulty_Back{Path.DirectorySeparatorChar}"), "Difficulty_Back_*.png"); - Difficulty_Back = new(); - for (int i = 0; i < genre_files.Length; i++) { - string name = Path.GetFileNameWithoutExtension(genre_files[i]).Split('_')[2]; - Difficulty_Back.Add(name, TxC(SONGSELECT + @$"Difficulty_Select{Path.DirectorySeparatorChar}Difficulty_Back{Path.DirectorySeparatorChar}Difficulty_Back_" + name + ".png")); - } - } - #endregion - - NewHeya_Close = TxC(SONGSELECT + @$"NewHeya{Path.DirectorySeparatorChar}Close.png"); - NewHeya_Close_Select = TxC(SONGSELECT + @$"NewHeya{Path.DirectorySeparatorChar}Close_Select.png"); - NewHeya_PlayerPlate[0] = TxC(SONGSELECT + @$"NewHeya{Path.DirectorySeparatorChar}PlayerPlate_1P.png"); - NewHeya_PlayerPlate[1] = TxC(SONGSELECT + @$"NewHeya{Path.DirectorySeparatorChar}PlayerPlate_2P.png"); - NewHeya_PlayerPlate[2] = TxC(SONGSELECT + @$"NewHeya{Path.DirectorySeparatorChar}PlayerPlate_3P.png"); - NewHeya_PlayerPlate[3] = TxC(SONGSELECT + @$"NewHeya{Path.DirectorySeparatorChar}PlayerPlate_4P.png"); - NewHeya_PlayerPlate[4] = TxC(SONGSELECT + @$"NewHeya{Path.DirectorySeparatorChar}PlayerPlate_5P.png"); - NewHeya_PlayerPlate_Select = TxC(SONGSELECT + @$"NewHeya{Path.DirectorySeparatorChar}PlayerPlate_Select.png"); - NewHeya_ModeBar = TxC(SONGSELECT + @$"NewHeya{Path.DirectorySeparatorChar}ModeBar.png"); - NewHeya_ModeBar_Select = TxC(SONGSELECT + @$"NewHeya{Path.DirectorySeparatorChar}ModeBar_Select.png"); - NewHeya_Box = TxC(SONGSELECT + @$"NewHeya{Path.DirectorySeparatorChar}Box.png"); - NewHeya_Lock = TxC(SONGSELECT + @$"NewHeya{Path.DirectorySeparatorChar}Lock.png"); - - #endregion - - #region 3_段位選択画面 - - //Dani_Background = TxC(DANISELECT + "Background.png"); - Dani_Difficulty_Cymbol = TxC(DANISELECT + "Difficulty_Cymbol.png"); - Dani_Level_Number = TxC(DANISELECT + "Level_Number.png"); - Dani_Soul_Number = TxC(DANISELECT + "SoulNumber.png"); - Dani_Exam_Number = TxC(DANISELECT + "ExamNumber.png"); - Dani_Bar_Center = TxC(DANISELECT + "Bar_Center.png"); - Dani_Bar_Back = TxC(DANISELECT + "Bar_Back.png"); - Dani_Bar_Folder = TxC(DANISELECT + "Bar_Folder.png"); - Dani_Bar_Folder_Back = TxC(DANISELECT + "Bar_Folder_Back.png"); - Dani_Bar_Random = TxC(DANISELECT + "Bar_Random.png"); - Dani_Plate = TxC(DANISELECT + "Plate.png"); - Dani_Plate_Extra = TxC(DANISELECT + "Plate_Extra.png"); - - for (int i = 0; i < Challenge_Select.Length; i++) - Challenge_Select[i] = TxC(DANISELECT + "Challenge_Select_" + i.ToString() + ".png"); - - //Dani_Dan_In = TxC(DANISELECT + "Dan_In.png"); - //Dani_Dan_Text = TxC(DANISELECT + "Dan_Text.png"); - - Dani_DanPlates = TxC(DANISELECT + "DanPlates.png"); - Dani_DanPlates_Back = TxC(DANISELECT + "DanPlates_Back.png"); - Dani_DanIcon = TxC(DANISELECT + "DanIcon.png"); - Dani_DanIcon_Fade = TxC(DANISELECT + "DanIcon_Fade.png"); - Dani_DanSides = TxC(DANISELECT + "DanSides.png"); - - for (int i = 0; i < Dani_Bloc.Length; i++) - Dani_Bloc[i] = TxC(DANISELECT + "Bloc" + i.ToString() + ".png"); - - #endregion - - #region 4_読み込み画面 - - SongLoading_Plate = TxC(SONGLOADING + @$"Plate.png"); - SongLoading_Bg = TxC(SONGLOADING + @$"Bg.png"); - SongLoading_BgWait = TxC(SONGLOADING + @$"Bg_Wait.png"); - SongLoading_Chara = TxC(SONGLOADING + @$"Chara.png"); - SongLoading_Fade = TxC(SONGLOADING + @$"Fade.png"); - SongLoading_Bg_Dan = TxC(SONGLOADING + @$"Bg_Dan.png"); - - SongLoading_Plate_AI = TxC(SONGLOADING + @$"Plate_AI.png"); - SongLoading_Bg_AI = TxC(SONGLOADING + @$"Bg_AI.png"); - SongLoading_Bg_AI_Wait = TxC(SONGLOADING + @$"Bg_AI_Wait.png"); - SongLoading_Fade_AI = TxC(SONGLOADING + @$"Fade_AI.png"); - SongLoading_Fade_AI_Anime_Base = TxC(SONGLOADING + @$"Fade_AI_Anime_Base.png"); - SongLoading_Fade_AI_Anime_Ring = TxC(SONGLOADING + @$"Fade_AI_Anime_Ring.png"); - SongLoading_Fade_AI_Anime_NowLoading = TxC(SONGLOADING + @$"Fade_AI_Anime_NowLoading.png"); - SongLoading_Fade_AI_Anime_Start = TxC(SONGLOADING + @$"Fade_AI_Anime_Start.png"); - SongLoading_Fade_AI_Anime_LoadBar_Base = TxC(SONGLOADING + @$"Fade_AI_Anime_LoadBar_Base.png"); - SongLoading_Fade_AI_Anime_LoadBar = TxC(SONGLOADING + @$"Fade_AI_Anime_LoadBar.png"); - - #endregion - - #region 5_演奏画面 - - #region General - - Notes = new CTexture[2]; - Notes[0] = TxC(GAME + @$"Notes.png"); - Notes[1] = TxC(GAME + @$"Notes_Konga.png"); - - Note_Mine = TxC(GAME + @$"Mine.png"); - Note_Swap = TxC(GAME + @$"Swap.png"); - Note_Kusu = TxC(GAME + @$"Kusu.png"); - Note_FuseRoll = TxC(GAME + @$"FuseRoll.png"); - Note_Adlib = TxC(GAME + @$"Adlib.png"); - - Judge_Frame = TxC(GAME + @$"Notes.png"); - - SENotes = new CTexture[2]; - SENotes[0] = TxC(GAME + @$"SENotes.png"); - SENotes[1] = TxC(GAME + @$"SENotes_Konga.png"); - - SENotesExtension = TxC(GAME + @$"SENotes_Extension.png"); - - Notes_Arm = TxC(GAME + @$"Notes_Arm.png"); - Judge = TxC(GAME + @$"Judge.png"); - ChipEffect = TxC(GAME + @$"ChipEffect.png"); - ScoreRank = TxC(GAME + @$"ScoreRank.png"); - - Judge_Meter = TxC(GAME + @$"Judge_Meter.png"); - Bar = TxC(GAME + @$"Bar.png"); - Bar_Branch = TxC(GAME + @$"Bar_Branch.png"); - - var _presetsDefs = CSkin.Path(BASE + GAME + BACKGROUND + @$"Presets.json"); - if (File.Exists(_presetsDefs)) - OpenTaiko.Skin.Game_SkinScenes = ConfigManager.GetConfig(_presetsDefs); - else - OpenTaiko.Skin.Game_SkinScenes = new DBSkinPreset.SkinPreset(); - - #endregion - - #region Mob - - #endregion - - #region Taiko - - Taiko_Background = new CTexture[12]; - Taiko_Background[0] = TxC(GAME + TAIKO + @$"1P_Background.png"); - Taiko_Background[1] = TxC(GAME + TAIKO + @$"2P_Background.png"); - Taiko_Background[2] = TxC(GAME + TAIKO + @$"Dan_Background.png"); - Taiko_Background[3] = TxC(GAME + TAIKO + @$"Tower_Background.png"); - Taiko_Background[4] = TxC(GAME + TAIKO + @$"1P_Background_Right.png"); - Taiko_Background[5] = TxC(GAME + TAIKO + @$"1P_Background_Tokkun.png"); - Taiko_Background[6] = TxC(GAME + TAIKO + @$"2P_Background_Tokkun.png"); - Taiko_Background[7] = TxC(GAME + TAIKO + @$"3P_Background.png"); - Taiko_Background[8] = TxC(GAME + TAIKO + @$"4P_Background.png"); - Taiko_Background[9] = TxC(GAME + TAIKO + @$"AI_Background.png"); - Taiko_Background[10] = TxC(GAME + TAIKO + @$"Boss_Background.png"); - Taiko_Background[11] = TxC(GAME + TAIKO + @$"5P_Background.png"); - - Taiko_Frame = new CTexture[7]; - Taiko_Frame[0] = TxC(GAME + TAIKO + @$"1P_Frame.png"); - Taiko_Frame[1] = TxC(GAME + TAIKO + @$"2P_Frame.png"); - Taiko_Frame[2] = TxC(GAME + TAIKO + @$"Tower_Frame.png"); - Taiko_Frame[3] = TxC(GAME + TAIKO + @$"Tokkun_Frame.png"); - Taiko_Frame[4] = TxC(GAME + TAIKO + @$"2P_None_Frame.png"); - Taiko_Frame[5] = TxC(GAME + TAIKO + @$"AI_Frame.png"); - Taiko_Frame[6] = TxC(GAME + TAIKO + @$"4PPlay_Frame.png"); - - Taiko_PlayerNumber = new CTexture[5]; - Taiko_PlayerNumber[0] = TxC(GAME + TAIKO + @$"1P_PlayerNumber.png"); - Taiko_PlayerNumber[1] = TxC(GAME + TAIKO + @$"2P_PlayerNumber.png"); - Taiko_PlayerNumber[2] = TxC(GAME + TAIKO + @$"3P_PlayerNumber.png"); - Taiko_PlayerNumber[3] = TxC(GAME + TAIKO + @$"4P_PlayerNumber.png"); - Taiko_PlayerNumber[4] = TxC(GAME + TAIKO + @$"5P_PlayerNumber.png"); - - - Taiko_Base = new CTexture[2]; - Taiko_Base[0] = TxC(GAME + TAIKO + @$"Base.png"); - Taiko_Base[1] = TxC(GAME + TAIKO + @$"Base_Konga.png"); - - Taiko_Don_Left = TxC(GAME + TAIKO + @$"Don.png"); - Taiko_Don_Right = TxC(GAME + TAIKO + @$"Don.png"); - Taiko_Ka_Left = TxC(GAME + TAIKO + @$"Ka.png"); - Taiko_Ka_Right = TxC(GAME + TAIKO + @$"Ka.png"); - - Taiko_Konga_Don = TxC(GAME + TAIKO + @$"Don_Konga.png"); - Taiko_Konga_Ka = TxC(GAME + TAIKO + @$"Ka_Konga.png"); - Taiko_Konga_Clap = TxC(GAME + TAIKO + @$"Clap.png"); - - Taiko_LevelUp = TxC(GAME + TAIKO + @$"LevelUp.png"); - Taiko_LevelDown = TxC(GAME + TAIKO + @$"LevelDown.png"); - Couse_Symbol = new CTexture[(int)Difficulty.Total + 1]; // +1は真打ちモードの分 - Couse_Symbol_Back = new CTexture[(int)Difficulty.Total + 1]; // +1は真打ちモードの分 - Couse_Symbol_Back_Flash = new CTexture[(int)Difficulty.Total + 1]; // +1は真打ちモードの分 - string[] Couse_Symbols = new string[(int)Difficulty.Total + 1] { "Easy", "Normal", "Hard", "Oni", "Edit", "Tower", "Dan", "Shin" }; - for (int i = 0; i < (int)Difficulty.Total + 1; i++) { - Couse_Symbol[i] = TxC(GAME + COURSESYMBOL + Couse_Symbols[i] + ".png"); - Couse_Symbol_Back[i] = TxC(GAME + COURSESYMBOL + Couse_Symbols[i] + "_Back.png"); - Couse_Symbol_Back_Flash[i] = TxC(GAME + COURSESYMBOL + Couse_Symbols[i] + "_Back_Flash.png"); - } - - Taiko_Score = new CTexture[6]; - Taiko_Score[0] = TxC(GAME + TAIKO + @$"Score.png"); - Taiko_Score[1] = TxC(GAME + TAIKO + @$"Score_1P.png"); - Taiko_Score[2] = TxC(GAME + TAIKO + @$"Score_2P.png"); - Taiko_Score[3] = TxC(GAME + TAIKO + @$"Score_3P.png"); - Taiko_Score[4] = TxC(GAME + TAIKO + @$"Score_4P.png"); - Taiko_Score[5] = TxC(GAME + TAIKO + @$"Score_5P.png"); - Taiko_Combo = new CTexture[4]; - Taiko_Combo[0] = TxC(GAME + TAIKO + @$"Combo.png"); - Taiko_Combo[1] = TxC(GAME + TAIKO + @$"Combo_Big.png"); - Taiko_Combo[2] = TxC(GAME + TAIKO + @$"Combo_Midium.png"); - Taiko_Combo[3] = TxC(GAME + TAIKO + @$"Combo_Huge.png"); - Taiko_Combo_Effect = TxC(GAME + TAIKO + @$"Combo_Effect.png"); - Taiko_Combo_Text = TxC(GAME + TAIKO + @$"Combo_Text.png"); - - Taiko_Combo_Guide = new CTexture[3]; - for (int i = 0; i < Taiko_Combo_Guide.Length; i++) { - Taiko_Combo_Guide[i] = TxC(GAME + TAIKO + @$"Combo_Guide" + i.ToString() + ".png"); - } - - #endregion - - #region Gauge - - Gauge = new CTexture[8]; - Gauge[0] = TxC(GAME + GAUGE + @$"1P.png"); - Gauge[1] = TxC(GAME + GAUGE + @$"2P.png"); - Gauge[2] = TxC(GAME + GAUGE + @$"1P_Right.png"); - Gauge[3] = TxC(GAME + GAUGE + @$"1P_4PGauge.png"); - Gauge[4] = TxC(GAME + GAUGE + @$"2P_4PGauge.png"); - Gauge[5] = TxC(GAME + GAUGE + @$"3P_4PGauge.png"); - Gauge[6] = TxC(GAME + GAUGE + @$"4P_4PGauge.png"); - Gauge[7] = TxC(GAME + GAUGE + @$"5P_4PGauge.png"); - - Gauge_Base = new CTexture[8]; - Gauge_Base[0] = TxC(GAME + GAUGE + @$"1P_Base.png"); - Gauge_Base[1] = TxC(GAME + GAUGE + @$"2P_Base.png"); - Gauge_Base[2] = TxC(GAME + GAUGE + @$"1P_Base_Right.png"); - Gauge_Base[3] = TxC(GAME + GAUGE + @$"1P_Base_4PGauge.png"); - Gauge_Base[4] = TxC(GAME + GAUGE + @$"2P_Base_4PGauge.png"); - Gauge_Base[5] = TxC(GAME + GAUGE + @$"3P_Base_4PGauge.png"); - Gauge_Base[6] = TxC(GAME + GAUGE + @$"4P_Base_4PGauge.png"); - Gauge_Base[7] = TxC(GAME + GAUGE + @$"5P_Base_4PGauge.png"); - - Gauge_Line = new CTexture[2]; - Gauge_Line[0] = TxC(GAME + GAUGE + @$"1P_Line.png"); - Gauge_Line[1] = TxC(GAME + GAUGE + @$"2P_Line.png"); - - Gauge_Clear = new CTexture[3]; - Gauge_Clear[0] = TxC(GAME + GAUGE + @$"Clear.png"); - Gauge_Clear[1] = TxC(GAME + GAUGE + @$"Clear_2PGauge.png"); - Gauge_Clear[2] = TxC(GAME + GAUGE + @$"Clear_4PGauge.png"); - - Gauge_Base_Norma = new CTexture[3]; - Gauge_Base_Norma[0] = TxC(GAME + GAUGE + @$"Norma_Base.png"); - Gauge_Base_Norma[1] = TxC(GAME + GAUGE + @$"Norma_Base_2PGauge.png"); - Gauge_Base_Norma[2] = TxC(GAME + GAUGE + @$"Norma_Base_4PGauge.png"); - - Gauge_Killzone = new CTexture[3]; - Gauge_Killzone[0] = TxC(GAME + GAUGE + @$"Killzone.png"); - Gauge_Killzone[1] = TxC(GAME + GAUGE + @$"Killzone_2PGauge.png"); - Gauge_Killzone[2] = TxC(GAME + GAUGE + @$"Killzone_4PGauge.png"); - - OpenTaiko.Skin.Game_Gauge_Rainbow_Ptn = OpenTaiko.t連番画像の枚数を数える(CSkin.Path(BASE + GAME + GAUGE + @$"Rainbow{Path.DirectorySeparatorChar}")); - if (OpenTaiko.Skin.Game_Gauge_Rainbow_Ptn != 0) { - Gauge_Rainbow = new CTexture[OpenTaiko.Skin.Game_Gauge_Rainbow_Ptn]; - for (int i = 0; i < OpenTaiko.Skin.Game_Gauge_Rainbow_Ptn; i++) { - Gauge_Rainbow[i] = TxC(GAME + GAUGE + @$"Rainbow{Path.DirectorySeparatorChar}" + i.ToString() + ".png"); - } - } - - OpenTaiko.Skin.Game_Gauge_Rainbow_Flat_Ptn = OpenTaiko.t連番画像の枚数を数える(CSkin.Path(BASE + GAME + GAUGE + @$"Rainbow_Flat{Path.DirectorySeparatorChar}")); - if (OpenTaiko.Skin.Game_Gauge_Rainbow_Flat_Ptn != 0) { - Gauge_Rainbow_Flat = new CTexture[OpenTaiko.Skin.Game_Gauge_Rainbow_Flat_Ptn]; - for (int i = 0; i < OpenTaiko.Skin.Game_Gauge_Rainbow_Flat_Ptn; i++) { - Gauge_Rainbow_Flat[i] = TxC(GAME + GAUGE + @$"Rainbow_Flat{Path.DirectorySeparatorChar}" + i.ToString() + ".png"); - } - } - - OpenTaiko.Skin.Game_Gauge_Rainbow_2PGauge_Ptn = OpenTaiko.t連番画像の枚数を数える(CSkin.Path(BASE + GAME + GAUGE + @$"Rainbow_2PGauge{Path.DirectorySeparatorChar}")); - if (OpenTaiko.Skin.Game_Gauge_Rainbow_2PGauge_Ptn != 0) { - Gauge_Rainbow_2PGauge = new CTexture[OpenTaiko.Skin.Game_Gauge_Rainbow_2PGauge_Ptn]; - for (int i = 0; i < OpenTaiko.Skin.Game_Gauge_Rainbow_2PGauge_Ptn; i++) { - Gauge_Rainbow_2PGauge[i] = TxC(GAME + GAUGE + @$"Rainbow_2PGauge{Path.DirectorySeparatorChar}" + i.ToString() + ".png"); - } - } - - // Dan - - OpenTaiko.Skin.Game_Gauge_Dan_Rainbow_Ptn = OpenTaiko.t連番画像の枚数を数える(CSkin.Path(BASE + GAME + DANC + @$"Rainbow{Path.DirectorySeparatorChar}")); - if (OpenTaiko.Skin.Game_Gauge_Dan_Rainbow_Ptn != 0) { - Gauge_Dan_Rainbow = new CTexture[OpenTaiko.Skin.Game_Gauge_Dan_Rainbow_Ptn]; - for (int i = 0; i < OpenTaiko.Skin.Game_Gauge_Dan_Rainbow_Ptn; i++) { - Gauge_Dan_Rainbow[i] = TxC(GAME + DANC + @$"Rainbow{Path.DirectorySeparatorChar}" + i.ToString() + ".png"); - } - } - - Gauge_Dan = new CTexture[6]; - - Gauge_Dan[0] = TxC(GAME + GAUGE + @$"1P_Dan_Base.png"); - Gauge_Dan[1] = TxC(GAME + GAUGE + @$"1P_Dan.png"); - Gauge_Dan[2] = TxC(GAME + GAUGE + @$"1P_Dan_Clear_Base.png"); - Gauge_Dan[3] = TxC(GAME + GAUGE + @$"1P_Dan_Clear.png"); - Gauge_Dan[4] = TxC(GAME + GAUGE + @$"1P_Dan_Base_Right.png"); - Gauge_Dan[5] = TxC(GAME + GAUGE + @$"1P_Dan_Right.png"); - - Gauge_Soul = TxC(GAME + GAUGE + @$"Soul.png"); - Gauge_Soul_Fire = TxC(GAME + GAUGE + @$"Fire.png"); - Gauge_Soul_Explosion = new CTexture[2]; - Gauge_Soul_Explosion[0] = TxC(GAME + GAUGE + @$"1P_Explosion.png"); - Gauge_Soul_Explosion[1] = TxC(GAME + GAUGE + @$"2P_Explosion.png"); - - #endregion - - #region Balloon - - Balloon_Combo = new CTexture[2]; - Balloon_Combo[0] = TxC(GAME + BALLOON + @$"Combo_1P.png"); - Balloon_Combo[1] = TxC(GAME + BALLOON + @$"Combo_2P.png"); - Balloon_Roll = TxC(GAME + BALLOON + @$"Roll.png"); - Balloon_Balloon = TxC(GAME + BALLOON + @$"Balloon.png"); - Balloon_Number_Roll = TxC(GAME + BALLOON + @$"Number_Roll.png"); - Balloon_Number_Combo = TxC(GAME + BALLOON + @$"Number_Combo.png"); - - Balloon_Breaking = new CTexture[6]; - for (int i = 0; i < 6; i++) { - Balloon_Breaking[i] = TxC(GAME + BALLOON + @$"Breaking_" + i.ToString() + ".png"); - } - - Kusudama_Number = TxC(GAME + BALLOON + KUSUDAMA + @$"Kusudama_Number.png"); - - Fuse_Number = TxC(GAME + BALLOON + FUSE + @$"Number_Fuse.png"); - Fuse_Balloon = TxC(GAME + BALLOON + FUSE + @$"Fuse.png"); - - #endregion - - #region Effects - - Effects_Hit_Explosion = TxCAf(GAME + EFFECTS + @$"Hit{Path.DirectorySeparatorChar}Explosion.png"); - if (Effects_Hit_Explosion != null) Effects_Hit_Explosion.b加算合成 = OpenTaiko.Skin.Game_Effect_HitExplosion_AddBlend; - Effects_Hit_Explosion_Big = TxC(GAME + EFFECTS + @$"Hit{Path.DirectorySeparatorChar}Explosion_Big.png"); - if (Effects_Hit_Explosion_Big != null) Effects_Hit_Explosion_Big.b加算合成 = OpenTaiko.Skin.Game_Effect_HitExplosionBig_AddBlend; - Effects_Hit_FireWorks = TxC(GAME + EFFECTS + @$"Hit{Path.DirectorySeparatorChar}FireWorks.png"); - if (Effects_Hit_FireWorks != null) Effects_Hit_FireWorks.b加算合成 = OpenTaiko.Skin.Game_Effect_FireWorks_AddBlend; - - Effects_Hit_Bomb = TxCAf(GAME + EFFECTS + @$"Hit{Path.DirectorySeparatorChar}Bomb.png"); - - - Effects_Fire = TxC(GAME + EFFECTS + @$"Fire.png"); - if (Effects_Fire != null) Effects_Fire.b加算合成 = OpenTaiko.Skin.Game_Effect_Fire_AddBlend; - - Effects_Rainbow = TxC(GAME + EFFECTS + @$"Rainbow.png"); - - Effects_GoGoSplash = TxC(GAME + EFFECTS + @$"GoGoSplash.png"); - if (Effects_GoGoSplash != null) Effects_GoGoSplash.b加算合成 = OpenTaiko.Skin.Game_Effect_GoGoSplash_AddBlend; - Effects_Hit_Great = new CTexture[15]; - Effects_Hit_Great_Big = new CTexture[15]; - Effects_Hit_Good = new CTexture[15]; - Effects_Hit_Good_Big = new CTexture[15]; - for (int i = 0; i < 15; i++) { - Effects_Hit_Great[i] = TxC(GAME + EFFECTS + @$"Hit{Path.DirectorySeparatorChar}" + @$"Great{Path.DirectorySeparatorChar}" + i.ToString() + ".png"); - Effects_Hit_Great_Big[i] = TxC(GAME + EFFECTS + @$"Hit{Path.DirectorySeparatorChar}" + @$"Great_Big{Path.DirectorySeparatorChar}" + i.ToString() + ".png"); - Effects_Hit_Good[i] = TxC(GAME + EFFECTS + @$"Hit{Path.DirectorySeparatorChar}" + @$"Good{Path.DirectorySeparatorChar}" + i.ToString() + ".png"); - Effects_Hit_Good_Big[i] = TxC(GAME + EFFECTS + @$"Hit{Path.DirectorySeparatorChar}" + @$"Good_Big{Path.DirectorySeparatorChar}" + i.ToString() + ".png"); - } - OpenTaiko.Skin.Game_Effect_Roll_Ptn = OpenTaiko.t連番画像の枚数を数える(CSkin.Path(BASE + GAME + EFFECTS + @$"Roll{Path.DirectorySeparatorChar}")); - Effects_Roll = new CTexture[OpenTaiko.Skin.Game_Effect_Roll_Ptn]; - for (int i = 0; i < OpenTaiko.Skin.Game_Effect_Roll_Ptn; i++) { - Effects_Roll[i] = TxC(GAME + EFFECTS + @$"Roll{Path.DirectorySeparatorChar}" + i.ToString() + ".png"); - } - - #endregion - - #region Lane - - Lane_Base = new CTexture[3]; - Lane_Text = new CTexture[3]; - string[] Lanes = new string[3] { "Normal", "Expert", "Master" }; - for (int i = 0; i < 3; i++) { - Lane_Base[i] = TxC(GAME + LANE + "Base_" + Lanes[i] + ".png"); - Lane_Text[i] = TxC(GAME + LANE + "Text_" + Lanes[i] + ".png"); - } - - Lane_Red = new CTexture[2]; - Lane_Blue = new CTexture[2]; - Lane_Clap = new CTexture[2]; - - var _suffixes = new string[] { "", "_Konga" }; - - for (int i = 0; i < Lane_Red.Length; i++) { - Lane_Red[i] = TxC(GAME + LANE + @$"Red" + _suffixes[i] + @$".png"); - Lane_Blue[i] = TxC(GAME + LANE + @$"Blue" + _suffixes[i] + @$".png"); - Lane_Clap[i] = TxC(GAME + LANE + @$"Clap" + _suffixes[i] + @$".png"); - } - - - Lane_Yellow = TxC(GAME + LANE + @$"Yellow.png"); - Lane_Background_Main = TxC(GAME + LANE + @$"Background_Main.png"); - Lane_Background_AI = TxC(GAME + LANE + @$"Background_AI.png"); - Lane_Background_Sub = TxC(GAME + LANE + @$"Background_Sub.png"); - Lane_Background_GoGo = TxC(GAME + LANE + @$"Background_GoGo.png"); - - #endregion - - #region GameMode - - GameMode_Timer_Tick = TxC(GAME + GAMEMODE + @$"Timer_Tick.png"); - GameMode_Timer_Frame = TxC(GAME + GAMEMODE + @$"Timer_Frame.png"); - - #endregion - - #region ClearFailed - - Failed_Game = TxC(GAME + FAILED + @$"Game.png"); - Failed_Stage = TxC(GAME + FAILED + @$"Stage.png"); - - #endregion - - #region Runner - - //Runner = TxC(GAME + RUNNER + @$"0.png"); - - #endregion - - #region DanC - - DanC_Background = TxC(GAME + DANC + @$"Background.png"); - DanC_Gauge = new CTexture[4]; - var type = new string[] { "Normal", "Reach", "Clear", "Flush" }; - for (int i = 0; i < 4; i++) { - DanC_Gauge[i] = TxC(GAME + DANC + @$"Gauge_" + type[i] + ".png"); - } - DanC_Base = TxC(GAME + DANC + @$"Base.png"); - DanC_Base_Small = TxC(GAME + DANC + @$"Base_Small.png"); - - DanC_Gauge_Base = TxC(GAME + DANC + @$"Gauge_Base.png"); - DanC_Failed = TxC(GAME + DANC + @$"Failed.png"); - DanC_Number = TxC(GAME + DANC + @$"Number.png"); - DanC_Small_Number = TxC(GAME + DANC + @$"Small_Number.png"); - DanC_ExamType = TxC(GAME + DANC + @$"ExamType.png"); - DanC_ExamRange = TxC(GAME + DANC + @$"ExamRange.png"); - DanC_ExamUnit = TxC(GAME + DANC + @$"ExamUnit.png"); - DanC_Screen = TxC(GAME + DANC + @$"Screen.png"); - DanC_SmallBase = TxC(GAME + DANC + @$"SmallBase.png"); - DanC_Small_ExamCymbol = TxC(GAME + DANC + @$"Small_ExamCymbol.png"); - DanC_ExamCymbol = TxC(GAME + DANC + @$"ExamCymbol.png"); - DanC_MiniNumber = TxC(GAME + DANC + @$"MiniNumber.png"); - - #endregion - - #region PuchiChara - - var puchicharaDirs = System.IO.Directory.GetDirectories(OpenTaiko.strEXEのあるフォルダ + GLOBAL + PUCHICHARA); - OpenTaiko.Skin.Puchichara_Ptn = puchicharaDirs.Length; - - Puchichara = new CPuchichara[OpenTaiko.Skin.Puchichara_Ptn]; - OpenTaiko.Skin.Puchicharas_Name = new string[OpenTaiko.Skin.Puchichara_Ptn]; - - for (int i = 0; i < OpenTaiko.Skin.Puchichara_Ptn; i++) { - Puchichara[i] = new CPuchichara(puchicharaDirs[i]); - - OpenTaiko.Skin.Puchicharas_Name[i] = System.IO.Path.GetFileName(puchicharaDirs[i]); - } - - ///TJAPlayer3.Skin.Puchichara_Ptn = 5 * Math.Max(1, (PuchiChara.szテクスチャサイズ.Height / 256)); - - - #endregion - - #region Training - - Tokkun_DownBG = TxC(GAME + TRAINING + @$"Down.png"); - Tokkun_BigTaiko = TxC(GAME + TRAINING + @$"BigTaiko.png"); - Tokkun_ProgressBar = TxC(GAME + TRAINING + @$"ProgressBar_Red.png"); - Tokkun_ProgressBarWhite = TxC(GAME + TRAINING + @$"ProgressBar_White.png"); - Tokkun_GoGoPoint = TxC(GAME + TRAINING + @$"GoGoPoint.png"); - Tokkun_JumpPoint = TxC(GAME + TRAINING + @$"JumpPoint.png"); - Tokkun_Background_Up = TxC(GAME + TRAINING + @$"Background_Up.png"); - Tokkun_BigNumber = TxC(GAME + TRAINING + @$"BigNumber.png"); - Tokkun_SmallNumber = TxC(GAME + TRAINING + @$"SmallNumber.png"); - Tokkun_Speed_Measure = TxC(GAME + TRAINING + @$"Speed_Measure.png"); - - #endregion - - #region [20_Tower] - - Tower_Miss = TxC(GAME + TOWER + @$"Miss.png"); - - // Tower elements - string[] towerDirectories = System.IO.Directory.GetDirectories(CSkin.Path(BASE + GAME + TOWER + TOWERFLOOR)); - OpenTaiko.Skin.Game_Tower_Ptn = towerDirectories.Length; - OpenTaiko.Skin.Game_Tower_Names = new string[OpenTaiko.Skin.Game_Tower_Ptn]; - for (int i = 0; i < OpenTaiko.Skin.Game_Tower_Ptn; i++) - OpenTaiko.Skin.Game_Tower_Names[i] = new DirectoryInfo(towerDirectories[i]).Name; - Tower_Top = new CTexture[OpenTaiko.Skin.Game_Tower_Ptn]; - Tower_Base = new CTexture[OpenTaiko.Skin.Game_Tower_Ptn][]; - Tower_Deco = new CTexture[OpenTaiko.Skin.Game_Tower_Ptn][]; - - OpenTaiko.Skin.Game_Tower_Ptn_Base = new int[OpenTaiko.Skin.Game_Tower_Ptn]; - OpenTaiko.Skin.Game_Tower_Ptn_Deco = new int[OpenTaiko.Skin.Game_Tower_Ptn]; - - for (int i = 0; i < OpenTaiko.Skin.Game_Tower_Ptn; i++) { - OpenTaiko.Skin.Game_Tower_Ptn_Base[i] = OpenTaiko.t連番画像の枚数を数える((towerDirectories[i] + @$"{Path.DirectorySeparatorChar}Base{Path.DirectorySeparatorChar}"), "Base"); - OpenTaiko.Skin.Game_Tower_Ptn_Deco[i] = OpenTaiko.t連番画像の枚数を数える((towerDirectories[i] + @$"{Path.DirectorySeparatorChar}Deco{Path.DirectorySeparatorChar}"), "Deco"); - - Tower_Top[i] = TxC(GAME + TOWER + TOWERFLOOR + OpenTaiko.Skin.Game_Tower_Names[i] + @$"{Path.DirectorySeparatorChar}Top.png"); - - Tower_Base[i] = new CTexture[OpenTaiko.Skin.Game_Tower_Ptn_Base[i]]; - Tower_Deco[i] = new CTexture[OpenTaiko.Skin.Game_Tower_Ptn_Deco[i]]; - - for (int j = 0; j < OpenTaiko.Skin.Game_Tower_Ptn_Base[i]; j++) { - Tower_Base[i][j] = TxC(GAME + TOWER + TOWERFLOOR + OpenTaiko.Skin.Game_Tower_Names[i] + @$"{Path.DirectorySeparatorChar}Base{Path.DirectorySeparatorChar}Base" + j.ToString() + ".png"); - } - - for (int j = 0; j < OpenTaiko.Skin.Game_Tower_Ptn_Deco[i]; j++) { - Tower_Deco[i][j] = TxC(GAME + TOWER + TOWERFLOOR + OpenTaiko.Skin.Game_Tower_Names[i] + @$"{Path.DirectorySeparatorChar}Deco{Path.DirectorySeparatorChar}Deco" + j.ToString() + ".png"); - } - } - - - - #endregion - - #region [21_ModIcons] - - HiSp = new CTexture[14]; - for (int i = 0; i < HiSp.Length; i++) { - HiSp[i] = TxC(GAME + MODICONS + @$"HS{Path.DirectorySeparatorChar}" + i.ToString() + @$".png"); - } - - Mod_Timing = new CTexture[5]; - for (int i = 0; i < Mod_Timing.Length; i++) { - Mod_Timing[i] = TxC(GAME + MODICONS + @$"Timing{Path.DirectorySeparatorChar}" + i.ToString() + @$".png"); - } - - Mod_SongSpeed = new CTexture[2]; - for (int i = 0; i < Mod_SongSpeed.Length; i++) { - Mod_SongSpeed[i] = TxC(GAME + MODICONS + @$"SongSpeed{Path.DirectorySeparatorChar}" + i.ToString() + @$".png"); - } - - Mod_Fun = new CTexture[3]; - for (int i = 0; i < Mod_Fun.Length; i++) { - Mod_Fun[i] = TxC(GAME + MODICONS + @$"Fun{Path.DirectorySeparatorChar}" + i.ToString() + @$".png"); - } - - Mod_Doron = TxC(GAME + MODICONS + @$"Doron.png"); - Mod_Stealth = TxC(GAME + MODICONS + @$"Stealth.png"); - Mod_Mirror = TxC(GAME + MODICONS + @$"Mirror.png"); - Mod_Super = TxC(GAME + MODICONS + @$"Super.png"); - Mod_Hyper = TxC(GAME + MODICONS + @$"Hyper.png"); - Mod_Random = TxC(GAME + MODICONS + @$"Random.png"); - Mod_Auto = TxC(GAME + MODICONS + @$"Auto.png"); - Mod_Just = TxC(GAME + MODICONS + @$"Just.png"); - Mod_Safe = TxC(GAME + MODICONS + @$"Safe.png"); - Mod_None = TxC(GAME + MODICONS + @$"None.png"); - - #endregion - - #region [22_AIBattle] - - AIBattle_SectionTime_Panel = TxC(GAME + AIBATTLE + @$"SectionTime_Panel.png"); - - AIBattle_SectionTime_Bar_Base = TxC(GAME + AIBATTLE + @$"SectionTime_Bar_Base.png"); - AIBattle_SectionTime_Bar_Finish = TxC(GAME + AIBATTLE + @$"SectionTime_Bar_Finish.png"); - AIBattle_SectionTime_Bar_Normal = TxC(GAME + AIBATTLE + @$"SectionTime_Bar_Normal.png"); - - AIBattle_Batch_Base = TxC(GAME + AIBATTLE + @$"Batch_Base.png"); - AIBattle_Batch = TxC(GAME + AIBATTLE + @$"Batch.png"); - - AIBattle_Judge_Meter[0] = TxC(GAME + AIBATTLE + @$"Judge_Meter.png"); - AIBattle_Judge_Meter[1] = TxC(GAME + AIBATTLE + @$"Judge_Meter_AI.png"); - - AIBattle_Judge_Number = TxC(GAME + AIBATTLE + @$"Judge_Number.png"); - - #endregion - - #endregion - - #region 6_結果発表 - - Result_Gauge[0] = TxC(RESULT + @$"Gauge.png"); - Result_Gauge_Base[0] = TxC(RESULT + @$"Gauge_Base.png"); - Result_Gauge[1] = TxC(RESULT + @$"Gauge_2.png"); - Result_Gauge_Base[1] = TxC(RESULT + @$"Gauge_Base_2.png"); - Result_Gauge[2] = TxC(RESULT + @$"Gauge_3.png"); - Result_Gauge_Base[2] = TxC(RESULT + @$"Gauge_Base_3.png"); - Result_Gauge[3] = TxC(RESULT + @$"Gauge_4.png"); - Result_Gauge_Base[3] = TxC(RESULT + @$"Gauge_Base_4.png"); - Result_Gauge[4] = TxC(RESULT + @$"Gauge_5.png"); - Result_Gauge_Base[4] = TxC(RESULT + @$"Gauge_Base_5.png"); - - Result_Gauge_Frame = TxC(RESULT + @$"Gauge_Frame.png"); - Result_Gauge_Clear = TxC(RESULT + @$"Gauge_Clear.png"); - Result_Gauge_Clear_Base = TxC(RESULT + @$"Gauge_Clear_Base.png"); - Result_Gauge_Killzone = TxC(RESULT + @$"Gauge_Killzone.png"); - - Result_Header = TxC(RESULT + @$"Header.png"); - Result_Number = TxC(RESULT + @$"Number.png"); - Result_Panel = TxC(RESULT + @$"Panel.png"); - Result_Panel_2P = TxC(RESULT + @$"Panel_2.png"); - Result_Soul_Text = TxC(RESULT + @$"Soul_Text.png"); - Result_Soul_Fire = TxC(RESULT + @$"Result_Soul_Fire.png"); - Result_Diff_Bar = TxC(RESULT + @$"DifficultyBar.png"); - Result_Score_Number = TxC(RESULT + @$"Score_Number.png"); - Result_Dan = TxC(RESULT + @$"Dan.png"); - - Result_CrownEffect = TxC(RESULT + @$"CrownEffect.png"); - Result_ScoreRankEffect = TxC(RESULT + @$"ScoreRankEffect.png"); - //Result_Cloud = TxC(RESULT + @$"Cloud.png"); - Result_Shine = TxC(RESULT + @$"Shine.png"); - - Result_Speech_Bubble[0] = TxC(RESULT + @$"Speech_Bubble.png"); - Result_Speech_Bubble[1] = TxC(RESULT + @$"Speech_Bubble_2.png"); - - Result_Speech_Bubble_V2[0] = TxC(RESULT + @$"Speech_Bubble_V2_Left.png"); - Result_Speech_Bubble_V2[1] = TxC(RESULT + @$"Speech_Bubble_V2_Right.png"); - Result_Speech_Bubble_V2[2] = TxC(RESULT + @$"Speech_Bubble_V2_4P_5P.png"); - - Result_Flower = TxC(RESULT + @$"Flower{Path.DirectorySeparatorChar}Flower.png"); - - for (int i = 0; i < 4; i++) - Result_Panel_4P[i] = TxC(RESULT + @$"Panel_4P_" + (i + 1).ToString() + ".png"); - - for (int i = 0; i < 5; i++) - Result_Panel_5P[i] = TxC(RESULT + @$"Panel_5P_" + (i + 1).ToString() + ".png"); - - for (int i = 1; i <= 5; i++) - Result_Flower_Rotate[i - 1] = TxC(RESULT + @$"Flower{Path.DirectorySeparatorChar}Rotate_" + i.ToString() + ".png"); - - //for (int i = 0; i < 3; i++) - //Result_Work[i] = TxC(RESULT + @$"Work{Path.DirectorySeparatorChar}" + i.ToString() + ".png"); - - OpenTaiko.Skin.Result_Gauge_Rainbow_Ptn = OpenTaiko.t連番画像の枚数を数える(CSkin.Path(BASE + RESULT + @$"Rainbow{Path.DirectorySeparatorChar}")); - if (OpenTaiko.Skin.Result_Gauge_Rainbow_Ptn != 0) { - Result_Rainbow = new CTexture[OpenTaiko.Skin.Result_Gauge_Rainbow_Ptn]; - for (int i = 0; i < OpenTaiko.Skin.Result_Gauge_Rainbow_Ptn; i++) { - Result_Rainbow[i] = TxC(RESULT + @$"Rainbow{Path.DirectorySeparatorChar}" + i.ToString() + ".png"); - } - } - - //for (int i = 0; i < 6; i++) - //Result_Background[i] = TxC(RESULT + @$"Background_" + i.ToString() + ".png"); - - //for (int i = 0; i < 4; i++) - //Result_Mountain[i] = TxC(RESULT + @$"Background_Mountain_" + i.ToString() + ".png"); - - for (int i = 0; i < 3; i++) - Result_Crown[i] = TxC(RESULT + @$"Crown{Path.DirectorySeparatorChar}Crown_" + i.ToString() + ".png"); - - #endregion - - #region 7_終了画面 - //Exit_Background = TxC(EXIT + @$"Background.png"); - #endregion - - #region 7_AIResults - - Result_AIBattle_Panel_AI = TxC(RESULT + @$"AIBattle{Path.DirectorySeparatorChar}Panel_AI.png"); - Result_AIBattle_Batch = TxC(RESULT + @$"AIBattle{Path.DirectorySeparatorChar}Batch.png"); - Result_AIBattle_SectionPlate = TxC(RESULT + @$"AIBattle{Path.DirectorySeparatorChar}SectionPlate.png"); - Result_AIBattle_WinFlag_Clear = TxC(RESULT + @$"AIBattle{Path.DirectorySeparatorChar}WinFlag_Win.png"); - Result_AIBattle_WinFlag_Lose = TxC(RESULT + @$"AIBattle{Path.DirectorySeparatorChar}WinFlag_Lose.png"); - - #endregion - - #region [7_DanResults] - - //DanResult_Background = TxC(DANRESULT + @$"Background.png"); - DanResult_Rank = TxC(DANRESULT + @$"Rank.png"); - DanResult_SongPanel_Base = TxC(DANRESULT + @$"SongPanel_Base.png"); - DanResult_StatePanel_Base = TxC(DANRESULT + @$"StatePanel_Base.png"); - DanResult_SongPanel_Main = TxC(DANRESULT + @$"SongPanel_Main.png"); - DanResult_StatePanel_Main = TxC(DANRESULT + @$"StatePanel_Main.png"); - - #endregion - - #region [8_TowerResults] - - OpenTaiko.Skin.Game_Tower_Ptn_Result = OpenTaiko.t連番画像の枚数を数える(CSkin.Path(BASE + TOWERRESULT + @$"Tower{Path.DirectorySeparatorChar}")); - TowerResult_Tower = new CTexture[OpenTaiko.Skin.Game_Tower_Ptn_Result]; - - TowerResult_Background = TxC(TOWERRESULT + @$"Background.png"); - TowerResult_Panel = TxC(TOWERRESULT + @$"Panel.png"); - - TowerResult_ScoreRankEffect = TxC(TOWERRESULT + @$"ScoreRankEffect.png"); - - for (int i = 0; i < OpenTaiko.Skin.Game_Tower_Ptn_Result; i++) { - TowerResult_Tower[i] = TxC(TOWERRESULT + @$"Tower{Path.DirectorySeparatorChar}" + i.ToString() + ".png"); - } - - #endregion - - #region [10_Heya] - - //Heya_Background = TxC(HEYA + @$"Background.png"); - Heya_Center_Menu_Bar = TxC(HEYA + @$"Center_Menu_Bar.png"); - Heya_Center_Menu_Box = TxC(HEYA + @$"Center_Menu_Box.png"); - Heya_Center_Menu_Box_Slot = TxC(HEYA + @$"Center_Menu_Box_Slot.png"); - Heya_Side_Menu = TxC(HEYA + @$"Side_Menu.png"); - Heya_Render_Field = TxC(HEYA + @$"Render_Field.png"); - Heya_Center_Menu_Background = TxC(HEYA + @$"Center_Menu_Background.png"); - Heya_Description_Panel = TxC(HEYA + @$"Description_Panel.png"); - Heya_Box = TxC(HEYA + @$"Box.png"); - Heya_Lock = TxC(HEYA + @$"Lock.png"); - - #endregion - - #region [11_Characters] - - #region [Character count initialisations] - - var charaDirs = System.IO.Directory.GetDirectories(OpenTaiko.strEXEのあるフォルダ + GLOBAL + CHARACTERS); - OpenTaiko.Skin.Characters_Ptn = charaDirs.Length; - - Characters_Heya_Preview = new CTexture[OpenTaiko.Skin.Characters_Ptn]; - Characters_Heya_Render = new CTexture[OpenTaiko.Skin.Characters_Ptn]; - Characters_Result_Clear_1P = new CTexture[OpenTaiko.Skin.Characters_Ptn]; - Characters_Result_Failed_1P = new CTexture[OpenTaiko.Skin.Characters_Ptn]; - Characters_Result_Clear_2P = new CTexture[OpenTaiko.Skin.Characters_Ptn]; - Characters_Result_Failed_2P = new CTexture[OpenTaiko.Skin.Characters_Ptn]; - Characters = new CCharacter[OpenTaiko.Skin.Characters_Ptn]; - - Characters_Normal = new CTexture[OpenTaiko.Skin.Characters_Ptn][]; - Characters_Normal_Missed = new CTexture[OpenTaiko.Skin.Characters_Ptn][]; - Characters_Normal_MissedDown = new CTexture[OpenTaiko.Skin.Characters_Ptn][]; - Characters_Normal_Cleared = new CTexture[OpenTaiko.Skin.Characters_Ptn][]; - Characters_Normal_Maxed = new CTexture[OpenTaiko.Skin.Characters_Ptn][]; - Characters_MissIn = new CTexture[OpenTaiko.Skin.Characters_Ptn][]; - Characters_MissDownIn = new CTexture[OpenTaiko.Skin.Characters_Ptn][]; - Characters_GoGoTime = new CTexture[OpenTaiko.Skin.Characters_Ptn][]; - Characters_GoGoTime_Maxed = new CTexture[OpenTaiko.Skin.Characters_Ptn][]; - Characters_10Combo = new CTexture[OpenTaiko.Skin.Characters_Ptn][]; - Characters_10Combo_Clear = new CTexture[OpenTaiko.Skin.Characters_Ptn][]; - Characters_10Combo_Maxed = new CTexture[OpenTaiko.Skin.Characters_Ptn][]; - Characters_GoGoStart = new CTexture[OpenTaiko.Skin.Characters_Ptn][]; - Characters_GoGoStart_Clear = new CTexture[OpenTaiko.Skin.Characters_Ptn][]; - Characters_GoGoStart_Maxed = new CTexture[OpenTaiko.Skin.Characters_Ptn][]; - Characters_Become_Cleared = new CTexture[OpenTaiko.Skin.Characters_Ptn][]; - Characters_Become_Maxed = new CTexture[OpenTaiko.Skin.Characters_Ptn][]; - Characters_SoulOut = new CTexture[OpenTaiko.Skin.Characters_Ptn][]; - Characters_ClearOut = new CTexture[OpenTaiko.Skin.Characters_Ptn][]; - Characters_Return = new CTexture[OpenTaiko.Skin.Characters_Ptn][]; - Characters_Balloon_Breaking = new CTexture[OpenTaiko.Skin.Characters_Ptn][]; - Characters_Balloon_Broke = new CTexture[OpenTaiko.Skin.Characters_Ptn][]; - Characters_Balloon_Miss = new CTexture[OpenTaiko.Skin.Characters_Ptn][]; - Characters_Kusudama_Idle = new CTexture[OpenTaiko.Skin.Characters_Ptn][]; - Characters_Kusudama_Breaking = new CTexture[OpenTaiko.Skin.Characters_Ptn][]; - Characters_Kusudama_Broke = new CTexture[OpenTaiko.Skin.Characters_Ptn][]; - Characters_Kusudama_Miss = new CTexture[OpenTaiko.Skin.Characters_Ptn][]; - Characters_Title_Entry = new CTexture[OpenTaiko.Skin.Characters_Ptn][]; - Characters_Title_Normal = new CTexture[OpenTaiko.Skin.Characters_Ptn][]; - Characters_Result_Clear = new CTexture[OpenTaiko.Skin.Characters_Ptn][]; - Characters_Result_Failed = new CTexture[OpenTaiko.Skin.Characters_Ptn][]; - Characters_Result_Failed_In = new CTexture[OpenTaiko.Skin.Characters_Ptn][]; - Characters_Result_Normal = new CTexture[OpenTaiko.Skin.Characters_Ptn][]; - Characters_Menu_Loop = new CTexture[OpenTaiko.Skin.Characters_Ptn][]; - Characters_Menu_Start = new CTexture[OpenTaiko.Skin.Characters_Ptn][]; - Characters_Menu_Select = new CTexture[OpenTaiko.Skin.Characters_Ptn][]; - Characters_Menu_Wait = new CTexture[OpenTaiko.Skin.Characters_Ptn][]; - Characters_Tower_Standing = new CTexture[OpenTaiko.Skin.Characters_Ptn][]; - Characters_Tower_Climbing = new CTexture[OpenTaiko.Skin.Characters_Ptn][]; - Characters_Tower_Running = new CTexture[OpenTaiko.Skin.Characters_Ptn][]; - Characters_Tower_Clear = new CTexture[OpenTaiko.Skin.Characters_Ptn][]; - Characters_Tower_Fail = new CTexture[OpenTaiko.Skin.Characters_Ptn][]; - Characters_Tower_Standing_Tired = new CTexture[OpenTaiko.Skin.Characters_Ptn][]; - Characters_Tower_Climbing_Tired = new CTexture[OpenTaiko.Skin.Characters_Ptn][]; - Characters_Tower_Running_Tired = new CTexture[OpenTaiko.Skin.Characters_Ptn][]; - Characters_Tower_Clear_Tired = new CTexture[OpenTaiko.Skin.Characters_Ptn][]; - - OpenTaiko.Skin.Characters_DirName = new string[OpenTaiko.Skin.Characters_Ptn]; - OpenTaiko.Skin.Characters_Normal_Ptn = new int[OpenTaiko.Skin.Characters_Ptn]; - OpenTaiko.Skin.Characters_Normal_Missed_Ptn = new int[OpenTaiko.Skin.Characters_Ptn]; - OpenTaiko.Skin.Characters_Normal_MissedDown_Ptn = new int[OpenTaiko.Skin.Characters_Ptn]; - OpenTaiko.Skin.Characters_Normal_Cleared_Ptn = new int[OpenTaiko.Skin.Characters_Ptn]; - OpenTaiko.Skin.Characters_Normal_Maxed_Ptn = new int[OpenTaiko.Skin.Characters_Ptn]; - OpenTaiko.Skin.Characters_MissIn_Ptn = new int[OpenTaiko.Skin.Characters_Ptn]; - OpenTaiko.Skin.Characters_MissDownIn_Ptn = new int[OpenTaiko.Skin.Characters_Ptn]; - OpenTaiko.Skin.Characters_GoGoTime_Ptn = new int[OpenTaiko.Skin.Characters_Ptn]; - OpenTaiko.Skin.Characters_GoGoTime_Maxed_Ptn = new int[OpenTaiko.Skin.Characters_Ptn]; - OpenTaiko.Skin.Characters_10Combo_Ptn = new int[OpenTaiko.Skin.Characters_Ptn]; - OpenTaiko.Skin.Characters_10Combo_Clear_Ptn = new int[OpenTaiko.Skin.Characters_Ptn]; - OpenTaiko.Skin.Characters_10Combo_Maxed_Ptn = new int[OpenTaiko.Skin.Characters_Ptn]; - OpenTaiko.Skin.Characters_GoGoStart_Ptn = new int[OpenTaiko.Skin.Characters_Ptn]; - OpenTaiko.Skin.Characters_GoGoStart_Clear_Ptn = new int[OpenTaiko.Skin.Characters_Ptn]; - OpenTaiko.Skin.Characters_GoGoStart_Maxed_Ptn = new int[OpenTaiko.Skin.Characters_Ptn]; - OpenTaiko.Skin.Characters_Become_Cleared_Ptn = new int[OpenTaiko.Skin.Characters_Ptn]; - OpenTaiko.Skin.Characters_Become_Maxed_Ptn = new int[OpenTaiko.Skin.Characters_Ptn]; - OpenTaiko.Skin.Characters_SoulOut_Ptn = new int[OpenTaiko.Skin.Characters_Ptn]; - OpenTaiko.Skin.Characters_ClearOut_Ptn = new int[OpenTaiko.Skin.Characters_Ptn]; - OpenTaiko.Skin.Characters_Return_Ptn = new int[OpenTaiko.Skin.Characters_Ptn]; - OpenTaiko.Skin.Characters_Balloon_Breaking_Ptn = new int[OpenTaiko.Skin.Characters_Ptn]; - OpenTaiko.Skin.Characters_Balloon_Broke_Ptn = new int[OpenTaiko.Skin.Characters_Ptn]; - OpenTaiko.Skin.Characters_Balloon_Miss_Ptn = new int[OpenTaiko.Skin.Characters_Ptn]; - OpenTaiko.Skin.Characters_Kusudama_Idle_Ptn = new int[OpenTaiko.Skin.Characters_Ptn]; - OpenTaiko.Skin.Characters_Kusudama_Breaking_Ptn = new int[OpenTaiko.Skin.Characters_Ptn]; - OpenTaiko.Skin.Characters_Kusudama_Broke_Ptn = new int[OpenTaiko.Skin.Characters_Ptn]; - OpenTaiko.Skin.Characters_Kusudama_Miss_Ptn = new int[OpenTaiko.Skin.Characters_Ptn]; - OpenTaiko.Skin.Characters_Title_Entry_Ptn = new int[OpenTaiko.Skin.Characters_Ptn]; - OpenTaiko.Skin.Characters_Title_Normal_Ptn = new int[OpenTaiko.Skin.Characters_Ptn]; - OpenTaiko.Skin.Characters_Result_Clear_Ptn = new int[OpenTaiko.Skin.Characters_Ptn]; - OpenTaiko.Skin.Characters_Result_Failed_Ptn = new int[OpenTaiko.Skin.Characters_Ptn]; - OpenTaiko.Skin.Characters_Result_Failed_In_Ptn = new int[OpenTaiko.Skin.Characters_Ptn]; - OpenTaiko.Skin.Characters_Result_Normal_Ptn = new int[OpenTaiko.Skin.Characters_Ptn]; - OpenTaiko.Skin.Characters_Menu_Loop_Ptn = new int[OpenTaiko.Skin.Characters_Ptn]; - OpenTaiko.Skin.Characters_Menu_Start_Ptn = new int[OpenTaiko.Skin.Characters_Ptn]; - OpenTaiko.Skin.Characters_Menu_Select_Ptn = new int[OpenTaiko.Skin.Characters_Ptn]; - OpenTaiko.Skin.Characters_Menu_Wait_Ptn = new int[OpenTaiko.Skin.Characters_Ptn]; - OpenTaiko.Skin.Characters_Tower_Standing_Ptn = new int[OpenTaiko.Skin.Characters_Ptn]; - OpenTaiko.Skin.Characters_Tower_Climbing_Ptn = new int[OpenTaiko.Skin.Characters_Ptn]; - OpenTaiko.Skin.Characters_Tower_Running_Ptn = new int[OpenTaiko.Skin.Characters_Ptn]; - OpenTaiko.Skin.Characters_Tower_Clear_Ptn = new int[OpenTaiko.Skin.Characters_Ptn]; - OpenTaiko.Skin.Characters_Tower_Fail_Ptn = new int[OpenTaiko.Skin.Characters_Ptn]; - OpenTaiko.Skin.Characters_Tower_Standing_Tired_Ptn = new int[OpenTaiko.Skin.Characters_Ptn]; - OpenTaiko.Skin.Characters_Tower_Climbing_Tired_Ptn = new int[OpenTaiko.Skin.Characters_Ptn]; - OpenTaiko.Skin.Characters_Tower_Running_Tired_Ptn = new int[OpenTaiko.Skin.Characters_Ptn]; - OpenTaiko.Skin.Characters_Tower_Clear_Tired_Ptn = new int[OpenTaiko.Skin.Characters_Ptn]; - OpenTaiko.Skin.Characters_Tower_Clear_IsLooping = new bool[OpenTaiko.Skin.Characters_Ptn]; - OpenTaiko.Skin.Characters_Tower_Clear_Tired_IsLooping = new bool[OpenTaiko.Skin.Characters_Ptn]; - OpenTaiko.Skin.Characters_Tower_Fail_IsLooping = new bool[OpenTaiko.Skin.Characters_Ptn]; - - OpenTaiko.Skin.Characters_Resolution = new int[OpenTaiko.Skin.Characters_Ptn][]; - OpenTaiko.Skin.Characters_Heya_Render_Offset = new int[OpenTaiko.Skin.Characters_Ptn][]; - OpenTaiko.Skin.Characters_UseResult1P = new bool[OpenTaiko.Skin.Characters_Ptn]; - OpenTaiko.Skin.Characters_X = new int[OpenTaiko.Skin.Characters_Ptn][]; - OpenTaiko.Skin.Characters_Y = new int[OpenTaiko.Skin.Characters_Ptn][]; - OpenTaiko.Skin.Characters_4P = new int[OpenTaiko.Skin.Characters_Ptn][]; - OpenTaiko.Skin.Characters_5P = new int[OpenTaiko.Skin.Characters_Ptn][]; - OpenTaiko.Skin.Characters_X_AI = new int[OpenTaiko.Skin.Characters_Ptn][]; - OpenTaiko.Skin.Characters_Y_AI = new int[OpenTaiko.Skin.Characters_Ptn][]; - OpenTaiko.Skin.Characters_Balloon_X = new int[OpenTaiko.Skin.Characters_Ptn][]; - OpenTaiko.Skin.Characters_Balloon_Y = new int[OpenTaiko.Skin.Characters_Ptn][]; - OpenTaiko.Skin.Characters_Balloon_4P = new int[OpenTaiko.Skin.Characters_Ptn][]; - OpenTaiko.Skin.Characters_Balloon_5P = new int[OpenTaiko.Skin.Characters_Ptn][]; - OpenTaiko.Skin.Characters_Kusudama_X = new int[OpenTaiko.Skin.Characters_Ptn][]; - OpenTaiko.Skin.Characters_Kusudama_Y = new int[OpenTaiko.Skin.Characters_Ptn][]; - OpenTaiko.Skin.Characters_Motion_Normal = new int[OpenTaiko.Skin.Characters_Ptn][]; - OpenTaiko.Skin.Characters_Motion_10Combo = new int[OpenTaiko.Skin.Characters_Ptn][]; - OpenTaiko.Skin.Characters_Motion_10Combo_Clear = new int[OpenTaiko.Skin.Characters_Ptn][]; - OpenTaiko.Skin.Characters_Motion_10ComboMax = new int[OpenTaiko.Skin.Characters_Ptn][]; - OpenTaiko.Skin.Characters_Motion_Miss = new int[OpenTaiko.Skin.Characters_Ptn][]; - OpenTaiko.Skin.Characters_Motion_MissDown = new int[OpenTaiko.Skin.Characters_Ptn][]; - OpenTaiko.Skin.Characters_Motion_ClearIn = new int[OpenTaiko.Skin.Characters_Ptn][]; - OpenTaiko.Skin.Characters_Motion_Clear = new int[OpenTaiko.Skin.Characters_Ptn][]; - OpenTaiko.Skin.Characters_Motion_ClearMax = new int[OpenTaiko.Skin.Characters_Ptn][]; - OpenTaiko.Skin.Characters_Motion_MissIn = new int[OpenTaiko.Skin.Characters_Ptn][]; - OpenTaiko.Skin.Characters_Motion_MissDownIn = new int[OpenTaiko.Skin.Characters_Ptn][]; - OpenTaiko.Skin.Characters_Motion_GoGoStart = new int[OpenTaiko.Skin.Characters_Ptn][]; - OpenTaiko.Skin.Characters_Motion_GoGoStart_Clear = new int[OpenTaiko.Skin.Characters_Ptn][]; - OpenTaiko.Skin.Characters_Motion_GoGoStartMax = new int[OpenTaiko.Skin.Characters_Ptn][]; - OpenTaiko.Skin.Characters_Motion_GoGo = new int[OpenTaiko.Skin.Characters_Ptn][]; - OpenTaiko.Skin.Characters_Motion_GoGoMax = new int[OpenTaiko.Skin.Characters_Ptn][]; - OpenTaiko.Skin.Characters_Motion_SoulIn = new int[OpenTaiko.Skin.Characters_Ptn][]; - OpenTaiko.Skin.Characters_Motion_SoulOut = new int[OpenTaiko.Skin.Characters_Ptn][]; - OpenTaiko.Skin.Characters_Motion_ClearOut = new int[OpenTaiko.Skin.Characters_Ptn][]; - OpenTaiko.Skin.Characters_Motion_Return = new int[OpenTaiko.Skin.Characters_Ptn][]; - /* - TJAPlayer3.Skin.Characters_Motion_Tower_Standing = new int[TJAPlayer3.Skin.Characters_Ptn][]; - TJAPlayer3.Skin.Characters_Motion_Tower_Climbing = new int[TJAPlayer3.Skin.Characters_Ptn][]; - TJAPlayer3.Skin.Characters_Motion_Tower_Running = new int[TJAPlayer3.Skin.Characters_Ptn][]; - TJAPlayer3.Skin.Characters_Motion_Tower_Clear = new int[TJAPlayer3.Skin.Characters_Ptn][]; - TJAPlayer3.Skin.Characters_Motion_Tower_Fail = new int[TJAPlayer3.Skin.Characters_Ptn][]; - TJAPlayer3.Skin.Characters_Motion_Tower_Standing_Tired = new int[TJAPlayer3.Skin.Characters_Ptn][]; - TJAPlayer3.Skin.Characters_Motion_Tower_Climbing_Tired = new int[TJAPlayer3.Skin.Characters_Ptn][]; - TJAPlayer3.Skin.Characters_Motion_Tower_Running_Tired = new int[TJAPlayer3.Skin.Characters_Ptn][]; - TJAPlayer3.Skin.Characters_Motion_Tower_Clear_Tired = new int[TJAPlayer3.Skin.Characters_Ptn][]; - */ - OpenTaiko.Skin.Characters_Beat_Normal = new float[OpenTaiko.Skin.Characters_Ptn]; - OpenTaiko.Skin.Characters_Beat_Miss = new float[OpenTaiko.Skin.Characters_Ptn]; - OpenTaiko.Skin.Characters_Beat_MissDown = new float[OpenTaiko.Skin.Characters_Ptn]; - OpenTaiko.Skin.Characters_Beat_Clear = new float[OpenTaiko.Skin.Characters_Ptn]; - OpenTaiko.Skin.Characters_Beat_GoGo = new float[OpenTaiko.Skin.Characters_Ptn]; - OpenTaiko.Skin.Characters_Beat_10Combo = new float[OpenTaiko.Skin.Characters_Ptn]; - OpenTaiko.Skin.Characters_Beat_10Combo_Clear = new float[OpenTaiko.Skin.Characters_Ptn]; - OpenTaiko.Skin.Characters_Beat_10ComboMax = new float[OpenTaiko.Skin.Characters_Ptn]; - OpenTaiko.Skin.Characters_Beat_ClearIn = new float[OpenTaiko.Skin.Characters_Ptn]; - OpenTaiko.Skin.Characters_Beat_ClearMax = new float[OpenTaiko.Skin.Characters_Ptn]; - OpenTaiko.Skin.Characters_Beat_MissIn = new float[OpenTaiko.Skin.Characters_Ptn]; - OpenTaiko.Skin.Characters_Beat_MissDownIn = new float[OpenTaiko.Skin.Characters_Ptn]; - OpenTaiko.Skin.Characters_Beat_GoGoStart = new float[OpenTaiko.Skin.Characters_Ptn]; - OpenTaiko.Skin.Characters_Beat_GoGoStart_Clear = new float[OpenTaiko.Skin.Characters_Ptn]; - OpenTaiko.Skin.Characters_Beat_GoGoStartMax = new float[OpenTaiko.Skin.Characters_Ptn]; - OpenTaiko.Skin.Characters_Beat_GoGoMax = new float[OpenTaiko.Skin.Characters_Ptn]; - OpenTaiko.Skin.Characters_Beat_SoulIn = new float[OpenTaiko.Skin.Characters_Ptn]; - OpenTaiko.Skin.Characters_Beat_SoulOut = new float[OpenTaiko.Skin.Characters_Ptn]; - OpenTaiko.Skin.Characters_Beat_ClearOut = new float[OpenTaiko.Skin.Characters_Ptn]; - OpenTaiko.Skin.Characters_Beat_Return = new float[OpenTaiko.Skin.Characters_Ptn]; - OpenTaiko.Skin.Characters_Beat_Tower_Standing = new float[OpenTaiko.Skin.Characters_Ptn]; - OpenTaiko.Skin.Characters_Beat_Tower_Clear = new float[OpenTaiko.Skin.Characters_Ptn]; - OpenTaiko.Skin.Characters_Beat_Tower_Fail = new float[OpenTaiko.Skin.Characters_Ptn]; - OpenTaiko.Skin.Characters_Beat_Tower_Standing_Tired = new float[OpenTaiko.Skin.Characters_Ptn]; - OpenTaiko.Skin.Characters_Beat_Tower_Clear_Tired = new float[OpenTaiko.Skin.Characters_Ptn]; - OpenTaiko.Skin.Characters_Balloon_Timer = new int[OpenTaiko.Skin.Characters_Ptn]; - OpenTaiko.Skin.Characters_Balloon_Delay = new int[OpenTaiko.Skin.Characters_Ptn]; - OpenTaiko.Skin.Characters_Balloon_FadeOut = new int[OpenTaiko.Skin.Characters_Ptn]; - OpenTaiko.Skin.Characters_Title_Entry_AnimationDuration = new int[OpenTaiko.Skin.Characters_Ptn]; - OpenTaiko.Skin.Characters_Title_Normal_AnimationDuration = new int[OpenTaiko.Skin.Characters_Ptn]; - OpenTaiko.Skin.Characters_Menu_Loop_AnimationDuration = new int[OpenTaiko.Skin.Characters_Ptn]; - OpenTaiko.Skin.Characters_Menu_Select_AnimationDuration = new int[OpenTaiko.Skin.Characters_Ptn]; - OpenTaiko.Skin.Characters_Menu_Start_AnimationDuration = new int[OpenTaiko.Skin.Characters_Ptn]; - OpenTaiko.Skin.Characters_Menu_Wait_AnimationDuration = new int[OpenTaiko.Skin.Characters_Ptn]; - OpenTaiko.Skin.Characters_Result_Normal_AnimationDuration = new int[OpenTaiko.Skin.Characters_Ptn]; - OpenTaiko.Skin.Characters_Result_Clear_AnimationDuration = new int[OpenTaiko.Skin.Characters_Ptn]; - OpenTaiko.Skin.Characters_Result_Failed_In_AnimationDuration = new int[OpenTaiko.Skin.Characters_Ptn]; - OpenTaiko.Skin.Characters_Result_Failed_AnimationDuration = new int[OpenTaiko.Skin.Characters_Ptn]; - - for (int i = 0; i < charaDirs.Length; i++) { - OpenTaiko.Skin.Characters_DirName[i] = System.IO.Path.GetFileName(charaDirs[i]); - } - - #endregion - - for (int i = 0; i < 5; i++) { - OpenTaiko.SaveFileInstances[i].tReindexCharacter(OpenTaiko.Skin.Characters_DirName); - this.ReloadCharacter(-1, OpenTaiko.SaveFileInstances[i].data.Character, i, true); - } - - - for (int i = 0; i < OpenTaiko.Skin.Characters_Ptn; i++) { - Characters_Heya_Preview[i] = TxCGlobal(CHARACTERS + OpenTaiko.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Normal{Path.DirectorySeparatorChar}0.png"); - Characters_Heya_Render[i] = TxCGlobal(CHARACTERS + OpenTaiko.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Render.png"); - Characters_Result_Clear_1P[i] = TxCGlobal(CHARACTERS + OpenTaiko.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Result_Clear_1P.png"); - Characters_Result_Failed_1P[i] = TxCGlobal(CHARACTERS + OpenTaiko.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Result_Failed_1P.png"); - Characters_Result_Clear_2P[i] = TxCGlobal(CHARACTERS + OpenTaiko.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Result_Clear_2P.png"); - Characters_Result_Failed_2P[i] = TxCGlobal(CHARACTERS + OpenTaiko.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Result_Failed_2P.png"); - - OpenTaiko.Skin.Characters_Resolution[i] = new int[] { 1280, 720 }; - OpenTaiko.Skin.Characters_Heya_Render_Offset[i] = new int[] { 0, 0 }; - OpenTaiko.Skin.Characters_UseResult1P[i] = false; - - - var _str = ""; - OpenTaiko.Skin.LoadSkinConfigFromFile(charaDirs[i] + @$"{Path.DirectorySeparatorChar}CharaConfig.txt", ref _str); - - string[] delimiter = { "\n", "\r" }; - string[] strSingleLine = _str.Split(delimiter, StringSplitOptions.RemoveEmptyEntries); - - foreach (string line in strSingleLine) { - if (line.StartsWith("Chara_Resolution=")) // required for Heya resolution compatibility - { - string[] values = line.Substring(17).Trim().Split(','); - OpenTaiko.Skin.Characters_Resolution[i][0] = int.Parse(values[0]); - OpenTaiko.Skin.Characters_Resolution[i][1] = int.Parse(values[1]); - } else if (line.StartsWith("Heya_Chara_Render_Offset=")) { - string[] values = line.Substring(25).Trim().Split(','); - OpenTaiko.Skin.Characters_Heya_Render_Offset[i][0] = int.Parse(values[0]); - OpenTaiko.Skin.Characters_Heya_Render_Offset[i][1] = int.Parse(values[1]); - } else if (line.StartsWith("Result_UseResult1P=")) { - OpenTaiko.Skin.Characters_UseResult1P[i] = FDK.CConversion.bONorOFF(line.Substring(19).Trim()[0]); - } - } - - Characters[i] = new CCharacter(charaDirs[i], i); - } - - - #endregion - - #region [12_OnlineLounge] - - //OnlineLounge_Background = TxC(ONLINELOUNGE + @"Background.png"); - OnlineLounge_Box = TxC(ONLINELOUNGE + @"Box.png"); - OnlineLounge_Center_Menu_Bar = TxC(ONLINELOUNGE + @"Center_Menu_Bar.png"); - OnlineLounge_Center_Menu_Box_Slot = TxC(ONLINELOUNGE + @"Center_Menu_Box_Slot.png"); - OnlineLounge_Side_Menu = TxC(ONLINELOUNGE + @"Side_Menu.png"); - OnlineLounge_Context = TxC(ONLINELOUNGE + @"Context.png"); - OnlineLounge_Song_Box = TxC(ONLINELOUNGE + @"Song_Box.png"); - OnlineLounge_Return_Box = TxC(ONLINELOUNGE + @"Return_Box.png"); - - #endregion - - #region [13_TowerSelect] - - TowerSelect_Tower = TxC(TOWERSELECT + @"Tower.png"); - - #endregion - - if (OpenTaiko.ConfigIni.PreAssetsLoading) { - foreach (var act in OpenTaiko.app.listトップレベルActivities) { - act.CreateManagedResource(); - act.CreateUnmanagedResource(); - } - } - } - - public int[] CreateNumberedArrayFromInt(int total) { - int[] array = new int[total]; - for (int i = 0; i < total; i++) { - array[i] = i; - } - return array; - } - - public CSkin.CSystemSound VoiceSelectOggOrWav(string basePath) { - if (File.Exists(basePath + @$".ogg")) - return new CSkin.CSystemSound(basePath + @$".ogg", false, false, true, ESoundGroup.Voice); - else - return new CSkin.CSystemSound(basePath + @$".wav", false, false, true, ESoundGroup.Voice); - } - - public void ReloadCharacter(int old, int newC, int player, bool primary = false) { - if (old == newC) - return; - - if (old >= 0 && - (OpenTaiko.SaveFileInstances[0].data.Character != old || player == 0) && - (OpenTaiko.SaveFileInstances[1].data.Character != old || player == 1) && - (OpenTaiko.SaveFileInstances[2].data.Character != old || player == 2) && - (OpenTaiko.SaveFileInstances[3].data.Character != old || player == 3) && - (OpenTaiko.SaveFileInstances[4].data.Character != old || player == 4)) { - int i = old; - - #region [Dispose the previous character] - - for (int j = 0; j < OpenTaiko.Skin.Characters_Menu_Loop_Ptn[i]; j++) - Characters_Menu_Loop[i][j]?.Dispose(); - - for (int j = 0; j < OpenTaiko.Skin.Characters_Menu_Start_Ptn[i]; j++) - Characters_Menu_Start[i][j]?.Dispose(); - - for (int j = 0; j < OpenTaiko.Skin.Characters_Menu_Select_Ptn[i]; j++) - Characters_Menu_Select[i][j]?.Dispose(); - - for (int j = 0; j < OpenTaiko.Skin.Characters_Menu_Wait_Ptn[i]; j++) - Characters_Menu_Wait[i][j]?.Dispose(); - - for (int j = 0; j < OpenTaiko.Skin.Characters_Result_Normal_Ptn[i]; j++) - Characters_Result_Normal[i][j]?.Dispose(); - - for (int j = 0; j < OpenTaiko.Skin.Characters_Result_Failed_In_Ptn[i]; j++) - Characters_Result_Failed_In[i][j]?.Dispose(); - - for (int j = 0; j < OpenTaiko.Skin.Characters_Result_Failed_Ptn[i]; j++) - Characters_Result_Failed[i][j]?.Dispose(); - - for (int j = 0; j < OpenTaiko.Skin.Characters_Result_Clear_Ptn[i]; j++) - Characters_Result_Clear[i][j]?.Dispose(); - - for (int j = 0; j < OpenTaiko.Skin.Characters_Title_Normal_Ptn[i]; j++) - Characters_Title_Normal[i][j]?.Dispose(); - - for (int j = 0; j < OpenTaiko.Skin.Characters_Title_Entry_Ptn[i]; j++) - Characters_Title_Entry[i][j]?.Dispose(); - - for (int j = 0; j < OpenTaiko.Skin.Characters_Normal_Ptn[i]; j++) - Characters_Normal[i][j]?.Dispose(); - - for (int j = 0; j < OpenTaiko.Skin.Characters_Normal_Missed_Ptn[i]; j++) - Characters_Normal_Missed[i][j]?.Dispose(); - - for (int j = 0; j < OpenTaiko.Skin.Characters_Normal_MissedDown_Ptn[i]; j++) - Characters_Normal_MissedDown[i][j]?.Dispose(); - - for (int j = 0; j < OpenTaiko.Skin.Characters_Normal_Cleared_Ptn[i]; j++) - Characters_Normal_Cleared[i][j]?.Dispose(); - - for (int j = 0; j < OpenTaiko.Skin.Characters_Normal_Maxed_Ptn[i]; j++) - Characters_Normal_Maxed[i][j]?.Dispose(); - - for (int j = 0; j < OpenTaiko.Skin.Characters_MissIn_Ptn[i]; j++) - Characters_MissIn[i][j]?.Dispose(); - - for (int j = 0; j < OpenTaiko.Skin.Characters_MissDownIn_Ptn[i]; j++) - Characters_MissDownIn[i][j]?.Dispose(); - - for (int j = 0; j < OpenTaiko.Skin.Characters_GoGoTime_Ptn[i]; j++) - Characters_GoGoTime[i][j]?.Dispose(); - - for (int j = 0; j < OpenTaiko.Skin.Characters_GoGoTime_Maxed_Ptn[i]; j++) - Characters_GoGoTime_Maxed[i][j]?.Dispose(); - - for (int j = 0; j < OpenTaiko.Skin.Characters_GoGoStart_Ptn[i]; j++) - Characters_GoGoStart[i][j]?.Dispose(); - - for (int j = 0; j < OpenTaiko.Skin.Characters_GoGoStart_Clear_Ptn[i]; j++) - Characters_GoGoStart_Clear[i][j]?.Dispose(); - - for (int j = 0; j < OpenTaiko.Skin.Characters_GoGoStart_Maxed_Ptn[i]; j++) - Characters_GoGoStart_Maxed[i][j]?.Dispose(); - - for (int j = 0; j < OpenTaiko.Skin.Characters_10Combo_Ptn[i]; j++) - Characters_10Combo[i][j]?.Dispose(); - - for (int j = 0; j < OpenTaiko.Skin.Characters_10Combo_Clear_Ptn[i]; j++) - Characters_10Combo_Clear[i][j]?.Dispose(); - - for (int j = 0; j < OpenTaiko.Skin.Characters_10Combo_Maxed_Ptn[i]; j++) - Characters_10Combo_Maxed[i][j]?.Dispose(); - - for (int j = 0; j < OpenTaiko.Skin.Characters_Become_Cleared_Ptn[i]; j++) - Characters_Become_Cleared[i][j]?.Dispose(); - - for (int j = 0; j < OpenTaiko.Skin.Characters_Become_Maxed_Ptn[i]; j++) - Characters_Become_Maxed[i][j]?.Dispose(); - - for (int j = 0; j < OpenTaiko.Skin.Characters_SoulOut_Ptn[i]; j++) - Characters_SoulOut[i][j]?.Dispose(); - - for (int j = 0; j < OpenTaiko.Skin.Characters_ClearOut_Ptn[i]; j++) - Characters_ClearOut[i][j]?.Dispose(); - - for (int j = 0; j < OpenTaiko.Skin.Characters_Return_Ptn[i]; j++) - Characters_Return[i][j]?.Dispose(); - - for (int j = 0; j < OpenTaiko.Skin.Characters_Balloon_Breaking_Ptn[i]; j++) - Characters_Balloon_Breaking[i][j]?.Dispose(); - - for (int j = 0; j < OpenTaiko.Skin.Characters_Balloon_Broke_Ptn[i]; j++) - Characters_Balloon_Broke[i][j]?.Dispose(); - - for (int j = 0; j < OpenTaiko.Skin.Characters_Balloon_Miss_Ptn[i]; j++) - Characters_Balloon_Miss[i][j]?.Dispose(); - - for (int j = 0; j < OpenTaiko.Skin.Characters_Kusudama_Idle_Ptn[i]; j++) - Characters_Kusudama_Idle[i][j]?.Dispose(); - - for (int j = 0; j < OpenTaiko.Skin.Characters_Kusudama_Breaking_Ptn[i]; j++) - Characters_Kusudama_Breaking[i][j]?.Dispose(); - - for (int j = 0; j < OpenTaiko.Skin.Characters_Kusudama_Broke_Ptn[i]; j++) - Characters_Kusudama_Broke[i][j]?.Dispose(); - - for (int j = 0; j < OpenTaiko.Skin.Characters_Kusudama_Miss_Ptn[i]; j++) - Characters_Kusudama_Miss[i][j]?.Dispose(); - - for (int j = 0; j < OpenTaiko.Skin.Characters_Tower_Standing_Ptn[i]; j++) - Characters_Tower_Standing[i][j]?.Dispose(); - - for (int j = 0; j < OpenTaiko.Skin.Characters_Tower_Climbing_Ptn[i]; j++) - Characters_Tower_Climbing[i][j]?.Dispose(); - - for (int j = 0; j < OpenTaiko.Skin.Characters_Tower_Running_Ptn[i]; j++) - Characters_Tower_Running[i][j]?.Dispose(); - - for (int j = 0; j < OpenTaiko.Skin.Characters_Tower_Clear_Ptn[i]; j++) - Characters_Tower_Clear[i][j]?.Dispose(); - - for (int j = 0; j < OpenTaiko.Skin.Characters_Tower_Fail_Ptn[i]; j++) - Characters_Tower_Fail[i][j]?.Dispose(); - - for (int j = 0; j < OpenTaiko.Skin.Characters_Tower_Standing_Tired_Ptn[i]; j++) - Characters_Tower_Standing_Tired[i][j]?.Dispose(); - - for (int j = 0; j < OpenTaiko.Skin.Characters_Tower_Climbing_Tired_Ptn[i]; j++) - Characters_Tower_Climbing_Tired[i][j]?.Dispose(); - - for (int j = 0; j < OpenTaiko.Skin.Characters_Tower_Running_Tired_Ptn[i]; j++) - Characters_Tower_Running_Tired[i][j]?.Dispose(); - - for (int j = 0; j < OpenTaiko.Skin.Characters_Tower_Clear_Tired_Ptn[i]; j++) - Characters_Tower_Clear_Tired[i][j]?.Dispose(); - #endregion - } - - string charaPath = OpenTaiko.strEXEのあるフォルダ + GLOBAL + CHARACTERS + OpenTaiko.Skin.Characters_DirName[newC]; - - if ((newC >= 0 && - OpenTaiko.SaveFileInstances[0].data.Character != newC && - OpenTaiko.SaveFileInstances[1].data.Character != newC && - OpenTaiko.SaveFileInstances[2].data.Character != newC && - OpenTaiko.SaveFileInstances[3].data.Character != newC && - OpenTaiko.SaveFileInstances[4].data.Character != newC) || primary) { - int i = newC; - - #region [Allocate the new character] - - #region [Character individual values count initialisation] - - OpenTaiko.Skin.Characters_Normal_Ptn[i] = OpenTaiko.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Normal{Path.DirectorySeparatorChar}"); - OpenTaiko.Skin.Characters_Normal_Missed_Ptn[i] = OpenTaiko.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Miss{Path.DirectorySeparatorChar}"); - OpenTaiko.Skin.Characters_Normal_MissedDown_Ptn[i] = OpenTaiko.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}MissDown{Path.DirectorySeparatorChar}"); - OpenTaiko.Skin.Characters_MissIn_Ptn[i] = OpenTaiko.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}MissIn{Path.DirectorySeparatorChar}"); - OpenTaiko.Skin.Characters_MissDownIn_Ptn[i] = OpenTaiko.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}MissDownIn{Path.DirectorySeparatorChar}"); - OpenTaiko.Skin.Characters_Normal_Cleared_Ptn[i] = OpenTaiko.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Clear{Path.DirectorySeparatorChar}"); - OpenTaiko.Skin.Characters_Normal_Maxed_Ptn[i] = OpenTaiko.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Clear_Max{Path.DirectorySeparatorChar}"); - OpenTaiko.Skin.Characters_GoGoTime_Ptn[i] = OpenTaiko.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}GoGo{Path.DirectorySeparatorChar}"); - OpenTaiko.Skin.Characters_GoGoTime_Maxed_Ptn[i] = OpenTaiko.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}GoGo_Max{Path.DirectorySeparatorChar}"); - OpenTaiko.Skin.Characters_10Combo_Ptn[i] = OpenTaiko.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}10combo{Path.DirectorySeparatorChar}"); - OpenTaiko.Skin.Characters_10Combo_Clear_Ptn[i] = OpenTaiko.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}10combo_Clear{Path.DirectorySeparatorChar}"); - OpenTaiko.Skin.Characters_10Combo_Maxed_Ptn[i] = OpenTaiko.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}10combo_Max{Path.DirectorySeparatorChar}"); - OpenTaiko.Skin.Characters_GoGoStart_Ptn[i] = OpenTaiko.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}GoGoStart{Path.DirectorySeparatorChar}"); - OpenTaiko.Skin.Characters_GoGoStart_Clear_Ptn[i] = OpenTaiko.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}GoGoStart_Clear{Path.DirectorySeparatorChar}"); - OpenTaiko.Skin.Characters_GoGoStart_Maxed_Ptn[i] = OpenTaiko.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}GoGoStart_Max{Path.DirectorySeparatorChar}"); - OpenTaiko.Skin.Characters_Become_Cleared_Ptn[i] = OpenTaiko.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Clearin{Path.DirectorySeparatorChar}"); - OpenTaiko.Skin.Characters_Become_Maxed_Ptn[i] = OpenTaiko.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Soulin{Path.DirectorySeparatorChar}"); - OpenTaiko.Skin.Characters_SoulOut_Ptn[i] = OpenTaiko.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}SoulOut{Path.DirectorySeparatorChar}"); - OpenTaiko.Skin.Characters_ClearOut_Ptn[i] = OpenTaiko.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}ClearOut{Path.DirectorySeparatorChar}"); - OpenTaiko.Skin.Characters_Return_Ptn[i] = OpenTaiko.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Return{Path.DirectorySeparatorChar}"); - OpenTaiko.Skin.Characters_Balloon_Breaking_Ptn[i] = OpenTaiko.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Balloon_Breaking{Path.DirectorySeparatorChar}"); - OpenTaiko.Skin.Characters_Balloon_Broke_Ptn[i] = OpenTaiko.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Balloon_Broke{Path.DirectorySeparatorChar}"); - OpenTaiko.Skin.Characters_Balloon_Miss_Ptn[i] = OpenTaiko.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Balloon_Miss{Path.DirectorySeparatorChar}"); - OpenTaiko.Skin.Characters_Kusudama_Idle_Ptn[i] = OpenTaiko.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Kusudama_Idle{Path.DirectorySeparatorChar}"); - OpenTaiko.Skin.Characters_Kusudama_Breaking_Ptn[i] = OpenTaiko.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Kusudama_Breaking{Path.DirectorySeparatorChar}"); - OpenTaiko.Skin.Characters_Kusudama_Broke_Ptn[i] = OpenTaiko.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Kusudama_Broke{Path.DirectorySeparatorChar}"); - OpenTaiko.Skin.Characters_Kusudama_Miss_Ptn[i] = OpenTaiko.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Kusudama_Miss{Path.DirectorySeparatorChar}"); - OpenTaiko.Skin.Characters_Title_Entry_Ptn[i] = OpenTaiko.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Title_Entry{Path.DirectorySeparatorChar}"); - OpenTaiko.Skin.Characters_Title_Normal_Ptn[i] = OpenTaiko.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Title_Normal{Path.DirectorySeparatorChar}"); - OpenTaiko.Skin.Characters_Menu_Loop_Ptn[i] = OpenTaiko.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Menu_Loop{Path.DirectorySeparatorChar}"); - OpenTaiko.Skin.Characters_Menu_Select_Ptn[i] = OpenTaiko.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Menu_Select{Path.DirectorySeparatorChar}"); - OpenTaiko.Skin.Characters_Menu_Start_Ptn[i] = OpenTaiko.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Menu_Start{Path.DirectorySeparatorChar}"); - OpenTaiko.Skin.Characters_Menu_Wait_Ptn[i] = OpenTaiko.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Menu_Wait{Path.DirectorySeparatorChar}"); - OpenTaiko.Skin.Characters_Result_Clear_Ptn[i] = OpenTaiko.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Result_Clear{Path.DirectorySeparatorChar}"); - OpenTaiko.Skin.Characters_Result_Failed_Ptn[i] = OpenTaiko.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Result_Failed{Path.DirectorySeparatorChar}"); - OpenTaiko.Skin.Characters_Result_Failed_In_Ptn[i] = OpenTaiko.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Result_Failed_In{Path.DirectorySeparatorChar}"); - OpenTaiko.Skin.Characters_Result_Normal_Ptn[i] = OpenTaiko.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Result_Normal{Path.DirectorySeparatorChar}"); - OpenTaiko.Skin.Characters_Tower_Standing_Ptn[i] = OpenTaiko.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Tower_Char{Path.DirectorySeparatorChar}Standing{Path.DirectorySeparatorChar}"); - OpenTaiko.Skin.Characters_Tower_Climbing_Ptn[i] = OpenTaiko.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Tower_Char{Path.DirectorySeparatorChar}Climbing{Path.DirectorySeparatorChar}"); - OpenTaiko.Skin.Characters_Tower_Running_Ptn[i] = OpenTaiko.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Tower_Char{Path.DirectorySeparatorChar}Running{Path.DirectorySeparatorChar}"); - OpenTaiko.Skin.Characters_Tower_Clear_Ptn[i] = OpenTaiko.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Tower_Char{Path.DirectorySeparatorChar}Clear{Path.DirectorySeparatorChar}"); - OpenTaiko.Skin.Characters_Tower_Fail_Ptn[i] = OpenTaiko.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Tower_Char{Path.DirectorySeparatorChar}Fail{Path.DirectorySeparatorChar}"); - OpenTaiko.Skin.Characters_Tower_Standing_Tired_Ptn[i] = OpenTaiko.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Tower_Char{Path.DirectorySeparatorChar}Standing_Tired{Path.DirectorySeparatorChar}"); - OpenTaiko.Skin.Characters_Tower_Climbing_Tired_Ptn[i] = OpenTaiko.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Tower_Char{Path.DirectorySeparatorChar}Climbing_Tired{Path.DirectorySeparatorChar}"); - OpenTaiko.Skin.Characters_Tower_Running_Tired_Ptn[i] = OpenTaiko.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Tower_Char{Path.DirectorySeparatorChar}Running_Tired{Path.DirectorySeparatorChar}"); - OpenTaiko.Skin.Characters_Tower_Clear_Tired_Ptn[i] = OpenTaiko.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Tower_Char{Path.DirectorySeparatorChar}Clear_Tired{Path.DirectorySeparatorChar}"); - - Characters_Normal[i] = new CTexture[OpenTaiko.Skin.Characters_Normal_Ptn[i]]; - Characters_Normal_Missed[i] = new CTexture[OpenTaiko.Skin.Characters_Normal_Missed_Ptn[i]]; - Characters_Normal_MissedDown[i] = new CTexture[OpenTaiko.Skin.Characters_Normal_MissedDown_Ptn[i]]; - Characters_Normal_Cleared[i] = new CTexture[OpenTaiko.Skin.Characters_Normal_Cleared_Ptn[i]]; - Characters_Normal_Maxed[i] = new CTexture[OpenTaiko.Skin.Characters_Normal_Maxed_Ptn[i]]; - Characters_MissIn[i] = new CTexture[OpenTaiko.Skin.Characters_MissIn_Ptn[i]]; - Characters_MissDownIn[i] = new CTexture[OpenTaiko.Skin.Characters_MissDownIn_Ptn[i]]; - Characters_GoGoTime[i] = new CTexture[OpenTaiko.Skin.Characters_GoGoTime_Ptn[i]]; - Characters_GoGoTime_Maxed[i] = new CTexture[OpenTaiko.Skin.Characters_GoGoTime_Maxed_Ptn[i]]; - Characters_10Combo[i] = new CTexture[OpenTaiko.Skin.Characters_10Combo_Ptn[i]]; - Characters_10Combo_Clear[i] = new CTexture[OpenTaiko.Skin.Characters_10Combo_Clear_Ptn[i]]; - Characters_10Combo_Maxed[i] = new CTexture[OpenTaiko.Skin.Characters_10Combo_Maxed_Ptn[i]]; - Characters_GoGoStart[i] = new CTexture[OpenTaiko.Skin.Characters_GoGoStart_Ptn[i]]; - Characters_GoGoStart_Clear[i] = new CTexture[OpenTaiko.Skin.Characters_GoGoStart_Clear_Ptn[i]]; - Characters_GoGoStart_Maxed[i] = new CTexture[OpenTaiko.Skin.Characters_GoGoStart_Maxed_Ptn[i]]; - Characters_Become_Cleared[i] = new CTexture[OpenTaiko.Skin.Characters_Become_Cleared_Ptn[i]]; - Characters_Become_Maxed[i] = new CTexture[OpenTaiko.Skin.Characters_Become_Maxed_Ptn[i]]; - Characters_SoulOut[i] = new CTexture[OpenTaiko.Skin.Characters_SoulOut_Ptn[i]]; - Characters_ClearOut[i] = new CTexture[OpenTaiko.Skin.Characters_ClearOut_Ptn[i]]; - Characters_Return[i] = new CTexture[OpenTaiko.Skin.Characters_Return_Ptn[i]]; - Characters_Balloon_Breaking[i] = new CTexture[OpenTaiko.Skin.Characters_Balloon_Breaking_Ptn[i]]; - Characters_Balloon_Broke[i] = new CTexture[OpenTaiko.Skin.Characters_Balloon_Broke_Ptn[i]]; - Characters_Balloon_Miss[i] = new CTexture[OpenTaiko.Skin.Characters_Balloon_Miss_Ptn[i]]; - Characters_Kusudama_Idle[i] = new CTexture[OpenTaiko.Skin.Characters_Kusudama_Idle_Ptn[i]]; - Characters_Kusudama_Breaking[i] = new CTexture[OpenTaiko.Skin.Characters_Kusudama_Breaking_Ptn[i]]; - Characters_Kusudama_Broke[i] = new CTexture[OpenTaiko.Skin.Characters_Kusudama_Broke_Ptn[i]]; - Characters_Kusudama_Miss[i] = new CTexture[OpenTaiko.Skin.Characters_Kusudama_Miss_Ptn[i]]; - Characters_Title_Entry[i] = new CTexture[OpenTaiko.Skin.Characters_Title_Entry_Ptn[i]]; - Characters_Title_Normal[i] = new CTexture[OpenTaiko.Skin.Characters_Title_Normal_Ptn[i]]; - Characters_Result_Clear[i] = new CTexture[OpenTaiko.Skin.Characters_Result_Clear_Ptn[i]]; - Characters_Result_Failed[i] = new CTexture[OpenTaiko.Skin.Characters_Result_Failed_Ptn[i]]; - Characters_Result_Failed_In[i] = new CTexture[OpenTaiko.Skin.Characters_Result_Failed_In_Ptn[i]]; - Characters_Result_Normal[i] = new CTexture[OpenTaiko.Skin.Characters_Result_Normal_Ptn[i]]; - Characters_Menu_Loop[i] = new CTexture[OpenTaiko.Skin.Characters_Menu_Loop_Ptn[i]]; - Characters_Menu_Start[i] = new CTexture[OpenTaiko.Skin.Characters_Menu_Start_Ptn[i]]; - Characters_Menu_Select[i] = new CTexture[OpenTaiko.Skin.Characters_Menu_Select_Ptn[i]]; - Characters_Menu_Wait[i] = new CTexture[OpenTaiko.Skin.Characters_Menu_Wait_Ptn[i]]; - Characters_Tower_Standing[i] = new CTexture[OpenTaiko.Skin.Characters_Tower_Standing_Ptn[i]]; - Characters_Tower_Climbing[i] = new CTexture[OpenTaiko.Skin.Characters_Tower_Climbing_Ptn[i]]; - Characters_Tower_Running[i] = new CTexture[OpenTaiko.Skin.Characters_Tower_Running_Ptn[i]]; - Characters_Tower_Clear[i] = new CTexture[OpenTaiko.Skin.Characters_Tower_Clear_Ptn[i]]; - Characters_Tower_Fail[i] = new CTexture[OpenTaiko.Skin.Characters_Tower_Fail_Ptn[i]]; - Characters_Tower_Standing_Tired[i] = new CTexture[OpenTaiko.Skin.Characters_Tower_Standing_Tired_Ptn[i]]; - Characters_Tower_Climbing_Tired[i] = new CTexture[OpenTaiko.Skin.Characters_Tower_Climbing_Tired_Ptn[i]]; - Characters_Tower_Running_Tired[i] = new CTexture[OpenTaiko.Skin.Characters_Tower_Running_Tired_Ptn[i]]; - Characters_Tower_Clear_Tired[i] = new CTexture[OpenTaiko.Skin.Characters_Tower_Clear_Tired_Ptn[i]]; - - #endregion - - #region [Characters asset loading] - - for (int j = 0; j < OpenTaiko.Skin.Characters_Menu_Loop_Ptn[i]; j++) - Characters_Menu_Loop[i][j] = TxCGlobal(CHARACTERS + OpenTaiko.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Menu_Loop{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); - - for (int j = 0; j < OpenTaiko.Skin.Characters_Menu_Select_Ptn[i]; j++) - Characters_Menu_Select[i][j] = TxCGlobal(CHARACTERS + OpenTaiko.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Menu_Select{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); - - for (int j = 0; j < OpenTaiko.Skin.Characters_Menu_Start_Ptn[i]; j++) - Characters_Menu_Start[i][j] = TxCGlobal(CHARACTERS + OpenTaiko.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Menu_Start{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); - - for (int j = 0; j < OpenTaiko.Skin.Characters_Menu_Wait_Ptn[i]; j++) - Characters_Menu_Wait[i][j] = TxCGlobal(CHARACTERS + OpenTaiko.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Menu_Wait{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); - - for (int j = 0; j < OpenTaiko.Skin.Characters_Result_Normal_Ptn[i]; j++) - Characters_Result_Normal[i][j] = TxCGlobal(CHARACTERS + OpenTaiko.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Result_Normal{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); - - for (int j = 0; j < OpenTaiko.Skin.Characters_Result_Failed_In_Ptn[i]; j++) - Characters_Result_Failed_In[i][j] = TxCGlobal(CHARACTERS + OpenTaiko.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Result_Failed_In{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); - - for (int j = 0; j < OpenTaiko.Skin.Characters_Result_Failed_Ptn[i]; j++) - Characters_Result_Failed[i][j] = TxCGlobal(CHARACTERS + OpenTaiko.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Result_Failed{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); - - for (int j = 0; j < OpenTaiko.Skin.Characters_Result_Clear_Ptn[i]; j++) - Characters_Result_Clear[i][j] = TxCGlobal(CHARACTERS + OpenTaiko.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Result_Clear{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); - - for (int j = 0; j < OpenTaiko.Skin.Characters_Title_Normal_Ptn[i]; j++) - Characters_Title_Normal[i][j] = TxCGlobal(CHARACTERS + OpenTaiko.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Title_Normal{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); - - for (int j = 0; j < OpenTaiko.Skin.Characters_Title_Entry_Ptn[i]; j++) - Characters_Title_Entry[i][j] = TxCGlobal(CHARACTERS + OpenTaiko.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Title_Entry{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); - - for (int j = 0; j < OpenTaiko.Skin.Characters_Normal_Ptn[i]; j++) - Characters_Normal[i][j] = TxCGlobal(CHARACTERS + OpenTaiko.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Normal{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); - - for (int j = 0; j < OpenTaiko.Skin.Characters_Normal_Missed_Ptn[i]; j++) - Characters_Normal_Missed[i][j] = TxCGlobal(CHARACTERS + OpenTaiko.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Miss{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); - - for (int j = 0; j < OpenTaiko.Skin.Characters_Normal_MissedDown_Ptn[i]; j++) - Characters_Normal_MissedDown[i][j] = TxCGlobal(CHARACTERS + OpenTaiko.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}MissDown{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); - - for (int j = 0; j < OpenTaiko.Skin.Characters_Normal_Cleared_Ptn[i]; j++) - Characters_Normal_Cleared[i][j] = TxCGlobal(CHARACTERS + OpenTaiko.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Clear{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); - - for (int j = 0; j < OpenTaiko.Skin.Characters_Normal_Maxed_Ptn[i]; j++) - Characters_Normal_Maxed[i][j] = TxCGlobal(CHARACTERS + OpenTaiko.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Clear_Max{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); - - for (int j = 0; j < OpenTaiko.Skin.Characters_MissIn_Ptn[i]; j++) - Characters_MissIn[i][j] = TxCGlobal(CHARACTERS + OpenTaiko.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}MissIn{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); - - for (int j = 0; j < OpenTaiko.Skin.Characters_MissDownIn_Ptn[i]; j++) - Characters_MissDownIn[i][j] = TxCGlobal(CHARACTERS + OpenTaiko.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}MissDownIn{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); - - for (int j = 0; j < OpenTaiko.Skin.Characters_GoGoTime_Ptn[i]; j++) - Characters_GoGoTime[i][j] = TxCGlobal(CHARACTERS + OpenTaiko.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}GoGo{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); - - for (int j = 0; j < OpenTaiko.Skin.Characters_GoGoTime_Maxed_Ptn[i]; j++) - Characters_GoGoTime_Maxed[i][j] = TxCGlobal(CHARACTERS + OpenTaiko.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}GoGo_Max{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); - - for (int j = 0; j < OpenTaiko.Skin.Characters_GoGoStart_Ptn[i]; j++) - Characters_GoGoStart[i][j] = TxCGlobal(CHARACTERS + OpenTaiko.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}GoGoStart{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); - - for (int j = 0; j < OpenTaiko.Skin.Characters_GoGoStart_Clear_Ptn[i]; j++) - Characters_GoGoStart_Clear[i][j] = TxCGlobal(CHARACTERS + OpenTaiko.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}GoGoStart_Clear{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); - - for (int j = 0; j < OpenTaiko.Skin.Characters_GoGoStart_Maxed_Ptn[i]; j++) - Characters_GoGoStart_Maxed[i][j] = TxCGlobal(CHARACTERS + OpenTaiko.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}GoGoStart_Max{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); - - for (int j = 0; j < OpenTaiko.Skin.Characters_10Combo_Ptn[i]; j++) - Characters_10Combo[i][j] = TxCGlobal(CHARACTERS + OpenTaiko.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}10combo{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); - - for (int j = 0; j < OpenTaiko.Skin.Characters_10Combo_Clear_Ptn[i]; j++) - Characters_10Combo_Clear[i][j] = TxCGlobal(CHARACTERS + OpenTaiko.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}10combo_Clear{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); - - for (int j = 0; j < OpenTaiko.Skin.Characters_10Combo_Maxed_Ptn[i]; j++) - Characters_10Combo_Maxed[i][j] = TxCGlobal(CHARACTERS + OpenTaiko.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}10combo_Max{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); - - for (int j = 0; j < OpenTaiko.Skin.Characters_Become_Cleared_Ptn[i]; j++) - Characters_Become_Cleared[i][j] = TxCGlobal(CHARACTERS + OpenTaiko.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Clearin{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); - - for (int j = 0; j < OpenTaiko.Skin.Characters_Become_Maxed_Ptn[i]; j++) - Characters_Become_Maxed[i][j] = TxCGlobal(CHARACTERS + OpenTaiko.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Soulin{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); - - for (int j = 0; j < OpenTaiko.Skin.Characters_SoulOut_Ptn[i]; j++) - Characters_SoulOut[i][j] = TxCGlobal(CHARACTERS + OpenTaiko.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Soulout{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); - - for (int j = 0; j < OpenTaiko.Skin.Characters_ClearOut_Ptn[i]; j++) - Characters_ClearOut[i][j] = TxCGlobal(CHARACTERS + OpenTaiko.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Clearout{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); - - for (int j = 0; j < OpenTaiko.Skin.Characters_Return_Ptn[i]; j++) - Characters_Return[i][j] = TxCGlobal(CHARACTERS + OpenTaiko.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Return{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); - - for (int j = 0; j < OpenTaiko.Skin.Characters_Balloon_Breaking_Ptn[i]; j++) - Characters_Balloon_Breaking[i][j] = TxCGlobal(CHARACTERS + OpenTaiko.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Balloon_Breaking{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); - - for (int j = 0; j < OpenTaiko.Skin.Characters_Balloon_Broke_Ptn[i]; j++) - Characters_Balloon_Broke[i][j] = TxCGlobal(CHARACTERS + OpenTaiko.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Balloon_Broke{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); - - for (int j = 0; j < OpenTaiko.Skin.Characters_Balloon_Miss_Ptn[i]; j++) - Characters_Balloon_Miss[i][j] = TxCGlobal(CHARACTERS + OpenTaiko.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Balloon_Miss{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); - - for (int j = 0; j < OpenTaiko.Skin.Characters_Kusudama_Idle_Ptn[i]; j++) - Characters_Kusudama_Idle[i][j] = TxCGlobal(CHARACTERS + OpenTaiko.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Kusudama_Idle{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); - - for (int j = 0; j < OpenTaiko.Skin.Characters_Kusudama_Breaking_Ptn[i]; j++) - Characters_Kusudama_Breaking[i][j] = TxCGlobal(CHARACTERS + OpenTaiko.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Kusudama_Breaking{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); - - for (int j = 0; j < OpenTaiko.Skin.Characters_Kusudama_Broke_Ptn[i]; j++) - Characters_Kusudama_Broke[i][j] = TxCGlobal(CHARACTERS + OpenTaiko.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Kusudama_Broke{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); - - for (int j = 0; j < OpenTaiko.Skin.Characters_Kusudama_Miss_Ptn[i]; j++) - Characters_Kusudama_Miss[i][j] = TxCGlobal(CHARACTERS + OpenTaiko.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Kusudama_Miss{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); - - for (int j = 0; j < OpenTaiko.Skin.Characters_Tower_Standing_Ptn[i]; j++) - Characters_Tower_Standing[i][j] = TxCGlobal(CHARACTERS + OpenTaiko.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Tower_Char{Path.DirectorySeparatorChar}Standing{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); - - for (int j = 0; j < OpenTaiko.Skin.Characters_Tower_Climbing_Ptn[i]; j++) - Characters_Tower_Climbing[i][j] = TxCGlobal(CHARACTERS + OpenTaiko.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Tower_Char{Path.DirectorySeparatorChar}Climbing{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); - - for (int j = 0; j < OpenTaiko.Skin.Characters_Tower_Running_Ptn[i]; j++) - Characters_Tower_Running[i][j] = TxCGlobal(CHARACTERS + OpenTaiko.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Tower_Char{Path.DirectorySeparatorChar}Running{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); - - for (int j = 0; j < OpenTaiko.Skin.Characters_Tower_Clear_Ptn[i]; j++) - Characters_Tower_Clear[i][j] = TxCGlobal(CHARACTERS + OpenTaiko.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Tower_Char{Path.DirectorySeparatorChar}Clear{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); - - for (int j = 0; j < OpenTaiko.Skin.Characters_Tower_Fail_Ptn[i]; j++) - Characters_Tower_Fail[i][j] = TxCGlobal(CHARACTERS + OpenTaiko.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Tower_Char{Path.DirectorySeparatorChar}Fail{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); - - for (int j = 0; j < OpenTaiko.Skin.Characters_Tower_Standing_Tired_Ptn[i]; j++) - Characters_Tower_Standing_Tired[i][j] = TxCGlobal(CHARACTERS + OpenTaiko.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Tower_Char{Path.DirectorySeparatorChar}Standing_Tired{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); - - for (int j = 0; j < OpenTaiko.Skin.Characters_Tower_Climbing_Tired_Ptn[i]; j++) - Characters_Tower_Climbing_Tired[i][j] = TxCGlobal(CHARACTERS + OpenTaiko.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Tower_Char{Path.DirectorySeparatorChar}Climbing_Tired{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); - - for (int j = 0; j < OpenTaiko.Skin.Characters_Tower_Running_Tired_Ptn[i]; j++) - Characters_Tower_Running_Tired[i][j] = TxCGlobal(CHARACTERS + OpenTaiko.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Tower_Char{Path.DirectorySeparatorChar}Running_Tired{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); - - for (int j = 0; j < OpenTaiko.Skin.Characters_Tower_Clear_Tired_Ptn[i]; j++) - Characters_Tower_Clear_Tired[i][j] = TxCGlobal(CHARACTERS + OpenTaiko.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Tower_Char{Path.DirectorySeparatorChar}Clear_Tired{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); - - #endregion - - #region [Parse individual character parameters] - - #region [Default values] - - OpenTaiko.Skin.Characters_X[i] = new int[] { 0, 0 }; - OpenTaiko.Skin.Characters_Y[i] = new int[] { 0, 537 }; - OpenTaiko.Skin.Characters_4P[i] = new int[] { 165, 68 }; - OpenTaiko.Skin.Characters_5P[i] = new int[] { 165, 40 }; - OpenTaiko.Skin.Characters_X_AI[i] = new int[] { 472, 602 }; - OpenTaiko.Skin.Characters_Y_AI[i] = new int[] { 152, 152 }; - OpenTaiko.Skin.Characters_Balloon_X[i] = new int[] { 240, 240, 0, 0 }; - OpenTaiko.Skin.Characters_Balloon_Y[i] = new int[] { 0, 297, 0, 0 }; - OpenTaiko.Skin.Characters_Balloon_4P[i] = new int[] { 0, -176 }; - OpenTaiko.Skin.Characters_Balloon_5P[i] = new int[] { 0, -168 }; - OpenTaiko.Skin.Characters_Kusudama_X[i] = new int[] { 290, 690, 90, 890, 490 }; - OpenTaiko.Skin.Characters_Kusudama_Y[i] = new int[] { 420, 420, 420, 420, 420 }; - OpenTaiko.Skin.Characters_Motion_Normal[i] = CreateNumberedArrayFromInt(OpenTaiko.Skin.Characters_Normal_Ptn[i]); - OpenTaiko.Skin.Characters_Motion_10Combo[i] = CreateNumberedArrayFromInt(OpenTaiko.Skin.Characters_10Combo_Ptn[i]); - OpenTaiko.Skin.Characters_Motion_10Combo_Clear[i] = CreateNumberedArrayFromInt(OpenTaiko.Skin.Characters_10Combo_Clear_Ptn[i]); - OpenTaiko.Skin.Characters_Motion_10ComboMax[i] = CreateNumberedArrayFromInt(OpenTaiko.Skin.Characters_10Combo_Maxed_Ptn[i]); - OpenTaiko.Skin.Characters_Motion_Miss[i] = CreateNumberedArrayFromInt(OpenTaiko.Skin.Characters_Normal_Missed_Ptn[i]); - OpenTaiko.Skin.Characters_Motion_MissDown[i] = CreateNumberedArrayFromInt(OpenTaiko.Skin.Characters_Normal_MissedDown_Ptn[i]); - OpenTaiko.Skin.Characters_Motion_ClearIn[i] = CreateNumberedArrayFromInt(OpenTaiko.Skin.Characters_Become_Cleared_Ptn[i]); - OpenTaiko.Skin.Characters_Motion_Clear[i] = CreateNumberedArrayFromInt(OpenTaiko.Skin.Characters_Normal_Cleared_Ptn[i]); - OpenTaiko.Skin.Characters_Motion_ClearMax[i] = CreateNumberedArrayFromInt(OpenTaiko.Skin.Characters_Normal_Maxed_Ptn[i]); - OpenTaiko.Skin.Characters_Motion_MissIn[i] = CreateNumberedArrayFromInt(OpenTaiko.Skin.Characters_MissIn_Ptn[i]); - OpenTaiko.Skin.Characters_Motion_MissDownIn[i] = CreateNumberedArrayFromInt(OpenTaiko.Skin.Characters_MissDownIn_Ptn[i]); - OpenTaiko.Skin.Characters_Motion_GoGoStart[i] = CreateNumberedArrayFromInt(OpenTaiko.Skin.Characters_GoGoStart_Ptn[i]); - OpenTaiko.Skin.Characters_Motion_GoGoStart_Clear[i] = CreateNumberedArrayFromInt(OpenTaiko.Skin.Characters_GoGoStart_Clear_Ptn[i]); - OpenTaiko.Skin.Characters_Motion_GoGoStartMax[i] = CreateNumberedArrayFromInt(OpenTaiko.Skin.Characters_GoGoStart_Maxed_Ptn[i]); - OpenTaiko.Skin.Characters_Motion_GoGo[i] = CreateNumberedArrayFromInt(OpenTaiko.Skin.Characters_GoGoTime_Ptn[i]); - OpenTaiko.Skin.Characters_Motion_GoGoMax[i] = CreateNumberedArrayFromInt(OpenTaiko.Skin.Characters_GoGoTime_Maxed_Ptn[i]); - OpenTaiko.Skin.Characters_Motion_SoulIn[i] = CreateNumberedArrayFromInt(OpenTaiko.Skin.Characters_Become_Maxed_Ptn[i]); - OpenTaiko.Skin.Characters_Motion_SoulOut[i] = CreateNumberedArrayFromInt(OpenTaiko.Skin.Characters_SoulOut_Ptn[i]); - OpenTaiko.Skin.Characters_Motion_ClearOut[i] = CreateNumberedArrayFromInt(OpenTaiko.Skin.Characters_ClearOut_Ptn[i]); - OpenTaiko.Skin.Characters_Motion_Return[i] = CreateNumberedArrayFromInt(OpenTaiko.Skin.Characters_Return_Ptn[i]); - /* - TJAPlayer3.Skin.Characters_Motion_Tower_Standing[i] = CreateNumberedArrayFromInt(TJAPlayer3.Skin.Characters_Tower_Standing_Ptn[i]); - TJAPlayer3.Skin.Characters_Motion_Tower_Climbing[i] = CreateNumberedArrayFromInt(TJAPlayer3.Skin.Characters_Tower_Climbing_Ptn[i]); - TJAPlayer3.Skin.Characters_Motion_Tower_Running[i] = CreateNumberedArrayFromInt(TJAPlayer3.Skin.Characters_Tower_Running_Ptn[i]); - TJAPlayer3.Skin.Characters_Motion_Tower_Clear[i] = CreateNumberedArrayFromInt(TJAPlayer3.Skin.Characters_Tower_Clear_Ptn[i]); - TJAPlayer3.Skin.Characters_Motion_Tower_Fail[i] = CreateNumberedArrayFromInt(TJAPlayer3.Skin.Characters_Tower_Fail_Ptn[i]); - TJAPlayer3.Skin.Characters_Motion_Tower_Standing_Tired[i] = CreateNumberedArrayFromInt(TJAPlayer3.Skin.Characters_Tower_Standing_Tired_Ptn[i]); - TJAPlayer3.Skin.Characters_Motion_Tower_Climbing_Tired[i] = CreateNumberedArrayFromInt(TJAPlayer3.Skin.Characters_Tower_Climbing_Tired_Ptn[i]); - TJAPlayer3.Skin.Characters_Motion_Tower_Running_Tired[i] = CreateNumberedArrayFromInt(TJAPlayer3.Skin.Characters_Tower_Running_Tired_Ptn[i]); - TJAPlayer3.Skin.Characters_Motion_Tower_Clear_Tired[i] = CreateNumberedArrayFromInt(TJAPlayer3.Skin.Characters_Tower_Clear_Tired_Ptn[i]); - */ - OpenTaiko.Skin.Characters_Beat_Normal[i] = 1; - OpenTaiko.Skin.Characters_Beat_Miss[i] = 1; - OpenTaiko.Skin.Characters_Beat_MissDown[i] = 1; - OpenTaiko.Skin.Characters_Beat_Clear[i] = 2; - OpenTaiko.Skin.Characters_Beat_GoGo[i] = 2; - OpenTaiko.Skin.Characters_Beat_MissIn[i] = 1.5f; - OpenTaiko.Skin.Characters_Beat_MissDownIn[i] = 1.5f; - OpenTaiko.Skin.Characters_Beat_10Combo[i] = 1.5f; - OpenTaiko.Skin.Characters_Beat_10Combo_Clear[i] = 1.5f; - OpenTaiko.Skin.Characters_Beat_10ComboMax[i] = 1.5f; - OpenTaiko.Skin.Characters_Beat_ClearIn[i] = 1.5f; - OpenTaiko.Skin.Characters_Beat_ClearMax[i] = 1.5f; - OpenTaiko.Skin.Characters_Beat_GoGoStart[i] = 1.5f; - OpenTaiko.Skin.Characters_Beat_GoGoStart_Clear[i] = 1.5f; - OpenTaiko.Skin.Characters_Beat_GoGoStartMax[i] = 1.5f; - OpenTaiko.Skin.Characters_Beat_GoGoMax[i] = 2; - OpenTaiko.Skin.Characters_Beat_SoulIn[i] = 1.5f; - OpenTaiko.Skin.Characters_Beat_SoulOut[i] = 1.5f; - OpenTaiko.Skin.Characters_Beat_ClearOut[i] = 1.5f; - OpenTaiko.Skin.Characters_Beat_Return[i] = 1.5f; - OpenTaiko.Skin.Characters_Beat_Tower_Standing[i] = 1; - OpenTaiko.Skin.Characters_Beat_Tower_Clear[i] = 1; - OpenTaiko.Skin.Characters_Beat_Tower_Fail[i] = 1; - OpenTaiko.Skin.Characters_Beat_Tower_Standing_Tired[i] = 1; - OpenTaiko.Skin.Characters_Beat_Tower_Clear_Tired[i] = 1; - OpenTaiko.Skin.Characters_Balloon_Timer[i] = 28; - OpenTaiko.Skin.Characters_Balloon_Delay[i] = 500; - OpenTaiko.Skin.Characters_Balloon_FadeOut[i] = 84; - OpenTaiko.Skin.Characters_Title_Entry_AnimationDuration[i] = 1000; - OpenTaiko.Skin.Characters_Title_Normal_AnimationDuration[i] = 1000; - OpenTaiko.Skin.Characters_Menu_Loop_AnimationDuration[i] = 1000; - OpenTaiko.Skin.Characters_Menu_Select_AnimationDuration[i] = 1000; - OpenTaiko.Skin.Characters_Menu_Start_AnimationDuration[i] = 1000; - OpenTaiko.Skin.Characters_Menu_Wait_AnimationDuration[i] = 1000; - OpenTaiko.Skin.Characters_Result_Normal_AnimationDuration[i] = 1000; - OpenTaiko.Skin.Characters_Result_Clear_AnimationDuration[i] = 1000; - OpenTaiko.Skin.Characters_Result_Failed_In_AnimationDuration[i] = 1000; - OpenTaiko.Skin.Characters_Result_Failed_AnimationDuration[i] = 1000; - - #endregion - - var _str = ""; - OpenTaiko.Skin.LoadSkinConfigFromFile(charaPath + @$"{Path.DirectorySeparatorChar}CharaConfig.txt", ref _str); - - string[] delimiter = { "\n" }; - string[] strSingleLine = _str.Split(delimiter, StringSplitOptions.RemoveEmptyEntries); - - foreach (string s in strSingleLine) { - string str = s.Replace('\t', ' ').TrimStart(new char[] { '\t', ' ' }); - if ((str.Length != 0) && (str[0] != ';')) { - try { - string strCommand; - string strParam; - string[] strArray = str.Split(new char[] { '=' }); - - if (strArray.Length == 2) { - strCommand = strArray[0].Trim(); - strParam = strArray[1].Trim(); - - switch (strCommand) { - case "Game_Chara_X": { - string[] strSplit = strParam.Split(','); - for (int k = 0; k < 2; k++) { - OpenTaiko.Skin.Characters_X[i][k] = int.Parse(strSplit[k]); - } - break; - } - case "Game_Chara_Y": { - string[] strSplit = strParam.Split(','); - for (int k = 0; k < 2; k++) { - OpenTaiko.Skin.Characters_Y[i][k] = int.Parse(strSplit[k]); - } - break; - } - case "Game_Chara_4P": { - string[] strSplit = strParam.Split(','); - for (int k = 0; k < 2; k++) { - OpenTaiko.Skin.Characters_4P[i][k] = int.Parse(strSplit[k]); - } - break; - } - case "Game_Chara_5P": { - string[] strSplit = strParam.Split(','); - for (int k = 0; k < 2; k++) { - OpenTaiko.Skin.Characters_5P[i][k] = int.Parse(strSplit[k]); - } - break; - } - case "Game_Chara_X_AI": { - string[] strSplit = strParam.Split(','); - for (int k = 0; k < 2; k++) { - OpenTaiko.Skin.Characters_X_AI[i][k] = int.Parse(strSplit[k]); - } - break; - } - case "Game_Chara_Y_AI": { - string[] strSplit = strParam.Split(','); - for (int k = 0; k < 2; k++) { - OpenTaiko.Skin.Characters_Y_AI[i][k] = int.Parse(strSplit[k]); - } - break; - } - case "Game_Chara_Balloon_X": { - string[] strSplit = strParam.Split(','); - for (int k = 0; k < 2; k++) { - OpenTaiko.Skin.Characters_Balloon_X[i][k] = int.Parse(strSplit[k]); - } - break; - } - case "Game_Chara_Balloon_Y": { - string[] strSplit = strParam.Split(','); - for (int k = 0; k < 2; k++) { - OpenTaiko.Skin.Characters_Balloon_Y[i][k] = int.Parse(strSplit[k]); - } - break; - } - case "Game_Chara_Balloon_4P": { - string[] strSplit = strParam.Split(','); - for (int k = 0; k < 2; k++) { - OpenTaiko.Skin.Characters_Balloon_4P[i][k] = int.Parse(strSplit[k]); - } - break; - } - case "Game_Chara_Balloon_5P": { - string[] strSplit = strParam.Split(','); - for (int k = 0; k < 2; k++) { - OpenTaiko.Skin.Characters_Balloon_5P[i][k] = int.Parse(strSplit[k]); - } - break; - } - case "Game_Chara_Kusudama_X": { - string[] strSplit = strParam.Split(','); - for (int k = 0; k < 5; k++) { - OpenTaiko.Skin.Characters_Kusudama_X[i][k] = int.Parse(strSplit[k]); - } - break; - } - case "Game_Chara_Kusudama_Y": { - string[] strSplit = strParam.Split(','); - for (int k = 0; k < 5; k++) { - OpenTaiko.Skin.Characters_Kusudama_Y[i][k] = int.Parse(strSplit[k]); - } - break; - } - case "Game_Chara_Balloon_Timer": { - if (int.Parse(strParam) > 0) - OpenTaiko.Skin.Characters_Balloon_Timer[i] = int.Parse(strParam); - break; - } - case "Game_Chara_Balloon_Delay": { - if (int.Parse(strParam) > 0) - OpenTaiko.Skin.Characters_Balloon_Delay[i] = int.Parse(strParam); - break; - } - case "Game_Chara_Balloon_FadeOut": { - if (int.Parse(strParam) > 0) - OpenTaiko.Skin.Characters_Balloon_FadeOut[i] = int.Parse(strParam); - break; - } - // パターン数の設定はTextureLoader.csで反映されます。 - case "Game_Chara_Motion_Normal": { - OpenTaiko.Skin.Characters_Motion_Normal[i] = CConversion.StringToIntArray(strParam); - break; - } - case "Game_Chara_Motion_10Combo": { - OpenTaiko.Skin.Characters_Motion_10Combo[i] = CConversion.StringToIntArray(strParam); - break; - } - case "Game_Chara_Motion_10Combo_Clear": { - OpenTaiko.Skin.Characters_Motion_10Combo_Clear[i] = CConversion.StringToIntArray(strParam); - break; - } - case "Game_Chara_Motion_10Combo_Max": { - OpenTaiko.Skin.Characters_Motion_10ComboMax[i] = CConversion.StringToIntArray(strParam); - break; - } - case "Game_Chara_Motion_Miss": { - OpenTaiko.Skin.Characters_Motion_Miss[i] = CConversion.StringToIntArray(strParam); - break; - } - case "Game_Chara_Motion_MissDown": { - OpenTaiko.Skin.Characters_Motion_MissDown[i] = CConversion.StringToIntArray(strParam); - break; - } - case "Game_Chara_Motion_ClearIn": { - OpenTaiko.Skin.Characters_Motion_ClearIn[i] = CConversion.StringToIntArray(strParam); - break; - } - case "Game_Chara_Motion_Clear": { - OpenTaiko.Skin.Characters_Motion_Clear[i] = CConversion.StringToIntArray(strParam); - OpenTaiko.Skin.Characters_Motion_ClearMax[i] = OpenTaiko.Skin.Characters_Motion_Clear[i]; - break; - } - case "Game_Chara_Motion_ClearMax": { - OpenTaiko.Skin.Characters_Motion_ClearMax[i] = CConversion.StringToIntArray(strParam); - break; - } - case "Game_Chara_Motion_MissIn": { - OpenTaiko.Skin.Characters_Motion_MissIn[i] = CConversion.StringToIntArray(strParam); - break; - } - case "Game_Chara_Motion_MissDownIn": { - OpenTaiko.Skin.Characters_Motion_MissDownIn[i] = CConversion.StringToIntArray(strParam); - break; - } - case "Game_Chara_Motion_GoGoStart": { - OpenTaiko.Skin.Characters_Motion_GoGoStart[i] = CConversion.StringToIntArray(strParam); - OpenTaiko.Skin.Characters_Motion_GoGoStartMax[i] = OpenTaiko.Skin.Characters_Motion_GoGoStart[i]; - break; - } - case "Game_Chara_Motion_GoGoStart_Clear": { - OpenTaiko.Skin.Characters_Motion_GoGoStart_Clear[i] = CConversion.StringToIntArray(strParam); - break; - } - case "Game_Chara_Motion_GoGoStart_Max": { - OpenTaiko.Skin.Characters_Motion_GoGoStartMax[i] = CConversion.StringToIntArray(strParam); - break; - } - case "Game_Chara_Motion_GoGo": { - OpenTaiko.Skin.Characters_Motion_GoGo[i] = CConversion.StringToIntArray(strParam); - OpenTaiko.Skin.Characters_Motion_GoGoMax[i] = OpenTaiko.Skin.Characters_Motion_GoGo[i]; - break; - } - case "Game_Chara_Motion_GoGo_Max": { - OpenTaiko.Skin.Characters_Motion_GoGoMax[i] = CConversion.StringToIntArray(strParam); - break; - } - case "Game_Chara_Motion_SoulIn": { - OpenTaiko.Skin.Characters_Motion_SoulIn[i] = CConversion.StringToIntArray(strParam); - break; - } - case "Game_Chara_Motion_SoulOut": { - OpenTaiko.Skin.Characters_Motion_SoulOut[i] = CConversion.StringToIntArray(strParam); - break; - } - case "Game_Chara_Motion_ClearOut": { - OpenTaiko.Skin.Characters_Motion_ClearOut[i] = CConversion.StringToIntArray(strParam); - break; - } - case "Game_Chara_Motion_Return": { - OpenTaiko.Skin.Characters_Motion_Return[i] = CConversion.StringToIntArray(strParam); - break; - } - /*case "Game_Chara_Motion_Tower_Standing": - { - TJAPlayer3.Skin.Characters_Motion_Tower_Standing[i] = CConversion.StringToIntArray(strParam); - break; - } - case "Game_Chara_Motion_Tower_Climbing": - { - TJAPlayer3.Skin.Characters_Motion_Tower_Climbing[i] = CConversion.StringToIntArray(strParam); - break; - } - case "Game_Chara_Motion_Tower_Running": - { - TJAPlayer3.Skin.Characters_Motion_Tower_Running[i] = CConversion.StringToIntArray(strParam); - break; - } - case "Game_Chara_Motion_Tower_Clear": - { - TJAPlayer3.Skin.Characters_Motion_Tower_Clear[i] = CConversion.StringToIntArray(strParam); - break; - } - case "Game_Chara_Motion_Tower_Fail": - { - TJAPlayer3.Skin.Characters_Motion_Tower_Fail[i] = CConversion.StringToIntArray(strParam); - break; - } - case "Game_Chara_Motion_Tower_Standing_Tired": - { - TJAPlayer3.Skin.Characters_Motion_Tower_Standing_Tired[i] = CConversion.StringToIntArray(strParam); - break; - } - case "Game_Chara_Motion_Tower_Climbing_Tired": - { - TJAPlayer3.Skin.Characters_Motion_Tower_Climbing_Tired[i] = CConversion.StringToIntArray(strParam); - break; - } - case "Game_Chara_Motion_Tower_Running_Tired": - { - TJAPlayer3.Skin.Characters_Motion_Tower_Running_Tired[i] = CConversion.StringToIntArray(strParam); - break; - } - case "Game_Chara_Motion_Tower_Clear_Tired": - { - TJAPlayer3.Skin.Characters_Motion_Tower_Clear_Tired[i] = CConversion.StringToIntArray(strParam); - break; - }*/ - case "Game_Chara_Beat_Normal": { - OpenTaiko.Skin.Characters_Beat_Normal[i] = float.Parse(strParam); - break; - } - case "Game_Chara_Beat_10Combo": { - OpenTaiko.Skin.Characters_Beat_10Combo[i] = float.Parse(strParam); - break; - } - case "Game_Chara_Beat_10ComboMax": { - OpenTaiko.Skin.Characters_Beat_10ComboMax[i] = float.Parse(strParam); - break; - } - case "Game_Chara_Beat_Miss": { - OpenTaiko.Skin.Characters_Beat_Miss[i] = float.Parse(strParam); - break; - } - case "Game_Chara_Beat_MissDown": { - OpenTaiko.Skin.Characters_Beat_MissDown[i] = float.Parse(strParam); - break; - } - case "Game_Chara_Beat_ClearIn": { - OpenTaiko.Skin.Characters_Beat_ClearIn[i] = float.Parse(strParam); - break; - } - case "Game_Chara_Beat_Clear": { - OpenTaiko.Skin.Characters_Beat_Clear[i] = float.Parse(strParam); - OpenTaiko.Skin.Characters_Beat_ClearMax[i] = float.Parse(strParam); - break; - } - case "Game_Chara_Beat_ClearMax": { - OpenTaiko.Skin.Characters_Beat_ClearMax[i] = float.Parse(strParam); - break; - } - case "Game_Chara_Beat_MissIn": { - OpenTaiko.Skin.Characters_Beat_MissIn[i] = float.Parse(strParam); - break; - } - case "Game_Chara_Beat_MissDownIn": { - OpenTaiko.Skin.Characters_Beat_MissDownIn[i] = float.Parse(strParam); - break; - } - case "Game_Chara_Beat_GoGoStart": { - OpenTaiko.Skin.Characters_Beat_GoGoStart[i] = float.Parse(strParam); - break; - } - case "Game_Chara_Beat_GoGoStartClear": { - OpenTaiko.Skin.Characters_Beat_GoGoStart_Clear[i] = float.Parse(strParam); - break; - } - case "Game_Chara_Beat_GoGoStartMax": { - OpenTaiko.Skin.Characters_Beat_GoGoStartMax[i] = float.Parse(strParam); - break; - } - case "Game_Chara_Beat_GoGo": { - OpenTaiko.Skin.Characters_Beat_GoGo[i] = float.Parse(strParam); - OpenTaiko.Skin.Characters_Beat_GoGoMax[i] = float.Parse(strParam); - break; - } - case "Game_Chara_Beat_GoGoMax": { - OpenTaiko.Skin.Characters_Beat_GoGoMax[i] = float.Parse(strParam); - break; - } - case "Game_Chara_Beat_SoulIn": { - OpenTaiko.Skin.Characters_Beat_SoulIn[i] = float.Parse(strParam); - break; - } - case "Game_Chara_Beat_Return": { - OpenTaiko.Skin.Characters_Beat_Return[i] = float.Parse(strParam); - break; - } - case "Game_Chara_Beat_Tower_Standing": { - OpenTaiko.Skin.Characters_Beat_Tower_Standing[i] = float.Parse(strParam); - break; - } - case "Game_Chara_Beat_Tower_Standing_Tired": { - OpenTaiko.Skin.Characters_Beat_Tower_Standing_Tired[i] = float.Parse(strParam); - break; - } - case "Game_Chara_Beat_Tower_Fail": { - OpenTaiko.Skin.Characters_Beat_Tower_Fail[i] = float.Parse(strParam); - break; - } - case "Game_Chara_Beat_Tower_Clear": { - OpenTaiko.Skin.Characters_Beat_Tower_Clear[i] = float.Parse(strParam); - break; - } - case "Game_Chara_Beat_Tower_Clear_Tired": { - OpenTaiko.Skin.Characters_Beat_Tower_Clear_Tired[i] = float.Parse(strParam); - break; - } - case "Game_Chara_Tower_Clear_IsLooping": { - OpenTaiko.Skin.Characters_Tower_Clear_IsLooping[i] = int.Parse(strParam) != 0; - break; - } - case "Game_Chara_Tower_Clear_Tired_IsLooping": { - OpenTaiko.Skin.Characters_Tower_Clear_Tired_IsLooping[i] = int.Parse(strParam) != 0; - break; - } - case "Game_Chara_Tower_Fail_IsLooping": { - OpenTaiko.Skin.Characters_Tower_Fail_IsLooping[i] = int.Parse(strParam) != 0; - break; - } - case "Chara_Entry_AnimationDuration": { - OpenTaiko.Skin.Characters_Title_Entry_AnimationDuration[i] = int.Parse(strParam); - break; - } - case "Chara_Normal_AnimationDuration": { - OpenTaiko.Skin.Characters_Title_Normal_AnimationDuration[i] = int.Parse(strParam); - break; - } - case "Chara_Menu_Loop_AnimationDuration": { - OpenTaiko.Skin.Characters_Menu_Loop_AnimationDuration[i] = int.Parse(strParam); - break; - } - case "Chara_Menu_Select_AnimationDuration": { - OpenTaiko.Skin.Characters_Menu_Select_AnimationDuration[i] = int.Parse(strParam); - break; - } - case "Chara_Menu_Start_AnimationDuration": { - OpenTaiko.Skin.Characters_Menu_Start_AnimationDuration[i] = int.Parse(strParam); - break; - } - case "Chara_Menu_Wait_AnimationDuration": { - OpenTaiko.Skin.Characters_Menu_Wait_AnimationDuration[i] = int.Parse(strParam); - break; - } - case "Chara_Result_Normal_AnimationDuration": { - OpenTaiko.Skin.Characters_Result_Normal_AnimationDuration[i] = int.Parse(strParam); - break; - } - case "Chara_Result_Clear_AnimationDuration": { - OpenTaiko.Skin.Characters_Result_Clear_AnimationDuration[i] = int.Parse(strParam); - break; - } - case "Chara_Result_Failed_In_AnimationDuration": { - OpenTaiko.Skin.Characters_Result_Failed_In_AnimationDuration[i] = int.Parse(strParam); - break; - } - case "Chara_Result_Failed_AnimationDuration": { - OpenTaiko.Skin.Characters_Result_Failed_AnimationDuration[i] = int.Parse(strParam); - break; - } - /* - case "Chara_Result_SpeechText": - { - string[] strSplit = strParam.Split(','); - for (int j = 0; j < 6; j++) - { - TJAPlayer3.Skin.Characters_Result_SpeechText[i][j] = strSplit[j]; - } - break; - } - */ - default: { break; } - } - } - continue; - } catch (Exception exception) { - Trace.TraceError(exception.ToString()); - Trace.TraceError("例外が発生しましたが処理を継続します。 (6a32cc37-1527-412e-968a-512c1f0135cd)"); - continue; - } - } - } - - #endregion - - #endregion - } - - #region [Voice samples] - - var _skin = OpenTaiko.Skin; - - #region [Dispose previously allocated sound effects] - - _skin.voiceClearFailed[player]?.Dispose(); - _skin.voiceClearClear[player]?.Dispose(); - _skin.voiceClearFullCombo[player]?.Dispose(); - _skin.voiceClearAllPerfect[player]?.Dispose(); - _skin.voiceAIWin[player]?.Dispose(); - _skin.voiceAILose[player]?.Dispose(); - _skin.voiceMenuSongSelect[player]?.Dispose(); - _skin.voiceMenuSongDecide[player]?.Dispose(); - _skin.voiceMenuSongDecide_AI[player]?.Dispose(); - _skin.voiceMenuDiffSelect[player]?.Dispose(); - _skin.voiceMenuDanSelectStart[player]?.Dispose(); - _skin.voiceMenuDanSelectPrompt[player]?.Dispose(); - _skin.voiceMenuDanSelectConfirm[player]?.Dispose(); - _skin.voiceTitleSanka[player]?.Dispose(); - _skin.voiceTowerMiss[player]?.Dispose(); - _skin.voiceResultBestScore[player]?.Dispose(); - _skin.voiceResultClearFailed[player]?.Dispose(); - _skin.voiceResultClearSuccess[player]?.Dispose(); - _skin.voiceResultDanFailed[player]?.Dispose(); - _skin.voiceResultDanRedPass[player]?.Dispose(); - _skin.voiceResultDanGoldPass[player]?.Dispose(); - - #endregion - - #region [Allocate and load the new samples] - - _skin.voiceClearFailed[player] = VoiceSelectOggOrWav(charaPath + @$"{Path.DirectorySeparatorChar}Sounds{Path.DirectorySeparatorChar}Clear{Path.DirectorySeparatorChar}Failed"); - _skin.voiceClearClear[player] = VoiceSelectOggOrWav(charaPath + @$"{Path.DirectorySeparatorChar}Sounds{Path.DirectorySeparatorChar}Clear{Path.DirectorySeparatorChar}Clear"); - _skin.voiceClearFullCombo[player] = VoiceSelectOggOrWav(charaPath + @$"{Path.DirectorySeparatorChar}Sounds{Path.DirectorySeparatorChar}Clear{Path.DirectorySeparatorChar}FullCombo"); - _skin.voiceClearAllPerfect[player] = VoiceSelectOggOrWav(charaPath + @$"{Path.DirectorySeparatorChar}Sounds{Path.DirectorySeparatorChar}Clear{Path.DirectorySeparatorChar}AllPerfect"); - _skin.voiceAIWin[player] = VoiceSelectOggOrWav(charaPath + @$"{Path.DirectorySeparatorChar}Sounds{Path.DirectorySeparatorChar}Clear{Path.DirectorySeparatorChar}AIBattle_Win"); - _skin.voiceAILose[player] = VoiceSelectOggOrWav(charaPath + @$"{Path.DirectorySeparatorChar}Sounds{Path.DirectorySeparatorChar}Clear{Path.DirectorySeparatorChar}AIBattle_Lose"); - _skin.voiceMenuSongSelect[player] = VoiceSelectOggOrWav(charaPath + @$"{Path.DirectorySeparatorChar}Sounds{Path.DirectorySeparatorChar}Menu{Path.DirectorySeparatorChar}SongSelect"); - _skin.voiceMenuSongDecide[player] = VoiceSelectOggOrWav(charaPath + @$"{Path.DirectorySeparatorChar}Sounds{Path.DirectorySeparatorChar}Menu{Path.DirectorySeparatorChar}SongDecide"); - _skin.voiceMenuSongDecide_AI[player] = VoiceSelectOggOrWav(charaPath + @$"{Path.DirectorySeparatorChar}Sounds{Path.DirectorySeparatorChar}Menu{Path.DirectorySeparatorChar}SongDecide_AI"); - _skin.voiceMenuDiffSelect[player] = VoiceSelectOggOrWav(charaPath + @$"{Path.DirectorySeparatorChar}Sounds{Path.DirectorySeparatorChar}Menu{Path.DirectorySeparatorChar}DiffSelect"); - _skin.voiceMenuDanSelectStart[player] = VoiceSelectOggOrWav(charaPath + @$"{Path.DirectorySeparatorChar}Sounds{Path.DirectorySeparatorChar}Menu{Path.DirectorySeparatorChar}DanSelectStart"); - _skin.voiceMenuDanSelectPrompt[player] = VoiceSelectOggOrWav(charaPath + @$"{Path.DirectorySeparatorChar}Sounds{Path.DirectorySeparatorChar}Menu{Path.DirectorySeparatorChar}DanSelectPrompt"); - _skin.voiceMenuDanSelectConfirm[player] = VoiceSelectOggOrWav(charaPath + @$"{Path.DirectorySeparatorChar}Sounds{Path.DirectorySeparatorChar}Menu{Path.DirectorySeparatorChar}DanSelectConfirm"); - _skin.voiceTitleSanka[player] = VoiceSelectOggOrWav(charaPath + @$"{Path.DirectorySeparatorChar}Sounds{Path.DirectorySeparatorChar}Title{Path.DirectorySeparatorChar}Sanka"); - _skin.voiceTowerMiss[player] = VoiceSelectOggOrWav(charaPath + @$"{Path.DirectorySeparatorChar}Sounds{Path.DirectorySeparatorChar}Tower{Path.DirectorySeparatorChar}Miss"); - _skin.voiceResultBestScore[player] = VoiceSelectOggOrWav(charaPath + @$"{Path.DirectorySeparatorChar}Sounds{Path.DirectorySeparatorChar}Result{Path.DirectorySeparatorChar}BestScore"); - _skin.voiceResultClearFailed[player] = VoiceSelectOggOrWav(charaPath + @$"{Path.DirectorySeparatorChar}Sounds{Path.DirectorySeparatorChar}Result{Path.DirectorySeparatorChar}ClearFailed"); - _skin.voiceResultClearSuccess[player] = VoiceSelectOggOrWav(charaPath + @$"{Path.DirectorySeparatorChar}Sounds{Path.DirectorySeparatorChar}Result{Path.DirectorySeparatorChar}ClearSuccess"); - _skin.voiceResultDanFailed[player] = VoiceSelectOggOrWav(charaPath + @$"{Path.DirectorySeparatorChar}Sounds{Path.DirectorySeparatorChar}Result{Path.DirectorySeparatorChar}DanFailed"); - _skin.voiceResultDanRedPass[player] = VoiceSelectOggOrWav(charaPath + @$"{Path.DirectorySeparatorChar}Sounds{Path.DirectorySeparatorChar}Result{Path.DirectorySeparatorChar}DanRedPass"); - _skin.voiceResultDanGoldPass[player] = VoiceSelectOggOrWav(charaPath + @$"{Path.DirectorySeparatorChar}Sounds{Path.DirectorySeparatorChar}Result{Path.DirectorySeparatorChar}DanGoldPass"); - - #endregion - - #endregion - } - - public void DisposeTexture() { - foreach (var tex in listTexture) { - var texture = tex; - OpenTaiko.tテクスチャの解放(ref texture); - texture?.Dispose(); - texture = null; - } - listTexture.Clear(); - - //if (TJAPlayer3.ConfigIni.PreAssetsLoading) - { - foreach (var act in OpenTaiko.app.listトップレベルActivities) { - act.ReleaseManagedResource(); - act.ReleaseUnmanagedResource(); - } - } - } - #region Calibration - - public CTexture CalibrateFG, - CalibrateBG; - - #endregion +namespace OpenTaiko; + +class TextureLoader { + public static string BASE = @$"Graphics{Path.DirectorySeparatorChar}"; + public static string GLOBAL = @$"Global{Path.DirectorySeparatorChar}"; + + // Global assets + public static string PUCHICHARA = @$"PuchiChara{Path.DirectorySeparatorChar}"; + public static string CHARACTERS = @$"Characters{Path.DirectorySeparatorChar}"; + + // Stage + public static string STARTUP = @$"0_Startup{Path.DirectorySeparatorChar}"; + public static string TITLE = @$"1_Title{Path.DirectorySeparatorChar}"; + public static string CONFIG = @$"2_Config{Path.DirectorySeparatorChar}"; + public static string SONGSELECT = @$"3_SongSelect{Path.DirectorySeparatorChar}"; + public static string DANISELECT = @$"3_DaniSelect{Path.DirectorySeparatorChar}"; + public static string SONGLOADING = @$"4_SongLoading{Path.DirectorySeparatorChar}"; + public static string GAME = @$"5_Game{Path.DirectorySeparatorChar}"; + public static string RESULT = @$"6_Result{Path.DirectorySeparatorChar}"; + public static string EXIT = @$"7_Exit{Path.DirectorySeparatorChar}"; + public static string DANRESULT = @$"7_DanResult{Path.DirectorySeparatorChar}"; + public static string TOWERRESULT = @$"8_TowerResult{Path.DirectorySeparatorChar}"; + public static string HEYA = @$"10_Heya{Path.DirectorySeparatorChar}"; + + public static string MODALS = @$"11_Modals{Path.DirectorySeparatorChar}"; + public static string ONLINELOUNGE = @$"12_OnlineLounge{Path.DirectorySeparatorChar}"; + public static string TOWERSELECT = @$"13_TowerSelect{Path.DirectorySeparatorChar}"; + + // InGame + public static string DANCER = @$"2_Dancer{Path.DirectorySeparatorChar}"; + public static string MOB = @$"3_Mob{Path.DirectorySeparatorChar}"; + public static string COURSESYMBOL = @$"4_CourseSymbol{Path.DirectorySeparatorChar}"; + public static string BACKGROUND = @$"5_Background{Path.DirectorySeparatorChar}"; + public static string TAIKO = @$"6_Taiko{Path.DirectorySeparatorChar}"; + public static string GAUGE = @$"7_Gauge{Path.DirectorySeparatorChar}"; + public static string FOOTER = @$"8_Footer{Path.DirectorySeparatorChar}"; + public static string END = @$"9_End{Path.DirectorySeparatorChar}"; + public static string EFFECTS = @$"10_Effects{Path.DirectorySeparatorChar}"; + public static string BALLOON = @$"11_Balloon{Path.DirectorySeparatorChar}"; + public static string LANE = @$"12_Lane{Path.DirectorySeparatorChar}"; + public static string GENRE = @$"13_GENRE{Path.DirectorySeparatorChar}"; + public static string GAMEMODE = @$"14_GameMode{Path.DirectorySeparatorChar}"; + public static string FAILED = @$"15_Failed{Path.DirectorySeparatorChar}"; + public static string RUNNER = @$"16_Runner{Path.DirectorySeparatorChar}"; + public static string TRAINING = @$"19_Training{Path.DirectorySeparatorChar}"; + public static string DANC = @$"17_DanC{Path.DirectorySeparatorChar}"; + public static string TOWER = @$"20_Tower{Path.DirectorySeparatorChar}"; + public static string MODICONS = @$"21_ModIcons{Path.DirectorySeparatorChar}"; + public static string AIBATTLE = @$"22_AIBattle{Path.DirectorySeparatorChar}"; + + // Special balloons + public static string KUSUDAMA = @$"Kusudama{Path.DirectorySeparatorChar}"; + public static string FUSE = @$"Fuseroll{Path.DirectorySeparatorChar}"; + + // Tower infos + public static string TOWERDON = @$"Tower_Don{Path.DirectorySeparatorChar}"; + public static string TOWERFLOOR = @$"Tower_Floors{Path.DirectorySeparatorChar}"; + + // InGame_Effects + public static string FIRE = @$"Fire{Path.DirectorySeparatorChar}"; + public static string HIT = @$"Hit{Path.DirectorySeparatorChar}"; + public static string ROLL = @$"Roll{Path.DirectorySeparatorChar}"; + public static string SPLASH = @$"Splash{Path.DirectorySeparatorChar}"; + + public Dictionary trackedTextures = new Dictionary(); + + public TextureLoader() { + // Constructor + } + + internal CTexture TxC(string FileName, bool localize = true) { + var texpath = (localize) ? HLocalizedPath.GetAvailableLocalizedPath(CSkin.Path(BASE + FileName)) : CSkin.Path(BASE + FileName); + var tex = OpenTaiko.tテクスチャの生成(texpath, false); + + listTexture.Add(tex); + return tex; + } + + internal CTexture TxCGlobal(string FileName) { + var tex = OpenTaiko.tテクスチャの生成(OpenTaiko.strEXEのあるフォルダ + GLOBAL + FileName, false); + listTexture.Add(tex); + return tex; + } + + internal CTexture TxCAbsolute(string FileName) { + var tex = OpenTaiko.tテクスチャの生成(FileName, false); + listTexture.Add(tex); + return tex; + } + + internal CTextureAf TxCAf(string FileName) { + var tex = OpenTaiko.tテクスチャの生成Af(CSkin.Path(BASE + FileName)); + listTexture.Add(tex); + return tex; + } + internal CTexture TxCGen(string FileName) { + return OpenTaiko.tテクスチャの生成(CSkin.Path(BASE + GAME + GENRE + FileName + ".png"), false); + } + + internal CTexture TxCSong(string path) { + return TxCUntrackedSong(path); + } + + private CTexture[] TxCSong(int count, string format, int start = 0) { + return TxCSong(format, Enumerable.Range(start, count).Select(o => o.ToString()).ToArray()); + } + + private CTexture[] TxCSong(string format, params string[] parts) { + return parts.Select(o => TxCSong(string.Format(format, o))).ToArray(); + } + + public CTexture[] TxCSongFolder(string folder) { + var count = OpenTaiko.t連番画像の枚数を数える(folder); + var texture = count == 0 ? null : TxCSong(count, folder + "{0}.png"); + return texture; + } + + internal CTexture TxCUntrackedSong(string path) { + return OpenTaiko.tテクスチャの生成(path, false); + } + + public void LoadTexture() { + CalibrateFG = TxC(CONFIG + $@"Calibration{Path.DirectorySeparatorChar}FG.png"); + CalibrateBG = TxC(CONFIG + $@"Calibration{Path.DirectorySeparatorChar}BG.png"); #region 共通 - public CTexture Tile_Black, - Menu_Title, - Menu_Highlight, - Enum_Song, - Loading, - Scanning_Loudness, - NamePlateBase, - NamePlate_Extension, - Overlay, - Readme, - Network_Connection; + Tile_Black = TxC(@$"Tile_Black.png"); + Menu_Title = TxC(@$"Menu_Title.png"); + Menu_Highlight = TxC(@$"Menu_Highlight.png"); + Enum_Song = TxC(@$"Enum_Song.png"); + Loading = TxC(@$"Loading.png"); + Scanning_Loudness = TxC(@$"Scanning_Loudness.png"); + Overlay = TxC(@$"Overlay.png"); + Network_Connection = TxC(@$"Network_Connection.png"); + Readme = TxC(@$"Readme.png"); + NamePlateBase = TxC(@$"NamePlate.png"); + NamePlate_Extension = TxC(@$"NamePlate_Extension.png"); #endregion #region 1_タイトル画面 + //Title_Background = TxC(TITLE + @$"Background.png"); + Entry_Bar = TxC(TITLE + @$"Entry_Bar.png"); + Entry_Bar_Text = TxC(TITLE + @$"Entry_Bar_Text.png"); - public CTexture - //Title_Background, - Entry_Bar, - Entry_Bar_Text; + Banapas_Load[0] = TxC(TITLE + @$"Banapas_Load.png"); + Banapas_Load[1] = TxC(TITLE + @$"Banapas_Load_Text.png"); + Banapas_Load[2] = TxC(TITLE + @$"Banapas_Load_Anime.png"); - public CTexture[] Banapas_Load = new CTexture[3]; - public CTexture[] Banapas_Load_Clear = new CTexture[2]; - public CTexture[] Banapas_Load_Failure = new CTexture[2]; - public CTexture[] Entry_Player = new CTexture[3]; - public CTexture[] ModeSelect_Bar; - public CTexture[] ModeSelect_Bar_Chara; + Banapas_Load_Clear[0] = TxC(TITLE + @$"Banapas_Load_Clear.png"); + Banapas_Load_Clear[1] = TxC(TITLE + @$"Banapas_Load_Clear_Anime.png"); + + Banapas_Load_Failure[0] = TxC(TITLE + @$"Banapas_Load_Failure.png"); + Banapas_Load_Failure[1] = TxC(TITLE + @$"Banapas_Load_Clear_Anime.png"); + + Entry_Player[0] = TxC(TITLE + @$"Entry_Player.png"); + Entry_Player[1] = TxC(TITLE + @$"Entry_Player_Select_Bar.png"); + Entry_Player[2] = TxC(TITLE + @$"Entry_Player_Select.png"); + + ModeSelect_Bar = new CTexture[CMainMenuTab.__MenuCount + 1]; + ModeSelect_Bar_Chara = new CTexture[CMainMenuTab.__MenuCount]; + + for (int i = 0; i < CMainMenuTab.__MenuCount; i++) { + ModeSelect_Bar[i] = TxC(TITLE + @$"ModeSelect_Bar_" + i.ToString() + ".png"); + } + + for (int i = 0; i < CMainMenuTab.__MenuCount; i++) { + ModeSelect_Bar_Chara[i] = TxC(TITLE + @$"ModeSelect_Bar_Chara_" + i.ToString() + ".png"); + } + + ModeSelect_Bar[CMainMenuTab.__MenuCount] = TxC(TITLE + @$"ModeSelect_Bar_Overlay.png"); #endregion #region 2_コンフィグ画面 - public CTexture - /*Config_Background, - Config_Header,*/ - Config_Cursor, - Config_ItemBox, - Config_Arrow, - Config_KeyAssign, - Config_Font, - Config_Font_Bold, - Config_Enum_Song; + //Config_Background = TxC(CONFIG + @$"Background.png"); + //Config_Header = TxC(CONFIG + @$"Header.png"); + Config_Cursor = TxC(CONFIG + @$"Cursor.png"); + Config_ItemBox = TxC(CONFIG + @$"ItemBox.png"); + Config_Arrow = TxC(CONFIG + @$"Arrow.png"); + Config_KeyAssign = TxC(CONFIG + @$"KeyAssign.png"); + Config_Font = TxC(CONFIG + @$"Font.png"); + Config_Font_Bold = TxC(CONFIG + @$"Font_Bold.png"); + Config_Enum_Song = TxC(CONFIG + @$"Enum_Song.png"); #endregion #region 3_選曲画面 + SongSelect_Background = TxC(SONGSELECT + @$"Background.png"); + SongSelect_Header = TxC(SONGSELECT + @$"Header.png"); + SongSelect_Footer = TxC(SONGSELECT + @$"Footer.png"); + SongSelect_Coin_Slot[0] = TxC(SONGSELECT + @$"Coin_Slot.png"); + SongSelect_Coin_Slot[1] = TxC(SONGSELECT + @$"Coin_Slot_3P.png"); + SongSelect_Coin_Slot[2] = TxC(SONGSELECT + @$"Coin_Slot_4P.png"); + SongSelect_Coin_Slot[3] = TxC(SONGSELECT + @$"Coin_Slot_5P.png"); - public CTexture SongSelect_Background, - SongSelect_Header, - SongSelect_Footer, - SongSelect_Auto, - SongSelect_Level, - SongSelect_Branch, - SongSelect_Branch_Text, - SongSelect_Lock, - SongSelect_Frame_Box, - SongSelect_Frame_BackBox, - SongSelect_Frame_Random, - SongSelect_Bar_Center, - SongSelect_Bar_Genre_Back, - SongSelect_Bar_Genre_Locked, - SongSelect_Bar_Genre_Locked_Top, - SongSelect_Bar_Genre_Random, - SongSelect_Bar_Genre_RecentryPlaySong, - SongSelect_Level_Number, - SongSelect_Level_Number_Colored, - SongSelect_Level_Number_Icon, - SongSelect_Level_Number_Big, - SongSelect_Level_Number_Big_Colored, - SongSelect_Level_Number_Big_Icon, - SongSelect_Bpm_Number, - SongSelect_Floor_Number, - SongSelect_Bar_Select, - SongSelect_Bar_Genre_Overlay, - SongSelect_Credit, - SongSelect_Timer, - SongSelect_Explicit, - SongSelect_Movie, - SongSelect_Crown, - SongSelect_ScoreRank, - SongSelect_Song_Number, - SongSelect_BoardNumber, - SongSelect_Difficulty_Cymbol, - SongSelect_Unlock_Conditions, - SongSelect_Tower_Side, + SongSelect_Auto = TxC(SONGSELECT + @$"Auto.png"); + SongSelect_Level = TxC(SONGSELECT + @$"Level.png"); + SongSelect_Branch = TxC(SONGSELECT + @$"Branch.png"); + SongSelect_Branch_Text = TxC(SONGSELECT + @$"Branch_Text.png"); + SongSelect_Bar_Center = TxC(SONGSELECT + @$"Bar_Center.png"); + SongSelect_Lock = TxC(SONGSELECT + @$"Lock.png"); - SongSelect_Favorite, - SongSelect_High_Score, + SongSelect_Frame_Score[0] = TxC(SONGSELECT + @$"Frame_Score.png"); + SongSelect_Frame_Score[1] = TxC(SONGSELECT + @$"Frame_Score_Tower.png"); + SongSelect_Frame_Score[2] = TxC(SONGSELECT + @$"Frame_Score_Dan.png"); - SongSelect_Level_Icons, - SongSelect_Search_Arrow, - SongSelect_Search_Arrow_Glow, - SongSelect_Search_Window, + SongSelect_Tower_Side = TxC(SONGSELECT + @$"Tower_Side.png"); - SongSelect_ScoreWindow_Text; - public Dictionary SongSelect_GenreBack, - SongSelect_Bar_Genre, - SongSelect_Bar_Genre_Overlap, - SongSelect_Box_Chara; - public CTexture[] - SongSelect_ScoreWindow = new CTexture[(int)Difficulty.Total], - SongSelect_Frame_Score = new CTexture[3], - SongSelect_NamePlate = new CTexture[1], - SongSelect_Song_Panel = new CTexture[6], - SongSelect_Coin_Slot = new CTexture[4], - SongSelect_Table = new CTexture[6]; + SongSelect_Frame_Box = TxC(SONGSELECT + @$"Frame_Box.png"); + SongSelect_Frame_BackBox = TxC(SONGSELECT + @$"Frame_BackBox.png"); + SongSelect_Frame_Random = TxC(SONGSELECT + @$"Frame_Random.png"); + SongSelect_Bar_Genre_Back = TxC(SONGSELECT + @$"Bar_Genre_Back.png"); + SongSelect_Bar_Genre_Locked = TxC(SONGSELECT + @$"Bar_Genre_Locked.png"); + SongSelect_Bar_Genre_Locked_Top = TxC(SONGSELECT + @$"Bar_Genre_Locked_Top.png"); + SongSelect_Bar_Genre_Random = TxC(SONGSELECT + @$"Bar_Genre_Random.png"); + SongSelect_Bar_Genre_RecentryPlaySong = TxC(SONGSELECT + @$"Bar_Genre_RecentryPlaySong.png"); + SongSelect_Bar_Select = TxC(SONGSELECT + @$"Bar_Select.png"); + SongSelect_Level_Number = TxC(SONGSELECT + @$"Level_Number.png"); + SongSelect_Level_Number_Big = TxC(SONGSELECT + @$"Level_Number_Big.png"); + SongSelect_Level_Number_Big_Colored = TxC(SONGSELECT + @$"Level_Number_Big_Colored.png"); + SongSelect_Level_Number_Colored = TxC(SONGSELECT + @$"Level_Number_Colored.png"); + SongSelect_Level_Number_Big_Icon = TxC(SONGSELECT + @$"Level_Number_Big_Icon.png"); + SongSelect_Level_Number_Icon = TxC(SONGSELECT + @$"Level_Number_Icon.png"); + SongSelect_Bpm_Number = TxC(SONGSELECT + @$"Bpm_Number.png"); + SongSelect_Floor_Number = TxC(SONGSELECT + @$"Floor_Number.png"); + SongSelect_Credit = TxC(SONGSELECT + @$"Credit.png"); + SongSelect_Timer = TxC(SONGSELECT + @$"Timer.png"); + SongSelect_Explicit = TxC(SONGSELECT + @$"Explicit.png"); + SongSelect_Movie = TxC(SONGSELECT + @$"Movie.png"); + SongSelect_Song_Number = TxC(SONGSELECT + @$"Song_Number.png"); + SongSelect_Bar_Genre_Overlay = TxC(SONGSELECT + @$"Bar_Genre_Overlay.png"); + SongSelect_Crown = TxC(SONGSELECT + @$"SongSelect_Crown.png"); + SongSelect_ScoreRank = TxC(SONGSELECT + @$"ScoreRank.png"); + SongSelect_BoardNumber = TxC(SONGSELECT + @$"BoardNumber.png"); + SongSelect_Difficulty_Cymbol = TxC(SONGSELECT + "Difficulty_Cymbol.png"); + SongSelect_Unlock_Conditions = TxC(SONGSELECT + "Unlock_Conditions.png"); + + SongSelect_Favorite = TxC(SONGSELECT + @$"Favorite.png"); + SongSelect_High_Score = TxC(SONGSELECT + @$"High_Score.png"); + + SongSelect_Level_Icons = TxC(SONGSELECT + @$"Level_Icons.png"); + SongSelect_Search_Arrow = TxC(SONGSELECT + @$"Search{Path.DirectorySeparatorChar}Search_Arrow.png"); + SongSelect_Search_Arrow_Glow = TxC(SONGSELECT + @$"Search{Path.DirectorySeparatorChar}Search_Arrow_Glow.png"); + SongSelect_Search_Window = TxC(SONGSELECT + @$"Search{Path.DirectorySeparatorChar}Search_Window.png"); + + for (int i = 0; i < (int)Difficulty.Total; i++) { + SongSelect_ScoreWindow[i] = TxC(SONGSELECT + @$"ScoreWindow_" + i.ToString() + ".png"); + } + + SongSelect_ScoreWindow_Text = TxC(SONGSELECT + @$"ScoreWindow_Text.png"); + + + + { + string[] genre_files = Directory.GetFiles(CSkin.Path(BASE + SONGSELECT + @$"Bar_Genre{Path.DirectorySeparatorChar}"), "Bar_Genre_*.png"); + SongSelect_Bar_Genre = new(); + for (int i = 0; i < genre_files.Length; i++) { + string name = Path.GetFileNameWithoutExtension(genre_files[i]).Split('_')[2]; + if (name != "Overlap") SongSelect_Bar_Genre.Add(name, TxC(SONGSELECT + @$"Bar_Genre{Path.DirectorySeparatorChar}Bar_Genre_" + name + ".png")); + } + } + { + string[] genre_files = Directory.GetFiles(CSkin.Path(BASE + SONGSELECT + @$"Bar_Genre{Path.DirectorySeparatorChar}"), "Bar_Genre_Overlap_*.png"); + SongSelect_Bar_Genre_Overlap = new(); + for (int i = 0; i < genre_files.Length; i++) { + string name = Path.GetFileNameWithoutExtension(genre_files[i]).Split('_')[3]; + SongSelect_Bar_Genre_Overlap.Add(name, TxC(SONGSELECT + @$"Bar_Genre{Path.DirectorySeparatorChar}Bar_Genre_Overlap_" + name + ".png")); + } + } + + { + string[] genre_files = Directory.GetFiles(CSkin.Path(BASE + SONGSELECT + @$"Genre_Background{Path.DirectorySeparatorChar}"), "GenreBackground_*.png"); + SongSelect_GenreBack = new(); + for (int i = 0; i < genre_files.Length; i++) { + string name = Path.GetFileNameWithoutExtension(genre_files[i]).Split('_')[1]; + SongSelect_GenreBack.Add(name, TxC(SONGSELECT + @$"Genre_Background{Path.DirectorySeparatorChar}GenreBackground_" + name + ".png")); + } + } + + { + string[] genre_files = Directory.GetFiles(CSkin.Path(BASE + SONGSELECT + @$"Box_Chara{Path.DirectorySeparatorChar}"), "Box_Chara_*.png"); + SongSelect_Box_Chara = new(); + for (int i = 0; i < genre_files.Length; i++) { + string name = Path.GetFileNameWithoutExtension(genre_files[i]).Split('_')[2]; + SongSelect_Box_Chara.Add(name, TxC(SONGSELECT + @$"Box_Chara{Path.DirectorySeparatorChar}Box_Chara_" + name + ".png")); + } + } + + for (int i = 0; i < SongSelect_Table.Length; i++) { + SongSelect_Table[i] = TxC(SONGSELECT + @$"Table{Path.DirectorySeparatorChar}" + i.ToString() + ".png"); + } + + SongSelect_Song_Panel[0] = TxC(SONGSELECT + @$"Song_Panel{Path.DirectorySeparatorChar}Song_Panel_Box.png"); + SongSelect_Song_Panel[1] = TxC(SONGSELECT + @$"Song_Panel{Path.DirectorySeparatorChar}Song_Panel_Song.png"); + SongSelect_Song_Panel[2] = TxC(SONGSELECT + @$"Song_Panel{Path.DirectorySeparatorChar}Song_Panel_Dan.png"); + SongSelect_Song_Panel[3] = TxC(SONGSELECT + @$"Song_Panel{Path.DirectorySeparatorChar}Song_Panel_Tower.png"); + SongSelect_Song_Panel[4] = TxC(SONGSELECT + @$"Song_Panel{Path.DirectorySeparatorChar}Song_Panel_Locked_Song.png"); + SongSelect_Song_Panel[5] = TxC(SONGSELECT + @$"Song_Panel{Path.DirectorySeparatorChar}Song_Panel_Locked_Asset.png"); #region [ 難易度選択画面 ] - public CTexture Difficulty_Bar; - public CTexture Difficulty_Number; - public CTexture Difficulty_Number_Colored; - public CTexture Difficulty_Number_Icon; - public CTexture Difficulty_Star; - public CTexture Difficulty_Crown; - public CTexture Difficulty_Option; - public CTexture Difficulty_Option_Select; + Difficulty_Bar = TxC(SONGSELECT + @$"Difficulty_Select{Path.DirectorySeparatorChar}Difficulty_Bar.png"); + Difficulty_Number = TxC(SONGSELECT + @$"Difficulty_Select{Path.DirectorySeparatorChar}Difficulty_Number.png"); + Difficulty_Number_Colored = TxC(SONGSELECT + @$"Difficulty_Select{Path.DirectorySeparatorChar}Difficulty_Number_Colored.png"); + Difficulty_Number_Icon = TxC(SONGSELECT + @$"Difficulty_Select{Path.DirectorySeparatorChar}Difficulty_Number_Icon.png"); + Difficulty_Star = TxC(SONGSELECT + @$"Difficulty_Select{Path.DirectorySeparatorChar}Difficulty_Star.png"); + Difficulty_Crown = TxC(SONGSELECT + @$"Difficulty_Select{Path.DirectorySeparatorChar}Difficulty_Crown.png"); + Difficulty_Option = TxC($"{SONGSELECT}Difficulty_Select/Difficulty_Option.png"); + Difficulty_Option_Select = TxC($"{SONGSELECT}Difficulty_Select/Difficulty_Option_Select.png"); - public CTexture[] Difficulty_Select_Bar = new CTexture[5]; - public Dictionary Difficulty_Back; + Difficulty_Select_Bar[0] = TxC(SONGSELECT + @$"Difficulty_Select{Path.DirectorySeparatorChar}Difficulty_Select_Bar.png"); + Difficulty_Select_Bar[1] = TxC(SONGSELECT + @$"Difficulty_Select{Path.DirectorySeparatorChar}Difficulty_Select_Bar2.png"); + Difficulty_Select_Bar[2] = TxC(SONGSELECT + @$"Difficulty_Select{Path.DirectorySeparatorChar}Difficulty_Select_Bar3.png"); + Difficulty_Select_Bar[3] = TxC(SONGSELECT + @$"Difficulty_Select{Path.DirectorySeparatorChar}Difficulty_Select_Bar4.png"); + Difficulty_Select_Bar[4] = TxC(SONGSELECT + @$"Difficulty_Select{Path.DirectorySeparatorChar}Difficulty_Select_Bar5.png"); + + { + string[] genre_files = Directory.GetFiles(CSkin.Path(BASE + SONGSELECT + @$"Difficulty_Select{Path.DirectorySeparatorChar}Difficulty_Back{Path.DirectorySeparatorChar}"), "Difficulty_Back_*.png"); + Difficulty_Back = new(); + for (int i = 0; i < genre_files.Length; i++) { + string name = Path.GetFileNameWithoutExtension(genre_files[i]).Split('_')[2]; + Difficulty_Back.Add(name, TxC(SONGSELECT + @$"Difficulty_Select{Path.DirectorySeparatorChar}Difficulty_Back{Path.DirectorySeparatorChar}Difficulty_Back_" + name + ".png")); + } + } #endregion - public CTexture NewHeya_Close; - public CTexture NewHeya_Close_Select; - public CTexture[] NewHeya_PlayerPlate = new CTexture[5]; - public CTexture NewHeya_PlayerPlate_Select; - public CTexture NewHeya_ModeBar; - public CTexture NewHeya_ModeBar_Select; - public CTexture NewHeya_Box; - public CTexture NewHeya_Lock; + NewHeya_Close = TxC(SONGSELECT + @$"NewHeya{Path.DirectorySeparatorChar}Close.png"); + NewHeya_Close_Select = TxC(SONGSELECT + @$"NewHeya{Path.DirectorySeparatorChar}Close_Select.png"); + NewHeya_PlayerPlate[0] = TxC(SONGSELECT + @$"NewHeya{Path.DirectorySeparatorChar}PlayerPlate_1P.png"); + NewHeya_PlayerPlate[1] = TxC(SONGSELECT + @$"NewHeya{Path.DirectorySeparatorChar}PlayerPlate_2P.png"); + NewHeya_PlayerPlate[2] = TxC(SONGSELECT + @$"NewHeya{Path.DirectorySeparatorChar}PlayerPlate_3P.png"); + NewHeya_PlayerPlate[3] = TxC(SONGSELECT + @$"NewHeya{Path.DirectorySeparatorChar}PlayerPlate_4P.png"); + NewHeya_PlayerPlate[4] = TxC(SONGSELECT + @$"NewHeya{Path.DirectorySeparatorChar}PlayerPlate_5P.png"); + NewHeya_PlayerPlate_Select = TxC(SONGSELECT + @$"NewHeya{Path.DirectorySeparatorChar}PlayerPlate_Select.png"); + NewHeya_ModeBar = TxC(SONGSELECT + @$"NewHeya{Path.DirectorySeparatorChar}ModeBar.png"); + NewHeya_ModeBar_Select = TxC(SONGSELECT + @$"NewHeya{Path.DirectorySeparatorChar}ModeBar_Select.png"); + NewHeya_Box = TxC(SONGSELECT + @$"NewHeya{Path.DirectorySeparatorChar}Box.png"); + NewHeya_Lock = TxC(SONGSELECT + @$"NewHeya{Path.DirectorySeparatorChar}Lock.png"); #endregion #region 3_段位選択画面 - //public CTexture Dani_Background; - public CTexture Dani_Difficulty_Cymbol; - public CTexture Dani_Level_Number; - public CTexture Dani_Soul_Number; - public CTexture Dani_Exam_Number; - public CTexture Dani_Bar_Center; - public CTexture Dani_Bar_Back; - public CTexture Dani_Bar_Folder; - public CTexture Dani_Bar_Folder_Back; - public CTexture Dani_Bar_Random; - public CTexture Dani_Plate; - public CTexture Dani_Plate_Extra; + //Dani_Background = TxC(DANISELECT + "Background.png"); + Dani_Difficulty_Cymbol = TxC(DANISELECT + "Difficulty_Cymbol.png"); + Dani_Level_Number = TxC(DANISELECT + "Level_Number.png"); + Dani_Soul_Number = TxC(DANISELECT + "SoulNumber.png"); + Dani_Exam_Number = TxC(DANISELECT + "ExamNumber.png"); + Dani_Bar_Center = TxC(DANISELECT + "Bar_Center.png"); + Dani_Bar_Back = TxC(DANISELECT + "Bar_Back.png"); + Dani_Bar_Folder = TxC(DANISELECT + "Bar_Folder.png"); + Dani_Bar_Folder_Back = TxC(DANISELECT + "Bar_Folder_Back.png"); + Dani_Bar_Random = TxC(DANISELECT + "Bar_Random.png"); + Dani_Plate = TxC(DANISELECT + "Plate.png"); + Dani_Plate_Extra = TxC(DANISELECT + "Plate_Extra.png"); - public CTexture[] Challenge_Select = new CTexture[3]; + for (int i = 0; i < Challenge_Select.Length; i++) + Challenge_Select[i] = TxC(DANISELECT + "Challenge_Select_" + i.ToString() + ".png"); - //public CTexture Dani_Dan_In; - //public CTexture Dani_Dan_Text; + //Dani_Dan_In = TxC(DANISELECT + "Dan_In.png"); + //Dani_Dan_Text = TxC(DANISELECT + "Dan_Text.png"); - public CTexture Dani_DanPlates; - public CTexture Dani_DanPlates_Back; - public CTexture Dani_DanIcon; - public CTexture Dani_DanIcon_Fade; - public CTexture Dani_DanSides; - public CTexture[] Dani_Bloc = new CTexture[4]; + Dani_DanPlates = TxC(DANISELECT + "DanPlates.png"); + Dani_DanPlates_Back = TxC(DANISELECT + "DanPlates_Back.png"); + Dani_DanIcon = TxC(DANISELECT + "DanIcon.png"); + Dani_DanIcon_Fade = TxC(DANISELECT + "DanIcon_Fade.png"); + Dani_DanSides = TxC(DANISELECT + "DanSides.png"); + + for (int i = 0; i < Dani_Bloc.Length; i++) + Dani_Bloc[i] = TxC(DANISELECT + "Bloc" + i.ToString() + ".png"); #endregion #region 4_読み込み画面 - public CTexture SongLoading_Plate, - SongLoading_Bg, - SongLoading_BgWait, - SongLoading_Chara, - SongLoading_Bg_Dan, - SongLoading_Fade, - SongLoading_Plate_AI, - SongLoading_Bg_AI, - SongLoading_Bg_AI_Wait, - SongLoading_Fade_AI, - SongLoading_Fade_AI_Anime_Base, - SongLoading_Fade_AI_Anime_Ring, - SongLoading_Fade_AI_Anime_NowLoading, - SongLoading_Fade_AI_Anime_Start, - SongLoading_Fade_AI_Anime_LoadBar_Base, - SongLoading_Fade_AI_Anime_LoadBar; + SongLoading_Plate = TxC(SONGLOADING + @$"Plate.png"); + SongLoading_Bg = TxC(SONGLOADING + @$"Bg.png"); + SongLoading_BgWait = TxC(SONGLOADING + @$"Bg_Wait.png"); + SongLoading_Chara = TxC(SONGLOADING + @$"Chara.png"); + SongLoading_Fade = TxC(SONGLOADING + @$"Fade.png"); + SongLoading_Bg_Dan = TxC(SONGLOADING + @$"Bg_Dan.png"); + + SongLoading_Plate_AI = TxC(SONGLOADING + @$"Plate_AI.png"); + SongLoading_Bg_AI = TxC(SONGLOADING + @$"Bg_AI.png"); + SongLoading_Bg_AI_Wait = TxC(SONGLOADING + @$"Bg_AI_Wait.png"); + SongLoading_Fade_AI = TxC(SONGLOADING + @$"Fade_AI.png"); + SongLoading_Fade_AI_Anime_Base = TxC(SONGLOADING + @$"Fade_AI_Anime_Base.png"); + SongLoading_Fade_AI_Anime_Ring = TxC(SONGLOADING + @$"Fade_AI_Anime_Ring.png"); + SongLoading_Fade_AI_Anime_NowLoading = TxC(SONGLOADING + @$"Fade_AI_Anime_NowLoading.png"); + SongLoading_Fade_AI_Anime_Start = TxC(SONGLOADING + @$"Fade_AI_Anime_Start.png"); + SongLoading_Fade_AI_Anime_LoadBar_Base = TxC(SONGLOADING + @$"Fade_AI_Anime_LoadBar_Base.png"); + SongLoading_Fade_AI_Anime_LoadBar = TxC(SONGLOADING + @$"Fade_AI_Anime_LoadBar.png"); + #endregion #region 5_演奏画面 - #region 共通 - public CTexture Judge_Frame, - Note_Mine, - Note_Swap, - Note_Kusu, - Note_FuseRoll, - Note_Adlib, - SENotesExtension, - Notes_Arm, - ChipEffect, - ScoreRank, - Judge; - public CTexture Judge_Meter, - Bar, - Bar_Branch; - public CTexture[] Notes, - SENotes; + + #region General + + Notes = new CTexture[2]; + Notes[0] = TxC(GAME + @$"Notes.png"); + Notes[1] = TxC(GAME + @$"Notes_Konga.png"); + + Note_Mine = TxC(GAME + @$"Mine.png"); + Note_Swap = TxC(GAME + @$"Swap.png"); + Note_Kusu = TxC(GAME + @$"Kusu.png"); + Note_FuseRoll = TxC(GAME + @$"FuseRoll.png"); + Note_Adlib = TxC(GAME + @$"Adlib.png"); + + Judge_Frame = TxC(GAME + @$"Notes.png"); + + SENotes = new CTexture[2]; + SENotes[0] = TxC(GAME + @$"SENotes.png"); + SENotes[1] = TxC(GAME + @$"SENotes_Konga.png"); + + SENotesExtension = TxC(GAME + @$"SENotes_Extension.png"); + + Notes_Arm = TxC(GAME + @$"Notes_Arm.png"); + Judge = TxC(GAME + @$"Judge.png"); + ChipEffect = TxC(GAME + @$"ChipEffect.png"); + ScoreRank = TxC(GAME + @$"ScoreRank.png"); + + Judge_Meter = TxC(GAME + @$"Judge_Meter.png"); + Bar = TxC(GAME + @$"Bar.png"); + Bar_Branch = TxC(GAME + @$"Bar_Branch.png"); + + var _presetsDefs = CSkin.Path(BASE + GAME + BACKGROUND + @$"Presets.json"); + if (File.Exists(_presetsDefs)) + OpenTaiko.Skin.Game_SkinScenes = ConfigManager.GetConfig(_presetsDefs); + else + OpenTaiko.Skin.Game_SkinScenes = new DBSkinPreset.SkinPreset(); + #endregion + #region Mob - #region モブ #endregion - #region 太鼓 - public CTexture[] Taiko_Base, - Taiko_Frame, // MTaiko下敷き - Taiko_Background; - public CTexture Taiko_Don_Left, - Taiko_Don_Right, - Taiko_Ka_Left, - Taiko_Ka_Right, - Taiko_Konga_Don, - Taiko_Konga_Ka, - Taiko_Konga_Clap, - Taiko_LevelUp, - Taiko_LevelDown, - Taiko_Combo_Effect, - Taiko_Combo_Text; - public CTexture[] Couse_Symbol, // コースシンボル - Couse_Symbol_Back, - Couse_Symbol_Back_Flash, - Taiko_PlayerNumber, - Taiko_NamePlate; // ネームプレート - public CTexture[] Taiko_Score, - Taiko_Combo, - Taiko_Combo_Guide; - #endregion - #region ゲージ - public CTexture[] Gauge, - Gauge_Base, - Gauge_Base_Norma, - Gauge_Line, - Gauge_Rainbow, - Gauge_Rainbow_2PGauge, - Gauge_Rainbow_Flat, - Gauge_Clear, - Gauge_Killzone, - Gauge_Soul_Explosion; - public CTexture Gauge_Soul, - Gauge_Soul_Fire; - public CTexture[] Gauge_Dan; - public CTexture[] Gauge_Dan_Rainbow; - #endregion - #region 吹き出し - public CTexture[] Balloon_Combo; - public CTexture Balloon_Roll, - Balloon_Balloon, - Balloon_Number_Roll, - Balloon_Number_Combo/*,*/ - /*Balloon_Broken*/; - public CTexture Kusudama_Number; - public CTexture Fuse_Number, - Fuse_Balloon; + #region Taiko + + Taiko_Background = new CTexture[12]; + Taiko_Background[0] = TxC(GAME + TAIKO + @$"1P_Background.png"); + Taiko_Background[1] = TxC(GAME + TAIKO + @$"2P_Background.png"); + Taiko_Background[2] = TxC(GAME + TAIKO + @$"Dan_Background.png"); + Taiko_Background[3] = TxC(GAME + TAIKO + @$"Tower_Background.png"); + Taiko_Background[4] = TxC(GAME + TAIKO + @$"1P_Background_Right.png"); + Taiko_Background[5] = TxC(GAME + TAIKO + @$"1P_Background_Tokkun.png"); + Taiko_Background[6] = TxC(GAME + TAIKO + @$"2P_Background_Tokkun.png"); + Taiko_Background[7] = TxC(GAME + TAIKO + @$"3P_Background.png"); + Taiko_Background[8] = TxC(GAME + TAIKO + @$"4P_Background.png"); + Taiko_Background[9] = TxC(GAME + TAIKO + @$"AI_Background.png"); + Taiko_Background[10] = TxC(GAME + TAIKO + @$"Boss_Background.png"); + Taiko_Background[11] = TxC(GAME + TAIKO + @$"5P_Background.png"); + + Taiko_Frame = new CTexture[7]; + Taiko_Frame[0] = TxC(GAME + TAIKO + @$"1P_Frame.png"); + Taiko_Frame[1] = TxC(GAME + TAIKO + @$"2P_Frame.png"); + Taiko_Frame[2] = TxC(GAME + TAIKO + @$"Tower_Frame.png"); + Taiko_Frame[3] = TxC(GAME + TAIKO + @$"Tokkun_Frame.png"); + Taiko_Frame[4] = TxC(GAME + TAIKO + @$"2P_None_Frame.png"); + Taiko_Frame[5] = TxC(GAME + TAIKO + @$"AI_Frame.png"); + Taiko_Frame[6] = TxC(GAME + TAIKO + @$"4PPlay_Frame.png"); + + Taiko_PlayerNumber = new CTexture[5]; + Taiko_PlayerNumber[0] = TxC(GAME + TAIKO + @$"1P_PlayerNumber.png"); + Taiko_PlayerNumber[1] = TxC(GAME + TAIKO + @$"2P_PlayerNumber.png"); + Taiko_PlayerNumber[2] = TxC(GAME + TAIKO + @$"3P_PlayerNumber.png"); + Taiko_PlayerNumber[3] = TxC(GAME + TAIKO + @$"4P_PlayerNumber.png"); + Taiko_PlayerNumber[4] = TxC(GAME + TAIKO + @$"5P_PlayerNumber.png"); + + + Taiko_Base = new CTexture[2]; + Taiko_Base[0] = TxC(GAME + TAIKO + @$"Base.png"); + Taiko_Base[1] = TxC(GAME + TAIKO + @$"Base_Konga.png"); + + Taiko_Don_Left = TxC(GAME + TAIKO + @$"Don.png"); + Taiko_Don_Right = TxC(GAME + TAIKO + @$"Don.png"); + Taiko_Ka_Left = TxC(GAME + TAIKO + @$"Ka.png"); + Taiko_Ka_Right = TxC(GAME + TAIKO + @$"Ka.png"); + + Taiko_Konga_Don = TxC(GAME + TAIKO + @$"Don_Konga.png"); + Taiko_Konga_Ka = TxC(GAME + TAIKO + @$"Ka_Konga.png"); + Taiko_Konga_Clap = TxC(GAME + TAIKO + @$"Clap.png"); + + Taiko_LevelUp = TxC(GAME + TAIKO + @$"LevelUp.png"); + Taiko_LevelDown = TxC(GAME + TAIKO + @$"LevelDown.png"); + Couse_Symbol = new CTexture[(int)Difficulty.Total + 1]; // +1は真打ちモードの分 + Couse_Symbol_Back = new CTexture[(int)Difficulty.Total + 1]; // +1は真打ちモードの分 + Couse_Symbol_Back_Flash = new CTexture[(int)Difficulty.Total + 1]; // +1は真打ちモードの分 + string[] Couse_Symbols = new string[(int)Difficulty.Total + 1] { "Easy", "Normal", "Hard", "Oni", "Edit", "Tower", "Dan", "Shin" }; + for (int i = 0; i < (int)Difficulty.Total + 1; i++) { + Couse_Symbol[i] = TxC(GAME + COURSESYMBOL + Couse_Symbols[i] + ".png"); + Couse_Symbol_Back[i] = TxC(GAME + COURSESYMBOL + Couse_Symbols[i] + "_Back.png"); + Couse_Symbol_Back_Flash[i] = TxC(GAME + COURSESYMBOL + Couse_Symbols[i] + "_Back_Flash.png"); + } + + Taiko_Score = new CTexture[6]; + Taiko_Score[0] = TxC(GAME + TAIKO + @$"Score.png"); + Taiko_Score[1] = TxC(GAME + TAIKO + @$"Score_1P.png"); + Taiko_Score[2] = TxC(GAME + TAIKO + @$"Score_2P.png"); + Taiko_Score[3] = TxC(GAME + TAIKO + @$"Score_3P.png"); + Taiko_Score[4] = TxC(GAME + TAIKO + @$"Score_4P.png"); + Taiko_Score[5] = TxC(GAME + TAIKO + @$"Score_5P.png"); + Taiko_Combo = new CTexture[4]; + Taiko_Combo[0] = TxC(GAME + TAIKO + @$"Combo.png"); + Taiko_Combo[1] = TxC(GAME + TAIKO + @$"Combo_Big.png"); + Taiko_Combo[2] = TxC(GAME + TAIKO + @$"Combo_Midium.png"); + Taiko_Combo[3] = TxC(GAME + TAIKO + @$"Combo_Huge.png"); + Taiko_Combo_Effect = TxC(GAME + TAIKO + @$"Combo_Effect.png"); + Taiko_Combo_Text = TxC(GAME + TAIKO + @$"Combo_Text.png"); + + Taiko_Combo_Guide = new CTexture[3]; + for (int i = 0; i < Taiko_Combo_Guide.Length; i++) { + Taiko_Combo_Guide[i] = TxC(GAME + TAIKO + @$"Combo_Guide" + i.ToString() + ".png"); + } - public CTexture[] Balloon_Breaking; #endregion - #region エフェクト - public CTexture Effects_Hit_Explosion, - Effects_Hit_Bomb, - Effects_Hit_Explosion_Big, - Effects_Fire, - Effects_Rainbow, - Effects_GoGoSplash, - Effects_Hit_FireWorks; - public CTexture[] Effects_Hit_Great, - Effects_Hit_Good, - Effects_Hit_Great_Big, - Effects_Hit_Good_Big; - public CTexture[] Effects_Roll; + + #region Gauge + + Gauge = new CTexture[8]; + Gauge[0] = TxC(GAME + GAUGE + @$"1P.png"); + Gauge[1] = TxC(GAME + GAUGE + @$"2P.png"); + Gauge[2] = TxC(GAME + GAUGE + @$"1P_Right.png"); + Gauge[3] = TxC(GAME + GAUGE + @$"1P_4PGauge.png"); + Gauge[4] = TxC(GAME + GAUGE + @$"2P_4PGauge.png"); + Gauge[5] = TxC(GAME + GAUGE + @$"3P_4PGauge.png"); + Gauge[6] = TxC(GAME + GAUGE + @$"4P_4PGauge.png"); + Gauge[7] = TxC(GAME + GAUGE + @$"5P_4PGauge.png"); + + Gauge_Base = new CTexture[8]; + Gauge_Base[0] = TxC(GAME + GAUGE + @$"1P_Base.png"); + Gauge_Base[1] = TxC(GAME + GAUGE + @$"2P_Base.png"); + Gauge_Base[2] = TxC(GAME + GAUGE + @$"1P_Base_Right.png"); + Gauge_Base[3] = TxC(GAME + GAUGE + @$"1P_Base_4PGauge.png"); + Gauge_Base[4] = TxC(GAME + GAUGE + @$"2P_Base_4PGauge.png"); + Gauge_Base[5] = TxC(GAME + GAUGE + @$"3P_Base_4PGauge.png"); + Gauge_Base[6] = TxC(GAME + GAUGE + @$"4P_Base_4PGauge.png"); + Gauge_Base[7] = TxC(GAME + GAUGE + @$"5P_Base_4PGauge.png"); + + Gauge_Line = new CTexture[2]; + Gauge_Line[0] = TxC(GAME + GAUGE + @$"1P_Line.png"); + Gauge_Line[1] = TxC(GAME + GAUGE + @$"2P_Line.png"); + + Gauge_Clear = new CTexture[3]; + Gauge_Clear[0] = TxC(GAME + GAUGE + @$"Clear.png"); + Gauge_Clear[1] = TxC(GAME + GAUGE + @$"Clear_2PGauge.png"); + Gauge_Clear[2] = TxC(GAME + GAUGE + @$"Clear_4PGauge.png"); + + Gauge_Base_Norma = new CTexture[3]; + Gauge_Base_Norma[0] = TxC(GAME + GAUGE + @$"Norma_Base.png"); + Gauge_Base_Norma[1] = TxC(GAME + GAUGE + @$"Norma_Base_2PGauge.png"); + Gauge_Base_Norma[2] = TxC(GAME + GAUGE + @$"Norma_Base_4PGauge.png"); + + Gauge_Killzone = new CTexture[3]; + Gauge_Killzone[0] = TxC(GAME + GAUGE + @$"Killzone.png"); + Gauge_Killzone[1] = TxC(GAME + GAUGE + @$"Killzone_2PGauge.png"); + Gauge_Killzone[2] = TxC(GAME + GAUGE + @$"Killzone_4PGauge.png"); + + OpenTaiko.Skin.Game_Gauge_Rainbow_Ptn = OpenTaiko.t連番画像の枚数を数える(CSkin.Path(BASE + GAME + GAUGE + @$"Rainbow{Path.DirectorySeparatorChar}")); + if (OpenTaiko.Skin.Game_Gauge_Rainbow_Ptn != 0) { + Gauge_Rainbow = new CTexture[OpenTaiko.Skin.Game_Gauge_Rainbow_Ptn]; + for (int i = 0; i < OpenTaiko.Skin.Game_Gauge_Rainbow_Ptn; i++) { + Gauge_Rainbow[i] = TxC(GAME + GAUGE + @$"Rainbow{Path.DirectorySeparatorChar}" + i.ToString() + ".png"); + } + } + + OpenTaiko.Skin.Game_Gauge_Rainbow_Flat_Ptn = OpenTaiko.t連番画像の枚数を数える(CSkin.Path(BASE + GAME + GAUGE + @$"Rainbow_Flat{Path.DirectorySeparatorChar}")); + if (OpenTaiko.Skin.Game_Gauge_Rainbow_Flat_Ptn != 0) { + Gauge_Rainbow_Flat = new CTexture[OpenTaiko.Skin.Game_Gauge_Rainbow_Flat_Ptn]; + for (int i = 0; i < OpenTaiko.Skin.Game_Gauge_Rainbow_Flat_Ptn; i++) { + Gauge_Rainbow_Flat[i] = TxC(GAME + GAUGE + @$"Rainbow_Flat{Path.DirectorySeparatorChar}" + i.ToString() + ".png"); + } + } + + OpenTaiko.Skin.Game_Gauge_Rainbow_2PGauge_Ptn = OpenTaiko.t連番画像の枚数を数える(CSkin.Path(BASE + GAME + GAUGE + @$"Rainbow_2PGauge{Path.DirectorySeparatorChar}")); + if (OpenTaiko.Skin.Game_Gauge_Rainbow_2PGauge_Ptn != 0) { + Gauge_Rainbow_2PGauge = new CTexture[OpenTaiko.Skin.Game_Gauge_Rainbow_2PGauge_Ptn]; + for (int i = 0; i < OpenTaiko.Skin.Game_Gauge_Rainbow_2PGauge_Ptn; i++) { + Gauge_Rainbow_2PGauge[i] = TxC(GAME + GAUGE + @$"Rainbow_2PGauge{Path.DirectorySeparatorChar}" + i.ToString() + ".png"); + } + } + + // Dan + + OpenTaiko.Skin.Game_Gauge_Dan_Rainbow_Ptn = OpenTaiko.t連番画像の枚数を数える(CSkin.Path(BASE + GAME + DANC + @$"Rainbow{Path.DirectorySeparatorChar}")); + if (OpenTaiko.Skin.Game_Gauge_Dan_Rainbow_Ptn != 0) { + Gauge_Dan_Rainbow = new CTexture[OpenTaiko.Skin.Game_Gauge_Dan_Rainbow_Ptn]; + for (int i = 0; i < OpenTaiko.Skin.Game_Gauge_Dan_Rainbow_Ptn; i++) { + Gauge_Dan_Rainbow[i] = TxC(GAME + DANC + @$"Rainbow{Path.DirectorySeparatorChar}" + i.ToString() + ".png"); + } + } + + Gauge_Dan = new CTexture[6]; + + Gauge_Dan[0] = TxC(GAME + GAUGE + @$"1P_Dan_Base.png"); + Gauge_Dan[1] = TxC(GAME + GAUGE + @$"1P_Dan.png"); + Gauge_Dan[2] = TxC(GAME + GAUGE + @$"1P_Dan_Clear_Base.png"); + Gauge_Dan[3] = TxC(GAME + GAUGE + @$"1P_Dan_Clear.png"); + Gauge_Dan[4] = TxC(GAME + GAUGE + @$"1P_Dan_Base_Right.png"); + Gauge_Dan[5] = TxC(GAME + GAUGE + @$"1P_Dan_Right.png"); + + Gauge_Soul = TxC(GAME + GAUGE + @$"Soul.png"); + Gauge_Soul_Fire = TxC(GAME + GAUGE + @$"Fire.png"); + Gauge_Soul_Explosion = new CTexture[2]; + Gauge_Soul_Explosion[0] = TxC(GAME + GAUGE + @$"1P_Explosion.png"); + Gauge_Soul_Explosion[1] = TxC(GAME + GAUGE + @$"2P_Explosion.png"); + #endregion - #region レーン - public CTexture[] Lane_Red, - Lane_Blue, - Lane_Clap, - Lane_Base, - Lane_Text; - public CTexture Lane_Yellow; - public CTexture Lane_Background_Main, - Lane_Background_AI, - Lane_Background_Sub, - Lane_Background_GoGo; + + #region Balloon + + Balloon_Combo = new CTexture[2]; + Balloon_Combo[0] = TxC(GAME + BALLOON + @$"Combo_1P.png"); + Balloon_Combo[1] = TxC(GAME + BALLOON + @$"Combo_2P.png"); + Balloon_Roll = TxC(GAME + BALLOON + @$"Roll.png"); + Balloon_Balloon = TxC(GAME + BALLOON + @$"Balloon.png"); + Balloon_Number_Roll = TxC(GAME + BALLOON + @$"Number_Roll.png"); + Balloon_Number_Combo = TxC(GAME + BALLOON + @$"Number_Combo.png"); + + Balloon_Breaking = new CTexture[6]; + for (int i = 0; i < 6; i++) { + Balloon_Breaking[i] = TxC(GAME + BALLOON + @$"Breaking_" + i.ToString() + ".png"); + } + + Kusudama_Number = TxC(GAME + BALLOON + KUSUDAMA + @$"Kusudama_Number.png"); + + Fuse_Number = TxC(GAME + BALLOON + FUSE + @$"Number_Fuse.png"); + Fuse_Balloon = TxC(GAME + BALLOON + FUSE + @$"Fuse.png"); + #endregion - #region ゲームモード - public CTexture GameMode_Timer_Frame, - GameMode_Timer_Tick; + + #region Effects + + Effects_Hit_Explosion = TxCAf(GAME + EFFECTS + @$"Hit{Path.DirectorySeparatorChar}Explosion.png"); + if (Effects_Hit_Explosion != null) Effects_Hit_Explosion.b加算合成 = OpenTaiko.Skin.Game_Effect_HitExplosion_AddBlend; + Effects_Hit_Explosion_Big = TxC(GAME + EFFECTS + @$"Hit{Path.DirectorySeparatorChar}Explosion_Big.png"); + if (Effects_Hit_Explosion_Big != null) Effects_Hit_Explosion_Big.b加算合成 = OpenTaiko.Skin.Game_Effect_HitExplosionBig_AddBlend; + Effects_Hit_FireWorks = TxC(GAME + EFFECTS + @$"Hit{Path.DirectorySeparatorChar}FireWorks.png"); + if (Effects_Hit_FireWorks != null) Effects_Hit_FireWorks.b加算合成 = OpenTaiko.Skin.Game_Effect_FireWorks_AddBlend; + + Effects_Hit_Bomb = TxCAf(GAME + EFFECTS + @$"Hit{Path.DirectorySeparatorChar}Bomb.png"); + + + Effects_Fire = TxC(GAME + EFFECTS + @$"Fire.png"); + if (Effects_Fire != null) Effects_Fire.b加算合成 = OpenTaiko.Skin.Game_Effect_Fire_AddBlend; + + Effects_Rainbow = TxC(GAME + EFFECTS + @$"Rainbow.png"); + + Effects_GoGoSplash = TxC(GAME + EFFECTS + @$"GoGoSplash.png"); + if (Effects_GoGoSplash != null) Effects_GoGoSplash.b加算合成 = OpenTaiko.Skin.Game_Effect_GoGoSplash_AddBlend; + Effects_Hit_Great = new CTexture[15]; + Effects_Hit_Great_Big = new CTexture[15]; + Effects_Hit_Good = new CTexture[15]; + Effects_Hit_Good_Big = new CTexture[15]; + for (int i = 0; i < 15; i++) { + Effects_Hit_Great[i] = TxC(GAME + EFFECTS + @$"Hit{Path.DirectorySeparatorChar}" + @$"Great{Path.DirectorySeparatorChar}" + i.ToString() + ".png"); + Effects_Hit_Great_Big[i] = TxC(GAME + EFFECTS + @$"Hit{Path.DirectorySeparatorChar}" + @$"Great_Big{Path.DirectorySeparatorChar}" + i.ToString() + ".png"); + Effects_Hit_Good[i] = TxC(GAME + EFFECTS + @$"Hit{Path.DirectorySeparatorChar}" + @$"Good{Path.DirectorySeparatorChar}" + i.ToString() + ".png"); + Effects_Hit_Good_Big[i] = TxC(GAME + EFFECTS + @$"Hit{Path.DirectorySeparatorChar}" + @$"Good_Big{Path.DirectorySeparatorChar}" + i.ToString() + ".png"); + } + OpenTaiko.Skin.Game_Effect_Roll_Ptn = OpenTaiko.t連番画像の枚数を数える(CSkin.Path(BASE + GAME + EFFECTS + @$"Roll{Path.DirectorySeparatorChar}")); + Effects_Roll = new CTexture[OpenTaiko.Skin.Game_Effect_Roll_Ptn]; + for (int i = 0; i < OpenTaiko.Skin.Game_Effect_Roll_Ptn; i++) { + Effects_Roll[i] = TxC(GAME + EFFECTS + @$"Roll{Path.DirectorySeparatorChar}" + i.ToString() + ".png"); + } + #endregion - #region ステージ失敗 - public CTexture Failed_Game, - Failed_Stage; + + #region Lane + + Lane_Base = new CTexture[3]; + Lane_Text = new CTexture[3]; + string[] Lanes = new string[3] { "Normal", "Expert", "Master" }; + for (int i = 0; i < 3; i++) { + Lane_Base[i] = TxC(GAME + LANE + "Base_" + Lanes[i] + ".png"); + Lane_Text[i] = TxC(GAME + LANE + "Text_" + Lanes[i] + ".png"); + } + + Lane_Red = new CTexture[2]; + Lane_Blue = new CTexture[2]; + Lane_Clap = new CTexture[2]; + + var _suffixes = new string[] { "", "_Konga" }; + + for (int i = 0; i < Lane_Red.Length; i++) { + Lane_Red[i] = TxC(GAME + LANE + @$"Red" + _suffixes[i] + @$".png"); + Lane_Blue[i] = TxC(GAME + LANE + @$"Blue" + _suffixes[i] + @$".png"); + Lane_Clap[i] = TxC(GAME + LANE + @$"Clap" + _suffixes[i] + @$".png"); + } + + + Lane_Yellow = TxC(GAME + LANE + @$"Yellow.png"); + Lane_Background_Main = TxC(GAME + LANE + @$"Background_Main.png"); + Lane_Background_AI = TxC(GAME + LANE + @$"Background_AI.png"); + Lane_Background_Sub = TxC(GAME + LANE + @$"Background_Sub.png"); + Lane_Background_GoGo = TxC(GAME + LANE + @$"Background_GoGo.png"); + #endregion - #region ランナー - //public CTexture Runner; + + #region GameMode + + GameMode_Timer_Tick = TxC(GAME + GAMEMODE + @$"Timer_Tick.png"); + GameMode_Timer_Frame = TxC(GAME + GAMEMODE + @$"Timer_Frame.png"); + #endregion + + #region ClearFailed + + Failed_Game = TxC(GAME + FAILED + @$"Game.png"); + Failed_Stage = TxC(GAME + FAILED + @$"Stage.png"); + + #endregion + + #region Runner + + //Runner = TxC(GAME + RUNNER + @$"0.png"); + + #endregion + #region DanC - public CTexture DanC_Background; - public CTexture[] DanC_Gauge; - public CTexture DanC_Base; - public CTexture DanC_Base_Small; + DanC_Background = TxC(GAME + DANC + @$"Background.png"); + DanC_Gauge = new CTexture[4]; + var type = new string[] { "Normal", "Reach", "Clear", "Flush" }; + for (int i = 0; i < 4; i++) { + DanC_Gauge[i] = TxC(GAME + DANC + @$"Gauge_" + type[i] + ".png"); + } + DanC_Base = TxC(GAME + DANC + @$"Base.png"); + DanC_Base_Small = TxC(GAME + DANC + @$"Base_Small.png"); + + DanC_Gauge_Base = TxC(GAME + DANC + @$"Gauge_Base.png"); + DanC_Failed = TxC(GAME + DANC + @$"Failed.png"); + DanC_Number = TxC(GAME + DANC + @$"Number.png"); + DanC_Small_Number = TxC(GAME + DANC + @$"Small_Number.png"); + DanC_ExamType = TxC(GAME + DANC + @$"ExamType.png"); + DanC_ExamRange = TxC(GAME + DANC + @$"ExamRange.png"); + DanC_ExamUnit = TxC(GAME + DANC + @$"ExamUnit.png"); + DanC_Screen = TxC(GAME + DANC + @$"Screen.png"); + DanC_SmallBase = TxC(GAME + DANC + @$"SmallBase.png"); + DanC_Small_ExamCymbol = TxC(GAME + DANC + @$"Small_ExamCymbol.png"); + DanC_ExamCymbol = TxC(GAME + DANC + @$"ExamCymbol.png"); + DanC_MiniNumber = TxC(GAME + DANC + @$"MiniNumber.png"); - public CTexture DanC_Gauge_Base; - public CTexture DanC_Failed; - public CTexture DanC_Number, - DanC_Small_Number, - DanC_SmallBase, - DanC_ExamType, - DanC_ExamRange, - DanC_Small_ExamCymbol, - DanC_ExamCymbol, - DanC_MiniNumber, - DanC_ExamUnit; - public CTexture DanC_Screen; #endregion + #region PuchiChara - public CPuchichara[] Puchichara; + var puchicharaDirs = System.IO.Directory.GetDirectories(OpenTaiko.strEXEのあるフォルダ + GLOBAL + PUCHICHARA); + OpenTaiko.Skin.Puchichara_Ptn = puchicharaDirs.Length; + + Puchichara = new CPuchichara[OpenTaiko.Skin.Puchichara_Ptn]; + OpenTaiko.Skin.Puchicharas_Name = new string[OpenTaiko.Skin.Puchichara_Ptn]; + + for (int i = 0; i < OpenTaiko.Skin.Puchichara_Ptn; i++) { + Puchichara[i] = new CPuchichara(puchicharaDirs[i]); + + OpenTaiko.Skin.Puchicharas_Name[i] = System.IO.Path.GetFileName(puchicharaDirs[i]); + } + + ///TJAPlayer3.Skin.Puchichara_Ptn = 5 * Math.Max(1, (PuchiChara.szテクスチャサイズ.Height / 256)); + #endregion + #region Training - public CTexture Tokkun_DownBG, - Tokkun_BigTaiko, - Tokkun_ProgressBar, - Tokkun_ProgressBarWhite, - Tokkun_GoGoPoint, - Tokkun_JumpPoint, - Tokkun_Background_Up, - Tokkun_BigNumber, - Tokkun_SmallNumber, - Tokkun_Speed_Measure; + + Tokkun_DownBG = TxC(GAME + TRAINING + @$"Down.png"); + Tokkun_BigTaiko = TxC(GAME + TRAINING + @$"BigTaiko.png"); + Tokkun_ProgressBar = TxC(GAME + TRAINING + @$"ProgressBar_Red.png"); + Tokkun_ProgressBarWhite = TxC(GAME + TRAINING + @$"ProgressBar_White.png"); + Tokkun_GoGoPoint = TxC(GAME + TRAINING + @$"GoGoPoint.png"); + Tokkun_JumpPoint = TxC(GAME + TRAINING + @$"JumpPoint.png"); + Tokkun_Background_Up = TxC(GAME + TRAINING + @$"Background_Up.png"); + Tokkun_BigNumber = TxC(GAME + TRAINING + @$"BigNumber.png"); + Tokkun_SmallNumber = TxC(GAME + TRAINING + @$"SmallNumber.png"); + Tokkun_Speed_Measure = TxC(GAME + TRAINING + @$"Speed_Measure.png"); + #endregion #region [20_Tower] - public CTexture Tower_Miss; + Tower_Miss = TxC(GAME + TOWER + @$"Miss.png"); - public CTexture[] Tower_Top; + // Tower elements + string[] towerDirectories = System.IO.Directory.GetDirectories(CSkin.Path(BASE + GAME + TOWER + TOWERFLOOR)); + OpenTaiko.Skin.Game_Tower_Ptn = towerDirectories.Length; + OpenTaiko.Skin.Game_Tower_Names = new string[OpenTaiko.Skin.Game_Tower_Ptn]; + for (int i = 0; i < OpenTaiko.Skin.Game_Tower_Ptn; i++) + OpenTaiko.Skin.Game_Tower_Names[i] = new DirectoryInfo(towerDirectories[i]).Name; + Tower_Top = new CTexture[OpenTaiko.Skin.Game_Tower_Ptn]; + Tower_Base = new CTexture[OpenTaiko.Skin.Game_Tower_Ptn][]; + Tower_Deco = new CTexture[OpenTaiko.Skin.Game_Tower_Ptn][]; + + OpenTaiko.Skin.Game_Tower_Ptn_Base = new int[OpenTaiko.Skin.Game_Tower_Ptn]; + OpenTaiko.Skin.Game_Tower_Ptn_Deco = new int[OpenTaiko.Skin.Game_Tower_Ptn]; + + for (int i = 0; i < OpenTaiko.Skin.Game_Tower_Ptn; i++) { + OpenTaiko.Skin.Game_Tower_Ptn_Base[i] = OpenTaiko.t連番画像の枚数を数える((towerDirectories[i] + @$"{Path.DirectorySeparatorChar}Base{Path.DirectorySeparatorChar}"), "Base"); + OpenTaiko.Skin.Game_Tower_Ptn_Deco[i] = OpenTaiko.t連番画像の枚数を数える((towerDirectories[i] + @$"{Path.DirectorySeparatorChar}Deco{Path.DirectorySeparatorChar}"), "Deco"); + + Tower_Top[i] = TxC(GAME + TOWER + TOWERFLOOR + OpenTaiko.Skin.Game_Tower_Names[i] + @$"{Path.DirectorySeparatorChar}Top.png"); + + Tower_Base[i] = new CTexture[OpenTaiko.Skin.Game_Tower_Ptn_Base[i]]; + Tower_Deco[i] = new CTexture[OpenTaiko.Skin.Game_Tower_Ptn_Deco[i]]; + + for (int j = 0; j < OpenTaiko.Skin.Game_Tower_Ptn_Base[i]; j++) { + Tower_Base[i][j] = TxC(GAME + TOWER + TOWERFLOOR + OpenTaiko.Skin.Game_Tower_Names[i] + @$"{Path.DirectorySeparatorChar}Base{Path.DirectorySeparatorChar}Base" + j.ToString() + ".png"); + } + + for (int j = 0; j < OpenTaiko.Skin.Game_Tower_Ptn_Deco[i]; j++) { + Tower_Deco[i][j] = TxC(GAME + TOWER + TOWERFLOOR + OpenTaiko.Skin.Game_Tower_Names[i] + @$"{Path.DirectorySeparatorChar}Deco{Path.DirectorySeparatorChar}Deco" + j.ToString() + ".png"); + } + } - public CTexture[][] Tower_Base, - Tower_Deco; #endregion #region [21_ModIcons] - public CTexture[] Mod_Timing, - Mod_SongSpeed, - Mod_Fun, - HiSp; - public CTexture Mod_None, - Mod_Doron, - Mod_Stealth, - Mod_Mirror, - Mod_Random, - Mod_Super, - Mod_Hyper, - Mod_Just, - Mod_Safe, - Mod_Auto; + HiSp = new CTexture[14]; + for (int i = 0; i < HiSp.Length; i++) { + HiSp[i] = TxC(GAME + MODICONS + @$"HS{Path.DirectorySeparatorChar}" + i.ToString() + @$".png"); + } + + Mod_Timing = new CTexture[5]; + for (int i = 0; i < Mod_Timing.Length; i++) { + Mod_Timing[i] = TxC(GAME + MODICONS + @$"Timing{Path.DirectorySeparatorChar}" + i.ToString() + @$".png"); + } + + Mod_SongSpeed = new CTexture[2]; + for (int i = 0; i < Mod_SongSpeed.Length; i++) { + Mod_SongSpeed[i] = TxC(GAME + MODICONS + @$"SongSpeed{Path.DirectorySeparatorChar}" + i.ToString() + @$".png"); + } + + Mod_Fun = new CTexture[3]; + for (int i = 0; i < Mod_Fun.Length; i++) { + Mod_Fun[i] = TxC(GAME + MODICONS + @$"Fun{Path.DirectorySeparatorChar}" + i.ToString() + @$".png"); + } + + Mod_Doron = TxC(GAME + MODICONS + @$"Doron.png"); + Mod_Stealth = TxC(GAME + MODICONS + @$"Stealth.png"); + Mod_Mirror = TxC(GAME + MODICONS + @$"Mirror.png"); + Mod_Super = TxC(GAME + MODICONS + @$"Super.png"); + Mod_Hyper = TxC(GAME + MODICONS + @$"Hyper.png"); + Mod_Random = TxC(GAME + MODICONS + @$"Random.png"); + Mod_Auto = TxC(GAME + MODICONS + @$"Auto.png"); + Mod_Just = TxC(GAME + MODICONS + @$"Just.png"); + Mod_Safe = TxC(GAME + MODICONS + @$"Safe.png"); + Mod_None = TxC(GAME + MODICONS + @$"None.png"); #endregion #region [22_AIBattle] - public CTexture AIBattle_SectionTime_Panel, - AIBattle_SectionTime_Bar_Base, - AIBattle_SectionTime_Bar_Normal, - AIBattle_SectionTime_Bar_Finish, - AIBattle_Batch_Base, - AIBattle_Batch, - AIBattle_Judge_Number; + AIBattle_SectionTime_Panel = TxC(GAME + AIBATTLE + @$"SectionTime_Panel.png"); - public CTexture[] AIBattle_Judge_Meter = new CTexture[2]; + AIBattle_SectionTime_Bar_Base = TxC(GAME + AIBATTLE + @$"SectionTime_Bar_Base.png"); + AIBattle_SectionTime_Bar_Finish = TxC(GAME + AIBATTLE + @$"SectionTime_Bar_Finish.png"); + AIBattle_SectionTime_Bar_Normal = TxC(GAME + AIBATTLE + @$"SectionTime_Bar_Normal.png"); + + AIBattle_Batch_Base = TxC(GAME + AIBATTLE + @$"Batch_Base.png"); + AIBattle_Batch = TxC(GAME + AIBATTLE + @$"Batch.png"); + + AIBattle_Judge_Meter[0] = TxC(GAME + AIBATTLE + @$"Judge_Meter.png"); + AIBattle_Judge_Meter[1] = TxC(GAME + AIBATTLE + @$"Judge_Meter_AI.png"); + + AIBattle_Judge_Number = TxC(GAME + AIBATTLE + @$"Judge_Number.png"); #endregion - #endregion #region 6_結果発表 - public CTexture Result_Header, - Result_Number, - Result_Panel, - Result_Panel_2P, - Result_Soul_Text, - Result_Soul_Fire, - Result_Diff_Bar, - Result_Score_Number, - Result_CrownEffect, - Result_ScoreRankEffect, + Result_Gauge[0] = TxC(RESULT + @$"Gauge.png"); + Result_Gauge_Base[0] = TxC(RESULT + @$"Gauge_Base.png"); + Result_Gauge[1] = TxC(RESULT + @$"Gauge_2.png"); + Result_Gauge_Base[1] = TxC(RESULT + @$"Gauge_Base_2.png"); + Result_Gauge[2] = TxC(RESULT + @$"Gauge_3.png"); + Result_Gauge_Base[2] = TxC(RESULT + @$"Gauge_Base_3.png"); + Result_Gauge[3] = TxC(RESULT + @$"Gauge_4.png"); + Result_Gauge_Base[3] = TxC(RESULT + @$"Gauge_Base_4.png"); + Result_Gauge[4] = TxC(RESULT + @$"Gauge_5.png"); + Result_Gauge_Base[4] = TxC(RESULT + @$"Gauge_Base_5.png"); - //Result_Cloud, - Result_Flower, - Result_Shine, - Result_Gauge_Frame, - Result_Gauge_Clear, - Result_Gauge_Clear_Base, - Result_Gauge_Killzone, + Result_Gauge_Frame = TxC(RESULT + @$"Gauge_Frame.png"); + Result_Gauge_Clear = TxC(RESULT + @$"Gauge_Clear.png"); + Result_Gauge_Clear_Base = TxC(RESULT + @$"Gauge_Clear_Base.png"); + Result_Gauge_Killzone = TxC(RESULT + @$"Gauge_Killzone.png"); - Result_Dan; + Result_Header = TxC(RESULT + @$"Header.png"); + Result_Number = TxC(RESULT + @$"Number.png"); + Result_Panel = TxC(RESULT + @$"Panel.png"); + Result_Panel_2P = TxC(RESULT + @$"Panel_2.png"); + Result_Soul_Text = TxC(RESULT + @$"Soul_Text.png"); + Result_Soul_Fire = TxC(RESULT + @$"Result_Soul_Fire.png"); + Result_Diff_Bar = TxC(RESULT + @$"DifficultyBar.png"); + Result_Score_Number = TxC(RESULT + @$"Score_Number.png"); + Result_Dan = TxC(RESULT + @$"Dan.png"); - public CTexture[] - Result_Panel_5P = new CTexture[5], - Result_Panel_4P = new CTexture[4], - Result_Rainbow = new CTexture[41], - //Result_Background = new CTexture[6], - Result_Crown = new CTexture[3], + Result_CrownEffect = TxC(RESULT + @$"CrownEffect.png"); + Result_ScoreRankEffect = TxC(RESULT + @$"ScoreRankEffect.png"); + //Result_Cloud = TxC(RESULT + @$"Cloud.png"); + Result_Shine = TxC(RESULT + @$"Shine.png"); - Result_Flower_Rotate = new CTexture[5], - //Result_Work = new CTexture[3], + Result_Speech_Bubble[0] = TxC(RESULT + @$"Speech_Bubble.png"); + Result_Speech_Bubble[1] = TxC(RESULT + @$"Speech_Bubble_2.png"); - Result_Gauge = new CTexture[5], - Result_Gauge_Base = new CTexture[5], - Result_Speech_Bubble = new CTexture[2], - Result_Speech_Bubble_V2 = new CTexture[3] -/*, -Result_Mountain = new CTexture[4]*/; - #endregion + Result_Speech_Bubble_V2[0] = TxC(RESULT + @$"Speech_Bubble_V2_Left.png"); + Result_Speech_Bubble_V2[1] = TxC(RESULT + @$"Speech_Bubble_V2_Right.png"); + Result_Speech_Bubble_V2[2] = TxC(RESULT + @$"Speech_Bubble_V2_4P_5P.png"); + + Result_Flower = TxC(RESULT + @$"Flower{Path.DirectorySeparatorChar}Flower.png"); + + for (int i = 0; i < 4; i++) + Result_Panel_4P[i] = TxC(RESULT + @$"Panel_4P_" + (i + 1).ToString() + ".png"); + + for (int i = 0; i < 5; i++) + Result_Panel_5P[i] = TxC(RESULT + @$"Panel_5P_" + (i + 1).ToString() + ".png"); + + for (int i = 1; i <= 5; i++) + Result_Flower_Rotate[i - 1] = TxC(RESULT + @$"Flower{Path.DirectorySeparatorChar}Rotate_" + i.ToString() + ".png"); + + //for (int i = 0; i < 3; i++) + //Result_Work[i] = TxC(RESULT + @$"Work{Path.DirectorySeparatorChar}" + i.ToString() + ".png"); + + OpenTaiko.Skin.Result_Gauge_Rainbow_Ptn = OpenTaiko.t連番画像の枚数を数える(CSkin.Path(BASE + RESULT + @$"Rainbow{Path.DirectorySeparatorChar}")); + if (OpenTaiko.Skin.Result_Gauge_Rainbow_Ptn != 0) { + Result_Rainbow = new CTexture[OpenTaiko.Skin.Result_Gauge_Rainbow_Ptn]; + for (int i = 0; i < OpenTaiko.Skin.Result_Gauge_Rainbow_Ptn; i++) { + Result_Rainbow[i] = TxC(RESULT + @$"Rainbow{Path.DirectorySeparatorChar}" + i.ToString() + ".png"); + } + } + + //for (int i = 0; i < 6; i++) + //Result_Background[i] = TxC(RESULT + @$"Background_" + i.ToString() + ".png"); + + //for (int i = 0; i < 4; i++) + //Result_Mountain[i] = TxC(RESULT + @$"Background_Mountain_" + i.ToString() + ".png"); + + for (int i = 0; i < 3; i++) + Result_Crown[i] = TxC(RESULT + @$"Crown{Path.DirectorySeparatorChar}Crown_" + i.ToString() + ".png"); - #region 7_AIResults - public CTexture Result_AIBattle_Panel_AI, - Result_AIBattle_Batch, - Result_AIBattle_SectionPlate, - Result_AIBattle_WinFlag_Clear, - Result_AIBattle_WinFlag_Lose; #endregion #region 7_終了画面 - //public CTexture Exit_Background/* , */ - /*Exit_Text; */ + //Exit_Background = TxC(EXIT + @$"Background.png"); + #endregion + + #region 7_AIResults + + Result_AIBattle_Panel_AI = TxC(RESULT + @$"AIBattle{Path.DirectorySeparatorChar}Panel_AI.png"); + Result_AIBattle_Batch = TxC(RESULT + @$"AIBattle{Path.DirectorySeparatorChar}Batch.png"); + Result_AIBattle_SectionPlate = TxC(RESULT + @$"AIBattle{Path.DirectorySeparatorChar}SectionPlate.png"); + Result_AIBattle_WinFlag_Clear = TxC(RESULT + @$"AIBattle{Path.DirectorySeparatorChar}WinFlag_Win.png"); + Result_AIBattle_WinFlag_Lose = TxC(RESULT + @$"AIBattle{Path.DirectorySeparatorChar}WinFlag_Lose.png"); + #endregion #region [7_DanResults] - public CTexture - //DanResult_Background, - DanResult_Rank, - DanResult_SongPanel_Base, - DanResult_StatePanel_Base, - DanResult_SongPanel_Main, - DanResult_StatePanel_Main; + //DanResult_Background = TxC(DANRESULT + @$"Background.png"); + DanResult_Rank = TxC(DANRESULT + @$"Rank.png"); + DanResult_SongPanel_Base = TxC(DANRESULT + @$"SongPanel_Base.png"); + DanResult_StatePanel_Base = TxC(DANRESULT + @$"StatePanel_Base.png"); + DanResult_SongPanel_Main = TxC(DANRESULT + @$"SongPanel_Main.png"); + DanResult_StatePanel_Main = TxC(DANRESULT + @$"StatePanel_Main.png"); #endregion #region [8_TowerResults] - public CTexture TowerResult_Background, - TowerResult_ScoreRankEffect, - TowerResult_Panel; - public CTexture[] - TowerResult_Tower; + OpenTaiko.Skin.Game_Tower_Ptn_Result = OpenTaiko.t連番画像の枚数を数える(CSkin.Path(BASE + TOWERRESULT + @$"Tower{Path.DirectorySeparatorChar}")); + TowerResult_Tower = new CTexture[OpenTaiko.Skin.Game_Tower_Ptn_Result]; + + TowerResult_Background = TxC(TOWERRESULT + @$"Background.png"); + TowerResult_Panel = TxC(TOWERRESULT + @$"Panel.png"); + + TowerResult_ScoreRankEffect = TxC(TOWERRESULT + @$"ScoreRankEffect.png"); + + for (int i = 0; i < OpenTaiko.Skin.Game_Tower_Ptn_Result; i++) { + TowerResult_Tower[i] = TxC(TOWERRESULT + @$"Tower{Path.DirectorySeparatorChar}" + i.ToString() + ".png"); + } #endregion #region [10_Heya] - public CTexture - //Heya_Background, - Heya_Center_Menu_Bar, - Heya_Center_Menu_Box, - Heya_Center_Menu_Box_Slot, - Heya_Side_Menu, - Heya_Box, - Heya_Render_Field, - Heya_Center_Menu_Background, - Heya_Description_Panel, - Heya_Lock; + //Heya_Background = TxC(HEYA + @$"Background.png"); + Heya_Center_Menu_Bar = TxC(HEYA + @$"Center_Menu_Bar.png"); + Heya_Center_Menu_Box = TxC(HEYA + @$"Center_Menu_Box.png"); + Heya_Center_Menu_Box_Slot = TxC(HEYA + @$"Center_Menu_Box_Slot.png"); + Heya_Side_Menu = TxC(HEYA + @$"Side_Menu.png"); + Heya_Render_Field = TxC(HEYA + @$"Render_Field.png"); + Heya_Center_Menu_Background = TxC(HEYA + @$"Center_Menu_Background.png"); + Heya_Description_Panel = TxC(HEYA + @$"Description_Panel.png"); + Heya_Box = TxC(HEYA + @$"Box.png"); + Heya_Lock = TxC(HEYA + @$"Lock.png"); #endregion #region [11_Characters] - public CTexture[][] Characters_Normal, - Characters_Normal_Missed, - Characters_Normal_MissedDown, - Characters_Normal_Cleared, - Characters_Normal_Maxed, - Characters_MissIn, - Characters_MissDownIn, - Characters_GoGoTime, - Characters_GoGoTime_Maxed, - Characters_10Combo, - Characters_10Combo_Clear, - Characters_10Combo_Maxed, - Characters_GoGoStart, - Characters_GoGoStart_Clear, - Characters_GoGoStart_Maxed, - Characters_Become_Cleared, - Characters_Become_Maxed, - Characters_SoulOut, - Characters_ClearOut, - Characters_Return, - Characters_Balloon_Breaking, - Characters_Balloon_Broke, - Characters_Balloon_Miss, - Characters_Kusudama_Idle, - Characters_Kusudama_Breaking, - Characters_Kusudama_Broke, - Characters_Kusudama_Miss, - Characters_Title_Entry, - Characters_Title_Normal, - Characters_Menu_Loop, - Characters_Menu_Select, - Characters_Menu_Start, - Characters_Menu_Wait, - Characters_Result_Clear, - Characters_Result_Failed, - Characters_Result_Failed_In, - Characters_Result_Normal, - Characters_Tower_Standing, - Characters_Tower_Climbing, - Characters_Tower_Running, - Characters_Tower_Clear, - Characters_Tower_Fail, - Characters_Tower_Standing_Tired, - Characters_Tower_Climbing_Tired, - Characters_Tower_Running_Tired, - Characters_Tower_Clear_Tired; - public CTexture[] Characters_Heya_Preview, - Characters_Heya_Render, - Characters_Result_Clear_1P, - Characters_Result_Failed_1P, - Characters_Result_Clear_2P, - Characters_Result_Failed_2P; - public CCharacter[] Characters; + #region [Character count initialisations] + + var charaDirs = System.IO.Directory.GetDirectories(OpenTaiko.strEXEのあるフォルダ + GLOBAL + CHARACTERS); + OpenTaiko.Skin.Characters_Ptn = charaDirs.Length; + + Characters_Heya_Preview = new CTexture[OpenTaiko.Skin.Characters_Ptn]; + Characters_Heya_Render = new CTexture[OpenTaiko.Skin.Characters_Ptn]; + Characters_Result_Clear_1P = new CTexture[OpenTaiko.Skin.Characters_Ptn]; + Characters_Result_Failed_1P = new CTexture[OpenTaiko.Skin.Characters_Ptn]; + Characters_Result_Clear_2P = new CTexture[OpenTaiko.Skin.Characters_Ptn]; + Characters_Result_Failed_2P = new CTexture[OpenTaiko.Skin.Characters_Ptn]; + Characters = new CCharacter[OpenTaiko.Skin.Characters_Ptn]; + + Characters_Normal = new CTexture[OpenTaiko.Skin.Characters_Ptn][]; + Characters_Normal_Missed = new CTexture[OpenTaiko.Skin.Characters_Ptn][]; + Characters_Normal_MissedDown = new CTexture[OpenTaiko.Skin.Characters_Ptn][]; + Characters_Normal_Cleared = new CTexture[OpenTaiko.Skin.Characters_Ptn][]; + Characters_Normal_Maxed = new CTexture[OpenTaiko.Skin.Characters_Ptn][]; + Characters_MissIn = new CTexture[OpenTaiko.Skin.Characters_Ptn][]; + Characters_MissDownIn = new CTexture[OpenTaiko.Skin.Characters_Ptn][]; + Characters_GoGoTime = new CTexture[OpenTaiko.Skin.Characters_Ptn][]; + Characters_GoGoTime_Maxed = new CTexture[OpenTaiko.Skin.Characters_Ptn][]; + Characters_10Combo = new CTexture[OpenTaiko.Skin.Characters_Ptn][]; + Characters_10Combo_Clear = new CTexture[OpenTaiko.Skin.Characters_Ptn][]; + Characters_10Combo_Maxed = new CTexture[OpenTaiko.Skin.Characters_Ptn][]; + Characters_GoGoStart = new CTexture[OpenTaiko.Skin.Characters_Ptn][]; + Characters_GoGoStart_Clear = new CTexture[OpenTaiko.Skin.Characters_Ptn][]; + Characters_GoGoStart_Maxed = new CTexture[OpenTaiko.Skin.Characters_Ptn][]; + Characters_Become_Cleared = new CTexture[OpenTaiko.Skin.Characters_Ptn][]; + Characters_Become_Maxed = new CTexture[OpenTaiko.Skin.Characters_Ptn][]; + Characters_SoulOut = new CTexture[OpenTaiko.Skin.Characters_Ptn][]; + Characters_ClearOut = new CTexture[OpenTaiko.Skin.Characters_Ptn][]; + Characters_Return = new CTexture[OpenTaiko.Skin.Characters_Ptn][]; + Characters_Balloon_Breaking = new CTexture[OpenTaiko.Skin.Characters_Ptn][]; + Characters_Balloon_Broke = new CTexture[OpenTaiko.Skin.Characters_Ptn][]; + Characters_Balloon_Miss = new CTexture[OpenTaiko.Skin.Characters_Ptn][]; + Characters_Kusudama_Idle = new CTexture[OpenTaiko.Skin.Characters_Ptn][]; + Characters_Kusudama_Breaking = new CTexture[OpenTaiko.Skin.Characters_Ptn][]; + Characters_Kusudama_Broke = new CTexture[OpenTaiko.Skin.Characters_Ptn][]; + Characters_Kusudama_Miss = new CTexture[OpenTaiko.Skin.Characters_Ptn][]; + Characters_Title_Entry = new CTexture[OpenTaiko.Skin.Characters_Ptn][]; + Characters_Title_Normal = new CTexture[OpenTaiko.Skin.Characters_Ptn][]; + Characters_Result_Clear = new CTexture[OpenTaiko.Skin.Characters_Ptn][]; + Characters_Result_Failed = new CTexture[OpenTaiko.Skin.Characters_Ptn][]; + Characters_Result_Failed_In = new CTexture[OpenTaiko.Skin.Characters_Ptn][]; + Characters_Result_Normal = new CTexture[OpenTaiko.Skin.Characters_Ptn][]; + Characters_Menu_Loop = new CTexture[OpenTaiko.Skin.Characters_Ptn][]; + Characters_Menu_Start = new CTexture[OpenTaiko.Skin.Characters_Ptn][]; + Characters_Menu_Select = new CTexture[OpenTaiko.Skin.Characters_Ptn][]; + Characters_Menu_Wait = new CTexture[OpenTaiko.Skin.Characters_Ptn][]; + Characters_Tower_Standing = new CTexture[OpenTaiko.Skin.Characters_Ptn][]; + Characters_Tower_Climbing = new CTexture[OpenTaiko.Skin.Characters_Ptn][]; + Characters_Tower_Running = new CTexture[OpenTaiko.Skin.Characters_Ptn][]; + Characters_Tower_Clear = new CTexture[OpenTaiko.Skin.Characters_Ptn][]; + Characters_Tower_Fail = new CTexture[OpenTaiko.Skin.Characters_Ptn][]; + Characters_Tower_Standing_Tired = new CTexture[OpenTaiko.Skin.Characters_Ptn][]; + Characters_Tower_Climbing_Tired = new CTexture[OpenTaiko.Skin.Characters_Ptn][]; + Characters_Tower_Running_Tired = new CTexture[OpenTaiko.Skin.Characters_Ptn][]; + Characters_Tower_Clear_Tired = new CTexture[OpenTaiko.Skin.Characters_Ptn][]; + + OpenTaiko.Skin.Characters_DirName = new string[OpenTaiko.Skin.Characters_Ptn]; + OpenTaiko.Skin.Characters_Normal_Ptn = new int[OpenTaiko.Skin.Characters_Ptn]; + OpenTaiko.Skin.Characters_Normal_Missed_Ptn = new int[OpenTaiko.Skin.Characters_Ptn]; + OpenTaiko.Skin.Characters_Normal_MissedDown_Ptn = new int[OpenTaiko.Skin.Characters_Ptn]; + OpenTaiko.Skin.Characters_Normal_Cleared_Ptn = new int[OpenTaiko.Skin.Characters_Ptn]; + OpenTaiko.Skin.Characters_Normal_Maxed_Ptn = new int[OpenTaiko.Skin.Characters_Ptn]; + OpenTaiko.Skin.Characters_MissIn_Ptn = new int[OpenTaiko.Skin.Characters_Ptn]; + OpenTaiko.Skin.Characters_MissDownIn_Ptn = new int[OpenTaiko.Skin.Characters_Ptn]; + OpenTaiko.Skin.Characters_GoGoTime_Ptn = new int[OpenTaiko.Skin.Characters_Ptn]; + OpenTaiko.Skin.Characters_GoGoTime_Maxed_Ptn = new int[OpenTaiko.Skin.Characters_Ptn]; + OpenTaiko.Skin.Characters_10Combo_Ptn = new int[OpenTaiko.Skin.Characters_Ptn]; + OpenTaiko.Skin.Characters_10Combo_Clear_Ptn = new int[OpenTaiko.Skin.Characters_Ptn]; + OpenTaiko.Skin.Characters_10Combo_Maxed_Ptn = new int[OpenTaiko.Skin.Characters_Ptn]; + OpenTaiko.Skin.Characters_GoGoStart_Ptn = new int[OpenTaiko.Skin.Characters_Ptn]; + OpenTaiko.Skin.Characters_GoGoStart_Clear_Ptn = new int[OpenTaiko.Skin.Characters_Ptn]; + OpenTaiko.Skin.Characters_GoGoStart_Maxed_Ptn = new int[OpenTaiko.Skin.Characters_Ptn]; + OpenTaiko.Skin.Characters_Become_Cleared_Ptn = new int[OpenTaiko.Skin.Characters_Ptn]; + OpenTaiko.Skin.Characters_Become_Maxed_Ptn = new int[OpenTaiko.Skin.Characters_Ptn]; + OpenTaiko.Skin.Characters_SoulOut_Ptn = new int[OpenTaiko.Skin.Characters_Ptn]; + OpenTaiko.Skin.Characters_ClearOut_Ptn = new int[OpenTaiko.Skin.Characters_Ptn]; + OpenTaiko.Skin.Characters_Return_Ptn = new int[OpenTaiko.Skin.Characters_Ptn]; + OpenTaiko.Skin.Characters_Balloon_Breaking_Ptn = new int[OpenTaiko.Skin.Characters_Ptn]; + OpenTaiko.Skin.Characters_Balloon_Broke_Ptn = new int[OpenTaiko.Skin.Characters_Ptn]; + OpenTaiko.Skin.Characters_Balloon_Miss_Ptn = new int[OpenTaiko.Skin.Characters_Ptn]; + OpenTaiko.Skin.Characters_Kusudama_Idle_Ptn = new int[OpenTaiko.Skin.Characters_Ptn]; + OpenTaiko.Skin.Characters_Kusudama_Breaking_Ptn = new int[OpenTaiko.Skin.Characters_Ptn]; + OpenTaiko.Skin.Characters_Kusudama_Broke_Ptn = new int[OpenTaiko.Skin.Characters_Ptn]; + OpenTaiko.Skin.Characters_Kusudama_Miss_Ptn = new int[OpenTaiko.Skin.Characters_Ptn]; + OpenTaiko.Skin.Characters_Title_Entry_Ptn = new int[OpenTaiko.Skin.Characters_Ptn]; + OpenTaiko.Skin.Characters_Title_Normal_Ptn = new int[OpenTaiko.Skin.Characters_Ptn]; + OpenTaiko.Skin.Characters_Result_Clear_Ptn = new int[OpenTaiko.Skin.Characters_Ptn]; + OpenTaiko.Skin.Characters_Result_Failed_Ptn = new int[OpenTaiko.Skin.Characters_Ptn]; + OpenTaiko.Skin.Characters_Result_Failed_In_Ptn = new int[OpenTaiko.Skin.Characters_Ptn]; + OpenTaiko.Skin.Characters_Result_Normal_Ptn = new int[OpenTaiko.Skin.Characters_Ptn]; + OpenTaiko.Skin.Characters_Menu_Loop_Ptn = new int[OpenTaiko.Skin.Characters_Ptn]; + OpenTaiko.Skin.Characters_Menu_Start_Ptn = new int[OpenTaiko.Skin.Characters_Ptn]; + OpenTaiko.Skin.Characters_Menu_Select_Ptn = new int[OpenTaiko.Skin.Characters_Ptn]; + OpenTaiko.Skin.Characters_Menu_Wait_Ptn = new int[OpenTaiko.Skin.Characters_Ptn]; + OpenTaiko.Skin.Characters_Tower_Standing_Ptn = new int[OpenTaiko.Skin.Characters_Ptn]; + OpenTaiko.Skin.Characters_Tower_Climbing_Ptn = new int[OpenTaiko.Skin.Characters_Ptn]; + OpenTaiko.Skin.Characters_Tower_Running_Ptn = new int[OpenTaiko.Skin.Characters_Ptn]; + OpenTaiko.Skin.Characters_Tower_Clear_Ptn = new int[OpenTaiko.Skin.Characters_Ptn]; + OpenTaiko.Skin.Characters_Tower_Fail_Ptn = new int[OpenTaiko.Skin.Characters_Ptn]; + OpenTaiko.Skin.Characters_Tower_Standing_Tired_Ptn = new int[OpenTaiko.Skin.Characters_Ptn]; + OpenTaiko.Skin.Characters_Tower_Climbing_Tired_Ptn = new int[OpenTaiko.Skin.Characters_Ptn]; + OpenTaiko.Skin.Characters_Tower_Running_Tired_Ptn = new int[OpenTaiko.Skin.Characters_Ptn]; + OpenTaiko.Skin.Characters_Tower_Clear_Tired_Ptn = new int[OpenTaiko.Skin.Characters_Ptn]; + OpenTaiko.Skin.Characters_Tower_Clear_IsLooping = new bool[OpenTaiko.Skin.Characters_Ptn]; + OpenTaiko.Skin.Characters_Tower_Clear_Tired_IsLooping = new bool[OpenTaiko.Skin.Characters_Ptn]; + OpenTaiko.Skin.Characters_Tower_Fail_IsLooping = new bool[OpenTaiko.Skin.Characters_Ptn]; + + OpenTaiko.Skin.Characters_Resolution = new int[OpenTaiko.Skin.Characters_Ptn][]; + OpenTaiko.Skin.Characters_Heya_Render_Offset = new int[OpenTaiko.Skin.Characters_Ptn][]; + OpenTaiko.Skin.Characters_UseResult1P = new bool[OpenTaiko.Skin.Characters_Ptn]; + OpenTaiko.Skin.Characters_X = new int[OpenTaiko.Skin.Characters_Ptn][]; + OpenTaiko.Skin.Characters_Y = new int[OpenTaiko.Skin.Characters_Ptn][]; + OpenTaiko.Skin.Characters_4P = new int[OpenTaiko.Skin.Characters_Ptn][]; + OpenTaiko.Skin.Characters_5P = new int[OpenTaiko.Skin.Characters_Ptn][]; + OpenTaiko.Skin.Characters_X_AI = new int[OpenTaiko.Skin.Characters_Ptn][]; + OpenTaiko.Skin.Characters_Y_AI = new int[OpenTaiko.Skin.Characters_Ptn][]; + OpenTaiko.Skin.Characters_Balloon_X = new int[OpenTaiko.Skin.Characters_Ptn][]; + OpenTaiko.Skin.Characters_Balloon_Y = new int[OpenTaiko.Skin.Characters_Ptn][]; + OpenTaiko.Skin.Characters_Balloon_4P = new int[OpenTaiko.Skin.Characters_Ptn][]; + OpenTaiko.Skin.Characters_Balloon_5P = new int[OpenTaiko.Skin.Characters_Ptn][]; + OpenTaiko.Skin.Characters_Kusudama_X = new int[OpenTaiko.Skin.Characters_Ptn][]; + OpenTaiko.Skin.Characters_Kusudama_Y = new int[OpenTaiko.Skin.Characters_Ptn][]; + OpenTaiko.Skin.Characters_Motion_Normal = new int[OpenTaiko.Skin.Characters_Ptn][]; + OpenTaiko.Skin.Characters_Motion_10Combo = new int[OpenTaiko.Skin.Characters_Ptn][]; + OpenTaiko.Skin.Characters_Motion_10Combo_Clear = new int[OpenTaiko.Skin.Characters_Ptn][]; + OpenTaiko.Skin.Characters_Motion_10ComboMax = new int[OpenTaiko.Skin.Characters_Ptn][]; + OpenTaiko.Skin.Characters_Motion_Miss = new int[OpenTaiko.Skin.Characters_Ptn][]; + OpenTaiko.Skin.Characters_Motion_MissDown = new int[OpenTaiko.Skin.Characters_Ptn][]; + OpenTaiko.Skin.Characters_Motion_ClearIn = new int[OpenTaiko.Skin.Characters_Ptn][]; + OpenTaiko.Skin.Characters_Motion_Clear = new int[OpenTaiko.Skin.Characters_Ptn][]; + OpenTaiko.Skin.Characters_Motion_ClearMax = new int[OpenTaiko.Skin.Characters_Ptn][]; + OpenTaiko.Skin.Characters_Motion_MissIn = new int[OpenTaiko.Skin.Characters_Ptn][]; + OpenTaiko.Skin.Characters_Motion_MissDownIn = new int[OpenTaiko.Skin.Characters_Ptn][]; + OpenTaiko.Skin.Characters_Motion_GoGoStart = new int[OpenTaiko.Skin.Characters_Ptn][]; + OpenTaiko.Skin.Characters_Motion_GoGoStart_Clear = new int[OpenTaiko.Skin.Characters_Ptn][]; + OpenTaiko.Skin.Characters_Motion_GoGoStartMax = new int[OpenTaiko.Skin.Characters_Ptn][]; + OpenTaiko.Skin.Characters_Motion_GoGo = new int[OpenTaiko.Skin.Characters_Ptn][]; + OpenTaiko.Skin.Characters_Motion_GoGoMax = new int[OpenTaiko.Skin.Characters_Ptn][]; + OpenTaiko.Skin.Characters_Motion_SoulIn = new int[OpenTaiko.Skin.Characters_Ptn][]; + OpenTaiko.Skin.Characters_Motion_SoulOut = new int[OpenTaiko.Skin.Characters_Ptn][]; + OpenTaiko.Skin.Characters_Motion_ClearOut = new int[OpenTaiko.Skin.Characters_Ptn][]; + OpenTaiko.Skin.Characters_Motion_Return = new int[OpenTaiko.Skin.Characters_Ptn][]; + /* + TJAPlayer3.Skin.Characters_Motion_Tower_Standing = new int[TJAPlayer3.Skin.Characters_Ptn][]; + TJAPlayer3.Skin.Characters_Motion_Tower_Climbing = new int[TJAPlayer3.Skin.Characters_Ptn][]; + TJAPlayer3.Skin.Characters_Motion_Tower_Running = new int[TJAPlayer3.Skin.Characters_Ptn][]; + TJAPlayer3.Skin.Characters_Motion_Tower_Clear = new int[TJAPlayer3.Skin.Characters_Ptn][]; + TJAPlayer3.Skin.Characters_Motion_Tower_Fail = new int[TJAPlayer3.Skin.Characters_Ptn][]; + TJAPlayer3.Skin.Characters_Motion_Tower_Standing_Tired = new int[TJAPlayer3.Skin.Characters_Ptn][]; + TJAPlayer3.Skin.Characters_Motion_Tower_Climbing_Tired = new int[TJAPlayer3.Skin.Characters_Ptn][]; + TJAPlayer3.Skin.Characters_Motion_Tower_Running_Tired = new int[TJAPlayer3.Skin.Characters_Ptn][]; + TJAPlayer3.Skin.Characters_Motion_Tower_Clear_Tired = new int[TJAPlayer3.Skin.Characters_Ptn][]; + */ + OpenTaiko.Skin.Characters_Beat_Normal = new float[OpenTaiko.Skin.Characters_Ptn]; + OpenTaiko.Skin.Characters_Beat_Miss = new float[OpenTaiko.Skin.Characters_Ptn]; + OpenTaiko.Skin.Characters_Beat_MissDown = new float[OpenTaiko.Skin.Characters_Ptn]; + OpenTaiko.Skin.Characters_Beat_Clear = new float[OpenTaiko.Skin.Characters_Ptn]; + OpenTaiko.Skin.Characters_Beat_GoGo = new float[OpenTaiko.Skin.Characters_Ptn]; + OpenTaiko.Skin.Characters_Beat_10Combo = new float[OpenTaiko.Skin.Characters_Ptn]; + OpenTaiko.Skin.Characters_Beat_10Combo_Clear = new float[OpenTaiko.Skin.Characters_Ptn]; + OpenTaiko.Skin.Characters_Beat_10ComboMax = new float[OpenTaiko.Skin.Characters_Ptn]; + OpenTaiko.Skin.Characters_Beat_ClearIn = new float[OpenTaiko.Skin.Characters_Ptn]; + OpenTaiko.Skin.Characters_Beat_ClearMax = new float[OpenTaiko.Skin.Characters_Ptn]; + OpenTaiko.Skin.Characters_Beat_MissIn = new float[OpenTaiko.Skin.Characters_Ptn]; + OpenTaiko.Skin.Characters_Beat_MissDownIn = new float[OpenTaiko.Skin.Characters_Ptn]; + OpenTaiko.Skin.Characters_Beat_GoGoStart = new float[OpenTaiko.Skin.Characters_Ptn]; + OpenTaiko.Skin.Characters_Beat_GoGoStart_Clear = new float[OpenTaiko.Skin.Characters_Ptn]; + OpenTaiko.Skin.Characters_Beat_GoGoStartMax = new float[OpenTaiko.Skin.Characters_Ptn]; + OpenTaiko.Skin.Characters_Beat_GoGoMax = new float[OpenTaiko.Skin.Characters_Ptn]; + OpenTaiko.Skin.Characters_Beat_SoulIn = new float[OpenTaiko.Skin.Characters_Ptn]; + OpenTaiko.Skin.Characters_Beat_SoulOut = new float[OpenTaiko.Skin.Characters_Ptn]; + OpenTaiko.Skin.Characters_Beat_ClearOut = new float[OpenTaiko.Skin.Characters_Ptn]; + OpenTaiko.Skin.Characters_Beat_Return = new float[OpenTaiko.Skin.Characters_Ptn]; + OpenTaiko.Skin.Characters_Beat_Tower_Standing = new float[OpenTaiko.Skin.Characters_Ptn]; + OpenTaiko.Skin.Characters_Beat_Tower_Clear = new float[OpenTaiko.Skin.Characters_Ptn]; + OpenTaiko.Skin.Characters_Beat_Tower_Fail = new float[OpenTaiko.Skin.Characters_Ptn]; + OpenTaiko.Skin.Characters_Beat_Tower_Standing_Tired = new float[OpenTaiko.Skin.Characters_Ptn]; + OpenTaiko.Skin.Characters_Beat_Tower_Clear_Tired = new float[OpenTaiko.Skin.Characters_Ptn]; + OpenTaiko.Skin.Characters_Balloon_Timer = new int[OpenTaiko.Skin.Characters_Ptn]; + OpenTaiko.Skin.Characters_Balloon_Delay = new int[OpenTaiko.Skin.Characters_Ptn]; + OpenTaiko.Skin.Characters_Balloon_FadeOut = new int[OpenTaiko.Skin.Characters_Ptn]; + OpenTaiko.Skin.Characters_Title_Entry_AnimationDuration = new int[OpenTaiko.Skin.Characters_Ptn]; + OpenTaiko.Skin.Characters_Title_Normal_AnimationDuration = new int[OpenTaiko.Skin.Characters_Ptn]; + OpenTaiko.Skin.Characters_Menu_Loop_AnimationDuration = new int[OpenTaiko.Skin.Characters_Ptn]; + OpenTaiko.Skin.Characters_Menu_Select_AnimationDuration = new int[OpenTaiko.Skin.Characters_Ptn]; + OpenTaiko.Skin.Characters_Menu_Start_AnimationDuration = new int[OpenTaiko.Skin.Characters_Ptn]; + OpenTaiko.Skin.Characters_Menu_Wait_AnimationDuration = new int[OpenTaiko.Skin.Characters_Ptn]; + OpenTaiko.Skin.Characters_Result_Normal_AnimationDuration = new int[OpenTaiko.Skin.Characters_Ptn]; + OpenTaiko.Skin.Characters_Result_Clear_AnimationDuration = new int[OpenTaiko.Skin.Characters_Ptn]; + OpenTaiko.Skin.Characters_Result_Failed_In_AnimationDuration = new int[OpenTaiko.Skin.Characters_Ptn]; + OpenTaiko.Skin.Characters_Result_Failed_AnimationDuration = new int[OpenTaiko.Skin.Characters_Ptn]; + + for (int i = 0; i < charaDirs.Length; i++) { + OpenTaiko.Skin.Characters_DirName[i] = System.IO.Path.GetFileName(charaDirs[i]); + } + + #endregion + + for (int i = 0; i < 5; i++) { + OpenTaiko.SaveFileInstances[i].tReindexCharacter(OpenTaiko.Skin.Characters_DirName); + this.ReloadCharacter(-1, OpenTaiko.SaveFileInstances[i].data.Character, i, true); + } + + + for (int i = 0; i < OpenTaiko.Skin.Characters_Ptn; i++) { + Characters_Heya_Preview[i] = TxCGlobal(CHARACTERS + OpenTaiko.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Normal{Path.DirectorySeparatorChar}0.png"); + Characters_Heya_Render[i] = TxCGlobal(CHARACTERS + OpenTaiko.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Render.png"); + Characters_Result_Clear_1P[i] = TxCGlobal(CHARACTERS + OpenTaiko.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Result_Clear_1P.png"); + Characters_Result_Failed_1P[i] = TxCGlobal(CHARACTERS + OpenTaiko.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Result_Failed_1P.png"); + Characters_Result_Clear_2P[i] = TxCGlobal(CHARACTERS + OpenTaiko.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Result_Clear_2P.png"); + Characters_Result_Failed_2P[i] = TxCGlobal(CHARACTERS + OpenTaiko.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Result_Failed_2P.png"); + + OpenTaiko.Skin.Characters_Resolution[i] = new int[] { 1280, 720 }; + OpenTaiko.Skin.Characters_Heya_Render_Offset[i] = new int[] { 0, 0 }; + OpenTaiko.Skin.Characters_UseResult1P[i] = false; + + + var _str = ""; + OpenTaiko.Skin.LoadSkinConfigFromFile(charaDirs[i] + @$"{Path.DirectorySeparatorChar}CharaConfig.txt", ref _str); + + string[] delimiter = { "\n", "\r" }; + string[] strSingleLine = _str.Split(delimiter, StringSplitOptions.RemoveEmptyEntries); + + foreach (string line in strSingleLine) { + if (line.StartsWith("Chara_Resolution=")) // required for Heya resolution compatibility + { + string[] values = line.Substring(17).Trim().Split(','); + OpenTaiko.Skin.Characters_Resolution[i][0] = int.Parse(values[0]); + OpenTaiko.Skin.Characters_Resolution[i][1] = int.Parse(values[1]); + } else if (line.StartsWith("Heya_Chara_Render_Offset=")) { + string[] values = line.Substring(25).Trim().Split(','); + OpenTaiko.Skin.Characters_Heya_Render_Offset[i][0] = int.Parse(values[0]); + OpenTaiko.Skin.Characters_Heya_Render_Offset[i][1] = int.Parse(values[1]); + } else if (line.StartsWith("Result_UseResult1P=")) { + OpenTaiko.Skin.Characters_UseResult1P[i] = FDK.CConversion.bONorOFF(line.Substring(19).Trim()[0]); + } + } + + Characters[i] = new CCharacter(charaDirs[i], i); + } + #endregion #region [12_OnlineLounge] - public CTexture - //OnlineLounge_Background, - OnlineLounge_Box, - OnlineLounge_Center_Menu_Bar, - OnlineLounge_Center_Menu_Box_Slot, - OnlineLounge_Side_Menu, - OnlineLounge_Context, - OnlineLounge_Return_Box, - OnlineLounge_Song_Box; + //OnlineLounge_Background = TxC(ONLINELOUNGE + @"Background.png"); + OnlineLounge_Box = TxC(ONLINELOUNGE + @"Box.png"); + OnlineLounge_Center_Menu_Bar = TxC(ONLINELOUNGE + @"Center_Menu_Bar.png"); + OnlineLounge_Center_Menu_Box_Slot = TxC(ONLINELOUNGE + @"Center_Menu_Box_Slot.png"); + OnlineLounge_Side_Menu = TxC(ONLINELOUNGE + @"Side_Menu.png"); + OnlineLounge_Context = TxC(ONLINELOUNGE + @"Context.png"); + OnlineLounge_Song_Box = TxC(ONLINELOUNGE + @"Song_Box.png"); + OnlineLounge_Return_Box = TxC(ONLINELOUNGE + @"Return_Box.png"); #endregion #region [13_TowerSelect] - public CTexture - TowerSelect_Tower; + TowerSelect_Tower = TxC(TOWERSELECT + @"Tower.png"); #endregion - - #region [ 解放用 ] - public List listTexture = new List(); - #endregion - + if (OpenTaiko.ConfigIni.PreAssetsLoading) { + foreach (var act in OpenTaiko.app.listトップレベルActivities) { + act.CreateManagedResource(); + act.CreateUnmanagedResource(); + } + } } + + public int[] CreateNumberedArrayFromInt(int total) { + int[] array = new int[total]; + for (int i = 0; i < total; i++) { + array[i] = i; + } + return array; + } + + public CSkin.CSystemSound VoiceSelectOggOrWav(string basePath) { + if (File.Exists(basePath + @$".ogg")) + return new CSkin.CSystemSound(basePath + @$".ogg", false, false, true, ESoundGroup.Voice); + else + return new CSkin.CSystemSound(basePath + @$".wav", false, false, true, ESoundGroup.Voice); + } + + public void ReloadCharacter(int old, int newC, int player, bool primary = false) { + if (old == newC) + return; + + if (old >= 0 && + (OpenTaiko.SaveFileInstances[0].data.Character != old || player == 0) && + (OpenTaiko.SaveFileInstances[1].data.Character != old || player == 1) && + (OpenTaiko.SaveFileInstances[2].data.Character != old || player == 2) && + (OpenTaiko.SaveFileInstances[3].data.Character != old || player == 3) && + (OpenTaiko.SaveFileInstances[4].data.Character != old || player == 4)) { + int i = old; + + #region [Dispose the previous character] + + for (int j = 0; j < OpenTaiko.Skin.Characters_Menu_Loop_Ptn[i]; j++) + Characters_Menu_Loop[i][j]?.Dispose(); + + for (int j = 0; j < OpenTaiko.Skin.Characters_Menu_Start_Ptn[i]; j++) + Characters_Menu_Start[i][j]?.Dispose(); + + for (int j = 0; j < OpenTaiko.Skin.Characters_Menu_Select_Ptn[i]; j++) + Characters_Menu_Select[i][j]?.Dispose(); + + for (int j = 0; j < OpenTaiko.Skin.Characters_Menu_Wait_Ptn[i]; j++) + Characters_Menu_Wait[i][j]?.Dispose(); + + for (int j = 0; j < OpenTaiko.Skin.Characters_Result_Normal_Ptn[i]; j++) + Characters_Result_Normal[i][j]?.Dispose(); + + for (int j = 0; j < OpenTaiko.Skin.Characters_Result_Failed_In_Ptn[i]; j++) + Characters_Result_Failed_In[i][j]?.Dispose(); + + for (int j = 0; j < OpenTaiko.Skin.Characters_Result_Failed_Ptn[i]; j++) + Characters_Result_Failed[i][j]?.Dispose(); + + for (int j = 0; j < OpenTaiko.Skin.Characters_Result_Clear_Ptn[i]; j++) + Characters_Result_Clear[i][j]?.Dispose(); + + for (int j = 0; j < OpenTaiko.Skin.Characters_Title_Normal_Ptn[i]; j++) + Characters_Title_Normal[i][j]?.Dispose(); + + for (int j = 0; j < OpenTaiko.Skin.Characters_Title_Entry_Ptn[i]; j++) + Characters_Title_Entry[i][j]?.Dispose(); + + for (int j = 0; j < OpenTaiko.Skin.Characters_Normal_Ptn[i]; j++) + Characters_Normal[i][j]?.Dispose(); + + for (int j = 0; j < OpenTaiko.Skin.Characters_Normal_Missed_Ptn[i]; j++) + Characters_Normal_Missed[i][j]?.Dispose(); + + for (int j = 0; j < OpenTaiko.Skin.Characters_Normal_MissedDown_Ptn[i]; j++) + Characters_Normal_MissedDown[i][j]?.Dispose(); + + for (int j = 0; j < OpenTaiko.Skin.Characters_Normal_Cleared_Ptn[i]; j++) + Characters_Normal_Cleared[i][j]?.Dispose(); + + for (int j = 0; j < OpenTaiko.Skin.Characters_Normal_Maxed_Ptn[i]; j++) + Characters_Normal_Maxed[i][j]?.Dispose(); + + for (int j = 0; j < OpenTaiko.Skin.Characters_MissIn_Ptn[i]; j++) + Characters_MissIn[i][j]?.Dispose(); + + for (int j = 0; j < OpenTaiko.Skin.Characters_MissDownIn_Ptn[i]; j++) + Characters_MissDownIn[i][j]?.Dispose(); + + for (int j = 0; j < OpenTaiko.Skin.Characters_GoGoTime_Ptn[i]; j++) + Characters_GoGoTime[i][j]?.Dispose(); + + for (int j = 0; j < OpenTaiko.Skin.Characters_GoGoTime_Maxed_Ptn[i]; j++) + Characters_GoGoTime_Maxed[i][j]?.Dispose(); + + for (int j = 0; j < OpenTaiko.Skin.Characters_GoGoStart_Ptn[i]; j++) + Characters_GoGoStart[i][j]?.Dispose(); + + for (int j = 0; j < OpenTaiko.Skin.Characters_GoGoStart_Clear_Ptn[i]; j++) + Characters_GoGoStart_Clear[i][j]?.Dispose(); + + for (int j = 0; j < OpenTaiko.Skin.Characters_GoGoStart_Maxed_Ptn[i]; j++) + Characters_GoGoStart_Maxed[i][j]?.Dispose(); + + for (int j = 0; j < OpenTaiko.Skin.Characters_10Combo_Ptn[i]; j++) + Characters_10Combo[i][j]?.Dispose(); + + for (int j = 0; j < OpenTaiko.Skin.Characters_10Combo_Clear_Ptn[i]; j++) + Characters_10Combo_Clear[i][j]?.Dispose(); + + for (int j = 0; j < OpenTaiko.Skin.Characters_10Combo_Maxed_Ptn[i]; j++) + Characters_10Combo_Maxed[i][j]?.Dispose(); + + for (int j = 0; j < OpenTaiko.Skin.Characters_Become_Cleared_Ptn[i]; j++) + Characters_Become_Cleared[i][j]?.Dispose(); + + for (int j = 0; j < OpenTaiko.Skin.Characters_Become_Maxed_Ptn[i]; j++) + Characters_Become_Maxed[i][j]?.Dispose(); + + for (int j = 0; j < OpenTaiko.Skin.Characters_SoulOut_Ptn[i]; j++) + Characters_SoulOut[i][j]?.Dispose(); + + for (int j = 0; j < OpenTaiko.Skin.Characters_ClearOut_Ptn[i]; j++) + Characters_ClearOut[i][j]?.Dispose(); + + for (int j = 0; j < OpenTaiko.Skin.Characters_Return_Ptn[i]; j++) + Characters_Return[i][j]?.Dispose(); + + for (int j = 0; j < OpenTaiko.Skin.Characters_Balloon_Breaking_Ptn[i]; j++) + Characters_Balloon_Breaking[i][j]?.Dispose(); + + for (int j = 0; j < OpenTaiko.Skin.Characters_Balloon_Broke_Ptn[i]; j++) + Characters_Balloon_Broke[i][j]?.Dispose(); + + for (int j = 0; j < OpenTaiko.Skin.Characters_Balloon_Miss_Ptn[i]; j++) + Characters_Balloon_Miss[i][j]?.Dispose(); + + for (int j = 0; j < OpenTaiko.Skin.Characters_Kusudama_Idle_Ptn[i]; j++) + Characters_Kusudama_Idle[i][j]?.Dispose(); + + for (int j = 0; j < OpenTaiko.Skin.Characters_Kusudama_Breaking_Ptn[i]; j++) + Characters_Kusudama_Breaking[i][j]?.Dispose(); + + for (int j = 0; j < OpenTaiko.Skin.Characters_Kusudama_Broke_Ptn[i]; j++) + Characters_Kusudama_Broke[i][j]?.Dispose(); + + for (int j = 0; j < OpenTaiko.Skin.Characters_Kusudama_Miss_Ptn[i]; j++) + Characters_Kusudama_Miss[i][j]?.Dispose(); + + for (int j = 0; j < OpenTaiko.Skin.Characters_Tower_Standing_Ptn[i]; j++) + Characters_Tower_Standing[i][j]?.Dispose(); + + for (int j = 0; j < OpenTaiko.Skin.Characters_Tower_Climbing_Ptn[i]; j++) + Characters_Tower_Climbing[i][j]?.Dispose(); + + for (int j = 0; j < OpenTaiko.Skin.Characters_Tower_Running_Ptn[i]; j++) + Characters_Tower_Running[i][j]?.Dispose(); + + for (int j = 0; j < OpenTaiko.Skin.Characters_Tower_Clear_Ptn[i]; j++) + Characters_Tower_Clear[i][j]?.Dispose(); + + for (int j = 0; j < OpenTaiko.Skin.Characters_Tower_Fail_Ptn[i]; j++) + Characters_Tower_Fail[i][j]?.Dispose(); + + for (int j = 0; j < OpenTaiko.Skin.Characters_Tower_Standing_Tired_Ptn[i]; j++) + Characters_Tower_Standing_Tired[i][j]?.Dispose(); + + for (int j = 0; j < OpenTaiko.Skin.Characters_Tower_Climbing_Tired_Ptn[i]; j++) + Characters_Tower_Climbing_Tired[i][j]?.Dispose(); + + for (int j = 0; j < OpenTaiko.Skin.Characters_Tower_Running_Tired_Ptn[i]; j++) + Characters_Tower_Running_Tired[i][j]?.Dispose(); + + for (int j = 0; j < OpenTaiko.Skin.Characters_Tower_Clear_Tired_Ptn[i]; j++) + Characters_Tower_Clear_Tired[i][j]?.Dispose(); + #endregion + } + + string charaPath = OpenTaiko.strEXEのあるフォルダ + GLOBAL + CHARACTERS + OpenTaiko.Skin.Characters_DirName[newC]; + + if ((newC >= 0 && + OpenTaiko.SaveFileInstances[0].data.Character != newC && + OpenTaiko.SaveFileInstances[1].data.Character != newC && + OpenTaiko.SaveFileInstances[2].data.Character != newC && + OpenTaiko.SaveFileInstances[3].data.Character != newC && + OpenTaiko.SaveFileInstances[4].data.Character != newC) || primary) { + int i = newC; + + #region [Allocate the new character] + + #region [Character individual values count initialisation] + + OpenTaiko.Skin.Characters_Normal_Ptn[i] = OpenTaiko.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Normal{Path.DirectorySeparatorChar}"); + OpenTaiko.Skin.Characters_Normal_Missed_Ptn[i] = OpenTaiko.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Miss{Path.DirectorySeparatorChar}"); + OpenTaiko.Skin.Characters_Normal_MissedDown_Ptn[i] = OpenTaiko.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}MissDown{Path.DirectorySeparatorChar}"); + OpenTaiko.Skin.Characters_MissIn_Ptn[i] = OpenTaiko.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}MissIn{Path.DirectorySeparatorChar}"); + OpenTaiko.Skin.Characters_MissDownIn_Ptn[i] = OpenTaiko.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}MissDownIn{Path.DirectorySeparatorChar}"); + OpenTaiko.Skin.Characters_Normal_Cleared_Ptn[i] = OpenTaiko.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Clear{Path.DirectorySeparatorChar}"); + OpenTaiko.Skin.Characters_Normal_Maxed_Ptn[i] = OpenTaiko.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Clear_Max{Path.DirectorySeparatorChar}"); + OpenTaiko.Skin.Characters_GoGoTime_Ptn[i] = OpenTaiko.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}GoGo{Path.DirectorySeparatorChar}"); + OpenTaiko.Skin.Characters_GoGoTime_Maxed_Ptn[i] = OpenTaiko.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}GoGo_Max{Path.DirectorySeparatorChar}"); + OpenTaiko.Skin.Characters_10Combo_Ptn[i] = OpenTaiko.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}10combo{Path.DirectorySeparatorChar}"); + OpenTaiko.Skin.Characters_10Combo_Clear_Ptn[i] = OpenTaiko.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}10combo_Clear{Path.DirectorySeparatorChar}"); + OpenTaiko.Skin.Characters_10Combo_Maxed_Ptn[i] = OpenTaiko.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}10combo_Max{Path.DirectorySeparatorChar}"); + OpenTaiko.Skin.Characters_GoGoStart_Ptn[i] = OpenTaiko.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}GoGoStart{Path.DirectorySeparatorChar}"); + OpenTaiko.Skin.Characters_GoGoStart_Clear_Ptn[i] = OpenTaiko.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}GoGoStart_Clear{Path.DirectorySeparatorChar}"); + OpenTaiko.Skin.Characters_GoGoStart_Maxed_Ptn[i] = OpenTaiko.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}GoGoStart_Max{Path.DirectorySeparatorChar}"); + OpenTaiko.Skin.Characters_Become_Cleared_Ptn[i] = OpenTaiko.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Clearin{Path.DirectorySeparatorChar}"); + OpenTaiko.Skin.Characters_Become_Maxed_Ptn[i] = OpenTaiko.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Soulin{Path.DirectorySeparatorChar}"); + OpenTaiko.Skin.Characters_SoulOut_Ptn[i] = OpenTaiko.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}SoulOut{Path.DirectorySeparatorChar}"); + OpenTaiko.Skin.Characters_ClearOut_Ptn[i] = OpenTaiko.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}ClearOut{Path.DirectorySeparatorChar}"); + OpenTaiko.Skin.Characters_Return_Ptn[i] = OpenTaiko.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Return{Path.DirectorySeparatorChar}"); + OpenTaiko.Skin.Characters_Balloon_Breaking_Ptn[i] = OpenTaiko.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Balloon_Breaking{Path.DirectorySeparatorChar}"); + OpenTaiko.Skin.Characters_Balloon_Broke_Ptn[i] = OpenTaiko.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Balloon_Broke{Path.DirectorySeparatorChar}"); + OpenTaiko.Skin.Characters_Balloon_Miss_Ptn[i] = OpenTaiko.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Balloon_Miss{Path.DirectorySeparatorChar}"); + OpenTaiko.Skin.Characters_Kusudama_Idle_Ptn[i] = OpenTaiko.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Kusudama_Idle{Path.DirectorySeparatorChar}"); + OpenTaiko.Skin.Characters_Kusudama_Breaking_Ptn[i] = OpenTaiko.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Kusudama_Breaking{Path.DirectorySeparatorChar}"); + OpenTaiko.Skin.Characters_Kusudama_Broke_Ptn[i] = OpenTaiko.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Kusudama_Broke{Path.DirectorySeparatorChar}"); + OpenTaiko.Skin.Characters_Kusudama_Miss_Ptn[i] = OpenTaiko.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Kusudama_Miss{Path.DirectorySeparatorChar}"); + OpenTaiko.Skin.Characters_Title_Entry_Ptn[i] = OpenTaiko.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Title_Entry{Path.DirectorySeparatorChar}"); + OpenTaiko.Skin.Characters_Title_Normal_Ptn[i] = OpenTaiko.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Title_Normal{Path.DirectorySeparatorChar}"); + OpenTaiko.Skin.Characters_Menu_Loop_Ptn[i] = OpenTaiko.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Menu_Loop{Path.DirectorySeparatorChar}"); + OpenTaiko.Skin.Characters_Menu_Select_Ptn[i] = OpenTaiko.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Menu_Select{Path.DirectorySeparatorChar}"); + OpenTaiko.Skin.Characters_Menu_Start_Ptn[i] = OpenTaiko.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Menu_Start{Path.DirectorySeparatorChar}"); + OpenTaiko.Skin.Characters_Menu_Wait_Ptn[i] = OpenTaiko.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Menu_Wait{Path.DirectorySeparatorChar}"); + OpenTaiko.Skin.Characters_Result_Clear_Ptn[i] = OpenTaiko.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Result_Clear{Path.DirectorySeparatorChar}"); + OpenTaiko.Skin.Characters_Result_Failed_Ptn[i] = OpenTaiko.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Result_Failed{Path.DirectorySeparatorChar}"); + OpenTaiko.Skin.Characters_Result_Failed_In_Ptn[i] = OpenTaiko.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Result_Failed_In{Path.DirectorySeparatorChar}"); + OpenTaiko.Skin.Characters_Result_Normal_Ptn[i] = OpenTaiko.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Result_Normal{Path.DirectorySeparatorChar}"); + OpenTaiko.Skin.Characters_Tower_Standing_Ptn[i] = OpenTaiko.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Tower_Char{Path.DirectorySeparatorChar}Standing{Path.DirectorySeparatorChar}"); + OpenTaiko.Skin.Characters_Tower_Climbing_Ptn[i] = OpenTaiko.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Tower_Char{Path.DirectorySeparatorChar}Climbing{Path.DirectorySeparatorChar}"); + OpenTaiko.Skin.Characters_Tower_Running_Ptn[i] = OpenTaiko.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Tower_Char{Path.DirectorySeparatorChar}Running{Path.DirectorySeparatorChar}"); + OpenTaiko.Skin.Characters_Tower_Clear_Ptn[i] = OpenTaiko.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Tower_Char{Path.DirectorySeparatorChar}Clear{Path.DirectorySeparatorChar}"); + OpenTaiko.Skin.Characters_Tower_Fail_Ptn[i] = OpenTaiko.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Tower_Char{Path.DirectorySeparatorChar}Fail{Path.DirectorySeparatorChar}"); + OpenTaiko.Skin.Characters_Tower_Standing_Tired_Ptn[i] = OpenTaiko.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Tower_Char{Path.DirectorySeparatorChar}Standing_Tired{Path.DirectorySeparatorChar}"); + OpenTaiko.Skin.Characters_Tower_Climbing_Tired_Ptn[i] = OpenTaiko.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Tower_Char{Path.DirectorySeparatorChar}Climbing_Tired{Path.DirectorySeparatorChar}"); + OpenTaiko.Skin.Characters_Tower_Running_Tired_Ptn[i] = OpenTaiko.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Tower_Char{Path.DirectorySeparatorChar}Running_Tired{Path.DirectorySeparatorChar}"); + OpenTaiko.Skin.Characters_Tower_Clear_Tired_Ptn[i] = OpenTaiko.t連番画像の枚数を数える(charaPath + @$"{Path.DirectorySeparatorChar}Tower_Char{Path.DirectorySeparatorChar}Clear_Tired{Path.DirectorySeparatorChar}"); + + Characters_Normal[i] = new CTexture[OpenTaiko.Skin.Characters_Normal_Ptn[i]]; + Characters_Normal_Missed[i] = new CTexture[OpenTaiko.Skin.Characters_Normal_Missed_Ptn[i]]; + Characters_Normal_MissedDown[i] = new CTexture[OpenTaiko.Skin.Characters_Normal_MissedDown_Ptn[i]]; + Characters_Normal_Cleared[i] = new CTexture[OpenTaiko.Skin.Characters_Normal_Cleared_Ptn[i]]; + Characters_Normal_Maxed[i] = new CTexture[OpenTaiko.Skin.Characters_Normal_Maxed_Ptn[i]]; + Characters_MissIn[i] = new CTexture[OpenTaiko.Skin.Characters_MissIn_Ptn[i]]; + Characters_MissDownIn[i] = new CTexture[OpenTaiko.Skin.Characters_MissDownIn_Ptn[i]]; + Characters_GoGoTime[i] = new CTexture[OpenTaiko.Skin.Characters_GoGoTime_Ptn[i]]; + Characters_GoGoTime_Maxed[i] = new CTexture[OpenTaiko.Skin.Characters_GoGoTime_Maxed_Ptn[i]]; + Characters_10Combo[i] = new CTexture[OpenTaiko.Skin.Characters_10Combo_Ptn[i]]; + Characters_10Combo_Clear[i] = new CTexture[OpenTaiko.Skin.Characters_10Combo_Clear_Ptn[i]]; + Characters_10Combo_Maxed[i] = new CTexture[OpenTaiko.Skin.Characters_10Combo_Maxed_Ptn[i]]; + Characters_GoGoStart[i] = new CTexture[OpenTaiko.Skin.Characters_GoGoStart_Ptn[i]]; + Characters_GoGoStart_Clear[i] = new CTexture[OpenTaiko.Skin.Characters_GoGoStart_Clear_Ptn[i]]; + Characters_GoGoStart_Maxed[i] = new CTexture[OpenTaiko.Skin.Characters_GoGoStart_Maxed_Ptn[i]]; + Characters_Become_Cleared[i] = new CTexture[OpenTaiko.Skin.Characters_Become_Cleared_Ptn[i]]; + Characters_Become_Maxed[i] = new CTexture[OpenTaiko.Skin.Characters_Become_Maxed_Ptn[i]]; + Characters_SoulOut[i] = new CTexture[OpenTaiko.Skin.Characters_SoulOut_Ptn[i]]; + Characters_ClearOut[i] = new CTexture[OpenTaiko.Skin.Characters_ClearOut_Ptn[i]]; + Characters_Return[i] = new CTexture[OpenTaiko.Skin.Characters_Return_Ptn[i]]; + Characters_Balloon_Breaking[i] = new CTexture[OpenTaiko.Skin.Characters_Balloon_Breaking_Ptn[i]]; + Characters_Balloon_Broke[i] = new CTexture[OpenTaiko.Skin.Characters_Balloon_Broke_Ptn[i]]; + Characters_Balloon_Miss[i] = new CTexture[OpenTaiko.Skin.Characters_Balloon_Miss_Ptn[i]]; + Characters_Kusudama_Idle[i] = new CTexture[OpenTaiko.Skin.Characters_Kusudama_Idle_Ptn[i]]; + Characters_Kusudama_Breaking[i] = new CTexture[OpenTaiko.Skin.Characters_Kusudama_Breaking_Ptn[i]]; + Characters_Kusudama_Broke[i] = new CTexture[OpenTaiko.Skin.Characters_Kusudama_Broke_Ptn[i]]; + Characters_Kusudama_Miss[i] = new CTexture[OpenTaiko.Skin.Characters_Kusudama_Miss_Ptn[i]]; + Characters_Title_Entry[i] = new CTexture[OpenTaiko.Skin.Characters_Title_Entry_Ptn[i]]; + Characters_Title_Normal[i] = new CTexture[OpenTaiko.Skin.Characters_Title_Normal_Ptn[i]]; + Characters_Result_Clear[i] = new CTexture[OpenTaiko.Skin.Characters_Result_Clear_Ptn[i]]; + Characters_Result_Failed[i] = new CTexture[OpenTaiko.Skin.Characters_Result_Failed_Ptn[i]]; + Characters_Result_Failed_In[i] = new CTexture[OpenTaiko.Skin.Characters_Result_Failed_In_Ptn[i]]; + Characters_Result_Normal[i] = new CTexture[OpenTaiko.Skin.Characters_Result_Normal_Ptn[i]]; + Characters_Menu_Loop[i] = new CTexture[OpenTaiko.Skin.Characters_Menu_Loop_Ptn[i]]; + Characters_Menu_Start[i] = new CTexture[OpenTaiko.Skin.Characters_Menu_Start_Ptn[i]]; + Characters_Menu_Select[i] = new CTexture[OpenTaiko.Skin.Characters_Menu_Select_Ptn[i]]; + Characters_Menu_Wait[i] = new CTexture[OpenTaiko.Skin.Characters_Menu_Wait_Ptn[i]]; + Characters_Tower_Standing[i] = new CTexture[OpenTaiko.Skin.Characters_Tower_Standing_Ptn[i]]; + Characters_Tower_Climbing[i] = new CTexture[OpenTaiko.Skin.Characters_Tower_Climbing_Ptn[i]]; + Characters_Tower_Running[i] = new CTexture[OpenTaiko.Skin.Characters_Tower_Running_Ptn[i]]; + Characters_Tower_Clear[i] = new CTexture[OpenTaiko.Skin.Characters_Tower_Clear_Ptn[i]]; + Characters_Tower_Fail[i] = new CTexture[OpenTaiko.Skin.Characters_Tower_Fail_Ptn[i]]; + Characters_Tower_Standing_Tired[i] = new CTexture[OpenTaiko.Skin.Characters_Tower_Standing_Tired_Ptn[i]]; + Characters_Tower_Climbing_Tired[i] = new CTexture[OpenTaiko.Skin.Characters_Tower_Climbing_Tired_Ptn[i]]; + Characters_Tower_Running_Tired[i] = new CTexture[OpenTaiko.Skin.Characters_Tower_Running_Tired_Ptn[i]]; + Characters_Tower_Clear_Tired[i] = new CTexture[OpenTaiko.Skin.Characters_Tower_Clear_Tired_Ptn[i]]; + + #endregion + + #region [Characters asset loading] + + for (int j = 0; j < OpenTaiko.Skin.Characters_Menu_Loop_Ptn[i]; j++) + Characters_Menu_Loop[i][j] = TxCGlobal(CHARACTERS + OpenTaiko.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Menu_Loop{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); + + for (int j = 0; j < OpenTaiko.Skin.Characters_Menu_Select_Ptn[i]; j++) + Characters_Menu_Select[i][j] = TxCGlobal(CHARACTERS + OpenTaiko.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Menu_Select{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); + + for (int j = 0; j < OpenTaiko.Skin.Characters_Menu_Start_Ptn[i]; j++) + Characters_Menu_Start[i][j] = TxCGlobal(CHARACTERS + OpenTaiko.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Menu_Start{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); + + for (int j = 0; j < OpenTaiko.Skin.Characters_Menu_Wait_Ptn[i]; j++) + Characters_Menu_Wait[i][j] = TxCGlobal(CHARACTERS + OpenTaiko.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Menu_Wait{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); + + for (int j = 0; j < OpenTaiko.Skin.Characters_Result_Normal_Ptn[i]; j++) + Characters_Result_Normal[i][j] = TxCGlobal(CHARACTERS + OpenTaiko.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Result_Normal{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); + + for (int j = 0; j < OpenTaiko.Skin.Characters_Result_Failed_In_Ptn[i]; j++) + Characters_Result_Failed_In[i][j] = TxCGlobal(CHARACTERS + OpenTaiko.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Result_Failed_In{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); + + for (int j = 0; j < OpenTaiko.Skin.Characters_Result_Failed_Ptn[i]; j++) + Characters_Result_Failed[i][j] = TxCGlobal(CHARACTERS + OpenTaiko.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Result_Failed{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); + + for (int j = 0; j < OpenTaiko.Skin.Characters_Result_Clear_Ptn[i]; j++) + Characters_Result_Clear[i][j] = TxCGlobal(CHARACTERS + OpenTaiko.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Result_Clear{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); + + for (int j = 0; j < OpenTaiko.Skin.Characters_Title_Normal_Ptn[i]; j++) + Characters_Title_Normal[i][j] = TxCGlobal(CHARACTERS + OpenTaiko.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Title_Normal{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); + + for (int j = 0; j < OpenTaiko.Skin.Characters_Title_Entry_Ptn[i]; j++) + Characters_Title_Entry[i][j] = TxCGlobal(CHARACTERS + OpenTaiko.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Title_Entry{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); + + for (int j = 0; j < OpenTaiko.Skin.Characters_Normal_Ptn[i]; j++) + Characters_Normal[i][j] = TxCGlobal(CHARACTERS + OpenTaiko.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Normal{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); + + for (int j = 0; j < OpenTaiko.Skin.Characters_Normal_Missed_Ptn[i]; j++) + Characters_Normal_Missed[i][j] = TxCGlobal(CHARACTERS + OpenTaiko.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Miss{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); + + for (int j = 0; j < OpenTaiko.Skin.Characters_Normal_MissedDown_Ptn[i]; j++) + Characters_Normal_MissedDown[i][j] = TxCGlobal(CHARACTERS + OpenTaiko.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}MissDown{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); + + for (int j = 0; j < OpenTaiko.Skin.Characters_Normal_Cleared_Ptn[i]; j++) + Characters_Normal_Cleared[i][j] = TxCGlobal(CHARACTERS + OpenTaiko.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Clear{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); + + for (int j = 0; j < OpenTaiko.Skin.Characters_Normal_Maxed_Ptn[i]; j++) + Characters_Normal_Maxed[i][j] = TxCGlobal(CHARACTERS + OpenTaiko.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Clear_Max{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); + + for (int j = 0; j < OpenTaiko.Skin.Characters_MissIn_Ptn[i]; j++) + Characters_MissIn[i][j] = TxCGlobal(CHARACTERS + OpenTaiko.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}MissIn{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); + + for (int j = 0; j < OpenTaiko.Skin.Characters_MissDownIn_Ptn[i]; j++) + Characters_MissDownIn[i][j] = TxCGlobal(CHARACTERS + OpenTaiko.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}MissDownIn{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); + + for (int j = 0; j < OpenTaiko.Skin.Characters_GoGoTime_Ptn[i]; j++) + Characters_GoGoTime[i][j] = TxCGlobal(CHARACTERS + OpenTaiko.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}GoGo{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); + + for (int j = 0; j < OpenTaiko.Skin.Characters_GoGoTime_Maxed_Ptn[i]; j++) + Characters_GoGoTime_Maxed[i][j] = TxCGlobal(CHARACTERS + OpenTaiko.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}GoGo_Max{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); + + for (int j = 0; j < OpenTaiko.Skin.Characters_GoGoStart_Ptn[i]; j++) + Characters_GoGoStart[i][j] = TxCGlobal(CHARACTERS + OpenTaiko.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}GoGoStart{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); + + for (int j = 0; j < OpenTaiko.Skin.Characters_GoGoStart_Clear_Ptn[i]; j++) + Characters_GoGoStart_Clear[i][j] = TxCGlobal(CHARACTERS + OpenTaiko.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}GoGoStart_Clear{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); + + for (int j = 0; j < OpenTaiko.Skin.Characters_GoGoStart_Maxed_Ptn[i]; j++) + Characters_GoGoStart_Maxed[i][j] = TxCGlobal(CHARACTERS + OpenTaiko.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}GoGoStart_Max{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); + + for (int j = 0; j < OpenTaiko.Skin.Characters_10Combo_Ptn[i]; j++) + Characters_10Combo[i][j] = TxCGlobal(CHARACTERS + OpenTaiko.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}10combo{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); + + for (int j = 0; j < OpenTaiko.Skin.Characters_10Combo_Clear_Ptn[i]; j++) + Characters_10Combo_Clear[i][j] = TxCGlobal(CHARACTERS + OpenTaiko.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}10combo_Clear{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); + + for (int j = 0; j < OpenTaiko.Skin.Characters_10Combo_Maxed_Ptn[i]; j++) + Characters_10Combo_Maxed[i][j] = TxCGlobal(CHARACTERS + OpenTaiko.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}10combo_Max{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); + + for (int j = 0; j < OpenTaiko.Skin.Characters_Become_Cleared_Ptn[i]; j++) + Characters_Become_Cleared[i][j] = TxCGlobal(CHARACTERS + OpenTaiko.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Clearin{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); + + for (int j = 0; j < OpenTaiko.Skin.Characters_Become_Maxed_Ptn[i]; j++) + Characters_Become_Maxed[i][j] = TxCGlobal(CHARACTERS + OpenTaiko.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Soulin{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); + + for (int j = 0; j < OpenTaiko.Skin.Characters_SoulOut_Ptn[i]; j++) + Characters_SoulOut[i][j] = TxCGlobal(CHARACTERS + OpenTaiko.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Soulout{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); + + for (int j = 0; j < OpenTaiko.Skin.Characters_ClearOut_Ptn[i]; j++) + Characters_ClearOut[i][j] = TxCGlobal(CHARACTERS + OpenTaiko.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Clearout{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); + + for (int j = 0; j < OpenTaiko.Skin.Characters_Return_Ptn[i]; j++) + Characters_Return[i][j] = TxCGlobal(CHARACTERS + OpenTaiko.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Return{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); + + for (int j = 0; j < OpenTaiko.Skin.Characters_Balloon_Breaking_Ptn[i]; j++) + Characters_Balloon_Breaking[i][j] = TxCGlobal(CHARACTERS + OpenTaiko.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Balloon_Breaking{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); + + for (int j = 0; j < OpenTaiko.Skin.Characters_Balloon_Broke_Ptn[i]; j++) + Characters_Balloon_Broke[i][j] = TxCGlobal(CHARACTERS + OpenTaiko.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Balloon_Broke{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); + + for (int j = 0; j < OpenTaiko.Skin.Characters_Balloon_Miss_Ptn[i]; j++) + Characters_Balloon_Miss[i][j] = TxCGlobal(CHARACTERS + OpenTaiko.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Balloon_Miss{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); + + for (int j = 0; j < OpenTaiko.Skin.Characters_Kusudama_Idle_Ptn[i]; j++) + Characters_Kusudama_Idle[i][j] = TxCGlobal(CHARACTERS + OpenTaiko.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Kusudama_Idle{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); + + for (int j = 0; j < OpenTaiko.Skin.Characters_Kusudama_Breaking_Ptn[i]; j++) + Characters_Kusudama_Breaking[i][j] = TxCGlobal(CHARACTERS + OpenTaiko.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Kusudama_Breaking{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); + + for (int j = 0; j < OpenTaiko.Skin.Characters_Kusudama_Broke_Ptn[i]; j++) + Characters_Kusudama_Broke[i][j] = TxCGlobal(CHARACTERS + OpenTaiko.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Kusudama_Broke{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); + + for (int j = 0; j < OpenTaiko.Skin.Characters_Kusudama_Miss_Ptn[i]; j++) + Characters_Kusudama_Miss[i][j] = TxCGlobal(CHARACTERS + OpenTaiko.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Kusudama_Miss{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); + + for (int j = 0; j < OpenTaiko.Skin.Characters_Tower_Standing_Ptn[i]; j++) + Characters_Tower_Standing[i][j] = TxCGlobal(CHARACTERS + OpenTaiko.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Tower_Char{Path.DirectorySeparatorChar}Standing{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); + + for (int j = 0; j < OpenTaiko.Skin.Characters_Tower_Climbing_Ptn[i]; j++) + Characters_Tower_Climbing[i][j] = TxCGlobal(CHARACTERS + OpenTaiko.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Tower_Char{Path.DirectorySeparatorChar}Climbing{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); + + for (int j = 0; j < OpenTaiko.Skin.Characters_Tower_Running_Ptn[i]; j++) + Characters_Tower_Running[i][j] = TxCGlobal(CHARACTERS + OpenTaiko.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Tower_Char{Path.DirectorySeparatorChar}Running{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); + + for (int j = 0; j < OpenTaiko.Skin.Characters_Tower_Clear_Ptn[i]; j++) + Characters_Tower_Clear[i][j] = TxCGlobal(CHARACTERS + OpenTaiko.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Tower_Char{Path.DirectorySeparatorChar}Clear{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); + + for (int j = 0; j < OpenTaiko.Skin.Characters_Tower_Fail_Ptn[i]; j++) + Characters_Tower_Fail[i][j] = TxCGlobal(CHARACTERS + OpenTaiko.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Tower_Char{Path.DirectorySeparatorChar}Fail{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); + + for (int j = 0; j < OpenTaiko.Skin.Characters_Tower_Standing_Tired_Ptn[i]; j++) + Characters_Tower_Standing_Tired[i][j] = TxCGlobal(CHARACTERS + OpenTaiko.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Tower_Char{Path.DirectorySeparatorChar}Standing_Tired{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); + + for (int j = 0; j < OpenTaiko.Skin.Characters_Tower_Climbing_Tired_Ptn[i]; j++) + Characters_Tower_Climbing_Tired[i][j] = TxCGlobal(CHARACTERS + OpenTaiko.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Tower_Char{Path.DirectorySeparatorChar}Climbing_Tired{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); + + for (int j = 0; j < OpenTaiko.Skin.Characters_Tower_Running_Tired_Ptn[i]; j++) + Characters_Tower_Running_Tired[i][j] = TxCGlobal(CHARACTERS + OpenTaiko.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Tower_Char{Path.DirectorySeparatorChar}Running_Tired{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); + + for (int j = 0; j < OpenTaiko.Skin.Characters_Tower_Clear_Tired_Ptn[i]; j++) + Characters_Tower_Clear_Tired[i][j] = TxCGlobal(CHARACTERS + OpenTaiko.Skin.Characters_DirName[i] + @$"{Path.DirectorySeparatorChar}Tower_Char{Path.DirectorySeparatorChar}Clear_Tired{Path.DirectorySeparatorChar}" + j.ToString() + @$".png"); + + #endregion + + #region [Parse individual character parameters] + + #region [Default values] + + OpenTaiko.Skin.Characters_X[i] = new int[] { 0, 0 }; + OpenTaiko.Skin.Characters_Y[i] = new int[] { 0, 537 }; + OpenTaiko.Skin.Characters_4P[i] = new int[] { 165, 68 }; + OpenTaiko.Skin.Characters_5P[i] = new int[] { 165, 40 }; + OpenTaiko.Skin.Characters_X_AI[i] = new int[] { 472, 602 }; + OpenTaiko.Skin.Characters_Y_AI[i] = new int[] { 152, 152 }; + OpenTaiko.Skin.Characters_Balloon_X[i] = new int[] { 240, 240, 0, 0 }; + OpenTaiko.Skin.Characters_Balloon_Y[i] = new int[] { 0, 297, 0, 0 }; + OpenTaiko.Skin.Characters_Balloon_4P[i] = new int[] { 0, -176 }; + OpenTaiko.Skin.Characters_Balloon_5P[i] = new int[] { 0, -168 }; + OpenTaiko.Skin.Characters_Kusudama_X[i] = new int[] { 290, 690, 90, 890, 490 }; + OpenTaiko.Skin.Characters_Kusudama_Y[i] = new int[] { 420, 420, 420, 420, 420 }; + OpenTaiko.Skin.Characters_Motion_Normal[i] = CreateNumberedArrayFromInt(OpenTaiko.Skin.Characters_Normal_Ptn[i]); + OpenTaiko.Skin.Characters_Motion_10Combo[i] = CreateNumberedArrayFromInt(OpenTaiko.Skin.Characters_10Combo_Ptn[i]); + OpenTaiko.Skin.Characters_Motion_10Combo_Clear[i] = CreateNumberedArrayFromInt(OpenTaiko.Skin.Characters_10Combo_Clear_Ptn[i]); + OpenTaiko.Skin.Characters_Motion_10ComboMax[i] = CreateNumberedArrayFromInt(OpenTaiko.Skin.Characters_10Combo_Maxed_Ptn[i]); + OpenTaiko.Skin.Characters_Motion_Miss[i] = CreateNumberedArrayFromInt(OpenTaiko.Skin.Characters_Normal_Missed_Ptn[i]); + OpenTaiko.Skin.Characters_Motion_MissDown[i] = CreateNumberedArrayFromInt(OpenTaiko.Skin.Characters_Normal_MissedDown_Ptn[i]); + OpenTaiko.Skin.Characters_Motion_ClearIn[i] = CreateNumberedArrayFromInt(OpenTaiko.Skin.Characters_Become_Cleared_Ptn[i]); + OpenTaiko.Skin.Characters_Motion_Clear[i] = CreateNumberedArrayFromInt(OpenTaiko.Skin.Characters_Normal_Cleared_Ptn[i]); + OpenTaiko.Skin.Characters_Motion_ClearMax[i] = CreateNumberedArrayFromInt(OpenTaiko.Skin.Characters_Normal_Maxed_Ptn[i]); + OpenTaiko.Skin.Characters_Motion_MissIn[i] = CreateNumberedArrayFromInt(OpenTaiko.Skin.Characters_MissIn_Ptn[i]); + OpenTaiko.Skin.Characters_Motion_MissDownIn[i] = CreateNumberedArrayFromInt(OpenTaiko.Skin.Characters_MissDownIn_Ptn[i]); + OpenTaiko.Skin.Characters_Motion_GoGoStart[i] = CreateNumberedArrayFromInt(OpenTaiko.Skin.Characters_GoGoStart_Ptn[i]); + OpenTaiko.Skin.Characters_Motion_GoGoStart_Clear[i] = CreateNumberedArrayFromInt(OpenTaiko.Skin.Characters_GoGoStart_Clear_Ptn[i]); + OpenTaiko.Skin.Characters_Motion_GoGoStartMax[i] = CreateNumberedArrayFromInt(OpenTaiko.Skin.Characters_GoGoStart_Maxed_Ptn[i]); + OpenTaiko.Skin.Characters_Motion_GoGo[i] = CreateNumberedArrayFromInt(OpenTaiko.Skin.Characters_GoGoTime_Ptn[i]); + OpenTaiko.Skin.Characters_Motion_GoGoMax[i] = CreateNumberedArrayFromInt(OpenTaiko.Skin.Characters_GoGoTime_Maxed_Ptn[i]); + OpenTaiko.Skin.Characters_Motion_SoulIn[i] = CreateNumberedArrayFromInt(OpenTaiko.Skin.Characters_Become_Maxed_Ptn[i]); + OpenTaiko.Skin.Characters_Motion_SoulOut[i] = CreateNumberedArrayFromInt(OpenTaiko.Skin.Characters_SoulOut_Ptn[i]); + OpenTaiko.Skin.Characters_Motion_ClearOut[i] = CreateNumberedArrayFromInt(OpenTaiko.Skin.Characters_ClearOut_Ptn[i]); + OpenTaiko.Skin.Characters_Motion_Return[i] = CreateNumberedArrayFromInt(OpenTaiko.Skin.Characters_Return_Ptn[i]); + /* + TJAPlayer3.Skin.Characters_Motion_Tower_Standing[i] = CreateNumberedArrayFromInt(TJAPlayer3.Skin.Characters_Tower_Standing_Ptn[i]); + TJAPlayer3.Skin.Characters_Motion_Tower_Climbing[i] = CreateNumberedArrayFromInt(TJAPlayer3.Skin.Characters_Tower_Climbing_Ptn[i]); + TJAPlayer3.Skin.Characters_Motion_Tower_Running[i] = CreateNumberedArrayFromInt(TJAPlayer3.Skin.Characters_Tower_Running_Ptn[i]); + TJAPlayer3.Skin.Characters_Motion_Tower_Clear[i] = CreateNumberedArrayFromInt(TJAPlayer3.Skin.Characters_Tower_Clear_Ptn[i]); + TJAPlayer3.Skin.Characters_Motion_Tower_Fail[i] = CreateNumberedArrayFromInt(TJAPlayer3.Skin.Characters_Tower_Fail_Ptn[i]); + TJAPlayer3.Skin.Characters_Motion_Tower_Standing_Tired[i] = CreateNumberedArrayFromInt(TJAPlayer3.Skin.Characters_Tower_Standing_Tired_Ptn[i]); + TJAPlayer3.Skin.Characters_Motion_Tower_Climbing_Tired[i] = CreateNumberedArrayFromInt(TJAPlayer3.Skin.Characters_Tower_Climbing_Tired_Ptn[i]); + TJAPlayer3.Skin.Characters_Motion_Tower_Running_Tired[i] = CreateNumberedArrayFromInt(TJAPlayer3.Skin.Characters_Tower_Running_Tired_Ptn[i]); + TJAPlayer3.Skin.Characters_Motion_Tower_Clear_Tired[i] = CreateNumberedArrayFromInt(TJAPlayer3.Skin.Characters_Tower_Clear_Tired_Ptn[i]); + */ + OpenTaiko.Skin.Characters_Beat_Normal[i] = 1; + OpenTaiko.Skin.Characters_Beat_Miss[i] = 1; + OpenTaiko.Skin.Characters_Beat_MissDown[i] = 1; + OpenTaiko.Skin.Characters_Beat_Clear[i] = 2; + OpenTaiko.Skin.Characters_Beat_GoGo[i] = 2; + OpenTaiko.Skin.Characters_Beat_MissIn[i] = 1.5f; + OpenTaiko.Skin.Characters_Beat_MissDownIn[i] = 1.5f; + OpenTaiko.Skin.Characters_Beat_10Combo[i] = 1.5f; + OpenTaiko.Skin.Characters_Beat_10Combo_Clear[i] = 1.5f; + OpenTaiko.Skin.Characters_Beat_10ComboMax[i] = 1.5f; + OpenTaiko.Skin.Characters_Beat_ClearIn[i] = 1.5f; + OpenTaiko.Skin.Characters_Beat_ClearMax[i] = 1.5f; + OpenTaiko.Skin.Characters_Beat_GoGoStart[i] = 1.5f; + OpenTaiko.Skin.Characters_Beat_GoGoStart_Clear[i] = 1.5f; + OpenTaiko.Skin.Characters_Beat_GoGoStartMax[i] = 1.5f; + OpenTaiko.Skin.Characters_Beat_GoGoMax[i] = 2; + OpenTaiko.Skin.Characters_Beat_SoulIn[i] = 1.5f; + OpenTaiko.Skin.Characters_Beat_SoulOut[i] = 1.5f; + OpenTaiko.Skin.Characters_Beat_ClearOut[i] = 1.5f; + OpenTaiko.Skin.Characters_Beat_Return[i] = 1.5f; + OpenTaiko.Skin.Characters_Beat_Tower_Standing[i] = 1; + OpenTaiko.Skin.Characters_Beat_Tower_Clear[i] = 1; + OpenTaiko.Skin.Characters_Beat_Tower_Fail[i] = 1; + OpenTaiko.Skin.Characters_Beat_Tower_Standing_Tired[i] = 1; + OpenTaiko.Skin.Characters_Beat_Tower_Clear_Tired[i] = 1; + OpenTaiko.Skin.Characters_Balloon_Timer[i] = 28; + OpenTaiko.Skin.Characters_Balloon_Delay[i] = 500; + OpenTaiko.Skin.Characters_Balloon_FadeOut[i] = 84; + OpenTaiko.Skin.Characters_Title_Entry_AnimationDuration[i] = 1000; + OpenTaiko.Skin.Characters_Title_Normal_AnimationDuration[i] = 1000; + OpenTaiko.Skin.Characters_Menu_Loop_AnimationDuration[i] = 1000; + OpenTaiko.Skin.Characters_Menu_Select_AnimationDuration[i] = 1000; + OpenTaiko.Skin.Characters_Menu_Start_AnimationDuration[i] = 1000; + OpenTaiko.Skin.Characters_Menu_Wait_AnimationDuration[i] = 1000; + OpenTaiko.Skin.Characters_Result_Normal_AnimationDuration[i] = 1000; + OpenTaiko.Skin.Characters_Result_Clear_AnimationDuration[i] = 1000; + OpenTaiko.Skin.Characters_Result_Failed_In_AnimationDuration[i] = 1000; + OpenTaiko.Skin.Characters_Result_Failed_AnimationDuration[i] = 1000; + + #endregion + + var _str = ""; + OpenTaiko.Skin.LoadSkinConfigFromFile(charaPath + @$"{Path.DirectorySeparatorChar}CharaConfig.txt", ref _str); + + string[] delimiter = { "\n" }; + string[] strSingleLine = _str.Split(delimiter, StringSplitOptions.RemoveEmptyEntries); + + foreach (string s in strSingleLine) { + string str = s.Replace('\t', ' ').TrimStart(new char[] { '\t', ' ' }); + if ((str.Length != 0) && (str[0] != ';')) { + try { + string strCommand; + string strParam; + string[] strArray = str.Split(new char[] { '=' }); + + if (strArray.Length == 2) { + strCommand = strArray[0].Trim(); + strParam = strArray[1].Trim(); + + switch (strCommand) { + case "Game_Chara_X": { + string[] strSplit = strParam.Split(','); + for (int k = 0; k < 2; k++) { + OpenTaiko.Skin.Characters_X[i][k] = int.Parse(strSplit[k]); + } + break; + } + case "Game_Chara_Y": { + string[] strSplit = strParam.Split(','); + for (int k = 0; k < 2; k++) { + OpenTaiko.Skin.Characters_Y[i][k] = int.Parse(strSplit[k]); + } + break; + } + case "Game_Chara_4P": { + string[] strSplit = strParam.Split(','); + for (int k = 0; k < 2; k++) { + OpenTaiko.Skin.Characters_4P[i][k] = int.Parse(strSplit[k]); + } + break; + } + case "Game_Chara_5P": { + string[] strSplit = strParam.Split(','); + for (int k = 0; k < 2; k++) { + OpenTaiko.Skin.Characters_5P[i][k] = int.Parse(strSplit[k]); + } + break; + } + case "Game_Chara_X_AI": { + string[] strSplit = strParam.Split(','); + for (int k = 0; k < 2; k++) { + OpenTaiko.Skin.Characters_X_AI[i][k] = int.Parse(strSplit[k]); + } + break; + } + case "Game_Chara_Y_AI": { + string[] strSplit = strParam.Split(','); + for (int k = 0; k < 2; k++) { + OpenTaiko.Skin.Characters_Y_AI[i][k] = int.Parse(strSplit[k]); + } + break; + } + case "Game_Chara_Balloon_X": { + string[] strSplit = strParam.Split(','); + for (int k = 0; k < 2; k++) { + OpenTaiko.Skin.Characters_Balloon_X[i][k] = int.Parse(strSplit[k]); + } + break; + } + case "Game_Chara_Balloon_Y": { + string[] strSplit = strParam.Split(','); + for (int k = 0; k < 2; k++) { + OpenTaiko.Skin.Characters_Balloon_Y[i][k] = int.Parse(strSplit[k]); + } + break; + } + case "Game_Chara_Balloon_4P": { + string[] strSplit = strParam.Split(','); + for (int k = 0; k < 2; k++) { + OpenTaiko.Skin.Characters_Balloon_4P[i][k] = int.Parse(strSplit[k]); + } + break; + } + case "Game_Chara_Balloon_5P": { + string[] strSplit = strParam.Split(','); + for (int k = 0; k < 2; k++) { + OpenTaiko.Skin.Characters_Balloon_5P[i][k] = int.Parse(strSplit[k]); + } + break; + } + case "Game_Chara_Kusudama_X": { + string[] strSplit = strParam.Split(','); + for (int k = 0; k < 5; k++) { + OpenTaiko.Skin.Characters_Kusudama_X[i][k] = int.Parse(strSplit[k]); + } + break; + } + case "Game_Chara_Kusudama_Y": { + string[] strSplit = strParam.Split(','); + for (int k = 0; k < 5; k++) { + OpenTaiko.Skin.Characters_Kusudama_Y[i][k] = int.Parse(strSplit[k]); + } + break; + } + case "Game_Chara_Balloon_Timer": { + if (int.Parse(strParam) > 0) + OpenTaiko.Skin.Characters_Balloon_Timer[i] = int.Parse(strParam); + break; + } + case "Game_Chara_Balloon_Delay": { + if (int.Parse(strParam) > 0) + OpenTaiko.Skin.Characters_Balloon_Delay[i] = int.Parse(strParam); + break; + } + case "Game_Chara_Balloon_FadeOut": { + if (int.Parse(strParam) > 0) + OpenTaiko.Skin.Characters_Balloon_FadeOut[i] = int.Parse(strParam); + break; + } + // パターン数の設定はTextureLoader.csで反映されます。 + case "Game_Chara_Motion_Normal": { + OpenTaiko.Skin.Characters_Motion_Normal[i] = CConversion.StringToIntArray(strParam); + break; + } + case "Game_Chara_Motion_10Combo": { + OpenTaiko.Skin.Characters_Motion_10Combo[i] = CConversion.StringToIntArray(strParam); + break; + } + case "Game_Chara_Motion_10Combo_Clear": { + OpenTaiko.Skin.Characters_Motion_10Combo_Clear[i] = CConversion.StringToIntArray(strParam); + break; + } + case "Game_Chara_Motion_10Combo_Max": { + OpenTaiko.Skin.Characters_Motion_10ComboMax[i] = CConversion.StringToIntArray(strParam); + break; + } + case "Game_Chara_Motion_Miss": { + OpenTaiko.Skin.Characters_Motion_Miss[i] = CConversion.StringToIntArray(strParam); + break; + } + case "Game_Chara_Motion_MissDown": { + OpenTaiko.Skin.Characters_Motion_MissDown[i] = CConversion.StringToIntArray(strParam); + break; + } + case "Game_Chara_Motion_ClearIn": { + OpenTaiko.Skin.Characters_Motion_ClearIn[i] = CConversion.StringToIntArray(strParam); + break; + } + case "Game_Chara_Motion_Clear": { + OpenTaiko.Skin.Characters_Motion_Clear[i] = CConversion.StringToIntArray(strParam); + OpenTaiko.Skin.Characters_Motion_ClearMax[i] = OpenTaiko.Skin.Characters_Motion_Clear[i]; + break; + } + case "Game_Chara_Motion_ClearMax": { + OpenTaiko.Skin.Characters_Motion_ClearMax[i] = CConversion.StringToIntArray(strParam); + break; + } + case "Game_Chara_Motion_MissIn": { + OpenTaiko.Skin.Characters_Motion_MissIn[i] = CConversion.StringToIntArray(strParam); + break; + } + case "Game_Chara_Motion_MissDownIn": { + OpenTaiko.Skin.Characters_Motion_MissDownIn[i] = CConversion.StringToIntArray(strParam); + break; + } + case "Game_Chara_Motion_GoGoStart": { + OpenTaiko.Skin.Characters_Motion_GoGoStart[i] = CConversion.StringToIntArray(strParam); + OpenTaiko.Skin.Characters_Motion_GoGoStartMax[i] = OpenTaiko.Skin.Characters_Motion_GoGoStart[i]; + break; + } + case "Game_Chara_Motion_GoGoStart_Clear": { + OpenTaiko.Skin.Characters_Motion_GoGoStart_Clear[i] = CConversion.StringToIntArray(strParam); + break; + } + case "Game_Chara_Motion_GoGoStart_Max": { + OpenTaiko.Skin.Characters_Motion_GoGoStartMax[i] = CConversion.StringToIntArray(strParam); + break; + } + case "Game_Chara_Motion_GoGo": { + OpenTaiko.Skin.Characters_Motion_GoGo[i] = CConversion.StringToIntArray(strParam); + OpenTaiko.Skin.Characters_Motion_GoGoMax[i] = OpenTaiko.Skin.Characters_Motion_GoGo[i]; + break; + } + case "Game_Chara_Motion_GoGo_Max": { + OpenTaiko.Skin.Characters_Motion_GoGoMax[i] = CConversion.StringToIntArray(strParam); + break; + } + case "Game_Chara_Motion_SoulIn": { + OpenTaiko.Skin.Characters_Motion_SoulIn[i] = CConversion.StringToIntArray(strParam); + break; + } + case "Game_Chara_Motion_SoulOut": { + OpenTaiko.Skin.Characters_Motion_SoulOut[i] = CConversion.StringToIntArray(strParam); + break; + } + case "Game_Chara_Motion_ClearOut": { + OpenTaiko.Skin.Characters_Motion_ClearOut[i] = CConversion.StringToIntArray(strParam); + break; + } + case "Game_Chara_Motion_Return": { + OpenTaiko.Skin.Characters_Motion_Return[i] = CConversion.StringToIntArray(strParam); + break; + } + /*case "Game_Chara_Motion_Tower_Standing": + { + TJAPlayer3.Skin.Characters_Motion_Tower_Standing[i] = CConversion.StringToIntArray(strParam); + break; + } + case "Game_Chara_Motion_Tower_Climbing": + { + TJAPlayer3.Skin.Characters_Motion_Tower_Climbing[i] = CConversion.StringToIntArray(strParam); + break; + } + case "Game_Chara_Motion_Tower_Running": + { + TJAPlayer3.Skin.Characters_Motion_Tower_Running[i] = CConversion.StringToIntArray(strParam); + break; + } + case "Game_Chara_Motion_Tower_Clear": + { + TJAPlayer3.Skin.Characters_Motion_Tower_Clear[i] = CConversion.StringToIntArray(strParam); + break; + } + case "Game_Chara_Motion_Tower_Fail": + { + TJAPlayer3.Skin.Characters_Motion_Tower_Fail[i] = CConversion.StringToIntArray(strParam); + break; + } + case "Game_Chara_Motion_Tower_Standing_Tired": + { + TJAPlayer3.Skin.Characters_Motion_Tower_Standing_Tired[i] = CConversion.StringToIntArray(strParam); + break; + } + case "Game_Chara_Motion_Tower_Climbing_Tired": + { + TJAPlayer3.Skin.Characters_Motion_Tower_Climbing_Tired[i] = CConversion.StringToIntArray(strParam); + break; + } + case "Game_Chara_Motion_Tower_Running_Tired": + { + TJAPlayer3.Skin.Characters_Motion_Tower_Running_Tired[i] = CConversion.StringToIntArray(strParam); + break; + } + case "Game_Chara_Motion_Tower_Clear_Tired": + { + TJAPlayer3.Skin.Characters_Motion_Tower_Clear_Tired[i] = CConversion.StringToIntArray(strParam); + break; + }*/ + case "Game_Chara_Beat_Normal": { + OpenTaiko.Skin.Characters_Beat_Normal[i] = float.Parse(strParam); + break; + } + case "Game_Chara_Beat_10Combo": { + OpenTaiko.Skin.Characters_Beat_10Combo[i] = float.Parse(strParam); + break; + } + case "Game_Chara_Beat_10ComboMax": { + OpenTaiko.Skin.Characters_Beat_10ComboMax[i] = float.Parse(strParam); + break; + } + case "Game_Chara_Beat_Miss": { + OpenTaiko.Skin.Characters_Beat_Miss[i] = float.Parse(strParam); + break; + } + case "Game_Chara_Beat_MissDown": { + OpenTaiko.Skin.Characters_Beat_MissDown[i] = float.Parse(strParam); + break; + } + case "Game_Chara_Beat_ClearIn": { + OpenTaiko.Skin.Characters_Beat_ClearIn[i] = float.Parse(strParam); + break; + } + case "Game_Chara_Beat_Clear": { + OpenTaiko.Skin.Characters_Beat_Clear[i] = float.Parse(strParam); + OpenTaiko.Skin.Characters_Beat_ClearMax[i] = float.Parse(strParam); + break; + } + case "Game_Chara_Beat_ClearMax": { + OpenTaiko.Skin.Characters_Beat_ClearMax[i] = float.Parse(strParam); + break; + } + case "Game_Chara_Beat_MissIn": { + OpenTaiko.Skin.Characters_Beat_MissIn[i] = float.Parse(strParam); + break; + } + case "Game_Chara_Beat_MissDownIn": { + OpenTaiko.Skin.Characters_Beat_MissDownIn[i] = float.Parse(strParam); + break; + } + case "Game_Chara_Beat_GoGoStart": { + OpenTaiko.Skin.Characters_Beat_GoGoStart[i] = float.Parse(strParam); + break; + } + case "Game_Chara_Beat_GoGoStartClear": { + OpenTaiko.Skin.Characters_Beat_GoGoStart_Clear[i] = float.Parse(strParam); + break; + } + case "Game_Chara_Beat_GoGoStartMax": { + OpenTaiko.Skin.Characters_Beat_GoGoStartMax[i] = float.Parse(strParam); + break; + } + case "Game_Chara_Beat_GoGo": { + OpenTaiko.Skin.Characters_Beat_GoGo[i] = float.Parse(strParam); + OpenTaiko.Skin.Characters_Beat_GoGoMax[i] = float.Parse(strParam); + break; + } + case "Game_Chara_Beat_GoGoMax": { + OpenTaiko.Skin.Characters_Beat_GoGoMax[i] = float.Parse(strParam); + break; + } + case "Game_Chara_Beat_SoulIn": { + OpenTaiko.Skin.Characters_Beat_SoulIn[i] = float.Parse(strParam); + break; + } + case "Game_Chara_Beat_Return": { + OpenTaiko.Skin.Characters_Beat_Return[i] = float.Parse(strParam); + break; + } + case "Game_Chara_Beat_Tower_Standing": { + OpenTaiko.Skin.Characters_Beat_Tower_Standing[i] = float.Parse(strParam); + break; + } + case "Game_Chara_Beat_Tower_Standing_Tired": { + OpenTaiko.Skin.Characters_Beat_Tower_Standing_Tired[i] = float.Parse(strParam); + break; + } + case "Game_Chara_Beat_Tower_Fail": { + OpenTaiko.Skin.Characters_Beat_Tower_Fail[i] = float.Parse(strParam); + break; + } + case "Game_Chara_Beat_Tower_Clear": { + OpenTaiko.Skin.Characters_Beat_Tower_Clear[i] = float.Parse(strParam); + break; + } + case "Game_Chara_Beat_Tower_Clear_Tired": { + OpenTaiko.Skin.Characters_Beat_Tower_Clear_Tired[i] = float.Parse(strParam); + break; + } + case "Game_Chara_Tower_Clear_IsLooping": { + OpenTaiko.Skin.Characters_Tower_Clear_IsLooping[i] = int.Parse(strParam) != 0; + break; + } + case "Game_Chara_Tower_Clear_Tired_IsLooping": { + OpenTaiko.Skin.Characters_Tower_Clear_Tired_IsLooping[i] = int.Parse(strParam) != 0; + break; + } + case "Game_Chara_Tower_Fail_IsLooping": { + OpenTaiko.Skin.Characters_Tower_Fail_IsLooping[i] = int.Parse(strParam) != 0; + break; + } + case "Chara_Entry_AnimationDuration": { + OpenTaiko.Skin.Characters_Title_Entry_AnimationDuration[i] = int.Parse(strParam); + break; + } + case "Chara_Normal_AnimationDuration": { + OpenTaiko.Skin.Characters_Title_Normal_AnimationDuration[i] = int.Parse(strParam); + break; + } + case "Chara_Menu_Loop_AnimationDuration": { + OpenTaiko.Skin.Characters_Menu_Loop_AnimationDuration[i] = int.Parse(strParam); + break; + } + case "Chara_Menu_Select_AnimationDuration": { + OpenTaiko.Skin.Characters_Menu_Select_AnimationDuration[i] = int.Parse(strParam); + break; + } + case "Chara_Menu_Start_AnimationDuration": { + OpenTaiko.Skin.Characters_Menu_Start_AnimationDuration[i] = int.Parse(strParam); + break; + } + case "Chara_Menu_Wait_AnimationDuration": { + OpenTaiko.Skin.Characters_Menu_Wait_AnimationDuration[i] = int.Parse(strParam); + break; + } + case "Chara_Result_Normal_AnimationDuration": { + OpenTaiko.Skin.Characters_Result_Normal_AnimationDuration[i] = int.Parse(strParam); + break; + } + case "Chara_Result_Clear_AnimationDuration": { + OpenTaiko.Skin.Characters_Result_Clear_AnimationDuration[i] = int.Parse(strParam); + break; + } + case "Chara_Result_Failed_In_AnimationDuration": { + OpenTaiko.Skin.Characters_Result_Failed_In_AnimationDuration[i] = int.Parse(strParam); + break; + } + case "Chara_Result_Failed_AnimationDuration": { + OpenTaiko.Skin.Characters_Result_Failed_AnimationDuration[i] = int.Parse(strParam); + break; + } + /* + case "Chara_Result_SpeechText": + { + string[] strSplit = strParam.Split(','); + for (int j = 0; j < 6; j++) + { + TJAPlayer3.Skin.Characters_Result_SpeechText[i][j] = strSplit[j]; + } + break; + } + */ + default: { break; } + } + } + continue; + } catch (Exception exception) { + Trace.TraceError(exception.ToString()); + Trace.TraceError("例外が発生しましたが処理を継続します。 (6a32cc37-1527-412e-968a-512c1f0135cd)"); + continue; + } + } + } + + #endregion + + #endregion + } + + #region [Voice samples] + + var _skin = OpenTaiko.Skin; + + #region [Dispose previously allocated sound effects] + + _skin.voiceClearFailed[player]?.Dispose(); + _skin.voiceClearClear[player]?.Dispose(); + _skin.voiceClearFullCombo[player]?.Dispose(); + _skin.voiceClearAllPerfect[player]?.Dispose(); + _skin.voiceAIWin[player]?.Dispose(); + _skin.voiceAILose[player]?.Dispose(); + _skin.voiceMenuSongSelect[player]?.Dispose(); + _skin.voiceMenuSongDecide[player]?.Dispose(); + _skin.voiceMenuSongDecide_AI[player]?.Dispose(); + _skin.voiceMenuDiffSelect[player]?.Dispose(); + _skin.voiceMenuDanSelectStart[player]?.Dispose(); + _skin.voiceMenuDanSelectPrompt[player]?.Dispose(); + _skin.voiceMenuDanSelectConfirm[player]?.Dispose(); + _skin.voiceTitleSanka[player]?.Dispose(); + _skin.voiceTowerMiss[player]?.Dispose(); + _skin.voiceResultBestScore[player]?.Dispose(); + _skin.voiceResultClearFailed[player]?.Dispose(); + _skin.voiceResultClearSuccess[player]?.Dispose(); + _skin.voiceResultDanFailed[player]?.Dispose(); + _skin.voiceResultDanRedPass[player]?.Dispose(); + _skin.voiceResultDanGoldPass[player]?.Dispose(); + + #endregion + + #region [Allocate and load the new samples] + + _skin.voiceClearFailed[player] = VoiceSelectOggOrWav(charaPath + @$"{Path.DirectorySeparatorChar}Sounds{Path.DirectorySeparatorChar}Clear{Path.DirectorySeparatorChar}Failed"); + _skin.voiceClearClear[player] = VoiceSelectOggOrWav(charaPath + @$"{Path.DirectorySeparatorChar}Sounds{Path.DirectorySeparatorChar}Clear{Path.DirectorySeparatorChar}Clear"); + _skin.voiceClearFullCombo[player] = VoiceSelectOggOrWav(charaPath + @$"{Path.DirectorySeparatorChar}Sounds{Path.DirectorySeparatorChar}Clear{Path.DirectorySeparatorChar}FullCombo"); + _skin.voiceClearAllPerfect[player] = VoiceSelectOggOrWav(charaPath + @$"{Path.DirectorySeparatorChar}Sounds{Path.DirectorySeparatorChar}Clear{Path.DirectorySeparatorChar}AllPerfect"); + _skin.voiceAIWin[player] = VoiceSelectOggOrWav(charaPath + @$"{Path.DirectorySeparatorChar}Sounds{Path.DirectorySeparatorChar}Clear{Path.DirectorySeparatorChar}AIBattle_Win"); + _skin.voiceAILose[player] = VoiceSelectOggOrWav(charaPath + @$"{Path.DirectorySeparatorChar}Sounds{Path.DirectorySeparatorChar}Clear{Path.DirectorySeparatorChar}AIBattle_Lose"); + _skin.voiceMenuSongSelect[player] = VoiceSelectOggOrWav(charaPath + @$"{Path.DirectorySeparatorChar}Sounds{Path.DirectorySeparatorChar}Menu{Path.DirectorySeparatorChar}SongSelect"); + _skin.voiceMenuSongDecide[player] = VoiceSelectOggOrWav(charaPath + @$"{Path.DirectorySeparatorChar}Sounds{Path.DirectorySeparatorChar}Menu{Path.DirectorySeparatorChar}SongDecide"); + _skin.voiceMenuSongDecide_AI[player] = VoiceSelectOggOrWav(charaPath + @$"{Path.DirectorySeparatorChar}Sounds{Path.DirectorySeparatorChar}Menu{Path.DirectorySeparatorChar}SongDecide_AI"); + _skin.voiceMenuDiffSelect[player] = VoiceSelectOggOrWav(charaPath + @$"{Path.DirectorySeparatorChar}Sounds{Path.DirectorySeparatorChar}Menu{Path.DirectorySeparatorChar}DiffSelect"); + _skin.voiceMenuDanSelectStart[player] = VoiceSelectOggOrWav(charaPath + @$"{Path.DirectorySeparatorChar}Sounds{Path.DirectorySeparatorChar}Menu{Path.DirectorySeparatorChar}DanSelectStart"); + _skin.voiceMenuDanSelectPrompt[player] = VoiceSelectOggOrWav(charaPath + @$"{Path.DirectorySeparatorChar}Sounds{Path.DirectorySeparatorChar}Menu{Path.DirectorySeparatorChar}DanSelectPrompt"); + _skin.voiceMenuDanSelectConfirm[player] = VoiceSelectOggOrWav(charaPath + @$"{Path.DirectorySeparatorChar}Sounds{Path.DirectorySeparatorChar}Menu{Path.DirectorySeparatorChar}DanSelectConfirm"); + _skin.voiceTitleSanka[player] = VoiceSelectOggOrWav(charaPath + @$"{Path.DirectorySeparatorChar}Sounds{Path.DirectorySeparatorChar}Title{Path.DirectorySeparatorChar}Sanka"); + _skin.voiceTowerMiss[player] = VoiceSelectOggOrWav(charaPath + @$"{Path.DirectorySeparatorChar}Sounds{Path.DirectorySeparatorChar}Tower{Path.DirectorySeparatorChar}Miss"); + _skin.voiceResultBestScore[player] = VoiceSelectOggOrWav(charaPath + @$"{Path.DirectorySeparatorChar}Sounds{Path.DirectorySeparatorChar}Result{Path.DirectorySeparatorChar}BestScore"); + _skin.voiceResultClearFailed[player] = VoiceSelectOggOrWav(charaPath + @$"{Path.DirectorySeparatorChar}Sounds{Path.DirectorySeparatorChar}Result{Path.DirectorySeparatorChar}ClearFailed"); + _skin.voiceResultClearSuccess[player] = VoiceSelectOggOrWav(charaPath + @$"{Path.DirectorySeparatorChar}Sounds{Path.DirectorySeparatorChar}Result{Path.DirectorySeparatorChar}ClearSuccess"); + _skin.voiceResultDanFailed[player] = VoiceSelectOggOrWav(charaPath + @$"{Path.DirectorySeparatorChar}Sounds{Path.DirectorySeparatorChar}Result{Path.DirectorySeparatorChar}DanFailed"); + _skin.voiceResultDanRedPass[player] = VoiceSelectOggOrWav(charaPath + @$"{Path.DirectorySeparatorChar}Sounds{Path.DirectorySeparatorChar}Result{Path.DirectorySeparatorChar}DanRedPass"); + _skin.voiceResultDanGoldPass[player] = VoiceSelectOggOrWav(charaPath + @$"{Path.DirectorySeparatorChar}Sounds{Path.DirectorySeparatorChar}Result{Path.DirectorySeparatorChar}DanGoldPass"); + + #endregion + + #endregion + } + + public void DisposeTexture() { + foreach (var tex in listTexture) { + var texture = tex; + OpenTaiko.tテクスチャの解放(ref texture); + texture?.Dispose(); + texture = null; + } + listTexture.Clear(); + + //if (TJAPlayer3.ConfigIni.PreAssetsLoading) + { + foreach (var act in OpenTaiko.app.listトップレベルActivities) { + act.ReleaseManagedResource(); + act.ReleaseUnmanagedResource(); + } + } + } + #region Calibration + + public CTexture CalibrateFG, + CalibrateBG; + + #endregion + + #region 共通 + public CTexture Tile_Black, + Menu_Title, + Menu_Highlight, + Enum_Song, + Loading, + Scanning_Loudness, + NamePlateBase, + NamePlate_Extension, + Overlay, + Readme, + Network_Connection; + + #endregion + + #region 1_タイトル画面 + + public CTexture + //Title_Background, + Entry_Bar, + Entry_Bar_Text; + + public CTexture[] Banapas_Load = new CTexture[3]; + public CTexture[] Banapas_Load_Clear = new CTexture[2]; + public CTexture[] Banapas_Load_Failure = new CTexture[2]; + public CTexture[] Entry_Player = new CTexture[3]; + public CTexture[] ModeSelect_Bar; + public CTexture[] ModeSelect_Bar_Chara; + + #endregion + + #region 2_コンフィグ画面 + public CTexture + /*Config_Background, + Config_Header,*/ + Config_Cursor, + Config_ItemBox, + Config_Arrow, + Config_KeyAssign, + Config_Font, + Config_Font_Bold, + Config_Enum_Song; + #endregion + + #region 3_選曲画面 + + public CTexture SongSelect_Background, + SongSelect_Header, + SongSelect_Footer, + SongSelect_Auto, + SongSelect_Level, + SongSelect_Branch, + SongSelect_Branch_Text, + SongSelect_Lock, + SongSelect_Frame_Box, + SongSelect_Frame_BackBox, + SongSelect_Frame_Random, + SongSelect_Bar_Center, + SongSelect_Bar_Genre_Back, + SongSelect_Bar_Genre_Locked, + SongSelect_Bar_Genre_Locked_Top, + SongSelect_Bar_Genre_Random, + SongSelect_Bar_Genre_RecentryPlaySong, + SongSelect_Level_Number, + SongSelect_Level_Number_Colored, + SongSelect_Level_Number_Icon, + SongSelect_Level_Number_Big, + SongSelect_Level_Number_Big_Colored, + SongSelect_Level_Number_Big_Icon, + SongSelect_Bpm_Number, + SongSelect_Floor_Number, + SongSelect_Bar_Select, + SongSelect_Bar_Genre_Overlay, + SongSelect_Credit, + SongSelect_Timer, + SongSelect_Explicit, + SongSelect_Movie, + SongSelect_Crown, + SongSelect_ScoreRank, + SongSelect_Song_Number, + SongSelect_BoardNumber, + SongSelect_Difficulty_Cymbol, + SongSelect_Unlock_Conditions, + SongSelect_Tower_Side, + + SongSelect_Favorite, + SongSelect_High_Score, + + SongSelect_Level_Icons, + SongSelect_Search_Arrow, + SongSelect_Search_Arrow_Glow, + SongSelect_Search_Window, + + SongSelect_ScoreWindow_Text; + public Dictionary SongSelect_GenreBack, + SongSelect_Bar_Genre, + SongSelect_Bar_Genre_Overlap, + SongSelect_Box_Chara; + public CTexture[] + SongSelect_ScoreWindow = new CTexture[(int)Difficulty.Total], + SongSelect_Frame_Score = new CTexture[3], + SongSelect_NamePlate = new CTexture[1], + SongSelect_Song_Panel = new CTexture[6], + SongSelect_Coin_Slot = new CTexture[4], + SongSelect_Table = new CTexture[6]; + + #region [ 難易度選択画面 ] + public CTexture Difficulty_Bar; + public CTexture Difficulty_Number; + public CTexture Difficulty_Number_Colored; + public CTexture Difficulty_Number_Icon; + public CTexture Difficulty_Star; + public CTexture Difficulty_Crown; + public CTexture Difficulty_Option; + public CTexture Difficulty_Option_Select; + + public CTexture[] Difficulty_Select_Bar = new CTexture[5]; + public Dictionary Difficulty_Back; + #endregion + + public CTexture NewHeya_Close; + public CTexture NewHeya_Close_Select; + public CTexture[] NewHeya_PlayerPlate = new CTexture[5]; + public CTexture NewHeya_PlayerPlate_Select; + public CTexture NewHeya_ModeBar; + public CTexture NewHeya_ModeBar_Select; + public CTexture NewHeya_Box; + public CTexture NewHeya_Lock; + + #endregion + + #region 3_段位選択画面 + + //public CTexture Dani_Background; + public CTexture Dani_Difficulty_Cymbol; + public CTexture Dani_Level_Number; + public CTexture Dani_Soul_Number; + public CTexture Dani_Exam_Number; + public CTexture Dani_Bar_Center; + public CTexture Dani_Bar_Back; + public CTexture Dani_Bar_Folder; + public CTexture Dani_Bar_Folder_Back; + public CTexture Dani_Bar_Random; + public CTexture Dani_Plate; + public CTexture Dani_Plate_Extra; + + public CTexture[] Challenge_Select = new CTexture[3]; + + //public CTexture Dani_Dan_In; + //public CTexture Dani_Dan_Text; + + public CTexture Dani_DanPlates; + public CTexture Dani_DanPlates_Back; + public CTexture Dani_DanIcon; + public CTexture Dani_DanIcon_Fade; + public CTexture Dani_DanSides; + public CTexture[] Dani_Bloc = new CTexture[4]; + + #endregion + + #region 4_読み込み画面 + public CTexture SongLoading_Plate, + SongLoading_Bg, + SongLoading_BgWait, + SongLoading_Chara, + SongLoading_Bg_Dan, + SongLoading_Fade, + + SongLoading_Plate_AI, + SongLoading_Bg_AI, + SongLoading_Bg_AI_Wait, + SongLoading_Fade_AI, + SongLoading_Fade_AI_Anime_Base, + SongLoading_Fade_AI_Anime_Ring, + SongLoading_Fade_AI_Anime_NowLoading, + SongLoading_Fade_AI_Anime_Start, + SongLoading_Fade_AI_Anime_LoadBar_Base, + SongLoading_Fade_AI_Anime_LoadBar; + #endregion + + #region 5_演奏画面 + #region 共通 + public CTexture Judge_Frame, + Note_Mine, + Note_Swap, + Note_Kusu, + Note_FuseRoll, + Note_Adlib, + SENotesExtension, + Notes_Arm, + ChipEffect, + ScoreRank, + Judge; + public CTexture Judge_Meter, + Bar, + Bar_Branch; + public CTexture[] Notes, + SENotes; + #endregion + + + #region モブ + #endregion + #region 太鼓 + public CTexture[] Taiko_Base, + Taiko_Frame, // MTaiko下敷き + Taiko_Background; + public CTexture Taiko_Don_Left, + Taiko_Don_Right, + Taiko_Ka_Left, + Taiko_Ka_Right, + Taiko_Konga_Don, + Taiko_Konga_Ka, + Taiko_Konga_Clap, + Taiko_LevelUp, + Taiko_LevelDown, + Taiko_Combo_Effect, + Taiko_Combo_Text; + public CTexture[] Couse_Symbol, // コースシンボル + Couse_Symbol_Back, + Couse_Symbol_Back_Flash, + Taiko_PlayerNumber, + Taiko_NamePlate; // ネームプレート + public CTexture[] Taiko_Score, + Taiko_Combo, + Taiko_Combo_Guide; + #endregion + #region ゲージ + public CTexture[] Gauge, + Gauge_Base, + Gauge_Base_Norma, + Gauge_Line, + Gauge_Rainbow, + Gauge_Rainbow_2PGauge, + Gauge_Rainbow_Flat, + Gauge_Clear, + Gauge_Killzone, + Gauge_Soul_Explosion; + public CTexture Gauge_Soul, + Gauge_Soul_Fire; + public CTexture[] Gauge_Dan; + public CTexture[] Gauge_Dan_Rainbow; + #endregion + #region 吹き出し + public CTexture[] Balloon_Combo; + public CTexture Balloon_Roll, + Balloon_Balloon, + Balloon_Number_Roll, + Balloon_Number_Combo/*,*/ + /*Balloon_Broken*/; + public CTexture Kusudama_Number; + + public CTexture Fuse_Number, + Fuse_Balloon; + + public CTexture[] Balloon_Breaking; + #endregion + #region エフェクト + public CTexture Effects_Hit_Explosion, + Effects_Hit_Bomb, + Effects_Hit_Explosion_Big, + Effects_Fire, + Effects_Rainbow, + Effects_GoGoSplash, + Effects_Hit_FireWorks; + public CTexture[] Effects_Hit_Great, + Effects_Hit_Good, + Effects_Hit_Great_Big, + Effects_Hit_Good_Big; + public CTexture[] Effects_Roll; + #endregion + #region レーン + public CTexture[] Lane_Red, + Lane_Blue, + Lane_Clap, + Lane_Base, + Lane_Text; + public CTexture Lane_Yellow; + public CTexture Lane_Background_Main, + Lane_Background_AI, + Lane_Background_Sub, + Lane_Background_GoGo; + #endregion + #region ゲームモード + public CTexture GameMode_Timer_Frame, + GameMode_Timer_Tick; + #endregion + #region ステージ失敗 + public CTexture Failed_Game, + Failed_Stage; + #endregion + #region ランナー + //public CTexture Runner; + #endregion + #region DanC + public CTexture DanC_Background; + public CTexture[] DanC_Gauge; + public CTexture DanC_Base; + public CTexture DanC_Base_Small; + + + public CTexture DanC_Gauge_Base; + public CTexture DanC_Failed; + public CTexture DanC_Number, + DanC_Small_Number, + DanC_SmallBase, + DanC_ExamType, + DanC_ExamRange, + DanC_Small_ExamCymbol, + DanC_ExamCymbol, + DanC_MiniNumber, + DanC_ExamUnit; + public CTexture DanC_Screen; + #endregion + #region PuchiChara + + public CPuchichara[] Puchichara; + + #endregion + #region Training + public CTexture Tokkun_DownBG, + Tokkun_BigTaiko, + Tokkun_ProgressBar, + Tokkun_ProgressBarWhite, + Tokkun_GoGoPoint, + Tokkun_JumpPoint, + Tokkun_Background_Up, + Tokkun_BigNumber, + Tokkun_SmallNumber, + Tokkun_Speed_Measure; + #endregion + + #region [20_Tower] + + public CTexture Tower_Miss; + + public CTexture[] Tower_Top; + + public CTexture[][] Tower_Base, + Tower_Deco; + + + #endregion + + #region [21_ModIcons] + + public CTexture[] Mod_Timing, + Mod_SongSpeed, + Mod_Fun, + HiSp; + public CTexture Mod_None, + Mod_Doron, + Mod_Stealth, + Mod_Mirror, + Mod_Random, + Mod_Super, + Mod_Hyper, + Mod_Just, + Mod_Safe, + Mod_Auto; + + #endregion + + #region [22_AIBattle] + + public CTexture AIBattle_SectionTime_Panel, + AIBattle_SectionTime_Bar_Base, + AIBattle_SectionTime_Bar_Normal, + AIBattle_SectionTime_Bar_Finish, + AIBattle_Batch_Base, + AIBattle_Batch, + AIBattle_Judge_Number; + + public CTexture[] AIBattle_Judge_Meter = new CTexture[2]; + + #endregion + + + #endregion + + #region 6_結果発表 + public CTexture Result_Header, + Result_Number, + Result_Panel, + Result_Panel_2P, + Result_Soul_Text, + Result_Soul_Fire, + Result_Diff_Bar, + Result_Score_Number, + + Result_CrownEffect, + Result_ScoreRankEffect, + + //Result_Cloud, + Result_Flower, + Result_Shine, + Result_Gauge_Frame, + Result_Gauge_Clear, + Result_Gauge_Clear_Base, + Result_Gauge_Killzone, + + Result_Dan; + + public CTexture[] + Result_Panel_5P = new CTexture[5], + Result_Panel_4P = new CTexture[4], + Result_Rainbow = new CTexture[41], + //Result_Background = new CTexture[6], + Result_Crown = new CTexture[3], + + Result_Flower_Rotate = new CTexture[5], + //Result_Work = new CTexture[3], + + Result_Gauge = new CTexture[5], + Result_Gauge_Base = new CTexture[5], + Result_Speech_Bubble = new CTexture[2], + Result_Speech_Bubble_V2 = new CTexture[3] +/*, +Result_Mountain = new CTexture[4]*/; + #endregion + + #region 7_AIResults + public CTexture Result_AIBattle_Panel_AI, + Result_AIBattle_Batch, + Result_AIBattle_SectionPlate, + Result_AIBattle_WinFlag_Clear, + Result_AIBattle_WinFlag_Lose; + #endregion + + #region 7_終了画面 + //public CTexture Exit_Background/* , */ + /*Exit_Text; */ + #endregion + + #region [7_DanResults] + + public CTexture + //DanResult_Background, + DanResult_Rank, + DanResult_SongPanel_Base, + DanResult_StatePanel_Base, + DanResult_SongPanel_Main, + DanResult_StatePanel_Main; + + #endregion + + #region [8_TowerResults] + + public CTexture TowerResult_Background, + TowerResult_ScoreRankEffect, + TowerResult_Panel; + public CTexture[] + TowerResult_Tower; + + #endregion + + #region [10_Heya] + + public CTexture + //Heya_Background, + Heya_Center_Menu_Bar, + Heya_Center_Menu_Box, + Heya_Center_Menu_Box_Slot, + Heya_Side_Menu, + Heya_Box, + Heya_Render_Field, + Heya_Center_Menu_Background, + Heya_Description_Panel, + Heya_Lock; + + #endregion + + #region [11_Characters] + + public CTexture[][] Characters_Normal, + Characters_Normal_Missed, + Characters_Normal_MissedDown, + Characters_Normal_Cleared, + Characters_Normal_Maxed, + Characters_MissIn, + Characters_MissDownIn, + Characters_GoGoTime, + Characters_GoGoTime_Maxed, + Characters_10Combo, + Characters_10Combo_Clear, + Characters_10Combo_Maxed, + Characters_GoGoStart, + Characters_GoGoStart_Clear, + Characters_GoGoStart_Maxed, + Characters_Become_Cleared, + Characters_Become_Maxed, + Characters_SoulOut, + Characters_ClearOut, + Characters_Return, + Characters_Balloon_Breaking, + Characters_Balloon_Broke, + Characters_Balloon_Miss, + Characters_Kusudama_Idle, + Characters_Kusudama_Breaking, + Characters_Kusudama_Broke, + Characters_Kusudama_Miss, + Characters_Title_Entry, + Characters_Title_Normal, + Characters_Menu_Loop, + Characters_Menu_Select, + Characters_Menu_Start, + Characters_Menu_Wait, + Characters_Result_Clear, + Characters_Result_Failed, + Characters_Result_Failed_In, + Characters_Result_Normal, + Characters_Tower_Standing, + Characters_Tower_Climbing, + Characters_Tower_Running, + Characters_Tower_Clear, + Characters_Tower_Fail, + Characters_Tower_Standing_Tired, + Characters_Tower_Climbing_Tired, + Characters_Tower_Running_Tired, + Characters_Tower_Clear_Tired; + public CTexture[] Characters_Heya_Preview, + Characters_Heya_Render, + Characters_Result_Clear_1P, + Characters_Result_Failed_1P, + Characters_Result_Clear_2P, + Characters_Result_Failed_2P; + public CCharacter[] Characters; + + #endregion + + #region [12_OnlineLounge] + + public CTexture + //OnlineLounge_Background, + OnlineLounge_Box, + OnlineLounge_Center_Menu_Bar, + OnlineLounge_Center_Menu_Box_Slot, + OnlineLounge_Side_Menu, + OnlineLounge_Context, + OnlineLounge_Return_Box, + OnlineLounge_Song_Box; + + #endregion + + #region [13_TowerSelect] + + public CTexture + TowerSelect_Tower; + + #endregion + + + #region [ 解放用 ] + public List listTexture = new List(); + #endregion + } diff --git a/OpenTaiko/src/Stages/02.Title/CActEnumSongs.cs b/OpenTaiko/src/Stages/02.Title/CActEnumSongs.cs index 44c8f32b..23683c4f 100644 --- a/OpenTaiko/src/Stages/02.Title/CActEnumSongs.cs +++ b/OpenTaiko/src/Stages/02.Title/CActEnumSongs.cs @@ -5,120 +5,120 @@ using FDK; using Silk.NET.Maths; using SkiaSharp; -namespace OpenTaiko { - internal class CActEnumSongs : CActivity { - public bool bコマンドでの曲データ取得; +namespace OpenTaiko; + +internal class CActEnumSongs : CActivity { + public bool bコマンドでの曲データ取得; - /// - /// Constructor - /// - public CActEnumSongs() { - Init(false); + /// + /// Constructor + /// + public CActEnumSongs() { + Init(false); + } + + public CActEnumSongs(bool _bコマンドでの曲データ取得) { + Init(_bコマンドでの曲データ取得); + } + private void Init(bool _bコマンドでの曲データ取得) { + base.IsDeActivated = true; + bコマンドでの曲データ取得 = _bコマンドでの曲データ取得; + } + + // CActivity 実装 + + public override void Activate() { + if (this.IsActivated) + return; + base.Activate(); + + try { + this.ctNowEnumeratingSongs = new CCounter(); // 0, 1000, 17, CDTXMania.Timer ); + this.ctNowEnumeratingSongs.Start(0, 100, 17, OpenTaiko.Timer); + } finally { } + } + public override void DeActivate() { + if (this.IsDeActivated) + return; - public CActEnumSongs(bool _bコマンドでの曲データ取得) { - Init(_bコマンドでの曲データ取得); - } - private void Init(bool _bコマンドでの曲データ取得) { - base.IsDeActivated = true; - bコマンドでの曲データ取得 = _bコマンドでの曲データ取得; - } + base.DeActivate(); + this.ctNowEnumeratingSongs = null; + } + public override void CreateManagedResource() { + //string pathNowEnumeratingSongs = CSkin.Path( @"Graphics\ScreenTitle NowEnumeratingSongs.png" ); + //if ( File.Exists( pathNowEnumeratingSongs ) ) + //{ + // this.txNowEnumeratingSongs = CDTXMania.tテクスチャの生成( pathNowEnumeratingSongs, false ); + //} + //else + //{ + // this.txNowEnumeratingSongs = null; + //} + //string pathDialogNowEnumeratingSongs = CSkin.Path( @"Graphics\ScreenConfig NowEnumeratingSongs.png" ); + //if ( File.Exists( pathDialogNowEnumeratingSongs ) ) + //{ + // this.txDialogNowEnumeratingSongs = CDTXMania.tテクスチャの生成( pathDialogNowEnumeratingSongs, false ); + //} + //else + //{ + // this.txDialogNowEnumeratingSongs = null; + //} - // CActivity 実装 - - public override void Activate() { - if (this.IsActivated) - return; - base.Activate(); - - try { - this.ctNowEnumeratingSongs = new CCounter(); // 0, 1000, 17, CDTXMania.Timer ); - this.ctNowEnumeratingSongs.Start(0, 100, 17, OpenTaiko.Timer); - } finally { - } - } - public override void DeActivate() { - if (this.IsDeActivated) - return; - - base.DeActivate(); - this.ctNowEnumeratingSongs = null; - } - public override void CreateManagedResource() { - //string pathNowEnumeratingSongs = CSkin.Path( @"Graphics\ScreenTitle NowEnumeratingSongs.png" ); - //if ( File.Exists( pathNowEnumeratingSongs ) ) - //{ - // this.txNowEnumeratingSongs = CDTXMania.tテクスチャの生成( pathNowEnumeratingSongs, false ); - //} - //else - //{ - // this.txNowEnumeratingSongs = null; - //} - //string pathDialogNowEnumeratingSongs = CSkin.Path( @"Graphics\ScreenConfig NowEnumeratingSongs.png" ); - //if ( File.Exists( pathDialogNowEnumeratingSongs ) ) - //{ - // this.txDialogNowEnumeratingSongs = CDTXMania.tテクスチャの生成( pathDialogNowEnumeratingSongs, false ); - //} - //else - //{ - // this.txDialogNowEnumeratingSongs = null; - //} - - try { - CCachedFontRenderer ftMessage = new CCachedFontRenderer(CFontRenderer.DefaultFontName, 40, CCachedFontRenderer.FontStyle.Bold); - string[] strMessage = - { - " 曲データの一覧を\n 取得しています。\n しばらくお待ちください。", - " Now enumerating songs.\n Please wait..." - }; - int ci = (CultureInfo.CurrentUICulture.TwoLetterISOLanguageName == "ja") ? 0 : 1; - if ((strMessage != null) && (strMessage.Length > 0)) { - SKBitmap image = ftMessage.DrawText(strMessage[ci], Color.White); - this.txMessage = new CTexture(image); - this.txMessage.vcScaleRatio = new Vector3D(0.5f, 0.5f, 1f); - image.Dispose(); - OpenTaiko.tDisposeSafely(ref ftMessage); - } else { - this.txMessage = null; - } - } catch (CTextureCreateFailedException e) { - Trace.TraceError("テクスチャの生成に失敗しました。(txMessage)"); - Trace.TraceError(e.ToString()); - Trace.TraceError("例外が発生しましたが処理を継続します。 (761b726d-d27c-470d-be0b-a702971601b5)"); + try { + CCachedFontRenderer ftMessage = new CCachedFontRenderer(CFontRenderer.DefaultFontName, 40, CCachedFontRenderer.FontStyle.Bold); + string[] strMessage = + { + " 曲データの一覧を\n 取得しています。\n しばらくお待ちください。", + " Now enumerating songs.\n Please wait..." + }; + int ci = (CultureInfo.CurrentUICulture.TwoLetterISOLanguageName == "ja") ? 0 : 1; + if ((strMessage != null) && (strMessage.Length > 0)) { + SKBitmap image = ftMessage.DrawText(strMessage[ci], Color.White); + this.txMessage = new CTexture(image); + this.txMessage.vcScaleRatio = new Vector3D(0.5f, 0.5f, 1f); + image.Dispose(); + OpenTaiko.tDisposeSafely(ref ftMessage); + } else { this.txMessage = null; } - - base.CreateManagedResource(); - } - public override void ReleaseManagedResource() { - //CDTXMania.t安全にDisposeする( ref this.txDialogNowEnumeratingSongs ); - //CDTXMania.t安全にDisposeする( ref this.txNowEnumeratingSongs ); - OpenTaiko.tDisposeSafely(ref this.txMessage); - base.ReleaseManagedResource(); + } catch (CTextureCreateFailedException e) { + Trace.TraceError("テクスチャの生成に失敗しました。(txMessage)"); + Trace.TraceError(e.ToString()); + Trace.TraceError("例外が発生しましたが処理を継続します。 (761b726d-d27c-470d-be0b-a702971601b5)"); + this.txMessage = null; } - public override int Draw() { - if (this.IsDeActivated) { - return 0; - } - this.ctNowEnumeratingSongs.TickLoop(); - if (OpenTaiko.Tx.Enum_Song != null) { - OpenTaiko.Tx.Enum_Song.Opacity = (int)(176.0 + 80.0 * Math.Sin((double)(2 * Math.PI * this.ctNowEnumeratingSongs.CurrentValue * 2 / 100.0))); - OpenTaiko.Tx.Enum_Song.t2D描画(18, 7); - } - if (bコマンドでの曲データ取得 && OpenTaiko.Tx.Config_Enum_Song != null) { - OpenTaiko.Tx.Config_Enum_Song.t2D描画(180, 177); - this.txMessage.t2D描画(190, 197); - } + base.CreateManagedResource(); + } + public override void ReleaseManagedResource() { + //CDTXMania.t安全にDisposeする( ref this.txDialogNowEnumeratingSongs ); + //CDTXMania.t安全にDisposeする( ref this.txNowEnumeratingSongs ); + OpenTaiko.tDisposeSafely(ref this.txMessage); + base.ReleaseManagedResource(); + } + public override int Draw() { + if (this.IsDeActivated) { return 0; } + this.ctNowEnumeratingSongs.TickLoop(); + if (OpenTaiko.Tx.Enum_Song != null) { + OpenTaiko.Tx.Enum_Song.Opacity = (int)(176.0 + 80.0 * Math.Sin((double)(2 * Math.PI * this.ctNowEnumeratingSongs.CurrentValue * 2 / 100.0))); + OpenTaiko.Tx.Enum_Song.t2D描画(18, 7); + } + if (bコマンドでの曲データ取得 && OpenTaiko.Tx.Config_Enum_Song != null) { + OpenTaiko.Tx.Config_Enum_Song.t2D描画(180, 177); + this.txMessage.t2D描画(190, 197); + } - - private CCounter ctNowEnumeratingSongs; - //private CTexture txNowEnumeratingSongs = null; - //private CTexture txDialogNowEnumeratingSongs = null; - private CTexture txMessage; + return 0; } + + + private CCounter ctNowEnumeratingSongs; + //private CTexture txNowEnumeratingSongs = null; + //private CTexture txDialogNowEnumeratingSongs = null; + private CTexture txMessage; } diff --git a/OpenTaiko/src/Stages/02.Title/CActScanningLoudness.cs b/OpenTaiko/src/Stages/02.Title/CActScanningLoudness.cs index b33ff8f5..a523d50c 100644 --- a/OpenTaiko/src/Stages/02.Title/CActScanningLoudness.cs +++ b/OpenTaiko/src/Stages/02.Title/CActScanningLoudness.cs @@ -1,43 +1,43 @@ using FDK; -namespace OpenTaiko { - internal class CActScanningLoudness : CActivity { - public bool bIsActivelyScanning; +namespace OpenTaiko; - // CActivity 実装 +internal class CActScanningLoudness : CActivity { + public bool bIsActivelyScanning; - public override void Activate() { - if (this.IsActivated) - return; - base.Activate(); + // CActivity 実装 - try { - this.ctNowScanningLoudness = new CCounter(); - this.ctNowScanningLoudness.Start(0, 200, 29, OpenTaiko.Timer); - } finally { - } + public override void Activate() { + if (this.IsActivated) + return; + base.Activate(); + + try { + this.ctNowScanningLoudness = new CCounter(); + this.ctNowScanningLoudness.Start(0, 200, 29, OpenTaiko.Timer); + } finally { } + } - public override void DeActivate() { - if (this.IsDeActivated) - return; - base.DeActivate(); - this.ctNowScanningLoudness = null; - } - - public override int Draw() { - if (this.IsDeActivated) { - return 0; - } - this.ctNowScanningLoudness.TickLoop(); - if (bIsActivelyScanning && OpenTaiko.Tx.Scanning_Loudness != null) { - OpenTaiko.Tx.Scanning_Loudness.Opacity = (int)(176.0 + 80.0 * Math.Sin((double)(2 * Math.PI * this.ctNowScanningLoudness.CurrentValue / 100.0))); - OpenTaiko.Tx.Scanning_Loudness.t2D描画(18 + 89 + 18, 7); // 2018-09-03 twopointzero: display right of Enum_Song, using its width and margin - } + public override void DeActivate() { + if (this.IsDeActivated) + return; + base.DeActivate(); + this.ctNowScanningLoudness = null; + } + public override int Draw() { + if (this.IsDeActivated) { return 0; } + this.ctNowScanningLoudness.TickLoop(); + if (bIsActivelyScanning && OpenTaiko.Tx.Scanning_Loudness != null) { + OpenTaiko.Tx.Scanning_Loudness.Opacity = (int)(176.0 + 80.0 * Math.Sin((double)(2 * Math.PI * this.ctNowScanningLoudness.CurrentValue / 100.0))); + OpenTaiko.Tx.Scanning_Loudness.t2D描画(18 + 89 + 18, 7); // 2018-09-03 twopointzero: display right of Enum_Song, using its width and margin + } - private CCounter ctNowScanningLoudness; + return 0; } + + private CCounter ctNowScanningLoudness; } diff --git a/OpenTaiko/src/Stages/02.Title/CEnumSongs.cs b/OpenTaiko/src/Stages/02.Title/CEnumSongs.cs index 4c298b09..79007f38 100644 --- a/OpenTaiko/src/Stages/02.Title/CEnumSongs.cs +++ b/OpenTaiko/src/Stages/02.Title/CEnumSongs.cs @@ -1,433 +1,433 @@ using System.Diagnostics; using System.Runtime.Serialization.Formatters.Binary; -namespace OpenTaiko { - internal class CEnumSongs // #27060 2011.2.7 yyagi 曲リストを取得するクラス - { // ファイルキャッシュ(songslist.db)からの取得と、ディスクからの取得を、この一つのクラスに集約。 +namespace OpenTaiko; - public CSongs管理 Songs管理 // 曲の探索結果はこのSongs管理に読み込まれる - { - get; - private set; +internal class CEnumSongs // #27060 2011.2.7 yyagi 曲リストを取得するクラス +{ // ファイルキャッシュ(songslist.db)からの取得と、ディスクからの取得を、この一つのクラスに集約。 + + public CSongs管理 Songs管理 // 曲の探索結果はこのSongs管理に読み込まれる + { + get; + private set; + } + + public bool IsSongListEnumCompletelyDone // 曲リスト探索と、実際の曲リストへの反映が完了した? + { + get { + return (this.state == DTXEnumState.CompletelyDone); } - - public bool IsSongListEnumCompletelyDone // 曲リスト探索と、実際の曲リストへの反映が完了した? - { - get { - return (this.state == DTXEnumState.CompletelyDone); + } + public bool IsEnumerating { + get { + if (thDTXFileEnumerate == null) { + return false; } + return thDTXFileEnumerate.IsAlive; } - public bool IsEnumerating { - get { - if (thDTXFileEnumerate == null) { - return false; - } - return thDTXFileEnumerate.IsAlive; + } + public bool IsSongListEnumerated // 曲リスト探索が完了したが、実際の曲リストへの反映はまだ? + { + get { + return (this.state == DTXEnumState.Enumeratad); + } + } + public bool IsSongListEnumStarted // 曲リスト探索開始後?(探索完了も含む) + { + get { + return (this.state != DTXEnumState.None); + } + } + public void SongListEnumCompletelyDone() { + this.state = DTXEnumState.CompletelyDone; + this.Songs管理 = null; // GCはOSに任せる + } + public bool IsSlowdown // #PREMOVIE再生中は検索負荷を落とす + { + get { + return this.Songs管理.bIsSlowdown; + } + set { + this.Songs管理.bIsSlowdown = value; + } + } + + public void ChangeEnumeratePriority(ThreadPriority tp) { + if (this.thDTXFileEnumerate != null && this.thDTXFileEnumerate.IsAlive == true) { + this.thDTXFileEnumerate.Priority = tp; + } + } + private readonly string strPathSongsDB = OpenTaiko.strEXEのあるフォルダ + "songs.db"; + private readonly string strPathSongList = OpenTaiko.strEXEのあるフォルダ + "songlist.db"; + + public Thread thDTXFileEnumerate { + get; + private set; + } + private enum DTXEnumState { + None, + Ongoing, + Suspended, + Enumeratad, // 探索完了、現在の曲リストに未反映 + CompletelyDone // 探索完了、現在の曲リストに反映完了 + } + private DTXEnumState state = DTXEnumState.None; + + + /// + /// Constractor + /// + public CEnumSongs() { + this.Songs管理 = new CSongs管理(); + } + + public void Init() { + + } + + /// + /// 曲リストのキャッシュ(songlist.db)取得スレッドの開始 + /// + public void StartEnumFromCache() { + this.thDTXFileEnumerate = new Thread(new ThreadStart(this.t曲リストの構築1)); + this.thDTXFileEnumerate.Name = "曲リストの構築"; + this.thDTXFileEnumerate.IsBackground = true; + this.thDTXFileEnumerate.Start(); + } + + /// + /// + /// + public delegate void AsyncDelegate(); + + /// + /// 曲検索スレッドの開始 + /// + public void StartEnumFromDisk(bool hard_reload = false) { + if (state == DTXEnumState.None || state == DTXEnumState.CompletelyDone) { + Trace.TraceInformation("★曲データ検索スレッドを起動しました。"); + lock (this) { + state = DTXEnumState.Ongoing; } - } - public bool IsSongListEnumerated // 曲リスト探索が完了したが、実際の曲リストへの反映はまだ? - { - get { - return (this.state == DTXEnumState.Enumeratad); - } - } - public bool IsSongListEnumStarted // 曲リスト探索開始後?(探索完了も含む) - { - get { - return (this.state != DTXEnumState.None); - } - } - public void SongListEnumCompletelyDone() { - this.state = DTXEnumState.CompletelyDone; - this.Songs管理 = null; // GCはOSに任せる - } - public bool IsSlowdown // #PREMOVIE再生中は検索負荷を落とす - { - get { - return this.Songs管理.bIsSlowdown; - } - set { - this.Songs管理.bIsSlowdown = value; - } - } + // this.autoReset = new AutoResetEvent( true ); - public void ChangeEnumeratePriority(ThreadPriority tp) { - if (this.thDTXFileEnumerate != null && this.thDTXFileEnumerate.IsAlive == true) { - this.thDTXFileEnumerate.Priority = tp; - } - } - private readonly string strPathSongsDB = OpenTaiko.strEXEのあるフォルダ + "songs.db"; - private readonly string strPathSongList = OpenTaiko.strEXEのあるフォルダ + "songlist.db"; - - public Thread thDTXFileEnumerate { - get; - private set; - } - private enum DTXEnumState { - None, - Ongoing, - Suspended, - Enumeratad, // 探索完了、現在の曲リストに未反映 - CompletelyDone // 探索完了、現在の曲リストに反映完了 - } - private DTXEnumState state = DTXEnumState.None; - - - /// - /// Constractor - /// - public CEnumSongs() { - this.Songs管理 = new CSongs管理(); - } - - public void Init() { - - } - - /// - /// 曲リストのキャッシュ(songlist.db)取得スレッドの開始 - /// - public void StartEnumFromCache() { - this.thDTXFileEnumerate = new Thread(new ThreadStart(this.t曲リストの構築1)); - this.thDTXFileEnumerate.Name = "曲リストの構築"; - this.thDTXFileEnumerate.IsBackground = true; - this.thDTXFileEnumerate.Start(); - } - - /// - /// - /// - public delegate void AsyncDelegate(); - - /// - /// 曲検索スレッドの開始 - /// - public void StartEnumFromDisk(bool hard_reload = false) { - if (state == DTXEnumState.None || state == DTXEnumState.CompletelyDone) { - Trace.TraceInformation("★曲データ検索スレッドを起動しました。"); - lock (this) { - state = DTXEnumState.Ongoing; - } - // this.autoReset = new AutoResetEvent( true ); - - if (this.Songs管理 == null) // Enumerating Songs完了後、CONFIG画面から再スキャンしたときにこうなる - { - this.Songs管理 = new CSongs管理(); - } - if (hard_reload) - this.thDTXFileEnumerate = new Thread(new ThreadStart(this.HardReloadSongList)); - else - this.thDTXFileEnumerate = new Thread(new ThreadStart(this.ReloadSongList)); - this.thDTXFileEnumerate.Name = "曲リストの構築"; - this.thDTXFileEnumerate.IsBackground = true; - this.thDTXFileEnumerate.Priority = System.Threading.ThreadPriority.Lowest; - this.thDTXFileEnumerate.Start(); - } - } - - private void HardReloadSongList() { - this.t曲リストの構築2(true); - } - private void ReloadSongList() { - this.t曲リストの構築2(false); - } - - /// - /// 曲探索スレッドのサスペンド - /// - public void Suspend() { - if (this.state != DTXEnumState.CompletelyDone && - ((thDTXFileEnumerate.ThreadState & (System.Threading.ThreadState.Background)) != 0)) { - // this.thDTXFileEnumerate.Suspend(); // obsoleteにつき使用中止 - this.Songs管理.bIsSuspending = true; - this.state = DTXEnumState.Suspended; - Trace.TraceInformation("★曲データ検索スレッドを中断しました。"); - } - } - - /// - /// 曲探索スレッドのレジューム - /// - public void Resume() { - if (this.state == DTXEnumState.Suspended) { - if ((this.thDTXFileEnumerate.ThreadState & (System.Threading.ThreadState.WaitSleepJoin | System.Threading.ThreadState.StopRequested)) != 0) // - { - // this.thDTXFileEnumerate.Resume(); // obsoleteにつき使用中止 - this.Songs管理.bIsSuspending = false; - this.Songs管理.AutoReset.Set(); - this.state = DTXEnumState.Ongoing; - Trace.TraceInformation("★曲データ検索スレッドを再開しました。"); - } - } - } - - /// - /// 曲探索スレッドにサスペンド指示を出してから、本当にサスペンド状態に遷移するまでの間、ブロックする - /// 500ms * 10回=5秒でタイムアウトし、サスペンド完了して無くてもブロック解除する - /// - public void WaitUntilSuspended() { - // 曲検索が一時中断されるまで待機 - for (int i = 0; i < 10; i++) { - if (this.state == DTXEnumState.CompletelyDone || - (thDTXFileEnumerate.ThreadState & (System.Threading.ThreadState.WaitSleepJoin | System.Threading.ThreadState.Background | System.Threading.ThreadState.Stopped)) != 0) { - break; - } - Trace.TraceInformation("★曲データ検索スレッドの中断待ちです: {0}", this.thDTXFileEnumerate.ThreadState.ToString()); - Thread.Sleep(500); - } - - } - - /// - /// 曲探索スレッドを強制終了する - /// - public void Abort() { - if (thDTXFileEnumerate != null) { - thDTXFileEnumerate.Abort(); - thDTXFileEnumerate = null; - this.state = DTXEnumState.None; - - this.Songs管理 = null; // Songs管理を再初期化する (途中まで作った曲リストの最後に、一から重複して追記することにならないようにする。) + if (this.Songs管理 == null) // Enumerating Songs完了後、CONFIG画面から再スキャンしたときにこうなる + { this.Songs管理 = new CSongs管理(); } + if (hard_reload) + this.thDTXFileEnumerate = new Thread(new ThreadStart(this.HardReloadSongList)); + else + this.thDTXFileEnumerate = new Thread(new ThreadStart(this.ReloadSongList)); + this.thDTXFileEnumerate.Name = "曲リストの構築"; + this.thDTXFileEnumerate.IsBackground = true; + this.thDTXFileEnumerate.Priority = System.Threading.ThreadPriority.Lowest; + this.thDTXFileEnumerate.Start(); } + } + private void HardReloadSongList() { + this.t曲リストの構築2(true); + } + private void ReloadSongList() { + this.t曲リストの構築2(false); + } + /// + /// 曲探索スレッドのサスペンド + /// + public void Suspend() { + if (this.state != DTXEnumState.CompletelyDone && + ((thDTXFileEnumerate.ThreadState & (System.Threading.ThreadState.Background)) != 0)) { + // this.thDTXFileEnumerate.Suspend(); // obsoleteにつき使用中止 + this.Songs管理.bIsSuspending = true; + this.state = DTXEnumState.Suspended; + Trace.TraceInformation("★曲データ検索スレッドを中断しました。"); + } + } - /// - /// songlist.dbからの曲リスト構築 - /// - public void t曲リストの構築1() { - // !注意! - // 本メソッドは別スレッドで動作するが、プラグイン側でカレントディレクトリを変更しても大丈夫なように、 - // すべてのファイルアクセスは「絶対パス」で行うこと。(2010.9.16) - // 構築が完了したら、DTXEnumerateState state を DTXEnumerateState.Done にすること。(2012.2.9) - DateTime now = DateTime.Now; - - try { - #region [ 0) システムサウンドの構築 ] - //----------------------------- - OpenTaiko.stage起動.ePhaseID = CStage.EPhase.Startup_0_CreateSystemSound; - - Trace.TraceInformation("0) システムサウンドを構築します。"); - Trace.Indent(); - - try { - OpenTaiko.Skin.bgm起動画面.tPlay(); - for (int i = 0; i < OpenTaiko.Skin.nシステムサウンド数; i++) { - if (!OpenTaiko.Skin[i].bExclusive) // BGM系以外のみ読み込む。(BGM系は必要になったときに読み込む) - { - CSkin.CSystemSound cシステムサウンド = OpenTaiko.Skin[i]; - if (cシステムサウンド.bCompact対象) { - try { - cシステムサウンド.tLoading(); - Trace.TraceInformation("システムサウンドを読み込みました。({0})", cシステムサウンド.strFileName); - //if ( ( cシステムサウンド == CDTXMania.Skin.bgm起動画面 ) && cシステムサウンド.b読み込み成功 ) - //{ - // cシステムサウンド.t再生する(); - //} - } catch (FileNotFoundException) { - Trace.TraceWarning("システムサウンドが存在しません。({0})", cシステムサウンド.strFileName); - } catch (Exception e) { - Trace.TraceWarning(e.ToString()); - Trace.TraceWarning("システムサウンドの読み込みに失敗しました。({0})", cシステムサウンド.strFileName); - } - } - } - } - lock (OpenTaiko.stage起動.list進行文字列) { - OpenTaiko.stage起動.list進行文字列.Add("SYSTEM SOUND...OK"); - } - } finally { - Trace.Unindent(); - } - //----------------------------- - #endregion - - } finally { - OpenTaiko.stage起動.ePhaseID = CStage.EPhase.Startup_6_LoadTextures; - TimeSpan span = (TimeSpan)(DateTime.Now - now); - Trace.TraceInformation("起動所要時間: {0}", span.ToString()); - lock (this) // #28700 2012.6.12 yyagi; state change must be in finally{} for exiting as of compact mode. - { - state = DTXEnumState.CompletelyDone; - } + /// + /// 曲探索スレッドのレジューム + /// + public void Resume() { + if (this.state == DTXEnumState.Suspended) { + if ((this.thDTXFileEnumerate.ThreadState & (System.Threading.ThreadState.WaitSleepJoin | System.Threading.ThreadState.StopRequested)) != 0) // + { + // this.thDTXFileEnumerate.Resume(); // obsoleteにつき使用中止 + this.Songs管理.bIsSuspending = false; + this.Songs管理.AutoReset.Set(); + this.state = DTXEnumState.Ongoing; + Trace.TraceInformation("★曲データ検索スレッドを再開しました。"); } } + } + + /// + /// 曲探索スレッドにサスペンド指示を出してから、本当にサスペンド状態に遷移するまでの間、ブロックする + /// 500ms * 10回=5秒でタイムアウトし、サスペンド完了して無くてもブロック解除する + /// + public void WaitUntilSuspended() { + // 曲検索が一時中断されるまで待機 + for (int i = 0; i < 10; i++) { + if (this.state == DTXEnumState.CompletelyDone || + (thDTXFileEnumerate.ThreadState & (System.Threading.ThreadState.WaitSleepJoin | System.Threading.ThreadState.Background | System.Threading.ThreadState.Stopped)) != 0) { + break; + } + Trace.TraceInformation("★曲データ検索スレッドの中断待ちです: {0}", this.thDTXFileEnumerate.ThreadState.ToString()); + Thread.Sleep(500); + } + + } + + /// + /// 曲探索スレッドを強制終了する + /// + public void Abort() { + if (thDTXFileEnumerate != null) { + thDTXFileEnumerate.Abort(); + thDTXFileEnumerate = null; + this.state = DTXEnumState.None; + + this.Songs管理 = null; // Songs管理を再初期化する (途中まで作った曲リストの最後に、一から重複して追記することにならないようにする。) + this.Songs管理 = new CSongs管理(); + } + } - /// - /// 起動してタイトル画面に遷移した後にバックグラウンドで発生させる曲検索 - /// #27060 2012.2.6 yyagi - /// - private void t曲リストの構築2(bool hard_reload = false) { - // !注意! - // 本メソッドは別スレッドで動作するが、プラグイン側でカレントディレクトリを変更しても大丈夫なように、 - // すべてのファイルアクセスは「絶対パス」で行うこと。(2010.9.16) - // 構築が完了したら、DTXEnumerateState state を DTXEnumerateState.Done にすること。(2012.2.9) - DateTime now = DateTime.Now; + /// + /// songlist.dbからの曲リスト構築 + /// + public void t曲リストの構築1() { + // !注意! + // 本メソッドは別スレッドで動作するが、プラグイン側でカレントディレクトリを変更しても大丈夫なように、 + // すべてのファイルアクセスは「絶対パス」で行うこと。(2010.9.16) + // 構築が完了したら、DTXEnumerateState state を DTXEnumerateState.Done にすること。(2012.2.9) + DateTime now = DateTime.Now; + + try { + #region [ 0) システムサウンドの構築 ] + //----------------------------- + OpenTaiko.stage起動.ePhaseID = CStage.EPhase.Startup_0_CreateSystemSound; + + Trace.TraceInformation("0) システムサウンドを構築します。"); + Trace.Indent(); try { - if (hard_reload) { - if (File.Exists($"{OpenTaiko.strEXEのあるフォルダ}songlist.db")) - File.Delete($"{OpenTaiko.strEXEのあるフォルダ}songlist.db"); - } - Deserialize(); - - #region [ 2) 曲データの検索 ] - //----------------------------- - // base.eフェーズID = CStage.Eフェーズ.起動2_曲を検索してリストを作成する; - - Trace.TraceInformation("enum2) 曲データを検索します。"); - Trace.Indent(); - - try { - if (!string.IsNullOrEmpty(OpenTaiko.ConfigIni.strSongsPath)) { - CSongDict.tClearSongNodes(); - string[] strArray = OpenTaiko.ConfigIni.strSongsPath.Split(new char[] { ';' }); - if (strArray.Length > 0) { - // 全パスについて… - foreach (string str in strArray) { - string path = str; - if (!Path.IsPathRooted(path)) { - path = OpenTaiko.strEXEのあるフォルダ + str; // 相対パスの場合、絶対パスに直す(2010.9.16) - } - - if (!string.IsNullOrEmpty(path)) { - Trace.TraceInformation("検索パス: " + path); - Trace.Indent(); - - try { - this.Songs管理.t曲を検索してリストを作成する(path, true); - } catch (Exception e) { - Trace.TraceError(e.ToString()); - Trace.TraceError("例外が発生しましたが処理を継続します。 (105fd674-e722-4a4e-bd9a-e6f82ac0b1d3)"); - } finally { - Trace.Unindent(); - } - } + OpenTaiko.Skin.bgm起動画面.tPlay(); + for (int i = 0; i < OpenTaiko.Skin.nシステムサウンド数; i++) { + if (!OpenTaiko.Skin[i].bExclusive) // BGM系以外のみ読み込む。(BGM系は必要になったときに読み込む) + { + CSkin.CSystemSound cシステムサウンド = OpenTaiko.Skin[i]; + if (cシステムサウンド.bCompact対象) { + try { + cシステムサウンド.tLoading(); + Trace.TraceInformation("システムサウンドを読み込みました。({0})", cシステムサウンド.strFileName); + //if ( ( cシステムサウンド == CDTXMania.Skin.bgm起動画面 ) && cシステムサウンド.b読み込み成功 ) + //{ + // cシステムサウンド.t再生する(); + //} + } catch (FileNotFoundException) { + Trace.TraceWarning("システムサウンドが存在しません。({0})", cシステムサウンド.strFileName); + } catch (Exception e) { + Trace.TraceWarning(e.ToString()); + Trace.TraceWarning("システムサウンドの読み込みに失敗しました。({0})", cシステムサウンド.strFileName); } } - } else { - Trace.TraceWarning("曲データの検索パス(TJAPath)の指定がありません。"); } - } finally { - Trace.TraceInformation("曲データの検索を完了しました。[{0}曲{1}スコア]", this.Songs管理.n検索された曲ノード数, this.Songs管理.n検索されたスコア数); - Trace.Unindent(); } - // lock ( this.list進行文字列 ) - // { - // this.list進行文字列.Add( string.Format( "{0} ... {1} scores ({2} songs)", "Enumerating songs", this..Songs管理_裏読.n検索されたスコア数, this.Songs管理_裏読.n検索された曲ノード数 ) ); - // } - //----------------------------- - #endregion - #region [ 4) songs.db になかった曲データをファイルから読み込んで反映 ] - //----------------------------- - // base.eフェーズID = CStage.Eフェーズ.起動4_スコアキャッシュになかった曲をファイルから読み込んで反映する; - - /* - int num2 = this.Songs管理.n検索されたスコア数 - this.Songs管理.nスコアキャッシュから反映できたスコア数; - - Trace.TraceInformation( "{0}, {1}", this.Songs管理.n検索されたスコア数, this.Songs管理.nスコアキャッシュから反映できたスコア数 ); - Trace.TraceInformation( "enum4) songs.db になかった曲データ[{0}スコア]の情報をファイルから読み込んで反映します。", num2 ); - Trace.Indent(); - - try - { - this.Songs管理.tSongsDBになかった曲をファイルから読み込んで反映する(); + lock (OpenTaiko.stage起動.list進行文字列) { + OpenTaiko.stage起動.list進行文字列.Add("SYSTEM SOUND...OK"); } - catch ( Exception e ) - { - Trace.TraceError( e.ToString() ); - Trace.TraceError( "例外が発生しましたが処理を継続します。 (276bb40f-6406-40c1-9f03-e2a9869dbc88)" ); - } - finally - { - Trace.TraceInformation( "曲データへの反映を完了しました。[{0}/{1}スコア]", this.Songs管理.nファイルから反映できたスコア数, num2 ); - Trace.Unindent(); - } - // lock ( this.list進行文字列 ) - // { - // this.list進行文字列.Add( string.Format( "{0} ... {1}/{2}", "Loading score properties from files", CDTXMania.Songs管理_裏読.nファイルから反映できたスコア数, CDTXMania.Songs管理_裏読.n検索されたスコア数 - cs.nスコアキャッシュから反映できたスコア数 ) ); - // } - */ - //----------------------------- - #endregion - #region [ 5) 曲リストへの後処理の適用 ] - //----------------------------- - // base.eフェーズID = CStage.Eフェーズ.起動5_曲リストへ後処理を適用する; - - Trace.TraceInformation("enum5) 曲リストへの後処理を適用します。"); - Trace.Indent(); - - try { - this.Songs管理.t曲リストへ後処理を適用する(); - } catch (Exception e) { - Trace.TraceError(e.ToString()); - Trace.TraceError("例外が発生しましたが処理を継続します。 (6480ffa0-1cc1-40d4-9cc9-aceeecd0264b)"); - } finally { - Trace.TraceInformation("曲リストへの後処理を完了しました。"); - Trace.Unindent(); - } - // lock ( this.list進行文字列 ) - // { - // this.list進行文字列.Add( string.Format( "{0} ... OK", "Building songlists" ) ); - // } - //----------------------------- - #endregion - - // if ( !bSucceededFastBoot ) // songs2.db読み込みに成功したなら、songs2.dbを新たに作らない - #region [ 7) songs2.db への保存 ] // #27060 2012.1.26 yyagi - Trace.TraceInformation("enum7) 曲データの情報を songlist.db へ出力します。"); - Trace.Indent(); - - SerializeSongList(); - Trace.TraceInformation("songlist.db への出力を完了しました。"); + } finally { Trace.Unindent(); - //----------------------------- - #endregion - // } - - } finally { - // base.eフェーズID = CStage.Eフェーズ.起動7_完了; - TimeSpan span = (TimeSpan)(DateTime.Now - now); - Trace.TraceInformation("曲探索所要時間: {0}", span.ToString()); } - lock (this) { - // state = DTXEnumState.Done; // DoneにするのはCDTXMania.cs側にて。 - state = DTXEnumState.Enumeratad; + //----------------------------- + #endregion + + } finally { + OpenTaiko.stage起動.ePhaseID = CStage.EPhase.Startup_6_LoadTextures; + TimeSpan span = (TimeSpan)(DateTime.Now - now); + Trace.TraceInformation("起動所要時間: {0}", span.ToString()); + lock (this) // #28700 2012.6.12 yyagi; state change must be in finally{} for exiting as of compact mode. + { + state = DTXEnumState.CompletelyDone; } } + } + + + /// + /// 起動してタイトル画面に遷移した後にバックグラウンドで発生させる曲検索 + /// #27060 2012.2.6 yyagi + /// + private void t曲リストの構築2(bool hard_reload = false) { + // !注意! + // 本メソッドは別スレッドで動作するが、プラグイン側でカレントディレクトリを変更しても大丈夫なように、 + // すべてのファイルアクセスは「絶対パス」で行うこと。(2010.9.16) + // 構築が完了したら、DTXEnumerateState state を DTXEnumerateState.Done にすること。(2012.2.9) + + DateTime now = DateTime.Now; + + try { + if (hard_reload) { + if (File.Exists($"{OpenTaiko.strEXEのあるフォルダ}songlist.db")) + File.Delete($"{OpenTaiko.strEXEのあるフォルダ}songlist.db"); + } + Deserialize(); + + #region [ 2) 曲データの検索 ] + //----------------------------- + // base.eフェーズID = CStage.Eフェーズ.起動2_曲を検索してリストを作成する; + + Trace.TraceInformation("enum2) 曲データを検索します。"); + Trace.Indent(); + + try { + if (!string.IsNullOrEmpty(OpenTaiko.ConfigIni.strSongsPath)) { + CSongDict.tClearSongNodes(); + string[] strArray = OpenTaiko.ConfigIni.strSongsPath.Split(new char[] { ';' }); + if (strArray.Length > 0) { + // 全パスについて… + foreach (string str in strArray) { + string path = str; + if (!Path.IsPathRooted(path)) { + path = OpenTaiko.strEXEのあるフォルダ + str; // 相対パスの場合、絶対パスに直す(2010.9.16) + } + + if (!string.IsNullOrEmpty(path)) { + Trace.TraceInformation("検索パス: " + path); + Trace.Indent(); + + try { + this.Songs管理.t曲を検索してリストを作成する(path, true); + } catch (Exception e) { + Trace.TraceError(e.ToString()); + Trace.TraceError("例外が発生しましたが処理を継続します。 (105fd674-e722-4a4e-bd9a-e6f82ac0b1d3)"); + } finally { + Trace.Unindent(); + } + } + } + } + } else { + Trace.TraceWarning("曲データの検索パス(TJAPath)の指定がありません。"); + } + } finally { + Trace.TraceInformation("曲データの検索を完了しました。[{0}曲{1}スコア]", this.Songs管理.n検索された曲ノード数, this.Songs管理.n検索されたスコア数); + Trace.Unindent(); + } + // lock ( this.list進行文字列 ) + // { + // this.list進行文字列.Add( string.Format( "{0} ... {1} scores ({2} songs)", "Enumerating songs", this..Songs管理_裏読.n検索されたスコア数, this.Songs管理_裏読.n検索された曲ノード数 ) ); + // } + //----------------------------- + #endregion + #region [ 4) songs.db になかった曲データをファイルから読み込んで反映 ] + //----------------------------- + // base.eフェーズID = CStage.Eフェーズ.起動4_スコアキャッシュになかった曲をファイルから読み込んで反映する; + + /* + int num2 = this.Songs管理.n検索されたスコア数 - this.Songs管理.nスコアキャッシュから反映できたスコア数; + + Trace.TraceInformation( "{0}, {1}", this.Songs管理.n検索されたスコア数, this.Songs管理.nスコアキャッシュから反映できたスコア数 ); + Trace.TraceInformation( "enum4) songs.db になかった曲データ[{0}スコア]の情報をファイルから読み込んで反映します。", num2 ); + Trace.Indent(); + + try + { + this.Songs管理.tSongsDBになかった曲をファイルから読み込んで反映する(); + } + catch ( Exception e ) + { + Trace.TraceError( e.ToString() ); + Trace.TraceError( "例外が発生しましたが処理を継続します。 (276bb40f-6406-40c1-9f03-e2a9869dbc88)" ); + } + finally + { + Trace.TraceInformation( "曲データへの反映を完了しました。[{0}/{1}スコア]", this.Songs管理.nファイルから反映できたスコア数, num2 ); + Trace.Unindent(); + } + // lock ( this.list進行文字列 ) + // { + // this.list進行文字列.Add( string.Format( "{0} ... {1}/{2}", "Loading score properties from files", CDTXMania.Songs管理_裏読.nファイルから反映できたスコア数, CDTXMania.Songs管理_裏読.n検索されたスコア数 - cs.nスコアキャッシュから反映できたスコア数 ) ); + // } + */ + //----------------------------- + #endregion + #region [ 5) 曲リストへの後処理の適用 ] + //----------------------------- + // base.eフェーズID = CStage.Eフェーズ.起動5_曲リストへ後処理を適用する; + + Trace.TraceInformation("enum5) 曲リストへの後処理を適用します。"); + Trace.Indent(); + + try { + this.Songs管理.t曲リストへ後処理を適用する(); + } catch (Exception e) { + Trace.TraceError(e.ToString()); + Trace.TraceError("例外が発生しましたが処理を継続します。 (6480ffa0-1cc1-40d4-9cc9-aceeecd0264b)"); + } finally { + Trace.TraceInformation("曲リストへの後処理を完了しました。"); + Trace.Unindent(); + } + // lock ( this.list進行文字列 ) + // { + // this.list進行文字列.Add( string.Format( "{0} ... OK", "Building songlists" ) ); + // } + //----------------------------- + #endregion + + // if ( !bSucceededFastBoot ) // songs2.db読み込みに成功したなら、songs2.dbを新たに作らない + #region [ 7) songs2.db への保存 ] // #27060 2012.1.26 yyagi + Trace.TraceInformation("enum7) 曲データの情報を songlist.db へ出力します。"); + Trace.Indent(); + + SerializeSongList(); + Trace.TraceInformation("songlist.db への出力を完了しました。"); + Trace.Unindent(); + //----------------------------- + #endregion + // } + + } finally { + // base.eフェーズID = CStage.Eフェーズ.起動7_完了; + TimeSpan span = (TimeSpan)(DateTime.Now - now); + Trace.TraceInformation("曲探索所要時間: {0}", span.ToString()); + } + lock (this) { + // state = DTXEnumState.Done; // DoneにするのはCDTXMania.cs側にて。 + state = DTXEnumState.Enumeratad; + } + } #pragma warning disable SYSLIB0011 - /// - /// 曲リストのserialize - /// - private void SerializeSongList() { - BinaryFormatter songlistdb_ = new BinaryFormatter(); - using Stream songlistdb = File.OpenWrite($"{OpenTaiko.strEXEのあるフォルダ}songlist.db"); - songlistdb_.Serialize(songlistdb, Songs管理.listSongsDB); - } - - /// - /// 曲リストのdeserialize - /// - /// - /// - public void Deserialize() { - try { - if (File.Exists($"{OpenTaiko.strEXEのあるフォルダ}songlist.db")) { - BinaryFormatter songlistdb_ = new BinaryFormatter(); - using Stream songlistdb = File.OpenRead($"{OpenTaiko.strEXEのあるフォルダ}songlist.db"); - this.Songs管理.listSongsDB = (Dictionary)songlistdb_.Deserialize(songlistdb); - } - } catch (Exception exception) { - this.Songs管理.listSongsDB = new(); - } finally { - } - } -#pragma warning restore SYSLIB0011 + /// + /// 曲リストのserialize + /// + private void SerializeSongList() { + BinaryFormatter songlistdb_ = new BinaryFormatter(); + using Stream songlistdb = File.OpenWrite($"{OpenTaiko.strEXEのあるフォルダ}songlist.db"); + songlistdb_.Serialize(songlistdb, Songs管理.listSongsDB); } + + /// + /// 曲リストのdeserialize + /// + /// + /// + public void Deserialize() { + try { + if (File.Exists($"{OpenTaiko.strEXEのあるフォルダ}songlist.db")) { + BinaryFormatter songlistdb_ = new BinaryFormatter(); + using Stream songlistdb = File.OpenRead($"{OpenTaiko.strEXEのあるフォルダ}songlist.db"); + this.Songs管理.listSongsDB = (Dictionary)songlistdb_.Deserialize(songlistdb); + } + } catch (Exception exception) { + this.Songs管理.listSongsDB = new(); + } finally { + } + } +#pragma warning restore SYSLIB0011 } diff --git a/OpenTaiko/src/Stages/02.Title/CMainMenuTab.cs b/OpenTaiko/src/Stages/02.Title/CMainMenuTab.cs index 21ee51bf..b42fa2dd 100644 --- a/OpenTaiko/src/Stages/02.Title/CMainMenuTab.cs +++ b/OpenTaiko/src/Stages/02.Title/CMainMenuTab.cs @@ -1,178 +1,178 @@ using System.Drawing; using FDK; -namespace OpenTaiko { - class CMainMenuTab { - public static int __MenuCount = 14; // Number of existing menus - public static CMainMenuTab[] __Menus; - public static bool __BoxesProcessed = false; +namespace OpenTaiko; - public TitleTextureKey ttkTitle; - public TitleTextureKey ttkBoxText; - public bool _1pRestricted; - public bool implemented; - public CTexture barTex; - public CTexture barChara; - public CStageタイトル.E戻り値 rp; +class CMainMenuTab { + public static int __MenuCount = 14; // Number of existing menus + public static CMainMenuTab[] __Menus; + public static bool __BoxesProcessed = false; - public CMainMenuTab(int boxId, Color col, CCachedFontRenderer tpf, CCachedFontRenderer boxpf, CStageタイトル.E戻り値 returnPoint, bool _1Ponly, bool impl, CTexture[] modeSelect_Bar, CTexture[] modeSelect_Bar_Chara) { - string title = GetBoxText(boxId); + public TitleTextureKey ttkTitle; + public TitleTextureKey ttkBoxText; + public bool _1pRestricted; + public bool implemented; + public CTexture barTex; + public CTexture barChara; + public CStageタイトル.E戻り値 rp; - ttkTitle = new TitleTextureKey(title, tpf, Color.White, col, 1280, Color.Black); + public CMainMenuTab(int boxId, Color col, CCachedFontRenderer tpf, CCachedFontRenderer boxpf, CStageタイトル.E戻り値 returnPoint, bool _1Ponly, bool impl, CTexture[] modeSelect_Bar, CTexture[] modeSelect_Bar_Chara) { + string title = GetBoxText(boxId); - string boxText = GetBoxText(boxId, false); + ttkTitle = new TitleTextureKey(title, tpf, Color.White, col, 1280, Color.Black); - ttkBoxText = new TitleTextureKey(boxText, boxpf, Color.White, Color.Black, 1000); + string boxText = GetBoxText(boxId, false); - rp = returnPoint; + ttkBoxText = new TitleTextureKey(boxText, boxpf, Color.White, Color.Black, 1000); - _1pRestricted = _1Ponly; - implemented = impl; - barTex = (modeSelect_Bar.Length > boxId) ? modeSelect_Bar[boxId] : null; - barChara = (modeSelect_Bar_Chara.Length > boxId) ? modeSelect_Bar_Chara[boxId] : null; + rp = returnPoint; + + _1pRestricted = _1Ponly; + implemented = impl; + barTex = (modeSelect_Bar.Length > boxId) ? modeSelect_Bar[boxId] : null; + barChara = (modeSelect_Bar_Chara.Length > boxId) ? modeSelect_Bar_Chara[boxId] : null; + } + + private static string GetBoxText(int boxid, bool isTitle = true) { + string append = isTitle ? "" : "_DESC"; + switch (boxid) { + case 0: + default: + return CLangManager.LangInstance.GetString($"TITLE_MODE_TAIKO{append}"); + case 1: + return CLangManager.LangInstance.GetString($"TITLE_MODE_DAN{append}"); + case 2: + return CLangManager.LangInstance.GetString($"TITLE_MODE_TOWER{append}"); + case 3: + return CLangManager.LangInstance.GetString($"TITLE_MODE_SHOP{append}"); + case 4: + return CLangManager.LangInstance.GetString($"TITLE_MODE_STORY{append}"); + case 5: + return CLangManager.LangInstance.GetString($"TITLE_MODE_HEYA{append}"); + case 6: + return CLangManager.LangInstance.GetString($"TITLE_MODE_SETTINGS{append}"); + case 7: + return CLangManager.LangInstance.GetString($"TITLE_MODE_EXIT{append}"); + case 8: + return CLangManager.LangInstance.GetString($"TITLE_MODE_ONLINE{append}"); + case 9: + return CLangManager.LangInstance.GetString($"TITLE_MODE_DOCUMENT{append}"); + case 10: + return CLangManager.LangInstance.GetString($"TITLE_MODE_AI{append}"); + case 11: + return CLangManager.LangInstance.GetString($"TITLE_MODE_STATS{append}"); + case 12: + return CLangManager.LangInstance.GetString($"TITLE_MODE_EDITOR{append}"); + case 13: + return CLangManager.LangInstance.GetString($"TITLE_MODE_TOOLS{append}"); } + } + + public static void tInitMenus(CCachedFontRenderer tpf, CCachedFontRenderer boxpf, CTexture[] modeSelect_Bar, CTexture[] modeSelect_Bar_Chara) { + // Proceed the boxes only once + + if (__BoxesProcessed == false) { + __Menus = new CMainMenuTab[__MenuCount]; + + // Removed to avoid having to reload the game when changing language + //__BoxesProcessed = true; + + #region [Menu Colors] + + Color[] __MenuColors = + { + Color.FromArgb(233, 53, 71), + Color.FromArgb(71, 64, 135), + Color.FromArgb(255, 180, 42), + Color.FromArgb(16, 255, 255), + Color.FromArgb(128, 0, 128), + Color.FromArgb(24, 128, 24), + Color.FromArgb(128, 128, 128), + Color.FromArgb(72, 72, 72), + Color.FromArgb(199, 8, 119), // Online lounge red/pink + Color.FromArgb(181, 186, 28), // Encyclopedia yellow + Color.FromArgb(78, 166, 171), // AI battle mode blue + Color.FromArgb(230, 230, 230), // Player stats white + Color.FromArgb(40, 40, 40), // Chart editor black + Color.FromArgb(120, 104, 56), // Toolbox brown + }; + + #endregion + + #region [Return points] + + CStageタイトル.E戻り値[] __rps = + { + CStageタイトル.E戻り値.GAMESTART, + CStageタイトル.E戻り値.DANGAMESTART, + CStageタイトル.E戻り値.TAIKOTOWERSSTART, + CStageタイトル.E戻り値.SHOPSTART, + CStageタイトル.E戻り値.BOUKENSTART, + CStageタイトル.E戻り値.HEYA, + CStageタイトル.E戻り値.CONFIG, + CStageタイトル.E戻り値.EXIT, + CStageタイトル.E戻り値.ONLINELOUNGE, + CStageタイトル.E戻り値.ENCYCLOPEDIA, + CStageタイトル.E戻り値.AIBATTLEMODE, + CStageタイトル.E戻り値.PLAYERSTATS, + CStageタイトル.E戻り値.CHARTEDITOR, + CStageタイトル.E戻り値.TOOLBOX, + }; + + #endregion + + #region [Extra bools] + + bool[] _1PRestricts = + { + false, + true, + true, + false, + true, + false, + false, + false, + false, + false, + false, + false, + true, + false, + }; + + // To edit while new features are implemented + bool[] _implemented = + { + true, + true, + true, + false, + false, + true, + true, + true, + true, + false, + true, + false, + false, + false, + }; + + #endregion + + for (int i = 0; i < __MenuCount; i++) { + CStageタイトル.E戻り値 _rp = (i >= __rps.Length) ? CStageタイトル.E戻り値.GAMESTART : __rps[i]; + Color _mc = (i >= __MenuColors.Length) ? Color.White : __MenuColors[i]; + bool _1pr = (i >= _1PRestricts.Length) ? false : _1PRestricts[i]; + bool _impl = (i >= _implemented.Length) ? false : _implemented[i]; + + __Menus[i] = new CMainMenuTab(i, _mc, tpf, boxpf, _rp, _1pr, _impl, modeSelect_Bar, modeSelect_Bar_Chara); - private static string GetBoxText(int boxid, bool isTitle = true) { - string append = isTitle ? "" : "_DESC"; - switch (boxid) { - case 0: - default: - return CLangManager.LangInstance.GetString($"TITLE_MODE_TAIKO{append}"); - case 1: - return CLangManager.LangInstance.GetString($"TITLE_MODE_DAN{append}"); - case 2: - return CLangManager.LangInstance.GetString($"TITLE_MODE_TOWER{append}"); - case 3: - return CLangManager.LangInstance.GetString($"TITLE_MODE_SHOP{append}"); - case 4: - return CLangManager.LangInstance.GetString($"TITLE_MODE_STORY{append}"); - case 5: - return CLangManager.LangInstance.GetString($"TITLE_MODE_HEYA{append}"); - case 6: - return CLangManager.LangInstance.GetString($"TITLE_MODE_SETTINGS{append}"); - case 7: - return CLangManager.LangInstance.GetString($"TITLE_MODE_EXIT{append}"); - case 8: - return CLangManager.LangInstance.GetString($"TITLE_MODE_ONLINE{append}"); - case 9: - return CLangManager.LangInstance.GetString($"TITLE_MODE_DOCUMENT{append}"); - case 10: - return CLangManager.LangInstance.GetString($"TITLE_MODE_AI{append}"); - case 11: - return CLangManager.LangInstance.GetString($"TITLE_MODE_STATS{append}"); - case 12: - return CLangManager.LangInstance.GetString($"TITLE_MODE_EDITOR{append}"); - case 13: - return CLangManager.LangInstance.GetString($"TITLE_MODE_TOOLS{append}"); } } - public static void tInitMenus(CCachedFontRenderer tpf, CCachedFontRenderer boxpf, CTexture[] modeSelect_Bar, CTexture[] modeSelect_Bar_Chara) { - // Proceed the boxes only once - - if (__BoxesProcessed == false) { - __Menus = new CMainMenuTab[__MenuCount]; - - // Removed to avoid having to reload the game when changing language - //__BoxesProcessed = true; - - #region [Menu Colors] - - Color[] __MenuColors = - { - Color.FromArgb(233, 53, 71), - Color.FromArgb(71, 64, 135), - Color.FromArgb(255, 180, 42), - Color.FromArgb(16, 255, 255), - Color.FromArgb(128, 0, 128), - Color.FromArgb(24, 128, 24), - Color.FromArgb(128, 128, 128), - Color.FromArgb(72, 72, 72), - Color.FromArgb(199, 8, 119), // Online lounge red/pink - Color.FromArgb(181, 186, 28), // Encyclopedia yellow - Color.FromArgb(78, 166, 171), // AI battle mode blue - Color.FromArgb(230, 230, 230), // Player stats white - Color.FromArgb(40, 40, 40), // Chart editor black - Color.FromArgb(120, 104, 56), // Toolbox brown - }; - - #endregion - - #region [Return points] - - CStageタイトル.E戻り値[] __rps = - { - CStageタイトル.E戻り値.GAMESTART, - CStageタイトル.E戻り値.DANGAMESTART, - CStageタイトル.E戻り値.TAIKOTOWERSSTART, - CStageタイトル.E戻り値.SHOPSTART, - CStageタイトル.E戻り値.BOUKENSTART, - CStageタイトル.E戻り値.HEYA, - CStageタイトル.E戻り値.CONFIG, - CStageタイトル.E戻り値.EXIT, - CStageタイトル.E戻り値.ONLINELOUNGE, - CStageタイトル.E戻り値.ENCYCLOPEDIA, - CStageタイトル.E戻り値.AIBATTLEMODE, - CStageタイトル.E戻り値.PLAYERSTATS, - CStageタイトル.E戻り値.CHARTEDITOR, - CStageタイトル.E戻り値.TOOLBOX, - }; - - #endregion - - #region [Extra bools] - - bool[] _1PRestricts = - { - false, - true, - true, - false, - true, - false, - false, - false, - false, - false, - false, - false, - true, - false, - }; - - // To edit while new features are implemented - bool[] _implemented = - { - true, - true, - true, - false, - false, - true, - true, - true, - true, - false, - true, - false, - false, - false, - }; - - #endregion - - for (int i = 0; i < __MenuCount; i++) { - CStageタイトル.E戻り値 _rp = (i >= __rps.Length) ? CStageタイトル.E戻り値.GAMESTART : __rps[i]; - Color _mc = (i >= __MenuColors.Length) ? Color.White : __MenuColors[i]; - bool _1pr = (i >= _1PRestricts.Length) ? false : _1PRestricts[i]; - bool _impl = (i >= _implemented.Length) ? false : _implemented[i]; - - __Menus[i] = new CMainMenuTab(i, _mc, tpf, boxpf, _rp, _1pr, _impl, modeSelect_Bar, modeSelect_Bar_Chara); - - } - } - - } - } + } diff --git a/OpenTaiko/src/Stages/02.Title/CStageタイトル.cs b/OpenTaiko/src/Stages/02.Title/CStageタイトル.cs index 49ae6859..a6615e77 100644 --- a/OpenTaiko/src/Stages/02.Title/CStageタイトル.cs +++ b/OpenTaiko/src/Stages/02.Title/CStageタイトル.cs @@ -3,1022 +3,1022 @@ using System.Drawing; using System.Reflection; using FDK; -namespace OpenTaiko { - internal class CStageタイトル : CStage { - // Constructor +namespace OpenTaiko; - public CStageタイトル() { - base.eStageID = CStage.EStage.Title; - base.IsDeActivated = true; - base.ChildActivities.Add(this.actFIfromSetup = new CActFIFOBlack()); - base.ChildActivities.Add(this.actFI = new CActFIFOBlack()); - base.ChildActivities.Add(this.actFO = new CActFIFOBlack()); +internal class CStageタイトル : CStage { + // Constructor - base.ChildActivities.Add(this.PuchiChara = new PuchiChara()); + public CStageタイトル() { + base.eStageID = CStage.EStage.Title; + base.IsDeActivated = true; + base.ChildActivities.Add(this.actFIfromSetup = new CActFIFOBlack()); + base.ChildActivities.Add(this.actFI = new CActFIFOBlack()); + base.ChildActivities.Add(this.actFO = new CActFIFOBlack()); + base.ChildActivities.Add(this.PuchiChara = new PuchiChara()); + + } + + + // CStage 実装 + + public override void Activate() { + Trace.TraceInformation("タイトルステージを活性化します。"); + Trace.Indent(); + try { + UnloadSaveFile(); + + this.PuchiChara.IdleAnimation(); + + SkipSaveFileStep(); + + usedMenus = new int[] { + 0, + 1, + 2, + 10, + 5, + //3, + //9, + 8, + 6, + 7, + + // -- Debug + /* + 11, + 12, + 13, + */ + }; + + usedMenusCount = usedMenus.Length; + + usedMenusPos = new int[usedMenusCount]; + for (int i = 0; i < usedMenusCount; i++) { + usedMenusPos[i] = i + 1 - n現在の選択行モード選択; + } + + // Init Menus + tReloadMenus(); + + Background = new ScriptBG(CSkin.Path($"{TextureLoader.BASE}{TextureLoader.TITLE}Script.lua")); + Background.Init(); + + + b音声再生 = false; + if (bSaveFileLoaded == false) + OpenTaiko.Skin.soundEntry.tPlay(); + if (OpenTaiko.ConfigIni.bBGMPlayVoiceSound) + OpenTaiko.Skin.bgmタイトルイン.tPlay(); + base.Activate(); + } finally { + Trace.TraceInformation("タイトルステージの活性化を完了しました。"); + Trace.Unindent(); } + } + public override void DeActivate() { + Trace.TraceInformation("タイトルステージを非活性化します。"); + Trace.Indent(); + try { + OpenTaiko.tDisposeSafely(ref Background); + } finally { + Trace.TraceInformation("タイトルステージの非活性化を完了しました。"); + Trace.Unindent(); + } + base.DeActivate(); + } + public void tReloadMenus() { + if (this.pfMenuTitle != null && this.pfBoxText != null) + CMainMenuTab.tInitMenus(this.pfMenuTitle, this.pfBoxText, OpenTaiko.Tx.ModeSelect_Bar, OpenTaiko.Tx.ModeSelect_Bar_Chara); + } - // CStage 実装 + public override void CreateManagedResource() { + this.pfMenuTitle = HPrivateFastFont.tInstantiateMainFont(OpenTaiko.Skin.Title_ModeSelect_Title_Scale[0]); + this.pfBoxText = HPrivateFastFont.tInstantiateBoxFont(OpenTaiko.Skin.Title_ModeSelect_Title_Scale[1]); - public override void Activate() { - Trace.TraceInformation("タイトルステージを活性化します。"); - Trace.Indent(); - try { - UnloadSaveFile(); + base.CreateManagedResource(); + } + public override void ReleaseManagedResource() { - this.PuchiChara.IdleAnimation(); + OpenTaiko.tDisposeSafely(ref pfMenuTitle); + OpenTaiko.tDisposeSafely(ref pfBoxText); - SkipSaveFileStep(); - - usedMenus = new int[] { - 0, - 1, - 2, - 10, - 5, - //3, - //9, - 8, - 6, - 7, - - // -- Debug - /* - 11, - 12, - 13, - */ - }; - - usedMenusCount = usedMenus.Length; - - usedMenusPos = new int[usedMenusCount]; - for (int i = 0; i < usedMenusCount; i++) { - usedMenusPos[i] = i + 1 - n現在の選択行モード選択; + base.ReleaseManagedResource(); + } + public override int Draw() { + if (!base.IsDeActivated) { + #region [ 初めての進行描画 ] + //--------------------- + if (base.IsFirstDraw) { + if (OpenTaiko.r直前のステージ == OpenTaiko.stage起動) { + this.actFIfromSetup.tフェードイン開始(); + base.ePhaseID = CStage.EPhase.Title_FadeIn; + } else { + this.actFI.tフェードイン開始(); + base.ePhaseID = CStage.EPhase.Common_FADEIN; } - - // Init Menus - tReloadMenus(); - - Background = new ScriptBG(CSkin.Path($"{TextureLoader.BASE}{TextureLoader.TITLE}Script.lua")); - Background.Init(); - - - b音声再生 = false; - if (bSaveFileLoaded == false) - OpenTaiko.Skin.soundEntry.tPlay(); - if (OpenTaiko.ConfigIni.bBGMPlayVoiceSound) - OpenTaiko.Skin.bgmタイトルイン.tPlay(); - base.Activate(); - } finally { - Trace.TraceInformation("タイトルステージの活性化を完了しました。"); - Trace.Unindent(); + base.IsFirstDraw = false; } - } - public override void DeActivate() { - Trace.TraceInformation("タイトルステージを非活性化します。"); - Trace.Indent(); - try { - OpenTaiko.tDisposeSafely(ref Background); - } finally { - Trace.TraceInformation("タイトルステージの非活性化を完了しました。"); - Trace.Unindent(); + //--------------------- + #endregion + + this.ctコインイン待機.TickLoop(); + this.ctSaveLoaded.Tick(); + this.ctSaveLoadingFailed.Tick(); + this.ctエントリーバー点滅.TickLoop(); + this.ctエントリーバー決定点滅.Tick(); + this.ctキャライン.Tick(); + this.ctBarMove.Tick(); + + if (!OpenTaiko.Skin.bgmタイトルイン.bIsPlaying) { + if (OpenTaiko.ConfigIni.bBGMPlayVoiceSound && !b音声再生) { + OpenTaiko.Skin.bgmタイトル.tPlay(); + b音声再生 = true; + } } - base.DeActivate(); - } - public void tReloadMenus() { - if (this.pfMenuTitle != null && this.pfBoxText != null) - CMainMenuTab.tInitMenus(this.pfMenuTitle, this.pfBoxText, OpenTaiko.Tx.ModeSelect_Bar, OpenTaiko.Tx.ModeSelect_Bar_Chara); - } + // 進行 - public override void CreateManagedResource() { - this.pfMenuTitle = HPrivateFastFont.tInstantiateMainFont(OpenTaiko.Skin.Title_ModeSelect_Title_Scale[0]); - this.pfBoxText = HPrivateFastFont.tInstantiateBoxFont(OpenTaiko.Skin.Title_ModeSelect_Title_Scale[1]); + #region [ キー関係 ] - base.CreateManagedResource(); - } - public override void ReleaseManagedResource() { - - OpenTaiko.tDisposeSafely(ref pfMenuTitle); - OpenTaiko.tDisposeSafely(ref pfBoxText); - - base.ReleaseManagedResource(); - } - public override int Draw() { - if (!base.IsDeActivated) { - #region [ 初めての進行描画 ] - //--------------------- - if (base.IsFirstDraw) { - if (OpenTaiko.r直前のステージ == OpenTaiko.stage起動) { - this.actFIfromSetup.tフェードイン開始(); - base.ePhaseID = CStage.EPhase.Title_FadeIn; + if (base.ePhaseID == CStage.EPhase.Common_NORMAL) // プラグインの入力占有がない + { + if (OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Escape) || OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.Cancel)) { + if (bモード選択) { + OpenTaiko.Skin.soundCancelSFX.tPlay(); + bSaveFileLoaded = false; + UnloadSaveFile(); + if (bSaveFileLoaded == false) + OpenTaiko.Skin.soundEntry.tPlay(); } else { - this.actFI.tフェードイン開始(); - base.ePhaseID = CStage.EPhase.Common_FADEIN; - } - base.IsFirstDraw = false; - } - //--------------------- - #endregion - - this.ctコインイン待機.TickLoop(); - this.ctSaveLoaded.Tick(); - this.ctSaveLoadingFailed.Tick(); - this.ctエントリーバー点滅.TickLoop(); - this.ctエントリーバー決定点滅.Tick(); - this.ctキャライン.Tick(); - this.ctBarMove.Tick(); - - if (!OpenTaiko.Skin.bgmタイトルイン.bIsPlaying) { - if (OpenTaiko.ConfigIni.bBGMPlayVoiceSound && !b音声再生) { - OpenTaiko.Skin.bgmタイトル.tPlay(); - b音声再生 = true; + OpenTaiko.Skin.soundDecideSFX.tPlay(); + n現在の選択行モード選択 = (int)E戻り値.EXIT + 1; + this.actFO.tフェードアウト開始(0, 500); + base.ePhaseID = CStage.EPhase.Common_FADEOUT; } } - - // 進行 - - #region [ キー関係 ] - - if (base.ePhaseID == CStage.EPhase.Common_NORMAL) // プラグインの入力占有がない - { - if (OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Escape) || OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.Cancel)) { - if (bモード選択) { - OpenTaiko.Skin.soundCancelSFX.tPlay(); - bSaveFileLoaded = false; - UnloadSaveFile(); - if (bSaveFileLoaded == false) - OpenTaiko.Skin.soundEntry.tPlay(); - } else { - OpenTaiko.Skin.soundDecideSFX.tPlay(); - n現在の選択行モード選択 = (int)E戻り値.EXIT + 1; - this.actFO.tフェードアウト開始(0, 500); - base.ePhaseID = CStage.EPhase.Common_FADEOUT; - } - } #if DEBUG - if (OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.F8)) { - CScoreIni_Importer.ImportScoreInisToSavesDb3(); - } + if (OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.F8)) { + CScoreIni_Importer.ImportScoreInisToSavesDb3(); + } #endif - // Disable F1 keybind since menu is accessible from main menu - /* - if ((TJAPlayer3.Input管理.Keyboard.bキーが押されている((int)SlimDXKeys.Key.RightShift) || TJAPlayer3.Input管理.Keyboard.bキーが押されている((int)SlimDXKeys.Key.LeftShift)) && TJAPlayer3.Input管理.Keyboard.bキーが押された((int)SlimDXKeys.Key.F1)) + // Disable F1 keybind since menu is accessible from main menu + /* + if ((TJAPlayer3.Input管理.Keyboard.bキーが押されている((int)SlimDXKeys.Key.RightShift) || TJAPlayer3.Input管理.Keyboard.bキーが押されている((int)SlimDXKeys.Key.LeftShift)) && TJAPlayer3.Input管理.Keyboard.bキーが押された((int)SlimDXKeys.Key.F1)) + { + TJAPlayer3.Skin.soundEntry.t停止する(); + + n現在の選択行モード選択 = (int)E戻り値.CONFIG - 1; + + this.actFO.tフェードアウト開始(); + base.eフェーズID = CStage.Eフェーズ.共通_フェードアウト; + TJAPlayer3.Skin.sound取消音.t再生する(); + } + */ + + // 1st step (Save file loading) + if (!bSaveIsLoading && !bSaveFailedToLoad) { + + if (OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.Decide) || + OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.RRed) || OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.LRed)) { + // Hit 1P save + OpenTaiko.SaveFile = 0; + CMenuCharacter.tMenuResetTimer(CMenuCharacter.ECharacterAnimation.ENTRY_NORMAL); + this.ctSaveLoading.Start(0, 600, 1, OpenTaiko.Timer); + this.ctSaveLoading.CurrentValue = (int)this.ctSaveLoading.EndValue; + for (int i = 0; i < 2; i++) + OpenTaiko.NamePlate.tNamePlateRefreshTitles(i); + } else if (OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.RRed2P) || OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.LRed2P)) { + // Hit 2P save + OpenTaiko.SaveFile = 1; + CMenuCharacter.tMenuResetTimer(CMenuCharacter.ECharacterAnimation.ENTRY_NORMAL); + this.ctSaveLoading.Start(0, 600, 1, OpenTaiko.Timer); + this.ctSaveLoading.CurrentValue = (int)this.ctSaveLoading.EndValue; + for (int i = 0; i < 2; i++) + OpenTaiko.NamePlate.tNamePlateRefreshTitles(i); + } else if (OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.P)) // In case "P" is already binded to another pad { - TJAPlayer3.Skin.soundEntry.t停止する(); - - n現在の選択行モード選択 = (int)E戻り値.CONFIG - 1; - - this.actFO.tフェードアウト開始(); - base.eフェーズID = CStage.Eフェーズ.共通_フェードアウト; - TJAPlayer3.Skin.sound取消音.t再生する(); + // Hit 1P save + OpenTaiko.SaveFile = 0; + CMenuCharacter.tMenuResetTimer(CMenuCharacter.ECharacterAnimation.ENTRY_NORMAL); + this.ctSaveLoading.Start(0, 600, 1, OpenTaiko.Timer); + this.ctSaveLoading.CurrentValue = (int)this.ctSaveLoading.EndValue; + for (int i = 0; i < 2; i++) + OpenTaiko.NamePlate.tNamePlateRefreshTitles(i); } - */ + } - // 1st step (Save file loading) - if (!bSaveIsLoading && !bSaveFailedToLoad) { - - if (OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.Decide) || - OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.RRed) || OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.LRed)) { - // Hit 1P save - OpenTaiko.SaveFile = 0; - CMenuCharacter.tMenuResetTimer(CMenuCharacter.ECharacterAnimation.ENTRY_NORMAL); - this.ctSaveLoading.Start(0, 600, 1, OpenTaiko.Timer); - this.ctSaveLoading.CurrentValue = (int)this.ctSaveLoading.EndValue; - for (int i = 0; i < 2; i++) - OpenTaiko.NamePlate.tNamePlateRefreshTitles(i); - } else if (OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.RRed2P) || OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.LRed2P)) { - // Hit 2P save - OpenTaiko.SaveFile = 1; - CMenuCharacter.tMenuResetTimer(CMenuCharacter.ECharacterAnimation.ENTRY_NORMAL); - this.ctSaveLoading.Start(0, 600, 1, OpenTaiko.Timer); - this.ctSaveLoading.CurrentValue = (int)this.ctSaveLoading.EndValue; - for (int i = 0; i < 2; i++) - OpenTaiko.NamePlate.tNamePlateRefreshTitles(i); - } else if (OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.P)) // In case "P" is already binded to another pad - { - // Hit 1P save - OpenTaiko.SaveFile = 0; - CMenuCharacter.tMenuResetTimer(CMenuCharacter.ECharacterAnimation.ENTRY_NORMAL); - this.ctSaveLoading.Start(0, 600, 1, OpenTaiko.Timer); - this.ctSaveLoading.CurrentValue = (int)this.ctSaveLoading.EndValue; - for (int i = 0; i < 2; i++) - OpenTaiko.NamePlate.tNamePlateRefreshTitles(i); + if (OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.RightChange) || OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.RightArrow)) { + if (bプレイヤーエントリー && !bプレイヤーエントリー決定 && this.ctSaveLoaded.IsEnded) { + if (n現在の選択行プレイヤーエントリー + 1 <= 2) { + OpenTaiko.Skin.soundChangeSFX.tPlay(); + n現在の選択行プレイヤーエントリー += 1; } } - if (OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.RightChange) || OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.RightArrow)) { - if (bプレイヤーエントリー && !bプレイヤーエントリー決定 && this.ctSaveLoaded.IsEnded) { - if (n現在の選択行プレイヤーエントリー + 1 <= 2) { - OpenTaiko.Skin.soundChangeSFX.tPlay(); - n現在の選択行プレイヤーエントリー += 1; + if (bモード選択) { + //if (n現在の選択行モード選択 < this.nbModes - 1) + if (n現在の選択行モード選択 < usedMenusCount - 1) { + OpenTaiko.Skin.soundChangeSFX.tPlay(); + ctBarMove.Start(0, 250, 1.2f, OpenTaiko.Timer); + n現在の選択行モード選択++; + this.bDownPushed = true; + + for (int i = 0; i < usedMenusCount; i++) { + usedMenusPos[i] = i + 1 - n現在の選択行モード選択; } } - - if (bモード選択) { - //if (n現在の選択行モード選択 < this.nbModes - 1) - if (n現在の選択行モード選択 < usedMenusCount - 1) { - OpenTaiko.Skin.soundChangeSFX.tPlay(); - ctBarMove.Start(0, 250, 1.2f, OpenTaiko.Timer); - n現在の選択行モード選択++; - this.bDownPushed = true; - - for (int i = 0; i < usedMenusCount; i++) { - usedMenusPos[i] = i + 1 - n現在の選択行モード選択; - } - } - } - } - - if (OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.LeftChange) || OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.LeftArrow)) { - if (bプレイヤーエントリー && !bプレイヤーエントリー決定 && this.ctSaveLoaded.IsEnded) { - if (n現在の選択行プレイヤーエントリー - 1 >= 0) { - OpenTaiko.Skin.soundChangeSFX.tPlay(); - n現在の選択行プレイヤーエントリー -= 1; - } - } - - if (bモード選択) { - if (n現在の選択行モード選択 > 0) { - OpenTaiko.Skin.soundChangeSFX.tPlay(); - ctBarMove.Start(0, 250, 1.2f, OpenTaiko.Timer); - n現在の選択行モード選択--; - this.bDownPushed = false; - - for (int i = 0; i < usedMenusCount; i++) { - usedMenusPos[i] = i + 1 - n現在の選択行モード選択; - } - } - } - } - - - if (OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.Decide) - || OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Return)) { - if (bプレイヤーエントリー && this.ctSaveLoaded.IsEnded) { - if (n現在の選択行プレイヤーエントリー == 0 || n現在の選択行プレイヤーエントリー == 2) { - if (!bプレイヤーエントリー決定) { - OpenTaiko.Skin.soundDecideSFX.tPlay(); - ctエントリーバー決定点滅.Start(0, 1055, 1, OpenTaiko.Timer); - bプレイヤーエントリー決定 = true; - OpenTaiko.PlayerSide = (n現在の選択行プレイヤーエントリー == 2) ? 1 : 0; - if (OpenTaiko.PlayerSide == 1) - OpenTaiko.ConfigIni.nPlayerCount = 1; - bSaveFileLoaded = true; - } - } else { - OpenTaiko.Skin.soundDecideSFX.tPlay(); - bプレイヤーエントリー = false; - bSaveIsLoading = false; - OpenTaiko.Skin.SoundBanapas.bPlayed = false; - ctSaveLoaded = new CCounter(); - ctSaveLoading = new CCounter(); - } - } - if (bモード選択) { - bool operationSucceded = false; - - if (CMainMenuTab.__Menus[usedMenus[this.n現在の選択行モード選択]].rp == E戻り値.DANGAMESTART || CMainMenuTab.__Menus[usedMenus[this.n現在の選択行モード選択]].rp == E戻り値.TAIKOTOWERSSTART) { - if (OpenTaiko.Songs管理.list曲ルート_Dan.Count > 0 && OpenTaiko.ConfigIni.nPlayerCount == 1) - operationSucceded = true; - } else if (CMainMenuTab.__Menus[usedMenus[this.n現在の選択行モード選択]].implemented == true - && (CMainMenuTab.__Menus[usedMenus[this.n現在の選択行モード選択]]._1pRestricted == false - || OpenTaiko.ConfigIni.nPlayerCount == 1)) - operationSucceded = true; - - if (operationSucceded == true) { - OpenTaiko.Skin.soundDecideSFX.tPlay(); - this.actFO.tフェードアウト開始(0, 500); - base.ePhaseID = CStage.EPhase.Common_FADEOUT; - } else - OpenTaiko.Skin.soundError.tPlay(); - } - } - - if (ctSaveLoading.CurrentValue >= 500) { - if (!bSaveIsLoading) { - OpenTaiko.Skin.soundEntry.tStop(); - ctSaveLoaded.Start(0, 3655, 1, OpenTaiko.Timer); - bSaveIsLoading = true; - bキャラカウンター初期化 = false; - } - } - - if (ctエントリーバー決定点滅.CurrentValue >= 1055) { - if (!bモード選択) { - /* - if (!TJAPlayer3.Skin.soundsanka.bPlayed) - TJAPlayer3.Skin.soundsanka.t再生する(); - */ - - if (OpenTaiko.Skin.voiceTitleSanka[OpenTaiko.SaveFile] != null && !OpenTaiko.Skin.voiceTitleSanka[OpenTaiko.SaveFile].bPlayed) - OpenTaiko.Skin.voiceTitleSanka[OpenTaiko.SaveFile]?.tPlay(); - - ctキャライン.Start(0, 180, 2, OpenTaiko.Timer); - ctBarAnimeIn.Start(0, 1295, 1, OpenTaiko.Timer); - bモード選択 = true; - } } } - #endregion + if (OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.LeftChange) || OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.LeftArrow)) { + if (bプレイヤーエントリー && !bプレイヤーエントリー決定 && this.ctSaveLoaded.IsEnded) { + if (n現在の選択行プレイヤーエントリー - 1 >= 0) { + OpenTaiko.Skin.soundChangeSFX.tPlay(); + n現在の選択行プレイヤーエントリー -= 1; + } + } - #region [ 背景描画 ] - - Background.Update(); - Background.Draw(); - - //if (Title_Background != null) - // Title_Background.t2D描画(0, 0); - - #endregion - - if (bSaveFileLoaded == false) { - #region [ Save Loading ] - - if (!bSaveIsLoading && !bSaveFailedToLoad) { - OpenTaiko.Tx.Entry_Bar.t2D描画(0, 0); - - if (this.ctコインイン待機.CurrentValue <= 255) - OpenTaiko.Tx.Entry_Bar_Text.Opacity = this.ctコインイン待機.CurrentValue; - else if (this.ctコインイン待機.CurrentValue <= 2000 - 355) - OpenTaiko.Tx.Entry_Bar_Text.Opacity = 255; - else - OpenTaiko.Tx.Entry_Bar_Text.Opacity = 255 - (this.ctコインイン待機.CurrentValue - (2000 - 355)); - - OpenTaiko.Tx.Entry_Bar_Text.t2D描画(OpenTaiko.Skin.Title_Entry_Bar_Text_X[0], OpenTaiko.Skin.Title_Entry_Bar_Text_Y[0], new RectangleF(0, 0, OpenTaiko.Tx.Entry_Bar_Text.sz画像サイズ.Width, OpenTaiko.Tx.Entry_Bar_Text.sz画像サイズ.Height / 2)); - OpenTaiko.Tx.Entry_Bar_Text.t2D描画(OpenTaiko.Skin.Title_Entry_Bar_Text_X[1], OpenTaiko.Skin.Title_Entry_Bar_Text_Y[1], new RectangleF(0, OpenTaiko.Tx.Entry_Bar_Text.sz画像サイズ.Height / 2, OpenTaiko.Tx.Entry_Bar_Text.sz画像サイズ.Width, OpenTaiko.Tx.Entry_Bar_Text.sz画像サイズ.Height / 2)); - } else { - if (this.ctSaveLoaded.CurrentValue <= 1000 && this.ctSaveLoadingFailed.CurrentValue <= 1128) { - if (bSaveIsLoading) { - OpenTaiko.Tx.Tile_Black.Opacity = this.ctSaveLoaded.CurrentValue <= 2972 ? 128 : 128 - (this.ctSaveLoaded.CurrentValue - 2972); - - for (int i = 0; i < OpenTaiko.Skin.Resolution[0] / OpenTaiko.Tx.Tile_Black.szTextureSize.Width + 1; i++) - for (int j = 0; j < OpenTaiko.Skin.Resolution[1] / OpenTaiko.Tx.Tile_Black.szTextureSize.Height + 1; j++) - OpenTaiko.Tx.Tile_Black.t2D描画(i * OpenTaiko.Tx.Tile_Black.szTextureSize.Width, j * OpenTaiko.Tx.Tile_Black.szTextureSize.Height); - - OpenTaiko.Tx.Banapas_Load[0].Opacity = ctSaveLoaded.CurrentValue >= 872 ? 255 - (ctSaveLoaded.CurrentValue - 872) * 2 : ctSaveLoaded.CurrentValue * 2; - OpenTaiko.Tx.Banapas_Load[0].vcScaleRatio.Y = ctSaveLoaded.CurrentValue <= 100 ? ctSaveLoaded.CurrentValue * 0.01f : 1.0f; - OpenTaiko.Tx.Banapas_Load[0].t2D描画(0, 0); - - OpenTaiko.Tx.Banapas_Load[1].Opacity = ctSaveLoaded.CurrentValue >= 872 ? 255 - (ctSaveLoaded.CurrentValue - 872) * 2 : ctSaveLoaded.CurrentValue <= 96 ? (int)((ctSaveLoaded.CurrentValue - 96) * 7.96875f) : 255; - OpenTaiko.Tx.Banapas_Load[1].t2D描画(0, 0); - - if (OpenTaiko.Tx.Banapas_Load[2] != null) { - int step = OpenTaiko.Tx.Banapas_Load[2].szTextureSize.Width / OpenTaiko.Skin.Title_LoadingPinFrameCount; - int cycle = OpenTaiko.Skin.Title_LoadingPinCycle; - int _stamp = (ctSaveLoaded.CurrentValue - 200) % (OpenTaiko.Skin.Title_LoadingPinInstances * cycle); - - for (int i = 0; i < OpenTaiko.Skin.Title_LoadingPinInstances; i++) { - OpenTaiko.Tx.Banapas_Load[2].Opacity = ctSaveLoaded.CurrentValue >= 872 ? 255 - (ctSaveLoaded.CurrentValue - 872) * 2 : ctSaveLoaded.CurrentValue <= 96 ? (int)((ctSaveLoaded.CurrentValue - 96) * 7.96875f) : 255; - - - OpenTaiko.Tx.Banapas_Load[2].t2D拡大率考慮中央基準描画( - OpenTaiko.Skin.Title_LoadingPinBase[0] + OpenTaiko.Skin.Title_LoadingPinDiff[0] * i, - OpenTaiko.Skin.Title_LoadingPinBase[1] + OpenTaiko.Skin.Title_LoadingPinDiff[1] * i, - new Rectangle(step - * (_stamp >= i * cycle - ? _stamp <= (i + 1) * cycle - ? (_stamp + i * cycle) / (cycle / OpenTaiko.Skin.Title_LoadingPinFrameCount) - : 0 - : 0), - 0, - step, - OpenTaiko.Tx.Banapas_Load[2].szTextureSize.Height)); - } - } + if (bモード選択) { + if (n現在の選択行モード選択 > 0) { + OpenTaiko.Skin.soundChangeSFX.tPlay(); + ctBarMove.Start(0, 250, 1.2f, OpenTaiko.Timer); + n現在の選択行モード選択--; + this.bDownPushed = false; + for (int i = 0; i < usedMenusCount; i++) { + usedMenusPos[i] = i + 1 - n現在の選択行モード選択; } - if (bSaveFailedToLoad) { - OpenTaiko.Tx.Tile_Black.Opacity = this.ctSaveLoadingFailed.CurrentValue <= 1000 ? 128 : 128 - (this.ctSaveLoadingFailed.CurrentValue - 1000); + } + } + } - for (int i = 0; i < OpenTaiko.Skin.Resolution[0] / OpenTaiko.Tx.Tile_Black.szTextureSize.Width + 1; i++) - for (int j = 0; j < OpenTaiko.Skin.Resolution[1] / OpenTaiko.Tx.Tile_Black.szTextureSize.Height + 1; j++) - OpenTaiko.Tx.Tile_Black.t2D描画(i * OpenTaiko.Tx.Tile_Black.szTextureSize.Width, j * OpenTaiko.Tx.Tile_Black.szTextureSize.Height); - if (!OpenTaiko.Skin.soundError.bPlayed) - OpenTaiko.Skin.soundError.tPlay(); - - int count = this.ctSaveLoadingFailed.CurrentValue; - OpenTaiko.Tx.Banapas_Load_Failure[0].Opacity = count >= 872 ? 255 - (count - 872) * 2 : count * 2; - OpenTaiko.Tx.Banapas_Load_Failure[0].vcScaleRatio.Y = count <= 100 ? count * 0.01f : 1.0f; - OpenTaiko.Tx.Banapas_Load_Failure[0].t2D描画(0, 0); - - if (ctSaveLoadingFailed.CurrentValue >= 1128) { - bSaveFailedToLoad = false; - OpenTaiko.Skin.soundError.bPlayed = false; - } + if (OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.Decide) + || OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Return)) { + if (bプレイヤーエントリー && this.ctSaveLoaded.IsEnded) { + if (n現在の選択行プレイヤーエントリー == 0 || n現在の選択行プレイヤーエントリー == 2) { + if (!bプレイヤーエントリー決定) { + OpenTaiko.Skin.soundDecideSFX.tPlay(); + ctエントリーバー決定点滅.Start(0, 1055, 1, OpenTaiko.Timer); + bプレイヤーエントリー決定 = true; + OpenTaiko.PlayerSide = (n現在の選択行プレイヤーエントリー == 2) ? 1 : 0; + if (OpenTaiko.PlayerSide == 1) + OpenTaiko.ConfigIni.nPlayerCount = 1; + bSaveFileLoaded = true; } } else { - if (bSaveIsLoading) { - OpenTaiko.Tx.Tile_Black.Opacity = this.ctSaveLoaded.CurrentValue <= 2972 ? 128 : 128 - (this.ctSaveLoaded.CurrentValue - 2972); + OpenTaiko.Skin.soundDecideSFX.tPlay(); + bプレイヤーエントリー = false; + bSaveIsLoading = false; + OpenTaiko.Skin.SoundBanapas.bPlayed = false; + ctSaveLoaded = new CCounter(); + ctSaveLoading = new CCounter(); + } + } + if (bモード選択) { + bool operationSucceded = false; - for (int i = 0; i < OpenTaiko.Skin.Resolution[0] / OpenTaiko.Tx.Tile_Black.szTextureSize.Width + 1; i++) - for (int j = 0; j < OpenTaiko.Skin.Resolution[1] / OpenTaiko.Tx.Tile_Black.szTextureSize.Height + 1; j++) - OpenTaiko.Tx.Tile_Black.t2D描画(i * OpenTaiko.Tx.Tile_Black.szTextureSize.Width, j * OpenTaiko.Tx.Tile_Black.szTextureSize.Height); + if (CMainMenuTab.__Menus[usedMenus[this.n現在の選択行モード選択]].rp == E戻り値.DANGAMESTART || CMainMenuTab.__Menus[usedMenus[this.n現在の選択行モード選択]].rp == E戻り値.TAIKOTOWERSSTART) { + if (OpenTaiko.Songs管理.list曲ルート_Dan.Count > 0 && OpenTaiko.ConfigIni.nPlayerCount == 1) + operationSucceded = true; + } else if (CMainMenuTab.__Menus[usedMenus[this.n現在の選択行モード選択]].implemented == true + && (CMainMenuTab.__Menus[usedMenus[this.n現在の選択行モード選択]]._1pRestricted == false + || OpenTaiko.ConfigIni.nPlayerCount == 1)) + operationSucceded = true; - if (!OpenTaiko.Skin.SoundBanapas.bPlayed) - OpenTaiko.Skin.SoundBanapas.tPlay(); + if (operationSucceded == true) { + OpenTaiko.Skin.soundDecideSFX.tPlay(); + this.actFO.tフェードアウト開始(0, 500); + base.ePhaseID = CStage.EPhase.Common_FADEOUT; + } else + OpenTaiko.Skin.soundError.tPlay(); + } + } - int count = this.ctSaveLoaded.CurrentValue - 1000; - OpenTaiko.Tx.Banapas_Load_Clear[0].Opacity = count >= 1872 ? 255 - (count - 1872) * 2 : count * 2; - OpenTaiko.Tx.Banapas_Load_Clear[0].vcScaleRatio.Y = count <= 100 ? count * 0.01f : 1.0f; - OpenTaiko.Tx.Banapas_Load_Clear[0].t2D描画(0, 0); + if (ctSaveLoading.CurrentValue >= 500) { + if (!bSaveIsLoading) { + OpenTaiko.Skin.soundEntry.tStop(); + ctSaveLoaded.Start(0, 3655, 1, OpenTaiko.Timer); + bSaveIsLoading = true; + bキャラカウンター初期化 = false; + } + } - float anime = 0f; - float scalex = 0f; - float scaley = 0f; + if (ctエントリーバー決定点滅.CurrentValue >= 1055) { + if (!bモード選択) { + /* + if (!TJAPlayer3.Skin.soundsanka.bPlayed) + TJAPlayer3.Skin.soundsanka.t再生する(); + */ - if (count >= 300) { - if (count <= 300 + 270) { - anime = (float)Math.Sin((float)(count - 300) / 1.5f * (Math.PI / 180)) * 95f; - scalex = -(float)Math.Sin((float)(count - 300) / 1.5f * (Math.PI / 180)) * 0.15f; - scaley = (float)Math.Sin((float)(count - 300) / 1.5f * (Math.PI / 180)) * 0.2f; - } else if (count <= 300 + 270 + 100) { - scalex = (float)Math.Sin((float)(count - (300 + 270)) * 1.8f * (Math.PI / 180)) * 0.13f; - scaley = -(float)Math.Sin((float)(count - (300 + 270)) * 1.8f * (Math.PI / 180)) * 0.1f; - anime = 0; - } else if (count <= 300 + 540 + 100) { - anime = (float)Math.Sin((float)(count - (300 + 270 + 100)) / 1.5f * (Math.PI / 180)) * 95f; - scalex = -(float)Math.Sin((float)(count - (300 + 270 + 100)) / 1.5f * (Math.PI / 180)) * 0.15f; - scaley = (float)Math.Sin((float)(count - (300 + 270 + 100)) / 1.5f * (Math.PI / 180)) * 0.2f; - } else if (count <= 300 + 540 + 100 + 100) { - scalex = (float)Math.Sin((float)(count - (300 + 540 + 100)) * 1.8f * (Math.PI / 180)) * 0.13f; - scaley = -(float)Math.Sin((float)(count - (300 + 540 + 100)) * 1.8f * (Math.PI / 180)) * 0.1f; - } + if (OpenTaiko.Skin.voiceTitleSanka[OpenTaiko.SaveFile] != null && !OpenTaiko.Skin.voiceTitleSanka[OpenTaiko.SaveFile].bPlayed) + OpenTaiko.Skin.voiceTitleSanka[OpenTaiko.SaveFile]?.tPlay(); + + ctキャライン.Start(0, 180, 2, OpenTaiko.Timer); + ctBarAnimeIn.Start(0, 1295, 1, OpenTaiko.Timer); + bモード選択 = true; + } + } + } + + #endregion + + #region [ 背景描画 ] + + Background.Update(); + Background.Draw(); + + //if (Title_Background != null) + // Title_Background.t2D描画(0, 0); + + #endregion + + if (bSaveFileLoaded == false) { + #region [ Save Loading ] + + if (!bSaveIsLoading && !bSaveFailedToLoad) { + OpenTaiko.Tx.Entry_Bar.t2D描画(0, 0); + + if (this.ctコインイン待機.CurrentValue <= 255) + OpenTaiko.Tx.Entry_Bar_Text.Opacity = this.ctコインイン待機.CurrentValue; + else if (this.ctコインイン待機.CurrentValue <= 2000 - 355) + OpenTaiko.Tx.Entry_Bar_Text.Opacity = 255; + else + OpenTaiko.Tx.Entry_Bar_Text.Opacity = 255 - (this.ctコインイン待機.CurrentValue - (2000 - 355)); + + OpenTaiko.Tx.Entry_Bar_Text.t2D描画(OpenTaiko.Skin.Title_Entry_Bar_Text_X[0], OpenTaiko.Skin.Title_Entry_Bar_Text_Y[0], new RectangleF(0, 0, OpenTaiko.Tx.Entry_Bar_Text.sz画像サイズ.Width, OpenTaiko.Tx.Entry_Bar_Text.sz画像サイズ.Height / 2)); + OpenTaiko.Tx.Entry_Bar_Text.t2D描画(OpenTaiko.Skin.Title_Entry_Bar_Text_X[1], OpenTaiko.Skin.Title_Entry_Bar_Text_Y[1], new RectangleF(0, OpenTaiko.Tx.Entry_Bar_Text.sz画像サイズ.Height / 2, OpenTaiko.Tx.Entry_Bar_Text.sz画像サイズ.Width, OpenTaiko.Tx.Entry_Bar_Text.sz画像サイズ.Height / 2)); + } else { + if (this.ctSaveLoaded.CurrentValue <= 1000 && this.ctSaveLoadingFailed.CurrentValue <= 1128) { + if (bSaveIsLoading) { + OpenTaiko.Tx.Tile_Black.Opacity = this.ctSaveLoaded.CurrentValue <= 2972 ? 128 : 128 - (this.ctSaveLoaded.CurrentValue - 2972); + + for (int i = 0; i < OpenTaiko.Skin.Resolution[0] / OpenTaiko.Tx.Tile_Black.szTextureSize.Width + 1; i++) + for (int j = 0; j < OpenTaiko.Skin.Resolution[1] / OpenTaiko.Tx.Tile_Black.szTextureSize.Height + 1; j++) + OpenTaiko.Tx.Tile_Black.t2D描画(i * OpenTaiko.Tx.Tile_Black.szTextureSize.Width, j * OpenTaiko.Tx.Tile_Black.szTextureSize.Height); + + OpenTaiko.Tx.Banapas_Load[0].Opacity = ctSaveLoaded.CurrentValue >= 872 ? 255 - (ctSaveLoaded.CurrentValue - 872) * 2 : ctSaveLoaded.CurrentValue * 2; + OpenTaiko.Tx.Banapas_Load[0].vcScaleRatio.Y = ctSaveLoaded.CurrentValue <= 100 ? ctSaveLoaded.CurrentValue * 0.01f : 1.0f; + OpenTaiko.Tx.Banapas_Load[0].t2D描画(0, 0); + + OpenTaiko.Tx.Banapas_Load[1].Opacity = ctSaveLoaded.CurrentValue >= 872 ? 255 - (ctSaveLoaded.CurrentValue - 872) * 2 : ctSaveLoaded.CurrentValue <= 96 ? (int)((ctSaveLoaded.CurrentValue - 96) * 7.96875f) : 255; + OpenTaiko.Tx.Banapas_Load[1].t2D描画(0, 0); + + if (OpenTaiko.Tx.Banapas_Load[2] != null) { + int step = OpenTaiko.Tx.Banapas_Load[2].szTextureSize.Width / OpenTaiko.Skin.Title_LoadingPinFrameCount; + int cycle = OpenTaiko.Skin.Title_LoadingPinCycle; + int _stamp = (ctSaveLoaded.CurrentValue - 200) % (OpenTaiko.Skin.Title_LoadingPinInstances * cycle); + + for (int i = 0; i < OpenTaiko.Skin.Title_LoadingPinInstances; i++) { + OpenTaiko.Tx.Banapas_Load[2].Opacity = ctSaveLoaded.CurrentValue >= 872 ? 255 - (ctSaveLoaded.CurrentValue - 872) * 2 : ctSaveLoaded.CurrentValue <= 96 ? (int)((ctSaveLoaded.CurrentValue - 96) * 7.96875f) : 255; + + + OpenTaiko.Tx.Banapas_Load[2].t2D拡大率考慮中央基準描画( + OpenTaiko.Skin.Title_LoadingPinBase[0] + OpenTaiko.Skin.Title_LoadingPinDiff[0] * i, + OpenTaiko.Skin.Title_LoadingPinBase[1] + OpenTaiko.Skin.Title_LoadingPinDiff[1] * i, + new Rectangle(step + * (_stamp >= i * cycle + ? _stamp <= (i + 1) * cycle + ? (_stamp + i * cycle) / (cycle / OpenTaiko.Skin.Title_LoadingPinFrameCount) + : 0 + : 0), + 0, + step, + OpenTaiko.Tx.Banapas_Load[2].szTextureSize.Height)); } + } - OpenTaiko.Tx.Banapas_Load_Clear[1].vcScaleRatio.X = 1.0f + scalex; - OpenTaiko.Tx.Banapas_Load_Clear[1].vcScaleRatio.Y = 1.0f + scaley; - OpenTaiko.Tx.Banapas_Load_Clear[1].Opacity = count >= 1872 ? 255 - (count - 1872) * 2 : count * 2; - OpenTaiko.Tx.Banapas_Load_Clear[1].t2D拡大率考慮下中心基準描画(OpenTaiko.Skin.Title_Banapas_Load_Clear_Anime[0], OpenTaiko.Skin.Title_Banapas_Load_Clear_Anime[1] - anime); + } + if (bSaveFailedToLoad) { + OpenTaiko.Tx.Tile_Black.Opacity = this.ctSaveLoadingFailed.CurrentValue <= 1000 ? 128 : 128 - (this.ctSaveLoadingFailed.CurrentValue - 1000); - if (ctSaveLoaded.CurrentValue >= 2000) { - bプレイヤーエントリー = true; + for (int i = 0; i < OpenTaiko.Skin.Resolution[0] / OpenTaiko.Tx.Tile_Black.szTextureSize.Width + 1; i++) + for (int j = 0; j < OpenTaiko.Skin.Resolution[1] / OpenTaiko.Tx.Tile_Black.szTextureSize.Height + 1; j++) + OpenTaiko.Tx.Tile_Black.t2D描画(i * OpenTaiko.Tx.Tile_Black.szTextureSize.Width, j * OpenTaiko.Tx.Tile_Black.szTextureSize.Height); + + if (!OpenTaiko.Skin.soundError.bPlayed) + OpenTaiko.Skin.soundError.tPlay(); + + int count = this.ctSaveLoadingFailed.CurrentValue; + OpenTaiko.Tx.Banapas_Load_Failure[0].Opacity = count >= 872 ? 255 - (count - 872) * 2 : count * 2; + OpenTaiko.Tx.Banapas_Load_Failure[0].vcScaleRatio.Y = count <= 100 ? count * 0.01f : 1.0f; + OpenTaiko.Tx.Banapas_Load_Failure[0].t2D描画(0, 0); + + if (ctSaveLoadingFailed.CurrentValue >= 1128) { + bSaveFailedToLoad = false; + OpenTaiko.Skin.soundError.bPlayed = false; + } + } + } else { + if (bSaveIsLoading) { + OpenTaiko.Tx.Tile_Black.Opacity = this.ctSaveLoaded.CurrentValue <= 2972 ? 128 : 128 - (this.ctSaveLoaded.CurrentValue - 2972); + + for (int i = 0; i < OpenTaiko.Skin.Resolution[0] / OpenTaiko.Tx.Tile_Black.szTextureSize.Width + 1; i++) + for (int j = 0; j < OpenTaiko.Skin.Resolution[1] / OpenTaiko.Tx.Tile_Black.szTextureSize.Height + 1; j++) + OpenTaiko.Tx.Tile_Black.t2D描画(i * OpenTaiko.Tx.Tile_Black.szTextureSize.Width, j * OpenTaiko.Tx.Tile_Black.szTextureSize.Height); + + if (!OpenTaiko.Skin.SoundBanapas.bPlayed) + OpenTaiko.Skin.SoundBanapas.tPlay(); + + int count = this.ctSaveLoaded.CurrentValue - 1000; + OpenTaiko.Tx.Banapas_Load_Clear[0].Opacity = count >= 1872 ? 255 - (count - 1872) * 2 : count * 2; + OpenTaiko.Tx.Banapas_Load_Clear[0].vcScaleRatio.Y = count <= 100 ? count * 0.01f : 1.0f; + OpenTaiko.Tx.Banapas_Load_Clear[0].t2D描画(0, 0); + + float anime = 0f; + float scalex = 0f; + float scaley = 0f; + + if (count >= 300) { + if (count <= 300 + 270) { + anime = (float)Math.Sin((float)(count - 300) / 1.5f * (Math.PI / 180)) * 95f; + scalex = -(float)Math.Sin((float)(count - 300) / 1.5f * (Math.PI / 180)) * 0.15f; + scaley = (float)Math.Sin((float)(count - 300) / 1.5f * (Math.PI / 180)) * 0.2f; + } else if (count <= 300 + 270 + 100) { + scalex = (float)Math.Sin((float)(count - (300 + 270)) * 1.8f * (Math.PI / 180)) * 0.13f; + scaley = -(float)Math.Sin((float)(count - (300 + 270)) * 1.8f * (Math.PI / 180)) * 0.1f; + anime = 0; + } else if (count <= 300 + 540 + 100) { + anime = (float)Math.Sin((float)(count - (300 + 270 + 100)) / 1.5f * (Math.PI / 180)) * 95f; + scalex = -(float)Math.Sin((float)(count - (300 + 270 + 100)) / 1.5f * (Math.PI / 180)) * 0.15f; + scaley = (float)Math.Sin((float)(count - (300 + 270 + 100)) / 1.5f * (Math.PI / 180)) * 0.2f; + } else if (count <= 300 + 540 + 100 + 100) { + scalex = (float)Math.Sin((float)(count - (300 + 540 + 100)) * 1.8f * (Math.PI / 180)) * 0.13f; + scaley = -(float)Math.Sin((float)(count - (300 + 540 + 100)) * 1.8f * (Math.PI / 180)) * 0.1f; } } + + OpenTaiko.Tx.Banapas_Load_Clear[1].vcScaleRatio.X = 1.0f + scalex; + OpenTaiko.Tx.Banapas_Load_Clear[1].vcScaleRatio.Y = 1.0f + scaley; + OpenTaiko.Tx.Banapas_Load_Clear[1].Opacity = count >= 1872 ? 255 - (count - 1872) * 2 : count * 2; + OpenTaiko.Tx.Banapas_Load_Clear[1].t2D拡大率考慮下中心基準描画(OpenTaiko.Skin.Title_Banapas_Load_Clear_Anime[0], OpenTaiko.Skin.Title_Banapas_Load_Clear_Anime[1] - anime); + + if (ctSaveLoaded.CurrentValue >= 2000) { + bプレイヤーエントリー = true; + } } } - - #endregion } - #region [ プレイヤーエントリー ] + #endregion + } - if (bプレイヤーエントリー) { - if (!this.bキャラカウンター初期化) { - //this.ctキャラエントリーループ = new CCounter(0, Chara_Entry.Length - 1, 1000 / 60, TJAPlayer3.Timer); - CMenuCharacter.tMenuResetTimer(CMenuCharacter.ECharacterAnimation.ENTRY); + #region [ プレイヤーエントリー ] - this.bキャラカウンター初期化 = true; - } + if (bプレイヤーエントリー) { + if (!this.bキャラカウンター初期化) { + //this.ctキャラエントリーループ = new CCounter(0, Chara_Entry.Length - 1, 1000 / 60, TJAPlayer3.Timer); + CMenuCharacter.tMenuResetTimer(CMenuCharacter.ECharacterAnimation.ENTRY); - int alpha = ctエントリーバー決定点滅.CurrentValue >= 800 ? 255 - (ctエントリーバー決定点滅.CurrentValue - 800) : (this.ctSaveLoaded.CurrentValue - 3400); + this.bキャラカウンター初期化 = true; + } - OpenTaiko.Tx.Entry_Player[0].Opacity = alpha; - OpenTaiko.Tx.Entry_Player[1].Opacity = alpha; + int alpha = ctエントリーバー決定点滅.CurrentValue >= 800 ? 255 - (ctエントリーバー決定点滅.CurrentValue - 800) : (this.ctSaveLoaded.CurrentValue - 3400); - /* - var ___ttx = CMenuCharacter._getReferenceArray(0, CMenuCharacter.ECharacterAnimation.ENTRY) - [CMenuCharacter._getReferenceCounter(CMenuCharacter.ECharacterAnimation.ENTRY)[0].n現在の値]; - ___ttx.Opacity = alpha; - */ + OpenTaiko.Tx.Entry_Player[0].Opacity = alpha; + OpenTaiko.Tx.Entry_Player[1].Opacity = alpha; - //Chara_Entry[this.ctキャラエントリーループ.n現在の値].Opacity = alpha; + /* + var ___ttx = CMenuCharacter._getReferenceArray(0, CMenuCharacter.ECharacterAnimation.ENTRY) + [CMenuCharacter._getReferenceCounter(CMenuCharacter.ECharacterAnimation.ENTRY)[0].n現在の値]; + ___ttx.Opacity = alpha; + */ - OpenTaiko.Tx.Entry_Player[0].t2D描画(0, 0); + //Chara_Entry[this.ctキャラエントリーループ.n現在の値].Opacity = alpha; - //Chara_Entry[this.ctキャラエントリーループ.n現在の値].t2D描画(485, 140); + OpenTaiko.Tx.Entry_Player[0].t2D描画(0, 0); - int _actual = OpenTaiko.GetActualPlayer(0); + //Chara_Entry[this.ctキャラエントリーループ.n現在の値].t2D描画(485, 140); - int _charaId = OpenTaiko.SaveFileInstances[_actual].data.Character; + int _actual = OpenTaiko.GetActualPlayer(0); - int chara_x = OpenTaiko.Skin.Title_Entry_NamePlate[0] + OpenTaiko.Tx.NamePlateBase.szTextureSize.Width / 2; - int chara_y = OpenTaiko.Skin.Title_Entry_NamePlate[1]; + int _charaId = OpenTaiko.SaveFileInstances[_actual].data.Character; - int puchi_x = chara_x + OpenTaiko.Skin.Adjustments_MenuPuchichara_X[0]; - int puchi_y = chara_y + OpenTaiko.Skin.Adjustments_MenuPuchichara_Y[0]; + int chara_x = OpenTaiko.Skin.Title_Entry_NamePlate[0] + OpenTaiko.Tx.NamePlateBase.szTextureSize.Width / 2; + int chara_y = OpenTaiko.Skin.Title_Entry_NamePlate[1]; - CMenuCharacter.tMenuDisplayCharacter( - 0, - chara_x, - chara_y, - CMenuCharacter.ECharacterAnimation.ENTRY, alpha - ); + int puchi_x = chara_x + OpenTaiko.Skin.Adjustments_MenuPuchichara_X[0]; + int puchi_y = chara_y + OpenTaiko.Skin.Adjustments_MenuPuchichara_Y[0]; - /* - CMenuCharacter.tMenuDisplayCharacter( - 0, - TJAPlayer3.Skin.Characters_Title_Entry_X[_charaId][_actual], - TJAPlayer3.Skin.Characters_Title_Entry_Y[_charaId][_actual], - CMenuCharacter.ECharacterAnimation.ENTRY, alpha - ); - */ + CMenuCharacter.tMenuDisplayCharacter( + 0, + chara_x, + chara_y, + CMenuCharacter.ECharacterAnimation.ENTRY, alpha + ); - //___ttx.Opacity = 255; + /* + CMenuCharacter.tMenuDisplayCharacter( + 0, + TJAPlayer3.Skin.Characters_Title_Entry_X[_charaId][_actual], + TJAPlayer3.Skin.Characters_Title_Entry_Y[_charaId][_actual], + CMenuCharacter.ECharacterAnimation.ENTRY, alpha + ); + */ + + //___ttx.Opacity = 255; - //this.PuchiChara.On進行描画(485 + 100, 140 + 190, false, alpha); - this.PuchiChara.On進行描画(puchi_x, puchi_y, false, alpha); + //this.PuchiChara.On進行描画(485 + 100, 140 + 190, false, alpha); + this.PuchiChara.On進行描画(puchi_x, puchi_y, false, alpha); - OpenTaiko.Tx.Entry_Player[2].Opacity = ctエントリーバー決定点滅.CurrentValue >= 800 ? 255 - (ctエントリーバー決定点滅.CurrentValue - 800) : (this.ctSaveLoaded.CurrentValue - 3400) - (this.ctエントリーバー点滅.CurrentValue <= 255 ? this.ctエントリーバー点滅.CurrentValue : 255 - (this.ctエントリーバー点滅.CurrentValue - 255)); - OpenTaiko.Tx.Entry_Player[2].t2D描画(OpenTaiko.Skin.Title_Entry_Player_Select_X[n現在の選択行プレイヤーエントリー], OpenTaiko.Skin.Title_Entry_Player_Select_Y[n現在の選択行プレイヤーエントリー], - new RectangleF(OpenTaiko.Skin.Title_Entry_Player_Select_Rect[0][n現在の選択行プレイヤーエントリー == 1 ? 1 : 0][0], + OpenTaiko.Tx.Entry_Player[2].Opacity = ctエントリーバー決定点滅.CurrentValue >= 800 ? 255 - (ctエントリーバー決定点滅.CurrentValue - 800) : (this.ctSaveLoaded.CurrentValue - 3400) - (this.ctエントリーバー点滅.CurrentValue <= 255 ? this.ctエントリーバー点滅.CurrentValue : 255 - (this.ctエントリーバー点滅.CurrentValue - 255)); + OpenTaiko.Tx.Entry_Player[2].t2D描画(OpenTaiko.Skin.Title_Entry_Player_Select_X[n現在の選択行プレイヤーエントリー], OpenTaiko.Skin.Title_Entry_Player_Select_Y[n現在の選択行プレイヤーエントリー], + new RectangleF(OpenTaiko.Skin.Title_Entry_Player_Select_Rect[0][n現在の選択行プレイヤーエントリー == 1 ? 1 : 0][0], OpenTaiko.Skin.Title_Entry_Player_Select_Rect[0][n現在の選択行プレイヤーエントリー == 1 ? 1 : 0][1], OpenTaiko.Skin.Title_Entry_Player_Select_Rect[0][n現在の選択行プレイヤーエントリー == 1 ? 1 : 0][2], OpenTaiko.Skin.Title_Entry_Player_Select_Rect[0][n現在の選択行プレイヤーエントリー == 1 ? 1 : 0][3] - )); + )); - OpenTaiko.Tx.Entry_Player[2].Opacity = alpha; - OpenTaiko.Tx.Entry_Player[2].t2D描画(OpenTaiko.Skin.Title_Entry_Player_Select_X[n現在の選択行プレイヤーエントリー], OpenTaiko.Skin.Title_Entry_Player_Select_Y[n現在の選択行プレイヤーエントリー], - new RectangleF(OpenTaiko.Skin.Title_Entry_Player_Select_Rect[1][n現在の選択行プレイヤーエントリー == 1 ? 1 : 0][0], + OpenTaiko.Tx.Entry_Player[2].Opacity = alpha; + OpenTaiko.Tx.Entry_Player[2].t2D描画(OpenTaiko.Skin.Title_Entry_Player_Select_X[n現在の選択行プレイヤーエントリー], OpenTaiko.Skin.Title_Entry_Player_Select_Y[n現在の選択行プレイヤーエントリー], + new RectangleF(OpenTaiko.Skin.Title_Entry_Player_Select_Rect[1][n現在の選択行プレイヤーエントリー == 1 ? 1 : 0][0], OpenTaiko.Skin.Title_Entry_Player_Select_Rect[1][n現在の選択行プレイヤーエントリー == 1 ? 1 : 0][1], OpenTaiko.Skin.Title_Entry_Player_Select_Rect[1][n現在の選択行プレイヤーエントリー == 1 ? 1 : 0][2], OpenTaiko.Skin.Title_Entry_Player_Select_Rect[1][n現在の選択行プレイヤーエントリー == 1 ? 1 : 0][3] - )); + )); - OpenTaiko.Tx.Entry_Player[1].t2D描画(0, 0); + OpenTaiko.Tx.Entry_Player[1].t2D描画(0, 0); - #region [ 透明度 ] + #region [ 透明度 ] - int Opacity = 0; + int Opacity = 0; - if (ctエントリーバー決定点滅.CurrentValue <= 100) - Opacity = (int)(ctエントリーバー決定点滅.CurrentValue * 2.55f); - else if (ctエントリーバー決定点滅.CurrentValue <= 200) - Opacity = 255 - (int)((ctエントリーバー決定点滅.CurrentValue - 100) * 2.55f); - else if (ctエントリーバー決定点滅.CurrentValue <= 300) - Opacity = (int)((ctエントリーバー決定点滅.CurrentValue - 200) * 2.55f); - else if (ctエントリーバー決定点滅.CurrentValue <= 400) - Opacity = 255 - (int)((ctエントリーバー決定点滅.CurrentValue - 300) * 2.55f); - else if (ctエントリーバー決定点滅.CurrentValue <= 500) - Opacity = (int)((ctエントリーバー決定点滅.CurrentValue - 400) * 2.55f); - else if (ctエントリーバー決定点滅.CurrentValue <= 600) - Opacity = 255 - (int)((ctエントリーバー決定点滅.CurrentValue - 500) * 2.55f); + if (ctエントリーバー決定点滅.CurrentValue <= 100) + Opacity = (int)(ctエントリーバー決定点滅.CurrentValue * 2.55f); + else if (ctエントリーバー決定点滅.CurrentValue <= 200) + Opacity = 255 - (int)((ctエントリーバー決定点滅.CurrentValue - 100) * 2.55f); + else if (ctエントリーバー決定点滅.CurrentValue <= 300) + Opacity = (int)((ctエントリーバー決定点滅.CurrentValue - 200) * 2.55f); + else if (ctエントリーバー決定点滅.CurrentValue <= 400) + Opacity = 255 - (int)((ctエントリーバー決定点滅.CurrentValue - 300) * 2.55f); + else if (ctエントリーバー決定点滅.CurrentValue <= 500) + Opacity = (int)((ctエントリーバー決定点滅.CurrentValue - 400) * 2.55f); + else if (ctエントリーバー決定点滅.CurrentValue <= 600) + Opacity = 255 - (int)((ctエントリーバー決定点滅.CurrentValue - 500) * 2.55f); - #endregion + #endregion - OpenTaiko.Tx.Entry_Player[2].Opacity = Opacity; - OpenTaiko.Tx.Entry_Player[2].t2D描画(OpenTaiko.Skin.Title_Entry_Player_Select_X[n現在の選択行プレイヤーエントリー], OpenTaiko.Skin.Title_Entry_Player_Select_Y[n現在の選択行プレイヤーエントリー], - new RectangleF(OpenTaiko.Skin.Title_Entry_Player_Select_Rect[2][n現在の選択行プレイヤーエントリー == 1 ? 1 : 0][0], + OpenTaiko.Tx.Entry_Player[2].Opacity = Opacity; + OpenTaiko.Tx.Entry_Player[2].t2D描画(OpenTaiko.Skin.Title_Entry_Player_Select_X[n現在の選択行プレイヤーエントリー], OpenTaiko.Skin.Title_Entry_Player_Select_Y[n現在の選択行プレイヤーエントリー], + new RectangleF(OpenTaiko.Skin.Title_Entry_Player_Select_Rect[2][n現在の選択行プレイヤーエントリー == 1 ? 1 : 0][0], OpenTaiko.Skin.Title_Entry_Player_Select_Rect[2][n現在の選択行プレイヤーエントリー == 1 ? 1 : 0][1], OpenTaiko.Skin.Title_Entry_Player_Select_Rect[2][n現在の選択行プレイヤーエントリー == 1 ? 1 : 0][2], OpenTaiko.Skin.Title_Entry_Player_Select_Rect[2][n現在の選択行プレイヤーエントリー == 1 ? 1 : 0][3] - )); + )); - Opacity = ctエントリーバー決定点滅.CurrentValue >= 800 ? 255 - (ctエントリーバー決定点滅.CurrentValue - 800) : (this.ctSaveLoaded.CurrentValue - 3400); - if (Opacity > 0) - OpenTaiko.NamePlate.tNamePlateDraw(OpenTaiko.Skin.Title_Entry_NamePlate[0], OpenTaiko.Skin.Title_Entry_NamePlate[1], 0, true, Opacity); + Opacity = ctエントリーバー決定点滅.CurrentValue >= 800 ? 255 - (ctエントリーバー決定点滅.CurrentValue - 800) : (this.ctSaveLoaded.CurrentValue - 3400); + if (Opacity > 0) + OpenTaiko.NamePlate.tNamePlateDraw(OpenTaiko.Skin.Title_Entry_NamePlate[0], OpenTaiko.Skin.Title_Entry_NamePlate[1], 0, true, Opacity); + } + + #endregion + + #region [ モード選択 ] + + if (bモード選択) { + this.ctBarAnimeIn.Tick(); + + #region [ キャラ描画 ] + + for (int player = 0; player < OpenTaiko.ConfigIni.nPlayerCount; player++) { + if (player >= 2) continue; + + float CharaX = 0f, CharaY = 0f; + + CharaX = -200 + ((float)Math.Sin(ctキャライン.CurrentValue / 2 * (Math.PI / 180)) * 200f); + CharaY = ((float)Math.Sin((90 + (ctキャライン.CurrentValue / 2)) * (Math.PI / 180)) * 150f); + if (player == 1) CharaX *= -1; + + int _charaId = OpenTaiko.SaveFileInstances[OpenTaiko.GetActualPlayer(player)].data.Character; + + //int chara_x = (int)(TJAPlayer3.Skin.Characters_Title_Normal_X[_charaId][player] + CharaX); + //int chara_y = (int)(TJAPlayer3.Skin.Characters_Title_Normal_Y[_charaId][player] - CharaY); + + + int chara_x = (int)CharaX + OpenTaiko.Skin.SongSelect_NamePlate_X[player] + OpenTaiko.Tx.NamePlateBase.szTextureSize.Width / 2; + int chara_y = OpenTaiko.Skin.SongSelect_NamePlate_Y[player] - (int)CharaY; + + int puchi_x = chara_x + OpenTaiko.Skin.Adjustments_MenuPuchichara_X[player]; + int puchi_y = chara_y + OpenTaiko.Skin.Adjustments_MenuPuchichara_Y[player]; + + //Entry_Chara_Normal[ctキャラループ.n現在の値].t2D描画(-200 + CharaX, 341 - CharaY); + CMenuCharacter.tMenuDisplayCharacter(player, chara_x, chara_y, CMenuCharacter.ECharacterAnimation.ENTRY_NORMAL); + + //int puchi_x = TJAPlayer3.Skin.Characters_Menu_X[_charaId][player] + TJAPlayer3.Skin.Adjustments_MenuPuchichara_X[player]; + //int puchi_y = TJAPlayer3.Skin.Characters_Menu_Y[_charaId][player] + TJAPlayer3.Skin.Adjustments_MenuPuchichara_Y[player]; + + this.PuchiChara.On進行描画(puchi_x, puchi_y, false, player: player); } #endregion - #region [ モード選択 ] + if (ctBarAnimeIn.CurrentValue >= (int)(16 * 16.6f)) { + // TJAPlayer3.act文字コンソール.tPrint(0, 0, C文字コンソール.Eフォント種別.白, ctBarMove.n現在の値.ToString()); - if (bモード選択) { - this.ctBarAnimeIn.Tick(); + //for (int i = 0; i < this.nbModes; i++) + for (int i = 0; i < usedMenusCount; i++) { + // Get Menu reference + CMainMenuTab _menu = CMainMenuTab.__Menus[usedMenus[i]]; + CTexture _bar = _menu.barTex; + CTexture _chara = _menu.barChara; - #region [ キャラ描画 ] + #region [Disable visualy 1p specific buttons if 2p] - for (int player = 0; player < OpenTaiko.ConfigIni.nPlayerCount; player++) { - if (player >= 2) continue; + if ((_menu._1pRestricted == true && OpenTaiko.ConfigIni.nPlayerCount > 1) + || _menu.implemented == false) { + if (_bar != null) + _bar.color4 = CConversion.ColorToColor4(Color.DarkGray); + if (_chara != null) + _chara.color4 = CConversion.ColorToColor4(Color.DarkGray); + TitleTextureKey.ResolveTitleTexture(_menu.ttkBoxText, OpenTaiko.Skin.Title_VerticalText, true).color4 = CConversion.ColorToColor4(Color.DarkGray); + TitleTextureKey.ResolveTitleTexture(_menu.ttkTitle, OpenTaiko.Skin.Title_VerticalText).color4 = CConversion.ColorToColor4(Color.DarkGray); + } else { + if (_bar != null) + _bar.color4 = CConversion.ColorToColor4(Color.White); + if (_chara != null) + _chara.color4 = CConversion.ColorToColor4(Color.White); + TitleTextureKey.ResolveTitleTexture(_menu.ttkBoxText, OpenTaiko.Skin.Title_VerticalText, true).color4 = CConversion.ColorToColor4(Color.White); + TitleTextureKey.ResolveTitleTexture(_menu.ttkTitle, OpenTaiko.Skin.Title_VerticalText).color4 = CConversion.ColorToColor4(Color.White); + } - float CharaX = 0f, CharaY = 0f; + #endregion - CharaX = -200 + ((float)Math.Sin(ctキャライン.CurrentValue / 2 * (Math.PI / 180)) * 200f); - CharaY = ((float)Math.Sin((90 + (ctキャライン.CurrentValue / 2)) * (Math.PI / 180)) * 150f); - if (player == 1) CharaX *= -1; + // if (this.stModeBar[i].n現在存在している行 == 1 && ctBarMove.n現在の値 >= 150) + if (usedMenusPos[i] == 1 && ctBarMove.CurrentValue >= 150) { + float barAnimef = (ctBarMove.CurrentValue / 100.0f) - 1.5f; - int _charaId = OpenTaiko.SaveFileInstances[OpenTaiko.GetActualPlayer(player)].data.Character; + float barAnime = OpenTaiko.Skin.Title_ModeSelect_Bar_Move[0] + + (barAnimef * (OpenTaiko.Skin.Title_ModeSelect_Bar_Move[1] - OpenTaiko.Skin.Title_ModeSelect_Bar_Move[0])); - //int chara_x = (int)(TJAPlayer3.Skin.Characters_Title_Normal_X[_charaId][player] + CharaX); - //int chara_y = (int)(TJAPlayer3.Skin.Characters_Title_Normal_Y[_charaId][player] - CharaY); + float barAnimeX = OpenTaiko.Skin.Title_ModeSelect_Bar_Move_X[0] + + (barAnimef * (OpenTaiko.Skin.Title_ModeSelect_Bar_Move_X[1] - OpenTaiko.Skin.Title_ModeSelect_Bar_Move_X[0])); + float overlayAnime = OpenTaiko.Skin.Title_ModeSelect_Overlay_Move[0] + + (barAnimef * (OpenTaiko.Skin.Title_ModeSelect_Overlay_Move[1] - OpenTaiko.Skin.Title_ModeSelect_Overlay_Move[0])); - int chara_x = (int)CharaX + OpenTaiko.Skin.SongSelect_NamePlate_X[player] + OpenTaiko.Tx.NamePlateBase.szTextureSize.Width / 2; - int chara_y = OpenTaiko.Skin.SongSelect_NamePlate_Y[player] - (int)CharaY; - - int puchi_x = chara_x + OpenTaiko.Skin.Adjustments_MenuPuchichara_X[player]; - int puchi_y = chara_y + OpenTaiko.Skin.Adjustments_MenuPuchichara_Y[player]; - - //Entry_Chara_Normal[ctキャラループ.n現在の値].t2D描画(-200 + CharaX, 341 - CharaY); - CMenuCharacter.tMenuDisplayCharacter(player, chara_x, chara_y, CMenuCharacter.ECharacterAnimation.ENTRY_NORMAL); - - //int puchi_x = TJAPlayer3.Skin.Characters_Menu_X[_charaId][player] + TJAPlayer3.Skin.Adjustments_MenuPuchichara_X[player]; - //int puchi_y = TJAPlayer3.Skin.Characters_Menu_Y[_charaId][player] + TJAPlayer3.Skin.Adjustments_MenuPuchichara_Y[player]; - - this.PuchiChara.On進行描画(puchi_x, puchi_y, false, player: player); - } - - #endregion - - if (ctBarAnimeIn.CurrentValue >= (int)(16 * 16.6f)) { - // TJAPlayer3.act文字コンソール.tPrint(0, 0, C文字コンソール.Eフォント種別.白, ctBarMove.n現在の値.ToString()); - - //for (int i = 0; i < this.nbModes; i++) - for (int i = 0; i < usedMenusCount; i++) { - // Get Menu reference - CMainMenuTab _menu = CMainMenuTab.__Menus[usedMenus[i]]; - CTexture _bar = _menu.barTex; - CTexture _chara = _menu.barChara; - - #region [Disable visualy 1p specific buttons if 2p] - - if ((_menu._1pRestricted == true && OpenTaiko.ConfigIni.nPlayerCount > 1) - || _menu.implemented == false) { - if (_bar != null) - _bar.color4 = CConversion.ColorToColor4(Color.DarkGray); - if (_chara != null) - _chara.color4 = CConversion.ColorToColor4(Color.DarkGray); - TitleTextureKey.ResolveTitleTexture(_menu.ttkBoxText, OpenTaiko.Skin.Title_VerticalText, true).color4 = CConversion.ColorToColor4(Color.DarkGray); - TitleTextureKey.ResolveTitleTexture(_menu.ttkTitle, OpenTaiko.Skin.Title_VerticalText).color4 = CConversion.ColorToColor4(Color.DarkGray); - } else { - if (_bar != null) - _bar.color4 = CConversion.ColorToColor4(Color.White); - if (_chara != null) - _chara.color4 = CConversion.ColorToColor4(Color.White); - TitleTextureKey.ResolveTitleTexture(_menu.ttkBoxText, OpenTaiko.Skin.Title_VerticalText, true).color4 = CConversion.ColorToColor4(Color.White); - TitleTextureKey.ResolveTitleTexture(_menu.ttkTitle, OpenTaiko.Skin.Title_VerticalText).color4 = CConversion.ColorToColor4(Color.White); - } - - #endregion - - // if (this.stModeBar[i].n現在存在している行 == 1 && ctBarMove.n現在の値 >= 150) - if (usedMenusPos[i] == 1 && ctBarMove.CurrentValue >= 150) { - float barAnimef = (ctBarMove.CurrentValue / 100.0f) - 1.5f; - - float barAnime = OpenTaiko.Skin.Title_ModeSelect_Bar_Move[0] + - (barAnimef * (OpenTaiko.Skin.Title_ModeSelect_Bar_Move[1] - OpenTaiko.Skin.Title_ModeSelect_Bar_Move[0])); - - float barAnimeX = OpenTaiko.Skin.Title_ModeSelect_Bar_Move_X[0] + - (barAnimef * (OpenTaiko.Skin.Title_ModeSelect_Bar_Move_X[1] - OpenTaiko.Skin.Title_ModeSelect_Bar_Move_X[0])); - - float overlayAnime = OpenTaiko.Skin.Title_ModeSelect_Overlay_Move[0] + - (barAnimef * (OpenTaiko.Skin.Title_ModeSelect_Overlay_Move[1] - OpenTaiko.Skin.Title_ModeSelect_Overlay_Move[0])); - - float overlayAnimeX = OpenTaiko.Skin.Title_ModeSelect_Overlay_Move_X[0] + - (barAnimef * (OpenTaiko.Skin.Title_ModeSelect_Overlay_Move_X[1] - OpenTaiko.Skin.Title_ModeSelect_Overlay_Move_X[0])); + float overlayAnimeX = OpenTaiko.Skin.Title_ModeSelect_Overlay_Move_X[0] + + (barAnimef * (OpenTaiko.Skin.Title_ModeSelect_Overlay_Move_X[1] - OpenTaiko.Skin.Title_ModeSelect_Overlay_Move_X[0])); - //int BarAnime = ctBarAnimeIn.n現在の値 >= (int)(26 * 16.6f) + 100 ? 0 : ctBarAnimeIn.n現在の値 >= (int)(26 * 16.6f) && ctBarAnimeIn.n現在の値 <= (int)(26 * 16.6f) + 100 ? 40 + (int)((ctBarAnimeIn.n現在の値 - (26 * 16.6)) / 100f * 71f) : ctBarAnimeIn.n現在の値 < (int)(26 * 16.6f) ? 40 : 111; - //int BarAnime1 = BarAnime == 0 ? ctBarMove.n現在の値 >= 150 ? 40 + (int)((ctBarMove.n現在の値 - 150) / 100f * 71f) : ctBarMove.n現在の値 < 150 ? 40 : 111 : 0; + //int BarAnime = ctBarAnimeIn.n現在の値 >= (int)(26 * 16.6f) + 100 ? 0 : ctBarAnimeIn.n現在の値 >= (int)(26 * 16.6f) && ctBarAnimeIn.n現在の値 <= (int)(26 * 16.6f) + 100 ? 40 + (int)((ctBarAnimeIn.n現在の値 - (26 * 16.6)) / 100f * 71f) : ctBarAnimeIn.n現在の値 < (int)(26 * 16.6f) ? 40 : 111; + //int BarAnime1 = BarAnime == 0 ? ctBarMove.n現在の値 >= 150 ? 40 + (int)((ctBarMove.n現在の値 - 150) / 100f * 71f) : ctBarMove.n現在の値 < 150 ? 40 : 111 : 0; - if (_bar != null) { - _bar.Opacity = 255; - _bar.vcScaleRatio.X = 1.0f; - _bar.vcScaleRatio.Y = 1.0f; - _bar.t2D描画(OpenTaiko.Skin.Title_ModeSelect_Bar_Center_X[0] - (OpenTaiko.Skin.Title_VerticalBar ? barAnimeX : 0), - OpenTaiko.Skin.Title_ModeSelect_Bar_Center_Y[0] - (OpenTaiko.Skin.Title_VerticalBar ? 0 : barAnime), - new Rectangle(OpenTaiko.Skin.Title_ModeSelect_Bar_Center_Rect[0][0], + if (_bar != null) { + _bar.Opacity = 255; + _bar.vcScaleRatio.X = 1.0f; + _bar.vcScaleRatio.Y = 1.0f; + _bar.t2D描画(OpenTaiko.Skin.Title_ModeSelect_Bar_Center_X[0] - (OpenTaiko.Skin.Title_VerticalBar ? barAnimeX : 0), + OpenTaiko.Skin.Title_ModeSelect_Bar_Center_Y[0] - (OpenTaiko.Skin.Title_VerticalBar ? 0 : barAnime), + new Rectangle(OpenTaiko.Skin.Title_ModeSelect_Bar_Center_Rect[0][0], OpenTaiko.Skin.Title_ModeSelect_Bar_Center_Rect[0][1], OpenTaiko.Skin.Title_ModeSelect_Bar_Center_Rect[0][2], OpenTaiko.Skin.Title_ModeSelect_Bar_Center_Rect[0][3])); - _bar.t2D描画(OpenTaiko.Skin.Title_ModeSelect_Bar_Center_X[1] + (OpenTaiko.Skin.Title_VerticalBar ? barAnimeX : 0), - OpenTaiko.Skin.Title_ModeSelect_Bar_Center_Y[1] + (OpenTaiko.Skin.Title_VerticalBar ? 0 : barAnime), - new Rectangle(OpenTaiko.Skin.Title_ModeSelect_Bar_Center_Rect[1][0], + _bar.t2D描画(OpenTaiko.Skin.Title_ModeSelect_Bar_Center_X[1] + (OpenTaiko.Skin.Title_VerticalBar ? barAnimeX : 0), + OpenTaiko.Skin.Title_ModeSelect_Bar_Center_Y[1] + (OpenTaiko.Skin.Title_VerticalBar ? 0 : barAnime), + new Rectangle(OpenTaiko.Skin.Title_ModeSelect_Bar_Center_Rect[1][0], OpenTaiko.Skin.Title_ModeSelect_Bar_Center_Rect[1][1], OpenTaiko.Skin.Title_ModeSelect_Bar_Center_Rect[1][2], OpenTaiko.Skin.Title_ModeSelect_Bar_Center_Rect[1][3])); - if (OpenTaiko.Skin.Title_VerticalBar) { - _bar.vcScaleRatio.X = (barAnimeX / OpenTaiko.Skin.Title_ModeSelect_Bar_Center_Rect[2][2]) * 2.0f; - } else { - _bar.vcScaleRatio.Y = (barAnime / OpenTaiko.Skin.Title_ModeSelect_Bar_Center_Rect[2][3]) * 2.0f; - } + if (OpenTaiko.Skin.Title_VerticalBar) { + _bar.vcScaleRatio.X = (barAnimeX / OpenTaiko.Skin.Title_ModeSelect_Bar_Center_Rect[2][2]) * 2.0f; + } else { + _bar.vcScaleRatio.Y = (barAnime / OpenTaiko.Skin.Title_ModeSelect_Bar_Center_Rect[2][3]) * 2.0f; + } - _bar.t2D拡大率考慮中央基準描画(OpenTaiko.Skin.Title_ModeSelect_Bar_Center_X[2], OpenTaiko.Skin.Title_ModeSelect_Bar_Center_Y[2], - new Rectangle(OpenTaiko.Skin.Title_ModeSelect_Bar_Center_Rect[2][0], + _bar.t2D拡大率考慮中央基準描画(OpenTaiko.Skin.Title_ModeSelect_Bar_Center_X[2], OpenTaiko.Skin.Title_ModeSelect_Bar_Center_Y[2], + new Rectangle(OpenTaiko.Skin.Title_ModeSelect_Bar_Center_Rect[2][0], OpenTaiko.Skin.Title_ModeSelect_Bar_Center_Rect[2][1], OpenTaiko.Skin.Title_ModeSelect_Bar_Center_Rect[2][2], OpenTaiko.Skin.Title_ModeSelect_Bar_Center_Rect[2][3])); - } + } - if (OpenTaiko.Tx.ModeSelect_Bar[CMainMenuTab.__MenuCount] != null) { - CTexture _overlap = OpenTaiko.Tx.ModeSelect_Bar[CMainMenuTab.__MenuCount]; + if (OpenTaiko.Tx.ModeSelect_Bar[CMainMenuTab.__MenuCount] != null) { + CTexture _overlap = OpenTaiko.Tx.ModeSelect_Bar[CMainMenuTab.__MenuCount]; - _overlap.vcScaleRatio.X = 1.0f; - _overlap.vcScaleRatio.Y = 1.0f; - _overlap.t2D描画(OpenTaiko.Skin.Title_ModeSelect_Bar_Overlay_X[0], OpenTaiko.Skin.Title_ModeSelect_Bar_Overlay_Y[0], - new Rectangle(OpenTaiko.Skin.Title_ModeSelect_Bar_Overlay_Rect[0][0], + _overlap.vcScaleRatio.X = 1.0f; + _overlap.vcScaleRatio.Y = 1.0f; + _overlap.t2D描画(OpenTaiko.Skin.Title_ModeSelect_Bar_Overlay_X[0], OpenTaiko.Skin.Title_ModeSelect_Bar_Overlay_Y[0], + new Rectangle(OpenTaiko.Skin.Title_ModeSelect_Bar_Overlay_Rect[0][0], OpenTaiko.Skin.Title_ModeSelect_Bar_Overlay_Rect[0][1], OpenTaiko.Skin.Title_ModeSelect_Bar_Overlay_Rect[0][2], OpenTaiko.Skin.Title_ModeSelect_Bar_Overlay_Rect[0][3])); - _overlap.t2D描画(OpenTaiko.Skin.Title_ModeSelect_Bar_Overlay_X[1] + (OpenTaiko.Skin.Title_VerticalBar ? overlayAnimeX : 0), - OpenTaiko.Skin.Title_ModeSelect_Bar_Overlay_Y[1] + (OpenTaiko.Skin.Title_VerticalBar ? 0 : overlayAnime), - new Rectangle(OpenTaiko.Skin.Title_ModeSelect_Bar_Overlay_Rect[1][0], + _overlap.t2D描画(OpenTaiko.Skin.Title_ModeSelect_Bar_Overlay_X[1] + (OpenTaiko.Skin.Title_VerticalBar ? overlayAnimeX : 0), + OpenTaiko.Skin.Title_ModeSelect_Bar_Overlay_Y[1] + (OpenTaiko.Skin.Title_VerticalBar ? 0 : overlayAnime), + new Rectangle(OpenTaiko.Skin.Title_ModeSelect_Bar_Overlay_Rect[1][0], OpenTaiko.Skin.Title_ModeSelect_Bar_Overlay_Rect[1][1], OpenTaiko.Skin.Title_ModeSelect_Bar_Overlay_Rect[1][2], OpenTaiko.Skin.Title_ModeSelect_Bar_Overlay_Rect[1][3])); - if (OpenTaiko.Skin.Title_VerticalBar) { - _overlap.vcScaleRatio.X = (overlayAnimeX / OpenTaiko.Skin.Title_ModeSelect_Bar_Overlay_Rect[2][2]); - } else { - _overlap.vcScaleRatio.Y = (overlayAnime / OpenTaiko.Skin.Title_ModeSelect_Bar_Overlay_Rect[2][3]); - } + if (OpenTaiko.Skin.Title_VerticalBar) { + _overlap.vcScaleRatio.X = (overlayAnimeX / OpenTaiko.Skin.Title_ModeSelect_Bar_Overlay_Rect[2][2]); + } else { + _overlap.vcScaleRatio.Y = (overlayAnime / OpenTaiko.Skin.Title_ModeSelect_Bar_Overlay_Rect[2][3]); + } - _overlap.t2D拡大率考慮上中央基準描画(OpenTaiko.Skin.Title_ModeSelect_Bar_Overlay_X[2], OpenTaiko.Skin.Title_ModeSelect_Bar_Overlay_Y[2], - new Rectangle(OpenTaiko.Skin.Title_ModeSelect_Bar_Overlay_Rect[2][0], + _overlap.t2D拡大率考慮上中央基準描画(OpenTaiko.Skin.Title_ModeSelect_Bar_Overlay_X[2], OpenTaiko.Skin.Title_ModeSelect_Bar_Overlay_Y[2], + new Rectangle(OpenTaiko.Skin.Title_ModeSelect_Bar_Overlay_Rect[2][0], OpenTaiko.Skin.Title_ModeSelect_Bar_Overlay_Rect[2][1], OpenTaiko.Skin.Title_ModeSelect_Bar_Overlay_Rect[2][2], OpenTaiko.Skin.Title_ModeSelect_Bar_Overlay_Rect[2][3])); - } - - - float anime = 0; - float BarAnimeCount = (this.ctBarMove.CurrentValue - 150) / 100.0f; - - if (BarAnimeCount <= 0.45) - anime = BarAnimeCount * 3.333333333f; - else - anime = 1.50f - (BarAnimeCount - 0.45f) * 0.61764705f; - anime *= OpenTaiko.Skin.Title_ModeSelect_Bar_Chara_Move; - - if (_chara != null) { - _chara.Opacity = (int)(BarAnimeCount * 255f) + (int)(barAnimef * 2.5f); - _chara.t2D中心基準描画(OpenTaiko.Skin.Title_ModeSelect_Bar_Chara_X[0] - anime, OpenTaiko.Skin.Title_ModeSelect_Bar_Chara_Y[0], - new Rectangle(0, 0, _chara.szTextureSize.Width / 2, _chara.szTextureSize.Height)); - _chara.t2D中心基準描画(OpenTaiko.Skin.Title_ModeSelect_Bar_Chara_X[1] + anime, OpenTaiko.Skin.Title_ModeSelect_Bar_Chara_Y[1], - new Rectangle(_chara.szTextureSize.Width / 2, 0, _chara.szTextureSize.Width / 2, _chara.szTextureSize.Height)); - } - - TitleTextureKey.ResolveTitleTexture(_menu.ttkTitle, OpenTaiko.Skin.Title_VerticalText)?.t2D中心基準描画( - OpenTaiko.Skin.Title_ModeSelect_Bar_Center_Title[0] + (OpenTaiko.Skin.Title_ModeSelect_Bar_Center_Title_Move_X * BarAnimeCount), - OpenTaiko.Skin.Title_ModeSelect_Bar_Center_Title[1] - (OpenTaiko.Skin.Title_ModeSelect_Bar_Center_Title_Move * BarAnimeCount)); - - CTexture currentText = TitleTextureKey.ResolveTitleTexture(_menu.ttkBoxText, OpenTaiko.Skin.Title_VerticalText, true); - if (currentText != null) { - currentText.Opacity = (int)(BarAnimeCount * 255f); - currentText?.t2D中心基準描画(OpenTaiko.Skin.Title_ModeSelect_Bar_Center_BoxText[0], OpenTaiko.Skin.Title_ModeSelect_Bar_Center_BoxText[1]); - } - - } else { - int BarAnimeY = ctBarAnimeIn.CurrentValue >= (int)(26 * 16.6f) + 100 && ctBarAnimeIn.CurrentValue <= (int)(26 * 16.6f) + 299 ? 600 - (ctBarAnimeIn.CurrentValue - (int)(26 * 16.6f + 100)) * 3 : ctBarAnimeIn.CurrentValue >= (int)(26 * 16.6f) + 100 ? 0 : 600; - int BarAnimeX = ctBarAnimeIn.CurrentValue >= (int)(26 * 16.6f) + 100 && ctBarAnimeIn.CurrentValue <= (int)(26 * 16.6f) + 299 ? 100 - (int)((ctBarAnimeIn.CurrentValue - (int)(26 * 16.6f + 100)) * 0.5f) : ctBarAnimeIn.CurrentValue >= (int)(26 * 16.6f) + 100 ? 0 : 100; - - int BarMoveX = 0; - int BarMoveY = 0; - - #region [Position precalculation] - - //int CurrentPos = this.stModeBar[i].n現在存在している行; - int CurrentPos = usedMenusPos[i]; - int Selected; - - if (this.bDownPushed) - Selected = CurrentPos + 1; - else - Selected = CurrentPos - 1; - - Point pos = this.getFixedPositionForBar(CurrentPos); - Point posSelect = this.getFixedPositionForBar(Selected); - - #endregion - - BarMoveX = ctBarMove.CurrentValue <= 100 ? (int)(pos.X - posSelect.X) - (int)(ctBarMove.CurrentValue / 100f * (pos.X - posSelect.X)) : 0; - BarMoveY = ctBarMove.CurrentValue <= 100 ? (int)(pos.Y - posSelect.Y) - (int)(ctBarMove.CurrentValue / 100f * (pos.Y - posSelect.Y)) : 0; - - - if (_bar != null) { - _bar.vcScaleRatio.X = 1.0f; - _bar.vcScaleRatio.Y = 1.0f; - _bar.t2D描画(pos.X + BarAnimeX - BarMoveX, pos.Y + BarAnimeY - BarMoveY); - } - - if (OpenTaiko.Tx.ModeSelect_Bar[CMainMenuTab.__MenuCount] != null) { - CTexture _overlap = OpenTaiko.Tx.ModeSelect_Bar[CMainMenuTab.__MenuCount]; - - _overlap.vcScaleRatio.X = 1.0f; - _overlap.vcScaleRatio.Y = 1.0f; - _overlap.t2D描画(pos.X + BarAnimeX - BarMoveX, pos.Y + BarAnimeY - BarMoveY); - } - - - - TitleTextureKey.ResolveTitleTexture(_menu.ttkTitle, OpenTaiko.Skin.Title_VerticalText)?.t2D中心基準描画(pos.X + BarAnimeX - BarMoveX + OpenTaiko.Skin.Title_ModeSelect_Title_Offset[0], pos.Y + BarAnimeY - BarMoveY + OpenTaiko.Skin.Title_ModeSelect_Title_Offset[1]); } + + + float anime = 0; + float BarAnimeCount = (this.ctBarMove.CurrentValue - 150) / 100.0f; + + if (BarAnimeCount <= 0.45) + anime = BarAnimeCount * 3.333333333f; + else + anime = 1.50f - (BarAnimeCount - 0.45f) * 0.61764705f; + anime *= OpenTaiko.Skin.Title_ModeSelect_Bar_Chara_Move; + + if (_chara != null) { + _chara.Opacity = (int)(BarAnimeCount * 255f) + (int)(barAnimef * 2.5f); + _chara.t2D中心基準描画(OpenTaiko.Skin.Title_ModeSelect_Bar_Chara_X[0] - anime, OpenTaiko.Skin.Title_ModeSelect_Bar_Chara_Y[0], + new Rectangle(0, 0, _chara.szTextureSize.Width / 2, _chara.szTextureSize.Height)); + _chara.t2D中心基準描画(OpenTaiko.Skin.Title_ModeSelect_Bar_Chara_X[1] + anime, OpenTaiko.Skin.Title_ModeSelect_Bar_Chara_Y[1], + new Rectangle(_chara.szTextureSize.Width / 2, 0, _chara.szTextureSize.Width / 2, _chara.szTextureSize.Height)); + } + + TitleTextureKey.ResolveTitleTexture(_menu.ttkTitle, OpenTaiko.Skin.Title_VerticalText)?.t2D中心基準描画( + OpenTaiko.Skin.Title_ModeSelect_Bar_Center_Title[0] + (OpenTaiko.Skin.Title_ModeSelect_Bar_Center_Title_Move_X * BarAnimeCount), + OpenTaiko.Skin.Title_ModeSelect_Bar_Center_Title[1] - (OpenTaiko.Skin.Title_ModeSelect_Bar_Center_Title_Move * BarAnimeCount)); + + CTexture currentText = TitleTextureKey.ResolveTitleTexture(_menu.ttkBoxText, OpenTaiko.Skin.Title_VerticalText, true); + if (currentText != null) { + currentText.Opacity = (int)(BarAnimeCount * 255f); + currentText?.t2D中心基準描画(OpenTaiko.Skin.Title_ModeSelect_Bar_Center_BoxText[0], OpenTaiko.Skin.Title_ModeSelect_Bar_Center_BoxText[1]); + } + + } else { + int BarAnimeY = ctBarAnimeIn.CurrentValue >= (int)(26 * 16.6f) + 100 && ctBarAnimeIn.CurrentValue <= (int)(26 * 16.6f) + 299 ? 600 - (ctBarAnimeIn.CurrentValue - (int)(26 * 16.6f + 100)) * 3 : ctBarAnimeIn.CurrentValue >= (int)(26 * 16.6f) + 100 ? 0 : 600; + int BarAnimeX = ctBarAnimeIn.CurrentValue >= (int)(26 * 16.6f) + 100 && ctBarAnimeIn.CurrentValue <= (int)(26 * 16.6f) + 299 ? 100 - (int)((ctBarAnimeIn.CurrentValue - (int)(26 * 16.6f + 100)) * 0.5f) : ctBarAnimeIn.CurrentValue >= (int)(26 * 16.6f) + 100 ? 0 : 100; + + int BarMoveX = 0; + int BarMoveY = 0; + + #region [Position precalculation] + + //int CurrentPos = this.stModeBar[i].n現在存在している行; + int CurrentPos = usedMenusPos[i]; + int Selected; + + if (this.bDownPushed) + Selected = CurrentPos + 1; + else + Selected = CurrentPos - 1; + + Point pos = this.getFixedPositionForBar(CurrentPos); + Point posSelect = this.getFixedPositionForBar(Selected); + + #endregion + + BarMoveX = ctBarMove.CurrentValue <= 100 ? (int)(pos.X - posSelect.X) - (int)(ctBarMove.CurrentValue / 100f * (pos.X - posSelect.X)) : 0; + BarMoveY = ctBarMove.CurrentValue <= 100 ? (int)(pos.Y - posSelect.Y) - (int)(ctBarMove.CurrentValue / 100f * (pos.Y - posSelect.Y)) : 0; + + + if (_bar != null) { + _bar.vcScaleRatio.X = 1.0f; + _bar.vcScaleRatio.Y = 1.0f; + _bar.t2D描画(pos.X + BarAnimeX - BarMoveX, pos.Y + BarAnimeY - BarMoveY); + } + + if (OpenTaiko.Tx.ModeSelect_Bar[CMainMenuTab.__MenuCount] != null) { + CTexture _overlap = OpenTaiko.Tx.ModeSelect_Bar[CMainMenuTab.__MenuCount]; + + _overlap.vcScaleRatio.X = 1.0f; + _overlap.vcScaleRatio.Y = 1.0f; + _overlap.t2D描画(pos.X + BarAnimeX - BarMoveX, pos.Y + BarAnimeY - BarMoveY); + } + + + + TitleTextureKey.ResolveTitleTexture(_menu.ttkTitle, OpenTaiko.Skin.Title_VerticalText)?.t2D中心基準描画(pos.X + BarAnimeX - BarMoveX + OpenTaiko.Skin.Title_ModeSelect_Title_Offset[0], pos.Y + BarAnimeY - BarMoveY + OpenTaiko.Skin.Title_ModeSelect_Title_Offset[1]); } } - - for (int player = 0; player < OpenTaiko.ConfigIni.nPlayerCount; player++) { - if (player >= 2) continue; - - OpenTaiko.NamePlate.tNamePlateDraw(OpenTaiko.Skin.SongSelect_NamePlate_X[player], OpenTaiko.Skin.SongSelect_NamePlate_Y[player], player, false, 255); - } } - #endregion + for (int player = 0; player < OpenTaiko.ConfigIni.nPlayerCount; player++) { + if (player >= 2) continue; - #region[ バージョン表示 ] + OpenTaiko.NamePlate.tNamePlateDraw(OpenTaiko.Skin.SongSelect_NamePlate_X[player], OpenTaiko.Skin.SongSelect_NamePlate_Y[player], player, false, 255); + } + } + + #endregion + + #region[ バージョン表示 ] #if DEBUG - //string strVersion = "KTT:J:A:I:2017072200"; - string strCreator = "https://github.com/0AuBSQ/OpenTaiko"; - AssemblyName asmApp = Assembly.GetExecutingAssembly().GetName(); - OpenTaiko.actTextConsole.Print(4, 44, CTextConsole.EFontType.White, "DEBUG BUILD"); - OpenTaiko.actTextConsole.Print(4, 4, CTextConsole.EFontType.White, asmApp.Name + " Ver." + OpenTaiko.VERSION + " (" + strCreator + ")"); - OpenTaiko.actTextConsole.Print(4, 24, CTextConsole.EFontType.White, "Skin:" + OpenTaiko.Skin.Skin_Name + " Ver." + OpenTaiko.Skin.Skin_Version + " (" + OpenTaiko.Skin.Skin_Creator + ")"); - //CDTXMania.act文字コンソール.tPrint(4, 24, C文字コンソール.Eフォント種別.白, strSubTitle); - OpenTaiko.actTextConsole.Print(4, (OpenTaiko.Skin.Resolution[1] - 24), CTextConsole.EFontType.White, "TJAPlayer3 forked TJAPlayer2 forPC(kairera0467)"); + //string strVersion = "KTT:J:A:I:2017072200"; + string strCreator = "https://github.com/0AuBSQ/OpenTaiko"; + AssemblyName asmApp = Assembly.GetExecutingAssembly().GetName(); + OpenTaiko.actTextConsole.Print(4, 44, CTextConsole.EFontType.White, "DEBUG BUILD"); + OpenTaiko.actTextConsole.Print(4, 4, CTextConsole.EFontType.White, asmApp.Name + " Ver." + OpenTaiko.VERSION + " (" + strCreator + ")"); + OpenTaiko.actTextConsole.Print(4, 24, CTextConsole.EFontType.White, "Skin:" + OpenTaiko.Skin.Skin_Name + " Ver." + OpenTaiko.Skin.Skin_Version + " (" + OpenTaiko.Skin.Skin_Creator + ")"); + //CDTXMania.act文字コンソール.tPrint(4, 24, C文字コンソール.Eフォント種別.白, strSubTitle); + OpenTaiko.actTextConsole.Print(4, (OpenTaiko.Skin.Resolution[1] - 24), CTextConsole.EFontType.White, "TJAPlayer3 forked TJAPlayer2 forPC(kairera0467)"); #endif - //TJAPlayer3.actTextConsole.tPrint(4, 64, CTextConsole.EFontType.White, CScoreIni_Importer.Status); - #endregion + //TJAPlayer3.actTextConsole.tPrint(4, 64, CTextConsole.EFontType.White, CScoreIni_Importer.Status); + #endregion - CStage.EPhase eフェーズid = base.ePhaseID; - switch (eフェーズid) { - case CStage.EPhase.Common_FADEIN: - if (this.actFI.Draw() != 0) { - base.ePhaseID = CStage.EPhase.Common_NORMAL; - } + CStage.EPhase eフェーズid = base.ePhaseID; + switch (eフェーズid) { + case CStage.EPhase.Common_FADEIN: + if (this.actFI.Draw() != 0) { + base.ePhaseID = CStage.EPhase.Common_NORMAL; + } + break; + + case CStage.EPhase.Common_FADEOUT: + if (this.actFO.Draw() == 0) { + OpenTaiko.Skin.bgmタイトル.tStop(); + OpenTaiko.Skin.bgmタイトルイン.tStop(); break; - - case CStage.EPhase.Common_FADEOUT: - if (this.actFO.Draw() == 0) { - OpenTaiko.Skin.bgmタイトル.tStop(); - OpenTaiko.Skin.bgmタイトルイン.tStop(); - break; - } - base.ePhaseID = CStage.EPhase.Common_EXIT; + } + base.ePhaseID = CStage.EPhase.Common_EXIT; - // Select Menu here + // Select Menu here - return ((int)CMainMenuTab.__Menus[usedMenus[this.n現在の選択行モード選択]].rp); + return ((int)CMainMenuTab.__Menus[usedMenus[this.n現在の選択行モード選択]].rp); - case CStage.EPhase.Title_FadeIn: - if (this.actFIfromSetup.Draw() != 0) { - base.ePhaseID = CStage.EPhase.Common_NORMAL; - } - break; - } - } - return 0; - } - public enum E戻り値 { - 継続 = 0, - GAMESTART, - DANGAMESTART, - TAIKOTOWERSSTART, - SHOPSTART, - BOUKENSTART, - HEYA, - CONFIG, - EXIT, - ONLINELOUNGE, - ENCYCLOPEDIA, - AIBATTLEMODE, - PLAYERSTATS, - CHARTEDITOR, - TOOLBOX, - } - - - // その他 - - #region [ private ] - //----------------- - - private ScriptBG Background; - - // Directly propose the different game options if the save file is already loaded, go back to save file select by pressing "Escape" - private void SkipSaveFileStep() { - if (bSaveFileLoaded == true) { - bモード選択 = true; - // bプレイヤーエントリー = true; - bSaveIsLoading = true; - bプレイヤーエントリー決定 = true; - bキャラカウンター初期化 = true; - - this.ctSaveLoading.Start(0, 600, 1, OpenTaiko.Timer); - this.ctSaveLoading.CurrentValue = (int)this.ctSaveLoading.EndValue; - ctエントリーバー決定点滅.Start(0, 1055, 1, OpenTaiko.Timer); - ctエントリーバー決定点滅.CurrentValue = (int)ctエントリーバー決定点滅.CurrentValue; - ctSaveLoaded.Start(0, 3655, 1, OpenTaiko.Timer); - ctSaveLoaded.CurrentValue = (int)ctSaveLoaded.EndValue; - - ctキャライン.Start(0, 180, 2, OpenTaiko.Timer); - ctBarAnimeIn.Start(0, 1295, 1, OpenTaiko.Timer); - - ctコインイン待機.CurrentValue = (int)ctコインイン待機.EndValue; - ctエントリーバー点滅.CurrentValue = (int)ctエントリーバー点滅.EndValue; - - OpenTaiko.Skin.SoundBanapas.bPlayed = true; - //TJAPlayer3.Skin.soundsanka.bPlayed = true; - - if (OpenTaiko.Skin.voiceTitleSanka[OpenTaiko.SaveFile] != null) - OpenTaiko.Skin.voiceTitleSanka[OpenTaiko.SaveFile].bPlayed = true; + case CStage.EPhase.Title_FadeIn: + if (this.actFIfromSetup.Draw() != 0) { + base.ePhaseID = CStage.EPhase.Common_NORMAL; + } + break; } } - - // Restore the title screen to the "Taiko hit start" screen - private void UnloadSaveFile() { - this.ctSaveLoading = new CCounter(); - this.ctコインイン待機 = new CCounter(0, 2000, 1, OpenTaiko.Timer); - this.ctSaveLoaded = new CCounter(); - this.ctSaveLoadingFailed = new CCounter(); - this.ctエントリーバー点滅 = new CCounter(0, 510, 2, OpenTaiko.Timer); - this.ctエントリーバー決定点滅 = new CCounter(); - - //this.ctキャラエントリーループ = new CCounter(); - CMenuCharacter.tMenuResetTimer(CMenuCharacter.ECharacterAnimation.ENTRY); - this.ctキャライン = new CCounter(); - //this.ctキャラループ = new CCounter(0, Entry_Chara_Normal.Length - 1, 1000 / 30, TJAPlayer3.Timer); - CMenuCharacter.tMenuResetTimer(CMenuCharacter.ECharacterAnimation.ENTRY_NORMAL); - - - this.ctBarAnimeIn = new CCounter(); - this.ctBarMove = new CCounter(); - this.ctBarMove.CurrentValue = 250; - - this.bSaveIsLoading = false; - this.bSaveFailedToLoad = false; - this.bプレイヤーエントリー = false; - this.bプレイヤーエントリー決定 = false; - this.bモード選択 = false; - this.bキャラカウンター初期化 = false; - this.n現在の選択行プレイヤーエントリー = 1; - - OpenTaiko.Skin.SoundBanapas.bPlayed = false; - } - - private static bool bSaveFileLoaded = false; - - private CCounter ctコインイン待機; - - private CCounter ctSaveLoading; - - private CCounter ctSaveLoaded; - private CCounter ctSaveLoadingFailed; - - private CCounter ctエントリーバー点滅; - private CCounter ctエントリーバー決定点滅; - - //private CCounter ctキャラエントリーループ; - private CCounter ctキャライン; - //private CCounter ctキャラループ; - - private CCounter ctBarAnimeIn; - private CCounter ctBarMove; - - private bool bDownPushed; - - private PuchiChara PuchiChara; - - internal CCachedFontRenderer pfMenuTitle; - internal CCachedFontRenderer pfBoxText; - - private int[] usedMenus; - private int[] usedMenusPos; - private int usedMenusCount; - - private bool bSaveIsLoading; - private bool bSaveFailedToLoad; - private bool bプレイヤーエントリー; - private bool bプレイヤーエントリー決定; - private bool bモード選択; - private bool bキャラカウンター初期化; - - private int n現在の選択行プレイヤーエントリー; - private int n現在の選択行モード選択; - - /*private Point[] ptプレイヤーエントリーバー座標 = - { new Point(337, 488), new Point( 529, 487), new Point(743, 486) }; - - private Point[] ptモード選択バー座標 = - { new Point(290, 107), new Point(319, 306), new Point(356, 513) };*/ - - private Point getFixedPositionForBar(int CurrentPos) { - int posX; - int posY; - - if (CurrentPos >= 0 && CurrentPos < 3) { - posX = OpenTaiko.Skin.Title_ModeSelect_Bar_X[CurrentPos]; - posY = OpenTaiko.Skin.Title_ModeSelect_Bar_Y[CurrentPos]; - } else if (CurrentPos < 0) { - posX = OpenTaiko.Skin.Title_ModeSelect_Bar_X[0] + CurrentPos * OpenTaiko.Skin.Title_ModeSelect_Bar_Offset[0]; - posY = OpenTaiko.Skin.Title_ModeSelect_Bar_Y[0] + CurrentPos * OpenTaiko.Skin.Title_ModeSelect_Bar_Offset[1]; - } else { - posX = OpenTaiko.Skin.Title_ModeSelect_Bar_X[2] + (CurrentPos - 2) * OpenTaiko.Skin.Title_ModeSelect_Bar_Offset[0]; - posY = OpenTaiko.Skin.Title_ModeSelect_Bar_Y[2] + (CurrentPos - 2) * OpenTaiko.Skin.Title_ModeSelect_Bar_Offset[1]; - } - - return new Point(posX, posY); - } - - private bool b音声再生; - private CActFIFOBlack actFI; - private CActFIFOBlack actFIfromSetup; - private CActFIFOBlack actFO; - //----------------- - #endregion + return 0; } + public enum E戻り値 { + 継続 = 0, + GAMESTART, + DANGAMESTART, + TAIKOTOWERSSTART, + SHOPSTART, + BOUKENSTART, + HEYA, + CONFIG, + EXIT, + ONLINELOUNGE, + ENCYCLOPEDIA, + AIBATTLEMODE, + PLAYERSTATS, + CHARTEDITOR, + TOOLBOX, + } + + + // その他 + + #region [ private ] + //----------------- + + private ScriptBG Background; + + // Directly propose the different game options if the save file is already loaded, go back to save file select by pressing "Escape" + private void SkipSaveFileStep() { + if (bSaveFileLoaded == true) { + bモード選択 = true; + // bプレイヤーエントリー = true; + bSaveIsLoading = true; + bプレイヤーエントリー決定 = true; + bキャラカウンター初期化 = true; + + this.ctSaveLoading.Start(0, 600, 1, OpenTaiko.Timer); + this.ctSaveLoading.CurrentValue = (int)this.ctSaveLoading.EndValue; + ctエントリーバー決定点滅.Start(0, 1055, 1, OpenTaiko.Timer); + ctエントリーバー決定点滅.CurrentValue = (int)ctエントリーバー決定点滅.CurrentValue; + ctSaveLoaded.Start(0, 3655, 1, OpenTaiko.Timer); + ctSaveLoaded.CurrentValue = (int)ctSaveLoaded.EndValue; + + ctキャライン.Start(0, 180, 2, OpenTaiko.Timer); + ctBarAnimeIn.Start(0, 1295, 1, OpenTaiko.Timer); + + ctコインイン待機.CurrentValue = (int)ctコインイン待機.EndValue; + ctエントリーバー点滅.CurrentValue = (int)ctエントリーバー点滅.EndValue; + + OpenTaiko.Skin.SoundBanapas.bPlayed = true; + //TJAPlayer3.Skin.soundsanka.bPlayed = true; + + if (OpenTaiko.Skin.voiceTitleSanka[OpenTaiko.SaveFile] != null) + OpenTaiko.Skin.voiceTitleSanka[OpenTaiko.SaveFile].bPlayed = true; + } + } + + // Restore the title screen to the "Taiko hit start" screen + private void UnloadSaveFile() { + this.ctSaveLoading = new CCounter(); + this.ctコインイン待機 = new CCounter(0, 2000, 1, OpenTaiko.Timer); + this.ctSaveLoaded = new CCounter(); + this.ctSaveLoadingFailed = new CCounter(); + this.ctエントリーバー点滅 = new CCounter(0, 510, 2, OpenTaiko.Timer); + this.ctエントリーバー決定点滅 = new CCounter(); + + //this.ctキャラエントリーループ = new CCounter(); + CMenuCharacter.tMenuResetTimer(CMenuCharacter.ECharacterAnimation.ENTRY); + this.ctキャライン = new CCounter(); + //this.ctキャラループ = new CCounter(0, Entry_Chara_Normal.Length - 1, 1000 / 30, TJAPlayer3.Timer); + CMenuCharacter.tMenuResetTimer(CMenuCharacter.ECharacterAnimation.ENTRY_NORMAL); + + + this.ctBarAnimeIn = new CCounter(); + this.ctBarMove = new CCounter(); + this.ctBarMove.CurrentValue = 250; + + this.bSaveIsLoading = false; + this.bSaveFailedToLoad = false; + this.bプレイヤーエントリー = false; + this.bプレイヤーエントリー決定 = false; + this.bモード選択 = false; + this.bキャラカウンター初期化 = false; + this.n現在の選択行プレイヤーエントリー = 1; + + OpenTaiko.Skin.SoundBanapas.bPlayed = false; + } + + private static bool bSaveFileLoaded = false; + + private CCounter ctコインイン待機; + + private CCounter ctSaveLoading; + + private CCounter ctSaveLoaded; + private CCounter ctSaveLoadingFailed; + + private CCounter ctエントリーバー点滅; + private CCounter ctエントリーバー決定点滅; + + //private CCounter ctキャラエントリーループ; + private CCounter ctキャライン; + //private CCounter ctキャラループ; + + private CCounter ctBarAnimeIn; + private CCounter ctBarMove; + + private bool bDownPushed; + + private PuchiChara PuchiChara; + + internal CCachedFontRenderer pfMenuTitle; + internal CCachedFontRenderer pfBoxText; + + private int[] usedMenus; + private int[] usedMenusPos; + private int usedMenusCount; + + private bool bSaveIsLoading; + private bool bSaveFailedToLoad; + private bool bプレイヤーエントリー; + private bool bプレイヤーエントリー決定; + private bool bモード選択; + private bool bキャラカウンター初期化; + + private int n現在の選択行プレイヤーエントリー; + private int n現在の選択行モード選択; + + /*private Point[] ptプレイヤーエントリーバー座標 = + { new Point(337, 488), new Point( 529, 487), new Point(743, 486) }; + + private Point[] ptモード選択バー座標 = + { new Point(290, 107), new Point(319, 306), new Point(356, 513) };*/ + + private Point getFixedPositionForBar(int CurrentPos) { + int posX; + int posY; + + if (CurrentPos >= 0 && CurrentPos < 3) { + posX = OpenTaiko.Skin.Title_ModeSelect_Bar_X[CurrentPos]; + posY = OpenTaiko.Skin.Title_ModeSelect_Bar_Y[CurrentPos]; + } else if (CurrentPos < 0) { + posX = OpenTaiko.Skin.Title_ModeSelect_Bar_X[0] + CurrentPos * OpenTaiko.Skin.Title_ModeSelect_Bar_Offset[0]; + posY = OpenTaiko.Skin.Title_ModeSelect_Bar_Y[0] + CurrentPos * OpenTaiko.Skin.Title_ModeSelect_Bar_Offset[1]; + } else { + posX = OpenTaiko.Skin.Title_ModeSelect_Bar_X[2] + (CurrentPos - 2) * OpenTaiko.Skin.Title_ModeSelect_Bar_Offset[0]; + posY = OpenTaiko.Skin.Title_ModeSelect_Bar_Y[2] + (CurrentPos - 2) * OpenTaiko.Skin.Title_ModeSelect_Bar_Offset[1]; + } + + return new Point(posX, posY); + } + + private bool b音声再生; + private CActFIFOBlack actFI; + private CActFIFOBlack actFIfromSetup; + private CActFIFOBlack actFO; + //----------------- + #endregion } diff --git a/OpenTaiko/src/Stages/04.Config/CActCalibrationMode.cs b/OpenTaiko/src/Stages/04.Config/CActCalibrationMode.cs index 6d598692..2937b7c4 100644 --- a/OpenTaiko/src/Stages/04.Config/CActCalibrationMode.cs +++ b/OpenTaiko/src/Stages/04.Config/CActCalibrationMode.cs @@ -1,200 +1,200 @@ using System.Drawing; using FDK; -namespace OpenTaiko { - internal class CActCalibrationMode : CActivity { - public CActCalibrationMode() { } +namespace OpenTaiko; - public override void Activate() { - //hitSound = TJAPlayer3.SoundManager.tCreateSound($@"Global{Path.DirectorySeparatorChar}HitSounds{Path.DirectorySeparatorChar}" + TJAPlayer3.Skin.hsHitSoundsInformations.don[0], ESoundGroup.SoundEffect); - font = HPrivateFastFont.tInstantiateMainFont(30); - base.Activate(); - } +internal class CActCalibrationMode : CActivity { + public CActCalibrationMode() { } - public override void DeActivate() { - Stop(); - Offsets.Clear(); - font?.Dispose(); - offsettext?.Dispose(); - //hitSound?.tDispose(); - - base.DeActivate(); - } - - public void Start() { - CalibrateTick = new CCounter(0, 500, 1, OpenTaiko.Timer); - UpdateText(); - } - - public void Stop() { - CalibrateTick = new CCounter(); - Offsets.Clear(); - LastOffset = 0; - buttonIndex = 1; - } - - public int Update() { - if (IsDeActivated || CalibrateTick.IsStoped) - return 1; - - CalibrateTick.Tick(); - - bool decide = OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.Decide) || - OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.RRed) || - OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.LRed) || - OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Return); - - if (CalibrateTick.IsEnded) { - OpenTaiko.Skin.calibrationTick.tPlay(); - CalibrateTick.Start(0, 500, 1, OpenTaiko.Timer); - } - - if (OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.LeftChange) || - OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.LBlue) || - OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.LeftArrow)) { - buttonIndex = Math.Max(buttonIndex - 1, 0); - OpenTaiko.Skin.soundChangeSFX.tPlay(); - } else if (OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.RightChange) || - OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.RBlue) || - OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.RightArrow)) { - buttonIndex = Math.Min(buttonIndex + 1, 2); - OpenTaiko.Skin.soundChangeSFX.tPlay(); - } else if (buttonIndex == 0 && decide) // Cancel - { - OpenTaiko.Skin.soundCancelSFX.tPlay(); - Stop(); - } else if (buttonIndex == 1 && decide) // Hit! - { - //hitSound?.PlayStart(); - AddOffset(); - UpdateText(); - } else if (buttonIndex == 2 && decide) // Save - { - OpenTaiko.ConfigIni.nGlobalOffsetMs = GetMedianOffset(); - OpenTaiko.stageコンフィグ.actList.iGlobalOffsetMs.n現在の値 = GetMedianOffset(); - OpenTaiko.Skin.soundDecideSFX.tPlay(); - Stop(); - - return 0; - } else if (OpenTaiko.ConfigIni.KeyAssign.KeyIsPressed(OpenTaiko.ConfigIni.KeyAssign.System.Cancel) || - OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Escape)) { - OpenTaiko.Skin.soundCancelSFX.tPlay(); - Stop(); - - return 0; - } - - return 0; - } - - public override int Draw() { - if (IsDeActivated || CalibrateTick.IsStoped) - return 1; - - if (OpenTaiko.Tx.Tile_Black != null) { - OpenTaiko.Tx.Tile_Black.Opacity = 128; - for (int i = 0; i <= SampleFramework.GameWindowSize.Width; i += OpenTaiko.Tx.Tile_Black.szTextureSize.Width) { - for (int j = 0; j <= SampleFramework.GameWindowSize.Height; j += OpenTaiko.Tx.Tile_Black.szTextureSize.Height) { - OpenTaiko.Tx.Tile_Black.t2D描画(i, j); - } - } - OpenTaiko.Tx.Tile_Black.Opacity = 255; - } - - OpenTaiko.Tx.CalibrateBG?.t2D描画(OpenTaiko.Skin.Config_Calibration_Highlights[buttonIndex].X, - OpenTaiko.Skin.Config_Calibration_Highlights[buttonIndex].Y, - OpenTaiko.Skin.Config_Calibration_Highlights[buttonIndex]); - OpenTaiko.Tx.CalibrateFG?.t2D描画(0, 0); - - OpenTaiko.Tx.Lane_Background_Main?.t2D描画(OpenTaiko.Skin.Game_Lane_X[0], OpenTaiko.Skin.Game_Lane_Y[0]); - OpenTaiko.Tx.Lane_Background_Sub?.t2D描画(OpenTaiko.Skin.Game_Lane_Sub_X[0], OpenTaiko.Skin.Game_Lane_Sub_Y[0]); - OpenTaiko.Tx.Taiko_Frame[2]?.t2D描画(OpenTaiko.Skin.Game_Taiko_Frame_X[0], OpenTaiko.Skin.Game_Taiko_Frame_Y[0]); - - OpenTaiko.Tx.Notes[0]?.t2D描画(OpenTaiko.Skin.nScrollFieldX[0], OpenTaiko.Skin.nScrollFieldY[0], new RectangleF(0, 0, OpenTaiko.Skin.Game_Notes_Size[0], OpenTaiko.Skin.Game_Notes_Size[1])); - - for (int x = OpenTaiko.Skin.nScrollFieldX[0]; x < SampleFramework.GameWindowSize.Width + 500; x += 500) { - OpenTaiko.Tx.Bar?.t2D描画( - (x - CalibrateTick.CurrentValue) + ((OpenTaiko.Skin.Game_Notes_Size[0] - OpenTaiko.Tx.Bar.szTextureSize.Width) / 2), - OpenTaiko.Skin.nScrollFieldY[0], - new Rectangle(0, 0, OpenTaiko.Tx.Bar.szTextureSize.Width, OpenTaiko.Skin.Game_Notes_Size[1]) - ); - OpenTaiko.Tx.Notes[0]?.t2D描画( - (x - CalibrateTick.CurrentValue), - OpenTaiko.Skin.nScrollFieldY[0], - new Rectangle(OpenTaiko.Skin.Game_Notes_Size[0], OpenTaiko.Skin.Game_Notes_Size[1], OpenTaiko.Skin.Game_Notes_Size[0], OpenTaiko.Skin.Game_Notes_Size[1]) - ); - } - - if (OpenTaiko.P1IsBlue()) - OpenTaiko.Tx.Taiko_Background[4]?.t2D描画(OpenTaiko.Skin.Game_Taiko_Background_X[0], OpenTaiko.Skin.Game_Taiko_Background_Y[0]); - else - OpenTaiko.Tx.Taiko_Background[0]?.t2D描画(OpenTaiko.Skin.Game_Taiko_Background_X[0], OpenTaiko.Skin.Game_Taiko_Background_Y[0]); - - #region Calibration Info - - offsettext?.t2D描画(OpenTaiko.Skin.Config_Calibration_OffsetText[0] - offsettext.szTextureSize.Width, OpenTaiko.Skin.Config_Calibration_OffsetText[1]); - - OpenTaiko.actTextConsole.Print(OpenTaiko.Skin.Config_Calibration_InfoText[0], OpenTaiko.Skin.Config_Calibration_InfoText[1], CTextConsole.EFontType.Cyan, - "MEDIAN OFFSET : " + GetMedianOffset() + "ms\n"); - OpenTaiko.actTextConsole.Print(OpenTaiko.Skin.Config_Calibration_InfoText[0], OpenTaiko.Skin.Config_Calibration_InfoText[1] + OpenTaiko.actTextConsole.fontHeight, CTextConsole.EFontType.White, - "MIN OFFSET : " + GetLowestOffset() + "ms\n" + - "MAX OFFSET : " + GetHighestOffset() + "ms\n" + - "LAST OFFSET : " + LastOffset + "ms\n" + - "OFFSET COUNT : " + (Offsets != null ? Offsets.Count : 0)); - OpenTaiko.actTextConsole.Print(OpenTaiko.Skin.Config_Calibration_InfoText[0], OpenTaiko.Skin.Config_Calibration_InfoText[1] + (OpenTaiko.actTextConsole.fontHeight * 5), CTextConsole.EFontType.White, - "CURRENT OFFSET: " + CurrentOffset() + "ms"); - - #endregion - - return 0; - } - - public void AddOffset() { Offsets.Add(CurrentOffset()); LastOffset = CurrentOffset(); } - - public int GetMedianOffset() { - if (Offsets != null) - if (Offsets.Count > 0) { - Offsets.Sort(); - return Offsets[Offsets.Count / 2]; - } - return 0; - } - public int GetLowestOffset() { - if (Offsets != null) - return Offsets.Count > 0 ? Offsets.Min() : 0; - return 0; - } - public int GetHighestOffset() { - if (Offsets != null) - return Offsets.Count > 0 ? Offsets.Max() : 0; - return 0; - } - public int CurrentOffset() { - return CalibrateTick.CurrentValue > 250 ? CalibrateTick.CurrentValue - 500 : CalibrateTick.CurrentValue; - } - - private void UpdateText() { - offsettext?.Dispose(); - offsettext = new CTexture(font.DrawText(CLangManager.LangInstance.GetString("SETTINGS_GAME_CALIBRATION_OFFSET", GetMedianOffset().ToString()), Color.White, Color.Black, null, 32)); - } - - public bool IsStarted { get { return CalibrateTick.IsStarted; } } - #region Private - private CCounter CalibrateTick = new CCounter(); - private List Offsets = new List(); - private int LastOffset = 0; - private CCachedFontRenderer font; - private CTexture offsettext; - - //private CSound hitSound; - - private int buttonIndex = 1; - private Rectangle[] BGs = new Rectangle[3] - { - new Rectangle(371, 724, 371, 209), - new Rectangle(774, 724, 371, 209), - new Rectangle(1179, 724, 371, 209) - }; - #endregion + public override void Activate() { + //hitSound = TJAPlayer3.SoundManager.tCreateSound($@"Global{Path.DirectorySeparatorChar}HitSounds{Path.DirectorySeparatorChar}" + TJAPlayer3.Skin.hsHitSoundsInformations.don[0], ESoundGroup.SoundEffect); + font = HPrivateFastFont.tInstantiateMainFont(30); + base.Activate(); } + + public override void DeActivate() { + Stop(); + Offsets.Clear(); + font?.Dispose(); + offsettext?.Dispose(); + //hitSound?.tDispose(); + + base.DeActivate(); + } + + public void Start() { + CalibrateTick = new CCounter(0, 500, 1, OpenTaiko.Timer); + UpdateText(); + } + + public void Stop() { + CalibrateTick = new CCounter(); + Offsets.Clear(); + LastOffset = 0; + buttonIndex = 1; + } + + public int Update() { + if (IsDeActivated || CalibrateTick.IsStoped) + return 1; + + CalibrateTick.Tick(); + + bool decide = OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.Decide) || + OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.RRed) || + OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.LRed) || + OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Return); + + if (CalibrateTick.IsEnded) { + OpenTaiko.Skin.calibrationTick.tPlay(); + CalibrateTick.Start(0, 500, 1, OpenTaiko.Timer); + } + + if (OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.LeftChange) || + OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.LBlue) || + OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.LeftArrow)) { + buttonIndex = Math.Max(buttonIndex - 1, 0); + OpenTaiko.Skin.soundChangeSFX.tPlay(); + } else if (OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.RightChange) || + OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.RBlue) || + OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.RightArrow)) { + buttonIndex = Math.Min(buttonIndex + 1, 2); + OpenTaiko.Skin.soundChangeSFX.tPlay(); + } else if (buttonIndex == 0 && decide) // Cancel + { + OpenTaiko.Skin.soundCancelSFX.tPlay(); + Stop(); + } else if (buttonIndex == 1 && decide) // Hit! + { + //hitSound?.PlayStart(); + AddOffset(); + UpdateText(); + } else if (buttonIndex == 2 && decide) // Save + { + OpenTaiko.ConfigIni.nGlobalOffsetMs = GetMedianOffset(); + OpenTaiko.stageコンフィグ.actList.iGlobalOffsetMs.n現在の値 = GetMedianOffset(); + OpenTaiko.Skin.soundDecideSFX.tPlay(); + Stop(); + + return 0; + } else if (OpenTaiko.ConfigIni.KeyAssign.KeyIsPressed(OpenTaiko.ConfigIni.KeyAssign.System.Cancel) || + OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Escape)) { + OpenTaiko.Skin.soundCancelSFX.tPlay(); + Stop(); + + return 0; + } + + return 0; + } + + public override int Draw() { + if (IsDeActivated || CalibrateTick.IsStoped) + return 1; + + if (OpenTaiko.Tx.Tile_Black != null) { + OpenTaiko.Tx.Tile_Black.Opacity = 128; + for (int i = 0; i <= SampleFramework.GameWindowSize.Width; i += OpenTaiko.Tx.Tile_Black.szTextureSize.Width) { + for (int j = 0; j <= SampleFramework.GameWindowSize.Height; j += OpenTaiko.Tx.Tile_Black.szTextureSize.Height) { + OpenTaiko.Tx.Tile_Black.t2D描画(i, j); + } + } + OpenTaiko.Tx.Tile_Black.Opacity = 255; + } + + OpenTaiko.Tx.CalibrateBG?.t2D描画(OpenTaiko.Skin.Config_Calibration_Highlights[buttonIndex].X, + OpenTaiko.Skin.Config_Calibration_Highlights[buttonIndex].Y, + OpenTaiko.Skin.Config_Calibration_Highlights[buttonIndex]); + OpenTaiko.Tx.CalibrateFG?.t2D描画(0, 0); + + OpenTaiko.Tx.Lane_Background_Main?.t2D描画(OpenTaiko.Skin.Game_Lane_X[0], OpenTaiko.Skin.Game_Lane_Y[0]); + OpenTaiko.Tx.Lane_Background_Sub?.t2D描画(OpenTaiko.Skin.Game_Lane_Sub_X[0], OpenTaiko.Skin.Game_Lane_Sub_Y[0]); + OpenTaiko.Tx.Taiko_Frame[2]?.t2D描画(OpenTaiko.Skin.Game_Taiko_Frame_X[0], OpenTaiko.Skin.Game_Taiko_Frame_Y[0]); + + OpenTaiko.Tx.Notes[0]?.t2D描画(OpenTaiko.Skin.nScrollFieldX[0], OpenTaiko.Skin.nScrollFieldY[0], new RectangleF(0, 0, OpenTaiko.Skin.Game_Notes_Size[0], OpenTaiko.Skin.Game_Notes_Size[1])); + + for (int x = OpenTaiko.Skin.nScrollFieldX[0]; x < SampleFramework.GameWindowSize.Width + 500; x += 500) { + OpenTaiko.Tx.Bar?.t2D描画( + (x - CalibrateTick.CurrentValue) + ((OpenTaiko.Skin.Game_Notes_Size[0] - OpenTaiko.Tx.Bar.szTextureSize.Width) / 2), + OpenTaiko.Skin.nScrollFieldY[0], + new Rectangle(0, 0, OpenTaiko.Tx.Bar.szTextureSize.Width, OpenTaiko.Skin.Game_Notes_Size[1]) + ); + OpenTaiko.Tx.Notes[0]?.t2D描画( + (x - CalibrateTick.CurrentValue), + OpenTaiko.Skin.nScrollFieldY[0], + new Rectangle(OpenTaiko.Skin.Game_Notes_Size[0], OpenTaiko.Skin.Game_Notes_Size[1], OpenTaiko.Skin.Game_Notes_Size[0], OpenTaiko.Skin.Game_Notes_Size[1]) + ); + } + + if (OpenTaiko.P1IsBlue()) + OpenTaiko.Tx.Taiko_Background[4]?.t2D描画(OpenTaiko.Skin.Game_Taiko_Background_X[0], OpenTaiko.Skin.Game_Taiko_Background_Y[0]); + else + OpenTaiko.Tx.Taiko_Background[0]?.t2D描画(OpenTaiko.Skin.Game_Taiko_Background_X[0], OpenTaiko.Skin.Game_Taiko_Background_Y[0]); + + #region Calibration Info + + offsettext?.t2D描画(OpenTaiko.Skin.Config_Calibration_OffsetText[0] - offsettext.szTextureSize.Width, OpenTaiko.Skin.Config_Calibration_OffsetText[1]); + + OpenTaiko.actTextConsole.Print(OpenTaiko.Skin.Config_Calibration_InfoText[0], OpenTaiko.Skin.Config_Calibration_InfoText[1], CTextConsole.EFontType.Cyan, + "MEDIAN OFFSET : " + GetMedianOffset() + "ms\n"); + OpenTaiko.actTextConsole.Print(OpenTaiko.Skin.Config_Calibration_InfoText[0], OpenTaiko.Skin.Config_Calibration_InfoText[1] + OpenTaiko.actTextConsole.fontHeight, CTextConsole.EFontType.White, + "MIN OFFSET : " + GetLowestOffset() + "ms\n" + + "MAX OFFSET : " + GetHighestOffset() + "ms\n" + + "LAST OFFSET : " + LastOffset + "ms\n" + + "OFFSET COUNT : " + (Offsets != null ? Offsets.Count : 0)); + OpenTaiko.actTextConsole.Print(OpenTaiko.Skin.Config_Calibration_InfoText[0], OpenTaiko.Skin.Config_Calibration_InfoText[1] + (OpenTaiko.actTextConsole.fontHeight * 5), CTextConsole.EFontType.White, + "CURRENT OFFSET: " + CurrentOffset() + "ms"); + + #endregion + + return 0; + } + + public void AddOffset() { Offsets.Add(CurrentOffset()); LastOffset = CurrentOffset(); } + + public int GetMedianOffset() { + if (Offsets != null) + if (Offsets.Count > 0) { + Offsets.Sort(); + return Offsets[Offsets.Count / 2]; + } + return 0; + } + public int GetLowestOffset() { + if (Offsets != null) + return Offsets.Count > 0 ? Offsets.Min() : 0; + return 0; + } + public int GetHighestOffset() { + if (Offsets != null) + return Offsets.Count > 0 ? Offsets.Max() : 0; + return 0; + } + public int CurrentOffset() { + return CalibrateTick.CurrentValue > 250 ? CalibrateTick.CurrentValue - 500 : CalibrateTick.CurrentValue; + } + + private void UpdateText() { + offsettext?.Dispose(); + offsettext = new CTexture(font.DrawText(CLangManager.LangInstance.GetString("SETTINGS_GAME_CALIBRATION_OFFSET", GetMedianOffset().ToString()), Color.White, Color.Black, null, 32)); + } + + public bool IsStarted { get { return CalibrateTick.IsStarted; } } + #region Private + private CCounter CalibrateTick = new CCounter(); + private List Offsets = new List(); + private int LastOffset = 0; + private CCachedFontRenderer font; + private CTexture offsettext; + + //private CSound hitSound; + + private int buttonIndex = 1; + private Rectangle[] BGs = new Rectangle[3] + { + new Rectangle(371, 724, 371, 209), + new Rectangle(774, 724, 371, 209), + new Rectangle(1179, 724, 371, 209) + }; + #endregion } diff --git a/OpenTaiko/src/Stages/04.Config/CActConfigKeyAssign.cs b/OpenTaiko/src/Stages/04.Config/CActConfigKeyAssign.cs index 5f1d7a05..34acbbcc 100644 --- a/OpenTaiko/src/Stages/04.Config/CActConfigKeyAssign.cs +++ b/OpenTaiko/src/Stages/04.Config/CActConfigKeyAssign.cs @@ -1,384 +1,384 @@ using System.Runtime.InteropServices; using FDK; -namespace OpenTaiko { - internal class CActConfigKeyAssign : CActivity { - // Properties +namespace OpenTaiko; - public bool bキー入力待ちの最中である { - get { - return this.bキー入力待ち; - } +internal class CActConfigKeyAssign : CActivity { + // Properties + + public bool bキー入力待ちの最中である { + get { + return this.bキー入力待ち; } - - - // メソッド - - public void t開始(EKeyConfigPart part, EKeyConfigPad pad, string strパッド名) { - if (part != EKeyConfigPart.Unknown) { - this.part = part; - this.pad = pad; - this.strパッド名 = strパッド名; - for (int i = 0; i < 0x10; i++) { - this.structReset用KeyAssign[i].InputDevice = OpenTaiko.ConfigIni.KeyAssign[(int)part][(int)pad][i].InputDevice; - this.structReset用KeyAssign[i].ID = OpenTaiko.ConfigIni.KeyAssign[(int)part][(int)pad][i].ID; - this.structReset用KeyAssign[i].Code = OpenTaiko.ConfigIni.KeyAssign[(int)part][(int)pad][i].Code; - } - } - } - - public void tEnter押下() { - if (!this.bキー入力待ち) { - OpenTaiko.Skin.soundDecideSFX.tPlay(); - switch (this.n現在の選択行) { - case 0x10: - for (int i = 0; i < 0x10; i++) { - OpenTaiko.ConfigIni.KeyAssign[(int)this.part][(int)this.pad][i].InputDevice = this.structReset用KeyAssign[i].InputDevice; - OpenTaiko.ConfigIni.KeyAssign[(int)this.part][(int)this.pad][i].ID = this.structReset用KeyAssign[i].ID; - OpenTaiko.ConfigIni.KeyAssign[(int)this.part][(int)this.pad][i].Code = this.structReset用KeyAssign[i].Code; - } - return; - - case 0x11: - OpenTaiko.stageコンフィグ.tアサイン完了通知(); - return; - } - this.bキー入力待ち = true; - } - } - public void t次に移動() { - if (!this.bキー入力待ち) { - OpenTaiko.Skin.soundカーソル移動音.tPlay(); - this.n現在の選択行 = (this.n現在の選択行 + 1) % 0x12; - } - } - public void t前に移動() { - if (!this.bキー入力待ち) { - OpenTaiko.Skin.soundカーソル移動音.tPlay(); - this.n現在の選択行 = ((this.n現在の選択行 - 1) + 0x12) % 0x12; - } - } - - - // CActivity 実装 - - public override void Activate() { - this.part = EKeyConfigPart.Unknown; - this.pad = EKeyConfigPad.Unknown; - this.strパッド名 = ""; - this.n現在の選択行 = 0; - this.bキー入力待ち = false; - this.structReset用KeyAssign = new CConfigIni.CKeyAssign.STKEYASSIGN[0x10]; - base.Activate(); - } - public override void DeActivate() { - if (!base.IsDeActivated) { - //CDTXMania.tテクスチャの解放( ref this.txカーソル ); - //CDTXMania.tテクスチャの解放( ref this.txHitKeyダイアログ ); - base.DeActivate(); - } - } - public override void CreateManagedResource() { - //this.txカーソル = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\ScreenConfig menu cursor.png" ), false ); - //this.txHitKeyダイアログ = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\ScreenConfig hit key to assign dialog.png" ), false ); - base.CreateManagedResource(); - } - public override void ReleaseManagedResource() { - base.ReleaseManagedResource(); - } - public override int Draw() { - if (!base.IsDeActivated) { - if (this.bキー入力待ち) { - if (OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Escape)) { - OpenTaiko.Skin.soundCancelSFX.tPlay(); - this.bキー入力待ち = false; - OpenTaiko.InputManager.Polling(false); - } else if ((this.tキーチェックとアサイン_Keyboard() || this.tキーチェックとアサイン_MidiIn()) || (this.tキーチェックとアサイン_Joypad() || tキーチェックとアサイン_Gamepad() || this.tキーチェックとアサイン_Mouse())) { - this.bキー入力待ち = false; - OpenTaiko.InputManager.Polling(false); - } - } else if ((OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Delete) && (this.n現在の選択行 >= 0)) && (this.n現在の選択行 <= 15)) { - OpenTaiko.Skin.soundDecideSFX.tPlay(); - OpenTaiko.ConfigIni.KeyAssign[(int)this.part][(int)this.pad][this.n現在の選択行].InputDevice = EInputDevice.Unknown; - OpenTaiko.ConfigIni.KeyAssign[(int)this.part][(int)this.pad][this.n現在の選択行].ID = 0; - OpenTaiko.ConfigIni.KeyAssign[(int)this.part][(int)this.pad][this.n現在の選択行].Code = 0; - } - if (OpenTaiko.Tx.Menu_Highlight != null) { - int num = OpenTaiko.Skin.Config_KeyAssign_Move; - int num2 = OpenTaiko.Skin.Config_KeyAssign_Menu_Highlight[0]; - int num3 = OpenTaiko.Skin.Config_KeyAssign_Menu_Highlight[1] + (num * (this.n現在の選択行 + 1)); - //TJAPlayer3.Tx.Menu_Highlight.t2D描画( num2, num3, new Rectangle( 0, 0, 0x10, 0x20 ) ); - float scale = 0.55f; - for (int j = 0; j < 14; j++) { - OpenTaiko.Tx.Menu_Highlight.vcScaleRatio.X = scale; - OpenTaiko.Tx.Menu_Highlight.vcScaleRatio.Y = scale; - - OpenTaiko.Tx.Menu_Highlight.t2D描画(num2, num3); - num2 += (int)(OpenTaiko.Tx.Menu_Highlight.szTextureSize.Width * scale); - - OpenTaiko.Tx.Menu_Highlight.vcScaleRatio.X = 1; - OpenTaiko.Tx.Menu_Highlight.vcScaleRatio.Y = 1; - } - //TJAPlayer3.Tx.Menu_Highlight.t2D描画( num2, num3, new Rectangle( 0x10, 0, 0x10, 0x20 ) ); - } - int num5 = OpenTaiko.Skin.Config_KeyAssign_Move; - int x = OpenTaiko.Skin.Config_KeyAssign_Font[0]; - int y = OpenTaiko.Skin.Config_KeyAssign_Font[1]; - OpenTaiko.stageコンフィグ.actFont.t文字列描画(x, y, this.strパッド名, false, 0.75f); - y += num5; - CConfigIni.CKeyAssign.STKEYASSIGN[] stkeyassignArray = OpenTaiko.ConfigIni.KeyAssign[(int)this.part][(int)this.pad]; - for (int i = 0; i < 0x10; i++) { - switch (stkeyassignArray[i].InputDevice) { - case EInputDevice.Keyboard: - this.tアサインコードの描画_Keyboard(i + 1, x + num5, y, stkeyassignArray[i].ID, stkeyassignArray[i].Code, this.n現在の選択行 == i); - break; - - case EInputDevice.MIDIInput: - this.tアサインコードの描画_MidiIn(i + 1, x + num5, y, stkeyassignArray[i].ID, stkeyassignArray[i].Code, this.n現在の選択行 == i); - break; - - case EInputDevice.Joypad: - this.tアサインコードの描画_Joypad(i + 1, x + num5, y, stkeyassignArray[i].ID, stkeyassignArray[i].Code, this.n現在の選択行 == i); - break; - - case EInputDevice.Gamepad: - this.tアサインコードの描画_Gamepad(i + 1, x + num5, y, stkeyassignArray[i].ID, stkeyassignArray[i].Code, this.n現在の選択行 == i); - break; - - case EInputDevice.Mouse: - this.tアサインコードの描画_Mouse(i + 1, x + num5, y, stkeyassignArray[i].ID, stkeyassignArray[i].Code, this.n現在の選択行 == i); - break; - - default: - OpenTaiko.stageコンフィグ.actFont.t文字列描画(x + num5, y, string.Format("{0,2}.", i + 1), this.n現在の選択行 == i, 0.75f); - break; - } - y += num5; - } - OpenTaiko.stageコンフィグ.actFont.t文字列描画(x + num5, y, "Reset", this.n現在の選択行 == 0x10, 0.75f); - y += num5; - OpenTaiko.stageコンフィグ.actFont.t文字列描画(x + num5, y, "<< Returnto List", this.n現在の選択行 == 0x11, 0.75f); - y += num5; - if (this.bキー入力待ち && (OpenTaiko.Tx.Config_KeyAssign != null)) { - OpenTaiko.Tx.Config_KeyAssign.t2D描画(OpenTaiko.Skin.Config_KeyAssign[0], OpenTaiko.Skin.Config_KeyAssign[1]); - } - } - return 0; - } - - - // その他 - - #region [ private ] - //----------------- - [StructLayout(LayoutKind.Sequential)] - private struct STKEYLABEL { - public int nCode; - public string strLabel; - public STKEYLABEL(int nCode, string strLabel) { - this.nCode = nCode; - this.strLabel = strLabel; - } - } - - private bool bキー入力待ち; - private STKEYLABEL[] KeyLabel = new STKEYLABEL[] { - new STKEYLABEL(0x35, "[ESC]"), new STKEYLABEL(1, "[ 1 ]"), new STKEYLABEL(2, "[ 2 ]"), new STKEYLABEL(3, "[ 3 ]"), new STKEYLABEL(4, "[ 4 ]"), new STKEYLABEL(5, "[ 5 ]"), new STKEYLABEL(6, "[ 6 ]"), new STKEYLABEL(7, "[ 7 ]"), new STKEYLABEL(8, "[ 8 ]"), new STKEYLABEL(9, "[ 9 ]"), new STKEYLABEL(0, "[ 0 ]"), new STKEYLABEL(0x53, "[ - ]"), new STKEYLABEL(0x34, "[ = ]"), new STKEYLABEL(0x2a, "[BSC]"), new STKEYLABEL(0x81, "[TAB]"), new STKEYLABEL(0x1a, "[ Q ]"), - new STKEYLABEL(0x20, "[ W ]"), new STKEYLABEL(14, "[ E ]"), new STKEYLABEL(0x1b, "[ R ]"), new STKEYLABEL(0x1d, "[ T ]"), new STKEYLABEL(0x22, "[ Y ]"), new STKEYLABEL(30, "[ U ]"), new STKEYLABEL(0x12, "[ I ]"), new STKEYLABEL(0x18, "[ O ]"), new STKEYLABEL(0x19, "[ P ]"), new STKEYLABEL(0x4a, "[ [ ]"), new STKEYLABEL(0x73, "[ ] ]"), new STKEYLABEL(0x75, "[Enter]"), new STKEYLABEL(0x4b, "[L-Ctrl]"), new STKEYLABEL(10, "[ A ]"), new STKEYLABEL(0x1c, "[ S ]"), new STKEYLABEL(13, "[ D ]"), - new STKEYLABEL(15, "[ F ]"), new STKEYLABEL(0x10, "[ G ]"), new STKEYLABEL(0x11, "[ H ]"), new STKEYLABEL(0x13, "[ J ]"), new STKEYLABEL(20, "[ K ]"), new STKEYLABEL(0x15, "[ L ]"), new STKEYLABEL(0x7b, "[ ; ]"), new STKEYLABEL(0x26, "[ ' ]"), new STKEYLABEL(0x45, "[ ` ]"), new STKEYLABEL(0x4e, "[L-Shift]"), new STKEYLABEL(0x2b, @"[ \]"), new STKEYLABEL(0x23, "[ Z ]"), new STKEYLABEL(0x21, "[ X ]"), new STKEYLABEL(12, "[ C ]"), new STKEYLABEL(0x1f, "[ V ]"), new STKEYLABEL(11, "[ B ]"), - new STKEYLABEL(0x17, "[ N ]"), new STKEYLABEL(0x16, "[ M ]"), new STKEYLABEL(0x2f, "[ , ]"), new STKEYLABEL(0x6f, "[ . ]"), new STKEYLABEL(0x7c, "[ / ]"), new STKEYLABEL(120, "[R-Shift]"), new STKEYLABEL(0x6a, "[ * ]"), new STKEYLABEL(0x4d, "[L-Alt]"), new STKEYLABEL(0x7e, "[Space]"), new STKEYLABEL(0x2d, "[CAPS]"), new STKEYLABEL(0x36, "[F1]"), new STKEYLABEL(0x37, "[F2]"), new STKEYLABEL(0x38, "[F3]"), new STKEYLABEL(0x39, "[F4]"), new STKEYLABEL(0x3a, "[F5]"), new STKEYLABEL(0x3b, "[F6]"), - new STKEYLABEL(60, "[F7]"), new STKEYLABEL(0x3d, "[F8]"), new STKEYLABEL(0x3e, "[F9]"), new STKEYLABEL(0x3f, "[F10]"), new STKEYLABEL(0x58, "[NumLock]"), new STKEYLABEL(0x7a, "[Scroll]"), new STKEYLABEL(0x60, "[NPad7]"), new STKEYLABEL(0x61, "[NPad8]"), new STKEYLABEL(0x62, "[NPad9]"), new STKEYLABEL(0x66, "[NPad-]"), new STKEYLABEL(0x5d, "[NPad4]"), new STKEYLABEL(0x5e, "[NPad5]"), new STKEYLABEL(0x5f, "[NPad6]"), new STKEYLABEL(0x68, "[NPad+]"), new STKEYLABEL(90, "[NPad1]"), new STKEYLABEL(0x5b, "[NPad2]"), - new STKEYLABEL(0x5c, "[NPad3]"), new STKEYLABEL(0x59, "[NPad0]"), new STKEYLABEL(0x67, "[NPad.]"), new STKEYLABEL(0x40, "[F11]"), new STKEYLABEL(0x41, "[F12]"), new STKEYLABEL(0x42, "[F13]"), new STKEYLABEL(0x43, "[F14]"), new STKEYLABEL(0x44, "[F15]"), new STKEYLABEL(0x48, "[Kana]"), new STKEYLABEL(0x24, "[ ? ]"), new STKEYLABEL(0x30, "[Henkan]"), new STKEYLABEL(0x57, "[MuHenkan]"), new STKEYLABEL(0x8f, @"[ \ ]"), new STKEYLABEL(0x25, "[NPad.]"), new STKEYLABEL(0x65, "[NPad=]"), new STKEYLABEL(0x72, "[ ^ ]"), - new STKEYLABEL(40, "[ @ ]"), new STKEYLABEL(0x2e, "[ : ]"), new STKEYLABEL(130, "[ _ ]"), new STKEYLABEL(0x49, "[Kanji]"), new STKEYLABEL(0x7f, "[Stop]"), new STKEYLABEL(0x29, "[AX]"), new STKEYLABEL(100, "[NPEnter]"), new STKEYLABEL(0x74, "[R-Ctrl]"), new STKEYLABEL(0x54, "[Mute]"), new STKEYLABEL(0x2c, "[Calc]"), new STKEYLABEL(0x70, "[PlayPause]"), new STKEYLABEL(0x52, "[MediaStop]"), new STKEYLABEL(0x85, "[Volume-]"), new STKEYLABEL(0x86, "[Volume+]"), new STKEYLABEL(0x8b, "[WebHome]"), new STKEYLABEL(0x63, "[NPad,]"), - new STKEYLABEL(0x69, "[ / ]"), new STKEYLABEL(0x80, "[PrtScn]"), new STKEYLABEL(0x77, "[R-Alt]"), new STKEYLABEL(110, "[Pause]"), new STKEYLABEL(70, "[Home]"), new STKEYLABEL(0x84, "[Up]"), new STKEYLABEL(0x6d, "[PageUp]"), new STKEYLABEL(0x4c, "[Left]"), new STKEYLABEL(0x76, "[Right]"), new STKEYLABEL(0x33, "[End]"), new STKEYLABEL(50, "[Down]"), new STKEYLABEL(0x6c, "[PageDown]"), new STKEYLABEL(0x47, "[Insert]"), new STKEYLABEL(0x31, "[Delete]"), new STKEYLABEL(0x4f, "[L-Win]"), new STKEYLABEL(0x79, "[R-Win]"), - new STKEYLABEL(0x27, "[APP]"), new STKEYLABEL(0x71, "[Power]"), new STKEYLABEL(0x7d, "[Sleep]"), new STKEYLABEL(0x87, "[Wake]") - }; - private int n現在の選択行; - private EKeyConfigPad pad; - private EKeyConfigPart part; - private CConfigIni.CKeyAssign.STKEYASSIGN[] structReset用KeyAssign; - private string strパッド名; - //private CTexture txHitKeyダイアログ; - //private CTexture txカーソル; - - private void tアサインコードの描画_Joypad(int line, int x, int y, int nID, int nCode, bool b強調) { - string str = ""; - switch (nCode) { - case 0: - str = "Left"; - break; - - case 1: - str = "Right"; - break; - - case 2: - str = "Up"; - break; - - case 3: - str = "Down"; - break; - - case 4: - str = "Forward"; - break; - - case 5: - str = "Back"; - break; - - case 6: - str = "CCW"; - break; - - case 7: - str = "CW"; - break; - - default: - if ((8 <= nCode) && (nCode < 8 + 128)) // other buttons (128 types) - { - str = string.Format("Button{0}", nCode - 7); - } else if ((8 + 128 <= nCode) && (nCode < 8 + 128 + 8)) // POV HAT ( 8 types; 45 degrees per HATs) - { - str = string.Format("POV {0}", (nCode - 8 - 128) * 45); - } else { - str = string.Format("Code{0}", nCode); - } - break; - } - OpenTaiko.stageコンフィグ.actFont.t文字列描画(x, y, string.Format("{0,2}. Joypad #{1} ", line, nID) + str, b強調, 0.75f); - } - private void tアサインコードの描画_Gamepad(int line, int x, int y, int nID, int nCode, bool b強調) { - string str = ""; - if ((8 <= nCode) && (nCode < 8 + 128)) // other buttons (128 types) - { - str = string.Format("Button{0}", nCode - 7); - } else if ((8 + 128 <= nCode) && (nCode < 8 + 128 + 8)) // POV HAT ( 8 types; 45 degrees per HATs) - { - str = string.Format("POV {0}", (nCode - 8 - 128) * 45); - } else { - str = string.Format("Code{0}", nCode); - } - OpenTaiko.stageコンフィグ.actFont.t文字列描画(x, y, string.Format("{0,2}. Gamepad #{1} ", line, nID) + str, b強調, 0.75f); - } - private void tアサインコードの描画_Keyboard(int line, int x, int y, int nID, int nCode, bool b強調) { - string str = null; - foreach (STKEYLABEL stkeylabel in this.KeyLabel) { - if (stkeylabel.nCode == nCode) { - str = string.Format("{0,2}. Key {1}", line, stkeylabel.strLabel); - break; - } - } - if (str == null) { - str = string.Format("{0,2}. Key 0x{1:X2}", line, nCode); - } - OpenTaiko.stageコンフィグ.actFont.t文字列描画(x, y, str, b強調, 0.75f); - } - private void tアサインコードの描画_MidiIn(int line, int x, int y, int nID, int nCode, bool b強調) { - OpenTaiko.stageコンフィグ.actFont.t文字列描画(x, y, string.Format("{0,2}. MidiIn #{1} code.{2}", line, nID, nCode), b強調, 0.75f); - } - private void tアサインコードの描画_Mouse(int line, int x, int y, int nID, int nCode, bool b強調) { - OpenTaiko.stageコンフィグ.actFont.t文字列描画(x, y, string.Format("{0,2}. Mouse Button{1}", line, nCode), b強調, 0.75f); - } - - private bool tキーチェックとアサイン_Gamepad() { - foreach (IInputDevice device in OpenTaiko.InputManager.InputDevices) { - if (device.CurrentType == InputDeviceType.Gamepad) { - for (int i = 0; i < 15; i++) // +8 for Axis, +8 for HAT - { - if (device.KeyPressed(i)) { - OpenTaiko.Skin.soundDecideSFX.tPlay(); - OpenTaiko.ConfigIni.RemoveDuplicateKeyAssignments(EInputDevice.Gamepad, device.ID, i, this.pad); - OpenTaiko.ConfigIni.KeyAssign[(int)this.part][(int)this.pad][this.n現在の選択行].InputDevice = EInputDevice.Gamepad; - OpenTaiko.ConfigIni.KeyAssign[(int)this.part][(int)this.pad][this.n現在の選択行].ID = device.ID; - OpenTaiko.ConfigIni.KeyAssign[(int)this.part][(int)this.pad][this.n現在の選択行].Code = i; - return true; - } - } - } - } - return false; - } - private bool tキーチェックとアサイン_Joypad() { - foreach (IInputDevice device in OpenTaiko.InputManager.InputDevices) { - if (device.CurrentType == InputDeviceType.Joystick) { - for (int i = 0; i < 15; i++) // +8 for Axis, +8 for HAT - { - if (device.KeyPressed(i)) { - OpenTaiko.Skin.soundDecideSFX.tPlay(); - OpenTaiko.ConfigIni.RemoveDuplicateKeyAssignments(EInputDevice.Joypad, device.ID, i, this.pad); - OpenTaiko.ConfigIni.KeyAssign[(int)this.part][(int)this.pad][this.n現在の選択行].InputDevice = EInputDevice.Joypad; - OpenTaiko.ConfigIni.KeyAssign[(int)this.part][(int)this.pad][this.n現在の選択行].ID = device.ID; - OpenTaiko.ConfigIni.KeyAssign[(int)this.part][(int)this.pad][this.n現在の選択行].Code = i; - return true; - } - } - } - } - return false; - } - private bool tキーチェックとアサイン_Keyboard() { - for (int i = 0; i < 144; i++) { - //if (i != (int)SlimDXKeys.Key.Escape && - // i != (int)SlimDXKeys.Key.Return && - // i != (int)SlimDXKeys.Key.UpArrow && - // i != (int)SlimDXKeys.Key.DownArrow && - // i != (int)SlimDXKeys.Key.LeftArrow && - // i != (int)SlimDXKeys.Key.RightArrow && - // TJAPlayer3.InputManager.Keyboard.KeyPressed( i ) ) - //{ - if (i != (int)SlimDXKeys.Key.Escape && - i != (int)SlimDXKeys.Key.Return && - OpenTaiko.InputManager.Keyboard.KeyPressed(i)) { - OpenTaiko.Skin.soundDecideSFX.tPlay(); - if (pad < EKeyConfigPad.Capture) - OpenTaiko.ConfigIni.RemoveDuplicateKeyAssignments(EInputDevice.Keyboard, 0, i, this.pad); - OpenTaiko.ConfigIni.KeyAssign[(int)this.part][(int)this.pad][this.n現在の選択行].InputDevice = EInputDevice.Keyboard; - OpenTaiko.ConfigIni.KeyAssign[(int)this.part][(int)this.pad][this.n現在の選択行].ID = 0; - OpenTaiko.ConfigIni.KeyAssign[(int)this.part][(int)this.pad][this.n現在の選択行].Code = i; - return true; - } else if (i == (int)SlimDXKeys.Key.Return && OpenTaiko.InputManager.Keyboard.KeyPressed(i)) // Remove keybind - { - OpenTaiko.Skin.soundCancelSFX.tPlay(); - OpenTaiko.ConfigIni.KeyAssign[(int)this.part][(int)this.pad][this.n現在の選択行].InputDevice = EInputDevice.Unknown; - OpenTaiko.ConfigIni.KeyAssign[(int)this.part][(int)this.pad][this.n現在の選択行].ID = 0; - OpenTaiko.ConfigIni.KeyAssign[(int)this.part][(int)this.pad][this.n現在の選択行].Code = 0; - return true; - } - } - return false; - } - private bool tキーチェックとアサイン_MidiIn() { - foreach (IInputDevice device in OpenTaiko.InputManager.InputDevices) { - if (device.CurrentType == InputDeviceType.MidiIn) { - for (int i = 0; i < 0x100; i++) { - if (device.KeyPressed(i)) { - OpenTaiko.Skin.soundDecideSFX.tPlay(); - OpenTaiko.ConfigIni.RemoveDuplicateKeyAssignments(EInputDevice.MIDIInput, device.ID, i, this.pad); - OpenTaiko.ConfigIni.KeyAssign[(int)this.part][(int)this.pad][this.n現在の選択行].InputDevice = EInputDevice.MIDIInput; - OpenTaiko.ConfigIni.KeyAssign[(int)this.part][(int)this.pad][this.n現在の選択行].ID = device.ID; - OpenTaiko.ConfigIni.KeyAssign[(int)this.part][(int)this.pad][this.n現在の選択行].Code = i; - return true; - } - } - } - } - return false; - } - private bool tキーチェックとアサイン_Mouse() { - for (int i = 0; i < 8; i++) { - if (OpenTaiko.InputManager.Mouse.KeyPressed(i)) { - OpenTaiko.ConfigIni.RemoveDuplicateKeyAssignments(EInputDevice.Mouse, 0, i, this.pad); - OpenTaiko.ConfigIni.KeyAssign[(int)this.part][(int)this.pad][this.n現在の選択行].InputDevice = EInputDevice.Mouse; - OpenTaiko.ConfigIni.KeyAssign[(int)this.part][(int)this.pad][this.n現在の選択行].ID = 0; - OpenTaiko.ConfigIni.KeyAssign[(int)this.part][(int)this.pad][this.n現在の選択行].Code = i; - } - } - return false; - } - //----------------- - #endregion } + + + // メソッド + + public void t開始(EKeyConfigPart part, EKeyConfigPad pad, string strパッド名) { + if (part != EKeyConfigPart.Unknown) { + this.part = part; + this.pad = pad; + this.strパッド名 = strパッド名; + for (int i = 0; i < 0x10; i++) { + this.structReset用KeyAssign[i].InputDevice = OpenTaiko.ConfigIni.KeyAssign[(int)part][(int)pad][i].InputDevice; + this.structReset用KeyAssign[i].ID = OpenTaiko.ConfigIni.KeyAssign[(int)part][(int)pad][i].ID; + this.structReset用KeyAssign[i].Code = OpenTaiko.ConfigIni.KeyAssign[(int)part][(int)pad][i].Code; + } + } + } + + public void tEnter押下() { + if (!this.bキー入力待ち) { + OpenTaiko.Skin.soundDecideSFX.tPlay(); + switch (this.n現在の選択行) { + case 0x10: + for (int i = 0; i < 0x10; i++) { + OpenTaiko.ConfigIni.KeyAssign[(int)this.part][(int)this.pad][i].InputDevice = this.structReset用KeyAssign[i].InputDevice; + OpenTaiko.ConfigIni.KeyAssign[(int)this.part][(int)this.pad][i].ID = this.structReset用KeyAssign[i].ID; + OpenTaiko.ConfigIni.KeyAssign[(int)this.part][(int)this.pad][i].Code = this.structReset用KeyAssign[i].Code; + } + return; + + case 0x11: + OpenTaiko.stageコンフィグ.tアサイン完了通知(); + return; + } + this.bキー入力待ち = true; + } + } + public void t次に移動() { + if (!this.bキー入力待ち) { + OpenTaiko.Skin.soundカーソル移動音.tPlay(); + this.n現在の選択行 = (this.n現在の選択行 + 1) % 0x12; + } + } + public void t前に移動() { + if (!this.bキー入力待ち) { + OpenTaiko.Skin.soundカーソル移動音.tPlay(); + this.n現在の選択行 = ((this.n現在の選択行 - 1) + 0x12) % 0x12; + } + } + + + // CActivity 実装 + + public override void Activate() { + this.part = EKeyConfigPart.Unknown; + this.pad = EKeyConfigPad.Unknown; + this.strパッド名 = ""; + this.n現在の選択行 = 0; + this.bキー入力待ち = false; + this.structReset用KeyAssign = new CConfigIni.CKeyAssign.STKEYASSIGN[0x10]; + base.Activate(); + } + public override void DeActivate() { + if (!base.IsDeActivated) { + //CDTXMania.tテクスチャの解放( ref this.txカーソル ); + //CDTXMania.tテクスチャの解放( ref this.txHitKeyダイアログ ); + base.DeActivate(); + } + } + public override void CreateManagedResource() { + //this.txカーソル = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\ScreenConfig menu cursor.png" ), false ); + //this.txHitKeyダイアログ = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\ScreenConfig hit key to assign dialog.png" ), false ); + base.CreateManagedResource(); + } + public override void ReleaseManagedResource() { + base.ReleaseManagedResource(); + } + public override int Draw() { + if (!base.IsDeActivated) { + if (this.bキー入力待ち) { + if (OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Escape)) { + OpenTaiko.Skin.soundCancelSFX.tPlay(); + this.bキー入力待ち = false; + OpenTaiko.InputManager.Polling(false); + } else if ((this.tキーチェックとアサイン_Keyboard() || this.tキーチェックとアサイン_MidiIn()) || (this.tキーチェックとアサイン_Joypad() || tキーチェックとアサイン_Gamepad() || this.tキーチェックとアサイン_Mouse())) { + this.bキー入力待ち = false; + OpenTaiko.InputManager.Polling(false); + } + } else if ((OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Delete) && (this.n現在の選択行 >= 0)) && (this.n現在の選択行 <= 15)) { + OpenTaiko.Skin.soundDecideSFX.tPlay(); + OpenTaiko.ConfigIni.KeyAssign[(int)this.part][(int)this.pad][this.n現在の選択行].InputDevice = EInputDevice.Unknown; + OpenTaiko.ConfigIni.KeyAssign[(int)this.part][(int)this.pad][this.n現在の選択行].ID = 0; + OpenTaiko.ConfigIni.KeyAssign[(int)this.part][(int)this.pad][this.n現在の選択行].Code = 0; + } + if (OpenTaiko.Tx.Menu_Highlight != null) { + int num = OpenTaiko.Skin.Config_KeyAssign_Move; + int num2 = OpenTaiko.Skin.Config_KeyAssign_Menu_Highlight[0]; + int num3 = OpenTaiko.Skin.Config_KeyAssign_Menu_Highlight[1] + (num * (this.n現在の選択行 + 1)); + //TJAPlayer3.Tx.Menu_Highlight.t2D描画( num2, num3, new Rectangle( 0, 0, 0x10, 0x20 ) ); + float scale = 0.55f; + for (int j = 0; j < 14; j++) { + OpenTaiko.Tx.Menu_Highlight.vcScaleRatio.X = scale; + OpenTaiko.Tx.Menu_Highlight.vcScaleRatio.Y = scale; + + OpenTaiko.Tx.Menu_Highlight.t2D描画(num2, num3); + num2 += (int)(OpenTaiko.Tx.Menu_Highlight.szTextureSize.Width * scale); + + OpenTaiko.Tx.Menu_Highlight.vcScaleRatio.X = 1; + OpenTaiko.Tx.Menu_Highlight.vcScaleRatio.Y = 1; + } + //TJAPlayer3.Tx.Menu_Highlight.t2D描画( num2, num3, new Rectangle( 0x10, 0, 0x10, 0x20 ) ); + } + int num5 = OpenTaiko.Skin.Config_KeyAssign_Move; + int x = OpenTaiko.Skin.Config_KeyAssign_Font[0]; + int y = OpenTaiko.Skin.Config_KeyAssign_Font[1]; + OpenTaiko.stageコンフィグ.actFont.t文字列描画(x, y, this.strパッド名, false, 0.75f); + y += num5; + CConfigIni.CKeyAssign.STKEYASSIGN[] stkeyassignArray = OpenTaiko.ConfigIni.KeyAssign[(int)this.part][(int)this.pad]; + for (int i = 0; i < 0x10; i++) { + switch (stkeyassignArray[i].InputDevice) { + case EInputDevice.Keyboard: + this.tアサインコードの描画_Keyboard(i + 1, x + num5, y, stkeyassignArray[i].ID, stkeyassignArray[i].Code, this.n現在の選択行 == i); + break; + + case EInputDevice.MIDIInput: + this.tアサインコードの描画_MidiIn(i + 1, x + num5, y, stkeyassignArray[i].ID, stkeyassignArray[i].Code, this.n現在の選択行 == i); + break; + + case EInputDevice.Joypad: + this.tアサインコードの描画_Joypad(i + 1, x + num5, y, stkeyassignArray[i].ID, stkeyassignArray[i].Code, this.n現在の選択行 == i); + break; + + case EInputDevice.Gamepad: + this.tアサインコードの描画_Gamepad(i + 1, x + num5, y, stkeyassignArray[i].ID, stkeyassignArray[i].Code, this.n現在の選択行 == i); + break; + + case EInputDevice.Mouse: + this.tアサインコードの描画_Mouse(i + 1, x + num5, y, stkeyassignArray[i].ID, stkeyassignArray[i].Code, this.n現在の選択行 == i); + break; + + default: + OpenTaiko.stageコンフィグ.actFont.t文字列描画(x + num5, y, string.Format("{0,2}.", i + 1), this.n現在の選択行 == i, 0.75f); + break; + } + y += num5; + } + OpenTaiko.stageコンフィグ.actFont.t文字列描画(x + num5, y, "Reset", this.n現在の選択行 == 0x10, 0.75f); + y += num5; + OpenTaiko.stageコンフィグ.actFont.t文字列描画(x + num5, y, "<< Returnto List", this.n現在の選択行 == 0x11, 0.75f); + y += num5; + if (this.bキー入力待ち && (OpenTaiko.Tx.Config_KeyAssign != null)) { + OpenTaiko.Tx.Config_KeyAssign.t2D描画(OpenTaiko.Skin.Config_KeyAssign[0], OpenTaiko.Skin.Config_KeyAssign[1]); + } + } + return 0; + } + + + // その他 + + #region [ private ] + //----------------- + [StructLayout(LayoutKind.Sequential)] + private struct STKEYLABEL { + public int nCode; + public string strLabel; + public STKEYLABEL(int nCode, string strLabel) { + this.nCode = nCode; + this.strLabel = strLabel; + } + } + + private bool bキー入力待ち; + private STKEYLABEL[] KeyLabel = new STKEYLABEL[] { + new STKEYLABEL(0x35, "[ESC]"), new STKEYLABEL(1, "[ 1 ]"), new STKEYLABEL(2, "[ 2 ]"), new STKEYLABEL(3, "[ 3 ]"), new STKEYLABEL(4, "[ 4 ]"), new STKEYLABEL(5, "[ 5 ]"), new STKEYLABEL(6, "[ 6 ]"), new STKEYLABEL(7, "[ 7 ]"), new STKEYLABEL(8, "[ 8 ]"), new STKEYLABEL(9, "[ 9 ]"), new STKEYLABEL(0, "[ 0 ]"), new STKEYLABEL(0x53, "[ - ]"), new STKEYLABEL(0x34, "[ = ]"), new STKEYLABEL(0x2a, "[BSC]"), new STKEYLABEL(0x81, "[TAB]"), new STKEYLABEL(0x1a, "[ Q ]"), + new STKEYLABEL(0x20, "[ W ]"), new STKEYLABEL(14, "[ E ]"), new STKEYLABEL(0x1b, "[ R ]"), new STKEYLABEL(0x1d, "[ T ]"), new STKEYLABEL(0x22, "[ Y ]"), new STKEYLABEL(30, "[ U ]"), new STKEYLABEL(0x12, "[ I ]"), new STKEYLABEL(0x18, "[ O ]"), new STKEYLABEL(0x19, "[ P ]"), new STKEYLABEL(0x4a, "[ [ ]"), new STKEYLABEL(0x73, "[ ] ]"), new STKEYLABEL(0x75, "[Enter]"), new STKEYLABEL(0x4b, "[L-Ctrl]"), new STKEYLABEL(10, "[ A ]"), new STKEYLABEL(0x1c, "[ S ]"), new STKEYLABEL(13, "[ D ]"), + new STKEYLABEL(15, "[ F ]"), new STKEYLABEL(0x10, "[ G ]"), new STKEYLABEL(0x11, "[ H ]"), new STKEYLABEL(0x13, "[ J ]"), new STKEYLABEL(20, "[ K ]"), new STKEYLABEL(0x15, "[ L ]"), new STKEYLABEL(0x7b, "[ ; ]"), new STKEYLABEL(0x26, "[ ' ]"), new STKEYLABEL(0x45, "[ ` ]"), new STKEYLABEL(0x4e, "[L-Shift]"), new STKEYLABEL(0x2b, @"[ \]"), new STKEYLABEL(0x23, "[ Z ]"), new STKEYLABEL(0x21, "[ X ]"), new STKEYLABEL(12, "[ C ]"), new STKEYLABEL(0x1f, "[ V ]"), new STKEYLABEL(11, "[ B ]"), + new STKEYLABEL(0x17, "[ N ]"), new STKEYLABEL(0x16, "[ M ]"), new STKEYLABEL(0x2f, "[ , ]"), new STKEYLABEL(0x6f, "[ . ]"), new STKEYLABEL(0x7c, "[ / ]"), new STKEYLABEL(120, "[R-Shift]"), new STKEYLABEL(0x6a, "[ * ]"), new STKEYLABEL(0x4d, "[L-Alt]"), new STKEYLABEL(0x7e, "[Space]"), new STKEYLABEL(0x2d, "[CAPS]"), new STKEYLABEL(0x36, "[F1]"), new STKEYLABEL(0x37, "[F2]"), new STKEYLABEL(0x38, "[F3]"), new STKEYLABEL(0x39, "[F4]"), new STKEYLABEL(0x3a, "[F5]"), new STKEYLABEL(0x3b, "[F6]"), + new STKEYLABEL(60, "[F7]"), new STKEYLABEL(0x3d, "[F8]"), new STKEYLABEL(0x3e, "[F9]"), new STKEYLABEL(0x3f, "[F10]"), new STKEYLABEL(0x58, "[NumLock]"), new STKEYLABEL(0x7a, "[Scroll]"), new STKEYLABEL(0x60, "[NPad7]"), new STKEYLABEL(0x61, "[NPad8]"), new STKEYLABEL(0x62, "[NPad9]"), new STKEYLABEL(0x66, "[NPad-]"), new STKEYLABEL(0x5d, "[NPad4]"), new STKEYLABEL(0x5e, "[NPad5]"), new STKEYLABEL(0x5f, "[NPad6]"), new STKEYLABEL(0x68, "[NPad+]"), new STKEYLABEL(90, "[NPad1]"), new STKEYLABEL(0x5b, "[NPad2]"), + new STKEYLABEL(0x5c, "[NPad3]"), new STKEYLABEL(0x59, "[NPad0]"), new STKEYLABEL(0x67, "[NPad.]"), new STKEYLABEL(0x40, "[F11]"), new STKEYLABEL(0x41, "[F12]"), new STKEYLABEL(0x42, "[F13]"), new STKEYLABEL(0x43, "[F14]"), new STKEYLABEL(0x44, "[F15]"), new STKEYLABEL(0x48, "[Kana]"), new STKEYLABEL(0x24, "[ ? ]"), new STKEYLABEL(0x30, "[Henkan]"), new STKEYLABEL(0x57, "[MuHenkan]"), new STKEYLABEL(0x8f, @"[ \ ]"), new STKEYLABEL(0x25, "[NPad.]"), new STKEYLABEL(0x65, "[NPad=]"), new STKEYLABEL(0x72, "[ ^ ]"), + new STKEYLABEL(40, "[ @ ]"), new STKEYLABEL(0x2e, "[ : ]"), new STKEYLABEL(130, "[ _ ]"), new STKEYLABEL(0x49, "[Kanji]"), new STKEYLABEL(0x7f, "[Stop]"), new STKEYLABEL(0x29, "[AX]"), new STKEYLABEL(100, "[NPEnter]"), new STKEYLABEL(0x74, "[R-Ctrl]"), new STKEYLABEL(0x54, "[Mute]"), new STKEYLABEL(0x2c, "[Calc]"), new STKEYLABEL(0x70, "[PlayPause]"), new STKEYLABEL(0x52, "[MediaStop]"), new STKEYLABEL(0x85, "[Volume-]"), new STKEYLABEL(0x86, "[Volume+]"), new STKEYLABEL(0x8b, "[WebHome]"), new STKEYLABEL(0x63, "[NPad,]"), + new STKEYLABEL(0x69, "[ / ]"), new STKEYLABEL(0x80, "[PrtScn]"), new STKEYLABEL(0x77, "[R-Alt]"), new STKEYLABEL(110, "[Pause]"), new STKEYLABEL(70, "[Home]"), new STKEYLABEL(0x84, "[Up]"), new STKEYLABEL(0x6d, "[PageUp]"), new STKEYLABEL(0x4c, "[Left]"), new STKEYLABEL(0x76, "[Right]"), new STKEYLABEL(0x33, "[End]"), new STKEYLABEL(50, "[Down]"), new STKEYLABEL(0x6c, "[PageDown]"), new STKEYLABEL(0x47, "[Insert]"), new STKEYLABEL(0x31, "[Delete]"), new STKEYLABEL(0x4f, "[L-Win]"), new STKEYLABEL(0x79, "[R-Win]"), + new STKEYLABEL(0x27, "[APP]"), new STKEYLABEL(0x71, "[Power]"), new STKEYLABEL(0x7d, "[Sleep]"), new STKEYLABEL(0x87, "[Wake]") + }; + private int n現在の選択行; + private EKeyConfigPad pad; + private EKeyConfigPart part; + private CConfigIni.CKeyAssign.STKEYASSIGN[] structReset用KeyAssign; + private string strパッド名; + //private CTexture txHitKeyダイアログ; + //private CTexture txカーソル; + + private void tアサインコードの描画_Joypad(int line, int x, int y, int nID, int nCode, bool b強調) { + string str = ""; + switch (nCode) { + case 0: + str = "Left"; + break; + + case 1: + str = "Right"; + break; + + case 2: + str = "Up"; + break; + + case 3: + str = "Down"; + break; + + case 4: + str = "Forward"; + break; + + case 5: + str = "Back"; + break; + + case 6: + str = "CCW"; + break; + + case 7: + str = "CW"; + break; + + default: + if ((8 <= nCode) && (nCode < 8 + 128)) // other buttons (128 types) + { + str = string.Format("Button{0}", nCode - 7); + } else if ((8 + 128 <= nCode) && (nCode < 8 + 128 + 8)) // POV HAT ( 8 types; 45 degrees per HATs) + { + str = string.Format("POV {0}", (nCode - 8 - 128) * 45); + } else { + str = string.Format("Code{0}", nCode); + } + break; + } + OpenTaiko.stageコンフィグ.actFont.t文字列描画(x, y, string.Format("{0,2}. Joypad #{1} ", line, nID) + str, b強調, 0.75f); + } + private void tアサインコードの描画_Gamepad(int line, int x, int y, int nID, int nCode, bool b強調) { + string str = ""; + if ((8 <= nCode) && (nCode < 8 + 128)) // other buttons (128 types) + { + str = string.Format("Button{0}", nCode - 7); + } else if ((8 + 128 <= nCode) && (nCode < 8 + 128 + 8)) // POV HAT ( 8 types; 45 degrees per HATs) + { + str = string.Format("POV {0}", (nCode - 8 - 128) * 45); + } else { + str = string.Format("Code{0}", nCode); + } + OpenTaiko.stageコンフィグ.actFont.t文字列描画(x, y, string.Format("{0,2}. Gamepad #{1} ", line, nID) + str, b強調, 0.75f); + } + private void tアサインコードの描画_Keyboard(int line, int x, int y, int nID, int nCode, bool b強調) { + string str = null; + foreach (STKEYLABEL stkeylabel in this.KeyLabel) { + if (stkeylabel.nCode == nCode) { + str = string.Format("{0,2}. Key {1}", line, stkeylabel.strLabel); + break; + } + } + if (str == null) { + str = string.Format("{0,2}. Key 0x{1:X2}", line, nCode); + } + OpenTaiko.stageコンフィグ.actFont.t文字列描画(x, y, str, b強調, 0.75f); + } + private void tアサインコードの描画_MidiIn(int line, int x, int y, int nID, int nCode, bool b強調) { + OpenTaiko.stageコンフィグ.actFont.t文字列描画(x, y, string.Format("{0,2}. MidiIn #{1} code.{2}", line, nID, nCode), b強調, 0.75f); + } + private void tアサインコードの描画_Mouse(int line, int x, int y, int nID, int nCode, bool b強調) { + OpenTaiko.stageコンフィグ.actFont.t文字列描画(x, y, string.Format("{0,2}. Mouse Button{1}", line, nCode), b強調, 0.75f); + } + + private bool tキーチェックとアサイン_Gamepad() { + foreach (IInputDevice device in OpenTaiko.InputManager.InputDevices) { + if (device.CurrentType == InputDeviceType.Gamepad) { + for (int i = 0; i < 15; i++) // +8 for Axis, +8 for HAT + { + if (device.KeyPressed(i)) { + OpenTaiko.Skin.soundDecideSFX.tPlay(); + OpenTaiko.ConfigIni.RemoveDuplicateKeyAssignments(EInputDevice.Gamepad, device.ID, i, this.pad); + OpenTaiko.ConfigIni.KeyAssign[(int)this.part][(int)this.pad][this.n現在の選択行].InputDevice = EInputDevice.Gamepad; + OpenTaiko.ConfigIni.KeyAssign[(int)this.part][(int)this.pad][this.n現在の選択行].ID = device.ID; + OpenTaiko.ConfigIni.KeyAssign[(int)this.part][(int)this.pad][this.n現在の選択行].Code = i; + return true; + } + } + } + } + return false; + } + private bool tキーチェックとアサイン_Joypad() { + foreach (IInputDevice device in OpenTaiko.InputManager.InputDevices) { + if (device.CurrentType == InputDeviceType.Joystick) { + for (int i = 0; i < 15; i++) // +8 for Axis, +8 for HAT + { + if (device.KeyPressed(i)) { + OpenTaiko.Skin.soundDecideSFX.tPlay(); + OpenTaiko.ConfigIni.RemoveDuplicateKeyAssignments(EInputDevice.Joypad, device.ID, i, this.pad); + OpenTaiko.ConfigIni.KeyAssign[(int)this.part][(int)this.pad][this.n現在の選択行].InputDevice = EInputDevice.Joypad; + OpenTaiko.ConfigIni.KeyAssign[(int)this.part][(int)this.pad][this.n現在の選択行].ID = device.ID; + OpenTaiko.ConfigIni.KeyAssign[(int)this.part][(int)this.pad][this.n現在の選択行].Code = i; + return true; + } + } + } + } + return false; + } + private bool tキーチェックとアサイン_Keyboard() { + for (int i = 0; i < 144; i++) { + //if (i != (int)SlimDXKeys.Key.Escape && + // i != (int)SlimDXKeys.Key.Return && + // i != (int)SlimDXKeys.Key.UpArrow && + // i != (int)SlimDXKeys.Key.DownArrow && + // i != (int)SlimDXKeys.Key.LeftArrow && + // i != (int)SlimDXKeys.Key.RightArrow && + // TJAPlayer3.InputManager.Keyboard.KeyPressed( i ) ) + //{ + if (i != (int)SlimDXKeys.Key.Escape && + i != (int)SlimDXKeys.Key.Return && + OpenTaiko.InputManager.Keyboard.KeyPressed(i)) { + OpenTaiko.Skin.soundDecideSFX.tPlay(); + if (pad < EKeyConfigPad.Capture) + OpenTaiko.ConfigIni.RemoveDuplicateKeyAssignments(EInputDevice.Keyboard, 0, i, this.pad); + OpenTaiko.ConfigIni.KeyAssign[(int)this.part][(int)this.pad][this.n現在の選択行].InputDevice = EInputDevice.Keyboard; + OpenTaiko.ConfigIni.KeyAssign[(int)this.part][(int)this.pad][this.n現在の選択行].ID = 0; + OpenTaiko.ConfigIni.KeyAssign[(int)this.part][(int)this.pad][this.n現在の選択行].Code = i; + return true; + } else if (i == (int)SlimDXKeys.Key.Return && OpenTaiko.InputManager.Keyboard.KeyPressed(i)) // Remove keybind + { + OpenTaiko.Skin.soundCancelSFX.tPlay(); + OpenTaiko.ConfigIni.KeyAssign[(int)this.part][(int)this.pad][this.n現在の選択行].InputDevice = EInputDevice.Unknown; + OpenTaiko.ConfigIni.KeyAssign[(int)this.part][(int)this.pad][this.n現在の選択行].ID = 0; + OpenTaiko.ConfigIni.KeyAssign[(int)this.part][(int)this.pad][this.n現在の選択行].Code = 0; + return true; + } + } + return false; + } + private bool tキーチェックとアサイン_MidiIn() { + foreach (IInputDevice device in OpenTaiko.InputManager.InputDevices) { + if (device.CurrentType == InputDeviceType.MidiIn) { + for (int i = 0; i < 0x100; i++) { + if (device.KeyPressed(i)) { + OpenTaiko.Skin.soundDecideSFX.tPlay(); + OpenTaiko.ConfigIni.RemoveDuplicateKeyAssignments(EInputDevice.MIDIInput, device.ID, i, this.pad); + OpenTaiko.ConfigIni.KeyAssign[(int)this.part][(int)this.pad][this.n現在の選択行].InputDevice = EInputDevice.MIDIInput; + OpenTaiko.ConfigIni.KeyAssign[(int)this.part][(int)this.pad][this.n現在の選択行].ID = device.ID; + OpenTaiko.ConfigIni.KeyAssign[(int)this.part][(int)this.pad][this.n現在の選択行].Code = i; + return true; + } + } + } + } + return false; + } + private bool tキーチェックとアサイン_Mouse() { + for (int i = 0; i < 8; i++) { + if (OpenTaiko.InputManager.Mouse.KeyPressed(i)) { + OpenTaiko.ConfigIni.RemoveDuplicateKeyAssignments(EInputDevice.Mouse, 0, i, this.pad); + OpenTaiko.ConfigIni.KeyAssign[(int)this.part][(int)this.pad][this.n現在の選択行].InputDevice = EInputDevice.Mouse; + OpenTaiko.ConfigIni.KeyAssign[(int)this.part][(int)this.pad][this.n現在の選択行].ID = 0; + OpenTaiko.ConfigIni.KeyAssign[(int)this.part][(int)this.pad][this.n現在の選択行].Code = i; + } + } + return false; + } + //----------------- + #endregion } diff --git a/OpenTaiko/src/Stages/04.Config/CActConfigList.cs b/OpenTaiko/src/Stages/04.Config/CActConfigList.cs index d201d9a6..c4d79494 100644 --- a/OpenTaiko/src/Stages/04.Config/CActConfigList.cs +++ b/OpenTaiko/src/Stages/04.Config/CActConfigList.cs @@ -2,1702 +2,1702 @@ using FDK; using SkiaSharp; -namespace OpenTaiko { - internal class CActConfigList : CActivity { - // Properties - - public bool bIsKeyAssignSelected // #24525 2011.3.15 yyagi - { - get { - Eメニュー種別 e = this.eメニュー種別; - if (e == Eメニュー種別.KeyAssignDrums || e == Eメニュー種別.KeyAssignSystem || e == Eメニュー種別.KeyAssignTraining) { - return true; - } else { - return false; - } +namespace OpenTaiko; + +internal class CActConfigList : CActivity { + // Properties + + public bool bIsKeyAssignSelected // #24525 2011.3.15 yyagi + { + get { + Eメニュー種別 e = this.eメニュー種別; + if (e == Eメニュー種別.KeyAssignDrums || e == Eメニュー種別.KeyAssignSystem || e == Eメニュー種別.KeyAssignTraining) { + return true; + } else { + return false; } } - public bool bIsFocusingParameter // #32059 2013.9.17 yyagi - { - get { - return b要素値にフォーカス中; + } + public bool bIsFocusingParameter // #32059 2013.9.17 yyagi + { + get { + return b要素値にフォーカス中; + } + } + public bool b現在選択されている項目はReturnToMenuである { + get { + CItemBase currentItem = this.list項目リスト[this.n現在の選択項目]; + if (currentItem == this.iSystemReturnToMenu || currentItem == this.iDrumsReturnToMenu) { + return true; + } else { + return false; } } - public bool b現在選択されている項目はReturnToMenuである { - get { - CItemBase currentItem = this.list項目リスト[this.n現在の選択項目]; - if (currentItem == this.iSystemReturnToMenu || currentItem == this.iDrumsReturnToMenu) { - return true; - } else { - return false; - } - } + } + public CItemBase ib現在の選択項目 { + get { + return this.list項目リスト[this.n現在の選択項目]; } - public CItemBase ib現在の選択項目 { - get { - return this.list項目リスト[this.n現在の選択項目]; - } - } - public int n現在の選択項目; - - - // General system options - #region [ t項目リストの設定_System() ] - - public void t項目リストの設定_System(bool refresh = true) { - this.tConfigIniへ記録する(); - this.list項目リスト.Clear(); - - // #27029 2012.1.5 from: 説明文は最大9行→13行に変更。 - - this.iSystemReturnToMenu = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_MENU_RETURN"), CItemBase.EPanelType.Other, - CLangManager.LangInstance.GetString("SETTINGS_MENU_RETURN_DESC")); - this.list項目リスト.Add(this.iSystemReturnToMenu); + } + public int n現在の選択項目; - this.iSystemReloadDTX = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_RELOADSONG"), CItemBase.EPanelType.Normal, - CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_RELOADSONG_DESC")); - this.list項目リスト.Add(this.iSystemReloadDTX); - this.iSystemHardReloadDTX = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_RELOADSONGCACHE"), CItemBase.EPanelType.Normal, - CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_RELOADSONGCACHE_DESC")); - this.list項目リスト.Add(this.iSystemHardReloadDTX); + // General system options + #region [ t項目リストの設定_System() ] - this.isSystemImportingScore = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_IMPORTSCOREINI"), CItemBase.EPanelType.Normal, - CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_IMPORTSCOREINI_DESC")); - this.list項目リスト.Add(this.isSystemImportingScore); + public void t項目リストの設定_System(bool refresh = true) { + this.tConfigIniへ記録する(); + this.list項目リスト.Clear(); - this.iSystemLanguage = new CItemList(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_LANGUAGE"), CItemList.EPanelType.Normal, CLangManager.langToInt(OpenTaiko.ConfigIni.sLang), - CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_LANGUAGE_DESC"), - CLangManager.Languages); - this.list項目リスト.Add(this.iSystemLanguage); + // #27029 2012.1.5 from: 説明文は最大9行→13行に変更。 - this.iTaikoPlayerCount = new CItemInteger(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_PLAYERCOUNT"), 1, 5, OpenTaiko.ConfigIni.nPlayerCount, - CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_PLAYERCOUNT_DESC")); - this.list項目リスト.Add(this.iTaikoPlayerCount); + this.iSystemReturnToMenu = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_MENU_RETURN"), CItemBase.EPanelType.Other, + CLangManager.LangInstance.GetString("SETTINGS_MENU_RETURN_DESC")); + this.list項目リスト.Add(this.iSystemReturnToMenu); - this.iDanTowerHide = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_HIDEDANTOWER"), OpenTaiko.ConfigIni.bDanTowerHide, - CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_HIDEDANTOWER_DESC")); - this.list項目リスト.Add(this.iDanTowerHide); + this.iSystemReloadDTX = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_RELOADSONG"), CItemBase.EPanelType.Normal, + CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_RELOADSONG_DESC")); + this.list項目リスト.Add(this.iSystemReloadDTX); - this.iCommonPlaySpeed = new CItemInteger(CLangManager.LangInstance.GetString("MOD_SONGSPEED"), 5, 400, OpenTaiko.ConfigIni.nSongSpeed, - CLangManager.LangInstance.GetString("SETTINGS_MOD_SONGSPEED_DESC")); - this.list項目リスト.Add(this.iCommonPlaySpeed); + this.iSystemHardReloadDTX = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_RELOADSONGCACHE"), CItemBase.EPanelType.Normal, + CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_RELOADSONGCACHE_DESC")); + this.list項目リスト.Add(this.iSystemHardReloadDTX); - this.iSystemTimeStretch = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_TIMESTRETCH"), OpenTaiko.ConfigIni.bTimeStretch, - CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_TIMESTRETCH_DESC")); - this.list項目リスト.Add(this.iSystemTimeStretch); + this.isSystemImportingScore = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_IMPORTSCOREINI"), CItemBase.EPanelType.Normal, + CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_IMPORTSCOREINI_DESC")); + this.list項目リスト.Add(this.isSystemImportingScore); - this.iSystemGraphicsType = new CItemList(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_GRAPHICSAPI"), CItemList.EPanelType.Normal, OpenTaiko.ConfigIni.nGraphicsDeviceType, - CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_GRAPHICSAPI_DESC"), - //new string[] { "OpenGL", "DirectX9", "DirectX11", "Vulkan", "Metal" }); - new string[] { "OpenGL", "DirectX11", "Vulkan", "Metal" }); - this.list項目リスト.Add(this.iSystemGraphicsType); + this.iSystemLanguage = new CItemList(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_LANGUAGE"), CItemList.EPanelType.Normal, CLangManager.langToInt(OpenTaiko.ConfigIni.sLang), + CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_LANGUAGE_DESC"), + CLangManager.Languages); + this.list項目リスト.Add(this.iSystemLanguage); - this.iSystemFullscreen = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_FULLSCREEN"), OpenTaiko.ConfigIni.bFullScreen, - CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_FULLSCREEN_DESC")); - this.list項目リスト.Add(this.iSystemFullscreen); + this.iTaikoPlayerCount = new CItemInteger(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_PLAYERCOUNT"), 1, 5, OpenTaiko.ConfigIni.nPlayerCount, + CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_PLAYERCOUNT_DESC")); + this.list項目リスト.Add(this.iTaikoPlayerCount); - this.iSystemRandomFromSubBox = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_RANDOMSUBFOLDER"), OpenTaiko.ConfigIni.bIncludeSubfoldersOnRandomSelect, - CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_RANDOMSUBFOLDER_DESC")); - this.list項目リスト.Add(this.iSystemRandomFromSubBox); + this.iDanTowerHide = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_HIDEDANTOWER"), OpenTaiko.ConfigIni.bDanTowerHide, + CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_HIDEDANTOWER_DESC")); + this.list項目リスト.Add(this.iDanTowerHide); - this.iSystemVSyncWait = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_VSYNC"), OpenTaiko.ConfigIni.bEnableVSync, - CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_VSYNC_DESC")); - this.list項目リスト.Add(this.iSystemVSyncWait); + this.iCommonPlaySpeed = new CItemInteger(CLangManager.LangInstance.GetString("MOD_SONGSPEED"), 5, 400, OpenTaiko.ConfigIni.nSongSpeed, + CLangManager.LangInstance.GetString("SETTINGS_MOD_SONGSPEED_DESC")); + this.list項目リスト.Add(this.iCommonPlaySpeed); - this.iSystemAVI = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_BGMOVIE"), OpenTaiko.ConfigIni.bEnableAVI, - CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_BGMOVIE_DESC")); - this.list項目リスト.Add(this.iSystemAVI); + this.iSystemTimeStretch = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_TIMESTRETCH"), OpenTaiko.ConfigIni.bTimeStretch, + CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_TIMESTRETCH_DESC")); + this.list項目リスト.Add(this.iSystemTimeStretch); - this.iSystemAVIDisplayMode = new CItemList(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_BGMOVIEDISPLAY"), CItemList.EPanelType.Normal, (int)OpenTaiko.ConfigIni.eClipDispType, - CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_BGMOVIEDISPLAY_DESC"), - new string[] { + this.iSystemGraphicsType = new CItemList(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_GRAPHICSAPI"), CItemList.EPanelType.Normal, OpenTaiko.ConfigIni.nGraphicsDeviceType, + CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_GRAPHICSAPI_DESC"), + //new string[] { "OpenGL", "DirectX9", "DirectX11", "Vulkan", "Metal" }); + new string[] { "OpenGL", "DirectX11", "Vulkan", "Metal" }); + this.list項目リスト.Add(this.iSystemGraphicsType); + + this.iSystemFullscreen = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_FULLSCREEN"), OpenTaiko.ConfigIni.bFullScreen, + CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_FULLSCREEN_DESC")); + this.list項目リスト.Add(this.iSystemFullscreen); + + this.iSystemRandomFromSubBox = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_RANDOMSUBFOLDER"), OpenTaiko.ConfigIni.bIncludeSubfoldersOnRandomSelect, + CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_RANDOMSUBFOLDER_DESC")); + this.list項目リスト.Add(this.iSystemRandomFromSubBox); + + this.iSystemVSyncWait = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_VSYNC"), OpenTaiko.ConfigIni.bEnableVSync, + CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_VSYNC_DESC")); + this.list項目リスト.Add(this.iSystemVSyncWait); + + this.iSystemAVI = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_BGMOVIE"), OpenTaiko.ConfigIni.bEnableAVI, + CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_BGMOVIE_DESC")); + this.list項目リスト.Add(this.iSystemAVI); + + this.iSystemAVIDisplayMode = new CItemList(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_BGMOVIEDISPLAY"), CItemList.EPanelType.Normal, (int)OpenTaiko.ConfigIni.eClipDispType, + CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_BGMOVIEDISPLAY_DESC"), + new string[] { CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_BGMOVIEDISPLAY_NONE"), CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_BGMOVIEDISPLAY_FULL"), CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_BGMOVIEDISPLAY_MINI"), CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_BGMOVIEDISPLAY_BOTH") - }); - this.list項目リスト.Add(this.iSystemAVIDisplayMode); + }); + this.list項目リスト.Add(this.iSystemAVIDisplayMode); - this.iSystemBGA = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_BGA"), OpenTaiko.ConfigIni.bEnableBGA, - CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_BGA_DESC")); - this.list項目リスト.Add(this.iSystemBGA); + this.iSystemBGA = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_BGA"), OpenTaiko.ConfigIni.bEnableBGA, + CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_BGA_DESC")); + this.list項目リスト.Add(this.iSystemBGA); - this.iSystemPreviewSoundWait = new CItemInteger(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_SONGPREVIEWBUFFER"), 0, 0x2710, OpenTaiko.ConfigIni.nMsWaitPreviewSoundFromSongSelected, - CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_SONGPREVIEWBUFFER_DESC")); - this.list項目リスト.Add(this.iSystemPreviewSoundWait); + this.iSystemPreviewSoundWait = new CItemInteger(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_SONGPREVIEWBUFFER"), 0, 0x2710, OpenTaiko.ConfigIni.nMsWaitPreviewSoundFromSongSelected, + CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_SONGPREVIEWBUFFER_DESC")); + this.list項目リスト.Add(this.iSystemPreviewSoundWait); - this.iSystemPreviewImageWait = new CItemInteger(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_IMAGEPREVIEWBUFFER"), 0, 0x2710, OpenTaiko.ConfigIni.nMsWaitPreviewImageFromSongSelected, - CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_IMAGEPREVIEWBUFFER_DESC")); - this.list項目リスト.Add(this.iSystemPreviewImageWait); + this.iSystemPreviewImageWait = new CItemInteger(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_IMAGEPREVIEWBUFFER"), 0, 0x2710, OpenTaiko.ConfigIni.nMsWaitPreviewImageFromSongSelected, + CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_IMAGEPREVIEWBUFFER_DESC")); + this.list項目リスト.Add(this.iSystemPreviewImageWait); - this.iSystemDebugInfo = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_DEBUGMODE"), OpenTaiko.ConfigIni.bDisplayDebugInfo, - CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_DEBUGMODE_DESC")); - this.list項目リスト.Add(this.iSystemDebugInfo); + this.iSystemDebugInfo = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_DEBUGMODE"), OpenTaiko.ConfigIni.bDisplayDebugInfo, + CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_DEBUGMODE_DESC")); + this.list項目リスト.Add(this.iSystemDebugInfo); - this.iSystemBGAlpha = new CItemInteger(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_LANEOPACITY"), 0, 0xff, OpenTaiko.ConfigIni.nBackgroundTransparency, - CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_LANEOPACITY_DESC")); - this.list項目リスト.Add(this.iSystemBGAlpha); + this.iSystemBGAlpha = new CItemInteger(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_LANEOPACITY"), 0, 0xff, OpenTaiko.ConfigIni.nBackgroundTransparency, + CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_LANEOPACITY_DESC")); + this.list項目リスト.Add(this.iSystemBGAlpha); - this.iSystemBGMSound = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_SONGPLAYBACK"), OpenTaiko.ConfigIni.bBGMPlayVoiceSound, - CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_SONGPLAYBACK_DESC")); - this.list項目リスト.Add(this.iSystemBGMSound); + this.iSystemBGMSound = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_SONGPLAYBACK"), OpenTaiko.ConfigIni.bBGMPlayVoiceSound, + CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_SONGPLAYBACK_DESC")); + this.list項目リスト.Add(this.iSystemBGMSound); - this.iSystemApplySongVol = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_USESONGVOL"), OpenTaiko.ConfigIni.ApplySongVol, - CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_USESONGVOL_DESC")); - this.list項目リスト.Add(this.iSystemApplySongVol); + this.iSystemApplySongVol = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_USESONGVOL"), OpenTaiko.ConfigIni.ApplySongVol, + CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_USESONGVOL_DESC")); + this.list項目リスト.Add(this.iSystemApplySongVol); - this.iSystemSoundEffectLevel = new CItemInteger(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_SEVOL"), CSound.MinimumGroupLevel, CSound.MaximumGroupLevel, OpenTaiko.ConfigIni.SoundEffectLevel, - CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_SEVOL_DESC")); - this.list項目リスト.Add(this.iSystemSoundEffectLevel); + this.iSystemSoundEffectLevel = new CItemInteger(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_SEVOL"), CSound.MinimumGroupLevel, CSound.MaximumGroupLevel, OpenTaiko.ConfigIni.SoundEffectLevel, + CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_SEVOL_DESC")); + this.list項目リスト.Add(this.iSystemSoundEffectLevel); - this.iSystemVoiceLevel = new CItemInteger(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_VOICEVOL"), CSound.MinimumGroupLevel, CSound.MaximumGroupLevel, OpenTaiko.ConfigIni.VoiceLevel, - CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_VOICEVOL_DESC")); - this.list項目リスト.Add(this.iSystemVoiceLevel); + this.iSystemVoiceLevel = new CItemInteger(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_VOICEVOL"), CSound.MinimumGroupLevel, CSound.MaximumGroupLevel, OpenTaiko.ConfigIni.VoiceLevel, + CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_VOICEVOL_DESC")); + this.list項目リスト.Add(this.iSystemVoiceLevel); - this.iSystemSongPreviewLevel = new CItemInteger(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_SONGPREVIEWVOL"), CSound.MinimumGroupLevel, CSound.MaximumGroupLevel, OpenTaiko.ConfigIni.SongPreviewLevel, - CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_SONGPREVIEWVOL_DESC")); - this.list項目リスト.Add(this.iSystemSongPreviewLevel); + this.iSystemSongPreviewLevel = new CItemInteger(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_SONGPREVIEWVOL"), CSound.MinimumGroupLevel, CSound.MaximumGroupLevel, OpenTaiko.ConfigIni.SongPreviewLevel, + CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_SONGPREVIEWVOL_DESC")); + this.list項目リスト.Add(this.iSystemSongPreviewLevel); - this.iSystemSongPlaybackLevel = new CItemInteger(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_SONGVOL"), CSound.MinimumGroupLevel, CSound.MaximumGroupLevel, OpenTaiko.ConfigIni.SongPlaybackLevel, - CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_SONGVOL_DESC")); - this.list項目リスト.Add(this.iSystemSongPlaybackLevel); + this.iSystemSongPlaybackLevel = new CItemInteger(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_SONGVOL"), CSound.MinimumGroupLevel, CSound.MaximumGroupLevel, OpenTaiko.ConfigIni.SongPlaybackLevel, + CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_SONGVOL_DESC")); + this.list項目リスト.Add(this.iSystemSongPlaybackLevel); - this.iSystemKeyboardSoundLevelIncrement = new CItemInteger(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_VOLINCREMENT"), 1, 20, OpenTaiko.ConfigIni.KeyboardSoundLevelIncrement, - CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_VOLINCREMENT_DESC")); - this.list項目リスト.Add(this.iSystemKeyboardSoundLevelIncrement); + this.iSystemKeyboardSoundLevelIncrement = new CItemInteger(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_VOLINCREMENT"), 1, 20, OpenTaiko.ConfigIni.KeyboardSoundLevelIncrement, + CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_VOLINCREMENT_DESC")); + this.list項目リスト.Add(this.iSystemKeyboardSoundLevelIncrement); - this.MusicPreTimeMs = new CItemInteger(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_SONGPLAYBACKBUFFER"), 0, 10000, OpenTaiko.ConfigIni.MusicPreTimeMs, - CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_SONGPLAYBACKBUFFER_DESC")); - this.list項目リスト.Add(this.MusicPreTimeMs); + this.MusicPreTimeMs = new CItemInteger(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_SONGPLAYBACKBUFFER"), 0, 10000, OpenTaiko.ConfigIni.MusicPreTimeMs, + CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_SONGPLAYBACKBUFFER_DESC")); + this.list項目リスト.Add(this.MusicPreTimeMs); - this.iSystemAutoResultCapture = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_AUTOSCREENSHOT"), OpenTaiko.ConfigIni.bIsAutoResultCapture, - CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_AUTOSCREENSHOT_DESC")); - this.list項目リスト.Add(this.iSystemAutoResultCapture); + this.iSystemAutoResultCapture = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_AUTOSCREENSHOT"), OpenTaiko.ConfigIni.bIsAutoResultCapture, + CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_AUTOSCREENSHOT_DESC")); + this.list項目リスト.Add(this.iSystemAutoResultCapture); - SendDiscordPlayingInformation = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_DISCORDRPC"), - OpenTaiko.ConfigIni.SendDiscordPlayingInformation, - CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_DISCORDRPC_DESC")); - list項目リスト.Add(SendDiscordPlayingInformation); + SendDiscordPlayingInformation = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_DISCORDRPC"), + OpenTaiko.ConfigIni.SendDiscordPlayingInformation, + CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_DISCORDRPC_DESC")); + list項目リスト.Add(SendDiscordPlayingInformation); - this.iSystemBufferedInput = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_BUFFEREDINPUT"), OpenTaiko.ConfigIni.bBufferedInputs, - CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_BUFFEREDINPUT_DESC")); - this.list項目リスト.Add(this.iSystemBufferedInput); - this.iLogOutputLog = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_LOG"), OpenTaiko.ConfigIni.bOutputLogs, - CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_LOG_DESC")); - this.list項目リスト.Add(this.iLogOutputLog); - - // #24820 2013.1.3 yyagi - - this.iSystemSoundType = new CItemList(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_AUDIOPLAYBACK"), CItemList.EPanelType.Normal, OpenTaiko.ConfigIni.nSoundDeviceType, - CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_AUDIOPLAYBACK_DESC"), - new string[] { "Bass", "ASIO", "WASAPI Exclusive", "WASAPI Shared" }); - this.list項目リスト.Add(this.iSystemSoundType); - - // #24820 2013.1.15 yyagi - this.iSystemBassBufferSizeMs = new CItemInteger(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_BASSBUFFER"), 0, 99999, OpenTaiko.ConfigIni.nBassBufferSizeMs, - CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_BASSBUFFER_DESC")); - this.list項目リスト.Add(this.iSystemBassBufferSizeMs); - - // #24820 2013.1.15 yyagi - this.iSystemWASAPIBufferSizeMs = new CItemInteger(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_WASAPIBUFFER"), 0, 99999, OpenTaiko.ConfigIni.nWASAPIBufferSizeMs, - CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_WASAPIBUFFER_DESC")); - this.list項目リスト.Add(this.iSystemWASAPIBufferSizeMs); - - // #24820 2013.1.17 yyagi - this.iSystemASIODevice = new CItemList(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_ASIOPLAYBACK"), CItemList.EPanelType.Normal, OpenTaiko.ConfigIni.nASIODevice, - CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_ASIOPLAYBACK_DESC"), - CEnumerateAllAsioDevices.GetAllASIODevices()); - this.list項目リスト.Add(this.iSystemASIODevice); - - // #33689 2014.6.17 yyagi - this.iSystemSoundTimerType = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_OSTIMER"), OpenTaiko.ConfigIni.bUseOSTimer, - CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_OSTIMER_DESC")); - this.list項目リスト.Add(this.iSystemSoundTimerType); + this.iSystemBufferedInput = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_BUFFEREDINPUT"), OpenTaiko.ConfigIni.bBufferedInputs, + CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_BUFFEREDINPUT_DESC")); + this.list項目リスト.Add(this.iSystemBufferedInput); + this.iLogOutputLog = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_LOG"), OpenTaiko.ConfigIni.bOutputLogs, + CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_LOG_DESC")); + this.list項目リスト.Add(this.iLogOutputLog); - ShowChara = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_DISPLAYCHARA"), OpenTaiko.ConfigIni.ShowChara, - CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_DISPLAYCHARA_DESC")); - this.list項目リスト.Add(ShowChara); + // #24820 2013.1.3 yyagi - ShowDancer = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_DISPLAYDANCER"), OpenTaiko.ConfigIni.ShowDancer, - CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_DISPLAYDANCER_DESC")); - this.list項目リスト.Add(ShowDancer); + this.iSystemSoundType = new CItemList(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_AUDIOPLAYBACK"), CItemList.EPanelType.Normal, OpenTaiko.ConfigIni.nSoundDeviceType, + CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_AUDIOPLAYBACK_DESC"), + new string[] { "Bass", "ASIO", "WASAPI Exclusive", "WASAPI Shared" }); + this.list項目リスト.Add(this.iSystemSoundType); - ShowMob = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_DISPLAYMOB"), OpenTaiko.ConfigIni.ShowMob, - CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_DISPLAYMOB_DESC")); - this.list項目リスト.Add(ShowMob); + // #24820 2013.1.15 yyagi + this.iSystemBassBufferSizeMs = new CItemInteger(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_BASSBUFFER"), 0, 99999, OpenTaiko.ConfigIni.nBassBufferSizeMs, + CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_BASSBUFFER_DESC")); + this.list項目リスト.Add(this.iSystemBassBufferSizeMs); - ShowRunner = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_DISPLAYRUNNER"), OpenTaiko.ConfigIni.ShowRunner, - CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_DISPLAYRUNNER_DESC")); - this.list項目リスト.Add(ShowRunner); + // #24820 2013.1.15 yyagi + this.iSystemWASAPIBufferSizeMs = new CItemInteger(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_WASAPIBUFFER"), 0, 99999, OpenTaiko.ConfigIni.nWASAPIBufferSizeMs, + CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_WASAPIBUFFER_DESC")); + this.list項目リスト.Add(this.iSystemWASAPIBufferSizeMs); - ShowFooter = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_DISPLAYFOOTER"), OpenTaiko.ConfigIni.ShowFooter, - CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_DISPLAYFOOTER_DESC")); - this.list項目リスト.Add(ShowFooter); + // #24820 2013.1.17 yyagi + this.iSystemASIODevice = new CItemList(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_ASIOPLAYBACK"), CItemList.EPanelType.Normal, OpenTaiko.ConfigIni.nASIODevice, + CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_ASIOPLAYBACK_DESC"), + CEnumerateAllAsioDevices.GetAllASIODevices()); + this.list項目リスト.Add(this.iSystemASIODevice); - FastRender = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_FASTRENDER"), OpenTaiko.ConfigIni.FastRender, - CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_FASTRENDER_DESC")); - this.list項目リスト.Add(FastRender); + // #33689 2014.6.17 yyagi + this.iSystemSoundTimerType = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_OSTIMER"), OpenTaiko.ConfigIni.bUseOSTimer, + CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_OSTIMER_DESC")); + this.list項目リスト.Add(this.iSystemSoundTimerType); - ShowPuchiChara = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_DISPLAYPUCHI"), OpenTaiko.ConfigIni.ShowPuchiChara, - CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_DISPLAYPUCHI_DESC")); - this.list項目リスト.Add(ShowPuchiChara); + ShowChara = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_DISPLAYCHARA"), OpenTaiko.ConfigIni.ShowChara, + CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_DISPLAYCHARA_DESC")); + this.list項目リスト.Add(ShowChara); - SimpleMode = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_SIMPLEMODE"), OpenTaiko.ConfigIni.SimpleMode, - CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_SIMPLEMODE_DESC")); - this.list項目リスト.Add(SimpleMode); + ShowDancer = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_DISPLAYDANCER"), OpenTaiko.ConfigIni.ShowDancer, + CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_DISPLAYDANCER_DESC")); + this.list項目リスト.Add(ShowDancer); - ASyncTextureLoad = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_TEXTUREASYNC"), OpenTaiko.ConfigIni.ASyncTextureLoad, - CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_TEXTUREASYNC_DESC")); - this.list項目リスト.Add(ASyncTextureLoad); + ShowMob = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_DISPLAYMOB"), OpenTaiko.ConfigIni.ShowMob, + CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_DISPLAYMOB_DESC")); + this.list項目リスト.Add(ShowMob); - this.iSystemSkinSubfolder = new CItemList(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_SKIN"), CItemBase.EPanelType.Normal, nSkinIndex, - CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_SKIN_DESC"), - skinNames); - this.list項目リスト.Add(this.iSystemSkinSubfolder); + ShowRunner = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_DISPLAYRUNNER"), OpenTaiko.ConfigIni.ShowRunner, + CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_DISPLAYRUNNER_DESC")); + this.list項目リスト.Add(ShowRunner); - this.iSystemGoToKeyAssign = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_SYSTEM"), CItemBase.EPanelType.Normal, + ShowFooter = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_DISPLAYFOOTER"), OpenTaiko.ConfigIni.ShowFooter, + CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_DISPLAYFOOTER_DESC")); + this.list項目リスト.Add(ShowFooter); + + FastRender = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_FASTRENDER"), OpenTaiko.ConfigIni.FastRender, + CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_FASTRENDER_DESC")); + this.list項目リスト.Add(FastRender); + + ShowPuchiChara = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_DISPLAYPUCHI"), OpenTaiko.ConfigIni.ShowPuchiChara, + CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_DISPLAYPUCHI_DESC")); + this.list項目リスト.Add(ShowPuchiChara); + + SimpleMode = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_SIMPLEMODE"), OpenTaiko.ConfigIni.SimpleMode, + CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_SIMPLEMODE_DESC")); + this.list項目リスト.Add(SimpleMode); + + ASyncTextureLoad = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_TEXTUREASYNC"), OpenTaiko.ConfigIni.ASyncTextureLoad, + CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_TEXTUREASYNC_DESC")); + this.list項目リスト.Add(ASyncTextureLoad); + + this.iSystemSkinSubfolder = new CItemList(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_SKIN"), CItemBase.EPanelType.Normal, nSkinIndex, + CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_SKIN_DESC"), + skinNames); + this.list項目リスト.Add(this.iSystemSkinSubfolder); + + this.iSystemGoToKeyAssign = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_SYSTEM"), CItemBase.EPanelType.Normal, CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_SYSTEM_DESC")); - this.list項目リスト.Add(this.iSystemGoToKeyAssign); - + this.list項目リスト.Add(this.iSystemGoToKeyAssign); + #if DEBUG - this.debugImGui = new CItemToggle("[DEBUG ONLY] Show ImGui Debug Window", OpenTaiko.ConfigIni.DEBUG_bShowImgui); - this.list項目リスト.Add(this.debugImGui); + this.debugImGui = new CItemToggle("[DEBUG ONLY] Show ImGui Debug Window", OpenTaiko.ConfigIni.DEBUG_bShowImgui); + this.list項目リスト.Add(this.debugImGui); #endif - - OnListMenuの初期化(); - if (refresh) { - this.n現在の選択項目 = 0; - this.eメニュー種別 = Eメニュー種別.System; - } - } - #endregion - - - // Gameplay options - #region [ t項目リストの設定_Drums() ] - - public void t項目リストの設定_Drums() { - this.tConfigIniへ記録する(); - this.list項目リスト.Clear(); - - // #27029 2012.1.5 from: 説明文は最大9行→13行に変更。 - - this.iDrumsReturnToMenu = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_MENU_RETURN"), CItemBase.EPanelType.Other, - CLangManager.LangInstance.GetString("SETTINGS_MENU_RETURN_DESC")); - this.list項目リスト.Add(this.iDrumsReturnToMenu); - - this.iDrumsGoToCalibration = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_GAME_CALIBRATION"), CItemBase.EPanelType.Other, - CLangManager.LangInstance.GetString("SETTINGS_GAME_CALIBRATION_DESC")); - this.list項目リスト.Add(this.iDrumsGoToCalibration); - - this.iRollsPerSec = new CItemInteger(CLangManager.LangInstance.GetString("SETTINGS_GAME_AUTOROLL"), 0, 1000, OpenTaiko.ConfigIni.nRollsPerSec, - CLangManager.LangInstance.GetString("SETTINGS_GAME_AUTOROLL_DESC")); - this.list項目リスト.Add(this.iRollsPerSec); - - this.iAILevel = new CItemInteger(CLangManager.LangInstance.GetString("SETTINGS_GAME_AILEVEL"), 1, 10, OpenTaiko.ConfigIni.nDefaultAILevel, - CLangManager.LangInstance.GetString("SETTINGS_GAME_AILEVEL_DESC")); - this.list項目リスト.Add(this.iAILevel); - - this.iSystemRisky = new CItemInteger(CLangManager.LangInstance.GetString("SETTINGS_GAME_BADCOUNT"), 0, 10, OpenTaiko.ConfigIni.nRisky, - CLangManager.LangInstance.GetString("SETTINGS_GAME_BADCOUNT_DESC")); - this.list項目リスト.Add(this.iSystemRisky); - - this.iTaikoNoInfo = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_GAME_NOINFO"), OpenTaiko.ConfigIni.bNoInfo, - CLangManager.LangInstance.GetString("SETTINGS_GAME_NOINFO_DESC")); - this.list項目リスト.Add(this.iTaikoNoInfo); - - this.iDrumsTight = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_GAME_NOTELOCK"), OpenTaiko.ConfigIni.bTight, - CLangManager.LangInstance.GetString("SETTINGS_GAME_NOTELOCK_DESC")); - this.list項目リスト.Add(this.iDrumsTight); - - this.iSystemMinComboDrums = new CItemInteger(CLangManager.LangInstance.GetString("SETTINGS_GAME_COMBODISPLAY"), 1, 0x1869f, OpenTaiko.ConfigIni.nMinDisplayedCombo.Drums, - CLangManager.LangInstance.GetString("SETTINGS_GAME_COMBODISPLAY_DESC")); - this.list項目リスト.Add(this.iSystemMinComboDrums); - - this.iGlobalOffsetMs = new CItemInteger(CLangManager.LangInstance.GetString("SETTINGS_GAME_GLOBALOFFSET"), -9999, 9999, OpenTaiko.ConfigIni.nGlobalOffsetMs, - CLangManager.LangInstance.GetString("SETTINGS_GAME_GLOBALOFFSET_DESC")); - this.list項目リスト.Add(this.iGlobalOffsetMs); - - this.iTaikoDefaultCourse = new CItemList(CLangManager.LangInstance.GetString("SETTINGS_GAME_DEFAULTDIFF"), CItemBase.EPanelType.Normal, OpenTaiko.ConfigIni.nDefaultCourse, - CLangManager.LangInstance.GetString("SETTINGS_GAME_DEFAULTDIFF_DESC"), - new string[] { - CLangManager.LangInstance.GetString("DIFF_EASY"), - CLangManager.LangInstance.GetString("DIFF_NORMAL"), - CLangManager.LangInstance.GetString("DIFF_HARD"), - CLangManager.LangInstance.GetString("DIFF_EX"), - CLangManager.LangInstance.GetString("DIFF_EXTRA"), - CLangManager.LangInstance.GetString("DIFF_EXEXTRA") }); - this.list項目リスト.Add(this.iTaikoDefaultCourse); - - this.iTaikoScoreMode = new CItemList(CLangManager.LangInstance.GetString("SETTINGS_GAME_SCOREMODE"), CItemBase.EPanelType.Normal, OpenTaiko.ConfigIni.nScoreMode, - CLangManager.LangInstance.GetString("SETTINGS_GAME_SCOREMODE_DESC"), - new string[] { "TYPE-A", "TYPE-B", "TYPE-C" }); - this.list項目リスト.Add(this.iTaikoScoreMode); - - this.ShinuchiMode = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_GAME_SHINUCHI"), OpenTaiko.ConfigIni.ShinuchiMode, CItemBase.EPanelType.Normal, - CLangManager.LangInstance.GetString("SETTINGS_GAME_SHINUCHI_DESC")); - this.list項目リスト.Add(this.ShinuchiMode); - - // FIXME: This does nothing vvv - this.iTaikoBranchGuide = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_GAME_BRANCHGUIDE"), OpenTaiko.ConfigIni.bBranchGuide, - CLangManager.LangInstance.GetString("SETTINGS_GAME_BRANCHGUIDE_DESC")); - this.list項目リスト.Add(this.iTaikoBranchGuide); - - this.iTaikoBranchAnime = new CItemList(CLangManager.LangInstance.GetString("SETTINGS_GAME_BRANCHANIME"), CItemBase.EPanelType.Normal, OpenTaiko.ConfigIni.nBranchAnime, - CLangManager.LangInstance.GetString("SETTINGS_GAME_BRANCHANIME_DESC"), - new string[] { "TYPE-A", "TYPE-B" }); - this.list項目リスト.Add(this.iTaikoBranchAnime); - - this.iTaikoGameMode = new CItemList(CLangManager.LangInstance.GetString("SETTINGS_GAME_SURVIVAL"), CItemBase.EPanelType.Normal, (int)OpenTaiko.ConfigIni.eGameMode, - CLangManager.LangInstance.GetString("SETTINGS_GAME_SURVIVAL_DESC"), - new string[] { "OFF", "TYPE-A", "TYPE-B" }); - this.list項目リスト.Add(this.iTaikoGameMode); - - this.iTaikoBigNotesJudge = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_GAME_BIGNOTEJUDGE"), OpenTaiko.ConfigIni.bJudgeBigNotes, - CLangManager.LangInstance.GetString("SETTINGS_GAME_BIGNOTEJUDGE_DESC")); - this.list項目リスト.Add(this.iTaikoBigNotesJudge); - - this.iTaikoForceNormalGauge = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_GAME_NORMALGAUGE"), OpenTaiko.ConfigIni.bForceNormalGauge, - CLangManager.LangInstance.GetString("SETTINGS_GAME_NORMALGAUGE_DESC")); - this.list項目リスト.Add(this.iTaikoForceNormalGauge); - - this.iTaikoJudgeCountDisp = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_GAME_SCOREDISPLAY"), OpenTaiko.ConfigIni.bJudgeCountDisplay, - CLangManager.LangInstance.GetString("SETTINGS_GAME_SCOREDISPLAY_DESC")); - this.list項目リスト.Add(this.iTaikoJudgeCountDisp); - - this.iShowExExtraAnime = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_GAME_EXEXTRAANIME"), OpenTaiko.ConfigIni.ShowExExtraAnime, - CLangManager.LangInstance.GetString("SETTINGS_GAME_EXEXTRAANIME_DESC")); - this.list項目リスト.Add(this.iShowExExtraAnime); - - this.TokkunSkipCount = new CItemInteger(CLangManager.LangInstance.GetString("SETTINGS_TRAINING_SKIPCOUNT"), 1, 99, OpenTaiko.ConfigIni.TokkunSkipMeasures, - CLangManager.LangInstance.GetString("SETTINGS_TRAINING_SKIPCOUNT_DESC")); - this.list項目リスト.Add(TokkunSkipCount); - - this.TokkunMashInterval = new CItemInteger(CLangManager.LangInstance.GetString("SETTINGS_TRAINING_JUMPINTERVAL"), 1, 9999, OpenTaiko.ConfigIni.TokkunMashInterval, - CLangManager.LangInstance.GetString("SETTINGS_TRAINING_JUMPINTERVAL_DESC")); - this.list項目リスト.Add(TokkunMashInterval); - - this.iTaikoIgnoreSongUnlockables = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_GAME_IGNORESONGUNLOCKABLES"), OpenTaiko.ConfigIni.bIgnoreSongUnlockables, - CLangManager.LangInstance.GetString("SETTINGS_GAME_IGNORESONGUNLOCKABLES_DESC")); - this.list項目リスト.Add(this.iTaikoIgnoreSongUnlockables); - - this.iDrumsGoToKeyAssign = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME"), CItemBase.EPanelType.Normal, - CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_DESC")); - this.list項目リスト.Add(this.iDrumsGoToKeyAssign); - - this.iDrumsGoToTrainingKeyAssign = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_TRAINING"), CItemBase.EPanelType.Normal, - CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_TRAINING_DESC")); - this.list項目リスト.Add(this.iDrumsGoToTrainingKeyAssign); - - OnListMenuの初期化(); + OnListMenuの初期化(); + if (refresh) { this.n現在の選択項目 = 0; - this.eメニュー種別 = Eメニュー種別.Drums; - } - - #endregion - - - /// - /// ESC押下時の右メニュー描画 - /// - public void tEsc押下() { - if (this.b要素値にフォーカス中) // #32059 2013.9.17 add yyagi - { - this.b要素値にフォーカス中 = false; - } - - switch (eメニュー種別) { - case Eメニュー種別.KeyAssignSystem: - t項目リストの設定_System(); - break; - case Eメニュー種別.KeyAssignDrums: - case Eメニュー種別.KeyAssignTraining: - t項目リストの設定_Drums(); - break; - } - - // これ以外なら何もしない - } - public void tEnter押下() { - OpenTaiko.Skin.soundDecideSFX.tPlay(); - if (this.b要素値にフォーカス中) { - this.b要素値にフォーカス中 = false; - } else if (this.list項目リスト[this.n現在の選択項目].e種別 == CItemBase.E種別.整数) { - this.b要素値にフォーカス中 = true; - } - #region [ 個々のキーアサイン ] - //太鼓のキー設定。 - else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTaikoLRed) { - OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.Drums, EKeyConfigPad.LRed); - } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTaikoRRed) { - OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.Drums, EKeyConfigPad.RRed); - } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTaikoLBlue) { - OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.Drums, EKeyConfigPad.LBlue); - } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTaikoRBlue) { - OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.Drums, EKeyConfigPad.RBlue); - } - - //太鼓のキー設定。2P - else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTaikoLRed2P) { - OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.Drums, EKeyConfigPad.LRed2P); - } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTaikoRRed2P) { - OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.Drums, EKeyConfigPad.RRed2P); - } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTaikoLBlue2P) { - OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.Drums, EKeyConfigPad.LBlue2P); - } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTaikoRBlue2P) { - OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.Drums, EKeyConfigPad.RBlue2P); - } - - //太鼓のキー設定。3P - else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTaikoLRed3P) { - OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.Drums, EKeyConfigPad.LRed3P); - } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTaikoRRed3P) { - OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.Drums, EKeyConfigPad.RRed3P); - } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTaikoLBlue3P) { - OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.Drums, EKeyConfigPad.LBlue3P); - } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTaikoRBlue3P) { - OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.Drums, EKeyConfigPad.RBlue3P); - } - - //太鼓のキー設定。4P - else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTaikoLRed4P) { - OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.Drums, EKeyConfigPad.LRed4P); - } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTaikoRRed4P) { - OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.Drums, EKeyConfigPad.RRed4P); - } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTaikoLBlue4P) { - OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.Drums, EKeyConfigPad.LBlue4P); - } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTaikoRBlue4P) { - OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.Drums, EKeyConfigPad.RBlue4P); - } - - //太鼓のキー設定。5P - else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTaikoLRed5P) { - OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.Drums, EKeyConfigPad.LRed5P); - } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTaikoRRed5P) { - OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.Drums, EKeyConfigPad.RRed5P); - } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTaikoLBlue5P) { - OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.Drums, EKeyConfigPad.LBlue5P); - } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTaikoRBlue5P) { - OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.Drums, EKeyConfigPad.RBlue5P); - } - - // Konga claps - else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignKongaClap) { - OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.Drums, EKeyConfigPad.Clap); - } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignKongaClap2P) { - OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.Drums, EKeyConfigPad.Clap2P); - } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignKongaClap3P) { - OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.Drums, EKeyConfigPad.Clap3P); - } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignKongaClap4P) { - OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.Drums, EKeyConfigPad.Clap4P); - } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignKongaClap5P) { - OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.Drums, EKeyConfigPad.Clap5P); - } - - // Menu controls - else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignDecide) { - OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.Drums, EKeyConfigPad.Decide); - } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignCancel) { - OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.Drums, EKeyConfigPad.Cancel); - } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignLeftChange) { - OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.Drums, EKeyConfigPad.LeftChange); - } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignRightChange) { - OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.Drums, EKeyConfigPad.RightChange); - } - - // System controls - else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignSystemCapture) { - OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.System, EKeyConfigPad.Capture); - } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignSystemSongVolIncrease) { - OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.System, EKeyConfigPad.SongVolumeIncrease); - } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignSystemSongVolDecrease) { - OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.System, EKeyConfigPad.SongVolumeDecrease); - } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignSystemDisplayHit) { - OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.System, EKeyConfigPad.DisplayHits); - } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignSystemDisplayDebug) { - OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.System, EKeyConfigPad.DisplayDebug); - } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignSystemQuickConfig) { - OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.System, EKeyConfigPad.QuickConfig); - } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignSystemNewHeya) { - OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.System, EKeyConfigPad.NewHeya); - } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignSystemSortSongs) { - OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.System, EKeyConfigPad.SortSongs); - } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignSystemToggleAutoP1) { - OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.System, EKeyConfigPad.ToggleAutoP1); - } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignSystemToggleAutoP2) { - OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.System, EKeyConfigPad.ToggleAutoP2); - } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignSystemToggleTrainingMode) { - OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.System, EKeyConfigPad.ToggleTrainingMode); - } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignSystemCycleVideoDisplayMode) { - OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.System, EKeyConfigPad.CycleVideoDisplayMode); - } - - // Training controls - else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTrainingPause) { - OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.Drums, EKeyConfigPad.TrainingPause); - } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTrainingToggleAuto) { - OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.Drums, EKeyConfigPad.TrainingToggleAuto); - } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTrainingBookmark) { - OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.Drums, EKeyConfigPad.TrainingBookmark); - } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTrainingIncreaseScrollSpeed) { - OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.Drums, EKeyConfigPad.TrainingIncreaseScrollSpeed); - } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTrainingDecreaseScrollSpeed) { - OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.Drums, EKeyConfigPad.TrainingDecreaseScrollSpeed); - } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTrainingIncreaseSongSpeed) { - OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.Drums, EKeyConfigPad.TrainingIncreaseSongSpeed); - } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTrainingDecreaseSongSpeed) { - OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.Drums, EKeyConfigPad.TrainingDecreaseSongSpeed); - } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTrainingBranchNormal) { - OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.Drums, EKeyConfigPad.TrainingBranchNormal); - } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTrainingBranchExpert) { - OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.Drums, EKeyConfigPad.TrainingBranchExpert); - } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTrainingBranchMaster) { - OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.Drums, EKeyConfigPad.TrainingBranchMaster); - } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTrainingMoveForwardMeasure) { - OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.Drums, EKeyConfigPad.TrainingMoveForwardMeasure); - } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTrainingMoveBackMeasure) { - OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.Drums, EKeyConfigPad.TrainingMoveBackMeasure); - } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTrainingSkipForwardMeasure) { - OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.Drums, EKeyConfigPad.TrainingSkipForwardMeasure); - } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTrainingSkipBackMeasure) { - OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.Drums, EKeyConfigPad.TrainingSkipBackMeasure); - } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTrainingJumpToFirstMeasure) { - OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.Drums, EKeyConfigPad.TrainingJumpToFirstMeasure); - } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTrainingJumpToLastMeasure) { - OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.Drums, EKeyConfigPad.TrainingJumpToLastMeasure); - } - #endregion - else { - // #27029 2012.1.5 from - this.list項目リスト[this.n現在の選択項目].tEnter押下(); - - if (this.list項目リスト[this.n現在の選択項目] == this.iSystemLanguage) { - OpenTaiko.ConfigIni.sLang = CLangManager.intToLang(this.iSystemLanguage.n現在選択されている項目番号); - CLangManager.langAttach(OpenTaiko.ConfigIni.sLang); - - prvFont?.Dispose(); - OpenTaiko.stageコンフィグ.ftフォント?.Dispose(); - OpenTaiko.stageタイトル.pfMenuTitle?.Dispose(); - OpenTaiko.stageタイトル.pfBoxText?.Dispose(); - - prvFont = HPrivateFastFont.tInstantiateMainFont(OpenTaiko.Skin.Config_Font_Scale); - OpenTaiko.stageコンフィグ.ftフォント = HPrivateFastFont.tInstantiateMainFont((int)OpenTaiko.Skin.Config_Font_Scale_Description, CFontRenderer.FontStyle.Bold); - OpenTaiko.stageタイトル.pfMenuTitle = HPrivateFastFont.tInstantiateMainFont(OpenTaiko.Skin.Title_ModeSelect_Title_Scale[0]); - OpenTaiko.stageタイトル.pfBoxText = HPrivateFastFont.tInstantiateBoxFont(OpenTaiko.Skin.Title_ModeSelect_Title_Scale[1]); - - t項目リストの設定_System(refresh: false); - OpenTaiko.stageコンフィグ.ReloadMenus(); - } - // Enter押下後の後処理 - - if (this.list項目リスト[this.n現在の選択項目] == this.iSystemFullscreen) { - OpenTaiko.app.b次のタイミングで全画面_ウィンドウ切り替えを行う = true; - } else if (this.list項目リスト[this.n現在の選択項目] == this.iSystemVSyncWait) { - OpenTaiko.ConfigIni.bEnableVSync = this.iSystemVSyncWait.bON; - OpenTaiko.app.b次のタイミングで垂直帰線同期切り替えを行う = true; - } - #region [ キーアサインへの遷移と脱出 ] - else if (this.list項目リスト[this.n現在の選択項目] == this.iSystemGoToKeyAssign) // #24609 2011.4.12 yyagi - { - t項目リストの設定_KeyAssignSystem(); - } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignSystemReturnToMenu) // #24609 2011.4.12 yyagi - { - tConfigIniへ記録する(); - t項目リストの設定_System(); - } else if (this.list項目リスト[this.n現在の選択項目] == this.iDrumsGoToKeyAssign) // #24525 2011.3.15 yyagi - { - tConfigIniへ記録する(); - t項目リストの設定_KeyAssignDrums(); - } else if (this.list項目リスト[this.n現在の選択項目] == this.iDrumsGoToTrainingKeyAssign) { - tConfigIniへ記録する(); - t項目リストの設定_KeyAssignTraining(); - } else if (this.list項目リスト[this.n現在の選択項目] == this.iDrumsGoToCalibration) { - OpenTaiko.stageコンフィグ.actCalibrationMode.Start(); - } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignDrumsReturnToMenu || - this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTrainingReturnToMenu) // #24525 2011.3.15 yyagi - { - t項目リストの設定_Drums(); - } - #endregion - #region [ スキン項目でEnterを押下した場合に限り、スキンの縮小サンプルを生成する。] - else if (this.list項目リスト[this.n現在の選択項目] == this.iSystemSkinSubfolder) // #28195 2012.5.2 yyagi - { - tGenerateSkinSample(); - } - #endregion - #region [ 曲データ一覧の再読み込み ] - else if (this.list項目リスト[this.n現在の選択項目] == this.iSystemReloadDTX) // #32081 2013.10.21 yyagi - { - if (OpenTaiko.EnumSongs.IsEnumerating) { - // Debug.WriteLine( "バックグラウンドでEnumeratingSongs中だったので、一旦中断します。" ); - OpenTaiko.EnumSongs.Abort(); - OpenTaiko.actEnumSongs.DeActivate(); - } - - OpenTaiko.EnumSongs.StartEnumFromDisk(); - OpenTaiko.EnumSongs.ChangeEnumeratePriority(ThreadPriority.Normal); - OpenTaiko.actEnumSongs.bコマンドでの曲データ取得 = true; - OpenTaiko.actEnumSongs.Activate(); - OpenTaiko.stageSongSelect.actSongList.ResetSongIndex(); - } else if (this.list項目リスト[this.n現在の選択項目] == this.iSystemHardReloadDTX) // #32081 2013.10.21 yyagi - { - if (OpenTaiko.EnumSongs.IsEnumerating) { - OpenTaiko.EnumSongs.Abort(); - OpenTaiko.actEnumSongs.DeActivate(); - } - - OpenTaiko.EnumSongs.StartEnumFromDisk(true); - OpenTaiko.EnumSongs.ChangeEnumeratePriority(ThreadPriority.Normal); - OpenTaiko.actEnumSongs.bコマンドでの曲データ取得 = true; - OpenTaiko.actEnumSongs.Activate(); - OpenTaiko.stageSongSelect.actSongList.ResetSongIndex(); - } else if (this.list項目リスト[this.n現在の選択項目] == this.isSystemImportingScore) { - // Running in a separate thread so the game doesn't freeze - ScoreIniImportThread = new Thread(CScoreIni_Importer.ImportScoreInisToSavesDb3); - ScoreIniImportThread.Start(); - } - #endregion - } + this.eメニュー種別 = Eメニュー種別.System; } - private void tGenerateSkinSample() { - - nSkinIndex = ((CItemList)this.list項目リスト[this.n現在の選択項目]).n現在選択されている項目番号; - if (nSkinSampleIndex != nSkinIndex) { - string path = skinSubFolders[nSkinIndex]; - path = System.IO.Path.Combine(path, @$"Graphics{Path.DirectorySeparatorChar}1_Title{Path.DirectorySeparatorChar}Background.png"); - SKBitmap bmSrc = SKBitmap.Decode(path); - - int _w = OpenTaiko.Skin.Resolution[0] / 4; - int _h = OpenTaiko.Skin.Resolution[1] / 4; - - if (txSkinSample1 != null) { - OpenTaiko.tDisposeSafely(ref txSkinSample1); - } - txSkinSample1 = OpenTaiko.tテクスチャの生成(bmSrc, false); - - txSkinSample1.vcScaleRatio = new Silk.NET.Maths.Vector3D(_w / (float)txSkinSample1.szTextureSize.Width, _h / (float)txSkinSample1.szTextureSize.Height, 0); - - bmSrc.Dispose(); - nSkinSampleIndex = nSkinIndex; - } - } - - #region [ 項目リストの設定 ( Exit, KeyAssignSystem/Drums) ] - public void t項目リストの設定_Exit() { - this.tConfigIniへ記録する(); - this.eメニュー種別 = Eメニュー種別.Unknown; - } - public void t項目リストの設定_KeyAssignSystem() { - this.list項目リスト.Clear(); - // #27029 2012.1.5 from: 説明文は最大9行→13行に変更。 - - this.iKeyAssignSystemReturnToMenu = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_MENU_RETURN"), CItemBase.EPanelType.Other, - CLangManager.LangInstance.GetString("SETTINGS_MENU_RETURN_DESC")); - this.list項目リスト.Add(this.iKeyAssignSystemReturnToMenu); - - this.iKeyAssignSystemCapture = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_SYSTEM_CAPTURE"), - CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_SYSTEM_CAPTURE_DESC")); - this.list項目リスト.Add(this.iKeyAssignSystemCapture); - this.iKeyAssignSystemSongVolIncrease = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_SYSTEM_INCREASEVOL"), - CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_SYSTEM_INCREASEVOL_DESC")); - this.list項目リスト.Add(this.iKeyAssignSystemSongVolIncrease); - this.iKeyAssignSystemSongVolDecrease = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_SYSTEM_DECREASEVOL"), - CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_SYSTEM_DECREASEVOL_DESC")); - this.list項目リスト.Add(this.iKeyAssignSystemSongVolDecrease); - this.iKeyAssignSystemDisplayHit = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_SYSTEM_DISPLAYHITS"), - CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_SYSTEM_DISPLAYHITS_DESC")); - this.list項目リスト.Add(this.iKeyAssignSystemDisplayHit); - this.iKeyAssignSystemDisplayDebug = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_SYSTEM_DISPLAYDEBUG"), - CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_SYSTEM_DISPLAYDEBUG_DESC")); - this.list項目リスト.Add(this.iKeyAssignSystemDisplayDebug); - this.iKeyAssignSystemQuickConfig = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_SYSTEM_QUICKCONFIG"), - CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_SYSTEM_QUICKCONFIG_DESC")); - this.list項目リスト.Add(this.iKeyAssignSystemQuickConfig); - this.iKeyAssignSystemNewHeya = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_SYSTEM_QUICKHEYA"), - CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_SYSTEM_QUICKHEYA_DESC")); - this.list項目リスト.Add(this.iKeyAssignSystemNewHeya); - this.iKeyAssignSystemSortSongs = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_SYSTEM_SONGSORT"), - CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_SYSTEM_SONGSORT_DESC")); - this.list項目リスト.Add(this.iKeyAssignSystemSortSongs); - this.iKeyAssignSystemToggleAutoP1 = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_SYSTEM_AUTO1P"), - CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_SYSTEM_AUTO1P_DESC")); - this.list項目リスト.Add(this.iKeyAssignSystemToggleAutoP1); - this.iKeyAssignSystemToggleAutoP2 = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_SYSTEM_AUTO2P"), - CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_SYSTEM_AUTO2P_DESC")); - this.list項目リスト.Add(this.iKeyAssignSystemToggleAutoP2); - this.iKeyAssignSystemToggleTrainingMode = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_SYSTEM_TRAINING"), - CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_SYSTEM_TRAINING_DESC")); - this.list項目リスト.Add(this.iKeyAssignSystemToggleTrainingMode); - this.iKeyAssignSystemCycleVideoDisplayMode = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_SYSTEM_BGMOVIEDISPLAY"), - CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_SYSTEM_BGMOVIEDISPLAY_DESC")); - this.list項目リスト.Add(this.iKeyAssignSystemCycleVideoDisplayMode); - - OnListMenuの初期化(); - this.n現在の選択項目 = 0; - this.eメニュー種別 = Eメニュー種別.KeyAssignSystem; - } - public void t項目リストの設定_KeyAssignDrums() { - this.list項目リスト.Clear(); - // #27029 2012.1.5 from: 説明文は最大9行→13行に変更。 - - this.iKeyAssignDrumsReturnToMenu = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_MENU_RETURN"), CItemBase.EPanelType.Other, - CLangManager.LangInstance.GetString("SETTINGS_MENU_RETURN_DESC")); - this.list項目リスト.Add(this.iKeyAssignDrumsReturnToMenu); - - this.iKeyAssignTaikoLRed = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_LEFTRED"), - CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_LEFTRED_DESC")); - this.list項目リスト.Add(this.iKeyAssignTaikoLRed); - this.iKeyAssignTaikoRRed = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_RIGHTRED"), - CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_RIGHTRED_DESC")); - this.list項目リスト.Add(this.iKeyAssignTaikoRRed); - this.iKeyAssignTaikoLBlue = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_LEFTBLUE"), - CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_LEFTBLUE_DESC")); - this.list項目リスト.Add(this.iKeyAssignTaikoLBlue); - this.iKeyAssignTaikoRBlue = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_RIGHTBLUE"), - CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_RIGHTBLUE_DESC")); - this.list項目リスト.Add(this.iKeyAssignTaikoRBlue); - this.iKeyAssignKongaClap = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_CLAP"), - CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_CLAP_DESC")); - this.list項目リスト.Add(this.iKeyAssignKongaClap); - - this.iKeyAssignTaikoLRed2P = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_LEFTRED2P"), - CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_LEFTRED2P_DESC")); - this.list項目リスト.Add(this.iKeyAssignTaikoLRed2P); - this.iKeyAssignTaikoRRed2P = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_RIGHTRED2P"), - CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_RIGHTRED2P_DESC")); - this.list項目リスト.Add(this.iKeyAssignTaikoRRed2P); - this.iKeyAssignTaikoLBlue2P = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_LEFTBLUE2P"), - CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_LEFTBLUE2P_DESC")); - this.list項目リスト.Add(this.iKeyAssignTaikoLBlue2P); - this.iKeyAssignTaikoRBlue2P = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_RIGHTBLUE2P"), - CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_RIGHTBLUE2P_DESC")); - this.list項目リスト.Add(this.iKeyAssignTaikoRBlue2P); - this.iKeyAssignKongaClap2P = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_CLAP2P"), - CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_CLAP2P_DESC")); - this.list項目リスト.Add(this.iKeyAssignKongaClap2P); - - this.iKeyAssignTaikoLRed3P = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_LEFTRED3P"), - CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_LEFTRED3P_DESC")); - this.list項目リスト.Add(this.iKeyAssignTaikoLRed3P); - this.iKeyAssignTaikoRRed3P = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_RIGHTRED3P"), - CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_RIGHTRED3P_DESC")); - this.list項目リスト.Add(this.iKeyAssignTaikoRRed3P); - this.iKeyAssignTaikoLBlue3P = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_LEFTBLUE3P"), - CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_LEFTBLUE3P_DESC")); - this.list項目リスト.Add(this.iKeyAssignTaikoLBlue3P); - this.iKeyAssignTaikoRBlue3P = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_RIGHTBLUE3P"), - CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_RIGHTBLUE3P_DESC")); - this.list項目リスト.Add(this.iKeyAssignTaikoRBlue3P); - this.iKeyAssignKongaClap3P = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_CLAP3P"), - CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_CLAP3P_DESC")); - this.list項目リスト.Add(this.iKeyAssignKongaClap3P); - - this.iKeyAssignTaikoLRed4P = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_LEFTRED4P"), - CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_LEFTRED4P_DESC")); - this.list項目リスト.Add(this.iKeyAssignTaikoLRed4P); - this.iKeyAssignTaikoRRed4P = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_RIGHTRED4P"), - CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_RIGHTRED4P_DESC")); - this.list項目リスト.Add(this.iKeyAssignTaikoRRed4P); - this.iKeyAssignTaikoLBlue4P = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_LEFTBLUE4P"), - CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_LEFTBLUE4P_DESC")); - this.list項目リスト.Add(this.iKeyAssignTaikoLBlue4P); - this.iKeyAssignTaikoRBlue4P = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_RIGHTBLUE4P"), - CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_RIGHTBLUE4P_DESC")); - this.list項目リスト.Add(this.iKeyAssignTaikoRBlue4P); - this.iKeyAssignKongaClap4P = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_CLAP4P"), - CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_CLAP4P_DESC")); - this.list項目リスト.Add(this.iKeyAssignKongaClap4P); - - this.iKeyAssignTaikoLRed5P = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_LEFTRED5P"), - CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_LEFTRED5P_DESC")); - this.list項目リスト.Add(this.iKeyAssignTaikoLRed5P); - this.iKeyAssignTaikoRRed5P = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_RIGHTRED5P"), - CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_RIGHTRED5P_DESC")); - this.list項目リスト.Add(this.iKeyAssignTaikoRRed5P); - this.iKeyAssignTaikoLBlue5P = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_LEFTBLUE5P"), - CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_LEFTBLUE5P_DESC")); - this.list項目リスト.Add(this.iKeyAssignTaikoLBlue5P); - this.iKeyAssignTaikoRBlue5P = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_RIGHTBLUE5P"), - CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_RIGHTBLUE5P_DESC")); - this.list項目リスト.Add(this.iKeyAssignTaikoRBlue5P); - this.iKeyAssignKongaClap5P = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_CLAP5P"), - CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_CLAP5P_DESC")); - this.list項目リスト.Add(this.iKeyAssignKongaClap5P); - - this.iKeyAssignDecide = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_DECIDE"), - CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_DECIDE_DESC")); - this.list項目リスト.Add(this.iKeyAssignDecide); - this.iKeyAssignCancel = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_CANCEL"), - CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_CANCEL_DESC")); - this.list項目リスト.Add(this.iKeyAssignCancel); - - this.iKeyAssignLeftChange = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_LEFTCHANGE"), - CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_LEFTCHANGE_DESC")); - this.list項目リスト.Add(this.iKeyAssignLeftChange); - this.iKeyAssignRightChange = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_RIGHTCHANGE"), - CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_RIGHTCHANGE_DESC")); - this.list項目リスト.Add(this.iKeyAssignRightChange); - - OnListMenuの初期化(); - this.n現在の選択項目 = 0; - this.eメニュー種別 = Eメニュー種別.KeyAssignDrums; - } - public void t項目リストの設定_KeyAssignTraining() { - this.list項目リスト.Clear(); - - this.iKeyAssignTrainingReturnToMenu = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_MENU_RETURN"), CItemBase.EPanelType.Other, - CLangManager.LangInstance.GetString("SETTINGS_MENU_RETURN_DESC")); - this.list項目リスト.Add(this.iKeyAssignTrainingReturnToMenu); + } + #endregion - this.iKeyAssignTrainingPause = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_TRAINING_PAUSE"), - CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_TRAINING_PAUSE_DESC")); - this.list項目リスト.Add(this.iKeyAssignTrainingPause); + // Gameplay options + #region [ t項目リストの設定_Drums() ] - this.iKeyAssignTrainingToggleAuto = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_TRAINING_AUTO"), - CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_TRAINING_AUTO_DESC")); - this.list項目リスト.Add(this.iKeyAssignTrainingToggleAuto); + public void t項目リストの設定_Drums() { + this.tConfigIniへ記録する(); + this.list項目リスト.Clear(); - this.iKeyAssignTrainingBookmark = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_TRAINING_BOOKMARK"), - CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_TRAINING_BOOKMARK_DESC")); - this.list項目リスト.Add(this.iKeyAssignTrainingBookmark); + // #27029 2012.1.5 from: 説明文は最大9行→13行に変更。 - this.iKeyAssignTrainingIncreaseScrollSpeed = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_TRAINING_INCREASESCROLL"), - CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_TRAINING_INCREASESCROLL_DESC")); - this.list項目リスト.Add(this.iKeyAssignTrainingIncreaseScrollSpeed); + this.iDrumsReturnToMenu = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_MENU_RETURN"), CItemBase.EPanelType.Other, + CLangManager.LangInstance.GetString("SETTINGS_MENU_RETURN_DESC")); + this.list項目リスト.Add(this.iDrumsReturnToMenu); - this.iKeyAssignTrainingDecreaseScrollSpeed = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_TRAINING_DECREASESCROLL"), - CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_TRAINING_DECREASESCROLL_DESC")); - this.list項目リスト.Add(this.iKeyAssignTrainingDecreaseScrollSpeed); + this.iDrumsGoToCalibration = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_GAME_CALIBRATION"), CItemBase.EPanelType.Other, + CLangManager.LangInstance.GetString("SETTINGS_GAME_CALIBRATION_DESC")); + this.list項目リスト.Add(this.iDrumsGoToCalibration); - this.iKeyAssignTrainingIncreaseSongSpeed = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_TRAINING_INCREASESPEED"), - CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_TRAINING_INCREASESPEED_DESC")); - this.list項目リスト.Add(this.iKeyAssignTrainingIncreaseSongSpeed); + this.iRollsPerSec = new CItemInteger(CLangManager.LangInstance.GetString("SETTINGS_GAME_AUTOROLL"), 0, 1000, OpenTaiko.ConfigIni.nRollsPerSec, + CLangManager.LangInstance.GetString("SETTINGS_GAME_AUTOROLL_DESC")); + this.list項目リスト.Add(this.iRollsPerSec); - this.iKeyAssignTrainingDecreaseSongSpeed = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_TRAINING_DECREASESPEED"), - CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_TRAINING_DECREASESPEED_DESC")); - this.list項目リスト.Add(this.iKeyAssignTrainingDecreaseSongSpeed); + this.iAILevel = new CItemInteger(CLangManager.LangInstance.GetString("SETTINGS_GAME_AILEVEL"), 1, 10, OpenTaiko.ConfigIni.nDefaultAILevel, + CLangManager.LangInstance.GetString("SETTINGS_GAME_AILEVEL_DESC")); + this.list項目リスト.Add(this.iAILevel); - this.iKeyAssignTrainingBranchNormal = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_TRAINING_BRANCHNORMAL"), - CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_TRAINING_BRANCHNORMAL_DESC")); - this.list項目リスト.Add(this.iKeyAssignTrainingBranchNormal); + this.iSystemRisky = new CItemInteger(CLangManager.LangInstance.GetString("SETTINGS_GAME_BADCOUNT"), 0, 10, OpenTaiko.ConfigIni.nRisky, + CLangManager.LangInstance.GetString("SETTINGS_GAME_BADCOUNT_DESC")); + this.list項目リスト.Add(this.iSystemRisky); - this.iKeyAssignTrainingBranchExpert = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_TRAINING_BRANCHEXPERT"), - CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_TRAINING_BRANCHEXPERT_DESC")); - this.list項目リスト.Add(this.iKeyAssignTrainingBranchExpert); + this.iTaikoNoInfo = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_GAME_NOINFO"), OpenTaiko.ConfigIni.bNoInfo, + CLangManager.LangInstance.GetString("SETTINGS_GAME_NOINFO_DESC")); + this.list項目リスト.Add(this.iTaikoNoInfo); - this.iKeyAssignTrainingBranchMaster = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_TRAINING_BRANCHMASTER"), - CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_TRAINING_BRANCHMASTER_DESC")); - this.list項目リスト.Add(this.iKeyAssignTrainingBranchMaster); + this.iDrumsTight = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_GAME_NOTELOCK"), OpenTaiko.ConfigIni.bTight, + CLangManager.LangInstance.GetString("SETTINGS_GAME_NOTELOCK_DESC")); + this.list項目リスト.Add(this.iDrumsTight); - this.iKeyAssignTrainingMoveForwardMeasure = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_TRAINING_MOVEFORWARD"), - CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_TRAINING_MOVEFORWARD_DESC")); - this.list項目リスト.Add(this.iKeyAssignTrainingMoveForwardMeasure); + this.iSystemMinComboDrums = new CItemInteger(CLangManager.LangInstance.GetString("SETTINGS_GAME_COMBODISPLAY"), 1, 0x1869f, OpenTaiko.ConfigIni.nMinDisplayedCombo.Drums, + CLangManager.LangInstance.GetString("SETTINGS_GAME_COMBODISPLAY_DESC")); + this.list項目リスト.Add(this.iSystemMinComboDrums); - this.iKeyAssignTrainingMoveBackMeasure = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_TRAINING_MOVEBACKWARD"), - CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_TRAINING_MOVEBACKWARD_DESC")); - this.list項目リスト.Add(this.iKeyAssignTrainingMoveBackMeasure); + this.iGlobalOffsetMs = new CItemInteger(CLangManager.LangInstance.GetString("SETTINGS_GAME_GLOBALOFFSET"), -9999, 9999, OpenTaiko.ConfigIni.nGlobalOffsetMs, + CLangManager.LangInstance.GetString("SETTINGS_GAME_GLOBALOFFSET_DESC")); + this.list項目リスト.Add(this.iGlobalOffsetMs); - this.iKeyAssignTrainingSkipForwardMeasure = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_TRAINING_SKIPFORWARD"), - CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_TRAINING_SKIPFORWARD_DESC")); - this.list項目リスト.Add(this.iKeyAssignTrainingSkipForwardMeasure); + this.iTaikoDefaultCourse = new CItemList(CLangManager.LangInstance.GetString("SETTINGS_GAME_DEFAULTDIFF"), CItemBase.EPanelType.Normal, OpenTaiko.ConfigIni.nDefaultCourse, + CLangManager.LangInstance.GetString("SETTINGS_GAME_DEFAULTDIFF_DESC"), + new string[] { + CLangManager.LangInstance.GetString("DIFF_EASY"), + CLangManager.LangInstance.GetString("DIFF_NORMAL"), + CLangManager.LangInstance.GetString("DIFF_HARD"), + CLangManager.LangInstance.GetString("DIFF_EX"), + CLangManager.LangInstance.GetString("DIFF_EXTRA"), + CLangManager.LangInstance.GetString("DIFF_EXEXTRA") }); + this.list項目リスト.Add(this.iTaikoDefaultCourse); - this.iKeyAssignTrainingSkipBackMeasure = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_TRAINING_SKIPBACKWARD"), - CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_TRAINING_SKIPBACKWARD_DESC")); - this.list項目リスト.Add(this.iKeyAssignTrainingSkipBackMeasure); + this.iTaikoScoreMode = new CItemList(CLangManager.LangInstance.GetString("SETTINGS_GAME_SCOREMODE"), CItemBase.EPanelType.Normal, OpenTaiko.ConfigIni.nScoreMode, + CLangManager.LangInstance.GetString("SETTINGS_GAME_SCOREMODE_DESC"), + new string[] { "TYPE-A", "TYPE-B", "TYPE-C" }); + this.list項目リスト.Add(this.iTaikoScoreMode); - this.iKeyAssignTrainingJumpToFirstMeasure = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_TRAINING_JUMPTOFIRST"), - CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_TRAINING_JUMPTOFIRST_DESC")); - this.list項目リスト.Add(this.iKeyAssignTrainingJumpToFirstMeasure); + this.ShinuchiMode = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_GAME_SHINUCHI"), OpenTaiko.ConfigIni.ShinuchiMode, CItemBase.EPanelType.Normal, + CLangManager.LangInstance.GetString("SETTINGS_GAME_SHINUCHI_DESC")); + this.list項目リスト.Add(this.ShinuchiMode); - this.iKeyAssignTrainingJumpToLastMeasure = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_TRAINING_JUMPTOLAST"), - CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_TRAINING_JUMPTOLAST_DESC")); - this.list項目リスト.Add(this.iKeyAssignTrainingJumpToLastMeasure); + // FIXME: This does nothing vvv + this.iTaikoBranchGuide = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_GAME_BRANCHGUIDE"), OpenTaiko.ConfigIni.bBranchGuide, + CLangManager.LangInstance.GetString("SETTINGS_GAME_BRANCHGUIDE_DESC")); + this.list項目リスト.Add(this.iTaikoBranchGuide); - OnListMenuの初期化(); - this.n現在の選択項目 = 0; - this.eメニュー種別 = Eメニュー種別.KeyAssignTraining; - } - #endregion - public void t次に移動() { - OpenTaiko.Skin.soundカーソル移動音.tPlay(); - if (this.b要素値にフォーカス中) { - this.list項目リスト[this.n現在の選択項目].t項目値を前へ移動(); - } else { - this.n目標のスクロールカウンタ += 100; - } - } - public void t前に移動() { - OpenTaiko.Skin.soundカーソル移動音.tPlay(); - if (this.b要素値にフォーカス中) { - this.list項目リスト[this.n現在の選択項目].t項目値を次へ移動(); - } else { - this.n目標のスクロールカウンタ -= 100; - } - } - - // CActivity 実装 - - public override void Activate() { - if (this.IsActivated) - return; + this.iTaikoBranchAnime = new CItemList(CLangManager.LangInstance.GetString("SETTINGS_GAME_BRANCHANIME"), CItemBase.EPanelType.Normal, OpenTaiko.ConfigIni.nBranchAnime, + CLangManager.LangInstance.GetString("SETTINGS_GAME_BRANCHANIME_DESC"), + new string[] { "TYPE-A", "TYPE-B" }); + this.list項目リスト.Add(this.iTaikoBranchAnime); - this.list項目リスト = new List(); - this.eメニュー種別 = Eメニュー種別.Unknown; - - #region [ スキン選択肢と、現在選択中のスキン(index)の準備 #28195 2012.5.2 yyagi ] - int ns = (OpenTaiko.Skin.strSystemSkinSubfolders == null) ? 0 : OpenTaiko.Skin.strSystemSkinSubfolders.Length; - int nb = (OpenTaiko.Skin.strBoxDefSkinSubfolders == null) ? 0 : OpenTaiko.Skin.strBoxDefSkinSubfolders.Length; - skinSubFolders = new string[ns + nb]; - for (int i = 0; i < ns; i++) { - skinSubFolders[i] = OpenTaiko.Skin.strSystemSkinSubfolders[i]; - } - for (int i = 0; i < nb; i++) { - skinSubFolders[ns + i] = OpenTaiko.Skin.strBoxDefSkinSubfolders[i]; - } - skinSubFolder_org = OpenTaiko.Skin.GetCurrentSkinSubfolderFullName(true); - Array.Sort(skinSubFolders); - skinNames = CSkin.GetSkinName(skinSubFolders); - nSkinIndex = Array.BinarySearch(skinSubFolders, skinSubFolder_org); - if (nSkinIndex < 0) // 念のため - { - nSkinIndex = 0; - } - nSkinSampleIndex = -1; - #endregion - - this.t項目リストの設定_Drums(); - this.t項目リストの設定_System(); // 順番として、最後にSystemを持ってくること。設定一覧の初期位置がSystemのため。 + this.iTaikoGameMode = new CItemList(CLangManager.LangInstance.GetString("SETTINGS_GAME_SURVIVAL"), CItemBase.EPanelType.Normal, (int)OpenTaiko.ConfigIni.eGameMode, + CLangManager.LangInstance.GetString("SETTINGS_GAME_SURVIVAL_DESC"), + new string[] { "OFF", "TYPE-A", "TYPE-B" }); + this.list項目リスト.Add(this.iTaikoGameMode); + + this.iTaikoBigNotesJudge = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_GAME_BIGNOTEJUDGE"), OpenTaiko.ConfigIni.bJudgeBigNotes, + CLangManager.LangInstance.GetString("SETTINGS_GAME_BIGNOTEJUDGE_DESC")); + this.list項目リスト.Add(this.iTaikoBigNotesJudge); + + this.iTaikoForceNormalGauge = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_GAME_NORMALGAUGE"), OpenTaiko.ConfigIni.bForceNormalGauge, + CLangManager.LangInstance.GetString("SETTINGS_GAME_NORMALGAUGE_DESC")); + this.list項目リスト.Add(this.iTaikoForceNormalGauge); + + this.iTaikoJudgeCountDisp = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_GAME_SCOREDISPLAY"), OpenTaiko.ConfigIni.bJudgeCountDisplay, + CLangManager.LangInstance.GetString("SETTINGS_GAME_SCOREDISPLAY_DESC")); + this.list項目リスト.Add(this.iTaikoJudgeCountDisp); + + this.iShowExExtraAnime = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_GAME_EXEXTRAANIME"), OpenTaiko.ConfigIni.ShowExExtraAnime, + CLangManager.LangInstance.GetString("SETTINGS_GAME_EXEXTRAANIME_DESC")); + this.list項目リスト.Add(this.iShowExExtraAnime); + + this.TokkunSkipCount = new CItemInteger(CLangManager.LangInstance.GetString("SETTINGS_TRAINING_SKIPCOUNT"), 1, 99, OpenTaiko.ConfigIni.TokkunSkipMeasures, + CLangManager.LangInstance.GetString("SETTINGS_TRAINING_SKIPCOUNT_DESC")); + this.list項目リスト.Add(TokkunSkipCount); + + this.TokkunMashInterval = new CItemInteger(CLangManager.LangInstance.GetString("SETTINGS_TRAINING_JUMPINTERVAL"), 1, 9999, OpenTaiko.ConfigIni.TokkunMashInterval, + CLangManager.LangInstance.GetString("SETTINGS_TRAINING_JUMPINTERVAL_DESC")); + this.list項目リスト.Add(TokkunMashInterval); + + this.iTaikoIgnoreSongUnlockables = new CItemToggle(CLangManager.LangInstance.GetString("SETTINGS_GAME_IGNORESONGUNLOCKABLES"), OpenTaiko.ConfigIni.bIgnoreSongUnlockables, + CLangManager.LangInstance.GetString("SETTINGS_GAME_IGNORESONGUNLOCKABLES_DESC")); + this.list項目リスト.Add(this.iTaikoIgnoreSongUnlockables); + + this.iDrumsGoToKeyAssign = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME"), CItemBase.EPanelType.Normal, + CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_DESC")); + this.list項目リスト.Add(this.iDrumsGoToKeyAssign); + + this.iDrumsGoToTrainingKeyAssign = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_TRAINING"), CItemBase.EPanelType.Normal, + CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_TRAINING_DESC")); + this.list項目リスト.Add(this.iDrumsGoToTrainingKeyAssign); + + OnListMenuの初期化(); + this.n現在の選択項目 = 0; + this.eメニュー種別 = Eメニュー種別.Drums; + } + + #endregion + + + /// + /// ESC押下時の右メニュー描画 + /// + public void tEsc押下() { + if (this.b要素値にフォーカス中) // #32059 2013.9.17 add yyagi + { this.b要素値にフォーカス中 = false; - this.n目標のスクロールカウンタ = 0; - this.n現在のスクロールカウンタ = 0; - this.nスクロール用タイマ値 = -1; - this.ct三角矢印アニメ = new CCounter(); + } - this.iSystemSoundType_initial = this.iSystemSoundType.n現在選択されている項目番号; // CONFIGに入ったときの値を保持しておく - this.iSystemBassBufferSizeMs_initial = this.iSystemBassBufferSizeMs.n現在の値; // CONFIG脱出時にこの値から変更されているようなら - this.iSystemWASAPIBufferSizeMs_initial = this.iSystemWASAPIBufferSizeMs.n現在の値; // CONFIG脱出時にこの値から変更されているようなら - this.iSystemASIODevice_initial = this.iSystemASIODevice.n現在選択されている項目番号; - this.iSystemSoundTimerType_initial = this.iSystemSoundTimerType.GetIndex(); - base.Activate(); + switch (eメニュー種別) { + case Eメニュー種別.KeyAssignSystem: + t項目リストの設定_System(); + break; + case Eメニュー種別.KeyAssignDrums: + case Eメニュー種別.KeyAssignTraining: + t項目リストの設定_Drums(); + break; } - public override void DeActivate() { - if (this.IsDeActivated) - return; - this.tConfigIniへ記録する(); - this.list項目リスト.Clear(); - this.ct三角矢印アニメ = null; + // これ以外なら何もしない + } + public void tEnter押下() { + OpenTaiko.Skin.soundDecideSFX.tPlay(); + if (this.b要素値にフォーカス中) { + this.b要素値にフォーカス中 = false; + } else if (this.list項目リスト[this.n現在の選択項目].e種別 == CItemBase.E種別.整数) { + this.b要素値にフォーカス中 = true; + } + #region [ 個々のキーアサイン ] + //太鼓のキー設定。 + else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTaikoLRed) { + OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.Drums, EKeyConfigPad.LRed); + } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTaikoRRed) { + OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.Drums, EKeyConfigPad.RRed); + } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTaikoLBlue) { + OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.Drums, EKeyConfigPad.LBlue); + } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTaikoRBlue) { + OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.Drums, EKeyConfigPad.RBlue); + } - base.DeActivate(); - #region [ Skin変更 ] - if (OpenTaiko.Skin.GetCurrentSkinSubfolderFullName(true) != this.skinSubFolder_org) { - OpenTaiko.app.RefreshSkin(); - } - #endregion - - // #24820 2013.1.22 yyagi CONFIGでWASAPI/ASIO/DirectSound関連の設定を変更した場合、サウンドデバイスを再構築する。 - // #33689 2014.6.17 yyagi CONFIGでSoundTimerTypeの設定を変更した場合も、サウンドデバイスを再構築する。 - #region [ サウンドデバイス変更 ] - if (this.iSystemSoundType_initial != this.iSystemSoundType.n現在選択されている項目番号 || - this.iSystemBassBufferSizeMs_initial != this.iSystemBassBufferSizeMs.n現在の値 || - this.iSystemWASAPIBufferSizeMs_initial != this.iSystemWASAPIBufferSizeMs.n現在の値 || - this.iSystemASIODevice_initial != this.iSystemASIODevice.n現在選択されている項目番号 || - this.iSystemSoundTimerType_initial != this.iSystemSoundTimerType.GetIndex()) { - ESoundDeviceType soundDeviceType; - switch (this.iSystemSoundType.n現在選択されている項目番号) { - case 0: - soundDeviceType = ESoundDeviceType.Bass; - break; - case 1: - soundDeviceType = ESoundDeviceType.ASIO; - break; - case 2: - soundDeviceType = ESoundDeviceType.ExclusiveWASAPI; - break; - case 3: - soundDeviceType = ESoundDeviceType.SharedWASAPI; - break; - default: - soundDeviceType = ESoundDeviceType.Unknown; - break; - } - OpenTaiko.SoundManager.tInitialize(soundDeviceType, - this.iSystemBassBufferSizeMs.n現在の値, - this.iSystemWASAPIBufferSizeMs.n現在の値, - 0, - this.iSystemASIODevice.n現在選択されている項目番号, - this.iSystemSoundTimerType.bON); - OpenTaiko.app.ShowWindowTitleWithSoundType(); - OpenTaiko.Skin.ReloadSkin();// 音声の再読み込みをすることによって、音量の初期化を防ぐ - } - #endregion - #region [ サウンドのタイムストレッチモード変更 ] - FDK.SoundManager.bIsTimeStretch = this.iSystemTimeStretch.bON; - #endregion + //太鼓のキー設定。2P + else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTaikoLRed2P) { + OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.Drums, EKeyConfigPad.LRed2P); + } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTaikoRRed2P) { + OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.Drums, EKeyConfigPad.RRed2P); + } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTaikoLBlue2P) { + OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.Drums, EKeyConfigPad.LBlue2P); + } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTaikoRBlue2P) { + OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.Drums, EKeyConfigPad.RBlue2P); } - public override void CreateManagedResource() { - this.prvFont = HPrivateFastFont.tInstantiateMainFont(OpenTaiko.Skin.Config_Font_Scale); // t項目リストの設定 の前に必要 - this.txSkinSample1 = null; // スキン選択時に動的に設定するため、ここでは初期化しない - base.CreateManagedResource(); + + //太鼓のキー設定。3P + else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTaikoLRed3P) { + OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.Drums, EKeyConfigPad.LRed3P); + } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTaikoRRed3P) { + OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.Drums, EKeyConfigPad.RRed3P); + } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTaikoLBlue3P) { + OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.Drums, EKeyConfigPad.LBlue3P); + } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTaikoRBlue3P) { + OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.Drums, EKeyConfigPad.RBlue3P); } - public override void ReleaseManagedResource() { - prvFont.Dispose(); - OpenTaiko.tテクスチャの解放(ref this.txSkinSample1); - base.ReleaseManagedResource(); + + //太鼓のキー設定。4P + else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTaikoLRed4P) { + OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.Drums, EKeyConfigPad.LRed4P); + } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTaikoRRed4P) { + OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.Drums, EKeyConfigPad.RRed4P); + } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTaikoLBlue4P) { + OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.Drums, EKeyConfigPad.LBlue4P); + } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTaikoRBlue4P) { + OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.Drums, EKeyConfigPad.RBlue4P); } - private void OnListMenuの初期化() { - OnListMenuの解放(); - this.listMenu = new stMenuItemRight[this.list項目リスト.Count]; - } - - /// - /// 事前にレンダリングしておいたテクスチャを解放する。 - /// - private void OnListMenuの解放() { - if (listMenu != null) { - for (int i = 0; i < listMenu.Length; i++) { - if (listMenu[i].txParam != null) { - listMenu[i].txParam.Dispose(); - } - if (listMenu[i].txMenuItemRight != null) { - listMenu[i].txMenuItemRight.Dispose(); - } - } - this.listMenu = null; + + //太鼓のキー設定。5P + else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTaikoLRed5P) { + OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.Drums, EKeyConfigPad.LRed5P); + } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTaikoRRed5P) { + OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.Drums, EKeyConfigPad.RRed5P); + } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTaikoLBlue5P) { + OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.Drums, EKeyConfigPad.LBlue5P); + } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTaikoRBlue5P) { + OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.Drums, EKeyConfigPad.RBlue5P); + } + + // Konga claps + else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignKongaClap) { + OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.Drums, EKeyConfigPad.Clap); + } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignKongaClap2P) { + OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.Drums, EKeyConfigPad.Clap2P); + } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignKongaClap3P) { + OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.Drums, EKeyConfigPad.Clap3P); + } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignKongaClap4P) { + OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.Drums, EKeyConfigPad.Clap4P); + } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignKongaClap5P) { + OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.Drums, EKeyConfigPad.Clap5P); + } + + // Menu controls + else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignDecide) { + OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.Drums, EKeyConfigPad.Decide); + } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignCancel) { + OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.Drums, EKeyConfigPad.Cancel); + } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignLeftChange) { + OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.Drums, EKeyConfigPad.LeftChange); + } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignRightChange) { + OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.Drums, EKeyConfigPad.RightChange); + } + + // System controls + else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignSystemCapture) { + OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.System, EKeyConfigPad.Capture); + } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignSystemSongVolIncrease) { + OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.System, EKeyConfigPad.SongVolumeIncrease); + } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignSystemSongVolDecrease) { + OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.System, EKeyConfigPad.SongVolumeDecrease); + } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignSystemDisplayHit) { + OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.System, EKeyConfigPad.DisplayHits); + } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignSystemDisplayDebug) { + OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.System, EKeyConfigPad.DisplayDebug); + } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignSystemQuickConfig) { + OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.System, EKeyConfigPad.QuickConfig); + } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignSystemNewHeya) { + OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.System, EKeyConfigPad.NewHeya); + } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignSystemSortSongs) { + OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.System, EKeyConfigPad.SortSongs); + } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignSystemToggleAutoP1) { + OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.System, EKeyConfigPad.ToggleAutoP1); + } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignSystemToggleAutoP2) { + OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.System, EKeyConfigPad.ToggleAutoP2); + } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignSystemToggleTrainingMode) { + OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.System, EKeyConfigPad.ToggleTrainingMode); + } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignSystemCycleVideoDisplayMode) { + OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.System, EKeyConfigPad.CycleVideoDisplayMode); + } + + // Training controls + else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTrainingPause) { + OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.Drums, EKeyConfigPad.TrainingPause); + } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTrainingToggleAuto) { + OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.Drums, EKeyConfigPad.TrainingToggleAuto); + } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTrainingBookmark) { + OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.Drums, EKeyConfigPad.TrainingBookmark); + } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTrainingIncreaseScrollSpeed) { + OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.Drums, EKeyConfigPad.TrainingIncreaseScrollSpeed); + } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTrainingDecreaseScrollSpeed) { + OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.Drums, EKeyConfigPad.TrainingDecreaseScrollSpeed); + } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTrainingIncreaseSongSpeed) { + OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.Drums, EKeyConfigPad.TrainingIncreaseSongSpeed); + } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTrainingDecreaseSongSpeed) { + OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.Drums, EKeyConfigPad.TrainingDecreaseSongSpeed); + } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTrainingBranchNormal) { + OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.Drums, EKeyConfigPad.TrainingBranchNormal); + } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTrainingBranchExpert) { + OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.Drums, EKeyConfigPad.TrainingBranchExpert); + } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTrainingBranchMaster) { + OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.Drums, EKeyConfigPad.TrainingBranchMaster); + } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTrainingMoveForwardMeasure) { + OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.Drums, EKeyConfigPad.TrainingMoveForwardMeasure); + } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTrainingMoveBackMeasure) { + OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.Drums, EKeyConfigPad.TrainingMoveBackMeasure); + } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTrainingSkipForwardMeasure) { + OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.Drums, EKeyConfigPad.TrainingSkipForwardMeasure); + } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTrainingSkipBackMeasure) { + OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.Drums, EKeyConfigPad.TrainingSkipBackMeasure); + } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTrainingJumpToFirstMeasure) { + OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.Drums, EKeyConfigPad.TrainingJumpToFirstMeasure); + } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTrainingJumpToLastMeasure) { + OpenTaiko.stageコンフィグ.tパッド選択通知(EKeyConfigPart.Drums, EKeyConfigPad.TrainingJumpToLastMeasure); + } + #endregion + else { + // #27029 2012.1.5 from + this.list項目リスト[this.n現在の選択項目].tEnter押下(); + + if (this.list項目リスト[this.n現在の選択項目] == this.iSystemLanguage) { + OpenTaiko.ConfigIni.sLang = CLangManager.intToLang(this.iSystemLanguage.n現在選択されている項目番号); + CLangManager.langAttach(OpenTaiko.ConfigIni.sLang); + + prvFont?.Dispose(); + OpenTaiko.stageコンフィグ.ftフォント?.Dispose(); + OpenTaiko.stageタイトル.pfMenuTitle?.Dispose(); + OpenTaiko.stageタイトル.pfBoxText?.Dispose(); + + prvFont = HPrivateFastFont.tInstantiateMainFont(OpenTaiko.Skin.Config_Font_Scale); + OpenTaiko.stageコンフィグ.ftフォント = HPrivateFastFont.tInstantiateMainFont((int)OpenTaiko.Skin.Config_Font_Scale_Description, CFontRenderer.FontStyle.Bold); + OpenTaiko.stageタイトル.pfMenuTitle = HPrivateFastFont.tInstantiateMainFont(OpenTaiko.Skin.Title_ModeSelect_Title_Scale[0]); + OpenTaiko.stageタイトル.pfBoxText = HPrivateFastFont.tInstantiateBoxFont(OpenTaiko.Skin.Title_ModeSelect_Title_Scale[1]); + + t項目リストの設定_System(refresh: false); + OpenTaiko.stageコンフィグ.ReloadMenus(); } - } - public override int Draw() { - throw new InvalidOperationException("t進行描画(bool)のほうを使用してください。"); - } - public int t進行描画(bool b項目リスト側にフォーカスがある) { - if (this.IsDeActivated) - return 0; - - // 進行 - - #region [ 初めての進行描画 ] - //----------------- - if (base.IsFirstDraw) { - this.nスクロール用タイマ値 = (long)(SoundManager.PlayTimer.NowTime * OpenTaiko.ConfigIni.SongPlaybackSpeed); - this.ct三角矢印アニメ.Start(0, 9, 50, OpenTaiko.Timer); - base.IsFirstDraw = false; - } - //----------------- - #endregion - - this.b項目リスト側にフォーカスがある = b項目リスト側にフォーカスがある; // 記憶 - - #region [ 項目スクロールの進行 ] - //----------------- - long n現在時刻 = OpenTaiko.Timer.NowTime; - if (n現在時刻 < this.nスクロール用タイマ値) this.nスクロール用タイマ値 = n現在時刻; + // Enter押下後の後処理 - const int INTERVAL = 2; // [ms] - while ((n現在時刻 - this.nスクロール用タイマ値) >= INTERVAL) { - int n目標項目までのスクロール量 = Math.Abs((int)(this.n目標のスクロールカウンタ - this.n現在のスクロールカウンタ)); - int n加速度 = 0; - - #region [ n加速度の決定;目標まで遠いほど加速する。] - //----------------- - if (n目標項目までのスクロール量 <= 100) { - n加速度 = 2; - } else if (n目標項目までのスクロール量 <= 300) { - n加速度 = 3; - } else if (n目標項目までのスクロール量 <= 500) { - n加速度 = 4; - } else { - n加速度 = 8; - } - //----------------- - #endregion - #region [ this.n現在のスクロールカウンタに n加速度 を加減算。] - //----------------- - if (this.n現在のスクロールカウンタ < this.n目標のスクロールカウンタ) { - this.n現在のスクロールカウンタ += n加速度; - if (this.n現在のスクロールカウンタ > this.n目標のスクロールカウンタ) { - // 目標を超えたら目標値で停止。 - this.n現在のスクロールカウンタ = this.n目標のスクロールカウンタ; - } - } else if (this.n現在のスクロールカウンタ > this.n目標のスクロールカウンタ) { - this.n現在のスクロールカウンタ -= n加速度; - if (this.n現在のスクロールカウンタ < this.n目標のスクロールカウンタ) { - // 目標を超えたら目標値で停止。 - this.n現在のスクロールカウンタ = this.n目標のスクロールカウンタ; - } - } - //----------------- - #endregion - #region [ 行超え処理、ならびに目標位置に到達したらスクロールを停止して項目変更通知を発行。] - //----------------- - if (this.n現在のスクロールカウンタ >= 100) { - this.n現在の選択項目 = this.t次の項目(this.n現在の選択項目); - this.n現在のスクロールカウンタ -= 100; - this.n目標のスクロールカウンタ -= 100; - if (this.n目標のスクロールカウンタ == 0) { - OpenTaiko.stageコンフィグ.t項目変更通知(); - } - } else if (this.n現在のスクロールカウンタ <= -100) { - this.n現在の選択項目 = this.t前の項目(this.n現在の選択項目); - this.n現在のスクロールカウンタ += 100; - this.n目標のスクロールカウンタ += 100; - if (this.n目標のスクロールカウンタ == 0) { - OpenTaiko.stageコンフィグ.t項目変更通知(); - } - } - //----------------- - #endregion - - this.nスクロール用タイマ値 += INTERVAL; - } - //----------------- - #endregion - - #region [ ▲印アニメの進行 ] - //----------------- - if (this.b項目リスト側にフォーカスがある && (this.n目標のスクロールカウンタ == 0)) - this.ct三角矢印アニメ.TickLoop(); - //----------------- - #endregion - // 描画 - - #region [ 計11個の項目パネルを描画する。] - //----------------- - int nItem = this.n現在の選択項目; - for (int i = 0; i < (OpenTaiko.Skin.Config_ItemBox_Count / 2) - 1; i++) - nItem = this.t前の項目(nItem); - - for (int i = 0; i < OpenTaiko.Skin.Config_ItemBox_Count; i++) // n行番号 == 0 がフォーカスされている項目パネル。 + if (this.list項目リスト[this.n現在の選択項目] == this.iSystemFullscreen) { + OpenTaiko.app.b次のタイミングで全画面_ウィンドウ切り替えを行う = true; + } else if (this.list項目リスト[this.n現在の選択項目] == this.iSystemVSyncWait) { + OpenTaiko.ConfigIni.bEnableVSync = this.iSystemVSyncWait.bON; + OpenTaiko.app.b次のタイミングで垂直帰線同期切り替えを行う = true; + } + #region [ キーアサインへの遷移と脱出 ] + else if (this.list項目リスト[this.n現在の選択項目] == this.iSystemGoToKeyAssign) // #24609 2011.4.12 yyagi { - bool centerFlag = i == (OpenTaiko.Skin.Config_ItemBox_Count / 2) - 1; - - #region [ 今まさに画面外に飛びだそうとしている項目パネルは描画しない。] - //----------------- - if (((i == 0) && (this.n現在のスクロールカウンタ > 0)) || // 上に飛び出そうとしている - ((i == OpenTaiko.Skin.Config_ItemBox_Count - 1) && (this.n現在のスクロールカウンタ < 0))) // 下に飛び出そうとしている - { - nItem = this.t次の項目(nItem); - continue; - } - //----------------- - #endregion - - int n移動先の行の基本位置 = (this.n現在のスクロールカウンタ <= 0) ? ((i + 1) % OpenTaiko.Skin.Config_ItemBox_Count) : (((i - 1) + OpenTaiko.Skin.Config_ItemBox_Count) % OpenTaiko.Skin.Config_ItemBox_Count); - int x = OpenTaiko.Skin.Config_ItemBox_X[i] + ((int)((OpenTaiko.Skin.Config_ItemBox_X[n移動先の行の基本位置] - OpenTaiko.Skin.Config_ItemBox_X[i]) * (((double)Math.Abs(this.n現在のスクロールカウンタ)) / 100.0))); - int y = OpenTaiko.Skin.Config_ItemBox_Y[i] + ((int)((OpenTaiko.Skin.Config_ItemBox_Y[n移動先の行の基本位置] - OpenTaiko.Skin.Config_ItemBox_Y[i]) * (((double)Math.Abs(this.n現在のスクロールカウンタ)) / 100.0))); - - #region [ 現在の行の項目パネル枠を描画。] - //----------------- - switch (this.list項目リスト[nItem].eパネル種別) { - case CItemBase.EPanelType.Normal: - case CItemBase.EPanelType.Other: - if (OpenTaiko.Tx.Config_ItemBox != null) - OpenTaiko.Tx.Config_ItemBox.t2D描画(x, y); - break; - } - //----------------- - #endregion - #region [ 現在の行の項目名を描画。] - //----------------- - if (listMenu[nItem].txMenuItemRight != null) // 自前のキャッシュに含まれているようなら、再レンダリングせずキャッシュを使用 - { - listMenu[nItem].txMenuItemRight.t2D描画(x + OpenTaiko.Skin.Config_ItemBox_Font_Offset[0], y + OpenTaiko.Skin.Config_ItemBox_Font_Offset[1]); - } else { - using (var bmpItem = prvFont.DrawText(this.list項目リスト[nItem].str項目名, Color.White, Color.Black, null, 30)) { - listMenu[nItem].txMenuItemRight = OpenTaiko.tテクスチャの生成(bmpItem); - } - } - //----------------- - #endregion - #region [ 現在の行の項目の要素を描画。] - //----------------- - string strParam = null; - bool b強調 = false; - switch (this.list項目リスト[nItem].e種別) { - case CItemBase.E種別.ONorOFFトグル: - #region [ *** ] - //----------------- - strParam = ((CItemToggle)this.list項目リスト[nItem]).bON ? "ON" : "OFF"; - break; - //----------------- - #endregion - - case CItemBase.E種別.ONorOFFor不定スリーステート: - #region [ *** ] - //----------------- - switch (((CItemThreeState)this.list項目リスト[nItem]).e現在の状態) { - case CItemThreeState.E状態.ON: - strParam = "ON"; - break; - - case CItemThreeState.E状態.不定: - strParam = "- -"; - break; - - default: - strParam = "OFF"; - break; - } - break; - //----------------- - #endregion - - case CItemBase.E種別.整数: // #24789 2011.4.8 yyagi: add PlaySpeed supports (copied them from OPTION) - #region [ *** ] - //----------------- - if (this.list項目リスト[nItem] == this.iCommonPlaySpeed) { - double d = ((double)((CItemInteger)this.list項目リスト[nItem]).n現在の値) / 20.0; - strParam = d.ToString("0.000"); - } else { - strParam = ((CItemInteger)this.list項目リスト[nItem]).n現在の値.ToString(); - } - b強調 = centerFlag && this.b要素値にフォーカス中; - break; - //----------------- - #endregion - - case CItemBase.E種別.リスト: // #28195 2012.5.2 yyagi: add Skin supports - #region [ *** ] - //----------------- - { - CItemList list = (CItemList)this.list項目リスト[nItem]; - strParam = list.list項目値[list.n現在選択されている項目番号]; - - #region [ 必要な場合に、Skinのサンプルを生成・描画する。#28195 2012.5.2 yyagi ] - if (this.list項目リスト[this.n現在の選択項目] == this.iSystemSkinSubfolder) { - tGenerateSkinSample(); // 最初にSkinの選択肢にきたとき(Enterを押す前)に限り、サンプル生成が発生する。 - if (txSkinSample1 != null) { - txSkinSample1.t2D描画(OpenTaiko.Skin.Config_SkinSample1[0], OpenTaiko.Skin.Config_SkinSample1[1]); - } - } - #endregion - break; - } - //----------------- - #endregion - } - if (b強調) { - using (var bmpStr = prvFont.DrawText(strParam, - Color.Black, - Color.White, - null, - OpenTaiko.Skin.Config_Selected_Menu_Text_Grad_Color_1, - OpenTaiko.Skin.Config_Selected_Menu_Text_Grad_Color_2, - 30)) { - using (var txStr = OpenTaiko.tテクスチャの生成(bmpStr, false)) { - txStr.t2D描画(x + OpenTaiko.Skin.Config_ItemBox_ItemValue_Font_Offset[0], y + OpenTaiko.Skin.Config_ItemBox_ItemValue_Font_Offset[1]); - } - } - } else { - int nIndex = this.list項目リスト[nItem].GetIndex(); - if (listMenu[nItem].nParam != nIndex || listMenu[nItem].txParam == null) { - stMenuItemRight stm = listMenu[nItem]; - stm.nParam = nIndex; - object o = this.list項目リスト[nItem].obj現在値(); - stm.strParam = (o == null) ? "" : o.ToString(); - - using (var bmpStr = prvFont.DrawText(strParam, Color.White, Color.Black, null, 30)) { - stm.txParam = OpenTaiko.tテクスチャの生成(bmpStr, false); - } - - listMenu[nItem] = stm; - } - listMenu[nItem].txParam.t2D描画(x + OpenTaiko.Skin.Config_ItemBox_ItemValue_Font_Offset[0], y + OpenTaiko.Skin.Config_ItemBox_ItemValue_Font_Offset[1]); - } - //----------------- - #endregion - - nItem = this.t次の項目(nItem); - } - //----------------- + t項目リストの設定_KeyAssignSystem(); + } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignSystemReturnToMenu) // #24609 2011.4.12 yyagi + { + tConfigIniへ記録する(); + t項目リストの設定_System(); + } else if (this.list項目リスト[this.n現在の選択項目] == this.iDrumsGoToKeyAssign) // #24525 2011.3.15 yyagi + { + tConfigIniへ記録する(); + t項目リストの設定_KeyAssignDrums(); + } else if (this.list項目リスト[this.n現在の選択項目] == this.iDrumsGoToTrainingKeyAssign) { + tConfigIniへ記録する(); + t項目リストの設定_KeyAssignTraining(); + } else if (this.list項目リスト[this.n現在の選択項目] == this.iDrumsGoToCalibration) { + OpenTaiko.stageコンフィグ.actCalibrationMode.Start(); + } else if (this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignDrumsReturnToMenu || + this.list項目リスト[this.n現在の選択項目] == this.iKeyAssignTrainingReturnToMenu) // #24525 2011.3.15 yyagi + { + t項目リストの設定_Drums(); + } #endregion - - #region [ 項目リストにフォーカスがあって、かつスクロールが停止しているなら、パネルの上下に▲印を描画する。] - //----------------- - if (this.b項目リスト側にフォーカスがある && (this.n目標のスクロールカウンタ == 0)) { - int x_upper; - int x_lower; - int y_upper; - int y_lower; - - // 位置決定。 - - if (this.b要素値にフォーカス中) { - x_upper = OpenTaiko.Skin.Config_Arrow_Focus_X[0]; // 要素値の上下あたり。 - x_lower = OpenTaiko.Skin.Config_Arrow_Focus_X[1]; // 要素値の上下あたり。 - y_upper = OpenTaiko.Skin.Config_Arrow_Focus_Y[0] - this.ct三角矢印アニメ.CurrentValue; - y_lower = OpenTaiko.Skin.Config_Arrow_Focus_Y[1] + this.ct三角矢印アニメ.CurrentValue; - } else { - x_upper = OpenTaiko.Skin.Config_Arrow_X[0]; // 要素値の上下あたり。 - x_lower = OpenTaiko.Skin.Config_Arrow_X[1]; // 要素値の上下あたり。 - y_upper = OpenTaiko.Skin.Config_Arrow_Y[0] - this.ct三角矢印アニメ.CurrentValue; - y_lower = OpenTaiko.Skin.Config_Arrow_Y[1] + this.ct三角矢印アニメ.CurrentValue; - } - - // 描画。 - - if (OpenTaiko.Tx.Config_Arrow != null) { - OpenTaiko.Tx.Config_Arrow.t2D描画(x_upper, y_upper, new Rectangle(0, 0, OpenTaiko.Tx.Config_Arrow.sz画像サイズ.Width, OpenTaiko.Tx.Config_Arrow.sz画像サイズ.Height / 2)); - OpenTaiko.Tx.Config_Arrow.t2D描画(x_lower, y_lower, new Rectangle(0, OpenTaiko.Tx.Config_Arrow.sz画像サイズ.Height / 2, OpenTaiko.Tx.Config_Arrow.sz画像サイズ.Width, OpenTaiko.Tx.Config_Arrow.sz画像サイズ.Height / 2)); - } - } - //----------------- + #region [ スキン項目でEnterを押下した場合に限り、スキンの縮小サンプルを生成する。] + else if (this.list項目リスト[this.n現在の選択項目] == this.iSystemSkinSubfolder) // #28195 2012.5.2 yyagi + { + tGenerateSkinSample(); + } #endregion - return 0; - } - - - // その他 - - #region [ private ] - //----------------- - private enum Eメニュー種別 { - System, - Drums, - KeyAssignSystem, // #24609 2011.4.12 yyagi: 画面キャプチャキーのアサイン - KeyAssignDrums, - KeyAssignTraining, - Unknown + #region [ 曲データ一覧の再読み込み ] + else if (this.list項目リスト[this.n現在の選択項目] == this.iSystemReloadDTX) // #32081 2013.10.21 yyagi + { + if (OpenTaiko.EnumSongs.IsEnumerating) { + // Debug.WriteLine( "バックグラウンドでEnumeratingSongs中だったので、一旦中断します。" ); + OpenTaiko.EnumSongs.Abort(); + OpenTaiko.actEnumSongs.DeActivate(); + } - } + OpenTaiko.EnumSongs.StartEnumFromDisk(); + OpenTaiko.EnumSongs.ChangeEnumeratePriority(ThreadPriority.Normal); + OpenTaiko.actEnumSongs.bコマンドでの曲データ取得 = true; + OpenTaiko.actEnumSongs.Activate(); + OpenTaiko.stageSongSelect.actSongList.ResetSongIndex(); + } else if (this.list項目リスト[this.n現在の選択項目] == this.iSystemHardReloadDTX) // #32081 2013.10.21 yyagi + { + if (OpenTaiko.EnumSongs.IsEnumerating) { + OpenTaiko.EnumSongs.Abort(); + OpenTaiko.actEnumSongs.DeActivate(); + } - private bool b項目リスト側にフォーカスがある; - private bool b要素値にフォーカス中; - private CCounter ct三角矢印アニメ; - private Eメニュー種別 eメニュー種別; - #region [ Key Config ] - - private CItemBase iKeyAssignSystemReturnToMenu; // #24609 - private CItemBase iKeyAssignDrumsReturnToMenu; - private CItemBase iKeyAssignTrainingReturnToMenu; - - #region [System] - private CItemBase iKeyAssignSystemCapture; // #24609 - private CItemBase iKeyAssignSystemSongVolIncrease; - private CItemBase iKeyAssignSystemSongVolDecrease; - private CItemBase iKeyAssignSystemDisplayHit; - private CItemBase iKeyAssignSystemDisplayDebug; - private CItemBase iKeyAssignSystemQuickConfig; - private CItemBase iKeyAssignSystemNewHeya; - private CItemBase iKeyAssignSystemSortSongs; - private CItemBase iKeyAssignSystemToggleAutoP1; - private CItemBase iKeyAssignSystemToggleAutoP2; - private CItemBase iKeyAssignSystemToggleTrainingMode; - private CItemBase iKeyAssignSystemCycleVideoDisplayMode; - #endregion - - #region [Drum] - private CItemBase iKeyAssignTaikoLRed; - private CItemBase iKeyAssignTaikoRRed; - private CItemBase iKeyAssignTaikoLBlue; - private CItemBase iKeyAssignTaikoRBlue; - - private CItemBase iKeyAssignTaikoLRed2P; - private CItemBase iKeyAssignTaikoRRed2P; - private CItemBase iKeyAssignTaikoLBlue2P; - private CItemBase iKeyAssignTaikoRBlue2P; - - private CItemBase iKeyAssignTaikoLRed3P; - private CItemBase iKeyAssignTaikoRRed3P; - private CItemBase iKeyAssignTaikoLBlue3P; - private CItemBase iKeyAssignTaikoRBlue3P; - - private CItemBase iKeyAssignTaikoLRed4P; - private CItemBase iKeyAssignTaikoRRed4P; - private CItemBase iKeyAssignTaikoLBlue4P; - private CItemBase iKeyAssignTaikoRBlue4P; - - private CItemBase iKeyAssignTaikoLRed5P; - private CItemBase iKeyAssignTaikoRRed5P; - private CItemBase iKeyAssignTaikoLBlue5P; - private CItemBase iKeyAssignTaikoRBlue5P; - - private CItemBase iKeyAssignKongaClap; - private CItemBase iKeyAssignKongaClap2P; - private CItemBase iKeyAssignKongaClap3P; - private CItemBase iKeyAssignKongaClap4P; - private CItemBase iKeyAssignKongaClap5P; - - private CItemBase iKeyAssignDecide; - private CItemBase iKeyAssignCancel; - private CItemBase iKeyAssignLeftChange; - private CItemBase iKeyAssignRightChange; - #endregion - - #region [Training] - private CItemBase iKeyAssignTrainingIncreaseScrollSpeed; - private CItemBase iKeyAssignTrainingDecreaseScrollSpeed; - private CItemBase iKeyAssignTrainingToggleAuto; - private CItemBase iKeyAssignTrainingBranchNormal; - private CItemBase iKeyAssignTrainingBranchExpert; - private CItemBase iKeyAssignTrainingBranchMaster; - private CItemBase iKeyAssignTrainingPause; - private CItemBase iKeyAssignTrainingBookmark; - private CItemBase iKeyAssignTrainingMoveForwardMeasure; - private CItemBase iKeyAssignTrainingMoveBackMeasure; - private CItemBase iKeyAssignTrainingSkipForwardMeasure; - private CItemBase iKeyAssignTrainingSkipBackMeasure; - private CItemBase iKeyAssignTrainingIncreaseSongSpeed; - private CItemBase iKeyAssignTrainingDecreaseSongSpeed; - private CItemBase iKeyAssignTrainingJumpToFirstMeasure; - private CItemBase iKeyAssignTrainingJumpToLastMeasure; - #endregion - - #endregion - private CItemToggle iLogOutputLog; - private CItemToggle iSystemApplyLoudnessMetadata; - private CItemInteger iSystemTargetLoudness; - private CItemToggle iSystemApplySongVol; - private CItemInteger iSystemSoundEffectLevel; - private CItemInteger iSystemVoiceLevel; - private CItemInteger iSystemSongPreviewLevel; - private CItemInteger iSystemSongPlaybackLevel; - private CItemInteger iSystemKeyboardSoundLevelIncrement; - private CItemToggle iSystemAVI; - private CItemList iSystemAVIDisplayMode; - private CItemToggle iSystemBGA; - private CItemInteger iSystemBGAlpha; - private CItemToggle iSystemBGMSound; - private CItemToggle iSystemDebugInfo; - private CItemList iSystemGraphicsType; // #24820 2013.1.3 yyagi - private CItemToggle iSystemFullscreen; - private CItemInteger iSystemMinComboDrums; - private CItemInteger iSystemPreviewImageWait; - private CItemInteger iSystemPreviewSoundWait; - private CItemToggle iSystemRandomFromSubBox; - private CItemBase iSystemReturnToMenu; - private CItemToggle iSystemVSyncWait; - private CItemToggle iSystemAutoResultCapture; // #25399 2011.6.9 yyagi - private CItemToggle SendDiscordPlayingInformation; - private CItemToggle iSystemBufferedInput; - private CItemInteger iSystemRisky; // #23559 2011.7.27 yyagi - private CItemList iSystemSoundType; // #24820 2013.1.3 yyagi - - private CItemList iSystemLanguage; - private CItemToggle iDanTowerHide; - - private CItemInteger iSystemBassBufferSizeMs; // #24820 2013.1.15 yyagi - private CItemInteger iSystemWASAPIBufferSizeMs; // #24820 2013.1.15 yyagi - private CItemList iSystemASIODevice; // #24820 2013.1.17 yyagi - - private int iSystemSoundType_initial; - private int iSystemBassBufferSizeMs_initial; - private int iSystemWASAPIBufferSizeMs_initial; - private int iSystemASIODevice_initial; - private CItemToggle iSystemSoundTimerType; // #33689 2014.6.17 yyagi - private int iSystemSoundTimerType_initial; // #33689 2014.6.17 yyagi - - private CItemToggle iSystemTimeStretch; // #23664 2013.2.24 yyagi - - private List list項目リスト; - private long nスクロール用タイマ値; - private int n現在のスクロールカウンタ; - private int n目標のスクロールカウンタ; - - private CCachedFontRenderer prvFont; - private struct stMenuItemRight { - public CTexture txMenuItemRight; - public int nParam; - public string strParam; - public CTexture txParam; - } - private stMenuItemRight[] listMenu; - - private CTexture txSkinSample1; // #28195 2012.5.2 yyagi - private string[] skinSubFolders; - private string[] skinNames; - private string skinSubFolder_org; - private int nSkinSampleIndex; - private int nSkinIndex; - - private CItemBase iDrumsGoToCalibration; - private CItemBase iDrumsGoToKeyAssign; - private CItemBase iDrumsGoToTrainingKeyAssign; - private CItemBase iSystemGoToKeyAssign; - private CItemInteger iCommonPlaySpeed; - - private CItemInteger iLayoutType; - - private CItemBase iDrumsReturnToMenu; - private CItemInteger iDrumsScrollSpeed; - private CItemToggle iDrumsTight; - private CItemToggle iTaikoAutoPlay; - private CItemToggle iTaikoAutoPlay2P; - private CItemToggle iTaikoAutoRoll; - private CItemToggle iTaikoIgnoreSongUnlockables; - - private CItemInteger iRollsPerSec; - private CItemInteger iAILevel; - - private CItemToggle iTaikoBranchGuide; - private CItemList iTaikoDefaultCourse; //2017.01.30 DD デフォルトでカーソルをあわせる難易度 - private CItemList iTaikoScoreMode; - private CItemList iTaikoBranchAnime; - private CItemToggle iTaikoNoInfo; - private CItemList iTaikoRandom; - private CItemList iTaikoStealth; - private CItemList iTaikoGameMode; - private CItemToggle iTaikoJust; - private CItemToggle iTaikoJudgeCountDisp; - private CItemToggle iTaikoBigNotesJudge; - private CItemToggle iTaikoForceNormalGauge; - private CItemInteger iTaikoPlayerCount; - CItemToggle ShowChara; - CItemToggle ShowDancer; - CItemToggle ShowRunner; - CItemToggle ShowMob; - CItemToggle ShowFooter; - CItemToggle ShowPuchiChara; - CItemToggle SimpleMode; - CItemToggle iShowExExtraAnime; - CItemToggle ShinuchiMode; - CItemToggle FastRender; - CItemToggle ASyncTextureLoad; - CItemInteger MusicPreTimeMs; - CItemInteger TokkunSkipCount; - CItemInteger TokkunMashInterval; - - private CItemInteger iInputAdjustTimeMs; - public CItemInteger iGlobalOffsetMs; - - private CItemList iSystemSkinSubfolder; // #28195 2012.5.2 yyagi - private CItemBase iSystemReloadDTX; // #32081 2013.10.21 yyagi - private CItemBase iSystemHardReloadDTX; - private CItemBase isSystemImportingScore; - - #region DBEUG - private CItemToggle debugImGui; - #endregion - - public Thread ScoreIniImportThread { get; private set; } - public bool ScoreIniImportThreadIsActive { - get { - if (ScoreIniImportThread == null) return false; - return ScoreIniImportThread.IsAlive; + OpenTaiko.EnumSongs.StartEnumFromDisk(true); + OpenTaiko.EnumSongs.ChangeEnumeratePriority(ThreadPriority.Normal); + OpenTaiko.actEnumSongs.bコマンドでの曲データ取得 = true; + OpenTaiko.actEnumSongs.Activate(); + OpenTaiko.stageSongSelect.actSongList.ResetSongIndex(); + } else if (this.list項目リスト[this.n現在の選択項目] == this.isSystemImportingScore) { + // Running in a separate thread so the game doesn't freeze + ScoreIniImportThread = new Thread(CScoreIni_Importer.ImportScoreInisToSavesDb3); + ScoreIniImportThread.Start(); } + #endregion } + } - private int t前の項目(int nItem) { - if (--nItem < 0) { - nItem = this.list項目リスト.Count - 1; + private void tGenerateSkinSample() { + + nSkinIndex = ((CItemList)this.list項目リスト[this.n現在の選択項目]).n現在選択されている項目番号; + if (nSkinSampleIndex != nSkinIndex) { + string path = skinSubFolders[nSkinIndex]; + path = System.IO.Path.Combine(path, @$"Graphics{Path.DirectorySeparatorChar}1_Title{Path.DirectorySeparatorChar}Background.png"); + SKBitmap bmSrc = SKBitmap.Decode(path); + + int _w = OpenTaiko.Skin.Resolution[0] / 4; + int _h = OpenTaiko.Skin.Resolution[1] / 4; + + if (txSkinSample1 != null) { + OpenTaiko.tDisposeSafely(ref txSkinSample1); } - return nItem; + txSkinSample1 = OpenTaiko.tテクスチャの生成(bmSrc, false); + + txSkinSample1.vcScaleRatio = new Silk.NET.Maths.Vector3D(_w / (float)txSkinSample1.szTextureSize.Width, _h / (float)txSkinSample1.szTextureSize.Height, 0); + + bmSrc.Dispose(); + nSkinSampleIndex = nSkinIndex; } - private int t次の項目(int nItem) { - if (++nItem >= this.list項目リスト.Count) { - nItem = 0; + } + + #region [ 項目リストの設定 ( Exit, KeyAssignSystem/Drums) ] + public void t項目リストの設定_Exit() { + this.tConfigIniへ記録する(); + this.eメニュー種別 = Eメニュー種別.Unknown; + } + public void t項目リストの設定_KeyAssignSystem() { + this.list項目リスト.Clear(); + // #27029 2012.1.5 from: 説明文は最大9行→13行に変更。 + + this.iKeyAssignSystemReturnToMenu = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_MENU_RETURN"), CItemBase.EPanelType.Other, + CLangManager.LangInstance.GetString("SETTINGS_MENU_RETURN_DESC")); + this.list項目リスト.Add(this.iKeyAssignSystemReturnToMenu); + + this.iKeyAssignSystemCapture = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_SYSTEM_CAPTURE"), + CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_SYSTEM_CAPTURE_DESC")); + this.list項目リスト.Add(this.iKeyAssignSystemCapture); + this.iKeyAssignSystemSongVolIncrease = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_SYSTEM_INCREASEVOL"), + CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_SYSTEM_INCREASEVOL_DESC")); + this.list項目リスト.Add(this.iKeyAssignSystemSongVolIncrease); + this.iKeyAssignSystemSongVolDecrease = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_SYSTEM_DECREASEVOL"), + CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_SYSTEM_DECREASEVOL_DESC")); + this.list項目リスト.Add(this.iKeyAssignSystemSongVolDecrease); + this.iKeyAssignSystemDisplayHit = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_SYSTEM_DISPLAYHITS"), + CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_SYSTEM_DISPLAYHITS_DESC")); + this.list項目リスト.Add(this.iKeyAssignSystemDisplayHit); + this.iKeyAssignSystemDisplayDebug = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_SYSTEM_DISPLAYDEBUG"), + CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_SYSTEM_DISPLAYDEBUG_DESC")); + this.list項目リスト.Add(this.iKeyAssignSystemDisplayDebug); + this.iKeyAssignSystemQuickConfig = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_SYSTEM_QUICKCONFIG"), + CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_SYSTEM_QUICKCONFIG_DESC")); + this.list項目リスト.Add(this.iKeyAssignSystemQuickConfig); + this.iKeyAssignSystemNewHeya = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_SYSTEM_QUICKHEYA"), + CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_SYSTEM_QUICKHEYA_DESC")); + this.list項目リスト.Add(this.iKeyAssignSystemNewHeya); + this.iKeyAssignSystemSortSongs = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_SYSTEM_SONGSORT"), + CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_SYSTEM_SONGSORT_DESC")); + this.list項目リスト.Add(this.iKeyAssignSystemSortSongs); + this.iKeyAssignSystemToggleAutoP1 = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_SYSTEM_AUTO1P"), + CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_SYSTEM_AUTO1P_DESC")); + this.list項目リスト.Add(this.iKeyAssignSystemToggleAutoP1); + this.iKeyAssignSystemToggleAutoP2 = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_SYSTEM_AUTO2P"), + CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_SYSTEM_AUTO2P_DESC")); + this.list項目リスト.Add(this.iKeyAssignSystemToggleAutoP2); + this.iKeyAssignSystemToggleTrainingMode = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_SYSTEM_TRAINING"), + CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_SYSTEM_TRAINING_DESC")); + this.list項目リスト.Add(this.iKeyAssignSystemToggleTrainingMode); + this.iKeyAssignSystemCycleVideoDisplayMode = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_SYSTEM_BGMOVIEDISPLAY"), + CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_SYSTEM_BGMOVIEDISPLAY_DESC")); + this.list項目リスト.Add(this.iKeyAssignSystemCycleVideoDisplayMode); + + OnListMenuの初期化(); + this.n現在の選択項目 = 0; + this.eメニュー種別 = Eメニュー種別.KeyAssignSystem; + } + public void t項目リストの設定_KeyAssignDrums() { + this.list項目リスト.Clear(); + // #27029 2012.1.5 from: 説明文は最大9行→13行に変更。 + + this.iKeyAssignDrumsReturnToMenu = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_MENU_RETURN"), CItemBase.EPanelType.Other, + CLangManager.LangInstance.GetString("SETTINGS_MENU_RETURN_DESC")); + this.list項目リスト.Add(this.iKeyAssignDrumsReturnToMenu); + + this.iKeyAssignTaikoLRed = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_LEFTRED"), + CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_LEFTRED_DESC")); + this.list項目リスト.Add(this.iKeyAssignTaikoLRed); + this.iKeyAssignTaikoRRed = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_RIGHTRED"), + CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_RIGHTRED_DESC")); + this.list項目リスト.Add(this.iKeyAssignTaikoRRed); + this.iKeyAssignTaikoLBlue = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_LEFTBLUE"), + CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_LEFTBLUE_DESC")); + this.list項目リスト.Add(this.iKeyAssignTaikoLBlue); + this.iKeyAssignTaikoRBlue = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_RIGHTBLUE"), + CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_RIGHTBLUE_DESC")); + this.list項目リスト.Add(this.iKeyAssignTaikoRBlue); + this.iKeyAssignKongaClap = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_CLAP"), + CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_CLAP_DESC")); + this.list項目リスト.Add(this.iKeyAssignKongaClap); + + this.iKeyAssignTaikoLRed2P = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_LEFTRED2P"), + CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_LEFTRED2P_DESC")); + this.list項目リスト.Add(this.iKeyAssignTaikoLRed2P); + this.iKeyAssignTaikoRRed2P = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_RIGHTRED2P"), + CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_RIGHTRED2P_DESC")); + this.list項目リスト.Add(this.iKeyAssignTaikoRRed2P); + this.iKeyAssignTaikoLBlue2P = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_LEFTBLUE2P"), + CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_LEFTBLUE2P_DESC")); + this.list項目リスト.Add(this.iKeyAssignTaikoLBlue2P); + this.iKeyAssignTaikoRBlue2P = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_RIGHTBLUE2P"), + CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_RIGHTBLUE2P_DESC")); + this.list項目リスト.Add(this.iKeyAssignTaikoRBlue2P); + this.iKeyAssignKongaClap2P = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_CLAP2P"), + CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_CLAP2P_DESC")); + this.list項目リスト.Add(this.iKeyAssignKongaClap2P); + + this.iKeyAssignTaikoLRed3P = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_LEFTRED3P"), + CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_LEFTRED3P_DESC")); + this.list項目リスト.Add(this.iKeyAssignTaikoLRed3P); + this.iKeyAssignTaikoRRed3P = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_RIGHTRED3P"), + CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_RIGHTRED3P_DESC")); + this.list項目リスト.Add(this.iKeyAssignTaikoRRed3P); + this.iKeyAssignTaikoLBlue3P = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_LEFTBLUE3P"), + CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_LEFTBLUE3P_DESC")); + this.list項目リスト.Add(this.iKeyAssignTaikoLBlue3P); + this.iKeyAssignTaikoRBlue3P = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_RIGHTBLUE3P"), + CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_RIGHTBLUE3P_DESC")); + this.list項目リスト.Add(this.iKeyAssignTaikoRBlue3P); + this.iKeyAssignKongaClap3P = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_CLAP3P"), + CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_CLAP3P_DESC")); + this.list項目リスト.Add(this.iKeyAssignKongaClap3P); + + this.iKeyAssignTaikoLRed4P = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_LEFTRED4P"), + CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_LEFTRED4P_DESC")); + this.list項目リスト.Add(this.iKeyAssignTaikoLRed4P); + this.iKeyAssignTaikoRRed4P = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_RIGHTRED4P"), + CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_RIGHTRED4P_DESC")); + this.list項目リスト.Add(this.iKeyAssignTaikoRRed4P); + this.iKeyAssignTaikoLBlue4P = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_LEFTBLUE4P"), + CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_LEFTBLUE4P_DESC")); + this.list項目リスト.Add(this.iKeyAssignTaikoLBlue4P); + this.iKeyAssignTaikoRBlue4P = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_RIGHTBLUE4P"), + CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_RIGHTBLUE4P_DESC")); + this.list項目リスト.Add(this.iKeyAssignTaikoRBlue4P); + this.iKeyAssignKongaClap4P = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_CLAP4P"), + CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_CLAP4P_DESC")); + this.list項目リスト.Add(this.iKeyAssignKongaClap4P); + + this.iKeyAssignTaikoLRed5P = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_LEFTRED5P"), + CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_LEFTRED5P_DESC")); + this.list項目リスト.Add(this.iKeyAssignTaikoLRed5P); + this.iKeyAssignTaikoRRed5P = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_RIGHTRED5P"), + CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_RIGHTRED5P_DESC")); + this.list項目リスト.Add(this.iKeyAssignTaikoRRed5P); + this.iKeyAssignTaikoLBlue5P = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_LEFTBLUE5P"), + CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_LEFTBLUE5P_DESC")); + this.list項目リスト.Add(this.iKeyAssignTaikoLBlue5P); + this.iKeyAssignTaikoRBlue5P = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_RIGHTBLUE5P"), + CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_RIGHTBLUE5P_DESC")); + this.list項目リスト.Add(this.iKeyAssignTaikoRBlue5P); + this.iKeyAssignKongaClap5P = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_CLAP5P"), + CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_CLAP5P_DESC")); + this.list項目リスト.Add(this.iKeyAssignKongaClap5P); + + this.iKeyAssignDecide = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_DECIDE"), + CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_DECIDE_DESC")); + this.list項目リスト.Add(this.iKeyAssignDecide); + this.iKeyAssignCancel = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_CANCEL"), + CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_CANCEL_DESC")); + this.list項目リスト.Add(this.iKeyAssignCancel); + + this.iKeyAssignLeftChange = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_LEFTCHANGE"), + CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_LEFTCHANGE_DESC")); + this.list項目リスト.Add(this.iKeyAssignLeftChange); + this.iKeyAssignRightChange = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_RIGHTCHANGE"), + CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_GAME_RIGHTCHANGE_DESC")); + this.list項目リスト.Add(this.iKeyAssignRightChange); + + OnListMenuの初期化(); + this.n現在の選択項目 = 0; + this.eメニュー種別 = Eメニュー種別.KeyAssignDrums; + } + public void t項目リストの設定_KeyAssignTraining() { + this.list項目リスト.Clear(); + + this.iKeyAssignTrainingReturnToMenu = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_MENU_RETURN"), CItemBase.EPanelType.Other, + CLangManager.LangInstance.GetString("SETTINGS_MENU_RETURN_DESC")); + this.list項目リスト.Add(this.iKeyAssignTrainingReturnToMenu); + + + this.iKeyAssignTrainingPause = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_TRAINING_PAUSE"), + CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_TRAINING_PAUSE_DESC")); + this.list項目リスト.Add(this.iKeyAssignTrainingPause); + + this.iKeyAssignTrainingToggleAuto = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_TRAINING_AUTO"), + CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_TRAINING_AUTO_DESC")); + this.list項目リスト.Add(this.iKeyAssignTrainingToggleAuto); + + this.iKeyAssignTrainingBookmark = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_TRAINING_BOOKMARK"), + CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_TRAINING_BOOKMARK_DESC")); + this.list項目リスト.Add(this.iKeyAssignTrainingBookmark); + + this.iKeyAssignTrainingIncreaseScrollSpeed = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_TRAINING_INCREASESCROLL"), + CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_TRAINING_INCREASESCROLL_DESC")); + this.list項目リスト.Add(this.iKeyAssignTrainingIncreaseScrollSpeed); + + this.iKeyAssignTrainingDecreaseScrollSpeed = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_TRAINING_DECREASESCROLL"), + CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_TRAINING_DECREASESCROLL_DESC")); + this.list項目リスト.Add(this.iKeyAssignTrainingDecreaseScrollSpeed); + + this.iKeyAssignTrainingIncreaseSongSpeed = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_TRAINING_INCREASESPEED"), + CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_TRAINING_INCREASESPEED_DESC")); + this.list項目リスト.Add(this.iKeyAssignTrainingIncreaseSongSpeed); + + this.iKeyAssignTrainingDecreaseSongSpeed = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_TRAINING_DECREASESPEED"), + CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_TRAINING_DECREASESPEED_DESC")); + this.list項目リスト.Add(this.iKeyAssignTrainingDecreaseSongSpeed); + + this.iKeyAssignTrainingBranchNormal = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_TRAINING_BRANCHNORMAL"), + CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_TRAINING_BRANCHNORMAL_DESC")); + this.list項目リスト.Add(this.iKeyAssignTrainingBranchNormal); + + this.iKeyAssignTrainingBranchExpert = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_TRAINING_BRANCHEXPERT"), + CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_TRAINING_BRANCHEXPERT_DESC")); + this.list項目リスト.Add(this.iKeyAssignTrainingBranchExpert); + + this.iKeyAssignTrainingBranchMaster = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_TRAINING_BRANCHMASTER"), + CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_TRAINING_BRANCHMASTER_DESC")); + this.list項目リスト.Add(this.iKeyAssignTrainingBranchMaster); + + this.iKeyAssignTrainingMoveForwardMeasure = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_TRAINING_MOVEFORWARD"), + CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_TRAINING_MOVEFORWARD_DESC")); + this.list項目リスト.Add(this.iKeyAssignTrainingMoveForwardMeasure); + + this.iKeyAssignTrainingMoveBackMeasure = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_TRAINING_MOVEBACKWARD"), + CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_TRAINING_MOVEBACKWARD_DESC")); + this.list項目リスト.Add(this.iKeyAssignTrainingMoveBackMeasure); + + this.iKeyAssignTrainingSkipForwardMeasure = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_TRAINING_SKIPFORWARD"), + CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_TRAINING_SKIPFORWARD_DESC")); + this.list項目リスト.Add(this.iKeyAssignTrainingSkipForwardMeasure); + + this.iKeyAssignTrainingSkipBackMeasure = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_TRAINING_SKIPBACKWARD"), + CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_TRAINING_SKIPBACKWARD_DESC")); + this.list項目リスト.Add(this.iKeyAssignTrainingSkipBackMeasure); + + this.iKeyAssignTrainingJumpToFirstMeasure = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_TRAINING_JUMPTOFIRST"), + CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_TRAINING_JUMPTOFIRST_DESC")); + this.list項目リスト.Add(this.iKeyAssignTrainingJumpToFirstMeasure); + + this.iKeyAssignTrainingJumpToLastMeasure = new CItemBase(CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_TRAINING_JUMPTOLAST"), + CLangManager.LangInstance.GetString("SETTINGS_KEYASSIGN_TRAINING_JUMPTOLAST_DESC")); + this.list項目リスト.Add(this.iKeyAssignTrainingJumpToLastMeasure); + + OnListMenuの初期化(); + this.n現在の選択項目 = 0; + this.eメニュー種別 = Eメニュー種別.KeyAssignTraining; + } + #endregion + public void t次に移動() { + OpenTaiko.Skin.soundカーソル移動音.tPlay(); + if (this.b要素値にフォーカス中) { + this.list項目リスト[this.n現在の選択項目].t項目値を前へ移動(); + } else { + this.n目標のスクロールカウンタ += 100; + } + } + public void t前に移動() { + OpenTaiko.Skin.soundカーソル移動音.tPlay(); + if (this.b要素値にフォーカス中) { + this.list項目リスト[this.n現在の選択項目].t項目値を次へ移動(); + } else { + this.n目標のスクロールカウンタ -= 100; + } + } + + // CActivity 実装 + + public override void Activate() { + if (this.IsActivated) + return; + + this.list項目リスト = new List(); + this.eメニュー種別 = Eメニュー種別.Unknown; + + #region [ スキン選択肢と、現在選択中のスキン(index)の準備 #28195 2012.5.2 yyagi ] + int ns = (OpenTaiko.Skin.strSystemSkinSubfolders == null) ? 0 : OpenTaiko.Skin.strSystemSkinSubfolders.Length; + int nb = (OpenTaiko.Skin.strBoxDefSkinSubfolders == null) ? 0 : OpenTaiko.Skin.strBoxDefSkinSubfolders.Length; + skinSubFolders = new string[ns + nb]; + for (int i = 0; i < ns; i++) { + skinSubFolders[i] = OpenTaiko.Skin.strSystemSkinSubfolders[i]; + } + for (int i = 0; i < nb; i++) { + skinSubFolders[ns + i] = OpenTaiko.Skin.strBoxDefSkinSubfolders[i]; + } + skinSubFolder_org = OpenTaiko.Skin.GetCurrentSkinSubfolderFullName(true); + Array.Sort(skinSubFolders); + skinNames = CSkin.GetSkinName(skinSubFolders); + nSkinIndex = Array.BinarySearch(skinSubFolders, skinSubFolder_org); + if (nSkinIndex < 0) // 念のため + { + nSkinIndex = 0; + } + nSkinSampleIndex = -1; + #endregion + + this.t項目リストの設定_Drums(); + this.t項目リストの設定_System(); // 順番として、最後にSystemを持ってくること。設定一覧の初期位置がSystemのため。 + this.b要素値にフォーカス中 = false; + this.n目標のスクロールカウンタ = 0; + this.n現在のスクロールカウンタ = 0; + this.nスクロール用タイマ値 = -1; + this.ct三角矢印アニメ = new CCounter(); + + this.iSystemSoundType_initial = this.iSystemSoundType.n現在選択されている項目番号; // CONFIGに入ったときの値を保持しておく + this.iSystemBassBufferSizeMs_initial = this.iSystemBassBufferSizeMs.n現在の値; // CONFIG脱出時にこの値から変更されているようなら + this.iSystemWASAPIBufferSizeMs_initial = this.iSystemWASAPIBufferSizeMs.n現在の値; // CONFIG脱出時にこの値から変更されているようなら + this.iSystemASIODevice_initial = this.iSystemASIODevice.n現在選択されている項目番号; + this.iSystemSoundTimerType_initial = this.iSystemSoundTimerType.GetIndex(); + base.Activate(); + } + public override void DeActivate() { + if (this.IsDeActivated) + return; + + this.tConfigIniへ記録する(); + this.list項目リスト.Clear(); + this.ct三角矢印アニメ = null; + + base.DeActivate(); + #region [ Skin変更 ] + if (OpenTaiko.Skin.GetCurrentSkinSubfolderFullName(true) != this.skinSubFolder_org) { + OpenTaiko.app.RefreshSkin(); + } + #endregion + + // #24820 2013.1.22 yyagi CONFIGでWASAPI/ASIO/DirectSound関連の設定を変更した場合、サウンドデバイスを再構築する。 + // #33689 2014.6.17 yyagi CONFIGでSoundTimerTypeの設定を変更した場合も、サウンドデバイスを再構築する。 + #region [ サウンドデバイス変更 ] + if (this.iSystemSoundType_initial != this.iSystemSoundType.n現在選択されている項目番号 || + this.iSystemBassBufferSizeMs_initial != this.iSystemBassBufferSizeMs.n現在の値 || + this.iSystemWASAPIBufferSizeMs_initial != this.iSystemWASAPIBufferSizeMs.n現在の値 || + this.iSystemASIODevice_initial != this.iSystemASIODevice.n現在選択されている項目番号 || + this.iSystemSoundTimerType_initial != this.iSystemSoundTimerType.GetIndex()) { + ESoundDeviceType soundDeviceType; + switch (this.iSystemSoundType.n現在選択されている項目番号) { + case 0: + soundDeviceType = ESoundDeviceType.Bass; + break; + case 1: + soundDeviceType = ESoundDeviceType.ASIO; + break; + case 2: + soundDeviceType = ESoundDeviceType.ExclusiveWASAPI; + break; + case 3: + soundDeviceType = ESoundDeviceType.SharedWASAPI; + break; + default: + soundDeviceType = ESoundDeviceType.Unknown; + break; } - return nItem; + OpenTaiko.SoundManager.tInitialize(soundDeviceType, + this.iSystemBassBufferSizeMs.n現在の値, + this.iSystemWASAPIBufferSizeMs.n現在の値, + 0, + this.iSystemASIODevice.n現在選択されている項目番号, + this.iSystemSoundTimerType.bON); + OpenTaiko.app.ShowWindowTitleWithSoundType(); + OpenTaiko.Skin.ReloadSkin();// 音声の再読み込みをすることによって、音量の初期化を防ぐ } - private void tConfigIniへ記録する() { - switch (this.eメニュー種別) { - case Eメニュー種別.System: - this.tConfigIniへ記録する_System(); - return; - - case Eメニュー種別.Drums: - this.tConfigIniへ記録する_Drums(); - return; - } - } - private void tConfigIniへ記録する_System() { - OpenTaiko.ConfigIni.nSongSpeed = this.iCommonPlaySpeed.n現在の値; - - OpenTaiko.ConfigIni.nGraphicsDeviceType = this.iSystemGraphicsType.n現在選択されている項目番号; - OpenTaiko.ConfigIni.bFullScreen = this.iSystemFullscreen.bON; - OpenTaiko.ConfigIni.bIncludeSubfoldersOnRandomSelect = this.iSystemRandomFromSubBox.bON; - - OpenTaiko.ConfigIni.bEnableVSync = this.iSystemVSyncWait.bON; - OpenTaiko.ConfigIni.bBufferedInputs = this.iSystemBufferedInput.bON; - OpenTaiko.ConfigIni.bEnableAVI = this.iSystemAVI.bON; - OpenTaiko.ConfigIni.eClipDispType = (EClipDispType)this.iSystemAVIDisplayMode.n現在選択されている項目番号; - OpenTaiko.ConfigIni.bEnableBGA = this.iSystemBGA.bON; - OpenTaiko.ConfigIni.nMsWaitPreviewSoundFromSongSelected = this.iSystemPreviewSoundWait.n現在の値; - OpenTaiko.ConfigIni.nMsWaitPreviewImageFromSongSelected = this.iSystemPreviewImageWait.n現在の値; - OpenTaiko.ConfigIni.bDisplayDebugInfo = this.iSystemDebugInfo.bON; - OpenTaiko.ConfigIni.nBackgroundTransparency = this.iSystemBGAlpha.n現在の値; - OpenTaiko.ConfigIni.bBGMPlayVoiceSound = this.iSystemBGMSound.bON; - OpenTaiko.ConfigIni.bDanTowerHide = this.iDanTowerHide.bON; - - OpenTaiko.ConfigIni.ApplySongVol = this.iSystemApplySongVol.bON; - OpenTaiko.ConfigIni.SoundEffectLevel = this.iSystemSoundEffectLevel.n現在の値; - OpenTaiko.ConfigIni.VoiceLevel = this.iSystemVoiceLevel.n現在の値; - OpenTaiko.ConfigIni.SongPreviewLevel = this.iSystemSongPreviewLevel.n現在の値; - OpenTaiko.ConfigIni.SongPlaybackLevel = this.iSystemSongPlaybackLevel.n現在の値; - OpenTaiko.ConfigIni.KeyboardSoundLevelIncrement = this.iSystemKeyboardSoundLevelIncrement.n現在の値; - OpenTaiko.ConfigIni.MusicPreTimeMs = this.MusicPreTimeMs.n現在の値; - - OpenTaiko.ConfigIni.bOutputLogs = this.iLogOutputLog.bON; - OpenTaiko.ConfigIni.bIsAutoResultCapture = this.iSystemAutoResultCapture.bON; // #25399 2011.6.9 yyagi - OpenTaiko.ConfigIni.SendDiscordPlayingInformation = this.SendDiscordPlayingInformation.bON; - - OpenTaiko.ConfigIni.nRisky = this.iSystemRisky.n現在の値; // #23559 2011.7.27 yyagi - - OpenTaiko.ConfigIni.strSystemSkinSubfolderFullName = skinSubFolders[nSkinIndex]; // #28195 2012.5.2 yyagi - OpenTaiko.Skin.SetCurrentSkinSubfolderFullName(OpenTaiko.ConfigIni.strSystemSkinSubfolderFullName, true); - - OpenTaiko.ConfigIni.nSoundDeviceType = this.iSystemSoundType.n現在選択されている項目番号; // #24820 2013.1.3 yyagi - OpenTaiko.ConfigIni.nBassBufferSizeMs = this.iSystemBassBufferSizeMs.n現在の値; // #24820 2013.1.15 yyagi - OpenTaiko.ConfigIni.nWASAPIBufferSizeMs = this.iSystemWASAPIBufferSizeMs.n現在の値; // #24820 2013.1.15 yyagi - // CDTXMania.ConfigIni.nASIOBufferSizeMs = this.iSystemASIOBufferSizeMs.n現在の値; // #24820 2013.1.3 yyagi - OpenTaiko.ConfigIni.nASIODevice = this.iSystemASIODevice.n現在選択されている項目番号; // #24820 2013.1.17 yyagi - OpenTaiko.ConfigIni.bUseOSTimer = this.iSystemSoundTimerType.bON; // #33689 2014.6.17 yyagi - - OpenTaiko.ConfigIni.bTimeStretch = this.iSystemTimeStretch.bON; // #23664 2013.2.24 yyagi - - - OpenTaiko.ConfigIni.sLang = CLangManager.intToLang(this.iSystemLanguage.n現在選択されている項目番号); - CLangManager.langAttach(OpenTaiko.ConfigIni.sLang); - OpenTaiko.ConfigIni.ShowChara = this.ShowChara.bON; - OpenTaiko.ConfigIni.ShowDancer = this.ShowDancer.bON; - OpenTaiko.ConfigIni.ShowRunner = this.ShowRunner.bON; - OpenTaiko.ConfigIni.ShowMob = this.ShowMob.bON; - OpenTaiko.ConfigIni.ShowFooter = this.ShowFooter.bON; - OpenTaiko.ConfigIni.ShowPuchiChara = this.ShowPuchiChara.bON; - - OpenTaiko.ConfigIni.nPlayerCount = this.iTaikoPlayerCount.n現在の値; - OpenTaiko.ConfigIni.FastRender = this.FastRender.bON; - OpenTaiko.ConfigIni.ASyncTextureLoad = this.ASyncTextureLoad.bON; - OpenTaiko.ConfigIni.SimpleMode = this.SimpleMode.bON; - -#if DEBUG - OpenTaiko.ConfigIni.DEBUG_bShowImgui = this.debugImGui.bON; -#endif - } - private void tConfigIniへ記録する_Drums() { - OpenTaiko.ConfigIni.nRollsPerSec = this.iRollsPerSec.n現在の値; - - OpenTaiko.ConfigIni.nDefaultAILevel = this.iAILevel.n現在の値; - for (int i = 0; i < 2; i++) - OpenTaiko.NamePlate.tNamePlateRefreshTitles(i); - - OpenTaiko.ConfigIni.bTight = this.iDrumsTight.bON; - - OpenTaiko.ConfigIni.nGlobalOffsetMs = this.iGlobalOffsetMs.n現在の値; - OpenTaiko.ConfigIni.bIgnoreSongUnlockables = this.iTaikoIgnoreSongUnlockables.bON; - - OpenTaiko.ConfigIni.nMinDisplayedCombo.Drums = this.iSystemMinComboDrums.n現在の値; - OpenTaiko.ConfigIni.nRisky = this.iSystemRisky.n現在の値; // #23559 2911.7.27 yyagi - OpenTaiko.ConfigIni.bBranchGuide = this.iTaikoBranchGuide.bON; - OpenTaiko.ConfigIni.nDefaultCourse = this.iTaikoDefaultCourse.n現在選択されている項目番号; - OpenTaiko.ConfigIni.nScoreMode = this.iTaikoScoreMode.n現在選択されている項目番号; - OpenTaiko.ConfigIni.ShinuchiMode = this.ShinuchiMode.bON; - OpenTaiko.ConfigIni.nBranchAnime = this.iTaikoBranchAnime.n現在選択されている項目番号; - OpenTaiko.ConfigIni.bNoInfo = this.iTaikoNoInfo.bON; - - OpenTaiko.ConfigIni.eGameMode = (EGame)this.iTaikoGameMode.n現在選択されている項目番号; - OpenTaiko.ConfigIni.bJudgeCountDisplay = this.iTaikoJudgeCountDisp.bON; - OpenTaiko.ConfigIni.ShowExExtraAnime = this.iShowExExtraAnime.bON; - OpenTaiko.ConfigIni.bJudgeBigNotes = this.iTaikoBigNotesJudge.bON; - OpenTaiko.ConfigIni.bForceNormalGauge = this.iTaikoForceNormalGauge.bON; - - OpenTaiko.ConfigIni.TokkunSkipMeasures = this.TokkunSkipCount.n現在の値; - OpenTaiko.ConfigIni.TokkunMashInterval = this.TokkunMashInterval.n現在の値; - } - //----------------- + #endregion + #region [ サウンドのタイムストレッチモード変更 ] + FDK.SoundManager.bIsTimeStretch = this.iSystemTimeStretch.bON; #endregion } + public override void CreateManagedResource() { + this.prvFont = HPrivateFastFont.tInstantiateMainFont(OpenTaiko.Skin.Config_Font_Scale); // t項目リストの設定 の前に必要 + this.txSkinSample1 = null; // スキン選択時に動的に設定するため、ここでは初期化しない + base.CreateManagedResource(); + } + public override void ReleaseManagedResource() { + prvFont.Dispose(); + OpenTaiko.tテクスチャの解放(ref this.txSkinSample1); + base.ReleaseManagedResource(); + } + private void OnListMenuの初期化() { + OnListMenuの解放(); + this.listMenu = new stMenuItemRight[this.list項目リスト.Count]; + } + + /// + /// 事前にレンダリングしておいたテクスチャを解放する。 + /// + private void OnListMenuの解放() { + if (listMenu != null) { + for (int i = 0; i < listMenu.Length; i++) { + if (listMenu[i].txParam != null) { + listMenu[i].txParam.Dispose(); + } + if (listMenu[i].txMenuItemRight != null) { + listMenu[i].txMenuItemRight.Dispose(); + } + } + this.listMenu = null; + } + } + public override int Draw() { + throw new InvalidOperationException("t進行描画(bool)のほうを使用してください。"); + } + public int t進行描画(bool b項目リスト側にフォーカスがある) { + if (this.IsDeActivated) + return 0; + + // 進行 + + #region [ 初めての進行描画 ] + //----------------- + if (base.IsFirstDraw) { + this.nスクロール用タイマ値 = (long)(SoundManager.PlayTimer.NowTime * OpenTaiko.ConfigIni.SongPlaybackSpeed); + this.ct三角矢印アニメ.Start(0, 9, 50, OpenTaiko.Timer); + base.IsFirstDraw = false; + } + //----------------- + #endregion + + this.b項目リスト側にフォーカスがある = b項目リスト側にフォーカスがある; // 記憶 + + #region [ 項目スクロールの進行 ] + //----------------- + long n現在時刻 = OpenTaiko.Timer.NowTime; + if (n現在時刻 < this.nスクロール用タイマ値) this.nスクロール用タイマ値 = n現在時刻; + + const int INTERVAL = 2; // [ms] + while ((n現在時刻 - this.nスクロール用タイマ値) >= INTERVAL) { + int n目標項目までのスクロール量 = Math.Abs((int)(this.n目標のスクロールカウンタ - this.n現在のスクロールカウンタ)); + int n加速度 = 0; + + #region [ n加速度の決定;目標まで遠いほど加速する。] + //----------------- + if (n目標項目までのスクロール量 <= 100) { + n加速度 = 2; + } else if (n目標項目までのスクロール量 <= 300) { + n加速度 = 3; + } else if (n目標項目までのスクロール量 <= 500) { + n加速度 = 4; + } else { + n加速度 = 8; + } + //----------------- + #endregion + #region [ this.n現在のスクロールカウンタに n加速度 を加減算。] + //----------------- + if (this.n現在のスクロールカウンタ < this.n目標のスクロールカウンタ) { + this.n現在のスクロールカウンタ += n加速度; + if (this.n現在のスクロールカウンタ > this.n目標のスクロールカウンタ) { + // 目標を超えたら目標値で停止。 + this.n現在のスクロールカウンタ = this.n目標のスクロールカウンタ; + } + } else if (this.n現在のスクロールカウンタ > this.n目標のスクロールカウンタ) { + this.n現在のスクロールカウンタ -= n加速度; + if (this.n現在のスクロールカウンタ < this.n目標のスクロールカウンタ) { + // 目標を超えたら目標値で停止。 + this.n現在のスクロールカウンタ = this.n目標のスクロールカウンタ; + } + } + //----------------- + #endregion + #region [ 行超え処理、ならびに目標位置に到達したらスクロールを停止して項目変更通知を発行。] + //----------------- + if (this.n現在のスクロールカウンタ >= 100) { + this.n現在の選択項目 = this.t次の項目(this.n現在の選択項目); + this.n現在のスクロールカウンタ -= 100; + this.n目標のスクロールカウンタ -= 100; + if (this.n目標のスクロールカウンタ == 0) { + OpenTaiko.stageコンフィグ.t項目変更通知(); + } + } else if (this.n現在のスクロールカウンタ <= -100) { + this.n現在の選択項目 = this.t前の項目(this.n現在の選択項目); + this.n現在のスクロールカウンタ += 100; + this.n目標のスクロールカウンタ += 100; + if (this.n目標のスクロールカウンタ == 0) { + OpenTaiko.stageコンフィグ.t項目変更通知(); + } + } + //----------------- + #endregion + + this.nスクロール用タイマ値 += INTERVAL; + } + //----------------- + #endregion + + #region [ ▲印アニメの進行 ] + //----------------- + if (this.b項目リスト側にフォーカスがある && (this.n目標のスクロールカウンタ == 0)) + this.ct三角矢印アニメ.TickLoop(); + //----------------- + #endregion + // 描画 + + #region [ 計11個の項目パネルを描画する。] + //----------------- + int nItem = this.n現在の選択項目; + for (int i = 0; i < (OpenTaiko.Skin.Config_ItemBox_Count / 2) - 1; i++) + nItem = this.t前の項目(nItem); + + for (int i = 0; i < OpenTaiko.Skin.Config_ItemBox_Count; i++) // n行番号 == 0 がフォーカスされている項目パネル。 + { + bool centerFlag = i == (OpenTaiko.Skin.Config_ItemBox_Count / 2) - 1; + + #region [ 今まさに画面外に飛びだそうとしている項目パネルは描画しない。] + //----------------- + if (((i == 0) && (this.n現在のスクロールカウンタ > 0)) || // 上に飛び出そうとしている + ((i == OpenTaiko.Skin.Config_ItemBox_Count - 1) && (this.n現在のスクロールカウンタ < 0))) // 下に飛び出そうとしている + { + nItem = this.t次の項目(nItem); + continue; + } + //----------------- + #endregion + + int n移動先の行の基本位置 = (this.n現在のスクロールカウンタ <= 0) ? ((i + 1) % OpenTaiko.Skin.Config_ItemBox_Count) : (((i - 1) + OpenTaiko.Skin.Config_ItemBox_Count) % OpenTaiko.Skin.Config_ItemBox_Count); + int x = OpenTaiko.Skin.Config_ItemBox_X[i] + ((int)((OpenTaiko.Skin.Config_ItemBox_X[n移動先の行の基本位置] - OpenTaiko.Skin.Config_ItemBox_X[i]) * (((double)Math.Abs(this.n現在のスクロールカウンタ)) / 100.0))); + int y = OpenTaiko.Skin.Config_ItemBox_Y[i] + ((int)((OpenTaiko.Skin.Config_ItemBox_Y[n移動先の行の基本位置] - OpenTaiko.Skin.Config_ItemBox_Y[i]) * (((double)Math.Abs(this.n現在のスクロールカウンタ)) / 100.0))); + + #region [ 現在の行の項目パネル枠を描画。] + //----------------- + switch (this.list項目リスト[nItem].eパネル種別) { + case CItemBase.EPanelType.Normal: + case CItemBase.EPanelType.Other: + if (OpenTaiko.Tx.Config_ItemBox != null) + OpenTaiko.Tx.Config_ItemBox.t2D描画(x, y); + break; + } + //----------------- + #endregion + #region [ 現在の行の項目名を描画。] + //----------------- + if (listMenu[nItem].txMenuItemRight != null) // 自前のキャッシュに含まれているようなら、再レンダリングせずキャッシュを使用 + { + listMenu[nItem].txMenuItemRight.t2D描画(x + OpenTaiko.Skin.Config_ItemBox_Font_Offset[0], y + OpenTaiko.Skin.Config_ItemBox_Font_Offset[1]); + } else { + using (var bmpItem = prvFont.DrawText(this.list項目リスト[nItem].str項目名, Color.White, Color.Black, null, 30)) { + listMenu[nItem].txMenuItemRight = OpenTaiko.tテクスチャの生成(bmpItem); + } + } + //----------------- + #endregion + #region [ 現在の行の項目の要素を描画。] + //----------------- + string strParam = null; + bool b強調 = false; + switch (this.list項目リスト[nItem].e種別) { + case CItemBase.E種別.ONorOFFトグル: + #region [ *** ] + //----------------- + strParam = ((CItemToggle)this.list項目リスト[nItem]).bON ? "ON" : "OFF"; + break; + //----------------- + #endregion + + case CItemBase.E種別.ONorOFFor不定スリーステート: + #region [ *** ] + //----------------- + switch (((CItemThreeState)this.list項目リスト[nItem]).e現在の状態) { + case CItemThreeState.E状態.ON: + strParam = "ON"; + break; + + case CItemThreeState.E状態.不定: + strParam = "- -"; + break; + + default: + strParam = "OFF"; + break; + } + break; + //----------------- + #endregion + + case CItemBase.E種別.整数: // #24789 2011.4.8 yyagi: add PlaySpeed supports (copied them from OPTION) + #region [ *** ] + //----------------- + if (this.list項目リスト[nItem] == this.iCommonPlaySpeed) { + double d = ((double)((CItemInteger)this.list項目リスト[nItem]).n現在の値) / 20.0; + strParam = d.ToString("0.000"); + } else { + strParam = ((CItemInteger)this.list項目リスト[nItem]).n現在の値.ToString(); + } + b強調 = centerFlag && this.b要素値にフォーカス中; + break; + //----------------- + #endregion + + case CItemBase.E種別.リスト: // #28195 2012.5.2 yyagi: add Skin supports + #region [ *** ] + //----------------- + { + CItemList list = (CItemList)this.list項目リスト[nItem]; + strParam = list.list項目値[list.n現在選択されている項目番号]; + + #region [ 必要な場合に、Skinのサンプルを生成・描画する。#28195 2012.5.2 yyagi ] + if (this.list項目リスト[this.n現在の選択項目] == this.iSystemSkinSubfolder) { + tGenerateSkinSample(); // 最初にSkinの選択肢にきたとき(Enterを押す前)に限り、サンプル生成が発生する。 + if (txSkinSample1 != null) { + txSkinSample1.t2D描画(OpenTaiko.Skin.Config_SkinSample1[0], OpenTaiko.Skin.Config_SkinSample1[1]); + } + } + #endregion + break; + } + //----------------- + #endregion + } + if (b強調) { + using (var bmpStr = prvFont.DrawText(strParam, + Color.Black, + Color.White, + null, + OpenTaiko.Skin.Config_Selected_Menu_Text_Grad_Color_1, + OpenTaiko.Skin.Config_Selected_Menu_Text_Grad_Color_2, + 30)) { + using (var txStr = OpenTaiko.tテクスチャの生成(bmpStr, false)) { + txStr.t2D描画(x + OpenTaiko.Skin.Config_ItemBox_ItemValue_Font_Offset[0], y + OpenTaiko.Skin.Config_ItemBox_ItemValue_Font_Offset[1]); + } + } + } else { + int nIndex = this.list項目リスト[nItem].GetIndex(); + if (listMenu[nItem].nParam != nIndex || listMenu[nItem].txParam == null) { + stMenuItemRight stm = listMenu[nItem]; + stm.nParam = nIndex; + object o = this.list項目リスト[nItem].obj現在値(); + stm.strParam = (o == null) ? "" : o.ToString(); + + using (var bmpStr = prvFont.DrawText(strParam, Color.White, Color.Black, null, 30)) { + stm.txParam = OpenTaiko.tテクスチャの生成(bmpStr, false); + } + + listMenu[nItem] = stm; + } + listMenu[nItem].txParam.t2D描画(x + OpenTaiko.Skin.Config_ItemBox_ItemValue_Font_Offset[0], y + OpenTaiko.Skin.Config_ItemBox_ItemValue_Font_Offset[1]); + } + //----------------- + #endregion + + nItem = this.t次の項目(nItem); + } + //----------------- + #endregion + + #region [ 項目リストにフォーカスがあって、かつスクロールが停止しているなら、パネルの上下に▲印を描画する。] + //----------------- + if (this.b項目リスト側にフォーカスがある && (this.n目標のスクロールカウンタ == 0)) { + int x_upper; + int x_lower; + int y_upper; + int y_lower; + + // 位置決定。 + + if (this.b要素値にフォーカス中) { + x_upper = OpenTaiko.Skin.Config_Arrow_Focus_X[0]; // 要素値の上下あたり。 + x_lower = OpenTaiko.Skin.Config_Arrow_Focus_X[1]; // 要素値の上下あたり。 + y_upper = OpenTaiko.Skin.Config_Arrow_Focus_Y[0] - this.ct三角矢印アニメ.CurrentValue; + y_lower = OpenTaiko.Skin.Config_Arrow_Focus_Y[1] + this.ct三角矢印アニメ.CurrentValue; + } else { + x_upper = OpenTaiko.Skin.Config_Arrow_X[0]; // 要素値の上下あたり。 + x_lower = OpenTaiko.Skin.Config_Arrow_X[1]; // 要素値の上下あたり。 + y_upper = OpenTaiko.Skin.Config_Arrow_Y[0] - this.ct三角矢印アニメ.CurrentValue; + y_lower = OpenTaiko.Skin.Config_Arrow_Y[1] + this.ct三角矢印アニメ.CurrentValue; + } + + // 描画。 + + if (OpenTaiko.Tx.Config_Arrow != null) { + OpenTaiko.Tx.Config_Arrow.t2D描画(x_upper, y_upper, new Rectangle(0, 0, OpenTaiko.Tx.Config_Arrow.sz画像サイズ.Width, OpenTaiko.Tx.Config_Arrow.sz画像サイズ.Height / 2)); + OpenTaiko.Tx.Config_Arrow.t2D描画(x_lower, y_lower, new Rectangle(0, OpenTaiko.Tx.Config_Arrow.sz画像サイズ.Height / 2, OpenTaiko.Tx.Config_Arrow.sz画像サイズ.Width, OpenTaiko.Tx.Config_Arrow.sz画像サイズ.Height / 2)); + } + } + //----------------- + #endregion + return 0; + } + + + // その他 + + #region [ private ] + //----------------- + private enum Eメニュー種別 { + System, + Drums, + KeyAssignSystem, // #24609 2011.4.12 yyagi: 画面キャプチャキーのアサイン + KeyAssignDrums, + KeyAssignTraining, + Unknown + + } + + private bool b項目リスト側にフォーカスがある; + private bool b要素値にフォーカス中; + private CCounter ct三角矢印アニメ; + private Eメニュー種別 eメニュー種別; + #region [ Key Config ] + + private CItemBase iKeyAssignSystemReturnToMenu; // #24609 + private CItemBase iKeyAssignDrumsReturnToMenu; + private CItemBase iKeyAssignTrainingReturnToMenu; + + #region [System] + private CItemBase iKeyAssignSystemCapture; // #24609 + private CItemBase iKeyAssignSystemSongVolIncrease; + private CItemBase iKeyAssignSystemSongVolDecrease; + private CItemBase iKeyAssignSystemDisplayHit; + private CItemBase iKeyAssignSystemDisplayDebug; + private CItemBase iKeyAssignSystemQuickConfig; + private CItemBase iKeyAssignSystemNewHeya; + private CItemBase iKeyAssignSystemSortSongs; + private CItemBase iKeyAssignSystemToggleAutoP1; + private CItemBase iKeyAssignSystemToggleAutoP2; + private CItemBase iKeyAssignSystemToggleTrainingMode; + private CItemBase iKeyAssignSystemCycleVideoDisplayMode; + #endregion + + #region [Drum] + private CItemBase iKeyAssignTaikoLRed; + private CItemBase iKeyAssignTaikoRRed; + private CItemBase iKeyAssignTaikoLBlue; + private CItemBase iKeyAssignTaikoRBlue; + + private CItemBase iKeyAssignTaikoLRed2P; + private CItemBase iKeyAssignTaikoRRed2P; + private CItemBase iKeyAssignTaikoLBlue2P; + private CItemBase iKeyAssignTaikoRBlue2P; + + private CItemBase iKeyAssignTaikoLRed3P; + private CItemBase iKeyAssignTaikoRRed3P; + private CItemBase iKeyAssignTaikoLBlue3P; + private CItemBase iKeyAssignTaikoRBlue3P; + + private CItemBase iKeyAssignTaikoLRed4P; + private CItemBase iKeyAssignTaikoRRed4P; + private CItemBase iKeyAssignTaikoLBlue4P; + private CItemBase iKeyAssignTaikoRBlue4P; + + private CItemBase iKeyAssignTaikoLRed5P; + private CItemBase iKeyAssignTaikoRRed5P; + private CItemBase iKeyAssignTaikoLBlue5P; + private CItemBase iKeyAssignTaikoRBlue5P; + + private CItemBase iKeyAssignKongaClap; + private CItemBase iKeyAssignKongaClap2P; + private CItemBase iKeyAssignKongaClap3P; + private CItemBase iKeyAssignKongaClap4P; + private CItemBase iKeyAssignKongaClap5P; + + private CItemBase iKeyAssignDecide; + private CItemBase iKeyAssignCancel; + private CItemBase iKeyAssignLeftChange; + private CItemBase iKeyAssignRightChange; + #endregion + + #region [Training] + private CItemBase iKeyAssignTrainingIncreaseScrollSpeed; + private CItemBase iKeyAssignTrainingDecreaseScrollSpeed; + private CItemBase iKeyAssignTrainingToggleAuto; + private CItemBase iKeyAssignTrainingBranchNormal; + private CItemBase iKeyAssignTrainingBranchExpert; + private CItemBase iKeyAssignTrainingBranchMaster; + private CItemBase iKeyAssignTrainingPause; + private CItemBase iKeyAssignTrainingBookmark; + private CItemBase iKeyAssignTrainingMoveForwardMeasure; + private CItemBase iKeyAssignTrainingMoveBackMeasure; + private CItemBase iKeyAssignTrainingSkipForwardMeasure; + private CItemBase iKeyAssignTrainingSkipBackMeasure; + private CItemBase iKeyAssignTrainingIncreaseSongSpeed; + private CItemBase iKeyAssignTrainingDecreaseSongSpeed; + private CItemBase iKeyAssignTrainingJumpToFirstMeasure; + private CItemBase iKeyAssignTrainingJumpToLastMeasure; + #endregion + + #endregion + private CItemToggle iLogOutputLog; + private CItemToggle iSystemApplyLoudnessMetadata; + private CItemInteger iSystemTargetLoudness; + private CItemToggle iSystemApplySongVol; + private CItemInteger iSystemSoundEffectLevel; + private CItemInteger iSystemVoiceLevel; + private CItemInteger iSystemSongPreviewLevel; + private CItemInteger iSystemSongPlaybackLevel; + private CItemInteger iSystemKeyboardSoundLevelIncrement; + private CItemToggle iSystemAVI; + private CItemList iSystemAVIDisplayMode; + private CItemToggle iSystemBGA; + private CItemInteger iSystemBGAlpha; + private CItemToggle iSystemBGMSound; + private CItemToggle iSystemDebugInfo; + private CItemList iSystemGraphicsType; // #24820 2013.1.3 yyagi + private CItemToggle iSystemFullscreen; + private CItemInteger iSystemMinComboDrums; + private CItemInteger iSystemPreviewImageWait; + private CItemInteger iSystemPreviewSoundWait; + private CItemToggle iSystemRandomFromSubBox; + private CItemBase iSystemReturnToMenu; + private CItemToggle iSystemVSyncWait; + private CItemToggle iSystemAutoResultCapture; // #25399 2011.6.9 yyagi + private CItemToggle SendDiscordPlayingInformation; + private CItemToggle iSystemBufferedInput; + private CItemInteger iSystemRisky; // #23559 2011.7.27 yyagi + private CItemList iSystemSoundType; // #24820 2013.1.3 yyagi + + private CItemList iSystemLanguage; + private CItemToggle iDanTowerHide; + + private CItemInteger iSystemBassBufferSizeMs; // #24820 2013.1.15 yyagi + private CItemInteger iSystemWASAPIBufferSizeMs; // #24820 2013.1.15 yyagi + private CItemList iSystemASIODevice; // #24820 2013.1.17 yyagi + + private int iSystemSoundType_initial; + private int iSystemBassBufferSizeMs_initial; + private int iSystemWASAPIBufferSizeMs_initial; + private int iSystemASIODevice_initial; + private CItemToggle iSystemSoundTimerType; // #33689 2014.6.17 yyagi + private int iSystemSoundTimerType_initial; // #33689 2014.6.17 yyagi + + private CItemToggle iSystemTimeStretch; // #23664 2013.2.24 yyagi + + private List list項目リスト; + private long nスクロール用タイマ値; + private int n現在のスクロールカウンタ; + private int n目標のスクロールカウンタ; + + private CCachedFontRenderer prvFont; + private struct stMenuItemRight { + public CTexture txMenuItemRight; + public int nParam; + public string strParam; + public CTexture txParam; + } + private stMenuItemRight[] listMenu; + + private CTexture txSkinSample1; // #28195 2012.5.2 yyagi + private string[] skinSubFolders; + private string[] skinNames; + private string skinSubFolder_org; + private int nSkinSampleIndex; + private int nSkinIndex; + + private CItemBase iDrumsGoToCalibration; + private CItemBase iDrumsGoToKeyAssign; + private CItemBase iDrumsGoToTrainingKeyAssign; + private CItemBase iSystemGoToKeyAssign; + private CItemInteger iCommonPlaySpeed; + + private CItemInteger iLayoutType; + + private CItemBase iDrumsReturnToMenu; + private CItemInteger iDrumsScrollSpeed; + private CItemToggle iDrumsTight; + private CItemToggle iTaikoAutoPlay; + private CItemToggle iTaikoAutoPlay2P; + private CItemToggle iTaikoAutoRoll; + private CItemToggle iTaikoIgnoreSongUnlockables; + + private CItemInteger iRollsPerSec; + private CItemInteger iAILevel; + + private CItemToggle iTaikoBranchGuide; + private CItemList iTaikoDefaultCourse; //2017.01.30 DD デフォルトでカーソルをあわせる難易度 + private CItemList iTaikoScoreMode; + private CItemList iTaikoBranchAnime; + private CItemToggle iTaikoNoInfo; + private CItemList iTaikoRandom; + private CItemList iTaikoStealth; + private CItemList iTaikoGameMode; + private CItemToggle iTaikoJust; + private CItemToggle iTaikoJudgeCountDisp; + private CItemToggle iTaikoBigNotesJudge; + private CItemToggle iTaikoForceNormalGauge; + private CItemInteger iTaikoPlayerCount; + CItemToggle ShowChara; + CItemToggle ShowDancer; + CItemToggle ShowRunner; + CItemToggle ShowMob; + CItemToggle ShowFooter; + CItemToggle ShowPuchiChara; + CItemToggle SimpleMode; + CItemToggle iShowExExtraAnime; + CItemToggle ShinuchiMode; + CItemToggle FastRender; + CItemToggle ASyncTextureLoad; + CItemInteger MusicPreTimeMs; + CItemInteger TokkunSkipCount; + CItemInteger TokkunMashInterval; + + private CItemInteger iInputAdjustTimeMs; + public CItemInteger iGlobalOffsetMs; + + private CItemList iSystemSkinSubfolder; // #28195 2012.5.2 yyagi + private CItemBase iSystemReloadDTX; // #32081 2013.10.21 yyagi + private CItemBase iSystemHardReloadDTX; + private CItemBase isSystemImportingScore; + + #region DBEUG + private CItemToggle debugImGui; + #endregion + + public Thread ScoreIniImportThread { get; private set; } + public bool ScoreIniImportThreadIsActive { + get { + if (ScoreIniImportThread == null) return false; + return ScoreIniImportThread.IsAlive; + } + } + + private int t前の項目(int nItem) { + if (--nItem < 0) { + nItem = this.list項目リスト.Count - 1; + } + return nItem; + } + private int t次の項目(int nItem) { + if (++nItem >= this.list項目リスト.Count) { + nItem = 0; + } + return nItem; + } + private void tConfigIniへ記録する() { + switch (this.eメニュー種別) { + case Eメニュー種別.System: + this.tConfigIniへ記録する_System(); + return; + + case Eメニュー種別.Drums: + this.tConfigIniへ記録する_Drums(); + return; + } + } + private void tConfigIniへ記録する_System() { + OpenTaiko.ConfigIni.nSongSpeed = this.iCommonPlaySpeed.n現在の値; + + OpenTaiko.ConfigIni.nGraphicsDeviceType = this.iSystemGraphicsType.n現在選択されている項目番号; + OpenTaiko.ConfigIni.bFullScreen = this.iSystemFullscreen.bON; + OpenTaiko.ConfigIni.bIncludeSubfoldersOnRandomSelect = this.iSystemRandomFromSubBox.bON; + + OpenTaiko.ConfigIni.bEnableVSync = this.iSystemVSyncWait.bON; + OpenTaiko.ConfigIni.bBufferedInputs = this.iSystemBufferedInput.bON; + OpenTaiko.ConfigIni.bEnableAVI = this.iSystemAVI.bON; + OpenTaiko.ConfigIni.eClipDispType = (EClipDispType)this.iSystemAVIDisplayMode.n現在選択されている項目番号; + OpenTaiko.ConfigIni.bEnableBGA = this.iSystemBGA.bON; + OpenTaiko.ConfigIni.nMsWaitPreviewSoundFromSongSelected = this.iSystemPreviewSoundWait.n現在の値; + OpenTaiko.ConfigIni.nMsWaitPreviewImageFromSongSelected = this.iSystemPreviewImageWait.n現在の値; + OpenTaiko.ConfigIni.bDisplayDebugInfo = this.iSystemDebugInfo.bON; + OpenTaiko.ConfigIni.nBackgroundTransparency = this.iSystemBGAlpha.n現在の値; + OpenTaiko.ConfigIni.bBGMPlayVoiceSound = this.iSystemBGMSound.bON; + OpenTaiko.ConfigIni.bDanTowerHide = this.iDanTowerHide.bON; + + OpenTaiko.ConfigIni.ApplySongVol = this.iSystemApplySongVol.bON; + OpenTaiko.ConfigIni.SoundEffectLevel = this.iSystemSoundEffectLevel.n現在の値; + OpenTaiko.ConfigIni.VoiceLevel = this.iSystemVoiceLevel.n現在の値; + OpenTaiko.ConfigIni.SongPreviewLevel = this.iSystemSongPreviewLevel.n現在の値; + OpenTaiko.ConfigIni.SongPlaybackLevel = this.iSystemSongPlaybackLevel.n現在の値; + OpenTaiko.ConfigIni.KeyboardSoundLevelIncrement = this.iSystemKeyboardSoundLevelIncrement.n現在の値; + OpenTaiko.ConfigIni.MusicPreTimeMs = this.MusicPreTimeMs.n現在の値; + + OpenTaiko.ConfigIni.bOutputLogs = this.iLogOutputLog.bON; + OpenTaiko.ConfigIni.bIsAutoResultCapture = this.iSystemAutoResultCapture.bON; // #25399 2011.6.9 yyagi + OpenTaiko.ConfigIni.SendDiscordPlayingInformation = this.SendDiscordPlayingInformation.bON; + + OpenTaiko.ConfigIni.nRisky = this.iSystemRisky.n現在の値; // #23559 2011.7.27 yyagi + + OpenTaiko.ConfigIni.strSystemSkinSubfolderFullName = skinSubFolders[nSkinIndex]; // #28195 2012.5.2 yyagi + OpenTaiko.Skin.SetCurrentSkinSubfolderFullName(OpenTaiko.ConfigIni.strSystemSkinSubfolderFullName, true); + + OpenTaiko.ConfigIni.nSoundDeviceType = this.iSystemSoundType.n現在選択されている項目番号; // #24820 2013.1.3 yyagi + OpenTaiko.ConfigIni.nBassBufferSizeMs = this.iSystemBassBufferSizeMs.n現在の値; // #24820 2013.1.15 yyagi + OpenTaiko.ConfigIni.nWASAPIBufferSizeMs = this.iSystemWASAPIBufferSizeMs.n現在の値; // #24820 2013.1.15 yyagi + // CDTXMania.ConfigIni.nASIOBufferSizeMs = this.iSystemASIOBufferSizeMs.n現在の値; // #24820 2013.1.3 yyagi + OpenTaiko.ConfigIni.nASIODevice = this.iSystemASIODevice.n現在選択されている項目番号; // #24820 2013.1.17 yyagi + OpenTaiko.ConfigIni.bUseOSTimer = this.iSystemSoundTimerType.bON; // #33689 2014.6.17 yyagi + + OpenTaiko.ConfigIni.bTimeStretch = this.iSystemTimeStretch.bON; // #23664 2013.2.24 yyagi + + + OpenTaiko.ConfigIni.sLang = CLangManager.intToLang(this.iSystemLanguage.n現在選択されている項目番号); + CLangManager.langAttach(OpenTaiko.ConfigIni.sLang); + OpenTaiko.ConfigIni.ShowChara = this.ShowChara.bON; + OpenTaiko.ConfigIni.ShowDancer = this.ShowDancer.bON; + OpenTaiko.ConfigIni.ShowRunner = this.ShowRunner.bON; + OpenTaiko.ConfigIni.ShowMob = this.ShowMob.bON; + OpenTaiko.ConfigIni.ShowFooter = this.ShowFooter.bON; + OpenTaiko.ConfigIni.ShowPuchiChara = this.ShowPuchiChara.bON; + + OpenTaiko.ConfigIni.nPlayerCount = this.iTaikoPlayerCount.n現在の値; + OpenTaiko.ConfigIni.FastRender = this.FastRender.bON; + OpenTaiko.ConfigIni.ASyncTextureLoad = this.ASyncTextureLoad.bON; + OpenTaiko.ConfigIni.SimpleMode = this.SimpleMode.bON; + +#if DEBUG + OpenTaiko.ConfigIni.DEBUG_bShowImgui = this.debugImGui.bON; +#endif + } + private void tConfigIniへ記録する_Drums() { + OpenTaiko.ConfigIni.nRollsPerSec = this.iRollsPerSec.n現在の値; + + OpenTaiko.ConfigIni.nDefaultAILevel = this.iAILevel.n現在の値; + for (int i = 0; i < 2; i++) + OpenTaiko.NamePlate.tNamePlateRefreshTitles(i); + + OpenTaiko.ConfigIni.bTight = this.iDrumsTight.bON; + + OpenTaiko.ConfigIni.nGlobalOffsetMs = this.iGlobalOffsetMs.n現在の値; + OpenTaiko.ConfigIni.bIgnoreSongUnlockables = this.iTaikoIgnoreSongUnlockables.bON; + + OpenTaiko.ConfigIni.nMinDisplayedCombo.Drums = this.iSystemMinComboDrums.n現在の値; + OpenTaiko.ConfigIni.nRisky = this.iSystemRisky.n現在の値; // #23559 2911.7.27 yyagi + OpenTaiko.ConfigIni.bBranchGuide = this.iTaikoBranchGuide.bON; + OpenTaiko.ConfigIni.nDefaultCourse = this.iTaikoDefaultCourse.n現在選択されている項目番号; + OpenTaiko.ConfigIni.nScoreMode = this.iTaikoScoreMode.n現在選択されている項目番号; + OpenTaiko.ConfigIni.ShinuchiMode = this.ShinuchiMode.bON; + OpenTaiko.ConfigIni.nBranchAnime = this.iTaikoBranchAnime.n現在選択されている項目番号; + OpenTaiko.ConfigIni.bNoInfo = this.iTaikoNoInfo.bON; + + OpenTaiko.ConfigIni.eGameMode = (EGame)this.iTaikoGameMode.n現在選択されている項目番号; + OpenTaiko.ConfigIni.bJudgeCountDisplay = this.iTaikoJudgeCountDisp.bON; + OpenTaiko.ConfigIni.ShowExExtraAnime = this.iShowExExtraAnime.bON; + OpenTaiko.ConfigIni.bJudgeBigNotes = this.iTaikoBigNotesJudge.bON; + OpenTaiko.ConfigIni.bForceNormalGauge = this.iTaikoForceNormalGauge.bON; + + OpenTaiko.ConfigIni.TokkunSkipMeasures = this.TokkunSkipCount.n現在の値; + OpenTaiko.ConfigIni.TokkunMashInterval = this.TokkunMashInterval.n現在の値; + } + //----------------- + #endregion } diff --git a/OpenTaiko/src/Stages/04.Config/CStageコンフィグ.cs b/OpenTaiko/src/Stages/04.Config/CStageコンフィグ.cs index 62aae328..6588ada4 100644 --- a/OpenTaiko/src/Stages/04.Config/CStageコンフィグ.cs +++ b/OpenTaiko/src/Stages/04.Config/CStageコンフィグ.cs @@ -4,652 +4,652 @@ using System.Runtime.InteropServices; using FDK; using SkiaSharp; -namespace OpenTaiko { - internal class CStageコンフィグ : CStage { - // Properties +namespace OpenTaiko; - public CActDFPFont actFont { get; private set; } - public CActCalibrationMode actCalibrationMode; +internal class CStageコンフィグ : CStage { + // Properties + + public CActDFPFont actFont { get; private set; } + public CActCalibrationMode actCalibrationMode; - // Constructor + // Constructor - public CStageコンフィグ() { - CActDFPFont font; - base.eStageID = CStage.EStage.Config; - base.ePhaseID = CStage.EPhase.Common_NORMAL; - this.actFont = font = new CActDFPFont(); - base.ChildActivities.Add(font); - base.ChildActivities.Add(this.actFIFO = new CActFIFOWhite()); - base.ChildActivities.Add(this.actList = new CActConfigList()); - base.ChildActivities.Add(this.actKeyAssign = new CActConfigKeyAssign()); - base.ChildActivities.Add(this.actオプションパネル = new CActオプションパネル()); - base.ChildActivities.Add(this.actCalibrationMode = new CActCalibrationMode()); - base.IsDeActivated = true; - } + public CStageコンフィグ() { + CActDFPFont font; + base.eStageID = CStage.EStage.Config; + base.ePhaseID = CStage.EPhase.Common_NORMAL; + this.actFont = font = new CActDFPFont(); + base.ChildActivities.Add(font); + base.ChildActivities.Add(this.actFIFO = new CActFIFOWhite()); + base.ChildActivities.Add(this.actList = new CActConfigList()); + base.ChildActivities.Add(this.actKeyAssign = new CActConfigKeyAssign()); + base.ChildActivities.Add(this.actオプションパネル = new CActオプションパネル()); + base.ChildActivities.Add(this.actCalibrationMode = new CActCalibrationMode()); + base.IsDeActivated = true; + } - // メソッド + // メソッド - public void tアサイン完了通知() // CONFIGにのみ存在 - { // - this.eItemPanelモード = EItemPanelモード.パッド一覧; // - } // - public void tパッド選択通知(EKeyConfigPart part, EKeyConfigPad pad) // - { // - this.actKeyAssign.t開始(part, pad, this.actList.ib現在の選択項目.str項目名); // - this.eItemPanelモード = EItemPanelモード.キーコード一覧; // - } // - public void t項目変更通知() // OPTIONと共通 - { // - this.t説明文パネルに現在選択されている項目の説明を描画する(); // - } // + public void tアサイン完了通知() // CONFIGにのみ存在 + { // + this.eItemPanelモード = EItemPanelモード.パッド一覧; // + } // + public void tパッド選択通知(EKeyConfigPart part, EKeyConfigPad pad) // + { // + this.actKeyAssign.t開始(part, pad, this.actList.ib現在の選択項目.str項目名); // + this.eItemPanelモード = EItemPanelモード.キーコード一覧; // + } // + public void t項目変更通知() // OPTIONと共通 + { // + this.t説明文パネルに現在選択されている項目の説明を描画する(); // + } // - // CStage 実装 + // CStage 実装 - public override void Activate() { - Trace.TraceInformation("コンフィグステージを活性化します。"); - Trace.Indent(); - try { - OpenTaiko.Skin.bgmコンフィグ画面.tPlay(); + public override void Activate() { + Trace.TraceInformation("コンフィグステージを活性化します。"); + Trace.Indent(); + try { + OpenTaiko.Skin.bgmコンフィグ画面.tPlay(); - this.n現在のメニュー番号 = 0; // - for (int i = 0; i < 4; i++) // - { // - this.ctキー反復用[i] = new CCounter(0, 0, 0, OpenTaiko.Timer); // - } // - this.bメニューにフォーカス中 = true; // ここまでOPTIONと共通 - this.eItemPanelモード = EItemPanelモード.パッド一覧; + this.n現在のメニュー番号 = 0; // + for (int i = 0; i < 4; i++) // + { // + this.ctキー反復用[i] = new CCounter(0, 0, 0, OpenTaiko.Timer); // + } // + this.bメニューにフォーカス中 = true; // ここまでOPTIONと共通 + this.eItemPanelモード = EItemPanelモード.パッド一覧; - ReloadMenus(); + ReloadMenus(); - Background = new ScriptBG(CSkin.Path($"{TextureLoader.BASE}{TextureLoader.CONFIG}Script.lua")); - Background.Init(); + Background = new ScriptBG(CSkin.Path($"{TextureLoader.BASE}{TextureLoader.CONFIG}Script.lua")); + Background.Init(); - if (this.bメニューにフォーカス中) { - this.t説明文パネルに現在選択されているメニューの説明を描画する(); - } else { - this.t説明文パネルに現在選択されている項目の説明を描画する(); - } - } finally { - Trace.TraceInformation("コンフィグステージの活性化を完了しました。"); - Trace.Unindent(); + if (this.bメニューにフォーカス中) { + this.t説明文パネルに現在選択されているメニューの説明を描画する(); + } else { + this.t説明文パネルに現在選択されている項目の説明を描画する(); } - base.Activate(); // 2011.3.14 yyagi: On活性化()をtryの中から外に移動 + } finally { + Trace.TraceInformation("コンフィグステージの活性化を完了しました。"); + Trace.Unindent(); } - public override void DeActivate() { - Trace.TraceInformation("コンフィグステージを非活性化します。"); - Trace.Indent(); - try { + base.Activate(); // 2011.3.14 yyagi: On活性化()をtryの中から外に移動 + } + public override void DeActivate() { + Trace.TraceInformation("コンフィグステージを非活性化します。"); + Trace.Indent(); + try { + OpenTaiko.Skin.bgmコンフィグ画面.tStop(); + + OpenTaiko.ConfigIni.t書き出し(OpenTaiko.strEXEのあるフォルダ + "Config.ini"); // CONFIGだけ + for (int i = 0; i < 4; i++) { + this.ctキー反復用[i] = null; + } + + for (int i = 0; i < txMenuItemLeft.GetLength(0); i++) { + txMenuItemLeft[i, 0].Dispose(); + txMenuItemLeft[i, 0] = null; + txMenuItemLeft[i, 1].Dispose(); + txMenuItemLeft[i, 1] = null; + } + txMenuItemLeft = null; + + OpenTaiko.tDisposeSafely(ref Background); + + base.DeActivate(); + } catch (UnauthorizedAccessException e) { + Trace.TraceError(e.ToString()); + Trace.TraceError("ファイルが読み取り専用になっていないか、管理者権限がないと書き込めなくなっていないか等を確認して下さい"); + Trace.TraceError("例外が発生しましたが処理を継続します。 (7a61f01b-1703-4aad-8d7d-08bd88ae8760)"); + } catch (Exception e) { + Trace.TraceError(e.ToString()); + Trace.TraceError("例外が発生しましたが処理を継続します。 (83f0d93c-bb04-4a19-a596-bc32de39f496)"); + } finally { + Trace.TraceInformation("コンフィグステージの非活性化を完了しました。"); + Trace.Unindent(); + } + } + + public void ReloadMenus() { + string[] strMenuItem = { + CLangManager.LangInstance.GetString("SETTINGS_SYSTEM"), + CLangManager.LangInstance.GetString("SETTINGS_GAME"), + CLangManager.LangInstance.GetString("SETTINGS_EXIT") + }; + + txMenuItemLeft = new CTexture[strMenuItem.Length, 2]; + + using (var prvFont = HPrivateFastFont.tInstantiateMainFont(OpenTaiko.Skin.Config_Font_Scale)) { + for (int i = 0; i < strMenuItem.Length; i++) { + using (var bmpStr = prvFont.DrawText(strMenuItem[i], Color.White, Color.Black, null, 30)) { + txMenuItemLeft[i, 0]?.Dispose(); + txMenuItemLeft[i, 0] = OpenTaiko.tテクスチャの生成(bmpStr, false); + } + using (var bmpStr = prvFont.DrawText(strMenuItem[i], + Color.White, + Color.Black, + null, + OpenTaiko.Skin.Config_Selected_Menu_Text_Grad_Color_1, + OpenTaiko.Skin.Config_Selected_Menu_Text_Grad_Color_2, + 30)) { + txMenuItemLeft[i, 1]?.Dispose(); + txMenuItemLeft[i, 1] = OpenTaiko.tテクスチャの生成(bmpStr, false); + } + } + } + } + + public override void CreateManagedResource() // OPTIONと画像以外共通 + { + //if (HPrivateFastFont.FontExists(TJAPlayer3.Skin.FontName)) + //{ + // this.ftフォント = new CCachedFontRenderer(TJAPlayer3.Skin.FontName, (int)TJAPlayer3.Skin.Config_Font_Scale_Description, CFontRenderer.FontStyle.Bold); + //} + //else + //{ + // this.ftフォント = new CCachedFontRenderer(CFontRenderer.DefaultFontName, (int)TJAPlayer3.Skin.Config_Font_Scale_Description, CFontRenderer.FontStyle.Bold); + //} + this.ftフォント = HPrivateFastFont.tInstantiateMainFont((int)OpenTaiko.Skin.Config_Font_Scale_Description, CFontRenderer.FontStyle.Bold); + + + OpenTaiko.Tx.Config_Cursor = OpenTaiko.tテクスチャの生成(CSkin.Path($"{TextureLoader.BASE}{TextureLoader.CONFIG}Cursor.png")); + + //ctBackgroundAnime = new CCounter(0, TJAPlayer3.Tx.Config_Background.szテクスチャサイズ.Width, 20, TJAPlayer3.Timer); + + /* + string[] strMenuItem = { + CLangManager.LangInstance.GetString(10085), + CLangManager.LangInstance.GetString(10086), + CLangManager.LangInstance.GetString(10087) + }; + + txMenuItemLeft = new CTexture[strMenuItem.Length, 2]; + + using (var prvFont = new CPrivateFastFont(new FontFamily(string.IsNullOrEmpty(TJAPlayer3.ConfigIni.FontName) ? "MS UI Gothic" : TJAPlayer3.ConfigIni.FontName), 20)) + { + for (int i = 0; i < strMenuItem.Length; i++) + { + using (var bmpStr = prvFont.DrawPrivateFont(strMenuItem[i], Color.White, Color.Black)) + { + txMenuItemLeft[i, 0] = TJAPlayer3.tテクスチャの生成(bmpStr, false); + } + using (var bmpStr = prvFont.DrawPrivateFont(strMenuItem[i], Color.White, Color.Black, Color.Yellow, Color.OrangeRed)) + { + txMenuItemLeft[i, 1] = TJAPlayer3.tテクスチャの生成(bmpStr, false); + } + } + } + */ + base.CreateManagedResource(); + } + public override void ReleaseManagedResource() // OPTIONと同じ(COnfig.iniの書き出しタイミングのみ異なるが、無視して良い) + { + if (this.ftフォント != null) { + this.ftフォント.Dispose(); + this.ftフォント = null; + } + //CDTXMania.tテクスチャの解放( ref this.tx背景 ); + //CDTXMania.tテクスチャの解放( ref this.tx上部パネル ); + //CDTXMania.tテクスチャの解放( ref this.tx下部パネル ); + //CDTXMania.tテクスチャの解放( ref this.txMenuカーソル ); + + OpenTaiko.tテクスチャの解放(ref this.tx説明文パネル); + base.ReleaseManagedResource(); + } + public override int Draw() { + if (base.IsDeActivated) + return 0; + + if (base.IsFirstDraw) { + base.ePhaseID = CStage.EPhase.Common_FADEIN; + this.actFIFO.tフェードイン開始(); + base.IsFirstDraw = false; + } + + //ctBackgroundAnime.t進行Loop(); + + // 描画 + + #region [ Background ] + + //--------------------- + /* + for(int i = 0; i < 2; i++) + if (TJAPlayer3.Tx.Config_Background != null ) + TJAPlayer3.Tx.Config_Background.t2D描画( 0 + -(TJAPlayer3.Tx.Config_Background.szテクスチャサイズ.Width * i) + ctBackgroundAnime.n現在の値, 0 ); + if(TJAPlayer3.Tx.Config_Header != null ) + TJAPlayer3.Tx.Config_Header.t2D描画( 0, 0 ); + */ + Background.Update(); + Background.Draw(); + //--------------------- + + #endregion + + #region [ Menu Cursor ] + //--------------------- + if (OpenTaiko.Tx.Config_Cursor != null) { + #region Old + /* + Rectangle rectangle; + TJAPlayer3.Tx.TJAPlayer3.Tx.Config_Cursor.Opacity = this.bメニューにフォーカス中 ? 255 : 128; + int x = 110; + int y = (int)( 145.5 + ( this.n現在のメニュー番号 * 37.5 ) ); + int num3 = 340; + TJAPlayer3.Tx.TJAPlayer3.Tx.Config_Cursor.t2D描画( x, y, new Rectangle( 0, 0, 32, 48 ) ); + TJAPlayer3.Tx.TJAPlayer3.Tx.Config_Cursor.t2D描画( ( x + num3 ) - 32, y, new Rectangle( 20, 0, 32, 48 ) ); + x += 32; + for( num3 -= 64; num3 > 0; num3 -= rectangle.Width ) + { + rectangle = new Rectangle( 16, 0, 32, 48 ); + if( num3 < 32 ) + { + rectangle.Width -= 32 - num3; + } + TJAPlayer3.Tx.TJAPlayer3.Tx.Config_Cursor.t2D描画( x, y, rectangle ); + x += rectangle.Width; + } + */ + #endregion + + + int x = OpenTaiko.Skin.Config_Item_X[this.n現在のメニュー番号]; + int y = OpenTaiko.Skin.Config_Item_Y[this.n現在のメニュー番号]; + + int width = OpenTaiko.Tx.Config_Cursor.sz画像サイズ.Width / 3; + int height = OpenTaiko.Tx.Config_Cursor.sz画像サイズ.Height; + + int move = OpenTaiko.Skin.Config_Item_Width; + + //Left + OpenTaiko.Tx.Config_Cursor.t2D中心基準描画(x - (width / 2) - move, y, + new Rectangle(0, 0, width, height)); + + //Right + OpenTaiko.Tx.Config_Cursor.t2D中心基準描画(x + (width / 2) + move, y, + new Rectangle(width * 2, 0, width, height)); + + //Center + OpenTaiko.Tx.Config_Cursor.vcScaleRatio.X = (move / (float)width) * 2.0f; + OpenTaiko.Tx.Config_Cursor.t2D拡大率考慮中央基準描画(x, y, + new Rectangle(width, 0, width, height)); + + OpenTaiko.Tx.Config_Cursor.vcScaleRatio.X = 1.0f; + } + //--------------------- + #endregion + + #region [ Menu ] + //--------------------- + //int menuY = 162 - 22 + 13; + //int stepY = 39; + for (int i = 0; i < txMenuItemLeft.GetLength(0); i++) { + //Bitmap bmpStr = (this.n現在のメニュー番号 == i) ? + // prvFont.DrawPrivateFont( strMenuItem[ i ], Color.White, Color.Black, Color.Yellow, Color.OrangeRed ) : + // prvFont.DrawPrivateFont( strMenuItem[ i ], Color.White, Color.Black ); + //txMenuItemLeft = CDTXMania.tテクスチャの生成( bmpStr, false ); + + int flag = (this.n現在のメニュー番号 == i) ? 1 : 0; + txMenuItemLeft[i, flag].t2D中心基準描画(OpenTaiko.Skin.Config_Item_X[i] + OpenTaiko.Skin.Config_Item_Font_Offset[0], OpenTaiko.Skin.Config_Item_Y[i] + OpenTaiko.Skin.Config_Item_Font_Offset[1]); //55 + //txMenuItem.Dispose(); + //menuY += stepY; + } + //--------------------- + #endregion + + #region [ Explanation Panel ] + //--------------------- + if (this.tx説明文パネル != null) + this.tx説明文パネル.t2D描画(OpenTaiko.Skin.Config_ExplanationPanel[0], OpenTaiko.Skin.Config_ExplanationPanel[1]); + //--------------------- + #endregion + + #region [ Item ] + //--------------------- + switch (this.eItemPanelモード) { + case EItemPanelモード.パッド一覧: + this.actList.t進行描画(!this.bメニューにフォーカス中); + break; + + case EItemPanelモード.キーコード一覧: + this.actKeyAssign.Draw(); + break; + } + //--------------------- + #endregion + + //#region [ 上部パネル ] + ////--------------------- + //if( this.tx上部パネル != null ) + // this.tx上部パネル.t2D描画( CDTXMania.app.Device, 0, 0 ); + ////--------------------- + //#endregion + //#region [ 下部パネル ] + ////--------------------- + //if( this.tx下部パネル != null ) + // this.tx下部パネル.t2D描画( CDTXMania.app.Device, 0, 720 - this.tx下部パネル.szテクスチャサイズ.Height ); + ////--------------------- + //#endregion + + #region [ Option Panel ] + //--------------------- + //this.actオプションパネル.On進行描画(); + //--------------------- + #endregion + + #region [ FadeOut ] + //--------------------- + switch (base.ePhaseID) { + case CStage.EPhase.Common_FADEIN: + if (this.actFIFO.Draw() != 0) { + base.ePhaseID = CStage.EPhase.Common_NORMAL; + } + break; + + case CStage.EPhase.Common_FADEOUT: + if (this.actFIFO.Draw() == 0) { + break; + } + return 1; + } + //--------------------- + #endregion + + #region [ Enumerating Songs ] + // CActEnumSongs側で表示する + #endregion + + // キー入力 + + if ((base.ePhaseID != CStage.EPhase.Common_NORMAL) + || this.actKeyAssign.bキー入力待ちの最中である) + return 0; + + if (actCalibrationMode.IsStarted) { + if (OpenTaiko.Skin.bgmコンフィグ画面.bIsPlaying) OpenTaiko.Skin.bgmコンフィグ画面.tStop(); - OpenTaiko.ConfigIni.t書き出し(OpenTaiko.strEXEのあるフォルダ + "Config.ini"); // CONFIGだけ - for (int i = 0; i < 4; i++) { - this.ctキー反復用[i] = null; + actCalibrationMode.Update(); + actCalibrationMode.Draw(); + } else if (actList.ScoreIniImportThreadIsActive) { + if (OpenTaiko.Tx.Tile_Black != null) { + OpenTaiko.Tx.Tile_Black.Opacity = 191; + for (int i = 0; i <= SampleFramework.GameWindowSize.Width; i += OpenTaiko.Tx.Tile_Black.szTextureSize.Width) { + for (int j = 0; j <= SampleFramework.GameWindowSize.Height; j += OpenTaiko.Tx.Tile_Black.szTextureSize.Height) { + OpenTaiko.Tx.Tile_Black.t2D描画(i, j); + } } - - for (int i = 0; i < txMenuItemLeft.GetLength(0); i++) { - txMenuItemLeft[i, 0].Dispose(); - txMenuItemLeft[i, 0] = null; - txMenuItemLeft[i, 1].Dispose(); - txMenuItemLeft[i, 1] = null; - } - txMenuItemLeft = null; - - OpenTaiko.tDisposeSafely(ref Background); - - base.DeActivate(); - } catch (UnauthorizedAccessException e) { - Trace.TraceError(e.ToString()); - Trace.TraceError("ファイルが読み取り専用になっていないか、管理者権限がないと書き込めなくなっていないか等を確認して下さい"); - Trace.TraceError("例外が発生しましたが処理を継続します。 (7a61f01b-1703-4aad-8d7d-08bd88ae8760)"); - } catch (Exception e) { - Trace.TraceError(e.ToString()); - Trace.TraceError("例外が発生しましたが処理を継続します。 (83f0d93c-bb04-4a19-a596-bc32de39f496)"); - } finally { - Trace.TraceInformation("コンフィグステージの非活性化を完了しました。"); - Trace.Unindent(); + OpenTaiko.Tx.Tile_Black.Opacity = 255; } - } - - public void ReloadMenus() { - string[] strMenuItem = { - CLangManager.LangInstance.GetString("SETTINGS_SYSTEM"), - CLangManager.LangInstance.GetString("SETTINGS_GAME"), - CLangManager.LangInstance.GetString("SETTINGS_EXIT") - }; - - txMenuItemLeft = new CTexture[strMenuItem.Length, 2]; - using (var prvFont = HPrivateFastFont.tInstantiateMainFont(OpenTaiko.Skin.Config_Font_Scale)) { - for (int i = 0; i < strMenuItem.Length; i++) { - using (var bmpStr = prvFont.DrawText(strMenuItem[i], Color.White, Color.Black, null, 30)) { - txMenuItemLeft[i, 0]?.Dispose(); - txMenuItemLeft[i, 0] = OpenTaiko.tテクスチャの生成(bmpStr, false); - } - using (var bmpStr = prvFont.DrawText(strMenuItem[i], - Color.White, - Color.Black, - null, - OpenTaiko.Skin.Config_Selected_Menu_Text_Grad_Color_1, - OpenTaiko.Skin.Config_Selected_Menu_Text_Grad_Color_2, - 30)) { - txMenuItemLeft[i, 1]?.Dispose(); - txMenuItemLeft[i, 1] = OpenTaiko.tテクスチャの生成(bmpStr, false); - } + using (var status_text = new CTexture(prvFont.DrawText( + CScoreIni_Importer.Status, + Color.White, + Color.Black, + null, + 30, + true))) { + status_text.t2D_DisplayImage_AnchorCenter(SampleFramework.GameWindowSize.Width / 2, SampleFramework.GameWindowSize.Height / 2); } } } + // 曲データの一覧取得中は、キー入力を無効化する + else if (!OpenTaiko.EnumSongs.IsEnumerating || OpenTaiko.actEnumSongs.bコマンドでの曲データ取得 != true) { + if (!OpenTaiko.Skin.bgmコンフィグ画面.bIsPlaying) + OpenTaiko.Skin.bgmコンフィグ画面.tPlay(); - public override void CreateManagedResource() // OPTIONと画像以外共通 - { - //if (HPrivateFastFont.FontExists(TJAPlayer3.Skin.FontName)) - //{ - // this.ftフォント = new CCachedFontRenderer(TJAPlayer3.Skin.FontName, (int)TJAPlayer3.Skin.Config_Font_Scale_Description, CFontRenderer.FontStyle.Bold); - //} - //else - //{ - // this.ftフォント = new CCachedFontRenderer(CFontRenderer.DefaultFontName, (int)TJAPlayer3.Skin.Config_Font_Scale_Description, CFontRenderer.FontStyle.Bold); - //} - this.ftフォント = HPrivateFastFont.tInstantiateMainFont((int)OpenTaiko.Skin.Config_Font_Scale_Description, CFontRenderer.FontStyle.Bold); - - - OpenTaiko.Tx.Config_Cursor = OpenTaiko.tテクスチャの生成(CSkin.Path($"{TextureLoader.BASE}{TextureLoader.CONFIG}Cursor.png")); - - //ctBackgroundAnime = new CCounter(0, TJAPlayer3.Tx.Config_Background.szテクスチャサイズ.Width, 20, TJAPlayer3.Timer); - - /* - string[] strMenuItem = { - CLangManager.LangInstance.GetString(10085), - CLangManager.LangInstance.GetString(10086), - CLangManager.LangInstance.GetString(10087) - }; - - txMenuItemLeft = new CTexture[strMenuItem.Length, 2]; - - using (var prvFont = new CPrivateFastFont(new FontFamily(string.IsNullOrEmpty(TJAPlayer3.ConfigIni.FontName) ? "MS UI Gothic" : TJAPlayer3.ConfigIni.FontName), 20)) - { - for (int i = 0; i < strMenuItem.Length; i++) - { - using (var bmpStr = prvFont.DrawPrivateFont(strMenuItem[i], Color.White, Color.Black)) - { - txMenuItemLeft[i, 0] = TJAPlayer3.tテクスチャの生成(bmpStr, false); + if ((OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Escape) || OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.FT)) || OpenTaiko.Pad.bPressedGB(EPad.FT)) { + OpenTaiko.Skin.soundCancelSFX.tPlay(); + if (!this.bメニューにフォーカス中) { + if (this.eItemPanelモード == EItemPanelモード.キーコード一覧) { + OpenTaiko.stageコンフィグ.tアサイン完了通知(); + return 0; } - using (var bmpStr = prvFont.DrawPrivateFont(strMenuItem[i], Color.White, Color.Black, Color.Yellow, Color.OrangeRed)) + if (!this.actList.bIsKeyAssignSelected && !this.actList.bIsFocusingParameter) // #24525 2011.3.15 yyagi, #32059 2013.9.17 yyagi { - txMenuItemLeft[i, 1] = TJAPlayer3.tテクスチャの生成(bmpStr, false); + this.bメニューにフォーカス中 = true; + } + this.t説明文パネルに現在選択されているメニューの説明を描画する(); + this.actList.tEsc押下(); // #24525 2011.3.15 yyagi ESC押下時の右メニュー描画用 + } else { + this.actFIFO.tフェードアウト開始(); + base.ePhaseID = CStage.EPhase.Common_FADEOUT; + } + } else if ((OpenTaiko.Pad.bPressedDGB(EPad.CY) || OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.RD)) || (OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.LC) || (OpenTaiko.ConfigIni.bEnterIsNotUsedInKeyAssignments && OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Return)))) { + if (this.n現在のメニュー番号 == 2) { + // Exit + OpenTaiko.Skin.soundDecideSFX.tPlay(); + this.actFIFO.tフェードアウト開始(); + base.ePhaseID = CStage.EPhase.Common_FADEOUT; + } else if (this.bメニューにフォーカス中) { + OpenTaiko.Skin.soundDecideSFX.tPlay(); + this.bメニューにフォーカス中 = false; + this.t説明文パネルに現在選択されている項目の説明を描画する(); + } else { + switch (this.eItemPanelモード) { + case EItemPanelモード.パッド一覧: + bool bIsKeyAssignSelectedBeforeHitEnter = this.actList.bIsKeyAssignSelected; // #24525 2011.3.15 yyagi + this.actList.tEnter押下(); + + this.t説明文パネルに現在選択されている項目の説明を描画する(); + + if (this.actList.b現在選択されている項目はReturnToMenuである) { + this.t説明文パネルに現在選択されているメニューの説明を描画する(); + if (bIsKeyAssignSelectedBeforeHitEnter == false) // #24525 2011.3.15 yyagi + { + this.bメニューにフォーカス中 = true; + } + } + break; + + case EItemPanelモード.キーコード一覧: + this.actKeyAssign.tEnter押下(); + break; } } } - */ - base.CreateManagedResource(); - } - public override void ReleaseManagedResource() // OPTIONと同じ(COnfig.iniの書き出しタイミングのみ異なるが、無視して良い) - { - if (this.ftフォント != null) { - this.ftフォント.Dispose(); - this.ftフォント = null; + this.ctキー反復用.Up.KeyIntervalFunc(OpenTaiko.InputManager.Keyboard.KeyPressing((int)SlimDXKeys.Key.UpArrow), new CCounter.KeyProcess(this.tカーソルを上へ移動する)); + this.ctキー反復用.R.KeyIntervalFunc(OpenTaiko.Pad.IsPressingGB(EPad.HH), new CCounter.KeyProcess(this.tカーソルを上へ移動する)); + if (OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.SD)) { + this.tカーソルを上へ移動する(); } - //CDTXMania.tテクスチャの解放( ref this.tx背景 ); - //CDTXMania.tテクスチャの解放( ref this.tx上部パネル ); - //CDTXMania.tテクスチャの解放( ref this.tx下部パネル ); - //CDTXMania.tテクスチャの解放( ref this.txMenuカーソル ); - - OpenTaiko.tテクスチャの解放(ref this.tx説明文パネル); - base.ReleaseManagedResource(); - } - public override int Draw() { - if (base.IsDeActivated) - return 0; - - if (base.IsFirstDraw) { - base.ePhaseID = CStage.EPhase.Common_FADEIN; - this.actFIFO.tフェードイン開始(); - base.IsFirstDraw = false; + this.ctキー反復用.Down.KeyIntervalFunc(OpenTaiko.InputManager.Keyboard.KeyPressing((int)SlimDXKeys.Key.DownArrow), new CCounter.KeyProcess(this.tカーソルを下へ移動する)); + this.ctキー反復用.B.KeyIntervalFunc(OpenTaiko.Pad.IsPressingGB(EPad.BD), new CCounter.KeyProcess(this.tカーソルを下へ移動する)); + if (OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.LT)) { + this.tカーソルを下へ移動する(); } + } + return 0; + } - //ctBackgroundAnime.t進行Loop(); - // 描画 + // その他 - #region [ Background ] + #region [ private ] + //----------------- + private enum EItemPanelモード { + パッド一覧, + キーコード一覧 + } - //--------------------- - /* - for(int i = 0; i < 2; i++) - if (TJAPlayer3.Tx.Config_Background != null ) - TJAPlayer3.Tx.Config_Background.t2D描画( 0 + -(TJAPlayer3.Tx.Config_Background.szテクスチャサイズ.Width * i) + ctBackgroundAnime.n現在の値, 0 ); - if(TJAPlayer3.Tx.Config_Header != null ) - TJAPlayer3.Tx.Config_Header.t2D描画( 0, 0 ); - */ - Background.Update(); - Background.Draw(); - //--------------------- + [StructLayout(LayoutKind.Sequential)] + private struct STキー反復用カウンタ { + public CCounter Up; + public CCounter Down; + public CCounter R; + public CCounter B; + public CCounter this[int index] { + get { + switch (index) { + case 0: + return this.Up; - #endregion + case 1: + return this.Down; - #region [ Menu Cursor ] - //--------------------- - if (OpenTaiko.Tx.Config_Cursor != null) { - #region Old - /* - Rectangle rectangle; - TJAPlayer3.Tx.TJAPlayer3.Tx.Config_Cursor.Opacity = this.bメニューにフォーカス中 ? 255 : 128; - int x = 110; - int y = (int)( 145.5 + ( this.n現在のメニュー番号 * 37.5 ) ); - int num3 = 340; - TJAPlayer3.Tx.TJAPlayer3.Tx.Config_Cursor.t2D描画( x, y, new Rectangle( 0, 0, 32, 48 ) ); - TJAPlayer3.Tx.TJAPlayer3.Tx.Config_Cursor.t2D描画( ( x + num3 ) - 32, y, new Rectangle( 20, 0, 32, 48 ) ); - x += 32; - for( num3 -= 64; num3 > 0; num3 -= rectangle.Width ) - { - rectangle = new Rectangle( 16, 0, 32, 48 ); - if( num3 < 32 ) - { - rectangle.Width -= 32 - num3; - } - TJAPlayer3.Tx.TJAPlayer3.Tx.Config_Cursor.t2D描画( x, y, rectangle ); - x += rectangle.Width; + case 2: + return this.R; + + case 3: + return this.B; } - */ - #endregion - - - int x = OpenTaiko.Skin.Config_Item_X[this.n現在のメニュー番号]; - int y = OpenTaiko.Skin.Config_Item_Y[this.n現在のメニュー番号]; - - int width = OpenTaiko.Tx.Config_Cursor.sz画像サイズ.Width / 3; - int height = OpenTaiko.Tx.Config_Cursor.sz画像サイズ.Height; - - int move = OpenTaiko.Skin.Config_Item_Width; - - //Left - OpenTaiko.Tx.Config_Cursor.t2D中心基準描画(x - (width / 2) - move, y, - new Rectangle(0, 0, width, height)); - - //Right - OpenTaiko.Tx.Config_Cursor.t2D中心基準描画(x + (width / 2) + move, y, - new Rectangle(width * 2, 0, width, height)); - - //Center - OpenTaiko.Tx.Config_Cursor.vcScaleRatio.X = (move / (float)width) * 2.0f; - OpenTaiko.Tx.Config_Cursor.t2D拡大率考慮中央基準描画(x, y, - new Rectangle(width, 0, width, height)); - - OpenTaiko.Tx.Config_Cursor.vcScaleRatio.X = 1.0f; + throw new IndexOutOfRangeException(); } - //--------------------- - #endregion + set { + switch (index) { + case 0: + this.Up = value; + return; - #region [ Menu ] - //--------------------- - //int menuY = 162 - 22 + 13; - //int stepY = 39; - for (int i = 0; i < txMenuItemLeft.GetLength(0); i++) { - //Bitmap bmpStr = (this.n現在のメニュー番号 == i) ? - // prvFont.DrawPrivateFont( strMenuItem[ i ], Color.White, Color.Black, Color.Yellow, Color.OrangeRed ) : - // prvFont.DrawPrivateFont( strMenuItem[ i ], Color.White, Color.Black ); - //txMenuItemLeft = CDTXMania.tテクスチャの生成( bmpStr, false ); + case 1: + this.Down = value; + return; - int flag = (this.n現在のメニュー番号 == i) ? 1 : 0; - txMenuItemLeft[i, flag].t2D中心基準描画(OpenTaiko.Skin.Config_Item_X[i] + OpenTaiko.Skin.Config_Item_Font_Offset[0], OpenTaiko.Skin.Config_Item_Y[i] + OpenTaiko.Skin.Config_Item_Font_Offset[1]); //55 - //txMenuItem.Dispose(); - //menuY += stepY; + case 2: + this.R = value; + return; + + case 3: + this.B = value; + return; + } + throw new IndexOutOfRangeException(); } - //--------------------- - #endregion + } + } - #region [ Explanation Panel ] - //--------------------- - if (this.tx説明文パネル != null) - this.tx説明文パネル.t2D描画(OpenTaiko.Skin.Config_ExplanationPanel[0], OpenTaiko.Skin.Config_ExplanationPanel[1]); - //--------------------- - #endregion + //private CCounter ctBackgroundAnime; + private CActFIFOWhite actFIFO; + private CActConfigKeyAssign actKeyAssign; + public CActConfigList actList; + private CActオプションパネル actオプションパネル; + private bool bメニューにフォーカス中; + private STキー反復用カウンタ ctキー反復用; + private const int DESC_H = 0x80; + private const int DESC_W = 220; + private EItemPanelモード eItemPanelモード; + internal CCachedFontRenderer ftフォント; + private int n現在のメニュー番号; + //private CTexture txMenuカーソル; + //private CTexture tx下部パネル; + //private CTexture tx上部パネル; + private CTexture tx説明文パネル; + //private CTexture tx背景; + private CTexture[,] txMenuItemLeft; - #region [ Item ] - //--------------------- + private ScriptBG Background; + + private void tカーソルを下へ移動する() { + if (!this.bメニューにフォーカス中) { switch (this.eItemPanelモード) { case EItemPanelモード.パッド一覧: - this.actList.t進行描画(!this.bメニューにフォーカス中); - break; + this.actList.t次に移動(); + return; case EItemPanelモード.キーコード一覧: - this.actKeyAssign.Draw(); - break; + this.actKeyAssign.t次に移動(); + return; } - //--------------------- - #endregion - - //#region [ 上部パネル ] - ////--------------------- - //if( this.tx上部パネル != null ) - // this.tx上部パネル.t2D描画( CDTXMania.app.Device, 0, 0 ); - ////--------------------- - //#endregion - //#region [ 下部パネル ] - ////--------------------- - //if( this.tx下部パネル != null ) - // this.tx下部パネル.t2D描画( CDTXMania.app.Device, 0, 720 - this.tx下部パネル.szテクスチャサイズ.Height ); - ////--------------------- - //#endregion - - #region [ Option Panel ] - //--------------------- - //this.actオプションパネル.On進行描画(); - //--------------------- - #endregion - - #region [ FadeOut ] - //--------------------- - switch (base.ePhaseID) { - case CStage.EPhase.Common_FADEIN: - if (this.actFIFO.Draw() != 0) { - base.ePhaseID = CStage.EPhase.Common_NORMAL; - } + } else { + OpenTaiko.Skin.soundカーソル移動音.tPlay(); + this.n現在のメニュー番号 = (this.n現在のメニュー番号 + 1) % 3; + switch (this.n現在のメニュー番号) { + case 0: + this.actList.t項目リストの設定_System(); break; - case CStage.EPhase.Common_FADEOUT: - if (this.actFIFO.Draw() == 0) { - break; - } - return 1; + case 1: + this.actList.t項目リストの設定_Drums(); + break; + + case 2: + this.actList.t項目リストの設定_Exit(); + break; } - //--------------------- - #endregion - - #region [ Enumerating Songs ] - // CActEnumSongs側で表示する - #endregion - - // キー入力 - - if ((base.ePhaseID != CStage.EPhase.Common_NORMAL) - || this.actKeyAssign.bキー入力待ちの最中である) - return 0; - - if (actCalibrationMode.IsStarted) { - if (OpenTaiko.Skin.bgmコンフィグ画面.bIsPlaying) - OpenTaiko.Skin.bgmコンフィグ画面.tStop(); - - actCalibrationMode.Update(); - actCalibrationMode.Draw(); - } else if (actList.ScoreIniImportThreadIsActive) { - if (OpenTaiko.Tx.Tile_Black != null) { - OpenTaiko.Tx.Tile_Black.Opacity = 191; - for (int i = 0; i <= SampleFramework.GameWindowSize.Width; i += OpenTaiko.Tx.Tile_Black.szTextureSize.Width) { - for (int j = 0; j <= SampleFramework.GameWindowSize.Height; j += OpenTaiko.Tx.Tile_Black.szTextureSize.Height) { - OpenTaiko.Tx.Tile_Black.t2D描画(i, j); - } - } - OpenTaiko.Tx.Tile_Black.Opacity = 255; - } - using (var prvFont = HPrivateFastFont.tInstantiateMainFont(OpenTaiko.Skin.Config_Font_Scale)) { - using (var status_text = new CTexture(prvFont.DrawText( - CScoreIni_Importer.Status, - Color.White, - Color.Black, - null, - 30, - true))) { - status_text.t2D_DisplayImage_AnchorCenter(SampleFramework.GameWindowSize.Width / 2, SampleFramework.GameWindowSize.Height / 2); - } - } - } - // 曲データの一覧取得中は、キー入力を無効化する - else if (!OpenTaiko.EnumSongs.IsEnumerating || OpenTaiko.actEnumSongs.bコマンドでの曲データ取得 != true) { - if (!OpenTaiko.Skin.bgmコンフィグ画面.bIsPlaying) - OpenTaiko.Skin.bgmコンフィグ画面.tPlay(); - - if ((OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Escape) || OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.FT)) || OpenTaiko.Pad.bPressedGB(EPad.FT)) { - OpenTaiko.Skin.soundCancelSFX.tPlay(); - if (!this.bメニューにフォーカス中) { - if (this.eItemPanelモード == EItemPanelモード.キーコード一覧) { - OpenTaiko.stageコンフィグ.tアサイン完了通知(); - return 0; - } - if (!this.actList.bIsKeyAssignSelected && !this.actList.bIsFocusingParameter) // #24525 2011.3.15 yyagi, #32059 2013.9.17 yyagi - { - this.bメニューにフォーカス中 = true; - } - this.t説明文パネルに現在選択されているメニューの説明を描画する(); - this.actList.tEsc押下(); // #24525 2011.3.15 yyagi ESC押下時の右メニュー描画用 - } else { - this.actFIFO.tフェードアウト開始(); - base.ePhaseID = CStage.EPhase.Common_FADEOUT; - } - } else if ((OpenTaiko.Pad.bPressedDGB(EPad.CY) || OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.RD)) || (OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.LC) || (OpenTaiko.ConfigIni.bEnterIsNotUsedInKeyAssignments && OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Return)))) { - if (this.n現在のメニュー番号 == 2) { - // Exit - OpenTaiko.Skin.soundDecideSFX.tPlay(); - this.actFIFO.tフェードアウト開始(); - base.ePhaseID = CStage.EPhase.Common_FADEOUT; - } else if (this.bメニューにフォーカス中) { - OpenTaiko.Skin.soundDecideSFX.tPlay(); - this.bメニューにフォーカス中 = false; - this.t説明文パネルに現在選択されている項目の説明を描画する(); - } else { - switch (this.eItemPanelモード) { - case EItemPanelモード.パッド一覧: - bool bIsKeyAssignSelectedBeforeHitEnter = this.actList.bIsKeyAssignSelected; // #24525 2011.3.15 yyagi - this.actList.tEnter押下(); - - this.t説明文パネルに現在選択されている項目の説明を描画する(); - - if (this.actList.b現在選択されている項目はReturnToMenuである) { - this.t説明文パネルに現在選択されているメニューの説明を描画する(); - if (bIsKeyAssignSelectedBeforeHitEnter == false) // #24525 2011.3.15 yyagi - { - this.bメニューにフォーカス中 = true; - } - } - break; - - case EItemPanelモード.キーコード一覧: - this.actKeyAssign.tEnter押下(); - break; - } - } - } - this.ctキー反復用.Up.KeyIntervalFunc(OpenTaiko.InputManager.Keyboard.KeyPressing((int)SlimDXKeys.Key.UpArrow), new CCounter.KeyProcess(this.tカーソルを上へ移動する)); - this.ctキー反復用.R.KeyIntervalFunc(OpenTaiko.Pad.IsPressingGB(EPad.HH), new CCounter.KeyProcess(this.tカーソルを上へ移動する)); - if (OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.SD)) { - this.tカーソルを上へ移動する(); - } - this.ctキー反復用.Down.KeyIntervalFunc(OpenTaiko.InputManager.Keyboard.KeyPressing((int)SlimDXKeys.Key.DownArrow), new CCounter.KeyProcess(this.tカーソルを下へ移動する)); - this.ctキー反復用.B.KeyIntervalFunc(OpenTaiko.Pad.IsPressingGB(EPad.BD), new CCounter.KeyProcess(this.tカーソルを下へ移動する)); - if (OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.LT)) { - this.tカーソルを下へ移動する(); - } - } - return 0; + this.t説明文パネルに現在選択されているメニューの説明を描画する(); } - - - // その他 - - #region [ private ] - //----------------- - private enum EItemPanelモード { - パッド一覧, - キーコード一覧 - } - - [StructLayout(LayoutKind.Sequential)] - private struct STキー反復用カウンタ { - public CCounter Up; - public CCounter Down; - public CCounter R; - public CCounter B; - public CCounter this[int index] { - get { - switch (index) { - case 0: - return this.Up; - - case 1: - return this.Down; - - case 2: - return this.R; - - case 3: - return this.B; - } - throw new IndexOutOfRangeException(); - } - set { - switch (index) { - case 0: - this.Up = value; - return; - - case 1: - this.Down = value; - return; - - case 2: - this.R = value; - return; - - case 3: - this.B = value; - return; - } - throw new IndexOutOfRangeException(); - } - } - } - - //private CCounter ctBackgroundAnime; - private CActFIFOWhite actFIFO; - private CActConfigKeyAssign actKeyAssign; - public CActConfigList actList; - private CActオプションパネル actオプションパネル; - private bool bメニューにフォーカス中; - private STキー反復用カウンタ ctキー反復用; - private const int DESC_H = 0x80; - private const int DESC_W = 220; - private EItemPanelモード eItemPanelモード; - internal CCachedFontRenderer ftフォント; - private int n現在のメニュー番号; - //private CTexture txMenuカーソル; - //private CTexture tx下部パネル; - //private CTexture tx上部パネル; - private CTexture tx説明文パネル; - //private CTexture tx背景; - private CTexture[,] txMenuItemLeft; - - private ScriptBG Background; - - private void tカーソルを下へ移動する() { - if (!this.bメニューにフォーカス中) { - switch (this.eItemPanelモード) { - case EItemPanelモード.パッド一覧: - this.actList.t次に移動(); - return; - - case EItemPanelモード.キーコード一覧: - this.actKeyAssign.t次に移動(); - return; - } - } else { - OpenTaiko.Skin.soundカーソル移動音.tPlay(); - this.n現在のメニュー番号 = (this.n現在のメニュー番号 + 1) % 3; - switch (this.n現在のメニュー番号) { - case 0: - this.actList.t項目リストの設定_System(); - break; - - case 1: - this.actList.t項目リストの設定_Drums(); - break; - - case 2: - this.actList.t項目リストの設定_Exit(); - break; - } - this.t説明文パネルに現在選択されているメニューの説明を描画する(); - } - } - private void tカーソルを上へ移動する() { - if (!this.bメニューにフォーカス中) { - switch (this.eItemPanelモード) { - case EItemPanelモード.パッド一覧: - this.actList.t前に移動(); - return; - - case EItemPanelモード.キーコード一覧: - this.actKeyAssign.t前に移動(); - return; - } - } else { - OpenTaiko.Skin.soundカーソル移動音.tPlay(); - this.n現在のメニュー番号 = ((this.n現在のメニュー番号 - 1) + 3) % 3; - switch (this.n現在のメニュー番号) { - case 0: - this.actList.t項目リストの設定_System(); - break; - - case 1: - this.actList.t項目リストの設定_Drums(); - break; - - case 2: - this.actList.t項目リストの設定_Exit(); - break; - } - this.t説明文パネルに現在選択されているメニューの説明を描画する(); - } - } - private void t説明文パネルに現在選択されているメニューの説明を描画する() { - try { - string text = ""; - switch (this.n現在のメニュー番号) { - case 0: - text = CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_DESC"); - break; - case 1: - text = CLangManager.LangInstance.GetString("SETTINGS_GAME_DESC"); - break; - case 2: - text = CLangManager.LangInstance.GetString("SETTINGS_EXIT_DESC"); - break; - } - SKBitmap image = ftフォント.DrawText(text, Color.White, Color.Black, null, 30); - if (this.tx説明文パネル != null) { - this.tx説明文パネル.Dispose(); - } - this.tx説明文パネル = new CTexture(image); - image.Dispose(); - } catch (CTextureCreateFailedException e) { - Trace.TraceError(e.ToString()); - Trace.TraceError("説明文テクスチャの作成に失敗しました。"); - this.tx説明文パネル = null; - } - } - private void t説明文パネルに現在選択されている項目の説明を描画する() { - try { - var image = new SKBitmap(440, 288); // 説明文領域サイズの縦横 2 倍。(描画時に 0.5 倍で表示する___のは中止。処理速度向上のため。) - - CItemBase item = this.actList.ib現在の選択項目; - if ((item.str説明文 != null) && (item.str説明文.Length > 0)) { - image.Dispose(); - image = ftフォント.DrawText(item.str説明文, Color.White, Color.Black, null, 30); - } - if (this.tx説明文パネル != null) { - this.tx説明文パネル.Dispose(); - } - this.tx説明文パネル = new CTexture(image); - image.Dispose(); - } catch (CTextureCreateFailedException e) { - Trace.TraceError(e.ToString()); - Trace.TraceError("説明文パネルテクスチャの作成に失敗しました。"); - this.tx説明文パネル = null; - } - } - //----------------- - #endregion } + private void tカーソルを上へ移動する() { + if (!this.bメニューにフォーカス中) { + switch (this.eItemPanelモード) { + case EItemPanelモード.パッド一覧: + this.actList.t前に移動(); + return; + + case EItemPanelモード.キーコード一覧: + this.actKeyAssign.t前に移動(); + return; + } + } else { + OpenTaiko.Skin.soundカーソル移動音.tPlay(); + this.n現在のメニュー番号 = ((this.n現在のメニュー番号 - 1) + 3) % 3; + switch (this.n現在のメニュー番号) { + case 0: + this.actList.t項目リストの設定_System(); + break; + + case 1: + this.actList.t項目リストの設定_Drums(); + break; + + case 2: + this.actList.t項目リストの設定_Exit(); + break; + } + this.t説明文パネルに現在選択されているメニューの説明を描画する(); + } + } + private void t説明文パネルに現在選択されているメニューの説明を描画する() { + try { + string text = ""; + switch (this.n現在のメニュー番号) { + case 0: + text = CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_DESC"); + break; + case 1: + text = CLangManager.LangInstance.GetString("SETTINGS_GAME_DESC"); + break; + case 2: + text = CLangManager.LangInstance.GetString("SETTINGS_EXIT_DESC"); + break; + } + SKBitmap image = ftフォント.DrawText(text, Color.White, Color.Black, null, 30); + if (this.tx説明文パネル != null) { + this.tx説明文パネル.Dispose(); + } + this.tx説明文パネル = new CTexture(image); + image.Dispose(); + } catch (CTextureCreateFailedException e) { + Trace.TraceError(e.ToString()); + Trace.TraceError("説明文テクスチャの作成に失敗しました。"); + this.tx説明文パネル = null; + } + } + private void t説明文パネルに現在選択されている項目の説明を描画する() { + try { + var image = new SKBitmap(440, 288); // 説明文領域サイズの縦横 2 倍。(描画時に 0.5 倍で表示する___のは中止。処理速度向上のため。) + + CItemBase item = this.actList.ib現在の選択項目; + if ((item.str説明文 != null) && (item.str説明文.Length > 0)) { + image.Dispose(); + image = ftフォント.DrawText(item.str説明文, Color.White, Color.Black, null, 30); + } + if (this.tx説明文パネル != null) { + this.tx説明文パネル.Dispose(); + } + this.tx説明文パネル = new CTexture(image); + image.Dispose(); + } catch (CTextureCreateFailedException e) { + Trace.TraceError(e.ToString()); + Trace.TraceError("説明文パネルテクスチャの作成に失敗しました。"); + this.tx説明文パネル = null; + } + } + //----------------- + #endregion } diff --git a/OpenTaiko/src/Stages/05.DaniSelect/CActSelect段位リスト.cs b/OpenTaiko/src/Stages/05.DaniSelect/CActSelect段位リスト.cs index ed56180d..569d07d9 100644 --- a/OpenTaiko/src/Stages/05.DaniSelect/CActSelect段位リスト.cs +++ b/OpenTaiko/src/Stages/05.DaniSelect/CActSelect段位リスト.cs @@ -3,910 +3,909 @@ using FDK; using Silk.NET.Maths; using Rectangle = System.Drawing.Rectangle; -namespace OpenTaiko { - class CActSelect段位リスト : CStage { - public CActSelect段位リスト() { - for (int i = 0; i < 10; i++) { - stLevel[i].ch = i.ToString().ToCharArray()[0]; - stLevel[i].pt = new Point(i * 14, 0); +namespace OpenTaiko; - stSoulNumber[i].ch = i.ToString().ToCharArray()[0]; - stSoulNumber[i].pt = new Point(i * 23, 0); +class CActSelect段位リスト : CStage { + public CActSelect段位リスト() { + for (int i = 0; i < 10; i++) { + stLevel[i].ch = i.ToString().ToCharArray()[0]; + stLevel[i].pt = new Point(i * 14, 0); - stExamNumber[i].ch = i.ToString().ToCharArray()[0]; - stExamNumber[i].pt = new Point(i * 19, 0); + stSoulNumber[i].ch = i.ToString().ToCharArray()[0]; + stSoulNumber[i].pt = new Point(i * 23, 0); + + stExamNumber[i].ch = i.ToString().ToCharArray()[0]; + stExamNumber[i].pt = new Point(i * 19, 0); + } + } + + public bool bスクロール中 { + get { + return ctDaniMoveAnime.IsTicked; + } + } + + public override void Activate() { + if (this.IsActivated) + return; + + DaniInAnime = false; + + ctDaniMoveAnime = new CCounter(); + ctDanAnimeIn = new CCounter(); + ctDaniIn = new CCounter(0, 6000, 1, OpenTaiko.Timer); + + ctDanTick = new CCounter(0, 510, 3, OpenTaiko.Timer); + + ctExamConditionsAnim = new CCounter(0, 4000, 1, OpenTaiko.Timer); + + this.ttkExams = new TitleTextureKey[(int)Exam.Type.Total]; + for (int i = 0; i < this.ttkExams.Length; i++) { + this.ttkExams[i] = new TitleTextureKey(CLangManager.LangInstance.GetExamName(i), this.pfExamFont, Color.White, Color.SaddleBrown, 1000); + } + + listSongs = OpenTaiko.Songs管理.list曲ルート_Dan; + tUpdateSongs(); + + base.Activate(); + } + + public override void DeActivate() { + + base.DeActivate(); + } + + public override void CreateManagedResource() { + this.pfDanFolder = HPrivateFastFont.tInstantiateMainFont(OpenTaiko.Skin.DaniSelect_Font_DanFolder_Size[0]); + this.pfDanFolderDesc = HPrivateFastFont.tInstantiateMainFont(OpenTaiko.Skin.DaniSelect_Font_DanFolder_Size[1]); + this.pfDanSong = HPrivateFastFont.tInstantiateMainFont(OpenTaiko.Skin.DaniSelect_Font_DanSong_Size); + this.pfExamFont = HPrivateFastFont.tInstantiateMainFont(OpenTaiko.Skin.DaniSelect_Font_Exam_Size); + + base.CreateManagedResource(); + } + + public override void ReleaseManagedResource() { + OpenTaiko.tDisposeSafely(ref pfDanFolder); + OpenTaiko.tDisposeSafely(ref pfDanFolderDesc); + OpenTaiko.tDisposeSafely(ref pfDanSong); + OpenTaiko.tDisposeSafely(ref pfExamFont); + + base.ReleaseManagedResource(); + } + + public override int Draw() { + ctDaniMoveAnime.Tick(); + ctDaniIn.Tick(); + ctDanAnimeIn.Tick(); + ctDanTick.TickLoop(); + + ctExamConditionsAnim.TickLoop(); + + if (ctDaniIn.CurrentValue == 6000) { + if (!DaniInAnime) { + ctDanAnimeIn.Start(0, 90, 2f, OpenTaiko.Timer); + DaniInAnime = true; } } - public bool bスクロール中 { - get { - return ctDaniMoveAnime.IsTicked; - } - } + #region [ バー表示 ] - public override void Activate() { - if (this.IsActivated) - return; + if (stバー情報.Length != 0 && ctDaniIn.CurrentValue == 6000) { + OpenTaiko.Tx.DanC_ExamType.vcScaleRatio.X = 0.81f; + OpenTaiko.Tx.DanC_ExamType.vcScaleRatio.Y = 0.81f; - DaniInAnime = false; + float Anime = ctDanAnimeIn.CurrentValue == 90 ? bLeftMove ? (float)Math.Sin(ctDaniMoveAnime.CurrentValue * (Math.PI / 180)) * OpenTaiko.Skin.Resolution[0] : -((float)Math.Sin(ctDaniMoveAnime.CurrentValue * (Math.PI / 180)) * OpenTaiko.Skin.Resolution[0]) : OpenTaiko.Skin.Resolution[0] - (float)Math.Sin(ctDanAnimeIn.CurrentValue * (Math.PI / 180)) * OpenTaiko.Skin.Resolution[0]; - ctDaniMoveAnime = new CCounter(); - ctDanAnimeIn = new CCounter(); - ctDaniIn = new CCounter(0, 6000, 1, OpenTaiko.Timer); + tDrawDanSelectedLevel(Anime); - ctDanTick = new CCounter(0, 510, 3, OpenTaiko.Timer); - - ctExamConditionsAnim = new CCounter(0, 4000, 1, OpenTaiko.Timer); - - this.ttkExams = new TitleTextureKey[(int)Exam.Type.Total]; - for (int i = 0; i < this.ttkExams.Length; i++) { - this.ttkExams[i] = new TitleTextureKey(CLangManager.LangInstance.GetExamName(i), this.pfExamFont, Color.White, Color.SaddleBrown, 1000); - } - - listSongs = OpenTaiko.Songs管理.list曲ルート_Dan; - tUpdateSongs(); - - base.Activate(); - } - - public override void DeActivate() { - - base.DeActivate(); - } - - public override void CreateManagedResource() { - this.pfDanFolder = HPrivateFastFont.tInstantiateMainFont(OpenTaiko.Skin.DaniSelect_Font_DanFolder_Size[0]); - this.pfDanFolderDesc = HPrivateFastFont.tInstantiateMainFont(OpenTaiko.Skin.DaniSelect_Font_DanFolder_Size[1]); - this.pfDanSong = HPrivateFastFont.tInstantiateMainFont(OpenTaiko.Skin.DaniSelect_Font_DanSong_Size); - this.pfExamFont = HPrivateFastFont.tInstantiateMainFont(OpenTaiko.Skin.DaniSelect_Font_Exam_Size); - - base.CreateManagedResource(); - } - - public override void ReleaseManagedResource() { - OpenTaiko.tDisposeSafely(ref pfDanFolder); - OpenTaiko.tDisposeSafely(ref pfDanFolderDesc); - OpenTaiko.tDisposeSafely(ref pfDanSong); - OpenTaiko.tDisposeSafely(ref pfExamFont); - - base.ReleaseManagedResource(); - } - - public override int Draw() { - ctDaniMoveAnime.Tick(); - ctDaniIn.Tick(); - ctDanAnimeIn.Tick(); - ctDanTick.TickLoop(); - - ctExamConditionsAnim.TickLoop(); - - if (ctDaniIn.CurrentValue == 6000) { - if (!DaniInAnime) { - ctDanAnimeIn.Start(0, 90, 2f, OpenTaiko.Timer); - DaniInAnime = true; - } - } - - #region [ バー表示 ] - - if (stバー情報.Length != 0 && ctDaniIn.CurrentValue == 6000) { - OpenTaiko.Tx.DanC_ExamType.vcScaleRatio.X = 0.81f; - OpenTaiko.Tx.DanC_ExamType.vcScaleRatio.Y = 0.81f; - - float Anime = ctDanAnimeIn.CurrentValue == 90 ? bLeftMove ? (float)Math.Sin(ctDaniMoveAnime.CurrentValue * (Math.PI / 180)) * OpenTaiko.Skin.Resolution[0] : -((float)Math.Sin(ctDaniMoveAnime.CurrentValue * (Math.PI / 180)) * OpenTaiko.Skin.Resolution[0]) : OpenTaiko.Skin.Resolution[0] - (float)Math.Sin(ctDanAnimeIn.CurrentValue * (Math.PI / 180)) * OpenTaiko.Skin.Resolution[0]; - - tDrawDanSelectedLevel(Anime); - - if (bLeftMove && n現在の選択行 - 1 >= 0) - tDrawDanSelectedLevel(Anime, -1); - if (!bLeftMove && n現在の選択行 + 1 <= stバー情報.Length - 1) - tDrawDanSelectedLevel(Anime, 1); - } - - #endregion - - #region [ バー移動 ] - - if (ctDaniMoveAnime.CurrentValue == 90) { - if (bLeftMove) { - this.n現在の選択行 -= n現在の選択行 - 1 >= 0 ? 1 : 0; - } else { - this.n現在の選択行 += n現在の選択行 + 1 < this.stバー情報.Length ? 1 : 0; - } - ctDaniMoveAnime.Stop(); - ctDaniMoveAnime.CurrentValue = 0; - } - - #endregion - - // To do : Display the 27 (max) bars one by one - if (ctDaniIn.CurrentValue < 5000) - return 0; - - #region [Upper plates] - - // stバー情報[n現在の選択行] - - int tickWidth = OpenTaiko.Tx.Dani_Plate.szTextureSize.Width / 7; - int tickHeight = OpenTaiko.Tx.Dani_Plate.szTextureSize.Height; - int tickExtraWidth = OpenTaiko.Tx.Dani_Plate_Extra.szTextureSize.Width / 3; - int tickExtraHeight = OpenTaiko.Tx.Dani_Plate_Extra.szTextureSize.Height; - - for (int idx = -13; idx < 14; idx++) { - - if (ctDaniIn.CurrentValue < 5000 + (idx + 13) * 33) - break; - - int currentSong = n現在の選択行 + idx; - - if (currentSong < 0) - continue; - if (currentSong >= stバー情報.Length) - break; - - int xPos = OpenTaiko.Skin.DaniSelect_Plate[0] + (idx == 0 ? OpenTaiko.Skin.DaniSelect_Plate_Center_Move[0] : 0) + idx * OpenTaiko.Skin.DaniSelect_Plate_Move[0]; - int yPos = OpenTaiko.Skin.DaniSelect_Plate[1] + (idx == 0 ? OpenTaiko.Skin.DaniSelect_Plate_Center_Move[1] : 0) + idx * OpenTaiko.Skin.DaniSelect_Plate_Move[1]; - - - - #region [Plate background] - - int tick = Math.Max(0, Math.Min(5, stバー情報[currentSong].nDanTick)); - Color tickColor = stバー情報[currentSong].cDanTickColor; - - switch (stバー情報[currentSong].eノード種別) { - case CSongListNode.ENodeType.BACKBOX: { - OpenTaiko.Tx.Dani_Plate_Extra?.tUpdateOpacity(255); - OpenTaiko.Tx.Dani_Plate_Extra?.tUpdateColor4(CConversion.ColorToColor4(tickColor)); - OpenTaiko.Tx.Dani_Plate_Extra?.t2D拡大率考慮上中央基準描画(xPos, yPos, new Rectangle(0, 0, tickExtraWidth, tickExtraHeight)); - break; - } - case CSongListNode.ENodeType.BOX: { - OpenTaiko.Tx.Dani_Plate_Extra?.tUpdateOpacity(255); - OpenTaiko.Tx.Dani_Plate_Extra?.tUpdateColor4(CConversion.ColorToColor4(tickColor)); - OpenTaiko.Tx.Dani_Plate_Extra?.t2D拡大率考慮上中央基準描画(xPos, yPos, new Rectangle(tickExtraWidth, 0, tickExtraWidth, tickExtraHeight)); - break; - } - case CSongListNode.ENodeType.RANDOM: { - OpenTaiko.Tx.Dani_Plate_Extra?.tUpdateOpacity(255); - OpenTaiko.Tx.Dani_Plate_Extra?.tUpdateColor4(CConversion.ColorToColor4(tickColor)); - OpenTaiko.Tx.Dani_Plate_Extra?.t2D拡大率考慮上中央基準描画(xPos, yPos, new Rectangle(tickExtraWidth * 2, 0, tickExtraWidth, tickExtraHeight)); - break; - } - default: { - OpenTaiko.Tx.Dani_Plate?.tUpdateOpacity(255); - OpenTaiko.Tx.Dani_Plate?.tUpdateColor4(CConversion.ColorToColor4(tickColor)); - OpenTaiko.Tx.Dani_Plate?.t2D拡大率考慮上中央基準描画(xPos, yPos, new Rectangle(tickWidth * tick, 0, tickWidth, tickHeight)); - break; - } - } - - // Reset color for plate flash - OpenTaiko.Tx.Dani_Plate?.tUpdateColor4(CConversion.ColorToColor4(Color.White)); - - #endregion - - #region [Dan grade title] - if (stバー情報[currentSong].eノード種別 == CSongListNode.ENodeType.SCORE) - TitleTextureKey.ResolveTitleTextureTate(stバー情報[currentSong].ttkタイトル[stバー情報[currentSong].ttkタイトル.Length - 1]) - .t2D拡大率考慮上中央基準描画(xPos + OpenTaiko.Skin.DaniSelect_Plate_Title_Offset[0], yPos + OpenTaiko.Skin.DaniSelect_Plate_Title_Offset[1]); - - #endregion - - - #region [Plate flash] - - if (idx == 0) { - OpenTaiko.Tx.Dani_Plate?.tUpdateOpacity(Math.Abs(255 - ctDanTick.CurrentValue)); - OpenTaiko.Tx.Dani_Plate?.t2D拡大率考慮上中央基準描画(xPos, yPos, new Rectangle(tickWidth * 6, 0, tickWidth, tickHeight)); - } - - #endregion - - #region [Goukaku plate] - - int currentRank = Math.Min(stバー情報[currentSong].clearGrade, 8) - 3; - - if (currentRank >= 0) { - OpenTaiko.Tx.DanResult_Rank.vcScaleRatio.X = 0.20f; - OpenTaiko.Tx.DanResult_Rank.vcScaleRatio.Y = 0.20f; - int rank_width = OpenTaiko.Tx.DanResult_Rank.szTextureSize.Width / 7; - int rank_height = OpenTaiko.Tx.DanResult_Rank.szTextureSize.Height; - OpenTaiko.Tx.DanResult_Rank.t2D拡大率考慮上中央基準描画(xPos - 2, yPos - 14, new Rectangle(rank_width * (currentRank + 1), 0, rank_width, rank_height)); - } - - #endregion - } - - #endregion - - return 0; - } - - #region [private] - - private CCounter ctExamConditionsAnim; - - private bool DaniInAnime; - public CCounter ctDaniIn; - - private CCounter ctDanAnimeIn; - - private CCounter ctDanTick; - - private CCounter ctDaniMoveAnime; - public int n現在の選択行; - - private bool bLeftMove; - - private CCachedFontRenderer pfDanFolder, pfDanFolderDesc, pfDanSong, pfExamFont; - public TitleTextureKey[] ttkExams; - - private CStage選曲.STNumber[] stLevel = new CStage選曲.STNumber[10]; - private CStage選曲.STNumber[] stSoulNumber = new CStage選曲.STNumber[10]; - private CStage選曲.STNumber[] stExamNumber = new CStage選曲.STNumber[10]; - - public List listSongs; - public STバー情報[] stバー情報; - - public struct STバー情報 { - public TitleTextureKey[] ttkタイトル; - public int[] n曲難易度; - public int[] n曲レベル; - public CSongListNode.ENodeType eノード種別; - public List List_DanSongs; - public CTexture txBarCenter; - public CTexture txDanPlate; - - // Extra parameters - public int clearGrade; - public int nDanTick; - public Color cDanTickColor; - } - - public CSongListNode currentBar { - get { - return listSongs[n現在の選択行]; - } - } - - static CCachedFontRenderer pfDanPlateTitle = null; - static CCachedFontRenderer pfDanIconTitle = null; - - private Dictionary BarTexCache = new Dictionary(); - - public static void RefleshSkin() { - OpenTaiko.tDisposeSafely(ref pfDanPlateTitle); - OpenTaiko.tDisposeSafely(ref pfDanIconTitle); - } - - public static void tDisplayDanPlate(CTexture givenPlate, STバー情報? songNode, int x, int y) { - if (givenPlate != null) { - givenPlate.Opacity = 255; - givenPlate.t2D中心基準描画(x, y); - } else { - // Default Dan Plate - - int danTick = 0; - Color danTickColor = Color.White; - - if (OpenTaiko.stageSongSelect.r確定されたスコア != null) { - danTick = OpenTaiko.stageSongSelect.r確定されたスコア.譜面情報.nDanTick; - danTickColor = OpenTaiko.stageSongSelect.r確定されたスコア.譜面情報.cDanTickColor; - } - if (songNode != null) { - STバー情報 stNode = (STバー情報)songNode; - - danTick = stNode.nDanTick; - danTickColor = stNode.cDanTickColor; - } - - - int unit = OpenTaiko.Tx.Dani_DanPlates.szTextureSize.Width / 6; - - if (OpenTaiko.Tx.Dani_DanPlates != null) { - OpenTaiko.Tx.Dani_DanPlates.Opacity = 255; - OpenTaiko.Tx.Dani_DanPlates.color4 = CConversion.ColorToColor4(danTickColor); - } - OpenTaiko.Tx.Dani_DanPlates_Back?.t2D中心基準描画(x, y, new Rectangle( - unit * danTick, - 0, - unit, - OpenTaiko.Tx.Dani_DanPlates_Back.szTextureSize.Height - )); - OpenTaiko.Tx.Dani_DanPlates?.t2D中心基準描画(x, y, new Rectangle( - unit * danTick, - 0, - unit, - OpenTaiko.Tx.Dani_DanPlates.szTextureSize.Height - )); - - if (pfDanPlateTitle == null) - pfDanPlateTitle = HPrivateFastFont.tInstantiateMainFont(OpenTaiko.Skin.DaniSelect_DanPlateTitle_Size); - - string titleTmp = ""; - - if (OpenTaiko.stageSongSelect.r確定されたスコア != null) - titleTmp = OpenTaiko.stageSongSelect.rChoosenSong.ldTitle.GetString(""); - if (songNode != null) { - STバー情報 stNode = (STバー情報)songNode; - - titleTmp = stNode.ttkタイトル[stNode.ttkタイトル.Length - 1].str; - } - - TitleTextureKey ttkTmp = new TitleTextureKey(titleTmp.TrimStringWithTags(2), pfDanPlateTitle, Color.White, Color.Black, 1000); - TitleTextureKey.ResolveTitleTextureTate(ttkTmp).t2D中心基準描画(x + OpenTaiko.Skin.DaniSelect_DanPlateTitle_Offset[0], y + OpenTaiko.Skin.DaniSelect_DanPlateTitle_Offset[1]); - } - } - - public static void tDisplayDanIcon(int count, float x, float y, int opacity, float scale, bool showFade = false) { - if (pfDanIconTitle == null) - pfDanIconTitle = HPrivateFastFont.tInstantiateMainFont(OpenTaiko.Skin.DaniSelect_DanIconTitle_Size); - - string ex = "th"; - switch (count) { - case 1: - ex = "st"; - break; - case 2: - ex = "nd"; - break; - case 3: - ex = "rd"; - break; - } - - TitleTextureKey ttkTmp = new TitleTextureKey(count.ToString() + ex, pfDanIconTitle, Color.White, Color.Black, 1000); - - if (showFade) { - OpenTaiko.Tx.Dani_DanIcon_Fade.vcScaleRatio = new Vector3D(scale, scale, 1.0f); - OpenTaiko.Tx.Dani_DanIcon_Fade.Opacity = opacity; - OpenTaiko.Tx.Dani_DanIcon_Fade.color4 = CConversion.ColorToColor4(OpenTaiko.Skin.DaniSelect_DanIcon_Color[Math.Min(count - 1, OpenTaiko.Skin.DaniSelect_DanIcon_Color.Length - 1)]); - OpenTaiko.Tx.Dani_DanIcon_Fade.t2D拡大率考慮描画(CTexture.RefPnt.Left, x - ((OpenTaiko.Tx.Dani_DanIcon.szTextureSize.Width / 2) * scale), y); - OpenTaiko.Tx.Dani_DanIcon_Fade.Opacity = 255; - } - - OpenTaiko.Tx.Dani_DanIcon.vcScaleRatio = new Vector3D(scale, scale, 1.0f); - OpenTaiko.Tx.Dani_DanIcon.Opacity = opacity; - OpenTaiko.Tx.Dani_DanIcon.color4 = CConversion.ColorToColor4(OpenTaiko.Skin.DaniSelect_DanIcon_Color[Math.Min(count - 1, OpenTaiko.Skin.DaniSelect_DanIcon_Color.Length - 1)]); - OpenTaiko.Tx.Dani_DanIcon.t2D拡大率考慮中央基準描画(x, y); - OpenTaiko.Tx.Dani_DanIcon.Opacity = 255; - - TitleTextureKey.ResolveTitleTexture(ttkTmp).vcScaleRatio = new Vector3D(scale, scale, 1.0f); - TitleTextureKey.ResolveTitleTexture(ttkTmp).Opacity = opacity; - TitleTextureKey.ResolveTitleTexture(ttkTmp).t2D拡大率考慮中央基準描画(x + OpenTaiko.Skin.DaniSelect_DanIconTitle_Offset[0], y + OpenTaiko.Skin.DaniSelect_DanIconTitle_Offset[1]); - TitleTextureKey.ResolveTitleTexture(ttkTmp).Opacity = 255; - } - - private void tDrawDanSelectedLevel(float Anime, int modifier = 0) { - int scroll = OpenTaiko.Skin.Resolution[0] * modifier; - int currentSong = Math.Clamp(n現在の選択行 + modifier, 0, stバー情報.Length - 1); - bool over4 = false; - - switch (stバー情報[currentSong].eノード種別) { - case CSongListNode.ENodeType.SCORE: { - #region [Center bar and Dan plate] - - int danTick = stバー情報[currentSong].nDanTick; - Color danTickColor = stバー情報[currentSong].cDanTickColor; - - // Use the given bar center if provided, else use a default one - if (stバー情報[currentSong].txBarCenter != null) { - stバー情報[currentSong].txBarCenter.t2D描画(scroll + Anime, 0); - } else { - int unit = OpenTaiko.Tx.Dani_DanSides.szTextureSize.Width / 6; - OpenTaiko.Tx.Dani_DanSides.color4 = CConversion.ColorToColor4(danTickColor); - - OpenTaiko.Tx.Dani_Bar_Center.t2D描画(scroll + Anime, 0); - - // Bar sides - OpenTaiko.Tx.Dani_DanSides.t2D描画((int)(scroll + Anime) + OpenTaiko.Skin.DaniSelect_DanSides_X[0], OpenTaiko.Skin.DaniSelect_DanSides_Y[0], new Rectangle( - unit * danTick, - 0, - unit, - OpenTaiko.Tx.Dani_DanSides.szTextureSize.Height - )); - - OpenTaiko.Tx.Dani_DanSides.t2D左右反転描画((int)(scroll + Anime) + OpenTaiko.Skin.DaniSelect_DanSides_X[1], OpenTaiko.Skin.DaniSelect_DanSides_Y[1], new Rectangle( - unit * danTick, - 0, - unit, - OpenTaiko.Tx.Dani_DanSides.szTextureSize.Height - )); - } - - CActSelect段位リスト.tDisplayDanPlate(stバー情報[currentSong].txDanPlate, stバー情報[currentSong], (int)(scroll + Anime) + OpenTaiko.Skin.DaniSelect_DanPlate[0], OpenTaiko.Skin.DaniSelect_DanPlate[1]); - - #endregion - - #region [Goukaku plate] - - int currentRank = Math.Min(stバー情報[currentSong].clearGrade, 8) - 3; - - if (currentRank >= 0) { - OpenTaiko.Tx.DanResult_Rank.vcScaleRatio.X = 0.8f; - OpenTaiko.Tx.DanResult_Rank.vcScaleRatio.Y = 0.8f; - - int rank_width = OpenTaiko.Tx.DanResult_Rank.szTextureSize.Width / 7; - int rank_height = OpenTaiko.Tx.DanResult_Rank.szTextureSize.Height; - - OpenTaiko.Tx.DanResult_Rank.t2D拡大率考慮中央基準描画(scroll + Anime + OpenTaiko.Skin.DaniSelect_Rank[0], OpenTaiko.Skin.DaniSelect_Rank[1], new Rectangle(rank_width * (currentRank + 1), 0, rank_width, rank_height)); - } - - #endregion - - #region [Soul gauge condition] - - OpenTaiko.Tx.Dani_Bloc[2]?.t2D描画(scroll + Anime + OpenTaiko.Skin.DaniSelect_Bloc2[0], OpenTaiko.Skin.DaniSelect_Bloc2[1]); - - if (stバー情報[currentSong].List_DanSongs[0].Dan_C[0] != null) - tSoulDraw(scroll + Anime + OpenTaiko.Skin.DaniSelect_Value_Gauge[0], OpenTaiko.Skin.DaniSelect_Value_Gauge[1], stバー情報[currentSong].List_DanSongs[0].Dan_C[0].Value[0]); - - //TJAPlayer3.stage選曲.act曲リスト.ResolveTitleTexture(this.ttkExams[0]).t2D下中央基準描画((int)(scroll + 396 + Anime), 452); - TitleTextureKey.ResolveTitleTexture(this.ttkExams[0]).t2D拡大率考慮中央基準描画((int)(scroll + Anime) + OpenTaiko.Skin.DaniSelect_Text_Gauge[0], OpenTaiko.Skin.DaniSelect_Text_Gauge[1]); - - #endregion - - #region [Song information] - - int getOpacity(int index, int sections = 2) { - int current_section = index / 3; - int animJauge = ctExamConditionsAnim.CurrentValue; - int split = 4000 / sections; - int begin = split * current_section; - int end = split * (current_section + 1); - if (animJauge < begin || animJauge > end) return 0; - - double sinus = Math.Abs(Math.Sin(animJauge * Math.PI / split)); - - if (sinus == 0) return 0; - return (int)(Math.Abs(Math.Pow(sinus, 1.2) / sinus) * 255); - - /* - int opacity = 255; - int half = index / 3; - - - - if (half == 0) - { - if (animJauge > 3745) - opacity = animJauge - 3745; - else if (animJauge > 1745) - opacity = 2000 - animJauge; - } - else - { - if (animJauge > 3745) - opacity = 4000 - animJauge; - else if (animJauge > 1745) - opacity = animJauge - 1745; - else - opacity = 0; - } - - return opacity; - */ - } - - int difficulty_cymbol_width = OpenTaiko.Tx.Dani_Difficulty_Cymbol.szTextureSize.Width / 5; - int difficulty_cymbol_height = OpenTaiko.Tx.Dani_Difficulty_Cymbol.szTextureSize.Height; - int sections_count = 1 + ((stバー情報[currentSong].n曲レベル.Length - 1) / 3); - - for (int i = 0; i < stバー情報[currentSong].ttkタイトル.Length - 1; i++) { - int pos = i % 3; - int opacity = 255; - if (stバー情報[currentSong].ttkタイトル.Length - 1 > 3) { - opacity = getOpacity(i, sections_count); - } - TitleTextureKey.ResolveTitleTexture(stバー情報[currentSong].ttkタイトル[i]).Opacity = opacity; - TitleTextureKey.ResolveTitleTexture(stバー情報[currentSong].ttkタイトル[i]).t2D描画(scroll + Anime + OpenTaiko.Skin.DaniSelect_Title_X[pos], OpenTaiko.Skin.DaniSelect_Title_Y[pos]); - TitleTextureKey.ResolveTitleTexture(stバー情報[currentSong].ttkタイトル[i]).Opacity = 255; - - tDisplayDanIcon(i + 1, scroll + Anime + OpenTaiko.Skin.DaniSelect_DanIcon_X[pos], OpenTaiko.Skin.DaniSelect_DanIcon_Y[pos], opacity, 1.0f); - } - - for (int i = 0; i < stバー情報[currentSong].n曲難易度.Length; i++) { - int pos = i % 3; - if (stバー情報[currentSong].n曲難易度.Length > 3) { - OpenTaiko.Tx.Dani_Difficulty_Cymbol.Opacity = getOpacity(i, sections_count); - } - OpenTaiko.Tx.Dani_Difficulty_Cymbol.t2D中心基準描画(scroll + Anime + OpenTaiko.Skin.DaniSelect_Difficulty_Cymbol_X[pos], OpenTaiko.Skin.DaniSelect_Difficulty_Cymbol_Y[pos], new Rectangle(stバー情報[currentSong].n曲難易度[i] * difficulty_cymbol_width, 0, difficulty_cymbol_width, difficulty_cymbol_height)); - OpenTaiko.Tx.Dani_Difficulty_Cymbol.Opacity = 255; - } - - for (int i = 0; i < stバー情報[currentSong].n曲レベル.Length; i++) { - int pos = i % 3; - if (stバー情報[currentSong].n曲レベル.Length > 3) { - OpenTaiko.Tx.Dani_Level_Number.Opacity = getOpacity(i, sections_count); - } - this.tLevelNumberDraw(scroll + Anime + OpenTaiko.Skin.DaniSelect_Level_Number_X[pos], OpenTaiko.Skin.DaniSelect_Level_Number_Y[pos], stバー情報[currentSong].n曲レベル[i]); - OpenTaiko.Tx.Dani_Level_Number.Opacity = 255; - } - - - #endregion - - #region [Check if one of the EXAM5,6,7 slots are used] - - for (int j = 4; j < CExamInfo.cMaxExam; j++) { - if (stバー情報[currentSong].List_DanSongs[0].Dan_C[j] != null) { - over4 = true; - break; - } - } - - #endregion - - #region [Display dan conditions] - - for (int j = 1; j < CExamInfo.cMaxExam; j++) //段位条件のループ(魂ゲージを除く) 縦(y) - { - // Inner index within the exam 3-set - int index = (j - 1) % 3; - - #region [Alter opacity if multi-screen exam display] - - int opacity = 255; - - if (over4 == true) { - int half = (j - 1) / 3; - - int animJauge = ctExamConditionsAnim.CurrentValue; - - if (half == 0) { - if (animJauge > 3745) - opacity = animJauge - 3745; - else if (animJauge > 1745) - opacity = 2000 - animJauge; - } else { - if (animJauge > 3745) - opacity = 4000 - animJauge; - else if (animJauge > 1745) - opacity = animJauge - 1745; - else - opacity = 0; - } - } - - #endregion - - #region [Exam value (individual included)] - - for (int i = 0; i < stバー情報[currentSong].List_DanSongs.Count; i++) //曲ごとのループ(魂ゲージを除く) 横(x) - { - if (stバー情報[currentSong].List_DanSongs[i].Dan_C[j] != null) { - OpenTaiko.Tx.Dani_Exam_Number.Opacity = opacity; - - if (stバー情報[currentSong].List_DanSongs[stバー情報[currentSong].List_DanSongs.Count - 1].Dan_C[j] != null) { - //個別の条件がありますよー - - int moveX = OpenTaiko.Skin.DaniSelect_Exam_Interval[0]; - int moveY = OpenTaiko.Skin.DaniSelect_Exam_Interval[1]; - int x = OpenTaiko.Skin.DaniSelect_Exam_Bloc_X[index]; - int y = OpenTaiko.Skin.DaniSelect_Exam_Bloc_Y[index]; - - int exam_x = OpenTaiko.Skin.DaniSelect_Exam_X[index]; - int exam_y = OpenTaiko.Skin.DaniSelect_Exam_Y[index]; - - CTexture tex = null; - switch (stバー情報[currentSong].List_DanSongs.Count) { - case 1: - tex = OpenTaiko.Tx.Dani_Bloc[0]; - break; - case 2: - case 3: - tex = OpenTaiko.Tx.Dani_Bloc[1]; - break; - case 4: - case 5: - case 6: - default: - tex = OpenTaiko.Tx.Dani_Bloc[3]; - moveX /= 2; - moveY /= 2; - exam_x = OpenTaiko.Skin.DaniSelect_Exam_X_Ex[index]; - exam_y = OpenTaiko.Skin.DaniSelect_Exam_Y_Ex[index]; - break; - } - - if (i == 0) { - if (tex != null) - tex.Opacity = opacity; - tex?.t2D描画( - scroll + Anime + x, - y); - } - - if (i < 6) - tExamDraw(scroll + Anime + exam_x + (i * moveX), - exam_y + (i * moveY), - stバー情報[currentSong].List_DanSongs[i].Dan_C[j].Value[0], stバー情報[currentSong].List_DanSongs[i].Dan_C[j].GetExamRange()); - } else { - //全体の条件ですよー - - if (i == 0) { - if (OpenTaiko.Tx.Dani_Bloc[0] != null) - OpenTaiko.Tx.Dani_Bloc[0].Opacity = opacity; - OpenTaiko.Tx.Dani_Bloc[0]?.t2D描画( - scroll + Anime + OpenTaiko.Skin.DaniSelect_Exam_Bloc_X[index], - OpenTaiko.Skin.DaniSelect_Exam_Bloc_Y[index]); - } - - tExamDraw(scroll + Anime + OpenTaiko.Skin.DaniSelect_Exam_X[index], OpenTaiko.Skin.DaniSelect_Exam_Y[index], stバー情報[currentSong].List_DanSongs[0].Dan_C[j].Value[0], stバー情報[currentSong].List_DanSongs[0].Dan_C[j].GetExamRange()); - - } - - OpenTaiko.Tx.Dani_Exam_Number.Opacity = 255; - } - } - - #endregion - - #region [Exam title] - - if (stバー情報[currentSong].List_DanSongs[0].Dan_C[j] != null) { - CTexture tmpTex = TitleTextureKey.ResolveTitleTexture(this.ttkExams[(int)stバー情報[currentSong].List_DanSongs[0].Dan_C[j].GetExamType()]); - - tmpTex.Opacity = opacity; - //tmpTex.t2D下中央基準描画((int)(scroll + 614 + Anime), 452 + index * 88); - - tmpTex.t2D拡大率考慮中央基準描画((int)(scroll + Anime) + OpenTaiko.Skin.DaniSelect_Exam_Title_X[index], OpenTaiko.Skin.DaniSelect_Exam_Title_Y[index]); - } - - #endregion - } - - #endregion - } - break; - case CSongListNode.ENodeType.BACKBOX: { - OpenTaiko.Tx.Dani_Bar_Back?.t2D描画(scroll + Anime, 0); - break; - } - case CSongListNode.ENodeType.BOX: { - OpenTaiko.Tx.Dani_Bar_Folder_Back?.t2D描画(scroll + Anime, 0); - OpenTaiko.Tx.Dani_Bar_Folder?.t2D描画(scroll + Anime, 0); - TitleTextureKey.ResolveTitleTexture(stバー情報[currentSong].ttkタイトル[0]) - .t2D拡大率考慮上中央基準描画((int)(scroll + Anime + OpenTaiko.Skin.DaniSelect_FolderText_X[0]), OpenTaiko.Skin.DaniSelect_FolderText_Y[0]); - for (int desc = 1; desc < 4; desc++) - TitleTextureKey.ResolveTitleTexture(stバー情報[currentSong].ttkタイトル[desc]) - .t2D拡大率考慮上中央基準描画((int)(scroll + Anime + OpenTaiko.Skin.DaniSelect_FolderText_X[desc]), OpenTaiko.Skin.DaniSelect_FolderText_Y[desc]); - break; - } - case CSongListNode.ENodeType.RANDOM: { - OpenTaiko.Tx.Dani_Bar_Random?.t2D描画(scroll + Anime, 0); - break; - } - } - } - - public void tOpenFolder(CSongListNode song) { - listSongs = song.list子リスト; - n現在の選択行 = 0; - tUpdateSongs(); - } - - public void tCloseFolder(CSongListNode song) { - listSongs = song.rParentNode.rParentNode.list子リスト; - n現在の選択行 = 0; - tUpdateSongs(); - } - - private void tUpdateSongs() { - stバー情報 = new STバー情報[listSongs.Count]; - this.tバーの初期化(); - } - - private void tバーの初期化() { - for (int i = 0; i < stバー情報.Length; i++) { - var song = listSongs[i]; - - stバー情報[i].eノード種別 = song.eノード種別; - switch (song.eノード種別) { - case CSongListNode.ENodeType.SCORE: { - stバー情報[i].ttkタイトル = new TitleTextureKey[listSongs[i].DanSongs.Count + 1]; - stバー情報[i].n曲難易度 = new int[listSongs[i].DanSongs.Count]; - stバー情報[i].n曲レベル = new int[listSongs[i].DanSongs.Count]; - for (int j = 0; j < listSongs[i].DanSongs.Count; j++) { - stバー情報[i].ttkタイトル[j] = new TitleTextureKey(song.DanSongs[j].bTitleShow ? "???" : song.DanSongs[j].Title, pfDanSong, Color.White, Color.Black, 700); - stバー情報[i].n曲難易度[j] = song.DanSongs[j].Difficulty; - stバー情報[i].n曲レベル[j] = song.DanSongs[j].Level; - stバー情報[i].List_DanSongs = song.DanSongs; - } - - // Two char header, will be used for grade unlocking too - string tmp = song.ldTitle.GetString("").TrimStringWithTags(2); - - stバー情報[i].ttkタイトル[listSongs[i].DanSongs.Count] = new TitleTextureKey(tmp, pfDanSong, Color.Black, Color.Transparent, 700); - - stバー情報[i].nDanTick = song.arスコア[6].譜面情報.nDanTick; - stバー情報[i].cDanTickColor = song.arスコア[6].譜面情報.cDanTickColor; - - //stバー情報[i].clearGrade = song.arスコア[6].譜面情報.nクリア[0]; - var TableEntry = OpenTaiko.SaveFileInstances[OpenTaiko.SaveFile].data.tGetSongSelectTableEntry(song.tGetUniqueId()); - stバー情報[i].clearGrade = TableEntry.ClearStatuses[(int)Difficulty.Dan]; - - string barCenter = Path.GetDirectoryName(song.arスコア[6].ファイル情報.ファイルの絶対パス) + @$"${Path.DirectorySeparatorChar}Bar_Center.png"; - if (BarTexCache.TryGetValue(barCenter, out CTexture texture1)) { - stバー情報[i].txBarCenter = texture1; - } else { - stバー情報[i].txBarCenter = OpenTaiko.tテクスチャの生成(barCenter); - BarTexCache.Add(barCenter, stバー情報[i].txBarCenter); - } - - string danPlate = Path.GetDirectoryName(song.arスコア[6].ファイル情報.ファイルの絶対パス) + @$"${Path.DirectorySeparatorChar}Dan_Plate.png"; - if (BarTexCache.TryGetValue(danPlate, out CTexture texture2)) { - stバー情報[i].txDanPlate = texture2; - } else { - stバー情報[i].txDanPlate = OpenTaiko.tテクスチャの生成(danPlate); - BarTexCache.Add(danPlate, stバー情報[i].txDanPlate); - } - } - break; - case CSongListNode.ENodeType.BOX: { - OpenTaiko.Tx.Dani_Bar_Folder?.tUpdateColor4(CConversion.ColorToColor4(song.BoxColor)); - - stバー情報[i].ttkタイトル = new TitleTextureKey[4]; - stバー情報[i].ttkタイトル[0] = new TitleTextureKey(song.ldTitle.GetString(""), pfDanFolder, Color.White, Color.Black, OpenTaiko.Skin.Resolution[0]); - for (int boxdesc = 0; boxdesc < 3; boxdesc++) - if (song.strBoxText[boxdesc] != null) - stバー情報[i].ttkタイトル[boxdesc + 1] = new TitleTextureKey(song.strBoxText[boxdesc].GetString(""), pfDanFolderDesc, song.ForeColor, song.BackColor, OpenTaiko.Skin.Resolution[0]); - else - stバー情報[i].ttkタイトル[boxdesc + 1] = new TitleTextureKey("", pfDanFolderDesc, Color.White, Color.Black, OpenTaiko.Skin.Resolution[0]); - stバー情報[i].cDanTickColor = song.BoxColor; - } - break; - case CSongListNode.ENodeType.BACKBOX: { - stバー情報[i].ttkタイトル = new TitleTextureKey[1]; - stバー情報[i].ttkタイトル[0] = new TitleTextureKey(CLangManager.LangInstance.GetString("MENU_RETURN"), pfDanSong, Color.White, Color.Black, 700); - stバー情報[i].cDanTickColor = Color.FromArgb(180, 150, 70); - } - break; - case CSongListNode.ENodeType.RANDOM: { - stバー情報[i].ttkタイトル = new TitleTextureKey[1]; - stバー情報[i].ttkタイトル[0] = new TitleTextureKey(CLangManager.LangInstance.GetString("SONGSELECT_RANDOM"), pfDanSong, Color.White, Color.Black, 700); - stバー情報[i].cDanTickColor = Color.FromArgb(150, 250, 255); - } - break; - } - - } - } - - public void t右に移動() { - if (n現在の選択行 < stバー情報.Length - 1) { - OpenTaiko.Skin.soundChangeSFX.tPlay(); - this.bLeftMove = false; - this.ctDaniMoveAnime.Start(0, 90, 2f, OpenTaiko.Timer); - } - } - - public void t左に移動() { - if (n現在の選択行 > 0) { - OpenTaiko.Skin.soundChangeSFX.tPlay(); - this.bLeftMove = true; - this.ctDaniMoveAnime.Start(0, 90, 2f, OpenTaiko.Timer); - } - } - - public void tLevelNumberDraw(float x, float y, int num, float scale = 1.0f) { - /* - for (int j = 0; j < str.Length; j++) - { - for (int i = 0; i < 10; i++) - { - if (str[j] == stLevel[i].ch) - { - TJAPlayer3.Tx.Dani_Level_Number.t2D描画(x - (str.Length * 14 + 10 * str.Length - str.Length * 14) / 2 + 14 / 2, (float)y - 18 / 2, new RectangleF(stLevel[i].pt.X, stLevel[i].pt.Y, 14, 18)); - x += 10; - } - } - }*/ - - float width = OpenTaiko.Tx.Dani_Level_Number.sz画像サイズ.Width / 10.0f; - float height = OpenTaiko.Tx.Dani_Level_Number.sz画像サイズ.Height; - - int[] nums = CConversion.SeparateDigits(num); - for (int j = 0; j < nums.Length; j++) { - float offset = j; - - float _x = x - (((OpenTaiko.Skin.DaniSelect_Level_Number_Interval[0] * offset) + (width / 2)) * scale); - float _y = y - (((OpenTaiko.Skin.DaniSelect_Level_Number_Interval[1] * offset) - (width / 2)) * scale); - - OpenTaiko.Tx.Dani_Level_Number.vcScaleRatio.X = scale; - OpenTaiko.Tx.Dani_Level_Number.vcScaleRatio.Y = scale; - OpenTaiko.Tx.Dani_Level_Number.t2D描画(_x, _y, - new RectangleF(width * nums[j], 0, width, height)); - OpenTaiko.Tx.Dani_Level_Number.vcScaleRatio.X = 1; - OpenTaiko.Tx.Dani_Level_Number.vcScaleRatio.Y = 1; - } - } - - public void tSoulDraw(float x, float y, int num) { - /* - TJAPlayer3.Tx.Dani_Soul_Number.t2D描画(x + 16 * str.Length, y - 30 / 2, new RectangleF(0, 30, 80, 30)); - - for (int j = 0; j < str.Length; j++) - { - for (int i = 0; i < 10; i++) - { - if (str[j] == stSoulNumber[i].ch) - { - TJAPlayer3.Tx.Dani_Soul_Number.t2D描画(x - (str.Length * 23 + 18 * str.Length - str.Length * 23) / 2 + 23 / 2, (float)y - 30 / 2, new RectangleF(stSoulNumber[i].pt.X, stSoulNumber[i].pt.Y, 23, 30)); - x += 16; - } - } - }*/ - - int[] nums = CConversion.SeparateDigits(num); - - float width = OpenTaiko.Tx.Dani_Soul_Number.sz画像サイズ.Width / 10.0f; - float height = OpenTaiko.Tx.Dani_Soul_Number.sz画像サイズ.Height / 2.0f; - - float text_width = OpenTaiko.Skin.DaniSelect_Soul_Number_Text_Width; - - OpenTaiko.Tx.Dani_Soul_Number.t2D描画(x + OpenTaiko.Skin.DaniSelect_Soul_Number_Interval[0] + (width / 2), - y + OpenTaiko.Skin.DaniSelect_Soul_Number_Interval[1] - (height / 2), - new RectangleF(0, height, text_width, height)); - - for (int j = 0; j < nums.Length; j++) { - float offset = j; - - float _x = x - (OpenTaiko.Skin.DaniSelect_Soul_Number_Interval[0] * offset) + (width / 2); - float _y = y - (OpenTaiko.Skin.DaniSelect_Soul_Number_Interval[1] * offset) - (height / 2); - - OpenTaiko.Tx.Dani_Soul_Number.t2D描画(_x, _y, - new RectangleF(width * nums[j], 0, width, height)); - } - } - - public void tExamDraw(float x, float y, int num, Exam.Range Range, float scale = 1.0f) { - /* - TJAPlayer3.Tx.Dani_Exam_Number.t2D描画(x + 19 * str.Length, y - 24 / 2, new RectangleF(45 * (int)Range, 24, 45, 24)); - - for (int j = 0; j < str.Length; j++) - { - for (int i = 0; i < 10; i++) - { - if (str[j] == stExamNumber[i].ch) - { - TJAPlayer3.Tx.Dani_Exam_Number.t2D描画(x, (float)y - 24 / 2, new RectangleF(stExamNumber[i].pt.X, stExamNumber[i].pt.Y, 19, 24)); - x += 16; - } - } - } - */ - - - int[] nums = CConversion.SeparateDigits(num); - - float width = OpenTaiko.Tx.Dani_Exam_Number.sz画像サイズ.Width / 10.0f; - float height = OpenTaiko.Tx.Dani_Exam_Number.sz画像サイズ.Height / 2.0f; - - float text_width = OpenTaiko.Skin.DaniSelect_Exam_Number_Text_Width; - - OpenTaiko.Tx.Dani_Exam_Number.vcScaleRatio.X = scale; - OpenTaiko.Tx.Dani_Exam_Number.vcScaleRatio.Y = scale; - - OpenTaiko.Tx.Dani_Exam_Number.t2D描画( - x + ((OpenTaiko.Skin.DaniSelect_Exam_Number_Interval[0] + (width / 2)) * scale), - y + ((OpenTaiko.Skin.DaniSelect_Exam_Number_Interval[1] + (height / 2)) * scale), - new RectangleF(text_width * (int)Range, height, text_width, height)); - - for (int j = 0; j < nums.Length; j++) { - float offset = j; - - float _x = x - (((OpenTaiko.Skin.DaniSelect_Exam_Number_Interval[0] * offset) + (width / 2)) * scale); - float _y = y - (((OpenTaiko.Skin.DaniSelect_Exam_Number_Interval[1] * offset) - (height / 2)) * scale); - - OpenTaiko.Tx.Dani_Exam_Number.t2D描画(_x, _y, - new RectangleF(width * nums[j], 0, width, height)); - } + if (bLeftMove && n現在の選択行 - 1 >= 0) + tDrawDanSelectedLevel(Anime, -1); + if (!bLeftMove && n現在の選択行 + 1 <= stバー情報.Length - 1) + tDrawDanSelectedLevel(Anime, 1); } #endregion + #region [ バー移動 ] + + if (ctDaniMoveAnime.CurrentValue == 90) { + if (bLeftMove) { + this.n現在の選択行 -= n現在の選択行 - 1 >= 0 ? 1 : 0; + } else { + this.n現在の選択行 += n現在の選択行 + 1 < this.stバー情報.Length ? 1 : 0; + } + ctDaniMoveAnime.Stop(); + ctDaniMoveAnime.CurrentValue = 0; + } + + #endregion + + // To do : Display the 27 (max) bars one by one + if (ctDaniIn.CurrentValue < 5000) + return 0; + + #region [Upper plates] + + // stバー情報[n現在の選択行] + + int tickWidth = OpenTaiko.Tx.Dani_Plate.szTextureSize.Width / 7; + int tickHeight = OpenTaiko.Tx.Dani_Plate.szTextureSize.Height; + int tickExtraWidth = OpenTaiko.Tx.Dani_Plate_Extra.szTextureSize.Width / 3; + int tickExtraHeight = OpenTaiko.Tx.Dani_Plate_Extra.szTextureSize.Height; + + for (int idx = -13; idx < 14; idx++) { + + if (ctDaniIn.CurrentValue < 5000 + (idx + 13) * 33) + break; + + int currentSong = n現在の選択行 + idx; + + if (currentSong < 0) + continue; + if (currentSong >= stバー情報.Length) + break; + + int xPos = OpenTaiko.Skin.DaniSelect_Plate[0] + (idx == 0 ? OpenTaiko.Skin.DaniSelect_Plate_Center_Move[0] : 0) + idx * OpenTaiko.Skin.DaniSelect_Plate_Move[0]; + int yPos = OpenTaiko.Skin.DaniSelect_Plate[1] + (idx == 0 ? OpenTaiko.Skin.DaniSelect_Plate_Center_Move[1] : 0) + idx * OpenTaiko.Skin.DaniSelect_Plate_Move[1]; + + + + #region [Plate background] + + int tick = Math.Max(0, Math.Min(5, stバー情報[currentSong].nDanTick)); + Color tickColor = stバー情報[currentSong].cDanTickColor; + + switch (stバー情報[currentSong].eノード種別) { + case CSongListNode.ENodeType.BACKBOX: { + OpenTaiko.Tx.Dani_Plate_Extra?.tUpdateOpacity(255); + OpenTaiko.Tx.Dani_Plate_Extra?.tUpdateColor4(CConversion.ColorToColor4(tickColor)); + OpenTaiko.Tx.Dani_Plate_Extra?.t2D拡大率考慮上中央基準描画(xPos, yPos, new Rectangle(0, 0, tickExtraWidth, tickExtraHeight)); + break; + } + case CSongListNode.ENodeType.BOX: { + OpenTaiko.Tx.Dani_Plate_Extra?.tUpdateOpacity(255); + OpenTaiko.Tx.Dani_Plate_Extra?.tUpdateColor4(CConversion.ColorToColor4(tickColor)); + OpenTaiko.Tx.Dani_Plate_Extra?.t2D拡大率考慮上中央基準描画(xPos, yPos, new Rectangle(tickExtraWidth, 0, tickExtraWidth, tickExtraHeight)); + break; + } + case CSongListNode.ENodeType.RANDOM: { + OpenTaiko.Tx.Dani_Plate_Extra?.tUpdateOpacity(255); + OpenTaiko.Tx.Dani_Plate_Extra?.tUpdateColor4(CConversion.ColorToColor4(tickColor)); + OpenTaiko.Tx.Dani_Plate_Extra?.t2D拡大率考慮上中央基準描画(xPos, yPos, new Rectangle(tickExtraWidth * 2, 0, tickExtraWidth, tickExtraHeight)); + break; + } + default: { + OpenTaiko.Tx.Dani_Plate?.tUpdateOpacity(255); + OpenTaiko.Tx.Dani_Plate?.tUpdateColor4(CConversion.ColorToColor4(tickColor)); + OpenTaiko.Tx.Dani_Plate?.t2D拡大率考慮上中央基準描画(xPos, yPos, new Rectangle(tickWidth * tick, 0, tickWidth, tickHeight)); + break; + } + } + + // Reset color for plate flash + OpenTaiko.Tx.Dani_Plate?.tUpdateColor4(CConversion.ColorToColor4(Color.White)); + + #endregion + + #region [Dan grade title] + if (stバー情報[currentSong].eノード種別 == CSongListNode.ENodeType.SCORE) + TitleTextureKey.ResolveTitleTextureTate(stバー情報[currentSong].ttkタイトル[stバー情報[currentSong].ttkタイトル.Length - 1]) + .t2D拡大率考慮上中央基準描画(xPos + OpenTaiko.Skin.DaniSelect_Plate_Title_Offset[0], yPos + OpenTaiko.Skin.DaniSelect_Plate_Title_Offset[1]); + + #endregion + + + #region [Plate flash] + + if (idx == 0) { + OpenTaiko.Tx.Dani_Plate?.tUpdateOpacity(Math.Abs(255 - ctDanTick.CurrentValue)); + OpenTaiko.Tx.Dani_Plate?.t2D拡大率考慮上中央基準描画(xPos, yPos, new Rectangle(tickWidth * 6, 0, tickWidth, tickHeight)); + } + + #endregion + + #region [Goukaku plate] + + int currentRank = Math.Min(stバー情報[currentSong].clearGrade, 8) - 3; + + if (currentRank >= 0) { + OpenTaiko.Tx.DanResult_Rank.vcScaleRatio.X = 0.20f; + OpenTaiko.Tx.DanResult_Rank.vcScaleRatio.Y = 0.20f; + int rank_width = OpenTaiko.Tx.DanResult_Rank.szTextureSize.Width / 7; + int rank_height = OpenTaiko.Tx.DanResult_Rank.szTextureSize.Height; + OpenTaiko.Tx.DanResult_Rank.t2D拡大率考慮上中央基準描画(xPos - 2, yPos - 14, new Rectangle(rank_width * (currentRank + 1), 0, rank_width, rank_height)); + } + + #endregion + } + + #endregion + + return 0; } + #region [private] + + private CCounter ctExamConditionsAnim; + + private bool DaniInAnime; + public CCounter ctDaniIn; + + private CCounter ctDanAnimeIn; + + private CCounter ctDanTick; + + private CCounter ctDaniMoveAnime; + public int n現在の選択行; + + private bool bLeftMove; + + private CCachedFontRenderer pfDanFolder, pfDanFolderDesc, pfDanSong, pfExamFont; + public TitleTextureKey[] ttkExams; + + private CStage選曲.STNumber[] stLevel = new CStage選曲.STNumber[10]; + private CStage選曲.STNumber[] stSoulNumber = new CStage選曲.STNumber[10]; + private CStage選曲.STNumber[] stExamNumber = new CStage選曲.STNumber[10]; + + public List listSongs; + public STバー情報[] stバー情報; + + public struct STバー情報 { + public TitleTextureKey[] ttkタイトル; + public int[] n曲難易度; + public int[] n曲レベル; + public CSongListNode.ENodeType eノード種別; + public List List_DanSongs; + public CTexture txBarCenter; + public CTexture txDanPlate; + + // Extra parameters + public int clearGrade; + public int nDanTick; + public Color cDanTickColor; + } + + public CSongListNode currentBar { + get { + return listSongs[n現在の選択行]; + } + } + + static CCachedFontRenderer pfDanPlateTitle = null; + static CCachedFontRenderer pfDanIconTitle = null; + + private Dictionary BarTexCache = new Dictionary(); + + public static void RefleshSkin() { + OpenTaiko.tDisposeSafely(ref pfDanPlateTitle); + OpenTaiko.tDisposeSafely(ref pfDanIconTitle); + } + + public static void tDisplayDanPlate(CTexture givenPlate, STバー情報? songNode, int x, int y) { + if (givenPlate != null) { + givenPlate.Opacity = 255; + givenPlate.t2D中心基準描画(x, y); + } else { + // Default Dan Plate + + int danTick = 0; + Color danTickColor = Color.White; + + if (OpenTaiko.stageSongSelect.r確定されたスコア != null) { + danTick = OpenTaiko.stageSongSelect.r確定されたスコア.譜面情報.nDanTick; + danTickColor = OpenTaiko.stageSongSelect.r確定されたスコア.譜面情報.cDanTickColor; + } + if (songNode != null) { + STバー情報 stNode = (STバー情報)songNode; + + danTick = stNode.nDanTick; + danTickColor = stNode.cDanTickColor; + } + + + int unit = OpenTaiko.Tx.Dani_DanPlates.szTextureSize.Width / 6; + + if (OpenTaiko.Tx.Dani_DanPlates != null) { + OpenTaiko.Tx.Dani_DanPlates.Opacity = 255; + OpenTaiko.Tx.Dani_DanPlates.color4 = CConversion.ColorToColor4(danTickColor); + } + OpenTaiko.Tx.Dani_DanPlates_Back?.t2D中心基準描画(x, y, new Rectangle( + unit * danTick, + 0, + unit, + OpenTaiko.Tx.Dani_DanPlates_Back.szTextureSize.Height + )); + OpenTaiko.Tx.Dani_DanPlates?.t2D中心基準描画(x, y, new Rectangle( + unit * danTick, + 0, + unit, + OpenTaiko.Tx.Dani_DanPlates.szTextureSize.Height + )); + + if (pfDanPlateTitle == null) + pfDanPlateTitle = HPrivateFastFont.tInstantiateMainFont(OpenTaiko.Skin.DaniSelect_DanPlateTitle_Size); + + string titleTmp = ""; + + if (OpenTaiko.stageSongSelect.r確定されたスコア != null) + titleTmp = OpenTaiko.stageSongSelect.rChoosenSong.ldTitle.GetString(""); + if (songNode != null) { + STバー情報 stNode = (STバー情報)songNode; + + titleTmp = stNode.ttkタイトル[stNode.ttkタイトル.Length - 1].str; + } + + TitleTextureKey ttkTmp = new TitleTextureKey(titleTmp.TrimStringWithTags(2), pfDanPlateTitle, Color.White, Color.Black, 1000); + TitleTextureKey.ResolveTitleTextureTate(ttkTmp).t2D中心基準描画(x + OpenTaiko.Skin.DaniSelect_DanPlateTitle_Offset[0], y + OpenTaiko.Skin.DaniSelect_DanPlateTitle_Offset[1]); + } + } + + public static void tDisplayDanIcon(int count, float x, float y, int opacity, float scale, bool showFade = false) { + if (pfDanIconTitle == null) + pfDanIconTitle = HPrivateFastFont.tInstantiateMainFont(OpenTaiko.Skin.DaniSelect_DanIconTitle_Size); + + string ex = "th"; + switch (count) { + case 1: + ex = "st"; + break; + case 2: + ex = "nd"; + break; + case 3: + ex = "rd"; + break; + } + + TitleTextureKey ttkTmp = new TitleTextureKey(count.ToString() + ex, pfDanIconTitle, Color.White, Color.Black, 1000); + + if (showFade) { + OpenTaiko.Tx.Dani_DanIcon_Fade.vcScaleRatio = new Vector3D(scale, scale, 1.0f); + OpenTaiko.Tx.Dani_DanIcon_Fade.Opacity = opacity; + OpenTaiko.Tx.Dani_DanIcon_Fade.color4 = CConversion.ColorToColor4(OpenTaiko.Skin.DaniSelect_DanIcon_Color[Math.Min(count - 1, OpenTaiko.Skin.DaniSelect_DanIcon_Color.Length - 1)]); + OpenTaiko.Tx.Dani_DanIcon_Fade.t2D拡大率考慮描画(CTexture.RefPnt.Left, x - ((OpenTaiko.Tx.Dani_DanIcon.szTextureSize.Width / 2) * scale), y); + OpenTaiko.Tx.Dani_DanIcon_Fade.Opacity = 255; + } + + OpenTaiko.Tx.Dani_DanIcon.vcScaleRatio = new Vector3D(scale, scale, 1.0f); + OpenTaiko.Tx.Dani_DanIcon.Opacity = opacity; + OpenTaiko.Tx.Dani_DanIcon.color4 = CConversion.ColorToColor4(OpenTaiko.Skin.DaniSelect_DanIcon_Color[Math.Min(count - 1, OpenTaiko.Skin.DaniSelect_DanIcon_Color.Length - 1)]); + OpenTaiko.Tx.Dani_DanIcon.t2D拡大率考慮中央基準描画(x, y); + OpenTaiko.Tx.Dani_DanIcon.Opacity = 255; + + TitleTextureKey.ResolveTitleTexture(ttkTmp).vcScaleRatio = new Vector3D(scale, scale, 1.0f); + TitleTextureKey.ResolveTitleTexture(ttkTmp).Opacity = opacity; + TitleTextureKey.ResolveTitleTexture(ttkTmp).t2D拡大率考慮中央基準描画(x + OpenTaiko.Skin.DaniSelect_DanIconTitle_Offset[0], y + OpenTaiko.Skin.DaniSelect_DanIconTitle_Offset[1]); + TitleTextureKey.ResolveTitleTexture(ttkTmp).Opacity = 255; + } + + private void tDrawDanSelectedLevel(float Anime, int modifier = 0) { + int scroll = OpenTaiko.Skin.Resolution[0] * modifier; + int currentSong = Math.Clamp(n現在の選択行 + modifier, 0, stバー情報.Length - 1); + bool over4 = false; + + switch (stバー情報[currentSong].eノード種別) { + case CSongListNode.ENodeType.SCORE: { + #region [Center bar and Dan plate] + + int danTick = stバー情報[currentSong].nDanTick; + Color danTickColor = stバー情報[currentSong].cDanTickColor; + + // Use the given bar center if provided, else use a default one + if (stバー情報[currentSong].txBarCenter != null) { + stバー情報[currentSong].txBarCenter.t2D描画(scroll + Anime, 0); + } else { + int unit = OpenTaiko.Tx.Dani_DanSides.szTextureSize.Width / 6; + OpenTaiko.Tx.Dani_DanSides.color4 = CConversion.ColorToColor4(danTickColor); + + OpenTaiko.Tx.Dani_Bar_Center.t2D描画(scroll + Anime, 0); + + // Bar sides + OpenTaiko.Tx.Dani_DanSides.t2D描画((int)(scroll + Anime) + OpenTaiko.Skin.DaniSelect_DanSides_X[0], OpenTaiko.Skin.DaniSelect_DanSides_Y[0], new Rectangle( + unit * danTick, + 0, + unit, + OpenTaiko.Tx.Dani_DanSides.szTextureSize.Height + )); + + OpenTaiko.Tx.Dani_DanSides.t2D左右反転描画((int)(scroll + Anime) + OpenTaiko.Skin.DaniSelect_DanSides_X[1], OpenTaiko.Skin.DaniSelect_DanSides_Y[1], new Rectangle( + unit * danTick, + 0, + unit, + OpenTaiko.Tx.Dani_DanSides.szTextureSize.Height + )); + } + + CActSelect段位リスト.tDisplayDanPlate(stバー情報[currentSong].txDanPlate, stバー情報[currentSong], (int)(scroll + Anime) + OpenTaiko.Skin.DaniSelect_DanPlate[0], OpenTaiko.Skin.DaniSelect_DanPlate[1]); + + #endregion + + #region [Goukaku plate] + + int currentRank = Math.Min(stバー情報[currentSong].clearGrade, 8) - 3; + + if (currentRank >= 0) { + OpenTaiko.Tx.DanResult_Rank.vcScaleRatio.X = 0.8f; + OpenTaiko.Tx.DanResult_Rank.vcScaleRatio.Y = 0.8f; + + int rank_width = OpenTaiko.Tx.DanResult_Rank.szTextureSize.Width / 7; + int rank_height = OpenTaiko.Tx.DanResult_Rank.szTextureSize.Height; + + OpenTaiko.Tx.DanResult_Rank.t2D拡大率考慮中央基準描画(scroll + Anime + OpenTaiko.Skin.DaniSelect_Rank[0], OpenTaiko.Skin.DaniSelect_Rank[1], new Rectangle(rank_width * (currentRank + 1), 0, rank_width, rank_height)); + } + + #endregion + + #region [Soul gauge condition] + + OpenTaiko.Tx.Dani_Bloc[2]?.t2D描画(scroll + Anime + OpenTaiko.Skin.DaniSelect_Bloc2[0], OpenTaiko.Skin.DaniSelect_Bloc2[1]); + + if (stバー情報[currentSong].List_DanSongs[0].Dan_C[0] != null) + tSoulDraw(scroll + Anime + OpenTaiko.Skin.DaniSelect_Value_Gauge[0], OpenTaiko.Skin.DaniSelect_Value_Gauge[1], stバー情報[currentSong].List_DanSongs[0].Dan_C[0].Value[0]); + + //TJAPlayer3.stage選曲.act曲リスト.ResolveTitleTexture(this.ttkExams[0]).t2D下中央基準描画((int)(scroll + 396 + Anime), 452); + TitleTextureKey.ResolveTitleTexture(this.ttkExams[0]).t2D拡大率考慮中央基準描画((int)(scroll + Anime) + OpenTaiko.Skin.DaniSelect_Text_Gauge[0], OpenTaiko.Skin.DaniSelect_Text_Gauge[1]); + + #endregion + + #region [Song information] + + int getOpacity(int index, int sections = 2) { + int current_section = index / 3; + int animJauge = ctExamConditionsAnim.CurrentValue; + int split = 4000 / sections; + int begin = split * current_section; + int end = split * (current_section + 1); + if (animJauge < begin || animJauge > end) return 0; + + double sinus = Math.Abs(Math.Sin(animJauge * Math.PI / split)); + + if (sinus == 0) return 0; + return (int)(Math.Abs(Math.Pow(sinus, 1.2) / sinus) * 255); + + /* + int opacity = 255; + int half = index / 3; + + + + if (half == 0) + { + if (animJauge > 3745) + opacity = animJauge - 3745; + else if (animJauge > 1745) + opacity = 2000 - animJauge; + } + else + { + if (animJauge > 3745) + opacity = 4000 - animJauge; + else if (animJauge > 1745) + opacity = animJauge - 1745; + else + opacity = 0; + } + + return opacity; + */ + } + + int difficulty_cymbol_width = OpenTaiko.Tx.Dani_Difficulty_Cymbol.szTextureSize.Width / 5; + int difficulty_cymbol_height = OpenTaiko.Tx.Dani_Difficulty_Cymbol.szTextureSize.Height; + int sections_count = 1 + ((stバー情報[currentSong].n曲レベル.Length - 1) / 3); + + for (int i = 0; i < stバー情報[currentSong].ttkタイトル.Length - 1; i++) { + int pos = i % 3; + int opacity = 255; + if (stバー情報[currentSong].ttkタイトル.Length - 1 > 3) { + opacity = getOpacity(i, sections_count); + } + TitleTextureKey.ResolveTitleTexture(stバー情報[currentSong].ttkタイトル[i]).Opacity = opacity; + TitleTextureKey.ResolveTitleTexture(stバー情報[currentSong].ttkタイトル[i]).t2D描画(scroll + Anime + OpenTaiko.Skin.DaniSelect_Title_X[pos], OpenTaiko.Skin.DaniSelect_Title_Y[pos]); + TitleTextureKey.ResolveTitleTexture(stバー情報[currentSong].ttkタイトル[i]).Opacity = 255; + + tDisplayDanIcon(i + 1, scroll + Anime + OpenTaiko.Skin.DaniSelect_DanIcon_X[pos], OpenTaiko.Skin.DaniSelect_DanIcon_Y[pos], opacity, 1.0f); + } + + for (int i = 0; i < stバー情報[currentSong].n曲難易度.Length; i++) { + int pos = i % 3; + if (stバー情報[currentSong].n曲難易度.Length > 3) { + OpenTaiko.Tx.Dani_Difficulty_Cymbol.Opacity = getOpacity(i, sections_count); + } + OpenTaiko.Tx.Dani_Difficulty_Cymbol.t2D中心基準描画(scroll + Anime + OpenTaiko.Skin.DaniSelect_Difficulty_Cymbol_X[pos], OpenTaiko.Skin.DaniSelect_Difficulty_Cymbol_Y[pos], new Rectangle(stバー情報[currentSong].n曲難易度[i] * difficulty_cymbol_width, 0, difficulty_cymbol_width, difficulty_cymbol_height)); + OpenTaiko.Tx.Dani_Difficulty_Cymbol.Opacity = 255; + } + + for (int i = 0; i < stバー情報[currentSong].n曲レベル.Length; i++) { + int pos = i % 3; + if (stバー情報[currentSong].n曲レベル.Length > 3) { + OpenTaiko.Tx.Dani_Level_Number.Opacity = getOpacity(i, sections_count); + } + this.tLevelNumberDraw(scroll + Anime + OpenTaiko.Skin.DaniSelect_Level_Number_X[pos], OpenTaiko.Skin.DaniSelect_Level_Number_Y[pos], stバー情報[currentSong].n曲レベル[i]); + OpenTaiko.Tx.Dani_Level_Number.Opacity = 255; + } + + + #endregion + + #region [Check if one of the EXAM5,6,7 slots are used] + + for (int j = 4; j < CExamInfo.cMaxExam; j++) { + if (stバー情報[currentSong].List_DanSongs[0].Dan_C[j] != null) { + over4 = true; + break; + } + } + + #endregion + + #region [Display dan conditions] + + for (int j = 1; j < CExamInfo.cMaxExam; j++) //段位条件のループ(魂ゲージを除く) 縦(y) + { + // Inner index within the exam 3-set + int index = (j - 1) % 3; + + #region [Alter opacity if multi-screen exam display] + + int opacity = 255; + + if (over4 == true) { + int half = (j - 1) / 3; + + int animJauge = ctExamConditionsAnim.CurrentValue; + + if (half == 0) { + if (animJauge > 3745) + opacity = animJauge - 3745; + else if (animJauge > 1745) + opacity = 2000 - animJauge; + } else { + if (animJauge > 3745) + opacity = 4000 - animJauge; + else if (animJauge > 1745) + opacity = animJauge - 1745; + else + opacity = 0; + } + } + + #endregion + + #region [Exam value (individual included)] + + for (int i = 0; i < stバー情報[currentSong].List_DanSongs.Count; i++) //曲ごとのループ(魂ゲージを除く) 横(x) + { + if (stバー情報[currentSong].List_DanSongs[i].Dan_C[j] != null) { + OpenTaiko.Tx.Dani_Exam_Number.Opacity = opacity; + + if (stバー情報[currentSong].List_DanSongs[stバー情報[currentSong].List_DanSongs.Count - 1].Dan_C[j] != null) { + //個別の条件がありますよー + + int moveX = OpenTaiko.Skin.DaniSelect_Exam_Interval[0]; + int moveY = OpenTaiko.Skin.DaniSelect_Exam_Interval[1]; + int x = OpenTaiko.Skin.DaniSelect_Exam_Bloc_X[index]; + int y = OpenTaiko.Skin.DaniSelect_Exam_Bloc_Y[index]; + + int exam_x = OpenTaiko.Skin.DaniSelect_Exam_X[index]; + int exam_y = OpenTaiko.Skin.DaniSelect_Exam_Y[index]; + + CTexture tex = null; + switch (stバー情報[currentSong].List_DanSongs.Count) { + case 1: + tex = OpenTaiko.Tx.Dani_Bloc[0]; + break; + case 2: + case 3: + tex = OpenTaiko.Tx.Dani_Bloc[1]; + break; + case 4: + case 5: + case 6: + default: + tex = OpenTaiko.Tx.Dani_Bloc[3]; + moveX /= 2; + moveY /= 2; + exam_x = OpenTaiko.Skin.DaniSelect_Exam_X_Ex[index]; + exam_y = OpenTaiko.Skin.DaniSelect_Exam_Y_Ex[index]; + break; + } + + if (i == 0) { + if (tex != null) + tex.Opacity = opacity; + tex?.t2D描画( + scroll + Anime + x, + y); + } + + if (i < 6) + tExamDraw(scroll + Anime + exam_x + (i * moveX), + exam_y + (i * moveY), + stバー情報[currentSong].List_DanSongs[i].Dan_C[j].Value[0], stバー情報[currentSong].List_DanSongs[i].Dan_C[j].GetExamRange()); + } else { + //全体の条件ですよー + + if (i == 0) { + if (OpenTaiko.Tx.Dani_Bloc[0] != null) + OpenTaiko.Tx.Dani_Bloc[0].Opacity = opacity; + OpenTaiko.Tx.Dani_Bloc[0]?.t2D描画( + scroll + Anime + OpenTaiko.Skin.DaniSelect_Exam_Bloc_X[index], + OpenTaiko.Skin.DaniSelect_Exam_Bloc_Y[index]); + } + + tExamDraw(scroll + Anime + OpenTaiko.Skin.DaniSelect_Exam_X[index], OpenTaiko.Skin.DaniSelect_Exam_Y[index], stバー情報[currentSong].List_DanSongs[0].Dan_C[j].Value[0], stバー情報[currentSong].List_DanSongs[0].Dan_C[j].GetExamRange()); + + } + + OpenTaiko.Tx.Dani_Exam_Number.Opacity = 255; + } + } + + #endregion + + #region [Exam title] + + if (stバー情報[currentSong].List_DanSongs[0].Dan_C[j] != null) { + CTexture tmpTex = TitleTextureKey.ResolveTitleTexture(this.ttkExams[(int)stバー情報[currentSong].List_DanSongs[0].Dan_C[j].GetExamType()]); + + tmpTex.Opacity = opacity; + //tmpTex.t2D下中央基準描画((int)(scroll + 614 + Anime), 452 + index * 88); + + tmpTex.t2D拡大率考慮中央基準描画((int)(scroll + Anime) + OpenTaiko.Skin.DaniSelect_Exam_Title_X[index], OpenTaiko.Skin.DaniSelect_Exam_Title_Y[index]); + } + + #endregion + } + + #endregion + } + break; + case CSongListNode.ENodeType.BACKBOX: { + OpenTaiko.Tx.Dani_Bar_Back?.t2D描画(scroll + Anime, 0); + break; + } + case CSongListNode.ENodeType.BOX: { + OpenTaiko.Tx.Dani_Bar_Folder_Back?.t2D描画(scroll + Anime, 0); + OpenTaiko.Tx.Dani_Bar_Folder?.t2D描画(scroll + Anime, 0); + TitleTextureKey.ResolveTitleTexture(stバー情報[currentSong].ttkタイトル[0]) + .t2D拡大率考慮上中央基準描画((int)(scroll + Anime + OpenTaiko.Skin.DaniSelect_FolderText_X[0]), OpenTaiko.Skin.DaniSelect_FolderText_Y[0]); + for (int desc = 1; desc < 4; desc++) + TitleTextureKey.ResolveTitleTexture(stバー情報[currentSong].ttkタイトル[desc]) + .t2D拡大率考慮上中央基準描画((int)(scroll + Anime + OpenTaiko.Skin.DaniSelect_FolderText_X[desc]), OpenTaiko.Skin.DaniSelect_FolderText_Y[desc]); + break; + } + case CSongListNode.ENodeType.RANDOM: { + OpenTaiko.Tx.Dani_Bar_Random?.t2D描画(scroll + Anime, 0); + break; + } + } + } + + public void tOpenFolder(CSongListNode song) { + listSongs = song.list子リスト; + n現在の選択行 = 0; + tUpdateSongs(); + } + + public void tCloseFolder(CSongListNode song) { + listSongs = song.rParentNode.rParentNode.list子リスト; + n現在の選択行 = 0; + tUpdateSongs(); + } + + private void tUpdateSongs() { + stバー情報 = new STバー情報[listSongs.Count]; + this.tバーの初期化(); + } + + private void tバーの初期化() { + for (int i = 0; i < stバー情報.Length; i++) { + var song = listSongs[i]; + + stバー情報[i].eノード種別 = song.eノード種別; + switch (song.eノード種別) { + case CSongListNode.ENodeType.SCORE: { + stバー情報[i].ttkタイトル = new TitleTextureKey[listSongs[i].DanSongs.Count + 1]; + stバー情報[i].n曲難易度 = new int[listSongs[i].DanSongs.Count]; + stバー情報[i].n曲レベル = new int[listSongs[i].DanSongs.Count]; + for (int j = 0; j < listSongs[i].DanSongs.Count; j++) { + stバー情報[i].ttkタイトル[j] = new TitleTextureKey(song.DanSongs[j].bTitleShow ? "???" : song.DanSongs[j].Title, pfDanSong, Color.White, Color.Black, 700); + stバー情報[i].n曲難易度[j] = song.DanSongs[j].Difficulty; + stバー情報[i].n曲レベル[j] = song.DanSongs[j].Level; + stバー情報[i].List_DanSongs = song.DanSongs; + } + + // Two char header, will be used for grade unlocking too + string tmp = song.ldTitle.GetString("").TrimStringWithTags(2); + + stバー情報[i].ttkタイトル[listSongs[i].DanSongs.Count] = new TitleTextureKey(tmp, pfDanSong, Color.Black, Color.Transparent, 700); + + stバー情報[i].nDanTick = song.arスコア[6].譜面情報.nDanTick; + stバー情報[i].cDanTickColor = song.arスコア[6].譜面情報.cDanTickColor; + + //stバー情報[i].clearGrade = song.arスコア[6].譜面情報.nクリア[0]; + var TableEntry = OpenTaiko.SaveFileInstances[OpenTaiko.SaveFile].data.tGetSongSelectTableEntry(song.tGetUniqueId()); + stバー情報[i].clearGrade = TableEntry.ClearStatuses[(int)Difficulty.Dan]; + + string barCenter = Path.GetDirectoryName(song.arスコア[6].ファイル情報.ファイルの絶対パス) + @$"${Path.DirectorySeparatorChar}Bar_Center.png"; + if (BarTexCache.TryGetValue(barCenter, out CTexture texture1)) { + stバー情報[i].txBarCenter = texture1; + } else { + stバー情報[i].txBarCenter = OpenTaiko.tテクスチャの生成(barCenter); + BarTexCache.Add(barCenter, stバー情報[i].txBarCenter); + } + + string danPlate = Path.GetDirectoryName(song.arスコア[6].ファイル情報.ファイルの絶対パス) + @$"${Path.DirectorySeparatorChar}Dan_Plate.png"; + if (BarTexCache.TryGetValue(danPlate, out CTexture texture2)) { + stバー情報[i].txDanPlate = texture2; + } else { + stバー情報[i].txDanPlate = OpenTaiko.tテクスチャの生成(danPlate); + BarTexCache.Add(danPlate, stバー情報[i].txDanPlate); + } + } + break; + case CSongListNode.ENodeType.BOX: { + OpenTaiko.Tx.Dani_Bar_Folder?.tUpdateColor4(CConversion.ColorToColor4(song.BoxColor)); + + stバー情報[i].ttkタイトル = new TitleTextureKey[4]; + stバー情報[i].ttkタイトル[0] = new TitleTextureKey(song.ldTitle.GetString(""), pfDanFolder, Color.White, Color.Black, OpenTaiko.Skin.Resolution[0]); + for (int boxdesc = 0; boxdesc < 3; boxdesc++) + if (song.strBoxText[boxdesc] != null) + stバー情報[i].ttkタイトル[boxdesc + 1] = new TitleTextureKey(song.strBoxText[boxdesc].GetString(""), pfDanFolderDesc, song.ForeColor, song.BackColor, OpenTaiko.Skin.Resolution[0]); + else + stバー情報[i].ttkタイトル[boxdesc + 1] = new TitleTextureKey("", pfDanFolderDesc, Color.White, Color.Black, OpenTaiko.Skin.Resolution[0]); + stバー情報[i].cDanTickColor = song.BoxColor; + } + break; + case CSongListNode.ENodeType.BACKBOX: { + stバー情報[i].ttkタイトル = new TitleTextureKey[1]; + stバー情報[i].ttkタイトル[0] = new TitleTextureKey(CLangManager.LangInstance.GetString("MENU_RETURN"), pfDanSong, Color.White, Color.Black, 700); + stバー情報[i].cDanTickColor = Color.FromArgb(180, 150, 70); + } + break; + case CSongListNode.ENodeType.RANDOM: { + stバー情報[i].ttkタイトル = new TitleTextureKey[1]; + stバー情報[i].ttkタイトル[0] = new TitleTextureKey(CLangManager.LangInstance.GetString("SONGSELECT_RANDOM"), pfDanSong, Color.White, Color.Black, 700); + stバー情報[i].cDanTickColor = Color.FromArgb(150, 250, 255); + } + break; + } + + } + } + + public void t右に移動() { + if (n現在の選択行 < stバー情報.Length - 1) { + OpenTaiko.Skin.soundChangeSFX.tPlay(); + this.bLeftMove = false; + this.ctDaniMoveAnime.Start(0, 90, 2f, OpenTaiko.Timer); + } + } + + public void t左に移動() { + if (n現在の選択行 > 0) { + OpenTaiko.Skin.soundChangeSFX.tPlay(); + this.bLeftMove = true; + this.ctDaniMoveAnime.Start(0, 90, 2f, OpenTaiko.Timer); + } + } + + public void tLevelNumberDraw(float x, float y, int num, float scale = 1.0f) { + /* + for (int j = 0; j < str.Length; j++) + { + for (int i = 0; i < 10; i++) + { + if (str[j] == stLevel[i].ch) + { + TJAPlayer3.Tx.Dani_Level_Number.t2D描画(x - (str.Length * 14 + 10 * str.Length - str.Length * 14) / 2 + 14 / 2, (float)y - 18 / 2, new RectangleF(stLevel[i].pt.X, stLevel[i].pt.Y, 14, 18)); + x += 10; + } + } + }*/ + + float width = OpenTaiko.Tx.Dani_Level_Number.sz画像サイズ.Width / 10.0f; + float height = OpenTaiko.Tx.Dani_Level_Number.sz画像サイズ.Height; + + int[] nums = CConversion.SeparateDigits(num); + for (int j = 0; j < nums.Length; j++) { + float offset = j; + + float _x = x - (((OpenTaiko.Skin.DaniSelect_Level_Number_Interval[0] * offset) + (width / 2)) * scale); + float _y = y - (((OpenTaiko.Skin.DaniSelect_Level_Number_Interval[1] * offset) - (width / 2)) * scale); + + OpenTaiko.Tx.Dani_Level_Number.vcScaleRatio.X = scale; + OpenTaiko.Tx.Dani_Level_Number.vcScaleRatio.Y = scale; + OpenTaiko.Tx.Dani_Level_Number.t2D描画(_x, _y, + new RectangleF(width * nums[j], 0, width, height)); + OpenTaiko.Tx.Dani_Level_Number.vcScaleRatio.X = 1; + OpenTaiko.Tx.Dani_Level_Number.vcScaleRatio.Y = 1; + } + } + + public void tSoulDraw(float x, float y, int num) { + /* + TJAPlayer3.Tx.Dani_Soul_Number.t2D描画(x + 16 * str.Length, y - 30 / 2, new RectangleF(0, 30, 80, 30)); + + for (int j = 0; j < str.Length; j++) + { + for (int i = 0; i < 10; i++) + { + if (str[j] == stSoulNumber[i].ch) + { + TJAPlayer3.Tx.Dani_Soul_Number.t2D描画(x - (str.Length * 23 + 18 * str.Length - str.Length * 23) / 2 + 23 / 2, (float)y - 30 / 2, new RectangleF(stSoulNumber[i].pt.X, stSoulNumber[i].pt.Y, 23, 30)); + x += 16; + } + } + }*/ + + int[] nums = CConversion.SeparateDigits(num); + + float width = OpenTaiko.Tx.Dani_Soul_Number.sz画像サイズ.Width / 10.0f; + float height = OpenTaiko.Tx.Dani_Soul_Number.sz画像サイズ.Height / 2.0f; + + float text_width = OpenTaiko.Skin.DaniSelect_Soul_Number_Text_Width; + + OpenTaiko.Tx.Dani_Soul_Number.t2D描画(x + OpenTaiko.Skin.DaniSelect_Soul_Number_Interval[0] + (width / 2), + y + OpenTaiko.Skin.DaniSelect_Soul_Number_Interval[1] - (height / 2), + new RectangleF(0, height, text_width, height)); + + for (int j = 0; j < nums.Length; j++) { + float offset = j; + + float _x = x - (OpenTaiko.Skin.DaniSelect_Soul_Number_Interval[0] * offset) + (width / 2); + float _y = y - (OpenTaiko.Skin.DaniSelect_Soul_Number_Interval[1] * offset) - (height / 2); + + OpenTaiko.Tx.Dani_Soul_Number.t2D描画(_x, _y, + new RectangleF(width * nums[j], 0, width, height)); + } + } + + public void tExamDraw(float x, float y, int num, Exam.Range Range, float scale = 1.0f) { + /* + TJAPlayer3.Tx.Dani_Exam_Number.t2D描画(x + 19 * str.Length, y - 24 / 2, new RectangleF(45 * (int)Range, 24, 45, 24)); + + for (int j = 0; j < str.Length; j++) + { + for (int i = 0; i < 10; i++) + { + if (str[j] == stExamNumber[i].ch) + { + TJAPlayer3.Tx.Dani_Exam_Number.t2D描画(x, (float)y - 24 / 2, new RectangleF(stExamNumber[i].pt.X, stExamNumber[i].pt.Y, 19, 24)); + x += 16; + } + } + } + */ + + + int[] nums = CConversion.SeparateDigits(num); + + float width = OpenTaiko.Tx.Dani_Exam_Number.sz画像サイズ.Width / 10.0f; + float height = OpenTaiko.Tx.Dani_Exam_Number.sz画像サイズ.Height / 2.0f; + + float text_width = OpenTaiko.Skin.DaniSelect_Exam_Number_Text_Width; + + OpenTaiko.Tx.Dani_Exam_Number.vcScaleRatio.X = scale; + OpenTaiko.Tx.Dani_Exam_Number.vcScaleRatio.Y = scale; + + OpenTaiko.Tx.Dani_Exam_Number.t2D描画( + x + ((OpenTaiko.Skin.DaniSelect_Exam_Number_Interval[0] + (width / 2)) * scale), + y + ((OpenTaiko.Skin.DaniSelect_Exam_Number_Interval[1] + (height / 2)) * scale), + new RectangleF(text_width * (int)Range, height, text_width, height)); + + for (int j = 0; j < nums.Length; j++) { + float offset = j; + + float _x = x - (((OpenTaiko.Skin.DaniSelect_Exam_Number_Interval[0] * offset) + (width / 2)) * scale); + float _y = y - (((OpenTaiko.Skin.DaniSelect_Exam_Number_Interval[1] * offset) - (height / 2)) * scale); + + OpenTaiko.Tx.Dani_Exam_Number.t2D描画(_x, _y, + new RectangleF(width * nums[j], 0, width, height)); + } + } + + #endregion + } diff --git a/OpenTaiko/src/Stages/05.DaniSelect/CActSelect段位挑戦選択画面.cs b/OpenTaiko/src/Stages/05.DaniSelect/CActSelect段位挑戦選択画面.cs index b0c45911..b1cfd891 100644 --- a/OpenTaiko/src/Stages/05.DaniSelect/CActSelect段位挑戦選択画面.cs +++ b/OpenTaiko/src/Stages/05.DaniSelect/CActSelect段位挑戦選択画面.cs @@ -1,102 +1,102 @@ using System.Drawing; using FDK; -namespace OpenTaiko { - class CActSelect段位挑戦選択画面 : CActivity { - public override void Activate() { - ctBarIn = new CCounter(); - ctBarOut = new CCounter(); - ctBarOut.CurrentValue = 255; - OpenTaiko.stage段位選択.bDifficultyIn = false; - bOption = false; +namespace OpenTaiko; - base.Activate(); - } +class CActSelect段位挑戦選択画面 : CActivity { + public override void Activate() { + ctBarIn = new CCounter(); + ctBarOut = new CCounter(); + ctBarOut.CurrentValue = 255; + OpenTaiko.stage段位選択.bDifficultyIn = false; + bOption = false; - public override void DeActivate() { - base.DeActivate(); - } + base.Activate(); + } - public override void CreateManagedResource() { - base.CreateManagedResource(); - } + public override void DeActivate() { + base.DeActivate(); + } - public override void ReleaseManagedResource() { - base.ReleaseManagedResource(); - } + public override void CreateManagedResource() { + base.CreateManagedResource(); + } - public override int Draw() { - if (OpenTaiko.stage段位選択.bDifficultyIn || ctBarOut.CurrentValue < ctBarOut.EndValue) { - ctBarIn.Tick(); - ctBarOut.Tick(); + public override void ReleaseManagedResource() { + base.ReleaseManagedResource(); + } - OpenTaiko.Tx.Challenge_Select[0].Opacity = OpenTaiko.stage段位選択.bDifficultyIn ? ctBarIn.CurrentValue : 255 - ctBarOut.CurrentValue; - OpenTaiko.Tx.Challenge_Select[1].Opacity = OpenTaiko.stage段位選択.bDifficultyIn ? ctBarIn.CurrentValue : 255 - ctBarOut.CurrentValue; - OpenTaiko.Tx.Challenge_Select[2].Opacity = OpenTaiko.stage段位選択.bDifficultyIn ? ctBarIn.CurrentValue : 255 - ctBarOut.CurrentValue; + public override int Draw() { + if (OpenTaiko.stage段位選択.bDifficultyIn || ctBarOut.CurrentValue < ctBarOut.EndValue) { + ctBarIn.Tick(); + ctBarOut.Tick(); - OpenTaiko.Tx.Challenge_Select[0].t2D描画(0, 0); + OpenTaiko.Tx.Challenge_Select[0].Opacity = OpenTaiko.stage段位選択.bDifficultyIn ? ctBarIn.CurrentValue : 255 - ctBarOut.CurrentValue; + OpenTaiko.Tx.Challenge_Select[1].Opacity = OpenTaiko.stage段位選択.bDifficultyIn ? ctBarIn.CurrentValue : 255 - ctBarOut.CurrentValue; + OpenTaiko.Tx.Challenge_Select[2].Opacity = OpenTaiko.stage段位選択.bDifficultyIn ? ctBarIn.CurrentValue : 255 - ctBarOut.CurrentValue; - int selectIndex = (2 - n現在の選択行); - int[] challenge_select_rect = OpenTaiko.Skin.DaniSelect_Challenge_Select_Rect[selectIndex]; + OpenTaiko.Tx.Challenge_Select[0].t2D描画(0, 0); - OpenTaiko.Tx.Challenge_Select[2].t2D描画(OpenTaiko.Skin.DaniSelect_Challenge_Select_X[selectIndex], OpenTaiko.Skin.DaniSelect_Challenge_Select_Y[selectIndex], - new Rectangle(challenge_select_rect[0], challenge_select_rect[1], challenge_select_rect[2], challenge_select_rect[3])); + int selectIndex = (2 - n現在の選択行); + int[] challenge_select_rect = OpenTaiko.Skin.DaniSelect_Challenge_Select_Rect[selectIndex]; - OpenTaiko.Tx.Challenge_Select[1].t2D描画(0, 0); + OpenTaiko.Tx.Challenge_Select[2].t2D描画(OpenTaiko.Skin.DaniSelect_Challenge_Select_X[selectIndex], OpenTaiko.Skin.DaniSelect_Challenge_Select_Y[selectIndex], + new Rectangle(challenge_select_rect[0], challenge_select_rect[1], challenge_select_rect[2], challenge_select_rect[3])); + + OpenTaiko.Tx.Challenge_Select[1].t2D描画(0, 0); - if (OpenTaiko.stage段位選択.ct待機.IsStarted) - return base.Draw(); + if (OpenTaiko.stage段位選択.ct待機.IsStarted) + return base.Draw(); - #region [Key bindings] + #region [Key bindings] - if (ctBarIn.IsEnded && !OpenTaiko.stage段位選択.b選択した && bOption == false) { - if (OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.RightArrow) || - OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.RBlue)) { - if (n現在の選択行 - 1 >= 0) { - OpenTaiko.Skin.soundChangeSFX.tPlay(); - n現在の選択行--; - } - } - - if (OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.LeftArrow) || - OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.LBlue)) { - if (n現在の選択行 + 1 <= 2) { - OpenTaiko.Skin.soundChangeSFX.tPlay(); - n現在の選択行++; - } - } - - if (OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Return) || - OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.LRed) || - OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.RRed)) { - if (n現在の選択行 == 0) { - this.ctBarOut.Start(0, 255, 0.5f, OpenTaiko.Timer); - OpenTaiko.Skin.soundCancelSFX.tPlay(); - OpenTaiko.stage段位選択.bDifficultyIn = false; - } else if (n現在の選択行 == 1) { - //TJAPlayer3.Skin.soundDanSongSelect.t再生する(); - OpenTaiko.ConfigIni.bTokkunMode = false; - OpenTaiko.Skin.soundDecideSFX.tPlay(); - OpenTaiko.Skin.voiceMenuDanSelectConfirm[OpenTaiko.SaveFile]?.tPlay(); - OpenTaiko.stage段位選択.ct待機.Start(0, 3000, 1, OpenTaiko.Timer); - } else if (n現在の選択行 == 2) { - bOption = true; - } + if (ctBarIn.IsEnded && !OpenTaiko.stage段位選択.b選択した && bOption == false) { + if (OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.RightArrow) || + OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.RBlue)) { + if (n現在の選択行 - 1 >= 0) { + OpenTaiko.Skin.soundChangeSFX.tPlay(); + n現在の選択行--; } } - #endregion + if (OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.LeftArrow) || + OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.LBlue)) { + if (n現在の選択行 + 1 <= 2) { + OpenTaiko.Skin.soundChangeSFX.tPlay(); + n現在の選択行++; + } + } + + if (OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Return) || + OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.LRed) || + OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.RRed)) { + if (n現在の選択行 == 0) { + this.ctBarOut.Start(0, 255, 0.5f, OpenTaiko.Timer); + OpenTaiko.Skin.soundCancelSFX.tPlay(); + OpenTaiko.stage段位選択.bDifficultyIn = false; + } else if (n現在の選択行 == 1) { + //TJAPlayer3.Skin.soundDanSongSelect.t再生する(); + OpenTaiko.ConfigIni.bTokkunMode = false; + OpenTaiko.Skin.soundDecideSFX.tPlay(); + OpenTaiko.Skin.voiceMenuDanSelectConfirm[OpenTaiko.SaveFile]?.tPlay(); + OpenTaiko.stage段位選択.ct待機.Start(0, 3000, 1, OpenTaiko.Timer); + } else if (n現在の選択行 == 2) { + bOption = true; + } + } } - return base.Draw(); + #endregion } - public CCounter ctBarIn; - public CCounter ctBarOut; - - public bool bOption; - - private int n現在の選択行; + return base.Draw(); } + + public CCounter ctBarIn; + public CCounter ctBarOut; + + public bool bOption; + + private int n現在の選択行; } diff --git a/OpenTaiko/src/Stages/05.DaniSelect/CStage段位選択.cs b/OpenTaiko/src/Stages/05.DaniSelect/CStage段位選択.cs index 256ec54a..cb096d9f 100644 --- a/OpenTaiko/src/Stages/05.DaniSelect/CStage段位選択.cs +++ b/OpenTaiko/src/Stages/05.DaniSelect/CStage段位選択.cs @@ -2,369 +2,369 @@ using System.Text; using FDK; -namespace OpenTaiko { - class CStage段位選択 : CStage { - public CStage段位選択() { - base.eStageID = EStage.DanDojoSelect; - base.ePhaseID = CStage.EPhase.Common_NORMAL; +namespace OpenTaiko; - base.ChildActivities.Add(this.段位リスト = new CActSelect段位リスト()); +class CStage段位選択 : CStage { + public CStage段位選択() { + base.eStageID = EStage.DanDojoSelect; + base.ePhaseID = CStage.EPhase.Common_NORMAL; - base.ChildActivities.Add(this.actFOtoNowLoading = new CActFIFOStart()); - base.ChildActivities.Add(this.段位挑戦選択画面 = new CActSelect段位挑戦選択画面()); - base.ChildActivities.Add(this.actFOtoTitle = new CActFIFOBlack()); - base.ChildActivities.Add(this.actPlayOption = new CActPlayOption()); - base.ChildActivities.Add(this.PuchiChara = new PuchiChara()); - } + base.ChildActivities.Add(this.段位リスト = new CActSelect段位リスト()); - public override void Activate() { - if (base.IsActivated) - return; + base.ChildActivities.Add(this.actFOtoNowLoading = new CActFIFOStart()); + base.ChildActivities.Add(this.段位挑戦選択画面 = new CActSelect段位挑戦選択画面()); + base.ChildActivities.Add(this.actFOtoTitle = new CActFIFOBlack()); + base.ChildActivities.Add(this.actPlayOption = new CActPlayOption()); + base.ChildActivities.Add(this.PuchiChara = new PuchiChara()); + } - this.b選択した = false; + public override void Activate() { + if (base.IsActivated) + return; - base.ePhaseID = CStage.EPhase.Common_NORMAL; - this.eフェードアウト完了時の戻り値 = E戻り値.継続; + this.b選択した = false; - ct待機 = new CCounter(); - ctChara_In = new CCounter(); + base.ePhaseID = CStage.EPhase.Common_NORMAL; + this.eフェードアウト完了時の戻り値 = E戻り値.継続; - // ctChara_Normal = new CCounter(0, TJAPlayer3.Tx.SongSelect_Chara_Normal.Length - 1, 1000 / 45, TJAPlayer3.Timer); - CMenuCharacter.tMenuResetTimer(CMenuCharacter.ECharacterAnimation.NORMAL); + ct待機 = new CCounter(); + ctChara_In = new CCounter(); + + // ctChara_Normal = new CCounter(0, TJAPlayer3.Tx.SongSelect_Chara_Normal.Length - 1, 1000 / 45, TJAPlayer3.Timer); + CMenuCharacter.tMenuResetTimer(CMenuCharacter.ECharacterAnimation.NORMAL); - bInSongPlayed = false; + bInSongPlayed = false; - this.PuchiChara.IdleAnimation(); + this.PuchiChara.IdleAnimation(); - Background = new ScriptBG(CSkin.Path($"{TextureLoader.BASE}{TextureLoader.DANISELECT}Script.lua")); - Background.Init(); + Background = new ScriptBG(CSkin.Path($"{TextureLoader.BASE}{TextureLoader.DANISELECT}Script.lua")); + Background.Init(); - base.Activate(); - } + base.Activate(); + } - public override void DeActivate() { - OpenTaiko.tDisposeSafely(ref Background); + public override void DeActivate() { + OpenTaiko.tDisposeSafely(ref Background); - base.DeActivate(); - } + base.DeActivate(); + } - public override void CreateManagedResource() { + public override void CreateManagedResource() { - base.CreateManagedResource(); - } + base.CreateManagedResource(); + } - public override void ReleaseManagedResource() { + public override void ReleaseManagedResource() { - base.ReleaseManagedResource(); - } + base.ReleaseManagedResource(); + } - public override int Draw() { - // ctChara_Normal.t進行Loop(); - ctChara_In.Tick(); - ct待機.Tick(); + public override int Draw() { + // ctChara_Normal.t進行Loop(); + ctChara_In.Tick(); + ct待機.Tick(); - int stamp = this.段位リスト.ctDaniIn.CurrentValue; + int stamp = this.段位リスト.ctDaniIn.CurrentValue; - float zoom = Math.Min(1.14f, Math.Max(1f, (float)Math.Pow(stamp / 3834f, 0.5f))); + float zoom = Math.Min(1.14f, Math.Max(1f, (float)Math.Pow(stamp / 3834f, 0.5f))); - Background.Update(); - Background.Draw(); + Background.Update(); + Background.Draw(); - //TJAPlayer3.Tx.Dani_Background.vc拡大縮小倍率.X = zoom; - //TJAPlayer3.Tx.Dani_Background.vc拡大縮小倍率.Y = zoom; - //TJAPlayer3.Tx.Dani_Background.t2D拡大率考慮中央基準描画(TJAPlayer3.Skin.Resolution[0] / 2, TJAPlayer3.Skin.Resolution[1] / 2); + //TJAPlayer3.Tx.Dani_Background.vc拡大縮小倍率.X = zoom; + //TJAPlayer3.Tx.Dani_Background.vc拡大縮小倍率.Y = zoom; + //TJAPlayer3.Tx.Dani_Background.t2D拡大率考慮中央基準描画(TJAPlayer3.Skin.Resolution[0] / 2, TJAPlayer3.Skin.Resolution[1] / 2); - this.段位リスト.Draw(); + this.段位リスト.Draw(); - if (stamp < 6000) { - #region [Dan intro anim] + if (stamp < 6000) { + #region [Dan intro anim] - if (!bInSongPlayed) { - this.段位リスト.ctDaniIn = new CCounter(0, 6000, 1, OpenTaiko.Timer); - OpenTaiko.Skin.soundDanSongSelectIn.tPlay(); - bInSongPlayed = true; - } + if (!bInSongPlayed) { + this.段位リスト.ctDaniIn = new CCounter(0, 6000, 1, OpenTaiko.Timer); + OpenTaiko.Skin.soundDanSongSelectIn.tPlay(); + bInSongPlayed = true; + } + + /* + int dani_dan_in_width = TJAPlayer3.Tx.Dani_Dan_In.szテクスチャサイズ.Width / 2; + int dani_dan_in_height = TJAPlayer3.Tx.Dani_Dan_In.szテクスチャサイズ.Height; + + int doorLeft = 0; + int doorRight = dani_dan_in_width; + if (stamp >= 3834) + { + double screen_ratio = TJAPlayer3.Skin.Resolution[0] / 1280.0; + + doorLeft -= (int)((stamp - 3834) * screen_ratio); + doorRight += (int)((stamp - 3834) * screen_ratio); + } + + TJAPlayer3.Tx.Dani_Dan_In.t2D描画(doorLeft, 0, new Rectangle(0, 0, dani_dan_in_width, dani_dan_in_height)); + TJAPlayer3.Tx.Dani_Dan_In.t2D描画(doorRight, 0, new Rectangle(dani_dan_in_width, 0, dani_dan_in_width, dani_dan_in_height)); + */ + if (stamp <= 3834) { + #region [Dan intro letters] + + //int quarter = TJAPlayer3.Tx.Dani_Dan_Text.szテクスチャサイズ.Width / 4; /* - int dani_dan_in_width = TJAPlayer3.Tx.Dani_Dan_In.szテクスチャサイズ.Width / 2; - int dani_dan_in_height = TJAPlayer3.Tx.Dani_Dan_In.szテクスチャサイズ.Height; - - int doorLeft = 0; - int doorRight = dani_dan_in_width; - if (stamp >= 3834) - { - double screen_ratio = TJAPlayer3.Skin.Resolution[0] / 1280.0; - - doorLeft -= (int)((stamp - 3834) * screen_ratio); - doorRight += (int)((stamp - 3834) * screen_ratio); - } - - TJAPlayer3.Tx.Dani_Dan_In.t2D描画(doorLeft, 0, new Rectangle(0, 0, dani_dan_in_width, dani_dan_in_height)); - TJAPlayer3.Tx.Dani_Dan_In.t2D描画(doorRight, 0, new Rectangle(dani_dan_in_width, 0, dani_dan_in_width, dani_dan_in_height)); + int[] xAxis = { 300, 980 }; + int[] yAxis = { 198, 522 }; */ - if (stamp <= 3834) { - #region [Dan intro letters] - //int quarter = TJAPlayer3.Tx.Dani_Dan_Text.szテクスチャサイズ.Width / 4; + /* + int[] appearStamps = { 1645, 2188, 2646, 3152 }; - /* - int[] xAxis = { 300, 980 }; - int[] yAxis = { 198, 522 }; - */ + for (int i = 0; i < 4; i++) + { + int x = TJAPlayer3.Skin.DaniSelect_Dan_Text_X[i]; + int y = TJAPlayer3.Skin.DaniSelect_Dan_Text_Y[i]; - /* - int[] appearStamps = { 1645, 2188, 2646, 3152 }; + if (stamp < appearStamps[i]) + break; - for (int i = 0; i < 4; i++) - { - int x = TJAPlayer3.Skin.DaniSelect_Dan_Text_X[i]; - int y = TJAPlayer3.Skin.DaniSelect_Dan_Text_Y[i]; + TJAPlayer3.Tx.Dani_Dan_Text.Opacity = Math.Min(255, stamp - appearStamps[i]); - if (stamp < appearStamps[i]) - break; + float ratio = (255 - TJAPlayer3.Tx.Dani_Dan_Text.Opacity) / 400f + 1f; - TJAPlayer3.Tx.Dani_Dan_Text.Opacity = Math.Min(255, stamp - appearStamps[i]); + TJAPlayer3.Tx.Dani_Dan_Text.vc拡大縮小倍率.X = ratio; + TJAPlayer3.Tx.Dani_Dan_Text.vc拡大縮小倍率.Y = ratio; - float ratio = (255 - TJAPlayer3.Tx.Dani_Dan_Text.Opacity) / 400f + 1f; - - TJAPlayer3.Tx.Dani_Dan_Text.vc拡大縮小倍率.X = ratio; - TJAPlayer3.Tx.Dani_Dan_Text.vc拡大縮小倍率.Y = ratio; - - TJAPlayer3.Tx.Dani_Dan_Text.t2D拡大率考慮中央基準描画(x, y, - new Rectangle(quarter * i, 0, quarter, TJAPlayer3.Tx.Dani_Dan_Text.szテクスチャサイズ.Height)); - } - */ - - #endregion - } + TJAPlayer3.Tx.Dani_Dan_Text.t2D拡大率考慮中央基準描画(x, y, + new Rectangle(quarter * i, 0, quarter, TJAPlayer3.Tx.Dani_Dan_Text.szテクスチャサイズ.Height)); + } + */ #endregion - } else if (stamp == 6000) { - if (!ctChara_In.IsStarted) { - //TJAPlayer3.Skin.soundDanSelectStart.t再生する(); - OpenTaiko.Skin.voiceMenuDanSelectStart[OpenTaiko.SaveFile]?.tPlay(); - OpenTaiko.Skin.soundDanSelectBGM.tPlay(); - ctChara_In.Start(0, 180, 1.25f, OpenTaiko.Timer); + } + + #endregion + } else if (stamp == 6000) { + if (!ctChara_In.IsStarted) { + //TJAPlayer3.Skin.soundDanSelectStart.t再生する(); + OpenTaiko.Skin.voiceMenuDanSelectStart[OpenTaiko.SaveFile]?.tPlay(); + OpenTaiko.Skin.soundDanSelectBGM.tPlay(); + ctChara_In.Start(0, 180, 1.25f, OpenTaiko.Timer); + } + + OpenTaiko.NamePlate.tNamePlateDraw(OpenTaiko.Skin.SongSelect_NamePlate_X[0], OpenTaiko.Skin.SongSelect_NamePlate_Y[0], 0); + ModIcons.tDisplayModsMenu(OpenTaiko.Skin.SongSelect_ModIcons_X[0], OpenTaiko.Skin.SongSelect_ModIcons_Y[0], 0); ; + + #region [ キー関連 ] + + if (!this.段位リスト.bスクロール中 && !b選択した && !bDifficultyIn) { + int returnTitle() { + OpenTaiko.Skin.soundDanSelectBGM.tStop(); + OpenTaiko.Skin.soundCancelSFX.tPlay(); + this.eフェードアウト完了時の戻り値 = E戻り値.タイトルに戻る; + this.actFOtoTitle.tフェードアウト開始(); + base.ePhaseID = CStage.EPhase.Common_FADEOUT; + return 0; } - OpenTaiko.NamePlate.tNamePlateDraw(OpenTaiko.Skin.SongSelect_NamePlate_X[0], OpenTaiko.Skin.SongSelect_NamePlate_Y[0], 0); - ModIcons.tDisplayModsMenu(OpenTaiko.Skin.SongSelect_ModIcons_X[0], OpenTaiko.Skin.SongSelect_ModIcons_Y[0], 0); ; + if (OpenTaiko.InputManager.Keyboard.KeyPressing((int)SlimDXKeys.Key.RightArrow) || + OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.RightChange)) { + this.段位リスト.t右に移動(); + } - #region [ キー関連 ] - - if (!this.段位リスト.bスクロール中 && !b選択した && !bDifficultyIn) { - int returnTitle() { - OpenTaiko.Skin.soundDanSelectBGM.tStop(); - OpenTaiko.Skin.soundCancelSFX.tPlay(); - this.eフェードアウト完了時の戻り値 = E戻り値.タイトルに戻る; - this.actFOtoTitle.tフェードアウト開始(); - base.ePhaseID = CStage.EPhase.Common_FADEOUT; - return 0; - } - - if (OpenTaiko.InputManager.Keyboard.KeyPressing((int)SlimDXKeys.Key.RightArrow) || - OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.RightChange)) { - this.段位リスト.t右に移動(); - } - - if (OpenTaiko.InputManager.Keyboard.KeyPressing((int)SlimDXKeys.Key.LeftArrow) || + if (OpenTaiko.InputManager.Keyboard.KeyPressing((int)SlimDXKeys.Key.LeftArrow) || OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.LeftChange)) { - this.段位リスト.t左に移動(); - } + this.段位リスト.t左に移動(); + } - if (OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Return) || - OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.Decide)) { - switch (段位リスト.currentBar.eノード種別) { - case CSongListNode.ENodeType.SCORE: - case CSongListNode.ENodeType.RANDOM: { - //this.t段位を選択する(); - //TJAPlayer3.Skin.soundDanSongSelectCheck.t再生する(); - OpenTaiko.Skin.voiceMenuDanSelectPrompt[OpenTaiko.SaveFile]?.tPlay(); - this.bDifficultyIn = true; - this.段位挑戦選択画面.ctBarIn.Start(0, 255, 1, OpenTaiko.Timer); - } - break; - case CSongListNode.ENodeType.BOX: { + if (OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Return) || + OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.Decide)) { + switch (段位リスト.currentBar.eノード種別) { + case CSongListNode.ENodeType.SCORE: + case CSongListNode.ENodeType.RANDOM: { + //this.t段位を選択する(); + //TJAPlayer3.Skin.soundDanSongSelectCheck.t再生する(); + OpenTaiko.Skin.voiceMenuDanSelectPrompt[OpenTaiko.SaveFile]?.tPlay(); + this.bDifficultyIn = true; + this.段位挑戦選択画面.ctBarIn.Start(0, 255, 1, OpenTaiko.Timer); + } + break; + case CSongListNode.ENodeType.BOX: { + OpenTaiko.Skin.soundDecideSFX.tPlay(); + 段位リスト.tOpenFolder(段位リスト.currentBar); + } + break; + case CSongListNode.ENodeType.BACKBOX: { + if (OpenTaiko.Songs管理.list曲ルート.Contains(段位リスト.currentBar.rParentNode) && 段位リスト.currentBar.rParentNode.strジャンル == "段位道場") { + return returnTitle(); + } else { OpenTaiko.Skin.soundDecideSFX.tPlay(); - 段位リスト.tOpenFolder(段位リスト.currentBar); + 段位リスト.tCloseFolder(段位リスト.currentBar); } - break; - case CSongListNode.ENodeType.BACKBOX: { - if (OpenTaiko.Songs管理.list曲ルート.Contains(段位リスト.currentBar.rParentNode) && 段位リスト.currentBar.rParentNode.strジャンル == "段位道場") { - return returnTitle(); - } else { - OpenTaiko.Skin.soundDecideSFX.tPlay(); - 段位リスト.tCloseFolder(段位リスト.currentBar); - } - } - break; - } - } - - if (OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Escape) || - OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.Cancel)) { - this.段位リスト.n現在の選択行 = 0; - return returnTitle(); + } + break; } } + if (OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Escape) || + OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.Cancel)) { + this.段位リスト.n現在の選択行 = 0; + return returnTitle(); + } + } + + #endregion + + #region [ キャラ関連 ] + + if (ctChara_In.CurrentValue != 90) { + float CharaX = 0f, CharaY = 0f; + + CharaX = (float)Math.Sin(ctChara_In.CurrentValue / 2 * (Math.PI / 180)) * 200f; + CharaY = ((float)Math.Sin((90 + (ctChara_In.CurrentValue / 2)) * (Math.PI / 180)) * 150f); + + // TJAPlayer3.Tx.SongSelect_Chara_Normal[ctChara_Normal.n現在の値].Opacity = ctChara_In.n現在の値 * 2; + // TJAPlayer3.Tx.SongSelect_Chara_Normal[ctChara_Normal.n現在の値].t2D描画(-200 + CharaX, 336 - CharaY); + + //CMenuCharacter.tMenuDisplayCharacter(0, (int)(-200 + CharaX), (int)(336 - CharaY), CMenuCharacter.ECharacterAnimation.NORMAL); + + int chara_x = OpenTaiko.Skin.SongSelect_NamePlate_X[0] + OpenTaiko.Tx.NamePlateBase.szTextureSize.Width / 2; + int chara_y = OpenTaiko.Skin.SongSelect_NamePlate_Y[0]; + + CMenuCharacter.tMenuDisplayCharacter( + 0, + chara_x, + chara_y, + CMenuCharacter.ECharacterAnimation.NORMAL); + + #region [PuchiChara] + + int puchi_x = chara_x + OpenTaiko.Skin.Adjustments_MenuPuchichara_X[0]; + int puchi_y = chara_y + OpenTaiko.Skin.Adjustments_MenuPuchichara_Y[0]; + + //this.PuchiChara.On進行描画(0 + 100, 336 + 230, false); + this.PuchiChara.On進行描画(puchi_x, puchi_y, false); + #endregion + } - #region [ キャラ関連 ] + #endregion - if (ctChara_In.CurrentValue != 90) { - float CharaX = 0f, CharaY = 0f; + this.段位挑戦選択画面.Draw(); + } - CharaX = (float)Math.Sin(ctChara_In.CurrentValue / 2 * (Math.PI / 180)) * 200f; - CharaY = ((float)Math.Sin((90 + (ctChara_In.CurrentValue / 2)) * (Math.PI / 180)) * 150f); + if (段位挑戦選択画面.bOption) actPlayOption.On進行描画(0); - // TJAPlayer3.Tx.SongSelect_Chara_Normal[ctChara_Normal.n現在の値].Opacity = ctChara_In.n現在の値 * 2; - // TJAPlayer3.Tx.SongSelect_Chara_Normal[ctChara_Normal.n現在の値].t2D描画(-200 + CharaX, 336 - CharaY); - - //CMenuCharacter.tMenuDisplayCharacter(0, (int)(-200 + CharaX), (int)(336 - CharaY), CMenuCharacter.ECharacterAnimation.NORMAL); - - int chara_x = OpenTaiko.Skin.SongSelect_NamePlate_X[0] + OpenTaiko.Tx.NamePlateBase.szTextureSize.Width / 2; - int chara_y = OpenTaiko.Skin.SongSelect_NamePlate_Y[0]; - - CMenuCharacter.tMenuDisplayCharacter( - 0, - chara_x, - chara_y, - CMenuCharacter.ECharacterAnimation.NORMAL); - - #region [PuchiChara] - - int puchi_x = chara_x + OpenTaiko.Skin.Adjustments_MenuPuchichara_X[0]; - int puchi_y = chara_y + OpenTaiko.Skin.Adjustments_MenuPuchichara_Y[0]; - - //this.PuchiChara.On進行描画(0 + 100, 336 + 230, false); - this.PuchiChara.On進行描画(puchi_x, puchi_y, false); - - #endregion + if (ct待機.CurrentValue >= 3000) { + if (段位リスト.currentBar.eノード種別 == CSongListNode.ENodeType.RANDOM) { + if (!tSelectSongRandomly()) { + bDifficultyIn = false; + b選択した = false; + OpenTaiko.Skin.soundError.tPlay(); } - - #endregion - - this.段位挑戦選択画面.Draw(); + } else { + OpenTaiko.stage段位選択.t段位を選択する(); } + ct待機.CurrentValue = 0; + ct待機.Stop(); + } - if (段位挑戦選択画面.bOption) actPlayOption.On進行描画(0); - - if (ct待機.CurrentValue >= 3000) { - if (段位リスト.currentBar.eノード種別 == CSongListNode.ENodeType.RANDOM) { - if (!tSelectSongRandomly()) { - bDifficultyIn = false; - b選択した = false; - OpenTaiko.Skin.soundError.tPlay(); - } - } else { - OpenTaiko.stage段位選択.t段位を選択する(); + switch (base.ePhaseID) { + case CStage.EPhase.SongSelect_FadeOutToNowLoading: + if (this.actFOtoNowLoading.Draw() == 0) { + break; } - ct待機.CurrentValue = 0; - ct待機.Stop(); - } + return (int)this.eフェードアウト完了時の戻り値; - switch (base.ePhaseID) { - case CStage.EPhase.SongSelect_FadeOutToNowLoading: - if (this.actFOtoNowLoading.Draw() == 0) { - break; - } - return (int)this.eフェードアウト完了時の戻り値; + case CStage.EPhase.Common_FADEOUT: + if (this.actFOtoTitle.Draw() == 0) { + break; + } + return (int)this.eフェードアウト完了時の戻り値; - case CStage.EPhase.Common_FADEOUT: - if (this.actFOtoTitle.Draw() == 0) { - break; - } - return (int)this.eフェードアウト完了時の戻り値; - - } - - return 0; } - public enum E戻り値 : int { - 継続, - タイトルに戻る, - 選曲した - } - - public void t段位を選択する() { - this.b選択した = true; - OpenTaiko.stageSongSelect.rChoosenSong = 段位リスト.listSongs[段位リスト.n現在の選択行]; - OpenTaiko.stageSongSelect.r確定されたスコア = 段位リスト.listSongs[段位リスト.n現在の選択行].arスコア[(int)Difficulty.Dan]; - OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] = (int)Difficulty.Dan; - OpenTaiko.stageSongSelect.str確定された曲のジャンル = 段位リスト.listSongs[段位リスト.n現在の選択行].strジャンル; - if ((OpenTaiko.stageSongSelect.rChoosenSong != null) && (OpenTaiko.stageSongSelect.r確定されたスコア != null)) { - this.eフェードアウト完了時の戻り値 = E戻り値.選曲した; - this.actFOtoNowLoading.tフェードアウト開始(); // #27787 2012.3.10 yyagi 曲決定時の画面フェードアウトの省略 - base.ePhaseID = CStage.EPhase.SongSelect_FadeOutToNowLoading; - } - // TJAPlayer3.Skin.bgm選曲画面.t停止する(); - CSongSelectSongManager.stopSong(); - } - - private bool tSelectSongRandomly() { - this.b選択した = true; - var mandatoryDiffs = new List(); - CSongListNode song = 段位リスト.currentBar; - - List songs = new List(); - OpenTaiko.stageSongSelect.t指定された曲の子リストの曲を列挙する_孫リスト含む(song.rParentNode, ref songs, ref mandatoryDiffs, true); - song.listランダム用ノードリスト = songs; - - int selectableSongCount = song.listランダム用ノードリスト.Count; - - if (selectableSongCount == 0) { - return false; - } - - int randomSongIndex = OpenTaiko.Random.Next(selectableSongCount); - - if (OpenTaiko.ConfigIni.bOutputDetailedDTXLog) { - StringBuilder builder = new StringBuilder(0x400); - builder.Append(string.Format("Total number of songs to randomly choose from {0}. Randomly selected index {0}.", selectableSongCount, randomSongIndex)); - Trace.TraceInformation(builder.ToString()); - } - - // Third assignment - OpenTaiko.stageSongSelect.rChoosenSong = song.listランダム用ノードリスト[randomSongIndex]; - OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] = (int)Difficulty.Dan; - - OpenTaiko.stageSongSelect.r確定されたスコア = OpenTaiko.stageSongSelect.rChoosenSong.arスコア[OpenTaiko.stageSongSelect.actSongList.n現在のアンカ難易度レベルに最も近い難易度レベルを返す(OpenTaiko.stageSongSelect.rChoosenSong)]; - OpenTaiko.stageSongSelect.str確定された曲のジャンル = OpenTaiko.stageSongSelect.rChoosenSong.strジャンル; - - //TJAPlayer3.Skin.sound曲決定音.t再生する(); - - this.eフェードアウト完了時の戻り値 = E戻り値.選曲した; - this.actFOtoNowLoading.tフェードアウト開始(); // #27787 2012.3.10 yyagi 曲決定時の画面フェードアウトの省略 - base.ePhaseID = CStage.EPhase.SongSelect_FadeOutToNowLoading; - - CSongSelectSongManager.stopSong(); - - return true; - } - - private ScriptBG Background; - - public CCounter ct待機; - - public bool b選択した; - public bool bDifficultyIn; - - public bool bInSongPlayed; - - private CCounter ctChara_In; - // private CCounter ctChara_Normal; - - private PuchiChara PuchiChara; - - public E戻り値 eフェードアウト完了時の戻り値; - - public CActFIFOStart actFOtoNowLoading; - public CActFIFOBlack actFOtoTitle; - public CActSelect段位リスト 段位リスト; - public CActSelect段位挑戦選択画面 段位挑戦選択画面; - public CActPlayOption actPlayOption; + return 0; } + + public enum E戻り値 : int { + 継続, + タイトルに戻る, + 選曲した + } + + public void t段位を選択する() { + this.b選択した = true; + OpenTaiko.stageSongSelect.rChoosenSong = 段位リスト.listSongs[段位リスト.n現在の選択行]; + OpenTaiko.stageSongSelect.r確定されたスコア = 段位リスト.listSongs[段位リスト.n現在の選択行].arスコア[(int)Difficulty.Dan]; + OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] = (int)Difficulty.Dan; + OpenTaiko.stageSongSelect.str確定された曲のジャンル = 段位リスト.listSongs[段位リスト.n現在の選択行].strジャンル; + if ((OpenTaiko.stageSongSelect.rChoosenSong != null) && (OpenTaiko.stageSongSelect.r確定されたスコア != null)) { + this.eフェードアウト完了時の戻り値 = E戻り値.選曲した; + this.actFOtoNowLoading.tフェードアウト開始(); // #27787 2012.3.10 yyagi 曲決定時の画面フェードアウトの省略 + base.ePhaseID = CStage.EPhase.SongSelect_FadeOutToNowLoading; + } + // TJAPlayer3.Skin.bgm選曲画面.t停止する(); + CSongSelectSongManager.stopSong(); + } + + private bool tSelectSongRandomly() { + this.b選択した = true; + var mandatoryDiffs = new List(); + CSongListNode song = 段位リスト.currentBar; + + List songs = new List(); + OpenTaiko.stageSongSelect.t指定された曲の子リストの曲を列挙する_孫リスト含む(song.rParentNode, ref songs, ref mandatoryDiffs, true); + song.listランダム用ノードリスト = songs; + + int selectableSongCount = song.listランダム用ノードリスト.Count; + + if (selectableSongCount == 0) { + return false; + } + + int randomSongIndex = OpenTaiko.Random.Next(selectableSongCount); + + if (OpenTaiko.ConfigIni.bOutputDetailedDTXLog) { + StringBuilder builder = new StringBuilder(0x400); + builder.Append(string.Format("Total number of songs to randomly choose from {0}. Randomly selected index {0}.", selectableSongCount, randomSongIndex)); + Trace.TraceInformation(builder.ToString()); + } + + // Third assignment + OpenTaiko.stageSongSelect.rChoosenSong = song.listランダム用ノードリスト[randomSongIndex]; + OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] = (int)Difficulty.Dan; + + OpenTaiko.stageSongSelect.r確定されたスコア = OpenTaiko.stageSongSelect.rChoosenSong.arスコア[OpenTaiko.stageSongSelect.actSongList.n現在のアンカ難易度レベルに最も近い難易度レベルを返す(OpenTaiko.stageSongSelect.rChoosenSong)]; + OpenTaiko.stageSongSelect.str確定された曲のジャンル = OpenTaiko.stageSongSelect.rChoosenSong.strジャンル; + + //TJAPlayer3.Skin.sound曲決定音.t再生する(); + + this.eフェードアウト完了時の戻り値 = E戻り値.選曲した; + this.actFOtoNowLoading.tフェードアウト開始(); // #27787 2012.3.10 yyagi 曲決定時の画面フェードアウトの省略 + base.ePhaseID = CStage.EPhase.SongSelect_FadeOutToNowLoading; + + CSongSelectSongManager.stopSong(); + + return true; + } + + private ScriptBG Background; + + public CCounter ct待機; + + public bool b選択した; + public bool bDifficultyIn; + + public bool bInSongPlayed; + + private CCounter ctChara_In; + // private CCounter ctChara_Normal; + + private PuchiChara PuchiChara; + + public E戻り値 eフェードアウト完了時の戻り値; + + public CActFIFOStart actFOtoNowLoading; + public CActFIFOBlack actFOtoTitle; + public CActSelect段位リスト 段位リスト; + public CActSelect段位挑戦選択画面 段位挑戦選択画面; + public CActPlayOption actPlayOption; } diff --git a/OpenTaiko/src/Stages/05.SongSelect/AnimeBG.cs b/OpenTaiko/src/Stages/05.SongSelect/AnimeBG.cs index 4c6b3358..56e5df7f 100644 --- a/OpenTaiko/src/Stages/05.SongSelect/AnimeBG.cs +++ b/OpenTaiko/src/Stages/05.SongSelect/AnimeBG.cs @@ -1,24 +1,24 @@ using NLua; -namespace OpenTaiko { - internal class AnimeBG : ScriptBG { - private LuaFunction LuaPlayAnimation; - public AnimeBG(string filePath) : base(filePath) { - if (LuaScript != null) { - LuaPlayAnimation = LuaScript.GetFunction("playAnime"); - } - } - public new void Dispose() { - base.Dispose(); - LuaPlayAnimation?.Dispose(); - } +namespace OpenTaiko; - public void PlayAnimation() { - if (LuaScript == null) return; - try { - LuaPlayAnimation.Call(); - } catch (Exception ex) { - } +internal class AnimeBG : ScriptBG { + private LuaFunction LuaPlayAnimation; + public AnimeBG(string filePath) : base(filePath) { + if (LuaScript != null) { + LuaPlayAnimation = LuaScript.GetFunction("playAnime"); + } + } + public new void Dispose() { + base.Dispose(); + LuaPlayAnimation?.Dispose(); + } + + public void PlayAnimation() { + if (LuaScript == null) return; + try { + LuaPlayAnimation.Call(); + } catch (Exception ex) { } } } diff --git a/OpenTaiko/src/Stages/05.SongSelect/CActPlayOption.cs b/OpenTaiko/src/Stages/05.SongSelect/CActPlayOption.cs index 7b31fbde..0dcf4e1a 100644 --- a/OpenTaiko/src/Stages/05.SongSelect/CActPlayOption.cs +++ b/OpenTaiko/src/Stages/05.SongSelect/CActPlayOption.cs @@ -1,703 +1,703 @@ using System.Drawing; using FDK; -namespace OpenTaiko { - internal class CActPlayOption : CActivity { - public CActPlayOption() { - base.IsDeActivated = true; +namespace OpenTaiko; + +internal class CActPlayOption : CActivity { + public CActPlayOption() { + base.IsDeActivated = true; + } + + public override void Activate() { + if (this.IsActivated) + return; + + ctOpen = new CCounter(); + ctClose = new CCounter(); + + for (int i = 0; i < OptionType.Length; i++) + OptionType[i] = new CTexture(); + + #region [ Speed ] + + txSpeed[0] = OptionTypeTx("0.5", Color.White, Color.Black); + txSpeed[1] = OptionTypeTx("1.0", Color.White, Color.Black); + txSpeed[2] = OptionTypeTx("1.1", Color.White, Color.Black); + txSpeed[3] = OptionTypeTx("1.2", Color.White, Color.Black); + txSpeed[4] = OptionTypeTx("1.3", Color.White, Color.Black); + txSpeed[5] = OptionTypeTx("1.4", Color.White, Color.Black); + txSpeed[6] = OptionTypeTx("1.5", Color.White, Color.Black); + txSpeed[7] = OptionTypeTx("1.6", Color.White, Color.Black); + txSpeed[8] = OptionTypeTx("1.7", Color.White, Color.Black); + txSpeed[9] = OptionTypeTx("1.8", Color.White, Color.Black); + txSpeed[10] = OptionTypeTx("1.9", Color.White, Color.Black); + txSpeed[11] = OptionTypeTx("2.0", Color.White, Color.Black); + txSpeed[12] = OptionTypeTx("2.5", Color.White, Color.Black); + txSpeed[13] = OptionTypeTx("3.0", Color.White, Color.Black); + txSpeed[14] = OptionTypeTx("3.5", Color.White, Color.Black); + txSpeed[15] = OptionTypeTx("4.0", Color.White, Color.Black); + + #endregion + + for (int i = 0; i < txSongSpeed.Length; i++) { + Color _c = Color.White; + + if (i < 5) + _c = Color.LimeGreen; + else if (i > 5) + _c = Color.Red; + + txSongSpeed[i] = OptionTypeTx((0.5f + i * 0.1f).ToString("n1"), _c, Color.Black); } - public override void Activate() { - if (this.IsActivated) - return; + txSwitch[0] = OptionTypeTx(CLangManager.LangInstance.GetString("MOD_SWITCH_OFF"), Color.White, Color.Black); + txSwitch[1] = OptionTypeTx(CLangManager.LangInstance.GetString("MOD_SWITCH_ON"), Color.White, Color.Black); - ctOpen = new CCounter(); - ctClose = new CCounter(); + txRandom[0] = OptionTypeTx(CLangManager.LangInstance.GetString("MOD_NONE"), Color.White, Color.Black); + txRandom[1] = OptionTypeTx(CLangManager.LangInstance.GetString("MOD_RANDOM_SHUFFLE"), Color.White, Color.Black); + txRandom[2] = OptionTypeTx(CLangManager.LangInstance.GetString("MOD_RANDOM_CHAOS"), Color.White, Color.Black); - for (int i = 0; i < OptionType.Length; i++) - OptionType[i] = new CTexture(); + txStealth[0] = OptionTypeTx(CLangManager.LangInstance.GetString("MOD_SWITCH_OFF"), Color.White, Color.Black); + txStealth[1] = OptionTypeTx(CLangManager.LangInstance.GetString("MOD_HIDE"), Color.White, Color.Black); + txStealth[2] = OptionTypeTx(CLangManager.LangInstance.GetString("MOD_STEALTH"), Color.White, Color.Black); - #region [ Speed ] + txJust[0] = OptionTypeTx(CLangManager.LangInstance.GetString("MOD_SWITCH_OFF"), Color.White, Color.Black); + txJust[1] = OptionTypeTx(CLangManager.LangInstance.GetString("MOD_JUST"), Color.Red, Color.Black); + txJust[2] = OptionTypeTx(CLangManager.LangInstance.GetString("MOD_SAFE"), Color.LimeGreen, Color.Black); - txSpeed[0] = OptionTypeTx("0.5", Color.White, Color.Black); - txSpeed[1] = OptionTypeTx("1.0", Color.White, Color.Black); - txSpeed[2] = OptionTypeTx("1.1", Color.White, Color.Black); - txSpeed[3] = OptionTypeTx("1.2", Color.White, Color.Black); - txSpeed[4] = OptionTypeTx("1.3", Color.White, Color.Black); - txSpeed[5] = OptionTypeTx("1.4", Color.White, Color.Black); - txSpeed[6] = OptionTypeTx("1.5", Color.White, Color.Black); - txSpeed[7] = OptionTypeTx("1.6", Color.White, Color.Black); - txSpeed[8] = OptionTypeTx("1.7", Color.White, Color.Black); - txSpeed[9] = OptionTypeTx("1.8", Color.White, Color.Black); - txSpeed[10] = OptionTypeTx("1.9", Color.White, Color.Black); - txSpeed[11] = OptionTypeTx("2.0", Color.White, Color.Black); - txSpeed[12] = OptionTypeTx("2.5", Color.White, Color.Black); - txSpeed[13] = OptionTypeTx("3.0", Color.White, Color.Black); - txSpeed[14] = OptionTypeTx("3.5", Color.White, Color.Black); - txSpeed[15] = OptionTypeTx("4.0", Color.White, Color.Black); + txGameMode[0] = OptionTypeTx(CLangManager.LangInstance.GetString("MOD_NONE"), Color.White, Color.Black); + txGameMode[1] = OptionTypeTx(CLangManager.LangInstance.GetString("MOD_GAMEMODE_TRAINING"), Color.White, Color.Black); - #endregion + txGameType[0] = OptionTypeTx(CLangManager.LangInstance.GetString("MOD_GAMETYPE_TAIKO"), Color.White, Color.Black); + txGameType[1] = OptionTypeTx(CLangManager.LangInstance.GetString("MOD_GAMETYPE_KONGA"), Color.White, Color.Black); - for (int i = 0; i < txSongSpeed.Length; i++) { - Color _c = Color.White; + txFunMods[0] = OptionTypeTx(CLangManager.LangInstance.GetString("MOD_SWITCH_OFF"), Color.White, Color.Black); + txFunMods[1] = OptionTypeTx(CLangManager.LangInstance.GetString("MOD_FUN_AVALANCHE"), Color.White, Color.Black); + txFunMods[2] = OptionTypeTx(CLangManager.LangInstance.GetString("MOD_FUN_MINESWEEPER"), Color.White, Color.Black); - if (i < 5) - _c = Color.LimeGreen; - else if (i > 5) - _c = Color.Red; + txNone = OptionTypeTx(CLangManager.LangInstance.GetString("MOD_BLANK"), Color.White, Color.Black); - txSongSpeed[i] = OptionTypeTx((0.5f + i * 0.1f).ToString("n1"), _c, Color.Black); + hsInfo = OpenTaiko.Skin.hsHitSoundsInformations; + + txOtoiro = new CTexture[hsInfo.names.Length]; + + if (txOtoiro.Length > 0) { + for (int i = 0; i < txOtoiro.Length; i++) { + txOtoiro[i] = OptionTypeTx(hsInfo.names[i], Color.White, Color.Black); } - - txSwitch[0] = OptionTypeTx(CLangManager.LangInstance.GetString("MOD_SWITCH_OFF"), Color.White, Color.Black); - txSwitch[1] = OptionTypeTx(CLangManager.LangInstance.GetString("MOD_SWITCH_ON"), Color.White, Color.Black); - - txRandom[0] = OptionTypeTx(CLangManager.LangInstance.GetString("MOD_NONE"), Color.White, Color.Black); - txRandom[1] = OptionTypeTx(CLangManager.LangInstance.GetString("MOD_RANDOM_SHUFFLE"), Color.White, Color.Black); - txRandom[2] = OptionTypeTx(CLangManager.LangInstance.GetString("MOD_RANDOM_CHAOS"), Color.White, Color.Black); - - txStealth[0] = OptionTypeTx(CLangManager.LangInstance.GetString("MOD_SWITCH_OFF"), Color.White, Color.Black); - txStealth[1] = OptionTypeTx(CLangManager.LangInstance.GetString("MOD_HIDE"), Color.White, Color.Black); - txStealth[2] = OptionTypeTx(CLangManager.LangInstance.GetString("MOD_STEALTH"), Color.White, Color.Black); - - txJust[0] = OptionTypeTx(CLangManager.LangInstance.GetString("MOD_SWITCH_OFF"), Color.White, Color.Black); - txJust[1] = OptionTypeTx(CLangManager.LangInstance.GetString("MOD_JUST"), Color.Red, Color.Black); - txJust[2] = OptionTypeTx(CLangManager.LangInstance.GetString("MOD_SAFE"), Color.LimeGreen, Color.Black); - - txGameMode[0] = OptionTypeTx(CLangManager.LangInstance.GetString("MOD_NONE"), Color.White, Color.Black); - txGameMode[1] = OptionTypeTx(CLangManager.LangInstance.GetString("MOD_GAMEMODE_TRAINING"), Color.White, Color.Black); - - txGameType[0] = OptionTypeTx(CLangManager.LangInstance.GetString("MOD_GAMETYPE_TAIKO"), Color.White, Color.Black); - txGameType[1] = OptionTypeTx(CLangManager.LangInstance.GetString("MOD_GAMETYPE_KONGA"), Color.White, Color.Black); - - txFunMods[0] = OptionTypeTx(CLangManager.LangInstance.GetString("MOD_SWITCH_OFF"), Color.White, Color.Black); - txFunMods[1] = OptionTypeTx(CLangManager.LangInstance.GetString("MOD_FUN_AVALANCHE"), Color.White, Color.Black); - txFunMods[2] = OptionTypeTx(CLangManager.LangInstance.GetString("MOD_FUN_MINESWEEPER"), Color.White, Color.Black); - - txNone = OptionTypeTx(CLangManager.LangInstance.GetString("MOD_BLANK"), Color.White, Color.Black); - - hsInfo = OpenTaiko.Skin.hsHitSoundsInformations; - - txOtoiro = new CTexture[hsInfo.names.Length]; - - if (txOtoiro.Length > 0) { - for (int i = 0; i < txOtoiro.Length; i++) { - txOtoiro[i] = OptionTypeTx(hsInfo.names[i], Color.White, Color.Black); - } - } else { - txOtoiro = new CTexture[1]; - txOtoiro[0] = OptionTypeTx(CLangManager.LangInstance.GetString("MOD_BLANK"), Color.White, Color.Black); - } - - OptionType[0] = OptionTypeTx(CLangManager.LangInstance.GetString("MOD_SPEED"), Color.White, Color.Black); - OptionType[1] = OptionTypeTx(CLangManager.LangInstance.GetString("MOD_HIDE"), Color.White, Color.Black); - OptionType[2] = OptionTypeTx(CLangManager.LangInstance.GetString("MOD_FLIP"), Color.White, Color.Black); - OptionType[3] = OptionTypeTx(CLangManager.LangInstance.GetString("MOD_RANDOM"), Color.White, Color.Black); - OptionType[4] = OptionTypeTx(CLangManager.LangInstance.GetString("MOD_TIMING"), Color.White, Color.Black); - OptionType[5] = OptionTypeTx(CLangManager.LangInstance.GetString("MOD_JUSTICE"), Color.White, Color.Black); - OptionType[6] = OptionTypeTx(CLangManager.LangInstance.GetString("MOD_GAMETYPE"), Color.White, Color.Black); - OptionType[7] = OptionTypeTx(CLangManager.LangInstance.GetString("MOD_GAMEMODE"), Color.White, Color.Black); - OptionType[8] = OptionTypeTx(CLangManager.LangInstance.GetString("MOD_AUTO"), Color.White, Color.Black); - OptionType[9] = OptionTypeTx(CLangManager.LangInstance.GetString("MOD_SONGSPEED"), Color.White, Color.Black); - OptionType[10] = OptionTypeTx(CLangManager.LangInstance.GetString("MOD_HITSOUND"), Color.White, Color.Black); - OptionType[11] = OptionTypeTx(CLangManager.LangInstance.GetString("MOD_FUN"), Color.White, Color.Black); - - var _timingColors = new Color[] { Color.LimeGreen, Color.YellowGreen, Color.White, Color.Orange, Color.Red }; - for (int i = 0; i < 5; i++) { - txTiming[i] = OptionTypeTx(CLangManager.LangInstance.GetString($"MOD_TIMING{i + 1}"), _timingColors[i], Color.Black); - } - - for (int i = 0; i < OptionType.Length; i++) - OptionType[i].vcScaleRatio.X = 0.96f; - - base.Activate(); + } else { + txOtoiro = new CTexture[1]; + txOtoiro[0] = OptionTypeTx(CLangManager.LangInstance.GetString("MOD_BLANK"), Color.White, Color.Black); } - public void tFetchMults(int player) { - var scoreMult = tGetModMultiplier(EBalancingType.SCORE, true, player); - var coinMult = tGetModMultiplier(EBalancingType.COINS, true, player); - txModMults[0] = OptionTypeTx(CLangManager.LangInstance.GetString("MOD_SCOREMULTIPLY", scoreMult.ToString("n2")), Color.White, Color.Black); - txModMults[1] = OptionTypeTx(CLangManager.LangInstance.GetString("MOD_COINMULTIPLY", coinMult.ToString("n2")), Color.White, Color.Black); + OptionType[0] = OptionTypeTx(CLangManager.LangInstance.GetString("MOD_SPEED"), Color.White, Color.Black); + OptionType[1] = OptionTypeTx(CLangManager.LangInstance.GetString("MOD_HIDE"), Color.White, Color.Black); + OptionType[2] = OptionTypeTx(CLangManager.LangInstance.GetString("MOD_FLIP"), Color.White, Color.Black); + OptionType[3] = OptionTypeTx(CLangManager.LangInstance.GetString("MOD_RANDOM"), Color.White, Color.Black); + OptionType[4] = OptionTypeTx(CLangManager.LangInstance.GetString("MOD_TIMING"), Color.White, Color.Black); + OptionType[5] = OptionTypeTx(CLangManager.LangInstance.GetString("MOD_JUSTICE"), Color.White, Color.Black); + OptionType[6] = OptionTypeTx(CLangManager.LangInstance.GetString("MOD_GAMETYPE"), Color.White, Color.Black); + OptionType[7] = OptionTypeTx(CLangManager.LangInstance.GetString("MOD_GAMEMODE"), Color.White, Color.Black); + OptionType[8] = OptionTypeTx(CLangManager.LangInstance.GetString("MOD_AUTO"), Color.White, Color.Black); + OptionType[9] = OptionTypeTx(CLangManager.LangInstance.GetString("MOD_SONGSPEED"), Color.White, Color.Black); + OptionType[10] = OptionTypeTx(CLangManager.LangInstance.GetString("MOD_HITSOUND"), Color.White, Color.Black); + OptionType[11] = OptionTypeTx(CLangManager.LangInstance.GetString("MOD_FUN"), Color.White, Color.Black); + + var _timingColors = new Color[] { Color.LimeGreen, Color.YellowGreen, Color.White, Color.Orange, Color.Red }; + for (int i = 0; i < 5; i++) { + txTiming[i] = OptionTypeTx(CLangManager.LangInstance.GetString($"MOD_TIMING{i + 1}"), _timingColors[i], Color.Black); } - public override void DeActivate() { - base.DeActivate(); - } - public override void CreateManagedResource() { - OptionFont = HPrivateFastFont.tInstantiateMainFont(OpenTaiko.Skin.SongSelect_Option_Font_Scale); + for (int i = 0; i < OptionType.Length; i++) + OptionType[i].vcScaleRatio.X = 0.96f; - base.CreateManagedResource(); - } - public override void ReleaseManagedResource() { - OptionFont.Dispose(); + base.Activate(); + } + + public void tFetchMults(int player) { + var scoreMult = tGetModMultiplier(EBalancingType.SCORE, true, player); + var coinMult = tGetModMultiplier(EBalancingType.COINS, true, player); + txModMults[0] = OptionTypeTx(CLangManager.LangInstance.GetString("MOD_SCOREMULTIPLY", scoreMult.ToString("n2")), Color.White, Color.Black); + txModMults[1] = OptionTypeTx(CLangManager.LangInstance.GetString("MOD_COINMULTIPLY", coinMult.ToString("n2")), Color.White, Color.Black); + } + + public override void DeActivate() { + base.DeActivate(); + } + public override void CreateManagedResource() { + OptionFont = HPrivateFastFont.tInstantiateMainFont(OpenTaiko.Skin.SongSelect_Option_Font_Scale); + + base.CreateManagedResource(); + } + public override void ReleaseManagedResource() { + OptionFont.Dispose(); - base.ReleaseManagedResource(); + base.ReleaseManagedResource(); + } + + + + public int On進行描画(int player) { + if (this.IsDeActivated) + return 0; + + if (ctOpen.CurrentValue == 0) + Init(player); + + ctOpen.Tick(); + ctClose.Tick(); + + if (!ctOpen.IsTicked) ctOpen.Start(0, 50, 6, OpenTaiko.Timer); + + var act難易度 = OpenTaiko.stageSongSelect.actDifficultySelectionScreen; + var danAct = OpenTaiko.stage段位選択.段位挑戦選択画面; + + #region [ Open & Close ] + + float oy1 = ctOpen.CurrentValue * 18; + float oy2 = (ctOpen.CurrentValue - 30) * 4; + float oy3 = ctOpen.CurrentValue < 30 ? 410 - oy1 : -80 + oy2; + + float cy1 = ctClose.CurrentValue * 3; + float cy2 = (ctClose.CurrentValue - 20) * 16; + float cy3 = ctClose.CurrentValue < 20 ? 0 - cy1 : 20 + cy2; + + float y = oy3 + cy3; + + #endregion + + + + + var _textures = new CTexture[] + { + txSpeed[nSpeedCount], + txStealth[nStealth], + txSwitch[nAbekobe], + txRandom[nRandom], + txTiming[nTiming], + txJust[nJust], + txGameType[nGameType], + txGameMode[nGameMode], + txSwitch[nAutoMode], + txSongSpeed[nSongSpeed], + txOtoiro[nOtoiro], + txFunMods[nFunMods], + }; + + var pos = player % 2; + var _shift = pos == 1 ? (OpenTaiko.Tx.Difficulty_Option.szTextureSize.Width / 2) : 0; + var _rect = new Rectangle(_shift, 0, OpenTaiko.Tx.Difficulty_Option.szTextureSize.Width / 2, OpenTaiko.Tx.Difficulty_Option.szTextureSize.Height); + + OpenTaiko.Tx.Difficulty_Option.t2D描画(_shift, y, _rect); + OpenTaiko.Tx.Difficulty_Option_Select.t2D描画(_shift + OpenTaiko.Skin.SongSelect_Option_Select_Offset[0] + NowCount * OpenTaiko.Skin.SongSelect_Option_Interval[0], + OpenTaiko.Skin.SongSelect_Option_Select_Offset[1] + y + NowCount * OpenTaiko.Skin.SongSelect_Option_Interval[1], _rect); + + for (int i = 0; i < OptionType.Length; i++) { + OptionType[i].t2D描画(OpenTaiko.Skin.SongSelect_Option_OptionType_X[pos] + i * OpenTaiko.Skin.SongSelect_Option_Interval[0], + OpenTaiko.Skin.SongSelect_Option_OptionType_Y[pos] + y + i * OpenTaiko.Skin.SongSelect_Option_Interval[1]); } + txModMults[0]?.t2D拡大率考慮描画(CTexture.RefPnt.Up, OpenTaiko.Skin.SongSelect_Option_ModMults1_X[pos], OpenTaiko.Skin.SongSelect_Option_ModMults1_Y[pos] + y); + txModMults[1]?.t2D拡大率考慮描画(CTexture.RefPnt.Up, OpenTaiko.Skin.SongSelect_Option_ModMults2_X[pos], OpenTaiko.Skin.SongSelect_Option_ModMults2_Y[pos] + y); + for (int i = 0; i < _textures.Length; i++) { + _textures[i]?.t2D拡大率考慮描画(CTexture.RefPnt.Up, OpenTaiko.Skin.SongSelect_Option_Value_X[pos] + i * OpenTaiko.Skin.SongSelect_Option_Interval[0], + OpenTaiko.Skin.SongSelect_Option_Value_Y[pos] + y + i * OpenTaiko.Skin.SongSelect_Option_Interval[1]); + } - public int On進行描画(int player) { - if (this.IsDeActivated) - return 0; + if (ctClose.CurrentValue >= 50) { + Decision(player); + NowCount = 0; + ctOpen.Stop(); + ctOpen.CurrentValue = 0; + ctClose.Stop(); + ctClose.CurrentValue = 0; + bEnd = false; + act難易度.bOption[player] = false; + danAct.bOption = false; + } - if (ctOpen.CurrentValue == 0) - Init(player); + #region [ Inputs ] - ctOpen.Tick(); - ctClose.Tick(); + if (!ctClose.IsTicked) { + bool _leftDrum = false; - if (!ctOpen.IsTicked) ctOpen.Start(0, 50, 6, OpenTaiko.Timer); + bool _rightDrum = false; - var act難易度 = OpenTaiko.stageSongSelect.actDifficultySelectionScreen; - var danAct = OpenTaiko.stage段位選択.段位挑戦選択画面; + bool _centerDrum = false; - #region [ Open & Close ] + bool _cancel = false; - float oy1 = ctOpen.CurrentValue * 18; - float oy2 = (ctOpen.CurrentValue - 30) * 4; - float oy3 = ctOpen.CurrentValue < 30 ? 410 - oy1 : -80 + oy2; - - float cy1 = ctClose.CurrentValue * 3; - float cy2 = (ctClose.CurrentValue - 20) * 16; - float cy3 = ctClose.CurrentValue < 20 ? 0 - cy1 : 20 + cy2; - - float y = oy3 + cy3; - - #endregion - - - - - var _textures = new CTexture[] - { - txSpeed[nSpeedCount], - txStealth[nStealth], - txSwitch[nAbekobe], - txRandom[nRandom], - txTiming[nTiming], - txJust[nJust], - txGameType[nGameType], - txGameMode[nGameMode], - txSwitch[nAutoMode], - txSongSpeed[nSongSpeed], - txOtoiro[nOtoiro], - txFunMods[nFunMods], - }; - - var pos = player % 2; - var _shift = pos == 1 ? (OpenTaiko.Tx.Difficulty_Option.szTextureSize.Width / 2) : 0; - var _rect = new Rectangle(_shift, 0, OpenTaiko.Tx.Difficulty_Option.szTextureSize.Width / 2, OpenTaiko.Tx.Difficulty_Option.szTextureSize.Height); - - OpenTaiko.Tx.Difficulty_Option.t2D描画(_shift, y, _rect); - OpenTaiko.Tx.Difficulty_Option_Select.t2D描画(_shift + OpenTaiko.Skin.SongSelect_Option_Select_Offset[0] + NowCount * OpenTaiko.Skin.SongSelect_Option_Interval[0], - OpenTaiko.Skin.SongSelect_Option_Select_Offset[1] + y + NowCount * OpenTaiko.Skin.SongSelect_Option_Interval[1], _rect); - - for (int i = 0; i < OptionType.Length; i++) { - OptionType[i].t2D描画(OpenTaiko.Skin.SongSelect_Option_OptionType_X[pos] + i * OpenTaiko.Skin.SongSelect_Option_Interval[0], - OpenTaiko.Skin.SongSelect_Option_OptionType_Y[pos] + y + i * OpenTaiko.Skin.SongSelect_Option_Interval[1]); + switch (player) { + case 0: + _rightDrum = (OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.RightChange) || OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.RightArrow)); + _leftDrum = (OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.LeftChange) || OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.LeftArrow)); + _centerDrum = (OpenTaiko.Pad.bPressedDGB(EPad.Decide) || + (OpenTaiko.ConfigIni.bEnterIsNotUsedInKeyAssignments && OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Return))); + _cancel = (OpenTaiko.Pad.bPressedDGB(EPad.Cancel) || OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Escape)); + break; + case 1: + _rightDrum = (OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.RBlue2P)); + _leftDrum = (OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.LBlue2P)); + _centerDrum = (OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.LRed2P) || OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.RRed2P)); + break; + case 2: + _rightDrum = (OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.RBlue3P)); + _leftDrum = (OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.LBlue3P)); + _centerDrum = (OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.LRed3P) || OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.RRed3P)); + break; + case 3: + _rightDrum = (OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.RBlue4P)); + _leftDrum = (OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.LBlue4P)); + _centerDrum = (OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.LRed4P) || OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.RRed4P)); + break; + case 4: + _rightDrum = (OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.RBlue5P)); + _leftDrum = (OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.LBlue5P)); + _centerDrum = (OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.LRed5P) || OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.RRed5P)); + break; } - txModMults[0]?.t2D拡大率考慮描画(CTexture.RefPnt.Up, OpenTaiko.Skin.SongSelect_Option_ModMults1_X[pos], OpenTaiko.Skin.SongSelect_Option_ModMults1_Y[pos] + y); - txModMults[1]?.t2D拡大率考慮描画(CTexture.RefPnt.Up, OpenTaiko.Skin.SongSelect_Option_ModMults2_X[pos], OpenTaiko.Skin.SongSelect_Option_ModMults2_Y[pos] + y); - for (int i = 0; i < _textures.Length; i++) { - _textures[i]?.t2D拡大率考慮描画(CTexture.RefPnt.Up, OpenTaiko.Skin.SongSelect_Option_Value_X[pos] + i * OpenTaiko.Skin.SongSelect_Option_Interval[0], - OpenTaiko.Skin.SongSelect_Option_Value_Y[pos] + y + i * OpenTaiko.Skin.SongSelect_Option_Interval[1]); + if (_leftDrum || OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.LeftArrow)) { + OptionSelect(true); + tFetchMults(player); + OpenTaiko.Skin.soundChangeSFX.tPlay(); } - if (ctClose.CurrentValue >= 50) { - Decision(player); - NowCount = 0; - ctOpen.Stop(); - ctOpen.CurrentValue = 0; - ctClose.Stop(); - ctClose.CurrentValue = 0; - bEnd = false; - act難易度.bOption[player] = false; - danAct.bOption = false; + if (_rightDrum || OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.RightArrow)) { + OptionSelect(false); + tFetchMults(player); + OpenTaiko.Skin.soundChangeSFX.tPlay(); } - #region [ Inputs ] - - if (!ctClose.IsTicked) { - bool _leftDrum = false; - - bool _rightDrum = false; - - bool _centerDrum = false; - - bool _cancel = false; - - switch (player) { - case 0: - _rightDrum = (OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.RightChange) || OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.RightArrow)); - _leftDrum = (OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.LeftChange) || OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.LeftArrow)); - _centerDrum = (OpenTaiko.Pad.bPressedDGB(EPad.Decide) || - (OpenTaiko.ConfigIni.bEnterIsNotUsedInKeyAssignments && OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Return))); - _cancel = (OpenTaiko.Pad.bPressedDGB(EPad.Cancel) || OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Escape)); - break; - case 1: - _rightDrum = (OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.RBlue2P)); - _leftDrum = (OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.LBlue2P)); - _centerDrum = (OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.LRed2P) || OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.RRed2P)); - break; - case 2: - _rightDrum = (OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.RBlue3P)); - _leftDrum = (OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.LBlue3P)); - _centerDrum = (OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.LRed3P) || OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.RRed3P)); - break; - case 3: - _rightDrum = (OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.RBlue4P)); - _leftDrum = (OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.LBlue4P)); - _centerDrum = (OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.LRed4P) || OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.RRed4P)); - break; - case 4: - _rightDrum = (OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.RBlue5P)); - _leftDrum = (OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.LBlue5P)); - _centerDrum = (OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.LRed5P) || OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.RRed5P)); - break; - } - - - if (_leftDrum || OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.LeftArrow)) { - OptionSelect(true); - tFetchMults(player); - OpenTaiko.Skin.soundChangeSFX.tPlay(); - } - - if (_rightDrum || OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.RightArrow)) { - OptionSelect(false); - tFetchMults(player); - OpenTaiko.Skin.soundChangeSFX.tPlay(); - } - - if (_centerDrum && ctOpen.CurrentValue >= ctOpen.EndValue) { - OpenTaiko.Skin.soundDecideSFX.tPlay(); - if (NowCount < nOptionCount) { - NowCount++; - } else if (NowCount >= nOptionCount && !bEnd) { - bEnd = true; - ctClose.Start(0, 50, 6, OpenTaiko.Timer); - } - } - - int cp1 = nOptionCount + 1; - - if (OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.UpArrow)) { - OpenTaiko.Skin.soundChangeSFX.tPlay(); - NowCount = (NowCount + cp1 - 1) % cp1; - } - - if (OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.DownArrow)) { - OpenTaiko.Skin.soundChangeSFX.tPlay(); - NowCount = (NowCount + 1) % cp1; - } - - if (OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Escape)) { - OpenTaiko.Skin.soundDecideSFX.tPlay(); + if (_centerDrum && ctOpen.CurrentValue >= ctOpen.EndValue) { + OpenTaiko.Skin.soundDecideSFX.tPlay(); + if (NowCount < nOptionCount) { + NowCount++; + } else if (NowCount >= nOptionCount && !bEnd) { bEnd = true; ctClose.Start(0, 50, 6, OpenTaiko.Timer); } } + int cp1 = nOptionCount + 1; - #endregion + if (OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.UpArrow)) { + OpenTaiko.Skin.soundChangeSFX.tPlay(); + NowCount = (NowCount + cp1 - 1) % cp1; + } - return 0; - } - private CCachedFontRenderer OptionFont; + if (OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.DownArrow)) { + OpenTaiko.Skin.soundChangeSFX.tPlay(); + NowCount = (NowCount + 1) % cp1; + } - public int nOptionCount = 11; - - public CCounter ctOpen; - public CCounter ctClose; - public CTexture[] OptionType = new CTexture[12]; - - public int NowCount; - public int[] NowCountType = new int[8]; - - public bool bEnd; - - public CTexture[] txSpeed = new CTexture[16]; - public int nSpeedCount = 1; - - public CTexture[] txStealth = new CTexture[3]; - public int nStealth = 0; - public int nAbekobe = 0; - - public CTexture[] txRandom = new CTexture[3]; - public int nRandom = 0; - - public CTexture[] txGameMode = new CTexture[2]; - public int nGameMode; - - public CTexture[] txAutoMode = new CTexture[2]; - public int nAutoMode = 0; - public CTexture txNone = new CTexture(); - - public CTexture[] txSwitch = new CTexture[2]; - - public CTexture[] txTiming = new CTexture[5]; - public int nTiming = 2; - - public CTexture[] txJust = new CTexture[3]; - public int nJust = 0; - - public CTexture[] txOtoiro; - public CHitSounds hsInfo; - public int nOtoiro = 0; - - public CTexture[] txSongSpeed = new CTexture[16]; - public int nSongSpeed = 5; - - public CTexture[] txGameType = new CTexture[2]; - public int nGameType = 0; - - public CTexture[] txFunMods = new CTexture[3]; - public int nFunMods = 0; - - public CTexture[] txModMults = new CTexture[2]; - - public CTexture OptionTypeTx(string str文字, Color forecolor, Color backcolor) { - using (var bmp = OptionFont.DrawText(str文字, forecolor, backcolor, null, 30)) { - return OpenTaiko.tテクスチャの生成(bmp); + if (OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Escape)) { + OpenTaiko.Skin.soundDecideSFX.tPlay(); + bEnd = true; + ctClose.Start(0, 50, 6, OpenTaiko.Timer); } } - private void ShiftVal(bool left, ref int value, int capUp, int capDown) { - if (left) { - if (value > capDown) value--; - else value = capUp; - } else { - if (value < capUp) value++; - else value = capDown; - } + + #endregion + + return 0; + } + private CCachedFontRenderer OptionFont; + + public int nOptionCount = 11; + + public CCounter ctOpen; + public CCounter ctClose; + public CTexture[] OptionType = new CTexture[12]; + + public int NowCount; + public int[] NowCountType = new int[8]; + + public bool bEnd; + + public CTexture[] txSpeed = new CTexture[16]; + public int nSpeedCount = 1; + + public CTexture[] txStealth = new CTexture[3]; + public int nStealth = 0; + public int nAbekobe = 0; + + public CTexture[] txRandom = new CTexture[3]; + public int nRandom = 0; + + public CTexture[] txGameMode = new CTexture[2]; + public int nGameMode; + + public CTexture[] txAutoMode = new CTexture[2]; + public int nAutoMode = 0; + public CTexture txNone = new CTexture(); + + public CTexture[] txSwitch = new CTexture[2]; + + public CTexture[] txTiming = new CTexture[5]; + public int nTiming = 2; + + public CTexture[] txJust = new CTexture[3]; + public int nJust = 0; + + public CTexture[] txOtoiro; + public CHitSounds hsInfo; + public int nOtoiro = 0; + + public CTexture[] txSongSpeed = new CTexture[16]; + public int nSongSpeed = 5; + + public CTexture[] txGameType = new CTexture[2]; + public int nGameType = 0; + + public CTexture[] txFunMods = new CTexture[3]; + public int nFunMods = 0; + + public CTexture[] txModMults = new CTexture[2]; + + public CTexture OptionTypeTx(string str文字, Color forecolor, Color backcolor) { + using (var bmp = OptionFont.DrawText(str文字, forecolor, backcolor, null, 30)) { + return OpenTaiko.tテクスチャの生成(bmp); } + } - public void OptionSelect(bool left) { - switch (NowCount) { - case 0: - ShiftVal(left, ref nSpeedCount, 15, 0); - break; - case 1: - ShiftVal(left, ref nStealth, 2, 0); - break; - case 2: - if (nAbekobe == 0) nAbekobe = 1; - else nAbekobe = 0; - break; - case 3: - ShiftVal(left, ref nRandom, 2, 0); - break; - case 4: - ShiftVal(left, ref nTiming, 4, 0); - break; - case 5: - ShiftVal(left, ref nJust, 2, 0); - break; - case 6: - ShiftVal(left, ref nGameType, 1, 0); - break; - case 7: - if (nGameMode == 0) nGameMode = 1; - else nGameMode = 0; - break; - case 8: - if (nAutoMode == 0) nAutoMode = 1; - else nAutoMode = 0; - break; - case 9: - ShiftVal(left, ref nSongSpeed, txSongSpeed.Length - 1, 0); - break; - case 10: - ShiftVal(left, ref nOtoiro, txOtoiro.Length - 1, 0); - break; - case 11: - ShiftVal(left, ref nFunMods, txFunMods.Length - 1, 0); - break; - } + private void ShiftVal(bool left, ref int value, int capUp, int capDown) { + if (left) { + if (value > capDown) value--; + else value = capUp; + } else { + if (value < capUp) value++; + else value = capDown; } + } - public void Init(int player) { - int actual = OpenTaiko.GetActualPlayer(player); - - #region [ Speed ] - - int speed = OpenTaiko.ConfigIni.nScrollSpeed[actual]; - - if (speed <= 8) - nSpeedCount = 0; - else if (speed <= 19) - nSpeedCount = speed - 8; - else if (speed <= 24) - nSpeedCount = 12; - else if (speed <= 29) - nSpeedCount = 13; - else if (speed <= 34) - nSpeedCount = 14; - else - nSpeedCount = 15; - - #endregion - - #region [ Doron ] - - nStealth = (int)OpenTaiko.ConfigIni.eSTEALTH[actual]; - - #endregion - - #region [ Random ] - - var rand_ = OpenTaiko.ConfigIni.eRandom[actual]; - - if (rand_ == ERandomMode.MirrorRandom) { - nRandom = 2; - nAbekobe = 1; - } else if (rand_ == ERandomMode.SuperRandom) { - nRandom = 2; - nAbekobe = 0; - } else if (rand_ == ERandomMode.Random) { - nRandom = 1; - nAbekobe = 0; - } else if (rand_ == ERandomMode.Mirror) { - nRandom = 0; - nAbekobe = 1; - } else if (rand_ == ERandomMode.Off) { - nRandom = 0; - nAbekobe = 0; - } - - #endregion - - #region [ Timing ] - - nTiming = OpenTaiko.ConfigIni.nTimingZones[actual]; - - #endregion - - #region [Just] - - nJust = OpenTaiko.ConfigIni.bJust[actual]; - - #endregion - - #region [GameType] - - nGameType = (int)OpenTaiko.ConfigIni.nGameType[actual]; - - #endregion - - #region [Fun mods] - - nFunMods = (int)OpenTaiko.ConfigIni.nFunMods[actual]; - - #endregion - - #region [ GameMode ] - - if (OpenTaiko.ConfigIni.bTokkunMode == true) - nGameMode = 1; - else - nGameMode = 0; - - #endregion - - #region [ AutoMode ] - - bool _auto = OpenTaiko.ConfigIni.bAutoPlay[player]; - - if (_auto == true) - nAutoMode = 1; - else - nAutoMode = 0; - - #endregion - - #region [ Hitsounds ] - - nOtoiro = Math.Min(txOtoiro.Length - 1, OpenTaiko.ConfigIni.nHitSounds[actual]); - - #endregion - - #region [ Song speed ] - - nSongSpeed = Math.Max(0, Math.Min(txSongSpeed.Length - 1, (OpenTaiko.ConfigIni.nSongSpeed / 2) - 5)); - - #endregion - - tFetchMults(player); - + public void OptionSelect(bool left) { + switch (NowCount) { + case 0: + ShiftVal(left, ref nSpeedCount, 15, 0); + break; + case 1: + ShiftVal(left, ref nStealth, 2, 0); + break; + case 2: + if (nAbekobe == 0) nAbekobe = 1; + else nAbekobe = 0; + break; + case 3: + ShiftVal(left, ref nRandom, 2, 0); + break; + case 4: + ShiftVal(left, ref nTiming, 4, 0); + break; + case 5: + ShiftVal(left, ref nJust, 2, 0); + break; + case 6: + ShiftVal(left, ref nGameType, 1, 0); + break; + case 7: + if (nGameMode == 0) nGameMode = 1; + else nGameMode = 0; + break; + case 8: + if (nAutoMode == 0) nAutoMode = 1; + else nAutoMode = 0; + break; + case 9: + ShiftVal(left, ref nSongSpeed, txSongSpeed.Length - 1, 0); + break; + case 10: + ShiftVal(left, ref nOtoiro, txOtoiro.Length - 1, 0); + break; + case 11: + ShiftVal(left, ref nFunMods, txFunMods.Length - 1, 0); + break; } + } - public void Decision(int player) { - int actual = OpenTaiko.GetActualPlayer(player); + public void Init(int player) { + int actual = OpenTaiko.GetActualPlayer(player); - #region [ Speed ] + #region [ Speed ] - if (nSpeedCount == 0) { - OpenTaiko.ConfigIni.nScrollSpeed[actual] = 4; - } else if (nSpeedCount > 0 && nSpeedCount <= 11) { - OpenTaiko.ConfigIni.nScrollSpeed[actual] = nSpeedCount + 8; - } else if (nSpeedCount == 12) { - OpenTaiko.ConfigIni.nScrollSpeed[actual] = 24; - } else if (nSpeedCount == 13) { - OpenTaiko.ConfigIni.nScrollSpeed[actual] = 29; - } else if (nSpeedCount == 14) { - OpenTaiko.ConfigIni.nScrollSpeed[actual] = 34; - } else if (nSpeedCount == 15) { - OpenTaiko.ConfigIni.nScrollSpeed[actual] = 39; - } + int speed = OpenTaiko.ConfigIni.nScrollSpeed[actual]; - #endregion + if (speed <= 8) + nSpeedCount = 0; + else if (speed <= 19) + nSpeedCount = speed - 8; + else if (speed <= 24) + nSpeedCount = 12; + else if (speed <= 29) + nSpeedCount = 13; + else if (speed <= 34) + nSpeedCount = 14; + else + nSpeedCount = 15; - #region [ Doron ] + #endregion - OpenTaiko.ConfigIni.eSTEALTH[actual] = (EStealthMode)nStealth; + #region [ Doron ] - #endregion + nStealth = (int)OpenTaiko.ConfigIni.eSTEALTH[actual]; - #region [ Random ] + #endregion - if (nRandom == 2 && nAbekobe == 1) { - OpenTaiko.ConfigIni.eRandom[actual] = ERandomMode.MirrorRandom; - } else if (nRandom == 2 && nAbekobe == 0) { - OpenTaiko.ConfigIni.eRandom[actual] = ERandomMode.SuperRandom; - } else if (nRandom == 1 && nAbekobe == 1) { - OpenTaiko.ConfigIni.eRandom[actual] = ERandomMode.Random; - } else if (nRandom == 1 && nAbekobe == 0) { - OpenTaiko.ConfigIni.eRandom[actual] = ERandomMode.Random; - } else if (nRandom == 0 && nAbekobe == 1) { - OpenTaiko.ConfigIni.eRandom[actual] = ERandomMode.Mirror; - } else if (nRandom == 0 && nAbekobe == 0) { - OpenTaiko.ConfigIni.eRandom[actual] = ERandomMode.Off; - } + #region [ Random ] - #endregion + var rand_ = OpenTaiko.ConfigIni.eRandom[actual]; - #region [ Timing ] - - OpenTaiko.ConfigIni.nTimingZones[actual] = nTiming; - - #endregion - - #region [Just] - - OpenTaiko.ConfigIni.bJust[actual] = nJust; - - #endregion - - #region [GameType] - - OpenTaiko.ConfigIni.nGameType[actual] = (EGameType)nGameType; - - #endregion - - #region [Fun mods] - - OpenTaiko.ConfigIni.nFunMods[actual] = (EFunMods)nFunMods; - - #endregion - - #region [ GameMode ] - - if (nGameMode == 0) { - OpenTaiko.ConfigIni.bTokkunMode = false; - } else { - OpenTaiko.ConfigIni.bTokkunMode = true; - } - - #endregion - - #region [ AutoMode ] - - if (nAutoMode == 1) { - OpenTaiko.ConfigIni.bAutoPlay[player] = true; - } else { - OpenTaiko.ConfigIni.bAutoPlay[player] = false; - } - - #endregion - - #region [ Hitsounds ] - - OpenTaiko.ConfigIni.nHitSounds[actual] = nOtoiro; - hsInfo.tReloadHitSounds(nOtoiro, actual); - - #endregion - - #region [ Song speed ] - - OpenTaiko.ConfigIni.nSongSpeed = (nSongSpeed + 5) * 2; - - #endregion - } - - #region [ Balancing functions ] - - public float tGetScrollSpeedFactor(EBalancingType ebt = EBalancingType.SCORE, bool isMenu = false, int actual = 0) { - var _compare = (isMenu) ? nSpeedCount != 1 : OpenTaiko.ConfigIni.nScrollSpeed[actual] != 9; - - if (ebt == EBalancingType.SCORE) - return (_compare) ? 0.9f : 1f; - return 1f; - } - - public float tGetSongSpeedFactor(EBalancingType ebt = EBalancingType.SCORE, bool isMenu = false, int actual = 0) { - var _compare = ((isMenu) ? (nSongSpeed + 5) * 2 : OpenTaiko.ConfigIni.nSongSpeed) / 20f; - - if (ebt == EBalancingType.SCORE || _compare <= 1f) - return Math.Min(1f, (float)Math.Pow(_compare, 1.3)); - return Math.Max(1f, (float)Math.Pow(_compare, 0.7)); - } - - public float tGetJustFactor(EBalancingType ebt = EBalancingType.SCORE, bool isMenu = false, int actual = 0) { - var _compare = (isMenu) ? nJust : OpenTaiko.ConfigIni.bJust[actual]; - - if (ebt == EBalancingType.SCORE) - return (_compare == 2) ? 0.6f : 1f; - - return (_compare > 0) ? ((_compare > 1) ? 0.5f : 1.3f) : 1f; - } - - public float tGetTimingFactor(EBalancingType ebt = EBalancingType.SCORE, bool isMenu = false, int actual = 0) { - var _compare = (isMenu) ? nTiming - 2 : OpenTaiko.ConfigIni.nTimingZones[actual] - 2; - - if (ebt == EBalancingType.SCORE) - return (_compare < 0) ? (1f + 0.2f * _compare) : 1f; - - return 1f + 0.2f * _compare; - } - - public float tGetDoronFactor(EBalancingType ebt = EBalancingType.SCORE, bool isMenu = false, int actual = 0) { - var _compare = (isMenu) ? nStealth : (int)OpenTaiko.ConfigIni.eSTEALTH[actual]; - - if (ebt == EBalancingType.SCORE || _compare == 0) - return 1f; - - // Doron : x1.1 coins, Stealth : x1.4 coins - return 1f + 0.1f * (float)Math.Pow(_compare, 2); - } - - public float tGetModMultiplier(EBalancingType ebt = EBalancingType.SCORE, bool isMenu = false, int player = 0) { - float factor = 1f; - int actual = OpenTaiko.GetActualPlayer(player); - - //factor *= tGetScrollSpeedFactor(ebt, isMenu, actual); - factor *= tGetSongSpeedFactor(ebt, isMenu, actual); - factor *= tGetJustFactor(ebt, isMenu, actual); - factor *= tGetTimingFactor(ebt, isMenu, actual); - factor *= tGetDoronFactor(ebt, isMenu, actual); - - return ebt == EBalancingType.SCORE ? Math.Min(factor, 1f) : factor; - } - - public enum EBalancingType { - SCORE, - COINS + if (rand_ == ERandomMode.MirrorRandom) { + nRandom = 2; + nAbekobe = 1; + } else if (rand_ == ERandomMode.SuperRandom) { + nRandom = 2; + nAbekobe = 0; + } else if (rand_ == ERandomMode.Random) { + nRandom = 1; + nAbekobe = 0; + } else if (rand_ == ERandomMode.Mirror) { + nRandom = 0; + nAbekobe = 1; + } else if (rand_ == ERandomMode.Off) { + nRandom = 0; + nAbekobe = 0; } #endregion + #region [ Timing ] + + nTiming = OpenTaiko.ConfigIni.nTimingZones[actual]; + + #endregion + + #region [Just] + + nJust = OpenTaiko.ConfigIni.bJust[actual]; + + #endregion + + #region [GameType] + + nGameType = (int)OpenTaiko.ConfigIni.nGameType[actual]; + + #endregion + + #region [Fun mods] + + nFunMods = (int)OpenTaiko.ConfigIni.nFunMods[actual]; + + #endregion + + #region [ GameMode ] + + if (OpenTaiko.ConfigIni.bTokkunMode == true) + nGameMode = 1; + else + nGameMode = 0; + + #endregion + + #region [ AutoMode ] + + bool _auto = OpenTaiko.ConfigIni.bAutoPlay[player]; + + if (_auto == true) + nAutoMode = 1; + else + nAutoMode = 0; + + #endregion + + #region [ Hitsounds ] + + nOtoiro = Math.Min(txOtoiro.Length - 1, OpenTaiko.ConfigIni.nHitSounds[actual]); + + #endregion + + #region [ Song speed ] + + nSongSpeed = Math.Max(0, Math.Min(txSongSpeed.Length - 1, (OpenTaiko.ConfigIni.nSongSpeed / 2) - 5)); + + #endregion + + tFetchMults(player); + } + + public void Decision(int player) { + int actual = OpenTaiko.GetActualPlayer(player); + + #region [ Speed ] + + if (nSpeedCount == 0) { + OpenTaiko.ConfigIni.nScrollSpeed[actual] = 4; + } else if (nSpeedCount > 0 && nSpeedCount <= 11) { + OpenTaiko.ConfigIni.nScrollSpeed[actual] = nSpeedCount + 8; + } else if (nSpeedCount == 12) { + OpenTaiko.ConfigIni.nScrollSpeed[actual] = 24; + } else if (nSpeedCount == 13) { + OpenTaiko.ConfigIni.nScrollSpeed[actual] = 29; + } else if (nSpeedCount == 14) { + OpenTaiko.ConfigIni.nScrollSpeed[actual] = 34; + } else if (nSpeedCount == 15) { + OpenTaiko.ConfigIni.nScrollSpeed[actual] = 39; + } + + #endregion + + #region [ Doron ] + + OpenTaiko.ConfigIni.eSTEALTH[actual] = (EStealthMode)nStealth; + + #endregion + + #region [ Random ] + + if (nRandom == 2 && nAbekobe == 1) { + OpenTaiko.ConfigIni.eRandom[actual] = ERandomMode.MirrorRandom; + } else if (nRandom == 2 && nAbekobe == 0) { + OpenTaiko.ConfigIni.eRandom[actual] = ERandomMode.SuperRandom; + } else if (nRandom == 1 && nAbekobe == 1) { + OpenTaiko.ConfigIni.eRandom[actual] = ERandomMode.Random; + } else if (nRandom == 1 && nAbekobe == 0) { + OpenTaiko.ConfigIni.eRandom[actual] = ERandomMode.Random; + } else if (nRandom == 0 && nAbekobe == 1) { + OpenTaiko.ConfigIni.eRandom[actual] = ERandomMode.Mirror; + } else if (nRandom == 0 && nAbekobe == 0) { + OpenTaiko.ConfigIni.eRandom[actual] = ERandomMode.Off; + } + + #endregion + + #region [ Timing ] + + OpenTaiko.ConfigIni.nTimingZones[actual] = nTiming; + + #endregion + + #region [Just] + + OpenTaiko.ConfigIni.bJust[actual] = nJust; + + #endregion + + #region [GameType] + + OpenTaiko.ConfigIni.nGameType[actual] = (EGameType)nGameType; + + #endregion + + #region [Fun mods] + + OpenTaiko.ConfigIni.nFunMods[actual] = (EFunMods)nFunMods; + + #endregion + + #region [ GameMode ] + + if (nGameMode == 0) { + OpenTaiko.ConfigIni.bTokkunMode = false; + } else { + OpenTaiko.ConfigIni.bTokkunMode = true; + } + + #endregion + + #region [ AutoMode ] + + if (nAutoMode == 1) { + OpenTaiko.ConfigIni.bAutoPlay[player] = true; + } else { + OpenTaiko.ConfigIni.bAutoPlay[player] = false; + } + + #endregion + + #region [ Hitsounds ] + + OpenTaiko.ConfigIni.nHitSounds[actual] = nOtoiro; + hsInfo.tReloadHitSounds(nOtoiro, actual); + + #endregion + + #region [ Song speed ] + + OpenTaiko.ConfigIni.nSongSpeed = (nSongSpeed + 5) * 2; + + #endregion + } + + #region [ Balancing functions ] + + public float tGetScrollSpeedFactor(EBalancingType ebt = EBalancingType.SCORE, bool isMenu = false, int actual = 0) { + var _compare = (isMenu) ? nSpeedCount != 1 : OpenTaiko.ConfigIni.nScrollSpeed[actual] != 9; + + if (ebt == EBalancingType.SCORE) + return (_compare) ? 0.9f : 1f; + return 1f; + } + + public float tGetSongSpeedFactor(EBalancingType ebt = EBalancingType.SCORE, bool isMenu = false, int actual = 0) { + var _compare = ((isMenu) ? (nSongSpeed + 5) * 2 : OpenTaiko.ConfigIni.nSongSpeed) / 20f; + + if (ebt == EBalancingType.SCORE || _compare <= 1f) + return Math.Min(1f, (float)Math.Pow(_compare, 1.3)); + return Math.Max(1f, (float)Math.Pow(_compare, 0.7)); + } + + public float tGetJustFactor(EBalancingType ebt = EBalancingType.SCORE, bool isMenu = false, int actual = 0) { + var _compare = (isMenu) ? nJust : OpenTaiko.ConfigIni.bJust[actual]; + + if (ebt == EBalancingType.SCORE) + return (_compare == 2) ? 0.6f : 1f; + + return (_compare > 0) ? ((_compare > 1) ? 0.5f : 1.3f) : 1f; + } + + public float tGetTimingFactor(EBalancingType ebt = EBalancingType.SCORE, bool isMenu = false, int actual = 0) { + var _compare = (isMenu) ? nTiming - 2 : OpenTaiko.ConfigIni.nTimingZones[actual] - 2; + + if (ebt == EBalancingType.SCORE) + return (_compare < 0) ? (1f + 0.2f * _compare) : 1f; + + return 1f + 0.2f * _compare; + } + + public float tGetDoronFactor(EBalancingType ebt = EBalancingType.SCORE, bool isMenu = false, int actual = 0) { + var _compare = (isMenu) ? nStealth : (int)OpenTaiko.ConfigIni.eSTEALTH[actual]; + + if (ebt == EBalancingType.SCORE || _compare == 0) + return 1f; + + // Doron : x1.1 coins, Stealth : x1.4 coins + return 1f + 0.1f * (float)Math.Pow(_compare, 2); + } + + public float tGetModMultiplier(EBalancingType ebt = EBalancingType.SCORE, bool isMenu = false, int player = 0) { + float factor = 1f; + int actual = OpenTaiko.GetActualPlayer(player); + + //factor *= tGetScrollSpeedFactor(ebt, isMenu, actual); + factor *= tGetSongSpeedFactor(ebt, isMenu, actual); + factor *= tGetJustFactor(ebt, isMenu, actual); + factor *= tGetTimingFactor(ebt, isMenu, actual); + factor *= tGetDoronFactor(ebt, isMenu, actual); + + return ebt == EBalancingType.SCORE ? Math.Min(factor, 1f) : factor; + } + + public enum EBalancingType { + SCORE, + COINS + } + + #endregion + } diff --git a/OpenTaiko/src/Stages/05.SongSelect/CActSelectArtistComment.cs b/OpenTaiko/src/Stages/05.SongSelect/CActSelectArtistComment.cs index 0ea19c95..dc6fa4f3 100644 --- a/OpenTaiko/src/Stages/05.SongSelect/CActSelectArtistComment.cs +++ b/OpenTaiko/src/Stages/05.SongSelect/CActSelectArtistComment.cs @@ -1,218 +1,218 @@ using FDK; -namespace OpenTaiko { - internal class CActSelectArtistComment : CActivity { - // メソッド +namespace OpenTaiko; - public CActSelectArtistComment() { - base.IsDeActivated = true; - } - public void t選択曲が変更された() { - /* - Cスコア cスコア = TJAPlayer3.stage選曲.r現在選択中のスコア; - if( cスコア != null ) +internal class CActSelectArtistComment : CActivity { + // メソッド + + public CActSelectArtistComment() { + base.IsDeActivated = true; + } + public void t選択曲が変更された() { + /* + Cスコア cスコア = TJAPlayer3.stage選曲.r現在選択中のスコア; + if( cスコア != null ) + { + Bitmap image = new Bitmap( 1, 1 ); + TJAPlayer3.tテクスチャの解放( ref this.txArtist ); + this.strArtist = cスコア.譜面情報.アーティスト名; + if( ( this.strArtist != null ) && ( this.strArtist.Length > 0 ) ) { - Bitmap image = new Bitmap( 1, 1 ); - TJAPlayer3.tテクスチャの解放( ref this.txArtist ); - this.strArtist = cスコア.譜面情報.アーティスト名; - if( ( this.strArtist != null ) && ( this.strArtist.Length > 0 ) ) + Graphics graphics = Graphics.FromImage( image ); + graphics.PageUnit = GraphicsUnit.Pixel; + SizeF ef = graphics.MeasureString( this.strArtist, this.ft描画用フォント ); + graphics.Dispose(); + if (ef.Width > SampleFramework.GameWindowSize.Width) { - Graphics graphics = Graphics.FromImage( image ); - graphics.PageUnit = GraphicsUnit.Pixel; - SizeF ef = graphics.MeasureString( this.strArtist, this.ft描画用フォント ); + ef.Width = SampleFramework.GameWindowSize.Width; + } + try + { + Bitmap bitmap2 = new Bitmap( (int) Math.Ceiling( (double) ef.Width ), (int) Math.Ceiling( (double) this.ft描画用フォント.Size ) ); + graphics = Graphics.FromImage( bitmap2 ); + graphics.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAlias; + graphics.DrawString( this.strArtist, this.ft描画用フォント, Brushes.White, ( float ) 0f, ( float ) 0f ); graphics.Dispose(); - if (ef.Width > SampleFramework.GameWindowSize.Width) - { - ef.Width = SampleFramework.GameWindowSize.Width; - } - try - { - Bitmap bitmap2 = new Bitmap( (int) Math.Ceiling( (double) ef.Width ), (int) Math.Ceiling( (double) this.ft描画用フォント.Size ) ); - graphics = Graphics.FromImage( bitmap2 ); - graphics.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAlias; - graphics.DrawString( this.strArtist, this.ft描画用フォント, Brushes.White, ( float ) 0f, ( float ) 0f ); - graphics.Dispose(); - this.txArtist = new CTexture( bitmap2 ); - this.txArtist.vc拡大縮小倍率 = new Vector3D( 0.5f, 0.5f, 1f ); - bitmap2.Dispose(); - } - catch( CTextureCreateFailedException e ) - { - Trace.TraceError( e.ToString() ); - Trace.TraceError( "ARTISTテクスチャの生成に失敗しました。" ); - this.txArtist = null; - } + this.txArtist = new CTexture( bitmap2 ); + this.txArtist.vc拡大縮小倍率 = new Vector3D( 0.5f, 0.5f, 1f ); + bitmap2.Dispose(); } - TJAPlayer3.tテクスチャの解放( ref this.txComment ); - //this.strComment = cスコア.譜面情報.コメント; - this.strComment = cスコア.譜面情報.ジャンル; - if( ( this.strComment != null ) && ( this.strComment.Length > 0 ) ) + catch( CTextureCreateFailedException e ) { - Graphics graphics2 = Graphics.FromImage( image ); - graphics2.PageUnit = GraphicsUnit.Pixel; - SizeF ef2 = graphics2.MeasureString( this.strComment, this.ft描画用フォント ); - Size size = new Size( (int) Math.Ceiling( (double) ef2.Width ), (int) Math.Ceiling( (double) ef2.Height ) ); - graphics2.Dispose(); - this.nテクスチャの最大幅 = 99999; - int maxTextureHeight = 99999; - Bitmap bitmap3 = new Bitmap( size.Width, (int) Math.Ceiling( (double) this.ft描画用フォント.Size ) ); - graphics2 = Graphics.FromImage( bitmap3 ); - graphics2.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAlias; - graphics2.DrawString( this.strComment, this.ft描画用フォント, Brushes.White, ( float ) 0f, ( float ) 0f ); - graphics2.Dispose(); - this.nComment行数 = 1; - this.nComment最終行の幅 = size.Width; - while( this.nComment最終行の幅 > this.nテクスチャの最大幅 ) - { - this.nComment行数++; - this.nComment最終行の幅 -= this.nテクスチャの最大幅; - } - while( ( this.nComment行数 * ( (int) Math.Ceiling( (double) this.ft描画用フォント.Size ) ) ) > maxTextureHeight ) - { - this.nComment行数--; - this.nComment最終行の幅 = this.nテクスチャの最大幅; - } - Bitmap bitmap4 = new Bitmap( ( this.nComment行数 > 1 ) ? this.nテクスチャの最大幅 : this.nComment最終行の幅, this.nComment行数 * ( (int) Math.Ceiling( (double) this.ft描画用フォント.Size ) ) ); - graphics2 = Graphics.FromImage( bitmap4 ); - Rectangle srcRect = new Rectangle(); - Rectangle destRect = new Rectangle(); - for( int i = 0; i < this.nComment行数; i++ ) - { - srcRect.X = i * this.nテクスチャの最大幅; - srcRect.Y = 0; - srcRect.Width = ( ( i + 1 ) == this.nComment行数 ) ? this.nComment最終行の幅 : this.nテクスチャの最大幅; - srcRect.Height = bitmap3.Height; - destRect.X = 0; - destRect.Y = i * bitmap3.Height; - destRect.Width = srcRect.Width; - destRect.Height = srcRect.Height; - graphics2.DrawImage( bitmap3, destRect, srcRect, GraphicsUnit.Pixel ); - } - graphics2.Dispose(); - try - { - this.txComment = new CTexture( bitmap4 ); - this.txComment.vc拡大縮小倍率 = new Vector3D( 0.5f, 0.5f, 1f ); - } - catch( CTextureCreateFailedException e ) - { - Trace.TraceError( e.ToString() ); - Trace.TraceError( "COMMENTテクスチャの生成に失敗しました。" ); - this.txComment = null; - } - bitmap4.Dispose(); - bitmap3.Dispose(); + Trace.TraceError( e.ToString() ); + Trace.TraceError( "ARTISTテクスチャの生成に失敗しました。" ); + this.txArtist = null; } - image.Dispose(); - if( this.txComment != null ) + } + TJAPlayer3.tテクスチャの解放( ref this.txComment ); + //this.strComment = cスコア.譜面情報.コメント; + this.strComment = cスコア.譜面情報.ジャンル; + if( ( this.strComment != null ) && ( this.strComment.Length > 0 ) ) + { + Graphics graphics2 = Graphics.FromImage( image ); + graphics2.PageUnit = GraphicsUnit.Pixel; + SizeF ef2 = graphics2.MeasureString( this.strComment, this.ft描画用フォント ); + Size size = new Size( (int) Math.Ceiling( (double) ef2.Width ), (int) Math.Ceiling( (double) ef2.Height ) ); + graphics2.Dispose(); + this.nテクスチャの最大幅 = 99999; + int maxTextureHeight = 99999; + Bitmap bitmap3 = new Bitmap( size.Width, (int) Math.Ceiling( (double) this.ft描画用フォント.Size ) ); + graphics2 = Graphics.FromImage( bitmap3 ); + graphics2.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAlias; + graphics2.DrawString( this.strComment, this.ft描画用フォント, Brushes.White, ( float ) 0f, ( float ) 0f ); + graphics2.Dispose(); + this.nComment行数 = 1; + this.nComment最終行の幅 = size.Width; + while( this.nComment最終行の幅 > this.nテクスチャの最大幅 ) { - this.ctComment = new CCounter( -740, (int) ( ( ( ( this.nComment行数 - 1 ) * this.nテクスチャの最大幅 ) + this.nComment最終行の幅 ) * this.txComment.vc拡大縮小倍率.X ), 10, TJAPlayer3.Timer ); + this.nComment行数++; + this.nComment最終行の幅 -= this.nテクスチャの最大幅; + } + while( ( this.nComment行数 * ( (int) Math.Ceiling( (double) this.ft描画用フォント.Size ) ) ) > maxTextureHeight ) + { + this.nComment行数--; + this.nComment最終行の幅 = this.nテクスチャの最大幅; + } + Bitmap bitmap4 = new Bitmap( ( this.nComment行数 > 1 ) ? this.nテクスチャの最大幅 : this.nComment最終行の幅, this.nComment行数 * ( (int) Math.Ceiling( (double) this.ft描画用フォント.Size ) ) ); + graphics2 = Graphics.FromImage( bitmap4 ); + Rectangle srcRect = new Rectangle(); + Rectangle destRect = new Rectangle(); + for( int i = 0; i < this.nComment行数; i++ ) + { + srcRect.X = i * this.nテクスチャの最大幅; + srcRect.Y = 0; + srcRect.Width = ( ( i + 1 ) == this.nComment行数 ) ? this.nComment最終行の幅 : this.nテクスチャの最大幅; + srcRect.Height = bitmap3.Height; + destRect.X = 0; + destRect.Y = i * bitmap3.Height; + destRect.Width = srcRect.Width; + destRect.Height = srcRect.Height; + graphics2.DrawImage( bitmap3, destRect, srcRect, GraphicsUnit.Pixel ); + } + graphics2.Dispose(); + try + { + this.txComment = new CTexture( bitmap4 ); + this.txComment.vc拡大縮小倍率 = new Vector3D( 0.5f, 0.5f, 1f ); + } + catch( CTextureCreateFailedException e ) + { + Trace.TraceError( e.ToString() ); + Trace.TraceError( "COMMENTテクスチャの生成に失敗しました。" ); + this.txComment = null; + } + bitmap4.Dispose(); + bitmap3.Dispose(); + } + image.Dispose(); + if( this.txComment != null ) + { + this.ctComment = new CCounter( -740, (int) ( ( ( ( this.nComment行数 - 1 ) * this.nテクスチャの最大幅 ) + this.nComment最終行の幅 ) * this.txComment.vc拡大縮小倍率.X ), 10, TJAPlayer3.Timer ); + } + } + */ + } + + + // CActivity 実装 + + public override void Activate() { + this.txArtist = null; + this.txComment = null; + this.strArtist = ""; + this.strComment = ""; + this.nComment最終行の幅 = 0; + this.nComment行数 = 0; + this.nテクスチャの最大幅 = 0; + this.ctComment = new CCounter(); + this.t選択曲が変更された(); + base.Activate(); + } + public override void DeActivate() { + OpenTaiko.tテクスチャの解放(ref this.txArtist); + OpenTaiko.tテクスチャの解放(ref this.txComment); + this.ctComment = null; + base.DeActivate(); + } + public override void CreateManagedResource() { + this.ft描画用フォント = new CCachedFontRenderer(CFontRenderer.DefaultFontName, 26, CFontRenderer.FontStyle.Regular); + base.CreateManagedResource(); + } + public override void ReleaseManagedResource() { + if (this.ft描画用フォント != null) { + this.ft描画用フォント.Dispose(); + this.ft描画用フォント = null; + } + + OpenTaiko.tテクスチャの解放(ref this.txArtist); + OpenTaiko.tテクスチャの解放(ref this.txComment); + base.ReleaseManagedResource(); + } + public override int Draw() { + if (!base.IsDeActivated) { + /* + if( this.ctComment.b進行中 ) + { + this.ctComment.t進行Loop(); + } + if( this.txArtist != null ) + { + int x = 1260 - ( (int) ( this.txArtist.szテクスチャサイズ.Width * this.txArtist.vc拡大縮小倍率.X ) ); // #27648 2012.3.14 yyagi: -12 for scrollbar + int y = 322; + this.txArtist.t2D描画( x, y ); + } + if( ( this.txComment != null ) && ( ( this.ctComment.n現在の値 + 750 ) >= 0 ) ) + { + int num3 = 510; + int num4 = 342; + Rectangle rectangle = new Rectangle( this.ctComment.n現在の値, 0, 750, (int) this.ft描画用フォント.Size ); + if( rectangle.X < 0 ) + { + num3 += -rectangle.X; + rectangle.Width -= -rectangle.X; + rectangle.X = 0; + } + int num5 = ( (int) ( ( (float) rectangle.X ) / this.txComment.vc拡大縮小倍率.X ) ) / this.nテクスチャの最大幅; + Rectangle rectangle2 = new Rectangle(); + while( rectangle.Width > 0 ) + { + rectangle2.X = ( (int) ( ( (float) rectangle.X ) / this.txComment.vc拡大縮小倍率.X ) ) % this.nテクスチャの最大幅; + rectangle2.Y = num5 * ( (int) this.ft描画用フォント.Size ); + int num6 = ( ( num5 + 1 ) == this.nComment行数 ) ? this.nComment最終行の幅 : this.nテクスチャの最大幅; + int num7 = num6 - rectangle2.X; + rectangle2.Width = num7; + rectangle2.Height = (int) this.ft描画用フォント.Size; + this.txComment.t2D描画( num3, num4, rectangle2 ); + if( ++num5 == this.nComment行数 ) + { + break; + } + int num8 = (int) ( rectangle2.Width * this.txComment.vc拡大縮小倍率.X ); + rectangle.X += num8; + rectangle.Width -= num8; + num3 += num8; } } */ } - - - // CActivity 実装 - - public override void Activate() { - this.txArtist = null; - this.txComment = null; - this.strArtist = ""; - this.strComment = ""; - this.nComment最終行の幅 = 0; - this.nComment行数 = 0; - this.nテクスチャの最大幅 = 0; - this.ctComment = new CCounter(); - this.t選択曲が変更された(); - base.Activate(); - } - public override void DeActivate() { - OpenTaiko.tテクスチャの解放(ref this.txArtist); - OpenTaiko.tテクスチャの解放(ref this.txComment); - this.ctComment = null; - base.DeActivate(); - } - public override void CreateManagedResource() { - this.ft描画用フォント = new CCachedFontRenderer(CFontRenderer.DefaultFontName, 26, CFontRenderer.FontStyle.Regular); - base.CreateManagedResource(); - } - public override void ReleaseManagedResource() { - if (this.ft描画用フォント != null) { - this.ft描画用フォント.Dispose(); - this.ft描画用フォント = null; - } - - OpenTaiko.tテクスチャの解放(ref this.txArtist); - OpenTaiko.tテクスチャの解放(ref this.txComment); - base.ReleaseManagedResource(); - } - public override int Draw() { - if (!base.IsDeActivated) { - /* - if( this.ctComment.b進行中 ) - { - this.ctComment.t進行Loop(); - } - if( this.txArtist != null ) - { - int x = 1260 - ( (int) ( this.txArtist.szテクスチャサイズ.Width * this.txArtist.vc拡大縮小倍率.X ) ); // #27648 2012.3.14 yyagi: -12 for scrollbar - int y = 322; - this.txArtist.t2D描画( x, y ); - } - if( ( this.txComment != null ) && ( ( this.ctComment.n現在の値 + 750 ) >= 0 ) ) - { - int num3 = 510; - int num4 = 342; - Rectangle rectangle = new Rectangle( this.ctComment.n現在の値, 0, 750, (int) this.ft描画用フォント.Size ); - if( rectangle.X < 0 ) - { - num3 += -rectangle.X; - rectangle.Width -= -rectangle.X; - rectangle.X = 0; - } - int num5 = ( (int) ( ( (float) rectangle.X ) / this.txComment.vc拡大縮小倍率.X ) ) / this.nテクスチャの最大幅; - Rectangle rectangle2 = new Rectangle(); - while( rectangle.Width > 0 ) - { - rectangle2.X = ( (int) ( ( (float) rectangle.X ) / this.txComment.vc拡大縮小倍率.X ) ) % this.nテクスチャの最大幅; - rectangle2.Y = num5 * ( (int) this.ft描画用フォント.Size ); - int num6 = ( ( num5 + 1 ) == this.nComment行数 ) ? this.nComment最終行の幅 : this.nテクスチャの最大幅; - int num7 = num6 - rectangle2.X; - rectangle2.Width = num7; - rectangle2.Height = (int) this.ft描画用フォント.Size; - this.txComment.t2D描画( num3, num4, rectangle2 ); - if( ++num5 == this.nComment行数 ) - { - break; - } - int num8 = (int) ( rectangle2.Width * this.txComment.vc拡大縮小倍率.X ); - rectangle.X += num8; - rectangle.Width -= num8; - num3 += num8; - } - } - */ - } - return 0; - } - - - // その他 - - #region [ private ] - //----------------- - private CCounter ctComment; - private CCachedFontRenderer ft描画用フォント; - private int nComment行数; - private int nComment最終行の幅; - private const int nComment表示幅 = 750; - private int nテクスチャの最大幅; - private string strArtist; - private string strComment; - private CTexture txArtist; - private CTexture txComment; - //----------------- - #endregion + return 0; } + + + // その他 + + #region [ private ] + //----------------- + private CCounter ctComment; + private CCachedFontRenderer ft描画用フォント; + private int nComment行数; + private int nComment最終行の幅; + private const int nComment表示幅 = 750; + private int nテクスチャの最大幅; + private string strArtist; + private string strComment; + private CTexture txArtist; + private CTexture txComment; + //----------------- + #endregion } diff --git a/OpenTaiko/src/Stages/05.SongSelect/CActSelectDanInfo.cs b/OpenTaiko/src/Stages/05.SongSelect/CActSelectDanInfo.cs index 00c83cbb..2db71261 100644 --- a/OpenTaiko/src/Stages/05.SongSelect/CActSelectDanInfo.cs +++ b/OpenTaiko/src/Stages/05.SongSelect/CActSelectDanInfo.cs @@ -2,167 +2,167 @@ using FDK; // Minimalist menu class to use for custom menus -namespace OpenTaiko { - class CActSelectDanInfo : CStage { - public CActSelectDanInfo() { - base.IsDeActivated = true; +namespace OpenTaiko; + +class CActSelectDanInfo : CStage { + public CActSelectDanInfo() { + base.IsDeActivated = true; + } + + public override void Activate() { + // On activation + + if (base.IsActivated) + return; + + ctStep = new CCounter(0, 1000, 2, OpenTaiko.Timer); + ctStepFade = new CCounter(0, 255, 0.5, OpenTaiko.Timer); + + ttkExams = new TitleTextureKey[(int)Exam.Type.Total]; + for (int i = 0; i < ttkExams.Length; i++) { + ttkExams[i] = new TitleTextureKey(CLangManager.LangInstance.GetExamName(i), pfExamFont, Color.Black, Color.Transparent, 700); } - public override void Activate() { - // On activation + base.Activate(); + } - if (base.IsActivated) - return; + public override void DeActivate() { + // On de-activation + base.DeActivate(); + } + + public override void CreateManagedResource() { + // Ressource allocation + pfTitleFont = HPrivateFastFont.tInstantiateMainFont(OpenTaiko.Skin.SongSelect_DanInfo_Title_Size); + pfExamFont = HPrivateFastFont.tInstantiateMainFont(OpenTaiko.Skin.SongSelect_DanInfo_Exam_Size); + + base.CreateManagedResource(); + } + + public override void ReleaseManagedResource() { + // Ressource freeing + OpenTaiko.tDisposeSafely(ref pfTitleFont); + OpenTaiko.tDisposeSafely(ref pfExamFont); + + base.ReleaseManagedResource(); + } + + public override int Draw() { + ctStep.Tick(); + ctStepFade.Tick(); + if (ctStep.CurrentValue == ctStep.EndValue) { ctStep = new CCounter(0, 1000, 2, OpenTaiko.Timer); - ctStepFade = new CCounter(0, 255, 0.5, OpenTaiko.Timer); - - ttkExams = new TitleTextureKey[(int)Exam.Type.Total]; - for (int i = 0; i < ttkExams.Length; i++) { - ttkExams[i] = new TitleTextureKey(CLangManager.LangInstance.GetExamName(i), pfExamFont, Color.Black, Color.Transparent, 700); - } - - base.Activate(); + tNextStep(); } - public override void DeActivate() { - // On de-activation - - base.DeActivate(); - } - - public override void CreateManagedResource() { - // Ressource allocation - pfTitleFont = HPrivateFastFont.tInstantiateMainFont(OpenTaiko.Skin.SongSelect_DanInfo_Title_Size); - pfExamFont = HPrivateFastFont.tInstantiateMainFont(OpenTaiko.Skin.SongSelect_DanInfo_Exam_Size); - - base.CreateManagedResource(); - } - - public override void ReleaseManagedResource() { - // Ressource freeing - OpenTaiko.tDisposeSafely(ref pfTitleFont); - OpenTaiko.tDisposeSafely(ref pfExamFont); - - base.ReleaseManagedResource(); - } - - public override int Draw() { - ctStep.Tick(); - ctStepFade.Tick(); - if (ctStep.CurrentValue == ctStep.EndValue) { - ctStep = new CCounter(0, 1000, 2, OpenTaiko.Timer); - tNextStep(); - } - - if (OpenTaiko.Skin.SongSelect_DanInfo_Show) { - for (int i = 0; i < OpenTaiko.stageSongSelect.rNowSelectedSong.DanSongs.Count; i++) { - var dan = OpenTaiko.stageSongSelect.rNowSelectedSong.DanSongs[i]; - int songIndex = i / 3; - int opacity = 255; - if (OpenTaiko.stageSongSelect.rNowSelectedSong.DanSongs.Count > 3) { - if (nNowSongIndex == songIndex) { - opacity = ctStepFade.CurrentValue; - } else if (nPrevSongIndex == songIndex) { - opacity = 255 - ctStepFade.CurrentValue; - } else { - opacity = 0; - } - } - - int pos = i % 3; - CActSelect段位リスト.tDisplayDanIcon(i + 1, OpenTaiko.Skin.SongSelect_DanInfo_Icon_X[pos], OpenTaiko.Skin.SongSelect_DanInfo_Icon_Y[pos], opacity, OpenTaiko.Skin.SongSelect_DanInfo_Icon_Scale, false); - - int difficulty_cymbol_width = OpenTaiko.Tx.Dani_Difficulty_Cymbol.szTextureSize.Width / 5; - int difficulty_cymbol_height = OpenTaiko.Tx.Dani_Difficulty_Cymbol.szTextureSize.Height; - - OpenTaiko.Tx.Dani_Difficulty_Cymbol.Opacity = opacity; - OpenTaiko.Tx.Dani_Difficulty_Cymbol.vcScaleRatio.X = OpenTaiko.Skin.SongSelect_DanInfo_Difficulty_Cymbol_Scale; - OpenTaiko.Tx.Dani_Difficulty_Cymbol.vcScaleRatio.Y = OpenTaiko.Skin.SongSelect_DanInfo_Difficulty_Cymbol_Scale; - OpenTaiko.Tx.Dani_Difficulty_Cymbol.t2D拡大率考慮中央基準描画(OpenTaiko.Skin.SongSelect_DanInfo_Difficulty_Cymbol_X[pos], OpenTaiko.Skin.SongSelect_DanInfo_Difficulty_Cymbol_Y[pos], new Rectangle(dan.Difficulty * difficulty_cymbol_width, 0, difficulty_cymbol_width, difficulty_cymbol_height)); - OpenTaiko.Tx.Dani_Difficulty_Cymbol.Opacity = 255; - OpenTaiko.Tx.Dani_Difficulty_Cymbol.vcScaleRatio.X = 1; - OpenTaiko.Tx.Dani_Difficulty_Cymbol.vcScaleRatio.Y = 1; - - OpenTaiko.Tx.Dani_Level_Number.Opacity = opacity; - OpenTaiko.stage段位選択.段位リスト.tLevelNumberDraw(OpenTaiko.Skin.SongSelect_DanInfo_Level_Number_X[pos], OpenTaiko.Skin.SongSelect_DanInfo_Level_Number_Y[pos], dan.Level, OpenTaiko.Skin.SongSelect_DanInfo_Level_Number_Scale); - OpenTaiko.Tx.Dani_Level_Number.Opacity = 255; - - TitleTextureKey.ResolveTitleTexture(ttkTitles[i]).Opacity = opacity; - TitleTextureKey.ResolveTitleTexture(ttkTitles[i]).t2D描画(OpenTaiko.Skin.SongSelect_DanInfo_Title_X[pos], OpenTaiko.Skin.SongSelect_DanInfo_Title_Y[pos]); - - - } - - for (int j = 0; j < CExamInfo.cMaxExam; j++) { - int index = j; - Dan_C danc0 = OpenTaiko.stageSongSelect.rNowSelectedSong.DanSongs[0].Dan_C[j]; - - if (danc0 != null) { - TitleTextureKey.ResolveTitleTexture(this.ttkExams[(int)danc0.GetExamType()]).t2D中心基準描画(OpenTaiko.Skin.SongSelect_DanInfo_Exam_X[index], OpenTaiko.Skin.SongSelect_DanInfo_Exam_Y[index]); - } - - if (OpenTaiko.stageSongSelect.rNowSelectedSong.DanSongs[OpenTaiko.stageSongSelect.rNowSelectedSong.DanSongs.Count - 1].Dan_C[j] == null) { - Dan_C danc = OpenTaiko.stageSongSelect.rNowSelectedSong.DanSongs[0].Dan_C[j]; - if (danc != null) { - OpenTaiko.stage段位選択.段位リスト.tExamDraw(OpenTaiko.Skin.SongSelect_DanInfo_Exam_Value_X[0], OpenTaiko.Skin.SongSelect_DanInfo_Exam_Value_Y[index], danc.Value[0], danc.GetExamRange(), OpenTaiko.Skin.SongSelect_DanInfo_Exam_Value_Scale); - } - } else { - for (int i = 0; i < OpenTaiko.stageSongSelect.rNowSelectedSong.DanSongs.Count; i++) { - Dan_C danc = OpenTaiko.stageSongSelect.rNowSelectedSong.DanSongs[i].Dan_C[j]; - if (danc != null) { - int opacity = 255; - if (OpenTaiko.stageSongSelect.rNowSelectedSong.DanSongs.Count > 3) { - if (nNowSongIndex == i / 3) { - opacity = ctStepFade.CurrentValue; - } else if (nPrevSongIndex == i / 3) { - opacity = 255 - ctStepFade.CurrentValue; - } else { - opacity = 0; - } - } - - OpenTaiko.Tx.Dani_Exam_Number.Opacity = opacity; - OpenTaiko.stage段位選択.段位リスト.tExamDraw(OpenTaiko.Skin.SongSelect_DanInfo_Exam_Value_X[i % 3], OpenTaiko.Skin.SongSelect_DanInfo_Exam_Value_Y[index], danc.Value[0], danc.GetExamRange(), OpenTaiko.Skin.SongSelect_DanInfo_Exam_Value_Scale); - OpenTaiko.Tx.Dani_Exam_Number.Opacity = 255; - } - } - } - } - } - - return 0; - } - - public void UpdateSong() { - if (OpenTaiko.stageSongSelect.rNowSelectedSong == null || OpenTaiko.stageSongSelect.rNowSelectedSong.DanSongs == null) return; - - ttkTitles = new TitleTextureKey[OpenTaiko.stageSongSelect.rNowSelectedSong.DanSongs.Count]; + if (OpenTaiko.Skin.SongSelect_DanInfo_Show) { for (int i = 0; i < OpenTaiko.stageSongSelect.rNowSelectedSong.DanSongs.Count; i++) { var dan = OpenTaiko.stageSongSelect.rNowSelectedSong.DanSongs[i]; - ttkTitles[i] = new TitleTextureKey(dan.bTitleShow ? "???" : dan.Title, pfTitleFont, Color.Black, Color.Transparent, 700); + int songIndex = i / 3; + int opacity = 255; + if (OpenTaiko.stageSongSelect.rNowSelectedSong.DanSongs.Count > 3) { + if (nNowSongIndex == songIndex) { + opacity = ctStepFade.CurrentValue; + } else if (nPrevSongIndex == songIndex) { + opacity = 255 - ctStepFade.CurrentValue; + } else { + opacity = 0; + } + } + + int pos = i % 3; + CActSelect段位リスト.tDisplayDanIcon(i + 1, OpenTaiko.Skin.SongSelect_DanInfo_Icon_X[pos], OpenTaiko.Skin.SongSelect_DanInfo_Icon_Y[pos], opacity, OpenTaiko.Skin.SongSelect_DanInfo_Icon_Scale, false); + + int difficulty_cymbol_width = OpenTaiko.Tx.Dani_Difficulty_Cymbol.szTextureSize.Width / 5; + int difficulty_cymbol_height = OpenTaiko.Tx.Dani_Difficulty_Cymbol.szTextureSize.Height; + + OpenTaiko.Tx.Dani_Difficulty_Cymbol.Opacity = opacity; + OpenTaiko.Tx.Dani_Difficulty_Cymbol.vcScaleRatio.X = OpenTaiko.Skin.SongSelect_DanInfo_Difficulty_Cymbol_Scale; + OpenTaiko.Tx.Dani_Difficulty_Cymbol.vcScaleRatio.Y = OpenTaiko.Skin.SongSelect_DanInfo_Difficulty_Cymbol_Scale; + OpenTaiko.Tx.Dani_Difficulty_Cymbol.t2D拡大率考慮中央基準描画(OpenTaiko.Skin.SongSelect_DanInfo_Difficulty_Cymbol_X[pos], OpenTaiko.Skin.SongSelect_DanInfo_Difficulty_Cymbol_Y[pos], new Rectangle(dan.Difficulty * difficulty_cymbol_width, 0, difficulty_cymbol_width, difficulty_cymbol_height)); + OpenTaiko.Tx.Dani_Difficulty_Cymbol.Opacity = 255; + OpenTaiko.Tx.Dani_Difficulty_Cymbol.vcScaleRatio.X = 1; + OpenTaiko.Tx.Dani_Difficulty_Cymbol.vcScaleRatio.Y = 1; + + OpenTaiko.Tx.Dani_Level_Number.Opacity = opacity; + OpenTaiko.stage段位選択.段位リスト.tLevelNumberDraw(OpenTaiko.Skin.SongSelect_DanInfo_Level_Number_X[pos], OpenTaiko.Skin.SongSelect_DanInfo_Level_Number_Y[pos], dan.Level, OpenTaiko.Skin.SongSelect_DanInfo_Level_Number_Scale); + OpenTaiko.Tx.Dani_Level_Number.Opacity = 255; + + TitleTextureKey.ResolveTitleTexture(ttkTitles[i]).Opacity = opacity; + TitleTextureKey.ResolveTitleTexture(ttkTitles[i]).t2D描画(OpenTaiko.Skin.SongSelect_DanInfo_Title_X[pos], OpenTaiko.Skin.SongSelect_DanInfo_Title_Y[pos]); + + + } + + for (int j = 0; j < CExamInfo.cMaxExam; j++) { + int index = j; + Dan_C danc0 = OpenTaiko.stageSongSelect.rNowSelectedSong.DanSongs[0].Dan_C[j]; + + if (danc0 != null) { + TitleTextureKey.ResolveTitleTexture(this.ttkExams[(int)danc0.GetExamType()]).t2D中心基準描画(OpenTaiko.Skin.SongSelect_DanInfo_Exam_X[index], OpenTaiko.Skin.SongSelect_DanInfo_Exam_Y[index]); + } + + if (OpenTaiko.stageSongSelect.rNowSelectedSong.DanSongs[OpenTaiko.stageSongSelect.rNowSelectedSong.DanSongs.Count - 1].Dan_C[j] == null) { + Dan_C danc = OpenTaiko.stageSongSelect.rNowSelectedSong.DanSongs[0].Dan_C[j]; + if (danc != null) { + OpenTaiko.stage段位選択.段位リスト.tExamDraw(OpenTaiko.Skin.SongSelect_DanInfo_Exam_Value_X[0], OpenTaiko.Skin.SongSelect_DanInfo_Exam_Value_Y[index], danc.Value[0], danc.GetExamRange(), OpenTaiko.Skin.SongSelect_DanInfo_Exam_Value_Scale); + } + } else { + for (int i = 0; i < OpenTaiko.stageSongSelect.rNowSelectedSong.DanSongs.Count; i++) { + Dan_C danc = OpenTaiko.stageSongSelect.rNowSelectedSong.DanSongs[i].Dan_C[j]; + if (danc != null) { + int opacity = 255; + if (OpenTaiko.stageSongSelect.rNowSelectedSong.DanSongs.Count > 3) { + if (nNowSongIndex == i / 3) { + opacity = ctStepFade.CurrentValue; + } else if (nPrevSongIndex == i / 3) { + opacity = 255 - ctStepFade.CurrentValue; + } else { + opacity = 0; + } + } + + OpenTaiko.Tx.Dani_Exam_Number.Opacity = opacity; + OpenTaiko.stage段位選択.段位リスト.tExamDraw(OpenTaiko.Skin.SongSelect_DanInfo_Exam_Value_X[i % 3], OpenTaiko.Skin.SongSelect_DanInfo_Exam_Value_Y[index], danc.Value[0], danc.GetExamRange(), OpenTaiko.Skin.SongSelect_DanInfo_Exam_Value_Scale); + OpenTaiko.Tx.Dani_Exam_Number.Opacity = 255; + } + } + } } } - #region [Private] - - private TitleTextureKey[] ttkTitles; - private TitleTextureKey[] ttkExams; - private CCachedFontRenderer pfTitleFont; - private CCachedFontRenderer pfExamFont; - - private CCounter ctStep; - private CCounter ctStepFade; - - private int nPrevSongIndex; - private int nNowSongIndex; - - private void tNextStep() { - nPrevSongIndex = nNowSongIndex; - nNowSongIndex = (nNowSongIndex + 1) % (int)Math.Ceiling(OpenTaiko.stageSongSelect.rNowSelectedSong.DanSongs.Count / 3.0); - ctStepFade = new CCounter(0, 255, 1, OpenTaiko.Timer); - } - - #endregion + return 0; } + + public void UpdateSong() { + if (OpenTaiko.stageSongSelect.rNowSelectedSong == null || OpenTaiko.stageSongSelect.rNowSelectedSong.DanSongs == null) return; + + ttkTitles = new TitleTextureKey[OpenTaiko.stageSongSelect.rNowSelectedSong.DanSongs.Count]; + for (int i = 0; i < OpenTaiko.stageSongSelect.rNowSelectedSong.DanSongs.Count; i++) { + var dan = OpenTaiko.stageSongSelect.rNowSelectedSong.DanSongs[i]; + ttkTitles[i] = new TitleTextureKey(dan.bTitleShow ? "???" : dan.Title, pfTitleFont, Color.Black, Color.Transparent, 700); + } + } + + #region [Private] + + private TitleTextureKey[] ttkTitles; + private TitleTextureKey[] ttkExams; + private CCachedFontRenderer pfTitleFont; + private CCachedFontRenderer pfExamFont; + + private CCounter ctStep; + private CCounter ctStepFade; + + private int nPrevSongIndex; + private int nNowSongIndex; + + private void tNextStep() { + nPrevSongIndex = nNowSongIndex; + nNowSongIndex = (nNowSongIndex + 1) % (int)Math.Ceiling(OpenTaiko.stageSongSelect.rNowSelectedSong.DanSongs.Count / 3.0); + ctStepFade = new CCounter(0, 255, 1, OpenTaiko.Timer); + } + + #endregion } diff --git a/OpenTaiko/src/Stages/05.SongSelect/CActSelectExExtraTransAnime.cs b/OpenTaiko/src/Stages/05.SongSelect/CActSelectExExtraTransAnime.cs index f458073e..05a5ff1d 100644 --- a/OpenTaiko/src/Stages/05.SongSelect/CActSelectExExtraTransAnime.cs +++ b/OpenTaiko/src/Stages/05.SongSelect/CActSelectExExtraTransAnime.cs @@ -1,119 +1,119 @@ using FDK; -namespace OpenTaiko { - internal class CActSelectExExtraTransAnime : CActivity { - enum AnimeState { - NotRunning = 0, - ExToExtra = 1, - ExtraToEx = 2, - } +namespace OpenTaiko; - // Timer & script for each anime - // Activate when swapping between ex/extra - // Do not let player move until timer is complete - // Stop drawing script when timer is finished - public CActSelectExExtraTransAnime() { - - } - // because i can't read japanese very well : - public override void CreateManagedResource() //On Managed Create Resource - { - base.CreateManagedResource(); - - CurrentState = AnimeState.NotRunning; - - ExToExtraCounter = new CCounter(0, 1, OpenTaiko.Skin.SongSelect_Difficulty_Bar_ExExtra_AnimeDuration[0], OpenTaiko.Timer); - ExtraToExCounter = new CCounter(0, 1, OpenTaiko.Skin.SongSelect_Difficulty_Bar_ExExtra_AnimeDuration[1], OpenTaiko.Timer); - - ExToExtraScript = new AnimeBG(CSkin.Path($"{TextureLoader.BASE}{TextureLoader.SONGSELECT}Difficulty_Select{Path.DirectorySeparatorChar}ExToExtra{Path.DirectorySeparatorChar}0{Path.DirectorySeparatorChar}Script.lua")); - ExtraToExScript = new AnimeBG(CSkin.Path($"{TextureLoader.BASE}{TextureLoader.SONGSELECT}Difficulty_Select{Path.DirectorySeparatorChar}ExtraToEx{Path.DirectorySeparatorChar}0{Path.DirectorySeparatorChar}Script.lua")); - - ExToExtraScript.Init(); - ExtraToExScript.Init(); - } - - public override void ReleaseManagedResource() //On Managed Release Resource - { - base.ReleaseManagedResource(); - - ExToExtraCounter = null; - ExtraToExCounter = null; - - if (ExToExtraScript != null) { - ExToExtraScript.Dispose(); - ExToExtraScript = null; - } - if (ExtraToExScript != null) { - ExtraToExScript.Dispose(); - ExtraToExScript = null; - } - } - - public override void Activate() //On Activate - { - base.Activate(); - } - - public override int Draw() //On Progress Draw - { - switch (CurrentState) { - case AnimeState.ExToExtra: - ExToExtraCounter.Tick(); - if (ExToExtraCounter.IsEnded) { - CurrentState = AnimeState.NotRunning; - ExToExtraCounter.Stop(); - return 0; - } - - ExToExtraScript.Update(); - ExToExtraScript.Draw(); - return 1; - - case AnimeState.ExtraToEx: - ExtraToExCounter.Tick(); - if (ExtraToExCounter.IsEnded) { - CurrentState = AnimeState.NotRunning; - ExtraToExCounter.Stop(); - return 0; - } - - ExtraToExScript.Update(); - ExtraToExScript.Draw(); - return 1; - - case AnimeState.NotRunning: - default: - return 0; - } - } - - public override void DeActivate() //On Deactivate - { - base.DeActivate(); - } - - public void BeginAnime(bool toExtra) { - if (!OpenTaiko.ConfigIni.ShowExExtraAnime) return; - else if (toExtra && !ExToExtraScript.Exists()) return; - else if (!toExtra && !ExtraToExScript.Exists()) return; - - CurrentState = toExtra ? AnimeState.ExToExtra : AnimeState.ExtraToEx; - if (toExtra) { - ExToExtraCounter = new CCounter(0, 1, OpenTaiko.Skin.SongSelect_Difficulty_Bar_ExExtra_AnimeDuration[0], OpenTaiko.Timer); - ExToExtraScript.PlayAnimation(); - OpenTaiko.Skin.soundExToExtra[0]?.tPlay(); // Placeholder code - } else { - ExtraToExCounter = new CCounter(0, 1, OpenTaiko.Skin.SongSelect_Difficulty_Bar_ExExtra_AnimeDuration[1], OpenTaiko.Timer); - ExtraToExScript.PlayAnimation(); - OpenTaiko.Skin.soundExtraToEx[0]?.tPlay(); // Placeholder code - } - } - - #region Private - CCounter ExToExtraCounter, ExtraToExCounter; - AnimeBG ExToExtraScript, ExtraToExScript; - - AnimeState CurrentState; - #endregion +internal class CActSelectExExtraTransAnime : CActivity { + enum AnimeState { + NotRunning = 0, + ExToExtra = 1, + ExtraToEx = 2, } + + // Timer & script for each anime + // Activate when swapping between ex/extra + // Do not let player move until timer is complete + // Stop drawing script when timer is finished + public CActSelectExExtraTransAnime() { + + } + // because i can't read japanese very well : + public override void CreateManagedResource() //On Managed Create Resource + { + base.CreateManagedResource(); + + CurrentState = AnimeState.NotRunning; + + ExToExtraCounter = new CCounter(0, 1, OpenTaiko.Skin.SongSelect_Difficulty_Bar_ExExtra_AnimeDuration[0], OpenTaiko.Timer); + ExtraToExCounter = new CCounter(0, 1, OpenTaiko.Skin.SongSelect_Difficulty_Bar_ExExtra_AnimeDuration[1], OpenTaiko.Timer); + + ExToExtraScript = new AnimeBG(CSkin.Path($"{TextureLoader.BASE}{TextureLoader.SONGSELECT}Difficulty_Select{Path.DirectorySeparatorChar}ExToExtra{Path.DirectorySeparatorChar}0{Path.DirectorySeparatorChar}Script.lua")); + ExtraToExScript = new AnimeBG(CSkin.Path($"{TextureLoader.BASE}{TextureLoader.SONGSELECT}Difficulty_Select{Path.DirectorySeparatorChar}ExtraToEx{Path.DirectorySeparatorChar}0{Path.DirectorySeparatorChar}Script.lua")); + + ExToExtraScript.Init(); + ExtraToExScript.Init(); + } + + public override void ReleaseManagedResource() //On Managed Release Resource + { + base.ReleaseManagedResource(); + + ExToExtraCounter = null; + ExtraToExCounter = null; + + if (ExToExtraScript != null) { + ExToExtraScript.Dispose(); + ExToExtraScript = null; + } + if (ExtraToExScript != null) { + ExtraToExScript.Dispose(); + ExtraToExScript = null; + } + } + + public override void Activate() //On Activate + { + base.Activate(); + } + + public override int Draw() //On Progress Draw + { + switch (CurrentState) { + case AnimeState.ExToExtra: + ExToExtraCounter.Tick(); + if (ExToExtraCounter.IsEnded) { + CurrentState = AnimeState.NotRunning; + ExToExtraCounter.Stop(); + return 0; + } + + ExToExtraScript.Update(); + ExToExtraScript.Draw(); + return 1; + + case AnimeState.ExtraToEx: + ExtraToExCounter.Tick(); + if (ExtraToExCounter.IsEnded) { + CurrentState = AnimeState.NotRunning; + ExtraToExCounter.Stop(); + return 0; + } + + ExtraToExScript.Update(); + ExtraToExScript.Draw(); + return 1; + + case AnimeState.NotRunning: + default: + return 0; + } + } + + public override void DeActivate() //On Deactivate + { + base.DeActivate(); + } + + public void BeginAnime(bool toExtra) { + if (!OpenTaiko.ConfigIni.ShowExExtraAnime) return; + else if (toExtra && !ExToExtraScript.Exists()) return; + else if (!toExtra && !ExtraToExScript.Exists()) return; + + CurrentState = toExtra ? AnimeState.ExToExtra : AnimeState.ExtraToEx; + if (toExtra) { + ExToExtraCounter = new CCounter(0, 1, OpenTaiko.Skin.SongSelect_Difficulty_Bar_ExExtra_AnimeDuration[0], OpenTaiko.Timer); + ExToExtraScript.PlayAnimation(); + OpenTaiko.Skin.soundExToExtra[0]?.tPlay(); // Placeholder code + } else { + ExtraToExCounter = new CCounter(0, 1, OpenTaiko.Skin.SongSelect_Difficulty_Bar_ExExtra_AnimeDuration[1], OpenTaiko.Timer); + ExtraToExScript.PlayAnimation(); + OpenTaiko.Skin.soundExtraToEx[0]?.tPlay(); // Placeholder code + } + } + + #region Private + CCounter ExToExtraCounter, ExtraToExCounter; + AnimeBG ExToExtraScript, ExtraToExScript; + + AnimeState CurrentState; + #endregion } diff --git a/OpenTaiko/src/Stages/05.SongSelect/CActSelectInformation.cs b/OpenTaiko/src/Stages/05.SongSelect/CActSelectInformation.cs index 1453d367..eab935ad 100644 --- a/OpenTaiko/src/Stages/05.SongSelect/CActSelectInformation.cs +++ b/OpenTaiko/src/Stages/05.SongSelect/CActSelectInformation.cs @@ -2,118 +2,118 @@ using System.Runtime.InteropServices; using FDK; -namespace OpenTaiko { - internal class CActSelectInformation : CActivity { - // Constructor +namespace OpenTaiko; - public CActSelectInformation() { - base.IsDeActivated = true; - } +internal class CActSelectInformation : CActivity { + // Constructor - - // CActivity 実装 - - public override void Activate() { - this.n画像Index上 = -1; - this.n画像Index下 = 0; - - this.bFirst = true; - this.ct進行用 = new CCounter(0, 3000, 3, OpenTaiko.Timer); - base.Activate(); - } - public override void DeActivate() { - this.ctスクロール用 = null; - base.DeActivate(); - } - public override void CreateManagedResource() { - this.txInfo_Back = OpenTaiko.tテクスチャの生成(CSkin.Path(@$"Graphics{Path.DirectorySeparatorChar}5_information_BG.png")); - this.txInfo[0] = OpenTaiko.tテクスチャの生成(CSkin.Path(@$"Graphics{Path.DirectorySeparatorChar}5_information.png")); - this.txInfo[1] = OpenTaiko.tテクスチャの生成(CSkin.Path(@$"Graphics{Path.DirectorySeparatorChar}5_information2.png")); - base.CreateManagedResource(); - } - public override void ReleaseManagedResource() { - OpenTaiko.tテクスチャの解放(ref this.txInfo_Back); - OpenTaiko.tテクスチャの解放(ref this.txInfo[0]); - OpenTaiko.tテクスチャの解放(ref this.txInfo[1]); - base.ReleaseManagedResource(); - } - public override int Draw() { - if (!base.IsDeActivated) { - if (base.IsFirstDraw) { - base.IsFirstDraw = false; - } - - if (this.txInfo_Back != null) - this.txInfo_Back.t2D描画(340, 600); - - - this.ct進行用.TickLoop(); - if (this.bFirst) { - this.ct進行用.CurrentValue = 300; - } - - #region[ 透明度制御 ] - if (this.txInfo[0] != null && this.txInfo[1] != null) { - if (this.ct進行用.CurrentValue < 255) { - this.txInfo[0].Opacity = this.ct進行用.CurrentValue; - this.txInfo[1].Opacity = 255 - this.ct進行用.CurrentValue; - } else if (this.ct進行用.CurrentValue >= 255 && this.ct進行用.CurrentValue < 1245) { - this.bFirst = false; - this.txInfo[0].Opacity = 255; - this.txInfo[1].Opacity = 0; - } else if (this.ct進行用.CurrentValue >= 1245 && this.ct進行用.CurrentValue < 1500) { - this.txInfo[0].Opacity = 255 - (this.ct進行用.CurrentValue - 1245); - this.txInfo[1].Opacity = this.ct進行用.CurrentValue - 1245; - } else if (this.ct進行用.CurrentValue >= 1500 && this.ct進行用.CurrentValue <= 3000) { - this.txInfo[0].Opacity = 0; - this.txInfo[1].Opacity = 255; - } - - this.txInfo[0].t2D描画(340, 600); - this.txInfo[1].t2D描画(340, 600); - } - - #endregion - - - } - return 0; - } - - - // その他 - - #region [ private ] - //----------------- - [StructLayout(LayoutKind.Sequential)] - private struct STINFO { - public int nTexture番号; - public Point pt左上座標; - public STINFO(int nTexture番号, int x, int y) { - this.nTexture番号 = nTexture番号; - this.pt左上座標 = new Point(x, y); - } - } - - private CCounter ctスクロール用; - private int n画像Index下; - private int n画像Index上; - private readonly STINFO[] stInfo = new STINFO[] { - new STINFO( 0, 0, 0 ), - new STINFO( 0, 0, 49 ), - new STINFO( 0, 0, 97 ), - new STINFO( 0, 0, 147 ), - new STINFO( 0, 0, 196 ), - new STINFO( 1, 0, 0 ), - new STINFO( 1, 0, 49 ), - new STINFO( 1, 0, 97 ), - new STINFO( 1, 0, 147 ) - }; - private CTexture txInfo_Back; - private CTexture[] txInfo = new CTexture[2]; - private bool bFirst; - private CCounter ct進行用; - //----------------- - #endregion + public CActSelectInformation() { + base.IsDeActivated = true; } + + + // CActivity 実装 + + public override void Activate() { + this.n画像Index上 = -1; + this.n画像Index下 = 0; + + this.bFirst = true; + this.ct進行用 = new CCounter(0, 3000, 3, OpenTaiko.Timer); + base.Activate(); + } + public override void DeActivate() { + this.ctスクロール用 = null; + base.DeActivate(); + } + public override void CreateManagedResource() { + this.txInfo_Back = OpenTaiko.tテクスチャの生成(CSkin.Path(@$"Graphics{Path.DirectorySeparatorChar}5_information_BG.png")); + this.txInfo[0] = OpenTaiko.tテクスチャの生成(CSkin.Path(@$"Graphics{Path.DirectorySeparatorChar}5_information.png")); + this.txInfo[1] = OpenTaiko.tテクスチャの生成(CSkin.Path(@$"Graphics{Path.DirectorySeparatorChar}5_information2.png")); + base.CreateManagedResource(); + } + public override void ReleaseManagedResource() { + OpenTaiko.tテクスチャの解放(ref this.txInfo_Back); + OpenTaiko.tテクスチャの解放(ref this.txInfo[0]); + OpenTaiko.tテクスチャの解放(ref this.txInfo[1]); + base.ReleaseManagedResource(); + } + public override int Draw() { + if (!base.IsDeActivated) { + if (base.IsFirstDraw) { + base.IsFirstDraw = false; + } + + if (this.txInfo_Back != null) + this.txInfo_Back.t2D描画(340, 600); + + + this.ct進行用.TickLoop(); + if (this.bFirst) { + this.ct進行用.CurrentValue = 300; + } + + #region[ 透明度制御 ] + if (this.txInfo[0] != null && this.txInfo[1] != null) { + if (this.ct進行用.CurrentValue < 255) { + this.txInfo[0].Opacity = this.ct進行用.CurrentValue; + this.txInfo[1].Opacity = 255 - this.ct進行用.CurrentValue; + } else if (this.ct進行用.CurrentValue >= 255 && this.ct進行用.CurrentValue < 1245) { + this.bFirst = false; + this.txInfo[0].Opacity = 255; + this.txInfo[1].Opacity = 0; + } else if (this.ct進行用.CurrentValue >= 1245 && this.ct進行用.CurrentValue < 1500) { + this.txInfo[0].Opacity = 255 - (this.ct進行用.CurrentValue - 1245); + this.txInfo[1].Opacity = this.ct進行用.CurrentValue - 1245; + } else if (this.ct進行用.CurrentValue >= 1500 && this.ct進行用.CurrentValue <= 3000) { + this.txInfo[0].Opacity = 0; + this.txInfo[1].Opacity = 255; + } + + this.txInfo[0].t2D描画(340, 600); + this.txInfo[1].t2D描画(340, 600); + } + + #endregion + + + } + return 0; + } + + + // その他 + + #region [ private ] + //----------------- + [StructLayout(LayoutKind.Sequential)] + private struct STINFO { + public int nTexture番号; + public Point pt左上座標; + public STINFO(int nTexture番号, int x, int y) { + this.nTexture番号 = nTexture番号; + this.pt左上座標 = new Point(x, y); + } + } + + private CCounter ctスクロール用; + private int n画像Index下; + private int n画像Index上; + private readonly STINFO[] stInfo = new STINFO[] { + new STINFO( 0, 0, 0 ), + new STINFO( 0, 0, 49 ), + new STINFO( 0, 0, 97 ), + new STINFO( 0, 0, 147 ), + new STINFO( 0, 0, 196 ), + new STINFO( 1, 0, 0 ), + new STINFO( 1, 0, 49 ), + new STINFO( 1, 0, 97 ), + new STINFO( 1, 0, 147 ) + }; + private CTexture txInfo_Back; + private CTexture[] txInfo = new CTexture[2]; + private bool bFirst; + private CCounter ct進行用; + //----------------- + #endregion } diff --git a/OpenTaiko/src/Stages/05.SongSelect/CActSelectPopupMenu.cs b/OpenTaiko/src/Stages/05.SongSelect/CActSelectPopupMenu.cs index cfdc2870..085931e9 100644 --- a/OpenTaiko/src/Stages/05.SongSelect/CActSelectPopupMenu.cs +++ b/OpenTaiko/src/Stages/05.SongSelect/CActSelectPopupMenu.cs @@ -3,442 +3,442 @@ using System.Runtime.InteropServices; using FDK; -namespace OpenTaiko { - internal class CActSelectPopupMenu : CActivity { - private static List Child = new List(); +namespace OpenTaiko; - public CActSelectPopupMenu() { - Child.Add(this); - } +internal class CActSelectPopupMenu : CActivity { + private static List Child = new List(); - // Properties - - - public int GetIndex(int pos) { - return lciMenuItems[pos].cItem.GetIndex(); - } - public object GetObj現在値(int pos) { - return lciMenuItems[pos].cItem.obj現在値(); - } - public bool bGotoDetailConfig { - get; - internal set; - } - - /// - /// ソートメニュー機能を使用中かどうか。外部からこれをtrueにすると、ソートメニューが出現する。falseにすると消える。 - /// - public bool bIsActivePopupMenu { - get; - private set; - } - public virtual void tActivatePopupMenu(EInstrumentPad einst) { - nItemSelecting = -1; // #24757 2011.4.1 yyagi: Clear sorting status in each stating menu. - this.eInst = einst; - this.bIsActivePopupMenu = true; - this.bIsSelectingIntItem = false; - this.bGotoDetailConfig = false; - } - public virtual void tDeativatePopupMenu() { - this.bIsActivePopupMenu = false; - } - - - protected void Initialize(List menulist, bool showAllItems, string title) { - Initialize(menulist, showAllItems, title, 0); - } - - protected void Initialize(List menulist, bool showAllItems, string title, int defaultPos) { - ConditionallyInitializePrvFont(); - - b選択した = false; - stqMenuTitle = new stQuickMenuItem(); - stqMenuTitle.cItem = new CItemBase(); - stqMenuTitle.cItem.str項目名 = title; - using (var bitmap = prvFont.DrawText(title, Color.White, Color.Black, null, 30)) { - stqMenuTitle.txName = OpenTaiko.tテクスチャの生成(bitmap, false); - } - lciMenuItems = new stQuickMenuItem[menulist.Count]; - for (int i = 0; i < menulist.Count; i++) { - stQuickMenuItem stqm = new stQuickMenuItem(); - stqm.cItem = menulist[i]; - using (var bitmap = prvFont.DrawText(menulist[i].str項目名, Color.White, Color.Black, null, 30)) { - stqm.txName = OpenTaiko.tテクスチャの生成(bitmap, false); - } - lciMenuItems[i] = stqm; - } - - bShowAllItems = showAllItems; - n現在の選択行 = defaultPos; - } - - private void ConditionallyInitializePrvFont() { - if (prvFont == null) { - prvFont = HPrivateFastFont.tInstantiateMainFont(OpenTaiko.Skin.PopupMenu_Font_Size); - } - } - - public static void RefleshSkin() { - for (int i = 0; i < Child.Count; i++) { - Child[i]._RefleshSkin(); - } - } - - public void _RefleshSkin() { - OpenTaiko.tDisposeSafely(ref prvFont); - ConditionallyInitializePrvFont(); - - using (var bitmap = prvFont.DrawText(stqMenuTitle.cItem.str項目名, Color.White, Color.Black, null, 30)) { - OpenTaiko.tDisposeSafely(ref stqMenuTitle.txName); - stqMenuTitle.txName = OpenTaiko.tテクスチャの生成(bitmap, false); - } - for (int i = 0; i < lciMenuItems.Length; i++) { - using (var bitmap = prvFont.DrawText(lciMenuItems[i].cItem.str項目名, Color.White, Color.Black, null, 30)) { - OpenTaiko.tDisposeSafely(ref lciMenuItems[i].txName); - lciMenuItems[i].txName = OpenTaiko.tテクスチャの生成(bitmap, false); - } - } - } - - public void tEnter押下() { - if (this.bキー入力待ち) { - OpenTaiko.Skin.soundDecideSFX.tPlay(); - - if (this.n現在の選択行 != lciMenuItems.Length - 1) { - if (lciMenuItems[n現在の選択行].cItem.e種別 == CItemBase.E種別.リスト || - lciMenuItems[n現在の選択行].cItem.e種別 == CItemBase.E種別.ONorOFFトグル || - lciMenuItems[n現在の選択行].cItem.e種別 == CItemBase.E種別.ONorOFFor不定スリーステート) { - lciMenuItems[n現在の選択行].cItem.t項目値を次へ移動(); - } else if (lciMenuItems[n現在の選択行].cItem.e種別 == CItemBase.E種別.整数) { - bIsSelectingIntItem = !bIsSelectingIntItem; // 選択状態/選択解除状態を反転する - } else if (lciMenuItems[n現在の選択行].cItem.e種別 == CItemBase.E種別.切替リスト) { - // 特に何もしない - } else { - throw new ArgumentException(); - } - nItemSelecting = n現在の選択行; - } - tEnter押下Main((int)lciMenuItems[n現在の選択行].cItem.GetIndex()); - - this.bキー入力待ち = true; - } - } - - /// - /// Decide押下時の処理を、継承先で記述する。 - /// - /// CItemBaseの現在の設定値のindex - public virtual void tEnter押下Main(int val) { - } - /// - /// Cancel押下時の追加処理があれば、継承先で記述する。 - /// - public virtual void tCancel() { - } - /// - /// 追加の描画処理。必要に応じて、継承先で記述する。 - /// - public virtual void t進行描画sub() { - } - - public void t次に移動() { - if (this.bキー入力待ち) { - OpenTaiko.Skin.soundカーソル移動音.tPlay(); - if (bIsSelectingIntItem) { - lciMenuItems[n現在の選択行].cItem.t項目値を前へ移動(); // 項目移動と数値上下は方向が逆になるので注意 - } else { - if (++this.n現在の選択行 >= this.lciMenuItems.Length) { - this.n現在の選択行 = 0; - } - } - } - } - public void t前に移動() { - if (this.bキー入力待ち) { - OpenTaiko.Skin.soundカーソル移動音.tPlay(); - if (bIsSelectingIntItem) { - lciMenuItems[n現在の選択行].cItem.t項目値を次へ移動(); // 項目移動と数値上下は方向が逆になるので注意 - } else { - if (--this.n現在の選択行 < 0) { - this.n現在の選択行 = this.lciMenuItems.Length - 1; - } - } - } - } - - // CActivity 実装 - - public override void Activate() { - // this.n現在の選択行 = 0; - this.bキー入力待ち = true; - for (int i = 0; i < 4; i++) { - this.ctキー反復用[i] = new CCounter(0, 0, 0, OpenTaiko.Timer); - } - base.IsDeActivated = true; - b選択した = false; - this.bIsActivePopupMenu = false; - this.font = new CActDFPFont(); - base.ChildActivities.Add(this.font); - nItemSelecting = -1; - - base.Activate(); - } - public override void DeActivate() { - if (!base.IsDeActivated) { - base.ChildActivities.Remove(this.font); - this.font.DeActivate(); - this.font = null; - - //CDTXMania.tテクスチャの解放( ref this.txCursor ); - //CDTXMania.tテクスチャの解放( ref this.txPopupMenuBackground ); - for (int i = 0; i < 4; i++) { - this.ctキー反復用[i] = null; - } - base.DeActivate(); - } - } - - public override void CreateManagedResource() { - base.CreateManagedResource(); - - ConditionallyInitializePrvFont(); - } - - public override void ReleaseManagedResource() { - //CDTXMania.tテクスチャの解放( ref this.txPopupMenuBackground ); - //CDTXMania.tテクスチャの解放( ref this.txCursor ); - OpenTaiko.tDisposeSafely(ref this.prvFont); - base.ReleaseManagedResource(); - } - - public override int Draw() { - throw new InvalidOperationException("t進行描画(bool)のほうを使用してください。"); - } - - public int t進行描画() { - if (!base.IsDeActivated && this.bIsActivePopupMenu) { - if (this.bキー入力待ち) { - #region [ Shift-F1: CONFIG画面 ] - if ((OpenTaiko.InputManager.Keyboard.KeyPressing((int)SlimDXKeys.Key.RightShift) || OpenTaiko.InputManager.Keyboard.KeyPressing((int)SlimDXKeys.Key.LeftShift)) && - OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.F1)) { // [SHIFT] + [F1] CONFIG - OpenTaiko.Skin.soundCancelSFX.tPlay(); - tCancel(); - this.bGotoDetailConfig = true; - } - #endregion - #region [ キー入力: キャンセル ] - else if ((OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Escape) - || OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.FT) - || OpenTaiko.Pad.bPressedGB(EPad.Cancel)) - && this.bEsc有効) { // キャンセル - OpenTaiko.Skin.soundCancelSFX.tPlay(); - tCancel(); - this.bIsActivePopupMenu = false; - } - #endregion - - if (!b選択した) { - #region [ キー入力: 決定 ] - // E楽器パート eInst = E楽器パート.UNKNOWN; - ESortAction eAction = ESortAction.END; - if (OpenTaiko.Pad.bPressed(EInstrumentPad.Guitar, EPad.Decide)) { - eInst = EInstrumentPad.Guitar; - eAction = ESortAction.Decide; - } else if (OpenTaiko.Pad.bPressed(EInstrumentPad.Bass, EPad.Decide)) { - eInst = EInstrumentPad.Bass; - eAction = ESortAction.Decide; - } else if ( - OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.Decide) // #24756 2011.4.1 yyagi: Add condition "Drum-Decide" to enable CY in Sort Menu. - || OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.RD) - || OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.LC) - || OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.LRed) - || OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.RRed) - || (OpenTaiko.ConfigIni.bEnterIsNotUsedInKeyAssignments && OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Return))) { - eInst = EInstrumentPad.Drums; - eAction = ESortAction.Decide; - } - if (eAction == ESortAction.Decide) // 決定 - { - this.tEnter押下(); - } - #endregion - #region [ キー入力: 前に移動 ] - this.ctキー反復用.Up.KeyIntervalFunc(OpenTaiko.InputManager.Keyboard.KeyPressing((int)SlimDXKeys.Key.UpArrow), new CCounter.KeyProcess(this.t前に移動)); - this.ctキー反復用.R.KeyIntervalFunc(OpenTaiko.Pad.IsPressingGB(EPad.R), new CCounter.KeyProcess(this.t前に移動)); - if (OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.SD) || OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.LBlue)) { - this.t前に移動(); - } - #endregion - #region [ キー入力: 次に移動 ] - this.ctキー反復用.Down.KeyIntervalFunc(OpenTaiko.InputManager.Keyboard.KeyPressing((int)SlimDXKeys.Key.DownArrow), new CCounter.KeyProcess(this.t次に移動)); - this.ctキー反復用.B.KeyIntervalFunc(OpenTaiko.Pad.IsPressingGB(EPad.B), new CCounter.KeyProcess(this.t次に移動)); - if (OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.LT) || OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.RBlue)) { - this.t次に移動(); - } - #endregion - } - } - #region [ ポップアップメニュー 背景描画 ] - if (OpenTaiko.Tx.Menu_Title != null) { - OpenTaiko.Tx.Menu_Title.t2D描画(OpenTaiko.Skin.PopupMenu_Menu_Title[0], OpenTaiko.Skin.PopupMenu_Menu_Title[1]); - } - #endregion - #region [ ソートメニュータイトル描画 ] - stqMenuTitle.txName.t2D描画(OpenTaiko.Skin.PopupMenu_Title[0], OpenTaiko.Skin.PopupMenu_Title[1]); - #endregion - #region [ カーソル描画 ] - if (OpenTaiko.Tx.Menu_Highlight != null) { - int curX = OpenTaiko.Skin.PopupMenu_Menu_Highlight[0] + (OpenTaiko.Skin.PopupMenu_Move[0] * (this.n現在の選択行 + 1)); - int curY = OpenTaiko.Skin.PopupMenu_Menu_Highlight[1] + (OpenTaiko.Skin.PopupMenu_Move[1] * (this.n現在の選択行 + 1)); - - int width = OpenTaiko.Tx.Menu_Highlight.szTextureSize.Width / 2; - int height = OpenTaiko.Tx.Menu_Highlight.szTextureSize.Height; - - OpenTaiko.Tx.Menu_Highlight.t2D描画(curX, curY, new Rectangle(0, 0, width, height)); - curX += width; - Rectangle rectangle = new Rectangle(width / 2, 0, width, height); - for (int j = 0; j < 16; j++) { - OpenTaiko.Tx.Menu_Highlight.t2D描画(curX, curY, rectangle); - curX += width; - } - OpenTaiko.Tx.Menu_Highlight.t2D描画(curX, curY, new Rectangle(width, 0, width, height)); - } - #endregion - #region [ ソート候補文字列描画 ] - for (int i = 0; i < lciMenuItems.Length; i++) { - bool bItemBold = (i == nItemSelecting && !bShowAllItems) ? true : false; - //font.t文字列描画( 190, 80 + i * 32, lciMenuItems[ i ].cItem.str項目名, bItemBold, 1.0f ); - if (lciMenuItems[i].txName != null) { - lciMenuItems[i].txName.t2D描画(OpenTaiko.Skin.PopupMenu_MenuItem_Name[0] + i * OpenTaiko.Skin.PopupMenu_Move[0], - OpenTaiko.Skin.PopupMenu_MenuItem_Name[1] + i * OpenTaiko.Skin.PopupMenu_Move[1]); - } - - bool bValueBold = (bItemBold || (i == nItemSelecting && bIsSelectingIntItem)) ? true : false; - if (bItemBold || bShowAllItems) { - string s; - if (lciMenuItems[i].cItem.str項目名 == CLangManager.LangInstance.GetString("MOD_SONGSPEED")) { - double d = (double)((int)lciMenuItems[i].cItem.obj現在値() / 20.0); - s = "x" + d.ToString("0.00"); - } else if (lciMenuItems[i].cItem.str項目名 == CLangManager.LangInstance.GetString("MOD_SPEED")) { - double d = (double)((((int)lciMenuItems[i].cItem.obj現在値()) + 1) / 10.0); - s = "x" + d.ToString("0.0"); - } else { - s = lciMenuItems[i].cItem.obj現在値().ToString(); - } - // switch (lciMenuItems[i].cItem.str項目名) - // { - // case "演奏速度": - // { - // double d = (double)((int)lciMenuItems[i].cItem.obj現在値() / 20.0); - // s = "x" + d.ToString("0.000"); - // } - // break; - // case "ばいそく": - // { - //double d = (double)((((int)lciMenuItems[i].cItem.obj現在値()) + 1) / 10.0); - //s = "x" + d.ToString("0.0"); - // } - // break; - - // default: - // s = lciMenuItems[i].cItem.obj現在値().ToString(); - // break; - // } - //font.t文字列描画( (int)(340 * Scale.X), (int)(80 + i * 32), s, bValueBold, 1.0f * Scale.Y); - using (var bmpStr = bValueBold ? - prvFont.DrawText(s, Color.White, Color.Black, null, Color.Yellow, Color.OrangeRed, 30) : - prvFont.DrawText(s, Color.White, Color.Black, null, 30)) { - using (var ctStr = OpenTaiko.tテクスチャの生成(bmpStr, false)) { - ctStr.t2D描画(OpenTaiko.Skin.PopupMenu_MenuItem_Value[0] + i * OpenTaiko.Skin.PopupMenu_Move[0], - OpenTaiko.Skin.PopupMenu_MenuItem_Value[1] + i * OpenTaiko.Skin.PopupMenu_Move[1]); - } - } - } - } - #endregion - t進行描画sub(); - } - return 0; - } - - - // その他 - - #region [ private ] - //----------------- - private bool bキー入力待ち; - protected bool bEsc有効; - - internal int n現在の選択行; - internal EInstrumentPad eInst = EInstrumentPad.Unknown; - - //private CTexture txPopupMenuBackground; - //private CTexture txCursor; - private CActDFPFont font; - CCachedFontRenderer prvFont; - - internal struct stQuickMenuItem { - internal CItemBase cItem; - internal CTexture txName; - } - private stQuickMenuItem[] lciMenuItems; - private stQuickMenuItem stqMenuTitle; - private string strMenuTitle; - private bool bShowAllItems; - private bool bIsSelectingIntItem; - public static bool b選択した; - [StructLayout(LayoutKind.Sequential)] - private struct STキー反復用カウンタ { - public CCounter Up; - public CCounter Down; - public CCounter R; - public CCounter B; - public CCounter this[int index] { - get { - switch (index) { - case 0: - return this.Up; - - case 1: - return this.Down; - - case 2: - return this.R; - - case 3: - return this.B; - } - throw new IndexOutOfRangeException(); - } - set { - switch (index) { - case 0: - this.Up = value; - return; - - case 1: - this.Down = value; - return; - - case 2: - this.R = value; - return; - - case 3: - this.B = value; - return; - } - throw new IndexOutOfRangeException(); - } - } - } - private STキー反復用カウンタ ctキー反復用; - - private enum ESortAction : int { - Cancel, Decide, Previous, Next, END - } - private int nItemSelecting; // 「n現在の選択行」とは別に設ける。sortでメニュー表示直後にアイテムの中身を表示しないようにするため - //----------------- - #endregion + public CActSelectPopupMenu() { + Child.Add(this); } + + // Properties + + + public int GetIndex(int pos) { + return lciMenuItems[pos].cItem.GetIndex(); + } + public object GetObj現在値(int pos) { + return lciMenuItems[pos].cItem.obj現在値(); + } + public bool bGotoDetailConfig { + get; + internal set; + } + + /// + /// ソートメニュー機能を使用中かどうか。外部からこれをtrueにすると、ソートメニューが出現する。falseにすると消える。 + /// + public bool bIsActivePopupMenu { + get; + private set; + } + public virtual void tActivatePopupMenu(EInstrumentPad einst) { + nItemSelecting = -1; // #24757 2011.4.1 yyagi: Clear sorting status in each stating menu. + this.eInst = einst; + this.bIsActivePopupMenu = true; + this.bIsSelectingIntItem = false; + this.bGotoDetailConfig = false; + } + public virtual void tDeativatePopupMenu() { + this.bIsActivePopupMenu = false; + } + + + protected void Initialize(List menulist, bool showAllItems, string title) { + Initialize(menulist, showAllItems, title, 0); + } + + protected void Initialize(List menulist, bool showAllItems, string title, int defaultPos) { + ConditionallyInitializePrvFont(); + + b選択した = false; + stqMenuTitle = new stQuickMenuItem(); + stqMenuTitle.cItem = new CItemBase(); + stqMenuTitle.cItem.str項目名 = title; + using (var bitmap = prvFont.DrawText(title, Color.White, Color.Black, null, 30)) { + stqMenuTitle.txName = OpenTaiko.tテクスチャの生成(bitmap, false); + } + lciMenuItems = new stQuickMenuItem[menulist.Count]; + for (int i = 0; i < menulist.Count; i++) { + stQuickMenuItem stqm = new stQuickMenuItem(); + stqm.cItem = menulist[i]; + using (var bitmap = prvFont.DrawText(menulist[i].str項目名, Color.White, Color.Black, null, 30)) { + stqm.txName = OpenTaiko.tテクスチャの生成(bitmap, false); + } + lciMenuItems[i] = stqm; + } + + bShowAllItems = showAllItems; + n現在の選択行 = defaultPos; + } + + private void ConditionallyInitializePrvFont() { + if (prvFont == null) { + prvFont = HPrivateFastFont.tInstantiateMainFont(OpenTaiko.Skin.PopupMenu_Font_Size); + } + } + + public static void RefleshSkin() { + for (int i = 0; i < Child.Count; i++) { + Child[i]._RefleshSkin(); + } + } + + public void _RefleshSkin() { + OpenTaiko.tDisposeSafely(ref prvFont); + ConditionallyInitializePrvFont(); + + using (var bitmap = prvFont.DrawText(stqMenuTitle.cItem.str項目名, Color.White, Color.Black, null, 30)) { + OpenTaiko.tDisposeSafely(ref stqMenuTitle.txName); + stqMenuTitle.txName = OpenTaiko.tテクスチャの生成(bitmap, false); + } + for (int i = 0; i < lciMenuItems.Length; i++) { + using (var bitmap = prvFont.DrawText(lciMenuItems[i].cItem.str項目名, Color.White, Color.Black, null, 30)) { + OpenTaiko.tDisposeSafely(ref lciMenuItems[i].txName); + lciMenuItems[i].txName = OpenTaiko.tテクスチャの生成(bitmap, false); + } + } + } + + public void tEnter押下() { + if (this.bキー入力待ち) { + OpenTaiko.Skin.soundDecideSFX.tPlay(); + + if (this.n現在の選択行 != lciMenuItems.Length - 1) { + if (lciMenuItems[n現在の選択行].cItem.e種別 == CItemBase.E種別.リスト || + lciMenuItems[n現在の選択行].cItem.e種別 == CItemBase.E種別.ONorOFFトグル || + lciMenuItems[n現在の選択行].cItem.e種別 == CItemBase.E種別.ONorOFFor不定スリーステート) { + lciMenuItems[n現在の選択行].cItem.t項目値を次へ移動(); + } else if (lciMenuItems[n現在の選択行].cItem.e種別 == CItemBase.E種別.整数) { + bIsSelectingIntItem = !bIsSelectingIntItem; // 選択状態/選択解除状態を反転する + } else if (lciMenuItems[n現在の選択行].cItem.e種別 == CItemBase.E種別.切替リスト) { + // 特に何もしない + } else { + throw new ArgumentException(); + } + nItemSelecting = n現在の選択行; + } + tEnter押下Main((int)lciMenuItems[n現在の選択行].cItem.GetIndex()); + + this.bキー入力待ち = true; + } + } + + /// + /// Decide押下時の処理を、継承先で記述する。 + /// + /// CItemBaseの現在の設定値のindex + public virtual void tEnter押下Main(int val) { + } + /// + /// Cancel押下時の追加処理があれば、継承先で記述する。 + /// + public virtual void tCancel() { + } + /// + /// 追加の描画処理。必要に応じて、継承先で記述する。 + /// + public virtual void t進行描画sub() { + } + + public void t次に移動() { + if (this.bキー入力待ち) { + OpenTaiko.Skin.soundカーソル移動音.tPlay(); + if (bIsSelectingIntItem) { + lciMenuItems[n現在の選択行].cItem.t項目値を前へ移動(); // 項目移動と数値上下は方向が逆になるので注意 + } else { + if (++this.n現在の選択行 >= this.lciMenuItems.Length) { + this.n現在の選択行 = 0; + } + } + } + } + public void t前に移動() { + if (this.bキー入力待ち) { + OpenTaiko.Skin.soundカーソル移動音.tPlay(); + if (bIsSelectingIntItem) { + lciMenuItems[n現在の選択行].cItem.t項目値を次へ移動(); // 項目移動と数値上下は方向が逆になるので注意 + } else { + if (--this.n現在の選択行 < 0) { + this.n現在の選択行 = this.lciMenuItems.Length - 1; + } + } + } + } + + // CActivity 実装 + + public override void Activate() { + // this.n現在の選択行 = 0; + this.bキー入力待ち = true; + for (int i = 0; i < 4; i++) { + this.ctキー反復用[i] = new CCounter(0, 0, 0, OpenTaiko.Timer); + } + base.IsDeActivated = true; + b選択した = false; + this.bIsActivePopupMenu = false; + this.font = new CActDFPFont(); + base.ChildActivities.Add(this.font); + nItemSelecting = -1; + + base.Activate(); + } + public override void DeActivate() { + if (!base.IsDeActivated) { + base.ChildActivities.Remove(this.font); + this.font.DeActivate(); + this.font = null; + + //CDTXMania.tテクスチャの解放( ref this.txCursor ); + //CDTXMania.tテクスチャの解放( ref this.txPopupMenuBackground ); + for (int i = 0; i < 4; i++) { + this.ctキー反復用[i] = null; + } + base.DeActivate(); + } + } + + public override void CreateManagedResource() { + base.CreateManagedResource(); + + ConditionallyInitializePrvFont(); + } + + public override void ReleaseManagedResource() { + //CDTXMania.tテクスチャの解放( ref this.txPopupMenuBackground ); + //CDTXMania.tテクスチャの解放( ref this.txCursor ); + OpenTaiko.tDisposeSafely(ref this.prvFont); + base.ReleaseManagedResource(); + } + + public override int Draw() { + throw new InvalidOperationException("t進行描画(bool)のほうを使用してください。"); + } + + public int t進行描画() { + if (!base.IsDeActivated && this.bIsActivePopupMenu) { + if (this.bキー入力待ち) { + #region [ Shift-F1: CONFIG画面 ] + if ((OpenTaiko.InputManager.Keyboard.KeyPressing((int)SlimDXKeys.Key.RightShift) || OpenTaiko.InputManager.Keyboard.KeyPressing((int)SlimDXKeys.Key.LeftShift)) && + OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.F1)) { // [SHIFT] + [F1] CONFIG + OpenTaiko.Skin.soundCancelSFX.tPlay(); + tCancel(); + this.bGotoDetailConfig = true; + } + #endregion + #region [ キー入力: キャンセル ] + else if ((OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Escape) + || OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.FT) + || OpenTaiko.Pad.bPressedGB(EPad.Cancel)) + && this.bEsc有効) { // キャンセル + OpenTaiko.Skin.soundCancelSFX.tPlay(); + tCancel(); + this.bIsActivePopupMenu = false; + } + #endregion + + if (!b選択した) { + #region [ キー入力: 決定 ] + // E楽器パート eInst = E楽器パート.UNKNOWN; + ESortAction eAction = ESortAction.END; + if (OpenTaiko.Pad.bPressed(EInstrumentPad.Guitar, EPad.Decide)) { + eInst = EInstrumentPad.Guitar; + eAction = ESortAction.Decide; + } else if (OpenTaiko.Pad.bPressed(EInstrumentPad.Bass, EPad.Decide)) { + eInst = EInstrumentPad.Bass; + eAction = ESortAction.Decide; + } else if ( + OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.Decide) // #24756 2011.4.1 yyagi: Add condition "Drum-Decide" to enable CY in Sort Menu. + || OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.RD) + || OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.LC) + || OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.LRed) + || OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.RRed) + || (OpenTaiko.ConfigIni.bEnterIsNotUsedInKeyAssignments && OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Return))) { + eInst = EInstrumentPad.Drums; + eAction = ESortAction.Decide; + } + if (eAction == ESortAction.Decide) // 決定 + { + this.tEnter押下(); + } + #endregion + #region [ キー入力: 前に移動 ] + this.ctキー反復用.Up.KeyIntervalFunc(OpenTaiko.InputManager.Keyboard.KeyPressing((int)SlimDXKeys.Key.UpArrow), new CCounter.KeyProcess(this.t前に移動)); + this.ctキー反復用.R.KeyIntervalFunc(OpenTaiko.Pad.IsPressingGB(EPad.R), new CCounter.KeyProcess(this.t前に移動)); + if (OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.SD) || OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.LBlue)) { + this.t前に移動(); + } + #endregion + #region [ キー入力: 次に移動 ] + this.ctキー反復用.Down.KeyIntervalFunc(OpenTaiko.InputManager.Keyboard.KeyPressing((int)SlimDXKeys.Key.DownArrow), new CCounter.KeyProcess(this.t次に移動)); + this.ctキー反復用.B.KeyIntervalFunc(OpenTaiko.Pad.IsPressingGB(EPad.B), new CCounter.KeyProcess(this.t次に移動)); + if (OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.LT) || OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.RBlue)) { + this.t次に移動(); + } + #endregion + } + } + #region [ ポップアップメニュー 背景描画 ] + if (OpenTaiko.Tx.Menu_Title != null) { + OpenTaiko.Tx.Menu_Title.t2D描画(OpenTaiko.Skin.PopupMenu_Menu_Title[0], OpenTaiko.Skin.PopupMenu_Menu_Title[1]); + } + #endregion + #region [ ソートメニュータイトル描画 ] + stqMenuTitle.txName.t2D描画(OpenTaiko.Skin.PopupMenu_Title[0], OpenTaiko.Skin.PopupMenu_Title[1]); + #endregion + #region [ カーソル描画 ] + if (OpenTaiko.Tx.Menu_Highlight != null) { + int curX = OpenTaiko.Skin.PopupMenu_Menu_Highlight[0] + (OpenTaiko.Skin.PopupMenu_Move[0] * (this.n現在の選択行 + 1)); + int curY = OpenTaiko.Skin.PopupMenu_Menu_Highlight[1] + (OpenTaiko.Skin.PopupMenu_Move[1] * (this.n現在の選択行 + 1)); + + int width = OpenTaiko.Tx.Menu_Highlight.szTextureSize.Width / 2; + int height = OpenTaiko.Tx.Menu_Highlight.szTextureSize.Height; + + OpenTaiko.Tx.Menu_Highlight.t2D描画(curX, curY, new Rectangle(0, 0, width, height)); + curX += width; + Rectangle rectangle = new Rectangle(width / 2, 0, width, height); + for (int j = 0; j < 16; j++) { + OpenTaiko.Tx.Menu_Highlight.t2D描画(curX, curY, rectangle); + curX += width; + } + OpenTaiko.Tx.Menu_Highlight.t2D描画(curX, curY, new Rectangle(width, 0, width, height)); + } + #endregion + #region [ ソート候補文字列描画 ] + for (int i = 0; i < lciMenuItems.Length; i++) { + bool bItemBold = (i == nItemSelecting && !bShowAllItems) ? true : false; + //font.t文字列描画( 190, 80 + i * 32, lciMenuItems[ i ].cItem.str項目名, bItemBold, 1.0f ); + if (lciMenuItems[i].txName != null) { + lciMenuItems[i].txName.t2D描画(OpenTaiko.Skin.PopupMenu_MenuItem_Name[0] + i * OpenTaiko.Skin.PopupMenu_Move[0], + OpenTaiko.Skin.PopupMenu_MenuItem_Name[1] + i * OpenTaiko.Skin.PopupMenu_Move[1]); + } + + bool bValueBold = (bItemBold || (i == nItemSelecting && bIsSelectingIntItem)) ? true : false; + if (bItemBold || bShowAllItems) { + string s; + if (lciMenuItems[i].cItem.str項目名 == CLangManager.LangInstance.GetString("MOD_SONGSPEED")) { + double d = (double)((int)lciMenuItems[i].cItem.obj現在値() / 20.0); + s = "x" + d.ToString("0.00"); + } else if (lciMenuItems[i].cItem.str項目名 == CLangManager.LangInstance.GetString("MOD_SPEED")) { + double d = (double)((((int)lciMenuItems[i].cItem.obj現在値()) + 1) / 10.0); + s = "x" + d.ToString("0.0"); + } else { + s = lciMenuItems[i].cItem.obj現在値().ToString(); + } + // switch (lciMenuItems[i].cItem.str項目名) + // { + // case "演奏速度": + // { + // double d = (double)((int)lciMenuItems[i].cItem.obj現在値() / 20.0); + // s = "x" + d.ToString("0.000"); + // } + // break; + // case "ばいそく": + // { + //double d = (double)((((int)lciMenuItems[i].cItem.obj現在値()) + 1) / 10.0); + //s = "x" + d.ToString("0.0"); + // } + // break; + + // default: + // s = lciMenuItems[i].cItem.obj現在値().ToString(); + // break; + // } + //font.t文字列描画( (int)(340 * Scale.X), (int)(80 + i * 32), s, bValueBold, 1.0f * Scale.Y); + using (var bmpStr = bValueBold ? + prvFont.DrawText(s, Color.White, Color.Black, null, Color.Yellow, Color.OrangeRed, 30) : + prvFont.DrawText(s, Color.White, Color.Black, null, 30)) { + using (var ctStr = OpenTaiko.tテクスチャの生成(bmpStr, false)) { + ctStr.t2D描画(OpenTaiko.Skin.PopupMenu_MenuItem_Value[0] + i * OpenTaiko.Skin.PopupMenu_Move[0], + OpenTaiko.Skin.PopupMenu_MenuItem_Value[1] + i * OpenTaiko.Skin.PopupMenu_Move[1]); + } + } + } + } + #endregion + t進行描画sub(); + } + return 0; + } + + + // その他 + + #region [ private ] + //----------------- + private bool bキー入力待ち; + protected bool bEsc有効; + + internal int n現在の選択行; + internal EInstrumentPad eInst = EInstrumentPad.Unknown; + + //private CTexture txPopupMenuBackground; + //private CTexture txCursor; + private CActDFPFont font; + CCachedFontRenderer prvFont; + + internal struct stQuickMenuItem { + internal CItemBase cItem; + internal CTexture txName; + } + private stQuickMenuItem[] lciMenuItems; + private stQuickMenuItem stqMenuTitle; + private string strMenuTitle; + private bool bShowAllItems; + private bool bIsSelectingIntItem; + public static bool b選択した; + [StructLayout(LayoutKind.Sequential)] + private struct STキー反復用カウンタ { + public CCounter Up; + public CCounter Down; + public CCounter R; + public CCounter B; + public CCounter this[int index] { + get { + switch (index) { + case 0: + return this.Up; + + case 1: + return this.Down; + + case 2: + return this.R; + + case 3: + return this.B; + } + throw new IndexOutOfRangeException(); + } + set { + switch (index) { + case 0: + this.Up = value; + return; + + case 1: + this.Down = value; + return; + + case 2: + this.R = value; + return; + + case 3: + this.B = value; + return; + } + throw new IndexOutOfRangeException(); + } + } + } + private STキー反復用カウンタ ctキー反復用; + + private enum ESortAction : int { + Cancel, Decide, Previous, Next, END + } + private int nItemSelecting; // 「n現在の選択行」とは別に設ける。sortでメニュー表示直後にアイテムの中身を表示しないようにするため + //----------------- + #endregion } diff --git a/OpenTaiko/src/Stages/05.SongSelect/CActSelectPreimageパネル.cs b/OpenTaiko/src/Stages/05.SongSelect/CActSelectPreimageパネル.cs index c69546ba..b6195ca7 100644 --- a/OpenTaiko/src/Stages/05.SongSelect/CActSelectPreimageパネル.cs +++ b/OpenTaiko/src/Stages/05.SongSelect/CActSelectPreimageパネル.cs @@ -1,72 +1,145 @@ using FDK; -namespace OpenTaiko { - internal class CActSelectPreimageパネル : CActivity { - // メソッド +namespace OpenTaiko; - public CActSelectPreimageパネル() { - base.IsDeActivated = true; - } - public void tSelectedSongChanged() { - this.ctDelayedDisplay = new CCounter(-OpenTaiko.ConfigIni.nMsWaitPreviewImageFromSongSelected, 100, 1, OpenTaiko.Timer); - this.bNewPreimageLoaded = false; - } +internal class CActSelectPreimageパネル : CActivity { + // メソッド - // CActivity 実装 + public CActSelectPreimageパネル() { + base.IsDeActivated = true; + } + public void tSelectedSongChanged() { + this.ctDelayedDisplay = new CCounter(-OpenTaiko.ConfigIni.nMsWaitPreviewImageFromSongSelected, 100, 1, OpenTaiko.Timer); + this.bNewPreimageLoaded = false; + } - public override void Activate() { - this.rCurrentlyDisplayedPreimage = this.txDefaultPreimage; - this.strCurrentFilename = ""; - this.bNewPreimageLoaded = false; - this.txPreimage = null; - this.tUpdatePreimage(OpenTaiko.stageSongSelect.r現在選択中のスコア); - base.Activate(); - } - public override void DeActivate() { - OpenTaiko.tテクスチャの解放(ref this.txPreimage); - this.ctApparitionAnimation = null; - this.ctDelayedDisplay = null; - base.DeActivate(); - } - public override void CreateManagedResource() { - this.txDefaultPreimage = OpenTaiko.tテクスチャの生成(CSkin.Path(@$"Graphics{Path.DirectorySeparatorChar}3_SongSelect{Path.DirectorySeparatorChar}PreImageDefault.png"), false); - base.CreateManagedResource(); - } - public override void ReleaseManagedResource() { + // CActivity 実装 - OpenTaiko.tテクスチャの解放(ref this.txDefaultPreimage); - base.ReleaseManagedResource(); - } - public override int Draw() { - if (!base.IsDeActivated) { - if (base.IsFirstDraw) { - this.ctApparitionAnimation = new CCounter(0, 100, 5, OpenTaiko.Timer); - base.IsFirstDraw = false; - } - this.ctApparitionAnimation.Tick(); - if ((!OpenTaiko.stageSongSelect.bCurrentlyScrolling && (this.ctDelayedDisplay != null)) && this.ctDelayedDisplay.IsTicked) { - this.ctDelayedDisplay.Tick(); - if ((this.ctDelayedDisplay.CurrentValue >= 0) && this.bNewPreimageStillLoading) { - this.tUpdatePreimage(OpenTaiko.stageSongSelect.r現在選択中のスコア); - OpenTaiko.Timer.Update(); - this.ctDelayedDisplay.NowTime = OpenTaiko.Timer.NowTime; - this.bNewPreimageLoaded = true; - } else if (this.ctDelayedDisplay.IsEnded && this.ctDelayedDisplay.IsTicked) { - this.ctDelayedDisplay.Stop(); - } - } - this.tDisplayPreimage(); + public override void Activate() { + this.rCurrentlyDisplayedPreimage = this.txDefaultPreimage; + this.strCurrentFilename = ""; + this.bNewPreimageLoaded = false; + this.txPreimage = null; + this.tUpdatePreimage(OpenTaiko.stageSongSelect.r現在選択中のスコア); + base.Activate(); + } + public override void DeActivate() { + OpenTaiko.tテクスチャの解放(ref this.txPreimage); + this.ctApparitionAnimation = null; + this.ctDelayedDisplay = null; + base.DeActivate(); + } + public override void CreateManagedResource() { + this.txDefaultPreimage = OpenTaiko.tテクスチャの生成(CSkin.Path(@$"Graphics{Path.DirectorySeparatorChar}3_SongSelect{Path.DirectorySeparatorChar}PreImageDefault.png"), false); + base.CreateManagedResource(); + } + public override void ReleaseManagedResource() { + + OpenTaiko.tテクスチャの解放(ref this.txDefaultPreimage); + base.ReleaseManagedResource(); + } + public override int Draw() { + if (!base.IsDeActivated) { + if (base.IsFirstDraw) { + this.ctApparitionAnimation = new CCounter(0, 100, 5, OpenTaiko.Timer); + base.IsFirstDraw = false; } - return 0; + this.ctApparitionAnimation.Tick(); + if ((!OpenTaiko.stageSongSelect.bCurrentlyScrolling && (this.ctDelayedDisplay != null)) && this.ctDelayedDisplay.IsTicked) { + this.ctDelayedDisplay.Tick(); + if ((this.ctDelayedDisplay.CurrentValue >= 0) && this.bNewPreimageStillLoading) { + this.tUpdatePreimage(OpenTaiko.stageSongSelect.r現在選択中のスコア); + OpenTaiko.Timer.Update(); + this.ctDelayedDisplay.NowTime = OpenTaiko.Timer.NowTime; + this.bNewPreimageLoaded = true; + } else if (this.ctDelayedDisplay.IsEnded && this.ctDelayedDisplay.IsTicked) { + this.ctDelayedDisplay.Stop(); + } + } + this.tDisplayPreimage(); + } + return 0; + } + + public CTexture? tGenerateAndGetPreimage(Cスコア? cScoreInst) { + this.tUpdatePreimage(cScoreInst); + return tGetPreimageTextureResized(); + } + + public CTexture? tGetPreimageTextureResized() { + + + if (this.rCurrentlyDisplayedPreimage != null) { + + int width = OpenTaiko.Skin.SongSelect_Preimage_Size[0]; + int height = OpenTaiko.Skin.SongSelect_Preimage_Size[1]; + + float xRatio = width / (float)this.rCurrentlyDisplayedPreimage.sz画像サイズ.Width; + float yRatio = height / (float)this.rCurrentlyDisplayedPreimage.sz画像サイズ.Height; + + this.rCurrentlyDisplayedPreimage.Opacity = 255; + this.rCurrentlyDisplayedPreimage.vcScaleRatio.X = xRatio; + this.rCurrentlyDisplayedPreimage.vcScaleRatio.Y = xRatio; + + } + return rCurrentlyDisplayedPreimage; + } + + // その他 + + #region [ private ] + //----------------- + private CCounter ctDelayedDisplay; + private CCounter ctApparitionAnimation; + private CTexture rCurrentlyDisplayedPreimage; + private string strCurrentFilename; + private CTexture txPreimage; + private CTexture txDefaultPreimage; + private bool bNewPreimageLoaded; + private bool bNewPreimageStillLoading { + get { + return !this.bNewPreimageLoaded; + } + set { + this.bNewPreimageLoaded = !value; + } + } + + private void tUpdatePreimage(Cスコア? cScoreInst) { + if (cScoreInst != null && this.tBuildPreimageAssets(cScoreInst)) { + return; } - public CTexture? tGenerateAndGetPreimage(Cスコア? cScoreInst) { - this.tUpdatePreimage(cScoreInst); - return tGetPreimageTextureResized(); + // If no preimage or preimage not found + this.rCurrentlyDisplayedPreimage = this.txDefaultPreimage; + this.strCurrentFilename = ""; + } + private bool tBuildPreimageAssets(Cスコア cScoreInst) { + if ((cScoreInst == null) || string.IsNullOrEmpty(cScoreInst.譜面情報.Preimage)) return false; + + string str = ((!Path.IsPathRooted(cScoreInst.譜面情報.Preimage)) ? cScoreInst.ファイル情報.フォルダの絶対パス : "") + cScoreInst.譜面情報.Preimage; + if (!str.Equals(this.strCurrentFilename)) { + OpenTaiko.tテクスチャの解放(ref this.txPreimage); + this.strCurrentFilename = str; + if (!File.Exists(this.strCurrentFilename)) { + LogNotification.PopWarning("Preimage not found ({0})".SafeFormat(this.strCurrentFilename)); + return false; + } + this.txPreimage = OpenTaiko.tテクスチャの生成(this.strCurrentFilename, false); + if (this.txPreimage != null) { + this.rCurrentlyDisplayedPreimage = this.txPreimage; + } else { + this.rCurrentlyDisplayedPreimage = this.txDefaultPreimage; + } } + return true; + } - public CTexture? tGetPreimageTextureResized() { + private void tDisplayPreimage() { + if (!OpenTaiko.stageSongSelect.bCurrentlyScrolling && (((this.ctDelayedDisplay != null) && (this.ctDelayedDisplay.CurrentValue > 0)) && !this.bNewPreimageStillLoading)) { + float num3 = ((float)this.ctDelayedDisplay.CurrentValue) / 100f; + float num4 = 0.9f + (0.1f * num3); if (this.rCurrentlyDisplayedPreimage != null) { @@ -76,97 +149,24 @@ namespace OpenTaiko { float xRatio = width / (float)this.rCurrentlyDisplayedPreimage.sz画像サイズ.Width; float yRatio = height / (float)this.rCurrentlyDisplayedPreimage.sz画像サイズ.Height; - this.rCurrentlyDisplayedPreimage.Opacity = 255; - this.rCurrentlyDisplayedPreimage.vcScaleRatio.X = xRatio; - this.rCurrentlyDisplayedPreimage.vcScaleRatio.Y = xRatio; + this.rCurrentlyDisplayedPreimage.Opacity = (int)(255f * num3); + this.rCurrentlyDisplayedPreimage.vcScaleRatio.X = num4 * xRatio; + this.rCurrentlyDisplayedPreimage.vcScaleRatio.Y = num4 * xRatio; - } - return rCurrentlyDisplayedPreimage; - } + var HiddenIndex = OpenTaiko.Databases.DBSongUnlockables.tGetSongHiddenIndex(OpenTaiko.stageSongSelect.actSongList.rCurrentlySelectedSong); - // その他 - - #region [ private ] - //----------------- - private CCounter ctDelayedDisplay; - private CCounter ctApparitionAnimation; - private CTexture rCurrentlyDisplayedPreimage; - private string strCurrentFilename; - private CTexture txPreimage; - private CTexture txDefaultPreimage; - private bool bNewPreimageLoaded; - private bool bNewPreimageStillLoading { - get { - return !this.bNewPreimageLoaded; - } - set { - this.bNewPreimageLoaded = !value; + if (HiddenIndex >= DBSongUnlockables.EHiddenIndex.BLURED) { + this.rCurrentlyDisplayedPreimage.bUseNoiseEffect = true; + this.rCurrentlyDisplayedPreimage.t2D拡大率考慮中央基準描画(OpenTaiko.Skin.SongSelect_Preimage[0], OpenTaiko.Skin.SongSelect_Preimage[1]); + this.rCurrentlyDisplayedPreimage.bUseNoiseEffect = false; + } else + this.rCurrentlyDisplayedPreimage.t2D拡大率考慮中央基準描画(OpenTaiko.Skin.SongSelect_Preimage[0], OpenTaiko.Skin.SongSelect_Preimage[1]); } } - - private void tUpdatePreimage(Cスコア? cScoreInst) { - if (cScoreInst != null && this.tBuildPreimageAssets(cScoreInst)) { - return; - } - - // If no preimage or preimage not found - this.rCurrentlyDisplayedPreimage = this.txDefaultPreimage; - this.strCurrentFilename = ""; - } - private bool tBuildPreimageAssets(Cスコア cScoreInst) { - if ((cScoreInst == null) || string.IsNullOrEmpty(cScoreInst.譜面情報.Preimage)) return false; - - string str = ((!Path.IsPathRooted(cScoreInst.譜面情報.Preimage)) ? cScoreInst.ファイル情報.フォルダの絶対パス : "") + cScoreInst.譜面情報.Preimage; - if (!str.Equals(this.strCurrentFilename)) { - OpenTaiko.tテクスチャの解放(ref this.txPreimage); - this.strCurrentFilename = str; - if (!File.Exists(this.strCurrentFilename)) { - LogNotification.PopWarning("Preimage not found ({0})".SafeFormat(this.strCurrentFilename)); - return false; - } - this.txPreimage = OpenTaiko.tテクスチャの生成(this.strCurrentFilename, false); - if (this.txPreimage != null) { - this.rCurrentlyDisplayedPreimage = this.txPreimage; - } else { - this.rCurrentlyDisplayedPreimage = this.txDefaultPreimage; - } - } - return true; - } - - private void tDisplayPreimage() { - if (!OpenTaiko.stageSongSelect.bCurrentlyScrolling && (((this.ctDelayedDisplay != null) && (this.ctDelayedDisplay.CurrentValue > 0)) && !this.bNewPreimageStillLoading)) { - - float num3 = ((float)this.ctDelayedDisplay.CurrentValue) / 100f; - float num4 = 0.9f + (0.1f * num3); - - if (this.rCurrentlyDisplayedPreimage != null) { - - int width = OpenTaiko.Skin.SongSelect_Preimage_Size[0]; - int height = OpenTaiko.Skin.SongSelect_Preimage_Size[1]; - - float xRatio = width / (float)this.rCurrentlyDisplayedPreimage.sz画像サイズ.Width; - float yRatio = height / (float)this.rCurrentlyDisplayedPreimage.sz画像サイズ.Height; - - this.rCurrentlyDisplayedPreimage.Opacity = (int)(255f * num3); - this.rCurrentlyDisplayedPreimage.vcScaleRatio.X = num4 * xRatio; - this.rCurrentlyDisplayedPreimage.vcScaleRatio.Y = num4 * xRatio; - - var HiddenIndex = OpenTaiko.Databases.DBSongUnlockables.tGetSongHiddenIndex(OpenTaiko.stageSongSelect.actSongList.rCurrentlySelectedSong); - - if (HiddenIndex >= DBSongUnlockables.EHiddenIndex.BLURED) { - this.rCurrentlyDisplayedPreimage.bUseNoiseEffect = true; - this.rCurrentlyDisplayedPreimage.t2D拡大率考慮中央基準描画(OpenTaiko.Skin.SongSelect_Preimage[0], OpenTaiko.Skin.SongSelect_Preimage[1]); - this.rCurrentlyDisplayedPreimage.bUseNoiseEffect = false; - } else - this.rCurrentlyDisplayedPreimage.t2D拡大率考慮中央基準描画(OpenTaiko.Skin.SongSelect_Preimage[0], OpenTaiko.Skin.SongSelect_Preimage[1]); - } - } - } - - - - //----------------- - #endregion } + + + + //----------------- + #endregion } diff --git a/OpenTaiko/src/Stages/05.SongSelect/CActSelectPresound.cs b/OpenTaiko/src/Stages/05.SongSelect/CActSelectPresound.cs index 603c142e..32df200a 100644 --- a/OpenTaiko/src/Stages/05.SongSelect/CActSelectPresound.cs +++ b/OpenTaiko/src/Stages/05.SongSelect/CActSelectPresound.cs @@ -1,200 +1,200 @@ using System.Diagnostics; using FDK; -namespace OpenTaiko { - internal class CActSelectPresound : CActivity { - // メソッド - - public CActSelectPresound() { - base.IsDeActivated = true; +namespace OpenTaiko; + +internal class CActSelectPresound : CActivity { + // メソッド + + public CActSelectPresound() { + base.IsDeActivated = true; + } + public void tStopSound() { + if (this.sound != null) { + this.sound.Stop(); + OpenTaiko.SoundManager.tDisposeSound(this.sound); + this.sound = null; } - public void tStopSound() { + } + public void t選択曲が変更された() { + Cスコア cスコア = OpenTaiko.stageSongSelect.r現在選択中のスコア; + + if ((cスコア != null) && ((!(cスコア.ファイル情報.フォルダの絶対パス + cスコア.譜面情報.strBGMファイル名).Equals(this.str現在のファイル名) || (this.sound == null)) || !this.sound.IsPlaying)) { + this.tStopSound(); + this.tBGMフェードイン開始(); + this.long再生位置 = -1; + if ((cスコア.譜面情報.strBGMファイル名 != null) && (cスコア.譜面情報.strBGMファイル名.Length > 0)) { + //this.ct再生待ちウェイト = new CCounter( 0, CDTXMania.ConfigIni.n曲が選択されてからプレビュー音が鳴るまでのウェイトms, 1, CDTXMania.Timer ); + if (OpenTaiko.SoundManager.GetCurrentSoundDeviceType() != "DirectSound") { + this.ct再生待ちウェイト = new CCounter(0, 1, 270, OpenTaiko.Timer); + } else { + this.ct再生待ちウェイト = new CCounter(0, 1, 500, OpenTaiko.Timer); + } + } + } + + //if( ( cスコア != null ) && ( ( !( cスコア.ファイル情報.フォルダの絶対パス + cスコア.譜面情報.Presound ).Equals( this.str現在のファイル名 ) || ( this.sound == null ) ) || !this.sound.b再生中 ) ) + //{ + // this.tサウンド停止(); + // this.tBGMフェードイン開始(); + // if( ( cスコア.譜面情報.Presound != null ) && ( cスコア.譜面情報.Presound.Length > 0 ) ) + // { + // this.ct再生待ちウェイト = new CCounter( 0, CDTXMania.ConfigIni.n曲が選択されてからプレビュー音が鳴るまでのウェイトms, 1, CDTXMania.Timer ); + // } + //} + } + + + // CActivity 実装 + + public override void Activate() { + this.sound = null; + this.str現在のファイル名 = ""; + this.ct再生待ちウェイト = null; + this.ctBGMフェードアウト用 = null; + this.ctBGMフェードイン用 = null; + this.long再生位置 = -1; + this.long再生開始時のシステム時刻 = -1; + base.Activate(); + } + public override void DeActivate() { + this.tStopSound(); + this.ct再生待ちウェイト = null; + this.ctBGMフェードイン用 = null; + this.ctBGMフェードアウト用 = null; + base.DeActivate(); + } + public override int Draw() { + if (!base.IsDeActivated) { + if ((this.ctBGMフェードイン用 != null) && this.ctBGMフェードイン用.IsTicked) { + this.ctBGMフェードイン用.Tick(); + OpenTaiko.Skin.bgm選曲画面.nAutomationLevel_現在のサウンド = this.ctBGMフェードイン用.CurrentValue; + if (this.ctBGMフェードイン用.IsEnded) { + this.ctBGMフェードイン用.Stop(); + } + } + if ((this.ctBGMフェードアウト用 != null) && this.ctBGMフェードアウト用.IsTicked) { + this.ctBGMフェードアウト用.Tick(); + OpenTaiko.Skin.bgm選曲画面.nAutomationLevel_現在のサウンド = CSound.MaximumAutomationLevel - this.ctBGMフェードアウト用.CurrentValue; + if (this.ctBGMフェードアウト用.IsEnded) { + this.ctBGMフェードアウト用.Stop(); + } + } + this.t進行処理_プレビューサウンド(); + if (this.sound != null) { - this.sound.Stop(); - OpenTaiko.SoundManager.tDisposeSound(this.sound); + Cスコア cスコア = OpenTaiko.stageSongSelect.r現在選択中のスコア; + if (long再生位置 == -1) { + this.long再生開始時のシステム時刻 = SoundManager.PlayTimer.SystemTimeMs; + this.long再生位置 = cスコア.譜面情報.nデモBGMオフセット; + + this.sound.tSetPositonToBegin(cスコア.譜面情報.nデモBGMオフセット); + + } else { + this.long再生位置 = SoundManager.PlayTimer.SystemTimeMs - this.long再生開始時のシステム時刻; + if (this.long再生位置 >= this.sound.TotalPlayTime - cスコア.譜面情報.nデモBGMオフセット) //2020.04.18 Mr-Ojii #DEMOSTARTから何度も再生するために追加 + this.long再生位置 = -1; + } + //if (this.long再生位置 >= (this.sound.n総演奏時間ms - cスコア.譜面情報.nデモBGMオフセット) - 1 && this.long再生位置 <= (this.sound.n総演奏時間ms - cスコア.譜面情報.nデモBGMオフセット) + 0) + //this.long再生位置 = -1; + + //CDTXMania.act文字コンソール.tPrint( 0, 0, C文字コンソール.Eフォント種別.白, this.long再生位置.ToString() ); + //CDTXMania.act文字コンソール.tPrint( 0, 20, C文字コンソール.Eフォント種別.白, (this.sound.n総演奏時間ms - cスコア.譜面情報.nデモBGMオフセット).ToString() ); + } + } + return 0; + } + + + // その他 + + #region [ private ] + //----------------- + private CCounter ctBGMフェードアウト用; + private CCounter ctBGMフェードイン用; + private CCounter ct再生待ちウェイト; + private long long再生位置; + private long long再生開始時のシステム時刻; + private CSound sound; + private string str現在のファイル名; + + private void tBGMフェードアウト開始() { + if (this.ctBGMフェードイン用 != null) { + this.ctBGMフェードイン用.Stop(); + } + this.ctBGMフェードアウト用 = new CCounter(0, 100, 10, OpenTaiko.Timer); + this.ctBGMフェードアウト用.CurrentValue = 100 - OpenTaiko.Skin.bgm選曲画面.nAutomationLevel_現在のサウンド; + } + private void tBGMフェードイン開始() { + if (this.ctBGMフェードアウト用 != null) { + this.ctBGMフェードアウト用.Stop(); + } + this.ctBGMフェードイン用 = new CCounter(0, 100, 20, OpenTaiko.Timer); + this.ctBGMフェードイン用.CurrentValue = OpenTaiko.Skin.bgm選曲画面.nAutomationLevel_現在のサウンド; + } + private void tプレビューサウンドの作成() { + Cスコア cスコア = OpenTaiko.stageSongSelect.r現在選択中のスコア; + var HiddenIndex = OpenTaiko.Databases.DBSongUnlockables.tGetSongHiddenIndex(OpenTaiko.stageSongSelect.rNowSelectedSong); + if ((cスコア != null) + && !string.IsNullOrEmpty(cスコア.譜面情報.strBGMファイル名) + && OpenTaiko.stageSongSelect.ePhaseID != CStage.EPhase.SongSelect_FadeOutToNowLoading + && HiddenIndex < DBSongUnlockables.EHiddenIndex.GRAYED + ) { + string strPreviewFilename = cスコア.ファイル情報.フォルダの絶対パス + cスコア.譜面情報.Presound; + try { + strPreviewFilename = cスコア.ファイル情報.フォルダの絶対パス + cスコア.譜面情報.strBGMファイル名; + if (OpenTaiko.ConfigIni.bBGMPlayVoiceSound) + this.sound = OpenTaiko.SoundManager.tCreateSound(strPreviewFilename, ESoundGroup.SongPreview); + if (this.sound == null) return; + //this.sound.db再生速度 = ((double)TJAPlayer3.ConfigIni.n演奏速度) / 20.0; + + // 2018-08-27 twopointzero - DO attempt to load (or queue scanning) loudness metadata here. + // Initialization, song enumeration, and/or interactions may have + // caused background scanning and the metadata may now be available. + // If is not yet available then we wish to queue scanning. + var loudnessMetadata = cスコア.譜面情報.SongLoudnessMetadata + ?? LoudnessMetadataScanner.LoadForAudioPath(strPreviewFilename); + OpenTaiko.SongGainController.Set(cスコア.譜面情報.SongVol, loudnessMetadata, this.sound); + + // Disable song if playing while playing the preview song + CSongSelectSongManager.disable(); + + this.sound.PlayStart(true); + + if (long再生位置 == -1) { + this.long再生開始時のシステム時刻 = SoundManager.PlayTimer.SystemTimeMs; + this.long再生位置 = cスコア.譜面情報.nデモBGMオフセット; + this.sound.tSetPositonToBegin(cスコア.譜面情報.nデモBGMオフセット); + this.long再生位置 = SoundManager.PlayTimer.SystemTimeMs - this.long再生開始時のシステム時刻; + } + //if( long再生位置 == this.sound.n総演奏時間ms - 10 ) + // this.long再生位置 = -1; + + this.str現在のファイル名 = strPreviewFilename; + this.tBGMフェードアウト開始(); + Trace.TraceInformation("プレビューサウンドを生成しました。({0})", strPreviewFilename); + + } catch (Exception e) { + Trace.TraceError(e.ToString()); + Trace.TraceError("プレビューサウンドの生成に失敗しました。({0})", strPreviewFilename); + if (this.sound != null) { + this.sound.Dispose(); + } this.sound = null; } } - public void t選択曲が変更された() { - Cスコア cスコア = OpenTaiko.stageSongSelect.r現在選択中のスコア; - - if ((cスコア != null) && ((!(cスコア.ファイル情報.フォルダの絶対パス + cスコア.譜面情報.strBGMファイル名).Equals(this.str現在のファイル名) || (this.sound == null)) || !this.sound.IsPlaying)) { - this.tStopSound(); - this.tBGMフェードイン開始(); - this.long再生位置 = -1; - if ((cスコア.譜面情報.strBGMファイル名 != null) && (cスコア.譜面情報.strBGMファイル名.Length > 0)) { - //this.ct再生待ちウェイト = new CCounter( 0, CDTXMania.ConfigIni.n曲が選択されてからプレビュー音が鳴るまでのウェイトms, 1, CDTXMania.Timer ); - if (OpenTaiko.SoundManager.GetCurrentSoundDeviceType() != "DirectSound") { - this.ct再生待ちウェイト = new CCounter(0, 1, 270, OpenTaiko.Timer); - } else { - this.ct再生待ちウェイト = new CCounter(0, 1, 500, OpenTaiko.Timer); - } - } - } - - //if( ( cスコア != null ) && ( ( !( cスコア.ファイル情報.フォルダの絶対パス + cスコア.譜面情報.Presound ).Equals( this.str現在のファイル名 ) || ( this.sound == null ) ) || !this.sound.b再生中 ) ) - //{ - // this.tサウンド停止(); - // this.tBGMフェードイン開始(); - // if( ( cスコア.譜面情報.Presound != null ) && ( cスコア.譜面情報.Presound.Length > 0 ) ) - // { - // this.ct再生待ちウェイト = new CCounter( 0, CDTXMania.ConfigIni.n曲が選択されてからプレビュー音が鳴るまでのウェイトms, 1, CDTXMania.Timer ); - // } - //} - } - - - // CActivity 実装 - - public override void Activate() { - this.sound = null; - this.str現在のファイル名 = ""; - this.ct再生待ちウェイト = null; - this.ctBGMフェードアウト用 = null; - this.ctBGMフェードイン用 = null; - this.long再生位置 = -1; - this.long再生開始時のシステム時刻 = -1; - base.Activate(); - } - public override void DeActivate() { - this.tStopSound(); - this.ct再生待ちウェイト = null; - this.ctBGMフェードイン用 = null; - this.ctBGMフェードアウト用 = null; - base.DeActivate(); - } - public override int Draw() { - if (!base.IsDeActivated) { - if ((this.ctBGMフェードイン用 != null) && this.ctBGMフェードイン用.IsTicked) { - this.ctBGMフェードイン用.Tick(); - OpenTaiko.Skin.bgm選曲画面.nAutomationLevel_現在のサウンド = this.ctBGMフェードイン用.CurrentValue; - if (this.ctBGMフェードイン用.IsEnded) { - this.ctBGMフェードイン用.Stop(); - } - } - if ((this.ctBGMフェードアウト用 != null) && this.ctBGMフェードアウト用.IsTicked) { - this.ctBGMフェードアウト用.Tick(); - OpenTaiko.Skin.bgm選曲画面.nAutomationLevel_現在のサウンド = CSound.MaximumAutomationLevel - this.ctBGMフェードアウト用.CurrentValue; - if (this.ctBGMフェードアウト用.IsEnded) { - this.ctBGMフェードアウト用.Stop(); - } - } - this.t進行処理_プレビューサウンド(); - - if (this.sound != null) { - Cスコア cスコア = OpenTaiko.stageSongSelect.r現在選択中のスコア; - if (long再生位置 == -1) { - this.long再生開始時のシステム時刻 = SoundManager.PlayTimer.SystemTimeMs; - this.long再生位置 = cスコア.譜面情報.nデモBGMオフセット; - - this.sound.tSetPositonToBegin(cスコア.譜面情報.nデモBGMオフセット); - - } else { - this.long再生位置 = SoundManager.PlayTimer.SystemTimeMs - this.long再生開始時のシステム時刻; - if (this.long再生位置 >= this.sound.TotalPlayTime - cスコア.譜面情報.nデモBGMオフセット) //2020.04.18 Mr-Ojii #DEMOSTARTから何度も再生するために追加 - this.long再生位置 = -1; - } - //if (this.long再生位置 >= (this.sound.n総演奏時間ms - cスコア.譜面情報.nデモBGMオフセット) - 1 && this.long再生位置 <= (this.sound.n総演奏時間ms - cスコア.譜面情報.nデモBGMオフセット) + 0) - //this.long再生位置 = -1; - - //CDTXMania.act文字コンソール.tPrint( 0, 0, C文字コンソール.Eフォント種別.白, this.long再生位置.ToString() ); - //CDTXMania.act文字コンソール.tPrint( 0, 20, C文字コンソール.Eフォント種別.白, (this.sound.n総演奏時間ms - cスコア.譜面情報.nデモBGMオフセット).ToString() ); - } - } - return 0; - } - - - // その他 - - #region [ private ] - //----------------- - private CCounter ctBGMフェードアウト用; - private CCounter ctBGMフェードイン用; - private CCounter ct再生待ちウェイト; - private long long再生位置; - private long long再生開始時のシステム時刻; - private CSound sound; - private string str現在のファイル名; - - private void tBGMフェードアウト開始() { - if (this.ctBGMフェードイン用 != null) { - this.ctBGMフェードイン用.Stop(); - } - this.ctBGMフェードアウト用 = new CCounter(0, 100, 10, OpenTaiko.Timer); - this.ctBGMフェードアウト用.CurrentValue = 100 - OpenTaiko.Skin.bgm選曲画面.nAutomationLevel_現在のサウンド; - } - private void tBGMフェードイン開始() { - if (this.ctBGMフェードアウト用 != null) { - this.ctBGMフェードアウト用.Stop(); - } - this.ctBGMフェードイン用 = new CCounter(0, 100, 20, OpenTaiko.Timer); - this.ctBGMフェードイン用.CurrentValue = OpenTaiko.Skin.bgm選曲画面.nAutomationLevel_現在のサウンド; - } - private void tプレビューサウンドの作成() { - Cスコア cスコア = OpenTaiko.stageSongSelect.r現在選択中のスコア; - var HiddenIndex = OpenTaiko.Databases.DBSongUnlockables.tGetSongHiddenIndex(OpenTaiko.stageSongSelect.rNowSelectedSong); - if ((cスコア != null) - && !string.IsNullOrEmpty(cスコア.譜面情報.strBGMファイル名) - && OpenTaiko.stageSongSelect.ePhaseID != CStage.EPhase.SongSelect_FadeOutToNowLoading - && HiddenIndex < DBSongUnlockables.EHiddenIndex.GRAYED - ) { - string strPreviewFilename = cスコア.ファイル情報.フォルダの絶対パス + cスコア.譜面情報.Presound; - try { - strPreviewFilename = cスコア.ファイル情報.フォルダの絶対パス + cスコア.譜面情報.strBGMファイル名; - if (OpenTaiko.ConfigIni.bBGMPlayVoiceSound) - this.sound = OpenTaiko.SoundManager.tCreateSound(strPreviewFilename, ESoundGroup.SongPreview); - if (this.sound == null) return; - //this.sound.db再生速度 = ((double)TJAPlayer3.ConfigIni.n演奏速度) / 20.0; - - // 2018-08-27 twopointzero - DO attempt to load (or queue scanning) loudness metadata here. - // Initialization, song enumeration, and/or interactions may have - // caused background scanning and the metadata may now be available. - // If is not yet available then we wish to queue scanning. - var loudnessMetadata = cスコア.譜面情報.SongLoudnessMetadata - ?? LoudnessMetadataScanner.LoadForAudioPath(strPreviewFilename); - OpenTaiko.SongGainController.Set(cスコア.譜面情報.SongVol, loudnessMetadata, this.sound); - - // Disable song if playing while playing the preview song - CSongSelectSongManager.disable(); - - this.sound.PlayStart(true); - - if (long再生位置 == -1) { - this.long再生開始時のシステム時刻 = SoundManager.PlayTimer.SystemTimeMs; - this.long再生位置 = cスコア.譜面情報.nデモBGMオフセット; - this.sound.tSetPositonToBegin(cスコア.譜面情報.nデモBGMオフセット); - this.long再生位置 = SoundManager.PlayTimer.SystemTimeMs - this.long再生開始時のシステム時刻; - } - //if( long再生位置 == this.sound.n総演奏時間ms - 10 ) - // this.long再生位置 = -1; - - this.str現在のファイル名 = strPreviewFilename; - this.tBGMフェードアウト開始(); - Trace.TraceInformation("プレビューサウンドを生成しました。({0})", strPreviewFilename); - - } catch (Exception e) { - Trace.TraceError(e.ToString()); - Trace.TraceError("プレビューサウンドの生成に失敗しました。({0})", strPreviewFilename); - if (this.sound != null) { - this.sound.Dispose(); - } - this.sound = null; - } - } - } - private void t進行処理_プレビューサウンド() { - if ((this.ct再生待ちウェイト != null) && !this.ct再生待ちウェイト.IsStoped) { - this.ct再生待ちウェイト.Tick(); - if (!this.ct再生待ちウェイト.IsUnEnded) { - this.ct再生待ちウェイト.Stop(); - if (!OpenTaiko.stageSongSelect.bCurrentlyScrolling) { - this.tプレビューサウンドの作成(); - } - } - } - } - //----------------- - #endregion } + private void t進行処理_プレビューサウンド() { + if ((this.ct再生待ちウェイト != null) && !this.ct再生待ちウェイト.IsStoped) { + this.ct再生待ちウェイト.Tick(); + if (!this.ct再生待ちウェイト.IsUnEnded) { + this.ct再生待ちウェイト.Stop(); + if (!OpenTaiko.stageSongSelect.bCurrentlyScrolling) { + this.tプレビューサウンドの作成(); + } + } + } + } + //----------------- + #endregion } diff --git a/OpenTaiko/src/Stages/05.SongSelect/CActSelectQuickConfig.cs b/OpenTaiko/src/Stages/05.SongSelect/CActSelectQuickConfig.cs index 488bf828..65fcf90d 100644 --- a/OpenTaiko/src/Stages/05.SongSelect/CActSelectQuickConfig.cs +++ b/OpenTaiko/src/Stages/05.SongSelect/CActSelectQuickConfig.cs @@ -1,201 +1,199 @@ using FDK; -namespace OpenTaiko { - internal class CActSelectQuickConfig : CActSelectPopupMenu { - // Constructor +namespace OpenTaiko; - public CActSelectQuickConfig() { - CActSelectQuickConfigMain(); - } +internal class CActSelectQuickConfig : CActSelectPopupMenu { + // Constructor - private void CActSelectQuickConfigMain() { - /* - •Target: Drums/Guitar/Bass - •Auto Mode: All ON/All OFF/CUSTOM - •Auto Lane: - •Scroll Speed: - •Play Speed: - •Risky: - •Hidden/Sudden: None/Hidden/Sudden/Both - •Conf SET: SET-1/SET-2/SET-3 - •More... - •EXIT - */ - lci = new List>>(); // この画面に来る度に、メニューを作り直す。 - for (int nConfSet = 0; nConfSet < 3; nConfSet++) { - lci.Add(new List>()); // ConfSet用の3つ分の枠。 - for (int nInst = 0; nInst < 3; nInst++) { - lci[nConfSet].Add(null); // Drum/Guitar/Bassで3つ分、枠を作っておく - lci[nConfSet][nInst] = MakeListCItemBase(nConfSet, nInst); - } - } - base.Initialize(lci[nCurrentConfigSet][0], true, CLangManager.LangInstance.GetString("SONGSELECT_QUICKCONFIG"), 0); // ConfSet=0, nInst=Drums - } + public CActSelectQuickConfig() { + CActSelectQuickConfigMain(); + } - private List MakeListCItemBase(int nConfigSet, int nInst) { - List l = new List(); - - #region [ 共通 Target/AutoMode/AutoLane ] - #endregion - #region [ 個別 ScrollSpeed ] - l.Add(new CItemInteger(CLangManager.LangInstance.GetString("MOD_SPEED"), 0, 1999, OpenTaiko.ConfigIni.nScrollSpeed[OpenTaiko.SaveFile], - "")); - #endregion - #region [ 共通 Dark/Risky/PlaySpeed ] - l.Add(new CItemInteger(CLangManager.LangInstance.GetString("MOD_SONGSPEED"), 5, 400, OpenTaiko.ConfigIni.nSongSpeed, - "")); - #endregion - #region [ 個別 Sud/Hid ] - l.Add(new CItemList(CLangManager.LangInstance.GetString("MOD_RANDOM"), CItemBase.EPanelType.Normal, (int)OpenTaiko.ConfigIni.eRandom[OpenTaiko.SaveFile], - "", - new string[] { CLangManager.LangInstance.GetString("MOD_SWITCH_OFF"), CLangManager.LangInstance.GetString("MOD_RANDOM"), CLangManager.LangInstance.GetString("MOD_FLIP"), "SUPER", "HYPER" })); - l.Add(new CItemList(CLangManager.LangInstance.GetString("MOD_HIDE"), CItemBase.EPanelType.Normal, (int)OpenTaiko.ConfigIni.eSTEALTH[OpenTaiko.SaveFile], - "", - new string[] { CLangManager.LangInstance.GetString("MOD_SWITCH_OFF"), CLangManager.LangInstance.GetString("MOD_HIDE"), CLangManager.LangInstance.GetString("MOD_STEALTH") })); - l.Add(new CItemList(CLangManager.LangInstance.GetString("SETTINGS_GAME_SURVIVAL"), CItemBase.EPanelType.Normal, (int)OpenTaiko.ConfigIni.eGameMode, - "", - new string[] { CLangManager.LangInstance.GetString("MOD_SWITCH_OFF"), "TYPE-A", "TYPE-B" })); - - l.Add(new CItemList(CLangManager.LangInstance.GetString("SETTINGS_GAME_SHINUCHI"), CItemBase.EPanelType.Normal, OpenTaiko.ConfigIni.ShinuchiMode ? 1 : 0, "", "", new string[] { CLangManager.LangInstance.GetString("MOD_SWITCH_OFF"), CLangManager.LangInstance.GetString("MOD_SWITCH_ON") })); - - #endregion - #region [ 共通 SET切り替え/More/Return ] - l.Add(new CItemInteger(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_PLAYERCOUNT"), 1, 5, OpenTaiko.ConfigIni.nPlayerCount, "")); - l.Add(new CSwitchItemList(CLangManager.LangInstance.GetString("SONGSELECT_QUICKCONFIG_MORE"), CItemBase.EPanelType.Normal, 0, "", "", new string[] { "" })); - l.Add(new CSwitchItemList(CLangManager.LangInstance.GetString("MENU_RETURN"), CItemBase.EPanelType.Normal, 0, "", "", new string[] { "", "" })); - #endregion - - return l; - } - - // メソッド - public override void tActivatePopupMenu(EInstrumentPad einst) { - this.CActSelectQuickConfigMain(); - base.tActivatePopupMenu(einst); - } - //public void tDeativatePopupMenu() - //{ - // base.tDeativatePopupMenu(); - //} - - public override void t進行描画sub() { - - } - - public override void tEnter押下Main(int nSortOrder) { - switch (n現在の選択行) { - case (int)EOrder.ScrollSpeed: - OpenTaiko.ConfigIni.nScrollSpeed[OpenTaiko.SaveFile] = (int)GetObj現在値((int)EOrder.ScrollSpeed); - break; - - case (int)EOrder.PlaySpeed: - OpenTaiko.ConfigIni.nSongSpeed = (int)GetObj現在値((int)EOrder.PlaySpeed); - break; - case (int)EOrder.Random: - OpenTaiko.ConfigIni.eRandom[OpenTaiko.SaveFile] = (ERandomMode)GetIndex((int)EOrder.Random); - break; - case (int)EOrder.Stealth: - OpenTaiko.ConfigIni.eSTEALTH[OpenTaiko.SaveFile] = (EStealthMode)GetIndex((int)EOrder.Stealth); - break; - case (int)EOrder.GameMode: - EGame game = EGame.Off; - switch ((int)GetIndex((int)EOrder.GameMode)) { - case 0: game = EGame.Off; break; - case 1: game = EGame.Survival; break; - case 2: game = EGame.SurvivalHard; break; - } - OpenTaiko.ConfigIni.eGameMode = game; - break; - case (int)EOrder.ShinuchiMode: - OpenTaiko.ConfigIni.ShinuchiMode = !OpenTaiko.ConfigIni.ShinuchiMode; - break; - case (int)EOrder.PlayerCount: - OpenTaiko.ConfigIni.nPlayerCount = (int)GetObj現在値((int)EOrder.PlayerCount); - break; - case (int)EOrder.More: - SetAutoParameters(); // 簡易CONFIGメニュー脱出に伴い、簡易CONFIG内のAUTOの設定をConfigIniクラスに反映する - this.bGotoDetailConfig = true; - this.tDeativatePopupMenu(); - break; - - case (int)EOrder.Return: - SetAutoParameters(); // 簡易CONFIGメニュー脱出に伴い、簡易CONFIG内のAUTOの設定をConfigIniクラスに反映する - this.tDeativatePopupMenu(); - break; - default: - break; + private void CActSelectQuickConfigMain() { + /* + •Target: Drums/Guitar/Bass + •Auto Mode: All ON/All OFF/CUSTOM + •Auto Lane: + •Scroll Speed: + •Play Speed: + •Risky: + •Hidden/Sudden: None/Hidden/Sudden/Both + •Conf SET: SET-1/SET-2/SET-3 + •More... + •EXIT + */ + lci = new List>>(); // この画面に来る度に、メニューを作り直す。 + for (int nConfSet = 0; nConfSet < 3; nConfSet++) { + lci.Add(new List>()); // ConfSet用の3つ分の枠。 + for (int nInst = 0; nInst < 3; nInst++) { + lci[nConfSet].Add(null); // Drum/Guitar/Bassで3つ分、枠を作っておく + lci[nConfSet][nInst] = MakeListCItemBase(nConfSet, nInst); } } + base.Initialize(lci[nCurrentConfigSet][0], true, CLangManager.LangInstance.GetString("SONGSELECT_QUICKCONFIG"), 0); // ConfSet=0, nInst=Drums + } - public override void tCancel() { - SetAutoParameters(); - // Autoの設定値保持のロジックを書くこと! - // (Autoのパラメータ切り替え時は実際に値設定していないため、キャンセルまたはRetern, More...時に値設定する必要有り) - } + private List MakeListCItemBase(int nConfigSet, int nInst) { + List l = new List(); - - /// - /// ConfigIni.bAutoPlayに簡易CONFIGの状態を反映する - /// - private void SetAutoParameters() { - - } - - // CActivity 実装 - - public override void Activate() { - base.Activate(); - this.bGotoDetailConfig = false; - } - public override void DeActivate() { - base.DeActivate(); - } - public override void CreateManagedResource() { - this.ft表示用フォント = new CCachedFontRenderer("Arial", 26, CFontRenderer.FontStyle.Bold); - //string pathパネル本体 = CSkin.Path( @"Graphics\ScreenSelect popup auto settings.png" ); - //if ( File.Exists( pathパネル本体 ) ) - //{ - // this.txパネル本体 = CDTXMania.tテクスチャの生成( pathパネル本体, true ); - //} - - base.CreateManagedResource(); - } - public override void ReleaseManagedResource() { - if (this.ft表示用フォント != null) { - this.ft表示用フォント.Dispose(); - this.ft表示用フォント = null; - } - //CDTXMania.tテクスチャの解放( ref this.txパネル本体 ); - OpenTaiko.tテクスチャの解放(ref this.tx文字列パネル); - base.ReleaseManagedResource(); - } - - #region [ private ] - //----------------- - private int nCurrentTarget = 0; - private int nCurrentConfigSet = 0; - private List>> lci; // DrGtBs, ConfSet, 選択肢一覧。都合、3次のListとなる。 - private enum EOrder : int { - ScrollSpeed = 0, - PlaySpeed, - Random, - Stealth, - GameMode, - ShinuchiMode, - PlayerCount, - More, - Return, - END, - Default = 99 - }; - - private CCachedFontRenderer ft表示用フォント; - //private CTexture txパネル本体; - private CTexture tx文字列パネル; - private CTexture tx説明文1; - //----------------- + #region [ 共通 Target/AutoMode/AutoLane ] #endregion + #region [ 個別 ScrollSpeed ] + l.Add(new CItemInteger(CLangManager.LangInstance.GetString("MOD_SPEED"), 0, 1999, OpenTaiko.ConfigIni.nScrollSpeed[OpenTaiko.SaveFile], + "")); + #endregion + #region [ 共通 Dark/Risky/PlaySpeed ] + l.Add(new CItemInteger(CLangManager.LangInstance.GetString("MOD_SONGSPEED"), 5, 400, OpenTaiko.ConfigIni.nSongSpeed, + "")); + #endregion + #region [ 個別 Sud/Hid ] + l.Add(new CItemList(CLangManager.LangInstance.GetString("MOD_RANDOM"), CItemBase.EPanelType.Normal, (int)OpenTaiko.ConfigIni.eRandom[OpenTaiko.SaveFile], + "", + new string[] { CLangManager.LangInstance.GetString("MOD_SWITCH_OFF"), CLangManager.LangInstance.GetString("MOD_RANDOM"), CLangManager.LangInstance.GetString("MOD_FLIP"), "SUPER", "HYPER" })); + l.Add(new CItemList(CLangManager.LangInstance.GetString("MOD_HIDE"), CItemBase.EPanelType.Normal, (int)OpenTaiko.ConfigIni.eSTEALTH[OpenTaiko.SaveFile], + "", + new string[] { CLangManager.LangInstance.GetString("MOD_SWITCH_OFF"), CLangManager.LangInstance.GetString("MOD_HIDE"), CLangManager.LangInstance.GetString("MOD_STEALTH") })); + l.Add(new CItemList(CLangManager.LangInstance.GetString("SETTINGS_GAME_SURVIVAL"), CItemBase.EPanelType.Normal, (int)OpenTaiko.ConfigIni.eGameMode, + "", + new string[] { CLangManager.LangInstance.GetString("MOD_SWITCH_OFF"), "TYPE-A", "TYPE-B" })); + + l.Add(new CItemList(CLangManager.LangInstance.GetString("SETTINGS_GAME_SHINUCHI"), CItemBase.EPanelType.Normal, OpenTaiko.ConfigIni.ShinuchiMode ? 1 : 0, "", "", new string[] { CLangManager.LangInstance.GetString("MOD_SWITCH_OFF"), CLangManager.LangInstance.GetString("MOD_SWITCH_ON") })); + + #endregion + #region [ 共通 SET切り替え/More/Return ] + l.Add(new CItemInteger(CLangManager.LangInstance.GetString("SETTINGS_SYSTEM_PLAYERCOUNT"), 1, 5, OpenTaiko.ConfigIni.nPlayerCount, "")); + l.Add(new CSwitchItemList(CLangManager.LangInstance.GetString("SONGSELECT_QUICKCONFIG_MORE"), CItemBase.EPanelType.Normal, 0, "", "", new string[] { "" })); + l.Add(new CSwitchItemList(CLangManager.LangInstance.GetString("MENU_RETURN"), CItemBase.EPanelType.Normal, 0, "", "", new string[] { "", "" })); + #endregion + + return l; + } + + // メソッド + public override void tActivatePopupMenu(EInstrumentPad einst) { + this.CActSelectQuickConfigMain(); + base.tActivatePopupMenu(einst); + } + //public void tDeativatePopupMenu() + //{ + // base.tDeativatePopupMenu(); + //} + + public override void t進行描画sub() { + + } + + public override void tEnter押下Main(int nSortOrder) { + switch (n現在の選択行) { + case (int)EOrder.ScrollSpeed: + OpenTaiko.ConfigIni.nScrollSpeed[OpenTaiko.SaveFile] = (int)GetObj現在値((int)EOrder.ScrollSpeed); + break; + + case (int)EOrder.PlaySpeed: + OpenTaiko.ConfigIni.nSongSpeed = (int)GetObj現在値((int)EOrder.PlaySpeed); + break; + case (int)EOrder.Random: + OpenTaiko.ConfigIni.eRandom[OpenTaiko.SaveFile] = (ERandomMode)GetIndex((int)EOrder.Random); + break; + case (int)EOrder.Stealth: + OpenTaiko.ConfigIni.eSTEALTH[OpenTaiko.SaveFile] = (EStealthMode)GetIndex((int)EOrder.Stealth); + break; + case (int)EOrder.GameMode: + EGame game = EGame.Off; + switch ((int)GetIndex((int)EOrder.GameMode)) { + case 0: game = EGame.Off; break; + case 1: game = EGame.Survival; break; + case 2: game = EGame.SurvivalHard; break; + } + OpenTaiko.ConfigIni.eGameMode = game; + break; + case (int)EOrder.ShinuchiMode: + OpenTaiko.ConfigIni.ShinuchiMode = !OpenTaiko.ConfigIni.ShinuchiMode; + break; + case (int)EOrder.PlayerCount: + OpenTaiko.ConfigIni.nPlayerCount = (int)GetObj現在値((int)EOrder.PlayerCount); + break; + case (int)EOrder.More: + SetAutoParameters(); // 簡易CONFIGメニュー脱出に伴い、簡易CONFIG内のAUTOの設定をConfigIniクラスに反映する + this.bGotoDetailConfig = true; + this.tDeativatePopupMenu(); + break; + + case (int)EOrder.Return: + SetAutoParameters(); // 簡易CONFIGメニュー脱出に伴い、簡易CONFIG内のAUTOの設定をConfigIniクラスに反映する + this.tDeativatePopupMenu(); + break; + default: + break; + } + } + + public override void tCancel() { + SetAutoParameters(); + // Autoの設定値保持のロジックを書くこと! + // (Autoのパラメータ切り替え時は実際に値設定していないため、キャンセルまたはRetern, More...時に値設定する必要有り) } + /// + /// ConfigIni.bAutoPlayに簡易CONFIGの状態を反映する + /// + private void SetAutoParameters() { + + } + + // CActivity 実装 + + public override void Activate() { + base.Activate(); + this.bGotoDetailConfig = false; + } + public override void DeActivate() { + base.DeActivate(); + } + public override void CreateManagedResource() { + this.ft表示用フォント = new CCachedFontRenderer("Arial", 26, CFontRenderer.FontStyle.Bold); + //string pathパネル本体 = CSkin.Path( @"Graphics\ScreenSelect popup auto settings.png" ); + //if ( File.Exists( pathパネル本体 ) ) + //{ + // this.txパネル本体 = CDTXMania.tテクスチャの生成( pathパネル本体, true ); + //} + + base.CreateManagedResource(); + } + public override void ReleaseManagedResource() { + if (this.ft表示用フォント != null) { + this.ft表示用フォント.Dispose(); + this.ft表示用フォント = null; + } + //CDTXMania.tテクスチャの解放( ref this.txパネル本体 ); + OpenTaiko.tテクスチャの解放(ref this.tx文字列パネル); + base.ReleaseManagedResource(); + } + + #region [ private ] + //----------------- + private int nCurrentTarget = 0; + private int nCurrentConfigSet = 0; + private List>> lci; // DrGtBs, ConfSet, 選択肢一覧。都合、3次のListとなる。 + private enum EOrder : int { + ScrollSpeed = 0, + PlaySpeed, + Random, + Stealth, + GameMode, + ShinuchiMode, + PlayerCount, + More, + Return, + END, + Default = 99 + }; + + private CCachedFontRenderer ft表示用フォント; + //private CTexture txパネル本体; + private CTexture tx文字列パネル; + private CTexture tx説明文1; + //----------------- + #endregion } diff --git a/OpenTaiko/src/Stages/05.SongSelect/CActSelectShowCurrentPosition.cs b/OpenTaiko/src/Stages/05.SongSelect/CActSelectShowCurrentPosition.cs index 8a264601..4bb46020 100644 --- a/OpenTaiko/src/Stages/05.SongSelect/CActSelectShowCurrentPosition.cs +++ b/OpenTaiko/src/Stages/05.SongSelect/CActSelectShowCurrentPosition.cs @@ -1,65 +1,65 @@ using FDK; -namespace OpenTaiko { - internal class CActSelectShowCurrentPosition : CActivity { - // メソッド +namespace OpenTaiko; - public CActSelectShowCurrentPosition() { - base.IsDeActivated = true; - } +internal class CActSelectShowCurrentPosition : CActivity { + // メソッド - // CActivity 実装 - - public override void Activate() { - if (this.IsActivated) - return; - - base.Activate(); - } - public override void DeActivate() { - base.DeActivate(); - } - public override void CreateManagedResource() { - string pathScrollBar = CSkin.Path(@$"Graphics{Path.DirectorySeparatorChar}5_scrollbar.png"); - string pathScrollPosition = CSkin.Path(@$"Graphics{Path.DirectorySeparatorChar}5_scrollbar.png"); - if (File.Exists(pathScrollBar)) { - this.txScrollBar = OpenTaiko.tテクスチャの生成(pathScrollBar, false); - } - if (File.Exists(pathScrollPosition)) { - this.txScrollPosition = OpenTaiko.tテクスチャの生成(pathScrollPosition, false); - } - base.CreateManagedResource(); - } - public override void ReleaseManagedResource() { - OpenTaiko.tDisposeSafely(ref this.txScrollBar); - OpenTaiko.tDisposeSafely(ref this.txScrollPosition); - - base.ReleaseManagedResource(); - } - public override int Draw() { - if (this.txScrollBar != null) { - #region [ スクロールバーの描画 #27648 ] - //this.txScrollBar.t2D描画( CDTXMania.app.Device, (int)(1280 - ((429.0f / 100.0f ) * CDTXMania.stage選曲.ct登場時アニメ用共通.n現在の値)), 164, new Rectangle( 0, 0, 352, 26 ) ); //移動後のxは851 - #endregion - #region [ スクロール地点の描画 (計算はCActSelect曲リストで行う。スクロール位置と選曲項目の同期のため。)#27648 ] - int py = OpenTaiko.stageSongSelect.nスクロールバー相対y座標; - if (py <= 336 && py >= 0) { - //this.txScrollBar.t2D描画( CDTXMania.app.Device, (int)( 1280 - 4 - (( 424.0f / 100.0f ) * CDTXMania.stage選曲.ct登場時アニメ用共通.n現在の値 ) ) + py, 164, new Rectangle( 352, 0, 26, 26 ) );//856 - } - #endregion - } - - return 0; - } - - - // その他 - - #region [ private ] - //----------------- - private CTexture txScrollPosition; - private CTexture txScrollBar; - //----------------- - #endregion + public CActSelectShowCurrentPosition() { + base.IsDeActivated = true; } + + // CActivity 実装 + + public override void Activate() { + if (this.IsActivated) + return; + + base.Activate(); + } + public override void DeActivate() { + base.DeActivate(); + } + public override void CreateManagedResource() { + string pathScrollBar = CSkin.Path(@$"Graphics{Path.DirectorySeparatorChar}5_scrollbar.png"); + string pathScrollPosition = CSkin.Path(@$"Graphics{Path.DirectorySeparatorChar}5_scrollbar.png"); + if (File.Exists(pathScrollBar)) { + this.txScrollBar = OpenTaiko.tテクスチャの生成(pathScrollBar, false); + } + if (File.Exists(pathScrollPosition)) { + this.txScrollPosition = OpenTaiko.tテクスチャの生成(pathScrollPosition, false); + } + base.CreateManagedResource(); + } + public override void ReleaseManagedResource() { + OpenTaiko.tDisposeSafely(ref this.txScrollBar); + OpenTaiko.tDisposeSafely(ref this.txScrollPosition); + + base.ReleaseManagedResource(); + } + public override int Draw() { + if (this.txScrollBar != null) { + #region [ スクロールバーの描画 #27648 ] + //this.txScrollBar.t2D描画( CDTXMania.app.Device, (int)(1280 - ((429.0f / 100.0f ) * CDTXMania.stage選曲.ct登場時アニメ用共通.n現在の値)), 164, new Rectangle( 0, 0, 352, 26 ) ); //移動後のxは851 + #endregion + #region [ スクロール地点の描画 (計算はCActSelect曲リストで行う。スクロール位置と選曲項目の同期のため。)#27648 ] + int py = OpenTaiko.stageSongSelect.nスクロールバー相対y座標; + if (py <= 336 && py >= 0) { + //this.txScrollBar.t2D描画( CDTXMania.app.Device, (int)( 1280 - 4 - (( 424.0f / 100.0f ) * CDTXMania.stage選曲.ct登場時アニメ用共通.n現在の値 ) ) + py, 164, new Rectangle( 352, 0, 26, 26 ) );//856 + } + #endregion + } + + return 0; + } + + + // その他 + + #region [ private ] + //----------------- + private CTexture txScrollPosition; + private CTexture txScrollBar; + //----------------- + #endregion } diff --git a/OpenTaiko/src/Stages/05.SongSelect/CActSelectSongInfo.cs b/OpenTaiko/src/Stages/05.SongSelect/CActSelectSongInfo.cs index 4a7fb29a..ed6657c7 100644 --- a/OpenTaiko/src/Stages/05.SongSelect/CActSelectSongInfo.cs +++ b/OpenTaiko/src/Stages/05.SongSelect/CActSelectSongInfo.cs @@ -2,87 +2,87 @@ using FDK; // Minimalist menu class to use for custom menus -namespace OpenTaiko { - class CActSelectSongInfo : CStage { - public CActSelectSongInfo() { - base.IsDeActivated = true; - } +namespace OpenTaiko; - public override void Activate() { - // On activation - - if (base.IsActivated) - return; - - - - base.Activate(); - } - - public override void DeActivate() { - // On de-activation - - base.DeActivate(); - } - - public override void CreateManagedResource() { - // Ressource allocation - - base.CreateManagedResource(); - } - - public override void ReleaseManagedResource() { - // Ressource freeing - - base.ReleaseManagedResource(); - } - - public override int Draw() { - if (OpenTaiko.stageSongSelect.rNowSelectedSong != null && OpenTaiko.stageSongSelect.rNowSelectedSong.eノード種別 == CSongListNode.ENodeType.SCORE) { - int[] bpms = new int[3] { - (int)OpenTaiko.stageSongSelect.rNowSelectedSong.arスコア[OpenTaiko.stageSongSelect.actSongList.tFetchDifficulty(OpenTaiko.stageSongSelect.rNowSelectedSong)].譜面情報.BaseBpm, - (int)OpenTaiko.stageSongSelect.rNowSelectedSong.arスコア[OpenTaiko.stageSongSelect.actSongList.tFetchDifficulty(OpenTaiko.stageSongSelect.rNowSelectedSong)].譜面情報.MinBpm, - (int)OpenTaiko.stageSongSelect.rNowSelectedSong.arスコア[OpenTaiko.stageSongSelect.actSongList.tFetchDifficulty(OpenTaiko.stageSongSelect.rNowSelectedSong)].譜面情報.MaxBpm - }; - for (int i = 0; i < 3; i++) { - tBPMNumberDraw(OpenTaiko.Skin.SongSelect_Bpm_X[i], OpenTaiko.Skin.SongSelect_Bpm_Y[i], bpms[i]); - } - - if (OpenTaiko.stageSongSelect.actSongList.ttkSelectedSongMaker != null && OpenTaiko.Skin.SongSelect_Maker_Show) { - TitleTextureKey.ResolveTitleTexture(OpenTaiko.stageSongSelect.actSongList.ttkSelectedSongMaker).t2D拡大率考慮描画(CTexture.RefPnt.Left, OpenTaiko.Skin.SongSelect_Maker[0], OpenTaiko.Skin.SongSelect_Maker[1]); - } - if (OpenTaiko.stageSongSelect.actSongList.ttkSelectedSongBPM != null && OpenTaiko.Skin.SongSelect_BPM_Text_Show) { - TitleTextureKey.ResolveTitleTexture(OpenTaiko.stageSongSelect.actSongList.ttkSelectedSongBPM).t2D拡大率考慮描画(CTexture.RefPnt.Left, OpenTaiko.Skin.SongSelect_BPM_Text[0], OpenTaiko.Skin.SongSelect_BPM_Text[1]); - } - if (OpenTaiko.stageSongSelect.rNowSelectedSong.bExplicit) - OpenTaiko.Tx.SongSelect_Explicit?.t2D描画(OpenTaiko.Skin.SongSelect_Explicit[0], OpenTaiko.Skin.SongSelect_Explicit[1]); - if (OpenTaiko.stageSongSelect.rNowSelectedSong.bMovie) - OpenTaiko.Tx.SongSelect_Movie?.t2D描画(OpenTaiko.Skin.SongSelect_Movie[0], OpenTaiko.Skin.SongSelect_Movie[1]); - } - - - return 0; - } - - #region [Private] - - private void tBPMNumberDraw(float originx, float originy, int num) { - int[] nums = CConversion.SeparateDigits(num); - - for (int j = 0; j < nums.Length; j++) { - if (OpenTaiko.Skin.SongSelect_Bpm_Show && OpenTaiko.Tx.SongSelect_Bpm_Number != null) { - float offset = j; - float x = originx - (OpenTaiko.Skin.SongSelect_Bpm_Interval[0] * offset); - float y = originy - (OpenTaiko.Skin.SongSelect_Bpm_Interval[1] * offset); - - float width = OpenTaiko.Tx.SongSelect_Bpm_Number.sz画像サイズ.Width / 10.0f; - float height = OpenTaiko.Tx.SongSelect_Bpm_Number.sz画像サイズ.Height; - - OpenTaiko.Tx.SongSelect_Bpm_Number.t2D描画(x, y, new RectangleF(width * nums[j], 0, width, height)); - } - } - } - - #endregion +class CActSelectSongInfo : CStage { + public CActSelectSongInfo() { + base.IsDeActivated = true; } + + public override void Activate() { + // On activation + + if (base.IsActivated) + return; + + + + base.Activate(); + } + + public override void DeActivate() { + // On de-activation + + base.DeActivate(); + } + + public override void CreateManagedResource() { + // Ressource allocation + + base.CreateManagedResource(); + } + + public override void ReleaseManagedResource() { + // Ressource freeing + + base.ReleaseManagedResource(); + } + + public override int Draw() { + if (OpenTaiko.stageSongSelect.rNowSelectedSong != null && OpenTaiko.stageSongSelect.rNowSelectedSong.eノード種別 == CSongListNode.ENodeType.SCORE) { + int[] bpms = new int[3] { + (int)OpenTaiko.stageSongSelect.rNowSelectedSong.arスコア[OpenTaiko.stageSongSelect.actSongList.tFetchDifficulty(OpenTaiko.stageSongSelect.rNowSelectedSong)].譜面情報.BaseBpm, + (int)OpenTaiko.stageSongSelect.rNowSelectedSong.arスコア[OpenTaiko.stageSongSelect.actSongList.tFetchDifficulty(OpenTaiko.stageSongSelect.rNowSelectedSong)].譜面情報.MinBpm, + (int)OpenTaiko.stageSongSelect.rNowSelectedSong.arスコア[OpenTaiko.stageSongSelect.actSongList.tFetchDifficulty(OpenTaiko.stageSongSelect.rNowSelectedSong)].譜面情報.MaxBpm + }; + for (int i = 0; i < 3; i++) { + tBPMNumberDraw(OpenTaiko.Skin.SongSelect_Bpm_X[i], OpenTaiko.Skin.SongSelect_Bpm_Y[i], bpms[i]); + } + + if (OpenTaiko.stageSongSelect.actSongList.ttkSelectedSongMaker != null && OpenTaiko.Skin.SongSelect_Maker_Show) { + TitleTextureKey.ResolveTitleTexture(OpenTaiko.stageSongSelect.actSongList.ttkSelectedSongMaker).t2D拡大率考慮描画(CTexture.RefPnt.Left, OpenTaiko.Skin.SongSelect_Maker[0], OpenTaiko.Skin.SongSelect_Maker[1]); + } + if (OpenTaiko.stageSongSelect.actSongList.ttkSelectedSongBPM != null && OpenTaiko.Skin.SongSelect_BPM_Text_Show) { + TitleTextureKey.ResolveTitleTexture(OpenTaiko.stageSongSelect.actSongList.ttkSelectedSongBPM).t2D拡大率考慮描画(CTexture.RefPnt.Left, OpenTaiko.Skin.SongSelect_BPM_Text[0], OpenTaiko.Skin.SongSelect_BPM_Text[1]); + } + if (OpenTaiko.stageSongSelect.rNowSelectedSong.bExplicit) + OpenTaiko.Tx.SongSelect_Explicit?.t2D描画(OpenTaiko.Skin.SongSelect_Explicit[0], OpenTaiko.Skin.SongSelect_Explicit[1]); + if (OpenTaiko.stageSongSelect.rNowSelectedSong.bMovie) + OpenTaiko.Tx.SongSelect_Movie?.t2D描画(OpenTaiko.Skin.SongSelect_Movie[0], OpenTaiko.Skin.SongSelect_Movie[1]); + } + + + return 0; + } + + #region [Private] + + private void tBPMNumberDraw(float originx, float originy, int num) { + int[] nums = CConversion.SeparateDigits(num); + + for (int j = 0; j < nums.Length; j++) { + if (OpenTaiko.Skin.SongSelect_Bpm_Show && OpenTaiko.Tx.SongSelect_Bpm_Number != null) { + float offset = j; + float x = originx - (OpenTaiko.Skin.SongSelect_Bpm_Interval[0] * offset); + float y = originy - (OpenTaiko.Skin.SongSelect_Bpm_Interval[1] * offset); + + float width = OpenTaiko.Tx.SongSelect_Bpm_Number.sz画像サイズ.Width / 10.0f; + float height = OpenTaiko.Tx.SongSelect_Bpm_Number.sz画像サイズ.Height; + + OpenTaiko.Tx.SongSelect_Bpm_Number.t2D描画(x, y, new RectangleF(width * nums[j], 0, width, height)); + } + } + } + + #endregion } diff --git a/OpenTaiko/src/Stages/05.SongSelect/CActSelectTowerInfo.cs b/OpenTaiko/src/Stages/05.SongSelect/CActSelectTowerInfo.cs index 31ef4d46..e55fc943 100644 --- a/OpenTaiko/src/Stages/05.SongSelect/CActSelectTowerInfo.cs +++ b/OpenTaiko/src/Stages/05.SongSelect/CActSelectTowerInfo.cs @@ -2,69 +2,69 @@ using FDK; // Minimalist menu class to use for custom menus -namespace OpenTaiko { - class CActSelectTowerInfo : CStage { - public CActSelectTowerInfo() { - base.IsDeActivated = true; - } +namespace OpenTaiko; - public override void Activate() { - // On activation +class CActSelectTowerInfo : CStage { + public CActSelectTowerInfo() { + base.IsDeActivated = true; + } - if (base.IsActivated) - return; + public override void Activate() { + // On activation + + if (base.IsActivated) + return; - base.Activate(); - } + base.Activate(); + } - public override void DeActivate() { - // On de-activation + public override void DeActivate() { + // On de-activation - base.DeActivate(); - } + base.DeActivate(); + } - public override void CreateManagedResource() { + public override void CreateManagedResource() { - // Ressource allocation + // Ressource allocation - base.CreateManagedResource(); - } + base.CreateManagedResource(); + } - public override void ReleaseManagedResource() { + public override void ReleaseManagedResource() { - // Ressource freeing + // Ressource freeing - base.ReleaseManagedResource(); - } + base.ReleaseManagedResource(); + } - public override int Draw() { - if (OpenTaiko.stageSongSelect.rNowSelectedSong.arスコア[5] != null) + public override int Draw() { + if (OpenTaiko.stageSongSelect.rNowSelectedSong.arスコア[5] != null) tFloorNumberDraw(OpenTaiko.Skin.SongSelect_FloorNum_X, OpenTaiko.Skin.SongSelect_FloorNum_Y, OpenTaiko.stageSongSelect.rNowSelectedSong.arスコア[5].譜面情報.nTotalFloor); - return 0; - } + return 0; + } - #region [Private] + #region [Private] - private void tFloorNumberDraw(float originx, float originy, int num) { - int[] nums = CConversion.SeparateDigits(num); + private void tFloorNumberDraw(float originx, float originy, int num) { + int[] nums = CConversion.SeparateDigits(num); - for (int j = 0; j < nums.Length; j++) { - if (OpenTaiko.Skin.SongSelect_FloorNum_Show && OpenTaiko.Tx.SongSelect_Floor_Number != null) { - float offset = j; - float x = originx - (OpenTaiko.Skin.SongSelect_FloorNum_Interval[0] * offset); - float y = originy - (OpenTaiko.Skin.SongSelect_FloorNum_Interval[1] * offset); + for (int j = 0; j < nums.Length; j++) { + if (OpenTaiko.Skin.SongSelect_FloorNum_Show && OpenTaiko.Tx.SongSelect_Floor_Number != null) { + float offset = j; + float x = originx - (OpenTaiko.Skin.SongSelect_FloorNum_Interval[0] * offset); + float y = originy - (OpenTaiko.Skin.SongSelect_FloorNum_Interval[1] * offset); - float width = OpenTaiko.Tx.SongSelect_Floor_Number.sz画像サイズ.Width / 10.0f; - float height = OpenTaiko.Tx.SongSelect_Floor_Number.sz画像サイズ.Height; + float width = OpenTaiko.Tx.SongSelect_Floor_Number.sz画像サイズ.Width / 10.0f; + float height = OpenTaiko.Tx.SongSelect_Floor_Number.sz画像サイズ.Height; - OpenTaiko.Tx.SongSelect_Floor_Number.t2D描画(x, y, new RectangleF(width * nums[j], 0, width, height)); - } + OpenTaiko.Tx.SongSelect_Floor_Number.t2D描画(x, y, new RectangleF(width * nums[j], 0, width, height)); } } - - #endregion } + + #endregion } diff --git a/OpenTaiko/src/Stages/05.SongSelect/CActSelectステータスパネル.cs b/OpenTaiko/src/Stages/05.SongSelect/CActSelectステータスパネル.cs index 2031f93b..b1a716be 100644 --- a/OpenTaiko/src/Stages/05.SongSelect/CActSelectステータスパネル.cs +++ b/OpenTaiko/src/Stages/05.SongSelect/CActSelectステータスパネル.cs @@ -1,46 +1,46 @@ using FDK; -namespace OpenTaiko { - internal class CActSelectステータスパネル : CActivity { - // メソッド +namespace OpenTaiko; - public CActSelectステータスパネル() { - base.IsDeActivated = true; - } - public void t選択曲が変更された() { +internal class CActSelectステータスパネル : CActivity { + // メソッド - } - - - // CActivity 実装 - - public override void Activate() { - - base.Activate(); - } - public override void DeActivate() { - - base.DeActivate(); - } - public override void CreateManagedResource() { - base.CreateManagedResource(); - } - public override void ReleaseManagedResource() { - base.ReleaseManagedResource(); - } - public override int Draw() { - if (!base.IsDeActivated) { - - } - return 0; - } - - - // その他 - - #region [ private ] - //----------------- - //----------------- - #endregion + public CActSelectステータスパネル() { + base.IsDeActivated = true; } + public void t選択曲が変更された() { + + } + + + // CActivity 実装 + + public override void Activate() { + + base.Activate(); + } + public override void DeActivate() { + + base.DeActivate(); + } + public override void CreateManagedResource() { + base.CreateManagedResource(); + } + public override void ReleaseManagedResource() { + base.ReleaseManagedResource(); + } + public override int Draw() { + if (!base.IsDeActivated) { + + } + return 0; + } + + + // その他 + + #region [ private ] + //----------------- + //----------------- + #endregion } diff --git a/OpenTaiko/src/Stages/05.SongSelect/CActSelect曲リスト.cs b/OpenTaiko/src/Stages/05.SongSelect/CActSelect曲リスト.cs index faf900ce..7ea76b8b 100644 --- a/OpenTaiko/src/Stages/05.SongSelect/CActSelect曲リスト.cs +++ b/OpenTaiko/src/Stages/05.SongSelect/CActSelect曲リスト.cs @@ -6,1008 +6,819 @@ using Color = System.Drawing.Color; using Rectangle = System.Drawing.Rectangle; using RectangleF = System.Drawing.RectangleF; -namespace OpenTaiko { - internal class CActSelect曲リスト : CActivity { - // Properties +namespace OpenTaiko; - public bool bIsEnumeratingSongs { - get; - set; +internal class CActSelect曲リスト : CActivity { + // Properties + + public bool bIsEnumeratingSongs { + get; + set; + } + public bool bスクロール中 { + get { + return ctScrollCounter.CurrentValue != ctScrollCounter.EndValue; } - public bool bスクロール中 { - get { - return ctScrollCounter.CurrentValue != ctScrollCounter.EndValue; + } + public double fNowScrollAnime { + get { + double value = ctScrollCounter.CurrentValue / 1000.0; + return Math.Sin(value * Math.PI / 2.0); + } + } + public int n現在のアンカ難易度レベル { + get; + private set; + } + public int n現在選択中の曲の現在の難易度レベル { + get { + return this.n現在のアンカ難易度レベルに最も近い難易度レベルを返す(this.rCurrentlySelectedSong); + } + } + public Cスコア r現在選択中のスコア { + get { + if (this.rCurrentlySelectedSong != null) { + return this.rCurrentlySelectedSong.arスコア[this.n現在選択中の曲の現在の難易度レベル]; } + return null; } - public double fNowScrollAnime { - get { - double value = ctScrollCounter.CurrentValue / 1000.0; - return Math.Sin(value * Math.PI / 2.0); - } + } + public int nSelectSongIndex { + get; + private set; + } + public CSongListNode rPrevSelectedSong { + get; + private set; + } + private CSongListNode _rNowSelectedSong; + public CSongListNode rCurrentlySelectedSong { + get { + return _rNowSelectedSong; } - public int n現在のアンカ難易度レベル { - get; - private set; - } - public int n現在選択中の曲の現在の難易度レベル { - get { - return this.n現在のアンカ難易度レベルに最も近い難易度レベルを返す(this.rCurrentlySelectedSong); - } - } - public Cスコア r現在選択中のスコア { - get { - if (this.rCurrentlySelectedSong != null) { - return this.rCurrentlySelectedSong.arスコア[this.n現在選択中の曲の現在の難易度レベル]; - } - return null; - } - } - public int nSelectSongIndex { - get; - private set; - } - public CSongListNode rPrevSelectedSong { - get; - private set; - } - private CSongListNode _rNowSelectedSong; - public CSongListNode rCurrentlySelectedSong { - get { - return _rNowSelectedSong; - } - set { - rPrevSelectedSong = rCurrentlySelectedSong; - _rNowSelectedSong = value; - } + set { + rPrevSelectedSong = rCurrentlySelectedSong; + _rNowSelectedSong = value; } + } - public TitleTextureKey? ttkNowUnlockConditionText = null; + public TitleTextureKey? ttkNowUnlockConditionText = null; - public void ResetSongIndex() { - nSelectSongIndex = 0; - this.rCurrentlySelectedSong = OpenTaiko.Songs管理.list曲ルート[nSelectSongIndex]; - } + public void ResetSongIndex() { + nSelectSongIndex = 0; + this.rCurrentlySelectedSong = OpenTaiko.Songs管理.list曲ルート[nSelectSongIndex]; + } - public int nスクロールバー相対y座標 { - get; - private set; - } + public int nスクロールバー相対y座標 { + get; + private set; + } - // t選択曲が変更された()内で使う、直前の選曲の保持 - // (前と同じ曲なら選択曲変更に掛かる再計算を省略して高速化するため) - private CSongListNode song_last = null; + // t選択曲が変更された()内で使う、直前の選曲の保持 + // (前と同じ曲なら選択曲変更に掛かる再計算を省略して高速化するため) + private CSongListNode song_last = null; - // Constructor + // Constructor - public CActSelect曲リスト() { + public CActSelect曲リスト() { - this.nSelectSongIndex = 0; - this.rCurrentlySelectedSong = null; + this.nSelectSongIndex = 0; + this.rCurrentlySelectedSong = null; - this.n現在のアンカ難易度レベル = Math.Min((int)Difficulty.Edit, OpenTaiko.ConfigIni.nDefaultCourse); - base.IsDeActivated = true; - this.bIsEnumeratingSongs = false; + this.n現在のアンカ難易度レベル = Math.Min((int)Difficulty.Edit, OpenTaiko.ConfigIni.nDefaultCourse); + base.IsDeActivated = true; + this.bIsEnumeratingSongs = false; + } + + + // メソッド + + // Closest level + public int n現在のアンカ難易度レベルに最も近い難易度レベルを返す(CSongListNode song) { + // 事前チェック。 + + if (song == null) + return this.n現在のアンカ難易度レベル; // 曲がまったくないよ + + if (song.arスコア[this.n現在のアンカ難易度レベル] != null) + return this.n現在のアンカ難易度レベル; // 難易度ぴったりの曲があったよ + + if ((song.eノード種別 == CSongListNode.ENodeType.BOX) || (song.eノード種別 == CSongListNode.ENodeType.BACKBOX)) + return 0; // BOX と BACKBOX は関係無いよ + + + // 現在のアンカレベルから、難易度上向きに検索開始。 + + int n最も近いレベル = this.n現在のアンカ難易度レベル; + + for (int i = 0; i < (int)Difficulty.Total; i++) { + if (song.arスコア[n最も近いレベル] != null) + break; // 曲があった。 + + n最も近いレベル = (n最も近いレベル + 1) % (int)Difficulty.Total; // 曲がなかったので次の難易度レベルへGo。(5以上になったら0に戻る。) } - // メソッド + // 見つかった曲がアンカより下のレベルだった場合…… + // アンカから下向きに検索すれば、もっとアンカに近い曲があるんじゃね? - // Closest level - public int n現在のアンカ難易度レベルに最も近い難易度レベルを返す(CSongListNode song) { - // 事前チェック。 + if (n最も近いレベル < this.n現在のアンカ難易度レベル) { + // 現在のアンカレベルから、難易度下向きに検索開始。 - if (song == null) - return this.n現在のアンカ難易度レベル; // 曲がまったくないよ - - if (song.arスコア[this.n現在のアンカ難易度レベル] != null) - return this.n現在のアンカ難易度レベル; // 難易度ぴったりの曲があったよ - - if ((song.eノード種別 == CSongListNode.ENodeType.BOX) || (song.eノード種別 == CSongListNode.ENodeType.BACKBOX)) - return 0; // BOX と BACKBOX は関係無いよ - - - // 現在のアンカレベルから、難易度上向きに検索開始。 - - int n最も近いレベル = this.n現在のアンカ難易度レベル; + n最も近いレベル = this.n現在のアンカ難易度レベル; for (int i = 0; i < (int)Difficulty.Total; i++) { if (song.arスコア[n最も近いレベル] != null) break; // 曲があった。 - n最も近いレベル = (n最も近いレベル + 1) % (int)Difficulty.Total; // 曲がなかったので次の難易度レベルへGo。(5以上になったら0に戻る。) + n最も近いレベル = ((n最も近いレベル - 1) + (int)Difficulty.Total) % (int)Difficulty.Total; // 曲がなかったので次の難易度レベルへGo。(0未満になったら4に戻る。) } - - - // 見つかった曲がアンカより下のレベルだった場合…… - // アンカから下向きに検索すれば、もっとアンカに近い曲があるんじゃね? - - if (n最も近いレベル < this.n現在のアンカ難易度レベル) { - // 現在のアンカレベルから、難易度下向きに検索開始。 - - n最も近いレベル = this.n現在のアンカ難易度レベル; - - for (int i = 0; i < (int)Difficulty.Total; i++) { - if (song.arスコア[n最も近いレベル] != null) - break; // 曲があった。 - - n最も近いレベル = ((n最も近いレベル - 1) + (int)Difficulty.Total) % (int)Difficulty.Total; // 曲がなかったので次の難易度レベルへGo。(0未満になったら4に戻る。) - } - } - - return n最も近いレベル; - } - public CSongListNode r指定された曲が存在するリストの先頭の曲(CSongListNode song) { - List songList = GetSongListWithinMe(song); - return (songList == null) ? null : songList[0]; - } - public CSongListNode r指定された曲が存在するリストの末尾の曲(CSongListNode song) { - List songList = GetSongListWithinMe(song); - return (songList == null) ? null : songList[songList.Count - 1]; } - private List GetSongListWithinMe(CSongListNode song) { - if (song.rParentNode == null) // root階層のノートだったら - { - return OpenTaiko.Songs管理.list曲ルート; // rootのリストを返す + return n最も近いレベル; + } + public CSongListNode r指定された曲が存在するリストの先頭の曲(CSongListNode song) { + List songList = GetSongListWithinMe(song); + return (songList == null) ? null : songList[0]; + } + public CSongListNode r指定された曲が存在するリストの末尾の曲(CSongListNode song) { + List songList = GetSongListWithinMe(song); + return (songList == null) ? null : songList[songList.Count - 1]; + } + + private List GetSongListWithinMe(CSongListNode song) { + if (song.rParentNode == null) // root階層のノートだったら + { + return OpenTaiko.Songs管理.list曲ルート; // rootのリストを返す + } else { + if ((song.rParentNode.list子リスト != null) && (song.rParentNode.list子リスト.Count > 0)) { + return song.rParentNode.list子リスト; } else { - if ((song.rParentNode.list子リスト != null) && (song.rParentNode.list子リスト.Count > 0)) { - return song.rParentNode.list子リスト; - } else { - return null; + return null; + } + } + } + + + public delegate void DGSortFunc(List songList, EInstrumentPad eInst, int order, params object[] p); + /// + /// 主にCSong管理.cs内にあるソート機能を、delegateで呼び出す。 + /// + /// ソート用に呼び出すメソッド + /// ソート基準とする楽器 + /// -1=降順, 1=昇順 + public void t曲リストのソート(DGSortFunc sf, EInstrumentPad eInst, int order, params object[] p) { + List songList = GetSongListWithinMe(this.rCurrentlySelectedSong); + if (songList == null) { + // 何もしない; + } else { + // CDTXMania.Songs管理.t曲リストのソート3_演奏回数の多い順( songList, eInst, order ); + sf(songList, eInst, order, p); + // this.r現在選択中の曲 = CDTXMania + void addBackBox(List list, string parentName = "/") { + foreach (CSongListNode node in list) { + if (node.eノード種別 != CSongListNode.ENodeType.BOX) continue; + string newPath = parentName + node.ldTitle.GetString("") + "/"; + CSongDict.tReinsertBackButtons(node, node.list子リスト, newPath, OpenTaiko.Songs管理.listStrBoxDefSkinSubfolderFullName); + + addBackBox(node.list子リスト, newPath); } } + addBackBox(OpenTaiko.Songs管理.list曲ルート); + this.t現在選択中の曲を元に曲バーを再構成する(); + tChangeSong(0); + this.t選択曲が変更された(false); + tUpdateCurSong(); + OpenTaiko.stageSongSelect.tNotifySelectedSongChange(); } + } + public void tResetTitleKey() { + this.ttkSelectedSongTitle = null; + this.ttkSelectedSongSubtitle = null; + this.ttkSelectedSongMaker = null; + this.ttkSelectedSongBPM = null; + } - public delegate void DGSortFunc(List songList, EInstrumentPad eInst, int order, params object[] p); - /// - /// 主にCSong管理.cs内にあるソート機能を、delegateで呼び出す。 - /// - /// ソート用に呼び出すメソッド - /// ソート基準とする楽器 - /// -1=降順, 1=昇順 - public void t曲リストのソート(DGSortFunc sf, EInstrumentPad eInst, int order, params object[] p) { - List songList = GetSongListWithinMe(this.rCurrentlySelectedSong); - if (songList == null) { - // 何もしない; - } else { - // CDTXMania.Songs管理.t曲リストのソート3_演奏回数の多い順( songList, eInst, order ); - sf(songList, eInst, order, p); - // this.r現在選択中の曲 = CDTXMania - void addBackBox(List list, string parentName = "/") { - foreach (CSongListNode node in list) { - if (node.eノード種別 != CSongListNode.ENodeType.BOX) continue; - string newPath = parentName + node.ldTitle.GetString("") + "/"; - CSongDict.tReinsertBackButtons(node, node.list子リスト, newPath, OpenTaiko.Songs管理.listStrBoxDefSkinSubfolderFullName); - - addBackBox(node.list子リスト, newPath); - } - } - addBackBox(OpenTaiko.Songs管理.list曲ルート); - this.t現在選択中の曲を元に曲バーを再構成する(); - tChangeSong(0); - this.t選択曲が変更された(false); - tUpdateCurSong(); - OpenTaiko.stageSongSelect.tNotifySelectedSongChange(); - } - } - - public void tResetTitleKey() { - this.ttkSelectedSongTitle = null; - this.ttkSelectedSongSubtitle = null; - this.ttkSelectedSongMaker = null; - this.ttkSelectedSongBPM = null; - } - - public bool tBOXに入る() { - //Trace.TraceInformation( "box enter" ); - //Trace.TraceInformation( "Skin現在Current : " + CDTXMania.Skin.GetCurrentSkinSubfolderFullName(false) ); - //Trace.TraceInformation( "Skin現在System : " + CSkin.strSystemSkinSubfolderFullName ); - //Trace.TraceInformation( "Skin現在BoxDef : " + CSkin.strBoxDefSkinSubfolderFullName ); - //Trace.TraceInformation( "Skin現在: " + CSkin.GetSkinName( CDTXMania.Skin.GetCurrentSkinSubfolderFullName(false) ) ); - //Trace.TraceInformation( "Skin現pt: " + CDTXMania.Skin.GetCurrentSkinSubfolderFullName(false) ); - //Trace.TraceInformation( "Skin指定: " + CSkin.GetSkinName( this.r現在選択中の曲.strSkinPath ) ); - //Trace.TraceInformation( "Skinpath: " + this.r現在選択中の曲.strSkinPath ); - bool ret = false; - if (CSkin.GetSkinName(OpenTaiko.Skin.GetCurrentSkinSubfolderFullName(false)) != CSkin.GetSkinName(this.rCurrentlySelectedSong.strSkinPath) - && CSkin.bUseBoxDefSkin) { - ret = true; - // BOXに入るときは、スキン変更発生時のみboxdefスキン設定の更新を行う - OpenTaiko.Skin.SetCurrentSkinSubfolderFullName( - OpenTaiko.Skin.GetSkinSubfolderFullNameFromSkinName(CSkin.GetSkinName(this.rCurrentlySelectedSong.strSkinPath)), false); - } - - //Trace.TraceInformation( "Skin変更: " + CSkin.GetSkinName( CDTXMania.Skin.GetCurrentSkinSubfolderFullName(false) ) ); - //Trace.TraceInformation( "Skin変更Current : "+ CDTXMania.Skin.GetCurrentSkinSubfolderFullName(false) ); - //Trace.TraceInformation( "Skin変更System : "+ CSkin.strSystemSkinSubfolderFullName ); - //Trace.TraceInformation( "Skin変更BoxDef : "+ CSkin.strBoxDefSkinSubfolderFullName ); - - tResetTitleTextureKey(); - - // INFO: This null check is added due to `list子リスト` might be null during rapid sorting - // Despite what editor tell you here it is possible to be null - if (rCurrentlySelectedSong != null && - rCurrentlySelectedSong.list子リスト != null && - rCurrentlySelectedSong.list子リスト.Count != 1) { - if (OpenTaiko.ConfigIni.TJAP3FolderMode) { - this.rCurrentlySelectedSong = this.rCurrentlySelectedSong.list子リスト[0]; - nSelectSongIndex = 0; - tChangeSong(this.rCurrentlySelectedSong.rParentNode.Openindex); - } else { - //実際には親フォルダを消さないように変更 - - this.rCurrentlySelectedSong.bIsOpenFolder = true; - - // Previous index - int n回数 = this.rCurrentlySelectedSong.Openindex; - if (this.rCurrentlySelectedSong.Openindex >= this.rCurrentlySelectedSong.list子リスト.Count()) - n回数 = 0; - - tChangeSong(n回数); - } - - this.t現在選択中の曲を元に曲バーを再構成する(); - this.t選択曲が変更された(false); - - OpenTaiko.stageSongSelect.tNotifySelectedSongChange(); // #27648 項目数変更を反映させる - this.b選択曲が変更された = true; - // TJAPlayer3.Skin.bgm選曲画面.t停止する(); - CSongSelectSongManager.stopSong(); - } - return ret; - } - - public void tReturnToRootBox() { - while (this.rCurrentlySelectedSong.rParentNode != null) - tCloseBOX(); - } - - - public bool tCloseBOX() { - - bool ret = false; - if (CSkin.GetSkinName(OpenTaiko.Skin.GetCurrentSkinSubfolderFullName(false)) != CSkin.GetSkinName(this.rCurrentlySelectedSong.strSkinPath) - && CSkin.bUseBoxDefSkin) { - ret = true; - } - // スキン変更が発生しなくても、boxdef圏外に出る場合は、boxdefスキン設定の更新が必要 - // (ユーザーがboxdefスキンをConfig指定している場合への対応のために必要) - // tBoxに入る()とは処理が微妙に異なるので注意 + public bool tBOXに入る() { + //Trace.TraceInformation( "box enter" ); + //Trace.TraceInformation( "Skin現在Current : " + CDTXMania.Skin.GetCurrentSkinSubfolderFullName(false) ); + //Trace.TraceInformation( "Skin現在System : " + CSkin.strSystemSkinSubfolderFullName ); + //Trace.TraceInformation( "Skin現在BoxDef : " + CSkin.strBoxDefSkinSubfolderFullName ); + //Trace.TraceInformation( "Skin現在: " + CSkin.GetSkinName( CDTXMania.Skin.GetCurrentSkinSubfolderFullName(false) ) ); + //Trace.TraceInformation( "Skin現pt: " + CDTXMania.Skin.GetCurrentSkinSubfolderFullName(false) ); + //Trace.TraceInformation( "Skin指定: " + CSkin.GetSkinName( this.r現在選択中の曲.strSkinPath ) ); + //Trace.TraceInformation( "Skinpath: " + this.r現在選択中の曲.strSkinPath ); + bool ret = false; + if (CSkin.GetSkinName(OpenTaiko.Skin.GetCurrentSkinSubfolderFullName(false)) != CSkin.GetSkinName(this.rCurrentlySelectedSong.strSkinPath) + && CSkin.bUseBoxDefSkin) { + ret = true; + // BOXに入るときは、スキン変更発生時のみboxdefスキン設定の更新を行う OpenTaiko.Skin.SetCurrentSkinSubfolderFullName( - (this.rCurrentlySelectedSong.strSkinPath == "") ? "" : OpenTaiko.Skin.GetSkinSubfolderFullNameFromSkinName(CSkin.GetSkinName(this.rCurrentlySelectedSong.strSkinPath)), false); + OpenTaiko.Skin.GetSkinSubfolderFullNameFromSkinName(CSkin.GetSkinName(this.rCurrentlySelectedSong.strSkinPath)), false); + } - tResetTitleTextureKey(); + //Trace.TraceInformation( "Skin変更: " + CSkin.GetSkinName( CDTXMania.Skin.GetCurrentSkinSubfolderFullName(false) ) ); + //Trace.TraceInformation( "Skin変更Current : "+ CDTXMania.Skin.GetCurrentSkinSubfolderFullName(false) ); + //Trace.TraceInformation( "Skin変更System : "+ CSkin.strSystemSkinSubfolderFullName ); + //Trace.TraceInformation( "Skin変更BoxDef : "+ CSkin.strBoxDefSkinSubfolderFullName ); + tResetTitleTextureKey(); + + // INFO: This null check is added due to `list子リスト` might be null during rapid sorting + // Despite what editor tell you here it is possible to be null + if (rCurrentlySelectedSong != null && + rCurrentlySelectedSong.list子リスト != null && + rCurrentlySelectedSong.list子リスト.Count != 1) { if (OpenTaiko.ConfigIni.TJAP3FolderMode) { - if (this.rCurrentlySelectedSong.rParentNode != null) { - this.rCurrentlySelectedSong = this.rCurrentlySelectedSong.rParentNode; - this.rCurrentlySelectedSong.Openindex = nSelectSongIndex; - tChangeSong(OpenTaiko.Songs管理.list曲ルート.IndexOf(this.rCurrentlySelectedSong) - nSelectSongIndex); - } + this.rCurrentlySelectedSong = this.rCurrentlySelectedSong.list子リスト[0]; + nSelectSongIndex = 0; + tChangeSong(this.rCurrentlySelectedSong.rParentNode.Openindex); } else { - // Reindex the parent node - List currentSongList = flattenList(OpenTaiko.Songs管理.list曲ルート, true); - this.rCurrentlySelectedSong.rParentNode.Openindex = currentSongList.IndexOf(this.rCurrentlySelectedSong) - currentSongList.IndexOf(this.rCurrentlySelectedSong.rParentNode.list子リスト[0]); - this.rCurrentlySelectedSong.rParentNode.bIsOpenFolder = false; - tChangeSong(-this.rCurrentlySelectedSong.rParentNode.Openindex); + //実際には親フォルダを消さないように変更 + this.rCurrentlySelectedSong.bIsOpenFolder = true; + // Previous index + int n回数 = this.rCurrentlySelectedSong.Openindex; + if (this.rCurrentlySelectedSong.Openindex >= this.rCurrentlySelectedSong.list子リスト.Count()) + n回数 = 0; + + tChangeSong(n回数); } this.t現在選択中の曲を元に曲バーを再構成する(); - this.t選択曲が変更された(false); // #27648 項目数変更を反映させる + this.t選択曲が変更された(false); + + OpenTaiko.stageSongSelect.tNotifySelectedSongChange(); // #27648 項目数変更を反映させる this.b選択曲が変更された = true; - - return ret; + // TJAPlayer3.Skin.bgm選曲画面.t停止する(); + CSongSelectSongManager.stopSong(); } + return ret; + } + + public void tReturnToRootBox() { + while (this.rCurrentlySelectedSong.rParentNode != null) + tCloseBOX(); + } - public List flattenList(List list, bool useOpenFlag = false) { - List ret = new List(); + public bool tCloseBOX() { - //foreach (var e in list) - for (int i = 0; i < list.Count; i++) { - var e = list[i]; - if (!useOpenFlag || !e.bIsOpenFolder) ret.Add(e); - - if (e.eノード種別 == CSongListNode.ENodeType.BOX && - (!useOpenFlag || e.bIsOpenFolder)) { - ret.AddRange(flattenList(e.list子リスト, useOpenFlag)); - } - } - - return (ret); + bool ret = false; + if (CSkin.GetSkinName(OpenTaiko.Skin.GetCurrentSkinSubfolderFullName(false)) != CSkin.GetSkinName(this.rCurrentlySelectedSong.strSkinPath) + && CSkin.bUseBoxDefSkin) { + ret = true; } + // スキン変更が発生しなくても、boxdef圏外に出る場合は、boxdefスキン設定の更新が必要 + // (ユーザーがboxdefスキンをConfig指定している場合への対応のために必要) + // tBoxに入る()とは処理が微妙に異なるので注意 + OpenTaiko.Skin.SetCurrentSkinSubfolderFullName( + (this.rCurrentlySelectedSong.strSkinPath == "") ? "" : OpenTaiko.Skin.GetSkinSubfolderFullNameFromSkinName(CSkin.GetSkinName(this.rCurrentlySelectedSong.strSkinPath)), false); - public void t現在選択中の曲を元に曲バーを再構成する() { - this.tバーの初期化(); - } - public void t次に移動() { - if (this.rCurrentlySelectedSong != null) { - nNowChange = 1; - ctScoreFrameAnime.Stop(); - ctScoreFrameAnime.CurrentValue = 0; - ctBarOpen.Stop(); - ctBarOpen.CurrentValue = 0; - this.ctScrollCounter = new CCounter(0, 1000, OpenTaiko.Skin.SongSelect_Scroll_Interval, OpenTaiko.Timer); + tResetTitleTextureKey(); - - #region [ パネルを1行上にシフトする。] - //----------------- - - int barCenterNum = (OpenTaiko.Skin.SongSelect_Bar_Count - 1) / 2; - - // 選択曲と選択行を1つ下の行に移動。 - - tChangeSong(1); - this.n現在の選択行 = (this.n現在の選択行 + 1) % OpenTaiko.Skin.SongSelect_Bar_Count; - - // 選択曲から7つ下のパネル(=新しく最下部に表示されるパネル。消えてしまう一番上のパネルを再利用する)に、新しい曲の情報を記載する。 - - var song = this.rGetSideSong(barCenterNum); - - int index = (this.n現在の選択行 + barCenterNum) % OpenTaiko.Skin.SongSelect_Bar_Count; // 新しく最下部に表示されるパネルのインデックス(0~12)。 - this.stバー情報[index].strタイトル文字列 = song.ldTitle.GetString(""); - this.stバー情報[index].ForeColor = song.ForeColor; - this.stバー情報[index].BackColor = song.BackColor; - this.stバー情報[index].BoxColor = song.BoxColor; - this.stバー情報[index].BgColor = song.BgColor; - - // Set default if unchanged here - this.stバー情報[index].BoxType = song.BoxType; - this.stバー情報[index].BgType = song.BgType; - - this.stバー情報[index].BgTypeChanged = song.isChangedBgType; - this.stバー情報[index].BoxTypeChanged = song.isChangedBoxType; - - this.stバー情報[index].BoxChara = song.BoxChara; - this.stバー情報[index].BoxCharaChanged = song.isChangedBoxChara; - - this.stバー情報[index].strジャンル = song.strジャンル; - this.stバー情報[index].strサブタイトル = song.ldSubtitle.GetString(""); - this.stバー情報[index].ar難易度 = song.nLevel; - this.stバー情報[index].nLevelIcon = song.nLevelIcon; - - for (int f = 0; f < (int)Difficulty.Total; f++) { - if (song.arスコア[f] != null) - this.stバー情報[index].b分岐 = song.arスコア[f].譜面情報.b譜面分岐; - } - - #region [Reroll cases] - - if (stバー情報[index].nクリア == null) - this.stバー情報[index].nクリア = new int[2][]; - if (stバー情報[index].nスコアランク == null) - this.stバー情報[index].nスコアランク = new int[2][]; - - for (int i = 0; i < 2; i++) { - this.stバー情報[index].nクリア[i] = new int[5]; - this.stバー情報[index].nスコアランク[i] = new int[5]; - - int ap = OpenTaiko.GetActualPlayer(i); - //var sr = song.arスコア[n現在のアンカ難易度レベルに最も近い難易度レベルを返す(song)]; - - var TableEntry = OpenTaiko.SaveFileInstances[ap].data.tGetSongSelectTableEntry(song.tGetUniqueId()); - - this.stバー情報[index].nクリア[i] = TableEntry.ClearStatuses; - this.stバー情報[index].nスコアランク[i] = TableEntry.ScoreRanks; - } - - this.stバー情報[index].csu = song.uniqueId; - this.stバー情報[index].reference = song; - - #endregion - - // stバー情報[] の内容を1行ずつずらす。 - - - for (int i = 0; i < OpenTaiko.Skin.SongSelect_Bar_Count; i++) { - CSongListNode song2 = this.rGetSideSong(i - barCenterNum); - int n = (((this.n現在の選択行 - barCenterNum) + i) + OpenTaiko.Skin.SongSelect_Bar_Count) % OpenTaiko.Skin.SongSelect_Bar_Count; - this.stバー情報[n].eバー種別 = this.e曲のバー種別を返す(song2); - this.stバー情報[n].ttkタイトル = this.ttkGenerateSongNameTexture(this.stバー情報[n].strタイトル文字列, this.stバー情報[n].ForeColor, this.stバー情報[n].BackColor, stバー情報[n].eバー種別 == Eバー種別.Box ? this.pfBoxName : this.pfMusicName); - } - - - // 新しく最下部に表示されるパネル用のスキル値を取得。 - - for (int i = 0; i < 3; i++) - this.stバー情報[index].nスキル値[i] = (int)song.arスコア[this.n現在のアンカ難易度レベルに最も近い難易度レベルを返す(song)].譜面情報.最大スキル[i]; - - - // 1行(100カウント)移動完了。 - - this.t選択曲が変更された(false); // スクロールバー用に今何番目を選択しているかを更新 - - - - { - OpenTaiko.stageSongSelect.tNotifySelectedSongChange(); // スクロール完了=選択曲変更! - ctBarOpen.Start(0, 260, 2, OpenTaiko.Timer); - - OpenTaiko.stageSongSelect.NowGenre = this.rCurrentlySelectedSong.strジャンル; - - OpenTaiko.stageSongSelect.NowBg = this.rCurrentlySelectedSong.BgType; - - OpenTaiko.stageSongSelect.NowBgColor = this.rCurrentlySelectedSong.BgColor; - - OpenTaiko.stageSongSelect.NowUseGenre = !this.rCurrentlySelectedSong.isChangedBgType; - - ctScoreFrameAnime.Start(0, 6000, 1, OpenTaiko.Timer); - } - - //----------------- - #endregion - - - tResetTitleTextureKey(); + if (OpenTaiko.ConfigIni.TJAP3FolderMode) { + if (this.rCurrentlySelectedSong.rParentNode != null) { + this.rCurrentlySelectedSong = this.rCurrentlySelectedSong.rParentNode; + this.rCurrentlySelectedSong.Openindex = nSelectSongIndex; + tChangeSong(OpenTaiko.Songs管理.list曲ルート.IndexOf(this.rCurrentlySelectedSong) - nSelectSongIndex); } - this.b選択曲が変更された = true; - } - public void t前に移動() { - if (this.rCurrentlySelectedSong != null) { - nNowChange = -1; - ctScoreFrameAnime.Stop(); - ctScoreFrameAnime.CurrentValue = 0; - ctBarOpen.Stop(); - ctBarOpen.CurrentValue = 0; - this.ctScrollCounter = new CCounter(0, 1000, OpenTaiko.Skin.SongSelect_Scroll_Interval, OpenTaiko.Timer); + } else { + // Reindex the parent node + List currentSongList = flattenList(OpenTaiko.Songs管理.list曲ルート, true); + this.rCurrentlySelectedSong.rParentNode.Openindex = currentSongList.IndexOf(this.rCurrentlySelectedSong) - currentSongList.IndexOf(this.rCurrentlySelectedSong.rParentNode.list子リスト[0]); + this.rCurrentlySelectedSong.rParentNode.bIsOpenFolder = false; + tChangeSong(-this.rCurrentlySelectedSong.rParentNode.Openindex); - #region [ パネルを1行下にシフトする。] - //----------------- - - int barCenterNum = (OpenTaiko.Skin.SongSelect_Bar_Count - 1) / 2; - - // 選択曲と選択行を1つ上の行に移動。 - - tChangeSong(-1); - this.n現在の選択行 = ((this.n現在の選択行 - 1) + OpenTaiko.Skin.SongSelect_Bar_Count) % OpenTaiko.Skin.SongSelect_Bar_Count; - - - // 選択曲から5つ上のパネル(=新しく最上部に表示されるパネル。消えてしまう一番下のパネルを再利用する)に、新しい曲の情報を記載する。 - - var song = this.rGetSideSong(-barCenterNum); - - int index = ((this.n現在の選択行 - barCenterNum) + OpenTaiko.Skin.SongSelect_Bar_Count) % OpenTaiko.Skin.SongSelect_Bar_Count; // 新しく最上部に表示されるパネルのインデックス(0~12)。 - this.stバー情報[index].strタイトル文字列 = song.ldTitle.GetString(""); - this.stバー情報[index].ForeColor = song.ForeColor; - this.stバー情報[index].BackColor = song.BackColor; - this.stバー情報[index].BoxColor = song.BoxColor; - this.stバー情報[index].BgColor = song.BgColor; - - // Set default if unchanged here - this.stバー情報[index].BoxType = song.BoxType; - this.stバー情報[index].BgType = song.BgType; - - this.stバー情報[index].BgTypeChanged = song.isChangedBgType; - this.stバー情報[index].BoxTypeChanged = song.isChangedBoxType; - - this.stバー情報[index].BoxChara = song.BoxChara; - this.stバー情報[index].BoxCharaChanged = song.isChangedBoxChara; - - this.stバー情報[index].strサブタイトル = song.ldSubtitle.GetString(""); - this.stバー情報[index].strジャンル = song.strジャンル; - this.stバー情報[index].ar難易度 = song.nLevel; - this.stバー情報[index].nLevelIcon = song.nLevelIcon; - for (int f = 0; f < (int)Difficulty.Total; f++) { - if (song.arスコア[f] != null) - this.stバー情報[index].b分岐 = song.arスコア[f].譜面情報.b譜面分岐; - } - - /* - if (stバー情報[index].nクリア == null) - this.stバー情報[index].nクリア = new int[5]; - if (stバー情報[index].nスコアランク == null) - this.stバー情報[index].nスコアランク = new int[5]; - - for (int i = 0; i <= (int)Difficulty.Edit; i++) - { - if (song.arスコア[i] != null) - { - this.stバー情報[index].nクリア = song.arスコア[i].譜面情報.nクリア; - this.stバー情報[index].nスコアランク = song.arスコア[i].譜面情報.nスコアランク; - } - } - */ - - #region [Reroll cases] - - if (stバー情報[index].nクリア == null) - this.stバー情報[index].nクリア = new int[2][]; - if (stバー情報[index].nスコアランク == null) - this.stバー情報[index].nスコアランク = new int[2][]; - - for (int i = 0; i < 2; i++) { - this.stバー情報[index].nクリア[i] = new int[5]; - this.stバー情報[index].nスコアランク[i] = new int[5]; - - int ap = OpenTaiko.GetActualPlayer(i); - //var sr = song.arスコア[n現在のアンカ難易度レベルに最も近い難易度レベルを返す(song)]; - var TableEntry = OpenTaiko.SaveFileInstances[ap].data.tGetSongSelectTableEntry(song.tGetUniqueId()); - - this.stバー情報[index].nクリア[i] = TableEntry.ClearStatuses; - this.stバー情報[index].nスコアランク[i] = TableEntry.ScoreRanks; - } - - this.stバー情報[index].csu = song.uniqueId; - this.stバー情報[index].reference = song; - - #endregion - - // stバー情報[] の内容を1行ずつずらす。 - - for (int i = 0; i < OpenTaiko.Skin.SongSelect_Bar_Count; i++) { - int n = (((this.n現在の選択行 - barCenterNum) + i) + OpenTaiko.Skin.SongSelect_Bar_Count) % OpenTaiko.Skin.SongSelect_Bar_Count; - var song2 = this.rGetSideSong(i - barCenterNum); - this.stバー情報[n].eバー種別 = this.e曲のバー種別を返す(song2); - this.stバー情報[n].ttkタイトル = this.ttkGenerateSongNameTexture(this.stバー情報[n].strタイトル文字列, this.stバー情報[n].ForeColor, this.stバー情報[n].BackColor, stバー情報[n].eバー種別 == Eバー種別.Box ? this.pfBoxName : this.pfMusicName); - } - - - // 新しく最上部に表示されるパネル用のスキル値を取得。 - - for (int i = 0; i < 3; i++) - this.stバー情報[index].nスキル値[i] = (int)song.arスコア[this.n現在のアンカ難易度レベルに最も近い難易度レベルを返す(song)].譜面情報.最大スキル[i]; - - - this.t選択曲が変更された(false); // スクロールバー用に今何番目を選択しているかを更新 - - this.ttkSelectedSongTitle = null; - this.ttkSelectedSongSubtitle = null; - - OpenTaiko.stageSongSelect.tNotifySelectedSongChange(); // スクロール完了=選択曲変更! - ctBarOpen.Start(0, 260, 2, OpenTaiko.Timer); - OpenTaiko.stageSongSelect.NowGenre = this.rCurrentlySelectedSong.strジャンル; - OpenTaiko.stageSongSelect.NowBg = this.rCurrentlySelectedSong.BgType; - OpenTaiko.stageSongSelect.NowBgColor = this.rCurrentlySelectedSong.BgColor; - OpenTaiko.stageSongSelect.NowUseGenre = !this.rCurrentlySelectedSong.isChangedBgType; - ctScoreFrameAnime.Start(0, 6000, 1, OpenTaiko.Timer); - //----------------- - #endregion - - - tResetTitleTextureKey(); - } - this.b選択曲が変更された = true; - } - public void tUpdateCurSong() { - if ((this.rGetSideSong(0).eノード種別 == CSongListNode.ENodeType.SCORE) || this.rGetSideSong(0).eノード種別 == CSongListNode.ENodeType.BACKBOX) { - OpenTaiko.stageSongSelect.bBGMIn再生した = false; - - CSongSelectSongManager.disable(); - } else { - CSongSelectSongManager.enable(); - CSongSelectSongManager.playSongIfPossible(); - } - - OpenTaiko.stageSongSelect.ctBackgroundFade.Start(0, 600, 1, OpenTaiko.Timer); - if (this.ctBarOpen.CurrentValue >= 200 || OpenTaiko.stageSongSelect.ctBackgroundFade.CurrentValue >= 600 - 255) { - OpenTaiko.stageSongSelect.OldGenre = this.rCurrentlySelectedSong.strジャンル; - OpenTaiko.stageSongSelect.OldUseGenre = !this.rCurrentlySelectedSong.isChangedBgType; - OpenTaiko.stageSongSelect.OldBg = this.rCurrentlySelectedSong.BgType; - OpenTaiko.stageSongSelect.OldBgColor = this.rCurrentlySelectedSong.BgColor; - } - - if (this.rCurrentlySelectedSong != null) { - ctScoreFrameAnime.Stop(); - ctScoreFrameAnime.CurrentValue = 0; - ctBarOpen.Stop(); - ctBarOpen.CurrentValue = 0; - } - this.b選択曲が変更された = true; - } - public void t難易度レベルをひとつ進める() { - if ((this.rCurrentlySelectedSong == null) || (this.rCurrentlySelectedSong.nスコア数 <= 1)) - return; // 曲にスコアが0~1個しかないなら進める意味なし。 - - - // 難易度レベルを+1し、現在選曲中のスコアを変更する。 - - this.n現在のアンカ難易度レベル = this.n現在のアンカ難易度レベルに最も近い難易度レベルを返す(this.rCurrentlySelectedSong); - - for (int i = 0; i < (int)Difficulty.Total; i++) { - this.n現在のアンカ難易度レベル = (this.n現在のアンカ難易度レベル + 1) % (int)Difficulty.Total; // 5以上になったら0に戻る。 - if (this.rCurrentlySelectedSong.arスコア[this.n現在のアンカ難易度レベル] != null) // 曲が存在してるならここで終了。存在してないなら次のレベルへGo。 - break; - } - - - // 曲毎に表示しているスキル値を、新しい難易度レベルに合わせて取得し直す。(表示されている13曲全部。) - - int _center = (OpenTaiko.Skin.SongSelect_Bar_Count - 1) / 2; - for (int i = this.n現在の選択行 - _center; i < ((this.n現在の選択行 - _center) + OpenTaiko.Skin.SongSelect_Bar_Count); i++) { - var song = this.rGetSideSong(i); - int index = (i + OpenTaiko.Skin.SongSelect_Bar_Count) % OpenTaiko.Skin.SongSelect_Bar_Count; - for (int m = 0; m < 3; m++) { - this.stバー情報[index].nスキル値[m] = (int)song.arスコア[this.n現在のアンカ難易度レベルに最も近い難易度レベルを返す(song)].譜面情報.最大スキル[m]; - } - } - - - // 選曲ステージに変更通知を発出し、関係Activityの対応を行ってもらう。 - - OpenTaiko.stageSongSelect.tNotifySelectedSongChange(); - } - /// - /// 不便だったから作った。 - /// - public void t難易度レベルをひとつ戻す() { - if ((this.rCurrentlySelectedSong == null) || (this.rCurrentlySelectedSong.nスコア数 <= 1)) - return; // 曲にスコアが0~1個しかないなら進める意味なし。 - - - - // 難易度レベルを+1し、現在選曲中のスコアを変更する。 - - this.n現在のアンカ難易度レベル = this.n現在のアンカ難易度レベルに最も近い難易度レベルを返す(this.rCurrentlySelectedSong); - - this.n現在のアンカ難易度レベル--; - if (this.n現在のアンカ難易度レベル < 0) // 0より下になったら4に戻す。 - { - this.n現在のアンカ難易度レベル = 4; - } - - //2016.08.13 kairera0467 かんたん譜面が無い譜面(ふつう、むずかしいのみ)で、難易度を最上位に戻せない不具合の修正。 - bool bLabel0NotFound = true; - for (int i = this.n現在のアンカ難易度レベル; i >= 0; i--) { - if (this.rCurrentlySelectedSong.arスコア[i] != null) { - this.n現在のアンカ難易度レベル = i; - bLabel0NotFound = false; - break; - } - } - if (bLabel0NotFound) { - for (int i = 4; i >= 0; i--) { - if (this.rCurrentlySelectedSong.arスコア[i] != null) { - this.n現在のアンカ難易度レベル = i; - break; - } - } - } - - // 曲毎に表示しているスキル値を、新しい難易度レベルに合わせて取得し直す。(表示されている13曲全部。) - - int _center = (OpenTaiko.Skin.SongSelect_Bar_Count - 1) / 2; - for (int i = this.n現在の選択行 - _center; i < ((this.n現在の選択行 - _center) + OpenTaiko.Skin.SongSelect_Bar_Count); i++) { - CSongListNode song = this.rGetSideSong(i); - int index = (i + OpenTaiko.Skin.SongSelect_Bar_Count) % OpenTaiko.Skin.SongSelect_Bar_Count; - for (int m = 0; m < 3; m++) { - this.stバー情報[index].nスキル値[m] = (int)song.arスコア[this.n現在のアンカ難易度レベルに最も近い難易度レベルを返す(song)].譜面情報.最大スキル[m]; - } - } - - - // 選曲ステージに変更通知を発出し、関係Activityの対応を行ってもらう。 - - OpenTaiko.stageSongSelect.tNotifySelectedSongChange(); - } - - - /// - /// 曲リストをリセットする - /// - /// - public void Refresh(CSongs管理 cs, bool bRemakeSongTitleBar) // #26070 2012.2.28 yyagi - { - // this.On非活性化(); - - if (cs != null && cs.list曲ルート.Count > 0) // 新しい曲リストを検索して、1曲以上あった - { - OpenTaiko.Songs管理 = cs; - - if (this.rCurrentlySelectedSong != null) // r現在選択中の曲==null とは、「最初songlist.dbが無かった or 検索したが1曲もない」 - { - this.rCurrentlySelectedSong = searchCurrentBreadcrumbsPosition(OpenTaiko.Songs管理.list曲ルート, this.rCurrentlySelectedSong.strBreadcrumbs); - if (bRemakeSongTitleBar) // 選曲画面以外に居るときには再構成しない (非活性化しているときに実行すると例外となる) - { - this.t現在選択中の曲を元に曲バーを再構成する(); - } - return; - } - } - if (this.IsActivated) { - this.DeActivate(); - this.rCurrentlySelectedSong = null; - this.nSelectSongIndex = 0; - this.Activate(); - } - } - - - /// - /// 現在選曲している位置を検索する - /// (曲一覧クラスを新しいものに入れ替える際に用いる) - /// - /// 検索対象のList - /// 検索するパンくずリスト(文字列) - /// - private CSongListNode searchCurrentBreadcrumbsPosition(List ln, string bc) { - foreach (CSongListNode n in ln) { - if (n.strBreadcrumbs == bc) { - return n; - } else if (n.list子リスト != null && n.list子リスト.Count > 0) // 子リストが存在するなら、再帰で探す - { - CSongListNode r = searchCurrentBreadcrumbsPosition(n.list子リスト, bc); - if (r != null) return r; - } - } - return null; - } - - /// - /// BOXのアイテム数と、今何番目を選択しているかをセットする - /// - public void t選択曲が変更された(bool bForce) // #27648 - { - CSongListNode song = OpenTaiko.stageSongSelect.rNowSelectedSong; - if (song == null) - return; - if (song == song_last && bForce == false) - return; - - song_last = song; - List list = OpenTaiko.Songs管理.list曲ルート; - int index = list.IndexOf(song) + 1; - if (index <= 0) { - nCurrentPosition = nNumOfItems = 0; - } else { - nCurrentPosition = index; - nNumOfItems = list.Count; - } - OpenTaiko.stageSongSelect.act演奏履歴パネル.tSongChange(); - } - - // CActivity 実装 - - async public void tLoadPads() { - while (bIsEnumeratingSongs) { - await Task.Delay(100); - } - - CSongDict.tRefreshScoreTables(); - } - public override void Activate() { - if (this.IsActivated) - return; + this.t現在選択中の曲を元に曲バーを再構成する(); + this.t選択曲が変更された(false); // #27648 項目数変更を反映させる + this.b選択曲が変更された = true; - if (!bFirstCrownLoad) { - // tLoadPads(); + return ret; + } - // Calculate Pads asynchonously - new Task(tLoadPads).Start(); - bFirstCrownLoad = true; + public List flattenList(List list, bool useOpenFlag = false) { + List ret = new List(); + //foreach (var e in list) + for (int i = 0; i < list.Count; i++) { + var e = list[i]; + if (!useOpenFlag || !e.bIsOpenFolder) ret.Add(e); + + if (e.eノード種別 == CSongListNode.ENodeType.BOX && + (!useOpenFlag || e.bIsOpenFolder)) { + ret.AddRange(flattenList(e.list子リスト, useOpenFlag)); } + } - OpenTaiko.stageSongSelect.actDifficultySelectionScreen.bIsDifficltSelect = false; + return (ret); + } - this.pfBoxName = HPrivateFastFont.tInstantiateMainFont(OpenTaiko.Skin.SongSelect_BoxName_Scale); - this.pfMusicName = HPrivateFastFont.tInstantiateMainFont(OpenTaiko.Skin.SongSelect_MusicName_Scale); - this.pfSubtitle = HPrivateFastFont.tInstantiateMainFont(OpenTaiko.Skin.SongSelect_Subtitle_Scale); - this.pfMaker = HPrivateFastFont.tInstantiateBoxFont(OpenTaiko.Skin.SongSelect_Maker_Size); - this.pfBoxText = HPrivateFastFont.tInstantiateBoxFont(OpenTaiko.Skin.SongSelect_BoxText_Scale); - this.pfBPM = HPrivateFastFont.tInstantiateBoxFont(OpenTaiko.Skin.SongSelect_BPM_Text_Size); - - - this.b登場アニメ全部完了 = false; + public void t現在選択中の曲を元に曲バーを再構成する() { + this.tバーの初期化(); + } + public void t次に移動() { + if (this.rCurrentlySelectedSong != null) { + nNowChange = 1; + ctScoreFrameAnime.Stop(); + ctScoreFrameAnime.CurrentValue = 0; + ctBarOpen.Stop(); + ctBarOpen.CurrentValue = 0; this.ctScrollCounter = new CCounter(0, 1000, OpenTaiko.Skin.SongSelect_Scroll_Interval, OpenTaiko.Timer); - // フォント作成。 - // 曲リスト文字は2倍(面積4倍)でテクスチャに描画してから縮小表示するので、フォントサイズは2倍とする。 - // 現在選択中の曲がない(=はじめての活性化)なら、現在選択中の曲をルートの先頭ノードに設定する。 - - if ((this.rCurrentlySelectedSong == null) && (OpenTaiko.Songs管理.list曲ルート.Count > 0)) - this.rCurrentlySelectedSong = OpenTaiko.Songs管理.list曲ルート[0]; - - this.tバーの初期化(); - - this.ctBarOpen = new CCounter(); - this.ctBoxOpen = new CCounter(); - this.ctDifficultyIn = new CCounter(); - - this.ct三角矢印アニメ = new CCounter(); - - this.ctBarFlash = new CCounter(); - - this.ctScoreFrameAnime = new CCounter(); - - // strboxText here - if (this.rCurrentlySelectedSong != null) { - #region [Box text] - - string _append = ""; - if (HSongTraverse.IsRegularFolder(rCurrentlySelectedSong)) { - int countTotalSongs = HSongTraverse.GetSongsMatchingCondition(rCurrentlySelectedSong, (_) => true); - int countUnlockedSongs = HSongTraverse.GetSongsMatchingCondition(rCurrentlySelectedSong, (song) => !OpenTaiko.Databases.DBSongUnlockables.tIsSongLocked(song)); - _append = " ({0}/{1})".SafeFormat(countUnlockedSongs, countTotalSongs); - } - - string[] boxText = new string[3] - { - rCurrentlySelectedSong.strBoxText[0].GetString(""), - rCurrentlySelectedSong.strBoxText[1].GetString(""), - rCurrentlySelectedSong.strBoxText[2].GetString("") + _append - }; - - if (strBoxText != boxText[0] + boxText[1] + boxText[2]) { - for (int i = 0; i < 3; i++) { - using (var texture = pfBoxText.DrawText(boxText[i], rCurrentlySelectedSong.ForeColor, rCurrentlySelectedSong.BackColor, null, 26)) { - this.txBoxText[i] = OpenTaiko.tテクスチャの生成(texture); - this.strBoxText = boxText[0] + boxText[1] + boxText[2]; - } - } - } - - #endregion - } else { - strBoxText = "null"; - } - - for (int i = 0; i < OpenTaiko.Skin.SongSelect_Bar_Count; i++) { - this.stバー情報[i].ttkタイトル = this.ttkGenerateSongNameTexture(this.stバー情報[i].strタイトル文字列, this.stバー情報[i].ForeColor, this.stバー情報[i].BackColor, stバー情報[i].eバー種別 == Eバー種別.Box ? this.pfBoxName : this.pfMusicName); - } - - base.Activate(); - - this.t選択曲が変更された(true); // #27648 2012.3.31 yyagi 選曲画面に入った直後の 現在位置/全アイテム数 の表示を正しく行うため - } - public override void DeActivate() { - if (this.IsDeActivated) - return; - - OpenTaiko.tDisposeSafely(ref pfBoxName); - OpenTaiko.tDisposeSafely(ref pfMusicName); - OpenTaiko.tDisposeSafely(ref pfSubtitle); - OpenTaiko.tDisposeSafely(ref pfMaker); - OpenTaiko.tDisposeSafely(ref pfBPM); - - tResetTitleKey(); - //ClearTitleTextureCache(); - - this.ct三角矢印アニメ = null; - - base.DeActivate(); - } - public override void CreateManagedResource() { - this.ft曲リスト用フォント = HPrivateFastFont.tInstantiateMainFont(40); - - int c = (CultureInfo.CurrentCulture.TwoLetterISOLanguageName == "ja") ? 0 : 1; - - #region [ Songs not found画像 ] - try { - this.txSongNotFound = new CTexture(ft曲リスト用フォント.DrawText("Songs not found.\nYou need to install songs.", Color.White)); - this.txSongNotFound.vcScaleRatio = new Vector3D(0.5f, 0.5f, 1f); // 半分のサイズで表示する。 - - /* - using( Bitmap image = new Bitmap( 640, 128 ) ) - using( Graphics graphics = Graphics.FromImage( image ) ) - { - string[] s1 = { "曲データが見つかりません。", "Songs not found." }; - string[] s2 = { "曲データをDTXManiaGR.exe以下の", "You need to install songs." }; - string[] s3 = { "フォルダにインストールして下さい。", "" }; - graphics.DrawString( s1[c], this.ft曲リスト用フォント, Brushes.DarkGray, (float) 2f, (float) 2f ); - graphics.DrawString( s1[c], this.ft曲リスト用フォント, Brushes.White, (float) 0f, (float) 0f ); - graphics.DrawString( s2[c], this.ft曲リスト用フォント, Brushes.DarkGray, (float) 2f, (float) 44f ); - graphics.DrawString( s2[c], this.ft曲リスト用フォント, Brushes.White, (float) 0f, (float) 42f ); - graphics.DrawString( s3[c], this.ft曲リスト用フォント, Brushes.DarkGray, (float) 2f, (float) 86f ); - graphics.DrawString( s3[c], this.ft曲リスト用フォント, Brushes.White, (float) 0f, (float) 84f ); - - this.txSongNotFound = new CTexture( image ); - - } - */ - } catch (CTextureCreateFailedException e) { - Trace.TraceError(e.ToString()); - Trace.TraceError("SoungNotFoundテクスチャの作成に失敗しました。"); - this.txSongNotFound = null; - } - #endregion - #region [ "曲データを検索しています"画像 ] - try { - this.txEnumeratingSongs = new CTexture(ft曲リスト用フォント.DrawText("Now loading songs.\nPlease wait...", Color.White)); - this.txEnumeratingSongs.vcScaleRatio = new Vector3D(0.5f, 0.5f, 1f); // 半分のサイズで表示する。 - - /* - using ( Bitmap image = new Bitmap( 640, 96 ) ) - using ( Graphics graphics = Graphics.FromImage( image ) ) - { - string[] s1 = { "曲データを検索しています。", "Now loading songs." }; - string[] s2 = { "そのまましばらくお待ち下さい。", "Please wait..." }; - graphics.DrawString( s1[c], this.ft曲リスト用フォント, Brushes.DarkGray, (float) 2f, (float) 2f ); - graphics.DrawString( s1[c], this.ft曲リスト用フォント, Brushes.White, (float) 0f, (float) 0f ); - graphics.DrawString( s2[c], this.ft曲リスト用フォント, Brushes.DarkGray, (float) 2f, (float) 44f ); - graphics.DrawString( s2[c], this.ft曲リスト用フォント, Brushes.White, (float) 0f, (float) 42f ); - - this.txEnumeratingSongs = new CTexture( image ); - - this.txEnumeratingSongs.vc拡大縮小倍率 = new Vector3D( 0.5f, 0.5f, 1f ); // 半分のサイズで表示する。 - } - */ - } catch (CTextureCreateFailedException e) { - Trace.TraceError(e.ToString()); - Trace.TraceError("txEnumeratingSongsテクスチャの作成に失敗しました。"); - this.txEnumeratingSongs = null; - } - #endregion - #region [ 曲数表示 ] - //this.txアイテム数数字 = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\ScreenSelect skill number on gauge etc.png" ), false ); - #endregion - - base.CreateManagedResource(); - } - public override void ReleaseManagedResource() { - OpenTaiko.tDisposeSafely(ref this.ft曲リスト用フォント); - - for (int i = 0; i < OpenTaiko.Skin.SongSelect_Bar_Count; i++) { - OpenTaiko.tテクスチャの解放(ref this.stバー情報[i].txタイトル名); - this.stバー情報[i].ttkタイトル = null; - } - - OpenTaiko.tテクスチャの解放(ref this.txEnumeratingSongs); - OpenTaiko.tテクスチャの解放(ref this.txSongNotFound); - - base.ReleaseManagedResource(); - } - public override int Draw() { - if (this.IsDeActivated) - return 0; - - #region [ 初めての進行描画 ] + #region [ パネルを1行上にシフトする。] //----------------- - if (this.IsFirstDraw) { - OpenTaiko.stageSongSelect.tNotifySelectedSongChange(); + int barCenterNum = (OpenTaiko.Skin.SongSelect_Bar_Count - 1) / 2; + + // 選択曲と選択行を1つ下の行に移動。 + + tChangeSong(1); + this.n現在の選択行 = (this.n現在の選択行 + 1) % OpenTaiko.Skin.SongSelect_Bar_Count; + + // 選択曲から7つ下のパネル(=新しく最下部に表示されるパネル。消えてしまう一番上のパネルを再利用する)に、新しい曲の情報を記載する。 + + var song = this.rGetSideSong(barCenterNum); + + int index = (this.n現在の選択行 + barCenterNum) % OpenTaiko.Skin.SongSelect_Bar_Count; // 新しく最下部に表示されるパネルのインデックス(0~12)。 + this.stバー情報[index].strタイトル文字列 = song.ldTitle.GetString(""); + this.stバー情報[index].ForeColor = song.ForeColor; + this.stバー情報[index].BackColor = song.BackColor; + this.stバー情報[index].BoxColor = song.BoxColor; + this.stバー情報[index].BgColor = song.BgColor; + + // Set default if unchanged here + this.stバー情報[index].BoxType = song.BoxType; + this.stバー情報[index].BgType = song.BgType; + + this.stバー情報[index].BgTypeChanged = song.isChangedBgType; + this.stバー情報[index].BoxTypeChanged = song.isChangedBoxType; + + this.stバー情報[index].BoxChara = song.BoxChara; + this.stバー情報[index].BoxCharaChanged = song.isChangedBoxChara; + + this.stバー情報[index].strジャンル = song.strジャンル; + this.stバー情報[index].strサブタイトル = song.ldSubtitle.GetString(""); + this.stバー情報[index].ar難易度 = song.nLevel; + this.stバー情報[index].nLevelIcon = song.nLevelIcon; + + for (int f = 0; f < (int)Difficulty.Total; f++) { + if (song.arスコア[f] != null) + this.stバー情報[index].b分岐 = song.arスコア[f].譜面情報.b譜面分岐; + } + + #region [Reroll cases] + + if (stバー情報[index].nクリア == null) + this.stバー情報[index].nクリア = new int[2][]; + if (stバー情報[index].nスコアランク == null) + this.stバー情報[index].nスコアランク = new int[2][]; + + for (int i = 0; i < 2; i++) { + this.stバー情報[index].nクリア[i] = new int[5]; + this.stバー情報[index].nスコアランク[i] = new int[5]; + + int ap = OpenTaiko.GetActualPlayer(i); + //var sr = song.arスコア[n現在のアンカ難易度レベルに最も近い難易度レベルを返す(song)]; + + var TableEntry = OpenTaiko.SaveFileInstances[ap].data.tGetSongSelectTableEntry(song.tGetUniqueId()); + + this.stバー情報[index].nクリア[i] = TableEntry.ClearStatuses; + this.stバー情報[index].nスコアランク[i] = TableEntry.ScoreRanks; + } + + this.stバー情報[index].csu = song.uniqueId; + this.stバー情報[index].reference = song; + + #endregion + + // stバー情報[] の内容を1行ずつずらす。 + + + for (int i = 0; i < OpenTaiko.Skin.SongSelect_Bar_Count; i++) { + CSongListNode song2 = this.rGetSideSong(i - barCenterNum); + int n = (((this.n現在の選択行 - barCenterNum) + i) + OpenTaiko.Skin.SongSelect_Bar_Count) % OpenTaiko.Skin.SongSelect_Bar_Count; + this.stバー情報[n].eバー種別 = this.e曲のバー種別を返す(song2); + this.stバー情報[n].ttkタイトル = this.ttkGenerateSongNameTexture(this.stバー情報[n].strタイトル文字列, this.stバー情報[n].ForeColor, this.stバー情報[n].BackColor, stバー情報[n].eバー種別 == Eバー種別.Box ? this.pfBoxName : this.pfMusicName); + } + + + // 新しく最下部に表示されるパネル用のスキル値を取得。 + + for (int i = 0; i < 3; i++) + this.stバー情報[index].nスキル値[i] = (int)song.arスコア[this.n現在のアンカ難易度レベルに最も近い難易度レベルを返す(song)].譜面情報.最大スキル[i]; + + + // 1行(100カウント)移動完了。 + + this.t選択曲が変更された(false); // スクロールバー用に今何番目を選択しているかを更新 + + + + { + OpenTaiko.stageSongSelect.tNotifySelectedSongChange(); // スクロール完了=選択曲変更! ctBarOpen.Start(0, 260, 2, OpenTaiko.Timer); - this.ct三角矢印アニメ.Start(0, 1000, 1, OpenTaiko.Timer); - base.IsFirstDraw = false; + + OpenTaiko.stageSongSelect.NowGenre = this.rCurrentlySelectedSong.strジャンル; + + OpenTaiko.stageSongSelect.NowBg = this.rCurrentlySelectedSong.BgType; + + OpenTaiko.stageSongSelect.NowBgColor = this.rCurrentlySelectedSong.BgColor; + + OpenTaiko.stageSongSelect.NowUseGenre = !this.rCurrentlySelectedSong.isChangedBgType; + + ctScoreFrameAnime.Start(0, 6000, 1, OpenTaiko.Timer); } + //----------------- #endregion - ctBarFlash.Tick(); - ctBoxOpen.Tick(); - ctBarOpen.Tick(); - ctDifficultyIn.Tick(); - float BarAnimeCount = this.ctBarOpen.CurrentValue <= 200 ? 0 : (float)Math.Sin(((this.ctBarOpen.CurrentValue - 200) * 1.5f) * (Math.PI / 180)); - int centerMove = (int)(BarAnimeCount * OpenTaiko.Skin.SongSelect_Bar_Center_Move); - int centerMoveX = (int)(BarAnimeCount * OpenTaiko.Skin.SongSelect_Bar_Center_Move_X); + tResetTitleTextureKey(); + } + this.b選択曲が変更された = true; + } + public void t前に移動() { + if (this.rCurrentlySelectedSong != null) { + nNowChange = -1; + ctScoreFrameAnime.Stop(); + ctScoreFrameAnime.CurrentValue = 0; + ctBarOpen.Stop(); + ctBarOpen.CurrentValue = 0; + this.ctScrollCounter = new CCounter(0, 1000, OpenTaiko.Skin.SongSelect_Scroll_Interval, OpenTaiko.Timer); - if (BarAnimeCount == 1.0) - ctScoreFrameAnime.TickLoop(); - // まだ選択中の曲が決まってなければ、曲ツリールートの最初の曲にセットする。 + #region [ パネルを1行下にシフトする。] + //----------------- - if ((this.rCurrentlySelectedSong == null) && (OpenTaiko.Songs管理.list曲ルート.Count > 0)) { - nSelectSongIndex = 0; - this.rCurrentlySelectedSong = OpenTaiko.Songs管理.list曲ルート[nSelectSongIndex]; + int barCenterNum = (OpenTaiko.Skin.SongSelect_Bar_Count - 1) / 2; + + // 選択曲と選択行を1つ上の行に移動。 + + tChangeSong(-1); + this.n現在の選択行 = ((this.n現在の選択行 - 1) + OpenTaiko.Skin.SongSelect_Bar_Count) % OpenTaiko.Skin.SongSelect_Bar_Count; + + + // 選択曲から5つ上のパネル(=新しく最上部に表示されるパネル。消えてしまう一番下のパネルを再利用する)に、新しい曲の情報を記載する。 + + var song = this.rGetSideSong(-barCenterNum); + + int index = ((this.n現在の選択行 - barCenterNum) + OpenTaiko.Skin.SongSelect_Bar_Count) % OpenTaiko.Skin.SongSelect_Bar_Count; // 新しく最上部に表示されるパネルのインデックス(0~12)。 + this.stバー情報[index].strタイトル文字列 = song.ldTitle.GetString(""); + this.stバー情報[index].ForeColor = song.ForeColor; + this.stバー情報[index].BackColor = song.BackColor; + this.stバー情報[index].BoxColor = song.BoxColor; + this.stバー情報[index].BgColor = song.BgColor; + + // Set default if unchanged here + this.stバー情報[index].BoxType = song.BoxType; + this.stバー情報[index].BgType = song.BgType; + + this.stバー情報[index].BgTypeChanged = song.isChangedBgType; + this.stバー情報[index].BoxTypeChanged = song.isChangedBoxType; + + this.stバー情報[index].BoxChara = song.BoxChara; + this.stバー情報[index].BoxCharaChanged = song.isChangedBoxChara; + + this.stバー情報[index].strサブタイトル = song.ldSubtitle.GetString(""); + this.stバー情報[index].strジャンル = song.strジャンル; + this.stバー情報[index].ar難易度 = song.nLevel; + this.stバー情報[index].nLevelIcon = song.nLevelIcon; + for (int f = 0; f < (int)Difficulty.Total; f++) { + if (song.arスコア[f] != null) + this.stバー情報[index].b分岐 = song.arスコア[f].譜面情報.b譜面分岐; } - // 描画。 - if (this.rCurrentlySelectedSong == null) { - #region [Songs not found / Enumerating song screens] - //----------------- - if (bIsEnumeratingSongs) { - if (this.txEnumeratingSongs != null) { - this.txEnumeratingSongs.t2D描画(320, 160); - } - } else { - if (this.txSongNotFound != null) - this.txSongNotFound.t2D描画(320, 160); + /* + if (stバー情報[index].nクリア == null) + this.stバー情報[index].nクリア = new int[5]; + if (stバー情報[index].nスコアランク == null) + this.stバー情報[index].nスコアランク = new int[5]; + + for (int i = 0; i <= (int)Difficulty.Edit; i++) + { + if (song.arスコア[i] != null) + { + this.stバー情報[index].nクリア = song.arスコア[i].譜面情報.nクリア; + this.stバー情報[index].nスコアランク = song.arスコア[i].譜面情報.nスコアランク; } - //----------------- - #endregion + } + */ - return 0; + #region [Reroll cases] + + if (stバー情報[index].nクリア == null) + this.stバー情報[index].nクリア = new int[2][]; + if (stバー情報[index].nスコアランク == null) + this.stバー情報[index].nスコアランク = new int[2][]; + + for (int i = 0; i < 2; i++) { + this.stバー情報[index].nクリア[i] = new int[5]; + this.stバー情報[index].nスコアランク[i] = new int[5]; + + int ap = OpenTaiko.GetActualPlayer(i); + //var sr = song.arスコア[n現在のアンカ難易度レベルに最も近い難易度レベルを返す(song)]; + var TableEntry = OpenTaiko.SaveFileInstances[ap].data.tGetSongSelectTableEntry(song.tGetUniqueId()); + + this.stバー情報[index].nクリア[i] = TableEntry.ClearStatuses; + this.stバー情報[index].nスコアランク[i] = TableEntry.ScoreRanks; } - // 本ステージは、(1)登場アニメフェーズ → (2)通常フェーズ と二段階にわけて進む。 + this.stバー情報[index].csu = song.uniqueId; + this.stバー情報[index].reference = song; + #endregion + + // stバー情報[] の内容を1行ずつずらす。 + + for (int i = 0; i < OpenTaiko.Skin.SongSelect_Bar_Count; i++) { + int n = (((this.n現在の選択行 - barCenterNum) + i) + OpenTaiko.Skin.SongSelect_Bar_Count) % OpenTaiko.Skin.SongSelect_Bar_Count; + var song2 = this.rGetSideSong(i - barCenterNum); + this.stバー情報[n].eバー種別 = this.e曲のバー種別を返す(song2); + this.stバー情報[n].ttkタイトル = this.ttkGenerateSongNameTexture(this.stバー情報[n].strタイトル文字列, this.stバー情報[n].ForeColor, this.stバー情報[n].BackColor, stバー情報[n].eバー種別 == Eバー種別.Box ? this.pfBoxName : this.pfMusicName); + } + + + // 新しく最上部に表示されるパネル用のスキル値を取得。 + + for (int i = 0; i < 3; i++) + this.stバー情報[index].nスキル値[i] = (int)song.arスコア[this.n現在のアンカ難易度レベルに最も近い難易度レベルを返す(song)].譜面情報.最大スキル[i]; + + + this.t選択曲が変更された(false); // スクロールバー用に今何番目を選択しているかを更新 + + this.ttkSelectedSongTitle = null; + this.ttkSelectedSongSubtitle = null; + + OpenTaiko.stageSongSelect.tNotifySelectedSongChange(); // スクロール完了=選択曲変更! + ctBarOpen.Start(0, 260, 2, OpenTaiko.Timer); + OpenTaiko.stageSongSelect.NowGenre = this.rCurrentlySelectedSong.strジャンル; + OpenTaiko.stageSongSelect.NowBg = this.rCurrentlySelectedSong.BgType; + OpenTaiko.stageSongSelect.NowBgColor = this.rCurrentlySelectedSong.BgColor; + OpenTaiko.stageSongSelect.NowUseGenre = !this.rCurrentlySelectedSong.isChangedBgType; + ctScoreFrameAnime.Start(0, 6000, 1, OpenTaiko.Timer); + //----------------- + #endregion + + + tResetTitleTextureKey(); + } + this.b選択曲が変更された = true; + } + public void tUpdateCurSong() { + if ((this.rGetSideSong(0).eノード種別 == CSongListNode.ENodeType.SCORE) || this.rGetSideSong(0).eノード種別 == CSongListNode.ENodeType.BACKBOX) { + OpenTaiko.stageSongSelect.bBGMIn再生した = false; + + CSongSelectSongManager.disable(); + } else { + CSongSelectSongManager.enable(); + CSongSelectSongManager.playSongIfPossible(); + } + + OpenTaiko.stageSongSelect.ctBackgroundFade.Start(0, 600, 1, OpenTaiko.Timer); + if (this.ctBarOpen.CurrentValue >= 200 || OpenTaiko.stageSongSelect.ctBackgroundFade.CurrentValue >= 600 - 255) { + OpenTaiko.stageSongSelect.OldGenre = this.rCurrentlySelectedSong.strジャンル; + OpenTaiko.stageSongSelect.OldUseGenre = !this.rCurrentlySelectedSong.isChangedBgType; + OpenTaiko.stageSongSelect.OldBg = this.rCurrentlySelectedSong.BgType; + OpenTaiko.stageSongSelect.OldBgColor = this.rCurrentlySelectedSong.BgColor; + } + + if (this.rCurrentlySelectedSong != null) { + ctScoreFrameAnime.Stop(); + ctScoreFrameAnime.CurrentValue = 0; + ctBarOpen.Stop(); + ctBarOpen.CurrentValue = 0; + } + this.b選択曲が変更された = true; + } + public void t難易度レベルをひとつ進める() { + if ((this.rCurrentlySelectedSong == null) || (this.rCurrentlySelectedSong.nスコア数 <= 1)) + return; // 曲にスコアが0~1個しかないなら進める意味なし。 + + + // 難易度レベルを+1し、現在選曲中のスコアを変更する。 + + this.n現在のアンカ難易度レベル = this.n現在のアンカ難易度レベルに最も近い難易度レベルを返す(this.rCurrentlySelectedSong); + + for (int i = 0; i < (int)Difficulty.Total; i++) { + this.n現在のアンカ難易度レベル = (this.n現在のアンカ難易度レベル + 1) % (int)Difficulty.Total; // 5以上になったら0に戻る。 + if (this.rCurrentlySelectedSong.arスコア[this.n現在のアンカ難易度レベル] != null) // 曲が存在してるならここで終了。存在してないなら次のレベルへGo。 + break; + } + + + // 曲毎に表示しているスキル値を、新しい難易度レベルに合わせて取得し直す。(表示されている13曲全部。) + + int _center = (OpenTaiko.Skin.SongSelect_Bar_Count - 1) / 2; + for (int i = this.n現在の選択行 - _center; i < ((this.n現在の選択行 - _center) + OpenTaiko.Skin.SongSelect_Bar_Count); i++) { + var song = this.rGetSideSong(i); + int index = (i + OpenTaiko.Skin.SongSelect_Bar_Count) % OpenTaiko.Skin.SongSelect_Bar_Count; + for (int m = 0; m < 3; m++) { + this.stバー情報[index].nスキル値[m] = (int)song.arスコア[this.n現在のアンカ難易度レベルに最も近い難易度レベルを返す(song)].譜面情報.最大スキル[m]; + } + } + + + // 選曲ステージに変更通知を発出し、関係Activityの対応を行ってもらう。 + + OpenTaiko.stageSongSelect.tNotifySelectedSongChange(); + } + /// + /// 不便だったから作った。 + /// + public void t難易度レベルをひとつ戻す() { + if ((this.rCurrentlySelectedSong == null) || (this.rCurrentlySelectedSong.nスコア数 <= 1)) + return; // 曲にスコアが0~1個しかないなら進める意味なし。 + + + + // 難易度レベルを+1し、現在選曲中のスコアを変更する。 + + this.n現在のアンカ難易度レベル = this.n現在のアンカ難易度レベルに最も近い難易度レベルを返す(this.rCurrentlySelectedSong); + + this.n現在のアンカ難易度レベル--; + if (this.n現在のアンカ難易度レベル < 0) // 0より下になったら4に戻す。 + { + this.n現在のアンカ難易度レベル = 4; + } + + //2016.08.13 kairera0467 かんたん譜面が無い譜面(ふつう、むずかしいのみ)で、難易度を最上位に戻せない不具合の修正。 + bool bLabel0NotFound = true; + for (int i = this.n現在のアンカ難易度レベル; i >= 0; i--) { + if (this.rCurrentlySelectedSong.arスコア[i] != null) { + this.n現在のアンカ難易度レベル = i; + bLabel0NotFound = false; + break; + } + } + if (bLabel0NotFound) { + for (int i = 4; i >= 0; i--) { + if (this.rCurrentlySelectedSong.arスコア[i] != null) { + this.n現在のアンカ難易度レベル = i; + break; + } + } + } + + // 曲毎に表示しているスキル値を、新しい難易度レベルに合わせて取得し直す。(表示されている13曲全部。) + + int _center = (OpenTaiko.Skin.SongSelect_Bar_Count - 1) / 2; + for (int i = this.n現在の選択行 - _center; i < ((this.n現在の選択行 - _center) + OpenTaiko.Skin.SongSelect_Bar_Count); i++) { + CSongListNode song = this.rGetSideSong(i); + int index = (i + OpenTaiko.Skin.SongSelect_Bar_Count) % OpenTaiko.Skin.SongSelect_Bar_Count; + for (int m = 0; m < 3; m++) { + this.stバー情報[index].nスキル値[m] = (int)song.arスコア[this.n現在のアンカ難易度レベルに最も近い難易度レベルを返す(song)].譜面情報.最大スキル[m]; + } + } + + + // 選曲ステージに変更通知を発出し、関係Activityの対応を行ってもらう。 + + OpenTaiko.stageSongSelect.tNotifySelectedSongChange(); + } + + + /// + /// 曲リストをリセットする + /// + /// + public void Refresh(CSongs管理 cs, bool bRemakeSongTitleBar) // #26070 2012.2.28 yyagi + { + // this.On非活性化(); + + if (cs != null && cs.list曲ルート.Count > 0) // 新しい曲リストを検索して、1曲以上あった + { + OpenTaiko.Songs管理 = cs; + + if (this.rCurrentlySelectedSong != null) // r現在選択中の曲==null とは、「最初songlist.dbが無かった or 検索したが1曲もない」 + { + this.rCurrentlySelectedSong = searchCurrentBreadcrumbsPosition(OpenTaiko.Songs管理.list曲ルート, this.rCurrentlySelectedSong.strBreadcrumbs); + if (bRemakeSongTitleBar) // 選曲画面以外に居るときには再構成しない (非活性化しているときに実行すると例外となる) + { + this.t現在選択中の曲を元に曲バーを再構成する(); + } + return; + } + } + if (this.IsActivated) { + this.DeActivate(); + this.rCurrentlySelectedSong = null; + this.nSelectSongIndex = 0; + this.Activate(); + } + } + + + /// + /// 現在選曲している位置を検索する + /// (曲一覧クラスを新しいものに入れ替える際に用いる) + /// + /// 検索対象のList + /// 検索するパンくずリスト(文字列) + /// + private CSongListNode searchCurrentBreadcrumbsPosition(List ln, string bc) { + foreach (CSongListNode n in ln) { + if (n.strBreadcrumbs == bc) { + return n; + } else if (n.list子リスト != null && n.list子リスト.Count > 0) // 子リストが存在するなら、再帰で探す + { + CSongListNode r = searchCurrentBreadcrumbsPosition(n.list子リスト, bc); + if (r != null) return r; + } + } + return null; + } + + /// + /// BOXのアイテム数と、今何番目を選択しているかをセットする + /// + public void t選択曲が変更された(bool bForce) // #27648 + { + CSongListNode song = OpenTaiko.stageSongSelect.rNowSelectedSong; + if (song == null) + return; + if (song == song_last && bForce == false) + return; + + song_last = song; + List list = OpenTaiko.Songs管理.list曲ルート; + int index = list.IndexOf(song) + 1; + if (index <= 0) { + nCurrentPosition = nNumOfItems = 0; + } else { + nCurrentPosition = index; + nNumOfItems = list.Count; + } + OpenTaiko.stageSongSelect.act演奏履歴パネル.tSongChange(); + } + + // CActivity 実装 + + async public void tLoadPads() { + while (bIsEnumeratingSongs) { + await Task.Delay(100); + } + + CSongDict.tRefreshScoreTables(); + + } + + public override void Activate() { + if (this.IsActivated) + return; + + if (!bFirstCrownLoad) { + // tLoadPads(); + + // Calculate Pads asynchonously + new Task(tLoadPads).Start(); + + bFirstCrownLoad = true; + + } + + OpenTaiko.stageSongSelect.actDifficultySelectionScreen.bIsDifficltSelect = false; + + this.pfBoxName = HPrivateFastFont.tInstantiateMainFont(OpenTaiko.Skin.SongSelect_BoxName_Scale); + this.pfMusicName = HPrivateFastFont.tInstantiateMainFont(OpenTaiko.Skin.SongSelect_MusicName_Scale); + this.pfSubtitle = HPrivateFastFont.tInstantiateMainFont(OpenTaiko.Skin.SongSelect_Subtitle_Scale); + this.pfMaker = HPrivateFastFont.tInstantiateBoxFont(OpenTaiko.Skin.SongSelect_Maker_Size); + this.pfBoxText = HPrivateFastFont.tInstantiateBoxFont(OpenTaiko.Skin.SongSelect_BoxText_Scale); + this.pfBPM = HPrivateFastFont.tInstantiateBoxFont(OpenTaiko.Skin.SongSelect_BPM_Text_Size); + + + this.b登場アニメ全部完了 = false; + this.ctScrollCounter = new CCounter(0, 1000, OpenTaiko.Skin.SongSelect_Scroll_Interval, OpenTaiko.Timer); + + // フォント作成。 + // 曲リスト文字は2倍(面積4倍)でテクスチャに描画してから縮小表示するので、フォントサイズは2倍とする。 + + // 現在選択中の曲がない(=はじめての活性化)なら、現在選択中の曲をルートの先頭ノードに設定する。 + + if ((this.rCurrentlySelectedSong == null) && (OpenTaiko.Songs管理.list曲ルート.Count > 0)) + this.rCurrentlySelectedSong = OpenTaiko.Songs管理.list曲ルート[0]; + + this.tバーの初期化(); + + this.ctBarOpen = new CCounter(); + this.ctBoxOpen = new CCounter(); + this.ctDifficultyIn = new CCounter(); + + this.ct三角矢印アニメ = new CCounter(); + + this.ctBarFlash = new CCounter(); + + this.ctScoreFrameAnime = new CCounter(); + + // strboxText here + if (this.rCurrentlySelectedSong != null) { #region [Box text] string _append = ""; @@ -1034,2034 +845,2223 @@ namespace OpenTaiko { } #endregion + } else { + strBoxText = "null"; + } - this.ctScrollCounter.Tick(); + for (int i = 0; i < OpenTaiko.Skin.SongSelect_Bar_Count; i++) { + this.stバー情報[i].ttkタイトル = this.ttkGenerateSongNameTexture(this.stバー情報[i].strタイトル文字列, this.stバー情報[i].ForeColor, this.stバー情報[i].BackColor, stバー情報[i].eバー種別 == Eバー種別.Box ? this.pfBoxName : this.pfMusicName); + } - // 進行。 - if (this.ctScrollCounter.CurrentValue == this.ctScrollCounter.EndValue) ct三角矢印アニメ.TickLoop(); - else ct三角矢印アニメ.CurrentValue = 0; + base.Activate(); + this.t選択曲が変更された(true); // #27648 2012.3.31 yyagi 選曲画面に入った直後の 現在位置/全アイテム数 の表示を正しく行うため + } + public override void DeActivate() { + if (this.IsDeActivated) + return; - int i選曲バーX座標 = 673; //選曲バーの座標用 - int i選択曲バーX座標 = 665; //選択曲バーの座標用 + OpenTaiko.tDisposeSafely(ref pfBoxName); + OpenTaiko.tDisposeSafely(ref pfMusicName); + OpenTaiko.tDisposeSafely(ref pfSubtitle); + OpenTaiko.tDisposeSafely(ref pfMaker); + OpenTaiko.tDisposeSafely(ref pfBPM); - int barCenterNum = (OpenTaiko.Skin.SongSelect_Bar_Count - 1) / 2; + tResetTitleKey(); + //ClearTitleTextureCache(); - if (this.ctScrollCounter.CurrentValue == this.ctScrollCounter.EndValue) { - nNowChange = 0; - } + this.ct三角矢印アニメ = null; - #region [ (2) 通常フェーズの描画。] - //----------------- - for (int i = 0; i < OpenTaiko.Skin.SongSelect_Bar_Count; i++) // パネルは全13枚。 + base.DeActivate(); + } + public override void CreateManagedResource() { + this.ft曲リスト用フォント = HPrivateFastFont.tInstantiateMainFont(40); + + int c = (CultureInfo.CurrentCulture.TwoLetterISOLanguageName == "ja") ? 0 : 1; + + #region [ Songs not found画像 ] + try { + this.txSongNotFound = new CTexture(ft曲リスト用フォント.DrawText("Songs not found.\nYou need to install songs.", Color.White)); + this.txSongNotFound.vcScaleRatio = new Vector3D(0.5f, 0.5f, 1f); // 半分のサイズで表示する。 + + /* + using( Bitmap image = new Bitmap( 640, 128 ) ) + using( Graphics graphics = Graphics.FromImage( image ) ) { - int index = i + nNowChange; - if (((index < 0 || index >= OpenTaiko.Skin.SongSelect_Bar_Count) && this.ctScrollCounter.CurrentValue != this.ctScrollCounter.EndValue)) - continue; + string[] s1 = { "曲データが見つかりません。", "Songs not found." }; + string[] s2 = { "曲データをDTXManiaGR.exe以下の", "You need to install songs." }; + string[] s3 = { "フォルダにインストールして下さい。", "" }; + graphics.DrawString( s1[c], this.ft曲リスト用フォント, Brushes.DarkGray, (float) 2f, (float) 2f ); + graphics.DrawString( s1[c], this.ft曲リスト用フォント, Brushes.White, (float) 0f, (float) 0f ); + graphics.DrawString( s2[c], this.ft曲リスト用フォント, Brushes.DarkGray, (float) 2f, (float) 44f ); + graphics.DrawString( s2[c], this.ft曲リスト用フォント, Brushes.White, (float) 0f, (float) 42f ); + graphics.DrawString( s3[c], this.ft曲リスト用フォント, Brushes.DarkGray, (float) 2f, (float) 86f ); + graphics.DrawString( s3[c], this.ft曲リスト用フォント, Brushes.White, (float) 0f, (float) 84f ); - int nパネル番号 = (((this.n現在の選択行 - barCenterNum) + i) + OpenTaiko.Skin.SongSelect_Bar_Count) % OpenTaiko.Skin.SongSelect_Bar_Count; - int n見た目の行番号 = i; - int n次のパネル番号 = (index % OpenTaiko.Skin.SongSelect_Bar_Count); - int x = i選曲バーX座標; + this.txSongNotFound = new CTexture( image ); - #region [Positions and layouts] - - int xZahyou = OpenTaiko.Skin.SongSelect_Bar_X[n見た目の行番号]; - int xNextZahyou = OpenTaiko.Skin.SongSelect_Bar_X[n次のパネル番号]; - int xCentralZahyou = OpenTaiko.Skin.SongSelect_Bar_X[barCenterNum]; - - int yZahyou = OpenTaiko.Skin.SongSelect_Bar_Y[n見た目の行番号]; - int yNextZahyou = OpenTaiko.Skin.SongSelect_Bar_Y[n次のパネル番号]; - int yCentralZahyou = OpenTaiko.Skin.SongSelect_Bar_Y[barCenterNum]; - - int Diff4 = Math.Abs(n見た目の行番号 - barCenterNum); - int NextDiff4 = Math.Abs(n次のパネル番号 - barCenterNum); - - /* - eLayoutType eLayout = (eLayoutType)TJAPlayer3.ConfigIni.nLayoutType; - - switch (eLayout) - { - case eLayoutType.DiagonalDownUp: - xZahyou = xCentralZahyou - 2 * (xZahyou - xCentralZahyou); - xNextZahyou = xCentralZahyou - 2 * (xNextZahyou - xCentralZahyou); - break; - case eLayoutType.Vertical: - xZahyou = xCentralZahyou; - xNextZahyou = xCentralZahyou; - break; - case eLayoutType.HalfCircleRight: - xZahyou = xCentralZahyou - 25 * (int)Math.Pow(Diff4, 2); - xNextZahyou = xCentralZahyou - 25 * (int)Math.Pow(NextDiff4, 2); - break; - case eLayoutType.HalfCircleLeft: - xZahyou = xCentralZahyou + 25 * (int)Math.Pow(Diff4, 2); - xNextZahyou = xCentralZahyou + 25 * (int)Math.Pow(NextDiff4, 2); - break; - default: - break; - } - */ - - #endregion - - // x set here - int xAnime = xZahyou + (int)((xNextZahyou - xZahyou) - * (1.0 - fNowScrollAnime)); - - int y = yZahyou + (int)((yNextZahyou - yZahyou) - * (1.0 - fNowScrollAnime)); - - // (B) スクロール中の選択曲バー、またはその他のバーの描画。 - - float Box = 0; - float Box_X = 0; - float Box_Y = 0; - int _center = (OpenTaiko.Skin.SongSelect_Bar_Count - 1) / 2; - float[] _boxAim = new float[2] - { - OpenTaiko.Skin.SongSelect_Bar_Anim_X[i], - OpenTaiko.Skin.SongSelect_Bar_Anim_Y[i] - }; - - int _movfs = i - 1; - int _maxfs = _center - 1; - int _gap = Math.Max(1, OpenTaiko.Skin.SongSelect_Bar_Count - 3); - - #region [ BoxOpenAnime ] - - if (i != _center && i != 0 && i < OpenTaiko.Skin.SongSelect_Bar_Count - 1) { - if (ctBoxOpen.CurrentValue >= 1000 && ctBoxOpen.CurrentValue <= 1560) { - float _curve = 1000 + (150 / _gap) * (_maxfs - _movfs);//Math.Abs(150 / (_center - i)); - Box_X = _boxAim[0] - (float)Math.Sin(((ctBoxOpen.CurrentValue - _curve) / 4 + 90) * (Math.PI / 180)) * _boxAim[0]; - Box_Y = _boxAim[1] - (float)Math.Sin(((ctBoxOpen.CurrentValue - _curve) / 4 + 90) * (Math.PI / 180)) * _boxAim[1]; - } - if (ctBoxOpen.CurrentValue > 1300 && ctBoxOpen.CurrentValue < 1940) { - ctBoxOpen.ChangeInterval(0.65); - Box_X = _boxAim[0]; - Box_Y = _boxAim[1]; - } - - if (ctBoxOpen.CurrentValue >= 1840 && ctBoxOpen.CurrentValue <= 2300) { - ctBoxOpen.ChangeInterval(1.3); - float _curve = 1940 - (100 / _gap) * (_maxfs - _movfs);// Math.Abs(100 / (_center - i)); - Box_X = _boxAim[0] - (float)Math.Sin(((ctBoxOpen.CurrentValue - _curve) / 4) * (Math.PI / 180)) * _boxAim[0]; - Box_Y = _boxAim[1] - (float)Math.Sin(((ctBoxOpen.CurrentValue - _curve) / 4) * (Math.PI / 180)) * _boxAim[1]; - } - - } - - #region [old] - - /* - if (ctBoxOpen.n現在の値 <= 560 + 1000) - { - if (i == 1) - { - if (ctBoxOpen.n現在の値 >= 1000 && ctBoxOpen.n現在の値 <= 360 + 1000) - Box = 400.0f - (float)Math.Sin(((ctBoxOpen.n現在の値 - 1000) / 4 + 90) * (Math.PI / 180)) * 400.0f; - if (ctBoxOpen.n現在の値 >= 360 + 1000) - Box = 400.0f; - } - if (i == 2) - { - if (ctBoxOpen.n現在の値 >= 75 + 1000 && ctBoxOpen.n現在の値 <= 435 + 1000) - Box = 500.0f - (float)Math.Sin(((ctBoxOpen.n現在の値 - 1075) / 4 + 90) * (Math.PI / 180)) * 500.0f; - if (ctBoxOpen.n現在の値 >= 435 + 1000) - Box = 500.0f; - } - if (i == 3) - { - if (ctBoxOpen.n現在の値 >= 150 + 1000 && ctBoxOpen.n現在の値 <= 510 + 1000) - Box = 600.0f - (float)Math.Sin(((ctBoxOpen.n現在の値 - 1150) / 4 + 90) * (Math.PI / 180)) * 600.0f; - if (ctBoxOpen.n現在の値 >= 510 + 1000) - Box = 600.0f; - } - if (i == 5) - { - if (ctBoxOpen.n現在の値 >= 150 + 1000 && ctBoxOpen.n現在の値 <= 510 + 1000) - Box = -600.0f + (float)Math.Sin(((ctBoxOpen.n現在の値 - 1150) / 4 + 90) * (Math.PI / 180)) * 600.0f; - if (ctBoxOpen.n現在の値 >= 510 + 1000) - Box = 600.0f; - } - if (i == 6) - { - if (ctBoxOpen.n現在の値 >= 75 + 1000 && ctBoxOpen.n現在の値 <= 435 + 1000) - Box = -500.0f + (float)Math.Sin(((ctBoxOpen.n現在の値 - 1075) / 4 + 90) * (Math.PI / 180)) * 500.0f; - if (ctBoxOpen.n現在の値 >= 435 + 1000) - Box = 500.0f; - } - if (i == 7) - { - if (ctBoxOpen.n現在の値 >= 1000 && ctBoxOpen.n現在の値 <= 360 + 1000) - Box = -400.0f + (float)Math.Sin(((ctBoxOpen.n現在の値 - 1000) / 4 + 90) * (Math.PI / 180)) * 400.0f; - if (ctBoxOpen.n現在の値 >= 360 + 1000) - Box = 400.0f; - } - } - - if (ctBoxOpen.n現在の値 > 1300 && ctBoxOpen.n現在の値 < 1940) - { - ctBoxOpen.t間隔値変更(0.65); - if (i == 1) - Box = 600.0f; - if (i == 2) - Box = 600.0f; - if (i == 3) - Box = 600.0f; - if (i == 5) - Box = -600.0f; - if (i == 6) - Box = -600.0f; - if (i == 7) - Box = -600.0f; - } - - if (ctBoxOpen.n現在の値 >= 1840 && ctBoxOpen.n現在の値 <= 560 + 1840) - { - ctBoxOpen.t間隔値変更(1.3); - if (i == 1) - { - if (ctBoxOpen.n現在の値 >= 100 + 1840 && ctBoxOpen.n現在の値 <= 460 + 1840) - Box = 600.0f - (float)Math.Sin(((ctBoxOpen.n現在の値 - 1940) / 4) * (Math.PI / 180)) * 600.0f; - if (ctBoxOpen.n現在の値 < 100 + 1840) - Box = 600.0f; - } - if (i == 2) - { - if (ctBoxOpen.n現在の値 >= 50 + 1840 && ctBoxOpen.n現在の値 <= 410 + 1840) - Box = 500.0f - (float)Math.Sin(((ctBoxOpen.n現在の値 - 1890) / 4) * (Math.PI / 180)) * 500.0f; - if (ctBoxOpen.n現在の値 < 50 + 1840) - Box = 600.0f; - } - if (i == 3) - { - if (ctBoxOpen.n現在の値 >= 1840 && ctBoxOpen.n現在の値 <= 360 + 1840) - Box = 400.0f - (float)Math.Sin(((ctBoxOpen.n現在の値 - 1840) / 4) * (Math.PI / 180)) * 400.0f; - if (ctBoxOpen.n現在の値 < 1840) - Box = 600.0f; - } - if (i == 5) - { - if (ctBoxOpen.n現在の値 >= 1840 && ctBoxOpen.n現在の値 <= 360 + 1840) - Box = -400.0f + (float)Math.Sin(((ctBoxOpen.n現在の値 - 1840) / 4) * (Math.PI / 180)) * 400.0f; - if (ctBoxOpen.n現在の値 < 1840) - Box = -600.0f; - } - if (i == 6) - { - if (ctBoxOpen.n現在の値 >= 50 + 1840 && ctBoxOpen.n現在の値 <= 410 + 1840) - Box = -500.0f + (float)Math.Sin(((ctBoxOpen.n現在の値 - 1890) / 4) * (Math.PI / 180)) * 500.0f; - if (ctBoxOpen.n現在の値 < 50 + 1840) - Box = -600.0f; - } - if (i == 7) - { - if (ctBoxOpen.n現在の値 >= 100 + 1840 && ctBoxOpen.n現在の値 <= 460 + 1840) - Box = -600.0f + (float)Math.Sin(((ctBoxOpen.n現在の値 - 1940) / 4) * (Math.PI / 180)) * 600.0f; - if (ctBoxOpen.n現在の値 < 100 + 1840) - Box = -600.0f; - } - } - */ - - #endregion - - #endregion - - - #region [ バーテクスチャを描画。] - //----------------- - - // int boxType = nStrジャンルtoNum(stバー情報[nパネル番号].strジャンル); - string boxType = stバー情報[nパネル番号].BoxType; - var bar_genre = HGenreBar.tGetGenreBar(boxType, OpenTaiko.Tx.SongSelect_Bar_Genre); - var bar_genre_overlap = HGenreBar.tGetGenreBar(boxType, OpenTaiko.Tx.SongSelect_Bar_Genre_Overlap); - - bar_genre.color4 = CConversion.ColorToColor4(stバー情報[nパネル番号].BoxColor); - - bar_genre.vcScaleRatio.X = 1.0f; - if (bar_genre_overlap != null) - bar_genre_overlap.vcScaleRatio.X = 1.0f; - - OpenTaiko.Tx.SongSelect_Bar_Genre_Overlay.vcScaleRatio.X = 1.0f; - OpenTaiko.Tx.SongSelect_Bar_Genre_Back.vcScaleRatio.X = 1.0f; - OpenTaiko.Tx.SongSelect_Bar_Genre_Random.vcScaleRatio.X = 1.0f; - - - - if (ctScrollCounter.CurrentValue != ctScrollCounter.EndValue || n見た目の行番号 != barCenterNum) { - int songType = 0; - if (this.stバー情報[nパネル番号].ar難易度[(int)Difficulty.Dan] >= 0) - songType = 1; - else if (this.stバー情報[nパネル番号].ar難易度[(int)Difficulty.Tower] >= 0) - songType = 2; - - // TJAPlayer3.act文字コンソール.tPrint(x + -470, y + 30, C文字コンソール.Eフォント種別.白, (this.stバー情報[nパネル番号].ar難易度[(int)Difficulty.Tower]).ToString()); - - - // Very disgusting, to improve and unbloat asap - this.tジャンル別選択されていない曲バーの描画( - xAnime - (int)Box_X,//Box, - y - ((int)Box_Y),//Box * 3), - this.stバー情報[nパネル番号].strジャンル, - stバー情報[nパネル番号].eバー種別, - stバー情報[nパネル番号].nクリア, - stバー情報[nパネル番号].nスコアランク, - boxType, - songType, - stバー情報[nパネル番号].csu, - stバー情報[nパネル番号].reference); - } - - /* - - else if (n見た目の行番号 != 4) - this.tジャンル別選択されていない曲バーの描画(xAnime - (int)Box, y - ((int)Box * 3), this.stバー情報[nパネル番号].strジャンル, stバー情報[nパネル番号].eバー種別, stバー情報[nパネル番号].nクリア, stバー情報[nパネル番号].nスコアランク, boxType); - - */ - - //----------------- - #endregion - - var IsSongLocked = OpenTaiko.Databases.DBSongUnlockables.tIsSongLocked(stバー情報[nパネル番号].reference); - var HiddenIndex = OpenTaiko.Databases.DBSongUnlockables.tGetSongHiddenIndex(stバー情報[nパネル番号].reference); - - var _title = TitleTextureKey.ResolveTitleTexture(this.stバー情報[nパネル番号].ttkタイトル, OpenTaiko.Skin.SongSelect_VerticalText); - if (HiddenIndex >= DBSongUnlockables.EHiddenIndex.BLURED) { - _title.bUseNoiseEffect = true; - } - - #region [ タイトル名テクスチャを描画。] - if (ctDifficultyIn.CurrentValue >= 1000 && OpenTaiko.stageSongSelect.actDifficultySelectionScreen.bIsDifficltSelect) - _title.Opacity = (int)255.0f - (ctDifficultyIn.CurrentValue - 1000); - else - _title.Opacity = 255; - - if (ctScrollCounter.CurrentValue != ctScrollCounter.EndValue) - _title.t2D拡大率考慮中央基準描画( - xAnime - Box_X + GetTitleOffsetX(this.stバー情報[nパネル番号].eバー種別), y - Box_Y + GetTitleOffsetY(this.stバー情報[nパネル番号].eバー種別)); - else if (n見た目の行番号 != barCenterNum) - _title.t2D拡大率考慮中央基準描画( - xAnime - Box_X + GetTitleOffsetX(this.stバー情報[nパネル番号].eバー種別), y - Box_Y + GetTitleOffsetY(this.stバー情報[nパネル番号].eバー種別)); - #endregion - - if (HiddenIndex >= DBSongUnlockables.EHiddenIndex.BLURED) { - _title.bUseNoiseEffect = false; - } - - if (HiddenIndex >= DBSongUnlockables.EHiddenIndex.GRAYED) { - OpenTaiko.Tx.SongSelect_Bar_Genre_Locked_Top?.t2D描画(xAnime - (int)Box_X, y - ((int)Box_Y)); - } - - - //----------------- } + */ + } catch (CTextureCreateFailedException e) { + Trace.TraceError(e.ToString()); + Trace.TraceError("SoungNotFoundテクスチャの作成に失敗しました。"); + this.txSongNotFound = null; + } + #endregion + #region [ "曲データを検索しています"画像 ] + try { + this.txEnumeratingSongs = new CTexture(ft曲リスト用フォント.DrawText("Now loading songs.\nPlease wait...", Color.White)); + this.txEnumeratingSongs.vcScaleRatio = new Vector3D(0.5f, 0.5f, 1f); // 半分のサイズで表示する。 + + /* + using ( Bitmap image = new Bitmap( 640, 96 ) ) + using ( Graphics graphics = Graphics.FromImage( image ) ) + { + string[] s1 = { "曲データを検索しています。", "Now loading songs." }; + string[] s2 = { "そのまましばらくお待ち下さい。", "Please wait..." }; + graphics.DrawString( s1[c], this.ft曲リスト用フォント, Brushes.DarkGray, (float) 2f, (float) 2f ); + graphics.DrawString( s1[c], this.ft曲リスト用フォント, Brushes.White, (float) 0f, (float) 0f ); + graphics.DrawString( s2[c], this.ft曲リスト用フォント, Brushes.DarkGray, (float) 2f, (float) 44f ); + graphics.DrawString( s2[c], this.ft曲リスト用フォント, Brushes.White, (float) 0f, (float) 42f ); + + this.txEnumeratingSongs = new CTexture( image ); + + this.txEnumeratingSongs.vc拡大縮小倍率 = new Vector3D( 0.5f, 0.5f, 1f ); // 半分のサイズで表示する。 + } + */ + } catch (CTextureCreateFailedException e) { + Trace.TraceError(e.ToString()); + Trace.TraceError("txEnumeratingSongsテクスチャの作成に失敗しました。"); + this.txEnumeratingSongs = null; + } + #endregion + #region [ 曲数表示 ] + //this.txアイテム数数字 = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\ScreenSelect skill number on gauge etc.png" ), false ); + #endregion + + base.CreateManagedResource(); + } + public override void ReleaseManagedResource() { + OpenTaiko.tDisposeSafely(ref this.ft曲リスト用フォント); + + for (int i = 0; i < OpenTaiko.Skin.SongSelect_Bar_Count; i++) { + OpenTaiko.tテクスチャの解放(ref this.stバー情報[i].txタイトル名); + this.stバー情報[i].ttkタイトル = null; + } + + OpenTaiko.tテクスチャの解放(ref this.txEnumeratingSongs); + OpenTaiko.tテクスチャの解放(ref this.txSongNotFound); + + base.ReleaseManagedResource(); + } + public override int Draw() { + if (this.IsDeActivated) + return 0; + + #region [ 初めての進行描画 ] + //----------------- + if (this.IsFirstDraw) { + OpenTaiko.stageSongSelect.tNotifySelectedSongChange(); + + ctBarOpen.Start(0, 260, 2, OpenTaiko.Timer); + this.ct三角矢印アニメ.Start(0, 1000, 1, OpenTaiko.Timer); + base.IsFirstDraw = false; + } + //----------------- + #endregion + + ctBarFlash.Tick(); + ctBoxOpen.Tick(); + ctBarOpen.Tick(); + ctDifficultyIn.Tick(); + + float BarAnimeCount = this.ctBarOpen.CurrentValue <= 200 ? 0 : (float)Math.Sin(((this.ctBarOpen.CurrentValue - 200) * 1.5f) * (Math.PI / 180)); + int centerMove = (int)(BarAnimeCount * OpenTaiko.Skin.SongSelect_Bar_Center_Move); + int centerMoveX = (int)(BarAnimeCount * OpenTaiko.Skin.SongSelect_Bar_Center_Move_X); + + if (BarAnimeCount == 1.0) + ctScoreFrameAnime.TickLoop(); + + // まだ選択中の曲が決まってなければ、曲ツリールートの最初の曲にセットする。 + + if ((this.rCurrentlySelectedSong == null) && (OpenTaiko.Songs管理.list曲ルート.Count > 0)) { + nSelectSongIndex = 0; + this.rCurrentlySelectedSong = OpenTaiko.Songs管理.list曲ルート[nSelectSongIndex]; + } + + // 描画。 + if (this.rCurrentlySelectedSong == null) { + #region [Songs not found / Enumerating song screens] + //----------------- + if (bIsEnumeratingSongs) { + if (this.txEnumeratingSongs != null) { + this.txEnumeratingSongs.t2D描画(320, 160); + } + } else { + if (this.txSongNotFound != null) + this.txSongNotFound.t2D描画(320, 160); + } + //----------------- #endregion - - if (OpenTaiko.Skin.SongSelect_Bar_Select_Skip_Fade || - this.ctScrollCounter.CurrentValue == this.ctScrollCounter.EndValue) { - #region [ Bar_Select ] - - int barSelect_width = OpenTaiko.Tx.SongSelect_Bar_Select.sz画像サイズ.Width; - int barSelect_height = OpenTaiko.Tx.SongSelect_Bar_Select.sz画像サイズ.Height / 2; - - if (ctBarFlash.IsEnded && !OpenTaiko.stageSongSelect.actDifficultySelectionScreen.bIsDifficltSelect) { - OpenTaiko.Tx.SongSelect_Bar_Select.Opacity = (int)(BarAnimeCount * 255.0f); - if (OpenTaiko.Skin.SongSelect_Bar_Select_Skip_Fade) - OpenTaiko.Tx.SongSelect_Bar_Select.Opacity = 255; - - } else - OpenTaiko.Tx.SongSelect_Bar_Select.Opacity = (int)(255 - (ctBarFlash.CurrentValue - 700) * 2.55f); - - OpenTaiko.Tx.SongSelect_Bar_Select.t2D描画(OpenTaiko.Skin.SongSelect_Bar_Select[0], OpenTaiko.Skin.SongSelect_Bar_Select[1], new Rectangle(0, 0, barSelect_width, barSelect_height)); - - #region [ BarFlash ] - - if (ctBarFlash.CurrentValue <= 100) - OpenTaiko.Tx.SongSelect_Bar_Select.Opacity = (int)(ctBarFlash.CurrentValue * 2.55f); - else if (ctBarFlash.CurrentValue <= 200) - OpenTaiko.Tx.SongSelect_Bar_Select.Opacity = (int)(255 - (ctBarFlash.CurrentValue - 100) * 2.55f); - else if (ctBarFlash.CurrentValue <= 300) - OpenTaiko.Tx.SongSelect_Bar_Select.Opacity = (int)((ctBarFlash.CurrentValue - 200) * 2.55f); - else if (ctBarFlash.CurrentValue <= 400) - OpenTaiko.Tx.SongSelect_Bar_Select.Opacity = (int)(255 - (ctBarFlash.CurrentValue - 300) * 2.55f); - else if (ctBarFlash.CurrentValue <= 500) - OpenTaiko.Tx.SongSelect_Bar_Select.Opacity = (int)((ctBarFlash.CurrentValue - 400) * 2.55f); - else if (ctBarFlash.CurrentValue <= 600) - OpenTaiko.Tx.SongSelect_Bar_Select.Opacity = (int)(255 - (ctBarFlash.CurrentValue - 500) * 2.55f); - else if (ctBarFlash.CurrentValue <= 700) - OpenTaiko.Tx.SongSelect_Bar_Select.Opacity = (int)((ctBarFlash.CurrentValue - 600) * 2.55f); - else if (ctBarFlash.CurrentValue <= 800) - OpenTaiko.Tx.SongSelect_Bar_Select.Opacity = (int)(255 - (ctBarFlash.CurrentValue - 700) * 2.55f); - else - OpenTaiko.Tx.SongSelect_Bar_Select.Opacity = 0; - - OpenTaiko.Tx.SongSelect_Bar_Select.t2D描画(OpenTaiko.Skin.SongSelect_Bar_Select[0], OpenTaiko.Skin.SongSelect_Bar_Select[1], new Rectangle(0, barSelect_height, barSelect_width, barSelect_height)); - - #endregion - - #endregion - } - - - if (this.ctScrollCounter.CurrentValue == this.ctScrollCounter.EndValue) { - #region [ Draw BarCenter ] - - - - if (rCurrentlySelectedSong.eノード種別 == CSongListNode.ENodeType.SCORE) { - #region [ Score ] - - var IsSongLocked = OpenTaiko.Databases.DBSongUnlockables.tIsSongLocked(rCurrentlySelectedSong); - var HiddenIndex = OpenTaiko.Databases.DBSongUnlockables.tGetSongHiddenIndex(rCurrentlySelectedSong); - - #region [ Bar ] - - if (HiddenIndex >= DBSongUnlockables.EHiddenIndex.GRAYED) { - DrawBarCenter(OpenTaiko.Tx.SongSelect_Bar_Genre_Locked, OpenTaiko.Skin.SongSelect_Bar_X[barCenterNum], OpenTaiko.Skin.SongSelect_Bar_Y[barCenterNum], centerMoveX, centerMove, false, false, false); - } else { - var bar_genre = HGenreBar.tGetGenreBar(rCurrentlySelectedSong.BoxType, OpenTaiko.Tx.SongSelect_Bar_Genre); - var bar_genre_overlap = HGenreBar.tGetGenreBar(rCurrentlySelectedSong.BoxType, OpenTaiko.Tx.SongSelect_Bar_Genre_Overlap); - - DrawBarCenter(bar_genre, OpenTaiko.Skin.SongSelect_Bar_X[barCenterNum], OpenTaiko.Skin.SongSelect_Bar_Y[barCenterNum], centerMoveX, centerMove, true, false, false); - DrawBarCenter(bar_genre_overlap, OpenTaiko.Skin.SongSelect_Bar_X[barCenterNum], OpenTaiko.Skin.SongSelect_Bar_Y[barCenterNum], centerMoveX, centerMove, false, true, true); - - #region [ Crown and ScoreRank ] - - // Mark - - if (this.rCurrentlySelectedSong.arスコア[(int)Difficulty.Dan] != null) { - //int[] clear = this.r現在選択中の曲.arスコア[(int)Difficulty.Dan].譜面情報.nクリア; - - for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { - if (i >= 2) continue; - - int ap = OpenTaiko.GetActualPlayer(i); - - var TableEntry = OpenTaiko.SaveFileInstances[ap].data.tGetSongSelectTableEntry(rCurrentlySelectedSong.tGetUniqueId()); - - int[] clear = TableEntry.ClearStatuses; - - int currentRank = Math.Min(clear[(int)Difficulty.Dan], 8) - 3; - - int x = OpenTaiko.Skin.SongSelect_Bar_X[barCenterNum] + OpenTaiko.Skin.SongSelect_DanStatus_Offset_X[i]; - int y = OpenTaiko.Skin.SongSelect_Bar_Y[barCenterNum] + OpenTaiko.Skin.SongSelect_DanStatus_Offset_Y[i]; - - displayDanStatus((int)(x - centerMoveX / 1.1f), (int)(y - centerMove / 1.1f), currentRank, 0.2f); - } - - } else if (this.rCurrentlySelectedSong.arスコア[(int)Difficulty.Tower] != null) { - //int[] clear = this.r現在選択中の曲.arスコア[(int)Difficulty.Tower].譜面情報.nクリア; - - for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { - if (i >= 2) continue; - - int ap = OpenTaiko.GetActualPlayer(i); - var TableEntry = OpenTaiko.SaveFileInstances[ap].data.tGetSongSelectTableEntry(rCurrentlySelectedSong.tGetUniqueId()); - - int[] clear = TableEntry.ClearStatuses; - - int currentRank = Math.Min(clear[(int)Difficulty.Tower], 8) - 2; - - int x = OpenTaiko.Skin.SongSelect_Bar_X[barCenterNum] + OpenTaiko.Skin.SongSelect_TowerStatus_Offset_X[i]; - int y = OpenTaiko.Skin.SongSelect_Bar_Y[barCenterNum] + OpenTaiko.Skin.SongSelect_TowerStatus_Offset_Y[i]; - - displayTowerStatus((int)(x - centerMoveX / 1.1f), (int)(y - centerMove / 1.1f), currentRank, 0.3f); - } - } else if (this.rCurrentlySelectedSong.arスコア[3] != null || this.rCurrentlySelectedSong.arスコア[4] != null) { - //var sr = this.rCurrentlySelectedSong.arスコア[n現在のアンカ難易度レベルに最も近い難易度レベルを返す(this.rCurrentlySelectedSong)]; - - for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { - if (i >= 2) continue; - - int ap = OpenTaiko.GetActualPlayer(i); - var TableEntry = OpenTaiko.SaveFileInstances[ap].data.tGetSongSelectTableEntry(OpenTaiko.stageSongSelect.rNowSelectedSong.tGetUniqueId()); - - int[] クリア = TableEntry.ClearStatuses; - - int[] スコアランク = TableEntry.ScoreRanks; - - int x = OpenTaiko.Skin.SongSelect_Bar_X[barCenterNum] + OpenTaiko.Skin.SongSelect_RegularCrowns_Offset_X[i]; - int y = OpenTaiko.Skin.SongSelect_Bar_Y[barCenterNum] + OpenTaiko.Skin.SongSelect_RegularCrowns_Offset_Y[i]; - - displayRegularCrowns((int)(x - centerMoveX / 1.1f), (int)(y - centerMove / 1.1f), クリア, スコアランク, 0.8f + BarAnimeCount / 620f); - - } - } - - - #endregion - - #region [Favorite status and Locked icon] - - if (IsSongLocked) { - displayVisibleLockStatus( - (int)(OpenTaiko.Skin.SongSelect_Bar_X[barCenterNum] + OpenTaiko.Skin.SongSelect_FavoriteStatus_Offset[0] - centerMoveX / 1.1f), - (int)(OpenTaiko.Skin.SongSelect_Bar_Y[barCenterNum] + OpenTaiko.Skin.SongSelect_FavoriteStatus_Offset[1] - centerMove / 1.1f), 1f); - } else { - displayFavoriteStatus( - (int)(OpenTaiko.Skin.SongSelect_Bar_X[barCenterNum] + OpenTaiko.Skin.SongSelect_FavoriteStatus_Offset[0] - centerMoveX / 1.1f), - (int)(OpenTaiko.Skin.SongSelect_Bar_Y[barCenterNum] + OpenTaiko.Skin.SongSelect_FavoriteStatus_Offset[1] - centerMove / 1.1f), this.rCurrentlySelectedSong.uniqueId, 1f + BarAnimeCount / 620f); - } - #endregion - - #region [Level number big] - - tPrintLevelNumberBig( - (int)(OpenTaiko.Skin.SongSelect_Bar_X[barCenterNum] + OpenTaiko.Skin.SongSelect_Level_Offset[0] - centerMoveX / 1.1f), - (int)(OpenTaiko.Skin.SongSelect_Bar_Y[barCenterNum] + OpenTaiko.Skin.SongSelect_Level_Offset[1] - centerMove / 1.1f), - this.rCurrentlySelectedSong - ); - - #endregion - } - - #endregion - - - - - #endregion - } - if (rCurrentlySelectedSong.eノード種別 == CSongListNode.ENodeType.BOX) { - #region [ Box ] - - //int boxType = nStrジャンルtoNum(r現在選択中の曲.strジャンル); - var bar_genre = HGenreBar.tGetGenreBar(rCurrentlySelectedSong.BoxType, OpenTaiko.Tx.SongSelect_Bar_Genre); // Box - var bar_genre_overlap = HGenreBar.tGetGenreBar(rCurrentlySelectedSong.BoxType, OpenTaiko.Tx.SongSelect_Bar_Genre_Overlap); - - //DrawBarCenter(TJAPlayer3.Tx.SongSelect_Bar_Genre[boxType], TJAPlayer3.Skin.SongSelect_Bar_X[barCenterNum], TJAPlayer3.Skin.SongSelect_Bar_Y[barCenterNum], centerMoveX, centerMove, true, true, false); - - DrawBarCenter(bar_genre, OpenTaiko.Skin.SongSelect_Bar_X[barCenterNum], OpenTaiko.Skin.SongSelect_Bar_Y[barCenterNum], centerMoveX, centerMove, true, false, false); - DrawBarCenter(bar_genre_overlap, OpenTaiko.Skin.SongSelect_Bar_X[barCenterNum], OpenTaiko.Skin.SongSelect_Bar_Y[barCenterNum], centerMoveX, centerMove, false, true, false); - - - #endregion - } - if (rCurrentlySelectedSong.eノード種別 == CSongListNode.ENodeType.BACKBOX) { - #region [ BackBox ] - - DrawBarCenter(OpenTaiko.Tx.SongSelect_Bar_Genre_Back, OpenTaiko.Skin.SongSelect_Bar_X[barCenterNum], OpenTaiko.Skin.SongSelect_Bar_Y[barCenterNum], centerMoveX, centerMove, false, false, false); - - #endregion - } - if (rCurrentlySelectedSong.eノード種別 == CSongListNode.ENodeType.RANDOM) { - #region [Random box] - - DrawBarCenter(OpenTaiko.Tx.SongSelect_Bar_Genre_Random, OpenTaiko.Skin.SongSelect_Bar_X[barCenterNum], OpenTaiko.Skin.SongSelect_Bar_Y[barCenterNum], centerMoveX, centerMove, false, false, false); - - #endregion - } - - #endregion - - switch (rCurrentlySelectedSong.eノード種別) { - case CSongListNode.ENodeType.SCORE: { - var IsSongLocked = OpenTaiko.Databases.DBSongUnlockables.tIsSongLocked(rCurrentlySelectedSong); - var HiddenIndex = OpenTaiko.Databases.DBSongUnlockables.tGetSongHiddenIndex(rCurrentlySelectedSong); - - #region [Difficulty bars] - - if (OpenTaiko.Tx.SongSelect_Frame_Score != null && HiddenIndex < DBSongUnlockables.EHiddenIndex.GRAYED) { - // 難易度がTower、Danではない - if (OpenTaiko.stageSongSelect.n現在選択中の曲の難易度 != (int)Difficulty.Tower && OpenTaiko.stageSongSelect.n現在選択中の曲の難易度 != (int)Difficulty.Dan) { - #region [Display difficulty boxes] - - bool uraExists = OpenTaiko.stageSongSelect.r現在選択中のスコア.譜面情報.nレベル[(int)Difficulty.Edit] >= 0; - bool omoteExists = OpenTaiko.stageSongSelect.r現在選択中のスコア.譜面情報.nレベル[(int)Difficulty.Oni] >= 0; - - for (int i = 0; i < (int)Difficulty.Edit + 1; i++) { - if (ctBarOpen.CurrentValue >= 100 || OpenTaiko.Skin.SongSelect_Shorten_Frame_Fade) { - #region [Skip conditions] - - // Don't even bother process the Ura box if there isn't one - if (!uraExists && i == (int)Difficulty.Edit) - break; - - // Don't process oni box if ura exists but not oni - else if (uraExists && !omoteExists && i == (int)Difficulty.Oni) - continue; - - #endregion - - // avaliable : bool (Chart exists) - #region [Gray box if stage isn't avaliable] - - bool avaliable = OpenTaiko.stageSongSelect.r現在選択中のスコア.譜面情報.nレベル[i] >= 0; - - if (avaliable) - OpenTaiko.Tx.SongSelect_Frame_Score[0].color4 = new Color4(1f, 1f, 1f, 1f); - else - OpenTaiko.Tx.SongSelect_Frame_Score[0].color4 = new Color4(0.5f, 0.5f, 0.5f, 1f); - - #endregion - - // opacity : int (Box and scores opacity) - #region [Opacity management] - - int opacity = 0; - - if (avaliable && BarAnimeCount == 1.0) { - if (ctScoreFrameAnime.CurrentValue <= 3000) - opacity = Math.Max(0, ctScoreFrameAnime.CurrentValue - 2745); - else - opacity = Math.Min(255, 255 - (ctScoreFrameAnime.CurrentValue - 5745)); - } - - #endregion - - #region [Display box parameters] - - bool _switchingUra = i == (int)Difficulty.Edit && omoteExists; - - int difSelectOpacity = (_switchingUra) ? (BarAnimeCount < 1.0 ? 0 : opacity) : (int)(BarAnimeCount * 255.0f); - - if (OpenTaiko.Skin.SongSelect_Shorten_Frame_Fade && !_switchingUra) { - difSelectOpacity = 255; - } - - - if (!OpenTaiko.stageSongSelect.actDifficultySelectionScreen.bIsDifficltSelect || ctDifficultyIn.CurrentValue < 1000) { - OpenTaiko.Tx.SongSelect_Frame_Score[0].Opacity = difSelectOpacity; - OpenTaiko.Tx.SongSelect_Level_Number.Opacity = difSelectOpacity; - OpenTaiko.Tx.SongSelect_Level_Number_Icon?.tUpdateOpacity(difSelectOpacity); - OpenTaiko.Tx.SongSelect_Level_Number_Colored?.tUpdateOpacity(difSelectOpacity); - if (OpenTaiko.Tx.SongSelect_Level != null) OpenTaiko.Tx.SongSelect_Level.Opacity = difSelectOpacity; - } else if (ctDifficultyIn.CurrentValue >= 1000) { - int difInOpacity = (int)((float)((int)255.0f - (ctDifficultyIn.CurrentValue - 1000)) * ((i == (int)Difficulty.Edit && omoteExists) ? (float)difSelectOpacity / 255f : 1f)); - - OpenTaiko.Tx.SongSelect_Frame_Score[0].Opacity = difInOpacity; - OpenTaiko.Tx.SongSelect_Level_Number.Opacity = difInOpacity; - OpenTaiko.Tx.SongSelect_Level_Number_Icon?.tUpdateOpacity(difInOpacity); - OpenTaiko.Tx.SongSelect_Level_Number_Colored?.tUpdateOpacity(difInOpacity); - if (OpenTaiko.Tx.SongSelect_Level != null) OpenTaiko.Tx.SongSelect_Level.Opacity = difInOpacity; - } - - #endregion - - #region [Displayables] - - int displayingDiff = Math.Min(i, (int)Difficulty.Oni); - int positionalOffset = displayingDiff * 122; - - int width = OpenTaiko.Tx.SongSelect_Frame_Score[0].sz画像サイズ.Width / 5; - int height = OpenTaiko.Tx.SongSelect_Frame_Score[0].sz画像サイズ.Height; - - OpenTaiko.Tx.SongSelect_Frame_Score[0].t2D描画(OpenTaiko.Skin.SongSelect_Frame_Score_X[displayingDiff], OpenTaiko.Skin.SongSelect_Frame_Score_Y[displayingDiff], new Rectangle(width * i, 0, width, height)); - - if (avaliable) { - t小文字表示(OpenTaiko.Skin.SongSelect_Level_Number_X[displayingDiff], OpenTaiko.Skin.SongSelect_Level_Number_Y[displayingDiff], - OpenTaiko.stageSongSelect.r現在選択中のスコア.譜面情報.nレベル[i], - i, - OpenTaiko.stageSongSelect.r現在選択中のスコア.譜面情報.nLevelIcon[i] - ); - - if (OpenTaiko.Tx.SongSelect_Level != null) { - int level_width = OpenTaiko.Tx.SongSelect_Level.szTextureSize.Width / 7; - int level_height = OpenTaiko.Tx.SongSelect_Level.szTextureSize.Height; - - for (int i2 = 0; i2 < OpenTaiko.stageSongSelect.r現在選択中のスコア.譜面情報.nレベル[i]; i2++) { - OpenTaiko.Tx.SongSelect_Level.t2D描画( - OpenTaiko.Skin.SongSelect_Level_X[displayingDiff] + (OpenTaiko.Skin.SongSelect_Level_Move[0] * i2), - OpenTaiko.Skin.SongSelect_Level_Y[displayingDiff] + (OpenTaiko.Skin.SongSelect_Level_Move[1] * i2), - new RectangleF(level_width * i, 0, level_width, level_height)); - } - } - - if (OpenTaiko.stageSongSelect.r現在選択中のスコア.譜面情報.b譜面分岐[i]) { - OpenTaiko.Tx.SongSelect_Branch?.tUpdateOpacity(OpenTaiko.Tx.SongSelect_Frame_Score[0].Opacity); - OpenTaiko.Tx.SongSelect_Branch?.t2D描画( - - OpenTaiko.Skin.SongSelect_Frame_Score_X[displayingDiff] + OpenTaiko.Skin.SongSelect_Branch_Offset[0], - OpenTaiko.Skin.SongSelect_Frame_Score_Y[displayingDiff] + OpenTaiko.Skin.SongSelect_Branch_Offset[1] - ); - } - - } - - #endregion - - } - } - - #endregion - - } else { - // diff : int (5 : Tower, 6 : Dan) - #region [Check if Dan or Tower] - - int diff = 5; - if (OpenTaiko.stageSongSelect.n現在選択中の曲の難易度 == (int)Difficulty.Dan) - diff = 6; - - #endregion - - // avaliable : bool (Chart exists) - #region [Gray box if stage isn't avaliable] - - bool avaliable = OpenTaiko.stageSongSelect.r現在選択中のスコア.譜面情報.nレベル[diff] >= 0; - - if (avaliable) - OpenTaiko.Tx.SongSelect_Frame_Score[1].color4 = new Color4(1f, 1f, 1f, 1f); - else - OpenTaiko.Tx.SongSelect_Frame_Score[1].color4 = new Color4(0.5f, 0.5f, 0.5f, 1f); - - #endregion - - #region [Display box parameters] - - int difSelectOpacity = (int)(BarAnimeCount * 255); - - if (OpenTaiko.Skin.SongSelect_Shorten_Frame_Fade) - difSelectOpacity = 255; - - if (!OpenTaiko.stageSongSelect.actDifficultySelectionScreen.bIsDifficltSelect || ctDifficultyIn.CurrentValue < 1000) { - OpenTaiko.Tx.SongSelect_Frame_Score[1].Opacity = difSelectOpacity; - OpenTaiko.Tx.SongSelect_Level_Number.Opacity = difSelectOpacity; - OpenTaiko.Tx.SongSelect_Level_Number_Icon?.tUpdateOpacity(difSelectOpacity); - OpenTaiko.Tx.SongSelect_Level_Number_Colored?.tUpdateOpacity(difSelectOpacity); - if (OpenTaiko.Tx.SongSelect_Level != null) OpenTaiko.Tx.SongSelect_Level.Opacity = difSelectOpacity; - } else if (ctDifficultyIn.CurrentValue >= 1000) { - int difInOpacity = (int)255.0f - (ctDifficultyIn.CurrentValue - 1000); - - OpenTaiko.Tx.SongSelect_Frame_Score[1].Opacity = difInOpacity; - OpenTaiko.Tx.SongSelect_Level_Number.Opacity = difInOpacity; - OpenTaiko.Tx.SongSelect_Level_Number_Icon?.tUpdateOpacity(difInOpacity); - OpenTaiko.Tx.SongSelect_Level_Number_Colored?.tUpdateOpacity(difInOpacity); - if (OpenTaiko.Tx.SongSelect_Level != null) OpenTaiko.Tx.SongSelect_Level.Opacity = difInOpacity; - } - - #endregion - - #region [Displayables] - - int displayingDiff = diff == 5 ? 0 : 2; - int width = OpenTaiko.Tx.SongSelect_Frame_Score[0].sz画像サイズ.Width / 5; - int height = OpenTaiko.Tx.SongSelect_Frame_Score[0].sz画像サイズ.Height; - - OpenTaiko.Tx.SongSelect_Frame_Score[1].t2D描画(OpenTaiko.Skin.SongSelect_Frame_Score_X[displayingDiff], OpenTaiko.Skin.SongSelect_Frame_Score_Y[displayingDiff], new Rectangle(width * displayingDiff, 0, width, height)); - - var _level_number = (diff == 5) ? OpenTaiko.Skin.SongSelect_Level_Number_Tower : OpenTaiko.Skin.SongSelect_Level_Number_Tower; - - - if (avaliable) { - t小文字表示(OpenTaiko.Skin.SongSelect_Level_Number_X[displayingDiff], OpenTaiko.Skin.SongSelect_Level_Number_Y[displayingDiff], - OpenTaiko.stageSongSelect.r現在選択中のスコア.譜面情報.nレベル[diff], - diff, - OpenTaiko.stageSongSelect.r現在選択中のスコア.譜面情報.nLevelIcon[diff] - ); - - if (diff == 5) { - var _sidet = OpenTaiko.Tx.SongSelect_Tower_Side; - if (_sidet != null) { - var _side = (OpenTaiko.stageSongSelect.rNowSelectedSong.nSide == CDTX.ESide.eNormal) ? 0 : 1; - var _sc = _sidet.sz画像サイズ.Width / 2; - _sidet.t2D描画( - OpenTaiko.Skin.SongSelect_Tower_Side[0], - OpenTaiko.Skin.SongSelect_Tower_Side[1], - new Rectangle(_side * _sc, 0, _sc, _sidet.sz画像サイズ.Height)); - } - - } - - if (OpenTaiko.Tx.SongSelect_Level != null) { - int level_width = OpenTaiko.Tx.SongSelect_Level.szTextureSize.Width / 7; - int level_height = OpenTaiko.Tx.SongSelect_Level.szTextureSize.Height; - - for (int i2 = 0; i2 < OpenTaiko.stageSongSelect.r現在選択中のスコア.譜面情報.nレベル[diff]; i2++) { - OpenTaiko.Tx.SongSelect_Level?.t2D描画( - OpenTaiko.Skin.SongSelect_Level_X[displayingDiff] + (OpenTaiko.Skin.SongSelect_Level_Move[0] * i2), - OpenTaiko.Skin.SongSelect_Level_Y[displayingDiff] + (OpenTaiko.Skin.SongSelect_Level_Move[1] * i2), - new RectangleF(level_width * diff, 0, level_width, level_height)); - - } - } - } - - #endregion - - } - - } - - #endregion - } - break; - - case CSongListNode.ENodeType.BOX: { - #region [Box explanation] - - for (int j = 0; j < 3; j++) { - if (!ctBoxOpen.IsEnded && ctBoxOpen.CurrentValue != 0) { - if (txBoxText[j] != null) - this.txBoxText[j].Opacity = (int)(ctBoxOpen.CurrentValue >= 1200 && ctBoxOpen.CurrentValue <= 1620 ? 255 - (ctBoxOpen.CurrentValue - 1200) * 2.55f : - ctBoxOpen.CurrentValue >= 2000 ? (ctBoxOpen.CurrentValue - 2000) * 2.55f : ctBoxOpen.CurrentValue <= 1200 ? 255 : 0); - } else - if (txBoxText[j] != null) - this.txBoxText[j].Opacity = (int)(BarAnimeCount * 255.0f); - - if (this.txBoxText[j].szTextureSize.Width >= 510) - this.txBoxText[j].vcScaleRatio.X = 510f / this.txBoxText[j].szTextureSize.Width; - - this.txBoxText[j].t2D拡大率考慮中央基準描画(OpenTaiko.Skin.SongSelect_BoxExplanation_X, OpenTaiko.Skin.SongSelect_BoxExplanation_Y + j * OpenTaiko.Skin.SongSelect_BoxExplanation_Interval); - } - - #endregion - - #region [Box chara] - - var box_chara = HGenreBar.tGetGenreBar(rCurrentlySelectedSong.BoxChara, OpenTaiko.Tx.SongSelect_Box_Chara); - - // If BoxChara < 0, don't display any character - { - if (!ctBoxOpen.IsEnded) - box_chara.Opacity = (int)(ctBoxOpen.CurrentValue >= 1200 && ctBoxOpen.CurrentValue <= 1620 ? 255 - (ctBoxOpen.CurrentValue - 1200) * 2.55f : - ctBoxOpen.CurrentValue >= 2000 ? (ctBoxOpen.CurrentValue - 2000) * 2.55f : ctBoxOpen.CurrentValue <= 1200 ? 255 : 0); - else { - if (!OpenTaiko.stageSongSelect.actDifficultySelectionScreen.bIsDifficltSelect) - box_chara.Opacity = (int)(BarAnimeCount * 255.0f); - else if (ctDifficultyIn.CurrentValue >= 1000) - box_chara.Opacity = (int)255.0f - (ctDifficultyIn.CurrentValue - 1000); - } - - box_chara?.t2D中心基準描画(OpenTaiko.Skin.SongSelect_Box_Chara_X[0] - (BarAnimeCount * OpenTaiko.Skin.SongSelect_Box_Chara_Move), OpenTaiko.Skin.SongSelect_Box_Chara_Y[0], - new Rectangle(0, 0, box_chara.szTextureSize.Width / 2, - box_chara.szTextureSize.Height)); - - box_chara?.t2D中心基準描画(OpenTaiko.Skin.SongSelect_Box_Chara_X[1] + (BarAnimeCount * OpenTaiko.Skin.SongSelect_Box_Chara_Move), OpenTaiko.Skin.SongSelect_Box_Chara_Y[1], - new Rectangle(box_chara.szTextureSize.Width / 2, 0, - box_chara.szTextureSize.Width / 2, box_chara.szTextureSize.Height)); - } - - #endregion - } - break; - - case CSongListNode.ENodeType.BACKBOX: - //if (TJAPlayer3.Tx.SongSelect_Frame_BackBox != null) - // TJAPlayer3.Tx.SongSelect_Frame_BackBox.t2D描画(450, TJAPlayer3.Skin.SongSelect_Overall_Y); - break; - - case CSongListNode.ENodeType.RANDOM: - //if (TJAPlayer3.Tx.SongSelect_Frame_Random != null) - // TJAPlayer3.Tx.SongSelect_Frame_Random.t2D描画(450, TJAPlayer3.Skin.SongSelect_Overall_Y); - break; - } - - /*if (TJAPlayer3.Tx.SongSelect_Branch_Text != null - && TJAPlayer3.stage選曲.r現在選択中のスコア.譜面情報.b譜面分岐[TJAPlayer3.stage選曲.n現在選択中の曲の難易度]) - TJAPlayer3.Tx.SongSelect_Branch_Text.t2D描画(483, TJAPlayer3.Skin.SongSelect_Overall_Y + 21); - */ - } - - if (ctBoxOpen.CurrentValue >= 1620) { - if (bBoxOpen) { - this.tBOXに入る(); - bBoxOpen = false; - } - if (bBoxClose) { - this.tCloseBOX(); - OpenTaiko.stageSongSelect.bBGM再生済み = false; - /* - if (TJAPlayer3.ConfigIni.bBGM音を発声する || !TJAPlayer3.Skin.bgm選曲画面イン.b再生中) - TJAPlayer3.Skin.bgm選曲画面イン.t再生する(); - TJAPlayer3.stage選曲.bBGMIn再生した = true; - */ - CSongSelectSongManager.playSongIfPossible(); - bBoxClose = false; - } - } - - if (ctDifficultyIn.CurrentValue >= ctDifficultyIn.EndValue) { - ctDifficultyIn.Stop(); - } - - for (int i = 0; i < OpenTaiko.Skin.SongSelect_Bar_Count; i++) // パネルは全13枚。 - { - int index = i + nNowChange; - if (((index < 0 || index >= OpenTaiko.Skin.SongSelect_Bar_Count) && this.ctScrollCounter.CurrentValue != this.ctScrollCounter.EndValue)) - continue; - - int nパネル番号 = (((this.n現在の選択行 - barCenterNum) + i) + OpenTaiko.Skin.SongSelect_Bar_Count) % OpenTaiko.Skin.SongSelect_Bar_Count; - int n見た目の行番号 = i; - int n次のパネル番号 = ((i + nNowChange) % OpenTaiko.Skin.SongSelect_Bar_Count); - //int x = this.ptバーの基本座標[ n見た目の行番号 ].X + ( (int) ( ( this.ptバーの基本座標[ n次のパネル番号 ].X - this.ptバーの基本座標[ n見た目の行番号 ].X ) * ( ( (double) Math.Abs( this.n現在のスクロールカウンタ ) ) / 100.0 ) ) ); - int x = i選曲バーX座標; - int xAnime = OpenTaiko.Skin.SongSelect_Bar_X[n見た目の行番号] + ((int)((OpenTaiko.Skin.SongSelect_Bar_X[n次のパネル番号] - OpenTaiko.Skin.SongSelect_Bar_X[n見た目の行番号]) * - fNowScrollAnime)); - - int y = OpenTaiko.Skin.SongSelect_Bar_Y[n見た目の行番号] + ((int)((OpenTaiko.Skin.SongSelect_Bar_Y[n次のパネル番号] - OpenTaiko.Skin.SongSelect_Bar_Y[n見た目の行番号]) * - fNowScrollAnime)); - - if ((i == barCenterNum) && ctScrollCounter.CurrentValue == ctScrollCounter.EndValue) { - CTexture txSelectedSongSubtitle = null; - - // (A) スクロールが停止しているときの選択曲バーの描画。 - - var IsSongLocked = OpenTaiko.Databases.DBSongUnlockables.tIsSongLocked(rCurrentlySelectedSong); - var HiddenIndex = OpenTaiko.Databases.DBSongUnlockables.tGetSongHiddenIndex(rCurrentlySelectedSong); - - #region [ Nastiest Song Title display method I ever saw] - - // Fonts here - - //----------------- - if (rCurrentlySelectedSong.ldTitle.GetString("") != "" && this.ttkSelectedSongTitle == null) - this.ttkSelectedSongTitle = this.ttkGenerateSongNameTexture(rCurrentlySelectedSong.ldTitle.GetString(""), rCurrentlySelectedSong.ForeColor, rCurrentlySelectedSong.BackColor, rCurrentlySelectedSong.eノード種別 == CSongListNode.ENodeType.BOX ? this.pfBoxName : this.pfMusicName); - if (rCurrentlySelectedSong.ldSubtitle.GetString("") != "" && this.ttkSelectedSongSubtitle == null) - this.ttkSelectedSongSubtitle = this.ttkGenerateSubtitleTexture(rCurrentlySelectedSong.ldSubtitle.GetString(""), rCurrentlySelectedSong.ForeColor, rCurrentlySelectedSong.BackColor); - if (rCurrentlySelectedSong.strMaker != "" && this.ttkSelectedSongMaker == null) - this.ttkSelectedSongMaker = this.ttkGenerateMakerTexture(rCurrentlySelectedSong.strMaker, rCurrentlySelectedSong.ForeColor, rCurrentlySelectedSong.BackColor); - if (this.ttkSelectedSongBPM == null) - this.ttkSelectedSongBPM = this.ttkGenerateBPMTexture(rCurrentlySelectedSong, rCurrentlySelectedSong.ForeColor, rCurrentlySelectedSong.BackColor); ; - - - if (this.ttkSelectedSongSubtitle != null) - txSelectedSongSubtitle = TitleTextureKey.ResolveTitleTexture(ttkSelectedSongSubtitle, OpenTaiko.Skin.SongSelect_VerticalText); - - var _title = TitleTextureKey.ResolveTitleTexture(this.ttkSelectedSongTitle, OpenTaiko.Skin.SongSelect_VerticalText); - - if (HiddenIndex >= DBSongUnlockables.EHiddenIndex.BLURED && _title != null) { - _title.bUseNoiseEffect = true; - } - - //サブタイトルがあったら700 - - if (ttkSelectedSongTitle != null) { - if (!ctBoxOpen.IsEnded) - _title.Opacity = (int)(ctBoxOpen.CurrentValue >= 1200 && ctBoxOpen.CurrentValue <= 1620 ? 255 - (ctBoxOpen.CurrentValue - 1200) * 2.55f : - ctBoxOpen.CurrentValue >= 2000 ? (ctBoxOpen.CurrentValue - 2000) * 2.55f : ctBoxOpen.CurrentValue <= 1200 ? 255 : 0); - else { - if (!OpenTaiko.stageSongSelect.actDifficultySelectionScreen.bIsDifficltSelect) - _title.Opacity = 255; - else if (ctDifficultyIn.CurrentValue >= 1000) - _title.Opacity = (int)255.0f - (ctDifficultyIn.CurrentValue - 1000); - } - } - - if (this.ttkSelectedSongSubtitle != null) { - if (HiddenIndex >= DBSongUnlockables.EHiddenIndex.BLURED) { - txSelectedSongSubtitle.bUseNoiseEffect = true; - } - - if (!ctBoxOpen.IsEnded) - txSelectedSongSubtitle.Opacity = (int)(ctBoxOpen.CurrentValue >= 1200 && ctBoxOpen.CurrentValue <= 1620 ? 255 - (ctBoxOpen.CurrentValue - 1200) * 2.55f : - ctBoxOpen.CurrentValue >= 2000 ? (ctBoxOpen.CurrentValue - 2000) * 2.55f : ctBoxOpen.CurrentValue <= 1200 ? 255 : 0); - else { - if (!OpenTaiko.stageSongSelect.actDifficultySelectionScreen.bIsDifficltSelect) - txSelectedSongSubtitle.Opacity = (int)(BarAnimeCount * 255.0f); - else if (ctDifficultyIn.CurrentValue >= 1000) - txSelectedSongSubtitle.Opacity = (int)255.0f - (ctDifficultyIn.CurrentValue - 1000); - } - - txSelectedSongSubtitle.t2D拡大率考慮中央基準描画( - xAnime + OpenTaiko.Skin.SongSelect_Bar_SubTitle_Offset[0] + (rCurrentlySelectedSong.eノード種別 == CSongListNode.ENodeType.BOX ? centerMoveX : centerMoveX / 1.1f), - y + OpenTaiko.Skin.SongSelect_Bar_SubTitle_Offset[1] - (rCurrentlySelectedSong.eノード種別 == CSongListNode.ENodeType.BOX ? centerMove : centerMove / 1.1f)); - - if (HiddenIndex >= DBSongUnlockables.EHiddenIndex.BLURED) { - txSelectedSongSubtitle.bUseNoiseEffect = false; - } - - if (this.ttkSelectedSongTitle != null) { - _title.t2D拡大率考慮中央基準描画( - xAnime + GetTitleOffsetX(rCurrentlySelectedSong.eノード種別) + - (rCurrentlySelectedSong.eノード種別 != CSongListNode.ENodeType.BACKBOX ? (rCurrentlySelectedSong.eノード種別 == CSongListNode.ENodeType.BOX ? centerMoveX : centerMoveX / 1.1f) : 0), - - y + GetTitleOffsetY(rCurrentlySelectedSong.eノード種別) - - (rCurrentlySelectedSong.eノード種別 != CSongListNode.ENodeType.BACKBOX ? (rCurrentlySelectedSong.eノード種別 == CSongListNode.ENodeType.BOX ? centerMove : centerMove / 1.1f) : 0)); - } - } else { - if (this.ttkSelectedSongTitle != null) { - _title.t2D拡大率考慮中央基準描画( - xAnime + GetTitleOffsetX(this.stバー情報[nパネル番号].eバー種別) + - (rCurrentlySelectedSong.eノード種別 != CSongListNode.ENodeType.BACKBOX ? (rCurrentlySelectedSong.eノード種別 == CSongListNode.ENodeType.BOX ? centerMoveX : centerMoveX / 1.1f) : 0), - - y + GetTitleOffsetY(this.stバー情報[nパネル番号].eバー種別) - - (rCurrentlySelectedSong.eノード種別 != CSongListNode.ENodeType.BACKBOX ? (rCurrentlySelectedSong.eノード種別 == CSongListNode.ENodeType.BOX ? centerMove : centerMove / 1.1f) : 0)); - } - } - - if (HiddenIndex >= DBSongUnlockables.EHiddenIndex.BLURED && _title != null) { - _title.bUseNoiseEffect = false; - } - //----------------- - #endregion - - - - if (HiddenIndex >= DBSongUnlockables.EHiddenIndex.GRAYED) { - DrawBarCenter(OpenTaiko.Tx.SongSelect_Bar_Genre_Locked_Top, OpenTaiko.Skin.SongSelect_Bar_X[barCenterNum], OpenTaiko.Skin.SongSelect_Bar_Y[barCenterNum], centerMoveX, centerMove, false, false, false); - //TJAPlayer3.Tx.SongSelect_Bar_Genre_Locked_Top?.t2D描画(); - } - } - } - //----------------- - - //TJAPlayer3.act文字コンソール.tPrint(0, 12, C文字コンソール.Eフォント種別.白, CSongDict.tGetNodesCount().ToString()); - return 0; } - public void tMenuContextView(eMenuContext emc) { - // Context vars : - // 0 - Selected difficulty - // 1 - Selected star rating - // 2 - Current menu (0 : select difficulty, 1 : select star rating) - if (emc == eMenuContext.SearchByDifficulty) { - OpenTaiko.Tx.SongSelect_Search_Window?.t2D描画(0, 0); + // 本ステージは、(1)登場アニメフェーズ → (2)通常フェーズ と二段階にわけて進む。 - int tileSize = 0; - if (OpenTaiko.Tx.Dani_Difficulty_Cymbol != null) { - tileSize = OpenTaiko.Tx.Dani_Difficulty_Cymbol.szTextureSize.Height; - OpenTaiko.Tx.Dani_Difficulty_Cymbol.t2D中心基準描画(OpenTaiko.Skin.SongSelect_Search_Bar_X[0], OpenTaiko.Skin.SongSelect_Search_Bar_Y[0], - new Rectangle(tileSize * _contextVars[0], - 0, - (_contextVars[0] == (int)Difficulty.Oni ? 2 : 1) * tileSize, - tileSize)); - } + #region [Box text] + string _append = ""; + if (HSongTraverse.IsRegularFolder(rCurrentlySelectedSong)) { + int countTotalSongs = HSongTraverse.GetSongsMatchingCondition(rCurrentlySelectedSong, (_) => true); + int countUnlockedSongs = HSongTraverse.GetSongsMatchingCondition(rCurrentlySelectedSong, (song) => !OpenTaiko.Databases.DBSongUnlockables.tIsSongLocked(song)); + _append = " ({0}/{1})".SafeFormat(countUnlockedSongs, countTotalSongs); + } - if (_contextVars[2] == 0) { - OpenTaiko.Tx.SongSelect_Search_Arrow_Glow?.t2D中心基準描画(OpenTaiko.Skin.SongSelect_Search_Bar_X[0], OpenTaiko.Skin.SongSelect_Search_Bar_Y[0]); - } else if (_contextVars[2] == 1) { - OpenTaiko.Tx.SongSelect_Search_Arrow?.t2D中心基準描画(OpenTaiko.Skin.SongSelect_Search_Bar_X[0], OpenTaiko.Skin.SongSelect_Search_Bar_Y[0]); - OpenTaiko.Tx.SongSelect_Search_Arrow_Glow?.t2D中心基準描画(OpenTaiko.Skin.SongSelect_Search_Bar_X[1], OpenTaiko.Skin.SongSelect_Search_Bar_Y[1]); + string[] boxText = new string[3] + { + rCurrentlySelectedSong.strBoxText[0].GetString(""), + rCurrentlySelectedSong.strBoxText[1].GetString(""), + rCurrentlySelectedSong.strBoxText[2].GetString("") + _append + }; - if (OpenTaiko.Tx.SongSelect_Level_Icons != null) { - tileSize = OpenTaiko.Tx.SongSelect_Level_Icons.szTextureSize.Height; - OpenTaiko.Tx.SongSelect_Level_Icons.t2D中心基準描画(OpenTaiko.Skin.SongSelect_Search_Bar_X[1], OpenTaiko.Skin.SongSelect_Search_Bar_Y[1], - new Rectangle(tileSize * _contextVars[1], - 0, - tileSize, - tileSize)); - } - - } - } - // Context vars : - // 0~4 - Selected difficulty (1~5P) - // 5 - Current menu (0~4 for each player) - else if (emc == eMenuContext.Random) { - // To change with a new texture - OpenTaiko.Tx.SongSelect_Search_Window?.t2D描画(0, 0); - - for (int i = 0; i <= _contextVars[5]; i++) { - if (OpenTaiko.Tx.Dani_Difficulty_Cymbol != null) { - var tileSize = OpenTaiko.Tx.Dani_Difficulty_Cymbol.szTextureSize.Height; - OpenTaiko.Tx.Dani_Difficulty_Cymbol.t2D中心基準描画(OpenTaiko.Skin.SongSelect_Search_Bar_X[i], OpenTaiko.Skin.SongSelect_Search_Bar_Y[i], - new Rectangle(tileSize * _contextVars[i], - 0, - (_contextVars[i] == (int)Difficulty.Oni ? 2 : 1) * tileSize, - tileSize)); - - } - - if (i < _contextVars[5]) - OpenTaiko.Tx.SongSelect_Search_Arrow?.t2D中心基準描画(OpenTaiko.Skin.SongSelect_Search_Bar_X[i], OpenTaiko.Skin.SongSelect_Search_Bar_Y[i]); - else if (i == _contextVars[5]) - OpenTaiko.Tx.SongSelect_Search_Arrow_Glow?.t2D中心基準描画(OpenTaiko.Skin.SongSelect_Search_Bar_X[i], OpenTaiko.Skin.SongSelect_Search_Bar_Y[i]); + if (strBoxText != boxText[0] + boxText[1] + boxText[2]) { + for (int i = 0; i < 3; i++) { + using (var texture = pfBoxText.DrawText(boxText[i], rCurrentlySelectedSong.ForeColor, rCurrentlySelectedSong.BackColor, null, 26)) { + this.txBoxText[i] = OpenTaiko.tテクスチャの生成(texture); + this.strBoxText = boxText[0] + boxText[1] + boxText[2]; } } } - public bool tMenuContextController(eMenuContext emc) { - tMenuContextView(emc); + #endregion - #region [Inputs] + this.ctScrollCounter.Tick(); - #region [Decide] + // 進行。 + if (this.ctScrollCounter.CurrentValue == this.ctScrollCounter.EndValue) ct三角矢印アニメ.TickLoop(); + else ct三角矢印アニメ.CurrentValue = 0; - if ((OpenTaiko.Pad.bPressedDGB(EPad.Decide)) || - ((OpenTaiko.ConfigIni.bEnterIsNotUsedInKeyAssignments && OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Return)))) { - if (emc == eMenuContext.SearchByDifficulty) { - OpenTaiko.Skin.soundDecideSFX.tPlay(); - _contextVars[2]++; - if (_contextVars[2] >= 2) { - //tMenuContextDisable(); - return true; - } else if (_contextVars[2] == 1) { - // Set default level for each difficulty - switch (_contextVars[0]) { - case (int)Difficulty.Easy: - _contextVars[1] = 1; - break; - case (int)Difficulty.Normal: - _contextVars[1] = 3; - break; - case (int)Difficulty.Hard: - _contextVars[1] = 6; - break; - default: - _contextVars[1] = 8; - break; + int i選曲バーX座標 = 673; //選曲バーの座標用 + int i選択曲バーX座標 = 665; //選択曲バーの座標用 + + int barCenterNum = (OpenTaiko.Skin.SongSelect_Bar_Count - 1) / 2; + + if (this.ctScrollCounter.CurrentValue == this.ctScrollCounter.EndValue) { + nNowChange = 0; + } + + #region [ (2) 通常フェーズの描画。] + //----------------- + for (int i = 0; i < OpenTaiko.Skin.SongSelect_Bar_Count; i++) // パネルは全13枚。 + { + int index = i + nNowChange; + if (((index < 0 || index >= OpenTaiko.Skin.SongSelect_Bar_Count) && this.ctScrollCounter.CurrentValue != this.ctScrollCounter.EndValue)) + continue; + + int nパネル番号 = (((this.n現在の選択行 - barCenterNum) + i) + OpenTaiko.Skin.SongSelect_Bar_Count) % OpenTaiko.Skin.SongSelect_Bar_Count; + int n見た目の行番号 = i; + int n次のパネル番号 = (index % OpenTaiko.Skin.SongSelect_Bar_Count); + int x = i選曲バーX座標; + + #region [Positions and layouts] + + int xZahyou = OpenTaiko.Skin.SongSelect_Bar_X[n見た目の行番号]; + int xNextZahyou = OpenTaiko.Skin.SongSelect_Bar_X[n次のパネル番号]; + int xCentralZahyou = OpenTaiko.Skin.SongSelect_Bar_X[barCenterNum]; + + int yZahyou = OpenTaiko.Skin.SongSelect_Bar_Y[n見た目の行番号]; + int yNextZahyou = OpenTaiko.Skin.SongSelect_Bar_Y[n次のパネル番号]; + int yCentralZahyou = OpenTaiko.Skin.SongSelect_Bar_Y[barCenterNum]; + + int Diff4 = Math.Abs(n見た目の行番号 - barCenterNum); + int NextDiff4 = Math.Abs(n次のパネル番号 - barCenterNum); + + /* + eLayoutType eLayout = (eLayoutType)TJAPlayer3.ConfigIni.nLayoutType; + + switch (eLayout) + { + case eLayoutType.DiagonalDownUp: + xZahyou = xCentralZahyou - 2 * (xZahyou - xCentralZahyou); + xNextZahyou = xCentralZahyou - 2 * (xNextZahyou - xCentralZahyou); + break; + case eLayoutType.Vertical: + xZahyou = xCentralZahyou; + xNextZahyou = xCentralZahyou; + break; + case eLayoutType.HalfCircleRight: + xZahyou = xCentralZahyou - 25 * (int)Math.Pow(Diff4, 2); + xNextZahyou = xCentralZahyou - 25 * (int)Math.Pow(NextDiff4, 2); + break; + case eLayoutType.HalfCircleLeft: + xZahyou = xCentralZahyou + 25 * (int)Math.Pow(Diff4, 2); + xNextZahyou = xCentralZahyou + 25 * (int)Math.Pow(NextDiff4, 2); + break; + default: + break; + } + */ + + #endregion + + // x set here + int xAnime = xZahyou + (int)((xNextZahyou - xZahyou) + * (1.0 - fNowScrollAnime)); + + int y = yZahyou + (int)((yNextZahyou - yZahyou) + * (1.0 - fNowScrollAnime)); + + // (B) スクロール中の選択曲バー、またはその他のバーの描画。 + + float Box = 0; + float Box_X = 0; + float Box_Y = 0; + int _center = (OpenTaiko.Skin.SongSelect_Bar_Count - 1) / 2; + float[] _boxAim = new float[2] + { + OpenTaiko.Skin.SongSelect_Bar_Anim_X[i], + OpenTaiko.Skin.SongSelect_Bar_Anim_Y[i] + }; + + int _movfs = i - 1; + int _maxfs = _center - 1; + int _gap = Math.Max(1, OpenTaiko.Skin.SongSelect_Bar_Count - 3); + + #region [ BoxOpenAnime ] + + if (i != _center && i != 0 && i < OpenTaiko.Skin.SongSelect_Bar_Count - 1) { + if (ctBoxOpen.CurrentValue >= 1000 && ctBoxOpen.CurrentValue <= 1560) { + float _curve = 1000 + (150 / _gap) * (_maxfs - _movfs);//Math.Abs(150 / (_center - i)); + Box_X = _boxAim[0] - (float)Math.Sin(((ctBoxOpen.CurrentValue - _curve) / 4 + 90) * (Math.PI / 180)) * _boxAim[0]; + Box_Y = _boxAim[1] - (float)Math.Sin(((ctBoxOpen.CurrentValue - _curve) / 4 + 90) * (Math.PI / 180)) * _boxAim[1]; + } + if (ctBoxOpen.CurrentValue > 1300 && ctBoxOpen.CurrentValue < 1940) { + ctBoxOpen.ChangeInterval(0.65); + Box_X = _boxAim[0]; + Box_Y = _boxAim[1]; + } + + if (ctBoxOpen.CurrentValue >= 1840 && ctBoxOpen.CurrentValue <= 2300) { + ctBoxOpen.ChangeInterval(1.3); + float _curve = 1940 - (100 / _gap) * (_maxfs - _movfs);// Math.Abs(100 / (_center - i)); + Box_X = _boxAim[0] - (float)Math.Sin(((ctBoxOpen.CurrentValue - _curve) / 4) * (Math.PI / 180)) * _boxAim[0]; + Box_Y = _boxAim[1] - (float)Math.Sin(((ctBoxOpen.CurrentValue - _curve) / 4) * (Math.PI / 180)) * _boxAim[1]; + } + + } + + #region [old] + + /* + if (ctBoxOpen.n現在の値 <= 560 + 1000) + { + if (i == 1) + { + if (ctBoxOpen.n現在の値 >= 1000 && ctBoxOpen.n現在の値 <= 360 + 1000) + Box = 400.0f - (float)Math.Sin(((ctBoxOpen.n現在の値 - 1000) / 4 + 90) * (Math.PI / 180)) * 400.0f; + if (ctBoxOpen.n現在の値 >= 360 + 1000) + Box = 400.0f; + } + if (i == 2) + { + if (ctBoxOpen.n現在の値 >= 75 + 1000 && ctBoxOpen.n現在の値 <= 435 + 1000) + Box = 500.0f - (float)Math.Sin(((ctBoxOpen.n現在の値 - 1075) / 4 + 90) * (Math.PI / 180)) * 500.0f; + if (ctBoxOpen.n現在の値 >= 435 + 1000) + Box = 500.0f; + } + if (i == 3) + { + if (ctBoxOpen.n現在の値 >= 150 + 1000 && ctBoxOpen.n現在の値 <= 510 + 1000) + Box = 600.0f - (float)Math.Sin(((ctBoxOpen.n現在の値 - 1150) / 4 + 90) * (Math.PI / 180)) * 600.0f; + if (ctBoxOpen.n現在の値 >= 510 + 1000) + Box = 600.0f; + } + if (i == 5) + { + if (ctBoxOpen.n現在の値 >= 150 + 1000 && ctBoxOpen.n現在の値 <= 510 + 1000) + Box = -600.0f + (float)Math.Sin(((ctBoxOpen.n現在の値 - 1150) / 4 + 90) * (Math.PI / 180)) * 600.0f; + if (ctBoxOpen.n現在の値 >= 510 + 1000) + Box = 600.0f; + } + if (i == 6) + { + if (ctBoxOpen.n現在の値 >= 75 + 1000 && ctBoxOpen.n現在の値 <= 435 + 1000) + Box = -500.0f + (float)Math.Sin(((ctBoxOpen.n現在の値 - 1075) / 4 + 90) * (Math.PI / 180)) * 500.0f; + if (ctBoxOpen.n現在の値 >= 435 + 1000) + Box = 500.0f; + } + if (i == 7) + { + if (ctBoxOpen.n現在の値 >= 1000 && ctBoxOpen.n現在の値 <= 360 + 1000) + Box = -400.0f + (float)Math.Sin(((ctBoxOpen.n現在の値 - 1000) / 4 + 90) * (Math.PI / 180)) * 400.0f; + if (ctBoxOpen.n現在の値 >= 360 + 1000) + Box = 400.0f; + } + } + + if (ctBoxOpen.n現在の値 > 1300 && ctBoxOpen.n現在の値 < 1940) + { + ctBoxOpen.t間隔値変更(0.65); + if (i == 1) + Box = 600.0f; + if (i == 2) + Box = 600.0f; + if (i == 3) + Box = 600.0f; + if (i == 5) + Box = -600.0f; + if (i == 6) + Box = -600.0f; + if (i == 7) + Box = -600.0f; + } + + if (ctBoxOpen.n現在の値 >= 1840 && ctBoxOpen.n現在の値 <= 560 + 1840) + { + ctBoxOpen.t間隔値変更(1.3); + if (i == 1) + { + if (ctBoxOpen.n現在の値 >= 100 + 1840 && ctBoxOpen.n現在の値 <= 460 + 1840) + Box = 600.0f - (float)Math.Sin(((ctBoxOpen.n現在の値 - 1940) / 4) * (Math.PI / 180)) * 600.0f; + if (ctBoxOpen.n現在の値 < 100 + 1840) + Box = 600.0f; + } + if (i == 2) + { + if (ctBoxOpen.n現在の値 >= 50 + 1840 && ctBoxOpen.n現在の値 <= 410 + 1840) + Box = 500.0f - (float)Math.Sin(((ctBoxOpen.n現在の値 - 1890) / 4) * (Math.PI / 180)) * 500.0f; + if (ctBoxOpen.n現在の値 < 50 + 1840) + Box = 600.0f; + } + if (i == 3) + { + if (ctBoxOpen.n現在の値 >= 1840 && ctBoxOpen.n現在の値 <= 360 + 1840) + Box = 400.0f - (float)Math.Sin(((ctBoxOpen.n現在の値 - 1840) / 4) * (Math.PI / 180)) * 400.0f; + if (ctBoxOpen.n現在の値 < 1840) + Box = 600.0f; + } + if (i == 5) + { + if (ctBoxOpen.n現在の値 >= 1840 && ctBoxOpen.n現在の値 <= 360 + 1840) + Box = -400.0f + (float)Math.Sin(((ctBoxOpen.n現在の値 - 1840) / 4) * (Math.PI / 180)) * 400.0f; + if (ctBoxOpen.n現在の値 < 1840) + Box = -600.0f; + } + if (i == 6) + { + if (ctBoxOpen.n現在の値 >= 50 + 1840 && ctBoxOpen.n現在の値 <= 410 + 1840) + Box = -500.0f + (float)Math.Sin(((ctBoxOpen.n現在の値 - 1890) / 4) * (Math.PI / 180)) * 500.0f; + if (ctBoxOpen.n現在の値 < 50 + 1840) + Box = -600.0f; + } + if (i == 7) + { + if (ctBoxOpen.n現在の値 >= 100 + 1840 && ctBoxOpen.n現在の値 <= 460 + 1840) + Box = -600.0f + (float)Math.Sin(((ctBoxOpen.n現在の値 - 1940) / 4) * (Math.PI / 180)) * 600.0f; + if (ctBoxOpen.n現在の値 < 100 + 1840) + Box = -600.0f; + } + } + */ + + #endregion + + #endregion + + + #region [ バーテクスチャを描画。] + //----------------- + + // int boxType = nStrジャンルtoNum(stバー情報[nパネル番号].strジャンル); + string boxType = stバー情報[nパネル番号].BoxType; + var bar_genre = HGenreBar.tGetGenreBar(boxType, OpenTaiko.Tx.SongSelect_Bar_Genre); + var bar_genre_overlap = HGenreBar.tGetGenreBar(boxType, OpenTaiko.Tx.SongSelect_Bar_Genre_Overlap); + + bar_genre.color4 = CConversion.ColorToColor4(stバー情報[nパネル番号].BoxColor); + + bar_genre.vcScaleRatio.X = 1.0f; + if (bar_genre_overlap != null) + bar_genre_overlap.vcScaleRatio.X = 1.0f; + + OpenTaiko.Tx.SongSelect_Bar_Genre_Overlay.vcScaleRatio.X = 1.0f; + OpenTaiko.Tx.SongSelect_Bar_Genre_Back.vcScaleRatio.X = 1.0f; + OpenTaiko.Tx.SongSelect_Bar_Genre_Random.vcScaleRatio.X = 1.0f; + + + + if (ctScrollCounter.CurrentValue != ctScrollCounter.EndValue || n見た目の行番号 != barCenterNum) { + int songType = 0; + if (this.stバー情報[nパネル番号].ar難易度[(int)Difficulty.Dan] >= 0) + songType = 1; + else if (this.stバー情報[nパネル番号].ar難易度[(int)Difficulty.Tower] >= 0) + songType = 2; + + // TJAPlayer3.act文字コンソール.tPrint(x + -470, y + 30, C文字コンソール.Eフォント種別.白, (this.stバー情報[nパネル番号].ar難易度[(int)Difficulty.Tower]).ToString()); + + + // Very disgusting, to improve and unbloat asap + this.tジャンル別選択されていない曲バーの描画( + xAnime - (int)Box_X,//Box, + y - ((int)Box_Y),//Box * 3), + this.stバー情報[nパネル番号].strジャンル, + stバー情報[nパネル番号].eバー種別, + stバー情報[nパネル番号].nクリア, + stバー情報[nパネル番号].nスコアランク, + boxType, + songType, + stバー情報[nパネル番号].csu, + stバー情報[nパネル番号].reference); + } + + /* + + else if (n見た目の行番号 != 4) + this.tジャンル別選択されていない曲バーの描画(xAnime - (int)Box, y - ((int)Box * 3), this.stバー情報[nパネル番号].strジャンル, stバー情報[nパネル番号].eバー種別, stバー情報[nパネル番号].nクリア, stバー情報[nパネル番号].nスコアランク, boxType); + + */ + + //----------------- + #endregion + + var IsSongLocked = OpenTaiko.Databases.DBSongUnlockables.tIsSongLocked(stバー情報[nパネル番号].reference); + var HiddenIndex = OpenTaiko.Databases.DBSongUnlockables.tGetSongHiddenIndex(stバー情報[nパネル番号].reference); + + var _title = TitleTextureKey.ResolveTitleTexture(this.stバー情報[nパネル番号].ttkタイトル, OpenTaiko.Skin.SongSelect_VerticalText); + if (HiddenIndex >= DBSongUnlockables.EHiddenIndex.BLURED) { + _title.bUseNoiseEffect = true; + } + + #region [ タイトル名テクスチャを描画。] + if (ctDifficultyIn.CurrentValue >= 1000 && OpenTaiko.stageSongSelect.actDifficultySelectionScreen.bIsDifficltSelect) + _title.Opacity = (int)255.0f - (ctDifficultyIn.CurrentValue - 1000); + else + _title.Opacity = 255; + + if (ctScrollCounter.CurrentValue != ctScrollCounter.EndValue) + _title.t2D拡大率考慮中央基準描画( + xAnime - Box_X + GetTitleOffsetX(this.stバー情報[nパネル番号].eバー種別), y - Box_Y + GetTitleOffsetY(this.stバー情報[nパネル番号].eバー種別)); + else if (n見た目の行番号 != barCenterNum) + _title.t2D拡大率考慮中央基準描画( + xAnime - Box_X + GetTitleOffsetX(this.stバー情報[nパネル番号].eバー種別), y - Box_Y + GetTitleOffsetY(this.stバー情報[nパネル番号].eバー種別)); + #endregion + + if (HiddenIndex >= DBSongUnlockables.EHiddenIndex.BLURED) { + _title.bUseNoiseEffect = false; + } + + if (HiddenIndex >= DBSongUnlockables.EHiddenIndex.GRAYED) { + OpenTaiko.Tx.SongSelect_Bar_Genre_Locked_Top?.t2D描画(xAnime - (int)Box_X, y - ((int)Box_Y)); + } + + + //----------------- + } + #endregion + + + if (OpenTaiko.Skin.SongSelect_Bar_Select_Skip_Fade || + this.ctScrollCounter.CurrentValue == this.ctScrollCounter.EndValue) { + #region [ Bar_Select ] + + int barSelect_width = OpenTaiko.Tx.SongSelect_Bar_Select.sz画像サイズ.Width; + int barSelect_height = OpenTaiko.Tx.SongSelect_Bar_Select.sz画像サイズ.Height / 2; + + if (ctBarFlash.IsEnded && !OpenTaiko.stageSongSelect.actDifficultySelectionScreen.bIsDifficltSelect) { + OpenTaiko.Tx.SongSelect_Bar_Select.Opacity = (int)(BarAnimeCount * 255.0f); + if (OpenTaiko.Skin.SongSelect_Bar_Select_Skip_Fade) + OpenTaiko.Tx.SongSelect_Bar_Select.Opacity = 255; + + } else + OpenTaiko.Tx.SongSelect_Bar_Select.Opacity = (int)(255 - (ctBarFlash.CurrentValue - 700) * 2.55f); + + OpenTaiko.Tx.SongSelect_Bar_Select.t2D描画(OpenTaiko.Skin.SongSelect_Bar_Select[0], OpenTaiko.Skin.SongSelect_Bar_Select[1], new Rectangle(0, 0, barSelect_width, barSelect_height)); + + #region [ BarFlash ] + + if (ctBarFlash.CurrentValue <= 100) + OpenTaiko.Tx.SongSelect_Bar_Select.Opacity = (int)(ctBarFlash.CurrentValue * 2.55f); + else if (ctBarFlash.CurrentValue <= 200) + OpenTaiko.Tx.SongSelect_Bar_Select.Opacity = (int)(255 - (ctBarFlash.CurrentValue - 100) * 2.55f); + else if (ctBarFlash.CurrentValue <= 300) + OpenTaiko.Tx.SongSelect_Bar_Select.Opacity = (int)((ctBarFlash.CurrentValue - 200) * 2.55f); + else if (ctBarFlash.CurrentValue <= 400) + OpenTaiko.Tx.SongSelect_Bar_Select.Opacity = (int)(255 - (ctBarFlash.CurrentValue - 300) * 2.55f); + else if (ctBarFlash.CurrentValue <= 500) + OpenTaiko.Tx.SongSelect_Bar_Select.Opacity = (int)((ctBarFlash.CurrentValue - 400) * 2.55f); + else if (ctBarFlash.CurrentValue <= 600) + OpenTaiko.Tx.SongSelect_Bar_Select.Opacity = (int)(255 - (ctBarFlash.CurrentValue - 500) * 2.55f); + else if (ctBarFlash.CurrentValue <= 700) + OpenTaiko.Tx.SongSelect_Bar_Select.Opacity = (int)((ctBarFlash.CurrentValue - 600) * 2.55f); + else if (ctBarFlash.CurrentValue <= 800) + OpenTaiko.Tx.SongSelect_Bar_Select.Opacity = (int)(255 - (ctBarFlash.CurrentValue - 700) * 2.55f); + else + OpenTaiko.Tx.SongSelect_Bar_Select.Opacity = 0; + + OpenTaiko.Tx.SongSelect_Bar_Select.t2D描画(OpenTaiko.Skin.SongSelect_Bar_Select[0], OpenTaiko.Skin.SongSelect_Bar_Select[1], new Rectangle(0, barSelect_height, barSelect_width, barSelect_height)); + + #endregion + + #endregion + } + + + if (this.ctScrollCounter.CurrentValue == this.ctScrollCounter.EndValue) { + #region [ Draw BarCenter ] + + + + if (rCurrentlySelectedSong.eノード種別 == CSongListNode.ENodeType.SCORE) { + #region [ Score ] + + var IsSongLocked = OpenTaiko.Databases.DBSongUnlockables.tIsSongLocked(rCurrentlySelectedSong); + var HiddenIndex = OpenTaiko.Databases.DBSongUnlockables.tGetSongHiddenIndex(rCurrentlySelectedSong); + + #region [ Bar ] + + if (HiddenIndex >= DBSongUnlockables.EHiddenIndex.GRAYED) { + DrawBarCenter(OpenTaiko.Tx.SongSelect_Bar_Genre_Locked, OpenTaiko.Skin.SongSelect_Bar_X[barCenterNum], OpenTaiko.Skin.SongSelect_Bar_Y[barCenterNum], centerMoveX, centerMove, false, false, false); + } else { + var bar_genre = HGenreBar.tGetGenreBar(rCurrentlySelectedSong.BoxType, OpenTaiko.Tx.SongSelect_Bar_Genre); + var bar_genre_overlap = HGenreBar.tGetGenreBar(rCurrentlySelectedSong.BoxType, OpenTaiko.Tx.SongSelect_Bar_Genre_Overlap); + + DrawBarCenter(bar_genre, OpenTaiko.Skin.SongSelect_Bar_X[barCenterNum], OpenTaiko.Skin.SongSelect_Bar_Y[barCenterNum], centerMoveX, centerMove, true, false, false); + DrawBarCenter(bar_genre_overlap, OpenTaiko.Skin.SongSelect_Bar_X[barCenterNum], OpenTaiko.Skin.SongSelect_Bar_Y[barCenterNum], centerMoveX, centerMove, false, true, true); + + #region [ Crown and ScoreRank ] + + // Mark + + if (this.rCurrentlySelectedSong.arスコア[(int)Difficulty.Dan] != null) { + //int[] clear = this.r現在選択中の曲.arスコア[(int)Difficulty.Dan].譜面情報.nクリア; + + for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { + if (i >= 2) continue; + + int ap = OpenTaiko.GetActualPlayer(i); + + var TableEntry = OpenTaiko.SaveFileInstances[ap].data.tGetSongSelectTableEntry(rCurrentlySelectedSong.tGetUniqueId()); + + int[] clear = TableEntry.ClearStatuses; + + int currentRank = Math.Min(clear[(int)Difficulty.Dan], 8) - 3; + + int x = OpenTaiko.Skin.SongSelect_Bar_X[barCenterNum] + OpenTaiko.Skin.SongSelect_DanStatus_Offset_X[i]; + int y = OpenTaiko.Skin.SongSelect_Bar_Y[barCenterNum] + OpenTaiko.Skin.SongSelect_DanStatus_Offset_Y[i]; + + displayDanStatus((int)(x - centerMoveX / 1.1f), (int)(y - centerMove / 1.1f), currentRank, 0.2f); + } + + } else if (this.rCurrentlySelectedSong.arスコア[(int)Difficulty.Tower] != null) { + //int[] clear = this.r現在選択中の曲.arスコア[(int)Difficulty.Tower].譜面情報.nクリア; + + for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { + if (i >= 2) continue; + + int ap = OpenTaiko.GetActualPlayer(i); + var TableEntry = OpenTaiko.SaveFileInstances[ap].data.tGetSongSelectTableEntry(rCurrentlySelectedSong.tGetUniqueId()); + + int[] clear = TableEntry.ClearStatuses; + + int currentRank = Math.Min(clear[(int)Difficulty.Tower], 8) - 2; + + int x = OpenTaiko.Skin.SongSelect_Bar_X[barCenterNum] + OpenTaiko.Skin.SongSelect_TowerStatus_Offset_X[i]; + int y = OpenTaiko.Skin.SongSelect_Bar_Y[barCenterNum] + OpenTaiko.Skin.SongSelect_TowerStatus_Offset_Y[i]; + + displayTowerStatus((int)(x - centerMoveX / 1.1f), (int)(y - centerMove / 1.1f), currentRank, 0.3f); + } + } else if (this.rCurrentlySelectedSong.arスコア[3] != null || this.rCurrentlySelectedSong.arスコア[4] != null) { + //var sr = this.rCurrentlySelectedSong.arスコア[n現在のアンカ難易度レベルに最も近い難易度レベルを返す(this.rCurrentlySelectedSong)]; + + for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { + if (i >= 2) continue; + + int ap = OpenTaiko.GetActualPlayer(i); + var TableEntry = OpenTaiko.SaveFileInstances[ap].data.tGetSongSelectTableEntry(OpenTaiko.stageSongSelect.rNowSelectedSong.tGetUniqueId()); + + int[] クリア = TableEntry.ClearStatuses; + + int[] スコアランク = TableEntry.ScoreRanks; + + int x = OpenTaiko.Skin.SongSelect_Bar_X[barCenterNum] + OpenTaiko.Skin.SongSelect_RegularCrowns_Offset_X[i]; + int y = OpenTaiko.Skin.SongSelect_Bar_Y[barCenterNum] + OpenTaiko.Skin.SongSelect_RegularCrowns_Offset_Y[i]; + + displayRegularCrowns((int)(x - centerMoveX / 1.1f), (int)(y - centerMove / 1.1f), クリア, スコアランク, 0.8f + BarAnimeCount / 620f); + } } - } else if (emc == eMenuContext.Random) { - OpenTaiko.Skin.soundDecideSFX.tPlay(); - _contextVars[5]++; - if (_contextVars[5] >= OpenTaiko.ConfigIni.nPlayerCount) - return true; - if (_contextVars[5] >= 1 && OpenTaiko.ConfigIni.bAIBattleMode) { - _contextVars[1] = _contextVars[0]; - return true; + #endregion + + #region [Favorite status and Locked icon] + + if (IsSongLocked) { + displayVisibleLockStatus( + (int)(OpenTaiko.Skin.SongSelect_Bar_X[barCenterNum] + OpenTaiko.Skin.SongSelect_FavoriteStatus_Offset[0] - centerMoveX / 1.1f), + (int)(OpenTaiko.Skin.SongSelect_Bar_Y[barCenterNum] + OpenTaiko.Skin.SongSelect_FavoriteStatus_Offset[1] - centerMove / 1.1f), 1f); + } else { + displayFavoriteStatus( + (int)(OpenTaiko.Skin.SongSelect_Bar_X[barCenterNum] + OpenTaiko.Skin.SongSelect_FavoriteStatus_Offset[0] - centerMoveX / 1.1f), + (int)(OpenTaiko.Skin.SongSelect_Bar_Y[barCenterNum] + OpenTaiko.Skin.SongSelect_FavoriteStatus_Offset[1] - centerMove / 1.1f), this.rCurrentlySelectedSong.uniqueId, 1f + BarAnimeCount / 620f); } - _contextVars[_contextVars[5]] = Math.Min((int)Difficulty.Oni, OpenTaiko.ConfigIni.nDefaultCourse); + #endregion + + #region [Level number big] + + tPrintLevelNumberBig( + (int)(OpenTaiko.Skin.SongSelect_Bar_X[barCenterNum] + OpenTaiko.Skin.SongSelect_Level_Offset[0] - centerMoveX / 1.1f), + (int)(OpenTaiko.Skin.SongSelect_Bar_Y[barCenterNum] + OpenTaiko.Skin.SongSelect_Level_Offset[1] - centerMove / 1.1f), + this.rCurrentlySelectedSong + ); + + #endregion } - } - - #endregion - - #region [Left] - - else if (OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.LeftChange) - || OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.LeftArrow)) { - if (emc == eMenuContext.SearchByDifficulty) { - OpenTaiko.Skin.soundChangeSFX.tPlay(); - - _contextVars[_contextVars[2]]--; - // Clamp values - _contextVars[0] = Math.Max(0, Math.Min((int)Difficulty.Oni, _contextVars[0])); - _contextVars[1] = Math.Max(1, Math.Min(13, _contextVars[1])); - } else if (emc == eMenuContext.Random) { - OpenTaiko.Skin.soundChangeSFX.tPlay(); - - _contextVars[_contextVars[5]]--; - // Clamp values - _contextVars[_contextVars[5]] = Math.Max(0, Math.Min((int)Difficulty.Oni, _contextVars[_contextVars[5]])); - } - } - - #endregion - - #region [Right] - - else if (OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.RightChange) - || OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.RightArrow)) { - if (emc == eMenuContext.SearchByDifficulty) { - OpenTaiko.Skin.soundChangeSFX.tPlay(); - - _contextVars[_contextVars[2]]++; - // Clamp values - _contextVars[0] = Math.Max(0, Math.Min((int)Difficulty.Oni, _contextVars[0])); - _contextVars[1] = Math.Max(1, Math.Min(13, _contextVars[1])); - } else if (emc == eMenuContext.Random) { - OpenTaiko.Skin.soundChangeSFX.tPlay(); - - _contextVars[_contextVars[5]]++; - // Clamp values - _contextVars[_contextVars[5]] = Math.Max(0, Math.Min((int)Difficulty.Oni, _contextVars[_contextVars[5]])); - } - } - - #endregion - - #endregion - - return false; - } - - public void tMenuContextTrigger(eMenuContext emc) { - _contextVars = new int[10]; - isContextBoxOpened = true; - latestContext = emc; - } - - public void tMenuContextDisable() { - isContextBoxOpened = false; - latestContext = eMenuContext.NONE; - } - - public int tMenuContextGetVar(int i) { - if (i < 0 || i >= 10) - return -1; - return _contextVars[i]; - } - - public bool isContextBoxOpened = false; - public eMenuContext latestContext = eMenuContext.NONE; - private int[] _contextVars = new int[10]; - - - // その他 - - #region [ private ] - //----------------- - private enum Eバー種別 { Score, Box, Other, BackBox, Random } - - // Edit + 1 => UraOmote ScorePad - // public CScorePad[] ScorePads = new CScorePad[(int)Difficulty.Edit + 2] { new CScorePad(), new CScorePad(), new CScorePad(), new CScorePad(), new CScorePad(), new CScorePad() }; - // public CScorePad[] ScorePads2 = new CScorePad[(int)Difficulty.Edit + 2] { new CScorePad(), new CScorePad(), new CScorePad(), new CScorePad(), new CScorePad(), new CScorePad() }; - - public class CScorePad { - public int[] ScoreRankCount = new int[7]; - public int[] CrownCount = new int[4]; - } - - private struct STバー { - public CTexture Score; - public CTexture Box; - public CTexture Other; - public CTexture this[int index] { - get { - switch (index) { - case 0: - return this.Score; - - case 1: - return this.Box; - - case 2: - return this.Other; - } - throw new IndexOutOfRangeException(); - } - set { - switch (index) { - case 0: - this.Score = value; - return; - - case 1: - this.Box = value; - return; - - case 2: - this.Other = value; - return; - } - throw new IndexOutOfRangeException(); - } - } - } - - private struct STバー情報 { - public CActSelect曲リスト.Eバー種別 eバー種別; - public string strタイトル文字列; - public CTexture txタイトル名; - public STDGBVALUE nスキル値; - public Color col文字色; - public Color ForeColor; - public Color BackColor; - public Color BoxColor; - - public Color BgColor; - public string BoxType; - public string BgType; - public string BoxChara; - - public bool BoxTypeChanged; - public bool BgTypeChanged; - public bool BoxCharaChanged; - - public int[] ar難易度; - public CDTX.ELevelIcon[] nLevelIcon; - public bool[] b分岐; - public string strジャンル; - public string strサブタイトル; - public TitleTextureKey ttkタイトル; - - public int[][] nクリア; - public int[][] nスコアランク; - - public CSongUniqueID csu; - public CSongListNode reference; - } - - public bool bFirstCrownLoad; - - public CCounter ctBarFlash; - public CCounter ctDifficultyIn; - - private CCounter ctScoreFrameAnime; - - public CCounter ctBarOpen; - public CCounter ctBoxOpen; - public bool bBoxOpen; - public bool bBoxClose; - - public bool b選択曲が変更された = true; - private bool b登場アニメ全部完了; - private CCounter[] ct登場アニメ用 = new CCounter[13]; - private CCounter ct三角矢印アニメ; - private CCachedFontRenderer pfMusicName; - private CCachedFontRenderer pfSubtitle; - private CCachedFontRenderer pfMaker; - private CCachedFontRenderer pfBPM; - private CCachedFontRenderer pfBoxName; - - private string strBoxText; - private CCachedFontRenderer pfBoxText; - private CTexture[] txBoxText = new CTexture[3]; - - - - - - - - private readonly Dictionary _titledictionary - = new Dictionary(); - - private CCachedFontRenderer ft曲リスト用フォント; - //public int n現在のスクロールカウンタ; - private int n現在の選択行; - //private int n目標のスクロールカウンタ; - private CCounter ctScrollCounter; - - /* - private readonly Point[] ptバーの座標 = new Point[] { - new Point(214, -127),new Point(239, -36), new Point(263, 55), new Point(291, 145), - new Point(324, 314), - new Point(358, 485), new Point(386, 574), new Point(411, 665), new Point(436, 756) }; - */ - - private STバー情報[] stバー情報 = new STバー情報[OpenTaiko.Skin.SongSelect_Bar_Count]; - private CTexture txSongNotFound, txEnumeratingSongs; - - private TitleTextureKey ttkSelectedSongTitle; - private TitleTextureKey ttkSelectedSongSubtitle; - public TitleTextureKey ttkSelectedSongBPM; - public TitleTextureKey ttkSelectedSongMaker; - - private CTexture[] tx曲バー_難易度 = new CTexture[5]; - - private int nCurrentPosition = 0; - private int nNumOfItems = 0; - - private int nNowChange; - - private int GetTitleOffsetX(Eバー種別 bar) { - switch (bar) { - case Eバー種別.Score: - return OpenTaiko.Skin.SongSelect_Bar_Title_Offset[0]; - case Eバー種別.Box: - return OpenTaiko.Skin.SongSelect_Bar_Box_Offset[0]; - case Eバー種別.BackBox: - return OpenTaiko.Skin.SongSelect_Bar_BackBox_Offset[0]; - case Eバー種別.Random: - return OpenTaiko.Skin.SongSelect_Bar_Random_Offset[0]; - default: - return OpenTaiko.Skin.SongSelect_Bar_Title_Offset[0]; - } - } - - private int GetTitleOffsetX(CSongListNode.ENodeType node) { - switch (node) { - case CSongListNode.ENodeType.SCORE: - return OpenTaiko.Skin.SongSelect_Bar_Title_Offset[0]; - case CSongListNode.ENodeType.BOX: - return OpenTaiko.Skin.SongSelect_Bar_Box_Offset[0]; - case CSongListNode.ENodeType.BACKBOX: - return OpenTaiko.Skin.SongSelect_Bar_BackBox_Offset[0]; - case CSongListNode.ENodeType.RANDOM: - return OpenTaiko.Skin.SongSelect_Bar_Random_Offset[0]; - default: - return OpenTaiko.Skin.SongSelect_Bar_Title_Offset[0]; - } - } - - private int GetTitleOffsetY(Eバー種別 bar) { - switch (bar) { - case Eバー種別.Score: - return OpenTaiko.Skin.SongSelect_Bar_Title_Offset[1]; - case Eバー種別.Box: - return OpenTaiko.Skin.SongSelect_Bar_Box_Offset[1]; - case Eバー種別.BackBox: - return OpenTaiko.Skin.SongSelect_Bar_BackBox_Offset[1]; - case Eバー種別.Random: - return OpenTaiko.Skin.SongSelect_Bar_Random_Offset[1]; - default: - return OpenTaiko.Skin.SongSelect_Bar_Title_Offset[1]; - } - } - - private int GetTitleOffsetY(CSongListNode.ENodeType node) { - switch (node) { - case CSongListNode.ENodeType.SCORE: - return OpenTaiko.Skin.SongSelect_Bar_Title_Offset[1]; - case CSongListNode.ENodeType.BOX: - return OpenTaiko.Skin.SongSelect_Bar_Box_Offset[1]; - case CSongListNode.ENodeType.BACKBOX: - return OpenTaiko.Skin.SongSelect_Bar_BackBox_Offset[1]; - case CSongListNode.ENodeType.RANDOM: - return OpenTaiko.Skin.SongSelect_Bar_Random_Offset[1]; - default: - return OpenTaiko.Skin.SongSelect_Bar_Title_Offset[1]; - } - } - - private void DrawBarCenter(CTexture texture, int x, int y, int moveX, int move, bool changeColor, bool drawOverlay, bool fullScaleOverlay) { - CTexture overlay = OpenTaiko.Tx.SongSelect_Bar_Genre_Overlay; - - float openAnime = 1; - - if (ctBoxOpen.CurrentValue >= 1300 && ctBoxOpen.CurrentValue <= 1940) { - openAnime -= (float)Math.Sin(((ctBoxOpen.CurrentValue - 1300) * 0.28125f) * (Math.PI / 180)) * 1.0f; - } - - float overlay_xoffset = ((overlay.szTextureSize.Width / 3) * (1.0f - openAnime)); - float moveX_xoffset = (OpenTaiko.Skin.SongSelect_Bar_Center_Move_X * (1.0f - openAnime)); - - int width = overlay.sz画像サイズ.Width / 3; - int height = overlay.sz画像サイズ.Height / 3; - - if (texture != null) { - if (changeColor) { - texture.color4 = CConversion.ColorToColor4(rCurrentlySelectedSong.BoxColor); - } - - float texture_xoffset = ((texture.szTextureSize.Width / 3) * (1.0f - openAnime)); - - texture.vcScaleRatio.X = 1.0f * openAnime; - texture.vcScaleRatio.Y = 1.0f; - texture.t2D描画(x + (texture_xoffset * 1.5f) + moveX_xoffset - moveX, y - move, new Rectangle(0, 0, width, height)); - - texture.vcScaleRatio.X = 1.0f * openAnime; - texture.vcScaleRatio.Y = 1.0f + ((move / (float)height) * 2.0f); - texture.t2D描画(x + (texture_xoffset * 1.5f) + moveX_xoffset - moveX, y + height - move, new Rectangle(0, height, width, height)); - - texture.vcScaleRatio.X = 1.0f * openAnime; - texture.vcScaleRatio.Y = 1.0f; - texture.t2D描画(x + (texture_xoffset * 1.5f) + moveX_xoffset - moveX, y + (height * 2) + move, new Rectangle(0, height * 2, width, height)); - - - texture.vcScaleRatio.X = (1.0f + ((moveX / (float)width) * 2.0f)) * openAnime; - texture.vcScaleRatio.Y = 1.0f; - texture.t2D描画(x + (texture_xoffset / 2) + moveX_xoffset - moveX + width, y - move, new Rectangle(width, 0, width, height)); - - texture.vcScaleRatio.X = (1.0f + ((moveX / (float)width) * 2.0f)) * openAnime; - texture.vcScaleRatio.Y = 1.0f + ((move / (float)height) * 2.0f); - texture.t2D描画(x + (texture_xoffset / 2) + moveX_xoffset - moveX + width, y + height - move, new Rectangle(width, height, width, height)); - - texture.vcScaleRatio.X = (1.0f + ((moveX / (float)width) * 2.0f)) * openAnime; - texture.vcScaleRatio.Y = 1.0f; - texture.t2D描画(x + (texture_xoffset / 2) + moveX_xoffset - moveX + width, y + (height * 2) + move, new Rectangle(width, height * 2, width, height)); - - - texture.vcScaleRatio.X = 1.0f * openAnime; - texture.vcScaleRatio.Y = 1.0f; - texture.t2D描画(x - (texture_xoffset / 2) - moveX_xoffset + moveX + (width * 2), y - move, new Rectangle(width * 2, 0, width, height)); - - texture.vcScaleRatio.X = 1.0f * openAnime; - texture.vcScaleRatio.Y = 1.0f + ((move / (float)height) * 2.0f); - texture.t2D描画(x - (texture_xoffset / 2) - moveX_xoffset + moveX + (width * 2), y + height - move, new Rectangle(width * 2, height, width, height)); - - texture.vcScaleRatio.X = 1.0f * openAnime; - texture.vcScaleRatio.Y = 1.0f; - texture.t2D描画(x - (texture_xoffset / 2) - moveX_xoffset + moveX + (width * 2), y + (height * 2) + move, new Rectangle(width * 2, height * 2, width, height)); - - } - - if (drawOverlay) { - if (fullScaleOverlay) { - overlay.vcScaleRatio.X = 1.0f * openAnime; - overlay.vcScaleRatio.Y = 1.0f; - overlay.t2D描画(x + (overlay_xoffset * 1.5f) + moveX_xoffset - moveX, y - move, new Rectangle(0, 0, width, height)); - - overlay.vcScaleRatio.X = 1.0f * openAnime; - overlay.vcScaleRatio.Y = 1.0f + ((move / (float)height) * 2.0f); - overlay.t2D描画(x + (overlay_xoffset * 1.5f) + moveX_xoffset - moveX, y + height - move, new Rectangle(0, height, width, height)); - } else { - overlay.vcScaleRatio.X = 1.0f * openAnime; - overlay.vcScaleRatio.Y = 1.0f; - overlay.t2D描画(x + (overlay_xoffset * 1.5f) + moveX_xoffset - moveX, y, new Rectangle(0, 0, width, height)); - - overlay.vcScaleRatio.X = 1.0f * openAnime; - overlay.vcScaleRatio.Y = 1.0f + ((move / (float)height) * 1.0f); - overlay.t2D描画(x + (overlay_xoffset * 1.5f) + moveX_xoffset - moveX, y + height, new Rectangle(0, height, width, height)); - } - overlay.vcScaleRatio.X = 1.0f * openAnime; - overlay.vcScaleRatio.Y = 1.0f; - overlay.t2D描画(x + (overlay_xoffset * 1.5f) + moveX_xoffset - moveX, y + (height * 2) + move, new Rectangle(0, height * 2, width, height)); - - - if (fullScaleOverlay) { - overlay.vcScaleRatio.X = (1.0f + ((moveX / (float)width) * 2.0f)) * openAnime; - overlay.vcScaleRatio.Y = 1.0f; - overlay.t2D描画(x + (overlay_xoffset / 2) + moveX_xoffset - moveX + width, y - move, new Rectangle(width, 0, width, height)); - - overlay.vcScaleRatio.X = (1.0f + ((moveX / (float)width) * 2.0f)) * openAnime; - overlay.vcScaleRatio.Y = 1.0f + ((move / (float)height) * 2.0f); - overlay.t2D描画(x + (overlay_xoffset / 2) + moveX_xoffset - moveX + width, y + height - move, new Rectangle(width, height, width, height)); - } else { - overlay.vcScaleRatio.X = (1.0f + ((moveX / (float)width) * 2.0f)) * openAnime; - overlay.vcScaleRatio.Y = 1.0f; - overlay.t2D描画(x + (overlay_xoffset / 2) + moveX_xoffset - moveX + width, y, new Rectangle(width, 0, width, height)); - - overlay.vcScaleRatio.X = (1.0f + ((moveX / (float)width) * 2.0f)) * openAnime; - overlay.vcScaleRatio.Y = 1.0f + ((move / (float)height) * 1.0f); - overlay.t2D描画(x + (overlay_xoffset / 2) + moveX_xoffset - moveX + width, y + height, new Rectangle(width, height, width, height)); - } - overlay.vcScaleRatio.X = (1.0f + ((moveX / (float)width) * 2.0f)) * openAnime; - overlay.vcScaleRatio.Y = 1.0f; - overlay.t2D描画(x + (overlay_xoffset / 2) + moveX_xoffset - moveX + width, y + (height * 2) + move, new Rectangle(width, height * 2, width, height)); - - - if (fullScaleOverlay) { - overlay.vcScaleRatio.X = 1.0f * openAnime; - overlay.vcScaleRatio.Y = 1.0f; - overlay.t2D描画(x - (overlay_xoffset / 2) - moveX_xoffset + moveX + (width * 2), y - move, new Rectangle(width * 2, 0, width, height)); - - overlay.vcScaleRatio.X = 1.0f * openAnime; - overlay.vcScaleRatio.Y = 1.0f + ((move / (float)height) * 2.0f); - overlay.t2D描画(x - (overlay_xoffset / 2) - moveX_xoffset + moveX + (width * 2), y + height - move, new Rectangle(width * 2, height, width, height)); - } else { - overlay.vcScaleRatio.X = 1.0f * openAnime; - overlay.vcScaleRatio.Y = 1.0f; - overlay.t2D描画(x - (overlay_xoffset / 2) - moveX_xoffset + moveX + (width * 2), y, new Rectangle(width * 2, 0, width, height)); - - overlay.vcScaleRatio.X = 1.0f * openAnime; - overlay.vcScaleRatio.Y = 1.0f + ((move / (float)height) * 1.0f); - overlay.t2D描画(x - (overlay_xoffset / 2) - moveX_xoffset + moveX + (width * 2), y + height, new Rectangle(width * 2, height, width, height)); - } - overlay.vcScaleRatio.X = 1.0f * openAnime; - overlay.vcScaleRatio.Y = 1.0f; - overlay.t2D描画(x - (overlay_xoffset / 2) - moveX_xoffset + moveX + (width * 2), y + (height * 2) + move, new Rectangle(width * 2, height * 2, width, height)); - - } - - } - - private Eバー種別 e曲のバー種別を返す(CSongListNode song) { - if (song != null) { - switch (song.eノード種別) { - case CSongListNode.ENodeType.SCORE: - case CSongListNode.ENodeType.SCORE_MIDI: - return Eバー種別.Score; - - case CSongListNode.ENodeType.BOX: - return Eバー種別.Box; - - case CSongListNode.ENodeType.BACKBOX: - return Eバー種別.BackBox; - - case CSongListNode.ENodeType.RANDOM: - return Eバー種別.Random; - } - } - return Eバー種別.Other; - } - private void tChangeSong(int change) { - List list = (OpenTaiko.ConfigIni.TJAP3FolderMode && rCurrentlySelectedSong.rParentNode != null) ? rCurrentlySelectedSong.rParentNode.list子リスト : flattenList(OpenTaiko.Songs管理.list曲ルート, true); - - int index = nSelectSongIndex + change; - - while (index >= list.Count) { - index -= list.Count; - } - while (index < 0) { - index += list.Count; - } - nSelectSongIndex = index; - rCurrentlySelectedSong = list[index]; - - var IsSongLocked = OpenTaiko.Databases.DBSongUnlockables.tIsSongLocked(rCurrentlySelectedSong); - if (IsSongLocked) { - var SongUnlockable = OpenTaiko.Databases.DBSongUnlockables.tGetUnlockableByUniqueId(rCurrentlySelectedSong); - if (SongUnlockable != null) { - string _cond = "???"; - if (HRarity.tRarityToModalInt(SongUnlockable.rarity) - < HRarity.tRarityToModalInt("Epic")) - _cond = SongUnlockable.unlockConditions.tConditionMessage(DBUnlockables.CUnlockConditions.EScreen.SongSelect); - this.ttkNowUnlockConditionText = new TitleTextureKey(_cond, this.pfBoxText, Color.White, Color.Black, 1000); - } - } - } - public CSongListNode rGetSideSong(int change) { - if (rCurrentlySelectedSong == null) return null; - - List list = (OpenTaiko.ConfigIni.TJAP3FolderMode && rCurrentlySelectedSong.rParentNode != null) ? rCurrentlySelectedSong.rParentNode.list子リスト : flattenList(OpenTaiko.Songs管理.list曲ルート, true); - - if (list.Count <= 0) return null; - - int index = nSelectSongIndex + change; - - while (index >= list.Count) { - index -= list.Count; - } - while (index < 0) { - index += list.Count; - } - - var _sideNode = list[index]; - - return _sideNode; - } - - public void tバーの初期化() { - stバー情報 = new STバー情報[OpenTaiko.Skin.SongSelect_Bar_Count]; - - int barCenterNum = (OpenTaiko.Skin.SongSelect_Bar_Count - 1) / 2; - for (int i = 0; i < OpenTaiko.Skin.SongSelect_Bar_Count; i++) { - CSongListNode song = this.rGetSideSong(i - barCenterNum); - if (song == null) continue; - this.stバー情報[i].strタイトル文字列 = song.ldTitle.GetString(""); - this.stバー情報[i].strジャンル = song.strジャンル; - this.stバー情報[i].col文字色 = song.col文字色; - this.stバー情報[i].ForeColor = song.ForeColor; - this.stバー情報[i].BackColor = song.BackColor; - - this.stバー情報[i].BoxColor = song.BoxColor; - this.stバー情報[i].BgColor = song.BgColor; - - this.stバー情報[i].BoxType = song.BoxType; - this.stバー情報[i].BgType = song.BgType; - - this.stバー情報[i].BgTypeChanged = song.isChangedBgType; - this.stバー情報[i].BoxTypeChanged = song.isChangedBoxType; - - this.stバー情報[i].BoxChara = song.BoxChara; - this.stバー情報[i].BoxCharaChanged = song.isChangedBoxChara; - - this.stバー情報[i].eバー種別 = this.e曲のバー種別を返す(song); - this.stバー情報[i].strサブタイトル = song.ldSubtitle.GetString(""); - this.stバー情報[i].ar難易度 = song.nLevel; - this.stバー情報[i].nLevelIcon = song.nLevelIcon; - - for (int f = 0; f < (int)Difficulty.Total; f++) { - if (song.arスコア[f] != null) - this.stバー情報[i].b分岐 = song.arスコア[f].譜面情報.b譜面分岐; - } - - #region [Reroll cases] - - if (stバー情報[i].nクリア == null) - this.stバー情報[i].nクリア = new int[2][]; - if (stバー情報[i].nスコアランク == null) - this.stバー情報[i].nスコアランク = new int[2][]; - - for (int d = 0; d < 2; d++) { - this.stバー情報[i].nクリア[d] = new int[5]; - this.stバー情報[i].nスコアランク[d] = new int[5]; - - if (this.stバー情報[i].eバー種別 == Eバー種別.Score) { - int ap = OpenTaiko.GetActualPlayer(d); - //var sr = song.arスコア[n現在のアンカ難易度レベルに最も近い難易度レベルを返す(song)]; - - var TableEntry = OpenTaiko.SaveFileInstances[ap].data.tGetSongSelectTableEntry(song.tGetUniqueId()); - - this.stバー情報[i].nクリア[d] = TableEntry.ClearStatuses; - this.stバー情報[i].nスコアランク[d] = TableEntry.ScoreRanks; - } - } - - this.stバー情報[i].csu = song.uniqueId; - this.stバー情報[i].reference = song; - #endregion - for (int j = 0; j < 3; j++) - this.stバー情報[i].nスキル値[j] = (int)song.arスコア[this.n現在のアンカ難易度レベルに最も近い難易度レベルを返す(song)].譜面情報.最大スキル[j]; - this.stバー情報[i].ttkタイトル = this.ttkGenerateSongNameTexture(this.stバー情報[i].strタイトル文字列, this.stバー情報[i].ForeColor, this.stバー情報[i].BackColor, stバー情報[i].eバー種別 == Eバー種別.Box ? this.pfBoxName : this.pfMusicName); + #endregion + } + if (rCurrentlySelectedSong.eノード種別 == CSongListNode.ENodeType.BOX) { + #region [ Box ] + + //int boxType = nStrジャンルtoNum(r現在選択中の曲.strジャンル); + var bar_genre = HGenreBar.tGetGenreBar(rCurrentlySelectedSong.BoxType, OpenTaiko.Tx.SongSelect_Bar_Genre); // Box + var bar_genre_overlap = HGenreBar.tGetGenreBar(rCurrentlySelectedSong.BoxType, OpenTaiko.Tx.SongSelect_Bar_Genre_Overlap); + + //DrawBarCenter(TJAPlayer3.Tx.SongSelect_Bar_Genre[boxType], TJAPlayer3.Skin.SongSelect_Bar_X[barCenterNum], TJAPlayer3.Skin.SongSelect_Bar_Y[barCenterNum], centerMoveX, centerMove, true, true, false); + + DrawBarCenter(bar_genre, OpenTaiko.Skin.SongSelect_Bar_X[barCenterNum], OpenTaiko.Skin.SongSelect_Bar_Y[barCenterNum], centerMoveX, centerMove, true, false, false); + DrawBarCenter(bar_genre_overlap, OpenTaiko.Skin.SongSelect_Bar_X[barCenterNum], OpenTaiko.Skin.SongSelect_Bar_Y[barCenterNum], centerMoveX, centerMove, false, true, false); + + + #endregion + } + if (rCurrentlySelectedSong.eノード種別 == CSongListNode.ENodeType.BACKBOX) { + #region [ BackBox ] + + DrawBarCenter(OpenTaiko.Tx.SongSelect_Bar_Genre_Back, OpenTaiko.Skin.SongSelect_Bar_X[barCenterNum], OpenTaiko.Skin.SongSelect_Bar_Y[barCenterNum], centerMoveX, centerMove, false, false, false); + + #endregion + } + if (rCurrentlySelectedSong.eノード種別 == CSongListNode.ENodeType.RANDOM) { + #region [Random box] + + DrawBarCenter(OpenTaiko.Tx.SongSelect_Bar_Genre_Random, OpenTaiko.Skin.SongSelect_Bar_X[barCenterNum], OpenTaiko.Skin.SongSelect_Bar_Y[barCenterNum], centerMoveX, centerMove, false, false, false); + + #endregion } - int _center = (OpenTaiko.Skin.SongSelect_Bar_Count - 1) / 2; - this.n現在の選択行 = _center; + #endregion + + switch (rCurrentlySelectedSong.eノード種別) { + case CSongListNode.ENodeType.SCORE: { + var IsSongLocked = OpenTaiko.Databases.DBSongUnlockables.tIsSongLocked(rCurrentlySelectedSong); + var HiddenIndex = OpenTaiko.Databases.DBSongUnlockables.tGetSongHiddenIndex(rCurrentlySelectedSong); + + #region [Difficulty bars] + + if (OpenTaiko.Tx.SongSelect_Frame_Score != null && HiddenIndex < DBSongUnlockables.EHiddenIndex.GRAYED) { + // 難易度がTower、Danではない + if (OpenTaiko.stageSongSelect.n現在選択中の曲の難易度 != (int)Difficulty.Tower && OpenTaiko.stageSongSelect.n現在選択中の曲の難易度 != (int)Difficulty.Dan) { + #region [Display difficulty boxes] + + bool uraExists = OpenTaiko.stageSongSelect.r現在選択中のスコア.譜面情報.nレベル[(int)Difficulty.Edit] >= 0; + bool omoteExists = OpenTaiko.stageSongSelect.r現在選択中のスコア.譜面情報.nレベル[(int)Difficulty.Oni] >= 0; + + for (int i = 0; i < (int)Difficulty.Edit + 1; i++) { + if (ctBarOpen.CurrentValue >= 100 || OpenTaiko.Skin.SongSelect_Shorten_Frame_Fade) { + #region [Skip conditions] + + // Don't even bother process the Ura box if there isn't one + if (!uraExists && i == (int)Difficulty.Edit) + break; + + // Don't process oni box if ura exists but not oni + else if (uraExists && !omoteExists && i == (int)Difficulty.Oni) + continue; + + #endregion + + // avaliable : bool (Chart exists) + #region [Gray box if stage isn't avaliable] + + bool avaliable = OpenTaiko.stageSongSelect.r現在選択中のスコア.譜面情報.nレベル[i] >= 0; + + if (avaliable) + OpenTaiko.Tx.SongSelect_Frame_Score[0].color4 = new Color4(1f, 1f, 1f, 1f); + else + OpenTaiko.Tx.SongSelect_Frame_Score[0].color4 = new Color4(0.5f, 0.5f, 0.5f, 1f); + + #endregion + + // opacity : int (Box and scores opacity) + #region [Opacity management] + + int opacity = 0; + + if (avaliable && BarAnimeCount == 1.0) { + if (ctScoreFrameAnime.CurrentValue <= 3000) + opacity = Math.Max(0, ctScoreFrameAnime.CurrentValue - 2745); + else + opacity = Math.Min(255, 255 - (ctScoreFrameAnime.CurrentValue - 5745)); + } + + #endregion + + #region [Display box parameters] + + bool _switchingUra = i == (int)Difficulty.Edit && omoteExists; + + int difSelectOpacity = (_switchingUra) ? (BarAnimeCount < 1.0 ? 0 : opacity) : (int)(BarAnimeCount * 255.0f); + + if (OpenTaiko.Skin.SongSelect_Shorten_Frame_Fade && !_switchingUra) { + difSelectOpacity = 255; + } + + + if (!OpenTaiko.stageSongSelect.actDifficultySelectionScreen.bIsDifficltSelect || ctDifficultyIn.CurrentValue < 1000) { + OpenTaiko.Tx.SongSelect_Frame_Score[0].Opacity = difSelectOpacity; + OpenTaiko.Tx.SongSelect_Level_Number.Opacity = difSelectOpacity; + OpenTaiko.Tx.SongSelect_Level_Number_Icon?.tUpdateOpacity(difSelectOpacity); + OpenTaiko.Tx.SongSelect_Level_Number_Colored?.tUpdateOpacity(difSelectOpacity); + if (OpenTaiko.Tx.SongSelect_Level != null) OpenTaiko.Tx.SongSelect_Level.Opacity = difSelectOpacity; + } else if (ctDifficultyIn.CurrentValue >= 1000) { + int difInOpacity = (int)((float)((int)255.0f - (ctDifficultyIn.CurrentValue - 1000)) * ((i == (int)Difficulty.Edit && omoteExists) ? (float)difSelectOpacity / 255f : 1f)); + + OpenTaiko.Tx.SongSelect_Frame_Score[0].Opacity = difInOpacity; + OpenTaiko.Tx.SongSelect_Level_Number.Opacity = difInOpacity; + OpenTaiko.Tx.SongSelect_Level_Number_Icon?.tUpdateOpacity(difInOpacity); + OpenTaiko.Tx.SongSelect_Level_Number_Colored?.tUpdateOpacity(difInOpacity); + if (OpenTaiko.Tx.SongSelect_Level != null) OpenTaiko.Tx.SongSelect_Level.Opacity = difInOpacity; + } + + #endregion + + #region [Displayables] + + int displayingDiff = Math.Min(i, (int)Difficulty.Oni); + int positionalOffset = displayingDiff * 122; + + int width = OpenTaiko.Tx.SongSelect_Frame_Score[0].sz画像サイズ.Width / 5; + int height = OpenTaiko.Tx.SongSelect_Frame_Score[0].sz画像サイズ.Height; + + OpenTaiko.Tx.SongSelect_Frame_Score[0].t2D描画(OpenTaiko.Skin.SongSelect_Frame_Score_X[displayingDiff], OpenTaiko.Skin.SongSelect_Frame_Score_Y[displayingDiff], new Rectangle(width * i, 0, width, height)); + + if (avaliable) { + t小文字表示(OpenTaiko.Skin.SongSelect_Level_Number_X[displayingDiff], OpenTaiko.Skin.SongSelect_Level_Number_Y[displayingDiff], + OpenTaiko.stageSongSelect.r現在選択中のスコア.譜面情報.nレベル[i], + i, + OpenTaiko.stageSongSelect.r現在選択中のスコア.譜面情報.nLevelIcon[i] + ); + + if (OpenTaiko.Tx.SongSelect_Level != null) { + int level_width = OpenTaiko.Tx.SongSelect_Level.szTextureSize.Width / 7; + int level_height = OpenTaiko.Tx.SongSelect_Level.szTextureSize.Height; + + for (int i2 = 0; i2 < OpenTaiko.stageSongSelect.r現在選択中のスコア.譜面情報.nレベル[i]; i2++) { + OpenTaiko.Tx.SongSelect_Level.t2D描画( + OpenTaiko.Skin.SongSelect_Level_X[displayingDiff] + (OpenTaiko.Skin.SongSelect_Level_Move[0] * i2), + OpenTaiko.Skin.SongSelect_Level_Y[displayingDiff] + (OpenTaiko.Skin.SongSelect_Level_Move[1] * i2), + new RectangleF(level_width * i, 0, level_width, level_height)); + } + } + + if (OpenTaiko.stageSongSelect.r現在選択中のスコア.譜面情報.b譜面分岐[i]) { + OpenTaiko.Tx.SongSelect_Branch?.tUpdateOpacity(OpenTaiko.Tx.SongSelect_Frame_Score[0].Opacity); + OpenTaiko.Tx.SongSelect_Branch?.t2D描画( + + OpenTaiko.Skin.SongSelect_Frame_Score_X[displayingDiff] + OpenTaiko.Skin.SongSelect_Branch_Offset[0], + OpenTaiko.Skin.SongSelect_Frame_Score_Y[displayingDiff] + OpenTaiko.Skin.SongSelect_Branch_Offset[1] + ); + } + + } + + #endregion + + } + } + + #endregion + + } else { + // diff : int (5 : Tower, 6 : Dan) + #region [Check if Dan or Tower] + + int diff = 5; + if (OpenTaiko.stageSongSelect.n現在選択中の曲の難易度 == (int)Difficulty.Dan) + diff = 6; + + #endregion + + // avaliable : bool (Chart exists) + #region [Gray box if stage isn't avaliable] + + bool avaliable = OpenTaiko.stageSongSelect.r現在選択中のスコア.譜面情報.nレベル[diff] >= 0; + + if (avaliable) + OpenTaiko.Tx.SongSelect_Frame_Score[1].color4 = new Color4(1f, 1f, 1f, 1f); + else + OpenTaiko.Tx.SongSelect_Frame_Score[1].color4 = new Color4(0.5f, 0.5f, 0.5f, 1f); + + #endregion + + #region [Display box parameters] + + int difSelectOpacity = (int)(BarAnimeCount * 255); + + if (OpenTaiko.Skin.SongSelect_Shorten_Frame_Fade) + difSelectOpacity = 255; + + if (!OpenTaiko.stageSongSelect.actDifficultySelectionScreen.bIsDifficltSelect || ctDifficultyIn.CurrentValue < 1000) { + OpenTaiko.Tx.SongSelect_Frame_Score[1].Opacity = difSelectOpacity; + OpenTaiko.Tx.SongSelect_Level_Number.Opacity = difSelectOpacity; + OpenTaiko.Tx.SongSelect_Level_Number_Icon?.tUpdateOpacity(difSelectOpacity); + OpenTaiko.Tx.SongSelect_Level_Number_Colored?.tUpdateOpacity(difSelectOpacity); + if (OpenTaiko.Tx.SongSelect_Level != null) OpenTaiko.Tx.SongSelect_Level.Opacity = difSelectOpacity; + } else if (ctDifficultyIn.CurrentValue >= 1000) { + int difInOpacity = (int)255.0f - (ctDifficultyIn.CurrentValue - 1000); + + OpenTaiko.Tx.SongSelect_Frame_Score[1].Opacity = difInOpacity; + OpenTaiko.Tx.SongSelect_Level_Number.Opacity = difInOpacity; + OpenTaiko.Tx.SongSelect_Level_Number_Icon?.tUpdateOpacity(difInOpacity); + OpenTaiko.Tx.SongSelect_Level_Number_Colored?.tUpdateOpacity(difInOpacity); + if (OpenTaiko.Tx.SongSelect_Level != null) OpenTaiko.Tx.SongSelect_Level.Opacity = difInOpacity; + } + + #endregion + + #region [Displayables] + + int displayingDiff = diff == 5 ? 0 : 2; + int width = OpenTaiko.Tx.SongSelect_Frame_Score[0].sz画像サイズ.Width / 5; + int height = OpenTaiko.Tx.SongSelect_Frame_Score[0].sz画像サイズ.Height; + + OpenTaiko.Tx.SongSelect_Frame_Score[1].t2D描画(OpenTaiko.Skin.SongSelect_Frame_Score_X[displayingDiff], OpenTaiko.Skin.SongSelect_Frame_Score_Y[displayingDiff], new Rectangle(width * displayingDiff, 0, width, height)); + + var _level_number = (diff == 5) ? OpenTaiko.Skin.SongSelect_Level_Number_Tower : OpenTaiko.Skin.SongSelect_Level_Number_Tower; + + + if (avaliable) { + t小文字表示(OpenTaiko.Skin.SongSelect_Level_Number_X[displayingDiff], OpenTaiko.Skin.SongSelect_Level_Number_Y[displayingDiff], + OpenTaiko.stageSongSelect.r現在選択中のスコア.譜面情報.nレベル[diff], + diff, + OpenTaiko.stageSongSelect.r現在選択中のスコア.譜面情報.nLevelIcon[diff] + ); + + if (diff == 5) { + var _sidet = OpenTaiko.Tx.SongSelect_Tower_Side; + if (_sidet != null) { + var _side = (OpenTaiko.stageSongSelect.rNowSelectedSong.nSide == CDTX.ESide.eNormal) ? 0 : 1; + var _sc = _sidet.sz画像サイズ.Width / 2; + _sidet.t2D描画( + OpenTaiko.Skin.SongSelect_Tower_Side[0], + OpenTaiko.Skin.SongSelect_Tower_Side[1], + new Rectangle(_side * _sc, 0, _sc, _sidet.sz画像サイズ.Height)); + } + + } + + if (OpenTaiko.Tx.SongSelect_Level != null) { + int level_width = OpenTaiko.Tx.SongSelect_Level.szTextureSize.Width / 7; + int level_height = OpenTaiko.Tx.SongSelect_Level.szTextureSize.Height; + + for (int i2 = 0; i2 < OpenTaiko.stageSongSelect.r現在選択中のスコア.譜面情報.nレベル[diff]; i2++) { + OpenTaiko.Tx.SongSelect_Level?.t2D描画( + OpenTaiko.Skin.SongSelect_Level_X[displayingDiff] + (OpenTaiko.Skin.SongSelect_Level_Move[0] * i2), + OpenTaiko.Skin.SongSelect_Level_Y[displayingDiff] + (OpenTaiko.Skin.SongSelect_Level_Move[1] * i2), + new RectangleF(level_width * diff, 0, level_width, level_height)); + + } + } + } + + #endregion + + } + + } + + #endregion + } + break; + + case CSongListNode.ENodeType.BOX: { + #region [Box explanation] + + for (int j = 0; j < 3; j++) { + if (!ctBoxOpen.IsEnded && ctBoxOpen.CurrentValue != 0) { + if (txBoxText[j] != null) + this.txBoxText[j].Opacity = (int)(ctBoxOpen.CurrentValue >= 1200 && ctBoxOpen.CurrentValue <= 1620 ? 255 - (ctBoxOpen.CurrentValue - 1200) * 2.55f : + ctBoxOpen.CurrentValue >= 2000 ? (ctBoxOpen.CurrentValue - 2000) * 2.55f : ctBoxOpen.CurrentValue <= 1200 ? 255 : 0); + } else + if (txBoxText[j] != null) + this.txBoxText[j].Opacity = (int)(BarAnimeCount * 255.0f); + + if (this.txBoxText[j].szTextureSize.Width >= 510) + this.txBoxText[j].vcScaleRatio.X = 510f / this.txBoxText[j].szTextureSize.Width; + + this.txBoxText[j].t2D拡大率考慮中央基準描画(OpenTaiko.Skin.SongSelect_BoxExplanation_X, OpenTaiko.Skin.SongSelect_BoxExplanation_Y + j * OpenTaiko.Skin.SongSelect_BoxExplanation_Interval); + } + + #endregion + + #region [Box chara] + + var box_chara = HGenreBar.tGetGenreBar(rCurrentlySelectedSong.BoxChara, OpenTaiko.Tx.SongSelect_Box_Chara); + + // If BoxChara < 0, don't display any character + { + if (!ctBoxOpen.IsEnded) + box_chara.Opacity = (int)(ctBoxOpen.CurrentValue >= 1200 && ctBoxOpen.CurrentValue <= 1620 ? 255 - (ctBoxOpen.CurrentValue - 1200) * 2.55f : + ctBoxOpen.CurrentValue >= 2000 ? (ctBoxOpen.CurrentValue - 2000) * 2.55f : ctBoxOpen.CurrentValue <= 1200 ? 255 : 0); + else { + if (!OpenTaiko.stageSongSelect.actDifficultySelectionScreen.bIsDifficltSelect) + box_chara.Opacity = (int)(BarAnimeCount * 255.0f); + else if (ctDifficultyIn.CurrentValue >= 1000) + box_chara.Opacity = (int)255.0f - (ctDifficultyIn.CurrentValue - 1000); + } + + box_chara?.t2D中心基準描画(OpenTaiko.Skin.SongSelect_Box_Chara_X[0] - (BarAnimeCount * OpenTaiko.Skin.SongSelect_Box_Chara_Move), OpenTaiko.Skin.SongSelect_Box_Chara_Y[0], + new Rectangle(0, 0, box_chara.szTextureSize.Width / 2, + box_chara.szTextureSize.Height)); + + box_chara?.t2D中心基準描画(OpenTaiko.Skin.SongSelect_Box_Chara_X[1] + (BarAnimeCount * OpenTaiko.Skin.SongSelect_Box_Chara_Move), OpenTaiko.Skin.SongSelect_Box_Chara_Y[1], + new Rectangle(box_chara.szTextureSize.Width / 2, 0, + box_chara.szTextureSize.Width / 2, box_chara.szTextureSize.Height)); + } + + #endregion + } + break; + + case CSongListNode.ENodeType.BACKBOX: + //if (TJAPlayer3.Tx.SongSelect_Frame_BackBox != null) + // TJAPlayer3.Tx.SongSelect_Frame_BackBox.t2D描画(450, TJAPlayer3.Skin.SongSelect_Overall_Y); + break; + + case CSongListNode.ENodeType.RANDOM: + //if (TJAPlayer3.Tx.SongSelect_Frame_Random != null) + // TJAPlayer3.Tx.SongSelect_Frame_Random.t2D描画(450, TJAPlayer3.Skin.SongSelect_Overall_Y); + break; + } + + /*if (TJAPlayer3.Tx.SongSelect_Branch_Text != null + && TJAPlayer3.stage選曲.r現在選択中のスコア.譜面情報.b譜面分岐[TJAPlayer3.stage選曲.n現在選択中の曲の難易度]) + TJAPlayer3.Tx.SongSelect_Branch_Text.t2D描画(483, TJAPlayer3.Skin.SongSelect_Overall_Y + 21); + */ } - // Song type : 0 - Ensou, 1 - Dan, 2 - Tower - private void tジャンル別選択されていない曲バーの描画( - int x, - int y, - string strジャンル, - Eバー種別 eバー種別, - int[][] クリア, - int[][] スコアランク, - string boxType, - int _songType = 0, - CSongUniqueID csu = null, - CSongListNode reference = null - ) { - if (x >= SampleFramework.GameWindowSize.Width || y >= SampleFramework.GameWindowSize.Height) - return; - - var IsSongLocked = OpenTaiko.Databases.DBSongUnlockables.tIsSongLocked(reference); - var HiddenIndex = OpenTaiko.Databases.DBSongUnlockables.tGetSongHiddenIndex(reference); - - - var rc = new Rectangle(0, 48, 128, 48); - - int opct = 255; - - if (OpenTaiko.stageSongSelect.actDifficultySelectionScreen.bIsDifficltSelect && ctDifficultyIn.CurrentValue >= 1000) - opct = Math.Max((int)255.0f - (ctDifficultyIn.CurrentValue - 1000), 0); - - OpenTaiko.Tx.SongSelect_Crown.Opacity = opct; - OpenTaiko.Tx.SongSelect_ScoreRank.Opacity = opct; - - foreach (var tex in OpenTaiko.Tx.SongSelect_Bar_Genre) { - tex.Value.Opacity = opct; + if (ctBoxOpen.CurrentValue >= 1620) { + if (bBoxOpen) { + this.tBOXに入る(); + bBoxOpen = false; } - foreach (var tex in OpenTaiko.Tx.SongSelect_Bar_Genre_Overlap) { - tex.Value.Opacity = opct; + if (bBoxClose) { + this.tCloseBOX(); + OpenTaiko.stageSongSelect.bBGM再生済み = false; + /* + if (TJAPlayer3.ConfigIni.bBGM音を発声する || !TJAPlayer3.Skin.bgm選曲画面イン.b再生中) + TJAPlayer3.Skin.bgm選曲画面イン.t再生する(); + TJAPlayer3.stage選曲.bBGMIn再生した = true; + */ + CSongSelectSongManager.playSongIfPossible(); + bBoxClose = false; } + } - OpenTaiko.Tx.SongSelect_Bar_Genre_Back?.tUpdateOpacity(opct); - OpenTaiko.Tx.SongSelect_Bar_Genre_Random?.tUpdateOpacity(opct); - OpenTaiko.Tx.SongSelect_Bar_Genre_Overlay?.tUpdateOpacity(opct); - OpenTaiko.Tx.SongSelect_Favorite?.tUpdateOpacity(opct); - OpenTaiko.Tx.TowerResult_ScoreRankEffect?.tUpdateOpacity(opct); - OpenTaiko.Tx.DanResult_Rank?.tUpdateOpacity(opct); - OpenTaiko.Tx.SongSelect_Level_Number_Big?.tUpdateOpacity(opct); - OpenTaiko.Tx.SongSelect_Level_Number_Big_Colored?.tUpdateOpacity(opct); - OpenTaiko.Tx.SongSelect_Level_Number_Big_Icon?.tUpdateOpacity(opct); - OpenTaiko.Tx.SongSelect_Lock?.tUpdateOpacity(opct); - OpenTaiko.Tx.SongSelect_Bar_Genre_Locked?.tUpdateOpacity(opct); - OpenTaiko.Tx.SongSelect_Bar_Genre_Locked_Top?.tUpdateOpacity(opct); + if (ctDifficultyIn.CurrentValue >= ctDifficultyIn.EndValue) { + ctDifficultyIn.Stop(); + } - for (int i = 0; i < OpenTaiko.Tx.SongSelect_Song_Panel.Length; i++) { - OpenTaiko.Tx.SongSelect_Song_Panel[i]?.tUpdateOpacity(opct); - } - OpenTaiko.Tx.SongSelect_Bpm_Number?.tUpdateOpacity(opct); - if (ttkSelectedSongMaker != null && OpenTaiko.Skin.SongSelect_Maker_Show) { - TitleTextureKey.ResolveTitleTexture(ttkSelectedSongMaker)?.tUpdateOpacity(opct); - } - if (ttkSelectedSongBPM != null && OpenTaiko.Skin.SongSelect_BPM_Text_Show) { - TitleTextureKey.ResolveTitleTexture(ttkSelectedSongBPM)?.tUpdateOpacity(opct); - } - OpenTaiko.Tx.SongSelect_Explicit?.tUpdateOpacity(opct); - OpenTaiko.Tx.SongSelect_Movie?.tUpdateOpacity(opct); + for (int i = 0; i < OpenTaiko.Skin.SongSelect_Bar_Count; i++) // パネルは全13枚。 + { + int index = i + nNowChange; + if (((index < 0 || index >= OpenTaiko.Skin.SongSelect_Bar_Count) && this.ctScrollCounter.CurrentValue != this.ctScrollCounter.EndValue)) + continue; + + int nパネル番号 = (((this.n現在の選択行 - barCenterNum) + i) + OpenTaiko.Skin.SongSelect_Bar_Count) % OpenTaiko.Skin.SongSelect_Bar_Count; + int n見た目の行番号 = i; + int n次のパネル番号 = ((i + nNowChange) % OpenTaiko.Skin.SongSelect_Bar_Count); + //int x = this.ptバーの基本座標[ n見た目の行番号 ].X + ( (int) ( ( this.ptバーの基本座標[ n次のパネル番号 ].X - this.ptバーの基本座標[ n見た目の行番号 ].X ) * ( ( (double) Math.Abs( this.n現在のスクロールカウンタ ) ) / 100.0 ) ) ); + int x = i選曲バーX座標; + int xAnime = OpenTaiko.Skin.SongSelect_Bar_X[n見た目の行番号] + ((int)((OpenTaiko.Skin.SongSelect_Bar_X[n次のパネル番号] - OpenTaiko.Skin.SongSelect_Bar_X[n見た目の行番号]) * + fNowScrollAnime)); + + int y = OpenTaiko.Skin.SongSelect_Bar_Y[n見た目の行番号] + ((int)((OpenTaiko.Skin.SongSelect_Bar_Y[n次のパネル番号] - OpenTaiko.Skin.SongSelect_Bar_Y[n見た目の行番号]) * + fNowScrollAnime)); + + if ((i == barCenterNum) && ctScrollCounter.CurrentValue == ctScrollCounter.EndValue) { + CTexture txSelectedSongSubtitle = null; + + // (A) スクロールが停止しているときの選択曲バーの描画。 + + var IsSongLocked = OpenTaiko.Databases.DBSongUnlockables.tIsSongLocked(rCurrentlySelectedSong); + var HiddenIndex = OpenTaiko.Databases.DBSongUnlockables.tGetSongHiddenIndex(rCurrentlySelectedSong); + + #region [ Nastiest Song Title display method I ever saw] + + // Fonts here + + //----------------- + if (rCurrentlySelectedSong.ldTitle.GetString("") != "" && this.ttkSelectedSongTitle == null) + this.ttkSelectedSongTitle = this.ttkGenerateSongNameTexture(rCurrentlySelectedSong.ldTitle.GetString(""), rCurrentlySelectedSong.ForeColor, rCurrentlySelectedSong.BackColor, rCurrentlySelectedSong.eノード種別 == CSongListNode.ENodeType.BOX ? this.pfBoxName : this.pfMusicName); + if (rCurrentlySelectedSong.ldSubtitle.GetString("") != "" && this.ttkSelectedSongSubtitle == null) + this.ttkSelectedSongSubtitle = this.ttkGenerateSubtitleTexture(rCurrentlySelectedSong.ldSubtitle.GetString(""), rCurrentlySelectedSong.ForeColor, rCurrentlySelectedSong.BackColor); + if (rCurrentlySelectedSong.strMaker != "" && this.ttkSelectedSongMaker == null) + this.ttkSelectedSongMaker = this.ttkGenerateMakerTexture(rCurrentlySelectedSong.strMaker, rCurrentlySelectedSong.ForeColor, rCurrentlySelectedSong.BackColor); + if (this.ttkSelectedSongBPM == null) + this.ttkSelectedSongBPM = this.ttkGenerateBPMTexture(rCurrentlySelectedSong, rCurrentlySelectedSong.ForeColor, rCurrentlySelectedSong.BackColor); ; - if (eバー種別 == Eバー種別.Random) { - OpenTaiko.Tx.SongSelect_Bar_Genre_Random?.t2D描画(x, y); - } else if (eバー種別 != Eバー種別.BackBox) { - if (HiddenIndex >= DBSongUnlockables.EHiddenIndex.GRAYED) { - OpenTaiko.Tx.SongSelect_Bar_Genre_Locked?.t2D描画(x, y); - return; + if (this.ttkSelectedSongSubtitle != null) + txSelectedSongSubtitle = TitleTextureKey.ResolveTitleTexture(ttkSelectedSongSubtitle, OpenTaiko.Skin.SongSelect_VerticalText); + + var _title = TitleTextureKey.ResolveTitleTexture(this.ttkSelectedSongTitle, OpenTaiko.Skin.SongSelect_VerticalText); + + if (HiddenIndex >= DBSongUnlockables.EHiddenIndex.BLURED && _title != null) { + _title.bUseNoiseEffect = true; + } + + //サブタイトルがあったら700 + + if (ttkSelectedSongTitle != null) { + if (!ctBoxOpen.IsEnded) + _title.Opacity = (int)(ctBoxOpen.CurrentValue >= 1200 && ctBoxOpen.CurrentValue <= 1620 ? 255 - (ctBoxOpen.CurrentValue - 1200) * 2.55f : + ctBoxOpen.CurrentValue >= 2000 ? (ctBoxOpen.CurrentValue - 2000) * 2.55f : ctBoxOpen.CurrentValue <= 1200 ? 255 : 0); + else { + if (!OpenTaiko.stageSongSelect.actDifficultySelectionScreen.bIsDifficltSelect) + _title.Opacity = 255; + else if (ctDifficultyIn.CurrentValue >= 1000) + _title.Opacity = (int)255.0f - (ctDifficultyIn.CurrentValue - 1000); + } + } + + if (this.ttkSelectedSongSubtitle != null) { + if (HiddenIndex >= DBSongUnlockables.EHiddenIndex.BLURED) { + txSelectedSongSubtitle.bUseNoiseEffect = true; + } + + if (!ctBoxOpen.IsEnded) + txSelectedSongSubtitle.Opacity = (int)(ctBoxOpen.CurrentValue >= 1200 && ctBoxOpen.CurrentValue <= 1620 ? 255 - (ctBoxOpen.CurrentValue - 1200) * 2.55f : + ctBoxOpen.CurrentValue >= 2000 ? (ctBoxOpen.CurrentValue - 2000) * 2.55f : ctBoxOpen.CurrentValue <= 1200 ? 255 : 0); + else { + if (!OpenTaiko.stageSongSelect.actDifficultySelectionScreen.bIsDifficltSelect) + txSelectedSongSubtitle.Opacity = (int)(BarAnimeCount * 255.0f); + else if (ctDifficultyIn.CurrentValue >= 1000) + txSelectedSongSubtitle.Opacity = (int)255.0f - (ctDifficultyIn.CurrentValue - 1000); + } + + txSelectedSongSubtitle.t2D拡大率考慮中央基準描画( + xAnime + OpenTaiko.Skin.SongSelect_Bar_SubTitle_Offset[0] + (rCurrentlySelectedSong.eノード種別 == CSongListNode.ENodeType.BOX ? centerMoveX : centerMoveX / 1.1f), + y + OpenTaiko.Skin.SongSelect_Bar_SubTitle_Offset[1] - (rCurrentlySelectedSong.eノード種別 == CSongListNode.ENodeType.BOX ? centerMove : centerMove / 1.1f)); + + if (HiddenIndex >= DBSongUnlockables.EHiddenIndex.BLURED) { + txSelectedSongSubtitle.bUseNoiseEffect = false; + } + + if (this.ttkSelectedSongTitle != null) { + _title.t2D拡大率考慮中央基準描画( + xAnime + GetTitleOffsetX(rCurrentlySelectedSong.eノード種別) + + (rCurrentlySelectedSong.eノード種別 != CSongListNode.ENodeType.BACKBOX ? (rCurrentlySelectedSong.eノード種別 == CSongListNode.ENodeType.BOX ? centerMoveX : centerMoveX / 1.1f) : 0), + + y + GetTitleOffsetY(rCurrentlySelectedSong.eノード種別) - + (rCurrentlySelectedSong.eノード種別 != CSongListNode.ENodeType.BACKBOX ? (rCurrentlySelectedSong.eノード種別 == CSongListNode.ENodeType.BOX ? centerMove : centerMove / 1.1f) : 0)); + } } else { - HGenreBar.tGetGenreBar(boxType, OpenTaiko.Tx.SongSelect_Bar_Genre)?.t2D描画(x, y); - HGenreBar.tGetGenreBar(boxType, OpenTaiko.Tx.SongSelect_Bar_Genre_Overlap)?.t2D描画(x, y); - OpenTaiko.Tx.SongSelect_Bar_Genre_Overlay?.t2D描画(x, y); + if (this.ttkSelectedSongTitle != null) { + _title.t2D拡大率考慮中央基準描画( + xAnime + GetTitleOffsetX(this.stバー情報[nパネル番号].eバー種別) + + (rCurrentlySelectedSong.eノード種別 != CSongListNode.ENodeType.BACKBOX ? (rCurrentlySelectedSong.eノード種別 == CSongListNode.ENodeType.BOX ? centerMoveX : centerMoveX / 1.1f) : 0), + + y + GetTitleOffsetY(this.stバー情報[nパネル番号].eバー種別) - + (rCurrentlySelectedSong.eノード種別 != CSongListNode.ENodeType.BACKBOX ? (rCurrentlySelectedSong.eノード種別 == CSongListNode.ENodeType.BOX ? centerMove : centerMove / 1.1f) : 0)); + } + } + + if (HiddenIndex >= DBSongUnlockables.EHiddenIndex.BLURED && _title != null) { + _title.bUseNoiseEffect = false; + } + //----------------- + #endregion + + + + if (HiddenIndex >= DBSongUnlockables.EHiddenIndex.GRAYED) { + DrawBarCenter(OpenTaiko.Tx.SongSelect_Bar_Genre_Locked_Top, OpenTaiko.Skin.SongSelect_Bar_X[barCenterNum], OpenTaiko.Skin.SongSelect_Bar_Y[barCenterNum], centerMoveX, centerMove, false, false, false); + //TJAPlayer3.Tx.SongSelect_Bar_Genre_Locked_Top?.t2D描画(); + } + } + } + //----------------- + + //TJAPlayer3.act文字コンソール.tPrint(0, 12, C文字コンソール.Eフォント種別.白, CSongDict.tGetNodesCount().ToString()); + + return 0; + } + + public void tMenuContextView(eMenuContext emc) { + // Context vars : + // 0 - Selected difficulty + // 1 - Selected star rating + // 2 - Current menu (0 : select difficulty, 1 : select star rating) + if (emc == eMenuContext.SearchByDifficulty) { + OpenTaiko.Tx.SongSelect_Search_Window?.t2D描画(0, 0); + + int tileSize = 0; + if (OpenTaiko.Tx.Dani_Difficulty_Cymbol != null) { + tileSize = OpenTaiko.Tx.Dani_Difficulty_Cymbol.szTextureSize.Height; + OpenTaiko.Tx.Dani_Difficulty_Cymbol.t2D中心基準描画(OpenTaiko.Skin.SongSelect_Search_Bar_X[0], OpenTaiko.Skin.SongSelect_Search_Bar_Y[0], + new Rectangle(tileSize * _contextVars[0], + 0, + (_contextVars[0] == (int)Difficulty.Oni ? 2 : 1) * tileSize, + tileSize)); + } + + + if (_contextVars[2] == 0) { + OpenTaiko.Tx.SongSelect_Search_Arrow_Glow?.t2D中心基準描画(OpenTaiko.Skin.SongSelect_Search_Bar_X[0], OpenTaiko.Skin.SongSelect_Search_Bar_Y[0]); + } else if (_contextVars[2] == 1) { + OpenTaiko.Tx.SongSelect_Search_Arrow?.t2D中心基準描画(OpenTaiko.Skin.SongSelect_Search_Bar_X[0], OpenTaiko.Skin.SongSelect_Search_Bar_Y[0]); + OpenTaiko.Tx.SongSelect_Search_Arrow_Glow?.t2D中心基準描画(OpenTaiko.Skin.SongSelect_Search_Bar_X[1], OpenTaiko.Skin.SongSelect_Search_Bar_Y[1]); + + if (OpenTaiko.Tx.SongSelect_Level_Icons != null) { + tileSize = OpenTaiko.Tx.SongSelect_Level_Icons.szTextureSize.Height; + OpenTaiko.Tx.SongSelect_Level_Icons.t2D中心基準描画(OpenTaiko.Skin.SongSelect_Search_Bar_X[1], OpenTaiko.Skin.SongSelect_Search_Bar_Y[1], + new Rectangle(tileSize * _contextVars[1], + 0, + tileSize, + tileSize)); + } + + } + } + // Context vars : + // 0~4 - Selected difficulty (1~5P) + // 5 - Current menu (0~4 for each player) + else if (emc == eMenuContext.Random) { + // To change with a new texture + OpenTaiko.Tx.SongSelect_Search_Window?.t2D描画(0, 0); + + for (int i = 0; i <= _contextVars[5]; i++) { + if (OpenTaiko.Tx.Dani_Difficulty_Cymbol != null) { + var tileSize = OpenTaiko.Tx.Dani_Difficulty_Cymbol.szTextureSize.Height; + OpenTaiko.Tx.Dani_Difficulty_Cymbol.t2D中心基準描画(OpenTaiko.Skin.SongSelect_Search_Bar_X[i], OpenTaiko.Skin.SongSelect_Search_Bar_Y[i], + new Rectangle(tileSize * _contextVars[i], + 0, + (_contextVars[i] == (int)Difficulty.Oni ? 2 : 1) * tileSize, + tileSize)); + + } + + if (i < _contextVars[5]) + OpenTaiko.Tx.SongSelect_Search_Arrow?.t2D中心基準描画(OpenTaiko.Skin.SongSelect_Search_Bar_X[i], OpenTaiko.Skin.SongSelect_Search_Bar_Y[i]); + else if (i == _contextVars[5]) + OpenTaiko.Tx.SongSelect_Search_Arrow_Glow?.t2D中心基準描画(OpenTaiko.Skin.SongSelect_Search_Bar_X[i], OpenTaiko.Skin.SongSelect_Search_Bar_Y[i]); + } + } + } + + public bool tMenuContextController(eMenuContext emc) { + tMenuContextView(emc); + + #region [Inputs] + + #region [Decide] + + if ((OpenTaiko.Pad.bPressedDGB(EPad.Decide)) || + ((OpenTaiko.ConfigIni.bEnterIsNotUsedInKeyAssignments && OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Return)))) { + if (emc == eMenuContext.SearchByDifficulty) { + OpenTaiko.Skin.soundDecideSFX.tPlay(); + + _contextVars[2]++; + if (_contextVars[2] >= 2) { + //tMenuContextDisable(); + return true; + } else if (_contextVars[2] == 1) { + // Set default level for each difficulty + switch (_contextVars[0]) { + case (int)Difficulty.Easy: + _contextVars[1] = 1; + break; + case (int)Difficulty.Normal: + _contextVars[1] = 3; + break; + case (int)Difficulty.Hard: + _contextVars[1] = 6; + break; + default: + _contextVars[1] = 8; + break; + } + } + + } else if (emc == eMenuContext.Random) { + OpenTaiko.Skin.soundDecideSFX.tPlay(); + + _contextVars[5]++; + if (_contextVars[5] >= OpenTaiko.ConfigIni.nPlayerCount) + return true; + if (_contextVars[5] >= 1 && OpenTaiko.ConfigIni.bAIBattleMode) { + _contextVars[1] = _contextVars[0]; + return true; + } + _contextVars[_contextVars[5]] = Math.Min((int)Difficulty.Oni, OpenTaiko.ConfigIni.nDefaultCourse); + } + + } + + #endregion + + #region [Left] + + else if (OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.LeftChange) + || OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.LeftArrow)) { + if (emc == eMenuContext.SearchByDifficulty) { + OpenTaiko.Skin.soundChangeSFX.tPlay(); + + _contextVars[_contextVars[2]]--; + // Clamp values + _contextVars[0] = Math.Max(0, Math.Min((int)Difficulty.Oni, _contextVars[0])); + _contextVars[1] = Math.Max(1, Math.Min(13, _contextVars[1])); + } else if (emc == eMenuContext.Random) { + OpenTaiko.Skin.soundChangeSFX.tPlay(); + + _contextVars[_contextVars[5]]--; + // Clamp values + _contextVars[_contextVars[5]] = Math.Max(0, Math.Min((int)Difficulty.Oni, _contextVars[_contextVars[5]])); + } + } + + #endregion + + #region [Right] + + else if (OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.RightChange) + || OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.RightArrow)) { + if (emc == eMenuContext.SearchByDifficulty) { + OpenTaiko.Skin.soundChangeSFX.tPlay(); + + _contextVars[_contextVars[2]]++; + // Clamp values + _contextVars[0] = Math.Max(0, Math.Min((int)Difficulty.Oni, _contextVars[0])); + _contextVars[1] = Math.Max(1, Math.Min(13, _contextVars[1])); + } else if (emc == eMenuContext.Random) { + OpenTaiko.Skin.soundChangeSFX.tPlay(); + + _contextVars[_contextVars[5]]++; + // Clamp values + _contextVars[_contextVars[5]] = Math.Max(0, Math.Min((int)Difficulty.Oni, _contextVars[_contextVars[5]])); + } + } + + #endregion + + #endregion + + return false; + } + + public void tMenuContextTrigger(eMenuContext emc) { + _contextVars = new int[10]; + isContextBoxOpened = true; + latestContext = emc; + } + + public void tMenuContextDisable() { + isContextBoxOpened = false; + latestContext = eMenuContext.NONE; + } + + public int tMenuContextGetVar(int i) { + if (i < 0 || i >= 10) + return -1; + return _contextVars[i]; + } + + public bool isContextBoxOpened = false; + public eMenuContext latestContext = eMenuContext.NONE; + private int[] _contextVars = new int[10]; + + + // その他 + + #region [ private ] + //----------------- + private enum Eバー種別 { Score, Box, Other, BackBox, Random } + + // Edit + 1 => UraOmote ScorePad + // public CScorePad[] ScorePads = new CScorePad[(int)Difficulty.Edit + 2] { new CScorePad(), new CScorePad(), new CScorePad(), new CScorePad(), new CScorePad(), new CScorePad() }; + // public CScorePad[] ScorePads2 = new CScorePad[(int)Difficulty.Edit + 2] { new CScorePad(), new CScorePad(), new CScorePad(), new CScorePad(), new CScorePad(), new CScorePad() }; + + public class CScorePad { + public int[] ScoreRankCount = new int[7]; + public int[] CrownCount = new int[4]; + } + + private struct STバー { + public CTexture Score; + public CTexture Box; + public CTexture Other; + public CTexture this[int index] { + get { + switch (index) { + case 0: + return this.Score; + + case 1: + return this.Box; + + case 2: + return this.Other; + } + throw new IndexOutOfRangeException(); + } + set { + switch (index) { + case 0: + this.Score = value; + return; + + case 1: + this.Box = value; + return; + + case 2: + this.Other = value; + return; + } + throw new IndexOutOfRangeException(); + } + } + } + + private struct STバー情報 { + public CActSelect曲リスト.Eバー種別 eバー種別; + public string strタイトル文字列; + public CTexture txタイトル名; + public STDGBVALUE nスキル値; + public Color col文字色; + public Color ForeColor; + public Color BackColor; + public Color BoxColor; + + public Color BgColor; + public string BoxType; + public string BgType; + public string BoxChara; + + public bool BoxTypeChanged; + public bool BgTypeChanged; + public bool BoxCharaChanged; + + public int[] ar難易度; + public CDTX.ELevelIcon[] nLevelIcon; + public bool[] b分岐; + public string strジャンル; + public string strサブタイトル; + public TitleTextureKey ttkタイトル; + + public int[][] nクリア; + public int[][] nスコアランク; + + public CSongUniqueID csu; + public CSongListNode reference; + } + + public bool bFirstCrownLoad; + + public CCounter ctBarFlash; + public CCounter ctDifficultyIn; + + private CCounter ctScoreFrameAnime; + + public CCounter ctBarOpen; + public CCounter ctBoxOpen; + public bool bBoxOpen; + public bool bBoxClose; + + public bool b選択曲が変更された = true; + private bool b登場アニメ全部完了; + private CCounter[] ct登場アニメ用 = new CCounter[13]; + private CCounter ct三角矢印アニメ; + private CCachedFontRenderer pfMusicName; + private CCachedFontRenderer pfSubtitle; + private CCachedFontRenderer pfMaker; + private CCachedFontRenderer pfBPM; + private CCachedFontRenderer pfBoxName; + + private string strBoxText; + private CCachedFontRenderer pfBoxText; + private CTexture[] txBoxText = new CTexture[3]; + + + + + + + + private readonly Dictionary _titledictionary + = new Dictionary(); + + private CCachedFontRenderer ft曲リスト用フォント; + //public int n現在のスクロールカウンタ; + private int n現在の選択行; + //private int n目標のスクロールカウンタ; + private CCounter ctScrollCounter; + + /* + private readonly Point[] ptバーの座標 = new Point[] { + new Point(214, -127),new Point(239, -36), new Point(263, 55), new Point(291, 145), + new Point(324, 314), + new Point(358, 485), new Point(386, 574), new Point(411, 665), new Point(436, 756) }; + */ + + private STバー情報[] stバー情報 = new STバー情報[OpenTaiko.Skin.SongSelect_Bar_Count]; + private CTexture txSongNotFound, txEnumeratingSongs; + + private TitleTextureKey ttkSelectedSongTitle; + private TitleTextureKey ttkSelectedSongSubtitle; + public TitleTextureKey ttkSelectedSongBPM; + public TitleTextureKey ttkSelectedSongMaker; + + private CTexture[] tx曲バー_難易度 = new CTexture[5]; + + private int nCurrentPosition = 0; + private int nNumOfItems = 0; + + private int nNowChange; + + private int GetTitleOffsetX(Eバー種別 bar) { + switch (bar) { + case Eバー種別.Score: + return OpenTaiko.Skin.SongSelect_Bar_Title_Offset[0]; + case Eバー種別.Box: + return OpenTaiko.Skin.SongSelect_Bar_Box_Offset[0]; + case Eバー種別.BackBox: + return OpenTaiko.Skin.SongSelect_Bar_BackBox_Offset[0]; + case Eバー種別.Random: + return OpenTaiko.Skin.SongSelect_Bar_Random_Offset[0]; + default: + return OpenTaiko.Skin.SongSelect_Bar_Title_Offset[0]; + } + } + + private int GetTitleOffsetX(CSongListNode.ENodeType node) { + switch (node) { + case CSongListNode.ENodeType.SCORE: + return OpenTaiko.Skin.SongSelect_Bar_Title_Offset[0]; + case CSongListNode.ENodeType.BOX: + return OpenTaiko.Skin.SongSelect_Bar_Box_Offset[0]; + case CSongListNode.ENodeType.BACKBOX: + return OpenTaiko.Skin.SongSelect_Bar_BackBox_Offset[0]; + case CSongListNode.ENodeType.RANDOM: + return OpenTaiko.Skin.SongSelect_Bar_Random_Offset[0]; + default: + return OpenTaiko.Skin.SongSelect_Bar_Title_Offset[0]; + } + } + + private int GetTitleOffsetY(Eバー種別 bar) { + switch (bar) { + case Eバー種別.Score: + return OpenTaiko.Skin.SongSelect_Bar_Title_Offset[1]; + case Eバー種別.Box: + return OpenTaiko.Skin.SongSelect_Bar_Box_Offset[1]; + case Eバー種別.BackBox: + return OpenTaiko.Skin.SongSelect_Bar_BackBox_Offset[1]; + case Eバー種別.Random: + return OpenTaiko.Skin.SongSelect_Bar_Random_Offset[1]; + default: + return OpenTaiko.Skin.SongSelect_Bar_Title_Offset[1]; + } + } + + private int GetTitleOffsetY(CSongListNode.ENodeType node) { + switch (node) { + case CSongListNode.ENodeType.SCORE: + return OpenTaiko.Skin.SongSelect_Bar_Title_Offset[1]; + case CSongListNode.ENodeType.BOX: + return OpenTaiko.Skin.SongSelect_Bar_Box_Offset[1]; + case CSongListNode.ENodeType.BACKBOX: + return OpenTaiko.Skin.SongSelect_Bar_BackBox_Offset[1]; + case CSongListNode.ENodeType.RANDOM: + return OpenTaiko.Skin.SongSelect_Bar_Random_Offset[1]; + default: + return OpenTaiko.Skin.SongSelect_Bar_Title_Offset[1]; + } + } + + private void DrawBarCenter(CTexture texture, int x, int y, int moveX, int move, bool changeColor, bool drawOverlay, bool fullScaleOverlay) { + CTexture overlay = OpenTaiko.Tx.SongSelect_Bar_Genre_Overlay; + + float openAnime = 1; + + if (ctBoxOpen.CurrentValue >= 1300 && ctBoxOpen.CurrentValue <= 1940) { + openAnime -= (float)Math.Sin(((ctBoxOpen.CurrentValue - 1300) * 0.28125f) * (Math.PI / 180)) * 1.0f; + } + + float overlay_xoffset = ((overlay.szTextureSize.Width / 3) * (1.0f - openAnime)); + float moveX_xoffset = (OpenTaiko.Skin.SongSelect_Bar_Center_Move_X * (1.0f - openAnime)); + + int width = overlay.sz画像サイズ.Width / 3; + int height = overlay.sz画像サイズ.Height / 3; + + if (texture != null) { + if (changeColor) { + texture.color4 = CConversion.ColorToColor4(rCurrentlySelectedSong.BoxColor); + } + + float texture_xoffset = ((texture.szTextureSize.Width / 3) * (1.0f - openAnime)); + + texture.vcScaleRatio.X = 1.0f * openAnime; + texture.vcScaleRatio.Y = 1.0f; + texture.t2D描画(x + (texture_xoffset * 1.5f) + moveX_xoffset - moveX, y - move, new Rectangle(0, 0, width, height)); + + texture.vcScaleRatio.X = 1.0f * openAnime; + texture.vcScaleRatio.Y = 1.0f + ((move / (float)height) * 2.0f); + texture.t2D描画(x + (texture_xoffset * 1.5f) + moveX_xoffset - moveX, y + height - move, new Rectangle(0, height, width, height)); + + texture.vcScaleRatio.X = 1.0f * openAnime; + texture.vcScaleRatio.Y = 1.0f; + texture.t2D描画(x + (texture_xoffset * 1.5f) + moveX_xoffset - moveX, y + (height * 2) + move, new Rectangle(0, height * 2, width, height)); + + + texture.vcScaleRatio.X = (1.0f + ((moveX / (float)width) * 2.0f)) * openAnime; + texture.vcScaleRatio.Y = 1.0f; + texture.t2D描画(x + (texture_xoffset / 2) + moveX_xoffset - moveX + width, y - move, new Rectangle(width, 0, width, height)); + + texture.vcScaleRatio.X = (1.0f + ((moveX / (float)width) * 2.0f)) * openAnime; + texture.vcScaleRatio.Y = 1.0f + ((move / (float)height) * 2.0f); + texture.t2D描画(x + (texture_xoffset / 2) + moveX_xoffset - moveX + width, y + height - move, new Rectangle(width, height, width, height)); + + texture.vcScaleRatio.X = (1.0f + ((moveX / (float)width) * 2.0f)) * openAnime; + texture.vcScaleRatio.Y = 1.0f; + texture.t2D描画(x + (texture_xoffset / 2) + moveX_xoffset - moveX + width, y + (height * 2) + move, new Rectangle(width, height * 2, width, height)); + + + texture.vcScaleRatio.X = 1.0f * openAnime; + texture.vcScaleRatio.Y = 1.0f; + texture.t2D描画(x - (texture_xoffset / 2) - moveX_xoffset + moveX + (width * 2), y - move, new Rectangle(width * 2, 0, width, height)); + + texture.vcScaleRatio.X = 1.0f * openAnime; + texture.vcScaleRatio.Y = 1.0f + ((move / (float)height) * 2.0f); + texture.t2D描画(x - (texture_xoffset / 2) - moveX_xoffset + moveX + (width * 2), y + height - move, new Rectangle(width * 2, height, width, height)); + + texture.vcScaleRatio.X = 1.0f * openAnime; + texture.vcScaleRatio.Y = 1.0f; + texture.t2D描画(x - (texture_xoffset / 2) - moveX_xoffset + moveX + (width * 2), y + (height * 2) + move, new Rectangle(width * 2, height * 2, width, height)); + + } + + if (drawOverlay) { + if (fullScaleOverlay) { + overlay.vcScaleRatio.X = 1.0f * openAnime; + overlay.vcScaleRatio.Y = 1.0f; + overlay.t2D描画(x + (overlay_xoffset * 1.5f) + moveX_xoffset - moveX, y - move, new Rectangle(0, 0, width, height)); + + overlay.vcScaleRatio.X = 1.0f * openAnime; + overlay.vcScaleRatio.Y = 1.0f + ((move / (float)height) * 2.0f); + overlay.t2D描画(x + (overlay_xoffset * 1.5f) + moveX_xoffset - moveX, y + height - move, new Rectangle(0, height, width, height)); + } else { + overlay.vcScaleRatio.X = 1.0f * openAnime; + overlay.vcScaleRatio.Y = 1.0f; + overlay.t2D描画(x + (overlay_xoffset * 1.5f) + moveX_xoffset - moveX, y, new Rectangle(0, 0, width, height)); + + overlay.vcScaleRatio.X = 1.0f * openAnime; + overlay.vcScaleRatio.Y = 1.0f + ((move / (float)height) * 1.0f); + overlay.t2D描画(x + (overlay_xoffset * 1.5f) + moveX_xoffset - moveX, y + height, new Rectangle(0, height, width, height)); + } + overlay.vcScaleRatio.X = 1.0f * openAnime; + overlay.vcScaleRatio.Y = 1.0f; + overlay.t2D描画(x + (overlay_xoffset * 1.5f) + moveX_xoffset - moveX, y + (height * 2) + move, new Rectangle(0, height * 2, width, height)); + + + if (fullScaleOverlay) { + overlay.vcScaleRatio.X = (1.0f + ((moveX / (float)width) * 2.0f)) * openAnime; + overlay.vcScaleRatio.Y = 1.0f; + overlay.t2D描画(x + (overlay_xoffset / 2) + moveX_xoffset - moveX + width, y - move, new Rectangle(width, 0, width, height)); + + overlay.vcScaleRatio.X = (1.0f + ((moveX / (float)width) * 2.0f)) * openAnime; + overlay.vcScaleRatio.Y = 1.0f + ((move / (float)height) * 2.0f); + overlay.t2D描画(x + (overlay_xoffset / 2) + moveX_xoffset - moveX + width, y + height - move, new Rectangle(width, height, width, height)); + } else { + overlay.vcScaleRatio.X = (1.0f + ((moveX / (float)width) * 2.0f)) * openAnime; + overlay.vcScaleRatio.Y = 1.0f; + overlay.t2D描画(x + (overlay_xoffset / 2) + moveX_xoffset - moveX + width, y, new Rectangle(width, 0, width, height)); + + overlay.vcScaleRatio.X = (1.0f + ((moveX / (float)width) * 2.0f)) * openAnime; + overlay.vcScaleRatio.Y = 1.0f + ((move / (float)height) * 1.0f); + overlay.t2D描画(x + (overlay_xoffset / 2) + moveX_xoffset - moveX + width, y + height, new Rectangle(width, height, width, height)); + } + overlay.vcScaleRatio.X = (1.0f + ((moveX / (float)width) * 2.0f)) * openAnime; + overlay.vcScaleRatio.Y = 1.0f; + overlay.t2D描画(x + (overlay_xoffset / 2) + moveX_xoffset - moveX + width, y + (height * 2) + move, new Rectangle(width, height * 2, width, height)); + + + if (fullScaleOverlay) { + overlay.vcScaleRatio.X = 1.0f * openAnime; + overlay.vcScaleRatio.Y = 1.0f; + overlay.t2D描画(x - (overlay_xoffset / 2) - moveX_xoffset + moveX + (width * 2), y - move, new Rectangle(width * 2, 0, width, height)); + + overlay.vcScaleRatio.X = 1.0f * openAnime; + overlay.vcScaleRatio.Y = 1.0f + ((move / (float)height) * 2.0f); + overlay.t2D描画(x - (overlay_xoffset / 2) - moveX_xoffset + moveX + (width * 2), y + height - move, new Rectangle(width * 2, height, width, height)); + } else { + overlay.vcScaleRatio.X = 1.0f * openAnime; + overlay.vcScaleRatio.Y = 1.0f; + overlay.t2D描画(x - (overlay_xoffset / 2) - moveX_xoffset + moveX + (width * 2), y, new Rectangle(width * 2, 0, width, height)); + + overlay.vcScaleRatio.X = 1.0f * openAnime; + overlay.vcScaleRatio.Y = 1.0f + ((move / (float)height) * 1.0f); + overlay.t2D描画(x - (overlay_xoffset / 2) - moveX_xoffset + moveX + (width * 2), y + height, new Rectangle(width * 2, height, width, height)); + } + overlay.vcScaleRatio.X = 1.0f * openAnime; + overlay.vcScaleRatio.Y = 1.0f; + overlay.t2D描画(x - (overlay_xoffset / 2) - moveX_xoffset + moveX + (width * 2), y + (height * 2) + move, new Rectangle(width * 2, height * 2, width, height)); + + } + + } + + private Eバー種別 e曲のバー種別を返す(CSongListNode song) { + if (song != null) { + switch (song.eノード種別) { + case CSongListNode.ENodeType.SCORE: + case CSongListNode.ENodeType.SCORE_MIDI: + return Eバー種別.Score; + + case CSongListNode.ENodeType.BOX: + return Eバー種別.Box; + + case CSongListNode.ENodeType.BACKBOX: + return Eバー種別.BackBox; + + case CSongListNode.ENodeType.RANDOM: + return Eバー種別.Random; + } + } + return Eバー種別.Other; + } + private void tChangeSong(int change) { + List list = (OpenTaiko.ConfigIni.TJAP3FolderMode && rCurrentlySelectedSong.rParentNode != null) ? rCurrentlySelectedSong.rParentNode.list子リスト : flattenList(OpenTaiko.Songs管理.list曲ルート, true); + + int index = nSelectSongIndex + change; + + while (index >= list.Count) { + index -= list.Count; + } + while (index < 0) { + index += list.Count; + } + nSelectSongIndex = index; + rCurrentlySelectedSong = list[index]; + + var IsSongLocked = OpenTaiko.Databases.DBSongUnlockables.tIsSongLocked(rCurrentlySelectedSong); + if (IsSongLocked) { + var SongUnlockable = OpenTaiko.Databases.DBSongUnlockables.tGetUnlockableByUniqueId(rCurrentlySelectedSong); + if (SongUnlockable != null) { + string _cond = "???"; + if (HRarity.tRarityToModalInt(SongUnlockable.rarity) + < HRarity.tRarityToModalInt("Epic")) + _cond = SongUnlockable.unlockConditions.tConditionMessage(DBUnlockables.CUnlockConditions.EScreen.SongSelect); + this.ttkNowUnlockConditionText = new TitleTextureKey(_cond, this.pfBoxText, Color.White, Color.Black, 1000); + } + } + } + public CSongListNode rGetSideSong(int change) { + if (rCurrentlySelectedSong == null) return null; + + List list = (OpenTaiko.ConfigIni.TJAP3FolderMode && rCurrentlySelectedSong.rParentNode != null) ? rCurrentlySelectedSong.rParentNode.list子リスト : flattenList(OpenTaiko.Songs管理.list曲ルート, true); + + if (list.Count <= 0) return null; + + int index = nSelectSongIndex + change; + + while (index >= list.Count) { + index -= list.Count; + } + while (index < 0) { + index += list.Count; + } + + var _sideNode = list[index]; + + return _sideNode; + } + + public void tバーの初期化() { + stバー情報 = new STバー情報[OpenTaiko.Skin.SongSelect_Bar_Count]; + + int barCenterNum = (OpenTaiko.Skin.SongSelect_Bar_Count - 1) / 2; + for (int i = 0; i < OpenTaiko.Skin.SongSelect_Bar_Count; i++) { + CSongListNode song = this.rGetSideSong(i - barCenterNum); + if (song == null) continue; + this.stバー情報[i].strタイトル文字列 = song.ldTitle.GetString(""); + this.stバー情報[i].strジャンル = song.strジャンル; + this.stバー情報[i].col文字色 = song.col文字色; + this.stバー情報[i].ForeColor = song.ForeColor; + this.stバー情報[i].BackColor = song.BackColor; + + this.stバー情報[i].BoxColor = song.BoxColor; + this.stバー情報[i].BgColor = song.BgColor; + + this.stバー情報[i].BoxType = song.BoxType; + this.stバー情報[i].BgType = song.BgType; + + this.stバー情報[i].BgTypeChanged = song.isChangedBgType; + this.stバー情報[i].BoxTypeChanged = song.isChangedBoxType; + + this.stバー情報[i].BoxChara = song.BoxChara; + this.stバー情報[i].BoxCharaChanged = song.isChangedBoxChara; + + this.stバー情報[i].eバー種別 = this.e曲のバー種別を返す(song); + this.stバー情報[i].strサブタイトル = song.ldSubtitle.GetString(""); + this.stバー情報[i].ar難易度 = song.nLevel; + this.stバー情報[i].nLevelIcon = song.nLevelIcon; + + for (int f = 0; f < (int)Difficulty.Total; f++) { + if (song.arスコア[f] != null) + this.stバー情報[i].b分岐 = song.arスコア[f].譜面情報.b譜面分岐; + } + + #region [Reroll cases] + + if (stバー情報[i].nクリア == null) + this.stバー情報[i].nクリア = new int[2][]; + if (stバー情報[i].nスコアランク == null) + this.stバー情報[i].nスコアランク = new int[2][]; + + for (int d = 0; d < 2; d++) { + this.stバー情報[i].nクリア[d] = new int[5]; + this.stバー情報[i].nスコアランク[d] = new int[5]; + + if (this.stバー情報[i].eバー種別 == Eバー種別.Score) { + int ap = OpenTaiko.GetActualPlayer(d); + //var sr = song.arスコア[n現在のアンカ難易度レベルに最も近い難易度レベルを返す(song)]; + + var TableEntry = OpenTaiko.SaveFileInstances[ap].data.tGetSongSelectTableEntry(song.tGetUniqueId()); + + this.stバー情報[i].nクリア[d] = TableEntry.ClearStatuses; + this.stバー情報[i].nスコアランク[d] = TableEntry.ScoreRanks; + } + } + + this.stバー情報[i].csu = song.uniqueId; + this.stバー情報[i].reference = song; + + #endregion + + + + for (int j = 0; j < 3; j++) + this.stバー情報[i].nスキル値[j] = (int)song.arスコア[this.n現在のアンカ難易度レベルに最も近い難易度レベルを返す(song)].譜面情報.最大スキル[j]; + + this.stバー情報[i].ttkタイトル = this.ttkGenerateSongNameTexture(this.stバー情報[i].strタイトル文字列, this.stバー情報[i].ForeColor, this.stバー情報[i].BackColor, stバー情報[i].eバー種別 == Eバー種別.Box ? this.pfBoxName : this.pfMusicName); + } + + int _center = (OpenTaiko.Skin.SongSelect_Bar_Count - 1) / 2; + this.n現在の選択行 = _center; + } + + // Song type : 0 - Ensou, 1 - Dan, 2 - Tower + private void tジャンル別選択されていない曲バーの描画( + int x, + int y, + string strジャンル, + Eバー種別 eバー種別, + int[][] クリア, + int[][] スコアランク, + string boxType, + int _songType = 0, + CSongUniqueID csu = null, + CSongListNode reference = null + ) { + if (x >= SampleFramework.GameWindowSize.Width || y >= SampleFramework.GameWindowSize.Height) + return; + + var IsSongLocked = OpenTaiko.Databases.DBSongUnlockables.tIsSongLocked(reference); + var HiddenIndex = OpenTaiko.Databases.DBSongUnlockables.tGetSongHiddenIndex(reference); + + + var rc = new Rectangle(0, 48, 128, 48); + + int opct = 255; + + if (OpenTaiko.stageSongSelect.actDifficultySelectionScreen.bIsDifficltSelect && ctDifficultyIn.CurrentValue >= 1000) + opct = Math.Max((int)255.0f - (ctDifficultyIn.CurrentValue - 1000), 0); + + OpenTaiko.Tx.SongSelect_Crown.Opacity = opct; + OpenTaiko.Tx.SongSelect_ScoreRank.Opacity = opct; + + foreach (var tex in OpenTaiko.Tx.SongSelect_Bar_Genre) { + tex.Value.Opacity = opct; + } + foreach (var tex in OpenTaiko.Tx.SongSelect_Bar_Genre_Overlap) { + tex.Value.Opacity = opct; + } + + OpenTaiko.Tx.SongSelect_Bar_Genre_Back?.tUpdateOpacity(opct); + OpenTaiko.Tx.SongSelect_Bar_Genre_Random?.tUpdateOpacity(opct); + OpenTaiko.Tx.SongSelect_Bar_Genre_Overlay?.tUpdateOpacity(opct); + OpenTaiko.Tx.SongSelect_Favorite?.tUpdateOpacity(opct); + OpenTaiko.Tx.TowerResult_ScoreRankEffect?.tUpdateOpacity(opct); + OpenTaiko.Tx.DanResult_Rank?.tUpdateOpacity(opct); + OpenTaiko.Tx.SongSelect_Level_Number_Big?.tUpdateOpacity(opct); + OpenTaiko.Tx.SongSelect_Level_Number_Big_Colored?.tUpdateOpacity(opct); + OpenTaiko.Tx.SongSelect_Level_Number_Big_Icon?.tUpdateOpacity(opct); + OpenTaiko.Tx.SongSelect_Lock?.tUpdateOpacity(opct); + OpenTaiko.Tx.SongSelect_Bar_Genre_Locked?.tUpdateOpacity(opct); + OpenTaiko.Tx.SongSelect_Bar_Genre_Locked_Top?.tUpdateOpacity(opct); + + for (int i = 0; i < OpenTaiko.Tx.SongSelect_Song_Panel.Length; i++) { + OpenTaiko.Tx.SongSelect_Song_Panel[i]?.tUpdateOpacity(opct); + } + OpenTaiko.Tx.SongSelect_Bpm_Number?.tUpdateOpacity(opct); + if (ttkSelectedSongMaker != null && OpenTaiko.Skin.SongSelect_Maker_Show) { + TitleTextureKey.ResolveTitleTexture(ttkSelectedSongMaker)?.tUpdateOpacity(opct); + } + if (ttkSelectedSongBPM != null && OpenTaiko.Skin.SongSelect_BPM_Text_Show) { + TitleTextureKey.ResolveTitleTexture(ttkSelectedSongBPM)?.tUpdateOpacity(opct); + } + OpenTaiko.Tx.SongSelect_Explicit?.tUpdateOpacity(opct); + OpenTaiko.Tx.SongSelect_Movie?.tUpdateOpacity(opct); + + + if (eバー種別 == Eバー種別.Random) { + OpenTaiko.Tx.SongSelect_Bar_Genre_Random?.t2D描画(x, y); + } else if (eバー種別 != Eバー種別.BackBox) { + if (HiddenIndex >= DBSongUnlockables.EHiddenIndex.GRAYED) { + OpenTaiko.Tx.SongSelect_Bar_Genre_Locked?.t2D描画(x, y); + return; + } else { + HGenreBar.tGetGenreBar(boxType, OpenTaiko.Tx.SongSelect_Bar_Genre)?.t2D描画(x, y); + HGenreBar.tGetGenreBar(boxType, OpenTaiko.Tx.SongSelect_Bar_Genre_Overlap)?.t2D描画(x, y); + OpenTaiko.Tx.SongSelect_Bar_Genre_Overlay?.t2D描画(x, y); + } + } else { + OpenTaiko.Tx.SongSelect_Bar_Genre_Back?.t2D描画(x, y); + } + + if (eバー種別 == Eバー種別.Score) { + if (_songType == 1) { + // displayDanStatus(x + 30, y + 30, Math.Min(クリア[0][0], 6) - 1, 0.2f); + + for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { + if (i >= 2) continue; + + displayDanStatus(x + OpenTaiko.Skin.SongSelect_DanStatus_Offset_X[i], y + OpenTaiko.Skin.SongSelect_DanStatus_Offset_Y[i], Math.Min(クリア[i][0], 6) - 1, 0.2f); + } + } else if (_songType == 2) { + // displayTowerStatus(x + 30, y + 30, Math.Min(クリア[0][0], 6) - 1, 0.2f); + + for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { + if (i >= 2) continue; + + displayTowerStatus(x + OpenTaiko.Skin.SongSelect_TowerStatus_Offset_X[i], y + OpenTaiko.Skin.SongSelect_TowerStatus_Offset_Y[i], Math.Min(クリア[i][0], 7) - 1, 0.3f); } } else { - OpenTaiko.Tx.SongSelect_Bar_Genre_Back?.t2D描画(x, y); - } + // var sr = this.r現在選択中の曲.arスコア[n現在のアンカ難易度レベルに最も近い難易度レベルを返す(this.r現在選択中の曲)]; - if (eバー種別 == Eバー種別.Score) { - if (_songType == 1) { - // displayDanStatus(x + 30, y + 30, Math.Min(クリア[0][0], 6) - 1, 0.2f); + for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { + if (i >= 2) continue; - for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { - if (i >= 2) continue; - - displayDanStatus(x + OpenTaiko.Skin.SongSelect_DanStatus_Offset_X[i], y + OpenTaiko.Skin.SongSelect_DanStatus_Offset_Y[i], Math.Min(クリア[i][0], 6) - 1, 0.2f); - } - } else if (_songType == 2) { - // displayTowerStatus(x + 30, y + 30, Math.Min(クリア[0][0], 6) - 1, 0.2f); - - for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { - if (i >= 2) continue; - - displayTowerStatus(x + OpenTaiko.Skin.SongSelect_TowerStatus_Offset_X[i], y + OpenTaiko.Skin.SongSelect_TowerStatus_Offset_Y[i], Math.Min(クリア[i][0], 7) - 1, 0.3f); - } - } else { - // var sr = this.r現在選択中の曲.arスコア[n現在のアンカ難易度レベルに最も近い難易度レベルを返す(this.r現在選択中の曲)]; - - for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { - if (i >= 2) continue; - - displayRegularCrowns(x + OpenTaiko.Skin.SongSelect_RegularCrowns_Offset_X[i], y + OpenTaiko.Skin.SongSelect_RegularCrowns_Offset_Y[i], クリア[i], スコアランク[i], 0.8f); - } + displayRegularCrowns(x + OpenTaiko.Skin.SongSelect_RegularCrowns_Offset_X[i], y + OpenTaiko.Skin.SongSelect_RegularCrowns_Offset_Y[i], クリア[i], スコアランク[i], 0.8f); } - - if (IsSongLocked) { - displayVisibleLockStatus(x + OpenTaiko.Skin.SongSelect_FavoriteStatus_Offset[0], y + OpenTaiko.Skin.SongSelect_FavoriteStatus_Offset[1], 1f); - } else { - displayFavoriteStatus(x + OpenTaiko.Skin.SongSelect_FavoriteStatus_Offset[0], y + OpenTaiko.Skin.SongSelect_FavoriteStatus_Offset[1], csu, 1f); - } - - tPrintLevelNumberBig( - x + OpenTaiko.Skin.SongSelect_Level_Offset[0], - y + OpenTaiko.Skin.SongSelect_Level_Offset[1], - reference - ); } + + if (IsSongLocked) { + displayVisibleLockStatus(x + OpenTaiko.Skin.SongSelect_FavoriteStatus_Offset[0], y + OpenTaiko.Skin.SongSelect_FavoriteStatus_Offset[1], 1f); + } else { + displayFavoriteStatus(x + OpenTaiko.Skin.SongSelect_FavoriteStatus_Offset[0], y + OpenTaiko.Skin.SongSelect_FavoriteStatus_Offset[1], csu, 1f); + } + + tPrintLevelNumberBig( + x + OpenTaiko.Skin.SongSelect_Level_Offset[0], + y + OpenTaiko.Skin.SongSelect_Level_Offset[1], + reference + ); + } + } + + public void displayTowerStatus(int x, int y, int grade, float _resize) { + if (grade >= 0 && OpenTaiko.Tx.TowerResult_ScoreRankEffect != null) { + int scoreRankEffect_width = OpenTaiko.Tx.TowerResult_ScoreRankEffect.szTextureSize.Width / 7; + int scoreRankEffect_height = OpenTaiko.Tx.TowerResult_ScoreRankEffect.szTextureSize.Height; + + //TJAPlayer3.Tx.TowerResult_ScoreRankEffect.Opacity = 255; + OpenTaiko.Tx.TowerResult_ScoreRankEffect.vcScaleRatio.X = _resize; + OpenTaiko.Tx.TowerResult_ScoreRankEffect.vcScaleRatio.Y = _resize; + OpenTaiko.Tx.TowerResult_ScoreRankEffect.t2D拡大率考慮中央基準描画(x, y, new Rectangle(grade * scoreRankEffect_width, 0, scoreRankEffect_width, scoreRankEffect_height)); + OpenTaiko.Tx.TowerResult_ScoreRankEffect.vcScaleRatio.X = 1f; + OpenTaiko.Tx.TowerResult_ScoreRankEffect.vcScaleRatio.Y = 1f; + } + } + + public void displayDanStatus(int x, int y, int grade, float _resize) { + if (grade >= 0 && OpenTaiko.Tx.DanResult_Rank != null) { + int danResult_rank_width = OpenTaiko.Tx.DanResult_Rank.szTextureSize.Width / 7; + int danResult_rank_height = OpenTaiko.Tx.DanResult_Rank.szTextureSize.Height; + + //TJAPlayer3.Tx.DanResult_Rank.Opacity = 255; + OpenTaiko.Tx.DanResult_Rank.vcScaleRatio.X = _resize; + OpenTaiko.Tx.DanResult_Rank.vcScaleRatio.Y = _resize; + OpenTaiko.Tx.DanResult_Rank.t2D拡大率考慮中央基準描画(x, y, new Rectangle(danResult_rank_width * (grade + 1), 0, danResult_rank_width, danResult_rank_height)); + OpenTaiko.Tx.DanResult_Rank.vcScaleRatio.X = 1f; + OpenTaiko.Tx.DanResult_Rank.vcScaleRatio.Y = 1f; + } + } + + public void displayRegularCrowns(int x, int y, int[] クリア, int[] スコアランク, float _resize) { + // Don't display if one of the 2 textures is missing (to avoid crashes) + if (OpenTaiko.Tx.SongSelect_Crown == null || OpenTaiko.Tx.SongSelect_ScoreRank == null) + return; + + // To change to include all crowns/score ranks later + + OpenTaiko.Tx.SongSelect_Crown.vcScaleRatio.X = _resize; + OpenTaiko.Tx.SongSelect_Crown.vcScaleRatio.Y = _resize; + OpenTaiko.Tx.SongSelect_ScoreRank.vcScaleRatio.X = _resize; + OpenTaiko.Tx.SongSelect_ScoreRank.vcScaleRatio.Y = _resize; + + int bestCrown = -1; + int bestScoreRank = -1; + + for (int i = 0; i <= (int)Difficulty.Edit; i++) { + if (クリア[i] > 0) + bestCrown = i; + if (スコアランク[i] > 0) + bestScoreRank = i; } - public void displayTowerStatus(int x, int y, int grade, float _resize) { - if (grade >= 0 && OpenTaiko.Tx.TowerResult_ScoreRankEffect != null) { - int scoreRankEffect_width = OpenTaiko.Tx.TowerResult_ScoreRankEffect.szTextureSize.Width / 7; - int scoreRankEffect_height = OpenTaiko.Tx.TowerResult_ScoreRankEffect.szTextureSize.Height; - - //TJAPlayer3.Tx.TowerResult_ScoreRankEffect.Opacity = 255; - OpenTaiko.Tx.TowerResult_ScoreRankEffect.vcScaleRatio.X = _resize; - OpenTaiko.Tx.TowerResult_ScoreRankEffect.vcScaleRatio.Y = _resize; - OpenTaiko.Tx.TowerResult_ScoreRankEffect.t2D拡大率考慮中央基準描画(x, y, new Rectangle(grade * scoreRankEffect_width, 0, scoreRankEffect_width, scoreRankEffect_height)); - OpenTaiko.Tx.TowerResult_ScoreRankEffect.vcScaleRatio.X = 1f; - OpenTaiko.Tx.TowerResult_ScoreRankEffect.vcScaleRatio.Y = 1f; - } + if (bestCrown >= 0) { + float width = OpenTaiko.Tx.SongSelect_Crown.szTextureSize.Width / 4.0f; + int height = OpenTaiko.Tx.SongSelect_Crown.szTextureSize.Height; + OpenTaiko.Tx.SongSelect_Crown?.t2D拡大率考慮中央基準描画(x + OpenTaiko.Skin.SongSelect_RegularCrowns_ScoreRank_Offset_X[0], y + OpenTaiko.Skin.SongSelect_RegularCrowns_ScoreRank_Offset_Y[0], + new RectangleF((クリア[bestCrown] - 1) * width, 0, width, height)); } - public void displayDanStatus(int x, int y, int grade, float _resize) { - if (grade >= 0 && OpenTaiko.Tx.DanResult_Rank != null) { - int danResult_rank_width = OpenTaiko.Tx.DanResult_Rank.szTextureSize.Width / 7; - int danResult_rank_height = OpenTaiko.Tx.DanResult_Rank.szTextureSize.Height; - - //TJAPlayer3.Tx.DanResult_Rank.Opacity = 255; - OpenTaiko.Tx.DanResult_Rank.vcScaleRatio.X = _resize; - OpenTaiko.Tx.DanResult_Rank.vcScaleRatio.Y = _resize; - OpenTaiko.Tx.DanResult_Rank.t2D拡大率考慮中央基準描画(x, y, new Rectangle(danResult_rank_width * (grade + 1), 0, danResult_rank_width, danResult_rank_height)); - OpenTaiko.Tx.DanResult_Rank.vcScaleRatio.X = 1f; - OpenTaiko.Tx.DanResult_Rank.vcScaleRatio.Y = 1f; - } + if (bestScoreRank >= 0) { + int width = OpenTaiko.Tx.SongSelect_ScoreRank.szTextureSize.Width; + float height = OpenTaiko.Tx.SongSelect_ScoreRank.szTextureSize.Height / 7.0f; + OpenTaiko.Tx.SongSelect_ScoreRank?.t2D拡大率考慮中央基準描画(x + OpenTaiko.Skin.SongSelect_RegularCrowns_ScoreRank_Offset_X[1], y + OpenTaiko.Skin.SongSelect_RegularCrowns_ScoreRank_Offset_Y[1], + new RectangleF(0, (スコアランク[bestScoreRank] - 1) * height, width, height)); } - public void displayRegularCrowns(int x, int y, int[] クリア, int[] スコアランク, float _resize) { - // Don't display if one of the 2 textures is missing (to avoid crashes) - if (OpenTaiko.Tx.SongSelect_Crown == null || OpenTaiko.Tx.SongSelect_ScoreRank == null) - return; + if (OpenTaiko.Tx.Dani_Difficulty_Cymbol != null) { + int dani_difficulty_cymbol_width = OpenTaiko.Tx.Dani_Difficulty_Cymbol.szTextureSize.Width / 5; + int dani_difficulty_cymbol_height = OpenTaiko.Tx.Dani_Difficulty_Cymbol.szTextureSize.Height; - // To change to include all crowns/score ranks later - - OpenTaiko.Tx.SongSelect_Crown.vcScaleRatio.X = _resize; - OpenTaiko.Tx.SongSelect_Crown.vcScaleRatio.Y = _resize; - OpenTaiko.Tx.SongSelect_ScoreRank.vcScaleRatio.X = _resize; - OpenTaiko.Tx.SongSelect_ScoreRank.vcScaleRatio.Y = _resize; - - int bestCrown = -1; - int bestScoreRank = -1; - - for (int i = 0; i <= (int)Difficulty.Edit; i++) { - if (クリア[i] > 0) - bestCrown = i; - if (スコアランク[i] > 0) - bestScoreRank = i; - } + OpenTaiko.Tx.Dani_Difficulty_Cymbol.Opacity = OpenTaiko.Tx.SongSelect_Favorite.Opacity; + OpenTaiko.Tx.Dani_Difficulty_Cymbol.vcScaleRatio.X = 0.5f; + OpenTaiko.Tx.Dani_Difficulty_Cymbol.vcScaleRatio.Y = 0.5f; if (bestCrown >= 0) { - float width = OpenTaiko.Tx.SongSelect_Crown.szTextureSize.Width / 4.0f; - int height = OpenTaiko.Tx.SongSelect_Crown.szTextureSize.Height; - OpenTaiko.Tx.SongSelect_Crown?.t2D拡大率考慮中央基準描画(x + OpenTaiko.Skin.SongSelect_RegularCrowns_ScoreRank_Offset_X[0], y + OpenTaiko.Skin.SongSelect_RegularCrowns_ScoreRank_Offset_Y[0], - new RectangleF((クリア[bestCrown] - 1) * width, 0, width, height)); + OpenTaiko.Tx.Dani_Difficulty_Cymbol.t2D中心基準描画( + x + OpenTaiko.Skin.SongSelect_RegularCrowns_Difficulty_Cymbol_Offset_X[0], + y + OpenTaiko.Skin.SongSelect_RegularCrowns_Difficulty_Cymbol_Offset_Y[0], + new Rectangle(bestCrown * dani_difficulty_cymbol_width, 0, dani_difficulty_cymbol_width, dani_difficulty_cymbol_height)); } if (bestScoreRank >= 0) { - int width = OpenTaiko.Tx.SongSelect_ScoreRank.szTextureSize.Width; - float height = OpenTaiko.Tx.SongSelect_ScoreRank.szTextureSize.Height / 7.0f; - OpenTaiko.Tx.SongSelect_ScoreRank?.t2D拡大率考慮中央基準描画(x + OpenTaiko.Skin.SongSelect_RegularCrowns_ScoreRank_Offset_X[1], y + OpenTaiko.Skin.SongSelect_RegularCrowns_ScoreRank_Offset_Y[1], - new RectangleF(0, (スコアランク[bestScoreRank] - 1) * height, width, height)); + OpenTaiko.Tx.Dani_Difficulty_Cymbol.t2D中心基準描画( + x + OpenTaiko.Skin.SongSelect_RegularCrowns_Difficulty_Cymbol_Offset_X[1], + y + OpenTaiko.Skin.SongSelect_RegularCrowns_Difficulty_Cymbol_Offset_Y[1], + new Rectangle(bestScoreRank * dani_difficulty_cymbol_width, 0, dani_difficulty_cymbol_width, dani_difficulty_cymbol_height)); } - if (OpenTaiko.Tx.Dani_Difficulty_Cymbol != null) { - int dani_difficulty_cymbol_width = OpenTaiko.Tx.Dani_Difficulty_Cymbol.szTextureSize.Width / 5; - int dani_difficulty_cymbol_height = OpenTaiko.Tx.Dani_Difficulty_Cymbol.szTextureSize.Height; - - OpenTaiko.Tx.Dani_Difficulty_Cymbol.Opacity = OpenTaiko.Tx.SongSelect_Favorite.Opacity; - OpenTaiko.Tx.Dani_Difficulty_Cymbol.vcScaleRatio.X = 0.5f; - OpenTaiko.Tx.Dani_Difficulty_Cymbol.vcScaleRatio.Y = 0.5f; - - if (bestCrown >= 0) { - OpenTaiko.Tx.Dani_Difficulty_Cymbol.t2D中心基準描画( - x + OpenTaiko.Skin.SongSelect_RegularCrowns_Difficulty_Cymbol_Offset_X[0], - y + OpenTaiko.Skin.SongSelect_RegularCrowns_Difficulty_Cymbol_Offset_Y[0], - new Rectangle(bestCrown * dani_difficulty_cymbol_width, 0, dani_difficulty_cymbol_width, dani_difficulty_cymbol_height)); - } - - if (bestScoreRank >= 0) { - OpenTaiko.Tx.Dani_Difficulty_Cymbol.t2D中心基準描画( - x + OpenTaiko.Skin.SongSelect_RegularCrowns_Difficulty_Cymbol_Offset_X[1], - y + OpenTaiko.Skin.SongSelect_RegularCrowns_Difficulty_Cymbol_Offset_Y[1], - new Rectangle(bestScoreRank * dani_difficulty_cymbol_width, 0, dani_difficulty_cymbol_width, dani_difficulty_cymbol_height)); - } - - OpenTaiko.Tx.Dani_Difficulty_Cymbol.Opacity = 255; - OpenTaiko.Tx.Dani_Difficulty_Cymbol.vcScaleRatio.X = 1f; - OpenTaiko.Tx.Dani_Difficulty_Cymbol.vcScaleRatio.Y = 1f; - } - - - } - - public void displayFavoriteStatus(int x, int y, CSongUniqueID csu, float _resize) { - if (csu != null - && OpenTaiko.Tx.SongSelect_Favorite != null - && OpenTaiko.Favorites.tIsFavorite(csu.data.id)) { - OpenTaiko.Tx.SongSelect_Favorite.vcScaleRatio.X = _resize; - OpenTaiko.Tx.SongSelect_Favorite.vcScaleRatio.Y = _resize; - OpenTaiko.Tx.SongSelect_Favorite.t2D拡大率考慮中央基準描画(x, y); - } - } - - public void displayVisibleLockStatus(int x, int y, float _resize) { - if (OpenTaiko.Tx.SongSelect_Lock != null) { - OpenTaiko.Tx.SongSelect_Lock.vcScaleRatio.X = _resize; - OpenTaiko.Tx.SongSelect_Lock.vcScaleRatio.Y = _resize; - OpenTaiko.Tx.SongSelect_Lock.t2D拡大率考慮中央基準描画(x, y); - } - } - - private TitleTextureKey ttkGenerateSongNameTexture(string str文字, Color forecolor, Color backcolor, CCachedFontRenderer pf) { - return new TitleTextureKey(str文字, pf, forecolor, backcolor, OpenTaiko.Skin.SongSelect_Title_MaxSize); - } - - private TitleTextureKey ttkGenerateSubtitleTexture(string str文字, Color forecolor, Color backcolor) { - return new TitleTextureKey(str文字, pfSubtitle, forecolor, backcolor, OpenTaiko.Skin.SongSelect_SubTitle_MaxSize); - } - - private TitleTextureKey ttkGenerateMakerTexture(string str文字, Color forecolor, Color backcolor) { - return new TitleTextureKey(CLangManager.LangInstance.GetString("SONGSELECT_INFO_CHARTER", str文字), pfMaker, forecolor, backcolor, OpenTaiko.Skin.SongSelect_Maker_MaxSize); - } - - private TitleTextureKey ttkGenerateBPMTexture(CSongListNode node, Color forecolor, Color backcolor) { - var _score = node.arスコア[tFetchDifficulty(node)].譜面情報; - var _speed = OpenTaiko.ConfigIni.SongPlaybackSpeed; - - double[] bpms = new double[3] { - _score.BaseBpm * _speed, - _score.MinBpm * _speed, - _score.MaxBpm * _speed - }; - - string bpm_str = CLangManager.LangInstance.GetString("SONGSELECT_INFO_BPM", bpms[0]); - if (bpms[1] != bpms[0] || bpms[2] != bpms[0]) - bpm_str = CLangManager.LangInstance.GetString("SONGSELECT_INFO_BPM_VARIABLE", bpms[0], bpms[1], bpms[2]); - - var _color = forecolor; - if (_speed > 1) - _color = Color.Red; - else if (_speed < 1) - _color = Color.LightBlue; - - return new TitleTextureKey(bpm_str, pfBPM, _color, backcolor, OpenTaiko.Skin.SongSelect_BPM_Text_MaxSize); + OpenTaiko.Tx.Dani_Difficulty_Cymbol.Opacity = 255; + OpenTaiko.Tx.Dani_Difficulty_Cymbol.vcScaleRatio.X = 1f; + OpenTaiko.Tx.Dani_Difficulty_Cymbol.vcScaleRatio.Y = 1f; } - private void tResetTitleTextureKey() { - if (this.ttkSelectedSongTitle != null) { - this.ttkSelectedSongTitle = null; - this.b選択曲が変更された = false; - } - if (this.ttkSelectedSongSubtitle != null) { - this.ttkSelectedSongSubtitle = null; - this.b選択曲が変更された = false; - } - if (this.ttkSelectedSongMaker != null) { - this.ttkSelectedSongMaker = null; - this.b選択曲が変更された = false; - } - if (this.ttkSelectedSongBPM != null) { - this.ttkSelectedSongBPM = null; - this.b選択曲が変更された = false; - } - } - - public void tDisplayLevelIcon(int x, int y, CDTX.ELevelIcon icon, CTexture iconTex = null) { - var _tex = (iconTex != null) ? iconTex : OpenTaiko.Tx.SongSelect_Level_Number_Big_Icon; - if (icon != CDTX.ELevelIcon.eNone && - _tex != null) { - var __width = _tex.sz画像サイズ.Width / 3; - var __height = _tex.sz画像サイズ.Height; - _tex.t2D_DisplayImage_AnchorUpRight( - - x, - y, - new Rectangle(__width * (int)icon, 0, __width, __height) - ); - } - } - - private void t小文字表示(int x, int y, int num, int diff, CDTX.ELevelIcon icon) { - int[] nums = CConversion.SeparateDigits(num); - float[] icon_coords = new float[2] { -999, -999 }; - for (int j = 0; j < nums.Length; j++) { - float offset = j - (nums.Length / 2.0f); - float _x = x - (OpenTaiko.Skin.SongSelect_Level_Number_Interval[0] * offset); - float _y = y - (OpenTaiko.Skin.SongSelect_Level_Number_Interval[1] * offset); - - float width = OpenTaiko.Tx.SongSelect_Level_Number.sz画像サイズ.Width / 10.0f; - float height = OpenTaiko.Tx.SongSelect_Level_Number.sz画像サイズ.Height; - - var _expand_ratio = 1.0f / (1.0f + (0.25f * (nums.Length - 1))); - OpenTaiko.Tx.SongSelect_Level_Number.vcScaleRatio.X = _expand_ratio; - - icon_coords[0] = Math.Max(icon_coords[0], _x + width * _expand_ratio); - icon_coords[1] = _y; - - OpenTaiko.Tx.SongSelect_Level_Number.t2D描画(_x, _y, new RectangleF(width * nums[j], 0, width, height)); - - if (OpenTaiko.Tx.SongSelect_Level_Number_Colored != null) { - OpenTaiko.Tx.SongSelect_Level_Number_Colored.vcScaleRatio.X = _expand_ratio; - OpenTaiko.Tx.SongSelect_Level_Number_Colored.color4 = CConversion.ColorToColor4(OpenTaiko.Skin.SongSelect_Difficulty_Colors[diff]); - OpenTaiko.Tx.SongSelect_Level_Number_Colored.t2D描画(_x, _y, new RectangleF(width * nums[j], 0, width, height)); - } - } - tDisplayLevelIcon((int)icon_coords[0], (int)icon_coords[1], icon, OpenTaiko.Tx.SongSelect_Level_Number_Icon); - } - - public void tPrintLevelNumberBig(int x, int y, CSongListNode song) { - if (song == null) return; - int difficulty = tFetchDifficulty(song); - int num = song.nLevel[difficulty]; - var icon = song.nLevelIcon[difficulty]; - - if (OpenTaiko.Tx.SongSelect_Level_Number_Big == null || num < 0) return; - int[] nums = CConversion.SeparateDigits(num); - float _ratio = 1f; - float[] icon_coords = new float[2] { -999, -999 }; - if (OpenTaiko.Tx.SongSelect_Level_Number != null) { - _ratio = OpenTaiko.Tx.SongSelect_Level_Number_Big.szTextureSize.Width / OpenTaiko.Tx.SongSelect_Level_Number.szTextureSize.Width; - } - for (int j = 0; j < nums.Length; j++) { - float offset = j - (nums.Length / 2.0f); - float _x = x - (OpenTaiko.Skin.SongSelect_Level_Number_Interval[0] * offset * _ratio); - float _y = y - (OpenTaiko.Skin.SongSelect_Level_Number_Interval[1] * offset); - - float width = OpenTaiko.Tx.SongSelect_Level_Number_Big.sz画像サイズ.Width / 10.0f; - float height = OpenTaiko.Tx.SongSelect_Level_Number_Big.sz画像サイズ.Height; - - var _expand_ratio = 1.0f / (1.0f + (0.25f * (nums.Length - 1))); - OpenTaiko.Tx.SongSelect_Level_Number_Big.vcScaleRatio.X = _expand_ratio; - OpenTaiko.Tx.SongSelect_Level_Number_Big.t2D描画(_x, _y, new RectangleF(width * nums[j], 0, width, height)); - - icon_coords[0] = Math.Max(icon_coords[0], _x + width * _expand_ratio); - icon_coords[1] = _y; - - if (OpenTaiko.Tx.SongSelect_Level_Number_Big_Colored != null) { - OpenTaiko.Tx.SongSelect_Level_Number_Big_Colored.vcScaleRatio.X = _expand_ratio; - OpenTaiko.Tx.SongSelect_Level_Number_Big_Colored.color4 = CConversion.ColorToColor4(OpenTaiko.Skin.SongSelect_Difficulty_Colors[difficulty]); - OpenTaiko.Tx.SongSelect_Level_Number_Big_Colored.t2D描画(_x, _y, new RectangleF(width * nums[j], 0, width, height)); - } - - } - tDisplayLevelIcon((int)icon_coords[0], (int)icon_coords[1], icon); - - } - - public int tFetchDifficulty(CSongListNode song) { - var closest = this.n現在のアンカ難易度レベルに最も近い難易度レベルを返す(song); - int defaultTable = Math.Max(0, Math.Min((int)Difficulty.Edit + 1, OpenTaiko.ConfigIni.nDefaultCourse)); - - if (song.arスコア[defaultTable] == null) - return closest; - return defaultTable; - } - - //----------------- - #endregion } - public enum eMenuContext { - NONE, - SearchByDifficulty, - Random, + public void displayFavoriteStatus(int x, int y, CSongUniqueID csu, float _resize) { + if (csu != null + && OpenTaiko.Tx.SongSelect_Favorite != null + && OpenTaiko.Favorites.tIsFavorite(csu.data.id)) { + OpenTaiko.Tx.SongSelect_Favorite.vcScaleRatio.X = _resize; + OpenTaiko.Tx.SongSelect_Favorite.vcScaleRatio.Y = _resize; + OpenTaiko.Tx.SongSelect_Favorite.t2D拡大率考慮中央基準描画(x, y); + } } - public enum eLayoutType { - DiagonalUpDown, - Vertical, - DiagonalDownUp, - HalfCircleRight, - HalfCircleLeft, - TOTAL + public void displayVisibleLockStatus(int x, int y, float _resize) { + if (OpenTaiko.Tx.SongSelect_Lock != null) { + OpenTaiko.Tx.SongSelect_Lock.vcScaleRatio.X = _resize; + OpenTaiko.Tx.SongSelect_Lock.vcScaleRatio.Y = _resize; + OpenTaiko.Tx.SongSelect_Lock.t2D拡大率考慮中央基準描画(x, y); + } } + + private TitleTextureKey ttkGenerateSongNameTexture(string str文字, Color forecolor, Color backcolor, CCachedFontRenderer pf) { + return new TitleTextureKey(str文字, pf, forecolor, backcolor, OpenTaiko.Skin.SongSelect_Title_MaxSize); + } + + private TitleTextureKey ttkGenerateSubtitleTexture(string str文字, Color forecolor, Color backcolor) { + return new TitleTextureKey(str文字, pfSubtitle, forecolor, backcolor, OpenTaiko.Skin.SongSelect_SubTitle_MaxSize); + } + + private TitleTextureKey ttkGenerateMakerTexture(string str文字, Color forecolor, Color backcolor) { + return new TitleTextureKey(CLangManager.LangInstance.GetString("SONGSELECT_INFO_CHARTER", str文字), pfMaker, forecolor, backcolor, OpenTaiko.Skin.SongSelect_Maker_MaxSize); + } + + private TitleTextureKey ttkGenerateBPMTexture(CSongListNode node, Color forecolor, Color backcolor) { + var _score = node.arスコア[tFetchDifficulty(node)].譜面情報; + var _speed = OpenTaiko.ConfigIni.SongPlaybackSpeed; + + double[] bpms = new double[3] { + _score.BaseBpm * _speed, + _score.MinBpm * _speed, + _score.MaxBpm * _speed + }; + + string bpm_str = CLangManager.LangInstance.GetString("SONGSELECT_INFO_BPM", bpms[0]); + if (bpms[1] != bpms[0] || bpms[2] != bpms[0]) + bpm_str = CLangManager.LangInstance.GetString("SONGSELECT_INFO_BPM_VARIABLE", bpms[0], bpms[1], bpms[2]); + + var _color = forecolor; + if (_speed > 1) + _color = Color.Red; + else if (_speed < 1) + _color = Color.LightBlue; + + return new TitleTextureKey(bpm_str, pfBPM, _color, backcolor, OpenTaiko.Skin.SongSelect_BPM_Text_MaxSize); + } + + + private void tResetTitleTextureKey() { + if (this.ttkSelectedSongTitle != null) { + this.ttkSelectedSongTitle = null; + this.b選択曲が変更された = false; + } + if (this.ttkSelectedSongSubtitle != null) { + this.ttkSelectedSongSubtitle = null; + this.b選択曲が変更された = false; + } + if (this.ttkSelectedSongMaker != null) { + this.ttkSelectedSongMaker = null; + this.b選択曲が変更された = false; + } + if (this.ttkSelectedSongBPM != null) { + this.ttkSelectedSongBPM = null; + this.b選択曲が変更された = false; + } + } + + public void tDisplayLevelIcon(int x, int y, CDTX.ELevelIcon icon, CTexture iconTex = null) { + var _tex = (iconTex != null) ? iconTex : OpenTaiko.Tx.SongSelect_Level_Number_Big_Icon; + if (icon != CDTX.ELevelIcon.eNone && + _tex != null) { + var __width = _tex.sz画像サイズ.Width / 3; + var __height = _tex.sz画像サイズ.Height; + _tex.t2D_DisplayImage_AnchorUpRight( + + x, + y, + new Rectangle(__width * (int)icon, 0, __width, __height) + ); + } + } + + private void t小文字表示(int x, int y, int num, int diff, CDTX.ELevelIcon icon) { + int[] nums = CConversion.SeparateDigits(num); + float[] icon_coords = new float[2] { -999, -999 }; + for (int j = 0; j < nums.Length; j++) { + float offset = j - (nums.Length / 2.0f); + float _x = x - (OpenTaiko.Skin.SongSelect_Level_Number_Interval[0] * offset); + float _y = y - (OpenTaiko.Skin.SongSelect_Level_Number_Interval[1] * offset); + + float width = OpenTaiko.Tx.SongSelect_Level_Number.sz画像サイズ.Width / 10.0f; + float height = OpenTaiko.Tx.SongSelect_Level_Number.sz画像サイズ.Height; + + var _expand_ratio = 1.0f / (1.0f + (0.25f * (nums.Length - 1))); + OpenTaiko.Tx.SongSelect_Level_Number.vcScaleRatio.X = _expand_ratio; + + icon_coords[0] = Math.Max(icon_coords[0], _x + width * _expand_ratio); + icon_coords[1] = _y; + + OpenTaiko.Tx.SongSelect_Level_Number.t2D描画(_x, _y, new RectangleF(width * nums[j], 0, width, height)); + + if (OpenTaiko.Tx.SongSelect_Level_Number_Colored != null) { + OpenTaiko.Tx.SongSelect_Level_Number_Colored.vcScaleRatio.X = _expand_ratio; + OpenTaiko.Tx.SongSelect_Level_Number_Colored.color4 = CConversion.ColorToColor4(OpenTaiko.Skin.SongSelect_Difficulty_Colors[diff]); + OpenTaiko.Tx.SongSelect_Level_Number_Colored.t2D描画(_x, _y, new RectangleF(width * nums[j], 0, width, height)); + } + } + tDisplayLevelIcon((int)icon_coords[0], (int)icon_coords[1], icon, OpenTaiko.Tx.SongSelect_Level_Number_Icon); + } + + public void tPrintLevelNumberBig(int x, int y, CSongListNode song) { + if (song == null) return; + int difficulty = tFetchDifficulty(song); + int num = song.nLevel[difficulty]; + var icon = song.nLevelIcon[difficulty]; + + if (OpenTaiko.Tx.SongSelect_Level_Number_Big == null || num < 0) return; + int[] nums = CConversion.SeparateDigits(num); + float _ratio = 1f; + float[] icon_coords = new float[2] { -999, -999 }; + if (OpenTaiko.Tx.SongSelect_Level_Number != null) { + _ratio = OpenTaiko.Tx.SongSelect_Level_Number_Big.szTextureSize.Width / OpenTaiko.Tx.SongSelect_Level_Number.szTextureSize.Width; + } + for (int j = 0; j < nums.Length; j++) { + float offset = j - (nums.Length / 2.0f); + float _x = x - (OpenTaiko.Skin.SongSelect_Level_Number_Interval[0] * offset * _ratio); + float _y = y - (OpenTaiko.Skin.SongSelect_Level_Number_Interval[1] * offset); + + float width = OpenTaiko.Tx.SongSelect_Level_Number_Big.sz画像サイズ.Width / 10.0f; + float height = OpenTaiko.Tx.SongSelect_Level_Number_Big.sz画像サイズ.Height; + + var _expand_ratio = 1.0f / (1.0f + (0.25f * (nums.Length - 1))); + OpenTaiko.Tx.SongSelect_Level_Number_Big.vcScaleRatio.X = _expand_ratio; + OpenTaiko.Tx.SongSelect_Level_Number_Big.t2D描画(_x, _y, new RectangleF(width * nums[j], 0, width, height)); + + icon_coords[0] = Math.Max(icon_coords[0], _x + width * _expand_ratio); + icon_coords[1] = _y; + + if (OpenTaiko.Tx.SongSelect_Level_Number_Big_Colored != null) { + OpenTaiko.Tx.SongSelect_Level_Number_Big_Colored.vcScaleRatio.X = _expand_ratio; + OpenTaiko.Tx.SongSelect_Level_Number_Big_Colored.color4 = CConversion.ColorToColor4(OpenTaiko.Skin.SongSelect_Difficulty_Colors[difficulty]); + OpenTaiko.Tx.SongSelect_Level_Number_Big_Colored.t2D描画(_x, _y, new RectangleF(width * nums[j], 0, width, height)); + } + + } + tDisplayLevelIcon((int)icon_coords[0], (int)icon_coords[1], icon); + + } + + public int tFetchDifficulty(CSongListNode song) { + var closest = this.n現在のアンカ難易度レベルに最も近い難易度レベルを返す(song); + int defaultTable = Math.Max(0, Math.Min((int)Difficulty.Edit + 1, OpenTaiko.ConfigIni.nDefaultCourse)); + + if (song.arスコア[defaultTable] == null) + return closest; + return defaultTable; + } + + //----------------- + #endregion +} + +public enum eMenuContext { + NONE, + SearchByDifficulty, + Random, +} + +public enum eLayoutType { + DiagonalUpDown, + Vertical, + DiagonalDownUp, + HalfCircleRight, + HalfCircleLeft, + TOTAL } diff --git a/OpenTaiko/src/Stages/05.SongSelect/CActSelect演奏履歴パネル.cs b/OpenTaiko/src/Stages/05.SongSelect/CActSelect演奏履歴パネル.cs index 0033e50c..9aef5f06 100644 --- a/OpenTaiko/src/Stages/05.SongSelect/CActSelect演奏履歴パネル.cs +++ b/OpenTaiko/src/Stages/05.SongSelect/CActSelect演奏履歴パネル.cs @@ -7,183 +7,183 @@ using Color = System.Drawing.Color; using Point = System.Drawing.Point; using Rectangle = System.Drawing.Rectangle; -namespace OpenTaiko { - internal class CActSelect演奏履歴パネル : CActivity { - // メソッド +namespace OpenTaiko; - public CActSelect演奏履歴パネル() { - ST文字位置[] st文字位置Array = new ST文字位置[10]; +internal class CActSelect演奏履歴パネル : CActivity { + // メソッド - ST文字位置 st文字位置 = new ST文字位置(); - st文字位置.ch = '0'; - st文字位置.pt = new Point(0, 0); - st文字位置Array[0] = st文字位置; - ST文字位置 st文字位置2 = new ST文字位置(); - st文字位置2.ch = '1'; - st文字位置2.pt = new Point(26, 0); - st文字位置Array[1] = st文字位置2; - ST文字位置 st文字位置3 = new ST文字位置(); - st文字位置3.ch = '2'; - st文字位置3.pt = new Point(52, 0); - st文字位置Array[2] = st文字位置3; - ST文字位置 st文字位置4 = new ST文字位置(); - st文字位置4.ch = '3'; - st文字位置4.pt = new Point(78, 0); - st文字位置Array[3] = st文字位置4; - ST文字位置 st文字位置5 = new ST文字位置(); - st文字位置5.ch = '4'; - st文字位置5.pt = new Point(104, 0); - st文字位置Array[4] = st文字位置5; - ST文字位置 st文字位置6 = new ST文字位置(); - st文字位置6.ch = '5'; - st文字位置6.pt = new Point(130, 0); - st文字位置Array[5] = st文字位置6; - ST文字位置 st文字位置7 = new ST文字位置(); - st文字位置7.ch = '6'; - st文字位置7.pt = new Point(156, 0); - st文字位置Array[6] = st文字位置7; - ST文字位置 st文字位置8 = new ST文字位置(); - st文字位置8.ch = '7'; - st文字位置8.pt = new Point(182, 0); - st文字位置Array[7] = st文字位置8; - ST文字位置 st文字位置9 = new ST文字位置(); - st文字位置9.ch = '8'; - st文字位置9.pt = new Point(208, 0); - st文字位置Array[8] = st文字位置9; - ST文字位置 st文字位置10 = new ST文字位置(); - st文字位置10.ch = '9'; - st文字位置10.pt = new Point(234, 0); - st文字位置Array[9] = st文字位置10; - this.st小文字位置 = st文字位置Array; + public CActSelect演奏履歴パネル() { + ST文字位置[] st文字位置Array = new ST文字位置[10]; - base.IsDeActivated = true; - } - public void t選択曲が変更された() { - Cスコア cスコア = OpenTaiko.stageSongSelect.r現在選択中のスコア; - if ((cスコア != null) && !OpenTaiko.stageSongSelect.bCurrentlyScrolling) { - try { - foreach (var item in tx文字列パネル) { - item.Dispose(); - } - tx文字列パネル.Clear(); - for (int i = 0; i < (int)Difficulty.Total; i++) { - SKBitmap image = ft表示用フォント.DrawText(cスコア.譜面情報.演奏履歴[i], Color.Yellow); - var tex = new CTexture(image); - tex.vcScaleRatio = new Vector3D(0.5f, 0.5f, 1f); - this.tx文字列パネル.Add(tex); - image.Dispose(); - } - } catch (CTextureCreateFailedException e) { - Trace.TraceError(e.ToString()); - Trace.TraceError("演奏履歴文字列テクスチャの作成に失敗しました。"); - this.tx文字列パネル = null; - } - } - } + ST文字位置 st文字位置 = new ST文字位置(); + st文字位置.ch = '0'; + st文字位置.pt = new Point(0, 0); + st文字位置Array[0] = st文字位置; + ST文字位置 st文字位置2 = new ST文字位置(); + st文字位置2.ch = '1'; + st文字位置2.pt = new Point(26, 0); + st文字位置Array[1] = st文字位置2; + ST文字位置 st文字位置3 = new ST文字位置(); + st文字位置3.ch = '2'; + st文字位置3.pt = new Point(52, 0); + st文字位置Array[2] = st文字位置3; + ST文字位置 st文字位置4 = new ST文字位置(); + st文字位置4.ch = '3'; + st文字位置4.pt = new Point(78, 0); + st文字位置Array[3] = st文字位置4; + ST文字位置 st文字位置5 = new ST文字位置(); + st文字位置5.ch = '4'; + st文字位置5.pt = new Point(104, 0); + st文字位置Array[4] = st文字位置5; + ST文字位置 st文字位置6 = new ST文字位置(); + st文字位置6.ch = '5'; + st文字位置6.pt = new Point(130, 0); + st文字位置Array[5] = st文字位置6; + ST文字位置 st文字位置7 = new ST文字位置(); + st文字位置7.ch = '6'; + st文字位置7.pt = new Point(156, 0); + st文字位置Array[6] = st文字位置7; + ST文字位置 st文字位置8 = new ST文字位置(); + st文字位置8.ch = '7'; + st文字位置8.pt = new Point(182, 0); + st文字位置Array[7] = st文字位置8; + ST文字位置 st文字位置9 = new ST文字位置(); + st文字位置9.ch = '8'; + st文字位置9.pt = new Point(208, 0); + st文字位置Array[8] = st文字位置9; + ST文字位置 st文字位置10 = new ST文字位置(); + st文字位置10.ch = '9'; + st文字位置10.pt = new Point(234, 0); + st文字位置Array[9] = st文字位置10; + this.st小文字位置 = st文字位置Array; - - // CActivity 実装 - - public override void Activate() { - this.n本体X = 810; - this.n本体Y = 558; - base.Activate(); - } - public override void DeActivate() { - this.ct登場アニメ用 = null; - base.DeActivate(); - } - public override void CreateManagedResource() { - this.ft表示用フォント = new CCachedFontRenderer("Arial", 30, CFontRenderer.FontStyle.Bold); - - //this.txパネル本体 = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\5_play history panel.png" ) ); - //this.txスコアボード[0] = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\5_scoreboard_0.png" ) ); - //this.txスコアボード[1] = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\5_scoreboard_1.png" ) ); - //this.txスコアボード[2] = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\5_scoreboard_2.png" ) ); - //this.txスコアボード[3] = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\5_scoreboard_3.png" ) ); - //this.tx文字 = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\5_scoreboard_number.png" ) ); - - this.t選択曲が変更された(); - base.CreateManagedResource(); - } - public override void ReleaseManagedResource() { - if (this.ft表示用フォント != null) { - this.ft表示用フォント.Dispose(); - this.ft表示用フォント = null; - } - //CDTXMania.tテクスチャの解放( ref this.txパネル本体 ); - //CDTXMania.tテクスチャの解放( ref this.tx文字列パネル ); - // CDTXMania.tテクスチャの解放( ref this.txスコアボード[0] ); - // CDTXMania.tテクスチャの解放( ref this.txスコアボード[1] ); - // CDTXMania.tテクスチャの解放( ref this.txスコアボード[2] ); - // CDTXMania.tテクスチャの解放( ref this.txスコアボード[3] ); - // CDTXMania.tテクスチャの解放( ref this.tx文字 ); - base.ReleaseManagedResource(); - } - public override int Draw() { - if (!base.IsDeActivated) { - if (base.IsFirstDraw) { - this.ct登場アニメ用 = new CCounter(0, 3000, 1, OpenTaiko.Timer); - base.IsFirstDraw = false; - } - this.ct登場アニメ用.Tick(); - int x = 980; - int y = 350; - if (OpenTaiko.stageSongSelect.r現在選択中のスコア != null && this.ct登場アニメ用.CurrentValue >= 2000 && OpenTaiko.stageSongSelect.rNowSelectedSong.eノード種別 == CSongListNode.ENodeType.SCORE) { - //CDTXMania.Tx.SongSelect_ScoreWindow_Text.n透明度 = ct登場アニメ用.n現在の値 - 1745; - if (OpenTaiko.Tx.SongSelect_ScoreWindow[OpenTaiko.stageSongSelect.n現在選択中の曲の難易度] != null) { - //CDTXMania.Tx.SongSelect_ScoreWindow[CDTXMania.stage選曲.n現在選択中の曲の難易度].n透明度 = ct登場アニメ用.n現在の値 - 1745; - OpenTaiko.Tx.SongSelect_ScoreWindow[OpenTaiko.stageSongSelect.n現在選択中の曲の難易度].t2D描画(x, y); - this.t小文字表示(x + 56, y + 160, string.Format("{0,7:######0}", OpenTaiko.stageSongSelect.r現在選択中のスコア.譜面情報.nハイスコア[OpenTaiko.stageSongSelect.n現在選択中の曲の難易度].ToString())); - OpenTaiko.Tx.SongSelect_ScoreWindow_Text.t2D描画(x + 236, y + 166, new Rectangle(0, 36, 32, 30)); - } - } - } - return 0; - } - - - // その他 - - #region [ private ] - //----------------- - private CCounter ct登場アニメ用; - private CCounter ctスコアボード登場アニメ; - private CCachedFontRenderer ft表示用フォント; - private int n本体X; - private int n本体Y; - //private CTexture txパネル本体; - private List tx文字列パネル = new(); - // private CTexture[] txスコアボード = new CTexture[4]; - // private CTexture tx文字; - //----------------- - - [StructLayout(LayoutKind.Sequential)] - private struct ST文字位置 { - public char ch; - public Point pt; - } - private readonly ST文字位置[] st小文字位置; - private void t小文字表示(int x, int y, string str) { - foreach (char ch in str) { - for (int i = 0; i < this.st小文字位置.Length; i++) { - if (this.st小文字位置[i].ch == ch) { - Rectangle rectangle = new Rectangle(this.st小文字位置[i].pt.X, this.st小文字位置[i].pt.Y, 26, 36); - if (OpenTaiko.Tx.SongSelect_ScoreWindow_Text != null) { - OpenTaiko.Tx.SongSelect_ScoreWindow_Text.t2D描画(x, y, rectangle); - } - break; - } - } - x += 26; - } - } - - public void tSongChange() { - this.ct登場アニメ用 = new CCounter(0, 3000, 1, OpenTaiko.Timer); - } - - - #endregion + base.IsDeActivated = true; } + public void t選択曲が変更された() { + Cスコア cスコア = OpenTaiko.stageSongSelect.r現在選択中のスコア; + if ((cスコア != null) && !OpenTaiko.stageSongSelect.bCurrentlyScrolling) { + try { + foreach (var item in tx文字列パネル) { + item.Dispose(); + } + tx文字列パネル.Clear(); + for (int i = 0; i < (int)Difficulty.Total; i++) { + SKBitmap image = ft表示用フォント.DrawText(cスコア.譜面情報.演奏履歴[i], Color.Yellow); + var tex = new CTexture(image); + tex.vcScaleRatio = new Vector3D(0.5f, 0.5f, 1f); + this.tx文字列パネル.Add(tex); + image.Dispose(); + } + } catch (CTextureCreateFailedException e) { + Trace.TraceError(e.ToString()); + Trace.TraceError("演奏履歴文字列テクスチャの作成に失敗しました。"); + this.tx文字列パネル = null; + } + } + } + + + // CActivity 実装 + + public override void Activate() { + this.n本体X = 810; + this.n本体Y = 558; + base.Activate(); + } + public override void DeActivate() { + this.ct登場アニメ用 = null; + base.DeActivate(); + } + public override void CreateManagedResource() { + this.ft表示用フォント = new CCachedFontRenderer("Arial", 30, CFontRenderer.FontStyle.Bold); + + //this.txパネル本体 = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\5_play history panel.png" ) ); + //this.txスコアボード[0] = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\5_scoreboard_0.png" ) ); + //this.txスコアボード[1] = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\5_scoreboard_1.png" ) ); + //this.txスコアボード[2] = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\5_scoreboard_2.png" ) ); + //this.txスコアボード[3] = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\5_scoreboard_3.png" ) ); + //this.tx文字 = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\5_scoreboard_number.png" ) ); + + this.t選択曲が変更された(); + base.CreateManagedResource(); + } + public override void ReleaseManagedResource() { + if (this.ft表示用フォント != null) { + this.ft表示用フォント.Dispose(); + this.ft表示用フォント = null; + } + //CDTXMania.tテクスチャの解放( ref this.txパネル本体 ); + //CDTXMania.tテクスチャの解放( ref this.tx文字列パネル ); + // CDTXMania.tテクスチャの解放( ref this.txスコアボード[0] ); + // CDTXMania.tテクスチャの解放( ref this.txスコアボード[1] ); + // CDTXMania.tテクスチャの解放( ref this.txスコアボード[2] ); + // CDTXMania.tテクスチャの解放( ref this.txスコアボード[3] ); + // CDTXMania.tテクスチャの解放( ref this.tx文字 ); + base.ReleaseManagedResource(); + } + public override int Draw() { + if (!base.IsDeActivated) { + if (base.IsFirstDraw) { + this.ct登場アニメ用 = new CCounter(0, 3000, 1, OpenTaiko.Timer); + base.IsFirstDraw = false; + } + this.ct登場アニメ用.Tick(); + int x = 980; + int y = 350; + if (OpenTaiko.stageSongSelect.r現在選択中のスコア != null && this.ct登場アニメ用.CurrentValue >= 2000 && OpenTaiko.stageSongSelect.rNowSelectedSong.eノード種別 == CSongListNode.ENodeType.SCORE) { + //CDTXMania.Tx.SongSelect_ScoreWindow_Text.n透明度 = ct登場アニメ用.n現在の値 - 1745; + if (OpenTaiko.Tx.SongSelect_ScoreWindow[OpenTaiko.stageSongSelect.n現在選択中の曲の難易度] != null) { + //CDTXMania.Tx.SongSelect_ScoreWindow[CDTXMania.stage選曲.n現在選択中の曲の難易度].n透明度 = ct登場アニメ用.n現在の値 - 1745; + OpenTaiko.Tx.SongSelect_ScoreWindow[OpenTaiko.stageSongSelect.n現在選択中の曲の難易度].t2D描画(x, y); + this.t小文字表示(x + 56, y + 160, string.Format("{0,7:######0}", OpenTaiko.stageSongSelect.r現在選択中のスコア.譜面情報.nハイスコア[OpenTaiko.stageSongSelect.n現在選択中の曲の難易度].ToString())); + OpenTaiko.Tx.SongSelect_ScoreWindow_Text.t2D描画(x + 236, y + 166, new Rectangle(0, 36, 32, 30)); + } + } + } + return 0; + } + + + // その他 + + #region [ private ] + //----------------- + private CCounter ct登場アニメ用; + private CCounter ctスコアボード登場アニメ; + private CCachedFontRenderer ft表示用フォント; + private int n本体X; + private int n本体Y; + //private CTexture txパネル本体; + private List tx文字列パネル = new(); + // private CTexture[] txスコアボード = new CTexture[4]; + // private CTexture tx文字; + //----------------- + + [StructLayout(LayoutKind.Sequential)] + private struct ST文字位置 { + public char ch; + public Point pt; + } + private readonly ST文字位置[] st小文字位置; + private void t小文字表示(int x, int y, string str) { + foreach (char ch in str) { + for (int i = 0; i < this.st小文字位置.Length; i++) { + if (this.st小文字位置[i].ch == ch) { + Rectangle rectangle = new Rectangle(this.st小文字位置[i].pt.X, this.st小文字位置[i].pt.Y, 26, 36); + if (OpenTaiko.Tx.SongSelect_ScoreWindow_Text != null) { + OpenTaiko.Tx.SongSelect_ScoreWindow_Text.t2D描画(x, y, rectangle); + } + break; + } + } + x += 26; + } + } + + public void tSongChange() { + this.ct登場アニメ用 = new CCounter(0, 3000, 1, OpenTaiko.Timer); + } + + + #endregion } diff --git a/OpenTaiko/src/Stages/05.SongSelect/CActSelect難易度選択画面.cs b/OpenTaiko/src/Stages/05.SongSelect/CActSelect難易度選択画面.cs index 6ecf44f4..f16cb90a 100644 --- a/OpenTaiko/src/Stages/05.SongSelect/CActSelect難易度選択画面.cs +++ b/OpenTaiko/src/Stages/05.SongSelect/CActSelect難易度選択画面.cs @@ -4,547 +4,547 @@ using Color = System.Drawing.Color; using Rectangle = System.Drawing.Rectangle; using RectangleF = System.Drawing.RectangleF; -namespace OpenTaiko { - /// - /// 難易度選択画面。 - /// この難易度選択画面はAC7~AC14のような方式であり、WiiまたはAC15移行の方式とは異なる。 - /// - internal class CActSelect難易度選択画面 : CActivity { - // Properties +namespace OpenTaiko; - public bool bIsDifficltSelect; +/// +/// 難易度選択画面。 +/// この難易度選択画面はAC7~AC14のような方式であり、WiiまたはAC15移行の方式とは異なる。 +/// +internal class CActSelect難易度選択画面 : CActivity { + // Properties - // Constructor + public bool bIsDifficltSelect; - public CActSelect難易度選択画面() { - for (int i = 0; i < 10; i++) { - st小文字位置[i].ptX = i * 18; - st小文字位置[i].ch = i.ToString().ToCharArray()[0]; - } - base.IsDeActivated = true; + // Constructor + + public CActSelect難易度選択画面() { + for (int i = 0; i < 10; i++) { + st小文字位置[i].ptX = i * 18; + st小文字位置[i].ch = i.ToString().ToCharArray()[0]; } + base.IsDeActivated = true; + } - public void t次に移動(int player) { - if (n現在の選択行[player] < 5) { - ctBarAnime[player].Start(0, 180, 1, OpenTaiko.Timer); - if (!b裏譜面) { - n現在の選択行[player]++; + public void t次に移動(int player) { + if (n現在の選択行[player] < 5) { + ctBarAnime[player].Start(0, 180, 1, OpenTaiko.Timer); + if (!b裏譜面) { + n現在の選択行[player]++; + } else { + if (n現在の選択行[player] == 4) { + n現在の選択行[player] += 2; } else { - if (n現在の選択行[player] == 4) { - n現在の選択行[player] += 2; - } else { - n現在の選択行[player]++; - } - } - } else if (n現在の選択行[player] >= 5) { - if (OpenTaiko.stageSongSelect.r現在選択中のスコア.譜面情報.nレベル[4] < 0 || OpenTaiko.stageSongSelect.r現在選択中のスコア.譜面情報.nレベル[3] < 0) - return; - - if (nスイッチカウント < 0) { - nスイッチカウント++; - } else if (nスイッチカウント == 0) { - for (int i = 0; i < 5; i++) { - if (!bSelect[i]) { - if (n現在の選択行[i] == 5) { - // Extreme to Extra - OpenTaiko.stageSongSelect.actExExtraTransAnime.BeginAnime(true); - n現在の選択行[i] = 6; - } else if (n現在の選択行[i] == 6) { - //Extra to Extreme - OpenTaiko.stageSongSelect.actExExtraTransAnime.BeginAnime(false); - n現在の選択行[i] = 5; - } - } - } - - b裏譜面 = !b裏譜面; - nスイッチカウント = 0; + n現在の選択行[player]++; } } - } + } else if (n現在の選択行[player] >= 5) { + if (OpenTaiko.stageSongSelect.r現在選択中のスコア.譜面情報.nレベル[4] < 0 || OpenTaiko.stageSongSelect.r現在選択中のスコア.譜面情報.nレベル[3] < 0) + return; - public void t前に移動(int player) { - if (n現在の選択行[player] - 1 >= 0) { - ctBarAnime[player].Start(0, 180, 1, OpenTaiko.Timer); + if (nスイッチカウント < 0) { + nスイッチカウント++; + } else if (nスイッチカウント == 0) { + for (int i = 0; i < 5; i++) { + if (!bSelect[i]) { + if (n現在の選択行[i] == 5) { + // Extreme to Extra + OpenTaiko.stageSongSelect.actExExtraTransAnime.BeginAnime(true); + n現在の選択行[i] = 6; + } else if (n現在の選択行[i] == 6) { + //Extra to Extreme + OpenTaiko.stageSongSelect.actExExtraTransAnime.BeginAnime(false); + n現在の選択行[i] = 5; + } + } + } + + b裏譜面 = !b裏譜面; nスイッチカウント = 0; - if (n現在の選択行[player] == 6) - n現在の選択行[player] -= 2; - else - n現在の選択行[player]--; } } + } - public void t選択画面初期化() { - this.txTitle = OpenTaiko.tテクスチャの生成(pfTitle.DrawText(OpenTaiko.stageSongSelect.rNowSelectedSong.ldTitle.GetString(""), Color.White, Color.Black, null, 30)); - this.txSubTitle = OpenTaiko.tテクスチャの生成(pfSubTitle.DrawText(OpenTaiko.stageSongSelect.rNowSelectedSong.ldSubtitle.GetString(""), Color.White, Color.Black, null, 30)); + public void t前に移動(int player) { + if (n現在の選択行[player] - 1 >= 0) { + ctBarAnime[player].Start(0, 180, 1, OpenTaiko.Timer); + nスイッチカウント = 0; + if (n現在の選択行[player] == 6) + n現在の選択行[player] -= 2; + else + n現在の選択行[player]--; + } + } - this.n現在の選択行 = new int[5]; - this.bSelect[0] = false; - this.bSelect[1] = false; - this.bSelect[2] = false; - this.bSelect[3] = false; - this.bSelect[4] = false; + public void t選択画面初期化() { + this.txTitle = OpenTaiko.tテクスチャの生成(pfTitle.DrawText(OpenTaiko.stageSongSelect.rNowSelectedSong.ldTitle.GetString(""), Color.White, Color.Black, null, 30)); + this.txSubTitle = OpenTaiko.tテクスチャの生成(pfSubTitle.DrawText(OpenTaiko.stageSongSelect.rNowSelectedSong.ldSubtitle.GetString(""), Color.White, Color.Black, null, 30)); - this.b裏譜面 = (OpenTaiko.stageSongSelect.r現在選択中のスコア.譜面情報.nレベル[(int)Difficulty.Edit] >= 0 && OpenTaiko.stageSongSelect.r現在選択中のスコア.譜面情報.nレベル[(int)Difficulty.Oni] < 0); + this.n現在の選択行 = new int[5]; + this.bSelect[0] = false; + this.bSelect[1] = false; + this.bSelect[2] = false; + this.bSelect[3] = false; + this.bSelect[4] = false; - this.IsFirstDraw = true; + this.b裏譜面 = (OpenTaiko.stageSongSelect.r現在選択中のスコア.譜面情報.nレベル[(int)Difficulty.Edit] >= 0 && OpenTaiko.stageSongSelect.r現在選択中のスコア.譜面情報.nレベル[(int)Difficulty.Oni] < 0); + + this.IsFirstDraw = true; + } + + // CActivity 実装 + + public override void Activate() { + if (this.IsActivated) + return; + ctBarAnime = new CCounter[5]; + ctBarAnime[0] = new CCounter(); + ctBarAnime[1] = new CCounter(); + ctBarAnime[2] = new CCounter(); + ctBarAnime[3] = new CCounter(); + ctBarAnime[4] = new CCounter(); + + base.Activate(); + } + public override void DeActivate() { + if (this.IsDeActivated) + return; + + ctBarAnime = null; + + base.DeActivate(); + } + public override void CreateManagedResource() { + this.pfTitle = HPrivateFastFont.tInstantiateMainFont(OpenTaiko.Skin.SongSelect_MusicName_Scale); + this.pfSubTitle = HPrivateFastFont.tInstantiateMainFont(OpenTaiko.Skin.SongSelect_Subtitle_Scale); + + // this.soundSelectAnnounce = TJAPlayer3.Sound管理.tサウンドを生成する( CSkin.Path( @"Sounds{Path.DirectorySeparatorChar}DiffSelect.ogg" ), ESoundGroup.SoundEffect ); + + base.CreateManagedResource(); + } + public override void ReleaseManagedResource() { + pfTitle.Dispose(); + pfSubTitle.Dispose(); + + // TJAPlayer3.t安全にDisposeする( ref this.soundSelectAnnounce ); + + base.ReleaseManagedResource(); + } + public override int Draw() { + if (this.IsDeActivated) + return 0; + + #region [ 初めての進行描画 ] + //----------------- + if (this.IsFirstDraw) { + ctBarAnimeIn = new CCounter(0, 170, 4, OpenTaiko.Timer); + // this.soundSelectAnnounce?.tサウンドを再生する(); + //TJAPlayer3.Skin.soundSelectAnnounce.t再生する(); + OpenTaiko.Skin.voiceMenuDiffSelect[OpenTaiko.SaveFile]?.tPlay(); + base.IsFirstDraw = false; + } + //----------------- + #endregion + + ctBarAnimeIn.Tick(); + for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { + ctBarAnime[i].Tick(); } - // CActivity 実装 + bool uraExists = OpenTaiko.stageSongSelect.r現在選択中のスコア.譜面情報.nレベル[(int)Difficulty.Edit] >= 0; + bool omoteExists = OpenTaiko.stageSongSelect.r現在選択中のスコア.譜面情報.nレベル[(int)Difficulty.Oni] >= 0; - public override void Activate() { - if (this.IsActivated) - return; - ctBarAnime = new CCounter[5]; - ctBarAnime[0] = new CCounter(); - ctBarAnime[1] = new CCounter(); - ctBarAnime[2] = new CCounter(); - ctBarAnime[3] = new CCounter(); - ctBarAnime[4] = new CCounter(); + #region [ キー入力 ] - base.Activate(); - } - public override void DeActivate() { - if (this.IsDeActivated) - return; - - ctBarAnime = null; - - base.DeActivate(); - } - public override void CreateManagedResource() { - this.pfTitle = HPrivateFastFont.tInstantiateMainFont(OpenTaiko.Skin.SongSelect_MusicName_Scale); - this.pfSubTitle = HPrivateFastFont.tInstantiateMainFont(OpenTaiko.Skin.SongSelect_Subtitle_Scale); - - // this.soundSelectAnnounce = TJAPlayer3.Sound管理.tサウンドを生成する( CSkin.Path( @"Sounds{Path.DirectorySeparatorChar}DiffSelect.ogg" ), ESoundGroup.SoundEffect ); - - base.CreateManagedResource(); - } - public override void ReleaseManagedResource() { - pfTitle.Dispose(); - pfSubTitle.Dispose(); - - // TJAPlayer3.t安全にDisposeする( ref this.soundSelectAnnounce ); - - base.ReleaseManagedResource(); - } - public override int Draw() { - if (this.IsDeActivated) - return 0; - - #region [ 初めての進行描画 ] - //----------------- - if (this.IsFirstDraw) { - ctBarAnimeIn = new CCounter(0, 170, 4, OpenTaiko.Timer); - // this.soundSelectAnnounce?.tサウンドを再生する(); - //TJAPlayer3.Skin.soundSelectAnnounce.t再生する(); - OpenTaiko.Skin.voiceMenuDiffSelect[OpenTaiko.SaveFile]?.tPlay(); - base.IsFirstDraw = false; - } - //----------------- - #endregion - - ctBarAnimeIn.Tick(); + if (this.ctBarAnimeIn.IsEnded && exextraAnimation == 0) // Prevent player actions if animation is active + { for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { - ctBarAnime[i].Tick(); - } + if (!bSelect[i] && !isOnOption()) { + bool right = false; + bool left = false; + bool decide = false; - bool uraExists = OpenTaiko.stageSongSelect.r現在選択中のスコア.譜面情報.nレベル[(int)Difficulty.Edit] >= 0; - bool omoteExists = OpenTaiko.stageSongSelect.r現在選択中のスコア.譜面情報.nレベル[(int)Difficulty.Oni] >= 0; + bool cancel = false; - #region [ キー入力 ] - - if (this.ctBarAnimeIn.IsEnded && exextraAnimation == 0) // Prevent player actions if animation is active - { - for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { - if (!bSelect[i] && !isOnOption()) { - bool right = false; - bool left = false; - bool decide = false; - - bool cancel = false; - - switch (i) { - case 0: - right = (OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.RightChange) || OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.RightArrow)); - left = (OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.LeftChange) || OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.LeftArrow)); - decide = (OpenTaiko.Pad.bPressedDGB(EPad.Decide) || - (OpenTaiko.ConfigIni.bEnterIsNotUsedInKeyAssignments && OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Return))); - cancel = (OpenTaiko.Pad.bPressedDGB(EPad.Cancel) || OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Escape)); - break; - case 1: - if (!OpenTaiko.ConfigIni.bAIBattleMode) { - right = (OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.RBlue2P)); - left = (OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.LBlue2P)); - decide = (OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.LRed2P) || OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.RRed2P)); - } - break; - case 2: - right = (OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.RBlue3P)); - left = (OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.LBlue3P)); - decide = (OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.LRed3P) || OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.RRed3P)); - break; - case 3: - right = (OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.RBlue4P)); - left = (OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.LBlue4P)); - decide = (OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.LRed4P) || OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.RRed4P)); - break; - case 4: - right = (OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.RBlue5P)); - left = (OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.LBlue5P)); - decide = (OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.LRed5P) || OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.RRed5P)); - break; - } - - if (right) { - OpenTaiko.Skin.soundChangeSFX.tPlay(); - this.t次に移動(i); - } else if (left) { - OpenTaiko.Skin.soundChangeSFX.tPlay(); - this.t前に移動(i); - } - if (decide) { - if (n現在の選択行[i] == 0) { - OpenTaiko.Skin.soundDecideSFX.tPlay(); - OpenTaiko.stageSongSelect.actSongList.ctBarOpen.Start(100, 260, 2, OpenTaiko.Timer); - this.bIsDifficltSelect = false; - } else if (n現在の選択行[i] == 1) { - OpenTaiko.Skin.soundDecideSFX.tPlay(); - bOption[i] = true; - } else { - if (OpenTaiko.stageSongSelect.r現在選択中のスコア.譜面情報.nレベル[n現在の選択行[i] - 2] > 0) { - //TJAPlayer3.stage選曲.ctChara_Jump[0].t開始(0, SongSelect_Chara_Jump.Length - 1, 1000 / 45, TJAPlayer3.Timer); - - - this.bSelect[i] = true; - - bool allPlayerSelected = true; - - for (int i2 = 0; i2 < OpenTaiko.ConfigIni.nPlayerCount; i2++) { - if (OpenTaiko.ConfigIni.bAIBattleMode && i2 == 1) break; - - if (!bSelect[i2]) { - allPlayerSelected = false; - break; - } - } - - if (allPlayerSelected) { - if (OpenTaiko.Skin.soundSongDecide_AI.bLoadedSuccessfuly && OpenTaiko.ConfigIni.bAIBattleMode) { - OpenTaiko.Skin.soundSongDecide_AI.tPlay(); - } else if (OpenTaiko.Skin.sound曲決定音.bLoadedSuccessfuly) { - OpenTaiko.Skin.sound曲決定音.tPlay(); - } else { - OpenTaiko.Skin.soundDecideSFX.tPlay(); - } - - for (int i2 = 0; i2 < OpenTaiko.ConfigIni.nPlayerCount; i2++) { - if (OpenTaiko.ConfigIni.bAIBattleMode) { - OpenTaiko.Skin.voiceMenuSongDecide_AI[OpenTaiko.GetActualPlayer(i2)]?.tPlay(); - } else { - OpenTaiko.Skin.voiceMenuSongDecide[OpenTaiko.GetActualPlayer(i2)]?.tPlay(); - } - CMenuCharacter.tMenuResetTimer(i2, CMenuCharacter.ECharacterAnimation.START); - if (OpenTaiko.ConfigIni.bAIBattleMode) { - OpenTaiko.stageSongSelect.t曲を選択する(n現在の選択行[0] - 2, i2); - } else { - OpenTaiko.stageSongSelect.t曲を選択する(n現在の選択行[i2] - 2, i2); - } - } - } else { - CMenuCharacter.tMenuResetTimer(i, CMenuCharacter.ECharacterAnimation.WAIT); - OpenTaiko.Skin.soundDecideSFX.tPlay(); - } - } + switch (i) { + case 0: + right = (OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.RightChange) || OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.RightArrow)); + left = (OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.LeftChange) || OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.LeftArrow)); + decide = (OpenTaiko.Pad.bPressedDGB(EPad.Decide) || + (OpenTaiko.ConfigIni.bEnterIsNotUsedInKeyAssignments && OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Return))); + cancel = (OpenTaiko.Pad.bPressedDGB(EPad.Cancel) || OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Escape)); + break; + case 1: + if (!OpenTaiko.ConfigIni.bAIBattleMode) { + right = (OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.RBlue2P)); + left = (OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.LBlue2P)); + decide = (OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.LRed2P) || OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.RRed2P)); } - } - if (cancel) { + break; + case 2: + right = (OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.RBlue3P)); + left = (OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.LBlue3P)); + decide = (OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.LRed3P) || OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.RRed3P)); + break; + case 3: + right = (OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.RBlue4P)); + left = (OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.LBlue4P)); + decide = (OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.LRed4P) || OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.RRed4P)); + break; + case 4: + right = (OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.RBlue5P)); + left = (OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.LBlue5P)); + decide = (OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.LRed5P) || OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.RRed5P)); + break; + } + + if (right) { + OpenTaiko.Skin.soundChangeSFX.tPlay(); + this.t次に移動(i); + } else if (left) { + OpenTaiko.Skin.soundChangeSFX.tPlay(); + this.t前に移動(i); + } + if (decide) { + if (n現在の選択行[i] == 0) { OpenTaiko.Skin.soundDecideSFX.tPlay(); OpenTaiko.stageSongSelect.actSongList.ctBarOpen.Start(100, 260, 2, OpenTaiko.Timer); this.bIsDifficltSelect = false; + } else if (n現在の選択行[i] == 1) { + OpenTaiko.Skin.soundDecideSFX.tPlay(); + bOption[i] = true; + } else { + if (OpenTaiko.stageSongSelect.r現在選択中のスコア.譜面情報.nレベル[n現在の選択行[i] - 2] > 0) { + //TJAPlayer3.stage選曲.ctChara_Jump[0].t開始(0, SongSelect_Chara_Jump.Length - 1, 1000 / 45, TJAPlayer3.Timer); + + + this.bSelect[i] = true; + + bool allPlayerSelected = true; + + for (int i2 = 0; i2 < OpenTaiko.ConfigIni.nPlayerCount; i2++) { + if (OpenTaiko.ConfigIni.bAIBattleMode && i2 == 1) break; + + if (!bSelect[i2]) { + allPlayerSelected = false; + break; + } + } + + if (allPlayerSelected) { + if (OpenTaiko.Skin.soundSongDecide_AI.bLoadedSuccessfuly && OpenTaiko.ConfigIni.bAIBattleMode) { + OpenTaiko.Skin.soundSongDecide_AI.tPlay(); + } else if (OpenTaiko.Skin.sound曲決定音.bLoadedSuccessfuly) { + OpenTaiko.Skin.sound曲決定音.tPlay(); + } else { + OpenTaiko.Skin.soundDecideSFX.tPlay(); + } + + for (int i2 = 0; i2 < OpenTaiko.ConfigIni.nPlayerCount; i2++) { + if (OpenTaiko.ConfigIni.bAIBattleMode) { + OpenTaiko.Skin.voiceMenuSongDecide_AI[OpenTaiko.GetActualPlayer(i2)]?.tPlay(); + } else { + OpenTaiko.Skin.voiceMenuSongDecide[OpenTaiko.GetActualPlayer(i2)]?.tPlay(); + } + CMenuCharacter.tMenuResetTimer(i2, CMenuCharacter.ECharacterAnimation.START); + if (OpenTaiko.ConfigIni.bAIBattleMode) { + OpenTaiko.stageSongSelect.t曲を選択する(n現在の選択行[0] - 2, i2); + } else { + OpenTaiko.stageSongSelect.t曲を選択する(n現在の選択行[i2] - 2, i2); + } + } + } else { + CMenuCharacter.tMenuResetTimer(i, CMenuCharacter.ECharacterAnimation.WAIT); + OpenTaiko.Skin.soundDecideSFX.tPlay(); + } + } } } + if (cancel) { + OpenTaiko.Skin.soundDecideSFX.tPlay(); + OpenTaiko.stageSongSelect.actSongList.ctBarOpen.Start(100, 260, 2, OpenTaiko.Timer); + this.bIsDifficltSelect = false; + } } } + } - #endregion + #endregion - bool consideMultiPlay = OpenTaiko.ConfigIni.nPlayerCount >= 2 && !OpenTaiko.ConfigIni.bAIBattleMode; + bool consideMultiPlay = OpenTaiko.ConfigIni.nPlayerCount >= 2 && !OpenTaiko.ConfigIni.bAIBattleMode; - #region [ 画像描画 ] + #region [ 画像描画 ] - // int boxType = nStrジャンルtoNum(TJAPlayer3.stage選曲.r現在選択中の曲.strジャンル); - var difficulty_back = HGenreBar.tGetGenreBar(OpenTaiko.stageSongSelect.rNowSelectedSong.BoxType, OpenTaiko.Tx.Difficulty_Back); + // int boxType = nStrジャンルtoNum(TJAPlayer3.stage選曲.r現在選択中の曲.strジャンル); + var difficulty_back = HGenreBar.tGetGenreBar(OpenTaiko.stageSongSelect.rNowSelectedSong.BoxType, OpenTaiko.Tx.Difficulty_Back); - difficulty_back.Opacity = - (OpenTaiko.stageSongSelect.actSongList.ctDifficultyIn.CurrentValue - 1255); - OpenTaiko.Tx.Difficulty_Bar.Opacity = (OpenTaiko.stageSongSelect.actSongList.ctDifficultyIn.CurrentValue - 1255); - OpenTaiko.Tx.Difficulty_Number.Opacity = (OpenTaiko.stageSongSelect.actSongList.ctDifficultyIn.CurrentValue - 1255); - OpenTaiko.Tx.Difficulty_Crown.Opacity = (OpenTaiko.stageSongSelect.actSongList.ctDifficultyIn.CurrentValue - 1255); - OpenTaiko.Tx.SongSelect_ScoreRank.vcScaleRatio.X = 0.65f; - OpenTaiko.Tx.SongSelect_ScoreRank.vcScaleRatio.Y = 0.65f; - OpenTaiko.Tx.SongSelect_ScoreRank.Opacity = (OpenTaiko.stageSongSelect.actSongList.ctDifficultyIn.CurrentValue - 1255); - OpenTaiko.Tx.Difficulty_Star.Opacity = (OpenTaiko.stageSongSelect.actSongList.ctDifficultyIn.CurrentValue - 1255); + difficulty_back.Opacity = + (OpenTaiko.stageSongSelect.actSongList.ctDifficultyIn.CurrentValue - 1255); + OpenTaiko.Tx.Difficulty_Bar.Opacity = (OpenTaiko.stageSongSelect.actSongList.ctDifficultyIn.CurrentValue - 1255); + OpenTaiko.Tx.Difficulty_Number.Opacity = (OpenTaiko.stageSongSelect.actSongList.ctDifficultyIn.CurrentValue - 1255); + OpenTaiko.Tx.Difficulty_Crown.Opacity = (OpenTaiko.stageSongSelect.actSongList.ctDifficultyIn.CurrentValue - 1255); + OpenTaiko.Tx.SongSelect_ScoreRank.vcScaleRatio.X = 0.65f; + OpenTaiko.Tx.SongSelect_ScoreRank.vcScaleRatio.Y = 0.65f; + OpenTaiko.Tx.SongSelect_ScoreRank.Opacity = (OpenTaiko.stageSongSelect.actSongList.ctDifficultyIn.CurrentValue - 1255); + OpenTaiko.Tx.Difficulty_Star.Opacity = (OpenTaiko.stageSongSelect.actSongList.ctDifficultyIn.CurrentValue - 1255); - difficulty_back.color4 = CConversion.ColorToColor4(OpenTaiko.stageSongSelect.rNowSelectedSong.BoxColor); + difficulty_back.color4 = CConversion.ColorToColor4(OpenTaiko.stageSongSelect.rNowSelectedSong.BoxColor); - difficulty_back.t2D中心基準描画(OpenTaiko.Skin.SongSelect_Difficulty_Back[0], OpenTaiko.Skin.SongSelect_Difficulty_Back[1]); + difficulty_back.t2D中心基準描画(OpenTaiko.Skin.SongSelect_Difficulty_Back[0], OpenTaiko.Skin.SongSelect_Difficulty_Back[1]); - for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { - if (OpenTaiko.ConfigIni.bAIBattleMode && i == 1) break; + for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { + if (OpenTaiko.ConfigIni.bAIBattleMode && i == 1) break; - /* - Difficulty_Select_Bar[i].Opacity = (int)(ctBarAnimeIn.n現在の値 >= 80 ? (ctBarAnimeIn.n現在の値 - 80) * 2.84f : 0); - Difficulty_Select_Bar[i].t2D描画((float)this.BarX[n現在の選択行[i]], 242, new RectangleF(0, (n現在の選択行[i] >= 2 ? 114 : 387), 259, 275 - (n現在の選択行[i] >= 2 ? 0 : 164))); - */ - OpenTaiko.Tx.Difficulty_Select_Bar[i].Opacity = (int)(ctBarAnimeIn.CurrentValue >= 80 ? (ctBarAnimeIn.CurrentValue - 80) * 2.84f : 0); + /* + Difficulty_Select_Bar[i].Opacity = (int)(ctBarAnimeIn.n現在の値 >= 80 ? (ctBarAnimeIn.n現在の値 - 80) * 2.84f : 0); + Difficulty_Select_Bar[i].t2D描画((float)this.BarX[n現在の選択行[i]], 242, new RectangleF(0, (n現在の選択行[i] >= 2 ? 114 : 387), 259, 275 - (n現在の選択行[i] >= 2 ? 0 : 164))); + */ + OpenTaiko.Tx.Difficulty_Select_Bar[i].Opacity = (int)(ctBarAnimeIn.CurrentValue >= 80 ? (ctBarAnimeIn.CurrentValue - 80) * 2.84f : 0); - int backType = n現在の選択行[i] >= 2 ? 1 : 2; + int backType = n現在の選択行[i] >= 2 ? 1 : 2; - OpenTaiko.Tx.Difficulty_Select_Bar[i].t2D描画( - OpenTaiko.Skin.SongSelect_Difficulty_Select_Bar_Back_X[n現在の選択行[i]], - OpenTaiko.Skin.SongSelect_Difficulty_Select_Bar_Back_Y[n現在の選択行[i]], - new RectangleF(OpenTaiko.Skin.SongSelect_Difficulty_Select_Bar_Rect[backType][0], OpenTaiko.Skin.SongSelect_Difficulty_Select_Bar_Rect[backType][1], + OpenTaiko.Tx.Difficulty_Select_Bar[i].t2D描画( + OpenTaiko.Skin.SongSelect_Difficulty_Select_Bar_Back_X[n現在の選択行[i]], + OpenTaiko.Skin.SongSelect_Difficulty_Select_Bar_Back_Y[n現在の選択行[i]], + new RectangleF(OpenTaiko.Skin.SongSelect_Difficulty_Select_Bar_Rect[backType][0], OpenTaiko.Skin.SongSelect_Difficulty_Select_Bar_Rect[backType][1], OpenTaiko.Skin.SongSelect_Difficulty_Select_Bar_Rect[backType][2], OpenTaiko.Skin.SongSelect_Difficulty_Select_Bar_Rect[backType][3])); - } + } - OpenTaiko.Tx.Difficulty_Bar.color4 = new Color4(1.0f, 1.0f, 1.0f, 1.0f); - //Difficulty_Bar.t2D描画(255, 270, new RectangleF(0, 0, 171, 236)); //閉じる、演奏オプション - for (int i = 0; i < 2; i++) { - OpenTaiko.Tx.Difficulty_Bar.t2D描画(OpenTaiko.Skin.SongSelect_Difficulty_Bar_X[i], OpenTaiko.Skin.SongSelect_Difficulty_Bar_Y[i], - new RectangleF(OpenTaiko.Skin.SongSelect_Difficulty_Bar_Rect[i][0], + OpenTaiko.Tx.Difficulty_Bar.color4 = new Color4(1.0f, 1.0f, 1.0f, 1.0f); + //Difficulty_Bar.t2D描画(255, 270, new RectangleF(0, 0, 171, 236)); //閉じる、演奏オプション + for (int i = 0; i < 2; i++) { + OpenTaiko.Tx.Difficulty_Bar.t2D描画(OpenTaiko.Skin.SongSelect_Difficulty_Bar_X[i], OpenTaiko.Skin.SongSelect_Difficulty_Bar_Y[i], + new RectangleF(OpenTaiko.Skin.SongSelect_Difficulty_Bar_Rect[i][0], OpenTaiko.Skin.SongSelect_Difficulty_Bar_Rect[i][1], OpenTaiko.Skin.SongSelect_Difficulty_Bar_Rect[i][2], OpenTaiko.Skin.SongSelect_Difficulty_Bar_Rect[i][3])); //閉じる - } + } - exextraAnimation = OpenTaiko.stageSongSelect.actExExtraTransAnime.Draw(); + exextraAnimation = OpenTaiko.stageSongSelect.actExExtraTransAnime.Draw(); - for (int i = 0; i <= (int)Difficulty.Edit; i++) { - if (i == (int)Difficulty.Edit && (!uraExists || !b裏譜面)) - break; - else if (i == (int)Difficulty.Oni && (!omoteExists && uraExists || b裏譜面)) - continue; + for (int i = 0; i <= (int)Difficulty.Edit; i++) { + if (i == (int)Difficulty.Edit && (!uraExists || !b裏譜面)) + break; + else if (i == (int)Difficulty.Oni && (!omoteExists && uraExists || b裏譜面)) + continue; - int screenPos = Math.Min((int)Difficulty.Oni, i); - int level = OpenTaiko.stageSongSelect.r現在選択中のスコア.譜面情報.nレベル[i]; - bool avaliable = OpenTaiko.stageSongSelect.r現在選択中のスコア.譜面情報.nレベル[i] >= 0; + int screenPos = Math.Min((int)Difficulty.Oni, i); + int level = OpenTaiko.stageSongSelect.r現在選択中のスコア.譜面情報.nレベル[i]; + bool avaliable = OpenTaiko.stageSongSelect.r現在選択中のスコア.譜面情報.nレベル[i] >= 0; - if (avaliable) - OpenTaiko.Tx.Difficulty_Bar.color4 = new Color4(1.0f, 1.0f, 1.0f, 1.0f); - else - OpenTaiko.Tx.Difficulty_Bar.color4 = new Color4(0.5f, 0.5f, 0.5f, 1.0f); + if (avaliable) + OpenTaiko.Tx.Difficulty_Bar.color4 = new Color4(1.0f, 1.0f, 1.0f, 1.0f); + else + OpenTaiko.Tx.Difficulty_Bar.color4 = new Color4(0.5f, 0.5f, 0.5f, 1.0f); - if (!(i >= (int)Difficulty.Oni && exextraAnimation > 0)) // Hide Oni/Ura during transition - { - OpenTaiko.Tx.Difficulty_Bar.t2D描画(OpenTaiko.Skin.SongSelect_Difficulty_Bar_X[i + 2], OpenTaiko.Skin.SongSelect_Difficulty_Bar_Y[i + 2], - new RectangleF(OpenTaiko.Skin.SongSelect_Difficulty_Bar_Rect[i + 2][0], + if (!(i >= (int)Difficulty.Oni && exextraAnimation > 0)) // Hide Oni/Ura during transition + { + OpenTaiko.Tx.Difficulty_Bar.t2D描画(OpenTaiko.Skin.SongSelect_Difficulty_Bar_X[i + 2], OpenTaiko.Skin.SongSelect_Difficulty_Bar_Y[i + 2], + new RectangleF(OpenTaiko.Skin.SongSelect_Difficulty_Bar_Rect[i + 2][0], OpenTaiko.Skin.SongSelect_Difficulty_Bar_Rect[i + 2][1], OpenTaiko.Skin.SongSelect_Difficulty_Bar_Rect[i + 2][2], OpenTaiko.Skin.SongSelect_Difficulty_Bar_Rect[i + 2][3])); - } - - if (!avaliable) - continue; - - - for (int j = 0; j < OpenTaiko.ConfigIni.nPlayerCount; j++) { - if (j >= 2) continue; - - if (OpenTaiko.ConfigIni.bAIBattleMode && i == 1) break; - - int p = OpenTaiko.GetActualPlayer(j); - - Cスコア.ST譜面情報 idx = OpenTaiko.stageSongSelect.r現在選択中のスコア.譜面情報; - - //var GPInfo = TJAPlayer3.stageSongSelect.r現在選択中のスコア.GPInfo[p]; - - var TableEntry = OpenTaiko.SaveFileInstances[p].data.tGetSongSelectTableEntry(OpenTaiko.stageSongSelect.rNowSelectedSong.tGetUniqueId()); - - //Difficulty_Crown.t2D描画(445 + screenPos * 144, 284, new RectangleF(idx.nクリア[i] * 24.5f, 0, 24.5f, 26)); - - int crown_width = OpenTaiko.Tx.Difficulty_Crown.szTextureSize.Width / 5; - int crown_height = OpenTaiko.Tx.Difficulty_Crown.szTextureSize.Height; - OpenTaiko.Tx.Difficulty_Crown.t2D描画( - OpenTaiko.Skin.SongSelect_Difficulty_Crown_X[j][i], - OpenTaiko.Skin.SongSelect_Difficulty_Crown_Y[j][i], - new RectangleF(TableEntry.ClearStatuses[i] * crown_width, 0, crown_width, crown_height)); - - int scoreRank_width = OpenTaiko.Tx.SongSelect_ScoreRank.szTextureSize.Width; - int scoreRank_height = OpenTaiko.Tx.SongSelect_ScoreRank.szTextureSize.Height / 7; - - if (TableEntry.ScoreRanks[i] != 0) - OpenTaiko.Tx.SongSelect_ScoreRank.t2D描画( - OpenTaiko.Skin.SongSelect_Difficulty_ScoreRank_X[j][i], - OpenTaiko.Skin.SongSelect_Difficulty_ScoreRank_Y[j][i], - new RectangleF(0, (TableEntry.ScoreRanks[i] - 1) * scoreRank_height, scoreRank_width, scoreRank_height)); - - /* - if (idx.nスコアランク[i] != 0) - SongSelect_ScoreRank.t2D描画(467 + screenPos * 144, 281, new RectangleF(0, (idx.nスコアランク[i] - 1) * 42.71f, 50, 42.71f)); - */ - } - - if (level >= 0 && (!(i >= (int)Difficulty.Oni && exextraAnimation > 0))) - t小文字表示(OpenTaiko.stageSongSelect.r現在選択中のスコア.譜面情報.nレベル[i], - OpenTaiko.Skin.SongSelect_Difficulty_Number_X[i], - OpenTaiko.Skin.SongSelect_Difficulty_Number_Y[i], - i, - OpenTaiko.stageSongSelect.r現在選択中のスコア.譜面情報.nLevelIcon[i] - ); - - if (!(i >= (int)Difficulty.Oni && exextraAnimation > 0)) { - for (int g = 0; g < 10; g++) { - if (level > g + 10) { - OpenTaiko.Tx.Difficulty_Star.color4 = new Color4(1f, 0.2f, 0.2f, 1.0f); - OpenTaiko.Tx.Difficulty_Star?.t2D描画(OpenTaiko.Skin.SongSelect_Difficulty_Star_X[i] + g * OpenTaiko.Skin.SongSelect_Difficulty_Star_Interval[0], OpenTaiko.Skin.SongSelect_Difficulty_Star_Y[i] + g * OpenTaiko.Skin.SongSelect_Difficulty_Star_Interval[1]); - } else if (level > g) { - OpenTaiko.Tx.Difficulty_Star.color4 = new Color4(1f, 1f, 1f, 1.0f); - OpenTaiko.Tx.Difficulty_Star?.t2D描画(OpenTaiko.Skin.SongSelect_Difficulty_Star_X[i] + g * OpenTaiko.Skin.SongSelect_Difficulty_Star_Interval[0], OpenTaiko.Skin.SongSelect_Difficulty_Star_Y[i] + g * OpenTaiko.Skin.SongSelect_Difficulty_Star_Interval[1]); - } - - } - } - - if (OpenTaiko.stageSongSelect.r現在選択中のスコア.譜面情報.b譜面分岐[i]) - OpenTaiko.Tx.SongSelect_Branch_Text?.t2D描画( - - OpenTaiko.Skin.SongSelect_Difficulty_Bar_X[i + 2] + OpenTaiko.Skin.SongSelect_Branch_Text_Offset[0], - OpenTaiko.Skin.SongSelect_Difficulty_Bar_Y[i + 2] + OpenTaiko.Skin.SongSelect_Branch_Text_Offset[1] - ); } - this.txTitle.t2D中心基準描画(OpenTaiko.Skin.SongSelect_Difficulty_Select_Title[0], OpenTaiko.Skin.SongSelect_Difficulty_Select_Title[1]); - this.txSubTitle.t2D中心基準描画(OpenTaiko.Skin.SongSelect_Difficulty_Select_SubTitle[0], OpenTaiko.Skin.SongSelect_Difficulty_Select_SubTitle[1]); + if (!avaliable) + continue; - #region [ バーの描画 ] - for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { + for (int j = 0; j < OpenTaiko.ConfigIni.nPlayerCount; j++) { + if (j >= 2) continue; + if (OpenTaiko.ConfigIni.bAIBattleMode && i == 1) break; + int p = OpenTaiko.GetActualPlayer(j); + + Cスコア.ST譜面情報 idx = OpenTaiko.stageSongSelect.r現在選択中のスコア.譜面情報; + + //var GPInfo = TJAPlayer3.stageSongSelect.r現在選択中のスコア.GPInfo[p]; + + var TableEntry = OpenTaiko.SaveFileInstances[p].data.tGetSongSelectTableEntry(OpenTaiko.stageSongSelect.rNowSelectedSong.tGetUniqueId()); + + //Difficulty_Crown.t2D描画(445 + screenPos * 144, 284, new RectangleF(idx.nクリア[i] * 24.5f, 0, 24.5f, 26)); + + int crown_width = OpenTaiko.Tx.Difficulty_Crown.szTextureSize.Width / 5; + int crown_height = OpenTaiko.Tx.Difficulty_Crown.szTextureSize.Height; + OpenTaiko.Tx.Difficulty_Crown.t2D描画( + OpenTaiko.Skin.SongSelect_Difficulty_Crown_X[j][i], + OpenTaiko.Skin.SongSelect_Difficulty_Crown_Y[j][i], + new RectangleF(TableEntry.ClearStatuses[i] * crown_width, 0, crown_width, crown_height)); + + int scoreRank_width = OpenTaiko.Tx.SongSelect_ScoreRank.szTextureSize.Width; + int scoreRank_height = OpenTaiko.Tx.SongSelect_ScoreRank.szTextureSize.Height / 7; + + if (TableEntry.ScoreRanks[i] != 0) + OpenTaiko.Tx.SongSelect_ScoreRank.t2D描画( + OpenTaiko.Skin.SongSelect_Difficulty_ScoreRank_X[j][i], + OpenTaiko.Skin.SongSelect_Difficulty_ScoreRank_Y[j][i], + new RectangleF(0, (TableEntry.ScoreRanks[i] - 1) * scoreRank_height, scoreRank_width, scoreRank_height)); + /* - Difficulty_Select_Bar[i].t2D描画( - TJAPlayer3.ConfigIni.nPlayerCount == 2 ? n現在の選択行[0] != n現在の選択行[1] ? (float)this.BarX[n現在の選択行[i]] : i == 0 ? (float)this.BarX[n現在の選択行[i]] - 25 : (float)this.BarX[n現在の選択行[i]] + 25 : (float)this.BarX[n現在の選択行[i]], - 126 + ((float)Math.Sin((float)(ctBarAnimeIn.n現在の値 >= 80 ? (ctBarAnimeIn.n現在の値 - 80) : 0) * (Math.PI / 180)) * 50) + (float)Math.Sin((float)ctBarAnime[i].n現在の値 * (Math.PI / 180)) * 10, - new RectangleF(0, 0, 259, 114)); + if (idx.nスコアランク[i] != 0) + SongSelect_ScoreRank.t2D描画(467 + screenPos * 144, 281, new RectangleF(0, (idx.nスコアランク[i] - 1) * 42.71f, 50, 42.71f)); */ + } - //bool overlap = n現在の選択行[0] == n現在の選択行[1] && consideMultiPlay; + if (level >= 0 && (!(i >= (int)Difficulty.Oni && exextraAnimation > 0))) + t小文字表示(OpenTaiko.stageSongSelect.r現在選択中のスコア.譜面情報.nレベル[i], + OpenTaiko.Skin.SongSelect_Difficulty_Number_X[i], + OpenTaiko.Skin.SongSelect_Difficulty_Number_Y[i], + i, + OpenTaiko.stageSongSelect.r現在選択中のスコア.譜面情報.nLevelIcon[i] + ); - int overlapCount = 0; - int nowOverlapIndex = 0; - - for (int j = 0; j < OpenTaiko.ConfigIni.nPlayerCount; j++) { - if (n現在の選択行[i] == n現在の選択行[j] && j != i) overlapCount++; - if (j == i) { - nowOverlapIndex = overlapCount; + if (!(i >= (int)Difficulty.Oni && exextraAnimation > 0)) { + for (int g = 0; g < 10; g++) { + if (level > g + 10) { + OpenTaiko.Tx.Difficulty_Star.color4 = new Color4(1f, 0.2f, 0.2f, 1.0f); + OpenTaiko.Tx.Difficulty_Star?.t2D描画(OpenTaiko.Skin.SongSelect_Difficulty_Star_X[i] + g * OpenTaiko.Skin.SongSelect_Difficulty_Star_Interval[0], OpenTaiko.Skin.SongSelect_Difficulty_Star_Y[i] + g * OpenTaiko.Skin.SongSelect_Difficulty_Star_Interval[1]); + } else if (level > g) { + OpenTaiko.Tx.Difficulty_Star.color4 = new Color4(1f, 1f, 1f, 1.0f); + OpenTaiko.Tx.Difficulty_Star?.t2D描画(OpenTaiko.Skin.SongSelect_Difficulty_Star_X[i] + g * OpenTaiko.Skin.SongSelect_Difficulty_Star_Interval[0], OpenTaiko.Skin.SongSelect_Difficulty_Star_Y[i] + g * OpenTaiko.Skin.SongSelect_Difficulty_Star_Interval[1]); } + } + } - /*float moveX = overlap ? (i == 0 ? -TJAPlayer3.Skin.SongSelect_Difficulty_Select_Bar_Move[0] : TJAPlayer3.Skin.SongSelect_Difficulty_Select_Bar_Move[0]) : 0; - moveX += (((float)Math.Sin((float)ctBarAnime[i].n現在の値 * (Math.PI / 180)) * TJAPlayer3.Skin.SongSelect_Difficulty_Select_Bar_Anime[0]) - - (((float)Math.Cos((float)ctBarAnimeIn.n現在の値 * (Math.PI / 170)) + 1.0f) * TJAPlayer3.Skin.SongSelect_Difficulty_Select_Bar_AnimeIn[0])); + if (OpenTaiko.stageSongSelect.r現在選択中のスコア.譜面情報.b譜面分岐[i]) + OpenTaiko.Tx.SongSelect_Branch_Text?.t2D描画( - float moveY = overlap ? (i == 0 ? -TJAPlayer3.Skin.SongSelect_Difficulty_Select_Bar_Move[1] : TJAPlayer3.Skin.SongSelect_Difficulty_Select_Bar_Move[1]) : 0; - moveY += (((float)Math.Sin((float)ctBarAnime[i].n現在の値 * (Math.PI / 180)) * TJAPlayer3.Skin.SongSelect_Difficulty_Select_Bar_Anime[1]) - - (((float)Math.Cos((float)ctBarAnimeIn.n現在の値 * (Math.PI / 170)) + 1.0f) * TJAPlayer3.Skin.SongSelect_Difficulty_Select_Bar_Anime[1])); - */ + OpenTaiko.Skin.SongSelect_Difficulty_Bar_X[i + 2] + OpenTaiko.Skin.SongSelect_Branch_Text_Offset[0], + OpenTaiko.Skin.SongSelect_Difficulty_Bar_Y[i + 2] + OpenTaiko.Skin.SongSelect_Branch_Text_Offset[1] + ); + } - float moveX = OpenTaiko.Skin.SongSelect_Difficulty_Select_Bar_Move[0] * (nowOverlapIndex - (overlapCount / 2.0f)) * (2.0f / Math.Max(overlapCount, 1)); - float moveY = OpenTaiko.Skin.SongSelect_Difficulty_Select_Bar_Move[1] * (nowOverlapIndex - (overlapCount / 2.0f)) * (2.0f / Math.Max(overlapCount, 1)); + this.txTitle.t2D中心基準描画(OpenTaiko.Skin.SongSelect_Difficulty_Select_Title[0], OpenTaiko.Skin.SongSelect_Difficulty_Select_Title[1]); + this.txSubTitle.t2D中心基準描画(OpenTaiko.Skin.SongSelect_Difficulty_Select_SubTitle[0], OpenTaiko.Skin.SongSelect_Difficulty_Select_SubTitle[1]); - if (!consideMultiPlay) { - moveX = 0; - moveY = 0; + #region [ バーの描画 ] + + for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { + if (OpenTaiko.ConfigIni.bAIBattleMode && i == 1) break; + + /* + Difficulty_Select_Bar[i].t2D描画( + TJAPlayer3.ConfigIni.nPlayerCount == 2 ? n現在の選択行[0] != n現在の選択行[1] ? (float)this.BarX[n現在の選択行[i]] : i == 0 ? (float)this.BarX[n現在の選択行[i]] - 25 : (float)this.BarX[n現在の選択行[i]] + 25 : (float)this.BarX[n現在の選択行[i]], + 126 + ((float)Math.Sin((float)(ctBarAnimeIn.n現在の値 >= 80 ? (ctBarAnimeIn.n現在の値 - 80) : 0) * (Math.PI / 180)) * 50) + (float)Math.Sin((float)ctBarAnime[i].n現在の値 * (Math.PI / 180)) * 10, + new RectangleF(0, 0, 259, 114)); + */ + + //bool overlap = n現在の選択行[0] == n現在の選択行[1] && consideMultiPlay; + + int overlapCount = 0; + int nowOverlapIndex = 0; + + for (int j = 0; j < OpenTaiko.ConfigIni.nPlayerCount; j++) { + if (n現在の選択行[i] == n現在の選択行[j] && j != i) overlapCount++; + if (j == i) { + nowOverlapIndex = overlapCount; } + } - moveX += (((float)Math.Sin((float)ctBarAnime[i].CurrentValue * (Math.PI / 180)) * OpenTaiko.Skin.SongSelect_Difficulty_Select_Bar_Anime[0]) - - (((float)Math.Cos((float)ctBarAnimeIn.CurrentValue * (Math.PI / 170)) + 1.0f) * OpenTaiko.Skin.SongSelect_Difficulty_Select_Bar_AnimeIn[0])); - moveY += (((float)Math.Sin((float)ctBarAnime[i].CurrentValue * (Math.PI / 180)) * OpenTaiko.Skin.SongSelect_Difficulty_Select_Bar_Anime[1]) - - (((float)Math.Cos((float)ctBarAnimeIn.CurrentValue * (Math.PI / 170)) + 1.0f) * OpenTaiko.Skin.SongSelect_Difficulty_Select_Bar_Anime[1])); + /*float moveX = overlap ? (i == 0 ? -TJAPlayer3.Skin.SongSelect_Difficulty_Select_Bar_Move[0] : TJAPlayer3.Skin.SongSelect_Difficulty_Select_Bar_Move[0]) : 0; + moveX += (((float)Math.Sin((float)ctBarAnime[i].n現在の値 * (Math.PI / 180)) * TJAPlayer3.Skin.SongSelect_Difficulty_Select_Bar_Anime[0]) - + (((float)Math.Cos((float)ctBarAnimeIn.n現在の値 * (Math.PI / 170)) + 1.0f) * TJAPlayer3.Skin.SongSelect_Difficulty_Select_Bar_AnimeIn[0])); + + float moveY = overlap ? (i == 0 ? -TJAPlayer3.Skin.SongSelect_Difficulty_Select_Bar_Move[1] : TJAPlayer3.Skin.SongSelect_Difficulty_Select_Bar_Move[1]) : 0; + moveY += (((float)Math.Sin((float)ctBarAnime[i].n現在の値 * (Math.PI / 180)) * TJAPlayer3.Skin.SongSelect_Difficulty_Select_Bar_Anime[1]) - + (((float)Math.Cos((float)ctBarAnimeIn.n現在の値 * (Math.PI / 170)) + 1.0f) * TJAPlayer3.Skin.SongSelect_Difficulty_Select_Bar_Anime[1])); + */ + + float moveX = OpenTaiko.Skin.SongSelect_Difficulty_Select_Bar_Move[0] * (nowOverlapIndex - (overlapCount / 2.0f)) * (2.0f / Math.Max(overlapCount, 1)); + float moveY = OpenTaiko.Skin.SongSelect_Difficulty_Select_Bar_Move[1] * (nowOverlapIndex - (overlapCount / 2.0f)) * (2.0f / Math.Max(overlapCount, 1)); + + if (!consideMultiPlay) { + moveX = 0; + moveY = 0; + } + + moveX += (((float)Math.Sin((float)ctBarAnime[i].CurrentValue * (Math.PI / 180)) * OpenTaiko.Skin.SongSelect_Difficulty_Select_Bar_Anime[0]) - + (((float)Math.Cos((float)ctBarAnimeIn.CurrentValue * (Math.PI / 170)) + 1.0f) * OpenTaiko.Skin.SongSelect_Difficulty_Select_Bar_AnimeIn[0])); + moveY += (((float)Math.Sin((float)ctBarAnime[i].CurrentValue * (Math.PI / 180)) * OpenTaiko.Skin.SongSelect_Difficulty_Select_Bar_Anime[1]) - + (((float)Math.Cos((float)ctBarAnimeIn.CurrentValue * (Math.PI / 170)) + 1.0f) * OpenTaiko.Skin.SongSelect_Difficulty_Select_Bar_Anime[1])); - OpenTaiko.Tx.Difficulty_Select_Bar[i].t2D描画( - OpenTaiko.Skin.SongSelect_Difficulty_Select_Bar_X[n現在の選択行[i]] + moveX, - OpenTaiko.Skin.SongSelect_Difficulty_Select_Bar_Y[n現在の選択行[i]] + moveY, - new RectangleF(OpenTaiko.Skin.SongSelect_Difficulty_Select_Bar_Rect[0][0], OpenTaiko.Skin.SongSelect_Difficulty_Select_Bar_Rect[0][1], + OpenTaiko.Tx.Difficulty_Select_Bar[i].t2D描画( + OpenTaiko.Skin.SongSelect_Difficulty_Select_Bar_X[n現在の選択行[i]] + moveX, + OpenTaiko.Skin.SongSelect_Difficulty_Select_Bar_Y[n現在の選択行[i]] + moveY, + new RectangleF(OpenTaiko.Skin.SongSelect_Difficulty_Select_Bar_Rect[0][0], OpenTaiko.Skin.SongSelect_Difficulty_Select_Bar_Rect[0][1], OpenTaiko.Skin.SongSelect_Difficulty_Select_Bar_Rect[0][2], OpenTaiko.Skin.SongSelect_Difficulty_Select_Bar_Rect[0][3])); - } - - #endregion - - #endregion - - return 0; } - // その他 - - #region [ private ] - //----------------- - - public bool[] bSelect = new bool[5]; - public bool[] bOption = new bool[5]; - - private CCachedFontRenderer pfTitle; - private CCachedFontRenderer pfSubTitle; - private CTexture txTitle; - private CTexture txSubTitle; - - private CCounter ctBarAnimeIn; - private CCounter[] ctBarAnime = new CCounter[2]; - - private int exextraAnimation; - - //0 閉じる 1 演奏オプション 2~ 難易度 - public int[] n現在の選択行; - private int nスイッチカウント; - - private bool b裏譜面; - //176 - private int[] BarX = new int[] { 163, 251, 367, 510, 653, 797, 797 }; - - private CSound soundSelectAnnounce; - - [StructLayout(LayoutKind.Sequential)] - private struct STレベル数字 { - public char ch; - public int ptX; - } - private STレベル数字[] st小文字位置 = new STレベル数字[10]; - - private void t小文字表示(int num, float x, float y, int diff, CDTX.ELevelIcon icon) { - int[] nums = CConversion.SeparateDigits(num); - float[] icon_coords = new float[2] { -999, -999 }; - for (int j = 0; j < nums.Length; j++) { - float offset = j - (nums.Length / 2.0f); - float _x = x - (OpenTaiko.Skin.SongSelect_Difficulty_Number_Interval[0] * offset); - float _y = y - (OpenTaiko.Skin.SongSelect_Difficulty_Number_Interval[1] * offset); - - int width = OpenTaiko.Tx.Difficulty_Number.sz画像サイズ.Width / 10; - int height = OpenTaiko.Tx.Difficulty_Number.sz画像サイズ.Height; - - icon_coords[0] = Math.Max(icon_coords[0], _x + width); - icon_coords[1] = _y; - - OpenTaiko.Tx.Difficulty_Number.t2D描画(_x, _y, new Rectangle(width * nums[j], 0, width, height)); - - if (OpenTaiko.Tx.Difficulty_Number_Colored != null) { - OpenTaiko.Tx.Difficulty_Number_Colored.color4 = CConversion.ColorToColor4(OpenTaiko.Skin.SongSelect_Difficulty_Colors[diff]); - OpenTaiko.Tx.Difficulty_Number_Colored.t2D描画(_x, _y, new RectangleF(width * nums[j], 0, width, height)); - } - } - OpenTaiko.stageSongSelect.actSongList.tDisplayLevelIcon((int)icon_coords[0], (int)icon_coords[1], icon, OpenTaiko.Tx.Difficulty_Number_Icon); - } - - private bool isOnOption() { - return bOption[0] || bOption[1] || bOption[2] || bOption[3] || bOption[4]; - } - - //----------------- #endregion + + #endregion + + return 0; } + + // その他 + + #region [ private ] + //----------------- + + public bool[] bSelect = new bool[5]; + public bool[] bOption = new bool[5]; + + private CCachedFontRenderer pfTitle; + private CCachedFontRenderer pfSubTitle; + private CTexture txTitle; + private CTexture txSubTitle; + + private CCounter ctBarAnimeIn; + private CCounter[] ctBarAnime = new CCounter[2]; + + private int exextraAnimation; + + //0 閉じる 1 演奏オプション 2~ 難易度 + public int[] n現在の選択行; + private int nスイッチカウント; + + private bool b裏譜面; + //176 + private int[] BarX = new int[] { 163, 251, 367, 510, 653, 797, 797 }; + + private CSound soundSelectAnnounce; + + [StructLayout(LayoutKind.Sequential)] + private struct STレベル数字 { + public char ch; + public int ptX; + } + private STレベル数字[] st小文字位置 = new STレベル数字[10]; + + private void t小文字表示(int num, float x, float y, int diff, CDTX.ELevelIcon icon) { + int[] nums = CConversion.SeparateDigits(num); + float[] icon_coords = new float[2] { -999, -999 }; + for (int j = 0; j < nums.Length; j++) { + float offset = j - (nums.Length / 2.0f); + float _x = x - (OpenTaiko.Skin.SongSelect_Difficulty_Number_Interval[0] * offset); + float _y = y - (OpenTaiko.Skin.SongSelect_Difficulty_Number_Interval[1] * offset); + + int width = OpenTaiko.Tx.Difficulty_Number.sz画像サイズ.Width / 10; + int height = OpenTaiko.Tx.Difficulty_Number.sz画像サイズ.Height; + + icon_coords[0] = Math.Max(icon_coords[0], _x + width); + icon_coords[1] = _y; + + OpenTaiko.Tx.Difficulty_Number.t2D描画(_x, _y, new Rectangle(width * nums[j], 0, width, height)); + + if (OpenTaiko.Tx.Difficulty_Number_Colored != null) { + OpenTaiko.Tx.Difficulty_Number_Colored.color4 = CConversion.ColorToColor4(OpenTaiko.Skin.SongSelect_Difficulty_Colors[diff]); + OpenTaiko.Tx.Difficulty_Number_Colored.t2D描画(_x, _y, new RectangleF(width * nums[j], 0, width, height)); + } + } + OpenTaiko.stageSongSelect.actSongList.tDisplayLevelIcon((int)icon_coords[0], (int)icon_coords[1], icon, OpenTaiko.Tx.Difficulty_Number_Icon); + } + + private bool isOnOption() { + return bOption[0] || bOption[1] || bOption[2] || bOption[3] || bOption[4]; + } + + //----------------- + #endregion } diff --git a/OpenTaiko/src/Stages/05.SongSelect/CActSortSongs.cs b/OpenTaiko/src/Stages/05.SongSelect/CActSortSongs.cs index 10333dfd..eea16108 100644 --- a/OpenTaiko/src/Stages/05.SongSelect/CActSortSongs.cs +++ b/OpenTaiko/src/Stages/05.SongSelect/CActSortSongs.cs @@ -1,56 +1,57 @@ -namespace OpenTaiko { - internal class CActSortSongs : CActSelectPopupMenu { +namespace OpenTaiko; - // Constructor +internal class CActSortSongs : CActSelectPopupMenu { - public CActSortSongs() { - List lci = new List(); - lci.Add(new CItemList(CLangManager.LangInstance.GetString("SONGSELECT_SORT_PATH"), CItemBase.EPanelType.Normal, 0, "", "", new string[] { "Z,Y,X,...", "A,B,C,..." })); - lci.Add(new CItemList(CLangManager.LangInstance.GetString("SONGSELECT_SORT_TITLE"), CItemBase.EPanelType.Normal, 0, "", "", new string[] { "Z,Y,X,...", "A,B,C,..." })); - lci.Add(new CItemList(CLangManager.LangInstance.GetString("SONGSELECT_SORT_SUBTITLE"), CItemBase.EPanelType.Normal, 0, "", "", new string[] { "Z,Y,X,...", "A,B,C,..." })); - lci.Add(new CItemList(CLangManager.LangInstance.GetString("SONGSELECT_SORT_LEVEL"), CItemBase.EPanelType.Normal, 0, "", "", new string[] { "13,12,11,...", "1,2,3,..." })); + // Constructor + + public CActSortSongs() { + List lci = new List(); + lci.Add(new CItemList(CLangManager.LangInstance.GetString("SONGSELECT_SORT_PATH"), CItemBase.EPanelType.Normal, 0, "", "", new string[] { "Z,Y,X,...", "A,B,C,..." })); + lci.Add(new CItemList(CLangManager.LangInstance.GetString("SONGSELECT_SORT_TITLE"), CItemBase.EPanelType.Normal, 0, "", "", new string[] { "Z,Y,X,...", "A,B,C,..." })); + lci.Add(new CItemList(CLangManager.LangInstance.GetString("SONGSELECT_SORT_SUBTITLE"), CItemBase.EPanelType.Normal, 0, "", "", new string[] { "Z,Y,X,...", "A,B,C,..." })); + lci.Add(new CItemList(CLangManager.LangInstance.GetString("SONGSELECT_SORT_LEVEL"), CItemBase.EPanelType.Normal, 0, "", "", new string[] { "13,12,11,...", "1,2,3,..." })); #if TEST_SORTBGM lci.Add( new CItemList( "BPM", CItemBase.EPanelType.Normal, 0, "", "", new string[] { "300,200,...", "70,80,90,..." } ) ); #endif - lci.Add(new CItemList(CLangManager.LangInstance.GetString("MENU_RETURN"), CItemBase.EPanelType.Normal, 0, "", "", new string[] { "", "" })); - base.Initialize(lci, false, CLangManager.LangInstance.GetString("SONGSELECT_SORT")); - } + lci.Add(new CItemList(CLangManager.LangInstance.GetString("MENU_RETURN"), CItemBase.EPanelType.Normal, 0, "", "", new string[] { "", "" })); + base.Initialize(lci, false, CLangManager.LangInstance.GetString("SONGSELECT_SORT")); + } - // メソッド - public void tActivatePopupMenu(EInstrumentPad einst, ref CActSelect曲リスト ca) { - this.act曲リスト = ca; - base.tActivatePopupMenu(einst); - } + // メソッド + public void tActivatePopupMenu(EInstrumentPad einst, ref CActSelect曲リスト ca) { + this.act曲リスト = ca; + base.tActivatePopupMenu(einst); + } - public override void tEnter押下Main(int nSortOrder) { - nSortOrder *= 2; // 0,1 => -1, 1 - nSortOrder -= 1; - switch ((EOrder)n現在の選択行) { - case EOrder.Path: - this.act曲リスト.t曲リストのソート( - CSongs管理.t曲リストのソート1_絶対パス順, eInst, nSortOrder - ); - this.act曲リスト.t選択曲が変更された(true); - break; - case EOrder.Title: - this.act曲リスト.t曲リストのソート( - CSongs管理.t曲リストのソート2_タイトル順, eInst, nSortOrder - ); - this.act曲リスト.t選択曲が変更された(true); - break; - case EOrder.Subtitle: - this.act曲リスト.t曲リストのソート( - CSongs管理.tSongListSortBySubtitle, eInst, nSortOrder - ); - this.act曲リスト.t選択曲が変更された(true); - break; - case EOrder.Level: - this.act曲リスト.t曲リストのソート( - CSongs管理.tSongListSortByLevel, eInst, nSortOrder - ); - this.act曲リスト.t選択曲が変更された(true); - break; + public override void tEnter押下Main(int nSortOrder) { + nSortOrder *= 2; // 0,1 => -1, 1 + nSortOrder -= 1; + switch ((EOrder)n現在の選択行) { + case EOrder.Path: + this.act曲リスト.t曲リストのソート( + CSongs管理.t曲リストのソート1_絶対パス順, eInst, nSortOrder + ); + this.act曲リスト.t選択曲が変更された(true); + break; + case EOrder.Title: + this.act曲リスト.t曲リストのソート( + CSongs管理.t曲リストのソート2_タイトル順, eInst, nSortOrder + ); + this.act曲リスト.t選択曲が変更された(true); + break; + case EOrder.Subtitle: + this.act曲リスト.t曲リストのソート( + CSongs管理.tSongListSortBySubtitle, eInst, nSortOrder + ); + this.act曲リスト.t選択曲が変更された(true); + break; + case EOrder.Level: + this.act曲リスト.t曲リストのソート( + CSongs管理.tSongListSortByLevel, eInst, nSortOrder + ); + this.act曲リスト.t選択曲が変更された(true); + break; #if TEST_SORTBGM case (int) ESortItem.BPM: this.act曲リスト.t曲リストのソート( @@ -60,36 +61,35 @@ this.act曲リスト.t選択曲が変更された(true); break; #endif - case EOrder.Return: - this.tDeativatePopupMenu(); - break; - default: - break; - } + case EOrder.Return: + this.tDeativatePopupMenu(); + break; + default: + break; } - - // CActivity 実装 - - public override void DeActivate() { - if (!base.IsDeActivated) { - base.DeActivate(); - } - } - - #region [ private ] - //----------------- - - private CActSelect曲リスト act曲リスト; - - private enum EOrder : int { - Path = 0, - Title = 1, - Subtitle = 2, - Level = 3, - Return = 4 - } - - //----------------- - #endregion } + + // CActivity 実装 + + public override void DeActivate() { + if (!base.IsDeActivated) { + base.DeActivate(); + } + } + + #region [ private ] + //----------------- + + private CActSelect曲リスト act曲リスト; + + private enum EOrder : int { + Path = 0, + Title = 1, + Subtitle = 2, + Level = 3, + Return = 4 + } + + //----------------- + #endregion } diff --git a/OpenTaiko/src/Stages/05.SongSelect/CStage選曲.cs b/OpenTaiko/src/Stages/05.SongSelect/CStage選曲.cs index 2bc07685..9940c9de 100644 --- a/OpenTaiko/src/Stages/05.SongSelect/CStage選曲.cs +++ b/OpenTaiko/src/Stages/05.SongSelect/CStage選曲.cs @@ -5,470 +5,414 @@ using System.Text; using DiscordRPC; using FDK; -namespace OpenTaiko { - /* - ** class CSongSelectSongManager - ** playSongIfPossible : Play song is enabled and not playing, supports both intro and regular song - ** stopSong : Stop song without disabling it - ** enable : Enable the menu song - ** disable : Disable the menu song - */ - #region [Generic static class for handling the menu song] +namespace OpenTaiko; - static internal class CSongSelectSongManager { - public static CSkin.CSystemSound bgmIn { - get { - if (OpenTaiko.ConfigIni.bAIBattleMode) { - return OpenTaiko.Skin.bgmSongSelect_AI_In; - } else { - return OpenTaiko.Skin.bgm選曲画面イン; - } +/* + ** class CSongSelectSongManager + ** playSongIfPossible : Play song is enabled and not playing, supports both intro and regular song + ** stopSong : Stop song without disabling it + ** enable : Enable the menu song + ** disable : Disable the menu song + */ + +#region [Generic static class for handling the menu song] + +static internal class CSongSelectSongManager { + public static CSkin.CSystemSound bgmIn { + get { + if (OpenTaiko.ConfigIni.bAIBattleMode) { + return OpenTaiko.Skin.bgmSongSelect_AI_In; + } else { + return OpenTaiko.Skin.bgm選曲画面イン; } } - public static CSkin.CSystemSound bgmLoop { - get { - if (OpenTaiko.ConfigIni.bAIBattleMode) { - return OpenTaiko.Skin.bgmSongSelect_AI; - } else { - return OpenTaiko.Skin.bgm選曲画面; - } + } + public static CSkin.CSystemSound bgmLoop { + get { + if (OpenTaiko.ConfigIni.bAIBattleMode) { + return OpenTaiko.Skin.bgmSongSelect_AI; + } else { + return OpenTaiko.Skin.bgm選曲画面; } } - - public static void playSongIfPossible() { - if (CSongSelectSongManager.isSongDisabled) - return; - - if (OpenTaiko.ConfigIni.bBGMPlayVoiceSound && !bgmIn.bIsPlaying && !bgmLoop.bIsPlaying) { - if (inSongPlayed == false) { - bgmIn.tPlay(); - CSongSelectSongManager.inSongPlayed = true; - } else { - bgmLoop.tPlay(); - } - } - - } - - public static void stopSong() { - bgmIn.tStop(); - bgmLoop.tStop(); - CSongSelectSongManager.inSongPlayed = false; - } - - public static void enable() { - CSongSelectSongManager.isSongDisabled = false; - } - - public static void disable() { - CSongSelectSongManager.stopSong(); - CSongSelectSongManager.isSongDisabled = true; - } - - - private static bool inSongPlayed = false; - private static bool isSongDisabled = false; } - #endregion + public static void playSongIfPossible() { + if (CSongSelectSongManager.isSongDisabled) + return; - internal class CStage選曲 : CStage { - // Properties - public int nスクロールバー相対y座標 { - get { - if (actSongList != null) { - return actSongList.nスクロールバー相対y座標; + if (OpenTaiko.ConfigIni.bBGMPlayVoiceSound && !bgmIn.bIsPlaying && !bgmLoop.bIsPlaying) { + if (inSongPlayed == false) { + bgmIn.tPlay(); + CSongSelectSongManager.inSongPlayed = true; + } else { + bgmLoop.tPlay(); + } + } + + } + + public static void stopSong() { + bgmIn.tStop(); + bgmLoop.tStop(); + CSongSelectSongManager.inSongPlayed = false; + } + + public static void enable() { + CSongSelectSongManager.isSongDisabled = false; + } + + public static void disable() { + CSongSelectSongManager.stopSong(); + CSongSelectSongManager.isSongDisabled = true; + } + + + private static bool inSongPlayed = false; + private static bool isSongDisabled = false; +} + +#endregion + +internal class CStage選曲 : CStage { + // Properties + public int nスクロールバー相対y座標 { + get { + if (actSongList != null) { + return actSongList.nスクロールバー相対y座標; + } else { + return 0; + } + } + } + public bool bIsEnumeratingSongs { + get { + return actSongList.bIsEnumeratingSongs; + } + set { + actSongList.bIsEnumeratingSongs = value; + } + } + public bool bCurrentlyScrolling { + get { + return this.actSongList.bスクロール中; + } + } + public int[] nChoosenSongDifficulty = new int[5]; + + public string str確定された曲のジャンル { + get; + set; + } + public Cスコア r確定されたスコア { + get; + set; + } + public CSongListNode rChoosenSong { + get; + set; + } + public int n現在選択中の曲の難易度 { + get { + return this.actSongList.n現在選択中の曲の現在の難易度レベル; + } + } + public Cスコア r現在選択中のスコア { + get { + return this.actSongList.r現在選択中のスコア; + } + } + public CSongListNode rPrevSelectedSong { + get { + return this.actSongList.rPrevSelectedSong; + } + } + public CSongListNode rNowSelectedSong { + get { + return this.actSongList.rCurrentlySelectedSong; + } + set { + this.actSongList.rCurrentlySelectedSong = value; + } + } + + // コンストラクタ + public CStage選曲() { + base.eStageID = CStage.EStage.SongSelect; + base.ePhaseID = CStage.EPhase.Common_NORMAL; + base.IsDeActivated = true; + base.ChildActivities.Add(this.actオプションパネル = new CActオプションパネル()); + base.ChildActivities.Add(this.actFIFO = new CActFIFOBlack()); + base.ChildActivities.Add(this.actFIfrom結果画面 = new CActFIFOBlack()); + //base.list子Activities.Add( this.actFOtoNowLoading = new CActFIFOBlack() ); + base.ChildActivities.Add(this.actFOtoNowLoading = new CActFIFOStart()); + base.ChildActivities.Add(this.actSongList = new CActSelect曲リスト()); + base.ChildActivities.Add(this.actSongInfo = new CActSelectSongInfo()); + base.ChildActivities.Add(this.actDanInfo = new CActSelectDanInfo()); + base.ChildActivities.Add(this.actTowerInfo = new CActSelectTowerInfo()); + base.ChildActivities.Add(this.actステータスパネル = new CActSelectステータスパネル()); + base.ChildActivities.Add(this.act演奏履歴パネル = new CActSelect演奏履歴パネル()); + base.ChildActivities.Add(this.actPreimageパネル = new CActSelectPreimageパネル()); + base.ChildActivities.Add(this.actPresound = new CActSelectPresound()); + base.ChildActivities.Add(this.actArtistComment = new CActSelectArtistComment()); + base.ChildActivities.Add(this.actInformation = new CActSelectInformation()); + base.ChildActivities.Add(this.actSortSongs = new CActSortSongs()); + base.ChildActivities.Add(this.actShowCurrentPosition = new CActSelectShowCurrentPosition()); + base.ChildActivities.Add(this.actQuickConfig = new CActSelectQuickConfig()); + base.ChildActivities.Add(this.actDifficultySelectionScreen = new CActSelect難易度選択画面()); + base.ChildActivities.Add(this.actPlayOption = new CActPlayOption()); + base.ChildActivities.Add(this.actExExtraTransAnime = new CActSelectExExtraTransAnime()); + base.ChildActivities.Add(this.actNewHeya = new CActNewHeya()); + base.ChildActivities.Add(this.PuchiChara = new PuchiChara()); + + + for (int i = 0; i < 10; i++) { + stSongNumber[i].ch = i.ToString().ToCharArray()[0]; + stSongNumber[i].pt = new Point(27 * i, 0); + } + + for (int i = 0; i < 10; i++) { + stBoardNumber[i].ch = i.ToString().ToCharArray()[0]; + stBoardNumber[i].pt = new Point(15 * i, 0); + } + + this.CommandHistory = new CCommandHistory(); // #24063 2011.1.16 yyagi + } + + + // メソッド + + public void tNotifySelectedSongChange() { + int scroll = this.ct背景スクロール用タイマー.CurrentValue; + + if (rPrevSelectedSong != null) { + bool bchangedBGPath = rNowSelectedSong != null && rNowSelectedSong.strSelectBGPath != rPrevSelectedSong.strSelectBGPath; + + if (bchangedBGPath) + OpenTaiko.tテクスチャの解放(ref txCustomPrevSelectBG); + + txCustomPrevSelectBG = txCustomSelectBG; + + if (bchangedBGPath) { + if (rNowSelectedSong.strSelectBGPath != null && rNowSelectedSong.strSelectBGPath != "") { + txCustomSelectBG = OpenTaiko.tテクスチャの生成(rNowSelectedSong.strSelectBGPath); } else { - return 0; + txCustomSelectBG = null; } } } - public bool bIsEnumeratingSongs { - get { - return actSongList.bIsEnumeratingSongs; - } - set { - actSongList.bIsEnumeratingSongs = value; + + float scale = OpenTaiko.Skin.Resolution[1] / (float)txGenreBack.szTextureSize.Height; + this.ct背景スクロール用タイマー = new CCounter(0, (int)(txGenreBack.szTextureSize.Width * scale), 30, OpenTaiko.Timer); + this.ct背景スクロール用タイマー.CurrentValue = Math.Min(scroll, (int)(txGenreBack.szTextureSize.Width * scale)); + + float oldScale = OpenTaiko.Skin.Resolution[1] / (float)txOldGenreBack.szTextureSize.Height; + this.ctOldBGScroll = new CCounter(0, (int)(txOldGenreBack.szTextureSize.Width * oldScale), 30, OpenTaiko.Timer); + this.ctOldBGScroll.CurrentValue = Math.Min(scroll, (int)(txOldGenreBack.szTextureSize.Width * oldScale)); + + this.actPreimageパネル.tSelectedSongChanged(); + this.actPresound.t選択曲が変更された(); + this.act演奏履歴パネル.t選択曲が変更された(); + this.actステータスパネル.t選択曲が変更された(); + this.actArtistComment.t選択曲が変更された(); + actDanInfo.UpdateSong(); + + #region [ プラグインにも通知する(BOX, RANDOM, BACK なら通知しない)] + //--------------------- + if (OpenTaiko.app != null) { + var c曲リストノード = OpenTaiko.stageSongSelect.rNowSelectedSong; + var cスコア = OpenTaiko.stageSongSelect.r現在選択中のスコア; + + if (c曲リストノード != null && cスコア != null && c曲リストノード.eノード種別 == CSongListNode.ENodeType.SCORE) { + string str選択曲ファイル名 = cスコア.ファイル情報.ファイルの絶対パス; + int n曲番号inブロック = OpenTaiko.stageSongSelect.actSongList.n現在のアンカ難易度レベルに最も近い難易度レベルを返す(c曲リストノード); } } - public bool bCurrentlyScrolling { - get { - return this.actSongList.bスクロール中; - } - } - public int[] nChoosenSongDifficulty = new int[5]; + //--------------------- + #endregion + } - public string str確定された曲のジャンル { - get; - set; - } - public Cスコア r確定されたスコア { - get; - set; - } - public CSongListNode rChoosenSong { - get; - set; - } - public int n現在選択中の曲の難易度 { - get { - return this.actSongList.n現在選択中の曲の現在の難易度レベル; - } - } - public Cスコア r現在選択中のスコア { - get { - return this.actSongList.r現在選択中のスコア; - } - } - public CSongListNode rPrevSelectedSong { - get { - return this.actSongList.rPrevSelectedSong; - } - } - public CSongListNode rNowSelectedSong { - get { - return this.actSongList.rCurrentlySelectedSong; - } - set { - this.actSongList.rCurrentlySelectedSong = value; - } - } + // CStage 実装 - // コンストラクタ - public CStage選曲() { - base.eStageID = CStage.EStage.SongSelect; - base.ePhaseID = CStage.EPhase.Common_NORMAL; - base.IsDeActivated = true; - base.ChildActivities.Add(this.actオプションパネル = new CActオプションパネル()); - base.ChildActivities.Add(this.actFIFO = new CActFIFOBlack()); - base.ChildActivities.Add(this.actFIfrom結果画面 = new CActFIFOBlack()); - //base.list子Activities.Add( this.actFOtoNowLoading = new CActFIFOBlack() ); - base.ChildActivities.Add(this.actFOtoNowLoading = new CActFIFOStart()); - base.ChildActivities.Add(this.actSongList = new CActSelect曲リスト()); - base.ChildActivities.Add(this.actSongInfo = new CActSelectSongInfo()); - base.ChildActivities.Add(this.actDanInfo = new CActSelectDanInfo()); - base.ChildActivities.Add(this.actTowerInfo = new CActSelectTowerInfo()); - base.ChildActivities.Add(this.actステータスパネル = new CActSelectステータスパネル()); - base.ChildActivities.Add(this.act演奏履歴パネル = new CActSelect演奏履歴パネル()); - base.ChildActivities.Add(this.actPreimageパネル = new CActSelectPreimageパネル()); - base.ChildActivities.Add(this.actPresound = new CActSelectPresound()); - base.ChildActivities.Add(this.actArtistComment = new CActSelectArtistComment()); - base.ChildActivities.Add(this.actInformation = new CActSelectInformation()); - base.ChildActivities.Add(this.actSortSongs = new CActSortSongs()); - base.ChildActivities.Add(this.actShowCurrentPosition = new CActSelectShowCurrentPosition()); - base.ChildActivities.Add(this.actQuickConfig = new CActSelectQuickConfig()); - base.ChildActivities.Add(this.actDifficultySelectionScreen = new CActSelect難易度選択画面()); - base.ChildActivities.Add(this.actPlayOption = new CActPlayOption()); - base.ChildActivities.Add(this.actExExtraTransAnime = new CActSelectExExtraTransAnime()); - base.ChildActivities.Add(this.actNewHeya = new CActNewHeya()); - base.ChildActivities.Add(this.PuchiChara = new PuchiChara()); + /// + /// 曲リストをリセットする + /// + /// + public void Refresh(CSongs管理 cs, bool bRemakeSongTitleBar) { + this.actSongList.Refresh(cs, bRemakeSongTitleBar); + } + + public override void Activate() { + Trace.TraceInformation("選曲ステージを活性化します。"); + Trace.Indent(); + try { + nChoosenSongDifficulty = new int[5]; + this.eフェードアウト完了時の戻り値 = E戻り値.継続; + + // BGM played + this.bBGM再生済み = false; + + this.ct背景スクロール用タイマー = new CCounter(0, txGenreBack.szTextureSize.Width, 30, OpenTaiko.Timer); + this.ctOldBGScroll = new CCounter(0, txOldGenreBack.szTextureSize.Width, 30, OpenTaiko.Timer); + + OpenTaiko.Skin.voiceMenuSongSelect[OpenTaiko.SaveFile]?.tPlay(); + + for (int i = 0; i < 2; i++) + this.ctキー反復用[i] = new CCounter(0, 0, 0, OpenTaiko.Timer); + + //ctChara_Normal = new CCounter(0, TJAPlayer3.Tx.SongSelect_Chara_Normal.Length - 1, 1000 / 45, TJAPlayer3.Timer); + CMenuCharacter.tMenuResetTimer(CMenuCharacter.ECharacterAnimation.NORMAL); + + //ctChara_Select = new CCounter(); + //ctChara_Jump[0] = new CCounter(); + //ctChara_Jump[1] = new CCounter(); + + CMenuCharacter.tDisableCounter(CMenuCharacter.ECharacterAnimation.SELECT); + CMenuCharacter.tDisableCounter(CMenuCharacter.ECharacterAnimation.START); + + ctBackgroundFade = new CCounter(); + ctCreditAnime = new CCounter(0, 4500, 1, OpenTaiko.Timer); + ctTimer = new CCounter(0, 100, 1000, OpenTaiko.Timer); + + this.PuchiChara.IdleAnimation(); + + ctBackgroundFade.CurrentValue = 600; + + /* + if(TJAPlayer3.ConfigIni.bBGM音を発声する && !TJAPlayer3.Skin.bgm選曲画面イン.b再生中 && !TJAPlayer3.Skin.bgm選曲画面.b再生中) + TJAPlayer3.Skin.bgm選曲画面イン.t再生する(); + */ - for (int i = 0; i < 10; i++) { - stSongNumber[i].ch = i.ToString().ToCharArray()[0]; - stSongNumber[i].pt = new Point(27 * i, 0); - } + for (int i = 0; i < 3; i++) + r[i] = new Random(); - for (int i = 0; i < 10; i++) { - stBoardNumber[i].ch = i.ToString().ToCharArray()[0]; - stBoardNumber[i].pt = new Point(15 * i, 0); - } + //this.act難易度選択画面.bIsDifficltSelect = true; + base.Activate(); - this.CommandHistory = new CCommandHistory(); // #24063 2011.1.16 yyagi - } - - - // メソッド - - public void tNotifySelectedSongChange() { - int scroll = this.ct背景スクロール用タイマー.CurrentValue; - - if (rPrevSelectedSong != null) { - bool bchangedBGPath = rNowSelectedSong != null && rNowSelectedSong.strSelectBGPath != rPrevSelectedSong.strSelectBGPath; - - if (bchangedBGPath) - OpenTaiko.tテクスチャの解放(ref txCustomPrevSelectBG); - - txCustomPrevSelectBG = txCustomSelectBG; - - if (bchangedBGPath) { - if (rNowSelectedSong.strSelectBGPath != null && rNowSelectedSong.strSelectBGPath != "") { - txCustomSelectBG = OpenTaiko.tテクスチャの生成(rNowSelectedSong.strSelectBGPath); - } else { - txCustomSelectBG = null; - } + this.actステータスパネル.t選択曲が変更された(); // 最大ランクを更新 + // Discord Presenceの更新 + OpenTaiko.DiscordClient?.SetPresence(new RichPresence() { + Details = "", + State = "SongSelect", + Timestamps = new Timestamps(OpenTaiko.StartupTime), + Assets = new Assets() { + LargeImageKey = OpenTaiko.LargeImageKey, + LargeImageText = OpenTaiko.LargeImageText, } + }); + + + + if (rNowSelectedSong != null) + NowGenre = rNowSelectedSong.strジャンル; + + AI_Background = new ScriptBG(CSkin.Path($@"{TextureLoader.BASE}{TextureLoader.SONGSELECT}{Path.DirectorySeparatorChar}AIBattle{Path.DirectorySeparatorChar}Script.lua")); + AI_Background.Init(); + } finally { + Trace.TraceInformation("選曲ステージの活性化を完了しました。"); + Trace.Unindent(); + } + } + public override void DeActivate() { + Trace.TraceInformation("選曲ステージを非活性化します。"); + Trace.Indent(); + try { + for (int i = 0; i < 2; i++) { + this.ctキー反復用[i] = null; } - float scale = OpenTaiko.Skin.Resolution[1] / (float)txGenreBack.szTextureSize.Height; - this.ct背景スクロール用タイマー = new CCounter(0, (int)(txGenreBack.szTextureSize.Width * scale), 30, OpenTaiko.Timer); - this.ct背景スクロール用タイマー.CurrentValue = Math.Min(scroll, (int)(txGenreBack.szTextureSize.Width * scale)); + OpenTaiko.tDisposeSafely(ref AI_Background); - float oldScale = OpenTaiko.Skin.Resolution[1] / (float)txOldGenreBack.szTextureSize.Height; - this.ctOldBGScroll = new CCounter(0, (int)(txOldGenreBack.szTextureSize.Width * oldScale), 30, OpenTaiko.Timer); - this.ctOldBGScroll.CurrentValue = Math.Min(scroll, (int)(txOldGenreBack.szTextureSize.Width * oldScale)); + base.DeActivate(); + } finally { + Trace.TraceInformation("選曲ステージの非活性化を完了しました。"); + Trace.Unindent(); + } + } + public override void CreateManagedResource() { + this.ftフォント = new CCachedFontRenderer(CFontRenderer.DefaultFontName, 26, CFontRenderer.FontStyle.Regular); - this.actPreimageパネル.tSelectedSongChanged(); - this.actPresound.t選択曲が変更された(); - this.act演奏履歴パネル.t選択曲が変更された(); - this.actステータスパネル.t選択曲が変更された(); - this.actArtistComment.t選択曲が変更された(); - actDanInfo.UpdateSong(); + base.CreateManagedResource(); + } + public override void ReleaseManagedResource() { + if (this.ftフォント != null) { + this.ftフォント.Dispose(); + this.ftフォント = null; + } - #region [ プラグインにも通知する(BOX, RANDOM, BACK なら通知しない)] + base.ReleaseManagedResource(); + } + public override int Draw() { + if (!base.IsDeActivated) { + this.ct背景スクロール用タイマー.TickLoop(); + this.ctOldBGScroll.TickLoop(); + #region [ 初めての進行描画 ] //--------------------- - if (OpenTaiko.app != null) { - var c曲リストノード = OpenTaiko.stageSongSelect.rNowSelectedSong; - var cスコア = OpenTaiko.stageSongSelect.r現在選択中のスコア; - - if (c曲リストノード != null && cスコア != null && c曲リストノード.eノード種別 == CSongListNode.ENodeType.SCORE) { - string str選択曲ファイル名 = cスコア.ファイル情報.ファイルの絶対パス; - int n曲番号inブロック = OpenTaiko.stageSongSelect.actSongList.n現在のアンカ難易度レベルに最も近い難易度レベルを返す(c曲リストノード); + if (base.IsFirstDraw) { + this.ct登場時アニメ用共通 = new CCounter(0, 100, 3, OpenTaiko.Timer); + if (OpenTaiko.r直前のステージ == OpenTaiko.stage結果) { + this.actFIfrom結果画面.tフェードイン開始(); + base.ePhaseID = CStage.EPhase.SongSelect_FadeInFromResults; + } else { + this.actFIFO.tフェードイン開始(); + base.ePhaseID = CStage.EPhase.Common_FADEIN; } + this.tNotifySelectedSongChange(); + base.IsFirstDraw = false; } //--------------------- #endregion - } - - // CStage 実装 - - /// - /// 曲リストをリセットする - /// - /// - public void Refresh(CSongs管理 cs, bool bRemakeSongTitleBar) { - this.actSongList.Refresh(cs, bRemakeSongTitleBar); - } - - public override void Activate() { - Trace.TraceInformation("選曲ステージを活性化します。"); - Trace.Indent(); - try { - nChoosenSongDifficulty = new int[5]; - this.eフェードアウト完了時の戻り値 = E戻り値.継続; - - // BGM played - this.bBGM再生済み = false; - - this.ct背景スクロール用タイマー = new CCounter(0, txGenreBack.szTextureSize.Width, 30, OpenTaiko.Timer); - this.ctOldBGScroll = new CCounter(0, txOldGenreBack.szTextureSize.Width, 30, OpenTaiko.Timer); - - OpenTaiko.Skin.voiceMenuSongSelect[OpenTaiko.SaveFile]?.tPlay(); - - for (int i = 0; i < 2; i++) - this.ctキー反復用[i] = new CCounter(0, 0, 0, OpenTaiko.Timer); - - //ctChara_Normal = new CCounter(0, TJAPlayer3.Tx.SongSelect_Chara_Normal.Length - 1, 1000 / 45, TJAPlayer3.Timer); - CMenuCharacter.tMenuResetTimer(CMenuCharacter.ECharacterAnimation.NORMAL); - - //ctChara_Select = new CCounter(); - //ctChara_Jump[0] = new CCounter(); - //ctChara_Jump[1] = new CCounter(); - - CMenuCharacter.tDisableCounter(CMenuCharacter.ECharacterAnimation.SELECT); - CMenuCharacter.tDisableCounter(CMenuCharacter.ECharacterAnimation.START); - - ctBackgroundFade = new CCounter(); - ctCreditAnime = new CCounter(0, 4500, 1, OpenTaiko.Timer); - ctTimer = new CCounter(0, 100, 1000, OpenTaiko.Timer); - - this.PuchiChara.IdleAnimation(); - - ctBackgroundFade.CurrentValue = 600; - - /* - if(TJAPlayer3.ConfigIni.bBGM音を発声する && !TJAPlayer3.Skin.bgm選曲画面イン.b再生中 && !TJAPlayer3.Skin.bgm選曲画面.b再生中) - TJAPlayer3.Skin.bgm選曲画面イン.t再生する(); - */ - for (int i = 0; i < 3; i++) - r[i] = new Random(); + ctTimer.Tick(); + ctCreditAnime.TickLoop(); + ctBackgroundFade.Tick(); - //this.act難易度選択画面.bIsDifficltSelect = true; - base.Activate(); + //ctChara_Select.t進行(); + //ctChara_Jump[0].t進行(); + //ctChara_Jump[1].t進行(); + //ctChara_Normal.t進行Loop(); - this.actステータスパネル.t選択曲が変更された(); // 最大ランクを更新 - // Discord Presenceの更新 - OpenTaiko.DiscordClient?.SetPresence(new RichPresence() { - Details = "", - State = "SongSelect", - Timestamps = new Timestamps(OpenTaiko.StartupTime), - Assets = new Assets() { - LargeImageKey = OpenTaiko.LargeImageKey, - LargeImageText = OpenTaiko.LargeImageText, - } - }); + this.ct登場時アニメ用共通.Tick(); - - - if (rNowSelectedSong != null) - NowGenre = rNowSelectedSong.strジャンル; - - AI_Background = new ScriptBG(CSkin.Path($@"{TextureLoader.BASE}{TextureLoader.SONGSELECT}{Path.DirectorySeparatorChar}AIBattle{Path.DirectorySeparatorChar}Script.lua")); - AI_Background.Init(); - } finally { - Trace.TraceInformation("選曲ステージの活性化を完了しました。"); - Trace.Unindent(); - } - } - public override void DeActivate() { - Trace.TraceInformation("選曲ステージを非活性化します。"); - Trace.Indent(); - try { - for (int i = 0; i < 2; i++) { - this.ctキー反復用[i] = null; - } - - OpenTaiko.tDisposeSafely(ref AI_Background); - - base.DeActivate(); - } finally { - Trace.TraceInformation("選曲ステージの非活性化を完了しました。"); - Trace.Unindent(); - } - } - public override void CreateManagedResource() { - this.ftフォント = new CCachedFontRenderer(CFontRenderer.DefaultFontName, 26, CFontRenderer.FontStyle.Regular); - - base.CreateManagedResource(); - } - public override void ReleaseManagedResource() { - if (this.ftフォント != null) { - this.ftフォント.Dispose(); - this.ftフォント = null; + if (OpenTaiko.ConfigIni.bAIBattleMode) { + AI_Background?.Update(); + AI_Background?.Draw(); + } else { + if (OpenTaiko.Tx.SongSelect_Background != null) + OpenTaiko.Tx.SongSelect_Background.t2D描画(0, 0); } - base.ReleaseManagedResource(); - } - public override int Draw() { - if (!base.IsDeActivated) { - this.ct背景スクロール用タイマー.TickLoop(); - this.ctOldBGScroll.TickLoop(); - #region [ 初めての進行描画 ] - //--------------------- - if (base.IsFirstDraw) { - this.ct登場時アニメ用共通 = new CCounter(0, 100, 3, OpenTaiko.Timer); - if (OpenTaiko.r直前のステージ == OpenTaiko.stage結果) { - this.actFIfrom結果画面.tフェードイン開始(); - base.ePhaseID = CStage.EPhase.SongSelect_FadeInFromResults; - } else { - this.actFIFO.tフェードイン開始(); - base.ePhaseID = CStage.EPhase.Common_FADEIN; - } - this.tNotifySelectedSongChange(); - base.IsFirstDraw = false; - } - //--------------------- - #endregion + if (this.rNowSelectedSong != null) { + #region [Background] - ctTimer.Tick(); - ctCreditAnime.TickLoop(); - ctBackgroundFade.Tick(); + nGenreBack = this.NowBg; + nOldGenreBack = this.OldBg; - //ctChara_Select.t進行(); - //ctChara_Jump[0].t進行(); - //ctChara_Jump[1].t進行(); - //ctChara_Normal.t進行Loop(); - - this.ct登場時アニメ用共通.Tick(); - - if (OpenTaiko.ConfigIni.bAIBattleMode) { - AI_Background?.Update(); - AI_Background?.Draw(); - } else { - if (OpenTaiko.Tx.SongSelect_Background != null) - OpenTaiko.Tx.SongSelect_Background.t2D描画(0, 0); - } - - if (this.rNowSelectedSong != null) { - - #region [Background] - - nGenreBack = this.NowBg; - nOldGenreBack = this.OldBg; - - if (!OpenTaiko.ConfigIni.bAIBattleMode) { - if (txGenreBack != null) { - float scale = OpenTaiko.Skin.Resolution[1] / (float)txGenreBack.szTextureSize.Height; - for (int i = 0; i < (OpenTaiko.Skin.Resolution[0] / (txGenreBack.szTextureSize.Width * scale)) + 2; i++) { - if (txGenreBack != null) { - txGenreBack.color4 = CConversion.ColorToColor4(this.NowBgColor); - txGenreBack.Opacity = 255; - txGenreBack.vcScaleRatio.X = scale; - txGenreBack.vcScaleRatio.Y = scale; - txGenreBack.t2D描画(-(int)ct背景スクロール用タイマー.CurrentValue + (txGenreBack.szTextureSize.Width * scale) * i, 0); - } - } - } - if (txOldGenreBack != null) { - float scale = OpenTaiko.Skin.Resolution[1] / (float)txOldGenreBack.szTextureSize.Height; - for (int i = 0; i < (OpenTaiko.Skin.Resolution[0] / (txOldGenreBack.szTextureSize.Width * scale)) + 2; i++) { - if (txOldGenreBack != null) { - txOldGenreBack.color4 = CConversion.ColorToColor4(this.OldBgColor); - txOldGenreBack.Opacity = 600 - ctBackgroundFade.CurrentValue; - txOldGenreBack.vcScaleRatio.X = scale; - txOldGenreBack.vcScaleRatio.Y = scale; - txOldGenreBack.t2D描画(-(int)ctOldBGScroll.CurrentValue + (txOldGenreBack.szTextureSize.Width * scale) * i, 0); - } + if (!OpenTaiko.ConfigIni.bAIBattleMode) { + if (txGenreBack != null) { + float scale = OpenTaiko.Skin.Resolution[1] / (float)txGenreBack.szTextureSize.Height; + for (int i = 0; i < (OpenTaiko.Skin.Resolution[0] / (txGenreBack.szTextureSize.Width * scale)) + 2; i++) { + if (txGenreBack != null) { + txGenreBack.color4 = CConversion.ColorToColor4(this.NowBgColor); + txGenreBack.Opacity = 255; + txGenreBack.vcScaleRatio.X = scale; + txGenreBack.vcScaleRatio.Y = scale; + txGenreBack.t2D描画(-(int)ct背景スクロール用タイマー.CurrentValue + (txGenreBack.szTextureSize.Width * scale) * i, 0); } } } - - #endregion - - #region [Song Panel] - - if (this.rNowSelectedSong.eノード種別 == CSongListNode.ENodeType.BOX) { - OpenTaiko.Tx.SongSelect_Song_Panel[0]?.t2D描画(0, 0); - } else if (this.rNowSelectedSong.eノード種別 == CSongListNode.ENodeType.SCORE) { - var IsSongLocked = OpenTaiko.Databases.DBSongUnlockables.tIsSongLocked(this.rNowSelectedSong); - var HiddenIndex = OpenTaiko.Databases.DBSongUnlockables.tGetSongHiddenIndex(this.rNowSelectedSong); - - if (HiddenIndex >= DBSongUnlockables.EHiddenIndex.GRAYED) { - OpenTaiko.Tx.SongSelect_Song_Panel[4]?.t2D描画(0, 0); - } else { - if (OpenTaiko.stageSongSelect.n現在選択中の曲の難易度 == (int)Difficulty.Dan) - OpenTaiko.Tx.SongSelect_Song_Panel[2]?.t2D描画(0, 0); - else if (OpenTaiko.stageSongSelect.n現在選択中の曲の難易度 == (int)Difficulty.Tower) - OpenTaiko.Tx.SongSelect_Song_Panel[3]?.t2D描画(0, 0); - else - OpenTaiko.Tx.SongSelect_Song_Panel[1]?.t2D描画(0, 0); - } - } - - #endregion - } - - this.actSongList.Draw(); - int y = 0; - if (this.ct登場時アニメ用共通.IsTicked) { - double db登場割合 = ((double)this.ct登場時アニメ用共通.CurrentValue) / 100.0; // 100が最終値 - double dbY表示割合 = Math.Sin(Math.PI / 2 * db登場割合); - y = ((int)(OpenTaiko.Tx.SongSelect_Header.sz画像サイズ.Height * dbY表示割合)) - OpenTaiko.Tx.SongSelect_Header.sz画像サイズ.Height; - } - - OpenTaiko.Tx.SongSelect_Header?.t2D描画(0, 0); - OpenTaiko.Tx.SongSelect_Footer?.t2D描画(0, 0); - - tTimerDraw(100 - ctTimer.CurrentValue); - - #region [Song Info] - - if (this.rNowSelectedSong != null) { - if (this.rNowSelectedSong.eノード種別 == CSongListNode.ENodeType.BOX) { - } else if (this.rNowSelectedSong.eノード種別 == CSongListNode.ENodeType.SCORE) { - var IsSongLocked = OpenTaiko.Databases.DBSongUnlockables.tIsSongLocked(this.rNowSelectedSong); - var HiddenIndex = OpenTaiko.Databases.DBSongUnlockables.tGetSongHiddenIndex(this.rNowSelectedSong); - - if (HiddenIndex < DBSongUnlockables.EHiddenIndex.GRAYED) { - actSongInfo.Draw(); - if (this.n現在選択中の曲の難易度 == (int)Difficulty.Dan) { - actDanInfo.Draw(); - } else if (this.n現在選択中の曲の難易度 == (int)Difficulty.Tower) { - actTowerInfo.Draw(); - } else { + if (txOldGenreBack != null) { + float scale = OpenTaiko.Skin.Resolution[1] / (float)txOldGenreBack.szTextureSize.Height; + for (int i = 0; i < (OpenTaiko.Skin.Resolution[0] / (txOldGenreBack.szTextureSize.Width * scale)) + 2; i++) { + if (txOldGenreBack != null) { + txOldGenreBack.color4 = CConversion.ColorToColor4(this.OldBgColor); + txOldGenreBack.Opacity = 600 - ctBackgroundFade.CurrentValue; + txOldGenreBack.vcScaleRatio.X = scale; + txOldGenreBack.vcScaleRatio.Y = scale; + txOldGenreBack.t2D描画(-(int)ctOldBGScroll.CurrentValue + (txOldGenreBack.szTextureSize.Width * scale) * i, 0); } } } @@ -476,235 +420,374 @@ namespace OpenTaiko { #endregion - tSongNumberDraw(OpenTaiko.Skin.SongSelect_SongNumber_X[0], OpenTaiko.Skin.SongSelect_SongNumber_Y[0], NowSong); - tSongNumberDraw(OpenTaiko.Skin.SongSelect_SongNumber_X[1], OpenTaiko.Skin.SongSelect_SongNumber_Y[1], MaxSong); + #region [Song Panel] - this.actInformation.Draw(); - - #region[Modicons] - - for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { - ModIcons.tDisplayModsMenu(OpenTaiko.Skin.SongSelect_ModIcons_X[i], OpenTaiko.Skin.SongSelect_ModIcons_Y[i], i); - } - - if (OpenTaiko.ConfigIni.bTokkunMode) - OpenTaiko.actTextConsole.Print(0, 0, CTextConsole.EFontType.White, "GAME: TRAINING MODE"); - if (OpenTaiko.ConfigIni.eGameMode == EGame.Survival) - OpenTaiko.actTextConsole.Print(0, 16, CTextConsole.EFontType.White, "GAME: SURVIVAL"); - if (OpenTaiko.ConfigIni.eGameMode == EGame.SurvivalHard) - OpenTaiko.actTextConsole.Print(0, 16, CTextConsole.EFontType.White, "GAME: SURVIVAL HARD"); - if (OpenTaiko.ConfigIni.bSuperHard) - OpenTaiko.actTextConsole.Print(0, 32, CTextConsole.EFontType.Cyan, "SUPER HARD MODE : ON"); - - #endregion - - #region [Preimage, upper lock layer and unlock conditions] - - if (this.rNowSelectedSong != null - && this.rNowSelectedSong.eノード種別 == CSongListNode.ENodeType.SCORE) { + if (this.rNowSelectedSong.eノード種別 == CSongListNode.ENodeType.BOX) { + OpenTaiko.Tx.SongSelect_Song_Panel[0]?.t2D描画(0, 0); + } else if (this.rNowSelectedSong.eノード種別 == CSongListNode.ENodeType.SCORE) { var IsSongLocked = OpenTaiko.Databases.DBSongUnlockables.tIsSongLocked(this.rNowSelectedSong); var HiddenIndex = OpenTaiko.Databases.DBSongUnlockables.tGetSongHiddenIndex(this.rNowSelectedSong); - if (this.actDifficultySelectionScreen.bIsDifficltSelect == false || this.actSongList.ctDifficultyIn.CurrentValue < 1000) - this.actPreimageパネル.Draw(); - - if (HiddenIndex >= DBSongUnlockables.EHiddenIndex.GRAYED) - OpenTaiko.Tx.SongSelect_Song_Panel[5]?.t2D描画(0, 0); - - if (IsSongLocked) { - OpenTaiko.Tx.SongSelect_Unlock_Conditions?.t2D描画(0, 0); - - if (actSongList.ttkNowUnlockConditionText is not null) { - TitleTextureKey.ResolveTitleTexture(actSongList.ttkNowUnlockConditionText)?.t2D描画(OpenTaiko.Skin.SongSelect_Unlock_Conditions_Text[0], OpenTaiko.Skin.SongSelect_Unlock_Conditions_Text[1]); - } + if (HiddenIndex >= DBSongUnlockables.EHiddenIndex.GRAYED) { + OpenTaiko.Tx.SongSelect_Song_Panel[4]?.t2D描画(0, 0); + } else { + if (OpenTaiko.stageSongSelect.n現在選択中の曲の難易度 == (int)Difficulty.Dan) + OpenTaiko.Tx.SongSelect_Song_Panel[2]?.t2D描画(0, 0); + else if (OpenTaiko.stageSongSelect.n現在選択中の曲の難易度 == (int)Difficulty.Tower) + OpenTaiko.Tx.SongSelect_Song_Panel[3]?.t2D描画(0, 0); + else + OpenTaiko.Tx.SongSelect_Song_Panel[1]?.t2D描画(0, 0); } } #endregion + } - this.actPresound.Draw(); + this.actSongList.Draw(); + int y = 0; + if (this.ct登場時アニメ用共通.IsTicked) { + double db登場割合 = ((double)this.ct登場時アニメ用共通.CurrentValue) / 100.0; // 100が最終値 + double dbY表示割合 = Math.Sin(Math.PI / 2 * db登場割合); + y = ((int)(OpenTaiko.Tx.SongSelect_Header.sz画像サイズ.Height * dbY表示割合)) - OpenTaiko.Tx.SongSelect_Header.sz画像サイズ.Height; + } - this.act演奏履歴パネル.Draw(); + OpenTaiko.Tx.SongSelect_Header?.t2D描画(0, 0); + OpenTaiko.Tx.SongSelect_Footer?.t2D描画(0, 0); - this.actShowCurrentPosition.Draw(); // #27648 2011.3.28 yyagi + tTimerDraw(100 - ctTimer.CurrentValue); - // Select screen song - if (base.ePhaseID == CStage.EPhase.Common_NORMAL) { - CSongSelectSongManager.playSongIfPossible(); + #region [Song Info] + + if (this.rNowSelectedSong != null) { + if (this.rNowSelectedSong.eノード種別 == CSongListNode.ENodeType.BOX) { + } else if (this.rNowSelectedSong.eノード種別 == CSongListNode.ENodeType.SCORE) { + var IsSongLocked = OpenTaiko.Databases.DBSongUnlockables.tIsSongLocked(this.rNowSelectedSong); + var HiddenIndex = OpenTaiko.Databases.DBSongUnlockables.tGetSongHiddenIndex(this.rNowSelectedSong); + + if (HiddenIndex < DBSongUnlockables.EHiddenIndex.GRAYED) { + actSongInfo.Draw(); + if (this.n現在選択中の曲の難易度 == (int)Difficulty.Dan) { + actDanInfo.Draw(); + } else if (this.n現在選択中の曲の難易度 == (int)Difficulty.Tower) { + actTowerInfo.Draw(); + } else { + } + } } + } - if (this.ctDiffSelect移動待ち != null) - this.ctDiffSelect移動待ち.Tick(); + #endregion + + tSongNumberDraw(OpenTaiko.Skin.SongSelect_SongNumber_X[0], OpenTaiko.Skin.SongSelect_SongNumber_Y[0], NowSong); + tSongNumberDraw(OpenTaiko.Skin.SongSelect_SongNumber_X[1], OpenTaiko.Skin.SongSelect_SongNumber_Y[1], MaxSong); + + this.actInformation.Draw(); + + #region[Modicons] + + for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { + ModIcons.tDisplayModsMenu(OpenTaiko.Skin.SongSelect_ModIcons_X[i], OpenTaiko.Skin.SongSelect_ModIcons_Y[i], i); + } + + if (OpenTaiko.ConfigIni.bTokkunMode) + OpenTaiko.actTextConsole.Print(0, 0, CTextConsole.EFontType.White, "GAME: TRAINING MODE"); + if (OpenTaiko.ConfigIni.eGameMode == EGame.Survival) + OpenTaiko.actTextConsole.Print(0, 16, CTextConsole.EFontType.White, "GAME: SURVIVAL"); + if (OpenTaiko.ConfigIni.eGameMode == EGame.SurvivalHard) + OpenTaiko.actTextConsole.Print(0, 16, CTextConsole.EFontType.White, "GAME: SURVIVAL HARD"); + if (OpenTaiko.ConfigIni.bSuperHard) + OpenTaiko.actTextConsole.Print(0, 32, CTextConsole.EFontType.Cyan, "SUPER HARD MODE : ON"); + + #endregion + + #region [Preimage, upper lock layer and unlock conditions] + + if (this.rNowSelectedSong != null + && this.rNowSelectedSong.eノード種別 == CSongListNode.ENodeType.SCORE) { + var IsSongLocked = OpenTaiko.Databases.DBSongUnlockables.tIsSongLocked(this.rNowSelectedSong); + var HiddenIndex = OpenTaiko.Databases.DBSongUnlockables.tGetSongHiddenIndex(this.rNowSelectedSong); + + if (this.actDifficultySelectionScreen.bIsDifficltSelect == false || this.actSongList.ctDifficultyIn.CurrentValue < 1000) + this.actPreimageパネル.Draw(); + + if (HiddenIndex >= DBSongUnlockables.EHiddenIndex.GRAYED) + OpenTaiko.Tx.SongSelect_Song_Panel[5]?.t2D描画(0, 0); + + if (IsSongLocked) { + OpenTaiko.Tx.SongSelect_Unlock_Conditions?.t2D描画(0, 0); + + if (actSongList.ttkNowUnlockConditionText is not null) { + TitleTextureKey.ResolveTitleTexture(actSongList.ttkNowUnlockConditionText)?.t2D描画(OpenTaiko.Skin.SongSelect_Unlock_Conditions_Text[0], OpenTaiko.Skin.SongSelect_Unlock_Conditions_Text[1]); + } + } + } + + #endregion + + this.actPresound.Draw(); + + this.act演奏履歴パネル.Draw(); + + this.actShowCurrentPosition.Draw(); // #27648 2011.3.28 yyagi + + // Select screen song + if (base.ePhaseID == CStage.EPhase.Common_NORMAL) { + CSongSelectSongManager.playSongIfPossible(); + } + + if (this.ctDiffSelect移動待ち != null) + this.ctDiffSelect移動待ち.Tick(); - #region [Character & PuchiChara] + #region [Character & PuchiChara] - //if (this.ctChara_Select.b終了値に達してない) + //if (this.ctChara_Select.b終了値に達してない) - for (int player = 0; player < OpenTaiko.ConfigIni.nPlayerCount; player++) { - CCounter ___cc = CMenuCharacter._getReferenceCounter(CMenuCharacter.ECharacterAnimation.SELECT)[player]; + for (int player = 0; player < OpenTaiko.ConfigIni.nPlayerCount; player++) { + CCounter ___cc = CMenuCharacter._getReferenceCounter(CMenuCharacter.ECharacterAnimation.SELECT)[player]; - int _charaId = OpenTaiko.SaveFileInstances[OpenTaiko.GetActualPlayer(player)].data.Character; + int _charaId = OpenTaiko.SaveFileInstances[OpenTaiko.GetActualPlayer(player)].data.Character; - //int chara_x = TJAPlayer3.Skin.Characters_Menu_X[_charaId][player]; - //int chara_y = TJAPlayer3.Skin.Characters_Menu_Y[_charaId][player]; + //int chara_x = TJAPlayer3.Skin.Characters_Menu_X[_charaId][player]; + //int chara_y = TJAPlayer3.Skin.Characters_Menu_Y[_charaId][player]; - int chara_x = OpenTaiko.Skin.SongSelect_NamePlate_X[player] + OpenTaiko.Tx.NamePlateBase.szTextureSize.Width / 2; - int chara_y = OpenTaiko.Skin.SongSelect_NamePlate_Y[player]; + int chara_x = OpenTaiko.Skin.SongSelect_NamePlate_X[player] + OpenTaiko.Tx.NamePlateBase.szTextureSize.Width / 2; + int chara_y = OpenTaiko.Skin.SongSelect_NamePlate_Y[player]; - //int puchi_x = player == 0 ? 0 + 100 : 981 + 250; - //int puchi_y = player == 0 ? 330 + 230 : 330 + 230; + //int puchi_x = player == 0 ? 0 + 100 : 981 + 250; + //int puchi_y = player == 0 ? 330 + 230 : 330 + 230; - int puchi_x = chara_x + OpenTaiko.Skin.Adjustments_MenuPuchichara_X[player % 2]; - int puchi_y = chara_y + OpenTaiko.Skin.Adjustments_MenuPuchichara_Y[player % 2]; + int puchi_x = chara_x + OpenTaiko.Skin.Adjustments_MenuPuchichara_X[player % 2]; + int puchi_y = chara_y + OpenTaiko.Skin.Adjustments_MenuPuchichara_Y[player % 2]; - if (___cc != null && ___cc.IsUnEnded) { - CMenuCharacter.tMenuDisplayCharacter(player, chara_x, chara_y, CMenuCharacter.ECharacterAnimation.SELECT); + if (___cc != null && ___cc.IsUnEnded) { + CMenuCharacter.tMenuDisplayCharacter(player, chara_x, chara_y, CMenuCharacter.ECharacterAnimation.SELECT); + + this.PuchiChara.On進行描画(puchi_x, puchi_y, false, 255, false, player); + } else { + CCounter ___cj = CMenuCharacter._getReferenceCounter(CMenuCharacter.ECharacterAnimation.START)[player]; + + + if (___cj != null && ___cj.EndValue > 0) { + CMenuCharacter.tMenuDisplayCharacter(player, chara_x, chara_y, CMenuCharacter.ECharacterAnimation.START); + + this.PuchiChara.On進行描画(puchi_x, puchi_y, false, 255, false, player); + } else if (actDifficultySelectionScreen.bIsDifficltSelect && actDifficultySelectionScreen.bSelect[player]) { + CMenuCharacter.tMenuDisplayCharacter(player, chara_x, chara_y, CMenuCharacter.ECharacterAnimation.WAIT); this.PuchiChara.On進行描画(puchi_x, puchi_y, false, 255, false, player); } else { - CCounter ___cj = CMenuCharacter._getReferenceCounter(CMenuCharacter.ECharacterAnimation.START)[player]; + CMenuCharacter.tMenuDisplayCharacter(player, chara_x, chara_y, CMenuCharacter.ECharacterAnimation.NORMAL); + + this.PuchiChara.On進行描画(puchi_x, puchi_y, false, 255, false, player); + } + } + } - if (___cj != null && ___cj.EndValue > 0) { - CMenuCharacter.tMenuDisplayCharacter(player, chara_x, chara_y, CMenuCharacter.ECharacterAnimation.START); + #endregion - this.PuchiChara.On進行描画(puchi_x, puchi_y, false, 255, false, player); - } else if (actDifficultySelectionScreen.bIsDifficltSelect && actDifficultySelectionScreen.bSelect[player]) { - CMenuCharacter.tMenuDisplayCharacter(player, chara_x, chara_y, CMenuCharacter.ECharacterAnimation.WAIT); + #region [ Nameplate ] + for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { + OpenTaiko.NamePlate.tNamePlateDraw(OpenTaiko.Skin.SongSelect_NamePlate_X[i], OpenTaiko.Skin.SongSelect_NamePlate_Y[i], i); + } + #endregion - this.PuchiChara.On進行描画(puchi_x, puchi_y, false, 255, false, player); + #region [Pad displayables] + + int defaultTable = Math.Max(0, Math.Min((int)Difficulty.Edit + 1, OpenTaiko.ConfigIni.nDefaultCourse)); + + int[] currentPads = new int[5] { + defaultTable, + defaultTable, + defaultTable, + defaultTable, + defaultTable }; + + //int currentPad = (int)Difficulty.Edit + 1; + if (OpenTaiko.stageSongSelect.actDifficultySelectionScreen.bIsDifficltSelect) { + if (OpenTaiko.stageSongSelect.actDifficultySelectionScreen.n現在の選択行[0] >= 2) + currentPads[0] = OpenTaiko.stageSongSelect.actDifficultySelectionScreen.n現在の選択行[0] - 2; + if (OpenTaiko.ConfigIni.nPlayerCount > 1 && OpenTaiko.stageSongSelect.actDifficultySelectionScreen.n現在の選択行[1] >= 2) + currentPads[1] = OpenTaiko.stageSongSelect.actDifficultySelectionScreen.n現在の選択行[1] - 2; + if (OpenTaiko.ConfigIni.nPlayerCount > 1 && OpenTaiko.stageSongSelect.actDifficultySelectionScreen.n現在の選択行[2] >= 2) + currentPads[2] = OpenTaiko.stageSongSelect.actDifficultySelectionScreen.n現在の選択行[2] - 2; + if (OpenTaiko.ConfigIni.nPlayerCount > 1 && OpenTaiko.stageSongSelect.actDifficultySelectionScreen.n現在の選択行[3] >= 2) + currentPads[3] = OpenTaiko.stageSongSelect.actDifficultySelectionScreen.n現在の選択行[3] - 2; + if (OpenTaiko.ConfigIni.nPlayerCount > 1 && OpenTaiko.stageSongSelect.actDifficultySelectionScreen.n現在の選択行[4] >= 2) + currentPads[4] = OpenTaiko.stageSongSelect.actDifficultySelectionScreen.n現在の選択行[4] - 2; + } + + + + for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { + if (OpenTaiko.ConfigIni.bAIBattleMode && i == 1) break; + + int p = OpenTaiko.GetActualPlayer(i); + + OpenTaiko.Tx.SongSelect_Table[currentPads[i]]?.t2D描画(OpenTaiko.Skin.SongSelect_Table_X[i], OpenTaiko.Skin.SongSelect_Table_Y[i]); + + CActSelect曲リスト.CScorePad[] SPArrRef = CSongDict.ScorePads[p]; + + // Current board + for (int j = 0; j < 11; j++) { + tBoardNumberDraw(OpenTaiko.Skin.SongSelect_BoardNumber_X[i][j], OpenTaiko.Skin.SongSelect_BoardNumber_Y[i][j], j < 7 ? + SPArrRef[currentPads[i]].ScoreRankCount[j] + : SPArrRef[currentPads[i]].CrownCount[j - 7]); + } + + } + + if (OpenTaiko.ConfigIni.nPlayerCount <= 2) { + OpenTaiko.Tx.SongSelect_Coin_Slot[0]?.t2D描画(0, 0, + new Rectangle(0, 0, (OpenTaiko.Tx.SongSelect_Coin_Slot[0].sz画像サイズ.Width / 2) + ((OpenTaiko.ConfigIni.nPlayerCount > 1 && !OpenTaiko.ConfigIni.bAIBattleMode) ? (OpenTaiko.Tx.SongSelect_Coin_Slot[0].sz画像サイズ.Width / 2) : 0), OpenTaiko.Tx.SongSelect_Coin_Slot[0].sz画像サイズ.Height)); + } else { + OpenTaiko.Tx.SongSelect_Coin_Slot[OpenTaiko.ConfigIni.nPlayerCount - 2]?.t2D描画(0, 0); + } + + for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { + if (OpenTaiko.ConfigIni.bAIBattleMode && i == 1) break; + + int p = OpenTaiko.GetActualPlayer(i); + + if (OpenTaiko.SaveFileInstances[p].data.Medals >= 0) + tBoardNumberDraw(OpenTaiko.Skin.SongSelect_BoardNumber_X[i][11], OpenTaiko.Skin.SongSelect_BoardNumber_Y[i][11], (int)OpenTaiko.SaveFileInstances[p].data.Medals); + + #region [HiScore plate] + + var song = this.rNowSelectedSong; + + if (song != null && song.eノード種別 == CSongListNode.ENodeType.SCORE) { + var closest = this.actSongList.n現在のアンカ難易度レベルに最も近い難易度レベルを返す(song); + var score = song.arスコア[closest]; + + if (score != null) { + int displayedScore = 0; + int table = 0; + + OpenTaiko.Tx.SongSelect_High_Score?.t2D中心基準描画(OpenTaiko.Skin.SongSelect_High_Score_X[i], OpenTaiko.Skin.SongSelect_High_Score_Y[i]); + + if (this.n現在選択中の曲の難易度 > (int)Difficulty.Edit) + table = 0; + else if (currentPads[i] <= (int)Difficulty.Edit) + table = currentPads[i]; + else + table = closest; + + var TableEntry = OpenTaiko.SaveFileInstances[p].data.tGetSongSelectTableEntry(OpenTaiko.stageSongSelect.rNowSelectedSong.tGetUniqueId()); + displayedScore = TableEntry.HighScore[table]; + + if (this.n現在選択中の曲の難易度 <= (int)Difficulty.Edit) { + CTexture __tex = (OpenTaiko.Tx.SongSelect_Difficulty_Cymbol == null) ? OpenTaiko.Tx.Dani_Difficulty_Cymbol : OpenTaiko.Tx.SongSelect_Difficulty_Cymbol; + int width = __tex.sz画像サイズ.Width / 5; + int height = __tex.sz画像サイズ.Height; + + __tex.t2D中心基準描画( + OpenTaiko.Skin.SongSelect_High_Score_Difficulty_Cymbol_X[i], + OpenTaiko.Skin.SongSelect_High_Score_Difficulty_Cymbol_Y[i], + new Rectangle(table * width, 0, width, height)); + } + + tBoardNumberDraw(OpenTaiko.Skin.SongSelect_BoardNumber_X[i][12], OpenTaiko.Skin.SongSelect_BoardNumber_Y[i][12], displayedScore); + } + + } + + #endregion + } + + #endregion + + + #region [ Inputs ] + + // キー入力 + if (base.ePhaseID == CStage.EPhase.Common_NORMAL) { + #region [ 簡易CONFIGでMore、またはShift+F1: 詳細CONFIG呼び出し ] + if (actQuickConfig.bGotoDetailConfig) { // 詳細CONFIG呼び出し + actQuickConfig.tDeativatePopupMenu(); + this.actPresound.tStopSound(); + this.eフェードアウト完了時の戻り値 = E戻り値.コンフィグ呼び出し; // #24525 2011.3.16 yyagi: [SHIFT]-[F1]でCONFIG呼び出し + this.actFIFO.tフェードアウト開始(); + base.ePhaseID = CStage.EPhase.Common_FADEOUT; + OpenTaiko.Skin.soundCancelSFX.tPlay(); + return 0; + } + #endregion + + if (this.actSongList.isContextBoxOpened == true) { + // Handle menu contexts + bool __done = this.actSongList.tMenuContextController(this.actSongList.latestContext); + if (__done == true) { + if (this.actSongList.latestContext == eMenuContext.SearchByDifficulty) { + #region [Trigger context box] + + this.actSongList.rCurrentlySelectedSong.list子リスト = CSongDict.tFetchSongsByDifficulty( + this.actSongList.rCurrentlySelectedSong, + this.actSongList.tMenuContextGetVar(0), + this.actSongList.tMenuContextGetVar(1)); + + CSongSelectSongManager.disable(); + + OpenTaiko.Skin.soundDecideSFX.tPlay(); + this.actSongList.ctBarFlash.Start(0, 2700, 1, OpenTaiko.Timer); + this.actSongList.ctBoxOpen.Start(200, 2700, 1.3f, OpenTaiko.Timer); + this.actSongList.bBoxOpen = true; + + //this.ctChara_Select.t開始(0, TJAPlayer3.Tx.SongSelect_Chara_Select.Length - 1, 1000 / 45, TJAPlayer3.Timer); + CMenuCharacter.tMenuResetTimer(CMenuCharacter.ECharacterAnimation.SELECT); + + #endregion + } else if (this.actSongList.latestContext == eMenuContext.Random) { + #region [Trigger context box] + + this.tSetSongRandomly(); + + // Called here + OpenTaiko.Skin.soundDecideSFX.tPlay(); + this.actDifficultySelectionScreen.bIsDifficltSelect = true; + this.actDifficultySelectionScreen.t選択画面初期化(); + this.actSongList.ctBarFlash.Start(0, 2700, OpenTaiko.Skin.SongSelect_Box_Opening_Interval, OpenTaiko.Timer); + this.actSongList.ctDifficultyIn.Start(0, 3200, OpenTaiko.Skin.SongSelect_Box_Opening_Interval, OpenTaiko.Timer); + + //this.ctChara_Select.t開始(0, TJAPlayer3.Tx.SongSelect_Chara_Select.Length - 1, 1000 / 45, TJAPlayer3.Timer); + CMenuCharacter.tMenuResetTimer(CMenuCharacter.ECharacterAnimation.SELECT); + + #endregion + } + + this.actSongList.tMenuContextDisable(); + } + } else if (!this.actSortSongs.bIsActivePopupMenu && !this.actQuickConfig.bIsActivePopupMenu && !this.actDifficultySelectionScreen.bIsDifficltSelect && !actNewHeya.IsOpend) { + #region [ ESC ] + if ((OpenTaiko.Pad.bPressedDGB(EPad.Cancel) || OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Escape)) && (this.actSongList.rCurrentlySelectedSong != null))// && ( ) ) ) + if (this.actSongList.rCurrentlySelectedSong.rParentNode == null) { // [ESC] + this.actPresound.tStopSound(); + CSongSelectSongManager.enable(); + + OpenTaiko.Skin.soundCancelSFX.tPlay(); + this.eフェードアウト完了時の戻り値 = E戻り値.タイトルに戻る; + this.actFIFO.tフェードアウト開始(); + base.ePhaseID = CStage.EPhase.Common_FADEOUT; + return 0; } else { - CMenuCharacter.tMenuDisplayCharacter(player, chara_x, chara_y, CMenuCharacter.ECharacterAnimation.NORMAL); + if (this.actSongList.ctBoxOpen.IsEnded || this.actSongList.ctBoxOpen.CurrentValue == 0) { + this.actPresound.tStopSound(); + CSongSelectSongManager.enable(); - this.PuchiChara.On進行描画(puchi_x, puchi_y, false, 255, false, player); - } - } - } - - - #endregion - - #region [ Nameplate ] - for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { - OpenTaiko.NamePlate.tNamePlateDraw(OpenTaiko.Skin.SongSelect_NamePlate_X[i], OpenTaiko.Skin.SongSelect_NamePlate_Y[i], i); - } - #endregion - - #region [Pad displayables] - - int defaultTable = Math.Max(0, Math.Min((int)Difficulty.Edit + 1, OpenTaiko.ConfigIni.nDefaultCourse)); - - int[] currentPads = new int[5] { - defaultTable, - defaultTable, - defaultTable, - defaultTable, - defaultTable }; - - //int currentPad = (int)Difficulty.Edit + 1; - if (OpenTaiko.stageSongSelect.actDifficultySelectionScreen.bIsDifficltSelect) { - if (OpenTaiko.stageSongSelect.actDifficultySelectionScreen.n現在の選択行[0] >= 2) - currentPads[0] = OpenTaiko.stageSongSelect.actDifficultySelectionScreen.n現在の選択行[0] - 2; - if (OpenTaiko.ConfigIni.nPlayerCount > 1 && OpenTaiko.stageSongSelect.actDifficultySelectionScreen.n現在の選択行[1] >= 2) - currentPads[1] = OpenTaiko.stageSongSelect.actDifficultySelectionScreen.n現在の選択行[1] - 2; - if (OpenTaiko.ConfigIni.nPlayerCount > 1 && OpenTaiko.stageSongSelect.actDifficultySelectionScreen.n現在の選択行[2] >= 2) - currentPads[2] = OpenTaiko.stageSongSelect.actDifficultySelectionScreen.n現在の選択行[2] - 2; - if (OpenTaiko.ConfigIni.nPlayerCount > 1 && OpenTaiko.stageSongSelect.actDifficultySelectionScreen.n現在の選択行[3] >= 2) - currentPads[3] = OpenTaiko.stageSongSelect.actDifficultySelectionScreen.n現在の選択行[3] - 2; - if (OpenTaiko.ConfigIni.nPlayerCount > 1 && OpenTaiko.stageSongSelect.actDifficultySelectionScreen.n現在の選択行[4] >= 2) - currentPads[4] = OpenTaiko.stageSongSelect.actDifficultySelectionScreen.n現在の選択行[4] - 2; - } - - - - for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { - if (OpenTaiko.ConfigIni.bAIBattleMode && i == 1) break; - - int p = OpenTaiko.GetActualPlayer(i); - - OpenTaiko.Tx.SongSelect_Table[currentPads[i]]?.t2D描画(OpenTaiko.Skin.SongSelect_Table_X[i], OpenTaiko.Skin.SongSelect_Table_Y[i]); - - CActSelect曲リスト.CScorePad[] SPArrRef = CSongDict.ScorePads[p]; - - // Current board - for (int j = 0; j < 11; j++) { - tBoardNumberDraw(OpenTaiko.Skin.SongSelect_BoardNumber_X[i][j], OpenTaiko.Skin.SongSelect_BoardNumber_Y[i][j], j < 7 ? - SPArrRef[currentPads[i]].ScoreRankCount[j] - : SPArrRef[currentPads[i]].CrownCount[j - 7]); - } - - } - - if (OpenTaiko.ConfigIni.nPlayerCount <= 2) { - OpenTaiko.Tx.SongSelect_Coin_Slot[0]?.t2D描画(0, 0, - new Rectangle(0, 0, (OpenTaiko.Tx.SongSelect_Coin_Slot[0].sz画像サイズ.Width / 2) + ((OpenTaiko.ConfigIni.nPlayerCount > 1 && !OpenTaiko.ConfigIni.bAIBattleMode) ? (OpenTaiko.Tx.SongSelect_Coin_Slot[0].sz画像サイズ.Width / 2) : 0), OpenTaiko.Tx.SongSelect_Coin_Slot[0].sz画像サイズ.Height)); - } else { - OpenTaiko.Tx.SongSelect_Coin_Slot[OpenTaiko.ConfigIni.nPlayerCount - 2]?.t2D描画(0, 0); - } - - for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { - if (OpenTaiko.ConfigIni.bAIBattleMode && i == 1) break; - - int p = OpenTaiko.GetActualPlayer(i); - - if (OpenTaiko.SaveFileInstances[p].data.Medals >= 0) - tBoardNumberDraw(OpenTaiko.Skin.SongSelect_BoardNumber_X[i][11], OpenTaiko.Skin.SongSelect_BoardNumber_Y[i][11], (int)OpenTaiko.SaveFileInstances[p].data.Medals); - - #region [HiScore plate] - - var song = this.rNowSelectedSong; - - if (song != null && song.eノード種別 == CSongListNode.ENodeType.SCORE) { - var closest = this.actSongList.n現在のアンカ難易度レベルに最も近い難易度レベルを返す(song); - var score = song.arスコア[closest]; - - if (score != null) { - int displayedScore = 0; - int table = 0; - - OpenTaiko.Tx.SongSelect_High_Score?.t2D中心基準描画(OpenTaiko.Skin.SongSelect_High_Score_X[i], OpenTaiko.Skin.SongSelect_High_Score_Y[i]); - - if (this.n現在選択中の曲の難易度 > (int)Difficulty.Edit) - table = 0; - else if (currentPads[i] <= (int)Difficulty.Edit) - table = currentPads[i]; - else - table = closest; - - var TableEntry = OpenTaiko.SaveFileInstances[p].data.tGetSongSelectTableEntry(OpenTaiko.stageSongSelect.rNowSelectedSong.tGetUniqueId()); - displayedScore = TableEntry.HighScore[table]; - - if (this.n現在選択中の曲の難易度 <= (int)Difficulty.Edit) { - CTexture __tex = (OpenTaiko.Tx.SongSelect_Difficulty_Cymbol == null) ? OpenTaiko.Tx.Dani_Difficulty_Cymbol : OpenTaiko.Tx.SongSelect_Difficulty_Cymbol; - int width = __tex.sz画像サイズ.Width / 5; - int height = __tex.sz画像サイズ.Height; - - __tex.t2D中心基準描画( - OpenTaiko.Skin.SongSelect_High_Score_Difficulty_Cymbol_X[i], - OpenTaiko.Skin.SongSelect_High_Score_Difficulty_Cymbol_Y[i], - new Rectangle(table * width, 0, width, height)); + OpenTaiko.Skin.soundCancelSFX.tPlay(); + this.actSongList.ctBarFlash.Start(0, 2700, 1, OpenTaiko.Timer); + this.actSongList.ctBoxOpen.Start(200, 2700, 1.3f, OpenTaiko.Timer); + this.actSongList.bBoxClose = true; + //this.ctChara_Select.t開始(0, TJAPlayer3.Tx.SongSelect_Chara_Select.Length - 1, 1000 / 45, TJAPlayer3.Timer); + CMenuCharacter.tMenuResetTimer(CMenuCharacter.ECharacterAnimation.SELECT); } - - tBoardNumberDraw(OpenTaiko.Skin.SongSelect_BoardNumber_X[i][12], OpenTaiko.Skin.SongSelect_BoardNumber_Y[i][12], displayedScore); } - - } - #endregion - } - - #endregion - - - #region [ Inputs ] - - // キー入力 - if (base.ePhaseID == CStage.EPhase.Common_NORMAL) { - #region [ 簡易CONFIGでMore、またはShift+F1: 詳細CONFIG呼び出し ] - if (actQuickConfig.bGotoDetailConfig) { // 詳細CONFIG呼び出し - actQuickConfig.tDeativatePopupMenu(); + #region [ Shift-F1: Config shortcut ] + if ((OpenTaiko.InputManager.Keyboard.KeyPressing((int)SlimDXKeys.Key.RightShift) || OpenTaiko.InputManager.Keyboard.KeyPressing((int)SlimDXKeys.Key.LeftShift)) && + OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.F1)) { // [SHIFT] + [F1] CONFIG this.actPresound.tStopSound(); this.eフェードアウト完了時の戻り値 = E戻り値.コンフィグ呼び出し; // #24525 2011.3.16 yyagi: [SHIFT]-[F1]でCONFIG呼び出し this.actFIFO.tフェードアウト開始(); @@ -713,947 +796,865 @@ namespace OpenTaiko { return 0; } #endregion - - if (this.actSongList.isContextBoxOpened == true) { - // Handle menu contexts - bool __done = this.actSongList.tMenuContextController(this.actSongList.latestContext); - if (__done == true) { - if (this.actSongList.latestContext == eMenuContext.SearchByDifficulty) { - #region [Trigger context box] - - this.actSongList.rCurrentlySelectedSong.list子リスト = CSongDict.tFetchSongsByDifficulty( - this.actSongList.rCurrentlySelectedSong, - this.actSongList.tMenuContextGetVar(0), - this.actSongList.tMenuContextGetVar(1)); - - CSongSelectSongManager.disable(); - - OpenTaiko.Skin.soundDecideSFX.tPlay(); - this.actSongList.ctBarFlash.Start(0, 2700, 1, OpenTaiko.Timer); - this.actSongList.ctBoxOpen.Start(200, 2700, 1.3f, OpenTaiko.Timer); - this.actSongList.bBoxOpen = true; - - //this.ctChara_Select.t開始(0, TJAPlayer3.Tx.SongSelect_Chara_Select.Length - 1, 1000 / 45, TJAPlayer3.Timer); - CMenuCharacter.tMenuResetTimer(CMenuCharacter.ECharacterAnimation.SELECT); - - #endregion - } else if (this.actSongList.latestContext == eMenuContext.Random) { - #region [Trigger context box] - - this.tSetSongRandomly(); - - // Called here - OpenTaiko.Skin.soundDecideSFX.tPlay(); - this.actDifficultySelectionScreen.bIsDifficltSelect = true; - this.actDifficultySelectionScreen.t選択画面初期化(); - this.actSongList.ctBarFlash.Start(0, 2700, OpenTaiko.Skin.SongSelect_Box_Opening_Interval, OpenTaiko.Timer); - this.actSongList.ctDifficultyIn.Start(0, 3200, OpenTaiko.Skin.SongSelect_Box_Opening_Interval, OpenTaiko.Timer); - - //this.ctChara_Select.t開始(0, TJAPlayer3.Tx.SongSelect_Chara_Select.Length - 1, 1000 / 45, TJAPlayer3.Timer); - CMenuCharacter.tMenuResetTimer(CMenuCharacter.ECharacterAnimation.SELECT); - - #endregion - } - - this.actSongList.tMenuContextDisable(); - } - } else if (!this.actSortSongs.bIsActivePopupMenu && !this.actQuickConfig.bIsActivePopupMenu && !this.actDifficultySelectionScreen.bIsDifficltSelect && !actNewHeya.IsOpend) { - #region [ ESC ] - if ((OpenTaiko.Pad.bPressedDGB(EPad.Cancel) || OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Escape)) && (this.actSongList.rCurrentlySelectedSong != null))// && ( ) ) ) - if (this.actSongList.rCurrentlySelectedSong.rParentNode == null) { // [ESC] - this.actPresound.tStopSound(); - CSongSelectSongManager.enable(); - - OpenTaiko.Skin.soundCancelSFX.tPlay(); - this.eフェードアウト完了時の戻り値 = E戻り値.タイトルに戻る; - this.actFIFO.tフェードアウト開始(); - base.ePhaseID = CStage.EPhase.Common_FADEOUT; - return 0; - } else { - if (this.actSongList.ctBoxOpen.IsEnded || this.actSongList.ctBoxOpen.CurrentValue == 0) { - this.actPresound.tStopSound(); - CSongSelectSongManager.enable(); - - OpenTaiko.Skin.soundCancelSFX.tPlay(); - this.actSongList.ctBarFlash.Start(0, 2700, 1, OpenTaiko.Timer); - this.actSongList.ctBoxOpen.Start(200, 2700, 1.3f, OpenTaiko.Timer); - this.actSongList.bBoxClose = true; - //this.ctChara_Select.t開始(0, TJAPlayer3.Tx.SongSelect_Chara_Select.Length - 1, 1000 / 45, TJAPlayer3.Timer); - CMenuCharacter.tMenuResetTimer(CMenuCharacter.ECharacterAnimation.SELECT); - } - } - #endregion - #region [ Shift-F1: Config shortcut ] - if ((OpenTaiko.InputManager.Keyboard.KeyPressing((int)SlimDXKeys.Key.RightShift) || OpenTaiko.InputManager.Keyboard.KeyPressing((int)SlimDXKeys.Key.LeftShift)) && - OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.F1)) { // [SHIFT] + [F1] CONFIG - this.actPresound.tStopSound(); - this.eフェードアウト完了時の戻り値 = E戻り値.コンフィグ呼び出し; // #24525 2011.3.16 yyagi: [SHIFT]-[F1]でCONFIG呼び出し - this.actFIFO.tフェードアウト開始(); - base.ePhaseID = CStage.EPhase.Common_FADEOUT; - OpenTaiko.Skin.soundCancelSFX.tPlay(); - return 0; - } - #endregion - #region [ F2 Quick Config ] - if (OpenTaiko.ConfigIni.KeyAssign.KeyIsPressed(OpenTaiko.ConfigIni.KeyAssign.System.QuickConfig)) { + #region [ F2 Quick Config ] + if (OpenTaiko.ConfigIni.KeyAssign.KeyIsPressed(OpenTaiko.ConfigIni.KeyAssign.System.QuickConfig)) { + OpenTaiko.Skin.soundChangeSFX.tPlay(); + this.actQuickConfig.tActivatePopupMenu(EInstrumentPad.Drums); + } + #endregion + #region [ F3 1P AUTO ] + if (OpenTaiko.ConfigIni.KeyAssign.KeyIsPressed(OpenTaiko.ConfigIni.KeyAssign.System.ToggleAutoP1)) { + OpenTaiko.Skin.soundChangeSFX.tPlay(); + CUtility.ToggleBoolian(ref OpenTaiko.ConfigIni.bAutoPlay[0]); + } + #endregion + #region [ F4 2P AUTO ] + if (OpenTaiko.ConfigIni.KeyAssign.KeyIsPressed(OpenTaiko.ConfigIni.KeyAssign.System.ToggleAutoP2)) { + if (OpenTaiko.ConfigIni.nPlayerCount > 1) { OpenTaiko.Skin.soundChangeSFX.tPlay(); - this.actQuickConfig.tActivatePopupMenu(EInstrumentPad.Drums); + CUtility.ToggleBoolian(ref OpenTaiko.ConfigIni.bAutoPlay[1]); } - #endregion - #region [ F3 1P AUTO ] - if (OpenTaiko.ConfigIni.KeyAssign.KeyIsPressed(OpenTaiko.ConfigIni.KeyAssign.System.ToggleAutoP1)) { + } + #endregion + #region [ F5 Super Hard Mode (DEPRECATED / UNUSED) ] + if (OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.F5)) { + // Deprecated, to delete + OpenTaiko.Skin.soundChangeSFX.tPlay(); + CUtility.ToggleBoolian(ref OpenTaiko.ConfigIni.bSuperHard); + } + #endregion + #region [ F7 TokkunMode ] + if (OpenTaiko.ConfigIni.KeyAssign.KeyIsPressed(OpenTaiko.ConfigIni.KeyAssign.System.ToggleTrainingMode)) { + if (OpenTaiko.ConfigIni.nPlayerCount < 2) { OpenTaiko.Skin.soundChangeSFX.tPlay(); - CUtility.ToggleBoolian(ref OpenTaiko.ConfigIni.bAutoPlay[0]); + CUtility.ToggleBoolian(ref OpenTaiko.ConfigIni.bTokkunMode); } - #endregion - #region [ F4 2P AUTO ] - if (OpenTaiko.ConfigIni.KeyAssign.KeyIsPressed(OpenTaiko.ConfigIni.KeyAssign.System.ToggleAutoP2)) { - if (OpenTaiko.ConfigIni.nPlayerCount > 1) { - OpenTaiko.Skin.soundChangeSFX.tPlay(); - CUtility.ToggleBoolian(ref OpenTaiko.ConfigIni.bAutoPlay[1]); - } - } - #endregion - #region [ F5 Super Hard Mode (DEPRECATED / UNUSED) ] - if (OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.F5)) { - // Deprecated, to delete - OpenTaiko.Skin.soundChangeSFX.tPlay(); - CUtility.ToggleBoolian(ref OpenTaiko.ConfigIni.bSuperHard); - } - #endregion - #region [ F7 TokkunMode ] - if (OpenTaiko.ConfigIni.KeyAssign.KeyIsPressed(OpenTaiko.ConfigIni.KeyAssign.System.ToggleTrainingMode)) { - if (OpenTaiko.ConfigIni.nPlayerCount < 2) { - OpenTaiko.Skin.soundChangeSFX.tPlay(); - CUtility.ToggleBoolian(ref OpenTaiko.ConfigIni.bTokkunMode); - } - } - #endregion - #region [ F9 New Heya ] - if (OpenTaiko.ConfigIni.KeyAssign.KeyIsPressed(OpenTaiko.ConfigIni.KeyAssign.System.NewHeya)) { - actNewHeya.Open(); - } - #endregion + } + #endregion + #region [ F9 New Heya ] + if (OpenTaiko.ConfigIni.KeyAssign.KeyIsPressed(OpenTaiko.ConfigIni.KeyAssign.System.NewHeya)) { + actNewHeya.Open(); + } + #endregion - if (this.actSongList.rCurrentlySelectedSong != null) { + if (this.actSongList.rCurrentlySelectedSong != null) { - if (this.actSongList.ctBoxOpen.IsEnded || this.actSongList.ctBoxOpen.CurrentValue == 0) { - if (!this.bCurrentlyScrolling) { - #region [ Decide ] - if ((OpenTaiko.Pad.bPressedDGB(EPad.Decide) || - ((OpenTaiko.ConfigIni.bEnterIsNotUsedInKeyAssignments && OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Return))))) { + if (this.actSongList.ctBoxOpen.IsEnded || this.actSongList.ctBoxOpen.CurrentValue == 0) { + if (!this.bCurrentlyScrolling) { + #region [ Decide ] + if ((OpenTaiko.Pad.bPressedDGB(EPad.Decide) || + ((OpenTaiko.ConfigIni.bEnterIsNotUsedInKeyAssignments && OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Return))))) { - if (this.actSongList.rCurrentlySelectedSong != null) { - switch (this.actSongList.rCurrentlySelectedSong.eノード種別) { - case CSongListNode.ENodeType.SCORE: { - var IsSongLocked = OpenTaiko.Databases.DBSongUnlockables.tIsSongLocked(this.rNowSelectedSong); + if (this.actSongList.rCurrentlySelectedSong != null) { + switch (this.actSongList.rCurrentlySelectedSong.eノード種別) { + case CSongListNode.ENodeType.SCORE: { + var IsSongLocked = OpenTaiko.Databases.DBSongUnlockables.tIsSongLocked(this.rNowSelectedSong); - if (IsSongLocked) { - var SongToUnlock = OpenTaiko.Databases.DBSongUnlockables.tGetUnlockableByUniqueId(this.rNowSelectedSong); + if (IsSongLocked) { + var SongToUnlock = OpenTaiko.Databases.DBSongUnlockables.tGetUnlockableByUniqueId(this.rNowSelectedSong); - if (SongToUnlock != null) { - (bool, string?) response = SongToUnlock.unlockConditions.tConditionMetWrapper(OpenTaiko.SaveFile, DBUnlockables.CUnlockConditions.EScreen.SongSelect); + if (SongToUnlock != null) { + (bool, string?) response = SongToUnlock.unlockConditions.tConditionMetWrapper(OpenTaiko.SaveFile, DBUnlockables.CUnlockConditions.EScreen.SongSelect); - Color responseColor = (response.Item1) ? Color.Lime : Color.Red; - if (actSongList.ttkNowUnlockConditionText is not null) { - actSongList.ttkNowUnlockConditionText = new TitleTextureKey( + Color responseColor = (response.Item1) ? Color.Lime : Color.Red; + if (actSongList.ttkNowUnlockConditionText is not null) { + actSongList.ttkNowUnlockConditionText = new TitleTextureKey( response.Item2 ?? actSongList.ttkNowUnlockConditionText.str, actSongList.ttkNowUnlockConditionText.cPrivateFastFont, responseColor, Color.Black, 1000); - } + } - if (response.Item1) { - OpenTaiko.SaveFileInstances[OpenTaiko.SaveFile].data.UnlockedSongs.Add(this.rNowSelectedSong?.tGetUniqueId() ?? ""); - DBSaves.RegisterStringUnlockedAsset( - OpenTaiko.SaveFileInstances[OpenTaiko.SaveFile].data.SaveId, - "unlocked_songs", - this.rNowSelectedSong?.tGetUniqueId() ?? "" // Can't be null in this context - ); - OpenTaiko.SaveFileInstances[OpenTaiko.SaveFile].tSpendCoins(SongToUnlock.unlockConditions.Values[0]); - // Play modal animation here ? - } else - OpenTaiko.Skin.soundError.tPlay(); + if (response.Item1) { + OpenTaiko.SaveFileInstances[OpenTaiko.SaveFile].data.UnlockedSongs.Add(this.rNowSelectedSong?.tGetUniqueId() ?? ""); + DBSaves.RegisterStringUnlockedAsset( + OpenTaiko.SaveFileInstances[OpenTaiko.SaveFile].data.SaveId, + "unlocked_songs", + this.rNowSelectedSong?.tGetUniqueId() ?? "" // Can't be null in this context + ); + OpenTaiko.SaveFileInstances[OpenTaiko.SaveFile].tSpendCoins(SongToUnlock.unlockConditions.Values[0]); + // Play modal animation here ? + } else + OpenTaiko.Skin.soundError.tPlay(); + } else { + OpenTaiko.Skin.soundError.tPlay(); + } + } else { + if (this.n現在選択中の曲の難易度 >= (int)Difficulty.Tower) { + if (OpenTaiko.ConfigIni.nPlayerCount == 1 && !OpenTaiko.ConfigIni.bTokkunMode) { + // Init tower variables + if (this.n現在選択中の曲の難易度 == (int)Difficulty.Tower) + CFloorManagement.reinitialize(this.rNowSelectedSong.arスコア[(int)Difficulty.Tower].譜面情報.nLife); + + OpenTaiko.Skin.soundDecideSFX.tPlay(); + OpenTaiko.Skin.voiceMenuSongDecide[OpenTaiko.SaveFile]?.tPlay(); + + this.t曲を選択する(); } else { OpenTaiko.Skin.soundError.tPlay(); } } else { - if (this.n現在選択中の曲の難易度 >= (int)Difficulty.Tower) { - if (OpenTaiko.ConfigIni.nPlayerCount == 1 && !OpenTaiko.ConfigIni.bTokkunMode) { - // Init tower variables - if (this.n現在選択中の曲の難易度 == (int)Difficulty.Tower) - CFloorManagement.reinitialize(this.rNowSelectedSong.arスコア[(int)Difficulty.Tower].譜面情報.nLife); - - OpenTaiko.Skin.soundDecideSFX.tPlay(); - OpenTaiko.Skin.voiceMenuSongDecide[OpenTaiko.SaveFile]?.tPlay(); - - this.t曲を選択する(); - } else { - OpenTaiko.Skin.soundError.tPlay(); - } - } else { - // Called here - OpenTaiko.Skin.soundDecideSFX.tPlay(); - this.actDifficultySelectionScreen.bIsDifficltSelect = true; - this.actDifficultySelectionScreen.t選択画面初期化(); - this.actSongList.ctBarFlash.Start(0, 2700, OpenTaiko.Skin.SongSelect_Box_Opening_Interval, OpenTaiko.Timer); - this.actSongList.ctDifficultyIn.Start(0, 3200, OpenTaiko.Skin.SongSelect_Box_Opening_Interval, OpenTaiko.Timer); - //this.ctChara_Select.t開始(0, TJAPlayer3.Tx.SongSelect_Chara_Select.Length - 1, 1000 / 45, TJAPlayer3.Timer); - CMenuCharacter.tMenuResetTimer(CMenuCharacter.ECharacterAnimation.SELECT); - } - } - } - break; - case CSongListNode.ENodeType.BOX: { - - #region [Pre-generated folders] - - if (this.actSongList.rCurrentlySelectedSong.strジャンル == "Favorite") { - this.actSongList.rCurrentlySelectedSong.list子リスト = CSongDict.tFetchFavoriteFolder(this.actSongList.rCurrentlySelectedSong); - } else if (this.actSongList.rCurrentlySelectedSong.strジャンル == "最近遊んだ曲") { - this.actSongList.rCurrentlySelectedSong.list子リスト = CSongDict.tFetchRecentlyPlayedSongsFolder(this.actSongList.rCurrentlySelectedSong); - } else if (this.actSongList.rCurrentlySelectedSong.strジャンル == "SearchD") { - this.actSongList.tMenuContextTrigger(eMenuContext.SearchByDifficulty); + // Called here OpenTaiko.Skin.soundDecideSFX.tPlay(); - goto Decided; - //this.act曲リスト.r現在選択中の曲.list子リスト = CSongDict.tFetchSongsByDifficulty(this.act曲リスト.r現在選択中の曲, (int)Difficulty.Oni, 8); + this.actDifficultySelectionScreen.bIsDifficltSelect = true; + this.actDifficultySelectionScreen.t選択画面初期化(); + this.actSongList.ctBarFlash.Start(0, 2700, OpenTaiko.Skin.SongSelect_Box_Opening_Interval, OpenTaiko.Timer); + this.actSongList.ctDifficultyIn.Start(0, 3200, OpenTaiko.Skin.SongSelect_Box_Opening_Interval, OpenTaiko.Timer); + //this.ctChara_Select.t開始(0, TJAPlayer3.Tx.SongSelect_Chara_Select.Length - 1, 1000 / 45, TJAPlayer3.Timer); + CMenuCharacter.tMenuResetTimer(CMenuCharacter.ECharacterAnimation.SELECT); } + } + } + break; + case CSongListNode.ENodeType.BOX: { - #endregion - - CSongSelectSongManager.disable(); + #region [Pre-generated folders] + if (this.actSongList.rCurrentlySelectedSong.strジャンル == "Favorite") { + this.actSongList.rCurrentlySelectedSong.list子リスト = CSongDict.tFetchFavoriteFolder(this.actSongList.rCurrentlySelectedSong); + } else if (this.actSongList.rCurrentlySelectedSong.strジャンル == "最近遊んだ曲") { + this.actSongList.rCurrentlySelectedSong.list子リスト = CSongDict.tFetchRecentlyPlayedSongsFolder(this.actSongList.rCurrentlySelectedSong); + } else if (this.actSongList.rCurrentlySelectedSong.strジャンル == "SearchD") { + this.actSongList.tMenuContextTrigger(eMenuContext.SearchByDifficulty); OpenTaiko.Skin.soundDecideSFX.tPlay(); - this.actSongList.ctBarFlash.Start(0, 2700, OpenTaiko.Skin.SongSelect_Box_Opening_Interval, OpenTaiko.Timer); - this.actSongList.ctBoxOpen.Start(200, 2700, OpenTaiko.Skin.SongSelect_Box_Opening_Interval * 1.3f, OpenTaiko.Timer); - this.actSongList.bBoxOpen = true; - //this.ctChara_Select.t開始(0, TJAPlayer3.Tx.SongSelect_Chara_Select.Length - 1, 1000 / 45, TJAPlayer3.Timer); - CMenuCharacter.tMenuResetTimer(CMenuCharacter.ECharacterAnimation.SELECT); + goto Decided; + //this.act曲リスト.r現在選択中の曲.list子リスト = CSongDict.tFetchSongsByDifficulty(this.act曲リスト.r現在選択中の曲, (int)Difficulty.Oni, 8); } - break; - case CSongListNode.ENodeType.BACKBOX: { - // TOJIRU - CSongSelectSongManager.enable(); - OpenTaiko.Skin.soundCancelSFX.tPlay(); - this.actSongList.ctBarFlash.Start(0, 2700, OpenTaiko.Skin.SongSelect_Box_Opening_Interval, OpenTaiko.Timer); - this.actSongList.ctBoxOpen.Start(200, 2700, OpenTaiko.Skin.SongSelect_Box_Opening_Interval * 1.3f, OpenTaiko.Timer); - this.actSongList.bBoxClose = true; - //this.ctChara_Select.t開始(0, TJAPlayer3.Tx.SongSelect_Chara_Select.Length - 1, 1000 / 45, TJAPlayer3.Timer); - CMenuCharacter.tMenuResetTimer(CMenuCharacter.ECharacterAnimation.SELECT); - } - break; - case CSongListNode.ENodeType.RANDOM: { - this.tSetSongRandomly(); + #endregion - // Called here - OpenTaiko.Skin.soundDecideSFX.tPlay(); - this.actDifficultySelectionScreen.bIsDifficltSelect = true; - this.actDifficultySelectionScreen.t選択画面初期化(); - this.actSongList.ctBarFlash.Start(0, 2700, OpenTaiko.Skin.SongSelect_Box_Opening_Interval, OpenTaiko.Timer); - this.actSongList.ctDifficultyIn.Start(0, 3200, OpenTaiko.Skin.SongSelect_Box_Opening_Interval, OpenTaiko.Timer); + CSongSelectSongManager.disable(); - //this.ctChara_Select.t開始(0, TJAPlayer3.Tx.SongSelect_Chara_Select.Length - 1, 1000 / 45, TJAPlayer3.Timer); - CMenuCharacter.tMenuResetTimer(CMenuCharacter.ECharacterAnimation.SELECT); + OpenTaiko.Skin.soundDecideSFX.tPlay(); + this.actSongList.ctBarFlash.Start(0, 2700, OpenTaiko.Skin.SongSelect_Box_Opening_Interval, OpenTaiko.Timer); + this.actSongList.ctBoxOpen.Start(200, 2700, OpenTaiko.Skin.SongSelect_Box_Opening_Interval * 1.3f, OpenTaiko.Timer); + this.actSongList.bBoxOpen = true; + //this.ctChara_Select.t開始(0, TJAPlayer3.Tx.SongSelect_Chara_Select.Length - 1, 1000 / 45, TJAPlayer3.Timer); + CMenuCharacter.tMenuResetTimer(CMenuCharacter.ECharacterAnimation.SELECT); + } + break; + case CSongListNode.ENodeType.BACKBOX: { + // TOJIRU + CSongSelectSongManager.enable(); - /* - TJAPlayer3.Skin.sound決定音.t再生する(); + OpenTaiko.Skin.soundCancelSFX.tPlay(); + this.actSongList.ctBarFlash.Start(0, 2700, OpenTaiko.Skin.SongSelect_Box_Opening_Interval, OpenTaiko.Timer); + this.actSongList.ctBoxOpen.Start(200, 2700, OpenTaiko.Skin.SongSelect_Box_Opening_Interval * 1.3f, OpenTaiko.Timer); + this.actSongList.bBoxClose = true; + //this.ctChara_Select.t開始(0, TJAPlayer3.Tx.SongSelect_Chara_Select.Length - 1, 1000 / 45, TJAPlayer3.Timer); + CMenuCharacter.tMenuResetTimer(CMenuCharacter.ECharacterAnimation.SELECT); + } + break; + case CSongListNode.ENodeType.RANDOM: { + this.tSetSongRandomly(); - this.act曲リスト.tMenuContextTrigger(eMenuContext.Random); - goto Decided; - */ + // Called here + OpenTaiko.Skin.soundDecideSFX.tPlay(); + this.actDifficultySelectionScreen.bIsDifficltSelect = true; + this.actDifficultySelectionScreen.t選択画面初期化(); + this.actSongList.ctBarFlash.Start(0, 2700, OpenTaiko.Skin.SongSelect_Box_Opening_Interval, OpenTaiko.Timer); + this.actSongList.ctDifficultyIn.Start(0, 3200, OpenTaiko.Skin.SongSelect_Box_Opening_Interval, OpenTaiko.Timer); - /* - this.t曲をランダム選択する(); + //this.ctChara_Select.t開始(0, TJAPlayer3.Tx.SongSelect_Chara_Select.Length - 1, 1000 / 45, TJAPlayer3.Timer); + CMenuCharacter.tMenuResetTimer(CMenuCharacter.ECharacterAnimation.SELECT); - //this.ctChara_Select.t開始(0, TJAPlayer3.Tx.SongSelect_Chara_Select.Length - 1, 1000 / 45, TJAPlayer3.Timer); - CMenuCharacter.tMenuResetTimer(CMenuCharacter.ECharacterAnimation.SELECT); - */ - } - break; - } + /* + TJAPlayer3.Skin.sound決定音.t再生する(); - goto Decided; + this.act曲リスト.tMenuContextTrigger(eMenuContext.Random); + goto Decided; + */ + /* + this.t曲をランダム選択する(); + + //this.ctChara_Select.t開始(0, TJAPlayer3.Tx.SongSelect_Chara_Select.Length - 1, 1000 / 45, TJAPlayer3.Timer); + CMenuCharacter.tMenuResetTimer(CMenuCharacter.ECharacterAnimation.SELECT); + */ + } + break; } - } - #endregion - } + goto Decided; - #region [ Favorite ] - - if (!this.bCurrentlyScrolling) { - var IsSongLocked = OpenTaiko.Databases.DBSongUnlockables.tIsSongLocked(this.rNowSelectedSong); - - if (OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.LeftControl) && !IsSongLocked) { - CSongUniqueID csu = this.rNowSelectedSong.uniqueId; - - if (csu != null) { - OpenTaiko.Skin.soundDecideSFX.tPlay(); - OpenTaiko.Favorites.tToggleFavorite(csu.data.id); - } - } - } - - #endregion - - #region [ Up ] - if (!this.bCurrentlyScrolling) { - this.ctキー反復用.Up.KeyIntervalFunc(OpenTaiko.InputManager.Keyboard.KeyPressing((int)SlimDXKeys.Key.LeftArrow), new CCounter.KeyProcess(this.tカーソルを上へ移動する)); - //this.ctキー反復用.Up.tキー反復( CDTXMania.Input管理.Keyboard.bキーが押されている( (int) SlimDXKeys.Key.UpArrow ) || CDTXMania.Input管理.Keyboard.bキーが押されている( (int) SlimDXKeys.Key.LeftArrow ), new CCounter.DGキー処理( this.tカーソルを上へ移動する ) ); - if (OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.LeftChange)) { - this.tカーソルを上へ移動する(); - } - } else { - if (OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.LeftChange)) { - //this.ctChara_Jump[0].t開始(0, TJAPlayer3.Tx.SongSelect_Chara_Jump.Length + 8, 1000 / 45, TJAPlayer3.Timer); - //this.ctChara_Jump[1].t開始(0, TJAPlayer3.Tx.SongSelect_Chara_Jump.Length + 8, 1000 / 45, TJAPlayer3.Timer); - CMenuCharacter.tMenuResetTimer(CMenuCharacter.ECharacterAnimation.SELECT); - - for (int i = 0; i < 7; i++) tカーソルスキップ(true); } } #endregion - #region [ Down ] - if (!this.bCurrentlyScrolling) { - this.ctキー反復用.Down.KeyIntervalFunc(OpenTaiko.InputManager.Keyboard.KeyPressing((int)SlimDXKeys.Key.RightArrow), new CCounter.KeyProcess(this.tカーソルを下へ移動する)); - //this.ctキー反復用.Down.tキー反復( CDTXMania.Input管理.Keyboard.bキーが押されている( (int) SlimDXKeys.Key.DownArrow ) || CDTXMania.Input管理.Keyboard.bキーが押されている( (int) SlimDXKeys.Key.RightArrow ), new CCounter.DGキー処理( this.tカーソルを下へ移動する ) ); + } - if (OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.RightChange)) { - this.tカーソルを下へ移動する(); - } - } else { - if (OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.RightChange)) { - //this.ctChara_Jump[0].t開始(0, TJAPlayer3.Tx.SongSelect_Chara_Jump.Length + 8, 1000 / 45, TJAPlayer3.Timer); - //this.ctChara_Jump[1].t開始(0, TJAPlayer3.Tx.SongSelect_Chara_Jump.Length + 8, 1000 / 45, TJAPlayer3.Timer); - CMenuCharacter.tMenuResetTimer(CMenuCharacter.ECharacterAnimation.SELECT); + #region [ Favorite ] - for (int i = 0; i < 7; i++) tカーソルスキップ(false); + if (!this.bCurrentlyScrolling) { + var IsSongLocked = OpenTaiko.Databases.DBSongUnlockables.tIsSongLocked(this.rNowSelectedSong); + + if (OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.LeftControl) && !IsSongLocked) { + CSongUniqueID csu = this.rNowSelectedSong.uniqueId; + + if (csu != null) { + OpenTaiko.Skin.soundDecideSFX.tPlay(); + OpenTaiko.Favorites.tToggleFavorite(csu.data.id); } } + } + #endregion - Decided:; + #region [ Up ] + if (!this.bCurrentlyScrolling) { + this.ctキー反復用.Up.KeyIntervalFunc(OpenTaiko.InputManager.Keyboard.KeyPressing((int)SlimDXKeys.Key.LeftArrow), new CCounter.KeyProcess(this.tカーソルを上へ移動する)); + //this.ctキー反復用.Up.tキー反復( CDTXMania.Input管理.Keyboard.bキーが押されている( (int) SlimDXKeys.Key.UpArrow ) || CDTXMania.Input管理.Keyboard.bキーが押されている( (int) SlimDXKeys.Key.LeftArrow ), new CCounter.DGキー処理( this.tカーソルを上へ移動する ) ); + if (OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.LeftChange)) { + this.tカーソルを上へ移動する(); + } + } else { + if (OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.LeftChange)) { + //this.ctChara_Jump[0].t開始(0, TJAPlayer3.Tx.SongSelect_Chara_Jump.Length + 8, 1000 / 45, TJAPlayer3.Timer); + //this.ctChara_Jump[1].t開始(0, TJAPlayer3.Tx.SongSelect_Chara_Jump.Length + 8, 1000 / 45, TJAPlayer3.Timer); + CMenuCharacter.tMenuResetTimer(CMenuCharacter.ECharacterAnimation.SELECT); - } - #region [ Upstairs ] - /* - if (((this.actSongList.rCurrentlySelectedSong != null) && (this.actSongList.rCurrentlySelectedSong.rParentNode != null)) && (TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.FT) || TJAPlayer3.Pad.bPressedGB(EPad.Cancel))) - { - this.actPresound.tStopSound(); - TJAPlayer3.Skin.soundCancelSFX.tPlay(); - this.actSongList.tCloseBOX(); - this.tNotifySelectedSongChange(); - } - */ - #endregion - #region [ BDx2: 簡易CONFIG ] - if (OpenTaiko.ConfigIni.KeyAssign.KeyIsPressed(OpenTaiko.ConfigIni.KeyAssign.System.SortSongs)) { - OpenTaiko.Skin.soundChangeSFX.tPlay(); - this.actSortSongs.tActivatePopupMenu(EInstrumentPad.Drums, ref this.actSongList); - } - #endregion - #region [ HHx2: 難易度変更 ] - if (OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.HH) || OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.HHO)) { // [HH]x2 難易度変更 - CommandHistory.Add(EInstrumentPad.Drums, EPadFlag.HH); - EPadFlag[] comChangeDifficulty = new EPadFlag[] { EPadFlag.HH, EPadFlag.HH }; - if (CommandHistory.CheckCommand(comChangeDifficulty, EInstrumentPad.Drums)) { - Debug.WriteLine("ドラムス難易度変更"); - this.actSongList.t難易度レベルをひとつ進める(); - OpenTaiko.Skin.soundChangeSFX.tPlay(); + for (int i = 0; i < 7; i++) tカーソルスキップ(true); } } #endregion + + #region [ Down ] + if (!this.bCurrentlyScrolling) { + this.ctキー反復用.Down.KeyIntervalFunc(OpenTaiko.InputManager.Keyboard.KeyPressing((int)SlimDXKeys.Key.RightArrow), new CCounter.KeyProcess(this.tカーソルを下へ移動する)); + //this.ctキー反復用.Down.tキー反復( CDTXMania.Input管理.Keyboard.bキーが押されている( (int) SlimDXKeys.Key.DownArrow ) || CDTXMania.Input管理.Keyboard.bキーが押されている( (int) SlimDXKeys.Key.RightArrow ), new CCounter.DGキー処理( this.tカーソルを下へ移動する ) ); + + if (OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.RightChange)) { + this.tカーソルを下へ移動する(); + } + } else { + if (OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.RightChange)) { + //this.ctChara_Jump[0].t開始(0, TJAPlayer3.Tx.SongSelect_Chara_Jump.Length + 8, 1000 / 45, TJAPlayer3.Timer); + //this.ctChara_Jump[1].t開始(0, TJAPlayer3.Tx.SongSelect_Chara_Jump.Length + 8, 1000 / 45, TJAPlayer3.Timer); + CMenuCharacter.tMenuResetTimer(CMenuCharacter.ECharacterAnimation.SELECT); + + for (int i = 0; i < 7; i++) tカーソルスキップ(false); + } + } + #endregion + + Decided:; + } + #region [ Upstairs ] + /* + if (((this.actSongList.rCurrentlySelectedSong != null) && (this.actSongList.rCurrentlySelectedSong.rParentNode != null)) && (TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.FT) || TJAPlayer3.Pad.bPressedGB(EPad.Cancel))) + { + this.actPresound.tStopSound(); + TJAPlayer3.Skin.soundCancelSFX.tPlay(); + this.actSongList.tCloseBOX(); + this.tNotifySelectedSongChange(); + } + */ + #endregion + #region [ BDx2: 簡易CONFIG ] + if (OpenTaiko.ConfigIni.KeyAssign.KeyIsPressed(OpenTaiko.ConfigIni.KeyAssign.System.SortSongs)) { + OpenTaiko.Skin.soundChangeSFX.tPlay(); + this.actSortSongs.tActivatePopupMenu(EInstrumentPad.Drums, ref this.actSongList); + } + #endregion + #region [ HHx2: 難易度変更 ] + if (OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.HH) || OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.HHO)) { // [HH]x2 難易度変更 + CommandHistory.Add(EInstrumentPad.Drums, EPadFlag.HH); + EPadFlag[] comChangeDifficulty = new EPadFlag[] { EPadFlag.HH, EPadFlag.HH }; + if (CommandHistory.CheckCommand(comChangeDifficulty, EInstrumentPad.Drums)) { + Debug.WriteLine("ドラムス難易度変更"); + this.actSongList.t難易度レベルをひとつ進める(); + OpenTaiko.Skin.soundChangeSFX.tPlay(); + } + } + #endregion } - - - - - #region [ Minus & Equals Sound Group Level ] - KeyboardSoundGroupLevelControlHandler.Handle( - OpenTaiko.InputManager.Keyboard, OpenTaiko.SoundGroupLevelController, OpenTaiko.Skin, true); - #endregion - - this.actSortSongs.t進行描画(); - this.actQuickConfig.t進行描画(); } + + + + #region [ Minus & Equals Sound Group Level ] + KeyboardSoundGroupLevelControlHandler.Handle( + OpenTaiko.InputManager.Keyboard, OpenTaiko.SoundGroupLevelController, OpenTaiko.Skin, true); #endregion - //------------------------------ - if (this.actDifficultySelectionScreen.bIsDifficltSelect) { - if (this.actSongList.ctDifficultyIn.CurrentValue >= 1255) { - this.actDifficultySelectionScreen.Draw(); - } - } - //------------------------------ - - - if (OpenTaiko.ConfigIni.nPlayerCount == 1) { - var opacity = 0; - - if (ctCreditAnime.CurrentValue <= 510) - opacity = ctCreditAnime.CurrentValue / 2; - else if (ctCreditAnime.CurrentValue <= 4500 - 510) - opacity = 255; - else - opacity = 255 - ((ctCreditAnime.CurrentValue - (4500 - 510)) / 2); - - OpenTaiko.Tx.SongSelect_Credit.Opacity = opacity; - - OpenTaiko.Tx.SongSelect_Credit.t2D描画(0, 0); - } - - for (int i = 0; i < 5; i++) { - CCounter ___cs = CMenuCharacter._getReferenceCounter(CMenuCharacter.ECharacterAnimation.START)[i]; - - //if (this.ctChara_Jump[i].n現在の値 >= this.ctChara_Jump[i].n終了値) - if (___cs != null && ___cs.CurrentValue >= ___cs.EndValue) { - //this.ctChara_Jump[i].t停止(); - ___cs.Stop(); - - if (!this.actDifficultySelectionScreen.bIsDifficltSelect) { - //this.ctChara_Jump[i].n現在の値 = 0; - ___cs.CurrentValue = 0; - } - } - } - - if (actDifficultySelectionScreen.bOption[0]) actPlayOption.On進行描画(0); - if (actDifficultySelectionScreen.bOption[1]) actPlayOption.On進行描画(1); - if (actDifficultySelectionScreen.bOption[2]) actPlayOption.On進行描画(2); - if (actDifficultySelectionScreen.bOption[3]) actPlayOption.On進行描画(3); - if (actDifficultySelectionScreen.bOption[4]) actPlayOption.On進行描画(4); - - if (actNewHeya.IsOpend) actNewHeya.Draw(); - - switch (base.ePhaseID) { - case CStage.EPhase.Common_FADEIN: - if (this.actFIFO.Draw() != 0) { - base.ePhaseID = CStage.EPhase.Common_NORMAL; - } - break; - - case CStage.EPhase.Common_FADEOUT: - if (this.actFIFO.Draw() == 0) { - break; - } - return (int)this.eフェードアウト完了時の戻り値; - - case CStage.EPhase.SongSelect_FadeInFromResults: - if (this.actFIfrom結果画面.Draw() != 0) { - base.ePhaseID = CStage.EPhase.Common_NORMAL; - } - break; - - case CStage.EPhase.SongSelect_FadeOutToNowLoading: - if (this.actFOtoNowLoading.Draw() == 0) { - break; - } - return (int)this.eフェードアウト完了時の戻り値; - } - } - return 0; - } - public enum E戻り値 : int { - 継続, - タイトルに戻る, - 選曲した, - オプション呼び出し, - コンフィグ呼び出し, - スキン変更 - } - - - // その他 - - #region [ private ] - //----------------- - [StructLayout(LayoutKind.Sequential)] - private struct STキー反復用カウンタ { - public CCounter Up; - public CCounter Down; - public CCounter this[int index] { - get { - switch (index) { - case 0: - return this.Up; - - case 1: - return this.Down; - } - throw new IndexOutOfRangeException(); - } - set { - switch (index) { - case 0: - this.Up = value; - return; - - case 1: - this.Down = value; - return; - } - throw new IndexOutOfRangeException(); - } - } - } - private CCounter ctTimer; - private CCounter ctCreditAnime; - private Random[] r = new Random[3]; - public CCounter ctBackgroundFade; - public string NowGenre; - public string OldGenre; - public string NowBg; - public string OldBg; - public Color NowBgColor = Color.White; - public Color OldBgColor = Color.White; - public bool NowUseGenre; - public bool OldUseGenre; - private CActSelectArtistComment actArtistComment; - private CActFIFOBlack actFIFO; - private CActFIFOBlack actFIfrom結果画面; - //private CActFIFOBlack actFOtoNowLoading; - public CActFIFOStart actFOtoNowLoading; - private CActSelectInformation actInformation; - public CActSelectPreimageパネル actPreimageパネル; - public CActSelectPresound actPresound; - private CActオプションパネル actオプションパネル; - private CActSelectステータスパネル actステータスパネル; - public CActSelect演奏履歴パネル act演奏履歴パネル; - public CActSelect曲リスト actSongList; - public CActSelectSongInfo actSongInfo; - public CActSelectDanInfo actDanInfo; - public CActSelectTowerInfo actTowerInfo; - private CActSelectShowCurrentPosition actShowCurrentPosition; - public CActSelect難易度選択画面 actDifficultySelectionScreen; - public CActPlayOption actPlayOption; - public CActSelectExExtraTransAnime actExExtraTransAnime; - public CActNewHeya actNewHeya; - - public CActSortSongs actSortSongs; - private CActSelectQuickConfig actQuickConfig; - - private ScriptBG AI_Background; - - private const int MaxSong = 3; - public int NowSong = 1; - - //private CCounter ctChara_Normal; - //private CCounter ctChara_Select; - //public CCounter[] ctChara_Jump = new CCounter[2]; - - public PuchiChara PuchiChara; - - private string nGenreBack; - private string nOldGenreBack; - public bool bBGM再生済み; - public bool bBGMIn再生した; - private STキー反復用カウンタ ctキー反復用; - public CCounter ct登場時アニメ用共通; - private CCounter ctOldBGScroll; - private CCounter ct背景スクロール用タイマー; - private E戻り値 eフェードアウト完了時の戻り値; - private CCachedFontRenderer ftフォント; - //private CTexture tx下部パネル; - //private CTexture tx上部パネル; - //private CTexture tx背景; - // private CTexture[] txジャンル別背景 = new CTexture[9]; - // private CTexture[] tx難易度別背景 = new CTexture[5]; - // private CTexture tx難易度名; - // private CTexture tx下部テキスト; - private CCounter ctDiffSelect移動待ち; - - private STNumber[] stSongNumber = new STNumber[10]; - private STNumber[] stBoardNumber = new STNumber[10]; - - public struct STNumber { - public char ch; - public Point pt; - } - private struct STCommandTime // #24063 2011.1.16 yyagi コマンド入力時刻の記録用 - { - public EInstrumentPad eInst; // 使用楽器 - public EPadFlag ePad; // 押されたコマンド(同時押しはOR演算で列挙する) - public long time; // コマンド入力時刻 - } - - /* - private Point[] ptBoardNumber = - { new Point(72, 283), new Point(135, 283), new Point(200, 283), new Point(72, 258), new Point(135, 258), new Point(200, 258), new Point(200, 233), new Point(72, 311), new Point(135, 311), new Point(200, 311), new Point(84, 360), new Point(124, 416) }; - */ - - private CTexture txCustomSelectBG; - private CTexture txCustomPrevSelectBG; - private CTexture txGenreBack { - get { - if (txCustomSelectBG == null) { - return HGenreBar.tGetGenreBar(nGenreBack, OpenTaiko.Tx.SongSelect_GenreBack); - } else { - return txCustomSelectBG; - } - } - } - private CTexture txOldGenreBack { - get { - if (txCustomPrevSelectBG == null) { - return HGenreBar.tGetGenreBar(nOldGenreBack, OpenTaiko.Tx.SongSelect_GenreBack); - } else { - return txCustomPrevSelectBG; - } - } - } - - public void tBoardNumberDraw(int x, int y, int num) { - int[] nums = CConversion.SeparateDigits(num); - for (int j = 0; j < nums.Length; j++) { - float offset = j - (nums.Length / 2.0f); - float _x = x - (OpenTaiko.Skin.SongSelect_BoardNumber_Interval[0] * offset); - float _y = y - (OpenTaiko.Skin.SongSelect_BoardNumber_Interval[1] * offset); - - float width = OpenTaiko.Tx.SongSelect_BoardNumber.sz画像サイズ.Width / 10.0f; - float height = OpenTaiko.Tx.SongSelect_BoardNumber.sz画像サイズ.Height; - - OpenTaiko.Tx.SongSelect_BoardNumber.t2D描画(_x, _y, new RectangleF(width * nums[j], 0, width, height)); - } - } - - private void tSongNumberDraw(int x, int y, int num) { - int[] nums = CConversion.SeparateDigits(num); - for (int j = 0; j < nums.Length; j++) { - float offset = j - (nums.Length / 2.0f); - float _x = x - (OpenTaiko.Skin.SongSelect_SongNumber_Interval[0] * offset); - float _y = y - (OpenTaiko.Skin.SongSelect_SongNumber_Interval[1] * offset); - - float width = OpenTaiko.Tx.SongSelect_Song_Number.sz画像サイズ.Width / 10.0f; - float height = OpenTaiko.Tx.SongSelect_Song_Number.sz画像サイズ.Height; - - OpenTaiko.Tx.SongSelect_Song_Number.t2D描画(_x, _y, new RectangleF(width * nums[j], 0, width, height)); - } - } - - private void tTimerDraw(int num) { - //int x = 1171, y = 57; - - int[] nums = CConversion.SeparateDigits(num); - - for (int j = 0; j < nums.Length; j++) { - if (OpenTaiko.ConfigIni.bEnableCountdownTimer) { - float offset = j - (nums.Length / 2.0f); - float x = OpenTaiko.Skin.SongSelect_Timer[0] - (int)(OpenTaiko.Skin.SongSelect_Timer_Interval[0] * offset); - float y = OpenTaiko.Skin.SongSelect_Timer[1] - (int)(OpenTaiko.Skin.SongSelect_Timer_Interval[1] * offset); - - float width = OpenTaiko.Tx.SongSelect_Timer.sz画像サイズ.Width / 10.0f; - float height = OpenTaiko.Tx.SongSelect_Timer.sz画像サイズ.Height / 2.0f; - - OpenTaiko.Tx.SongSelect_Timer.t2D描画(x, y, new RectangleF(width * nums[j], 0, width, height)); - } - } - } - - - - private class CCommandHistory // #24063 2011.1.16 yyagi コマンド入力履歴を保持_確認するクラス - { - readonly int buffersize = 16; - private List stct; - - public CCommandHistory() // コンストラクタ - { - stct = new List(buffersize); - } - - /// - /// コマンド入力履歴へのコマンド追加 - /// - /// 楽器の種類 - /// 入力コマンド(同時押しはOR演算で列挙すること) - public void Add(EInstrumentPad _eInst, EPadFlag _ePad) { - STCommandTime _stct = new STCommandTime { - eInst = _eInst, - ePad = _ePad, - time = OpenTaiko.Timer.NowTime - }; - - if (stct.Count >= buffersize) { - stct.RemoveAt(0); - } - stct.Add(_stct); - //Debug.WriteLine( "CMDHIS: 楽器=" + _stct.eInst + ", CMD=" + _stct.ePad + ", time=" + _stct.time ); - } - public void RemoveAt(int index) { - stct.RemoveAt(index); - } - - /// - /// コマンド入力に成功しているか調べる - /// - /// 入力が成功したか調べたいコマンド - /// 対象楽器 - /// コマンド入力成功時true - public bool CheckCommand(EPadFlag[] _ePad, EInstrumentPad _eInst) { - int targetCount = _ePad.Length; - int stciCount = stct.Count; - if (stciCount < targetCount) { - //Debug.WriteLine("NOT start checking...stciCount=" + stciCount + ", targetCount=" + targetCount); - return false; - } - - long curTime = OpenTaiko.Timer.NowTime; - //Debug.WriteLine("Start checking...targetCount=" + targetCount); - for (int i = targetCount - 1, j = stciCount - 1; i >= 0; i--, j--) { - if (_ePad[i] != stct[j].ePad) { - //Debug.WriteLine( "CMD解析: false targetCount=" + targetCount + ", i=" + i + ", j=" + j + ": ePad[]=" + _ePad[i] + ", stci[j] = " + stct[j].ePad ); - return false; - } - if (stct[j].eInst != _eInst) { - //Debug.WriteLine( "CMD解析: false " + i ); - return false; - } - if (curTime - stct[j].time > 500) { - //Debug.WriteLine( "CMD解析: false " + i + "; over 500ms" ); - return false; - } - curTime = stct[j].time; - } - - //Debug.Write( "CMD解析: 成功!(" + _ePad.Length + ") " ); - //for ( int i = 0; i < _ePad.Length; i++ ) Debug.Write( _ePad[ i ] + ", " ); - //Debug.WriteLine( "" ); - //stct.RemoveRange( 0, targetCount ); // #24396 2011.2.13 yyagi - stct.Clear(); // #24396 2011.2.13 yyagi Clear all command input history in case you succeeded inputting some command - - return true; - } - } - private CCommandHistory CommandHistory; - - private void tカーソルを下へ移動する() { - if ((this.actSongList.rGetSideSong(1).eノード種別 == CSongListNode.ENodeType.SCORE) || this.actSongList.rGetSideSong(1).eノード種別 == CSongListNode.ENodeType.BACKBOX) { - OpenTaiko.stageSongSelect.bBGMIn再生した = false; - - CSongSelectSongManager.disable(); - } else { - CSongSelectSongManager.enable(); - CSongSelectSongManager.playSongIfPossible(); - } - this.ctBackgroundFade.Start(0, 600, 1, OpenTaiko.Timer); - if (this.actSongList.ctBarOpen.CurrentValue >= 200 || this.ctBackgroundFade.CurrentValue >= 600 - 255) { - OpenTaiko.stageSongSelect.OldGenre = this.rNowSelectedSong.strジャンル; - OpenTaiko.stageSongSelect.OldUseGenre = !this.rNowSelectedSong.isChangedBgType; - OpenTaiko.stageSongSelect.OldBg = this.rNowSelectedSong.BgType; - OpenTaiko.stageSongSelect.OldBgColor = this.rNowSelectedSong.BgColor; - } - - this.actSongList.t次に移動(); - OpenTaiko.Skin.soundカーソル移動音.tPlay(); - } - private void tカーソルを上へ移動する() { - if ((this.actSongList.rGetSideSong(-1).eノード種別 == CSongListNode.ENodeType.SCORE) || this.actSongList.rGetSideSong(-1).eノード種別 == CSongListNode.ENodeType.BACKBOX) { - OpenTaiko.stageSongSelect.bBGMIn再生した = false; - - CSongSelectSongManager.disable(); - } else { - CSongSelectSongManager.enable(); - CSongSelectSongManager.playSongIfPossible(); - } - - this.ctBackgroundFade.Start(0, 600, 1, OpenTaiko.Timer); - if (this.actSongList.ctBarOpen.CurrentValue >= 200 || this.ctBackgroundFade.CurrentValue >= 600 - 255) { - OpenTaiko.stageSongSelect.OldGenre = this.rNowSelectedSong.strジャンル; - OpenTaiko.stageSongSelect.OldUseGenre = !this.rNowSelectedSong.isChangedBgType; - OpenTaiko.stageSongSelect.OldBg = this.rNowSelectedSong.BgType; - OpenTaiko.stageSongSelect.OldBgColor = this.rNowSelectedSong.BgColor; - } - - this.actSongList.t前に移動(); - OpenTaiko.Skin.soundカーソル移動音.tPlay(); - } - private void tカーソルスキップ(bool Up) { - this.ctBackgroundFade.Start(0, 600, 1, OpenTaiko.Timer); - if (this.actSongList.ctBarOpen.CurrentValue >= 200 || this.ctBackgroundFade.CurrentValue >= 600 - 255) { - OpenTaiko.stageSongSelect.OldGenre = this.rNowSelectedSong.strジャンル; - OpenTaiko.stageSongSelect.OldUseGenre = !this.rNowSelectedSong.isChangedBgType; - OpenTaiko.stageSongSelect.OldBg = this.rNowSelectedSong.BgType; - OpenTaiko.stageSongSelect.OldBgColor = this.rNowSelectedSong.BgColor; - } - - if (Up) this.actSongList.t前に移動(); - else this.actSongList.t次に移動(); - - OpenTaiko.Skin.soundSkip.tPlay(); - } - - private int tGetRandomSongDifficulty(int contextDiff) { - var song = this.rChoosenSong; - - int baseDiff = this.actSongList.n現在のアンカ難易度レベルに最も近い難易度レベルを返す(this.rChoosenSong); - - if (contextDiff >= 0) { - if (contextDiff < (int)Difficulty.Oni) - return contextDiff; - else if (contextDiff == (int)Difficulty.Oni) { - var score = song.arスコア[baseDiff]; - if (score.譜面情報.nレベル[(int)Difficulty.Oni] >= 0 && score.譜面情報.nレベル[(int)Difficulty.Edit] >= 0) - return (new Random().Next(0, 2) == 0 ? (int)Difficulty.Oni : (int)Difficulty.Edit); - return (int)Difficulty.Oni; - } - } - - return baseDiff; - } - - private void tSetSongRandomly() { - var usedDiffs = new int[] { -1, -1, -1, -1, -1 }; - var mandatoryDiffs = new List(); - - #region [Fetch context informations] - - if (this.actSongList.latestContext == eMenuContext.Random) { - for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { - var diff = this.actSongList.tMenuContextGetVar(i); - usedDiffs[i] = diff; - if (!mandatoryDiffs.Contains(diff)) - mandatoryDiffs.Add(diff); - } + this.actSortSongs.t進行描画(); + this.actQuickConfig.t進行描画(); } #endregion - CSongListNode song = this.actSongList.rCurrentlySelectedSong; + //------------------------------ + if (this.actDifficultySelectionScreen.bIsDifficltSelect) { + if (this.actSongList.ctDifficultyIn.CurrentValue >= 1255) { + this.actDifficultySelectionScreen.Draw(); + } + } + //------------------------------ - song.listランダム用ノードリスト = this.t指定された曲が存在する場所の曲を列挙する_子リスト含む(song, ref mandatoryDiffs); - int selectableSongCount = song.listランダム用ノードリスト.Count; - if (selectableSongCount == 0) { - return; + if (OpenTaiko.ConfigIni.nPlayerCount == 1) { + var opacity = 0; + + if (ctCreditAnime.CurrentValue <= 510) + opacity = ctCreditAnime.CurrentValue / 2; + else if (ctCreditAnime.CurrentValue <= 4500 - 510) + opacity = 255; + else + opacity = 255 - ((ctCreditAnime.CurrentValue - (4500 - 510)) / 2); + + OpenTaiko.Tx.SongSelect_Credit.Opacity = opacity; + + OpenTaiko.Tx.SongSelect_Credit.t2D描画(0, 0); } - int randomSongIndex = OpenTaiko.Random.Next(selectableSongCount); + for (int i = 0; i < 5; i++) { + CCounter ___cs = CMenuCharacter._getReferenceCounter(CMenuCharacter.ECharacterAnimation.START)[i]; - if (OpenTaiko.ConfigIni.bOutputDetailedDTXLog) { - StringBuilder builder = new StringBuilder(0x400); - builder.Append(string.Format("Total number of songs to randomly choose from {0}. Randomly selected index {0}.", selectableSongCount, randomSongIndex)); - Trace.TraceInformation(builder.ToString()); + //if (this.ctChara_Jump[i].n現在の値 >= this.ctChara_Jump[i].n終了値) + if (___cs != null && ___cs.CurrentValue >= ___cs.EndValue) { + //this.ctChara_Jump[i].t停止(); + ___cs.Stop(); + + if (!this.actDifficultySelectionScreen.bIsDifficltSelect) { + //this.ctChara_Jump[i].n現在の値 = 0; + ___cs.CurrentValue = 0; + } + } } - // Third assignment - this.rNowSelectedSong = song.listランダム用ノードリスト[randomSongIndex]; + if (actDifficultySelectionScreen.bOption[0]) actPlayOption.On進行描画(0); + if (actDifficultySelectionScreen.bOption[1]) actPlayOption.On進行描画(1); + if (actDifficultySelectionScreen.bOption[2]) actPlayOption.On進行描画(2); + if (actDifficultySelectionScreen.bOption[3]) actPlayOption.On進行描画(3); + if (actDifficultySelectionScreen.bOption[4]) actPlayOption.On進行描画(4); - actSongList.t現在選択中の曲を元に曲バーを再構成する(); - actSongList.t選択曲が変更された(false); - actSongList.tUpdateCurSong(); - actSongList.tResetTitleKey(); - actSongList.tバーの初期化(); - tNotifySelectedSongChange(); + if (actNewHeya.IsOpend) actNewHeya.Draw(); + + switch (base.ePhaseID) { + case CStage.EPhase.Common_FADEIN: + if (this.actFIFO.Draw() != 0) { + base.ePhaseID = CStage.EPhase.Common_NORMAL; + } + break; + + case CStage.EPhase.Common_FADEOUT: + if (this.actFIFO.Draw() == 0) { + break; + } + return (int)this.eフェードアウト完了時の戻り値; + + case CStage.EPhase.SongSelect_FadeInFromResults: + if (this.actFIfrom結果画面.Draw() != 0) { + base.ePhaseID = CStage.EPhase.Common_NORMAL; + } + break; + + case CStage.EPhase.SongSelect_FadeOutToNowLoading: + if (this.actFOtoNowLoading.Draw() == 0) { + break; + } + return (int)this.eフェードアウト完了時の戻り値; + } } - private void t曲を選択する() { - // First assignation - this.rChoosenSong = this.actSongList.rCurrentlySelectedSong; - this.r確定されたスコア = this.actSongList.r現在選択中のスコア; + return 0; + } + public enum E戻り値 : int { + 継続, + タイトルに戻る, + 選曲した, + オプション呼び出し, + コンフィグ呼び出し, + スキン変更 + } - this.nChoosenSongDifficulty[0] = this.actSongList.n現在選択中の曲の現在の難易度レベル; - this.str確定された曲のジャンル = this.rChoosenSong.strジャンル; - if ((this.rChoosenSong != null) && (this.r確定されたスコア != null)) { - this.eフェードアウト完了時の戻り値 = E戻り値.選曲した; - this.actFOtoNowLoading.tフェードアウト開始(); // #27787 2012.3.10 yyagi 曲決定時の画面フェードアウトの省略 - base.ePhaseID = CStage.EPhase.SongSelect_FadeOutToNowLoading; + // その他 + + #region [ private ] + //----------------- + [StructLayout(LayoutKind.Sequential)] + private struct STキー反復用カウンタ { + public CCounter Up; + public CCounter Down; + public CCounter this[int index] { + get { + switch (index) { + case 0: + return this.Up; + + case 1: + return this.Down; + } + throw new IndexOutOfRangeException(); + } + set { + switch (index) { + case 0: + this.Up = value; + return; + + case 1: + this.Down = value; + return; + } + throw new IndexOutOfRangeException(); } - // TJAPlayer3.Skin.bgm選曲画面.t停止する(); - CSongSelectSongManager.stopSong(); } - public void t曲を選択する(int nCurrentLevel, int player) { - // Second assignation - this.rChoosenSong = this.actSongList.rCurrentlySelectedSong; - this.r確定されたスコア = this.actSongList.r現在選択中のスコア; + } + private CCounter ctTimer; + private CCounter ctCreditAnime; + private Random[] r = new Random[3]; + public CCounter ctBackgroundFade; + public string NowGenre; + public string OldGenre; + public string NowBg; + public string OldBg; + public Color NowBgColor = Color.White; + public Color OldBgColor = Color.White; + public bool NowUseGenre; + public bool OldUseGenre; + private CActSelectArtistComment actArtistComment; + private CActFIFOBlack actFIFO; + private CActFIFOBlack actFIfrom結果画面; + //private CActFIFOBlack actFOtoNowLoading; + public CActFIFOStart actFOtoNowLoading; + private CActSelectInformation actInformation; + public CActSelectPreimageパネル actPreimageパネル; + public CActSelectPresound actPresound; + private CActオプションパネル actオプションパネル; + private CActSelectステータスパネル actステータスパネル; + public CActSelect演奏履歴パネル act演奏履歴パネル; + public CActSelect曲リスト actSongList; + public CActSelectSongInfo actSongInfo; + public CActSelectDanInfo actDanInfo; + public CActSelectTowerInfo actTowerInfo; + private CActSelectShowCurrentPosition actShowCurrentPosition; + public CActSelect難易度選択画面 actDifficultySelectionScreen; + public CActPlayOption actPlayOption; + public CActSelectExExtraTransAnime actExExtraTransAnime; + public CActNewHeya actNewHeya; - this.nChoosenSongDifficulty[player] = nCurrentLevel; - this.str確定された曲のジャンル = this.rChoosenSong.strジャンル; + public CActSortSongs actSortSongs; + private CActSelectQuickConfig actQuickConfig; - if ((this.rChoosenSong != null) && (this.r確定されたスコア != null)) { - this.eフェードアウト完了時の戻り値 = E戻り値.選曲した; - this.actFOtoNowLoading.tフェードアウト開始(); // #27787 2012.3.10 yyagi 曲決定時の画面フェードアウトの省略 - base.ePhaseID = CStage.EPhase.SongSelect_FadeOutToNowLoading; + private ScriptBG AI_Background; + + private const int MaxSong = 3; + public int NowSong = 1; + + //private CCounter ctChara_Normal; + //private CCounter ctChara_Select; + //public CCounter[] ctChara_Jump = new CCounter[2]; + + public PuchiChara PuchiChara; + + private string nGenreBack; + private string nOldGenreBack; + public bool bBGM再生済み; + public bool bBGMIn再生した; + private STキー反復用カウンタ ctキー反復用; + public CCounter ct登場時アニメ用共通; + private CCounter ctOldBGScroll; + private CCounter ct背景スクロール用タイマー; + private E戻り値 eフェードアウト完了時の戻り値; + private CCachedFontRenderer ftフォント; + //private CTexture tx下部パネル; + //private CTexture tx上部パネル; + //private CTexture tx背景; + // private CTexture[] txジャンル別背景 = new CTexture[9]; + // private CTexture[] tx難易度別背景 = new CTexture[5]; + // private CTexture tx難易度名; + // private CTexture tx下部テキスト; + private CCounter ctDiffSelect移動待ち; + + private STNumber[] stSongNumber = new STNumber[10]; + private STNumber[] stBoardNumber = new STNumber[10]; + + public struct STNumber { + public char ch; + public Point pt; + } + private struct STCommandTime // #24063 2011.1.16 yyagi コマンド入力時刻の記録用 + { + public EInstrumentPad eInst; // 使用楽器 + public EPadFlag ePad; // 押されたコマンド(同時押しはOR演算で列挙する) + public long time; // コマンド入力時刻 + } + + /* + private Point[] ptBoardNumber = + { new Point(72, 283), new Point(135, 283), new Point(200, 283), new Point(72, 258), new Point(135, 258), new Point(200, 258), new Point(200, 233), new Point(72, 311), new Point(135, 311), new Point(200, 311), new Point(84, 360), new Point(124, 416) }; + */ + + private CTexture txCustomSelectBG; + private CTexture txCustomPrevSelectBG; + private CTexture txGenreBack { + get { + if (txCustomSelectBG == null) { + return HGenreBar.tGetGenreBar(nGenreBack, OpenTaiko.Tx.SongSelect_GenreBack); + } else { + return txCustomSelectBG; } + } + } + private CTexture txOldGenreBack { + get { + if (txCustomPrevSelectBG == null) { + return HGenreBar.tGetGenreBar(nOldGenreBack, OpenTaiko.Tx.SongSelect_GenreBack); + } else { + return txCustomPrevSelectBG; + } + } + } - // TJAPlayer3.Skin.bgm選曲画面.t停止する(); - CSongSelectSongManager.stopSong(); + public void tBoardNumberDraw(int x, int y, int num) { + int[] nums = CConversion.SeparateDigits(num); + for (int j = 0; j < nums.Length; j++) { + float offset = j - (nums.Length / 2.0f); + float _x = x - (OpenTaiko.Skin.SongSelect_BoardNumber_Interval[0] * offset); + float _y = y - (OpenTaiko.Skin.SongSelect_BoardNumber_Interval[1] * offset); + + float width = OpenTaiko.Tx.SongSelect_BoardNumber.sz画像サイズ.Width / 10.0f; + float height = OpenTaiko.Tx.SongSelect_BoardNumber.sz画像サイズ.Height; + + OpenTaiko.Tx.SongSelect_BoardNumber.t2D描画(_x, _y, new RectangleF(width * nums[j], 0, width, height)); + } + } + + private void tSongNumberDraw(int x, int y, int num) { + int[] nums = CConversion.SeparateDigits(num); + for (int j = 0; j < nums.Length; j++) { + float offset = j - (nums.Length / 2.0f); + float _x = x - (OpenTaiko.Skin.SongSelect_SongNumber_Interval[0] * offset); + float _y = y - (OpenTaiko.Skin.SongSelect_SongNumber_Interval[1] * offset); + + float width = OpenTaiko.Tx.SongSelect_Song_Number.sz画像サイズ.Width / 10.0f; + float height = OpenTaiko.Tx.SongSelect_Song_Number.sz画像サイズ.Height; + + OpenTaiko.Tx.SongSelect_Song_Number.t2D描画(_x, _y, new RectangleF(width * nums[j], 0, width, height)); + } + } + + private void tTimerDraw(int num) { + //int x = 1171, y = 57; + + int[] nums = CConversion.SeparateDigits(num); + + for (int j = 0; j < nums.Length; j++) { + if (OpenTaiko.ConfigIni.bEnableCountdownTimer) { + float offset = j - (nums.Length / 2.0f); + float x = OpenTaiko.Skin.SongSelect_Timer[0] - (int)(OpenTaiko.Skin.SongSelect_Timer_Interval[0] * offset); + float y = OpenTaiko.Skin.SongSelect_Timer[1] - (int)(OpenTaiko.Skin.SongSelect_Timer_Interval[1] * offset); + + float width = OpenTaiko.Tx.SongSelect_Timer.sz画像サイズ.Width / 10.0f; + float height = OpenTaiko.Tx.SongSelect_Timer.sz画像サイズ.Height / 2.0f; + + OpenTaiko.Tx.SongSelect_Timer.t2D描画(x, y, new RectangleF(width * nums[j], 0, width, height)); + } + } + } + + + + private class CCommandHistory // #24063 2011.1.16 yyagi コマンド入力履歴を保持_確認するクラス + { + readonly int buffersize = 16; + private List stct; + + public CCommandHistory() // コンストラクタ + { + stct = new List(buffersize); } - // Foreach randomly selectable songs - private List t指定された曲が存在する場所の曲を列挙する_子リスト含む(CSongListNode song, ref List mandatory) { - List list = new List(); - song = song.rParentNode; - if ((song == null) && (OpenTaiko.Songs管理.list曲ルート.Count > 0)) { - foreach (CSongListNode c曲リストノード in OpenTaiko.Songs管理.list曲ルート) { - if ((c曲リストノード.eノード種別 == CSongListNode.ENodeType.SCORE) || (c曲リストノード.eノード種別 == CSongListNode.ENodeType.SCORE_MIDI)) { - // Don't add Dan/Tower charts for Random - int diff = this.actSongList.n現在のアンカ難易度レベルに最も近い難易度レベルを返す(c曲リストノード); - if (diff < (int)Difficulty.Tower) { - // Check if mandatory diffs are present - var score = c曲リストノード.arスコア[diff]; - bool requiredDiffsExist = true; - foreach (int df in mandatory) { - if (score.譜面情報.nレベル[df] < 0) { - requiredDiffsExist = false; - break; - } - } - - var IsSongLocked = OpenTaiko.Databases.DBSongUnlockables.tIsSongLocked(c曲リストノード); - if (requiredDiffsExist == true && IsSongLocked == false) { - list.Add(c曲リストノード); + /// + /// コマンド入力履歴へのコマンド追加 + /// + /// 楽器の種類 + /// 入力コマンド(同時押しはOR演算で列挙すること) + public void Add(EInstrumentPad _eInst, EPadFlag _ePad) { + STCommandTime _stct = new STCommandTime { + eInst = _eInst, + ePad = _ePad, + time = OpenTaiko.Timer.NowTime + }; + + if (stct.Count >= buffersize) { + stct.RemoveAt(0); + } + stct.Add(_stct); + //Debug.WriteLine( "CMDHIS: 楽器=" + _stct.eInst + ", CMD=" + _stct.ePad + ", time=" + _stct.time ); + } + public void RemoveAt(int index) { + stct.RemoveAt(index); + } + + /// + /// コマンド入力に成功しているか調べる + /// + /// 入力が成功したか調べたいコマンド + /// 対象楽器 + /// コマンド入力成功時true + public bool CheckCommand(EPadFlag[] _ePad, EInstrumentPad _eInst) { + int targetCount = _ePad.Length; + int stciCount = stct.Count; + if (stciCount < targetCount) { + //Debug.WriteLine("NOT start checking...stciCount=" + stciCount + ", targetCount=" + targetCount); + return false; + } + + long curTime = OpenTaiko.Timer.NowTime; + //Debug.WriteLine("Start checking...targetCount=" + targetCount); + for (int i = targetCount - 1, j = stciCount - 1; i >= 0; i--, j--) { + if (_ePad[i] != stct[j].ePad) { + //Debug.WriteLine( "CMD解析: false targetCount=" + targetCount + ", i=" + i + ", j=" + j + ": ePad[]=" + _ePad[i] + ", stci[j] = " + stct[j].ePad ); + return false; + } + if (stct[j].eInst != _eInst) { + //Debug.WriteLine( "CMD解析: false " + i ); + return false; + } + if (curTime - stct[j].time > 500) { + //Debug.WriteLine( "CMD解析: false " + i + "; over 500ms" ); + return false; + } + curTime = stct[j].time; + } + + //Debug.Write( "CMD解析: 成功!(" + _ePad.Length + ") " ); + //for ( int i = 0; i < _ePad.Length; i++ ) Debug.Write( _ePad[ i ] + ", " ); + //Debug.WriteLine( "" ); + //stct.RemoveRange( 0, targetCount ); // #24396 2011.2.13 yyagi + stct.Clear(); // #24396 2011.2.13 yyagi Clear all command input history in case you succeeded inputting some command + + return true; + } + } + private CCommandHistory CommandHistory; + + private void tカーソルを下へ移動する() { + if ((this.actSongList.rGetSideSong(1).eノード種別 == CSongListNode.ENodeType.SCORE) || this.actSongList.rGetSideSong(1).eノード種別 == CSongListNode.ENodeType.BACKBOX) { + OpenTaiko.stageSongSelect.bBGMIn再生した = false; + + CSongSelectSongManager.disable(); + } else { + CSongSelectSongManager.enable(); + CSongSelectSongManager.playSongIfPossible(); + } + this.ctBackgroundFade.Start(0, 600, 1, OpenTaiko.Timer); + if (this.actSongList.ctBarOpen.CurrentValue >= 200 || this.ctBackgroundFade.CurrentValue >= 600 - 255) { + OpenTaiko.stageSongSelect.OldGenre = this.rNowSelectedSong.strジャンル; + OpenTaiko.stageSongSelect.OldUseGenre = !this.rNowSelectedSong.isChangedBgType; + OpenTaiko.stageSongSelect.OldBg = this.rNowSelectedSong.BgType; + OpenTaiko.stageSongSelect.OldBgColor = this.rNowSelectedSong.BgColor; + } + + this.actSongList.t次に移動(); + OpenTaiko.Skin.soundカーソル移動音.tPlay(); + } + private void tカーソルを上へ移動する() { + if ((this.actSongList.rGetSideSong(-1).eノード種別 == CSongListNode.ENodeType.SCORE) || this.actSongList.rGetSideSong(-1).eノード種別 == CSongListNode.ENodeType.BACKBOX) { + OpenTaiko.stageSongSelect.bBGMIn再生した = false; + + CSongSelectSongManager.disable(); + } else { + CSongSelectSongManager.enable(); + CSongSelectSongManager.playSongIfPossible(); + } + + this.ctBackgroundFade.Start(0, 600, 1, OpenTaiko.Timer); + if (this.actSongList.ctBarOpen.CurrentValue >= 200 || this.ctBackgroundFade.CurrentValue >= 600 - 255) { + OpenTaiko.stageSongSelect.OldGenre = this.rNowSelectedSong.strジャンル; + OpenTaiko.stageSongSelect.OldUseGenre = !this.rNowSelectedSong.isChangedBgType; + OpenTaiko.stageSongSelect.OldBg = this.rNowSelectedSong.BgType; + OpenTaiko.stageSongSelect.OldBgColor = this.rNowSelectedSong.BgColor; + } + + this.actSongList.t前に移動(); + OpenTaiko.Skin.soundカーソル移動音.tPlay(); + } + private void tカーソルスキップ(bool Up) { + this.ctBackgroundFade.Start(0, 600, 1, OpenTaiko.Timer); + if (this.actSongList.ctBarOpen.CurrentValue >= 200 || this.ctBackgroundFade.CurrentValue >= 600 - 255) { + OpenTaiko.stageSongSelect.OldGenre = this.rNowSelectedSong.strジャンル; + OpenTaiko.stageSongSelect.OldUseGenre = !this.rNowSelectedSong.isChangedBgType; + OpenTaiko.stageSongSelect.OldBg = this.rNowSelectedSong.BgType; + OpenTaiko.stageSongSelect.OldBgColor = this.rNowSelectedSong.BgColor; + } + + if (Up) this.actSongList.t前に移動(); + else this.actSongList.t次に移動(); + + OpenTaiko.Skin.soundSkip.tPlay(); + } + + private int tGetRandomSongDifficulty(int contextDiff) { + var song = this.rChoosenSong; + + int baseDiff = this.actSongList.n現在のアンカ難易度レベルに最も近い難易度レベルを返す(this.rChoosenSong); + + if (contextDiff >= 0) { + if (contextDiff < (int)Difficulty.Oni) + return contextDiff; + else if (contextDiff == (int)Difficulty.Oni) { + var score = song.arスコア[baseDiff]; + if (score.譜面情報.nレベル[(int)Difficulty.Oni] >= 0 && score.譜面情報.nレベル[(int)Difficulty.Edit] >= 0) + return (new Random().Next(0, 2) == 0 ? (int)Difficulty.Oni : (int)Difficulty.Edit); + return (int)Difficulty.Oni; + } + } + + return baseDiff; + } + + private void tSetSongRandomly() { + var usedDiffs = new int[] { -1, -1, -1, -1, -1 }; + var mandatoryDiffs = new List(); + + #region [Fetch context informations] + + if (this.actSongList.latestContext == eMenuContext.Random) { + for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { + var diff = this.actSongList.tMenuContextGetVar(i); + usedDiffs[i] = diff; + if (!mandatoryDiffs.Contains(diff)) + mandatoryDiffs.Add(diff); + } + } + + #endregion + + CSongListNode song = this.actSongList.rCurrentlySelectedSong; + + song.listランダム用ノードリスト = this.t指定された曲が存在する場所の曲を列挙する_子リスト含む(song, ref mandatoryDiffs); + int selectableSongCount = song.listランダム用ノードリスト.Count; + + if (selectableSongCount == 0) { + return; + } + + int randomSongIndex = OpenTaiko.Random.Next(selectableSongCount); + + if (OpenTaiko.ConfigIni.bOutputDetailedDTXLog) { + StringBuilder builder = new StringBuilder(0x400); + builder.Append(string.Format("Total number of songs to randomly choose from {0}. Randomly selected index {0}.", selectableSongCount, randomSongIndex)); + Trace.TraceInformation(builder.ToString()); + } + + // Third assignment + this.rNowSelectedSong = song.listランダム用ノードリスト[randomSongIndex]; + + actSongList.t現在選択中の曲を元に曲バーを再構成する(); + actSongList.t選択曲が変更された(false); + actSongList.tUpdateCurSong(); + actSongList.tResetTitleKey(); + actSongList.tバーの初期化(); + tNotifySelectedSongChange(); + } + private void t曲を選択する() { + // First assignation + this.rChoosenSong = this.actSongList.rCurrentlySelectedSong; + this.r確定されたスコア = this.actSongList.r現在選択中のスコア; + + this.nChoosenSongDifficulty[0] = this.actSongList.n現在選択中の曲の現在の難易度レベル; + this.str確定された曲のジャンル = this.rChoosenSong.strジャンル; + + if ((this.rChoosenSong != null) && (this.r確定されたスコア != null)) { + this.eフェードアウト完了時の戻り値 = E戻り値.選曲した; + this.actFOtoNowLoading.tフェードアウト開始(); // #27787 2012.3.10 yyagi 曲決定時の画面フェードアウトの省略 + base.ePhaseID = CStage.EPhase.SongSelect_FadeOutToNowLoading; + } + // TJAPlayer3.Skin.bgm選曲画面.t停止する(); + CSongSelectSongManager.stopSong(); + } + public void t曲を選択する(int nCurrentLevel, int player) { + // Second assignation + this.rChoosenSong = this.actSongList.rCurrentlySelectedSong; + this.r確定されたスコア = this.actSongList.r現在選択中のスコア; + + this.nChoosenSongDifficulty[player] = nCurrentLevel; + this.str確定された曲のジャンル = this.rChoosenSong.strジャンル; + + if ((this.rChoosenSong != null) && (this.r確定されたスコア != null)) { + this.eフェードアウト完了時の戻り値 = E戻り値.選曲した; + this.actFOtoNowLoading.tフェードアウト開始(); // #27787 2012.3.10 yyagi 曲決定時の画面フェードアウトの省略 + base.ePhaseID = CStage.EPhase.SongSelect_FadeOutToNowLoading; + } + + // TJAPlayer3.Skin.bgm選曲画面.t停止する(); + CSongSelectSongManager.stopSong(); + } + + // Foreach randomly selectable songs + private List t指定された曲が存在する場所の曲を列挙する_子リスト含む(CSongListNode song, ref List mandatory) { + List list = new List(); + song = song.rParentNode; + if ((song == null) && (OpenTaiko.Songs管理.list曲ルート.Count > 0)) { + foreach (CSongListNode c曲リストノード in OpenTaiko.Songs管理.list曲ルート) { + if ((c曲リストノード.eノード種別 == CSongListNode.ENodeType.SCORE) || (c曲リストノード.eノード種別 == CSongListNode.ENodeType.SCORE_MIDI)) { + // Don't add Dan/Tower charts for Random + int diff = this.actSongList.n現在のアンカ難易度レベルに最も近い難易度レベルを返す(c曲リストノード); + if (diff < (int)Difficulty.Tower) { + // Check if mandatory diffs are present + var score = c曲リストノード.arスコア[diff]; + bool requiredDiffsExist = true; + foreach (int df in mandatory) { + if (score.譜面情報.nレベル[df] < 0) { + requiredDiffsExist = false; + break; } + } + var IsSongLocked = OpenTaiko.Databases.DBSongUnlockables.tIsSongLocked(c曲リストノード); + if (requiredDiffsExist == true && IsSongLocked == false) { + list.Add(c曲リストノード); } } - if ((c曲リストノード.list子リスト != null) && OpenTaiko.ConfigIni.bIncludeSubfoldersOnRandomSelect) { - this.t指定された曲の子リストの曲を列挙する_孫リスト含む(c曲リストノード, ref list, ref mandatory); - } + + } + if ((c曲リストノード.list子リスト != null) && OpenTaiko.ConfigIni.bIncludeSubfoldersOnRandomSelect) { + this.t指定された曲の子リストの曲を列挙する_孫リスト含む(c曲リストノード, ref list, ref mandatory); } - return list; } - this.t指定された曲の子リストの曲を列挙する_孫リスト含む(song, ref list, ref mandatory); return list; } + this.t指定された曲の子リストの曲を列挙する_孫リスト含む(song, ref list, ref mandatory); + return list; + } - public void t指定された曲の子リストの曲を列挙する_孫リスト含む(CSongListNode r親, ref List list, ref List mandatory, bool dan = false, Difficulty difficulty = Difficulty.Dan) { - if ((r親 != null) && (r親.list子リスト != null)) { - foreach (CSongListNode c曲リストノード in r親.list子リスト) { - if ((c曲リストノード.eノード種別 == CSongListNode.ENodeType.SCORE) || (c曲リストノード.eノード種別 == CSongListNode.ENodeType.SCORE_MIDI)) { - // Don't add Dan/Tower charts for Random - int diff = this.actSongList.n現在のアンカ難易度レベルに最も近い難易度レベルを返す(c曲リストノード); + public void t指定された曲の子リストの曲を列挙する_孫リスト含む(CSongListNode r親, ref List list, ref List mandatory, bool dan = false, Difficulty difficulty = Difficulty.Dan) { + if ((r親 != null) && (r親.list子リスト != null)) { + foreach (CSongListNode c曲リストノード in r親.list子リスト) { + if ((c曲リストノード.eノード種別 == CSongListNode.ENodeType.SCORE) || (c曲リストノード.eノード種別 == CSongListNode.ENodeType.SCORE_MIDI)) { + // Don't add Dan/Tower charts for Random + int diff = this.actSongList.n現在のアンカ難易度レベルに最も近い難易度レベルを返す(c曲リストノード); - if (dan ? diff == (int)difficulty : diff < (int)Difficulty.Tower) { - // Check if mandatory diffs are present - var score = c曲リストノード.arスコア[diff]; - bool requiredDiffsExist = true; - foreach (int df in mandatory) { - if (score.譜面情報.nレベル[df] < 0) { - requiredDiffsExist = false; - break; - } + if (dan ? diff == (int)difficulty : diff < (int)Difficulty.Tower) { + // Check if mandatory diffs are present + var score = c曲リストノード.arスコア[diff]; + bool requiredDiffsExist = true; + foreach (int df in mandatory) { + if (score.譜面情報.nレベル[df] < 0) { + requiredDiffsExist = false; + break; } - - var IsSongLocked = OpenTaiko.Databases.DBSongUnlockables.tIsSongLocked(c曲リストノード); - if (requiredDiffsExist == true && IsSongLocked == false) { - list.Add(c曲リストノード); - } - } + + var IsSongLocked = OpenTaiko.Databases.DBSongUnlockables.tIsSongLocked(c曲リストノード); + if (requiredDiffsExist == true && IsSongLocked == false) { + list.Add(c曲リストノード); + } + } - if ((c曲リストノード.list子リスト != null) && OpenTaiko.ConfigIni.bIncludeSubfoldersOnRandomSelect) { - this.t指定された曲の子リストの曲を列挙する_孫リスト含む(c曲リストノード, ref list, ref mandatory, dan, difficulty); - } + } + if ((c曲リストノード.list子リスト != null) && OpenTaiko.ConfigIni.bIncludeSubfoldersOnRandomSelect) { + this.t指定された曲の子リストの曲を列挙する_孫リスト含む(c曲リストノード, ref list, ref mandatory, dan, difficulty); } } } - - //----------------- - #endregion } + + //----------------- + #endregion } diff --git a/OpenTaiko/src/Stages/06.SongLoading/CStage曲読み込み.cs b/OpenTaiko/src/Stages/06.SongLoading/CStage曲読み込み.cs index 1a64e9fb..2339e777 100644 --- a/OpenTaiko/src/Stages/06.SongLoading/CStage曲読み込み.cs +++ b/OpenTaiko/src/Stages/06.SongLoading/CStage曲読み込み.cs @@ -1,540 +1,540 @@ using System.Diagnostics; using FDK; -namespace OpenTaiko { - internal class CStage曲読み込み : CStage { - // コンストラクタ - - public CStage曲読み込み() { - base.eStageID = CStage.EStage.SongLoading; - base.ePhaseID = CStage.EPhase.Common_NORMAL; - base.IsDeActivated = true; - //base.list子Activities.Add( this.actFI = new CActFIFOBlack() ); // #27787 2012.3.10 yyagi 曲読み込み画面のフェードインの省略 - //base.list子Activities.Add( this.actFO = new CActFIFOBlack() ); - } - - - // CStage 実装 - - public override void Activate() { - Trace.TraceInformation("曲読み込みステージを活性化します。"); - Trace.Indent(); +namespace OpenTaiko; + +internal class CStage曲読み込み : CStage { + // コンストラクタ + + public CStage曲読み込み() { + base.eStageID = CStage.EStage.SongLoading; + base.ePhaseID = CStage.EPhase.Common_NORMAL; + base.IsDeActivated = true; + //base.list子Activities.Add( this.actFI = new CActFIFOBlack() ); // #27787 2012.3.10 yyagi 曲読み込み画面のフェードインの省略 + //base.list子Activities.Add( this.actFO = new CActFIFOBlack() ); + } + + + // CStage 実装 + + public override void Activate() { + Trace.TraceInformation("曲読み込みステージを活性化します。"); + Trace.Indent(); + try { + this.str曲タイトル = ""; + this.strSTAGEFILE = ""; + this.nBGM再生開始時刻 = -1; + this.nBGMの総再生時間ms = 0; + if (this.sd読み込み音 != null) { + OpenTaiko.SoundManager.tDisposeSound(this.sd読み込み音); + this.sd読み込み音 = null; + } + + if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] >= 5 || OpenTaiko.ConfigIni.nPlayerCount != 1) { + OpenTaiko.ConfigIni.bTokkunMode = false; + } + + string strDTXファイルパス = OpenTaiko.stageSongSelect.r確定されたスコア.ファイル情報.ファイルの絶対パス; + + var strフォルダ名 = Path.GetDirectoryName(strDTXファイルパス) + Path.DirectorySeparatorChar; + + var 譜面情報 = OpenTaiko.stageSongSelect.r確定されたスコア.譜面情報; + this.str曲タイトル = 譜面情報.タイトル; + this.strサブタイトル = 譜面情報.strサブタイトル; + + this.strSTAGEFILE = CSkin.Path(@$"Graphics{Path.DirectorySeparatorChar}4_SongLoading{Path.DirectorySeparatorChar}Background.png"); + + + float wait = 600f; + if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) + wait = 1000f; + else if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Tower) + wait = 1200f; + + this.ct待機 = new CCounter(0, wait, 5, OpenTaiko.Timer); + this.ct曲名表示 = new CCounter(1, 30, 30, OpenTaiko.Timer); try { - this.str曲タイトル = ""; - this.strSTAGEFILE = ""; - this.nBGM再生開始時刻 = -1; - this.nBGMの総再生時間ms = 0; - if (this.sd読み込み音 != null) { - OpenTaiko.SoundManager.tDisposeSound(this.sd読み込み音); - this.sd読み込み音 = null; - } + // When performing calibration, inform the player that + // calibration is about to begin, rather than + // displaying the song title and subtitle as usual. - if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] >= 5 || OpenTaiko.ConfigIni.nPlayerCount != 1) { - OpenTaiko.ConfigIni.bTokkunMode = false; - } + var タイトル = this.str曲タイトル; - string strDTXファイルパス = OpenTaiko.stageSongSelect.r確定されたスコア.ファイル情報.ファイルの絶対パス; + var サブタイトル = this.strサブタイトル; - var strフォルダ名 = Path.GetDirectoryName(strDTXファイルパス) + Path.DirectorySeparatorChar; - - var 譜面情報 = OpenTaiko.stageSongSelect.r確定されたスコア.譜面情報; - this.str曲タイトル = 譜面情報.タイトル; - this.strサブタイトル = 譜面情報.strサブタイトル; - - this.strSTAGEFILE = CSkin.Path(@$"Graphics{Path.DirectorySeparatorChar}4_SongLoading{Path.DirectorySeparatorChar}Background.png"); + if (!string.IsNullOrEmpty(タイトル)) { + //this.txタイトル = new CTexture( CDTXMania.app.Device, image, CDTXMania.TextureFormat ); + //this.txタイトル.vc拡大縮小倍率 = new Vector3( 0.5f, 0.5f, 1f ); - float wait = 600f; - if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) - wait = 1000f; - else if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Tower) - wait = 1200f; - - this.ct待機 = new CCounter(0, wait, 5, OpenTaiko.Timer); - this.ct曲名表示 = new CCounter(1, 30, 30, OpenTaiko.Timer); - try { - // When performing calibration, inform the player that - // calibration is about to begin, rather than - // displaying the song title and subtitle as usual. - - var タイトル = this.str曲タイトル; - - var サブタイトル = this.strサブタイトル; - - if (!string.IsNullOrEmpty(タイトル)) { - //this.txタイトル = new CTexture( CDTXMania.app.Device, image, CDTXMania.TextureFormat ); - //this.txタイトル.vc拡大縮小倍率 = new Vector3( 0.5f, 0.5f, 1f ); - - - using (var bmpSongTitle = this.pfTITLE.DrawText(タイトル, OpenTaiko.Skin.SongLoading_Title_ForeColor, OpenTaiko.Skin.SongLoading_Title_BackColor, null, 30)) { - this.txタイトル = new CTexture(bmpSongTitle); - txタイトル.vcScaleRatio.X = OpenTaiko.GetSongNameXScaling(ref txタイトル, OpenTaiko.Skin.SongLoading_Title_MaxSize); - } - - using (var bmpSongSubTitle = this.pfSUBTITLE.DrawText(サブタイトル, OpenTaiko.Skin.SongLoading_SubTitle_ForeColor, OpenTaiko.Skin.SongLoading_SubTitle_BackColor, null, 30)) { - this.txサブタイトル = new CTexture(bmpSongSubTitle); - txサブタイトル.vcScaleRatio.X = OpenTaiko.GetSongNameXScaling(ref txサブタイトル, OpenTaiko.Skin.SongLoading_SubTitle_MaxSize); - } - } else { - this.txタイトル = null; - this.txサブタイトル = null; + using (var bmpSongTitle = this.pfTITLE.DrawText(タイトル, OpenTaiko.Skin.SongLoading_Title_ForeColor, OpenTaiko.Skin.SongLoading_Title_BackColor, null, 30)) { + this.txタイトル = new CTexture(bmpSongTitle); + txタイトル.vcScaleRatio.X = OpenTaiko.GetSongNameXScaling(ref txタイトル, OpenTaiko.Skin.SongLoading_Title_MaxSize); } - } catch (CTextureCreateFailedException e) { - Trace.TraceError(e.ToString()); - Trace.TraceError("テクスチャの生成に失敗しました。({0})", new object[] { this.strSTAGEFILE }); + using (var bmpSongSubTitle = this.pfSUBTITLE.DrawText(サブタイトル, OpenTaiko.Skin.SongLoading_SubTitle_ForeColor, OpenTaiko.Skin.SongLoading_SubTitle_BackColor, null, 30)) { + this.txサブタイトル = new CTexture(bmpSongSubTitle); + txサブタイトル.vcScaleRatio.X = OpenTaiko.GetSongNameXScaling(ref txサブタイトル, OpenTaiko.Skin.SongLoading_SubTitle_MaxSize); + } + } else { this.txタイトル = null; this.txサブタイトル = null; } - base.Activate(); - } finally { - Trace.TraceInformation("曲読み込みステージの活性化を完了しました。"); - Trace.Unindent(); + } catch (CTextureCreateFailedException e) { + Trace.TraceError(e.ToString()); + Trace.TraceError("テクスチャの生成に失敗しました。({0})", new object[] { this.strSTAGEFILE }); + this.txタイトル = null; + this.txサブタイトル = null; } - } - public override void DeActivate() { - Trace.TraceInformation("曲読み込みステージを非活性化します。"); - Trace.Indent(); - try { - OpenTaiko.tテクスチャの解放(ref this.txタイトル); - //CDTXMania.tテクスチャの解放( ref this.txSongnamePlate ); - OpenTaiko.tテクスチャの解放(ref this.txサブタイトル); - base.DeActivate(); - } finally { - Trace.TraceInformation("曲読み込みステージの非活性化を完了しました。"); - Trace.Unindent(); - } - } - public override void CreateManagedResource() { - this.pfTITLE = HPrivateFastFont.tInstantiateMainFont(OpenTaiko.Skin.SongLoading_Title_FontSize); - this.pfSUBTITLE = HPrivateFastFont.tInstantiateMainFont(OpenTaiko.Skin.SongLoading_SubTitle_FontSize); - pfDanTitle = HPrivateFastFont.tInstantiateMainFont(OpenTaiko.Skin.Game_DanC_Title_Size); - pfDanSubTitle = HPrivateFastFont.tInstantiateMainFont(OpenTaiko.Skin.Game_DanC_SubTitle_Size); - - //this.txSongnamePlate = CDTXMania.tテクスチャの生成( CSkin.Path( @$"Graphics{Path.DirectorySeparatorChar}6_SongnamePlate.png" ) ); - base.CreateManagedResource(); - } - public override void ReleaseManagedResource() { - OpenTaiko.tDisposeSafely(ref this.pfTITLE); - OpenTaiko.tDisposeSafely(ref this.pfSUBTITLE); - pfDanTitle?.Dispose(); - pfDanSubTitle?.Dispose(); - - base.ReleaseManagedResource(); + base.Activate(); + } finally { + Trace.TraceInformation("曲読み込みステージの活性化を完了しました。"); + Trace.Unindent(); } - public override int Draw() { - string str; + } + public override void DeActivate() { + Trace.TraceInformation("曲読み込みステージを非活性化します。"); + Trace.Indent(); + try { + OpenTaiko.tテクスチャの解放(ref this.txタイトル); + //CDTXMania.tテクスチャの解放( ref this.txSongnamePlate ); + OpenTaiko.tテクスチャの解放(ref this.txサブタイトル); + base.DeActivate(); + } finally { + Trace.TraceInformation("曲読み込みステージの非活性化を完了しました。"); + Trace.Unindent(); + } + } + public override void CreateManagedResource() { + this.pfTITLE = HPrivateFastFont.tInstantiateMainFont(OpenTaiko.Skin.SongLoading_Title_FontSize); + this.pfSUBTITLE = HPrivateFastFont.tInstantiateMainFont(OpenTaiko.Skin.SongLoading_SubTitle_FontSize); + pfDanTitle = HPrivateFastFont.tInstantiateMainFont(OpenTaiko.Skin.Game_DanC_Title_Size); + pfDanSubTitle = HPrivateFastFont.tInstantiateMainFont(OpenTaiko.Skin.Game_DanC_SubTitle_Size); - if (base.IsDeActivated) - return 0; - - #region [ 初めての進行描画 ] - //----------------------------- - if (base.IsFirstDraw) { - Cスコア cスコア1 = OpenTaiko.stageSongSelect.r確定されたスコア; - if (this.sd読み込み音 != null) { - if (OpenTaiko.Skin.sound曲読込開始音.bExclusive && (CSkin.CSystemSound.r最後に再生した排他システムサウンド != null)) { - CSkin.CSystemSound.r最後に再生した排他システムサウンド.tStop(); - } - this.sd読み込み音.PlayStart(); - this.nBGM再生開始時刻 = SoundManager.PlayTimer.NowTime; - this.nBGMの総再生時間ms = this.sd読み込み音.TotalPlayTime; - } else { - OpenTaiko.Skin.sound曲読込開始音.tPlay(); - this.nBGM再生開始時刻 = SoundManager.PlayTimer.NowTime; - this.nBGMの総再生時間ms = OpenTaiko.Skin.sound曲読込開始音.n長さ_現在のサウンド; - } - //this.actFI.tフェードイン開始(); // #27787 2012.3.10 yyagi 曲読み込み画面のフェードインの省略 - base.ePhaseID = CStage.EPhase.Common_FADEIN; - base.IsFirstDraw = false; + //this.txSongnamePlate = CDTXMania.tテクスチャの生成( CSkin.Path( @$"Graphics{Path.DirectorySeparatorChar}6_SongnamePlate.png" ) ); + base.CreateManagedResource(); + } + public override void ReleaseManagedResource() { + OpenTaiko.tDisposeSafely(ref this.pfTITLE); + OpenTaiko.tDisposeSafely(ref this.pfSUBTITLE); - nWAVcount = 1; - } - //----------------------------- - #endregion - this.ct待機.Tick(); - - #region [ Cancel loading with esc ] - if (tキー入力()) { - if (this.sd読み込み音 != null) { - this.sd読み込み音.tStopSound(); - this.sd読み込み音.tDispose(); + pfDanTitle?.Dispose(); + pfDanSubTitle?.Dispose(); + + base.ReleaseManagedResource(); + } + public override int Draw() { + string str; + + if (base.IsDeActivated) + return 0; + + #region [ 初めての進行描画 ] + //----------------------------- + if (base.IsFirstDraw) { + Cスコア cスコア1 = OpenTaiko.stageSongSelect.r確定されたスコア; + if (this.sd読み込み音 != null) { + if (OpenTaiko.Skin.sound曲読込開始音.bExclusive && (CSkin.CSystemSound.r最後に再生した排他システムサウンド != null)) { + CSkin.CSystemSound.r最後に再生した排他システムサウンド.tStop(); } - return (int)ESongLoadingScreenReturnValue.LoadCanceled; - } - #endregion - - if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] != (int)Difficulty.Dan) { - void drawPlate() { - if (OpenTaiko.Tx.SongLoading_Plate != null) { - OpenTaiko.Tx.SongLoading_Plate.bスクリーン合成 = OpenTaiko.Skin.SongLoading_Plate_ScreenBlend; //あまりにも出番が無い - OpenTaiko.Tx.SongLoading_Plate.Opacity = 255; - if (OpenTaiko.Skin.SongLoading_Plate_ReferencePoint == CSkin.ReferencePoint.Left) { - OpenTaiko.Tx.SongLoading_Plate.t2D描画(OpenTaiko.Skin.SongLoading_Plate_X, OpenTaiko.Skin.SongLoading_Plate_Y - (OpenTaiko.Tx.SongLoading_Plate.sz画像サイズ.Height / 2)); - } else if (OpenTaiko.Skin.SongLoading_Plate_ReferencePoint == CSkin.ReferencePoint.Right) { - OpenTaiko.Tx.SongLoading_Plate.t2D描画(OpenTaiko.Skin.SongLoading_Plate_X - OpenTaiko.Tx.SongLoading_Plate.sz画像サイズ.Width, OpenTaiko.Skin.SongLoading_Plate_Y - (OpenTaiko.Tx.SongLoading_Plate.sz画像サイズ.Height / 2)); - } else { - OpenTaiko.Tx.SongLoading_Plate.t2D描画(OpenTaiko.Skin.SongLoading_Plate_X - (OpenTaiko.Tx.SongLoading_Plate.sz画像サイズ.Width / 2), OpenTaiko.Skin.SongLoading_Plate_Y - (OpenTaiko.Tx.SongLoading_Plate.sz画像サイズ.Height / 2)); - } - } - //CDTXMania.act文字コンソール.tPrint( 0, 16, C文字コンソール.Eフォント種別.灰, C変換.nParsentTo255( ( this.ct曲名表示.n現在の値 / 30.0 ) ).ToString() ); - - - int y = 720 - 45; - if (this.txタイトル != null) { - int nサブタイトル補正 = string.IsNullOrEmpty(OpenTaiko.stageSongSelect.r確定されたスコア.譜面情報.strサブタイトル) ? 15 : 0; + this.sd読み込み音.PlayStart(); + this.nBGM再生開始時刻 = SoundManager.PlayTimer.NowTime; + this.nBGMの総再生時間ms = this.sd読み込み音.TotalPlayTime; + } else { + OpenTaiko.Skin.sound曲読込開始音.tPlay(); + this.nBGM再生開始時刻 = SoundManager.PlayTimer.NowTime; + this.nBGMの総再生時間ms = OpenTaiko.Skin.sound曲読込開始音.n長さ_現在のサウンド; + } + //this.actFI.tフェードイン開始(); // #27787 2012.3.10 yyagi 曲読み込み画面のフェードインの省略 + base.ePhaseID = CStage.EPhase.Common_FADEIN; + base.IsFirstDraw = false; - this.txタイトル.Opacity = 255; - if (OpenTaiko.Skin.SongLoading_Title_ReferencePoint == CSkin.ReferencePoint.Left) { - this.txタイトル.t2D描画(OpenTaiko.Skin.SongLoading_Title_X, OpenTaiko.Skin.SongLoading_Title_Y - (this.txタイトル.sz画像サイズ.Height / 2) + nサブタイトル補正); - } else if (OpenTaiko.Skin.SongLoading_Title_ReferencePoint == CSkin.ReferencePoint.Right) { - this.txタイトル.t2D描画(OpenTaiko.Skin.SongLoading_Title_X - (this.txタイトル.sz画像サイズ.Width * txタイトル.vcScaleRatio.X), OpenTaiko.Skin.SongLoading_Title_Y - (this.txタイトル.sz画像サイズ.Height / 2) + nサブタイトル補正); - } else { - this.txタイトル.t2D描画((OpenTaiko.Skin.SongLoading_Title_X - ((this.txタイトル.sz画像サイズ.Width * txタイトル.vcScaleRatio.X) / 2)), OpenTaiko.Skin.SongLoading_Title_Y - (this.txタイトル.sz画像サイズ.Height / 2) + nサブタイトル補正); - } - } - if (this.txサブタイトル != null) { - this.txサブタイトル.Opacity = 255; - if (OpenTaiko.Skin.SongLoading_SubTitle_ReferencePoint == CSkin.ReferencePoint.Left) { - this.txサブタイトル.t2D描画(OpenTaiko.Skin.SongLoading_SubTitle_X, OpenTaiko.Skin.SongLoading_SubTitle_Y - (this.txサブタイトル.sz画像サイズ.Height / 2)); - } else if (OpenTaiko.Skin.SongLoading_Title_ReferencePoint == CSkin.ReferencePoint.Right) { - this.txサブタイトル.t2D描画(OpenTaiko.Skin.SongLoading_SubTitle_X - (this.txサブタイトル.sz画像サイズ.Width * txタイトル.vcScaleRatio.X), OpenTaiko.Skin.SongLoading_SubTitle_Y - (this.txサブタイトル.sz画像サイズ.Height / 2)); - } else { - this.txサブタイトル.t2D描画((OpenTaiko.Skin.SongLoading_SubTitle_X - ((this.txサブタイトル.sz画像サイズ.Width * txサブタイトル.vcScaleRatio.X) / 2)), OpenTaiko.Skin.SongLoading_SubTitle_Y - (this.txサブタイトル.sz画像サイズ.Height / 2)); - } + nWAVcount = 1; + } + //----------------------------- + #endregion + this.ct待機.Tick(); + + #region [ Cancel loading with esc ] + if (tキー入力()) { + if (this.sd読み込み音 != null) { + this.sd読み込み音.tStopSound(); + this.sd読み込み音.tDispose(); + } + return (int)ESongLoadingScreenReturnValue.LoadCanceled; + } + #endregion + + if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] != (int)Difficulty.Dan) { + void drawPlate() { + if (OpenTaiko.Tx.SongLoading_Plate != null) { + OpenTaiko.Tx.SongLoading_Plate.bスクリーン合成 = OpenTaiko.Skin.SongLoading_Plate_ScreenBlend; //あまりにも出番が無い + OpenTaiko.Tx.SongLoading_Plate.Opacity = 255; + if (OpenTaiko.Skin.SongLoading_Plate_ReferencePoint == CSkin.ReferencePoint.Left) { + OpenTaiko.Tx.SongLoading_Plate.t2D描画(OpenTaiko.Skin.SongLoading_Plate_X, OpenTaiko.Skin.SongLoading_Plate_Y - (OpenTaiko.Tx.SongLoading_Plate.sz画像サイズ.Height / 2)); + } else if (OpenTaiko.Skin.SongLoading_Plate_ReferencePoint == CSkin.ReferencePoint.Right) { + OpenTaiko.Tx.SongLoading_Plate.t2D描画(OpenTaiko.Skin.SongLoading_Plate_X - OpenTaiko.Tx.SongLoading_Plate.sz画像サイズ.Width, OpenTaiko.Skin.SongLoading_Plate_Y - (OpenTaiko.Tx.SongLoading_Plate.sz画像サイズ.Height / 2)); + } else { + OpenTaiko.Tx.SongLoading_Plate.t2D描画(OpenTaiko.Skin.SongLoading_Plate_X - (OpenTaiko.Tx.SongLoading_Plate.sz画像サイズ.Width / 2), OpenTaiko.Skin.SongLoading_Plate_Y - (OpenTaiko.Tx.SongLoading_Plate.sz画像サイズ.Height / 2)); } } + //CDTXMania.act文字コンソール.tPrint( 0, 16, C文字コンソール.Eフォント種別.灰, C変換.nParsentTo255( ( this.ct曲名表示.n現在の値 / 30.0 ) ).ToString() ); - void drawPlate_AI() { - if (OpenTaiko.Tx.SongLoading_Plate_AI != null) { - OpenTaiko.Tx.SongLoading_Plate_AI.bスクリーン合成 = OpenTaiko.Skin.SongLoading_Plate_ScreenBlend; //あまりにも出番が無い - OpenTaiko.Tx.SongLoading_Plate_AI.Opacity = 255; - if (OpenTaiko.Skin.SongLoading_Plate_ReferencePoint == CSkin.ReferencePoint.Left) { - OpenTaiko.Tx.SongLoading_Plate_AI.t2D描画(OpenTaiko.Skin.SongLoading_Plate_X_AI, OpenTaiko.Skin.SongLoading_Plate_Y_AI - (OpenTaiko.Tx.SongLoading_Plate_AI.sz画像サイズ.Height / 2)); - } else if (OpenTaiko.Skin.SongLoading_Plate_ReferencePoint == CSkin.ReferencePoint.Right) { - OpenTaiko.Tx.SongLoading_Plate_AI.t2D描画(OpenTaiko.Skin.SongLoading_Plate_X_AI - OpenTaiko.Tx.SongLoading_Plate_AI.sz画像サイズ.Width, OpenTaiko.Skin.SongLoading_Plate_Y_AI - (OpenTaiko.Tx.SongLoading_Plate_AI.sz画像サイズ.Height / 2)); - } else { - OpenTaiko.Tx.SongLoading_Plate_AI.t2D描画(OpenTaiko.Skin.SongLoading_Plate_X_AI - (OpenTaiko.Tx.SongLoading_Plate_AI.sz画像サイズ.Width / 2), OpenTaiko.Skin.SongLoading_Plate_Y_AI - (OpenTaiko.Tx.SongLoading_Plate_AI.sz画像サイズ.Height / 2)); - } - } - //CDTXMania.act文字コンソール.tPrint( 0, 16, C文字コンソール.Eフォント種別.灰, C変換.nParsentTo255( ( this.ct曲名表示.n現在の値 / 30.0 ) ).ToString() ); - - - int y = 720 - 45; - if (this.txタイトル != null) { - int nサブタイトル補正 = string.IsNullOrEmpty(OpenTaiko.stageSongSelect.r確定されたスコア.譜面情報.strサブタイトル) ? 15 : 0; - this.txタイトル.Opacity = 255; - if (OpenTaiko.Skin.SongLoading_Title_ReferencePoint == CSkin.ReferencePoint.Left) { - this.txタイトル.t2D描画(OpenTaiko.Skin.SongLoading_Title_X_AI, OpenTaiko.Skin.SongLoading_Title_Y_AI - (this.txタイトル.sz画像サイズ.Height / 2) + nサブタイトル補正); - } else if (OpenTaiko.Skin.SongLoading_Title_ReferencePoint == CSkin.ReferencePoint.Right) { - this.txタイトル.t2D描画(OpenTaiko.Skin.SongLoading_Title_X_AI - (this.txタイトル.sz画像サイズ.Width * txタイトル.vcScaleRatio.X), OpenTaiko.Skin.SongLoading_Title_Y_AI - (this.txタイトル.sz画像サイズ.Height / 2) + nサブタイトル補正); - } else { - this.txタイトル.t2D描画((OpenTaiko.Skin.SongLoading_Title_X_AI - ((this.txタイトル.sz画像サイズ.Width * txタイトル.vcScaleRatio.X) / 2)), OpenTaiko.Skin.SongLoading_Title_Y_AI - (this.txタイトル.sz画像サイズ.Height / 2) + nサブタイトル補正); - } + int y = 720 - 45; + if (this.txタイトル != null) { + int nサブタイトル補正 = string.IsNullOrEmpty(OpenTaiko.stageSongSelect.r確定されたスコア.譜面情報.strサブタイトル) ? 15 : 0; + + this.txタイトル.Opacity = 255; + if (OpenTaiko.Skin.SongLoading_Title_ReferencePoint == CSkin.ReferencePoint.Left) { + this.txタイトル.t2D描画(OpenTaiko.Skin.SongLoading_Title_X, OpenTaiko.Skin.SongLoading_Title_Y - (this.txタイトル.sz画像サイズ.Height / 2) + nサブタイトル補正); + } else if (OpenTaiko.Skin.SongLoading_Title_ReferencePoint == CSkin.ReferencePoint.Right) { + this.txタイトル.t2D描画(OpenTaiko.Skin.SongLoading_Title_X - (this.txタイトル.sz画像サイズ.Width * txタイトル.vcScaleRatio.X), OpenTaiko.Skin.SongLoading_Title_Y - (this.txタイトル.sz画像サイズ.Height / 2) + nサブタイトル補正); + } else { + this.txタイトル.t2D描画((OpenTaiko.Skin.SongLoading_Title_X - ((this.txタイトル.sz画像サイズ.Width * txタイトル.vcScaleRatio.X) / 2)), OpenTaiko.Skin.SongLoading_Title_Y - (this.txタイトル.sz画像サイズ.Height / 2) + nサブタイトル補正); } - if (this.txサブタイトル != null) { - this.txサブタイトル.Opacity = 255; - if (OpenTaiko.Skin.SongLoading_SubTitle_ReferencePoint == CSkin.ReferencePoint.Left) { - this.txサブタイトル.t2D描画(OpenTaiko.Skin.SongLoading_SubTitle_X_AI, OpenTaiko.Skin.SongLoading_SubTitle_Y_AI - (this.txサブタイトル.sz画像サイズ.Height / 2)); - } else if (OpenTaiko.Skin.SongLoading_Title_ReferencePoint == CSkin.ReferencePoint.Right) { - this.txサブタイトル.t2D描画(OpenTaiko.Skin.SongLoading_SubTitle_X_AI - (this.txサブタイトル.sz画像サイズ.Width * txタイトル.vcScaleRatio.X), OpenTaiko.Skin.SongLoading_SubTitle_Y_AI - (this.txサブタイトル.sz画像サイズ.Height / 2)); - } else { - this.txサブタイトル.t2D描画((OpenTaiko.Skin.SongLoading_SubTitle_X_AI - ((this.txサブタイトル.sz画像サイズ.Width * txサブタイトル.vcScaleRatio.X) / 2)), OpenTaiko.Skin.SongLoading_SubTitle_Y_AI - (this.txサブタイトル.sz画像サイズ.Height / 2)); - } + } + if (this.txサブタイトル != null) { + this.txサブタイトル.Opacity = 255; + if (OpenTaiko.Skin.SongLoading_SubTitle_ReferencePoint == CSkin.ReferencePoint.Left) { + this.txサブタイトル.t2D描画(OpenTaiko.Skin.SongLoading_SubTitle_X, OpenTaiko.Skin.SongLoading_SubTitle_Y - (this.txサブタイトル.sz画像サイズ.Height / 2)); + } else if (OpenTaiko.Skin.SongLoading_Title_ReferencePoint == CSkin.ReferencePoint.Right) { + this.txサブタイトル.t2D描画(OpenTaiko.Skin.SongLoading_SubTitle_X - (this.txサブタイトル.sz画像サイズ.Width * txタイトル.vcScaleRatio.X), OpenTaiko.Skin.SongLoading_SubTitle_Y - (this.txサブタイトル.sz画像サイズ.Height / 2)); + } else { + this.txサブタイトル.t2D描画((OpenTaiko.Skin.SongLoading_SubTitle_X - ((this.txサブタイトル.sz画像サイズ.Width * txサブタイトル.vcScaleRatio.X) / 2)), OpenTaiko.Skin.SongLoading_SubTitle_Y - (this.txサブタイトル.sz画像サイズ.Height / 2)); } - } - - #region [ Loading screen (except dan) ] - //----------------------------- - this.ct曲名表示.Tick(); + } + } - if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Tower) { - #region [Tower loading screen] - - if (OpenTaiko.Skin.Game_Tower_Ptn_Result > 0) { - int xFactor = 0; - float yFactor = 1f; + void drawPlate_AI() { + if (OpenTaiko.Tx.SongLoading_Plate_AI != null) { + OpenTaiko.Tx.SongLoading_Plate_AI.bスクリーン合成 = OpenTaiko.Skin.SongLoading_Plate_ScreenBlend; //あまりにも出番が無い + OpenTaiko.Tx.SongLoading_Plate_AI.Opacity = 255; + if (OpenTaiko.Skin.SongLoading_Plate_ReferencePoint == CSkin.ReferencePoint.Left) { + OpenTaiko.Tx.SongLoading_Plate_AI.t2D描画(OpenTaiko.Skin.SongLoading_Plate_X_AI, OpenTaiko.Skin.SongLoading_Plate_Y_AI - (OpenTaiko.Tx.SongLoading_Plate_AI.sz画像サイズ.Height / 2)); + } else if (OpenTaiko.Skin.SongLoading_Plate_ReferencePoint == CSkin.ReferencePoint.Right) { + OpenTaiko.Tx.SongLoading_Plate_AI.t2D描画(OpenTaiko.Skin.SongLoading_Plate_X_AI - OpenTaiko.Tx.SongLoading_Plate_AI.sz画像サイズ.Width, OpenTaiko.Skin.SongLoading_Plate_Y_AI - (OpenTaiko.Tx.SongLoading_Plate_AI.sz画像サイズ.Height / 2)); + } else { + OpenTaiko.Tx.SongLoading_Plate_AI.t2D描画(OpenTaiko.Skin.SongLoading_Plate_X_AI - (OpenTaiko.Tx.SongLoading_Plate_AI.sz画像サイズ.Width / 2), OpenTaiko.Skin.SongLoading_Plate_Y_AI - (OpenTaiko.Tx.SongLoading_Plate_AI.sz画像サイズ.Height / 2)); + } + } + //CDTXMania.act文字コンソール.tPrint( 0, 16, C文字コンソール.Eフォント種別.灰, C変換.nParsentTo255( ( this.ct曲名表示.n現在の値 / 30.0 ) ).ToString() ); - int currentTowerType = Array.IndexOf(OpenTaiko.Skin.Game_Tower_Names, OpenTaiko.stageSongSelect.rChoosenSong.arスコア[5].譜面情報.nTowerType); - if (currentTowerType < 0 || currentTowerType >= OpenTaiko.Skin.Game_Tower_Ptn) - currentTowerType = 0; + int y = 720 - 45; + if (this.txタイトル != null) { + int nサブタイトル補正 = string.IsNullOrEmpty(OpenTaiko.stageSongSelect.r確定されたスコア.譜面情報.strサブタイトル) ? 15 : 0; - if (OpenTaiko.Tx.TowerResult_Background != null && currentTowerType < OpenTaiko.Tx.TowerResult_Tower.Length && OpenTaiko.Tx.TowerResult_Tower[currentTowerType] != null) { - xFactor = (OpenTaiko.Tx.TowerResult_Background.szTextureSize.Width - OpenTaiko.Tx.TowerResult_Tower[currentTowerType].szTextureSize.Width) / 2; - yFactor = OpenTaiko.Tx.TowerResult_Tower[currentTowerType].szTextureSize.Height / (float)OpenTaiko.Tx.TowerResult_Background.szTextureSize.Height; - } + this.txタイトル.Opacity = 255; + if (OpenTaiko.Skin.SongLoading_Title_ReferencePoint == CSkin.ReferencePoint.Left) { + this.txタイトル.t2D描画(OpenTaiko.Skin.SongLoading_Title_X_AI, OpenTaiko.Skin.SongLoading_Title_Y_AI - (this.txタイトル.sz画像サイズ.Height / 2) + nサブタイトル補正); + } else if (OpenTaiko.Skin.SongLoading_Title_ReferencePoint == CSkin.ReferencePoint.Right) { + this.txタイトル.t2D描画(OpenTaiko.Skin.SongLoading_Title_X_AI - (this.txタイトル.sz画像サイズ.Width * txタイトル.vcScaleRatio.X), OpenTaiko.Skin.SongLoading_Title_Y_AI - (this.txタイトル.sz画像サイズ.Height / 2) + nサブタイトル補正); + } else { + this.txタイトル.t2D描画((OpenTaiko.Skin.SongLoading_Title_X_AI - ((this.txタイトル.sz画像サイズ.Width * txタイトル.vcScaleRatio.X) / 2)), OpenTaiko.Skin.SongLoading_Title_Y_AI - (this.txタイトル.sz画像サイズ.Height / 2) + nサブタイトル補正); + } + } + if (this.txサブタイトル != null) { + this.txサブタイトル.Opacity = 255; + if (OpenTaiko.Skin.SongLoading_SubTitle_ReferencePoint == CSkin.ReferencePoint.Left) { + this.txサブタイトル.t2D描画(OpenTaiko.Skin.SongLoading_SubTitle_X_AI, OpenTaiko.Skin.SongLoading_SubTitle_Y_AI - (this.txサブタイトル.sz画像サイズ.Height / 2)); + } else if (OpenTaiko.Skin.SongLoading_Title_ReferencePoint == CSkin.ReferencePoint.Right) { + this.txサブタイトル.t2D描画(OpenTaiko.Skin.SongLoading_SubTitle_X_AI - (this.txサブタイトル.sz画像サイズ.Width * txタイトル.vcScaleRatio.X), OpenTaiko.Skin.SongLoading_SubTitle_Y_AI - (this.txサブタイトル.sz画像サイズ.Height / 2)); + } else { + this.txサブタイトル.t2D描画((OpenTaiko.Skin.SongLoading_SubTitle_X_AI - ((this.txサブタイトル.sz画像サイズ.Width * txサブタイトル.vcScaleRatio.X) / 2)), OpenTaiko.Skin.SongLoading_SubTitle_Y_AI - (this.txサブタイトル.sz画像サイズ.Height / 2)); + } + } + } - float pos = (OpenTaiko.Tx.TowerResult_Background.szTextureSize.Height - OpenTaiko.Skin.Resolution[1]) - - ((ct待機.CurrentValue <= 1200 ? ct待機.CurrentValue / 10f : 120) / 120f * (OpenTaiko.Tx.TowerResult_Background.szTextureSize.Height - OpenTaiko.Skin.Resolution[1])); + #region [ Loading screen (except dan) ] + //----------------------------- + this.ct曲名表示.Tick(); - OpenTaiko.Tx.TowerResult_Background?.t2D描画(0, -1 * pos); + if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Tower) { + #region [Tower loading screen] - if (currentTowerType < OpenTaiko.Tx.TowerResult_Tower.Length) - OpenTaiko.Tx.TowerResult_Tower[currentTowerType]?.t2D描画(xFactor, -1 * yFactor * pos); - } - - #endregion - drawPlate(); - } else if (OpenTaiko.ConfigIni.bAIBattleMode) { - OpenTaiko.ConfigIni.tInitializeAILevel(); - OpenTaiko.Tx.SongLoading_Bg_AI_Wait.t2D描画(0, 0); - drawPlate_AI(); - } else { - #region [Ensou loading screen] - - if (OpenTaiko.Tx.SongLoading_BgWait != null) OpenTaiko.Tx.SongLoading_BgWait.t2D描画(0, 0); - if (OpenTaiko.Tx.SongLoading_Chara != null) OpenTaiko.Tx.SongLoading_Chara.t2D描画(0, 0); + if (OpenTaiko.Skin.Game_Tower_Ptn_Result > 0) { + int xFactor = 0; + float yFactor = 1f; + + int currentTowerType = Array.IndexOf(OpenTaiko.Skin.Game_Tower_Names, OpenTaiko.stageSongSelect.rChoosenSong.arスコア[5].譜面情報.nTowerType); + + if (currentTowerType < 0 || currentTowerType >= OpenTaiko.Skin.Game_Tower_Ptn) + currentTowerType = 0; + + if (OpenTaiko.Tx.TowerResult_Background != null && currentTowerType < OpenTaiko.Tx.TowerResult_Tower.Length && OpenTaiko.Tx.TowerResult_Tower[currentTowerType] != null) { + xFactor = (OpenTaiko.Tx.TowerResult_Background.szTextureSize.Width - OpenTaiko.Tx.TowerResult_Tower[currentTowerType].szTextureSize.Width) / 2; + yFactor = OpenTaiko.Tx.TowerResult_Tower[currentTowerType].szTextureSize.Height / (float)OpenTaiko.Tx.TowerResult_Background.szTextureSize.Height; + } + + float pos = (OpenTaiko.Tx.TowerResult_Background.szTextureSize.Height - OpenTaiko.Skin.Resolution[1]) - + ((ct待機.CurrentValue <= 1200 ? ct待機.CurrentValue / 10f : 120) / 120f * (OpenTaiko.Tx.TowerResult_Background.szTextureSize.Height - OpenTaiko.Skin.Resolution[1])); + + OpenTaiko.Tx.TowerResult_Background?.t2D描画(0, -1 * pos); + + if (currentTowerType < OpenTaiko.Tx.TowerResult_Tower.Length) + OpenTaiko.Tx.TowerResult_Tower[currentTowerType]?.t2D描画(xFactor, -1 * yFactor * pos); + } - drawPlate(); - - #endregion - } - - //CDTXMania.act文字コンソール.tPrint( 0, 0, C文字コンソール.Eフォント種別.灰, this.ct曲名表示.n現在の値.ToString() ); - - //----------------------------- #endregion - } else { - #region [ Dan Loading screen ] - - OpenTaiko.Tx.SongLoading_Bg_Dan.t2D描画(0, 0 - (ct待機.CurrentValue <= 600 ? ct待機.CurrentValue / 10f : 60)); + drawPlate(); + } else if (OpenTaiko.ConfigIni.bAIBattleMode) { + OpenTaiko.ConfigIni.tInitializeAILevel(); + OpenTaiko.Tx.SongLoading_Bg_AI_Wait.t2D描画(0, 0); + drawPlate_AI(); + } else { + #region [Ensou loading screen] - CTexture dp = (OpenTaiko.stage段位選択.段位リスト.stバー情報 != null) - ? OpenTaiko.stage段位選択.段位リスト.stバー情報[OpenTaiko.stage段位選択.段位リスト.n現在の選択行].txDanPlate - : null; + if (OpenTaiko.Tx.SongLoading_BgWait != null) OpenTaiko.Tx.SongLoading_BgWait.t2D描画(0, 0); + if (OpenTaiko.Tx.SongLoading_Chara != null) OpenTaiko.Tx.SongLoading_Chara.t2D描画(0, 0); - CActSelect段位リスト.tDisplayDanPlate(dp, - null, - OpenTaiko.Skin.SongLoading_DanPlate[0], - OpenTaiko.Skin.SongLoading_DanPlate[1]); + drawPlate(); - if (OpenTaiko.Tx.Tile_Black != null) { - OpenTaiko.Tx.Tile_Black.Opacity = (int)(ct待機.CurrentValue <= 51 ? (255 - ct待機.CurrentValue / 0.2f) : (this.ct待機.CurrentValue - 949) / 0.2); - for (int i = 0; i <= (SampleFramework.GameWindowSize.Width / OpenTaiko.Tx.Tile_Black.szTextureSize.Width); i++) // #23510 2010.10.31 yyagi: change "clientSize.Width" to "640" to fix FIFO drawing size + #endregion + } + + //CDTXMania.act文字コンソール.tPrint( 0, 0, C文字コンソール.Eフォント種別.灰, this.ct曲名表示.n現在の値.ToString() ); + + //----------------------------- + #endregion + } else { + #region [ Dan Loading screen ] + + OpenTaiko.Tx.SongLoading_Bg_Dan.t2D描画(0, 0 - (ct待機.CurrentValue <= 600 ? ct待機.CurrentValue / 10f : 60)); + + CTexture dp = (OpenTaiko.stage段位選択.段位リスト.stバー情報 != null) + ? OpenTaiko.stage段位選択.段位リスト.stバー情報[OpenTaiko.stage段位選択.段位リスト.n現在の選択行].txDanPlate + : null; + + CActSelect段位リスト.tDisplayDanPlate(dp, + null, + OpenTaiko.Skin.SongLoading_DanPlate[0], + OpenTaiko.Skin.SongLoading_DanPlate[1]); + + if (OpenTaiko.Tx.Tile_Black != null) { + OpenTaiko.Tx.Tile_Black.Opacity = (int)(ct待機.CurrentValue <= 51 ? (255 - ct待機.CurrentValue / 0.2f) : (this.ct待機.CurrentValue - 949) / 0.2); + for (int i = 0; i <= (SampleFramework.GameWindowSize.Width / OpenTaiko.Tx.Tile_Black.szTextureSize.Width); i++) // #23510 2010.10.31 yyagi: change "clientSize.Width" to "640" to fix FIFO drawing size + { + for (int j = 0; j <= (SampleFramework.GameWindowSize.Height / OpenTaiko.Tx.Tile_Black.szTextureSize.Height); j++) // #23510 2010.10.31 yyagi: change "clientSize.Height" to "480" to fix FIFO drawing size { - for (int j = 0; j <= (SampleFramework.GameWindowSize.Height / OpenTaiko.Tx.Tile_Black.szTextureSize.Height); j++) // #23510 2010.10.31 yyagi: change "clientSize.Height" to "480" to fix FIFO drawing size - { - OpenTaiko.Tx.Tile_Black.t2D描画(i * OpenTaiko.Tx.Tile_Black.szTextureSize.Width, j * OpenTaiko.Tx.Tile_Black.szTextureSize.Height); - } + OpenTaiko.Tx.Tile_Black.t2D描画(i * OpenTaiko.Tx.Tile_Black.szTextureSize.Width, j * OpenTaiko.Tx.Tile_Black.szTextureSize.Height); } - } - - #endregion + } } - switch (base.ePhaseID) { - case CStage.EPhase.Common_FADEIN: - //if( this.actFI.On進行描画() != 0 ) // #27787 2012.3.10 yyagi 曲読み込み画面のフェードインの省略 - // 必ず一度「CStaeg.Eフェーズ.共通_フェードイン」フェーズを経由させること。 - // さもないと、曲読み込みが完了するまで、曲読み込み画面が描画されない。 - base.ePhaseID = CStage.EPhase.SongLoading_LoadDTXFile; - return (int)ESongLoadingScreenReturnValue.Continue; + #endregion + } - case CStage.EPhase.SongLoading_LoadDTXFile: { - timeBeginLoad = DateTime.Now; - TimeSpan span; - str = OpenTaiko.stageSongSelect.r確定されたスコア.ファイル情報.ファイルの絶対パス; + switch (base.ePhaseID) { + case CStage.EPhase.Common_FADEIN: + //if( this.actFI.On進行描画() != 0 ) // #27787 2012.3.10 yyagi 曲読み込み画面のフェードインの省略 + // 必ず一度「CStaeg.Eフェーズ.共通_フェードイン」フェーズを経由させること。 + // さもないと、曲読み込みが完了するまで、曲読み込み画面が描画されない。 + base.ePhaseID = CStage.EPhase.SongLoading_LoadDTXFile; + return (int)ESongLoadingScreenReturnValue.Continue; - if ((OpenTaiko.DTX != null) && OpenTaiko.DTX.IsActivated) - OpenTaiko.DTX.DeActivate(); - - //if( CDTXMania.DTX == null ) - { - OpenTaiko.DTX = new CDTX(str, false, 1.0, 0, 0, 0, true, OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0]); - if (OpenTaiko.ConfigIni.nPlayerCount >= 2) - OpenTaiko.DTX_2P = new CDTX(str, false, 1.0, 0, 0, 1, true, OpenTaiko.stageSongSelect.nChoosenSongDifficulty[1]); - if (OpenTaiko.ConfigIni.nPlayerCount >= 3) - OpenTaiko.DTX_3P = new CDTX(str, false, 1.0, 0, 0, 2, true, OpenTaiko.stageSongSelect.nChoosenSongDifficulty[2]); - if (OpenTaiko.ConfigIni.nPlayerCount >= 4) - OpenTaiko.DTX_4P = new CDTX(str, false, 1.0, 0, 0, 3, true, OpenTaiko.stageSongSelect.nChoosenSongDifficulty[3]); - if (OpenTaiko.ConfigIni.nPlayerCount >= 5) - OpenTaiko.DTX_5P = new CDTX(str, false, 1.0, 0, 0, 4, true, OpenTaiko.stageSongSelect.nChoosenSongDifficulty[4]); + case CStage.EPhase.SongLoading_LoadDTXFile: { + timeBeginLoad = DateTime.Now; + TimeSpan span; + str = OpenTaiko.stageSongSelect.r確定されたスコア.ファイル情報.ファイルの絶対パス; - if (OpenTaiko.DTX.listErrors.Count != 0) { - string message = ""; - foreach (var text in OpenTaiko.DTX.listErrors) { - OpenTaiko.VisualLogManager.PushCard(CVisualLogManager.ELogCardType.LogError, text); - //System.Windows.Forms.MessageBox.Show(text, "譜面にエラーが見つかりました"); - } + if ((OpenTaiko.DTX != null) && OpenTaiko.DTX.IsActivated) + OpenTaiko.DTX.DeActivate(); + + //if( CDTXMania.DTX == null ) + { + OpenTaiko.DTX = new CDTX(str, false, 1.0, 0, 0, 0, true, OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0]); + if (OpenTaiko.ConfigIni.nPlayerCount >= 2) + OpenTaiko.DTX_2P = new CDTX(str, false, 1.0, 0, 0, 1, true, OpenTaiko.stageSongSelect.nChoosenSongDifficulty[1]); + if (OpenTaiko.ConfigIni.nPlayerCount >= 3) + OpenTaiko.DTX_3P = new CDTX(str, false, 1.0, 0, 0, 2, true, OpenTaiko.stageSongSelect.nChoosenSongDifficulty[2]); + if (OpenTaiko.ConfigIni.nPlayerCount >= 4) + OpenTaiko.DTX_4P = new CDTX(str, false, 1.0, 0, 0, 3, true, OpenTaiko.stageSongSelect.nChoosenSongDifficulty[3]); + if (OpenTaiko.ConfigIni.nPlayerCount >= 5) + OpenTaiko.DTX_5P = new CDTX(str, false, 1.0, 0, 0, 4, true, OpenTaiko.stageSongSelect.nChoosenSongDifficulty[4]); + + if (OpenTaiko.DTX.listErrors.Count != 0) { + string message = ""; + foreach (var text in OpenTaiko.DTX.listErrors) { + OpenTaiko.VisualLogManager.PushCard(CVisualLogManager.ELogCardType.LogError, text); + //System.Windows.Forms.MessageBox.Show(text, "譜面にエラーが見つかりました"); } - - Trace.TraceInformation("---- Song information -----------------"); - Trace.TraceInformation("TITLE: {0}", OpenTaiko.DTX.TITLE.GetString("")); - Trace.TraceInformation("FILE: {0}", OpenTaiko.DTX.strファイル名の絶対パス); - Trace.TraceInformation("---------------------------"); - - span = (TimeSpan)(DateTime.Now - timeBeginLoad); - Trace.TraceInformation("Chart loading time: {0}", span.ToString()); - - // 段位認定モード用。 - #region [dan setup] - if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan && OpenTaiko.DTX.List_DanSongs != null) { - - var titleForeColor = OpenTaiko.Skin.Game_DanC_Title_ForeColor; - var titleBackColor = OpenTaiko.Skin.Game_DanC_Title_BackColor; - var subtitleForeColor = OpenTaiko.Skin.Game_DanC_SubTitle_ForeColor; - var subtitleBackColor = OpenTaiko.Skin.Game_DanC_SubTitle_BackColor; - - for (int i = 0; i < OpenTaiko.DTX.List_DanSongs.Count; i++) { - if (!string.IsNullOrEmpty(OpenTaiko.DTX.List_DanSongs[i].Title)) { - using (var bmpSongTitle = pfDanTitle.DrawText(OpenTaiko.DTX.List_DanSongs[i].Title, titleForeColor, titleBackColor, null, 30)) { - OpenTaiko.DTX.List_DanSongs[i].TitleTex = OpenTaiko.tテクスチャの生成(bmpSongTitle, false); - OpenTaiko.DTX.List_DanSongs[i].TitleTex.vcScaleRatio.X = OpenTaiko.GetSongNameXScaling(ref OpenTaiko.DTX.List_DanSongs[i].TitleTex, OpenTaiko.Skin.Game_DanC_Title_MaxWidth); - } - } - - if (!string.IsNullOrEmpty(OpenTaiko.DTX.List_DanSongs[i].SubTitle)) { - using (var bmpSongSubTitle = pfDanSubTitle.DrawText(OpenTaiko.DTX.List_DanSongs[i].SubTitle, subtitleForeColor, subtitleBackColor, null, 30)) { - OpenTaiko.DTX.List_DanSongs[i].SubTitleTex = OpenTaiko.tテクスチャの生成(bmpSongSubTitle, false); - OpenTaiko.DTX.List_DanSongs[i].SubTitleTex.vcScaleRatio.X = OpenTaiko.GetSongNameXScaling(ref OpenTaiko.DTX.List_DanSongs[i].SubTitleTex, OpenTaiko.Skin.Game_DanC_SubTitle_MaxWidth); - } - } - - } - } - #endregion } - base.ePhaseID = CStage.EPhase.SongLoading_WaitToLoadWAVFile; - timeBeginLoadWAV = DateTime.Now; - return (int)ESongLoadingScreenReturnValue.Continue; - } - - case CStage.EPhase.SongLoading_WaitToLoadWAVFile: { - if (this.ct待機.CurrentValue > 260) { - base.ePhaseID = CStage.EPhase.SongLoading_LoadWAVFile; - } - return (int)ESongLoadingScreenReturnValue.Continue; - } - - case CStage.EPhase.SongLoading_LoadWAVFile: { - int looptime = (OpenTaiko.ConfigIni.bEnableVSync) ? 3 : 1; // VSyncWait=ON時は1frame(1/60s)あたり3つ読むようにする - for (int i = 0; i < looptime && nWAVcount <= OpenTaiko.DTX.listWAV.Count; i++) { - if (OpenTaiko.DTX.listWAV[nWAVcount].listこのWAVを使用するチャンネル番号の集合.Count > 0) // #28674 2012.5.8 yyagi - { - OpenTaiko.DTX.tWAVの読み込み(OpenTaiko.DTX.listWAV[nWAVcount]); - } - nWAVcount++; - } - if (nWAVcount > OpenTaiko.DTX.listWAV.Count) { - TimeSpan span = (TimeSpan)(DateTime.Now - timeBeginLoadWAV); - Trace.TraceInformation("Song loading time({0,4}): {1}", OpenTaiko.DTX.listWAV.Count, span.ToString()); - timeBeginLoadWAV = DateTime.Now; - - if (OpenTaiko.ConfigIni.bDynamicBassMixerManagement) { - OpenTaiko.DTX.PlanToAddMixerChannel(); - } - - var _dtx = new CDTX[5] { OpenTaiko.DTX, OpenTaiko.DTX_2P, OpenTaiko.DTX_3P, OpenTaiko.DTX_4P, OpenTaiko.DTX_5P }; - - for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { - _dtx[i]?.tRandomizeTaikoChips(i); - _dtx[i]?.tApplyFunMods(i); - OpenTaiko.ReplayInstances[i] = new CSongReplay(_dtx[i].strファイル名の絶対パス, i); - } - - OpenTaiko.stage演奏ドラム画面.Activate(); - - span = (TimeSpan)(DateTime.Now - timeBeginLoadWAV); - - base.ePhaseID = CStage.EPhase.SongLoading_LoadBMPFile; - } - return (int)ESongLoadingScreenReturnValue.Continue; - } - - case CStage.EPhase.SongLoading_LoadBMPFile: { - TimeSpan span; - DateTime timeBeginLoadBMPAVI = DateTime.Now; - - if (OpenTaiko.ConfigIni.bEnableAVI) - OpenTaiko.DTX.tAVIの読み込み(); - span = (TimeSpan)(DateTime.Now - timeBeginLoadBMPAVI); + Trace.TraceInformation("---- Song information -----------------"); + Trace.TraceInformation("TITLE: {0}", OpenTaiko.DTX.TITLE.GetString("")); + Trace.TraceInformation("FILE: {0}", OpenTaiko.DTX.strファイル名の絶対パス); + Trace.TraceInformation("---------------------------"); span = (TimeSpan)(DateTime.Now - timeBeginLoad); - Trace.TraceInformation("総読込時間: {0}", span.ToString()); + Trace.TraceInformation("Chart loading time: {0}", span.ToString()); - if (OpenTaiko.ConfigIni.FastRender) { - var fastRender = new FastRender(); - fastRender.Render(); - fastRender = null; + // 段位認定モード用。 + #region [dan setup] + if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan && OpenTaiko.DTX.List_DanSongs != null) { + + var titleForeColor = OpenTaiko.Skin.Game_DanC_Title_ForeColor; + var titleBackColor = OpenTaiko.Skin.Game_DanC_Title_BackColor; + var subtitleForeColor = OpenTaiko.Skin.Game_DanC_SubTitle_ForeColor; + var subtitleBackColor = OpenTaiko.Skin.Game_DanC_SubTitle_BackColor; + + for (int i = 0; i < OpenTaiko.DTX.List_DanSongs.Count; i++) { + if (!string.IsNullOrEmpty(OpenTaiko.DTX.List_DanSongs[i].Title)) { + using (var bmpSongTitle = pfDanTitle.DrawText(OpenTaiko.DTX.List_DanSongs[i].Title, titleForeColor, titleBackColor, null, 30)) { + OpenTaiko.DTX.List_DanSongs[i].TitleTex = OpenTaiko.tテクスチャの生成(bmpSongTitle, false); + OpenTaiko.DTX.List_DanSongs[i].TitleTex.vcScaleRatio.X = OpenTaiko.GetSongNameXScaling(ref OpenTaiko.DTX.List_DanSongs[i].TitleTex, OpenTaiko.Skin.Game_DanC_Title_MaxWidth); + } + } + + if (!string.IsNullOrEmpty(OpenTaiko.DTX.List_DanSongs[i].SubTitle)) { + using (var bmpSongSubTitle = pfDanSubTitle.DrawText(OpenTaiko.DTX.List_DanSongs[i].SubTitle, subtitleForeColor, subtitleBackColor, null, 30)) { + OpenTaiko.DTX.List_DanSongs[i].SubTitleTex = OpenTaiko.tテクスチャの生成(bmpSongSubTitle, false); + OpenTaiko.DTX.List_DanSongs[i].SubTitleTex.vcScaleRatio.X = OpenTaiko.GetSongNameXScaling(ref OpenTaiko.DTX.List_DanSongs[i].SubTitleTex, OpenTaiko.Skin.Game_DanC_SubTitle_MaxWidth); + } + } + + } } - - - OpenTaiko.Timer.Update(); - //CSound管理.rc演奏用タイマ.t更新(); - base.ePhaseID = CStage.EPhase.SongLoading_WaitForSoundSystemBGM; - return (int)ESongLoadingScreenReturnValue.Continue; + #endregion } - case CStage.EPhase.SongLoading_WaitForSoundSystemBGM: { - long nCurrentTime = OpenTaiko.Timer.NowTime; - if (nCurrentTime < this.nBGM再生開始時刻) - this.nBGM再生開始時刻 = nCurrentTime; - - // if ( ( nCurrentTime - this.nBGM再生開始時刻 ) > ( this.nBGMの総再生時間ms - 1000 ) ) - if ((nCurrentTime - this.nBGM再生開始時刻) >= (this.nBGMの総再生時間ms)) // #27787 2012.3.10 yyagi 1000ms == フェードイン分の時間 + base.ePhaseID = CStage.EPhase.SongLoading_WaitToLoadWAVFile; + timeBeginLoadWAV = DateTime.Now; + return (int)ESongLoadingScreenReturnValue.Continue; + } + + case CStage.EPhase.SongLoading_WaitToLoadWAVFile: { + if (this.ct待機.CurrentValue > 260) { + base.ePhaseID = CStage.EPhase.SongLoading_LoadWAVFile; + } + return (int)ESongLoadingScreenReturnValue.Continue; + } + + case CStage.EPhase.SongLoading_LoadWAVFile: { + int looptime = (OpenTaiko.ConfigIni.bEnableVSync) ? 3 : 1; // VSyncWait=ON時は1frame(1/60s)あたり3つ読むようにする + for (int i = 0; i < looptime && nWAVcount <= OpenTaiko.DTX.listWAV.Count; i++) { + if (OpenTaiko.DTX.listWAV[nWAVcount].listこのWAVを使用するチャンネル番号の集合.Count > 0) // #28674 2012.5.8 yyagi { - base.ePhaseID = CStage.EPhase.Common_FADEOUT; + OpenTaiko.DTX.tWAVの読み込み(OpenTaiko.DTX.listWAV[nWAVcount]); } - return (int)ESongLoadingScreenReturnValue.Continue; + nWAVcount++; + } + if (nWAVcount > OpenTaiko.DTX.listWAV.Count) { + TimeSpan span = (TimeSpan)(DateTime.Now - timeBeginLoadWAV); + Trace.TraceInformation("Song loading time({0,4}): {1}", OpenTaiko.DTX.listWAV.Count, span.ToString()); + timeBeginLoadWAV = DateTime.Now; + + if (OpenTaiko.ConfigIni.bDynamicBassMixerManagement) { + OpenTaiko.DTX.PlanToAddMixerChannel(); + } + + var _dtx = new CDTX[5] { OpenTaiko.DTX, OpenTaiko.DTX_2P, OpenTaiko.DTX_3P, OpenTaiko.DTX_4P, OpenTaiko.DTX_5P }; + + for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { + _dtx[i]?.tRandomizeTaikoChips(i); + _dtx[i]?.tApplyFunMods(i); + OpenTaiko.ReplayInstances[i] = new CSongReplay(_dtx[i].strファイル名の絶対パス, i); + } + + OpenTaiko.stage演奏ドラム画面.Activate(); + + span = (TimeSpan)(DateTime.Now - timeBeginLoadWAV); + + base.ePhaseID = CStage.EPhase.SongLoading_LoadBMPFile; + } + return (int)ESongLoadingScreenReturnValue.Continue; + } + + case CStage.EPhase.SongLoading_LoadBMPFile: { + TimeSpan span; + DateTime timeBeginLoadBMPAVI = DateTime.Now; + + if (OpenTaiko.ConfigIni.bEnableAVI) + OpenTaiko.DTX.tAVIの読み込み(); + span = (TimeSpan)(DateTime.Now - timeBeginLoadBMPAVI); + + span = (TimeSpan)(DateTime.Now - timeBeginLoad); + Trace.TraceInformation("総読込時間: {0}", span.ToString()); + + if (OpenTaiko.ConfigIni.FastRender) { + var fastRender = new FastRender(); + fastRender.Render(); + fastRender = null; } - case CStage.EPhase.Common_FADEOUT: - if (this.ct待機.IsUnEnded) // DTXVモード時は、フェードアウト省略 - return (int)ESongLoadingScreenReturnValue.Continue; - if (this.sd読み込み音 != null) { - this.sd読み込み音.tDispose(); + OpenTaiko.Timer.Update(); + //CSound管理.rc演奏用タイマ.t更新(); + base.ePhaseID = CStage.EPhase.SongLoading_WaitForSoundSystemBGM; + return (int)ESongLoadingScreenReturnValue.Continue; + } + + case CStage.EPhase.SongLoading_WaitForSoundSystemBGM: { + long nCurrentTime = OpenTaiko.Timer.NowTime; + if (nCurrentTime < this.nBGM再生開始時刻) + this.nBGM再生開始時刻 = nCurrentTime; + + // if ( ( nCurrentTime - this.nBGM再生開始時刻 ) > ( this.nBGMの総再生時間ms - 1000 ) ) + if ((nCurrentTime - this.nBGM再生開始時刻) >= (this.nBGMの総再生時間ms)) // #27787 2012.3.10 yyagi 1000ms == フェードイン分の時間 + { + base.ePhaseID = CStage.EPhase.Common_FADEOUT; } - return (int)ESongLoadingScreenReturnValue.LoadComplete; - } - return (int)ESongLoadingScreenReturnValue.Continue; - } - - /// - /// ESC押下時、trueを返す - /// - /// - protected bool tキー入力() { - IInputDevice keyboard = OpenTaiko.InputManager.Keyboard; - if (keyboard.KeyPressed((int)SlimDXKeys.Key.Escape)) // escape (exit) - { - return true; - } - return false; - } - - // その他 - - #region [ private ] - //----------------- - //private CActFIFOBlack actFI; - //private CActFIFOBlack actFO; - private long nBGMの総再生時間ms; - private long nBGM再生開始時刻; - private CSound sd読み込み音; - private string strSTAGEFILE; - private string str曲タイトル; - private string strサブタイトル; - private CTexture txタイトル; - private CTexture txサブタイトル; - //private CTexture txSongnamePlate; - private DateTime timeBeginLoad; - private DateTime timeBeginLoadWAV; - private int nWAVcount; - private CCounter ct待機; - private CCounter ct曲名表示; + return (int)ESongLoadingScreenReturnValue.Continue; + } - private CCachedFontRenderer pfTITLE; - private CCachedFontRenderer pfSUBTITLE; + case CStage.EPhase.Common_FADEOUT: + if (this.ct待機.IsUnEnded) // DTXVモード時は、フェードアウト省略 + return (int)ESongLoadingScreenReturnValue.Continue; - private CCachedFontRenderer pfDanTitle = null; - private CCachedFontRenderer pfDanSubTitle = null; - //----------------- - #endregion + if (this.sd読み込み音 != null) { + this.sd読み込み音.tDispose(); + } + return (int)ESongLoadingScreenReturnValue.LoadComplete; + } + return (int)ESongLoadingScreenReturnValue.Continue; } + + /// + /// ESC押下時、trueを返す + /// + /// + protected bool tキー入力() { + IInputDevice keyboard = OpenTaiko.InputManager.Keyboard; + if (keyboard.KeyPressed((int)SlimDXKeys.Key.Escape)) // escape (exit) + { + return true; + } + return false; + } + + // その他 + + #region [ private ] + //----------------- + //private CActFIFOBlack actFI; + //private CActFIFOBlack actFO; + private long nBGMの総再生時間ms; + private long nBGM再生開始時刻; + private CSound sd読み込み音; + private string strSTAGEFILE; + private string str曲タイトル; + private string strサブタイトル; + private CTexture txタイトル; + private CTexture txサブタイトル; + //private CTexture txSongnamePlate; + private DateTime timeBeginLoad; + private DateTime timeBeginLoadWAV; + private int nWAVcount; + private CCounter ct待機; + private CCounter ct曲名表示; + + private CCachedFontRenderer pfTITLE; + private CCachedFontRenderer pfSUBTITLE; + + private CCachedFontRenderer pfDanTitle = null; + private CCachedFontRenderer pfDanSubTitle = null; + //----------------- + #endregion } diff --git a/OpenTaiko/src/Stages/06.SongLoading/FastRender.cs b/OpenTaiko/src/Stages/06.SongLoading/FastRender.cs index c9d306fa..c3e0ec96 100644 --- a/OpenTaiko/src/Stages/06.SongLoading/FastRender.cs +++ b/OpenTaiko/src/Stages/06.SongLoading/FastRender.cs @@ -1,31 +1,31 @@ using FDK; -namespace OpenTaiko { - class FastRender { - public FastRender() { +namespace OpenTaiko; - } +class FastRender { + public FastRender() { - public void Render() { - /*for (int i = 0; i < 5; i++) + } + + public void Render() { + /*for (int i = 0; i < 5; i++) + { + for (int k = 0; k < TJAPlayer3.Skin.Game_Dancer_Ptn; k++) { - for (int k = 0; k < TJAPlayer3.Skin.Game_Dancer_Ptn; k++) - { - NullCheckAndRender(ref TJAPlayer3.Tx.Dancer[i][k]); - } - }*/ + NullCheckAndRender(ref TJAPlayer3.Tx.Dancer[i][k]); + } + }*/ - NullCheckAndRender(ref OpenTaiko.Tx.Effects_GoGoSplash); + NullCheckAndRender(ref OpenTaiko.Tx.Effects_GoGoSplash); - //NullCheckAndRender(ref TJAPlayer3.Tx.PuchiChara); + //NullCheckAndRender(ref TJAPlayer3.Tx.PuchiChara); - } + } - private void NullCheckAndRender(ref CTexture tx) { - if (tx == null) return; - tx.Opacity = 0; - tx.t2D描画(0, 0); - tx.Opacity = 255; - } + private void NullCheckAndRender(ref CTexture tx) { + if (tx == null) return; + tx.Opacity = 0; + tx.t2D描画(0, 0); + tx.Opacity = 255; } } diff --git a/OpenTaiko/src/Stages/07.Game/CAct演奏AVI.cs b/OpenTaiko/src/Stages/07.Game/CAct演奏AVI.cs index 733999dd..c3969165 100644 --- a/OpenTaiko/src/Stages/07.Game/CAct演奏AVI.cs +++ b/OpenTaiko/src/Stages/07.Game/CAct演奏AVI.cs @@ -1,96 +1,96 @@ using FDK; -namespace OpenTaiko { - internal class CAct演奏AVI : CActivity { - // コンストラクタ +namespace OpenTaiko; - public CAct演奏AVI() { - base.IsDeActivated = true; - } +internal class CAct演奏AVI : CActivity { + // コンストラクタ - - // メソッド - - public void Start(int nチャンネル番号, CVideoDecoder rVD) { - if (nチャンネル番号 == 0x54 && OpenTaiko.ConfigIni.bEnableAVI) { - this.rVD = rVD; - if (this.rVD != null) { - this.ratio1 = Math.Min((float)SampleFramework.GameWindowSize.Height / ((float)this.rVD.FrameSize.Height), (float)SampleFramework.GameWindowSize.Width / ((float)this.rVD.FrameSize.Height)); - - if (!rVD.bPlaying) this.rVD.Start(); - } - } - } - public void Seek(int ms) => this.rVD?.Seek(ms); - - public void Stop() => this.rVD?.Stop(); - - public void tPauseControl() => this.rVD?.PauseControl(); - - public unsafe int t進行描画(int x, int y) { - if (!base.IsDeActivated) { - if (this.rVD == null || !rVD.bDrawing) - return 0; - - this.rVD.GetNowFrame(ref this.tx描画用); - - this.tx描画用.vcScaleRatio.X = this.ratio1; - this.tx描画用.vcScaleRatio.Y = this.ratio1; - - if (OpenTaiko.ConfigIni.eClipDispType.HasFlag(EClipDispType.BackgroundOnly)) { - this.tx描画用.t2D拡大率考慮描画(CTexture.RefPnt.Center, SampleFramework.GameWindowSize.Width / 2, SampleFramework.GameWindowSize.Height / 2); - } - } - return 0; - } - - public void t窓表示() { - if (this.rVD == null || this.tx描画用 == null || !OpenTaiko.ConfigIni.eClipDispType.HasFlag(EClipDispType.WindowOnly)) - return; - - float[] fRatio = new float[] { (SampleFramework.GameWindowSize.Width / 2) - 4.0f, (SampleFramework.GameWindowSize.Height / 2) - 4.0f }; //中央下表示 - - float ratio = Math.Min((float)(fRatio[0] / this.rVD.FrameSize.Width), (float)(fRatio[1] / this.rVD.FrameSize.Height)); - this.tx描画用.vcScaleRatio.X = ratio; - this.tx描画用.vcScaleRatio.Y = ratio; - - this.tx描画用.t2D拡大率考慮描画(CTexture.RefPnt.Down, SampleFramework.GameWindowSize.Width / 2, SampleFramework.GameWindowSize.Height); - } - - // CActivity 実装 - - public override void Activate() { - base.Activate(); - } - public override void DeActivate() { - if (this.tx描画用 != null) { - this.tx描画用.Dispose(); - this.tx描画用 = null; - } - base.DeActivate(); - } - public override void CreateManagedResource() { - base.CreateManagedResource(); - } - public override void ReleaseManagedResource() { - base.ReleaseManagedResource(); - } - public override int Draw() { - throw new InvalidOperationException("t進行描画(int,int)のほうを使用してください。"); - } - - - // その他 - - #region [ private ] - //----------------- - private float ratio1; - - private CTexture tx描画用; - - public CVideoDecoder rVD; - - //----------------- - #endregion + public CAct演奏AVI() { + base.IsDeActivated = true; } + + + // メソッド + + public void Start(int nチャンネル番号, CVideoDecoder rVD) { + if (nチャンネル番号 == 0x54 && OpenTaiko.ConfigIni.bEnableAVI) { + this.rVD = rVD; + if (this.rVD != null) { + this.ratio1 = Math.Min((float)SampleFramework.GameWindowSize.Height / ((float)this.rVD.FrameSize.Height), (float)SampleFramework.GameWindowSize.Width / ((float)this.rVD.FrameSize.Height)); + + if (!rVD.bPlaying) this.rVD.Start(); + } + } + } + public void Seek(int ms) => this.rVD?.Seek(ms); + + public void Stop() => this.rVD?.Stop(); + + public void tPauseControl() => this.rVD?.PauseControl(); + + public unsafe int t進行描画(int x, int y) { + if (!base.IsDeActivated) { + if (this.rVD == null || !rVD.bDrawing) + return 0; + + this.rVD.GetNowFrame(ref this.tx描画用); + + this.tx描画用.vcScaleRatio.X = this.ratio1; + this.tx描画用.vcScaleRatio.Y = this.ratio1; + + if (OpenTaiko.ConfigIni.eClipDispType.HasFlag(EClipDispType.BackgroundOnly)) { + this.tx描画用.t2D拡大率考慮描画(CTexture.RefPnt.Center, SampleFramework.GameWindowSize.Width / 2, SampleFramework.GameWindowSize.Height / 2); + } + } + return 0; + } + + public void t窓表示() { + if (this.rVD == null || this.tx描画用 == null || !OpenTaiko.ConfigIni.eClipDispType.HasFlag(EClipDispType.WindowOnly)) + return; + + float[] fRatio = new float[] { (SampleFramework.GameWindowSize.Width / 2) - 4.0f, (SampleFramework.GameWindowSize.Height / 2) - 4.0f }; //中央下表示 + + float ratio = Math.Min((float)(fRatio[0] / this.rVD.FrameSize.Width), (float)(fRatio[1] / this.rVD.FrameSize.Height)); + this.tx描画用.vcScaleRatio.X = ratio; + this.tx描画用.vcScaleRatio.Y = ratio; + + this.tx描画用.t2D拡大率考慮描画(CTexture.RefPnt.Down, SampleFramework.GameWindowSize.Width / 2, SampleFramework.GameWindowSize.Height); + } + + // CActivity 実装 + + public override void Activate() { + base.Activate(); + } + public override void DeActivate() { + if (this.tx描画用 != null) { + this.tx描画用.Dispose(); + this.tx描画用 = null; + } + base.DeActivate(); + } + public override void CreateManagedResource() { + base.CreateManagedResource(); + } + public override void ReleaseManagedResource() { + base.ReleaseManagedResource(); + } + public override int Draw() { + throw new InvalidOperationException("t進行描画(int,int)のほうを使用してください。"); + } + + + // その他 + + #region [ private ] + //----------------- + private float ratio1; + + private CTexture tx描画用; + + public CVideoDecoder rVD; + + //----------------- + #endregion } diff --git a/OpenTaiko/src/Stages/07.Game/CAct演奏Combo共通.cs b/OpenTaiko/src/Stages/07.Game/CAct演奏Combo共通.cs index 1dec0888..84fa274a 100644 --- a/OpenTaiko/src/Stages/07.Game/CAct演奏Combo共通.cs +++ b/OpenTaiko/src/Stages/07.Game/CAct演奏Combo共通.cs @@ -1,677 +1,677 @@ using System.Drawing; using FDK; -namespace OpenTaiko { - internal class CAct演奏Combo共通 : CActivity { - // Properties +namespace OpenTaiko; - public STCOMBO n現在のコンボ数; - public struct STCOMBO { - public CAct演奏Combo共通 act; +internal class CAct演奏Combo共通 : CActivity { + // Properties - public int this[int index] { - get { - switch (index) { - case 0: - return this.P1; + public STCOMBO n現在のコンボ数; + public struct STCOMBO { + public CAct演奏Combo共通 act; - case 1: - return this.P2; - - case 2: - return this.P3; - - case 3: - return this.P4; - - case 4: - return this.P5; - } - throw new IndexOutOfRangeException(); - } - set { - switch (index) { - case 0: - this.P1 = value; - return; - - case 1: - this.P2 = value; - return; - - case 2: - this.P3 = value; - return; - - case 3: - this.P4 = value; - return; - - case 4: - this.P5 = value; - return; - } - throw new IndexOutOfRangeException(); - } - } - public int P1 { - get { - return this.p1; - } - set { - this.p1 = value; - if (this.p1 > this.最高値[0]) { - this.最高値[0] = this.p1; - } - this.act.status.P1.nCOMBO値 = this.p1; - this.act.status.P1.n最高COMBO値 = this.最高値[0]; - } - } - public int P2 { - get { - return this.p2; - } - set { - this.p2 = value; - if (this.p2 > this.最高値[1]) { - this.最高値[1] = this.p2; - } - this.act.status.P2.nCOMBO値 = this.p2; - this.act.status.P2.n最高COMBO値 = this.最高値[1]; - } - } - public int P3 { - get { - return this.p3; - } - set { - this.p3 = value; - if (this.p3 > this.最高値[2]) { - this.最高値[2] = this.p3; - } - this.act.status.P3.nCOMBO値 = this.p3; - this.act.status.P3.n最高COMBO値 = this.最高値[2]; - } - } - public int P4 { - get { - return this.p4; - } - set { - this.p4 = value; - if (this.p4 > this.最高値[3]) { - this.最高値[3] = this.p4; - } - this.act.status.P4.nCOMBO値 = this.p4; - this.act.status.P4.n最高COMBO値 = this.最高値[3]; - } - } - public int P5 { - get { - return this.p5; - } - set { - this.p5 = value; - if (this.p5 > this.最高値[4]) { - this.最高値[4] = this.p5; - } - this.act.status.P5.nCOMBO値 = this.p5; - this.act.status.P5.n最高COMBO値 = this.最高値[4]; - } - } - public int[] 最高値 { get; set; } - - private int p1; - private int p2; - private int p3; - private int p4; - private int p5; - } - - protected enum EEvent { 非表示, 数値更新, 同一数値, ミス通知 } - protected enum EMode { 非表示中, 進行表示中, 残像表示中 } - protected const int nドラムコンボのCOMBO文字の高さ = 32; - protected const int nドラムコンボのCOMBO文字の幅 = 90; - protected const int nドラムコンボの高さ = 115; - protected const int nドラムコンボの幅 = 90; - protected const int nドラムコンボの文字間隔 = -6; - protected int[] nジャンプ差分値 = new int[180]; - protected CSTATUS status; - //protected CTexture txCOMBO太鼓; - //protected CTexture txCOMBO太鼓_でかいやつ; - //protected CTexture txコンボラメ; - public CCounter[] ctコンボ加算; - public CCounter ctコンボラメ; - - protected float[,] nコンボ拡大率_座標 = new float[,]{ - {1.11f,-7}, - {1.22f,-14}, - {1.2f,-12}, - {1.15f,-9}, - {1.13f,-8}, - {1.11f,-7}, - {1.06f,-3}, - {1.04f,-2}, - {1.0f,0}, - }; - protected float[,] nコンボ拡大率_座標_100combo = new float[,]{ - {0.81f,-7}, - {0.92f,-14}, - {0.9f,-12}, - {0.85f,-9}, - {0.83f,-8}, - {0.81f,-7}, - {0.78f,-3}, - {0.74f,-2}, - {0.7f,0}, - }; - protected float[,] nコンボ拡大率_座標_1000combo = new float[,]{ - {1.11f,-7}, - {1.22f,-14}, - {1.2f,-12}, - {1.15f,-9}, - {1.13f,-8}, - {1.11f,-7}, - {1.06f,-3}, - {1.04f,-2}, - {1.0f,0}, - }; - - - private float[] ComboScale = new float[] - { - 0.000f, - 0.042f, - 0.120f, - 0.160f, - 0.180f, - 0.120f, - 0.110f, - 0.095f, - 0.086f, - 0.044f, - 0.032f, - 0.011f, - 0.000f - }; - private float[,] ComboScale_Ex = new float[,] - { - { 0.000f, 0}, - { 0.042f, 0}, - { 0.120f, 0}, - { 0.160f, 0}, - { 0.180f, 0}, - { 0.120f, 0}, - { 0.110f, 0}, - { 0.095f, 0}, - { 0.086f, 0}, - { 0.044f, 0}, - { 0.032f, 0}, - { 0.011f, 0}, - { 0.000f, 0}, - }; - // 内部クラス - - protected class CSTATUS { - public CSTAT P1 = new CSTAT(); - public CSTAT P2 = new CSTAT(); - public CSTAT P3 = new CSTAT(); - public CSTAT P4 = new CSTAT(); - public CSTAT P5 = new CSTAT(); - public CSTAT this[int index] { - get { - switch (index) { - case 0: - return this.P1; - - case 1: - return this.P2; - - case 2: - return this.P3; - - case 3: - return this.P4; - - case 4: - return this.P5; - } - throw new IndexOutOfRangeException(); - } - set { - switch (index) { - case 0: - this.P1 = value; - return; - - case 1: - this.P2 = value; - return; - - case 2: - this.P3 = value; - return; - - case 3: - this.P4 = value; - return; - - case 4: - this.P5 = value; - return; - } - throw new IndexOutOfRangeException(); - } - } - - public class CSTAT { - public CAct演奏Combo共通.EMode e現在のモード; - public int nCOMBO値; - public long nコンボが切れた時刻; - public int nジャンプインデックス値; - public int n現在表示中のCOMBO値; - public int n最高COMBO値; - public int n残像表示中のCOMBO値; - public long n前回の時刻_ジャンプ用; - } - } - - - // メソッド - - - private void showComboEffect(int cat, int i, int rightX, int y, int nPlayer) { - if (OpenTaiko.Tx.Taiko_Combo_Effect != null) { - int a = rightX - OpenTaiko.Skin.Game_Taiko_Combo_Padding[cat] * i; - float b = (OpenTaiko.Skin.Game_Taiko_Combo_Size_Ex[0] / 4) * OpenTaiko.Skin.Game_Taiko_Combo_Scale[cat]; - float c = (OpenTaiko.Skin.Game_Taiko_Combo_Size_Ex[1] / 4) * OpenTaiko.Skin.Game_Taiko_Combo_Scale[cat]; - float d = y; - - if (ctコンボラメ.CurrentValue < 13) // First - { - // まんなか - OpenTaiko.Tx.Taiko_Combo_Effect.t2D拡大率考慮下中心基準描画(a, d - c - (int)(1.05 * this.ctコンボラメ.CurrentValue) - 13); - } - if (ctコンボラメ.CurrentValue >= 8 && ctコンボラメ.CurrentValue < 23) { - // みぎ - OpenTaiko.Tx.Taiko_Combo_Effect.t2D拡大率考慮下中心基準描画(a + b, d - c - (int)(1.05 * (this.ctコンボラメ.CurrentValue - 10)) - 3); - - } - if (this.ctコンボラメ.CurrentValue >= 17 && this.ctコンボラメ.CurrentValue < 32) { - // ひだり - OpenTaiko.Tx.Taiko_Combo_Effect.t2D拡大率考慮下中心基準描画(a - b, d - c - (int)(1.05 * this.ctコンボラメ.CurrentValue - 20) - 8); - } - } - } - - protected virtual void tコンボ表示_太鼓(int nCombo値, int nジャンプインデックス, int nPlayer) { - // Combo display here - - //テスト用コンボ数 - //nCombo値 = 72; - #region [ 事前チェック。] - //----------------- - //if( CDTXMania.ConfigIni.bドラムコンボ表示 == false ) - // return; // 表示OFF。 - - if (nCombo値 == 0) - return; // コンボゼロは表示しない。 - //----------------- - #endregion - - int[] n位の数 = new int[10]; // 表示は10桁もあれば足りるだろう - - this.ctコンボラメ.TickLoop(); - this.ctコンボ加算[nPlayer].Tick(); - - #region [ nCombo値を桁数ごとに n位の数[] に格納する。(例:nCombo値=125 のとき n位の数 = { 5,2,1,0,0,0,0,0,0,0 } ) ] - //----------------- - int n = nCombo値; - int n桁数 = 0; - while ((n > 0) && (n桁数 < 10)) { - n位の数[n桁数] = n % 10; // 1の位を格納 - n = (n - (n % 10)) / 10; // 右へシフト(例: 12345 → 1234 ) - n桁数++; - } - //----------------- - #endregion - - #region [ n位の数[] を、"COMBO" → 1の位 → 10の位 … の順に、右から左へ向かって順番に表示する。] - //----------------- - const int n1桁ごとのジャンプの遅れ = 30; // 1桁につき 50 インデックス遅れる - - - //X右座標を元にして、右座標 - ( コンボの幅 * 桁数 ) でX座標を求めていく? - - int combo_text_x; - int combo_text_y; - int combo_x; - int combo_y; - int combo_ex_x; - int combo_ex_y; - int combo_ex4_x; - int combo_ex4_y; - if (OpenTaiko.ConfigIni.nPlayerCount == 5) { - combo_text_x = OpenTaiko.Skin.Game_Taiko_Combo_Text_5P[0] + (OpenTaiko.Skin.Game_UIMove_5P[0] * nPlayer); - combo_text_y = OpenTaiko.Skin.Game_Taiko_Combo_Text_5P[1] + (OpenTaiko.Skin.Game_UIMove_5P[1] * nPlayer); - - combo_x = OpenTaiko.Skin.Game_Taiko_Combo_5P[0] + (OpenTaiko.Skin.Game_UIMove_5P[0] * nPlayer); - combo_y = OpenTaiko.Skin.Game_Taiko_Combo_5P[1] + (OpenTaiko.Skin.Game_UIMove_5P[1] * nPlayer); - combo_ex_x = OpenTaiko.Skin.Game_Taiko_Combo_Ex_5P[0] + (OpenTaiko.Skin.Game_UIMove_5P[0] * nPlayer); - combo_ex_y = OpenTaiko.Skin.Game_Taiko_Combo_Ex_5P[1] + (OpenTaiko.Skin.Game_UIMove_5P[1] * nPlayer); - combo_ex4_x = OpenTaiko.Skin.Game_Taiko_Combo_Ex4_5P[0] + (OpenTaiko.Skin.Game_UIMove_5P[0] * nPlayer); - combo_ex4_y = OpenTaiko.Skin.Game_Taiko_Combo_Ex4_5P[1] + (OpenTaiko.Skin.Game_UIMove_5P[1] * nPlayer); - } else if (OpenTaiko.ConfigIni.nPlayerCount == 4 || OpenTaiko.ConfigIni.nPlayerCount == 3) { - combo_text_x = OpenTaiko.Skin.Game_Taiko_Combo_Text_4P[0] + (OpenTaiko.Skin.Game_UIMove_4P[0] * nPlayer); - combo_text_y = OpenTaiko.Skin.Game_Taiko_Combo_Text_4P[1] + (OpenTaiko.Skin.Game_UIMove_4P[1] * nPlayer); - - combo_x = OpenTaiko.Skin.Game_Taiko_Combo_4P[0] + (OpenTaiko.Skin.Game_UIMove_4P[0] * nPlayer); - combo_y = OpenTaiko.Skin.Game_Taiko_Combo_4P[1] + (OpenTaiko.Skin.Game_UIMove_4P[1] * nPlayer); - combo_ex_x = OpenTaiko.Skin.Game_Taiko_Combo_Ex_4P[0] + (OpenTaiko.Skin.Game_UIMove_4P[0] * nPlayer); - combo_ex_y = OpenTaiko.Skin.Game_Taiko_Combo_Ex_4P[1] + (OpenTaiko.Skin.Game_UIMove_4P[1] * nPlayer); - combo_ex4_x = OpenTaiko.Skin.Game_Taiko_Combo_Ex4_4P[0] + (OpenTaiko.Skin.Game_UIMove_4P[0] * nPlayer); - combo_ex4_y = OpenTaiko.Skin.Game_Taiko_Combo_Ex4_4P[1] + (OpenTaiko.Skin.Game_UIMove_4P[1] * nPlayer); - } else { - combo_text_x = OpenTaiko.Skin.Game_Taiko_Combo_Text_X[nPlayer]; - combo_text_y = OpenTaiko.Skin.Game_Taiko_Combo_Text_Y[nPlayer]; - - combo_x = OpenTaiko.Skin.Game_Taiko_Combo_X[nPlayer]; - combo_y = OpenTaiko.Skin.Game_Taiko_Combo_Y[nPlayer]; - combo_ex_x = OpenTaiko.Skin.Game_Taiko_Combo_Ex_X[nPlayer]; - combo_ex_y = OpenTaiko.Skin.Game_Taiko_Combo_Ex_Y[nPlayer]; - combo_ex4_x = OpenTaiko.Skin.Game_Taiko_Combo_Ex4_X[nPlayer]; - combo_ex4_y = OpenTaiko.Skin.Game_Taiko_Combo_Ex4_Y[nPlayer]; - } - - int nY上辺位置px = OpenTaiko.ConfigIni.bReverse.Drums ? 350 : 10; - int n数字とCOMBOを合わせた画像の全長px = ((44) * n桁数); - int x = 245 + (n数字とCOMBOを合わせた画像の全長px / 2); - //int y = 212; - //int y = CDTXMania.Skin.nComboNumberY[ nPlayer ]; - - #region[ Combo text & Combo guides ] - - if (!OpenTaiko.ConfigIni.SimpleMode) { - OpenTaiko.Tx.Taiko_Combo_Text?.t2D拡大率考慮下中心基準描画(combo_text_x, combo_text_y); - - int guide = 2; - var ccf = OpenTaiko.stage演奏ドラム画面.CChartScore[nPlayer]; - - if (ccf.nGood > 0) - guide = 1; - if (ccf.nMiss > 0 || ccf.nMine > 0) - guide = 0; - - OpenTaiko.Tx.Taiko_Combo_Guide[guide]?.t2D拡大率考慮下中心基準描画(combo_text_x, combo_text_y); - } - - #endregion - - int rightX = 0; - #region 一番右の数字の座標の決定 - if (n桁数 == 1) { - // 一桁ならそのままSkinConfigの座標を使用する。 - rightX = combo_x; - } else if (n桁数 == 2) { - // 二桁ならSkinConfigの座標+パディング/2を使用する - rightX = combo_x + OpenTaiko.Skin.Game_Taiko_Combo_Padding[0] / 2; - } else if (n桁数 == 3) { - // 三桁ならSkinConfigの座標+パディングを使用する - rightX = combo_ex_x + OpenTaiko.Skin.Game_Taiko_Combo_Padding[1]; - } else if (n桁数 == 4) { - // 四桁ならSkinconfigの座標+パディング/2 + パディングを使用する - rightX = combo_ex4_x + OpenTaiko.Skin.Game_Taiko_Combo_Padding[2] / 2 + OpenTaiko.Skin.Game_Taiko_Combo_Padding[2]; - } else { - // 五桁以上の場合 - int rightDigit = 0; - switch (n桁数 % 2) { + public int this[int index] { + get { + switch (index) { case 0: - // 2で割り切れる - // パディング/2を足す必要がある - // 右に表示される桁数を求め、-1する - rightDigit = n桁数 / 2 - 1; - rightX = combo_ex4_x + OpenTaiko.Skin.Game_Taiko_Combo_Padding[2] / 2 + OpenTaiko.Skin.Game_Taiko_Combo_Padding[2] * rightDigit; - break; + return this.P1; + case 1: - // 2で割るとあまりが出る - // そのままパディングを足していく - // 右に表示される桁数を求める(中央除く -1) - rightDigit = (n桁数 - 1) / 2; - rightX = combo_ex4_x + OpenTaiko.Skin.Game_Taiko_Combo_Padding[2] * rightDigit; - break; - default: - break; + return this.P2; + + case 2: + return this.P3; + + case 3: + return this.P4; + + case 4: + return this.P5; } + throw new IndexOutOfRangeException(); } - #endregion + set { + switch (index) { + case 0: + this.P1 = value; + return; + + case 1: + this.P2 = value; + return; + + case 2: + this.P3 = value; + return; + + case 3: + this.P4 = value; + return; + + case 4: + this.P5 = value; + return; + } + throw new IndexOutOfRangeException(); + } + } + public int P1 { + get { + return this.p1; + } + set { + this.p1 = value; + if (this.p1 > this.最高値[0]) { + this.最高値[0] = this.p1; + } + this.act.status.P1.nCOMBO値 = this.p1; + this.act.status.P1.n最高COMBO値 = this.最高値[0]; + } + } + public int P2 { + get { + return this.p2; + } + set { + this.p2 = value; + if (this.p2 > this.最高値[1]) { + this.最高値[1] = this.p2; + } + this.act.status.P2.nCOMBO値 = this.p2; + this.act.status.P2.n最高COMBO値 = this.最高値[1]; + } + } + public int P3 { + get { + return this.p3; + } + set { + this.p3 = value; + if (this.p3 > this.最高値[2]) { + this.最高値[2] = this.p3; + } + this.act.status.P3.nCOMBO値 = this.p3; + this.act.status.P3.n最高COMBO値 = this.最高値[2]; + } + } + public int P4 { + get { + return this.p4; + } + set { + this.p4 = value; + if (this.p4 > this.最高値[3]) { + this.最高値[3] = this.p4; + } + this.act.status.P4.nCOMBO値 = this.p4; + this.act.status.P4.n最高COMBO値 = this.最高値[3]; + } + } + public int P5 { + get { + return this.p5; + } + set { + this.p5 = value; + if (this.p5 > this.最高値[4]) { + this.最高値[4] = this.p5; + } + this.act.status.P5.nCOMBO値 = this.p5; + this.act.status.P5.n最高COMBO値 = this.最高値[4]; + } + } + public int[] 最高値 { get; set; } + + private int p1; + private int p2; + private int p3; + private int p4; + private int p5; + } + + protected enum EEvent { 非表示, 数値更新, 同一数値, ミス通知 } + protected enum EMode { 非表示中, 進行表示中, 残像表示中 } + protected const int nドラムコンボのCOMBO文字の高さ = 32; + protected const int nドラムコンボのCOMBO文字の幅 = 90; + protected const int nドラムコンボの高さ = 115; + protected const int nドラムコンボの幅 = 90; + protected const int nドラムコンボの文字間隔 = -6; + protected int[] nジャンプ差分値 = new int[180]; + protected CSTATUS status; + //protected CTexture txCOMBO太鼓; + //protected CTexture txCOMBO太鼓_でかいやつ; + //protected CTexture txコンボラメ; + public CCounter[] ctコンボ加算; + public CCounter ctコンボラメ; + + protected float[,] nコンボ拡大率_座標 = new float[,]{ + {1.11f,-7}, + {1.22f,-14}, + {1.2f,-12}, + {1.15f,-9}, + {1.13f,-8}, + {1.11f,-7}, + {1.06f,-3}, + {1.04f,-2}, + {1.0f,0}, + }; + protected float[,] nコンボ拡大率_座標_100combo = new float[,]{ + {0.81f,-7}, + {0.92f,-14}, + {0.9f,-12}, + {0.85f,-9}, + {0.83f,-8}, + {0.81f,-7}, + {0.78f,-3}, + {0.74f,-2}, + {0.7f,0}, + }; + protected float[,] nコンボ拡大率_座標_1000combo = new float[,]{ + {1.11f,-7}, + {1.22f,-14}, + {1.2f,-12}, + {1.15f,-9}, + {1.13f,-8}, + {1.11f,-7}, + {1.06f,-3}, + {1.04f,-2}, + {1.0f,0}, + }; - for (int i = 0; i < n桁数; i++) { + private float[] ComboScale = new float[] + { + 0.000f, + 0.042f, + 0.120f, + 0.160f, + 0.180f, + 0.120f, + 0.110f, + 0.095f, + 0.086f, + 0.044f, + 0.032f, + 0.011f, + 0.000f + }; + private float[,] ComboScale_Ex = new float[,] + { + { 0.000f, 0}, + { 0.042f, 0}, + { 0.120f, 0}, + { 0.160f, 0}, + { 0.180f, 0}, + { 0.120f, 0}, + { 0.110f, 0}, + { 0.095f, 0}, + { 0.086f, 0}, + { 0.044f, 0}, + { 0.032f, 0}, + { 0.011f, 0}, + { 0.000f, 0}, + }; + // 内部クラス - OpenTaiko.Tx.Taiko_Combo[0].Opacity = 255; - OpenTaiko.Tx.Taiko_Combo[1].Opacity = 255; + protected class CSTATUS { + public CSTAT P1 = new CSTAT(); + public CSTAT P2 = new CSTAT(); + public CSTAT P3 = new CSTAT(); + public CSTAT P4 = new CSTAT(); + public CSTAT P5 = new CSTAT(); + public CSTAT this[int index] { + get { + switch (index) { + case 0: + return this.P1; - if (n桁数 <= 1) { + case 1: + return this.P2; + + case 2: + return this.P3; + + case 3: + return this.P4; + + case 4: + return this.P5; + } + throw new IndexOutOfRangeException(); + } + set { + switch (index) { + case 0: + this.P1 = value; + return; + + case 1: + this.P2 = value; + return; + + case 2: + this.P3 = value; + return; + + case 3: + this.P4 = value; + return; + + case 4: + this.P5 = value; + return; + } + throw new IndexOutOfRangeException(); + } + } + + public class CSTAT { + public CAct演奏Combo共通.EMode e現在のモード; + public int nCOMBO値; + public long nコンボが切れた時刻; + public int nジャンプインデックス値; + public int n現在表示中のCOMBO値; + public int n最高COMBO値; + public int n残像表示中のCOMBO値; + public long n前回の時刻_ジャンプ用; + } + } + + + // メソッド + + + private void showComboEffect(int cat, int i, int rightX, int y, int nPlayer) { + if (OpenTaiko.Tx.Taiko_Combo_Effect != null) { + int a = rightX - OpenTaiko.Skin.Game_Taiko_Combo_Padding[cat] * i; + float b = (OpenTaiko.Skin.Game_Taiko_Combo_Size_Ex[0] / 4) * OpenTaiko.Skin.Game_Taiko_Combo_Scale[cat]; + float c = (OpenTaiko.Skin.Game_Taiko_Combo_Size_Ex[1] / 4) * OpenTaiko.Skin.Game_Taiko_Combo_Scale[cat]; + float d = y; + + if (ctコンボラメ.CurrentValue < 13) // First + { + // まんなか + OpenTaiko.Tx.Taiko_Combo_Effect.t2D拡大率考慮下中心基準描画(a, d - c - (int)(1.05 * this.ctコンボラメ.CurrentValue) - 13); + } + if (ctコンボラメ.CurrentValue >= 8 && ctコンボラメ.CurrentValue < 23) { + // みぎ + OpenTaiko.Tx.Taiko_Combo_Effect.t2D拡大率考慮下中心基準描画(a + b, d - c - (int)(1.05 * (this.ctコンボラメ.CurrentValue - 10)) - 3); + + } + if (this.ctコンボラメ.CurrentValue >= 17 && this.ctコンボラメ.CurrentValue < 32) { + // ひだり + OpenTaiko.Tx.Taiko_Combo_Effect.t2D拡大率考慮下中心基準描画(a - b, d - c - (int)(1.05 * this.ctコンボラメ.CurrentValue - 20) - 8); + } + } + } + + protected virtual void tコンボ表示_太鼓(int nCombo値, int nジャンプインデックス, int nPlayer) { + // Combo display here + + //テスト用コンボ数 + //nCombo値 = 72; + #region [ 事前チェック。] + //----------------- + //if( CDTXMania.ConfigIni.bドラムコンボ表示 == false ) + // return; // 表示OFF。 + + if (nCombo値 == 0) + return; // コンボゼロは表示しない。 + //----------------- + #endregion + + int[] n位の数 = new int[10]; // 表示は10桁もあれば足りるだろう + + this.ctコンボラメ.TickLoop(); + this.ctコンボ加算[nPlayer].Tick(); + + #region [ nCombo値を桁数ごとに n位の数[] に格納する。(例:nCombo値=125 のとき n位の数 = { 5,2,1,0,0,0,0,0,0,0 } ) ] + //----------------- + int n = nCombo値; + int n桁数 = 0; + while ((n > 0) && (n桁数 < 10)) { + n位の数[n桁数] = n % 10; // 1の位を格納 + n = (n - (n % 10)) / 10; // 右へシフト(例: 12345 → 1234 ) + n桁数++; + } + //----------------- + #endregion + + #region [ n位の数[] を、"COMBO" → 1の位 → 10の位 … の順に、右から左へ向かって順番に表示する。] + //----------------- + const int n1桁ごとのジャンプの遅れ = 30; // 1桁につき 50 インデックス遅れる + + + //X右座標を元にして、右座標 - ( コンボの幅 * 桁数 ) でX座標を求めていく? + + int combo_text_x; + int combo_text_y; + int combo_x; + int combo_y; + int combo_ex_x; + int combo_ex_y; + int combo_ex4_x; + int combo_ex4_y; + if (OpenTaiko.ConfigIni.nPlayerCount == 5) { + combo_text_x = OpenTaiko.Skin.Game_Taiko_Combo_Text_5P[0] + (OpenTaiko.Skin.Game_UIMove_5P[0] * nPlayer); + combo_text_y = OpenTaiko.Skin.Game_Taiko_Combo_Text_5P[1] + (OpenTaiko.Skin.Game_UIMove_5P[1] * nPlayer); + + combo_x = OpenTaiko.Skin.Game_Taiko_Combo_5P[0] + (OpenTaiko.Skin.Game_UIMove_5P[0] * nPlayer); + combo_y = OpenTaiko.Skin.Game_Taiko_Combo_5P[1] + (OpenTaiko.Skin.Game_UIMove_5P[1] * nPlayer); + combo_ex_x = OpenTaiko.Skin.Game_Taiko_Combo_Ex_5P[0] + (OpenTaiko.Skin.Game_UIMove_5P[0] * nPlayer); + combo_ex_y = OpenTaiko.Skin.Game_Taiko_Combo_Ex_5P[1] + (OpenTaiko.Skin.Game_UIMove_5P[1] * nPlayer); + combo_ex4_x = OpenTaiko.Skin.Game_Taiko_Combo_Ex4_5P[0] + (OpenTaiko.Skin.Game_UIMove_5P[0] * nPlayer); + combo_ex4_y = OpenTaiko.Skin.Game_Taiko_Combo_Ex4_5P[1] + (OpenTaiko.Skin.Game_UIMove_5P[1] * nPlayer); + } else if (OpenTaiko.ConfigIni.nPlayerCount == 4 || OpenTaiko.ConfigIni.nPlayerCount == 3) { + combo_text_x = OpenTaiko.Skin.Game_Taiko_Combo_Text_4P[0] + (OpenTaiko.Skin.Game_UIMove_4P[0] * nPlayer); + combo_text_y = OpenTaiko.Skin.Game_Taiko_Combo_Text_4P[1] + (OpenTaiko.Skin.Game_UIMove_4P[1] * nPlayer); + + combo_x = OpenTaiko.Skin.Game_Taiko_Combo_4P[0] + (OpenTaiko.Skin.Game_UIMove_4P[0] * nPlayer); + combo_y = OpenTaiko.Skin.Game_Taiko_Combo_4P[1] + (OpenTaiko.Skin.Game_UIMove_4P[1] * nPlayer); + combo_ex_x = OpenTaiko.Skin.Game_Taiko_Combo_Ex_4P[0] + (OpenTaiko.Skin.Game_UIMove_4P[0] * nPlayer); + combo_ex_y = OpenTaiko.Skin.Game_Taiko_Combo_Ex_4P[1] + (OpenTaiko.Skin.Game_UIMove_4P[1] * nPlayer); + combo_ex4_x = OpenTaiko.Skin.Game_Taiko_Combo_Ex4_4P[0] + (OpenTaiko.Skin.Game_UIMove_4P[0] * nPlayer); + combo_ex4_y = OpenTaiko.Skin.Game_Taiko_Combo_Ex4_4P[1] + (OpenTaiko.Skin.Game_UIMove_4P[1] * nPlayer); + } else { + combo_text_x = OpenTaiko.Skin.Game_Taiko_Combo_Text_X[nPlayer]; + combo_text_y = OpenTaiko.Skin.Game_Taiko_Combo_Text_Y[nPlayer]; + + combo_x = OpenTaiko.Skin.Game_Taiko_Combo_X[nPlayer]; + combo_y = OpenTaiko.Skin.Game_Taiko_Combo_Y[nPlayer]; + combo_ex_x = OpenTaiko.Skin.Game_Taiko_Combo_Ex_X[nPlayer]; + combo_ex_y = OpenTaiko.Skin.Game_Taiko_Combo_Ex_Y[nPlayer]; + combo_ex4_x = OpenTaiko.Skin.Game_Taiko_Combo_Ex4_X[nPlayer]; + combo_ex4_y = OpenTaiko.Skin.Game_Taiko_Combo_Ex4_Y[nPlayer]; + } + + int nY上辺位置px = OpenTaiko.ConfigIni.bReverse.Drums ? 350 : 10; + int n数字とCOMBOを合わせた画像の全長px = ((44) * n桁数); + int x = 245 + (n数字とCOMBOを合わせた画像の全長px / 2); + //int y = 212; + //int y = CDTXMania.Skin.nComboNumberY[ nPlayer ]; + + #region[ Combo text & Combo guides ] + + if (!OpenTaiko.ConfigIni.SimpleMode) { + OpenTaiko.Tx.Taiko_Combo_Text?.t2D拡大率考慮下中心基準描画(combo_text_x, combo_text_y); + + int guide = 2; + var ccf = OpenTaiko.stage演奏ドラム画面.CChartScore[nPlayer]; + + if (ccf.nGood > 0) + guide = 1; + if (ccf.nMiss > 0 || ccf.nMine > 0) + guide = 0; + + OpenTaiko.Tx.Taiko_Combo_Guide[guide]?.t2D拡大率考慮下中心基準描画(combo_text_x, combo_text_y); + } + + #endregion + + int rightX = 0; + #region 一番右の数字の座標の決定 + if (n桁数 == 1) { + // 一桁ならそのままSkinConfigの座標を使用する。 + rightX = combo_x; + } else if (n桁数 == 2) { + // 二桁ならSkinConfigの座標+パディング/2を使用する + rightX = combo_x + OpenTaiko.Skin.Game_Taiko_Combo_Padding[0] / 2; + } else if (n桁数 == 3) { + // 三桁ならSkinConfigの座標+パディングを使用する + rightX = combo_ex_x + OpenTaiko.Skin.Game_Taiko_Combo_Padding[1]; + } else if (n桁数 == 4) { + // 四桁ならSkinconfigの座標+パディング/2 + パディングを使用する + rightX = combo_ex4_x + OpenTaiko.Skin.Game_Taiko_Combo_Padding[2] / 2 + OpenTaiko.Skin.Game_Taiko_Combo_Padding[2]; + } else { + // 五桁以上の場合 + int rightDigit = 0; + switch (n桁数 % 2) { + case 0: + // 2で割り切れる + // パディング/2を足す必要がある + // 右に表示される桁数を求め、-1する + rightDigit = n桁数 / 2 - 1; + rightX = combo_ex4_x + OpenTaiko.Skin.Game_Taiko_Combo_Padding[2] / 2 + OpenTaiko.Skin.Game_Taiko_Combo_Padding[2] * rightDigit; + break; + case 1: + // 2で割るとあまりが出る + // そのままパディングを足していく + // 右に表示される桁数を求める(中央除く -1) + rightDigit = (n桁数 - 1) / 2; + rightX = combo_ex4_x + OpenTaiko.Skin.Game_Taiko_Combo_Padding[2] * rightDigit; + break; + default: + break; + } + } + #endregion + + + for (int i = 0; i < n桁数; i++) { + + OpenTaiko.Tx.Taiko_Combo[0].Opacity = 255; + OpenTaiko.Tx.Taiko_Combo[1].Opacity = 255; + + if (n桁数 <= 1) { + if (OpenTaiko.Tx.Taiko_Combo[0] != null) { + var yScalling = OpenTaiko.ConfigIni.SimpleMode ? 0 : ComboScale[this.ctコンボ加算[nPlayer].CurrentValue]; + OpenTaiko.Tx.Taiko_Combo[0].vcScaleRatio.Y = OpenTaiko.Skin.Game_Taiko_Combo_Scale[0] + yScalling; + OpenTaiko.Tx.Taiko_Combo[0].vcScaleRatio.X = OpenTaiko.Skin.Game_Taiko_Combo_Scale[0]; + OpenTaiko.Tx.Taiko_Combo[0].t2D拡大率考慮下中心基準描画(rightX, combo_y, new Rectangle(n位の数[i] * OpenTaiko.Skin.Game_Taiko_Combo_Size[0], 0, OpenTaiko.Skin.Game_Taiko_Combo_Size[0], OpenTaiko.Skin.Game_Taiko_Combo_Size[1])); + } + } else if (n桁数 <= 2) { + //int[] arComboX = { CDTXMania.Skin.Game_Taiko_Combo_X[nPlayer] + CDTXMania.Skin.Game_Taiko_Combo_Padding[0], CDTXMania.Skin.Game_Taiko_Combo_X[nPlayer] - CDTXMania.Skin.Game_Taiko_Combo_Padding[0] }; + if (nCombo値 < 50) { if (OpenTaiko.Tx.Taiko_Combo[0] != null) { var yScalling = OpenTaiko.ConfigIni.SimpleMode ? 0 : ComboScale[this.ctコンボ加算[nPlayer].CurrentValue]; OpenTaiko.Tx.Taiko_Combo[0].vcScaleRatio.Y = OpenTaiko.Skin.Game_Taiko_Combo_Scale[0] + yScalling; OpenTaiko.Tx.Taiko_Combo[0].vcScaleRatio.X = OpenTaiko.Skin.Game_Taiko_Combo_Scale[0]; - OpenTaiko.Tx.Taiko_Combo[0].t2D拡大率考慮下中心基準描画(rightX, combo_y, new Rectangle(n位の数[i] * OpenTaiko.Skin.Game_Taiko_Combo_Size[0], 0, OpenTaiko.Skin.Game_Taiko_Combo_Size[0], OpenTaiko.Skin.Game_Taiko_Combo_Size[1])); + OpenTaiko.Tx.Taiko_Combo[0].t2D拡大率考慮下中心基準描画(rightX - OpenTaiko.Skin.Game_Taiko_Combo_Padding[0] * i, combo_y, new Rectangle(n位の数[i] * OpenTaiko.Skin.Game_Taiko_Combo_Size[0], 0, OpenTaiko.Skin.Game_Taiko_Combo_Size[0], OpenTaiko.Skin.Game_Taiko_Combo_Size[1])); } - } else if (n桁数 <= 2) { - //int[] arComboX = { CDTXMania.Skin.Game_Taiko_Combo_X[nPlayer] + CDTXMania.Skin.Game_Taiko_Combo_Padding[0], CDTXMania.Skin.Game_Taiko_Combo_X[nPlayer] - CDTXMania.Skin.Game_Taiko_Combo_Padding[0] }; - if (nCombo値 < 50) { - if (OpenTaiko.Tx.Taiko_Combo[0] != null) { - var yScalling = OpenTaiko.ConfigIni.SimpleMode ? 0 : ComboScale[this.ctコンボ加算[nPlayer].CurrentValue]; - OpenTaiko.Tx.Taiko_Combo[0].vcScaleRatio.Y = OpenTaiko.Skin.Game_Taiko_Combo_Scale[0] + yScalling; - OpenTaiko.Tx.Taiko_Combo[0].vcScaleRatio.X = OpenTaiko.Skin.Game_Taiko_Combo_Scale[0]; - OpenTaiko.Tx.Taiko_Combo[0].t2D拡大率考慮下中心基準描画(rightX - OpenTaiko.Skin.Game_Taiko_Combo_Padding[0] * i, combo_y, new Rectangle(n位の数[i] * OpenTaiko.Skin.Game_Taiko_Combo_Size[0], 0, OpenTaiko.Skin.Game_Taiko_Combo_Size[0], OpenTaiko.Skin.Game_Taiko_Combo_Size[1])); - } - } else { - if (OpenTaiko.Tx.Taiko_Combo[2] != null) { - var yScalling = OpenTaiko.ConfigIni.SimpleMode ? 0 : ComboScale[this.ctコンボ加算[nPlayer].CurrentValue]; - OpenTaiko.Tx.Taiko_Combo[2].vcScaleRatio.Y = OpenTaiko.Skin.Game_Taiko_Combo_Scale[0] + yScalling; - OpenTaiko.Tx.Taiko_Combo[2].vcScaleRatio.X = OpenTaiko.Skin.Game_Taiko_Combo_Scale[0]; - OpenTaiko.Tx.Taiko_Combo[2].t2D拡大率考慮下中心基準描画(rightX - OpenTaiko.Skin.Game_Taiko_Combo_Padding[0] * i, combo_y, new Rectangle(n位の数[i] * OpenTaiko.Skin.Game_Taiko_Combo_Size[0], 0, OpenTaiko.Skin.Game_Taiko_Combo_Size[0], OpenTaiko.Skin.Game_Taiko_Combo_Size[1])); - } - - if (!OpenTaiko.ConfigIni.SimpleMode) showComboEffect(0, i, rightX, combo_ex_y, nPlayer); - } - } else if (n桁数 == 3) { - if (nCombo値 >= 300 && OpenTaiko.Tx.Taiko_Combo[3] != null) { - var yScalling = OpenTaiko.ConfigIni.SimpleMode ? 0 : ComboScale_Ex[this.ctコンボ加算[nPlayer].CurrentValue, 0]; - OpenTaiko.Tx.Taiko_Combo[3].vcScaleRatio.Y = OpenTaiko.Skin.Game_Taiko_Combo_Scale[1] + yScalling; - OpenTaiko.Tx.Taiko_Combo[3].vcScaleRatio.X = OpenTaiko.Skin.Game_Taiko_Combo_Scale[1]; - var yJumping = OpenTaiko.Skin.Game_Taiko_Combo_Ex_IsJumping ? (int)ComboScale_Ex[this.ctコンボ加算[nPlayer].CurrentValue, 1] : 0; - OpenTaiko.Tx.Taiko_Combo[3].t2D拡大率考慮下中心基準描画(rightX - OpenTaiko.Skin.Game_Taiko_Combo_Padding[1] * i, combo_ex_y + yJumping, new Rectangle(n位の数[i] * OpenTaiko.Skin.Game_Taiko_Combo_Size_Ex[0], 0, OpenTaiko.Skin.Game_Taiko_Combo_Size_Ex[0], OpenTaiko.Skin.Game_Taiko_Combo_Size_Ex[1])); - } else if (OpenTaiko.Tx.Taiko_Combo[1] != null) { - var yScalling = OpenTaiko.ConfigIni.SimpleMode ? 0 : ComboScale_Ex[this.ctコンボ加算[nPlayer].CurrentValue, 0]; - OpenTaiko.Tx.Taiko_Combo[1].vcScaleRatio.Y = OpenTaiko.Skin.Game_Taiko_Combo_Scale[1] + yScalling; - OpenTaiko.Tx.Taiko_Combo[1].vcScaleRatio.X = OpenTaiko.Skin.Game_Taiko_Combo_Scale[1]; - var yJumping = OpenTaiko.Skin.Game_Taiko_Combo_Ex_IsJumping ? (int)ComboScale_Ex[this.ctコンボ加算[nPlayer].CurrentValue, 1] : 0; - OpenTaiko.Tx.Taiko_Combo[1].t2D拡大率考慮下中心基準描画(rightX - OpenTaiko.Skin.Game_Taiko_Combo_Padding[1] * i, combo_ex_y + yJumping, new Rectangle(n位の数[i] * OpenTaiko.Skin.Game_Taiko_Combo_Size_Ex[0], 0, OpenTaiko.Skin.Game_Taiko_Combo_Size_Ex[0], OpenTaiko.Skin.Game_Taiko_Combo_Size_Ex[1])); - } - - if (!OpenTaiko.ConfigIni.SimpleMode) showComboEffect(1, i, rightX, combo_ex_y, nPlayer); } else { - if (nCombo値 >= 300 && OpenTaiko.Tx.Taiko_Combo[3] != null) { - var yScalling = OpenTaiko.ConfigIni.SimpleMode ? 0 : ComboScale_Ex[this.ctコンボ加算[nPlayer].CurrentValue, 0]; - OpenTaiko.Tx.Taiko_Combo[3].vcScaleRatio.Y = 1.0f + yScalling; - OpenTaiko.Tx.Taiko_Combo[3].vcScaleRatio.X = OpenTaiko.Skin.Game_Taiko_Combo_Scale[2]; - var yJumping = OpenTaiko.Skin.Game_Taiko_Combo_Ex_IsJumping ? (int)ComboScale_Ex[this.ctコンボ加算[nPlayer].CurrentValue, 1] : 0; - OpenTaiko.Tx.Taiko_Combo[3].t2D拡大率考慮下中心基準描画(rightX - OpenTaiko.Skin.Game_Taiko_Combo_Padding[2] * i, combo_ex_y + yJumping, new Rectangle(n位の数[i] * OpenTaiko.Skin.Game_Taiko_Combo_Size_Ex[0], 0, OpenTaiko.Skin.Game_Taiko_Combo_Size_Ex[0], OpenTaiko.Skin.Game_Taiko_Combo_Size_Ex[1])); - } else if (OpenTaiko.Tx.Taiko_Combo[1] != null) { - var yScalling = OpenTaiko.ConfigIni.SimpleMode ? 0 : ComboScale_Ex[this.ctコンボ加算[nPlayer].CurrentValue, 0]; - OpenTaiko.Tx.Taiko_Combo[1].vcScaleRatio.Y = 1.0f + yScalling; - OpenTaiko.Tx.Taiko_Combo[1].vcScaleRatio.X = OpenTaiko.Skin.Game_Taiko_Combo_Scale[2]; - var yJumping = OpenTaiko.Skin.Game_Taiko_Combo_Ex_IsJumping ? (int)ComboScale_Ex[this.ctコンボ加算[nPlayer].CurrentValue, 1] : 0; - OpenTaiko.Tx.Taiko_Combo[1].t2D拡大率考慮下中心基準描画(rightX - OpenTaiko.Skin.Game_Taiko_Combo_Padding[2] * i, combo_ex_y + yJumping, new Rectangle(n位の数[i] * OpenTaiko.Skin.Game_Taiko_Combo_Size_Ex[0], 0, OpenTaiko.Skin.Game_Taiko_Combo_Size_Ex[0], OpenTaiko.Skin.Game_Taiko_Combo_Size_Ex[1])); + if (OpenTaiko.Tx.Taiko_Combo[2] != null) { + var yScalling = OpenTaiko.ConfigIni.SimpleMode ? 0 : ComboScale[this.ctコンボ加算[nPlayer].CurrentValue]; + OpenTaiko.Tx.Taiko_Combo[2].vcScaleRatio.Y = OpenTaiko.Skin.Game_Taiko_Combo_Scale[0] + yScalling; + OpenTaiko.Tx.Taiko_Combo[2].vcScaleRatio.X = OpenTaiko.Skin.Game_Taiko_Combo_Scale[0]; + OpenTaiko.Tx.Taiko_Combo[2].t2D拡大率考慮下中心基準描画(rightX - OpenTaiko.Skin.Game_Taiko_Combo_Padding[0] * i, combo_y, new Rectangle(n位の数[i] * OpenTaiko.Skin.Game_Taiko_Combo_Size[0], 0, OpenTaiko.Skin.Game_Taiko_Combo_Size[0], OpenTaiko.Skin.Game_Taiko_Combo_Size[1])); } - if (!OpenTaiko.ConfigIni.SimpleMode) showComboEffect(2, i, rightX, combo_ex_y, nPlayer); - + if (!OpenTaiko.ConfigIni.SimpleMode) showComboEffect(0, i, rightX, combo_ex_y, nPlayer); + } + } else if (n桁数 == 3) { + if (nCombo値 >= 300 && OpenTaiko.Tx.Taiko_Combo[3] != null) { + var yScalling = OpenTaiko.ConfigIni.SimpleMode ? 0 : ComboScale_Ex[this.ctコンボ加算[nPlayer].CurrentValue, 0]; + OpenTaiko.Tx.Taiko_Combo[3].vcScaleRatio.Y = OpenTaiko.Skin.Game_Taiko_Combo_Scale[1] + yScalling; + OpenTaiko.Tx.Taiko_Combo[3].vcScaleRatio.X = OpenTaiko.Skin.Game_Taiko_Combo_Scale[1]; + var yJumping = OpenTaiko.Skin.Game_Taiko_Combo_Ex_IsJumping ? (int)ComboScale_Ex[this.ctコンボ加算[nPlayer].CurrentValue, 1] : 0; + OpenTaiko.Tx.Taiko_Combo[3].t2D拡大率考慮下中心基準描画(rightX - OpenTaiko.Skin.Game_Taiko_Combo_Padding[1] * i, combo_ex_y + yJumping, new Rectangle(n位の数[i] * OpenTaiko.Skin.Game_Taiko_Combo_Size_Ex[0], 0, OpenTaiko.Skin.Game_Taiko_Combo_Size_Ex[0], OpenTaiko.Skin.Game_Taiko_Combo_Size_Ex[1])); + } else if (OpenTaiko.Tx.Taiko_Combo[1] != null) { + var yScalling = OpenTaiko.ConfigIni.SimpleMode ? 0 : ComboScale_Ex[this.ctコンボ加算[nPlayer].CurrentValue, 0]; + OpenTaiko.Tx.Taiko_Combo[1].vcScaleRatio.Y = OpenTaiko.Skin.Game_Taiko_Combo_Scale[1] + yScalling; + OpenTaiko.Tx.Taiko_Combo[1].vcScaleRatio.X = OpenTaiko.Skin.Game_Taiko_Combo_Scale[1]; + var yJumping = OpenTaiko.Skin.Game_Taiko_Combo_Ex_IsJumping ? (int)ComboScale_Ex[this.ctコンボ加算[nPlayer].CurrentValue, 1] : 0; + OpenTaiko.Tx.Taiko_Combo[1].t2D拡大率考慮下中心基準描画(rightX - OpenTaiko.Skin.Game_Taiko_Combo_Padding[1] * i, combo_ex_y + yJumping, new Rectangle(n位の数[i] * OpenTaiko.Skin.Game_Taiko_Combo_Size_Ex[0], 0, OpenTaiko.Skin.Game_Taiko_Combo_Size_Ex[0], OpenTaiko.Skin.Game_Taiko_Combo_Size_Ex[1])); } - } + if (!OpenTaiko.ConfigIni.SimpleMode) showComboEffect(1, i, rightX, combo_ex_y, nPlayer); + } else { + if (nCombo値 >= 300 && OpenTaiko.Tx.Taiko_Combo[3] != null) { + var yScalling = OpenTaiko.ConfigIni.SimpleMode ? 0 : ComboScale_Ex[this.ctコンボ加算[nPlayer].CurrentValue, 0]; + OpenTaiko.Tx.Taiko_Combo[3].vcScaleRatio.Y = 1.0f + yScalling; + OpenTaiko.Tx.Taiko_Combo[3].vcScaleRatio.X = OpenTaiko.Skin.Game_Taiko_Combo_Scale[2]; + var yJumping = OpenTaiko.Skin.Game_Taiko_Combo_Ex_IsJumping ? (int)ComboScale_Ex[this.ctコンボ加算[nPlayer].CurrentValue, 1] : 0; + OpenTaiko.Tx.Taiko_Combo[3].t2D拡大率考慮下中心基準描画(rightX - OpenTaiko.Skin.Game_Taiko_Combo_Padding[2] * i, combo_ex_y + yJumping, new Rectangle(n位の数[i] * OpenTaiko.Skin.Game_Taiko_Combo_Size_Ex[0], 0, OpenTaiko.Skin.Game_Taiko_Combo_Size_Ex[0], OpenTaiko.Skin.Game_Taiko_Combo_Size_Ex[1])); + } else if (OpenTaiko.Tx.Taiko_Combo[1] != null) { + var yScalling = OpenTaiko.ConfigIni.SimpleMode ? 0 : ComboScale_Ex[this.ctコンボ加算[nPlayer].CurrentValue, 0]; + OpenTaiko.Tx.Taiko_Combo[1].vcScaleRatio.Y = 1.0f + yScalling; + OpenTaiko.Tx.Taiko_Combo[1].vcScaleRatio.X = OpenTaiko.Skin.Game_Taiko_Combo_Scale[2]; + var yJumping = OpenTaiko.Skin.Game_Taiko_Combo_Ex_IsJumping ? (int)ComboScale_Ex[this.ctコンボ加算[nPlayer].CurrentValue, 1] : 0; + OpenTaiko.Tx.Taiko_Combo[1].t2D拡大率考慮下中心基準描画(rightX - OpenTaiko.Skin.Game_Taiko_Combo_Padding[2] * i, combo_ex_y + yJumping, new Rectangle(n位の数[i] * OpenTaiko.Skin.Game_Taiko_Combo_Size_Ex[0], 0, OpenTaiko.Skin.Game_Taiko_Combo_Size_Ex[0], OpenTaiko.Skin.Game_Taiko_Combo_Size_Ex[1])); + } + + if (!OpenTaiko.ConfigIni.SimpleMode) showComboEffect(2, i, rightX, combo_ex_y, nPlayer); + + } + } + + //----------------- + #endregion + } + + // CActivity 実装 + + public override void Activate() { + this.n現在のコンボ数 = new STCOMBO() { act = this }; + this.n現在のコンボ数.最高値 = new int[5]; + this.status = new CSTATUS(); + this.ctコンボ加算 = new CCounter[5]; + for (int i = 0; i < 5; i++) { + this.status[i].e現在のモード = EMode.非表示中; + this.status[i].nCOMBO値 = 0; + this.status[i].n最高COMBO値 = 0; + this.status[i].n現在表示中のCOMBO値 = 0; + this.status[i].n残像表示中のCOMBO値 = 0; + this.status[i].nジャンプインデックス値 = 99999; + this.status[i].n前回の時刻_ジャンプ用 = -1; + this.status[i].nコンボが切れた時刻 = -1; + this.ctコンボ加算[i] = new CCounter(0, 12, 12, OpenTaiko.Timer); + } + this.ctコンボラメ = new CCounter(0, 35, 16, OpenTaiko.Timer); + base.Activate(); + } + public override void DeActivate() { + if (this.status != null) + this.status = null; + + base.DeActivate(); + } + public override void CreateManagedResource() { + base.CreateManagedResource(); + } + public override void ReleaseManagedResource() { + base.ReleaseManagedResource(); + } + public override int Draw() { + if (this.IsDeActivated) + return 0; + + for (int i = 0; i < 5; i++) { + EEvent e今回の状態遷移イベント; + + #region [ 前回と今回の COMBO 値から、e今回の状態遷移イベントを決定する。] + //----------------- + if (this.status[i].n現在表示中のCOMBO値 == this.status[i].nCOMBO値) { + e今回の状態遷移イベント = EEvent.同一数値; + } else if (this.status[i].n現在表示中のCOMBO値 > this.status[i].nCOMBO値) { + e今回の状態遷移イベント = EEvent.ミス通知; + } else if ((this.status[i].n現在表示中のCOMBO値 < OpenTaiko.ConfigIni.nMinDisplayedCombo.Drums) && (this.status[i].nCOMBO値 < OpenTaiko.ConfigIni.nMinDisplayedCombo.Drums)) { + e今回の状態遷移イベント = EEvent.非表示; + } else { + e今回の状態遷移イベント = EEvent.数値更新; + } //----------------- #endregion - } - // CActivity 実装 + #region [ nジャンプインデックス値 の進行。] + //----------------- + if (this.status[i].nジャンプインデックス値 < 360) { + if ((this.status[i].n前回の時刻_ジャンプ用 == -1) || (OpenTaiko.Timer.NowTime < this.status[i].n前回の時刻_ジャンプ用)) + this.status[i].n前回の時刻_ジャンプ用 = OpenTaiko.Timer.NowTime; - public override void Activate() { - this.n現在のコンボ数 = new STCOMBO() { act = this }; - this.n現在のコンボ数.最高値 = new int[5]; - this.status = new CSTATUS(); - this.ctコンボ加算 = new CCounter[5]; - for (int i = 0; i < 5; i++) { - this.status[i].e現在のモード = EMode.非表示中; - this.status[i].nCOMBO値 = 0; - this.status[i].n最高COMBO値 = 0; - this.status[i].n現在表示中のCOMBO値 = 0; - this.status[i].n残像表示中のCOMBO値 = 0; - this.status[i].nジャンプインデックス値 = 99999; - this.status[i].n前回の時刻_ジャンプ用 = -1; - this.status[i].nコンボが切れた時刻 = -1; - this.ctコンボ加算[i] = new CCounter(0, 12, 12, OpenTaiko.Timer); - } - this.ctコンボラメ = new CCounter(0, 35, 16, OpenTaiko.Timer); - base.Activate(); - } - public override void DeActivate() { - if (this.status != null) - this.status = null; + const long INTERVAL = 2; + while ((OpenTaiko.Timer.NowTime - this.status[i].n前回の時刻_ジャンプ用) >= INTERVAL) { + if (this.status[i].nジャンプインデックス値 < 2000) + this.status[i].nジャンプインデックス値 += 3; - base.DeActivate(); - } - public override void CreateManagedResource() { - base.CreateManagedResource(); - } - public override void ReleaseManagedResource() { - base.ReleaseManagedResource(); - } - public override int Draw() { - if (this.IsDeActivated) - return 0; - - for (int i = 0; i < 5; i++) { - EEvent e今回の状態遷移イベント; - - #region [ 前回と今回の COMBO 値から、e今回の状態遷移イベントを決定する。] - //----------------- - if (this.status[i].n現在表示中のCOMBO値 == this.status[i].nCOMBO値) { - e今回の状態遷移イベント = EEvent.同一数値; - } else if (this.status[i].n現在表示中のCOMBO値 > this.status[i].nCOMBO値) { - e今回の状態遷移イベント = EEvent.ミス通知; - } else if ((this.status[i].n現在表示中のCOMBO値 < OpenTaiko.ConfigIni.nMinDisplayedCombo.Drums) && (this.status[i].nCOMBO値 < OpenTaiko.ConfigIni.nMinDisplayedCombo.Drums)) { - e今回の状態遷移イベント = EEvent.非表示; - } else { - e今回の状態遷移イベント = EEvent.数値更新; + this.status[i].n前回の時刻_ジャンプ用 += INTERVAL; } + } + //----------------- + #endregion + + Retry: // モードが変化した場合はここからリトライする。 + + switch (this.status[i].e現在のモード) { + case EMode.非表示中: + #region [ *** ] + //----------------- + + if (e今回の状態遷移イベント == EEvent.数値更新) { + // モード変更 + this.status[i].e現在のモード = EMode.進行表示中; + this.status[i].nジャンプインデックス値 = 0; + this.status[i].n前回の時刻_ジャンプ用 = OpenTaiko.Timer.NowTime; + goto Retry; + } + + this.status[i].n現在表示中のCOMBO値 = this.status[i].nCOMBO値; + break; //----------------- #endregion - #region [ nジャンプインデックス値 の進行。] - //----------------- - if (this.status[i].nジャンプインデックス値 < 360) { - if ((this.status[i].n前回の時刻_ジャンプ用 == -1) || (OpenTaiko.Timer.NowTime < this.status[i].n前回の時刻_ジャンプ用)) - this.status[i].n前回の時刻_ジャンプ用 = OpenTaiko.Timer.NowTime; + case EMode.進行表示中: + #region [ *** ] + //----------------- - const long INTERVAL = 2; - while ((OpenTaiko.Timer.NowTime - this.status[i].n前回の時刻_ジャンプ用) >= INTERVAL) { - if (this.status[i].nジャンプインデックス値 < 2000) - this.status[i].nジャンプインデックス値 += 3; - - this.status[i].n前回の時刻_ジャンプ用 += INTERVAL; + if ((e今回の状態遷移イベント == EEvent.非表示) || (e今回の状態遷移イベント == EEvent.ミス通知)) { + // モード変更 + this.status[i].e現在のモード = EMode.残像表示中; + this.status[i].n残像表示中のCOMBO値 = this.status[i].n現在表示中のCOMBO値; + this.status[i].nコンボが切れた時刻 = OpenTaiko.Timer.NowTime; + goto Retry; } - } - //----------------- - #endregion - Retry: // モードが変化した場合はここからリトライする。 + if (e今回の状態遷移イベント == EEvent.数値更新) { + this.status[i].nジャンプインデックス値 = 0; + this.status[i].n前回の時刻_ジャンプ用 = OpenTaiko.Timer.NowTime; + } - switch (this.status[i].e現在のモード) { - case EMode.非表示中: - #region [ *** ] - //----------------- + this.status[i].n現在表示中のCOMBO値 = this.status[i].nCOMBO値; + switch (i) { + case 0: + this.tコンボ表示_太鼓(this.status[i].nCOMBO値, this.status[i].nジャンプインデックス値, 0); + break; - if (e今回の状態遷移イベント == EEvent.数値更新) { - // モード変更 - this.status[i].e現在のモード = EMode.進行表示中; - this.status[i].nジャンプインデックス値 = 0; - this.status[i].n前回の時刻_ジャンプ用 = OpenTaiko.Timer.NowTime; - goto Retry; - } + case 1: + this.tコンボ表示_太鼓(this.status[i].nCOMBO値, this.status[i].nジャンプインデックス値, 1); + break; - this.status[i].n現在表示中のCOMBO値 = this.status[i].nCOMBO値; - break; + case 2: + this.tコンボ表示_太鼓(this.status[i].nCOMBO値, this.status[i].nジャンプインデックス値, 2); + break; + + case 3: + this.tコンボ表示_太鼓(this.status[i].nCOMBO値, this.status[i].nジャンプインデックス値, 3); + break; + + case 4: + this.tコンボ表示_太鼓(this.status[i].nCOMBO値, this.status[i].nジャンプインデックス値, 4); + break; + } + break; + //----------------- + #endregion + + case EMode.残像表示中: + #region [ *** ] + //----------------- + if (e今回の状態遷移イベント == EEvent.数値更新) { + // モード変更1 + this.status[i].e現在のモード = EMode.進行表示中; + goto Retry; + } + if ((OpenTaiko.Timer.NowTime - this.status[i].nコンボが切れた時刻) > 1000) { + // モード変更2 + this.status[i].e現在のモード = EMode.非表示中; + goto Retry; + } + this.status[i].n現在表示中のCOMBO値 = this.status[i].nCOMBO値; + break; //----------------- #endregion - - case EMode.進行表示中: - #region [ *** ] - //----------------- - - if ((e今回の状態遷移イベント == EEvent.非表示) || (e今回の状態遷移イベント == EEvent.ミス通知)) { - // モード変更 - this.status[i].e現在のモード = EMode.残像表示中; - this.status[i].n残像表示中のCOMBO値 = this.status[i].n現在表示中のCOMBO値; - this.status[i].nコンボが切れた時刻 = OpenTaiko.Timer.NowTime; - goto Retry; - } - - if (e今回の状態遷移イベント == EEvent.数値更新) { - this.status[i].nジャンプインデックス値 = 0; - this.status[i].n前回の時刻_ジャンプ用 = OpenTaiko.Timer.NowTime; - } - - this.status[i].n現在表示中のCOMBO値 = this.status[i].nCOMBO値; - switch (i) { - case 0: - this.tコンボ表示_太鼓(this.status[i].nCOMBO値, this.status[i].nジャンプインデックス値, 0); - break; - - case 1: - this.tコンボ表示_太鼓(this.status[i].nCOMBO値, this.status[i].nジャンプインデックス値, 1); - break; - - case 2: - this.tコンボ表示_太鼓(this.status[i].nCOMBO値, this.status[i].nジャンプインデックス値, 2); - break; - - case 3: - this.tコンボ表示_太鼓(this.status[i].nCOMBO値, this.status[i].nジャンプインデックス値, 3); - break; - - case 4: - this.tコンボ表示_太鼓(this.status[i].nCOMBO値, this.status[i].nジャンプインデックス値, 4); - break; - } - break; - //----------------- - #endregion - - case EMode.残像表示中: - #region [ *** ] - //----------------- - if (e今回の状態遷移イベント == EEvent.数値更新) { - // モード変更1 - this.status[i].e現在のモード = EMode.進行表示中; - goto Retry; - } - if ((OpenTaiko.Timer.NowTime - this.status[i].nコンボが切れた時刻) > 1000) { - // モード変更2 - this.status[i].e現在のモード = EMode.非表示中; - goto Retry; - } - this.status[i].n現在表示中のCOMBO値 = this.status[i].nCOMBO値; - break; - //----------------- - #endregion - } } - - return 0; } + + return 0; } } diff --git a/OpenTaiko/src/Stages/07.Game/CAct演奏Combo音声.cs b/OpenTaiko/src/Stages/07.Game/CAct演奏Combo音声.cs index 7dbc73aa..fbb7e3f9 100644 --- a/OpenTaiko/src/Stages/07.Game/CAct演奏Combo音声.cs +++ b/OpenTaiko/src/Stages/07.Game/CAct演奏Combo音声.cs @@ -1,173 +1,173 @@ using FDK; -namespace OpenTaiko { - internal class CAct演奏Combo音声 : CActivity { - // コンストラクタ +namespace OpenTaiko; - public CAct演奏Combo音声() { - base.IsDeActivated = true; - } +internal class CAct演奏Combo音声 : CActivity { + // コンストラクタ - // メソッド - public void t再生(int nCombo, int player) { - if (VoiceIndex[player] < ListCombo[player].Count) { - - var index = ListCombo[player][VoiceIndex[player]]; - if (nCombo == index.nCombo) { - index.soundComboVoice.PlayStart(); - VoiceIndex[player]++; - } - - } - } - - public void tPlayFloorSound() { - if (FloorIndex[0] < ListFloor[0].Count) { - - var index = ListFloor[0][FloorIndex[0]]; - if (CFloorManagement.LastRegisteredFloor == index.nCombo) { - index.soundComboVoice.PlayStart(); - FloorIndex[0]++; - } - } - } - - /// - /// カーソルを戻す。 - /// コンボが切れた時に使う。 - /// - public void tReset(int nPlayer) { - VoiceIndex[nPlayer] = 0; - } - - // CActivity 実装 - - public override void Activate() { - for (int i = 0; i < 5; i++) { - ListCombo[i] = new List(); - ListFloor[i] = new List(); - } - VoiceIndex = new int[] { 0, 0, 0, 0, 0 }; - FloorIndex = new int[] { 0, 0, 0, 0, 0 }; - - - - - // フォルダ内を走査してコンボボイスをListに入れていく - // 1P、2P コンボボイス - for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { - #region [Combo voices] - - int _charaId = OpenTaiko.SaveFileInstances[OpenTaiko.GetActualPlayer(i)].data.Character; - - var currentDir = ($@"{OpenTaiko.strEXEのあるフォルダ}Global{Path.DirectorySeparatorChar}Characters{Path.DirectorySeparatorChar}{OpenTaiko.Skin.Characters_DirName[_charaId]}{Path.DirectorySeparatorChar}Sounds{Path.DirectorySeparatorChar}Combo{Path.DirectorySeparatorChar}"); - if (Directory.Exists(currentDir)) { - foreach (var item in Directory.GetFiles(currentDir)) { - var comboVoice = new CComboVoice(); - comboVoice.bFileFound = true; - comboVoice.nPlayer = i; - comboVoice.strFilePath = item; - comboVoice.soundComboVoice = OpenTaiko.SoundManager.tCreateSound(item, ESoundGroup.Voice); - /* - if (TJAPlayer3.ConfigIni.nPlayerCount >= 2) //2020.05.06 Mr-Ojii 左右に出したかったから追加。 - { - if (i == 0) - comboVoice.soundComboVoice.n位置 = -100; - else - comboVoice.soundComboVoice.n位置 = 100; - } - */ - comboVoice.soundComboVoice.SoundPosition = OpenTaiko.ConfigIni.nPanning[OpenTaiko.ConfigIni.nPlayerCount - 1][i]; - comboVoice.nCombo = int.Parse(Path.GetFileNameWithoutExtension(item)); - ListCombo[i].Add(comboVoice); - } - if (ListCombo[i].Count > 0) { - ListCombo[i].Sort(); - } - } - - #endregion - - #region [Floor voices] - - currentDir = ($@"{OpenTaiko.strEXEのあるフォルダ}Global\Characters\{OpenTaiko.Skin.Characters_DirName[_charaId]}\Sounds\Tower_Combo\"); - if (Directory.Exists(currentDir)) { - foreach (var item in Directory.GetFiles(currentDir)) { - var comboVoice = new CComboVoice(); - comboVoice.bFileFound = true; - comboVoice.nPlayer = i; - comboVoice.strFilePath = item; - comboVoice.soundComboVoice = OpenTaiko.SoundManager.tCreateSound(item, ESoundGroup.Voice); - comboVoice.nCombo = int.Parse(Path.GetFileNameWithoutExtension(item)); - ListFloor[i].Add(comboVoice); - } - if (ListFloor[i].Count > 0) { - ListFloor[i].Sort(); - } - } - - #endregion - - } - - base.Activate(); - } - - public override void DeActivate() { - if (!base.IsDeActivated) { - for (int i = 0; i < 5; i++) { - foreach (var item in ListCombo[i]) { - OpenTaiko.SoundManager.tDisposeSound(item.soundComboVoice); - } - ListCombo[i].Clear(); - - foreach (var item in ListFloor[i]) { - OpenTaiko.SoundManager.tDisposeSound(item.soundComboVoice); - } - ListFloor[i].Clear(); - } - - base.DeActivate(); - } - } - public override void CreateManagedResource() { - base.CreateManagedResource(); - } - public override void ReleaseManagedResource() { - base.ReleaseManagedResource(); - } - - #region [ private ] - //----------------- - int[] VoiceIndex; - int[] FloorIndex; - - readonly List[] ListCombo = new List[5]; - readonly List[] ListFloor = new List[5]; - //----------------- - #endregion + public CAct演奏Combo音声() { + base.IsDeActivated = true; } - public class CComboVoice : IComparable { - public bool bFileFound; - public int nCombo; - public int nPlayer; - public string strFilePath; - public CSound soundComboVoice; + // メソッド + public void t再生(int nCombo, int player) { + if (VoiceIndex[player] < ListCombo[player].Count) { + + var index = ListCombo[player][VoiceIndex[player]]; + if (nCombo == index.nCombo) { + index.soundComboVoice.PlayStart(); + VoiceIndex[player]++; + } + + } + } + + public void tPlayFloorSound() { + if (FloorIndex[0] < ListFloor[0].Count) { + + var index = ListFloor[0][FloorIndex[0]]; + if (CFloorManagement.LastRegisteredFloor == index.nCombo) { + index.soundComboVoice.PlayStart(); + FloorIndex[0]++; + } + } + } + + /// + /// カーソルを戻す。 + /// コンボが切れた時に使う。 + /// + public void tReset(int nPlayer) { + VoiceIndex[nPlayer] = 0; + } + + // CActivity 実装 + + public override void Activate() { + for (int i = 0; i < 5; i++) { + ListCombo[i] = new List(); + ListFloor[i] = new List(); + } + VoiceIndex = new int[] { 0, 0, 0, 0, 0 }; + FloorIndex = new int[] { 0, 0, 0, 0, 0 }; + + + + + // フォルダ内を走査してコンボボイスをListに入れていく + // 1P、2P コンボボイス + for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { + #region [Combo voices] + + int _charaId = OpenTaiko.SaveFileInstances[OpenTaiko.GetActualPlayer(i)].data.Character; + + var currentDir = ($@"{OpenTaiko.strEXEのあるフォルダ}Global{Path.DirectorySeparatorChar}Characters{Path.DirectorySeparatorChar}{OpenTaiko.Skin.Characters_DirName[_charaId]}{Path.DirectorySeparatorChar}Sounds{Path.DirectorySeparatorChar}Combo{Path.DirectorySeparatorChar}"); + if (Directory.Exists(currentDir)) { + foreach (var item in Directory.GetFiles(currentDir)) { + var comboVoice = new CComboVoice(); + comboVoice.bFileFound = true; + comboVoice.nPlayer = i; + comboVoice.strFilePath = item; + comboVoice.soundComboVoice = OpenTaiko.SoundManager.tCreateSound(item, ESoundGroup.Voice); + /* + if (TJAPlayer3.ConfigIni.nPlayerCount >= 2) //2020.05.06 Mr-Ojii 左右に出したかったから追加。 + { + if (i == 0) + comboVoice.soundComboVoice.n位置 = -100; + else + comboVoice.soundComboVoice.n位置 = 100; + } + */ + comboVoice.soundComboVoice.SoundPosition = OpenTaiko.ConfigIni.nPanning[OpenTaiko.ConfigIni.nPlayerCount - 1][i]; + comboVoice.nCombo = int.Parse(Path.GetFileNameWithoutExtension(item)); + ListCombo[i].Add(comboVoice); + } + if (ListCombo[i].Count > 0) { + ListCombo[i].Sort(); + } + } + + #endregion + + #region [Floor voices] + + currentDir = ($@"{OpenTaiko.strEXEのあるフォルダ}Global\Characters\{OpenTaiko.Skin.Characters_DirName[_charaId]}\Sounds\Tower_Combo\"); + if (Directory.Exists(currentDir)) { + foreach (var item in Directory.GetFiles(currentDir)) { + var comboVoice = new CComboVoice(); + comboVoice.bFileFound = true; + comboVoice.nPlayer = i; + comboVoice.strFilePath = item; + comboVoice.soundComboVoice = OpenTaiko.SoundManager.tCreateSound(item, ESoundGroup.Voice); + comboVoice.nCombo = int.Parse(Path.GetFileNameWithoutExtension(item)); + ListFloor[i].Add(comboVoice); + } + if (ListFloor[i].Count > 0) { + ListFloor[i].Sort(); + } + } + + #endregion - public CComboVoice() { - bFileFound = false; - nCombo = 0; - nPlayer = 0; - strFilePath = ""; - soundComboVoice = null; } - public int CompareTo(CComboVoice other) { - if (this.nCombo > other.nCombo) return 1; - else if (this.nCombo < other.nCombo) return -1; + base.Activate(); + } - return 0; + public override void DeActivate() { + if (!base.IsDeActivated) { + for (int i = 0; i < 5; i++) { + foreach (var item in ListCombo[i]) { + OpenTaiko.SoundManager.tDisposeSound(item.soundComboVoice); + } + ListCombo[i].Clear(); + + foreach (var item in ListFloor[i]) { + OpenTaiko.SoundManager.tDisposeSound(item.soundComboVoice); + } + ListFloor[i].Clear(); + } + + base.DeActivate(); } } + public override void CreateManagedResource() { + base.CreateManagedResource(); + } + public override void ReleaseManagedResource() { + base.ReleaseManagedResource(); + } + + #region [ private ] + //----------------- + int[] VoiceIndex; + int[] FloorIndex; + + readonly List[] ListCombo = new List[5]; + readonly List[] ListFloor = new List[5]; + //----------------- + #endregion +} + +public class CComboVoice : IComparable { + public bool bFileFound; + public int nCombo; + public int nPlayer; + public string strFilePath; + public CSound soundComboVoice; + + public CComboVoice() { + bFileFound = false; + nCombo = 0; + nPlayer = 0; + strFilePath = ""; + soundComboVoice = null; + } + + public int CompareTo(CComboVoice other) { + if (this.nCombo > other.nCombo) return 1; + else if (this.nCombo < other.nCombo) return -1; + + return 0; + } } diff --git a/OpenTaiko/src/Stages/07.Game/CAct演奏PauseMenu.cs b/OpenTaiko/src/Stages/07.Game/CAct演奏PauseMenu.cs index c8065a25..7ace5d3f 100644 --- a/OpenTaiko/src/Stages/07.Game/CAct演奏PauseMenu.cs +++ b/OpenTaiko/src/Stages/07.Game/CAct演奏PauseMenu.cs @@ -1,151 +1,149 @@ using System.Diagnostics; using FDK; -namespace OpenTaiko { - internal class CAct演奏PauseMenu : CActSelectPopupMenu { - // コンストラクタ +namespace OpenTaiko; - public CAct演奏PauseMenu() { - CAct演奏PauseMenuMain(); - } +internal class CAct演奏PauseMenu : CActSelectPopupMenu { + // コンストラクタ - private void CAct演奏PauseMenuMain() { - this.bEsc有効 = false; - lci = new List>>(); // この画面に来る度に、メニューを作り直す。 - for (int nConfSet = 0; nConfSet < (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] != (int)Difficulty.Dan ? 3 : 2); nConfSet++) { - lci.Add(new List>()); // ConfSet用の3つ分の枠。 - for (int nInst = 0; nInst < 3; nInst++) { - lci[nConfSet].Add(null); // Drum/Guitar/Bassで3つ分、枠を作っておく - lci[nConfSet][nInst] = MakeListCItemBase(nConfSet, nInst); - } - } - base.Initialize(lci[nCurrentConfigSet][0], true, CLangManager.LangInstance.GetString("PAUSE_TITLE"), 0); // ConfSet=0, nInst=Drums - } + public CAct演奏PauseMenu() { + CAct演奏PauseMenuMain(); + } - private List MakeListCItemBase(int nConfigSet, int nInst) { - List l = new List(); - - #region [ 共通 SET切り替え/More/Return ] - l.Add(new CSwitchItemList(CLangManager.LangInstance.GetString("PAUSE_RESUME"), CItemBase.EPanelType.Normal, 0, "", "", new string[] { "" })); - if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] != (int)Difficulty.Dan) l.Add(new CSwitchItemList(CLangManager.LangInstance.GetString("PAUSE_RESTART"), CItemBase.EPanelType.Normal, 0, "", "", new string[] { "" })); - l.Add(new CSwitchItemList(CLangManager.LangInstance.GetString("PAUSE_EXIT"), CItemBase.EPanelType.Normal, 0, "", "", new string[] { "", "" })); - #endregion - - return l; - } - - // メソッド - public override void tActivatePopupMenu(EInstrumentPad einst) { - this.CAct演奏PauseMenuMain(); - CActSelectPopupMenu.b選択した = false; - this.bやり直しを選択した = false; - base.tActivatePopupMenu(einst); - } - //public void tDeativatePopupMenu() - //{ - // base.tDeativatePopupMenu(); - //} - - public override void t進行描画sub() { - if (this.bやり直しを選択した) { - if (!sw.IsRunning) - this.sw = Stopwatch.StartNew(); - if (sw.ElapsedMilliseconds > 1500) { - OpenTaiko.stage演奏ドラム画面.bPAUSE = false; - OpenTaiko.stage演奏ドラム画面.t演奏やりなおし(); - - this.tDeativatePopupMenu(); - this.sw.Reset(); - } + private void CAct演奏PauseMenuMain() { + this.bEsc有効 = false; + lci = new List>>(); // この画面に来る度に、メニューを作り直す。 + for (int nConfSet = 0; nConfSet < (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] != (int)Difficulty.Dan ? 3 : 2); nConfSet++) { + lci.Add(new List>()); // ConfSet用の3つ分の枠。 + for (int nInst = 0; nInst < 3; nInst++) { + lci[nConfSet].Add(null); // Drum/Guitar/Bassで3つ分、枠を作っておく + lci[nConfSet][nInst] = MakeListCItemBase(nConfSet, nInst); } } + base.Initialize(lci[nCurrentConfigSet][0], true, CLangManager.LangInstance.GetString("PAUSE_TITLE"), 0); // ConfSet=0, nInst=Drums + } - public override void tEnter押下Main(int nSortOrder) { - switch (n現在の選択行) { - case (int)EOrder.Continue: - OpenTaiko.stage演奏ドラム画面.bPAUSE = false; + private List MakeListCItemBase(int nConfigSet, int nInst) { + List l = new List(); - SoundManager.PlayTimer.Resume(); - OpenTaiko.Timer.Resume(); - OpenTaiko.DTX.t全チップの再生再開(); - OpenTaiko.stage演奏ドラム画面.actAVI.tPauseControl(); + #region [ 共通 SET切り替え/More/Return ] + l.Add(new CSwitchItemList(CLangManager.LangInstance.GetString("PAUSE_RESUME"), CItemBase.EPanelType.Normal, 0, "", "", new string[] { "" })); + if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] != (int)Difficulty.Dan) l.Add(new CSwitchItemList(CLangManager.LangInstance.GetString("PAUSE_RESTART"), CItemBase.EPanelType.Normal, 0, "", "", new string[] { "" })); + l.Add(new CSwitchItemList(CLangManager.LangInstance.GetString("PAUSE_EXIT"), CItemBase.EPanelType.Normal, 0, "", "", new string[] { "", "" })); + #endregion + + return l; + } + + // メソッド + public override void tActivatePopupMenu(EInstrumentPad einst) { + this.CAct演奏PauseMenuMain(); + CActSelectPopupMenu.b選択した = false; + this.bやり直しを選択した = false; + base.tActivatePopupMenu(einst); + } + //public void tDeativatePopupMenu() + //{ + // base.tDeativatePopupMenu(); + //} + + public override void t進行描画sub() { + if (this.bやり直しを選択した) { + if (!sw.IsRunning) + this.sw = Stopwatch.StartNew(); + if (sw.ElapsedMilliseconds > 1500) { + OpenTaiko.stage演奏ドラム画面.bPAUSE = false; + OpenTaiko.stage演奏ドラム画面.t演奏やりなおし(); + + this.tDeativatePopupMenu(); + this.sw.Reset(); + } + } + } + + public override void tEnter押下Main(int nSortOrder) { + switch (n現在の選択行) { + case (int)EOrder.Continue: + OpenTaiko.stage演奏ドラム画面.bPAUSE = false; + + SoundManager.PlayTimer.Resume(); + OpenTaiko.Timer.Resume(); + OpenTaiko.DTX.t全チップの再生再開(); + OpenTaiko.stage演奏ドラム画面.actAVI.tPauseControl(); + CActSelectPopupMenu.b選択した = true; + this.tDeativatePopupMenu(); + break; + + case (int)EOrder.Redoing: + if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] != (int)Difficulty.Dan) { + OpenTaiko.stage演奏ドラム画面.tResetGameplayFinishedStatus(); + this.bやり直しを選択した = true; CActSelectPopupMenu.b選択した = true; - this.tDeativatePopupMenu(); - break; - - case (int)EOrder.Redoing: - if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] != (int)Difficulty.Dan) { - OpenTaiko.stage演奏ドラム画面.tResetGameplayFinishedStatus(); - this.bやり直しを選択した = true; - CActSelectPopupMenu.b選択した = true; - } else { - SoundManager.PlayTimer.Resume(); - OpenTaiko.Timer.Resume(); - OpenTaiko.stage演奏ドラム画面.t演奏中止(); - CActSelectPopupMenu.b選択した = true; - this.tDeativatePopupMenu(); - } - break; - - case (int)EOrder.Return: + } else { SoundManager.PlayTimer.Resume(); OpenTaiko.Timer.Resume(); OpenTaiko.stage演奏ドラム画面.t演奏中止(); CActSelectPopupMenu.b選択した = true; this.tDeativatePopupMenu(); - break; - default: - break; - } - } + } + break; - public override void tCancel() { + case (int)EOrder.Return: + SoundManager.PlayTimer.Resume(); + OpenTaiko.Timer.Resume(); + OpenTaiko.stage演奏ドラム画面.t演奏中止(); + CActSelectPopupMenu.b選択した = true; + this.tDeativatePopupMenu(); + break; + default: + break; } - - // CActivity 実装 - - public override void Activate() { - base.Activate(); - this.bGotoDetailConfig = false; - this.sw = new Stopwatch(); - } - public override void DeActivate() { - base.DeActivate(); - } - public override void CreateManagedResource() { - string pathパネル本体 = CSkin.Path(@$"Graphics{Path.DirectorySeparatorChar}ScreenSelect popup auto settings.png"); - if (File.Exists(pathパネル本体)) { - this.txパネル本体 = OpenTaiko.tテクスチャの生成(pathパネル本体, true); - } - - base.CreateManagedResource(); - } - public override void ReleaseManagedResource() { - OpenTaiko.tテクスチャの解放(ref this.txパネル本体); - OpenTaiko.tテクスチャの解放(ref this.tx文字列パネル); - base.ReleaseManagedResource(); - } - - #region [ private ] - //----------------- - private int nCurrentTarget = 0; - private int nCurrentConfigSet = 0; - private List>> lci; - private enum EOrder : int { - Continue, - Redoing, - Return, END, - Default = 99 - }; - - private bool b選択した; - private CTexture txパネル本体; - private CTexture tx文字列パネル; - private Stopwatch sw; - private bool bやり直しを選択した; - //----------------- - #endregion } + public override void tCancel() { + } + // CActivity 実装 + + public override void Activate() { + base.Activate(); + this.bGotoDetailConfig = false; + this.sw = new Stopwatch(); + } + public override void DeActivate() { + base.DeActivate(); + } + public override void CreateManagedResource() { + string pathパネル本体 = CSkin.Path(@$"Graphics{Path.DirectorySeparatorChar}ScreenSelect popup auto settings.png"); + if (File.Exists(pathパネル本体)) { + this.txパネル本体 = OpenTaiko.tテクスチャの生成(pathパネル本体, true); + } + + base.CreateManagedResource(); + } + public override void ReleaseManagedResource() { + OpenTaiko.tテクスチャの解放(ref this.txパネル本体); + OpenTaiko.tテクスチャの解放(ref this.tx文字列パネル); + base.ReleaseManagedResource(); + } + + #region [ private ] + //----------------- + private int nCurrentTarget = 0; + private int nCurrentConfigSet = 0; + private List>> lci; + private enum EOrder : int { + Continue, + Redoing, + Return, END, + Default = 99 + }; + + private bool b選択した; + private CTexture txパネル本体; + private CTexture tx文字列パネル; + private Stopwatch sw; + private bool bやり直しを選択した; + //----------------- + #endregion } diff --git a/OpenTaiko/src/Stages/07.Game/CAct演奏ゲージ共通.cs b/OpenTaiko/src/Stages/07.Game/CAct演奏ゲージ共通.cs index 2285ce03..71b50a5e 100644 --- a/OpenTaiko/src/Stages/07.Game/CAct演奏ゲージ共通.cs +++ b/OpenTaiko/src/Stages/07.Game/CAct演奏ゲージ共通.cs @@ -1,449 +1,449 @@ using FDK; -namespace OpenTaiko { - /// - /// CAct演奏Drumsゲージ と CAct演奏Gutiarゲージ のbaseクラス。ダメージ計算やDanger/Failed判断もこのクラスで行う。 - /// - /// 課題 - /// _STAGE FAILED OFF時にゲージ回復を止める - /// _黒→閉店までの差を大きくする。 - /// - internal class CAct演奏ゲージ共通 : CActivity { - // Properties - public CActLVLNFont actLVLNFont { get; protected set; } +namespace OpenTaiko; - // コンストラクタ - public CAct演奏ゲージ共通() { - //actLVLNFont = new CActLVLNFont(); // On活性化()に移動 - //actLVLNFont.On活性化(); - } +/// +/// CAct演奏Drumsゲージ と CAct演奏Gutiarゲージ のbaseクラス。ダメージ計算やDanger/Failed判断もこのクラスで行う。 +/// +/// 課題 +/// _STAGE FAILED OFF時にゲージ回復を止める +/// _黒→閉店までの差を大きくする。 +/// +internal class CAct演奏ゲージ共通 : CActivity { + // Properties + public CActLVLNFont actLVLNFont { get; protected set; } - // CActivity 実装 + // コンストラクタ + public CAct演奏ゲージ共通() { + //actLVLNFont = new CActLVLNFont(); // On活性化()に移動 + //actLVLNFont.On活性化(); + } - public override void Activate() { - for (int i = 0; i < 3; i++) { - dbゲージ増加量[i] = new float[5]; - for (int n = 0; n < 3; n++) { - dbゲージ増加量_Branch[i, n] = new float[5]; - } + // CActivity 実装 + + public override void Activate() { + for (int i = 0; i < 3; i++) { + dbゲージ増加量[i] = new float[5]; + for (int n = 0; n < 3; n++) { + dbゲージ増加量_Branch[i, n] = new float[5]; } - this.DTX[0] = OpenTaiko.DTX; - this.DTX[1] = OpenTaiko.DTX_2P; - this.DTX[2] = OpenTaiko.DTX_3P; - this.DTX[3] = OpenTaiko.DTX_4P; - this.DTX[4] = OpenTaiko.DTX_5P; - actLVLNFont = new CActLVLNFont(); - actLVLNFont.Activate(); - base.Activate(); } - public override void DeActivate() { - actLVLNFont.DeActivate(); - actLVLNFont = null; - base.DeActivate(); + this.DTX[0] = OpenTaiko.DTX; + this.DTX[1] = OpenTaiko.DTX_2P; + this.DTX[2] = OpenTaiko.DTX_3P; + this.DTX[3] = OpenTaiko.DTX_4P; + this.DTX[4] = OpenTaiko.DTX_5P; + actLVLNFont = new CActLVLNFont(); + actLVLNFont.Activate(); + base.Activate(); + } + public override void DeActivate() { + actLVLNFont.DeActivate(); + actLVLNFont = null; + base.DeActivate(); + } + + const double GAUGE_MAX = 100.0; + const double GAUGE_INITIAL = 2.0 / 3; + const double GAUGE_MIN = -0.1; + const double GAUGE_ZERO = 0.0; + const double GAUGE_DANGER = 0.3; + + public bool bRisky // Riskyモードか否か + { + get; + private set; + } + public int nRiskyTimes_Initial // Risky初期値 + { + get; + private set; + } + public int nRiskyTimes // 残Miss回数 + { + get; + private set; + } + public bool IsFailed(EInstrumentPad part) // 閉店状態になったかどうか + { + if (bRisky) { + return (nRiskyTimes <= 0); } - - const double GAUGE_MAX = 100.0; - const double GAUGE_INITIAL = 2.0 / 3; - const double GAUGE_MIN = -0.1; - const double GAUGE_ZERO = 0.0; - const double GAUGE_DANGER = 0.3; - - public bool bRisky // Riskyモードか否か - { - get; - private set; - } - public int nRiskyTimes_Initial // Risky初期値 - { - get; - private set; - } - public int nRiskyTimes // 残Miss回数 - { - get; - private set; - } - public bool IsFailed(EInstrumentPad part) // 閉店状態になったかどうか - { - if (bRisky) { - return (nRiskyTimes <= 0); - } - return this.db現在のゲージ値[(int)part] <= GAUGE_MIN; - } - public bool IsDanger(EInstrumentPad part) // DANGERかどうか - { - if (bRisky) { - switch (nRiskyTimes_Initial) { - case 1: - return false; - case 2: - case 3: - return (nRiskyTimes <= 1); - default: - return (nRiskyTimes <= 2); - } - } - return (this.db現在のゲージ値[(int)part] <= GAUGE_DANGER); - } - - /// - /// ゲージの初期化 - /// - /// Riskyの初期値(0でRisky未使用) - public void Init(int nRiskyTimes_InitialVal, int nPlayer) // ゲージ初期化 - { - //ダメージ値の計算 - { - var chara = OpenTaiko.Tx.Characters[OpenTaiko.SaveFileInstances[OpenTaiko.GetActualPlayer(nPlayer)].data.Character]; - switch (chara.effect.tGetGaugeType()) { - default: - case "Normal": - this.db現在のゲージ値[nPlayer] = 0; - break; - case "Hard": - case "Extreme": - this.db現在のゲージ値[nPlayer] = 100; - break; - } - } - - //ゲージのMAXまでの最低コンボ数を計算 - float dbGaugeMaxComboValue = 0; - float[] dbGaugeMaxComboValue_branch = new float[3]; - - - if (nRiskyTimes_InitialVal > 0) { - this.bRisky = true; - this.nRiskyTimes = OpenTaiko.ConfigIni.nRisky; - this.nRiskyTimes_Initial = OpenTaiko.ConfigIni.nRisky; - } - - float gaugeRate = 0f; - float dbDamageRate = 2.0f; - - int nanidou = OpenTaiko.stageSongSelect.nChoosenSongDifficulty[nPlayer]; - - switch (this.DTX[nPlayer].LEVELtaiko[nanidou]) { - case 0: + return this.db現在のゲージ値[(int)part] <= GAUGE_MIN; + } + public bool IsDanger(EInstrumentPad part) // DANGERかどうか + { + if (bRisky) { + switch (nRiskyTimes_Initial) { case 1: + return false; case 2: case 3: - case 4: - case 5: - case 6: - case 7: - gaugeRate = this.fGaugeMaxRate[0]; - dbDamageRate = 0.625f; - break; - - - case 8: - gaugeRate = this.fGaugeMaxRate[1]; - dbDamageRate = 0.625f; - break; - - case 9: - case 10: + return (nRiskyTimes <= 1); default: - gaugeRate = this.fGaugeMaxRate[2]; - dbDamageRate = 2.0f; - break; + return (nRiskyTimes <= 2); } + } + return (this.db現在のゲージ値[(int)part] <= GAUGE_DANGER); + } - #region [(Unbloated) Gauge max combo values] - - if (this.DTX[nPlayer].bチップがある.Branch) { - dbGaugeMaxComboValue = this.DTX[nPlayer].nノーツ数[3] * (gaugeRate / 100.0f); - for (int i = 0; i < 3; i++) { - dbGaugeMaxComboValue_branch[i] = this.DTX[nPlayer].nノーツ数_Branch[i] * (gaugeRate / 100.0f); - } - } else { - dbGaugeMaxComboValue = this.DTX[nPlayer].nノーツ数[3] * (gaugeRate / 100.0f); - } - - #endregion - - float multiplicationFactor = 1f; - if (nanidou == (int)Difficulty.Tower) - multiplicationFactor = 0f; - - double nGaugeRankValue = 0D; - double[] nGaugeRankValue_branch = new double[] { 0D, 0D, 0D }; - - nGaugeRankValue = (10000.0f / dbGaugeMaxComboValue) * multiplicationFactor; - for (int i = 0; i < 3; i++) { - nGaugeRankValue_branch[i] = (10000.0f / dbGaugeMaxComboValue_branch[i]) * multiplicationFactor; - } - - //ゲージ値計算 - //実機に近い計算 - - this.dbゲージ増加量[0][nPlayer] = (float)nGaugeRankValue / 100.0f; - this.dbゲージ増加量[1][nPlayer] = (float)(nGaugeRankValue / 100.0f) * 0.5f; - this.dbゲージ増加量[2][nPlayer] = (float)(nGaugeRankValue / 100.0f) * dbDamageRate; - - for (int i = 0; i < 3; i++) { - this.dbゲージ増加量_Branch[i, 0][nPlayer] = (float)nGaugeRankValue_branch[i] / 100.0f; - this.dbゲージ増加量_Branch[i, 1][nPlayer] = (float)(nGaugeRankValue_branch[i] / 100.0f) * 0.5f; - this.dbゲージ増加量_Branch[i, 2][nPlayer] = (float)(nGaugeRankValue_branch[i] / 100.0f) * dbDamageRate; - } - - //this.dbゲージ増加量[ 0 ] = CDTXMania.DTX.bチップがある.Branch ? ( 130.0 / CDTXMania.DTX.nノーツ数[ 0 ] ) : ( 130.0 / CDTXMania.DTX.nノーツ数[ 3 ] ); - //this.dbゲージ増加量[ 1 ] = CDTXMania.DTX.bチップがある.Branch ? ( 65.0 / CDTXMania.DTX.nノーツ数[ 0 ] ) : 65.0 / CDTXMania.DTX.nノーツ数[ 3 ]; - //this.dbゲージ増加量[ 2 ] = CDTXMania.DTX.bチップがある.Branch ? ( -260.0 / CDTXMania.DTX.nノーツ数[ 0 ] ) : -260.0 / CDTXMania.DTX.nノーツ数[ 3 ]; - - //2015.03.26 kairera0467 計算を初期化時にするよう修正。 - - #region [ Handling infinity cases ] - float fIsDontInfinty = 0.4f;//適当に0.4で - float[] fAddVolume = new float[] { 1.0f, 0.5f, dbDamageRate }; - - for (int i = 0; i < 3; i++) { - for (int l = 0; l < 3; l++) { - if (!double.IsInfinity(nGaugeRankValue_branch[i] / 100.0f))//値がInfintyかチェック - { - fIsDontInfinty = (float)(nGaugeRankValue_branch[i] / 100.0f); - this.dbゲージ増加量_Branch[i, l][nPlayer] = fIsDontInfinty * fAddVolume[l]; - } - } - } - for (int i = 0; i < 3; i++) { - for (int l = 0; l < 3; l++) { - if (double.IsInfinity(nGaugeRankValue_branch[i] / 100.0f))//値がInfintyかチェック - { - //Infintyだった場合はInfintyではない値 * 3.0をしてその値を利用する。 - this.dbゲージ増加量_Branch[i, l][nPlayer] = (fIsDontInfinty * fAddVolume[l]) * 3f; - } - } - } - #endregion - - #region [Rounding process] - - var increase = new float[] { dbゲージ増加量[0][nPlayer], dbゲージ増加量[1][nPlayer], dbゲージ増加量[2][nPlayer] }; - var increaseBranch = new float[3, 3]; - for (int i = 0; i < 3; i++) { - increaseBranch[i, 0] = dbゲージ増加量_Branch[i, 0][nPlayer]; - increaseBranch[i, 1] = dbゲージ増加量_Branch[i, 1][nPlayer]; - increaseBranch[i, 2] = dbゲージ増加量_Branch[i, 0][nPlayer]; - } - switch (this.DTX[nPlayer].GaugeIncreaseMode) { - case GaugeIncreaseMode.Normal: - case GaugeIncreaseMode.Floor: - // 切り捨て - for (int i = 0; i < 3; i++) { - increase[i] = (float)Math.Truncate(increase[i] * 10000.0f) / 10000.0f; - } - for (int i = 0; i < 3; i++) { - increaseBranch[i, 0] = (float)Math.Truncate(increaseBranch[i, 0] * 10000.0f) / 10000.0f; - increaseBranch[i, 1] = (float)Math.Truncate(increaseBranch[i, 1] * 10000.0f) / 10000.0f; - increaseBranch[i, 2] = (float)Math.Truncate(increaseBranch[i, 2] * 10000.0f) / 10000.0f; - } - break; - case GaugeIncreaseMode.Round: - // 四捨五入 - for (int i = 0; i < 3; i++) { - increase[i] = (float)Math.Round(increase[i] * 10000.0f) / 10000.0f; - } - for (int i = 0; i < 3; i++) { - increaseBranch[i, 0] = (float)Math.Round(increaseBranch[i, 0] * 10000.0f) / 10000.0f; - increaseBranch[i, 1] = (float)Math.Round(increaseBranch[i, 1] * 10000.0f) / 10000.0f; - increaseBranch[i, 2] = (float)Math.Round(increaseBranch[i, 2] * 10000.0f) / 10000.0f; - } - break; - case GaugeIncreaseMode.Ceiling: - // 切り上げ - for (int i = 0; i < 3; i++) { - increase[i] = (float)Math.Ceiling(increase[i] * 10000.0f) / 10000.0f; - } - for (int i = 0; i < 3; i++) { - increaseBranch[i, 0] = (float)Math.Ceiling(increaseBranch[i, 0] * 10000.0f) / 10000.0f; - increaseBranch[i, 1] = (float)Math.Ceiling(increaseBranch[i, 1] * 10000.0f) / 10000.0f; - increaseBranch[i, 2] = (float)Math.Ceiling(increaseBranch[i, 2] * 10000.0f) / 10000.0f; - } - break; - case GaugeIncreaseMode.NotFix: + /// + /// ゲージの初期化 + /// + /// Riskyの初期値(0でRisky未使用) + public void Init(int nRiskyTimes_InitialVal, int nPlayer) // ゲージ初期化 + { + //ダメージ値の計算 + { + var chara = OpenTaiko.Tx.Characters[OpenTaiko.SaveFileInstances[OpenTaiko.GetActualPlayer(nPlayer)].data.Character]; + switch (chara.effect.tGetGaugeType()) { default: - // 丸めない + case "Normal": + this.db現在のゲージ値[nPlayer] = 0; + break; + case "Hard": + case "Extreme": + this.db現在のゲージ値[nPlayer] = 100; break; } - - for (int i = 0; i < 3; i++) { - var chara = OpenTaiko.Tx.Characters[OpenTaiko.SaveFileInstances[OpenTaiko.GetActualPlayer(nPlayer)].data.Character]; - switch (chara.effect.tGetGaugeType()) { - default: - case "Normal": - dbゲージ増加量[i][nPlayer] = increase[i]; - break; - case "Hard": - dbゲージ増加量[i][nPlayer] = increase[i] * HGaugeMethods.HardGaugeFillRatio; - break; - case "Extreme": - dbゲージ増加量[i][nPlayer] = increase[i] * HGaugeMethods.ExtremeGaugeFillRatio; - break; - } - } - for (int i = 0; i < 3; i++) { - var chara = OpenTaiko.Tx.Characters[OpenTaiko.SaveFileInstances[OpenTaiko.GetActualPlayer(nPlayer)].data.Character]; - switch (chara.effect.tGetGaugeType()) { - default: - case "Normal": - dbゲージ増加量_Branch[i, 0][nPlayer] = increaseBranch[i, 0]; - dbゲージ増加量_Branch[i, 1][nPlayer] = increaseBranch[i, 1]; - dbゲージ増加量_Branch[i, 2][nPlayer] = increaseBranch[i, 2]; - break; - case "Hard": - dbゲージ増加量_Branch[i, 0][nPlayer] = increaseBranch[i, 0] * HGaugeMethods.HardGaugeFillRatio; - dbゲージ増加量_Branch[i, 1][nPlayer] = increaseBranch[i, 1] * HGaugeMethods.HardGaugeFillRatio; - dbゲージ増加量_Branch[i, 2][nPlayer] = increaseBranch[i, 2] * HGaugeMethods.HardGaugeFillRatio; - break; - case "Extreme": - dbゲージ増加量_Branch[i, 0][nPlayer] = increaseBranch[i, 0] * HGaugeMethods.ExtremeGaugeFillRatio; - dbゲージ増加量_Branch[i, 1][nPlayer] = increaseBranch[i, 1] * HGaugeMethods.ExtremeGaugeFillRatio; - dbゲージ増加量_Branch[i, 2][nPlayer] = increaseBranch[i, 2] * HGaugeMethods.ExtremeGaugeFillRatio; - break; - } - } - #endregion } - #region [ DAMAGE ] -#if true // DAMAGELEVELTUNING - #region [ DAMAGELEVELTUNING ] - // ---------------------------------- - public float[,] fDamageGaugeDelta = { // #23625 2011.1.10 ickw_284: tuned damage/recover factors - // drums, guitar, bass - { 0.004f, 0.006f, 0.006f, 0.004f }, - { 0.002f, 0.003f, 0.003f, 0.002f }, - { 0.000f, 0.000f, 0.000f, 0.000f }, - { -0.020f, -0.030f, -0.030f, -0.020f }, - { -0.050f, -0.050f, -0.050f, -0.050f } - }; - public float[] fDamageLevelFactor = { - 0.5f, 1.0f, 1.5f - }; - - public float[][] dbゲージ増加量 = new float[3][]; - - //譜面レベル, 判定 - public float[,][] dbゲージ増加量_Branch = new float[3, 3][]; + //ゲージのMAXまでの最低コンボ数を計算 + float dbGaugeMaxComboValue = 0; + float[] dbGaugeMaxComboValue_branch = new float[3]; - public float[] fGaugeMaxRate = - { - 70.7f, // 1~7 - 70f, // 8 - 75.0f, // 9~10 - 78.5f, // 11 - 80.5f, // 12 - 82f, // 13+ - };//おおよその値。 + if (nRiskyTimes_InitialVal > 0) { + this.bRisky = true; + this.nRiskyTimes = OpenTaiko.ConfigIni.nRisky; + this.nRiskyTimes_Initial = OpenTaiko.ConfigIni.nRisky; + } + + float gaugeRate = 0f; + float dbDamageRate = 2.0f; + + int nanidou = OpenTaiko.stageSongSelect.nChoosenSongDifficulty[nPlayer]; + + switch (this.DTX[nPlayer].LEVELtaiko[nanidou]) { + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + gaugeRate = this.fGaugeMaxRate[0]; + dbDamageRate = 0.625f; + break; + + + case 8: + gaugeRate = this.fGaugeMaxRate[1]; + dbDamageRate = 0.625f; + break; + + case 9: + case 10: + default: + gaugeRate = this.fGaugeMaxRate[2]; + dbDamageRate = 2.0f; + break; + } + + #region [(Unbloated) Gauge max combo values] + + if (this.DTX[nPlayer].bチップがある.Branch) { + dbGaugeMaxComboValue = this.DTX[nPlayer].nノーツ数[3] * (gaugeRate / 100.0f); + for (int i = 0; i < 3; i++) { + dbGaugeMaxComboValue_branch[i] = this.DTX[nPlayer].nノーツ数_Branch[i] * (gaugeRate / 100.0f); + } + } else { + dbGaugeMaxComboValue = this.DTX[nPlayer].nノーツ数[3] * (gaugeRate / 100.0f); + } - // ---------------------------------- #endregion + + float multiplicationFactor = 1f; + if (nanidou == (int)Difficulty.Tower) + multiplicationFactor = 0f; + + double nGaugeRankValue = 0D; + double[] nGaugeRankValue_branch = new double[] { 0D, 0D, 0D }; + + nGaugeRankValue = (10000.0f / dbGaugeMaxComboValue) * multiplicationFactor; + for (int i = 0; i < 3; i++) { + nGaugeRankValue_branch[i] = (10000.0f / dbGaugeMaxComboValue_branch[i]) * multiplicationFactor; + } + + //ゲージ値計算 + //実機に近い計算 + + this.dbゲージ増加量[0][nPlayer] = (float)nGaugeRankValue / 100.0f; + this.dbゲージ増加量[1][nPlayer] = (float)(nGaugeRankValue / 100.0f) * 0.5f; + this.dbゲージ増加量[2][nPlayer] = (float)(nGaugeRankValue / 100.0f) * dbDamageRate; + + for (int i = 0; i < 3; i++) { + this.dbゲージ増加量_Branch[i, 0][nPlayer] = (float)nGaugeRankValue_branch[i] / 100.0f; + this.dbゲージ増加量_Branch[i, 1][nPlayer] = (float)(nGaugeRankValue_branch[i] / 100.0f) * 0.5f; + this.dbゲージ増加量_Branch[i, 2][nPlayer] = (float)(nGaugeRankValue_branch[i] / 100.0f) * dbDamageRate; + } + + //this.dbゲージ増加量[ 0 ] = CDTXMania.DTX.bチップがある.Branch ? ( 130.0 / CDTXMania.DTX.nノーツ数[ 0 ] ) : ( 130.0 / CDTXMania.DTX.nノーツ数[ 3 ] ); + //this.dbゲージ増加量[ 1 ] = CDTXMania.DTX.bチップがある.Branch ? ( 65.0 / CDTXMania.DTX.nノーツ数[ 0 ] ) : 65.0 / CDTXMania.DTX.nノーツ数[ 3 ]; + //this.dbゲージ増加量[ 2 ] = CDTXMania.DTX.bチップがある.Branch ? ( -260.0 / CDTXMania.DTX.nノーツ数[ 0 ] ) : -260.0 / CDTXMania.DTX.nノーツ数[ 3 ]; + + //2015.03.26 kairera0467 計算を初期化時にするよう修正。 + + #region [ Handling infinity cases ] + float fIsDontInfinty = 0.4f;//適当に0.4で + float[] fAddVolume = new float[] { 1.0f, 0.5f, dbDamageRate }; + + for (int i = 0; i < 3; i++) { + for (int l = 0; l < 3; l++) { + if (!double.IsInfinity(nGaugeRankValue_branch[i] / 100.0f))//値がInfintyかチェック + { + fIsDontInfinty = (float)(nGaugeRankValue_branch[i] / 100.0f); + this.dbゲージ増加量_Branch[i, l][nPlayer] = fIsDontInfinty * fAddVolume[l]; + } + } + } + for (int i = 0; i < 3; i++) { + for (int l = 0; l < 3; l++) { + if (double.IsInfinity(nGaugeRankValue_branch[i] / 100.0f))//値がInfintyかチェック + { + //Infintyだった場合はInfintyではない値 * 3.0をしてその値を利用する。 + this.dbゲージ増加量_Branch[i, l][nPlayer] = (fIsDontInfinty * fAddVolume[l]) * 3f; + } + } + } + #endregion + + #region [Rounding process] + + var increase = new float[] { dbゲージ増加量[0][nPlayer], dbゲージ増加量[1][nPlayer], dbゲージ増加量[2][nPlayer] }; + var increaseBranch = new float[3, 3]; + for (int i = 0; i < 3; i++) { + increaseBranch[i, 0] = dbゲージ増加量_Branch[i, 0][nPlayer]; + increaseBranch[i, 1] = dbゲージ増加量_Branch[i, 1][nPlayer]; + increaseBranch[i, 2] = dbゲージ増加量_Branch[i, 0][nPlayer]; + } + switch (this.DTX[nPlayer].GaugeIncreaseMode) { + case GaugeIncreaseMode.Normal: + case GaugeIncreaseMode.Floor: + // 切り捨て + for (int i = 0; i < 3; i++) { + increase[i] = (float)Math.Truncate(increase[i] * 10000.0f) / 10000.0f; + } + for (int i = 0; i < 3; i++) { + increaseBranch[i, 0] = (float)Math.Truncate(increaseBranch[i, 0] * 10000.0f) / 10000.0f; + increaseBranch[i, 1] = (float)Math.Truncate(increaseBranch[i, 1] * 10000.0f) / 10000.0f; + increaseBranch[i, 2] = (float)Math.Truncate(increaseBranch[i, 2] * 10000.0f) / 10000.0f; + } + break; + case GaugeIncreaseMode.Round: + // 四捨五入 + for (int i = 0; i < 3; i++) { + increase[i] = (float)Math.Round(increase[i] * 10000.0f) / 10000.0f; + } + for (int i = 0; i < 3; i++) { + increaseBranch[i, 0] = (float)Math.Round(increaseBranch[i, 0] * 10000.0f) / 10000.0f; + increaseBranch[i, 1] = (float)Math.Round(increaseBranch[i, 1] * 10000.0f) / 10000.0f; + increaseBranch[i, 2] = (float)Math.Round(increaseBranch[i, 2] * 10000.0f) / 10000.0f; + } + break; + case GaugeIncreaseMode.Ceiling: + // 切り上げ + for (int i = 0; i < 3; i++) { + increase[i] = (float)Math.Ceiling(increase[i] * 10000.0f) / 10000.0f; + } + for (int i = 0; i < 3; i++) { + increaseBranch[i, 0] = (float)Math.Ceiling(increaseBranch[i, 0] * 10000.0f) / 10000.0f; + increaseBranch[i, 1] = (float)Math.Ceiling(increaseBranch[i, 1] * 10000.0f) / 10000.0f; + increaseBranch[i, 2] = (float)Math.Ceiling(increaseBranch[i, 2] * 10000.0f) / 10000.0f; + } + break; + case GaugeIncreaseMode.NotFix: + default: + // 丸めない + break; + } + + for (int i = 0; i < 3; i++) { + var chara = OpenTaiko.Tx.Characters[OpenTaiko.SaveFileInstances[OpenTaiko.GetActualPlayer(nPlayer)].data.Character]; + switch (chara.effect.tGetGaugeType()) { + default: + case "Normal": + dbゲージ増加量[i][nPlayer] = increase[i]; + break; + case "Hard": + dbゲージ増加量[i][nPlayer] = increase[i] * HGaugeMethods.HardGaugeFillRatio; + break; + case "Extreme": + dbゲージ増加量[i][nPlayer] = increase[i] * HGaugeMethods.ExtremeGaugeFillRatio; + break; + } + } + for (int i = 0; i < 3; i++) { + var chara = OpenTaiko.Tx.Characters[OpenTaiko.SaveFileInstances[OpenTaiko.GetActualPlayer(nPlayer)].data.Character]; + switch (chara.effect.tGetGaugeType()) { + default: + case "Normal": + dbゲージ増加量_Branch[i, 0][nPlayer] = increaseBranch[i, 0]; + dbゲージ増加量_Branch[i, 1][nPlayer] = increaseBranch[i, 1]; + dbゲージ増加量_Branch[i, 2][nPlayer] = increaseBranch[i, 2]; + break; + case "Hard": + dbゲージ増加量_Branch[i, 0][nPlayer] = increaseBranch[i, 0] * HGaugeMethods.HardGaugeFillRatio; + dbゲージ増加量_Branch[i, 1][nPlayer] = increaseBranch[i, 1] * HGaugeMethods.HardGaugeFillRatio; + dbゲージ増加量_Branch[i, 2][nPlayer] = increaseBranch[i, 2] * HGaugeMethods.HardGaugeFillRatio; + break; + case "Extreme": + dbゲージ増加量_Branch[i, 0][nPlayer] = increaseBranch[i, 0] * HGaugeMethods.ExtremeGaugeFillRatio; + dbゲージ増加量_Branch[i, 1][nPlayer] = increaseBranch[i, 1] * HGaugeMethods.ExtremeGaugeFillRatio; + dbゲージ増加量_Branch[i, 2][nPlayer] = increaseBranch[i, 2] * HGaugeMethods.ExtremeGaugeFillRatio; + break; + } + } + #endregion + } + + #region [ DAMAGE ] +#if true // DAMAGELEVELTUNING + #region [ DAMAGELEVELTUNING ] + // ---------------------------------- + public float[,] fDamageGaugeDelta = { // #23625 2011.1.10 ickw_284: tuned damage/recover factors + // drums, guitar, bass + { 0.004f, 0.006f, 0.006f, 0.004f }, + { 0.002f, 0.003f, 0.003f, 0.002f }, + { 0.000f, 0.000f, 0.000f, 0.000f }, + { -0.020f, -0.030f, -0.030f, -0.020f }, + { -0.050f, -0.050f, -0.050f, -0.050f } + }; + public float[] fDamageLevelFactor = { + 0.5f, 1.0f, 1.5f + }; + + public float[][] dbゲージ増加量 = new float[3][]; + + //譜面レベル, 判定 + public float[,][] dbゲージ増加量_Branch = new float[3, 3][]; + + + public float[] fGaugeMaxRate = + { + 70.7f, // 1~7 + 70f, // 8 + 75.0f, // 9~10 + 78.5f, // 11 + 80.5f, // 12 + 82f, // 13+ + };//おおよその値。 + + // ---------------------------------- + #endregion #endif - public void MineDamage(int nPlayer) { - this.db現在のゲージ値[nPlayer] = Math.Max(0, this.db現在のゲージ値[nPlayer] - HGaugeMethods.BombDamage); - } - - public void FuseDamage(int nPlayer) { - this.db現在のゲージ値[nPlayer] = Math.Max(0, this.db現在のゲージ値[nPlayer] - HGaugeMethods.FuserollDamage); - } - - public void Damage(EInstrumentPad screenmode, EInstrumentPad part, ENoteJudge e今回の判定, int nPlayer) { - float fDamage; - int nコース = (int)OpenTaiko.stage演奏ドラム画面.n現在のコース[nPlayer]; - - switch (e今回の判定) { - case ENoteJudge.Perfect: - case ENoteJudge.Great: { - if (this.DTX[nPlayer].bチップがある.Branch) { - fDamage = this.dbゲージ増加量_Branch[nコース, 0][nPlayer]; - } else - fDamage = this.dbゲージ増加量[0][nPlayer]; - } - break; - case ENoteJudge.Good: { - if (this.DTX[nPlayer].bチップがある.Branch) { - fDamage = this.dbゲージ増加量_Branch[nコース, 1][nPlayer]; - } else - fDamage = this.dbゲージ増加量[1][nPlayer]; - } - break; - case ENoteJudge.Poor: - case ENoteJudge.Miss: { - if (this.DTX[nPlayer].bチップがある.Branch) { - fDamage = this.dbゲージ増加量_Branch[nコース, 2][nPlayer]; - } else - fDamage = this.dbゲージ増加量[2][nPlayer]; - - if (fDamage >= 0) { - fDamage = -fDamage; - } - - var chara = OpenTaiko.Tx.Characters[OpenTaiko.SaveFileInstances[OpenTaiko.GetActualPlayer(nPlayer)].data.Character]; - - int nanidou = OpenTaiko.stageSongSelect.nChoosenSongDifficulty[nPlayer]; - int level = this.DTX[nPlayer].LEVELtaiko[nanidou]; - - switch (chara.effect.tGetGaugeType()) { - case "Hard": - fDamage = -HGaugeMethods.tHardGaugeGetDamage((Difficulty)nanidou, level); - break; - case "Extreme": - fDamage = -HGaugeMethods.tExtremeGaugeGetDamage((Difficulty)nanidou, level); - break; - } - - if (this.bRisky) { - this.nRiskyTimes--; - } - } - - break; - - - - default: { - if (this.DTX[nPlayer].bチップがある.Branch) { - fDamage = this.dbゲージ増加量_Branch[nコース, 0][nPlayer]; - } else - fDamage = this.dbゲージ増加量[0][nPlayer]; - break; - } - - - } - - - - this.db現在のゲージ値[nPlayer] = Math.Round(this.db現在のゲージ値[nPlayer] + fDamage, 5, MidpointRounding.ToEven); - - if (this.db現在のゲージ値[nPlayer] >= 100.0) - this.db現在のゲージ値[nPlayer] = 100.0; - else if (this.db現在のゲージ値[nPlayer] <= 0.0) - this.db現在のゲージ値[nPlayer] = 0.0; - - - //CDTXMania.stage演奏ドラム画面.nGauge = fDamage; - - } - - public virtual void Start(int nLane, ENoteJudge judge, int player) { - } - - //----------------- - #endregion - - private CDTX[] DTX = new CDTX[5]; - public double[] db現在のゲージ値 = new double[5]; - protected CCounter ct炎; - protected CCounter ct虹アニメ; - protected CCounter ct虹透明度; - protected CTexture[] txゲージ虹 = new CTexture[12]; - protected CTexture[] txゲージ虹2P = new CTexture[12]; + public void MineDamage(int nPlayer) { + this.db現在のゲージ値[nPlayer] = Math.Max(0, this.db現在のゲージ値[nPlayer] - HGaugeMethods.BombDamage); } + + public void FuseDamage(int nPlayer) { + this.db現在のゲージ値[nPlayer] = Math.Max(0, this.db現在のゲージ値[nPlayer] - HGaugeMethods.FuserollDamage); + } + + public void Damage(EInstrumentPad screenmode, EInstrumentPad part, ENoteJudge e今回の判定, int nPlayer) { + float fDamage; + int nコース = (int)OpenTaiko.stage演奏ドラム画面.n現在のコース[nPlayer]; + + switch (e今回の判定) { + case ENoteJudge.Perfect: + case ENoteJudge.Great: { + if (this.DTX[nPlayer].bチップがある.Branch) { + fDamage = this.dbゲージ増加量_Branch[nコース, 0][nPlayer]; + } else + fDamage = this.dbゲージ増加量[0][nPlayer]; + } + break; + case ENoteJudge.Good: { + if (this.DTX[nPlayer].bチップがある.Branch) { + fDamage = this.dbゲージ増加量_Branch[nコース, 1][nPlayer]; + } else + fDamage = this.dbゲージ増加量[1][nPlayer]; + } + break; + case ENoteJudge.Poor: + case ENoteJudge.Miss: { + if (this.DTX[nPlayer].bチップがある.Branch) { + fDamage = this.dbゲージ増加量_Branch[nコース, 2][nPlayer]; + } else + fDamage = this.dbゲージ増加量[2][nPlayer]; + + if (fDamage >= 0) { + fDamage = -fDamage; + } + + var chara = OpenTaiko.Tx.Characters[OpenTaiko.SaveFileInstances[OpenTaiko.GetActualPlayer(nPlayer)].data.Character]; + + int nanidou = OpenTaiko.stageSongSelect.nChoosenSongDifficulty[nPlayer]; + int level = this.DTX[nPlayer].LEVELtaiko[nanidou]; + + switch (chara.effect.tGetGaugeType()) { + case "Hard": + fDamage = -HGaugeMethods.tHardGaugeGetDamage((Difficulty)nanidou, level); + break; + case "Extreme": + fDamage = -HGaugeMethods.tExtremeGaugeGetDamage((Difficulty)nanidou, level); + break; + } + + if (this.bRisky) { + this.nRiskyTimes--; + } + } + + break; + + + + default: { + if (this.DTX[nPlayer].bチップがある.Branch) { + fDamage = this.dbゲージ増加量_Branch[nコース, 0][nPlayer]; + } else + fDamage = this.dbゲージ増加量[0][nPlayer]; + break; + } + + + } + + + + this.db現在のゲージ値[nPlayer] = Math.Round(this.db現在のゲージ値[nPlayer] + fDamage, 5, MidpointRounding.ToEven); + + if (this.db現在のゲージ値[nPlayer] >= 100.0) + this.db現在のゲージ値[nPlayer] = 100.0; + else if (this.db現在のゲージ値[nPlayer] <= 0.0) + this.db現在のゲージ値[nPlayer] = 0.0; + + + //CDTXMania.stage演奏ドラム画面.nGauge = fDamage; + + } + + public virtual void Start(int nLane, ENoteJudge judge, int player) { + } + + //----------------- + #endregion + + private CDTX[] DTX = new CDTX[5]; + public double[] db現在のゲージ値 = new double[5]; + protected CCounter ct炎; + protected CCounter ct虹アニメ; + protected CCounter ct虹透明度; + protected CTexture[] txゲージ虹 = new CTexture[12]; + protected CTexture[] txゲージ虹2P = new CTexture[12]; } diff --git a/OpenTaiko/src/Stages/07.Game/CAct演奏スクロール速度.cs b/OpenTaiko/src/Stages/07.Game/CAct演奏スクロール速度.cs index 2312d35c..073a87bb 100644 --- a/OpenTaiko/src/Stages/07.Game/CAct演奏スクロール速度.cs +++ b/OpenTaiko/src/Stages/07.Game/CAct演奏スクロール速度.cs @@ -1,78 +1,78 @@ using FDK; -namespace OpenTaiko { - internal class CAct演奏スクロール速度 : CActivity { - // Properties +namespace OpenTaiko; - public double[] db現在の譜面スクロール速度 = new double[5]; +internal class CAct演奏スクロール速度 : CActivity { + // Properties + + public double[] db現在の譜面スクロール速度 = new double[5]; - // コンストラクタ + // コンストラクタ - public CAct演奏スクロール速度() { - base.IsDeActivated = true; - } - - - // CActivity 実装 - - public override void Activate() { - for (int i = 0; i < 5; i++) { - this.db現在の譜面スクロール速度[i] = (double)OpenTaiko.ConfigIni.nScrollSpeed[OpenTaiko.GetActualPlayer(i)]; - this.n速度変更制御タイマ[i] = -1; - } - - - - base.Activate(); - } - public override unsafe int Draw() { - if (!base.IsDeActivated) { - if (base.IsFirstDraw) { - //this.n速度変更制御タイマ.Drums = this.n速度変更制御タイマ.Guitar = this.n速度変更制御タイマ.Bass = (long)(CSound管理.rc演奏用タイマ.n現在時刻 * (((double)TJAPlayer3.ConfigIni.n演奏速度) / 20.0)); - for (int i = 0; i < 5; i++) { - this.n速度変更制御タイマ[i] = (long)(SoundManager.PlayTimer.NowTime * OpenTaiko.ConfigIni.SongPlaybackSpeed); - - } - - base.IsFirstDraw = false; - } - long n現在時刻 = SoundManager.PlayTimer.NowTime; - for (int i = 0; i < 5; i++) { - double db譜面スクロールスピード = (double)OpenTaiko.ConfigIni.nScrollSpeed[OpenTaiko.GetActualPlayer(i)]; - if (n現在時刻 < this.n速度変更制御タイマ[i]) { - this.n速度変更制御タイマ[i] = n現在時刻; - } - while ((n現在時刻 - this.n速度変更制御タイマ[i]) >= 2) // 2msに1回ループ - { - if (this.db現在の譜面スクロール速度[i] < db譜面スクロールスピード) // Config.iniのスクロール速度を変えると、それに追いつくように実画面のスクロール速度を変える - { - this.db現在の譜面スクロール速度[i] += 0.012; - - if (this.db現在の譜面スクロール速度[i] > db譜面スクロールスピード) { - this.db現在の譜面スクロール速度[i] = db譜面スクロールスピード; - } - } else if (this.db現在の譜面スクロール速度[i] > db譜面スクロールスピード) { - this.db現在の譜面スクロール速度[i] -= 0.012; - - if (this.db現在の譜面スクロール速度[i] < db譜面スクロールスピード) { - this.db現在の譜面スクロール速度[i] = db譜面スクロールスピード; - } - } - this.n速度変更制御タイマ[i] += 2; - } - } - } - return 0; - } - - - // その他 - - #region [ private ] - //----------------- - private long[] n速度変更制御タイマ = new long[5]; - //----------------- - #endregion + public CAct演奏スクロール速度() { + base.IsDeActivated = true; } + + + // CActivity 実装 + + public override void Activate() { + for (int i = 0; i < 5; i++) { + this.db現在の譜面スクロール速度[i] = (double)OpenTaiko.ConfigIni.nScrollSpeed[OpenTaiko.GetActualPlayer(i)]; + this.n速度変更制御タイマ[i] = -1; + } + + + + base.Activate(); + } + public override unsafe int Draw() { + if (!base.IsDeActivated) { + if (base.IsFirstDraw) { + //this.n速度変更制御タイマ.Drums = this.n速度変更制御タイマ.Guitar = this.n速度変更制御タイマ.Bass = (long)(CSound管理.rc演奏用タイマ.n現在時刻 * (((double)TJAPlayer3.ConfigIni.n演奏速度) / 20.0)); + for (int i = 0; i < 5; i++) { + this.n速度変更制御タイマ[i] = (long)(SoundManager.PlayTimer.NowTime * OpenTaiko.ConfigIni.SongPlaybackSpeed); + + } + + base.IsFirstDraw = false; + } + long n現在時刻 = SoundManager.PlayTimer.NowTime; + for (int i = 0; i < 5; i++) { + double db譜面スクロールスピード = (double)OpenTaiko.ConfigIni.nScrollSpeed[OpenTaiko.GetActualPlayer(i)]; + if (n現在時刻 < this.n速度変更制御タイマ[i]) { + this.n速度変更制御タイマ[i] = n現在時刻; + } + while ((n現在時刻 - this.n速度変更制御タイマ[i]) >= 2) // 2msに1回ループ + { + if (this.db現在の譜面スクロール速度[i] < db譜面スクロールスピード) // Config.iniのスクロール速度を変えると、それに追いつくように実画面のスクロール速度を変える + { + this.db現在の譜面スクロール速度[i] += 0.012; + + if (this.db現在の譜面スクロール速度[i] > db譜面スクロールスピード) { + this.db現在の譜面スクロール速度[i] = db譜面スクロールスピード; + } + } else if (this.db現在の譜面スクロール速度[i] > db譜面スクロールスピード) { + this.db現在の譜面スクロール速度[i] -= 0.012; + + if (this.db現在の譜面スクロール速度[i] < db譜面スクロールスピード) { + this.db現在の譜面スクロール速度[i] = db譜面スクロールスピード; + } + } + this.n速度変更制御タイマ[i] += 2; + } + } + } + return 0; + } + + + // その他 + + #region [ private ] + //----------------- + private long[] n速度変更制御タイマ = new long[5]; + //----------------- + #endregion } diff --git a/OpenTaiko/src/Stages/07.Game/CAct演奏スコア共通.cs b/OpenTaiko/src/Stages/07.Game/CAct演奏スコア共通.cs index 72edfe9a..3a02b945 100644 --- a/OpenTaiko/src/Stages/07.Game/CAct演奏スコア共通.cs +++ b/OpenTaiko/src/Stages/07.Game/CAct演奏スコア共通.cs @@ -2,347 +2,347 @@ using System.Runtime.InteropServices; using FDK; -namespace OpenTaiko { - internal class CAct演奏スコア共通 : CActivity { - // Properties +namespace OpenTaiko; - protected long[] nScoreIncrease; - protected double[] nCurrentRealScore; - protected long[] nCurrentlyDisplayedScore; - //protected CTexture txScore; +internal class CAct演奏スコア共通 : CActivity { + // Properties - // protected CTexture txScore_1P; - protected CCounter ctTimer; - public CCounter[] ct点数アニメタイマ; + protected long[] nScoreIncrease; + protected double[] nCurrentRealScore; + protected long[] nCurrentlyDisplayedScore; + //protected CTexture txScore; - public CCounter[] ctボーナス加算タイマ; + // protected CTexture txScore_1P; + protected CCounter ctTimer; + public CCounter[] ct点数アニメタイマ; - protected STスコア[] stScore; - protected int nNowDisplayedAddScore; + public CCounter[] ctボーナス加算タイマ; - [StructLayout(LayoutKind.Sequential)] - protected struct STスコア { - public bool bAddEnd; - public bool b使用中; - public bool b表示中; - public bool bBonusScore; - public CCounter ctTimer; - public int nAddScore; - public int nPlayer; - } + protected STスコア[] stScore; + protected int nNowDisplayedAddScore; - [StructLayout(LayoutKind.Sequential)] - private struct ST文字位置 { - public char ch; - public Point pt; - } - private ST文字位置[] stFont; + [StructLayout(LayoutKind.Sequential)] + protected struct STスコア { + public bool bAddEnd; + public bool b使用中; + public bool b表示中; + public bool bBonusScore; + public CCounter ctTimer; + public int nAddScore; + public int nPlayer; + } + + [StructLayout(LayoutKind.Sequential)] + private struct ST文字位置 { + public char ch; + public Point pt; + } + private ST文字位置[] stFont; - public long GetScore(int player) { - return nCurrentlyDisplayedScore[player]; - } + public long GetScore(int player) { + return nCurrentlyDisplayedScore[player]; + } - // コンストラクタ + // コンストラクタ - public CAct演奏スコア共通() { - ST文字位置[] st文字位置Array = new ST文字位置[11]; - ST文字位置 st文字位置 = new ST文字位置(); - st文字位置.ch = '0'; - st文字位置.pt = new Point(0, 0); - st文字位置Array[0] = st文字位置; - ST文字位置 st文字位置2 = new ST文字位置(); - st文字位置2.ch = '1'; - st文字位置2.pt = new Point(24, 0); - st文字位置Array[1] = st文字位置2; - ST文字位置 st文字位置3 = new ST文字位置(); - st文字位置3.ch = '2'; - st文字位置3.pt = new Point(48, 0); - st文字位置Array[2] = st文字位置3; - ST文字位置 st文字位置4 = new ST文字位置(); - st文字位置4.ch = '3'; - st文字位置4.pt = new Point(72, 0); - st文字位置Array[3] = st文字位置4; - ST文字位置 st文字位置5 = new ST文字位置(); - st文字位置5.ch = '4'; - st文字位置5.pt = new Point(96, 0); - st文字位置Array[4] = st文字位置5; - ST文字位置 st文字位置6 = new ST文字位置(); - st文字位置6.ch = '5'; - st文字位置6.pt = new Point(120, 0); - st文字位置Array[5] = st文字位置6; - ST文字位置 st文字位置7 = new ST文字位置(); - st文字位置7.ch = '6'; - st文字位置7.pt = new Point(144, 0); - st文字位置Array[6] = st文字位置7; - ST文字位置 st文字位置8 = new ST文字位置(); - st文字位置8.ch = '7'; - st文字位置8.pt = new Point(168, 0); - st文字位置Array[7] = st文字位置8; - ST文字位置 st文字位置9 = new ST文字位置(); - st文字位置9.ch = '8'; - st文字位置9.pt = new Point(192, 0); - st文字位置Array[8] = st文字位置9; - ST文字位置 st文字位置10 = new ST文字位置(); - st文字位置10.ch = '9'; - st文字位置10.pt = new Point(216, 0); - st文字位置Array[9] = st文字位置10; - this.stFont = st文字位置Array; + public CAct演奏スコア共通() { + ST文字位置[] st文字位置Array = new ST文字位置[11]; + ST文字位置 st文字位置 = new ST文字位置(); + st文字位置.ch = '0'; + st文字位置.pt = new Point(0, 0); + st文字位置Array[0] = st文字位置; + ST文字位置 st文字位置2 = new ST文字位置(); + st文字位置2.ch = '1'; + st文字位置2.pt = new Point(24, 0); + st文字位置Array[1] = st文字位置2; + ST文字位置 st文字位置3 = new ST文字位置(); + st文字位置3.ch = '2'; + st文字位置3.pt = new Point(48, 0); + st文字位置Array[2] = st文字位置3; + ST文字位置 st文字位置4 = new ST文字位置(); + st文字位置4.ch = '3'; + st文字位置4.pt = new Point(72, 0); + st文字位置Array[3] = st文字位置4; + ST文字位置 st文字位置5 = new ST文字位置(); + st文字位置5.ch = '4'; + st文字位置5.pt = new Point(96, 0); + st文字位置Array[4] = st文字位置5; + ST文字位置 st文字位置6 = new ST文字位置(); + st文字位置6.ch = '5'; + st文字位置6.pt = new Point(120, 0); + st文字位置Array[5] = st文字位置6; + ST文字位置 st文字位置7 = new ST文字位置(); + st文字位置7.ch = '6'; + st文字位置7.pt = new Point(144, 0); + st文字位置Array[6] = st文字位置7; + ST文字位置 st文字位置8 = new ST文字位置(); + st文字位置8.ch = '7'; + st文字位置8.pt = new Point(168, 0); + st文字位置Array[7] = st文字位置8; + ST文字位置 st文字位置9 = new ST文字位置(); + st文字位置9.ch = '8'; + st文字位置9.pt = new Point(192, 0); + st文字位置Array[8] = st文字位置9; + ST文字位置 st文字位置10 = new ST文字位置(); + st文字位置10.ch = '9'; + st文字位置10.pt = new Point(216, 0); + st文字位置Array[9] = st文字位置10; + this.stFont = st文字位置Array; - this.stScore = new STスコア[256]; - base.IsDeActivated = true; - } + this.stScore = new STスコア[256]; + base.IsDeActivated = true; + } - // メソッド + // メソッド - private float[,] n点数アニメ拡大率_座標 = new float[,] + private float[,] n点数アニメ拡大率_座標 = new float[,] { - { - 1.14f, - -5f - }, - { - 1.2f, - -6f - }, - { - 1.23f, - -8f - }, - { - 1.25f, - -9f - }, - { - 1.23f, - -8f - }, - { - 1.2f, - -6f - }, - { - 1.14f, - -5f - }, - { - 1.08f, - -4f - }, - { - 1.04f, - -2f - }, - { - 1.02f, - -1f - }, - { - 1.01f, - -1f - }, - { - 1f, - 0f - } - }; - - private float[] ScoreScale = new float[] { - 1f, - 1.050f, - 1.100f, - 1.110f, - 1.120f, - 1.125f, - 1.120f, - 1.080f, - 1.065f, - 1.030f, - 1.015f, - 1f - }; - - public double Get(int player) { - return this.nCurrentRealScore[player]; + 1.14f, + -5f + }, + { + 1.2f, + -6f + }, + { + 1.23f, + -8f + }, + { + 1.25f, + -9f + }, + { + 1.23f, + -8f + }, + { + 1.2f, + -6f + }, + { + 1.14f, + -5f + }, + { + 1.08f, + -4f + }, + { + 1.04f, + -2f + }, + { + 1.02f, + -1f + }, + { + 1.01f, + -1f + }, + { + 1f, + 0f } - public void Set(double nScore, int player) { - if (this.nCurrentRealScore[player] != nScore) { - this.nCurrentRealScore[player] = nScore; - this.nScoreIncrease[player] = (long)(((double)(this.nCurrentRealScore[player] - this.nCurrentlyDisplayedScore[player])) / 20.0); - if (this.nScoreIncrease[player] < 1L) { - this.nScoreIncrease[player] = 1L; + }; + + private float[] ScoreScale = new float[] + { + 1f, + 1.050f, + 1.100f, + 1.110f, + 1.120f, + 1.125f, + 1.120f, + 1.080f, + 1.065f, + 1.030f, + 1.015f, + 1f + }; + + public double Get(int player) { + return this.nCurrentRealScore[player]; + } + public void Set(double nScore, int player) { + if (this.nCurrentRealScore[player] != nScore) { + this.nCurrentRealScore[player] = nScore; + this.nScoreIncrease[player] = (long)(((double)(this.nCurrentRealScore[player] - this.nCurrentlyDisplayedScore[player])) / 20.0); + if (this.nScoreIncrease[player] < 1L) { + this.nScoreIncrease[player] = 1L; + } + } + + } + /// + /// 点数を加える(各種AUTO補正つき) + /// + /// + /// + /// + public void Add(long delta, int player) { + if (OpenTaiko.ConfigIni.bAIBattleMode && player == 1) return; + + double rev = 1.0; + + delta = (long)(delta * OpenTaiko.stageSongSelect.actPlayOption.tGetModMultiplier(CActPlayOption.EBalancingType.SCORE, false, player)); + + this.ctTimer = new CCounter(0, 400, 1, OpenTaiko.Timer); + + for (int sc = 0; sc < 1; sc++) { + for (int i = 0; i < 256; i++) { + if (this.stScore[i].b使用中 == false) { + this.stScore[i].b使用中 = true; + this.stScore[i].b表示中 = true; + this.stScore[i].nAddScore = (int)delta; + this.stScore[i].ctTimer = new CCounter(0, 465, 2, OpenTaiko.Timer); + this.stScore[i].bBonusScore = false; + this.stScore[i].bAddEnd = false; + this.stScore[i].nPlayer = player; + this.nNowDisplayedAddScore++; + break; } } - } - /// - /// 点数を加える(各種AUTO補正つき) - /// - /// - /// - /// - public void Add(long delta, int player) { - if (OpenTaiko.ConfigIni.bAIBattleMode && player == 1) return; - double rev = 1.0; + this.Set(this.Get(player) + delta * rev, player); + } - delta = (long)(delta * OpenTaiko.stageSongSelect.actPlayOption.tGetModMultiplier(CActPlayOption.EBalancingType.SCORE, false, player)); + public void BonusAdd(int player) { + if (OpenTaiko.ConfigIni.bAIBattleMode && player == 1) return; - this.ctTimer = new CCounter(0, 400, 1, OpenTaiko.Timer); + for (int sc = 0; sc < 1; sc++) { + for (int i = 0; i < 256; i++) { + if (this.stScore[i].b使用中 == false) { + this.stScore[i].b使用中 = true; + this.stScore[i].b表示中 = true; + this.stScore[i].nAddScore = 10000; + this.stScore[i].ctTimer = new CCounter(0, 100, 4, OpenTaiko.Timer); + this.stScore[i].bBonusScore = true; + this.stScore[i].bAddEnd = false; + this.stScore[i].nPlayer = player; + this.nNowDisplayedAddScore++; + break; + } + } + } - for (int sc = 0; sc < 1; sc++) { - for (int i = 0; i < 256; i++) { - if (this.stScore[i].b使用中 == false) { - this.stScore[i].b使用中 = true; - this.stScore[i].b表示中 = true; - this.stScore[i].nAddScore = (int)delta; - this.stScore[i].ctTimer = new CCounter(0, 465, 2, OpenTaiko.Timer); - this.stScore[i].bBonusScore = false; - this.stScore[i].bAddEnd = false; - this.stScore[i].nPlayer = player; - this.nNowDisplayedAddScore++; - break; + this.Set(this.Get(player) + 10000, player); + } + + // CActivity 実装 + + public override void Activate() { + this.nCurrentlyDisplayedScore = new long[5] { 0L, 0L, 0L, 0L, 0L }; + this.nCurrentRealScore = new double[5] { 0L, 0L, 0L, 0L, 0L }; + this.nScoreIncrease = new long[5] { 0L, 0L, 0L, 0L, 0L }; + + for (int sc = 0; sc < 256; sc++) { + this.stScore[sc].b使用中 = false; + this.stScore[sc].ctTimer = new CCounter(); + this.stScore[sc].nAddScore = 0; + this.stScore[sc].bBonusScore = false; + this.stScore[sc].bAddEnd = false; + } + + this.nNowDisplayedAddScore = 0; + + this.ctTimer = new CCounter(); + + this.ct点数アニメタイマ = new CCounter[5]; + for (int i = 0; i < 5; i++) { + this.ct点数アニメタイマ[i] = new CCounter(); + } + this.ctボーナス加算タイマ = new CCounter[5]; + for (int i = 0; i < 5; i++) { + this.ctボーナス加算タイマ[i] = new CCounter(); + } + base.Activate(); + } + public override void CreateManagedResource() { + //this.txScore = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\7_Score_number.png" ) ); + // this.txScore_1P = CDTXMania.tテクスチャの生成(CSkin.Path(@"Graphics\7_Score_number_1P.png")); + base.CreateManagedResource(); + } + public override void ReleaseManagedResource() { + //CDTXMania.tテクスチャの解放( ref this.txScore ); + // CDTXMania.tテクスチャの解放(ref this.txScore_1P); + base.ReleaseManagedResource(); + } + + protected void t小文字表示(int x, int y, string str, int mode, int alpha, int player) { + foreach (char ch in str) { + for (int i = 0; i < this.stFont.Length; i++) { + if (this.stFont[i].ch == ch) { + Rectangle rectangle = new Rectangle(OpenTaiko.Skin.Game_Score_Size[0] * i, 0, OpenTaiko.Skin.Game_Score_Size[0], OpenTaiko.Skin.Game_Score_Size[1]); + switch (mode) { + case 0: + if (OpenTaiko.Tx.Taiko_Score[0] != null) { + //this.txScore.color4 = new SlimDX.Color4( 1.0f, 1.0f, 1.0f ); + OpenTaiko.Tx.Taiko_Score[0].Opacity = alpha; + if (OpenTaiko.ConfigIni.SimpleMode) { + OpenTaiko.Tx.Taiko_Score[0].vcScaleRatio.Y = 1; + } else { + OpenTaiko.Tx.Taiko_Score[0].vcScaleRatio.Y = ScoreScale[this.ct点数アニメタイマ[player].CurrentValue]; + } + OpenTaiko.Tx.Taiko_Score[0].t2D拡大率考慮下基準描画(x, y, rectangle); + + } + break; + case 1: + if (OpenTaiko.Tx.Taiko_Score[1] != null) { + //this.txScore.color4 = new SlimDX.Color4( 1.0f, 0.5f, 0.4f ); + //this.txScore.color4 = CDTXMania.Skin.cScoreColor1P; + OpenTaiko.Tx.Taiko_Score[1].Opacity = alpha; + OpenTaiko.Tx.Taiko_Score[1].vcScaleRatio.Y = 1; + OpenTaiko.Tx.Taiko_Score[1].t2D拡大率考慮下基準描画(x, y, rectangle); + } + break; + case 2: + if (OpenTaiko.Tx.Taiko_Score[2] != null) { + //this.txScore.color4 = new SlimDX.Color4( 0.4f, 0.5f, 1.0f ); + //this.txScore.color4 = CDTXMania.Skin.cScoreColor2P; + OpenTaiko.Tx.Taiko_Score[2].Opacity = alpha; + OpenTaiko.Tx.Taiko_Score[2].vcScaleRatio.Y = 1; + OpenTaiko.Tx.Taiko_Score[2].t2D拡大率考慮下基準描画(x, y, rectangle); + } + break; + case 3: + if (OpenTaiko.Tx.Taiko_Score[3] != null) { + //this.txScore.color4 = new SlimDX.Color4( 0.4f, 0.5f, 1.0f ); + //this.txScore.color4 = CDTXMania.Skin.cScoreColor2P; + OpenTaiko.Tx.Taiko_Score[3].Opacity = alpha; + OpenTaiko.Tx.Taiko_Score[3].vcScaleRatio.Y = 1; + OpenTaiko.Tx.Taiko_Score[3].t2D拡大率考慮下基準描画(x, y, rectangle); + } + break; + case 4: + if (OpenTaiko.Tx.Taiko_Score[4] != null) { + //this.txScore.color4 = new SlimDX.Color4( 0.4f, 0.5f, 1.0f ); + //this.txScore.color4 = CDTXMania.Skin.cScoreColor2P; + OpenTaiko.Tx.Taiko_Score[4].Opacity = alpha; + OpenTaiko.Tx.Taiko_Score[4].vcScaleRatio.Y = 1; + OpenTaiko.Tx.Taiko_Score[4].t2D拡大率考慮下基準描画(x, y, rectangle); + } + break; + case 5: + if (OpenTaiko.Tx.Taiko_Score[5] != null) { + //this.txScore.color4 = new SlimDX.Color4( 0.4f, 0.5f, 1.0f ); + //this.txScore.color4 = CDTXMania.Skin.cScoreColor2P; + OpenTaiko.Tx.Taiko_Score[5].Opacity = alpha; + OpenTaiko.Tx.Taiko_Score[5].vcScaleRatio.Y = 1; + OpenTaiko.Tx.Taiko_Score[5].t2D拡大率考慮下基準描画(x, y, rectangle); + } + break; } + break; } } - - this.Set(this.Get(player) + delta * rev, player); - } - - public void BonusAdd(int player) { - if (OpenTaiko.ConfigIni.bAIBattleMode && player == 1) return; - - for (int sc = 0; sc < 1; sc++) { - for (int i = 0; i < 256; i++) { - if (this.stScore[i].b使用中 == false) { - this.stScore[i].b使用中 = true; - this.stScore[i].b表示中 = true; - this.stScore[i].nAddScore = 10000; - this.stScore[i].ctTimer = new CCounter(0, 100, 4, OpenTaiko.Timer); - this.stScore[i].bBonusScore = true; - this.stScore[i].bAddEnd = false; - this.stScore[i].nPlayer = player; - this.nNowDisplayedAddScore++; - break; - } - } - } - - this.Set(this.Get(player) + 10000, player); - } - - // CActivity 実装 - - public override void Activate() { - this.nCurrentlyDisplayedScore = new long[5] { 0L, 0L, 0L, 0L, 0L }; - this.nCurrentRealScore = new double[5] { 0L, 0L, 0L, 0L, 0L }; - this.nScoreIncrease = new long[5] { 0L, 0L, 0L, 0L, 0L }; - - for (int sc = 0; sc < 256; sc++) { - this.stScore[sc].b使用中 = false; - this.stScore[sc].ctTimer = new CCounter(); - this.stScore[sc].nAddScore = 0; - this.stScore[sc].bBonusScore = false; - this.stScore[sc].bAddEnd = false; - } - - this.nNowDisplayedAddScore = 0; - - this.ctTimer = new CCounter(); - - this.ct点数アニメタイマ = new CCounter[5]; - for (int i = 0; i < 5; i++) { - this.ct点数アニメタイマ[i] = new CCounter(); - } - this.ctボーナス加算タイマ = new CCounter[5]; - for (int i = 0; i < 5; i++) { - this.ctボーナス加算タイマ[i] = new CCounter(); - } - base.Activate(); - } - public override void CreateManagedResource() { - //this.txScore = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\7_Score_number.png" ) ); - // this.txScore_1P = CDTXMania.tテクスチャの生成(CSkin.Path(@"Graphics\7_Score_number_1P.png")); - base.CreateManagedResource(); - } - public override void ReleaseManagedResource() { - //CDTXMania.tテクスチャの解放( ref this.txScore ); - // CDTXMania.tテクスチャの解放(ref this.txScore_1P); - base.ReleaseManagedResource(); - } - - protected void t小文字表示(int x, int y, string str, int mode, int alpha, int player) { - foreach (char ch in str) { - for (int i = 0; i < this.stFont.Length; i++) { - if (this.stFont[i].ch == ch) { - Rectangle rectangle = new Rectangle(OpenTaiko.Skin.Game_Score_Size[0] * i, 0, OpenTaiko.Skin.Game_Score_Size[0], OpenTaiko.Skin.Game_Score_Size[1]); - switch (mode) { - case 0: - if (OpenTaiko.Tx.Taiko_Score[0] != null) { - //this.txScore.color4 = new SlimDX.Color4( 1.0f, 1.0f, 1.0f ); - OpenTaiko.Tx.Taiko_Score[0].Opacity = alpha; - if (OpenTaiko.ConfigIni.SimpleMode) { - OpenTaiko.Tx.Taiko_Score[0].vcScaleRatio.Y = 1; - } else { - OpenTaiko.Tx.Taiko_Score[0].vcScaleRatio.Y = ScoreScale[this.ct点数アニメタイマ[player].CurrentValue]; - } - OpenTaiko.Tx.Taiko_Score[0].t2D拡大率考慮下基準描画(x, y, rectangle); - - } - break; - case 1: - if (OpenTaiko.Tx.Taiko_Score[1] != null) { - //this.txScore.color4 = new SlimDX.Color4( 1.0f, 0.5f, 0.4f ); - //this.txScore.color4 = CDTXMania.Skin.cScoreColor1P; - OpenTaiko.Tx.Taiko_Score[1].Opacity = alpha; - OpenTaiko.Tx.Taiko_Score[1].vcScaleRatio.Y = 1; - OpenTaiko.Tx.Taiko_Score[1].t2D拡大率考慮下基準描画(x, y, rectangle); - } - break; - case 2: - if (OpenTaiko.Tx.Taiko_Score[2] != null) { - //this.txScore.color4 = new SlimDX.Color4( 0.4f, 0.5f, 1.0f ); - //this.txScore.color4 = CDTXMania.Skin.cScoreColor2P; - OpenTaiko.Tx.Taiko_Score[2].Opacity = alpha; - OpenTaiko.Tx.Taiko_Score[2].vcScaleRatio.Y = 1; - OpenTaiko.Tx.Taiko_Score[2].t2D拡大率考慮下基準描画(x, y, rectangle); - } - break; - case 3: - if (OpenTaiko.Tx.Taiko_Score[3] != null) { - //this.txScore.color4 = new SlimDX.Color4( 0.4f, 0.5f, 1.0f ); - //this.txScore.color4 = CDTXMania.Skin.cScoreColor2P; - OpenTaiko.Tx.Taiko_Score[3].Opacity = alpha; - OpenTaiko.Tx.Taiko_Score[3].vcScaleRatio.Y = 1; - OpenTaiko.Tx.Taiko_Score[3].t2D拡大率考慮下基準描画(x, y, rectangle); - } - break; - case 4: - if (OpenTaiko.Tx.Taiko_Score[4] != null) { - //this.txScore.color4 = new SlimDX.Color4( 0.4f, 0.5f, 1.0f ); - //this.txScore.color4 = CDTXMania.Skin.cScoreColor2P; - OpenTaiko.Tx.Taiko_Score[4].Opacity = alpha; - OpenTaiko.Tx.Taiko_Score[4].vcScaleRatio.Y = 1; - OpenTaiko.Tx.Taiko_Score[4].t2D拡大率考慮下基準描画(x, y, rectangle); - } - break; - case 5: - if (OpenTaiko.Tx.Taiko_Score[5] != null) { - //this.txScore.color4 = new SlimDX.Color4( 0.4f, 0.5f, 1.0f ); - //this.txScore.color4 = CDTXMania.Skin.cScoreColor2P; - OpenTaiko.Tx.Taiko_Score[5].Opacity = alpha; - OpenTaiko.Tx.Taiko_Score[5].vcScaleRatio.Y = 1; - OpenTaiko.Tx.Taiko_Score[5].t2D拡大率考慮下基準描画(x, y, rectangle); - } - break; - } - break; - } - } - x += OpenTaiko.Skin.Game_Score_Padding; - } + x += OpenTaiko.Skin.Game_Score_Padding; } } } diff --git a/OpenTaiko/src/Stages/07.Game/CAct演奏ステージ失敗.cs b/OpenTaiko/src/Stages/07.Game/CAct演奏ステージ失敗.cs index 0ffa1cc0..f921283c 100644 --- a/OpenTaiko/src/Stages/07.Game/CAct演奏ステージ失敗.cs +++ b/OpenTaiko/src/Stages/07.Game/CAct演奏ステージ失敗.cs @@ -2,254 +2,254 @@ using System.Runtime.InteropServices; using FDK; -namespace OpenTaiko { - internal class CAct演奏ステージ失敗 : CActivity { - // コンストラクタ +namespace OpenTaiko; - public CAct演奏ステージ失敗() { - ST文字位置[] st文字位置Array = new ST文字位置[11]; +internal class CAct演奏ステージ失敗 : CActivity { + // コンストラクタ - ST文字位置 st文字位置 = new ST文字位置(); - st文字位置.ch = '0'; - st文字位置.pt = new Point(0, 0); - st文字位置Array[0] = st文字位置; - ST文字位置 st文字位置2 = new ST文字位置(); - st文字位置2.ch = '1'; - st文字位置2.pt = new Point(62, 0); - st文字位置Array[1] = st文字位置2; - ST文字位置 st文字位置3 = new ST文字位置(); - st文字位置3.ch = '2'; - st文字位置3.pt = new Point(124, 0); - st文字位置Array[2] = st文字位置3; - ST文字位置 st文字位置4 = new ST文字位置(); - st文字位置4.ch = '3'; - st文字位置4.pt = new Point(186, 0); - st文字位置Array[3] = st文字位置4; - ST文字位置 st文字位置5 = new ST文字位置(); - st文字位置5.ch = '4'; - st文字位置5.pt = new Point(248, 0); - st文字位置Array[4] = st文字位置5; - ST文字位置 st文字位置6 = new ST文字位置(); - st文字位置6.ch = '5'; - st文字位置6.pt = new Point(310, 0); - st文字位置Array[5] = st文字位置6; - ST文字位置 st文字位置7 = new ST文字位置(); - st文字位置7.ch = '6'; - st文字位置7.pt = new Point(372, 0); - st文字位置Array[6] = st文字位置7; - ST文字位置 st文字位置8 = new ST文字位置(); - st文字位置8.ch = '7'; - st文字位置8.pt = new Point(434, 0); - st文字位置Array[7] = st文字位置8; - ST文字位置 st文字位置9 = new ST文字位置(); - st文字位置9.ch = '8'; - st文字位置9.pt = new Point(496, 0); - st文字位置Array[8] = st文字位置9; - ST文字位置 st文字位置10 = new ST文字位置(); - st文字位置10.ch = '9'; - st文字位置10.pt = new Point(558, 0); - st文字位置Array[9] = st文字位置10; - ST文字位置 st文字位置11 = new ST文字位置(); - st文字位置11.ch = '%'; - st文字位置11.pt = new Point(558 + 62, 0); - st文字位置Array[10] = st文字位置11; - this.st文字位置 = st文字位置Array; - base.IsDeActivated = true; + public CAct演奏ステージ失敗() { + ST文字位置[] st文字位置Array = new ST文字位置[11]; + + ST文字位置 st文字位置 = new ST文字位置(); + st文字位置.ch = '0'; + st文字位置.pt = new Point(0, 0); + st文字位置Array[0] = st文字位置; + ST文字位置 st文字位置2 = new ST文字位置(); + st文字位置2.ch = '1'; + st文字位置2.pt = new Point(62, 0); + st文字位置Array[1] = st文字位置2; + ST文字位置 st文字位置3 = new ST文字位置(); + st文字位置3.ch = '2'; + st文字位置3.pt = new Point(124, 0); + st文字位置Array[2] = st文字位置3; + ST文字位置 st文字位置4 = new ST文字位置(); + st文字位置4.ch = '3'; + st文字位置4.pt = new Point(186, 0); + st文字位置Array[3] = st文字位置4; + ST文字位置 st文字位置5 = new ST文字位置(); + st文字位置5.ch = '4'; + st文字位置5.pt = new Point(248, 0); + st文字位置Array[4] = st文字位置5; + ST文字位置 st文字位置6 = new ST文字位置(); + st文字位置6.ch = '5'; + st文字位置6.pt = new Point(310, 0); + st文字位置Array[5] = st文字位置6; + ST文字位置 st文字位置7 = new ST文字位置(); + st文字位置7.ch = '6'; + st文字位置7.pt = new Point(372, 0); + st文字位置Array[6] = st文字位置7; + ST文字位置 st文字位置8 = new ST文字位置(); + st文字位置8.ch = '7'; + st文字位置8.pt = new Point(434, 0); + st文字位置Array[7] = st文字位置8; + ST文字位置 st文字位置9 = new ST文字位置(); + st文字位置9.ch = '8'; + st文字位置9.pt = new Point(496, 0); + st文字位置Array[8] = st文字位置9; + ST文字位置 st文字位置10 = new ST文字位置(); + st文字位置10.ch = '9'; + st文字位置10.pt = new Point(558, 0); + st文字位置Array[9] = st文字位置10; + ST文字位置 st文字位置11 = new ST文字位置(); + st文字位置11.ch = '%'; + st文字位置11.pt = new Point(558 + 62, 0); + st文字位置Array[10] = st文字位置11; + this.st文字位置 = st文字位置Array; + base.IsDeActivated = true; + } + + + // メソッド + + public void Start() { + this.dbFailedTime = OpenTaiko.Timer.NowTime; + this.ct進行 = new CCounter(0, 300, 22, OpenTaiko.Timer); + if (OpenTaiko.ConfigIni.eGameMode != EGame.Off) { + this.ct進行 = new CCounter(0, 4000, 2, OpenTaiko.Timer); } + } - // メソッド + // CActivity 実装 - public void Start() { - this.dbFailedTime = OpenTaiko.Timer.NowTime; - this.ct進行 = new CCounter(0, 300, 22, OpenTaiko.Timer); - if (OpenTaiko.ConfigIni.eGameMode != EGame.Off) { - this.ct進行 = new CCounter(0, 4000, 2, OpenTaiko.Timer); - } - } - - - // CActivity 実装 - - public override void Activate() { + public override void Activate() { + this.sd効果音 = null; + this.b効果音再生済み = false; + this.ct進行 = new CCounter(); + base.Activate(); + } + public override void DeActivate() { + this.ct進行 = null; + if (this.sd効果音 != null) { + OpenTaiko.SoundManager.tDisposeSound(this.sd効果音); this.sd効果音 = null; - this.b効果音再生済み = false; - this.ct進行 = new CCounter(); - base.Activate(); - } - public override void DeActivate() { - this.ct進行 = null; - if (this.sd効果音 != null) { - OpenTaiko.SoundManager.tDisposeSound(this.sd効果音); - this.sd効果音 = null; - } - base.DeActivate(); - } - public override void CreateManagedResource() { - this.failedSongPlayed = false; - // this.txBlack = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\Tile black 64x64.png" ) ); - //this.txStageFailed = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\7_stage_failed.jpg" ) ); - //this.txGameFailed = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\7_GameFailed.png" ) ); - // this.tx数字 = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\7_RollNumber.png" ) ); - this.soundFailed = OpenTaiko.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}Failed.ogg"), ESoundGroup.SoundEffect); - base.CreateManagedResource(); - } - public override void ReleaseManagedResource() { - //CDTXMania.tテクスチャの解放( ref this.txStageFailed ); - //CDTXMania.tテクスチャの解放( ref this.txGameFailed ); - // CDTXMania.tテクスチャの解放( ref this.txBlack ); - // CDTXMania.tテクスチャの解放( ref this.tx数字 ); - if (this.soundFailed != null) - this.soundFailed.tDispose(); - base.ReleaseManagedResource(); } + base.DeActivate(); + } + public override void CreateManagedResource() { + this.failedSongPlayed = false; + // this.txBlack = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\Tile black 64x64.png" ) ); + //this.txStageFailed = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\7_stage_failed.jpg" ) ); + //this.txGameFailed = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\7_GameFailed.png" ) ); + // this.tx数字 = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\7_RollNumber.png" ) ); + this.soundFailed = OpenTaiko.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}Failed.ogg"), ESoundGroup.SoundEffect); + base.CreateManagedResource(); + } + public override void ReleaseManagedResource() { + //CDTXMania.tテクスチャの解放( ref this.txStageFailed ); + //CDTXMania.tテクスチャの解放( ref this.txGameFailed ); + // CDTXMania.tテクスチャの解放( ref this.txBlack ); + // CDTXMania.tテクスチャの解放( ref this.tx数字 ); + if (this.soundFailed != null) + this.soundFailed.tDispose(); + base.ReleaseManagedResource(); + } - #region [Effect] + #region [Effect] - private void showEndEffect_Failed(int i) { - int[] y = new int[] { 0, 176 }; + private void showEndEffect_Failed(int i) { + int[] y = new int[] { 0, 176 }; + } + + #endregion + + public override int Draw() { + if (base.IsDeActivated) { + return 0; } + if ((this.ct進行 == null) || this.ct進行.IsStoped) { + return 0; + } + this.ct進行.Tick(); + + #region [Failed screen] + + if (this.soundFailed != null && !this.failedSongPlayed) { + this.soundFailed.PlayStart(); + this.failedSongPlayed = true; + } + this.showEndEffect_Failed(0); #endregion - public override int Draw() { - if (base.IsDeActivated) { - return 0; - } - if ((this.ct進行 == null) || this.ct進行.IsStoped) { - return 0; - } - this.ct進行.Tick(); + /* - #region [Failed screen] - - if (this.soundFailed != null && !this.failedSongPlayed) { - this.soundFailed.PlayStart(); - this.failedSongPlayed = true; - } - this.showEndEffect_Failed(0); - - #endregion - - /* - - if (TJAPlayer3.ConfigIni.eGameMode == EGame.完走叩ききりまショー || TJAPlayer3.ConfigIni.eGameMode == EGame.完走叩ききりまショー激辛) + if (TJAPlayer3.ConfigIni.eGameMode == EGame.完走叩ききりまショー || TJAPlayer3.ConfigIni.eGameMode == EGame.完走叩ききりまショー激辛) + { + if (TJAPlayer3.Tx.Tile_Black != null) { - if (TJAPlayer3.Tx.Tile_Black != null) + for (int i = 0; i <= (SampleFramework.GameWindowSize.Width / 64); i++) { - for (int i = 0; i <= (SampleFramework.GameWindowSize.Width / 64); i++) + for (int j = 0; j <= (SampleFramework.GameWindowSize.Height / 64); j++) { - for (int j = 0; j <= (SampleFramework.GameWindowSize.Height / 64); j++) - { - TJAPlayer3.Tx.Tile_Black.t2D描画(i * 64, j * 64); - } + TJAPlayer3.Tx.Tile_Black.t2D描画(i * 64, j * 64); } } - if (this.ct進行.n現在の値 > 1500) + } + if (this.ct進行.n現在の値 > 1500) + { + if (TJAPlayer3.Tx.Failed_Game != null) + TJAPlayer3.Tx.Failed_Game.t2D描画(0, 0); + + int num = (TJAPlayer3.DTX.listChip.Count > 0) ? TJAPlayer3.DTX.listChip[TJAPlayer3.DTX.listChip.Count - 1].n発声時刻ms : 0; + this.t文字表示(640, 520, (((this.dbFailedTime) / 1000.0) / (((double)num) / 1000.0) * 100).ToString("##0") + "%"); + } + + //int num = ( CDTXMania.DTX.listChip.Count > 0 ) ? CDTXMania.DTX.listChip[ CDTXMania.DTX.listChip.Count - 1 ].n発声時刻ms : 0; + //string str = "Time: " + ( ( ( this.dbFailedTime ) / 1000.0 ) ).ToString( "####0.00" ) + " / " + ( ( ( ( double ) num ) / 1000.0 ) ).ToString( "####0.00" ); + //CDTXMania.act文字コンソール.tPrint( 0, 0, C文字コンソール.Eフォント種別.白, str ); + + } + else + { + if (this.ct進行.n現在の値 < 100) + { + int x = (int)(640.0 * Math.Cos((Math.PI / 2 * this.ct進行.n現在の値) / 100.0)); + if ((x != 640) && (TJAPlayer3.Tx.Failed_Stage != null)) { - if (TJAPlayer3.Tx.Failed_Game != null) - TJAPlayer3.Tx.Failed_Game.t2D描画(0, 0); - - int num = (TJAPlayer3.DTX.listChip.Count > 0) ? TJAPlayer3.DTX.listChip[TJAPlayer3.DTX.listChip.Count - 1].n発声時刻ms : 0; - this.t文字表示(640, 520, (((this.dbFailedTime) / 1000.0) / (((double)num) / 1000.0) * 100).ToString("##0") + "%"); + TJAPlayer3.Tx.Failed_Stage.t2D描画(0, 0, new Rectangle(x, 0, 640 - x, 720)); + TJAPlayer3.Tx.Failed_Stage.t2D描画(640 + x, 0, new Rectangle(640, 0, 640 - x, 720)); } - - //int num = ( CDTXMania.DTX.listChip.Count > 0 ) ? CDTXMania.DTX.listChip[ CDTXMania.DTX.listChip.Count - 1 ].n発声時刻ms : 0; - //string str = "Time: " + ( ( ( this.dbFailedTime ) / 1000.0 ) ).ToString( "####0.00" ) + " / " + ( ( ( ( double ) num ) / 1000.0 ) ).ToString( "####0.00" ); - //CDTXMania.act文字コンソール.tPrint( 0, 0, C文字コンソール.Eフォント種別.白, str ); - } else { - if (this.ct進行.n現在の値 < 100) + if (TJAPlayer3.Tx.Failed_Stage != null) { - int x = (int)(640.0 * Math.Cos((Math.PI / 2 * this.ct進行.n現在の値) / 100.0)); - if ((x != 640) && (TJAPlayer3.Tx.Failed_Stage != null)) - { - TJAPlayer3.Tx.Failed_Stage.t2D描画(0, 0, new Rectangle(x, 0, 640 - x, 720)); - TJAPlayer3.Tx.Failed_Stage.t2D描画(640 + x, 0, new Rectangle(640, 0, 640 - x, 720)); - } + TJAPlayer3.Tx.Failed_Stage.t2D描画(0, 0); } - else + if (this.ct進行.n現在の値 <= 250) { + int num2 = TJAPlayer3.Random.Next(5) - 2; + int y = TJAPlayer3.Random.Next(5) - 2; if (TJAPlayer3.Tx.Failed_Stage != null) { - TJAPlayer3.Tx.Failed_Stage.t2D描画(0, 0); - } - if (this.ct進行.n現在の値 <= 250) - { - int num2 = TJAPlayer3.Random.Next(5) - 2; - int y = TJAPlayer3.Random.Next(5) - 2; - if (TJAPlayer3.Tx.Failed_Stage != null) - { - TJAPlayer3.Tx.Failed_Stage.t2D描画(num2, y); - } - } - if (!this.b効果音再生済み) - { - TJAPlayer3.Skin.soundSTAGEFAILED音.t再生する(); - this.b効果音再生済み = true; + TJAPlayer3.Tx.Failed_Stage.t2D描画(num2, y); } } + if (!this.b効果音再生済み) + { + TJAPlayer3.Skin.soundSTAGEFAILED音.t再生する(); + this.b効果音再生済み = true; + } } + } - */ + */ - if (!this.ct進行.IsEnded) { - return 0; - } - return 1; + if (!this.ct進行.IsEnded) { + return 0; } - - - // その他 - - #region [ private ] - //----------------- - private bool b効果音再生済み; - private CCounter ct進行; - private CSound sd効果音; - - private bool failedSongPlayed; - private CSound soundFailed; - //private CTexture txStageFailed; - // private CTexture txGameFailed; - // private CTexture txBlack; - // private CTexture tx数字; - private double dbFailedTime; - //----------------- - private ST文字位置[] st文字位置; - - [StructLayout(LayoutKind.Sequential)] - public struct ST文字位置 { - public char ch; - public Point pt; - public ST文字位置(char ch, Point pt) { - this.ch = ch; - this.pt = pt; - } - } - - private void t文字表示(int x, int y, string str) { - foreach (char ch in str) { - for (int i = 0; i < this.st文字位置.Length; i++) { - if (this.st文字位置[i].ch == ch) { - Rectangle rectangle = new Rectangle(this.st文字位置[i].pt.X, this.st文字位置[i].pt.Y, 62, 80); - if (ch == '%') { - rectangle.Width = 80; - } - if (OpenTaiko.Tx.Balloon_Number_Roll != null) { - OpenTaiko.Tx.Balloon_Number_Roll.t2D描画(x - (62 * str.Length / 2), y, rectangle); - } - break; - } - } - x += 62; - } - } - - - #endregion + return 1; } + + + // その他 + + #region [ private ] + //----------------- + private bool b効果音再生済み; + private CCounter ct進行; + private CSound sd効果音; + + private bool failedSongPlayed; + private CSound soundFailed; + //private CTexture txStageFailed; + // private CTexture txGameFailed; + // private CTexture txBlack; + // private CTexture tx数字; + private double dbFailedTime; + //----------------- + private ST文字位置[] st文字位置; + + [StructLayout(LayoutKind.Sequential)] + public struct ST文字位置 { + public char ch; + public Point pt; + public ST文字位置(char ch, Point pt) { + this.ch = ch; + this.pt = pt; + } + } + + private void t文字表示(int x, int y, string str) { + foreach (char ch in str) { + for (int i = 0; i < this.st文字位置.Length; i++) { + if (this.st文字位置[i].ch == ch) { + Rectangle rectangle = new Rectangle(this.st文字位置[i].pt.X, this.st文字位置[i].pt.Y, 62, 80); + if (ch == '%') { + rectangle.Width = 80; + } + if (OpenTaiko.Tx.Balloon_Number_Roll != null) { + OpenTaiko.Tx.Balloon_Number_Roll.t2D描画(x - (62 * str.Length / 2), y, rectangle); + } + break; + } + } + x += 62; + } + } + + + #endregion } diff --git a/OpenTaiko/src/Stages/07.Game/CAct演奏パネル文字列.cs b/OpenTaiko/src/Stages/07.Game/CAct演奏パネル文字列.cs index 65a91f00..d4b693e9 100644 --- a/OpenTaiko/src/Stages/07.Game/CAct演奏パネル文字列.cs +++ b/OpenTaiko/src/Stages/07.Game/CAct演奏パネル文字列.cs @@ -4,207 +4,238 @@ using SkiaSharp; using static OpenTaiko.CActSelect曲リスト; using Color = System.Drawing.Color; -namespace OpenTaiko { +namespace OpenTaiko; - internal class CAct演奏パネル文字列 : CActivity { - public static int tToArgb(int r, int g, int b) { - return (b * 65536 + g * 256 + r); - } +internal class CAct演奏パネル文字列 : CActivity { + public static int tToArgb(int r, int g, int b) { + return (b * 65536 + g * 256 + r); + } - // コンストラクタ - public CAct演奏パネル文字列() { - base.IsDeActivated = true; - this.Start(); - } + // コンストラクタ + public CAct演奏パネル文字列() { + base.IsDeActivated = true; + this.Start(); + } - private readonly Dictionary tTagDict = new Dictionary { - ["アニメ"] = new Color4(tToArgb(253, 145, 208)), - ["Anime"] = new Color4(tToArgb(253, 145, 208)), - ["クラシック"] = new Color4(tToArgb(221, 172, 4)), - ["Classical"] = new Color4(tToArgb(221, 172, 4)), - ["バラエティ"] = new Color4(tToArgb(32, 218, 56)), - ["Variety"] = new Color4(tToArgb(32, 218, 56)), - ["どうよう"] = new Color4(tToArgb(254, 191, 3)), - ["キッズ"] = new Color4(tToArgb(254, 191, 3)), - ["Children & Folk"] = new Color4(tToArgb(254, 191, 3)), - ["ボーカロイド"] = new Color4(tToArgb(204, 207, 222)), - ["VOCALOID"] = new Color4(tToArgb(204, 207, 222)), - ["Vocaloid"] = new Color4(tToArgb(204, 207, 222)), - ["ゲームミュージック"] = new Color4(tToArgb(205, 138, 237)), - ["ゲームバラエティ"] = new Color4(tToArgb(205, 138, 237)), - ["Game Music"] = new Color4(tToArgb(205, 138, 237)), - ["J-POP"] = new Color4(tToArgb(68, 192, 209)), - ["POP"] = new Color4(tToArgb(68, 192, 209)), - ["ナムコオリジナル"] = new Color4(tToArgb(255, 70, 28)), - ["OpenTaikoオリジナル"] = new Color4(tToArgb(249, 255, 40)), - ["OpenTaiko Original"] = new Color4(tToArgb(249, 255, 40)), - ["ポップス"] = new Color4(tToArgb(68, 192, 209)), - ["太鼓タワー"] = new Color4(tToArgb(254, 191, 3)), - ["Taiko Towers"] = new Color4(tToArgb(254, 191, 3)), // Temporary, will use CLang - ["段位道場"] = new Color4(tToArgb(42, 122, 169)), - }; + private readonly Dictionary tTagDict = new Dictionary { + ["アニメ"] = new Color4(tToArgb(253, 145, 208)), + ["Anime"] = new Color4(tToArgb(253, 145, 208)), + ["クラシック"] = new Color4(tToArgb(221, 172, 4)), + ["Classical"] = new Color4(tToArgb(221, 172, 4)), + ["バラエティ"] = new Color4(tToArgb(32, 218, 56)), + ["Variety"] = new Color4(tToArgb(32, 218, 56)), + ["どうよう"] = new Color4(tToArgb(254, 191, 3)), + ["キッズ"] = new Color4(tToArgb(254, 191, 3)), + ["Children & Folk"] = new Color4(tToArgb(254, 191, 3)), + ["ボーカロイド"] = new Color4(tToArgb(204, 207, 222)), + ["VOCALOID"] = new Color4(tToArgb(204, 207, 222)), + ["Vocaloid"] = new Color4(tToArgb(204, 207, 222)), + ["ゲームミュージック"] = new Color4(tToArgb(205, 138, 237)), + ["ゲームバラエティ"] = new Color4(tToArgb(205, 138, 237)), + ["Game Music"] = new Color4(tToArgb(205, 138, 237)), + ["J-POP"] = new Color4(tToArgb(68, 192, 209)), + ["POP"] = new Color4(tToArgb(68, 192, 209)), + ["ナムコオリジナル"] = new Color4(tToArgb(255, 70, 28)), + ["OpenTaikoオリジナル"] = new Color4(tToArgb(249, 255, 40)), + ["OpenTaiko Original"] = new Color4(tToArgb(249, 255, 40)), + ["ポップス"] = new Color4(tToArgb(68, 192, 209)), + ["太鼓タワー"] = new Color4(tToArgb(254, 191, 3)), + ["Taiko Towers"] = new Color4(tToArgb(254, 191, 3)), // Temporary, will use CLang + ["段位道場"] = new Color4(tToArgb(42, 122, 169)), + }; - // メソッド + // メソッド - /// - /// 右上の曲名、曲数表示の更新を行います。 - /// - /// 曲名 - /// ジャンル名 - /// 曲数 - public void SetPanelString(string songName, string genreName, string stageText = null, CSongListNode songNode = null) { - if (base.IsActivated) { - OpenTaiko.tテクスチャの解放(ref this.txPanel); - if ((songName != null) && (songName.Length > 0)) { - try { - using (var bmpSongTitle = pfMusicName.DrawText(songName, OpenTaiko.Skin.Game_MusicName_ForeColor, OpenTaiko.Skin.Game_MusicName_BackColor, null, 30)) { - this.txMusicName = OpenTaiko.tテクスチャの生成(bmpSongTitle, false); - } - if (txMusicName != null) { - this.txMusicName.vcScaleRatio.X = OpenTaiko.GetSongNameXScaling(ref txMusicName); - } - - SKBitmap bmpDiff; - string strDiff = ""; - if (OpenTaiko.Skin.eDiffDispMode == EDifficultyDisplayType.TextOnNthSong) { - switch (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0]) { - case 0: - strDiff = "かんたん "; - break; - case 1: - strDiff = "ふつう "; - break; - case 2: - strDiff = "むずかしい "; - break; - case 3: - strDiff = "おに "; - break; - case 4: - strDiff = "えでぃと "; - break; - default: - strDiff = "おに "; - break; - } - bmpDiff = pfMusicName.DrawText(strDiff + stageText, OpenTaiko.Skin.Game_StageText_ForeColor, OpenTaiko.Skin.Game_StageText_BackColor, null, 30); - } else { - bmpDiff = pfMusicName.DrawText(stageText, OpenTaiko.Skin.Game_StageText_ForeColor, OpenTaiko.Skin.Game_StageText_BackColor, null, 30); - } - - using (bmpDiff) { - txStage = OpenTaiko.Tx.TxCGen("Songs"); - } - } catch (CTextureCreateFailedException e) { - Trace.TraceError(e.ToString()); - Trace.TraceError("パネル文字列テクスチャの生成に失敗しました。"); - this.txPanel = null; + /// + /// 右上の曲名、曲数表示の更新を行います。 + /// + /// 曲名 + /// ジャンル名 + /// 曲数 + public void SetPanelString(string songName, string genreName, string stageText = null, CSongListNode songNode = null) { + if (base.IsActivated) { + OpenTaiko.tテクスチャの解放(ref this.txPanel); + if ((songName != null) && (songName.Length > 0)) { + try { + using (var bmpSongTitle = pfMusicName.DrawText(songName, OpenTaiko.Skin.Game_MusicName_ForeColor, OpenTaiko.Skin.Game_MusicName_BackColor, null, 30)) { + this.txMusicName = OpenTaiko.tテクスチャの生成(bmpSongTitle, false); + } + if (txMusicName != null) { + this.txMusicName.vcScaleRatio.X = OpenTaiko.GetSongNameXScaling(ref txMusicName); } - } - this.txGENRE = OpenTaiko.Tx.TxCGen("Template"); + SKBitmap bmpDiff; + string strDiff = ""; + if (OpenTaiko.Skin.eDiffDispMode == EDifficultyDisplayType.TextOnNthSong) { + switch (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0]) { + case 0: + strDiff = "かんたん "; + break; + case 1: + strDiff = "ふつう "; + break; + case 2: + strDiff = "むずかしい "; + break; + case 3: + strDiff = "おに "; + break; + case 4: + strDiff = "えでぃと "; + break; + default: + strDiff = "おに "; + break; + } + bmpDiff = pfMusicName.DrawText(strDiff + stageText, OpenTaiko.Skin.Game_StageText_ForeColor, OpenTaiko.Skin.Game_StageText_BackColor, null, 30); + } else { + bmpDiff = pfMusicName.DrawText(stageText, OpenTaiko.Skin.Game_StageText_ForeColor, OpenTaiko.Skin.Game_StageText_BackColor, null, 30); + } - Color stageColor = Color.White; - if (songNode != null && songNode.isChangedBoxColor) - stageColor = songNode.BoxColor; - - if (!(songNode != null && songNode.isChangedBoxColor) - && tTagDict != null - && tTagDict.ContainsKey(genreName)) { - this.txGENRE.color4 = tTagDict[genreName]; - } else if (genreName == CLangManager.LangInstance.GetString("TITLE_MODE_DAN")) { - this.txGENRE.color4 = tTagDict["段位道場"]; - } else { - this.txGENRE.color4 = CConversion.ColorToColor4(stageColor); - } - - pfGENRE = HPrivateFastFont.tInstantiateBoxFont(OpenTaiko.Skin.Game_GenreText_FontSize); - - this.ttkGENRE = new TitleTextureKey(genreName, this.pfGENRE, Color.White, Color.Black, 1000); - - this.ct進行用 = new CCounter(0, 2000, 2, OpenTaiko.Timer); - this.Start(); - - - - } - } - - public void t歌詞テクスチャを生成する(SKBitmap bmplyric) { - OpenTaiko.tDisposeSafely(ref this.tx歌詞テクスチャ); - this.tx歌詞テクスチャ = OpenTaiko.tテクスチャの生成(bmplyric); - } - public void t歌詞テクスチャを削除する() { - OpenTaiko.tテクスチャの解放(ref this.tx歌詞テクスチャ); - } - /// - /// レイヤー管理のため、On進行描画から分離。 - /// - public void t歌詞テクスチャを描画する() { - if (this.tx歌詞テクスチャ != null) { - if (OpenTaiko.Skin.Game_Lyric_ReferencePoint == CSkin.ReferencePoint.Left) { - this.tx歌詞テクスチャ.t2D描画(OpenTaiko.Skin.Game_Lyric_X, OpenTaiko.Skin.Game_Lyric_Y - (this.tx歌詞テクスチャ.szTextureSize.Height)); - } else if (OpenTaiko.Skin.Game_Lyric_ReferencePoint == CSkin.ReferencePoint.Right) { - this.tx歌詞テクスチャ.t2D描画(OpenTaiko.Skin.Game_Lyric_X - this.tx歌詞テクスチャ.szTextureSize.Width, OpenTaiko.Skin.Game_Lyric_Y - (this.tx歌詞テクスチャ.szTextureSize.Height)); - } else { - this.tx歌詞テクスチャ.t2D描画(OpenTaiko.Skin.Game_Lyric_X - (this.tx歌詞テクスチャ.szTextureSize.Width / 2), OpenTaiko.Skin.Game_Lyric_Y - (this.tx歌詞テクスチャ.szTextureSize.Height)); + using (bmpDiff) { + txStage = OpenTaiko.Tx.TxCGen("Songs"); + } + } catch (CTextureCreateFailedException e) { + Trace.TraceError(e.ToString()); + Trace.TraceError("パネル文字列テクスチャの生成に失敗しました。"); + this.txPanel = null; } } - } - public void Stop() { - this.bMute = true; - } - public void Start() { - this.bMute = false; - } + this.txGENRE = OpenTaiko.Tx.TxCGen("Template"); + Color stageColor = Color.White; + if (songNode != null && songNode.isChangedBoxColor) + stageColor = songNode.BoxColor; - // CActivity 実装 + if (!(songNode != null && songNode.isChangedBoxColor) + && tTagDict != null + && tTagDict.ContainsKey(genreName)) { + this.txGENRE.color4 = tTagDict[genreName]; + } else if (genreName == CLangManager.LangInstance.GetString("TITLE_MODE_DAN")) { + this.txGENRE.color4 = tTagDict["段位道場"]; + } else { + this.txGENRE.color4 = CConversion.ColorToColor4(stageColor); + } - public override void Activate() { - this.pfMusicName = HPrivateFastFont.tInstantiateMainFont(OpenTaiko.Skin.Game_MusicName_FontSize); - this.txPanel = null; - this.ct進行用 = new CCounter(); + pfGENRE = HPrivateFastFont.tInstantiateBoxFont(OpenTaiko.Skin.Game_GenreText_FontSize); + + this.ttkGENRE = new TitleTextureKey(genreName, this.pfGENRE, Color.White, Color.Black, 1000); + + this.ct進行用 = new CCounter(0, 2000, 2, OpenTaiko.Timer); this.Start(); - this.bFirst = true; - base.Activate(); - } - public override void DeActivate() { - this.ct進行用 = null; - OpenTaiko.tDisposeSafely(ref this.txPanel); - OpenTaiko.tDisposeSafely(ref this.txMusicName); - OpenTaiko.tDisposeSafely(ref this.txGENRE); - OpenTaiko.tDisposeSafely(ref this.pfGENRE); - OpenTaiko.tDisposeSafely(ref this.txPanel); - OpenTaiko.tDisposeSafely(ref this.pfMusicName); - OpenTaiko.tDisposeSafely(ref this.pf歌詞フォント); - OpenTaiko.tDisposeSafely(ref this.tx歌詞テクスチャ); - base.DeActivate(); - } - public override void CreateManagedResource() { - base.CreateManagedResource(); - } - public override void ReleaseManagedResource() { - base.ReleaseManagedResource(); - } - public override int Draw() { - throw new InvalidOperationException("t進行描画(x,y)のほうを使用してください。"); - } - public int t進行描画(int x, int y) { - if (OpenTaiko.stage演奏ドラム画面.actDan.IsAnimating || OpenTaiko.ConfigIni.nPlayerCount > 2) return 0; - if (!base.IsDeActivated && !this.bMute) { - this.ct進行用.TickLoop(); - if (this.txGENRE != null) { - this.txGENRE.t2D描画(OpenTaiko.Skin.Game_Genre_X, OpenTaiko.Skin.Game_Genre_Y); - TitleTextureKey.ResolveTitleTexture(this.ttkGENRE).t2D拡大率考慮中央基準描画(OpenTaiko.Skin.Game_Genre_X + OpenTaiko.Skin.Game_GenreText_Offset[0], OpenTaiko.Skin.Game_Genre_Y + OpenTaiko.Skin.Game_GenreText_Offset[1]); + + + } + } + + public void t歌詞テクスチャを生成する(SKBitmap bmplyric) { + OpenTaiko.tDisposeSafely(ref this.tx歌詞テクスチャ); + this.tx歌詞テクスチャ = OpenTaiko.tテクスチャの生成(bmplyric); + } + public void t歌詞テクスチャを削除する() { + OpenTaiko.tテクスチャの解放(ref this.tx歌詞テクスチャ); + } + /// + /// レイヤー管理のため、On進行描画から分離。 + /// + public void t歌詞テクスチャを描画する() { + if (this.tx歌詞テクスチャ != null) { + if (OpenTaiko.Skin.Game_Lyric_ReferencePoint == CSkin.ReferencePoint.Left) { + this.tx歌詞テクスチャ.t2D描画(OpenTaiko.Skin.Game_Lyric_X, OpenTaiko.Skin.Game_Lyric_Y - (this.tx歌詞テクスチャ.szTextureSize.Height)); + } else if (OpenTaiko.Skin.Game_Lyric_ReferencePoint == CSkin.ReferencePoint.Right) { + this.tx歌詞テクスチャ.t2D描画(OpenTaiko.Skin.Game_Lyric_X - this.tx歌詞テクスチャ.szTextureSize.Width, OpenTaiko.Skin.Game_Lyric_Y - (this.tx歌詞テクスチャ.szTextureSize.Height)); + } else { + this.tx歌詞テクスチャ.t2D描画(OpenTaiko.Skin.Game_Lyric_X - (this.tx歌詞テクスチャ.szTextureSize.Width / 2), OpenTaiko.Skin.Game_Lyric_Y - (this.tx歌詞テクスチャ.szTextureSize.Height)); + } + } + } + + public void Stop() { + this.bMute = true; + } + public void Start() { + this.bMute = false; + } + + + // CActivity 実装 + + public override void Activate() { + this.pfMusicName = HPrivateFastFont.tInstantiateMainFont(OpenTaiko.Skin.Game_MusicName_FontSize); + this.txPanel = null; + this.ct進行用 = new CCounter(); + this.Start(); + this.bFirst = true; + base.Activate(); + } + public override void DeActivate() { + this.ct進行用 = null; + OpenTaiko.tDisposeSafely(ref this.txPanel); + OpenTaiko.tDisposeSafely(ref this.txMusicName); + OpenTaiko.tDisposeSafely(ref this.txGENRE); + OpenTaiko.tDisposeSafely(ref this.pfGENRE); + OpenTaiko.tDisposeSafely(ref this.txPanel); + OpenTaiko.tDisposeSafely(ref this.pfMusicName); + OpenTaiko.tDisposeSafely(ref this.pf歌詞フォント); + OpenTaiko.tDisposeSafely(ref this.tx歌詞テクスチャ); + base.DeActivate(); + } + public override void CreateManagedResource() { + base.CreateManagedResource(); + } + public override void ReleaseManagedResource() { + base.ReleaseManagedResource(); + } + public override int Draw() { + throw new InvalidOperationException("t進行描画(x,y)のほうを使用してください。"); + } + public int t進行描画(int x, int y) { + if (OpenTaiko.stage演奏ドラム画面.actDan.IsAnimating || OpenTaiko.ConfigIni.nPlayerCount > 2) return 0; + if (!base.IsDeActivated && !this.bMute) { + this.ct進行用.TickLoop(); + + if (this.txGENRE != null) { + this.txGENRE.t2D描画(OpenTaiko.Skin.Game_Genre_X, OpenTaiko.Skin.Game_Genre_Y); + TitleTextureKey.ResolveTitleTexture(this.ttkGENRE).t2D拡大率考慮中央基準描画(OpenTaiko.Skin.Game_Genre_X + OpenTaiko.Skin.Game_GenreText_Offset[0], OpenTaiko.Skin.Game_Genre_Y + OpenTaiko.Skin.Game_GenreText_Offset[1]); + } + if (this.txStage != null) + this.txStage.t2D描画(OpenTaiko.Skin.Game_Genre_X, OpenTaiko.Skin.Game_Genre_Y); + + if (OpenTaiko.Skin.b現在のステージ数を表示しない) { + if (this.txMusicName != null) { + float fRate = (float)OpenTaiko.Skin.Game_MusicName_MaxWidth / this.txMusicName.szTextureSize.Width; + if (this.txMusicName.szTextureSize.Width <= OpenTaiko.Skin.Game_MusicName_MaxWidth) + fRate = 1.0f; + + this.txMusicName.vcScaleRatio.X = fRate; + + this.txMusicName.t2D描画(OpenTaiko.Skin.Game_MusicName_X - (this.txMusicName.szTextureSize.Width * fRate), OpenTaiko.Skin.Game_MusicName_Y); } - if (this.txStage != null) - this.txStage.t2D描画(OpenTaiko.Skin.Game_Genre_X, OpenTaiko.Skin.Game_Genre_Y); + } else { + #region[ 透明度制御 ] - if (OpenTaiko.Skin.b現在のステージ数を表示しない) { + if (this.ct進行用.CurrentValue < 745) { + if (this.txStage != null) + this.txStage.Opacity = 0; + } else if (this.ct進行用.CurrentValue >= 745 && this.ct進行用.CurrentValue < 1000) { + if (this.txStage != null) + this.txStage.Opacity = (this.ct進行用.CurrentValue - 745); + } else if (this.ct進行用.CurrentValue >= 1000 && this.ct進行用.CurrentValue <= 1745) { + if (this.txStage != null) + this.txStage.Opacity = 255; + } else if (this.ct進行用.CurrentValue >= 1745) { + if (this.txStage != null) + this.txStage.Opacity = 255 - (this.ct進行用.CurrentValue - 1745); + } + #endregion + + if (this.txMusicName != null) { + if (this.IsFirstDraw) { + IsFirstDraw = false; + } if (this.txMusicName != null) { float fRate = (float)OpenTaiko.Skin.Game_MusicName_MaxWidth / this.txMusicName.szTextureSize.Width; if (this.txMusicName.szTextureSize.Width <= OpenTaiko.Skin.Game_MusicName_MaxWidth) @@ -214,76 +245,43 @@ namespace OpenTaiko { this.txMusicName.t2D描画(OpenTaiko.Skin.Game_MusicName_X - (this.txMusicName.szTextureSize.Width * fRate), OpenTaiko.Skin.Game_MusicName_Y); } - } else { - #region[ 透明度制御 ] - - if (this.ct進行用.CurrentValue < 745) { - if (this.txStage != null) - this.txStage.Opacity = 0; - } else if (this.ct進行用.CurrentValue >= 745 && this.ct進行用.CurrentValue < 1000) { - if (this.txStage != null) - this.txStage.Opacity = (this.ct進行用.CurrentValue - 745); - } else if (this.ct進行用.CurrentValue >= 1000 && this.ct進行用.CurrentValue <= 1745) { - if (this.txStage != null) - this.txStage.Opacity = 255; - } else if (this.ct進行用.CurrentValue >= 1745) { - if (this.txStage != null) - this.txStage.Opacity = 255 - (this.ct進行用.CurrentValue - 1745); - } - #endregion - - if (this.txMusicName != null) { - if (this.IsFirstDraw) { - IsFirstDraw = false; - } - if (this.txMusicName != null) { - float fRate = (float)OpenTaiko.Skin.Game_MusicName_MaxWidth / this.txMusicName.szTextureSize.Width; - if (this.txMusicName.szTextureSize.Width <= OpenTaiko.Skin.Game_MusicName_MaxWidth) - fRate = 1.0f; - - this.txMusicName.vcScaleRatio.X = fRate; - - this.txMusicName.t2D描画(OpenTaiko.Skin.Game_MusicName_X - (this.txMusicName.szTextureSize.Width * fRate), OpenTaiko.Skin.Game_MusicName_Y); - } - } } - - //CDTXMania.act文字コンソール.tPrint( 0, 0, C文字コンソール.Eフォント種別.白, this.ct進行用.n現在の値.ToString() ); - - //this.txMusicName.t2D描画( CDTXMania.app.Device, 1250 - this.txMusicName.szテクスチャサイズ.Width, 14 ); } - return 0; + + //CDTXMania.act文字コンソール.tPrint( 0, 0, C文字コンソール.Eフォント種別.白, this.ct進行用.n現在の値.ToString() ); + + //this.txMusicName.t2D描画( CDTXMania.app.Device, 1250 - this.txMusicName.szテクスチャサイズ.Width, 14 ); } - - public enum ESongType { - REGULAR, - DAN, - TOWER, - BOSS, - TOTAL, - } - - - // その他 - - #region [ private ] - //----------------- - private CCounter ct進行用; - - private CTexture txPanel; - private bool bMute; - private bool bFirst; - - private CTexture txMusicName; - private CTexture txStage; - private CTexture txGENRE; - private CCachedFontRenderer pfGENRE; - private TitleTextureKey ttkGENRE; - private CTexture tx歌詞テクスチャ; - private CCachedFontRenderer pfMusicName; - private CCachedFontRenderer pf歌詞フォント; - //----------------- - #endregion + return 0; } -} + public enum ESongType { + REGULAR, + DAN, + TOWER, + BOSS, + TOTAL, + } + + + // その他 + + #region [ private ] + //----------------- + private CCounter ct進行用; + + private CTexture txPanel; + private bool bMute; + private bool bFirst; + + private CTexture txMusicName; + private CTexture txStage; + private CTexture txGENRE; + private CCachedFontRenderer pfGENRE; + private TitleTextureKey ttkGENRE; + private CTexture tx歌詞テクスチャ; + private CCachedFontRenderer pfMusicName; + private CCachedFontRenderer pf歌詞フォント; + //----------------- + #endregion +} diff --git a/OpenTaiko/src/Stages/07.Game/CAct演奏演奏情報.cs b/OpenTaiko/src/Stages/07.Game/CAct演奏演奏情報.cs index 4388942d..78cbe199 100644 --- a/OpenTaiko/src/Stages/07.Game/CAct演奏演奏情報.cs +++ b/OpenTaiko/src/Stages/07.Game/CAct演奏演奏情報.cs @@ -1,92 +1,92 @@ using FDK; -namespace OpenTaiko { - internal class CAct演奏演奏情報 : CActivity { - // Properties +namespace OpenTaiko; - public double[] dbBPM = new double[5]; - public readonly int[] NowMeasure = new int[5]; - public double dbSCROLL; - public int[] _chipCounts = new int[2]; +internal class CAct演奏演奏情報 : CActivity { + // Properties - // コンストラクタ + public double[] dbBPM = new double[5]; + public readonly int[] NowMeasure = new int[5]; + public double dbSCROLL; + public int[] _chipCounts = new int[2]; - public CAct演奏演奏情報() { - base.IsDeActivated = true; - } + // コンストラクタ - - // CActivity 実装 - - public override void Activate() { - for (int i = 0; i < 5; i++) { - NowMeasure[i] = 0; - this.dbBPM[i] = OpenTaiko.DTX.BASEBPM; - } - this.dbSCROLL = 1.0; - - _chipCounts[0] = OpenTaiko.DTX.listChip.Where(num => NotesManager.IsMissableNote(num)).Count(); - _chipCounts[1] = OpenTaiko.DTX.listChip_Branch[2].Where(num => NotesManager.IsMissableNote(num)).Count(); - - NotesTextN = string.Format("NoteN: {0:####0}", OpenTaiko.DTX.nノーツ数_Branch[0]); - NotesTextE = string.Format("NoteE: {0:####0}", OpenTaiko.DTX.nノーツ数_Branch[1]); - NotesTextM = string.Format("NoteM: {0:####0}", OpenTaiko.DTX.nノーツ数_Branch[2]); - NotesTextC = string.Format("NoteC: {0:####0}", OpenTaiko.DTX.nノーツ数[3]); - ScoreModeText = string.Format("SCOREMODE: {0:####0}", OpenTaiko.DTX.nScoreModeTmp); - ListChipText = string.Format("ListChip: {0:####0}", _chipCounts[0]); - ListChipMText = string.Format("ListChipM: {0:####0}", _chipCounts[1]); - - base.Activate(); - } - public override int Draw() { - throw new InvalidOperationException("t進行描画(int x, int y) のほうを使用してください。"); - } - public void t進行描画(int x, int y) { - if (!base.IsDeActivated) { - y += 0x153; - OpenTaiko.actTextConsole.Print(x, y, CTextConsole.EFontType.White, string.Format("Song/G. Offset:{0:####0}/{1:####0} ms", OpenTaiko.DTX.nBGMAdjust, OpenTaiko.ConfigIni.nGlobalOffsetMs)); - y -= 0x10; - int num = (OpenTaiko.DTX.listChip.Count > 0) ? OpenTaiko.DTX.listChip[OpenTaiko.DTX.listChip.Count - 1].n発声時刻ms : 0; - string str = "Time: " + ((((double)(SoundManager.PlayTimer.NowTime * OpenTaiko.ConfigIni.SongPlaybackSpeed)) / 1000.0)).ToString("####0.00") + " / " + ((((double)num) / 1000.0)).ToString("####0.00"); - OpenTaiko.actTextConsole.Print(x, y, CTextConsole.EFontType.White, str); - y -= 0x10; - OpenTaiko.actTextConsole.Print(x, y, CTextConsole.EFontType.White, string.Format("Part: {0:####0}/{1:####0}", NowMeasure[0], NowMeasure[1])); - y -= 0x10; - OpenTaiko.actTextConsole.Print(x, y, CTextConsole.EFontType.White, string.Format("BPM: {0:####0.0000}", this.dbBPM[0])); - y -= 0x10; - OpenTaiko.actTextConsole.Print(x, y, CTextConsole.EFontType.White, string.Format("Frame: {0:####0} fps", OpenTaiko.FPS.NowFPS)); - y -= 0x10; - OpenTaiko.actTextConsole.Print(x, y, CTextConsole.EFontType.White, NotesTextN); - y -= 0x10; - OpenTaiko.actTextConsole.Print(x, y, CTextConsole.EFontType.White, NotesTextE); - y -= 0x10; - OpenTaiko.actTextConsole.Print(x, y, CTextConsole.EFontType.White, NotesTextM); - y -= 0x10; - OpenTaiko.actTextConsole.Print(x, y, CTextConsole.EFontType.White, NotesTextC); - y -= 0x10; - OpenTaiko.actTextConsole.Print(x, y, CTextConsole.EFontType.White, string.Format("SCROLL: {0:####0.00}", this.dbSCROLL)); - y -= 0x10; - OpenTaiko.actTextConsole.Print(x, y, CTextConsole.EFontType.White, ScoreModeText); - y -= 0x10; - OpenTaiko.actTextConsole.Print(x, y, CTextConsole.EFontType.White, ListChipText); - y -= 0x10; - OpenTaiko.actTextConsole.Print(x, y, CTextConsole.EFontType.White, ListChipMText); - - //CDTXMania.act文字コンソール.tPrint( x, y, C文字コンソール.Eフォント種別.白, string.Format( "Sound CPU : {0:####0.00}%", CDTXMania.Sound管理.GetCPUusage() ) ); - //y -= 0x10; - //CDTXMania.act文字コンソール.tPrint( x, y, C文字コンソール.Eフォント種別.白, string.Format( "Sound Mixing: {0:####0}", CDTXMania.Sound管理.GetMixingStreams() ) ); - //y -= 0x10; - //CDTXMania.act文字コンソール.tPrint( x, y, C文字コンソール.Eフォント種別.白, string.Format( "Sound Streams: {0:####0}", CDTXMania.Sound管理.GetStreams() ) ); - //y -= 0x10; - } - } - - private string NotesTextN; - private string NotesTextE; - private string NotesTextM; - private string NotesTextC; - private string ScoreModeText; - private string ListChipText; - private string ListChipMText; + public CAct演奏演奏情報() { + base.IsDeActivated = true; } + + + // CActivity 実装 + + public override void Activate() { + for (int i = 0; i < 5; i++) { + NowMeasure[i] = 0; + this.dbBPM[i] = OpenTaiko.DTX.BASEBPM; + } + this.dbSCROLL = 1.0; + + _chipCounts[0] = OpenTaiko.DTX.listChip.Where(num => NotesManager.IsMissableNote(num)).Count(); + _chipCounts[1] = OpenTaiko.DTX.listChip_Branch[2].Where(num => NotesManager.IsMissableNote(num)).Count(); + + NotesTextN = string.Format("NoteN: {0:####0}", OpenTaiko.DTX.nノーツ数_Branch[0]); + NotesTextE = string.Format("NoteE: {0:####0}", OpenTaiko.DTX.nノーツ数_Branch[1]); + NotesTextM = string.Format("NoteM: {0:####0}", OpenTaiko.DTX.nノーツ数_Branch[2]); + NotesTextC = string.Format("NoteC: {0:####0}", OpenTaiko.DTX.nノーツ数[3]); + ScoreModeText = string.Format("SCOREMODE: {0:####0}", OpenTaiko.DTX.nScoreModeTmp); + ListChipText = string.Format("ListChip: {0:####0}", _chipCounts[0]); + ListChipMText = string.Format("ListChipM: {0:####0}", _chipCounts[1]); + + base.Activate(); + } + public override int Draw() { + throw new InvalidOperationException("t進行描画(int x, int y) のほうを使用してください。"); + } + public void t進行描画(int x, int y) { + if (!base.IsDeActivated) { + y += 0x153; + OpenTaiko.actTextConsole.Print(x, y, CTextConsole.EFontType.White, string.Format("Song/G. Offset:{0:####0}/{1:####0} ms", OpenTaiko.DTX.nBGMAdjust, OpenTaiko.ConfigIni.nGlobalOffsetMs)); + y -= 0x10; + int num = (OpenTaiko.DTX.listChip.Count > 0) ? OpenTaiko.DTX.listChip[OpenTaiko.DTX.listChip.Count - 1].n発声時刻ms : 0; + string str = "Time: " + ((((double)(SoundManager.PlayTimer.NowTime * OpenTaiko.ConfigIni.SongPlaybackSpeed)) / 1000.0)).ToString("####0.00") + " / " + ((((double)num) / 1000.0)).ToString("####0.00"); + OpenTaiko.actTextConsole.Print(x, y, CTextConsole.EFontType.White, str); + y -= 0x10; + OpenTaiko.actTextConsole.Print(x, y, CTextConsole.EFontType.White, string.Format("Part: {0:####0}/{1:####0}", NowMeasure[0], NowMeasure[1])); + y -= 0x10; + OpenTaiko.actTextConsole.Print(x, y, CTextConsole.EFontType.White, string.Format("BPM: {0:####0.0000}", this.dbBPM[0])); + y -= 0x10; + OpenTaiko.actTextConsole.Print(x, y, CTextConsole.EFontType.White, string.Format("Frame: {0:####0} fps", OpenTaiko.FPS.NowFPS)); + y -= 0x10; + OpenTaiko.actTextConsole.Print(x, y, CTextConsole.EFontType.White, NotesTextN); + y -= 0x10; + OpenTaiko.actTextConsole.Print(x, y, CTextConsole.EFontType.White, NotesTextE); + y -= 0x10; + OpenTaiko.actTextConsole.Print(x, y, CTextConsole.EFontType.White, NotesTextM); + y -= 0x10; + OpenTaiko.actTextConsole.Print(x, y, CTextConsole.EFontType.White, NotesTextC); + y -= 0x10; + OpenTaiko.actTextConsole.Print(x, y, CTextConsole.EFontType.White, string.Format("SCROLL: {0:####0.00}", this.dbSCROLL)); + y -= 0x10; + OpenTaiko.actTextConsole.Print(x, y, CTextConsole.EFontType.White, ScoreModeText); + y -= 0x10; + OpenTaiko.actTextConsole.Print(x, y, CTextConsole.EFontType.White, ListChipText); + y -= 0x10; + OpenTaiko.actTextConsole.Print(x, y, CTextConsole.EFontType.White, ListChipMText); + + //CDTXMania.act文字コンソール.tPrint( x, y, C文字コンソール.Eフォント種別.白, string.Format( "Sound CPU : {0:####0.00}%", CDTXMania.Sound管理.GetCPUusage() ) ); + //y -= 0x10; + //CDTXMania.act文字コンソール.tPrint( x, y, C文字コンソール.Eフォント種別.白, string.Format( "Sound Mixing: {0:####0}", CDTXMania.Sound管理.GetMixingStreams() ) ); + //y -= 0x10; + //CDTXMania.act文字コンソール.tPrint( x, y, C文字コンソール.Eフォント種別.白, string.Format( "Sound Streams: {0:####0}", CDTXMania.Sound管理.GetStreams() ) ); + //y -= 0x10; + } + } + + private string NotesTextN; + private string NotesTextE; + private string NotesTextM; + private string NotesTextC; + private string ScoreModeText; + private string ListChipText; + private string ListChipMText; } diff --git a/OpenTaiko/src/Stages/07.Game/CFloorManagement.cs b/OpenTaiko/src/Stages/07.Game/CFloorManagement.cs index a1b072f1..7bc54ce3 100644 --- a/OpenTaiko/src/Stages/07.Game/CFloorManagement.cs +++ b/OpenTaiko/src/Stages/07.Game/CFloorManagement.cs @@ -1,58 +1,58 @@ using FDK; -namespace OpenTaiko { - // Small static class which refers to the Tower mode important informations - static internal class CFloorManagement { - public static void reinitialize(int life) { - CFloorManagement.LastRegisteredFloor = 1; - CFloorManagement.MaxNumberOfLives = life; - CFloorManagement.CurrentNumberOfLives = life; - CFloorManagement.InvincibilityFrames = null; - } +namespace OpenTaiko; - public static void reload() { - CFloorManagement.LastRegisteredFloor = 1; - CFloorManagement.CurrentNumberOfLives = CFloorManagement.MaxNumberOfLives; - CFloorManagement.InvincibilityFrames = null; - } - - public static void damage() { - if (CFloorManagement.InvincibilityFrames != null && CFloorManagement.InvincibilityFrames.CurrentValue < CFloorManagement.InvincibilityDurationSpeedDependent) - return; - - if (CFloorManagement.CurrentNumberOfLives > 0) { - CFloorManagement.InvincibilityFrames = new CCounter(0, CFloorManagement.InvincibilityDurationSpeedDependent + 1000, 1, OpenTaiko.Timer); - CFloorManagement.CurrentNumberOfLives--; - //TJAPlayer3.Skin.soundTowerMiss.t再生する(); - OpenTaiko.Skin.voiceTowerMiss[OpenTaiko.SaveFile]?.tPlay(); - } - } - - public static bool isBlinking() { - if (CFloorManagement.InvincibilityFrames == null || CFloorManagement.InvincibilityFrames.CurrentValue >= CFloorManagement.InvincibilityDurationSpeedDependent) - return false; - - if (CFloorManagement.InvincibilityFrames.CurrentValue % 200 > 100) - return false; - - return true; - } - - public static void loopFrames() { - if (CFloorManagement.InvincibilityFrames != null) - CFloorManagement.InvincibilityFrames.Tick(); - } - - public static int LastRegisteredFloor = 1; - public static int MaxNumberOfLives = 5; - public static int CurrentNumberOfLives = 5; - - public static double InvincibilityDurationSpeedDependent { - get => ((double)InvincibilityDuration) / OpenTaiko.ConfigIni.SongPlaybackSpeed; - } - - // ms - public static readonly int InvincibilityDuration = 2000; - public static CCounter InvincibilityFrames = null; +// Small static class which refers to the Tower mode important informations +static internal class CFloorManagement { + public static void reinitialize(int life) { + CFloorManagement.LastRegisteredFloor = 1; + CFloorManagement.MaxNumberOfLives = life; + CFloorManagement.CurrentNumberOfLives = life; + CFloorManagement.InvincibilityFrames = null; } + + public static void reload() { + CFloorManagement.LastRegisteredFloor = 1; + CFloorManagement.CurrentNumberOfLives = CFloorManagement.MaxNumberOfLives; + CFloorManagement.InvincibilityFrames = null; + } + + public static void damage() { + if (CFloorManagement.InvincibilityFrames != null && CFloorManagement.InvincibilityFrames.CurrentValue < CFloorManagement.InvincibilityDurationSpeedDependent) + return; + + if (CFloorManagement.CurrentNumberOfLives > 0) { + CFloorManagement.InvincibilityFrames = new CCounter(0, CFloorManagement.InvincibilityDurationSpeedDependent + 1000, 1, OpenTaiko.Timer); + CFloorManagement.CurrentNumberOfLives--; + //TJAPlayer3.Skin.soundTowerMiss.t再生する(); + OpenTaiko.Skin.voiceTowerMiss[OpenTaiko.SaveFile]?.tPlay(); + } + } + + public static bool isBlinking() { + if (CFloorManagement.InvincibilityFrames == null || CFloorManagement.InvincibilityFrames.CurrentValue >= CFloorManagement.InvincibilityDurationSpeedDependent) + return false; + + if (CFloorManagement.InvincibilityFrames.CurrentValue % 200 > 100) + return false; + + return true; + } + + public static void loopFrames() { + if (CFloorManagement.InvincibilityFrames != null) + CFloorManagement.InvincibilityFrames.Tick(); + } + + public static int LastRegisteredFloor = 1; + public static int MaxNumberOfLives = 5; + public static int CurrentNumberOfLives = 5; + + public static double InvincibilityDurationSpeedDependent { + get => ((double)InvincibilityDuration) / OpenTaiko.ConfigIni.SongPlaybackSpeed; + } + + // ms + public static readonly int InvincibilityDuration = 2000; + public static CCounter InvincibilityFrames = null; } diff --git a/OpenTaiko/src/Stages/07.Game/CInvisibleChip.cs b/OpenTaiko/src/Stages/07.Game/CInvisibleChip.cs index 146fb2b8..510a2881 100644 --- a/OpenTaiko/src/Stages/07.Game/CInvisibleChip.cs +++ b/OpenTaiko/src/Stages/07.Game/CInvisibleChip.cs @@ -1,168 +1,168 @@ using FDK; -namespace OpenTaiko { - public class CInvisibleChip : IDisposable { - /// ミス後表示する時間(ms) - public int nDisplayTimeMs { - get; - set; - } - /// 表示期間終了後、フェードアウトする時間 - public int nFadeoutTimeMs { - get; - set; - } - /// 楽器ごとのInvisibleモード - public STDGBVALUE eInvisibleMode; +namespace OpenTaiko; + +public class CInvisibleChip : IDisposable { + /// ミス後表示する時間(ms) + public int nDisplayTimeMs { + get; + set; + } + /// 表示期間終了後、フェードアウトする時間 + public int nFadeoutTimeMs { + get; + set; + } + /// 楽器ごとのInvisibleモード + public STDGBVALUE eInvisibleMode; - #region [ コンストラクタ ] - public CInvisibleChip() { - Initialize(3000, 2000); - } - /// - /// コンストラクタ - /// - /// ミス時再表示する時間(秒) - /// 再表示後フェードアウトする時間(秒) - public CInvisibleChip(int _nDisplayTimeMs, int _nFadeoutTimeMs) { - Initialize(_nDisplayTimeMs, _nFadeoutTimeMs); - } - private void Initialize(int _nDisplayTimeMs, int _nFadeoutTimeMs) { - nDisplayTimeMs = _nDisplayTimeMs; - nFadeoutTimeMs = _nFadeoutTimeMs; - Reset(); - } - #endregion + #region [ コンストラクタ ] + public CInvisibleChip() { + Initialize(3000, 2000); + } + /// + /// コンストラクタ + /// + /// ミス時再表示する時間(秒) + /// 再表示後フェードアウトする時間(秒) + public CInvisibleChip(int _nDisplayTimeMs, int _nFadeoutTimeMs) { + Initialize(_nDisplayTimeMs, _nFadeoutTimeMs); + } + private void Initialize(int _nDisplayTimeMs, int _nFadeoutTimeMs) { + nDisplayTimeMs = _nDisplayTimeMs; + nFadeoutTimeMs = _nFadeoutTimeMs; + Reset(); + } + #endregion - /// - /// 内部状態を初期化する - /// - public void Reset() { - for (int i = 0; i < 5; i++) { - ccounter[i] = new CCounter(); - b演奏チップが1つでもバーを通過した[i] = false; + /// + /// 内部状態を初期化する + /// + public void Reset() { + for (int i = 0; i < 5; i++) { + ccounter[i] = new CCounter(); + b演奏チップが1つでもバーを通過した[i] = false; + } + } + + /// + /// まだSemi-Invisibleを開始していなければ、開始する + /// + /// + public void StartSemiInvisible(EInstrumentPad eInst) { + int nInst = (int)eInst; + if (!b演奏チップが1つでもバーを通過した[nInst]) { + b演奏チップが1つでもバーを通過した[nInst] = true; + if (this.eInvisibleMode[nInst] == EInvisible.Semi) { + ShowChipTemporally(eInst); + ccounter[nInst].CurrentValue = nDisplayTimeMs; } } + } + /// + /// 一時的にチップを表示するモードを開始する + /// + /// 楽器パート + public void ShowChipTemporally(EInstrumentPad eInst) { + ccounter[(int)eInst].Start(0, nDisplayTimeMs + nFadeoutTimeMs + 1, 1, OpenTaiko.Timer); + } - /// - /// まだSemi-Invisibleを開始していなければ、開始する - /// - /// - public void StartSemiInvisible(EInstrumentPad eInst) { - int nInst = (int)eInst; - if (!b演奏チップが1つでもバーを通過した[nInst]) { - b演奏チップが1つでもバーを通過した[nInst] = true; - if (this.eInvisibleMode[nInst] == EInvisible.Semi) { - ShowChipTemporally(eInst); - ccounter[nInst].CurrentValue = nDisplayTimeMs; - } - } - } - /// - /// 一時的にチップを表示するモードを開始する - /// - /// 楽器パート - public void ShowChipTemporally(EInstrumentPad eInst) { - ccounter[(int)eInst].Start(0, nDisplayTimeMs + nFadeoutTimeMs + 1, 1, OpenTaiko.Timer); + /// + /// チップの表示/非表示の状態 + /// + public enum EChipInvisibleState { + SHOW, // Missなどしてチップを表示中 + FADEOUT, // 表示期間終了後、フェードアウト中 + INVISIBLE // 完全非表示 + } + + internal EChipInvisibleState SetInvisibleStatus(ref CDTX.CChip cc) { + if (cc.e楽器パート == EInstrumentPad.Unknown) { + return EChipInvisibleState.SHOW; } + int nInst = (int)cc.e楽器パート; + EChipInvisibleState retcode = EChipInvisibleState.SHOW; - /// - /// チップの表示/非表示の状態 - /// - public enum EChipInvisibleState { - SHOW, // Missなどしてチップを表示中 - FADEOUT, // 表示期間終了後、フェードアウト中 - INVISIBLE // 完全非表示 - } + ccounter[nInst].Tick(); - internal EChipInvisibleState SetInvisibleStatus(ref CDTX.CChip cc) { - if (cc.e楽器パート == EInstrumentPad.Unknown) { - return EChipInvisibleState.SHOW; - } - int nInst = (int)cc.e楽器パート; - EChipInvisibleState retcode = EChipInvisibleState.SHOW; + switch (eInvisibleMode[nInst]) { + case EInvisible.Off: + cc.b可視 = true; + retcode = EChipInvisibleState.SHOW; + break; - ccounter[nInst].Tick(); + case EInvisible.Full: + cc.b可視 = false; + retcode = EChipInvisibleState.INVISIBLE; + break; - switch (eInvisibleMode[nInst]) { - case EInvisible.Off: + case EInvisible.Semi: + if (!b演奏チップが1つでもバーを通過した[nInst]) // まだ1つもチップがバーを通過していない時は、チップを表示する + { cc.b可視 = true; - retcode = EChipInvisibleState.SHOW; - break; + cc.n透明度 = 255; + return EChipInvisibleState.SHOW; + } - case EInvisible.Full: + if (ccounter[nInst].CurrentValue <= 0 || ccounter[nInst].CurrentValue > nDisplayTimeMs + nFadeoutTimeMs) + // まだ一度もMissっていない or フェードアウトしきった後 + { cc.b可視 = false; + cc.n透明度 = 255; retcode = EChipInvisibleState.INVISIBLE; - break; - - case EInvisible.Semi: - if (!b演奏チップが1つでもバーを通過した[nInst]) // まだ1つもチップがバーを通過していない時は、チップを表示する - { - cc.b可視 = true; - cc.n透明度 = 255; - return EChipInvisibleState.SHOW; - } - - if (ccounter[nInst].CurrentValue <= 0 || ccounter[nInst].CurrentValue > nDisplayTimeMs + nFadeoutTimeMs) - // まだ一度もMissっていない or フェードアウトしきった後 - { - cc.b可視 = false; - cc.n透明度 = 255; - retcode = EChipInvisibleState.INVISIBLE; - } else if (ccounter[nInst].CurrentValue < nDisplayTimeMs) // 表示期間 - { - cc.b可視 = true; - cc.n透明度 = 255; - retcode = EChipInvisibleState.SHOW; - } else if (ccounter[nInst].CurrentValue < nDisplayTimeMs + nFadeoutTimeMs) // フェードアウト期間 - { - cc.b可視 = true; - cc.n透明度 = 255 - (int)(Convert.ToDouble(ccounter[nInst].CurrentValue - nDisplayTimeMs) / nFadeoutTimeMs * 255.0); - retcode = EChipInvisibleState.FADEOUT; - } - break; - default: + } else if (ccounter[nInst].CurrentValue < nDisplayTimeMs) // 表示期間 + { cc.b可視 = true; cc.n透明度 = 255; retcode = EChipInvisibleState.SHOW; - break; - } - return retcode; - } - - #region [ Dispose-Finalize パターン実装 ] - //----------------- - public void Dispose() { - this.Dispose(true); - GC.SuppressFinalize(this); - } - protected void Dispose(bool disposeManagedObjects) { - if (this.bDispose完了済み) - return; - - if (disposeManagedObjects) { - // (A) Managed リソースの解放 - for (int i = 0; i < 5; i++) { - // ctInvisibleTimer[ i ].Dispose(); - ccounter[i].Stop(); - ccounter[i] = null; + } else if (ccounter[nInst].CurrentValue < nDisplayTimeMs + nFadeoutTimeMs) // フェードアウト期間 + { + cc.b可視 = true; + cc.n透明度 = 255 - (int)(Convert.ToDouble(ccounter[nInst].CurrentValue - nDisplayTimeMs) / nFadeoutTimeMs * 255.0); + retcode = EChipInvisibleState.FADEOUT; } - } - - // (B) Unamanaged リソースの解放 - - this.bDispose完了済み = true; + break; + default: + cc.b可視 = true; + cc.n透明度 = 255; + retcode = EChipInvisibleState.SHOW; + break; } - ~CInvisibleChip() { - this.Dispose(false); - } - //----------------- - #endregion - - private CCounter[] ccounter = new CCounter[5]; - private bool bDispose完了済み = false; - private bool[] b演奏チップが1つでもバーを通過した = new bool[5]; + return retcode; } + + #region [ Dispose-Finalize パターン実装 ] + //----------------- + public void Dispose() { + this.Dispose(true); + GC.SuppressFinalize(this); + } + protected void Dispose(bool disposeManagedObjects) { + if (this.bDispose完了済み) + return; + + if (disposeManagedObjects) { + // (A) Managed リソースの解放 + for (int i = 0; i < 5; i++) { + // ctInvisibleTimer[ i ].Dispose(); + ccounter[i].Stop(); + ccounter[i] = null; + } + } + + // (B) Unamanaged リソースの解放 + + this.bDispose完了済み = true; + } + ~CInvisibleChip() { + this.Dispose(false); + } + //----------------- + #endregion + + private CCounter[] ccounter = new CCounter[5]; + private bool bDispose完了済み = false; + private bool[] b演奏チップが1つでもバーを通過した = new bool[5]; } diff --git a/OpenTaiko/src/Stages/07.Game/CLagLogger.cs b/OpenTaiko/src/Stages/07.Game/CLagLogger.cs index 98f3a593..6da857ab 100644 --- a/OpenTaiko/src/Stages/07.Game/CLagLogger.cs +++ b/OpenTaiko/src/Stages/07.Game/CLagLogger.cs @@ -2,90 +2,90 @@ using System.Text; using FDK.ExtensionMethods; -namespace OpenTaiko { - internal static class CLagLogger { - private const int MaximumLag = 200; - private const int MinimumLag = 0 - MaximumLag; - private const int Offset = 1 - MinimumLag; +namespace OpenTaiko; - private static readonly List LagValues = new List(2000); +internal static class CLagLogger { + private const int MaximumLag = 200; + private const int MinimumLag = 0 - MaximumLag; + private const int Offset = 1 - MinimumLag; - public static void Add(int nPlayer, CDTX.CChip pChip) { - if (nPlayer != 0) { + private static readonly List LagValues = new List(2000); + + public static void Add(int nPlayer, CDTX.CChip pChip) { + if (nPlayer != 0) { + return; + } + + switch (pChip.nチャンネル番号) { + case 0x15: + case 0x16: + case 0x17: + case 0x18: + case 0x1F: return; - } - - switch (pChip.nチャンネル番号) { - case 0x15: - case 0x16: - case 0x17: - case 0x18: - case 0x1F: - return; - } - - var pChipNLag = pChip.nLag; - - LagValues.Add(pChipNLag); } - public static double? LogAndReturnMeanLag() { - if (LagValues.Count < 30) { - return null; - } + var pChipNLag = pChip.nLag; - var orderedLagValues = LagValues.OrderBy(x => x).ToList(); + LagValues.Add(pChipNLag); + } - var mean = orderedLagValues.Average(); - var mid = (orderedLagValues.Count - 1) / 2.0; - var median = (orderedLagValues[(int)(mid)] + orderedLagValues[(int)(mid + 0.5)]) / 2.0; - var groups = orderedLagValues.GroupBy(v => v).ToList(); - var maxCount = groups.Max(g => g.Count()); - var modes = string.Join(",", groups.Where(g => g.Count() == maxCount).Select(o => o.Key.ToString()).ToArray()); - var stdev = Math.Sqrt(orderedLagValues.Select(o => Math.Pow(o - mean, 2)).Average()); + public static double? LogAndReturnMeanLag() { + if (LagValues.Count < 30) { + return null; + } - Trace.TraceInformation( - $"{nameof(CLagLogger)}.{nameof(LogAndReturnMeanLag)}: Mean lag: {mean}. Median lag: {median}. Mode(s) of lag: {modes}. Standard deviation of lag: {stdev}."); + var orderedLagValues = LagValues.OrderBy(x => x).ToList(); - var hitChipCountsIndexedByOffsetLag = new int[1 + MaximumLag + 1 + MaximumLag + 1]; - foreach (var pChipNLag in LagValues) { - hitChipCountsIndexedByOffsetLag[pChipNLag.Clamp(MinimumLag - 1, MaximumLag + 1) + Offset]++; - } + var mean = orderedLagValues.Average(); + var mid = (orderedLagValues.Count - 1) / 2.0; + var median = (orderedLagValues[(int)(mid)] + orderedLagValues[(int)(mid + 0.5)]) / 2.0; + var groups = orderedLagValues.GroupBy(v => v).ToList(); + var maxCount = groups.Max(g => g.Count()); + var modes = string.Join(",", groups.Where(g => g.Count() == maxCount).Select(o => o.Key.ToString()).ToArray()); + var stdev = Math.Sqrt(orderedLagValues.Select(o => Math.Pow(o - mean, 2)).Average()); - var sbHeader = new StringBuilder(); - var sbData = new StringBuilder(); + Trace.TraceInformation( + $"{nameof(CLagLogger)}.{nameof(LogAndReturnMeanLag)}: Mean lag: {mean}. Median lag: {median}. Mode(s) of lag: {modes}. Standard deviation of lag: {stdev}."); - var doneOne = false; - for (var i = 0; i < hitChipCountsIndexedByOffsetLag.Length; i++) { - var count = hitChipCountsIndexedByOffsetLag[i]; + var hitChipCountsIndexedByOffsetLag = new int[1 + MaximumLag + 1 + MaximumLag + 1]; + foreach (var pChipNLag in LagValues) { + hitChipCountsIndexedByOffsetLag[pChipNLag.Clamp(MinimumLag - 1, MaximumLag + 1) + Offset]++; + } - if (count != 0) { - if (doneOne) { - sbHeader.Append(","); - sbData.Append(","); - } else { - doneOne = true; - } + var sbHeader = new StringBuilder(); + var sbData = new StringBuilder(); - var lag = i - Offset; - if (lag < MinimumLag) { - sbHeader.Append($"< {MinimumLag}"); - } else if (lag > MaximumLag) { - sbHeader.Append($"> {MaximumLag}"); - } else { - sbHeader.Append(lag); - } + var doneOne = false; + for (var i = 0; i < hitChipCountsIndexedByOffsetLag.Length; i++) { + var count = hitChipCountsIndexedByOffsetLag[i]; - sbData.Append(count); + if (count != 0) { + if (doneOne) { + sbHeader.Append(","); + sbData.Append(","); + } else { + doneOne = true; } + + var lag = i - Offset; + if (lag < MinimumLag) { + sbHeader.Append($"< {MinimumLag}"); + } else if (lag > MaximumLag) { + sbHeader.Append($"> {MaximumLag}"); + } else { + sbHeader.Append(lag); + } + + sbData.Append(count); } - - Trace.TraceInformation( - $"{nameof(CLagLogger)}.{nameof(LogAndReturnMeanLag)}: Hit chip counts, indexed by lag in milliseconds:{Environment.NewLine}{sbHeader}{Environment.NewLine}{sbData}"); - - LagValues.Clear(); - - return mean; } + + Trace.TraceInformation( + $"{nameof(CLagLogger)}.{nameof(LogAndReturnMeanLag)}: Hit chip counts, indexed by lag in milliseconds:{Environment.NewLine}{sbHeader}{Environment.NewLine}{sbData}"); + + LagValues.Clear(); + + return mean; } } diff --git a/OpenTaiko/src/Stages/07.Game/CStage演奏画面共通.cs b/OpenTaiko/src/Stages/07.Game/CStage演奏画面共通.cs index 4b79c6d1..0694edba 100644 --- a/OpenTaiko/src/Stages/07.Game/CStage演奏画面共通.cs +++ b/OpenTaiko/src/Stages/07.Game/CStage演奏画面共通.cs @@ -3,1807 +3,1916 @@ using System.Drawing; using FDK; using FDK.ExtensionMethods; -namespace OpenTaiko { - /// - /// 演奏画面の共通クラス (ドラム演奏画面, ギター演奏画面の継承元) - /// - internal abstract class CStage演奏画面共通 : CStage { - // Properties +namespace OpenTaiko; - // メソッド +/// +/// 演奏画面の共通クラス (ドラム演奏画面, ギター演奏画面の継承元) +/// +internal abstract class CStage演奏画面共通 : CStage { + // Properties - #region [ t演奏結果を格納する_ドラム() ] - public void t演奏結果を格納する_ドラム(out CScoreIni.C演奏記録 Drums) { - Drums = new CScoreIni.C演奏記録(); + // メソッド - { - Drums.nGoodCount = OpenTaiko.ConfigIni.bAutoPlay[0] ? this.nヒット数_Auto含む.Drums.Perfect : this.nヒット数_Auto含まない.Drums.Perfect; - Drums.nOkCount = OpenTaiko.ConfigIni.bAutoPlay[0] ? this.nヒット数_Auto含む.Drums.Great : this.nヒット数_Auto含まない.Drums.Great; - Drums.nBadCount = OpenTaiko.ConfigIni.bAutoPlay[0] ? this.nヒット数_Auto含む.Drums.Miss : this.nヒット数_Auto含まない.Drums.Miss; + #region [ t演奏結果を格納する_ドラム() ] + public void t演奏結果を格納する_ドラム(out CScoreIni.C演奏記録 Drums) { + Drums = new CScoreIni.C演奏記録(); - var danC = OpenTaiko.stage演奏ドラム画面.actDan.GetExam(); - for (int i = 0; i < danC.Length; i++) { - Drums.Dan_C[i] = danC[i]; + { + Drums.nGoodCount = OpenTaiko.ConfigIni.bAutoPlay[0] ? this.nヒット数_Auto含む.Drums.Perfect : this.nヒット数_Auto含まない.Drums.Perfect; + Drums.nOkCount = OpenTaiko.ConfigIni.bAutoPlay[0] ? this.nヒット数_Auto含む.Drums.Great : this.nヒット数_Auto含まない.Drums.Great; + Drums.nBadCount = OpenTaiko.ConfigIni.bAutoPlay[0] ? this.nヒット数_Auto含む.Drums.Miss : this.nヒット数_Auto含まない.Drums.Miss; + + var danC = OpenTaiko.stage演奏ドラム画面.actDan.GetExam(); + for (int i = 0; i < danC.Length; i++) { + Drums.Dan_C[i] = danC[i]; + } + } + } + #endregion + + // CStage 実装 + + public int[] nNoteCount = new int[5]; + public int[] nBalloonCount = new int[5]; + public double[] nRollTimeMs = new double[5]; + public double[] nAddScoreNiji = new double[5]; + + public override void Activate() { + listChip = new List[5]; + List[] balloonChips = new List[5]; + for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { + nNoteCount[i] = 0; + nBalloonCount[i] = 0; + nRollTimeMs[i] = 0; + nAddScoreNiji[i] = 0; + + switch (i) { + case 0: + listChip[i] = OpenTaiko.DTX.listChip; + break; + case 1: + listChip[i] = OpenTaiko.DTX_2P.listChip; + break; + case 2: + listChip[i] = OpenTaiko.DTX_3P.listChip; + break; + case 3: + listChip[i] = OpenTaiko.DTX_4P.listChip; + break; + case 4: + listChip[i] = OpenTaiko.DTX_5P.listChip; + break; + } + + if (OpenTaiko.ConfigIni.nPlayerCount >= 2) { + balloonChips[i] = new(); + for (int j = 0; j < listChip[i].Count; j++) { + var chip = listChip[i][j]; + + if (NotesManager.IsGenericBalloon(chip)) { + balloonChips[i].Add(chip); + } } } + + int n整数値管理 = 0; + if (r指定時刻に一番近い未ヒットChipを過去方向優先で検索する(0, i) != null) //2020.07.08 Mr-Ojii 未ヒットチップがないときの例外の発生回避 <-(KabanFriends)コード借りましたごめんなさい(´・ω・`) + { + foreach (CDTX.CChip chip in listChip[i]) { + chip.nList上の位置 = n整数値管理; + //if ((chip.nチャンネル番号 == 0x15 || chip.nチャンネル番号 == 0x16) && (n整数値管理 < this.listChip[i].Count - 1)) + if ((NotesManager.IsRoll(chip) || NotesManager.IsFuzeRoll(chip)) && (n整数値管理 < this.listChip[i].Count - 1)) { + if (chip.db発声時刻ms < r指定時刻に一番近い未ヒットChipを過去方向優先で検索する(0, i).db発声時刻ms) { + chip.n描画優先度 = 1; + } + } + n整数値管理++; + } + } + } + + for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { + CDTX _dtx = OpenTaiko.DTX; + switch (i) //2017.08.11 kairera0467 + { + case 0: + break; + case 1: + _dtx = OpenTaiko.DTX_2P; + break; + case 2: + _dtx = OpenTaiko.DTX_3P; + break; + case 3: + _dtx = OpenTaiko.DTX_4P; + break; + case 4: + _dtx = OpenTaiko.DTX_5P; + break; + default: + break; + } + + if (OpenTaiko.ConfigIni.nPlayerCount >= 2) { + for (int j = 0; j < balloonChips[i].Count; j++) { + var chip = balloonChips[i][j]; + if (NotesManager.IsKusudama(chip)) { + for (int p = 0; p < OpenTaiko.ConfigIni.nPlayerCount; p++) { + if (p == i) continue; + var chip2 = balloonChips[p].Find(x => Math.Abs(x.db発声時刻ms - chip.db発声時刻ms) < 100); + + if (chip2 == null) { + var chip3 = listChip[p].Find(x => Math.Abs(x.db発声時刻ms - chip.db発声時刻ms) < 100); + if (!NotesManager.IsKusudama(chip3)) { + chip.nチャンネル番号 = 0x17; + } + } else if (!NotesManager.IsKusudama(chip2)) { + chip.nチャンネル番号 = 0x17; + } + } + } + } + /* + for(int p = 0; p < TJAPlayer3.ConfigIni.nPlayerCount; p++) + { + for(int j = 0; j < balloonChips[p].Count; j++) + { + var chip = balloonChips[i].Find(x => Math.Abs(x.db発声時刻ms - balloonChips[p][j].db発声時刻ms) < 100); + if (chip == null) + { + var chip2 = listChip[i].Find(x => Math.Abs(x.db発声時刻ms - balloonChips[p][j].db発声時刻ms) < 100); + if (NotesManager.IsKusudama(chip2)) + { + chip.nチャンネル番号 = NotesManager.GetNoteValueFromChar("7"); + } + } + else if (NotesManager.IsKusudama(chip) && !NotesManager.IsKusudama(balloonChips[p][j])) + { + chip.nチャンネル番号 = balloonChips[p][j].nチャンネル番号; + } + } + } + */ + } + + + + int _totalNotes = 0; + int _totalBalloons = 0; + double _totalRolls = 0; + + /* + for (int j = 0; j < (_dtx.bチップがある.Branch ? 2 : 1); j++) + { + var _list = (j == 0) ? _dtx.listChip : _dtx.listChip_Branch[2]; + + _totalNotes += _list.Where(num => NotesManager.IsMissableNote(num)).Count(); + for (int k = 0; k < _list.Count; k++) + { + var _chip = _list[k]; + _totalBalloons += _chip.nBalloon; + if (NotesManager.IsRoll(_chip)) + _totalRolls += (_chip.nノーツ終了時刻ms - _chip.n発声時刻ms) / 1000.0; + } + } + */ + + var _list = (_dtx.bチップがある.Branch) ? _dtx.listChip_Branch[2] : _dtx.listChip; + + _totalNotes += _list.Where(num => NotesManager.IsMissableNote(num)).Count(); + for (int k = 0; k < _list.Count; k++) { + var _chip = _list[k]; + + if (NotesManager.IsGenericBalloon(_chip)) { + var _duration = (_chip.nノーツ終了時刻ms - _chip.n発声時刻ms) / 1000.0; + var _expectedHits = (int)(_duration / 16.6f); + _totalBalloons += Math.Min(_chip.nBalloon, _expectedHits); + } + + if (NotesManager.IsRoll(_chip) || NotesManager.IsFuzeRoll(_chip)) + _totalRolls += (_chip.nノーツ終了時刻ms - _chip.n発声時刻ms) / 1000.0; + } + + nNoteCount[i] = _totalNotes; + nBalloonCount[i] = _totalBalloons; + nRollTimeMs[i] = _totalRolls; + } + + for (int k = 0; k < OpenTaiko.ConfigIni.nPlayerCount; k++) { + //nAddScoreNiji = (1000000 - (15 * RollTimems * 100) - (nBalloonCount * 100)) / TJAPlayer3.DTX.listChip.Count; + if (nNoteCount[k] == 0 && nBalloonCount[k] == 0) { + nAddScoreNiji[k] = 1000000; + } else { + nAddScoreNiji[k] = (double)Math.Ceiling((decimal)(1000000 - (nBalloonCount[k] * 100) - (nRollTimeMs[k] * 100 * 16.6)) / nNoteCount[k] / 10) * 10; + } + + } + + + for (int index = OpenTaiko.DTX.listChip.Count - 1; index >= 0; index--) { + if (OpenTaiko.DTX.listChip[index].nチャンネル番号 == 0x01) { + this.bgmlength = OpenTaiko.DTX.listChip[index].GetDuration() + OpenTaiko.DTX.listChip[index].n発声時刻ms; + break; + } + } + + _AIBattleState = 0; + _AIBattleStateBatch = new Queue[] { new Queue(), new Queue() }; + + this.AIBattleSections = new List(); + + CDTX.CChip endChip = null; + for (int i = 0; i < listChip[0].Count; i++) { + CDTX.CChip chip = listChip[0][i]; + if (endChip == null || (chip.n発声時刻ms > endChip.n発声時刻ms && chip.nチャンネル番号 == 0x50)) { + endChip = chip; + } + } + + int battleSectionCount = 3 + ((endChip.n発声時刻ms * 2) / 100000); + // Avoid single section + if (battleSectionCount <= 1) + battleSectionCount = 3; + // Avoid ties + if (battleSectionCount % 2 == 0) + battleSectionCount -= 1; + + + int battleSectionTime = 0; + + int nowBattleSectionCount = 1; + + for (int i = 0; i < listChip[0].Count; i++) { + CDTX.CChip chip = listChip[0][i]; + + if (nowBattleSectionCount == battleSectionCount) { + chip = endChip; + i = listChip[0].Count - 1; + } + + int endtime = endChip.n発声時刻ms / battleSectionCount; + + bool isAddSection = (nowBattleSectionCount != battleSectionCount) ? + chip.n発声時刻ms >= endtime * nowBattleSectionCount : + i == listChip[0].Count - 1; + + + if (isAddSection) { + AIBattleSection aIBattleSection = new AIBattleSection(); + + aIBattleSection.StartTime = battleSectionTime; + aIBattleSection.EndTime = chip.n発声時刻ms; + aIBattleSection.Length = aIBattleSection.EndTime - aIBattleSection.StartTime; + + this.AIBattleSections.Add(aIBattleSection); + + battleSectionTime = aIBattleSection.EndTime; + nowBattleSectionCount++; + } + } + + NowAIBattleSectionCount = 0; + bIsAIBattleWin = false; + + ctChipAnime = new CCounter[5]; + ctChipAnimeLag = new CCounter[5]; + for (int i = 0; i < 5; i++) { + ctChipAnime[i] = new CCounter(); + ctChipAnimeLag[i] = new CCounter(); + } + + listWAV = OpenTaiko.DTX.listWAV; + + this.eフェードアウト完了時の戻り値 = EGameplayScreenReturnValue.Continue; + this.n現在のトップChip = (listChip[0].Count > 0) ? 0 : -1; + this.L最後に再生したHHの実WAV番号 = new List(16); + this.n最後に再生したHHのチャンネル番号 = 0; + for (int i = 0; i < 50; i++) { + this.n最後に再生したBGMの実WAV番号[i] = -1; + } + + cInvisibleChip = new CInvisibleChip(OpenTaiko.ConfigIni.nDisplayTimesMs, OpenTaiko.ConfigIni.nFadeoutTimeMs); + for (int k = 0; k < 4; k++) { + //for ( int n = 0; n < 5; n++ ) + //{ + this.nヒット数_Auto含まない[k] = new CHITCOUNTOFRANK(); + this.nヒット数_Auto含む[k] = new CHITCOUNTOFRANK(); + //} + this.r現在の歓声Chip[k] = null; + cInvisibleChip.eInvisibleMode[k] = OpenTaiko.ConfigIni.eInvisible[k]; + + + this.bReverse[k] = OpenTaiko.ConfigIni.bReverse[k]; + + } + + this.b演奏にキーボードを使った = false; + this.b演奏にジョイパッドを使った = false; + this.b演奏にMIDI入力を使った = false; + this.b演奏にマウスを使った = false; + + cInvisibleChip.Reset(); + base.Activate(); + this.tパネル文字列の設定(); + //this.演奏判定ライン座標(); + this.bIsGOGOTIME = new bool[] { false, false, false, false, false }; + this.bIsMiss = new bool[] { false, false, false, false, false }; + this.bUseBranch = new bool[] { false, false, false, false, false }; + this.n現在のコース = new CDTX.ECourse[5]; + this.n次回のコース = new CDTX.ECourse[5]; + nCurrentKusudamaRollCount = 0; + nCurrentKusudamaCount = 0; + + for (int i = 0; i < 5; i++) { + this.b強制的に分岐させた[i] = false; + + this.CChartScore[i] = new CBRANCHSCORE(); + this.CSectionScore[i] = new CBRANCHSCORE(); + + OpenTaiko.stage演奏ドラム画面.actMtaiko.After[i] = CDTX.ECourse.eNormal; + OpenTaiko.stage演奏ドラム画面.actLaneTaiko.stBranch[i].nAfter = CDTX.ECourse.eNormal; + OpenTaiko.stage演奏ドラム画面.actMtaiko.Before[i] = CDTX.ECourse.eNormal; + OpenTaiko.stage演奏ドラム画面.actLaneTaiko.stBranch[i].nBefore = CDTX.ECourse.eNormal; + } + + for (int i = 0; i < CBranchScore.Length; i++) { + this.CBranchScore[i] = new CBRANCHSCORE(); + + //大音符分岐時の情報をまとめるため + this.CBranchScore[i].cBigNotes = new CBRANCHSCORE(); + } + + + this.nレーン用表示コース = new CDTX.ECourse[5]; + this.b連打中 = new bool[] { false, false, false, false, false }; + this.n現在の連打数 = new int[] { 0, 0, 0, 0, 0 }; + this.n合計連打数 = new int[] { 0, 0, 0, 0, 0 }; + this.n分岐した回数 = new int[5]; + this.Chara_MissCount = new int[5]; + for (int i = 0; i < 2; i++) { + ShownLyric[i] = 0; + } + this.nJPOSSCROLL = new int[5]; + this.bLEVELHOLD = new bool[] { false, false, false, false, false }; + this.JPOSCROLLX = new int[5]; + this.JPOSCROLLY = new int[5]; + eFirstGameType = new EGameType[5]; + bSplitLane = new bool[5]; + + + // Double play set here + this.bDoublePlay = OpenTaiko.ConfigIni.nPlayerCount >= 2 ? true : false; + + this.nLoopCount_Clear = 1; + + this.tBranchReset(0); + + for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { + actGauge.Init(OpenTaiko.ConfigIni.nRisky, i); // #23559 2011.7.28 yyagi + eFirstGameType[i] = OpenTaiko.ConfigIni.nGameType[i]; + } + this.nPolyphonicSounds = OpenTaiko.ConfigIni.nPoliphonicSounds; + + OpenTaiko.Skin.tRemoveMixerAll(); // 効果音のストリームをミキサーから解除しておく + + queueMixerSound = new Queue(64); + bIsDirectSound = (OpenTaiko.SoundManager.GetCurrentSoundDeviceType() == "DirectSound"); + bUseOSTimer = OpenTaiko.ConfigIni.bUseOSTimer; + this.bPAUSE = false; + db再生速度 = OpenTaiko.ConfigIni.SongPlaybackSpeed; + bValidScore = true; + + #region [ 演奏開始前にmixer登録しておくべきサウンド(開幕してすぐに鳴らすことになるチップ音)を登録しておく ] + foreach (CDTX.CChip pChip in listChip[0]) { + // Debug.WriteLine( "CH=" + pChip.nチャンネル番号.ToString( "x2" ) + ", 整数値=" + pChip.n整数値 + ", time=" + pChip.n発声時刻ms ); + if (pChip.n発声時刻ms <= 0) { + if (pChip.nチャンネル番号 == 0xDA) { + pChip.bHit = true; + // Trace.TraceInformation( "first [DA] BAR=" + pChip.n発声位置 / 384 + " ch=" + pChip.nチャンネル番号.ToString( "x2" ) + ", wav=" + pChip.n整数値 + ", time=" + pChip.n発声時刻ms ); + if (listWAV.TryGetValue(pChip.n整数値_内部番号, out CDTX.CWAV wc)) { + for (int i = 0; i < nPolyphonicSounds; i++) { + if (wc.rSound[i] != null) { + OpenTaiko.SoundManager.AddMixer(wc.rSound[i], db再生速度, pChip.b演奏終了後も再生が続くチップである); + //AddMixer( wc.rSound[ i ] ); // 最初はqueueを介さず直接ミキサー登録する + } + } + } + } + } else { + break; + } } #endregion - // CStage 実装 - - public int[] nNoteCount = new int[5]; - public int[] nBalloonCount = new int[5]; - public double[] nRollTimeMs = new double[5]; - public double[] nAddScoreNiji = new double[5]; - - public override void Activate() { - listChip = new List[5]; - List[] balloonChips = new List[5]; - for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { - nNoteCount[i] = 0; - nBalloonCount[i] = 0; - nRollTimeMs[i] = 0; - nAddScoreNiji[i] = 0; - - switch (i) { - case 0: - listChip[i] = OpenTaiko.DTX.listChip; - break; - case 1: - listChip[i] = OpenTaiko.DTX_2P.listChip; - break; - case 2: - listChip[i] = OpenTaiko.DTX_3P.listChip; - break; - case 3: - listChip[i] = OpenTaiko.DTX_4P.listChip; - break; - case 4: - listChip[i] = OpenTaiko.DTX_5P.listChip; - break; - } - - if (OpenTaiko.ConfigIni.nPlayerCount >= 2) { - balloonChips[i] = new(); - for (int j = 0; j < listChip[i].Count; j++) { - var chip = listChip[i][j]; - - if (NotesManager.IsGenericBalloon(chip)) { - balloonChips[i].Add(chip); - } - } - } - - int n整数値管理 = 0; - if (r指定時刻に一番近い未ヒットChipを過去方向優先で検索する(0, i) != null) //2020.07.08 Mr-Ojii 未ヒットチップがないときの例外の発生回避 <-(KabanFriends)コード借りましたごめんなさい(´・ω・`) - { - foreach (CDTX.CChip chip in listChip[i]) { - chip.nList上の位置 = n整数値管理; - //if ((chip.nチャンネル番号 == 0x15 || chip.nチャンネル番号 == 0x16) && (n整数値管理 < this.listChip[i].Count - 1)) - if ((NotesManager.IsRoll(chip) || NotesManager.IsFuzeRoll(chip)) && (n整数値管理 < this.listChip[i].Count - 1)) { - if (chip.db発声時刻ms < r指定時刻に一番近い未ヒットChipを過去方向優先で検索する(0, i).db発声時刻ms) { - chip.n描画優先度 = 1; - } - } - n整数値管理++; - } - } - } - - for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { - CDTX _dtx = OpenTaiko.DTX; - switch (i) //2017.08.11 kairera0467 - { - case 0: - break; - case 1: - _dtx = OpenTaiko.DTX_2P; - break; - case 2: - _dtx = OpenTaiko.DTX_3P; - break; - case 3: - _dtx = OpenTaiko.DTX_4P; - break; - case 4: - _dtx = OpenTaiko.DTX_5P; - break; - default: - break; - } - - if (OpenTaiko.ConfigIni.nPlayerCount >= 2) { - for (int j = 0; j < balloonChips[i].Count; j++) { - var chip = balloonChips[i][j]; - if (NotesManager.IsKusudama(chip)) { - for (int p = 0; p < OpenTaiko.ConfigIni.nPlayerCount; p++) { - if (p == i) continue; - var chip2 = balloonChips[p].Find(x => Math.Abs(x.db発声時刻ms - chip.db発声時刻ms) < 100); - - if (chip2 == null) { - var chip3 = listChip[p].Find(x => Math.Abs(x.db発声時刻ms - chip.db発声時刻ms) < 100); - if (!NotesManager.IsKusudama(chip3)) { - chip.nチャンネル番号 = 0x17; - } - } else if (!NotesManager.IsKusudama(chip2)) { - chip.nチャンネル番号 = 0x17; - } - } - } - } - /* - for(int p = 0; p < TJAPlayer3.ConfigIni.nPlayerCount; p++) - { - for(int j = 0; j < balloonChips[p].Count; j++) - { - var chip = balloonChips[i].Find(x => Math.Abs(x.db発声時刻ms - balloonChips[p][j].db発声時刻ms) < 100); - if (chip == null) - { - var chip2 = listChip[i].Find(x => Math.Abs(x.db発声時刻ms - balloonChips[p][j].db発声時刻ms) < 100); - if (NotesManager.IsKusudama(chip2)) - { - chip.nチャンネル番号 = NotesManager.GetNoteValueFromChar("7"); - } - } - else if (NotesManager.IsKusudama(chip) && !NotesManager.IsKusudama(balloonChips[p][j])) - { - chip.nチャンネル番号 = balloonChips[p][j].nチャンネル番号; - } - } - } - */ - } - - - - int _totalNotes = 0; - int _totalBalloons = 0; - double _totalRolls = 0; - - /* - for (int j = 0; j < (_dtx.bチップがある.Branch ? 2 : 1); j++) - { - var _list = (j == 0) ? _dtx.listChip : _dtx.listChip_Branch[2]; - - _totalNotes += _list.Where(num => NotesManager.IsMissableNote(num)).Count(); - for (int k = 0; k < _list.Count; k++) - { - var _chip = _list[k]; - _totalBalloons += _chip.nBalloon; - if (NotesManager.IsRoll(_chip)) - _totalRolls += (_chip.nノーツ終了時刻ms - _chip.n発声時刻ms) / 1000.0; - } - } - */ - - var _list = (_dtx.bチップがある.Branch) ? _dtx.listChip_Branch[2] : _dtx.listChip; - - _totalNotes += _list.Where(num => NotesManager.IsMissableNote(num)).Count(); - for (int k = 0; k < _list.Count; k++) { - var _chip = _list[k]; - - if (NotesManager.IsGenericBalloon(_chip)) { - var _duration = (_chip.nノーツ終了時刻ms - _chip.n発声時刻ms) / 1000.0; - var _expectedHits = (int)(_duration / 16.6f); - _totalBalloons += Math.Min(_chip.nBalloon, _expectedHits); - } - - if (NotesManager.IsRoll(_chip) || NotesManager.IsFuzeRoll(_chip)) - _totalRolls += (_chip.nノーツ終了時刻ms - _chip.n発声時刻ms) / 1000.0; - } - - nNoteCount[i] = _totalNotes; - nBalloonCount[i] = _totalBalloons; - nRollTimeMs[i] = _totalRolls; - } - - for (int k = 0; k < OpenTaiko.ConfigIni.nPlayerCount; k++) { - //nAddScoreNiji = (1000000 - (15 * RollTimems * 100) - (nBalloonCount * 100)) / TJAPlayer3.DTX.listChip.Count; - if (nNoteCount[k] == 0 && nBalloonCount[k] == 0) { - nAddScoreNiji[k] = 1000000; - } else { - nAddScoreNiji[k] = (double)Math.Ceiling((decimal)(1000000 - (nBalloonCount[k] * 100) - (nRollTimeMs[k] * 100 * 16.6)) / nNoteCount[k] / 10) * 10; - } - - } - - - for (int index = OpenTaiko.DTX.listChip.Count - 1; index >= 0; index--) { - if (OpenTaiko.DTX.listChip[index].nチャンネル番号 == 0x01) { - this.bgmlength = OpenTaiko.DTX.listChip[index].GetDuration() + OpenTaiko.DTX.listChip[index].n発声時刻ms; - break; - } - } - - _AIBattleState = 0; - _AIBattleStateBatch = new Queue[] { new Queue(), new Queue() }; - - this.AIBattleSections = new List(); - - CDTX.CChip endChip = null; - for (int i = 0; i < listChip[0].Count; i++) { - CDTX.CChip chip = listChip[0][i]; - if (endChip == null || (chip.n発声時刻ms > endChip.n発声時刻ms && chip.nチャンネル番号 == 0x50)) { - endChip = chip; - } - } - - int battleSectionCount = 3 + ((endChip.n発声時刻ms * 2) / 100000); - // Avoid single section - if (battleSectionCount <= 1) - battleSectionCount = 3; - // Avoid ties - if (battleSectionCount % 2 == 0) - battleSectionCount -= 1; - - - int battleSectionTime = 0; - - int nowBattleSectionCount = 1; - - for (int i = 0; i < listChip[0].Count; i++) { - CDTX.CChip chip = listChip[0][i]; - - if (nowBattleSectionCount == battleSectionCount) { - chip = endChip; - i = listChip[0].Count - 1; - } - - int endtime = endChip.n発声時刻ms / battleSectionCount; - - bool isAddSection = (nowBattleSectionCount != battleSectionCount) ? - chip.n発声時刻ms >= endtime * nowBattleSectionCount : - i == listChip[0].Count - 1; - - - if (isAddSection) { - AIBattleSection aIBattleSection = new AIBattleSection(); - - aIBattleSection.StartTime = battleSectionTime; - aIBattleSection.EndTime = chip.n発声時刻ms; - aIBattleSection.Length = aIBattleSection.EndTime - aIBattleSection.StartTime; - - this.AIBattleSections.Add(aIBattleSection); - - battleSectionTime = aIBattleSection.EndTime; - nowBattleSectionCount++; - } - } - - NowAIBattleSectionCount = 0; - bIsAIBattleWin = false; - - ctChipAnime = new CCounter[5]; - ctChipAnimeLag = new CCounter[5]; - for (int i = 0; i < 5; i++) { - ctChipAnime[i] = new CCounter(); - ctChipAnimeLag[i] = new CCounter(); - } - - listWAV = OpenTaiko.DTX.listWAV; - - this.eフェードアウト完了時の戻り値 = EGameplayScreenReturnValue.Continue; - this.n現在のトップChip = (listChip[0].Count > 0) ? 0 : -1; - this.L最後に再生したHHの実WAV番号 = new List(16); - this.n最後に再生したHHのチャンネル番号 = 0; - for (int i = 0; i < 50; i++) { - this.n最後に再生したBGMの実WAV番号[i] = -1; - } - - cInvisibleChip = new CInvisibleChip(OpenTaiko.ConfigIni.nDisplayTimesMs, OpenTaiko.ConfigIni.nFadeoutTimeMs); - for (int k = 0; k < 4; k++) { - //for ( int n = 0; n < 5; n++ ) - //{ - this.nヒット数_Auto含まない[k] = new CHITCOUNTOFRANK(); - this.nヒット数_Auto含む[k] = new CHITCOUNTOFRANK(); - //} - this.r現在の歓声Chip[k] = null; - cInvisibleChip.eInvisibleMode[k] = OpenTaiko.ConfigIni.eInvisible[k]; - - - this.bReverse[k] = OpenTaiko.ConfigIni.bReverse[k]; - - } - - this.b演奏にキーボードを使った = false; - this.b演奏にジョイパッドを使った = false; - this.b演奏にMIDI入力を使った = false; - this.b演奏にマウスを使った = false; - - cInvisibleChip.Reset(); - base.Activate(); - this.tパネル文字列の設定(); - //this.演奏判定ライン座標(); - this.bIsGOGOTIME = new bool[] { false, false, false, false, false }; - this.bIsMiss = new bool[] { false, false, false, false, false }; - this.bUseBranch = new bool[] { false, false, false, false, false }; - this.n現在のコース = new CDTX.ECourse[5]; - this.n次回のコース = new CDTX.ECourse[5]; - nCurrentKusudamaRollCount = 0; - nCurrentKusudamaCount = 0; - - for (int i = 0; i < 5; i++) { - this.b強制的に分岐させた[i] = false; - - this.CChartScore[i] = new CBRANCHSCORE(); - this.CSectionScore[i] = new CBRANCHSCORE(); - - OpenTaiko.stage演奏ドラム画面.actMtaiko.After[i] = CDTX.ECourse.eNormal; - OpenTaiko.stage演奏ドラム画面.actLaneTaiko.stBranch[i].nAfter = CDTX.ECourse.eNormal; - OpenTaiko.stage演奏ドラム画面.actMtaiko.Before[i] = CDTX.ECourse.eNormal; - OpenTaiko.stage演奏ドラム画面.actLaneTaiko.stBranch[i].nBefore = CDTX.ECourse.eNormal; - } - - for (int i = 0; i < CBranchScore.Length; i++) { - this.CBranchScore[i] = new CBRANCHSCORE(); - - //大音符分岐時の情報をまとめるため - this.CBranchScore[i].cBigNotes = new CBRANCHSCORE(); - } - - - this.nレーン用表示コース = new CDTX.ECourse[5]; - this.b連打中 = new bool[] { false, false, false, false, false }; - this.n現在の連打数 = new int[] { 0, 0, 0, 0, 0 }; - this.n合計連打数 = new int[] { 0, 0, 0, 0, 0 }; - this.n分岐した回数 = new int[5]; - this.Chara_MissCount = new int[5]; - for (int i = 0; i < 2; i++) { - ShownLyric[i] = 0; - } - this.nJPOSSCROLL = new int[5]; - this.bLEVELHOLD = new bool[] { false, false, false, false, false }; - this.JPOSCROLLX = new int[5]; - this.JPOSCROLLY = new int[5]; - eFirstGameType = new EGameType[5]; - bSplitLane = new bool[5]; - - - // Double play set here - this.bDoublePlay = OpenTaiko.ConfigIni.nPlayerCount >= 2 ? true : false; - - this.nLoopCount_Clear = 1; - - this.tBranchReset(0); - - for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { - actGauge.Init(OpenTaiko.ConfigIni.nRisky, i); // #23559 2011.7.28 yyagi - eFirstGameType[i] = OpenTaiko.ConfigIni.nGameType[i]; - } - this.nPolyphonicSounds = OpenTaiko.ConfigIni.nPoliphonicSounds; - - OpenTaiko.Skin.tRemoveMixerAll(); // 効果音のストリームをミキサーから解除しておく - - queueMixerSound = new Queue(64); - bIsDirectSound = (OpenTaiko.SoundManager.GetCurrentSoundDeviceType() == "DirectSound"); - bUseOSTimer = OpenTaiko.ConfigIni.bUseOSTimer; - this.bPAUSE = false; - db再生速度 = OpenTaiko.ConfigIni.SongPlaybackSpeed; - bValidScore = true; - - #region [ 演奏開始前にmixer登録しておくべきサウンド(開幕してすぐに鳴らすことになるチップ音)を登録しておく ] - foreach (CDTX.CChip pChip in listChip[0]) { - // Debug.WriteLine( "CH=" + pChip.nチャンネル番号.ToString( "x2" ) + ", 整数値=" + pChip.n整数値 + ", time=" + pChip.n発声時刻ms ); - if (pChip.n発声時刻ms <= 0) { - if (pChip.nチャンネル番号 == 0xDA) { - pChip.bHit = true; - // Trace.TraceInformation( "first [DA] BAR=" + pChip.n発声位置 / 384 + " ch=" + pChip.nチャンネル番号.ToString( "x2" ) + ", wav=" + pChip.n整数値 + ", time=" + pChip.n発声時刻ms ); - if (listWAV.TryGetValue(pChip.n整数値_内部番号, out CDTX.CWAV wc)) { - for (int i = 0; i < nPolyphonicSounds; i++) { - if (wc.rSound[i] != null) { - OpenTaiko.SoundManager.AddMixer(wc.rSound[i], db再生速度, pChip.b演奏終了後も再生が続くチップである); - //AddMixer( wc.rSound[ i ] ); // 最初はqueueを介さず直接ミキサー登録する - } - } - } - } - } else { - break; - } - } - #endregion - - // Note - if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) { - n良 = new int[OpenTaiko.stageSongSelect.rChoosenSong.DanSongs.Count]; - nCombo = new int[OpenTaiko.stageSongSelect.rChoosenSong.DanSongs.Count]; - nHighestCombo = new int[OpenTaiko.stageSongSelect.rChoosenSong.DanSongs.Count]; - n可 = new int[OpenTaiko.stageSongSelect.rChoosenSong.DanSongs.Count]; - n不可 = new int[OpenTaiko.stageSongSelect.rChoosenSong.DanSongs.Count]; - n連打 = new int[OpenTaiko.stageSongSelect.rChoosenSong.DanSongs.Count]; - nADLIB = new int[OpenTaiko.stageSongSelect.rChoosenSong.DanSongs.Count]; - nMine = new int[OpenTaiko.stageSongSelect.rChoosenSong.DanSongs.Count]; - } - - - this.sw = new Stopwatch(); - // this.sw2 = new Stopwatch(); - // this.gclatencymode = GCSettings.LatencyMode; - // GCSettings.LatencyMode = GCLatencyMode.Batch; // 演奏画面中はGCを抑止する - this.bIsAlreadyCleared = new bool[5]; - for (int player = 0; player < OpenTaiko.ConfigIni.nPlayerCount; player++) { - var chara = OpenTaiko.Tx.Characters[OpenTaiko.SaveFileInstances[OpenTaiko.GetActualPlayer(player)].data.Character]; - switch (chara.effect.tGetGaugeType()) { - default: - case "Normal": - bIsAlreadyCleared[player] = false; - break; - case "Hard": - case "Extreme": - bIsAlreadyCleared[player] = true; - break; - } - } - this.bIsAlreadyMaxed = new bool[5]; - - this.ListDan_Number = 0; - this.IsDanFailed = false; - - this.objHandlers = new Dictionary(); - - this.t背景テクスチャの生成(); + // Note + if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) { + n良 = new int[OpenTaiko.stageSongSelect.rChoosenSong.DanSongs.Count]; + nCombo = new int[OpenTaiko.stageSongSelect.rChoosenSong.DanSongs.Count]; + nHighestCombo = new int[OpenTaiko.stageSongSelect.rChoosenSong.DanSongs.Count]; + n可 = new int[OpenTaiko.stageSongSelect.rChoosenSong.DanSongs.Count]; + n不可 = new int[OpenTaiko.stageSongSelect.rChoosenSong.DanSongs.Count]; + n連打 = new int[OpenTaiko.stageSongSelect.rChoosenSong.DanSongs.Count]; + nADLIB = new int[OpenTaiko.stageSongSelect.rChoosenSong.DanSongs.Count]; + nMine = new int[OpenTaiko.stageSongSelect.rChoosenSong.DanSongs.Count]; } - public void ftDanReSetScoreNiji(int songNotes, int ballons) { - if (songNotes == 0 && ballons == 0) { - nAddScoreNiji[0] = 1000000; + this.sw = new Stopwatch(); + // this.sw2 = new Stopwatch(); + // this.gclatencymode = GCSettings.LatencyMode; + // GCSettings.LatencyMode = GCLatencyMode.Batch; // 演奏画面中はGCを抑止する + this.bIsAlreadyCleared = new bool[5]; + for (int player = 0; player < OpenTaiko.ConfigIni.nPlayerCount; player++) { + var chara = OpenTaiko.Tx.Characters[OpenTaiko.SaveFileInstances[OpenTaiko.GetActualPlayer(player)].data.Character]; + switch (chara.effect.tGetGaugeType()) { + default: + case "Normal": + bIsAlreadyCleared[player] = false; + break; + case "Hard": + case "Extreme": + bIsAlreadyCleared[player] = true; + break; + } + } + this.bIsAlreadyMaxed = new bool[5]; + + this.ListDan_Number = 0; + this.IsDanFailed = false; + + this.objHandlers = new Dictionary(); + + this.t背景テクスチャの生成(); + } + + + public void ftDanReSetScoreNiji(int songNotes, int ballons) { + if (songNotes == 0 && ballons == 0) { + nAddScoreNiji[0] = 1000000; + } else { + nAddScoreNiji[0] = (double)Math.Ceiling((decimal)(1000000 - (ballons * 100)) / songNotes / 10) * 10; + } + } + + public void ftDanReSetBranches(bool hasBranches) { + this.tBranchReset(0); + + OpenTaiko.stage演奏ドラム画面.nレーン用表示コース[0] = CDTX.ECourse.eNormal; + OpenTaiko.stage演奏ドラム画面.bUseBranch[0] = hasBranches; + + // TJAPlayer3.stage選曲.r確定されたスコア.譜面情報.b譜面分岐[(int)Difficulty.Dan] = hasBranches; + } + + + public override void DeActivate() { + this.bgmlength = 1; + this.L最後に再生したHHの実WAV番号.Clear(); // #23921 2011.1.4 yyagi + this.L最後に再生したHHの実WAV番号 = null; // + this.ctチップ模様アニメ.Drums = null; + this.ctチップ模様アニメ.Guitar = null; + this.ctチップ模様アニメ.Bass = null; + this.ctチップ模様アニメ.Taiko = null; + + this.ctCamHMove = null; + this.ctCamVMove = null; + this.ctCamHScale = null; + this.ctCamVScale = null; + this.ctCamRotation = null; + this.ctCamZoom = null; + + OpenTaiko.borderColor = new Color4(0f, 0f, 0f, 0f); + OpenTaiko.fCamXOffset = 0.0f; + OpenTaiko.fCamYOffset = 0.0f; + OpenTaiko.fCamXScale = 1.0f; + OpenTaiko.fCamYScale = 1.0f; + OpenTaiko.fCamRotation = 0.0f; + OpenTaiko.fCamZoomFactor = 1.0f; + + for (int i = 0; i < 5; i++) { + ctChipAnime[i] = null; + ctChipAnimeLag[i] = null; + OpenTaiko.ConfigIni.nGameType[i] = eFirstGameType[i]; + bSplitLane[i] = false; + } + + listWAV.Clear(); + listWAV = null; + listChip = null; + queueMixerSound.Clear(); + queueMixerSound = null; + cInvisibleChip.Dispose(); + cInvisibleChip = null; + // GCSettings.LatencyMode = this.gclatencymode; + + var meanLag = CLagLogger.LogAndReturnMeanLag(); + + this.actDan.IsAnimating = false;// IsAnimating=trueのときにそのまま選曲画面に戻ると、文字列が描画されない問題修正用。 + OpenTaiko.tテクスチャの解放(ref this.tx背景); + + base.DeActivate(); + } + public override void CreateManagedResource() { + base.CreateManagedResource(); + } + public override void ReleaseManagedResource() { + Trace.TraceInformation("CStage演奏画面共通 リソースの開放"); + base.ReleaseManagedResource(); + } + + // その他 + + + //----------------- + public class CHITCOUNTOFRANK { + // Fields + public int Good; + public int Great; + public int Miss; + public int Perfect; + public int Poor; + + // Properties + public int this[int index] { + get { + switch (index) { + case 0: + return this.Perfect; + + case 1: + return this.Great; + + case 2: + return this.Good; + + case 3: + return this.Poor; + + case 4: + return this.Miss; + } + throw new IndexOutOfRangeException(); + } + set { + switch (index) { + case 0: + this.Perfect = value; + return; + + case 1: + this.Great = value; + return; + + case 2: + this.Good = value; + return; + + case 3: + this.Poor = value; + return; + + case 4: + this.Miss = value; + return; + } + throw new IndexOutOfRangeException(); + } + } + } + + + + protected struct stmixer { + internal bool bIsAdd; + internal CSound csound; + internal bool b演奏終了後も再生が続くチップである; + }; + + /// + /// 分岐用のスコアをまとめるクラス。 + /// .2020.04.21.akasoko26 + /// + public class CBRANCHSCORE { + public CBRANCHSCORE cBigNotes;//大音符分岐時の情報をまとめるため + public int nRoll; + public int nGreat; + public int nGood; + public int nMiss; + public int nScore; + public int nADLIB; + public int nMine; + } + + public int[] JPOSCROLLX = new int[5]; + public int GetJPOSCROLLX(int player) { + double screen_ratio = OpenTaiko.Skin.Resolution[0] / 1280.0; + return (int)(JPOSCROLLX[player] * screen_ratio); + } + public int[] NoteOriginX { + get { + if (OpenTaiko.ConfigIni.nPlayerCount == 5) { + return new int[] { + OpenTaiko.Skin.nScrollField_5P[0] + (OpenTaiko.Skin.Game_UIMove_5P[0] * 0) + GetJPOSCROLLX(0), + OpenTaiko.Skin.nScrollField_5P[0] + (OpenTaiko.Skin.Game_UIMove_5P[0] * 1) + GetJPOSCROLLX(1), + OpenTaiko.Skin.nScrollField_5P[0] + (OpenTaiko.Skin.Game_UIMove_5P[0] * 2) + GetJPOSCROLLX(2), + OpenTaiko.Skin.nScrollField_5P[0] + (OpenTaiko.Skin.Game_UIMove_5P[0] * 3) + GetJPOSCROLLX(3), + OpenTaiko.Skin.nScrollField_5P[0] + (OpenTaiko.Skin.Game_UIMove_5P[0] * 4) + GetJPOSCROLLX(4) + }; + } else if (OpenTaiko.ConfigIni.nPlayerCount == 4 || OpenTaiko.ConfigIni.nPlayerCount == 3) { + return new int[] { + OpenTaiko.Skin.nScrollField_4P[0] + (OpenTaiko.Skin.Game_UIMove_4P[0] * 0) + GetJPOSCROLLX(0), + OpenTaiko.Skin.nScrollField_4P[0] + (OpenTaiko.Skin.Game_UIMove_4P[0] * 1) + GetJPOSCROLLX(1), + OpenTaiko.Skin.nScrollField_4P[0] + (OpenTaiko.Skin.Game_UIMove_4P[0] * 2) + GetJPOSCROLLX(2), + OpenTaiko.Skin.nScrollField_4P[0] + (OpenTaiko.Skin.Game_UIMove_4P[0] * 3) + GetJPOSCROLLX(3) + }; } else { - nAddScoreNiji[0] = (double)Math.Ceiling((decimal)(1000000 - (ballons * 100)) / songNotes / 10) * 10; + return new int[] { + OpenTaiko.Skin.nScrollFieldX[0] + GetJPOSCROLLX(0), + OpenTaiko.Skin.nScrollFieldX[1] + GetJPOSCROLLX(1) + }; } } + } - public void ftDanReSetBranches(bool hasBranches) { - this.tBranchReset(0); - - OpenTaiko.stage演奏ドラム画面.nレーン用表示コース[0] = CDTX.ECourse.eNormal; - OpenTaiko.stage演奏ドラム画面.bUseBranch[0] = hasBranches; - - // TJAPlayer3.stage選曲.r確定されたスコア.譜面情報.b譜面分岐[(int)Difficulty.Dan] = hasBranches; - } - - - public override void DeActivate() { - this.bgmlength = 1; - this.L最後に再生したHHの実WAV番号.Clear(); // #23921 2011.1.4 yyagi - this.L最後に再生したHHの実WAV番号 = null; // - this.ctチップ模様アニメ.Drums = null; - this.ctチップ模様アニメ.Guitar = null; - this.ctチップ模様アニメ.Bass = null; - this.ctチップ模様アニメ.Taiko = null; - - this.ctCamHMove = null; - this.ctCamVMove = null; - this.ctCamHScale = null; - this.ctCamVScale = null; - this.ctCamRotation = null; - this.ctCamZoom = null; - - OpenTaiko.borderColor = new Color4(0f, 0f, 0f, 0f); - OpenTaiko.fCamXOffset = 0.0f; - OpenTaiko.fCamYOffset = 0.0f; - OpenTaiko.fCamXScale = 1.0f; - OpenTaiko.fCamYScale = 1.0f; - OpenTaiko.fCamRotation = 0.0f; - OpenTaiko.fCamZoomFactor = 1.0f; - - for (int i = 0; i < 5; i++) { - ctChipAnime[i] = null; - ctChipAnimeLag[i] = null; - OpenTaiko.ConfigIni.nGameType[i] = eFirstGameType[i]; - bSplitLane[i] = false; - } - - listWAV.Clear(); - listWAV = null; - listChip = null; - queueMixerSound.Clear(); - queueMixerSound = null; - cInvisibleChip.Dispose(); - cInvisibleChip = null; - // GCSettings.LatencyMode = this.gclatencymode; - - var meanLag = CLagLogger.LogAndReturnMeanLag(); - - this.actDan.IsAnimating = false;// IsAnimating=trueのときにそのまま選曲画面に戻ると、文字列が描画されない問題修正用。 - OpenTaiko.tテクスチャの解放(ref this.tx背景); - - base.DeActivate(); - } - public override void CreateManagedResource() { - base.CreateManagedResource(); - } - public override void ReleaseManagedResource() { - Trace.TraceInformation("CStage演奏画面共通 リソースの開放"); - base.ReleaseManagedResource(); - } - - // その他 - - - //----------------- - public class CHITCOUNTOFRANK { - // Fields - public int Good; - public int Great; - public int Miss; - public int Perfect; - public int Poor; - - // Properties - public int this[int index] { - get { - switch (index) { - case 0: - return this.Perfect; - - case 1: - return this.Great; - - case 2: - return this.Good; - - case 3: - return this.Poor; - - case 4: - return this.Miss; - } - throw new IndexOutOfRangeException(); - } - set { - switch (index) { - case 0: - this.Perfect = value; - return; - - case 1: - this.Great = value; - return; - - case 2: - this.Good = value; - return; - - case 3: - this.Poor = value; - return; - - case 4: - this.Miss = value; - return; - } - throw new IndexOutOfRangeException(); - } + public int[] JPOSCROLLY = new int[5]; + public int GetJPOSCROLLY(int player) { + double screen_ratio = OpenTaiko.Skin.Resolution[1] / 720.0; + return (int)(JPOSCROLLY[player] * screen_ratio); + } + public int[] NoteOriginY { + get { + if (OpenTaiko.ConfigIni.nPlayerCount == 5) { + return new int[] { + OpenTaiko.Skin.nScrollField_5P[1] + (OpenTaiko.Skin.Game_UIMove_5P[1] * 0) + GetJPOSCROLLY(0), + OpenTaiko.Skin.nScrollField_5P[1] + (OpenTaiko.Skin.Game_UIMove_5P[1] * 1) + GetJPOSCROLLY(1), + OpenTaiko.Skin.nScrollField_5P[1] + (OpenTaiko.Skin.Game_UIMove_5P[1] * 2) + GetJPOSCROLLY(2), + OpenTaiko.Skin.nScrollField_5P[1] + (OpenTaiko.Skin.Game_UIMove_5P[1] * 3) + GetJPOSCROLLY(3), + OpenTaiko.Skin.nScrollField_5P[1] + (OpenTaiko.Skin.Game_UIMove_5P[1] * 4) + GetJPOSCROLLY(4) + }; + } else if (OpenTaiko.ConfigIni.nPlayerCount == 4 || OpenTaiko.ConfigIni.nPlayerCount == 3) { + return new int[] { + OpenTaiko.Skin.nScrollField_4P[1] + (OpenTaiko.Skin.Game_UIMove_4P[1] * 0) + GetJPOSCROLLY(0), + OpenTaiko.Skin.nScrollField_4P[1] + (OpenTaiko.Skin.Game_UIMove_4P[1] * 1) + GetJPOSCROLLY(1), + OpenTaiko.Skin.nScrollField_4P[1] + (OpenTaiko.Skin.Game_UIMove_4P[1] * 2) + GetJPOSCROLLY(2), + OpenTaiko.Skin.nScrollField_4P[1] + (OpenTaiko.Skin.Game_UIMove_4P[1] * 3) + GetJPOSCROLLY(3) + }; + } else { + return new int[] { + OpenTaiko.Skin.nScrollFieldY[0] + GetJPOSCROLLY(0), + OpenTaiko.Skin.nScrollFieldY[1] + GetJPOSCROLLY(1) + }; } } + } + + public CAct演奏AVI actAVI; + public Rainbow Rainbow; + public CAct演奏Combo共通 actCombo; + //protected CActFIFOBlack actFI; + public CActFIFOStart actFI; + protected CActFIFOBlack actFO; + protected CActFIFOResult actFOClear; + public CAct演奏ゲージ共通 actGauge; + + public CActImplDancer actDancer; + protected CActImplJudgeText actJudgeString; + public TaikoLaneFlash actTaikoLaneFlash; + public CAct演奏パネル文字列 actPanel; + public CAct演奏演奏情報 actPlayInfo; + public CAct演奏スコア共通 actScore; + public CAct演奏ステージ失敗 actStageFailed; + protected CAct演奏スクロール速度 act譜面スクロール速度; + protected CActImplRoll actRoll; + public CActImplBalloon actBalloon; + public CActImplCharacter actChara; + protected CActImplRollEffect actRollChara; + protected CActImplComboBalloon actComboBalloon; + protected CAct演奏Combo音声 actComboVoice; + protected CAct演奏PauseMenu actPauseMenu; + public CActImplChipEffects actChipEffects; + public CActImplFooter actFooter; + public CActImplRunner actRunner; + public CActImplMob actMob; + public Dan_Cert actDan; + public AIBattle actAIBattle; + public CActImplTrainingMode actTokkun; + public bool bPAUSE; + public bool[] bIsAlreadyCleared; + public bool[] bIsAlreadyMaxed; + protected bool b演奏にMIDI入力を使った; + protected bool b演奏にキーボードを使った; + protected bool b演奏にジョイパッドを使った; + protected bool b演奏にマウスを使った; + protected STDGBVALUE ctチップ模様アニメ; + public CCounter[] ctChipAnime; + public CCounter[] ctChipAnimeLag; + private int bgmlength = 1; + + protected EGameplayScreenReturnValue eフェードアウト完了時の戻り値; + protected readonly int[] nチャンネル0Atoパッド08 = new int[] { 1, 2, 3, 4, 5, 7, 6, 1, 8, 0, 9, 9 }; + protected readonly int[] nチャンネル0Atoレーン07 = new int[] { 1, 2, 3, 4, 5, 7, 6, 1, 9, 0, 8, 8 }; + // RD LC LP RD + protected readonly int[] nパッド0Atoチャンネル0A = new int[] { 0x11, 0x12, 0x13, 0x14, 0x15, 0x17, 0x16, 0x18, 0x19, 0x1a, 0x1b, 0x1c }; + protected readonly int[] nパッド0Atoパッド08 = new int[] { 1, 2, 3, 4, 5, 6, 7, 1, 8, 0, 9, 9 };// パッド画像のヒット処理用 + // HH SD BD HT LT FT CY HHO RD LC LP LBD + protected readonly int[] nパッド0Atoレーン07 = new int[] { 1, 2, 3, 4, 5, 6, 7, 1, 9, 0, 8, 8 }; + public STDGBVALUE nヒット数_Auto含まない; + public STDGBVALUE nヒット数_Auto含む; + public bool ShowVideo; + public int[] n良; + public int[] nHighestCombo; + public int[] nCombo; + public int[] n可; + public int[] n不可; + public int[] n連打; + public int[] nADLIB; + public int[] nMine; + + public int n現在のトップChip = -1; + protected int[] n最後に再生したBGMの実WAV番号 = new int[50]; + protected int n最後に再生したHHのチャンネル番号; + protected List L最後に再生したHHの実WAV番号; // #23921 2011.1.4 yyagi: change "int" to "List", for recording multiple wav No. + + protected volatile Queue queueMixerSound; // #24820 2013.1.21 yyagi まずは単純にAdd/Removeを1個のキューでまとめて管理するやり方で設計する + protected DateTime dtLastQueueOperation; // + protected bool bIsDirectSound; // + protected double db再生速度; + protected bool bValidScore; + // protected bool bDTXVmode; + protected STDGBVALUE bReverse; + + protected STDGBVALUE r現在の歓声Chip; + protected CTexture txチップ; + protected CTexture txヒットバー; + + protected CTexture tx背景; + + // protected int nRisky_InitialVar, nRiskyTime; // #23559 2011.7.28 yyagi → CAct演奏ゲージ共通クラスに隠蔽 + protected int nPolyphonicSounds; + protected List[] listChip = new List[5]; + protected Dictionary listWAV; + protected CInvisibleChip cInvisibleChip; + protected bool bUseOSTimer; + + public CBRANCHSCORE[] CBranchScore = new CBRANCHSCORE[6]; + public CBRANCHSCORE[] CChartScore = new CBRANCHSCORE[5]; + public CBRANCHSCORE[] CSectionScore = new CBRANCHSCORE[5]; + + public bool[] bIsGOGOTIME = new bool[5]; + public bool[] bIsMiss = new bool[5]; + public bool[] bUseBranch = new bool[5]; + public CDTX.ECourse[] n現在のコース = new CDTX.ECourse[5]; //0:普通譜面 1:玄人譜面 2:達人譜面 + public CDTX.ECourse[] n次回のコース = new CDTX.ECourse[5]; + public CDTX.ECourse[] nレーン用表示コース = new CDTX.ECourse[5]; + protected bool[] b譜面分岐中 = new bool[] { false, false, false, false, false }; + protected int[] n分岐した回数 = new int[5]; + protected int[] nJPOSSCROLL = new int[5]; + + public bool[] b強制的に分岐させた = new bool[] { false, false, false, false, false }; + public bool[] bLEVELHOLD = new bool[] { false, false, false, false, false }; + protected int nListCount; + + private readonly int[] ShownLyric = new int[] { 0, 0 }; + public bool[] b連打中 = new bool[] { false, false, false, false, false }; //奥の手 + private int[] n合計連打数 = new int[5]; + protected int[] n風船残り = new int[5]; + protected int[] n現在の連打数 = new int[5]; + public int[] Chara_MissCount; + protected ERollState eRollState; + protected bool[] ifp = { false, false, false, false, false }; + protected bool[] isDeniedPlaying = { false, false, false, false, false }; + + protected int nタイマ番号; + protected int n現在の音符の顔番号; + + protected int nWaitButton; + + protected int[] nStoredHit; + private EGameType[] eFirstGameType; + protected bool[] bSplitLane; + public CDTX.CChip[] chip現在処理中の連打チップ = new CDTX.CChip[5]; - protected struct stmixer { - internal bool bIsAdd; - internal CSound csound; - internal bool b演奏終了後も再生が続くチップである; + protected const int NOTE_GAP = 25; + public int nLoopCount_Clear; + protected int[] nScore = new int[11]; + protected int[] nHand = new int[5]; + protected CSound[] soundRed = new CSound[5]; + protected CSound[] soundBlue = new CSound[5]; + protected CSound[] soundAdlib = new CSound[5]; + protected CSound[] soundClap = new CSound[5]; + public bool bDoublePlay; // 2016.08.21 kairera0467 表示だけ。 + protected Stopwatch sw; // 2011.6.13 最適化検討用のストップウォッチ + public int ListDan_Number; + private bool IsDanFailed; + private bool[] b強制分岐譜面 = new bool[5]; + private CDTX.E分岐種類 eBranch種類; + public double nBranch条件数値A; + public double nBranch条件数値B; + private readonly int[] NowProcessingChip = new int[] { 0, 0, 0, 0, 0 }; + protected int nCurrentKusudamaRollCount; + protected int nCurrentKusudamaCount; + + private float _AIBattleState; + private Queue[] _AIBattleStateBatch; + public int AIBattleState { + get { + return (int)_AIBattleState; + } + } + public bool bIsAIBattleWin { + get; + private set; + } + + public class AIBattleSection { + public enum EndType { + None, + Clear, + Lose + } + + public int Length; + public int StartTime; + public int EndTime; + + public EndType End; + public bool IsAnimated; + } + + public List AIBattleSections; + + public int NowAIBattleSectionCount; + public int NowAIBattleSectionTime; + public AIBattleSection NowAIBattleSection { + get { + return AIBattleSections[Math.Min(NowAIBattleSectionCount, AIBattleSections.Count - 1)]; + } + } + + private void PassAIBattleSection() { + if (AIBattleState >= 0) { + NowAIBattleSection.End = AIBattleSection.EndType.Clear; + if (OpenTaiko.ConfigIni.nAILevel < 10) + OpenTaiko.ConfigIni.nAILevel++; + } else { + NowAIBattleSection.End = AIBattleSection.EndType.Lose; + if (OpenTaiko.ConfigIni.nAILevel > 1) + OpenTaiko.ConfigIni.nAILevel--; + } + actAIBattle.BatchAnimeCounter.CurrentValue = 0; + _AIBattleState = 0; + + for (int i = 0; i < 5; i++) { + this.CSectionScore[i] = new CBRANCHSCORE(); + } + + int clearCount = 0; + for (int i = 0; i < OpenTaiko.stage演奏ドラム画面.AIBattleSections.Count; i++) { + if (OpenTaiko.stage演奏ドラム画面.AIBattleSections[i].End == CStage演奏画面共通.AIBattleSection.EndType.Clear) { + clearCount++; + } + } + bIsAIBattleWin = clearCount >= OpenTaiko.stage演奏ドラム画面.AIBattleSections.Count / 2.0; + } + + private void AIRegisterInput(int nPlayer, float move) { + if (nPlayer < 2 && nPlayer >= 0) { + _AIBattleStateBatch[nPlayer].Enqueue(move); + while (_AIBattleStateBatch[0].Count > 0 && _AIBattleStateBatch[1].Count > 0) { + _AIBattleState += _AIBattleStateBatch[0].Dequeue() - _AIBattleStateBatch[1].Dequeue(); + _AIBattleState = Math.Max(Math.Min(_AIBattleState, 9), -9); + } + } + } + + private void UpdateCharaCounter(int nPlayer) { + for (int i = 0; i < 5; i++) { + ctChipAnime[i] = new CCounter(0, 3, 60.0 / OpenTaiko.stage演奏ドラム画面.actPlayInfo.dbBPM[i] * 1 / 4 / OpenTaiko.ConfigIni.SongPlaybackSpeed, SoundManager.PlayTimer); + } + + OpenTaiko.stage演奏ドラム画面.PuchiChara.ChangeBPM(60.0 / OpenTaiko.stage演奏ドラム画面.actPlayInfo.dbBPM[nPlayer] / OpenTaiko.ConfigIni.SongPlaybackSpeed); + } + + public void AddMixer(CSound cs, bool _b演奏終了後も再生が続くチップである) { + stmixer stm = new stmixer() { + bIsAdd = true, + csound = cs, + b演奏終了後も再生が続くチップである = _b演奏終了後も再生が続くチップである }; - - /// - /// 分岐用のスコアをまとめるクラス。 - /// .2020.04.21.akasoko26 - /// - public class CBRANCHSCORE { - public CBRANCHSCORE cBigNotes;//大音符分岐時の情報をまとめるため - public int nRoll; - public int nGreat; - public int nGood; - public int nMiss; - public int nScore; - public int nADLIB; - public int nMine; - } - - public int[] JPOSCROLLX = new int[5]; - public int GetJPOSCROLLX(int player) { - double screen_ratio = OpenTaiko.Skin.Resolution[0] / 1280.0; - return (int)(JPOSCROLLX[player] * screen_ratio); - } - public int[] NoteOriginX { - get { - if (OpenTaiko.ConfigIni.nPlayerCount == 5) { - return new int[] { - OpenTaiko.Skin.nScrollField_5P[0] + (OpenTaiko.Skin.Game_UIMove_5P[0] * 0) + GetJPOSCROLLX(0), - OpenTaiko.Skin.nScrollField_5P[0] + (OpenTaiko.Skin.Game_UIMove_5P[0] * 1) + GetJPOSCROLLX(1), - OpenTaiko.Skin.nScrollField_5P[0] + (OpenTaiko.Skin.Game_UIMove_5P[0] * 2) + GetJPOSCROLLX(2), - OpenTaiko.Skin.nScrollField_5P[0] + (OpenTaiko.Skin.Game_UIMove_5P[0] * 3) + GetJPOSCROLLX(3), - OpenTaiko.Skin.nScrollField_5P[0] + (OpenTaiko.Skin.Game_UIMove_5P[0] * 4) + GetJPOSCROLLX(4) - }; - } else if (OpenTaiko.ConfigIni.nPlayerCount == 4 || OpenTaiko.ConfigIni.nPlayerCount == 3) { - return new int[] { - OpenTaiko.Skin.nScrollField_4P[0] + (OpenTaiko.Skin.Game_UIMove_4P[0] * 0) + GetJPOSCROLLX(0), - OpenTaiko.Skin.nScrollField_4P[0] + (OpenTaiko.Skin.Game_UIMove_4P[0] * 1) + GetJPOSCROLLX(1), - OpenTaiko.Skin.nScrollField_4P[0] + (OpenTaiko.Skin.Game_UIMove_4P[0] * 2) + GetJPOSCROLLX(2), - OpenTaiko.Skin.nScrollField_4P[0] + (OpenTaiko.Skin.Game_UIMove_4P[0] * 3) + GetJPOSCROLLX(3) - }; - } else { - return new int[] { - OpenTaiko.Skin.nScrollFieldX[0] + GetJPOSCROLLX(0), - OpenTaiko.Skin.nScrollFieldX[1] + GetJPOSCROLLX(1) - }; - } - } - } - - public int[] JPOSCROLLY = new int[5]; - public int GetJPOSCROLLY(int player) { - double screen_ratio = OpenTaiko.Skin.Resolution[1] / 720.0; - return (int)(JPOSCROLLY[player] * screen_ratio); - } - public int[] NoteOriginY { - get { - if (OpenTaiko.ConfigIni.nPlayerCount == 5) { - return new int[] { - OpenTaiko.Skin.nScrollField_5P[1] + (OpenTaiko.Skin.Game_UIMove_5P[1] * 0) + GetJPOSCROLLY(0), - OpenTaiko.Skin.nScrollField_5P[1] + (OpenTaiko.Skin.Game_UIMove_5P[1] * 1) + GetJPOSCROLLY(1), - OpenTaiko.Skin.nScrollField_5P[1] + (OpenTaiko.Skin.Game_UIMove_5P[1] * 2) + GetJPOSCROLLY(2), - OpenTaiko.Skin.nScrollField_5P[1] + (OpenTaiko.Skin.Game_UIMove_5P[1] * 3) + GetJPOSCROLLY(3), - OpenTaiko.Skin.nScrollField_5P[1] + (OpenTaiko.Skin.Game_UIMove_5P[1] * 4) + GetJPOSCROLLY(4) - }; - } else if (OpenTaiko.ConfigIni.nPlayerCount == 4 || OpenTaiko.ConfigIni.nPlayerCount == 3) { - return new int[] { - OpenTaiko.Skin.nScrollField_4P[1] + (OpenTaiko.Skin.Game_UIMove_4P[1] * 0) + GetJPOSCROLLY(0), - OpenTaiko.Skin.nScrollField_4P[1] + (OpenTaiko.Skin.Game_UIMove_4P[1] * 1) + GetJPOSCROLLY(1), - OpenTaiko.Skin.nScrollField_4P[1] + (OpenTaiko.Skin.Game_UIMove_4P[1] * 2) + GetJPOSCROLLY(2), - OpenTaiko.Skin.nScrollField_4P[1] + (OpenTaiko.Skin.Game_UIMove_4P[1] * 3) + GetJPOSCROLLY(3) - }; - } else { - return new int[] { - OpenTaiko.Skin.nScrollFieldY[0] + GetJPOSCROLLY(0), - OpenTaiko.Skin.nScrollFieldY[1] + GetJPOSCROLLY(1) - }; - } - } - } - - public CAct演奏AVI actAVI; - public Rainbow Rainbow; - public CAct演奏Combo共通 actCombo; - //protected CActFIFOBlack actFI; - public CActFIFOStart actFI; - protected CActFIFOBlack actFO; - protected CActFIFOResult actFOClear; - public CAct演奏ゲージ共通 actGauge; - - public CActImplDancer actDancer; - protected CActImplJudgeText actJudgeString; - public TaikoLaneFlash actTaikoLaneFlash; - public CAct演奏パネル文字列 actPanel; - public CAct演奏演奏情報 actPlayInfo; - public CAct演奏スコア共通 actScore; - public CAct演奏ステージ失敗 actStageFailed; - protected CAct演奏スクロール速度 act譜面スクロール速度; - protected CActImplRoll actRoll; - public CActImplBalloon actBalloon; - public CActImplCharacter actChara; - protected CActImplRollEffect actRollChara; - protected CActImplComboBalloon actComboBalloon; - protected CAct演奏Combo音声 actComboVoice; - protected CAct演奏PauseMenu actPauseMenu; - public CActImplChipEffects actChipEffects; - public CActImplFooter actFooter; - public CActImplRunner actRunner; - public CActImplMob actMob; - public Dan_Cert actDan; - public AIBattle actAIBattle; - public CActImplTrainingMode actTokkun; - public bool bPAUSE; - public bool[] bIsAlreadyCleared; - public bool[] bIsAlreadyMaxed; - protected bool b演奏にMIDI入力を使った; - protected bool b演奏にキーボードを使った; - protected bool b演奏にジョイパッドを使った; - protected bool b演奏にマウスを使った; - protected STDGBVALUE ctチップ模様アニメ; - public CCounter[] ctChipAnime; - public CCounter[] ctChipAnimeLag; - private int bgmlength = 1; - - protected EGameplayScreenReturnValue eフェードアウト完了時の戻り値; - protected readonly int[] nチャンネル0Atoパッド08 = new int[] { 1, 2, 3, 4, 5, 7, 6, 1, 8, 0, 9, 9 }; - protected readonly int[] nチャンネル0Atoレーン07 = new int[] { 1, 2, 3, 4, 5, 7, 6, 1, 9, 0, 8, 8 }; - // RD LC LP RD - protected readonly int[] nパッド0Atoチャンネル0A = new int[] { 0x11, 0x12, 0x13, 0x14, 0x15, 0x17, 0x16, 0x18, 0x19, 0x1a, 0x1b, 0x1c }; - protected readonly int[] nパッド0Atoパッド08 = new int[] { 1, 2, 3, 4, 5, 6, 7, 1, 8, 0, 9, 9 };// パッド画像のヒット処理用 - // HH SD BD HT LT FT CY HHO RD LC LP LBD - protected readonly int[] nパッド0Atoレーン07 = new int[] { 1, 2, 3, 4, 5, 6, 7, 1, 9, 0, 8, 8 }; - public STDGBVALUE nヒット数_Auto含まない; - public STDGBVALUE nヒット数_Auto含む; - public bool ShowVideo; - public int[] n良; - public int[] nHighestCombo; - public int[] nCombo; - public int[] n可; - public int[] n不可; - public int[] n連打; - public int[] nADLIB; - public int[] nMine; - - public int n現在のトップChip = -1; - protected int[] n最後に再生したBGMの実WAV番号 = new int[50]; - protected int n最後に再生したHHのチャンネル番号; - protected List L最後に再生したHHの実WAV番号; // #23921 2011.1.4 yyagi: change "int" to "List", for recording multiple wav No. - - protected volatile Queue queueMixerSound; // #24820 2013.1.21 yyagi まずは単純にAdd/Removeを1個のキューでまとめて管理するやり方で設計する - protected DateTime dtLastQueueOperation; // - protected bool bIsDirectSound; // - protected double db再生速度; - protected bool bValidScore; - // protected bool bDTXVmode; - protected STDGBVALUE bReverse; - - protected STDGBVALUE r現在の歓声Chip; - protected CTexture txチップ; - protected CTexture txヒットバー; - - protected CTexture tx背景; - - // protected int nRisky_InitialVar, nRiskyTime; // #23559 2011.7.28 yyagi → CAct演奏ゲージ共通クラスに隠蔽 - protected int nPolyphonicSounds; - protected List[] listChip = new List[5]; - protected Dictionary listWAV; - protected CInvisibleChip cInvisibleChip; - protected bool bUseOSTimer; - - public CBRANCHSCORE[] CBranchScore = new CBRANCHSCORE[6]; - public CBRANCHSCORE[] CChartScore = new CBRANCHSCORE[5]; - public CBRANCHSCORE[] CSectionScore = new CBRANCHSCORE[5]; - - public bool[] bIsGOGOTIME = new bool[5]; - public bool[] bIsMiss = new bool[5]; - public bool[] bUseBranch = new bool[5]; - public CDTX.ECourse[] n現在のコース = new CDTX.ECourse[5]; //0:普通譜面 1:玄人譜面 2:達人譜面 - public CDTX.ECourse[] n次回のコース = new CDTX.ECourse[5]; - public CDTX.ECourse[] nレーン用表示コース = new CDTX.ECourse[5]; - protected bool[] b譜面分岐中 = new bool[] { false, false, false, false, false }; - protected int[] n分岐した回数 = new int[5]; - protected int[] nJPOSSCROLL = new int[5]; - - public bool[] b強制的に分岐させた = new bool[] { false, false, false, false, false }; - public bool[] bLEVELHOLD = new bool[] { false, false, false, false, false }; - protected int nListCount; - - private readonly int[] ShownLyric = new int[] { 0, 0 }; - public bool[] b連打中 = new bool[] { false, false, false, false, false }; //奥の手 - private int[] n合計連打数 = new int[5]; - protected int[] n風船残り = new int[5]; - protected int[] n現在の連打数 = new int[5]; - public int[] Chara_MissCount; - protected ERollState eRollState; - protected bool[] ifp = { false, false, false, false, false }; - protected bool[] isDeniedPlaying = { false, false, false, false, false }; - - protected int nタイマ番号; - protected int n現在の音符の顔番号; - - protected int nWaitButton; - - protected int[] nStoredHit; - private EGameType[] eFirstGameType; - protected bool[] bSplitLane; - - - public CDTX.CChip[] chip現在処理中の連打チップ = new CDTX.CChip[5]; - - protected const int NOTE_GAP = 25; - public int nLoopCount_Clear; - protected int[] nScore = new int[11]; - protected int[] nHand = new int[5]; - protected CSound[] soundRed = new CSound[5]; - protected CSound[] soundBlue = new CSound[5]; - protected CSound[] soundAdlib = new CSound[5]; - protected CSound[] soundClap = new CSound[5]; - public bool bDoublePlay; // 2016.08.21 kairera0467 表示だけ。 - protected Stopwatch sw; // 2011.6.13 最適化検討用のストップウォッチ - public int ListDan_Number; - private bool IsDanFailed; - private bool[] b強制分岐譜面 = new bool[5]; - private CDTX.E分岐種類 eBranch種類; - public double nBranch条件数値A; - public double nBranch条件数値B; - private readonly int[] NowProcessingChip = new int[] { 0, 0, 0, 0, 0 }; - protected int nCurrentKusudamaRollCount; - protected int nCurrentKusudamaCount; - - private float _AIBattleState; - private Queue[] _AIBattleStateBatch; - public int AIBattleState { - get { - return (int)_AIBattleState; - } - } - public bool bIsAIBattleWin { - get; - private set; - } - - public class AIBattleSection { - public enum EndType { - None, - Clear, - Lose - } - - public int Length; - public int StartTime; - public int EndTime; - - public EndType End; - public bool IsAnimated; - } - - public List AIBattleSections; - - public int NowAIBattleSectionCount; - public int NowAIBattleSectionTime; - public AIBattleSection NowAIBattleSection { - get { - return AIBattleSections[Math.Min(NowAIBattleSectionCount, AIBattleSections.Count - 1)]; - } - } - - private void PassAIBattleSection() { - if (AIBattleState >= 0) { - NowAIBattleSection.End = AIBattleSection.EndType.Clear; - if (OpenTaiko.ConfigIni.nAILevel < 10) - OpenTaiko.ConfigIni.nAILevel++; - } else { - NowAIBattleSection.End = AIBattleSection.EndType.Lose; - if (OpenTaiko.ConfigIni.nAILevel > 1) - OpenTaiko.ConfigIni.nAILevel--; - } - actAIBattle.BatchAnimeCounter.CurrentValue = 0; - _AIBattleState = 0; - - for (int i = 0; i < 5; i++) { - this.CSectionScore[i] = new CBRANCHSCORE(); - } - - int clearCount = 0; - for (int i = 0; i < OpenTaiko.stage演奏ドラム画面.AIBattleSections.Count; i++) { - if (OpenTaiko.stage演奏ドラム画面.AIBattleSections[i].End == CStage演奏画面共通.AIBattleSection.EndType.Clear) { - clearCount++; - } - } - bIsAIBattleWin = clearCount >= OpenTaiko.stage演奏ドラム画面.AIBattleSections.Count / 2.0; - } - - private void AIRegisterInput(int nPlayer, float move) { - if (nPlayer < 2 && nPlayer >= 0) { - _AIBattleStateBatch[nPlayer].Enqueue(move); - while (_AIBattleStateBatch[0].Count > 0 && _AIBattleStateBatch[1].Count > 0) { - _AIBattleState += _AIBattleStateBatch[0].Dequeue() - _AIBattleStateBatch[1].Dequeue(); - _AIBattleState = Math.Max(Math.Min(_AIBattleState, 9), -9); - } - } - } - - private void UpdateCharaCounter(int nPlayer) { - for (int i = 0; i < 5; i++) { - ctChipAnime[i] = new CCounter(0, 3, 60.0 / OpenTaiko.stage演奏ドラム画面.actPlayInfo.dbBPM[i] * 1 / 4 / OpenTaiko.ConfigIni.SongPlaybackSpeed, SoundManager.PlayTimer); - } - - OpenTaiko.stage演奏ドラム画面.PuchiChara.ChangeBPM(60.0 / OpenTaiko.stage演奏ドラム画面.actPlayInfo.dbBPM[nPlayer] / OpenTaiko.ConfigIni.SongPlaybackSpeed); - } - - public void AddMixer(CSound cs, bool _b演奏終了後も再生が続くチップである) { - stmixer stm = new stmixer() { - bIsAdd = true, - csound = cs, - b演奏終了後も再生が続くチップである = _b演奏終了後も再生が続くチップである - }; - queueMixerSound.Enqueue(stm); - // Debug.WriteLine( "★Queue: add " + Path.GetFileName( stm.csound.strファイル名 )); - } - public void RemoveMixer(CSound cs) { - stmixer stm = new stmixer() { - bIsAdd = false, - csound = cs, - b演奏終了後も再生が続くチップである = false - }; - queueMixerSound.Enqueue(stm); - // Debug.WriteLine( "★Queue: remove " + Path.GetFileName( stm.csound.strファイル名 )); - } - public void ManageMixerQueue() { - // もしサウンドの登録/削除が必要なら、実行する - if (queueMixerSound.Count > 0) { - //Debug.WriteLine( "☆queueLength=" + queueMixerSound.Count ); - DateTime dtnow = DateTime.Now; - TimeSpan ts = dtnow - dtLastQueueOperation; - if (ts.Milliseconds > 7) { - for (int i = 0; i < 2 && queueMixerSound.Count > 0; i++) { - dtLastQueueOperation = dtnow; - stmixer stm = queueMixerSound.Dequeue(); - if (stm.bIsAdd) { - OpenTaiko.SoundManager.AddMixer(stm.csound, db再生速度, stm.b演奏終了後も再生が続くチップである); - } else { - OpenTaiko.SoundManager.RemoveMixer(stm.csound); - } + queueMixerSound.Enqueue(stm); + // Debug.WriteLine( "★Queue: add " + Path.GetFileName( stm.csound.strファイル名 )); + } + public void RemoveMixer(CSound cs) { + stmixer stm = new stmixer() { + bIsAdd = false, + csound = cs, + b演奏終了後も再生が続くチップである = false + }; + queueMixerSound.Enqueue(stm); + // Debug.WriteLine( "★Queue: remove " + Path.GetFileName( stm.csound.strファイル名 )); + } + public void ManageMixerQueue() { + // もしサウンドの登録/削除が必要なら、実行する + if (queueMixerSound.Count > 0) { + //Debug.WriteLine( "☆queueLength=" + queueMixerSound.Count ); + DateTime dtnow = DateTime.Now; + TimeSpan ts = dtnow - dtLastQueueOperation; + if (ts.Milliseconds > 7) { + for (int i = 0; i < 2 && queueMixerSound.Count > 0; i++) { + dtLastQueueOperation = dtnow; + stmixer stm = queueMixerSound.Dequeue(); + if (stm.bIsAdd) { + OpenTaiko.SoundManager.AddMixer(stm.csound, db再生速度, stm.b演奏終了後も再生が続くチップである); + } else { + OpenTaiko.SoundManager.RemoveMixer(stm.csound); } } } } + } - internal ENoteJudge e指定時刻からChipのJUDGEを返す(long nTime, CDTX.CChip pChip, int player = 0) { - var e判定 = e指定時刻からChipのJUDGEを返すImpl(nTime, pChip, player); - return e判定; + internal ENoteJudge e指定時刻からChipのJUDGEを返す(long nTime, CDTX.CChip pChip, int player = 0) { + var e判定 = e指定時刻からChipのJUDGEを返すImpl(nTime, pChip, player); + return e判定; + } + + private bool tEasyTimeZones(int nPlayer) { + bool _timingzonesAreEasy = false; + + int diff = OpenTaiko.stageSongSelect.nChoosenSongDifficulty[nPlayer]; + + // Diff = Normal or Easy + if (diff <= (int)Difficulty.Normal) { + _timingzonesAreEasy = true; } - private bool tEasyTimeZones(int nPlayer) { - bool _timingzonesAreEasy = false; + // Diff = Dan and current song is Normal or Easy + if (diff == (int)Difficulty.Dan) { + int _nb = OpenTaiko.stage演奏ドラム画面.actDan.NowShowingNumber; + var _danSongs = OpenTaiko.stageSongSelect.rChoosenSong.DanSongs; - int diff = OpenTaiko.stageSongSelect.nChoosenSongDifficulty[nPlayer]; + if (_nb < _danSongs.Count) { + var _currentDiff = _danSongs[_nb].Difficulty; + if (_currentDiff <= (int)Difficulty.Normal) + _timingzonesAreEasy = true; - // Diff = Normal or Easy - if (diff <= (int)Difficulty.Normal) { - _timingzonesAreEasy = true; } - - // Diff = Dan and current song is Normal or Easy - if (diff == (int)Difficulty.Dan) { - int _nb = OpenTaiko.stage演奏ドラム画面.actDan.NowShowingNumber; - var _danSongs = OpenTaiko.stageSongSelect.rChoosenSong.DanSongs; - - if (_nb < _danSongs.Count) { - var _currentDiff = _danSongs[_nb].Difficulty; - if (_currentDiff <= (int)Difficulty.Normal) - _timingzonesAreEasy = true; - - } - } - - // Diff = Tower and SIDE is Normal - if (diff == (int)Difficulty.Tower) { - _timingzonesAreEasy = OpenTaiko.stageSongSelect.rChoosenSong.nSide == CDTX.ESide.eNormal; - } - - return _timingzonesAreEasy; } - private void tIncreaseComboDan(int danSong) { - this.nCombo[danSong]++; - if (this.nCombo[danSong] > this.nHighestCombo[danSong]) - this.nHighestCombo[danSong] = this.nCombo[danSong]; + // Diff = Tower and SIDE is Normal + if (diff == (int)Difficulty.Tower) { + _timingzonesAreEasy = OpenTaiko.stageSongSelect.rChoosenSong.nSide == CDTX.ESide.eNormal; } - private ENoteJudge e指定時刻からChipのJUDGEを返すImpl(long nTime, CDTX.CChip pChip, int player = 0) { + return _timingzonesAreEasy; + } - if (pChip != null) { - pChip.nLag = (int)(nTime - pChip.n発声時刻ms); // #23580 2011.1.3 yyagi: add "nInputAdjustTime" to add input timing adjust feature - int nDeltaTime = Math.Abs(pChip.nLag); - //Debug.WriteLine("nAbsTime=" + (nTime - pChip.n発声時刻ms) + ", nDeltaTime=" + (nTime + nInputAdjustTime - pChip.n発声時刻ms)); - if (NotesManager.IsRoll(pChip) || NotesManager.IsFuzeRoll(pChip)) { - if ((SoundManager.PlayTimer.NowTimeMs * OpenTaiko.ConfigIni.SongPlaybackSpeed) > pChip.n発声時刻ms && (SoundManager.PlayTimer.NowTimeMs * OpenTaiko.ConfigIni.SongPlaybackSpeed) < pChip.nノーツ終了時刻ms) { - return ENoteJudge.Perfect; - } - } else if (NotesManager.IsGenericBalloon(pChip)) { - if ((SoundManager.PlayTimer.NowTimeMs * OpenTaiko.ConfigIni.SongPlaybackSpeed) >= pChip.n発声時刻ms - 17 && (SoundManager.PlayTimer.NowTimeMs * OpenTaiko.ConfigIni.SongPlaybackSpeed) < pChip.nノーツ終了時刻ms) { - return ENoteJudge.Perfect; - } - } + private void tIncreaseComboDan(int danSong) { + this.nCombo[danSong]++; + if (this.nCombo[danSong] > this.nHighestCombo[danSong]) + this.nHighestCombo[danSong] = this.nCombo[danSong]; + } + private ENoteJudge e指定時刻からChipのJUDGEを返すImpl(long nTime, CDTX.CChip pChip, int player = 0) { - - // To change later to adapt to Tower Ama-kuchi - //diff = Math.Min(diff, (int)Difficulty.Oni); - - int actual = OpenTaiko.GetActualPlayer(player); - - int timingShift = OpenTaiko.ConfigIni.nTimingZones[actual]; - - bool _timingzonesAreEasy = tEasyTimeZones(player); - - CConfigIni.CTimingZones tz = (_timingzonesAreEasy == true) ? OpenTaiko.ConfigIni.tzLevels[timingShift] : OpenTaiko.ConfigIni.tzLevels[2 + timingShift]; - - if (nDeltaTime <= tz.nGoodZone * OpenTaiko.ConfigIni.SongPlaybackSpeed) { + if (pChip != null) { + pChip.nLag = (int)(nTime - pChip.n発声時刻ms); // #23580 2011.1.3 yyagi: add "nInputAdjustTime" to add input timing adjust feature + int nDeltaTime = Math.Abs(pChip.nLag); + //Debug.WriteLine("nAbsTime=" + (nTime - pChip.n発声時刻ms) + ", nDeltaTime=" + (nTime + nInputAdjustTime - pChip.n発声時刻ms)); + if (NotesManager.IsRoll(pChip) || NotesManager.IsFuzeRoll(pChip)) { + if ((SoundManager.PlayTimer.NowTimeMs * OpenTaiko.ConfigIni.SongPlaybackSpeed) > pChip.n発声時刻ms && (SoundManager.PlayTimer.NowTimeMs * OpenTaiko.ConfigIni.SongPlaybackSpeed) < pChip.nノーツ終了時刻ms) { return ENoteJudge.Perfect; } - if (nDeltaTime <= tz.nOkZone * OpenTaiko.ConfigIni.SongPlaybackSpeed) { - if (OpenTaiko.ConfigIni.bJust[actual] == 1 && NotesManager.IsMissableNote(pChip)) // Just - return ENoteJudge.Poor; - return ENoteJudge.Good; + } else if (NotesManager.IsGenericBalloon(pChip)) { + if ((SoundManager.PlayTimer.NowTimeMs * OpenTaiko.ConfigIni.SongPlaybackSpeed) >= pChip.n発声時刻ms - 17 && (SoundManager.PlayTimer.NowTimeMs * OpenTaiko.ConfigIni.SongPlaybackSpeed) < pChip.nノーツ終了時刻ms) { + return ENoteJudge.Perfect; } - - - if (nDeltaTime <= tz.nBadZone * OpenTaiko.ConfigIni.SongPlaybackSpeed) { - if (OpenTaiko.ConfigIni.bJust[actual] == 2 || !NotesManager.IsMissableNote(pChip)) // Safe - return ENoteJudge.Good; - return ENoteJudge.Poor; - } - } - return ENoteJudge.Miss; + + + + // To change later to adapt to Tower Ama-kuchi + //diff = Math.Min(diff, (int)Difficulty.Oni); + + int actual = OpenTaiko.GetActualPlayer(player); + + int timingShift = OpenTaiko.ConfigIni.nTimingZones[actual]; + + bool _timingzonesAreEasy = tEasyTimeZones(player); + + CConfigIni.CTimingZones tz = (_timingzonesAreEasy == true) ? OpenTaiko.ConfigIni.tzLevels[timingShift] : OpenTaiko.ConfigIni.tzLevels[2 + timingShift]; + + if (nDeltaTime <= tz.nGoodZone * OpenTaiko.ConfigIni.SongPlaybackSpeed) { + return ENoteJudge.Perfect; + } + if (nDeltaTime <= tz.nOkZone * OpenTaiko.ConfigIni.SongPlaybackSpeed) { + if (OpenTaiko.ConfigIni.bJust[actual] == 1 && NotesManager.IsMissableNote(pChip)) // Just + return ENoteJudge.Poor; + return ENoteJudge.Good; + } + + + if (nDeltaTime <= tz.nBadZone * OpenTaiko.ConfigIni.SongPlaybackSpeed) { + if (OpenTaiko.ConfigIni.bJust[actual] == 2 || !NotesManager.IsMissableNote(pChip)) // Safe + return ENoteJudge.Good; + return ENoteJudge.Poor; + } + + } + return ENoteJudge.Miss; + } + + protected CDTX.CChip r指定時刻に一番近い連打Chip_ヒット未済問わず不可視考慮(long nTime, int nChannel, int nInputAdjustTime, int nPlayer) { + //sw2.Start(); + //Trace.TraceInformation( "NTime={0}, nChannel={1:x2}", nTime, nChannel ); + nTime += nInputAdjustTime; // #24239 2011.1.23 yyagi InputAdjust + + int nIndex_InitialPositionSearchingToPast; + if (this.n現在のトップChip == -1) // 演奏データとして1個もチップがない場合は + { + //sw2.Stop(); + return null; } - protected CDTX.CChip r指定時刻に一番近い連打Chip_ヒット未済問わず不可視考慮(long nTime, int nChannel, int nInputAdjustTime, int nPlayer) { - //sw2.Start(); - //Trace.TraceInformation( "NTime={0}, nChannel={1:x2}", nTime, nChannel ); - nTime += nInputAdjustTime; // #24239 2011.1.23 yyagi InputAdjust + List playerListChip = listChip[nPlayer]; + int count = playerListChip.Count; + int nIndex_NearestChip_Future = nIndex_InitialPositionSearchingToPast = this.n現在のトップChip; + if (this.n現在のトップChip >= count) // その時点で演奏すべきチップが既に全部無くなっていたら + { + nIndex_NearestChip_Future = nIndex_InitialPositionSearchingToPast = count - 1; + } + //int nIndex_NearestChip_Future; // = nIndex_InitialPositionSearchingToFuture; + //while ( nIndex_NearestChip_Future < count ) // 未来方向への検索 + for (; nIndex_NearestChip_Future < count; nIndex_NearestChip_Future++) { + if (((0x11 <= nChannel) && (nChannel <= 0x17)) || nChannel == 0x19) { + CDTX.CChip chip = playerListChip[nIndex_NearestChip_Future]; - int nIndex_InitialPositionSearchingToPast; - if (this.n現在のトップChip == -1) // 演奏データとして1個もチップがない場合は - { - //sw2.Stop(); - return null; - } - - List playerListChip = listChip[nPlayer]; - int count = playerListChip.Count; - int nIndex_NearestChip_Future = nIndex_InitialPositionSearchingToPast = this.n現在のトップChip; - if (this.n現在のトップChip >= count) // その時点で演奏すべきチップが既に全部無くなっていたら - { - nIndex_NearestChip_Future = nIndex_InitialPositionSearchingToPast = count - 1; - } - //int nIndex_NearestChip_Future; // = nIndex_InitialPositionSearchingToFuture; - //while ( nIndex_NearestChip_Future < count ) // 未来方向への検索 - for (; nIndex_NearestChip_Future < count; nIndex_NearestChip_Future++) { - if (((0x11 <= nChannel) && (nChannel <= 0x17)) || nChannel == 0x19) { - CDTX.CChip chip = playerListChip[nIndex_NearestChip_Future]; - - if (chip.nチャンネル番号 == nChannel) { - if (chip.n発声時刻ms > nTime) { - break; - } - if (chip.nコース != this.n次回のコース[nPlayer]) { - break; - } - nIndex_InitialPositionSearchingToPast = nIndex_NearestChip_Future; - } - continue; // ほんの僅かながら高速化 - } - - // nIndex_NearestChip_Future++; - } - int nIndex_NearestChip_Past = nIndex_InitialPositionSearchingToPast; - //while ( nIndex_NearestChip_Past >= 0 ) // 過去方向への検索 - for (; nIndex_NearestChip_Past >= 0; nIndex_NearestChip_Past--) { - if ((((0x15 <= nChannel) && (nChannel <= 0x17) || nChannel == 0x19) || (nChannel == 0x20 || nChannel == 0x21))) { - CDTX.CChip chip = playerListChip[nIndex_NearestChip_Past]; - - if (((chip.nチャンネル番号 == nChannel))) { + if (chip.nチャンネル番号 == nChannel) { + if (chip.n発声時刻ms > nTime) { break; } + if (chip.nコース != this.n次回のコース[nPlayer]) { + break; + } + nIndex_InitialPositionSearchingToPast = nIndex_NearestChip_Future; } - // nIndex_NearestChip_Past--; + continue; // ほんの僅かながら高速化 } - if (nIndex_NearestChip_Future >= count) { - if (nIndex_NearestChip_Past < 0) // 検索対象が過去未来どちらにも見つからなかった場合 - { - return null; - } else // 検索対象が未来方向には見つからなかった(しかし過去方向には見つかった)場合 - { - //sw2.Stop(); - return playerListChip[nIndex_NearestChip_Past]; + // nIndex_NearestChip_Future++; + } + int nIndex_NearestChip_Past = nIndex_InitialPositionSearchingToPast; + //while ( nIndex_NearestChip_Past >= 0 ) // 過去方向への検索 + for (; nIndex_NearestChip_Past >= 0; nIndex_NearestChip_Past--) { + if ((((0x15 <= nChannel) && (nChannel <= 0x17) || nChannel == 0x19) || (nChannel == 0x20 || nChannel == 0x21))) { + CDTX.CChip chip = playerListChip[nIndex_NearestChip_Past]; + + if (((chip.nチャンネル番号 == nChannel))) { + break; } - } else if (nIndex_NearestChip_Past < 0) // 検索対象が過去方向には見つからなかった(しかし未来方向には見つかった)場合 - { - //sw2.Stop(); - return playerListChip[nIndex_NearestChip_Future]; } - // 検索対象が過去未来の双方に見つかったなら、より近い方を採用する - CDTX.CChip nearestChip_Future = playerListChip[nIndex_NearestChip_Future]; - CDTX.CChip nearestChip_Past = playerListChip[nIndex_NearestChip_Past]; - int nDiffTime_Future = Math.Abs((int)(nTime - nearestChip_Future.n発声時刻ms)); - int nDiffTime_Past = Math.Abs((int)(nTime - nearestChip_Past.n発声時刻ms)); - if (nDiffTime_Future >= nDiffTime_Past) { + // nIndex_NearestChip_Past--; + } + + if (nIndex_NearestChip_Future >= count) { + if (nIndex_NearestChip_Past < 0) // 検索対象が過去未来どちらにも見つからなかった場合 + { + return null; + } else // 検索対象が未来方向には見つからなかった(しかし過去方向には見つかった)場合 + { //sw2.Stop(); - return nearestChip_Past; + return playerListChip[nIndex_NearestChip_Past]; } + } else if (nIndex_NearestChip_Past < 0) // 検索対象が過去方向には見つからなかった(しかし未来方向には見つかった)場合 + { //sw2.Stop(); - return nearestChip_Future; + return playerListChip[nIndex_NearestChip_Future]; } - protected void tサウンド再生(CDTX.CChip pChip, int nPlayer) { - var _gt = OpenTaiko.ConfigIni.nGameType[OpenTaiko.GetActualPlayer(nPlayer)]; - int index = pChip.nチャンネル番号; + // 検索対象が過去未来の双方に見つかったなら、より近い方を採用する + CDTX.CChip nearestChip_Future = playerListChip[nIndex_NearestChip_Future]; + CDTX.CChip nearestChip_Past = playerListChip[nIndex_NearestChip_Past]; + int nDiffTime_Future = Math.Abs((int)(nTime - nearestChip_Future.n発声時刻ms)); + int nDiffTime_Past = Math.Abs((int)(nTime - nearestChip_Past.n発声時刻ms)); + if (nDiffTime_Future >= nDiffTime_Past) { + //sw2.Stop(); + return nearestChip_Past; + } + //sw2.Stop(); + return nearestChip_Future; + } + protected void tサウンド再生(CDTX.CChip pChip, int nPlayer) { + var _gt = OpenTaiko.ConfigIni.nGameType[OpenTaiko.GetActualPlayer(nPlayer)]; + int index = pChip.nチャンネル番号; - if (index == 0x11 || index == 0x13 || index == 0x1A || index == 0x101) { - this.soundRed[pChip.nPlayerSide]?.PlayStart(); - if ((index == 0x13 && _gt == EGameType.Konga) || index == 0x101) { - this.soundBlue[pChip.nPlayerSide]?.PlayStart(); - } - } else if (index == 0x12 || index == 0x14 || index == 0x1B) { - if (index == 0x14 && _gt == EGameType.Konga) { - this.soundClap[pChip.nPlayerSide]?.PlayStart(); - } else { - this.soundBlue[pChip.nPlayerSide]?.PlayStart(); - } - - - } else if (index == 0x1F) { - this.soundAdlib[pChip.nPlayerSide]?.PlayStart(); + if (index == 0x11 || index == 0x13 || index == 0x1A || index == 0x101) { + this.soundRed[pChip.nPlayerSide]?.PlayStart(); + if ((index == 0x13 && _gt == EGameType.Konga) || index == 0x101) { + this.soundBlue[pChip.nPlayerSide]?.PlayStart(); + } + } else if (index == 0x12 || index == 0x14 || index == 0x1B) { + if (index == 0x14 && _gt == EGameType.Konga) { + this.soundClap[pChip.nPlayerSide]?.PlayStart(); + } else { + this.soundBlue[pChip.nPlayerSide]?.PlayStart(); } - if (this.nHand[nPlayer] == 0) - this.nHand[nPlayer]++; - else - this.nHand[nPlayer] = 0; + + } else if (index == 0x1F) { + this.soundAdlib[pChip.nPlayerSide]?.PlayStart(); } - protected bool tRollProcess(CDTX.CChip pChip, double dbProcess_time, int num, int sort, int Input, int nPlayer) { - if (dbProcess_time >= pChip.n発声時刻ms && dbProcess_time < pChip.nノーツ終了時刻ms) { - if (pChip.nRollCount == 0) //連打カウントが0の時 - { - this.actRoll.b表示[nPlayer] = true; - this.n現在の連打数[nPlayer] = 0; - this.actRoll.t枠表示時間延長(nPlayer, true); - } else { - this.actRoll.t枠表示時間延長(nPlayer, false); + if (this.nHand[nPlayer] == 0) + this.nHand[nPlayer]++; + else + this.nHand[nPlayer] = 0; + } + + protected bool tRollProcess(CDTX.CChip pChip, double dbProcess_time, int num, int sort, int Input, int nPlayer) { + if (dbProcess_time >= pChip.n発声時刻ms && dbProcess_time < pChip.nノーツ終了時刻ms) { + if (pChip.nRollCount == 0) //連打カウントが0の時 + { + this.actRoll.b表示[nPlayer] = true; + this.n現在の連打数[nPlayer] = 0; + this.actRoll.t枠表示時間延長(nPlayer, true); + } else { + this.actRoll.t枠表示時間延長(nPlayer, false); + } + this.b連打中[nPlayer] = true; + if (this.actRoll.ct連打アニメ[nPlayer].IsUnEnded) { + this.actRoll.ct連打アニメ[nPlayer] = new CCounter(0, 9, 14, OpenTaiko.Timer); + this.actRoll.ct連打アニメ[nPlayer].CurrentValue = 1; + } else { + this.actRoll.ct連打アニメ[nPlayer] = new CCounter(0, 9, 14, OpenTaiko.Timer); + } + + + pChip.RollEffectLevel += 10; + if (pChip.RollEffectLevel >= 100) { + pChip.RollEffectLevel = 100; + pChip.RollInputTime = new CCounter(0, 1500, 1, OpenTaiko.Timer); + pChip.RollDelay?.Stop(); + } else { + pChip.RollInputTime = new CCounter(0, 150, 1, OpenTaiko.Timer); + pChip.RollDelay?.Stop(); + } + + if (pChip.nチャンネル番号 == 0x15) + this.eRollState = ERollState.Roll; + else + this.eRollState = ERollState.RollB; + + pChip.nRollCount++; + + if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) + this.n連打[actDan.NowShowingNumber]++; + + this.n現在の連打数[nPlayer]++; + + this.CBranchScore[nPlayer].nRoll++; + this.CChartScore[nPlayer].nRoll++; + this.CSectionScore[nPlayer].nRoll++; + + this.n合計連打数[nPlayer]++; + if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] != (int)Difficulty.Dan) this.actRollChara.Start(nPlayer); + + + long nAddScore = 0; + + if (!OpenTaiko.ConfigIni.ShinuchiMode) { + // 旧配点・旧筐体配点 + if (OpenTaiko.DTX.nScoreModeTmp == 0 || OpenTaiko.DTX.nScoreModeTmp == 1) { + if (pChip.nチャンネル番号 == 0x15) + nAddScore = 300L; + else + nAddScore = 360L; } - this.b連打中[nPlayer] = true; - if (this.actRoll.ct連打アニメ[nPlayer].IsUnEnded) { - this.actRoll.ct連打アニメ[nPlayer] = new CCounter(0, 9, 14, OpenTaiko.Timer); - this.actRoll.ct連打アニメ[nPlayer].CurrentValue = 1; - } else { - this.actRoll.ct連打アニメ[nPlayer] = new CCounter(0, 9, 14, OpenTaiko.Timer); + // 新配点 + else { + if (pChip.nチャンネル番号 == 0x15) + nAddScore = 100L; + else + nAddScore = 200L; } + } else { + nAddScore = 100L; + } + + if (!OpenTaiko.ConfigIni.ShinuchiMode && pChip.bGOGOTIME) this.actScore.Add((long)(nAddScore * 1.2f), nPlayer); + else this.actScore.Add(nAddScore, nPlayer); - pChip.RollEffectLevel += 10; - if (pChip.RollEffectLevel >= 100) { - pChip.RollEffectLevel = 100; - pChip.RollInputTime = new CCounter(0, 1500, 1, OpenTaiko.Timer); - pChip.RollDelay?.Stop(); + // Refresh scores after roll hits as well + int __score = (int)(this.actScore.GetScore(nPlayer) + nAddScore); + this.CBranchScore[nPlayer].nScore = __score; + this.CChartScore[nPlayer].nScore = __score; + this.CSectionScore[nPlayer].nScore = __score; + + EGameType _gt = OpenTaiko.ConfigIni.nGameType[OpenTaiko.GetActualPlayer(nPlayer)]; + + //赤か青かの分岐 + if (sort == 0 || sort == 2) { + this.soundRed[pChip.nPlayerSide]?.PlayStart(); + + if (pChip.nチャンネル番号 == 0x15 || _gt == EGameType.Konga || (_gt == EGameType.Taiko && pChip.nチャンネル番号 == 0x21)) { + //CDTXMania.Skin.soundRed.t再生する(); + //CDTXMania.stage演奏ドラム画面.actChipFireTaiko.Start( 1, nPlayer ); + OpenTaiko.stage演奏ドラム画面.FlyingNotes.Start(1, nPlayer, true); } else { - pChip.RollInputTime = new CCounter(0, 150, 1, OpenTaiko.Timer); - pChip.RollDelay?.Stop(); + //CDTXMania.Skin.soundRed.t再生する(); + //CDTXMania.stage演奏ドラム画面.actChipFireTaiko.Start( 3, nPlayer ); + OpenTaiko.stage演奏ドラム画面.FlyingNotes.Start(3, nPlayer, true); } + } else if (sort == 1 || sort == 3) { + this.soundBlue[pChip.nPlayerSide]?.PlayStart(); - if (pChip.nチャンネル番号 == 0x15) - this.eRollState = ERollState.Roll; - else - this.eRollState = ERollState.RollB; - - pChip.nRollCount++; - - if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) - this.n連打[actDan.NowShowingNumber]++; - - this.n現在の連打数[nPlayer]++; - - this.CBranchScore[nPlayer].nRoll++; - this.CChartScore[nPlayer].nRoll++; - this.CSectionScore[nPlayer].nRoll++; - - this.n合計連打数[nPlayer]++; - if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] != (int)Difficulty.Dan) this.actRollChara.Start(nPlayer); - - - long nAddScore = 0; - - if (!OpenTaiko.ConfigIni.ShinuchiMode) { - // 旧配点・旧筐体配点 - if (OpenTaiko.DTX.nScoreModeTmp == 0 || OpenTaiko.DTX.nScoreModeTmp == 1) { - if (pChip.nチャンネル番号 == 0x15) - nAddScore = 300L; - else - nAddScore = 360L; - } - // 新配点 - else { - if (pChip.nチャンネル番号 == 0x15) - nAddScore = 100L; - else - nAddScore = 200L; - } + if (pChip.nチャンネル番号 == 0x15 || _gt == EGameType.Konga || (_gt == EGameType.Taiko && pChip.nチャンネル番号 == 0x21)) { + //CDTXMania.Skin.soundBlue.t再生する(); + //CDTXMania.stage演奏ドラム画面.actChipFireTaiko.Start( 2, nPlayer ); + OpenTaiko.stage演奏ドラム画面.FlyingNotes.Start(2, nPlayer, true); } else { - nAddScore = 100L; - } - - if (!OpenTaiko.ConfigIni.ShinuchiMode && pChip.bGOGOTIME) this.actScore.Add((long)(nAddScore * 1.2f), nPlayer); - else this.actScore.Add(nAddScore, nPlayer); - - - // Refresh scores after roll hits as well - int __score = (int)(this.actScore.GetScore(nPlayer) + nAddScore); - this.CBranchScore[nPlayer].nScore = __score; - this.CChartScore[nPlayer].nScore = __score; - this.CSectionScore[nPlayer].nScore = __score; - - EGameType _gt = OpenTaiko.ConfigIni.nGameType[OpenTaiko.GetActualPlayer(nPlayer)]; - - //赤か青かの分岐 - if (sort == 0 || sort == 2) { - this.soundRed[pChip.nPlayerSide]?.PlayStart(); - - if (pChip.nチャンネル番号 == 0x15 || _gt == EGameType.Konga || (_gt == EGameType.Taiko && pChip.nチャンネル番号 == 0x21)) { - //CDTXMania.Skin.soundRed.t再生する(); - //CDTXMania.stage演奏ドラム画面.actChipFireTaiko.Start( 1, nPlayer ); - OpenTaiko.stage演奏ドラム画面.FlyingNotes.Start(1, nPlayer, true); - } else { - //CDTXMania.Skin.soundRed.t再生する(); - //CDTXMania.stage演奏ドラム画面.actChipFireTaiko.Start( 3, nPlayer ); - OpenTaiko.stage演奏ドラム画面.FlyingNotes.Start(3, nPlayer, true); - } - } else if (sort == 1 || sort == 3) { - this.soundBlue[pChip.nPlayerSide]?.PlayStart(); - - if (pChip.nチャンネル番号 == 0x15 || _gt == EGameType.Konga || (_gt == EGameType.Taiko && pChip.nチャンネル番号 == 0x21)) { - //CDTXMania.Skin.soundBlue.t再生する(); - //CDTXMania.stage演奏ドラム画面.actChipFireTaiko.Start( 2, nPlayer ); - OpenTaiko.stage演奏ドラム画面.FlyingNotes.Start(2, nPlayer, true); - } else { - //CDTXMania.Skin.soundBlue.t再生する(); - //CDTXMania.stage演奏ドラム画面.actChipFireTaiko.Start( 4, nPlayer ); - OpenTaiko.stage演奏ドラム画面.FlyingNotes.Start(4, nPlayer, true); - } - } else if (sort == 4) { - this.soundClap[pChip.nPlayerSide]?.PlayStart(); + //CDTXMania.Skin.soundBlue.t再生する(); + //CDTXMania.stage演奏ドラム画面.actChipFireTaiko.Start( 4, nPlayer ); OpenTaiko.stage演奏ドラム画面.FlyingNotes.Start(4, nPlayer, true); } - - //TJAPlayer3.stage演奏ドラム画面.actTaikoLaneFlash.PlayerLane[nPlayer].Start(PlayerLane.FlashType.Hit); - } else { - this.b連打中[nPlayer] = false; - return true; + } else if (sort == 4) { + this.soundClap[pChip.nPlayerSide]?.PlayStart(); + OpenTaiko.stage演奏ドラム画面.FlyingNotes.Start(4, nPlayer, true); } - return false; - } - - protected bool tBalloonProcess(CDTX.CChip pChip, double dbProcess_time, int player) { - //if( dbProcess_time >= pChip.n発声時刻ms && dbProcess_time < pChip.nノーツ終了時刻ms ) - long nowTime = (long)(SoundManager.PlayTimer.NowTimeMs * OpenTaiko.ConfigIni.SongPlaybackSpeed); - bool IsKusudama = NotesManager.IsKusudama(pChip); - bool IsFuze = NotesManager.IsFuzeRoll(pChip); - - int rollCount = pChip.nRollCount; - int balloon = pChip.nBalloon; - - if (IsKusudama) { - nCurrentKusudamaRollCount++; - rollCount = nCurrentKusudamaRollCount; - balloon = nCurrentKusudamaCount; - } - - if ((int)nowTime >= pChip.n発声時刻ms - && (int)nowTime <= pChip.nノーツ終了時刻ms) { - - if (IsKusudama) { - if (nCurrentKusudamaCount > 0) { - actChara.ChangeAnime(player, CActImplCharacter.Anime.Kusudama_Breaking, true); - for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { - this.b連打中[i] = true; - - - if (this.actBalloon.ct風船アニメ[i].IsUnEnded) { - this.actBalloon.ct風船アニメ[i] = new CCounter(0, 9, 14, OpenTaiko.Timer); - this.actBalloon.ct風船アニメ[i].CurrentValue = 1; - } else { - this.actBalloon.ct風船アニメ[i] = new CCounter(0, 9, 14, OpenTaiko.Timer); - } - } - } - } else { - this.b連打中[player] = true; - actChara.ChangeAnime(player, CActImplCharacter.Anime.Balloon_Breaking, true); - - - if (this.actBalloon.ct風船アニメ[player].IsUnEnded) { - this.actBalloon.ct風船アニメ[player] = new CCounter(0, 9, 14, OpenTaiko.Timer); - this.actBalloon.ct風船アニメ[player].CurrentValue = 1; - } else { - this.actBalloon.ct風船アニメ[player] = new CCounter(0, 9, 14, OpenTaiko.Timer); - } - } - - this.eRollState = ERollState.Balloon; - - - - if (IsKusudama) { - //pChip.nRollCount = nCurrentKusudamaRollCount; - for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { - pChip.nRollCount = nCurrentKusudamaRollCount; - this.n風船残り[i] = balloon - rollCount; - } - } else { - pChip.nRollCount++; - rollCount = pChip.nRollCount; - this.n風船残り[player] = balloon - rollCount; - } - - if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) - this.n連打[actDan.NowShowingNumber]++; - this.CBranchScore[player].nRoll++; - this.CChartScore[player].nRoll++; - this.CSectionScore[player].nRoll++; - - this.n合計連打数[player]++; // 成績発表の連打数に風船を含めるように (AioiLight) - - //分岐のための処理。実装してない。 - - //赤か青かの分岐 - - long nAddScore = 0; - - if (!OpenTaiko.ConfigIni.ShinuchiMode) { - if (pChip.bGOGOTIME) { - if (balloon == rollCount) - nAddScore = 6000L; - else - nAddScore = 360L; - } else { - if (balloon == rollCount) - nAddScore = 5000L; - else - nAddScore = 300L; - } - } else { - nAddScore = 100L; - } - - this.actScore.Add(nAddScore, player); - - // Refresh scores after roll hits as well - int __score = (int)(this.actScore.GetScore(player) + nAddScore); - this.CBranchScore[player].nScore = __score; - this.CChartScore[player].nScore = __score; - this.CSectionScore[player].nScore = __score; - - this.soundRed[pChip.nPlayerSide]?.PlayStart(); - - - if (this.n風船残り[player] <= 0) { - if (IsKusudama) { - OpenTaiko.Skin.soundKusudama.tPlay(); - pChip.bHit = true; - pChip.IsHitted = true; - chip現在処理中の連打チップ[player].bHit = true; - pChip.b可視 = false; - nCurrentKusudamaCount = 0; - - actBalloon.KusuBroke(); - for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { - actChara.ChangeAnime(i, CActImplCharacter.Anime.Kusudama_Broke, true); - if (actChara.CharaAction_Balloon_Delay[i] != null) actChara.CharaAction_Balloon_Delay[i] = new CCounter(0, OpenTaiko.Skin.Characters_Balloon_Delay[actChara.iCurrentCharacter[i]] - 1, 1, OpenTaiko.Timer); - } - } else { - //パァーン - OpenTaiko.Skin.soundBalloon.tPlay(); - //CDTXMania.stage演奏ドラム画面.actChipFireTaiko.Start( 3, player ); //ここで飛ばす。飛ばされるのは大音符のみ。 - OpenTaiko.stage演奏ドラム画面.FlyingNotes.Start(3, player); - OpenTaiko.stage演奏ドラム画面.Rainbow.Start(player); - //CDTXMania.stage演奏ドラム画面.actChipFireD.Start( 0, player ); - pChip.bHit = true; - pChip.IsHitted = true; - chip現在処理中の連打チップ[player].bHit = true; - //this.b連打中 = false; - //this.actChara.b風船連打中 = false; - pChip.b可視 = false; - { - actChara.ChangeAnime(player, CActImplCharacter.Anime.Balloon_Broke, true); - if (actChara.CharaAction_Balloon_Delay[player] != null) actChara.CharaAction_Balloon_Delay[player] = new CCounter(0, OpenTaiko.Skin.Characters_Balloon_Delay[actChara.iCurrentCharacter[player]] - 1, 1, OpenTaiko.Timer); - } - } - this.eRollState = ERollState.None; // Unused variable ? - } - } else { - if (IsKusudama) { - for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { - if (chip現在処理中の連打チップ[i] != null) - chip現在処理中の連打チップ[i].bHit = true; - this.b連打中[i] = false; - this.actChara.b風船連打中[i] = false; - nCurrentKusudamaCount = 0; - } - } else { - if (chip現在処理中の連打チップ[player] != null) - chip現在処理中の連打チップ[player].bHit = true; - this.b連打中[player] = false; - this.actChara.b風船連打中[player] = false; - } - return false; - } + //TJAPlayer3.stage演奏ドラム画面.actTaikoLaneFlash.PlayerLane[nPlayer].Start(PlayerLane.FlashType.Hit); + } else { + this.b連打中[nPlayer] = false; return true; } - protected abstract ENoteJudge tチップのヒット処理(long nHitTime, CDTX.CChip pChip, bool bCorrectLane); + return false; + } - protected ENoteJudge tチップのヒット処理(long nHitTime, CDTX.CChip pChip, EInstrumentPad screenmode, bool bCorrectLane, int nNowInput) { - return tチップのヒット処理(nHitTime, pChip, screenmode, bCorrectLane, nNowInput, 0); + protected bool tBalloonProcess(CDTX.CChip pChip, double dbProcess_time, int player) { + //if( dbProcess_time >= pChip.n発声時刻ms && dbProcess_time < pChip.nノーツ終了時刻ms ) + long nowTime = (long)(SoundManager.PlayTimer.NowTimeMs * OpenTaiko.ConfigIni.SongPlaybackSpeed); + bool IsKusudama = NotesManager.IsKusudama(pChip); + bool IsFuze = NotesManager.IsFuzeRoll(pChip); + + int rollCount = pChip.nRollCount; + int balloon = pChip.nBalloon; + + if (IsKusudama) { + nCurrentKusudamaRollCount++; + rollCount = nCurrentKusudamaRollCount; + balloon = nCurrentKusudamaCount; } - protected unsafe ENoteJudge tチップのヒット処理(long nHitTime, CDTX.CChip pChip, EInstrumentPad screenmode, bool bCorrectLane, int nNowInput, int nPlayer, bool rollEffectHit = false) { - //unsafeコードにつき、デバッグ中の変更厳禁! - bool bAutoPlay = OpenTaiko.ConfigIni.bAutoPlay[nPlayer]; - bool bBombHit = false; + if ((int)nowTime >= pChip.n発声時刻ms + && (int)nowTime <= pChip.nノーツ終了時刻ms) { - switch (nPlayer) { - case 1: - bAutoPlay = OpenTaiko.ConfigIni.bAutoPlay[nPlayer] || OpenTaiko.ConfigIni.bAIBattleMode; - break; - } + if (IsKusudama) { + if (nCurrentKusudamaCount > 0) { + actChara.ChangeAnime(player, CActImplCharacter.Anime.Kusudama_Breaking, true); + for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { + this.b連打中[i] = true; - if (!pChip.b可視) - return ENoteJudge.Auto; - if (!NotesManager.IsGenericRoll(pChip)) { - if (!pChip.IsMissed)//通り越したチップでなければ判定! - { - pChip.bHit = true; - pChip.IsHitted = true; + if (this.actBalloon.ct風船アニメ[i].IsUnEnded) { + this.actBalloon.ct風船アニメ[i] = new CCounter(0, 9, 14, OpenTaiko.Timer); + this.actBalloon.ct風船アニメ[i].CurrentValue = 1; + } else { + this.actBalloon.ct風船アニメ[i] = new CCounter(0, 9, 14, OpenTaiko.Timer); + } + } + } + } else { + this.b連打中[player] = true; + actChara.ChangeAnime(player, CActImplCharacter.Anime.Balloon_Breaking, true); + + + if (this.actBalloon.ct風船アニメ[player].IsUnEnded) { + this.actBalloon.ct風船アニメ[player] = new CCounter(0, 9, 14, OpenTaiko.Timer); + this.actBalloon.ct風船アニメ[player].CurrentValue = 1; + } else { + this.actBalloon.ct風船アニメ[player] = new CCounter(0, 9, 14, OpenTaiko.Timer); } } - ENoteJudge eJudgeResult = ENoteJudge.Auto; - switch (pChip.e楽器パート) { - case EInstrumentPad.Drums: - case EInstrumentPad.Guitar: - case EInstrumentPad.Bass: - break; - case EInstrumentPad.Taiko: { - //連打が短すぎると発声されない - eJudgeResult = (bCorrectLane) ? this.e指定時刻からChipのJUDGEを返す(nHitTime, pChip, nPlayer) : ENoteJudge.Miss; + this.eRollState = ERollState.Balloon; - // AI judges - eJudgeResult = AlterJudgement(nPlayer, eJudgeResult, true); - if (!bAutoPlay && eJudgeResult != ENoteJudge.Miss) { - CLagLogger.Add(nPlayer, pChip); + + if (IsKusudama) { + //pChip.nRollCount = nCurrentKusudamaRollCount; + for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { + pChip.nRollCount = nCurrentKusudamaRollCount; + this.n風船残り[i] = balloon - rollCount; + } + } else { + pChip.nRollCount++; + rollCount = pChip.nRollCount; + this.n風船残り[player] = balloon - rollCount; + } + + if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) + this.n連打[actDan.NowShowingNumber]++; + this.CBranchScore[player].nRoll++; + this.CChartScore[player].nRoll++; + this.CSectionScore[player].nRoll++; + + this.n合計連打数[player]++; // 成績発表の連打数に風船を含めるように (AioiLight) + + //分岐のための処理。実装してない。 + + //赤か青かの分岐 + + long nAddScore = 0; + + if (!OpenTaiko.ConfigIni.ShinuchiMode) { + if (pChip.bGOGOTIME) { + if (balloon == rollCount) + nAddScore = 6000L; + else + nAddScore = 360L; + } else { + if (balloon == rollCount) + nAddScore = 5000L; + else + nAddScore = 300L; + } + } else { + nAddScore = 100L; + } + + this.actScore.Add(nAddScore, player); + + // Refresh scores after roll hits as well + int __score = (int)(this.actScore.GetScore(player) + nAddScore); + this.CBranchScore[player].nScore = __score; + this.CChartScore[player].nScore = __score; + this.CSectionScore[player].nScore = __score; + + this.soundRed[pChip.nPlayerSide]?.PlayStart(); + + + if (this.n風船残り[player] <= 0) { + if (IsKusudama) { + OpenTaiko.Skin.soundKusudama.tPlay(); + pChip.bHit = true; + pChip.IsHitted = true; + chip現在処理中の連打チップ[player].bHit = true; + pChip.b可視 = false; + nCurrentKusudamaCount = 0; + + actBalloon.KusuBroke(); + for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { + actChara.ChangeAnime(i, CActImplCharacter.Anime.Kusudama_Broke, true); + if (actChara.CharaAction_Balloon_Delay[i] != null) actChara.CharaAction_Balloon_Delay[i] = new CCounter(0, OpenTaiko.Skin.Characters_Balloon_Delay[actChara.iCurrentCharacter[i]] - 1, 1, OpenTaiko.Timer); + } + } else { + //パァーン + OpenTaiko.Skin.soundBalloon.tPlay(); + //CDTXMania.stage演奏ドラム画面.actChipFireTaiko.Start( 3, player ); //ここで飛ばす。飛ばされるのは大音符のみ。 + OpenTaiko.stage演奏ドラム画面.FlyingNotes.Start(3, player); + OpenTaiko.stage演奏ドラム画面.Rainbow.Start(player); + //CDTXMania.stage演奏ドラム画面.actChipFireD.Start( 0, player ); + pChip.bHit = true; + pChip.IsHitted = true; + chip現在処理中の連打チップ[player].bHit = true; + //this.b連打中 = false; + //this.actChara.b風船連打中 = false; + pChip.b可視 = false; + { + actChara.ChangeAnime(player, CActImplCharacter.Anime.Balloon_Broke, true); + if (actChara.CharaAction_Balloon_Delay[player] != null) actChara.CharaAction_Balloon_Delay[player] = new CCounter(0, OpenTaiko.Skin.Characters_Balloon_Delay[actChara.iCurrentCharacter[player]] - 1, 1, OpenTaiko.Timer); + } + } + this.eRollState = ERollState.None; // Unused variable ? + } + } else { + if (IsKusudama) { + for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { + if (chip現在処理中の連打チップ[i] != null) + chip現在処理中の連打チップ[i].bHit = true; + this.b連打中[i] = false; + this.actChara.b風船連打中[i] = false; + nCurrentKusudamaCount = 0; + } + } else { + if (chip現在処理中の連打チップ[player] != null) + chip現在処理中の連打チップ[player].bHit = true; + this.b連打中[player] = false; + this.actChara.b風船連打中[player] = false; + } + return false; + } + return true; + } + + protected abstract ENoteJudge tチップのヒット処理(long nHitTime, CDTX.CChip pChip, bool bCorrectLane); + + protected ENoteJudge tチップのヒット処理(long nHitTime, CDTX.CChip pChip, EInstrumentPad screenmode, bool bCorrectLane, int nNowInput) { + return tチップのヒット処理(nHitTime, pChip, screenmode, bCorrectLane, nNowInput, 0); + } + protected unsafe ENoteJudge tチップのヒット処理(long nHitTime, CDTX.CChip pChip, EInstrumentPad screenmode, bool bCorrectLane, int nNowInput, int nPlayer, bool rollEffectHit = false) { + //unsafeコードにつき、デバッグ中の変更厳禁! + + bool bAutoPlay = OpenTaiko.ConfigIni.bAutoPlay[nPlayer]; + bool bBombHit = false; + + switch (nPlayer) { + case 1: + bAutoPlay = OpenTaiko.ConfigIni.bAutoPlay[nPlayer] || OpenTaiko.ConfigIni.bAIBattleMode; + break; + } + + if (!pChip.b可視) + return ENoteJudge.Auto; + + if (!NotesManager.IsGenericRoll(pChip)) { + if (!pChip.IsMissed)//通り越したチップでなければ判定! + { + pChip.bHit = true; + pChip.IsHitted = true; + } + } + + ENoteJudge eJudgeResult = ENoteJudge.Auto; + switch (pChip.e楽器パート) { + case EInstrumentPad.Drums: + case EInstrumentPad.Guitar: + case EInstrumentPad.Bass: + break; + case EInstrumentPad.Taiko: { + //連打が短すぎると発声されない + eJudgeResult = (bCorrectLane) ? this.e指定時刻からChipのJUDGEを返す(nHitTime, pChip, nPlayer) : ENoteJudge.Miss; + + // AI judges + eJudgeResult = AlterJudgement(nPlayer, eJudgeResult, true); + + if (!bAutoPlay && eJudgeResult != ENoteJudge.Miss) { + CLagLogger.Add(nPlayer, pChip); + } + + var puchichara = OpenTaiko.Tx.Puchichara[PuchiChara.tGetPuchiCharaIndexByName(OpenTaiko.GetActualPlayer(nPlayer))]; + + if (NotesManager.IsRoll(pChip)) { + #region[ Drumroll ] + //--------------------------- + this.b連打中[nPlayer] = true; + if (bAutoPlay || rollEffectHit) { + int rollSpeed = bAutoPlay ? OpenTaiko.ConfigIni.nRollsPerSec : puchichara.effect.Autoroll; + if (OpenTaiko.ConfigIni.bAIBattleMode && nPlayer == 1) + rollSpeed = OpenTaiko.ConfigIni.apAIPerformances[OpenTaiko.ConfigIni.nAILevel - 1].nRollSpeed; + + if (this.bPAUSE == false && rollSpeed > 0) // && TJAPlayer3.ConfigIni.bAuto先生の連打) + { + if (((SoundManager.PlayTimer.NowTime * OpenTaiko.ConfigIni.SongPlaybackSpeed) + * OpenTaiko.ConfigIni.SongPlaybackSpeed) + > (pChip.n発声時刻ms + (1000.0 / (double)rollSpeed) * pChip.nRollCount)) { + EGameType _gt = OpenTaiko.ConfigIni.nGameType[OpenTaiko.GetActualPlayer(nPlayer)]; + int nLane = 0; + + if (this.nHand[nPlayer] == 0) + this.nHand[nPlayer]++; + else + this.nHand[nPlayer] = 0; + + if (OpenTaiko.stage演奏ドラム画面.actPlayInfo.dbBPM[nPlayer] < 0 && (pChip.eScrollMode == EScrollMode.HBScroll)) + pChip.fBMSCROLLTime -= OpenTaiko.stage演奏ドラム画面.actPlayInfo.dbBPM[nPlayer] * -0.05; + + OpenTaiko.stage演奏ドラム画面.actTaikoLaneFlash.PlayerLane[nPlayer].Start(PlayerLane.FlashType.Red); + //CDTXMania.stage演奏ドラム画面.actChipFireTaiko.Start( pChip.nチャンネル番号 == 0x15 ? 1 : 3, nPlayer ); + OpenTaiko.stage演奏ドラム画面.FlyingNotes.Start(pChip.nチャンネル番号 == 0x15 ? 1 : 3, nPlayer, true); + OpenTaiko.stage演奏ドラム画面.actMtaiko.tMtaikoEvent(pChip.nチャンネル番号, this.nHand[nPlayer], nPlayer); + + + if (pChip.nチャンネル番号 == 0x20 && _gt == EGameType.Konga) nLane = 4; + else if (pChip.nチャンネル番号 == 0x21 && _gt == EGameType.Konga) nLane = 1; + + this.tRollProcess(pChip, (SoundManager.PlayTimer.NowTime * OpenTaiko.ConfigIni.SongPlaybackSpeed), 1, nLane, 0, nPlayer); + } + } + } + if (!bAutoPlay && !rollEffectHit) { + this.eRollState = ERollState.Roll; + this.tRollProcess(pChip, (SoundManager.PlayTimer.NowTime * OpenTaiko.ConfigIni.SongPlaybackSpeed), 1, nNowInput, 0, nPlayer); } - var puchichara = OpenTaiko.Tx.Puchichara[PuchiChara.tGetPuchiCharaIndexByName(OpenTaiko.GetActualPlayer(nPlayer))]; + break; + //--------------------------- + #endregion + } else if (NotesManager.IsGenericBalloon(pChip)) { + #region [ Balloon ] - if (NotesManager.IsRoll(pChip)) { - #region[ Drumroll ] - //--------------------------- - this.b連打中[nPlayer] = true; - if (bAutoPlay || rollEffectHit) { - int rollSpeed = bAutoPlay ? OpenTaiko.ConfigIni.nRollsPerSec : puchichara.effect.Autoroll; - if (OpenTaiko.ConfigIni.bAIBattleMode && nPlayer == 1) - rollSpeed = OpenTaiko.ConfigIni.apAIPerformances[OpenTaiko.ConfigIni.nAILevel - 1].nRollSpeed; + bool IsKusudama = NotesManager.IsKusudama(pChip); - if (this.bPAUSE == false && rollSpeed > 0) // && TJAPlayer3.ConfigIni.bAuto先生の連打) + if (IsKusudama) { + if (nCurrentKusudamaCount > 0) { + /* + if (!this.b連打中[nPlayer] && nPlayer == 0) { - if (((SoundManager.PlayTimer.NowTime * OpenTaiko.ConfigIni.SongPlaybackSpeed) - * OpenTaiko.ConfigIni.SongPlaybackSpeed) - > (pChip.n発声時刻ms + (1000.0 / (double)rollSpeed) * pChip.nRollCount)) { - EGameType _gt = OpenTaiko.ConfigIni.nGameType[OpenTaiko.GetActualPlayer(nPlayer)]; - int nLane = 0; - - if (this.nHand[nPlayer] == 0) - this.nHand[nPlayer]++; - else - this.nHand[nPlayer] = 0; - - if (OpenTaiko.stage演奏ドラム画面.actPlayInfo.dbBPM[nPlayer] < 0 && (pChip.eScrollMode == EScrollMode.HBScroll)) - pChip.fBMSCROLLTime -= OpenTaiko.stage演奏ドラム画面.actPlayInfo.dbBPM[nPlayer] * -0.05; - - OpenTaiko.stage演奏ドラム画面.actTaikoLaneFlash.PlayerLane[nPlayer].Start(PlayerLane.FlashType.Red); - //CDTXMania.stage演奏ドラム画面.actChipFireTaiko.Start( pChip.nチャンネル番号 == 0x15 ? 1 : 3, nPlayer ); - OpenTaiko.stage演奏ドラム画面.FlyingNotes.Start(pChip.nチャンネル番号 == 0x15 ? 1 : 3, nPlayer, true); - OpenTaiko.stage演奏ドラム画面.actMtaiko.tMtaikoEvent(pChip.nチャンネル番号, this.nHand[nPlayer], nPlayer); - - - if (pChip.nチャンネル番号 == 0x20 && _gt == EGameType.Konga) nLane = 4; - else if (pChip.nチャンネル番号 == 0x21 && _gt == EGameType.Konga) nLane = 1; - - this.tRollProcess(pChip, (SoundManager.PlayTimer.NowTime * OpenTaiko.ConfigIni.SongPlaybackSpeed), 1, nLane, 0, nPlayer); - } + actBalloon.KusuIn(); + actChara.KusuIn(); } + for(int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) + { + this.b連打中[i] = true; + this.actChara.b風船連打中[i] = true; + } + */ } - if (!bAutoPlay && !rollEffectHit) { - this.eRollState = ERollState.Roll; - this.tRollProcess(pChip, (SoundManager.PlayTimer.NowTime * OpenTaiko.ConfigIni.SongPlaybackSpeed), 1, nNowInput, 0, nPlayer); - } + } else { + this.b連打中[nPlayer] = true; + this.actChara.b風船連打中[nPlayer] = true; + } - break; - //--------------------------- - #endregion - } else if (NotesManager.IsGenericBalloon(pChip)) { - #region [ Balloon ] - - bool IsKusudama = NotesManager.IsKusudama(pChip); + if (bAutoPlay || rollEffectHit) { + int rollCount = pChip.nRollCount; + int balloon = pChip.nBalloon; if (IsKusudama) { - if (nCurrentKusudamaCount > 0) { - /* - if (!this.b連打中[nPlayer] && nPlayer == 0) - { - actBalloon.KusuIn(); - actChara.KusuIn(); - } - for(int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) - { - this.b連打中[i] = true; - this.actChara.b風船連打中[i] = true; - } - */ + /* + var ts = pChip.db発声時刻ms; + var km = TJAPlayer3.DTX.kusudaMAP; + + if (km.ContainsKey(ts)) + { + rollCount = km[ts].nRollCount; + balloon = km[ts].nBalloon; } - } else { - this.b連打中[nPlayer] = true; - this.actChara.b風船連打中[nPlayer] = true; + */ + rollCount = nCurrentKusudamaRollCount; + balloon = nCurrentKusudamaCount; + } - if (bAutoPlay || rollEffectHit) { + if (balloon != 0 && this.bPAUSE == false) { + int rollSpeed = bAutoPlay ? balloon : puchichara.effect.Autoroll; - int rollCount = pChip.nRollCount; - int balloon = pChip.nBalloon; - if (IsKusudama) { - /* - var ts = pChip.db発声時刻ms; - var km = TJAPlayer3.DTX.kusudaMAP; + int balloonDuration = bAutoPlay ? (pChip.nノーツ終了時刻ms - pChip.n発声時刻ms) : 1000; - if (km.ContainsKey(ts)) - { - rollCount = km[ts].nRollCount; - balloon = km[ts].nBalloon; - } - */ - rollCount = nCurrentKusudamaRollCount; - balloon = nCurrentKusudamaCount; + if ((SoundManager.PlayTimer.NowTime * OpenTaiko.ConfigIni.SongPlaybackSpeed) > + (pChip.n発声時刻ms + (balloonDuration / (double)rollSpeed) * rollCount)) { + if (this.nHand[nPlayer] == 0) + this.nHand[nPlayer]++; + else + this.nHand[nPlayer] = 0; - } + OpenTaiko.stage演奏ドラム画面.actTaikoLaneFlash.PlayerLane[nPlayer].Start(PlayerLane.FlashType.Red); + OpenTaiko.stage演奏ドラム画面.actMtaiko.tMtaikoEvent(pChip.nチャンネル番号, this.nHand[nPlayer], nPlayer); - if (balloon != 0 && this.bPAUSE == false) { - int rollSpeed = bAutoPlay ? balloon : puchichara.effect.Autoroll; - - int balloonDuration = bAutoPlay ? (pChip.nノーツ終了時刻ms - pChip.n発声時刻ms) : 1000; - - if ((SoundManager.PlayTimer.NowTime * OpenTaiko.ConfigIni.SongPlaybackSpeed) > - (pChip.n発声時刻ms + (balloonDuration / (double)rollSpeed) * rollCount)) { - if (this.nHand[nPlayer] == 0) - this.nHand[nPlayer]++; - else - this.nHand[nPlayer] = 0; - - OpenTaiko.stage演奏ドラム画面.actTaikoLaneFlash.PlayerLane[nPlayer].Start(PlayerLane.FlashType.Red); - OpenTaiko.stage演奏ドラム画面.actMtaiko.tMtaikoEvent(pChip.nチャンネル番号, this.nHand[nPlayer], nPlayer); - - this.tBalloonProcess(pChip, (SoundManager.PlayTimer.NowTime * OpenTaiko.ConfigIni.SongPlaybackSpeed), nPlayer); - } - } - } - if (!bAutoPlay && !rollEffectHit) { - if (!IsKusudama || nCurrentKusudamaCount > 0) { this.tBalloonProcess(pChip, (SoundManager.PlayTimer.NowTime * OpenTaiko.ConfigIni.SongPlaybackSpeed), nPlayer); } } - break; - #endregion - } else if (NotesManager.IsRollEnd(pChip)) { - if (pChip.nノーツ終了時刻ms <= (SoundManager.PlayTimer.NowTime * OpenTaiko.ConfigIni.SongPlaybackSpeed)) { - if (NotesManager.IsKusudama(pChip)) { - for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { - chip現在処理中の連打チップ[i].bHit = true; - this.b連打中[i] = false; - } - } else { - this.b連打中[nPlayer] = false; - } - - - // this.actChara.b風船連打中[nPlayer] = false; - - pChip.bHit = true; - pChip.IsHitted = true; - break; - } - } else if (NotesManager.IsADLIB(pChip)) { - if (eJudgeResult != ENoteJudge.Auto && eJudgeResult != ENoteJudge.Miss) { - this.actJudgeString.Start(nPlayer, eJudgeResult != ENoteJudge.Bad ? ENoteJudge.ADLIB : ENoteJudge.Bad); - eJudgeResult = ENoteJudge.Perfect; // Prevent ADLIB notes breaking DFC runs - OpenTaiko.stage演奏ドラム画面.actLaneTaiko.Start(0x11, eJudgeResult, true, nPlayer); - OpenTaiko.stage演奏ドラム画面.actChipFireD.Start(0x11, eJudgeResult, nPlayer); - this.CChartScore[nPlayer].nADLIB++; - this.CSectionScore[nPlayer].nADLIB++; - this.CBranchScore[nPlayer].nADLIB++; - if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) - this.nADLIB[actDan.NowShowingNumber]++; - } - break; - } else if (NotesManager.IsMine(pChip)) { - if (eJudgeResult != ENoteJudge.Auto && eJudgeResult != ENoteJudge.Miss) { - this.actJudgeString.Start(nPlayer, eJudgeResult != ENoteJudge.Bad ? ENoteJudge.Mine : ENoteJudge.Bad); - bBombHit = true; - eJudgeResult = ENoteJudge.Bad; - OpenTaiko.stage演奏ドラム画面.actLaneTaiko.Start(0x11, eJudgeResult, true, nPlayer); - OpenTaiko.stage演奏ドラム画面.actChipFireD.Start(0x11, ENoteJudge.Mine, nPlayer); - OpenTaiko.Skin.soundBomb?.tPlay(); - actGauge.MineDamage(nPlayer); - this.CChartScore[nPlayer].nMine++; - this.CSectionScore[nPlayer].nMine++; - this.CBranchScore[nPlayer].nMine++; - if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) - this.nMine[actDan.NowShowingNumber]++; - } - break; - } else { - if (eJudgeResult != ENoteJudge.Miss) { - pChip.bShow = false; + } + if (!bAutoPlay && !rollEffectHit) { + if (!IsKusudama || nCurrentKusudamaCount > 0) { + this.tBalloonProcess(pChip, (SoundManager.PlayTimer.NowTime * OpenTaiko.ConfigIni.SongPlaybackSpeed), nPlayer); } } + break; + #endregion + } else if (NotesManager.IsRollEnd(pChip)) { + if (pChip.nノーツ終了時刻ms <= (SoundManager.PlayTimer.NowTime * OpenTaiko.ConfigIni.SongPlaybackSpeed)) { + if (NotesManager.IsKusudama(pChip)) { + for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { + chip現在処理中の連打チップ[i].bHit = true; + this.b連打中[i] = false; + } + } else { + this.b連打中[nPlayer] = false; + } + + // this.actChara.b風船連打中[nPlayer] = false; + + pChip.bHit = true; + pChip.IsHitted = true; + break; + } + } else if (NotesManager.IsADLIB(pChip)) { if (eJudgeResult != ENoteJudge.Auto && eJudgeResult != ENoteJudge.Miss) { - - this.actJudgeString.Start(nPlayer, (bAutoPlay && !OpenTaiko.ConfigIni.bAIBattleMode) ? ENoteJudge.Auto : eJudgeResult); - OpenTaiko.stage演奏ドラム画面.actLaneTaiko.Start(pChip.nチャンネル番号, eJudgeResult, true, nPlayer); - OpenTaiko.stage演奏ドラム画面.actChipFireD.Start(pChip.nチャンネル番号, eJudgeResult, nPlayer); + this.actJudgeString.Start(nPlayer, eJudgeResult != ENoteJudge.Bad ? ENoteJudge.ADLIB : ENoteJudge.Bad); + eJudgeResult = ENoteJudge.Perfect; // Prevent ADLIB notes breaking DFC runs + OpenTaiko.stage演奏ドラム画面.actLaneTaiko.Start(0x11, eJudgeResult, true, nPlayer); + OpenTaiko.stage演奏ドラム画面.actChipFireD.Start(0x11, eJudgeResult, nPlayer); + this.CChartScore[nPlayer].nADLIB++; + this.CSectionScore[nPlayer].nADLIB++; + this.CBranchScore[nPlayer].nADLIB++; + if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) + this.nADLIB[actDan.NowShowingNumber]++; } - - } - break; - } - - if ((pChip.e楽器パート != EInstrumentPad.Unknown)) { - if (NotesManager.IsMissableNote(pChip)) { - actGauge.Damage(screenmode, pChip.e楽器パート, eJudgeResult, nPlayer); - } - } - - - - - - - var chara = OpenTaiko.Tx.Characters[OpenTaiko.SaveFileInstances[OpenTaiko.GetActualPlayer(nPlayer)].data.Character]; - bool cleared = HGaugeMethods.UNSAFE_FastNormaCheck(nPlayer); - - if (eJudgeResult != ENoteJudge.Poor && eJudgeResult != ENoteJudge.Miss) { - double dbUnit = (((60.0 / (OpenTaiko.stage演奏ドラム画面.actPlayInfo.dbBPM[nPlayer])))); - - // ランナー(たたけたやつ) - this.actRunner.Start(nPlayer, false, pChip); - - int Character = this.actChara.iCurrentCharacter[nPlayer]; - - if (HGaugeMethods.UNSAFE_IsRainbow(nPlayer) && this.bIsAlreadyMaxed[nPlayer] == false) { - if (OpenTaiko.Skin.Characters_Become_Maxed_Ptn[Character] != 0 && actChara.CharaAction_Balloon_Delay[nPlayer].IsEnded) { - this.actChara.ChangeAnime(nPlayer, CActImplCharacter.Anime.Become_Maxed, true); - } - this.bIsAlreadyMaxed[nPlayer] = true; - } - if (cleared && this.bIsAlreadyCleared[nPlayer] == false) { - if (OpenTaiko.Skin.Characters_Become_Cleared_Ptn[Character] != 0 && actChara.CharaAction_Balloon_Delay[nPlayer].IsEnded) { - this.actChara.ChangeAnime(nPlayer, CActImplCharacter.Anime.Become_Cleared, true); - } - this.bIsAlreadyCleared[nPlayer] = true; - OpenTaiko.stage演奏ドラム画面.actBackground.ClearIn(nPlayer); - } - } - - if (eJudgeResult == ENoteJudge.Poor || eJudgeResult == ENoteJudge.Miss || eJudgeResult == ENoteJudge.Bad) { - int Character = this.actChara.iCurrentCharacter[nPlayer]; - - // ランナー(みすったやつ) - this.actRunner.Start(nPlayer, true, pChip); - if (!HGaugeMethods.UNSAFE_IsRainbow(nPlayer) && this.bIsAlreadyMaxed[nPlayer] == true) { - this.bIsAlreadyMaxed[nPlayer] = false; - if (OpenTaiko.Skin.Characters_SoulOut_Ptn[Character] != 0 && actChara.CharaAction_Balloon_Delay[nPlayer].IsEnded) { - this.actChara.ChangeAnime(nPlayer, CActImplCharacter.Anime.SoulOut, true); - } - } else if (!bIsGOGOTIME[nPlayer]) { - if (Chara_MissCount[nPlayer] == 1 - 1) { - if (OpenTaiko.Skin.Characters_MissIn_Ptn[Character] != 0 && actChara.CharaAction_Balloon_Delay[nPlayer].IsEnded) { - this.actChara.ChangeAnime(nPlayer, CActImplCharacter.Anime.MissIn, true); + break; + } else if (NotesManager.IsMine(pChip)) { + if (eJudgeResult != ENoteJudge.Auto && eJudgeResult != ENoteJudge.Miss) { + this.actJudgeString.Start(nPlayer, eJudgeResult != ENoteJudge.Bad ? ENoteJudge.Mine : ENoteJudge.Bad); + bBombHit = true; + eJudgeResult = ENoteJudge.Bad; + OpenTaiko.stage演奏ドラム画面.actLaneTaiko.Start(0x11, eJudgeResult, true, nPlayer); + OpenTaiko.stage演奏ドラム画面.actChipFireD.Start(0x11, ENoteJudge.Mine, nPlayer); + OpenTaiko.Skin.soundBomb?.tPlay(); + actGauge.MineDamage(nPlayer); + this.CChartScore[nPlayer].nMine++; + this.CSectionScore[nPlayer].nMine++; + this.CBranchScore[nPlayer].nMine++; + if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) + this.nMine[actDan.NowShowingNumber]++; } - } else if (Chara_MissCount[nPlayer] == 6 - 1) { - if (OpenTaiko.Skin.Characters_MissDownIn_Ptn[Character] != 0 && actChara.CharaAction_Balloon_Delay[nPlayer].IsEnded) { - this.actChara.ChangeAnime(nPlayer, CActImplCharacter.Anime.MissDownIn, true); + break; + } else { + if (eJudgeResult != ENoteJudge.Miss) { + pChip.bShow = false; } } - } - if (!cleared && this.bIsAlreadyCleared[nPlayer] == true) { - this.bIsAlreadyCleared[nPlayer] = false; - if (OpenTaiko.Skin.Characters_ClearOut_Ptn[Character] != 0 && actChara.CharaAction_Balloon_Delay[nPlayer].IsEnded) { - this.actChara.ChangeAnime(nPlayer, CActImplCharacter.Anime.ClearOut, true); + + if (eJudgeResult != ENoteJudge.Auto && eJudgeResult != ENoteJudge.Miss) { + + this.actJudgeString.Start(nPlayer, (bAutoPlay && !OpenTaiko.ConfigIni.bAIBattleMode) ? ENoteJudge.Auto : eJudgeResult); + OpenTaiko.stage演奏ドラム画面.actLaneTaiko.Start(pChip.nチャンネル番号, eJudgeResult, true, nPlayer); + OpenTaiko.stage演奏ドラム画面.actChipFireD.Start(pChip.nチャンネル番号, eJudgeResult, nPlayer); } - OpenTaiko.stage演奏ドラム画面.actBackground.ClearOut(nPlayer); - switch (chara.effect.tGetGaugeType()) { - case "Hard": - case "Extreme": { - ifp[nPlayer] = true; - isDeniedPlaying[nPlayer] = true; // Prevents the player to ever be able to hit the drum, without freezing the whole game + } + break; + } - bool allDeniedPlaying = true; - for (int p = 0; p < OpenTaiko.ConfigIni.nPlayerCount; p++) { - if (!isDeniedPlaying[p]) { - allDeniedPlaying = false; - break; - } + if ((pChip.e楽器パート != EInstrumentPad.Unknown)) { + if (NotesManager.IsMissableNote(pChip)) { + actGauge.Damage(screenmode, pChip.e楽器パート, eJudgeResult, nPlayer); + } + } + + + + + + + var chara = OpenTaiko.Tx.Characters[OpenTaiko.SaveFileInstances[OpenTaiko.GetActualPlayer(nPlayer)].data.Character]; + bool cleared = HGaugeMethods.UNSAFE_FastNormaCheck(nPlayer); + + if (eJudgeResult != ENoteJudge.Poor && eJudgeResult != ENoteJudge.Miss) { + double dbUnit = (((60.0 / (OpenTaiko.stage演奏ドラム画面.actPlayInfo.dbBPM[nPlayer])))); + + // ランナー(たたけたやつ) + this.actRunner.Start(nPlayer, false, pChip); + + int Character = this.actChara.iCurrentCharacter[nPlayer]; + + if (HGaugeMethods.UNSAFE_IsRainbow(nPlayer) && this.bIsAlreadyMaxed[nPlayer] == false) { + if (OpenTaiko.Skin.Characters_Become_Maxed_Ptn[Character] != 0 && actChara.CharaAction_Balloon_Delay[nPlayer].IsEnded) { + this.actChara.ChangeAnime(nPlayer, CActImplCharacter.Anime.Become_Maxed, true); + } + this.bIsAlreadyMaxed[nPlayer] = true; + } + if (cleared && this.bIsAlreadyCleared[nPlayer] == false) { + if (OpenTaiko.Skin.Characters_Become_Cleared_Ptn[Character] != 0 && actChara.CharaAction_Balloon_Delay[nPlayer].IsEnded) { + this.actChara.ChangeAnime(nPlayer, CActImplCharacter.Anime.Become_Cleared, true); + } + this.bIsAlreadyCleared[nPlayer] = true; + OpenTaiko.stage演奏ドラム画面.actBackground.ClearIn(nPlayer); + } + } + + if (eJudgeResult == ENoteJudge.Poor || eJudgeResult == ENoteJudge.Miss || eJudgeResult == ENoteJudge.Bad) { + int Character = this.actChara.iCurrentCharacter[nPlayer]; + + // ランナー(みすったやつ) + this.actRunner.Start(nPlayer, true, pChip); + if (!HGaugeMethods.UNSAFE_IsRainbow(nPlayer) && this.bIsAlreadyMaxed[nPlayer] == true) { + this.bIsAlreadyMaxed[nPlayer] = false; + if (OpenTaiko.Skin.Characters_SoulOut_Ptn[Character] != 0 && actChara.CharaAction_Balloon_Delay[nPlayer].IsEnded) { + this.actChara.ChangeAnime(nPlayer, CActImplCharacter.Anime.SoulOut, true); + } + } else if (!bIsGOGOTIME[nPlayer]) { + if (Chara_MissCount[nPlayer] == 1 - 1) { + if (OpenTaiko.Skin.Characters_MissIn_Ptn[Character] != 0 && actChara.CharaAction_Balloon_Delay[nPlayer].IsEnded) { + this.actChara.ChangeAnime(nPlayer, CActImplCharacter.Anime.MissIn, true); + } + } else if (Chara_MissCount[nPlayer] == 6 - 1) { + if (OpenTaiko.Skin.Characters_MissDownIn_Ptn[Character] != 0 && actChara.CharaAction_Balloon_Delay[nPlayer].IsEnded) { + this.actChara.ChangeAnime(nPlayer, CActImplCharacter.Anime.MissDownIn, true); + } + } + } + if (!cleared && this.bIsAlreadyCleared[nPlayer] == true) { + this.bIsAlreadyCleared[nPlayer] = false; + if (OpenTaiko.Skin.Characters_ClearOut_Ptn[Character] != 0 && actChara.CharaAction_Balloon_Delay[nPlayer].IsEnded) { + this.actChara.ChangeAnime(nPlayer, CActImplCharacter.Anime.ClearOut, true); + } + OpenTaiko.stage演奏ドラム画面.actBackground.ClearOut(nPlayer); + + switch (chara.effect.tGetGaugeType()) { + case "Hard": + case "Extreme": { + ifp[nPlayer] = true; + isDeniedPlaying[nPlayer] = true; // Prevents the player to ever be able to hit the drum, without freezing the whole game + + bool allDeniedPlaying = true; + for (int p = 0; p < OpenTaiko.ConfigIni.nPlayerCount; p++) { + if (!isDeniedPlaying[p]) { + allDeniedPlaying = false; + break; } - if (allDeniedPlaying) OpenTaiko.DTX.t全チップの再生停止(); // Stop playing song + } + if (allDeniedPlaying) OpenTaiko.DTX.t全チップの再生停止(); // Stop playing song - // Stop timer : Pauses the whole game (to remove once is denied playing will work) - //CSound管理.rc演奏用タイマ.t一時停止(); + // Stop timer : Pauses the whole game (to remove once is denied playing will work) + //CSound管理.rc演奏用タイマ.t一時停止(); + } + break; + } + } + cInvisibleChip.ShowChipTemporally(pChip.e楽器パート); + } + + void returnChara() { + int Character = this.actChara.iCurrentCharacter[nPlayer]; + + double dbUnit = (((60.0 / (OpenTaiko.stage演奏ドラム画面.actPlayInfo.dbBPM[nPlayer])))); + dbUnit = (((60.0 / pChip.dbBPM))); + + if (OpenTaiko.Skin.Characters_Return_Ptn[Character] != 0 && !bIsGOGOTIME[nPlayer] && actChara.CharaAction_Balloon_Delay[nPlayer].IsEnded) { + { + // 魂ゲージMAXではない + // ジャンプ_ノーマル + this.actChara.ChangeAnime(nPlayer, CActImplCharacter.Anime.Return, true); + //this.actChara.キャラクター_アクション_10コンボ(); + } + } + } + + + switch (pChip.e楽器パート) { + case EInstrumentPad.Drums: + case EInstrumentPad.Guitar: + case EInstrumentPad.Bass: + break; + case EInstrumentPad.Taiko: + if (!bAutoPlay) { + if (NotesManager.IsGenericRoll(pChip)) + break; + + switch (eJudgeResult) { + case ENoteJudge.Perfect: { + if (NotesManager.IsADLIB(pChip)) + break; + + this.CBranchScore[nPlayer].nGreat++; + this.CChartScore[nPlayer].nGreat++; + this.CSectionScore[nPlayer].nGreat++; + this.Chara_MissCount[nPlayer] = 0; + + if (nPlayer == 0) this.nヒット数_Auto含まない.Drums.Perfect++; + this.actCombo.n現在のコンボ数[nPlayer]++; + + if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) { + this.n良[actDan.NowShowingNumber]++; + this.tIncreaseComboDan(actDan.NowShowingNumber); + } + + + if (this.actCombo.ctコンボ加算[nPlayer].IsUnEnded) { + this.actCombo.ctコンボ加算[nPlayer].CurrentValue = 1; + } else { + this.actCombo.ctコンボ加算[nPlayer].CurrentValue = 0; + } + + + AIRegisterInput(nPlayer, 1); + + OpenTaiko.stage演奏ドラム画面.actMtaiko.BackSymbolEvent(nPlayer); + + + if (this.bIsMiss[nPlayer]) { + returnChara(); + } + + this.bIsMiss[nPlayer] = false; } break; - } - } - cInvisibleChip.ShowChipTemporally(pChip.e楽器パート); - } + case ENoteJudge.Great: + case ENoteJudge.Good: { + this.CBranchScore[nPlayer].nGood++; + this.CChartScore[nPlayer].nGood++; + this.CSectionScore[nPlayer].nGood++; + this.Chara_MissCount[nPlayer] = 0; - void returnChara() { - int Character = this.actChara.iCurrentCharacter[nPlayer]; + if (nPlayer == 0) this.nヒット数_Auto含まない.Drums.Great++; + this.actCombo.n現在のコンボ数[nPlayer]++; - double dbUnit = (((60.0 / (OpenTaiko.stage演奏ドラム画面.actPlayInfo.dbBPM[nPlayer])))); - dbUnit = (((60.0 / pChip.dbBPM))); + if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) { + this.n可[actDan.NowShowingNumber]++; + this.tIncreaseComboDan(actDan.NowShowingNumber); + } - if (OpenTaiko.Skin.Characters_Return_Ptn[Character] != 0 && !bIsGOGOTIME[nPlayer] && actChara.CharaAction_Balloon_Delay[nPlayer].IsEnded) { - { - // 魂ゲージMAXではない - // ジャンプ_ノーマル - this.actChara.ChangeAnime(nPlayer, CActImplCharacter.Anime.Return, true); - //this.actChara.キャラクター_アクション_10コンボ(); - } - } - } + if (this.actCombo.ctコンボ加算[nPlayer].IsUnEnded) { + this.actCombo.ctコンボ加算[nPlayer].CurrentValue = 1; + } else { + this.actCombo.ctコンボ加算[nPlayer].CurrentValue = 0; + } - switch (pChip.e楽器パート) { - case EInstrumentPad.Drums: - case EInstrumentPad.Guitar: - case EInstrumentPad.Bass: - break; - case EInstrumentPad.Taiko: - if (!bAutoPlay) { - if (NotesManager.IsGenericRoll(pChip)) + AIRegisterInput(nPlayer, 0.5f); + + OpenTaiko.stage演奏ドラム画面.actMtaiko.BackSymbolEvent(nPlayer); + + if (this.bIsMiss[nPlayer]) { + returnChara(); + } + + this.bIsMiss[nPlayer] = false; + } break; + case ENoteJudge.Poor: + case ENoteJudge.Miss: + case ENoteJudge.Bad: { + if (!NotesManager.IsMissableNote(pChip) && !bBombHit) + break; - switch (eJudgeResult) { - case ENoteJudge.Perfect: { + if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Tower) + CFloorManagement.damage(); + + if (!bBombHit) { + if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) + this.n不可[actDan.NowShowingNumber]++; + + this.CBranchScore[nPlayer].nMiss++; + this.CChartScore[nPlayer].nMiss++; + this.CSectionScore[nPlayer].nMiss++; + this.Chara_MissCount[nPlayer]++; + + if (nPlayer == 0) this.nヒット数_Auto含まない.Drums.Miss++; + } + + this.actCombo.n現在のコンボ数[nPlayer] = 0; + if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) + this.nCombo[actDan.NowShowingNumber] = 0; + this.actComboVoice.tReset(nPlayer); + + AIRegisterInput(nPlayer, 0f); + + this.bIsMiss[nPlayer] = true; + } + break; + default: + this.nヒット数_Auto含む.Drums[(int)eJudgeResult]++; + break; + } + } else if (bAutoPlay) { + switch (eJudgeResult) { + case ENoteJudge.Perfect: { + if (!NotesManager.IsGenericRoll(pChip)) { if (NotesManager.IsADLIB(pChip)) break; - this.CBranchScore[nPlayer].nGreat++; - this.CChartScore[nPlayer].nGreat++; - this.CSectionScore[nPlayer].nGreat++; - this.Chara_MissCount[nPlayer] = 0; - - if (nPlayer == 0) this.nヒット数_Auto含まない.Drums.Perfect++; - this.actCombo.n現在のコンボ数[nPlayer]++; - if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) { this.n良[actDan.NowShowingNumber]++; this.tIncreaseComboDan(actDan.NowShowingNumber); } + this.CBranchScore[nPlayer].nGreat++; + this.CChartScore[nPlayer].nGreat++; + this.CSectionScore[nPlayer].nGreat++; + this.Chara_MissCount[nPlayer] = 0; + if (nPlayer == 0) this.nヒット数_Auto含む.Drums.Perfect++; + this.actCombo.n現在のコンボ数[nPlayer]++; + //this.actCombo.ctコンボ加算.t進行(); if (this.actCombo.ctコンボ加算[nPlayer].IsUnEnded) { this.actCombo.ctコンボ加算[nPlayer].CurrentValue = 1; } else { this.actCombo.ctコンボ加算[nPlayer].CurrentValue = 0; } - AIRegisterInput(nPlayer, 1); OpenTaiko.stage演奏ドラム画面.actMtaiko.BackSymbolEvent(nPlayer); - if (this.bIsMiss[nPlayer]) { returnChara(); } this.bIsMiss[nPlayer] = false; } - break; - case ENoteJudge.Great: - case ENoteJudge.Good: { + } + break; + + case ENoteJudge.Great: + case ENoteJudge.Good: { + if (!NotesManager.IsGenericRoll(pChip)) { + if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) { + this.n可[actDan.NowShowingNumber]++; + this.tIncreaseComboDan(actDan.NowShowingNumber); + } + this.CBranchScore[nPlayer].nGood++; this.CChartScore[nPlayer].nGood++; this.CSectionScore[nPlayer].nGood++; this.Chara_MissCount[nPlayer] = 0; - if (nPlayer == 0) this.nヒット数_Auto含まない.Drums.Great++; + if (nPlayer == 0) this.nヒット数_Auto含む.Drums.Great++; this.actCombo.n現在のコンボ数[nPlayer]++; - if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) { - this.n可[actDan.NowShowingNumber]++; - this.tIncreaseComboDan(actDan.NowShowingNumber); - } - if (this.actCombo.ctコンボ加算[nPlayer].IsUnEnded) { this.actCombo.ctコンボ加算[nPlayer].CurrentValue = 1; } else { @@ -1821,10 +1930,11 @@ namespace OpenTaiko { this.bIsMiss[nPlayer] = false; } - break; - case ENoteJudge.Poor: - case ENoteJudge.Miss: - case ENoteJudge.Bad: { + } + break; + + default: { + if (!NotesManager.IsGenericRoll(pChip)) { if (!NotesManager.IsMissableNote(pChip) && !bBombHit) break; @@ -1835,12 +1945,11 @@ namespace OpenTaiko { if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) this.n不可[actDan.NowShowingNumber]++; + this.CBranchScore[nPlayer].nMiss++; this.CChartScore[nPlayer].nMiss++; this.CSectionScore[nPlayer].nMiss++; this.Chara_MissCount[nPlayer]++; - - if (nPlayer == 0) this.nヒット数_Auto含まない.Drums.Miss++; } this.actCombo.n現在のコンボ数[nPlayer] = 0; @@ -1850,2378 +1959,2283 @@ namespace OpenTaiko { AIRegisterInput(nPlayer, 0f); + this.bIsMiss[nPlayer] = true; } - break; - default: - this.nヒット数_Auto含む.Drums[(int)eJudgeResult]++; - break; - } - } else if (bAutoPlay) { - switch (eJudgeResult) { - case ENoteJudge.Perfect: { - if (!NotesManager.IsGenericRoll(pChip)) { - if (NotesManager.IsADLIB(pChip)) - break; + } + break; + } + } + actDan.Update(); - if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) { - this.n良[actDan.NowShowingNumber]++; - this.tIncreaseComboDan(actDan.NowShowingNumber); - } + #region[ Combo voice ] - this.CBranchScore[nPlayer].nGreat++; - this.CChartScore[nPlayer].nGreat++; - this.CSectionScore[nPlayer].nGreat++; - this.Chara_MissCount[nPlayer] = 0; + if (!NotesManager.IsGenericRoll(pChip)) { + if ((this.actCombo.n現在のコンボ数[nPlayer] % 100 == 0 || this.actCombo.n現在のコンボ数[nPlayer] == 50) && this.actCombo.n現在のコンボ数[nPlayer] > 0) { + this.actComboBalloon.Start(this.actCombo.n現在のコンボ数[nPlayer], nPlayer); + } - if (nPlayer == 0) this.nヒット数_Auto含む.Drums.Perfect++; - this.actCombo.n現在のコンボ数[nPlayer]++; - //this.actCombo.ctコンボ加算.t進行(); - if (this.actCombo.ctコンボ加算[nPlayer].IsUnEnded) { - this.actCombo.ctコンボ加算[nPlayer].CurrentValue = 1; - } else { - this.actCombo.ctコンボ加算[nPlayer].CurrentValue = 0; - } + // Combo voice here + this.actComboVoice.t再生(this.actCombo.n現在のコンボ数[nPlayer], nPlayer); - AIRegisterInput(nPlayer, 1); + double dbUnit = (((60.0 / (OpenTaiko.stage演奏ドラム画面.actPlayInfo.dbBPM[nPlayer])))); + dbUnit = (((60.0 / pChip.dbBPM))); - OpenTaiko.stage演奏ドラム画面.actMtaiko.BackSymbolEvent(nPlayer); + //CDTXMania.act文字コンソール.tPrint(620, 80, C文字コンソール.Eフォント種別.白, "BPM: " + dbUnit.ToString()); - if (this.bIsMiss[nPlayer]) { - returnChara(); - } - - this.bIsMiss[nPlayer] = false; - } - } - break; - - case ENoteJudge.Great: - case ENoteJudge.Good: { - if (!NotesManager.IsGenericRoll(pChip)) { - if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) { - this.n可[actDan.NowShowingNumber]++; - this.tIncreaseComboDan(actDan.NowShowingNumber); - } - - this.CBranchScore[nPlayer].nGood++; - this.CChartScore[nPlayer].nGood++; - this.CSectionScore[nPlayer].nGood++; - this.Chara_MissCount[nPlayer] = 0; - - if (nPlayer == 0) this.nヒット数_Auto含む.Drums.Great++; - this.actCombo.n現在のコンボ数[nPlayer]++; - - if (this.actCombo.ctコンボ加算[nPlayer].IsUnEnded) { - this.actCombo.ctコンボ加算[nPlayer].CurrentValue = 1; - } else { - this.actCombo.ctコンボ加算[nPlayer].CurrentValue = 0; - } - - - AIRegisterInput(nPlayer, 0.5f); - - OpenTaiko.stage演奏ドラム画面.actMtaiko.BackSymbolEvent(nPlayer); - - if (this.bIsMiss[nPlayer]) { - returnChara(); - } - - this.bIsMiss[nPlayer] = false; - } - } - break; - - default: { - if (!NotesManager.IsGenericRoll(pChip)) { - if (!NotesManager.IsMissableNote(pChip) && !bBombHit) - break; - - if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Tower) - CFloorManagement.damage(); - - if (!bBombHit) { - if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) - this.n不可[actDan.NowShowingNumber]++; - - - this.CBranchScore[nPlayer].nMiss++; - this.CChartScore[nPlayer].nMiss++; - this.CSectionScore[nPlayer].nMiss++; - this.Chara_MissCount[nPlayer]++; - } - - this.actCombo.n現在のコンボ数[nPlayer] = 0; - if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) - this.nCombo[actDan.NowShowingNumber] = 0; - this.actComboVoice.tReset(nPlayer); - - AIRegisterInput(nPlayer, 0f); - - - this.bIsMiss[nPlayer] = true; - } - } - break; + for (int i = 0; i < 5; i++) { + if (this.actCombo.n現在のコンボ数[i] == 50 || this.actCombo.n現在のコンボ数[i] == 300) { + ctChipAnimeLag[i] = new CCounter(0, 664, 1, OpenTaiko.Timer); } } - actDan.Update(); - #region[ Combo voice ] - - if (!NotesManager.IsGenericRoll(pChip)) { - if ((this.actCombo.n現在のコンボ数[nPlayer] % 100 == 0 || this.actCombo.n現在のコンボ数[nPlayer] == 50) && this.actCombo.n現在のコンボ数[nPlayer] > 0) { - this.actComboBalloon.Start(this.actCombo.n現在のコンボ数[nPlayer], nPlayer); - } - - // Combo voice here - this.actComboVoice.t再生(this.actCombo.n現在のコンボ数[nPlayer], nPlayer); - - double dbUnit = (((60.0 / (OpenTaiko.stage演奏ドラム画面.actPlayInfo.dbBPM[nPlayer])))); - dbUnit = (((60.0 / pChip.dbBPM))); - - //CDTXMania.act文字コンソール.tPrint(620, 80, C文字コンソール.Eフォント種別.白, "BPM: " + dbUnit.ToString()); - - for (int i = 0; i < 5; i++) { - if (this.actCombo.n現在のコンボ数[i] == 50 || this.actCombo.n現在のコンボ数[i] == 300) { - ctChipAnimeLag[i] = new CCounter(0, 664, 1, OpenTaiko.Timer); + if (this.actCombo.n現在のコンボ数[nPlayer] % 10 == 0 && this.actCombo.n現在のコンボ数[nPlayer] > 0) { + //if (this.actChara.bキャラクターアクション中 == false) + //{ + int Character = this.actChara.iCurrentCharacter[nPlayer]; + // Edit character values here + if (!pChip.bGOGOTIME) //2018.03.11 kairera0467 チップに埋め込んだフラグから読み取る + { + if (OpenTaiko.Skin.Characters_10Combo_Ptn[Character] != 0 && this.actChara.eNowAnime[nPlayer] != CActImplCharacter.Anime.Combo10 && actChara.CharaAction_Balloon_Delay[nPlayer].IsEnded) { + if (!HGaugeMethods.UNSAFE_IsRainbow(nPlayer)) { + // 魂ゲージMAXではない + // ジャンプ_ノーマル + this.actChara.ChangeAnime(nPlayer, CActImplCharacter.Anime.Combo10, true); + } + } + if (OpenTaiko.Skin.Characters_10Combo_Maxed_Ptn[Character] != 0 && this.actChara.eNowAnime[nPlayer] != CActImplCharacter.Anime.Combo10_Max && actChara.CharaAction_Balloon_Delay[nPlayer].IsEnded) { + if (HGaugeMethods.UNSAFE_IsRainbow(nPlayer)) { + // 魂ゲージMAX + // ジャンプ_MAX + this.actChara.ChangeAnime(nPlayer, CActImplCharacter.Anime.Combo10_Max, true); + } } } - if (this.actCombo.n現在のコンボ数[nPlayer] % 10 == 0 && this.actCombo.n現在のコンボ数[nPlayer] > 0) { - //if (this.actChara.bキャラクターアクション中 == false) - //{ - int Character = this.actChara.iCurrentCharacter[nPlayer]; - // Edit character values here - if (!pChip.bGOGOTIME) //2018.03.11 kairera0467 チップに埋め込んだフラグから読み取る - { - if (OpenTaiko.Skin.Characters_10Combo_Ptn[Character] != 0 && this.actChara.eNowAnime[nPlayer] != CActImplCharacter.Anime.Combo10 && actChara.CharaAction_Balloon_Delay[nPlayer].IsEnded) { - if (!HGaugeMethods.UNSAFE_IsRainbow(nPlayer)) { - // 魂ゲージMAXではない - // ジャンプ_ノーマル - this.actChara.ChangeAnime(nPlayer, CActImplCharacter.Anime.Combo10, true); - } - } - if (OpenTaiko.Skin.Characters_10Combo_Maxed_Ptn[Character] != 0 && this.actChara.eNowAnime[nPlayer] != CActImplCharacter.Anime.Combo10_Max && actChara.CharaAction_Balloon_Delay[nPlayer].IsEnded) { - if (HGaugeMethods.UNSAFE_IsRainbow(nPlayer)) { - // 魂ゲージMAX - // ジャンプ_MAX - this.actChara.ChangeAnime(nPlayer, CActImplCharacter.Anime.Combo10_Max, true); - } - } - } - - } - - this.t紙吹雪_開始(); - } - #endregion - - - break; - - - default: - break; - } - if (((pChip.e楽器パート != EInstrumentPad.Unknown)) && (eJudgeResult != ENoteJudge.Miss) && (eJudgeResult != ENoteJudge.Bad) && (eJudgeResult != ENoteJudge.Poor) && (NotesManager.IsMissableNote(pChip))) { - int nCombos = this.actCombo.n現在のコンボ数[nPlayer]; - long nInit = OpenTaiko.DTX.nScoreInit[0, OpenTaiko.stageSongSelect.nChoosenSongDifficulty[nPlayer]]; - long nDiff = OpenTaiko.DTX.nScoreDiff[OpenTaiko.stageSongSelect.nChoosenSongDifficulty[nPlayer]]; - long nAddScore = 0; - - if (OpenTaiko.ConfigIni.ShinuchiMode) //2016.07.04 kairera0467 真打モード。 - { - nAddScore = (long)nAddScoreNiji[nPlayer]; - - if (eJudgeResult == ENoteJudge.Great || eJudgeResult == ENoteJudge.Good) { - nAddScore = (long)nAddScoreNiji[nPlayer] / 20; - nAddScore = (long)nAddScore * 10; } - this.actScore.Add((long)nAddScore, nPlayer); - } else if (OpenTaiko.DTX.nScoreModeTmp == 2) { - if (nCombos < 10) { - nAddScore = this.nScore[0]; - } else if (nCombos >= 10 && nCombos <= 29) { - nAddScore = this.nScore[1]; - } else if (nCombos >= 30 && nCombos <= 49) { - nAddScore = this.nScore[2]; - } else if (nCombos >= 50 && nCombos <= 99) { - nAddScore = this.nScore[3]; - } else if (nCombos >= 100) { - nAddScore = this.nScore[4]; - } - - if (eJudgeResult == ENoteJudge.Great || eJudgeResult == ENoteJudge.Good) { - nAddScore = nAddScore / 2; - } - - if (pChip.bGOGOTIME) //2018.03.11 kairera0467 チップに埋め込んだフラグから読み取る - { - nAddScore = (int)(nAddScore * 1.2f); - } - - //100コンボ毎のボーナス - if (nCombos % 100 == 0 && nCombos > 99) { - if (this.actScore.ctボーナス加算タイマ[nPlayer].IsTicked) { - this.actScore.ctボーナス加算タイマ[nPlayer].Stop(); - this.actScore.BonusAdd(nPlayer); - } - this.actScore.ctボーナス加算タイマ[nPlayer].CurrentValue = 0; - this.actScore.ctボーナス加算タイマ[nPlayer] = new CCounter(0, 2, 1000, OpenTaiko.Timer); - } - - nAddScore = (int)(nAddScore / 10); - nAddScore = (int)(nAddScore * 10); - - //大音符のボーナス - if (pChip.nチャンネル番号 == 0x13 || pChip.nチャンネル番号 == 0x14 || pChip.nチャンネル番号 == 0x1A || pChip.nチャンネル番号 == 0x1B) { - nAddScore = nAddScore * 2; - } - - this.actScore.Add(nAddScore, nPlayer); - } else if (OpenTaiko.DTX.nScoreModeTmp == 1) { - if (nCombos < 10) { - nAddScore = this.nScore[0]; - } else if (nCombos >= 10 && nCombos <= 19) { - nAddScore = this.nScore[1]; - } else if (nCombos >= 20 && nCombos <= 29) { - nAddScore = this.nScore[2]; - } else if (nCombos >= 30 && nCombos <= 39) { - nAddScore = this.nScore[3]; - } else if (nCombos >= 40 && nCombos <= 49) { - nAddScore = this.nScore[4]; - } else if (nCombos >= 50 && nCombos <= 59) { - nAddScore = this.nScore[5]; - } else if (nCombos >= 60 && nCombos <= 69) { - nAddScore = this.nScore[6]; - } else if (nCombos >= 70 && nCombos <= 79) { - nAddScore = this.nScore[7]; - } else if (nCombos >= 80 && nCombos <= 89) { - nAddScore = this.nScore[8]; - } else if (nCombos >= 90 && nCombos <= 99) { - nAddScore = this.nScore[9]; - } else if (nCombos >= 100) { - nAddScore = this.nScore[10]; - } - - if (eJudgeResult == ENoteJudge.Great || eJudgeResult == ENoteJudge.Good) { - nAddScore = nAddScore / 2; - } - - if (pChip.bGOGOTIME) //2018.03.11 kairera0467 チップに埋め込んだフラグから読み取る - nAddScore = (int)(nAddScore * 1.2f); - - nAddScore = (int)(nAddScore / 10.0); - nAddScore = (int)(nAddScore * 10); - - //大音符のボーナス - if (pChip.nチャンネル番号 == 0x13 || pChip.nチャンネル番号 == 0x14 || pChip.nチャンネル番号 == 0x1A || pChip.nチャンネル番号 == 0x1B) { - nAddScore = nAddScore * 2; - } - - this.actScore.Add(nAddScore, nPlayer); - } else { - if (eJudgeResult == ENoteJudge.Perfect) { - if (nCombos < 200) { - nAddScore = 1000; - } else { - nAddScore = 2000; - } - } else if (eJudgeResult == ENoteJudge.Great || eJudgeResult == ENoteJudge.Good) { - if (nCombos < 200) { - nAddScore = 500; - } else { - nAddScore = 1000; - } - } - - if (pChip.bGOGOTIME) //2018.03.11 kairera0467 チップに埋め込んだフラグから読み取る - nAddScore = (int)(nAddScore * 1.2f); + this.t紙吹雪_開始(); + } + #endregion - //大音符のボーナス - if (pChip.nチャンネル番号 == 0x13 || pChip.nチャンネル番号 == 0x25) { - nAddScore = nAddScore * 2; - } + break; - this.actScore.Add(nAddScore, nPlayer); + + default: + break; + } + if (((pChip.e楽器パート != EInstrumentPad.Unknown)) && (eJudgeResult != ENoteJudge.Miss) && (eJudgeResult != ENoteJudge.Bad) && (eJudgeResult != ENoteJudge.Poor) && (NotesManager.IsMissableNote(pChip))) { + int nCombos = this.actCombo.n現在のコンボ数[nPlayer]; + long nInit = OpenTaiko.DTX.nScoreInit[0, OpenTaiko.stageSongSelect.nChoosenSongDifficulty[nPlayer]]; + long nDiff = OpenTaiko.DTX.nScoreDiff[OpenTaiko.stageSongSelect.nChoosenSongDifficulty[nPlayer]]; + long nAddScore = 0; + + if (OpenTaiko.ConfigIni.ShinuchiMode) //2016.07.04 kairera0467 真打モード。 + { + nAddScore = (long)nAddScoreNiji[nPlayer]; + + if (eJudgeResult == ENoteJudge.Great || eJudgeResult == ENoteJudge.Good) { + nAddScore = (long)nAddScoreNiji[nPlayer] / 20; + nAddScore = (long)nAddScore * 10; } - //キーを押したときにスコア情報 + nAddScoreを置き換える様に - int __score = (int)(this.actScore.GetScore(nPlayer) + nAddScore); - this.CBranchScore[nPlayer].nScore = __score; - this.CChartScore[nPlayer].nScore = __score; - this.CSectionScore[nPlayer].nScore = __score; + this.actScore.Add((long)nAddScore, nPlayer); + } else if (OpenTaiko.DTX.nScoreModeTmp == 2) { + if (nCombos < 10) { + nAddScore = this.nScore[0]; + } else if (nCombos >= 10 && nCombos <= 29) { + nAddScore = this.nScore[1]; + } else if (nCombos >= 30 && nCombos <= 49) { + nAddScore = this.nScore[2]; + } else if (nCombos >= 50 && nCombos <= 99) { + nAddScore = this.nScore[3]; + } else if (nCombos >= 100) { + nAddScore = this.nScore[4]; + } + + if (eJudgeResult == ENoteJudge.Great || eJudgeResult == ENoteJudge.Good) { + nAddScore = nAddScore / 2; + } + + if (pChip.bGOGOTIME) //2018.03.11 kairera0467 チップに埋め込んだフラグから読み取る + { + nAddScore = (int)(nAddScore * 1.2f); + } + + //100コンボ毎のボーナス + if (nCombos % 100 == 0 && nCombos > 99) { + if (this.actScore.ctボーナス加算タイマ[nPlayer].IsTicked) { + this.actScore.ctボーナス加算タイマ[nPlayer].Stop(); + this.actScore.BonusAdd(nPlayer); + } + this.actScore.ctボーナス加算タイマ[nPlayer].CurrentValue = 0; + this.actScore.ctボーナス加算タイマ[nPlayer] = new CCounter(0, 2, 1000, OpenTaiko.Timer); + } + + nAddScore = (int)(nAddScore / 10); + nAddScore = (int)(nAddScore * 10); + + //大音符のボーナス + if (pChip.nチャンネル番号 == 0x13 || pChip.nチャンネル番号 == 0x14 || pChip.nチャンネル番号 == 0x1A || pChip.nチャンネル番号 == 0x1B) { + nAddScore = nAddScore * 2; + } + + this.actScore.Add(nAddScore, nPlayer); + } else if (OpenTaiko.DTX.nScoreModeTmp == 1) { + if (nCombos < 10) { + nAddScore = this.nScore[0]; + } else if (nCombos >= 10 && nCombos <= 19) { + nAddScore = this.nScore[1]; + } else if (nCombos >= 20 && nCombos <= 29) { + nAddScore = this.nScore[2]; + } else if (nCombos >= 30 && nCombos <= 39) { + nAddScore = this.nScore[3]; + } else if (nCombos >= 40 && nCombos <= 49) { + nAddScore = this.nScore[4]; + } else if (nCombos >= 50 && nCombos <= 59) { + nAddScore = this.nScore[5]; + } else if (nCombos >= 60 && nCombos <= 69) { + nAddScore = this.nScore[6]; + } else if (nCombos >= 70 && nCombos <= 79) { + nAddScore = this.nScore[7]; + } else if (nCombos >= 80 && nCombos <= 89) { + nAddScore = this.nScore[8]; + } else if (nCombos >= 90 && nCombos <= 99) { + nAddScore = this.nScore[9]; + } else if (nCombos >= 100) { + nAddScore = this.nScore[10]; + } + + if (eJudgeResult == ENoteJudge.Great || eJudgeResult == ENoteJudge.Good) { + nAddScore = nAddScore / 2; + } + + if (pChip.bGOGOTIME) //2018.03.11 kairera0467 チップに埋め込んだフラグから読み取る + nAddScore = (int)(nAddScore * 1.2f); + + nAddScore = (int)(nAddScore / 10.0); + nAddScore = (int)(nAddScore * 10); + + //大音符のボーナス + if (pChip.nチャンネル番号 == 0x13 || pChip.nチャンネル番号 == 0x14 || pChip.nチャンネル番号 == 0x1A || pChip.nチャンネル番号 == 0x1B) { + nAddScore = nAddScore * 2; + } + + this.actScore.Add(nAddScore, nPlayer); + } else { + if (eJudgeResult == ENoteJudge.Perfect) { + if (nCombos < 200) { + nAddScore = 1000; + } else { + nAddScore = 2000; + } + } else if (eJudgeResult == ENoteJudge.Great || eJudgeResult == ENoteJudge.Good) { + if (nCombos < 200) { + nAddScore = 500; + } else { + nAddScore = 1000; + } + } + + if (pChip.bGOGOTIME) //2018.03.11 kairera0467 チップに埋め込んだフラグから読み取る + nAddScore = (int)(nAddScore * 1.2f); + + + //大音符のボーナス + if (pChip.nチャンネル番号 == 0x13 || pChip.nチャンネル番号 == 0x25) { + nAddScore = nAddScore * 2; + } + + this.actScore.Add(nAddScore, nPlayer); } - - return ENoteJudge.Auto; + //キーを押したときにスコア情報 + nAddScoreを置き換える様に + int __score = (int)(this.actScore.GetScore(nPlayer) + nAddScore); + this.CBranchScore[nPlayer].nScore = __score; + this.CChartScore[nPlayer].nScore = __score; + this.CSectionScore[nPlayer].nScore = __score; } - protected abstract void tチップのヒット処理_BadならびにTight時のMiss(CDTX.ECourse eCourse, EInstrumentPad part); - protected abstract void tチップのヒット処理_BadならびにTight時のMiss(CDTX.ECourse eCourse, EInstrumentPad part, int nLane); - protected void tチップのヒット処理_BadならびにTight時のMiss(CDTX.ECourse eCourse, EInstrumentPad part, int nLane, EInstrumentPad screenmode) { - cInvisibleChip.StartSemiInvisible(part); - cInvisibleChip.ShowChipTemporally(part); + return ENoteJudge.Auto; + } - //ChipのCourseをベースにゲージの伸びを調節 - actGauge.Damage(screenmode, part, ENoteJudge.Miss, 0); - switch (part) { - case EInstrumentPad.Drums: - case EInstrumentPad.Guitar: - case EInstrumentPad.Bass: - break; + protected abstract void tチップのヒット処理_BadならびにTight時のMiss(CDTX.ECourse eCourse, EInstrumentPad part); + protected abstract void tチップのヒット処理_BadならびにTight時のMiss(CDTX.ECourse eCourse, EInstrumentPad part, int nLane); - case EInstrumentPad.Taiko: - this.actCombo.n現在のコンボ数.P1 = 0; - this.actCombo.n現在のコンボ数.P2 = 0; - this.actCombo.n現在のコンボ数.P3 = 0; - this.actCombo.n現在のコンボ数.P4 = 0; - this.actCombo.n現在のコンボ数.P5 = 0; - break; + protected void tチップのヒット処理_BadならびにTight時のMiss(CDTX.ECourse eCourse, EInstrumentPad part, int nLane, EInstrumentPad screenmode) { + cInvisibleChip.StartSemiInvisible(part); + cInvisibleChip.ShowChipTemporally(part); - default: - return; - } + //ChipのCourseをベースにゲージの伸びを調節 + actGauge.Damage(screenmode, part, ENoteJudge.Miss, 0); + switch (part) { + case EInstrumentPad.Drums: + case EInstrumentPad.Guitar: + case EInstrumentPad.Bass: + break; + + case EInstrumentPad.Taiko: + this.actCombo.n現在のコンボ数.P1 = 0; + this.actCombo.n現在のコンボ数.P2 = 0; + this.actCombo.n現在のコンボ数.P3 = 0; + this.actCombo.n現在のコンボ数.P4 = 0; + this.actCombo.n現在のコンボ数.P5 = 0; + break; + + default: + return; + } + } + + protected CDTX.CChip r指定時刻に一番近い未ヒットChipを過去方向優先で検索する(long nTime, int nPlayer) { + //sw2.Start(); + + int nIndex_InitialPositionSearchingToPast; + int nTimeDiff; + int count = listChip[nPlayer].Count; + if (count <= 0) // 演奏データとして1個もチップがない場合は + { + //sw2.Stop(); + return null; } - protected CDTX.CChip r指定時刻に一番近い未ヒットChipを過去方向優先で検索する(long nTime, int nPlayer) { - //sw2.Start(); + int nIndex_NearestChip_Future = nIndex_InitialPositionSearchingToPast = this.n現在のトップChip; + if (this.n現在のトップChip >= count) // その時点で演奏すべきチップが既に全部無くなっていたら + { + nIndex_NearestChip_Future = nIndex_InitialPositionSearchingToPast = count - 1; + } - int nIndex_InitialPositionSearchingToPast; - int nTimeDiff; - int count = listChip[nPlayer].Count; - if (count <= 0) // 演奏データとして1個もチップがない場合は + + // int nIndex_NearestChip_Future = nIndex_InitialPositionSearchingToFuture; + // while ( nIndex_NearestChip_Future < count ) // 未来方向への検索 + for (; nIndex_NearestChip_Future < count; nIndex_NearestChip_Future++) { + + if (nIndex_NearestChip_Future < 0) + continue; + + + CDTX.CChip chip = listChip[nPlayer][nIndex_NearestChip_Future]; + if (!chip.bHit && chip.b可視) { + if (NotesManager.IsHittableNote(chip)) { + if (chip.n発声時刻ms > nTime) { + break; + } + nIndex_InitialPositionSearchingToPast = nIndex_NearestChip_Future; + } + } + if (chip.bHit && chip.b可視) // 2015.11.5 kairera0467 連打対策 { - //sw2.Stop(); - return null; + if (NotesManager.IsGenericRoll(chip) && !NotesManager.IsRollEnd(chip)) { + if (chip.nノーツ終了時刻ms > nTime) { + nIndex_InitialPositionSearchingToPast = nIndex_NearestChip_Future; + break; + } + } + } + // nIndex_NearestChip_Future++; + } + + + int nIndex_NearestChip_Past = nIndex_InitialPositionSearchingToPast; + // while ( nIndex_NearestChip_Past >= 0 ) // 過去方向への検索 + for (; nIndex_NearestChip_Past >= 0; nIndex_NearestChip_Past--) { + CDTX.CChip chip = listChip[nPlayer][nIndex_NearestChip_Past]; + //if ( (!chip.bHit && chip.b可視 ) && ( ( 0x93 <= chip.nチャンネル番号 ) && ( chip.nチャンネル番号 <= 0x99 ) ) ) + + if ((!chip.bHit && chip.b可視) && NotesManager.IsHittableNote(chip) && !NotesManager.IsRollEnd(chip)) { + break; + } + //2015.11.5 kairera0467 連打対策 + else if ((chip.b可視) && NotesManager.IsGenericRoll(chip) && !NotesManager.IsRollEnd(chip)) { + break; } - int nIndex_NearestChip_Future = nIndex_InitialPositionSearchingToPast = this.n現在のトップChip; - if (this.n現在のトップChip >= count) // その時点で演奏すべきチップが既に全部無くなっていたら - { - nIndex_NearestChip_Future = nIndex_InitialPositionSearchingToPast = count - 1; + // nIndex_NearestChip_Past--; + } + if ((nIndex_NearestChip_Future >= count) && (nIndex_NearestChip_Past < 0)) // 検索対象が過去未来どちらにも見つからなかった場合 + { + //sw2.Stop(); + return null; + } + CDTX.CChip nearestChip; // = null; // 以下のifブロックのいずれかで必ずnearestChipには非nullが代入されるので、null初期化を削除 + if (nIndex_NearestChip_Future >= count) // 検索対象が未来方向には見つからなかった(しかし過去方向には見つかった)場合 + { + nearestChip = listChip[nPlayer][nIndex_NearestChip_Past]; + // nTimeDiff = Math.Abs( (int) ( nTime - nearestChip.n発声時刻ms ) ); + } else if (nIndex_NearestChip_Past < 0) // 検索対象が過去方向には見つからなかった(しかし未来方向には見つかった)場合 + { + nearestChip = listChip[nPlayer][nIndex_NearestChip_Future]; + // nTimeDiff = Math.Abs( (int) ( nTime - nearestChip.n発声時刻ms ) ); + } else { + int nTimeDiff_Future = Math.Abs((int)(nTime - listChip[nPlayer][nIndex_NearestChip_Future].n発声時刻ms)); + int nTimeDiff_Past = Math.Abs((int)(nTime - listChip[nPlayer][nIndex_NearestChip_Past].n発声時刻ms)); + + if (nTimeDiff_Future < nTimeDiff_Past) { + if (!listChip[nPlayer][nIndex_NearestChip_Past].bHit + && listChip[nPlayer][nIndex_NearestChip_Past].n発声時刻ms + 108 >= nTime + && NotesManager.IsMissableNote(listChip[nPlayer][nIndex_NearestChip_Past]) + ) { + nearestChip = listChip[nPlayer][nIndex_NearestChip_Past]; + } else + nearestChip = listChip[nPlayer][nIndex_NearestChip_Future]; + + // nTimeDiff = Math.Abs( (int) ( nTime - nearestChip.n発声時刻ms ) ); + } else { + nearestChip = listChip[nPlayer][nIndex_NearestChip_Past]; + // nTimeDiff = Math.Abs( (int) ( nTime - nearestChip.n発声時刻ms ) ); } + var __tmpchp = listChip[nPlayer][nIndex_NearestChip_Future]; - // int nIndex_NearestChip_Future = nIndex_InitialPositionSearchingToFuture; - // while ( nIndex_NearestChip_Future < count ) // 未来方向への検索 - for (; nIndex_NearestChip_Future < count; nIndex_NearestChip_Future++) { + //2015.11.5 kairera0467 連打音符の判定 + if (NotesManager.IsGenericRoll(__tmpchp) && !NotesManager.IsRollEnd(__tmpchp)) { + if (listChip[nPlayer][nIndex_NearestChip_Future].n発声時刻ms <= nTime && listChip[nPlayer][nIndex_NearestChip_Future].nノーツ終了時刻ms >= nTime) { + nearestChip = listChip[nPlayer][nIndex_NearestChip_Future]; + } + } + } + nTimeDiff = Math.Abs((int)(nTime - nearestChip.n発声時刻ms)); + int n検索範囲時間ms = 0; + if ((n検索範囲時間ms > 0) && (nTimeDiff > n検索範囲時間ms)) // チップは見つかったが、検索範囲時間外だった場合 + { + //sw2.Stop(); + return null; + } + //sw2.Stop(); + return nearestChip; + } - if (nIndex_NearestChip_Future < 0) + /// + /// 最も判定枠に近いドンカツを返します。 + /// + /// 判定時の時間。 + /// プレイヤー。 + /// ドンかどうか。 + /// 最も判定枠に近いノーツ。 + /* + protected CDTX.CChip GetChipOfNearest(long nowTime, int player, bool don) + { + var nearestChip = new CDTX.CChip(); + var count = listChip[player].Count; + var chips = listChip[player]; + var startPosision = NowProcessingChip[player]; + CDTX.CChip pastChip; // 判定されるべき過去ノート + CDTX.CChip futureChip; // 判定されるべき未来ノート + var pastJudge = E判定.Miss; + var futureJudge = E判定.Miss; + + bool GetDon(CDTX.CChip note) + { + return note.nチャンネル番号 == 0x11 || note.nチャンネル番号 == 0x13 || note.nチャンネル番号 == 0x1A || note.nチャンネル番号 == 0x1F; + } + bool GetKatsu(CDTX.CChip note) + { + return note.nチャンネル番号 == 0x12 || note.nチャンネル番号 == 0x14 || note.nチャンネル番号 == 0x1B || note.nチャンネル番号 == 0x1F; + } + + if (count <= 0) + { + return null; + } + + if (startPosision >= count) + { + startPosision -= 1; + } + + #region 過去のノーツで、かつ可判定以上のノーツの決定 + CDTX.CChip afterChip = null; + for (int pastNote = startPosision - 1; ; pastNote--) + { + if (pastNote < 0) + { + pastChip = afterChip != null ? afterChip : null; // afterChipに過去の判定があるかもしれないので + break; + } + var processingChip = chips[pastNote]; + if (!processingChip.IsHitted && processingChip.nコース == n現在のコース[player]) // まだ判定されてない音符 + { + if (don ? GetDon(processingChip) : GetKatsu(processingChip)) // 音符のチャンネルである + { + var thisChipJudge = pastJudge = e指定時刻からChipのJUDGEを返すImpl(nowTime, processingChip, player); + if (thisChipJudge != E判定.Miss) + { + // 判定が見過ごし不可ではない(=たたいて不可以上) + // その前のノートがもしかしたら存在して、可以上の判定かもしれないからまだ処理を続行する。 + afterChip = processingChip; + continue; + } + else + { + // 判定が不可だった + // その前のノーツを過去で可以上のノート(つまり判定されるべきノート)とする。 + pastChip = afterChip; + break; // 検索終わり + } + } + } + if (processingChip.IsHitted && processingChip.nコース == n現在のコース[player]) // 連打 + { + if ((0x15 <= processingChip.nチャンネル番号) && (processingChip.nチャンネル番号 <= 0x17)) + { + if (processingChip.nノーツ終了時刻ms > nowTime) + { + pastChip = processingChip; + break; + } + } + } + } + #endregion + + #region 未来のノーツで、かつ可判定以上のノーツの決定 + for (int futureNote = startPosision; ; futureNote++) + { + if (futureNote >= count) + { + futureChip = null; + break; + } + var processingChip = chips[futureNote]; + if (!processingChip.IsHitted && processingChip.nコース == n現在のコース[player]) // まだ判定されてない音符 + { + if (don ? GetDon(processingChip) : GetKatsu(processingChip)) // 音符のチャンネルである + { + var thisChipJudge = futureJudge = e指定時刻からChipのJUDGEを返すImpl(nowTime, processingChip, player); + if (thisChipJudge != E判定.Miss) + { + // 判定が見過ごし不可ではない(=たたいて不可以上) + // そのノートを処理すべきなので、検索終わり。 + futureChip = processingChip; + break; // 検索終わり + } + else + { + // 判定が不可だった + // つまり未来に処理すべきノートはないので、検索終わり。 + futureChip = null; // 今処理中のノート + break; // 検索終わり + } + } + } + } + #endregion + + #region 過去のノーツが見つかったらそれを返却、そうでなければ未来のノーツを返却 + if ((pastJudge == E判定.Miss || pastJudge == E判定.Poor) && (futureJudge != E判定.Miss && futureJudge != E判定.Poor)) + { + // 過去の判定が不可で、未来の判定が可以上なら未来を返却。 + nearestChip = futureChip; + } + else if (futureChip == null && pastChip != null) + { + // 未来に処理するべきノートがなかったので、過去の処理すべきノートを返す。 + nearestChip = pastChip; + } + else if (pastChip == null && futureChip != null) + { + // 過去の検索が該当なしだったので、未来のノートを返す。 + nearestChip = futureChip; + } + else + { + // 基本的には過去のノートを返す。 + nearestChip = pastChip; + } + #endregion + + return nearestChip; + } + */ + + + protected CDTX.CChip r指定時刻に一番近い未ヒットChip(long nTime, int nChannel, int nInputAdjustTime, int n検索範囲時間ms, int nPlayer) { + //sw2.Start(); + //Trace.TraceInformation( "nTime={0}, nChannel={1:x2}, 現在のTop={2}", nTime, nChannel,CDTXMania.DTX.listChip[ this.n現在のトップChip ].n発声時刻ms ); + nTime += nInputAdjustTime; + + int nIndex_InitialPositionSearchingToPast; + int nTimeDiff; + if (this.n現在のトップChip == -1) // 演奏データとして1個もチップがない場合は + { + //sw2.Stop(); + return null; + } + int count = listChip[nPlayer].Count; + int nIndex_NearestChip_Future = nIndex_InitialPositionSearchingToPast = this.n現在のトップChip; + if (this.n現在のトップChip >= count) // その時点で演奏すべきチップが既に全部無くなっていたら + { + nIndex_NearestChip_Future = nIndex_InitialPositionSearchingToPast = count - 1; + } + // int nIndex_NearestChip_Future = nIndex_InitialPositionSearchingToFuture; + // while ( nIndex_NearestChip_Future < count ) // 未来方向への検索 + for (; nIndex_NearestChip_Future < count; nIndex_NearestChip_Future++) { + CDTX.CChip chip = listChip[nPlayer][nIndex_NearestChip_Future]; + if (!chip.bHit) { + if ((0x11 <= nChannel) && (nChannel <= 0x1F)) { + if ((chip.nチャンネル番号 == nChannel) || (chip.nチャンネル番号 == (nChannel + 0x20))) { + if (chip.n発声時刻ms > nTime) { + break; + } + nIndex_InitialPositionSearchingToPast = nIndex_NearestChip_Future; + } continue; + } - - CDTX.CChip chip = listChip[nPlayer][nIndex_NearestChip_Future]; - if (!chip.bHit && chip.b可視) { - if (NotesManager.IsHittableNote(chip)) { + //if ( ( ( 0xDE <= nChannel ) && ( nChannel <= 0xDF ) ) ) + if (((0xDF == nChannel))) { + if (chip.nチャンネル番号 == nChannel) { if (chip.n発声時刻ms > nTime) { break; } nIndex_InitialPositionSearchingToPast = nIndex_NearestChip_Future; } } - if (chip.bHit && chip.b可視) // 2015.11.5 kairera0467 連打対策 - { - if (NotesManager.IsGenericRoll(chip) && !NotesManager.IsRollEnd(chip)) { - if (chip.nノーツ終了時刻ms > nTime) { - nIndex_InitialPositionSearchingToPast = nIndex_NearestChip_Future; + + if (((0x50 == nChannel))) { + if (chip.nチャンネル番号 == nChannel) { + if (chip.n発声時刻ms > nTime) { break; } + nIndex_InitialPositionSearchingToPast = nIndex_NearestChip_Future; } } - // nIndex_NearestChip_Future++; + } - - - int nIndex_NearestChip_Past = nIndex_InitialPositionSearchingToPast; - // while ( nIndex_NearestChip_Past >= 0 ) // 過去方向への検索 - for (; nIndex_NearestChip_Past >= 0; nIndex_NearestChip_Past--) { - CDTX.CChip chip = listChip[nPlayer][nIndex_NearestChip_Past]; - //if ( (!chip.bHit && chip.b可視 ) && ( ( 0x93 <= chip.nチャンネル番号 ) && ( chip.nチャンネル番号 <= 0x99 ) ) ) - - if ((!chip.bHit && chip.b可視) && NotesManager.IsHittableNote(chip) && !NotesManager.IsRollEnd(chip)) { - break; - } - //2015.11.5 kairera0467 連打対策 - else if ((chip.b可視) && NotesManager.IsGenericRoll(chip) && !NotesManager.IsRollEnd(chip)) { - break; - } - - // nIndex_NearestChip_Past--; - } - if ((nIndex_NearestChip_Future >= count) && (nIndex_NearestChip_Past < 0)) // 検索対象が過去未来どちらにも見つからなかった場合 - { - //sw2.Stop(); - return null; - } - CDTX.CChip nearestChip; // = null; // 以下のifブロックのいずれかで必ずnearestChipには非nullが代入されるので、null初期化を削除 - if (nIndex_NearestChip_Future >= count) // 検索対象が未来方向には見つからなかった(しかし過去方向には見つかった)場合 - { - nearestChip = listChip[nPlayer][nIndex_NearestChip_Past]; - // nTimeDiff = Math.Abs( (int) ( nTime - nearestChip.n発声時刻ms ) ); - } else if (nIndex_NearestChip_Past < 0) // 検索対象が過去方向には見つからなかった(しかし未来方向には見つかった)場合 - { - nearestChip = listChip[nPlayer][nIndex_NearestChip_Future]; - // nTimeDiff = Math.Abs( (int) ( nTime - nearestChip.n発声時刻ms ) ); - } else { - int nTimeDiff_Future = Math.Abs((int)(nTime - listChip[nPlayer][nIndex_NearestChip_Future].n発声時刻ms)); - int nTimeDiff_Past = Math.Abs((int)(nTime - listChip[nPlayer][nIndex_NearestChip_Past].n発声時刻ms)); - - if (nTimeDiff_Future < nTimeDiff_Past) { - if (!listChip[nPlayer][nIndex_NearestChip_Past].bHit - && listChip[nPlayer][nIndex_NearestChip_Past].n発声時刻ms + 108 >= nTime - && NotesManager.IsMissableNote(listChip[nPlayer][nIndex_NearestChip_Past]) - ) { - nearestChip = listChip[nPlayer][nIndex_NearestChip_Past]; - } else - nearestChip = listChip[nPlayer][nIndex_NearestChip_Future]; - - // nTimeDiff = Math.Abs( (int) ( nTime - nearestChip.n発声時刻ms ) ); - } else { - nearestChip = listChip[nPlayer][nIndex_NearestChip_Past]; - // nTimeDiff = Math.Abs( (int) ( nTime - nearestChip.n発声時刻ms ) ); - } - - var __tmpchp = listChip[nPlayer][nIndex_NearestChip_Future]; - - //2015.11.5 kairera0467 連打音符の判定 - if (NotesManager.IsGenericRoll(__tmpchp) && !NotesManager.IsRollEnd(__tmpchp)) { - if (listChip[nPlayer][nIndex_NearestChip_Future].n発声時刻ms <= nTime && listChip[nPlayer][nIndex_NearestChip_Future].nノーツ終了時刻ms >= nTime) { - nearestChip = listChip[nPlayer][nIndex_NearestChip_Future]; - } - } - } - nTimeDiff = Math.Abs((int)(nTime - nearestChip.n発声時刻ms)); - int n検索範囲時間ms = 0; - if ((n検索範囲時間ms > 0) && (nTimeDiff > n検索範囲時間ms)) // チップは見つかったが、検索範囲時間外だった場合 - { - //sw2.Stop(); - return null; - } - //sw2.Stop(); - return nearestChip; + // nIndex_NearestChip_Future++; } - /// - /// 最も判定枠に近いドンカツを返します。 - /// - /// 判定時の時間。 - /// プレイヤー。 - /// ドンかどうか。 - /// 最も判定枠に近いノーツ。 - /* - protected CDTX.CChip GetChipOfNearest(long nowTime, int player, bool don) - { - var nearestChip = new CDTX.CChip(); - var count = listChip[player].Count; - var chips = listChip[player]; - var startPosision = NowProcessingChip[player]; - CDTX.CChip pastChip; // 判定されるべき過去ノート - CDTX.CChip futureChip; // 判定されるべき未来ノート - var pastJudge = E判定.Miss; - var futureJudge = E判定.Miss; + // Channel is always 50, following code is unreachable - bool GetDon(CDTX.CChip note) - { - return note.nチャンネル番号 == 0x11 || note.nチャンネル番号 == 0x13 || note.nチャンネル番号 == 0x1A || note.nチャンネル番号 == 0x1F; - } - bool GetKatsu(CDTX.CChip note) - { - return note.nチャンネル番号 == 0x12 || note.nチャンネル番号 == 0x14 || note.nチャンネル番号 == 0x1B || note.nチャンネル番号 == 0x1F; - } - - if (count <= 0) - { - return null; - } - - if (startPosision >= count) - { - startPosision -= 1; - } - - #region 過去のノーツで、かつ可判定以上のノーツの決定 - CDTX.CChip afterChip = null; - for (int pastNote = startPosision - 1; ; pastNote--) - { - if (pastNote < 0) - { - pastChip = afterChip != null ? afterChip : null; // afterChipに過去の判定があるかもしれないので - break; - } - var processingChip = chips[pastNote]; - if (!processingChip.IsHitted && processingChip.nコース == n現在のコース[player]) // まだ判定されてない音符 - { - if (don ? GetDon(processingChip) : GetKatsu(processingChip)) // 音符のチャンネルである - { - var thisChipJudge = pastJudge = e指定時刻からChipのJUDGEを返すImpl(nowTime, processingChip, player); - if (thisChipJudge != E判定.Miss) - { - // 判定が見過ごし不可ではない(=たたいて不可以上) - // その前のノートがもしかしたら存在して、可以上の判定かもしれないからまだ処理を続行する。 - afterChip = processingChip; - continue; - } - else - { - // 判定が不可だった - // その前のノーツを過去で可以上のノート(つまり判定されるべきノート)とする。 - pastChip = afterChip; - break; // 検索終わり - } - } - } - if (processingChip.IsHitted && processingChip.nコース == n現在のコース[player]) // 連打 - { - if ((0x15 <= processingChip.nチャンネル番号) && (processingChip.nチャンネル番号 <= 0x17)) - { - if (processingChip.nノーツ終了時刻ms > nowTime) - { - pastChip = processingChip; - break; - } - } - } - } - #endregion - - #region 未来のノーツで、かつ可判定以上のノーツの決定 - for (int futureNote = startPosision; ; futureNote++) - { - if (futureNote >= count) - { - futureChip = null; - break; - } - var processingChip = chips[futureNote]; - if (!processingChip.IsHitted && processingChip.nコース == n現在のコース[player]) // まだ判定されてない音符 - { - if (don ? GetDon(processingChip) : GetKatsu(processingChip)) // 音符のチャンネルである - { - var thisChipJudge = futureJudge = e指定時刻からChipのJUDGEを返すImpl(nowTime, processingChip, player); - if (thisChipJudge != E判定.Miss) - { - // 判定が見過ごし不可ではない(=たたいて不可以上) - // そのノートを処理すべきなので、検索終わり。 - futureChip = processingChip; - break; // 検索終わり - } - else - { - // 判定が不可だった - // つまり未来に処理すべきノートはないので、検索終わり。 - futureChip = null; // 今処理中のノート - break; // 検索終わり - } - } - } - } - #endregion - - #region 過去のノーツが見つかったらそれを返却、そうでなければ未来のノーツを返却 - if ((pastJudge == E判定.Miss || pastJudge == E判定.Poor) && (futureJudge != E判定.Miss && futureJudge != E判定.Poor)) - { - // 過去の判定が不可で、未来の判定が可以上なら未来を返却。 - nearestChip = futureChip; - } - else if (futureChip == null && pastChip != null) - { - // 未来に処理するべきノートがなかったので、過去の処理すべきノートを返す。 - nearestChip = pastChip; - } - else if (pastChip == null && futureChip != null) - { - // 過去の検索が該当なしだったので、未来のノートを返す。 - nearestChip = futureChip; - } - else - { - // 基本的には過去のノートを返す。 - nearestChip = pastChip; - } - #endregion - - return nearestChip; - } - */ - - - protected CDTX.CChip r指定時刻に一番近い未ヒットChip(long nTime, int nChannel, int nInputAdjustTime, int n検索範囲時間ms, int nPlayer) { - //sw2.Start(); - //Trace.TraceInformation( "nTime={0}, nChannel={1:x2}, 現在のTop={2}", nTime, nChannel,CDTXMania.DTX.listChip[ this.n現在のトップChip ].n発声時刻ms ); - nTime += nInputAdjustTime; - - int nIndex_InitialPositionSearchingToPast; - int nTimeDiff; - if (this.n現在のトップChip == -1) // 演奏データとして1個もチップがない場合は - { - //sw2.Stop(); - return null; + int nIndex_NearestChip_Past = nIndex_InitialPositionSearchingToPast; + // while ( nIndex_NearestChip_Past >= 0 ) // 過去方向への検索 + for (; nIndex_NearestChip_Past >= 0; nIndex_NearestChip_Past--) { + CDTX.CChip chip = listChip[nPlayer][nIndex_NearestChip_Past]; + if ((!chip.bHit) && + ( + ( + ((((nChannel >= 0x11) && (nChannel <= 0x14)) || nChannel == 0x1A || nChannel == 0x1B || nChannel == 0x1F) && (chip.nチャンネル番号 == nChannel)) + ) + || + ( + // ( ( ( nChannel >= 0xDE ) && ( nChannel <= 0xDF ) ) && ( chip.nチャンネル番号 == nChannel ) ) + (((nChannel == 0xDF)) && (chip.nチャンネル番号 == nChannel)) + ) + || + ( + // ( ( ( nChannel >= 0xDE ) && ( nChannel <= 0xDF ) ) && ( chip.nチャンネル番号 == nChannel ) ) + (((nChannel == 0x50)) && (chip.nチャンネル番号 == nChannel)) + ) + ) + ) { + break; } - int count = listChip[nPlayer].Count; - int nIndex_NearestChip_Future = nIndex_InitialPositionSearchingToPast = this.n現在のトップChip; - if (this.n現在のトップChip >= count) // その時点で演奏すべきチップが既に全部無くなっていたら - { - nIndex_NearestChip_Future = nIndex_InitialPositionSearchingToPast = count - 1; - } - // int nIndex_NearestChip_Future = nIndex_InitialPositionSearchingToFuture; - // while ( nIndex_NearestChip_Future < count ) // 未来方向への検索 - for (; nIndex_NearestChip_Future < count; nIndex_NearestChip_Future++) { - CDTX.CChip chip = listChip[nPlayer][nIndex_NearestChip_Future]; - if (!chip.bHit) { - if ((0x11 <= nChannel) && (nChannel <= 0x1F)) { - if ((chip.nチャンネル番号 == nChannel) || (chip.nチャンネル番号 == (nChannel + 0x20))) { - if (chip.n発声時刻ms > nTime) { - break; - } - nIndex_InitialPositionSearchingToPast = nIndex_NearestChip_Future; - } - continue; - } - - //if ( ( ( 0xDE <= nChannel ) && ( nChannel <= 0xDF ) ) ) - if (((0xDF == nChannel))) { - if (chip.nチャンネル番号 == nChannel) { - if (chip.n発声時刻ms > nTime) { - break; - } - nIndex_InitialPositionSearchingToPast = nIndex_NearestChip_Future; - } - } - - if (((0x50 == nChannel))) { - if (chip.nチャンネル番号 == nChannel) { - if (chip.n発声時刻ms > nTime) { - break; - } - nIndex_InitialPositionSearchingToPast = nIndex_NearestChip_Future; - } - } - - } - // nIndex_NearestChip_Future++; - } - - // Channel is always 50, following code is unreachable - - int nIndex_NearestChip_Past = nIndex_InitialPositionSearchingToPast; - // while ( nIndex_NearestChip_Past >= 0 ) // 過去方向への検索 - for (; nIndex_NearestChip_Past >= 0; nIndex_NearestChip_Past--) { - CDTX.CChip chip = listChip[nPlayer][nIndex_NearestChip_Past]; - if ((!chip.bHit) && - ( - ( - ((((nChannel >= 0x11) && (nChannel <= 0x14)) || nChannel == 0x1A || nChannel == 0x1B || nChannel == 0x1F) && (chip.nチャンネル番号 == nChannel)) - ) - || - ( - // ( ( ( nChannel >= 0xDE ) && ( nChannel <= 0xDF ) ) && ( chip.nチャンネル番号 == nChannel ) ) - (((nChannel == 0xDF)) && (chip.nチャンネル番号 == nChannel)) - ) - || - ( - // ( ( ( nChannel >= 0xDE ) && ( nChannel <= 0xDF ) ) && ( chip.nチャンネル番号 == nChannel ) ) - (((nChannel == 0x50)) && (chip.nチャンネル番号 == nChannel)) - ) - ) - ) { - break; - } - // nIndex_NearestChip_Past--; - } - if ((nIndex_NearestChip_Future >= count) && (nIndex_NearestChip_Past < 0)) // 検索対象が過去未来どちらにも見つからなかった場合 - { - //sw2.Stop(); - return null; - } - CDTX.CChip nearestChip; // = null; // 以下のifブロックのいずれかで必ずnearestChipには非nullが代入されるので、null初期化を削除 - if (nIndex_NearestChip_Future >= count) // 検索対象が未来方向には見つからなかった(しかし過去方向には見つかった)場合 - { - nearestChip = listChip[nPlayer][nIndex_NearestChip_Past]; - // nTimeDiff = Math.Abs( (int) ( nTime - nearestChip.n発声時刻ms ) ); - } else if (nIndex_NearestChip_Past < 0) // 検索対象が過去方向には見つからなかった(しかし未来方向には見つかった)場合 - { - nearestChip = listChip[nPlayer][nIndex_NearestChip_Future]; - // nTimeDiff = Math.Abs( (int) ( nTime - nearestChip.n発声時刻ms ) ); - } else { - int nTimeDiff_Future = Math.Abs((int)(nTime - listChip[nPlayer][nIndex_NearestChip_Future].n発声時刻ms)); - int nTimeDiff_Past = Math.Abs((int)(nTime - listChip[nPlayer][nIndex_NearestChip_Past].n発声時刻ms)); - - if (nChannel == 0xDF) //0xDFの場合は過去方向への検索をしない - { - return listChip[nPlayer][nIndex_NearestChip_Future]; - } - - if (nTimeDiff_Future < nTimeDiff_Past) { - nearestChip = listChip[nPlayer][nIndex_NearestChip_Future]; - // nTimeDiff = Math.Abs( (int) ( nTime - nearestChip.n発声時刻ms ) ); - } else { - nearestChip = listChip[nPlayer][nIndex_NearestChip_Past]; - // nTimeDiff = Math.Abs( (int) ( nTime - nearestChip.n発声時刻ms ) ); - } - } - nTimeDiff = Math.Abs((int)(nTime - nearestChip.n発声時刻ms)); - if ((n検索範囲時間ms > 0) && (nTimeDiff > n検索範囲時間ms)) // チップは見つかったが、検索範囲時間外だった場合 - { - //sw2.Stop(); - return null; - } - //sw2.Stop(); - return nearestChip; + // nIndex_NearestChip_Past--; } - public bool r検索範囲内にチップがあるか調べる(long nTime, int nInputAdjustTime, int n検索範囲時間ms, int nPlayer) { - nTime += nInputAdjustTime; - - for (int i = 0; i < listChip[nPlayer].Count; i++) { - CDTX.CChip chip = listChip[nPlayer][i]; - if (!chip.bHit) { - if (NotesManager.IsMissableNote(chip)) { - if (chip.n発声時刻ms < nTime + n検索範囲時間ms) { - if (chip.nコース == this.n現在のコース[nPlayer]) //2016.06.14 kairera0467 譜面分岐も考慮するようにしてみる。 - return true; - } - } - } - } - - return false; - } - - protected void ChangeInputAdjustTimeInPlaying(IInputDevice keyboard, int plusminus) // #23580 2011.1.16 yyagi UI for InputAdjustTime in playing screen. + if ((nIndex_NearestChip_Future >= count) && (nIndex_NearestChip_Past < 0)) // 検索対象が過去未来どちらにも見つからなかった場合 { - int offset; - if (keyboard.KeyPressing((int)SlimDXKeys.Key.LeftControl) || - keyboard.KeyPressing((int)SlimDXKeys.Key.RightControl)) { - offset = plusminus; - } else { - offset = plusminus * 10; + //sw2.Stop(); + return null; + } + CDTX.CChip nearestChip; // = null; // 以下のifブロックのいずれかで必ずnearestChipには非nullが代入されるので、null初期化を削除 + if (nIndex_NearestChip_Future >= count) // 検索対象が未来方向には見つからなかった(しかし過去方向には見つかった)場合 + { + nearestChip = listChip[nPlayer][nIndex_NearestChip_Past]; + // nTimeDiff = Math.Abs( (int) ( nTime - nearestChip.n発声時刻ms ) ); + } else if (nIndex_NearestChip_Past < 0) // 検索対象が過去方向には見つからなかった(しかし未来方向には見つかった)場合 + { + nearestChip = listChip[nPlayer][nIndex_NearestChip_Future]; + // nTimeDiff = Math.Abs( (int) ( nTime - nearestChip.n発声時刻ms ) ); + } else { + int nTimeDiff_Future = Math.Abs((int)(nTime - listChip[nPlayer][nIndex_NearestChip_Future].n発声時刻ms)); + int nTimeDiff_Past = Math.Abs((int)(nTime - listChip[nPlayer][nIndex_NearestChip_Past].n発声時刻ms)); + + if (nChannel == 0xDF) //0xDFの場合は過去方向への検索をしない + { + return listChip[nPlayer][nIndex_NearestChip_Future]; } - var newInputAdjustTimeMs = (OpenTaiko.ConfigIni.nInputAdjustTimeMs + offset).Clamp(-99, 99); - OpenTaiko.ConfigIni.nInputAdjustTimeMs = newInputAdjustTimeMs; + if (nTimeDiff_Future < nTimeDiff_Past) { + nearestChip = listChip[nPlayer][nIndex_NearestChip_Future]; + // nTimeDiff = Math.Abs( (int) ( nTime - nearestChip.n発声時刻ms ) ); + } else { + nearestChip = listChip[nPlayer][nIndex_NearestChip_Past]; + // nTimeDiff = Math.Abs( (int) ( nTime - nearestChip.n発声時刻ms ) ); + } + } + nTimeDiff = Math.Abs((int)(nTime - nearestChip.n発声時刻ms)); + if ((n検索範囲時間ms > 0) && (nTimeDiff > n検索範囲時間ms)) // チップは見つかったが、検索範囲時間外だった場合 + { + //sw2.Stop(); + return null; + } + //sw2.Stop(); + return nearestChip; + } + public bool r検索範囲内にチップがあるか調べる(long nTime, int nInputAdjustTime, int n検索範囲時間ms, int nPlayer) { + nTime += nInputAdjustTime; + + for (int i = 0; i < listChip[nPlayer].Count; i++) { + CDTX.CChip chip = listChip[nPlayer][i]; + if (!chip.bHit) { + if (NotesManager.IsMissableNote(chip)) { + if (chip.n発声時刻ms < nTime + n検索範囲時間ms) { + if (chip.nコース == this.n現在のコース[nPlayer]) //2016.06.14 kairera0467 譜面分岐も考慮するようにしてみる。 + return true; + } + } + } } - protected abstract void t入力処理_ドラム(); - protected abstract void ドラムスクロール速度アップ(); - protected abstract void ドラムスクロール速度ダウン(); - protected void tキー入力() { - // Inputs + return false; + } - IInputDevice keyboard = OpenTaiko.InputManager.Keyboard; + protected void ChangeInputAdjustTimeInPlaying(IInputDevice keyboard, int plusminus) // #23580 2011.1.16 yyagi UI for InputAdjustTime in playing screen. + { + int offset; + if (keyboard.KeyPressing((int)SlimDXKeys.Key.LeftControl) || + keyboard.KeyPressing((int)SlimDXKeys.Key.RightControl)) { + offset = plusminus; + } else { + offset = plusminus * 10; + } - if ((!this.bPAUSE && (base.ePhaseID != CStage.EPhase.Game_STAGE_FAILED)) && (base.ePhaseID != CStage.EPhase.Game_STAGE_FAILED_FadeOut)) { - this.t入力処理_ドラム(); + var newInputAdjustTimeMs = (OpenTaiko.ConfigIni.nInputAdjustTimeMs + offset).Clamp(-99, 99); + OpenTaiko.ConfigIni.nInputAdjustTimeMs = newInputAdjustTimeMs; + } + + protected abstract void t入力処理_ドラム(); + protected abstract void ドラムスクロール速度アップ(); + protected abstract void ドラムスクロール速度ダウン(); + protected void tキー入力() { + // Inputs + + IInputDevice keyboard = OpenTaiko.InputManager.Keyboard; + + if ((!this.bPAUSE && (base.ePhaseID != CStage.EPhase.Game_STAGE_FAILED)) && (base.ePhaseID != CStage.EPhase.Game_STAGE_FAILED_FadeOut)) { + this.t入力処理_ドラム(); - // Individual offset - if (keyboard.KeyPressed((int)SlimDXKeys.Key.UpArrow) && (keyboard.KeyPressing((int)SlimDXKeys.Key.RightShift) || keyboard.KeyPressing((int)SlimDXKeys.Key.LeftShift))) { // shift (+ctrl) + UpArrow (BGMAdjust) - OpenTaiko.DTX.t各自動再生音チップの再生時刻を変更する((keyboard.KeyPressing((int)SlimDXKeys.Key.LeftControl) || keyboard.KeyPressing((int)SlimDXKeys.Key.RightControl)) ? 1 : 10); - OpenTaiko.DTX.tWave再生位置自動補正(); - } else if (keyboard.KeyPressed((int)SlimDXKeys.Key.DownArrow) && (keyboard.KeyPressing((int)SlimDXKeys.Key.RightShift) || keyboard.KeyPressing((int)SlimDXKeys.Key.LeftShift))) { // shift + DownArrow (BGMAdjust) - OpenTaiko.DTX.t各自動再生音チップの再生時刻を変更する((keyboard.KeyPressing((int)SlimDXKeys.Key.LeftControl) || keyboard.KeyPressing((int)SlimDXKeys.Key.RightControl)) ? -1 : -10); - OpenTaiko.DTX.tWave再生位置自動補正(); - } - // Tokkun only - else if (OpenTaiko.ConfigIni.bTokkunMode && - OpenTaiko.ConfigIni.KeyAssign.KeyIsPressed(OpenTaiko.ConfigIni.KeyAssign.Drums.TrainingIncreaseScrollSpeed)) { // UpArrow(scrollspeed up) - ドラムスクロール速度アップ(); - } else if (OpenTaiko.ConfigIni.bTokkunMode && - OpenTaiko.ConfigIni.KeyAssign.KeyIsPressed(OpenTaiko.ConfigIni.KeyAssign.Drums.TrainingDecreaseScrollSpeed)) { // DownArrow (scrollspeed down) - ドラムスクロール速度ダウン(); - } - // Debug mode - else if (OpenTaiko.ConfigIni.KeyAssign.KeyIsPressed(OpenTaiko.ConfigIni.KeyAssign.System.DisplayDebug)) { // del (debug info) - OpenTaiko.ConfigIni.bDisplayDebugInfo = !OpenTaiko.ConfigIni.bDisplayDebugInfo; + // Individual offset + if (keyboard.KeyPressed((int)SlimDXKeys.Key.UpArrow) && (keyboard.KeyPressing((int)SlimDXKeys.Key.RightShift) || keyboard.KeyPressing((int)SlimDXKeys.Key.LeftShift))) { // shift (+ctrl) + UpArrow (BGMAdjust) + OpenTaiko.DTX.t各自動再生音チップの再生時刻を変更する((keyboard.KeyPressing((int)SlimDXKeys.Key.LeftControl) || keyboard.KeyPressing((int)SlimDXKeys.Key.RightControl)) ? 1 : 10); + OpenTaiko.DTX.tWave再生位置自動補正(); + } else if (keyboard.KeyPressed((int)SlimDXKeys.Key.DownArrow) && (keyboard.KeyPressing((int)SlimDXKeys.Key.RightShift) || keyboard.KeyPressing((int)SlimDXKeys.Key.LeftShift))) { // shift + DownArrow (BGMAdjust) + OpenTaiko.DTX.t各自動再生音チップの再生時刻を変更する((keyboard.KeyPressing((int)SlimDXKeys.Key.LeftControl) || keyboard.KeyPressing((int)SlimDXKeys.Key.RightControl)) ? -1 : -10); + OpenTaiko.DTX.tWave再生位置自動補正(); + } + // Tokkun only + else if (OpenTaiko.ConfigIni.bTokkunMode && + OpenTaiko.ConfigIni.KeyAssign.KeyIsPressed(OpenTaiko.ConfigIni.KeyAssign.Drums.TrainingIncreaseScrollSpeed)) { // UpArrow(scrollspeed up) + ドラムスクロール速度アップ(); + } else if (OpenTaiko.ConfigIni.bTokkunMode && + OpenTaiko.ConfigIni.KeyAssign.KeyIsPressed(OpenTaiko.ConfigIni.KeyAssign.Drums.TrainingDecreaseScrollSpeed)) { // DownArrow (scrollspeed down) + ドラムスクロール速度ダウン(); + } + // Debug mode + else if (OpenTaiko.ConfigIni.KeyAssign.KeyIsPressed(OpenTaiko.ConfigIni.KeyAssign.System.DisplayDebug)) { // del (debug info) + OpenTaiko.ConfigIni.bDisplayDebugInfo = !OpenTaiko.ConfigIni.bDisplayDebugInfo; + } + + + /* + else if ( keyboard.bキーが押された( (int)SlimDXKeys.Key.LeftArrow ) ) // #24243 2011.1.16 yyagi UI for InputAdjustTime in playing screen. + { + ChangeInputAdjustTimeInPlaying( keyboard, -1 ); + } + else if ( keyboard.bキーが押された( (int)SlimDXKeys.Key.RightArrow ) ) // #24243 2011.1.16 yyagi UI for InputAdjustTime in playing screen. + { + ChangeInputAdjustTimeInPlaying( keyboard, +1 ); + } + */ + + else if ((base.ePhaseID == CStage.EPhase.Common_NORMAL) && (keyboard.KeyPressed((int)SlimDXKeys.Key.Escape) || OpenTaiko.Pad.bPressedGB(EPad.FT)) && !this.actPauseMenu.bIsActivePopupMenu) { // escape (exit) + if (!this.actPauseMenu.bIsActivePopupMenu && this.bPAUSE == false) { + OpenTaiko.Skin.soundChangeSFX.tPlay(); + + SoundManager.PlayTimer.Pause(); + OpenTaiko.Timer.Pause(); + OpenTaiko.DTX.t全チップの再生一時停止(); + this.actAVI.tPauseControl(); + + this.bPAUSE = true; + this.actPauseMenu.tActivatePopupMenu(0); } + // this.t演奏中止(); + } else if (OpenTaiko.ConfigIni.KeyAssign.KeyIsPressed(OpenTaiko.ConfigIni.KeyAssign.Drums.TrainingBranchNormal) && + (OpenTaiko.ConfigIni.bTokkunMode || OpenTaiko.ConfigIni.bAutoPlay[0])) { + if (!OpenTaiko.DTX.bHasBranch[OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0]]) return; + + //listBRANCHを廃止したため強制分岐の開始値を + //rc演奏用タイマ.n現在時刻msから引っ張ることに + + //判定枠に一番近いチップの情報を元に一小節分の値を計算する. 2020.04.21 akasoko26 + + var p判定枠に最も近いチップ = r指定時刻に一番近い未ヒットChipを過去方向優先で検索する((long)(SoundManager.PlayTimer.NowTime * OpenTaiko.ConfigIni.SongPlaybackSpeed), 0); + double db一小節後 = 0.0; + if (p判定枠に最も近いチップ != null) + db一小節後 = ((15000.0 / p判定枠に最も近いチップ.dbBPM * (p判定枠に最も近いチップ.fNow_Measure_s / p判定枠に最も近いチップ.fNow_Measure_m)) * 16.0); + + this.t分岐処理(CDTX.ECourse.eNormal, 0, (SoundManager.PlayTimer.NowTime * OpenTaiko.ConfigIni.SongPlaybackSpeed) + db一小節後); + + OpenTaiko.stage演奏ドラム画面.actLaneTaiko.t分岐レイヤー_コース変化(OpenTaiko.stage演奏ドラム画面.actLaneTaiko.stBranch[0].nAfter, CDTX.ECourse.eNormal, 0); + OpenTaiko.stage演奏ドラム画面.actMtaiko.tBranchEvent(OpenTaiko.stage演奏ドラム画面.actMtaiko.After[0], CDTX.ECourse.eNormal, 0); + + this.n現在のコース[0] = CDTX.ECourse.eNormal; + this.n次回のコース[0] = CDTX.ECourse.eNormal; + this.nレーン用表示コース[0] = CDTX.ECourse.eNormal; - /* - else if ( keyboard.bキーが押された( (int)SlimDXKeys.Key.LeftArrow ) ) // #24243 2011.1.16 yyagi UI for InputAdjustTime in playing screen. - { - ChangeInputAdjustTimeInPlaying( keyboard, -1 ); - } - else if ( keyboard.bキーが押された( (int)SlimDXKeys.Key.RightArrow ) ) // #24243 2011.1.16 yyagi UI for InputAdjustTime in playing screen. - { - ChangeInputAdjustTimeInPlaying( keyboard, +1 ); - } - */ + this.b強制的に分岐させた[0] = true; + } else if (OpenTaiko.ConfigIni.KeyAssign.KeyIsPressed(OpenTaiko.ConfigIni.KeyAssign.Drums.TrainingBranchExpert) && + (OpenTaiko.ConfigIni.bTokkunMode || OpenTaiko.ConfigIni.bAutoPlay[0])) // #24243 2011.1.16 yyagi UI for InputAdjustTime in playing screen. + { + if (!OpenTaiko.DTX.bHasBranch[OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0]]) return; - else if ((base.ePhaseID == CStage.EPhase.Common_NORMAL) && (keyboard.KeyPressed((int)SlimDXKeys.Key.Escape) || OpenTaiko.Pad.bPressedGB(EPad.FT)) && !this.actPauseMenu.bIsActivePopupMenu) { // escape (exit) - if (!this.actPauseMenu.bIsActivePopupMenu && this.bPAUSE == false) { - OpenTaiko.Skin.soundChangeSFX.tPlay(); + //listBRANCHを廃止したため強制分岐の開始値を + //rc演奏用タイマ.n現在時刻msから引っ張ることに - SoundManager.PlayTimer.Pause(); - OpenTaiko.Timer.Pause(); - OpenTaiko.DTX.t全チップの再生一時停止(); - this.actAVI.tPauseControl(); + //判定枠に一番近いチップの情報を元に一小節分の値を計算する. 2020.04.21 akasoko26 + var p判定枠に最も近いチップ = r指定時刻に一番近い未ヒットChipを過去方向優先で検索する((long)(SoundManager.PlayTimer.NowTime * OpenTaiko.ConfigIni.SongPlaybackSpeed), 0); - this.bPAUSE = true; - this.actPauseMenu.tActivatePopupMenu(0); - } - // this.t演奏中止(); - } else if (OpenTaiko.ConfigIni.KeyAssign.KeyIsPressed(OpenTaiko.ConfigIni.KeyAssign.Drums.TrainingBranchNormal) && - (OpenTaiko.ConfigIni.bTokkunMode || OpenTaiko.ConfigIni.bAutoPlay[0])) { - if (!OpenTaiko.DTX.bHasBranch[OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0]]) return; + double db一小節後 = 0.0; + if (p判定枠に最も近いチップ != null) + db一小節後 = ((15000.0 / p判定枠に最も近いチップ.dbBPM * (p判定枠に最も近いチップ.fNow_Measure_s / p判定枠に最も近いチップ.fNow_Measure_m)) * 16.0); - //listBRANCHを廃止したため強制分岐の開始値を - //rc演奏用タイマ.n現在時刻msから引っ張ることに + this.t分岐処理(CDTX.ECourse.eExpert, 0, (SoundManager.PlayTimer.NowTime * OpenTaiko.ConfigIni.SongPlaybackSpeed) + db一小節後); - //判定枠に一番近いチップの情報を元に一小節分の値を計算する. 2020.04.21 akasoko26 - - var p判定枠に最も近いチップ = r指定時刻に一番近い未ヒットChipを過去方向優先で検索する((long)(SoundManager.PlayTimer.NowTime * OpenTaiko.ConfigIni.SongPlaybackSpeed), 0); - double db一小節後 = 0.0; - if (p判定枠に最も近いチップ != null) - db一小節後 = ((15000.0 / p判定枠に最も近いチップ.dbBPM * (p判定枠に最も近いチップ.fNow_Measure_s / p判定枠に最も近いチップ.fNow_Measure_m)) * 16.0); - - this.t分岐処理(CDTX.ECourse.eNormal, 0, (SoundManager.PlayTimer.NowTime * OpenTaiko.ConfigIni.SongPlaybackSpeed) + db一小節後); - - OpenTaiko.stage演奏ドラム画面.actLaneTaiko.t分岐レイヤー_コース変化(OpenTaiko.stage演奏ドラム画面.actLaneTaiko.stBranch[0].nAfter, CDTX.ECourse.eNormal, 0); - OpenTaiko.stage演奏ドラム画面.actMtaiko.tBranchEvent(OpenTaiko.stage演奏ドラム画面.actMtaiko.After[0], CDTX.ECourse.eNormal, 0); - - this.n現在のコース[0] = CDTX.ECourse.eNormal; - this.n次回のコース[0] = CDTX.ECourse.eNormal; - this.nレーン用表示コース[0] = CDTX.ECourse.eNormal; + OpenTaiko.stage演奏ドラム画面.actLaneTaiko.t分岐レイヤー_コース変化(OpenTaiko.stage演奏ドラム画面.actLaneTaiko.stBranch[0].nAfter, CDTX.ECourse.eExpert, 0); + OpenTaiko.stage演奏ドラム画面.actMtaiko.tBranchEvent(OpenTaiko.stage演奏ドラム画面.actMtaiko.After[0], CDTX.ECourse.eExpert, 0); - this.b強制的に分岐させた[0] = true; - } else if (OpenTaiko.ConfigIni.KeyAssign.KeyIsPressed(OpenTaiko.ConfigIni.KeyAssign.Drums.TrainingBranchExpert) && - (OpenTaiko.ConfigIni.bTokkunMode || OpenTaiko.ConfigIni.bAutoPlay[0])) // #24243 2011.1.16 yyagi UI for InputAdjustTime in playing screen. - { - if (!OpenTaiko.DTX.bHasBranch[OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0]]) return; + this.n現在のコース[0] = CDTX.ECourse.eExpert; + this.n次回のコース[0] = CDTX.ECourse.eExpert; + this.nレーン用表示コース[0] = CDTX.ECourse.eExpert; - //listBRANCHを廃止したため強制分岐の開始値を - //rc演奏用タイマ.n現在時刻msから引っ張ることに + this.b強制的に分岐させた[0] = true; + } else if (OpenTaiko.ConfigIni.KeyAssign.KeyIsPressed(OpenTaiko.ConfigIni.KeyAssign.Drums.TrainingBranchMaster) && + (OpenTaiko.ConfigIni.bTokkunMode || OpenTaiko.ConfigIni.bAutoPlay[0])) // #24243 2011.1.16 yyagi UI for InputAdjustTime in playing screen. + { + if (!OpenTaiko.DTX.bHasBranch[OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0]]) return; - //判定枠に一番近いチップの情報を元に一小節分の値を計算する. 2020.04.21 akasoko26 - var p判定枠に最も近いチップ = r指定時刻に一番近い未ヒットChipを過去方向優先で検索する((long)(SoundManager.PlayTimer.NowTime * OpenTaiko.ConfigIni.SongPlaybackSpeed), 0); + //listBRANCHを廃止したため強制分岐の開始値を + //rc演奏用タイマ.n現在時刻msから引っ張ることに - double db一小節後 = 0.0; - if (p判定枠に最も近いチップ != null) - db一小節後 = ((15000.0 / p判定枠に最も近いチップ.dbBPM * (p判定枠に最も近いチップ.fNow_Measure_s / p判定枠に最も近いチップ.fNow_Measure_m)) * 16.0); + //判定枠に一番近いチップの情報を元に一小節分の値を計算する. 2020.04.21 akasoko26 + var p判定枠に最も近いチップ = r指定時刻に一番近い未ヒットChipを過去方向優先で検索する((long)(SoundManager.PlayTimer.NowTime * OpenTaiko.ConfigIni.SongPlaybackSpeed), 0); - this.t分岐処理(CDTX.ECourse.eExpert, 0, (SoundManager.PlayTimer.NowTime * OpenTaiko.ConfigIni.SongPlaybackSpeed) + db一小節後); + double db一小節後 = 0.0; + if (p判定枠に最も近いチップ != null) + db一小節後 = ((15000.0 / p判定枠に最も近いチップ.dbBPM * (p判定枠に最も近いチップ.fNow_Measure_s / p判定枠に最も近いチップ.fNow_Measure_m)) * 16.0); - OpenTaiko.stage演奏ドラム画面.actLaneTaiko.t分岐レイヤー_コース変化(OpenTaiko.stage演奏ドラム画面.actLaneTaiko.stBranch[0].nAfter, CDTX.ECourse.eExpert, 0); - OpenTaiko.stage演奏ドラム画面.actMtaiko.tBranchEvent(OpenTaiko.stage演奏ドラム画面.actMtaiko.After[0], CDTX.ECourse.eExpert, 0); + this.t分岐処理(CDTX.ECourse.eMaster, 0, (SoundManager.PlayTimer.NowTime * OpenTaiko.ConfigIni.SongPlaybackSpeed) + db一小節後); + OpenTaiko.stage演奏ドラム画面.actLaneTaiko.t分岐レイヤー_コース変化(OpenTaiko.stage演奏ドラム画面.actLaneTaiko.stBranch[0].nAfter, CDTX.ECourse.eMaster, 0); + OpenTaiko.stage演奏ドラム画面.actMtaiko.tBranchEvent(OpenTaiko.stage演奏ドラム画面.actMtaiko.After[0], CDTX.ECourse.eMaster, 0); - this.n現在のコース[0] = CDTX.ECourse.eExpert; - this.n次回のコース[0] = CDTX.ECourse.eExpert; - this.nレーン用表示コース[0] = CDTX.ECourse.eExpert; + this.n現在のコース[0] = CDTX.ECourse.eMaster; + this.n次回のコース[0] = CDTX.ECourse.eMaster; + this.nレーン用表示コース[0] = CDTX.ECourse.eMaster; - this.b強制的に分岐させた[0] = true; - } else if (OpenTaiko.ConfigIni.KeyAssign.KeyIsPressed(OpenTaiko.ConfigIni.KeyAssign.Drums.TrainingBranchMaster) && - (OpenTaiko.ConfigIni.bTokkunMode || OpenTaiko.ConfigIni.bAutoPlay[0])) // #24243 2011.1.16 yyagi UI for InputAdjustTime in playing screen. - { - if (!OpenTaiko.DTX.bHasBranch[OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0]]) return; + this.b強制的に分岐させた[0] = true; + } - //listBRANCHを廃止したため強制分岐の開始値を - //rc演奏用タイマ.n現在時刻msから引っ張ることに + if (OpenTaiko.ConfigIni.KeyAssign.KeyIsPressed(OpenTaiko.ConfigIni.KeyAssign.System.DisplayHits)) { + if (OpenTaiko.ConfigIni.bJudgeCountDisplay == false) + OpenTaiko.ConfigIni.bJudgeCountDisplay = true; + else + OpenTaiko.ConfigIni.bJudgeCountDisplay = false; + } - //判定枠に一番近いチップの情報を元に一小節分の値を計算する. 2020.04.21 akasoko26 - var p判定枠に最も近いチップ = r指定時刻に一番近い未ヒットChipを過去方向優先で検索する((long)(SoundManager.PlayTimer.NowTime * OpenTaiko.ConfigIni.SongPlaybackSpeed), 0); - - double db一小節後 = 0.0; - if (p判定枠に最も近いチップ != null) - db一小節後 = ((15000.0 / p判定枠に最も近いチップ.dbBPM * (p判定枠に最も近いチップ.fNow_Measure_s / p判定枠に最も近いチップ.fNow_Measure_m)) * 16.0); - - this.t分岐処理(CDTX.ECourse.eMaster, 0, (SoundManager.PlayTimer.NowTime * OpenTaiko.ConfigIni.SongPlaybackSpeed) + db一小節後); - - OpenTaiko.stage演奏ドラム画面.actLaneTaiko.t分岐レイヤー_コース変化(OpenTaiko.stage演奏ドラム画面.actLaneTaiko.stBranch[0].nAfter, CDTX.ECourse.eMaster, 0); - OpenTaiko.stage演奏ドラム画面.actMtaiko.tBranchEvent(OpenTaiko.stage演奏ドラム画面.actMtaiko.After[0], CDTX.ECourse.eMaster, 0); - - this.n現在のコース[0] = CDTX.ECourse.eMaster; - this.n次回のコース[0] = CDTX.ECourse.eMaster; - this.nレーン用表示コース[0] = CDTX.ECourse.eMaster; - - this.b強制的に分岐させた[0] = true; - } - - if (OpenTaiko.ConfigIni.KeyAssign.KeyIsPressed(OpenTaiko.ConfigIni.KeyAssign.System.DisplayHits)) { - if (OpenTaiko.ConfigIni.bJudgeCountDisplay == false) - OpenTaiko.ConfigIni.bJudgeCountDisplay = true; - else - OpenTaiko.ConfigIni.bJudgeCountDisplay = false; - } - - if (OpenTaiko.ConfigIni.KeyAssign.KeyIsPressed(OpenTaiko.ConfigIni.KeyAssign.System.CycleVideoDisplayMode)) { - switch (OpenTaiko.ConfigIni.eClipDispType) { - case EClipDispType.Off: - OpenTaiko.ConfigIni.eClipDispType = EClipDispType.BackgroundOnly; - break; - case EClipDispType.BackgroundOnly: - OpenTaiko.ConfigIni.eClipDispType = EClipDispType.WindowOnly; - break; - case EClipDispType.WindowOnly: - OpenTaiko.ConfigIni.eClipDispType = EClipDispType.Both; - break; - case EClipDispType.Both: - OpenTaiko.ConfigIni.eClipDispType = EClipDispType.Off; - break; - } - } - - if (OpenTaiko.ConfigIni.bTokkunMode && OpenTaiko.ConfigIni.KeyAssign.KeyIsPressed(OpenTaiko.ConfigIni.KeyAssign.Drums.TrainingToggleAuto)) { - OpenTaiko.ConfigIni.bAutoPlay[0] = !OpenTaiko.ConfigIni.bAutoPlay[0]; + if (OpenTaiko.ConfigIni.KeyAssign.KeyIsPressed(OpenTaiko.ConfigIni.KeyAssign.System.CycleVideoDisplayMode)) { + switch (OpenTaiko.ConfigIni.eClipDispType) { + case EClipDispType.Off: + OpenTaiko.ConfigIni.eClipDispType = EClipDispType.BackgroundOnly; + break; + case EClipDispType.BackgroundOnly: + OpenTaiko.ConfigIni.eClipDispType = EClipDispType.WindowOnly; + break; + case EClipDispType.WindowOnly: + OpenTaiko.ConfigIni.eClipDispType = EClipDispType.Both; + break; + case EClipDispType.Both: + OpenTaiko.ConfigIni.eClipDispType = EClipDispType.Off; + break; } } + if (OpenTaiko.ConfigIni.bTokkunMode && OpenTaiko.ConfigIni.KeyAssign.KeyIsPressed(OpenTaiko.ConfigIni.KeyAssign.Drums.TrainingToggleAuto)) { + OpenTaiko.ConfigIni.bAutoPlay[0] = !OpenTaiko.ConfigIni.bAutoPlay[0]; + } + } + #if DEBUG - if (keyboard.KeyPressed((int)SlimDXKeys.Key.F7)) { - OpenTaiko.ConfigIni.bAutoPlay[1] = !OpenTaiko.ConfigIni.bAutoPlay[1]; - } + if (keyboard.KeyPressed((int)SlimDXKeys.Key.F7)) { + OpenTaiko.ConfigIni.bAutoPlay[1] = !OpenTaiko.ConfigIni.bAutoPlay[1]; + } #endif - if (!this.actPauseMenu.bIsActivePopupMenu && this.bPAUSE && ((base.ePhaseID != CStage.EPhase.Game_STAGE_FAILED)) && (base.ePhaseID != CStage.EPhase.Game_STAGE_FAILED_FadeOut)) { - if (keyboard.KeyPressed((int)SlimDXKeys.Key.UpArrow)) { // UpArrow(scrollspeed up) - ドラムスクロール速度アップ(); - } else if (keyboard.KeyPressed((int)SlimDXKeys.Key.DownArrow)) { // DownArrow (scrollspeed down) - ドラムスクロール速度ダウン(); - } else if (OpenTaiko.ConfigIni.KeyAssign.KeyIsPressed(OpenTaiko.ConfigIni.KeyAssign.System.DisplayDebug)) { // del (debug info) - OpenTaiko.ConfigIni.bDisplayDebugInfo = !OpenTaiko.ConfigIni.bDisplayDebugInfo; - } else if ((keyboard.KeyPressed((int)SlimDXKeys.Key.Escape))) { // escape (exit) - SoundManager.PlayTimer.Resume(); - OpenTaiko.Timer.Resume(); - this.t演奏中止(); - } - } - - #region [ Minus & Equals Sound Group Level ] - KeyboardSoundGroupLevelControlHandler.Handle( - keyboard, OpenTaiko.SoundGroupLevelController, OpenTaiko.Skin, false); - #endregion - } - - protected void t入力メソッド記憶(EInstrumentPad part) { - if (OpenTaiko.Pad.detectedDevice.Keyboard) { - this.b演奏にキーボードを使った = true; - } - if (OpenTaiko.Pad.detectedDevice.Joypad) { - this.b演奏にジョイパッドを使った = true; - } - if (OpenTaiko.Pad.detectedDevice.MIDIIN) { - this.b演奏にMIDI入力を使った = true; - } - if (OpenTaiko.Pad.detectedDevice.Mouse) { - this.b演奏にマウスを使った = true; + if (!this.actPauseMenu.bIsActivePopupMenu && this.bPAUSE && ((base.ePhaseID != CStage.EPhase.Game_STAGE_FAILED)) && (base.ePhaseID != CStage.EPhase.Game_STAGE_FAILED_FadeOut)) { + if (keyboard.KeyPressed((int)SlimDXKeys.Key.UpArrow)) { // UpArrow(scrollspeed up) + ドラムスクロール速度アップ(); + } else if (keyboard.KeyPressed((int)SlimDXKeys.Key.DownArrow)) { // DownArrow (scrollspeed down) + ドラムスクロール速度ダウン(); + } else if (OpenTaiko.ConfigIni.KeyAssign.KeyIsPressed(OpenTaiko.ConfigIni.KeyAssign.System.DisplayDebug)) { // del (debug info) + OpenTaiko.ConfigIni.bDisplayDebugInfo = !OpenTaiko.ConfigIni.bDisplayDebugInfo; + } else if ((keyboard.KeyPressed((int)SlimDXKeys.Key.Escape))) { // escape (exit) + SoundManager.PlayTimer.Resume(); + OpenTaiko.Timer.Resume(); + this.t演奏中止(); } } + #region [ Minus & Equals Sound Group Level ] + KeyboardSoundGroupLevelControlHandler.Handle( + keyboard, OpenTaiko.SoundGroupLevelController, OpenTaiko.Skin, false); + #endregion + } - protected abstract void t進行描画_AVI(); - protected void t進行描画_AVI(int x, int y) { - if (((base.ePhaseID != CStage.EPhase.Game_STAGE_FAILED) && (base.ePhaseID != CStage.EPhase.Game_STAGE_FAILED_FadeOut)) && OpenTaiko.ConfigIni.bEnableAVI) { - this.actAVI.t進行描画(x, y); - } + protected void t入力メソッド記憶(EInstrumentPad part) { + if (OpenTaiko.Pad.detectedDevice.Keyboard) { + this.b演奏にキーボードを使った = true; } - protected void t進行描画_STAGEFAILED() { - // Transition for failed games - if (((base.ePhaseID == CStage.EPhase.Game_STAGE_FAILED) - || (base.ePhaseID == CStage.EPhase.Game_STAGE_FAILED_FadeOut)) - && ((this.actStageFailed.Draw() != 0) + if (OpenTaiko.Pad.detectedDevice.Joypad) { + this.b演奏にジョイパッドを使った = true; + } + if (OpenTaiko.Pad.detectedDevice.MIDIIN) { + this.b演奏にMIDI入力を使った = true; + } + if (OpenTaiko.Pad.detectedDevice.Mouse) { + this.b演奏にマウスを使った = true; + } + } + + + protected abstract void t進行描画_AVI(); + protected void t進行描画_AVI(int x, int y) { + if (((base.ePhaseID != CStage.EPhase.Game_STAGE_FAILED) && (base.ePhaseID != CStage.EPhase.Game_STAGE_FAILED_FadeOut)) && OpenTaiko.ConfigIni.bEnableAVI) { + this.actAVI.t進行描画(x, y); + } + } + protected void t進行描画_STAGEFAILED() { + // Transition for failed games + if (((base.ePhaseID == CStage.EPhase.Game_STAGE_FAILED) + || (base.ePhaseID == CStage.EPhase.Game_STAGE_FAILED_FadeOut)) + && ((this.actStageFailed.Draw() != 0) && (base.ePhaseID != CStage.EPhase.Game_STAGE_FAILED_FadeOut))) { - if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Tower) { - this.eフェードアウト完了時の戻り値 = EGameplayScreenReturnValue.StageCleared; - } else { - this.eフェードアウト完了時の戻り値 = EGameplayScreenReturnValue.StageFailed; + if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Tower) { + this.eフェードアウト完了時の戻り値 = EGameplayScreenReturnValue.StageCleared; + } else { + this.eフェードアウト完了時の戻り値 = EGameplayScreenReturnValue.StageFailed; + } + base.ePhaseID = CStage.EPhase.Game_STAGE_FAILED_FadeOut; + this.actFO.tフェードアウト開始(); + } + } + + protected abstract void t進行描画_パネル文字列(); + protected void t進行描画_パネル文字列(int x, int y) { + if ((base.ePhaseID != CStage.EPhase.Game_STAGE_FAILED) && (base.ePhaseID != CStage.EPhase.Game_STAGE_FAILED_FadeOut)) { + this.actPanel.t進行描画(x, y); + } + } + protected void tパネル文字列の設定() { + var panelString = string.IsNullOrEmpty(OpenTaiko.DTX.PANEL) ? OpenTaiko.DTX.TITLE.GetString("") : OpenTaiko.DTX.PANEL; + + this.actPanel.SetPanelString(panelString, + OpenTaiko.stageSongSelect.rChoosenSong.str本当のジャンル, + OpenTaiko.Skin.Game_StageText, + songNode: OpenTaiko.stageSongSelect.rChoosenSong); + } + + + protected void t進行描画_ゲージ() { + if ((((base.ePhaseID != CStage.EPhase.Game_STAGE_FAILED) && (base.ePhaseID != CStage.EPhase.Game_STAGE_FAILED_FadeOut)))) { + this.actGauge.Draw(); + } + } + protected void t進行描画_コンボ() { + this.actCombo.Draw(); + } + protected void t進行描画_スコア() { + this.actScore.Draw(); + } + + protected bool t進行描画_チップ(EInstrumentPad ePlayMode, int nPlayer) { + if ((base.ePhaseID == CStage.EPhase.Game_STAGE_FAILED) || (base.ePhaseID == CStage.EPhase.Game_STAGE_FAILED_FadeOut)) { + return true; + } + if ((this.n現在のトップChip == -1) || (this.n現在のトップChip >= listChip[nPlayer].Count)) { + return true; + } + if (IsDanFailed) { + return true; + } + + var n現在時刻ms = (long)(SoundManager.PlayTimer.NowTimeMs * OpenTaiko.ConfigIni.SongPlaybackSpeed); + + NowAIBattleSectionTime = (int)n現在時刻ms - NowAIBattleSection.StartTime; + + if (this.r指定時刻に一番近い未ヒットChip((long)n現在時刻ms, 0x50, 0, 1000000, nPlayer) == null) { + this.actChara.b演奏中[nPlayer] = false; + } + + var db現在の譜面スクロール速度 = this.act譜面スクロール速度.db現在の譜面スクロール速度; + + //double speed = 264.0; // BPM150の時の1小節の長さ[dot] + const double speed = 324.0; // BPM150の時の1小節の長さ[dot] + + double ScrollSpeedDrums = ((db現在の譜面スクロール速度[nPlayer] + 1.0) * speed) * 0.5 * 37.5 / 60000.0; + double ScrollSpeedGuitar = (db現在の譜面スクロール速度[nPlayer] + 1.0) * 0.5 * 0.5 * 37.5 * speed / 60000.0; + double ScrollSpeedBass = (db現在の譜面スクロール速度[nPlayer] + 1.0) * 0.5 * 0.5 * 37.5 * speed / 60000.0; + double ScrollSpeedTaiko = ((db現在の譜面スクロール速度[nPlayer] + 1.0) * speed) * 0.5 * 37.5 / 60000.0; + + + CConfigIni configIni = OpenTaiko.ConfigIni; + + CDTX dTX = OpenTaiko.DTX; + bool bAutoPlay = configIni.bAutoPlay[nPlayer]; + switch (nPlayer) //2017.08.11 kairera0467 + { + case 1: + bAutoPlay = configIni.bAutoPlay[nPlayer] || OpenTaiko.ConfigIni.bAIBattleMode; + dTX = OpenTaiko.DTX_2P; + break; + case 2: + dTX = OpenTaiko.DTX_3P; + break; + case 3: + dTX = OpenTaiko.DTX_4P; + break; + case 4: + dTX = OpenTaiko.DTX_5P; + break; + default: + break; + } + + if (this.n分岐した回数[nPlayer] == 0) { + this.bUseBranch[nPlayer] = dTX.bHIDDENBRANCH ? false : dTX.bチップがある.Branch; + } + + + //CDTXMania.act文字コンソール.tPrint(0, 0, C文字コンソール.Eフォント種別.灰, this.nLoopCount_Clear.ToString() ); + + float play_bpm_time = this.GetNowPBMTime(dTX, 0); + + //for ( int nCurrentTopChip = this.n現在のトップChip; nCurrentTopChip < dTX.listChip.Count; nCurrentTopChip++ ) + for (int nCurrentTopChip = dTX.listChip.Count - 1; nCurrentTopChip > 0; nCurrentTopChip--) { + CDTX.CChip pChip = dTX.listChip[nCurrentTopChip]; + //Debug.WriteLine( "nCurrentTopChip=" + nCurrentTopChip + ", ch=" + pChip.nチャンネル番号.ToString("x2") + ", 発音位置=" + pChip.n発声位置 + ", 発声時刻ms=" + pChip.n発声時刻ms ); + long time = pChip.n発声時刻ms - n現在時刻ms; + pChip.nバーからの距離dot.Drums = (int)(time * ScrollSpeedDrums); + pChip.nバーからの距離dot.Guitar = (int)(time * ScrollSpeedGuitar); + pChip.nバーからの距離dot.Bass = (int)(time * ScrollSpeedBass); + + double _scrollSpeed = pChip.dbSCROLL * (db現在の譜面スクロール速度[nPlayer] + 1.0) / 10.0; + double _scrollSpeed_Y = pChip.dbSCROLL_Y * (db現在の譜面スクロール速度[nPlayer] + 1.0) / 10.0; + pChip.nバーからの距離dot.Taiko = NotesManager.GetNoteX(pChip, time * pChip.dbBPM, _scrollSpeed, OpenTaiko.Skin.Game_Notes_Interval, play_bpm_time, pChip.eScrollMode, false); + if (pChip.nノーツ終了時刻ms != 0) { + pChip.nバーからのノーツ末端距離dot = NotesManager.GetNoteX(pChip, (pChip.nノーツ終了時刻ms - n現在時刻ms) * pChip.dbBPM, _scrollSpeed, OpenTaiko.Skin.Game_Notes_Interval, play_bpm_time, pChip.eScrollMode, true); + pChip.nバーからのノーツ末端距離dot_Y = NotesManager.GetNoteY(pChip, (pChip.nノーツ終了時刻ms - n現在時刻ms) * pChip.dbBPM, _scrollSpeed_Y, OpenTaiko.Skin.Game_Notes_Interval, play_bpm_time, pChip.eScrollMode, true); + } + + + if (pChip.eScrollMode == EScrollMode.BMScroll || pChip.eScrollMode == EScrollMode.HBScroll) { + + /* + pChip.nバーからの距離dot.Taiko = (int)(3 * 0.8335 * ((pChip.fBMSCROLLTime * NOTE_GAP) - (play_bpm_time * NOTE_GAP)) * dbSCROLL * (db現在の譜面スクロール速度[nPlayer] + 1) / 2 / 5.0); + if ( pChip.nノーツ終了時刻ms != 0 ) + pChip.nバーからのノーツ末端距離dot = (int)(3 * 0.8335 * ((pChip.fBMSCROLLTime_end * NOTE_GAP) - (play_bpm_time * NOTE_GAP)) * pChip.dbSCROLL * (db現在の譜面スクロール速度[nPlayer] + 1.0) / 2 / 5.0); + */ + } + + int instIndex = (int)pChip.e楽器パート; + + if (!pChip.IsMissed && !pChip.bHit) { + if (NotesManager.IsMissableNote(pChip))//|| pChip.nチャンネル番号 == 0x9A ) + { + //こっちのほうが適格と考えたためフラグを変更.2020.04.20 Akasoko26 + if (time <= 0) { + if (this.e指定時刻からChipのJUDGEを返す(n現在時刻ms, pChip, nPlayer) == ENoteJudge.Miss) { + pChip.IsMissed = true; + pChip.eNoteState = ENoteState.Bad; + this.tチップのヒット処理(n現在時刻ms, pChip, EInstrumentPad.Taiko, false, 0, nPlayer); + } + } } - base.ePhaseID = CStage.EPhase.Game_STAGE_FAILED_FadeOut; - this.actFO.tフェードアウト開始(); - } - } - - protected abstract void t進行描画_パネル文字列(); - protected void t進行描画_パネル文字列(int x, int y) { - if ((base.ePhaseID != CStage.EPhase.Game_STAGE_FAILED) && (base.ePhaseID != CStage.EPhase.Game_STAGE_FAILED_FadeOut)) { - this.actPanel.t進行描画(x, y); - } - } - protected void tパネル文字列の設定() { - var panelString = string.IsNullOrEmpty(OpenTaiko.DTX.PANEL) ? OpenTaiko.DTX.TITLE.GetString("") : OpenTaiko.DTX.PANEL; - - this.actPanel.SetPanelString(panelString, - OpenTaiko.stageSongSelect.rChoosenSong.str本当のジャンル, - OpenTaiko.Skin.Game_StageText, - songNode: OpenTaiko.stageSongSelect.rChoosenSong); - } - - - protected void t進行描画_ゲージ() { - if ((((base.ePhaseID != CStage.EPhase.Game_STAGE_FAILED) && (base.ePhaseID != CStage.EPhase.Game_STAGE_FAILED_FadeOut)))) { - this.actGauge.Draw(); - } - } - protected void t進行描画_コンボ() { - this.actCombo.Draw(); - } - protected void t進行描画_スコア() { - this.actScore.Draw(); - } - - protected bool t進行描画_チップ(EInstrumentPad ePlayMode, int nPlayer) { - if ((base.ePhaseID == CStage.EPhase.Game_STAGE_FAILED) || (base.ePhaseID == CStage.EPhase.Game_STAGE_FAILED_FadeOut)) { - return true; - } - if ((this.n現在のトップChip == -1) || (this.n現在のトップChip >= listChip[nPlayer].Count)) { - return true; - } - if (IsDanFailed) { - return true; } - var n現在時刻ms = (long)(SoundManager.PlayTimer.NowTimeMs * OpenTaiko.ConfigIni.SongPlaybackSpeed); - - NowAIBattleSectionTime = (int)n現在時刻ms - NowAIBattleSection.StartTime; - - if (this.r指定時刻に一番近い未ヒットChip((long)n現在時刻ms, 0x50, 0, 1000000, nPlayer) == null) { - this.actChara.b演奏中[nPlayer] = false; - } - - var db現在の譜面スクロール速度 = this.act譜面スクロール速度.db現在の譜面スクロール速度; - - //double speed = 264.0; // BPM150の時の1小節の長さ[dot] - const double speed = 324.0; // BPM150の時の1小節の長さ[dot] - - double ScrollSpeedDrums = ((db現在の譜面スクロール速度[nPlayer] + 1.0) * speed) * 0.5 * 37.5 / 60000.0; - double ScrollSpeedGuitar = (db現在の譜面スクロール速度[nPlayer] + 1.0) * 0.5 * 0.5 * 37.5 * speed / 60000.0; - double ScrollSpeedBass = (db現在の譜面スクロール速度[nPlayer] + 1.0) * 0.5 * 0.5 * 37.5 * speed / 60000.0; - double ScrollSpeedTaiko = ((db現在の譜面スクロール速度[nPlayer] + 1.0) * speed) * 0.5 * 37.5 / 60000.0; - - - CConfigIni configIni = OpenTaiko.ConfigIni; - - CDTX dTX = OpenTaiko.DTX; - bool bAutoPlay = configIni.bAutoPlay[nPlayer]; - switch (nPlayer) //2017.08.11 kairera0467 - { - case 1: - bAutoPlay = configIni.bAutoPlay[nPlayer] || OpenTaiko.ConfigIni.bAIBattleMode; - dTX = OpenTaiko.DTX_2P; - break; - case 2: - dTX = OpenTaiko.DTX_3P; - break; - case 3: - dTX = OpenTaiko.DTX_4P; - break; - case 4: - dTX = OpenTaiko.DTX_5P; - break; - default: - break; - } - - if (this.n分岐した回数[nPlayer] == 0) { - this.bUseBranch[nPlayer] = dTX.bHIDDENBRANCH ? false : dTX.bチップがある.Branch; - } - - - //CDTXMania.act文字コンソール.tPrint(0, 0, C文字コンソール.Eフォント種別.灰, this.nLoopCount_Clear.ToString() ); - - float play_bpm_time = this.GetNowPBMTime(dTX, 0); - - //for ( int nCurrentTopChip = this.n現在のトップChip; nCurrentTopChip < dTX.listChip.Count; nCurrentTopChip++ ) - for (int nCurrentTopChip = dTX.listChip.Count - 1; nCurrentTopChip > 0; nCurrentTopChip--) { - CDTX.CChip pChip = dTX.listChip[nCurrentTopChip]; - //Debug.WriteLine( "nCurrentTopChip=" + nCurrentTopChip + ", ch=" + pChip.nチャンネル番号.ToString("x2") + ", 発音位置=" + pChip.n発声位置 + ", 発声時刻ms=" + pChip.n発声時刻ms ); - long time = pChip.n発声時刻ms - n現在時刻ms; - pChip.nバーからの距離dot.Drums = (int)(time * ScrollSpeedDrums); - pChip.nバーからの距離dot.Guitar = (int)(time * ScrollSpeedGuitar); - pChip.nバーからの距離dot.Bass = (int)(time * ScrollSpeedBass); - - double _scrollSpeed = pChip.dbSCROLL * (db現在の譜面スクロール速度[nPlayer] + 1.0) / 10.0; - double _scrollSpeed_Y = pChip.dbSCROLL_Y * (db現在の譜面スクロール速度[nPlayer] + 1.0) / 10.0; - pChip.nバーからの距離dot.Taiko = NotesManager.GetNoteX(pChip, time * pChip.dbBPM, _scrollSpeed, OpenTaiko.Skin.Game_Notes_Interval, play_bpm_time, pChip.eScrollMode, false); - if (pChip.nノーツ終了時刻ms != 0) { - pChip.nバーからのノーツ末端距離dot = NotesManager.GetNoteX(pChip, (pChip.nノーツ終了時刻ms - n現在時刻ms) * pChip.dbBPM, _scrollSpeed, OpenTaiko.Skin.Game_Notes_Interval, play_bpm_time, pChip.eScrollMode, true); - pChip.nバーからのノーツ末端距離dot_Y = NotesManager.GetNoteY(pChip, (pChip.nノーツ終了時刻ms - n現在時刻ms) * pChip.dbBPM, _scrollSpeed_Y, OpenTaiko.Skin.Game_Notes_Interval, play_bpm_time, pChip.eScrollMode, true); + if (pChip.nバーからの距離dot[instIndex] < -150) { + if (!(NotesManager.IsMissableNote(pChip))) { + //2016.02.11 kairera0467 + //太鼓の単音符の場合は座標による判定を行わない。 + //(ここで判定をすると高スピードでスクロールしている時に見逃し不可判定が行われない。) + pChip.bHit = true; } + } + var cChipCurrentlyInProcess = chip現在処理中の連打チップ[nPlayer]; + if (cChipCurrentlyInProcess != null && !cChipCurrentlyInProcess.bHit) { - if (pChip.eScrollMode == EScrollMode.BMScroll || pChip.eScrollMode == EScrollMode.HBScroll) { - - /* - pChip.nバーからの距離dot.Taiko = (int)(3 * 0.8335 * ((pChip.fBMSCROLLTime * NOTE_GAP) - (play_bpm_time * NOTE_GAP)) * dbSCROLL * (db現在の譜面スクロール速度[nPlayer] + 1) / 2 / 5.0); - if ( pChip.nノーツ終了時刻ms != 0 ) - pChip.nバーからのノーツ末端距離dot = (int)(3 * 0.8335 * ((pChip.fBMSCROLLTime_end * NOTE_GAP) - (play_bpm_time * NOTE_GAP)) * pChip.dbSCROLL * (db現在の譜面スクロール速度[nPlayer] + 1.0) / 2 / 5.0); - */ - } - - int instIndex = (int)pChip.e楽器パート; - - if (!pChip.IsMissed && !pChip.bHit) { - if (NotesManager.IsMissableNote(pChip))//|| pChip.nチャンネル番号 == 0x9A ) + //if( cChipCurrentlyInProcess.nチャンネル番号 >= 0x13 && cChipCurrentlyInProcess.nチャンネル番号 <= 0x15 )//|| pChip.nチャンネル番号 == 0x9A ) + if (NotesManager.IsBigNote(cChipCurrentlyInProcess)) { + if (((cChipCurrentlyInProcess.nバーからの距離dot.Taiko < -500) && (cChipCurrentlyInProcess.n発声時刻ms <= n現在時刻ms && cChipCurrentlyInProcess.nノーツ終了時刻ms >= n現在時刻ms))) + //( ( chip現在処理中の連打チップ.nバーからのノーツ末端距離dot.Taiko < -500 ) && ( chip現在処理中の連打チップ.n発声時刻ms <= CSound管理.rc演奏用タイマ.n現在時刻ms && chip現在処理中の連打チップ.nノーツ終了時刻ms >= CSound管理.rc演奏用タイマ.n現在時刻ms ) ) ) + //( ( pChip.n発声時刻ms <= CSound管理.rc演奏用タイマ.n現在時刻ms && pChip.nノーツ終了時刻ms >= CSound管理.rc演奏用タイマ.n現在時刻ms ) ) ) { - //こっちのほうが適格と考えたためフラグを変更.2020.04.20 Akasoko26 - if (time <= 0) { - if (this.e指定時刻からChipのJUDGEを返す(n現在時刻ms, pChip, nPlayer) == ENoteJudge.Miss) { - pChip.IsMissed = true; - pChip.eNoteState = ENoteState.Bad; - this.tチップのヒット処理(n現在時刻ms, pChip, EInstrumentPad.Taiko, false, 0, nPlayer); - } - } + if (bAutoPlay) + this.tチップのヒット処理(n現在時刻ms, cChipCurrentlyInProcess, EInstrumentPad.Taiko, false, 0, nPlayer); } } + } - if (pChip.nバーからの距離dot[instIndex] < -150) { - if (!(NotesManager.IsMissableNote(pChip))) { - //2016.02.11 kairera0467 - //太鼓の単音符の場合は座標による判定を行わない。 - //(ここで判定をすると高スピードでスクロールしている時に見逃し不可判定が行われない。) + + if (pChip.nPlayerSide == nPlayer && pChip.n発声時刻ms >= n現在時刻ms) { + NowProcessingChip[pChip.nPlayerSide] = nCurrentTopChip; + } + + switch (pChip.nチャンネル番号) { + #region [ 01: BGM ] + case 0x01: // BGM + if (!pChip.bHit && time < 0) { pChip.bHit = true; + if (configIni.bBGMPlayVoiceSound) { + dTX.tチップの再生(pChip, SoundManager.PlayTimer.PrevResetTime + (long)(pChip.n発声時刻ms / OpenTaiko.ConfigIni.SongPlaybackSpeed)); + } } - } + break; + #endregion + #region [ 03: BPM変更 ] + case 0x03: // BPM変更 + if (!pChip.bHit && time < 0) { + pChip.bHit = true; + this.actPlayInfo.dbBPM[nPlayer] = dTX.BASEBPM; //2016.07.10 kairera0467 太鼓の仕様にあわせて修正。(そもそもの仕様が不明&コードミス疑惑) + } + break; + #endregion + #region [ 08: BPM変更(拡張) ] + case 0x08: // BPM変更(拡張) + //CDTXMania.act文字コンソール.tPrint( 414 + pChip.nバーからの距離dot.Drums + 4, 192, C文字コンソール.Eフォント種別.白, "BRANCH START" + " " + pChip.n整数値.ToString() ); + if (!pChip.bHit && time < 0) { + pChip.bHit = true; + //if( pChip.nコース == this.n現在のコース[ nPlayer ] ) + //{ + //double bpm = ( dTX.listBPM[ pChip.n整数値_内部番号 ].dbBPM値 * ( ( (double) configIni.n演奏速度 ) / 20.0 ) ); + //int nUnit = (int)((60.0 / ( bpm ) / this.actChara.nキャラクター通常モーション枚数 ) * 1000 ); + //int nUnit_gogo = (int)((60.0 / ( bpm ) / this.actChara.nキャラクターゴーゴーモーション枚数 ) * 1000 ); + //this.actChara.ct通常モーション = new CCounter( 0, this.actChara.nキャラクター通常モーション枚数 - 1, nUnit, CDTXMania.Timer ); + //this.actChara.ctゴーゴーモーション = new CCounter(0, this.actChara.nキャラクターゴーゴーモーション枚数 - 1, nUnit_gogo * 2, CDTXMania.Timer); - var cChipCurrentlyInProcess = chip現在処理中の連打チップ[nPlayer]; - if (cChipCurrentlyInProcess != null && !cChipCurrentlyInProcess.bHit) { + //} + } + break; + #endregion - //if( cChipCurrentlyInProcess.nチャンネル番号 >= 0x13 && cChipCurrentlyInProcess.nチャンネル番号 <= 0x15 )//|| pChip.nチャンネル番号 == 0x9A ) - if (NotesManager.IsBigNote(cChipCurrentlyInProcess)) { - if (((cChipCurrentlyInProcess.nバーからの距離dot.Taiko < -500) && (cChipCurrentlyInProcess.n発声時刻ms <= n現在時刻ms && cChipCurrentlyInProcess.nノーツ終了時刻ms >= n現在時刻ms))) - //( ( chip現在処理中の連打チップ.nバーからのノーツ末端距離dot.Taiko < -500 ) && ( chip現在処理中の連打チップ.n発声時刻ms <= CSound管理.rc演奏用タイマ.n現在時刻ms && chip現在処理中の連打チップ.nノーツ終了時刻ms >= CSound管理.rc演奏用タイマ.n現在時刻ms ) ) ) - //( ( pChip.n発声時刻ms <= CSound管理.rc演奏用タイマ.n現在時刻ms && pChip.nノーツ終了時刻ms >= CSound管理.rc演奏用タイマ.n現在時刻ms ) ) ) + #region [ 11-1f & 101-: Taiko ] + case 0x11: + case 0x12: + case 0x13: + case 0x14: + case 0x1C: + case 0x101: { + this.t進行描画_チップ_Taiko(configIni, ref dTX, ref pChip, nPlayer); + } + break; + + case 0x15: + case 0x16: + case 0x17: + case 0x19: + case 0x1D: { + //2015.03.28 kairera0467 + //描画順序を変えるため、メイン処理だけをこちらに残して描画処理は分離。 + + //this.t進行描画_チップ_Taiko連打(configIni, ref dTX, ref pChip); + //2015.04.13 kairera0467 ここを外さないと恋文2000の連打に対応できず、ここをつけないと他のコースと重なっている連打をどうにもできない。 + //常時実行メソッドに渡したら対応できた!? + //if ((!pChip.bHit && (pChip.nバーからの距離dot.Drums < 0))) { - if (bAutoPlay) - this.tチップのヒット処理(n現在時刻ms, cChipCurrentlyInProcess, EInstrumentPad.Taiko, false, 0, nPlayer); - } - } - } - - - if (pChip.nPlayerSide == nPlayer && pChip.n発声時刻ms >= n現在時刻ms) { - NowProcessingChip[pChip.nPlayerSide] = nCurrentTopChip; - } - - switch (pChip.nチャンネル番号) { - #region [ 01: BGM ] - case 0x01: // BGM - if (!pChip.bHit && time < 0) { - pChip.bHit = true; - if (configIni.bBGMPlayVoiceSound) { - dTX.tチップの再生(pChip, SoundManager.PlayTimer.PrevResetTime + (long)(pChip.n発声時刻ms / OpenTaiko.ConfigIni.SongPlaybackSpeed)); - } - } - break; - #endregion - #region [ 03: BPM変更 ] - case 0x03: // BPM変更 - if (!pChip.bHit && time < 0) { - pChip.bHit = true; - this.actPlayInfo.dbBPM[nPlayer] = dTX.BASEBPM; //2016.07.10 kairera0467 太鼓の仕様にあわせて修正。(そもそもの仕様が不明&コードミス疑惑) - } - break; - #endregion - #region [ 08: BPM変更(拡張) ] - case 0x08: // BPM変更(拡張) - //CDTXMania.act文字コンソール.tPrint( 414 + pChip.nバーからの距離dot.Drums + 4, 192, C文字コンソール.Eフォント種別.白, "BRANCH START" + " " + pChip.n整数値.ToString() ); - if (!pChip.bHit && time < 0) { - pChip.bHit = true; - //if( pChip.nコース == this.n現在のコース[ nPlayer ] ) - //{ - //double bpm = ( dTX.listBPM[ pChip.n整数値_内部番号 ].dbBPM値 * ( ( (double) configIni.n演奏速度 ) / 20.0 ) ); - //int nUnit = (int)((60.0 / ( bpm ) / this.actChara.nキャラクター通常モーション枚数 ) * 1000 ); - //int nUnit_gogo = (int)((60.0 / ( bpm ) / this.actChara.nキャラクターゴーゴーモーション枚数 ) * 1000 ); - //this.actChara.ct通常モーション = new CCounter( 0, this.actChara.nキャラクター通常モーション枚数 - 1, nUnit, CDTXMania.Timer ); - //this.actChara.ctゴーゴーモーション = new CCounter(0, this.actChara.nキャラクターゴーゴーモーション枚数 - 1, nUnit_gogo * 2, CDTXMania.Timer); - - //} - } - break; - #endregion - - #region [ 11-1f & 101-: Taiko ] - case 0x11: - case 0x12: - case 0x13: - case 0x14: - case 0x1C: - case 0x101: { - this.t進行描画_チップ_Taiko(configIni, ref dTX, ref pChip, nPlayer); - } - break; - - case 0x15: - case 0x16: - case 0x17: - case 0x19: - case 0x1D: { - //2015.03.28 kairera0467 - //描画順序を変えるため、メイン処理だけをこちらに残して描画処理は分離。 - - //this.t進行描画_チップ_Taiko連打(configIni, ref dTX, ref pChip); - //2015.04.13 kairera0467 ここを外さないと恋文2000の連打に対応できず、ここをつけないと他のコースと重なっている連打をどうにもできない。 - //常時実行メソッドに渡したら対応できた!? - //if ((!pChip.bHit && (pChip.nバーからの距離dot.Drums < 0))) - { - if ((pChip.n発声時刻ms <= (int)n現在時刻ms && pChip.nノーツ終了時刻ms >= (int)n現在時刻ms)) { - //if( this.n現在のコース == pChip.nコース ) - if (pChip.b可視 == true) - this.chip現在処理中の連打チップ[nPlayer] = pChip; - } - } - if (!pChip.bProcessed && time < 0) { - if (NotesManager.IsKusudama(pChip)) { - if (!this.b連打中[nPlayer] && nPlayer == 0) { - actBalloon.KusuIn(); - actChara.KusuIn(); - for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { - this.b連打中[i] = true; - this.actChara.b風船連打中[i] = true; - } - } - - nCurrentKusudamaRollCount = 0; - nCurrentKusudamaCount += pChip.nBalloon; - for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { - n風船残り[i] = nCurrentKusudamaCount; - } - pChip.bProcessed = true; - } - } - if (pChip.n描画優先度 <= 0) - this.t進行描画_チップ_Taiko連打(configIni, ref dTX, ref pChip, nPlayer); - } - - break; - case 0x18: { - if ((!pChip.bProcessed && time < 0)) { - this.b連打中[nPlayer] = false; - this.actRoll.b表示[nPlayer] = false; - this.actChara.b風船連打中[nPlayer] = false; - pChip.bProcessed = true; - if (chip現在処理中の連打チップ[nPlayer] != null) { - chip現在処理中の連打チップ[nPlayer].bHit = true; - if (NotesManager.IsKusudama(chip現在処理中の連打チップ[nPlayer])) { - if (nCurrentKusudamaCount > nCurrentKusudamaRollCount) { - if (nPlayer == 0) { - actBalloon.KusuMiss(); - OpenTaiko.Skin.soundKusudamaMiss.tPlay(); - for (int p = 0; p < OpenTaiko.ConfigIni.nPlayerCount; p++) { - { - this.actChara.ChangeAnime(p, CActImplCharacter.Anime.Kusudama_Miss, true); - - if (actChara.CharaAction_Balloon_Delay[p] != null) actChara.CharaAction_Balloon_Delay[p] = new CCounter(0, - OpenTaiko.Skin.Characters_Balloon_Delay[actChara.iCurrentCharacter[p]] - 1, - 1, - OpenTaiko.Timer); - } - } - nCurrentKusudamaRollCount = 0; - nCurrentKusudamaCount = 0; - } - - } - } else { - if (chip現在処理中の連打チップ[nPlayer].nBalloon > chip現在処理中の連打チップ[nPlayer].nRollCount - && chip現在処理中の連打チップ[nPlayer].nRollCount > 0) { - { - this.actChara.ChangeAnime(nPlayer, CActImplCharacter.Anime.Balloon_Miss, true); - - if (actChara.CharaAction_Balloon_Delay[nPlayer] != null) actChara.CharaAction_Balloon_Delay[nPlayer] = new CCounter(0, - OpenTaiko.Skin.Characters_Balloon_Delay[actChara.iCurrentCharacter[nPlayer]] - 1, - 1, - OpenTaiko.Timer); - } - } - } - if (chip現在処理中の連打チップ[nPlayer].nBalloon > chip現在処理中の連打チップ[nPlayer].nRollCount) { - if (pChip.n連打音符State == 13) { - this.actJudgeString.Start(nPlayer, ENoteJudge.Mine); - OpenTaiko.stage演奏ドラム画面.actLaneTaiko.Start(0x11, ENoteJudge.Bad, true, nPlayer); - OpenTaiko.stage演奏ドラム画面.actChipFireD.Start(0x11, ENoteJudge.Mine, nPlayer); - actGauge.MineDamage(nPlayer); - OpenTaiko.Skin.soundBomb?.tPlay(); - this.CChartScore[nPlayer].nMine++; - this.CSectionScore[nPlayer].nMine++; - this.CBranchScore[nPlayer].nMine++; - if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Tower) - CFloorManagement.damage(); - if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) - this.nMine[actDan.NowShowingNumber]++; - this.actCombo.n現在のコンボ数[nPlayer] = 0; - if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) - this.nCombo[actDan.NowShowingNumber] = 0; - this.actComboVoice.tReset(nPlayer); - this.bIsMiss[nPlayer] = true; - } - } - chip現在処理中の連打チップ[nPlayer] = null; - - } - this.eRollState = ERollState.None; - } - if (pChip.n描画優先度 <= 0) - this.t進行描画_チップ_Taiko連打(configIni, ref dTX, ref pChip, nPlayer); - } - - break; - - case 0x1e: - break; - - case 0x1a: - case 0x1b: - case 0x1f: { - this.t進行描画_チップ_Taiko(configIni, ref dTX, ref pChip, nPlayer); - } - break; - #endregion - #region [ 20-2F: EmptySlot ] - case 0x20: - case 0x21: { if ((pChip.n発声時刻ms <= (int)n現在時刻ms && pChip.nノーツ終了時刻ms >= (int)n現在時刻ms)) { //if( this.n現在のコース == pChip.nコース ) if (pChip.b可視 == true) this.chip現在処理中の連打チップ[nPlayer] = pChip; } - if (pChip.n描画優先度 <= 0) - this.t進行描画_チップ_Taiko連打(configIni, ref dTX, ref pChip, nPlayer); } - break; - case 0x22: - case 0x23: - case 0x24: - case 0x25: - case 0x26: - case 0x27: - case 0x28: - case 0x29: - case 0x2a: - case 0x2b: - case 0x2c: - case 0x2d: - case 0x2e: - case 0x2f: - break; - #endregion - #region [ 31-3f: EmptySlot ] - case 0x31: - case 0x32: - case 0x33: - case 0x34: - case 0x35: - case 0x36: - case 0x37: - case 0x38: - case 0x39: - case 0x3a: - case 0x3b: - case 0x3c: - case 0x3d: - case 0x3e: - case 0x3f: - break; - #endregion - - #region [ 50: 小節線 ] - case 0x50: // 小節線 - { - - if (!pChip.bHit && time < 0) { - //if (nPlayer == 0) TJAPlayer3.BeatScaling = new CCounter(0, 1000, 120.0 / pChip.dbBPM / 2.0, TJAPlayer3.Timer); - if (NowAIBattleSectionTime >= NowAIBattleSection.Length && NowAIBattleSection.End == AIBattleSection.EndType.None && nPlayer == 0) { - PassAIBattleSection(); - - NowAIBattleSectionCount++; - - if (AIBattleSections.Count > NowAIBattleSectionCount) { - NowAIBattleSectionTime = 0; - } - NowAIBattleSectionTime = (int)n現在時刻ms - NowAIBattleSection.StartTime; - } - - - this.actChara.b演奏中[nPlayer] = true; - if (this.actPlayInfo.NowMeasure[nPlayer] == 0) { - UpdateCharaCounter(nPlayer); - } - if (!bPAUSE)//2020.07.08 Mr-Ojii KabanFriends氏のコードを参考に - { - actPlayInfo.NowMeasure[nPlayer] = pChip.n整数値_内部番号; - } - pChip.bHit = true; - } - this.t進行描画_チップ_小節線(configIni, ref dTX, ref pChip, nPlayer); - break; - } - #endregion - #region [ 51: 拍線 ] - case 0x51: // 拍線 - if (!pChip.bHit && time < 0) { - pChip.bHit = true; - } - break; - #endregion - #region [ 54: 動画再生 ] - case 0x54: // 動画再生 - if (!pChip.bHit && time < 0) { - pChip.bHit = true; - if (configIni.bEnableAVI) { - if ((dTX.listVD.TryGetValue(pChip.n整数値_内部番号, out CVideoDecoder vd))) { - ShowVideo = true; - if (OpenTaiko.ConfigIni.bEnableAVI && vd != null) { - this.actAVI.Start(pChip.nチャンネル番号, vd); - this.actAVI.Seek(pChip.VideoStartTimeMs); + if (!pChip.bProcessed && time < 0) { + if (NotesManager.IsKusudama(pChip)) { + if (!this.b連打中[nPlayer] && nPlayer == 0) { + actBalloon.KusuIn(); + actChara.KusuIn(); + for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { + this.b連打中[i] = true; + this.actChara.b風船連打中[i] = true; } } + + nCurrentKusudamaRollCount = 0; + nCurrentKusudamaCount += pChip.nBalloon; + for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { + n風船残り[i] = nCurrentKusudamaCount; + } + pChip.bProcessed = true; } } - break; - case 0x55: - if (!pChip.bHit && time < 0) { - pChip.bHit = true; - if (configIni.bEnableAVI) { - if ((dTX.listVD.TryGetValue(pChip.n整数値_内部番号, out CVideoDecoder vd))) { - ShowVideo = false; - if (OpenTaiko.ConfigIni.bEnableAVI && vd != null) { - this.actAVI.Stop(); + if (pChip.n描画優先度 <= 0) + this.t進行描画_チップ_Taiko連打(configIni, ref dTX, ref pChip, nPlayer); + } + + break; + case 0x18: { + if ((!pChip.bProcessed && time < 0)) { + this.b連打中[nPlayer] = false; + this.actRoll.b表示[nPlayer] = false; + this.actChara.b風船連打中[nPlayer] = false; + pChip.bProcessed = true; + if (chip現在処理中の連打チップ[nPlayer] != null) { + chip現在処理中の連打チップ[nPlayer].bHit = true; + if (NotesManager.IsKusudama(chip現在処理中の連打チップ[nPlayer])) { + if (nCurrentKusudamaCount > nCurrentKusudamaRollCount) { + if (nPlayer == 0) { + actBalloon.KusuMiss(); + OpenTaiko.Skin.soundKusudamaMiss.tPlay(); + for (int p = 0; p < OpenTaiko.ConfigIni.nPlayerCount; p++) { + { + this.actChara.ChangeAnime(p, CActImplCharacter.Anime.Kusudama_Miss, true); + + if (actChara.CharaAction_Balloon_Delay[p] != null) actChara.CharaAction_Balloon_Delay[p] = new CCounter(0, + OpenTaiko.Skin.Characters_Balloon_Delay[actChara.iCurrentCharacter[p]] - 1, + 1, + OpenTaiko.Timer); + } + } + nCurrentKusudamaRollCount = 0; + nCurrentKusudamaCount = 0; + } + } - } - - if ((dTX.listVD.TryGetValue(1, out CVideoDecoder vd2))) { - ShowVideo = true; - if (OpenTaiko.ConfigIni.bEnableAVI && vd != null) { - this.actAVI.Start(pChip.nチャンネル番号, vd); - } - } - } - } - break; - #endregion - #region[ 55-60: EmptySlot ] - case 0x56: - case 0x57: - case 0x58: - case 0x59: - break; - #endregion - #region [ 61-89: EmptySlot ] - case 0x60: - case 0x61: - case 0x62: - case 0x63: - case 0x64: - case 0x65: - case 0x66: - case 0x67: - case 0x68: - case 0x69: - case 0x70: - case 0x71: - case 0x72: - case 0x73: - case 0x74: - case 0x75: - case 0x76: - case 0x77: - case 0x78: - case 0x79: - case 0x80: - case 0x81: - case 0x82: - case 0x83: - case 0x84: - case 0x85: - case 0x86: - case 0x87: - case 0x88: - case 0x89: - break; - #endregion - - #region[ 90-9A: EmptySlot ] - case 0x90: - case 0x91: - case 0x92: - case 0x93: - case 0x94: - case 0x95: - case 0x96: - case 0x97: - case 0x98: - case 0x99: - case 0x9A: - break; - #endregion - - #region[ 9B-9F: 太鼓 ] - case 0x9B: - // 段位認定モードの幕アニメーション - if (!pChip.bHit && time < 0) { - pChip.bHit = true; - this.actPanel.t歌詞テクスチャを削除する(); - if (pChip.nコース == this.n現在のコース[nPlayer]) { - this.actDan.Update(); - if (ListDan_Number != 0 && actDan.FirstSectionAnime) { - if (this.actDan.GetFailedAllChallenges()) { - this.n現在のトップChip = OpenTaiko.DTX.listChip.Count - 1; // 終端にシーク - IsDanFailed = true; - return true; - } - - // Play next song here - this.actDan.Start(this.ListDan_Number); - ListDan_Number++; } else { - actDan.FirstSectionAnime = true; - } - } - } - break; - //0x9C BPM変化(アニメーション用) - case 0x9C: - //CDTXMania.act文字コンソール.tPrint( 414 + pChip.nバーからの距離dot.Taiko + 8, 192, C文字コンソール.Eフォント種別.白, "BPMCHANGE" ); - if (!pChip.bHit && time < 0) { - pChip.bHit = true; - if (pChip.nコース == this.n現在のコース[nPlayer]) { - if (dTX.listBPM.TryGetValue(pChip.n整数値_内部番号, out CDTX.CBPM cBPM)) { - this.actPlayInfo.dbBPM[nPlayer] = cBPM.dbBPM値;// + dTX.BASEBPM; - } + if (chip現在処理中の連打チップ[nPlayer].nBalloon > chip現在処理中の連打チップ[nPlayer].nRollCount + && chip現在処理中の連打チップ[nPlayer].nRollCount > 0) { + { + this.actChara.ChangeAnime(nPlayer, CActImplCharacter.Anime.Balloon_Miss, true); - - for (int i = 0; i < 5; i++) { - ctChipAnime[i] = new CCounter(0, 3, 60.0 / OpenTaiko.stage演奏ドラム画面.actPlayInfo.dbBPM[nPlayer] * 1 / 4, SoundManager.PlayTimer); - } - - UpdateCharaCounter(nPlayer); - //this.actDancer.ct踊り子モーション = new CCounter(0, this.actDancer.ar踊り子モーション番号.Length - 1, (dbUnit * CDTXMania.Skin.Game_Dancer_Beat) / this.actDancer.ar踊り子モーション番号.Length, CSound管理.rc演奏用タイマ); - //this.actChara.ctモブモーション = new CCounter(0, this.actChara.arモブモーション番号.Length - 1, (dbUnit) / this.actChara.arモブモーション番号.Length, CSound管理.rc演奏用タイマ); - //#if C_82D982F182AF82CD82A282AF82A2 - /* - * for( int dancer = 0; dancer < 5; dancer++ ) - this.actDancer.st投げ上げ[ dancer ].ct進行 = new CCounter( 0, this.actDancer.arモーション番号_登場.Length - 1, dbUnit / this.actDancer.arモーション番号_登場.Length, CSound管理.rc演奏用タイマ ); - - this.actDancer.ct通常モーション = new CCounter( 0, this.actDancer.arモーション番号_通常.Length - 1, ( dbUnit * 4 ) / this.actDancer.arモーション番号_通常.Length, CSound管理.rc演奏用タイマ ); - this.actDancer.ctモブ = new CCounter( 1.0, 16.0, (int)((60.0 / bpm / 16.0 ) * 1000 ), CSound管理.rc演奏用タイマ ); -//#endif - */ - } - - } - break; - - case 0x9D: //SCROLL - if (!pChip.bHit && time < 0) { - pChip.bHit = true; - //if ( dTX.listSCROLL.ContainsKey( pChip.n整数値_内部番号 ) ) - //{ - //this.actPlayInfo.dbBPM = ( dTX.listBPM[ pChip.n整数値_内部番号 ].dbBPM値 * ( ( (double) configIni.n演奏速度 ) / 20.0 ) );// + dTX.BASEBPM; - //} - } - break; - - case 0x9E: //ゴーゴータイム - if (!pChip.bHit && time < 0) { - pChip.bHit = true; - this.bIsGOGOTIME[nPlayer] = true; - //double dbUnit = (((60.0 / (CDTXMania.stage演奏ドラム画面.actPlayInfo.dbBPM)))); - double dbUnit = (((60.0 / pChip.dbBPM))); - - int Character = this.actChara.iCurrentCharacter[nPlayer]; - - { - if (OpenTaiko.Skin.Characters_GoGoStart_Ptn[Character] != 0 && actChara.CharaAction_Balloon_Delay[nPlayer].IsEnded) { - if (!HGaugeMethods.UNSAFE_IsRainbow(nPlayer) && (!HGaugeMethods.UNSAFE_FastNormaCheck(nPlayer) || OpenTaiko.Skin.Characters_GoGoStart_Clear_Ptn[Character] == 0)) { - // 魂ゲージMAXではない - // ゴーゴースタート_ノーマル - this.actChara.ChangeAnime(nPlayer, CActImplCharacter.Anime.GoGoStart, true); - //this.actChara.キャラクター_アクション_10コンボ(); - } - } - if (OpenTaiko.Skin.Characters_GoGoStart_Clear_Ptn[Character] != 0 && actChara.CharaAction_Balloon_Delay[nPlayer].IsEnded) { - if (!HGaugeMethods.UNSAFE_IsRainbow(nPlayer) && HGaugeMethods.UNSAFE_FastNormaCheck(nPlayer)) { - this.actChara.ChangeAnime(nPlayer, CActImplCharacter.Anime.GoGoStart_Clear, true); - } - } - if (OpenTaiko.Skin.Characters_GoGoStart_Maxed_Ptn[Character] != 0 && actChara.CharaAction_Balloon_Delay[nPlayer].IsEnded) { - if (HGaugeMethods.UNSAFE_IsRainbow(nPlayer)) { - // 魂ゲージMAX - // ゴーゴースタート_MAX - this.actChara.ChangeAnime(nPlayer, CActImplCharacter.Anime.GoGoStart_Max, true); - } - } - - } - OpenTaiko.stage演奏ドラム画面.actLaneTaiko.GOGOSTART(); - } - break; - case 0x9F: //ゴーゴータイム - if (!pChip.bHit && time < 0) { - pChip.bHit = true; - this.bIsGOGOTIME[nPlayer] = false; - } - break; - #endregion - - #region [ EXTENDED COMMANDS ] - case 0xa0: //camera vertical move start - if (!pChip.bHit && time < 0) { - pChip.bHit = true; - this.currentCamVMoveChip = pChip; - this.ctCamVMove = new CCounter(0, pChip.fCamTimeMs, 1, OpenTaiko.Timer); - } - break; - case 0xa1: //camera vertical move end - if (!pChip.bHit && time < 0) { - pChip.bHit = true; - } - break; - case 0xa2: //camera horizontal move start - if (!pChip.bHit && time < 0) { - pChip.bHit = true; - this.currentCamHMoveChip = pChip; - this.ctCamHMove = new CCounter(0, pChip.fCamTimeMs, 1, OpenTaiko.Timer); - } - break; - case 0xa3: //camera horizontal move end - if (!pChip.bHit && time < 0) { - pChip.bHit = true; - } - break; - case 0xa4: //camera zoom start - if (!pChip.bHit && time < 0) { - pChip.bHit = true; - this.currentCamZoomChip = pChip; - this.ctCamZoom = new CCounter(0, pChip.fCamTimeMs, 1, OpenTaiko.Timer); - } - break; - case 0xa5: //camera zoom end - if (!pChip.bHit && time < 0) { - pChip.bHit = true; - } - break; - case 0xa6: //camera rotation start - if (!pChip.bHit && time < 0) { - pChip.bHit = true; - this.currentCamRotateChip = pChip; - this.ctCamRotation = new CCounter(0, pChip.fCamTimeMs, 1, OpenTaiko.Timer); - } - break; - case 0xa7: //camera rotation end - if (!pChip.bHit && time < 0) { - pChip.bHit = true; - } - break; - case 0xa8: //camera vertical scaling start - if (!pChip.bHit && time < 0) { - pChip.bHit = true; - this.currentCamVScaleChip = pChip; - this.ctCamVScale = new CCounter(0, pChip.fCamTimeMs, 1, OpenTaiko.Timer); - } - break; - case 0xa9: //camera vertical scaling end - if (!pChip.bHit && time < 0) { - pChip.bHit = true; - } - break; - case 0xb0: //camera horizontal scaling start - if (!pChip.bHit && time < 0) { - pChip.bHit = true; - this.currentCamHScaleChip = pChip; - this.ctCamHScale = new CCounter(0, pChip.fCamTimeMs, 1, OpenTaiko.Timer); - } - break; - case 0xb1: //camera horizontal scaling end - if (!pChip.bHit && time < 0) { - pChip.bHit = true; - } - break; - case 0xb2: //change border color - if (!pChip.bHit && time < 0) { - pChip.bHit = true; - OpenTaiko.borderColor = pChip.borderColor; - } - break; - case 0xb3: //set camera x offset - if (!pChip.bHit && time < 0) { - pChip.bHit = true; - - this.currentCamHMoveChip = pChip; - this.ctCamHMove = new CCounter(0, 0, 1, OpenTaiko.Timer); - } - break; - case 0xb4: //set camera y offset - if (!pChip.bHit && time < 0) { - pChip.bHit = true; - - this.currentCamVMoveChip = pChip; - this.ctCamVMove = new CCounter(0, 0, 1, OpenTaiko.Timer); - } - break; - case 0xb5: //set camera zoom factor - if (!pChip.bHit && time < 0) { - pChip.bHit = true; - - this.currentCamZoomChip = pChip; - this.ctCamZoom = new CCounter(0, 0, 1, OpenTaiko.Timer); - } - break; - case 0xb6: //set camera rotation - if (!pChip.bHit && time < 0) { - pChip.bHit = true; - - this.currentCamRotateChip = pChip; - this.ctCamRotation = new CCounter(0, 0, 1, OpenTaiko.Timer); - } - break; - case 0xb7: //set camera x scale - if (!pChip.bHit && time < 0) { - pChip.bHit = true; - - this.currentCamHScaleChip = pChip; - this.ctCamHScale = new CCounter(0, 0, 1, OpenTaiko.Timer); - } - break; - case 0xb8: //set camera y scale - if (!pChip.bHit && time < 0) { - pChip.bHit = true; - - this.currentCamVScaleChip = pChip; - this.ctCamVScale = new CCounter(0, 0, 1, OpenTaiko.Timer); - } - break; - case 0xb9: //reset camera - if (!pChip.bHit && time < 0) { - pChip.bHit = true; - - OpenTaiko.borderColor = new Color4(0f, 0f, 0f, 0f); - - this.currentCamVMoveChip = pChip; - this.currentCamHMoveChip = pChip; - - this.currentCamZoomChip = pChip; - this.currentCamRotateChip = pChip; - - this.currentCamVScaleChip = pChip; - this.currentCamHScaleChip = pChip; - - this.ctCamVMove = new CCounter(0, 0, 1, OpenTaiko.Timer); - this.ctCamHMove = new CCounter(0, 0, 1, OpenTaiko.Timer); - - this.ctCamZoom = new CCounter(0, 0, 1, OpenTaiko.Timer); - this.ctCamRotation = new CCounter(0, 0, 1, OpenTaiko.Timer); - - this.ctCamVScale = new CCounter(0, 0, 1, OpenTaiko.Timer); - this.ctCamHScale = new CCounter(0, 0, 1, OpenTaiko.Timer); - } - break; - case 0xba: //enable doron - if (!pChip.bHit && time < 0) { - pChip.bHit = true; - bCustomDoron = true; - } - break; - case 0xbb: //disable doron - if (!pChip.bHit && time < 0) { - pChip.bHit = true; - bCustomDoron = false; - } - break; - case 0xbc: //add object - if (!pChip.bHit && time < 0) { - pChip.bHit = true; - - dTX.listObj.TryGetValue(pChip.strObjName, out CSongObject obj); - obj.x = pChip.fObjX; - obj.y = pChip.fObjY; - obj.isVisible = true; - } - break; - case 0xbd: //remove object - if (!pChip.bHit && time < 0) { - pChip.bHit = true; - - dTX.listObj.TryGetValue(pChip.strObjName, out CSongObject obj); - obj.isVisible = false; - } - break; - case 0xbe: //object animation start - case 0xc0: - case 0xc2: - case 0xc4: - case 0xc6: - case 0xc8: - if (!pChip.bHit && time < 0) { - pChip.bHit = true; - - dTX.listObj.TryGetValue(pChip.strObjName, out pChip.obj); - objHandlers.Add(pChip, new CCounter(0, pChip.fObjTimeMs, 1, OpenTaiko.Timer)); - } - break; - case 0xbf: //object animation end - case 0xc1: - case 0xc3: - case 0xc5: - case 0xc7: - case 0xc9: - if (!pChip.bHit && time < 0) { - pChip.bHit = true; - } - break; - case 0xca: //set object color - if (!pChip.bHit && time < 0) { - pChip.bHit = true; - - dTX.listObj.TryGetValue(pChip.strObjName, out CSongObject obj); - obj.color = pChip.borderColor; - } - break; - case 0xcb: //set object y - case 0xcc: //set object x - case 0xcd: //set object vertical scale - case 0xce: //set object horizontal scale - case 0xcf: //set object rotation - case 0xd0: //set object opacity - if (!pChip.bHit && time < 0) { - pChip.bHit = true; - - dTX.listObj.TryGetValue(pChip.strObjName, out pChip.obj); - objHandlers.Add(pChip, new CCounter(0, 0, 1, OpenTaiko.Timer)); - } - break; - case 0xd1: //change texture - if (!pChip.bHit && time < 0) { - pChip.bHit = true; - - if (OpenTaiko.Tx.trackedTextures.ContainsKey(pChip.strTargetTxName)) { - OpenTaiko.Tx.trackedTextures.TryGetValue(pChip.strTargetTxName, out CTexture oldTx); - dTX.listTextures.TryGetValue(pChip.strNewPath, out CTexture newTx); - - newTx.Opacity = oldTx.Opacity; - newTx.fZ軸中心回転 = oldTx.fZ軸中心回転; - newTx.vcScaleRatio = oldTx.vcScaleRatio; - - oldTx.UpdateTexture(newTx, newTx.sz画像サイズ.Width, newTx.sz画像サイズ.Height); - } - } - break; - case 0xd2: //reset texture - if (!pChip.bHit && time < 0) { - pChip.bHit = true; - - if (OpenTaiko.Tx.trackedTextures.ContainsKey(pChip.strTargetTxName)) { - OpenTaiko.Tx.trackedTextures.TryGetValue(pChip.strTargetTxName, out CTexture oldTx); - dTX.listOriginalTextures.TryGetValue(pChip.strTargetTxName, out CTexture originalTx); - - originalTx.Opacity = oldTx.Opacity; - originalTx.fZ軸中心回転 = oldTx.fZ軸中心回転; - originalTx.vcScaleRatio = oldTx.vcScaleRatio; - - oldTx.UpdateTexture(originalTx, originalTx.sz画像サイズ.Width, originalTx.sz画像サイズ.Height); - } - } - break; - case 0xd3: //set config - if (!pChip.bHit && time < 0) { - pChip.bHit = true; - string[] split = pChip.strConfigValue.Split('='); - - //TJAPlayer3.Skin.t文字列から読み込み(pChip.strConfigValue, split[0]); - bConfigUpdated = true; - } - break; - case 0xd4: //start object animation - if (!pChip.bHit && time < 0) { - pChip.bHit = true; - dTX.listObj.TryGetValue(pChip.strObjName, out CSongObject obj); - - obj.tStartAnimation(pChip.dbAnimInterval, false); - } - break; - case 0xd5: //start object animation (looping) - if (!pChip.bHit && time < 0) { - pChip.bHit = true; - dTX.listObj.TryGetValue(pChip.strObjName, out CSongObject obj); - - obj.tStartAnimation(pChip.dbAnimInterval, true); - } - break; - case 0xd6: //end object animation - if (!pChip.bHit && time < 0) { - pChip.bHit = true; - dTX.listObj.TryGetValue(pChip.strObjName, out CSongObject obj); - - obj.tStopAnimation(); - } - break; - case 0xd7: //set object frame - if (!pChip.bHit && time < 0) { - pChip.bHit = true; - dTX.listObj.TryGetValue(pChip.strObjName, out CSongObject obj); - - obj.frame = pChip.intFrame; - } - break; - #endregion - - #region [ d8-d9: EXTENDED2 ] - case 0xd8: - if (!pChip.bHit && time < 0) { - OpenTaiko.ConfigIni.nGameType[nPlayer] = pChip.eGameType; - pChip.bHit = true; - } - break; - case 0xd9: - if (!pChip.bHit && time < 0) { - bSplitLane[nPlayer] = true; - pChip.bHit = true; - } - break; - #endregion - - #region [ da: ミキサーへチップ音追加 ] - case 0xDA: - if (!pChip.bHit && time < 0) { - //Debug.WriteLine( "[DA(AddMixer)] BAR=" + pChip.n発声位置 / 384 + " ch=" + pChip.nチャンネル番号.ToString( "x2" ) + ", wav=" + pChip.n整数値.ToString( "x2" ) + ", time=" + pChip.n発声時刻ms ); - pChip.bHit = true; - if (listWAV.TryGetValue(pChip.n整数値_内部番号, out CDTX.CWAV wc)) // 参照が遠いので後日最適化する - { - for (int i = 0; i < nPolyphonicSounds; i++) { - if (wc.rSound[i] != null) { - //CDTXMania.Sound管理.AddMixer( wc.rSound[ i ] ); - AddMixer(wc.rSound[i], pChip.b演奏終了後も再生が続くチップである); - } - } - } - } - break; - #endregion - #region [ db: ミキサーからチップ音削除 ] - case 0xDB: - if (!pChip.bHit && time < 0) { - //Debug.WriteLine( "[DB(RemoveMixer)] BAR=" + pChip.n発声位置 / 384 + " ch=" + pChip.nチャンネル番号.ToString( "x2" ) + ", wav=" + pChip.n整数値.ToString( "x2" ) + ", time=" + pChip.n発声時刻ms ); - pChip.bHit = true; - if (listWAV.TryGetValue(pChip.n整数値_内部番号, out CDTX.CWAV wc)) // 参照が遠いので後日最適化する - { - for (int i = 0; i < nPolyphonicSounds; i++) { - if (wc.rSound[i] != null) { - //CDTXMania.Sound管理.RemoveMixer( wc.rSound[ i ] ); - if (!wc.rSound[i].b演奏終了後も再生が続くチップである) // #32248 2013.10.16 yyagi - { // DTX終了後も再生が続くチップの0xDB登録をなくすことはできず。 - RemoveMixer(wc.rSound[i]); // (ミキサー解除のタイミングが遅延する場合の対応が面倒なので。) - } // そこで、代わりにフラグをチェックしてミキサー削除ロジックへの遷移をカットする。 - } - } - } - } - break; - #endregion - - #region[ dc-df:太鼓(特殊命令) ] - case 0xDC: //DELAY - if (!pChip.bHit && time < 0) { - pChip.bHit = true; - //if ( dTX.listDELAY.ContainsKey( pChip.n整数値_内部番号 ) ) - //{ - //this.actPlayInfo.dbBPM = ( dTX.listBPM[ pChip.n整数値_内部番号 ].dbBPM値 * ( ( (double) configIni.n演奏速度 ) / 20.0 ) );// + dTX.BASEBPM; - //} - } - break; - case 0xDD: //SECTION - if (!pChip.bHit && time < 0) { - // 分岐毎にリセットしていたのでSECTIONの命令が来たらリセットする。 - this.tBranchReset(nPlayer); - pChip.bHit = true; - } - break; - - case 0xDE: //Judgeに応じたCourseを取得 - if (!pChip.bHit && time < 0) { - this.b強制分岐譜面[nPlayer] = false; - //分岐の種類はプレイヤー関係ないと思う - this.eBranch種類 = pChip.e分岐の種類; - this.nBranch条件数値A = pChip.n条件数値A; - this.nBranch条件数値B = pChip.n条件数値B; - if (!this.bLEVELHOLD[nPlayer]) { - //成仏2000にある-2,-1だったら達人に強制分岐みたいな。 - this.t強制用条件かを判断する(pChip.n条件数値A, pChip.n条件数値B, nPlayer); - - OpenTaiko.stage演奏ドラム画面.bUseBranch[nPlayer] = true; - - CBRANCHSCORE branchScore; - if (OpenTaiko.ConfigIni.bAIBattleMode) { - branchScore = this.CBranchScore[0]; - } else { - branchScore = this.CBranchScore[nPlayer]; - } - this.tBranchJudge(pChip, branchScore.cBigNotes, branchScore.nScore, branchScore.nRoll, branchScore.nGreat, branchScore.nGood, branchScore.nMiss, nPlayer); - - if (this.b強制分岐譜面[nPlayer])//強制分岐譜面だったら次回コースをそのコースにセット - this.n次回のコース[nPlayer] = this.E強制コース[nPlayer]; - - this.t分岐処理(this.n次回のコース[nPlayer], nPlayer, pChip.n分岐時刻ms, pChip.e分岐の種類); - - OpenTaiko.stage演奏ドラム画面.actLaneTaiko.t分岐レイヤー_コース変化(OpenTaiko.stage演奏ドラム画面.actLaneTaiko.stBranch[nPlayer].nAfter, this.n次回のコース[nPlayer], nPlayer); - OpenTaiko.stage演奏ドラム画面.actMtaiko.tBranchEvent(OpenTaiko.stage演奏ドラム画面.actMtaiko.After[nPlayer], this.n次回のコース[nPlayer], nPlayer); - this.n現在のコース[nPlayer] = this.n次回のコース[nPlayer]; - } - this.n分岐した回数[nPlayer]++; - pChip.bHit = true; - } - break; - case 0x52://End処理 - if (!pChip.bHit && time < 0) { - - pChip.bHit = true; - } - - break; - case 0xE0: - //if( !pChip.bHit && time < 0 ) - //{ - //#BARLINEONと#BARLINEOFF - //演奏中は使用しません。 - //} - break; - case 0xE1: - if (!pChip.bHit && time < 0) { - //LEVELHOLD - this.bLEVELHOLD[nPlayer] = true; - } - break; - case 0xE2: - if (!pChip.bHit && time < 0) { - OpenTaiko.stage演奏ドラム画面.actLaneTaiko.t判定枠移動(dTX.listJPOSSCROLL[nJPOSSCROLL[nPlayer]].db移動時間, dTX.listJPOSSCROLL[nJPOSSCROLL[nPlayer]].n移動距離px, dTX.listJPOSSCROLL[nJPOSSCROLL[nPlayer]].n移動方向, nPlayer, dTX.listJPOSSCROLL[nJPOSSCROLL[nPlayer]].nVerticalMove); - this.nJPOSSCROLL[nPlayer]++; - pChip.bHit = true; - } - break; - #endregion - #region[ f1: 歌詞 ] - case 0xF1: - if (!pChip.bHit && time < 0) { - if (OpenTaiko.ConfigIni.nPlayerCount == 1) { - if (dTX.listLyric.Count > ShownLyric[nPlayer] && dTX.nPlayerSide == nPlayer) { - this.actPanel.t歌詞テクスチャを生成する(dTX.listLyric[ShownLyric[nPlayer]]); - ShownLyric[nPlayer]++; - } - } - pChip.bHit = true; - } - break; - #endregion - #region[ ff: 譜面の強制終了 ] - //バグで譜面がとてつもないことになっているため、#ENDがきたらこれを差し込む。 - case 0xFF: - if (!pChip.bHit && time < 0) { - if (OpenTaiko.ConfigIni.bTokkunMode) { - foreach (CDTX.CWAV cwav in OpenTaiko.DTX.listWAV.Values) { - for (int i = 0; i < nPolyphonicSounds; i++) { - if ((cwav.rSound[i] != null) && cwav.rSound[i].IsPlaying) { - return false; + if (actChara.CharaAction_Balloon_Delay[nPlayer] != null) actChara.CharaAction_Balloon_Delay[nPlayer] = new CCounter(0, + OpenTaiko.Skin.Characters_Balloon_Delay[actChara.iCurrentCharacter[nPlayer]] - 1, + 1, + OpenTaiko.Timer); } } } - } - pChip.bHit = true; - return true; - } - break; - #endregion + if (chip現在処理中の連打チップ[nPlayer].nBalloon > chip現在処理中の連打チップ[nPlayer].nRollCount) { + if (pChip.n連打音符State == 13) { + this.actJudgeString.Start(nPlayer, ENoteJudge.Mine); + OpenTaiko.stage演奏ドラム画面.actLaneTaiko.Start(0x11, ENoteJudge.Bad, true, nPlayer); + OpenTaiko.stage演奏ドラム画面.actChipFireD.Start(0x11, ENoteJudge.Mine, nPlayer); + actGauge.MineDamage(nPlayer); + OpenTaiko.Skin.soundBomb?.tPlay(); + this.CChartScore[nPlayer].nMine++; + this.CSectionScore[nPlayer].nMine++; + this.CBranchScore[nPlayer].nMine++; + if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Tower) + CFloorManagement.damage(); + if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) + this.nMine[actDan.NowShowingNumber]++; + this.actCombo.n現在のコンボ数[nPlayer] = 0; + if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) + this.nCombo[actDan.NowShowingNumber] = 0; + this.actComboVoice.tReset(nPlayer); + this.bIsMiss[nPlayer] = true; + } + } + chip現在処理中の連打チップ[nPlayer] = null; - #region [ d8-d9: EXTENDED2 ] - case 0xe3: - if (!pChip.bHit && time < 0) { - bSplitLane[nPlayer] = false; - pChip.bHit = true; + } + this.eRollState = ERollState.None; } - break; - case 0xe4: + if (pChip.n描画優先度 <= 0) + this.t進行描画_チップ_Taiko連打(configIni, ref dTX, ref pChip, nPlayer); + } + + break; + + case 0x1e: + break; + + case 0x1a: + case 0x1b: + case 0x1f: { + this.t進行描画_チップ_Taiko(configIni, ref dTX, ref pChip, nPlayer); + } + break; + #endregion + #region [ 20-2F: EmptySlot ] + case 0x20: + case 0x21: { + if ((pChip.n発声時刻ms <= (int)n現在時刻ms && pChip.nノーツ終了時刻ms >= (int)n現在時刻ms)) { + //if( this.n現在のコース == pChip.nコース ) + if (pChip.b可視 == true) + this.chip現在処理中の連打チップ[nPlayer] = pChip; + } + if (pChip.n描画優先度 <= 0) + this.t進行描画_チップ_Taiko連打(configIni, ref dTX, ref pChip, nPlayer); + } + break; + case 0x22: + case 0x23: + case 0x24: + case 0x25: + case 0x26: + case 0x27: + case 0x28: + case 0x29: + case 0x2a: + case 0x2b: + case 0x2c: + case 0x2d: + case 0x2e: + case 0x2f: + break; + #endregion + #region [ 31-3f: EmptySlot ] + case 0x31: + case 0x32: + case 0x33: + case 0x34: + case 0x35: + case 0x36: + case 0x37: + case 0x38: + case 0x39: + case 0x3a: + case 0x3b: + case 0x3c: + case 0x3d: + case 0x3e: + case 0x3f: + break; + #endregion + + #region [ 50: 小節線 ] + case 0x50: // 小節線 + { + if (!pChip.bHit && time < 0) { + //if (nPlayer == 0) TJAPlayer3.BeatScaling = new CCounter(0, 1000, 120.0 / pChip.dbBPM / 2.0, TJAPlayer3.Timer); + if (NowAIBattleSectionTime >= NowAIBattleSection.Length && NowAIBattleSection.End == AIBattleSection.EndType.None && nPlayer == 0) { + PassAIBattleSection(); + + NowAIBattleSectionCount++; + + if (AIBattleSections.Count > NowAIBattleSectionCount) { + NowAIBattleSectionTime = 0; + } + NowAIBattleSectionTime = (int)n現在時刻ms - NowAIBattleSection.StartTime; + } + + + this.actChara.b演奏中[nPlayer] = true; + if (this.actPlayInfo.NowMeasure[nPlayer] == 0) { + UpdateCharaCounter(nPlayer); + } + if (!bPAUSE)//2020.07.08 Mr-Ojii KabanFriends氏のコードを参考に + { + actPlayInfo.NowMeasure[nPlayer] = pChip.n整数値_内部番号; + } pChip.bHit = true; } this.t進行描画_チップ_小節線(configIni, ref dTX, ref pChip, nPlayer); break; - case 0x09: - if (!pChip.bHit && time < 0) { - - pChip.bHit = true; - } - break; - case 0x0A: - if (!pChip.bHit && time < 0) { - - pChip.bHit = true; - } - break; - case 0x0B: - if (!pChip.bHit && time < 0) { - - pChip.bHit = true; - } - break; - #endregion - - #region [ その他(未定義) ] - default: - if (!pChip.bHit && time < 0) { - pChip.bHit = true; - } - break; - #endregion - } - - } - - - #region [ EXTENDED CONTROLS ] - if (ctCamVMove != null) //vertical camera move - { - ctCamVMove.Tick(); - float value = 0.0f; - if (currentCamVMoveChip.strCamEaseType.Equals("IN")) value = easing.EaseIn(ctCamVMove, currentCamVMoveChip.fCamScrollStartY, currentCamVMoveChip.fCamScrollEndY, currentCamVMoveChip.fCamMoveType); - if (currentCamVMoveChip.strCamEaseType.Equals("OUT")) value = easing.EaseOut(ctCamVMove, currentCamVMoveChip.fCamScrollStartY, currentCamVMoveChip.fCamScrollEndY, currentCamVMoveChip.fCamMoveType); - if (currentCamVMoveChip.strCamEaseType.Equals("IN_OUT")) value = easing.EaseInOut(ctCamVMove, currentCamVMoveChip.fCamScrollStartY, currentCamVMoveChip.fCamScrollEndY, currentCamVMoveChip.fCamMoveType); - OpenTaiko.fCamYOffset = float.IsNaN(value) ? currentCamVMoveChip.fCamScrollStartY : value; - - if (ctCamVMove.IsEnded) { - ctCamVMove = null; - OpenTaiko.fCamYOffset = currentCamVMoveChip.fCamScrollEndY; - } - } - - if (ctCamHMove != null) //horizontal camera move - { - ctCamHMove.Tick(); - float value = 0.0f; - if (currentCamHMoveChip.strCamEaseType.Equals("IN")) value = easing.EaseIn(ctCamHMove, currentCamHMoveChip.fCamScrollStartX, currentCamHMoveChip.fCamScrollEndX, currentCamHMoveChip.fCamMoveType); - if (currentCamHMoveChip.strCamEaseType.Equals("OUT")) value = easing.EaseOut(ctCamHMove, currentCamHMoveChip.fCamScrollStartX, currentCamHMoveChip.fCamScrollEndX, currentCamHMoveChip.fCamMoveType); - if (currentCamHMoveChip.strCamEaseType.Equals("IN_OUT")) value = easing.EaseInOut(ctCamHMove, currentCamHMoveChip.fCamScrollStartX, currentCamHMoveChip.fCamScrollEndX, currentCamHMoveChip.fCamMoveType); - OpenTaiko.fCamXOffset = float.IsNaN(value) ? currentCamHMoveChip.fCamScrollStartX : value; - - if (ctCamHMove.IsEnded) { - ctCamHMove = null; - OpenTaiko.fCamXOffset = currentCamHMoveChip.fCamScrollEndX; - } - } - - if (ctCamZoom != null) //camera zoom - { - ctCamZoom.Tick(); - float value = 0.0f; - if (currentCamZoomChip.strCamEaseType.Equals("IN")) value = easing.EaseIn(ctCamZoom, currentCamZoomChip.fCamZoomStart, currentCamZoomChip.fCamZoomEnd, currentCamZoomChip.fCamMoveType); - if (currentCamZoomChip.strCamEaseType.Equals("OUT")) value = easing.EaseOut(ctCamZoom, currentCamZoomChip.fCamZoomStart, currentCamZoomChip.fCamZoomEnd, currentCamZoomChip.fCamMoveType); - if (currentCamZoomChip.strCamEaseType.Equals("IN_OUT")) value = easing.EaseInOut(ctCamZoom, currentCamZoomChip.fCamZoomStart, currentCamZoomChip.fCamZoomEnd, currentCamZoomChip.fCamMoveType); - OpenTaiko.fCamZoomFactor = float.IsNaN(value) ? currentCamZoomChip.fCamZoomStart : value; - - if (ctCamZoom.IsEnded) { - ctCamZoom = null; - OpenTaiko.fCamZoomFactor = currentCamZoomChip.fCamZoomEnd; - } - } - - if (ctCamRotation != null) //camera rotation - { - ctCamRotation.Tick(); - float value = 0.0f; - if (currentCamRotateChip.strCamEaseType.Equals("IN")) value = easing.EaseIn(ctCamRotation, currentCamRotateChip.fCamRotationStart, currentCamRotateChip.fCamRotationEnd, currentCamRotateChip.fCamMoveType); - if (currentCamRotateChip.strCamEaseType.Equals("OUT")) value = easing.EaseOut(ctCamRotation, currentCamRotateChip.fCamRotationStart, currentCamRotateChip.fCamRotationEnd, currentCamRotateChip.fCamMoveType); - if (currentCamRotateChip.strCamEaseType.Equals("IN_OUT")) value = easing.EaseInOut(ctCamRotation, currentCamRotateChip.fCamRotationStart, currentCamRotateChip.fCamRotationEnd, currentCamRotateChip.fCamMoveType); - OpenTaiko.fCamRotation = float.IsNaN(value) ? currentCamRotateChip.fCamRotationStart : value; - - if (ctCamRotation.IsEnded) { - ctCamRotation = null; - OpenTaiko.fCamRotation = currentCamRotateChip.fCamRotationEnd; - } - } - - if (ctCamVScale != null) //vertical camera scaling - { - ctCamVScale.Tick(); - float value = 0.0f; - if (currentCamVScaleChip.strCamEaseType.Equals("IN")) value = easing.EaseIn(ctCamVScale, currentCamVScaleChip.fCamScaleStartY, currentCamVScaleChip.fCamScaleEndY, currentCamVScaleChip.fCamMoveType); - if (currentCamVScaleChip.strCamEaseType.Equals("OUT")) value = easing.EaseOut(ctCamVScale, currentCamVScaleChip.fCamScaleStartY, currentCamVScaleChip.fCamScaleEndY, currentCamVScaleChip.fCamMoveType); - if (currentCamVScaleChip.strCamEaseType.Equals("IN_OUT")) value = easing.EaseInOut(ctCamVScale, currentCamVScaleChip.fCamScaleStartY, currentCamVScaleChip.fCamScaleEndY, currentCamVScaleChip.fCamMoveType); - OpenTaiko.fCamYScale = float.IsNaN(value) ? currentCamVScaleChip.fCamScaleStartY : value; - - if (ctCamVScale.IsEnded) { - ctCamVScale = null; - OpenTaiko.fCamYScale = currentCamVScaleChip.fCamScaleEndY; - } - } - - if (ctCamHScale != null) //horizontal camera scaling - { - ctCamHScale.Tick(); - float value = 0.0f; - if (currentCamHScaleChip.strCamEaseType.Equals("IN")) value = easing.EaseIn(ctCamHScale, currentCamHScaleChip.fCamScaleStartX, currentCamHScaleChip.fCamScaleEndX, currentCamHScaleChip.fCamMoveType); - if (currentCamHScaleChip.strCamEaseType.Equals("OUT")) value = easing.EaseOut(ctCamHScale, currentCamHScaleChip.fCamScaleStartX, currentCamHScaleChip.fCamScaleEndX, currentCamHScaleChip.fCamMoveType); - if (currentCamHScaleChip.strCamEaseType.Equals("IN_OUT")) value = easing.EaseInOut(ctCamHScale, currentCamHScaleChip.fCamScaleStartX, currentCamHScaleChip.fCamScaleEndX, currentCamHScaleChip.fCamMoveType); - OpenTaiko.fCamXScale = float.IsNaN(value) ? currentCamHScaleChip.fCamScaleStartX : value; - - if (ctCamHScale.IsEnded) { - ctCamHScale = null; - OpenTaiko.fCamXScale = currentCamHScaleChip.fCamScaleEndX; - } - } - - foreach (KeyValuePair pair in objHandlers) { - CDTX.CChip chip = pair.Key; - CCounter counter = pair.Value; - - if (counter != null) { - counter.Tick(); - - float value = 0.0f; - if (counter.IsEnded) { - value = chip.fObjEnd; - counter = null; - } else { - if (chip.strObjEaseType.Equals("IN")) value = easing.EaseIn(counter, chip.fObjStart, chip.fObjEnd, chip.objCalcType); - if (chip.strObjEaseType.Equals("OUT")) value = easing.EaseOut(counter, chip.fObjStart, chip.fObjEnd, chip.objCalcType); - if (chip.strObjEaseType.Equals("IN_OUT")) value = easing.EaseInOut(counter, chip.fObjStart, chip.fObjEnd, chip.objCalcType); - value = float.IsNaN(value) ? chip.fObjStart : value; } - - if (chip.nチャンネル番号 == 0xBE) chip.obj.y = value; - if (chip.nチャンネル番号 == 0xC0) chip.obj.x = value; - if (chip.nチャンネル番号 == 0xC2) chip.obj.yScale = value; - if (chip.nチャンネル番号 == 0xC4) chip.obj.xScale = value; - if (chip.nチャンネル番号 == 0xC6) chip.obj.rotation = value; - if (chip.nチャンネル番号 == 0xC8) chip.obj.opacity = (int)value; - - if (chip.nチャンネル番号 == 0xCB) chip.obj.y = value; - if (chip.nチャンネル番号 == 0xCC) chip.obj.x = value; - if (chip.nチャンネル番号 == 0xCD) chip.obj.yScale = value; - if (chip.nチャンネル番号 == 0xCE) chip.obj.xScale = value; - if (chip.nチャンネル番号 == 0xCF) chip.obj.rotation = value; - if (chip.nチャンネル番号 == 0xD0) chip.obj.opacity = (int)value; - } - } - #endregion - - return false; - } - - protected bool t進行描画_チップ_連打(EInstrumentPad ePlayMode, int nPlayer) { - if ((base.ePhaseID == CStage.EPhase.Game_STAGE_FAILED) || (base.ePhaseID == CStage.EPhase.Game_STAGE_FAILED_FadeOut)) { - return true; - } - if ((this.n現在のトップChip == -1) || (this.n現在のトップChip >= listChip[nPlayer].Count)) { - return true; - } - - CConfigIni configIni = OpenTaiko.ConfigIni; - - CDTX dTX = OpenTaiko.DTX; - bool bAutoPlay = configIni.bAutoPlay[nPlayer]; - switch (nPlayer) //2017.08.11 kairera0467 - { - case 1: - bAutoPlay = configIni.bAutoPlay[nPlayer] || OpenTaiko.ConfigIni.bAIBattleMode; - dTX = OpenTaiko.DTX_2P; + #endregion + #region [ 51: 拍線 ] + case 0x51: // 拍線 + if (!pChip.bHit && time < 0) { + pChip.bHit = true; + } break; - case 2: - dTX = OpenTaiko.DTX_3P; - break; - case 3: - dTX = OpenTaiko.DTX_4P; - break; - case 4: - dTX = OpenTaiko.DTX_5P; - break; - default: - break; - } - - var n現在時刻ms = (long)(SoundManager.PlayTimer.NowTime * OpenTaiko.ConfigIni.SongPlaybackSpeed); - - //for ( int nCurrentTopChip = this.n現在のトップChip; nCurrentTopChip < dTX.listChip.Count; nCurrentTopChip++ ) - for (int nCurrentTopChip = dTX.listChip.Count - 1; nCurrentTopChip > 0; nCurrentTopChip--) { - CDTX.CChip pChip = dTX.listChip[nCurrentTopChip]; - - if (!pChip.bHit) { - bool bRollChip = NotesManager.IsGenericRoll(pChip);// pChip.nチャンネル番号 >= 0x15 && pChip.nチャンネル番号 <= 0x19; - if (bRollChip && ((pChip.e楽器パート != EInstrumentPad.Unknown))) { - int instIndex = (int)pChip.e楽器パート; - if (pChip.nバーからの距離dot[instIndex] < -40) { - if (this.e指定時刻からChipのJUDGEを返す(n現在時刻ms, pChip, nPlayer) == ENoteJudge.Miss) { - this.tチップのヒット処理(n現在時刻ms, pChip, EInstrumentPad.Taiko, false, 0, nPlayer); + #endregion + #region [ 54: 動画再生 ] + case 0x54: // 動画再生 + if (!pChip.bHit && time < 0) { + pChip.bHit = true; + if (configIni.bEnableAVI) { + if ((dTX.listVD.TryGetValue(pChip.n整数値_内部番号, out CVideoDecoder vd))) { + ShowVideo = true; + if (OpenTaiko.ConfigIni.bEnableAVI && vd != null) { + this.actAVI.Start(pChip.nチャンネル番号, vd); + this.actAVI.Seek(pChip.VideoStartTimeMs); + } } } } - } + break; + case 0x55: + if (!pChip.bHit && time < 0) { + pChip.bHit = true; + if (configIni.bEnableAVI) { + if ((dTX.listVD.TryGetValue(pChip.n整数値_内部番号, out CVideoDecoder vd))) { + ShowVideo = false; + if (OpenTaiko.ConfigIni.bEnableAVI && vd != null) { + this.actAVI.Stop(); + } + } - switch (pChip.nチャンネル番号) { - #region[ 15-19: Rolls ] - case 0x15: //連打 - case 0x16: //連打(大) - case 0x17: //風船 - case 0x18: //連打終了 - case 0x19: - case 0x1D: - case 0x20: - case 0x21: { - if (pChip.n描画優先度 >= 1) - this.t進行描画_チップ_Taiko連打(configIni, ref dTX, ref pChip, nPlayer); + if ((dTX.listVD.TryGetValue(1, out CVideoDecoder vd2))) { + ShowVideo = true; + if (OpenTaiko.ConfigIni.bEnableAVI && vd != null) { + this.actAVI.Start(pChip.nチャンネル番号, vd); + } + } } - break; - #endregion - } + } + break; + #endregion + #region[ 55-60: EmptySlot ] + case 0x56: + case 0x57: + case 0x58: + case 0x59: + break; + #endregion + #region [ 61-89: EmptySlot ] + case 0x60: + case 0x61: + case 0x62: + case 0x63: + case 0x64: + case 0x65: + case 0x66: + case 0x67: + case 0x68: + case 0x69: + case 0x70: + case 0x71: + case 0x72: + case 0x73: + case 0x74: + case 0x75: + case 0x76: + case 0x77: + case 0x78: + case 0x79: + case 0x80: + case 0x81: + case 0x82: + case 0x83: + case 0x84: + case 0x85: + case 0x86: + case 0x87: + case 0x88: + case 0x89: + break; + #endregion + #region[ 90-9A: EmptySlot ] + case 0x90: + case 0x91: + case 0x92: + case 0x93: + case 0x94: + case 0x95: + case 0x96: + case 0x97: + case 0x98: + case 0x99: + case 0x9A: + break; + #endregion + + #region[ 9B-9F: 太鼓 ] + case 0x9B: + // 段位認定モードの幕アニメーション + if (!pChip.bHit && time < 0) { + pChip.bHit = true; + this.actPanel.t歌詞テクスチャを削除する(); + if (pChip.nコース == this.n現在のコース[nPlayer]) { + this.actDan.Update(); + if (ListDan_Number != 0 && actDan.FirstSectionAnime) { + if (this.actDan.GetFailedAllChallenges()) { + this.n現在のトップChip = OpenTaiko.DTX.listChip.Count - 1; // 終端にシーク + IsDanFailed = true; + return true; + } + + // Play next song here + this.actDan.Start(this.ListDan_Number); + ListDan_Number++; + } else { + actDan.FirstSectionAnime = true; + } + } + } + break; + //0x9C BPM変化(アニメーション用) + case 0x9C: + //CDTXMania.act文字コンソール.tPrint( 414 + pChip.nバーからの距離dot.Taiko + 8, 192, C文字コンソール.Eフォント種別.白, "BPMCHANGE" ); + if (!pChip.bHit && time < 0) { + pChip.bHit = true; + if (pChip.nコース == this.n現在のコース[nPlayer]) { + if (dTX.listBPM.TryGetValue(pChip.n整数値_内部番号, out CDTX.CBPM cBPM)) { + this.actPlayInfo.dbBPM[nPlayer] = cBPM.dbBPM値;// + dTX.BASEBPM; + } + + + for (int i = 0; i < 5; i++) { + ctChipAnime[i] = new CCounter(0, 3, 60.0 / OpenTaiko.stage演奏ドラム画面.actPlayInfo.dbBPM[nPlayer] * 1 / 4, SoundManager.PlayTimer); + } + + UpdateCharaCounter(nPlayer); + //this.actDancer.ct踊り子モーション = new CCounter(0, this.actDancer.ar踊り子モーション番号.Length - 1, (dbUnit * CDTXMania.Skin.Game_Dancer_Beat) / this.actDancer.ar踊り子モーション番号.Length, CSound管理.rc演奏用タイマ); + //this.actChara.ctモブモーション = new CCounter(0, this.actChara.arモブモーション番号.Length - 1, (dbUnit) / this.actChara.arモブモーション番号.Length, CSound管理.rc演奏用タイマ); + //#if C_82D982F182AF82CD82A282AF82A2 + /* + * for( int dancer = 0; dancer < 5; dancer++ ) + this.actDancer.st投げ上げ[ dancer ].ct進行 = new CCounter( 0, this.actDancer.arモーション番号_登場.Length - 1, dbUnit / this.actDancer.arモーション番号_登場.Length, CSound管理.rc演奏用タイマ ); + + this.actDancer.ct通常モーション = new CCounter( 0, this.actDancer.arモーション番号_通常.Length - 1, ( dbUnit * 4 ) / this.actDancer.arモーション番号_通常.Length, CSound管理.rc演奏用タイマ ); + this.actDancer.ctモブ = new CCounter( 1.0, 16.0, (int)((60.0 / bpm / 16.0 ) * 1000 ), CSound管理.rc演奏用タイマ ); +//#endif + */ + } + + } + break; + + case 0x9D: //SCROLL + if (!pChip.bHit && time < 0) { + pChip.bHit = true; + //if ( dTX.listSCROLL.ContainsKey( pChip.n整数値_内部番号 ) ) + //{ + //this.actPlayInfo.dbBPM = ( dTX.listBPM[ pChip.n整数値_内部番号 ].dbBPM値 * ( ( (double) configIni.n演奏速度 ) / 20.0 ) );// + dTX.BASEBPM; + //} + } + break; + + case 0x9E: //ゴーゴータイム + if (!pChip.bHit && time < 0) { + pChip.bHit = true; + this.bIsGOGOTIME[nPlayer] = true; + //double dbUnit = (((60.0 / (CDTXMania.stage演奏ドラム画面.actPlayInfo.dbBPM)))); + double dbUnit = (((60.0 / pChip.dbBPM))); + + int Character = this.actChara.iCurrentCharacter[nPlayer]; + + { + if (OpenTaiko.Skin.Characters_GoGoStart_Ptn[Character] != 0 && actChara.CharaAction_Balloon_Delay[nPlayer].IsEnded) { + if (!HGaugeMethods.UNSAFE_IsRainbow(nPlayer) && (!HGaugeMethods.UNSAFE_FastNormaCheck(nPlayer) || OpenTaiko.Skin.Characters_GoGoStart_Clear_Ptn[Character] == 0)) { + // 魂ゲージMAXではない + // ゴーゴースタート_ノーマル + this.actChara.ChangeAnime(nPlayer, CActImplCharacter.Anime.GoGoStart, true); + //this.actChara.キャラクター_アクション_10コンボ(); + } + } + if (OpenTaiko.Skin.Characters_GoGoStart_Clear_Ptn[Character] != 0 && actChara.CharaAction_Balloon_Delay[nPlayer].IsEnded) { + if (!HGaugeMethods.UNSAFE_IsRainbow(nPlayer) && HGaugeMethods.UNSAFE_FastNormaCheck(nPlayer)) { + this.actChara.ChangeAnime(nPlayer, CActImplCharacter.Anime.GoGoStart_Clear, true); + } + } + if (OpenTaiko.Skin.Characters_GoGoStart_Maxed_Ptn[Character] != 0 && actChara.CharaAction_Balloon_Delay[nPlayer].IsEnded) { + if (HGaugeMethods.UNSAFE_IsRainbow(nPlayer)) { + // 魂ゲージMAX + // ゴーゴースタート_MAX + this.actChara.ChangeAnime(nPlayer, CActImplCharacter.Anime.GoGoStart_Max, true); + } + } + + } + OpenTaiko.stage演奏ドラム画面.actLaneTaiko.GOGOSTART(); + } + break; + case 0x9F: //ゴーゴータイム + if (!pChip.bHit && time < 0) { + pChip.bHit = true; + this.bIsGOGOTIME[nPlayer] = false; + } + break; + #endregion + + #region [ EXTENDED COMMANDS ] + case 0xa0: //camera vertical move start + if (!pChip.bHit && time < 0) { + pChip.bHit = true; + this.currentCamVMoveChip = pChip; + this.ctCamVMove = new CCounter(0, pChip.fCamTimeMs, 1, OpenTaiko.Timer); + } + break; + case 0xa1: //camera vertical move end + if (!pChip.bHit && time < 0) { + pChip.bHit = true; + } + break; + case 0xa2: //camera horizontal move start + if (!pChip.bHit && time < 0) { + pChip.bHit = true; + this.currentCamHMoveChip = pChip; + this.ctCamHMove = new CCounter(0, pChip.fCamTimeMs, 1, OpenTaiko.Timer); + } + break; + case 0xa3: //camera horizontal move end + if (!pChip.bHit && time < 0) { + pChip.bHit = true; + } + break; + case 0xa4: //camera zoom start + if (!pChip.bHit && time < 0) { + pChip.bHit = true; + this.currentCamZoomChip = pChip; + this.ctCamZoom = new CCounter(0, pChip.fCamTimeMs, 1, OpenTaiko.Timer); + } + break; + case 0xa5: //camera zoom end + if (!pChip.bHit && time < 0) { + pChip.bHit = true; + } + break; + case 0xa6: //camera rotation start + if (!pChip.bHit && time < 0) { + pChip.bHit = true; + this.currentCamRotateChip = pChip; + this.ctCamRotation = new CCounter(0, pChip.fCamTimeMs, 1, OpenTaiko.Timer); + } + break; + case 0xa7: //camera rotation end + if (!pChip.bHit && time < 0) { + pChip.bHit = true; + } + break; + case 0xa8: //camera vertical scaling start + if (!pChip.bHit && time < 0) { + pChip.bHit = true; + this.currentCamVScaleChip = pChip; + this.ctCamVScale = new CCounter(0, pChip.fCamTimeMs, 1, OpenTaiko.Timer); + } + break; + case 0xa9: //camera vertical scaling end + if (!pChip.bHit && time < 0) { + pChip.bHit = true; + } + break; + case 0xb0: //camera horizontal scaling start + if (!pChip.bHit && time < 0) { + pChip.bHit = true; + this.currentCamHScaleChip = pChip; + this.ctCamHScale = new CCounter(0, pChip.fCamTimeMs, 1, OpenTaiko.Timer); + } + break; + case 0xb1: //camera horizontal scaling end + if (!pChip.bHit && time < 0) { + pChip.bHit = true; + } + break; + case 0xb2: //change border color + if (!pChip.bHit && time < 0) { + pChip.bHit = true; + OpenTaiko.borderColor = pChip.borderColor; + } + break; + case 0xb3: //set camera x offset + if (!pChip.bHit && time < 0) { + pChip.bHit = true; + + this.currentCamHMoveChip = pChip; + this.ctCamHMove = new CCounter(0, 0, 1, OpenTaiko.Timer); + } + break; + case 0xb4: //set camera y offset + if (!pChip.bHit && time < 0) { + pChip.bHit = true; + + this.currentCamVMoveChip = pChip; + this.ctCamVMove = new CCounter(0, 0, 1, OpenTaiko.Timer); + } + break; + case 0xb5: //set camera zoom factor + if (!pChip.bHit && time < 0) { + pChip.bHit = true; + + this.currentCamZoomChip = pChip; + this.ctCamZoom = new CCounter(0, 0, 1, OpenTaiko.Timer); + } + break; + case 0xb6: //set camera rotation + if (!pChip.bHit && time < 0) { + pChip.bHit = true; + + this.currentCamRotateChip = pChip; + this.ctCamRotation = new CCounter(0, 0, 1, OpenTaiko.Timer); + } + break; + case 0xb7: //set camera x scale + if (!pChip.bHit && time < 0) { + pChip.bHit = true; + + this.currentCamHScaleChip = pChip; + this.ctCamHScale = new CCounter(0, 0, 1, OpenTaiko.Timer); + } + break; + case 0xb8: //set camera y scale + if (!pChip.bHit && time < 0) { + pChip.bHit = true; + + this.currentCamVScaleChip = pChip; + this.ctCamVScale = new CCounter(0, 0, 1, OpenTaiko.Timer); + } + break; + case 0xb9: //reset camera + if (!pChip.bHit && time < 0) { + pChip.bHit = true; + + OpenTaiko.borderColor = new Color4(0f, 0f, 0f, 0f); + + this.currentCamVMoveChip = pChip; + this.currentCamHMoveChip = pChip; + + this.currentCamZoomChip = pChip; + this.currentCamRotateChip = pChip; + + this.currentCamVScaleChip = pChip; + this.currentCamHScaleChip = pChip; + + this.ctCamVMove = new CCounter(0, 0, 1, OpenTaiko.Timer); + this.ctCamHMove = new CCounter(0, 0, 1, OpenTaiko.Timer); + + this.ctCamZoom = new CCounter(0, 0, 1, OpenTaiko.Timer); + this.ctCamRotation = new CCounter(0, 0, 1, OpenTaiko.Timer); + + this.ctCamVScale = new CCounter(0, 0, 1, OpenTaiko.Timer); + this.ctCamHScale = new CCounter(0, 0, 1, OpenTaiko.Timer); + } + break; + case 0xba: //enable doron + if (!pChip.bHit && time < 0) { + pChip.bHit = true; + bCustomDoron = true; + } + break; + case 0xbb: //disable doron + if (!pChip.bHit && time < 0) { + pChip.bHit = true; + bCustomDoron = false; + } + break; + case 0xbc: //add object + if (!pChip.bHit && time < 0) { + pChip.bHit = true; + + dTX.listObj.TryGetValue(pChip.strObjName, out CSongObject obj); + obj.x = pChip.fObjX; + obj.y = pChip.fObjY; + obj.isVisible = true; + } + break; + case 0xbd: //remove object + if (!pChip.bHit && time < 0) { + pChip.bHit = true; + + dTX.listObj.TryGetValue(pChip.strObjName, out CSongObject obj); + obj.isVisible = false; + } + break; + case 0xbe: //object animation start + case 0xc0: + case 0xc2: + case 0xc4: + case 0xc6: + case 0xc8: + if (!pChip.bHit && time < 0) { + pChip.bHit = true; + + dTX.listObj.TryGetValue(pChip.strObjName, out pChip.obj); + objHandlers.Add(pChip, new CCounter(0, pChip.fObjTimeMs, 1, OpenTaiko.Timer)); + } + break; + case 0xbf: //object animation end + case 0xc1: + case 0xc3: + case 0xc5: + case 0xc7: + case 0xc9: + if (!pChip.bHit && time < 0) { + pChip.bHit = true; + } + break; + case 0xca: //set object color + if (!pChip.bHit && time < 0) { + pChip.bHit = true; + + dTX.listObj.TryGetValue(pChip.strObjName, out CSongObject obj); + obj.color = pChip.borderColor; + } + break; + case 0xcb: //set object y + case 0xcc: //set object x + case 0xcd: //set object vertical scale + case 0xce: //set object horizontal scale + case 0xcf: //set object rotation + case 0xd0: //set object opacity + if (!pChip.bHit && time < 0) { + pChip.bHit = true; + + dTX.listObj.TryGetValue(pChip.strObjName, out pChip.obj); + objHandlers.Add(pChip, new CCounter(0, 0, 1, OpenTaiko.Timer)); + } + break; + case 0xd1: //change texture + if (!pChip.bHit && time < 0) { + pChip.bHit = true; + + if (OpenTaiko.Tx.trackedTextures.ContainsKey(pChip.strTargetTxName)) { + OpenTaiko.Tx.trackedTextures.TryGetValue(pChip.strTargetTxName, out CTexture oldTx); + dTX.listTextures.TryGetValue(pChip.strNewPath, out CTexture newTx); + + newTx.Opacity = oldTx.Opacity; + newTx.fZ軸中心回転 = oldTx.fZ軸中心回転; + newTx.vcScaleRatio = oldTx.vcScaleRatio; + + oldTx.UpdateTexture(newTx, newTx.sz画像サイズ.Width, newTx.sz画像サイズ.Height); + } + } + break; + case 0xd2: //reset texture + if (!pChip.bHit && time < 0) { + pChip.bHit = true; + + if (OpenTaiko.Tx.trackedTextures.ContainsKey(pChip.strTargetTxName)) { + OpenTaiko.Tx.trackedTextures.TryGetValue(pChip.strTargetTxName, out CTexture oldTx); + dTX.listOriginalTextures.TryGetValue(pChip.strTargetTxName, out CTexture originalTx); + + originalTx.Opacity = oldTx.Opacity; + originalTx.fZ軸中心回転 = oldTx.fZ軸中心回転; + originalTx.vcScaleRatio = oldTx.vcScaleRatio; + + oldTx.UpdateTexture(originalTx, originalTx.sz画像サイズ.Width, originalTx.sz画像サイズ.Height); + } + } + break; + case 0xd3: //set config + if (!pChip.bHit && time < 0) { + pChip.bHit = true; + string[] split = pChip.strConfigValue.Split('='); + + //TJAPlayer3.Skin.t文字列から読み込み(pChip.strConfigValue, split[0]); + bConfigUpdated = true; + } + break; + case 0xd4: //start object animation + if (!pChip.bHit && time < 0) { + pChip.bHit = true; + dTX.listObj.TryGetValue(pChip.strObjName, out CSongObject obj); + + obj.tStartAnimation(pChip.dbAnimInterval, false); + } + break; + case 0xd5: //start object animation (looping) + if (!pChip.bHit && time < 0) { + pChip.bHit = true; + dTX.listObj.TryGetValue(pChip.strObjName, out CSongObject obj); + + obj.tStartAnimation(pChip.dbAnimInterval, true); + } + break; + case 0xd6: //end object animation + if (!pChip.bHit && time < 0) { + pChip.bHit = true; + dTX.listObj.TryGetValue(pChip.strObjName, out CSongObject obj); + + obj.tStopAnimation(); + } + break; + case 0xd7: //set object frame + if (!pChip.bHit && time < 0) { + pChip.bHit = true; + dTX.listObj.TryGetValue(pChip.strObjName, out CSongObject obj); + + obj.frame = pChip.intFrame; + } + break; + #endregion + + #region [ d8-d9: EXTENDED2 ] + case 0xd8: + if (!pChip.bHit && time < 0) { + OpenTaiko.ConfigIni.nGameType[nPlayer] = pChip.eGameType; + pChip.bHit = true; + } + break; + case 0xd9: + if (!pChip.bHit && time < 0) { + bSplitLane[nPlayer] = true; + pChip.bHit = true; + } + break; + #endregion + + #region [ da: ミキサーへチップ音追加 ] + case 0xDA: + if (!pChip.bHit && time < 0) { + //Debug.WriteLine( "[DA(AddMixer)] BAR=" + pChip.n発声位置 / 384 + " ch=" + pChip.nチャンネル番号.ToString( "x2" ) + ", wav=" + pChip.n整数値.ToString( "x2" ) + ", time=" + pChip.n発声時刻ms ); + pChip.bHit = true; + if (listWAV.TryGetValue(pChip.n整数値_内部番号, out CDTX.CWAV wc)) // 参照が遠いので後日最適化する + { + for (int i = 0; i < nPolyphonicSounds; i++) { + if (wc.rSound[i] != null) { + //CDTXMania.Sound管理.AddMixer( wc.rSound[ i ] ); + AddMixer(wc.rSound[i], pChip.b演奏終了後も再生が続くチップである); + } + } + } + } + break; + #endregion + #region [ db: ミキサーからチップ音削除 ] + case 0xDB: + if (!pChip.bHit && time < 0) { + //Debug.WriteLine( "[DB(RemoveMixer)] BAR=" + pChip.n発声位置 / 384 + " ch=" + pChip.nチャンネル番号.ToString( "x2" ) + ", wav=" + pChip.n整数値.ToString( "x2" ) + ", time=" + pChip.n発声時刻ms ); + pChip.bHit = true; + if (listWAV.TryGetValue(pChip.n整数値_内部番号, out CDTX.CWAV wc)) // 参照が遠いので後日最適化する + { + for (int i = 0; i < nPolyphonicSounds; i++) { + if (wc.rSound[i] != null) { + //CDTXMania.Sound管理.RemoveMixer( wc.rSound[ i ] ); + if (!wc.rSound[i].b演奏終了後も再生が続くチップである) // #32248 2013.10.16 yyagi + { // DTX終了後も再生が続くチップの0xDB登録をなくすことはできず。 + RemoveMixer(wc.rSound[i]); // (ミキサー解除のタイミングが遅延する場合の対応が面倒なので。) + } // そこで、代わりにフラグをチェックしてミキサー削除ロジックへの遷移をカットする。 + } + } + } + } + break; + #endregion + + #region[ dc-df:太鼓(特殊命令) ] + case 0xDC: //DELAY + if (!pChip.bHit && time < 0) { + pChip.bHit = true; + //if ( dTX.listDELAY.ContainsKey( pChip.n整数値_内部番号 ) ) + //{ + //this.actPlayInfo.dbBPM = ( dTX.listBPM[ pChip.n整数値_内部番号 ].dbBPM値 * ( ( (double) configIni.n演奏速度 ) / 20.0 ) );// + dTX.BASEBPM; + //} + } + break; + case 0xDD: //SECTION + if (!pChip.bHit && time < 0) { + // 分岐毎にリセットしていたのでSECTIONの命令が来たらリセットする。 + this.tBranchReset(nPlayer); + pChip.bHit = true; + } + break; + + case 0xDE: //Judgeに応じたCourseを取得 + if (!pChip.bHit && time < 0) { + this.b強制分岐譜面[nPlayer] = false; + //分岐の種類はプレイヤー関係ないと思う + this.eBranch種類 = pChip.e分岐の種類; + this.nBranch条件数値A = pChip.n条件数値A; + this.nBranch条件数値B = pChip.n条件数値B; + if (!this.bLEVELHOLD[nPlayer]) { + //成仏2000にある-2,-1だったら達人に強制分岐みたいな。 + this.t強制用条件かを判断する(pChip.n条件数値A, pChip.n条件数値B, nPlayer); + + OpenTaiko.stage演奏ドラム画面.bUseBranch[nPlayer] = true; + + CBRANCHSCORE branchScore; + if (OpenTaiko.ConfigIni.bAIBattleMode) { + branchScore = this.CBranchScore[0]; + } else { + branchScore = this.CBranchScore[nPlayer]; + } + this.tBranchJudge(pChip, branchScore.cBigNotes, branchScore.nScore, branchScore.nRoll, branchScore.nGreat, branchScore.nGood, branchScore.nMiss, nPlayer); + + if (this.b強制分岐譜面[nPlayer])//強制分岐譜面だったら次回コースをそのコースにセット + this.n次回のコース[nPlayer] = this.E強制コース[nPlayer]; + + this.t分岐処理(this.n次回のコース[nPlayer], nPlayer, pChip.n分岐時刻ms, pChip.e分岐の種類); + + OpenTaiko.stage演奏ドラム画面.actLaneTaiko.t分岐レイヤー_コース変化(OpenTaiko.stage演奏ドラム画面.actLaneTaiko.stBranch[nPlayer].nAfter, this.n次回のコース[nPlayer], nPlayer); + OpenTaiko.stage演奏ドラム画面.actMtaiko.tBranchEvent(OpenTaiko.stage演奏ドラム画面.actMtaiko.After[nPlayer], this.n次回のコース[nPlayer], nPlayer); + this.n現在のコース[nPlayer] = this.n次回のコース[nPlayer]; + } + this.n分岐した回数[nPlayer]++; + pChip.bHit = true; + } + break; + case 0x52://End処理 + if (!pChip.bHit && time < 0) { + + pChip.bHit = true; + } + + break; + case 0xE0: + //if( !pChip.bHit && time < 0 ) + //{ + //#BARLINEONと#BARLINEOFF + //演奏中は使用しません。 + //} + break; + case 0xE1: + if (!pChip.bHit && time < 0) { + //LEVELHOLD + this.bLEVELHOLD[nPlayer] = true; + } + break; + case 0xE2: + if (!pChip.bHit && time < 0) { + OpenTaiko.stage演奏ドラム画面.actLaneTaiko.t判定枠移動(dTX.listJPOSSCROLL[nJPOSSCROLL[nPlayer]].db移動時間, dTX.listJPOSSCROLL[nJPOSSCROLL[nPlayer]].n移動距離px, dTX.listJPOSSCROLL[nJPOSSCROLL[nPlayer]].n移動方向, nPlayer, dTX.listJPOSSCROLL[nJPOSSCROLL[nPlayer]].nVerticalMove); + this.nJPOSSCROLL[nPlayer]++; + pChip.bHit = true; + } + break; + #endregion + #region[ f1: 歌詞 ] + case 0xF1: + if (!pChip.bHit && time < 0) { + if (OpenTaiko.ConfigIni.nPlayerCount == 1) { + if (dTX.listLyric.Count > ShownLyric[nPlayer] && dTX.nPlayerSide == nPlayer) { + this.actPanel.t歌詞テクスチャを生成する(dTX.listLyric[ShownLyric[nPlayer]]); + ShownLyric[nPlayer]++; + } + } + pChip.bHit = true; + } + break; + #endregion + #region[ ff: 譜面の強制終了 ] + //バグで譜面がとてつもないことになっているため、#ENDがきたらこれを差し込む。 + case 0xFF: + if (!pChip.bHit && time < 0) { + if (OpenTaiko.ConfigIni.bTokkunMode) { + foreach (CDTX.CWAV cwav in OpenTaiko.DTX.listWAV.Values) { + for (int i = 0; i < nPolyphonicSounds; i++) { + if ((cwav.rSound[i] != null) && cwav.rSound[i].IsPlaying) { + return false; + } + } + } + } + pChip.bHit = true; + return true; + } + break; + #endregion + + #region [ d8-d9: EXTENDED2 ] + case 0xe3: + if (!pChip.bHit && time < 0) { + bSplitLane[nPlayer] = false; + pChip.bHit = true; + } + break; + case 0xe4: + if (!pChip.bHit && time < 0) { + pChip.bHit = true; + } + this.t進行描画_チップ_小節線(configIni, ref dTX, ref pChip, nPlayer); + break; + case 0x09: + if (!pChip.bHit && time < 0) { + + pChip.bHit = true; + } + break; + case 0x0A: + if (!pChip.bHit && time < 0) { + + pChip.bHit = true; + } + break; + case 0x0B: + if (!pChip.bHit && time < 0) { + + pChip.bHit = true; + } + break; + #endregion + + #region [ その他(未定義) ] + default: + if (!pChip.bHit && time < 0) { + pChip.bHit = true; + } + break; + #endregion } - return false; + } - public void tBranchReset(int player) { - if (player != -1) { - this.CBranchScore[player].cBigNotes.nGreat = 0; - this.CBranchScore[player].cBigNotes.nGood = 0; - this.CBranchScore[player].cBigNotes.nMiss = 0; - this.CBranchScore[player].cBigNotes.nRoll = 0; - this.CBranchScore[player].nGreat = 0; - this.CBranchScore[player].nGood = 0; - this.CBranchScore[player].nMiss = 0; - this.CBranchScore[player].nRoll = 0; - } else { - for (int i = 0; i < CBranchScore.Length; i++) { - this.CBranchScore[i].cBigNotes.nGreat = 0; - this.CBranchScore[i].cBigNotes.nGood = 0; - this.CBranchScore[i].cBigNotes.nMiss = 0; - this.CBranchScore[i].cBigNotes.nRoll = 0; + #region [ EXTENDED CONTROLS ] + if (ctCamVMove != null) //vertical camera move + { + ctCamVMove.Tick(); + float value = 0.0f; + if (currentCamVMoveChip.strCamEaseType.Equals("IN")) value = easing.EaseIn(ctCamVMove, currentCamVMoveChip.fCamScrollStartY, currentCamVMoveChip.fCamScrollEndY, currentCamVMoveChip.fCamMoveType); + if (currentCamVMoveChip.strCamEaseType.Equals("OUT")) value = easing.EaseOut(ctCamVMove, currentCamVMoveChip.fCamScrollStartY, currentCamVMoveChip.fCamScrollEndY, currentCamVMoveChip.fCamMoveType); + if (currentCamVMoveChip.strCamEaseType.Equals("IN_OUT")) value = easing.EaseInOut(ctCamVMove, currentCamVMoveChip.fCamScrollStartY, currentCamVMoveChip.fCamScrollEndY, currentCamVMoveChip.fCamMoveType); + OpenTaiko.fCamYOffset = float.IsNaN(value) ? currentCamVMoveChip.fCamScrollStartY : value; - this.CBranchScore[i].nGreat = 0; - this.CBranchScore[i].nGood = 0; - this.CBranchScore[i].nMiss = 0; - this.CBranchScore[i].nRoll = 0; - } + if (ctCamVMove.IsEnded) { + ctCamVMove = null; + OpenTaiko.fCamYOffset = currentCamVMoveChip.fCamScrollEndY; } } - public void tBranchJudge(CDTX.CChip pChip, CBRANCHSCORE cBRANCHSCORE, int nスコア, int n連打数, int n良, int n可, int n不可, int nPlayer) { - // Branch check score here + if (ctCamHMove != null) //horizontal camera move + { + ctCamHMove.Tick(); + float value = 0.0f; + if (currentCamHMoveChip.strCamEaseType.Equals("IN")) value = easing.EaseIn(ctCamHMove, currentCamHMoveChip.fCamScrollStartX, currentCamHMoveChip.fCamScrollEndX, currentCamHMoveChip.fCamMoveType); + if (currentCamHMoveChip.strCamEaseType.Equals("OUT")) value = easing.EaseOut(ctCamHMove, currentCamHMoveChip.fCamScrollStartX, currentCamHMoveChip.fCamScrollEndX, currentCamHMoveChip.fCamMoveType); + if (currentCamHMoveChip.strCamEaseType.Equals("IN_OUT")) value = easing.EaseInOut(ctCamHMove, currentCamHMoveChip.fCamScrollStartX, currentCamHMoveChip.fCamScrollEndX, currentCamHMoveChip.fCamMoveType); + OpenTaiko.fCamXOffset = float.IsNaN(value) ? currentCamHMoveChip.fCamScrollStartX : value; - if (this.b強制的に分岐させた[nPlayer]) return; + if (ctCamHMove.IsEnded) { + ctCamHMove = null; + OpenTaiko.fCamXOffset = currentCamHMoveChip.fCamScrollEndX; + } + } - var e種類 = pChip.e分岐の種類; + if (ctCamZoom != null) //camera zoom + { + ctCamZoom.Tick(); + float value = 0.0f; + if (currentCamZoomChip.strCamEaseType.Equals("IN")) value = easing.EaseIn(ctCamZoom, currentCamZoomChip.fCamZoomStart, currentCamZoomChip.fCamZoomEnd, currentCamZoomChip.fCamMoveType); + if (currentCamZoomChip.strCamEaseType.Equals("OUT")) value = easing.EaseOut(ctCamZoom, currentCamZoomChip.fCamZoomStart, currentCamZoomChip.fCamZoomEnd, currentCamZoomChip.fCamMoveType); + if (currentCamZoomChip.strCamEaseType.Equals("IN_OUT")) value = easing.EaseInOut(ctCamZoom, currentCamZoomChip.fCamZoomStart, currentCamZoomChip.fCamZoomEnd, currentCamZoomChip.fCamMoveType); + OpenTaiko.fCamZoomFactor = float.IsNaN(value) ? currentCamZoomChip.fCamZoomStart : value; - //分岐の仕方が同じなので一緒にしていいと思う。 - var b分岐種類が一致 = e種類 == CDTX.E分岐種類.e精度分岐 || e種類 == CDTX.E分岐種類.eスコア分岐; + if (ctCamZoom.IsEnded) { + ctCamZoom = null; + OpenTaiko.fCamZoomFactor = currentCamZoomChip.fCamZoomEnd; + } + } + if (ctCamRotation != null) //camera rotation + { + ctCamRotation.Tick(); + float value = 0.0f; + if (currentCamRotateChip.strCamEaseType.Equals("IN")) value = easing.EaseIn(ctCamRotation, currentCamRotateChip.fCamRotationStart, currentCamRotateChip.fCamRotationEnd, currentCamRotateChip.fCamMoveType); + if (currentCamRotateChip.strCamEaseType.Equals("OUT")) value = easing.EaseOut(ctCamRotation, currentCamRotateChip.fCamRotationStart, currentCamRotateChip.fCamRotationEnd, currentCamRotateChip.fCamMoveType); + if (currentCamRotateChip.strCamEaseType.Equals("IN_OUT")) value = easing.EaseInOut(ctCamRotation, currentCamRotateChip.fCamRotationStart, currentCamRotateChip.fCamRotationEnd, currentCamRotateChip.fCamMoveType); + OpenTaiko.fCamRotation = float.IsNaN(value) ? currentCamRotateChip.fCamRotationStart : value; - double dbRate = 0; + if (ctCamRotation.IsEnded) { + ctCamRotation = null; + OpenTaiko.fCamRotation = currentCamRotateChip.fCamRotationEnd; + } + } - if (e種類 == CDTX.E分岐種類.e精度分岐) { - if ((n良 + n可 + n不可) != 0) { - dbRate = (((double)n良 + (double)n可 * 0.5) / (double)(n良 + n可 + n不可)) * 100.0; + if (ctCamVScale != null) //vertical camera scaling + { + ctCamVScale.Tick(); + float value = 0.0f; + if (currentCamVScaleChip.strCamEaseType.Equals("IN")) value = easing.EaseIn(ctCamVScale, currentCamVScaleChip.fCamScaleStartY, currentCamVScaleChip.fCamScaleEndY, currentCamVScaleChip.fCamMoveType); + if (currentCamVScaleChip.strCamEaseType.Equals("OUT")) value = easing.EaseOut(ctCamVScale, currentCamVScaleChip.fCamScaleStartY, currentCamVScaleChip.fCamScaleEndY, currentCamVScaleChip.fCamMoveType); + if (currentCamVScaleChip.strCamEaseType.Equals("IN_OUT")) value = easing.EaseInOut(ctCamVScale, currentCamVScaleChip.fCamScaleStartY, currentCamVScaleChip.fCamScaleEndY, currentCamVScaleChip.fCamMoveType); + OpenTaiko.fCamYScale = float.IsNaN(value) ? currentCamVScaleChip.fCamScaleStartY : value; + + if (ctCamVScale.IsEnded) { + ctCamVScale = null; + OpenTaiko.fCamYScale = currentCamVScaleChip.fCamScaleEndY; + } + } + + if (ctCamHScale != null) //horizontal camera scaling + { + ctCamHScale.Tick(); + float value = 0.0f; + if (currentCamHScaleChip.strCamEaseType.Equals("IN")) value = easing.EaseIn(ctCamHScale, currentCamHScaleChip.fCamScaleStartX, currentCamHScaleChip.fCamScaleEndX, currentCamHScaleChip.fCamMoveType); + if (currentCamHScaleChip.strCamEaseType.Equals("OUT")) value = easing.EaseOut(ctCamHScale, currentCamHScaleChip.fCamScaleStartX, currentCamHScaleChip.fCamScaleEndX, currentCamHScaleChip.fCamMoveType); + if (currentCamHScaleChip.strCamEaseType.Equals("IN_OUT")) value = easing.EaseInOut(ctCamHScale, currentCamHScaleChip.fCamScaleStartX, currentCamHScaleChip.fCamScaleEndX, currentCamHScaleChip.fCamMoveType); + OpenTaiko.fCamXScale = float.IsNaN(value) ? currentCamHScaleChip.fCamScaleStartX : value; + + if (ctCamHScale.IsEnded) { + ctCamHScale = null; + OpenTaiko.fCamXScale = currentCamHScaleChip.fCamScaleEndX; + } + } + + foreach (KeyValuePair pair in objHandlers) { + CDTX.CChip chip = pair.Key; + CCounter counter = pair.Value; + + if (counter != null) { + counter.Tick(); + + float value = 0.0f; + if (counter.IsEnded) { + value = chip.fObjEnd; + counter = null; + } else { + if (chip.strObjEaseType.Equals("IN")) value = easing.EaseIn(counter, chip.fObjStart, chip.fObjEnd, chip.objCalcType); + if (chip.strObjEaseType.Equals("OUT")) value = easing.EaseOut(counter, chip.fObjStart, chip.fObjEnd, chip.objCalcType); + if (chip.strObjEaseType.Equals("IN_OUT")) value = easing.EaseInOut(counter, chip.fObjStart, chip.fObjEnd, chip.objCalcType); + value = float.IsNaN(value) ? chip.fObjStart : value; + } + + if (chip.nチャンネル番号 == 0xBE) chip.obj.y = value; + if (chip.nチャンネル番号 == 0xC0) chip.obj.x = value; + if (chip.nチャンネル番号 == 0xC2) chip.obj.yScale = value; + if (chip.nチャンネル番号 == 0xC4) chip.obj.xScale = value; + if (chip.nチャンネル番号 == 0xC6) chip.obj.rotation = value; + if (chip.nチャンネル番号 == 0xC8) chip.obj.opacity = (int)value; + + if (chip.nチャンネル番号 == 0xCB) chip.obj.y = value; + if (chip.nチャンネル番号 == 0xCC) chip.obj.x = value; + if (chip.nチャンネル番号 == 0xCD) chip.obj.yScale = value; + if (chip.nチャンネル番号 == 0xCE) chip.obj.xScale = value; + if (chip.nチャンネル番号 == 0xCF) chip.obj.rotation = value; + if (chip.nチャンネル番号 == 0xD0) chip.obj.opacity = (int)value; + } + } + #endregion + + return false; + } + + protected bool t進行描画_チップ_連打(EInstrumentPad ePlayMode, int nPlayer) { + if ((base.ePhaseID == CStage.EPhase.Game_STAGE_FAILED) || (base.ePhaseID == CStage.EPhase.Game_STAGE_FAILED_FadeOut)) { + return true; + } + if ((this.n現在のトップChip == -1) || (this.n現在のトップChip >= listChip[nPlayer].Count)) { + return true; + } + + CConfigIni configIni = OpenTaiko.ConfigIni; + + CDTX dTX = OpenTaiko.DTX; + bool bAutoPlay = configIni.bAutoPlay[nPlayer]; + switch (nPlayer) //2017.08.11 kairera0467 + { + case 1: + bAutoPlay = configIni.bAutoPlay[nPlayer] || OpenTaiko.ConfigIni.bAIBattleMode; + dTX = OpenTaiko.DTX_2P; + break; + case 2: + dTX = OpenTaiko.DTX_3P; + break; + case 3: + dTX = OpenTaiko.DTX_4P; + break; + case 4: + dTX = OpenTaiko.DTX_5P; + break; + default: + break; + } + + var n現在時刻ms = (long)(SoundManager.PlayTimer.NowTime * OpenTaiko.ConfigIni.SongPlaybackSpeed); + + //for ( int nCurrentTopChip = this.n現在のトップChip; nCurrentTopChip < dTX.listChip.Count; nCurrentTopChip++ ) + for (int nCurrentTopChip = dTX.listChip.Count - 1; nCurrentTopChip > 0; nCurrentTopChip--) { + CDTX.CChip pChip = dTX.listChip[nCurrentTopChip]; + + if (!pChip.bHit) { + bool bRollChip = NotesManager.IsGenericRoll(pChip);// pChip.nチャンネル番号 >= 0x15 && pChip.nチャンネル番号 <= 0x19; + if (bRollChip && ((pChip.e楽器パート != EInstrumentPad.Unknown))) { + int instIndex = (int)pChip.e楽器パート; + if (pChip.nバーからの距離dot[instIndex] < -40) { + if (this.e指定時刻からChipのJUDGEを返す(n現在時刻ms, pChip, nPlayer) == ENoteJudge.Miss) { + this.tチップのヒット処理(n現在時刻ms, pChip, EInstrumentPad.Taiko, false, 0, nPlayer); + } + } } - } else if (e種類 == CDTX.E分岐種類.eスコア分岐) { - dbRate = nスコア; - } else if (e種類 == CDTX.E分岐種類.e連打分岐) { - dbRate = n連打数; - } else if (e種類 == CDTX.E分岐種類.e大音符のみ精度分岐) { - dbRate = cBRANCHSCORE.nGreat; } + switch (pChip.nチャンネル番号) { + #region[ 15-19: Rolls ] + case 0x15: //連打 + case 0x16: //連打(大) + case 0x17: //風船 + case 0x18: //連打終了 + case 0x19: + case 0x1D: + case 0x20: + case 0x21: { + if (pChip.n描画優先度 >= 1) + this.t進行描画_チップ_Taiko連打(configIni, ref dTX, ref pChip, nPlayer); + } + break; + #endregion + } - if (b分岐種類が一致) { + } + return false; + } + + public void tBranchReset(int player) { + if (player != -1) { + this.CBranchScore[player].cBigNotes.nGreat = 0; + this.CBranchScore[player].cBigNotes.nGood = 0; + this.CBranchScore[player].cBigNotes.nMiss = 0; + this.CBranchScore[player].cBigNotes.nRoll = 0; + + this.CBranchScore[player].nGreat = 0; + this.CBranchScore[player].nGood = 0; + this.CBranchScore[player].nMiss = 0; + this.CBranchScore[player].nRoll = 0; + } else { + for (int i = 0; i < CBranchScore.Length; i++) { + this.CBranchScore[i].cBigNotes.nGreat = 0; + this.CBranchScore[i].cBigNotes.nGood = 0; + this.CBranchScore[i].cBigNotes.nMiss = 0; + this.CBranchScore[i].cBigNotes.nRoll = 0; + + this.CBranchScore[i].nGreat = 0; + this.CBranchScore[i].nGood = 0; + this.CBranchScore[i].nMiss = 0; + this.CBranchScore[i].nRoll = 0; + } + } + } + + public void tBranchJudge(CDTX.CChip pChip, CBRANCHSCORE cBRANCHSCORE, int nスコア, int n連打数, int n良, int n可, int n不可, int nPlayer) { + // Branch check score here + + if (this.b強制的に分岐させた[nPlayer]) return; + + var e種類 = pChip.e分岐の種類; + + //分岐の仕方が同じなので一緒にしていいと思う。 + var b分岐種類が一致 = e種類 == CDTX.E分岐種類.e精度分岐 || e種類 == CDTX.E分岐種類.eスコア分岐; + + + double dbRate = 0; + + if (e種類 == CDTX.E分岐種類.e精度分岐) { + if ((n良 + n可 + n不可) != 0) { + dbRate = (((double)n良 + (double)n可 * 0.5) / (double)(n良 + n可 + n不可)) * 100.0; + } + } else if (e種類 == CDTX.E分岐種類.eスコア分岐) { + dbRate = nスコア; + } else if (e種類 == CDTX.E分岐種類.e連打分岐) { + dbRate = n連打数; + } else if (e種類 == CDTX.E分岐種類.e大音符のみ精度分岐) { + dbRate = cBRANCHSCORE.nGreat; + } + + + if (b分岐種類が一致) { + if (dbRate < pChip.n条件数値A) { + this.nレーン用表示コース[nPlayer] = CDTX.ECourse.eNormal; + this.n次回のコース[nPlayer] = CDTX.ECourse.eNormal; + } else if (dbRate >= pChip.n条件数値A && dbRate < pChip.n条件数値B) { + this.nレーン用表示コース[nPlayer] = CDTX.ECourse.eExpert; + this.n次回のコース[nPlayer] = CDTX.ECourse.eExpert; + } else if (dbRate >= pChip.n条件数値B) { + this.nレーン用表示コース[nPlayer] = CDTX.ECourse.eMaster; + this.n次回のコース[nPlayer] = CDTX.ECourse.eMaster; + } + + } else if (e種類 == CDTX.E分岐種類.e連打分岐) { + if (!(pChip.n条件数値A == 0 && pChip.n条件数値B == 0)) { if (dbRate < pChip.n条件数値A) { this.nレーン用表示コース[nPlayer] = CDTX.ECourse.eNormal; this.n次回のコース[nPlayer] = CDTX.ECourse.eNormal; @@ -4232,617 +4246,603 @@ namespace OpenTaiko { this.nレーン用表示コース[nPlayer] = CDTX.ECourse.eMaster; this.n次回のコース[nPlayer] = CDTX.ECourse.eMaster; } - - } else if (e種類 == CDTX.E分岐種類.e連打分岐) { - if (!(pChip.n条件数値A == 0 && pChip.n条件数値B == 0)) { - if (dbRate < pChip.n条件数値A) { - this.nレーン用表示コース[nPlayer] = CDTX.ECourse.eNormal; - this.n次回のコース[nPlayer] = CDTX.ECourse.eNormal; - } else if (dbRate >= pChip.n条件数値A && dbRate < pChip.n条件数値B) { - this.nレーン用表示コース[nPlayer] = CDTX.ECourse.eExpert; - this.n次回のコース[nPlayer] = CDTX.ECourse.eExpert; - } else if (dbRate >= pChip.n条件数値B) { - this.nレーン用表示コース[nPlayer] = CDTX.ECourse.eMaster; - this.n次回のコース[nPlayer] = CDTX.ECourse.eMaster; - } - } - } else if (e種類 == CDTX.E分岐種類.e大音符のみ精度分岐) { - if (!(pChip.n条件数値A == 0 && pChip.n条件数値B == 0)) { - if (dbRate < pChip.n条件数値A) { - this.nレーン用表示コース[nPlayer] = CDTX.ECourse.eNormal; - this.n次回のコース[nPlayer] = CDTX.ECourse.eNormal; - } else if (dbRate >= pChip.n条件数値A && dbRate < pChip.n条件数値B) { - this.nレーン用表示コース[nPlayer] = CDTX.ECourse.eExpert; - this.n次回のコース[nPlayer] = CDTX.ECourse.eExpert; - } else if (dbRate >= pChip.n条件数値B) { - this.nレーン用表示コース[nPlayer] = CDTX.ECourse.eMaster; - this.n次回のコース[nPlayer] = CDTX.ECourse.eMaster; - } + } + } else if (e種類 == CDTX.E分岐種類.e大音符のみ精度分岐) { + if (!(pChip.n条件数値A == 0 && pChip.n条件数値B == 0)) { + if (dbRate < pChip.n条件数値A) { + this.nレーン用表示コース[nPlayer] = CDTX.ECourse.eNormal; + this.n次回のコース[nPlayer] = CDTX.ECourse.eNormal; + } else if (dbRate >= pChip.n条件数値A && dbRate < pChip.n条件数値B) { + this.nレーン用表示コース[nPlayer] = CDTX.ECourse.eExpert; + this.n次回のコース[nPlayer] = CDTX.ECourse.eExpert; + } else if (dbRate >= pChip.n条件数値B) { + this.nレーン用表示コース[nPlayer] = CDTX.ECourse.eMaster; + this.n次回のコース[nPlayer] = CDTX.ECourse.eMaster; } } } + } - private CDTX.ECourse[] E強制コース = new CDTX.ECourse[5]; - private void t強制用条件かを判断する(double db条件A, double db条件B, int nPlayer) { - //Wiki参考 - //成仏 + private CDTX.ECourse[] E強制コース = new CDTX.ECourse[5]; + private void t強制用条件かを判断する(double db条件A, double db条件B, int nPlayer) { + //Wiki参考 + //成仏 - if (db条件A == 101 && db条件B == 102) //強制普通譜面 - { - E強制コース[nPlayer] = CDTX.ECourse.eNormal; - this.b強制分岐譜面[nPlayer] = true; - } else if (db条件A == -1 && db条件B == 101) //強制玄人譜面 - { - E強制コース[nPlayer] = CDTX.ECourse.eExpert; - this.b強制分岐譜面[nPlayer] = true; - } else if (db条件A == -2 && db条件B == -1) //強制達人譜面 - { - E強制コース[nPlayer] = CDTX.ECourse.eMaster; - this.b強制分岐譜面[nPlayer] = true; - } + if (db条件A == 101 && db条件B == 102) //強制普通譜面 + { + E強制コース[nPlayer] = CDTX.ECourse.eNormal; + this.b強制分岐譜面[nPlayer] = true; + } else if (db条件A == -1 && db条件B == 101) //強制玄人譜面 + { + E強制コース[nPlayer] = CDTX.ECourse.eExpert; + this.b強制分岐譜面[nPlayer] = true; + } else if (db条件A == -2 && db条件B == -1) //強制達人譜面 + { + E強制コース[nPlayer] = CDTX.ECourse.eMaster; + this.b強制分岐譜面[nPlayer] = true; + } + } + + public void t分岐処理(CDTX.ECourse n分岐先, int nPlayer, double n発声位置, CDTX.E分岐種類 e分岐種類 = CDTX.E分岐種類.e精度分岐) { + + CDTX dTX = OpenTaiko.DTX; + switch (nPlayer) { + case 1: + dTX = OpenTaiko.DTX_2P; + break; + case 2: + dTX = OpenTaiko.DTX_3P; + break; + case 3: + dTX = OpenTaiko.DTX_4P; + break; + case 4: + dTX = OpenTaiko.DTX_5P; + break; + default: + break; } - public void t分岐処理(CDTX.ECourse n分岐先, int nPlayer, double n発声位置, CDTX.E分岐種類 e分岐種類 = CDTX.E分岐種類.e精度分岐) { - CDTX dTX = OpenTaiko.DTX; - switch (nPlayer) { - case 1: - dTX = OpenTaiko.DTX_2P; - break; - case 2: - dTX = OpenTaiko.DTX_3P; - break; - case 3: - dTX = OpenTaiko.DTX_4P; - break; - case 4: - dTX = OpenTaiko.DTX_5P; - break; - default: - break; - } + for (int A = 0; A < dTX.listChip.Count; A++) { + var Chip = dTX.listChip[A].nチャンネル番号; + var _chip = dTX.listChip[A]; + var bDontDeleteFlag = NotesManager.IsHittableNote(_chip);// Chip >= 0x11 && Chip <= 0x19; + var bRollAllFlag = NotesManager.IsGenericRoll(_chip);//Chip >= 0x15 && Chip <= 0x19; + var bBalloonOnlyFlag = NotesManager.IsGenericBalloon(_chip);//Chip == 0x17; + var bRollOnlyFlag = NotesManager.IsRoll(_chip);//Chip >= 0x15 && Chip <= 0x16; - for (int A = 0; A < dTX.listChip.Count; A++) { - var Chip = dTX.listChip[A].nチャンネル番号; - var _chip = dTX.listChip[A]; + if (bDontDeleteFlag) { + if (dTX.listChip[A].n発声時刻ms > n発声位置) { + if (dTX.listChip[A].nコース == n分岐先) { + dTX.listChip[A].b可視 = true; - var bDontDeleteFlag = NotesManager.IsHittableNote(_chip);// Chip >= 0x11 && Chip <= 0x19; - var bRollAllFlag = NotesManager.IsGenericRoll(_chip);//Chip >= 0x15 && Chip <= 0x19; - var bBalloonOnlyFlag = NotesManager.IsGenericBalloon(_chip);//Chip == 0x17; - var bRollOnlyFlag = NotesManager.IsRoll(_chip);//Chip >= 0x15 && Chip <= 0x16; - - if (bDontDeleteFlag) { - if (dTX.listChip[A].n発声時刻ms > n発声位置) { - if (dTX.listChip[A].nコース == n分岐先) { - dTX.listChip[A].b可視 = true; - - if (dTX.listChip[A].IsEndedBranching) { - if (bRollAllFlag)//共通譜面時かつ、連打譜面だったら非可視化 - { - dTX.listChip[A].bHit = true; - dTX.listChip[A].bShow = false; - dTX.listChip[A].b可視 = false; - } - } - } else { - if (!dTX.listChip[A].IsEndedBranching) - dTX.listChip[A].b可視 = false; - } - //共通なため分岐させない. - dTX.listChip[A].eNoteState = ENoteState.None; - - if (dTX.listChip[A].IsEndedBranching && (dTX.listChip[A].nコース == CDTX.ECourse.eNormal)) { - if (bRollOnlyFlag)//共通譜面時かつ、連打譜面だったら可視化 + if (dTX.listChip[A].IsEndedBranching) { + if (bRollAllFlag)//共通譜面時かつ、連打譜面だったら非可視化 + { + dTX.listChip[A].bHit = true; + dTX.listChip[A].bShow = false; + dTX.listChip[A].b可視 = false; + } + } + } else { + if (!dTX.listChip[A].IsEndedBranching) + dTX.listChip[A].b可視 = false; + } + //共通なため分岐させない. + dTX.listChip[A].eNoteState = ENoteState.None; + + if (dTX.listChip[A].IsEndedBranching && (dTX.listChip[A].nコース == CDTX.ECourse.eNormal)) { + if (bRollOnlyFlag)//共通譜面時かつ、連打譜面だったら可視化 + { + dTX.listChip[A].bHit = false; + dTX.listChip[A].bShow = true; + dTX.listChip[A].b可視 = true; + } else { + if (bBalloonOnlyFlag)//共通譜面時かつ、風船譜面だったら可視化 { - dTX.listChip[A].bHit = false; dTX.listChip[A].bShow = true; dTX.listChip[A].b可視 = true; - } else { - if (bBalloonOnlyFlag)//共通譜面時かつ、風船譜面だったら可視化 - { - dTX.listChip[A].bShow = true; - dTX.listChip[A].b可視 = true; - } } } } } } } + } - public int GetRoll(int player) { - return n合計連打数[player]; - } + public int GetRoll(int player) { + return n合計連打数[player]; + } - protected float GetNowPBMTime(CDTX tja, float play_time) { - float bpm_time = 0; - int last_input = 0; - float last_bpm_change_time; - play_time = SoundManager.PlayTimer.NowTimeMs * (float)OpenTaiko.ConfigIni.SongPlaybackSpeed - tja.nOFFSET; + protected float GetNowPBMTime(CDTX tja, float play_time) { + float bpm_time = 0; + int last_input = 0; + float last_bpm_change_time; + play_time = SoundManager.PlayTimer.NowTimeMs * (float)OpenTaiko.ConfigIni.SongPlaybackSpeed - tja.nOFFSET; - for (int i = 1; ; i++) { - //BPMCHANGEの数越えた - if (i >= tja.listBPM.Count) { - CDTX.CBPM cBPM = tja.listBPM[last_input]; - bpm_time = (float)cBPM.bpm_change_bmscroll_time + ((play_time - (float)cBPM.bpm_change_time) * (float)cBPM.dbBPM値 / 15000.0f); - last_bpm_change_time = (float)cBPM.bpm_change_time; + for (int i = 1; ; i++) { + //BPMCHANGEの数越えた + if (i >= tja.listBPM.Count) { + CDTX.CBPM cBPM = tja.listBPM[last_input]; + bpm_time = (float)cBPM.bpm_change_bmscroll_time + ((play_time - (float)cBPM.bpm_change_time) * (float)cBPM.dbBPM値 / 15000.0f); + last_bpm_change_time = (float)cBPM.bpm_change_time; + break; + } + for (; i < tja.listBPM.Count; i++) { + CDTX.CBPM cBPM = tja.listBPM[i]; + if (cBPM.bpm_change_time == 0 || cBPM.bpm_change_course == this.n現在のコース[0]) { break; } - for (; i < tja.listBPM.Count; i++) { - CDTX.CBPM cBPM = tja.listBPM[i]; - if (cBPM.bpm_change_time == 0 || cBPM.bpm_change_course == this.n現在のコース[0]) { - break; - } - } - if (i == tja.listBPM.Count) { - i = tja.listBPM.Count - 1; - continue; - } - - if (play_time < tja.listBPM[i].bpm_change_time) { - CDTX.CBPM cBPM = tja.listBPM[last_input]; - bpm_time = (float)cBPM.bpm_change_bmscroll_time + ((play_time - (float)cBPM.bpm_change_time) * (float)cBPM.dbBPM値 / 15000.0f); - last_bpm_change_time = (float)cBPM.bpm_change_time; - break; - } else { - last_input = i; - } + } + if (i == tja.listBPM.Count) { + i = tja.listBPM.Count - 1; + continue; } - return bpm_time; - } - - public void t再読込() { - OpenTaiko.DTX.t全チップの再生停止とミキサーからの削除(); - this.eフェードアウト完了時の戻り値 = EGameplayScreenReturnValue.ReloadAndReplay; - base.ePhaseID = CStage.EPhase.Game_Reload; - this.bPAUSE = false; - } - - // Workaround for abnormal song completion animation after retrying during normal song completion animation - public void tResetGameplayFinishedStatus() { - for (int i = 0; i < 5; i++) { - ifp[i] = false; - isDeniedPlaying[i] = false; - } - } - - public void t演奏やりなおし() { - _AIBattleState = 0; - _AIBattleStateBatch = new Queue[] { new Queue(), new Queue() }; - - NowAIBattleSectionCount = 0; - NowAIBattleSectionTime = 0; - - CFloorManagement.reload(); - - for (int i = 0; i < AIBattleSections.Count; i++) { - AIBattleSections[i].End = AIBattleSection.EndType.None; - AIBattleSections[i].IsAnimated = false; - } - - OpenTaiko.fCamXOffset = 0; - - OpenTaiko.fCamYOffset = 0; - - OpenTaiko.fCamZoomFactor = 1.0f; - OpenTaiko.fCamRotation = 0; - - OpenTaiko.fCamXScale = 1.0f; - OpenTaiko.fCamYScale = 1.0f; - - OpenTaiko.borderColor = new Color4(1f, 0f, 0f, 0f); - - foreach (var chip in OpenTaiko.DTX.listChip) { - if (chip.obj == null) continue; - chip.obj.isVisible = false; - chip.obj.yScale = 1.0f; - chip.obj.xScale = 1.0f; - chip.obj.rotation = 0.0f; - chip.obj.opacity = 255; - chip.obj.frame = 0; - } - - OpenTaiko.DTX.t全チップの再生停止とミキサーからの削除(); - this.t数値の初期化(true, true); - //this.actAVI.Stop(); - foreach (var vd in OpenTaiko.DTX.listVD) { - vd.Value.Stop(); - } - this.actAVI.Stop(); - this.actPanel.t歌詞テクスチャを削除する(); - bool[] cleared = new bool[5]; - for (int i = 0; i < 5; i++) { - cleared[i] = bIsAlreadyCleared[i]; - this.t演奏位置の変更(0, i); - this.actPlayInfo.NowMeasure[i] = 0; - JPOSCROLLX[i] = 0; - JPOSCROLLY[i] = 0; - ifp[i] = false; - isDeniedPlaying[i] = false; - - OpenTaiko.ConfigIni.nGameType[i] = eFirstGameType[i]; - bSplitLane[i] = false; - } - OpenTaiko.stage演奏ドラム画面.Activate(); - for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { - if (!bIsAlreadyCleared[i] && cleared[i]) { - OpenTaiko.stage演奏ドラム画面.actBackground.ClearOut(i); - } - - if (NotesManager.IsKusudama(this.chip現在処理中の連打チップ[i]) && this.actChara.b風船連打中[i]) actBalloon.KusuMiss(); - this.chip現在処理中の連打チップ[i] = null; - this.actChara.b風船連打中[i] = false; - this.actChara.ReturnDefaultAnime(i, true); - } - this.bPAUSE = false; - } - - public void t停止() { - OpenTaiko.DTX.t全チップの再生停止とミキサーからの削除(); - foreach (var vd in OpenTaiko.DTX.listVD) { - vd.Value.Stop(); - } - this.actAVI.Stop(); - this.actPanel.Stop(); // PANEL表示停止 - OpenTaiko.Timer.Pause(); // 再生時刻カウンタ停止 - - this.n現在のトップChip = OpenTaiko.DTX.listChip.Count - 1; // 終端にシーク - - // 自分自身のOn活性化()相当の処理もすべき。 - } - - public void t数値の初期化(bool b演奏記録, bool b演奏状態) { - if (b演奏記録) { - this.nヒット数_Auto含む.Taiko.Perfect = 0; - this.nヒット数_Auto含む.Taiko.Great = 0; - this.nヒット数_Auto含む.Taiko.Good = 0; - this.nヒット数_Auto含む.Taiko.Poor = 0; - this.nヒット数_Auto含む.Taiko.Miss = 0; - - this.nヒット数_Auto含まない.Taiko.Perfect = 0; - this.nヒット数_Auto含まない.Taiko.Great = 0; - this.nヒット数_Auto含まない.Taiko.Good = 0; - this.nヒット数_Auto含まない.Taiko.Poor = 0; - this.nヒット数_Auto含まない.Taiko.Miss = 0; - - this.actCombo.Activate(); - this.actScore.Activate(); - for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { - this.actGauge.Init(OpenTaiko.ConfigIni.nRisky, i); - } - } - if (b演奏状態) { - for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { - this.bIsGOGOTIME[i] = false; - this.bIsMiss[i] = false; - this.bLEVELHOLD[i] = false; - this.b強制的に分岐させた[i] = false; - this.b譜面分岐中[i] = false; - this.b連打中[i] = false; - this.n現在のコース[i] = 0; - this.n次回のコース[i] = 0; - this.n現在の連打数[i] = 0; - this.n合計連打数[i] = 0; - this.n分岐した回数[i] = 0; - } - for (int i = 0; i < 5; i++) { - this.actComboVoice.tReset(i); - NowProcessingChip[i] = 0; - } - } - nCurrentKusudamaCount = 0; - nCurrentKusudamaRollCount = 0; - - this.ReSetScore(OpenTaiko.DTX.nScoreInit[0, OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0]], OpenTaiko.DTX.nScoreDiff[OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0]]); - this.nHand = new int[] { 0, 0, 0, 0, 0 }; - } - - public void t演奏位置の変更(int nStartBar, int nPlayer) { - // まず全サウンドオフにする - OpenTaiko.DTX.t全チップの再生停止(); - this.actAVI.Stop(); - CDTX dTX = OpenTaiko.DTX; - switch (nPlayer) { - case 1: - dTX = OpenTaiko.DTX_2P; - break; - case 2: - dTX = OpenTaiko.DTX_3P; - break; - case 3: - dTX = OpenTaiko.DTX_4P; - break; - case 4: - dTX = OpenTaiko.DTX_5P; - break; - default: - break; - } - - if (dTX == null) return; //CDTXがnullの場合はプレイヤーが居ないのでその場で処理終了 - - - #region [ 再生開始小節の変更 ] - //nStartBar++; // +1が必要 - - #region [ 演奏済みフラグのついたChipをリセットする ] - for (int i = 0; i < dTX.listChip.Count; i++) { - //if(dTX.listChip[i].bHit) フラグが付いてなくてもすべてのチップをリセットする。(必要がある).2020.04.23.akasoko26 - - dTX.listChip[i].bHit = false; - dTX.listChip[i].bShow = true; - dTX.listChip[i].bProcessed = false; - dTX.listChip[i].b可視 = true; - dTX.listChip[i].IsHitted = false; - dTX.listChip[i].IsMissed = false; - dTX.listChip[i].eNoteState = ENoteState.None; - dTX.listChip[i].nProcessTime = 0; - dTX.listChip[i].nRollCount = 0; - dTX.listChip[i].nRollCount = 0; - } - #endregion - - #region [ 処理を開始するチップの特定 ] - //for ( int i = this.n現在のトップChip; i < CDTXMania.DTX.listChip.Count; i++ ) - bool bSuccessSeek = false; - for (int i = 0; i < dTX.listChip.Count; i++) { - CDTX.CChip pChip = dTX.listChip[i]; - if (nStartBar == 0) { - if (pChip.n発声位置 < 384 * nStartBar) { - continue; - } else { - bSuccessSeek = true; - this.n現在のトップChip = i; - break; - } - } else { - if (pChip.nチャンネル番号 == 0x50 && pChip.n整数値_内部番号 > nStartBar - 1) { - bSuccessSeek = true; - this.n現在のトップChip = i; - break; - } - } - } - if (!bSuccessSeek) { - // this.n現在のトップChip = CDTXMania.DTX.listChip.Count - 1; - this.n現在のトップChip = 0; // 対象小節が存在しないなら、最初から再生 + if (play_time < tja.listBPM[i].bpm_change_time) { + CDTX.CBPM cBPM = tja.listBPM[last_input]; + bpm_time = (float)cBPM.bpm_change_bmscroll_time + ((play_time - (float)cBPM.bpm_change_time) * (float)cBPM.dbBPM値 / 15000.0f); + last_bpm_change_time = (float)cBPM.bpm_change_time; + break; } else { - while (this.n現在のトップChip != 0 && dTX.listChip[this.n現在のトップChip].n発声時刻ms == dTX.listChip[OpenTaiko.stage演奏ドラム画面.n現在のトップChip - 1].n発声時刻ms) - OpenTaiko.stage演奏ドラム画面.n現在のトップChip--; + last_input = i; } - #endregion - #region [ 演奏開始の発声時刻msを取得し、タイマに設定 ] - int nStartTime = (int)(dTX.listChip[this.n現在のトップChip].n発声時刻ms / OpenTaiko.ConfigIni.SongPlaybackSpeed); - - SoundManager.PlayTimer.Reset(); // これでPAUSE解除されるので、次のPAUSEチェックは不要 - //if ( !this.bPAUSE ) - //{ - SoundManager.PlayTimer.Pause(); - //} - SoundManager.PlayTimer.NowTime = nStartTime; - #endregion - - List pausedCSound = new List(); - - #region [ BGMやギターなど、演奏開始のタイミングで再生がかかっているサウンドのの途中再生開始 ] // (CDTXのt入力_行解析_チップ配置()で小節番号が+1されているのを削っておくこと) - for (int i = this.n現在のトップChip; i >= 0; i--) { - CDTX.CChip pChip = dTX.listChip[i]; - int nDuration = pChip.GetDuration(); - long n発声時刻ms = (long)(pChip.n発声時刻ms / OpenTaiko.ConfigIni.SongPlaybackSpeed); - - if ((n発声時刻ms + nDuration > 0) && (n発声時刻ms <= nStartTime) && (nStartTime <= n発声時刻ms + nDuration)) { - if (pChip.nチャンネル番号 == 0x01 && (pChip.nチャンネル番号 >> 4) != 0xB) // wav系チャンネル、且つ、空打ちチップではない - { - CDTX.CWAV wc; - bool b = dTX.listWAV.TryGetValue(pChip.n整数値_内部番号, out wc); - if (!b) continue; - - if ((wc.bIsBGMSound && OpenTaiko.ConfigIni.bBGMPlayVoiceSound) || (!wc.bIsBGMSound)) { - OpenTaiko.DTX.tチップの再生(pChip, (long)(SoundManager.PlayTimer.PrevResetTime) + (long)(pChip.n発声時刻ms / OpenTaiko.ConfigIni.SongPlaybackSpeed)); - #region [ PAUSEする ] - int j = wc.n現在再生中のサウンド番号; - if (wc.rSound[j] != null) { - wc.rSound[j].Pause(); - wc.rSound[j].tSetPositonToBegin(nStartTime - n発声時刻ms); - pausedCSound.Add(wc.rSound[j]); - } - #endregion - } - } - } - } - #endregion - #region [ 演奏開始時点で既に表示されているBGAとAVIの、シークと再生 ] - if (dTX.listVD.Count > 0) { - for (int i = 0; i < dTX.listChip.Count; i++) { - if (dTX.listChip[i].nチャンネル番号 == 0x54) { - if (dTX.listChip[i].n発声時刻ms <= nStartTime) { - this.actAVI.Seek(nStartTime - dTX.listChip[i].n発声時刻ms); - this.actAVI.Start(0x54, this.actAVI.rVD); - break; - } else { - this.actAVI.Seek(0); - } - break; - } - } - } - #endregion - #region [ PAUSEしていたサウンドを一斉に再生再開する(ただしタイマを止めているので、ここではまだ再生開始しない) ] - - if (!(OpenTaiko.ConfigIni.bNoAudioIfNot1xSpeed && OpenTaiko.ConfigIni.nSongSpeed != 20)) - foreach (CSound cs in pausedCSound) { - cs.tPlaySound(); - } - #endregion - pausedCSound.Clear(); - #region [ タイマを再開して、PAUSEから復帰する ] - SoundManager.PlayTimer.NowTime = nStartTime; - OpenTaiko.Timer.Reset(); // これでPAUSE解除されるので、3行先の再開()は不要 - OpenTaiko.Timer.NowTime = nStartTime; // Debug表示のTime: 表記を正しくするために必要 - SoundManager.PlayTimer.Resume(); - //CDTXMania.Timer.t再開(); - this.bPAUSE = false; // システムがPAUSE状態だったら、強制解除 - this.actPanel.Start(); - #endregion - #endregion } - public void t演奏中止() { - this.actFO.tフェードアウト開始(); - base.ePhaseID = CStage.EPhase.Common_FADEOUT; - this.eフェードアウト完了時の戻り値 = EGameplayScreenReturnValue.PerformanceInterrupted; + return bpm_time; + } + + public void t再読込() { + OpenTaiko.DTX.t全チップの再生停止とミキサーからの削除(); + this.eフェードアウト完了時の戻り値 = EGameplayScreenReturnValue.ReloadAndReplay; + base.ePhaseID = CStage.EPhase.Game_Reload; + this.bPAUSE = false; + } + + // Workaround for abnormal song completion animation after retrying during normal song completion animation + public void tResetGameplayFinishedStatus() { + for (int i = 0; i < 5; i++) { + ifp[i] = false; + isDeniedPlaying[i] = false; + } + } + + public void t演奏やりなおし() { + _AIBattleState = 0; + _AIBattleStateBatch = new Queue[] { new Queue(), new Queue() }; + + NowAIBattleSectionCount = 0; + NowAIBattleSectionTime = 0; + + CFloorManagement.reload(); + + for (int i = 0; i < AIBattleSections.Count; i++) { + AIBattleSections[i].End = AIBattleSection.EndType.None; + AIBattleSections[i].IsAnimated = false; } - /// - /// DTXV用の設定をする。(全AUTOなど) - /// 元の設定のバックアップなどはしないので、あとでConfig.iniを上書き保存しないこと。 - /// - protected void tDTXV用の設定() { + OpenTaiko.fCamXOffset = 0; + OpenTaiko.fCamYOffset = 0; + + OpenTaiko.fCamZoomFactor = 1.0f; + OpenTaiko.fCamRotation = 0; + + OpenTaiko.fCamXScale = 1.0f; + OpenTaiko.fCamYScale = 1.0f; + + OpenTaiko.borderColor = new Color4(1f, 0f, 0f, 0f); + + foreach (var chip in OpenTaiko.DTX.listChip) { + if (chip.obj == null) continue; + chip.obj.isVisible = false; + chip.obj.yScale = 1.0f; + chip.obj.xScale = 1.0f; + chip.obj.rotation = 0.0f; + chip.obj.opacity = 255; + chip.obj.frame = 0; } - protected abstract void t進行描画_チップ_ドラムス(CConfigIni configIni, ref CDTX dTX, ref CDTX.CChip pChip); - protected abstract void t進行描画_チップ本体_ドラムス(CConfigIni configIni, ref CDTX dTX, ref CDTX.CChip pChip); - protected abstract void t進行描画_チップ_Taiko(CConfigIni configIni, ref CDTX dTX, ref CDTX.CChip pChip, int nPlayer); - protected abstract void t進行描画_チップ_Taiko連打(CConfigIni configIni, ref CDTX dTX, ref CDTX.CChip pChip, int nPlayer); + OpenTaiko.DTX.t全チップの再生停止とミキサーからの削除(); + this.t数値の初期化(true, true); + //this.actAVI.Stop(); + foreach (var vd in OpenTaiko.DTX.listVD) { + vd.Value.Stop(); + } + this.actAVI.Stop(); + this.actPanel.t歌詞テクスチャを削除する(); + bool[] cleared = new bool[5]; + for (int i = 0; i < 5; i++) { + cleared[i] = bIsAlreadyCleared[i]; + this.t演奏位置の変更(0, i); + this.actPlayInfo.NowMeasure[i] = 0; + JPOSCROLLX[i] = 0; + JPOSCROLLY[i] = 0; + ifp[i] = false; + isDeniedPlaying[i] = false; - protected abstract void t進行描画_チップ_フィルイン(CConfigIni configIni, ref CDTX dTX, ref CDTX.CChip pChip); - protected abstract void t進行描画_チップ_小節線(CConfigIni configIni, ref CDTX dTX, ref CDTX.CChip pChip, int nPlayer); - protected void t進行描画_チップアニメ() { + OpenTaiko.ConfigIni.nGameType[i] = eFirstGameType[i]; + bSplitLane[i] = false; + } + OpenTaiko.stage演奏ドラム画面.Activate(); + for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { + if (!bIsAlreadyCleared[i] && cleared[i]) { + OpenTaiko.stage演奏ドラム画面.actBackground.ClearOut(i); + } + + if (NotesManager.IsKusudama(this.chip現在処理中の連打チップ[i]) && this.actChara.b風船連打中[i]) actBalloon.KusuMiss(); + this.chip現在処理中の連打チップ[i] = null; + this.actChara.b風船連打中[i] = false; + this.actChara.ReturnDefaultAnime(i, true); + } + this.bPAUSE = false; + } + + public void t停止() { + OpenTaiko.DTX.t全チップの再生停止とミキサーからの削除(); + foreach (var vd in OpenTaiko.DTX.listVD) { + vd.Value.Stop(); + } + this.actAVI.Stop(); + this.actPanel.Stop(); // PANEL表示停止 + OpenTaiko.Timer.Pause(); // 再生時刻カウンタ停止 + + this.n現在のトップChip = OpenTaiko.DTX.listChip.Count - 1; // 終端にシーク + + // 自分自身のOn活性化()相当の処理もすべき。 + } + + public void t数値の初期化(bool b演奏記録, bool b演奏状態) { + if (b演奏記録) { + this.nヒット数_Auto含む.Taiko.Perfect = 0; + this.nヒット数_Auto含む.Taiko.Great = 0; + this.nヒット数_Auto含む.Taiko.Good = 0; + this.nヒット数_Auto含む.Taiko.Poor = 0; + this.nヒット数_Auto含む.Taiko.Miss = 0; + + this.nヒット数_Auto含まない.Taiko.Perfect = 0; + this.nヒット数_Auto含まない.Taiko.Great = 0; + this.nヒット数_Auto含まない.Taiko.Good = 0; + this.nヒット数_Auto含まない.Taiko.Poor = 0; + this.nヒット数_Auto含まない.Taiko.Miss = 0; + + this.actCombo.Activate(); + this.actScore.Activate(); + for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { + this.actGauge.Init(OpenTaiko.ConfigIni.nRisky, i); + } + } + if (b演奏状態) { + for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { + this.bIsGOGOTIME[i] = false; + this.bIsMiss[i] = false; + this.bLEVELHOLD[i] = false; + this.b強制的に分岐させた[i] = false; + this.b譜面分岐中[i] = false; + this.b連打中[i] = false; + this.n現在のコース[i] = 0; + this.n次回のコース[i] = 0; + this.n現在の連打数[i] = 0; + this.n合計連打数[i] = 0; + this.n分岐した回数[i] = 0; + } for (int i = 0; i < 5; i++) { - ctChipAnime[i].TickLoopDB(); - ctChipAnimeLag[i].Tick(); + this.actComboVoice.tReset(i); + NowProcessingChip[i] = 0; } } + nCurrentKusudamaCount = 0; + nCurrentKusudamaRollCount = 0; - protected bool t進行描画_フェードイン_アウト() { - switch (base.ePhaseID) { - case CStage.EPhase.Common_FADEIN: - if (this.actFI.Draw() != 0) { - base.ePhaseID = CStage.EPhase.Common_NORMAL; - } + this.ReSetScore(OpenTaiko.DTX.nScoreInit[0, OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0]], OpenTaiko.DTX.nScoreDiff[OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0]]); + this.nHand = new int[] { 0, 0, 0, 0, 0 }; + } + + public void t演奏位置の変更(int nStartBar, int nPlayer) { + // まず全サウンドオフにする + OpenTaiko.DTX.t全チップの再生停止(); + this.actAVI.Stop(); + CDTX dTX = OpenTaiko.DTX; + switch (nPlayer) { + case 1: + dTX = OpenTaiko.DTX_2P; + break; + case 2: + dTX = OpenTaiko.DTX_3P; + break; + case 3: + dTX = OpenTaiko.DTX_4P; + break; + case 4: + dTX = OpenTaiko.DTX_5P; + break; + default: + break; + } + + if (dTX == null) return; //CDTXがnullの場合はプレイヤーが居ないのでその場で処理終了 + + + #region [ 再生開始小節の変更 ] + //nStartBar++; // +1が必要 + + #region [ 演奏済みフラグのついたChipをリセットする ] + for (int i = 0; i < dTX.listChip.Count; i++) { + //if(dTX.listChip[i].bHit) フラグが付いてなくてもすべてのチップをリセットする。(必要がある).2020.04.23.akasoko26 + + dTX.listChip[i].bHit = false; + dTX.listChip[i].bShow = true; + dTX.listChip[i].bProcessed = false; + dTX.listChip[i].b可視 = true; + dTX.listChip[i].IsHitted = false; + dTX.listChip[i].IsMissed = false; + dTX.listChip[i].eNoteState = ENoteState.None; + dTX.listChip[i].nProcessTime = 0; + dTX.listChip[i].nRollCount = 0; + dTX.listChip[i].nRollCount = 0; + } + #endregion + + #region [ 処理を開始するチップの特定 ] + //for ( int i = this.n現在のトップChip; i < CDTXMania.DTX.listChip.Count; i++ ) + bool bSuccessSeek = false; + for (int i = 0; i < dTX.listChip.Count; i++) { + CDTX.CChip pChip = dTX.listChip[i]; + if (nStartBar == 0) { + if (pChip.n発声位置 < 384 * nStartBar) { + continue; + } else { + bSuccessSeek = true; + this.n現在のトップChip = i; break; - - case CStage.EPhase.Common_FADEOUT: - case CStage.EPhase.Game_STAGE_FAILED_FadeOut: - if (this.actFO.Draw() != 0) { - return true; - } + } + } else { + if (pChip.nチャンネル番号 == 0x50 && pChip.n整数値_内部番号 > nStartBar - 1) { + bSuccessSeek = true; + this.n現在のトップChip = i; break; + } + } + } + if (!bSuccessSeek) { + // this.n現在のトップChip = CDTXMania.DTX.listChip.Count - 1; + this.n現在のトップChip = 0; // 対象小節が存在しないなら、最初から再生 + } else { + while (this.n現在のトップChip != 0 && dTX.listChip[this.n現在のトップChip].n発声時刻ms == dTX.listChip[OpenTaiko.stage演奏ドラム画面.n現在のトップChip - 1].n発声時刻ms) + OpenTaiko.stage演奏ドラム画面.n現在のトップChip--; + } + #endregion + #region [ 演奏開始の発声時刻msを取得し、タイマに設定 ] + int nStartTime = (int)(dTX.listChip[this.n現在のトップChip].n発声時刻ms / OpenTaiko.ConfigIni.SongPlaybackSpeed); - case CStage.EPhase.Game_STAGE_CLEAR_FadeOut: - if (this.actFOClear.Draw() == 0) { + SoundManager.PlayTimer.Reset(); // これでPAUSE解除されるので、次のPAUSEチェックは不要 + //if ( !this.bPAUSE ) + //{ + SoundManager.PlayTimer.Pause(); + //} + SoundManager.PlayTimer.NowTime = nStartTime; + #endregion + + List pausedCSound = new List(); + + #region [ BGMやギターなど、演奏開始のタイミングで再生がかかっているサウンドのの途中再生開始 ] // (CDTXのt入力_行解析_チップ配置()で小節番号が+1されているのを削っておくこと) + for (int i = this.n現在のトップChip; i >= 0; i--) { + CDTX.CChip pChip = dTX.listChip[i]; + int nDuration = pChip.GetDuration(); + long n発声時刻ms = (long)(pChip.n発声時刻ms / OpenTaiko.ConfigIni.SongPlaybackSpeed); + + if ((n発声時刻ms + nDuration > 0) && (n発声時刻ms <= nStartTime) && (nStartTime <= n発声時刻ms + nDuration)) { + if (pChip.nチャンネル番号 == 0x01 && (pChip.nチャンネル番号 >> 4) != 0xB) // wav系チャンネル、且つ、空打ちチップではない + { + CDTX.CWAV wc; + bool b = dTX.listWAV.TryGetValue(pChip.n整数値_内部番号, out wc); + if (!b) continue; + + if ((wc.bIsBGMSound && OpenTaiko.ConfigIni.bBGMPlayVoiceSound) || (!wc.bIsBGMSound)) { + OpenTaiko.DTX.tチップの再生(pChip, (long)(SoundManager.PlayTimer.PrevResetTime) + (long)(pChip.n発声時刻ms / OpenTaiko.ConfigIni.SongPlaybackSpeed)); + #region [ PAUSEする ] + int j = wc.n現在再生中のサウンド番号; + if (wc.rSound[j] != null) { + wc.rSound[j].Pause(); + wc.rSound[j].tSetPositonToBegin(nStartTime - n発声時刻ms); + pausedCSound.Add(wc.rSound[j]); + } + #endregion + } + } + } + } + #endregion + #region [ 演奏開始時点で既に表示されているBGAとAVIの、シークと再生 ] + if (dTX.listVD.Count > 0) { + for (int i = 0; i < dTX.listChip.Count; i++) { + if (dTX.listChip[i].nチャンネル番号 == 0x54) { + if (dTX.listChip[i].n発声時刻ms <= nStartTime) { + this.actAVI.Seek(nStartTime - dTX.listChip[i].n発声時刻ms); + this.actAVI.Start(0x54, this.actAVI.rVD); break; + } else { + this.actAVI.Seek(0); } - return true; - - } - return false; - } - - protected abstract void t進行描画_演奏情報(); - protected void t進行描画_演奏情報(int x, int y) { - if (!OpenTaiko.ConfigIni.bDoNotDisplayPerformanceInfos) { - this.actPlayInfo.t進行描画(x, y); - } - } - protected void t進行描画_背景() { - if (this.tx背景 != null) { - this.tx背景.t2D描画(0, 0); - } - } - - protected void t進行描画_判定文字列1_通常位置指定の場合() { - if (((EJudgeTextDisplayPosition)OpenTaiko.ConfigIni.JudgeTextDisplayPosition.Drums) != EJudgeTextDisplayPosition.BelowCombo) // 判定ライン上または横 - { - this.actJudgeString.Draw(); - } - } - - protected void t進行描画_譜面スクロール速度() { - this.act譜面スクロール速度.Draw(); - } - protected abstract void t紙吹雪_開始(); - protected abstract void t背景テクスチャの生成(); - protected void t背景テクスチャの生成(string DefaultBgFilename, Rectangle bgrect, string bgfilename) { - try { - if (!String.IsNullOrEmpty(bgfilename)) - this.tx背景 = OpenTaiko.tテクスチャの生成(OpenTaiko.stageSongSelect.r確定されたスコア.ファイル情報.フォルダの絶対パス + bgfilename); - else - this.tx背景 = OpenTaiko.tテクスチャの生成(CSkin.Path(DefaultBgFilename)); - } catch (Exception e) { - Trace.TraceError(e.ToString()); - Trace.TraceError("例外が発生しましたが処理を継続します。 (a80767e1-4de7-4fec-b072-d078b3659e62)"); - this.tx背景 = null; - } - } - - private int nDice = 0; - - public ENoteJudge AlterJudgement(int player, ENoteJudge judgement, bool reroll) { - int AILevel = OpenTaiko.ConfigIni.nAILevel; - if (OpenTaiko.ConfigIni.bAIBattleMode && player == 1) { - if (reroll) - nDice = OpenTaiko.Random.Next(1000); - - if (nDice < OpenTaiko.ConfigIni.apAIPerformances[AILevel - 1].nBadOdds) - return ENoteJudge.Poor; - else if (nDice - OpenTaiko.ConfigIni.apAIPerformances[AILevel - 1].nBadOdds - < OpenTaiko.ConfigIni.apAIPerformances[AILevel - 1].nGoodOdds) - return ENoteJudge.Good; - } - return judgement; - } - - public void ReSetScore(int scoreInit, int scoreDiff) { - //一打目の処理落ちがひどいので、あらかじめここで点数の計算をしておく。 - // -1だった場合、その前を引き継ぐ。 - int nInit = scoreInit != -1 ? scoreInit : this.nScore[0]; - int nDiff = scoreDiff != -1 ? scoreDiff : this.nScore[1] - this.nScore[0]; - int nAddScore = 0; - int[] n倍率 = { 0, 1, 2, 4, 8 }; - - if (OpenTaiko.DTX.nScoreModeTmp == 1) { - for (int i = 0; i < 11; i++) { - this.nScore[i] = (int)(nInit + (nDiff * (i))); - } - } else if (OpenTaiko.DTX.nScoreModeTmp == 2) { - for (int i = 0; i < 5; i++) { - this.nScore[i] = (int)(nInit + (nDiff * n倍率[i])); - - this.nScore[i] = (int)(this.nScore[i] / 10.0); - this.nScore[i] = this.nScore[i] * 10; - + break; } } } + #endregion + #region [ PAUSEしていたサウンドを一斉に再生再開する(ただしタイマを止めているので、ここではまだ再生開始しない) ] - - #region [EXTENDED COMMANDS] - private CCounter ctCamVMove; - private CCounter ctCamHMove; - private CCounter ctCamZoom; - private CCounter ctCamRotation; - private CCounter ctCamVScale; - private CCounter ctCamHScale; - - private CDTX.CChip currentCamVMoveChip; - private CDTX.CChip currentCamHMoveChip; - private CDTX.CChip currentCamZoomChip; - private CDTX.CChip currentCamRotateChip; - private CDTX.CChip currentCamVScaleChip; - private CDTX.CChip currentCamHScaleChip; - - private Dictionary camHandlers; - private Dictionary objHandlers; - - private Easing easing = new Easing(); - - public bool bCustomDoron = false; - private bool bConfigUpdated = false; + if (!(OpenTaiko.ConfigIni.bNoAudioIfNot1xSpeed && OpenTaiko.ConfigIni.nSongSpeed != 20)) + foreach (CSound cs in pausedCSound) { + cs.tPlaySound(); + } + #endregion + pausedCSound.Clear(); + #region [ タイマを再開して、PAUSEから復帰する ] + SoundManager.PlayTimer.NowTime = nStartTime; + OpenTaiko.Timer.Reset(); // これでPAUSE解除されるので、3行先の再開()は不要 + OpenTaiko.Timer.NowTime = nStartTime; // Debug表示のTime: 表記を正しくするために必要 + SoundManager.PlayTimer.Resume(); + //CDTXMania.Timer.t再開(); + this.bPAUSE = false; // システムがPAUSE状態だったら、強制解除 + this.actPanel.Start(); + #endregion #endregion } + + public void t演奏中止() { + this.actFO.tフェードアウト開始(); + base.ePhaseID = CStage.EPhase.Common_FADEOUT; + this.eフェードアウト完了時の戻り値 = EGameplayScreenReturnValue.PerformanceInterrupted; + } + + /// + /// DTXV用の設定をする。(全AUTOなど) + /// 元の設定のバックアップなどはしないので、あとでConfig.iniを上書き保存しないこと。 + /// + protected void tDTXV用の設定() { + + } + + protected abstract void t進行描画_チップ_ドラムス(CConfigIni configIni, ref CDTX dTX, ref CDTX.CChip pChip); + protected abstract void t進行描画_チップ本体_ドラムス(CConfigIni configIni, ref CDTX dTX, ref CDTX.CChip pChip); + protected abstract void t進行描画_チップ_Taiko(CConfigIni configIni, ref CDTX dTX, ref CDTX.CChip pChip, int nPlayer); + protected abstract void t進行描画_チップ_Taiko連打(CConfigIni configIni, ref CDTX dTX, ref CDTX.CChip pChip, int nPlayer); + + protected abstract void t進行描画_チップ_フィルイン(CConfigIni configIni, ref CDTX dTX, ref CDTX.CChip pChip); + protected abstract void t進行描画_チップ_小節線(CConfigIni configIni, ref CDTX dTX, ref CDTX.CChip pChip, int nPlayer); + protected void t進行描画_チップアニメ() { + for (int i = 0; i < 5; i++) { + ctChipAnime[i].TickLoopDB(); + ctChipAnimeLag[i].Tick(); + } + } + + protected bool t進行描画_フェードイン_アウト() { + switch (base.ePhaseID) { + case CStage.EPhase.Common_FADEIN: + if (this.actFI.Draw() != 0) { + base.ePhaseID = CStage.EPhase.Common_NORMAL; + } + break; + + case CStage.EPhase.Common_FADEOUT: + case CStage.EPhase.Game_STAGE_FAILED_FadeOut: + if (this.actFO.Draw() != 0) { + return true; + } + break; + + case CStage.EPhase.Game_STAGE_CLEAR_FadeOut: + if (this.actFOClear.Draw() == 0) { + break; + } + return true; + + } + return false; + } + + protected abstract void t進行描画_演奏情報(); + protected void t進行描画_演奏情報(int x, int y) { + if (!OpenTaiko.ConfigIni.bDoNotDisplayPerformanceInfos) { + this.actPlayInfo.t進行描画(x, y); + } + } + protected void t進行描画_背景() { + if (this.tx背景 != null) { + this.tx背景.t2D描画(0, 0); + } + } + + protected void t進行描画_判定文字列1_通常位置指定の場合() { + if (((EJudgeTextDisplayPosition)OpenTaiko.ConfigIni.JudgeTextDisplayPosition.Drums) != EJudgeTextDisplayPosition.BelowCombo) // 判定ライン上または横 + { + this.actJudgeString.Draw(); + } + } + + protected void t進行描画_譜面スクロール速度() { + this.act譜面スクロール速度.Draw(); + } + protected abstract void t紙吹雪_開始(); + protected abstract void t背景テクスチャの生成(); + protected void t背景テクスチャの生成(string DefaultBgFilename, Rectangle bgrect, string bgfilename) { + try { + if (!String.IsNullOrEmpty(bgfilename)) + this.tx背景 = OpenTaiko.tテクスチャの生成(OpenTaiko.stageSongSelect.r確定されたスコア.ファイル情報.フォルダの絶対パス + bgfilename); + else + this.tx背景 = OpenTaiko.tテクスチャの生成(CSkin.Path(DefaultBgFilename)); + } catch (Exception e) { + Trace.TraceError(e.ToString()); + Trace.TraceError("例外が発生しましたが処理を継続します。 (a80767e1-4de7-4fec-b072-d078b3659e62)"); + this.tx背景 = null; + } + } + + private int nDice = 0; + + public ENoteJudge AlterJudgement(int player, ENoteJudge judgement, bool reroll) { + int AILevel = OpenTaiko.ConfigIni.nAILevel; + if (OpenTaiko.ConfigIni.bAIBattleMode && player == 1) { + if (reroll) + nDice = OpenTaiko.Random.Next(1000); + + if (nDice < OpenTaiko.ConfigIni.apAIPerformances[AILevel - 1].nBadOdds) + return ENoteJudge.Poor; + else if (nDice - OpenTaiko.ConfigIni.apAIPerformances[AILevel - 1].nBadOdds + < OpenTaiko.ConfigIni.apAIPerformances[AILevel - 1].nGoodOdds) + return ENoteJudge.Good; + } + return judgement; + } + + public void ReSetScore(int scoreInit, int scoreDiff) { + //一打目の処理落ちがひどいので、あらかじめここで点数の計算をしておく。 + // -1だった場合、その前を引き継ぐ。 + int nInit = scoreInit != -1 ? scoreInit : this.nScore[0]; + int nDiff = scoreDiff != -1 ? scoreDiff : this.nScore[1] - this.nScore[0]; + int nAddScore = 0; + int[] n倍率 = { 0, 1, 2, 4, 8 }; + + if (OpenTaiko.DTX.nScoreModeTmp == 1) { + for (int i = 0; i < 11; i++) { + this.nScore[i] = (int)(nInit + (nDiff * (i))); + } + } else if (OpenTaiko.DTX.nScoreModeTmp == 2) { + for (int i = 0; i < 5; i++) { + this.nScore[i] = (int)(nInit + (nDiff * n倍率[i])); + + this.nScore[i] = (int)(this.nScore[i] / 10.0); + this.nScore[i] = this.nScore[i] * 10; + + } + } + } + + + #region [EXTENDED COMMANDS] + private CCounter ctCamVMove; + private CCounter ctCamHMove; + private CCounter ctCamZoom; + private CCounter ctCamRotation; + private CCounter ctCamVScale; + private CCounter ctCamHScale; + + private CDTX.CChip currentCamVMoveChip; + private CDTX.CChip currentCamHMoveChip; + private CDTX.CChip currentCamZoomChip; + private CDTX.CChip currentCamRotateChip; + private CDTX.CChip currentCamVScaleChip; + private CDTX.CChip currentCamHScaleChip; + + private Dictionary camHandlers; + private Dictionary objHandlers; + + private Easing easing = new Easing(); + + public bool bCustomDoron = false; + private bool bConfigUpdated = false; + #endregion } diff --git a/OpenTaiko/src/Stages/07.Game/Taiko/AIBattle.cs b/OpenTaiko/src/Stages/07.Game/Taiko/AIBattle.cs index eaba3791..83d0c904 100644 --- a/OpenTaiko/src/Stages/07.Game/Taiko/AIBattle.cs +++ b/OpenTaiko/src/Stages/07.Game/Taiko/AIBattle.cs @@ -2,202 +2,202 @@ using FDK; // Minimalist menu class to use for custom menus -namespace OpenTaiko { - class AIBattle : CStage { - public AIBattle() { - base.IsDeActivated = true; - } +namespace OpenTaiko; - public override void Activate() { - // On activation - - BarFlashCounter = new CCounter(0, 1000.0, 0.00035, SoundManager.PlayTimer); - - BatchAnimeCounter = new CCounter(0, 10000.0, 1.0 / 1000.0, SoundManager.PlayTimer); - - base.Activate(); - } - - public override void DeActivate() { - // On de-activation - - base.DeActivate(); - } - - public override void CreateManagedResource() { - // Ressource allocation - - base.CreateManagedResource(); - } - - public override void ReleaseManagedResource() { - // Ressource freeing - - base.ReleaseManagedResource(); - } - - public override int Draw() { - BarFlashCounter.TickLoopDB(); - BatchAnimeCounter.TickDB(); - - OpenTaiko.Tx.AIBattle_SectionTime_Panel?.t2D描画(OpenTaiko.Skin.Game_AIBattle_SectionTime_Panel[0], OpenTaiko.Skin.Game_AIBattle_SectionTime_Panel[1]); - - OpenTaiko.Tx.AIBattle_SectionTime_Bar_Base?.t2D描画(OpenTaiko.Skin.Game_AIBattle_SectionTime_Bar[0], OpenTaiko.Skin.Game_AIBattle_SectionTime_Bar[1], - new System.Drawing.RectangleF(0, 0, OpenTaiko.Tx.AIBattle_SectionTime_Bar_Base.szTextureSize.Width, OpenTaiko.Tx.AIBattle_SectionTime_Bar_Base.szTextureSize.Height)); - - void drawBar(CTexture barTex, float length) { - barTex?.t2D描画(OpenTaiko.Skin.Game_AIBattle_SectionTime_Bar[0], OpenTaiko.Skin.Game_AIBattle_SectionTime_Bar[1], - new System.Drawing.RectangleF(0, 0, barTex.szTextureSize.Width * length, barTex.szTextureSize.Height)); - } - - var nowSection = OpenTaiko.stage演奏ドラム画面.NowAIBattleSection; - - float nowLength = OpenTaiko.stage演奏ドラム画面.NowAIBattleSectionTime / (float)nowSection.Length; - nowLength = Math.Min(nowLength, 1.0f); - - if (nowLength < 0.75) { - drawBar(OpenTaiko.Tx.AIBattle_SectionTime_Bar_Normal, nowLength); - } else { - OpenTaiko.Tx.AIBattle_SectionTime_Bar_Finish.Opacity = (int)(Math.Sin((BarFlashCounter.CurrentValue / 1000.0) * Math.PI) * 255); - drawBar(OpenTaiko.Tx.AIBattle_SectionTime_Bar_Finish, nowLength); - } - - for (int i = 0; i < OpenTaiko.stage演奏ドラム画面.AIBattleSections.Count; i++) { - int upDown = (i % 2); - - int base_width = OpenTaiko.Tx.AIBattle_Batch_Base.szTextureSize.Width / 6; - int base_height = OpenTaiko.Tx.AIBattle_Batch_Base.szTextureSize.Height; - - int base_x = OpenTaiko.Skin.Game_AIBattle_Batch_Base[0] + (OpenTaiko.Skin.Game_AIBattle_Batch_Move[0] * i); - int base_y = OpenTaiko.Skin.Game_AIBattle_Batch_Base[1] + (OpenTaiko.Skin.Game_AIBattle_Batch_Move[1] * upDown); - - int nowBatchBaseRectX; - - if (i == 0) { - nowBatchBaseRectX = 2 + (upDown == 0 ? 0 : 1); - } else if (i == OpenTaiko.stage演奏ドラム画面.AIBattleSections.Count - 1) { - nowBatchBaseRectX = 4 + (upDown == 0 ? 0 : 1); - } else { - nowBatchBaseRectX = (upDown == 0 ? 0 : 1); - } - - OpenTaiko.Tx.AIBattle_Batch_Base?.t2D描画(base_x, base_y, new System.Drawing.RectangleF(base_width * nowBatchBaseRectX, 0, base_width, base_height)); - } - - for (int i = 0; i < OpenTaiko.stage演奏ドラム画面.NowAIBattleSectionCount; i++) { - - var section = OpenTaiko.stage演奏ドラム画面.AIBattleSections[i]; - - int upDown = (i % 2); - - int width = OpenTaiko.Tx.AIBattle_Batch.szTextureSize.Width / 6; - int height = OpenTaiko.Tx.AIBattle_Batch.szTextureSize.Height / 2; - - float value = 0.0f; - - float inScale = 0.0f; - - int drawFrame = 5; - - if (section.IsAnimated) { - value = 1.0f; - } else { - if (BatchAnimeCounter.CurrentValue < 100) { - inScale = 1.0f - (BatchAnimeCounter.CurrentValue / 100.0f); - } else if (BatchAnimeCounter.CurrentValue >= 700 && BatchAnimeCounter.CurrentValue < 1000) { - drawFrame = (int)(((BatchAnimeCounter.CurrentValue - 700) / 300.0) * 4.0); - } else if (BatchAnimeCounter.CurrentValue >= 1400 && BatchAnimeCounter.CurrentValue <= 1500) { - value = Math.Min((BatchAnimeCounter.CurrentValue - 1400) / 100.0f, 1.0f); - } else if (BatchAnimeCounter.CurrentValue >= 1500) { - value = 1.0f; - section.IsAnimated = true; - } - } - - float _x = OpenTaiko.Skin.Game_AIBattle_Batch[0] + (OpenTaiko.Skin.Game_AIBattle_Batch_Move[0] * i); - float _y = OpenTaiko.Skin.Game_AIBattle_Batch[1] + (OpenTaiko.Skin.Game_AIBattle_Batch_Move[1] * upDown); - - _x = OpenTaiko.Skin.Game_AIBattle_Batch_Anime[0] + ((_x - OpenTaiko.Skin.Game_AIBattle_Batch_Anime[0]) * value); - _y = OpenTaiko.Skin.Game_AIBattle_Batch_Anime[1] + ((_y - OpenTaiko.Skin.Game_AIBattle_Batch_Anime[1]) * value); - - - float size_x = OpenTaiko.Skin.Game_AIBattle_Batch_Anime_Size[0] + - ((OpenTaiko.Skin.Game_AIBattle_Batch_Size[0] - OpenTaiko.Skin.Game_AIBattle_Batch_Anime_Size[0]) * value); - - float size_y = OpenTaiko.Skin.Game_AIBattle_Batch_Anime_Size[1] + - ((OpenTaiko.Skin.Game_AIBattle_Batch_Size[1] - OpenTaiko.Skin.Game_AIBattle_Batch_Anime_Size[1]) * value); - - OpenTaiko.Tx.AIBattle_Batch.vcScaleRatio.X = (size_x / (float)width) + inScale; - OpenTaiko.Tx.AIBattle_Batch.vcScaleRatio.Y = (size_y / (float)height) + inScale; - - switch (section.End) { - case CStage演奏画面共通.AIBattleSection.EndType.Clear: - OpenTaiko.Tx.AIBattle_Batch?.t2D拡大率考慮中央基準描画(_x, _y, new System.Drawing.RectangleF(width * drawFrame, 0, width, height)); - break; - case CStage演奏画面共通.AIBattleSection.EndType.Lose: - OpenTaiko.Tx.AIBattle_Batch?.t2D拡大率考慮中央基準描画(_x, _y, new System.Drawing.RectangleF(width * drawFrame, height, width, height)); - break; - } - } - - for (int player = 0; player < 2; player++) { - OpenTaiko.Tx.AIBattle_Judge_Meter[player]?.t2D描画(OpenTaiko.Skin.Game_AIBattle_Judge_Meter_X[player], OpenTaiko.Skin.Game_AIBattle_Judge_Meter_Y[player]); - - - int[] numArr = new int[4] - { - OpenTaiko.stage演奏ドラム画面.CSectionScore[player].nGreat, - OpenTaiko.stage演奏ドラム画面.CSectionScore[player].nGood, - OpenTaiko.stage演奏ドラム画面.CSectionScore[player].nMiss, - OpenTaiko.stage演奏ドラム画面.CSectionScore[player].nRoll - }; - - int[] num_x = new int[4] - { - OpenTaiko.Skin.Game_AIBattle_Judge_Number_Perfect_X[player], - OpenTaiko.Skin.Game_AIBattle_Judge_Number_Good_X[player], - OpenTaiko.Skin.Game_AIBattle_Judge_Number_Miss_X[player], - OpenTaiko.Skin.Game_AIBattle_Judge_Number_Roll_X[player] - }; - - int[] num_y = new int[4] - { - OpenTaiko.Skin.Game_AIBattle_Judge_Number_Perfect_Y[player], - OpenTaiko.Skin.Game_AIBattle_Judge_Number_Good_Y[player], - OpenTaiko.Skin.Game_AIBattle_Judge_Number_Miss_Y[player], - OpenTaiko.Skin.Game_AIBattle_Judge_Number_Roll_Y[player] - }; - - for (int i = 0; i < 4; i++) { - DrawJudgeNumber(num_x[i], num_y[i], numArr[i]); - } - } - - - return 0; - } - - #region [Private] - - private CCounter BarFlashCounter; - public CCounter BatchAnimeCounter; - - private void DrawJudgeNumber(int x, int y, int num) { - int[] nums = CConversion.SeparateDigits(num); - for (int j = 0; j < nums.Length; j++) { - float offset = j - (nums.Length / 2.0f); - - float width = OpenTaiko.Tx.AIBattle_Judge_Number.sz画像サイズ.Width / 10.0f; - float height = OpenTaiko.Tx.AIBattle_Judge_Number.sz画像サイズ.Height; - - float _x = x - (OpenTaiko.Skin.Game_AIBattle_Judge_Number_Interval[0] * offset); - float _y = y - (OpenTaiko.Skin.Game_AIBattle_Judge_Number_Interval[1] * offset); - - OpenTaiko.Tx.AIBattle_Judge_Number.t2D拡大率考慮中央基準描画(_x + (width / 2), _y + (height / 2), - new RectangleF(width * nums[j], 0, width, height)); - } - } - - #endregion +class AIBattle : CStage { + public AIBattle() { + base.IsDeActivated = true; } + + public override void Activate() { + // On activation + + BarFlashCounter = new CCounter(0, 1000.0, 0.00035, SoundManager.PlayTimer); + + BatchAnimeCounter = new CCounter(0, 10000.0, 1.0 / 1000.0, SoundManager.PlayTimer); + + base.Activate(); + } + + public override void DeActivate() { + // On de-activation + + base.DeActivate(); + } + + public override void CreateManagedResource() { + // Ressource allocation + + base.CreateManagedResource(); + } + + public override void ReleaseManagedResource() { + // Ressource freeing + + base.ReleaseManagedResource(); + } + + public override int Draw() { + BarFlashCounter.TickLoopDB(); + BatchAnimeCounter.TickDB(); + + OpenTaiko.Tx.AIBattle_SectionTime_Panel?.t2D描画(OpenTaiko.Skin.Game_AIBattle_SectionTime_Panel[0], OpenTaiko.Skin.Game_AIBattle_SectionTime_Panel[1]); + + OpenTaiko.Tx.AIBattle_SectionTime_Bar_Base?.t2D描画(OpenTaiko.Skin.Game_AIBattle_SectionTime_Bar[0], OpenTaiko.Skin.Game_AIBattle_SectionTime_Bar[1], + new System.Drawing.RectangleF(0, 0, OpenTaiko.Tx.AIBattle_SectionTime_Bar_Base.szTextureSize.Width, OpenTaiko.Tx.AIBattle_SectionTime_Bar_Base.szTextureSize.Height)); + + void drawBar(CTexture barTex, float length) { + barTex?.t2D描画(OpenTaiko.Skin.Game_AIBattle_SectionTime_Bar[0], OpenTaiko.Skin.Game_AIBattle_SectionTime_Bar[1], + new System.Drawing.RectangleF(0, 0, barTex.szTextureSize.Width * length, barTex.szTextureSize.Height)); + } + + var nowSection = OpenTaiko.stage演奏ドラム画面.NowAIBattleSection; + + float nowLength = OpenTaiko.stage演奏ドラム画面.NowAIBattleSectionTime / (float)nowSection.Length; + nowLength = Math.Min(nowLength, 1.0f); + + if (nowLength < 0.75) { + drawBar(OpenTaiko.Tx.AIBattle_SectionTime_Bar_Normal, nowLength); + } else { + OpenTaiko.Tx.AIBattle_SectionTime_Bar_Finish.Opacity = (int)(Math.Sin((BarFlashCounter.CurrentValue / 1000.0) * Math.PI) * 255); + drawBar(OpenTaiko.Tx.AIBattle_SectionTime_Bar_Finish, nowLength); + } + + for (int i = 0; i < OpenTaiko.stage演奏ドラム画面.AIBattleSections.Count; i++) { + int upDown = (i % 2); + + int base_width = OpenTaiko.Tx.AIBattle_Batch_Base.szTextureSize.Width / 6; + int base_height = OpenTaiko.Tx.AIBattle_Batch_Base.szTextureSize.Height; + + int base_x = OpenTaiko.Skin.Game_AIBattle_Batch_Base[0] + (OpenTaiko.Skin.Game_AIBattle_Batch_Move[0] * i); + int base_y = OpenTaiko.Skin.Game_AIBattle_Batch_Base[1] + (OpenTaiko.Skin.Game_AIBattle_Batch_Move[1] * upDown); + + int nowBatchBaseRectX; + + if (i == 0) { + nowBatchBaseRectX = 2 + (upDown == 0 ? 0 : 1); + } else if (i == OpenTaiko.stage演奏ドラム画面.AIBattleSections.Count - 1) { + nowBatchBaseRectX = 4 + (upDown == 0 ? 0 : 1); + } else { + nowBatchBaseRectX = (upDown == 0 ? 0 : 1); + } + + OpenTaiko.Tx.AIBattle_Batch_Base?.t2D描画(base_x, base_y, new System.Drawing.RectangleF(base_width * nowBatchBaseRectX, 0, base_width, base_height)); + } + + for (int i = 0; i < OpenTaiko.stage演奏ドラム画面.NowAIBattleSectionCount; i++) { + + var section = OpenTaiko.stage演奏ドラム画面.AIBattleSections[i]; + + int upDown = (i % 2); + + int width = OpenTaiko.Tx.AIBattle_Batch.szTextureSize.Width / 6; + int height = OpenTaiko.Tx.AIBattle_Batch.szTextureSize.Height / 2; + + float value = 0.0f; + + float inScale = 0.0f; + + int drawFrame = 5; + + if (section.IsAnimated) { + value = 1.0f; + } else { + if (BatchAnimeCounter.CurrentValue < 100) { + inScale = 1.0f - (BatchAnimeCounter.CurrentValue / 100.0f); + } else if (BatchAnimeCounter.CurrentValue >= 700 && BatchAnimeCounter.CurrentValue < 1000) { + drawFrame = (int)(((BatchAnimeCounter.CurrentValue - 700) / 300.0) * 4.0); + } else if (BatchAnimeCounter.CurrentValue >= 1400 && BatchAnimeCounter.CurrentValue <= 1500) { + value = Math.Min((BatchAnimeCounter.CurrentValue - 1400) / 100.0f, 1.0f); + } else if (BatchAnimeCounter.CurrentValue >= 1500) { + value = 1.0f; + section.IsAnimated = true; + } + } + + float _x = OpenTaiko.Skin.Game_AIBattle_Batch[0] + (OpenTaiko.Skin.Game_AIBattle_Batch_Move[0] * i); + float _y = OpenTaiko.Skin.Game_AIBattle_Batch[1] + (OpenTaiko.Skin.Game_AIBattle_Batch_Move[1] * upDown); + + _x = OpenTaiko.Skin.Game_AIBattle_Batch_Anime[0] + ((_x - OpenTaiko.Skin.Game_AIBattle_Batch_Anime[0]) * value); + _y = OpenTaiko.Skin.Game_AIBattle_Batch_Anime[1] + ((_y - OpenTaiko.Skin.Game_AIBattle_Batch_Anime[1]) * value); + + + float size_x = OpenTaiko.Skin.Game_AIBattle_Batch_Anime_Size[0] + + ((OpenTaiko.Skin.Game_AIBattle_Batch_Size[0] - OpenTaiko.Skin.Game_AIBattle_Batch_Anime_Size[0]) * value); + + float size_y = OpenTaiko.Skin.Game_AIBattle_Batch_Anime_Size[1] + + ((OpenTaiko.Skin.Game_AIBattle_Batch_Size[1] - OpenTaiko.Skin.Game_AIBattle_Batch_Anime_Size[1]) * value); + + OpenTaiko.Tx.AIBattle_Batch.vcScaleRatio.X = (size_x / (float)width) + inScale; + OpenTaiko.Tx.AIBattle_Batch.vcScaleRatio.Y = (size_y / (float)height) + inScale; + + switch (section.End) { + case CStage演奏画面共通.AIBattleSection.EndType.Clear: + OpenTaiko.Tx.AIBattle_Batch?.t2D拡大率考慮中央基準描画(_x, _y, new System.Drawing.RectangleF(width * drawFrame, 0, width, height)); + break; + case CStage演奏画面共通.AIBattleSection.EndType.Lose: + OpenTaiko.Tx.AIBattle_Batch?.t2D拡大率考慮中央基準描画(_x, _y, new System.Drawing.RectangleF(width * drawFrame, height, width, height)); + break; + } + } + + for (int player = 0; player < 2; player++) { + OpenTaiko.Tx.AIBattle_Judge_Meter[player]?.t2D描画(OpenTaiko.Skin.Game_AIBattle_Judge_Meter_X[player], OpenTaiko.Skin.Game_AIBattle_Judge_Meter_Y[player]); + + + int[] numArr = new int[4] + { + OpenTaiko.stage演奏ドラム画面.CSectionScore[player].nGreat, + OpenTaiko.stage演奏ドラム画面.CSectionScore[player].nGood, + OpenTaiko.stage演奏ドラム画面.CSectionScore[player].nMiss, + OpenTaiko.stage演奏ドラム画面.CSectionScore[player].nRoll + }; + + int[] num_x = new int[4] + { + OpenTaiko.Skin.Game_AIBattle_Judge_Number_Perfect_X[player], + OpenTaiko.Skin.Game_AIBattle_Judge_Number_Good_X[player], + OpenTaiko.Skin.Game_AIBattle_Judge_Number_Miss_X[player], + OpenTaiko.Skin.Game_AIBattle_Judge_Number_Roll_X[player] + }; + + int[] num_y = new int[4] + { + OpenTaiko.Skin.Game_AIBattle_Judge_Number_Perfect_Y[player], + OpenTaiko.Skin.Game_AIBattle_Judge_Number_Good_Y[player], + OpenTaiko.Skin.Game_AIBattle_Judge_Number_Miss_Y[player], + OpenTaiko.Skin.Game_AIBattle_Judge_Number_Roll_Y[player] + }; + + for (int i = 0; i < 4; i++) { + DrawJudgeNumber(num_x[i], num_y[i], numArr[i]); + } + } + + + return 0; + } + + #region [Private] + + private CCounter BarFlashCounter; + public CCounter BatchAnimeCounter; + + private void DrawJudgeNumber(int x, int y, int num) { + int[] nums = CConversion.SeparateDigits(num); + for (int j = 0; j < nums.Length; j++) { + float offset = j - (nums.Length / 2.0f); + + float width = OpenTaiko.Tx.AIBattle_Judge_Number.sz画像サイズ.Width / 10.0f; + float height = OpenTaiko.Tx.AIBattle_Judge_Number.sz画像サイズ.Height; + + float _x = x - (OpenTaiko.Skin.Game_AIBattle_Judge_Number_Interval[0] * offset); + float _y = y - (OpenTaiko.Skin.Game_AIBattle_Judge_Number_Interval[1] * offset); + + OpenTaiko.Tx.AIBattle_Judge_Number.t2D拡大率考慮中央基準描画(_x + (width / 2), _y + (height / 2), + new RectangleF(width * nums[j], 0, width, height)); + } + } + + #endregion } diff --git a/OpenTaiko/src/Stages/07.Game/Taiko/CActImplBackground.cs b/OpenTaiko/src/Stages/07.Game/Taiko/CActImplBackground.cs index 5cc85d6e..6342b829 100644 --- a/OpenTaiko/src/Stages/07.Game/Taiko/CActImplBackground.cs +++ b/OpenTaiko/src/Stages/07.Game/Taiko/CActImplBackground.cs @@ -3,605 +3,605 @@ using static OpenTaiko.CActSelect曲リスト; using Color = System.Drawing.Color; using Rectangle = System.Drawing.Rectangle; -namespace OpenTaiko { - internal class CActImplBackground : CActivity { - // 本家っぽい背景を表示させるメソッド。 - // - // 拡張性とかないんで。はい、ヨロシクゥ! - // - public CActImplBackground() { - base.IsDeActivated = true; +namespace OpenTaiko; + +internal class CActImplBackground : CActivity { + // 本家っぽい背景を表示させるメソッド。 + // + // 拡張性とかないんで。はい、ヨロシクゥ! + // + public CActImplBackground() { + base.IsDeActivated = true; + } + + public void tFadeIn(int player) { + //this.ct上背景クリアインタイマー[player] = new CCounter(0, 100, 2, TJAPlayer3.Timer); + this.eFadeMode = EFIFOMode.FadeIn; + } + + //public void tFadeOut(int player) + //{ + // this.ct上背景フェードタイマー[player] = new CCounter( 0, 100, 6, CDTXMania.Timer ); + // this.eFadeMode = EFIFOモード.フェードアウト; + //} + + public void ClearIn(int player) { + /*this.ct上背景クリアインタイマー[player] = new CCounter(0, 100, 2, TJAPlayer3.Timer); + this.ct上背景クリアインタイマー[player].n現在の値 = 0; + this.ct上背景FIFOタイマー = new CCounter(0, 100, 2, TJAPlayer3.Timer); + this.ct上背景FIFOタイマー.n現在の値 = 0;*/ + UpScript?.ClearIn(player); + DownScript?.ClearIn(player); + } + + public void ClearOut(int player) { + UpScript?.ClearOut(player); + DownScript?.ClearOut(player); + } + + public override void Activate() { + if (!this.IsDeActivated) + return; + + var bgOrigindir = CSkin.Path($"{TextureLoader.BASE}{TextureLoader.GAME}{TextureLoader.BACKGROUND}"); + var preset = HScenePreset.GetBGPreset(); + if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Tower) { + bgOrigindir += "Tower"; + } else if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) { + bgOrigindir += "Dan"; + } else if (OpenTaiko.ConfigIni.bAIBattleMode) { + bgOrigindir += "AI"; + } else { + bgOrigindir += "Normal"; } - public void tFadeIn(int player) { - //this.ct上背景クリアインタイマー[player] = new CCounter(0, 100, 2, TJAPlayer3.Timer); - this.eFadeMode = EFIFOMode.FadeIn; + Random random = new Random(); + + if (System.IO.Directory.Exists($@"{bgOrigindir}{Path.DirectorySeparatorChar}Up")) { + var upDirs = System.IO.Directory.GetDirectories($@"{bgOrigindir}{Path.DirectorySeparatorChar}Up"); + + // If there is a preset upper background and this preset exists on the skin use it, else random upper background + var _presetPath = (preset != null && preset.UpperBackground != null) ? $@"{bgOrigindir}{Path.DirectorySeparatorChar}Up{Path.DirectorySeparatorChar}" + preset.UpperBackground[random.Next(0, preset.UpperBackground.Length)] : ""; + var upPath = (preset != null && System.IO.Directory.Exists(_presetPath)) + ? _presetPath + : upDirs[random.Next(0, upDirs.Length)]; + + UpScript = new ScriptBG($@"{upPath}{Path.DirectorySeparatorChar}Script.lua"); + UpScript.Init(); + + IsUpNotFound = false; + } else { + IsUpNotFound = true; } - //public void tFadeOut(int player) - //{ - // this.ct上背景フェードタイマー[player] = new CCounter( 0, 100, 6, CDTXMania.Timer ); - // this.eFadeMode = EFIFOモード.フェードアウト; - //} + if (System.IO.Directory.Exists($@"{bgOrigindir}{Path.DirectorySeparatorChar}Down")) { + var downDirs = System.IO.Directory.GetDirectories($@"{bgOrigindir}{Path.DirectorySeparatorChar}Down"); - public void ClearIn(int player) { - /*this.ct上背景クリアインタイマー[player] = new CCounter(0, 100, 2, TJAPlayer3.Timer); - this.ct上背景クリアインタイマー[player].n現在の値 = 0; - this.ct上背景FIFOタイマー = new CCounter(0, 100, 2, TJAPlayer3.Timer); - this.ct上背景FIFOタイマー.n現在の値 = 0;*/ - UpScript?.ClearIn(player); - DownScript?.ClearIn(player); + // If there is a preset lower background and this preset exists on the skin use it, else random upper background + var _presetPath = (preset != null && preset.LowerBackground != null) ? $@"{bgOrigindir}{Path.DirectorySeparatorChar}Down{Path.DirectorySeparatorChar}" + preset.LowerBackground[random.Next(0, preset.LowerBackground.Length)] : ""; + var downPath = (preset != null && System.IO.Directory.Exists(_presetPath)) + ? _presetPath + : downDirs[random.Next(0, downDirs.Length)]; + + DownScript = new ScriptBG($@"{downPath}{Path.DirectorySeparatorChar}Script.lua"); + DownScript?.Init(); + + if (DownScript.Exists()) IsDownNotFound = false; + } else { + IsDownNotFound = true; } - public void ClearOut(int player) { - UpScript?.ClearOut(player); - DownScript?.ClearOut(player); + this.pfTowerText = HPrivateFastFont.tInstantiateMainFont(OpenTaiko.Skin.Game_Tower_Font_TowerText); + + /* + if (!string.IsNullOrEmpty(TJAPlayer3.ConfigIni.FontName)) + { + this.pfTowerText = new CPrivateFastFont(new FontFamily(TJAPlayer3.ConfigIni.FontName), TJAPlayer3.Skin.Game_Tower_Font_TowerText); + } + else + { + this.pfTowerText = new CPrivateFastFont(new FontFamily("MS UI Gothic"), TJAPlayer3.Skin.Game_Tower_Font_TowerText); + } + */ + + this.ttkTouTatsuKaiSuu = new TitleTextureKey(CLangManager.LangInstance.GetString("TOWER_FLOOR_REACHED"), pfTowerText, Color.White, Color.Black, 700); + this.ttkKai = new TitleTextureKey(CLangManager.LangInstance.GetString("TOWER_FLOOR_INITIAL"), pfTowerText, Color.White, Color.Black, 700); + + this.ct炎 = new CCounter(0, 6, 50, OpenTaiko.Timer); + + this.currentCharacter = Math.Max(0, Math.Min(OpenTaiko.SaveFileInstances[0].data.Character, OpenTaiko.Skin.Characters_Ptn - 1)); + + float resolutionScaleX = OpenTaiko.Skin.Resolution[0] / (float)OpenTaiko.Skin.Characters_Resolution[currentCharacter][0]; + float resolutionScaleY = OpenTaiko.Skin.Resolution[1] / (float)OpenTaiko.Skin.Characters_Resolution[currentCharacter][1]; + + // Scale tower chara + foreach (CTexture texture in OpenTaiko.Tx.Characters_Tower_Standing[currentCharacter]) { + texture.vcScaleRatio.X = resolutionScaleX; + texture.vcScaleRatio.Y = resolutionScaleY; + } + foreach (CTexture texture in OpenTaiko.Tx.Characters_Tower_Climbing[currentCharacter]) { + texture.vcScaleRatio.X = resolutionScaleX; + texture.vcScaleRatio.Y = resolutionScaleY; + } + foreach (CTexture texture in OpenTaiko.Tx.Characters_Tower_Running[currentCharacter]) { + texture.vcScaleRatio.X = resolutionScaleX; + texture.vcScaleRatio.Y = resolutionScaleY; + } + foreach (CTexture texture in OpenTaiko.Tx.Characters_Tower_Clear[currentCharacter]) { + texture.vcScaleRatio.X = resolutionScaleX; + texture.vcScaleRatio.Y = resolutionScaleY; + } + foreach (CTexture texture in OpenTaiko.Tx.Characters_Tower_Fail[currentCharacter]) { + texture.vcScaleRatio.X = resolutionScaleX; + texture.vcScaleRatio.Y = resolutionScaleY; + } + foreach (CTexture texture in OpenTaiko.Tx.Characters_Tower_Standing_Tired[currentCharacter]) { + texture.vcScaleRatio.X = resolutionScaleX; + texture.vcScaleRatio.Y = resolutionScaleY; + } + foreach (CTexture texture in OpenTaiko.Tx.Characters_Tower_Climbing_Tired[currentCharacter]) { + texture.vcScaleRatio.X = resolutionScaleX; + texture.vcScaleRatio.Y = resolutionScaleY; + } + foreach (CTexture texture in OpenTaiko.Tx.Characters_Tower_Running_Tired[currentCharacter]) { + texture.vcScaleRatio.X = resolutionScaleX; + texture.vcScaleRatio.Y = resolutionScaleY; + } + foreach (CTexture texture in OpenTaiko.Tx.Characters_Tower_Clear_Tired[currentCharacter]) { + texture.vcScaleRatio.X = resolutionScaleX; + texture.vcScaleRatio.Y = resolutionScaleY; } - public override void Activate() { - if (!this.IsDeActivated) - return; + this.ctSlideAnimation = new CCounter(); + this.ctClimbDuration = new CCounter(); + this.ctStandingAnimation = new CCounter(0, 1000, (60000f / (float)(OpenTaiko.stage演奏ドラム画面.actPlayInfo.dbBPM[0] * OpenTaiko.ConfigIni.SongPlaybackSpeed)) * OpenTaiko.Skin.Characters_Beat_Tower_Standing[currentCharacter] / OpenTaiko.Skin.Characters_Tower_Standing_Ptn[currentCharacter], OpenTaiko.Timer); + this.ctClimbingAnimation = new CCounter(); + this.ctRunningAnimation = new CCounter(); + this.ctClearAnimation = new CCounter(); + this.ctFailAnimation = new CCounter(); + this.ctStandTiredAnimation = new CCounter(); + this.ctClimbTiredAnimation = new CCounter(); + this.ctRunTiredAnimation = new CCounter(); + this.ctClearTiredAnimation = new CCounter(); - var bgOrigindir = CSkin.Path($"{TextureLoader.BASE}{TextureLoader.GAME}{TextureLoader.BACKGROUND}"); - var preset = HScenePreset.GetBGPreset(); + TowerFinished = false; + + base.Activate(); + } + + public override void DeActivate() { + if (this.IsDeActivated) + return; + + OpenTaiko.tDisposeSafely(ref UpScript); + OpenTaiko.tDisposeSafely(ref DownScript); + + OpenTaiko.tDisposeSafely(ref pfTowerText); + + base.DeActivate(); + } + + public override void CreateManagedResource() { + base.CreateManagedResource(); + } + + public override void ReleaseManagedResource() { + base.ReleaseManagedResource(); + } + + public override int Draw() { + if (base.IsDeActivated) + return 0; + + + //this.ct上背景FIFOタイマー?.t進行(); + + + #region [Tower specific variables declaration] + + float currentFloorPositionMax140 = 0; + + #endregion + + // fNow_Measure_s (/ m) + + #region [Upper background] + + if (!IsUpNotFound) { + if (!OpenTaiko.stage演奏ドラム画面.bPAUSE) UpScript?.Update(); + UpScript?.Draw(); if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Tower) { - bgOrigindir += "Tower"; - } else if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) { - bgOrigindir += "Dan"; - } else if (OpenTaiko.ConfigIni.bAIBattleMode) { - bgOrigindir += "AI"; - } else { - bgOrigindir += "Normal"; - } + #region [Tower animations variables] - Random random = new Random(); + this.bFloorChanged = CFloorManagement.LastRegisteredFloor > 0 && (CFloorManagement.LastRegisteredFloor < OpenTaiko.stage演奏ドラム画面.actPlayInfo.NowMeasure[0] + 1); - if (System.IO.Directory.Exists($@"{bgOrigindir}{Path.DirectorySeparatorChar}Up")) { - var upDirs = System.IO.Directory.GetDirectories($@"{bgOrigindir}{Path.DirectorySeparatorChar}Up"); - - // If there is a preset upper background and this preset exists on the skin use it, else random upper background - var _presetPath = (preset != null && preset.UpperBackground != null) ? $@"{bgOrigindir}{Path.DirectorySeparatorChar}Up{Path.DirectorySeparatorChar}" + preset.UpperBackground[random.Next(0, preset.UpperBackground.Length)] : ""; - var upPath = (preset != null && System.IO.Directory.Exists(_presetPath)) - ? _presetPath - : upDirs[random.Next(0, upDirs.Length)]; - - UpScript = new ScriptBG($@"{upPath}{Path.DirectorySeparatorChar}Script.lua"); - UpScript.Init(); - - IsUpNotFound = false; - } else { - IsUpNotFound = true; - } - - if (System.IO.Directory.Exists($@"{bgOrigindir}{Path.DirectorySeparatorChar}Down")) { - var downDirs = System.IO.Directory.GetDirectories($@"{bgOrigindir}{Path.DirectorySeparatorChar}Down"); - - // If there is a preset lower background and this preset exists on the skin use it, else random upper background - var _presetPath = (preset != null && preset.LowerBackground != null) ? $@"{bgOrigindir}{Path.DirectorySeparatorChar}Down{Path.DirectorySeparatorChar}" + preset.LowerBackground[random.Next(0, preset.LowerBackground.Length)] : ""; - var downPath = (preset != null && System.IO.Directory.Exists(_presetPath)) - ? _presetPath - : downDirs[random.Next(0, downDirs.Length)]; - - DownScript = new ScriptBG($@"{downPath}{Path.DirectorySeparatorChar}Script.lua"); - DownScript?.Init(); - - if (DownScript.Exists()) IsDownNotFound = false; - } else { - IsDownNotFound = true; - } - - this.pfTowerText = HPrivateFastFont.tInstantiateMainFont(OpenTaiko.Skin.Game_Tower_Font_TowerText); - - /* - if (!string.IsNullOrEmpty(TJAPlayer3.ConfigIni.FontName)) - { - this.pfTowerText = new CPrivateFastFont(new FontFamily(TJAPlayer3.ConfigIni.FontName), TJAPlayer3.Skin.Game_Tower_Font_TowerText); - } - else - { - this.pfTowerText = new CPrivateFastFont(new FontFamily("MS UI Gothic"), TJAPlayer3.Skin.Game_Tower_Font_TowerText); - } - */ - - this.ttkTouTatsuKaiSuu = new TitleTextureKey(CLangManager.LangInstance.GetString("TOWER_FLOOR_REACHED"), pfTowerText, Color.White, Color.Black, 700); - this.ttkKai = new TitleTextureKey(CLangManager.LangInstance.GetString("TOWER_FLOOR_INITIAL"), pfTowerText, Color.White, Color.Black, 700); - - this.ct炎 = new CCounter(0, 6, 50, OpenTaiko.Timer); - - this.currentCharacter = Math.Max(0, Math.Min(OpenTaiko.SaveFileInstances[0].data.Character, OpenTaiko.Skin.Characters_Ptn - 1)); - - float resolutionScaleX = OpenTaiko.Skin.Resolution[0] / (float)OpenTaiko.Skin.Characters_Resolution[currentCharacter][0]; - float resolutionScaleY = OpenTaiko.Skin.Resolution[1] / (float)OpenTaiko.Skin.Characters_Resolution[currentCharacter][1]; - - // Scale tower chara - foreach (CTexture texture in OpenTaiko.Tx.Characters_Tower_Standing[currentCharacter]) { - texture.vcScaleRatio.X = resolutionScaleX; - texture.vcScaleRatio.Y = resolutionScaleY; - } - foreach (CTexture texture in OpenTaiko.Tx.Characters_Tower_Climbing[currentCharacter]) { - texture.vcScaleRatio.X = resolutionScaleX; - texture.vcScaleRatio.Y = resolutionScaleY; - } - foreach (CTexture texture in OpenTaiko.Tx.Characters_Tower_Running[currentCharacter]) { - texture.vcScaleRatio.X = resolutionScaleX; - texture.vcScaleRatio.Y = resolutionScaleY; - } - foreach (CTexture texture in OpenTaiko.Tx.Characters_Tower_Clear[currentCharacter]) { - texture.vcScaleRatio.X = resolutionScaleX; - texture.vcScaleRatio.Y = resolutionScaleY; - } - foreach (CTexture texture in OpenTaiko.Tx.Characters_Tower_Fail[currentCharacter]) { - texture.vcScaleRatio.X = resolutionScaleX; - texture.vcScaleRatio.Y = resolutionScaleY; - } - foreach (CTexture texture in OpenTaiko.Tx.Characters_Tower_Standing_Tired[currentCharacter]) { - texture.vcScaleRatio.X = resolutionScaleX; - texture.vcScaleRatio.Y = resolutionScaleY; - } - foreach (CTexture texture in OpenTaiko.Tx.Characters_Tower_Climbing_Tired[currentCharacter]) { - texture.vcScaleRatio.X = resolutionScaleX; - texture.vcScaleRatio.Y = resolutionScaleY; - } - foreach (CTexture texture in OpenTaiko.Tx.Characters_Tower_Running_Tired[currentCharacter]) { - texture.vcScaleRatio.X = resolutionScaleX; - texture.vcScaleRatio.Y = resolutionScaleY; - } - foreach (CTexture texture in OpenTaiko.Tx.Characters_Tower_Clear_Tired[currentCharacter]) { - texture.vcScaleRatio.X = resolutionScaleX; - texture.vcScaleRatio.Y = resolutionScaleY; - } - - this.ctSlideAnimation = new CCounter(); - this.ctClimbDuration = new CCounter(); - this.ctStandingAnimation = new CCounter(0, 1000, (60000f / (float)(OpenTaiko.stage演奏ドラム画面.actPlayInfo.dbBPM[0] * OpenTaiko.ConfigIni.SongPlaybackSpeed)) * OpenTaiko.Skin.Characters_Beat_Tower_Standing[currentCharacter] / OpenTaiko.Skin.Characters_Tower_Standing_Ptn[currentCharacter], OpenTaiko.Timer); - this.ctClimbingAnimation = new CCounter(); - this.ctRunningAnimation = new CCounter(); - this.ctClearAnimation = new CCounter(); - this.ctFailAnimation = new CCounter(); - this.ctStandTiredAnimation = new CCounter(); - this.ctClimbTiredAnimation = new CCounter(); - this.ctRunTiredAnimation = new CCounter(); - this.ctClearTiredAnimation = new CCounter(); - - TowerFinished = false; - - base.Activate(); - } - - public override void DeActivate() { - if (this.IsDeActivated) - return; - - OpenTaiko.tDisposeSafely(ref UpScript); - OpenTaiko.tDisposeSafely(ref DownScript); - - OpenTaiko.tDisposeSafely(ref pfTowerText); - - base.DeActivate(); - } - - public override void CreateManagedResource() { - base.CreateManagedResource(); - } - - public override void ReleaseManagedResource() { - base.ReleaseManagedResource(); - } - - public override int Draw() { - if (base.IsDeActivated) - return 0; - - - //this.ct上背景FIFOタイマー?.t進行(); - - - #region [Tower specific variables declaration] - - float currentFloorPositionMax140 = 0; - - #endregion - - // fNow_Measure_s (/ m) - - #region [Upper background] - - if (!IsUpNotFound) { - if (!OpenTaiko.stage演奏ドラム画面.bPAUSE) UpScript?.Update(); - UpScript?.Draw(); - if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Tower) { - #region [Tower animations variables] - - this.bFloorChanged = CFloorManagement.LastRegisteredFloor > 0 && (CFloorManagement.LastRegisteredFloor < OpenTaiko.stage演奏ドラム画面.actPlayInfo.NowMeasure[0] + 1); - - int maxFloor = OpenTaiko.stageSongSelect.rChoosenSong.arスコア[5].譜面情報.nTotalFloor; - int nightTime = Math.Max(140, maxFloor / 2); - - currentFloorPositionMax140 = Math.Min(OpenTaiko.stage演奏ドラム画面.actPlayInfo.NowMeasure[0] / (float)nightTime, 1f); - - #endregion - - #region [Tower background informations] - - if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Tower) { - TitleTextureKey.ResolveTitleTexture(ttkTouTatsuKaiSuu).t2D描画(OpenTaiko.Skin.Game_Tower_Font_TouTatsuKaiSuu[0], OpenTaiko.Skin.Game_Tower_Font_TouTatsuKaiSuu[1]); - TitleTextureKey.ResolveTitleTexture(ttkKai).t2D描画(OpenTaiko.Skin.Game_Tower_Font_Kai[0], OpenTaiko.Skin.Game_Tower_Font_Kai[1]); - - this.ct炎.TickLoop(); - CFloorManagement.loopFrames(); - - #region [Floor number] - - if (CFloorManagement.CurrentNumberOfLives > 0) - CFloorManagement.LastRegisteredFloor = OpenTaiko.stage演奏ドラム画面.actPlayInfo.NowMeasure[0] + 1; - - string floorStr = CFloorManagement.LastRegisteredFloor.ToString(); - - int len = floorStr.Length; - - int digitLength = OpenTaiko.Tx.Taiko_Combo[0].szTextureSize.Width / 10; - - OpenTaiko.Tx.Taiko_Combo[0].color4 = new Color4(1f, 0.6f, 0.2f, 1f); - OpenTaiko.Tx.Taiko_Combo[0].vcScaleRatio.X = 1.4f; - OpenTaiko.Tx.Taiko_Combo[0].vcScaleRatio.Y = 1.4f; - - for (int idx = len - 1; idx >= 0; idx--) { - int currentNum = int.Parse(floorStr[idx].ToString()); - - OpenTaiko.Tx.Taiko_Combo[0].t2D描画(OpenTaiko.Skin.Game_Tower_Floor_Number[0] - ((digitLength - 8) * (len - idx) * 1.4f), - OpenTaiko.Skin.Game_Tower_Floor_Number[1], - new Rectangle(digitLength * currentNum, 0, - digitLength, OpenTaiko.Tx.Taiko_Combo[0].szTextureSize.Height)); - } - - #endregion - - #region [Life Tamashii icon] - - int soulfire_width = OpenTaiko.Tx.Gauge_Soul_Fire.szTextureSize.Width / 8; - int soulfire_height = OpenTaiko.Tx.Gauge_Soul_Fire.szTextureSize.Height; - - int soul_height = OpenTaiko.Tx.Gauge_Soul.szTextureSize.Height / 2; - - OpenTaiko.Tx.Gauge_Soul_Fire?.t2D描画(OpenTaiko.Skin.Gauge_Soul_Fire_X_Tower, OpenTaiko.Skin.Gauge_Soul_Fire_Y_Tower, new Rectangle(soulfire_width * (this.ct炎.CurrentValue), 0, soulfire_width, soulfire_height)); - OpenTaiko.Tx.Gauge_Soul?.t2D描画(OpenTaiko.Skin.Gauge_Soul_X_Tower, OpenTaiko.Skin.Gauge_Soul_Y_Tower, new Rectangle(0, soul_height, OpenTaiko.Tx.Gauge_Soul.szTextureSize.Width, soul_height)); - - #endregion - - #region [Life number] - - if (CFloorManagement.MaxNumberOfLives <= 0) { - CFloorManagement.MaxNumberOfLives = 5; - CFloorManagement.CurrentNumberOfLives = 5; - } - - string lifeStr = CFloorManagement.CurrentNumberOfLives.ToString(); - - len = lifeStr.Length; - - bool lifeSpecialCase = CFloorManagement.CurrentNumberOfLives == 1 && CFloorManagement.MaxNumberOfLives != 1; - float lifeRatio = CFloorManagement.CurrentNumberOfLives / (float)CFloorManagement.MaxNumberOfLives; - - Color4 lifeColor = (lifeRatio > 0.5f && !lifeSpecialCase) ? new Color4(0.2f, 1f, 0.2f, 1f) - : ((lifeRatio >= 0.2f && !lifeSpecialCase) ? new Color4(1f, 1f, 0.2f, 1f) - : new Color4(1f, 0.2f, 0.2f, 1f)); - - OpenTaiko.Tx.Taiko_Combo[0].color4 = lifeColor; - OpenTaiko.Tx.Taiko_Combo[0].vcScaleRatio.X = 1.1f; - OpenTaiko.Tx.Taiko_Combo[0].vcScaleRatio.Y = 1.1f; - - for (int idx = 0; idx < len; idx++) { - int currentNum = int.Parse(lifeStr[len - idx - 1].ToString()); - - OpenTaiko.Tx.Taiko_Combo[0].t2D描画(OpenTaiko.Skin.Game_Tower_Life_Number[0] + ((digitLength - 8) * (len - idx) * 1.1f), - OpenTaiko.Skin.Game_Tower_Life_Number[1], - new Rectangle(digitLength * currentNum, 0, - digitLength, OpenTaiko.Tx.Taiko_Combo[0].szTextureSize.Height)); - } - - OpenTaiko.Tx.Taiko_Combo[0].color4 = new Color4(1f, 1f, 1f, 1f); - - #endregion - - } - - #endregion - } - } - - #endregion - - #region [Lower background] - - - if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Tower) { int maxFloor = OpenTaiko.stageSongSelect.rChoosenSong.arスコア[5].譜面情報.nTotalFloor; - - OpenTaiko.actTextConsole.Print(0, 0, CTextConsole.EFontType.White, maxFloor.ToString()); - int nightTime = Math.Max(140, maxFloor / 2); - int currentTowerType = Array.IndexOf(OpenTaiko.Skin.Game_Tower_Names, OpenTaiko.stageSongSelect.rChoosenSong.arスコア[5].譜面情報.nTowerType); - - if (currentTowerType < 0 || currentTowerType >= OpenTaiko.Skin.Game_Tower_Ptn) - currentTowerType = 0; - - #region [Tower lower background] - - float nextPositionMax140 = Math.Min((OpenTaiko.stage演奏ドラム画面.actPlayInfo.NowMeasure[0] + 1) / (float)nightTime, 1f); - - if (bFloorChanged == true) - ctSlideAnimation.Start(0, 1000, 120f / ((float)OpenTaiko.stage演奏ドラム画面.actPlayInfo.dbBPM[0] * OpenTaiko.ConfigIni.SongPlaybackSpeed), OpenTaiko.Timer); - - float progressFactor = (nextPositionMax140 - currentFloorPositionMax140) * (ctSlideAnimation.CurrentValue / 1000f); - - - - #region [Skybox] - - //int skyboxYPosition = (int)((TJAPlayer3.Tx.Tower_Sky_Gradient.szテクスチャサイズ.Height - TJAPlayer3.Skin.Game_Tower_Sky_Gradient_Size[1]) * (1f - (currentFloorPositionMax140 + progressFactor))); - - //TJAPlayer3.Tx.Tower_Sky_Gradient?.t2D描画(TJAPlayer3.Skin.Game_Tower_Sky_Gradient[0], TJAPlayer3.Skin.Game_Tower_Sky_Gradient[1], - //new Rectangle(0, skyboxYPosition, TJAPlayer3.Skin.Game_Tower_Sky_Gradient_Size[0], TJAPlayer3.Skin.Game_Tower_Sky_Gradient_Size[1])); - - if (!OpenTaiko.stage演奏ドラム画面.bPAUSE) DownScript.Update(); - DownScript.Draw(); + currentFloorPositionMax140 = Math.Min(OpenTaiko.stage演奏ドラム画面.actPlayInfo.NowMeasure[0] / (float)nightTime, 1f); #endregion + #region [Tower background informations] - #region [Tower body] + if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Tower) { + TitleTextureKey.ResolveTitleTexture(ttkTouTatsuKaiSuu).t2D描画(OpenTaiko.Skin.Game_Tower_Font_TouTatsuKaiSuu[0], OpenTaiko.Skin.Game_Tower_Font_TouTatsuKaiSuu[1]); + TitleTextureKey.ResolveTitleTexture(ttkKai).t2D描画(OpenTaiko.Skin.Game_Tower_Font_Kai[0], OpenTaiko.Skin.Game_Tower_Font_Kai[1]); - progressFactor = ctSlideAnimation.CurrentValue / 1000f; + this.ct炎.TickLoop(); + CFloorManagement.loopFrames(); - int currentTower = currentTowerType; + #region [Floor number] - // Will implement the roof later, need the beforehand total floor count calculation before - int nextTowerBase = ((OpenTaiko.stage演奏ドラム画面.actPlayInfo.NowMeasure[0] + 1) / 10) % OpenTaiko.Skin.Game_Tower_Ptn_Base[currentTower]; - int towerBase = (OpenTaiko.stage演奏ドラム画面.actPlayInfo.NowMeasure[0] / 10) % OpenTaiko.Skin.Game_Tower_Ptn_Base[currentTower]; + if (CFloorManagement.CurrentNumberOfLives > 0) + CFloorManagement.LastRegisteredFloor = OpenTaiko.stage演奏ドラム画面.actPlayInfo.NowMeasure[0] + 1; - int currentDeco = OpenTaiko.stage演奏ドラム画面.actPlayInfo.NowMeasure[0] % OpenTaiko.Skin.Game_Tower_Ptn_Deco[currentTower]; - int nextDeco = (OpenTaiko.stage演奏ドラム画面.actPlayInfo.NowMeasure[0] + 1) % OpenTaiko.Skin.Game_Tower_Ptn_Deco[currentTower]; + string floorStr = CFloorManagement.LastRegisteredFloor.ToString(); - // Microfix for the first floor suddenly changing texture - if (OpenTaiko.stage演奏ドラム画面.actPlayInfo.NowMeasure[0] == 0 && OpenTaiko.Skin.Game_Tower_Ptn_Deco[currentTower] > 1) - currentDeco++; - if (OpenTaiko.stage演奏ドラム画面.actPlayInfo.NowMeasure[0] == 0 && OpenTaiko.Skin.Game_Tower_Ptn_Base[currentTower] > 1) - towerBase++; + int len = floorStr.Length; - int widthChange = (int)(progressFactor * OpenTaiko.Skin.Game_Tower_Floors_Move[0]); - int heightChange = (int)(progressFactor * OpenTaiko.Skin.Game_Tower_Floors_Move[1]); + int digitLength = OpenTaiko.Tx.Taiko_Combo[0].szTextureSize.Width / 10; - // Current trunk - if (OpenTaiko.stage演奏ドラム画面.actPlayInfo.NowMeasure[0] < maxFloor) - OpenTaiko.Tx.Tower_Base[currentTower][towerBase]?.t2D下中央基準描画( - OpenTaiko.Skin.Game_Tower_Floors_Body[0] + widthChange, - OpenTaiko.Skin.Game_Tower_Floors_Body[1] + heightChange); // 316 + 360 - else - OpenTaiko.Tx.Tower_Top[currentTower]?.t2D下中央基準描画( - OpenTaiko.Skin.Game_Tower_Floors_Body[0] + widthChange, - OpenTaiko.Skin.Game_Tower_Floors_Body[1] + heightChange); + OpenTaiko.Tx.Taiko_Combo[0].color4 = new Color4(1f, 0.6f, 0.2f, 1f); + OpenTaiko.Tx.Taiko_Combo[0].vcScaleRatio.X = 1.4f; + OpenTaiko.Tx.Taiko_Combo[0].vcScaleRatio.Y = 1.4f; - // Current deco - OpenTaiko.Tx.Tower_Deco[currentTower][currentDeco]?.t2D下中央基準描画( - OpenTaiko.Skin.Game_Tower_Floors_Deco[0] + widthChange, - OpenTaiko.Skin.Game_Tower_Floors_Deco[1] + heightChange); + for (int idx = len - 1; idx >= 0; idx--) { + int currentNum = int.Parse(floorStr[idx].ToString()); - int originY = OpenTaiko.Skin.Game_Tower_Floors_Move[1] - heightChange; - - // Next trunk - if (OpenTaiko.stage演奏ドラム画面.actPlayInfo.NowMeasure[0] + 1 < maxFloor) - OpenTaiko.Tx.Tower_Base[currentTower][nextTowerBase]?.t2D下中央基準描画( - OpenTaiko.Skin.Game_Tower_Floors_Body[0] - OpenTaiko.Skin.Game_Tower_Floors_Move[0] + widthChange, - OpenTaiko.Skin.Game_Tower_Floors_Body[1] - OpenTaiko.Skin.Game_Tower_Floors_Move[1] + heightChange, - new Rectangle(0, originY, OpenTaiko.Tx.Tower_Base[currentTower][nextTowerBase].szTextureSize.Width, OpenTaiko.Tx.Tower_Base[currentTower][nextTowerBase].szTextureSize.Height - originY)); - else if (OpenTaiko.stage演奏ドラム画面.actPlayInfo.NowMeasure[0] + 1 == maxFloor) { - OpenTaiko.Tx.Tower_Top[currentTower]?.t2D下中央基準描画( - OpenTaiko.Skin.Game_Tower_Floors_Body[0] - OpenTaiko.Skin.Game_Tower_Floors_Move[0] + widthChange, - OpenTaiko.Skin.Game_Tower_Floors_Body[1] - OpenTaiko.Skin.Game_Tower_Floors_Move[1] + heightChange, - new Rectangle(0, originY, OpenTaiko.Tx.Tower_Top[currentTower].szTextureSize.Width, OpenTaiko.Tx.Tower_Top[currentTower].szTextureSize.Height - originY)); - } - - // Next deco - if (OpenTaiko.stage演奏ドラム画面.actPlayInfo.NowMeasure[0] + 1 <= maxFloor) - OpenTaiko.Tx.Tower_Deco[currentTower][nextDeco]?.t2D下中央基準描画( - OpenTaiko.Skin.Game_Tower_Floors_Deco[0] - OpenTaiko.Skin.Game_Tower_Floors_Move[0] + widthChange, - OpenTaiko.Skin.Game_Tower_Floors_Deco[1] - OpenTaiko.Skin.Game_Tower_Floors_Move[1] + heightChange); - - - #endregion - - #region [Climbing don] - - bool ctIsTired = !((CFloorManagement.CurrentNumberOfLives / (float)CFloorManagement.MaxNumberOfLives) >= 0.2f && !(CFloorManagement.CurrentNumberOfLives == 1 && CFloorManagement.MaxNumberOfLives != 1)); - - bool stageEnded = OpenTaiko.stage演奏ドラム画面.ePhaseID == CStage.EPhase.Game_EndStage || OpenTaiko.stage演奏ドラム画面.ePhaseID == CStage.EPhase.Game_STAGE_CLEAR_FadeOut || CFloorManagement.CurrentNumberOfLives == 0; - - if (bFloorChanged == true) { - float floorBPM = (float)(OpenTaiko.stage演奏ドラム画面.actPlayInfo.dbBPM[0] * OpenTaiko.ConfigIni.SongPlaybackSpeed); - ctClimbDuration.Start(0, 1500, 120f / floorBPM, OpenTaiko.Timer); - ctStandingAnimation.Start(0, 1000, (60000f / floorBPM) * OpenTaiko.Skin.Characters_Beat_Tower_Standing[currentCharacter] / OpenTaiko.Skin.Characters_Tower_Standing_Ptn[currentCharacter], OpenTaiko.Timer); - ctClimbingAnimation.Start(0, 1000, (120000f / floorBPM) / OpenTaiko.Skin.Characters_Tower_Climbing_Ptn[currentCharacter], OpenTaiko.Timer); - ctRunningAnimation.Start(0, 1000, (60000f / floorBPM) / OpenTaiko.Skin.Characters_Tower_Running_Ptn[currentCharacter], OpenTaiko.Timer); - ctStandTiredAnimation.Start(0, 1000, (60000f / floorBPM) * OpenTaiko.Skin.Characters_Beat_Tower_Standing_Tired[currentCharacter] / OpenTaiko.Skin.Characters_Tower_Standing_Tired_Ptn[currentCharacter], OpenTaiko.Timer); - ctClimbTiredAnimation.Start(0, 1000, (120000f / floorBPM) / OpenTaiko.Skin.Characters_Tower_Climbing_Tired_Ptn[currentCharacter], OpenTaiko.Timer); - ctRunTiredAnimation.Start(0, 1000, (60000f / floorBPM) / OpenTaiko.Skin.Characters_Tower_Running_Tired_Ptn[currentCharacter], OpenTaiko.Timer); - } - - bool isClimbing = ctClimbDuration.CurrentValue > 0 && ctClimbDuration.CurrentValue < 1500; - - if (stageEnded && !TowerFinished && !isClimbing) { - float floorBPM = (float)(OpenTaiko.stage演奏ドラム画面.actPlayInfo.dbBPM[0] * OpenTaiko.ConfigIni.SongPlaybackSpeed); - ctClearAnimation.Start(0, 20000, (60000f / floorBPM) * OpenTaiko.Skin.Characters_Beat_Tower_Clear[currentCharacter] / OpenTaiko.Skin.Characters_Tower_Clear_Ptn[currentCharacter], OpenTaiko.Timer); - ctClearTiredAnimation.Start(0, 20000, (60000f / floorBPM) * OpenTaiko.Skin.Characters_Beat_Tower_Clear_Tired[currentCharacter] / OpenTaiko.Skin.Characters_Tower_Clear_Tired_Ptn[currentCharacter], OpenTaiko.Timer); - ctFailAnimation.Start(0, 20000, (60000f / floorBPM) * OpenTaiko.Skin.Characters_Beat_Tower_Fail[currentCharacter] / OpenTaiko.Skin.Characters_Tower_Fail_Ptn[currentCharacter], OpenTaiko.Timer); - TowerFinished = true; - } - - if (isClimbing) { - // Tired Climb - if (ctIsTired && (ctClimbDuration.CurrentValue <= 1000) && OpenTaiko.Skin.Characters_Tower_Climbing_Tired_Ptn[currentCharacter] > 0) { - int animChar = ctClimbTiredAnimation.CurrentValue % OpenTaiko.Skin.Characters_Tower_Climbing_Ptn[currentCharacter]; - int distDonX = (int)(ctClimbDuration.CurrentValue * (OpenTaiko.Skin.Game_Tower_Don_Move[0] / 1000f)); - int distDonY = (int)(ctClimbDuration.CurrentValue * (OpenTaiko.Skin.Game_Tower_Don_Move[1] / 1000f)); - OpenTaiko.Tx.Characters_Tower_Climbing_Tired[currentCharacter][animChar]?.t2D拡大率考慮下中心基準描画(OpenTaiko.Skin.Game_Tower_Don[0] + distDonX, OpenTaiko.Skin.Game_Tower_Don[1] + distDonY); - } - // Tired Run - else if (ctIsTired && (ctClimbDuration.CurrentValue > 1000 && ctClimbDuration.CurrentValue < 1500) && OpenTaiko.Skin.Characters_Tower_Running_Tired_Ptn[currentCharacter] > 0) { - int animChar = ctRunTiredAnimation.CurrentValue % OpenTaiko.Skin.Characters_Tower_Running_Ptn[currentCharacter]; - int distDonX = (int)((1500 - ctClimbDuration.CurrentValue) * (OpenTaiko.Skin.Game_Tower_Don_Move[0] / 500f)); - int distDonY = (int)((1500 - ctClimbDuration.CurrentValue) * (OpenTaiko.Skin.Game_Tower_Don_Move[1] / 500f)); - OpenTaiko.Tx.Characters_Tower_Running_Tired[currentCharacter][animChar]?.t2D拡大率考慮下中心基準描画(OpenTaiko.Skin.Game_Tower_Don[0] + distDonX, OpenTaiko.Skin.Game_Tower_Don[1] + distDonY); - } - // Climb - else if ((ctClimbDuration.CurrentValue <= 1000) && OpenTaiko.Skin.Characters_Tower_Climbing_Ptn[currentCharacter] > 0) { - int animChar = ctClimbingAnimation.CurrentValue % OpenTaiko.Skin.Characters_Tower_Climbing_Ptn[currentCharacter]; - int distDonX = (int)(ctClimbDuration.CurrentValue * (OpenTaiko.Skin.Game_Tower_Don_Move[0] / 1000f)); - int distDonY = (int)(ctClimbDuration.CurrentValue * (OpenTaiko.Skin.Game_Tower_Don_Move[1] / 1000f)); - OpenTaiko.Tx.Characters_Tower_Climbing[currentCharacter][animChar]?.t2D拡大率考慮下中心基準描画(OpenTaiko.Skin.Game_Tower_Don[0] + distDonX, OpenTaiko.Skin.Game_Tower_Don[1] + distDonY); - } - // Run - else if ((ctClimbDuration.CurrentValue > 1000 && ctClimbDuration.CurrentValue < 1500) && OpenTaiko.Skin.Characters_Tower_Running_Ptn[currentCharacter] > 0) { - int animChar = ctRunningAnimation.CurrentValue % OpenTaiko.Skin.Characters_Tower_Running_Ptn[currentCharacter]; - int distDonX = (int)((1500 - ctClimbDuration.CurrentValue) * (OpenTaiko.Skin.Game_Tower_Don_Move[0] / 500f)); - int distDonY = (int)((1500 - ctClimbDuration.CurrentValue) * (OpenTaiko.Skin.Game_Tower_Don_Move[1] / 500f)); - OpenTaiko.Tx.Characters_Tower_Running[currentCharacter][animChar]?.t2D拡大率考慮下中心基準描画(OpenTaiko.Skin.Game_Tower_Don[0] + distDonX, OpenTaiko.Skin.Game_Tower_Don[1] + distDonY); - } - } else { - // Fail - if (OpenTaiko.Skin.Characters_Tower_Fail_Ptn[currentCharacter] > 0 && CFloorManagement.CurrentNumberOfLives == 0) { - int animChar = OpenTaiko.Skin.Characters_Tower_Fail_IsLooping[currentCharacter] ? - ctFailAnimation.CurrentValue % OpenTaiko.Skin.Characters_Tower_Fail_Ptn[currentCharacter] : - Math.Min(ctFailAnimation.CurrentValue, OpenTaiko.Skin.Characters_Tower_Fail_Ptn[currentCharacter] - 1); - OpenTaiko.Tx.Characters_Tower_Fail[currentCharacter][animChar]?.t2D拡大率考慮下中心基準描画(OpenTaiko.Skin.Game_Tower_Don[0], OpenTaiko.Skin.Game_Tower_Don[1]); - } - // Tired Clear - else if (ctIsTired && stageEnded && OpenTaiko.Skin.Characters_Tower_Clear_Tired_Ptn[currentCharacter] > 0 && CFloorManagement.CurrentNumberOfLives > 0) { - int animChar = OpenTaiko.Skin.Characters_Tower_Clear_Tired_IsLooping[currentCharacter] ? - ctClearTiredAnimation.CurrentValue % OpenTaiko.Skin.Characters_Tower_Clear_Tired_Ptn[currentCharacter] : - Math.Min(ctClearTiredAnimation.CurrentValue, OpenTaiko.Skin.Characters_Tower_Clear_Tired_Ptn[currentCharacter] - 1); - OpenTaiko.Tx.Characters_Tower_Clear_Tired[currentCharacter][animChar]?.t2D拡大率考慮下中心基準描画(OpenTaiko.Skin.Game_Tower_Don[0], OpenTaiko.Skin.Game_Tower_Don[1]); - } - // Clear - else if (stageEnded && OpenTaiko.Skin.Characters_Tower_Clear_Ptn[currentCharacter] > 0 && CFloorManagement.CurrentNumberOfLives > 0) { - int animChar = OpenTaiko.Skin.Characters_Tower_Clear_IsLooping[currentCharacter] ? - ctClearAnimation.CurrentValue % OpenTaiko.Skin.Characters_Tower_Clear_Ptn[currentCharacter] : - Math.Min(ctClearAnimation.CurrentValue, OpenTaiko.Skin.Characters_Tower_Clear_Ptn[currentCharacter] - 1); - OpenTaiko.Tx.Characters_Tower_Clear[currentCharacter][animChar]?.t2D拡大率考慮下中心基準描画(OpenTaiko.Skin.Game_Tower_Don[0], OpenTaiko.Skin.Game_Tower_Don[1]); + OpenTaiko.Tx.Taiko_Combo[0].t2D描画(OpenTaiko.Skin.Game_Tower_Floor_Number[0] - ((digitLength - 8) * (len - idx) * 1.4f), + OpenTaiko.Skin.Game_Tower_Floor_Number[1], + new Rectangle(digitLength * currentNum, 0, + digitLength, OpenTaiko.Tx.Taiko_Combo[0].szTextureSize.Height)); } - // Tired Stand - else if (ctIsTired && OpenTaiko.Skin.Characters_Tower_Standing_Tired_Ptn[currentCharacter] > 0) { - int animChar = ctStandTiredAnimation.CurrentValue % OpenTaiko.Skin.Characters_Tower_Standing_Tired_Ptn[currentCharacter]; - OpenTaiko.Tx.Characters_Tower_Standing_Tired[currentCharacter][animChar]?.t2D拡大率考慮下中心基準描画(OpenTaiko.Skin.Game_Tower_Don[0], OpenTaiko.Skin.Game_Tower_Don[1]); // Center X - 50 + #endregion + + #region [Life Tamashii icon] + + int soulfire_width = OpenTaiko.Tx.Gauge_Soul_Fire.szTextureSize.Width / 8; + int soulfire_height = OpenTaiko.Tx.Gauge_Soul_Fire.szTextureSize.Height; + + int soul_height = OpenTaiko.Tx.Gauge_Soul.szTextureSize.Height / 2; + + OpenTaiko.Tx.Gauge_Soul_Fire?.t2D描画(OpenTaiko.Skin.Gauge_Soul_Fire_X_Tower, OpenTaiko.Skin.Gauge_Soul_Fire_Y_Tower, new Rectangle(soulfire_width * (this.ct炎.CurrentValue), 0, soulfire_width, soulfire_height)); + OpenTaiko.Tx.Gauge_Soul?.t2D描画(OpenTaiko.Skin.Gauge_Soul_X_Tower, OpenTaiko.Skin.Gauge_Soul_Y_Tower, new Rectangle(0, soul_height, OpenTaiko.Tx.Gauge_Soul.szTextureSize.Width, soul_height)); + + #endregion + + #region [Life number] + + if (CFloorManagement.MaxNumberOfLives <= 0) { + CFloorManagement.MaxNumberOfLives = 5; + CFloorManagement.CurrentNumberOfLives = 5; } - // Stand - else if (OpenTaiko.Skin.Characters_Tower_Standing_Ptn[currentCharacter] > 0) { - int animChar = ctStandingAnimation.CurrentValue % OpenTaiko.Skin.Characters_Tower_Standing_Ptn[currentCharacter]; - OpenTaiko.Tx.Characters_Tower_Standing[currentCharacter][animChar]?.t2D拡大率考慮下中心基準描画(OpenTaiko.Skin.Game_Tower_Don[0], OpenTaiko.Skin.Game_Tower_Don[1]); // Center X - 50 + + string lifeStr = CFloorManagement.CurrentNumberOfLives.ToString(); + + len = lifeStr.Length; + + bool lifeSpecialCase = CFloorManagement.CurrentNumberOfLives == 1 && CFloorManagement.MaxNumberOfLives != 1; + float lifeRatio = CFloorManagement.CurrentNumberOfLives / (float)CFloorManagement.MaxNumberOfLives; + + Color4 lifeColor = (lifeRatio > 0.5f && !lifeSpecialCase) ? new Color4(0.2f, 1f, 0.2f, 1f) + : ((lifeRatio >= 0.2f && !lifeSpecialCase) ? new Color4(1f, 1f, 0.2f, 1f) + : new Color4(1f, 0.2f, 0.2f, 1f)); + + OpenTaiko.Tx.Taiko_Combo[0].color4 = lifeColor; + OpenTaiko.Tx.Taiko_Combo[0].vcScaleRatio.X = 1.1f; + OpenTaiko.Tx.Taiko_Combo[0].vcScaleRatio.Y = 1.1f; + + for (int idx = 0; idx < len; idx++) { + int currentNum = int.Parse(lifeStr[len - idx - 1].ToString()); + + OpenTaiko.Tx.Taiko_Combo[0].t2D描画(OpenTaiko.Skin.Game_Tower_Life_Number[0] + ((digitLength - 8) * (len - idx) * 1.1f), + OpenTaiko.Skin.Game_Tower_Life_Number[1], + new Rectangle(digitLength * currentNum, 0, + digitLength, OpenTaiko.Tx.Taiko_Combo[0].szTextureSize.Height)); } + + OpenTaiko.Tx.Taiko_Combo[0].color4 = new Color4(1f, 1f, 1f, 1f); + + #endregion + } #endregion - - #region [Miss icon] - - if (CFloorManagement.InvincibilityFrames != null && CFloorManagement.InvincibilityFrames.CurrentValue < CFloorManagement.InvincibilityDurationSpeedDependent) { - if (OpenTaiko.Tx.Tower_Miss != null) - OpenTaiko.Tx.Tower_Miss.Opacity = Math.Min(255, 1000 - CFloorManagement.InvincibilityFrames.CurrentValue); - OpenTaiko.Tx.Tower_Miss?.t2D下中央基準描画(OpenTaiko.Skin.Game_Tower_Miss[0], OpenTaiko.Skin.Game_Tower_Miss[1]); - } - - #endregion - - ctSlideAnimation?.Tick(); - ctClimbDuration?.Tick(); - ctStandingAnimation?.TickLoop(); - ctClimbingAnimation?.TickLoop(); - ctRunningAnimation?.TickLoop(); - ctStandTiredAnimation?.TickLoop(); - ctClimbTiredAnimation?.TickLoop(); - ctRunTiredAnimation?.TickLoop(); - ctClearAnimation?.Tick(); - ctClearTiredAnimation?.Tick(); - ctFailAnimation?.Tick(); - - #endregion - } else if (!OpenTaiko.stage演奏ドラム画面.bDoublePlay && OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] != (int)Difficulty.Dan) { - if (!IsDownNotFound) { - if (!OpenTaiko.stage演奏ドラム画面.bPAUSE) DownScript?.Update(); - DownScript?.Draw(); - } } + } + + #endregion + + #region [Lower background] + + + if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Tower) { + int maxFloor = OpenTaiko.stageSongSelect.rChoosenSong.arスコア[5].譜面情報.nTotalFloor; + + OpenTaiko.actTextConsole.Print(0, 0, CTextConsole.EFontType.White, maxFloor.ToString()); + + int nightTime = Math.Max(140, maxFloor / 2); + + int currentTowerType = Array.IndexOf(OpenTaiko.Skin.Game_Tower_Names, OpenTaiko.stageSongSelect.rChoosenSong.arスコア[5].譜面情報.nTowerType); + + if (currentTowerType < 0 || currentTowerType >= OpenTaiko.Skin.Game_Tower_Ptn) + currentTowerType = 0; + + #region [Tower lower background] + + float nextPositionMax140 = Math.Min((OpenTaiko.stage演奏ドラム画面.actPlayInfo.NowMeasure[0] + 1) / (float)nightTime, 1f); + + if (bFloorChanged == true) + ctSlideAnimation.Start(0, 1000, 120f / ((float)OpenTaiko.stage演奏ドラム画面.actPlayInfo.dbBPM[0] * OpenTaiko.ConfigIni.SongPlaybackSpeed), OpenTaiko.Timer); + + float progressFactor = (nextPositionMax140 - currentFloorPositionMax140) * (ctSlideAnimation.CurrentValue / 1000f); + + + + #region [Skybox] + + //int skyboxYPosition = (int)((TJAPlayer3.Tx.Tower_Sky_Gradient.szテクスチャサイズ.Height - TJAPlayer3.Skin.Game_Tower_Sky_Gradient_Size[1]) * (1f - (currentFloorPositionMax140 + progressFactor))); + + //TJAPlayer3.Tx.Tower_Sky_Gradient?.t2D描画(TJAPlayer3.Skin.Game_Tower_Sky_Gradient[0], TJAPlayer3.Skin.Game_Tower_Sky_Gradient[1], + //new Rectangle(0, skyboxYPosition, TJAPlayer3.Skin.Game_Tower_Sky_Gradient_Size[0], TJAPlayer3.Skin.Game_Tower_Sky_Gradient_Size[1])); + + if (!OpenTaiko.stage演奏ドラム画面.bPAUSE) DownScript.Update(); + DownScript.Draw(); + + #endregion + + + #region [Tower body] + + progressFactor = ctSlideAnimation.CurrentValue / 1000f; + + int currentTower = currentTowerType; + + // Will implement the roof later, need the beforehand total floor count calculation before + int nextTowerBase = ((OpenTaiko.stage演奏ドラム画面.actPlayInfo.NowMeasure[0] + 1) / 10) % OpenTaiko.Skin.Game_Tower_Ptn_Base[currentTower]; + int towerBase = (OpenTaiko.stage演奏ドラム画面.actPlayInfo.NowMeasure[0] / 10) % OpenTaiko.Skin.Game_Tower_Ptn_Base[currentTower]; + + int currentDeco = OpenTaiko.stage演奏ドラム画面.actPlayInfo.NowMeasure[0] % OpenTaiko.Skin.Game_Tower_Ptn_Deco[currentTower]; + int nextDeco = (OpenTaiko.stage演奏ドラム画面.actPlayInfo.NowMeasure[0] + 1) % OpenTaiko.Skin.Game_Tower_Ptn_Deco[currentTower]; + + // Microfix for the first floor suddenly changing texture + if (OpenTaiko.stage演奏ドラム画面.actPlayInfo.NowMeasure[0] == 0 && OpenTaiko.Skin.Game_Tower_Ptn_Deco[currentTower] > 1) + currentDeco++; + if (OpenTaiko.stage演奏ドラム画面.actPlayInfo.NowMeasure[0] == 0 && OpenTaiko.Skin.Game_Tower_Ptn_Base[currentTower] > 1) + towerBase++; + + int widthChange = (int)(progressFactor * OpenTaiko.Skin.Game_Tower_Floors_Move[0]); + int heightChange = (int)(progressFactor * OpenTaiko.Skin.Game_Tower_Floors_Move[1]); + + // Current trunk + if (OpenTaiko.stage演奏ドラム画面.actPlayInfo.NowMeasure[0] < maxFloor) + OpenTaiko.Tx.Tower_Base[currentTower][towerBase]?.t2D下中央基準描画( + OpenTaiko.Skin.Game_Tower_Floors_Body[0] + widthChange, + OpenTaiko.Skin.Game_Tower_Floors_Body[1] + heightChange); // 316 + 360 + else + OpenTaiko.Tx.Tower_Top[currentTower]?.t2D下中央基準描画( + OpenTaiko.Skin.Game_Tower_Floors_Body[0] + widthChange, + OpenTaiko.Skin.Game_Tower_Floors_Body[1] + heightChange); + + // Current deco + OpenTaiko.Tx.Tower_Deco[currentTower][currentDeco]?.t2D下中央基準描画( + OpenTaiko.Skin.Game_Tower_Floors_Deco[0] + widthChange, + OpenTaiko.Skin.Game_Tower_Floors_Deco[1] + heightChange); + + int originY = OpenTaiko.Skin.Game_Tower_Floors_Move[1] - heightChange; + + // Next trunk + if (OpenTaiko.stage演奏ドラム画面.actPlayInfo.NowMeasure[0] + 1 < maxFloor) + OpenTaiko.Tx.Tower_Base[currentTower][nextTowerBase]?.t2D下中央基準描画( + OpenTaiko.Skin.Game_Tower_Floors_Body[0] - OpenTaiko.Skin.Game_Tower_Floors_Move[0] + widthChange, + OpenTaiko.Skin.Game_Tower_Floors_Body[1] - OpenTaiko.Skin.Game_Tower_Floors_Move[1] + heightChange, + new Rectangle(0, originY, OpenTaiko.Tx.Tower_Base[currentTower][nextTowerBase].szTextureSize.Width, OpenTaiko.Tx.Tower_Base[currentTower][nextTowerBase].szTextureSize.Height - originY)); + else if (OpenTaiko.stage演奏ドラム画面.actPlayInfo.NowMeasure[0] + 1 == maxFloor) { + OpenTaiko.Tx.Tower_Top[currentTower]?.t2D下中央基準描画( + OpenTaiko.Skin.Game_Tower_Floors_Body[0] - OpenTaiko.Skin.Game_Tower_Floors_Move[0] + widthChange, + OpenTaiko.Skin.Game_Tower_Floors_Body[1] - OpenTaiko.Skin.Game_Tower_Floors_Move[1] + heightChange, + new Rectangle(0, originY, OpenTaiko.Tx.Tower_Top[currentTower].szTextureSize.Width, OpenTaiko.Tx.Tower_Top[currentTower].szTextureSize.Height - originY)); + } + + // Next deco + if (OpenTaiko.stage演奏ドラム画面.actPlayInfo.NowMeasure[0] + 1 <= maxFloor) + OpenTaiko.Tx.Tower_Deco[currentTower][nextDeco]?.t2D下中央基準描画( + OpenTaiko.Skin.Game_Tower_Floors_Deco[0] - OpenTaiko.Skin.Game_Tower_Floors_Move[0] + widthChange, + OpenTaiko.Skin.Game_Tower_Floors_Deco[1] - OpenTaiko.Skin.Game_Tower_Floors_Move[1] + heightChange); #endregion - return base.Draw(); + #region [Climbing don] + + bool ctIsTired = !((CFloorManagement.CurrentNumberOfLives / (float)CFloorManagement.MaxNumberOfLives) >= 0.2f && !(CFloorManagement.CurrentNumberOfLives == 1 && CFloorManagement.MaxNumberOfLives != 1)); + + bool stageEnded = OpenTaiko.stage演奏ドラム画面.ePhaseID == CStage.EPhase.Game_EndStage || OpenTaiko.stage演奏ドラム画面.ePhaseID == CStage.EPhase.Game_STAGE_CLEAR_FadeOut || CFloorManagement.CurrentNumberOfLives == 0; + + if (bFloorChanged == true) { + float floorBPM = (float)(OpenTaiko.stage演奏ドラム画面.actPlayInfo.dbBPM[0] * OpenTaiko.ConfigIni.SongPlaybackSpeed); + ctClimbDuration.Start(0, 1500, 120f / floorBPM, OpenTaiko.Timer); + ctStandingAnimation.Start(0, 1000, (60000f / floorBPM) * OpenTaiko.Skin.Characters_Beat_Tower_Standing[currentCharacter] / OpenTaiko.Skin.Characters_Tower_Standing_Ptn[currentCharacter], OpenTaiko.Timer); + ctClimbingAnimation.Start(0, 1000, (120000f / floorBPM) / OpenTaiko.Skin.Characters_Tower_Climbing_Ptn[currentCharacter], OpenTaiko.Timer); + ctRunningAnimation.Start(0, 1000, (60000f / floorBPM) / OpenTaiko.Skin.Characters_Tower_Running_Ptn[currentCharacter], OpenTaiko.Timer); + ctStandTiredAnimation.Start(0, 1000, (60000f / floorBPM) * OpenTaiko.Skin.Characters_Beat_Tower_Standing_Tired[currentCharacter] / OpenTaiko.Skin.Characters_Tower_Standing_Tired_Ptn[currentCharacter], OpenTaiko.Timer); + ctClimbTiredAnimation.Start(0, 1000, (120000f / floorBPM) / OpenTaiko.Skin.Characters_Tower_Climbing_Tired_Ptn[currentCharacter], OpenTaiko.Timer); + ctRunTiredAnimation.Start(0, 1000, (60000f / floorBPM) / OpenTaiko.Skin.Characters_Tower_Running_Tired_Ptn[currentCharacter], OpenTaiko.Timer); + } + + bool isClimbing = ctClimbDuration.CurrentValue > 0 && ctClimbDuration.CurrentValue < 1500; + + if (stageEnded && !TowerFinished && !isClimbing) { + float floorBPM = (float)(OpenTaiko.stage演奏ドラム画面.actPlayInfo.dbBPM[0] * OpenTaiko.ConfigIni.SongPlaybackSpeed); + ctClearAnimation.Start(0, 20000, (60000f / floorBPM) * OpenTaiko.Skin.Characters_Beat_Tower_Clear[currentCharacter] / OpenTaiko.Skin.Characters_Tower_Clear_Ptn[currentCharacter], OpenTaiko.Timer); + ctClearTiredAnimation.Start(0, 20000, (60000f / floorBPM) * OpenTaiko.Skin.Characters_Beat_Tower_Clear_Tired[currentCharacter] / OpenTaiko.Skin.Characters_Tower_Clear_Tired_Ptn[currentCharacter], OpenTaiko.Timer); + ctFailAnimation.Start(0, 20000, (60000f / floorBPM) * OpenTaiko.Skin.Characters_Beat_Tower_Fail[currentCharacter] / OpenTaiko.Skin.Characters_Tower_Fail_Ptn[currentCharacter], OpenTaiko.Timer); + TowerFinished = true; + } + + if (isClimbing) { + // Tired Climb + if (ctIsTired && (ctClimbDuration.CurrentValue <= 1000) && OpenTaiko.Skin.Characters_Tower_Climbing_Tired_Ptn[currentCharacter] > 0) { + int animChar = ctClimbTiredAnimation.CurrentValue % OpenTaiko.Skin.Characters_Tower_Climbing_Ptn[currentCharacter]; + int distDonX = (int)(ctClimbDuration.CurrentValue * (OpenTaiko.Skin.Game_Tower_Don_Move[0] / 1000f)); + int distDonY = (int)(ctClimbDuration.CurrentValue * (OpenTaiko.Skin.Game_Tower_Don_Move[1] / 1000f)); + OpenTaiko.Tx.Characters_Tower_Climbing_Tired[currentCharacter][animChar]?.t2D拡大率考慮下中心基準描画(OpenTaiko.Skin.Game_Tower_Don[0] + distDonX, OpenTaiko.Skin.Game_Tower_Don[1] + distDonY); + } + // Tired Run + else if (ctIsTired && (ctClimbDuration.CurrentValue > 1000 && ctClimbDuration.CurrentValue < 1500) && OpenTaiko.Skin.Characters_Tower_Running_Tired_Ptn[currentCharacter] > 0) { + int animChar = ctRunTiredAnimation.CurrentValue % OpenTaiko.Skin.Characters_Tower_Running_Ptn[currentCharacter]; + int distDonX = (int)((1500 - ctClimbDuration.CurrentValue) * (OpenTaiko.Skin.Game_Tower_Don_Move[0] / 500f)); + int distDonY = (int)((1500 - ctClimbDuration.CurrentValue) * (OpenTaiko.Skin.Game_Tower_Don_Move[1] / 500f)); + OpenTaiko.Tx.Characters_Tower_Running_Tired[currentCharacter][animChar]?.t2D拡大率考慮下中心基準描画(OpenTaiko.Skin.Game_Tower_Don[0] + distDonX, OpenTaiko.Skin.Game_Tower_Don[1] + distDonY); + } + // Climb + else if ((ctClimbDuration.CurrentValue <= 1000) && OpenTaiko.Skin.Characters_Tower_Climbing_Ptn[currentCharacter] > 0) { + int animChar = ctClimbingAnimation.CurrentValue % OpenTaiko.Skin.Characters_Tower_Climbing_Ptn[currentCharacter]; + int distDonX = (int)(ctClimbDuration.CurrentValue * (OpenTaiko.Skin.Game_Tower_Don_Move[0] / 1000f)); + int distDonY = (int)(ctClimbDuration.CurrentValue * (OpenTaiko.Skin.Game_Tower_Don_Move[1] / 1000f)); + OpenTaiko.Tx.Characters_Tower_Climbing[currentCharacter][animChar]?.t2D拡大率考慮下中心基準描画(OpenTaiko.Skin.Game_Tower_Don[0] + distDonX, OpenTaiko.Skin.Game_Tower_Don[1] + distDonY); + } + // Run + else if ((ctClimbDuration.CurrentValue > 1000 && ctClimbDuration.CurrentValue < 1500) && OpenTaiko.Skin.Characters_Tower_Running_Ptn[currentCharacter] > 0) { + int animChar = ctRunningAnimation.CurrentValue % OpenTaiko.Skin.Characters_Tower_Running_Ptn[currentCharacter]; + int distDonX = (int)((1500 - ctClimbDuration.CurrentValue) * (OpenTaiko.Skin.Game_Tower_Don_Move[0] / 500f)); + int distDonY = (int)((1500 - ctClimbDuration.CurrentValue) * (OpenTaiko.Skin.Game_Tower_Don_Move[1] / 500f)); + OpenTaiko.Tx.Characters_Tower_Running[currentCharacter][animChar]?.t2D拡大率考慮下中心基準描画(OpenTaiko.Skin.Game_Tower_Don[0] + distDonX, OpenTaiko.Skin.Game_Tower_Don[1] + distDonY); + } + } else { + // Fail + if (OpenTaiko.Skin.Characters_Tower_Fail_Ptn[currentCharacter] > 0 && CFloorManagement.CurrentNumberOfLives == 0) { + int animChar = OpenTaiko.Skin.Characters_Tower_Fail_IsLooping[currentCharacter] ? + ctFailAnimation.CurrentValue % OpenTaiko.Skin.Characters_Tower_Fail_Ptn[currentCharacter] : + Math.Min(ctFailAnimation.CurrentValue, OpenTaiko.Skin.Characters_Tower_Fail_Ptn[currentCharacter] - 1); + OpenTaiko.Tx.Characters_Tower_Fail[currentCharacter][animChar]?.t2D拡大率考慮下中心基準描画(OpenTaiko.Skin.Game_Tower_Don[0], OpenTaiko.Skin.Game_Tower_Don[1]); + } + // Tired Clear + else if (ctIsTired && stageEnded && OpenTaiko.Skin.Characters_Tower_Clear_Tired_Ptn[currentCharacter] > 0 && CFloorManagement.CurrentNumberOfLives > 0) { + int animChar = OpenTaiko.Skin.Characters_Tower_Clear_Tired_IsLooping[currentCharacter] ? + ctClearTiredAnimation.CurrentValue % OpenTaiko.Skin.Characters_Tower_Clear_Tired_Ptn[currentCharacter] : + Math.Min(ctClearTiredAnimation.CurrentValue, OpenTaiko.Skin.Characters_Tower_Clear_Tired_Ptn[currentCharacter] - 1); + OpenTaiko.Tx.Characters_Tower_Clear_Tired[currentCharacter][animChar]?.t2D拡大率考慮下中心基準描画(OpenTaiko.Skin.Game_Tower_Don[0], OpenTaiko.Skin.Game_Tower_Don[1]); + } + // Clear + else if (stageEnded && OpenTaiko.Skin.Characters_Tower_Clear_Ptn[currentCharacter] > 0 && CFloorManagement.CurrentNumberOfLives > 0) { + int animChar = OpenTaiko.Skin.Characters_Tower_Clear_IsLooping[currentCharacter] ? + ctClearAnimation.CurrentValue % OpenTaiko.Skin.Characters_Tower_Clear_Ptn[currentCharacter] : + Math.Min(ctClearAnimation.CurrentValue, OpenTaiko.Skin.Characters_Tower_Clear_Ptn[currentCharacter] - 1); + OpenTaiko.Tx.Characters_Tower_Clear[currentCharacter][animChar]?.t2D拡大率考慮下中心基準描画(OpenTaiko.Skin.Game_Tower_Don[0], OpenTaiko.Skin.Game_Tower_Don[1]); + } + + // Tired Stand + else if (ctIsTired && OpenTaiko.Skin.Characters_Tower_Standing_Tired_Ptn[currentCharacter] > 0) { + int animChar = ctStandTiredAnimation.CurrentValue % OpenTaiko.Skin.Characters_Tower_Standing_Tired_Ptn[currentCharacter]; + OpenTaiko.Tx.Characters_Tower_Standing_Tired[currentCharacter][animChar]?.t2D拡大率考慮下中心基準描画(OpenTaiko.Skin.Game_Tower_Don[0], OpenTaiko.Skin.Game_Tower_Don[1]); // Center X - 50 + } + // Stand + else if (OpenTaiko.Skin.Characters_Tower_Standing_Ptn[currentCharacter] > 0) { + int animChar = ctStandingAnimation.CurrentValue % OpenTaiko.Skin.Characters_Tower_Standing_Ptn[currentCharacter]; + OpenTaiko.Tx.Characters_Tower_Standing[currentCharacter][animChar]?.t2D拡大率考慮下中心基準描画(OpenTaiko.Skin.Game_Tower_Don[0], OpenTaiko.Skin.Game_Tower_Don[1]); // Center X - 50 + } + } + + #endregion + + #region [Miss icon] + + if (CFloorManagement.InvincibilityFrames != null && CFloorManagement.InvincibilityFrames.CurrentValue < CFloorManagement.InvincibilityDurationSpeedDependent) { + if (OpenTaiko.Tx.Tower_Miss != null) + OpenTaiko.Tx.Tower_Miss.Opacity = Math.Min(255, 1000 - CFloorManagement.InvincibilityFrames.CurrentValue); + OpenTaiko.Tx.Tower_Miss?.t2D下中央基準描画(OpenTaiko.Skin.Game_Tower_Miss[0], OpenTaiko.Skin.Game_Tower_Miss[1]); + } + + #endregion + + ctSlideAnimation?.Tick(); + ctClimbDuration?.Tick(); + ctStandingAnimation?.TickLoop(); + ctClimbingAnimation?.TickLoop(); + ctRunningAnimation?.TickLoop(); + ctStandTiredAnimation?.TickLoop(); + ctClimbTiredAnimation?.TickLoop(); + ctRunTiredAnimation?.TickLoop(); + ctClearAnimation?.Tick(); + ctClearTiredAnimation?.Tick(); + ctFailAnimation?.Tick(); + + #endregion + } else if (!OpenTaiko.stage演奏ドラム画面.bDoublePlay && OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] != (int)Difficulty.Dan) { + if (!IsDownNotFound) { + if (!OpenTaiko.stage演奏ドラム画面.bPAUSE) DownScript?.Update(); + DownScript?.Draw(); + } } - #region[ private ] - //----------------- - #region 背景 - /*private CTexture Background, - Background_Down, - Background_Down_Clear, - Background_Down_Scroll; - private CTexture[] Background_Up_1st, - Background_Up_2nd, - Background_Up_3rd, - Background_Up_Dan = new CTexture[6], - Background_Up_Tower = new CTexture[8];*/ #endregion - /*private CCounter[] ct上背景スクロール用タイマー1st; //上背景のX方向スクロール用 - private CCounter[] ct上背景スクロール用タイマー2nd; //上背景のY方向スクロール用 - private CCounter[] ct上背景スクロール用タイマー3rd; //上背景のY方向スクロール用 - private CCounter ct下背景スクロール用タイマー1; //下背景パーツ1のX方向スクロール用 - private CCounter ct上背景FIFOタイマー; - private CCounter[] ct上背景クリアインタイマー; - private CCounter[] ct上背景スクロール用タイマー1stDan; //上背景のX方向スクロール用 - private CCounter ct上背景スクロール用タイマー2stDan; //上背景のY方向スクロール用 - - private CCounter[] ct上背景スクロール用タイマー1stTower; //上背景のX方向スクロール用 - private CCounter ct上背景スクロール用タイマー2stTower; //上背景のX方向スクロール用 - */ - //private CTexture tx上背景メイン; - //private CTexture tx上背景クリアメイン; - //private CTexture tx下背景メイン; - //private CTexture tx下背景クリアメイン; - //private CTexture tx下背景クリアサブ1; - - public ScriptBG UpScript; - public ScriptBG DownScript; - - private TitleTextureKey ttkTouTatsuKaiSuu; - private TitleTextureKey ttkKai; - private CCachedFontRenderer pfTowerText; - - private bool bFloorChanged = false; - private int currentCharacter; - private CCounter ctSlideAnimation; - private CCounter ctStandingAnimation; - private CCounter ctClimbingAnimation; - private CCounter ctRunningAnimation; - private CCounter ctClearAnimation; - private CCounter ctFailAnimation; - private CCounter ctStandTiredAnimation; - private CCounter ctClimbTiredAnimation; - private CCounter ctRunTiredAnimation; - private CCounter ctClearTiredAnimation; - private CCounter ctClimbDuration; - private bool TowerFinished; - - private CCounter ct炎; - - private bool IsUpNotFound; - private bool IsDownNotFound; - - private EFIFOMode eFadeMode; - //----------------- - #endregion + return base.Draw(); } + + #region[ private ] + //----------------- + + #region 背景 + /*private CTexture Background, + Background_Down, + Background_Down_Clear, + Background_Down_Scroll; + private CTexture[] Background_Up_1st, + Background_Up_2nd, + Background_Up_3rd, + Background_Up_Dan = new CTexture[6], + Background_Up_Tower = new CTexture[8];*/ + #endregion + + /*private CCounter[] ct上背景スクロール用タイマー1st; //上背景のX方向スクロール用 + private CCounter[] ct上背景スクロール用タイマー2nd; //上背景のY方向スクロール用 + private CCounter[] ct上背景スクロール用タイマー3rd; //上背景のY方向スクロール用 + private CCounter ct下背景スクロール用タイマー1; //下背景パーツ1のX方向スクロール用 + private CCounter ct上背景FIFOタイマー; + private CCounter[] ct上背景クリアインタイマー; + private CCounter[] ct上背景スクロール用タイマー1stDan; //上背景のX方向スクロール用 + private CCounter ct上背景スクロール用タイマー2stDan; //上背景のY方向スクロール用 + + private CCounter[] ct上背景スクロール用タイマー1stTower; //上背景のX方向スクロール用 + private CCounter ct上背景スクロール用タイマー2stTower; //上背景のX方向スクロール用 + */ + //private CTexture tx上背景メイン; + //private CTexture tx上背景クリアメイン; + //private CTexture tx下背景メイン; + //private CTexture tx下背景クリアメイン; + //private CTexture tx下背景クリアサブ1; + + public ScriptBG UpScript; + public ScriptBG DownScript; + + private TitleTextureKey ttkTouTatsuKaiSuu; + private TitleTextureKey ttkKai; + private CCachedFontRenderer pfTowerText; + + private bool bFloorChanged = false; + private int currentCharacter; + private CCounter ctSlideAnimation; + private CCounter ctStandingAnimation; + private CCounter ctClimbingAnimation; + private CCounter ctRunningAnimation; + private CCounter ctClearAnimation; + private CCounter ctFailAnimation; + private CCounter ctStandTiredAnimation; + private CCounter ctClimbTiredAnimation; + private CCounter ctRunTiredAnimation; + private CCounter ctClearTiredAnimation; + private CCounter ctClimbDuration; + private bool TowerFinished; + + private CCounter ct炎; + + private bool IsUpNotFound; + private bool IsDownNotFound; + + private EFIFOMode eFadeMode; + //----------------- + #endregion } diff --git a/OpenTaiko/src/Stages/07.Game/Taiko/CActImplBalloon.cs b/OpenTaiko/src/Stages/07.Game/Taiko/CActImplBalloon.cs index 4c54b740..67852e30 100644 --- a/OpenTaiko/src/Stages/07.Game/Taiko/CActImplBalloon.cs +++ b/OpenTaiko/src/Stages/07.Game/Taiko/CActImplBalloon.cs @@ -2,264 +2,264 @@ using System.Runtime.InteropServices; using FDK; -namespace OpenTaiko { - internal class CActImplBalloon : CActivity { +namespace OpenTaiko; + +internal class CActImplBalloon : CActivity { - public CActImplBalloon() { - base.IsDeActivated = true; + public CActImplBalloon() { + base.IsDeActivated = true; + } + + public override void Activate() { + this.ct風船終了 = new CCounter(); + this.ct風船ふきだしアニメ = new CCounter(); + this.ct風船アニメ = new CCounter[5]; + for (int i = 0; i < 5; i++) { + this.ct風船アニメ[i] = new CCounter(); } - public override void Activate() { - this.ct風船終了 = new CCounter(); - this.ct風船ふきだしアニメ = new CCounter(); - this.ct風船アニメ = new CCounter[5]; - for (int i = 0; i < 5; i++) { - this.ct風船アニメ[i] = new CCounter(); - } + this.ct風船ふきだしアニメ = new CCounter(0, 1, 100, OpenTaiko.Timer); - this.ct風船ふきだしアニメ = new CCounter(0, 1, 100, OpenTaiko.Timer); + KusudamaScript = new(CSkin.Path($"{TextureLoader.BASE}{TextureLoader.GAME}{TextureLoader.BALLOON}{TextureLoader.KUSUDAMA}Script.lua")); + KusudamaScript.Init(); - KusudamaScript = new(CSkin.Path($"{TextureLoader.BASE}{TextureLoader.GAME}{TextureLoader.BALLOON}{TextureLoader.KUSUDAMA}Script.lua")); - KusudamaScript.Init(); + base.Activate(); + } - base.Activate(); + public override void DeActivate() { + KusudamaScript.Dispose(); + + this.ct風船終了 = null; + this.ct風船ふきだしアニメ = null; + + base.DeActivate(); + } + + public override void CreateManagedResource() { + base.CreateManagedResource(); + } + + public override void ReleaseManagedResource() { + base.ReleaseManagedResource(); + } + + public override int Draw() { + return base.Draw(); + } + + public void KusuIn() { + KusudamaScript.KusuIn(); + KusudamaIsActive = true; + } + public void KusuBroke() { + KusudamaScript.KusuBroke(); + KusudamaIsActive = false; + } + public void KusuMiss() { + KusudamaScript.KusuMiss(); + KusudamaIsActive = false; + } + + public enum EBalloonType { + BALLOON, + KUSUDAMA, + FUSEROLL + } + + public bool KusudamaIsActive { get; private set; } = false; + + public void tDrawKusudama() { + if (!OpenTaiko.stage演奏ドラム画面.bPAUSE) { + KusudamaScript.Update(); } - - public override void DeActivate() { - KusudamaScript.Dispose(); - - this.ct風船終了 = null; - this.ct風船ふきだしアニメ = null; - - base.DeActivate(); - } - - public override void CreateManagedResource() { - base.CreateManagedResource(); - } - - public override void ReleaseManagedResource() { - base.ReleaseManagedResource(); - } - - public override int Draw() { - return base.Draw(); - } - - public void KusuIn() { - KusudamaScript.KusuIn(); - KusudamaIsActive = true; - } - public void KusuBroke() { - KusudamaScript.KusuBroke(); - KusudamaIsActive = false; - } - public void KusuMiss() { - KusudamaScript.KusuMiss(); - KusudamaIsActive = false; - } - - public enum EBalloonType { - BALLOON, - KUSUDAMA, - FUSEROLL - } - - public bool KusudamaIsActive { get; private set; } = false; - - public void tDrawKusudama() { - if (!OpenTaiko.stage演奏ドラム画面.bPAUSE) { - KusudamaScript.Update(); - } - if (!(OpenTaiko.stage演奏ドラム画面.bPAUSE && OpenTaiko.ConfigIni.bTokkunMode)) { - KusudamaScript.Draw(); - } - } - - public int On進行描画(int n連打ノルマ, int n連打数, int player, EBalloonType btype) { - this.ct風船ふきだしアニメ.TickLoop(); - this.ct風船アニメ[player].Tick(); - - //CDTXMania.act文字コンソール.tPrint( 0, 16, C文字コンソール.Eフォント種別.赤, this.ct風船終了.n現在の値.ToString() ); - int[] n残り打数 = new int[] { 0, 0, 0, 0, 0 }; - #region[ ] - if (n連打ノルマ > 0) { - if (n連打ノルマ < 5) { - n残り打数 = new int[] { 4, 3, 2, 1, 0 }; - } else { - n残り打数[0] = (n連打ノルマ / 5) * 4; - n残り打数[1] = (n連打ノルマ / 5) * 3; - n残り打数[2] = (n連打ノルマ / 5) * 2; - n残り打数[3] = (n連打ノルマ / 5) * 1; - } - } - #endregion - - if (n連打数 != 0) { - int x; - int y; - int frame_x; - int frame_y; - int num_x; - int num_y; - if (OpenTaiko.ConfigIni.nPlayerCount == 5) { - x = OpenTaiko.Skin.Game_Balloon_Balloon_5P[0] + (OpenTaiko.Skin.Game_UIMove_5P[0] * player); - y = OpenTaiko.Skin.Game_Balloon_Balloon_5P[1] + (OpenTaiko.Skin.Game_UIMove_5P[1] * player); - frame_x = OpenTaiko.Skin.Game_Balloon_Balloon_Frame_5P[0] + (OpenTaiko.Skin.Game_UIMove_5P[0] * player); - frame_y = OpenTaiko.Skin.Game_Balloon_Balloon_Frame_5P[1] + (OpenTaiko.Skin.Game_UIMove_5P[1] * player); - num_x = OpenTaiko.Skin.Game_Balloon_Balloon_Number_5P[0] + (OpenTaiko.Skin.Game_UIMove_5P[0] * player); - num_y = OpenTaiko.Skin.Game_Balloon_Balloon_Number_5P[1] + (OpenTaiko.Skin.Game_UIMove_5P[1] * player); - } else if (OpenTaiko.ConfigIni.nPlayerCount == 4 || OpenTaiko.ConfigIni.nPlayerCount == 3) { - x = OpenTaiko.Skin.Game_Balloon_Balloon_4P[0] + (OpenTaiko.Skin.Game_UIMove_4P[0] * player); - y = OpenTaiko.Skin.Game_Balloon_Balloon_4P[1] + (OpenTaiko.Skin.Game_UIMove_4P[1] * player); - frame_x = OpenTaiko.Skin.Game_Balloon_Balloon_Frame_4P[0] + (OpenTaiko.Skin.Game_UIMove_4P[0] * player); - frame_y = OpenTaiko.Skin.Game_Balloon_Balloon_Frame_4P[1] + (OpenTaiko.Skin.Game_UIMove_4P[1] * player); - num_x = OpenTaiko.Skin.Game_Balloon_Balloon_Number_4P[0] + (OpenTaiko.Skin.Game_UIMove_4P[0] * player); - num_y = OpenTaiko.Skin.Game_Balloon_Balloon_Number_4P[1] + (OpenTaiko.Skin.Game_UIMove_4P[1] * player); - } else { - x = OpenTaiko.Skin.Game_Balloon_Balloon_X[player]; - y = OpenTaiko.Skin.Game_Balloon_Balloon_Y[player]; - frame_x = OpenTaiko.Skin.Game_Balloon_Balloon_Frame_X[player]; - frame_y = OpenTaiko.Skin.Game_Balloon_Balloon_Frame_Y[player]; - num_x = OpenTaiko.Skin.Game_Balloon_Balloon_Number_X[player]; - num_y = OpenTaiko.Skin.Game_Balloon_Balloon_Number_Y[player]; - } - //1P:0 2P:245 - //if (CDTXMania.Tx.Chara_Balloon_Breaking != null && CDTXMania.ConfigIni.ShowChara) - // CDTXMania.Tx.Chara_Balloon_Breaking.t2D描画(CDTXMania.app.Device, CDTXMania.Skin.Game_Chara_Balloon_X[player], CDTXMania.Skin.Game_Chara_Balloon_Y[player]); - for (int j = 0; j < 5; j++) { - - if (n残り打数[j] < n連打数 && btype == EBalloonType.BALLOON) { - if (OpenTaiko.Tx.Balloon_Breaking[j] != null) - OpenTaiko.Tx.Balloon_Breaking[j].t2D描画(x + (this.ct風船ふきだしアニメ.CurrentValue == 1 ? 3 : 0), y); - break; - } - } - //1P:31 2P:329 - - if (btype == EBalloonType.BALLOON) { - if (OpenTaiko.Tx.Balloon_Balloon != null) - OpenTaiko.Tx.Balloon_Balloon.t2D描画(frame_x, frame_y); - this.t文字表示(num_x, num_y, n連打数, player); - } else if (btype == EBalloonType.FUSEROLL) { - if (OpenTaiko.Tx.Fuse_Balloon != null) - OpenTaiko.Tx.Fuse_Balloon.t2D描画(frame_x, frame_y); - this.tFuseNumber(num_x, num_y, n連打数, player); - } else if (btype == EBalloonType.KUSUDAMA && player == 0) { - /* - if (TJAPlayer3.Tx.Kusudama_Back != null) - TJAPlayer3.Tx.Kusudama_Back.t2D描画(0, 0); - if (TJAPlayer3.Tx.Kusudama != null) - TJAPlayer3.Tx.Kusudama.t2D描画(0, 0); - */ - if (!(OpenTaiko.stage演奏ドラム画面.bPAUSE && OpenTaiko.ConfigIni.bTokkunMode)) - this.tKusudamaNumber(n連打数); - } - - //CDTXMania.act文字コンソール.tPrint( 0, 0, C文字コンソール.Eフォント種別.白, n連打数.ToString() ); - } - if (btype == EBalloonType.KUSUDAMA) { - /* - for(int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) - { - TJAPlayer3.stage演奏ドラム画面.actChara.b風船連打中[i] = false; - TJAPlayer3.stage演奏ドラム画面.b連打中[i] = false; - } - */ - } else { - if (n連打数 == 0 && OpenTaiko.stage演奏ドラム画面.actChara.b風船連打中[player]) { - OpenTaiko.stage演奏ドラム画面.actChara.b風船連打中[player] = false; - OpenTaiko.stage演奏ドラム画面.b連打中[player] = false; - } - } - - - - - - return base.Draw(); - } - - public KusudamaScript KusudamaScript { get; private set; } - - - private CCounter ct風船終了; - private CCounter ct風船ふきだしアニメ; - - public CCounter[] ct風船アニメ; - private float[] RollScale = new float[] - { - 0.000f, - 0.123f, // リピート - 0.164f, - 0.164f, - 0.164f, - 0.137f, - 0.110f, - 0.082f, - 0.055f, - 0.000f - }; - - [StructLayout(LayoutKind.Sequential)] - private struct ST文字位置 { - public char ch; - public Point pt; - } - - private void _nbDisplay(CTexture tx, int num, int x, int y) { - int[] nums = CConversion.SeparateDigits(num); - for (int j = 0; j < nums.Length; j++) { - float offset = j - (nums.Length / 2.0f); - float _x = x - (OpenTaiko.Skin.Game_Balloon_Number_Interval[0] * offset); - float _y = y - (OpenTaiko.Skin.Game_Balloon_Number_Interval[1] * offset); - - float width = tx.sz画像サイズ.Width / 10.0f; - float height = tx.sz画像サイズ.Height; - - tx.t2D拡大率考慮下基準描画(_x, _y, new RectangleF(width * nums[j], 0, width, height)); - } - } - - private void tKusudamaNumber(int num) { - if (OpenTaiko.Tx.Kusudama_Number == null) return; - OpenTaiko.Tx.Kusudama_Number.vcScaleRatio.X = OpenTaiko.Skin.Game_Balloon_Balloon_Number_Scale; - OpenTaiko.Tx.Kusudama_Number.vcScaleRatio.Y = OpenTaiko.Skin.Game_Balloon_Balloon_Number_Scale; - int x = OpenTaiko.Skin.Game_Kusudama_Number_X; - int y = OpenTaiko.Skin.Game_Kusudama_Number_Y; - - int[] nums = CConversion.SeparateDigits(num); - for (int j = 0; j < nums.Length; j++) { - float offset = j - ((nums.Length - 2) / 2.0f); - float width = OpenTaiko.Tx.Kusudama_Number.sz画像サイズ.Width / 10.0f; - float height = OpenTaiko.Tx.Kusudama_Number.sz画像サイズ.Height; - float _x = x - (width * offset); - float _y = y; - - OpenTaiko.Tx.Kusudama_Number.t2D拡大率考慮下基準描画(_x, _y, new RectangleF(width * nums[j], 0, width, height)); - } - } - - private void tFuseNumber(int x, int y, int num, int nPlayer) { - if (OpenTaiko.Tx.Fuse_Number == null) return; - OpenTaiko.Tx.Fuse_Number.vcScaleRatio.X = OpenTaiko.Skin.Game_Balloon_Balloon_Number_Scale; - OpenTaiko.Tx.Fuse_Number.vcScaleRatio.Y = OpenTaiko.Skin.Game_Balloon_Balloon_Number_Scale + RollScale[this.ct風船アニメ[nPlayer].CurrentValue]; - - _nbDisplay(OpenTaiko.Tx.Fuse_Number, num, x, y); - } - - private void t文字表示(int x, int y, int num, int nPlayer) { - if (OpenTaiko.Tx.Balloon_Number_Roll == null) return; - OpenTaiko.Tx.Balloon_Number_Roll.vcScaleRatio.X = OpenTaiko.Skin.Game_Balloon_Balloon_Number_Scale; - OpenTaiko.Tx.Balloon_Number_Roll.vcScaleRatio.Y = OpenTaiko.Skin.Game_Balloon_Balloon_Number_Scale + RollScale[this.ct風船アニメ[nPlayer].CurrentValue]; - - _nbDisplay(OpenTaiko.Tx.Balloon_Number_Roll, num, x, y); - } - - public void tEnd() { - this.ct風船終了 = new CCounter(0, 80, 10, SoundManager.PlayTimer); + if (!(OpenTaiko.stage演奏ドラム画面.bPAUSE && OpenTaiko.ConfigIni.bTokkunMode)) { + KusudamaScript.Draw(); } } + + public int On進行描画(int n連打ノルマ, int n連打数, int player, EBalloonType btype) { + this.ct風船ふきだしアニメ.TickLoop(); + this.ct風船アニメ[player].Tick(); + + //CDTXMania.act文字コンソール.tPrint( 0, 16, C文字コンソール.Eフォント種別.赤, this.ct風船終了.n現在の値.ToString() ); + int[] n残り打数 = new int[] { 0, 0, 0, 0, 0 }; + #region[ ] + if (n連打ノルマ > 0) { + if (n連打ノルマ < 5) { + n残り打数 = new int[] { 4, 3, 2, 1, 0 }; + } else { + n残り打数[0] = (n連打ノルマ / 5) * 4; + n残り打数[1] = (n連打ノルマ / 5) * 3; + n残り打数[2] = (n連打ノルマ / 5) * 2; + n残り打数[3] = (n連打ノルマ / 5) * 1; + } + } + #endregion + + if (n連打数 != 0) { + int x; + int y; + int frame_x; + int frame_y; + int num_x; + int num_y; + if (OpenTaiko.ConfigIni.nPlayerCount == 5) { + x = OpenTaiko.Skin.Game_Balloon_Balloon_5P[0] + (OpenTaiko.Skin.Game_UIMove_5P[0] * player); + y = OpenTaiko.Skin.Game_Balloon_Balloon_5P[1] + (OpenTaiko.Skin.Game_UIMove_5P[1] * player); + frame_x = OpenTaiko.Skin.Game_Balloon_Balloon_Frame_5P[0] + (OpenTaiko.Skin.Game_UIMove_5P[0] * player); + frame_y = OpenTaiko.Skin.Game_Balloon_Balloon_Frame_5P[1] + (OpenTaiko.Skin.Game_UIMove_5P[1] * player); + num_x = OpenTaiko.Skin.Game_Balloon_Balloon_Number_5P[0] + (OpenTaiko.Skin.Game_UIMove_5P[0] * player); + num_y = OpenTaiko.Skin.Game_Balloon_Balloon_Number_5P[1] + (OpenTaiko.Skin.Game_UIMove_5P[1] * player); + } else if (OpenTaiko.ConfigIni.nPlayerCount == 4 || OpenTaiko.ConfigIni.nPlayerCount == 3) { + x = OpenTaiko.Skin.Game_Balloon_Balloon_4P[0] + (OpenTaiko.Skin.Game_UIMove_4P[0] * player); + y = OpenTaiko.Skin.Game_Balloon_Balloon_4P[1] + (OpenTaiko.Skin.Game_UIMove_4P[1] * player); + frame_x = OpenTaiko.Skin.Game_Balloon_Balloon_Frame_4P[0] + (OpenTaiko.Skin.Game_UIMove_4P[0] * player); + frame_y = OpenTaiko.Skin.Game_Balloon_Balloon_Frame_4P[1] + (OpenTaiko.Skin.Game_UIMove_4P[1] * player); + num_x = OpenTaiko.Skin.Game_Balloon_Balloon_Number_4P[0] + (OpenTaiko.Skin.Game_UIMove_4P[0] * player); + num_y = OpenTaiko.Skin.Game_Balloon_Balloon_Number_4P[1] + (OpenTaiko.Skin.Game_UIMove_4P[1] * player); + } else { + x = OpenTaiko.Skin.Game_Balloon_Balloon_X[player]; + y = OpenTaiko.Skin.Game_Balloon_Balloon_Y[player]; + frame_x = OpenTaiko.Skin.Game_Balloon_Balloon_Frame_X[player]; + frame_y = OpenTaiko.Skin.Game_Balloon_Balloon_Frame_Y[player]; + num_x = OpenTaiko.Skin.Game_Balloon_Balloon_Number_X[player]; + num_y = OpenTaiko.Skin.Game_Balloon_Balloon_Number_Y[player]; + } + //1P:0 2P:245 + //if (CDTXMania.Tx.Chara_Balloon_Breaking != null && CDTXMania.ConfigIni.ShowChara) + // CDTXMania.Tx.Chara_Balloon_Breaking.t2D描画(CDTXMania.app.Device, CDTXMania.Skin.Game_Chara_Balloon_X[player], CDTXMania.Skin.Game_Chara_Balloon_Y[player]); + for (int j = 0; j < 5; j++) { + + if (n残り打数[j] < n連打数 && btype == EBalloonType.BALLOON) { + if (OpenTaiko.Tx.Balloon_Breaking[j] != null) + OpenTaiko.Tx.Balloon_Breaking[j].t2D描画(x + (this.ct風船ふきだしアニメ.CurrentValue == 1 ? 3 : 0), y); + break; + } + } + //1P:31 2P:329 + + if (btype == EBalloonType.BALLOON) { + if (OpenTaiko.Tx.Balloon_Balloon != null) + OpenTaiko.Tx.Balloon_Balloon.t2D描画(frame_x, frame_y); + this.t文字表示(num_x, num_y, n連打数, player); + } else if (btype == EBalloonType.FUSEROLL) { + if (OpenTaiko.Tx.Fuse_Balloon != null) + OpenTaiko.Tx.Fuse_Balloon.t2D描画(frame_x, frame_y); + this.tFuseNumber(num_x, num_y, n連打数, player); + } else if (btype == EBalloonType.KUSUDAMA && player == 0) { + /* + if (TJAPlayer3.Tx.Kusudama_Back != null) + TJAPlayer3.Tx.Kusudama_Back.t2D描画(0, 0); + if (TJAPlayer3.Tx.Kusudama != null) + TJAPlayer3.Tx.Kusudama.t2D描画(0, 0); + */ + if (!(OpenTaiko.stage演奏ドラム画面.bPAUSE && OpenTaiko.ConfigIni.bTokkunMode)) + this.tKusudamaNumber(n連打数); + } + + //CDTXMania.act文字コンソール.tPrint( 0, 0, C文字コンソール.Eフォント種別.白, n連打数.ToString() ); + } + if (btype == EBalloonType.KUSUDAMA) { + /* + for(int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) + { + TJAPlayer3.stage演奏ドラム画面.actChara.b風船連打中[i] = false; + TJAPlayer3.stage演奏ドラム画面.b連打中[i] = false; + } + */ + } else { + if (n連打数 == 0 && OpenTaiko.stage演奏ドラム画面.actChara.b風船連打中[player]) { + OpenTaiko.stage演奏ドラム画面.actChara.b風船連打中[player] = false; + OpenTaiko.stage演奏ドラム画面.b連打中[player] = false; + } + } + + + + + + return base.Draw(); + } + + public KusudamaScript KusudamaScript { get; private set; } + + + private CCounter ct風船終了; + private CCounter ct風船ふきだしアニメ; + + public CCounter[] ct風船アニメ; + private float[] RollScale = new float[] + { + 0.000f, + 0.123f, // リピート + 0.164f, + 0.164f, + 0.164f, + 0.137f, + 0.110f, + 0.082f, + 0.055f, + 0.000f + }; + + [StructLayout(LayoutKind.Sequential)] + private struct ST文字位置 { + public char ch; + public Point pt; + } + + private void _nbDisplay(CTexture tx, int num, int x, int y) { + int[] nums = CConversion.SeparateDigits(num); + for (int j = 0; j < nums.Length; j++) { + float offset = j - (nums.Length / 2.0f); + float _x = x - (OpenTaiko.Skin.Game_Balloon_Number_Interval[0] * offset); + float _y = y - (OpenTaiko.Skin.Game_Balloon_Number_Interval[1] * offset); + + float width = tx.sz画像サイズ.Width / 10.0f; + float height = tx.sz画像サイズ.Height; + + tx.t2D拡大率考慮下基準描画(_x, _y, new RectangleF(width * nums[j], 0, width, height)); + } + } + + private void tKusudamaNumber(int num) { + if (OpenTaiko.Tx.Kusudama_Number == null) return; + OpenTaiko.Tx.Kusudama_Number.vcScaleRatio.X = OpenTaiko.Skin.Game_Balloon_Balloon_Number_Scale; + OpenTaiko.Tx.Kusudama_Number.vcScaleRatio.Y = OpenTaiko.Skin.Game_Balloon_Balloon_Number_Scale; + int x = OpenTaiko.Skin.Game_Kusudama_Number_X; + int y = OpenTaiko.Skin.Game_Kusudama_Number_Y; + + int[] nums = CConversion.SeparateDigits(num); + for (int j = 0; j < nums.Length; j++) { + float offset = j - ((nums.Length - 2) / 2.0f); + float width = OpenTaiko.Tx.Kusudama_Number.sz画像サイズ.Width / 10.0f; + float height = OpenTaiko.Tx.Kusudama_Number.sz画像サイズ.Height; + float _x = x - (width * offset); + float _y = y; + + OpenTaiko.Tx.Kusudama_Number.t2D拡大率考慮下基準描画(_x, _y, new RectangleF(width * nums[j], 0, width, height)); + } + } + + private void tFuseNumber(int x, int y, int num, int nPlayer) { + if (OpenTaiko.Tx.Fuse_Number == null) return; + OpenTaiko.Tx.Fuse_Number.vcScaleRatio.X = OpenTaiko.Skin.Game_Balloon_Balloon_Number_Scale; + OpenTaiko.Tx.Fuse_Number.vcScaleRatio.Y = OpenTaiko.Skin.Game_Balloon_Balloon_Number_Scale + RollScale[this.ct風船アニメ[nPlayer].CurrentValue]; + + _nbDisplay(OpenTaiko.Tx.Fuse_Number, num, x, y); + } + + private void t文字表示(int x, int y, int num, int nPlayer) { + if (OpenTaiko.Tx.Balloon_Number_Roll == null) return; + OpenTaiko.Tx.Balloon_Number_Roll.vcScaleRatio.X = OpenTaiko.Skin.Game_Balloon_Balloon_Number_Scale; + OpenTaiko.Tx.Balloon_Number_Roll.vcScaleRatio.Y = OpenTaiko.Skin.Game_Balloon_Balloon_Number_Scale + RollScale[this.ct風船アニメ[nPlayer].CurrentValue]; + + _nbDisplay(OpenTaiko.Tx.Balloon_Number_Roll, num, x, y); + } + + public void tEnd() { + this.ct風船終了 = new CCounter(0, 80, 10, SoundManager.PlayTimer); + } } diff --git a/OpenTaiko/src/Stages/07.Game/Taiko/CActImplCharacter.cs b/OpenTaiko/src/Stages/07.Game/Taiko/CActImplCharacter.cs index b1b3df69..7a92e172 100644 --- a/OpenTaiko/src/Stages/07.Game/Taiko/CActImplCharacter.cs +++ b/OpenTaiko/src/Stages/07.Game/Taiko/CActImplCharacter.cs @@ -1,888 +1,887 @@ using FDK; -namespace OpenTaiko { - //クラスの設置位置は必ず演奏画面共通に置くこと。 - //そうしなければBPM変化に対応できません。 +namespace OpenTaiko; +//クラスの設置位置は必ず演奏画面共通に置くこと。 +//そうしなければBPM変化に対応できません。 - //完成している部分は以下のとおり。(画像完成+動作確認完了で完成とする) - //_通常モーション - //_ゴーゴータイムモーション - //_クリア時モーション - // - internal class CActImplCharacter : CActivity { - public CActImplCharacter() { +//完成している部分は以下のとおり。(画像完成+動作確認完了で完成とする) +//_通常モーション +//_ゴーゴータイムモーション +//_クリア時モーション +// +internal class CActImplCharacter : CActivity { + public CActImplCharacter() { + } + + public override void Activate() { + for (int i = 0; i < 5; i++) { + + /* + ctChara_Normal[i] = new CCounter(); + ctChara_Miss[i] = new CCounter(); + ctChara_MissDown[i] = new CCounter(); + ctChara_GoGo[i] = new CCounter(); + ctChara_Clear[i] = new CCounter(); + + this.ctキャラクターアクション_10コンボ[i] = new CCounter(); + this.ctキャラクターアクション_10コンボMAX[i] = new CCounter(); + this.ctキャラクターアクション_ゴーゴースタート[i] = new CCounter(); + this.ctキャラクターアクション_ゴーゴースタートMAX[i] = new CCounter(); + this.ctキャラクターアクション_ノルマ[i] = new CCounter(); + this.ctキャラクターアクション_魂MAX[i] = new CCounter(); + this.ctキャラクターアクション_Return[i] = new CCounter(); + */ + + //CharaAction_Balloon_Breaking[i] = new CCounter(); + //CharaAction_Balloon_Broke[i] = new CCounter(); + //CharaAction_Balloon_Miss[i] = new CCounter(); + CharaAction_Balloon_Delay[i] = new CCounter(); + ctKusuIn[i] = new(); + + // Currently used character + int p = OpenTaiko.GetActualPlayer(i); + + this.iCurrentCharacter[i] = Math.Max(0, Math.Min(OpenTaiko.SaveFileInstances[p].data.Character, OpenTaiko.Skin.Characters_Ptn - 1)); + + if (OpenTaiko.Skin.Characters_Normal_Ptn[this.iCurrentCharacter[i]] != 0) ChangeAnime(i, Anime.Normal, true); + else ChangeAnime(i, Anime.None, true); + + this.b風船連打中[i] = false; + this.b演奏中[i] = false; + + // CharaAction_Balloon_FadeOut[i] = new Animations.FadeOut(TJAPlayer3.Skin.Game_Chara_Balloon_FadeOut); + CharaAction_Balloon_FadeOut[i] = new Animations.FadeOut(OpenTaiko.Skin.Characters_Balloon_FadeOut[this.iCurrentCharacter[i]]); + + var tick = OpenTaiko.Skin.Characters_Balloon_Timer[this.iCurrentCharacter[i]]; + + var balloonBrokePtn = OpenTaiko.Skin.Characters_Balloon_Broke_Ptn[this.iCurrentCharacter[i]]; + var balloonMissPtn = OpenTaiko.Skin.Characters_Balloon_Miss_Ptn[this.iCurrentCharacter[i]]; + + CharaAction_Balloon_FadeOut_StartMs[i] = new int[2]; + + CharaAction_Balloon_FadeOut_StartMs[i][0] = (balloonBrokePtn * tick) - OpenTaiko.Skin.Characters_Balloon_FadeOut[this.iCurrentCharacter[i]]; + CharaAction_Balloon_FadeOut_StartMs[i][1] = (balloonMissPtn * tick) - OpenTaiko.Skin.Characters_Balloon_FadeOut[this.iCurrentCharacter[i]]; + + if (balloonBrokePtn > 1) CharaAction_Balloon_FadeOut_StartMs[i][0] /= balloonBrokePtn - 1; + if (balloonMissPtn > 1) CharaAction_Balloon_FadeOut_StartMs[i][1] /= balloonMissPtn - 1; // - 1はタイマー用 + + if (CharaAction_Balloon_Delay[i] != null) CharaAction_Balloon_Delay[i].CurrentValue = (int)CharaAction_Balloon_Delay[i].EndValue; } - public override void Activate() { - for (int i = 0; i < 5; i++) { + base.Activate(); + } - /* - ctChara_Normal[i] = new CCounter(); - ctChara_Miss[i] = new CCounter(); - ctChara_MissDown[i] = new CCounter(); - ctChara_GoGo[i] = new CCounter(); - ctChara_Clear[i] = new CCounter(); + public override void DeActivate() { + for (int i = 0; i < 5; i++) { + /* + ctChara_Normal[i] = null; + ctChara_Miss[i] = null; + ctChara_MissDown[i] = null; + ctChara_GoGo[i] = null; + ctChara_Clear[i] = null; + this.ctキャラクターアクション_10コンボ[i] = null; + this.ctキャラクターアクション_10コンボMAX[i] = null; + this.ctキャラクターアクション_ゴーゴースタート[i] = null; + this.ctキャラクターアクション_ゴーゴースタートMAX[i] = null; + this.ctキャラクターアクション_ノルマ[i] = null; + this.ctキャラクターアクション_魂MAX[i] = null; + this.ctキャラクターアクション_Return[i] = null; + */ - this.ctキャラクターアクション_10コンボ[i] = new CCounter(); - this.ctキャラクターアクション_10コンボMAX[i] = new CCounter(); - this.ctキャラクターアクション_ゴーゴースタート[i] = new CCounter(); - this.ctキャラクターアクション_ゴーゴースタートMAX[i] = new CCounter(); - this.ctキャラクターアクション_ノルマ[i] = new CCounter(); - this.ctキャラクターアクション_魂MAX[i] = new CCounter(); - this.ctキャラクターアクション_Return[i] = new CCounter(); - */ + //CharaAction_Balloon_Breaking[i] = null; + //CharaAction_Balloon_Broke[i] = null; + //CharaAction_Balloon_Miss[i] = null; + CharaAction_Balloon_Delay[i] = null; - //CharaAction_Balloon_Breaking[i] = new CCounter(); - //CharaAction_Balloon_Broke[i] = new CCounter(); - //CharaAction_Balloon_Miss[i] = new CCounter(); - CharaAction_Balloon_Delay[i] = new CCounter(); - ctKusuIn[i] = new(); - - // Currently used character - int p = OpenTaiko.GetActualPlayer(i); - - this.iCurrentCharacter[i] = Math.Max(0, Math.Min(OpenTaiko.SaveFileInstances[p].data.Character, OpenTaiko.Skin.Characters_Ptn - 1)); - - if (OpenTaiko.Skin.Characters_Normal_Ptn[this.iCurrentCharacter[i]] != 0) ChangeAnime(i, Anime.Normal, true); - else ChangeAnime(i, Anime.None, true); - - this.b風船連打中[i] = false; - this.b演奏中[i] = false; - - // CharaAction_Balloon_FadeOut[i] = new Animations.FadeOut(TJAPlayer3.Skin.Game_Chara_Balloon_FadeOut); - CharaAction_Balloon_FadeOut[i] = new Animations.FadeOut(OpenTaiko.Skin.Characters_Balloon_FadeOut[this.iCurrentCharacter[i]]); - - var tick = OpenTaiko.Skin.Characters_Balloon_Timer[this.iCurrentCharacter[i]]; - - var balloonBrokePtn = OpenTaiko.Skin.Characters_Balloon_Broke_Ptn[this.iCurrentCharacter[i]]; - var balloonMissPtn = OpenTaiko.Skin.Characters_Balloon_Miss_Ptn[this.iCurrentCharacter[i]]; - - CharaAction_Balloon_FadeOut_StartMs[i] = new int[2]; - - CharaAction_Balloon_FadeOut_StartMs[i][0] = (balloonBrokePtn * tick) - OpenTaiko.Skin.Characters_Balloon_FadeOut[this.iCurrentCharacter[i]]; - CharaAction_Balloon_FadeOut_StartMs[i][1] = (balloonMissPtn * tick) - OpenTaiko.Skin.Characters_Balloon_FadeOut[this.iCurrentCharacter[i]]; - - if (balloonBrokePtn > 1) CharaAction_Balloon_FadeOut_StartMs[i][0] /= balloonBrokePtn - 1; - if (balloonMissPtn > 1) CharaAction_Balloon_FadeOut_StartMs[i][1] /= balloonMissPtn - 1; // - 1はタイマー用 - - if (CharaAction_Balloon_Delay[i] != null) CharaAction_Balloon_Delay[i].CurrentValue = (int)CharaAction_Balloon_Delay[i].EndValue; - } - - base.Activate(); + CharaAction_Balloon_FadeOut[i] = null; } - public override void DeActivate() { - for (int i = 0; i < 5; i++) { - /* - ctChara_Normal[i] = null; - ctChara_Miss[i] = null; - ctChara_MissDown[i] = null; - ctChara_GoGo[i] = null; - ctChara_Clear[i] = null; - this.ctキャラクターアクション_10コンボ[i] = null; - this.ctキャラクターアクション_10コンボMAX[i] = null; - this.ctキャラクターアクション_ゴーゴースタート[i] = null; - this.ctキャラクターアクション_ゴーゴースタートMAX[i] = null; - this.ctキャラクターアクション_ノルマ[i] = null; - this.ctキャラクターアクション_魂MAX[i] = null; - this.ctキャラクターアクション_Return[i] = null; - */ + base.DeActivate(); + } - //CharaAction_Balloon_Breaking[i] = null; - //CharaAction_Balloon_Broke[i] = null; - //CharaAction_Balloon_Miss[i] = null; - CharaAction_Balloon_Delay[i] = null; + public override void CreateManagedResource() { + for (int i = 0; i < 5; i++) { + //this.arモーション番号[i] = C変換.ar配列形式のstringをint配列に変換して返す(TJAPlayer3.Skin.Characters_Motion_Normal[this.iCurrentCharacter[i]]); + //this.arMissモーション番号[i] = C変換.ar配列形式のstringをint配列に変換して返す(TJAPlayer3.Skin.Characters_Motion_Miss[this.iCurrentCharacter[i]]); + //this.arMissDownモーション番号[i] = C変換.ar配列形式のstringをint配列に変換して返す(TJAPlayer3.Skin.Characters_Motion_MissDown[this.iCurrentCharacter[i]]); + //this.arゴーゴーモーション番号[i] = C変換.ar配列形式のstringをint配列に変換して返す(TJAPlayer3.Skin.Characters_Motion_GoGo[this.iCurrentCharacter[i]]); + //this.arクリアモーション番号[i] = C変換.ar配列形式のstringをint配列に変換して返す(TJAPlayer3.Skin.Characters_Motion_Clear[this.iCurrentCharacter[i]]); - CharaAction_Balloon_FadeOut[i] = null; - } - - base.DeActivate(); + //if (arモーション番号[i] == null) this.arモーション番号[i] = C変換.ar配列形式のstringをint配列に変換して返す("0,0"); + //if (arMissモーション番号[i] == null) this.arMissモーション番号[i] = C変換.ar配列形式のstringをint配列に変換して返す("0,0"); + //if (arMissDownモーション番号[i] == null) this.arMissDownモーション番号[i] = C変換.ar配列形式のstringをint配列に変換して返す("0,0"); + //if (arゴーゴーモーション番号[i] == null) this.arゴーゴーモーション番号[i] = C変換.ar配列形式のstringをint配列に変換して返す("0,0"); + //if (arクリアモーション番号[i] == null) this.arクリアモーション番号[i] = C変換.ar配列形式のstringをint配列に変換して返す("0,0"); } + base.CreateManagedResource(); + } - public override void CreateManagedResource() { - for (int i = 0; i < 5; i++) { - //this.arモーション番号[i] = C変換.ar配列形式のstringをint配列に変換して返す(TJAPlayer3.Skin.Characters_Motion_Normal[this.iCurrentCharacter[i]]); - //this.arMissモーション番号[i] = C変換.ar配列形式のstringをint配列に変換して返す(TJAPlayer3.Skin.Characters_Motion_Miss[this.iCurrentCharacter[i]]); - //this.arMissDownモーション番号[i] = C変換.ar配列形式のstringをint配列に変換して返す(TJAPlayer3.Skin.Characters_Motion_MissDown[this.iCurrentCharacter[i]]); - //this.arゴーゴーモーション番号[i] = C変換.ar配列形式のstringをint配列に変換して返す(TJAPlayer3.Skin.Characters_Motion_GoGo[this.iCurrentCharacter[i]]); - //this.arクリアモーション番号[i] = C変換.ar配列形式のstringをint配列に変換して返す(TJAPlayer3.Skin.Characters_Motion_Clear[this.iCurrentCharacter[i]]); + public override void ReleaseManagedResource() { + base.ReleaseManagedResource(); + } - //if (arモーション番号[i] == null) this.arモーション番号[i] = C変換.ar配列形式のstringをint配列に変換して返す("0,0"); - //if (arMissモーション番号[i] == null) this.arMissモーション番号[i] = C変換.ar配列形式のstringをint配列に変換して返す("0,0"); - //if (arMissDownモーション番号[i] == null) this.arMissDownモーション番号[i] = C変換.ar配列形式のstringをint配列に変換して返す("0,0"); - //if (arゴーゴーモーション番号[i] == null) this.arゴーゴーモーション番号[i] = C変換.ar配列形式のstringをint配列に変換して返す("0,0"); - //if (arクリアモーション番号[i] == null) this.arクリアモーション番号[i] = C変換.ar配列形式のstringをint配列に変換して返す("0,0"); - } - base.CreateManagedResource(); - } + public override int Draw() { + for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { + int Character = this.iCurrentCharacter[i]; - public override void ReleaseManagedResource() { - base.ReleaseManagedResource(); - } + if (OpenTaiko.Skin.Characters_Ptn == 0) + break; - public override int Draw() { - for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { - int Character = this.iCurrentCharacter[i]; - - if (OpenTaiko.Skin.Characters_Ptn == 0) + // Blinking animation during invincibility frames + if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Tower) { + if (CFloorManagement.isBlinking() == true) break; + } - // Blinking animation during invincibility frames - if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Tower) { - if (CFloorManagement.isBlinking() == true) + CTexture nowChara = null; + + void updateNormal() { + if (!OpenTaiko.stage演奏ドラム画面.bPAUSE) { + nNowCharaCounter[i] += ((Math.Abs((float)OpenTaiko.stage演奏ドラム画面.actPlayInfo.dbBPM[i]) / 60.0f) * (float)OpenTaiko.FPS.DeltaTime) / nCharaBeat[i]; + } + } + void updateBalloon() { + if (!OpenTaiko.stage演奏ドラム画面.bPAUSE) { + nNowCharaCounter[i] += (float)OpenTaiko.FPS.DeltaTime / nCharaBeat[i]; + } + } + + ctKusuIn[i].Tick(); + + bool endAnime = nNowCharaCounter[i] >= 1; + nNowCharaFrame[i] = (int)(nNowCharaCounter[i] * (nCharaFrameCount[i] + 1)); + nNowCharaFrame[i] = Math.Min(nNowCharaFrame[i], nCharaFrameCount[i]); + + if (eNowAnime[i] != Anime.None) { + switch (eNowAnime[i]) { + case Anime.None: { + ReturnDefaultAnime(i, false); + } + break; + case Anime.Normal: { + updateNormal(); + ReturnDefaultAnime(i, false); + nowChara = OpenTaiko.Tx.Characters_Normal[Character][OpenTaiko.Skin.Characters_Motion_Normal[Character][nNowCharaFrame[i]]]; + if (endAnime) { + nNowCharaCounter[i] = 0; + nNowCharaFrame[i] = 0; + } + } + break; + case Anime.Miss: { + updateNormal(); + ReturnDefaultAnime(i, false); + nowChara = OpenTaiko.Tx.Characters_Normal_Missed[Character][OpenTaiko.Skin.Characters_Motion_Miss[Character][nNowCharaFrame[i]]]; + if (endAnime) { + nNowCharaCounter[i] = 0; + nNowCharaFrame[i] = 0; + } + } + break; + case Anime.MissDown: { + updateNormal(); + ReturnDefaultAnime(i, false); + nowChara = OpenTaiko.Tx.Characters_Normal_MissedDown[Character][OpenTaiko.Skin.Characters_Motion_MissDown[Character][nNowCharaFrame[i]]]; + if (endAnime) { + nNowCharaCounter[i] = 0; + nNowCharaFrame[i] = 0; + } + } + break; + case Anime.Cleared: { + updateNormal(); + ReturnDefaultAnime(i, false); + nowChara = OpenTaiko.Tx.Characters_Normal_Cleared[Character][OpenTaiko.Skin.Characters_Motion_Clear[Character][nNowCharaFrame[i]]]; + if (endAnime) { + nNowCharaCounter[i] = 0; + nNowCharaFrame[i] = 0; + } + } + break; + case Anime.Maxed: { + updateNormal(); + ReturnDefaultAnime(i, false); + nowChara = OpenTaiko.Tx.Characters_Normal_Maxed[Character][OpenTaiko.Skin.Characters_Motion_ClearMax[Character][nNowCharaFrame[i]]]; + if (endAnime) { + nNowCharaCounter[i] = 0; + nNowCharaFrame[i] = 0; + } + } + break; + case Anime.MissIn: { + updateNormal(); + if (OpenTaiko.Tx.Characters_MissIn[Character] != null && OpenTaiko.Skin.Characters_MissIn_Ptn[Character] != 0) { + nowChara = OpenTaiko.Tx.Characters_MissIn[Character][OpenTaiko.Skin.Characters_Motion_MissIn[Character][nNowCharaFrame[i]]]; + } + if (endAnime) { + ReturnDefaultAnime(i, true); + } + } + break; + case Anime.MissDownIn: { + updateNormal(); + if (OpenTaiko.Tx.Characters_MissDownIn[Character] != null && OpenTaiko.Skin.Characters_MissDownIn_Ptn[Character] != 0) { + nowChara = OpenTaiko.Tx.Characters_MissDownIn[Character][OpenTaiko.Skin.Characters_Motion_MissDownIn[Character][nNowCharaFrame[i]]]; + } + if (endAnime) { + ReturnDefaultAnime(i, true); + } + } + break; + case Anime.GoGoTime: { + updateNormal(); + ReturnDefaultAnime(i, false); + nowChara = OpenTaiko.Tx.Characters_GoGoTime[Character][OpenTaiko.Skin.Characters_Motion_GoGo[Character][nNowCharaFrame[i]]]; + if (endAnime) { + nNowCharaCounter[i] = 0; + nNowCharaFrame[i] = 0; + } + } + break; + case Anime.GoGoTime_Maxed: { + updateNormal(); + ReturnDefaultAnime(i, false); + nowChara = OpenTaiko.Tx.Characters_GoGoTime_Maxed[Character][OpenTaiko.Skin.Characters_Motion_GoGoMax[Character][nNowCharaFrame[i]]]; + if (endAnime) { + nNowCharaCounter[i] = 0; + nNowCharaFrame[i] = 0; + } + } + break; + case Anime.Combo10: { + updateNormal(); + if (OpenTaiko.Tx.Characters_10Combo[Character] != null && OpenTaiko.Skin.Characters_10Combo_Ptn[Character] != 0) { + nowChara = OpenTaiko.Tx.Characters_10Combo[Character][OpenTaiko.Skin.Characters_Motion_10Combo[Character][nNowCharaFrame[i]]]; + } + if (endAnime) { + ReturnDefaultAnime(i, true); + } + } + break; + case Anime.Combo10_Clear: { + updateNormal(); + if (OpenTaiko.Tx.Characters_10Combo_Clear[Character] != null && OpenTaiko.Skin.Characters_10Combo_Clear_Ptn[Character] != 0) { + nowChara = OpenTaiko.Tx.Characters_10Combo_Clear[Character][OpenTaiko.Skin.Characters_Motion_10Combo_Clear[Character][nNowCharaFrame[i]]]; + } + if (endAnime) { + ReturnDefaultAnime(i, true); + } + } + break; + case Anime.Combo10_Max: { + updateNormal(); + if (OpenTaiko.Tx.Characters_10Combo_Maxed[Character] != null && OpenTaiko.Skin.Characters_10Combo_Maxed_Ptn[Character] != 0) { + nowChara = OpenTaiko.Tx.Characters_10Combo_Maxed[Character][OpenTaiko.Skin.Characters_Motion_10ComboMax[Character][nNowCharaFrame[i]]]; + } + if (endAnime) { + ReturnDefaultAnime(i, true); + } + } + break; + case Anime.GoGoStart: { + updateNormal(); + if (OpenTaiko.Tx.Characters_GoGoStart[Character] != null && OpenTaiko.Skin.Characters_GoGoStart_Ptn[Character] != 0) { + nowChara = OpenTaiko.Tx.Characters_GoGoStart[Character][OpenTaiko.Skin.Characters_Motion_GoGoStart[Character][nNowCharaFrame[i]]]; + } + if (endAnime) { + ReturnDefaultAnime(i, true); + } + } + break; + case Anime.GoGoStart_Clear: { + updateNormal(); + if (OpenTaiko.Tx.Characters_GoGoStart_Clear[Character] != null && OpenTaiko.Skin.Characters_GoGoStart_Clear_Ptn[Character] != 0) { + nowChara = OpenTaiko.Tx.Characters_GoGoStart_Clear[Character][OpenTaiko.Skin.Characters_Motion_GoGoStart_Clear[Character][nNowCharaFrame[i]]]; + } + if (endAnime) { + ReturnDefaultAnime(i, true); + } + } + break; + case Anime.GoGoStart_Max: { + updateNormal(); + if (OpenTaiko.Tx.Characters_GoGoStart_Maxed[Character] != null && OpenTaiko.Skin.Characters_GoGoStart_Maxed_Ptn[Character] != 0) { + nowChara = OpenTaiko.Tx.Characters_GoGoStart_Maxed[Character][OpenTaiko.Skin.Characters_Motion_GoGoStartMax[Character][nNowCharaFrame[i]]]; + } + if (endAnime) { + ReturnDefaultAnime(i, true); + } + } + break; + case Anime.Become_Cleared: { + updateNormal(); + if (OpenTaiko.Tx.Characters_Become_Cleared[Character] != null && OpenTaiko.Skin.Characters_Become_Cleared_Ptn[Character] != 0) { + nowChara = OpenTaiko.Tx.Characters_Become_Cleared[Character][OpenTaiko.Skin.Characters_Motion_ClearIn[Character][nNowCharaFrame[i]]]; + } + if (endAnime) { + ReturnDefaultAnime(i, true); + } + } + break; + case Anime.Become_Maxed: { + updateNormal(); + if (OpenTaiko.Tx.Characters_Become_Maxed[Character] != null && OpenTaiko.Skin.Characters_Become_Maxed_Ptn[Character] != 0) { + nowChara = OpenTaiko.Tx.Characters_Become_Maxed[Character][OpenTaiko.Skin.Characters_Motion_SoulIn[Character][nNowCharaFrame[i]]]; + } + if (endAnime) { + ReturnDefaultAnime(i, true); + } + } + break; + case Anime.SoulOut: { + updateNormal(); + if (OpenTaiko.Tx.Characters_SoulOut[Character] != null && OpenTaiko.Skin.Characters_SoulOut_Ptn[Character] != 0) { + nowChara = OpenTaiko.Tx.Characters_SoulOut[Character][OpenTaiko.Skin.Characters_Motion_SoulOut[Character][nNowCharaFrame[i]]]; + } + if (endAnime) { + ReturnDefaultAnime(i, true); + } + } + break; + case Anime.ClearOut: { + updateNormal(); + if (OpenTaiko.Tx.Characters_ClearOut[Character] != null && OpenTaiko.Skin.Characters_ClearOut_Ptn[Character] != 0) { + nowChara = OpenTaiko.Tx.Characters_ClearOut[Character][OpenTaiko.Skin.Characters_Motion_ClearOut[Character][nNowCharaFrame[i]]]; + } + if (endAnime) { + ReturnDefaultAnime(i, true); + } + } + break; + case Anime.Return: { + updateNormal(); + if (OpenTaiko.Tx.Characters_Return[Character] != null && OpenTaiko.Skin.Characters_Return_Ptn[Character] != 0) { + nowChara = OpenTaiko.Tx.Characters_Return[Character][OpenTaiko.Skin.Characters_Motion_Return[Character][nNowCharaFrame[i]]]; + } + if (endAnime) { + ReturnDefaultAnime(i, true); + } + } + break; + case Anime.Balloon_Breaking: + case Anime.Balloon_Broke: + case Anime.Balloon_Miss: + case Anime.Kusudama_Idle: + case Anime.Kusudama_Breaking: + case Anime.Kusudama_Broke: { + updateBalloon(); + } + break; + case Anime.Kusudama_Miss: { + nNowCharaFrame[i] = (int)(nNowCharaCounter[i] * 2 * (nCharaFrameCount[i] + 1)); + nNowCharaFrame[i] = Math.Min(nNowCharaFrame[i], nCharaFrameCount[i]); + updateBalloon(); + } break; } - - CTexture nowChara = null; - - void updateNormal() { - if (!OpenTaiko.stage演奏ドラム画面.bPAUSE) { - nNowCharaCounter[i] += ((Math.Abs((float)OpenTaiko.stage演奏ドラム画面.actPlayInfo.dbBPM[i]) / 60.0f) * (float)OpenTaiko.FPS.DeltaTime) / nCharaBeat[i]; - } - } - void updateBalloon() { - if (!OpenTaiko.stage演奏ドラム画面.bPAUSE) { - nNowCharaCounter[i] += (float)OpenTaiko.FPS.DeltaTime / nCharaBeat[i]; - } - } - - ctKusuIn[i].Tick(); - - bool endAnime = nNowCharaCounter[i] >= 1; - nNowCharaFrame[i] = (int)(nNowCharaCounter[i] * (nCharaFrameCount[i] + 1)); - nNowCharaFrame[i] = Math.Min(nNowCharaFrame[i], nCharaFrameCount[i]); - - if (eNowAnime[i] != Anime.None) { - switch (eNowAnime[i]) { - case Anime.None: { - ReturnDefaultAnime(i, false); - } - break; - case Anime.Normal: { - updateNormal(); - ReturnDefaultAnime(i, false); - nowChara = OpenTaiko.Tx.Characters_Normal[Character][OpenTaiko.Skin.Characters_Motion_Normal[Character][nNowCharaFrame[i]]]; - if (endAnime) { - nNowCharaCounter[i] = 0; - nNowCharaFrame[i] = 0; - } - } - break; - case Anime.Miss: { - updateNormal(); - ReturnDefaultAnime(i, false); - nowChara = OpenTaiko.Tx.Characters_Normal_Missed[Character][OpenTaiko.Skin.Characters_Motion_Miss[Character][nNowCharaFrame[i]]]; - if (endAnime) { - nNowCharaCounter[i] = 0; - nNowCharaFrame[i] = 0; - } - } - break; - case Anime.MissDown: { - updateNormal(); - ReturnDefaultAnime(i, false); - nowChara = OpenTaiko.Tx.Characters_Normal_MissedDown[Character][OpenTaiko.Skin.Characters_Motion_MissDown[Character][nNowCharaFrame[i]]]; - if (endAnime) { - nNowCharaCounter[i] = 0; - nNowCharaFrame[i] = 0; - } - } - break; - case Anime.Cleared: { - updateNormal(); - ReturnDefaultAnime(i, false); - nowChara = OpenTaiko.Tx.Characters_Normal_Cleared[Character][OpenTaiko.Skin.Characters_Motion_Clear[Character][nNowCharaFrame[i]]]; - if (endAnime) { - nNowCharaCounter[i] = 0; - nNowCharaFrame[i] = 0; - } - } - break; - case Anime.Maxed: { - updateNormal(); - ReturnDefaultAnime(i, false); - nowChara = OpenTaiko.Tx.Characters_Normal_Maxed[Character][OpenTaiko.Skin.Characters_Motion_ClearMax[Character][nNowCharaFrame[i]]]; - if (endAnime) { - nNowCharaCounter[i] = 0; - nNowCharaFrame[i] = 0; - } - } - break; - case Anime.MissIn: { - updateNormal(); - if (OpenTaiko.Tx.Characters_MissIn[Character] != null && OpenTaiko.Skin.Characters_MissIn_Ptn[Character] != 0) { - nowChara = OpenTaiko.Tx.Characters_MissIn[Character][OpenTaiko.Skin.Characters_Motion_MissIn[Character][nNowCharaFrame[i]]]; - } - if (endAnime) { - ReturnDefaultAnime(i, true); - } - } - break; - case Anime.MissDownIn: { - updateNormal(); - if (OpenTaiko.Tx.Characters_MissDownIn[Character] != null && OpenTaiko.Skin.Characters_MissDownIn_Ptn[Character] != 0) { - nowChara = OpenTaiko.Tx.Characters_MissDownIn[Character][OpenTaiko.Skin.Characters_Motion_MissDownIn[Character][nNowCharaFrame[i]]]; - } - if (endAnime) { - ReturnDefaultAnime(i, true); - } - } - break; - case Anime.GoGoTime: { - updateNormal(); - ReturnDefaultAnime(i, false); - nowChara = OpenTaiko.Tx.Characters_GoGoTime[Character][OpenTaiko.Skin.Characters_Motion_GoGo[Character][nNowCharaFrame[i]]]; - if (endAnime) { - nNowCharaCounter[i] = 0; - nNowCharaFrame[i] = 0; - } - } - break; - case Anime.GoGoTime_Maxed: { - updateNormal(); - ReturnDefaultAnime(i, false); - nowChara = OpenTaiko.Tx.Characters_GoGoTime_Maxed[Character][OpenTaiko.Skin.Characters_Motion_GoGoMax[Character][nNowCharaFrame[i]]]; - if (endAnime) { - nNowCharaCounter[i] = 0; - nNowCharaFrame[i] = 0; - } - } - break; - case Anime.Combo10: { - updateNormal(); - if (OpenTaiko.Tx.Characters_10Combo[Character] != null && OpenTaiko.Skin.Characters_10Combo_Ptn[Character] != 0) { - nowChara = OpenTaiko.Tx.Characters_10Combo[Character][OpenTaiko.Skin.Characters_Motion_10Combo[Character][nNowCharaFrame[i]]]; - } - if (endAnime) { - ReturnDefaultAnime(i, true); - } - } - break; - case Anime.Combo10_Clear: { - updateNormal(); - if (OpenTaiko.Tx.Characters_10Combo_Clear[Character] != null && OpenTaiko.Skin.Characters_10Combo_Clear_Ptn[Character] != 0) { - nowChara = OpenTaiko.Tx.Characters_10Combo_Clear[Character][OpenTaiko.Skin.Characters_Motion_10Combo_Clear[Character][nNowCharaFrame[i]]]; - } - if (endAnime) { - ReturnDefaultAnime(i, true); - } - } - break; - case Anime.Combo10_Max: { - updateNormal(); - if (OpenTaiko.Tx.Characters_10Combo_Maxed[Character] != null && OpenTaiko.Skin.Characters_10Combo_Maxed_Ptn[Character] != 0) { - nowChara = OpenTaiko.Tx.Characters_10Combo_Maxed[Character][OpenTaiko.Skin.Characters_Motion_10ComboMax[Character][nNowCharaFrame[i]]]; - } - if (endAnime) { - ReturnDefaultAnime(i, true); - } - } - break; - case Anime.GoGoStart: { - updateNormal(); - if (OpenTaiko.Tx.Characters_GoGoStart[Character] != null && OpenTaiko.Skin.Characters_GoGoStart_Ptn[Character] != 0) { - nowChara = OpenTaiko.Tx.Characters_GoGoStart[Character][OpenTaiko.Skin.Characters_Motion_GoGoStart[Character][nNowCharaFrame[i]]]; - } - if (endAnime) { - ReturnDefaultAnime(i, true); - } - } - break; - case Anime.GoGoStart_Clear: { - updateNormal(); - if (OpenTaiko.Tx.Characters_GoGoStart_Clear[Character] != null && OpenTaiko.Skin.Characters_GoGoStart_Clear_Ptn[Character] != 0) { - nowChara = OpenTaiko.Tx.Characters_GoGoStart_Clear[Character][OpenTaiko.Skin.Characters_Motion_GoGoStart_Clear[Character][nNowCharaFrame[i]]]; - } - if (endAnime) { - ReturnDefaultAnime(i, true); - } - } - break; - case Anime.GoGoStart_Max: { - updateNormal(); - if (OpenTaiko.Tx.Characters_GoGoStart_Maxed[Character] != null && OpenTaiko.Skin.Characters_GoGoStart_Maxed_Ptn[Character] != 0) { - nowChara = OpenTaiko.Tx.Characters_GoGoStart_Maxed[Character][OpenTaiko.Skin.Characters_Motion_GoGoStartMax[Character][nNowCharaFrame[i]]]; - } - if (endAnime) { - ReturnDefaultAnime(i, true); - } - } - break; - case Anime.Become_Cleared: { - updateNormal(); - if (OpenTaiko.Tx.Characters_Become_Cleared[Character] != null && OpenTaiko.Skin.Characters_Become_Cleared_Ptn[Character] != 0) { - nowChara = OpenTaiko.Tx.Characters_Become_Cleared[Character][OpenTaiko.Skin.Characters_Motion_ClearIn[Character][nNowCharaFrame[i]]]; - } - if (endAnime) { - ReturnDefaultAnime(i, true); - } - } - break; - case Anime.Become_Maxed: { - updateNormal(); - if (OpenTaiko.Tx.Characters_Become_Maxed[Character] != null && OpenTaiko.Skin.Characters_Become_Maxed_Ptn[Character] != 0) { - nowChara = OpenTaiko.Tx.Characters_Become_Maxed[Character][OpenTaiko.Skin.Characters_Motion_SoulIn[Character][nNowCharaFrame[i]]]; - } - if (endAnime) { - ReturnDefaultAnime(i, true); - } - } - break; - case Anime.SoulOut: { - updateNormal(); - if (OpenTaiko.Tx.Characters_SoulOut[Character] != null && OpenTaiko.Skin.Characters_SoulOut_Ptn[Character] != 0) { - nowChara = OpenTaiko.Tx.Characters_SoulOut[Character][OpenTaiko.Skin.Characters_Motion_SoulOut[Character][nNowCharaFrame[i]]]; - } - if (endAnime) { - ReturnDefaultAnime(i, true); - } - } - break; - case Anime.ClearOut: { - updateNormal(); - if (OpenTaiko.Tx.Characters_ClearOut[Character] != null && OpenTaiko.Skin.Characters_ClearOut_Ptn[Character] != 0) { - nowChara = OpenTaiko.Tx.Characters_ClearOut[Character][OpenTaiko.Skin.Characters_Motion_ClearOut[Character][nNowCharaFrame[i]]]; - } - if (endAnime) { - ReturnDefaultAnime(i, true); - } - } - break; - case Anime.Return: { - updateNormal(); - if (OpenTaiko.Tx.Characters_Return[Character] != null && OpenTaiko.Skin.Characters_Return_Ptn[Character] != 0) { - nowChara = OpenTaiko.Tx.Characters_Return[Character][OpenTaiko.Skin.Characters_Motion_Return[Character][nNowCharaFrame[i]]]; - } - if (endAnime) { - ReturnDefaultAnime(i, true); - } - } - break; - case Anime.Balloon_Breaking: - case Anime.Balloon_Broke: - case Anime.Balloon_Miss: - case Anime.Kusudama_Idle: - case Anime.Kusudama_Breaking: - case Anime.Kusudama_Broke: { - updateBalloon(); - } - break; - case Anime.Kusudama_Miss: { - nNowCharaFrame[i] = (int)(nNowCharaCounter[i] * 2 * (nCharaFrameCount[i] + 1)); - nNowCharaFrame[i] = Math.Min(nNowCharaFrame[i], nCharaFrameCount[i]); - updateBalloon(); - } - break; - } - } - - float chara_x; - float chara_y; - - float charaScale = 1.0f; - - if (nowChara != null) { - bool flipX = OpenTaiko.ConfigIni.bAIBattleMode ? (i == 1) : false; - - float resolutionScaleX = OpenTaiko.Skin.Resolution[0] / (float)OpenTaiko.Skin.Characters_Resolution[Character][0]; - float resolutionScaleY = OpenTaiko.Skin.Resolution[1] / (float)OpenTaiko.Skin.Characters_Resolution[Character][1]; - - if (OpenTaiko.ConfigIni.bAIBattleMode) { - chara_x = (OpenTaiko.Skin.Characters_X_AI[Character][i] * resolutionScaleX); - chara_y = (OpenTaiko.Skin.Characters_Y_AI[Character][i] * resolutionScaleY); - - if (nowChara != null) { - charaScale = 0.58f; - } - } else if (OpenTaiko.ConfigIni.nPlayerCount <= 2) { - chara_x = (OpenTaiko.Skin.Characters_X[Character][i] * resolutionScaleX); - chara_y = (OpenTaiko.Skin.Characters_Y[Character][i] * resolutionScaleY); - - if (nowChara != null) { - charaScale = 1.0f; - } - } else if (OpenTaiko.ConfigIni.nPlayerCount == 5) { - chara_x = (OpenTaiko.Skin.Characters_5P[Character][0] * resolutionScaleX) + (OpenTaiko.Skin.Game_UIMove_5P[0] * i); - chara_y = (OpenTaiko.Skin.Characters_5P[Character][1] * resolutionScaleY) + (OpenTaiko.Skin.Game_UIMove_5P[1] * i); - - if (nowChara != null) { - charaScale = 0.58f; - } - } else { - chara_x = (OpenTaiko.Skin.Characters_4P[Character][0] * resolutionScaleX) + (OpenTaiko.Skin.Game_UIMove_4P[0] * i); - chara_y = (OpenTaiko.Skin.Characters_4P[Character][1] * resolutionScaleY) + (OpenTaiko.Skin.Game_UIMove_4P[1] * i); - - if (nowChara != null) { - charaScale = 0.58f; - } - } - - charaScale *= resolutionScaleY; - //chara_x *= resolutionScaleX; - //chara_y *= resolutionScaleY; - - if (OpenTaiko.ConfigIni.bAIBattleMode) { - chara_x += OpenTaiko.Skin.Game_AIBattle_CharaMove * OpenTaiko.stage演奏ドラム画面.AIBattleState; - chara_y -= nowChara.szTextureSize.Height * charaScale; // Center down - } - - nowChara.vcScaleRatio.X = charaScale; - nowChara.vcScaleRatio.Y = charaScale; - - if (flipX) { - nowChara.t2D左右反転描画(chara_x, chara_y); - } else { - nowChara.t2D描画(chara_x, chara_y); - } - - nowChara.vcScaleRatio.X = 1.0f; - nowChara.vcScaleRatio.Y = 1.0f; - } - - if ((this.b風船連打中[i] != true && CharaAction_Balloon_Delay[i].IsEnded) || OpenTaiko.ConfigIni.nPlayerCount > 2) { - if (OpenTaiko.ConfigIni.nPlayerCount <= 2) { - OpenTaiko.stage演奏ドラム画面.PuchiChara.On進行描画(OpenTaiko.Skin.Game_PuchiChara_X[i], OpenTaiko.Skin.Game_PuchiChara_Y[i], OpenTaiko.stage演奏ドラム画面.bIsAlreadyMaxed[i], player: i); - } else if (OpenTaiko.ConfigIni.nPlayerCount == 5) { - OpenTaiko.stage演奏ドラム画面.PuchiChara.On進行描画(OpenTaiko.Skin.Game_PuchiChara_5P[0] + (OpenTaiko.Skin.Game_UIMove_5P[0] * i), OpenTaiko.Skin.Game_PuchiChara_5P[1] + (OpenTaiko.Skin.Game_UIMove_5P[1] * i), OpenTaiko.stage演奏ドラム画面.bIsAlreadyMaxed[i], player: i, scale: 0.5f); - } else { - OpenTaiko.stage演奏ドラム画面.PuchiChara.On進行描画(OpenTaiko.Skin.Game_PuchiChara_4P[0] + (OpenTaiko.Skin.Game_UIMove_4P[0] * i), OpenTaiko.Skin.Game_PuchiChara_4P[1] + (OpenTaiko.Skin.Game_UIMove_4P[1] * i), OpenTaiko.stage演奏ドラム画面.bIsAlreadyMaxed[i], player: i, scale: 0.5f); - } - } } - return base.Draw(); - } - public void OnDraw_Balloon() { - for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { - //if (TJAPlayer3.Skin.Characters_Balloon_Breaking_Ptn[iCurrentCharacter[i]] != 0) CharaAction_Balloon_Breaking[i]?.t進行(); - //if (TJAPlayer3.Skin.Characters_Balloon_Broke_Ptn[iCurrentCharacter[i]] != 0) CharaAction_Balloon_Broke[i]?.t進行(); - CharaAction_Balloon_Delay[i]?.Tick(); - //if (TJAPlayer3.Skin.Characters_Balloon_Miss_Ptn[iCurrentCharacter[i]] != 0) CharaAction_Balloon_Miss[i]?.t進行(); - //CharaAction_Balloon_FadeOut[i].Tick(); + float chara_x; + float chara_y; - { - bool endAnime = nNowCharaCounter[i] >= 1; - var nowOpacity = 255; + float charaScale = 1.0f; - float resolutionScaleX = OpenTaiko.Skin.Resolution[0] / (float)OpenTaiko.Skin.Characters_Resolution[this.iCurrentCharacter[i]][0]; - float resolutionScaleY = OpenTaiko.Skin.Resolution[1] / (float)OpenTaiko.Skin.Characters_Resolution[this.iCurrentCharacter[i]][1]; + if (nowChara != null) { + bool flipX = OpenTaiko.ConfigIni.bAIBattleMode ? (i == 1) : false; - float chara_x = 0; - float chara_y = 0; - float kusu_chara_x = OpenTaiko.Skin.Characters_Kusudama_X[this.iCurrentCharacter[i]][i] * resolutionScaleX; - float kusu_chara_y = OpenTaiko.Skin.Characters_Kusudama_Y[this.iCurrentCharacter[i]][i] * resolutionScaleY; + float resolutionScaleX = OpenTaiko.Skin.Resolution[0] / (float)OpenTaiko.Skin.Characters_Resolution[Character][0]; + float resolutionScaleY = OpenTaiko.Skin.Resolution[1] / (float)OpenTaiko.Skin.Characters_Resolution[Character][1]; - if (OpenTaiko.ConfigIni.nPlayerCount <= 2) { - chara_x = OpenTaiko.Skin.Characters_Balloon_X[this.iCurrentCharacter[i]][i]; - chara_y = OpenTaiko.Skin.Characters_Balloon_Y[this.iCurrentCharacter[i]][i]; - } else { - if (OpenTaiko.ConfigIni.nPlayerCount == 5) { - chara_x = OpenTaiko.Skin.Characters_Balloon_5P[this.iCurrentCharacter[i]][0] + (OpenTaiko.Skin.Game_UIMove_5P[0] * i); - chara_y = OpenTaiko.Skin.Characters_Balloon_5P[this.iCurrentCharacter[i]][1] + (OpenTaiko.Skin.Game_UIMove_5P[1] * i); - } else { - chara_x = OpenTaiko.Skin.Characters_Balloon_4P[this.iCurrentCharacter[i]][0] + (OpenTaiko.Skin.Game_UIMove_4P[0] * i); - chara_y = OpenTaiko.Skin.Characters_Balloon_4P[this.iCurrentCharacter[i]][1] + (OpenTaiko.Skin.Game_UIMove_4P[1] * i); - } + if (OpenTaiko.ConfigIni.bAIBattleMode) { + chara_x = (OpenTaiko.Skin.Characters_X_AI[Character][i] * resolutionScaleX); + chara_y = (OpenTaiko.Skin.Characters_Y_AI[Character][i] * resolutionScaleY); + + if (nowChara != null) { + charaScale = 0.58f; } + } else if (OpenTaiko.ConfigIni.nPlayerCount <= 2) { + chara_x = (OpenTaiko.Skin.Characters_X[Character][i] * resolutionScaleX); + chara_y = (OpenTaiko.Skin.Characters_Y[Character][i] * resolutionScaleY); - chara_x *= resolutionScaleX; - chara_y *= resolutionScaleY; - - float charaScale = resolutionScaleY; - - - if (eNowAnime[i] == Anime.Balloon_Broke) { - if (CharaAction_Balloon_FadeOut[i].Counter.IsStoped && nNowCharaFrame[i] > CharaAction_Balloon_FadeOut_StartMs[i][0]) { - CharaAction_Balloon_FadeOut[i].Start(); - } - - if (OpenTaiko.Skin.Characters_Balloon_Broke_Ptn[this.iCurrentCharacter[i]] != 0 && OpenTaiko.Tx.Characters_Balloon_Broke[this.iCurrentCharacter[i]][nNowCharaFrame[i]] != null) { - OpenTaiko.Tx.Characters_Balloon_Broke[this.iCurrentCharacter[i]][nNowCharaFrame[i]].Opacity = nowOpacity; - OpenTaiko.Tx.Characters_Balloon_Broke[this.iCurrentCharacter[i]][nNowCharaFrame[i]].vcScaleRatio.X = charaScale; - OpenTaiko.Tx.Characters_Balloon_Broke[this.iCurrentCharacter[i]][nNowCharaFrame[i]].vcScaleRatio.Y = charaScale; - OpenTaiko.Tx.Characters_Balloon_Broke[this.iCurrentCharacter[i]][nNowCharaFrame[i]].t2D描画( - OpenTaiko.stage演奏ドラム画面.GetJPOSCROLLX(i) + chara_x, - OpenTaiko.stage演奏ドラム画面.GetJPOSCROLLY(i) + chara_y); - } - - if (OpenTaiko.ConfigIni.nPlayerCount <= 2) - OpenTaiko.stage演奏ドラム画面.PuchiChara.On進行描画( - OpenTaiko.stage演奏ドラム画面.GetJPOSCROLLX(i) + OpenTaiko.Skin.Game_PuchiChara_BalloonX[i], - OpenTaiko.stage演奏ドラム画面.GetJPOSCROLLY(i) + OpenTaiko.Skin.Game_PuchiChara_BalloonY[i], false, nowOpacity, true, player: i); - - if (endAnime) { - ReturnDefaultAnime(i, true); - } - } else if (eNowAnime[i] == Anime.Balloon_Miss) { - if (CharaAction_Balloon_FadeOut[i].Counter.IsStoped && nNowCharaFrame[i] > CharaAction_Balloon_FadeOut_StartMs[i][1]) { - CharaAction_Balloon_FadeOut[i].Start(); - } - - if (OpenTaiko.Skin.Characters_Balloon_Miss_Ptn[this.iCurrentCharacter[i]] != 0 && OpenTaiko.Tx.Characters_Balloon_Miss[this.iCurrentCharacter[i]][nNowCharaFrame[i]] != null) { - OpenTaiko.Tx.Characters_Balloon_Miss[this.iCurrentCharacter[i]][nNowCharaFrame[i]].Opacity = nowOpacity; - OpenTaiko.Tx.Characters_Balloon_Miss[this.iCurrentCharacter[i]][nNowCharaFrame[i]].vcScaleRatio.X = charaScale; - OpenTaiko.Tx.Characters_Balloon_Miss[this.iCurrentCharacter[i]][nNowCharaFrame[i]].vcScaleRatio.Y = charaScale; - OpenTaiko.Tx.Characters_Balloon_Miss[this.iCurrentCharacter[i]][nNowCharaFrame[i]].t2D描画( - OpenTaiko.stage演奏ドラム画面.GetJPOSCROLLX(i) + chara_x, - OpenTaiko.stage演奏ドラム画面.GetJPOSCROLLY(i) + chara_y); - } - - if (OpenTaiko.ConfigIni.nPlayerCount <= 2) - OpenTaiko.stage演奏ドラム画面.PuchiChara.On進行描画( - OpenTaiko.stage演奏ドラム画面.GetJPOSCROLLX(i) + OpenTaiko.Skin.Game_PuchiChara_BalloonX[i], - OpenTaiko.stage演奏ドラム画面.GetJPOSCROLLY(i) + OpenTaiko.Skin.Game_PuchiChara_BalloonY[i], false, nowOpacity, true, player: i); - - if (endAnime) { - ReturnDefaultAnime(i, true); - } - } else if (eNowAnime[i] == Anime.Balloon_Breaking) { - if (OpenTaiko.Skin.Characters_Balloon_Breaking_Ptn[this.iCurrentCharacter[i]] != 0 && OpenTaiko.Tx.Characters_Balloon_Breaking[this.iCurrentCharacter[i]][nNowCharaFrame[i]] != null) { - OpenTaiko.Tx.Characters_Balloon_Breaking[this.iCurrentCharacter[i]][nNowCharaFrame[i]].vcScaleRatio.X = charaScale; - OpenTaiko.Tx.Characters_Balloon_Breaking[this.iCurrentCharacter[i]][nNowCharaFrame[i]].vcScaleRatio.Y = charaScale; - OpenTaiko.Tx.Characters_Balloon_Breaking[this.iCurrentCharacter[i]][nNowCharaFrame[i]].t2D描画( - OpenTaiko.stage演奏ドラム画面.GetJPOSCROLLX(i) + chara_x, - OpenTaiko.stage演奏ドラム画面.GetJPOSCROLLY(i) + chara_y); - } - - if (OpenTaiko.ConfigIni.nPlayerCount <= 2) - OpenTaiko.stage演奏ドラム画面.PuchiChara.On進行描画( - OpenTaiko.stage演奏ドラム画面.GetJPOSCROLLX(i) + OpenTaiko.Skin.Game_PuchiChara_BalloonX[i], - OpenTaiko.stage演奏ドラム画面.GetJPOSCROLLY(i) + OpenTaiko.Skin.Game_PuchiChara_BalloonY[i], false, 255, true, player: i); - } else if (eNowAnime[i] == Anime.Kusudama_Broke) { - if (CharaAction_Balloon_FadeOut[i].Counter.IsStoped && nNowCharaFrame[i] > CharaAction_Balloon_FadeOut_StartMs[i][0]) { - CharaAction_Balloon_FadeOut[i].Start(); - } - float kusuOutX = ((1.0f - MathF.Cos(nNowCharaCounter[i] * MathF.PI)) * OpenTaiko.Skin.Resolution[0] / 2.0f) * resolutionScaleX; - float kusuOutY = (MathF.Sin(nNowCharaCounter[i] * MathF.PI / 2) * OpenTaiko.Skin.Resolution[1] / 2.0f) * resolutionScaleY; - - if (OpenTaiko.Skin.Characters_Kusudama_Broke_Ptn[this.iCurrentCharacter[i]] != 0 && OpenTaiko.Tx.Characters_Kusudama_Broke[this.iCurrentCharacter[i]][nNowCharaFrame[i]] != null) { - OpenTaiko.Tx.Characters_Kusudama_Broke[this.iCurrentCharacter[i]][nNowCharaFrame[i]].Opacity = nowOpacity; - OpenTaiko.Tx.Characters_Kusudama_Broke[this.iCurrentCharacter[i]][nNowCharaFrame[i]].vcScaleRatio.X = charaScale; - OpenTaiko.Tx.Characters_Kusudama_Broke[this.iCurrentCharacter[i]][nNowCharaFrame[i]].vcScaleRatio.Y = charaScale; - if (i % 2 == 0) { - OpenTaiko.Tx.Characters_Kusudama_Broke[this.iCurrentCharacter[i]][nNowCharaFrame[i]].t2D描画(kusu_chara_x - kusuOutX, kusu_chara_y - kusuOutY); - } else { - OpenTaiko.Tx.Characters_Kusudama_Broke[this.iCurrentCharacter[i]][nNowCharaFrame[i]].t2D左右反転描画(kusu_chara_x + kusuOutX, kusu_chara_y - kusuOutY); - } - } - if (i % 2 == 0) { - OpenTaiko.stage演奏ドラム画面.PuchiChara.On進行描画( - OpenTaiko.Skin.Game_PuchiChara_KusudamaX[i] - (int)kusuOutX, - OpenTaiko.Skin.Game_PuchiChara_KusudamaY[i] - (int)kusuOutY, false, nowOpacity, true, player: i); - } else { - OpenTaiko.stage演奏ドラム画面.PuchiChara.On進行描画( - OpenTaiko.Skin.Game_PuchiChara_KusudamaX[i] + (int)kusuOutX, - OpenTaiko.Skin.Game_PuchiChara_KusudamaY[i] - (int)kusuOutY, false, nowOpacity, true, player: i); - } - - if (endAnime) { - ReturnDefaultAnime(i, true); - } - } else if (eNowAnime[i] == Anime.Kusudama_Miss) { - if (CharaAction_Balloon_FadeOut[i].Counter.IsStoped && nNowCharaFrame[i] > CharaAction_Balloon_FadeOut_StartMs[i][1]) { - CharaAction_Balloon_FadeOut[i].Start(); - } - - float kusuOutY = (Math.Max(nNowCharaCounter[i] - 0.5f, 0) * OpenTaiko.Skin.Resolution[1] * 2) * resolutionScaleY; - - if (OpenTaiko.Skin.Characters_Kusudama_Miss_Ptn[this.iCurrentCharacter[i]] != 0 && OpenTaiko.Tx.Characters_Kusudama_Miss[this.iCurrentCharacter[i]][nNowCharaFrame[i]] != null) { - OpenTaiko.Tx.Characters_Kusudama_Miss[this.iCurrentCharacter[i]][nNowCharaFrame[i]].Opacity = nowOpacity; - OpenTaiko.Tx.Characters_Kusudama_Miss[this.iCurrentCharacter[i]][nNowCharaFrame[i]].vcScaleRatio.X = charaScale; - OpenTaiko.Tx.Characters_Kusudama_Miss[this.iCurrentCharacter[i]][nNowCharaFrame[i]].vcScaleRatio.Y = charaScale; - - - if (i % 2 == 0) { - OpenTaiko.Tx.Characters_Kusudama_Miss[this.iCurrentCharacter[i]][nNowCharaFrame[i]].t2D描画(kusu_chara_x, kusu_chara_y + kusuOutY); - } else { - OpenTaiko.Tx.Characters_Kusudama_Miss[this.iCurrentCharacter[i]][nNowCharaFrame[i]].t2D左右反転描画(kusu_chara_x, kusu_chara_y + kusuOutY); - } - } - - OpenTaiko.stage演奏ドラム画面.PuchiChara.On進行描画( - OpenTaiko.Skin.Game_PuchiChara_KusudamaX[i], - OpenTaiko.Skin.Game_PuchiChara_KusudamaY[i] + (int)kusuOutY, false, nowOpacity, true, player: i); - - if (endAnime) { - ReturnDefaultAnime(i, true); - } - } else if (eNowAnime[i] == Anime.Kusudama_Breaking) { - float kusuInX = ((1.0f - MathF.Sin(ctKusuIn[i].CurrentValue / 2000.0f * MathF.PI)) * OpenTaiko.Skin.Resolution[0] / 2.0f) * resolutionScaleX; - float kusuInY = -((MathF.Cos(ctKusuIn[i].CurrentValue / 1000.0f * MathF.PI / 2)) * OpenTaiko.Skin.Resolution[1] / 2.0f) * resolutionScaleY; - - - if (OpenTaiko.Skin.Characters_Kusudama_Breaking_Ptn[this.iCurrentCharacter[i]] != 0 && OpenTaiko.Tx.Characters_Kusudama_Breaking[this.iCurrentCharacter[i]][nNowCharaFrame[i]] != null) { - OpenTaiko.Tx.Characters_Kusudama_Breaking[this.iCurrentCharacter[i]][nNowCharaFrame[i]].vcScaleRatio.X = charaScale; - OpenTaiko.Tx.Characters_Kusudama_Breaking[this.iCurrentCharacter[i]][nNowCharaFrame[i]].vcScaleRatio.Y = charaScale; - if (i % 2 == 0) { - OpenTaiko.Tx.Characters_Kusudama_Breaking[this.iCurrentCharacter[i]][nNowCharaFrame[i]].t2D描画(kusu_chara_x - kusuInX, kusu_chara_y + kusuInY); - } else { - OpenTaiko.Tx.Characters_Kusudama_Breaking[this.iCurrentCharacter[i]][nNowCharaFrame[i]].t2D左右反転描画(kusu_chara_x + kusuInX, kusu_chara_y + kusuInY); - } - } - - if (i % 2 == 0) { - OpenTaiko.stage演奏ドラム画面.PuchiChara.On進行描画( - OpenTaiko.Skin.Game_PuchiChara_KusudamaX[i] - (int)kusuInX, - OpenTaiko.Skin.Game_PuchiChara_KusudamaY[i] + (int)kusuInY, false, 255, true, player: i); - } else { - OpenTaiko.stage演奏ドラム画面.PuchiChara.On進行描画( - OpenTaiko.Skin.Game_PuchiChara_KusudamaX[i] + (int)kusuInX, - OpenTaiko.Skin.Game_PuchiChara_KusudamaY[i] + (int)kusuInY, false, 255, true, player: i); - } - - if (endAnime) { - ChangeAnime(i, Anime.Kusudama_Idle, true); - } - } else if (eNowAnime[i] == Anime.Kusudama_Idle) { - float kusuInX = ((1.0f - MathF.Sin(ctKusuIn[i].CurrentValue / 2000.0f * MathF.PI)) * OpenTaiko.Skin.Resolution[0] / 2.0f) * resolutionScaleX; - float kusuInY = -((MathF.Cos(ctKusuIn[i].CurrentValue / 1000.0f * MathF.PI / 2)) * OpenTaiko.Skin.Resolution[1] / 2.0f) * resolutionScaleY; - - if (OpenTaiko.Skin.Characters_Kusudama_Idle_Ptn[this.iCurrentCharacter[i]] != 0 && OpenTaiko.Tx.Characters_Kusudama_Idle[this.iCurrentCharacter[i]][nNowCharaFrame[i]] != null) { - OpenTaiko.Tx.Characters_Kusudama_Idle[this.iCurrentCharacter[i]][nNowCharaFrame[i]].vcScaleRatio.X = charaScale; - OpenTaiko.Tx.Characters_Kusudama_Idle[this.iCurrentCharacter[i]][nNowCharaFrame[i]].vcScaleRatio.Y = charaScale; - if (i % 2 == 0) { - OpenTaiko.Tx.Characters_Kusudama_Idle[this.iCurrentCharacter[i]][nNowCharaFrame[i]].t2D描画(kusu_chara_x - kusuInX, kusu_chara_y + kusuInY); - } else { - OpenTaiko.Tx.Characters_Kusudama_Idle[this.iCurrentCharacter[i]][nNowCharaFrame[i]].t2D左右反転描画(kusu_chara_x + kusuInX, kusu_chara_y + kusuInY); - } - } - - if (i % 2 == 0) { - OpenTaiko.stage演奏ドラム画面.PuchiChara.On進行描画( - OpenTaiko.Skin.Game_PuchiChara_KusudamaX[i] - (int)kusuInX, - OpenTaiko.Skin.Game_PuchiChara_KusudamaY[i] + (int)kusuInY, false, 255, true, player: i); - } else { - OpenTaiko.stage演奏ドラム画面.PuchiChara.On進行描画( - OpenTaiko.Skin.Game_PuchiChara_KusudamaX[i] + (int)kusuInX, - OpenTaiko.Skin.Game_PuchiChara_KusudamaY[i] + (int)kusuInY, false, 255, true, player: i); - } - - if (endAnime) { - ChangeAnime(i, Anime.Kusudama_Idle, true); - } + if (nowChara != null) { + charaScale = 1.0f; } - } - } - } + } else if (OpenTaiko.ConfigIni.nPlayerCount == 5) { + chara_x = (OpenTaiko.Skin.Characters_5P[Character][0] * resolutionScaleX) + (OpenTaiko.Skin.Game_UIMove_5P[0] * i); + chara_y = (OpenTaiko.Skin.Characters_5P[Character][1] * resolutionScaleY) + (OpenTaiko.Skin.Game_UIMove_5P[1] * i); - - public void ReturnDefaultAnime(int player, bool resetCounter) { - if (OpenTaiko.stage演奏ドラム画面.bIsGOGOTIME[player] && OpenTaiko.Skin.Characters_GoGoTime_Ptn[this.iCurrentCharacter[player]] != 0) { - if (OpenTaiko.stage演奏ドラム画面.bIsAlreadyMaxed[player] && OpenTaiko.Skin.Characters_GoGoTime_Maxed_Ptn[this.iCurrentCharacter[player]] != 0) { - ChangeAnime(player, Anime.GoGoTime_Maxed, resetCounter); + if (nowChara != null) { + charaScale = 0.58f; + } } else { - ChangeAnime(player, Anime.GoGoTime, resetCounter); + chara_x = (OpenTaiko.Skin.Characters_4P[Character][0] * resolutionScaleX) + (OpenTaiko.Skin.Game_UIMove_4P[0] * i); + chara_y = (OpenTaiko.Skin.Characters_4P[Character][1] * resolutionScaleY) + (OpenTaiko.Skin.Game_UIMove_4P[1] * i); + + if (nowChara != null) { + charaScale = 0.58f; + } + } + + charaScale *= resolutionScaleY; + //chara_x *= resolutionScaleX; + //chara_y *= resolutionScaleY; + + if (OpenTaiko.ConfigIni.bAIBattleMode) { + chara_x += OpenTaiko.Skin.Game_AIBattle_CharaMove * OpenTaiko.stage演奏ドラム画面.AIBattleState; + chara_y -= nowChara.szTextureSize.Height * charaScale; // Center down + } + + nowChara.vcScaleRatio.X = charaScale; + nowChara.vcScaleRatio.Y = charaScale; + + if (flipX) { + nowChara.t2D左右反転描画(chara_x, chara_y); + } else { + nowChara.t2D描画(chara_x, chara_y); + } + + nowChara.vcScaleRatio.X = 1.0f; + nowChara.vcScaleRatio.Y = 1.0f; + } + + if ((this.b風船連打中[i] != true && CharaAction_Balloon_Delay[i].IsEnded) || OpenTaiko.ConfigIni.nPlayerCount > 2) { + if (OpenTaiko.ConfigIni.nPlayerCount <= 2) { + OpenTaiko.stage演奏ドラム画面.PuchiChara.On進行描画(OpenTaiko.Skin.Game_PuchiChara_X[i], OpenTaiko.Skin.Game_PuchiChara_Y[i], OpenTaiko.stage演奏ドラム画面.bIsAlreadyMaxed[i], player: i); + } else if (OpenTaiko.ConfigIni.nPlayerCount == 5) { + OpenTaiko.stage演奏ドラム画面.PuchiChara.On進行描画(OpenTaiko.Skin.Game_PuchiChara_5P[0] + (OpenTaiko.Skin.Game_UIMove_5P[0] * i), OpenTaiko.Skin.Game_PuchiChara_5P[1] + (OpenTaiko.Skin.Game_UIMove_5P[1] * i), OpenTaiko.stage演奏ドラム画面.bIsAlreadyMaxed[i], player: i, scale: 0.5f); + } else { + OpenTaiko.stage演奏ドラム画面.PuchiChara.On進行描画(OpenTaiko.Skin.Game_PuchiChara_4P[0] + (OpenTaiko.Skin.Game_UIMove_4P[0] * i), OpenTaiko.Skin.Game_PuchiChara_4P[1] + (OpenTaiko.Skin.Game_UIMove_4P[1] * i), OpenTaiko.stage演奏ドラム画面.bIsAlreadyMaxed[i], player: i, scale: 0.5f); + } + } + } + return base.Draw(); + } + + public void OnDraw_Balloon() { + for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { + //if (TJAPlayer3.Skin.Characters_Balloon_Breaking_Ptn[iCurrentCharacter[i]] != 0) CharaAction_Balloon_Breaking[i]?.t進行(); + //if (TJAPlayer3.Skin.Characters_Balloon_Broke_Ptn[iCurrentCharacter[i]] != 0) CharaAction_Balloon_Broke[i]?.t進行(); + CharaAction_Balloon_Delay[i]?.Tick(); + //if (TJAPlayer3.Skin.Characters_Balloon_Miss_Ptn[iCurrentCharacter[i]] != 0) CharaAction_Balloon_Miss[i]?.t進行(); + //CharaAction_Balloon_FadeOut[i].Tick(); + + { + bool endAnime = nNowCharaCounter[i] >= 1; + var nowOpacity = 255; + + float resolutionScaleX = OpenTaiko.Skin.Resolution[0] / (float)OpenTaiko.Skin.Characters_Resolution[this.iCurrentCharacter[i]][0]; + float resolutionScaleY = OpenTaiko.Skin.Resolution[1] / (float)OpenTaiko.Skin.Characters_Resolution[this.iCurrentCharacter[i]][1]; + + float chara_x = 0; + float chara_y = 0; + float kusu_chara_x = OpenTaiko.Skin.Characters_Kusudama_X[this.iCurrentCharacter[i]][i] * resolutionScaleX; + float kusu_chara_y = OpenTaiko.Skin.Characters_Kusudama_Y[this.iCurrentCharacter[i]][i] * resolutionScaleY; + + if (OpenTaiko.ConfigIni.nPlayerCount <= 2) { + chara_x = OpenTaiko.Skin.Characters_Balloon_X[this.iCurrentCharacter[i]][i]; + chara_y = OpenTaiko.Skin.Characters_Balloon_Y[this.iCurrentCharacter[i]][i]; + } else { + if (OpenTaiko.ConfigIni.nPlayerCount == 5) { + chara_x = OpenTaiko.Skin.Characters_Balloon_5P[this.iCurrentCharacter[i]][0] + (OpenTaiko.Skin.Game_UIMove_5P[0] * i); + chara_y = OpenTaiko.Skin.Characters_Balloon_5P[this.iCurrentCharacter[i]][1] + (OpenTaiko.Skin.Game_UIMove_5P[1] * i); + } else { + chara_x = OpenTaiko.Skin.Characters_Balloon_4P[this.iCurrentCharacter[i]][0] + (OpenTaiko.Skin.Game_UIMove_4P[0] * i); + chara_y = OpenTaiko.Skin.Characters_Balloon_4P[this.iCurrentCharacter[i]][1] + (OpenTaiko.Skin.Game_UIMove_4P[1] * i); + } + } + + chara_x *= resolutionScaleX; + chara_y *= resolutionScaleY; + + float charaScale = resolutionScaleY; + + + if (eNowAnime[i] == Anime.Balloon_Broke) { + if (CharaAction_Balloon_FadeOut[i].Counter.IsStoped && nNowCharaFrame[i] > CharaAction_Balloon_FadeOut_StartMs[i][0]) { + CharaAction_Balloon_FadeOut[i].Start(); + } + + if (OpenTaiko.Skin.Characters_Balloon_Broke_Ptn[this.iCurrentCharacter[i]] != 0 && OpenTaiko.Tx.Characters_Balloon_Broke[this.iCurrentCharacter[i]][nNowCharaFrame[i]] != null) { + OpenTaiko.Tx.Characters_Balloon_Broke[this.iCurrentCharacter[i]][nNowCharaFrame[i]].Opacity = nowOpacity; + OpenTaiko.Tx.Characters_Balloon_Broke[this.iCurrentCharacter[i]][nNowCharaFrame[i]].vcScaleRatio.X = charaScale; + OpenTaiko.Tx.Characters_Balloon_Broke[this.iCurrentCharacter[i]][nNowCharaFrame[i]].vcScaleRatio.Y = charaScale; + OpenTaiko.Tx.Characters_Balloon_Broke[this.iCurrentCharacter[i]][nNowCharaFrame[i]].t2D描画( + OpenTaiko.stage演奏ドラム画面.GetJPOSCROLLX(i) + chara_x, + OpenTaiko.stage演奏ドラム画面.GetJPOSCROLLY(i) + chara_y); + } + + if (OpenTaiko.ConfigIni.nPlayerCount <= 2) + OpenTaiko.stage演奏ドラム画面.PuchiChara.On進行描画( + OpenTaiko.stage演奏ドラム画面.GetJPOSCROLLX(i) + OpenTaiko.Skin.Game_PuchiChara_BalloonX[i], + OpenTaiko.stage演奏ドラム画面.GetJPOSCROLLY(i) + OpenTaiko.Skin.Game_PuchiChara_BalloonY[i], false, nowOpacity, true, player: i); + + if (endAnime) { + ReturnDefaultAnime(i, true); + } + } else if (eNowAnime[i] == Anime.Balloon_Miss) { + if (CharaAction_Balloon_FadeOut[i].Counter.IsStoped && nNowCharaFrame[i] > CharaAction_Balloon_FadeOut_StartMs[i][1]) { + CharaAction_Balloon_FadeOut[i].Start(); + } + + if (OpenTaiko.Skin.Characters_Balloon_Miss_Ptn[this.iCurrentCharacter[i]] != 0 && OpenTaiko.Tx.Characters_Balloon_Miss[this.iCurrentCharacter[i]][nNowCharaFrame[i]] != null) { + OpenTaiko.Tx.Characters_Balloon_Miss[this.iCurrentCharacter[i]][nNowCharaFrame[i]].Opacity = nowOpacity; + OpenTaiko.Tx.Characters_Balloon_Miss[this.iCurrentCharacter[i]][nNowCharaFrame[i]].vcScaleRatio.X = charaScale; + OpenTaiko.Tx.Characters_Balloon_Miss[this.iCurrentCharacter[i]][nNowCharaFrame[i]].vcScaleRatio.Y = charaScale; + OpenTaiko.Tx.Characters_Balloon_Miss[this.iCurrentCharacter[i]][nNowCharaFrame[i]].t2D描画( + OpenTaiko.stage演奏ドラム画面.GetJPOSCROLLX(i) + chara_x, + OpenTaiko.stage演奏ドラム画面.GetJPOSCROLLY(i) + chara_y); + } + + if (OpenTaiko.ConfigIni.nPlayerCount <= 2) + OpenTaiko.stage演奏ドラム画面.PuchiChara.On進行描画( + OpenTaiko.stage演奏ドラム画面.GetJPOSCROLLX(i) + OpenTaiko.Skin.Game_PuchiChara_BalloonX[i], + OpenTaiko.stage演奏ドラム画面.GetJPOSCROLLY(i) + OpenTaiko.Skin.Game_PuchiChara_BalloonY[i], false, nowOpacity, true, player: i); + + if (endAnime) { + ReturnDefaultAnime(i, true); + } + } else if (eNowAnime[i] == Anime.Balloon_Breaking) { + if (OpenTaiko.Skin.Characters_Balloon_Breaking_Ptn[this.iCurrentCharacter[i]] != 0 && OpenTaiko.Tx.Characters_Balloon_Breaking[this.iCurrentCharacter[i]][nNowCharaFrame[i]] != null) { + OpenTaiko.Tx.Characters_Balloon_Breaking[this.iCurrentCharacter[i]][nNowCharaFrame[i]].vcScaleRatio.X = charaScale; + OpenTaiko.Tx.Characters_Balloon_Breaking[this.iCurrentCharacter[i]][nNowCharaFrame[i]].vcScaleRatio.Y = charaScale; + OpenTaiko.Tx.Characters_Balloon_Breaking[this.iCurrentCharacter[i]][nNowCharaFrame[i]].t2D描画( + OpenTaiko.stage演奏ドラム画面.GetJPOSCROLLX(i) + chara_x, + OpenTaiko.stage演奏ドラム画面.GetJPOSCROLLY(i) + chara_y); + } + + if (OpenTaiko.ConfigIni.nPlayerCount <= 2) + OpenTaiko.stage演奏ドラム画面.PuchiChara.On進行描画( + OpenTaiko.stage演奏ドラム画面.GetJPOSCROLLX(i) + OpenTaiko.Skin.Game_PuchiChara_BalloonX[i], + OpenTaiko.stage演奏ドラム画面.GetJPOSCROLLY(i) + OpenTaiko.Skin.Game_PuchiChara_BalloonY[i], false, 255, true, player: i); + } else if (eNowAnime[i] == Anime.Kusudama_Broke) { + if (CharaAction_Balloon_FadeOut[i].Counter.IsStoped && nNowCharaFrame[i] > CharaAction_Balloon_FadeOut_StartMs[i][0]) { + CharaAction_Balloon_FadeOut[i].Start(); + } + float kusuOutX = ((1.0f - MathF.Cos(nNowCharaCounter[i] * MathF.PI)) * OpenTaiko.Skin.Resolution[0] / 2.0f) * resolutionScaleX; + float kusuOutY = (MathF.Sin(nNowCharaCounter[i] * MathF.PI / 2) * OpenTaiko.Skin.Resolution[1] / 2.0f) * resolutionScaleY; + + if (OpenTaiko.Skin.Characters_Kusudama_Broke_Ptn[this.iCurrentCharacter[i]] != 0 && OpenTaiko.Tx.Characters_Kusudama_Broke[this.iCurrentCharacter[i]][nNowCharaFrame[i]] != null) { + OpenTaiko.Tx.Characters_Kusudama_Broke[this.iCurrentCharacter[i]][nNowCharaFrame[i]].Opacity = nowOpacity; + OpenTaiko.Tx.Characters_Kusudama_Broke[this.iCurrentCharacter[i]][nNowCharaFrame[i]].vcScaleRatio.X = charaScale; + OpenTaiko.Tx.Characters_Kusudama_Broke[this.iCurrentCharacter[i]][nNowCharaFrame[i]].vcScaleRatio.Y = charaScale; + if (i % 2 == 0) { + OpenTaiko.Tx.Characters_Kusudama_Broke[this.iCurrentCharacter[i]][nNowCharaFrame[i]].t2D描画(kusu_chara_x - kusuOutX, kusu_chara_y - kusuOutY); + } else { + OpenTaiko.Tx.Characters_Kusudama_Broke[this.iCurrentCharacter[i]][nNowCharaFrame[i]].t2D左右反転描画(kusu_chara_x + kusuOutX, kusu_chara_y - kusuOutY); + } + } + if (i % 2 == 0) { + OpenTaiko.stage演奏ドラム画面.PuchiChara.On進行描画( + OpenTaiko.Skin.Game_PuchiChara_KusudamaX[i] - (int)kusuOutX, + OpenTaiko.Skin.Game_PuchiChara_KusudamaY[i] - (int)kusuOutY, false, nowOpacity, true, player: i); + } else { + OpenTaiko.stage演奏ドラム画面.PuchiChara.On進行描画( + OpenTaiko.Skin.Game_PuchiChara_KusudamaX[i] + (int)kusuOutX, + OpenTaiko.Skin.Game_PuchiChara_KusudamaY[i] - (int)kusuOutY, false, nowOpacity, true, player: i); + } + + if (endAnime) { + ReturnDefaultAnime(i, true); + } + } else if (eNowAnime[i] == Anime.Kusudama_Miss) { + if (CharaAction_Balloon_FadeOut[i].Counter.IsStoped && nNowCharaFrame[i] > CharaAction_Balloon_FadeOut_StartMs[i][1]) { + CharaAction_Balloon_FadeOut[i].Start(); + } + + float kusuOutY = (Math.Max(nNowCharaCounter[i] - 0.5f, 0) * OpenTaiko.Skin.Resolution[1] * 2) * resolutionScaleY; + + if (OpenTaiko.Skin.Characters_Kusudama_Miss_Ptn[this.iCurrentCharacter[i]] != 0 && OpenTaiko.Tx.Characters_Kusudama_Miss[this.iCurrentCharacter[i]][nNowCharaFrame[i]] != null) { + OpenTaiko.Tx.Characters_Kusudama_Miss[this.iCurrentCharacter[i]][nNowCharaFrame[i]].Opacity = nowOpacity; + OpenTaiko.Tx.Characters_Kusudama_Miss[this.iCurrentCharacter[i]][nNowCharaFrame[i]].vcScaleRatio.X = charaScale; + OpenTaiko.Tx.Characters_Kusudama_Miss[this.iCurrentCharacter[i]][nNowCharaFrame[i]].vcScaleRatio.Y = charaScale; + + + if (i % 2 == 0) { + OpenTaiko.Tx.Characters_Kusudama_Miss[this.iCurrentCharacter[i]][nNowCharaFrame[i]].t2D描画(kusu_chara_x, kusu_chara_y + kusuOutY); + } else { + OpenTaiko.Tx.Characters_Kusudama_Miss[this.iCurrentCharacter[i]][nNowCharaFrame[i]].t2D左右反転描画(kusu_chara_x, kusu_chara_y + kusuOutY); + } + } + + OpenTaiko.stage演奏ドラム画面.PuchiChara.On進行描画( + OpenTaiko.Skin.Game_PuchiChara_KusudamaX[i], + OpenTaiko.Skin.Game_PuchiChara_KusudamaY[i] + (int)kusuOutY, false, nowOpacity, true, player: i); + + if (endAnime) { + ReturnDefaultAnime(i, true); + } + } else if (eNowAnime[i] == Anime.Kusudama_Breaking) { + float kusuInX = ((1.0f - MathF.Sin(ctKusuIn[i].CurrentValue / 2000.0f * MathF.PI)) * OpenTaiko.Skin.Resolution[0] / 2.0f) * resolutionScaleX; + float kusuInY = -((MathF.Cos(ctKusuIn[i].CurrentValue / 1000.0f * MathF.PI / 2)) * OpenTaiko.Skin.Resolution[1] / 2.0f) * resolutionScaleY; + + + if (OpenTaiko.Skin.Characters_Kusudama_Breaking_Ptn[this.iCurrentCharacter[i]] != 0 && OpenTaiko.Tx.Characters_Kusudama_Breaking[this.iCurrentCharacter[i]][nNowCharaFrame[i]] != null) { + OpenTaiko.Tx.Characters_Kusudama_Breaking[this.iCurrentCharacter[i]][nNowCharaFrame[i]].vcScaleRatio.X = charaScale; + OpenTaiko.Tx.Characters_Kusudama_Breaking[this.iCurrentCharacter[i]][nNowCharaFrame[i]].vcScaleRatio.Y = charaScale; + if (i % 2 == 0) { + OpenTaiko.Tx.Characters_Kusudama_Breaking[this.iCurrentCharacter[i]][nNowCharaFrame[i]].t2D描画(kusu_chara_x - kusuInX, kusu_chara_y + kusuInY); + } else { + OpenTaiko.Tx.Characters_Kusudama_Breaking[this.iCurrentCharacter[i]][nNowCharaFrame[i]].t2D左右反転描画(kusu_chara_x + kusuInX, kusu_chara_y + kusuInY); + } + } + + if (i % 2 == 0) { + OpenTaiko.stage演奏ドラム画面.PuchiChara.On進行描画( + OpenTaiko.Skin.Game_PuchiChara_KusudamaX[i] - (int)kusuInX, + OpenTaiko.Skin.Game_PuchiChara_KusudamaY[i] + (int)kusuInY, false, 255, true, player: i); + } else { + OpenTaiko.stage演奏ドラム画面.PuchiChara.On進行描画( + OpenTaiko.Skin.Game_PuchiChara_KusudamaX[i] + (int)kusuInX, + OpenTaiko.Skin.Game_PuchiChara_KusudamaY[i] + (int)kusuInY, false, 255, true, player: i); + } + + if (endAnime) { + ChangeAnime(i, Anime.Kusudama_Idle, true); + } + } else if (eNowAnime[i] == Anime.Kusudama_Idle) { + float kusuInX = ((1.0f - MathF.Sin(ctKusuIn[i].CurrentValue / 2000.0f * MathF.PI)) * OpenTaiko.Skin.Resolution[0] / 2.0f) * resolutionScaleX; + float kusuInY = -((MathF.Cos(ctKusuIn[i].CurrentValue / 1000.0f * MathF.PI / 2)) * OpenTaiko.Skin.Resolution[1] / 2.0f) * resolutionScaleY; + + if (OpenTaiko.Skin.Characters_Kusudama_Idle_Ptn[this.iCurrentCharacter[i]] != 0 && OpenTaiko.Tx.Characters_Kusudama_Idle[this.iCurrentCharacter[i]][nNowCharaFrame[i]] != null) { + OpenTaiko.Tx.Characters_Kusudama_Idle[this.iCurrentCharacter[i]][nNowCharaFrame[i]].vcScaleRatio.X = charaScale; + OpenTaiko.Tx.Characters_Kusudama_Idle[this.iCurrentCharacter[i]][nNowCharaFrame[i]].vcScaleRatio.Y = charaScale; + if (i % 2 == 0) { + OpenTaiko.Tx.Characters_Kusudama_Idle[this.iCurrentCharacter[i]][nNowCharaFrame[i]].t2D描画(kusu_chara_x - kusuInX, kusu_chara_y + kusuInY); + } else { + OpenTaiko.Tx.Characters_Kusudama_Idle[this.iCurrentCharacter[i]][nNowCharaFrame[i]].t2D左右反転描画(kusu_chara_x + kusuInX, kusu_chara_y + kusuInY); + } + } + + if (i % 2 == 0) { + OpenTaiko.stage演奏ドラム画面.PuchiChara.On進行描画( + OpenTaiko.Skin.Game_PuchiChara_KusudamaX[i] - (int)kusuInX, + OpenTaiko.Skin.Game_PuchiChara_KusudamaY[i] + (int)kusuInY, false, 255, true, player: i); + } else { + OpenTaiko.stage演奏ドラム画面.PuchiChara.On進行描画( + OpenTaiko.Skin.Game_PuchiChara_KusudamaX[i] + (int)kusuInX, + OpenTaiko.Skin.Game_PuchiChara_KusudamaY[i] + (int)kusuInY, false, 255, true, player: i); + } + + if (endAnime) { + ChangeAnime(i, Anime.Kusudama_Idle, true); + } + } + } + } + } + + + public void ReturnDefaultAnime(int player, bool resetCounter) { + if (OpenTaiko.stage演奏ドラム画面.bIsGOGOTIME[player] && OpenTaiko.Skin.Characters_GoGoTime_Ptn[this.iCurrentCharacter[player]] != 0) { + if (OpenTaiko.stage演奏ドラム画面.bIsAlreadyMaxed[player] && OpenTaiko.Skin.Characters_GoGoTime_Maxed_Ptn[this.iCurrentCharacter[player]] != 0) { + ChangeAnime(player, Anime.GoGoTime_Maxed, resetCounter); + } else { + ChangeAnime(player, Anime.GoGoTime, resetCounter); + } + } else { + if (OpenTaiko.stage演奏ドラム画面.bIsMiss[player] && OpenTaiko.Skin.Characters_Normal_Missed_Ptn[this.iCurrentCharacter[player]] != 0) { + if (OpenTaiko.stage演奏ドラム画面.Chara_MissCount[player] >= 6 && OpenTaiko.Skin.Characters_Normal_MissedDown_Ptn[this.iCurrentCharacter[player]] != 0) { + ChangeAnime(player, Anime.MissDown, resetCounter); + } else { + ChangeAnime(player, Anime.Miss, resetCounter); } } else { - if (OpenTaiko.stage演奏ドラム画面.bIsMiss[player] && OpenTaiko.Skin.Characters_Normal_Missed_Ptn[this.iCurrentCharacter[player]] != 0) { - if (OpenTaiko.stage演奏ドラム画面.Chara_MissCount[player] >= 6 && OpenTaiko.Skin.Characters_Normal_MissedDown_Ptn[this.iCurrentCharacter[player]] != 0) { - ChangeAnime(player, Anime.MissDown, resetCounter); - } else { - ChangeAnime(player, Anime.Miss, resetCounter); - } + if (OpenTaiko.stage演奏ドラム画面.bIsAlreadyMaxed[player] && OpenTaiko.Skin.Characters_Normal_Maxed_Ptn[this.iCurrentCharacter[player]] != 0) { + ChangeAnime(player, Anime.Maxed, resetCounter); + } else if (OpenTaiko.stage演奏ドラム画面.bIsAlreadyCleared[player] && OpenTaiko.Skin.Characters_Normal_Cleared_Ptn[this.iCurrentCharacter[player]] != 0) { + ChangeAnime(player, Anime.Cleared, resetCounter); + } else if (OpenTaiko.Skin.Characters_Normal_Ptn[this.iCurrentCharacter[player]] != 0) { + ChangeAnime(player, Anime.Normal, resetCounter); } else { - if (OpenTaiko.stage演奏ドラム画面.bIsAlreadyMaxed[player] && OpenTaiko.Skin.Characters_Normal_Maxed_Ptn[this.iCurrentCharacter[player]] != 0) { - ChangeAnime(player, Anime.Maxed, resetCounter); - } else if (OpenTaiko.stage演奏ドラム画面.bIsAlreadyCleared[player] && OpenTaiko.Skin.Characters_Normal_Cleared_Ptn[this.iCurrentCharacter[player]] != 0) { - ChangeAnime(player, Anime.Cleared, resetCounter); - } else if (OpenTaiko.Skin.Characters_Normal_Ptn[this.iCurrentCharacter[player]] != 0) { - ChangeAnime(player, Anime.Normal, resetCounter); - } else { - ChangeAnime(player, Anime.None, resetCounter); - } + ChangeAnime(player, Anime.None, resetCounter); } } } - - public int[][] arモーション番号 = new int[5][]; - public int[][] arMissモーション番号 = new int[5][]; - public int[][] arMissDownモーション番号 = new int[5][]; - public int[][] arゴーゴーモーション番号 = new int[5][]; - public int[][] arクリアモーション番号 = new int[5][]; - - private float[] nNowCharaCounter = new float[5]; - private int[] nNowCharaFrame = new int[5]; - private int[] nCharaFrameCount = new int[5]; - private float[] nCharaBeat = new float[5]; - - public enum Anime { - None, - Normal, - Miss, - MissDown, - Cleared, - Maxed, - MissIn, - MissDownIn, - GoGoTime, - GoGoTime_Maxed, - Combo10, - Combo10_Clear, - Combo10_Max, - GoGoStart, - GoGoStart_Clear, - GoGoStart_Max, - Become_Cleared, - Become_Maxed, - SoulOut, - ClearOut, - Return, - Balloon_Breaking, - Balloon_Broke, - Balloon_Miss, - Kusudama_Idle, - Kusudama_Breaking, - Kusudama_Broke, - Kusudama_Miss - } - - - public Anime[] eNowAnime = new Anime[5]; - - public CCounter[] ctKusuIn = new CCounter[5]; - - public void KusuIn() { - for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { - ChangeAnime(i, Anime.Kusudama_Idle, true); - ctKusuIn[i] = new CCounter(0, 1000, 0.4f, OpenTaiko.Timer); - } - } - - public void ChangeAnime(int player, Anime anime, bool resetCounter) { - eNowAnime[player] = anime; - - if (resetCounter) { - nNowCharaCounter[player] = 0; - nNowCharaFrame[player] = 0; - } - - switch (anime) { - case Anime.None: - break; - case Anime.Normal: - nCharaFrameCount[player] = OpenTaiko.Skin.Characters_Motion_Normal[iCurrentCharacter[player]].Length - 1; - nCharaBeat[player] = OpenTaiko.Skin.Characters_Beat_Normal[iCurrentCharacter[player]]; - break; - case Anime.Miss: - nCharaFrameCount[player] = OpenTaiko.Skin.Characters_Motion_Miss[iCurrentCharacter[player]].Length - 1; - nCharaBeat[player] = OpenTaiko.Skin.Characters_Beat_Miss[iCurrentCharacter[player]]; - break; - case Anime.MissDown: - nCharaFrameCount[player] = OpenTaiko.Skin.Characters_Motion_MissDown[iCurrentCharacter[player]].Length - 1; - nCharaBeat[player] = OpenTaiko.Skin.Characters_Beat_MissDown[iCurrentCharacter[player]]; - break; - case Anime.Cleared: - nCharaFrameCount[player] = OpenTaiko.Skin.Characters_Motion_Clear[iCurrentCharacter[player]].Length - 1; - nCharaBeat[player] = OpenTaiko.Skin.Characters_Beat_Clear[iCurrentCharacter[player]]; - break; - case Anime.Maxed: - nCharaFrameCount[player] = OpenTaiko.Skin.Characters_Motion_ClearMax[iCurrentCharacter[player]].Length - 1; - nCharaBeat[player] = OpenTaiko.Skin.Characters_Beat_ClearMax[iCurrentCharacter[player]]; - break; - case Anime.MissIn: - nCharaFrameCount[player] = OpenTaiko.Skin.Characters_Motion_MissIn[iCurrentCharacter[player]].Length - 1; - nCharaBeat[player] = OpenTaiko.Skin.Characters_Beat_MissIn[iCurrentCharacter[player]]; - break; - case Anime.MissDownIn: - nCharaFrameCount[player] = OpenTaiko.Skin.Characters_Motion_MissDownIn[iCurrentCharacter[player]].Length - 1; - nCharaBeat[player] = OpenTaiko.Skin.Characters_Beat_MissDownIn[iCurrentCharacter[player]]; - break; - case Anime.GoGoTime: - nCharaFrameCount[player] = OpenTaiko.Skin.Characters_Motion_GoGo[iCurrentCharacter[player]].Length - 1; - nCharaBeat[player] = OpenTaiko.Skin.Characters_Beat_GoGo[iCurrentCharacter[player]]; - break; - case Anime.GoGoTime_Maxed: - nCharaFrameCount[player] = OpenTaiko.Skin.Characters_Motion_GoGoMax[iCurrentCharacter[player]].Length - 1; - nCharaBeat[player] = OpenTaiko.Skin.Characters_Beat_GoGoMax[iCurrentCharacter[player]]; - break; - case Anime.Combo10: - nCharaFrameCount[player] = OpenTaiko.Skin.Characters_Motion_10Combo[iCurrentCharacter[player]].Length - 1; - nCharaBeat[player] = OpenTaiko.Skin.Characters_Beat_10Combo[iCurrentCharacter[player]]; - break; - case Anime.Combo10_Clear: - nCharaFrameCount[player] = OpenTaiko.Skin.Characters_Motion_10Combo_Clear[iCurrentCharacter[player]].Length - 1; - nCharaBeat[player] = OpenTaiko.Skin.Characters_Beat_10Combo_Clear[iCurrentCharacter[player]]; - break; - case Anime.Combo10_Max: - nCharaFrameCount[player] = OpenTaiko.Skin.Characters_Motion_10ComboMax[iCurrentCharacter[player]].Length - 1; - nCharaBeat[player] = OpenTaiko.Skin.Characters_Beat_10ComboMax[iCurrentCharacter[player]]; - break; - case Anime.GoGoStart: - nCharaFrameCount[player] = OpenTaiko.Skin.Characters_Motion_GoGoStart[iCurrentCharacter[player]].Length - 1; - nCharaBeat[player] = OpenTaiko.Skin.Characters_Beat_GoGoStart[iCurrentCharacter[player]]; - break; - case Anime.GoGoStart_Clear: - nCharaFrameCount[player] = OpenTaiko.Skin.Characters_Motion_GoGoStart_Clear[iCurrentCharacter[player]].Length - 1; - nCharaBeat[player] = OpenTaiko.Skin.Characters_Beat_GoGoStart_Clear[iCurrentCharacter[player]]; - break; - case Anime.GoGoStart_Max: - nCharaFrameCount[player] = OpenTaiko.Skin.Characters_Motion_GoGoStartMax[iCurrentCharacter[player]].Length - 1; - nCharaBeat[player] = OpenTaiko.Skin.Characters_Beat_GoGoStartMax[iCurrentCharacter[player]]; - break; - case Anime.Become_Cleared: - nCharaFrameCount[player] = OpenTaiko.Skin.Characters_Motion_ClearIn[iCurrentCharacter[player]].Length - 1; - nCharaBeat[player] = OpenTaiko.Skin.Characters_Beat_ClearIn[iCurrentCharacter[player]]; - break; - case Anime.Become_Maxed: - nCharaFrameCount[player] = OpenTaiko.Skin.Characters_Motion_SoulIn[iCurrentCharacter[player]].Length - 1; - nCharaBeat[player] = OpenTaiko.Skin.Characters_Beat_SoulIn[iCurrentCharacter[player]]; - break; - case Anime.SoulOut: - nCharaFrameCount[player] = OpenTaiko.Skin.Characters_Motion_SoulOut[iCurrentCharacter[player]].Length - 1; - nCharaBeat[player] = OpenTaiko.Skin.Characters_Beat_SoulOut[iCurrentCharacter[player]]; - break; - case Anime.ClearOut: - nCharaFrameCount[player] = OpenTaiko.Skin.Characters_Motion_ClearOut[iCurrentCharacter[player]].Length - 1; - nCharaBeat[player] = OpenTaiko.Skin.Characters_Beat_ClearOut[iCurrentCharacter[player]]; - break; - case Anime.Return: - nCharaFrameCount[player] = OpenTaiko.Skin.Characters_Motion_Return[iCurrentCharacter[player]].Length - 1; - nCharaBeat[player] = OpenTaiko.Skin.Characters_Beat_Return[iCurrentCharacter[player]]; - break; - case Anime.Balloon_Breaking: - nCharaFrameCount[player] = OpenTaiko.Skin.Characters_Balloon_Breaking_Ptn[iCurrentCharacter[player]] - 1; - nCharaBeat[player] = 0.2f; - break; - case Anime.Balloon_Broke: - nCharaFrameCount[player] = OpenTaiko.Skin.Characters_Balloon_Broke_Ptn[iCurrentCharacter[player]] - 1; - nCharaBeat[player] = 0.2f; - break; - case Anime.Balloon_Miss: - nCharaFrameCount[player] = OpenTaiko.Skin.Characters_Balloon_Miss_Ptn[iCurrentCharacter[player]] - 1; - nCharaBeat[player] = 0.2f; - break; - case Anime.Kusudama_Idle: - nCharaFrameCount[player] = OpenTaiko.Skin.Characters_Kusudama_Idle_Ptn[iCurrentCharacter[player]] - 1; - nCharaBeat[player] = 0.4f; - break; - case Anime.Kusudama_Breaking: - nCharaFrameCount[player] = OpenTaiko.Skin.Characters_Kusudama_Breaking_Ptn[iCurrentCharacter[player]] - 1; - nCharaBeat[player] = 0.2f; - break; - case Anime.Kusudama_Broke: - nCharaFrameCount[player] = OpenTaiko.Skin.Characters_Kusudama_Broke_Ptn[iCurrentCharacter[player]] - 1; - nCharaBeat[player] = 1f; - break; - case Anime.Kusudama_Miss: - nCharaFrameCount[player] = OpenTaiko.Skin.Characters_Kusudama_Miss_Ptn[iCurrentCharacter[player]] - 1; - nCharaBeat[player] = 0.5f; - break; - } - } - - public CCounter[] CharaAction_Balloon_Delay = new CCounter[5]; - - public Animations.FadeOut[] CharaAction_Balloon_FadeOut = new Animations.FadeOut[5]; - //private readonly int[] CharaAction_Balloon_FadeOut_StartMs = new int[5]; - private readonly int[][] CharaAction_Balloon_FadeOut_StartMs = new int[5][]; - - //public bool[] bキャラクターアクション中 = new bool[5]; - - public bool[] b風船連打中 = new bool[5]; - public bool[] b演奏中 = new bool[5]; - - public int[] iCurrentCharacter = new int[5] { 0, 0, 0, 0, 0 }; } + + public int[][] arモーション番号 = new int[5][]; + public int[][] arMissモーション番号 = new int[5][]; + public int[][] arMissDownモーション番号 = new int[5][]; + public int[][] arゴーゴーモーション番号 = new int[5][]; + public int[][] arクリアモーション番号 = new int[5][]; + + private float[] nNowCharaCounter = new float[5]; + private int[] nNowCharaFrame = new int[5]; + private int[] nCharaFrameCount = new int[5]; + private float[] nCharaBeat = new float[5]; + + public enum Anime { + None, + Normal, + Miss, + MissDown, + Cleared, + Maxed, + MissIn, + MissDownIn, + GoGoTime, + GoGoTime_Maxed, + Combo10, + Combo10_Clear, + Combo10_Max, + GoGoStart, + GoGoStart_Clear, + GoGoStart_Max, + Become_Cleared, + Become_Maxed, + SoulOut, + ClearOut, + Return, + Balloon_Breaking, + Balloon_Broke, + Balloon_Miss, + Kusudama_Idle, + Kusudama_Breaking, + Kusudama_Broke, + Kusudama_Miss + } + + + public Anime[] eNowAnime = new Anime[5]; + + public CCounter[] ctKusuIn = new CCounter[5]; + + public void KusuIn() { + for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { + ChangeAnime(i, Anime.Kusudama_Idle, true); + ctKusuIn[i] = new CCounter(0, 1000, 0.4f, OpenTaiko.Timer); + } + } + + public void ChangeAnime(int player, Anime anime, bool resetCounter) { + eNowAnime[player] = anime; + + if (resetCounter) { + nNowCharaCounter[player] = 0; + nNowCharaFrame[player] = 0; + } + + switch (anime) { + case Anime.None: + break; + case Anime.Normal: + nCharaFrameCount[player] = OpenTaiko.Skin.Characters_Motion_Normal[iCurrentCharacter[player]].Length - 1; + nCharaBeat[player] = OpenTaiko.Skin.Characters_Beat_Normal[iCurrentCharacter[player]]; + break; + case Anime.Miss: + nCharaFrameCount[player] = OpenTaiko.Skin.Characters_Motion_Miss[iCurrentCharacter[player]].Length - 1; + nCharaBeat[player] = OpenTaiko.Skin.Characters_Beat_Miss[iCurrentCharacter[player]]; + break; + case Anime.MissDown: + nCharaFrameCount[player] = OpenTaiko.Skin.Characters_Motion_MissDown[iCurrentCharacter[player]].Length - 1; + nCharaBeat[player] = OpenTaiko.Skin.Characters_Beat_MissDown[iCurrentCharacter[player]]; + break; + case Anime.Cleared: + nCharaFrameCount[player] = OpenTaiko.Skin.Characters_Motion_Clear[iCurrentCharacter[player]].Length - 1; + nCharaBeat[player] = OpenTaiko.Skin.Characters_Beat_Clear[iCurrentCharacter[player]]; + break; + case Anime.Maxed: + nCharaFrameCount[player] = OpenTaiko.Skin.Characters_Motion_ClearMax[iCurrentCharacter[player]].Length - 1; + nCharaBeat[player] = OpenTaiko.Skin.Characters_Beat_ClearMax[iCurrentCharacter[player]]; + break; + case Anime.MissIn: + nCharaFrameCount[player] = OpenTaiko.Skin.Characters_Motion_MissIn[iCurrentCharacter[player]].Length - 1; + nCharaBeat[player] = OpenTaiko.Skin.Characters_Beat_MissIn[iCurrentCharacter[player]]; + break; + case Anime.MissDownIn: + nCharaFrameCount[player] = OpenTaiko.Skin.Characters_Motion_MissDownIn[iCurrentCharacter[player]].Length - 1; + nCharaBeat[player] = OpenTaiko.Skin.Characters_Beat_MissDownIn[iCurrentCharacter[player]]; + break; + case Anime.GoGoTime: + nCharaFrameCount[player] = OpenTaiko.Skin.Characters_Motion_GoGo[iCurrentCharacter[player]].Length - 1; + nCharaBeat[player] = OpenTaiko.Skin.Characters_Beat_GoGo[iCurrentCharacter[player]]; + break; + case Anime.GoGoTime_Maxed: + nCharaFrameCount[player] = OpenTaiko.Skin.Characters_Motion_GoGoMax[iCurrentCharacter[player]].Length - 1; + nCharaBeat[player] = OpenTaiko.Skin.Characters_Beat_GoGoMax[iCurrentCharacter[player]]; + break; + case Anime.Combo10: + nCharaFrameCount[player] = OpenTaiko.Skin.Characters_Motion_10Combo[iCurrentCharacter[player]].Length - 1; + nCharaBeat[player] = OpenTaiko.Skin.Characters_Beat_10Combo[iCurrentCharacter[player]]; + break; + case Anime.Combo10_Clear: + nCharaFrameCount[player] = OpenTaiko.Skin.Characters_Motion_10Combo_Clear[iCurrentCharacter[player]].Length - 1; + nCharaBeat[player] = OpenTaiko.Skin.Characters_Beat_10Combo_Clear[iCurrentCharacter[player]]; + break; + case Anime.Combo10_Max: + nCharaFrameCount[player] = OpenTaiko.Skin.Characters_Motion_10ComboMax[iCurrentCharacter[player]].Length - 1; + nCharaBeat[player] = OpenTaiko.Skin.Characters_Beat_10ComboMax[iCurrentCharacter[player]]; + break; + case Anime.GoGoStart: + nCharaFrameCount[player] = OpenTaiko.Skin.Characters_Motion_GoGoStart[iCurrentCharacter[player]].Length - 1; + nCharaBeat[player] = OpenTaiko.Skin.Characters_Beat_GoGoStart[iCurrentCharacter[player]]; + break; + case Anime.GoGoStart_Clear: + nCharaFrameCount[player] = OpenTaiko.Skin.Characters_Motion_GoGoStart_Clear[iCurrentCharacter[player]].Length - 1; + nCharaBeat[player] = OpenTaiko.Skin.Characters_Beat_GoGoStart_Clear[iCurrentCharacter[player]]; + break; + case Anime.GoGoStart_Max: + nCharaFrameCount[player] = OpenTaiko.Skin.Characters_Motion_GoGoStartMax[iCurrentCharacter[player]].Length - 1; + nCharaBeat[player] = OpenTaiko.Skin.Characters_Beat_GoGoStartMax[iCurrentCharacter[player]]; + break; + case Anime.Become_Cleared: + nCharaFrameCount[player] = OpenTaiko.Skin.Characters_Motion_ClearIn[iCurrentCharacter[player]].Length - 1; + nCharaBeat[player] = OpenTaiko.Skin.Characters_Beat_ClearIn[iCurrentCharacter[player]]; + break; + case Anime.Become_Maxed: + nCharaFrameCount[player] = OpenTaiko.Skin.Characters_Motion_SoulIn[iCurrentCharacter[player]].Length - 1; + nCharaBeat[player] = OpenTaiko.Skin.Characters_Beat_SoulIn[iCurrentCharacter[player]]; + break; + case Anime.SoulOut: + nCharaFrameCount[player] = OpenTaiko.Skin.Characters_Motion_SoulOut[iCurrentCharacter[player]].Length - 1; + nCharaBeat[player] = OpenTaiko.Skin.Characters_Beat_SoulOut[iCurrentCharacter[player]]; + break; + case Anime.ClearOut: + nCharaFrameCount[player] = OpenTaiko.Skin.Characters_Motion_ClearOut[iCurrentCharacter[player]].Length - 1; + nCharaBeat[player] = OpenTaiko.Skin.Characters_Beat_ClearOut[iCurrentCharacter[player]]; + break; + case Anime.Return: + nCharaFrameCount[player] = OpenTaiko.Skin.Characters_Motion_Return[iCurrentCharacter[player]].Length - 1; + nCharaBeat[player] = OpenTaiko.Skin.Characters_Beat_Return[iCurrentCharacter[player]]; + break; + case Anime.Balloon_Breaking: + nCharaFrameCount[player] = OpenTaiko.Skin.Characters_Balloon_Breaking_Ptn[iCurrentCharacter[player]] - 1; + nCharaBeat[player] = 0.2f; + break; + case Anime.Balloon_Broke: + nCharaFrameCount[player] = OpenTaiko.Skin.Characters_Balloon_Broke_Ptn[iCurrentCharacter[player]] - 1; + nCharaBeat[player] = 0.2f; + break; + case Anime.Balloon_Miss: + nCharaFrameCount[player] = OpenTaiko.Skin.Characters_Balloon_Miss_Ptn[iCurrentCharacter[player]] - 1; + nCharaBeat[player] = 0.2f; + break; + case Anime.Kusudama_Idle: + nCharaFrameCount[player] = OpenTaiko.Skin.Characters_Kusudama_Idle_Ptn[iCurrentCharacter[player]] - 1; + nCharaBeat[player] = 0.4f; + break; + case Anime.Kusudama_Breaking: + nCharaFrameCount[player] = OpenTaiko.Skin.Characters_Kusudama_Breaking_Ptn[iCurrentCharacter[player]] - 1; + nCharaBeat[player] = 0.2f; + break; + case Anime.Kusudama_Broke: + nCharaFrameCount[player] = OpenTaiko.Skin.Characters_Kusudama_Broke_Ptn[iCurrentCharacter[player]] - 1; + nCharaBeat[player] = 1f; + break; + case Anime.Kusudama_Miss: + nCharaFrameCount[player] = OpenTaiko.Skin.Characters_Kusudama_Miss_Ptn[iCurrentCharacter[player]] - 1; + nCharaBeat[player] = 0.5f; + break; + } + } + + public CCounter[] CharaAction_Balloon_Delay = new CCounter[5]; + + public Animations.FadeOut[] CharaAction_Balloon_FadeOut = new Animations.FadeOut[5]; + //private readonly int[] CharaAction_Balloon_FadeOut_StartMs = new int[5]; + private readonly int[][] CharaAction_Balloon_FadeOut_StartMs = new int[5][]; + + //public bool[] bキャラクターアクション中 = new bool[5]; + + public bool[] b風船連打中 = new bool[5]; + public bool[] b演奏中 = new bool[5]; + + public int[] iCurrentCharacter = new int[5] { 0, 0, 0, 0, 0 }; } diff --git a/OpenTaiko/src/Stages/07.Game/Taiko/CActImplChipEffects.cs b/OpenTaiko/src/Stages/07.Game/Taiko/CActImplChipEffects.cs index 7fccd081..71bd3066 100644 --- a/OpenTaiko/src/Stages/07.Game/Taiko/CActImplChipEffects.cs +++ b/OpenTaiko/src/Stages/07.Game/Taiko/CActImplChipEffects.cs @@ -2,120 +2,120 @@ using FDK; using Rectangle = System.Drawing.Rectangle; -namespace OpenTaiko { - internal class CActImplChipEffects : CActivity { - // コンストラクタ +namespace OpenTaiko; - public CActImplChipEffects() { - //base.b活性化してない = true; - } +internal class CActImplChipEffects : CActivity { + // コンストラクタ - - // メソッド - public virtual void Start(int nPlayer, int Lane) { - if (OpenTaiko.Tx.Gauge_Soul_Explosion != null && OpenTaiko.ConfigIni.nPlayerCount <= 2 && !OpenTaiko.ConfigIni.bAIBattleMode) { - for (int i = 0; i < 128; i++) { - if (!st[i].b使用中) { - st[i].b使用中 = true; - st[i].ct進行 = new CCounter(0, OpenTaiko.Skin.Game_Effect_NotesFlash[2], OpenTaiko.Skin.Game_Effect_NotesFlash_Timer, OpenTaiko.Timer); - st[i].ctChipEffect = new CCounter(0, 24, 17, OpenTaiko.Timer); - st[i].nプレイヤー = nPlayer; - st[i].Lane = Lane; - break; - } - } - } - } - - // CActivity 実装 - - public override void Activate() { - for (int i = 0; i < 128; i++) { - st[i] = new STチップエフェクト { - b使用中 = false, - ct進行 = new CCounter(), - ctChipEffect = new CCounter() - }; - } - base.Activate(); - } - public override void DeActivate() { - for (int i = 0; i < 128; i++) { - st[i].ct進行 = null; - st[i].ctChipEffect = null; - st[i].b使用中 = false; - } - base.DeActivate(); - } - public override int Draw() { - for (int i = 0; i < 128; i++) { - if (st[i].b使用中) { - st[i].ct進行.Tick(); - st[i].ctChipEffect.Tick(); - if (st[i].ct進行.IsEnded) { - st[i].ct進行.Stop(); - st[i].b使用中 = false; - } - - switch (st[i].nプレイヤー) { - case 0: - OpenTaiko.Tx.Gauge_Soul_Explosion[OpenTaiko.P1IsBlue() ? 1 : 0]?.t2D中心基準描画(OpenTaiko.Skin.Game_Effect_FlyingNotes_EndPoint_X[0], OpenTaiko.Skin.Game_Effect_FlyingNotes_EndPoint_Y[0], new Rectangle(st[i].ct進行.CurrentValue * OpenTaiko.Skin.Game_Effect_NotesFlash[0], 0, OpenTaiko.Skin.Game_Effect_NotesFlash[0], OpenTaiko.Skin.Game_Effect_NotesFlash[1])); - - if (this.st[i].ctChipEffect.CurrentValue < 13) - NotesManager.DisplayNote( - st[i].nプレイヤー, - OpenTaiko.Skin.Game_Effect_FlyingNotes_EndPoint_X[0], - OpenTaiko.Skin.Game_Effect_FlyingNotes_EndPoint_Y[0], - st[i].Lane); - break; - - case 1: - OpenTaiko.Tx.Gauge_Soul_Explosion[1]?.t2D中心基準描画(OpenTaiko.Skin.Game_Effect_FlyingNotes_EndPoint_X[1], OpenTaiko.Skin.Game_Effect_FlyingNotes_EndPoint_Y[1], new Rectangle(st[i].ct進行.CurrentValue * OpenTaiko.Skin.Game_Effect_NotesFlash[0], 0, OpenTaiko.Skin.Game_Effect_NotesFlash[0], OpenTaiko.Skin.Game_Effect_NotesFlash[1])); - if (this.st[i].ctChipEffect.CurrentValue < 13) - NotesManager.DisplayNote( - st[i].nプレイヤー, - OpenTaiko.Skin.Game_Effect_FlyingNotes_EndPoint_X[1], - OpenTaiko.Skin.Game_Effect_FlyingNotes_EndPoint_Y[1], - st[i].Lane); - break; - } - - if (OpenTaiko.Tx.ChipEffect != null) { - if (this.st[i].ctChipEffect.CurrentValue < 12) { - OpenTaiko.Tx.ChipEffect.color4 = new Color4(1.0f, 1.0f, 0.0f, 1.0f); - OpenTaiko.Tx.ChipEffect.Opacity = (int)(this.st[i].ctChipEffect.CurrentValue * (float)(225 / 11)); - OpenTaiko.Tx.ChipEffect.t2D中心基準描画(OpenTaiko.Skin.Game_Effect_FlyingNotes_EndPoint_X[st[i].nプレイヤー], OpenTaiko.Skin.Game_Effect_FlyingNotes_EndPoint_Y[st[i].nプレイヤー], new Rectangle(st[i].Lane * OpenTaiko.Skin.Game_Notes_Size[0], 0, OpenTaiko.Skin.Game_Notes_Size[0], OpenTaiko.Skin.Game_Notes_Size[1])); - } - if (this.st[i].ctChipEffect.CurrentValue > 12 && this.st[i].ctChipEffect.CurrentValue < 24) { - OpenTaiko.Tx.ChipEffect.color4 = new Color4(1.0f, 1.0f, 1.0f, 1.0f); - OpenTaiko.Tx.ChipEffect.Opacity = 255 - (int)((this.st[i].ctChipEffect.CurrentValue - 10) * (float)(255 / 14)); - OpenTaiko.Tx.ChipEffect.t2D中心基準描画(OpenTaiko.Skin.Game_Effect_FlyingNotes_EndPoint_X[st[i].nプレイヤー], OpenTaiko.Skin.Game_Effect_FlyingNotes_EndPoint_Y[st[i].nプレイヤー], new Rectangle(st[i].Lane * OpenTaiko.Skin.Game_Notes_Size[0], 0, OpenTaiko.Skin.Game_Notes_Size[0], OpenTaiko.Skin.Game_Notes_Size[1])); - } - } - - } - } - return 0; - } - - - // その他 - - #region [ private ] - //----------------- - //private CTexture[] txChara; - - [StructLayout(LayoutKind.Sequential)] - private struct STチップエフェクト { - public bool b使用中; - public CCounter ct進行; - public CCounter ctChipEffect; - public int nプレイヤー; - public int Lane; - } - private STチップエフェクト[] st = new STチップエフェクト[128]; - - //----------------- - #endregion + public CActImplChipEffects() { + //base.b活性化してない = true; } + + + // メソッド + public virtual void Start(int nPlayer, int Lane) { + if (OpenTaiko.Tx.Gauge_Soul_Explosion != null && OpenTaiko.ConfigIni.nPlayerCount <= 2 && !OpenTaiko.ConfigIni.bAIBattleMode) { + for (int i = 0; i < 128; i++) { + if (!st[i].b使用中) { + st[i].b使用中 = true; + st[i].ct進行 = new CCounter(0, OpenTaiko.Skin.Game_Effect_NotesFlash[2], OpenTaiko.Skin.Game_Effect_NotesFlash_Timer, OpenTaiko.Timer); + st[i].ctChipEffect = new CCounter(0, 24, 17, OpenTaiko.Timer); + st[i].nプレイヤー = nPlayer; + st[i].Lane = Lane; + break; + } + } + } + } + + // CActivity 実装 + + public override void Activate() { + for (int i = 0; i < 128; i++) { + st[i] = new STチップエフェクト { + b使用中 = false, + ct進行 = new CCounter(), + ctChipEffect = new CCounter() + }; + } + base.Activate(); + } + public override void DeActivate() { + for (int i = 0; i < 128; i++) { + st[i].ct進行 = null; + st[i].ctChipEffect = null; + st[i].b使用中 = false; + } + base.DeActivate(); + } + public override int Draw() { + for (int i = 0; i < 128; i++) { + if (st[i].b使用中) { + st[i].ct進行.Tick(); + st[i].ctChipEffect.Tick(); + if (st[i].ct進行.IsEnded) { + st[i].ct進行.Stop(); + st[i].b使用中 = false; + } + + switch (st[i].nプレイヤー) { + case 0: + OpenTaiko.Tx.Gauge_Soul_Explosion[OpenTaiko.P1IsBlue() ? 1 : 0]?.t2D中心基準描画(OpenTaiko.Skin.Game_Effect_FlyingNotes_EndPoint_X[0], OpenTaiko.Skin.Game_Effect_FlyingNotes_EndPoint_Y[0], new Rectangle(st[i].ct進行.CurrentValue * OpenTaiko.Skin.Game_Effect_NotesFlash[0], 0, OpenTaiko.Skin.Game_Effect_NotesFlash[0], OpenTaiko.Skin.Game_Effect_NotesFlash[1])); + + if (this.st[i].ctChipEffect.CurrentValue < 13) + NotesManager.DisplayNote( + st[i].nプレイヤー, + OpenTaiko.Skin.Game_Effect_FlyingNotes_EndPoint_X[0], + OpenTaiko.Skin.Game_Effect_FlyingNotes_EndPoint_Y[0], + st[i].Lane); + break; + + case 1: + OpenTaiko.Tx.Gauge_Soul_Explosion[1]?.t2D中心基準描画(OpenTaiko.Skin.Game_Effect_FlyingNotes_EndPoint_X[1], OpenTaiko.Skin.Game_Effect_FlyingNotes_EndPoint_Y[1], new Rectangle(st[i].ct進行.CurrentValue * OpenTaiko.Skin.Game_Effect_NotesFlash[0], 0, OpenTaiko.Skin.Game_Effect_NotesFlash[0], OpenTaiko.Skin.Game_Effect_NotesFlash[1])); + if (this.st[i].ctChipEffect.CurrentValue < 13) + NotesManager.DisplayNote( + st[i].nプレイヤー, + OpenTaiko.Skin.Game_Effect_FlyingNotes_EndPoint_X[1], + OpenTaiko.Skin.Game_Effect_FlyingNotes_EndPoint_Y[1], + st[i].Lane); + break; + } + + if (OpenTaiko.Tx.ChipEffect != null) { + if (this.st[i].ctChipEffect.CurrentValue < 12) { + OpenTaiko.Tx.ChipEffect.color4 = new Color4(1.0f, 1.0f, 0.0f, 1.0f); + OpenTaiko.Tx.ChipEffect.Opacity = (int)(this.st[i].ctChipEffect.CurrentValue * (float)(225 / 11)); + OpenTaiko.Tx.ChipEffect.t2D中心基準描画(OpenTaiko.Skin.Game_Effect_FlyingNotes_EndPoint_X[st[i].nプレイヤー], OpenTaiko.Skin.Game_Effect_FlyingNotes_EndPoint_Y[st[i].nプレイヤー], new Rectangle(st[i].Lane * OpenTaiko.Skin.Game_Notes_Size[0], 0, OpenTaiko.Skin.Game_Notes_Size[0], OpenTaiko.Skin.Game_Notes_Size[1])); + } + if (this.st[i].ctChipEffect.CurrentValue > 12 && this.st[i].ctChipEffect.CurrentValue < 24) { + OpenTaiko.Tx.ChipEffect.color4 = new Color4(1.0f, 1.0f, 1.0f, 1.0f); + OpenTaiko.Tx.ChipEffect.Opacity = 255 - (int)((this.st[i].ctChipEffect.CurrentValue - 10) * (float)(255 / 14)); + OpenTaiko.Tx.ChipEffect.t2D中心基準描画(OpenTaiko.Skin.Game_Effect_FlyingNotes_EndPoint_X[st[i].nプレイヤー], OpenTaiko.Skin.Game_Effect_FlyingNotes_EndPoint_Y[st[i].nプレイヤー], new Rectangle(st[i].Lane * OpenTaiko.Skin.Game_Notes_Size[0], 0, OpenTaiko.Skin.Game_Notes_Size[0], OpenTaiko.Skin.Game_Notes_Size[1])); + } + } + + } + } + return 0; + } + + + // その他 + + #region [ private ] + //----------------- + //private CTexture[] txChara; + + [StructLayout(LayoutKind.Sequential)] + private struct STチップエフェクト { + public bool b使用中; + public CCounter ct進行; + public CCounter ctChipEffect; + public int nプレイヤー; + public int Lane; + } + private STチップエフェクト[] st = new STチップエフェクト[128]; + + //----------------- + #endregion } diff --git a/OpenTaiko/src/Stages/07.Game/Taiko/CActImplClearAnimation.cs b/OpenTaiko/src/Stages/07.Game/Taiko/CActImplClearAnimation.cs index f5dcd896..51ab0ae2 100644 --- a/OpenTaiko/src/Stages/07.Game/Taiko/CActImplClearAnimation.cs +++ b/OpenTaiko/src/Stages/07.Game/Taiko/CActImplClearAnimation.cs @@ -1,229 +1,148 @@ using FDK; -namespace OpenTaiko { - internal class CActImplClearAnimation : CActivity { - /// - /// 課題 - /// _クリア失敗 →素材不足(確保はできる。切り出しと加工をしてないだけ。) - /// _ - /// - public CActImplClearAnimation() { - base.IsDeActivated = true; - } +namespace OpenTaiko; - public void Start() { - // this.ct進行メイン = new CCounter(0, 500, 1000 / 60, TJAPlayer3.Timer); +internal class CActImplClearAnimation : CActivity { + /// + /// 課題 + /// _クリア失敗 →素材不足(確保はできる。切り出しと加工をしてないだけ。) + /// _ + /// + public CActImplClearAnimation() { + base.IsDeActivated = true; + } - bSongsPlayed = false; + public void Start() { + // this.ct進行メイン = new CCounter(0, 500, 1000 / 60, TJAPlayer3.Timer); - this.ct進行メイン = new CCounter(0, 300, 22, OpenTaiko.Timer); + bSongsPlayed = false; - /* - this.ctEnd_ClearFailed = new CCounter(0, 69, 30, TJAPlayer3.Timer); - this.ctEnd_FullCombo = new CCounter(0, 66, 33, TJAPlayer3.Timer); - this.ctEnd_FullComboLoop = new CCounter(0, 2, 30, TJAPlayer3.Timer); - this.ctEnd_DondaFullCombo = new CCounter(0, 61, 33, TJAPlayer3.Timer); - this.ctEnd_DondaFullComboLoop = new CCounter(0, 2, 30, TJAPlayer3.Timer); - */ + this.ct進行メイン = new CCounter(0, 300, 22, OpenTaiko.Timer); - // モードの決定。クリア失敗・フルコンボも事前に作っとく。 - if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Tower) { - if (CFloorManagement.CurrentNumberOfLives > 0) { - if (OpenTaiko.stage演奏ドラム画面.CChartScore[0].nMiss == 0 && OpenTaiko.stage演奏ドラム画面.CChartScore[0].nMine == 0) { - if (OpenTaiko.stage演奏ドラム画面.CChartScore[0].nGood == 0) - this.Mode[0] = EndMode.Tower_TopReached_Perfect; - else - this.Mode[0] = EndMode.Tower_TopReached_FullCombo; - } else - this.Mode[0] = EndMode.Tower_TopReached_Pass; + /* + this.ctEnd_ClearFailed = new CCounter(0, 69, 30, TJAPlayer3.Timer); + this.ctEnd_FullCombo = new CCounter(0, 66, 33, TJAPlayer3.Timer); + this.ctEnd_FullComboLoop = new CCounter(0, 2, 30, TJAPlayer3.Timer); + this.ctEnd_DondaFullCombo = new CCounter(0, 61, 33, TJAPlayer3.Timer); + this.ctEnd_DondaFullComboLoop = new CCounter(0, 2, 30, TJAPlayer3.Timer); + */ + + // モードの決定。クリア失敗・フルコンボも事前に作っとく。 + if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Tower) { + if (CFloorManagement.CurrentNumberOfLives > 0) { + if (OpenTaiko.stage演奏ドラム画面.CChartScore[0].nMiss == 0 && OpenTaiko.stage演奏ドラム画面.CChartScore[0].nMine == 0) { + if (OpenTaiko.stage演奏ドラム画面.CChartScore[0].nGood == 0) + this.Mode[0] = EndMode.Tower_TopReached_Perfect; + else + this.Mode[0] = EndMode.Tower_TopReached_FullCombo; } else - this.Mode[0] = EndMode.Tower_Dropout; - } else if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) { - // 段位認定モード。 - if (!OpenTaiko.stage演奏ドラム画面.actDan.GetFailedAllChallenges()) { - // 段位認定モード、クリア成功 - // this.Mode[0] = EndMode.StageCleared; + this.Mode[0] = EndMode.Tower_TopReached_Pass; + } else + this.Mode[0] = EndMode.Tower_Dropout; + } else if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) { + // 段位認定モード。 + if (!OpenTaiko.stage演奏ドラム画面.actDan.GetFailedAllChallenges()) { + // 段位認定モード、クリア成功 + // this.Mode[0] = EndMode.StageCleared; - bool bgold = OpenTaiko.stage演奏ドラム画面.actDan.GetExamStatus(OpenTaiko.stage結果.st演奏記録.Drums.Dan_C) == Exam.Status.Better_Success; + bool bgold = OpenTaiko.stage演奏ドラム画面.actDan.GetExamStatus(OpenTaiko.stage結果.st演奏記録.Drums.Dan_C) == Exam.Status.Better_Success; - if (OpenTaiko.stage演奏ドラム画面.CChartScore[0].nMiss == 0 && OpenTaiko.stage演奏ドラム画面.CChartScore[0].nMine == 0) { - if (OpenTaiko.stage演奏ドラム画面.CChartScore[0].nGood == 0) - this.Mode[0] = bgold ? EndMode.Dan_Gold_Perfect : EndMode.Dan_Red_Perfect; - else - this.Mode[0] = bgold ? EndMode.Dan_Gold_FullCombo : EndMode.Dan_Red_FullCombo; - } else - this.Mode[0] = bgold ? EndMode.Dan_Gold_Pass : EndMode.Dan_Red_Pass; + if (OpenTaiko.stage演奏ドラム画面.CChartScore[0].nMiss == 0 && OpenTaiko.stage演奏ドラム画面.CChartScore[0].nMine == 0) { + if (OpenTaiko.stage演奏ドラム画面.CChartScore[0].nGood == 0) + this.Mode[0] = bgold ? EndMode.Dan_Gold_Perfect : EndMode.Dan_Red_Perfect; + else + this.Mode[0] = bgold ? EndMode.Dan_Gold_FullCombo : EndMode.Dan_Red_FullCombo; + } else + this.Mode[0] = bgold ? EndMode.Dan_Gold_Pass : EndMode.Dan_Red_Pass; - } else { - // 段位認定モード、クリア失敗 - this.Mode[0] = EndMode.Dan_Fail; - } - } else if (OpenTaiko.ConfigIni.bAIBattleMode) { - if (OpenTaiko.stage演奏ドラム画面.bIsAIBattleWin) { - if (OpenTaiko.stage演奏ドラム画面.CChartScore[0].nMiss == 0 && OpenTaiko.stage演奏ドラム画面.CChartScore[0].nMine == 0) { - if (OpenTaiko.stage演奏ドラム画面.CChartScore[0].nGood == 0) - this.Mode[0] = EndMode.AI_Win_Perfect; - else - this.Mode[0] = EndMode.AI_Win_FullCombo; - } else - this.Mode[0] = EndMode.AI_Win; - } else { - this.Mode[0] = EndMode.AI_Lose; - } } else { - // 通常のモード。 - // ここでフルコンボフラグをチェックするが現時点ではない。 - // 今の段階では魂ゲージ80%以上でチェック。 - for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { - if (HGaugeMethods.UNSAFE_FastNormaCheck(i)) { - if (OpenTaiko.stage演奏ドラム画面.CChartScore[i].nMiss == 0 && OpenTaiko.stage演奏ドラム画面.CChartScore[i].nMine == 0) - //if (TJAPlayer3.stage演奏ドラム画面.nヒット数_Auto含まない.Drums.Miss == 0) + // 段位認定モード、クリア失敗 + this.Mode[0] = EndMode.Dan_Fail; + } + } else if (OpenTaiko.ConfigIni.bAIBattleMode) { + if (OpenTaiko.stage演奏ドラム画面.bIsAIBattleWin) { + if (OpenTaiko.stage演奏ドラム画面.CChartScore[0].nMiss == 0 && OpenTaiko.stage演奏ドラム画面.CChartScore[0].nMine == 0) { + if (OpenTaiko.stage演奏ドラム画面.CChartScore[0].nGood == 0) + this.Mode[0] = EndMode.AI_Win_Perfect; + else + this.Mode[0] = EndMode.AI_Win_FullCombo; + } else + this.Mode[0] = EndMode.AI_Win; + } else { + this.Mode[0] = EndMode.AI_Lose; + } + } else { + // 通常のモード。 + // ここでフルコンボフラグをチェックするが現時点ではない。 + // 今の段階では魂ゲージ80%以上でチェック。 + for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { + if (HGaugeMethods.UNSAFE_FastNormaCheck(i)) { + if (OpenTaiko.stage演奏ドラム画面.CChartScore[i].nMiss == 0 && OpenTaiko.stage演奏ドラム画面.CChartScore[i].nMine == 0) + //if (TJAPlayer3.stage演奏ドラム画面.nヒット数_Auto含まない.Drums.Miss == 0) + { + if (OpenTaiko.stage演奏ドラム画面.CChartScore[i].nGood == 0) + //if (TJAPlayer3.stage演奏ドラム画面.nヒット数_Auto含まない.Drums.Great == 0) { - if (OpenTaiko.stage演奏ドラム画面.CChartScore[i].nGood == 0) - //if (TJAPlayer3.stage演奏ドラム画面.nヒット数_Auto含まない.Drums.Great == 0) - { - this.Mode[i] = EndMode.StagePerfectCombo; - } else { - this.Mode[i] = EndMode.StageFullCombo; - } + this.Mode[i] = EndMode.StagePerfectCombo; } else { - this.Mode[i] = EndMode.StageCleared; + this.Mode[i] = EndMode.StageFullCombo; } } else { - this.Mode[i] = EndMode.StageFailed; + this.Mode[i] = EndMode.StageCleared; } + } else { + this.Mode[i] = EndMode.StageFailed; } } } + } - public override void Activate() { - this.bリザルトボイス再生済み = false; - this.Mode = new EndMode[5]; + public override void Activate() { + this.bリザルトボイス再生済み = false; + this.Mode = new EndMode[5]; - var origindir = CSkin.Path($"{TextureLoader.BASE}{TextureLoader.GAME}{TextureLoader.END}"); + var origindir = CSkin.Path($"{TextureLoader.BASE}{TextureLoader.GAME}{TextureLoader.END}"); - if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Tower) { - Tower_DropoutScript = new EndAnimeScript($@"{origindir}Tower_Dropout{Path.DirectorySeparatorChar}Script.lua"); - Tower_DropoutScript.Init(); + if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Tower) { + Tower_DropoutScript = new EndAnimeScript($@"{origindir}Tower_Dropout{Path.DirectorySeparatorChar}Script.lua"); + Tower_DropoutScript.Init(); - Tower_TopReached_PassScript = new EndAnimeScript($@"{origindir}Tower_TopReached_Pass{Path.DirectorySeparatorChar}Script.lua"); - Tower_TopReached_PassScript.Init(); + Tower_TopReached_PassScript = new EndAnimeScript($@"{origindir}Tower_TopReached_Pass{Path.DirectorySeparatorChar}Script.lua"); + Tower_TopReached_PassScript.Init(); - Tower_TopReached_FullComboScript = new EndAnimeScript($@"{origindir}Tower_TopReached_FullCombo{Path.DirectorySeparatorChar}Script.lua"); - Tower_TopReached_FullComboScript.Init(); + Tower_TopReached_FullComboScript = new EndAnimeScript($@"{origindir}Tower_TopReached_FullCombo{Path.DirectorySeparatorChar}Script.lua"); + Tower_TopReached_FullComboScript.Init(); - Tower_TopReached_PerfectScript = new EndAnimeScript($@"{origindir}Tower_TopReached_Perfect{Path.DirectorySeparatorChar}Script.lua"); - Tower_TopReached_PerfectScript.Init(); - - this.soundTowerDropout = OpenTaiko.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}Tower{Path.DirectorySeparatorChar}Tower_Dropout.ogg"), ESoundGroup.SoundEffect); - this.soundTowerTopPass = OpenTaiko.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}Tower{Path.DirectorySeparatorChar}Tower_TopReached_Pass.ogg"), ESoundGroup.SoundEffect); - this.soundTowerTopFC = OpenTaiko.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}Tower{Path.DirectorySeparatorChar}Tower_TopReached_FullCombo.ogg"), ESoundGroup.SoundEffect); - this.soundTowerTopPerfect = OpenTaiko.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}Tower{Path.DirectorySeparatorChar}Tower_TopReached_Perfect.ogg"), ESoundGroup.SoundEffect); - } else if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) { - Dan_FailScript = new EndAnimeScript($@"{origindir}Dan_Fail{Path.DirectorySeparatorChar}Script.lua"); - Dan_FailScript.Init(); - - Dan_Red_PassScript = new EndAnimeScript($@"{origindir}Dan_Red_Pass{Path.DirectorySeparatorChar}Script.lua"); - Dan_Red_PassScript.Init(); - - Dan_Red_FullComboScript = new EndAnimeScript($@"{origindir}Dan_Red_FullCombo{Path.DirectorySeparatorChar}Script.lua"); - Dan_Red_FullComboScript.Init(); - - Dan_Red_PerfectScript = new EndAnimeScript($@"{origindir}Dan_Red_Perfect{Path.DirectorySeparatorChar}Script.lua"); - Dan_Red_PerfectScript.Init(); - - Dan_Gold_PassScript = new EndAnimeScript($@"{origindir}Dan_Gold_Pass{Path.DirectorySeparatorChar}Script.lua"); - Dan_Gold_PassScript.Init(); - - Dan_Gold_FullComboScript = new EndAnimeScript($@"{origindir}Dan_Gold_FullCombo{Path.DirectorySeparatorChar}Script.lua"); - Dan_Gold_FullComboScript.Init(); - - Dan_Gold_PerfectScript = new EndAnimeScript($@"{origindir}Dan_Gold_Perfect{Path.DirectorySeparatorChar}Script.lua"); - Dan_Gold_PerfectScript.Init(); - - this.soundDanFailed = OpenTaiko.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}Dan{Path.DirectorySeparatorChar}Dan_Fail.ogg"), ESoundGroup.SoundEffect); - this.soundDanRedClear = OpenTaiko.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}Dan{Path.DirectorySeparatorChar}Dan_Red_Pass.ogg"), ESoundGroup.SoundEffect); - this.soundDanRedFC = OpenTaiko.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}Dan{Path.DirectorySeparatorChar}Dan_Red_FullCombo.ogg"), ESoundGroup.SoundEffect); - this.soundDanRedPerfect = OpenTaiko.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}Dan{Path.DirectorySeparatorChar}Dan_Red_Perfect.ogg"), ESoundGroup.SoundEffect); - this.soundDanGoldClear = OpenTaiko.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}Dan{Path.DirectorySeparatorChar}Dan_Gold_Pass.ogg"), ESoundGroup.SoundEffect); - this.soundDanGoldFC = OpenTaiko.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}Dan{Path.DirectorySeparatorChar}Dan_Gold_FullCombo.ogg"), ESoundGroup.SoundEffect); - this.soundDanGoldPerfect = OpenTaiko.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}Dan{Path.DirectorySeparatorChar}Dan_Gold_Perfect.ogg"), ESoundGroup.SoundEffect); - - } else if (OpenTaiko.ConfigIni.bAIBattleMode) { - AILoseScript = new EndAnimeScript($@"{origindir}AI_Lose{Path.DirectorySeparatorChar}Script.lua"); - AILoseScript.Init(); - - AIWinScript = new EndAnimeScript($@"{origindir}AI_Win{Path.DirectorySeparatorChar}Script.lua"); - AIWinScript.Init(); - - AIWin_FullComboScript = new EndAnimeScript($@"{origindir}AI_Win_FullCombo{Path.DirectorySeparatorChar}Script.lua"); - AIWin_FullComboScript.Init(); - - AIWin_PerfectScript = new EndAnimeScript($@"{origindir}AI_Win_Perfect{Path.DirectorySeparatorChar}Script.lua"); - AIWin_PerfectScript.Init(); - - this.soundAILose = OpenTaiko.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}AIBattle_Lose.ogg"), ESoundGroup.SoundEffect); - this.soundAIWin = OpenTaiko.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}AIBattle_Win.ogg"), ESoundGroup.SoundEffect); - this.soundAIWinFullCombo = OpenTaiko.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}AIBattle_Win_FullCombo.ogg"), ESoundGroup.SoundEffect); - this.soundAIWinPerfectCombo = OpenTaiko.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}AIBattle_Win_AllPerfect.ogg"), ESoundGroup.SoundEffect); - } else { - FailedScript = new EndAnimeScript($@"{origindir}ClearFailed{Path.DirectorySeparatorChar}Script.lua");//ClearFailed - FailedScript.Init(); - - ClearScript = new EndAnimeScript($@"{origindir}Clear{Path.DirectorySeparatorChar}Script.lua"); - ClearScript.Init(); - - FullComboScript = new EndAnimeScript($@"{origindir}FullCombo{Path.DirectorySeparatorChar}Script.lua"); - FullComboScript.Init(); - - PerfectComboScript = new EndAnimeScript($@"{origindir}AllPerfect{Path.DirectorySeparatorChar}Script.lua"); - PerfectComboScript.Init(); - } - - - base.Activate(); - } - - public override void DeActivate() { - this.ct進行メイン = null; - - if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Tower) { - Tower_DropoutScript.Dispose(); - Tower_TopReached_PassScript.Dispose(); - Tower_TopReached_FullComboScript.Dispose(); - Tower_TopReached_PerfectScript.Dispose(); - } else if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) { - Dan_FailScript.Dispose(); - Dan_Red_PassScript.Dispose(); - Dan_Red_FullComboScript.Dispose(); - Dan_Red_PerfectScript.Dispose(); - Dan_Gold_PassScript.Dispose(); - Dan_Gold_FullComboScript.Dispose(); - Dan_Gold_PerfectScript.Dispose(); - } else if (OpenTaiko.ConfigIni.bAIBattleMode) { - AILoseScript.Dispose(); - AIWinScript.Dispose(); - AIWin_FullComboScript.Dispose(); - AIWin_PerfectScript.Dispose(); - } else { - FailedScript.Dispose(); - ClearScript.Dispose(); - FullComboScript.Dispose(); - PerfectComboScript.Dispose(); - } - - base.DeActivate(); - } - - public override void CreateManagedResource() { - this.b再生済み = false; + Tower_TopReached_PerfectScript = new EndAnimeScript($@"{origindir}Tower_TopReached_Perfect{Path.DirectorySeparatorChar}Script.lua"); + Tower_TopReached_PerfectScript.Init(); this.soundTowerDropout = OpenTaiko.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}Tower{Path.DirectorySeparatorChar}Tower_Dropout.ogg"), ESoundGroup.SoundEffect); this.soundTowerTopPass = OpenTaiko.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}Tower{Path.DirectorySeparatorChar}Tower_TopReached_Pass.ogg"), ESoundGroup.SoundEffect); this.soundTowerTopFC = OpenTaiko.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}Tower{Path.DirectorySeparatorChar}Tower_TopReached_FullCombo.ogg"), ESoundGroup.SoundEffect); this.soundTowerTopPerfect = OpenTaiko.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}Tower{Path.DirectorySeparatorChar}Tower_TopReached_Perfect.ogg"), ESoundGroup.SoundEffect); + } else if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) { + Dan_FailScript = new EndAnimeScript($@"{origindir}Dan_Fail{Path.DirectorySeparatorChar}Script.lua"); + Dan_FailScript.Init(); + + Dan_Red_PassScript = new EndAnimeScript($@"{origindir}Dan_Red_Pass{Path.DirectorySeparatorChar}Script.lua"); + Dan_Red_PassScript.Init(); + + Dan_Red_FullComboScript = new EndAnimeScript($@"{origindir}Dan_Red_FullCombo{Path.DirectorySeparatorChar}Script.lua"); + Dan_Red_FullComboScript.Init(); + + Dan_Red_PerfectScript = new EndAnimeScript($@"{origindir}Dan_Red_Perfect{Path.DirectorySeparatorChar}Script.lua"); + Dan_Red_PerfectScript.Init(); + + Dan_Gold_PassScript = new EndAnimeScript($@"{origindir}Dan_Gold_Pass{Path.DirectorySeparatorChar}Script.lua"); + Dan_Gold_PassScript.Init(); + + Dan_Gold_FullComboScript = new EndAnimeScript($@"{origindir}Dan_Gold_FullCombo{Path.DirectorySeparatorChar}Script.lua"); + Dan_Gold_FullComboScript.Init(); + + Dan_Gold_PerfectScript = new EndAnimeScript($@"{origindir}Dan_Gold_Perfect{Path.DirectorySeparatorChar}Script.lua"); + Dan_Gold_PerfectScript.Init(); this.soundDanFailed = OpenTaiko.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}Dan{Path.DirectorySeparatorChar}Dan_Fail.ogg"), ESoundGroup.SoundEffect); this.soundDanRedClear = OpenTaiko.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}Dan{Path.DirectorySeparatorChar}Dan_Red_Pass.ogg"), ESoundGroup.SoundEffect); @@ -233,604 +152,685 @@ namespace OpenTaiko { this.soundDanGoldFC = OpenTaiko.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}Dan{Path.DirectorySeparatorChar}Dan_Gold_FullCombo.ogg"), ESoundGroup.SoundEffect); this.soundDanGoldPerfect = OpenTaiko.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}Dan{Path.DirectorySeparatorChar}Dan_Gold_Perfect.ogg"), ESoundGroup.SoundEffect); + } else if (OpenTaiko.ConfigIni.bAIBattleMode) { + AILoseScript = new EndAnimeScript($@"{origindir}AI_Lose{Path.DirectorySeparatorChar}Script.lua"); + AILoseScript.Init(); + + AIWinScript = new EndAnimeScript($@"{origindir}AI_Win{Path.DirectorySeparatorChar}Script.lua"); + AIWinScript.Init(); + + AIWin_FullComboScript = new EndAnimeScript($@"{origindir}AI_Win_FullCombo{Path.DirectorySeparatorChar}Script.lua"); + AIWin_FullComboScript.Init(); + + AIWin_PerfectScript = new EndAnimeScript($@"{origindir}AI_Win_Perfect{Path.DirectorySeparatorChar}Script.lua"); + AIWin_PerfectScript.Init(); + this.soundAILose = OpenTaiko.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}AIBattle_Lose.ogg"), ESoundGroup.SoundEffect); this.soundAIWin = OpenTaiko.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}AIBattle_Win.ogg"), ESoundGroup.SoundEffect); this.soundAIWinFullCombo = OpenTaiko.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}AIBattle_Win_FullCombo.ogg"), ESoundGroup.SoundEffect); this.soundAIWinPerfectCombo = OpenTaiko.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}AIBattle_Win_AllPerfect.ogg"), ESoundGroup.SoundEffect); - for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { - this.soundClear[i] = OpenTaiko.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}Clear.ogg"), ESoundGroup.SoundEffect); - this.soundFailed[i] = OpenTaiko.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}Failed.ogg"), ESoundGroup.SoundEffect); - this.soundFullCombo[i] = OpenTaiko.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}FullCombo.ogg"), ESoundGroup.SoundEffect); - this.soundPerfectCombo[i] = OpenTaiko.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}AllPerfect.ogg"), ESoundGroup.SoundEffect); - } + } else { + FailedScript = new EndAnimeScript($@"{origindir}ClearFailed{Path.DirectorySeparatorChar}Script.lua");//ClearFailed + FailedScript.Init(); - base.CreateManagedResource(); + ClearScript = new EndAnimeScript($@"{origindir}Clear{Path.DirectorySeparatorChar}Script.lua"); + ClearScript.Init(); + + FullComboScript = new EndAnimeScript($@"{origindir}FullCombo{Path.DirectorySeparatorChar}Script.lua"); + FullComboScript.Init(); + + PerfectComboScript = new EndAnimeScript($@"{origindir}AllPerfect{Path.DirectorySeparatorChar}Script.lua"); + PerfectComboScript.Init(); } - public override void ReleaseManagedResource() { - this.soundTowerDropout?.tDispose(); - this.soundTowerTopPass?.tDispose(); - this.soundTowerTopFC?.tDispose(); - this.soundTowerTopPerfect?.tDispose(); - this.soundDanFailed?.tDispose(); - this.soundDanRedClear?.tDispose(); - this.soundDanRedFC?.tDispose(); - this.soundDanRedPerfect?.tDispose(); - this.soundDanGoldClear?.tDispose(); - this.soundDanGoldFC?.tDispose(); - this.soundDanGoldPerfect?.tDispose(); + base.Activate(); + } - this.soundAILose?.tDispose(); - this.soundAIWin?.tDispose(); - this.soundAIWinFullCombo?.tDispose(); - this.soundAIWinPerfectCombo?.tDispose(); + public override void DeActivate() { + this.ct進行メイン = null; - for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { - this.soundClear[i]?.tDispose(); - this.soundFailed[i]?.tDispose(); - this.soundFullCombo[i]?.tDispose(); - this.soundPerfectCombo[i]?.tDispose(); - } - - base.ReleaseManagedResource(); + if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Tower) { + Tower_DropoutScript.Dispose(); + Tower_TopReached_PassScript.Dispose(); + Tower_TopReached_FullComboScript.Dispose(); + Tower_TopReached_PerfectScript.Dispose(); + } else if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) { + Dan_FailScript.Dispose(); + Dan_Red_PassScript.Dispose(); + Dan_Red_FullComboScript.Dispose(); + Dan_Red_PerfectScript.Dispose(); + Dan_Gold_PassScript.Dispose(); + Dan_Gold_FullComboScript.Dispose(); + Dan_Gold_PerfectScript.Dispose(); + } else if (OpenTaiko.ConfigIni.bAIBattleMode) { + AILoseScript.Dispose(); + AIWinScript.Dispose(); + AIWin_FullComboScript.Dispose(); + AIWin_PerfectScript.Dispose(); + } else { + FailedScript.Dispose(); + ClearScript.Dispose(); + FullComboScript.Dispose(); + PerfectComboScript.Dispose(); } - #region [effects] - // ------------------------------------ - private void showEndEffect_Failed(int i) { - if (!OpenTaiko.stage演奏ドラム画面.bPAUSE) FailedScript.Update(i); - FailedScript.Draw(i); + base.DeActivate(); + } - int[] y = new int[] { 0, 176 }; + public override void CreateManagedResource() { + this.b再生済み = false; - /* + this.soundTowerDropout = OpenTaiko.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}Tower{Path.DirectorySeparatorChar}Tower_Dropout.ogg"), ESoundGroup.SoundEffect); + this.soundTowerTopPass = OpenTaiko.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}Tower{Path.DirectorySeparatorChar}Tower_TopReached_Pass.ogg"), ESoundGroup.SoundEffect); + this.soundTowerTopFC = OpenTaiko.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}Tower{Path.DirectorySeparatorChar}Tower_TopReached_FullCombo.ogg"), ESoundGroup.SoundEffect); + this.soundTowerTopPerfect = OpenTaiko.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}Tower{Path.DirectorySeparatorChar}Tower_TopReached_Perfect.ogg"), ESoundGroup.SoundEffect); - this.ctEnd_ClearFailed.t進行(); - if (this.ctEnd_ClearFailed.n現在の値 <= 20 || TJAPlayer3.Tx.ClearFailed == null) - { - TJAPlayer3.Tx.End_ClearFailed[Math.Min(this.ctEnd_ClearFailed.n現在の値, TJAPlayer3.Tx.End_ClearFailed.Length - 1)]?.t2D描画(505, y[i] + 145); - } - else if (this.ctEnd_ClearFailed.n現在の値 >= 20 && this.ctEnd_ClearFailed.n現在の値 <= 67) - { - TJAPlayer3.Tx.ClearFailed?.t2D描画(502, y[i] + 192); - } - else if (this.ctEnd_ClearFailed.n現在の値 == 68) - { - TJAPlayer3.Tx.ClearFailed1?.t2D描画(502, y[i] + 192); - } - else if (this.ctEnd_ClearFailed.n現在の値 >= 69) - { - TJAPlayer3.Tx.ClearFailed2?.t2D描画(502, y[i] + 192); - } - */ + this.soundDanFailed = OpenTaiko.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}Dan{Path.DirectorySeparatorChar}Dan_Fail.ogg"), ESoundGroup.SoundEffect); + this.soundDanRedClear = OpenTaiko.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}Dan{Path.DirectorySeparatorChar}Dan_Red_Pass.ogg"), ESoundGroup.SoundEffect); + this.soundDanRedFC = OpenTaiko.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}Dan{Path.DirectorySeparatorChar}Dan_Red_FullCombo.ogg"), ESoundGroup.SoundEffect); + this.soundDanRedPerfect = OpenTaiko.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}Dan{Path.DirectorySeparatorChar}Dan_Red_Perfect.ogg"), ESoundGroup.SoundEffect); + this.soundDanGoldClear = OpenTaiko.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}Dan{Path.DirectorySeparatorChar}Dan_Gold_Pass.ogg"), ESoundGroup.SoundEffect); + this.soundDanGoldFC = OpenTaiko.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}Dan{Path.DirectorySeparatorChar}Dan_Gold_FullCombo.ogg"), ESoundGroup.SoundEffect); + this.soundDanGoldPerfect = OpenTaiko.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}Dan{Path.DirectorySeparatorChar}Dan_Gold_Perfect.ogg"), ESoundGroup.SoundEffect); + + this.soundAILose = OpenTaiko.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}AIBattle_Lose.ogg"), ESoundGroup.SoundEffect); + this.soundAIWin = OpenTaiko.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}AIBattle_Win.ogg"), ESoundGroup.SoundEffect); + this.soundAIWinFullCombo = OpenTaiko.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}AIBattle_Win_FullCombo.ogg"), ESoundGroup.SoundEffect); + this.soundAIWinPerfectCombo = OpenTaiko.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}AIBattle_Win_AllPerfect.ogg"), ESoundGroup.SoundEffect); + for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { + this.soundClear[i] = OpenTaiko.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}Clear.ogg"), ESoundGroup.SoundEffect); + this.soundFailed[i] = OpenTaiko.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}Failed.ogg"), ESoundGroup.SoundEffect); + this.soundFullCombo[i] = OpenTaiko.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}FullCombo.ogg"), ESoundGroup.SoundEffect); + this.soundPerfectCombo[i] = OpenTaiko.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}AllPerfect.ogg"), ESoundGroup.SoundEffect); } - private void showEndEffect_Clear(int i) { - if (!OpenTaiko.stage演奏ドラム画面.bPAUSE) ClearScript.Update(i); - ClearScript.Draw(i); - /* - int[] y = new int[] { 210, 386 }; - #region[ 文字 ] - //登場アニメは20フレーム。うち最初の5フレームは半透過状態。 - float[] f文字拡大率 = new float[] { 1.04f, 1.11f, 1.15f, 1.19f, 1.23f, 1.26f, 1.30f, 1.31f, 1.32f, 1.32f, 1.32f, 1.30f, 1.30f, 1.26f, 1.25f, 1.19f, 1.15f, 1.11f, 1.05f, 1.0f }; - int[] n透明度 = new int[] { 43, 85, 128, 170, 213, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }; + base.CreateManagedResource(); + } - if (TJAPlayer3.Tx.End_Clear_Text_ != null) + public override void ReleaseManagedResource() { + this.soundTowerDropout?.tDispose(); + this.soundTowerTopPass?.tDispose(); + this.soundTowerTopFC?.tDispose(); + this.soundTowerTopPerfect?.tDispose(); + + this.soundDanFailed?.tDispose(); + this.soundDanRedClear?.tDispose(); + this.soundDanRedFC?.tDispose(); + this.soundDanRedPerfect?.tDispose(); + this.soundDanGoldClear?.tDispose(); + this.soundDanGoldFC?.tDispose(); + this.soundDanGoldPerfect?.tDispose(); + + this.soundAILose?.tDispose(); + this.soundAIWin?.tDispose(); + this.soundAIWinFullCombo?.tDispose(); + this.soundAIWinPerfectCombo?.tDispose(); + + for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { + this.soundClear[i]?.tDispose(); + this.soundFailed[i]?.tDispose(); + this.soundFullCombo[i]?.tDispose(); + this.soundPerfectCombo[i]?.tDispose(); + } + + base.ReleaseManagedResource(); + } + + #region [effects] + // ------------------------------------ + private void showEndEffect_Failed(int i) { + if (!OpenTaiko.stage演奏ドラム画面.bPAUSE) FailedScript.Update(i); + FailedScript.Draw(i); + + int[] y = new int[] { 0, 176 }; + + /* + + this.ctEnd_ClearFailed.t進行(); + if (this.ctEnd_ClearFailed.n現在の値 <= 20 || TJAPlayer3.Tx.ClearFailed == null) + { + TJAPlayer3.Tx.End_ClearFailed[Math.Min(this.ctEnd_ClearFailed.n現在の値, TJAPlayer3.Tx.End_ClearFailed.Length - 1)]?.t2D描画(505, y[i] + 145); + } + else if (this.ctEnd_ClearFailed.n現在の値 >= 20 && this.ctEnd_ClearFailed.n現在の値 <= 67) + { + TJAPlayer3.Tx.ClearFailed?.t2D描画(502, y[i] + 192); + } + else if (this.ctEnd_ClearFailed.n現在の値 == 68) + { + TJAPlayer3.Tx.ClearFailed1?.t2D描画(502, y[i] + 192); + } + else if (this.ctEnd_ClearFailed.n現在の値 >= 69) + { + TJAPlayer3.Tx.ClearFailed2?.t2D描画(502, y[i] + 192); + } + */ + } + private void showEndEffect_Clear(int i) { + if (!OpenTaiko.stage演奏ドラム画面.bPAUSE) ClearScript.Update(i); + ClearScript.Draw(i); + + /* + int[] y = new int[] { 210, 386 }; + #region[ 文字 ] + //登場アニメは20フレーム。うち最初の5フレームは半透過状態。 + float[] f文字拡大率 = new float[] { 1.04f, 1.11f, 1.15f, 1.19f, 1.23f, 1.26f, 1.30f, 1.31f, 1.32f, 1.32f, 1.32f, 1.30f, 1.30f, 1.26f, 1.25f, 1.19f, 1.15f, 1.11f, 1.05f, 1.0f }; + int[] n透明度 = new int[] { 43, 85, 128, 170, 213, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }; + + if (TJAPlayer3.Tx.End_Clear_Text_ != null) + { + if (this.ct進行メイン.n現在の値 >= 17) { - if (this.ct進行メイン.n現在の値 >= 17) + if (this.ct進行メイン.n現在の値 <= 36) { - if (this.ct進行メイン.n現在の値 <= 36) + TJAPlayer3.Tx.End_Clear_Text_.vc拡大縮小倍率.Y = f文字拡大率[this.ct進行メイン.n現在の値 - 17]; + TJAPlayer3.Tx.End_Clear_Text_.Opacity = n透明度[this.ct進行メイン.n現在の値 - 17]; + TJAPlayer3.Tx.End_Clear_Text_.t2D描画(634, (int)(y[i] - ((90 * f文字拡大率[this.ct進行メイン.n現在の値 - 17]) - 90)), new Rectangle(0, 0, 90, 90)); + } + else + { + TJAPlayer3.Tx.End_Clear_Text_.vc拡大縮小倍率.Y = 1.0f; + TJAPlayer3.Tx.End_Clear_Text_.t2D描画(634, y[i], new Rectangle(0, 0, 90, 90)); + } + } + if (this.ct進行メイン.n現在の値 >= 19) + { + if (this.ct進行メイン.n現在の値 <= 38) + { + TJAPlayer3.Tx.End_Clear_Text_.vc拡大縮小倍率.Y = f文字拡大率[this.ct進行メイン.n現在の値 - 19]; + TJAPlayer3.Tx.End_Clear_Text_.Opacity = n透明度[this.ct進行メイン.n現在の値 - 19]; + TJAPlayer3.Tx.End_Clear_Text_.t2D描画(692, (int)(y[i] - ((90 * f文字拡大率[this.ct進行メイン.n現在の値 - 19]) - 90)), new Rectangle(90, 0, 90, 90)); + } + else + { + TJAPlayer3.Tx.End_Clear_Text_.vc拡大縮小倍率.Y = 1.0f; + TJAPlayer3.Tx.End_Clear_Text_.t2D描画(692, y[i], new Rectangle(90, 0, 90, 90)); + } + } + TJAPlayer3.Tx.End_Clear_Text_.vc拡大縮小倍率.Y = 1.0f; + if (this.ct進行メイン.n現在の値 >= 21) + { + if (this.ct進行メイン.n現在の値 <= 40) + { + TJAPlayer3.Tx.End_Clear_Text_.vc拡大縮小倍率.Y = f文字拡大率[this.ct進行メイン.n現在の値 - 21]; + TJAPlayer3.Tx.End_Clear_Text_.Opacity = n透明度[this.ct進行メイン.n現在の値 - 21]; + TJAPlayer3.Tx.End_Clear_Text_.t2D描画(750, y[i] - (int)((90 * f文字拡大率[this.ct進行メイン.n現在の値 - 21]) - 90), new Rectangle(180, 0, 90, 90)); + } + else + { + TJAPlayer3.Tx.End_Clear_Text_.vc拡大縮小倍率.Y = 1.0f; + TJAPlayer3.Tx.End_Clear_Text_.t2D描画(750, y[i], new Rectangle(180, 0, 90, 90)); + } + } + if (this.ct進行メイン.n現在の値 >= 23) + { + if (this.ct進行メイン.n現在の値 <= 42) + { + TJAPlayer3.Tx.End_Clear_Text_.vc拡大縮小倍率.Y = f文字拡大率[this.ct進行メイン.n現在の値 - 23]; + TJAPlayer3.Tx.End_Clear_Text_.Opacity = n透明度[this.ct進行メイン.n現在の値 - 23]; + TJAPlayer3.Tx.End_Clear_Text_.t2D描画(819, y[i] - (int)((90 * f文字拡大率[this.ct進行メイン.n現在の値 - 23]) - 90), new Rectangle(270, 0, 90, 90)); + } + else + { + TJAPlayer3.Tx.End_Clear_Text_.vc拡大縮小倍率.Y = 1.0f; + TJAPlayer3.Tx.End_Clear_Text_.t2D描画(819, y[i], new Rectangle(270, 0, 90, 90)); + } + } + if (this.ct進行メイン.n現在の値 >= 25) + { + if (this.ct進行メイン.n現在の値 <= 44) + { + TJAPlayer3.Tx.End_Clear_Text_.vc拡大縮小倍率.Y = f文字拡大率[this.ct進行メイン.n現在の値 - 25]; + TJAPlayer3.Tx.End_Clear_Text_.Opacity = n透明度[this.ct進行メイン.n現在の値 - 25]; + TJAPlayer3.Tx.End_Clear_Text_.t2D描画(890, (y[i] + 2) - (int)((90 * f文字拡大率[this.ct進行メイン.n現在の値 - 25]) - 90), new Rectangle(360, 0, 90, 90)); + } + else + { + TJAPlayer3.Tx.End_Clear_Text_.vc拡大縮小倍率.Y = 1.0f; + TJAPlayer3.Tx.End_Clear_Text_.t2D描画(890, y[i] + 2, new Rectangle(360, 0, 90, 90)); + } + } + if (this.ct進行メイン.n現在の値 >= 50 && this.ct進行メイン.n現在の値 < 90) + { + if (TJAPlayer3.Tx.End_Clear_Text_Effect != null) + { + if (this.ct進行メイン.n現在の値 < 70) { - TJAPlayer3.Tx.End_Clear_Text_.vc拡大縮小倍率.Y = f文字拡大率[this.ct進行メイン.n現在の値 - 17]; - TJAPlayer3.Tx.End_Clear_Text_.Opacity = n透明度[this.ct進行メイン.n現在の値 - 17]; - TJAPlayer3.Tx.End_Clear_Text_.t2D描画(634, (int)(y[i] - ((90 * f文字拡大率[this.ct進行メイン.n現在の値 - 17]) - 90)), new Rectangle(0, 0, 90, 90)); + TJAPlayer3.Tx.End_Clear_Text_Effect.Opacity = (this.ct進行メイン.n現在の値 - 50) * (255 / 20); + TJAPlayer3.Tx.End_Clear_Text_Effect.t2D描画(634, y[i] - 2); } else { - TJAPlayer3.Tx.End_Clear_Text_.vc拡大縮小倍率.Y = 1.0f; - TJAPlayer3.Tx.End_Clear_Text_.t2D描画(634, y[i], new Rectangle(0, 0, 90, 90)); + TJAPlayer3.Tx.End_Clear_Text_Effect.Opacity = 255 - ((this.ct進行メイン.n現在の値 - 70) * (255 / 20)); + TJAPlayer3.Tx.End_Clear_Text_Effect.t2D描画(634, y[i] - 2); } } - if (this.ct進行メイン.n現在の値 >= 19) - { - if (this.ct進行メイン.n現在の値 <= 38) - { - TJAPlayer3.Tx.End_Clear_Text_.vc拡大縮小倍率.Y = f文字拡大率[this.ct進行メイン.n現在の値 - 19]; - TJAPlayer3.Tx.End_Clear_Text_.Opacity = n透明度[this.ct進行メイン.n現在の値 - 19]; - TJAPlayer3.Tx.End_Clear_Text_.t2D描画(692, (int)(y[i] - ((90 * f文字拡大率[this.ct進行メイン.n現在の値 - 19]) - 90)), new Rectangle(90, 0, 90, 90)); - } - else - { - TJAPlayer3.Tx.End_Clear_Text_.vc拡大縮小倍率.Y = 1.0f; - TJAPlayer3.Tx.End_Clear_Text_.t2D描画(692, y[i], new Rectangle(90, 0, 90, 90)); - } - } - TJAPlayer3.Tx.End_Clear_Text_.vc拡大縮小倍率.Y = 1.0f; - if (this.ct進行メイン.n現在の値 >= 21) - { - if (this.ct進行メイン.n現在の値 <= 40) - { - TJAPlayer3.Tx.End_Clear_Text_.vc拡大縮小倍率.Y = f文字拡大率[this.ct進行メイン.n現在の値 - 21]; - TJAPlayer3.Tx.End_Clear_Text_.Opacity = n透明度[this.ct進行メイン.n現在の値 - 21]; - TJAPlayer3.Tx.End_Clear_Text_.t2D描画(750, y[i] - (int)((90 * f文字拡大率[this.ct進行メイン.n現在の値 - 21]) - 90), new Rectangle(180, 0, 90, 90)); - } - else - { - TJAPlayer3.Tx.End_Clear_Text_.vc拡大縮小倍率.Y = 1.0f; - TJAPlayer3.Tx.End_Clear_Text_.t2D描画(750, y[i], new Rectangle(180, 0, 90, 90)); - } - } - if (this.ct進行メイン.n現在の値 >= 23) - { - if (this.ct進行メイン.n現在の値 <= 42) - { - TJAPlayer3.Tx.End_Clear_Text_.vc拡大縮小倍率.Y = f文字拡大率[this.ct進行メイン.n現在の値 - 23]; - TJAPlayer3.Tx.End_Clear_Text_.Opacity = n透明度[this.ct進行メイン.n現在の値 - 23]; - TJAPlayer3.Tx.End_Clear_Text_.t2D描画(819, y[i] - (int)((90 * f文字拡大率[this.ct進行メイン.n現在の値 - 23]) - 90), new Rectangle(270, 0, 90, 90)); - } - else - { - TJAPlayer3.Tx.End_Clear_Text_.vc拡大縮小倍率.Y = 1.0f; - TJAPlayer3.Tx.End_Clear_Text_.t2D描画(819, y[i], new Rectangle(270, 0, 90, 90)); - } - } - if (this.ct進行メイン.n現在の値 >= 25) - { - if (this.ct進行メイン.n現在の値 <= 44) - { - TJAPlayer3.Tx.End_Clear_Text_.vc拡大縮小倍率.Y = f文字拡大率[this.ct進行メイン.n現在の値 - 25]; - TJAPlayer3.Tx.End_Clear_Text_.Opacity = n透明度[this.ct進行メイン.n現在の値 - 25]; - TJAPlayer3.Tx.End_Clear_Text_.t2D描画(890, (y[i] + 2) - (int)((90 * f文字拡大率[this.ct進行メイン.n現在の値 - 25]) - 90), new Rectangle(360, 0, 90, 90)); - } - else - { - TJAPlayer3.Tx.End_Clear_Text_.vc拡大縮小倍率.Y = 1.0f; - TJAPlayer3.Tx.End_Clear_Text_.t2D描画(890, y[i] + 2, new Rectangle(360, 0, 90, 90)); - } - } - if (this.ct進行メイン.n現在の値 >= 50 && this.ct進行メイン.n現在の値 < 90) - { - if (TJAPlayer3.Tx.End_Clear_Text_Effect != null) - { - if (this.ct進行メイン.n現在の値 < 70) - { - TJAPlayer3.Tx.End_Clear_Text_Effect.Opacity = (this.ct進行メイン.n現在の値 - 50) * (255 / 20); - TJAPlayer3.Tx.End_Clear_Text_Effect.t2D描画(634, y[i] - 2); - } - else - { - TJAPlayer3.Tx.End_Clear_Text_Effect.Opacity = 255 - ((this.ct進行メイン.n現在の値 - 70) * (255 / 20)); - TJAPlayer3.Tx.End_Clear_Text_Effect.t2D描画(634, y[i] - 2); - } - } - - } - } - + } + } - #endregion - - #region[ バチお ] - - if (this.ct進行メイン.n現在の値 <= 11) - { - if (TJAPlayer3.Tx.End_Clear_L[1] != null) - { - TJAPlayer3.Tx.End_Clear_L[1].t2D描画(697, y[i] - 30); - TJAPlayer3.Tx.End_Clear_L[1].Opacity = (int)(11.0 / this.ct進行メイン.n現在の値) * 255; - } - if (TJAPlayer3.Tx.End_Clear_R[1] != null) - { - TJAPlayer3.Tx.End_Clear_R[1].t2D描画(738, y[i] - 30); - TJAPlayer3.Tx.End_Clear_R[1].Opacity = (int)(11.0 / this.ct進行メイン.n現在の値) * 255; - } - } - else if (this.ct進行メイン.n現在の値 <= 35) - { - if (TJAPlayer3.Tx.End_Clear_L[0] != null) - TJAPlayer3.Tx.End_Clear_L[0].t2D描画(697 - (int)((this.ct進行メイン.n現在の値 - 12) * 10), y[i] - 30); - if (TJAPlayer3.Tx.End_Clear_R[0] != null) - TJAPlayer3.Tx.End_Clear_R[0].t2D描画(738 + (int)((this.ct進行メイン.n現在の値 - 12) * 10), y[i] - 30); - } - else if (this.ct進行メイン.n現在の値 <= 46) - { - if (TJAPlayer3.Tx.End_Clear_L[0] != null) - { - //2016.07.16 kairera0467 またも原始的... - float[] fRet = new float[] { 1.0f, 0.99f, 0.98f, 0.97f, 0.96f, 0.95f, 0.96f, 0.97f, 0.98f, 0.99f, 1.0f }; - TJAPlayer3.Tx.End_Clear_L[0].t2D描画(466, y[i] - 30); - TJAPlayer3.Tx.End_Clear_L[0].vc拡大縮小倍率 = new Vector3(fRet[this.ct進行メイン.n現在の値 - 36], 1.0f, 1.0f); - //CDTXMania.Tx.End_Clear_R[ 0 ].t2D描画( CDTXMania.app.Device, 956 + (( this.ct進行メイン.n現在の値 - 36 ) / 2), 180 ); - TJAPlayer3.Tx.End_Clear_R[0].t2D描画(1136 - 180 * fRet[this.ct進行メイン.n現在の値 - 36], y[i] - 30); - TJAPlayer3.Tx.End_Clear_R[0].vc拡大縮小倍率 = new Vector3(fRet[this.ct進行メイン.n現在の値 - 36], 1.0f, 1.0f); - } - } - else if (this.ct進行メイン.n現在の値 <= 49) - { - if (TJAPlayer3.Tx.End_Clear_L[1] != null) - TJAPlayer3.Tx.End_Clear_L[1].t2D描画(466, y[i] - 30); - if (TJAPlayer3.Tx.End_Clear_R[1] != null) - TJAPlayer3.Tx.End_Clear_R[1].t2D描画(956, y[i] - 30); - } - else if (this.ct進行メイン.n現在の値 <= 54) - { - if (TJAPlayer3.Tx.End_Clear_L[2] != null) - TJAPlayer3.Tx.End_Clear_L[2].t2D描画(466, y[i] - 30); - if (TJAPlayer3.Tx.End_Clear_R[2] != null) - TJAPlayer3.Tx.End_Clear_R[2].t2D描画(956, y[i] - 30); - } - else if (this.ct進行メイン.n現在の値 <= 58) - { - if (TJAPlayer3.Tx.End_Clear_L[3] != null) - TJAPlayer3.Tx.End_Clear_L[3].t2D描画(466, y[i] - 30); - if (TJAPlayer3.Tx.End_Clear_R[3] != null) - TJAPlayer3.Tx.End_Clear_R[3].t2D描画(956, y[i] - 30); - } - else - { - if (TJAPlayer3.Tx.End_Clear_L[4] != null) - TJAPlayer3.Tx.End_Clear_L[4].t2D描画(466, y[i] - 30); - if (TJAPlayer3.Tx.End_Clear_R[4] != null) - TJAPlayer3.Tx.End_Clear_R[4].t2D描画(956, y[i] - 30); - } - #endregion - */ + #endregion + + #region[ バチお ] + + if (this.ct進行メイン.n現在の値 <= 11) + { + if (TJAPlayer3.Tx.End_Clear_L[1] != null) + { + TJAPlayer3.Tx.End_Clear_L[1].t2D描画(697, y[i] - 30); + TJAPlayer3.Tx.End_Clear_L[1].Opacity = (int)(11.0 / this.ct進行メイン.n現在の値) * 255; + } + if (TJAPlayer3.Tx.End_Clear_R[1] != null) + { + TJAPlayer3.Tx.End_Clear_R[1].t2D描画(738, y[i] - 30); + TJAPlayer3.Tx.End_Clear_R[1].Opacity = (int)(11.0 / this.ct進行メイン.n現在の値) * 255; + } + } + else if (this.ct進行メイン.n現在の値 <= 35) + { + if (TJAPlayer3.Tx.End_Clear_L[0] != null) + TJAPlayer3.Tx.End_Clear_L[0].t2D描画(697 - (int)((this.ct進行メイン.n現在の値 - 12) * 10), y[i] - 30); + if (TJAPlayer3.Tx.End_Clear_R[0] != null) + TJAPlayer3.Tx.End_Clear_R[0].t2D描画(738 + (int)((this.ct進行メイン.n現在の値 - 12) * 10), y[i] - 30); + } + else if (this.ct進行メイン.n現在の値 <= 46) + { + if (TJAPlayer3.Tx.End_Clear_L[0] != null) + { + //2016.07.16 kairera0467 またも原始的... + float[] fRet = new float[] { 1.0f, 0.99f, 0.98f, 0.97f, 0.96f, 0.95f, 0.96f, 0.97f, 0.98f, 0.99f, 1.0f }; + TJAPlayer3.Tx.End_Clear_L[0].t2D描画(466, y[i] - 30); + TJAPlayer3.Tx.End_Clear_L[0].vc拡大縮小倍率 = new Vector3(fRet[this.ct進行メイン.n現在の値 - 36], 1.0f, 1.0f); + //CDTXMania.Tx.End_Clear_R[ 0 ].t2D描画( CDTXMania.app.Device, 956 + (( this.ct進行メイン.n現在の値 - 36 ) / 2), 180 ); + TJAPlayer3.Tx.End_Clear_R[0].t2D描画(1136 - 180 * fRet[this.ct進行メイン.n現在の値 - 36], y[i] - 30); + TJAPlayer3.Tx.End_Clear_R[0].vc拡大縮小倍率 = new Vector3(fRet[this.ct進行メイン.n現在の値 - 36], 1.0f, 1.0f); + } + } + else if (this.ct進行メイン.n現在の値 <= 49) + { + if (TJAPlayer3.Tx.End_Clear_L[1] != null) + TJAPlayer3.Tx.End_Clear_L[1].t2D描画(466, y[i] - 30); + if (TJAPlayer3.Tx.End_Clear_R[1] != null) + TJAPlayer3.Tx.End_Clear_R[1].t2D描画(956, y[i] - 30); + } + else if (this.ct進行メイン.n現在の値 <= 54) + { + if (TJAPlayer3.Tx.End_Clear_L[2] != null) + TJAPlayer3.Tx.End_Clear_L[2].t2D描画(466, y[i] - 30); + if (TJAPlayer3.Tx.End_Clear_R[2] != null) + TJAPlayer3.Tx.End_Clear_R[2].t2D描画(956, y[i] - 30); + } + else if (this.ct進行メイン.n現在の値 <= 58) + { + if (TJAPlayer3.Tx.End_Clear_L[3] != null) + TJAPlayer3.Tx.End_Clear_L[3].t2D描画(466, y[i] - 30); + if (TJAPlayer3.Tx.End_Clear_R[3] != null) + TJAPlayer3.Tx.End_Clear_R[3].t2D描画(956, y[i] - 30); + } + else + { + if (TJAPlayer3.Tx.End_Clear_L[4] != null) + TJAPlayer3.Tx.End_Clear_L[4].t2D描画(466, y[i] - 30); + if (TJAPlayer3.Tx.End_Clear_R[4] != null) + TJAPlayer3.Tx.End_Clear_R[4].t2D描画(956, y[i] - 30); + } + + #endregion + + */ + } + + private void showEndEffect_FullCombo(int i) { + if (!OpenTaiko.stage演奏ドラム画面.bPAUSE) FullComboScript.Update(i); + FullComboScript.Draw(i); + + /* + int[] y = new int[] { 0, 176 }; + + this.ctEnd_FullCombo.t進行(); + TJAPlayer3.Tx.End_FullCombo[this.ctEnd_FullCombo.n現在の値]?.t2D描画(330, y[i] + 50); + + if (this.ctEnd_FullCombo.b終了値に達した && TJAPlayer3.Tx.End_FullComboLoop[0] != null) + { + this.ctEnd_FullComboLoop.t進行Loop(); + TJAPlayer3.Tx.End_FullComboLoop[this.ctEnd_FullComboLoop.n現在の値]?.t2D描画(330, y[i] + 196); + } + */ + } + + private void showEndEffect_PerfectCombo(int i) { + if (!OpenTaiko.stage演奏ドラム画面.bPAUSE) PerfectComboScript.Update(i); + PerfectComboScript.Draw(i); + + /* + int[] y = new int[] { 0, 176 }; + + this.ctEnd_DondaFullCombo.t進行(); + if (this.ctEnd_DondaFullCombo.n現在の値 >= 34) TJAPlayer3.Tx.End_DondaFullComboBg?.t2D描画(332, y[i] + 192); + TJAPlayer3.Tx.End_DondaFullCombo[this.ctEnd_DondaFullCombo.n現在の値]?.t2D描画(330, y[i] + 50); + + /* + if (this.ctEnd_DondaFullCombo.b終了値に達した) + { + this.ctEnd_DondaFullComboLoop.t進行Loop(); + TJAPlayer3.Tx.End_DondaFullComboLoop[this.ctEnd_DondaFullComboLoop.n現在の値].t2D描画(330, 196); + } + */ + } + // ------------------------------------ + #endregion + + public override int Draw() { + if (base.IsFirstDraw) { + base.IsFirstDraw = false; } + if (this.ct進行メイン != null && (OpenTaiko.stage演奏ドラム画面.ePhaseID == CStage.EPhase.Game_EndStage || OpenTaiko.stage演奏ドラム画面.ePhaseID == CStage.EPhase.Game_STAGE_FAILED || OpenTaiko.stage演奏ドラム画面.ePhaseID == CStage.EPhase.Game_STAGE_CLEAR_FadeOut)) { + this.ct進行メイン.Tick(); - private void showEndEffect_FullCombo(int i) { - if (!OpenTaiko.stage演奏ドラム画面.bPAUSE) FullComboScript.Update(i); - FullComboScript.Draw(i); - - /* - int[] y = new int[] { 0, 176 }; - - this.ctEnd_FullCombo.t進行(); - TJAPlayer3.Tx.End_FullCombo[this.ctEnd_FullCombo.n現在の値]?.t2D描画(330, y[i] + 50); - - if (this.ctEnd_FullCombo.b終了値に達した && TJAPlayer3.Tx.End_FullComboLoop[0] != null) - { - this.ctEnd_FullComboLoop.t進行Loop(); - TJAPlayer3.Tx.End_FullComboLoop[this.ctEnd_FullComboLoop.n現在の値]?.t2D描画(330, y[i] + 196); - } - */ - } - - private void showEndEffect_PerfectCombo(int i) { - if (!OpenTaiko.stage演奏ドラム画面.bPAUSE) PerfectComboScript.Update(i); - PerfectComboScript.Draw(i); - - /* - int[] y = new int[] { 0, 176 }; - - this.ctEnd_DondaFullCombo.t進行(); - if (this.ctEnd_DondaFullCombo.n現在の値 >= 34) TJAPlayer3.Tx.End_DondaFullComboBg?.t2D描画(332, y[i] + 192); - TJAPlayer3.Tx.End_DondaFullCombo[this.ctEnd_DondaFullCombo.n現在の値]?.t2D描画(330, y[i] + 50); - - /* - if (this.ctEnd_DondaFullCombo.b終了値に達した) - { - this.ctEnd_DondaFullComboLoop.t進行Loop(); - TJAPlayer3.Tx.End_DondaFullComboLoop[this.ctEnd_DondaFullComboLoop.n現在の値].t2D描画(330, 196); - } - */ - } - // ------------------------------------ - #endregion - - public override int Draw() { - if (base.IsFirstDraw) { - base.IsFirstDraw = false; - } - if (this.ct進行メイン != null && (OpenTaiko.stage演奏ドラム画面.ePhaseID == CStage.EPhase.Game_EndStage || OpenTaiko.stage演奏ドラム画面.ePhaseID == CStage.EPhase.Game_STAGE_FAILED || OpenTaiko.stage演奏ドラム画面.ePhaseID == CStage.EPhase.Game_STAGE_CLEAR_FadeOut)) { - this.ct進行メイン.Tick(); - - //CDTXMania.act文字コンソール.tPrint( 0, 0, C文字コンソール.Eフォント種別.灰, this.ct進行メイン.n現在の値.ToString() ); - //仮置き - - if (!bSongsPlayed) { - for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { - if (i == 1 && OpenTaiko.ConfigIni.bAIBattleMode) break; - - switch (this.Mode[i]) { - case EndMode.StageFailed: - FailedScript.PlayEndAnime(i); - this.soundFailed[i]?.PlayStart(); - OpenTaiko.Skin.voiceClearFailed[OpenTaiko.GetActualPlayer(i)]?.tPlay(); - break; - case EndMode.StageCleared: - ClearScript.PlayEndAnime(i); - this.soundClear[i]?.PlayStart(); - OpenTaiko.Skin.voiceClearClear[OpenTaiko.GetActualPlayer(i)]?.tPlay(); - break; - case EndMode.StageFullCombo: - FullComboScript.PlayEndAnime(i); - this.soundFullCombo[i]?.PlayStart(); - OpenTaiko.Skin.voiceClearFullCombo[OpenTaiko.GetActualPlayer(i)]?.tPlay(); - break; - case EndMode.StagePerfectCombo: - PerfectComboScript.PlayEndAnime(i); - this.soundPerfectCombo[i]?.PlayStart(); - OpenTaiko.Skin.voiceClearAllPerfect[OpenTaiko.GetActualPlayer(i)]?.tPlay(); - break; - - case EndMode.AI_Lose: - AILoseScript.PlayEndAnime(i); - this.soundAILose?.PlayStart(); - OpenTaiko.Skin.voiceAILose[OpenTaiko.GetActualPlayer(1)]?.tPlay(); - break; - case EndMode.AI_Win: - AIWinScript.PlayEndAnime(i); - this.soundAIWin?.PlayStart(); - OpenTaiko.Skin.voiceAIWin[OpenTaiko.GetActualPlayer(i)]?.tPlay(); - break; - case EndMode.AI_Win_FullCombo: - AIWin_FullComboScript.PlayEndAnime(i); - this.soundAIWinFullCombo?.PlayStart(); - OpenTaiko.Skin.voiceAIWin[OpenTaiko.GetActualPlayer(i)]?.tPlay(); - break; - case EndMode.AI_Win_Perfect: - AIWin_PerfectScript.PlayEndAnime(i); - this.soundAIWinPerfectCombo?.PlayStart(); - OpenTaiko.Skin.voiceAIWin[OpenTaiko.GetActualPlayer(i)]?.tPlay(); - break; - - case EndMode.Tower_Dropout: - Tower_DropoutScript.PlayEndAnime(i); - this.soundTowerDropout?.PlayStart(); - OpenTaiko.Skin.voiceClearFailed[OpenTaiko.GetActualPlayer(i)]?.tPlay(); - break; - case EndMode.Tower_TopReached_Pass: - Tower_TopReached_PassScript.PlayEndAnime(i); - this.soundTowerTopPass?.PlayStart(); - OpenTaiko.Skin.voiceClearClear[OpenTaiko.GetActualPlayer(i)]?.tPlay(); - break; - case EndMode.Tower_TopReached_FullCombo: - Tower_TopReached_FullComboScript.PlayEndAnime(i); - this.soundTowerTopFC?.PlayStart(); - OpenTaiko.Skin.voiceClearFullCombo[OpenTaiko.GetActualPlayer(i)]?.tPlay(); - break; - case EndMode.Tower_TopReached_Perfect: - Tower_TopReached_PerfectScript.PlayEndAnime(i); - this.soundTowerTopPerfect?.PlayStart(); - OpenTaiko.Skin.voiceClearAllPerfect[OpenTaiko.GetActualPlayer(i)]?.tPlay(); - break; - - case EndMode.Dan_Fail: - Dan_FailScript.PlayEndAnime(i); - this.soundDanFailed?.PlayStart(); - OpenTaiko.Skin.voiceClearFailed[OpenTaiko.GetActualPlayer(i)]?.tPlay(); - break; - case EndMode.Dan_Red_Pass: - Dan_Red_PassScript.PlayEndAnime(i); - this.soundDanRedClear?.PlayStart(); - OpenTaiko.Skin.voiceClearClear[OpenTaiko.GetActualPlayer(i)]?.tPlay(); - break; - case EndMode.Dan_Red_FullCombo: - Dan_Red_FullComboScript.PlayEndAnime(i); - this.soundDanRedFC?.PlayStart(); - OpenTaiko.Skin.voiceClearFullCombo[OpenTaiko.GetActualPlayer(i)]?.tPlay(); - break; - case EndMode.Dan_Red_Perfect: - Dan_Red_PerfectScript.PlayEndAnime(i); - this.soundDanRedPerfect?.PlayStart(); - OpenTaiko.Skin.voiceClearAllPerfect[OpenTaiko.GetActualPlayer(i)]?.tPlay(); - break; - case EndMode.Dan_Gold_Pass: - Dan_Gold_PassScript.PlayEndAnime(i); - this.soundDanGoldClear?.PlayStart(); - OpenTaiko.Skin.voiceClearClear[OpenTaiko.GetActualPlayer(i)]?.tPlay(); - break; - case EndMode.Dan_Gold_FullCombo: - Dan_Gold_FullComboScript.PlayEndAnime(i); - this.soundDanGoldFC?.PlayStart(); - OpenTaiko.Skin.voiceClearFullCombo[OpenTaiko.GetActualPlayer(i)]?.tPlay(); - break; - case EndMode.Dan_Gold_Perfect: - Dan_Gold_PerfectScript.PlayEndAnime(i); - this.soundDanGoldPerfect?.PlayStart(); - OpenTaiko.Skin.voiceClearAllPerfect[OpenTaiko.GetActualPlayer(i)]?.tPlay(); - break; - - default: - break; - } - } - - bSongsPlayed = true; - } - + //CDTXMania.act文字コンソール.tPrint( 0, 0, C文字コンソール.Eフォント種別.灰, this.ct進行メイン.n現在の値.ToString() ); + //仮置き + if (!bSongsPlayed) { for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { if (i == 1 && OpenTaiko.ConfigIni.bAIBattleMode) break; switch (this.Mode[i]) { case EndMode.StageFailed: - this.showEndEffect_Failed(i); + FailedScript.PlayEndAnime(i); + this.soundFailed[i]?.PlayStart(); + OpenTaiko.Skin.voiceClearFailed[OpenTaiko.GetActualPlayer(i)]?.tPlay(); break; case EndMode.StageCleared: - this.showEndEffect_Clear(i); + ClearScript.PlayEndAnime(i); + this.soundClear[i]?.PlayStart(); + OpenTaiko.Skin.voiceClearClear[OpenTaiko.GetActualPlayer(i)]?.tPlay(); break; case EndMode.StageFullCombo: - this.showEndEffect_FullCombo(i); + FullComboScript.PlayEndAnime(i); + this.soundFullCombo[i]?.PlayStart(); + OpenTaiko.Skin.voiceClearFullCombo[OpenTaiko.GetActualPlayer(i)]?.tPlay(); break; case EndMode.StagePerfectCombo: - this.showEndEffect_PerfectCombo(i); + PerfectComboScript.PlayEndAnime(i); + this.soundPerfectCombo[i]?.PlayStart(); + OpenTaiko.Skin.voiceClearAllPerfect[OpenTaiko.GetActualPlayer(i)]?.tPlay(); break; - case EndMode.AI_Win: - if (!OpenTaiko.stage演奏ドラム画面.bPAUSE) AIWinScript.Update(i); - AIWinScript.Draw(i); - break; case EndMode.AI_Lose: - if (!OpenTaiko.stage演奏ドラム画面.bPAUSE) AILoseScript.Update(i); - AILoseScript.Draw(i); + AILoseScript.PlayEndAnime(i); + this.soundAILose?.PlayStart(); + OpenTaiko.Skin.voiceAILose[OpenTaiko.GetActualPlayer(1)]?.tPlay(); + break; + case EndMode.AI_Win: + AIWinScript.PlayEndAnime(i); + this.soundAIWin?.PlayStart(); + OpenTaiko.Skin.voiceAIWin[OpenTaiko.GetActualPlayer(i)]?.tPlay(); break; case EndMode.AI_Win_FullCombo: - if (!OpenTaiko.stage演奏ドラム画面.bPAUSE) AIWin_FullComboScript.Update(i); - AIWin_FullComboScript.Draw(i); + AIWin_FullComboScript.PlayEndAnime(i); + this.soundAIWinFullCombo?.PlayStart(); + OpenTaiko.Skin.voiceAIWin[OpenTaiko.GetActualPlayer(i)]?.tPlay(); break; case EndMode.AI_Win_Perfect: - if (!OpenTaiko.stage演奏ドラム画面.bPAUSE) AIWin_PerfectScript.Update(i); - AIWin_PerfectScript.Draw(i); + AIWin_PerfectScript.PlayEndAnime(i); + this.soundAIWinPerfectCombo?.PlayStart(); + OpenTaiko.Skin.voiceAIWin[OpenTaiko.GetActualPlayer(i)]?.tPlay(); break; case EndMode.Tower_Dropout: - if (!OpenTaiko.stage演奏ドラム画面.bPAUSE) Tower_DropoutScript.Update(i); - Tower_DropoutScript.Draw(i); + Tower_DropoutScript.PlayEndAnime(i); + this.soundTowerDropout?.PlayStart(); + OpenTaiko.Skin.voiceClearFailed[OpenTaiko.GetActualPlayer(i)]?.tPlay(); break; case EndMode.Tower_TopReached_Pass: - if (!OpenTaiko.stage演奏ドラム画面.bPAUSE) Tower_TopReached_PassScript.Update(i); - Tower_TopReached_PassScript.Draw(i); + Tower_TopReached_PassScript.PlayEndAnime(i); + this.soundTowerTopPass?.PlayStart(); + OpenTaiko.Skin.voiceClearClear[OpenTaiko.GetActualPlayer(i)]?.tPlay(); break; case EndMode.Tower_TopReached_FullCombo: - if (!OpenTaiko.stage演奏ドラム画面.bPAUSE) Tower_TopReached_FullComboScript.Update(i); - Tower_TopReached_FullComboScript.Draw(i); + Tower_TopReached_FullComboScript.PlayEndAnime(i); + this.soundTowerTopFC?.PlayStart(); + OpenTaiko.Skin.voiceClearFullCombo[OpenTaiko.GetActualPlayer(i)]?.tPlay(); break; case EndMode.Tower_TopReached_Perfect: - if (!OpenTaiko.stage演奏ドラム画面.bPAUSE) Tower_TopReached_PerfectScript.Update(i); - Tower_TopReached_PerfectScript.Draw(i); + Tower_TopReached_PerfectScript.PlayEndAnime(i); + this.soundTowerTopPerfect?.PlayStart(); + OpenTaiko.Skin.voiceClearAllPerfect[OpenTaiko.GetActualPlayer(i)]?.tPlay(); break; case EndMode.Dan_Fail: - if (!OpenTaiko.stage演奏ドラム画面.bPAUSE) Dan_FailScript.Update(i); - Dan_FailScript.Draw(i); + Dan_FailScript.PlayEndAnime(i); + this.soundDanFailed?.PlayStart(); + OpenTaiko.Skin.voiceClearFailed[OpenTaiko.GetActualPlayer(i)]?.tPlay(); break; case EndMode.Dan_Red_Pass: - if (!OpenTaiko.stage演奏ドラム画面.bPAUSE) Dan_Red_PassScript.Update(i); - Dan_Red_PassScript.Draw(i); + Dan_Red_PassScript.PlayEndAnime(i); + this.soundDanRedClear?.PlayStart(); + OpenTaiko.Skin.voiceClearClear[OpenTaiko.GetActualPlayer(i)]?.tPlay(); break; case EndMode.Dan_Red_FullCombo: - if (!OpenTaiko.stage演奏ドラム画面.bPAUSE) Dan_Red_FullComboScript.Update(i); - Dan_Red_FullComboScript.Draw(i); + Dan_Red_FullComboScript.PlayEndAnime(i); + this.soundDanRedFC?.PlayStart(); + OpenTaiko.Skin.voiceClearFullCombo[OpenTaiko.GetActualPlayer(i)]?.tPlay(); break; case EndMode.Dan_Red_Perfect: - if (!OpenTaiko.stage演奏ドラム画面.bPAUSE) Dan_Red_PerfectScript.Update(i); - Dan_Red_PerfectScript.Draw(i); + Dan_Red_PerfectScript.PlayEndAnime(i); + this.soundDanRedPerfect?.PlayStart(); + OpenTaiko.Skin.voiceClearAllPerfect[OpenTaiko.GetActualPlayer(i)]?.tPlay(); break; case EndMode.Dan_Gold_Pass: - if (!OpenTaiko.stage演奏ドラム画面.bPAUSE) Dan_Gold_PassScript.Update(i); - Dan_Gold_PassScript.Draw(i); + Dan_Gold_PassScript.PlayEndAnime(i); + this.soundDanGoldClear?.PlayStart(); + OpenTaiko.Skin.voiceClearClear[OpenTaiko.GetActualPlayer(i)]?.tPlay(); break; case EndMode.Dan_Gold_FullCombo: - if (!OpenTaiko.stage演奏ドラム画面.bPAUSE) Dan_Gold_FullComboScript.Update(i); - Dan_Gold_FullComboScript.Draw(i); + Dan_Gold_FullComboScript.PlayEndAnime(i); + this.soundDanGoldFC?.PlayStart(); + OpenTaiko.Skin.voiceClearFullCombo[OpenTaiko.GetActualPlayer(i)]?.tPlay(); break; case EndMode.Dan_Gold_Perfect: - if (!OpenTaiko.stage演奏ドラム画面.bPAUSE) Dan_Gold_PerfectScript.Update(i); - Dan_Gold_PerfectScript.Draw(i); + Dan_Gold_PerfectScript.PlayEndAnime(i); + this.soundDanGoldPerfect?.PlayStart(); + OpenTaiko.Skin.voiceClearAllPerfect[OpenTaiko.GetActualPlayer(i)]?.tPlay(); break; + default: break; } - } - - - if (this.ct進行メイン.IsEnded) { - return 1; - } + bSongsPlayed = true; } - return 0; + + for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { + if (i == 1 && OpenTaiko.ConfigIni.bAIBattleMode) break; + + switch (this.Mode[i]) { + case EndMode.StageFailed: + this.showEndEffect_Failed(i); + break; + case EndMode.StageCleared: + this.showEndEffect_Clear(i); + break; + case EndMode.StageFullCombo: + this.showEndEffect_FullCombo(i); + break; + case EndMode.StagePerfectCombo: + this.showEndEffect_PerfectCombo(i); + break; + + case EndMode.AI_Win: + if (!OpenTaiko.stage演奏ドラム画面.bPAUSE) AIWinScript.Update(i); + AIWinScript.Draw(i); + break; + case EndMode.AI_Lose: + if (!OpenTaiko.stage演奏ドラム画面.bPAUSE) AILoseScript.Update(i); + AILoseScript.Draw(i); + break; + case EndMode.AI_Win_FullCombo: + if (!OpenTaiko.stage演奏ドラム画面.bPAUSE) AIWin_FullComboScript.Update(i); + AIWin_FullComboScript.Draw(i); + break; + case EndMode.AI_Win_Perfect: + if (!OpenTaiko.stage演奏ドラム画面.bPAUSE) AIWin_PerfectScript.Update(i); + AIWin_PerfectScript.Draw(i); + break; + + case EndMode.Tower_Dropout: + if (!OpenTaiko.stage演奏ドラム画面.bPAUSE) Tower_DropoutScript.Update(i); + Tower_DropoutScript.Draw(i); + break; + case EndMode.Tower_TopReached_Pass: + if (!OpenTaiko.stage演奏ドラム画面.bPAUSE) Tower_TopReached_PassScript.Update(i); + Tower_TopReached_PassScript.Draw(i); + break; + case EndMode.Tower_TopReached_FullCombo: + if (!OpenTaiko.stage演奏ドラム画面.bPAUSE) Tower_TopReached_FullComboScript.Update(i); + Tower_TopReached_FullComboScript.Draw(i); + break; + case EndMode.Tower_TopReached_Perfect: + if (!OpenTaiko.stage演奏ドラム画面.bPAUSE) Tower_TopReached_PerfectScript.Update(i); + Tower_TopReached_PerfectScript.Draw(i); + break; + + case EndMode.Dan_Fail: + if (!OpenTaiko.stage演奏ドラム画面.bPAUSE) Dan_FailScript.Update(i); + Dan_FailScript.Draw(i); + break; + case EndMode.Dan_Red_Pass: + if (!OpenTaiko.stage演奏ドラム画面.bPAUSE) Dan_Red_PassScript.Update(i); + Dan_Red_PassScript.Draw(i); + break; + case EndMode.Dan_Red_FullCombo: + if (!OpenTaiko.stage演奏ドラム画面.bPAUSE) Dan_Red_FullComboScript.Update(i); + Dan_Red_FullComboScript.Draw(i); + break; + case EndMode.Dan_Red_Perfect: + if (!OpenTaiko.stage演奏ドラム画面.bPAUSE) Dan_Red_PerfectScript.Update(i); + Dan_Red_PerfectScript.Draw(i); + break; + case EndMode.Dan_Gold_Pass: + if (!OpenTaiko.stage演奏ドラム画面.bPAUSE) Dan_Gold_PassScript.Update(i); + Dan_Gold_PassScript.Draw(i); + break; + case EndMode.Dan_Gold_FullCombo: + if (!OpenTaiko.stage演奏ドラム画面.bPAUSE) Dan_Gold_FullComboScript.Update(i); + Dan_Gold_FullComboScript.Draw(i); + break; + case EndMode.Dan_Gold_Perfect: + if (!OpenTaiko.stage演奏ドラム画面.bPAUSE) Dan_Gold_PerfectScript.Update(i); + Dan_Gold_PerfectScript.Draw(i); + break; + default: + break; + } + + } + + + + if (this.ct進行メイン.IsEnded) { + return 1; + } } - #region[ private ] - //----------------- - - public EndAnimeScript FailedScript { get; private set; } - public EndAnimeScript ClearScript { get; private set; } - public EndAnimeScript FullComboScript { get; private set; } - public EndAnimeScript PerfectComboScript { get; private set; } - - public EndAnimeScript AILoseScript { get; private set; } - public EndAnimeScript AIWinScript { get; private set; } - public EndAnimeScript AIWin_FullComboScript { get; private set; } - public EndAnimeScript AIWin_PerfectScript { get; private set; } - - public EndAnimeScript Tower_DropoutScript { get; private set; } - public EndAnimeScript Tower_TopReached_PassScript { get; private set; } - public EndAnimeScript Tower_TopReached_FullComboScript { get; private set; } - public EndAnimeScript Tower_TopReached_PerfectScript { get; private set; } - - public EndAnimeScript Dan_FailScript { get; private set; } - public EndAnimeScript Dan_Red_PassScript { get; private set; } - public EndAnimeScript Dan_Red_FullComboScript { get; private set; } - public EndAnimeScript Dan_Red_PerfectScript { get; private set; } - - public EndAnimeScript Dan_Gold_PassScript { get; private set; } - public EndAnimeScript Dan_Gold_FullComboScript { get; private set; } - public EndAnimeScript Dan_Gold_PerfectScript { get; private set; } - - - - bool b再生済み; - bool bリザルトボイス再生済み; - bool bSongsPlayed = false; - CCounter ct進行メイン; - - /* - CCounter ctEnd_ClearFailed; - CCounter ctEnd_FullCombo; - CCounter ctEnd_FullComboLoop; - CCounter ctEnd_DondaFullCombo; - CCounter ctEnd_DondaFullComboLoop; - */ - - CCounter ct進行Loop; - CSound[] soundClear = new CSound[5]; - CSound[] soundFailed = new CSound[5]; - CSound[] soundFullCombo = new CSound[5]; - CSound[] soundPerfectCombo = new CSound[5]; - - CSound soundDanFailed; - CSound soundDanRedClear; - CSound soundDanRedFC; - CSound soundDanRedPerfect; - CSound soundDanGoldClear; - CSound soundDanGoldFC; - CSound soundDanGoldPerfect; - CSound soundTowerDropout; - CSound soundTowerTopPass; - CSound soundTowerTopFC; - CSound soundTowerTopPerfect; - - CSound soundAILose; - CSound soundAIWin; - CSound soundAIWinFullCombo; - CSound soundAIWinPerfectCombo; - - public EndMode[] Mode { get; private set; } - public enum EndMode { - StageFailed, - StageCleared, - StageFullCombo, - StagePerfectCombo, - - AI_Lose, - AI_Win, - AI_Win_FullCombo, - AI_Win_Perfect, - - Tower_Dropout, - Tower_TopReached_Pass, - Tower_TopReached_FullCombo, - Tower_TopReached_Perfect, - - Dan_Fail, - Dan_Red_Pass, - Dan_Red_FullCombo, - Dan_Red_Perfect, - Dan_Gold_Pass, - Dan_Gold_FullCombo, - Dan_Gold_Perfect - } - - //----------------- - #endregion + return 0; } + + #region[ private ] + //----------------- + + public EndAnimeScript FailedScript { get; private set; } + public EndAnimeScript ClearScript { get; private set; } + public EndAnimeScript FullComboScript { get; private set; } + public EndAnimeScript PerfectComboScript { get; private set; } + + public EndAnimeScript AILoseScript { get; private set; } + public EndAnimeScript AIWinScript { get; private set; } + public EndAnimeScript AIWin_FullComboScript { get; private set; } + public EndAnimeScript AIWin_PerfectScript { get; private set; } + + public EndAnimeScript Tower_DropoutScript { get; private set; } + public EndAnimeScript Tower_TopReached_PassScript { get; private set; } + public EndAnimeScript Tower_TopReached_FullComboScript { get; private set; } + public EndAnimeScript Tower_TopReached_PerfectScript { get; private set; } + + public EndAnimeScript Dan_FailScript { get; private set; } + public EndAnimeScript Dan_Red_PassScript { get; private set; } + public EndAnimeScript Dan_Red_FullComboScript { get; private set; } + public EndAnimeScript Dan_Red_PerfectScript { get; private set; } + + public EndAnimeScript Dan_Gold_PassScript { get; private set; } + public EndAnimeScript Dan_Gold_FullComboScript { get; private set; } + public EndAnimeScript Dan_Gold_PerfectScript { get; private set; } + + + + bool b再生済み; + bool bリザルトボイス再生済み; + bool bSongsPlayed = false; + CCounter ct進行メイン; + + /* + CCounter ctEnd_ClearFailed; + CCounter ctEnd_FullCombo; + CCounter ctEnd_FullComboLoop; + CCounter ctEnd_DondaFullCombo; + CCounter ctEnd_DondaFullComboLoop; + */ + + CCounter ct進行Loop; + CSound[] soundClear = new CSound[5]; + CSound[] soundFailed = new CSound[5]; + CSound[] soundFullCombo = new CSound[5]; + CSound[] soundPerfectCombo = new CSound[5]; + + CSound soundDanFailed; + CSound soundDanRedClear; + CSound soundDanRedFC; + CSound soundDanRedPerfect; + CSound soundDanGoldClear; + CSound soundDanGoldFC; + CSound soundDanGoldPerfect; + CSound soundTowerDropout; + CSound soundTowerTopPass; + CSound soundTowerTopFC; + CSound soundTowerTopPerfect; + + CSound soundAILose; + CSound soundAIWin; + CSound soundAIWinFullCombo; + CSound soundAIWinPerfectCombo; + + public EndMode[] Mode { get; private set; } + public enum EndMode { + StageFailed, + StageCleared, + StageFullCombo, + StagePerfectCombo, + + AI_Lose, + AI_Win, + AI_Win_FullCombo, + AI_Win_Perfect, + + Tower_Dropout, + Tower_TopReached_Pass, + Tower_TopReached_FullCombo, + Tower_TopReached_Perfect, + + Dan_Fail, + Dan_Red_Pass, + Dan_Red_FullCombo, + Dan_Red_Perfect, + Dan_Gold_Pass, + Dan_Gold_FullCombo, + Dan_Gold_Perfect + } + + //----------------- + #endregion } diff --git a/OpenTaiko/src/Stages/07.Game/Taiko/CActImplCombo.cs b/OpenTaiko/src/Stages/07.Game/Taiko/CActImplCombo.cs index 1b9f2db6..bbbc151a 100644 --- a/OpenTaiko/src/Stages/07.Game/Taiko/CActImplCombo.cs +++ b/OpenTaiko/src/Stages/07.Game/Taiko/CActImplCombo.cs @@ -1,9 +1,9 @@ -namespace OpenTaiko { - internal class CActImplCombo : CAct演奏Combo共通 { - // CAct演奏Combo共通 実装 +namespace OpenTaiko; - protected override void tコンボ表示_太鼓(int nCombo値, int nジャンプインデックス, int nPlayer) { - base.tコンボ表示_太鼓(nCombo値, nジャンプインデックス, nPlayer); - } +internal class CActImplCombo : CAct演奏Combo共通 { + // CAct演奏Combo共通 実装 + + protected override void tコンボ表示_太鼓(int nCombo値, int nジャンプインデックス, int nPlayer) { + base.tコンボ表示_太鼓(nCombo値, nジャンプインデックス, nPlayer); } } diff --git a/OpenTaiko/src/Stages/07.Game/Taiko/CActImplComboBalloon.cs b/OpenTaiko/src/Stages/07.Game/Taiko/CActImplComboBalloon.cs index 77507d10..b9936eca 100644 --- a/OpenTaiko/src/Stages/07.Game/Taiko/CActImplComboBalloon.cs +++ b/OpenTaiko/src/Stages/07.Game/Taiko/CActImplComboBalloon.cs @@ -2,155 +2,155 @@ using System.Runtime.InteropServices; using FDK; -namespace OpenTaiko { - internal class CActImplComboBalloon : CActivity { - // コンストラクタ +namespace OpenTaiko; - /// - /// 100コンボごとに出る吹き出し。 - /// 本当は「10000点」のところも動かしたいけど、技術不足だし保留。 - /// - public CActImplComboBalloon() { - for (int i = 0; i < 10; i++) { - this.st小文字位置[i].ch = i.ToString().ToCharArray()[0]; - this.st小文字位置[i].pt = new Point(i * 53, 0); - } - base.IsDeActivated = true; +internal class CActImplComboBalloon : CActivity { + // コンストラクタ + + /// + /// 100コンボごとに出る吹き出し。 + /// 本当は「10000点」のところも動かしたいけど、技術不足だし保留。 + /// + public CActImplComboBalloon() { + for (int i = 0; i < 10; i++) { + this.st小文字位置[i].ch = i.ToString().ToCharArray()[0]; + this.st小文字位置[i].pt = new Point(i * 53, 0); + } + base.IsDeActivated = true; + } + + + // メソッド + public virtual void Start(int nCombo, int player) { + this.NowDrawBalloon = 0; + this.ct進行[player] = new CCounter(1, 42, 70, OpenTaiko.Timer); + this.nCombo_渡[player] = nCombo; + } + + // CActivity 実装 + + public override void Activate() { + for (int i = 0; i < 2; i++) { + this.nCombo_渡[i] = 0; + this.ct進行[i] = new CCounter(); } - - // メソッド - public virtual void Start(int nCombo, int player) { - this.NowDrawBalloon = 0; - this.ct進行[player] = new CCounter(1, 42, 70, OpenTaiko.Timer); - this.nCombo_渡[player] = nCombo; + base.Activate(); + } + public override void DeActivate() { + for (int i = 0; i < 2; i++) { + this.ct進行[i] = null; } - - // CActivity 実装 - - public override void Activate() { + base.DeActivate(); + } + public override void CreateManagedResource() { + base.CreateManagedResource(); + } + public override void ReleaseManagedResource() { + base.ReleaseManagedResource(); + } + public override int Draw() { + if (!base.IsDeActivated) { + if (OpenTaiko.ConfigIni.nPlayerCount > 2 || OpenTaiko.ConfigIni.SimpleMode) return 0; for (int i = 0; i < 2; i++) { - this.nCombo_渡[i] = 0; - this.ct進行[i] = new CCounter(); - } + if (OpenTaiko.ConfigIni.bAIBattleMode) break; - base.Activate(); - } - public override void DeActivate() { - for (int i = 0; i < 2; i++) { - this.ct進行[i] = null; - } - base.DeActivate(); - } - public override void CreateManagedResource() { - base.CreateManagedResource(); - } - public override void ReleaseManagedResource() { - base.ReleaseManagedResource(); - } - public override int Draw() { - if (!base.IsDeActivated) { - if (OpenTaiko.ConfigIni.nPlayerCount > 2 || OpenTaiko.ConfigIni.SimpleMode) return 0; - for (int i = 0; i < 2; i++) { - if (OpenTaiko.ConfigIni.bAIBattleMode) break; + int j = i; + if (OpenTaiko.PlayerSide == 1 && OpenTaiko.ConfigIni.nPlayerCount == 1) + j = 1; - int j = i; - if (OpenTaiko.PlayerSide == 1 && OpenTaiko.ConfigIni.nPlayerCount == 1) - j = 1; + if (!this.ct進行[i].IsStoped) { + this.ct進行[i].Tick(); + if (this.ct進行[i].IsEnded) { + this.ct進行[i].Stop(); + } + } - if (!this.ct進行[i].IsStoped) { - this.ct進行[i].Tick(); - if (this.ct進行[i].IsEnded) { - this.ct進行[i].Stop(); - } + if (OpenTaiko.Tx.Balloon_Combo[j] != null && OpenTaiko.Tx.Balloon_Number_Combo != null) { + //半透明4f + if (this.ct進行[i].CurrentValue == 1 || this.ct進行[i].CurrentValue == 42) { + OpenTaiko.Tx.Balloon_Number_Combo.Opacity = 0; + OpenTaiko.Tx.Balloon_Combo[j].Opacity = 64; + NowDrawBalloon = 0; + } else if (this.ct進行[i].CurrentValue == 2 || this.ct進行[i].CurrentValue == 41) { + OpenTaiko.Tx.Balloon_Number_Combo.Opacity = 0; + OpenTaiko.Tx.Balloon_Combo[j].Opacity = 128; + NowDrawBalloon = 0; + } else if (this.ct進行[i].CurrentValue == 3 || this.ct進行[i].CurrentValue == 40) { + NowDrawBalloon = 1; + OpenTaiko.Tx.Balloon_Combo[j].Opacity = 255; + OpenTaiko.Tx.Balloon_Number_Combo.Opacity = 128; + } else if (this.ct進行[i].CurrentValue == 4 || this.ct進行[i].CurrentValue == 39) { + NowDrawBalloon = 2; + OpenTaiko.Tx.Balloon_Combo[j].Opacity = 255; + OpenTaiko.Tx.Balloon_Number_Combo.Opacity = 255; + } else if (this.ct進行[i].CurrentValue == 5 || this.ct進行[i].CurrentValue == 38) { + NowDrawBalloon = 2; + OpenTaiko.Tx.Balloon_Combo[j].Opacity = 255; + OpenTaiko.Tx.Balloon_Number_Combo.Opacity = 255; + } else if (this.ct進行[i].CurrentValue >= 6 || this.ct進行[i].CurrentValue <= 37) { + NowDrawBalloon = 2; + OpenTaiko.Tx.Balloon_Combo[j].Opacity = 255; + OpenTaiko.Tx.Balloon_Number_Combo.Opacity = 255; } - if (OpenTaiko.Tx.Balloon_Combo[j] != null && OpenTaiko.Tx.Balloon_Number_Combo != null) { - //半透明4f - if (this.ct進行[i].CurrentValue == 1 || this.ct進行[i].CurrentValue == 42) { - OpenTaiko.Tx.Balloon_Number_Combo.Opacity = 0; - OpenTaiko.Tx.Balloon_Combo[j].Opacity = 64; - NowDrawBalloon = 0; - } else if (this.ct進行[i].CurrentValue == 2 || this.ct進行[i].CurrentValue == 41) { - OpenTaiko.Tx.Balloon_Number_Combo.Opacity = 0; - OpenTaiko.Tx.Balloon_Combo[j].Opacity = 128; - NowDrawBalloon = 0; - } else if (this.ct進行[i].CurrentValue == 3 || this.ct進行[i].CurrentValue == 40) { - NowDrawBalloon = 1; - OpenTaiko.Tx.Balloon_Combo[j].Opacity = 255; - OpenTaiko.Tx.Balloon_Number_Combo.Opacity = 128; - } else if (this.ct進行[i].CurrentValue == 4 || this.ct進行[i].CurrentValue == 39) { - NowDrawBalloon = 2; - OpenTaiko.Tx.Balloon_Combo[j].Opacity = 255; - OpenTaiko.Tx.Balloon_Number_Combo.Opacity = 255; - } else if (this.ct進行[i].CurrentValue == 5 || this.ct進行[i].CurrentValue == 38) { - NowDrawBalloon = 2; - OpenTaiko.Tx.Balloon_Combo[j].Opacity = 255; - OpenTaiko.Tx.Balloon_Number_Combo.Opacity = 255; - } else if (this.ct進行[i].CurrentValue >= 6 || this.ct進行[i].CurrentValue <= 37) { - NowDrawBalloon = 2; - OpenTaiko.Tx.Balloon_Combo[j].Opacity = 255; - OpenTaiko.Tx.Balloon_Number_Combo.Opacity = 255; - } - - if (this.ct進行[i].IsTicked) { - int plate_width = OpenTaiko.Tx.Balloon_Combo[j].szTextureSize.Width / 3; - int plate_height = OpenTaiko.Tx.Balloon_Combo[j].szTextureSize.Height; - OpenTaiko.Tx.Balloon_Combo[j].t2D描画(OpenTaiko.Skin.Game_Balloon_Combo_X[i], OpenTaiko.Skin.Game_Balloon_Combo_Y[i], new RectangleF(NowDrawBalloon * plate_width, 0, plate_width, plate_height)); - if (this.nCombo_渡[i] < 1000) //2016.08.23 kairera0467 仮実装。 - { - this.t小文字表示(OpenTaiko.Skin.Game_Balloon_Combo_Number_X[i], OpenTaiko.Skin.Game_Balloon_Combo_Number_Y[i], this.nCombo_渡[i], j); - OpenTaiko.Tx.Balloon_Number_Combo.t2D描画(OpenTaiko.Skin.Game_Balloon_Combo_Text_X[i] + 6 - NowDrawBalloon * 3, OpenTaiko.Skin.Game_Balloon_Combo_Text_Y[i], - new Rectangle(OpenTaiko.Skin.Game_Balloon_Combo_Text_Rect[0], OpenTaiko.Skin.Game_Balloon_Combo_Text_Rect[1], OpenTaiko.Skin.Game_Balloon_Combo_Text_Rect[2], OpenTaiko.Skin.Game_Balloon_Combo_Text_Rect[3])); - } else { - this.t小文字表示(OpenTaiko.Skin.Game_Balloon_Combo_Number_Ex_X[i], OpenTaiko.Skin.Game_Balloon_Combo_Number_Ex_Y[i], this.nCombo_渡[i], j); - OpenTaiko.Tx.Balloon_Number_Combo.vcScaleRatio.X = 1.0f; - OpenTaiko.Tx.Balloon_Number_Combo.t2D描画(OpenTaiko.Skin.Game_Balloon_Combo_Text_Ex_X[i] + 6 - NowDrawBalloon * 3, OpenTaiko.Skin.Game_Balloon_Combo_Text_Ex_Y[i], - new Rectangle(OpenTaiko.Skin.Game_Balloon_Combo_Text_Rect[0], OpenTaiko.Skin.Game_Balloon_Combo_Text_Rect[1], OpenTaiko.Skin.Game_Balloon_Combo_Text_Rect[2], OpenTaiko.Skin.Game_Balloon_Combo_Text_Rect[3])); - } + if (this.ct進行[i].IsTicked) { + int plate_width = OpenTaiko.Tx.Balloon_Combo[j].szTextureSize.Width / 3; + int plate_height = OpenTaiko.Tx.Balloon_Combo[j].szTextureSize.Height; + OpenTaiko.Tx.Balloon_Combo[j].t2D描画(OpenTaiko.Skin.Game_Balloon_Combo_X[i], OpenTaiko.Skin.Game_Balloon_Combo_Y[i], new RectangleF(NowDrawBalloon * plate_width, 0, plate_width, plate_height)); + if (this.nCombo_渡[i] < 1000) //2016.08.23 kairera0467 仮実装。 + { + this.t小文字表示(OpenTaiko.Skin.Game_Balloon_Combo_Number_X[i], OpenTaiko.Skin.Game_Balloon_Combo_Number_Y[i], this.nCombo_渡[i], j); + OpenTaiko.Tx.Balloon_Number_Combo.t2D描画(OpenTaiko.Skin.Game_Balloon_Combo_Text_X[i] + 6 - NowDrawBalloon * 3, OpenTaiko.Skin.Game_Balloon_Combo_Text_Y[i], + new Rectangle(OpenTaiko.Skin.Game_Balloon_Combo_Text_Rect[0], OpenTaiko.Skin.Game_Balloon_Combo_Text_Rect[1], OpenTaiko.Skin.Game_Balloon_Combo_Text_Rect[2], OpenTaiko.Skin.Game_Balloon_Combo_Text_Rect[3])); + } else { + this.t小文字表示(OpenTaiko.Skin.Game_Balloon_Combo_Number_Ex_X[i], OpenTaiko.Skin.Game_Balloon_Combo_Number_Ex_Y[i], this.nCombo_渡[i], j); + OpenTaiko.Tx.Balloon_Number_Combo.vcScaleRatio.X = 1.0f; + OpenTaiko.Tx.Balloon_Number_Combo.t2D描画(OpenTaiko.Skin.Game_Balloon_Combo_Text_Ex_X[i] + 6 - NowDrawBalloon * 3, OpenTaiko.Skin.Game_Balloon_Combo_Text_Ex_Y[i], + new Rectangle(OpenTaiko.Skin.Game_Balloon_Combo_Text_Rect[0], OpenTaiko.Skin.Game_Balloon_Combo_Text_Rect[1], OpenTaiko.Skin.Game_Balloon_Combo_Text_Rect[2], OpenTaiko.Skin.Game_Balloon_Combo_Text_Rect[3])); } } } } - return 0; } - - - // その他 - - #region [ private ] - //----------------- - private CCounter[] ct進行 = new CCounter[5]; - //private CTexture[] tx吹き出し本体 = new CTexture[ 2 ]; - //private CTexture tx数字; - private int[] nCombo_渡 = new int[5]; - - private int NowDrawBalloon; - - [StructLayout(LayoutKind.Sequential)] - private struct ST文字位置 { - public char ch; - public Point pt; - public ST文字位置(char ch, Point pt) { - this.ch = ch; - this.pt = pt; - } - } - private ST文字位置[] st小文字位置 = new ST文字位置[10]; - - private void t小文字表示(int x, int y, int num, int player) { - int[] nums = CConversion.SeparateDigits(num); - for (int j = 0; j < nums.Length; j++) { - float _x = x - (OpenTaiko.Skin.Game_Balloon_Combo_Number_Interval[0] * (j - nums.Length)); - float _y = y - (OpenTaiko.Skin.Game_Balloon_Combo_Number_Interval[1] * (j - nums.Length)); - - float width = OpenTaiko.Skin.Game_Balloon_Combo_Number_Size[0]; - float height = OpenTaiko.Skin.Game_Balloon_Combo_Number_Size[1]; - - OpenTaiko.Tx.Balloon_Number_Combo.t2D描画(_x, _y, new RectangleF(width * nums[j], height * player, width, height)); - } - } - //----------------- - #endregion + return 0; } + + + // その他 + + #region [ private ] + //----------------- + private CCounter[] ct進行 = new CCounter[5]; + //private CTexture[] tx吹き出し本体 = new CTexture[ 2 ]; + //private CTexture tx数字; + private int[] nCombo_渡 = new int[5]; + + private int NowDrawBalloon; + + [StructLayout(LayoutKind.Sequential)] + private struct ST文字位置 { + public char ch; + public Point pt; + public ST文字位置(char ch, Point pt) { + this.ch = ch; + this.pt = pt; + } + } + private ST文字位置[] st小文字位置 = new ST文字位置[10]; + + private void t小文字表示(int x, int y, int num, int player) { + int[] nums = CConversion.SeparateDigits(num); + for (int j = 0; j < nums.Length; j++) { + float _x = x - (OpenTaiko.Skin.Game_Balloon_Combo_Number_Interval[0] * (j - nums.Length)); + float _y = y - (OpenTaiko.Skin.Game_Balloon_Combo_Number_Interval[1] * (j - nums.Length)); + + float width = OpenTaiko.Skin.Game_Balloon_Combo_Number_Size[0]; + float height = OpenTaiko.Skin.Game_Balloon_Combo_Number_Size[1]; + + OpenTaiko.Tx.Balloon_Number_Combo.t2D描画(_x, _y, new RectangleF(width * nums[j], height * player, width, height)); + } + } + //----------------- + #endregion } diff --git a/OpenTaiko/src/Stages/07.Game/Taiko/CActImplDancer.cs b/OpenTaiko/src/Stages/07.Game/Taiko/CActImplDancer.cs index e523c161..9e1eabb7 100644 --- a/OpenTaiko/src/Stages/07.Game/Taiko/CActImplDancer.cs +++ b/OpenTaiko/src/Stages/07.Game/Taiko/CActImplDancer.cs @@ -1,297 +1,297 @@ using System.Diagnostics; using FDK; -namespace OpenTaiko { - internal class CActImplDancer : CActivity { - /// - /// 踊り子 - /// - public CActImplDancer() { - base.IsDeActivated = true; - } +namespace OpenTaiko; - public override void Activate() { - //this.ct踊り子モーション = new CCounter(); - - if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Tower || OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) - return; - - var preset = HScenePreset.GetBGPreset(); - - if (preset == null) return; - - Random random = new Random(); - - Dancer_In = new CTexture[5][]; - Dancer_Out = new CTexture[5][]; - Dancer = new CTexture[5][]; - DancerStates = new int[5]; - nNowDancerInCounter = new float[5]; - nNowDancerOutCounter = new float[5]; - - - - var dancerOrigindir = CSkin.Path($"{TextureLoader.BASE}{TextureLoader.GAME}{TextureLoader.DANCER}"); - if (Directory.Exists($@"{dancerOrigindir}")) { - var dirs = Directory.GetDirectories($@"{dancerOrigindir}"); - if (preset.DancerSet != null) { - var _presetPath = (preset.DancerSet.Length > 0) ? $@"{dancerOrigindir}" + preset.DancerSet[random.Next(0, preset.DancerSet.Length)] : ""; - var path = (Directory.Exists(_presetPath)) - ? _presetPath - : (dirs.Length > 0 ? dirs[random.Next(0, dirs.Length)] : ""); - - LoadDancerConifg(path); - - Dancer_In = new CTexture[nDancerCount][]; - Dancer_Out = new CTexture[nDancerCount][]; - Dancer = new CTexture[nDancerCount][]; - DancerStates = new int[nDancerCount]; - nNowDancerInCounter = new float[nDancerCount]; - nNowDancerOutCounter = new float[nDancerCount]; - - nDancerInPtn = OpenTaiko.t連番画像の枚数を数える($@"{path}{Path.DirectorySeparatorChar}1_In{Path.DirectorySeparatorChar}"); - if (nDancerInPtn != 0) { - for (int i = 0; i < nDancerCount; i++) { - Dancer_In[i] = new CTexture[nDancerInPtn]; - for (int p = 0; p < nDancerInPtn; p++) { - Dancer_In[i][p] = OpenTaiko.tテクスチャの生成($@"{path}{Path.DirectorySeparatorChar}{(i + 1)}_In{Path.DirectorySeparatorChar}{p}.png"); - } - } - } - - nDancerOutPtn = OpenTaiko.t連番画像の枚数を数える($@"{path}{Path.DirectorySeparatorChar}1_Out{Path.DirectorySeparatorChar}"); - if (nDancerOutPtn != 0) { - for (int i = 0; i < nDancerCount; i++) { - Dancer_Out[i] = new CTexture[nDancerOutPtn]; - for (int p = 0; p < nDancerOutPtn; p++) { - Dancer_Out[i][p] = OpenTaiko.tテクスチャの生成($@"{path}{Path.DirectorySeparatorChar}{(i + 1)}_Out{Path.DirectorySeparatorChar}{p}.png"); - } - } - } - - nDancerPtn = OpenTaiko.t連番画像の枚数を数える($@"{path}{Path.DirectorySeparatorChar}1{Path.DirectorySeparatorChar}"); - if (nDancerPtn != 0) { - for (int i = 0; i < nDancerCount; i++) { - Dancer[i] = new CTexture[nDancerPtn]; - for (int p = 0; p < nDancerPtn; p++) { - Dancer[i][p] = OpenTaiko.tテクスチャの生成($@"{path}{Path.DirectorySeparatorChar}{(i + 1)}{Path.DirectorySeparatorChar}{p}.png"); - } - } - } - } - } - - arMotionArray_In = CConversion.StringToIntArray(Game_Dancer_In_Motion); - if (this.arMotionArray_In == null) arMotionArray_In = CConversion.StringToIntArray("0,0"); - - arMotionArray_Out = CConversion.StringToIntArray(Game_Dancer_Out_Motion); - if (this.arMotionArray_Out == null) arMotionArray_Out = CConversion.StringToIntArray("0,0"); - - this.ar踊り子モーション番号 = CConversion.StringToIntArray(OpenTaiko.Skin.Game_Dancer_Motion); - if (this.ar踊り子モーション番号 == null) ar踊り子モーション番号 = CConversion.StringToIntArray("0,0"); - - nNowDancerCounter = 0; - nNowDancerFrame = 0; - - base.Activate(); - } - - public override void DeActivate() { - if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Tower || OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) - return; - - //this.ct踊り子モーション = null; - - for (int i = 0; i < nDancerCount; i++) { - OpenTaiko.t安全にDisposeする(ref Dancer_In[i]); - OpenTaiko.t安全にDisposeする(ref Dancer_Out[i]); - OpenTaiko.t安全にDisposeする(ref Dancer[i]); - } - - base.DeActivate(); - } - - public override void CreateManagedResource() { - base.CreateManagedResource(); - } - - public override void ReleaseManagedResource() { - base.ReleaseManagedResource(); - } - - public override int Draw() { - if (this.IsFirstDraw) { - this.IsFirstDraw = true; - } - - if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] != (int)Difficulty.Tower && OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] != (int)Difficulty.Dan) { - if (OpenTaiko.ConfigIni.ShowDancer && (this.ar踊り子モーション番号.Length - 1) != 0) { - if (!OpenTaiko.stage演奏ドラム画面.bPAUSE) nNowDancerCounter += Math.Abs((float)OpenTaiko.stage演奏ドラム画面.actPlayInfo.dbBPM[0] / 60.0f) * (float)OpenTaiko.FPS.DeltaTime / nDancerBeat; - if (nNowDancerCounter >= 1) { - nNowDancerCounter = 0; - } - nNowDancerFrame = (int)(nNowDancerCounter * (this.ar踊り子モーション番号.Length - 1)); - - for (int i = 0; i < nDancerCount; i++) { - if ((int)OpenTaiko.stage演奏ドラム画面.actGauge.db現在のゲージ値[0] >= OpenTaiko.Skin.Game_Dancer_Gauge[i]) { - if (DancerStates[i] == 0) { - DancerStates[i] = 1; - nNowDancerInCounter[i] = 0; - } - } else { - if (DancerStates[i] == 3) { - DancerStates[i] = 2; - nNowDancerOutCounter[i] = 0; - } - } - - switch (DancerStates[i]) { - case 0: - break; - case 1: { - if (nDancerInInterval == 0) { - DancerStates[i] = 3; - } else { - if (!OpenTaiko.stage演奏ドラム画面.bPAUSE) nNowDancerInCounter[i] += Math.Abs((float)OpenTaiko.stage演奏ドラム画面.actPlayInfo.dbBPM[0] / nDancerInInterval) * (float)OpenTaiko.FPS.DeltaTime; - - if (nNowDancerInCounter[i] >= 1) { - nNowDancerInCounter[i] = 1; - DancerStates[i] = 3; - } - - int frame = (int)(nNowDancerInCounter[i] * (this.arMotionArray_In.Length - 1)); - if (this.Dancer_In[i] != null && this.Dancer_In[i].Length > 0 && this.Dancer_In[i][this.arMotionArray_In[frame]] != null) { - this.Dancer_In[i][this.arMotionArray_In[frame]].t2D中心基準描画(OpenTaiko.Skin.Game_Dancer_X[i], OpenTaiko.Skin.Game_Dancer_Y[i]); - } - } - - } - break; - case 2: { - if (nDancerOutInterval == 0) { - DancerStates[i] = 0; - } else { - if (!OpenTaiko.stage演奏ドラム画面.bPAUSE) nNowDancerOutCounter[i] += Math.Abs((float)OpenTaiko.stage演奏ドラム画面.actPlayInfo.dbBPM[0] / nDancerOutInterval) * (float)OpenTaiko.FPS.DeltaTime; - - if (nNowDancerOutCounter[i] >= 1) { - nNowDancerOutCounter[i] = 1; - DancerStates[i] = 0; - } - - int frame = (int)(nNowDancerOutCounter[i] * (this.arMotionArray_Out.Length - 1)); - if (this.Dancer_Out[i] != null && this.Dancer_Out[i].Length > 0 && this.Dancer_Out[i][this.arMotionArray_Out[frame]] != null) { - this.Dancer_Out[i][this.arMotionArray_Out[frame]].t2D中心基準描画(OpenTaiko.Skin.Game_Dancer_X[i], OpenTaiko.Skin.Game_Dancer_Y[i]); - } - } - } - break; - case 3: - if (this.Dancer[i] != null && this.Dancer[i].Length > 0 && this.Dancer[i][this.ar踊り子モーション番号[nNowDancerFrame]] != null) { - this.Dancer[i][this.ar踊り子モーション番号[nNowDancerFrame]].t2D中心基準描画(OpenTaiko.Skin.Game_Dancer_X[i], OpenTaiko.Skin.Game_Dancer_Y[i]); - } - break; - } - } - } - } - - return base.Draw(); - } - - #region[ private ] - //----------------- - private int nDancerCount; - private float[] nNowDancerInCounter; - private float[] nNowDancerOutCounter; - private float nNowDancerCounter; - private int nNowDancerFrame; - private int nDancerInPtn; - private int nDancerOutPtn; - private int nDancerPtn; - private float nDancerBeat; - private float nDancerInInterval; - private float nDancerOutInterval; - private int[] arMotionArray_In; - private int[] arMotionArray_Out; - private int[] ar踊り子モーション番号; - //public CCounter ct踊り子モーション; - private CTexture[][] Dancer_In; - private CTexture[][] Dancer_Out; - private CTexture[][] Dancer; - private int[] DancerStates; - private string Game_Dancer_In_Motion; - private string Game_Dancer_Out_Motion; - - private void LoadDancerConifg(string dancerPath) { - var _str = ""; - OpenTaiko.Skin.LoadSkinConfigFromFile(dancerPath + @$"{Path.DirectorySeparatorChar}DancerConfig.txt", ref _str); - - string[] delimiter = { "\n" }; - string[] strSingleLine = _str.Split(delimiter, StringSplitOptions.RemoveEmptyEntries); - - OpenTaiko.Skin.Game_Dancer_X = new int[] { 640, 430, 856, 215, 1070 }; - OpenTaiko.Skin.Game_Dancer_Y = new int[] { 500, 500, 500, 500, 500 }; - nDancerCount = 5; - nDancerInInterval = 0; - nDancerOutInterval = 0; - - foreach (string s in strSingleLine) { - string str = s.Replace('\t', ' ').TrimStart(new char[] { '\t', ' ' }); - if ((str.Length != 0) && (str[0] != ';')) { - try { - string strCommand; - string strParam; - string[] strArray = str.Split(new char[] { '=' }); - - if (strArray.Length == 2) { - strCommand = strArray[0].Trim(); - strParam = strArray[1].Trim(); - - if (strCommand == "Game_Dancer_Count") { - nDancerCount = int.Parse(strParam); - OpenTaiko.Skin.Game_Dancer_X = new int[nDancerCount]; - OpenTaiko.Skin.Game_Dancer_Y = new int[nDancerCount]; - } else if (strCommand == "Game_Dancer_X") { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < nDancerCount; i++) { - OpenTaiko.Skin.Game_Dancer_X[i] = int.Parse(strSplit[i]); - } - } else if (strCommand == "Game_Dancer_Y") { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < nDancerCount; i++) { - OpenTaiko.Skin.Game_Dancer_Y[i] = int.Parse(strSplit[i]); - } - } else if (strCommand == "Game_Dancer_Motion") { - OpenTaiko.Skin.Game_Dancer_Motion = strParam; - } else if (strCommand == "Game_Dancer_In_Motion") { - Game_Dancer_In_Motion = strParam; - } else if (strCommand == "Game_Dancer_Out_Motion") { - Game_Dancer_Out_Motion = strParam; - } else if (strCommand == "Game_Dancer_Beat") { - nDancerBeat = int.Parse(strParam); - } else if (strCommand == "Game_Dancer_In_Interval") { - nDancerInInterval = int.Parse(strParam); - } else if (strCommand == "Game_Dancer_Out_Interval") { - nDancerOutInterval = int.Parse(strParam); - } else if (strCommand == "Game_Dancer_Gauge") { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < nDancerCount; i++) { - OpenTaiko.Skin.Game_Dancer_Gauge[i] = int.Parse(strSplit[i]); - } - } - - } - continue; - } catch (Exception exception) { - Trace.TraceError(exception.ToString()); - Trace.TraceError("例外が発生しましたが処理を継続します。 (6a32cc37-1527-412e-968a-512c1f0135cd)"); - continue; - } - } - } - - } - //----------------- - #endregion +internal class CActImplDancer : CActivity { + /// + /// 踊り子 + /// + public CActImplDancer() { + base.IsDeActivated = true; } + + public override void Activate() { + //this.ct踊り子モーション = new CCounter(); + + if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Tower || OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) + return; + + var preset = HScenePreset.GetBGPreset(); + + if (preset == null) return; + + Random random = new Random(); + + Dancer_In = new CTexture[5][]; + Dancer_Out = new CTexture[5][]; + Dancer = new CTexture[5][]; + DancerStates = new int[5]; + nNowDancerInCounter = new float[5]; + nNowDancerOutCounter = new float[5]; + + + + var dancerOrigindir = CSkin.Path($"{TextureLoader.BASE}{TextureLoader.GAME}{TextureLoader.DANCER}"); + if (Directory.Exists($@"{dancerOrigindir}")) { + var dirs = Directory.GetDirectories($@"{dancerOrigindir}"); + if (preset.DancerSet != null) { + var _presetPath = (preset.DancerSet.Length > 0) ? $@"{dancerOrigindir}" + preset.DancerSet[random.Next(0, preset.DancerSet.Length)] : ""; + var path = (Directory.Exists(_presetPath)) + ? _presetPath + : (dirs.Length > 0 ? dirs[random.Next(0, dirs.Length)] : ""); + + LoadDancerConifg(path); + + Dancer_In = new CTexture[nDancerCount][]; + Dancer_Out = new CTexture[nDancerCount][]; + Dancer = new CTexture[nDancerCount][]; + DancerStates = new int[nDancerCount]; + nNowDancerInCounter = new float[nDancerCount]; + nNowDancerOutCounter = new float[nDancerCount]; + + nDancerInPtn = OpenTaiko.t連番画像の枚数を数える($@"{path}{Path.DirectorySeparatorChar}1_In{Path.DirectorySeparatorChar}"); + if (nDancerInPtn != 0) { + for (int i = 0; i < nDancerCount; i++) { + Dancer_In[i] = new CTexture[nDancerInPtn]; + for (int p = 0; p < nDancerInPtn; p++) { + Dancer_In[i][p] = OpenTaiko.tテクスチャの生成($@"{path}{Path.DirectorySeparatorChar}{(i + 1)}_In{Path.DirectorySeparatorChar}{p}.png"); + } + } + } + + nDancerOutPtn = OpenTaiko.t連番画像の枚数を数える($@"{path}{Path.DirectorySeparatorChar}1_Out{Path.DirectorySeparatorChar}"); + if (nDancerOutPtn != 0) { + for (int i = 0; i < nDancerCount; i++) { + Dancer_Out[i] = new CTexture[nDancerOutPtn]; + for (int p = 0; p < nDancerOutPtn; p++) { + Dancer_Out[i][p] = OpenTaiko.tテクスチャの生成($@"{path}{Path.DirectorySeparatorChar}{(i + 1)}_Out{Path.DirectorySeparatorChar}{p}.png"); + } + } + } + + nDancerPtn = OpenTaiko.t連番画像の枚数を数える($@"{path}{Path.DirectorySeparatorChar}1{Path.DirectorySeparatorChar}"); + if (nDancerPtn != 0) { + for (int i = 0; i < nDancerCount; i++) { + Dancer[i] = new CTexture[nDancerPtn]; + for (int p = 0; p < nDancerPtn; p++) { + Dancer[i][p] = OpenTaiko.tテクスチャの生成($@"{path}{Path.DirectorySeparatorChar}{(i + 1)}{Path.DirectorySeparatorChar}{p}.png"); + } + } + } + } + } + + arMotionArray_In = CConversion.StringToIntArray(Game_Dancer_In_Motion); + if (this.arMotionArray_In == null) arMotionArray_In = CConversion.StringToIntArray("0,0"); + + arMotionArray_Out = CConversion.StringToIntArray(Game_Dancer_Out_Motion); + if (this.arMotionArray_Out == null) arMotionArray_Out = CConversion.StringToIntArray("0,0"); + + this.ar踊り子モーション番号 = CConversion.StringToIntArray(OpenTaiko.Skin.Game_Dancer_Motion); + if (this.ar踊り子モーション番号 == null) ar踊り子モーション番号 = CConversion.StringToIntArray("0,0"); + + nNowDancerCounter = 0; + nNowDancerFrame = 0; + + base.Activate(); + } + + public override void DeActivate() { + if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Tower || OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) + return; + + //this.ct踊り子モーション = null; + + for (int i = 0; i < nDancerCount; i++) { + OpenTaiko.t安全にDisposeする(ref Dancer_In[i]); + OpenTaiko.t安全にDisposeする(ref Dancer_Out[i]); + OpenTaiko.t安全にDisposeする(ref Dancer[i]); + } + + base.DeActivate(); + } + + public override void CreateManagedResource() { + base.CreateManagedResource(); + } + + public override void ReleaseManagedResource() { + base.ReleaseManagedResource(); + } + + public override int Draw() { + if (this.IsFirstDraw) { + this.IsFirstDraw = true; + } + + if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] != (int)Difficulty.Tower && OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] != (int)Difficulty.Dan) { + if (OpenTaiko.ConfigIni.ShowDancer && (this.ar踊り子モーション番号.Length - 1) != 0) { + if (!OpenTaiko.stage演奏ドラム画面.bPAUSE) nNowDancerCounter += Math.Abs((float)OpenTaiko.stage演奏ドラム画面.actPlayInfo.dbBPM[0] / 60.0f) * (float)OpenTaiko.FPS.DeltaTime / nDancerBeat; + if (nNowDancerCounter >= 1) { + nNowDancerCounter = 0; + } + nNowDancerFrame = (int)(nNowDancerCounter * (this.ar踊り子モーション番号.Length - 1)); + + for (int i = 0; i < nDancerCount; i++) { + if ((int)OpenTaiko.stage演奏ドラム画面.actGauge.db現在のゲージ値[0] >= OpenTaiko.Skin.Game_Dancer_Gauge[i]) { + if (DancerStates[i] == 0) { + DancerStates[i] = 1; + nNowDancerInCounter[i] = 0; + } + } else { + if (DancerStates[i] == 3) { + DancerStates[i] = 2; + nNowDancerOutCounter[i] = 0; + } + } + + switch (DancerStates[i]) { + case 0: + break; + case 1: { + if (nDancerInInterval == 0) { + DancerStates[i] = 3; + } else { + if (!OpenTaiko.stage演奏ドラム画面.bPAUSE) nNowDancerInCounter[i] += Math.Abs((float)OpenTaiko.stage演奏ドラム画面.actPlayInfo.dbBPM[0] / nDancerInInterval) * (float)OpenTaiko.FPS.DeltaTime; + + if (nNowDancerInCounter[i] >= 1) { + nNowDancerInCounter[i] = 1; + DancerStates[i] = 3; + } + + int frame = (int)(nNowDancerInCounter[i] * (this.arMotionArray_In.Length - 1)); + if (this.Dancer_In[i] != null && this.Dancer_In[i].Length > 0 && this.Dancer_In[i][this.arMotionArray_In[frame]] != null) { + this.Dancer_In[i][this.arMotionArray_In[frame]].t2D中心基準描画(OpenTaiko.Skin.Game_Dancer_X[i], OpenTaiko.Skin.Game_Dancer_Y[i]); + } + } + + } + break; + case 2: { + if (nDancerOutInterval == 0) { + DancerStates[i] = 0; + } else { + if (!OpenTaiko.stage演奏ドラム画面.bPAUSE) nNowDancerOutCounter[i] += Math.Abs((float)OpenTaiko.stage演奏ドラム画面.actPlayInfo.dbBPM[0] / nDancerOutInterval) * (float)OpenTaiko.FPS.DeltaTime; + + if (nNowDancerOutCounter[i] >= 1) { + nNowDancerOutCounter[i] = 1; + DancerStates[i] = 0; + } + + int frame = (int)(nNowDancerOutCounter[i] * (this.arMotionArray_Out.Length - 1)); + if (this.Dancer_Out[i] != null && this.Dancer_Out[i].Length > 0 && this.Dancer_Out[i][this.arMotionArray_Out[frame]] != null) { + this.Dancer_Out[i][this.arMotionArray_Out[frame]].t2D中心基準描画(OpenTaiko.Skin.Game_Dancer_X[i], OpenTaiko.Skin.Game_Dancer_Y[i]); + } + } + } + break; + case 3: + if (this.Dancer[i] != null && this.Dancer[i].Length > 0 && this.Dancer[i][this.ar踊り子モーション番号[nNowDancerFrame]] != null) { + this.Dancer[i][this.ar踊り子モーション番号[nNowDancerFrame]].t2D中心基準描画(OpenTaiko.Skin.Game_Dancer_X[i], OpenTaiko.Skin.Game_Dancer_Y[i]); + } + break; + } + } + } + } + + return base.Draw(); + } + + #region[ private ] + //----------------- + private int nDancerCount; + private float[] nNowDancerInCounter; + private float[] nNowDancerOutCounter; + private float nNowDancerCounter; + private int nNowDancerFrame; + private int nDancerInPtn; + private int nDancerOutPtn; + private int nDancerPtn; + private float nDancerBeat; + private float nDancerInInterval; + private float nDancerOutInterval; + private int[] arMotionArray_In; + private int[] arMotionArray_Out; + private int[] ar踊り子モーション番号; + //public CCounter ct踊り子モーション; + private CTexture[][] Dancer_In; + private CTexture[][] Dancer_Out; + private CTexture[][] Dancer; + private int[] DancerStates; + private string Game_Dancer_In_Motion; + private string Game_Dancer_Out_Motion; + + private void LoadDancerConifg(string dancerPath) { + var _str = ""; + OpenTaiko.Skin.LoadSkinConfigFromFile(dancerPath + @$"{Path.DirectorySeparatorChar}DancerConfig.txt", ref _str); + + string[] delimiter = { "\n" }; + string[] strSingleLine = _str.Split(delimiter, StringSplitOptions.RemoveEmptyEntries); + + OpenTaiko.Skin.Game_Dancer_X = new int[] { 640, 430, 856, 215, 1070 }; + OpenTaiko.Skin.Game_Dancer_Y = new int[] { 500, 500, 500, 500, 500 }; + nDancerCount = 5; + nDancerInInterval = 0; + nDancerOutInterval = 0; + + foreach (string s in strSingleLine) { + string str = s.Replace('\t', ' ').TrimStart(new char[] { '\t', ' ' }); + if ((str.Length != 0) && (str[0] != ';')) { + try { + string strCommand; + string strParam; + string[] strArray = str.Split(new char[] { '=' }); + + if (strArray.Length == 2) { + strCommand = strArray[0].Trim(); + strParam = strArray[1].Trim(); + + if (strCommand == "Game_Dancer_Count") { + nDancerCount = int.Parse(strParam); + OpenTaiko.Skin.Game_Dancer_X = new int[nDancerCount]; + OpenTaiko.Skin.Game_Dancer_Y = new int[nDancerCount]; + } else if (strCommand == "Game_Dancer_X") { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < nDancerCount; i++) { + OpenTaiko.Skin.Game_Dancer_X[i] = int.Parse(strSplit[i]); + } + } else if (strCommand == "Game_Dancer_Y") { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < nDancerCount; i++) { + OpenTaiko.Skin.Game_Dancer_Y[i] = int.Parse(strSplit[i]); + } + } else if (strCommand == "Game_Dancer_Motion") { + OpenTaiko.Skin.Game_Dancer_Motion = strParam; + } else if (strCommand == "Game_Dancer_In_Motion") { + Game_Dancer_In_Motion = strParam; + } else if (strCommand == "Game_Dancer_Out_Motion") { + Game_Dancer_Out_Motion = strParam; + } else if (strCommand == "Game_Dancer_Beat") { + nDancerBeat = int.Parse(strParam); + } else if (strCommand == "Game_Dancer_In_Interval") { + nDancerInInterval = int.Parse(strParam); + } else if (strCommand == "Game_Dancer_Out_Interval") { + nDancerOutInterval = int.Parse(strParam); + } else if (strCommand == "Game_Dancer_Gauge") { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < nDancerCount; i++) { + OpenTaiko.Skin.Game_Dancer_Gauge[i] = int.Parse(strSplit[i]); + } + } + + } + continue; + } catch (Exception exception) { + Trace.TraceError(exception.ToString()); + Trace.TraceError("例外が発生しましたが処理を継続します。 (6a32cc37-1527-412e-968a-512c1f0135cd)"); + continue; + } + } + } + + } + //----------------- + #endregion } diff --git a/OpenTaiko/src/Stages/07.Game/Taiko/CActImplFireworks.cs b/OpenTaiko/src/Stages/07.Game/Taiko/CActImplFireworks.cs index a2a06555..a4841727 100644 --- a/OpenTaiko/src/Stages/07.Game/Taiko/CActImplFireworks.cs +++ b/OpenTaiko/src/Stages/07.Game/Taiko/CActImplFireworks.cs @@ -2,272 +2,200 @@ using FDK; using Rectangle = System.Drawing.Rectangle; -namespace OpenTaiko { - internal class CActImplFireworks : CActivity { - // コンストラクタ +namespace OpenTaiko; - public CActImplFireworks() { - base.IsDeActivated = true; - } +internal class CActImplFireworks : CActivity { + // コンストラクタ + + public CActImplFireworks() { + base.IsDeActivated = true; + } - // メソッド + // メソッド - /// - /// 大音符の花火エフェクト - /// - /// - public virtual void Start(int nLane, int nPlayer) { - nY座標P2 = new int[] { 548, 612, 670, 712, 730, 780, 725, 690, 640 }; - if (OpenTaiko.Tx.Effects_Hit_FireWorks != null && OpenTaiko.Tx.Effects_Hit_FireWorks != null) { - for (int i = 0; i < 9; i++) { - for (int j = 0; j < 45; j++) { - if (!this.st大音符花火[j].b使用中) { - this.st大音符花火[j].b使用中 = true; - this.st大音符花火[j].ct進行 = new CCounter(0, 40, 18, OpenTaiko.Timer); // カウンタ - this.st大音符花火[j].fX = this.nX座標[i]; //X座標 - this.st大音符花火[j].fY = nPlayer == 0 ? this.nY座標[i] : this.nY座標P2[i]; + /// + /// 大音符の花火エフェクト + /// + /// + public virtual void Start(int nLane, int nPlayer) { + nY座標P2 = new int[] { 548, 612, 670, 712, 730, 780, 725, 690, 640 }; + if (OpenTaiko.Tx.Effects_Hit_FireWorks != null && OpenTaiko.Tx.Effects_Hit_FireWorks != null) { + for (int i = 0; i < 9; i++) { + for (int j = 0; j < 45; j++) { + if (!this.st大音符花火[j].b使用中) { + this.st大音符花火[j].b使用中 = true; + this.st大音符花火[j].ct進行 = new CCounter(0, 40, 18, OpenTaiko.Timer); // カウンタ + this.st大音符花火[j].fX = this.nX座標[i]; //X座標 + this.st大音符花火[j].fY = nPlayer == 0 ? this.nY座標[i] : this.nY座標P2[i]; - switch (nLane) { - case 0: - this.st大音符花火[j].nColor = 0; - break; - case 1: - this.st大音符花火[j].nColor = 1; - break; - } - - switch (i) { - case 0: - this.st大音符花火[j].n開始フレーム = 0; - this.st大音符花火[j].n終了フレーム = 16; - break; - case 1: - this.st大音符花火[j].n開始フレーム = 3; - this.st大音符花火[j].n終了フレーム = 19; - break; - case 2: - this.st大音符花火[j].n開始フレーム = 6; - this.st大音符花火[j].n終了フレーム = 22; - break; - case 3: - this.st大音符花火[j].n開始フレーム = 9; - this.st大音符花火[j].n終了フレーム = 25; - break; - case 4: - this.st大音符花火[j].n開始フレーム = 12; - this.st大音符花火[j].n終了フレーム = 28; - break; - case 5: - this.st大音符花火[j].n開始フレーム = 15; - this.st大音符花火[j].n終了フレーム = 31; - break; - case 6: - this.st大音符花火[j].n開始フレーム = 18; - this.st大音符花火[j].n終了フレーム = 34; - break; - case 7: - this.st大音符花火[j].n開始フレーム = 21; - this.st大音符花火[j].n終了フレーム = 37; - break; - case 8: - this.st大音符花火[j].n開始フレーム = 24; - this.st大音符花火[j].n終了フレーム = 40; - break; - } - - - - break; + switch (nLane) { + case 0: + this.st大音符花火[j].nColor = 0; + break; + case 1: + this.st大音符花火[j].nColor = 1; + break; } + + switch (i) { + case 0: + this.st大音符花火[j].n開始フレーム = 0; + this.st大音符花火[j].n終了フレーム = 16; + break; + case 1: + this.st大音符花火[j].n開始フレーム = 3; + this.st大音符花火[j].n終了フレーム = 19; + break; + case 2: + this.st大音符花火[j].n開始フレーム = 6; + this.st大音符花火[j].n終了フレーム = 22; + break; + case 3: + this.st大音符花火[j].n開始フレーム = 9; + this.st大音符花火[j].n終了フレーム = 25; + break; + case 4: + this.st大音符花火[j].n開始フレーム = 12; + this.st大音符花火[j].n終了フレーム = 28; + break; + case 5: + this.st大音符花火[j].n開始フレーム = 15; + this.st大音符花火[j].n終了フレーム = 31; + break; + case 6: + this.st大音符花火[j].n開始フレーム = 18; + this.st大音符花火[j].n終了フレーム = 34; + break; + case 7: + this.st大音符花火[j].n開始フレーム = 21; + this.st大音符花火[j].n終了フレーム = 37; + break; + case 8: + this.st大音符花火[j].n開始フレーム = 24; + this.st大音符花火[j].n終了フレーム = 40; + break; + } + + + + break; } } } } + } - public virtual void Start(int nLane, ENoteJudge judge, int player) { - for (int j = 0; j < 3 * 4; j++) { - if (!this.st状態[j].b使用中) - //for( int n = 0; n < 1; n++ ) - { - this.st状態[j].b使用中 = true; - //this.st状態[ n ].ct進行 = new CCounter( 0, 9, 20, CDTXMania.Timer ); - this.st状態[j].ct進行 = new CCounter(0, 6, 25, OpenTaiko.Timer); - this.st状態[j].judge = judge; - this.st状態[j].nPlayer = player; - this.st状態_大[j].nPlayer = player; + public virtual void Start(int nLane, ENoteJudge judge, int player) { + for (int j = 0; j < 3 * 4; j++) { + if (!this.st状態[j].b使用中) + //for( int n = 0; n < 1; n++ ) + { + this.st状態[j].b使用中 = true; + //this.st状態[ n ].ct進行 = new CCounter( 0, 9, 20, CDTXMania.Timer ); + this.st状態[j].ct進行 = new CCounter(0, 6, 25, OpenTaiko.Timer); + this.st状態[j].judge = judge; + this.st状態[j].nPlayer = player; + this.st状態_大[j].nPlayer = player; - switch (nLane) { - case 0x11: - case 0x12: - this.st状態[j].nIsBig = 0; - break; - case 0x13: - case 0x14: - case 0x1A: - case 0x1B: - this.st状態_大[j].ct進行 = new CCounter(0, 9, 20, OpenTaiko.Timer); - this.st状態_大[j].judge = judge; - this.st状態_大[j].nIsBig = 1; - break; - } - break; + switch (nLane) { + case 0x11: + case 0x12: + this.st状態[j].nIsBig = 0; + break; + case 0x13: + case 0x14: + case 0x1A: + case 0x1B: + this.st状態_大[j].ct進行 = new CCounter(0, 9, 20, OpenTaiko.Timer); + this.st状態_大[j].judge = judge; + this.st状態_大[j].nIsBig = 1; + break; } + break; } } + } - // CActivity 実装 + // CActivity 実装 - public override void Activate() { + public override void Activate() { + for (int i = 0; i < 3 * 4; i++) { + this.st状態[i].ct進行 = new CCounter(); + this.st状態[i].b使用中 = false; + this.st状態_大[i].ct進行 = new CCounter(); + } + for (int i = 0; i < 256; i++) { + this.st紙吹雪[i] = new ST紙吹雪(); + this.st紙吹雪[i].b使用中 = false; + this.st紙吹雪[i].ct進行 = new CCounter(); + } + base.Activate(); + } + public override void DeActivate() { + for (int i = 0; i < 3 * 4; i++) { + this.st状態[i].ct進行 = null; + this.st状態_大[i].ct進行 = null; + } + for (int i = 0; i < 256; i++) { + this.st紙吹雪[i].ct進行 = null; + } + base.DeActivate(); + } + public override void CreateManagedResource() { + base.CreateManagedResource(); + } + public override void ReleaseManagedResource() { + base.ReleaseManagedResource(); + } + public override int Draw() { + if (!base.IsDeActivated) { + int nWidth = (OpenTaiko.Tx.Effects_Hit_Explosion.szTextureSize.Width / 7); + int nHeight = (OpenTaiko.Tx.Effects_Hit_Explosion.szTextureSize.Height / 4); + int nBombWidth = (OpenTaiko.Tx.Effects_Hit_Bomb.szTextureSize.Width / 7); + int nBombHeight = (OpenTaiko.Tx.Effects_Hit_Bomb.szTextureSize.Height / 4); for (int i = 0; i < 3 * 4; i++) { - this.st状態[i].ct進行 = new CCounter(); - this.st状態[i].b使用中 = false; - this.st状態_大[i].ct進行 = new CCounter(); - } - for (int i = 0; i < 256; i++) { - this.st紙吹雪[i] = new ST紙吹雪(); - this.st紙吹雪[i].b使用中 = false; - this.st紙吹雪[i].ct進行 = new CCounter(); - } - base.Activate(); - } - public override void DeActivate() { - for (int i = 0; i < 3 * 4; i++) { - this.st状態[i].ct進行 = null; - this.st状態_大[i].ct進行 = null; - } - for (int i = 0; i < 256; i++) { - this.st紙吹雪[i].ct進行 = null; - } - base.DeActivate(); - } - public override void CreateManagedResource() { - base.CreateManagedResource(); - } - public override void ReleaseManagedResource() { - base.ReleaseManagedResource(); - } - public override int Draw() { - if (!base.IsDeActivated) { - int nWidth = (OpenTaiko.Tx.Effects_Hit_Explosion.szTextureSize.Width / 7); - int nHeight = (OpenTaiko.Tx.Effects_Hit_Explosion.szTextureSize.Height / 4); - int nBombWidth = (OpenTaiko.Tx.Effects_Hit_Bomb.szTextureSize.Width / 7); - int nBombHeight = (OpenTaiko.Tx.Effects_Hit_Bomb.szTextureSize.Height / 4); - for (int i = 0; i < 3 * 4; i++) { - if (this.st状態[i].b使用中) { - if (!this.st状態[i].ct進行.IsStoped) { - this.st状態[i].ct進行.Tick(); - if (this.st状態[i].ct進行.IsEnded) { - this.st状態[i].ct進行.Stop(); - this.st状態[i].b使用中 = false; - } - - // (When performing calibration, reduce visual distraction - // and current judgment feedback near the judgment position.) - if (OpenTaiko.Tx.Effects_Hit_Explosion != null) { - int n = this.st状態[i].nIsBig == 1 ? (nHeight * 2) : 0; - - int nX = 0; - int nY = 0; - - if (OpenTaiko.ConfigIni.nPlayerCount == 5) { - nX = OpenTaiko.Skin.Game_Effects_Hit_Explosion_5P[0] + (OpenTaiko.Skin.Game_UIMove_5P[0] * this.st状態[i].nPlayer); - nY = OpenTaiko.Skin.Game_Effects_Hit_Explosion_5P[1] + (OpenTaiko.Skin.Game_UIMove_5P[1] * this.st状態[i].nPlayer); - } else if (OpenTaiko.ConfigIni.nPlayerCount == 4 || OpenTaiko.ConfigIni.nPlayerCount == 3) { - nX = OpenTaiko.Skin.Game_Effects_Hit_Explosion_4P[0] + (OpenTaiko.Skin.Game_UIMove_4P[0] * this.st状態[i].nPlayer); - nY = OpenTaiko.Skin.Game_Effects_Hit_Explosion_4P[1] + (OpenTaiko.Skin.Game_UIMove_4P[1] * this.st状態[i].nPlayer); - } else { - nX = OpenTaiko.Skin.Game_Effects_Hit_Explosion_X[this.st状態[i].nPlayer]; - nY = OpenTaiko.Skin.Game_Effects_Hit_Explosion_Y[this.st状態[i].nPlayer]; - } - nX += OpenTaiko.stage演奏ドラム画面.GetJPOSCROLLX(this.st状態[i].nPlayer); - nY += OpenTaiko.stage演奏ドラム画面.GetJPOSCROLLY(this.st状態[i].nPlayer); - - switch (st状態[i].judge) { - case ENoteJudge.Perfect: - case ENoteJudge.Great: - case ENoteJudge.Auto: - if (!OpenTaiko.ConfigIni.SimpleMode) OpenTaiko.Tx.Effects_Hit_Explosion.t2D描画(nX, nY, new Rectangle(this.st状態[i].ct進行.CurrentValue * nWidth, n, nWidth, nHeight)); - break; - case ENoteJudge.Good: - OpenTaiko.Tx.Effects_Hit_Explosion.t2D描画(nX, nY, new Rectangle(this.st状態[i].ct進行.CurrentValue * nWidth, n + nHeight, nWidth, nHeight)); - break; - case ENoteJudge.Mine: - OpenTaiko.Tx.Effects_Hit_Bomb?.t2D描画(nX, nY, new Rectangle(this.st状態[i].ct進行.CurrentValue * nBombWidth, 0, nBombWidth, nBombHeight)); - break; - case ENoteJudge.Miss: - case ENoteJudge.Bad: - break; - } - } + if (this.st状態[i].b使用中) { + if (!this.st状態[i].ct進行.IsStoped) { + this.st状態[i].ct進行.Tick(); + if (this.st状態[i].ct進行.IsEnded) { + this.st状態[i].ct進行.Stop(); + this.st状態[i].b使用中 = false; } - } - } - for (int i = 0; i < 3 * 4; i++) { - if (!this.st状態_大[i].ct進行.IsStoped) { - this.st状態_大[i].ct進行.Tick(); - if (this.st状態_大[i].ct進行.IsEnded) { - this.st状態_大[i].ct進行.Stop(); - } - if (OpenTaiko.Tx.Effects_Hit_Explosion_Big != null && this.st状態_大[i].nIsBig == 1) { + // (When performing calibration, reduce visual distraction + // and current judgment feedback near the judgment position.) + if (OpenTaiko.Tx.Effects_Hit_Explosion != null) { + int n = this.st状態[i].nIsBig == 1 ? (nHeight * 2) : 0; - switch (st状態_大[i].judge) { + int nX = 0; + int nY = 0; + + if (OpenTaiko.ConfigIni.nPlayerCount == 5) { + nX = OpenTaiko.Skin.Game_Effects_Hit_Explosion_5P[0] + (OpenTaiko.Skin.Game_UIMove_5P[0] * this.st状態[i].nPlayer); + nY = OpenTaiko.Skin.Game_Effects_Hit_Explosion_5P[1] + (OpenTaiko.Skin.Game_UIMove_5P[1] * this.st状態[i].nPlayer); + } else if (OpenTaiko.ConfigIni.nPlayerCount == 4 || OpenTaiko.ConfigIni.nPlayerCount == 3) { + nX = OpenTaiko.Skin.Game_Effects_Hit_Explosion_4P[0] + (OpenTaiko.Skin.Game_UIMove_4P[0] * this.st状態[i].nPlayer); + nY = OpenTaiko.Skin.Game_Effects_Hit_Explosion_4P[1] + (OpenTaiko.Skin.Game_UIMove_4P[1] * this.st状態[i].nPlayer); + } else { + nX = OpenTaiko.Skin.Game_Effects_Hit_Explosion_X[this.st状態[i].nPlayer]; + nY = OpenTaiko.Skin.Game_Effects_Hit_Explosion_Y[this.st状態[i].nPlayer]; + } + nX += OpenTaiko.stage演奏ドラム画面.GetJPOSCROLLX(this.st状態[i].nPlayer); + nY += OpenTaiko.stage演奏ドラム画面.GetJPOSCROLLY(this.st状態[i].nPlayer); + + switch (st状態[i].judge) { case ENoteJudge.Perfect: case ENoteJudge.Great: case ENoteJudge.Auto: - if (this.st状態_大[i].nIsBig == 1 && !OpenTaiko.ConfigIni.SimpleMode) { - //float fX = 415 - ((TJAPlayer3.Tx.Effects_Hit_Explosion_Big.sz画像サイズ.Width * TJAPlayer3.Tx.Effects_Hit_Explosion_Big.vc拡大縮小倍率.X ) / 2.0f); - //float fY = TJAPlayer3.Skin.nJudgePointY[ this.st状態_大[ i ].nPlayer ] - ((TJAPlayer3.Tx.Effects_Hit_Explosion_Big.sz画像サイズ.Height * TJAPlayer3.Tx.Effects_Hit_Explosion_Big.vc拡大縮小倍率.Y ) / 2.0f); - //float fY = 257 - ((this.txアタックエフェクトUpper_big.sz画像サイズ.Height * this.txアタックエフェクトUpper_big.vc拡大縮小倍率.Y ) / 2.0f); - - ////7 - float f倍率 = 0.5f + ((this.st状態_大[i].ct進行.CurrentValue * 0.5f) / 10.0f); - //this.txアタックエフェクトUpper_big.vc拡大縮小倍率.X = f倍率; - //this.txアタックエフェクトUpper_big.vc拡大縮小倍率.Y = f倍率; - //this.txアタックエフェクトUpper_big.n透明度 = (int)(255 * f倍率); - //this.txアタックエフェクトUpper_big.t2D描画( CDTXMania.app.Device, fX, fY ); - - /* - Matrix mat = Matrix.Identity; - mat *= Matrix.Scaling( f倍率, f倍率, f倍率 ); - mat *= Matrix.Translation( TJAPlayer3.Skin.nScrollFieldX[0] - SampleFramework.GameWindowSize.Width / 2.0f, -(TJAPlayer3.Skin.nJudgePointY[ this.st状態[ i ].nPlayer ] - SampleFramework.GameWindowSize.Height / 2.0f), 0f ); - //mat *= Matrix.Billboard( new Vector3( 15, 15, 15 ), new Vector3(0, 0, 0), new Vector3( 0, 0, 0 ), new Vector3( 0, 0, 0 ) ); - //mat *= Matrix.Translation( 0f, 0f, 0f ); - - - TJAPlayer3.Tx.Effects_Hit_Explosion_Big.Opacity = 255; - TJAPlayer3.Tx.Effects_Hit_Explosion_Big.t3D描画( mat ); - */ - - float x = 0; - float y = 0; - - if (OpenTaiko.ConfigIni.nPlayerCount == 5) { - x = OpenTaiko.Skin.Game_Effects_Hit_Explosion_5P[0] + (OpenTaiko.Skin.Game_UIMove_5P[0] * this.st状態[i].nPlayer); - y = OpenTaiko.Skin.Game_Effects_Hit_Explosion_5P[1] + (OpenTaiko.Skin.Game_UIMove_5P[1] * this.st状態[i].nPlayer); - } else if (OpenTaiko.ConfigIni.nPlayerCount == 4 || OpenTaiko.ConfigIni.nPlayerCount == 3) { - x = OpenTaiko.Skin.Game_Effects_Hit_Explosion_4P[0] + (OpenTaiko.Skin.Game_UIMove_4P[0] * this.st状態[i].nPlayer); - y = OpenTaiko.Skin.Game_Effects_Hit_Explosion_4P[1] + (OpenTaiko.Skin.Game_UIMove_4P[1] * this.st状態[i].nPlayer); - } else { - x = OpenTaiko.Skin.Game_Effects_Hit_Explosion_X[this.st状態[i].nPlayer]; - y = OpenTaiko.Skin.Game_Effects_Hit_Explosion_Y[this.st状態[i].nPlayer]; - } - x += OpenTaiko.stage演奏ドラム画面.GetJPOSCROLLX(this.st状態[i].nPlayer); - y += OpenTaiko.stage演奏ドラム画面.GetJPOSCROLLY(this.st状態[i].nPlayer); - - x -= (OpenTaiko.Tx.Effects_Hit_Explosion_Big.szTextureSize.Width * (f倍率 - 1.0f) / 2.0f); - y -= (OpenTaiko.Tx.Effects_Hit_Explosion_Big.szTextureSize.Height * (f倍率 - 1.0f) / 2.0f); - - OpenTaiko.Tx.Effects_Hit_Explosion_Big.vcScaleRatio.X = f倍率; - OpenTaiko.Tx.Effects_Hit_Explosion_Big.vcScaleRatio.Y = f倍率; - OpenTaiko.Tx.Effects_Hit_Explosion_Big.t2D描画(x, y); - } + if (!OpenTaiko.ConfigIni.SimpleMode) OpenTaiko.Tx.Effects_Hit_Explosion.t2D描画(nX, nY, new Rectangle(this.st状態[i].ct進行.CurrentValue * nWidth, n, nWidth, nHeight)); break; - case ENoteJudge.Good: + OpenTaiko.Tx.Effects_Hit_Explosion.t2D描画(nX, nY, new Rectangle(this.st状態[i].ct進行.CurrentValue * nWidth, n + nHeight, nWidth, nHeight)); + break; + case ENoteJudge.Mine: + OpenTaiko.Tx.Effects_Hit_Bomb?.t2D描画(nX, nY, new Rectangle(this.st状態[i].ct進行.CurrentValue * nBombWidth, 0, nBombWidth, nBombHeight)); break; - case ENoteJudge.Miss: case ENoteJudge.Bad: break; @@ -275,153 +203,224 @@ namespace OpenTaiko { } } } + } - for (int i = 0; i < 45; i++) { - if (OpenTaiko.Skin.nScrollFieldX[0] != 414) - break; - - if (this.st大音符花火[i].b使用中) { - this.st大音符花火[i].n前回のValue = this.st大音符花火[i].ct進行.CurrentValue; - this.st大音符花火[i].ct進行.Tick(); - if (this.st大音符花火[i].ct進行.IsEnded) { - this.st大音符花火[i].ct進行.Stop(); - this.st大音符花火[i].b使用中 = false; - } - /* - Matrix mat = Matrix.Identity; - - mat *= Matrix.Translation(this.st大音符花火[i].fX - SampleFramework.GameWindowSize.Width / 2, -(this.st大音符花火[i].fY - SampleFramework.GameWindowSize.Height / 2), 0f); - */ - float fX = this.st大音符花火[i].fX - (192 / 2); - float fY = this.st大音符花火[i].fY - (192 / 2); - - //if(CDTXMania.Tx.Effects_Hit_FireWorks[ 0 ] != null && this.st大音符花火[ i ].nColor == 0 ) - //{ - // if( this.st大音符花火[ i ].n開始フレーム <= this.st大音符花火[ i ].ct進行.n現在の値 && this.st大音符花火[ i ].n終了フレーム > this.st大音符花火[ i ].ct進行.n現在の値 ) - // { - // //this.tx大音符花火[ 0 ].t3D描画(CDTXMania.app.Device, mat, new Rectangle( ( this.st大音符花火[i].ct進行.n現在の値 - this.st大音符花火[ i ].n開始フレーム ) * 192, 0, 192, 192 )); - // //this.tx大音符花火[ 0 ].t3D描画( CDTXMania.app.Device, mat, fX, fY, new Rectangle( ( this.st大音符花火[i].ct進行.n現在の値 - this.st大音符花火[ i ].n開始フレーム ) * 192, 0, 192, 192 ) ); - // CDTXMania.Tx.Effects_Hit_FireWorks[ 0 ].t2D描画( CDTXMania.app.Device, (int)fX, (int)fY, new Rectangle( ( this.st大音符花火[i].ct進行.n現在の値 - this.st大音符花火[ i ].n開始フレーム ) * 192, 0, 192, 192 ) ); - // } - //} - ////if(CDTXMania.Tx.Effects_Hit_FireWorks[ 1 ] != null && this.st大音符花火[ i ].nColor == 1 ) - //{ - // if( this.st大音符花火[ i ].n開始フレーム <= this.st大音符花火[ i ].ct進行.n現在の値 && this.st大音符花火[ i ].n終了フレーム > this.st大音符花火[ i ].ct進行.n現在の値 ) - // { - // //this.tx大音符花火[ 1 ].t3D描画( CDTXMania.app.Device, mat, fX, fY, ); - // //CDTXMania.Tx.Effects_Hit_FireWorks[ 1 ].t2D描画( CDTXMania.app.Device, (int)fX, (int)fY, new Rectangle( ( this.st大音符花火[i].ct進行.n現在の値 - this.st大音符花火[ i ].n開始フレーム ) * 192, 0, 192, 192 ) ); - // } - //} + for (int i = 0; i < 3 * 4; i++) { + if (!this.st状態_大[i].ct進行.IsStoped) { + this.st状態_大[i].ct進行.Tick(); + if (this.st状態_大[i].ct進行.IsEnded) { + this.st状態_大[i].ct進行.Stop(); } + if (OpenTaiko.Tx.Effects_Hit_Explosion_Big != null && this.st状態_大[i].nIsBig == 1) { - } + switch (st状態_大[i].judge) { + case ENoteJudge.Perfect: + case ENoteJudge.Great: + case ENoteJudge.Auto: + if (this.st状態_大[i].nIsBig == 1 && !OpenTaiko.ConfigIni.SimpleMode) { + //float fX = 415 - ((TJAPlayer3.Tx.Effects_Hit_Explosion_Big.sz画像サイズ.Width * TJAPlayer3.Tx.Effects_Hit_Explosion_Big.vc拡大縮小倍率.X ) / 2.0f); + //float fY = TJAPlayer3.Skin.nJudgePointY[ this.st状態_大[ i ].nPlayer ] - ((TJAPlayer3.Tx.Effects_Hit_Explosion_Big.sz画像サイズ.Height * TJAPlayer3.Tx.Effects_Hit_Explosion_Big.vc拡大縮小倍率.Y ) / 2.0f); + //float fY = 257 - ((this.txアタックエフェクトUpper_big.sz画像サイズ.Height * this.txアタックエフェクトUpper_big.vc拡大縮小倍率.Y ) / 2.0f); - for (int i = 0; i < 256; i++) { - if (this.st紙吹雪[i].b使用中) { - this.st紙吹雪[i].n前回のValue = this.st紙吹雪[i].ct進行.CurrentValue; - this.st紙吹雪[i].ct進行.Tick(); - if (this.st紙吹雪[i].ct進行.IsEnded) { - this.st紙吹雪[i].ct進行.Stop(); - this.st紙吹雪[i].b使用中 = false; - } else if (this.st紙吹雪[i].fX > 1300 || this.st紙吹雪[i].fX < -20) { - this.st紙吹雪[i].ct進行.Stop(); - this.st紙吹雪[i].b使用中 = false; + ////7 + float f倍率 = 0.5f + ((this.st状態_大[i].ct進行.CurrentValue * 0.5f) / 10.0f); + //this.txアタックエフェクトUpper_big.vc拡大縮小倍率.X = f倍率; + //this.txアタックエフェクトUpper_big.vc拡大縮小倍率.Y = f倍率; + //this.txアタックエフェクトUpper_big.n透明度 = (int)(255 * f倍率); + //this.txアタックエフェクトUpper_big.t2D描画( CDTXMania.app.Device, fX, fY ); + + /* + Matrix mat = Matrix.Identity; + mat *= Matrix.Scaling( f倍率, f倍率, f倍率 ); + mat *= Matrix.Translation( TJAPlayer3.Skin.nScrollFieldX[0] - SampleFramework.GameWindowSize.Width / 2.0f, -(TJAPlayer3.Skin.nJudgePointY[ this.st状態[ i ].nPlayer ] - SampleFramework.GameWindowSize.Height / 2.0f), 0f ); + //mat *= Matrix.Billboard( new Vector3( 15, 15, 15 ), new Vector3(0, 0, 0), new Vector3( 0, 0, 0 ), new Vector3( 0, 0, 0 ) ); + //mat *= Matrix.Translation( 0f, 0f, 0f ); + + + TJAPlayer3.Tx.Effects_Hit_Explosion_Big.Opacity = 255; + TJAPlayer3.Tx.Effects_Hit_Explosion_Big.t3D描画( mat ); + */ + + float x = 0; + float y = 0; + + if (OpenTaiko.ConfigIni.nPlayerCount == 5) { + x = OpenTaiko.Skin.Game_Effects_Hit_Explosion_5P[0] + (OpenTaiko.Skin.Game_UIMove_5P[0] * this.st状態[i].nPlayer); + y = OpenTaiko.Skin.Game_Effects_Hit_Explosion_5P[1] + (OpenTaiko.Skin.Game_UIMove_5P[1] * this.st状態[i].nPlayer); + } else if (OpenTaiko.ConfigIni.nPlayerCount == 4 || OpenTaiko.ConfigIni.nPlayerCount == 3) { + x = OpenTaiko.Skin.Game_Effects_Hit_Explosion_4P[0] + (OpenTaiko.Skin.Game_UIMove_4P[0] * this.st状態[i].nPlayer); + y = OpenTaiko.Skin.Game_Effects_Hit_Explosion_4P[1] + (OpenTaiko.Skin.Game_UIMove_4P[1] * this.st状態[i].nPlayer); + } else { + x = OpenTaiko.Skin.Game_Effects_Hit_Explosion_X[this.st状態[i].nPlayer]; + y = OpenTaiko.Skin.Game_Effects_Hit_Explosion_Y[this.st状態[i].nPlayer]; + } + x += OpenTaiko.stage演奏ドラム画面.GetJPOSCROLLX(this.st状態[i].nPlayer); + y += OpenTaiko.stage演奏ドラム画面.GetJPOSCROLLY(this.st状態[i].nPlayer); + + x -= (OpenTaiko.Tx.Effects_Hit_Explosion_Big.szTextureSize.Width * (f倍率 - 1.0f) / 2.0f); + y -= (OpenTaiko.Tx.Effects_Hit_Explosion_Big.szTextureSize.Height * (f倍率 - 1.0f) / 2.0f); + + OpenTaiko.Tx.Effects_Hit_Explosion_Big.vcScaleRatio.X = f倍率; + OpenTaiko.Tx.Effects_Hit_Explosion_Big.vcScaleRatio.Y = f倍率; + OpenTaiko.Tx.Effects_Hit_Explosion_Big.t2D描画(x, y); + } + break; + + case ENoteJudge.Good: + break; + + case ENoteJudge.Miss: + case ENoteJudge.Bad: + break; } - for (int n = this.st紙吹雪[i].n前回のValue; n < this.st紙吹雪[i].ct進行.CurrentValue; n++) { - this.st紙吹雪[i].fX -= this.st紙吹雪[i].f加速度X; - this.st紙吹雪[i].fY -= this.st紙吹雪[i].f加速度Y; - this.st紙吹雪[i].f加速度X *= this.st紙吹雪[i].f加速度の加速度X; - this.st紙吹雪[i].f加速度Y *= this.st紙吹雪[i].f加速度の加速度Y; - this.st紙吹雪[i].f加速度Y -= this.st紙吹雪[i].f重力加速度; - } - /* - Matrix mat = Matrix.Identity; - - float x = (float)(this.st紙吹雪[i].f半径 * Math.Cos((Math.PI / 2 * this.st紙吹雪[i].ct進行.n現在の値) / 100.0)) * 2.3f; - mat *= Matrix.Scaling(x, x, 1f); - mat *= Matrix.Translation(this.st紙吹雪[i].fX - SampleFramework.GameWindowSize.Width / 2, -(this.st紙吹雪[i].fY - SampleFramework.GameWindowSize.Height / 2), 0f); - */ - - /*if (this.tx紙吹雪 != null) - { - this.tx紙吹雪.t3D描画(CDTXMania.app.Device, mat, new Rectangle( 32 * this.st紙吹雪[ i ].nGraphic, 32 * this.st紙吹雪[ i ].nColor, 32, 32 )); - - } */ } - } } - return 0; + + for (int i = 0; i < 45; i++) { + if (OpenTaiko.Skin.nScrollFieldX[0] != 414) + break; + + if (this.st大音符花火[i].b使用中) { + this.st大音符花火[i].n前回のValue = this.st大音符花火[i].ct進行.CurrentValue; + this.st大音符花火[i].ct進行.Tick(); + if (this.st大音符花火[i].ct進行.IsEnded) { + this.st大音符花火[i].ct進行.Stop(); + this.st大音符花火[i].b使用中 = false; + } + /* + Matrix mat = Matrix.Identity; + + mat *= Matrix.Translation(this.st大音符花火[i].fX - SampleFramework.GameWindowSize.Width / 2, -(this.st大音符花火[i].fY - SampleFramework.GameWindowSize.Height / 2), 0f); + */ + float fX = this.st大音符花火[i].fX - (192 / 2); + float fY = this.st大音符花火[i].fY - (192 / 2); + + //if(CDTXMania.Tx.Effects_Hit_FireWorks[ 0 ] != null && this.st大音符花火[ i ].nColor == 0 ) + //{ + // if( this.st大音符花火[ i ].n開始フレーム <= this.st大音符花火[ i ].ct進行.n現在の値 && this.st大音符花火[ i ].n終了フレーム > this.st大音符花火[ i ].ct進行.n現在の値 ) + // { + // //this.tx大音符花火[ 0 ].t3D描画(CDTXMania.app.Device, mat, new Rectangle( ( this.st大音符花火[i].ct進行.n現在の値 - this.st大音符花火[ i ].n開始フレーム ) * 192, 0, 192, 192 )); + // //this.tx大音符花火[ 0 ].t3D描画( CDTXMania.app.Device, mat, fX, fY, new Rectangle( ( this.st大音符花火[i].ct進行.n現在の値 - this.st大音符花火[ i ].n開始フレーム ) * 192, 0, 192, 192 ) ); + // CDTXMania.Tx.Effects_Hit_FireWorks[ 0 ].t2D描画( CDTXMania.app.Device, (int)fX, (int)fY, new Rectangle( ( this.st大音符花火[i].ct進行.n現在の値 - this.st大音符花火[ i ].n開始フレーム ) * 192, 0, 192, 192 ) ); + // } + //} + ////if(CDTXMania.Tx.Effects_Hit_FireWorks[ 1 ] != null && this.st大音符花火[ i ].nColor == 1 ) + //{ + // if( this.st大音符花火[ i ].n開始フレーム <= this.st大音符花火[ i ].ct進行.n現在の値 && this.st大音符花火[ i ].n終了フレーム > this.st大音符花火[ i ].ct進行.n現在の値 ) + // { + // //this.tx大音符花火[ 1 ].t3D描画( CDTXMania.app.Device, mat, fX, fY, ); + // //CDTXMania.Tx.Effects_Hit_FireWorks[ 1 ].t2D描画( CDTXMania.app.Device, (int)fX, (int)fY, new Rectangle( ( this.st大音符花火[i].ct進行.n現在の値 - this.st大音符花火[ i ].n開始フレーム ) * 192, 0, 192, 192 ) ); + // } + //} + } + + } + + for (int i = 0; i < 256; i++) { + if (this.st紙吹雪[i].b使用中) { + this.st紙吹雪[i].n前回のValue = this.st紙吹雪[i].ct進行.CurrentValue; + this.st紙吹雪[i].ct進行.Tick(); + if (this.st紙吹雪[i].ct進行.IsEnded) { + this.st紙吹雪[i].ct進行.Stop(); + this.st紙吹雪[i].b使用中 = false; + } else if (this.st紙吹雪[i].fX > 1300 || this.st紙吹雪[i].fX < -20) { + this.st紙吹雪[i].ct進行.Stop(); + this.st紙吹雪[i].b使用中 = false; + } + for (int n = this.st紙吹雪[i].n前回のValue; n < this.st紙吹雪[i].ct進行.CurrentValue; n++) { + this.st紙吹雪[i].fX -= this.st紙吹雪[i].f加速度X; + this.st紙吹雪[i].fY -= this.st紙吹雪[i].f加速度Y; + this.st紙吹雪[i].f加速度X *= this.st紙吹雪[i].f加速度の加速度X; + this.st紙吹雪[i].f加速度Y *= this.st紙吹雪[i].f加速度の加速度Y; + this.st紙吹雪[i].f加速度Y -= this.st紙吹雪[i].f重力加速度; + } + /* + Matrix mat = Matrix.Identity; + + float x = (float)(this.st紙吹雪[i].f半径 * Math.Cos((Math.PI / 2 * this.st紙吹雪[i].ct進行.n現在の値) / 100.0)) * 2.3f; + mat *= Matrix.Scaling(x, x, 1f); + mat *= Matrix.Translation(this.st紙吹雪[i].fX - SampleFramework.GameWindowSize.Width / 2, -(this.st紙吹雪[i].fY - SampleFramework.GameWindowSize.Height / 2), 0f); + */ + + /*if (this.tx紙吹雪 != null) + { + this.tx紙吹雪.t3D描画(CDTXMania.app.Device, mat, new Rectangle( 32 * this.st紙吹雪[ i ].nGraphic, 32 * this.st紙吹雪[ i ].nColor, 32, 32 )); + + } */ + } + + } } - - - // その他 - - #region [ private ] - //----------------- - //private CTextureAf txアタックエフェクトUpper; - //private CTexture txアタックエフェクトUpper_big; - //private CTextureAf[] tx大音符花火 = new CTextureAf[2]; - //private CTexture tx紙吹雪; - - protected STSTATUS[] st状態 = new STSTATUS[3 * 4]; - protected STSTATUS_B[] st状態_大 = new STSTATUS_B[3 * 4]; - private ST大音符花火[] st大音符花火 = new ST大音符花火[45]; - - protected int[] nX座標 = new int[] { 450, 521, 596, 686, 778, 863, 970, 1070, 1150 }; - protected int[] nY座標 = new int[] { 172, 108, 50, 8, -10, -60, -5, 30, 90 }; - protected int[] nY座標P2 = new int[] { 172, 108, 50, 8, -10, -60, -5, 30, 90 }; - - [StructLayout(LayoutKind.Sequential)] - protected struct STSTATUS { - public bool b使用中; - public CCounter ct進行; - public ENoteJudge judge; - public int nIsBig; - public int n透明度; - public int nPlayer; - } - [StructLayout(LayoutKind.Sequential)] - protected struct STSTATUS_B { - public CCounter ct進行; - public ENoteJudge judge; - public int nIsBig; - public int n透明度; - public int nPlayer; - } - - [StructLayout(LayoutKind.Sequential)] - private struct ST大音符花火 { - public int nColor; - public bool b使用中; - public CCounter ct進行; - public int n前回のValue; - public float fX; - public float fY; - public int n開始フレーム; - public int n終了フレーム; - } - - private ST紙吹雪[] st紙吹雪 = new ST紙吹雪[256]; - [StructLayout(LayoutKind.Sequential)] - private struct ST紙吹雪 { - public int nGraphic; - public int nColor; - public bool b使用中; - public CCounter ct進行; - public int n前回のValue; - public float fX; - public float fY; - public float f加速度X; - public float f加速度Y; - public float f加速度の加速度X; - public float f加速度の加速度Y; - public float f重力加速度; - public float f半径; - public float f角度; - } - //----------------- - #endregion + return 0; } -} + + // その他 + + #region [ private ] + //----------------- + //private CTextureAf txアタックエフェクトUpper; + //private CTexture txアタックエフェクトUpper_big; + //private CTextureAf[] tx大音符花火 = new CTextureAf[2]; + //private CTexture tx紙吹雪; + + protected STSTATUS[] st状態 = new STSTATUS[3 * 4]; + protected STSTATUS_B[] st状態_大 = new STSTATUS_B[3 * 4]; + private ST大音符花火[] st大音符花火 = new ST大音符花火[45]; + + protected int[] nX座標 = new int[] { 450, 521, 596, 686, 778, 863, 970, 1070, 1150 }; + protected int[] nY座標 = new int[] { 172, 108, 50, 8, -10, -60, -5, 30, 90 }; + protected int[] nY座標P2 = new int[] { 172, 108, 50, 8, -10, -60, -5, 30, 90 }; + + [StructLayout(LayoutKind.Sequential)] + protected struct STSTATUS { + public bool b使用中; + public CCounter ct進行; + public ENoteJudge judge; + public int nIsBig; + public int n透明度; + public int nPlayer; + } + [StructLayout(LayoutKind.Sequential)] + protected struct STSTATUS_B { + public CCounter ct進行; + public ENoteJudge judge; + public int nIsBig; + public int n透明度; + public int nPlayer; + } + + [StructLayout(LayoutKind.Sequential)] + private struct ST大音符花火 { + public int nColor; + public bool b使用中; + public CCounter ct進行; + public int n前回のValue; + public float fX; + public float fY; + public int n開始フレーム; + public int n終了フレーム; + } + + private ST紙吹雪[] st紙吹雪 = new ST紙吹雪[256]; + [StructLayout(LayoutKind.Sequential)] + private struct ST紙吹雪 { + public int nGraphic; + public int nColor; + public bool b使用中; + public CCounter ct進行; + public int n前回のValue; + public float fX; + public float fY; + public float f加速度X; + public float f加速度Y; + public float f加速度の加速度X; + public float f加速度の加速度Y; + public float f重力加速度; + public float f半径; + public float f角度; + } + //----------------- + #endregion +} diff --git a/OpenTaiko/src/Stages/07.Game/Taiko/CActImplFooter.cs b/OpenTaiko/src/Stages/07.Game/Taiko/CActImplFooter.cs index 1d17dccb..f61ca2d7 100644 --- a/OpenTaiko/src/Stages/07.Game/Taiko/CActImplFooter.cs +++ b/OpenTaiko/src/Stages/07.Game/Taiko/CActImplFooter.cs @@ -1,60 +1,60 @@ using FDK; -namespace OpenTaiko { - internal class CActImplFooter : CActivity { - /// - /// フッター - /// - public CActImplFooter() { - base.IsDeActivated = true; - } +namespace OpenTaiko; - public override void Activate() { - var footerDir = CSkin.Path($"{TextureLoader.BASE}{TextureLoader.GAME}{TextureLoader.FOOTER}"); - var preset = HScenePreset.GetBGPreset(); - - if (preset == null) return; - - if (Directory.Exists(footerDir)) { - Random random = new Random(); - - var upDirs = Directory.GetFiles(footerDir); - if (preset.FooterSet != null) { - var _presetPath = (preset.FooterSet.Length > 0) ? $@"{footerDir}" + preset.FooterSet[random.Next(0, preset.FooterSet.Length)] + ".png" : ""; - var path = File.Exists(_presetPath) - ? _presetPath - : (upDirs.Length > 0 ? upDirs[random.Next(0, upDirs.Length)] : ""); - - Mob_Footer = OpenTaiko.tテクスチャの生成(path); - } - } - - base.Activate(); - } - - public override void DeActivate() { - OpenTaiko.tDisposeSafely(ref Mob_Footer); - - base.DeActivate(); - } - - public override void CreateManagedResource() { - base.CreateManagedResource(); - } - - public override void ReleaseManagedResource() { - base.ReleaseManagedResource(); - } - - public override int Draw() { - this.Mob_Footer?.t2D描画(0, OpenTaiko.Skin.Resolution[1] - this.Mob_Footer.szTextureSize.Height); - return base.Draw(); - } - - #region[ private ] - //----------------- - public CTexture Mob_Footer; - //----------------- - #endregion +internal class CActImplFooter : CActivity { + /// + /// フッター + /// + public CActImplFooter() { + base.IsDeActivated = true; } + + public override void Activate() { + var footerDir = CSkin.Path($"{TextureLoader.BASE}{TextureLoader.GAME}{TextureLoader.FOOTER}"); + var preset = HScenePreset.GetBGPreset(); + + if (preset == null) return; + + if (Directory.Exists(footerDir)) { + Random random = new Random(); + + var upDirs = Directory.GetFiles(footerDir); + if (preset.FooterSet != null) { + var _presetPath = (preset.FooterSet.Length > 0) ? $@"{footerDir}" + preset.FooterSet[random.Next(0, preset.FooterSet.Length)] + ".png" : ""; + var path = File.Exists(_presetPath) + ? _presetPath + : (upDirs.Length > 0 ? upDirs[random.Next(0, upDirs.Length)] : ""); + + Mob_Footer = OpenTaiko.tテクスチャの生成(path); + } + } + + base.Activate(); + } + + public override void DeActivate() { + OpenTaiko.tDisposeSafely(ref Mob_Footer); + + base.DeActivate(); + } + + public override void CreateManagedResource() { + base.CreateManagedResource(); + } + + public override void ReleaseManagedResource() { + base.ReleaseManagedResource(); + } + + public override int Draw() { + this.Mob_Footer?.t2D描画(0, OpenTaiko.Skin.Resolution[1] - this.Mob_Footer.szTextureSize.Height); + return base.Draw(); + } + + #region[ private ] + //----------------- + public CTexture Mob_Footer; + //----------------- + #endregion } diff --git a/OpenTaiko/src/Stages/07.Game/Taiko/CActImplGauge.cs b/OpenTaiko/src/Stages/07.Game/Taiko/CActImplGauge.cs index 680b71df..b7a3afbf 100644 --- a/OpenTaiko/src/Stages/07.Game/Taiko/CActImplGauge.cs +++ b/OpenTaiko/src/Stages/07.Game/Taiko/CActImplGauge.cs @@ -2,410 +2,410 @@ using System.Runtime.InteropServices; using FDK; -namespace OpenTaiko { - internal class CActImplGauge : CAct演奏ゲージ共通 { - // コンストラクタ - /// - /// ゲージの描画クラス。ドラム側。 - /// - /// 課題 - /// _ゲージの実装。 - /// _Danger時にゲージの色が変わる演出の実装。 - /// _Danger、MAX時のアニメーション実装。 - /// - public CActImplGauge() { - base.IsDeActivated = true; +namespace OpenTaiko; + +internal class CActImplGauge : CAct演奏ゲージ共通 { + // コンストラクタ + /// + /// ゲージの描画クラス。ドラム側。 + /// + /// 課題 + /// _ゲージの実装。 + /// _Danger時にゲージの色が変わる演出の実装。 + /// _Danger、MAX時のアニメーション実装。 + /// + public CActImplGauge() { + base.IsDeActivated = true; + } + + public override void Start(int nLane, ENoteJudge judge, int player) { + for (int j = 0; j < 32; j++) { + if (player == 0) { + if (!this.st花火状態[player][j].b使用中) { + this.st花火状態[player][j].ct進行 = new CCounter(0, 10, 20, OpenTaiko.Timer); + this.st花火状態[player][j].nPlayer = player; + + switch (nLane) { + case 0x11: + case 0x12: + case 0x15: + this.st花火状態[player][j].isBig = false; + break; + case 0x13: + case 0x14: + case 0x16: + case 0x17: + this.st花火状態[player][j].isBig = true; + break; + } + this.st花火状態[player][j].nLane = nLane; + + this.st花火状態[player][j].b使用中 = true; + break; + } + } + } + } + + // CActivity 実装 + + public override void Activate() { + this.ct炎 = new CCounter(0, 6, 50, OpenTaiko.Timer); + + for (int player = 0; player < 5; player++) { + for (int i = 0; i < 32; i++) { + this.st花火状態[player][i].ct進行 = new CCounter(); + } } - public override void Start(int nLane, ENoteJudge judge, int player) { - for (int j = 0; j < 32; j++) { - if (player == 0) { - if (!this.st花火状態[player][j].b使用中) { - this.st花火状態[player][j].ct進行 = new CCounter(0, 10, 20, OpenTaiko.Timer); - this.st花火状態[player][j].nPlayer = player; + if (OpenTaiko.Skin.Game_Gauge_Rainbow_Timer <= 1) { + throw new DivideByZeroException("SkinConfigの設定\"Game_Gauge_Rainbow_Timer\"を1以下にすることは出来ません。"); + } + this.ct虹アニメ = new CCounter(0, OpenTaiko.Skin.Game_Gauge_Rainbow_Ptn - 1, OpenTaiko.Skin.Game_Gauge_Rainbow_Timer, OpenTaiko.Timer); + this.ct虹透明度 = new CCounter(0, OpenTaiko.Skin.Game_Gauge_Rainbow_Timer - 1, 1, OpenTaiko.Timer); + this.ctGaugeFlash = new CCounter(0, 532, 1, OpenTaiko.Timer); - switch (nLane) { - case 0x11: - case 0x12: - case 0x15: - this.st花火状態[player][j].isBig = false; - break; - case 0x13: - case 0x14: - case 0x16: - case 0x17: - this.st花火状態[player][j].isBig = true; - break; - } - this.st花火状態[player][j].nLane = nLane; + base.Activate(); + } + public override void DeActivate() { + for (int player = 0; player < 5; player++) { + for (int i = 0; i < 32; i++) { + this.st花火状態[player][i].ct進行 = null; + } + } + this.ct炎 = null; - this.st花火状態[player][j].b使用中 = true; - break; + this.ct虹アニメ = null; + } + public override void CreateManagedResource() { + //this.tx音符 = CDTXMania.tテクスチャの生成(CSkin.Path(@"Graphics\7_taiko_notes.png")); + base.CreateManagedResource(); + } + public override void ReleaseManagedResource() { + base.ReleaseManagedResource(); + } + public override int Draw() { + if (!base.IsDeActivated) { + //CDTXMania.act文字コンソール.tPrint( 20, 150, C文字コンソール.Eフォント種別.白, this.db現在のゲージ値.Taiko.ToString() ); + + #region [ 初めての進行描画 ] + if (base.IsFirstDraw) { + base.IsFirstDraw = false; + } + #endregion + + this.ctGaugeFlash.TickLoop(); + + int nWidth = (OpenTaiko.Skin.Game_Gauge_Rect[2] / 50); + int[] nRectX = new int[] { + (int)( this.db現在のゲージ値[ 0 ] / 2 ) * nWidth, + (int)( this.db現在のゲージ値[ 1 ] / 2 ) * nWidth, + (int)( this.db現在のゲージ値[ 2 ] / 2 ) * nWidth, + (int)( this.db現在のゲージ値[ 3 ] / 2 ) * nWidth, + (int)( this.db現在のゲージ値[ 4 ] / 2 ) * nWidth + }; + int 虹ベース = ct虹アニメ.CurrentValue + 1; + if (虹ベース == ct虹アニメ.EndValue + 1) 虹ベース = 0; + /* + + 新虹ゲージの仕様 2018/08/10 ろみゅ~? + + フェードで動く虹ゲージが、ある程度強化できたので放出。 + 透明度255の虹ベースを描画し、その上から透明度可変式の虹ゲージを描画する。 + ゲージのパターン枚数は、読み込み枚数によって決定する。 + ゲージ描画の切り替え速度は、タイマーの値をSkinConfigで指定して行う(初期値50,1にするとエラーを吐く模様)。進行速度は1ms、高フレームレートでの滑らかさを重視。 + 虹ゲージの透明度調整値は、「255/パターン数」で算出する。 + こんな簡単なことを考えるのに30分(60f/s換算で108000f)を費やす。 + + */ + + // No gauge if tower + if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Tower || OpenTaiko.ConfigIni.bTokkunMode) + return 0; + + + if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] != (int)Difficulty.Dan) { + #region [Regular gauges] + + // Flash opacity + int Opacity = 0; + if (this.ctGaugeFlash.CurrentValue <= 365) Opacity = 0; + else if (this.ctGaugeFlash.CurrentValue <= 448) Opacity = (int)((this.ctGaugeFlash.CurrentValue - 365) / 83f * 255f); + else if (this.ctGaugeFlash.CurrentValue <= 531) Opacity = 255 - (int)((this.ctGaugeFlash.CurrentValue - 448) / 83f * 255f); + + // Rainbow gauge + this.ct虹アニメ.TickLoop(); + this.ct虹透明度.TickLoop(); + int rainbowFrame = this.ct虹アニメ.CurrentValue; + + // Soul fire frame + this.ct炎.TickLoop(); + int soulFireFrame = this.ct炎.CurrentValue; + + for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { + if (OpenTaiko.ConfigIni.bAIBattleMode && i == 1) continue; + HGaugeMethods.UNSAFE_DrawGaugeFast(i, Opacity, rainbowFrame, soulFireFrame); + } + + #endregion + } else { + float scale = 1.0f; + if (OpenTaiko.ConfigIni.bAIBattleMode) { + scale = 0.8f; + } + + int[] gauge_x = new int[5]; + int[] gauge_y = new int[5]; + + for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { + if (OpenTaiko.ConfigIni.nPlayerCount == 5) { + gauge_x[i] = OpenTaiko.Skin.Game_Gauge_5P[0] + (OpenTaiko.Skin.Game_UIMove_5P[0] * i); + gauge_y[i] = OpenTaiko.Skin.Game_Gauge_5P[1] + (OpenTaiko.Skin.Game_UIMove_5P[1] * i); + } else if (OpenTaiko.ConfigIni.nPlayerCount == 4 || OpenTaiko.ConfigIni.nPlayerCount == 3) { + gauge_x[i] = OpenTaiko.Skin.Game_Gauge_4P[0] + (OpenTaiko.Skin.Game_UIMove_4P[0] * i); + gauge_y[i] = OpenTaiko.Skin.Game_Gauge_4P[1] + (OpenTaiko.Skin.Game_UIMove_4P[1] * i); + } else { + gauge_x[i] = OpenTaiko.Skin.Game_Gauge_X[i]; + gauge_y[i] = OpenTaiko.Skin.Game_Gauge_Y[i]; } } - } - } - // CActivity 実装 + #region [Gauge base] - public override void Activate() { - this.ct炎 = new CCounter(0, 6, 50, OpenTaiko.Timer); + if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) { + if (OpenTaiko.P1IsBlue()) { + OpenTaiko.Tx.Gauge_Dan[4]?.t2D描画(gauge_x[0], gauge_y[0], + new Rectangle(OpenTaiko.Skin.Game_Gauge_Rect[0], OpenTaiko.Skin.Game_Gauge_Rect[1], OpenTaiko.Skin.Game_Gauge_Rect[2], OpenTaiko.Skin.Game_Gauge_Rect[3])); + } else { + OpenTaiko.Tx.Gauge_Dan[0]?.t2D描画(gauge_x[0], gauge_y[0], + new Rectangle(OpenTaiko.Skin.Game_Gauge_Rect[0], OpenTaiko.Skin.Game_Gauge_Rect[1], OpenTaiko.Skin.Game_Gauge_Rect[2], OpenTaiko.Skin.Game_Gauge_Rect[3])); + } - for (int player = 0; player < 5; player++) { - for (int i = 0; i < 32; i++) { - this.st花火状態[player][i].ct進行 = new CCounter(); + + if (OpenTaiko.Tx.Gauge_Dan[2] != null) { + for (int i = 0; i < OpenTaiko.DTX.Dan_C.Length; i++) { + if (OpenTaiko.DTX.Dan_C[i] != null) { + Dan_C dan_c = OpenTaiko.DTX.List_DanSongs[OpenTaiko.stage演奏ドラム画面.actDan.NowCymbolShowingNumber].Dan_C[i] != null ? + OpenTaiko.DTX.List_DanSongs[OpenTaiko.stage演奏ドラム画面.actDan.NowCymbolShowingNumber].Dan_C[i] : + OpenTaiko.DTX.Dan_C[i]; + + if (dan_c.GetExamType() == Exam.Type.Gauge) { + OpenTaiko.Tx.Gauge_Dan[2].t2D描画(gauge_x[0] + (dan_c.GetValue(false) / 2 * nWidth), gauge_y[0], + new Rectangle((dan_c.GetValue(false) / 2 * nWidth), 0, OpenTaiko.Skin.Game_Gauge_Rect[2] - (dan_c.GetValue(false) / 2 * nWidth), OpenTaiko.Skin.Game_Gauge_Rect[3])); + } + } + } + } } - } - if (OpenTaiko.Skin.Game_Gauge_Rainbow_Timer <= 1) { - throw new DivideByZeroException("SkinConfigの設定\"Game_Gauge_Rainbow_Timer\"を1以下にすることは出来ません。"); - } - this.ct虹アニメ = new CCounter(0, OpenTaiko.Skin.Game_Gauge_Rainbow_Ptn - 1, OpenTaiko.Skin.Game_Gauge_Rainbow_Timer, OpenTaiko.Timer); - this.ct虹透明度 = new CCounter(0, OpenTaiko.Skin.Game_Gauge_Rainbow_Timer - 1, 1, OpenTaiko.Timer); - this.ctGaugeFlash = new CCounter(0, 532, 1, OpenTaiko.Timer); - - base.Activate(); - } - public override void DeActivate() { - for (int player = 0; player < 5; player++) { - for (int i = 0; i < 32; i++) { - this.st花火状態[player][i].ct進行 = null; - } - } - this.ct炎 = null; - - this.ct虹アニメ = null; - } - public override void CreateManagedResource() { - //this.tx音符 = CDTXMania.tテクスチャの生成(CSkin.Path(@"Graphics\7_taiko_notes.png")); - base.CreateManagedResource(); - } - public override void ReleaseManagedResource() { - base.ReleaseManagedResource(); - } - public override int Draw() { - if (!base.IsDeActivated) { - //CDTXMania.act文字コンソール.tPrint( 20, 150, C文字コンソール.Eフォント種別.白, this.db現在のゲージ値.Taiko.ToString() ); - - #region [ 初めての進行描画 ] - if (base.IsFirstDraw) { - base.IsFirstDraw = false; - } #endregion - this.ctGaugeFlash.TickLoop(); + #region [ Gauge 1P ] - int nWidth = (OpenTaiko.Skin.Game_Gauge_Rect[2] / 50); - int[] nRectX = new int[] { - (int)( this.db現在のゲージ値[ 0 ] / 2 ) * nWidth, - (int)( this.db現在のゲージ値[ 1 ] / 2 ) * nWidth, - (int)( this.db現在のゲージ値[ 2 ] / 2 ) * nWidth, - (int)( this.db現在のゲージ値[ 3 ] / 2 ) * nWidth, - (int)( this.db現在のゲージ値[ 4 ] / 2 ) * nWidth - }; - int 虹ベース = ct虹アニメ.CurrentValue + 1; - if (虹ベース == ct虹アニメ.EndValue + 1) 虹ベース = 0; - /* - - 新虹ゲージの仕様 2018/08/10 ろみゅ~? - - フェードで動く虹ゲージが、ある程度強化できたので放出。 - 透明度255の虹ベースを描画し、その上から透明度可変式の虹ゲージを描画する。 - ゲージのパターン枚数は、読み込み枚数によって決定する。 - ゲージ描画の切り替え速度は、タイマーの値をSkinConfigで指定して行う(初期値50,1にするとエラーを吐く模様)。進行速度は1ms、高フレームレートでの滑らかさを重視。 - 虹ゲージの透明度調整値は、「255/パターン数」で算出する。 - こんな簡単なことを考えるのに30分(60f/s換算で108000f)を費やす。 - - */ - - // No gauge if tower - if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Tower || OpenTaiko.ConfigIni.bTokkunMode) - return 0; - - - if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] != (int)Difficulty.Dan) { - #region [Regular gauges] - - // Flash opacity - int Opacity = 0; - if (this.ctGaugeFlash.CurrentValue <= 365) Opacity = 0; - else if (this.ctGaugeFlash.CurrentValue <= 448) Opacity = (int)((this.ctGaugeFlash.CurrentValue - 365) / 83f * 255f); - else if (this.ctGaugeFlash.CurrentValue <= 531) Opacity = 255 - (int)((this.ctGaugeFlash.CurrentValue - 448) / 83f * 255f); - - // Rainbow gauge - this.ct虹アニメ.TickLoop(); - this.ct虹透明度.TickLoop(); - int rainbowFrame = this.ct虹アニメ.CurrentValue; - - // Soul fire frame - this.ct炎.TickLoop(); - int soulFireFrame = this.ct炎.CurrentValue; - - for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { - if (OpenTaiko.ConfigIni.bAIBattleMode && i == 1) continue; - HGaugeMethods.UNSAFE_DrawGaugeFast(i, Opacity, rainbowFrame, soulFireFrame); - } - - #endregion - } else { - float scale = 1.0f; + if (OpenTaiko.Tx.Gauge[0] != null) { + int x; + int y; if (OpenTaiko.ConfigIni.bAIBattleMode) { - scale = 0.8f; + x = OpenTaiko.Skin.Game_Gauge_X_AI; + y = OpenTaiko.Skin.Game_Gauge_Y_AI; + } else { + x = gauge_x[0]; + y = gauge_y[0]; } - int[] gauge_x = new int[5]; - int[] gauge_y = new int[5]; - - for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { - if (OpenTaiko.ConfigIni.nPlayerCount == 5) { - gauge_x[i] = OpenTaiko.Skin.Game_Gauge_5P[0] + (OpenTaiko.Skin.Game_UIMove_5P[0] * i); - gauge_y[i] = OpenTaiko.Skin.Game_Gauge_5P[1] + (OpenTaiko.Skin.Game_UIMove_5P[1] * i); - } else if (OpenTaiko.ConfigIni.nPlayerCount == 4 || OpenTaiko.ConfigIni.nPlayerCount == 3) { - gauge_x[i] = OpenTaiko.Skin.Game_Gauge_4P[0] + (OpenTaiko.Skin.Game_UIMove_4P[0] * i); - gauge_y[i] = OpenTaiko.Skin.Game_Gauge_4P[1] + (OpenTaiko.Skin.Game_UIMove_4P[1] * i); - } else { - gauge_x[i] = OpenTaiko.Skin.Game_Gauge_X[i]; - gauge_y[i] = OpenTaiko.Skin.Game_Gauge_Y[i]; - } - } - - #region [Gauge base] - if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) { - if (OpenTaiko.P1IsBlue()) { - OpenTaiko.Tx.Gauge_Dan[4]?.t2D描画(gauge_x[0], gauge_y[0], - new Rectangle(OpenTaiko.Skin.Game_Gauge_Rect[0], OpenTaiko.Skin.Game_Gauge_Rect[1], OpenTaiko.Skin.Game_Gauge_Rect[2], OpenTaiko.Skin.Game_Gauge_Rect[3])); - } else { - OpenTaiko.Tx.Gauge_Dan[0]?.t2D描画(gauge_x[0], gauge_y[0], - new Rectangle(OpenTaiko.Skin.Game_Gauge_Rect[0], OpenTaiko.Skin.Game_Gauge_Rect[1], OpenTaiko.Skin.Game_Gauge_Rect[2], OpenTaiko.Skin.Game_Gauge_Rect[3])); - } + if (OpenTaiko.P1IsBlue()) + OpenTaiko.Tx.Gauge_Dan[5]?.t2D描画(x, y, new Rectangle(0, 0, nRectX[0], OpenTaiko.Skin.Game_Gauge_Rect[3])); + else + OpenTaiko.Tx.Gauge_Dan[1]?.t2D描画(x, y, new Rectangle(0, 0, nRectX[0], OpenTaiko.Skin.Game_Gauge_Rect[3])); + for (int i = 0; i < OpenTaiko.DTX.Dan_C.Length; i++) { + Dan_C dan_c = OpenTaiko.DTX.List_DanSongs[OpenTaiko.stage演奏ドラム画面.actDan.NowCymbolShowingNumber].Dan_C[i] != null ? + OpenTaiko.DTX.List_DanSongs[OpenTaiko.stage演奏ドラム画面.actDan.NowCymbolShowingNumber].Dan_C[i] : + OpenTaiko.DTX.Dan_C[i]; - if (OpenTaiko.Tx.Gauge_Dan[2] != null) { - for (int i = 0; i < OpenTaiko.DTX.Dan_C.Length; i++) { - if (OpenTaiko.DTX.Dan_C[i] != null) { - Dan_C dan_c = OpenTaiko.DTX.List_DanSongs[OpenTaiko.stage演奏ドラム画面.actDan.NowCymbolShowingNumber].Dan_C[i] != null ? - OpenTaiko.DTX.List_DanSongs[OpenTaiko.stage演奏ドラム画面.actDan.NowCymbolShowingNumber].Dan_C[i] : - OpenTaiko.DTX.Dan_C[i]; + if (dan_c != null && dan_c.GetExamType() == Exam.Type.Gauge && db現在のゲージ値[0] >= dan_c.GetValue(false)) { + OpenTaiko.Tx.Gauge_Dan[3].Opacity = 255; + OpenTaiko.Tx.Gauge_Dan[3]?.t2D描画(x + (dan_c.GetValue(false) / 2 * nWidth), y, new Rectangle(dan_c.GetValue(false) / 2 * nWidth, 0, nRectX[0] - (dan_c.GetValue(false) / 2 * nWidth), OpenTaiko.Skin.Game_Gauge_Rect[3])); - if (dan_c.GetExamType() == Exam.Type.Gauge) { - OpenTaiko.Tx.Gauge_Dan[2].t2D描画(gauge_x[0] + (dan_c.GetValue(false) / 2 * nWidth), gauge_y[0], - new Rectangle((dan_c.GetValue(false) / 2 * nWidth), 0, OpenTaiko.Skin.Game_Gauge_Rect[2] - (dan_c.GetValue(false) / 2 * nWidth), OpenTaiko.Skin.Game_Gauge_Rect[3])); - } - } + int Opacity = 0; + if (this.ctGaugeFlash.CurrentValue <= 365) Opacity = 0; + else if (this.ctGaugeFlash.CurrentValue <= 448) Opacity = (int)((this.ctGaugeFlash.CurrentValue - 365) / 83f * 255f); + else if (this.ctGaugeFlash.CurrentValue <= 531) Opacity = 255 - (int)((this.ctGaugeFlash.CurrentValue - 448) / 83f * 255f); + OpenTaiko.Tx.Gauge_Dan[3].Opacity = Opacity; + OpenTaiko.Tx.Gauge_Dan[3]?.t2D描画(x, y, new Rectangle(0, 0, dan_c.GetValue(false) / 2 * nWidth, OpenTaiko.Skin.Game_Gauge_Rect[3])); + + break; } } + } - #endregion + #region [Rainbow] - #region [ Gauge 1P ] + if (this.db現在のゲージ値[0] >= 100.0) { + this.ct虹アニメ.TickLoop(); + this.ct虹透明度.TickLoop(); + if (OpenTaiko.Tx.Gauge_Rainbow[this.ct虹アニメ.CurrentValue] != null) { + OpenTaiko.Tx.Gauge_Rainbow[this.ct虹アニメ.CurrentValue].vcScaleRatio.X = scale; + OpenTaiko.Tx.Gauge_Rainbow[this.ct虹アニメ.CurrentValue].vcScaleRatio.Y = scale; - if (OpenTaiko.Tx.Gauge[0] != null) { - int x; - int y; - if (OpenTaiko.ConfigIni.bAIBattleMode) { - x = OpenTaiko.Skin.Game_Gauge_X_AI; - y = OpenTaiko.Skin.Game_Gauge_Y_AI; - } else { - x = gauge_x[0]; - y = gauge_y[0]; - } + OpenTaiko.Tx.Gauge_Rainbow[虹ベース].vcScaleRatio.X = scale; + OpenTaiko.Tx.Gauge_Rainbow[虹ベース].vcScaleRatio.Y = scale; - if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) { - if (OpenTaiko.P1IsBlue()) - OpenTaiko.Tx.Gauge_Dan[5]?.t2D描画(x, y, new Rectangle(0, 0, nRectX[0], OpenTaiko.Skin.Game_Gauge_Rect[3])); - else - OpenTaiko.Tx.Gauge_Dan[1]?.t2D描画(x, y, new Rectangle(0, 0, nRectX[0], OpenTaiko.Skin.Game_Gauge_Rect[3])); - - for (int i = 0; i < OpenTaiko.DTX.Dan_C.Length; i++) { - Dan_C dan_c = OpenTaiko.DTX.List_DanSongs[OpenTaiko.stage演奏ドラム画面.actDan.NowCymbolShowingNumber].Dan_C[i] != null ? - OpenTaiko.DTX.List_DanSongs[OpenTaiko.stage演奏ドラム画面.actDan.NowCymbolShowingNumber].Dan_C[i] : - OpenTaiko.DTX.Dan_C[i]; - - if (dan_c != null && dan_c.GetExamType() == Exam.Type.Gauge && db現在のゲージ値[0] >= dan_c.GetValue(false)) { - OpenTaiko.Tx.Gauge_Dan[3].Opacity = 255; - OpenTaiko.Tx.Gauge_Dan[3]?.t2D描画(x + (dan_c.GetValue(false) / 2 * nWidth), y, new Rectangle(dan_c.GetValue(false) / 2 * nWidth, 0, nRectX[0] - (dan_c.GetValue(false) / 2 * nWidth), OpenTaiko.Skin.Game_Gauge_Rect[3])); - - int Opacity = 0; - if (this.ctGaugeFlash.CurrentValue <= 365) Opacity = 0; - else if (this.ctGaugeFlash.CurrentValue <= 448) Opacity = (int)((this.ctGaugeFlash.CurrentValue - 365) / 83f * 255f); - else if (this.ctGaugeFlash.CurrentValue <= 531) Opacity = 255 - (int)((this.ctGaugeFlash.CurrentValue - 448) / 83f * 255f); - OpenTaiko.Tx.Gauge_Dan[3].Opacity = Opacity; - OpenTaiko.Tx.Gauge_Dan[3]?.t2D描画(x, y, new Rectangle(0, 0, dan_c.GetValue(false) / 2 * nWidth, OpenTaiko.Skin.Game_Gauge_Rect[3])); - - break; - } - } - - } - - #region [Rainbow] - - if (this.db現在のゲージ値[0] >= 100.0) { - this.ct虹アニメ.TickLoop(); - this.ct虹透明度.TickLoop(); - if (OpenTaiko.Tx.Gauge_Rainbow[this.ct虹アニメ.CurrentValue] != null) { - OpenTaiko.Tx.Gauge_Rainbow[this.ct虹アニメ.CurrentValue].vcScaleRatio.X = scale; - OpenTaiko.Tx.Gauge_Rainbow[this.ct虹アニメ.CurrentValue].vcScaleRatio.Y = scale; - - OpenTaiko.Tx.Gauge_Rainbow[虹ベース].vcScaleRatio.X = scale; - OpenTaiko.Tx.Gauge_Rainbow[虹ベース].vcScaleRatio.Y = scale; - - bool smart = OpenTaiko.ConfigIni.nPlayerCount > 2 || OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan; + bool smart = OpenTaiko.ConfigIni.nPlayerCount > 2 || OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan; - OpenTaiko.Tx.Gauge_Rainbow[this.ct虹アニメ.CurrentValue].Opacity = 255; - OpenTaiko.Tx.Gauge_Rainbow[this.ct虹アニメ.CurrentValue].t2D描画(x, y + (smart ? (OpenTaiko.Skin.Game_Gauge_Rect[3] / 2) : 0), - new RectangleF(0, + OpenTaiko.Tx.Gauge_Rainbow[this.ct虹アニメ.CurrentValue].Opacity = 255; + OpenTaiko.Tx.Gauge_Rainbow[this.ct虹アニメ.CurrentValue].t2D描画(x, y + (smart ? (OpenTaiko.Skin.Game_Gauge_Rect[3] / 2) : 0), + new RectangleF(0, smart ? (OpenTaiko.Skin.Game_Gauge_Rect[3] / 2) : 0, OpenTaiko.Tx.Gauge_Rainbow[this.ct虹アニメ.CurrentValue].szTextureSize.Width, smart ? OpenTaiko.Tx.Gauge_Rainbow[this.ct虹アニメ.CurrentValue].szTextureSize.Height - (OpenTaiko.Skin.Game_Gauge_Rect[3] / 2) : OpenTaiko.Tx.Gauge_Rainbow[this.ct虹アニメ.CurrentValue].szTextureSize.Height)); - OpenTaiko.Tx.Gauge_Rainbow[虹ベース].Opacity = (ct虹透明度.CurrentValue * 255 / (int)ct虹透明度.EndValue) / 1; - OpenTaiko.Tx.Gauge_Rainbow[虹ベース].t2D描画(x, y + (smart ? (OpenTaiko.Skin.Game_Gauge_Rect[3] / 2) : 0), - new RectangleF(0, + OpenTaiko.Tx.Gauge_Rainbow[虹ベース].Opacity = (ct虹透明度.CurrentValue * 255 / (int)ct虹透明度.EndValue) / 1; + OpenTaiko.Tx.Gauge_Rainbow[虹ベース].t2D描画(x, y + (smart ? (OpenTaiko.Skin.Game_Gauge_Rect[3] / 2) : 0), + new RectangleF(0, smart ? (OpenTaiko.Skin.Game_Gauge_Rect[3] / 2) : 0, OpenTaiko.Tx.Gauge_Rainbow[虹ベース].szTextureSize.Width, smart ? OpenTaiko.Tx.Gauge_Rainbow[虹ベース].szTextureSize.Height - (OpenTaiko.Skin.Game_Gauge_Rect[3] / 2) : OpenTaiko.Tx.Gauge_Rainbow[虹ベース].szTextureSize.Height)); - } } - - #endregion - - if (OpenTaiko.Tx.Gauge_Line[0] != null) { - - OpenTaiko.Tx.Gauge_Line[0].vcScaleRatio.X = scale; - OpenTaiko.Tx.Gauge_Line[0].vcScaleRatio.Y = scale; - - OpenTaiko.Tx.Gauge_Line[0].t2D描画(x, y); - } - } #endregion - // Soul fire here - if (OpenTaiko.Tx.Gauge_Soul_Fire != null) { - //仮置き - int soulfire_width = OpenTaiko.Tx.Gauge_Soul_Fire.szTextureSize.Width / 8; - int soulfire_height = OpenTaiko.Tx.Gauge_Soul_Fire.szTextureSize.Height; - for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { - if (OpenTaiko.ConfigIni.bAIBattleMode && i == 1) break; + if (OpenTaiko.Tx.Gauge_Line[0] != null) { - int x; - int y; - if (OpenTaiko.ConfigIni.bAIBattleMode) { - x = OpenTaiko.Skin.Gauge_Soul_Fire_X_AI; - y = OpenTaiko.Skin.Gauge_Soul_Fire_Y_AI; + OpenTaiko.Tx.Gauge_Line[0].vcScaleRatio.X = scale; + OpenTaiko.Tx.Gauge_Line[0].vcScaleRatio.Y = scale; + + OpenTaiko.Tx.Gauge_Line[0].t2D描画(x, y); + } + + } + + #endregion + + // Soul fire here + if (OpenTaiko.Tx.Gauge_Soul_Fire != null) { + //仮置き + int soulfire_width = OpenTaiko.Tx.Gauge_Soul_Fire.szTextureSize.Width / 8; + int soulfire_height = OpenTaiko.Tx.Gauge_Soul_Fire.szTextureSize.Height; + for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { + if (OpenTaiko.ConfigIni.bAIBattleMode && i == 1) break; + + int x; + int y; + if (OpenTaiko.ConfigIni.bAIBattleMode) { + x = OpenTaiko.Skin.Gauge_Soul_Fire_X_AI; + y = OpenTaiko.Skin.Gauge_Soul_Fire_Y_AI; + } else { + if (OpenTaiko.ConfigIni.nPlayerCount == 5) { + x = OpenTaiko.Skin.Gauge_Soul_Fire_5P[0] + (OpenTaiko.Skin.Game_UIMove_5P[0] * i); + y = OpenTaiko.Skin.Gauge_Soul_Fire_5P[1] + (OpenTaiko.Skin.Game_UIMove_5P[1] * i); + } else if (OpenTaiko.ConfigIni.nPlayerCount == 4 || OpenTaiko.ConfigIni.nPlayerCount == 3) { + x = OpenTaiko.Skin.Gauge_Soul_Fire_4P[0] + (OpenTaiko.Skin.Game_UIMove_4P[0] * i); + y = OpenTaiko.Skin.Gauge_Soul_Fire_4P[1] + (OpenTaiko.Skin.Game_UIMove_4P[1] * i); } else { - if (OpenTaiko.ConfigIni.nPlayerCount == 5) { - x = OpenTaiko.Skin.Gauge_Soul_Fire_5P[0] + (OpenTaiko.Skin.Game_UIMove_5P[0] * i); - y = OpenTaiko.Skin.Gauge_Soul_Fire_5P[1] + (OpenTaiko.Skin.Game_UIMove_5P[1] * i); - } else if (OpenTaiko.ConfigIni.nPlayerCount == 4 || OpenTaiko.ConfigIni.nPlayerCount == 3) { - x = OpenTaiko.Skin.Gauge_Soul_Fire_4P[0] + (OpenTaiko.Skin.Game_UIMove_4P[0] * i); - y = OpenTaiko.Skin.Gauge_Soul_Fire_4P[1] + (OpenTaiko.Skin.Game_UIMove_4P[1] * i); - } else { - x = OpenTaiko.Skin.Gauge_Soul_Fire_X[i]; - y = OpenTaiko.Skin.Gauge_Soul_Fire_Y[i]; - } - } - - if (this.db現在のゲージ値[i] >= 100.0) { - this.ct炎.TickLoop(); - - OpenTaiko.Tx.Gauge_Soul_Fire.vcScaleRatio.X = scale; - OpenTaiko.Tx.Gauge_Soul_Fire.vcScaleRatio.Y = scale; - - OpenTaiko.Tx.Gauge_Soul_Fire.t2D描画(x, y, new Rectangle(soulfire_width * (this.ct炎.CurrentValue), 0, soulfire_width, soulfire_height)); + x = OpenTaiko.Skin.Gauge_Soul_Fire_X[i]; + y = OpenTaiko.Skin.Gauge_Soul_Fire_Y[i]; } } - } - if (OpenTaiko.Tx.Gauge_Soul != null) { - //仮置き - int soul_height = OpenTaiko.Tx.Gauge_Soul.szTextureSize.Height / 2; - for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { - if (OpenTaiko.ConfigIni.bAIBattleMode && i == 1) break; - int x; - int y; - if (OpenTaiko.ConfigIni.bAIBattleMode) { - x = OpenTaiko.Skin.Gauge_Soul_X_AI; - y = OpenTaiko.Skin.Gauge_Soul_Y_AI; - } else { - if (OpenTaiko.ConfigIni.nPlayerCount == 5) { - x = OpenTaiko.Skin.Gauge_Soul_5P[0] + (OpenTaiko.Skin.Game_UIMove_5P[0] * i); - y = OpenTaiko.Skin.Gauge_Soul_5P[1] + (OpenTaiko.Skin.Game_UIMove_5P[1] * i); - } else if (OpenTaiko.ConfigIni.nPlayerCount == 4 || OpenTaiko.ConfigIni.nPlayerCount == 3) { - x = OpenTaiko.Skin.Gauge_Soul_4P[0] + (OpenTaiko.Skin.Game_UIMove_4P[0] * i); - y = OpenTaiko.Skin.Gauge_Soul_4P[1] + (OpenTaiko.Skin.Game_UIMove_4P[1] * i); - } else { - x = OpenTaiko.Skin.Gauge_Soul_X[i]; - y = OpenTaiko.Skin.Gauge_Soul_Y[i]; - } - } + if (this.db現在のゲージ値[i] >= 100.0) { + this.ct炎.TickLoop(); - OpenTaiko.Tx.Gauge_Soul.vcScaleRatio.X = scale; - OpenTaiko.Tx.Gauge_Soul.vcScaleRatio.Y = scale; + OpenTaiko.Tx.Gauge_Soul_Fire.vcScaleRatio.X = scale; + OpenTaiko.Tx.Gauge_Soul_Fire.vcScaleRatio.Y = scale; - if (this.db現在のゲージ値[i] >= 80.0) { - OpenTaiko.Tx.Gauge_Soul.t2D描画(x, y, new Rectangle(0, 0, OpenTaiko.Tx.Gauge_Soul.szTextureSize.Width, soul_height)); - } else { - OpenTaiko.Tx.Gauge_Soul.t2D描画(x, y, new Rectangle(0, soul_height, OpenTaiko.Tx.Gauge_Soul.szTextureSize.Width, soul_height)); - } + OpenTaiko.Tx.Gauge_Soul_Fire.t2D描画(x, y, new Rectangle(soulfire_width * (this.ct炎.CurrentValue), 0, soulfire_width, soulfire_height)); } } } + if (OpenTaiko.Tx.Gauge_Soul != null) { + //仮置き + int soul_height = OpenTaiko.Tx.Gauge_Soul.szTextureSize.Height / 2; + for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { + if (OpenTaiko.ConfigIni.bAIBattleMode && i == 1) break; - - - - - - //仮置き - int[] nSoulExplosion = new int[] { 73, 468, 0, 0 }; - for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { - for (int d = 0; d < 32; d++) { - if (this.st花火状態[i][d].b使用中) { - this.st花火状態[i][d].ct進行.Tick(); - if (this.st花火状態[i][d].ct進行.IsEnded) { - this.st花火状態[i][d].ct進行.Stop(); - this.st花火状態[i][d].b使用中 = false; + int x; + int y; + if (OpenTaiko.ConfigIni.bAIBattleMode) { + x = OpenTaiko.Skin.Gauge_Soul_X_AI; + y = OpenTaiko.Skin.Gauge_Soul_Y_AI; + } else { + if (OpenTaiko.ConfigIni.nPlayerCount == 5) { + x = OpenTaiko.Skin.Gauge_Soul_5P[0] + (OpenTaiko.Skin.Game_UIMove_5P[0] * i); + y = OpenTaiko.Skin.Gauge_Soul_5P[1] + (OpenTaiko.Skin.Game_UIMove_5P[1] * i); + } else if (OpenTaiko.ConfigIni.nPlayerCount == 4 || OpenTaiko.ConfigIni.nPlayerCount == 3) { + x = OpenTaiko.Skin.Gauge_Soul_4P[0] + (OpenTaiko.Skin.Game_UIMove_4P[0] * i); + y = OpenTaiko.Skin.Gauge_Soul_4P[1] + (OpenTaiko.Skin.Game_UIMove_4P[1] * i); + } else { + x = OpenTaiko.Skin.Gauge_Soul_X[i]; + y = OpenTaiko.Skin.Gauge_Soul_Y[i]; } + } + OpenTaiko.Tx.Gauge_Soul.vcScaleRatio.X = scale; + OpenTaiko.Tx.Gauge_Soul.vcScaleRatio.Y = scale; - break; + if (this.db現在のゲージ値[i] >= 80.0) { + OpenTaiko.Tx.Gauge_Soul.t2D描画(x, y, new Rectangle(0, 0, OpenTaiko.Tx.Gauge_Soul.szTextureSize.Width, soul_height)); + } else { + OpenTaiko.Tx.Gauge_Soul.t2D描画(x, y, new Rectangle(0, soul_height, OpenTaiko.Tx.Gauge_Soul.szTextureSize.Width, soul_height)); } } } } - return 0; + + + + + + + //仮置き + int[] nSoulExplosion = new int[] { 73, 468, 0, 0 }; + for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { + for (int d = 0; d < 32; d++) { + if (this.st花火状態[i][d].b使用中) { + this.st花火状態[i][d].ct進行.Tick(); + if (this.st花火状態[i][d].ct進行.IsEnded) { + this.st花火状態[i][d].ct進行.Stop(); + this.st花火状態[i][d].b使用中 = false; + } + + + break; + } + } + } } - - - // その他 - - #region [ private ] - //----------------- - private CCounter ctGaugeFlash; - - protected STSTATUS[][] st花火状態 = new STSTATUS[5][] { - new STSTATUS[ 32 ], - new STSTATUS[ 32 ], - new STSTATUS[ 32 ], - new STSTATUS[ 32 ], - new STSTATUS[ 32 ] - }; - [StructLayout(LayoutKind.Sequential)] - protected struct STSTATUS { - public CCounter ct進行; - public bool isBig; - public bool b使用中; - public int nPlayer; - public int nLane; - } - //----------------- - #endregion + return 0; } + + + // その他 + + #region [ private ] + //----------------- + private CCounter ctGaugeFlash; + + protected STSTATUS[][] st花火状態 = new STSTATUS[5][] { + new STSTATUS[ 32 ], + new STSTATUS[ 32 ], + new STSTATUS[ 32 ], + new STSTATUS[ 32 ], + new STSTATUS[ 32 ] + }; + [StructLayout(LayoutKind.Sequential)] + protected struct STSTATUS { + public CCounter ct進行; + public bool isBig; + public bool b使用中; + public int nPlayer; + public int nLane; + } + //----------------- + #endregion } diff --git a/OpenTaiko/src/Stages/07.Game/Taiko/CActImplJudgeText.cs b/OpenTaiko/src/Stages/07.Game/Taiko/CActImplJudgeText.cs index 7c22822d..efc810b3 100644 --- a/OpenTaiko/src/Stages/07.Game/Taiko/CActImplJudgeText.cs +++ b/OpenTaiko/src/Stages/07.Game/Taiko/CActImplJudgeText.cs @@ -1,120 +1,120 @@ using System.Drawing; using FDK; -namespace OpenTaiko { - internal class CActImplJudgeText : CActivity { - // コンストラクタ +namespace OpenTaiko; - public CActImplJudgeText() { - base.IsDeActivated = true; +internal class CActImplJudgeText : CActivity { + // コンストラクタ + + public CActImplJudgeText() { + base.IsDeActivated = true; + } + + public override void Activate() { + JudgeAnimes = new List[5]; + for (int i = 0; i < 5; i++) { + JudgeAnimes[i] = new List(); } + base.Activate(); + } - public override void Activate() { - JudgeAnimes = new List[5]; - for (int i = 0; i < 5; i++) { - JudgeAnimes[i] = new List(); + public override void DeActivate() { + for (int i = 0; i < 5; i++) { + for (int j = 0; j < JudgeAnimes[i].Count; j++) { + JudgeAnimes[i][j] = null; } - base.Activate(); } + base.DeActivate(); + } - public override void DeActivate() { - for (int i = 0; i < 5; i++) { - for (int j = 0; j < JudgeAnimes[i].Count; j++) { - JudgeAnimes[i][j] = null; - } - } - base.DeActivate(); - } + // CActivity 実装(共通クラスからの差分のみ) + public override int Draw() { + if (!base.IsDeActivated) { + for (int j = 0; j < 5; j++) { + for (int i = 0; i < JudgeAnimes[j].Count; i++) { + var judgeC = JudgeAnimes[j][i]; + if (judgeC.counter.CurrentValue == judgeC.counter.EndValue) { + JudgeAnimes[j].Remove(judgeC); + continue; + } + judgeC.counter.Tick(); - // CActivity 実装(共通クラスからの差分のみ) - public override int Draw() { - if (!base.IsDeActivated) { - for (int j = 0; j < 5; j++) { - for (int i = 0; i < JudgeAnimes[j].Count; i++) { - var judgeC = JudgeAnimes[j][i]; - if (judgeC.counter.CurrentValue == judgeC.counter.EndValue) { - JudgeAnimes[j].Remove(judgeC); - continue; + if (OpenTaiko.Tx.Judge != null) { + float moveValue = CubicEaseOut(judgeC.counter.CurrentValue / 410.0f) - 1.0f; + + float x = 0; + float y = 0; + + if (OpenTaiko.ConfigIni.nPlayerCount == 5) { + x = OpenTaiko.Skin.Game_Judge_5P[0] + (OpenTaiko.Skin.Game_UIMove_5P[0] * j); + y = OpenTaiko.Skin.Game_Judge_5P[1] + (OpenTaiko.Skin.Game_UIMove_5P[1] * j); + } else if (OpenTaiko.ConfigIni.nPlayerCount == 4 || OpenTaiko.ConfigIni.nPlayerCount == 3) { + x = OpenTaiko.Skin.Game_Judge_4P[0] + (OpenTaiko.Skin.Game_UIMove_4P[0] * j); + y = OpenTaiko.Skin.Game_Judge_4P[1] + (OpenTaiko.Skin.Game_UIMove_4P[1] * j); + } else { + x = OpenTaiko.Skin.Game_Judge_X[j]; + y = OpenTaiko.Skin.Game_Judge_Y[j]; } - judgeC.counter.Tick(); + x += (moveValue * OpenTaiko.Skin.Game_Judge_Move[0]) + OpenTaiko.stage演奏ドラム画面.GetJPOSCROLLX(j); + y += (moveValue * OpenTaiko.Skin.Game_Judge_Move[1]) + OpenTaiko.stage演奏ドラム画面.GetJPOSCROLLY(j); - if (OpenTaiko.Tx.Judge != null) { - float moveValue = CubicEaseOut(judgeC.counter.CurrentValue / 410.0f) - 1.0f; - - float x = 0; - float y = 0; - - if (OpenTaiko.ConfigIni.nPlayerCount == 5) { - x = OpenTaiko.Skin.Game_Judge_5P[0] + (OpenTaiko.Skin.Game_UIMove_5P[0] * j); - y = OpenTaiko.Skin.Game_Judge_5P[1] + (OpenTaiko.Skin.Game_UIMove_5P[1] * j); - } else if (OpenTaiko.ConfigIni.nPlayerCount == 4 || OpenTaiko.ConfigIni.nPlayerCount == 3) { - x = OpenTaiko.Skin.Game_Judge_4P[0] + (OpenTaiko.Skin.Game_UIMove_4P[0] * j); - y = OpenTaiko.Skin.Game_Judge_4P[1] + (OpenTaiko.Skin.Game_UIMove_4P[1] * j); - } else { - x = OpenTaiko.Skin.Game_Judge_X[j]; - y = OpenTaiko.Skin.Game_Judge_Y[j]; - } - x += (moveValue * OpenTaiko.Skin.Game_Judge_Move[0]) + OpenTaiko.stage演奏ドラム画面.GetJPOSCROLLX(j); - y += (moveValue * OpenTaiko.Skin.Game_Judge_Move[1]) + OpenTaiko.stage演奏ドラム画面.GetJPOSCROLLY(j); - - OpenTaiko.Tx.Judge.Opacity = (int)(255f - (judgeC.counter.CurrentValue >= 360 ? ((judgeC.counter.CurrentValue - 360) / 50.0f) * 255f : 0f)); - OpenTaiko.Tx.Judge.t2D描画(x, y, judgeC.rc); - } + OpenTaiko.Tx.Judge.Opacity = (int)(255f - (judgeC.counter.CurrentValue >= 360 ? ((judgeC.counter.CurrentValue - 360) / 50.0f) * 255f : 0f)); + OpenTaiko.Tx.Judge.t2D描画(x, y, judgeC.rc); } } } - return 0; } - - public void Start(int player, ENoteJudge judge) { - JudgeAnime judgeAnime = new(); - judgeAnime.counter.Start(0, 410, 1, OpenTaiko.Timer); - judgeAnime.Judge = judge; - - //int njudge = judge == E判定.Perfect ? 0 : judge == E判定.Good ? 1 : judge == E判定.ADLIB ? 3 : judge == E判定.Auto ? 0 : 2; - - int njudge = 2; - if (JudgesDict.ContainsKey(judge)) { - njudge = JudgesDict[judge]; - } - - if (njudge == 0 && OpenTaiko.ConfigIni.SimpleMode) { - return; - } - - int height = OpenTaiko.Tx.Judge.szTextureSize.Height / 5; - judgeAnime.rc = new Rectangle(0, (int)njudge * height, OpenTaiko.Tx.Judge.szTextureSize.Width, height); - - JudgeAnimes[player].Add(judgeAnime); - } - - // その他 - - #region [ private ] - //----------------- - - private static Dictionary JudgesDict = new Dictionary { - [ENoteJudge.Perfect] = 0, - [ENoteJudge.Auto] = 0, - [ENoteJudge.Good] = 1, - [ENoteJudge.Bad] = 2, - [ENoteJudge.Miss] = 2, - [ENoteJudge.ADLIB] = 3, - [ENoteJudge.Mine] = 4, - }; - - private List[] JudgeAnimes = new List[5]; - private class JudgeAnime { - public ENoteJudge Judge; - public Rectangle rc; - public CCounter counter = new CCounter(); - } - - private float CubicEaseOut(float p) { - float f = (p - 1); - return f * f * f + 1; - } - //----------------- - #endregion + return 0; } + + public void Start(int player, ENoteJudge judge) { + JudgeAnime judgeAnime = new(); + judgeAnime.counter.Start(0, 410, 1, OpenTaiko.Timer); + judgeAnime.Judge = judge; + + //int njudge = judge == E判定.Perfect ? 0 : judge == E判定.Good ? 1 : judge == E判定.ADLIB ? 3 : judge == E判定.Auto ? 0 : 2; + + int njudge = 2; + if (JudgesDict.ContainsKey(judge)) { + njudge = JudgesDict[judge]; + } + + if (njudge == 0 && OpenTaiko.ConfigIni.SimpleMode) { + return; + } + + int height = OpenTaiko.Tx.Judge.szTextureSize.Height / 5; + judgeAnime.rc = new Rectangle(0, (int)njudge * height, OpenTaiko.Tx.Judge.szTextureSize.Width, height); + + JudgeAnimes[player].Add(judgeAnime); + } + + // その他 + + #region [ private ] + //----------------- + + private static Dictionary JudgesDict = new Dictionary { + [ENoteJudge.Perfect] = 0, + [ENoteJudge.Auto] = 0, + [ENoteJudge.Good] = 1, + [ENoteJudge.Bad] = 2, + [ENoteJudge.Miss] = 2, + [ENoteJudge.ADLIB] = 3, + [ENoteJudge.Mine] = 4, + }; + + private List[] JudgeAnimes = new List[5]; + private class JudgeAnime { + public ENoteJudge Judge; + public Rectangle rc; + public CCounter counter = new CCounter(); + } + + private float CubicEaseOut(float p) { + float f = (p - 1); + return f * f * f + 1; + } + //----------------- + #endregion } diff --git a/OpenTaiko/src/Stages/07.Game/Taiko/CActImplLane.cs b/OpenTaiko/src/Stages/07.Game/Taiko/CActImplLane.cs index e65a0cf7..cc63062e 100644 --- a/OpenTaiko/src/Stages/07.Game/Taiko/CActImplLane.cs +++ b/OpenTaiko/src/Stages/07.Game/Taiko/CActImplLane.cs @@ -1,179 +1,179 @@ using FDK; -namespace OpenTaiko { - internal class CActImplLane : CActivity { - public CActImplLane() { - base.IsDeActivated = true; - } +namespace OpenTaiko; - public override void Activate() { - this.ct分岐アニメ進行 = new CCounter[5]; +internal class CActImplLane : CActivity { + public CActImplLane() { + base.IsDeActivated = true; + } + + public override void Activate() { + this.ct分岐アニメ進行 = new CCounter[5]; + this.nBefore = new CDTX.ECourse[5]; + this.nAfter = new CDTX.ECourse[5]; + for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { + this.ct分岐アニメ進行[i] = new CCounter(); this.nBefore = new CDTX.ECourse[5]; this.nAfter = new CDTX.ECourse[5]; - for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { - this.ct分岐アニメ進行[i] = new CCounter(); - this.nBefore = new CDTX.ECourse[5]; - this.nAfter = new CDTX.ECourse[5]; - this.bState[i] = false; + this.bState[i] = false; + } + if (OpenTaiko.Tx.Lane_Base[0] != null) + OpenTaiko.Tx.Lane_Base[0].Opacity = 255; + + base.Activate(); + } + + public override void DeActivate() { + OpenTaiko.tDisposeSafely(ref this.ct分岐アニメ進行); + base.DeActivate(); + } + + public override void CreateManagedResource() { + base.CreateManagedResource(); + } + + public override void ReleaseManagedResource() { + + + base.ReleaseManagedResource(); + } + + public override int Draw() { + for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { + if (!this.ct分岐アニメ進行[i].IsStoped) { + this.ct分岐アニメ進行[i].Tick(); + if (this.ct分岐アニメ進行[i].IsEnded) { + this.bState[i] = false; + this.ct分岐アニメ進行[i].Stop(); + } } - if (OpenTaiko.Tx.Lane_Base[0] != null) - OpenTaiko.Tx.Lane_Base[0].Opacity = 255; - - base.Activate(); } - public override void DeActivate() { - OpenTaiko.tDisposeSafely(ref this.ct分岐アニメ進行); - base.DeActivate(); + int[] x = new int[5]; + int[] y = new int[5]; + + for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { + if (OpenTaiko.ConfigIni.nPlayerCount == 5) { + x[i] = OpenTaiko.Skin.Game_Lane_5P[0] + (OpenTaiko.Skin.Game_UIMove_5P[0] * i); + y[i] = OpenTaiko.Skin.Game_Lane_5P[1] + (OpenTaiko.Skin.Game_UIMove_5P[1] * i); + } else if (OpenTaiko.ConfigIni.nPlayerCount == 4 || OpenTaiko.ConfigIni.nPlayerCount == 3) { + x[i] = OpenTaiko.Skin.Game_Lane_4P[0] + (OpenTaiko.Skin.Game_UIMove_4P[0] * i); + y[i] = OpenTaiko.Skin.Game_Lane_4P[1] + (OpenTaiko.Skin.Game_UIMove_4P[1] * i); + } else { + x[i] = OpenTaiko.Skin.Game_Lane_X[i]; + y[i] = OpenTaiko.Skin.Game_Lane_Y[i]; + } } - public override void CreateManagedResource() { - base.CreateManagedResource(); - } + //アニメーション中の分岐レイヤー(背景)の描画を行う。 + for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { + if (OpenTaiko.stage演奏ドラム画面.bUseBranch[i] == true) { - public override void ReleaseManagedResource() { + #region NullCheck + bool _laneNull = false; - base.ReleaseManagedResource(); - } - - public override int Draw() { - for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { - if (!this.ct分岐アニメ進行[i].IsStoped) { - this.ct分岐アニメ進行[i].Tick(); - if (this.ct分岐アニメ進行[i].IsEnded) { - this.bState[i] = false; - this.ct分岐アニメ進行[i].Stop(); + for (int j = 0; j < OpenTaiko.Tx.Lane_Base.Length; j++) { + if (OpenTaiko.Tx.Lane_Base[j] == null) { + _laneNull = true; + break; } } - } - int[] x = new int[5]; - int[] y = new int[5]; + #endregion - for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { - if (OpenTaiko.ConfigIni.nPlayerCount == 5) { - x[i] = OpenTaiko.Skin.Game_Lane_5P[0] + (OpenTaiko.Skin.Game_UIMove_5P[0] * i); - y[i] = OpenTaiko.Skin.Game_Lane_5P[1] + (OpenTaiko.Skin.Game_UIMove_5P[1] * i); - } else if (OpenTaiko.ConfigIni.nPlayerCount == 4 || OpenTaiko.ConfigIni.nPlayerCount == 3) { - x[i] = OpenTaiko.Skin.Game_Lane_4P[0] + (OpenTaiko.Skin.Game_UIMove_4P[0] * i); - y[i] = OpenTaiko.Skin.Game_Lane_4P[1] + (OpenTaiko.Skin.Game_UIMove_4P[1] * i); - } else { - x[i] = OpenTaiko.Skin.Game_Lane_X[i]; - y[i] = OpenTaiko.Skin.Game_Lane_Y[i]; - } - } - - //アニメーション中の分岐レイヤー(背景)の描画を行う。 - for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { - if (OpenTaiko.stage演奏ドラム画面.bUseBranch[i] == true) { - - #region NullCheck - - bool _laneNull = false; - - for (int j = 0; j < OpenTaiko.Tx.Lane_Base.Length; j++) { - if (OpenTaiko.Tx.Lane_Base[j] == null) { - _laneNull = true; - break; + if (OpenTaiko.ConfigIni.SimpleMode) { + OpenTaiko.Tx.Lane_Base[(int)nAfter[i]].t2D描画(x[i], y[i]); + } else if (this.ct分岐アニメ進行[i].IsTicked && !_laneNull) { + #region[ 普通譜面_レベルアップ ] + //普通→玄人 + if (nBefore[i] == 0 && nAfter[i] == CDTX.ECourse.eNormal) { + OpenTaiko.Tx.Lane_Base[1].Opacity = this.ct分岐アニメ進行[i].CurrentValue > 100 ? 255 : ((this.ct分岐アニメ進行[i].CurrentValue * 0xff) / 100); + OpenTaiko.Tx.Lane_Base[0].t2D描画(x[i], y[i]); + OpenTaiko.Tx.Lane_Base[1].t2D描画(x[i], y[i]); + } + //普通→達人 + if (nBefore[i] == 0 && nAfter[i] == CDTX.ECourse.eMaster) { + OpenTaiko.Tx.Lane_Base[0].t2D描画(x[i], y[i]); + if (this.ct分岐アニメ進行[i].CurrentValue < 100) { + OpenTaiko.Tx.Lane_Base[1].Opacity = this.ct分岐アニメ進行[i].CurrentValue > 100 ? 255 : ((this.ct分岐アニメ進行[i].CurrentValue * 0xff) / 100); + OpenTaiko.Tx.Lane_Base[1].t2D描画(x[i], y[i]); + } else if (this.ct分岐アニメ進行[i].CurrentValue >= 100 && this.ct分岐アニメ進行[i].CurrentValue < 150) { + OpenTaiko.Tx.Lane_Base[1].Opacity = 255; + OpenTaiko.Tx.Lane_Base[1].t2D描画(x[i], y[i]); + } else if (this.ct分岐アニメ進行[i].CurrentValue >= 150) { + OpenTaiko.Tx.Lane_Base[1].t2D描画(x[i], y[i]); + OpenTaiko.Tx.Lane_Base[2].Opacity = this.ct分岐アニメ進行[i].CurrentValue > 250 ? 255 : (((this.ct分岐アニメ進行[i].CurrentValue - 150) * 0xff) / 100); + OpenTaiko.Tx.Lane_Base[2].t2D描画(x[i], y[i]); } } - #endregion - if (OpenTaiko.ConfigIni.SimpleMode) { - OpenTaiko.Tx.Lane_Base[(int)nAfter[i]].t2D描画(x[i], y[i]); - } else if (this.ct分岐アニメ進行[i].IsTicked && !_laneNull) { - #region[ 普通譜面_レベルアップ ] - //普通→玄人 - if (nBefore[i] == 0 && nAfter[i] == CDTX.ECourse.eNormal) { - OpenTaiko.Tx.Lane_Base[1].Opacity = this.ct分岐アニメ進行[i].CurrentValue > 100 ? 255 : ((this.ct分岐アニメ進行[i].CurrentValue * 0xff) / 100); - OpenTaiko.Tx.Lane_Base[0].t2D描画(x[i], y[i]); - OpenTaiko.Tx.Lane_Base[1].t2D描画(x[i], y[i]); - } - //普通→達人 - if (nBefore[i] == 0 && nAfter[i] == CDTX.ECourse.eMaster) { - OpenTaiko.Tx.Lane_Base[0].t2D描画(x[i], y[i]); - if (this.ct分岐アニメ進行[i].CurrentValue < 100) { - OpenTaiko.Tx.Lane_Base[1].Opacity = this.ct分岐アニメ進行[i].CurrentValue > 100 ? 255 : ((this.ct分岐アニメ進行[i].CurrentValue * 0xff) / 100); - OpenTaiko.Tx.Lane_Base[1].t2D描画(x[i], y[i]); - } else if (this.ct分岐アニメ進行[i].CurrentValue >= 100 && this.ct分岐アニメ進行[i].CurrentValue < 150) { - OpenTaiko.Tx.Lane_Base[1].Opacity = 255; - OpenTaiko.Tx.Lane_Base[1].t2D描画(x[i], y[i]); - } else if (this.ct分岐アニメ進行[i].CurrentValue >= 150) { - OpenTaiko.Tx.Lane_Base[1].t2D描画(x[i], y[i]); - OpenTaiko.Tx.Lane_Base[2].Opacity = this.ct分岐アニメ進行[i].CurrentValue > 250 ? 255 : (((this.ct分岐アニメ進行[i].CurrentValue - 150) * 0xff) / 100); - OpenTaiko.Tx.Lane_Base[2].t2D描画(x[i], y[i]); - } - } - #endregion - - #region[ 玄人譜面_レベルアップ ] - if (nBefore[i] == CDTX.ECourse.eExpert && nAfter[i] == CDTX.ECourse.eMaster) { - OpenTaiko.Tx.Lane_Base[1].t2D描画(x[i], y[i]); - OpenTaiko.Tx.Lane_Base[2].Opacity = this.ct分岐アニメ進行[i].CurrentValue > 100 ? 255 : ((this.ct分岐アニメ進行[i].CurrentValue * 0xff) / 100); - OpenTaiko.Tx.Lane_Base[2].t2D描画(x[i], y[i]); - } - #endregion - - #region[ 玄人譜面_レベルダウン ] - if (nBefore[i] == CDTX.ECourse.eExpert && nAfter[i] == CDTX.ECourse.eNormal) { - OpenTaiko.Tx.Lane_Base[1].t2D描画(x[i], y[i]); - OpenTaiko.Tx.Lane_Base[0].Opacity = this.ct分岐アニメ進行[i].CurrentValue > 100 ? 255 : ((this.ct分岐アニメ進行[i].CurrentValue * 0xff) / 100); - OpenTaiko.Tx.Lane_Base[0].t2D描画(x[i], y[i]); - } - #endregion - - #region[ 達人譜面_レベルダウン ] - if (nBefore[i] == CDTX.ECourse.eMaster && nAfter[i] == CDTX.ECourse.eNormal) { - OpenTaiko.Tx.Lane_Base[2].t2D描画(x[i], y[i]); - if (this.ct分岐アニメ進行[i].CurrentValue < 100) { - OpenTaiko.Tx.Lane_Base[1].Opacity = this.ct分岐アニメ進行[i].CurrentValue > 100 ? 255 : ((this.ct分岐アニメ進行[i].CurrentValue * 0xff) / 100); - OpenTaiko.Tx.Lane_Base[1].t2D描画(x[i], y[i]); - } else if (this.ct分岐アニメ進行[i].CurrentValue >= 100 && this.ct分岐アニメ進行[i].CurrentValue < 150) { - OpenTaiko.Tx.Lane_Base[1].Opacity = 255; - OpenTaiko.Tx.Lane_Base[1].t2D描画(x[i], y[i]); - } else if (this.ct分岐アニメ進行[i].CurrentValue >= 150) { - OpenTaiko.Tx.Lane_Base[1].t2D描画(x[i], y[i]); - OpenTaiko.Tx.Lane_Base[0].Opacity = this.ct分岐アニメ進行[i].CurrentValue > 250 ? 255 : (((this.ct分岐アニメ進行[i].CurrentValue - 150) * 0xff) / 100); - OpenTaiko.Tx.Lane_Base[0].t2D描画(x[i], y[i]); - } - } - if (nBefore[i] == CDTX.ECourse.eMaster && nAfter[i] == CDTX.ECourse.eExpert) { - OpenTaiko.Tx.Lane_Base[2].t2D描画(x[i], y[i]); - OpenTaiko.Tx.Lane_Base[2].Opacity = this.ct分岐アニメ進行[i].CurrentValue > 100 ? 255 : ((this.ct分岐アニメ進行[i].CurrentValue * 0xff) / 100); - OpenTaiko.Tx.Lane_Base[2].t2D描画(x[i], y[i]); - } - #endregion + #region[ 玄人譜面_レベルアップ ] + if (nBefore[i] == CDTX.ECourse.eExpert && nAfter[i] == CDTX.ECourse.eMaster) { + OpenTaiko.Tx.Lane_Base[1].t2D描画(x[i], y[i]); + OpenTaiko.Tx.Lane_Base[2].Opacity = this.ct分岐アニメ進行[i].CurrentValue > 100 ? 255 : ((this.ct分岐アニメ進行[i].CurrentValue * 0xff) / 100); + OpenTaiko.Tx.Lane_Base[2].t2D描画(x[i], y[i]); } + #endregion + + #region[ 玄人譜面_レベルダウン ] + if (nBefore[i] == CDTX.ECourse.eExpert && nAfter[i] == CDTX.ECourse.eNormal) { + OpenTaiko.Tx.Lane_Base[1].t2D描画(x[i], y[i]); + OpenTaiko.Tx.Lane_Base[0].Opacity = this.ct分岐アニメ進行[i].CurrentValue > 100 ? 255 : ((this.ct分岐アニメ進行[i].CurrentValue * 0xff) / 100); + OpenTaiko.Tx.Lane_Base[0].t2D描画(x[i], y[i]); + } + #endregion + + #region[ 達人譜面_レベルダウン ] + if (nBefore[i] == CDTX.ECourse.eMaster && nAfter[i] == CDTX.ECourse.eNormal) { + OpenTaiko.Tx.Lane_Base[2].t2D描画(x[i], y[i]); + if (this.ct分岐アニメ進行[i].CurrentValue < 100) { + OpenTaiko.Tx.Lane_Base[1].Opacity = this.ct分岐アニメ進行[i].CurrentValue > 100 ? 255 : ((this.ct分岐アニメ進行[i].CurrentValue * 0xff) / 100); + OpenTaiko.Tx.Lane_Base[1].t2D描画(x[i], y[i]); + } else if (this.ct分岐アニメ進行[i].CurrentValue >= 100 && this.ct分岐アニメ進行[i].CurrentValue < 150) { + OpenTaiko.Tx.Lane_Base[1].Opacity = 255; + OpenTaiko.Tx.Lane_Base[1].t2D描画(x[i], y[i]); + } else if (this.ct分岐アニメ進行[i].CurrentValue >= 150) { + OpenTaiko.Tx.Lane_Base[1].t2D描画(x[i], y[i]); + OpenTaiko.Tx.Lane_Base[0].Opacity = this.ct分岐アニメ進行[i].CurrentValue > 250 ? 255 : (((this.ct分岐アニメ進行[i].CurrentValue - 150) * 0xff) / 100); + OpenTaiko.Tx.Lane_Base[0].t2D描画(x[i], y[i]); + } + } + if (nBefore[i] == CDTX.ECourse.eMaster && nAfter[i] == CDTX.ECourse.eExpert) { + OpenTaiko.Tx.Lane_Base[2].t2D描画(x[i], y[i]); + OpenTaiko.Tx.Lane_Base[2].Opacity = this.ct分岐アニメ進行[i].CurrentValue > 100 ? 255 : ((this.ct分岐アニメ進行[i].CurrentValue * 0xff) / 100); + OpenTaiko.Tx.Lane_Base[2].t2D描画(x[i], y[i]); + } + #endregion } } - return base.Draw(); } - - public virtual void t分岐レイヤー_コース変化(CDTX.ECourse n現在, CDTX.ECourse n次回, int player) { - if (n現在 == n次回) { - return; - } - this.ct分岐アニメ進行[player] = new CCounter(0, 300, 2, OpenTaiko.Timer); - this.bState[player] = true; - - this.nBefore[player] = n現在; - this.nAfter[player] = n次回; - - } - - #region[ private ] - //----------------- - public bool[] bState = new bool[5]; - public CCounter[] ct分岐アニメ進行 = new CCounter[5]; - private CDTX.ECourse[] nBefore; - private CDTX.ECourse[] nAfter; - private int[] n透明度 = new int[5]; - //private CTexture[] tx普通譜面 = new CTexture[2]; - //private CTexture[] tx玄人譜面 = new CTexture[2]; - //private CTexture[] tx達人譜面 = new CTexture[2]; - //----------------- - #endregion + return base.Draw(); } + + public virtual void t分岐レイヤー_コース変化(CDTX.ECourse n現在, CDTX.ECourse n次回, int player) { + if (n現在 == n次回) { + return; + } + this.ct分岐アニメ進行[player] = new CCounter(0, 300, 2, OpenTaiko.Timer); + this.bState[player] = true; + + this.nBefore[player] = n現在; + this.nAfter[player] = n次回; + + } + + #region[ private ] + //----------------- + public bool[] bState = new bool[5]; + public CCounter[] ct分岐アニメ進行 = new CCounter[5]; + private CDTX.ECourse[] nBefore; + private CDTX.ECourse[] nAfter; + private int[] n透明度 = new int[5]; + //private CTexture[] tx普通譜面 = new CTexture[2]; + //private CTexture[] tx玄人譜面 = new CTexture[2]; + //private CTexture[] tx達人譜面 = new CTexture[2]; + //----------------- + #endregion } diff --git a/OpenTaiko/src/Stages/07.Game/Taiko/CActImplLaneTaiko.cs b/OpenTaiko/src/Stages/07.Game/Taiko/CActImplLaneTaiko.cs index ea637faf..ce1f8058 100644 --- a/OpenTaiko/src/Stages/07.Game/Taiko/CActImplLaneTaiko.cs +++ b/OpenTaiko/src/Stages/07.Game/Taiko/CActImplLaneTaiko.cs @@ -2,260 +2,277 @@ using FDK; using Rectangle = System.Drawing.Rectangle; -namespace OpenTaiko { - internal class CActImplLaneTaiko : CActivity { - /// - /// レーンを描画するクラス。 - /// - /// - /// - public CActImplLaneTaiko() { - base.IsDeActivated = true; +namespace OpenTaiko; + +internal class CActImplLaneTaiko : CActivity { + /// + /// レーンを描画するクラス。 + /// + /// + /// + public CActImplLaneTaiko() { + base.IsDeActivated = true; + } + + public override void Activate() { + for (int i = 0; i < 5; i++) { + this.st状態[i].ct進行 = new CCounter(); + this.stBranch[i].ct分岐アニメ進行 = new CCounter(); + this.stBranch[i].nフラッシュ制御タイマ = -1; + this.stBranch[i].nBranchレイヤー透明度 = 0; + this.stBranch[i].nBranch文字透明度 = 0; + this.stBranch[i].nY座標 = 0; + + this.n総移動時間[i] = -1; + } + this.ctゴーゴー = new CCounter(); + + + this.ctゴーゴー炎 = new CCounter(0, 6, 50, OpenTaiko.Timer); + base.Activate(); + } + + public override void DeActivate() { + for (int i = 0; i < 5; i++) { + this.st状態[i].ct進行 = null; + this.stBranch[i].ct分岐アニメ進行 = null; + } + this.ctゴーゴー = null; + + base.DeActivate(); + } + + public override void CreateManagedResource() { + base.CreateManagedResource(); + } + + public override void ReleaseManagedResource() { + base.ReleaseManagedResource(); + } + + public override int Draw() { + if (base.IsFirstDraw) { + for (int i = 0; i < 5; i++) + this.stBranch[i].nフラッシュ制御タイマ = (long)(SoundManager.PlayTimer.NowTime * OpenTaiko.ConfigIni.SongPlaybackSpeed); + base.IsFirstDraw = false; } - public override void Activate() { - for (int i = 0; i < 5; i++) { - this.st状態[i].ct進行 = new CCounter(); - this.stBranch[i].ct分岐アニメ進行 = new CCounter(); - this.stBranch[i].nフラッシュ制御タイマ = -1; - this.stBranch[i].nBranchレイヤー透明度 = 0; - this.stBranch[i].nBranch文字透明度 = 0; - this.stBranch[i].nY座標 = 0; + //それぞれが独立したレイヤーでないといけないのでforループはパーツごとに分離すること。 - this.n総移動時間[i] = -1; + if (OpenTaiko.ConfigIni.nPlayerCount <= 2 && !OpenTaiko.ConfigIni.bAIBattleMode) OpenTaiko.stage演奏ドラム画面.actMtaiko.DrawBackSymbol(); + + #region[ レーン本体 ] + + + int[] x = new int[5]; + int[] y = new int[5]; + + for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { + if (OpenTaiko.ConfigIni.nPlayerCount == 5) { + x[i] = OpenTaiko.Skin.Game_Lane_5P[0] + (OpenTaiko.Skin.Game_UIMove_5P[0] * i); + y[i] = OpenTaiko.Skin.Game_Lane_5P[1] + (OpenTaiko.Skin.Game_UIMove_5P[1] * i); + } else if (OpenTaiko.ConfigIni.nPlayerCount == 4 || OpenTaiko.ConfigIni.nPlayerCount == 3) { + x[i] = OpenTaiko.Skin.Game_Lane_4P[0] + (OpenTaiko.Skin.Game_UIMove_4P[0] * i); + y[i] = OpenTaiko.Skin.Game_Lane_4P[1] + (OpenTaiko.Skin.Game_UIMove_4P[1] * i); + } else { + x[i] = OpenTaiko.Skin.Game_Lane_X[i]; + y[i] = OpenTaiko.Skin.Game_Lane_Y[i]; } - this.ctゴーゴー = new CCounter(); - - - this.ctゴーゴー炎 = new CCounter(0, 6, 50, OpenTaiko.Timer); - base.Activate(); } - public override void DeActivate() { - for (int i = 0; i < 5; i++) { - this.st状態[i].ct進行 = null; - this.stBranch[i].ct分岐アニメ進行 = null; + for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { + if (i == 1 && OpenTaiko.ConfigIni.bAIBattleMode && OpenTaiko.Tx.Lane_Background_AI != null) + OpenTaiko.Tx.Lane_Background_AI?.t2D描画(x[i], y[i]); + else + OpenTaiko.Tx.Lane_Background_Main?.t2D描画(x[i], y[i]); + } + + #endregion + + if (OpenTaiko.ConfigIni.nPlayerCount > 2 && !OpenTaiko.ConfigIni.bAIBattleMode) OpenTaiko.stage演奏ドラム画面.actMtaiko.DrawBackSymbol(); + + for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { + #region[ 分岐アニメ制御タイマー ] + long num = FDK.SoundManager.PlayTimer.NowTime; + if (num < this.stBranch[i].nフラッシュ制御タイマ) { + this.stBranch[i].nフラッシュ制御タイマ = num; } - this.ctゴーゴー = null; + while ((num - this.stBranch[i].nフラッシュ制御タイマ) >= 30) { + if (this.stBranch[i].nBranchレイヤー透明度 <= 255) { + this.stBranch[i].nBranchレイヤー透明度 += 10; + } - base.DeActivate(); - } + if (this.stBranch[i].nBranch文字透明度 >= 0) { + this.stBranch[i].nBranch文字透明度 -= 10; + } - public override void CreateManagedResource() { - base.CreateManagedResource(); - } + if (this.stBranch[i].nY座標 != 0 && this.stBranch[i].nY座標 <= 20) { + this.stBranch[i].nY座標++; + } - public override void ReleaseManagedResource() { - base.ReleaseManagedResource(); - } - - public override int Draw() { - if (base.IsFirstDraw) { - for (int i = 0; i < 5; i++) - this.stBranch[i].nフラッシュ制御タイマ = (long)(SoundManager.PlayTimer.NowTime * OpenTaiko.ConfigIni.SongPlaybackSpeed); - base.IsFirstDraw = false; + this.stBranch[i].nフラッシュ制御タイマ += 8; } - //それぞれが独立したレイヤーでないといけないのでforループはパーツごとに分離すること。 - - if (OpenTaiko.ConfigIni.nPlayerCount <= 2 && !OpenTaiko.ConfigIni.bAIBattleMode) OpenTaiko.stage演奏ドラム画面.actMtaiko.DrawBackSymbol(); - - #region[ レーン本体 ] - - - int[] x = new int[5]; - int[] y = new int[5]; - - for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { - if (OpenTaiko.ConfigIni.nPlayerCount == 5) { - x[i] = OpenTaiko.Skin.Game_Lane_5P[0] + (OpenTaiko.Skin.Game_UIMove_5P[0] * i); - y[i] = OpenTaiko.Skin.Game_Lane_5P[1] + (OpenTaiko.Skin.Game_UIMove_5P[1] * i); - } else if (OpenTaiko.ConfigIni.nPlayerCount == 4 || OpenTaiko.ConfigIni.nPlayerCount == 3) { - x[i] = OpenTaiko.Skin.Game_Lane_4P[0] + (OpenTaiko.Skin.Game_UIMove_4P[0] * i); - y[i] = OpenTaiko.Skin.Game_Lane_4P[1] + (OpenTaiko.Skin.Game_UIMove_4P[1] * i); - } else { - x[i] = OpenTaiko.Skin.Game_Lane_X[i]; - y[i] = OpenTaiko.Skin.Game_Lane_Y[i]; + if (!this.stBranch[i].ct分岐アニメ進行.IsStoped) { + this.stBranch[i].ct分岐アニメ進行.Tick(); + if (this.stBranch[i].ct分岐アニメ進行.IsEnded) { + this.stBranch[i].ct分岐アニメ進行.Stop(); } } - - for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { - if (i == 1 && OpenTaiko.ConfigIni.bAIBattleMode && OpenTaiko.Tx.Lane_Background_AI != null) - OpenTaiko.Tx.Lane_Background_AI?.t2D描画(x[i], y[i]); - else - OpenTaiko.Tx.Lane_Background_Main?.t2D描画(x[i], y[i]); - } - #endregion - - if (OpenTaiko.ConfigIni.nPlayerCount > 2 && !OpenTaiko.ConfigIni.bAIBattleMode) OpenTaiko.stage演奏ドラム画面.actMtaiko.DrawBackSymbol(); - - for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { - #region[ 分岐アニメ制御タイマー ] - long num = FDK.SoundManager.PlayTimer.NowTime; - if (num < this.stBranch[i].nフラッシュ制御タイマ) { - this.stBranch[i].nフラッシュ制御タイマ = num; - } - while ((num - this.stBranch[i].nフラッシュ制御タイマ) >= 30) { - if (this.stBranch[i].nBranchレイヤー透明度 <= 255) { - this.stBranch[i].nBranchレイヤー透明度 += 10; - } - - if (this.stBranch[i].nBranch文字透明度 >= 0) { - this.stBranch[i].nBranch文字透明度 -= 10; - } - - if (this.stBranch[i].nY座標 != 0 && this.stBranch[i].nY座標 <= 20) { - this.stBranch[i].nY座標++; - } - - this.stBranch[i].nフラッシュ制御タイマ += 8; - } - - if (!this.stBranch[i].ct分岐アニメ進行.IsStoped) { - this.stBranch[i].ct分岐アニメ進行.Tick(); - if (this.stBranch[i].ct分岐アニメ進行.IsEnded) { - this.stBranch[i].ct分岐アニメ進行.Stop(); - } + } + #region[ 分岐レイヤー ] + for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { + if (OpenTaiko.stage演奏ドラム画面.bUseBranch[i] == true) { + #region[ 動いていない ] + switch (OpenTaiko.stage演奏ドラム画面.nレーン用表示コース[i]) { + case CDTX.ECourse.eNormal: + if (OpenTaiko.Tx.Lane_Base[0] != null) { + OpenTaiko.Tx.Lane_Base[0].Opacity = 255; + OpenTaiko.Tx.Lane_Base[0].t2D描画(x[i], y[i]); + } + break; + case CDTX.ECourse.eExpert: + if (OpenTaiko.Tx.Lane_Base[1] != null) { + OpenTaiko.Tx.Lane_Base[1].Opacity = 255; + OpenTaiko.Tx.Lane_Base[1].t2D描画(x[i], y[i]); + } + break; + case CDTX.ECourse.eMaster: + if (OpenTaiko.Tx.Lane_Base[2] != null) { + OpenTaiko.Tx.Lane_Base[2].Opacity = 255; + OpenTaiko.Tx.Lane_Base[2].t2D描画(x[i], y[i]); + } + break; } #endregion - } - #region[ 分岐レイヤー ] - for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { - if (OpenTaiko.stage演奏ドラム画面.bUseBranch[i] == true) { - #region[ 動いていない ] - switch (OpenTaiko.stage演奏ドラム画面.nレーン用表示コース[i]) { - case CDTX.ECourse.eNormal: - if (OpenTaiko.Tx.Lane_Base[0] != null) { - OpenTaiko.Tx.Lane_Base[0].Opacity = 255; + + if (OpenTaiko.ConfigIni.nBranchAnime == 1) { + #region[ AC7~14風の背後レイヤー ] + if (this.stBranch[i].ct分岐アニメ進行.IsTicked) { + int n透明度 = ((100 - this.stBranch[i].ct分岐アニメ進行.CurrentValue) * 0xff) / 100; + + if (this.stBranch[i].ct分岐アニメ進行.IsEnded) { + n透明度 = 255; + this.stBranch[i].ct分岐アニメ進行.Stop(); + } + + #region[ 普通譜面_レベルアップ ] + //普通→玄人 + if (this.stBranch[i].nBefore == CDTX.ECourse.eNormal && this.stBranch[i].nAfter == CDTX.ECourse.eExpert) { + if (OpenTaiko.Tx.Lane_Base[0] != null && OpenTaiko.Tx.Lane_Base[1] != null) { OpenTaiko.Tx.Lane_Base[0].t2D描画(x[i], y[i]); - } - break; - case CDTX.ECourse.eExpert: - if (OpenTaiko.Tx.Lane_Base[1] != null) { - OpenTaiko.Tx.Lane_Base[1].Opacity = 255; + OpenTaiko.Tx.Lane_Base[1].Opacity = this.stBranch[i].nBranchレイヤー透明度; OpenTaiko.Tx.Lane_Base[1].t2D描画(x[i], y[i]); } - break; - case CDTX.ECourse.eMaster: - if (OpenTaiko.Tx.Lane_Base[2] != null) { - OpenTaiko.Tx.Lane_Base[2].Opacity = 255; + } + //普通→達人 + if (this.stBranch[i].nBefore == CDTX.ECourse.eNormal && this.stBranch[i].nAfter == CDTX.ECourse.eMaster) { + if (this.stBranch[i].ct分岐アニメ進行.CurrentValue < 100) { + n透明度 = ((100 - this.stBranch[i].ct分岐アニメ進行.CurrentValue) * 0xff) / 100; + } + if (OpenTaiko.Tx.Lane_Base[0] != null && OpenTaiko.Tx.Lane_Base[2] != null) { + OpenTaiko.Tx.Lane_Base[0].t2D描画(x[i], y[i]); OpenTaiko.Tx.Lane_Base[2].t2D描画(x[i], y[i]); + OpenTaiko.Tx.Lane_Base[2].Opacity = this.stBranch[i].nBranchレイヤー透明度; + } + } + #endregion + #region[ 玄人譜面_レベルアップ ] + if (this.stBranch[i].nBefore == CDTX.ECourse.eExpert && this.stBranch[i].nAfter == CDTX.ECourse.eMaster) { + if (OpenTaiko.Tx.Lane_Base[1] != null && OpenTaiko.Tx.Lane_Base[2] != null) { + OpenTaiko.Tx.Lane_Base[1].t2D描画(x[i], y[i]); + OpenTaiko.Tx.Lane_Base[2].t2D描画(x[i], y[i]); + OpenTaiko.Tx.Lane_Base[2].Opacity = this.stBranch[i].nBranchレイヤー透明度; + } + } + #endregion + #region[ 玄人譜面_レベルダウン ] + if (this.stBranch[i].nBefore == CDTX.ECourse.eExpert && this.stBranch[i].nAfter == CDTX.ECourse.eNormal) { + if (OpenTaiko.Tx.Lane_Base[1] != null && OpenTaiko.Tx.Lane_Base[0] != null) { + OpenTaiko.Tx.Lane_Base[1].t2D描画(x[i], y[i]); + OpenTaiko.Tx.Lane_Base[0].t2D描画(x[i], y[i]); + OpenTaiko.Tx.Lane_Base[0].Opacity = this.stBranch[i].nBranchレイヤー透明度; + } + } + #endregion + #region[ 達人譜面_レベルダウン ] + if (this.stBranch[i].nBefore == CDTX.ECourse.eMaster && this.stBranch[i].nAfter == CDTX.ECourse.eNormal) { + if (OpenTaiko.Tx.Lane_Base[2] != null && OpenTaiko.Tx.Lane_Base[0] != null) { + OpenTaiko.Tx.Lane_Base[2].t2D描画(x[i], y[i]); + OpenTaiko.Tx.Lane_Base[0].t2D描画(x[i], y[i]); + OpenTaiko.Tx.Lane_Base[0].Opacity = this.stBranch[i].nBranchレイヤー透明度; } - break; - } - #endregion - - if (OpenTaiko.ConfigIni.nBranchAnime == 1) { - #region[ AC7~14風の背後レイヤー ] - if (this.stBranch[i].ct分岐アニメ進行.IsTicked) { - int n透明度 = ((100 - this.stBranch[i].ct分岐アニメ進行.CurrentValue) * 0xff) / 100; - - if (this.stBranch[i].ct分岐アニメ進行.IsEnded) { - n透明度 = 255; - this.stBranch[i].ct分岐アニメ進行.Stop(); - } - - #region[ 普通譜面_レベルアップ ] - //普通→玄人 - if (this.stBranch[i].nBefore == CDTX.ECourse.eNormal && this.stBranch[i].nAfter == CDTX.ECourse.eExpert) { - if (OpenTaiko.Tx.Lane_Base[0] != null && OpenTaiko.Tx.Lane_Base[1] != null) { - OpenTaiko.Tx.Lane_Base[0].t2D描画(x[i], y[i]); - OpenTaiko.Tx.Lane_Base[1].Opacity = this.stBranch[i].nBranchレイヤー透明度; - OpenTaiko.Tx.Lane_Base[1].t2D描画(x[i], y[i]); - } - } - //普通→達人 - if (this.stBranch[i].nBefore == CDTX.ECourse.eNormal && this.stBranch[i].nAfter == CDTX.ECourse.eMaster) { - if (this.stBranch[i].ct分岐アニメ進行.CurrentValue < 100) { - n透明度 = ((100 - this.stBranch[i].ct分岐アニメ進行.CurrentValue) * 0xff) / 100; - } - if (OpenTaiko.Tx.Lane_Base[0] != null && OpenTaiko.Tx.Lane_Base[2] != null) { - OpenTaiko.Tx.Lane_Base[0].t2D描画(x[i], y[i]); - OpenTaiko.Tx.Lane_Base[2].t2D描画(x[i], y[i]); - OpenTaiko.Tx.Lane_Base[2].Opacity = this.stBranch[i].nBranchレイヤー透明度; - } - } - #endregion - #region[ 玄人譜面_レベルアップ ] - if (this.stBranch[i].nBefore == CDTX.ECourse.eExpert && this.stBranch[i].nAfter == CDTX.ECourse.eMaster) { - if (OpenTaiko.Tx.Lane_Base[1] != null && OpenTaiko.Tx.Lane_Base[2] != null) { - OpenTaiko.Tx.Lane_Base[1].t2D描画(x[i], y[i]); - OpenTaiko.Tx.Lane_Base[2].t2D描画(x[i], y[i]); - OpenTaiko.Tx.Lane_Base[2].Opacity = this.stBranch[i].nBranchレイヤー透明度; - } - } - #endregion - #region[ 玄人譜面_レベルダウン ] - if (this.stBranch[i].nBefore == CDTX.ECourse.eExpert && this.stBranch[i].nAfter == CDTX.ECourse.eNormal) { - if (OpenTaiko.Tx.Lane_Base[1] != null && OpenTaiko.Tx.Lane_Base[0] != null) { - OpenTaiko.Tx.Lane_Base[1].t2D描画(x[i], y[i]); - OpenTaiko.Tx.Lane_Base[0].t2D描画(x[i], y[i]); - OpenTaiko.Tx.Lane_Base[0].Opacity = this.stBranch[i].nBranchレイヤー透明度; - } - } - #endregion - #region[ 達人譜面_レベルダウン ] - if (this.stBranch[i].nBefore == CDTX.ECourse.eMaster && this.stBranch[i].nAfter == CDTX.ECourse.eNormal) { - if (OpenTaiko.Tx.Lane_Base[2] != null && OpenTaiko.Tx.Lane_Base[0] != null) { - OpenTaiko.Tx.Lane_Base[2].t2D描画(x[i], y[i]); - OpenTaiko.Tx.Lane_Base[0].t2D描画(x[i], y[i]); - OpenTaiko.Tx.Lane_Base[0].Opacity = this.stBranch[i].nBranchレイヤー透明度; - } - } - #endregion } #endregion - } else if (OpenTaiko.ConfigIni.nBranchAnime == 0) { - OpenTaiko.stage演奏ドラム画面.actLane.Draw(); } + #endregion + } else if (OpenTaiko.ConfigIni.nBranchAnime == 0) { + OpenTaiko.stage演奏ドラム画面.actLane.Draw(); + } + } + } + #endregion + + for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { + #region[ ゴーゴータイムレーン背景レイヤー ] + if (OpenTaiko.Tx.Lane_Background_GoGo != null && OpenTaiko.stage演奏ドラム画面.bIsGOGOTIME[i]) { + if (!this.ctゴーゴー.IsStoped) { + this.ctゴーゴー.Tick(); + } + + if (this.ctゴーゴー.CurrentValue <= 4) { + OpenTaiko.Tx.Lane_Background_GoGo.vcScaleRatio.Y = 0.2f; + OpenTaiko.Tx.Lane_Background_GoGo.t2D描画(x[i], y[i] + 54); + } else if (this.ctゴーゴー.CurrentValue <= 5) { + OpenTaiko.Tx.Lane_Background_GoGo.vcScaleRatio.Y = 0.4f; + OpenTaiko.Tx.Lane_Background_GoGo.t2D描画(x[i], y[i] + 40); + } else if (this.ctゴーゴー.CurrentValue <= 6) { + OpenTaiko.Tx.Lane_Background_GoGo.vcScaleRatio.Y = 0.6f; + OpenTaiko.Tx.Lane_Background_GoGo.t2D描画(x[i], y[i] + 26); + } else if (this.ctゴーゴー.CurrentValue <= 8) { + OpenTaiko.Tx.Lane_Background_GoGo.vcScaleRatio.Y = 0.8f; + OpenTaiko.Tx.Lane_Background_GoGo.t2D描画(x[i], y[i] + 13); + } else if (this.ctゴーゴー.CurrentValue >= 9) { + OpenTaiko.Tx.Lane_Background_GoGo.vcScaleRatio.Y = 1.0f; + OpenTaiko.Tx.Lane_Background_GoGo.t2D描画(x[i], y[i]); } } #endregion + } - for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { - #region[ ゴーゴータイムレーン背景レイヤー ] - if (OpenTaiko.Tx.Lane_Background_GoGo != null && OpenTaiko.stage演奏ドラム画面.bIsGOGOTIME[i]) { - if (!this.ctゴーゴー.IsStoped) { - this.ctゴーゴー.Tick(); - } + for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { + if (OpenTaiko.stage演奏ドラム画面.bUseBranch[i] == true) { + #region NullCheck - if (this.ctゴーゴー.CurrentValue <= 4) { - OpenTaiko.Tx.Lane_Background_GoGo.vcScaleRatio.Y = 0.2f; - OpenTaiko.Tx.Lane_Background_GoGo.t2D描画(x[i], y[i] + 54); - } else if (this.ctゴーゴー.CurrentValue <= 5) { - OpenTaiko.Tx.Lane_Background_GoGo.vcScaleRatio.Y = 0.4f; - OpenTaiko.Tx.Lane_Background_GoGo.t2D描画(x[i], y[i] + 40); - } else if (this.ctゴーゴー.CurrentValue <= 6) { - OpenTaiko.Tx.Lane_Background_GoGo.vcScaleRatio.Y = 0.6f; - OpenTaiko.Tx.Lane_Background_GoGo.t2D描画(x[i], y[i] + 26); - } else if (this.ctゴーゴー.CurrentValue <= 8) { - OpenTaiko.Tx.Lane_Background_GoGo.vcScaleRatio.Y = 0.8f; - OpenTaiko.Tx.Lane_Background_GoGo.t2D描画(x[i], y[i] + 13); - } else if (this.ctゴーゴー.CurrentValue >= 9) { - OpenTaiko.Tx.Lane_Background_GoGo.vcScaleRatio.Y = 1.0f; - OpenTaiko.Tx.Lane_Background_GoGo.t2D描画(x[i], y[i]); + bool _laneNull = false; + + for (int j = 0; j < OpenTaiko.Tx.Lane_Text.Length; j++) { + if (OpenTaiko.Tx.Lane_Text[j] == null) { + _laneNull = true; + break; } } + #endregion - } - for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { - if (OpenTaiko.stage演奏ドラム画面.bUseBranch[i] == true) { - #region NullCheck - - bool _laneNull = false; - - for (int j = 0; j < OpenTaiko.Tx.Lane_Text.Length; j++) { - if (OpenTaiko.Tx.Lane_Text[j] == null) { - _laneNull = true; + if (OpenTaiko.ConfigIni.SimpleMode) { + switch (OpenTaiko.stage演奏ドラム画面.nレーン用表示コース[i]) { + case CDTX.ECourse.eNormal: + OpenTaiko.Tx.Lane_Text[0].Opacity = 255; + OpenTaiko.Tx.Lane_Text[0].t2D描画(x[i], y[i]); + break; + case CDTX.ECourse.eExpert: + OpenTaiko.Tx.Lane_Text[1].Opacity = 255; + OpenTaiko.Tx.Lane_Text[1].t2D描画(x[i], y[i]); + break; + case CDTX.ECourse.eMaster: + OpenTaiko.Tx.Lane_Text[2].Opacity = 255; + OpenTaiko.Tx.Lane_Text[2].t2D描画(x[i], y[i]); break; - } } - - #endregion - - if (OpenTaiko.ConfigIni.SimpleMode) { + } else if (OpenTaiko.ConfigIni.nBranchAnime == 0 && !_laneNull) { + if (!this.stBranch[i].ct分岐アニメ進行.IsTicked) { switch (OpenTaiko.stage演奏ドラム画面.nレーン用表示コース[i]) { case CDTX.ECourse.eNormal: OpenTaiko.Tx.Lane_Text[0].Opacity = 255; @@ -270,608 +287,591 @@ namespace OpenTaiko { OpenTaiko.Tx.Lane_Text[2].t2D描画(x[i], y[i]); break; } - } else if (OpenTaiko.ConfigIni.nBranchAnime == 0 && !_laneNull) { - if (!this.stBranch[i].ct分岐アニメ進行.IsTicked) { - switch (OpenTaiko.stage演奏ドラム画面.nレーン用表示コース[i]) { - case CDTX.ECourse.eNormal: - OpenTaiko.Tx.Lane_Text[0].Opacity = 255; - OpenTaiko.Tx.Lane_Text[0].t2D描画(x[i], y[i]); - break; - case CDTX.ECourse.eExpert: - OpenTaiko.Tx.Lane_Text[1].Opacity = 255; - OpenTaiko.Tx.Lane_Text[1].t2D描画(x[i], y[i]); - break; - case CDTX.ECourse.eMaster: - OpenTaiko.Tx.Lane_Text[2].Opacity = 255; - OpenTaiko.Tx.Lane_Text[2].t2D描画(x[i], y[i]); - break; + } + if (this.stBranch[i].ct分岐アニメ進行.IsTicked) { + #region[ 普通譜面_レベルアップ ] + //普通→玄人 + if (this.stBranch[i].nBefore == 0 && this.stBranch[i].nAfter == CDTX.ECourse.eExpert) { + OpenTaiko.Tx.Lane_Text[0].Opacity = 255; + OpenTaiko.Tx.Lane_Text[1].Opacity = 255; + OpenTaiko.Tx.Lane_Text[2].Opacity = 255; + + OpenTaiko.Tx.Lane_Text[0].Opacity = this.stBranch[i].ct分岐アニメ進行.CurrentValue > 100 ? 0 : (255 - ((this.stBranch[i].ct分岐アニメ進行.CurrentValue * 0xff) / 60)); + //CDTXMania.Tx.Lane_Text[1].n透明度 = this.ct分岐アニメ進行.n現在の値 > 100 ? 255 : ( ( ( this.ct分岐アニメ進行.n現在の値 * 0xff ) / 60 ) ); + if (this.stBranch[i].ct分岐アニメ進行.CurrentValue < 60) { + this.stBranch[i].nY = this.stBranch[i].ct分岐アニメ進行.CurrentValue / 2; + OpenTaiko.Tx.Lane_Text[0].t2D描画(x[i], y[i] + this.stBranch[i].nY); + OpenTaiko.Tx.Lane_Text[1].Opacity = 255; + OpenTaiko.Tx.Lane_Text[1].t2D描画(x[i], (y[i] - 30) + this.stBranch[i].nY); + } else { + OpenTaiko.Tx.Lane_Text[1].Opacity = 255; + OpenTaiko.Tx.Lane_Text[1].t2D描画(x[i], y[i]); + } + + } + + //普通→達人 + if (this.stBranch[i].nBefore == 0 && this.stBranch[i].nAfter == CDTX.ECourse.eMaster) { + OpenTaiko.Tx.Lane_Text[0].Opacity = 255; + OpenTaiko.Tx.Lane_Text[1].Opacity = 255; + OpenTaiko.Tx.Lane_Text[2].Opacity = 255; + if (this.stBranch[i].ct分岐アニメ進行.CurrentValue < 60) { + this.stBranch[i].nY = this.stBranch[i].ct分岐アニメ進行.CurrentValue / 2; + OpenTaiko.Tx.Lane_Text[0].t2D描画(x[i], (y[i] - 12) + this.stBranch[i].nY); + OpenTaiko.Tx.Lane_Text[0].Opacity = this.stBranch[i].ct分岐アニメ進行.CurrentValue > 100 ? 0 : (255 - ((this.stBranch[i].ct分岐アニメ進行.CurrentValue * 0xff) / 100)); + OpenTaiko.Tx.Lane_Text[1].t2D描画(x[i], (y[i] - 20) + this.stBranch[i].nY); + } + //if( this.stBranch[ i ].ct分岐アニメ進行.n現在の値 >= 5 && this.stBranch[ i ].ct分岐アニメ進行.n現在の値 < 60 ) + //{ + // this.stBranch[ i ].nY = this.stBranch[ i ].ct分岐アニメ進行.n現在の値 / 2; + // this.tx普通譜面[ 1 ].t2D描画(CDTXMania.app.Device, 333, CDTXMania.Skin.nScrollFieldY[ i ] + this.stBranch[ i ].nY); + // this.tx普通譜面[ 1 ].n透明度 = this.stBranch[ i ].ct分岐アニメ進行.n現在の値 > 100 ? 0 : ( 255 - ( ( this.stBranch[ i ].ct分岐アニメ進行.n現在の値 * 0xff) / 100)); + // this.tx玄人譜面[ 1 ].t2D描画(CDTXMania.app.Device, 333, ( CDTXMania.Skin.nScrollFieldY[ i ] - 10 ) + this.stBranch[ i ].nY); + //} + else if (this.stBranch[i].ct分岐アニメ進行.CurrentValue >= 60 && this.stBranch[i].ct分岐アニメ進行.CurrentValue < 150) { + this.stBranch[i].nY = 21; + OpenTaiko.Tx.Lane_Text[1].t2D描画(x[i], y[i]); + OpenTaiko.Tx.Lane_Text[1].Opacity = 255; + OpenTaiko.Tx.Lane_Text[2].Opacity = 255; + } else if (this.stBranch[i].ct分岐アニメ進行.CurrentValue >= 150 && this.stBranch[i].ct分岐アニメ進行.CurrentValue < 210) { + this.stBranch[i].nY = ((this.stBranch[i].ct分岐アニメ進行.CurrentValue - 150) / 2); + OpenTaiko.Tx.Lane_Text[1].t2D描画(x[i], y[i] + this.stBranch[i].nY); + OpenTaiko.Tx.Lane_Text[1].Opacity = this.stBranch[i].ct分岐アニメ進行.CurrentValue > 100 ? 0 : (255 - ((this.stBranch[i].ct分岐アニメ進行.CurrentValue * 0xff) / 100)); + OpenTaiko.Tx.Lane_Text[2].t2D描画(x[i], (y[i] - 20) + this.stBranch[i].nY); + } else { + OpenTaiko.Tx.Lane_Text[2].Opacity = 255; + OpenTaiko.Tx.Lane_Text[2].t2D描画(x[i], y[i]); } } - if (this.stBranch[i].ct分岐アニメ進行.IsTicked) { - #region[ 普通譜面_レベルアップ ] - //普通→玄人 - if (this.stBranch[i].nBefore == 0 && this.stBranch[i].nAfter == CDTX.ECourse.eExpert) { - OpenTaiko.Tx.Lane_Text[0].Opacity = 255; - OpenTaiko.Tx.Lane_Text[1].Opacity = 255; - OpenTaiko.Tx.Lane_Text[2].Opacity = 255; - - OpenTaiko.Tx.Lane_Text[0].Opacity = this.stBranch[i].ct分岐アニメ進行.CurrentValue > 100 ? 0 : (255 - ((this.stBranch[i].ct分岐アニメ進行.CurrentValue * 0xff) / 60)); - //CDTXMania.Tx.Lane_Text[1].n透明度 = this.ct分岐アニメ進行.n現在の値 > 100 ? 255 : ( ( ( this.ct分岐アニメ進行.n現在の値 * 0xff ) / 60 ) ); - if (this.stBranch[i].ct分岐アニメ進行.CurrentValue < 60) { - this.stBranch[i].nY = this.stBranch[i].ct分岐アニメ進行.CurrentValue / 2; - OpenTaiko.Tx.Lane_Text[0].t2D描画(x[i], y[i] + this.stBranch[i].nY); - OpenTaiko.Tx.Lane_Text[1].Opacity = 255; - OpenTaiko.Tx.Lane_Text[1].t2D描画(x[i], (y[i] - 30) + this.stBranch[i].nY); - } else { - OpenTaiko.Tx.Lane_Text[1].Opacity = 255; - OpenTaiko.Tx.Lane_Text[1].t2D描画(x[i], y[i]); - } + #endregion + #region[ 玄人譜面_レベルアップ ] + //玄人→達人 + if (this.stBranch[i].nBefore == CDTX.ECourse.eExpert && this.stBranch[i].nAfter == CDTX.ECourse.eMaster) { + OpenTaiko.Tx.Lane_Text[0].Opacity = 255; + OpenTaiko.Tx.Lane_Text[1].Opacity = 255; + OpenTaiko.Tx.Lane_Text[2].Opacity = 255; + OpenTaiko.Tx.Lane_Text[1].Opacity = this.stBranch[i].ct分岐アニメ進行.CurrentValue > 100 ? 0 : (255 - ((this.stBranch[i].ct分岐アニメ進行.CurrentValue * 0xff) / 60)); + if (this.stBranch[i].ct分岐アニメ進行.CurrentValue < 60) { + this.stBranch[i].nY = this.stBranch[i].ct分岐アニメ進行.CurrentValue / 2; + OpenTaiko.Tx.Lane_Text[1].t2D描画(x[i], y[i] + this.stBranch[i].nY); + OpenTaiko.Tx.Lane_Text[2].t2D描画(x[i], (y[i] - 20) + this.stBranch[i].nY); + } else { + OpenTaiko.Tx.Lane_Text[2].t2D描画(x[i], y[i]); } + } + #endregion + #region[ 玄人譜面_レベルダウン ] + if (this.stBranch[i].nBefore == CDTX.ECourse.eExpert && this.stBranch[i].nAfter == CDTX.ECourse.eNormal) { + OpenTaiko.Tx.Lane_Text[0].Opacity = 255; + OpenTaiko.Tx.Lane_Text[1].Opacity = 255; + OpenTaiko.Tx.Lane_Text[2].Opacity = 255; - //普通→達人 - if (this.stBranch[i].nBefore == 0 && this.stBranch[i].nAfter == CDTX.ECourse.eMaster) { - OpenTaiko.Tx.Lane_Text[0].Opacity = 255; - OpenTaiko.Tx.Lane_Text[1].Opacity = 255; - OpenTaiko.Tx.Lane_Text[2].Opacity = 255; - if (this.stBranch[i].ct分岐アニメ進行.CurrentValue < 60) { - this.stBranch[i].nY = this.stBranch[i].ct分岐アニメ進行.CurrentValue / 2; - OpenTaiko.Tx.Lane_Text[0].t2D描画(x[i], (y[i] - 12) + this.stBranch[i].nY); - OpenTaiko.Tx.Lane_Text[0].Opacity = this.stBranch[i].ct分岐アニメ進行.CurrentValue > 100 ? 0 : (255 - ((this.stBranch[i].ct分岐アニメ進行.CurrentValue * 0xff) / 100)); - OpenTaiko.Tx.Lane_Text[1].t2D描画(x[i], (y[i] - 20) + this.stBranch[i].nY); - } - //if( this.stBranch[ i ].ct分岐アニメ進行.n現在の値 >= 5 && this.stBranch[ i ].ct分岐アニメ進行.n現在の値 < 60 ) - //{ - // this.stBranch[ i ].nY = this.stBranch[ i ].ct分岐アニメ進行.n現在の値 / 2; - // this.tx普通譜面[ 1 ].t2D描画(CDTXMania.app.Device, 333, CDTXMania.Skin.nScrollFieldY[ i ] + this.stBranch[ i ].nY); - // this.tx普通譜面[ 1 ].n透明度 = this.stBranch[ i ].ct分岐アニメ進行.n現在の値 > 100 ? 0 : ( 255 - ( ( this.stBranch[ i ].ct分岐アニメ進行.n現在の値 * 0xff) / 100)); - // this.tx玄人譜面[ 1 ].t2D描画(CDTXMania.app.Device, 333, ( CDTXMania.Skin.nScrollFieldY[ i ] - 10 ) + this.stBranch[ i ].nY); - //} - else if (this.stBranch[i].ct分岐アニメ進行.CurrentValue >= 60 && this.stBranch[i].ct分岐アニメ進行.CurrentValue < 150) { - this.stBranch[i].nY = 21; - OpenTaiko.Tx.Lane_Text[1].t2D描画(x[i], y[i]); - OpenTaiko.Tx.Lane_Text[1].Opacity = 255; - OpenTaiko.Tx.Lane_Text[2].Opacity = 255; - } else if (this.stBranch[i].ct分岐アニメ進行.CurrentValue >= 150 && this.stBranch[i].ct分岐アニメ進行.CurrentValue < 210) { - this.stBranch[i].nY = ((this.stBranch[i].ct分岐アニメ進行.CurrentValue - 150) / 2); - OpenTaiko.Tx.Lane_Text[1].t2D描画(x[i], y[i] + this.stBranch[i].nY); - OpenTaiko.Tx.Lane_Text[1].Opacity = this.stBranch[i].ct分岐アニメ進行.CurrentValue > 100 ? 0 : (255 - ((this.stBranch[i].ct分岐アニメ進行.CurrentValue * 0xff) / 100)); - OpenTaiko.Tx.Lane_Text[2].t2D描画(x[i], (y[i] - 20) + this.stBranch[i].nY); - } else { - OpenTaiko.Tx.Lane_Text[2].Opacity = 255; - OpenTaiko.Tx.Lane_Text[2].t2D描画(x[i], y[i]); - } + OpenTaiko.Tx.Lane_Text[1].Opacity = this.stBranch[i].ct分岐アニメ進行.CurrentValue > 100 ? 0 : (255 - ((this.stBranch[i].ct分岐アニメ進行.CurrentValue * 0xff) / 60)); + if (this.stBranch[i].ct分岐アニメ進行.CurrentValue < 60) { + this.stBranch[i].nY = this.stBranch[i].ct分岐アニメ進行.CurrentValue / 2; + OpenTaiko.Tx.Lane_Text[1].t2D描画(x[i], y[i] - this.stBranch[i].nY); + OpenTaiko.Tx.Lane_Text[0].t2D描画(x[i], (y[i] + 30) - this.stBranch[i].nY); + } else { + OpenTaiko.Tx.Lane_Text[0].t2D描画(x[i], y[i]); } - #endregion - #region[ 玄人譜面_レベルアップ ] - //玄人→達人 - if (this.stBranch[i].nBefore == CDTX.ECourse.eExpert && this.stBranch[i].nAfter == CDTX.ECourse.eMaster) { - OpenTaiko.Tx.Lane_Text[0].Opacity = 255; - OpenTaiko.Tx.Lane_Text[1].Opacity = 255; - OpenTaiko.Tx.Lane_Text[2].Opacity = 255; - - OpenTaiko.Tx.Lane_Text[1].Opacity = this.stBranch[i].ct分岐アニメ進行.CurrentValue > 100 ? 0 : (255 - ((this.stBranch[i].ct分岐アニメ進行.CurrentValue * 0xff) / 60)); - if (this.stBranch[i].ct分岐アニメ進行.CurrentValue < 60) { - this.stBranch[i].nY = this.stBranch[i].ct分岐アニメ進行.CurrentValue / 2; - OpenTaiko.Tx.Lane_Text[1].t2D描画(x[i], y[i] + this.stBranch[i].nY); - OpenTaiko.Tx.Lane_Text[2].t2D描画(x[i], (y[i] - 20) + this.stBranch[i].nY); - } else { - OpenTaiko.Tx.Lane_Text[2].t2D描画(x[i], y[i]); - } - } - #endregion - #region[ 玄人譜面_レベルダウン ] - if (this.stBranch[i].nBefore == CDTX.ECourse.eExpert && this.stBranch[i].nAfter == CDTX.ECourse.eNormal) { - OpenTaiko.Tx.Lane_Text[0].Opacity = 255; - OpenTaiko.Tx.Lane_Text[1].Opacity = 255; - OpenTaiko.Tx.Lane_Text[2].Opacity = 255; - - OpenTaiko.Tx.Lane_Text[1].Opacity = this.stBranch[i].ct分岐アニメ進行.CurrentValue > 100 ? 0 : (255 - ((this.stBranch[i].ct分岐アニメ進行.CurrentValue * 0xff) / 60)); - if (this.stBranch[i].ct分岐アニメ進行.CurrentValue < 60) { - this.stBranch[i].nY = this.stBranch[i].ct分岐アニメ進行.CurrentValue / 2; - OpenTaiko.Tx.Lane_Text[1].t2D描画(x[i], y[i] - this.stBranch[i].nY); - OpenTaiko.Tx.Lane_Text[0].t2D描画(x[i], (y[i] + 30) - this.stBranch[i].nY); - } else { - OpenTaiko.Tx.Lane_Text[0].t2D描画(x[i], y[i]); - } - } - #endregion - #region[ 達人譜面_レベルダウン ] - if (this.stBranch[i].nBefore == CDTX.ECourse.eMaster && this.stBranch[i].nAfter == CDTX.ECourse.eNormal) { - OpenTaiko.Tx.Lane_Text[0].Opacity = 255; - OpenTaiko.Tx.Lane_Text[1].Opacity = 255; - OpenTaiko.Tx.Lane_Text[2].Opacity = 255; - - if (this.stBranch[i].ct分岐アニメ進行.CurrentValue < 60) { - this.stBranch[i].nY = this.stBranch[i].ct分岐アニメ進行.CurrentValue / 2; - OpenTaiko.Tx.Lane_Text[2].Opacity = this.stBranch[i].ct分岐アニメ進行.CurrentValue > 100 ? 0 : (255 - ((this.stBranch[i].ct分岐アニメ進行.CurrentValue * 0xff) / 60)); - OpenTaiko.Tx.Lane_Text[2].t2D描画(x[i], y[i] - this.stBranch[i].nY); - OpenTaiko.Tx.Lane_Text[1].t2D描画(x[i], (y[i] + 30) - this.stBranch[i].nY); - } else if (this.stBranch[i].ct分岐アニメ進行.CurrentValue >= 60 && this.stBranch[i].ct分岐アニメ進行.CurrentValue < 150) { - this.stBranch[i].nY = 21; - OpenTaiko.Tx.Lane_Text[1].t2D描画(x[i], y[i]); - OpenTaiko.Tx.Lane_Text[1].Opacity = 255; - OpenTaiko.Tx.Lane_Text[2].Opacity = 255; - } else if (this.stBranch[i].ct分岐アニメ進行.CurrentValue >= 150 && this.stBranch[i].ct分岐アニメ進行.CurrentValue < 210) { - this.stBranch[i].nY = ((this.stBranch[i].ct分岐アニメ進行.CurrentValue - 150) / 2); - OpenTaiko.Tx.Lane_Text[1].t2D描画(x[i], y[i] - this.stBranch[i].nY); - OpenTaiko.Tx.Lane_Text[1].Opacity = this.stBranch[i].ct分岐アニメ進行.CurrentValue > 100 ? 0 : (255 - ((this.stBranch[i].ct分岐アニメ進行.CurrentValue * 0xff) / 100)); - OpenTaiko.Tx.Lane_Text[0].t2D描画(x[i], (y[i] + 30) - this.stBranch[i].nY); - } else if (this.stBranch[i].ct分岐アニメ進行.CurrentValue >= 210) { - OpenTaiko.Tx.Lane_Text[0].Opacity = 255; - OpenTaiko.Tx.Lane_Text[0].t2D描画(x[i], y[i]); - } - } - if (this.stBranch[i].nBefore == CDTX.ECourse.eMaster && this.stBranch[i].nAfter == CDTX.ECourse.eExpert) { - OpenTaiko.Tx.Lane_Text[0].Opacity = 255; - OpenTaiko.Tx.Lane_Text[1].Opacity = 255; - OpenTaiko.Tx.Lane_Text[2].Opacity = 255; + } + #endregion + #region[ 達人譜面_レベルダウン ] + if (this.stBranch[i].nBefore == CDTX.ECourse.eMaster && this.stBranch[i].nAfter == CDTX.ECourse.eNormal) { + OpenTaiko.Tx.Lane_Text[0].Opacity = 255; + OpenTaiko.Tx.Lane_Text[1].Opacity = 255; + OpenTaiko.Tx.Lane_Text[2].Opacity = 255; + if (this.stBranch[i].ct分岐アニメ進行.CurrentValue < 60) { + this.stBranch[i].nY = this.stBranch[i].ct分岐アニメ進行.CurrentValue / 2; OpenTaiko.Tx.Lane_Text[2].Opacity = this.stBranch[i].ct分岐アニメ進行.CurrentValue > 100 ? 0 : (255 - ((this.stBranch[i].ct分岐アニメ進行.CurrentValue * 0xff) / 60)); - if (this.stBranch[i].ct分岐アニメ進行.CurrentValue < 60) { - this.stBranch[i].nY = this.stBranch[i].ct分岐アニメ進行.CurrentValue / 2; - OpenTaiko.Tx.Lane_Text[2].t2D描画(x[i], y[i] - this.stBranch[i].nY); - OpenTaiko.Tx.Lane_Text[1].t2D描画(x[i], (y[i] + 30) - this.stBranch[i].nY); - } else { - OpenTaiko.Tx.Lane_Text[1].t2D描画(x[i], y[i]); - } - - } - #endregion - } - } else if (!_laneNull) { - if (this.stBranch[i].nY座標 == 21) { - this.stBranch[i].nY座標 = 0; - } - - if (this.stBranch[i].nY座標 == 0) { - switch (OpenTaiko.stage演奏ドラム画面.nレーン用表示コース[i]) { - case CDTX.ECourse.eNormal: - OpenTaiko.Tx.Lane_Text[0].Opacity = 255; - OpenTaiko.Tx.Lane_Text[0].t2D描画(x[i], y[i]); - break; - case CDTX.ECourse.eExpert: - OpenTaiko.Tx.Lane_Text[1].Opacity = 255; - OpenTaiko.Tx.Lane_Text[1].t2D描画(x[i], y[i]); - break; - case CDTX.ECourse.eMaster: - OpenTaiko.Tx.Lane_Text[2].Opacity = 255; - OpenTaiko.Tx.Lane_Text[2].t2D描画(x[i], y[i]); - break; + OpenTaiko.Tx.Lane_Text[2].t2D描画(x[i], y[i] - this.stBranch[i].nY); + OpenTaiko.Tx.Lane_Text[1].t2D描画(x[i], (y[i] + 30) - this.stBranch[i].nY); + } else if (this.stBranch[i].ct分岐アニメ進行.CurrentValue >= 60 && this.stBranch[i].ct分岐アニメ進行.CurrentValue < 150) { + this.stBranch[i].nY = 21; + OpenTaiko.Tx.Lane_Text[1].t2D描画(x[i], y[i]); + OpenTaiko.Tx.Lane_Text[1].Opacity = 255; + OpenTaiko.Tx.Lane_Text[2].Opacity = 255; + } else if (this.stBranch[i].ct分岐アニメ進行.CurrentValue >= 150 && this.stBranch[i].ct分岐アニメ進行.CurrentValue < 210) { + this.stBranch[i].nY = ((this.stBranch[i].ct分岐アニメ進行.CurrentValue - 150) / 2); + OpenTaiko.Tx.Lane_Text[1].t2D描画(x[i], y[i] - this.stBranch[i].nY); + OpenTaiko.Tx.Lane_Text[1].Opacity = this.stBranch[i].ct分岐アニメ進行.CurrentValue > 100 ? 0 : (255 - ((this.stBranch[i].ct分岐アニメ進行.CurrentValue * 0xff) / 100)); + OpenTaiko.Tx.Lane_Text[0].t2D描画(x[i], (y[i] + 30) - this.stBranch[i].nY); + } else if (this.stBranch[i].ct分岐アニメ進行.CurrentValue >= 210) { + OpenTaiko.Tx.Lane_Text[0].Opacity = 255; + OpenTaiko.Tx.Lane_Text[0].t2D描画(x[i], y[i]); } } + if (this.stBranch[i].nBefore == CDTX.ECourse.eMaster && this.stBranch[i].nAfter == CDTX.ECourse.eExpert) { + OpenTaiko.Tx.Lane_Text[0].Opacity = 255; + OpenTaiko.Tx.Lane_Text[1].Opacity = 255; + OpenTaiko.Tx.Lane_Text[2].Opacity = 255; - if (this.stBranch[i].nY座標 != 0) { - #region[ 普通譜面_レベルアップ ] - //普通→玄人 - if (this.stBranch[i].nBefore == CDTX.ECourse.eNormal && this.stBranch[i].nAfter == CDTX.ECourse.eExpert) { - OpenTaiko.Tx.Lane_Text[0].t2D描画(x[i], y[i] - this.stBranch[i].nY座標); - OpenTaiko.Tx.Lane_Text[1].t2D描画(x[i], (y[i] + 20) - this.stBranch[i].nY座標); - OpenTaiko.Tx.Lane_Text[0].Opacity = this.stBranch[i].nBranchレイヤー透明度; + OpenTaiko.Tx.Lane_Text[2].Opacity = this.stBranch[i].ct分岐アニメ進行.CurrentValue > 100 ? 0 : (255 - ((this.stBranch[i].ct分岐アニメ進行.CurrentValue * 0xff) / 60)); + if (this.stBranch[i].ct分岐アニメ進行.CurrentValue < 60) { + this.stBranch[i].nY = this.stBranch[i].ct分岐アニメ進行.CurrentValue / 2; + OpenTaiko.Tx.Lane_Text[2].t2D描画(x[i], y[i] - this.stBranch[i].nY); + OpenTaiko.Tx.Lane_Text[1].t2D描画(x[i], (y[i] + 30) - this.stBranch[i].nY); + } else { + OpenTaiko.Tx.Lane_Text[1].t2D描画(x[i], y[i]); } - //普通→達人 - if (this.stBranch[i].nBefore == CDTX.ECourse.eNormal && this.stBranch[i].nAfter == CDTX.ECourse.eMaster) { - OpenTaiko.Tx.Lane_Text[0].t2D描画(x[i], y[i] - this.stBranch[i].nY座標); - OpenTaiko.Tx.Lane_Text[2].t2D描画(x[i], (y[i] + 20) - this.stBranch[i].nY座標); - OpenTaiko.Tx.Lane_Text[0].Opacity = this.stBranch[i].nBranchレイヤー透明度; - } - #endregion - #region[ 玄人譜面_レベルアップ ] - //玄人→達人 - if (this.stBranch[i].nBefore == CDTX.ECourse.eExpert && this.stBranch[i].nAfter == CDTX.ECourse.eMaster) { - OpenTaiko.Tx.Lane_Text[1].t2D描画(x[i], y[i] - this.stBranch[i].nY座標); - OpenTaiko.Tx.Lane_Text[2].t2D描画(x[i], (y[i] + 20) - this.stBranch[i].nY座標); - OpenTaiko.Tx.Lane_Text[1].Opacity = this.stBranch[i].nBranchレイヤー透明度; - } - #endregion - #region[ 玄人譜面_レベルダウン ] - if (this.stBranch[i].nBefore == CDTX.ECourse.eExpert && this.stBranch[i].nAfter == CDTX.ECourse.eNormal) { - OpenTaiko.Tx.Lane_Text[1].t2D描画(x[i], y[i] + this.stBranch[i].nY座標); - OpenTaiko.Tx.Lane_Text[0].t2D描画(x[i], (y[i] - 24) + this.stBranch[i].nY座標); - OpenTaiko.Tx.Lane_Text[1].Opacity = this.stBranch[i].nBranchレイヤー透明度; - } - #endregion - #region[ 達人譜面_レベルダウン ] - if (this.stBranch[i].nBefore == CDTX.ECourse.eMaster && this.stBranch[i].nAfter == CDTX.ECourse.eNormal) { - OpenTaiko.Tx.Lane_Text[2].t2D描画(x[i], y[i] + this.stBranch[i].nY座標); - OpenTaiko.Tx.Lane_Text[0].t2D描画(x[i], (y[i] - 24) + this.stBranch[i].nY座標); - OpenTaiko.Tx.Lane_Text[2].Opacity = this.stBranch[i].nBranchレイヤー透明度; - } - if (this.stBranch[i].nBefore == CDTX.ECourse.eMaster && this.stBranch[i].nAfter == CDTX.ECourse.eExpert) { - OpenTaiko.Tx.Lane_Text[2].t2D描画(x[i], y[i] + this.stBranch[i].nY座標); - OpenTaiko.Tx.Lane_Text[1].t2D描画(x[i], (y[i] - 24) + this.stBranch[i].nY座標); - OpenTaiko.Tx.Lane_Text[2].Opacity = this.stBranch[i].nBranchレイヤー透明度; - } - #endregion + + } + #endregion + } + } else if (!_laneNull) { + if (this.stBranch[i].nY座標 == 21) { + this.stBranch[i].nY座標 = 0; + } + + if (this.stBranch[i].nY座標 == 0) { + switch (OpenTaiko.stage演奏ドラム画面.nレーン用表示コース[i]) { + case CDTX.ECourse.eNormal: + OpenTaiko.Tx.Lane_Text[0].Opacity = 255; + OpenTaiko.Tx.Lane_Text[0].t2D描画(x[i], y[i]); + break; + case CDTX.ECourse.eExpert: + OpenTaiko.Tx.Lane_Text[1].Opacity = 255; + OpenTaiko.Tx.Lane_Text[1].t2D描画(x[i], y[i]); + break; + case CDTX.ECourse.eMaster: + OpenTaiko.Tx.Lane_Text[2].Opacity = 255; + OpenTaiko.Tx.Lane_Text[2].t2D描画(x[i], y[i]); + break; } } + if (this.stBranch[i].nY座標 != 0) { + #region[ 普通譜面_レベルアップ ] + //普通→玄人 + if (this.stBranch[i].nBefore == CDTX.ECourse.eNormal && this.stBranch[i].nAfter == CDTX.ECourse.eExpert) { + OpenTaiko.Tx.Lane_Text[0].t2D描画(x[i], y[i] - this.stBranch[i].nY座標); + OpenTaiko.Tx.Lane_Text[1].t2D描画(x[i], (y[i] + 20) - this.stBranch[i].nY座標); + OpenTaiko.Tx.Lane_Text[0].Opacity = this.stBranch[i].nBranchレイヤー透明度; + } + //普通→達人 + if (this.stBranch[i].nBefore == CDTX.ECourse.eNormal && this.stBranch[i].nAfter == CDTX.ECourse.eMaster) { + OpenTaiko.Tx.Lane_Text[0].t2D描画(x[i], y[i] - this.stBranch[i].nY座標); + OpenTaiko.Tx.Lane_Text[2].t2D描画(x[i], (y[i] + 20) - this.stBranch[i].nY座標); + OpenTaiko.Tx.Lane_Text[0].Opacity = this.stBranch[i].nBranchレイヤー透明度; + } + #endregion + #region[ 玄人譜面_レベルアップ ] + //玄人→達人 + if (this.stBranch[i].nBefore == CDTX.ECourse.eExpert && this.stBranch[i].nAfter == CDTX.ECourse.eMaster) { + OpenTaiko.Tx.Lane_Text[1].t2D描画(x[i], y[i] - this.stBranch[i].nY座標); + OpenTaiko.Tx.Lane_Text[2].t2D描画(x[i], (y[i] + 20) - this.stBranch[i].nY座標); + OpenTaiko.Tx.Lane_Text[1].Opacity = this.stBranch[i].nBranchレイヤー透明度; + } + #endregion + #region[ 玄人譜面_レベルダウン ] + if (this.stBranch[i].nBefore == CDTX.ECourse.eExpert && this.stBranch[i].nAfter == CDTX.ECourse.eNormal) { + OpenTaiko.Tx.Lane_Text[1].t2D描画(x[i], y[i] + this.stBranch[i].nY座標); + OpenTaiko.Tx.Lane_Text[0].t2D描画(x[i], (y[i] - 24) + this.stBranch[i].nY座標); + OpenTaiko.Tx.Lane_Text[1].Opacity = this.stBranch[i].nBranchレイヤー透明度; + } + #endregion + #region[ 達人譜面_レベルダウン ] + if (this.stBranch[i].nBefore == CDTX.ECourse.eMaster && this.stBranch[i].nAfter == CDTX.ECourse.eNormal) { + OpenTaiko.Tx.Lane_Text[2].t2D描画(x[i], y[i] + this.stBranch[i].nY座標); + OpenTaiko.Tx.Lane_Text[0].t2D描画(x[i], (y[i] - 24) + this.stBranch[i].nY座標); + OpenTaiko.Tx.Lane_Text[2].Opacity = this.stBranch[i].nBranchレイヤー透明度; + } + if (this.stBranch[i].nBefore == CDTX.ECourse.eMaster && this.stBranch[i].nAfter == CDTX.ECourse.eExpert) { + OpenTaiko.Tx.Lane_Text[2].t2D描画(x[i], y[i] + this.stBranch[i].nY座標); + OpenTaiko.Tx.Lane_Text[1].t2D描画(x[i], (y[i] - 24) + this.stBranch[i].nY座標); + OpenTaiko.Tx.Lane_Text[2].Opacity = this.stBranch[i].nBranchレイヤー透明度; + } + #endregion + } + } + + } + } + + + if (OpenTaiko.ConfigIni.nPlayerCount <= 2) { + if (OpenTaiko.Tx.Lane_Background_Sub != null) { + OpenTaiko.Tx.Lane_Background_Sub.t2D描画(OpenTaiko.Skin.Game_Lane_Sub_X[0], OpenTaiko.Skin.Game_Lane_Sub_Y[0]); + if (OpenTaiko.stage演奏ドラム画面.bDoublePlay) { + OpenTaiko.Tx.Lane_Background_Sub.t2D描画(OpenTaiko.Skin.Game_Lane_Sub_X[1], OpenTaiko.Skin.Game_Lane_Sub_Y[1]); } } + } - if (OpenTaiko.ConfigIni.nPlayerCount <= 2) { - if (OpenTaiko.Tx.Lane_Background_Sub != null) { - OpenTaiko.Tx.Lane_Background_Sub.t2D描画(OpenTaiko.Skin.Game_Lane_Sub_X[0], OpenTaiko.Skin.Game_Lane_Sub_Y[0]); - if (OpenTaiko.stage演奏ドラム画面.bDoublePlay) { - OpenTaiko.Tx.Lane_Background_Sub.t2D描画(OpenTaiko.Skin.Game_Lane_Sub_X[1], OpenTaiko.Skin.Game_Lane_Sub_Y[1]); - } + OpenTaiko.stage演奏ドラム画面.actTaikoLaneFlash.Draw(); + + + + if (OpenTaiko.Tx.Taiko_Frame[0] != null) { + // Tower frame (without tamashii jauge) if playing a tower chart + for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { + int frame_x; + int frame_y; + if (OpenTaiko.ConfigIni.nPlayerCount == 5) { + frame_x = OpenTaiko.Skin.Game_Taiko_Frame_5P[0] + (OpenTaiko.Skin.Game_UIMove_5P[0] * i); + frame_y = OpenTaiko.Skin.Game_Taiko_Frame_5P[1] + (OpenTaiko.Skin.Game_UIMove_5P[1] * i); + } else if (OpenTaiko.ConfigIni.nPlayerCount == 4 || OpenTaiko.ConfigIni.nPlayerCount == 3) { + frame_x = OpenTaiko.Skin.Game_Taiko_Frame_4P[0] + (OpenTaiko.Skin.Game_UIMove_4P[0] * i); + frame_y = OpenTaiko.Skin.Game_Taiko_Frame_4P[1] + (OpenTaiko.Skin.Game_UIMove_4P[1] * i); + } else { + frame_x = OpenTaiko.Skin.Game_Taiko_Frame_X[i]; + frame_y = OpenTaiko.Skin.Game_Taiko_Frame_Y[i]; } + + CTexture tex = null; + + switch (i) { + case 0: { + if (OpenTaiko.ConfigIni.bTokkunMode) { + tex = OpenTaiko.Tx.Taiko_Frame[3]; + } else if (OpenTaiko.ConfigIni.bAIBattleMode) { + tex = OpenTaiko.Tx.Taiko_Frame[5]; + } else if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Tower) { + tex = OpenTaiko.Tx.Taiko_Frame[2]; + } else if (OpenTaiko.ConfigIni.nPlayerCount > 2) { + tex = OpenTaiko.Tx.Taiko_Frame[6]; + } else { + tex = OpenTaiko.Tx.Taiko_Frame[0]; + } + } + break; + case 1: { + if (OpenTaiko.ConfigIni.bAIBattleMode) { + tex = OpenTaiko.Tx.Taiko_Frame[4]; + } else if (OpenTaiko.ConfigIni.nPlayerCount > 2) { + tex = OpenTaiko.Tx.Taiko_Frame[6]; + } else { + tex = OpenTaiko.Tx.Taiko_Frame[1]; + } + } + break; + case 2: + tex = OpenTaiko.Tx.Taiko_Frame[6]; + break; + case 3: + tex = OpenTaiko.Tx.Taiko_Frame[6]; + break; + case 4: + tex = OpenTaiko.Tx.Taiko_Frame[6]; + break; + } + + tex?.t2D描画(frame_x, frame_y); } + /* + if (TJAPlayer3.ConfigIni.bTokkunMode == true && TJAPlayer3.Tx.Taiko_Frame[3] != null) + TJAPlayer3.Tx.Taiko_Frame[3]?.t2D描画(TJAPlayer3.Skin.Game_Taiko_Frame_X[0], TJAPlayer3.Skin.Game_Taiko_Frame_Y[0]); + else if (TJAPlayer3.stage選曲.n確定された曲の難易度[0] == (int)Difficulty.Tower && TJAPlayer3.Tx.Taiko_Frame[2] != null) + TJAPlayer3.Tx.Taiko_Frame[2]?.t2D描画(TJAPlayer3.Skin.Game_Taiko_Frame_X[0], TJAPlayer3.Skin.Game_Taiko_Frame_Y[0]); + else if (TJAPlayer3.ConfigIni.bAIBattleMode && TJAPlayer3.Tx.Taiko_Frame[5] != null) + TJAPlayer3.Tx.Taiko_Frame[5]?.t2D描画(TJAPlayer3.Skin.Game_Taiko_Frame_X[0], TJAPlayer3.Skin.Game_Taiko_Frame_Y[0]); + else + TJAPlayer3.Tx.Taiko_Frame[0]?.t2D描画(TJAPlayer3.Skin.Game_Taiko_Frame_X[0], TJAPlayer3.Skin.Game_Taiko_Frame_Y[0]); - OpenTaiko.stage演奏ドラム画面.actTaikoLaneFlash.Draw(); - - - - if (OpenTaiko.Tx.Taiko_Frame[0] != null) { - // Tower frame (without tamashii jauge) if playing a tower chart - for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { - int frame_x; - int frame_y; - if (OpenTaiko.ConfigIni.nPlayerCount == 5) { - frame_x = OpenTaiko.Skin.Game_Taiko_Frame_5P[0] + (OpenTaiko.Skin.Game_UIMove_5P[0] * i); - frame_y = OpenTaiko.Skin.Game_Taiko_Frame_5P[1] + (OpenTaiko.Skin.Game_UIMove_5P[1] * i); - } else if (OpenTaiko.ConfigIni.nPlayerCount == 4 || OpenTaiko.ConfigIni.nPlayerCount == 3) { - frame_x = OpenTaiko.Skin.Game_Taiko_Frame_4P[0] + (OpenTaiko.Skin.Game_UIMove_4P[0] * i); - frame_y = OpenTaiko.Skin.Game_Taiko_Frame_4P[1] + (OpenTaiko.Skin.Game_UIMove_4P[1] * i); - } else { - frame_x = OpenTaiko.Skin.Game_Taiko_Frame_X[i]; - frame_y = OpenTaiko.Skin.Game_Taiko_Frame_Y[i]; - } - - CTexture tex = null; - - switch (i) { - case 0: { - if (OpenTaiko.ConfigIni.bTokkunMode) { - tex = OpenTaiko.Tx.Taiko_Frame[3]; - } else if (OpenTaiko.ConfigIni.bAIBattleMode) { - tex = OpenTaiko.Tx.Taiko_Frame[5]; - } else if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Tower) { - tex = OpenTaiko.Tx.Taiko_Frame[2]; - } else if (OpenTaiko.ConfigIni.nPlayerCount > 2) { - tex = OpenTaiko.Tx.Taiko_Frame[6]; - } else { - tex = OpenTaiko.Tx.Taiko_Frame[0]; - } - } - break; - case 1: { - if (OpenTaiko.ConfigIni.bAIBattleMode) { - tex = OpenTaiko.Tx.Taiko_Frame[4]; - } else if (OpenTaiko.ConfigIni.nPlayerCount > 2) { - tex = OpenTaiko.Tx.Taiko_Frame[6]; - } else { - tex = OpenTaiko.Tx.Taiko_Frame[1]; - } - } - break; - case 2: - tex = OpenTaiko.Tx.Taiko_Frame[6]; - break; - case 3: - tex = OpenTaiko.Tx.Taiko_Frame[6]; - break; - case 4: - tex = OpenTaiko.Tx.Taiko_Frame[6]; - break; - } - - tex?.t2D描画(frame_x, frame_y); - } - - /* - if (TJAPlayer3.ConfigIni.bTokkunMode == true && TJAPlayer3.Tx.Taiko_Frame[3] != null) - TJAPlayer3.Tx.Taiko_Frame[3]?.t2D描画(TJAPlayer3.Skin.Game_Taiko_Frame_X[0], TJAPlayer3.Skin.Game_Taiko_Frame_Y[0]); - else if (TJAPlayer3.stage選曲.n確定された曲の難易度[0] == (int)Difficulty.Tower && TJAPlayer3.Tx.Taiko_Frame[2] != null) - TJAPlayer3.Tx.Taiko_Frame[2]?.t2D描画(TJAPlayer3.Skin.Game_Taiko_Frame_X[0], TJAPlayer3.Skin.Game_Taiko_Frame_Y[0]); - else if (TJAPlayer3.ConfigIni.bAIBattleMode && TJAPlayer3.Tx.Taiko_Frame[5] != null) - TJAPlayer3.Tx.Taiko_Frame[5]?.t2D描画(TJAPlayer3.Skin.Game_Taiko_Frame_X[0], TJAPlayer3.Skin.Game_Taiko_Frame_Y[0]); + if (TJAPlayer3.stage演奏ドラム画面.bDoublePlay) + { + if (TJAPlayer3.ConfigIni.bAIBattleMode) + TJAPlayer3.Tx.Taiko_Frame[4]?.t2D描画(TJAPlayer3.Skin.Game_Taiko_Frame_X[1], TJAPlayer3.Skin.Game_Taiko_Frame_Y[1]); else - TJAPlayer3.Tx.Taiko_Frame[0]?.t2D描画(TJAPlayer3.Skin.Game_Taiko_Frame_X[0], TJAPlayer3.Skin.Game_Taiko_Frame_Y[0]); - - if (TJAPlayer3.stage演奏ドラム画面.bDoublePlay) - { - if (TJAPlayer3.ConfigIni.bAIBattleMode) - TJAPlayer3.Tx.Taiko_Frame[4]?.t2D描画(TJAPlayer3.Skin.Game_Taiko_Frame_X[1], TJAPlayer3.Skin.Game_Taiko_Frame_Y[1]); - else - TJAPlayer3.Tx.Taiko_Frame[1]?.t2D描画(TJAPlayer3.Skin.Game_Taiko_Frame_X[1], TJAPlayer3.Skin.Game_Taiko_Frame_Y[1]); - } - */ - } - var nTime = (long)(SoundManager.PlayTimer.NowTime * OpenTaiko.ConfigIni.SongPlaybackSpeed); - - for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { - if (this.n総移動時間[i] != -1) { - if (n移動方向[i] == 1) { - OpenTaiko.stage演奏ドラム画面.JPOSCROLLX[i] = this.n移動開始X[i] + (int)((((int)nTime - this.n移動開始時刻[i]) / (double)(this.n総移動時間[i])) * this.n移動距離px[i]); - OpenTaiko.stage演奏ドラム画面.JPOSCROLLY[i] = this.n移動開始Y[i] + (int)((((int)nTime - this.n移動開始時刻[i]) / (double)(this.n総移動時間[i])) * this.nVerticalJSPos[i]); - //TJAPlayer3.stage演奏ドラム画面.FlyingNotes.StartPointX[i] = this.n移動開始X[i] + (int)((((int)nTime - this.n移動開始時刻[i]) / (double)(this.n総移動時間[i])) * this.n移動距離px[i]); - } else { - OpenTaiko.stage演奏ドラム画面.JPOSCROLLX[i] = this.n移動開始X[i] - (int)((((int)nTime - this.n移動開始時刻[i]) / (double)(this.n総移動時間[i])) * this.n移動距離px[i]); - OpenTaiko.stage演奏ドラム画面.JPOSCROLLY[i] = this.n移動開始Y[i] - (int)((((int)nTime - this.n移動開始時刻[i]) / (double)(this.n総移動時間[i])) * this.nVerticalJSPos[i]); - //TJAPlayer3.stage演奏ドラム画面.FlyingNotes.StartPointX[i] = this.n移動開始X[i] - (int)((((int)nTime - this.n移動開始時刻[i]) / (double)(this.n総移動時間[i])) * this.n移動距離px[i]); - } - - if (((int)nTime) > this.n移動開始時刻[i] + this.n総移動時間[i]) { - this.n総移動時間[i] = -1; - OpenTaiko.stage演奏ドラム画面.JPOSCROLLX[i] = this.n移動目的場所X[i]; - OpenTaiko.stage演奏ドラム画面.JPOSCROLLY[i] = this.n移動目的場所Y[i]; - //TJAPlayer3.stage演奏ドラム画面.FlyingNotes.StartPointX[i] = this.n移動目的場所X[i]; - } - } - } - - - - - if (OpenTaiko.ConfigIni.bEnableAVI && OpenTaiko.DTX.listVD.Count > 0 && OpenTaiko.stage演奏ドラム画面.ShowVideo) { - if (OpenTaiko.Tx.Lane_Background_Main != null) OpenTaiko.Tx.Lane_Background_Main.Opacity = OpenTaiko.ConfigIni.nBGAlpha; - if (OpenTaiko.Tx.Lane_Background_AI != null) OpenTaiko.Tx.Lane_Background_AI.Opacity = OpenTaiko.ConfigIni.nBGAlpha; - if (OpenTaiko.Tx.Lane_Background_Sub != null) OpenTaiko.Tx.Lane_Background_Sub.Opacity = OpenTaiko.ConfigIni.nBGAlpha; - if (OpenTaiko.Tx.Lane_Background_GoGo != null) OpenTaiko.Tx.Lane_Background_GoGo.Opacity = OpenTaiko.ConfigIni.nBGAlpha; - } else { - if (OpenTaiko.Tx.Lane_Background_Main != null) OpenTaiko.Tx.Lane_Background_Main.Opacity = 255; - if (OpenTaiko.Tx.Lane_Background_AI != null) OpenTaiko.Tx.Lane_Background_AI.Opacity = 255; - if (OpenTaiko.Tx.Lane_Background_Sub != null) OpenTaiko.Tx.Lane_Background_Sub.Opacity = 255; - if (OpenTaiko.Tx.Lane_Background_GoGo != null) OpenTaiko.Tx.Lane_Background_GoGo.Opacity = 255; - } - - return base.Draw(); + TJAPlayer3.Tx.Taiko_Frame[1]?.t2D描画(TJAPlayer3.Skin.Game_Taiko_Frame_X[1], TJAPlayer3.Skin.Game_Taiko_Frame_Y[1]); + } + */ } + var nTime = (long)(SoundManager.PlayTimer.NowTime * OpenTaiko.ConfigIni.SongPlaybackSpeed); - public void ゴーゴー炎() { - //判定枠 - if (OpenTaiko.Tx.Judge_Frame != null) { - OpenTaiko.Tx.Judge_Frame.b加算合成 = OpenTaiko.Skin.Game_JudgeFrame_AddBlend; - for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { - OpenTaiko.Tx.Judge_Frame.t2D描画( - OpenTaiko.stage演奏ドラム画面.NoteOriginX[i], - OpenTaiko.stage演奏ドラム画面.NoteOriginY[i], new Rectangle(0, 0, OpenTaiko.Skin.Game_Notes_Size[0], OpenTaiko.Skin.Game_Notes_Size[1])); + for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { + if (this.n総移動時間[i] != -1) { + if (n移動方向[i] == 1) { + OpenTaiko.stage演奏ドラム画面.JPOSCROLLX[i] = this.n移動開始X[i] + (int)((((int)nTime - this.n移動開始時刻[i]) / (double)(this.n総移動時間[i])) * this.n移動距離px[i]); + OpenTaiko.stage演奏ドラム画面.JPOSCROLLY[i] = this.n移動開始Y[i] + (int)((((int)nTime - this.n移動開始時刻[i]) / (double)(this.n総移動時間[i])) * this.nVerticalJSPos[i]); + //TJAPlayer3.stage演奏ドラム画面.FlyingNotes.StartPointX[i] = this.n移動開始X[i] + (int)((((int)nTime - this.n移動開始時刻[i]) / (double)(this.n総移動時間[i])) * this.n移動距離px[i]); + } else { + OpenTaiko.stage演奏ドラム画面.JPOSCROLLX[i] = this.n移動開始X[i] - (int)((((int)nTime - this.n移動開始時刻[i]) / (double)(this.n総移動時間[i])) * this.n移動距離px[i]); + OpenTaiko.stage演奏ドラム画面.JPOSCROLLY[i] = this.n移動開始Y[i] - (int)((((int)nTime - this.n移動開始時刻[i]) / (double)(this.n総移動時間[i])) * this.nVerticalJSPos[i]); + //TJAPlayer3.stage演奏ドラム画面.FlyingNotes.StartPointX[i] = this.n移動開始X[i] - (int)((((int)nTime - this.n移動開始時刻[i]) / (double)(this.n総移動時間[i])) * this.n移動距離px[i]); } - } - - #region[ ゴーゴー炎 ] - for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { - if (OpenTaiko.stage演奏ドラム画面.bIsGOGOTIME[i] && !OpenTaiko.ConfigIni.SimpleMode) { - this.ctゴーゴー炎.TickLoop(); - - if (OpenTaiko.Tx.Effects_Fire != null) { - float f倍率 = 1.0f; - - float[] ar倍率 = new float[] { 0.8f, 1.2f, 1.7f, 2.5f, 2.3f, 2.2f, 2.0f, 1.8f, 1.7f, 1.6f, 1.6f, 1.5f, 1.5f, 1.4f, 1.3f, 1.2f, 1.1f, 1.0f }; - - f倍率 = ar倍率[this.ctゴーゴー.CurrentValue]; - - /* - Matrix mat = Matrix.Identity; - mat *= Matrix.Scaling(f倍率, f倍率, 1.0f); - mat *= Matrix.Translation(TJAPlayer3.Skin.nScrollFieldX[i] - SampleFramework.GameWindowSize.Width / 2.0f, -(TJAPlayer3.Skin.nJudgePointY[i] - SampleFramework.GameWindowSize.Height / 2.0f), 0f); - */ - //this.txゴーゴー炎.b加算合成 = true; - - //this.ctゴーゴー.n現在の値 = 6; - - int width = OpenTaiko.Tx.Effects_Fire.szTextureSize.Width / 7; - int height = OpenTaiko.Tx.Effects_Fire.szTextureSize.Height; - - float x = -(width * (f倍率 - 1.0f) / 2.0f); - float y = -(height * (f倍率 - 1.0f) / 2.0f); - - if (OpenTaiko.ConfigIni.nPlayerCount == 5) { - x += OpenTaiko.Skin.Game_Effect_Fire_5P[0] + (OpenTaiko.Skin.Game_UIMove_5P[0] * i); - y += OpenTaiko.Skin.Game_Effect_Fire_5P[1] + (OpenTaiko.Skin.Game_UIMove_5P[1] * i); - } else if (OpenTaiko.ConfigIni.nPlayerCount == 4 || OpenTaiko.ConfigIni.nPlayerCount == 3) { - x += OpenTaiko.Skin.Game_Effect_Fire_4P[0] + (OpenTaiko.Skin.Game_UIMove_4P[0] * i); - y += OpenTaiko.Skin.Game_Effect_Fire_4P[1] + (OpenTaiko.Skin.Game_UIMove_4P[1] * i); - } else { - x += OpenTaiko.Skin.Game_Effect_Fire_X[i]; - y += OpenTaiko.Skin.Game_Effect_Fire_Y[i]; - } - - OpenTaiko.Tx.Effects_Fire.vcScaleRatio.X = f倍率; - OpenTaiko.Tx.Effects_Fire.vcScaleRatio.Y = f倍率; - - OpenTaiko.Tx.Effects_Fire.t2D描画(x, y, - new Rectangle(width * (this.ctゴーゴー炎.CurrentValue), 0, width, height)); - } - } - } - #endregion - for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { - if (!this.st状態[i].ct進行.IsStoped) { - this.st状態[i].ct進行.Tick(); - if (this.st状態[i].ct進行.IsEnded) { - this.st状態[i].ct進行.Stop(); - } - //if( this.txアタックエフェクトLower != null ) - { - //this.txアタックエフェクトLower.b加算合成 = true; - int n = this.st状態[i].nIsBig == 1 ? 520 : 0; - - float x = 0; - float y = 0; - - if (OpenTaiko.ConfigIni.nPlayerCount == 5) { - x = OpenTaiko.Skin.Game_Effects_Hit_Explosion_5P[0] + (OpenTaiko.Skin.Game_UIMove_5P[0] * i); - y = OpenTaiko.Skin.Game_Effects_Hit_Explosion_5P[1] + (OpenTaiko.Skin.Game_UIMove_5P[1] * i); - } else if (OpenTaiko.ConfigIni.nPlayerCount == 4 || OpenTaiko.ConfigIni.nPlayerCount == 3) { - x = OpenTaiko.Skin.Game_Effects_Hit_Explosion_4P[0] + (OpenTaiko.Skin.Game_UIMove_4P[0] * i); - y = OpenTaiko.Skin.Game_Effects_Hit_Explosion_4P[1] + (OpenTaiko.Skin.Game_UIMove_4P[1] * i); - } else { - x = OpenTaiko.Skin.Game_Effects_Hit_Explosion_X[i]; - y = OpenTaiko.Skin.Game_Effects_Hit_Explosion_Y[i]; - } - x += OpenTaiko.stage演奏ドラム画面.GetJPOSCROLLX(i); - y += OpenTaiko.stage演奏ドラム画面.GetJPOSCROLLY(i); - - switch (st状態[i].judge) { - case ENoteJudge.Perfect: - case ENoteJudge.Great: - case ENoteJudge.Auto: - if (!OpenTaiko.ConfigIni.SimpleMode) { - //this.txアタックエフェクトLower.t2D描画( CDTXMania.app.Device, 285, 127, new Rectangle( this.st状態[ i ].ct進行.n現在の値 * 260, n, 260, 260 ) ); - if (this.st状態[i].nIsBig == 1 && OpenTaiko.Tx.Effects_Hit_Great_Big[this.st状態[i].ct進行.CurrentValue] != null) - OpenTaiko.Tx.Effects_Hit_Great_Big[this.st状態[i].ct進行.CurrentValue].t2D描画(x, y); - else if (OpenTaiko.Tx.Effects_Hit_Great[this.st状態[i].ct進行.CurrentValue] != null) - OpenTaiko.Tx.Effects_Hit_Great[this.st状態[i].ct進行.CurrentValue].t2D描画(x, y); - } - break; - - case ENoteJudge.Good: - //this.txアタックエフェクトLower.t2D描画( CDTXMania.app.Device, 285, 127, new Rectangle( this.st状態[ i ].ct進行.n現在の値 * 260, n + 260, 260, 260 ) ); - if (this.st状態[i].nIsBig == 1 && OpenTaiko.Tx.Effects_Hit_Good_Big[this.st状態[i].ct進行.CurrentValue] != null) - OpenTaiko.Tx.Effects_Hit_Good_Big[this.st状態[i].ct進行.CurrentValue].t2D描画(x, y); - else if (OpenTaiko.Tx.Effects_Hit_Good[this.st状態[i].ct進行.CurrentValue] != null) - OpenTaiko.Tx.Effects_Hit_Good[this.st状態[i].ct進行.CurrentValue].t2D描画(x, y); - break; - - case ENoteJudge.Miss: - case ENoteJudge.Bad: - break; - } - } - } - } - - - } - - public virtual void Start(int nLane, ENoteJudge judge, bool b両手入力, int nPlayer) { - //2017.08.15 kairera0467 排他なので番地をそのまま各レーンの状態として扱う - - //for( int n = 0; n < 1; n++ ) - { - this.st状態[nPlayer].ct進行 = new CCounter(0, 14, 20, OpenTaiko.Timer); - this.st状態[nPlayer].judge = judge; - this.st状態[nPlayer].nPlayer = nPlayer; - - switch (nLane) { - case 0x11: - case 0x12: - this.st状態[nPlayer].nIsBig = 0; - break; - case 0x13: - case 0x14: - case 0x1A: - case 0x1B: { - if (b両手入力) - this.st状態[nPlayer].nIsBig = 1; - else - this.st状態[nPlayer].nIsBig = 0; - } - break; + if (((int)nTime) > this.n移動開始時刻[i] + this.n総移動時間[i]) { + this.n総移動時間[i] = -1; + OpenTaiko.stage演奏ドラム画面.JPOSCROLLX[i] = this.n移動目的場所X[i]; + OpenTaiko.stage演奏ドラム画面.JPOSCROLLY[i] = this.n移動目的場所Y[i]; + //TJAPlayer3.stage演奏ドラム画面.FlyingNotes.StartPointX[i] = this.n移動目的場所X[i]; } } } - public void GOGOSTART() { - this.ctゴーゴー = new CCounter(0, 17, 18, OpenTaiko.Timer); - if (OpenTaiko.ConfigIni.nPlayerCount == 1 && OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] != (int)Difficulty.Dan) OpenTaiko.stage演奏ドラム画面.GoGoSplash.StartSplash(); + + + if (OpenTaiko.ConfigIni.bEnableAVI && OpenTaiko.DTX.listVD.Count > 0 && OpenTaiko.stage演奏ドラム画面.ShowVideo) { + if (OpenTaiko.Tx.Lane_Background_Main != null) OpenTaiko.Tx.Lane_Background_Main.Opacity = OpenTaiko.ConfigIni.nBGAlpha; + if (OpenTaiko.Tx.Lane_Background_AI != null) OpenTaiko.Tx.Lane_Background_AI.Opacity = OpenTaiko.ConfigIni.nBGAlpha; + if (OpenTaiko.Tx.Lane_Background_Sub != null) OpenTaiko.Tx.Lane_Background_Sub.Opacity = OpenTaiko.ConfigIni.nBGAlpha; + if (OpenTaiko.Tx.Lane_Background_GoGo != null) OpenTaiko.Tx.Lane_Background_GoGo.Opacity = OpenTaiko.ConfigIni.nBGAlpha; + } else { + if (OpenTaiko.Tx.Lane_Background_Main != null) OpenTaiko.Tx.Lane_Background_Main.Opacity = 255; + if (OpenTaiko.Tx.Lane_Background_AI != null) OpenTaiko.Tx.Lane_Background_AI.Opacity = 255; + if (OpenTaiko.Tx.Lane_Background_Sub != null) OpenTaiko.Tx.Lane_Background_Sub.Opacity = 255; + if (OpenTaiko.Tx.Lane_Background_GoGo != null) OpenTaiko.Tx.Lane_Background_GoGo.Opacity = 255; } - - public void t分岐レイヤー_コース変化(CDTX.ECourse n現在, CDTX.ECourse n次回, int nPlayer) { - if (n現在 == n次回) { - return; - } - this.stBranch[nPlayer].ct分岐アニメ進行 = new CCounter(0, 300, 2, OpenTaiko.Timer); - - this.stBranch[nPlayer].nBranchレイヤー透明度 = 6; - this.stBranch[nPlayer].nY座標 = 1; - - this.stBranch[nPlayer].nBefore = n現在; - this.stBranch[nPlayer].nAfter = n次回; - - OpenTaiko.stage演奏ドラム画面.actLane.t分岐レイヤー_コース変化(n現在, n次回, nPlayer); - } - - public void t判定枠移動(double db移動時間, int n移動px, int n移動方向, int nPlayer, int vJs) { - this.n移動開始時刻[nPlayer] = (int)(SoundManager.PlayTimer.NowTime * OpenTaiko.ConfigIni.SongPlaybackSpeed); - this.n移動開始X[nPlayer] = OpenTaiko.stage演奏ドラム画面.JPOSCROLLX[nPlayer]; - this.n移動開始Y[nPlayer] = OpenTaiko.stage演奏ドラム画面.JPOSCROLLY[nPlayer]; - this.n総移動時間[nPlayer] = (int)(db移動時間 * 1000); - this.n移動方向[nPlayer] = n移動方向; - this.n移動距離px[nPlayer] = n移動px; - this.nVerticalJSPos[nPlayer] = vJs; - if (n移動方向 == 0) { - this.n移動目的場所X[nPlayer] = OpenTaiko.stage演奏ドラム画面.JPOSCROLLX[nPlayer] - n移動px; - this.n移動目的場所Y[nPlayer] = OpenTaiko.stage演奏ドラム画面.JPOSCROLLY[nPlayer] - vJs; - } else { - this.n移動目的場所X[nPlayer] = OpenTaiko.stage演奏ドラム画面.JPOSCROLLX[nPlayer] + n移動px; - this.n移動目的場所Y[nPlayer] = OpenTaiko.stage演奏ドラム画面.JPOSCROLLY[nPlayer] + vJs; - } - } - - #region[ private ] - //----------------- - //private CTexture txLane; - //private CTexture txLaneB; - //private CTexture tx枠線; - //private CTexture tx判定枠; - //private CTexture txゴーゴー; - //private CTexture txゴーゴー炎; - //private CTexture[] txArゴーゴー炎; - //private CTexture[] txArアタックエフェクトLower_A; - //private CTexture[] txArアタックエフェクトLower_B; - //private CTexture[] txArアタックエフェクトLower_C; - //private CTexture[] txArアタックエフェクトLower_D; - - //private CTexture[] txLaneFlush = new CTexture[3]; - - //private CTexture[] tx普通譜面 = new CTexture[2]; - //private CTexture[] tx玄人譜面 = new CTexture[2]; - //private CTexture[] tx達人譜面 = new CTexture[2]; - - //private CTextureAf txアタックエフェクトLower; - - protected STSTATUS[] st状態 = new STSTATUS[5]; - - //private CTexture[] txゴーゴースプラッシュ; - - [StructLayout(LayoutKind.Sequential)] - protected struct STSTATUS { - public bool b使用中; - public CCounter ct進行; - public ENoteJudge judge; - public int nIsBig; - public int n透明度; - public int nPlayer; - } - private CCounter ctゴーゴー; - private CCounter ctゴーゴー炎; - - - - public STBRANCH[] stBranch = new STBRANCH[5]; - [StructLayout(LayoutKind.Sequential)] - public struct STBRANCH { - public CCounter ct分岐アニメ進行; - public CDTX.ECourse nBefore; - public CDTX.ECourse nAfter; - - public long nフラッシュ制御タイマ; - public int nBranchレイヤー透明度; - public int nBranch文字透明度; - public int nY座標; - public int nY; - } - - - private int[] n総移動時間 = new int[5]; - private int[] n移動開始X = new int[5]; - private int[] n移動開始Y = new int[5]; - private int[] n移動開始時刻 = new int[5]; - private int[] n移動距離px = new int[5]; - private int[] nVerticalJSPos = new int[5]; - private int[] n移動目的場所X = new int[5]; - private int[] n移動目的場所Y = new int[5]; - private int[] n移動方向 = new int[5]; - - //----------------- - #endregion + return base.Draw(); } + + public void ゴーゴー炎() { + //判定枠 + if (OpenTaiko.Tx.Judge_Frame != null) { + OpenTaiko.Tx.Judge_Frame.b加算合成 = OpenTaiko.Skin.Game_JudgeFrame_AddBlend; + for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { + OpenTaiko.Tx.Judge_Frame.t2D描画( + OpenTaiko.stage演奏ドラム画面.NoteOriginX[i], + OpenTaiko.stage演奏ドラム画面.NoteOriginY[i], new Rectangle(0, 0, OpenTaiko.Skin.Game_Notes_Size[0], OpenTaiko.Skin.Game_Notes_Size[1])); + } + } + + + #region[ ゴーゴー炎 ] + for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { + if (OpenTaiko.stage演奏ドラム画面.bIsGOGOTIME[i] && !OpenTaiko.ConfigIni.SimpleMode) { + this.ctゴーゴー炎.TickLoop(); + + if (OpenTaiko.Tx.Effects_Fire != null) { + float f倍率 = 1.0f; + + float[] ar倍率 = new float[] { 0.8f, 1.2f, 1.7f, 2.5f, 2.3f, 2.2f, 2.0f, 1.8f, 1.7f, 1.6f, 1.6f, 1.5f, 1.5f, 1.4f, 1.3f, 1.2f, 1.1f, 1.0f }; + + f倍率 = ar倍率[this.ctゴーゴー.CurrentValue]; + + /* + Matrix mat = Matrix.Identity; + mat *= Matrix.Scaling(f倍率, f倍率, 1.0f); + mat *= Matrix.Translation(TJAPlayer3.Skin.nScrollFieldX[i] - SampleFramework.GameWindowSize.Width / 2.0f, -(TJAPlayer3.Skin.nJudgePointY[i] - SampleFramework.GameWindowSize.Height / 2.0f), 0f); + */ + //this.txゴーゴー炎.b加算合成 = true; + + //this.ctゴーゴー.n現在の値 = 6; + + int width = OpenTaiko.Tx.Effects_Fire.szTextureSize.Width / 7; + int height = OpenTaiko.Tx.Effects_Fire.szTextureSize.Height; + + float x = -(width * (f倍率 - 1.0f) / 2.0f); + float y = -(height * (f倍率 - 1.0f) / 2.0f); + + if (OpenTaiko.ConfigIni.nPlayerCount == 5) { + x += OpenTaiko.Skin.Game_Effect_Fire_5P[0] + (OpenTaiko.Skin.Game_UIMove_5P[0] * i); + y += OpenTaiko.Skin.Game_Effect_Fire_5P[1] + (OpenTaiko.Skin.Game_UIMove_5P[1] * i); + } else if (OpenTaiko.ConfigIni.nPlayerCount == 4 || OpenTaiko.ConfigIni.nPlayerCount == 3) { + x += OpenTaiko.Skin.Game_Effect_Fire_4P[0] + (OpenTaiko.Skin.Game_UIMove_4P[0] * i); + y += OpenTaiko.Skin.Game_Effect_Fire_4P[1] + (OpenTaiko.Skin.Game_UIMove_4P[1] * i); + } else { + x += OpenTaiko.Skin.Game_Effect_Fire_X[i]; + y += OpenTaiko.Skin.Game_Effect_Fire_Y[i]; + } + + OpenTaiko.Tx.Effects_Fire.vcScaleRatio.X = f倍率; + OpenTaiko.Tx.Effects_Fire.vcScaleRatio.Y = f倍率; + + OpenTaiko.Tx.Effects_Fire.t2D描画(x, y, + new Rectangle(width * (this.ctゴーゴー炎.CurrentValue), 0, width, height)); + } + } + } + #endregion + for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { + if (!this.st状態[i].ct進行.IsStoped) { + this.st状態[i].ct進行.Tick(); + if (this.st状態[i].ct進行.IsEnded) { + this.st状態[i].ct進行.Stop(); + } + //if( this.txアタックエフェクトLower != null ) + { + //this.txアタックエフェクトLower.b加算合成 = true; + int n = this.st状態[i].nIsBig == 1 ? 520 : 0; + + float x = 0; + float y = 0; + + if (OpenTaiko.ConfigIni.nPlayerCount == 5) { + x = OpenTaiko.Skin.Game_Effects_Hit_Explosion_5P[0] + (OpenTaiko.Skin.Game_UIMove_5P[0] * i); + y = OpenTaiko.Skin.Game_Effects_Hit_Explosion_5P[1] + (OpenTaiko.Skin.Game_UIMove_5P[1] * i); + } else if (OpenTaiko.ConfigIni.nPlayerCount == 4 || OpenTaiko.ConfigIni.nPlayerCount == 3) { + x = OpenTaiko.Skin.Game_Effects_Hit_Explosion_4P[0] + (OpenTaiko.Skin.Game_UIMove_4P[0] * i); + y = OpenTaiko.Skin.Game_Effects_Hit_Explosion_4P[1] + (OpenTaiko.Skin.Game_UIMove_4P[1] * i); + } else { + x = OpenTaiko.Skin.Game_Effects_Hit_Explosion_X[i]; + y = OpenTaiko.Skin.Game_Effects_Hit_Explosion_Y[i]; + } + x += OpenTaiko.stage演奏ドラム画面.GetJPOSCROLLX(i); + y += OpenTaiko.stage演奏ドラム画面.GetJPOSCROLLY(i); + + switch (st状態[i].judge) { + case ENoteJudge.Perfect: + case ENoteJudge.Great: + case ENoteJudge.Auto: + if (!OpenTaiko.ConfigIni.SimpleMode) { + //this.txアタックエフェクトLower.t2D描画( CDTXMania.app.Device, 285, 127, new Rectangle( this.st状態[ i ].ct進行.n現在の値 * 260, n, 260, 260 ) ); + if (this.st状態[i].nIsBig == 1 && OpenTaiko.Tx.Effects_Hit_Great_Big[this.st状態[i].ct進行.CurrentValue] != null) + OpenTaiko.Tx.Effects_Hit_Great_Big[this.st状態[i].ct進行.CurrentValue].t2D描画(x, y); + else if (OpenTaiko.Tx.Effects_Hit_Great[this.st状態[i].ct進行.CurrentValue] != null) + OpenTaiko.Tx.Effects_Hit_Great[this.st状態[i].ct進行.CurrentValue].t2D描画(x, y); + } + break; + + case ENoteJudge.Good: + //this.txアタックエフェクトLower.t2D描画( CDTXMania.app.Device, 285, 127, new Rectangle( this.st状態[ i ].ct進行.n現在の値 * 260, n + 260, 260, 260 ) ); + if (this.st状態[i].nIsBig == 1 && OpenTaiko.Tx.Effects_Hit_Good_Big[this.st状態[i].ct進行.CurrentValue] != null) + OpenTaiko.Tx.Effects_Hit_Good_Big[this.st状態[i].ct進行.CurrentValue].t2D描画(x, y); + else if (OpenTaiko.Tx.Effects_Hit_Good[this.st状態[i].ct進行.CurrentValue] != null) + OpenTaiko.Tx.Effects_Hit_Good[this.st状態[i].ct進行.CurrentValue].t2D描画(x, y); + break; + + case ENoteJudge.Miss: + case ENoteJudge.Bad: + break; + } + } + } + } + + + } + + public virtual void Start(int nLane, ENoteJudge judge, bool b両手入力, int nPlayer) { + //2017.08.15 kairera0467 排他なので番地をそのまま各レーンの状態として扱う + + //for( int n = 0; n < 1; n++ ) + { + this.st状態[nPlayer].ct進行 = new CCounter(0, 14, 20, OpenTaiko.Timer); + this.st状態[nPlayer].judge = judge; + this.st状態[nPlayer].nPlayer = nPlayer; + + switch (nLane) { + case 0x11: + case 0x12: + this.st状態[nPlayer].nIsBig = 0; + break; + case 0x13: + case 0x14: + case 0x1A: + case 0x1B: { + if (b両手入力) + this.st状態[nPlayer].nIsBig = 1; + else + this.st状態[nPlayer].nIsBig = 0; + } + break; + } + } + } + + + public void GOGOSTART() { + this.ctゴーゴー = new CCounter(0, 17, 18, OpenTaiko.Timer); + if (OpenTaiko.ConfigIni.nPlayerCount == 1 && OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] != (int)Difficulty.Dan) OpenTaiko.stage演奏ドラム画面.GoGoSplash.StartSplash(); + } + + + public void t分岐レイヤー_コース変化(CDTX.ECourse n現在, CDTX.ECourse n次回, int nPlayer) { + if (n現在 == n次回) { + return; + } + this.stBranch[nPlayer].ct分岐アニメ進行 = new CCounter(0, 300, 2, OpenTaiko.Timer); + + this.stBranch[nPlayer].nBranchレイヤー透明度 = 6; + this.stBranch[nPlayer].nY座標 = 1; + + this.stBranch[nPlayer].nBefore = n現在; + this.stBranch[nPlayer].nAfter = n次回; + + OpenTaiko.stage演奏ドラム画面.actLane.t分岐レイヤー_コース変化(n現在, n次回, nPlayer); + } + + public void t判定枠移動(double db移動時間, int n移動px, int n移動方向, int nPlayer, int vJs) { + this.n移動開始時刻[nPlayer] = (int)(SoundManager.PlayTimer.NowTime * OpenTaiko.ConfigIni.SongPlaybackSpeed); + this.n移動開始X[nPlayer] = OpenTaiko.stage演奏ドラム画面.JPOSCROLLX[nPlayer]; + this.n移動開始Y[nPlayer] = OpenTaiko.stage演奏ドラム画面.JPOSCROLLY[nPlayer]; + this.n総移動時間[nPlayer] = (int)(db移動時間 * 1000); + this.n移動方向[nPlayer] = n移動方向; + this.n移動距離px[nPlayer] = n移動px; + this.nVerticalJSPos[nPlayer] = vJs; + if (n移動方向 == 0) { + this.n移動目的場所X[nPlayer] = OpenTaiko.stage演奏ドラム画面.JPOSCROLLX[nPlayer] - n移動px; + this.n移動目的場所Y[nPlayer] = OpenTaiko.stage演奏ドラム画面.JPOSCROLLY[nPlayer] - vJs; + } else { + this.n移動目的場所X[nPlayer] = OpenTaiko.stage演奏ドラム画面.JPOSCROLLX[nPlayer] + n移動px; + this.n移動目的場所Y[nPlayer] = OpenTaiko.stage演奏ドラム画面.JPOSCROLLY[nPlayer] + vJs; + } + } + + #region[ private ] + //----------------- + //private CTexture txLane; + //private CTexture txLaneB; + //private CTexture tx枠線; + //private CTexture tx判定枠; + //private CTexture txゴーゴー; + //private CTexture txゴーゴー炎; + //private CTexture[] txArゴーゴー炎; + //private CTexture[] txArアタックエフェクトLower_A; + //private CTexture[] txArアタックエフェクトLower_B; + //private CTexture[] txArアタックエフェクトLower_C; + //private CTexture[] txArアタックエフェクトLower_D; + + //private CTexture[] txLaneFlush = new CTexture[3]; + + //private CTexture[] tx普通譜面 = new CTexture[2]; + //private CTexture[] tx玄人譜面 = new CTexture[2]; + //private CTexture[] tx達人譜面 = new CTexture[2]; + + //private CTextureAf txアタックエフェクトLower; + + protected STSTATUS[] st状態 = new STSTATUS[5]; + + //private CTexture[] txゴーゴースプラッシュ; + + [StructLayout(LayoutKind.Sequential)] + protected struct STSTATUS { + public bool b使用中; + public CCounter ct進行; + public ENoteJudge judge; + public int nIsBig; + public int n透明度; + public int nPlayer; + } + private CCounter ctゴーゴー; + private CCounter ctゴーゴー炎; + + + + public STBRANCH[] stBranch = new STBRANCH[5]; + [StructLayout(LayoutKind.Sequential)] + public struct STBRANCH { + public CCounter ct分岐アニメ進行; + public CDTX.ECourse nBefore; + public CDTX.ECourse nAfter; + + public long nフラッシュ制御タイマ; + public int nBranchレイヤー透明度; + public int nBranch文字透明度; + public int nY座標; + public int nY; + } + + + private int[] n総移動時間 = new int[5]; + private int[] n移動開始X = new int[5]; + private int[] n移動開始Y = new int[5]; + private int[] n移動開始時刻 = new int[5]; + private int[] n移動距離px = new int[5]; + private int[] nVerticalJSPos = new int[5]; + private int[] n移動目的場所X = new int[5]; + private int[] n移動目的場所Y = new int[5]; + private int[] n移動方向 = new int[5]; + + //----------------- + #endregion } diff --git a/OpenTaiko/src/Stages/07.Game/Taiko/CActImplMob.cs b/OpenTaiko/src/Stages/07.Game/Taiko/CActImplMob.cs index 34f1426b..c648fa16 100644 --- a/OpenTaiko/src/Stages/07.Game/Taiko/CActImplMob.cs +++ b/OpenTaiko/src/Stages/07.Game/Taiko/CActImplMob.cs @@ -1,85 +1,85 @@ using FDK; -namespace OpenTaiko { - internal class CActImplMob : CActivity { - /// - /// 踊り子 - /// - public CActImplMob() { - base.IsDeActivated = true; - } +namespace OpenTaiko; - public override void Activate() { - var mobDir = CSkin.Path($"{TextureLoader.BASE}{TextureLoader.GAME}{TextureLoader.MOB}"); - var preset = HScenePreset.GetBGPreset(); - - if (preset == null) return; - - if (System.IO.Directory.Exists(mobDir)) { - Random random = new Random(); - - var upDirs = System.IO.Directory.GetDirectories(mobDir); - if (preset.MobSet != null) { - var _presetPath = (preset.MobSet.Length > 0) ? $@"{mobDir}" + preset.MobSet[random.Next(0, preset.MobSet.Length)] : ""; - var path = Directory.Exists(_presetPath) - ? _presetPath - : (upDirs.Length > 0 ? upDirs[random.Next(0, upDirs.Length)] : ""); - - MobScript = new ScriptBG($@"{path}{Path.DirectorySeparatorChar}Script.lua"); - MobScript.Init(); - } - } - - base.Activate(); - } - - public override void DeActivate() { - MobScript?.Dispose(); - - base.DeActivate(); - } - - public override void CreateManagedResource() { - base.CreateManagedResource(); - } - - public override void ReleaseManagedResource() { - base.ReleaseManagedResource(); - } - - public override int Draw() { - if (!OpenTaiko.stage演奏ドラム画面.bDoublePlay) { - if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] != (int)Difficulty.Tower && OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] != (int)Difficulty.Dan) { - if (!OpenTaiko.stage演奏ドラム画面.bPAUSE) MobScript?.Update(); - MobScript?.Draw(); - - /* - if (HGaugeMethods.UNSAFE_IsRainbow(0)) - { - - if (!TJAPlayer3.stage演奏ドラム画面.bPAUSE) nNowMobCounter += (Math.Abs((float)TJAPlayer3.stage演奏ドラム画面.actPlayInfo.dbBPM[0] / 60.0f) * (float)TJAPlayer3.FPS.DeltaTime) * 180 / nMobBeat; - bool endAnime = nNowMobCounter >= 180; - - if (endAnime) - { - nNowMobCounter = 0; - } - - int moveHeight = (int)(70 * (TJAPlayer3.Skin.Resolution[1] / 720.0)); - - if (Mob != null) - Mob.t2D描画(0, (TJAPlayer3.Skin.Resolution[1] - (Mob.szテクスチャサイズ.Height - moveHeight)) + -((float)Math.Sin(nNowMobCounter * (Math.PI / 180)) * moveHeight)); - - } - */ - } - } - return base.Draw(); - } - #region[ private ] - //----------------- - public ScriptBG MobScript { get; private set; } - //----------------- - #endregion +internal class CActImplMob : CActivity { + /// + /// 踊り子 + /// + public CActImplMob() { + base.IsDeActivated = true; } + + public override void Activate() { + var mobDir = CSkin.Path($"{TextureLoader.BASE}{TextureLoader.GAME}{TextureLoader.MOB}"); + var preset = HScenePreset.GetBGPreset(); + + if (preset == null) return; + + if (System.IO.Directory.Exists(mobDir)) { + Random random = new Random(); + + var upDirs = System.IO.Directory.GetDirectories(mobDir); + if (preset.MobSet != null) { + var _presetPath = (preset.MobSet.Length > 0) ? $@"{mobDir}" + preset.MobSet[random.Next(0, preset.MobSet.Length)] : ""; + var path = Directory.Exists(_presetPath) + ? _presetPath + : (upDirs.Length > 0 ? upDirs[random.Next(0, upDirs.Length)] : ""); + + MobScript = new ScriptBG($@"{path}{Path.DirectorySeparatorChar}Script.lua"); + MobScript.Init(); + } + } + + base.Activate(); + } + + public override void DeActivate() { + MobScript?.Dispose(); + + base.DeActivate(); + } + + public override void CreateManagedResource() { + base.CreateManagedResource(); + } + + public override void ReleaseManagedResource() { + base.ReleaseManagedResource(); + } + + public override int Draw() { + if (!OpenTaiko.stage演奏ドラム画面.bDoublePlay) { + if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] != (int)Difficulty.Tower && OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] != (int)Difficulty.Dan) { + if (!OpenTaiko.stage演奏ドラム画面.bPAUSE) MobScript?.Update(); + MobScript?.Draw(); + + /* + if (HGaugeMethods.UNSAFE_IsRainbow(0)) + { + + if (!TJAPlayer3.stage演奏ドラム画面.bPAUSE) nNowMobCounter += (Math.Abs((float)TJAPlayer3.stage演奏ドラム画面.actPlayInfo.dbBPM[0] / 60.0f) * (float)TJAPlayer3.FPS.DeltaTime) * 180 / nMobBeat; + bool endAnime = nNowMobCounter >= 180; + + if (endAnime) + { + nNowMobCounter = 0; + } + + int moveHeight = (int)(70 * (TJAPlayer3.Skin.Resolution[1] / 720.0)); + + if (Mob != null) + Mob.t2D描画(0, (TJAPlayer3.Skin.Resolution[1] - (Mob.szテクスチャサイズ.Height - moveHeight)) + -((float)Math.Sin(nNowMobCounter * (Math.PI / 180)) * moveHeight)); + + } + */ + } + } + return base.Draw(); + } + #region[ private ] + //----------------- + public ScriptBG MobScript { get; private set; } + //----------------- + #endregion } diff --git a/OpenTaiko/src/Stages/07.Game/Taiko/CActImplMtaiko.cs b/OpenTaiko/src/Stages/07.Game/Taiko/CActImplMtaiko.cs index 96aacd73..42071426 100644 --- a/OpenTaiko/src/Stages/07.Game/Taiko/CActImplMtaiko.cs +++ b/OpenTaiko/src/Stages/07.Game/Taiko/CActImplMtaiko.cs @@ -2,578 +2,577 @@ using FDK; using Rectangle = System.Drawing.Rectangle; -namespace OpenTaiko { - internal class CActImplMtaiko : CActivity { - /// - /// mtaiko部分を描画するクラス。左側だけ。 - /// - /// - public CActImplMtaiko() { - base.IsDeActivated = true; +namespace OpenTaiko; + +internal class CActImplMtaiko : CActivity { + /// + /// mtaiko部分を描画するクラス。左側だけ。 + /// + /// + public CActImplMtaiko() { + base.IsDeActivated = true; + } + + public override void Activate() { + for (int i = 0; i < 25; i++) { + STパッド状態 stパッド状態 = new STパッド状態(); + stパッド状態.n明るさ = 0; + this.stパッド状態[i] = stパッド状態; } - public override void Activate() { - for (int i = 0; i < 25; i++) { - STパッド状態 stパッド状態 = new STパッド状態(); - stパッド状態.n明るさ = 0; - this.stパッド状態[i] = stパッド状態; - } - - this.ctレベルアップダウン = new CCounter[5]; - ctSymbolFlash = new CCounter[5]; - this.After = new CDTX.ECourse[5]; - this.Before = new CDTX.ECourse[5]; - for (int i = 0; i < 5; i++) { - this.ctレベルアップダウン[i] = new CCounter(); - BackSymbolEvent(i); - } - - base.Activate(); + this.ctレベルアップダウン = new CCounter[5]; + ctSymbolFlash = new CCounter[5]; + this.After = new CDTX.ECourse[5]; + this.Before = new CDTX.ECourse[5]; + for (int i = 0; i < 5; i++) { + this.ctレベルアップダウン[i] = new CCounter(); + BackSymbolEvent(i); } - public override void DeActivate() { - this.ctレベルアップダウン = null; + base.Activate(); + } - base.DeActivate(); + public override void DeActivate() { + this.ctレベルアップダウン = null; + + base.DeActivate(); + } + + public override void CreateManagedResource() { + base.CreateManagedResource(); + } + + public override void ReleaseManagedResource() { + base.ReleaseManagedResource(); + } + + public override int Draw() { + if (base.IsFirstDraw) { + this.nフラッシュ制御タイマ = (long)(SoundManager.PlayTimer.NowTime * OpenTaiko.ConfigIni.SongPlaybackSpeed); + base.IsFirstDraw = false; } - public override void CreateManagedResource() { - base.CreateManagedResource(); + long num = (long)(SoundManager.PlayTimer.NowTime * OpenTaiko.ConfigIni.SongPlaybackSpeed); + if (num < this.nフラッシュ制御タイマ) { + this.nフラッシュ制御タイマ = num; } - - public override void ReleaseManagedResource() { - base.ReleaseManagedResource(); - } - - public override int Draw() { - if (base.IsFirstDraw) { - this.nフラッシュ制御タイマ = (long)(SoundManager.PlayTimer.NowTime * OpenTaiko.ConfigIni.SongPlaybackSpeed); - base.IsFirstDraw = false; - } - - long num = (long)(SoundManager.PlayTimer.NowTime * OpenTaiko.ConfigIni.SongPlaybackSpeed); - if (num < this.nフラッシュ制御タイマ) { - this.nフラッシュ制御タイマ = num; - } - while ((num - this.nフラッシュ制御タイマ) >= 20) { - for (int j = 0; j < 25; j++) { - if (this.stパッド状態[j].n明るさ > 0) { - this.stパッド状態[j].n明るさ--; - } + while ((num - this.nフラッシュ制御タイマ) >= 20) { + for (int j = 0; j < 25; j++) { + if (this.stパッド状態[j].n明るさ > 0) { + this.stパッド状態[j].n明るさ--; } - this.nフラッシュ制御タイマ += 20; + } + this.nフラッシュ制御タイマ += 20; + } + + + //this.nHS = TJAPlayer3.ConfigIni.nScrollSpeed.Drums < 8 ? TJAPlayer3.ConfigIni.nScrollSpeed.Drums : 7; + + + + for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { + int bg_x; + int bg_y; + if (OpenTaiko.ConfigIni.nPlayerCount == 5) { + bg_x = OpenTaiko.Skin.Game_Taiko_Background_5P[0] + (OpenTaiko.Skin.Game_UIMove_5P[0] * i); + bg_y = OpenTaiko.Skin.Game_Taiko_Background_5P[1] + (OpenTaiko.Skin.Game_UIMove_5P[1] * i); + } else if (OpenTaiko.ConfigIni.nPlayerCount == 4 || OpenTaiko.ConfigIni.nPlayerCount == 3) { + bg_x = OpenTaiko.Skin.Game_Taiko_Background_4P[0] + (OpenTaiko.Skin.Game_UIMove_4P[0] * i); + bg_y = OpenTaiko.Skin.Game_Taiko_Background_4P[1] + (OpenTaiko.Skin.Game_UIMove_4P[1] * i); + } else { + bg_x = OpenTaiko.Skin.Game_Taiko_Background_X[i]; + bg_y = OpenTaiko.Skin.Game_Taiko_Background_Y[i]; } + CTexture tex = null; - //this.nHS = TJAPlayer3.ConfigIni.nScrollSpeed.Drums < 8 ? TJAPlayer3.ConfigIni.nScrollSpeed.Drums : 7; - - - - for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { - int bg_x; - int bg_y; - if (OpenTaiko.ConfigIni.nPlayerCount == 5) { - bg_x = OpenTaiko.Skin.Game_Taiko_Background_5P[0] + (OpenTaiko.Skin.Game_UIMove_5P[0] * i); - bg_y = OpenTaiko.Skin.Game_Taiko_Background_5P[1] + (OpenTaiko.Skin.Game_UIMove_5P[1] * i); - } else if (OpenTaiko.ConfigIni.nPlayerCount == 4 || OpenTaiko.ConfigIni.nPlayerCount == 3) { - bg_x = OpenTaiko.Skin.Game_Taiko_Background_4P[0] + (OpenTaiko.Skin.Game_UIMove_4P[0] * i); - bg_y = OpenTaiko.Skin.Game_Taiko_Background_4P[1] + (OpenTaiko.Skin.Game_UIMove_4P[1] * i); - } else { - bg_x = OpenTaiko.Skin.Game_Taiko_Background_X[i]; - bg_y = OpenTaiko.Skin.Game_Taiko_Background_Y[i]; - } - - CTexture tex = null; - - switch (i) { - case 0: { - if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) { - tex = OpenTaiko.Tx.Taiko_Background[2]; - } else if (OpenTaiko.ConfigIni.bTokkunMode) { - if (OpenTaiko.P1IsBlue()) - tex = OpenTaiko.Tx.Taiko_Background[6]; - else - tex = OpenTaiko.Tx.Taiko_Background[5]; - } else { - if (OpenTaiko.P1IsBlue()) - tex = OpenTaiko.Tx.Taiko_Background[4]; - else - tex = OpenTaiko.Tx.Taiko_Background[0]; - } + switch (i) { + case 0: { + if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) { + tex = OpenTaiko.Tx.Taiko_Background[2]; + } else if (OpenTaiko.ConfigIni.bTokkunMode) { + if (OpenTaiko.P1IsBlue()) + tex = OpenTaiko.Tx.Taiko_Background[6]; + else + tex = OpenTaiko.Tx.Taiko_Background[5]; + } else { + if (OpenTaiko.P1IsBlue()) + tex = OpenTaiko.Tx.Taiko_Background[4]; + else + tex = OpenTaiko.Tx.Taiko_Background[0]; } - break; - case 1: { - if (OpenTaiko.ConfigIni.bAIBattleMode) { - tex = OpenTaiko.Tx.Taiko_Background[9]; - } else { - if (OpenTaiko.ConfigIni.nPlayerCount == 2) - tex = OpenTaiko.Tx.Taiko_Background[1]; - else - tex = OpenTaiko.Tx.Taiko_Background[4]; - } + } + break; + case 1: { + if (OpenTaiko.ConfigIni.bAIBattleMode) { + tex = OpenTaiko.Tx.Taiko_Background[9]; + } else { + if (OpenTaiko.ConfigIni.nPlayerCount == 2) + tex = OpenTaiko.Tx.Taiko_Background[1]; + else + tex = OpenTaiko.Tx.Taiko_Background[4]; } - break; - case 2: - tex = OpenTaiko.Tx.Taiko_Background[7]; - break; - case 3: - tex = OpenTaiko.Tx.Taiko_Background[8]; - break; - case 4: - tex = OpenTaiko.Tx.Taiko_Background[11]; - break; - } - - tex?.t2D描画(bg_x, bg_y); - } - /* - if (TJAPlayer3.stage選曲.n確定された曲の難易度[0] == (int)Difficulty.Dan) // Dan-i Dojo - TJAPlayer3.Tx.Taiko_Background[2]?.t2D描画(bg_x[0], bg_y[0]); - else if (TJAPlayer3.stage選曲.n確定された曲の難易度[0] == (int)Difficulty.Tower) // Taiko Towers - TJAPlayer3.Tx.Taiko_Background[3]?.t2D描画(bg_x[0], bg_y[0]); - else if (!TJAPlayer3.ConfigIni.bTokkunMode - || TJAPlayer3.Tx.Taiko_Background[5] == null - || TJAPlayer3.Tx.Taiko_Background[6] == null) - { - // Taiko Mode - if (TJAPlayer3.stage演奏ドラム画面.bDoublePlay) - { - if (TJAPlayer3.ConfigIni.nPlayerCount == 2) - { - // 2P - if (!TJAPlayer3.ConfigIni.bAIBattleMode || TJAPlayer3.Tx.Taiko_Background[9] == null) - TJAPlayer3.Tx.Taiko_Background[1]?.t2D描画(bg_x[1], bg_y[1]); - else - TJAPlayer3.Tx.Taiko_Background[9]?.t2D描画(bg_x[1], bg_y[1]); - } - else - { - if (TJAPlayer3.ConfigIni.nPlayerCount >= 2) - TJAPlayer3.Tx.Taiko_Background[4]?.t2D描画(bg_x[1], bg_y[1]); - if (TJAPlayer3.ConfigIni.nPlayerCount >= 3) - TJAPlayer3.Tx.Taiko_Background[7]?.t2D描画(bg_x[2], bg_y[2]); - if (TJAPlayer3.ConfigIni.nPlayerCount >= 4) - TJAPlayer3.Tx.Taiko_Background[8]?.t2D描画(bg_x[3], bg_y[3]); - if (TJAPlayer3.ConfigIni.nPlayerCount >= 5) - TJAPlayer3.Tx.Taiko_Background[11]?.t2D描画(bg_x[4], bg_y[4]); - } - } - if (TJAPlayer3.P1IsBlue()) - TJAPlayer3.Tx.Taiko_Background[4]?.t2D描画(bg_x[0], bg_y[0]); - else - TJAPlayer3.Tx.Taiko_Background[0]?.t2D描画(bg_x[0], bg_y[0]); - } - else - { - // Training Mode - if (TJAPlayer3.P1IsBlue()) - TJAPlayer3.Tx.Taiko_Background[6]?.t2D描画(bg_x[0], bg_y[0]); - else - TJAPlayer3.Tx.Taiko_Background[5]?.t2D描画(bg_x[0], bg_y[0]); - } - */ - - int getMTaikoOpacity(int brightness) { - if (OpenTaiko.ConfigIni.SimpleMode) { - return brightness <= 0 ? 0 : 255; - } else { - return brightness * 73; - } - } - - for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { - int taiko_x; - int taiko_y; - if (OpenTaiko.ConfigIni.nPlayerCount == 5) { - taiko_x = OpenTaiko.Skin.Game_Taiko_5P[0] + (OpenTaiko.Skin.Game_UIMove_5P[0] * i); - taiko_y = OpenTaiko.Skin.Game_Taiko_5P[1] + (OpenTaiko.Skin.Game_UIMove_5P[1] * i); - } else if (OpenTaiko.ConfigIni.nPlayerCount == 4 || OpenTaiko.ConfigIni.nPlayerCount == 3) { - taiko_x = OpenTaiko.Skin.Game_Taiko_4P[0] + (OpenTaiko.Skin.Game_UIMove_4P[0] * i); - taiko_y = OpenTaiko.Skin.Game_Taiko_4P[1] + (OpenTaiko.Skin.Game_UIMove_4P[1] * i); - } else { - taiko_x = OpenTaiko.Skin.Game_Taiko_X[i]; - taiko_y = OpenTaiko.Skin.Game_Taiko_Y[i]; - } - - int _actual = OpenTaiko.GetActualPlayer(i); - EGameType _gt = OpenTaiko.ConfigIni.nGameType[_actual]; - int playerShift = i * 5; - - // Drum base - OpenTaiko.Tx.Taiko_Base[(int)_gt]?.t2D描画(taiko_x, taiko_y); - - // Taiko hits - if (_gt == EGameType.Taiko) { - if (OpenTaiko.Tx.Taiko_Don_Left != null && OpenTaiko.Tx.Taiko_Don_Right != null && OpenTaiko.Tx.Taiko_Ka_Left != null && OpenTaiko.Tx.Taiko_Ka_Right != null) { - OpenTaiko.Tx.Taiko_Ka_Left.Opacity = getMTaikoOpacity(this.stパッド状態[playerShift].n明るさ); - OpenTaiko.Tx.Taiko_Ka_Right.Opacity = getMTaikoOpacity(this.stパッド状態[1 + playerShift].n明るさ); - OpenTaiko.Tx.Taiko_Don_Left.Opacity = getMTaikoOpacity(this.stパッド状態[2 + playerShift].n明るさ); - OpenTaiko.Tx.Taiko_Don_Right.Opacity = getMTaikoOpacity(this.stパッド状態[3 + playerShift].n明るさ); - - OpenTaiko.Tx.Taiko_Ka_Left.t2D描画(taiko_x, taiko_y, new Rectangle(0, 0, OpenTaiko.Tx.Taiko_Ka_Right.szTextureSize.Width / 2, OpenTaiko.Tx.Taiko_Ka_Right.szTextureSize.Height)); - OpenTaiko.Tx.Taiko_Ka_Right.t2D描画(taiko_x + OpenTaiko.Tx.Taiko_Ka_Right.szTextureSize.Width / 2, taiko_y, new Rectangle(OpenTaiko.Tx.Taiko_Ka_Right.szTextureSize.Width / 2, 0, OpenTaiko.Tx.Taiko_Ka_Right.szTextureSize.Width / 2, OpenTaiko.Tx.Taiko_Ka_Right.szTextureSize.Height)); - OpenTaiko.Tx.Taiko_Don_Left.t2D描画(taiko_x, taiko_y, new Rectangle(0, 0, OpenTaiko.Tx.Taiko_Ka_Right.szTextureSize.Width / 2, OpenTaiko.Tx.Taiko_Ka_Right.szTextureSize.Height)); - OpenTaiko.Tx.Taiko_Don_Right.t2D描画(taiko_x + OpenTaiko.Tx.Taiko_Ka_Right.szTextureSize.Width / 2, taiko_y, new Rectangle(OpenTaiko.Tx.Taiko_Ka_Right.szTextureSize.Width / 2, 0, OpenTaiko.Tx.Taiko_Ka_Right.szTextureSize.Width / 2, OpenTaiko.Tx.Taiko_Ka_Right.szTextureSize.Height)); } - } else if (_gt == EGameType.Konga) { - if (OpenTaiko.Tx.Taiko_Konga_Clap != null && OpenTaiko.Tx.Taiko_Konga_Don != null && OpenTaiko.Tx.Taiko_Konga_Ka != null) { - OpenTaiko.Tx.Taiko_Konga_Clap.Opacity = getMTaikoOpacity(this.stパッド状態[4 + playerShift].n明るさ); - OpenTaiko.Tx.Taiko_Konga_Don.Opacity = getMTaikoOpacity(Math.Max(this.stパッド状態[2 + playerShift].n明るさ, this.stパッド状態[3 + playerShift].n明るさ)); - OpenTaiko.Tx.Taiko_Konga_Ka.Opacity = getMTaikoOpacity(Math.Max(this.stパッド状態[playerShift].n明るさ, this.stパッド状態[1 + playerShift].n明るさ)); - - OpenTaiko.Tx.Taiko_Konga_Ka.t2D描画(taiko_x, taiko_y); - OpenTaiko.Tx.Taiko_Konga_Don.t2D描画(taiko_x, taiko_y); - OpenTaiko.Tx.Taiko_Konga_Clap.t2D描画(taiko_x, taiko_y); - } - } - - } - - - int[] nLVUPY = new int[] { 127, 127, 0, 0 }; - - for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { - if (OpenTaiko.ConfigIni.nPlayerCount > 2 || OpenTaiko.ConfigIni.SimpleMode) break; - - if (!this.ctレベルアップダウン[i].IsStoped) { - this.ctレベルアップダウン[i].Tick(); - if (this.ctレベルアップダウン[i].IsEnded) { - this.ctレベルアップダウン[i].Stop(); - } - } - if ((this.ctレベルアップダウン[i].IsTicked && (OpenTaiko.Tx.Taiko_LevelUp != null && OpenTaiko.Tx.Taiko_LevelDown != null)) && !OpenTaiko.ConfigIni.bNoInfo) { - //this.ctレベルアップダウン[ i ].n現在の値 = 110; - - //2017.08.21 kairera0467 t3D描画に変更。 - float fScale = 1.0f; - int nAlpha = 255; - float[] fY = new float[] { 206, -206, 0, 0 }; - if (this.ctレベルアップダウン[i].CurrentValue >= 0 && this.ctレベルアップダウン[i].CurrentValue <= 20) { - nAlpha = 60; - fScale = 1.14f; - } else if (this.ctレベルアップダウン[i].CurrentValue >= 21 && this.ctレベルアップダウン[i].CurrentValue <= 40) { - nAlpha = 60; - fScale = 1.19f; - } else if (this.ctレベルアップダウン[i].CurrentValue >= 41 && this.ctレベルアップダウン[i].CurrentValue <= 60) { - nAlpha = 220; - fScale = 1.23f; - } else if (this.ctレベルアップダウン[i].CurrentValue >= 61 && this.ctレベルアップダウン[i].CurrentValue <= 80) { - nAlpha = 230; - fScale = 1.19f; - } else if (this.ctレベルアップダウン[i].CurrentValue >= 81 && this.ctレベルアップダウン[i].CurrentValue <= 100) { - nAlpha = 240; - fScale = 1.14f; - } else if (this.ctレベルアップダウン[i].CurrentValue >= 101 && this.ctレベルアップダウン[i].CurrentValue <= 120) { - nAlpha = 255; - fScale = 1.04f; - } else { - nAlpha = 255; - fScale = 1.0f; - } - - if (OpenTaiko.ConfigIni.nPlayerCount > 2) continue; - - int levelChange_x = OpenTaiko.Skin.Game_Taiko_LevelChange_X[i]; - int levelChange_y = OpenTaiko.Skin.Game_Taiko_LevelChange_Y[i]; - - if (this.After[i] - this.Before[i] >= 0) { - //レベルアップ - OpenTaiko.Tx.Taiko_LevelUp.vcScaleRatio.X = fScale; - OpenTaiko.Tx.Taiko_LevelUp.vcScaleRatio.Y = fScale; - OpenTaiko.Tx.Taiko_LevelUp.Opacity = nAlpha; - OpenTaiko.Tx.Taiko_LevelUp.t2D拡大率考慮中央基準描画(levelChange_x, - levelChange_y); - } else { - OpenTaiko.Tx.Taiko_LevelDown.vcScaleRatio.X = fScale; - OpenTaiko.Tx.Taiko_LevelDown.vcScaleRatio.Y = fScale; - OpenTaiko.Tx.Taiko_LevelDown.Opacity = nAlpha; - OpenTaiko.Tx.Taiko_LevelDown.t2D拡大率考慮中央基準描画(levelChange_x, - levelChange_y); - } - } - } - - for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { - if (OpenTaiko.ConfigIni.bAIBattleMode && i == 1) break; - - - int modIcons_x; - int modIcons_y; - int couse_symbol_x; - int couse_symbol_y; - if (OpenTaiko.ConfigIni.nPlayerCount == 5) { - modIcons_x = OpenTaiko.Skin.Game_Taiko_ModIcons_5P[0] + (OpenTaiko.Skin.Game_UIMove_5P[0] * i); - modIcons_y = OpenTaiko.Skin.Game_Taiko_ModIcons_5P[1] + (OpenTaiko.Skin.Game_UIMove_5P[1] * i); - - couse_symbol_x = OpenTaiko.Skin.Game_CourseSymbol_5P[0] + (OpenTaiko.Skin.Game_UIMove_5P[0] * i); - couse_symbol_y = OpenTaiko.Skin.Game_CourseSymbol_5P[1] + (OpenTaiko.Skin.Game_UIMove_5P[1] * i); - } else if (OpenTaiko.ConfigIni.nPlayerCount == 4 || OpenTaiko.ConfigIni.nPlayerCount == 3) { - modIcons_x = OpenTaiko.Skin.Game_Taiko_ModIcons_4P[0] + (OpenTaiko.Skin.Game_UIMove_4P[0] * i); - modIcons_y = OpenTaiko.Skin.Game_Taiko_ModIcons_4P[1] + (OpenTaiko.Skin.Game_UIMove_4P[1] * i); - - couse_symbol_x = OpenTaiko.Skin.Game_CourseSymbol_4P[0] + (OpenTaiko.Skin.Game_UIMove_4P[0] * i); - couse_symbol_y = OpenTaiko.Skin.Game_CourseSymbol_4P[1] + (OpenTaiko.Skin.Game_UIMove_4P[1] * i); - } else { - modIcons_x = OpenTaiko.Skin.Game_Taiko_ModIcons_X[i]; - modIcons_y = OpenTaiko.Skin.Game_Taiko_ModIcons_Y[i]; - - couse_symbol_x = OpenTaiko.Skin.Game_CourseSymbol_X[i]; - couse_symbol_y = OpenTaiko.Skin.Game_CourseSymbol_Y[i]; - } - - ModIcons.tDisplayMods(modIcons_x, modIcons_y, i); - - if (OpenTaiko.Tx.Couse_Symbol[OpenTaiko.stageSongSelect.nChoosenSongDifficulty[i]] != null) { - OpenTaiko.Tx.Couse_Symbol[OpenTaiko.stageSongSelect.nChoosenSongDifficulty[i]].t2D描画( - couse_symbol_x, - couse_symbol_y - ); - } - - - if (OpenTaiko.ConfigIni.ShinuchiMode) { - if (OpenTaiko.Tx.Couse_Symbol[(int)Difficulty.Total] != null) { - OpenTaiko.Tx.Couse_Symbol[(int)Difficulty.Total].t2D描画( - couse_symbol_x, - couse_symbol_y - ); - } - - } - } - - for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { - int namePlate_x; - int namePlate_y; - int playerNumber_x; - int playerNumber_y; - if (OpenTaiko.ConfigIni.nPlayerCount == 5) { - namePlate_x = OpenTaiko.Skin.Game_Taiko_NamePlate_5P[0] + (OpenTaiko.Skin.Game_UIMove_5P[0] * i); - namePlate_y = OpenTaiko.Skin.Game_Taiko_NamePlate_5P[1] + (OpenTaiko.Skin.Game_UIMove_5P[1] * i); - - playerNumber_x = OpenTaiko.Skin.Game_Taiko_PlayerNumber_5P[0] + (OpenTaiko.Skin.Game_UIMove_5P[0] * i); - playerNumber_y = OpenTaiko.Skin.Game_Taiko_PlayerNumber_5P[1] + (OpenTaiko.Skin.Game_UIMove_5P[1] * i); - } else if (OpenTaiko.ConfigIni.nPlayerCount == 4 || OpenTaiko.ConfigIni.nPlayerCount == 3) { - namePlate_x = OpenTaiko.Skin.Game_Taiko_NamePlate_4P[0] + (OpenTaiko.Skin.Game_UIMove_4P[0] * i); - namePlate_y = OpenTaiko.Skin.Game_Taiko_NamePlate_4P[1] + (OpenTaiko.Skin.Game_UIMove_4P[1] * i); - - playerNumber_x = OpenTaiko.Skin.Game_Taiko_PlayerNumber_4P[0] + (OpenTaiko.Skin.Game_UIMove_4P[0] * i); - playerNumber_y = OpenTaiko.Skin.Game_Taiko_PlayerNumber_4P[1] + (OpenTaiko.Skin.Game_UIMove_4P[1] * i); - } else { - namePlate_x = OpenTaiko.Skin.Game_Taiko_NamePlate_X[i]; - namePlate_y = OpenTaiko.Skin.Game_Taiko_NamePlate_Y[i]; - - playerNumber_x = OpenTaiko.Skin.Game_Taiko_PlayerNumber_X[i]; - playerNumber_y = OpenTaiko.Skin.Game_Taiko_PlayerNumber_Y[i]; - } - - OpenTaiko.NamePlate.tNamePlateDraw(namePlate_x, namePlate_y, i); - - if (OpenTaiko.Tx.Taiko_PlayerNumber[i] != null) { - OpenTaiko.Tx.Taiko_PlayerNumber[i].t2D描画(playerNumber_x, playerNumber_y); - } - } - return base.Draw(); - } - - public void tMtaikoEvent(int nChannel, int nHand, int nPlayer) { - CConfigIni configIni = OpenTaiko.ConfigIni; - bool bAutoPlay = configIni.bAutoPlay[nPlayer]; - int playerShift = 5 * nPlayer; - var _gt = configIni.nGameType[OpenTaiko.GetActualPlayer(nPlayer)]; - - switch (nPlayer) { - case 1: - bAutoPlay = configIni.bAutoPlay[nPlayer] || OpenTaiko.ConfigIni.bAIBattleMode; + break; + case 2: + tex = OpenTaiko.Tx.Taiko_Background[7]; + break; + case 3: + tex = OpenTaiko.Tx.Taiko_Background[8]; + break; + case 4: + tex = OpenTaiko.Tx.Taiko_Background[11]; break; } - if (!bAutoPlay) { - switch (nChannel) { - case 0x11: - case 0x13: - case 0x15: - case 0x16: - case 0x17: { - this.stパッド状態[2 + nHand + playerShift].n明るさ = 8; - } - break; - case 0x12: { - this.stパッド状態[nHand + playerShift].n明るさ = 8; - } - break; - case 0x14: { - if (_gt == EGameType.Konga) { - this.stパッド状態[4 + playerShift].n明るさ = 8; - } else { - this.stパッド状態[nHand + playerShift].n明るさ = 8; - } - } - break; + tex?.t2D描画(bg_x, bg_y); + } + /* + if (TJAPlayer3.stage選曲.n確定された曲の難易度[0] == (int)Difficulty.Dan) // Dan-i Dojo + TJAPlayer3.Tx.Taiko_Background[2]?.t2D描画(bg_x[0], bg_y[0]); + else if (TJAPlayer3.stage選曲.n確定された曲の難易度[0] == (int)Difficulty.Tower) // Taiko Towers + TJAPlayer3.Tx.Taiko_Background[3]?.t2D描画(bg_x[0], bg_y[0]); + else if (!TJAPlayer3.ConfigIni.bTokkunMode + || TJAPlayer3.Tx.Taiko_Background[5] == null + || TJAPlayer3.Tx.Taiko_Background[6] == null) + { + // Taiko Mode + if (TJAPlayer3.stage演奏ドラム画面.bDoublePlay) + { + if (TJAPlayer3.ConfigIni.nPlayerCount == 2) + { + // 2P + if (!TJAPlayer3.ConfigIni.bAIBattleMode || TJAPlayer3.Tx.Taiko_Background[9] == null) + TJAPlayer3.Tx.Taiko_Background[1]?.t2D描画(bg_x[1], bg_y[1]); + else + TJAPlayer3.Tx.Taiko_Background[9]?.t2D描画(bg_x[1], bg_y[1]); + } + else + { + if (TJAPlayer3.ConfigIni.nPlayerCount >= 2) + TJAPlayer3.Tx.Taiko_Background[4]?.t2D描画(bg_x[1], bg_y[1]); + if (TJAPlayer3.ConfigIni.nPlayerCount >= 3) + TJAPlayer3.Tx.Taiko_Background[7]?.t2D描画(bg_x[2], bg_y[2]); + if (TJAPlayer3.ConfigIni.nPlayerCount >= 4) + TJAPlayer3.Tx.Taiko_Background[8]?.t2D描画(bg_x[3], bg_y[3]); + if (TJAPlayer3.ConfigIni.nPlayerCount >= 5) + TJAPlayer3.Tx.Taiko_Background[11]?.t2D描画(bg_x[4], bg_y[4]); + } + } + if (TJAPlayer3.P1IsBlue()) + TJAPlayer3.Tx.Taiko_Background[4]?.t2D描画(bg_x[0], bg_y[0]); + else + TJAPlayer3.Tx.Taiko_Background[0]?.t2D描画(bg_x[0], bg_y[0]); + } + else + { + // Training Mode + if (TJAPlayer3.P1IsBlue()) + TJAPlayer3.Tx.Taiko_Background[6]?.t2D描画(bg_x[0], bg_y[0]); + else + TJAPlayer3.Tx.Taiko_Background[5]?.t2D描画(bg_x[0], bg_y[0]); + } + */ - } + int getMTaikoOpacity(int brightness) { + if (OpenTaiko.ConfigIni.SimpleMode) { + return brightness <= 0 ? 0 : 255; } else { - switch (nChannel) { - case 0x11: - case 0x15: - case 0x16: - case 0x17: - case 0x1F: { - this.stパッド状態[2 + nHand + playerShift].n明るさ = 8; - } - break; + return brightness * 73; + } + } - case 0x13: - case 0x1A: { - if (_gt == EGameType.Konga) { - this.stパッド状態[0 + playerShift].n明るさ = 8; - this.stパッド状態[2 + playerShift].n明るさ = 8; - } else { - this.stパッド状態[2 + playerShift].n明るさ = 8; - this.stパッド状態[3 + playerShift].n明るさ = 8; - } - } - break; + for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { + int taiko_x; + int taiko_y; + if (OpenTaiko.ConfigIni.nPlayerCount == 5) { + taiko_x = OpenTaiko.Skin.Game_Taiko_5P[0] + (OpenTaiko.Skin.Game_UIMove_5P[0] * i); + taiko_y = OpenTaiko.Skin.Game_Taiko_5P[1] + (OpenTaiko.Skin.Game_UIMove_5P[1] * i); + } else if (OpenTaiko.ConfigIni.nPlayerCount == 4 || OpenTaiko.ConfigIni.nPlayerCount == 3) { + taiko_x = OpenTaiko.Skin.Game_Taiko_4P[0] + (OpenTaiko.Skin.Game_UIMove_4P[0] * i); + taiko_y = OpenTaiko.Skin.Game_Taiko_4P[1] + (OpenTaiko.Skin.Game_UIMove_4P[1] * i); + } else { + taiko_x = OpenTaiko.Skin.Game_Taiko_X[i]; + taiko_y = OpenTaiko.Skin.Game_Taiko_Y[i]; + } - case 0x12: { - this.stパッド状態[nHand + playerShift].n明るさ = 8; - } - break; + int _actual = OpenTaiko.GetActualPlayer(i); + EGameType _gt = OpenTaiko.ConfigIni.nGameType[_actual]; + int playerShift = i * 5; - case 0x14: - case 0x1B: { - if (_gt == EGameType.Konga) { - this.stパッド状態[4 + playerShift].n明るさ = 8; - } else { - this.stパッド状態[0 + playerShift].n明るさ = 8; - this.stパッド状態[1 + playerShift].n明るさ = 8; - } + // Drum base + OpenTaiko.Tx.Taiko_Base[(int)_gt]?.t2D描画(taiko_x, taiko_y); - } - break; + // Taiko hits + if (_gt == EGameType.Taiko) { + if (OpenTaiko.Tx.Taiko_Don_Left != null && OpenTaiko.Tx.Taiko_Don_Right != null && OpenTaiko.Tx.Taiko_Ka_Left != null && OpenTaiko.Tx.Taiko_Ka_Right != null) { + OpenTaiko.Tx.Taiko_Ka_Left.Opacity = getMTaikoOpacity(this.stパッド状態[playerShift].n明るさ); + OpenTaiko.Tx.Taiko_Ka_Right.Opacity = getMTaikoOpacity(this.stパッド状態[1 + playerShift].n明るさ); + OpenTaiko.Tx.Taiko_Don_Left.Opacity = getMTaikoOpacity(this.stパッド状態[2 + playerShift].n明るさ); + OpenTaiko.Tx.Taiko_Don_Right.Opacity = getMTaikoOpacity(this.stパッド状態[3 + playerShift].n明るさ); - case 0x101: { - this.stパッド状態[nHand + playerShift].n明るさ = 8; - this.stパッド状態[2 + (nHand == 0 ? 1 : 0) + playerShift].n明るさ = 8; - break; - } + OpenTaiko.Tx.Taiko_Ka_Left.t2D描画(taiko_x, taiko_y, new Rectangle(0, 0, OpenTaiko.Tx.Taiko_Ka_Right.szTextureSize.Width / 2, OpenTaiko.Tx.Taiko_Ka_Right.szTextureSize.Height)); + OpenTaiko.Tx.Taiko_Ka_Right.t2D描画(taiko_x + OpenTaiko.Tx.Taiko_Ka_Right.szTextureSize.Width / 2, taiko_y, new Rectangle(OpenTaiko.Tx.Taiko_Ka_Right.szTextureSize.Width / 2, 0, OpenTaiko.Tx.Taiko_Ka_Right.szTextureSize.Width / 2, OpenTaiko.Tx.Taiko_Ka_Right.szTextureSize.Height)); + OpenTaiko.Tx.Taiko_Don_Left.t2D描画(taiko_x, taiko_y, new Rectangle(0, 0, OpenTaiko.Tx.Taiko_Ka_Right.szTextureSize.Width / 2, OpenTaiko.Tx.Taiko_Ka_Right.szTextureSize.Height)); + OpenTaiko.Tx.Taiko_Don_Right.t2D描画(taiko_x + OpenTaiko.Tx.Taiko_Ka_Right.szTextureSize.Width / 2, taiko_y, new Rectangle(OpenTaiko.Tx.Taiko_Ka_Right.szTextureSize.Width / 2, 0, OpenTaiko.Tx.Taiko_Ka_Right.szTextureSize.Width / 2, OpenTaiko.Tx.Taiko_Ka_Right.szTextureSize.Height)); + } + } else if (_gt == EGameType.Konga) { + if (OpenTaiko.Tx.Taiko_Konga_Clap != null && OpenTaiko.Tx.Taiko_Konga_Don != null && OpenTaiko.Tx.Taiko_Konga_Ka != null) { + OpenTaiko.Tx.Taiko_Konga_Clap.Opacity = getMTaikoOpacity(this.stパッド状態[4 + playerShift].n明るさ); + OpenTaiko.Tx.Taiko_Konga_Don.Opacity = getMTaikoOpacity(Math.Max(this.stパッド状態[2 + playerShift].n明るさ, this.stパッド状態[3 + playerShift].n明るさ)); + OpenTaiko.Tx.Taiko_Konga_Ka.Opacity = getMTaikoOpacity(Math.Max(this.stパッド状態[playerShift].n明るさ, this.stパッド状態[1 + playerShift].n明るさ)); + + OpenTaiko.Tx.Taiko_Konga_Ka.t2D描画(taiko_x, taiko_y); + OpenTaiko.Tx.Taiko_Konga_Don.t2D描画(taiko_x, taiko_y); + OpenTaiko.Tx.Taiko_Konga_Clap.t2D描画(taiko_x, taiko_y); } } } - public void tBranchEvent(CDTX.ECourse Before, CDTX.ECourse After, int player) { - if (After != Before) - this.ctレベルアップダウン[player] = new CCounter(0, 1000, 1, OpenTaiko.Timer); - this.After[player] = After; - this.Before[player] = Before; - } + int[] nLVUPY = new int[] { 127, 127, 0, 0 }; + for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { + if (OpenTaiko.ConfigIni.nPlayerCount > 2 || OpenTaiko.ConfigIni.SimpleMode) break; - public void BackSymbolEvent(int player) { - ctSymbolFlash[player] = new CCounter(0, 1000, 0.2f, OpenTaiko.Timer); - } + if (!this.ctレベルアップダウン[i].IsStoped) { + this.ctレベルアップダウン[i].Tick(); + if (this.ctレベルアップダウン[i].IsEnded) { + this.ctレベルアップダウン[i].Stop(); + } + } + if ((this.ctレベルアップダウン[i].IsTicked && (OpenTaiko.Tx.Taiko_LevelUp != null && OpenTaiko.Tx.Taiko_LevelDown != null)) && !OpenTaiko.ConfigIni.bNoInfo) { + //this.ctレベルアップダウン[ i ].n現在の値 = 110; - public void DrawBackSymbol() { - for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { - ctSymbolFlash[i].Tick(); - - int couse_symbol_x; - int couse_symbol_y; - if (OpenTaiko.ConfigIni.nPlayerCount == 5) { - couse_symbol_x = OpenTaiko.Skin.Game_CourseSymbol_Back_5P[0] + (OpenTaiko.Skin.Game_UIMove_5P[0] * i); - couse_symbol_y = OpenTaiko.Skin.Game_CourseSymbol_Back_5P[1] + (OpenTaiko.Skin.Game_UIMove_5P[1] * i); - } else if (OpenTaiko.ConfigIni.nPlayerCount == 4 || OpenTaiko.ConfigIni.nPlayerCount == 3) { - couse_symbol_x = OpenTaiko.Skin.Game_CourseSymbol_Back_4P[0] + (OpenTaiko.Skin.Game_UIMove_4P[0] * i); - couse_symbol_y = OpenTaiko.Skin.Game_CourseSymbol_Back_4P[1] + (OpenTaiko.Skin.Game_UIMove_4P[1] * i); + //2017.08.21 kairera0467 t3D描画に変更。 + float fScale = 1.0f; + int nAlpha = 255; + float[] fY = new float[] { 206, -206, 0, 0 }; + if (this.ctレベルアップダウン[i].CurrentValue >= 0 && this.ctレベルアップダウン[i].CurrentValue <= 20) { + nAlpha = 60; + fScale = 1.14f; + } else if (this.ctレベルアップダウン[i].CurrentValue >= 21 && this.ctレベルアップダウン[i].CurrentValue <= 40) { + nAlpha = 60; + fScale = 1.19f; + } else if (this.ctレベルアップダウン[i].CurrentValue >= 41 && this.ctレベルアップダウン[i].CurrentValue <= 60) { + nAlpha = 220; + fScale = 1.23f; + } else if (this.ctレベルアップダウン[i].CurrentValue >= 61 && this.ctレベルアップダウン[i].CurrentValue <= 80) { + nAlpha = 230; + fScale = 1.19f; + } else if (this.ctレベルアップダウン[i].CurrentValue >= 81 && this.ctレベルアップダウン[i].CurrentValue <= 100) { + nAlpha = 240; + fScale = 1.14f; + } else if (this.ctレベルアップダウン[i].CurrentValue >= 101 && this.ctレベルアップダウン[i].CurrentValue <= 120) { + nAlpha = 255; + fScale = 1.04f; } else { - couse_symbol_x = OpenTaiko.Skin.Game_CourseSymbol_Back_X[i]; - couse_symbol_y = OpenTaiko.Skin.Game_CourseSymbol_Back_Y[i]; + nAlpha = 255; + fScale = 1.0f; } + if (OpenTaiko.ConfigIni.nPlayerCount > 2) continue; - if (OpenTaiko.Tx.Couse_Symbol_Back[OpenTaiko.stageSongSelect.nChoosenSongDifficulty[i]] != null) { - int originX = 0; - int originY = 0; - int width = OpenTaiko.Tx.Couse_Symbol_Back[OpenTaiko.stageSongSelect.nChoosenSongDifficulty[i]].szTextureSize.Width; - int height = OpenTaiko.Tx.Couse_Symbol_Back[OpenTaiko.stageSongSelect.nChoosenSongDifficulty[i]].szTextureSize.Height; + int levelChange_x = OpenTaiko.Skin.Game_Taiko_LevelChange_X[i]; + int levelChange_y = OpenTaiko.Skin.Game_Taiko_LevelChange_Y[i]; - if (OpenTaiko.ConfigIni.nPlayerCount == 5) { - originX = OpenTaiko.Skin.Game_CourseSymbol_Back_Rect_5P[0]; - originY = OpenTaiko.Skin.Game_CourseSymbol_Back_Rect_5P[1]; - width = OpenTaiko.Skin.Game_CourseSymbol_Back_Rect_5P[2]; - height = OpenTaiko.Skin.Game_CourseSymbol_Back_Rect_5P[3]; - } else if (OpenTaiko.ConfigIni.nPlayerCount > 2) { - originX = OpenTaiko.Skin.Game_CourseSymbol_Back_Rect_4P[0]; - originY = OpenTaiko.Skin.Game_CourseSymbol_Back_Rect_4P[1]; - width = OpenTaiko.Skin.Game_CourseSymbol_Back_Rect_4P[2]; - height = OpenTaiko.Skin.Game_CourseSymbol_Back_Rect_4P[3]; - } - - OpenTaiko.Tx.Couse_Symbol_Back[OpenTaiko.stageSongSelect.nChoosenSongDifficulty[i]].t2D描画( - couse_symbol_x, - couse_symbol_y, - new System.Drawing.RectangleF(originX, originY, width, height)); - } - - if (OpenTaiko.Tx.Couse_Symbol_Back_Flash[OpenTaiko.stageSongSelect.nChoosenSongDifficulty[i]] != null && !OpenTaiko.ConfigIni.SimpleMode) { - int originX = 0; - int originY = 0; - int width = OpenTaiko.Tx.Couse_Symbol_Back[OpenTaiko.stageSongSelect.nChoosenSongDifficulty[i]].szTextureSize.Width; - int height = OpenTaiko.Tx.Couse_Symbol_Back[OpenTaiko.stageSongSelect.nChoosenSongDifficulty[i]].szTextureSize.Height; - - if (OpenTaiko.ConfigIni.nPlayerCount == 5) { - originX = OpenTaiko.Skin.Game_CourseSymbol_Back_Rect_5P[0]; - originY = OpenTaiko.Skin.Game_CourseSymbol_Back_Rect_5P[1]; - width = OpenTaiko.Skin.Game_CourseSymbol_Back_Rect_5P[2]; - height = OpenTaiko.Skin.Game_CourseSymbol_Back_Rect_5P[3]; - } else if (OpenTaiko.ConfigIni.nPlayerCount > 2) { - originX = OpenTaiko.Skin.Game_CourseSymbol_Back_Rect_4P[0]; - originY = OpenTaiko.Skin.Game_CourseSymbol_Back_Rect_4P[1]; - width = OpenTaiko.Skin.Game_CourseSymbol_Back_Rect_4P[2]; - height = OpenTaiko.Skin.Game_CourseSymbol_Back_Rect_4P[3]; - } - - OpenTaiko.Tx.Couse_Symbol_Back_Flash[OpenTaiko.stageSongSelect.nChoosenSongDifficulty[i]].Opacity = 255 - (int)((ctSymbolFlash[i].CurrentValue / 1000.0) * 255); - OpenTaiko.Tx.Couse_Symbol_Back_Flash[OpenTaiko.stageSongSelect.nChoosenSongDifficulty[i]].t2D描画( - couse_symbol_x, - couse_symbol_y, - new System.Drawing.RectangleF(originX, originY, width, height)); + if (this.After[i] - this.Before[i] >= 0) { + //レベルアップ + OpenTaiko.Tx.Taiko_LevelUp.vcScaleRatio.X = fScale; + OpenTaiko.Tx.Taiko_LevelUp.vcScaleRatio.Y = fScale; + OpenTaiko.Tx.Taiko_LevelUp.Opacity = nAlpha; + OpenTaiko.Tx.Taiko_LevelUp.t2D拡大率考慮中央基準描画(levelChange_x, + levelChange_y); + } else { + OpenTaiko.Tx.Taiko_LevelDown.vcScaleRatio.X = fScale; + OpenTaiko.Tx.Taiko_LevelDown.vcScaleRatio.Y = fScale; + OpenTaiko.Tx.Taiko_LevelDown.Opacity = nAlpha; + OpenTaiko.Tx.Taiko_LevelDown.t2D拡大率考慮中央基準描画(levelChange_x, + levelChange_y); } } } + for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { + if (OpenTaiko.ConfigIni.bAIBattleMode && i == 1) break; - #region[ private ] - //----------------- - //構造体 - [StructLayout(LayoutKind.Sequential)] - private struct STパッド状態 { - public int n明るさ; + + int modIcons_x; + int modIcons_y; + int couse_symbol_x; + int couse_symbol_y; + if (OpenTaiko.ConfigIni.nPlayerCount == 5) { + modIcons_x = OpenTaiko.Skin.Game_Taiko_ModIcons_5P[0] + (OpenTaiko.Skin.Game_UIMove_5P[0] * i); + modIcons_y = OpenTaiko.Skin.Game_Taiko_ModIcons_5P[1] + (OpenTaiko.Skin.Game_UIMove_5P[1] * i); + + couse_symbol_x = OpenTaiko.Skin.Game_CourseSymbol_5P[0] + (OpenTaiko.Skin.Game_UIMove_5P[0] * i); + couse_symbol_y = OpenTaiko.Skin.Game_CourseSymbol_5P[1] + (OpenTaiko.Skin.Game_UIMove_5P[1] * i); + } else if (OpenTaiko.ConfigIni.nPlayerCount == 4 || OpenTaiko.ConfigIni.nPlayerCount == 3) { + modIcons_x = OpenTaiko.Skin.Game_Taiko_ModIcons_4P[0] + (OpenTaiko.Skin.Game_UIMove_4P[0] * i); + modIcons_y = OpenTaiko.Skin.Game_Taiko_ModIcons_4P[1] + (OpenTaiko.Skin.Game_UIMove_4P[1] * i); + + couse_symbol_x = OpenTaiko.Skin.Game_CourseSymbol_4P[0] + (OpenTaiko.Skin.Game_UIMove_4P[0] * i); + couse_symbol_y = OpenTaiko.Skin.Game_CourseSymbol_4P[1] + (OpenTaiko.Skin.Game_UIMove_4P[1] * i); + } else { + modIcons_x = OpenTaiko.Skin.Game_Taiko_ModIcons_X[i]; + modIcons_y = OpenTaiko.Skin.Game_Taiko_ModIcons_Y[i]; + + couse_symbol_x = OpenTaiko.Skin.Game_CourseSymbol_X[i]; + couse_symbol_y = OpenTaiko.Skin.Game_CourseSymbol_Y[i]; + } + + ModIcons.tDisplayMods(modIcons_x, modIcons_y, i); + + if (OpenTaiko.Tx.Couse_Symbol[OpenTaiko.stageSongSelect.nChoosenSongDifficulty[i]] != null) { + OpenTaiko.Tx.Couse_Symbol[OpenTaiko.stageSongSelect.nChoosenSongDifficulty[i]].t2D描画( + couse_symbol_x, + couse_symbol_y + ); + } + + + if (OpenTaiko.ConfigIni.ShinuchiMode) { + if (OpenTaiko.Tx.Couse_Symbol[(int)Difficulty.Total] != null) { + OpenTaiko.Tx.Couse_Symbol[(int)Difficulty.Total].t2D描画( + couse_symbol_x, + couse_symbol_y + ); + } + + } } - //太鼓 - private STパッド状態[] stパッド状態 = new STパッド状態[5 * 5]; - private long nフラッシュ制御タイマ; + for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { + int namePlate_x; + int namePlate_y; + int playerNumber_x; + int playerNumber_y; + if (OpenTaiko.ConfigIni.nPlayerCount == 5) { + namePlate_x = OpenTaiko.Skin.Game_Taiko_NamePlate_5P[0] + (OpenTaiko.Skin.Game_UIMove_5P[0] * i); + namePlate_y = OpenTaiko.Skin.Game_Taiko_NamePlate_5P[1] + (OpenTaiko.Skin.Game_UIMove_5P[1] * i); - //private CTexture[] txコースシンボル = new CTexture[ 6 ]; - private string[] strCourseSymbolFileName; + playerNumber_x = OpenTaiko.Skin.Game_Taiko_PlayerNumber_5P[0] + (OpenTaiko.Skin.Game_UIMove_5P[0] * i); + playerNumber_y = OpenTaiko.Skin.Game_Taiko_PlayerNumber_5P[1] + (OpenTaiko.Skin.Game_UIMove_5P[1] * i); + } else if (OpenTaiko.ConfigIni.nPlayerCount == 4 || OpenTaiko.ConfigIni.nPlayerCount == 3) { + namePlate_x = OpenTaiko.Skin.Game_Taiko_NamePlate_4P[0] + (OpenTaiko.Skin.Game_UIMove_4P[0] * i); + namePlate_y = OpenTaiko.Skin.Game_Taiko_NamePlate_4P[1] + (OpenTaiko.Skin.Game_UIMove_4P[1] * i); - //オプション - private CTexture txオプションパネル_HS; - private CTexture txオプションパネル_RANMIR; - private CTexture txオプションパネル_特殊; - private int nHS; + playerNumber_x = OpenTaiko.Skin.Game_Taiko_PlayerNumber_4P[0] + (OpenTaiko.Skin.Game_UIMove_4P[0] * i); + playerNumber_y = OpenTaiko.Skin.Game_Taiko_PlayerNumber_4P[1] + (OpenTaiko.Skin.Game_UIMove_4P[1] * i); + } else { + namePlate_x = OpenTaiko.Skin.Game_Taiko_NamePlate_X[i]; + namePlate_y = OpenTaiko.Skin.Game_Taiko_NamePlate_Y[i]; - //譜面分岐 - private CCounter[] ctレベルアップダウン; - public CDTX.ECourse[] After; - public CDTX.ECourse[] Before; - private CCounter[] ctSymbolFlash = new CCounter[5]; - //----------------- - #endregion + playerNumber_x = OpenTaiko.Skin.Game_Taiko_PlayerNumber_X[i]; + playerNumber_y = OpenTaiko.Skin.Game_Taiko_PlayerNumber_Y[i]; + } + + OpenTaiko.NamePlate.tNamePlateDraw(namePlate_x, namePlate_y, i); + + if (OpenTaiko.Tx.Taiko_PlayerNumber[i] != null) { + OpenTaiko.Tx.Taiko_PlayerNumber[i].t2D描画(playerNumber_x, playerNumber_y); + } + } + return base.Draw(); + } + + public void tMtaikoEvent(int nChannel, int nHand, int nPlayer) { + CConfigIni configIni = OpenTaiko.ConfigIni; + bool bAutoPlay = configIni.bAutoPlay[nPlayer]; + int playerShift = 5 * nPlayer; + var _gt = configIni.nGameType[OpenTaiko.GetActualPlayer(nPlayer)]; + + switch (nPlayer) { + case 1: + bAutoPlay = configIni.bAutoPlay[nPlayer] || OpenTaiko.ConfigIni.bAIBattleMode; + break; + } + + if (!bAutoPlay) { + switch (nChannel) { + case 0x11: + case 0x13: + case 0x15: + case 0x16: + case 0x17: { + this.stパッド状態[2 + nHand + playerShift].n明るさ = 8; + } + break; + case 0x12: { + this.stパッド状態[nHand + playerShift].n明るさ = 8; + } + break; + case 0x14: { + if (_gt == EGameType.Konga) { + this.stパッド状態[4 + playerShift].n明るさ = 8; + } else { + this.stパッド状態[nHand + playerShift].n明るさ = 8; + } + } + break; + + } + } else { + switch (nChannel) { + case 0x11: + case 0x15: + case 0x16: + case 0x17: + case 0x1F: { + this.stパッド状態[2 + nHand + playerShift].n明るさ = 8; + } + break; + + case 0x13: + case 0x1A: { + if (_gt == EGameType.Konga) { + this.stパッド状態[0 + playerShift].n明るさ = 8; + this.stパッド状態[2 + playerShift].n明るさ = 8; + } else { + this.stパッド状態[2 + playerShift].n明るさ = 8; + this.stパッド状態[3 + playerShift].n明るさ = 8; + } + } + break; + + case 0x12: { + this.stパッド状態[nHand + playerShift].n明るさ = 8; + } + break; + + case 0x14: + case 0x1B: { + if (_gt == EGameType.Konga) { + this.stパッド状態[4 + playerShift].n明るさ = 8; + } else { + this.stパッド状態[0 + playerShift].n明るさ = 8; + this.stパッド状態[1 + playerShift].n明るさ = 8; + } + + } + break; + + case 0x101: { + this.stパッド状態[nHand + playerShift].n明るさ = 8; + this.stパッド状態[2 + (nHand == 0 ? 1 : 0) + playerShift].n明るさ = 8; + break; + } + } + } } -} + public void tBranchEvent(CDTX.ECourse Before, CDTX.ECourse After, int player) { + if (After != Before) + this.ctレベルアップダウン[player] = new CCounter(0, 1000, 1, OpenTaiko.Timer); + + this.After[player] = After; + this.Before[player] = Before; + } + + + public void BackSymbolEvent(int player) { + ctSymbolFlash[player] = new CCounter(0, 1000, 0.2f, OpenTaiko.Timer); + } + + public void DrawBackSymbol() { + for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { + ctSymbolFlash[i].Tick(); + + int couse_symbol_x; + int couse_symbol_y; + if (OpenTaiko.ConfigIni.nPlayerCount == 5) { + couse_symbol_x = OpenTaiko.Skin.Game_CourseSymbol_Back_5P[0] + (OpenTaiko.Skin.Game_UIMove_5P[0] * i); + couse_symbol_y = OpenTaiko.Skin.Game_CourseSymbol_Back_5P[1] + (OpenTaiko.Skin.Game_UIMove_5P[1] * i); + } else if (OpenTaiko.ConfigIni.nPlayerCount == 4 || OpenTaiko.ConfigIni.nPlayerCount == 3) { + couse_symbol_x = OpenTaiko.Skin.Game_CourseSymbol_Back_4P[0] + (OpenTaiko.Skin.Game_UIMove_4P[0] * i); + couse_symbol_y = OpenTaiko.Skin.Game_CourseSymbol_Back_4P[1] + (OpenTaiko.Skin.Game_UIMove_4P[1] * i); + } else { + couse_symbol_x = OpenTaiko.Skin.Game_CourseSymbol_Back_X[i]; + couse_symbol_y = OpenTaiko.Skin.Game_CourseSymbol_Back_Y[i]; + } + + + if (OpenTaiko.Tx.Couse_Symbol_Back[OpenTaiko.stageSongSelect.nChoosenSongDifficulty[i]] != null) { + int originX = 0; + int originY = 0; + int width = OpenTaiko.Tx.Couse_Symbol_Back[OpenTaiko.stageSongSelect.nChoosenSongDifficulty[i]].szTextureSize.Width; + int height = OpenTaiko.Tx.Couse_Symbol_Back[OpenTaiko.stageSongSelect.nChoosenSongDifficulty[i]].szTextureSize.Height; + + if (OpenTaiko.ConfigIni.nPlayerCount == 5) { + originX = OpenTaiko.Skin.Game_CourseSymbol_Back_Rect_5P[0]; + originY = OpenTaiko.Skin.Game_CourseSymbol_Back_Rect_5P[1]; + width = OpenTaiko.Skin.Game_CourseSymbol_Back_Rect_5P[2]; + height = OpenTaiko.Skin.Game_CourseSymbol_Back_Rect_5P[3]; + } else if (OpenTaiko.ConfigIni.nPlayerCount > 2) { + originX = OpenTaiko.Skin.Game_CourseSymbol_Back_Rect_4P[0]; + originY = OpenTaiko.Skin.Game_CourseSymbol_Back_Rect_4P[1]; + width = OpenTaiko.Skin.Game_CourseSymbol_Back_Rect_4P[2]; + height = OpenTaiko.Skin.Game_CourseSymbol_Back_Rect_4P[3]; + } + + OpenTaiko.Tx.Couse_Symbol_Back[OpenTaiko.stageSongSelect.nChoosenSongDifficulty[i]].t2D描画( + couse_symbol_x, + couse_symbol_y, + new System.Drawing.RectangleF(originX, originY, width, height)); + } + + if (OpenTaiko.Tx.Couse_Symbol_Back_Flash[OpenTaiko.stageSongSelect.nChoosenSongDifficulty[i]] != null && !OpenTaiko.ConfigIni.SimpleMode) { + int originX = 0; + int originY = 0; + int width = OpenTaiko.Tx.Couse_Symbol_Back[OpenTaiko.stageSongSelect.nChoosenSongDifficulty[i]].szTextureSize.Width; + int height = OpenTaiko.Tx.Couse_Symbol_Back[OpenTaiko.stageSongSelect.nChoosenSongDifficulty[i]].szTextureSize.Height; + + if (OpenTaiko.ConfigIni.nPlayerCount == 5) { + originX = OpenTaiko.Skin.Game_CourseSymbol_Back_Rect_5P[0]; + originY = OpenTaiko.Skin.Game_CourseSymbol_Back_Rect_5P[1]; + width = OpenTaiko.Skin.Game_CourseSymbol_Back_Rect_5P[2]; + height = OpenTaiko.Skin.Game_CourseSymbol_Back_Rect_5P[3]; + } else if (OpenTaiko.ConfigIni.nPlayerCount > 2) { + originX = OpenTaiko.Skin.Game_CourseSymbol_Back_Rect_4P[0]; + originY = OpenTaiko.Skin.Game_CourseSymbol_Back_Rect_4P[1]; + width = OpenTaiko.Skin.Game_CourseSymbol_Back_Rect_4P[2]; + height = OpenTaiko.Skin.Game_CourseSymbol_Back_Rect_4P[3]; + } + + OpenTaiko.Tx.Couse_Symbol_Back_Flash[OpenTaiko.stageSongSelect.nChoosenSongDifficulty[i]].Opacity = 255 - (int)((ctSymbolFlash[i].CurrentValue / 1000.0) * 255); + OpenTaiko.Tx.Couse_Symbol_Back_Flash[OpenTaiko.stageSongSelect.nChoosenSongDifficulty[i]].t2D描画( + couse_symbol_x, + couse_symbol_y, + new System.Drawing.RectangleF(originX, originY, width, height)); + } + } + } + + + #region[ private ] + //----------------- + //構造体 + [StructLayout(LayoutKind.Sequential)] + private struct STパッド状態 { + public int n明るさ; + } + + //太鼓 + private STパッド状態[] stパッド状態 = new STパッド状態[5 * 5]; + private long nフラッシュ制御タイマ; + + //private CTexture[] txコースシンボル = new CTexture[ 6 ]; + private string[] strCourseSymbolFileName; + + //オプション + private CTexture txオプションパネル_HS; + private CTexture txオプションパネル_RANMIR; + private CTexture txオプションパネル_特殊; + private int nHS; + + //譜面分岐 + private CCounter[] ctレベルアップダウン; + public CDTX.ECourse[] After; + public CDTX.ECourse[] Before; + private CCounter[] ctSymbolFlash = new CCounter[5]; + //----------------- + #endregion + +} diff --git a/OpenTaiko/src/Stages/07.Game/Taiko/CActImplPad.cs b/OpenTaiko/src/Stages/07.Game/Taiko/CActImplPad.cs index 373f8ed2..6ffd9665 100644 --- a/OpenTaiko/src/Stages/07.Game/Taiko/CActImplPad.cs +++ b/OpenTaiko/src/Stages/07.Game/Taiko/CActImplPad.cs @@ -1,102 +1,102 @@ using System.Runtime.InteropServices; using FDK; -namespace OpenTaiko { - internal class CActImplPad : CActivity { - // コンストラクタ +namespace OpenTaiko; - public CActImplPad() { - base.IsDeActivated = true; - } +internal class CActImplPad : CActivity { + // コンストラクタ - - // メソッド - - public void Hit(int nLane) { - this.stパッド状態[nLane].n明るさ = 6; - this.stパッド状態[nLane].nY座標加速度dot = 2; - } - - - // CActivity 実装 - - public override void Activate() { - this.nフラッシュ制御タイマ = -1; - this.nY座標制御タイマ = -1; - for (int i = 0; i < 9; i++) { - STパッド状態 stパッド状態2 = new STパッド状態(); - STパッド状態 stパッド状態 = stパッド状態2; - stパッド状態.nY座標オフセットdot = 0; - stパッド状態.nY座標加速度dot = 0; - stパッド状態.n明るさ = 0; - this.stパッド状態[i] = stパッド状態; - } - base.Activate(); - } - public override void CreateManagedResource() { - base.CreateManagedResource(); - } - public override void ReleaseManagedResource() { - base.ReleaseManagedResource(); - } - public override int Draw() { - if (!base.IsDeActivated) { - if (base.IsFirstDraw) { - this.nフラッシュ制御タイマ = (long)(SoundManager.PlayTimer.NowTime * OpenTaiko.ConfigIni.SongPlaybackSpeed); - this.nY座標制御タイマ = (long)(SoundManager.PlayTimer.NowTime * OpenTaiko.ConfigIni.SongPlaybackSpeed); - base.IsFirstDraw = false; - } - long num = (long)(SoundManager.PlayTimer.NowTime * OpenTaiko.ConfigIni.SongPlaybackSpeed); - if (num < this.nフラッシュ制御タイマ) { - this.nフラッシュ制御タイマ = num; - } - while ((num - this.nフラッシュ制御タイマ) >= 15) { - for (int j = 0; j < 10; j++) { - if (this.stパッド状態[j].n明るさ > 0) { - this.stパッド状態[j].n明るさ--; - } - } - this.nフラッシュ制御タイマ += 15; - } - long num3 = SoundManager.PlayTimer.NowTime; - if (num3 < this.nY座標制御タイマ) { - this.nY座標制御タイマ = num3; - } - while ((num3 - this.nY座標制御タイマ) >= 5) { - for (int k = 0; k < 10; k++) { - this.stパッド状態[k].nY座標オフセットdot += this.stパッド状態[k].nY座標加速度dot; - if (this.stパッド状態[k].nY座標オフセットdot > 15) { - this.stパッド状態[k].nY座標オフセットdot = 15; - this.stパッド状態[k].nY座標加速度dot = -1; - } else if (this.stパッド状態[k].nY座標オフセットdot < 0) { - this.stパッド状態[k].nY座標オフセットdot = 0; - this.stパッド状態[k].nY座標加速度dot = 0; - } - } - this.nY座標制御タイマ += 5; - } - - - } - return 0; - } - - - // その他 - - #region [ private ] - //----------------- - [StructLayout(LayoutKind.Sequential)] - private struct STパッド状態 { - public int n明るさ; - public int nY座標オフセットdot; - public int nY座標加速度dot; - } - - private long nY座標制御タイマ; - private long nフラッシュ制御タイマ; - private STパッド状態[] stパッド状態 = new STパッド状態[10]; - //----------------- - #endregion + public CActImplPad() { + base.IsDeActivated = true; } + + + // メソッド + + public void Hit(int nLane) { + this.stパッド状態[nLane].n明るさ = 6; + this.stパッド状態[nLane].nY座標加速度dot = 2; + } + + + // CActivity 実装 + + public override void Activate() { + this.nフラッシュ制御タイマ = -1; + this.nY座標制御タイマ = -1; + for (int i = 0; i < 9; i++) { + STパッド状態 stパッド状態2 = new STパッド状態(); + STパッド状態 stパッド状態 = stパッド状態2; + stパッド状態.nY座標オフセットdot = 0; + stパッド状態.nY座標加速度dot = 0; + stパッド状態.n明るさ = 0; + this.stパッド状態[i] = stパッド状態; + } + base.Activate(); + } + public override void CreateManagedResource() { + base.CreateManagedResource(); + } + public override void ReleaseManagedResource() { + base.ReleaseManagedResource(); + } + public override int Draw() { + if (!base.IsDeActivated) { + if (base.IsFirstDraw) { + this.nフラッシュ制御タイマ = (long)(SoundManager.PlayTimer.NowTime * OpenTaiko.ConfigIni.SongPlaybackSpeed); + this.nY座標制御タイマ = (long)(SoundManager.PlayTimer.NowTime * OpenTaiko.ConfigIni.SongPlaybackSpeed); + base.IsFirstDraw = false; + } + long num = (long)(SoundManager.PlayTimer.NowTime * OpenTaiko.ConfigIni.SongPlaybackSpeed); + if (num < this.nフラッシュ制御タイマ) { + this.nフラッシュ制御タイマ = num; + } + while ((num - this.nフラッシュ制御タイマ) >= 15) { + for (int j = 0; j < 10; j++) { + if (this.stパッド状態[j].n明るさ > 0) { + this.stパッド状態[j].n明るさ--; + } + } + this.nフラッシュ制御タイマ += 15; + } + long num3 = SoundManager.PlayTimer.NowTime; + if (num3 < this.nY座標制御タイマ) { + this.nY座標制御タイマ = num3; + } + while ((num3 - this.nY座標制御タイマ) >= 5) { + for (int k = 0; k < 10; k++) { + this.stパッド状態[k].nY座標オフセットdot += this.stパッド状態[k].nY座標加速度dot; + if (this.stパッド状態[k].nY座標オフセットdot > 15) { + this.stパッド状態[k].nY座標オフセットdot = 15; + this.stパッド状態[k].nY座標加速度dot = -1; + } else if (this.stパッド状態[k].nY座標オフセットdot < 0) { + this.stパッド状態[k].nY座標オフセットdot = 0; + this.stパッド状態[k].nY座標加速度dot = 0; + } + } + this.nY座標制御タイマ += 5; + } + + + } + return 0; + } + + + // その他 + + #region [ private ] + //----------------- + [StructLayout(LayoutKind.Sequential)] + private struct STパッド状態 { + public int n明るさ; + public int nY座標オフセットdot; + public int nY座標加速度dot; + } + + private long nY座標制御タイマ; + private long nフラッシュ制御タイマ; + private STパッド状態[] stパッド状態 = new STパッド状態[10]; + //----------------- + #endregion } diff --git a/OpenTaiko/src/Stages/07.Game/Taiko/CActImplRoll.cs b/OpenTaiko/src/Stages/07.Game/Taiko/CActImplRoll.cs index 1de41681..a83ba05c 100644 --- a/OpenTaiko/src/Stages/07.Game/Taiko/CActImplRoll.cs +++ b/OpenTaiko/src/Stages/07.Game/Taiko/CActImplRoll.cs @@ -2,149 +2,149 @@ using System.Runtime.InteropServices; using FDK; -namespace OpenTaiko { - internal class CActImplRoll : CActivity { +namespace OpenTaiko; + +internal class CActImplRoll : CActivity { - public CActImplRoll() { - base.IsDeActivated = true; + public CActImplRoll() { + base.IsDeActivated = true; + } + + public override void Activate() { + this.ct連打枠カウンター = new CCounter[5]; + this.ct連打アニメ = new CCounter[5]; + FadeOut = new Animations.FadeOut[5]; + for (int i = 0; i < 5; i++) { + this.ct連打枠カウンター[i] = new CCounter(); + this.ct連打アニメ[i] = new CCounter(); + // 後から変えれるようにする。大体10フレーム分。 + FadeOut[i] = new Animations.FadeOut(167); } + this.b表示 = new bool[] { false, false, false, false, false }; + this.n連打数 = new int[5]; - public override void Activate() { - this.ct連打枠カウンター = new CCounter[5]; - this.ct連打アニメ = new CCounter[5]; - FadeOut = new Animations.FadeOut[5]; - for (int i = 0; i < 5; i++) { - this.ct連打枠カウンター[i] = new CCounter(); - this.ct連打アニメ[i] = new CCounter(); - // 後から変えれるようにする。大体10フレーム分。 - FadeOut[i] = new Animations.FadeOut(167); - } - this.b表示 = new bool[] { false, false, false, false, false }; - this.n連打数 = new int[5]; + base.Activate(); + } - base.Activate(); + public override void DeActivate() { + for (int i = 0; i < 5; i++) { + ct連打枠カウンター[i] = null; + ct連打アニメ[i] = null; + FadeOut[i] = null; } + base.DeActivate(); + } - public override void DeActivate() { - for (int i = 0; i < 5; i++) { - ct連打枠カウンター[i] = null; - ct連打アニメ[i] = null; - FadeOut[i] = null; - } - base.DeActivate(); - } + public override void CreateManagedResource() { + base.CreateManagedResource(); + } - public override void CreateManagedResource() { - base.CreateManagedResource(); - } + public override void ReleaseManagedResource() { + base.ReleaseManagedResource(); + } - public override void ReleaseManagedResource() { - base.ReleaseManagedResource(); - } + public override int Draw() { + return base.Draw(); + } - public override int Draw() { - return base.Draw(); - } + public int On進行描画(int n連打数, int player) { + if (OpenTaiko.ConfigIni.nPlayerCount > 2) return base.Draw(); - public int On進行描画(int n連打数, int player) { - if (OpenTaiko.ConfigIni.nPlayerCount > 2) return base.Draw(); - - this.ct連打枠カウンター[player].Tick(); - this.ct連打アニメ[player].Tick(); - FadeOut[player].Tick(); - //1PY:-3 2PY:514 - //仮置き - int[] nRollBalloon = new int[] { -3, 514, 0, 0 }; - int[] nRollNumber = new int[] { 48, 559, 0, 0 }; - for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { - //CDTXMania.act文字コンソール.tPrint(0, 0, C文字コンソール.Eフォント種別.白, this.ct連打枠カウンター[player].n現在の値.ToString()); - if (this.ct連打枠カウンター[player].IsUnEnded) { - if (ct連打枠カウンター[player].CurrentValue > 66 && !FadeOut[player].Counter.IsTicked) { - FadeOut[player].Start(); - } - var opacity = (int)FadeOut[player].GetAnimation(); - - if (ct連打枠カウンター[player].CurrentValue == 0 || ct連打枠カウンター[player].CurrentValue == 60) { - bNowRollAnime = 0; - OpenTaiko.Tx.Balloon_Number_Roll.Opacity = 64; - } else if (ct連打枠カウンター[player].CurrentValue == 1 || ct連打枠カウンター[player].CurrentValue == 59) { - bNowRollAnime = 1; - OpenTaiko.Tx.Balloon_Number_Roll.Opacity = 128; - } else if (ct連打枠カウンター[player].CurrentValue == 2 || ct連打枠カウンター[player].CurrentValue == 58) { - bNowRollAnime = 2; - OpenTaiko.Tx.Balloon_Number_Roll.Opacity = 192; - } else if (ct連打枠カウンター[player].CurrentValue == 3 || ct連打枠カウンター[player].CurrentValue == 57) { - bNowRollAnime = 3; - OpenTaiko.Tx.Balloon_Number_Roll.Opacity = 255; - } else if (ct連打枠カウンター[player].CurrentValue >= 4 || ct連打枠カウンター[player].CurrentValue <= 56) { - bNowRollAnime = 4; - OpenTaiko.Tx.Balloon_Number_Roll.Opacity = 255; - } - - float width = OpenTaiko.Tx.Balloon_Roll.szTextureSize.Width / 5.0f; - float height = OpenTaiko.Tx.Balloon_Roll.szTextureSize.Height; - - OpenTaiko.Tx.Balloon_Roll?.t2D描画(OpenTaiko.Skin.Game_Balloon_Roll_Frame_X[player], OpenTaiko.Skin.Game_Balloon_Roll_Frame_Y[player], new RectangleF(0 + bNowRollAnime * width, 0, width, height)); - this.t文字表示(OpenTaiko.Skin.Game_Balloon_Roll_Number_X[player], OpenTaiko.Skin.Game_Balloon_Roll_Number_Y[player], n連打数, player); + this.ct連打枠カウンター[player].Tick(); + this.ct連打アニメ[player].Tick(); + FadeOut[player].Tick(); + //1PY:-3 2PY:514 + //仮置き + int[] nRollBalloon = new int[] { -3, 514, 0, 0 }; + int[] nRollNumber = new int[] { 48, 559, 0, 0 }; + for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { + //CDTXMania.act文字コンソール.tPrint(0, 0, C文字コンソール.Eフォント種別.白, this.ct連打枠カウンター[player].n現在の値.ToString()); + if (this.ct連打枠カウンター[player].IsUnEnded) { + if (ct連打枠カウンター[player].CurrentValue > 66 && !FadeOut[player].Counter.IsTicked) { + FadeOut[player].Start(); } + var opacity = (int)FadeOut[player].GetAnimation(); + + if (ct連打枠カウンター[player].CurrentValue == 0 || ct連打枠カウンター[player].CurrentValue == 60) { + bNowRollAnime = 0; + OpenTaiko.Tx.Balloon_Number_Roll.Opacity = 64; + } else if (ct連打枠カウンター[player].CurrentValue == 1 || ct連打枠カウンター[player].CurrentValue == 59) { + bNowRollAnime = 1; + OpenTaiko.Tx.Balloon_Number_Roll.Opacity = 128; + } else if (ct連打枠カウンター[player].CurrentValue == 2 || ct連打枠カウンター[player].CurrentValue == 58) { + bNowRollAnime = 2; + OpenTaiko.Tx.Balloon_Number_Roll.Opacity = 192; + } else if (ct連打枠カウンター[player].CurrentValue == 3 || ct連打枠カウンター[player].CurrentValue == 57) { + bNowRollAnime = 3; + OpenTaiko.Tx.Balloon_Number_Roll.Opacity = 255; + } else if (ct連打枠カウンター[player].CurrentValue >= 4 || ct連打枠カウンター[player].CurrentValue <= 56) { + bNowRollAnime = 4; + OpenTaiko.Tx.Balloon_Number_Roll.Opacity = 255; + } + + float width = OpenTaiko.Tx.Balloon_Roll.szTextureSize.Width / 5.0f; + float height = OpenTaiko.Tx.Balloon_Roll.szTextureSize.Height; + + OpenTaiko.Tx.Balloon_Roll?.t2D描画(OpenTaiko.Skin.Game_Balloon_Roll_Frame_X[player], OpenTaiko.Skin.Game_Balloon_Roll_Frame_Y[player], new RectangleF(0 + bNowRollAnime * width, 0, width, height)); + this.t文字表示(OpenTaiko.Skin.Game_Balloon_Roll_Number_X[player], OpenTaiko.Skin.Game_Balloon_Roll_Number_Y[player], n連打数, player); } - - return base.Draw(); } - public void t枠表示時間延長(int player, bool first) { - if ((this.ct連打枠カウンター[player].CurrentValue >= 6 && !first) || first) - this.ct連打枠カウンター[player] = new CCounter(0, 60, 40, OpenTaiko.Timer); + return base.Draw(); + } - if (!first) - this.ct連打枠カウンター[player].CurrentValue = 5; - else - this.ct連打枠カウンター[player].CurrentValue = 0; - } + public void t枠表示時間延長(int player, bool first) { + if ((this.ct連打枠カウンター[player].CurrentValue >= 6 && !first) || first) + this.ct連打枠カウンター[player] = new CCounter(0, 60, 40, OpenTaiko.Timer); - public int bNowRollAnime; - public bool[] b表示; - public int[] n連打数; - public CCounter[] ct連打枠カウンター; + if (!first) + this.ct連打枠カウンター[player].CurrentValue = 5; + else + this.ct連打枠カウンター[player].CurrentValue = 0; + } - public CCounter[] ct連打アニメ; - private float[] RollScale = new float[] - { - 0.000f, - 0.123f, // リピート - 0.164f, - 0.164f, - 0.164f, - 0.137f, - 0.110f, - 0.082f, - 0.055f, - 0.000f - }; - private Animations.FadeOut[] FadeOut; + public int bNowRollAnime; + public bool[] b表示; + public int[] n連打数; + public CCounter[] ct連打枠カウンター; - [StructLayout(LayoutKind.Sequential)] - private struct ST文字位置 { - public char ch; - public Point pt; - } + public CCounter[] ct連打アニメ; + private float[] RollScale = new float[] + { + 0.000f, + 0.123f, // リピート + 0.164f, + 0.164f, + 0.164f, + 0.137f, + 0.110f, + 0.082f, + 0.055f, + 0.000f + }; + private Animations.FadeOut[] FadeOut; - private void t文字表示(int x, int y, int num, int nPlayer) { - OpenTaiko.Tx.Balloon_Number_Roll.vcScaleRatio.X = OpenTaiko.Skin.Game_Balloon_Roll_Number_Scale; - OpenTaiko.Tx.Balloon_Number_Roll.vcScaleRatio.Y = OpenTaiko.Skin.Game_Balloon_Roll_Number_Scale + RollScale[this.ct連打アニメ[nPlayer].CurrentValue]; + [StructLayout(LayoutKind.Sequential)] + private struct ST文字位置 { + public char ch; + public Point pt; + } - int[] nums = CConversion.SeparateDigits(num); - for (int j = 0; j < nums.Length; j++) { - float offset = j - (nums.Length / 2.0f); - float _x = x - (OpenTaiko.Skin.Game_Balloon_Number_Interval[0] * offset); - float _y = y - (OpenTaiko.Skin.Game_Balloon_Number_Interval[1] * offset); + private void t文字表示(int x, int y, int num, int nPlayer) { + OpenTaiko.Tx.Balloon_Number_Roll.vcScaleRatio.X = OpenTaiko.Skin.Game_Balloon_Roll_Number_Scale; + OpenTaiko.Tx.Balloon_Number_Roll.vcScaleRatio.Y = OpenTaiko.Skin.Game_Balloon_Roll_Number_Scale + RollScale[this.ct連打アニメ[nPlayer].CurrentValue]; - float width = OpenTaiko.Tx.Balloon_Number_Roll.sz画像サイズ.Width / 10.0f; - float height = OpenTaiko.Tx.Balloon_Number_Roll.sz画像サイズ.Height; + int[] nums = CConversion.SeparateDigits(num); + for (int j = 0; j < nums.Length; j++) { + float offset = j - (nums.Length / 2.0f); + float _x = x - (OpenTaiko.Skin.Game_Balloon_Number_Interval[0] * offset); + float _y = y - (OpenTaiko.Skin.Game_Balloon_Number_Interval[1] * offset); - OpenTaiko.Tx.Balloon_Number_Roll.t2D拡大率考慮下基準描画(_x, _y, new RectangleF(width * nums[j], 0, width, height)); - } + float width = OpenTaiko.Tx.Balloon_Number_Roll.sz画像サイズ.Width / 10.0f; + float height = OpenTaiko.Tx.Balloon_Number_Roll.sz画像サイズ.Height; + + OpenTaiko.Tx.Balloon_Number_Roll.t2D拡大率考慮下基準描画(_x, _y, new RectangleF(width * nums[j], 0, width, height)); } } } diff --git a/OpenTaiko/src/Stages/07.Game/Taiko/CActImplRollEffect.cs b/OpenTaiko/src/Stages/07.Game/Taiko/CActImplRollEffect.cs index 9642eddc..8a8dc6d2 100644 --- a/OpenTaiko/src/Stages/07.Game/Taiko/CActImplRollEffect.cs +++ b/OpenTaiko/src/Stages/07.Game/Taiko/CActImplRollEffect.cs @@ -1,170 +1,170 @@ using System.Runtime.InteropServices; using FDK; -namespace OpenTaiko { - internal class CActImplRollEffect : CActivity { - // コンストラクタ +namespace OpenTaiko; - public CActImplRollEffect() { - base.IsDeActivated = true; - } +internal class CActImplRollEffect : CActivity { + // コンストラクタ + + public CActImplRollEffect() { + base.IsDeActivated = true; + } - // メソッド - public virtual void Start(int player) { - if (OpenTaiko.ConfigIni.SimpleMode) return; + // メソッド + public virtual void Start(int player) { + if (OpenTaiko.ConfigIni.SimpleMode) return; - for (int i = 0; i < 128; i++) { - if (!RollCharas[i].IsUsing) { - RollCharas[i].IsUsing = true; - RollCharas[i].Type = random.Next(0, OpenTaiko.Skin.Game_Effect_Roll_Ptn); - RollCharas[i].OldValue = 0; - RollCharas[i].Counter = new CCounter(0, 5000, 1, OpenTaiko.Timer); - if (OpenTaiko.stage演奏ドラム画面.bDoublePlay) { - switch (player) { - case 0: - RollCharas[i].X = OpenTaiko.Skin.Game_Effect_Roll_StartPoint_1P_X[random.Next(0, OpenTaiko.Skin.Game_Effect_Roll_StartPoint_1P_X.Length)]; - RollCharas[i].Y = OpenTaiko.Skin.Game_Effect_Roll_StartPoint_1P_Y[random.Next(0, OpenTaiko.Skin.Game_Effect_Roll_StartPoint_1P_Y.Length)]; - RollCharas[i].XAdd = OpenTaiko.Skin.Game_Effect_Roll_Speed_1P_X[random.Next(0, OpenTaiko.Skin.Game_Effect_Roll_Speed_1P_X.Length)]; - RollCharas[i].YAdd = OpenTaiko.Skin.Game_Effect_Roll_Speed_1P_Y[random.Next(0, OpenTaiko.Skin.Game_Effect_Roll_Speed_1P_Y.Length)]; - break; - case 1: - RollCharas[i].X = OpenTaiko.Skin.Game_Effect_Roll_StartPoint_2P_X[random.Next(0, OpenTaiko.Skin.Game_Effect_Roll_StartPoint_2P_X.Length)]; - RollCharas[i].Y = OpenTaiko.Skin.Game_Effect_Roll_StartPoint_2P_Y[random.Next(0, OpenTaiko.Skin.Game_Effect_Roll_StartPoint_2P_Y.Length)]; - RollCharas[i].XAdd = OpenTaiko.Skin.Game_Effect_Roll_Speed_2P_X[random.Next(0, OpenTaiko.Skin.Game_Effect_Roll_Speed_2P_X.Length)]; - RollCharas[i].YAdd = OpenTaiko.Skin.Game_Effect_Roll_Speed_2P_Y[random.Next(0, OpenTaiko.Skin.Game_Effect_Roll_Speed_2P_Y.Length)]; - break; - default: - return; - } - } else { - RollCharas[i].X = OpenTaiko.Skin.Game_Effect_Roll_StartPoint_X[random.Next(0, OpenTaiko.Skin.Game_Effect_Roll_StartPoint_X.Length)]; - RollCharas[i].Y = OpenTaiko.Skin.Game_Effect_Roll_StartPoint_Y[random.Next(0, OpenTaiko.Skin.Game_Effect_Roll_StartPoint_Y.Length)]; - RollCharas[i].XAdd = OpenTaiko.Skin.Game_Effect_Roll_Speed_X[random.Next(0, OpenTaiko.Skin.Game_Effect_Roll_Speed_X.Length)]; - RollCharas[i].YAdd = OpenTaiko.Skin.Game_Effect_Roll_Speed_Y[random.Next(0, OpenTaiko.Skin.Game_Effect_Roll_Speed_Y.Length)]; + for (int i = 0; i < 128; i++) { + if (!RollCharas[i].IsUsing) { + RollCharas[i].IsUsing = true; + RollCharas[i].Type = random.Next(0, OpenTaiko.Skin.Game_Effect_Roll_Ptn); + RollCharas[i].OldValue = 0; + RollCharas[i].Counter = new CCounter(0, 5000, 1, OpenTaiko.Timer); + if (OpenTaiko.stage演奏ドラム画面.bDoublePlay) { + switch (player) { + case 0: + RollCharas[i].X = OpenTaiko.Skin.Game_Effect_Roll_StartPoint_1P_X[random.Next(0, OpenTaiko.Skin.Game_Effect_Roll_StartPoint_1P_X.Length)]; + RollCharas[i].Y = OpenTaiko.Skin.Game_Effect_Roll_StartPoint_1P_Y[random.Next(0, OpenTaiko.Skin.Game_Effect_Roll_StartPoint_1P_Y.Length)]; + RollCharas[i].XAdd = OpenTaiko.Skin.Game_Effect_Roll_Speed_1P_X[random.Next(0, OpenTaiko.Skin.Game_Effect_Roll_Speed_1P_X.Length)]; + RollCharas[i].YAdd = OpenTaiko.Skin.Game_Effect_Roll_Speed_1P_Y[random.Next(0, OpenTaiko.Skin.Game_Effect_Roll_Speed_1P_Y.Length)]; + break; + case 1: + RollCharas[i].X = OpenTaiko.Skin.Game_Effect_Roll_StartPoint_2P_X[random.Next(0, OpenTaiko.Skin.Game_Effect_Roll_StartPoint_2P_X.Length)]; + RollCharas[i].Y = OpenTaiko.Skin.Game_Effect_Roll_StartPoint_2P_Y[random.Next(0, OpenTaiko.Skin.Game_Effect_Roll_StartPoint_2P_Y.Length)]; + RollCharas[i].XAdd = OpenTaiko.Skin.Game_Effect_Roll_Speed_2P_X[random.Next(0, OpenTaiko.Skin.Game_Effect_Roll_Speed_2P_X.Length)]; + RollCharas[i].YAdd = OpenTaiko.Skin.Game_Effect_Roll_Speed_2P_Y[random.Next(0, OpenTaiko.Skin.Game_Effect_Roll_Speed_2P_Y.Length)]; + break; + default: + return; } - break; + } else { + RollCharas[i].X = OpenTaiko.Skin.Game_Effect_Roll_StartPoint_X[random.Next(0, OpenTaiko.Skin.Game_Effect_Roll_StartPoint_X.Length)]; + RollCharas[i].Y = OpenTaiko.Skin.Game_Effect_Roll_StartPoint_Y[random.Next(0, OpenTaiko.Skin.Game_Effect_Roll_StartPoint_Y.Length)]; + RollCharas[i].XAdd = OpenTaiko.Skin.Game_Effect_Roll_Speed_X[random.Next(0, OpenTaiko.Skin.Game_Effect_Roll_Speed_X.Length)]; + RollCharas[i].YAdd = OpenTaiko.Skin.Game_Effect_Roll_Speed_Y[random.Next(0, OpenTaiko.Skin.Game_Effect_Roll_Speed_Y.Length)]; } + break; } - } - // CActivity 実装 + } - public override void Activate() { + // CActivity 実装 + + public override void Activate() { + + for (int i = 0; i < 128; i++) { + RollCharas[i] = new RollChara(); + RollCharas[i].IsUsing = false; + RollCharas[i].Counter = new CCounter(); + } + // SkinConfigで指定されたいくつかの変数からこのクラスに合ったものに変換していく + + base.Activate(); + } + public override void DeActivate() { + + for (int i = 0; i < 128; i++) { + RollCharas[i].Counter = null; + } + base.DeActivate(); + } + public override void CreateManagedResource() { + + base.CreateManagedResource(); + } + public override void ReleaseManagedResource() { + + base.ReleaseManagedResource(); + } + public override int Draw() { + if (!base.IsDeActivated && !OpenTaiko.ConfigIni.SimpleMode) { + + if (OpenTaiko.ConfigIni.nPlayerCount > 2) return 0; for (int i = 0; i < 128; i++) { - RollCharas[i] = new RollChara(); - RollCharas[i].IsUsing = false; - RollCharas[i].Counter = new CCounter(); - } - // SkinConfigで指定されたいくつかの変数からこのクラスに合ったものに変換していく + if (RollCharas[i].IsUsing) { + RollCharas[i].OldValue = RollCharas[i].Counter.CurrentValue; + RollCharas[i].Counter.Tick(); + if (RollCharas[i].Counter.IsEnded) { + RollCharas[i].Counter.Stop(); + RollCharas[i].IsUsing = false; + } + for (int l = RollCharas[i].OldValue; l < RollCharas[i].Counter.CurrentValue; l++) { + RollCharas[i].X += RollCharas[i].XAdd; + RollCharas[i].Y += RollCharas[i].YAdd; + } - base.Activate(); - } - public override void DeActivate() { + if (OpenTaiko.Tx.Effects_Roll[RollCharas[i].Type] != null) { + OpenTaiko.Tx.Effects_Roll[RollCharas[i].Type]?.t2D描画(RollCharas[i].X, RollCharas[i].Y); - for (int i = 0; i < 128; i++) { - RollCharas[i].Counter = null; - } - base.DeActivate(); - } - public override void CreateManagedResource() { - - base.CreateManagedResource(); - } - public override void ReleaseManagedResource() { - - base.ReleaseManagedResource(); - } - public override int Draw() { - if (!base.IsDeActivated && !OpenTaiko.ConfigIni.SimpleMode) { - - if (OpenTaiko.ConfigIni.nPlayerCount > 2) return 0; - - for (int i = 0; i < 128; i++) { - if (RollCharas[i].IsUsing) { - RollCharas[i].OldValue = RollCharas[i].Counter.CurrentValue; - RollCharas[i].Counter.Tick(); - if (RollCharas[i].Counter.IsEnded) { + // 画面外にいたら描画をやめさせる + if (RollCharas[i].X < 0 - OpenTaiko.Tx.Effects_Roll[RollCharas[i].Type].szTextureSize.Width || RollCharas[i].X > OpenTaiko.Skin.Resolution[0]) { RollCharas[i].Counter.Stop(); RollCharas[i].IsUsing = false; } - for (int l = RollCharas[i].OldValue; l < RollCharas[i].Counter.CurrentValue; l++) { - RollCharas[i].X += RollCharas[i].XAdd; - RollCharas[i].Y += RollCharas[i].YAdd; + + if (RollCharas[i].Y < 0 - OpenTaiko.Tx.Effects_Roll[RollCharas[i].Type].szTextureSize.Height || RollCharas[i].Y > OpenTaiko.Skin.Resolution[1]) { + RollCharas[i].Counter.Stop(); + RollCharas[i].IsUsing = false; } - - if (OpenTaiko.Tx.Effects_Roll[RollCharas[i].Type] != null) { - OpenTaiko.Tx.Effects_Roll[RollCharas[i].Type]?.t2D描画(RollCharas[i].X, RollCharas[i].Y); - - // 画面外にいたら描画をやめさせる - if (RollCharas[i].X < 0 - OpenTaiko.Tx.Effects_Roll[RollCharas[i].Type].szTextureSize.Width || RollCharas[i].X > OpenTaiko.Skin.Resolution[0]) { - RollCharas[i].Counter.Stop(); - RollCharas[i].IsUsing = false; - } - - if (RollCharas[i].Y < 0 - OpenTaiko.Tx.Effects_Roll[RollCharas[i].Type].szTextureSize.Height || RollCharas[i].Y > OpenTaiko.Skin.Resolution[1]) { - RollCharas[i].Counter.Stop(); - RollCharas[i].IsUsing = false; - } - } - - } + + } } - return 0; } - - - // その他 - - #region [ private ] - //----------------- - //private CTexture[] txChara; - private int nTex枚数; - - [StructLayout(LayoutKind.Sequential)] - private struct ST連打キャラ { - public int nColor; - public bool b使用中; - public CCounter ct進行; - public int n前回のValue; - public float fX; - public float fY; - public float fX開始点; - public float fY開始点; - public float f進行方向; //進行方向 0:左→右 1:左下→右上 2:右→左 - public float fX加速度; - public float fY加速度; - } - private ST連打キャラ[] st連打キャラ = new ST連打キャラ[64]; - - [StructLayout(LayoutKind.Sequential)] - private struct RollChara { - public CCounter Counter; - public int Type; - public bool IsUsing; - public float X; - public float Y; - public float XAdd; - public float YAdd; - public int OldValue; - } - - private RollChara[] RollCharas = new RollChara[128]; - - private Random random = new Random(); - - private int[,] StartPoint; - private int[,] StartPoint_1P; - private int[,] StartPoint_2P; - private float[,] Speed; - private float[,] Speed_1P; - private float[,] Speed_2P; - private int CharaPtn; - //----------------- - #endregion + return 0; } + + + // その他 + + #region [ private ] + //----------------- + //private CTexture[] txChara; + private int nTex枚数; + + [StructLayout(LayoutKind.Sequential)] + private struct ST連打キャラ { + public int nColor; + public bool b使用中; + public CCounter ct進行; + public int n前回のValue; + public float fX; + public float fY; + public float fX開始点; + public float fY開始点; + public float f進行方向; //進行方向 0:左→右 1:左下→右上 2:右→左 + public float fX加速度; + public float fY加速度; + } + private ST連打キャラ[] st連打キャラ = new ST連打キャラ[64]; + + [StructLayout(LayoutKind.Sequential)] + private struct RollChara { + public CCounter Counter; + public int Type; + public bool IsUsing; + public float X; + public float Y; + public float XAdd; + public float YAdd; + public int OldValue; + } + + private RollChara[] RollCharas = new RollChara[128]; + + private Random random = new Random(); + + private int[,] StartPoint; + private int[,] StartPoint_1P; + private int[,] StartPoint_2P; + private float[,] Speed; + private float[,] Speed_1P; + private float[,] Speed_2P; + private int CharaPtn; + //----------------- + #endregion } diff --git a/OpenTaiko/src/Stages/07.Game/Taiko/CActImplRunner.cs b/OpenTaiko/src/Stages/07.Game/Taiko/CActImplRunner.cs index 04c8414b..6d23e347 100644 --- a/OpenTaiko/src/Stages/07.Game/Taiko/CActImplRunner.cs +++ b/OpenTaiko/src/Stages/07.Game/Taiko/CActImplRunner.cs @@ -3,224 +3,224 @@ using System.Drawing; using System.Runtime.InteropServices; using FDK; -namespace OpenTaiko { - internal class CActImplRunner : CActivity { - /// - /// ランナー - /// - public CActImplRunner() { - base.IsDeActivated = true; - } +namespace OpenTaiko; - public void Start(int Player, bool IsMiss, CDTX.CChip pChip) { - if (Runner != null && !OpenTaiko.ConfigIni.SimpleMode) { - while (stRunners[Index].b使用中) { - Index += 1; - if (Index >= 128) { - Index = 0; - break; // 2018.6.15 IMARER 無限ループが発生するので修正 - } - } - if (pChip.nチャンネル番号 < 0x15 || (pChip.nチャンネル番号 >= 0x1A)) { - if (!stRunners[Index].b使用中) { - stRunners[Index].b使用中 = true; - stRunners[Index].nPlayer = Player; - if (IsMiss == true) { - stRunners[Index].nType = 0; - } else { - stRunners[Index].nType = random.Next(1, Type + 1); - } - stRunners[Index].ct進行 = new CCounter(0, OpenTaiko.Skin.Resolution[0], Timer, OpenTaiko.Timer); - stRunners[Index].nOldValue = 0; - stRunners[Index].nNowPtn = 0; - stRunners[Index].fX = 0; - } +internal class CActImplRunner : CActivity { + /// + /// ランナー + /// + public CActImplRunner() { + base.IsDeActivated = true; + } + public void Start(int Player, bool IsMiss, CDTX.CChip pChip) { + if (Runner != null && !OpenTaiko.ConfigIni.SimpleMode) { + while (stRunners[Index].b使用中) { + Index += 1; + if (Index >= 128) { + Index = 0; + break; // 2018.6.15 IMARER 無限ループが発生するので修正 } } + if (pChip.nチャンネル番号 < 0x15 || (pChip.nチャンネル番号 >= 0x1A)) { + if (!stRunners[Index].b使用中) { + stRunners[Index].b使用中 = true; + stRunners[Index].nPlayer = Player; + if (IsMiss == true) { + stRunners[Index].nType = 0; + } else { + stRunners[Index].nType = random.Next(1, Type + 1); + } + stRunners[Index].ct進行 = new CCounter(0, OpenTaiko.Skin.Resolution[0], Timer, OpenTaiko.Timer); + stRunners[Index].nOldValue = 0; + stRunners[Index].nNowPtn = 0; + stRunners[Index].fX = 0; + } + + } } + } - public override void Activate() { - if (OpenTaiko.ConfigIni.SimpleMode) { - base.Activate(); - return; - } - - for (int i = 0; i < 128; i++) { - stRunners[i] = new STRunner(); - stRunners[i].b使用中 = false; - stRunners[i].ct進行 = new CCounter(); - } - - var preset = HScenePreset.GetBGPreset(); - - if (preset == null) return; - - Random random = new Random(); - - var dancerOrigindir = CSkin.Path($"{TextureLoader.BASE}{TextureLoader.GAME}{TextureLoader.RUNNER}"); - if (Directory.Exists($@"{dancerOrigindir}")) { - var dirs = Directory.GetDirectories($@"{dancerOrigindir}"); - if (preset.RunnerSet != null) { - var _presetPath = (preset.RunnerSet.Length > 0) ? $@"{dancerOrigindir}" + preset.RunnerSet[random.Next(0, preset.RunnerSet.Length)] : ""; - var path = (Directory.Exists(_presetPath)) - ? _presetPath - : (dirs.Length > 0 ? dirs[random.Next(0, dirs.Length)] : ""); - LoadRunnerConifg(path); - - Runner = OpenTaiko.tテクスチャの生成($@"{path}{Path.DirectorySeparatorChar}Runner.png"); - } - } - - // フィールド上で代入してたためこちらへ移動。 + public override void Activate() { + if (OpenTaiko.ConfigIni.SimpleMode) { base.Activate(); + return; } - public override void DeActivate() { - if (OpenTaiko.ConfigIni.SimpleMode) { - base.DeActivate(); - return; + for (int i = 0; i < 128; i++) { + stRunners[i] = new STRunner(); + stRunners[i].b使用中 = false; + stRunners[i].ct進行 = new CCounter(); + } + + var preset = HScenePreset.GetBGPreset(); + + if (preset == null) return; + + Random random = new Random(); + + var dancerOrigindir = CSkin.Path($"{TextureLoader.BASE}{TextureLoader.GAME}{TextureLoader.RUNNER}"); + if (Directory.Exists($@"{dancerOrigindir}")) { + var dirs = Directory.GetDirectories($@"{dancerOrigindir}"); + if (preset.RunnerSet != null) { + var _presetPath = (preset.RunnerSet.Length > 0) ? $@"{dancerOrigindir}" + preset.RunnerSet[random.Next(0, preset.RunnerSet.Length)] : ""; + var path = (Directory.Exists(_presetPath)) + ? _presetPath + : (dirs.Length > 0 ? dirs[random.Next(0, dirs.Length)] : ""); + LoadRunnerConifg(path); + + Runner = OpenTaiko.tテクスチャの生成($@"{path}{Path.DirectorySeparatorChar}Runner.png"); } + } - for (int i = 0; i < 128; i++) { - stRunners[i].ct進行 = null; - } - - OpenTaiko.tDisposeSafely(ref Runner); + // フィールド上で代入してたためこちらへ移動。 + base.Activate(); + } + public override void DeActivate() { + if (OpenTaiko.ConfigIni.SimpleMode) { base.DeActivate(); + return; } - public override void CreateManagedResource() { - base.CreateManagedResource(); + for (int i = 0; i < 128; i++) { + stRunners[i].ct進行 = null; } - public override void ReleaseManagedResource() { - base.ReleaseManagedResource(); - } + OpenTaiko.tDisposeSafely(ref Runner); - public override int Draw() { - if (OpenTaiko.ConfigIni.SimpleMode) { - return base.Draw(); - } + base.DeActivate(); + } - for (int i = 0; i < 128; i++) { - if (stRunners[i].b使用中) { - stRunners[i].nOldValue = stRunners[i].ct進行.CurrentValue; - stRunners[i].ct進行.Tick(); - if (stRunners[i].ct進行.IsEnded || stRunners[i].fX > OpenTaiko.Skin.Resolution[0]) { - stRunners[i].ct進行.Stop(); - stRunners[i].b使用中 = false; - } - for (int n = stRunners[i].nOldValue; n < stRunners[i].ct進行.CurrentValue; n++) { - stRunners[i].fX += (float)OpenTaiko.stage演奏ドラム画面.actPlayInfo.dbBPM[stRunners[i].nPlayer] / 18; - int Width = OpenTaiko.Skin.Resolution[0] / Ptn; - stRunners[i].nNowPtn = (int)stRunners[i].fX / Width; - } - if (Runner != null) { - if (stRunners[i].nPlayer == 0) { - Runner.t2D描画((int)(StartPoint_X[0] + stRunners[i].fX), StartPoint_Y[0], new Rectangle(stRunners[i].nNowPtn * Size[0], stRunners[i].nType * Size[1], Size[0], Size[1])); - } else { - Runner.t2D描画((int)(StartPoint_X[1] + stRunners[i].fX), StartPoint_Y[1], new Rectangle(stRunners[i].nNowPtn * Size[0], stRunners[i].nType * Size[1], Size[0], Size[1])); - } - } - } - } + public override void CreateManagedResource() { + base.CreateManagedResource(); + } + + public override void ReleaseManagedResource() { + base.ReleaseManagedResource(); + } + + public override int Draw() { + if (OpenTaiko.ConfigIni.SimpleMode) { return base.Draw(); } - #region[ private ] - //----------------- - [StructLayout(LayoutKind.Sequential)] - private struct STRunner { - public bool b使用中; - public int nPlayer; - public int nType; - public int nOldValue; - public int nNowPtn; - public float fX; - public CCounter ct進行; - } - private STRunner[] stRunners = new STRunner[128]; - Random random = new Random(); - int Index = 0; - - private CTexture Runner; - - private void LoadRunnerConifg(string dancerPath) { - var _str = ""; - OpenTaiko.Skin.LoadSkinConfigFromFile(dancerPath + @"\RunnerConfig.txt", ref _str); - - string[] delimiter = { "\n" }; - string[] strSingleLine = _str.Split(delimiter, StringSplitOptions.RemoveEmptyEntries); - - Size = new int[2] { 60, 125 }; - Ptn = 48; - Type = 4; - StartPoint_X = new int[2] { 175, 175 }; - StartPoint_Y = new int[2] { 40, 560 }; - Timer = 16; - - foreach (string s in strSingleLine) { - string str = s.Replace('\t', ' ').TrimStart(new char[] { '\t', ' ' }); - if ((str.Length != 0) && (str[0] != ';')) { - try { - string strCommand; - string strParam; - string[] strArray = str.Split(new char[] { '=' }); - - if (strArray.Length == 2) { - strCommand = strArray[0].Trim(); - strParam = strArray[1].Trim(); - - if (strCommand == "Game_Runner_Size") { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - Size[i] = int.Parse(strSplit[i]); - } - } else if (strCommand == "Game_Runner_Ptn") { - Ptn = int.Parse(strParam); - } else if (strCommand == "Game_Runner_Type") { - Type = int.Parse(strParam); - } else if (strCommand == "Game_Runner_Timer") { - Timer = int.Parse(strParam); - } else if (strCommand == "Game_Runner_StartPoint_X") { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - StartPoint_X[i] = int.Parse(strSplit[i]); - } - } else if (strCommand == "Game_Runner_StartPoint_Y") { - string[] strSplit = strParam.Split(','); - for (int i = 0; i < 2; i++) { - StartPoint_Y[i] = int.Parse(strSplit[i]); - } - } - - } - continue; - } catch (Exception exception) { - Trace.TraceError(exception.ToString()); - Trace.TraceError("例外が発生しましたが処理を継続します。 (6a32cc37-1527-412e-968a-512c1f0135cd)"); - continue; + for (int i = 0; i < 128; i++) { + if (stRunners[i].b使用中) { + stRunners[i].nOldValue = stRunners[i].ct進行.CurrentValue; + stRunners[i].ct進行.Tick(); + if (stRunners[i].ct進行.IsEnded || stRunners[i].fX > OpenTaiko.Skin.Resolution[0]) { + stRunners[i].ct進行.Stop(); + stRunners[i].b使用中 = false; + } + for (int n = stRunners[i].nOldValue; n < stRunners[i].ct進行.CurrentValue; n++) { + stRunners[i].fX += (float)OpenTaiko.stage演奏ドラム画面.actPlayInfo.dbBPM[stRunners[i].nPlayer] / 18; + int Width = OpenTaiko.Skin.Resolution[0] / Ptn; + stRunners[i].nNowPtn = (int)stRunners[i].fX / Width; + } + if (Runner != null) { + if (stRunners[i].nPlayer == 0) { + Runner.t2D描画((int)(StartPoint_X[0] + stRunners[i].fX), StartPoint_Y[0], new Rectangle(stRunners[i].nNowPtn * Size[0], stRunners[i].nType * Size[1], Size[0], Size[1])); + } else { + Runner.t2D描画((int)(StartPoint_X[1] + stRunners[i].fX), StartPoint_Y[1], new Rectangle(stRunners[i].nNowPtn * Size[0], stRunners[i].nType * Size[1], Size[0], Size[1])); } } } + } + return base.Draw(); + } + #region[ private ] + //----------------- + [StructLayout(LayoutKind.Sequential)] + private struct STRunner { + public bool b使用中; + public int nPlayer; + public int nType; + public int nOldValue; + public int nNowPtn; + public float fX; + public CCounter ct進行; + } + private STRunner[] stRunners = new STRunner[128]; + Random random = new Random(); + int Index = 0; + + private CTexture Runner; + + private void LoadRunnerConifg(string dancerPath) { + var _str = ""; + OpenTaiko.Skin.LoadSkinConfigFromFile(dancerPath + @"\RunnerConfig.txt", ref _str); + + string[] delimiter = { "\n" }; + string[] strSingleLine = _str.Split(delimiter, StringSplitOptions.RemoveEmptyEntries); + + Size = new int[2] { 60, 125 }; + Ptn = 48; + Type = 4; + StartPoint_X = new int[2] { 175, 175 }; + StartPoint_Y = new int[2] { 40, 560 }; + Timer = 16; + + foreach (string s in strSingleLine) { + string str = s.Replace('\t', ' ').TrimStart(new char[] { '\t', ' ' }); + if ((str.Length != 0) && (str[0] != ';')) { + try { + string strCommand; + string strParam; + string[] strArray = str.Split(new char[] { '=' }); + + if (strArray.Length == 2) { + strCommand = strArray[0].Trim(); + strParam = strArray[1].Trim(); + + if (strCommand == "Game_Runner_Size") { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + Size[i] = int.Parse(strSplit[i]); + } + } else if (strCommand == "Game_Runner_Ptn") { + Ptn = int.Parse(strParam); + } else if (strCommand == "Game_Runner_Type") { + Type = int.Parse(strParam); + } else if (strCommand == "Game_Runner_Timer") { + Timer = int.Parse(strParam); + } else if (strCommand == "Game_Runner_StartPoint_X") { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + StartPoint_X[i] = int.Parse(strSplit[i]); + } + } else if (strCommand == "Game_Runner_StartPoint_Y") { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) { + StartPoint_Y[i] = int.Parse(strSplit[i]); + } + } + + } + continue; + } catch (Exception exception) { + Trace.TraceError(exception.ToString()); + Trace.TraceError("例外が発生しましたが処理を継続します。 (6a32cc37-1527-412e-968a-512c1f0135cd)"); + continue; + } + } } - // ランナー画像のサイズ。 X, Y - private int[] Size; - // ランナーのコマ数 - private int Ptn; - // ランナーのキャラクターのバリエーション(ミス時を含まない)。 - private int Type; - private int Timer; - // スタート地点のX座標 1P, 2P - private int[] StartPoint_X; - // スタート地点のY座標 1P, 2P - private int[] StartPoint_Y; - - //----------------- - #endregion } + + // ランナー画像のサイズ。 X, Y + private int[] Size; + // ランナーのコマ数 + private int Ptn; + // ランナーのキャラクターのバリエーション(ミス時を含まない)。 + private int Type; + private int Timer; + // スタート地点のX座標 1P, 2P + private int[] StartPoint_X; + // スタート地点のY座標 1P, 2P + private int[] StartPoint_Y; + + //----------------- + #endregion } diff --git a/OpenTaiko/src/Stages/07.Game/Taiko/CActImplScore.cs b/OpenTaiko/src/Stages/07.Game/Taiko/CActImplScore.cs index 0e45902a..6d34f7c5 100644 --- a/OpenTaiko/src/Stages/07.Game/Taiko/CActImplScore.cs +++ b/OpenTaiko/src/Stages/07.Game/Taiko/CActImplScore.cs @@ -1,201 +1,201 @@ using FDK; -namespace OpenTaiko { - internal class CActImplScore : CAct演奏スコア共通 { - // CActivity 実装(共通クラスからの差分のみ) - - public unsafe override int Draw() { - if (!base.IsDeActivated) { - if (base.IsFirstDraw) { - base.IsFirstDraw = false; - } - long num = FDK.SoundManager.PlayTimer.NowTime; - - - if (!this.ctTimer.IsStoped) { - this.ctTimer.Tick(); - if (this.ctTimer.IsEnded) { - this.ctTimer.Stop(); - } - - //base.t小文字表示( 20, 150, string.Format( "{0,7:######0}", this.nスコアの増分.Guitar ) ); - } - - for (int i = 0; i < 5; i++) { - if (!this.ct点数アニメタイマ[i].IsStoped) { - this.ct点数アニメタイマ[i].Tick(); - if (this.ct点数アニメタイマ[i].IsEnded) { - this.ct点数アニメタイマ[i].Stop(); - } - } - } - - for (int i = 0; i < 5; i++) { - if (!this.ctボーナス加算タイマ[i].IsStoped) { - this.ctボーナス加算タイマ[i].Tick(); - if (this.ctボーナス加算タイマ[i].IsEnded) { - OpenTaiko.stage演奏ドラム画面.actScore.BonusAdd(i); - this.ctボーナス加算タイマ[i].Stop(); - } - } - } - - int[] x = new int[5]; - int[] y = new int[5]; - int[] add_x = new int[5]; - int[] add_y = new int[5]; - int[] addBonus_x = new int[5]; - int[] addBonus_y = new int[5]; - - for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { - if (OpenTaiko.ConfigIni.nPlayerCount == 5) { - x[i] = OpenTaiko.Skin.Game_Score_5P[0] + (OpenTaiko.Skin.Game_UIMove_5P[0] * i); - y[i] = OpenTaiko.Skin.Game_Score_5P[1] + (OpenTaiko.Skin.Game_UIMove_5P[1] * i); - add_x[i] = OpenTaiko.Skin.Game_Score_Add_5P[0] + (OpenTaiko.Skin.Game_UIMove_5P[0] * i); - add_y[i] = OpenTaiko.Skin.Game_Score_Add_5P[1] + (OpenTaiko.Skin.Game_UIMove_5P[1] * i); - addBonus_x[i] = OpenTaiko.Skin.Game_Score_AddBonus_5P[0] + (OpenTaiko.Skin.Game_UIMove_5P[0] * i); - addBonus_y[i] = OpenTaiko.Skin.Game_Score_AddBonus_5P[1] + (OpenTaiko.Skin.Game_UIMove_5P[1] * i); - } else if (OpenTaiko.ConfigIni.nPlayerCount == 4 || OpenTaiko.ConfigIni.nPlayerCount == 3) { - x[i] = OpenTaiko.Skin.Game_Score_4P[0] + (OpenTaiko.Skin.Game_UIMove_4P[0] * i); - y[i] = OpenTaiko.Skin.Game_Score_4P[1] + (OpenTaiko.Skin.Game_UIMove_4P[1] * i); - add_x[i] = OpenTaiko.Skin.Game_Score_Add_4P[0] + (OpenTaiko.Skin.Game_UIMove_4P[0] * i); - add_y[i] = OpenTaiko.Skin.Game_Score_Add_4P[1] + (OpenTaiko.Skin.Game_UIMove_4P[1] * i); - addBonus_x[i] = OpenTaiko.Skin.Game_Score_AddBonus_4P[0] + (OpenTaiko.Skin.Game_UIMove_4P[0] * i); - addBonus_y[i] = OpenTaiko.Skin.Game_Score_AddBonus_4P[1] + (OpenTaiko.Skin.Game_UIMove_4P[1] * i); - } else { - x[i] = OpenTaiko.Skin.Game_Score_X[i]; - y[i] = OpenTaiko.Skin.Game_Score_Y[i]; - add_x[i] = OpenTaiko.Skin.Game_Score_Add_X[i]; - add_y[i] = OpenTaiko.Skin.Game_Score_Add_Y[i]; - addBonus_x[i] = OpenTaiko.Skin.Game_Score_AddBonus_X[i]; - addBonus_y[i] = OpenTaiko.Skin.Game_Score_AddBonus_Y[i]; - } - } - - //CDTXMania.act文字コンソール.tPrint(0, 0, C文字コンソール.Eフォント種別.白, this.ctボーナス加算タイマ[0].n現在の値.ToString()); - - for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { - if (i == 1 && OpenTaiko.ConfigIni.bAIBattleMode) break; - - base.t小文字表示(x[i], y[i], string.Format("{0,7:######0}", this.nCurrentlyDisplayedScore[i]), 0, 256, i); - } - - for (int i = 0; i < 256; i++) { - if (this.stScore[i].b使用中) { - if (!this.stScore[i].ctTimer.IsStoped) { - this.stScore[i].ctTimer.Tick(); - if (this.stScore[i].ctTimer.IsEnded) { - if (this.stScore[i].b表示中 == true) - this.nNowDisplayedAddScore--; - this.stScore[i].ctTimer.Stop(); - this.stScore[i].b使用中 = false; - OpenTaiko.stage演奏ドラム画面.actDan.Update(); - } - - if (!stScore[i].bAddEnd) { - this.nCurrentlyDisplayedScore[this.stScore[i].nPlayer] += (long)this.stScore[i].nAddScore; - stScore[i].bAddEnd = true; - if (ct点数アニメタイマ[stScore[i].nPlayer].IsUnEnded) { - this.ct点数アニメタイマ[stScore[i].nPlayer] = new CCounter(0, 11, 13, OpenTaiko.Timer); - this.ct点数アニメタイマ[stScore[i].nPlayer].CurrentValue = 1; - } else { - this.ct点数アニメタイマ[stScore[i].nPlayer] = new CCounter(0, 11, 13, OpenTaiko.Timer); - } - } - - int xAdd = 0; - int yAdd = 0; - int alpha = 0; - - if (this.stScore[i].ctTimer.CurrentValue < 10) { - xAdd = 25; - alpha = 150; - } else if (this.stScore[i].ctTimer.CurrentValue < 20) { - xAdd = 10; - alpha = 200; - } else if (this.stScore[i].ctTimer.CurrentValue < 30) { - xAdd = -5; - alpha = 250; - } else if (this.stScore[i].ctTimer.CurrentValue < 40) { - xAdd = -9; - alpha = 256; - } else if (this.stScore[i].ctTimer.CurrentValue < 50) { - xAdd = -10; - alpha = 256; - } else if (this.stScore[i].ctTimer.CurrentValue < 60) { - xAdd = -9; - alpha = 256; - } else if (this.stScore[i].ctTimer.CurrentValue < 70) { - xAdd = -5; - alpha = 256; - } else if (this.stScore[i].ctTimer.CurrentValue < 80) { - xAdd = -3; - alpha = 256; - } else { - xAdd = 0; - alpha = 256; - } - - - - if (this.stScore[i].ctTimer.CurrentValue > 120) { - yAdd = -1; - } - if (this.stScore[i].ctTimer.CurrentValue > 130) { - yAdd = -5; - } - if (this.stScore[i].ctTimer.CurrentValue > 140) { - yAdd = -7; - } - if (this.stScore[i].ctTimer.CurrentValue > 150) { - yAdd = -8; - } - if (this.stScore[i].ctTimer.CurrentValue > 160) { - yAdd = -8; - alpha = 256; - } - if (this.stScore[i].ctTimer.CurrentValue > 170) { - yAdd = -6; - alpha = 256; - } - if (this.stScore[i].ctTimer.CurrentValue > 180) { - yAdd = 0; - alpha = 256; - } - if (this.stScore[i].ctTimer.CurrentValue > 190) { - yAdd = 5; - alpha = 200; - } - if (this.stScore[i].ctTimer.CurrentValue > 200) { - yAdd = 12; - alpha = 150; - } - if (this.stScore[i].ctTimer.CurrentValue > 210) { - yAdd = 20; - alpha = 0; - } - - int pl = stScore[i].nPlayer; - if (OpenTaiko.PlayerSide == 1 && OpenTaiko.ConfigIni.nPlayerCount == 1) - pl = 1; - - if (this.nNowDisplayedAddScore < 10 && this.stScore[i].bBonusScore == false && !OpenTaiko.ConfigIni.SimpleMode) - base.t小文字表示(add_x[this.stScore[i].nPlayer] + xAdd, this.stScore[i].nPlayer == 0 && OpenTaiko.ConfigIni.nPlayerCount <= 2 ? add_y[this.stScore[i].nPlayer] + yAdd : add_y[this.stScore[i].nPlayer] - yAdd, string.Format("{0,7:######0}", this.stScore[i].nAddScore), pl + 1, alpha, stScore[i].nPlayer); - if (this.nNowDisplayedAddScore < 10 && this.stScore[i].bBonusScore == true && !OpenTaiko.ConfigIni.SimpleMode) - base.t小文字表示(addBonus_x[this.stScore[i].nPlayer] + xAdd, addBonus_y[this.stScore[i].nPlayer], string.Format("{0,7:######0}", this.stScore[i].nAddScore), pl + 1, alpha, stScore[i].nPlayer); - else { - this.nNowDisplayedAddScore--; - this.stScore[i].b表示中 = false; - } - } - } - //CDTXMania.act文字コンソール.tPrint(50, 0, C文字コンソール.Eフォント種別.白, this.ct点数アニメタイマ[0].n現在の値.ToString()); - //CDTXMania.act文字コンソール.tPrint(50, 20, C文字コンソール.Eフォント種別.白, this.ct点数アニメタイマ[0].b進行中.ToString()); - } +namespace OpenTaiko; +internal class CActImplScore : CAct演奏スコア共通 { + // CActivity 実装(共通クラスからの差分のみ) + public unsafe override int Draw() { + if (!base.IsDeActivated) { + if (base.IsFirstDraw) { + base.IsFirstDraw = false; } - return 0; + long num = FDK.SoundManager.PlayTimer.NowTime; + + + if (!this.ctTimer.IsStoped) { + this.ctTimer.Tick(); + if (this.ctTimer.IsEnded) { + this.ctTimer.Stop(); + } + + //base.t小文字表示( 20, 150, string.Format( "{0,7:######0}", this.nスコアの増分.Guitar ) ); + } + + for (int i = 0; i < 5; i++) { + if (!this.ct点数アニメタイマ[i].IsStoped) { + this.ct点数アニメタイマ[i].Tick(); + if (this.ct点数アニメタイマ[i].IsEnded) { + this.ct点数アニメタイマ[i].Stop(); + } + } + } + + for (int i = 0; i < 5; i++) { + if (!this.ctボーナス加算タイマ[i].IsStoped) { + this.ctボーナス加算タイマ[i].Tick(); + if (this.ctボーナス加算タイマ[i].IsEnded) { + OpenTaiko.stage演奏ドラム画面.actScore.BonusAdd(i); + this.ctボーナス加算タイマ[i].Stop(); + } + } + } + + int[] x = new int[5]; + int[] y = new int[5]; + int[] add_x = new int[5]; + int[] add_y = new int[5]; + int[] addBonus_x = new int[5]; + int[] addBonus_y = new int[5]; + + for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { + if (OpenTaiko.ConfigIni.nPlayerCount == 5) { + x[i] = OpenTaiko.Skin.Game_Score_5P[0] + (OpenTaiko.Skin.Game_UIMove_5P[0] * i); + y[i] = OpenTaiko.Skin.Game_Score_5P[1] + (OpenTaiko.Skin.Game_UIMove_5P[1] * i); + add_x[i] = OpenTaiko.Skin.Game_Score_Add_5P[0] + (OpenTaiko.Skin.Game_UIMove_5P[0] * i); + add_y[i] = OpenTaiko.Skin.Game_Score_Add_5P[1] + (OpenTaiko.Skin.Game_UIMove_5P[1] * i); + addBonus_x[i] = OpenTaiko.Skin.Game_Score_AddBonus_5P[0] + (OpenTaiko.Skin.Game_UIMove_5P[0] * i); + addBonus_y[i] = OpenTaiko.Skin.Game_Score_AddBonus_5P[1] + (OpenTaiko.Skin.Game_UIMove_5P[1] * i); + } else if (OpenTaiko.ConfigIni.nPlayerCount == 4 || OpenTaiko.ConfigIni.nPlayerCount == 3) { + x[i] = OpenTaiko.Skin.Game_Score_4P[0] + (OpenTaiko.Skin.Game_UIMove_4P[0] * i); + y[i] = OpenTaiko.Skin.Game_Score_4P[1] + (OpenTaiko.Skin.Game_UIMove_4P[1] * i); + add_x[i] = OpenTaiko.Skin.Game_Score_Add_4P[0] + (OpenTaiko.Skin.Game_UIMove_4P[0] * i); + add_y[i] = OpenTaiko.Skin.Game_Score_Add_4P[1] + (OpenTaiko.Skin.Game_UIMove_4P[1] * i); + addBonus_x[i] = OpenTaiko.Skin.Game_Score_AddBonus_4P[0] + (OpenTaiko.Skin.Game_UIMove_4P[0] * i); + addBonus_y[i] = OpenTaiko.Skin.Game_Score_AddBonus_4P[1] + (OpenTaiko.Skin.Game_UIMove_4P[1] * i); + } else { + x[i] = OpenTaiko.Skin.Game_Score_X[i]; + y[i] = OpenTaiko.Skin.Game_Score_Y[i]; + add_x[i] = OpenTaiko.Skin.Game_Score_Add_X[i]; + add_y[i] = OpenTaiko.Skin.Game_Score_Add_Y[i]; + addBonus_x[i] = OpenTaiko.Skin.Game_Score_AddBonus_X[i]; + addBonus_y[i] = OpenTaiko.Skin.Game_Score_AddBonus_Y[i]; + } + } + + //CDTXMania.act文字コンソール.tPrint(0, 0, C文字コンソール.Eフォント種別.白, this.ctボーナス加算タイマ[0].n現在の値.ToString()); + + for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { + if (i == 1 && OpenTaiko.ConfigIni.bAIBattleMode) break; + + base.t小文字表示(x[i], y[i], string.Format("{0,7:######0}", this.nCurrentlyDisplayedScore[i]), 0, 256, i); + } + + for (int i = 0; i < 256; i++) { + if (this.stScore[i].b使用中) { + if (!this.stScore[i].ctTimer.IsStoped) { + this.stScore[i].ctTimer.Tick(); + if (this.stScore[i].ctTimer.IsEnded) { + if (this.stScore[i].b表示中 == true) + this.nNowDisplayedAddScore--; + this.stScore[i].ctTimer.Stop(); + this.stScore[i].b使用中 = false; + OpenTaiko.stage演奏ドラム画面.actDan.Update(); + } + + if (!stScore[i].bAddEnd) { + this.nCurrentlyDisplayedScore[this.stScore[i].nPlayer] += (long)this.stScore[i].nAddScore; + stScore[i].bAddEnd = true; + if (ct点数アニメタイマ[stScore[i].nPlayer].IsUnEnded) { + this.ct点数アニメタイマ[stScore[i].nPlayer] = new CCounter(0, 11, 13, OpenTaiko.Timer); + this.ct点数アニメタイマ[stScore[i].nPlayer].CurrentValue = 1; + } else { + this.ct点数アニメタイマ[stScore[i].nPlayer] = new CCounter(0, 11, 13, OpenTaiko.Timer); + } + } + + int xAdd = 0; + int yAdd = 0; + int alpha = 0; + + if (this.stScore[i].ctTimer.CurrentValue < 10) { + xAdd = 25; + alpha = 150; + } else if (this.stScore[i].ctTimer.CurrentValue < 20) { + xAdd = 10; + alpha = 200; + } else if (this.stScore[i].ctTimer.CurrentValue < 30) { + xAdd = -5; + alpha = 250; + } else if (this.stScore[i].ctTimer.CurrentValue < 40) { + xAdd = -9; + alpha = 256; + } else if (this.stScore[i].ctTimer.CurrentValue < 50) { + xAdd = -10; + alpha = 256; + } else if (this.stScore[i].ctTimer.CurrentValue < 60) { + xAdd = -9; + alpha = 256; + } else if (this.stScore[i].ctTimer.CurrentValue < 70) { + xAdd = -5; + alpha = 256; + } else if (this.stScore[i].ctTimer.CurrentValue < 80) { + xAdd = -3; + alpha = 256; + } else { + xAdd = 0; + alpha = 256; + } + + + + if (this.stScore[i].ctTimer.CurrentValue > 120) { + yAdd = -1; + } + if (this.stScore[i].ctTimer.CurrentValue > 130) { + yAdd = -5; + } + if (this.stScore[i].ctTimer.CurrentValue > 140) { + yAdd = -7; + } + if (this.stScore[i].ctTimer.CurrentValue > 150) { + yAdd = -8; + } + if (this.stScore[i].ctTimer.CurrentValue > 160) { + yAdd = -8; + alpha = 256; + } + if (this.stScore[i].ctTimer.CurrentValue > 170) { + yAdd = -6; + alpha = 256; + } + if (this.stScore[i].ctTimer.CurrentValue > 180) { + yAdd = 0; + alpha = 256; + } + if (this.stScore[i].ctTimer.CurrentValue > 190) { + yAdd = 5; + alpha = 200; + } + if (this.stScore[i].ctTimer.CurrentValue > 200) { + yAdd = 12; + alpha = 150; + } + if (this.stScore[i].ctTimer.CurrentValue > 210) { + yAdd = 20; + alpha = 0; + } + + int pl = stScore[i].nPlayer; + if (OpenTaiko.PlayerSide == 1 && OpenTaiko.ConfigIni.nPlayerCount == 1) + pl = 1; + + if (this.nNowDisplayedAddScore < 10 && this.stScore[i].bBonusScore == false && !OpenTaiko.ConfigIni.SimpleMode) + base.t小文字表示(add_x[this.stScore[i].nPlayer] + xAdd, this.stScore[i].nPlayer == 0 && OpenTaiko.ConfigIni.nPlayerCount <= 2 ? add_y[this.stScore[i].nPlayer] + yAdd : add_y[this.stScore[i].nPlayer] - yAdd, string.Format("{0,7:######0}", this.stScore[i].nAddScore), pl + 1, alpha, stScore[i].nPlayer); + if (this.nNowDisplayedAddScore < 10 && this.stScore[i].bBonusScore == true && !OpenTaiko.ConfigIni.SimpleMode) + base.t小文字表示(addBonus_x[this.stScore[i].nPlayer] + xAdd, addBonus_y[this.stScore[i].nPlayer], string.Format("{0,7:######0}", this.stScore[i].nAddScore), pl + 1, alpha, stScore[i].nPlayer); + else { + this.nNowDisplayedAddScore--; + this.stScore[i].b表示中 = false; + } + } + } + //CDTXMania.act文字コンソール.tPrint(50, 0, C文字コンソール.Eフォント種別.白, this.ct点数アニメタイマ[0].n現在の値.ToString()); + //CDTXMania.act文字コンソール.tPrint(50, 20, C文字コンソール.Eフォント種別.白, this.ct点数アニメタイマ[0].b進行中.ToString()); + } + + } + return 0; } } diff --git a/OpenTaiko/src/Stages/07.Game/Taiko/CActImplScoreRank.cs b/OpenTaiko/src/Stages/07.Game/Taiko/CActImplScoreRank.cs index 6765a391..066d318d 100644 --- a/OpenTaiko/src/Stages/07.Game/Taiko/CActImplScoreRank.cs +++ b/OpenTaiko/src/Stages/07.Game/Taiko/CActImplScoreRank.cs @@ -1,231 +1,231 @@ using FDK; -namespace OpenTaiko { - class CActImplScoreRank : CActivity { - public override void Activate() { - double RollTimems = 0; +namespace OpenTaiko; - /* - foreach (var chip in TJAPlayer3.DTX.listChip) +class CActImplScoreRank : CActivity { + public override void Activate() { + double RollTimems = 0; + + /* + foreach (var chip in TJAPlayer3.DTX.listChip) + { + if (NotesManager.IsRoll(chip)) { - if (NotesManager.IsRoll(chip)) - { - RollTimems += (chip.nノーツ終了時刻ms - chip.n発声時刻ms) / 1000.0; - } + RollTimems += (chip.nノーツ終了時刻ms - chip.n発声時刻ms) / 1000.0; } - */ + } + */ - for (int player = 0; player < 5; player++) { - this.ScoreRank[player] = new int[] { 500000, 600000, 700000, 800000, 900000, 950000, + for (int player = 0; player < 5; player++) { + this.ScoreRank[player] = new int[] { 500000, 600000, 700000, 800000, 900000, 950000, Math.Max(1000000, (int)(OpenTaiko.stage演奏ドラム画面.nAddScoreNiji[player] * OpenTaiko.stage演奏ドラム画面.nNoteCount[player]) + (int)(OpenTaiko.stage演奏ドラム画面.nBalloonCount[player] * 100) + (int)(Math.Ceiling(OpenTaiko.stage演奏ドラム画面.nRollTimeMs[player] * 16.6 / 10) * 100 * 10)) }; - for (int i = 0; i < 7; i++) { - this.counter[player][i] = new CCounter(); - } + for (int i = 0; i < 7; i++) { + this.counter[player][i] = new CCounter(); } - base.Activate(); } - - public override void DeActivate() { - base.DeActivate(); - } - - public override void CreateManagedResource() { - TowerResult_ScoreRankEffect = OpenTaiko.tテクスチャの生成(CSkin.Path($"{TextureLoader.BASE}{TextureLoader.TOWERRESULT}ScoreRankEffect.png")); - - base.CreateManagedResource(); - } - - public override void ReleaseManagedResource() { - - OpenTaiko.tDisposeSafely(ref TowerResult_ScoreRankEffect); - - base.ReleaseManagedResource(); - } - - private void displayScoreRank(int i, int player, float x, float y, int mode = 0) { - CCounter cct = this.counter[player][i]; - - CTexture tex = OpenTaiko.Tx.ScoreRank; - if (mode == 1) // tower - tex = TowerResult_ScoreRankEffect; - - if (tex == null) - return; - - if (!cct.IsTicked) { - cct.Start(0, 3000, 1, OpenTaiko.Timer); - } - if (cct.CurrentValue <= 255) { - tex.Opacity = cct.CurrentValue; - x = ((cct.CurrentValue / 255.0f) - 1.0f) * (player == 0 ? -OpenTaiko.Skin.Game_Judge_Move[0] : OpenTaiko.Skin.Game_Judge_Move[0]); - y = ((cct.CurrentValue / 255.0f) - 1.0f) * (player == 0 ? -OpenTaiko.Skin.Game_Judge_Move[1] : OpenTaiko.Skin.Game_Judge_Move[1]); - } - if (cct.CurrentValue > 255 && cct.CurrentValue <= 255 + 180) { - tex.Opacity = 255; - - float newSize = 1.0f + (float)Math.Sin((cct.CurrentValue - 255) * (Math.PI / 180)) * 0.2f; - tex.vcScaleRatio.X = newSize; - tex.vcScaleRatio.Y = newSize; - x = 0; - y = 0; - } - if (cct.CurrentValue > 255 + 180 && cct.CurrentValue <= 2745) { - tex.Opacity = 255; - tex.vcScaleRatio.X = 1.0f; - tex.vcScaleRatio.Y = 1.0f; - x = 0; - y = 0; - } - if (cct.CurrentValue >= 2745 && cct.CurrentValue <= 3000) { - tex.Opacity = 255 - ((cct.CurrentValue - 2745)); - x = ((cct.CurrentValue - 2745) / 255.0f) * (player == 0 || OpenTaiko.ConfigIni.nPlayerCount >= 2 ? -OpenTaiko.Skin.Game_Judge_Move[0] : OpenTaiko.Skin.Game_Judge_Move[0]); - y = ((cct.CurrentValue - 2745) / 255.0f) * (player == 0 || OpenTaiko.ConfigIni.nPlayerCount >= 2 ? -OpenTaiko.Skin.Game_Judge_Move[1] : OpenTaiko.Skin.Game_Judge_Move[1]); - } - - var xpos = 0; - var ypos = 0; - if (OpenTaiko.ConfigIni.nPlayerCount == 5) { - xpos = OpenTaiko.Skin.Game_ScoreRank_5P[0] + (OpenTaiko.Skin.Game_UIMove_5P[0] * player); - ypos = OpenTaiko.Skin.Game_ScoreRank_5P[1] + (OpenTaiko.Skin.Game_UIMove_5P[1] * player); - } else if (OpenTaiko.ConfigIni.nPlayerCount == 4 || OpenTaiko.ConfigIni.nPlayerCount == 3) { - xpos = OpenTaiko.Skin.Game_ScoreRank_4P[0] + (OpenTaiko.Skin.Game_UIMove_4P[0] * player); - ypos = OpenTaiko.Skin.Game_ScoreRank_4P[1] + (OpenTaiko.Skin.Game_UIMove_4P[1] * player); - } else { - xpos = OpenTaiko.Skin.Game_ScoreRank_X[player]; - ypos = OpenTaiko.Skin.Game_ScoreRank_Y[player]; - } - xpos += (int)x; - ypos += (int)y; - - int width; - int height; - - switch (mode) { - case 1: - width = tex.szTextureSize.Width / 7; - height = tex.szTextureSize.Height; - break; - default: - width = tex.szTextureSize.Width; - height = tex.szTextureSize.Height / 7; - break; - } - - if (mode == 0) - tex.t2D拡大率考慮中央基準描画(xpos, ypos, new System.Drawing.Rectangle(0, height * i, width, height)); - else if (mode == 1 && player == 0) - tex.t2D拡大率考慮中央基準描画(xpos, ypos, new System.Drawing.Rectangle(width * i, 0, width, height)); - } - - public override int Draw() { - if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] != (int)Difficulty.Dan) { - float x = 0; - float y = 0; - - for (int i = 0; i < 7; i++) { - if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] != (int)Difficulty.Tower) { - - for (int player = 0; player < 5; player++) { - #region [Ensou score ranks] - - counter[player][i].Tick(); - if (OpenTaiko.stage演奏ドラム画面.actScore.GetScore(player) >= ScoreRank[player][i]) { - displayScoreRank(i, player, x, y); - - #region [Legacy] - - /* - if (!this.counter[i].b進行中) - { - this.counter[i].t開始(0, 3000, 1, TJAPlayer3.Timer); - } - if (counter[i].n現在の値 <= 255) - { - TJAPlayer3.Tx.ScoreRank.Opacity = counter[i].n現在の値; - x = 51 - (counter[i].n現在の値 / 5.0f); - } - if (counter[i].n現在の値 > 255 && counter[i].n現在の値 <= 255 + 180) - { - TJAPlayer3.Tx.ScoreRank.Opacity = 255; - TJAPlayer3.Tx.ScoreRank.vc拡大縮小倍率.X = 1.0f + (float)Math.Sin((counter[i].n現在の値 - 255) * (Math.PI / 180)) * 0.2f; - TJAPlayer3.Tx.ScoreRank.vc拡大縮小倍率.Y = 1.0f + (float)Math.Sin((counter[i].n現在の値 - 255) * (Math.PI / 180)) * 0.2f; - x = 0; - } - if (counter[i].n現在の値 > 255 + 180 && counter[i].n現在の値 <= 2745) - { - TJAPlayer3.Tx.ScoreRank.Opacity = 255; - TJAPlayer3.Tx.ScoreRank.vc拡大縮小倍率.X = 1.0f; - TJAPlayer3.Tx.ScoreRank.vc拡大縮小倍率.Y = 1.0f; - x = 0; - } - if (counter[i].n現在の値 >= 2745 && counter[i].n現在の値 <= 3000) - { - TJAPlayer3.Tx.ScoreRank.Opacity = 255 - ((counter[i].n現在の値 - 2745)); - x = -((counter[i].n現在の値 - 2745) / 5.0f); - } - - TJAPlayer3.Tx.ScoreRank.t2D拡大率考慮中央基準描画(87, 98 + (int)x, new System.Drawing.Rectangle(0, i == 0 ? i * 114 : i * 120, 140, i == 0 ? 114 : 120)); - */ - - #endregion - } - - x = 0; - } - #endregion - } else if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Tower) { - #region [Tower score ranks] - - double progress = CFloorManagement.LastRegisteredFloor / ((double)OpenTaiko.stageSongSelect.rChoosenSong.arスコア[5].譜面情報.nTotalFloor); - - bool[] conditions = - { - progress >= 0.1, - progress >= 0.25, - progress >= 0.5, - progress >= 0.75, - progress == 1 && CFloorManagement.CurrentNumberOfLives > 0, - OpenTaiko.stage演奏ドラム画面.CChartScore[0].nMiss == 0 && OpenTaiko.stage演奏ドラム画面.CChartScore[0].nMine == 0, - OpenTaiko.stage演奏ドラム画面.CChartScore[0].nGood == 0 - }; - - counter[0][i].Tick(); - - bool satisfied = true; - for (int j = 0; j <= i; j++) - if (conditions[j] == false) { - satisfied = false; - break; - } - - - if (satisfied == true) { - displayScoreRank(i, 0, x, y, 1); - } - - #endregion - } - } - - - } - - //TJAPlayer3.act文字コンソール.tPrint(0, 0, C文字コンソール.Eフォント種別.白, ScoreRank[6].ToString()); - //TJAPlayer3.act文字コンソール.tPrint(0, 10, C文字コンソール.Eフォント種別.白, ScoreRank2P[6].ToString()); - - return base.Draw(); - } - - private CTexture TowerResult_ScoreRankEffect; - - public int[][] ScoreRank = new int[5][]; - private CCounter[][] counter = new CCounter[5][] { - new CCounter[7], - new CCounter[7], - new CCounter[7], - new CCounter[7], - new CCounter[7] - }; + base.Activate(); } + + public override void DeActivate() { + base.DeActivate(); + } + + public override void CreateManagedResource() { + TowerResult_ScoreRankEffect = OpenTaiko.tテクスチャの生成(CSkin.Path($"{TextureLoader.BASE}{TextureLoader.TOWERRESULT}ScoreRankEffect.png")); + + base.CreateManagedResource(); + } + + public override void ReleaseManagedResource() { + + OpenTaiko.tDisposeSafely(ref TowerResult_ScoreRankEffect); + + base.ReleaseManagedResource(); + } + + private void displayScoreRank(int i, int player, float x, float y, int mode = 0) { + CCounter cct = this.counter[player][i]; + + CTexture tex = OpenTaiko.Tx.ScoreRank; + if (mode == 1) // tower + tex = TowerResult_ScoreRankEffect; + + if (tex == null) + return; + + if (!cct.IsTicked) { + cct.Start(0, 3000, 1, OpenTaiko.Timer); + } + if (cct.CurrentValue <= 255) { + tex.Opacity = cct.CurrentValue; + x = ((cct.CurrentValue / 255.0f) - 1.0f) * (player == 0 ? -OpenTaiko.Skin.Game_Judge_Move[0] : OpenTaiko.Skin.Game_Judge_Move[0]); + y = ((cct.CurrentValue / 255.0f) - 1.0f) * (player == 0 ? -OpenTaiko.Skin.Game_Judge_Move[1] : OpenTaiko.Skin.Game_Judge_Move[1]); + } + if (cct.CurrentValue > 255 && cct.CurrentValue <= 255 + 180) { + tex.Opacity = 255; + + float newSize = 1.0f + (float)Math.Sin((cct.CurrentValue - 255) * (Math.PI / 180)) * 0.2f; + tex.vcScaleRatio.X = newSize; + tex.vcScaleRatio.Y = newSize; + x = 0; + y = 0; + } + if (cct.CurrentValue > 255 + 180 && cct.CurrentValue <= 2745) { + tex.Opacity = 255; + tex.vcScaleRatio.X = 1.0f; + tex.vcScaleRatio.Y = 1.0f; + x = 0; + y = 0; + } + if (cct.CurrentValue >= 2745 && cct.CurrentValue <= 3000) { + tex.Opacity = 255 - ((cct.CurrentValue - 2745)); + x = ((cct.CurrentValue - 2745) / 255.0f) * (player == 0 || OpenTaiko.ConfigIni.nPlayerCount >= 2 ? -OpenTaiko.Skin.Game_Judge_Move[0] : OpenTaiko.Skin.Game_Judge_Move[0]); + y = ((cct.CurrentValue - 2745) / 255.0f) * (player == 0 || OpenTaiko.ConfigIni.nPlayerCount >= 2 ? -OpenTaiko.Skin.Game_Judge_Move[1] : OpenTaiko.Skin.Game_Judge_Move[1]); + } + + var xpos = 0; + var ypos = 0; + if (OpenTaiko.ConfigIni.nPlayerCount == 5) { + xpos = OpenTaiko.Skin.Game_ScoreRank_5P[0] + (OpenTaiko.Skin.Game_UIMove_5P[0] * player); + ypos = OpenTaiko.Skin.Game_ScoreRank_5P[1] + (OpenTaiko.Skin.Game_UIMove_5P[1] * player); + } else if (OpenTaiko.ConfigIni.nPlayerCount == 4 || OpenTaiko.ConfigIni.nPlayerCount == 3) { + xpos = OpenTaiko.Skin.Game_ScoreRank_4P[0] + (OpenTaiko.Skin.Game_UIMove_4P[0] * player); + ypos = OpenTaiko.Skin.Game_ScoreRank_4P[1] + (OpenTaiko.Skin.Game_UIMove_4P[1] * player); + } else { + xpos = OpenTaiko.Skin.Game_ScoreRank_X[player]; + ypos = OpenTaiko.Skin.Game_ScoreRank_Y[player]; + } + xpos += (int)x; + ypos += (int)y; + + int width; + int height; + + switch (mode) { + case 1: + width = tex.szTextureSize.Width / 7; + height = tex.szTextureSize.Height; + break; + default: + width = tex.szTextureSize.Width; + height = tex.szTextureSize.Height / 7; + break; + } + + if (mode == 0) + tex.t2D拡大率考慮中央基準描画(xpos, ypos, new System.Drawing.Rectangle(0, height * i, width, height)); + else if (mode == 1 && player == 0) + tex.t2D拡大率考慮中央基準描画(xpos, ypos, new System.Drawing.Rectangle(width * i, 0, width, height)); + } + + public override int Draw() { + if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] != (int)Difficulty.Dan) { + float x = 0; + float y = 0; + + for (int i = 0; i < 7; i++) { + if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] != (int)Difficulty.Tower) { + + for (int player = 0; player < 5; player++) { + #region [Ensou score ranks] + + counter[player][i].Tick(); + if (OpenTaiko.stage演奏ドラム画面.actScore.GetScore(player) >= ScoreRank[player][i]) { + displayScoreRank(i, player, x, y); + + #region [Legacy] + + /* + if (!this.counter[i].b進行中) + { + this.counter[i].t開始(0, 3000, 1, TJAPlayer3.Timer); + } + if (counter[i].n現在の値 <= 255) + { + TJAPlayer3.Tx.ScoreRank.Opacity = counter[i].n現在の値; + x = 51 - (counter[i].n現在の値 / 5.0f); + } + if (counter[i].n現在の値 > 255 && counter[i].n現在の値 <= 255 + 180) + { + TJAPlayer3.Tx.ScoreRank.Opacity = 255; + TJAPlayer3.Tx.ScoreRank.vc拡大縮小倍率.X = 1.0f + (float)Math.Sin((counter[i].n現在の値 - 255) * (Math.PI / 180)) * 0.2f; + TJAPlayer3.Tx.ScoreRank.vc拡大縮小倍率.Y = 1.0f + (float)Math.Sin((counter[i].n現在の値 - 255) * (Math.PI / 180)) * 0.2f; + x = 0; + } + if (counter[i].n現在の値 > 255 + 180 && counter[i].n現在の値 <= 2745) + { + TJAPlayer3.Tx.ScoreRank.Opacity = 255; + TJAPlayer3.Tx.ScoreRank.vc拡大縮小倍率.X = 1.0f; + TJAPlayer3.Tx.ScoreRank.vc拡大縮小倍率.Y = 1.0f; + x = 0; + } + if (counter[i].n現在の値 >= 2745 && counter[i].n現在の値 <= 3000) + { + TJAPlayer3.Tx.ScoreRank.Opacity = 255 - ((counter[i].n現在の値 - 2745)); + x = -((counter[i].n現在の値 - 2745) / 5.0f); + } + + TJAPlayer3.Tx.ScoreRank.t2D拡大率考慮中央基準描画(87, 98 + (int)x, new System.Drawing.Rectangle(0, i == 0 ? i * 114 : i * 120, 140, i == 0 ? 114 : 120)); + */ + + #endregion + } + + x = 0; + } + #endregion + } else if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Tower) { + #region [Tower score ranks] + + double progress = CFloorManagement.LastRegisteredFloor / ((double)OpenTaiko.stageSongSelect.rChoosenSong.arスコア[5].譜面情報.nTotalFloor); + + bool[] conditions = + { + progress >= 0.1, + progress >= 0.25, + progress >= 0.5, + progress >= 0.75, + progress == 1 && CFloorManagement.CurrentNumberOfLives > 0, + OpenTaiko.stage演奏ドラム画面.CChartScore[0].nMiss == 0 && OpenTaiko.stage演奏ドラム画面.CChartScore[0].nMine == 0, + OpenTaiko.stage演奏ドラム画面.CChartScore[0].nGood == 0 + }; + + counter[0][i].Tick(); + + bool satisfied = true; + for (int j = 0; j <= i; j++) + if (conditions[j] == false) { + satisfied = false; + break; + } + + + if (satisfied == true) { + displayScoreRank(i, 0, x, y, 1); + } + + #endregion + } + } + + + } + + //TJAPlayer3.act文字コンソール.tPrint(0, 0, C文字コンソール.Eフォント種別.白, ScoreRank[6].ToString()); + //TJAPlayer3.act文字コンソール.tPrint(0, 10, C文字コンソール.Eフォント種別.白, ScoreRank2P[6].ToString()); + + return base.Draw(); + } + + private CTexture TowerResult_ScoreRankEffect; + + public int[][] ScoreRank = new int[5][]; + private CCounter[][] counter = new CCounter[5][] { + new CCounter[7], + new CCounter[7], + new CCounter[7], + new CCounter[7], + new CCounter[7] + }; } diff --git a/OpenTaiko/src/Stages/07.Game/Taiko/CActImplTrainingMode.cs b/OpenTaiko/src/Stages/07.Game/Taiko/CActImplTrainingMode.cs index b939dffa..2f974b85 100644 --- a/OpenTaiko/src/Stages/07.Game/Taiko/CActImplTrainingMode.cs +++ b/OpenTaiko/src/Stages/07.Game/Taiko/CActImplTrainingMode.cs @@ -1,507 +1,506 @@ using System.Drawing; using FDK; -namespace OpenTaiko { - class CActImplTrainingMode : CActivity { - public CActImplTrainingMode() { - base.IsDeActivated = true; - } +namespace OpenTaiko; - public override void Activate() { - this.nCurrentMeasure = 0; - this.bTrainingPAUSE = false; - this.n最終演奏位置ms = 0; - - base.Activate(); - - CDTX dTX = OpenTaiko.DTX; - - var measureCount = 1; - var bIsInGoGo = false; - - int endtime = 1; - int bgmlength = 1; - - for (int index = 0; index < OpenTaiko.DTX.listChip.Count; index++) { - if (OpenTaiko.DTX.listChip[index].nチャンネル番号 == 0xff) { - endtime = OpenTaiko.DTX.listChip[index].n発声時刻ms; - break; - } - } - for (int index = 0; index < OpenTaiko.DTX.listChip.Count; index++) { - if (OpenTaiko.DTX.listChip[index].nチャンネル番号 == 0x01) { - bgmlength = OpenTaiko.DTX.listChip[index].GetDuration() + OpenTaiko.DTX.listChip[index].n発声時刻ms; - break; - } - } - - length = Math.Max(endtime, bgmlength); - - gogoXList = new List(); - JumpPointList = new List(); - - for (int i = 0; i < dTX.listChip.Count; i++) { - CDTX.CChip pChip = dTX.listChip[i]; - - if (pChip.n整数値_内部番号 > measureCount && pChip.nチャンネル番号 == 0x50) measureCount = pChip.n整数値_内部番号; - - if (pChip.nチャンネル番号 == 0x9E && !bIsInGoGo) { - bIsInGoGo = true; - - var current = ((double)(pChip.db発声時刻ms * OpenTaiko.ConfigIni.SongPlaybackSpeed)); - var width = 0; - if (OpenTaiko.Tx.Tokkun_ProgressBar != null) width = OpenTaiko.Tx.Tokkun_ProgressBar.szTextureSize.Width; - - this.gogoXList.Add((int)(width * (current / length))); - } - if (pChip.nチャンネル番号 == 0x9F && bIsInGoGo) { - bIsInGoGo = false; - } - } - - this.nMeasureCount = measureCount; - - if (OpenTaiko.Tx.Tokkun_Background_Up != null) this.ctBackgroundScrollTimer = new CCounter(1, OpenTaiko.Tx.Tokkun_Background_Up.szTextureSize.Width, 16, OpenTaiko.Timer); - } - - public override void DeActivate() { - length = 1; - gogoXList = null; - JumpPointList = null; - - this.ctScrollCounter = null; - this.ctBackgroundScrollTimer = null; - base.DeActivate(); - } - - public override void CreateManagedResource() { - base.CreateManagedResource(); - } - - public override void ReleaseManagedResource() { - base.ReleaseManagedResource(); - } - - public override int Draw() { - if (!base.IsDeActivated) { - if (base.IsFirstDraw) { - base.IsFirstDraw = false; - } - - OpenTaiko.actTextConsole.Print(0, 0, CTextConsole.EFontType.White, "TRAINING MODE (BETA)"); - - if (OpenTaiko.ConfigIni.KeyAssign.KeyIsPressed(OpenTaiko.ConfigIni.KeyAssign.Drums.TrainingPause)) { - if (this.bTrainingPAUSE) { - OpenTaiko.Skin.sound特訓再生音.tPlay(); - this.tResumePlay(); - } else { - OpenTaiko.Skin.sound特訓停止音.tPlay(); - this.tPausePlay(); - } - } - if (OpenTaiko.ConfigIni.KeyAssign.KeyIsPressed(OpenTaiko.ConfigIni.KeyAssign.Drums.TrainingSkipForwardMeasure)) { - if (this.bTrainingPAUSE) { - this.nCurrentMeasure += OpenTaiko.ConfigIni.TokkunSkipMeasures; - if (this.nCurrentMeasure > this.nMeasureCount) - this.nCurrentMeasure = this.nMeasureCount; - - OpenTaiko.stage演奏ドラム画面.actPlayInfo.NowMeasure[0] = this.nCurrentMeasure; - - this.tMatchWithTheChartDisplayPosition(true); - OpenTaiko.Skin.soundTrainingModeScrollSFX.tPlay(); - } - } - if (OpenTaiko.ConfigIni.KeyAssign.KeyIsPressed(OpenTaiko.ConfigIni.KeyAssign.Drums.TrainingSkipBackMeasure)) { - if (this.bTrainingPAUSE) { - this.nCurrentMeasure -= OpenTaiko.ConfigIni.TokkunSkipMeasures; - if (this.nCurrentMeasure <= 0) - this.nCurrentMeasure = 1; - - OpenTaiko.stage演奏ドラム画面.actPlayInfo.NowMeasure[0] = this.nCurrentMeasure; - - this.tMatchWithTheChartDisplayPosition(true); - OpenTaiko.Skin.soundTrainingModeScrollSFX.tPlay(); - } - } - if (OpenTaiko.ConfigIni.KeyAssign.KeyIsPressed(OpenTaiko.ConfigIni.KeyAssign.Drums.TrainingMoveForwardMeasure)) { - if (this.bTrainingPAUSE) { - if (this.nCurrentMeasure < this.nMeasureCount) { - this.nCurrentMeasure++; - OpenTaiko.stage演奏ドラム画面.actPlayInfo.NowMeasure[0] = this.nCurrentMeasure; - - this.tMatchWithTheChartDisplayPosition(true); - OpenTaiko.Skin.soundTrainingModeScrollSFX.tPlay(); - } - if (t配列の値interval以下か(ref this.RBlue, SoundManager.PlayTimer.SystemTimeMs, OpenTaiko.ConfigIni.TokkunMashInterval)) { - for (int index = 0; index < this.JumpPointList.Count; index++) { - if (this.JumpPointList[index].Time >= SoundManager.PlayTimer.NowTimeMs * OpenTaiko.ConfigIni.SongPlaybackSpeed) { - this.nCurrentMeasure = this.JumpPointList[index].Measure; - OpenTaiko.stage演奏ドラム画面.actPlayInfo.NowMeasure[0] = this.nCurrentMeasure; - OpenTaiko.Skin.soundSkip.tPlay(); - this.tMatchWithTheChartDisplayPosition(false); - break; - } - } - } - - } - } - if (OpenTaiko.ConfigIni.KeyAssign.KeyIsPressed(OpenTaiko.ConfigIni.KeyAssign.Drums.TrainingMoveBackMeasure)) { - if (this.bTrainingPAUSE) { - if (this.nCurrentMeasure > 1) { - this.nCurrentMeasure--; - OpenTaiko.stage演奏ドラム画面.actPlayInfo.NowMeasure[0] = this.nCurrentMeasure; - - this.tMatchWithTheChartDisplayPosition(true); - OpenTaiko.Skin.soundTrainingModeScrollSFX.tPlay(); - } - if (t配列の値interval以下か(ref this.LBlue, SoundManager.PlayTimer.SystemTimeMs, OpenTaiko.ConfigIni.TokkunMashInterval)) { - for (int index = this.JumpPointList.Count - 1; index >= 0; index--) { - if (this.JumpPointList[index].Time <= SoundManager.PlayTimer.NowTimeMs * OpenTaiko.ConfigIni.SongPlaybackSpeed) { - this.nCurrentMeasure = this.JumpPointList[index].Measure; - OpenTaiko.stage演奏ドラム画面.actPlayInfo.NowMeasure[0] = this.nCurrentMeasure; - OpenTaiko.Skin.sound特訓スキップ音.tPlay(); - this.tMatchWithTheChartDisplayPosition(false); - break; - } - } - } - } - } - if (OpenTaiko.ConfigIni.KeyAssign.KeyIsPressed(OpenTaiko.ConfigIni.KeyAssign.Drums.TrainingDecreaseSongSpeed)) { - if (this.bTrainingPAUSE) { - if (OpenTaiko.ConfigIni.nSongSpeed > 6) { - OpenTaiko.ConfigIni.nSongSpeed = OpenTaiko.ConfigIni.nSongSpeed - 2; - this.tMatchWithTheChartDisplayPosition(false); - } - } - } - if (OpenTaiko.ConfigIni.KeyAssign.KeyIsPressed(OpenTaiko.ConfigIni.KeyAssign.Drums.TrainingIncreaseSongSpeed)) { - if (this.bTrainingPAUSE) { - if (OpenTaiko.ConfigIni.nSongSpeed < 399) { - OpenTaiko.ConfigIni.nSongSpeed = OpenTaiko.ConfigIni.nSongSpeed + 2; - this.tMatchWithTheChartDisplayPosition(false); - } - } - } - if (OpenTaiko.ConfigIni.KeyAssign.KeyIsPressed(OpenTaiko.ConfigIni.KeyAssign.Drums.TrainingJumpToFirstMeasure)) { - if (this.bTrainingPAUSE) { - if (this.nCurrentMeasure > 1) { - this.nCurrentMeasure = 1; - OpenTaiko.stage演奏ドラム画面.actPlayInfo.NowMeasure[0] = this.nCurrentMeasure; - - this.tMatchWithTheChartDisplayPosition(true); - OpenTaiko.Skin.soundTrainingModeScrollSFX.tPlay(); - } - } - } - if (OpenTaiko.ConfigIni.KeyAssign.KeyIsPressed(OpenTaiko.ConfigIni.KeyAssign.Drums.TrainingJumpToLastMeasure)) { - if (this.bTrainingPAUSE) { - if (this.nCurrentMeasure < this.nMeasureCount) { - this.nCurrentMeasure = this.nMeasureCount; - OpenTaiko.stage演奏ドラム画面.actPlayInfo.NowMeasure[0] = this.nCurrentMeasure; - - this.tMatchWithTheChartDisplayPosition(true); - OpenTaiko.Skin.soundTrainingModeScrollSFX.tPlay(); - } - } - } - if (OpenTaiko.ConfigIni.KeyAssign.KeyIsPressed(OpenTaiko.ConfigIni.KeyAssign.Drums.TrainingBookmark)) - this.tToggleBookmarkAtTheCurrentPosition(); - - if (this.bCurrentlyScrolling) { - SoundManager.PlayTimer.NowTimeMs = easing.EaseOut(this.ctScrollCounter, (int)this.nスクロール前ms, (int)this.nスクロール後ms, Easing.CalcType.Circular); - - this.ctScrollCounter.Tick(); - - if ((int)SoundManager.PlayTimer.NowTimeMs == (int)this.nスクロール後ms) { - this.bCurrentlyScrolling = false; - SoundManager.PlayTimer.NowTimeMs = this.nスクロール後ms; - } - } - if (!this.bTrainingPAUSE) { - if (this.nCurrentMeasure < OpenTaiko.stage演奏ドラム画面.actPlayInfo.NowMeasure[0]) { - this.nCurrentMeasure = OpenTaiko.stage演奏ドラム画面.actPlayInfo.NowMeasure[0]; - } - - if (SoundManager.PlayTimer.NowTimeMs * OpenTaiko.ConfigIni.SongPlaybackSpeed > this.n最終演奏位置ms) { - this.n最終演奏位置ms = (long)(SoundManager.PlayTimer.NowTimeMs * OpenTaiko.ConfigIni.SongPlaybackSpeed); - } - } - - } - - var current = (double)(SoundManager.PlayTimer.NowTimeMs * OpenTaiko.ConfigIni.SongPlaybackSpeed); - var percentage = current / length; - - var currentWhite = (double)(this.n最終演奏位置ms); - var percentageWhite = currentWhite / length; - - if (OpenTaiko.Tx.Tokkun_ProgressBarWhite != null) OpenTaiko.Tx.Tokkun_ProgressBarWhite.t2D描画(OpenTaiko.Skin.Game_Training_ProgressBar_XY[0], OpenTaiko.Skin.Game_Training_ProgressBar_XY[1], new Rectangle(1, 1, (int)(OpenTaiko.Tx.Tokkun_ProgressBarWhite.szTextureSize.Width * percentageWhite), OpenTaiko.Tx.Tokkun_ProgressBarWhite.szTextureSize.Height)); - if (OpenTaiko.Tx.Tokkun_ProgressBar != null) OpenTaiko.Tx.Tokkun_ProgressBar.t2D描画(OpenTaiko.Skin.Game_Training_ProgressBar_XY[0], OpenTaiko.Skin.Game_Training_ProgressBar_XY[1], new Rectangle(1, 1, (int)(OpenTaiko.Tx.Tokkun_ProgressBar.szTextureSize.Width * percentage), OpenTaiko.Tx.Tokkun_ProgressBar.szTextureSize.Height)); - if (OpenTaiko.Tx.Tokkun_GoGoPoint != null) { - foreach (int xpos in gogoXList) { - OpenTaiko.Tx.Tokkun_GoGoPoint.t2D描画(xpos + OpenTaiko.Skin.Game_Training_ProgressBar_XY[0] - (OpenTaiko.Tx.Tokkun_GoGoPoint.szTextureSize.Width / 2), OpenTaiko.Skin.Game_Training_GoGoPoint_Y); - } - } - - if (OpenTaiko.Tx.Tokkun_JumpPoint != null) { - foreach (STJUMPP xpos in JumpPointList) { - var width = 0; - if (OpenTaiko.Tx.Tokkun_ProgressBar != null) width = OpenTaiko.Tx.Tokkun_ProgressBar.szTextureSize.Width; - - int x = (int)((double)width * ((double)xpos.Time / (double)length)); - OpenTaiko.Tx.Tokkun_JumpPoint.t2D描画(x + OpenTaiko.Skin.Game_Training_ProgressBar_XY[0] - (OpenTaiko.Tx.Tokkun_JumpPoint.szTextureSize.Width / 2), OpenTaiko.Skin.Game_Training_JumpPoint_Y); - } - } - - return base.Draw(); - } - - public int On進行描画_背景() { - if (this.ctBackgroundScrollTimer != null) { - this.ctBackgroundScrollTimer.TickLoop(); - - double TexSize = OpenTaiko.Skin.Resolution[0] / OpenTaiko.Tx.Tokkun_Background_Up.szTextureSize.Width; - // 1280をテクスチャサイズで割ったものを切り上げて、プラス+1足す。 - int ForLoop = (int)Math.Ceiling(TexSize) + 1; - OpenTaiko.Tx.Tokkun_Background_Up.t2D描画(0 - this.ctBackgroundScrollTimer.CurrentValue, OpenTaiko.Skin.Background_Scroll_Y[0]); - for (int l = 1; l < ForLoop + 1; l++) { - OpenTaiko.Tx.Tokkun_Background_Up.t2D描画(+(l * OpenTaiko.Tx.Tokkun_Background_Up.szTextureSize.Width) - this.ctBackgroundScrollTimer.CurrentValue, OpenTaiko.Skin.Background_Scroll_Y[0]); - } - } - - if (OpenTaiko.Tx.Tokkun_DownBG != null) OpenTaiko.Tx.Tokkun_DownBG.t2D描画(OpenTaiko.Skin.Game_Training_DownBG[0], OpenTaiko.Skin.Game_Training_DownBG[1]); - if (OpenTaiko.Tx.Tokkun_BigTaiko != null) OpenTaiko.Tx.Tokkun_BigTaiko.t2D描画(OpenTaiko.Skin.Game_Training_BigTaiko[0], OpenTaiko.Skin.Game_Training_BigTaiko[1]); - - return base.Draw(); - } - - public void On進行描画_小節_速度() { - if (OpenTaiko.Tx.Tokkun_Speed_Measure != null) - OpenTaiko.Tx.Tokkun_Speed_Measure.t2D描画(OpenTaiko.Skin.Game_Training_Speed_Measure[0], OpenTaiko.Skin.Game_Training_Speed_Measure[1]); - var maxMeasureStr = this.nMeasureCount.ToString(); - var measureStr = OpenTaiko.stage演奏ドラム画面.actPlayInfo.NowMeasure[0].ToString(); - if (OpenTaiko.Tx.Tokkun_SmallNumber != null) { - var x = OpenTaiko.Skin.Game_Training_MaxMeasureCount_XY[0]; - foreach (char c in maxMeasureStr) { - var currentNum = int.Parse(c.ToString()); - OpenTaiko.Tx.Tokkun_SmallNumber.t2D描画(x, OpenTaiko.Skin.Game_Training_MaxMeasureCount_XY[1], new Rectangle(OpenTaiko.Skin.Game_Training_SmallNumber_Width * currentNum, 0, OpenTaiko.Skin.Game_Training_SmallNumber_Width, OpenTaiko.Tx.Tokkun_SmallNumber.szTextureSize.Height)); - x += OpenTaiko.Skin.Game_Training_SmallNumber_Width - 2; - } - } - - var subtractVal = (OpenTaiko.Skin.Game_Training_BigNumber_Width - 2) * (measureStr.Length - 1); - - if (OpenTaiko.Tx.Tokkun_BigNumber != null) { - var x = OpenTaiko.Skin.Game_Training_CurrentMeasureCount_XY[0]; - foreach (char c in measureStr) { - var currentNum = int.Parse(c.ToString()); - OpenTaiko.Tx.Tokkun_BigNumber.t2D描画(x - subtractVal, OpenTaiko.Skin.Game_Training_CurrentMeasureCount_XY[1], new Rectangle(OpenTaiko.Skin.Game_Training_BigNumber_Width * currentNum, 0, OpenTaiko.Skin.Game_Training_BigNumber_Width, OpenTaiko.Tx.Tokkun_BigNumber.szTextureSize.Height)); - x += OpenTaiko.Skin.Game_Training_BigNumber_Width - 2; - } - - var PlaySpdtmp = OpenTaiko.ConfigIni.SongPlaybackSpeed * 10.0d; - PlaySpdtmp = Math.Round(PlaySpdtmp, MidpointRounding.AwayFromZero); - - var playSpd = PlaySpdtmp / 10.0d; - var playSpdI = playSpd - (int)playSpd; - var playSpdStr = Decimal.Round((decimal)playSpdI, 1, MidpointRounding.AwayFromZero).ToString(); - var decimalStr = (playSpdStr == "0") ? "0" : playSpdStr[2].ToString(); - - OpenTaiko.Tx.Tokkun_BigNumber.t2D描画(OpenTaiko.Skin.Game_Training_SpeedDisplay_XY[0], OpenTaiko.Skin.Game_Training_SpeedDisplay_XY[1], new Rectangle(OpenTaiko.Skin.Game_Training_BigNumber_Width * int.Parse(decimalStr), 0, OpenTaiko.Skin.Game_Training_BigNumber_Width, OpenTaiko.Tx.Tokkun_BigNumber.szTextureSize.Height)); - - x = OpenTaiko.Skin.Game_Training_SpeedDisplay_XY[0] - 25; - - subtractVal = OpenTaiko.Skin.Game_Training_BigNumber_Width * (((int)playSpd).ToString().Length - 1); - - foreach (char c in ((int)playSpd).ToString()) { - var currentNum = int.Parse(c.ToString()); - OpenTaiko.Tx.Tokkun_BigNumber.t2D描画(x - subtractVal, OpenTaiko.Skin.Game_Training_SpeedDisplay_XY[1], new Rectangle(OpenTaiko.Skin.Game_Training_BigNumber_Width * currentNum, 0, OpenTaiko.Skin.Game_Training_BigNumber_Width, OpenTaiko.Tx.Tokkun_BigNumber.szTextureSize.Height)); - x += OpenTaiko.Skin.Game_Training_BigNumber_Width - 2; - } - } - } - - public void tPausePlay() { - CDTX dTX = OpenTaiko.DTX; - - this.nスクロール後ms = SoundManager.PlayTimer.NowTimeMs; - - OpenTaiko.stage演奏ドラム画面.Activate(); - SoundManager.PlayTimer.Pause(); - - for (int i = 0; i < dTX.listChip.Count; i++) { - CDTX.CChip pChip = dTX.listChip[i]; - pChip.bHit = false; - if (dTX.listChip[i].nチャンネル番号 != 0x50) { - pChip.bShow = true; - pChip.b可視 = true; - } - } - - OpenTaiko.DTX.t全チップの再生一時停止(); - OpenTaiko.stage演奏ドラム画面.bPAUSE = true; - OpenTaiko.stage演奏ドラム画面.actPlayInfo.NowMeasure[0] = this.nCurrentMeasure; - this.bTrainingPAUSE = true; - if (OpenTaiko.ConfigIni.bTokkunMode && OpenTaiko.stage演奏ドラム画面.actBalloon.KusudamaIsActive) OpenTaiko.stage演奏ドラム画面.actBalloon.KusuMiss(); - - this.tMatchWithTheChartDisplayPosition(false); - } - - public void tResumePlay() { - CDTX dTX = OpenTaiko.DTX; - - this.bCurrentlyScrolling = false; - SoundManager.PlayTimer.NowTimeMs = this.nスクロール後ms; - - int n演奏開始Chip = OpenTaiko.stage演奏ドラム画面.n現在のトップChip; - int finalStartBar; - - finalStartBar = this.nCurrentMeasure - 2; - if (finalStartBar < 0) finalStartBar = 0; - - OpenTaiko.stage演奏ドラム画面.t演奏位置の変更(finalStartBar, 0); - - - int n少し戻ってから演奏開始Chip = OpenTaiko.stage演奏ドラム画面.n現在のトップChip; - - OpenTaiko.stage演奏ドラム画面.actPlayInfo.NowMeasure[0] = 0; - OpenTaiko.stage演奏ドラム画面.t数値の初期化(true, true); - OpenTaiko.stage演奏ドラム画面.Activate(); - if (OpenTaiko.ConfigIni.bTokkunMode && OpenTaiko.stage演奏ドラム画面.actBalloon.KusudamaIsActive) OpenTaiko.stage演奏ドラム画面.actBalloon.KusuMiss(); - - for (int i = 0; i < dTX.listChip.Count; i++) { - - //if (i < n演奏開始Chip && (dTX.listChip[i].nチャンネル番号 > 0x10 && dTX.listChip[i].nチャンネル番号 < 0x20)) //2020.07.08 ノーツだけ消す。 null参照回避のために順番変更 - if (i < n演奏開始Chip && NotesManager.IsHittableNote(dTX.listChip[i])) { - dTX.listChip[i].bHit = true; - dTX.listChip[i].IsHitted = true; - dTX.listChip[i].b可視 = false; - dTX.listChip[i].bShow = false; - } - if (i < n少し戻ってから演奏開始Chip && dTX.listChip[i].nチャンネル番号 == 0x01) { - dTX.listChip[i].bHit = true; - dTX.listChip[i].IsHitted = true; - dTX.listChip[i].b可視 = false; - dTX.listChip[i].bShow = false; - } - if (dTX.listChip[i].nチャンネル番号 == 0x50 && dTX.listChip[i].n整数値_内部番号 < finalStartBar) { - dTX.listChip[i].bHit = true; - dTX.listChip[i].IsHitted = true; - } - - } - - for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { - OpenTaiko.stage演奏ドラム画面.chip現在処理中の連打チップ[i] = null; - } - - this.bTrainingPAUSE = false; - } - - public void tMatchWithTheChartDisplayPosition(bool doScroll) { - this.nスクロール前ms = SoundManager.PlayTimer.NowTimeMs; - - CDTX dTX = OpenTaiko.DTX; - - bool bSuccessSeek = false; - for (int i = 0; i < dTX.listChip.Count; i++) { - CDTX.CChip pChip = dTX.listChip[i]; - - if (pChip.nチャンネル番号 == 0x50 && pChip.n整数値_内部番号 > nCurrentMeasure - 1) { - bSuccessSeek = true; - OpenTaiko.stage演奏ドラム画面.n現在のトップChip = i; - break; - } - } - if (!bSuccessSeek) { - OpenTaiko.stage演奏ドラム画面.n現在のトップChip = 0; - } else { - while (dTX.listChip[OpenTaiko.stage演奏ドラム画面.n現在のトップChip].n発声時刻ms == dTX.listChip[OpenTaiko.stage演奏ドラム画面.n現在のトップChip - 1].n発声時刻ms && OpenTaiko.stage演奏ドラム画面.n現在のトップChip != 0) - OpenTaiko.stage演奏ドラム画面.n現在のトップChip--; - } - - if (doScroll) { - this.nスクロール後ms = (long)(dTX.listChip[OpenTaiko.stage演奏ドラム画面.n現在のトップChip].n発声時刻ms / OpenTaiko.ConfigIni.SongPlaybackSpeed); - this.bCurrentlyScrolling = true; - - this.ctScrollCounter = new CCounter(0, OpenTaiko.Skin.Game_Training_ScrollTime, 1, OpenTaiko.Timer); - } else { - SoundManager.PlayTimer.NowTimeMs = (long)(dTX.listChip[OpenTaiko.stage演奏ドラム画面.n現在のトップChip].n発声時刻ms / OpenTaiko.ConfigIni.SongPlaybackSpeed); - this.nスクロール後ms = SoundManager.PlayTimer.NowTimeMs; - } - } - - public void tToggleBookmarkAtTheCurrentPosition() { - if (!this.bCurrentlyScrolling && this.bTrainingPAUSE) { - STJUMPP _JumpPoint = new STJUMPP() { Time = (long)(SoundManager.PlayTimer.NowTimeMs * OpenTaiko.ConfigIni.SongPlaybackSpeed), Measure = this.nCurrentMeasure }; - - if (!JumpPointList.Contains(_JumpPoint)) - JumpPointList.Add(_JumpPoint); - else - JumpPointList.Remove(_JumpPoint); - OpenTaiko.Skin.soundTrainingToggleBookmarkSFX.tPlay(); - JumpPointList.Sort((a, b) => a.Time.CompareTo(b.Time)); - } - } - - private bool t配列の値interval以下か(ref long[] array, long num, int interval) { - long[] arraytmp = array; - for (int index = 0; index < (array.Length - 1); index++) { - array[index] = array[index + 1]; - } - array[array.Length - 1] = num; - return Math.Abs(num - arraytmp[0]) <= interval; - } - - public int nCurrentMeasure; - public int nMeasureCount; - - #region [private] - private long nスクロール前ms; - private long nスクロール後ms; - private long n最終演奏位置ms; - - public bool bTrainingPAUSE { get; private set; } - private bool bCurrentlyScrolling; - - private CCounter ctScrollCounter; - private CCounter ctBackgroundScrollTimer; - private Easing easing = new Easing(); - private long length = 1; - - private List gogoXList; - private List JumpPointList; - private long[] LBlue = new long[] { 0, 0, 0, 0, 0 }; - private long[] RBlue = new long[] { 0, 0, 0, 0, 0 }; - - private struct STJUMPP { - public long Time; - public int Measure; - } - - /// - /// - /// - /// 今の時間 - /// 最初の値 - /// 最終の値-最初の値 - /// 全体の時間 - /// - private int EasingCircular(int time, int begin, int change, int duration) { - double t = time, b = begin, c = change, d = duration; - - t = t / d * 2; - if (t < 1) - return (int)(-c / 2 * (Math.Sqrt(1 - t * t) - 1) + b); - else { - t = t - 2; - return (int)(c / 2 * (Math.Sqrt(1 - t * t) + 1) + b); - } - } - - #endregion +class CActImplTrainingMode : CActivity { + public CActImplTrainingMode() { + base.IsDeActivated = true; } -} + public override void Activate() { + this.nCurrentMeasure = 0; + this.bTrainingPAUSE = false; + this.n最終演奏位置ms = 0; + + base.Activate(); + + CDTX dTX = OpenTaiko.DTX; + + var measureCount = 1; + var bIsInGoGo = false; + + int endtime = 1; + int bgmlength = 1; + + for (int index = 0; index < OpenTaiko.DTX.listChip.Count; index++) { + if (OpenTaiko.DTX.listChip[index].nチャンネル番号 == 0xff) { + endtime = OpenTaiko.DTX.listChip[index].n発声時刻ms; + break; + } + } + for (int index = 0; index < OpenTaiko.DTX.listChip.Count; index++) { + if (OpenTaiko.DTX.listChip[index].nチャンネル番号 == 0x01) { + bgmlength = OpenTaiko.DTX.listChip[index].GetDuration() + OpenTaiko.DTX.listChip[index].n発声時刻ms; + break; + } + } + + length = Math.Max(endtime, bgmlength); + + gogoXList = new List(); + JumpPointList = new List(); + + for (int i = 0; i < dTX.listChip.Count; i++) { + CDTX.CChip pChip = dTX.listChip[i]; + + if (pChip.n整数値_内部番号 > measureCount && pChip.nチャンネル番号 == 0x50) measureCount = pChip.n整数値_内部番号; + + if (pChip.nチャンネル番号 == 0x9E && !bIsInGoGo) { + bIsInGoGo = true; + + var current = ((double)(pChip.db発声時刻ms * OpenTaiko.ConfigIni.SongPlaybackSpeed)); + var width = 0; + if (OpenTaiko.Tx.Tokkun_ProgressBar != null) width = OpenTaiko.Tx.Tokkun_ProgressBar.szTextureSize.Width; + + this.gogoXList.Add((int)(width * (current / length))); + } + if (pChip.nチャンネル番号 == 0x9F && bIsInGoGo) { + bIsInGoGo = false; + } + } + + this.nMeasureCount = measureCount; + + if (OpenTaiko.Tx.Tokkun_Background_Up != null) this.ctBackgroundScrollTimer = new CCounter(1, OpenTaiko.Tx.Tokkun_Background_Up.szTextureSize.Width, 16, OpenTaiko.Timer); + } + + public override void DeActivate() { + length = 1; + gogoXList = null; + JumpPointList = null; + + this.ctScrollCounter = null; + this.ctBackgroundScrollTimer = null; + base.DeActivate(); + } + + public override void CreateManagedResource() { + base.CreateManagedResource(); + } + + public override void ReleaseManagedResource() { + base.ReleaseManagedResource(); + } + + public override int Draw() { + if (!base.IsDeActivated) { + if (base.IsFirstDraw) { + base.IsFirstDraw = false; + } + + OpenTaiko.actTextConsole.Print(0, 0, CTextConsole.EFontType.White, "TRAINING MODE (BETA)"); + + if (OpenTaiko.ConfigIni.KeyAssign.KeyIsPressed(OpenTaiko.ConfigIni.KeyAssign.Drums.TrainingPause)) { + if (this.bTrainingPAUSE) { + OpenTaiko.Skin.sound特訓再生音.tPlay(); + this.tResumePlay(); + } else { + OpenTaiko.Skin.sound特訓停止音.tPlay(); + this.tPausePlay(); + } + } + if (OpenTaiko.ConfigIni.KeyAssign.KeyIsPressed(OpenTaiko.ConfigIni.KeyAssign.Drums.TrainingSkipForwardMeasure)) { + if (this.bTrainingPAUSE) { + this.nCurrentMeasure += OpenTaiko.ConfigIni.TokkunSkipMeasures; + if (this.nCurrentMeasure > this.nMeasureCount) + this.nCurrentMeasure = this.nMeasureCount; + + OpenTaiko.stage演奏ドラム画面.actPlayInfo.NowMeasure[0] = this.nCurrentMeasure; + + this.tMatchWithTheChartDisplayPosition(true); + OpenTaiko.Skin.soundTrainingModeScrollSFX.tPlay(); + } + } + if (OpenTaiko.ConfigIni.KeyAssign.KeyIsPressed(OpenTaiko.ConfigIni.KeyAssign.Drums.TrainingSkipBackMeasure)) { + if (this.bTrainingPAUSE) { + this.nCurrentMeasure -= OpenTaiko.ConfigIni.TokkunSkipMeasures; + if (this.nCurrentMeasure <= 0) + this.nCurrentMeasure = 1; + + OpenTaiko.stage演奏ドラム画面.actPlayInfo.NowMeasure[0] = this.nCurrentMeasure; + + this.tMatchWithTheChartDisplayPosition(true); + OpenTaiko.Skin.soundTrainingModeScrollSFX.tPlay(); + } + } + if (OpenTaiko.ConfigIni.KeyAssign.KeyIsPressed(OpenTaiko.ConfigIni.KeyAssign.Drums.TrainingMoveForwardMeasure)) { + if (this.bTrainingPAUSE) { + if (this.nCurrentMeasure < this.nMeasureCount) { + this.nCurrentMeasure++; + OpenTaiko.stage演奏ドラム画面.actPlayInfo.NowMeasure[0] = this.nCurrentMeasure; + + this.tMatchWithTheChartDisplayPosition(true); + OpenTaiko.Skin.soundTrainingModeScrollSFX.tPlay(); + } + if (t配列の値interval以下か(ref this.RBlue, SoundManager.PlayTimer.SystemTimeMs, OpenTaiko.ConfigIni.TokkunMashInterval)) { + for (int index = 0; index < this.JumpPointList.Count; index++) { + if (this.JumpPointList[index].Time >= SoundManager.PlayTimer.NowTimeMs * OpenTaiko.ConfigIni.SongPlaybackSpeed) { + this.nCurrentMeasure = this.JumpPointList[index].Measure; + OpenTaiko.stage演奏ドラム画面.actPlayInfo.NowMeasure[0] = this.nCurrentMeasure; + OpenTaiko.Skin.soundSkip.tPlay(); + this.tMatchWithTheChartDisplayPosition(false); + break; + } + } + } + + } + } + if (OpenTaiko.ConfigIni.KeyAssign.KeyIsPressed(OpenTaiko.ConfigIni.KeyAssign.Drums.TrainingMoveBackMeasure)) { + if (this.bTrainingPAUSE) { + if (this.nCurrentMeasure > 1) { + this.nCurrentMeasure--; + OpenTaiko.stage演奏ドラム画面.actPlayInfo.NowMeasure[0] = this.nCurrentMeasure; + + this.tMatchWithTheChartDisplayPosition(true); + OpenTaiko.Skin.soundTrainingModeScrollSFX.tPlay(); + } + if (t配列の値interval以下か(ref this.LBlue, SoundManager.PlayTimer.SystemTimeMs, OpenTaiko.ConfigIni.TokkunMashInterval)) { + for (int index = this.JumpPointList.Count - 1; index >= 0; index--) { + if (this.JumpPointList[index].Time <= SoundManager.PlayTimer.NowTimeMs * OpenTaiko.ConfigIni.SongPlaybackSpeed) { + this.nCurrentMeasure = this.JumpPointList[index].Measure; + OpenTaiko.stage演奏ドラム画面.actPlayInfo.NowMeasure[0] = this.nCurrentMeasure; + OpenTaiko.Skin.sound特訓スキップ音.tPlay(); + this.tMatchWithTheChartDisplayPosition(false); + break; + } + } + } + } + } + if (OpenTaiko.ConfigIni.KeyAssign.KeyIsPressed(OpenTaiko.ConfigIni.KeyAssign.Drums.TrainingDecreaseSongSpeed)) { + if (this.bTrainingPAUSE) { + if (OpenTaiko.ConfigIni.nSongSpeed > 6) { + OpenTaiko.ConfigIni.nSongSpeed = OpenTaiko.ConfigIni.nSongSpeed - 2; + this.tMatchWithTheChartDisplayPosition(false); + } + } + } + if (OpenTaiko.ConfigIni.KeyAssign.KeyIsPressed(OpenTaiko.ConfigIni.KeyAssign.Drums.TrainingIncreaseSongSpeed)) { + if (this.bTrainingPAUSE) { + if (OpenTaiko.ConfigIni.nSongSpeed < 399) { + OpenTaiko.ConfigIni.nSongSpeed = OpenTaiko.ConfigIni.nSongSpeed + 2; + this.tMatchWithTheChartDisplayPosition(false); + } + } + } + if (OpenTaiko.ConfigIni.KeyAssign.KeyIsPressed(OpenTaiko.ConfigIni.KeyAssign.Drums.TrainingJumpToFirstMeasure)) { + if (this.bTrainingPAUSE) { + if (this.nCurrentMeasure > 1) { + this.nCurrentMeasure = 1; + OpenTaiko.stage演奏ドラム画面.actPlayInfo.NowMeasure[0] = this.nCurrentMeasure; + + this.tMatchWithTheChartDisplayPosition(true); + OpenTaiko.Skin.soundTrainingModeScrollSFX.tPlay(); + } + } + } + if (OpenTaiko.ConfigIni.KeyAssign.KeyIsPressed(OpenTaiko.ConfigIni.KeyAssign.Drums.TrainingJumpToLastMeasure)) { + if (this.bTrainingPAUSE) { + if (this.nCurrentMeasure < this.nMeasureCount) { + this.nCurrentMeasure = this.nMeasureCount; + OpenTaiko.stage演奏ドラム画面.actPlayInfo.NowMeasure[0] = this.nCurrentMeasure; + + this.tMatchWithTheChartDisplayPosition(true); + OpenTaiko.Skin.soundTrainingModeScrollSFX.tPlay(); + } + } + } + if (OpenTaiko.ConfigIni.KeyAssign.KeyIsPressed(OpenTaiko.ConfigIni.KeyAssign.Drums.TrainingBookmark)) + this.tToggleBookmarkAtTheCurrentPosition(); + + if (this.bCurrentlyScrolling) { + SoundManager.PlayTimer.NowTimeMs = easing.EaseOut(this.ctScrollCounter, (int)this.nスクロール前ms, (int)this.nスクロール後ms, Easing.CalcType.Circular); + + this.ctScrollCounter.Tick(); + + if ((int)SoundManager.PlayTimer.NowTimeMs == (int)this.nスクロール後ms) { + this.bCurrentlyScrolling = false; + SoundManager.PlayTimer.NowTimeMs = this.nスクロール後ms; + } + } + if (!this.bTrainingPAUSE) { + if (this.nCurrentMeasure < OpenTaiko.stage演奏ドラム画面.actPlayInfo.NowMeasure[0]) { + this.nCurrentMeasure = OpenTaiko.stage演奏ドラム画面.actPlayInfo.NowMeasure[0]; + } + + if (SoundManager.PlayTimer.NowTimeMs * OpenTaiko.ConfigIni.SongPlaybackSpeed > this.n最終演奏位置ms) { + this.n最終演奏位置ms = (long)(SoundManager.PlayTimer.NowTimeMs * OpenTaiko.ConfigIni.SongPlaybackSpeed); + } + } + + } + + var current = (double)(SoundManager.PlayTimer.NowTimeMs * OpenTaiko.ConfigIni.SongPlaybackSpeed); + var percentage = current / length; + + var currentWhite = (double)(this.n最終演奏位置ms); + var percentageWhite = currentWhite / length; + + if (OpenTaiko.Tx.Tokkun_ProgressBarWhite != null) OpenTaiko.Tx.Tokkun_ProgressBarWhite.t2D描画(OpenTaiko.Skin.Game_Training_ProgressBar_XY[0], OpenTaiko.Skin.Game_Training_ProgressBar_XY[1], new Rectangle(1, 1, (int)(OpenTaiko.Tx.Tokkun_ProgressBarWhite.szTextureSize.Width * percentageWhite), OpenTaiko.Tx.Tokkun_ProgressBarWhite.szTextureSize.Height)); + if (OpenTaiko.Tx.Tokkun_ProgressBar != null) OpenTaiko.Tx.Tokkun_ProgressBar.t2D描画(OpenTaiko.Skin.Game_Training_ProgressBar_XY[0], OpenTaiko.Skin.Game_Training_ProgressBar_XY[1], new Rectangle(1, 1, (int)(OpenTaiko.Tx.Tokkun_ProgressBar.szTextureSize.Width * percentage), OpenTaiko.Tx.Tokkun_ProgressBar.szTextureSize.Height)); + if (OpenTaiko.Tx.Tokkun_GoGoPoint != null) { + foreach (int xpos in gogoXList) { + OpenTaiko.Tx.Tokkun_GoGoPoint.t2D描画(xpos + OpenTaiko.Skin.Game_Training_ProgressBar_XY[0] - (OpenTaiko.Tx.Tokkun_GoGoPoint.szTextureSize.Width / 2), OpenTaiko.Skin.Game_Training_GoGoPoint_Y); + } + } + + if (OpenTaiko.Tx.Tokkun_JumpPoint != null) { + foreach (STJUMPP xpos in JumpPointList) { + var width = 0; + if (OpenTaiko.Tx.Tokkun_ProgressBar != null) width = OpenTaiko.Tx.Tokkun_ProgressBar.szTextureSize.Width; + + int x = (int)((double)width * ((double)xpos.Time / (double)length)); + OpenTaiko.Tx.Tokkun_JumpPoint.t2D描画(x + OpenTaiko.Skin.Game_Training_ProgressBar_XY[0] - (OpenTaiko.Tx.Tokkun_JumpPoint.szTextureSize.Width / 2), OpenTaiko.Skin.Game_Training_JumpPoint_Y); + } + } + + return base.Draw(); + } + + public int On進行描画_背景() { + if (this.ctBackgroundScrollTimer != null) { + this.ctBackgroundScrollTimer.TickLoop(); + + double TexSize = OpenTaiko.Skin.Resolution[0] / OpenTaiko.Tx.Tokkun_Background_Up.szTextureSize.Width; + // 1280をテクスチャサイズで割ったものを切り上げて、プラス+1足す。 + int ForLoop = (int)Math.Ceiling(TexSize) + 1; + OpenTaiko.Tx.Tokkun_Background_Up.t2D描画(0 - this.ctBackgroundScrollTimer.CurrentValue, OpenTaiko.Skin.Background_Scroll_Y[0]); + for (int l = 1; l < ForLoop + 1; l++) { + OpenTaiko.Tx.Tokkun_Background_Up.t2D描画(+(l * OpenTaiko.Tx.Tokkun_Background_Up.szTextureSize.Width) - this.ctBackgroundScrollTimer.CurrentValue, OpenTaiko.Skin.Background_Scroll_Y[0]); + } + } + + if (OpenTaiko.Tx.Tokkun_DownBG != null) OpenTaiko.Tx.Tokkun_DownBG.t2D描画(OpenTaiko.Skin.Game_Training_DownBG[0], OpenTaiko.Skin.Game_Training_DownBG[1]); + if (OpenTaiko.Tx.Tokkun_BigTaiko != null) OpenTaiko.Tx.Tokkun_BigTaiko.t2D描画(OpenTaiko.Skin.Game_Training_BigTaiko[0], OpenTaiko.Skin.Game_Training_BigTaiko[1]); + + return base.Draw(); + } + + public void On進行描画_小節_速度() { + if (OpenTaiko.Tx.Tokkun_Speed_Measure != null) + OpenTaiko.Tx.Tokkun_Speed_Measure.t2D描画(OpenTaiko.Skin.Game_Training_Speed_Measure[0], OpenTaiko.Skin.Game_Training_Speed_Measure[1]); + var maxMeasureStr = this.nMeasureCount.ToString(); + var measureStr = OpenTaiko.stage演奏ドラム画面.actPlayInfo.NowMeasure[0].ToString(); + if (OpenTaiko.Tx.Tokkun_SmallNumber != null) { + var x = OpenTaiko.Skin.Game_Training_MaxMeasureCount_XY[0]; + foreach (char c in maxMeasureStr) { + var currentNum = int.Parse(c.ToString()); + OpenTaiko.Tx.Tokkun_SmallNumber.t2D描画(x, OpenTaiko.Skin.Game_Training_MaxMeasureCount_XY[1], new Rectangle(OpenTaiko.Skin.Game_Training_SmallNumber_Width * currentNum, 0, OpenTaiko.Skin.Game_Training_SmallNumber_Width, OpenTaiko.Tx.Tokkun_SmallNumber.szTextureSize.Height)); + x += OpenTaiko.Skin.Game_Training_SmallNumber_Width - 2; + } + } + + var subtractVal = (OpenTaiko.Skin.Game_Training_BigNumber_Width - 2) * (measureStr.Length - 1); + + if (OpenTaiko.Tx.Tokkun_BigNumber != null) { + var x = OpenTaiko.Skin.Game_Training_CurrentMeasureCount_XY[0]; + foreach (char c in measureStr) { + var currentNum = int.Parse(c.ToString()); + OpenTaiko.Tx.Tokkun_BigNumber.t2D描画(x - subtractVal, OpenTaiko.Skin.Game_Training_CurrentMeasureCount_XY[1], new Rectangle(OpenTaiko.Skin.Game_Training_BigNumber_Width * currentNum, 0, OpenTaiko.Skin.Game_Training_BigNumber_Width, OpenTaiko.Tx.Tokkun_BigNumber.szTextureSize.Height)); + x += OpenTaiko.Skin.Game_Training_BigNumber_Width - 2; + } + + var PlaySpdtmp = OpenTaiko.ConfigIni.SongPlaybackSpeed * 10.0d; + PlaySpdtmp = Math.Round(PlaySpdtmp, MidpointRounding.AwayFromZero); + + var playSpd = PlaySpdtmp / 10.0d; + var playSpdI = playSpd - (int)playSpd; + var playSpdStr = Decimal.Round((decimal)playSpdI, 1, MidpointRounding.AwayFromZero).ToString(); + var decimalStr = (playSpdStr == "0") ? "0" : playSpdStr[2].ToString(); + + OpenTaiko.Tx.Tokkun_BigNumber.t2D描画(OpenTaiko.Skin.Game_Training_SpeedDisplay_XY[0], OpenTaiko.Skin.Game_Training_SpeedDisplay_XY[1], new Rectangle(OpenTaiko.Skin.Game_Training_BigNumber_Width * int.Parse(decimalStr), 0, OpenTaiko.Skin.Game_Training_BigNumber_Width, OpenTaiko.Tx.Tokkun_BigNumber.szTextureSize.Height)); + + x = OpenTaiko.Skin.Game_Training_SpeedDisplay_XY[0] - 25; + + subtractVal = OpenTaiko.Skin.Game_Training_BigNumber_Width * (((int)playSpd).ToString().Length - 1); + + foreach (char c in ((int)playSpd).ToString()) { + var currentNum = int.Parse(c.ToString()); + OpenTaiko.Tx.Tokkun_BigNumber.t2D描画(x - subtractVal, OpenTaiko.Skin.Game_Training_SpeedDisplay_XY[1], new Rectangle(OpenTaiko.Skin.Game_Training_BigNumber_Width * currentNum, 0, OpenTaiko.Skin.Game_Training_BigNumber_Width, OpenTaiko.Tx.Tokkun_BigNumber.szTextureSize.Height)); + x += OpenTaiko.Skin.Game_Training_BigNumber_Width - 2; + } + } + } + + public void tPausePlay() { + CDTX dTX = OpenTaiko.DTX; + + this.nスクロール後ms = SoundManager.PlayTimer.NowTimeMs; + + OpenTaiko.stage演奏ドラム画面.Activate(); + SoundManager.PlayTimer.Pause(); + + for (int i = 0; i < dTX.listChip.Count; i++) { + CDTX.CChip pChip = dTX.listChip[i]; + pChip.bHit = false; + if (dTX.listChip[i].nチャンネル番号 != 0x50) { + pChip.bShow = true; + pChip.b可視 = true; + } + } + + OpenTaiko.DTX.t全チップの再生一時停止(); + OpenTaiko.stage演奏ドラム画面.bPAUSE = true; + OpenTaiko.stage演奏ドラム画面.actPlayInfo.NowMeasure[0] = this.nCurrentMeasure; + this.bTrainingPAUSE = true; + if (OpenTaiko.ConfigIni.bTokkunMode && OpenTaiko.stage演奏ドラム画面.actBalloon.KusudamaIsActive) OpenTaiko.stage演奏ドラム画面.actBalloon.KusuMiss(); + + this.tMatchWithTheChartDisplayPosition(false); + } + + public void tResumePlay() { + CDTX dTX = OpenTaiko.DTX; + + this.bCurrentlyScrolling = false; + SoundManager.PlayTimer.NowTimeMs = this.nスクロール後ms; + + int n演奏開始Chip = OpenTaiko.stage演奏ドラム画面.n現在のトップChip; + int finalStartBar; + + finalStartBar = this.nCurrentMeasure - 2; + if (finalStartBar < 0) finalStartBar = 0; + + OpenTaiko.stage演奏ドラム画面.t演奏位置の変更(finalStartBar, 0); + + + int n少し戻ってから演奏開始Chip = OpenTaiko.stage演奏ドラム画面.n現在のトップChip; + + OpenTaiko.stage演奏ドラム画面.actPlayInfo.NowMeasure[0] = 0; + OpenTaiko.stage演奏ドラム画面.t数値の初期化(true, true); + OpenTaiko.stage演奏ドラム画面.Activate(); + if (OpenTaiko.ConfigIni.bTokkunMode && OpenTaiko.stage演奏ドラム画面.actBalloon.KusudamaIsActive) OpenTaiko.stage演奏ドラム画面.actBalloon.KusuMiss(); + + for (int i = 0; i < dTX.listChip.Count; i++) { + + //if (i < n演奏開始Chip && (dTX.listChip[i].nチャンネル番号 > 0x10 && dTX.listChip[i].nチャンネル番号 < 0x20)) //2020.07.08 ノーツだけ消す。 null参照回避のために順番変更 + if (i < n演奏開始Chip && NotesManager.IsHittableNote(dTX.listChip[i])) { + dTX.listChip[i].bHit = true; + dTX.listChip[i].IsHitted = true; + dTX.listChip[i].b可視 = false; + dTX.listChip[i].bShow = false; + } + if (i < n少し戻ってから演奏開始Chip && dTX.listChip[i].nチャンネル番号 == 0x01) { + dTX.listChip[i].bHit = true; + dTX.listChip[i].IsHitted = true; + dTX.listChip[i].b可視 = false; + dTX.listChip[i].bShow = false; + } + if (dTX.listChip[i].nチャンネル番号 == 0x50 && dTX.listChip[i].n整数値_内部番号 < finalStartBar) { + dTX.listChip[i].bHit = true; + dTX.listChip[i].IsHitted = true; + } + + } + + for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { + OpenTaiko.stage演奏ドラム画面.chip現在処理中の連打チップ[i] = null; + } + + this.bTrainingPAUSE = false; + } + + public void tMatchWithTheChartDisplayPosition(bool doScroll) { + this.nスクロール前ms = SoundManager.PlayTimer.NowTimeMs; + + CDTX dTX = OpenTaiko.DTX; + + bool bSuccessSeek = false; + for (int i = 0; i < dTX.listChip.Count; i++) { + CDTX.CChip pChip = dTX.listChip[i]; + + if (pChip.nチャンネル番号 == 0x50 && pChip.n整数値_内部番号 > nCurrentMeasure - 1) { + bSuccessSeek = true; + OpenTaiko.stage演奏ドラム画面.n現在のトップChip = i; + break; + } + } + if (!bSuccessSeek) { + OpenTaiko.stage演奏ドラム画面.n現在のトップChip = 0; + } else { + while (dTX.listChip[OpenTaiko.stage演奏ドラム画面.n現在のトップChip].n発声時刻ms == dTX.listChip[OpenTaiko.stage演奏ドラム画面.n現在のトップChip - 1].n発声時刻ms && OpenTaiko.stage演奏ドラム画面.n現在のトップChip != 0) + OpenTaiko.stage演奏ドラム画面.n現在のトップChip--; + } + + if (doScroll) { + this.nスクロール後ms = (long)(dTX.listChip[OpenTaiko.stage演奏ドラム画面.n現在のトップChip].n発声時刻ms / OpenTaiko.ConfigIni.SongPlaybackSpeed); + this.bCurrentlyScrolling = true; + + this.ctScrollCounter = new CCounter(0, OpenTaiko.Skin.Game_Training_ScrollTime, 1, OpenTaiko.Timer); + } else { + SoundManager.PlayTimer.NowTimeMs = (long)(dTX.listChip[OpenTaiko.stage演奏ドラム画面.n現在のトップChip].n発声時刻ms / OpenTaiko.ConfigIni.SongPlaybackSpeed); + this.nスクロール後ms = SoundManager.PlayTimer.NowTimeMs; + } + } + + public void tToggleBookmarkAtTheCurrentPosition() { + if (!this.bCurrentlyScrolling && this.bTrainingPAUSE) { + STJUMPP _JumpPoint = new STJUMPP() { Time = (long)(SoundManager.PlayTimer.NowTimeMs * OpenTaiko.ConfigIni.SongPlaybackSpeed), Measure = this.nCurrentMeasure }; + + if (!JumpPointList.Contains(_JumpPoint)) + JumpPointList.Add(_JumpPoint); + else + JumpPointList.Remove(_JumpPoint); + OpenTaiko.Skin.soundTrainingToggleBookmarkSFX.tPlay(); + JumpPointList.Sort((a, b) => a.Time.CompareTo(b.Time)); + } + } + + private bool t配列の値interval以下か(ref long[] array, long num, int interval) { + long[] arraytmp = array; + for (int index = 0; index < (array.Length - 1); index++) { + array[index] = array[index + 1]; + } + array[array.Length - 1] = num; + return Math.Abs(num - arraytmp[0]) <= interval; + } + + public int nCurrentMeasure; + public int nMeasureCount; + + #region [private] + private long nスクロール前ms; + private long nスクロール後ms; + private long n最終演奏位置ms; + + public bool bTrainingPAUSE { get; private set; } + private bool bCurrentlyScrolling; + + private CCounter ctScrollCounter; + private CCounter ctBackgroundScrollTimer; + private Easing easing = new Easing(); + private long length = 1; + + private List gogoXList; + private List JumpPointList; + private long[] LBlue = new long[] { 0, 0, 0, 0, 0 }; + private long[] RBlue = new long[] { 0, 0, 0, 0, 0 }; + + private struct STJUMPP { + public long Time; + public int Measure; + } + + /// + /// + /// + /// 今の時間 + /// 最初の値 + /// 最終の値-最初の値 + /// 全体の時間 + /// + private int EasingCircular(int time, int begin, int change, int duration) { + double t = time, b = begin, c = change, d = duration; + + t = t / d * 2; + if (t < 1) + return (int)(-c / 2 * (Math.Sqrt(1 - t * t) - 1) + b); + else { + t = t - 2; + return (int)(c / 2 * (Math.Sqrt(1 - t * t) + 1) + b); + } + } + + #endregion +} diff --git a/OpenTaiko/src/Stages/07.Game/Taiko/CAct演奏Drumsゲームモード.cs b/OpenTaiko/src/Stages/07.Game/Taiko/CAct演奏Drumsゲームモード.cs index be3d612e..21bf6c6b 100644 --- a/OpenTaiko/src/Stages/07.Game/Taiko/CAct演奏Drumsゲームモード.cs +++ b/OpenTaiko/src/Stages/07.Game/Taiko/CAct演奏Drumsゲームモード.cs @@ -3,98 +3,600 @@ using FDK; using Point = System.Drawing.Point; using Rectangle = System.Drawing.Rectangle; -namespace OpenTaiko { - internal class CAct演奏Drumsゲームモード : CActivity { - /// - /// 現時点では「完走!叩ききりまショー!」のみ。 - /// - /// - public CAct演奏Drumsゲームモード() { - this.IsDeActivated = true; +namespace OpenTaiko; + +internal class CAct演奏Drumsゲームモード : CActivity { + /// + /// 現時点では「完走!叩ききりまショー!」のみ。 + /// + /// + public CAct演奏Drumsゲームモード() { + this.IsDeActivated = true; + } + + //叩ききりまショー! + //<ルール> + //_某DAMのやつに似てるやつ。 + //_演奏可能な残り時間が減っていく。 + //_複数の項目に対して、一定の条件をクリアしていって延命させていく。 + //_タイマーが0になったらSTAGE FAILED。 + // + //判定要素 + //_精度 + //_ミス数 + //_ズレ時間 + //_最大コンボ数 + //その他諸々 + + private long n叩ききりまショー_残り時間タイマー; + public ST叩ききりまショー st叩ききりまショー; + public struct ST叩ききりまショー { + public bool b最初のチップが叩かれた; + public bool bタイマー使用中; + public bool b超激辛; + public bool b加算アニメ中; + public int nヒット数_PERFECT; + public int nヒット数_GREAT; + public int nヒット数_GOOD; + public int nヒット数_POOR; + public int nヒット数_MISS; + public int n最大コンボ; + public int n現在のコンボ; + public int n区間ノート数; + public int n最大ズレ時間; + public int n最小ズレ時間; + public int n現在通過したノート数; + public int n全体最大ズレ時間; + public int nおまけ加算が発生した回数; + public int n延長アニメ速度; + public CCounter ct残り時間; + public CCounter ct加算時間表示; + public CCounter ct加算審査中; + public CCounter ct針アニメ; + } + private int n最後に時間延長した時刻; + private int n演奏時間; + private int n前回の延長時間; + //private CTexture tx残り時間数字; + //private CTexture tx背景黒; + //private CTexture tx加算時間数字; + //private CTexture txタイマー枠; + //private CTexture txタイマー針; + + [StructLayout(LayoutKind.Sequential)] + private struct STボーナス { + public double ret; + public double point; + public STボーナス(double ret, double point) { + this.ret = ret; + this.point = point; } + } - //叩ききりまショー! - //<ルール> - //_某DAMのやつに似てるやつ。 - //_演奏可能な残り時間が減っていく。 - //_複数の項目に対して、一定の条件をクリアしていって延命させていく。 - //_タイマーが0になったらSTAGE FAILED。 - // - //判定要素 - //_精度 - //_ミス数 - //_ズレ時間 - //_最大コンボ数 - //その他諸々 + private STボーナス[] n精度ボーナス; + private STボーナス[] n最大ズレ時間ボーナス; + private STボーナス[] n最小ズレ時間ボーナス; + private STボーナス[] nコンボ率ボーナス; + private STボーナス[] nミス率ボーナス; - private long n叩ききりまショー_残り時間タイマー; - public ST叩ききりまショー st叩ききりまショー; - public struct ST叩ききりまショー { - public bool b最初のチップが叩かれた; - public bool bタイマー使用中; - public bool b超激辛; - public bool b加算アニメ中; - public int nヒット数_PERFECT; - public int nヒット数_GREAT; - public int nヒット数_GOOD; - public int nヒット数_POOR; - public int nヒット数_MISS; - public int n最大コンボ; - public int n現在のコンボ; - public int n区間ノート数; - public int n最大ズレ時間; - public int n最小ズレ時間; - public int n現在通過したノート数; - public int n全体最大ズレ時間; - public int nおまけ加算が発生した回数; - public int n延長アニメ速度; - public CCounter ct残り時間; - public CCounter ct加算時間表示; - public CCounter ct加算審査中; - public CCounter ct針アニメ; - } - private int n最後に時間延長した時刻; - private int n演奏時間; - private int n前回の延長時間; - //private CTexture tx残り時間数字; - //private CTexture tx背景黒; - //private CTexture tx加算時間数字; - //private CTexture txタイマー枠; - //private CTexture txタイマー針; + private STボーナス[] n全体精度ボーナス; + private STボーナス[] n全体最大ズレ時間ボーナス; + private STボーナス[] n全体コンボ率ボーナス; + private STボーナス[] n全体ミス率ボーナス; + private int n加算時間; - [StructLayout(LayoutKind.Sequential)] - private struct STボーナス { - public double ret; - public double point; - public STボーナス(double ret, double point) { - this.ret = ret; - this.point = point; + public void t叩ききりまショー_初期化() { + this.st叩ききりまショー = new ST叩ききりまショー(); + this.n演奏時間 = (OpenTaiko.DTX.listChip.Count > 0) ? OpenTaiko.DTX.listChip[OpenTaiko.DTX.listChip.Count - 1].n発声時刻ms : 0; + this.st叩ききりまショー.ct残り時間 = new CCounter(0, 25000, 1, OpenTaiko.Timer); + this.st叩ききりまショー.ct加算時間表示 = new CCounter(); + this.st叩ききりまショー.ct加算審査中 = new CCounter(); + this.st叩ききりまショー.b最初のチップが叩かれた = false; + this.st叩ききりまショー.bタイマー使用中 = false; + this.st叩ききりまショー.b加算アニメ中 = false; + this.n最後に時間延長した時刻 = 0; + + this.st叩ききりまショー.nヒット数_PERFECT = 0; + this.st叩ききりまショー.nヒット数_GREAT = 0; + this.st叩ききりまショー.nヒット数_GOOD = 0; + this.st叩ききりまショー.nヒット数_POOR = 0; + this.st叩ききりまショー.nヒット数_MISS = 0; + this.st叩ききりまショー.n区間ノート数 = 0; + this.st叩ききりまショー.n現在のコンボ = 0; + this.st叩ききりまショー.n最小ズレ時間 = -1; + this.st叩ききりまショー.n最大ズレ時間 = -1; + this.st叩ききりまショー.n全体最大ズレ時間 = -1; + this.st叩ききりまショー.n現在通過したノート数 = 0; + this.st叩ききりまショー.b超激辛 = false; + this.st叩ききりまショー.nおまけ加算が発生した回数 = 0; + this.st叩ききりまショー.n延長アニメ速度 = 0; + this.n加算時間 = 0; + this.n前回の延長時間 = 0; + + this.st叩ききりまショー.ct針アニメ = new CCounter(0, 1000, 1, OpenTaiko.Timer); + + this.t叩ききりまショー_判定項目と難易度を決める(); + } + + public void t叩ききりまショー_判定項目と難易度を決める() { + //まず通常、激辛時でわける。 + if (OpenTaiko.ConfigIni.eGameMode == EGame.Survival) { + #region[ 通常 ] + //通常の査定 + // 精度 > 最小ズレ > コンボ > 最大ズレ > ミス + this.n精度ボーナス = new STボーナス[]{ + new STボーナス( 90, 5 ), + new STボーナス( 70, 4.5 ), + new STボーナス( 60, 3 ), + new STボーナス( 50, 1 ), + new STボーナス( 30, 0 ) + }; + this.n最小ズレ時間ボーナス = new STボーナス[]{ + new STボーナス( 5, 4 ), + new STボーナス( 10, 3.5 ), + new STボーナス( 20, 3 ), + new STボーナス( 50, 1.5 ), + new STボーナス( 80, -1 ) + }; + this.n最大ズレ時間ボーナス = new STボーナス[]{ + new STボーナス( 50, 2 ), + new STボーナス( 60, 1.5 ), + new STボーナス( 80, 0.5 ), + new STボーナス( 90, 0 ), + new STボーナス( 100, -1 ) + }; + this.nコンボ率ボーナス = new STボーナス[]{ + new STボーナス( 98.0, 3.5 ), + new STボーナス( 80.0, 1 ), + new STボーナス( 50.0, 0.5 ), + new STボーナス( 35.0, -1.5 ) + }; + this.nミス率ボーナス = new STボーナス[]{ + new STボーナス( 0, 2 ), + new STボーナス( 20.0, 1 ), + new STボーナス( 50.0, -0.5 ) + }; + + this.n全体精度ボーナス = new STボーナス[]{ + new STボーナス( 90, 3.5 ), + new STボーナス( 70, 2.5 ), + new STボーナス( 60, 1 ), + new STボーナス( 50, 0.5 ), + new STボーナス( 30, -0.5 ) + }; + this.n全体最大ズレ時間ボーナス = new STボーナス[]{ + new STボーナス( 50, 4.2 ), + new STボーナス( 60, 3.6 ), + new STボーナス( 80, 2 ), + new STボーナス( 90, -0.5 ), + new STボーナス( 100, -1 ) + }; + this.n全体コンボ率ボーナス = new STボーナス[]{ + new STボーナス( 98.0, 3 ), + new STボーナス( 80.0, 2.5 ), + new STボーナス( 50.0, 0.5 ) + }; + this.n全体ミス率ボーナス = new STボーナス[]{ + new STボーナス( 0, 2 ), + new STボーナス( 20.0, 1.5 ), + new STボーナス( 50.0, 0.5 ), + new STボーナス( 70.0, -0.5 ) + }; + #endregion + } else if (OpenTaiko.ConfigIni.eGameMode == EGame.SurvivalHard) { + #region[ 激辛 ] + //激ムズの査定 + // 最大ズレ > 精度 > コンボ > 最小ズレ > ミス + //各項目最高値合計で20秒加算になるようにすること。 + this.n精度ボーナス = new STボーナス[]{ + new STボーナス( 100, 3 ), + new STボーナス( 95, 2 ), + new STボーナス( 90, 1 ), + new STボーナス( 70, -2 ), + new STボーナス( 50, -4 ), + new STボーナス( 0, -10 ) + }; + this.n最小ズレ時間ボーナス = new STボーナス[]{ + new STボーナス( 0, 2 ), + new STボーナス( 3, 1 ), + new STボーナス( 5, -2 ), + new STボーナス( 10, -3 ), + new STボーナス( 30, -3 ), + new STボーナス( 108, -4 ) + }; + this.n最大ズレ時間ボーナス = new STボーナス[]{ + new STボーナス( 3, 3.5 ), + new STボーナス( 10, 2 ), + new STボーナス( 15, 1 ), + new STボーナス( 20, 0 ), + new STボーナス( 50, -2 ), + new STボーナス( 108, -5 ) + }; + this.nコンボ率ボーナス = new STボーナス[]{ + new STボーナス( 100.0, 1 ), + new STボーナス( 50.0, 0.5 ), + new STボーナス( 0.0, -5 ) + }; + this.nミス率ボーナス = new STボーナス[]{ + new STボーナス( 0, 1 ), + new STボーナス( 100.0, -5 ) + }; + + this.n全体精度ボーナス = new STボーナス[]{ + new STボーナス( 100, 5 ), + new STボーナス( 99, 4 ), + new STボーナス( 90, 1.5 ), + new STボーナス( 80, 1 ), + new STボーナス( 50, -1 ), + new STボーナス( 30, -3 ), + new STボーナス( 0, -4.5 ) + }; + this.n全体最大ズレ時間ボーナス = new STボーナス[]{ + new STボーナス( 20, 3 ), + new STボーナス( 30, 1.5 ), + new STボーナス( 50, 1 ), + new STボーナス( 80, 0 ), + new STボーナス( 108, -2.5 ) + }; + this.n全体コンボ率ボーナス = new STボーナス[]{ + new STボーナス( 100.0, 1 ), + new STボーナス( 0.0, -2 ) + }; + this.n全体ミス率ボーナス = new STボーナス[]{ + new STボーナス( 0, 1 ), + new STボーナス( 100.0, -2 ), + }; + + //★10の場合超激辛モードになる。 + if (OpenTaiko.DTX.LEVELtaiko[OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0]] >= 10) { + #region[ 超激辛 ] + this.st叩ききりまショー.b超激辛 = true; + + this.n精度ボーナス = new STボーナス[]{ + new STボーナス( 100, 3 ), + new STボーナス( 95, 2 ), + new STボーナス( 88, 1 ), + new STボーナス( 80, -3 ), + new STボーナス( 50, -6 ), + new STボーナス( 0, -10 ) + }; + + this.n最大ズレ時間ボーナス = new STボーナス[]{ + new STボーナス( 2, 4 ), + new STボーナス( 10, 1 ), + new STボーナス( 30, 0 ), + new STボーナス( 50, -1 ), + new STボーナス( 70, -3 ), + new STボーナス( 108, -5 ) + }; + this.nコンボ率ボーナス = new STボーナス[]{ + new STボーナス( 100.0, 1 ), + new STボーナス( 0.0, -6 ) + }; + this.nミス率ボーナス = new STボーナス[]{ + new STボーナス( 0, 1 ), + new STボーナス( 100.0, -6 ) + }; + + this.n全体最大ズレ時間ボーナス = new STボーナス[]{ + new STボーナス( 20, 3 ), + new STボーナス( 60, 1 ), + new STボーナス( 108, -5 ) + }; + this.n全体コンボ率ボーナス = new STボーナス[]{ + new STボーナス( 100.0, 1 ), + new STボーナス( 0.0, -5 ) + }; + this.n全体ミス率ボーナス = new STボーナス[]{ + new STボーナス( 0, 1 ), + new STボーナス( 100.0, -5 ), + }; + #endregion } + + if (OpenTaiko.ConfigIni.bSuperHard) { + #region[ 超激辛 ] + this.st叩ききりまショー.b超激辛 = true; + + this.n精度ボーナス = new STボーナス[]{ + new STボーナス( 100, 3 ), + new STボーナス( 98, 2.3 ), + new STボーナス( 95, 2 ), + new STボーナス( 90, 1.5 ), + new STボーナス( 85, 0 ), + new STボーナス( 80, -2 ), + new STボーナス( 60, -3 ), + new STボーナス( 40, -6 ), + new STボーナス( 0, -7.5 ) + }; + + this.n最大ズレ時間ボーナス = new STボーナス[]{ + new STボーナス( 8, 5 ), + new STボーナス( 18, 3 ), + new STボーナス( 40, 1 ), + new STボーナス( 50, -0.5 ), + new STボーナス( 70, -3 ), + new STボーナス( 108, -5 ) + }; + this.nコンボ率ボーナス = new STボーナス[]{ + new STボーナス( 100.0, 1 ), + new STボーナス( 0.0, -6 ) + }; + this.nミス率ボーナス = new STボーナス[]{ + new STボーナス( 0, 1 ), + new STボーナス( 100.0, -6 ) + }; + + this.n全体精度ボーナス = new STボーナス[]{ + new STボーナス( 100, 7 ), + new STボーナス( 99, 4 ), + new STボーナス( 90, 2 ), + new STボーナス( 80, 1 ), + new STボーナス( 50, -1 ), + new STボーナス( 0, -7 ) + }; + this.n全体最大ズレ時間ボーナス = new STボーナス[]{ + new STボーナス( 20, 3 ), + new STボーナス( 40, 1 ), + new STボーナス( 60, -3 ), + new STボーナス( 108, -5 ) + }; + this.n全体コンボ率ボーナス = new STボーナス[]{ + new STボーナス( 100.0, 1 ), + new STボーナス( 0.0, -5 ) + }; + this.n全体ミス率ボーナス = new STボーナス[]{ + new STボーナス( 0, 0 ), + new STボーナス( 100.0, -5 ), + }; + #endregion + } + #endregion } + } - private STボーナス[] n精度ボーナス; - private STボーナス[] n最大ズレ時間ボーナス; - private STボーナス[] n最小ズレ時間ボーナス; - private STボーナス[] nコンボ率ボーナス; - private STボーナス[] nミス率ボーナス; + public override void CreateManagedResource() { + //this.tx残り時間数字 = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\7_combo taiko.png" ) ); + //this.tx加算時間数字 = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\7_Score_number_1P.png" ) ); + //this.txタイマー枠 = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\7_TimerPanel.png" ) ); + //this.txタイマー針 = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\7_TimerTick.png" ) ); + //this.tx背景黒 = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\Tile black 64x64.png" ) ); + base.CreateManagedResource(); + } - private STボーナス[] n全体精度ボーナス; - private STボーナス[] n全体最大ズレ時間ボーナス; - private STボーナス[] n全体コンボ率ボーナス; - private STボーナス[] n全体ミス率ボーナス; - private int n加算時間; + public override void ReleaseManagedResource() { + //CDTXMania.tテクスチャの解放( ref this.tx残り時間数字 ); + //CDTXMania.tテクスチャの解放( ref this.tx加算時間数字 ); + //CDTXMania.tテクスチャの解放( ref this.txタイマー枠 ); + //CDTXMania.tテクスチャの解放( ref this.txタイマー針 ); + //CDTXMania.tテクスチャの解放( ref this.tx背景黒 ); + base.ReleaseManagedResource(); + } - public void t叩ききりまショー_初期化() { - this.st叩ききりまショー = new ST叩ききりまショー(); - this.n演奏時間 = (OpenTaiko.DTX.listChip.Count > 0) ? OpenTaiko.DTX.listChip[OpenTaiko.DTX.listChip.Count - 1].n発声時刻ms : 0; - this.st叩ききりまショー.ct残り時間 = new CCounter(0, 25000, 1, OpenTaiko.Timer); - this.st叩ききりまショー.ct加算時間表示 = new CCounter(); - this.st叩ききりまショー.ct加算審査中 = new CCounter(); - this.st叩ききりまショー.b最初のチップが叩かれた = false; - this.st叩ききりまショー.bタイマー使用中 = false; - this.st叩ききりまショー.b加算アニメ中 = false; - this.n最後に時間延長した時刻 = 0; + public override int Draw() { + if (OpenTaiko.ConfigIni.eGameMode == EGame.Survival || OpenTaiko.ConfigIni.eGameMode == EGame.SurvivalHard) { + //if( this.st叩ききりまショー.b最初のチップが叩かれた == true )//&& + //CDTXMania.stage演奏ドラム画面.r検索範囲内にチップがあるか調べる( CSound管理.rc演奏用タイマ.n現在時刻ms, 0, 3000 ) ) + //this.st叩ききりまショー.ct残り時間.t進行(); + //else + //{ + // this.st叩ききりまショー.ct残り時間.n現在の値 = this.st叩ききりまショー.ct残り時間.n現在の値; + //} + + //if( !this.st叩ききりまショー.ct残り時間.b停止中 ) + if (this.st叩ききりまショー.bタイマー使用中) { + if (!this.st叩ききりまショー.ct残り時間.IsStoped || this.st叩ききりまショー.b加算アニメ中 == true) { + this.st叩ききりまショー.ct残り時間.Tick(); + if (!OpenTaiko.stage演奏ドラム画面.r検索範囲内にチップがあるか調べる((long)(SoundManager.PlayTimer.NowTime * OpenTaiko.ConfigIni.SongPlaybackSpeed), 0, 5000, 0) || this.st叩ききりまショー.b加算アニメ中 == true) { + this.st叩ききりまショー.bタイマー使用中 = false; + this.st叩ききりまショー.ct残り時間.Stop(); + } + } + } + + if (!this.st叩ききりまショー.bタイマー使用中 && this.st叩ききりまショー.b加算アニメ中 == false) { + if ((this.st叩ききりまショー.b最初のチップが叩かれた == true && (OpenTaiko.stage演奏ドラム画面.r検索範囲内にチップがあるか調べる(SoundManager.PlayTimer.NowTimeMs, 0, 2000, 0)))) { + this.st叩ききりまショー.bタイマー使用中 = true; + int nCount = this.st叩ききりまショー.ct残り時間.CurrentValue; + this.st叩ききりまショー.ct残り時間 = new CCounter(0, 25000, 1, OpenTaiko.Timer); + this.st叩ききりまショー.ct針アニメ = new CCounter(0, 1000, 1, OpenTaiko.Timer); + this.st叩ききりまショー.ct残り時間.CurrentValue = nCount; + } + + } + + + if ((this.st叩ききりまショー.ct残り時間.CurrentValue >= 20000) && this.st叩ききりまショー.ct残り時間.CurrentValue != 25000) + this.t叩ききりまショー_評価をして残り時間を延長する(); + + if (OpenTaiko.Tx.Tile_Black != null) { + if (this.st叩ききりまショー.ct残り時間.CurrentValue >= 22000 && this.st叩ききりまショー.ct残り時間.CurrentValue < 23000) + OpenTaiko.Tx.Tile_Black.Opacity = 64; + else if (this.st叩ききりまショー.ct残り時間.CurrentValue >= 23000 && this.st叩ききりまショー.ct残り時間.CurrentValue < 24000) + OpenTaiko.Tx.Tile_Black.Opacity = 128; + else if (this.st叩ききりまショー.ct残り時間.CurrentValue >= 24000) + OpenTaiko.Tx.Tile_Black.Opacity = 192; + else + OpenTaiko.Tx.Tile_Black.Opacity = 0; + + for (int i = 0; i <= (SampleFramework.GameWindowSize.Width / 64); i++) { + for (int j = 0; j <= (SampleFramework.GameWindowSize.Height / 64); j++) { + OpenTaiko.Tx.Tile_Black.t2D描画(i * 64, j * 64); + } + } + } + + //CDTXMania.act文字コンソール.tPrint( 100, 0, C文字コンソール.Eフォント種別.白, ( 25 - this.st叩ききりまショー.ct残り時間.n現在の値 ).ToString() ); + //CDTXMania.act文字コンソール.tPrint( 100, 16, C文字コンソール.Eフォント種別.白, this.st叩ききりまショー.n区間ノート数.ToString() ); + //CDTXMania.act文字コンソール.tPrint( 100, 16 * 2, C文字コンソール.Eフォント種別.白, this.st叩ききりまショー.n現在通過したノート数.ToString() ); + //CDTXMania.act文字コンソール.tPrint( 100, 16 * 3, C文字コンソール.Eフォント種別.白, this.st叩ききりまショー.nヒット数_MISS.ToString() ); + //CDTXMania.act文字コンソール.tPrint( 100, 16 * 4, C文字コンソール.Eフォント種別.白, this.st叩ききりまショー.n最小ズレ時間.ToString() ); + //CDTXMania.act文字コンソール.tPrint( 100, 16 * 5, C文字コンソール.Eフォント種別.白, this.st叩ききりまショー.n最大ズレ時間.ToString() ); + //CDTXMania.act文字コンソール.tPrint( 100, 16 * 6, C文字コンソール.Eフォント種別.白, this.st叩ききりまショー.n全体最大ズレ時間.ToString() ); + //CDTXMania.act文字コンソール.tPrint( 100, 16 * 7, C文字コンソール.Eフォント種別.白, this.st叩ききりまショー.n最大コンボ.ToString() ); + //CDTXMania.act文字コンソール.tPrint( 100, 16 * 7, C文字コンソール.Eフォント種別.白, this.st叩ききりまショー.ct加算審査中.n現在の値.ToString() ); + + #region[ 残り時間描画 ] + if (OpenTaiko.Tx.Taiko_Combo != null) { + if (OpenTaiko.Tx.GameMode_Timer_Frame != null) + OpenTaiko.Tx.GameMode_Timer_Frame.t2D描画(230, 84); + this.st叩ききりまショー.ct針アニメ.TickLoop(); + + int nCenterX = 230; + int nCerterY = 84; + float fRotate = -CConversion.DegreeToRadian(360.0f * (this.st叩ききりまショー.ct針アニメ.CurrentValue / 1000.0f)); + if (this.st叩ききりまショー.b加算アニメ中 == true) + fRotate = CConversion.DegreeToRadian(360.0f * (this.st叩ききりまショー.ct針アニメ.CurrentValue / (float)this.st叩ききりまショー.n延長アニメ速度)); + + /* + Matrix mat = Matrix.Identity; + if( this.st叩ききりまショー.b最初のチップが叩かれた ) + { + mat *= Matrix.RotationZ( fRotate ); + mat *= Matrix.Translation( 280 - 640, -( 134 - 360 ), 0 ); + } + else + { + mat *= Matrix.Translation( 280 - 640, -( 134 - 360 ), 0 ); + } + + TJAPlayer3.Tx.GameMode_Timer_Tick?.t3D描画( mat ); + */ + + string str表示する残り時間 = (this.st叩ききりまショー.ct残り時間.CurrentValue < 1000) ? "25" : ((26000 - this.st叩ききりまショー.ct残り時間.CurrentValue) / 1000).ToString(); + + if (OpenTaiko.Tx.GameMode_Timer_Frame != null) + this.t小文字表示(230 + (str表示する残り時間.Length * OpenTaiko.Skin.Game_Taiko_Combo_Size[0] / 4), 84 + OpenTaiko.Tx.GameMode_Timer_Frame.szTextureSize.Height / 2, string.Format("{0,2:#0}", str表示する残り時間)); + } + + if (!this.st叩ききりまショー.ct加算審査中.IsStoped) { + if (!this.st叩ききりまショー.ct加算審査中.IsStoped) { + this.st叩ききりまショー.ct加算審査中.Tick(); + if (this.st叩ききりまショー.ct加算審査中.IsEnded) { + this.st叩ききりまショー.ct加算審査中.Stop(); + this.st叩ききりまショー.b加算アニメ中 = false; + this.t加算時間描画_Start(); + } + } + } + if (!this.st叩ききりまショー.ct加算時間表示.IsStoped) { + if (!this.st叩ききりまショー.ct加算時間表示.IsStoped) { + this.st叩ききりまショー.ct加算時間表示.Tick(); + if (this.st叩ききりまショー.ct加算時間表示.IsEnded) { + this.st叩ききりまショー.ct加算時間表示.Stop(); + } + } + this.t加算時間描画(this.n前回の延長時間); + } + #endregion + } + return 0; + } + + private void t叩ききりまショー_評価をして残り時間を延長する() { + double n延長する時間 = 0; + + //最後に延長した時刻から11秒経過していなければ延長を行わない。 + if (this.n最後に時間延長した時刻 + 11000 <= (SoundManager.PlayTimer.NowTime * OpenTaiko.ConfigIni.SongPlaybackSpeed)) { + //1項目につき5秒 + //-精度 + if (this.st叩ききりまショー.nヒット数_PERFECT != 0 || this.st叩ききりまショー.nヒット数_GREAT != 0) { + double db区間内精度 = ((double)(this.st叩ききりまショー.nヒット数_PERFECT + this.st叩ききりまショー.nヒット数_GREAT) / this.st叩ききりまショー.n区間ノート数) * 100.0; + for (int i = 0; i < this.n精度ボーナス.Length; i++) { + if (db区間内精度 >= this.n精度ボーナス[i].ret) { + n延長する時間 += this.n精度ボーナス[i].point; + break; + } + } + } + + //-ラグ時間 + #region[ ラグ時間による判定 ] + if (this.st叩ききりまショー.n最小ズレ時間 != -1) { + for (int i = 0; i < this.n最小ズレ時間ボーナス.Length; i++) { + if (this.st叩ききりまショー.n最小ズレ時間 >= this.n最小ズレ時間ボーナス[i].ret) { + n延長する時間 += this.n最小ズレ時間ボーナス[i].point; + break; + } + } + } + + if (this.st叩ききりまショー.n最大ズレ時間 != -1) { + for (int i = 0; i < this.n最大ズレ時間ボーナス.Length; i++) { + if (this.st叩ききりまショー.n最大ズレ時間 <= this.n最大ズレ時間ボーナス[i].ret) { + n延長する時間 += this.n最大ズレ時間ボーナス[i].point; + break; + } + } + } + #endregion + if (this.st叩ききりまショー.n最大コンボ != 0) { + double db区間内コンボ精度 = ((double)this.st叩ききりまショー.n最大コンボ / this.st叩ききりまショー.n区間ノート数) * 100.0; + for (int i = 0; i < this.nコンボ率ボーナス.Length; i++) { + if (db区間内コンボ精度 >= this.nコンボ率ボーナス[i].ret) { + n延長する時間 += this.nコンボ率ボーナス[i].point; + break; + } + } + } + + double db区間内ミス率 = (((double)this.st叩ききりまショー.nヒット数_POOR + this.st叩ききりまショー.nヒット数_MISS) / this.st叩ききりまショー.n区間ノート数) * 100.0; + for (int i = 0; i < this.nミス率ボーナス.Length; i++) { + if (db区間内ミス率 >= this.nミス率ボーナス[i].ret) { + n延長する時間 += this.nミス率ボーナス[i].point; + break; + } + } + #region[ 全体 ] + if (OpenTaiko.stage演奏ドラム画面.nヒット数_Auto含まない.Drums.Perfect != 0 || OpenTaiko.stage演奏ドラム画面.nヒット数_Auto含まない.Drums.Great != 0) { + double db全体精度 = ((double)(OpenTaiko.stage演奏ドラム画面.nヒット数_Auto含まない.Drums.Perfect + OpenTaiko.stage演奏ドラム画面.nヒット数_Auto含まない.Drums.Great) / this.st叩ききりまショー.n区間ノート数) * 100.0; + for (int i = 0; i < this.n全体精度ボーナス.Length; i++) { + if (db全体精度 >= this.n全体精度ボーナス[i].ret) { + n延長する時間 += this.n全体精度ボーナス[i].point; + break; + } + } + } + + //-ラグ時間 + #region[ ラグ時間による判定 ] + if (this.st叩ききりまショー.n全体最大ズレ時間 != -1) { + for (int i = 0; i < this.n全体最大ズレ時間ボーナス.Length; i++) { + if (this.st叩ききりまショー.n全体最大ズレ時間 <= this.n全体最大ズレ時間ボーナス[i].ret) { + n延長する時間 += this.n全体最大ズレ時間ボーナス[i].point; + break; + } + } + } + #endregion + if (OpenTaiko.stage演奏ドラム画面.actCombo.n現在のコンボ数.最高値[0] != 0) { + double db全体コンボ率 = ((double)OpenTaiko.stage演奏ドラム画面.actCombo.n現在のコンボ数.最高値[0] / this.st叩ききりまショー.n現在通過したノート数) * 100.0; + for (int i = 0; i < this.n全体コンボ率ボーナス.Length; i++) { + if (db全体コンボ率 >= this.n全体コンボ率ボーナス[i].ret) { + n延長する時間 += this.n全体コンボ率ボーナス[i].point; + break; + } + } + } + + double db全体ミス率 = (((double)OpenTaiko.stage演奏ドラム画面.nヒット数_Auto含まない.Drums.Poor + OpenTaiko.stage演奏ドラム画面.nヒット数_Auto含まない.Drums.Miss) / this.st叩ききりまショー.n現在通過したノート数) * 100.0; + for (int i = 0; i < this.n全体ミス率ボーナス.Length; i++) { + if (db全体ミス率 >= this.n全体ミス率ボーナス[i].ret) { + n延長する時間 += this.n全体ミス率ボーナス[i].point; + break; + } + } + #endregion + + + this.n最後に時間延長した時刻 = (int)(SoundManager.PlayTimer.NowTime * OpenTaiko.ConfigIni.SongPlaybackSpeed); + if (n延長する時間 < 0) + n延長する時間 = 0; + if (this.st叩ききりまショー.n区間ノート数 == 0) + n延長する時間 = 15; + + //各数値を初期化 this.st叩ききりまショー.nヒット数_PERFECT = 0; this.st叩ききりまショー.nヒット数_GREAT = 0; this.st叩ききりまショー.nヒット数_GOOD = 0; @@ -104,703 +606,201 @@ namespace OpenTaiko { this.st叩ききりまショー.n現在のコンボ = 0; this.st叩ききりまショー.n最小ズレ時間 = -1; this.st叩ききりまショー.n最大ズレ時間 = -1; - this.st叩ききりまショー.n全体最大ズレ時間 = -1; - this.st叩ききりまショー.n現在通過したノート数 = 0; - this.st叩ききりまショー.b超激辛 = false; - this.st叩ききりまショー.nおまけ加算が発生した回数 = 0; - this.st叩ききりまショー.n延長アニメ速度 = 0; - this.n加算時間 = 0; - this.n前回の延長時間 = 0; - this.st叩ききりまショー.ct針アニメ = new CCounter(0, 1000, 1, OpenTaiko.Timer); - - this.t叩ききりまショー_判定項目と難易度を決める(); - } - - public void t叩ききりまショー_判定項目と難易度を決める() { - //まず通常、激辛時でわける。 - if (OpenTaiko.ConfigIni.eGameMode == EGame.Survival) { - #region[ 通常 ] - //通常の査定 - // 精度 > 最小ズレ > コンボ > 最大ズレ > ミス - this.n精度ボーナス = new STボーナス[]{ - new STボーナス( 90, 5 ), - new STボーナス( 70, 4.5 ), - new STボーナス( 60, 3 ), - new STボーナス( 50, 1 ), - new STボーナス( 30, 0 ) - }; - this.n最小ズレ時間ボーナス = new STボーナス[]{ - new STボーナス( 5, 4 ), - new STボーナス( 10, 3.5 ), - new STボーナス( 20, 3 ), - new STボーナス( 50, 1.5 ), - new STボーナス( 80, -1 ) - }; - this.n最大ズレ時間ボーナス = new STボーナス[]{ - new STボーナス( 50, 2 ), - new STボーナス( 60, 1.5 ), - new STボーナス( 80, 0.5 ), - new STボーナス( 90, 0 ), - new STボーナス( 100, -1 ) - }; - this.nコンボ率ボーナス = new STボーナス[]{ - new STボーナス( 98.0, 3.5 ), - new STボーナス( 80.0, 1 ), - new STボーナス( 50.0, 0.5 ), - new STボーナス( 35.0, -1.5 ) - }; - this.nミス率ボーナス = new STボーナス[]{ - new STボーナス( 0, 2 ), - new STボーナス( 20.0, 1 ), - new STボーナス( 50.0, -0.5 ) - }; - - this.n全体精度ボーナス = new STボーナス[]{ - new STボーナス( 90, 3.5 ), - new STボーナス( 70, 2.5 ), - new STボーナス( 60, 1 ), - new STボーナス( 50, 0.5 ), - new STボーナス( 30, -0.5 ) - }; - this.n全体最大ズレ時間ボーナス = new STボーナス[]{ - new STボーナス( 50, 4.2 ), - new STボーナス( 60, 3.6 ), - new STボーナス( 80, 2 ), - new STボーナス( 90, -0.5 ), - new STボーナス( 100, -1 ) - }; - this.n全体コンボ率ボーナス = new STボーナス[]{ - new STボーナス( 98.0, 3 ), - new STボーナス( 80.0, 2.5 ), - new STボーナス( 50.0, 0.5 ) - }; - this.n全体ミス率ボーナス = new STボーナス[]{ - new STボーナス( 0, 2 ), - new STボーナス( 20.0, 1.5 ), - new STボーナス( 50.0, 0.5 ), - new STボーナス( 70.0, -0.5 ) - }; - #endregion - } else if (OpenTaiko.ConfigIni.eGameMode == EGame.SurvivalHard) { - #region[ 激辛 ] - //激ムズの査定 - // 最大ズレ > 精度 > コンボ > 最小ズレ > ミス - //各項目最高値合計で20秒加算になるようにすること。 - this.n精度ボーナス = new STボーナス[]{ - new STボーナス( 100, 3 ), - new STボーナス( 95, 2 ), - new STボーナス( 90, 1 ), - new STボーナス( 70, -2 ), - new STボーナス( 50, -4 ), - new STボーナス( 0, -10 ) - }; - this.n最小ズレ時間ボーナス = new STボーナス[]{ - new STボーナス( 0, 2 ), - new STボーナス( 3, 1 ), - new STボーナス( 5, -2 ), - new STボーナス( 10, -3 ), - new STボーナス( 30, -3 ), - new STボーナス( 108, -4 ) - }; - this.n最大ズレ時間ボーナス = new STボーナス[]{ - new STボーナス( 3, 3.5 ), - new STボーナス( 10, 2 ), - new STボーナス( 15, 1 ), - new STボーナス( 20, 0 ), - new STボーナス( 50, -2 ), - new STボーナス( 108, -5 ) - }; - this.nコンボ率ボーナス = new STボーナス[]{ - new STボーナス( 100.0, 1 ), - new STボーナス( 50.0, 0.5 ), - new STボーナス( 0.0, -5 ) - }; - this.nミス率ボーナス = new STボーナス[]{ - new STボーナス( 0, 1 ), - new STボーナス( 100.0, -5 ) - }; - - this.n全体精度ボーナス = new STボーナス[]{ - new STボーナス( 100, 5 ), - new STボーナス( 99, 4 ), - new STボーナス( 90, 1.5 ), - new STボーナス( 80, 1 ), - new STボーナス( 50, -1 ), - new STボーナス( 30, -3 ), - new STボーナス( 0, -4.5 ) - }; - this.n全体最大ズレ時間ボーナス = new STボーナス[]{ - new STボーナス( 20, 3 ), - new STボーナス( 30, 1.5 ), - new STボーナス( 50, 1 ), - new STボーナス( 80, 0 ), - new STボーナス( 108, -2.5 ) - }; - this.n全体コンボ率ボーナス = new STボーナス[]{ - new STボーナス( 100.0, 1 ), - new STボーナス( 0.0, -2 ) - }; - this.n全体ミス率ボーナス = new STボーナス[]{ - new STボーナス( 0, 1 ), - new STボーナス( 100.0, -2 ), - }; - - //★10の場合超激辛モードになる。 - if (OpenTaiko.DTX.LEVELtaiko[OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0]] >= 10) { - #region[ 超激辛 ] - this.st叩ききりまショー.b超激辛 = true; - - this.n精度ボーナス = new STボーナス[]{ - new STボーナス( 100, 3 ), - new STボーナス( 95, 2 ), - new STボーナス( 88, 1 ), - new STボーナス( 80, -3 ), - new STボーナス( 50, -6 ), - new STボーナス( 0, -10 ) - }; - - this.n最大ズレ時間ボーナス = new STボーナス[]{ - new STボーナス( 2, 4 ), - new STボーナス( 10, 1 ), - new STボーナス( 30, 0 ), - new STボーナス( 50, -1 ), - new STボーナス( 70, -3 ), - new STボーナス( 108, -5 ) - }; - this.nコンボ率ボーナス = new STボーナス[]{ - new STボーナス( 100.0, 1 ), - new STボーナス( 0.0, -6 ) - }; - this.nミス率ボーナス = new STボーナス[]{ - new STボーナス( 0, 1 ), - new STボーナス( 100.0, -6 ) - }; - - this.n全体最大ズレ時間ボーナス = new STボーナス[]{ - new STボーナス( 20, 3 ), - new STボーナス( 60, 1 ), - new STボーナス( 108, -5 ) - }; - this.n全体コンボ率ボーナス = new STボーナス[]{ - new STボーナス( 100.0, 1 ), - new STボーナス( 0.0, -5 ) - }; - this.n全体ミス率ボーナス = new STボーナス[]{ - new STボーナス( 0, 1 ), - new STボーナス( 100.0, -5 ), - }; - #endregion - } - - if (OpenTaiko.ConfigIni.bSuperHard) { - #region[ 超激辛 ] - this.st叩ききりまショー.b超激辛 = true; - - this.n精度ボーナス = new STボーナス[]{ - new STボーナス( 100, 3 ), - new STボーナス( 98, 2.3 ), - new STボーナス( 95, 2 ), - new STボーナス( 90, 1.5 ), - new STボーナス( 85, 0 ), - new STボーナス( 80, -2 ), - new STボーナス( 60, -3 ), - new STボーナス( 40, -6 ), - new STボーナス( 0, -7.5 ) - }; - - this.n最大ズレ時間ボーナス = new STボーナス[]{ - new STボーナス( 8, 5 ), - new STボーナス( 18, 3 ), - new STボーナス( 40, 1 ), - new STボーナス( 50, -0.5 ), - new STボーナス( 70, -3 ), - new STボーナス( 108, -5 ) - }; - this.nコンボ率ボーナス = new STボーナス[]{ - new STボーナス( 100.0, 1 ), - new STボーナス( 0.0, -6 ) - }; - this.nミス率ボーナス = new STボーナス[]{ - new STボーナス( 0, 1 ), - new STボーナス( 100.0, -6 ) - }; - - this.n全体精度ボーナス = new STボーナス[]{ - new STボーナス( 100, 7 ), - new STボーナス( 99, 4 ), - new STボーナス( 90, 2 ), - new STボーナス( 80, 1 ), - new STボーナス( 50, -1 ), - new STボーナス( 0, -7 ) - }; - this.n全体最大ズレ時間ボーナス = new STボーナス[]{ - new STボーナス( 20, 3 ), - new STボーナス( 40, 1 ), - new STボーナス( 60, -3 ), - new STボーナス( 108, -5 ) - }; - this.n全体コンボ率ボーナス = new STボーナス[]{ - new STボーナス( 100.0, 1 ), - new STボーナス( 0.0, -5 ) - }; - this.n全体ミス率ボーナス = new STボーナス[]{ - new STボーナス( 0, 0 ), - new STボーナス( 100.0, -5 ), - }; - #endregion - } - #endregion + this.n前回の延長時間 = (int)n延長する時間; + n延長する時間 = n延長する時間 * 1000; + if (n延長する時間 > 0) { + this.t加算審査アニメ_Start(); + if (this.st叩ききりまショー.b加算アニメ中 == false) + this.t加算時間描画_Start(); } - } - - public override void CreateManagedResource() { - //this.tx残り時間数字 = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\7_combo taiko.png" ) ); - //this.tx加算時間数字 = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\7_Score_number_1P.png" ) ); - //this.txタイマー枠 = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\7_TimerPanel.png" ) ); - //this.txタイマー針 = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\7_TimerTick.png" ) ); - //this.tx背景黒 = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\Tile black 64x64.png" ) ); - base.CreateManagedResource(); - } - - public override void ReleaseManagedResource() { - //CDTXMania.tテクスチャの解放( ref this.tx残り時間数字 ); - //CDTXMania.tテクスチャの解放( ref this.tx加算時間数字 ); - //CDTXMania.tテクスチャの解放( ref this.txタイマー枠 ); - //CDTXMania.tテクスチャの解放( ref this.txタイマー針 ); - //CDTXMania.tテクスチャの解放( ref this.tx背景黒 ); - base.ReleaseManagedResource(); - } - - public override int Draw() { - if (OpenTaiko.ConfigIni.eGameMode == EGame.Survival || OpenTaiko.ConfigIni.eGameMode == EGame.SurvivalHard) { - //if( this.st叩ききりまショー.b最初のチップが叩かれた == true )//&& - //CDTXMania.stage演奏ドラム画面.r検索範囲内にチップがあるか調べる( CSound管理.rc演奏用タイマ.n現在時刻ms, 0, 3000 ) ) - //this.st叩ききりまショー.ct残り時間.t進行(); - //else - //{ - // this.st叩ききりまショー.ct残り時間.n現在の値 = this.st叩ききりまショー.ct残り時間.n現在の値; - //} + this.st叩ききりまショー.ct残り時間.CurrentValue -= (int)n延長する時間; + } else if (this.st叩ききりまショー.ct残り時間.CurrentValue >= 24000) { + if (this.st叩ききりまショー.nおまけ加算が発生した回数 > 3) + return; + if (this.st叩ききりまショー.b超激辛 && (((double)this.st叩ききりまショー.nヒット数_POOR + this.st叩ききりまショー.nヒット数_MISS) > 0)) + return; //ミスが出るようでは上達しませんよ。お兄様。 + if (OpenTaiko.ConfigIni.bSuperHard) + return; //スーパーハード時はボーナス加点無し。 - //if( !this.st叩ききりまショー.ct残り時間.b停止中 ) - if (this.st叩ききりまショー.bタイマー使用中) { - if (!this.st叩ききりまショー.ct残り時間.IsStoped || this.st叩ききりまショー.b加算アニメ中 == true) { - this.st叩ききりまショー.ct残り時間.Tick(); - if (!OpenTaiko.stage演奏ドラム画面.r検索範囲内にチップがあるか調べる((long)(SoundManager.PlayTimer.NowTime * OpenTaiko.ConfigIni.SongPlaybackSpeed), 0, 5000, 0) || this.st叩ききりまショー.b加算アニメ中 == true) { - this.st叩ききりまショー.bタイマー使用中 = false; - this.st叩ききりまショー.ct残り時間.Stop(); - } - } + this.st叩ききりまショー.nおまけ加算が発生した回数++; + + if (this.st叩ききりまショー.nヒット数_PERFECT != 0 || this.st叩ききりまショー.nヒット数_GREAT != 0) { + double db区間内精度 = ((double)(this.st叩ききりまショー.nヒット数_PERFECT + this.st叩ききりまショー.nヒット数_GREAT) / this.st叩ききりまショー.n区間ノート数) * 100.0; + if (this.st叩ききりまショー.b超激辛 ? (db区間内精度 >= 95.0) : (db区間内精度 >= 98.0)) { + n延長する時間 += 6; } - - if (!this.st叩ききりまショー.bタイマー使用中 && this.st叩ききりまショー.b加算アニメ中 == false) { - if ((this.st叩ききりまショー.b最初のチップが叩かれた == true && (OpenTaiko.stage演奏ドラム画面.r検索範囲内にチップがあるか調べる(SoundManager.PlayTimer.NowTimeMs, 0, 2000, 0)))) { - this.st叩ききりまショー.bタイマー使用中 = true; - int nCount = this.st叩ききりまショー.ct残り時間.CurrentValue; - this.st叩ききりまショー.ct残り時間 = new CCounter(0, 25000, 1, OpenTaiko.Timer); - this.st叩ききりまショー.ct針アニメ = new CCounter(0, 1000, 1, OpenTaiko.Timer); - this.st叩ききりまショー.ct残り時間.CurrentValue = nCount; - } - - } - - - if ((this.st叩ききりまショー.ct残り時間.CurrentValue >= 20000) && this.st叩ききりまショー.ct残り時間.CurrentValue != 25000) - this.t叩ききりまショー_評価をして残り時間を延長する(); - - if (OpenTaiko.Tx.Tile_Black != null) { - if (this.st叩ききりまショー.ct残り時間.CurrentValue >= 22000 && this.st叩ききりまショー.ct残り時間.CurrentValue < 23000) - OpenTaiko.Tx.Tile_Black.Opacity = 64; - else if (this.st叩ききりまショー.ct残り時間.CurrentValue >= 23000 && this.st叩ききりまショー.ct残り時間.CurrentValue < 24000) - OpenTaiko.Tx.Tile_Black.Opacity = 128; - else if (this.st叩ききりまショー.ct残り時間.CurrentValue >= 24000) - OpenTaiko.Tx.Tile_Black.Opacity = 192; - else - OpenTaiko.Tx.Tile_Black.Opacity = 0; - - for (int i = 0; i <= (SampleFramework.GameWindowSize.Width / 64); i++) { - for (int j = 0; j <= (SampleFramework.GameWindowSize.Height / 64); j++) { - OpenTaiko.Tx.Tile_Black.t2D描画(i * 64, j * 64); - } - } - } - - //CDTXMania.act文字コンソール.tPrint( 100, 0, C文字コンソール.Eフォント種別.白, ( 25 - this.st叩ききりまショー.ct残り時間.n現在の値 ).ToString() ); - //CDTXMania.act文字コンソール.tPrint( 100, 16, C文字コンソール.Eフォント種別.白, this.st叩ききりまショー.n区間ノート数.ToString() ); - //CDTXMania.act文字コンソール.tPrint( 100, 16 * 2, C文字コンソール.Eフォント種別.白, this.st叩ききりまショー.n現在通過したノート数.ToString() ); - //CDTXMania.act文字コンソール.tPrint( 100, 16 * 3, C文字コンソール.Eフォント種別.白, this.st叩ききりまショー.nヒット数_MISS.ToString() ); - //CDTXMania.act文字コンソール.tPrint( 100, 16 * 4, C文字コンソール.Eフォント種別.白, this.st叩ききりまショー.n最小ズレ時間.ToString() ); - //CDTXMania.act文字コンソール.tPrint( 100, 16 * 5, C文字コンソール.Eフォント種別.白, this.st叩ききりまショー.n最大ズレ時間.ToString() ); - //CDTXMania.act文字コンソール.tPrint( 100, 16 * 6, C文字コンソール.Eフォント種別.白, this.st叩ききりまショー.n全体最大ズレ時間.ToString() ); - //CDTXMania.act文字コンソール.tPrint( 100, 16 * 7, C文字コンソール.Eフォント種別.白, this.st叩ききりまショー.n最大コンボ.ToString() ); - //CDTXMania.act文字コンソール.tPrint( 100, 16 * 7, C文字コンソール.Eフォント種別.白, this.st叩ききりまショー.ct加算審査中.n現在の値.ToString() ); - - #region[ 残り時間描画 ] - if (OpenTaiko.Tx.Taiko_Combo != null) { - if (OpenTaiko.Tx.GameMode_Timer_Frame != null) - OpenTaiko.Tx.GameMode_Timer_Frame.t2D描画(230, 84); - this.st叩ききりまショー.ct針アニメ.TickLoop(); - - int nCenterX = 230; - int nCerterY = 84; - float fRotate = -CConversion.DegreeToRadian(360.0f * (this.st叩ききりまショー.ct針アニメ.CurrentValue / 1000.0f)); - if (this.st叩ききりまショー.b加算アニメ中 == true) - fRotate = CConversion.DegreeToRadian(360.0f * (this.st叩ききりまショー.ct針アニメ.CurrentValue / (float)this.st叩ききりまショー.n延長アニメ速度)); - - /* - Matrix mat = Matrix.Identity; - if( this.st叩ききりまショー.b最初のチップが叩かれた ) - { - mat *= Matrix.RotationZ( fRotate ); - mat *= Matrix.Translation( 280 - 640, -( 134 - 360 ), 0 ); - } - else - { - mat *= Matrix.Translation( 280 - 640, -( 134 - 360 ), 0 ); - } - - TJAPlayer3.Tx.GameMode_Timer_Tick?.t3D描画( mat ); - */ - - string str表示する残り時間 = (this.st叩ききりまショー.ct残り時間.CurrentValue < 1000) ? "25" : ((26000 - this.st叩ききりまショー.ct残り時間.CurrentValue) / 1000).ToString(); - - if (OpenTaiko.Tx.GameMode_Timer_Frame != null) - this.t小文字表示(230 + (str表示する残り時間.Length * OpenTaiko.Skin.Game_Taiko_Combo_Size[0] / 4), 84 + OpenTaiko.Tx.GameMode_Timer_Frame.szTextureSize.Height / 2, string.Format("{0,2:#0}", str表示する残り時間)); - } - - if (!this.st叩ききりまショー.ct加算審査中.IsStoped) { - if (!this.st叩ききりまショー.ct加算審査中.IsStoped) { - this.st叩ききりまショー.ct加算審査中.Tick(); - if (this.st叩ききりまショー.ct加算審査中.IsEnded) { - this.st叩ききりまショー.ct加算審査中.Stop(); - this.st叩ききりまショー.b加算アニメ中 = false; - this.t加算時間描画_Start(); - } - } - } - if (!this.st叩ききりまショー.ct加算時間表示.IsStoped) { - if (!this.st叩ききりまショー.ct加算時間表示.IsStoped) { - this.st叩ききりまショー.ct加算時間表示.Tick(); - if (this.st叩ききりまショー.ct加算時間表示.IsEnded) { - this.st叩ききりまショー.ct加算時間表示.Stop(); - } - } - this.t加算時間描画(this.n前回の延長時間); - } - #endregion } - return 0; - } - - private void t叩ききりまショー_評価をして残り時間を延長する() { - double n延長する時間 = 0; - - //最後に延長した時刻から11秒経過していなければ延長を行わない。 - if (this.n最後に時間延長した時刻 + 11000 <= (SoundManager.PlayTimer.NowTime * OpenTaiko.ConfigIni.SongPlaybackSpeed)) { - //1項目につき5秒 - //-精度 - if (this.st叩ききりまショー.nヒット数_PERFECT != 0 || this.st叩ききりまショー.nヒット数_GREAT != 0) { - double db区間内精度 = ((double)(this.st叩ききりまショー.nヒット数_PERFECT + this.st叩ききりまショー.nヒット数_GREAT) / this.st叩ききりまショー.n区間ノート数) * 100.0; - for (int i = 0; i < this.n精度ボーナス.Length; i++) { - if (db区間内精度 >= this.n精度ボーナス[i].ret) { - n延長する時間 += this.n精度ボーナス[i].point; - break; - } - } + #region[ ラグ時間による判定 ] + if (this.st叩ききりまショー.n最小ズレ時間 != -1) { + if (this.st叩ききりまショー.n最小ズレ時間 >= 0) { + n延長する時間 += 6; } + } - //-ラグ時間 - #region[ ラグ時間による判定 ] - if (this.st叩ききりまショー.n最小ズレ時間 != -1) { - for (int i = 0; i < this.n最小ズレ時間ボーナス.Length; i++) { - if (this.st叩ききりまショー.n最小ズレ時間 >= this.n最小ズレ時間ボーナス[i].ret) { - n延長する時間 += this.n最小ズレ時間ボーナス[i].point; - break; - } - } + if (this.st叩ききりまショー.n最大ズレ時間 != -1) { + if (this.st叩ききりまショー.n最大ズレ時間 <= 30) { + n延長する時間 += 6; } - - if (this.st叩ききりまショー.n最大ズレ時間 != -1) { - for (int i = 0; i < this.n最大ズレ時間ボーナス.Length; i++) { - if (this.st叩ききりまショー.n最大ズレ時間 <= this.n最大ズレ時間ボーナス[i].ret) { - n延長する時間 += this.n最大ズレ時間ボーナス[i].point; - break; - } - } - } - #endregion - if (this.st叩ききりまショー.n最大コンボ != 0) { - double db区間内コンボ精度 = ((double)this.st叩ききりまショー.n最大コンボ / this.st叩ききりまショー.n区間ノート数) * 100.0; - for (int i = 0; i < this.nコンボ率ボーナス.Length; i++) { - if (db区間内コンボ精度 >= this.nコンボ率ボーナス[i].ret) { - n延長する時間 += this.nコンボ率ボーナス[i].point; - break; - } - } - } - - double db区間内ミス率 = (((double)this.st叩ききりまショー.nヒット数_POOR + this.st叩ききりまショー.nヒット数_MISS) / this.st叩ききりまショー.n区間ノート数) * 100.0; - for (int i = 0; i < this.nミス率ボーナス.Length; i++) { - if (db区間内ミス率 >= this.nミス率ボーナス[i].ret) { - n延長する時間 += this.nミス率ボーナス[i].point; - break; - } - } - #region[ 全体 ] - if (OpenTaiko.stage演奏ドラム画面.nヒット数_Auto含まない.Drums.Perfect != 0 || OpenTaiko.stage演奏ドラム画面.nヒット数_Auto含まない.Drums.Great != 0) { - double db全体精度 = ((double)(OpenTaiko.stage演奏ドラム画面.nヒット数_Auto含まない.Drums.Perfect + OpenTaiko.stage演奏ドラム画面.nヒット数_Auto含まない.Drums.Great) / this.st叩ききりまショー.n区間ノート数) * 100.0; - for (int i = 0; i < this.n全体精度ボーナス.Length; i++) { - if (db全体精度 >= this.n全体精度ボーナス[i].ret) { - n延長する時間 += this.n全体精度ボーナス[i].point; - break; - } - } - } - - //-ラグ時間 - #region[ ラグ時間による判定 ] - if (this.st叩ききりまショー.n全体最大ズレ時間 != -1) { - for (int i = 0; i < this.n全体最大ズレ時間ボーナス.Length; i++) { - if (this.st叩ききりまショー.n全体最大ズレ時間 <= this.n全体最大ズレ時間ボーナス[i].ret) { - n延長する時間 += this.n全体最大ズレ時間ボーナス[i].point; - break; - } - } - } - #endregion - if (OpenTaiko.stage演奏ドラム画面.actCombo.n現在のコンボ数.最高値[0] != 0) { - double db全体コンボ率 = ((double)OpenTaiko.stage演奏ドラム画面.actCombo.n現在のコンボ数.最高値[0] / this.st叩ききりまショー.n現在通過したノート数) * 100.0; - for (int i = 0; i < this.n全体コンボ率ボーナス.Length; i++) { - if (db全体コンボ率 >= this.n全体コンボ率ボーナス[i].ret) { - n延長する時間 += this.n全体コンボ率ボーナス[i].point; - break; - } - } - } - - double db全体ミス率 = (((double)OpenTaiko.stage演奏ドラム画面.nヒット数_Auto含まない.Drums.Poor + OpenTaiko.stage演奏ドラム画面.nヒット数_Auto含まない.Drums.Miss) / this.st叩ききりまショー.n現在通過したノート数) * 100.0; - for (int i = 0; i < this.n全体ミス率ボーナス.Length; i++) { - if (db全体ミス率 >= this.n全体ミス率ボーナス[i].ret) { - n延長する時間 += this.n全体ミス率ボーナス[i].point; - break; - } - } - #endregion + } + #endregion + double db区間内ミス率 = (((double)this.st叩ききりまショー.nヒット数_POOR + this.st叩ききりまショー.nヒット数_MISS) / this.st叩ききりまショー.n区間ノート数) * 100.0; + if (db区間内ミス率 >= 5.0) { + n延長する時間 -= 2; + } - this.n最後に時間延長した時刻 = (int)(SoundManager.PlayTimer.NowTime * OpenTaiko.ConfigIni.SongPlaybackSpeed); - if (n延長する時間 < 0) - n延長する時間 = 0; - if (this.st叩ききりまショー.n区間ノート数 == 0) - n延長する時間 = 15; + this.n最後に時間延長した時刻 = (int)(SoundManager.PlayTimer.NowTime * OpenTaiko.ConfigIni.SongPlaybackSpeed); + if (n延長する時間 < 0) + n延長する時間 = 0; - //各数値を初期化 - this.st叩ききりまショー.nヒット数_PERFECT = 0; - this.st叩ききりまショー.nヒット数_GREAT = 0; - this.st叩ききりまショー.nヒット数_GOOD = 0; - this.st叩ききりまショー.nヒット数_POOR = 0; - this.st叩ききりまショー.nヒット数_MISS = 0; - this.st叩ききりまショー.n区間ノート数 = 0; - this.st叩ききりまショー.n現在のコンボ = 0; - this.st叩ききりまショー.n最小ズレ時間 = -1; - this.st叩ききりまショー.n最大ズレ時間 = -1; + //各数値を初期化 + this.st叩ききりまショー.nヒット数_PERFECT = 0; + this.st叩ききりまショー.nヒット数_GREAT = 0; + this.st叩ききりまショー.nヒット数_GOOD = 0; + this.st叩ききりまショー.nヒット数_POOR = 0; + this.st叩ききりまショー.nヒット数_MISS = 0; + this.st叩ききりまショー.n区間ノート数 = 0; + this.st叩ききりまショー.n現在のコンボ = 0; + this.st叩ききりまショー.n最小ズレ時間 = -1; + this.st叩ききりまショー.n最大ズレ時間 = -1; - this.n前回の延長時間 = (int)n延長する時間; - n延長する時間 = n延長する時間 * 1000; - if (n延長する時間 > 0) { - this.t加算審査アニメ_Start(); - if (this.st叩ききりまショー.b加算アニメ中 == false) - this.t加算時間描画_Start(); - } + this.n前回の延長時間 = (int)n延長する時間; + n延長する時間 = n延長する時間 * 1000; + if (n延長する時間 > 0) { + this.t加算審査アニメ_Start(); + if (this.st叩ききりまショー.b加算アニメ中 == false) + this.t加算時間描画_Start(); + } + if (n延長する時間 > 5000) this.st叩ききりまショー.ct残り時間.CurrentValue -= (int)n延長する時間; - } else if (this.st叩ききりまショー.ct残り時間.CurrentValue >= 24000) { - if (this.st叩ききりまショー.nおまけ加算が発生した回数 > 3) - return; - if (this.st叩ききりまショー.b超激辛 && (((double)this.st叩ききりまショー.nヒット数_POOR + this.st叩ききりまショー.nヒット数_MISS) > 0)) - return; //ミスが出るようでは上達しませんよ。お兄様。 - if (OpenTaiko.ConfigIni.bSuperHard) - return; //スーパーハード時はボーナス加点無し。 + } + if (n延長する時間 >= 12000) + this.st叩ききりまショー.n延長アニメ速度 = 100; + else if (n延長する時間 < 12000 && n延長する時間 >= 5000) + this.st叩ききりまショー.n延長アニメ速度 = 250; + else + this.st叩ききりまショー.n延長アニメ速度 = 500; + } - this.st叩ききりまショー.nおまけ加算が発生した回数++; - - if (this.st叩ききりまショー.nヒット数_PERFECT != 0 || this.st叩ききりまショー.nヒット数_GREAT != 0) { - double db区間内精度 = ((double)(this.st叩ききりまショー.nヒット数_PERFECT + this.st叩ききりまショー.nヒット数_GREAT) / this.st叩ききりまショー.n区間ノート数) * 100.0; - if (this.st叩ききりまショー.b超激辛 ? (db区間内精度 >= 95.0) : (db区間内精度 >= 98.0)) { - n延長する時間 += 6; - } + public void t叩ききりまショー_判定から各数値を増加させる(ENoteJudge eJudge, int nLagTime) { + this.st叩ききりまショー.b最初のチップが叩かれた = true; + this.st叩ききりまショー.n区間ノート数++; + this.st叩ききりまショー.n現在通過したノート数++; + switch (eJudge) { + case ENoteJudge.Perfect: + this.st叩ききりまショー.nヒット数_PERFECT++; + break; + case ENoteJudge.Great: + this.st叩ききりまショー.nヒット数_GREAT++; + break; + case ENoteJudge.Good: + this.st叩ききりまショー.nヒット数_GOOD++; + break; + case ENoteJudge.Poor: + this.st叩ききりまショー.nヒット数_POOR++; + break; + case ENoteJudge.Miss: + this.st叩ききりまショー.nヒット数_MISS++; + break; + } + switch (eJudge) { + case ENoteJudge.Perfect: + case ENoteJudge.Great: + case ENoteJudge.Good: + this.st叩ききりまショー.n現在のコンボ++; + if (this.st叩ききりまショー.n現在のコンボ >= this.st叩ききりまショー.n最大コンボ) + this.st叩ききりまショー.n最大コンボ = this.st叩ききりまショー.n現在のコンボ; + if (Math.Abs(nLagTime) > this.st叩ききりまショー.n最大ズレ時間) { + this.st叩ききりまショー.n最大ズレ時間 = Math.Abs(nLagTime); } - #region[ ラグ時間による判定 ] - if (this.st叩ききりまショー.n最小ズレ時間 != -1) { - if (this.st叩ききりまショー.n最小ズレ時間 >= 0) { - n延長する時間 += 6; - } + if (Math.Abs(nLagTime) > this.st叩ききりまショー.n全体最大ズレ時間) { + this.st叩ききりまショー.n全体最大ズレ時間 = Math.Abs(nLagTime); } - - if (this.st叩ききりまショー.n最大ズレ時間 != -1) { - if (this.st叩ききりまショー.n最大ズレ時間 <= 30) { - n延長する時間 += 6; - } + if (this.st叩ききりまショー.n最小ズレ時間 == -1) + this.st叩ききりまショー.n最小ズレ時間 = Math.Abs(nLagTime); + if (Math.Abs(nLagTime) < this.st叩ききりまショー.n最小ズレ時間) { + this.st叩ききりまショー.n最小ズレ時間 = Math.Abs(nLagTime); } - #endregion - double db区間内ミス率 = (((double)this.st叩ききりまショー.nヒット数_POOR + this.st叩ききりまショー.nヒット数_MISS) / this.st叩ききりまショー.n区間ノート数) * 100.0; - if (db区間内ミス率 >= 5.0) { - n延長する時間 -= 2; - } - - - this.n最後に時間延長した時刻 = (int)(SoundManager.PlayTimer.NowTime * OpenTaiko.ConfigIni.SongPlaybackSpeed); - if (n延長する時間 < 0) - n延長する時間 = 0; - - //各数値を初期化 - this.st叩ききりまショー.nヒット数_PERFECT = 0; - this.st叩ききりまショー.nヒット数_GREAT = 0; - this.st叩ききりまショー.nヒット数_GOOD = 0; - this.st叩ききりまショー.nヒット数_POOR = 0; - this.st叩ききりまショー.nヒット数_MISS = 0; - this.st叩ききりまショー.n区間ノート数 = 0; + break; + default: this.st叩ききりまショー.n現在のコンボ = 0; - this.st叩ききりまショー.n最小ズレ時間 = -1; - this.st叩ききりまショー.n最大ズレ時間 = -1; + break; + } + } - this.n前回の延長時間 = (int)n延長する時間; - n延長する時間 = n延長する時間 * 1000; - if (n延長する時間 > 0) { - this.t加算審査アニメ_Start(); - if (this.st叩ききりまショー.b加算アニメ中 == false) - this.t加算時間描画_Start(); + private void t加算審査アニメ_Start() { + this.st叩ききりまショー.ct加算審査中 = new CCounter(0, 2000, 1, OpenTaiko.Timer); + this.st叩ききりまショー.b加算アニメ中 = true; + } + private void t加算時間描画_Start() { + this.st叩ききりまショー.ct加算時間表示 = new CCounter(0, 1, 1000, OpenTaiko.Timer); + } + + private void t加算時間描画(int addtime) { + this.t加算文字表示(258, 150, string.Format("{0,2:#0}", addtime.ToString())); + //CDTXMania.act文字コンソール.tPrint( 236, 80, C文字コンソール.Eフォント種別.赤, "+" + string.Format( "{0,2:#0}", addtime.ToString() ) ); + } + + private struct ST文字位置 { + public char ch; + public Point pt; + public ST文字位置(char ch, Point pt) { + this.ch = ch; + this.pt = pt; + } + } + + private ST文字位置[] st小文字位置 = new ST文字位置[]{ + new ST文字位置( '0', new Point( 0, 0 ) ), + new ST文字位置( '1', new Point( 44, 0 ) ), + new ST文字位置( '2', new Point( 88, 0 ) ), + new ST文字位置( '3', new Point( 132, 0 ) ), + new ST文字位置( '4', new Point( 176, 0 ) ), + new ST文字位置( '5', new Point( 220, 0 ) ), + new ST文字位置( '6', new Point( 264, 0 ) ), + new ST文字位置( '7', new Point( 308, 0 ) ), + new ST文字位置( '8', new Point( 352, 0 ) ), + new ST文字位置( '9', new Point( 396, 0 ) ) + }; + + private void t小文字表示(int x, int y, string str) { + foreach (char ch in str) { + for (int i = 0; i < this.st小文字位置.Length; i++) { + if (this.st小文字位置[i].ch == ch) { + Rectangle rectangle = new Rectangle(OpenTaiko.Skin.Game_Taiko_Combo_Size[0] * i, 0, OpenTaiko.Skin.Game_Taiko_Combo_Size[0], OpenTaiko.Skin.Game_Taiko_Combo_Size[1]); + if (OpenTaiko.Tx.Taiko_Combo[0] != null) { + if (this.st叩ききりまショー.bタイマー使用中) + OpenTaiko.Tx.Taiko_Combo[0].Opacity = 255; + else if (this.st叩ききりまショー.b最初のチップが叩かれた && !this.st叩ききりまショー.bタイマー使用中) + OpenTaiko.Tx.Taiko_Combo[0].Opacity = 128; + if (this.st叩ききりまショー.b加算アニメ中) + OpenTaiko.Tx.Taiko_Combo[0].Opacity = 0; + OpenTaiko.Tx.Taiko_Combo[0].vcScaleRatio.Y = 1f; + OpenTaiko.Tx.Taiko_Combo[0].vcScaleRatio.X = 1f; + OpenTaiko.Tx.Taiko_Combo[0].t2D中心基準描画(x, y, rectangle); + } + break; } - if (n延長する時間 > 5000) - this.st叩ききりまショー.ct残り時間.CurrentValue -= (int)n延長する時間; } - - if (n延長する時間 >= 12000) - this.st叩ききりまショー.n延長アニメ速度 = 100; - else if (n延長する時間 < 12000 && n延長する時間 >= 5000) - this.st叩ききりまショー.n延長アニメ速度 = 250; - else - this.st叩ききりまショー.n延長アニメ速度 = 500; + x += OpenTaiko.Skin.Game_Taiko_Combo_Padding[0] * 2; } - - public void t叩ききりまショー_判定から各数値を増加させる(ENoteJudge eJudge, int nLagTime) { - this.st叩ききりまショー.b最初のチップが叩かれた = true; - this.st叩ききりまショー.n区間ノート数++; - this.st叩ききりまショー.n現在通過したノート数++; - switch (eJudge) { - case ENoteJudge.Perfect: - this.st叩ききりまショー.nヒット数_PERFECT++; - break; - case ENoteJudge.Great: - this.st叩ききりまショー.nヒット数_GREAT++; - break; - case ENoteJudge.Good: - this.st叩ききりまショー.nヒット数_GOOD++; - break; - case ENoteJudge.Poor: - this.st叩ききりまショー.nヒット数_POOR++; - break; - case ENoteJudge.Miss: - this.st叩ききりまショー.nヒット数_MISS++; - break; - } - switch (eJudge) { - case ENoteJudge.Perfect: - case ENoteJudge.Great: - case ENoteJudge.Good: - this.st叩ききりまショー.n現在のコンボ++; - if (this.st叩ききりまショー.n現在のコンボ >= this.st叩ききりまショー.n最大コンボ) - this.st叩ききりまショー.n最大コンボ = this.st叩ききりまショー.n現在のコンボ; - if (Math.Abs(nLagTime) > this.st叩ききりまショー.n最大ズレ時間) { - this.st叩ききりまショー.n最大ズレ時間 = Math.Abs(nLagTime); - } - if (Math.Abs(nLagTime) > this.st叩ききりまショー.n全体最大ズレ時間) { - this.st叩ききりまショー.n全体最大ズレ時間 = Math.Abs(nLagTime); - } - if (this.st叩ききりまショー.n最小ズレ時間 == -1) - this.st叩ききりまショー.n最小ズレ時間 = Math.Abs(nLagTime); - if (Math.Abs(nLagTime) < this.st叩ききりまショー.n最小ズレ時間) { - this.st叩ききりまショー.n最小ズレ時間 = Math.Abs(nLagTime); - } - break; - default: - this.st叩ききりまショー.n現在のコンボ = 0; - break; - } - } - - private void t加算審査アニメ_Start() { - this.st叩ききりまショー.ct加算審査中 = new CCounter(0, 2000, 1, OpenTaiko.Timer); - this.st叩ききりまショー.b加算アニメ中 = true; - } - private void t加算時間描画_Start() { - this.st叩ききりまショー.ct加算時間表示 = new CCounter(0, 1, 1000, OpenTaiko.Timer); - } - - private void t加算時間描画(int addtime) { - this.t加算文字表示(258, 150, string.Format("{0,2:#0}", addtime.ToString())); - //CDTXMania.act文字コンソール.tPrint( 236, 80, C文字コンソール.Eフォント種別.赤, "+" + string.Format( "{0,2:#0}", addtime.ToString() ) ); - } - - private struct ST文字位置 { - public char ch; - public Point pt; - public ST文字位置(char ch, Point pt) { - this.ch = ch; - this.pt = pt; - } - } - - private ST文字位置[] st小文字位置 = new ST文字位置[]{ - new ST文字位置( '0', new Point( 0, 0 ) ), - new ST文字位置( '1', new Point( 44, 0 ) ), - new ST文字位置( '2', new Point( 88, 0 ) ), - new ST文字位置( '3', new Point( 132, 0 ) ), - new ST文字位置( '4', new Point( 176, 0 ) ), - new ST文字位置( '5', new Point( 220, 0 ) ), - new ST文字位置( '6', new Point( 264, 0 ) ), - new ST文字位置( '7', new Point( 308, 0 ) ), - new ST文字位置( '8', new Point( 352, 0 ) ), - new ST文字位置( '9', new Point( 396, 0 ) ) - }; - - private void t小文字表示(int x, int y, string str) { - foreach (char ch in str) { - for (int i = 0; i < this.st小文字位置.Length; i++) { - if (this.st小文字位置[i].ch == ch) { - Rectangle rectangle = new Rectangle(OpenTaiko.Skin.Game_Taiko_Combo_Size[0] * i, 0, OpenTaiko.Skin.Game_Taiko_Combo_Size[0], OpenTaiko.Skin.Game_Taiko_Combo_Size[1]); - if (OpenTaiko.Tx.Taiko_Combo[0] != null) { - if (this.st叩ききりまショー.bタイマー使用中) - OpenTaiko.Tx.Taiko_Combo[0].Opacity = 255; - else if (this.st叩ききりまショー.b最初のチップが叩かれた && !this.st叩ききりまショー.bタイマー使用中) - OpenTaiko.Tx.Taiko_Combo[0].Opacity = 128; - if (this.st叩ききりまショー.b加算アニメ中) - OpenTaiko.Tx.Taiko_Combo[0].Opacity = 0; - OpenTaiko.Tx.Taiko_Combo[0].vcScaleRatio.Y = 1f; - OpenTaiko.Tx.Taiko_Combo[0].vcScaleRatio.X = 1f; - OpenTaiko.Tx.Taiko_Combo[0].t2D中心基準描画(x, y, rectangle); - } - break; + } + protected void t加算文字表示(int x, int y, string str) { + char[] cFont = new char[] { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' }; + foreach (char ch in str) { + for (int i = 0; i < cFont.Length; i++) { + if (cFont[i] == ch) { + Rectangle rectangle = new Rectangle(OpenTaiko.Skin.Game_Score_Size[0] * i, 0, OpenTaiko.Skin.Game_Score_Size[0], OpenTaiko.Skin.Game_Score_Size[1]); + if (OpenTaiko.Tx.Taiko_Score[0] != null) { + OpenTaiko.Tx.Taiko_Score[0].vcScaleRatio.Y = 1f; + OpenTaiko.Tx.Taiko_Score[0].t2D描画(x, y, rectangle); } } - x += OpenTaiko.Skin.Game_Taiko_Combo_Padding[0] * 2; - } - } - protected void t加算文字表示(int x, int y, string str) { - char[] cFont = new char[] { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' }; - foreach (char ch in str) { - for (int i = 0; i < cFont.Length; i++) { - if (cFont[i] == ch) { - Rectangle rectangle = new Rectangle(OpenTaiko.Skin.Game_Score_Size[0] * i, 0, OpenTaiko.Skin.Game_Score_Size[0], OpenTaiko.Skin.Game_Score_Size[1]); - if (OpenTaiko.Tx.Taiko_Score[0] != null) { - OpenTaiko.Tx.Taiko_Score[0].vcScaleRatio.Y = 1f; - OpenTaiko.Tx.Taiko_Score[0].t2D描画(x, y, rectangle); - } - } - } - x += 20; } + x += 20; } } } diff --git a/OpenTaiko/src/Stages/07.Game/Taiko/CStage演奏ドラム画面.cs b/OpenTaiko/src/Stages/07.Game/Taiko/CStage演奏ドラム画面.cs index e55d70ea..498c14f7 100644 --- a/OpenTaiko/src/Stages/07.Game/Taiko/CStage演奏ドラム画面.cs +++ b/OpenTaiko/src/Stages/07.Game/Taiko/CStage演奏ドラム画面.cs @@ -5,2349 +5,2349 @@ using DiscordRPC; using FDK; using Point = System.Drawing.Point; using Rectangle = System.Drawing.Rectangle; -namespace OpenTaiko { - internal class CStage演奏ドラム画面 : CStage演奏画面共通 { - // コンストラクタ - - public CStage演奏ドラム画面() { - base.eStageID = CStage.EStage.Game; - base.ePhaseID = CStage.EPhase.Common_NORMAL; - base.IsDeActivated = true; - base.ChildActivities.Add(this.actPad = new CActImplPad()); - base.ChildActivities.Add(this.actCombo = new CActImplCombo()); - base.ChildActivities.Add(this.actChipFireD = new CActImplFireworks()); - base.ChildActivities.Add(this.Rainbow = new Rainbow()); - base.ChildActivities.Add(this.actGauge = new CActImplGauge()); - base.ChildActivities.Add(this.actJudgeString = new CActImplJudgeText()); - base.ChildActivities.Add(this.actTaikoLaneFlash = new TaikoLaneFlash()); - base.ChildActivities.Add(this.actScore = new CActImplScore()); - base.ChildActivities.Add(this.act譜面スクロール速度 = new CAct演奏スクロール速度()); - base.ChildActivities.Add(this.actAVI = new CAct演奏AVI()); - base.ChildActivities.Add(this.actPanel = new CAct演奏パネル文字列()); - base.ChildActivities.Add(this.actStageFailed = new CAct演奏ステージ失敗()); - base.ChildActivities.Add(this.actPlayInfo = new CAct演奏演奏情報()); - //base.list子Activities.Add( this.actFI = new CActFIFOBlack() ); - base.ChildActivities.Add(this.actFI = new CActFIFOStart()); - base.ChildActivities.Add(this.actFO = new CActFIFOBlack()); - base.ChildActivities.Add(this.actFOClear = new CActFIFOResult()); - base.ChildActivities.Add(this.actLane = new CActImplLane()); - base.ChildActivities.Add(this.actEnd = new CActImplClearAnimation()); - base.ChildActivities.Add(this.actDancer = new CActImplDancer()); - base.ChildActivities.Add(this.actMtaiko = new CActImplMtaiko()); - base.ChildActivities.Add(this.actLaneTaiko = new CActImplLaneTaiko()); - base.ChildActivities.Add(this.actRoll = new CActImplRoll()); - base.ChildActivities.Add(this.actBalloon = new CActImplBalloon()); - base.ChildActivities.Add(this.actChara = new CActImplCharacter()); - base.ChildActivities.Add(this.actGame = new CAct演奏Drumsゲームモード()); - base.ChildActivities.Add(this.actBackground = new CActImplBackground()); - base.ChildActivities.Add(this.actRollChara = new CActImplRollEffect()); - base.ChildActivities.Add(this.actComboBalloon = new CActImplComboBalloon()); - base.ChildActivities.Add(this.actComboVoice = new CAct演奏Combo音声()); - base.ChildActivities.Add(this.actPauseMenu = new CAct演奏PauseMenu()); - base.ChildActivities.Add(this.actChipEffects = new CActImplChipEffects()); - base.ChildActivities.Add(this.actFooter = new CActImplFooter()); - base.ChildActivities.Add(this.actRunner = new CActImplRunner()); - base.ChildActivities.Add(this.actMob = new CActImplMob()); - base.ChildActivities.Add(this.GoGoSplash = new GoGoSplash()); - base.ChildActivities.Add(this.FlyingNotes = new FlyingNotes()); - base.ChildActivities.Add(this.FireWorks = new FireWorks()); - base.ChildActivities.Add(this.PuchiChara = new PuchiChara()); - base.ChildActivities.Add(this.ScoreRank = new CActImplScoreRank()); +namespace OpenTaiko; - base.ChildActivities.Add(this.actDan = new Dan_Cert()); - base.ChildActivities.Add(this.actTokkun = new CActImplTrainingMode()); - base.ChildActivities.Add(this.actAIBattle = new AIBattle()); - #region[ 文字初期化 ] - ST文字位置[] st文字位置Array = new ST文字位置[12]; - ST文字位置 st文字位置 = new ST文字位置(); - st文字位置.ch = '0'; - st文字位置.pt = new Point(0, 0); - st文字位置Array[0] = st文字位置; - ST文字位置 st文字位置2 = new ST文字位置(); - st文字位置2.ch = '1'; - st文字位置2.pt = new Point(32, 0); - st文字位置Array[1] = st文字位置2; - ST文字位置 st文字位置3 = new ST文字位置(); - st文字位置3.ch = '2'; - st文字位置3.pt = new Point(64, 0); - st文字位置Array[2] = st文字位置3; - ST文字位置 st文字位置4 = new ST文字位置(); - st文字位置4.ch = '3'; - st文字位置4.pt = new Point(96, 0); - st文字位置Array[3] = st文字位置4; - ST文字位置 st文字位置5 = new ST文字位置(); - st文字位置5.ch = '4'; - st文字位置5.pt = new Point(128, 0); - st文字位置Array[4] = st文字位置5; - ST文字位置 st文字位置6 = new ST文字位置(); - st文字位置6.ch = '5'; - st文字位置6.pt = new Point(160, 0); - st文字位置Array[5] = st文字位置6; - ST文字位置 st文字位置7 = new ST文字位置(); - st文字位置7.ch = '6'; - st文字位置7.pt = new Point(192, 0); - st文字位置Array[6] = st文字位置7; - ST文字位置 st文字位置8 = new ST文字位置(); - st文字位置8.ch = '7'; - st文字位置8.pt = new Point(224, 0); - st文字位置Array[7] = st文字位置8; - ST文字位置 st文字位置9 = new ST文字位置(); - st文字位置9.ch = '8'; - st文字位置9.pt = new Point(256, 0); - st文字位置Array[8] = st文字位置9; - ST文字位置 st文字位置10 = new ST文字位置(); - st文字位置10.ch = '9'; - st文字位置10.pt = new Point(288, 0); - st文字位置Array[9] = st文字位置10; - ST文字位置 st文字位置11 = new ST文字位置(); - st文字位置11.ch = '%'; - st文字位置11.pt = new Point(320, 0); - st文字位置Array[10] = st文字位置11; - ST文字位置 st文字位置12 = new ST文字位置(); - st文字位置12.ch = ' '; - st文字位置12.pt = new Point(0, 0); - st文字位置Array[11] = st文字位置12; - this.st小文字位置 = st文字位置Array; +internal class CStage演奏ドラム画面 : CStage演奏画面共通 { + // コンストラクタ - st文字位置Array = new ST文字位置[12]; - st文字位置 = new ST文字位置(); - st文字位置.ch = '0'; - st文字位置.pt = new Point(0, 0); - st文字位置Array[0] = st文字位置; - st文字位置2 = new ST文字位置(); - st文字位置2.ch = '1'; - st文字位置2.pt = new Point(32, 0); - st文字位置Array[1] = st文字位置2; - st文字位置3 = new ST文字位置(); - st文字位置3.ch = '2'; - st文字位置3.pt = new Point(64, 0); - st文字位置Array[2] = st文字位置3; - st文字位置4 = new ST文字位置(); - st文字位置4.ch = '3'; - st文字位置4.pt = new Point(96, 0); - st文字位置Array[3] = st文字位置4; - st文字位置5 = new ST文字位置(); - st文字位置5.ch = '4'; - st文字位置5.pt = new Point(128, 0); - st文字位置Array[4] = st文字位置5; - st文字位置6 = new ST文字位置(); - st文字位置6.ch = '5'; - st文字位置6.pt = new Point(160, 0); - st文字位置Array[5] = st文字位置6; - st文字位置7 = new ST文字位置(); - st文字位置7.ch = '6'; - st文字位置7.pt = new Point(192, 0); - st文字位置Array[6] = st文字位置7; - st文字位置8 = new ST文字位置(); - st文字位置8.ch = '7'; - st文字位置8.pt = new Point(224, 0); - st文字位置Array[7] = st文字位置8; - st文字位置9 = new ST文字位置(); - st文字位置9.ch = '8'; - st文字位置9.pt = new Point(256, 0); - st文字位置Array[8] = st文字位置9; - st文字位置10 = new ST文字位置(); - st文字位置10.ch = '9'; - st文字位置10.pt = new Point(288, 0); - st文字位置Array[9] = st文字位置10; - st文字位置11 = new ST文字位置(); - st文字位置11.ch = '%'; - st文字位置11.pt = new Point(320, 0); - st文字位置Array[10] = st文字位置11; - st文字位置12 = new ST文字位置(); - st文字位置12.ch = ' '; - st文字位置12.pt = new Point(0, 0); - st文字位置Array[11] = st文字位置12; - this.st小文字位置 = st文字位置Array; - #endregion - } - - - // メソッド - - public void t演奏結果を格納する(out CScoreIni.C演奏記録 Drums) { - base.t演奏結果を格納する_ドラム(out Drums); - } - - - // CStage 実装 - - public override void Activate() { - LoudnessMetadataScanner.StopBackgroundScanning(joinImmediately: false); + public CStage演奏ドラム画面() { + base.eStageID = CStage.EStage.Game; + base.ePhaseID = CStage.EPhase.Common_NORMAL; + base.IsDeActivated = true; + base.ChildActivities.Add(this.actPad = new CActImplPad()); + base.ChildActivities.Add(this.actCombo = new CActImplCombo()); + base.ChildActivities.Add(this.actChipFireD = new CActImplFireworks()); + base.ChildActivities.Add(this.Rainbow = new Rainbow()); + base.ChildActivities.Add(this.actGauge = new CActImplGauge()); + base.ChildActivities.Add(this.actJudgeString = new CActImplJudgeText()); + base.ChildActivities.Add(this.actTaikoLaneFlash = new TaikoLaneFlash()); + base.ChildActivities.Add(this.actScore = new CActImplScore()); + base.ChildActivities.Add(this.act譜面スクロール速度 = new CAct演奏スクロール速度()); + base.ChildActivities.Add(this.actAVI = new CAct演奏AVI()); + base.ChildActivities.Add(this.actPanel = new CAct演奏パネル文字列()); + base.ChildActivities.Add(this.actStageFailed = new CAct演奏ステージ失敗()); + base.ChildActivities.Add(this.actPlayInfo = new CAct演奏演奏情報()); + //base.list子Activities.Add( this.actFI = new CActFIFOBlack() ); + base.ChildActivities.Add(this.actFI = new CActFIFOStart()); + base.ChildActivities.Add(this.actFO = new CActFIFOBlack()); + base.ChildActivities.Add(this.actFOClear = new CActFIFOResult()); + base.ChildActivities.Add(this.actLane = new CActImplLane()); + base.ChildActivities.Add(this.actEnd = new CActImplClearAnimation()); + base.ChildActivities.Add(this.actDancer = new CActImplDancer()); + base.ChildActivities.Add(this.actMtaiko = new CActImplMtaiko()); + base.ChildActivities.Add(this.actLaneTaiko = new CActImplLaneTaiko()); + base.ChildActivities.Add(this.actRoll = new CActImplRoll()); + base.ChildActivities.Add(this.actBalloon = new CActImplBalloon()); + base.ChildActivities.Add(this.actChara = new CActImplCharacter()); + base.ChildActivities.Add(this.actGame = new CAct演奏Drumsゲームモード()); + base.ChildActivities.Add(this.actBackground = new CActImplBackground()); + base.ChildActivities.Add(this.actRollChara = new CActImplRollEffect()); + base.ChildActivities.Add(this.actComboBalloon = new CActImplComboBalloon()); + base.ChildActivities.Add(this.actComboVoice = new CAct演奏Combo音声()); + base.ChildActivities.Add(this.actPauseMenu = new CAct演奏PauseMenu()); + base.ChildActivities.Add(this.actChipEffects = new CActImplChipEffects()); + base.ChildActivities.Add(this.actFooter = new CActImplFooter()); + base.ChildActivities.Add(this.actRunner = new CActImplRunner()); + base.ChildActivities.Add(this.actMob = new CActImplMob()); + base.ChildActivities.Add(this.GoGoSplash = new GoGoSplash()); + base.ChildActivities.Add(this.FlyingNotes = new FlyingNotes()); + base.ChildActivities.Add(this.FireWorks = new FireWorks()); + base.ChildActivities.Add(this.PuchiChara = new PuchiChara()); + base.ChildActivities.Add(this.ScoreRank = new CActImplScoreRank()); - this.bフィルイン中 = false; - this.n待機中の大音符の座標 = 0; - this.actGame.t叩ききりまショー_初期化(); - base.ReSetScore(OpenTaiko.DTX.nScoreInit[0, OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0]], OpenTaiko.DTX.nScoreDiff[OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0]]); - - #region [ branch ] - for (int i = 0; i < 5; i++) { - this.n分岐した回数[i] = 0; - this.bLEVELHOLD[i] = false; - } - this.nBranch条件数値A = 0; - this.nBranch条件数値B = 0; - #endregion - - if ((OpenTaiko.DTX.listVD.TryGetValue(1, out CVideoDecoder vd2))) { - ShowVideo = true; - } else { - ShowVideo = false; - } + base.ChildActivities.Add(this.actDan = new Dan_Cert()); + base.ChildActivities.Add(this.actTokkun = new CActImplTrainingMode()); + base.ChildActivities.Add(this.actAIBattle = new AIBattle()); + #region[ 文字初期化 ] + ST文字位置[] st文字位置Array = new ST文字位置[12]; + ST文字位置 st文字位置 = new ST文字位置(); + st文字位置.ch = '0'; + st文字位置.pt = new Point(0, 0); + st文字位置Array[0] = st文字位置; + ST文字位置 st文字位置2 = new ST文字位置(); + st文字位置2.ch = '1'; + st文字位置2.pt = new Point(32, 0); + st文字位置Array[1] = st文字位置2; + ST文字位置 st文字位置3 = new ST文字位置(); + st文字位置3.ch = '2'; + st文字位置3.pt = new Point(64, 0); + st文字位置Array[2] = st文字位置3; + ST文字位置 st文字位置4 = new ST文字位置(); + st文字位置4.ch = '3'; + st文字位置4.pt = new Point(96, 0); + st文字位置Array[3] = st文字位置4; + ST文字位置 st文字位置5 = new ST文字位置(); + st文字位置5.ch = '4'; + st文字位置5.pt = new Point(128, 0); + st文字位置Array[4] = st文字位置5; + ST文字位置 st文字位置6 = new ST文字位置(); + st文字位置6.ch = '5'; + st文字位置6.pt = new Point(160, 0); + st文字位置Array[5] = st文字位置6; + ST文字位置 st文字位置7 = new ST文字位置(); + st文字位置7.ch = '6'; + st文字位置7.pt = new Point(192, 0); + st文字位置Array[6] = st文字位置7; + ST文字位置 st文字位置8 = new ST文字位置(); + st文字位置8.ch = '7'; + st文字位置8.pt = new Point(224, 0); + st文字位置Array[7] = st文字位置8; + ST文字位置 st文字位置9 = new ST文字位置(); + st文字位置9.ch = '8'; + st文字位置9.pt = new Point(256, 0); + st文字位置Array[8] = st文字位置9; + ST文字位置 st文字位置10 = new ST文字位置(); + st文字位置10.ch = '9'; + st文字位置10.pt = new Point(288, 0); + st文字位置Array[9] = st文字位置10; + ST文字位置 st文字位置11 = new ST文字位置(); + st文字位置11.ch = '%'; + st文字位置11.pt = new Point(320, 0); + st文字位置Array[10] = st文字位置11; + ST文字位置 st文字位置12 = new ST文字位置(); + st文字位置12.ch = ' '; + st文字位置12.pt = new Point(0, 0); + st文字位置Array[11] = st文字位置12; + this.st小文字位置 = st文字位置Array; - base.Activate(); - base.ePhaseID = CStage.EPhase.Common_NORMAL;//初期化すれば、リザルト変遷は止まる。 - - for (int i = 0; i < 5; i++) { - ifp[i] = false; - isDeniedPlaying[i] = false; - - if (bIsAlreadyCleared[i]) { - actBackground.ClearIn(i); - } - } - - this.nStoredHit = new int[OpenTaiko.ConfigIni.nPlayerCount]; - - dtLastQueueOperation = DateTime.MinValue; - - PuchiChara.ChangeBPM(60.0 / OpenTaiko.stage演奏ドラム画面.actPlayInfo.dbBPM[0]); - - //dbUnit = Math.Ceiling( dbUnit * 1000.0 ); - //dbUnit = dbUnit / 1000.0; - - //if (this.actChara.ctキャラクターアクションタイマ != null) this.actChara.ctキャラクターアクションタイマ = new CCounter(); - - //this.actDancer.ct通常モーション = new CCounter( 0, this.actDancer.arモーション番号_通常.Length - 1, ( dbUnit * 4.0) / this.actDancer.arモーション番号_通常.Length, CSound管理.rc演奏用タイマ ); - //this.actDancer.ctモブ = new CCounter( 1.0, 16.0, ((60.0 / CDTXMania.stage演奏ドラム画面.actPlayInfo.dbBPM / 16.0 )), CSound管理.rc演奏用タイマ ); - - - this.ct手つなぎ = new CCounter(0, 60, 20, OpenTaiko.Timer); - this.ShownLyric2 = 0; + st文字位置Array = new ST文字位置[12]; + st文字位置 = new ST文字位置(); + st文字位置.ch = '0'; + st文字位置.pt = new Point(0, 0); + st文字位置Array[0] = st文字位置; + st文字位置2 = new ST文字位置(); + st文字位置2.ch = '1'; + st文字位置2.pt = new Point(32, 0); + st文字位置Array[1] = st文字位置2; + st文字位置3 = new ST文字位置(); + st文字位置3.ch = '2'; + st文字位置3.pt = new Point(64, 0); + st文字位置Array[2] = st文字位置3; + st文字位置4 = new ST文字位置(); + st文字位置4.ch = '3'; + st文字位置4.pt = new Point(96, 0); + st文字位置Array[3] = st文字位置4; + st文字位置5 = new ST文字位置(); + st文字位置5.ch = '4'; + st文字位置5.pt = new Point(128, 0); + st文字位置Array[4] = st文字位置5; + st文字位置6 = new ST文字位置(); + st文字位置6.ch = '5'; + st文字位置6.pt = new Point(160, 0); + st文字位置Array[5] = st文字位置6; + st文字位置7 = new ST文字位置(); + st文字位置7.ch = '6'; + st文字位置7.pt = new Point(192, 0); + st文字位置Array[6] = st文字位置7; + st文字位置8 = new ST文字位置(); + st文字位置8.ch = '7'; + st文字位置8.pt = new Point(224, 0); + st文字位置Array[7] = st文字位置8; + st文字位置9 = new ST文字位置(); + st文字位置9.ch = '8'; + st文字位置9.pt = new Point(256, 0); + st文字位置Array[8] = st文字位置9; + st文字位置10 = new ST文字位置(); + st文字位置10.ch = '9'; + st文字位置10.pt = new Point(288, 0); + st文字位置Array[9] = st文字位置10; + st文字位置11 = new ST文字位置(); + st文字位置11.ch = '%'; + st文字位置11.pt = new Point(320, 0); + st文字位置Array[10] = st文字位置11; + st文字位置12 = new ST文字位置(); + st文字位置12.ch = ' '; + st文字位置12.pt = new Point(0, 0); + st文字位置Array[11] = st文字位置12; + this.st小文字位置 = st文字位置Array; + #endregion + } - string diffToString(int diff) { - string[] diffArr = - { - " Easy ", - " Normal ", - " Hard ", - " Extreme ", - " Extra ", - " Tower ", - " Dan " - }; - string[] diffArrIcon = - { - "-", - "", - "+" - }; + // メソッド - int level = OpenTaiko.stageSongSelect.rChoosenSong.nLevel[diff]; - CDTX.ELevelIcon levelIcon = OpenTaiko.stageSongSelect.rChoosenSong.nLevelIcon[diff]; + public void t演奏結果を格納する(out CScoreIni.C演奏記録 Drums) { + base.t演奏結果を格納する_ドラム(out Drums); + } - return (diffArr[Math.Min(diff, 6)] + "Lv." + level + diffArrIcon[(int)levelIcon]); - } - - // Discord Presence の更新 - string details = OpenTaiko.ConfigIni.SendDiscordPlayingInformation ? OpenTaiko.stageSongSelect.rChoosenSong.ldTitle.GetString("") - + diffToString(OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0]) : ""; - - // Byte count must be used instead of String.Length. - // The byte count is what Discord is concerned with. Some chars are greater than one byte. - if (Encoding.UTF8.GetBytes(details).Length > 128) { - byte[] details_byte = Encoding.UTF8.GetBytes(details); - Array.Resize(ref details_byte, 128); - details = Encoding.UTF8.GetString(details_byte); - } - var difficultyName = OpenTaiko.DifficultyNumberToEnum(OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0]).ToString(); + // CStage 実装 - OpenTaiko.DiscordClient?.SetPresence(new RichPresence() { - Details = details, - State = "Playing" + (OpenTaiko.ConfigIni.bAutoPlay[0] == true ? " (Auto)" : ""), - Timestamps = new Timestamps(DateTime.UtcNow, DateTime.UtcNow.AddMilliseconds(OpenTaiko.DTX.listChip[OpenTaiko.DTX.listChip.Count - 1].n発声時刻ms / OpenTaiko.ConfigIni.SongPlaybackSpeed)), - Assets = new Assets() { - SmallImageKey = OpenTaiko.ConfigIni.SendDiscordPlayingInformation ? difficultyName.ToLower() : "", - SmallImageText = OpenTaiko.ConfigIni.SendDiscordPlayingInformation ? String.Format("COURSE:{0} ({1})", difficultyName, OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0]) : "", - LargeImageKey = OpenTaiko.LargeImageKey, - LargeImageText = OpenTaiko.LargeImageText, - } - }); - - - - // When performing calibration, reduce audio distraction from user input. - // For users who play primarily by listening to the music, - // you might think that we want them to hear drum sound effects during - // calibration, but we do not. Humans are remarkably good at adjusting - // the timing of their own physical movement, even without realizing it. - // We are calibrating their input timing for the purposes of judgment. - // We do not want them subconsciously playing early so as to line up - // their drum sound effects with the sounds of the input calibration file. - // Instead, we want them focused on the sounds of their keyboard, tatacon, - // other controller, etc. and the sounds of the input calibration audio file. - for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { - int actual = OpenTaiko.GetActualPlayer(i); - - var hs = OpenTaiko.Skin.hsHitSoundsInformations; - - this.soundRed[i] = OpenTaiko.SoundManager.tCreateSound((@$"Global{Path.DirectorySeparatorChar}HitSounds{Path.DirectorySeparatorChar}" + hs.don[actual]), ESoundGroup.SoundEffect); - this.soundBlue[i] = OpenTaiko.SoundManager.tCreateSound((@$"Global{Path.DirectorySeparatorChar}HitSounds{Path.DirectorySeparatorChar}" + hs.ka[actual]), ESoundGroup.SoundEffect); - this.soundAdlib[i] = OpenTaiko.SoundManager.tCreateSound((@$"Global{Path.DirectorySeparatorChar}HitSounds{Path.DirectorySeparatorChar}" + hs.adlib[actual]), ESoundGroup.SoundEffect); - this.soundClap[i] = OpenTaiko.SoundManager.tCreateSound((@$"Global{Path.DirectorySeparatorChar}HitSounds{Path.DirectorySeparatorChar}" + hs.clap[actual]), ESoundGroup.SoundEffect); - - int _panning = OpenTaiko.ConfigIni.nPanning[OpenTaiko.ConfigIni.nPlayerCount - 1][i]; - if (this.soundRed[i] != null) this.soundRed[i].SoundPosition = _panning; - if (this.soundBlue[i] != null) this.soundBlue[i].SoundPosition = _panning; - if (this.soundAdlib[i] != null) this.soundAdlib[i].SoundPosition = _panning; - if (this.soundClap[i] != null) this.soundClap[i].SoundPosition = _panning; + public override void Activate() { + LoudnessMetadataScanner.StopBackgroundScanning(joinImmediately: false); + + this.bフィルイン中 = false; + this.n待機中の大音符の座標 = 0; + this.actGame.t叩ききりまショー_初期化(); + base.ReSetScore(OpenTaiko.DTX.nScoreInit[0, OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0]], OpenTaiko.DTX.nScoreDiff[OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0]]); + + #region [ branch ] + for (int i = 0; i < 5; i++) { + this.n分岐した回数[i] = 0; + this.bLEVELHOLD[i] = false; + } + this.nBranch条件数値A = 0; + this.nBranch条件数値B = 0; + #endregion + + if ((OpenTaiko.DTX.listVD.TryGetValue(1, out CVideoDecoder vd2))) { + ShowVideo = true; + } else { + ShowVideo = false; + } + + base.Activate(); + base.ePhaseID = CStage.EPhase.Common_NORMAL;//初期化すれば、リザルト変遷は止まる。 + + for (int i = 0; i < 5; i++) { + ifp[i] = false; + isDeniedPlaying[i] = false; + + if (bIsAlreadyCleared[i]) { + actBackground.ClearIn(i); } } - public override void DeActivate() { - this.ct手つなぎ = null; + + this.nStoredHit = new int[OpenTaiko.ConfigIni.nPlayerCount]; + + dtLastQueueOperation = DateTime.MinValue; + + PuchiChara.ChangeBPM(60.0 / OpenTaiko.stage演奏ドラム画面.actPlayInfo.dbBPM[0]); + + //dbUnit = Math.Ceiling( dbUnit * 1000.0 ); + //dbUnit = dbUnit / 1000.0; + + //if (this.actChara.ctキャラクターアクションタイマ != null) this.actChara.ctキャラクターアクションタイマ = new CCounter(); + + //this.actDancer.ct通常モーション = new CCounter( 0, this.actDancer.arモーション番号_通常.Length - 1, ( dbUnit * 4.0) / this.actDancer.arモーション番号_通常.Length, CSound管理.rc演奏用タイマ ); + //this.actDancer.ctモブ = new CCounter( 1.0, 16.0, ((60.0 / CDTXMania.stage演奏ドラム画面.actPlayInfo.dbBPM / 16.0 )), CSound管理.rc演奏用タイマ ); + + + this.ct手つなぎ = new CCounter(0, 60, 20, OpenTaiko.Timer); + this.ShownLyric2 = 0; + + + string diffToString(int diff) { + string[] diffArr = + { + " Easy ", + " Normal ", + " Hard ", + " Extreme ", + " Extra ", + " Tower ", + " Dan " + }; + string[] diffArrIcon = + { + "-", + "", + "+" + }; + + int level = OpenTaiko.stageSongSelect.rChoosenSong.nLevel[diff]; + CDTX.ELevelIcon levelIcon = OpenTaiko.stageSongSelect.rChoosenSong.nLevelIcon[diff]; + + return (diffArr[Math.Min(diff, 6)] + "Lv." + level + diffArrIcon[(int)levelIcon]); + } + + // Discord Presence の更新 + string details = OpenTaiko.ConfigIni.SendDiscordPlayingInformation ? OpenTaiko.stageSongSelect.rChoosenSong.ldTitle.GetString("") + + diffToString(OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0]) : ""; + + // Byte count must be used instead of String.Length. + // The byte count is what Discord is concerned with. Some chars are greater than one byte. + if (Encoding.UTF8.GetBytes(details).Length > 128) { + byte[] details_byte = Encoding.UTF8.GetBytes(details); + Array.Resize(ref details_byte, 128); + details = Encoding.UTF8.GetString(details_byte); + } + + var difficultyName = OpenTaiko.DifficultyNumberToEnum(OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0]).ToString(); + + OpenTaiko.DiscordClient?.SetPresence(new RichPresence() { + Details = details, + State = "Playing" + (OpenTaiko.ConfigIni.bAutoPlay[0] == true ? " (Auto)" : ""), + Timestamps = new Timestamps(DateTime.UtcNow, DateTime.UtcNow.AddMilliseconds(OpenTaiko.DTX.listChip[OpenTaiko.DTX.listChip.Count - 1].n発声時刻ms / OpenTaiko.ConfigIni.SongPlaybackSpeed)), + Assets = new Assets() { + SmallImageKey = OpenTaiko.ConfigIni.SendDiscordPlayingInformation ? difficultyName.ToLower() : "", + SmallImageText = OpenTaiko.ConfigIni.SendDiscordPlayingInformation ? String.Format("COURSE:{0} ({1})", difficultyName, OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0]) : "", + LargeImageKey = OpenTaiko.LargeImageKey, + LargeImageText = OpenTaiko.LargeImageText, + } + }); + + + + // When performing calibration, reduce audio distraction from user input. + // For users who play primarily by listening to the music, + // you might think that we want them to hear drum sound effects during + // calibration, but we do not. Humans are remarkably good at adjusting + // the timing of their own physical movement, even without realizing it. + // We are calibrating their input timing for the purposes of judgment. + // We do not want them subconsciously playing early so as to line up + // their drum sound effects with the sounds of the input calibration file. + // Instead, we want them focused on the sounds of their keyboard, tatacon, + // other controller, etc. and the sounds of the input calibration audio file. + for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { + int actual = OpenTaiko.GetActualPlayer(i); + + var hs = OpenTaiko.Skin.hsHitSoundsInformations; + + this.soundRed[i] = OpenTaiko.SoundManager.tCreateSound((@$"Global{Path.DirectorySeparatorChar}HitSounds{Path.DirectorySeparatorChar}" + hs.don[actual]), ESoundGroup.SoundEffect); + this.soundBlue[i] = OpenTaiko.SoundManager.tCreateSound((@$"Global{Path.DirectorySeparatorChar}HitSounds{Path.DirectorySeparatorChar}" + hs.ka[actual]), ESoundGroup.SoundEffect); + this.soundAdlib[i] = OpenTaiko.SoundManager.tCreateSound((@$"Global{Path.DirectorySeparatorChar}HitSounds{Path.DirectorySeparatorChar}" + hs.adlib[actual]), ESoundGroup.SoundEffect); + this.soundClap[i] = OpenTaiko.SoundManager.tCreateSound((@$"Global{Path.DirectorySeparatorChar}HitSounds{Path.DirectorySeparatorChar}" + hs.clap[actual]), ESoundGroup.SoundEffect); + + int _panning = OpenTaiko.ConfigIni.nPanning[OpenTaiko.ConfigIni.nPlayerCount - 1][i]; + if (this.soundRed[i] != null) this.soundRed[i].SoundPosition = _panning; + if (this.soundBlue[i] != null) this.soundBlue[i].SoundPosition = _panning; + if (this.soundAdlib[i] != null) this.soundAdlib[i].SoundPosition = _panning; + if (this.soundClap[i] != null) this.soundClap[i].SoundPosition = _panning; + } + } + public override void DeActivate() { + this.ct手つなぎ = null; + + for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { + if (this.soundRed[i] != null) + this.soundRed[i].tDispose(); + if (this.soundBlue[i] != null) + this.soundBlue[i].tDispose(); + if (this.soundAdlib[i] != null) + this.soundAdlib[i].tDispose(); + if (this.soundClap[i] != null) + this.soundClap[i].tDispose(); + } + + base.DeActivate(); + + LoudnessMetadataScanner.StartBackgroundScanning(); + } + public override void CreateManagedResource() { + base.CreateManagedResource(); + } + public override void ReleaseManagedResource() { + base.ReleaseManagedResource(); + } + public override int Draw() { + base.sw.Start(); + if (!base.IsDeActivated) { + bool bIsFinishedPlaying = false; + bool bIsFinishedEndAnime = false; + bool bIsFinishedFadeout = false; + #region [ 初めての進行描画 ] + if (base.IsFirstDraw) { + SoundManager.PlayTimer.Reset(); + OpenTaiko.Timer.Reset(); + this.ctチップ模様アニメ.Drums = new CCounter(0, 1, 500, OpenTaiko.Timer); + this.ctチップ模様アニメ.Guitar = new CCounter(0, 0x17, 20, OpenTaiko.Timer); + this.ctチップ模様アニメ.Bass = new CCounter(0, 0x17, 20, OpenTaiko.Timer); + this.ctチップ模様アニメ.Taiko = new CCounter(0, 1, 500, OpenTaiko.Timer); + + // this.actChipFireD.Start( Eレーン.HH ); // #31554 2013.6.12 yyagi + // 初チップヒット時のもたつき回避。最初にactChipFireD.Start()するときにJITが掛かって? + // ものすごく待たされる(2回目以降と比べると2,3桁tick違う)。そこで最初の画面フェードインの間に + // 一発Start()を掛けてJITの結果を生成させておく。 + + base.ePhaseID = CStage.EPhase.Common_FADEIN; + + this.actFI.tフェードイン開始(); + + // TJAPlayer3.Sound管理.tDisableUpdateBufferAutomatically(); + base.IsFirstDraw = false; + } + #endregion + if (((OpenTaiko.ConfigIni.nRisky != 0 && this.actGauge.IsFailed(EInstrumentPad.Taiko)) + || this.actGame.st叩ききりまショー.ct残り時間.IsEnded + || (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Tower && CFloorManagement.CurrentNumberOfLives <= 0)) + && (base.ePhaseID == CStage.EPhase.Common_NORMAL)) { + this.actStageFailed.Start(); + this.actEnd.Start(); + OpenTaiko.DTX.t全チップの再生停止(); + base.ePhaseID = CStage.EPhase.Game_STAGE_FAILED; + } + + bool BGA_Hidden = OpenTaiko.ConfigIni.bEnableAVI && OpenTaiko.DTX.listVD.Count > 0 && ShowVideo; + + // (????) + if (!String.IsNullOrEmpty(OpenTaiko.DTX.strBGIMAGE_PATH) || (OpenTaiko.DTX.listVD.Count == 0) || !ShowVideo || !OpenTaiko.ConfigIni.bEnableAVI) //背景動画があったら背景画像を描画しない。 + { + this.t進行描画_背景(); + } + + if (OpenTaiko.ConfigIni.bEnableAVI && OpenTaiko.DTX.listVD.Count > 0 && ShowVideo && !OpenTaiko.ConfigIni.bTokkunMode) { + this.t進行描画_AVI(); + } else if (OpenTaiko.ConfigIni.bEnableBGA) { + if (OpenTaiko.ConfigIni.bTokkunMode) actTokkun.On進行描画_背景(); + else actBackground.Draw(); + } + + if (!BGA_Hidden && !OpenTaiko.ConfigIni.bTokkunMode) { + actRollChara.Draw(); + } + + if (!BGA_Hidden && !bDoublePlay && OpenTaiko.ConfigIni.ShowDancer && !OpenTaiko.ConfigIni.bTokkunMode) { + actDancer.Draw(); + } + + if (!BGA_Hidden && !bDoublePlay && OpenTaiko.ConfigIni.ShowFooter && !OpenTaiko.ConfigIni.bTokkunMode) + this.actFooter.Draw(); + + //this.t進行描画_グラフ(); // #24074 2011.01.23 add ikanick + + + //this.t進行描画_DANGER(); + //this.t進行描画_判定ライン(); + + if (OpenTaiko.ConfigIni.ShowChara && OpenTaiko.ConfigIni.nPlayerCount <= 2) { + this.actChara.Draw(); + } + + if (!BGA_Hidden && OpenTaiko.ConfigIni.ShowMob && !OpenTaiko.ConfigIni.bTokkunMode) + this.actMob.Draw(); + + if (OpenTaiko.ConfigIni.eGameMode != EGame.Off) + this.actGame.Draw(); + + this.t進行描画_譜面スクロール速度(); + this.t進行描画_チップアニメ(); + + this.actLaneTaiko.Draw(); + + if (OpenTaiko.ConfigIni.ShowRunner && !OpenTaiko.ConfigIni.bAIBattleMode && OpenTaiko.ConfigIni.nPlayerCount <= 2) + this.actRunner.Draw(); + + //this.t進行描画_レーン(); + //this.t進行描画_レーンフラッシュD(); + + if ((OpenTaiko.ConfigIni.eClipDispType == EClipDispType.WindowOnly || OpenTaiko.ConfigIni.eClipDispType == EClipDispType.Both) && OpenTaiko.ConfigIni.nPlayerCount == 1) + this.actAVI.t窓表示(); + + if (!OpenTaiko.ConfigIni.bNoInfo && !OpenTaiko.ConfigIni.bTokkunMode) + this.t進行描画_ゲージ(); + + this.actLaneTaiko.ゴーゴー炎(); + + // bIsFinishedPlaying was dependent on 2P in this case + + this.actDan.Draw(); for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { - if (this.soundRed[i] != null) - this.soundRed[i].tDispose(); - if (this.soundBlue[i] != null) - this.soundBlue[i].tDispose(); - if (this.soundAdlib[i] != null) - this.soundAdlib[i].tDispose(); - if (this.soundClap[i] != null) - this.soundClap[i].tDispose(); + // bIsFinishedPlaying = this.t進行描画_チップ(E楽器パート.DRUMS, i); + bool btmp = this.t進行描画_チップ(EInstrumentPad.Drums, i); + if (btmp == true) + ifp[i] = true; + +#if DEBUG + if (OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.D0)) { + ifp[i] = true; + } +#endif + + this.t進行描画_チップ_連打(EInstrumentPad.Drums, i); } - base.DeActivate(); + this.actMtaiko.Draw(); - LoudnessMetadataScanner.StartBackgroundScanning(); - } - public override void CreateManagedResource() { - base.CreateManagedResource(); - } - public override void ReleaseManagedResource() { - base.ReleaseManagedResource(); - } - public override int Draw() { - base.sw.Start(); - if (!base.IsDeActivated) { - bool bIsFinishedPlaying = false; - bool bIsFinishedEndAnime = false; - bool bIsFinishedFadeout = false; - #region [ 初めての進行描画 ] - if (base.IsFirstDraw) { - SoundManager.PlayTimer.Reset(); - OpenTaiko.Timer.Reset(); - this.ctチップ模様アニメ.Drums = new CCounter(0, 1, 500, OpenTaiko.Timer); - this.ctチップ模様アニメ.Guitar = new CCounter(0, 0x17, 20, OpenTaiko.Timer); - this.ctチップ模様アニメ.Bass = new CCounter(0, 0x17, 20, OpenTaiko.Timer); - this.ctチップ模様アニメ.Taiko = new CCounter(0, 1, 500, OpenTaiko.Timer); - - // this.actChipFireD.Start( Eレーン.HH ); // #31554 2013.6.12 yyagi - // 初チップヒット時のもたつき回避。最初にactChipFireD.Start()するときにJITが掛かって? - // ものすごく待たされる(2回目以降と比べると2,3桁tick違う)。そこで最初の画面フェードインの間に - // 一発Start()を掛けてJITの結果を生成させておく。 - - base.ePhaseID = CStage.EPhase.Common_FADEIN; + if (OpenTaiko.ConfigIni.bAIBattleMode) { + this.actAIBattle.Draw(); + } - this.actFI.tフェードイン開始(); - - // TJAPlayer3.Sound管理.tDisableUpdateBufferAutomatically(); - base.IsFirstDraw = false; - } - #endregion - if (((OpenTaiko.ConfigIni.nRisky != 0 && this.actGauge.IsFailed(EInstrumentPad.Taiko)) - || this.actGame.st叩ききりまショー.ct残り時間.IsEnded - || (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Tower && CFloorManagement.CurrentNumberOfLives <= 0)) - && (base.ePhaseID == CStage.EPhase.Common_NORMAL)) { - this.actStageFailed.Start(); - this.actEnd.Start(); - OpenTaiko.DTX.t全チップの再生停止(); - base.ePhaseID = CStage.EPhase.Game_STAGE_FAILED; - } + this.GoGoSplash.Draw(); + this.t進行描画_リアルタイム判定数表示(); + if (OpenTaiko.ConfigIni.bTokkunMode) + this.actTokkun.On進行描画_小節_速度(); - bool BGA_Hidden = OpenTaiko.ConfigIni.bEnableAVI && OpenTaiko.DTX.listVD.Count > 0 && ShowVideo; - - // (????) - if (!String.IsNullOrEmpty(OpenTaiko.DTX.strBGIMAGE_PATH) || (OpenTaiko.DTX.listVD.Count == 0) || !ShowVideo || !OpenTaiko.ConfigIni.bEnableAVI) //背景動画があったら背景画像を描画しない。 - { - this.t進行描画_背景(); - } + if (!OpenTaiko.ConfigIni.bNoInfo) + this.t進行描画_コンボ(); + if (!OpenTaiko.ConfigIni.bNoInfo && !OpenTaiko.ConfigIni.bTokkunMode) + this.t進行描画_スコア(); - if (OpenTaiko.ConfigIni.bEnableAVI && OpenTaiko.DTX.listVD.Count > 0 && ShowVideo && !OpenTaiko.ConfigIni.bTokkunMode) { - this.t進行描画_AVI(); - } else if (OpenTaiko.ConfigIni.bEnableBGA) { - if (OpenTaiko.ConfigIni.bTokkunMode) actTokkun.On進行描画_背景(); - else actBackground.Draw(); - } + if (OpenTaiko.ConfigIni.ShowChara && OpenTaiko.ConfigIni.nPlayerCount > 2) { + this.actChara.Draw(); + } - if (!BGA_Hidden && !OpenTaiko.ConfigIni.bTokkunMode) { - actRollChara.Draw(); - } + this.Rainbow.Draw(); + this.FireWorks.Draw(); + this.actChipEffects.Draw(); + this.FlyingNotes.Draw(); + this.t進行描画_チップファイアD(); - if (!BGA_Hidden && !bDoublePlay && OpenTaiko.ConfigIni.ShowDancer && !OpenTaiko.ConfigIni.bTokkunMode) { - actDancer.Draw(); - } + if (!OpenTaiko.ConfigIni.bNoInfo) + this.t進行描画_パネル文字列(); - if (!BGA_Hidden && !bDoublePlay && OpenTaiko.ConfigIni.ShowFooter && !OpenTaiko.ConfigIni.bTokkunMode) - this.actFooter.Draw(); - - //this.t進行描画_グラフ(); // #24074 2011.01.23 add ikanick - - - //this.t進行描画_DANGER(); - //this.t進行描画_判定ライン(); - - if (OpenTaiko.ConfigIni.ShowChara && OpenTaiko.ConfigIni.nPlayerCount <= 2) { - this.actChara.Draw(); - } + this.actComboBalloon.Draw(); - if (!BGA_Hidden && OpenTaiko.ConfigIni.ShowMob && !OpenTaiko.ConfigIni.bTokkunMode) - this.actMob.Draw(); - - if (OpenTaiko.ConfigIni.eGameMode != EGame.Off) - this.actGame.Draw(); - - this.t進行描画_譜面スクロール速度(); - this.t進行描画_チップアニメ(); - - this.actLaneTaiko.Draw(); - - if (OpenTaiko.ConfigIni.ShowRunner && !OpenTaiko.ConfigIni.bAIBattleMode && OpenTaiko.ConfigIni.nPlayerCount <= 2) - this.actRunner.Draw(); - - //this.t進行描画_レーン(); - //this.t進行描画_レーンフラッシュD(); - - if ((OpenTaiko.ConfigIni.eClipDispType == EClipDispType.WindowOnly || OpenTaiko.ConfigIni.eClipDispType == EClipDispType.Both) && OpenTaiko.ConfigIni.nPlayerCount == 1) - this.actAVI.t窓表示(); - - if (!OpenTaiko.ConfigIni.bNoInfo && !OpenTaiko.ConfigIni.bTokkunMode) - this.t進行描画_ゲージ(); - - this.actLaneTaiko.ゴーゴー炎(); - - // bIsFinishedPlaying was dependent on 2P in this case - - this.actDan.Draw(); - - for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { - // bIsFinishedPlaying = this.t進行描画_チップ(E楽器パート.DRUMS, i); - bool btmp = this.t進行描画_チップ(EInstrumentPad.Drums, i); - if (btmp == true) - ifp[i] = true; - -#if DEBUG - if (OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.D0)) { - ifp[i] = true; - } -#endif - - this.t進行描画_チップ_連打(EInstrumentPad.Drums, i); - } - - this.actMtaiko.Draw(); - - if (OpenTaiko.ConfigIni.bAIBattleMode) { - this.actAIBattle.Draw(); - } - - this.GoGoSplash.Draw(); - this.t進行描画_リアルタイム判定数表示(); - if (OpenTaiko.ConfigIni.bTokkunMode) - this.actTokkun.On進行描画_小節_速度(); - - if (!OpenTaiko.ConfigIni.bNoInfo) - this.t進行描画_コンボ(); - if (!OpenTaiko.ConfigIni.bNoInfo && !OpenTaiko.ConfigIni.bTokkunMode) - this.t進行描画_スコア(); - - if (OpenTaiko.ConfigIni.ShowChara && OpenTaiko.ConfigIni.nPlayerCount > 2) { - this.actChara.Draw(); - } - - this.Rainbow.Draw(); - this.FireWorks.Draw(); - this.actChipEffects.Draw(); - this.FlyingNotes.Draw(); - this.t進行描画_チップファイアD(); - - if (!OpenTaiko.ConfigIni.bNoInfo) - this.t進行描画_パネル文字列(); - - this.actComboBalloon.Draw(); - - for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { - this.actRoll.On進行描画(this.n現在の連打数[i], i); - } + for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { + this.actRoll.On進行描画(this.n現在の連打数[i], i); + } - if (!OpenTaiko.ConfigIni.bNoInfo) - this.t進行描画_判定文字列1_通常位置指定の場合(); + if (!OpenTaiko.ConfigIni.bNoInfo) + this.t進行描画_判定文字列1_通常位置指定の場合(); - this.t進行描画_演奏情報(); + this.t進行描画_演奏情報(); - if (OpenTaiko.DTX.listLyric2.Count > ShownLyric2 && OpenTaiko.DTX.listLyric2[ShownLyric2].Time < (long)(SoundManager.PlayTimer.NowTime * OpenTaiko.ConfigIni.SongPlaybackSpeed)) { - this.actPanel.t歌詞テクスチャを生成する(OpenTaiko.DTX.listLyric2[ShownLyric2++].TextTex); - } + if (OpenTaiko.DTX.listLyric2.Count > ShownLyric2 && OpenTaiko.DTX.listLyric2[ShownLyric2].Time < (long)(SoundManager.PlayTimer.NowTime * OpenTaiko.ConfigIni.SongPlaybackSpeed)) { + this.actPanel.t歌詞テクスチャを生成する(OpenTaiko.DTX.listLyric2[ShownLyric2++].TextTex); + } - this.actPanel.t歌詞テクスチャを描画する(); + this.actPanel.t歌詞テクスチャを描画する(); - actChara.OnDraw_Balloon(); - - // Floor voice - if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Tower) - this.actComboVoice.tPlayFloorSound(); + actChara.OnDraw_Balloon(); - this.t全体制御メソッド(); - - //this.actEnd.On進行描画(); - this.t進行描画_STAGEFAILED(); + // Floor voice + if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Tower) + this.actComboVoice.tPlayFloorSound(); - this.ScoreRank.Draw(); + this.t全体制御メソッド(); + //this.actEnd.On進行描画(); + this.t進行描画_STAGEFAILED(); + + this.ScoreRank.Draw(); + + if (OpenTaiko.ConfigIni.bTokkunMode) { + actTokkun.Draw(); + } + + + bIsFinishedEndAnime = this.actEnd.Draw() == 1 ? true : false; + bIsFinishedFadeout = this.t進行描画_フェードイン_アウト(); + + bIsFinishedPlaying = true; + for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { + if (!ifp[i]) bIsFinishedPlaying = false; + } + + this.actPauseMenu.t進行描画(); + + //演奏終了→演出表示→フェードアウト + if (bIsFinishedPlaying && base.ePhaseID == CStage.EPhase.Common_NORMAL) { if (OpenTaiko.ConfigIni.bTokkunMode) { - actTokkun.Draw(); - } + bIsFinishedPlaying = false; + OpenTaiko.Skin.sound特訓停止音.tPlay(); + actTokkun.tPausePlay(); + actTokkun.tMatchWithTheChartDisplayPosition(true); + } else { + for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { + base.ePhaseID = CStage.EPhase.Game_EndStage; - bIsFinishedEndAnime = this.actEnd.Draw() == 1 ? true : false; - bIsFinishedFadeout = this.t進行描画_フェードイン_アウト(); + this.actEnd.Start(); - bIsFinishedPlaying = true; - for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { - if (!ifp[i]) bIsFinishedPlaying = false; - } + int Character = this.actChara.iCurrentCharacter[i]; - this.actPauseMenu.t進行描画(); - - //演奏終了→演出表示→フェードアウト - if (bIsFinishedPlaying && base.ePhaseID == CStage.EPhase.Common_NORMAL) { - if (OpenTaiko.ConfigIni.bTokkunMode) { - bIsFinishedPlaying = false; - OpenTaiko.Skin.sound特訓停止音.tPlay(); - actTokkun.tPausePlay(); - - actTokkun.tMatchWithTheChartDisplayPosition(true); - } else { - for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { - base.ePhaseID = CStage.EPhase.Game_EndStage; - - this.actEnd.Start(); - - int Character = this.actChara.iCurrentCharacter[i]; - - if (HGaugeMethods.UNSAFE_IsRainbow(i)) { - if (OpenTaiko.Skin.Characters_10Combo_Maxed_Ptn[Character] != 0) { - if (HGaugeMethods.UNSAFE_IsRainbow(i)) { - double dbUnit = (((60.0 / (OpenTaiko.stage演奏ドラム画面.actPlayInfo.dbBPM[i])))); - this.actChara.ChangeAnime(i, CActImplCharacter.Anime.Combo10_Max, true); - } - } - } else if (HGaugeMethods.UNSAFE_FastNormaCheck(i)) { - if (OpenTaiko.Skin.Characters_Become_Cleared_Ptn[Character] != 0) { - this.actChara.ChangeAnime(i, CActImplCharacter.Anime.Cleared, true); ; - } - } else { - if (OpenTaiko.Skin.Characters_ClearOut_Ptn[Character] != 0) { - this.actChara.ChangeAnime(i, CActImplCharacter.Anime.ClearOut, true); + if (HGaugeMethods.UNSAFE_IsRainbow(i)) { + if (OpenTaiko.Skin.Characters_10Combo_Maxed_Ptn[Character] != 0) { + if (HGaugeMethods.UNSAFE_IsRainbow(i)) { + double dbUnit = (((60.0 / (OpenTaiko.stage演奏ドラム画面.actPlayInfo.dbBPM[i])))); + this.actChara.ChangeAnime(i, CActImplCharacter.Anime.Combo10_Max, true); } } + } else if (HGaugeMethods.UNSAFE_FastNormaCheck(i)) { + if (OpenTaiko.Skin.Characters_Become_Cleared_Ptn[Character] != 0) { + this.actChara.ChangeAnime(i, CActImplCharacter.Anime.Cleared, true); ; + } + } else { + if (OpenTaiko.Skin.Characters_ClearOut_Ptn[Character] != 0) { + this.actChara.ChangeAnime(i, CActImplCharacter.Anime.ClearOut, true); + } } } - } else if (bIsFinishedEndAnime && base.ePhaseID == EPhase.Game_EndStage) { - this.eフェードアウト完了時の戻り値 = EGameplayScreenReturnValue.StageCleared; - base.ePhaseID = CStage.EPhase.Game_STAGE_CLEAR_FadeOut; - this.actFOClear.tフェードアウト開始(); } - - if (bIsFinishedFadeout) { - Debug.WriteLine("Total On進行描画=" + sw.ElapsedMilliseconds + "ms"); - return (int)this.eフェードアウト完了時の戻り値; - } - - ManageMixerQueue(); - - // キー入力 - - this.tキー入力(); - - + } else if (bIsFinishedEndAnime && base.ePhaseID == EPhase.Game_EndStage) { + this.eフェードアウト完了時の戻り値 = EGameplayScreenReturnValue.StageCleared; + base.ePhaseID = CStage.EPhase.Game_STAGE_CLEAR_FadeOut; + this.actFOClear.tフェードアウト開始(); } - base.sw.Stop(); - return 0; - } - - // その他 - - #region [ private ] - //----------------- - [StructLayout(LayoutKind.Sequential)] - private struct ST文字位置 { - public char ch; - public Point pt; + + if (bIsFinishedFadeout) { + Debug.WriteLine("Total On進行描画=" + sw.ElapsedMilliseconds + "ms"); + return (int)this.eフェードアウト完了時の戻り値; + } + + ManageMixerQueue(); + + // キー入力 + + this.tキー入力(); + + } - public CActImplFireworks actChipFireD; + base.sw.Stop(); + return 0; + } - private CActImplPad actPad; - public CActImplLane actLane; - public CActImplMtaiko actMtaiko; - public CActImplLaneTaiko actLaneTaiko; - public CActImplClearAnimation actEnd; - private CAct演奏Drumsゲームモード actGame; - public CActImplTrainingMode actTokkun; - public CActImplBackground actBackground; - public GoGoSplash GoGoSplash; - public FlyingNotes FlyingNotes; - public FireWorks FireWorks; - public PuchiChara PuchiChara; - public CActImplScoreRank ScoreRank; - private bool bフィルイン中; - private readonly EPad[] eチャンネルtoパッド = new EPad[] - { - EPad.HH, EPad.SD, EPad.BD, EPad.HT, - EPad.LT, EPad.CY, EPad.FT, EPad.HHO, - EPad.RD, EPad.Unknown, EPad.Unknown, EPad.LC, - EPad.LP, EPad.LBD - }; - private int[] nチャンネルtoX座標 = new int[] { 370, 470, 582, 527, 645, 748, 694, 373, 815, 298, 419, 419 }; - private CCounter ct手つなぎ; - private CTexture txヒットバーGB; - private CTexture txレーンフレームGB; - //private CTexture tx太鼓ノーツ; - //private CTexture txHand; - //private CTexture txSenotes; - //private CTexture tx小節線; - //private CTexture tx小節線_branch; - - private CTexture tx判定数表示パネル; - private CTexture tx判定数小文字; - //private CTexture txNamePlate; //ちょっと描画順で都合が悪くなるので移動。 - //private CTexture txNamePlate2P; //ちょっと描画順で都合が悪くなるので移動。 - //private CTexture txPlayerNumber; - private CTexture txMovie; //2016.08.30 kairera0467 ウィンドウ表示 - - public float nGauge = 0.0f; - private int ShownLyric2 = 0; + // その他 - private StreamWriter stream; + #region [ private ] + //----------------- + [StructLayout(LayoutKind.Sequential)] + private struct ST文字位置 { + public char ch; + public Point pt; + } + public CActImplFireworks actChipFireD; - private int n待機中の大音符の座標; - private readonly ST文字位置[] st小文字位置; - private readonly ST文字位置[] st大文字位置; - //----------------- - - protected override ENoteJudge tチップのヒット処理(long nHitTime, CDTX.CChip pChip, bool bCorrectLane) { - ENoteJudge eJudgeResult = tチップのヒット処理(nHitTime, pChip, EInstrumentPad.Drums, bCorrectLane, 0); - // #24074 2011.01.23 add ikanick - if (pChip.nコース == this.n現在のコース[0] && NotesManager.IsMissableNote(pChip) && pChip.bShow == true && eJudgeResult != ENoteJudge.Auto) - this.actGame.t叩ききりまショー_判定から各数値を増加させる(eJudgeResult, (int)(nHitTime - pChip.n発声時刻ms)); - return eJudgeResult; + private CActImplPad actPad; + public CActImplLane actLane; + public CActImplMtaiko actMtaiko; + public CActImplLaneTaiko actLaneTaiko; + public CActImplClearAnimation actEnd; + private CAct演奏Drumsゲームモード actGame; + public CActImplTrainingMode actTokkun; + public CActImplBackground actBackground; + public GoGoSplash GoGoSplash; + public FlyingNotes FlyingNotes; + public FireWorks FireWorks; + public PuchiChara PuchiChara; + public CActImplScoreRank ScoreRank; + private bool bフィルイン中; + private readonly EPad[] eチャンネルtoパッド = new EPad[] + { + EPad.HH, EPad.SD, EPad.BD, EPad.HT, + EPad.LT, EPad.CY, EPad.FT, EPad.HHO, + EPad.RD, EPad.Unknown, EPad.Unknown, EPad.LC, + EPad.LP, EPad.LBD + }; + private int[] nチャンネルtoX座標 = new int[] { 370, 470, 582, 527, 645, 748, 694, 373, 815, 298, 419, 419 }; + private CCounter ct手つなぎ; + private CTexture txヒットバーGB; + private CTexture txレーンフレームGB; + //private CTexture tx太鼓ノーツ; + //private CTexture txHand; + //private CTexture txSenotes; + //private CTexture tx小節線; + //private CTexture tx小節線_branch; + + private CTexture tx判定数表示パネル; + private CTexture tx判定数小文字; + //private CTexture txNamePlate; //ちょっと描画順で都合が悪くなるので移動。 + //private CTexture txNamePlate2P; //ちょっと描画順で都合が悪くなるので移動。 + //private CTexture txPlayerNumber; + private CTexture txMovie; //2016.08.30 kairera0467 ウィンドウ表示 + + public float nGauge = 0.0f; + private int ShownLyric2 = 0; + + private StreamWriter stream; + + private int n待機中の大音符の座標; + private readonly ST文字位置[] st小文字位置; + private readonly ST文字位置[] st大文字位置; + //----------------- + + protected override ENoteJudge tチップのヒット処理(long nHitTime, CDTX.CChip pChip, bool bCorrectLane) { + ENoteJudge eJudgeResult = tチップのヒット処理(nHitTime, pChip, EInstrumentPad.Drums, bCorrectLane, 0); + // #24074 2011.01.23 add ikanick + if (pChip.nコース == this.n現在のコース[0] && NotesManager.IsMissableNote(pChip) && pChip.bShow == true && eJudgeResult != ENoteJudge.Auto) + this.actGame.t叩ききりまショー_判定から各数値を増加させる(eJudgeResult, (int)(nHitTime - pChip.n発声時刻ms)); + return eJudgeResult; + } + + protected override void tチップのヒット処理_BadならびにTight時のMiss(CDTX.ECourse eCourse, EInstrumentPad part) { + this.tチップのヒット処理_BadならびにTight時のMiss(eCourse, part, 0, EInstrumentPad.Drums); + } + protected override void tチップのヒット処理_BadならびにTight時のMiss(CDTX.ECourse eCourse, EInstrumentPad part, int nLane) { + this.tチップのヒット処理_BadならびにTight時のMiss(eCourse, part, nLane, EInstrumentPad.Drums); + } + + private int ChannelNumToFlyNoteNum(CDTX.CChip pChip, int nPlayer, bool b両手入力 = false, int nInput = 0) { + var _gt = OpenTaiko.ConfigIni.nGameType[OpenTaiko.GetActualPlayer(nPlayer)]; + + int nFly = 0; + switch (pChip.nチャンネル番号) { + case 0x11: + nFly = 1; + break; + case 0x12: + nFly = 2; + break; + case 0x13: + case 0x1A: + nFly = b両手入力 ? 3 : 1; + break; + case 0x14: + case 0x1B: + nFly = (b両手入力 || _gt == EGameType.Konga) ? 4 : 2; + break; + case 0x1F: + nFly = nInput == 0 ? 1 : 2; + break; + case 0x101: + nFly = 5; + break; + default: + nFly = 1; + break; + } + return nFly; + } + + private bool tドラムヒット処理(long nHitTime, EPad type, CDTX.CChip pChip, bool b両手入力, int nPlayer) { + int nInput = 0; + + switch (type) { + case EPad.LRed: + case EPad.RRed: + case EPad.LRed2P: + case EPad.RRed2P: + case EPad.LRed3P: + case EPad.RRed3P: + case EPad.LRed4P: + case EPad.RRed4P: + case EPad.LRed5P: + case EPad.RRed5P: + nInput = 0; + if (b両手入力) + nInput = 2; + break; + case EPad.LBlue: + case EPad.RBlue: + case EPad.LBlue2P: + case EPad.RBlue2P: + case EPad.LBlue3P: + case EPad.RBlue3P: + case EPad.LBlue4P: + case EPad.RBlue4P: + case EPad.LBlue5P: + case EPad.RBlue5P: + nInput = 1; + if (b両手入力) + nInput = 3; + break; + case EPad.Clap: + case EPad.Clap2P: + case EPad.Clap3P: + case EPad.Clap4P: + case EPad.Clap5P: + nInput = 4; + break; } - protected override void tチップのヒット処理_BadならびにTight時のMiss(CDTX.ECourse eCourse, EInstrumentPad part) { - this.tチップのヒット処理_BadならびにTight時のMiss(eCourse, part, 0, EInstrumentPad.Drums); - } - protected override void tチップのヒット処理_BadならびにTight時のMiss(CDTX.ECourse eCourse, EInstrumentPad part, int nLane) { - this.tチップのヒット処理_BadならびにTight時のMiss(eCourse, part, nLane, EInstrumentPad.Drums); + + if (pChip == null) { + return false; } - private int ChannelNumToFlyNoteNum(CDTX.CChip pChip, int nPlayer, bool b両手入力 = false, int nInput = 0) { - var _gt = OpenTaiko.ConfigIni.nGameType[OpenTaiko.GetActualPlayer(nPlayer)]; - - int nFly = 0; - switch (pChip.nチャンネル番号) { - case 0x11: - nFly = 1; - break; - case 0x12: - nFly = 2; - break; - case 0x13: - case 0x1A: - nFly = b両手入力 ? 3 : 1; - break; - case 0x14: - case 0x1B: - nFly = (b両手入力 || _gt == EGameType.Konga) ? 4 : 2; - break; - case 0x1F: - nFly = nInput == 0 ? 1 : 2; - break; - case 0x101: - nFly = 5; - break; - default: - nFly = 1; - break; - } - return nFly; - } - - private bool tドラムヒット処理(long nHitTime, EPad type, CDTX.CChip pChip, bool b両手入力, int nPlayer) { - int nInput = 0; - - switch (type) { - case EPad.LRed: - case EPad.RRed: - case EPad.LRed2P: - case EPad.RRed2P: - case EPad.LRed3P: - case EPad.RRed3P: - case EPad.LRed4P: - case EPad.RRed4P: - case EPad.LRed5P: - case EPad.RRed5P: - nInput = 0; - if (b両手入力) - nInput = 2; - break; - case EPad.LBlue: - case EPad.RBlue: - case EPad.LBlue2P: - case EPad.RBlue2P: - case EPad.LBlue3P: - case EPad.RBlue3P: - case EPad.LBlue4P: - case EPad.RBlue4P: - case EPad.LBlue5P: - case EPad.RBlue5P: - nInput = 1; - if (b両手入力) - nInput = 3; - break; - case EPad.Clap: - case EPad.Clap2P: - case EPad.Clap3P: - case EPad.Clap4P: - case EPad.Clap5P: - nInput = 4; - break; - } - - - if (pChip == null) { - return false; - } - - if (NotesManager.IsGenericRoll(pChip) && !NotesManager.IsRollEnd(pChip)) { - this.tチップのヒット処理(nHitTime, pChip, EInstrumentPad.Taiko, true, nInput, nPlayer); - return true; - } else if (!NotesManager.IsHittableNote(pChip)) { - return false; - } - - ENoteJudge e判定 = this.e指定時刻からChipのJUDGEを返す(nHitTime, pChip, nPlayer); - - e判定 = AlterJudgement(nPlayer, e判定, false); - - this.actGame.t叩ききりまショー_判定から各数値を増加させる(e判定, (int)(nHitTime - pChip.n発声時刻ms)); - - if (e判定 == ENoteJudge.Miss) { - return false; - } - + if (NotesManager.IsGenericRoll(pChip) && !NotesManager.IsRollEnd(pChip)) { this.tチップのヒット処理(nHitTime, pChip, EInstrumentPad.Taiko, true, nInput, nPlayer); - - if ((e判定 != ENoteJudge.Poor) && (e判定 != ENoteJudge.Miss)) { - OpenTaiko.stage演奏ドラム画面.actLaneTaiko.Start(pChip.nチャンネル番号, e判定, b両手入力, nPlayer); - - int nFly = ChannelNumToFlyNoteNum(pChip, nPlayer, b両手入力, nInput); - - this.actTaikoLaneFlash.PlayerLane[nPlayer].Start(PlayerLane.FlashType.Hit); - this.FlyingNotes.Start(nFly, nPlayer); - } - return true; + } else if (!NotesManager.IsHittableNote(pChip)) { + return false; } - protected override void ドラムスクロール速度アップ() { - OpenTaiko.ConfigIni.nScrollSpeed[OpenTaiko.SaveFile] = Math.Min(OpenTaiko.ConfigIni.nScrollSpeed[OpenTaiko.SaveFile] + 1, 1999); - } - protected override void ドラムスクロール速度ダウン() { - OpenTaiko.ConfigIni.nScrollSpeed[OpenTaiko.SaveFile] = Math.Max(OpenTaiko.ConfigIni.nScrollSpeed[OpenTaiko.SaveFile] - 1, 0); + ENoteJudge e判定 = this.e指定時刻からChipのJUDGEを返す(nHitTime, pChip, nPlayer); + + e判定 = AlterJudgement(nPlayer, e判定, false); + + this.actGame.t叩ききりまショー_判定から各数値を増加させる(e判定, (int)(nHitTime - pChip.n発声時刻ms)); + + if (e判定 == ENoteJudge.Miss) { + return false; } + this.tチップのヒット処理(nHitTime, pChip, EInstrumentPad.Taiko, true, nInput, nPlayer); - protected override void t進行描画_AVI() { - base.t進行描画_AVI(0, 0); + if ((e判定 != ENoteJudge.Poor) && (e判定 != ENoteJudge.Miss)) { + OpenTaiko.stage演奏ドラム画面.actLaneTaiko.Start(pChip.nチャンネル番号, e判定, b両手入力, nPlayer); + + int nFly = ChannelNumToFlyNoteNum(pChip, nPlayer, b両手入力, nInput); + + this.actTaikoLaneFlash.PlayerLane[nPlayer].Start(PlayerLane.FlashType.Hit); + this.FlyingNotes.Start(nFly, nPlayer); } - private void t進行描画_チップファイアD() { - this.actChipFireD.Draw(); + return true; + } + + protected override void ドラムスクロール速度アップ() { + OpenTaiko.ConfigIni.nScrollSpeed[OpenTaiko.SaveFile] = Math.Min(OpenTaiko.ConfigIni.nScrollSpeed[OpenTaiko.SaveFile] + 1, 1999); + } + protected override void ドラムスクロール速度ダウン() { + OpenTaiko.ConfigIni.nScrollSpeed[OpenTaiko.SaveFile] = Math.Max(OpenTaiko.ConfigIni.nScrollSpeed[OpenTaiko.SaveFile] - 1, 0); + } + + + protected override void t進行描画_AVI() { + base.t進行描画_AVI(0, 0); + } + + private void t進行描画_チップファイアD() { + this.actChipFireD.Draw(); + } + + protected override void t進行描画_パネル文字列() { + base.t進行描画_パネル文字列(336, 427); + } + + protected override void t進行描画_演奏情報() { + base.t進行描画_演奏情報(1000, 257); + } + + protected override void t紙吹雪_開始() { + //if( this.actCombo.n現在のコンボ数.Drums % 10 == 0 && this.actCombo.n現在のコンボ数.Drums > 0 ) + { + //this.actChipFireD.Start紙吹雪(); } + } - protected override void t進行描画_パネル文字列() { - base.t進行描画_パネル文字列(336, 427); - } + protected override void t入力処理_ドラム() { + // Input adjust deprecated + var nInputAdjustTimeMs = 0; // TJAPlayer3.ConfigIni.nInputAdjustTimeMs; - protected override void t進行描画_演奏情報() { - base.t進行描画_演奏情報(1000, 257); - } + for (int nPad = 0; nPad < (int)EPad.Max; nPad++) // #27029 2012.1.4 from: <10 to <=10; Eパッドの要素が1つ(HP)増えたため。 + // 2012.1.5 yyagi: (int)Eパッド.MAX に変更。Eパッドの要素数への依存を無くすため。 + { + List listInputEvent = OpenTaiko.Pad.GetEvents(EInstrumentPad.Drums, (EPad)nPad); - protected override void t紙吹雪_開始() { - //if( this.actCombo.n現在のコンボ数.Drums % 10 == 0 && this.actCombo.n現在のコンボ数.Drums > 0 ) - { - //this.actChipFireD.Start紙吹雪(); - } - } + if ((listInputEvent == null) || (listInputEvent.Count == 0)) + continue; - protected override void t入力処理_ドラム() { - // Input adjust deprecated - var nInputAdjustTimeMs = 0; // TJAPlayer3.ConfigIni.nInputAdjustTimeMs; - - for (int nPad = 0; nPad < (int)EPad.Max; nPad++) // #27029 2012.1.4 from: <10 to <=10; Eパッドの要素が1つ(HP)増えたため。 - // 2012.1.5 yyagi: (int)Eパッド.MAX に変更。Eパッドの要素数への依存を無くすため。 - { - List listInputEvent = OpenTaiko.Pad.GetEvents(EInstrumentPad.Drums, (EPad)nPad); + this.t入力メソッド記憶(EInstrumentPad.Drums); - if ((listInputEvent == null) || (listInputEvent.Count == 0)) + foreach (STInputEvent inputEvent in listInputEvent) { + if (!inputEvent.Pressed) continue; - this.t入力メソッド記憶(EInstrumentPad.Drums); + long nTime = (long)(((SoundManager.PlayTimer.NowTimeMs + nInputAdjustTimeMs) * OpenTaiko.ConfigIni.SongPlaybackSpeed)); + //int nPad09 = ( nPad == (int) Eパッド.HP ) ? (int) Eパッド.BD : nPad; // #27029 2012.1.5 yyagi - foreach (STInputEvent inputEvent in listInputEvent) { - if (!inputEvent.Pressed) - continue; + bool bHitted = false; - long nTime = (long)(((SoundManager.PlayTimer.NowTimeMs + nInputAdjustTimeMs) * OpenTaiko.ConfigIni.SongPlaybackSpeed)); - //int nPad09 = ( nPad == (int) Eパッド.HP ) ? (int) Eパッド.BD : nPad; // #27029 2012.1.5 yyagi - - bool bHitted = false; + int nLane = 0; + int nHand = 0; + int nChannel = 0; - int nLane = 0; - int nHand = 0; - int nChannel = 0; - - //連打チップを検索してから通常音符検索 - //連打チップの検索は、 - //一番近くの連打音符を探す→時刻チェック - //発声 < 現在時刻 && 終わり > 現在時刻 - - //2015.03.19 kairera0467 Chipを1つにまとめて1つのレーン扱いにする。 - - bool isPad1P = (nPad >= 12 && nPad <= 15) || nPad == 32; - bool isPad2P = (nPad >= 16 && nPad <= 19) || nPad == 33; - bool isPad3P = (nPad >= 20 && nPad <= 23) || nPad == 34; - bool isPad4P = (nPad >= 24 && nPad <= 27) || nPad == 35; - bool isPad5P = (nPad >= 28 && nPad <= 31) || nPad == 36; + //連打チップを検索してから通常音符検索 + //連打チップの検索は、 + //一番近くの連打音符を探す→時刻チェック + //発声 < 現在時刻 && 終わり > 現在時刻 - int nUsePlayer = 0; - if (isPad1P) { - nUsePlayer = 0; - } else if (isPad2P) { - nUsePlayer = 1; - if (OpenTaiko.ConfigIni.nPlayerCount < 2) //プレイ人数が2人以上でなければ入力をキャンセル - break; - } else if (isPad3P) { - nUsePlayer = 2; - if (OpenTaiko.ConfigIni.nPlayerCount < 3) //プレイ人数が3人以上でなければ入力をキャンセル - break; - } else if (isPad4P) { - nUsePlayer = 3; - if (OpenTaiko.ConfigIni.nPlayerCount < 4) //プレイ人数が4人以上でなければ入力をキャンセル - break; - } else if (isPad5P) { - nUsePlayer = 4; - if (OpenTaiko.ConfigIni.nPlayerCount < 5) //プレイ人数が5人以上でなければ入力をキャンセル - break; - } + //2015.03.19 kairera0467 Chipを1つにまとめて1つのレーン扱いにする。 - if (OpenTaiko.stage演奏ドラム画面.isDeniedPlaying[nUsePlayer]) break; + bool isPad1P = (nPad >= 12 && nPad <= 15) || nPad == 32; + bool isPad2P = (nPad >= 16 && nPad <= 19) || nPad == 33; + bool isPad3P = (nPad >= 20 && nPad <= 23) || nPad == 34; + bool isPad4P = (nPad >= 24 && nPad <= 27) || nPad == 35; + bool isPad5P = (nPad >= 28 && nPad <= 31) || nPad == 36; - if (!OpenTaiko.ConfigIni.bTokkunMode && OpenTaiko.ConfigIni.bAutoPlay[0] && isPad1P)//2020.05.18 Mr-Ojii オート時の入力キャンセル + int nUsePlayer = 0; + if (isPad1P) { + nUsePlayer = 0; + } else if (isPad2P) { + nUsePlayer = 1; + if (OpenTaiko.ConfigIni.nPlayerCount < 2) //プレイ人数が2人以上でなければ入力をキャンセル break; - else if ((OpenTaiko.ConfigIni.bAutoPlay[1] || OpenTaiko.ConfigIni.bAIBattleMode) && isPad2P) + } else if (isPad3P) { + nUsePlayer = 2; + if (OpenTaiko.ConfigIni.nPlayerCount < 3) //プレイ人数が3人以上でなければ入力をキャンセル break; - else if (OpenTaiko.ConfigIni.bAutoPlay[2] && isPad3P) + } else if (isPad4P) { + nUsePlayer = 3; + if (OpenTaiko.ConfigIni.nPlayerCount < 4) //プレイ人数が4人以上でなければ入力をキャンセル break; - else if (OpenTaiko.ConfigIni.bAutoPlay[3] && isPad4P) + } else if (isPad5P) { + nUsePlayer = 4; + if (OpenTaiko.ConfigIni.nPlayerCount < 5) //プレイ人数が5人以上でなければ入力をキャンセル break; - else if (OpenTaiko.ConfigIni.bAutoPlay[4] && isPad5P) - break; - //var padTo = nUsePlayer == 0 ? nPad - 12 : nPad - 12 - 4; - var padTo = nPad - 12; - padTo -= 4 * nUsePlayer; + } - var isDon = padTo < 2 ? true : false; + if (OpenTaiko.stage演奏ドラム画面.isDeniedPlaying[nUsePlayer]) break; - CDTX.CChip chipNoHit = r指定時刻に一番近い未ヒットChipを過去方向優先で検索する(nTime, nUsePlayer); - ENoteJudge e判定 = (chipNoHit != null) ? this.e指定時刻からChipのJUDGEを返す(nTime, chipNoHit, nUsePlayer) : ENoteJudge.Miss; + if (!OpenTaiko.ConfigIni.bTokkunMode && OpenTaiko.ConfigIni.bAutoPlay[0] && isPad1P)//2020.05.18 Mr-Ojii オート時の入力キャンセル + break; + else if ((OpenTaiko.ConfigIni.bAutoPlay[1] || OpenTaiko.ConfigIni.bAIBattleMode) && isPad2P) + break; + else if (OpenTaiko.ConfigIni.bAutoPlay[2] && isPad3P) + break; + else if (OpenTaiko.ConfigIni.bAutoPlay[3] && isPad4P) + break; + else if (OpenTaiko.ConfigIni.bAutoPlay[4] && isPad5P) + break; + //var padTo = nUsePlayer == 0 ? nPad - 12 : nPad - 12 - 4; + var padTo = nPad - 12; + padTo -= 4 * nUsePlayer; - e判定 = AlterJudgement(nUsePlayer, e判定, false); - - #region [ADLIB] - - bool b太鼓音再生フラグ = true; - if (chipNoHit != null) { - if (NotesManager.IsADLIB(chipNoHit) && (e判定 == ENoteJudge.Perfect || e判定 == ENoteJudge.Good)) - b太鼓音再生フラグ = false; - if (NotesManager.IsADLIB(chipNoHit) && (e判定 != ENoteJudge.Miss && e判定 != ENoteJudge.Poor)) - this.soundAdlib[chipNoHit.nPlayerSide]?.PlayStart(); - } - - #endregion - - #region [Visual effects] - - switch (nPad) { - case 12: - nLane = 0; - nHand = 0; - nChannel = 0x11; - if (b太鼓音再生フラグ) { - this.soundRed[0]?.PlayStart(); - } - break; - case 13: - nLane = 0; - nHand = 1; - nChannel = 0x11; - if (b太鼓音再生フラグ) { - this.soundRed[0]?.PlayStart(); - } - break; - case 14: - nLane = 1; - nHand = 0; - nChannel = 0x12; - if (b太鼓音再生フラグ) - this.soundBlue[0]?.PlayStart(); - break; - case 15: - nLane = 1; - nHand = 1; - nChannel = 0x12; - if (b太鼓音再生フラグ) - this.soundBlue[0]?.PlayStart(); - break; - //以下2P - case 16: - nLane = 0; - nHand = 0; - nChannel = 0x11; - if (b太鼓音再生フラグ) { - this.soundRed[1]?.PlayStart(); - } - break; - case 17: - nLane = 0; - nHand = 1; - nChannel = 0x11; - if (b太鼓音再生フラグ) { - this.soundRed[1]?.PlayStart(); - } - break; - case 18: - nLane = 1; - nHand = 0; - nChannel = 0x12; - if (b太鼓音再生フラグ) - this.soundBlue[1]?.PlayStart(); - break; - case 19: - nLane = 1; - nHand = 1; - nChannel = 0x12; - if (b太鼓音再生フラグ) - this.soundBlue[1]?.PlayStart(); - break; - //以下3P - case 20: - nLane = 0; - nHand = 0; - nChannel = 0x11; - if (b太鼓音再生フラグ) { - this.soundRed[2]?.PlayStart(); - } - break; - case 21: - nLane = 0; - nHand = 1; - nChannel = 0x11; - if (b太鼓音再生フラグ) { - this.soundRed[2]?.PlayStart(); - } - break; - case 22: - nLane = 1; - nHand = 0; - nChannel = 0x12; - if (b太鼓音再生フラグ) - this.soundBlue[2]?.PlayStart(); - break; - case 23: - nLane = 1; - nHand = 1; - nChannel = 0x12; - if (b太鼓音再生フラグ) - this.soundBlue[2]?.PlayStart(); - break; - //以下4P - case 24: - nLane = 0; - nHand = 0; - nChannel = 0x11; - if (b太鼓音再生フラグ) { - this.soundRed[3]?.PlayStart(); - } - break; - case 25: - nLane = 0; - nHand = 1; - nChannel = 0x11; - if (b太鼓音再生フラグ) { - this.soundRed[3]?.PlayStart(); - } - break; - case 26: - nLane = 1; - nHand = 0; - nChannel = 0x12; - if (b太鼓音再生フラグ) - this.soundBlue[3]?.PlayStart(); - break; - case 27: - nLane = 1; - nHand = 1; - nChannel = 0x12; - if (b太鼓音再生フラグ) - this.soundBlue[3]?.PlayStart(); - break; - //以下5P - case 28: - nLane = 0; - nHand = 0; - nChannel = 0x11; - if (b太鼓音再生フラグ) { - this.soundRed[4]?.PlayStart(); - } - break; - case 29: - nLane = 0; - nHand = 1; - nChannel = 0x11; - if (b太鼓音再生フラグ) { - this.soundRed[4]?.PlayStart(); - } - break; - case 30: - nLane = 1; - nHand = 0; - nChannel = 0x12; - if (b太鼓音再生フラグ) - this.soundBlue[4]?.PlayStart(); - break; - case 31: - nLane = 1; - nHand = 1; - nChannel = 0x12; - if (b太鼓音再生フラグ) - this.soundBlue[4]?.PlayStart(); - break; - // Clap - case (int)EPad.Clap: - if (OpenTaiko.ConfigIni.nGameType[OpenTaiko.GetActualPlayer(0)] == EGameType.Konga) { - nLane = (int)PlayerLane.FlashType.Clap; - nHand = 0; - nChannel = 0x14; - if (b太鼓音再生フラグ) { - this.soundClap[0]?.PlayStart(); - } - } else { - nLane = (int)PlayerLane.FlashType.Total; - } - break; - case (int)EPad.Clap2P: - if (OpenTaiko.ConfigIni.nGameType[OpenTaiko.GetActualPlayer(1)] == EGameType.Konga) { - nLane = (int)PlayerLane.FlashType.Clap; - nHand = 0; - nChannel = 0x14; - if (b太鼓音再生フラグ) { - this.soundClap[1]?.PlayStart(); - } - } else { - nLane = (int)PlayerLane.FlashType.Total; - } - break; - case (int)EPad.Clap3P: - if (OpenTaiko.ConfigIni.nGameType[OpenTaiko.GetActualPlayer(1)] == EGameType.Konga) { - nLane = (int)PlayerLane.FlashType.Clap; - nHand = 0; - nChannel = 0x14; - if (b太鼓音再生フラグ) { - this.soundClap[2]?.PlayStart(); - } - } else { - nLane = (int)PlayerLane.FlashType.Total; - } - break; - case (int)EPad.Clap4P: - if (OpenTaiko.ConfigIni.nGameType[OpenTaiko.GetActualPlayer(1)] == EGameType.Konga) { - nLane = (int)PlayerLane.FlashType.Clap; - nHand = 0; - nChannel = 0x14; - if (b太鼓音再生フラグ) { - this.soundClap[3]?.PlayStart(); - } - } else { - nLane = (int)PlayerLane.FlashType.Total; - } - break; - case (int)EPad.Clap5P: - if (OpenTaiko.ConfigIni.nGameType[OpenTaiko.GetActualPlayer(1)] == EGameType.Konga) { - nLane = (int)PlayerLane.FlashType.Clap; - nHand = 0; - nChannel = 0x14; - if (b太鼓音再生フラグ) { - this.soundClap[4]?.PlayStart(); - } - } else { - nLane = (int)PlayerLane.FlashType.Total; - } - break; - default: { - continue; - } - break; - } + var isDon = padTo < 2 ? true : false; - OpenTaiko.stage演奏ドラム画面.actTaikoLaneFlash.PlayerLane[nUsePlayer].Start((PlayerLane.FlashType)nLane); - OpenTaiko.stage演奏ドラム画面.actMtaiko.tMtaikoEvent(nChannel, nHand, nUsePlayer); - - #endregion - - // Chip bools - EGameType _gt = OpenTaiko.ConfigIni.nGameType[OpenTaiko.GetActualPlayer(nUsePlayer)]; - bool _isBigKaTaiko = NotesManager.IsBigKaTaiko(chipNoHit, _gt); - bool _isBigDonTaiko = NotesManager.IsBigDonTaiko(chipNoHit, _gt); - bool _isClapKonga = NotesManager.IsClapKonga(chipNoHit, _gt); - bool _isPinkKonga = NotesManager.IsSwapNote(chipNoHit, _gt); + CDTX.CChip chipNoHit = r指定時刻に一番近い未ヒットChipを過去方向優先で検索する(nTime, nUsePlayer); + ENoteJudge e判定 = (chipNoHit != null) ? this.e指定時刻からChipのJUDGEを返す(nTime, chipNoHit, nUsePlayer) : ENoteJudge.Miss; + e判定 = AlterJudgement(nUsePlayer, e判定, false); - if (this.b連打中[nUsePlayer]) { - chipNoHit = this.chip現在処理中の連打チップ[nUsePlayer]; - e判定 = ENoteJudge.Perfect; - } + #region [ADLIB] - if (chipNoHit == null) { + bool b太鼓音再生フラグ = true; + if (chipNoHit != null) { + if (NotesManager.IsADLIB(chipNoHit) && (e判定 == ENoteJudge.Perfect || e判定 == ENoteJudge.Good)) + b太鼓音再生フラグ = false; + if (NotesManager.IsADLIB(chipNoHit) && (e判定 != ENoteJudge.Miss && e判定 != ENoteJudge.Poor)) + this.soundAdlib[chipNoHit.nPlayerSide]?.PlayStart(); + } + + #endregion + + #region [Visual effects] + + switch (nPad) { + case 12: + nLane = 0; + nHand = 0; + nChannel = 0x11; + if (b太鼓音再生フラグ) { + this.soundRed[0]?.PlayStart(); + } break; - } + case 13: + nLane = 0; + nHand = 1; + nChannel = 0x11; + if (b太鼓音再生フラグ) { + this.soundRed[0]?.PlayStart(); + } + break; + case 14: + nLane = 1; + nHand = 0; + nChannel = 0x12; + if (b太鼓音再生フラグ) + this.soundBlue[0]?.PlayStart(); + break; + case 15: + nLane = 1; + nHand = 1; + nChannel = 0x12; + if (b太鼓音再生フラグ) + this.soundBlue[0]?.PlayStart(); + break; + //以下2P + case 16: + nLane = 0; + nHand = 0; + nChannel = 0x11; + if (b太鼓音再生フラグ) { + this.soundRed[1]?.PlayStart(); + } + break; + case 17: + nLane = 0; + nHand = 1; + nChannel = 0x11; + if (b太鼓音再生フラグ) { + this.soundRed[1]?.PlayStart(); + } + break; + case 18: + nLane = 1; + nHand = 0; + nChannel = 0x12; + if (b太鼓音再生フラグ) + this.soundBlue[1]?.PlayStart(); + break; + case 19: + nLane = 1; + nHand = 1; + nChannel = 0x12; + if (b太鼓音再生フラグ) + this.soundBlue[1]?.PlayStart(); + break; + //以下3P + case 20: + nLane = 0; + nHand = 0; + nChannel = 0x11; + if (b太鼓音再生フラグ) { + this.soundRed[2]?.PlayStart(); + } + break; + case 21: + nLane = 0; + nHand = 1; + nChannel = 0x11; + if (b太鼓音再生フラグ) { + this.soundRed[2]?.PlayStart(); + } + break; + case 22: + nLane = 1; + nHand = 0; + nChannel = 0x12; + if (b太鼓音再生フラグ) + this.soundBlue[2]?.PlayStart(); + break; + case 23: + nLane = 1; + nHand = 1; + nChannel = 0x12; + if (b太鼓音再生フラグ) + this.soundBlue[2]?.PlayStart(); + break; + //以下4P + case 24: + nLane = 0; + nHand = 0; + nChannel = 0x11; + if (b太鼓音再生フラグ) { + this.soundRed[3]?.PlayStart(); + } + break; + case 25: + nLane = 0; + nHand = 1; + nChannel = 0x11; + if (b太鼓音再生フラグ) { + this.soundRed[3]?.PlayStart(); + } + break; + case 26: + nLane = 1; + nHand = 0; + nChannel = 0x12; + if (b太鼓音再生フラグ) + this.soundBlue[3]?.PlayStart(); + break; + case 27: + nLane = 1; + nHand = 1; + nChannel = 0x12; + if (b太鼓音再生フラグ) + this.soundBlue[3]?.PlayStart(); + break; + //以下5P + case 28: + nLane = 0; + nHand = 0; + nChannel = 0x11; + if (b太鼓音再生フラグ) { + this.soundRed[4]?.PlayStart(); + } + break; + case 29: + nLane = 0; + nHand = 1; + nChannel = 0x11; + if (b太鼓音再生フラグ) { + this.soundRed[4]?.PlayStart(); + } + break; + case 30: + nLane = 1; + nHand = 0; + nChannel = 0x12; + if (b太鼓音再生フラグ) + this.soundBlue[4]?.PlayStart(); + break; + case 31: + nLane = 1; + nHand = 1; + nChannel = 0x12; + if (b太鼓音再生フラグ) + this.soundBlue[4]?.PlayStart(); + break; + // Clap + case (int)EPad.Clap: + if (OpenTaiko.ConfigIni.nGameType[OpenTaiko.GetActualPlayer(0)] == EGameType.Konga) { + nLane = (int)PlayerLane.FlashType.Clap; + nHand = 0; + nChannel = 0x14; + if (b太鼓音再生フラグ) { + this.soundClap[0]?.PlayStart(); + } + } else { + nLane = (int)PlayerLane.FlashType.Total; + } + break; + case (int)EPad.Clap2P: + if (OpenTaiko.ConfigIni.nGameType[OpenTaiko.GetActualPlayer(1)] == EGameType.Konga) { + nLane = (int)PlayerLane.FlashType.Clap; + nHand = 0; + nChannel = 0x14; + if (b太鼓音再生フラグ) { + this.soundClap[1]?.PlayStart(); + } + } else { + nLane = (int)PlayerLane.FlashType.Total; + } + break; + case (int)EPad.Clap3P: + if (OpenTaiko.ConfigIni.nGameType[OpenTaiko.GetActualPlayer(1)] == EGameType.Konga) { + nLane = (int)PlayerLane.FlashType.Clap; + nHand = 0; + nChannel = 0x14; + if (b太鼓音再生フラグ) { + this.soundClap[2]?.PlayStart(); + } + } else { + nLane = (int)PlayerLane.FlashType.Total; + } + break; + case (int)EPad.Clap4P: + if (OpenTaiko.ConfigIni.nGameType[OpenTaiko.GetActualPlayer(1)] == EGameType.Konga) { + nLane = (int)PlayerLane.FlashType.Clap; + nHand = 0; + nChannel = 0x14; + if (b太鼓音再生フラグ) { + this.soundClap[3]?.PlayStart(); + } + } else { + nLane = (int)PlayerLane.FlashType.Total; + } + break; + case (int)EPad.Clap5P: + if (OpenTaiko.ConfigIni.nGameType[OpenTaiko.GetActualPlayer(1)] == EGameType.Konga) { + nLane = (int)PlayerLane.FlashType.Clap; + nHand = 0; + nChannel = 0x14; + if (b太鼓音再生フラグ) { + this.soundClap[4]?.PlayStart(); + } + } else { + nLane = (int)PlayerLane.FlashType.Total; + } + break; + default: { + continue; + } + break; + } - switch (((EPad)nPad)) { - case EPad.LRed: - case EPad.LRed2P: - case EPad.LRed3P: - case EPad.LRed4P: - case EPad.LRed5P: - case EPad.RRed: - case EPad.RRed2P: - case EPad.RRed3P: - case EPad.RRed4P: - case EPad.RRed5P: - case EPad.LBlue: - case EPad.LBlue2P: - case EPad.LBlue3P: - case EPad.LBlue4P: - case EPad.LBlue5P: - case EPad.RBlue: - case EPad.RBlue2P: - case EPad.RBlue3P: - case EPad.RBlue4P: - case EPad.RBlue5P: { - - // Regular notes - - #region [Fetch values] - - // Flatten pads from 8 to 4 - var _pad = (EPad)nPad; - if ((EPad)nPad == EPad.LRed2P) _pad = EPad.LRed; - if ((EPad)nPad == EPad.RRed2P) _pad = EPad.RRed; - if ((EPad)nPad == EPad.LBlue2P) _pad = EPad.LBlue; - if ((EPad)nPad == EPad.RBlue2P) _pad = EPad.RBlue; + OpenTaiko.stage演奏ドラム画面.actTaikoLaneFlash.PlayerLane[nUsePlayer].Start((PlayerLane.FlashType)nLane); + OpenTaiko.stage演奏ドラム画面.actMtaiko.tMtaikoEvent(nChannel, nHand, nUsePlayer); - if ((EPad)nPad == EPad.LRed3P) _pad = EPad.LRed; - if ((EPad)nPad == EPad.RRed3P) _pad = EPad.RRed; - if ((EPad)nPad == EPad.LBlue3P) _pad = EPad.LBlue; - if ((EPad)nPad == EPad.RBlue3P) _pad = EPad.RBlue; + #endregion - if ((EPad)nPad == EPad.LRed4P) _pad = EPad.LRed; - if ((EPad)nPad == EPad.RRed4P) _pad = EPad.RRed; - if ((EPad)nPad == EPad.LBlue4P) _pad = EPad.LBlue; - if ((EPad)nPad == EPad.RBlue4P) _pad = EPad.RBlue; + // Chip bools + EGameType _gt = OpenTaiko.ConfigIni.nGameType[OpenTaiko.GetActualPlayer(nUsePlayer)]; + bool _isBigKaTaiko = NotesManager.IsBigKaTaiko(chipNoHit, _gt); + bool _isBigDonTaiko = NotesManager.IsBigDonTaiko(chipNoHit, _gt); + bool _isClapKonga = NotesManager.IsClapKonga(chipNoHit, _gt); + bool _isPinkKonga = NotesManager.IsSwapNote(chipNoHit, _gt); - if ((EPad)nPad == EPad.LRed5P) _pad = EPad.LRed; - if ((EPad)nPad == EPad.RRed5P) _pad = EPad.RRed; - if ((EPad)nPad == EPad.LBlue5P) _pad = EPad.LBlue; - if ((EPad)nPad == EPad.RBlue5P) _pad = EPad.RBlue; - bool _isLeftPad = _pad == EPad.LRed || _pad == EPad.LBlue; - bool _isBlue = _pad == EPad.RBlue || _pad == EPad.LBlue; + if (this.b連打中[nUsePlayer]) { + chipNoHit = this.chip現在処理中の連打チップ[nUsePlayer]; + e判定 = ENoteJudge.Perfect; + } - int waitInstr = _isLeftPad ? 2 : 1; - int waitRec = waitInstr == 2 ? 1 : 2; + if (chipNoHit == null) { + break; + } - bool _isBigNoteTaiko = _isBlue ? _isBigKaTaiko : _isBigDonTaiko; - bool _isSmallNote = NotesManager.IsSmallNote(chipNoHit, _isBlue); - - #endregion - - // Register to replay file - OpenTaiko.ReplayInstances[nUsePlayer]?.tRegisterInput(nTime, (byte)_pad); - - // Process small note - if (e判定 != ENoteJudge.Miss && _isSmallNote) { - this.tドラムヒット処理(nTime, _pad, chipNoHit, false, nUsePlayer); - bHitted = true; - } - - // Process big notes (judge big notes off) - if (e判定 != ENoteJudge.Miss && _isBigNoteTaiko && !OpenTaiko.ConfigIni.bJudgeBigNotes) { - this.tドラムヒット処理(nTime, _pad, chipNoHit, true, nUsePlayer); - bHitted = true; - //this.nWaitButton = 0; - this.nStoredHit[nUsePlayer] = 0; - break; - } - - // Process big notes (judge big notes on) - if (e判定 != ENoteJudge.Miss && ((_isBigNoteTaiko && OpenTaiko.ConfigIni.bJudgeBigNotes) || _isPinkKonga)) { - double divided_songspeed = OpenTaiko.ConfigIni.SongPlaybackSpeed; - float time = chipNoHit.n発声時刻ms - (float)(SoundManager.PlayTimer.NowTimeMs * divided_songspeed); - int nWaitTime = OpenTaiko.ConfigIni.nBigNoteWaitTimems; + switch (((EPad)nPad)) { + case EPad.LRed: + case EPad.LRed2P: + case EPad.LRed3P: + case EPad.LRed4P: + case EPad.LRed5P: + case EPad.RRed: + case EPad.RRed2P: + case EPad.RRed3P: + case EPad.RRed4P: + case EPad.RRed5P: + case EPad.LBlue: + case EPad.LBlue2P: + case EPad.LBlue3P: + case EPad.LBlue4P: + case EPad.LBlue5P: + case EPad.RBlue: + case EPad.RBlue2P: + case EPad.RBlue3P: + case EPad.RBlue4P: + case EPad.RBlue5P: { - bool _timeB110 = time <= 110; + // Regular notes - if (chipNoHit.eNoteState == ENoteState.None) { - if (_timeB110) { - chipNoHit.nProcessTime = (int)(SoundManager.PlayTimer.NowTimeMs * divided_songspeed); - chipNoHit.eNoteState = ENoteState.Wait; - //this.nWaitButton = waitInstr; - this.nStoredHit[nUsePlayer] = (int)_pad; - } - } else if (chipNoHit.eNoteState == ENoteState.Wait) { + #region [Fetch values] - bool _isExpected = NotesManager.IsExpectedPad(this.nStoredHit[nUsePlayer], (int)_pad, chipNoHit, _gt); - - // Double tap success - // (this.nWaitButton == waitRec && _timeB110 && chipNoHit.nProcessTime - // + nWaitTime > (int)(CSound管理.rc演奏用タイマ.n現在時刻ms * divided_songspeed)) - - if (_isExpected && _timeB110 && chipNoHit.nProcessTime - + nWaitTime > (int)(SoundManager.PlayTimer.NowTimeMs * divided_songspeed)) { - this.tドラムヒット処理(nTime, _pad, chipNoHit, true, nUsePlayer); - bHitted = true; - //this.nWaitButton = 0; - this.nStoredHit[nUsePlayer] = 0; - } - - // Double tap failure - // else if (this.nWaitButton == waitInstr && _timeB110 && chipNoHit.nProcessTime - // + nWaitTime < (int)(CSound管理.rc演奏用タイマ.n現在時刻ms * divided_songspeed)) - else if (!_isExpected || (_timeB110 && chipNoHit.nProcessTime - + nWaitTime < (int)(SoundManager.PlayTimer.NowTimeMs * divided_songspeed))) { - if (!_isPinkKonga) { - this.tドラムヒット処理(nTime, _pad, chipNoHit, false, nUsePlayer); - bHitted = true; - } - - //this.nWaitButton = 0; - this.nStoredHit[nUsePlayer] = 0; - } + // Flatten pads from 8 to 4 + var _pad = (EPad)nPad; + if ((EPad)nPad == EPad.LRed2P) _pad = EPad.LRed; + if ((EPad)nPad == EPad.RRed2P) _pad = EPad.RRed; + if ((EPad)nPad == EPad.LBlue2P) _pad = EPad.LBlue; + if ((EPad)nPad == EPad.RBlue2P) _pad = EPad.RBlue; + + if ((EPad)nPad == EPad.LRed3P) _pad = EPad.LRed; + if ((EPad)nPad == EPad.RRed3P) _pad = EPad.RRed; + if ((EPad)nPad == EPad.LBlue3P) _pad = EPad.LBlue; + if ((EPad)nPad == EPad.RBlue3P) _pad = EPad.RBlue; + + if ((EPad)nPad == EPad.LRed4P) _pad = EPad.LRed; + if ((EPad)nPad == EPad.RRed4P) _pad = EPad.RRed; + if ((EPad)nPad == EPad.LBlue4P) _pad = EPad.LBlue; + if ((EPad)nPad == EPad.RBlue4P) _pad = EPad.RBlue; + + if ((EPad)nPad == EPad.LRed5P) _pad = EPad.LRed; + if ((EPad)nPad == EPad.RRed5P) _pad = EPad.RRed; + if ((EPad)nPad == EPad.LBlue5P) _pad = EPad.LBlue; + if ((EPad)nPad == EPad.RBlue5P) _pad = EPad.RBlue; + + bool _isLeftPad = _pad == EPad.LRed || _pad == EPad.LBlue; + bool _isBlue = _pad == EPad.RBlue || _pad == EPad.LBlue; + + int waitInstr = _isLeftPad ? 2 : 1; + int waitRec = waitInstr == 2 ? 1 : 2; + + bool _isBigNoteTaiko = _isBlue ? _isBigKaTaiko : _isBigDonTaiko; + bool _isSmallNote = NotesManager.IsSmallNote(chipNoHit, _isBlue); + + #endregion + + // Register to replay file + OpenTaiko.ReplayInstances[nUsePlayer]?.tRegisterInput(nTime, (byte)_pad); + + // Process small note + if (e判定 != ENoteJudge.Miss && _isSmallNote) { + this.tドラムヒット処理(nTime, _pad, chipNoHit, false, nUsePlayer); + bHitted = true; + } + + // Process big notes (judge big notes off) + if (e判定 != ENoteJudge.Miss && _isBigNoteTaiko && !OpenTaiko.ConfigIni.bJudgeBigNotes) { + this.tドラムヒット処理(nTime, _pad, chipNoHit, true, nUsePlayer); + bHitted = true; + //this.nWaitButton = 0; + this.nStoredHit[nUsePlayer] = 0; + break; + } + + // Process big notes (judge big notes on) + if (e判定 != ENoteJudge.Miss && ((_isBigNoteTaiko && OpenTaiko.ConfigIni.bJudgeBigNotes) || _isPinkKonga)) { + double divided_songspeed = OpenTaiko.ConfigIni.SongPlaybackSpeed; + float time = chipNoHit.n発声時刻ms - (float)(SoundManager.PlayTimer.NowTimeMs * divided_songspeed); + int nWaitTime = OpenTaiko.ConfigIni.nBigNoteWaitTimems; + + bool _timeB110 = time <= 110; + + if (chipNoHit.eNoteState == ENoteState.None) { + if (_timeB110) { + chipNoHit.nProcessTime = (int)(SoundManager.PlayTimer.NowTimeMs * divided_songspeed); + chipNoHit.eNoteState = ENoteState.Wait; + //this.nWaitButton = waitInstr; + this.nStoredHit[nUsePlayer] = (int)_pad; } - } - - // Judge rolls - if (e判定 != ENoteJudge.Miss - && NotesManager.IsGenericRoll(chipNoHit) - && !NotesManager.IsRollEnd(chipNoHit)) { - bool _isBalloon = NotesManager.IsGenericBalloon(chipNoHit); - bool _isKusudama = NotesManager.IsKusudama(chipNoHit); - bool _isKongaRedRoll = (NotesManager.IsSmallRoll(chipNoHit) || NotesManager.IsBigRoll(chipNoHit)) || _gt == EGameType.Taiko; + } else if (chipNoHit.eNoteState == ENoteState.Wait) { - bool _isRedOnly = _isBalloon || _isKongaRedRoll || _isKusudama; - - // To be added later - bool _isKongaPinkRoll = NotesManager.IsBigRoll(chipNoHit) && _gt == EGameType.Konga; - - // To improve (array of functions ?) - bool _isBlueOnly = ((NotesManager.IsYellowRoll(chipNoHit) || NotesManager.IsBigRoll(chipNoHit)) || _gt == EGameType.Taiko) - && !_isBalloon && !_isKusudama; + bool _isExpected = NotesManager.IsExpectedPad(this.nStoredHit[nUsePlayer], (int)_pad, chipNoHit, _gt); - if ((_isRedOnly && !_isBlue) || (_isBlueOnly && _isBlue)) - this.tドラムヒット処理(nTime, _pad, chipNoHit, false, nUsePlayer); + // Double tap success + // (this.nWaitButton == waitRec && _timeB110 && chipNoHit.nProcessTime + // + nWaitTime > (int)(CSound管理.rc演奏用タイマ.n現在時刻ms * divided_songspeed)) + + if (_isExpected && _timeB110 && chipNoHit.nProcessTime + + nWaitTime > (int)(SoundManager.PlayTimer.NowTimeMs * divided_songspeed)) { + this.tドラムヒット処理(nTime, _pad, chipNoHit, true, nUsePlayer); + bHitted = true; + //this.nWaitButton = 0; + this.nStoredHit[nUsePlayer] = 0; + } + + // Double tap failure + // else if (this.nWaitButton == waitInstr && _timeB110 && chipNoHit.nProcessTime + // + nWaitTime < (int)(CSound管理.rc演奏用タイマ.n現在時刻ms * divided_songspeed)) + else if (!_isExpected || (_timeB110 && chipNoHit.nProcessTime + + nWaitTime < (int)(SoundManager.PlayTimer.NowTimeMs * divided_songspeed))) { + if (!_isPinkKonga) { + this.tドラムヒット処理(nTime, _pad, chipNoHit, false, nUsePlayer); + bHitted = true; + } + + //this.nWaitButton = 0; + this.nStoredHit[nUsePlayer] = 0; + } } - - if (!bHitted) - break; - continue; - } - case EPad.Clap: - case EPad.Clap2P: - case EPad.Clap3P: - case EPad.Clap4P: - case EPad.Clap5P: { - var _pad = (EPad)nPad; - - // Process konga clap - if (e判定 != ENoteJudge.Miss && _isClapKonga) { + // Judge rolls + if (e判定 != ENoteJudge.Miss + && NotesManager.IsGenericRoll(chipNoHit) + && !NotesManager.IsRollEnd(chipNoHit)) { + bool _isBalloon = NotesManager.IsGenericBalloon(chipNoHit); + bool _isKusudama = NotesManager.IsKusudama(chipNoHit); + bool _isKongaRedRoll = (NotesManager.IsSmallRoll(chipNoHit) || NotesManager.IsBigRoll(chipNoHit)) || _gt == EGameType.Taiko; + + bool _isRedOnly = _isBalloon || _isKongaRedRoll || _isKusudama; + + // To be added later + bool _isKongaPinkRoll = NotesManager.IsBigRoll(chipNoHit) && _gt == EGameType.Konga; + + // To improve (array of functions ?) + bool _isBlueOnly = ((NotesManager.IsYellowRoll(chipNoHit) || NotesManager.IsBigRoll(chipNoHit)) || _gt == EGameType.Taiko) + && !_isBalloon && !_isKusudama; + + if ((_isRedOnly && !_isBlue) || (_isBlueOnly && _isBlue)) this.tドラムヒット処理(nTime, _pad, chipNoHit, false, nUsePlayer); - bHitted = true; - } - - // Judge rolls - if (e判定 != ENoteJudge.Miss - && NotesManager.IsGenericRoll(chipNoHit) - && !NotesManager.IsRollEnd(chipNoHit)) { - bool _isKongaClapRoll = NotesManager.IsClapRoll(chipNoHit) && _gt == EGameType.Konga; - - if (_isKongaClapRoll) - this.tドラムヒット処理(nTime, _pad, chipNoHit, false, nUsePlayer); - } - - - if (!bHitted) - break; - continue; } - } + if (!bHitted) + break; + continue; + + } + + case EPad.Clap: + case EPad.Clap2P: + case EPad.Clap3P: + case EPad.Clap4P: + case EPad.Clap5P: { + var _pad = (EPad)nPad; + + // Process konga clap + if (e判定 != ENoteJudge.Miss && _isClapKonga) { + this.tドラムヒット処理(nTime, _pad, chipNoHit, false, nUsePlayer); + bHitted = true; + } + + // Judge rolls + if (e判定 != ENoteJudge.Miss + && NotesManager.IsGenericRoll(chipNoHit) + && !NotesManager.IsRollEnd(chipNoHit)) { + bool _isKongaClapRoll = NotesManager.IsClapRoll(chipNoHit) && _gt == EGameType.Konga; + + if (_isKongaClapRoll) + this.tドラムヒット処理(nTime, _pad, chipNoHit, false, nUsePlayer); + } - if (e判定 != ENoteJudge.Miss && NotesManager.IsADLIB(chipNoHit)) { - this.tドラムヒット処理(nTime, (EPad)nPad, chipNoHit, false, nUsePlayer); - bHitted = true; - } + if (!bHitted) + break; + continue; + } - if (e判定 != ENoteJudge.Miss && NotesManager.IsMine(chipNoHit)) { - this.tドラムヒット処理(nTime, (EPad)nPad, chipNoHit, false, nUsePlayer); - bHitted = true; - } - - - - #region [ (A) ヒットしていればヒット処理して次の inputEvent へ ] - //----------------------------- - - #region [Legacy] - - /* - switch (((Eパッド)nPad)) - { - case Eパッド.LRed: - case Eパッド.LRed2P: - #region[ 面のヒット処理 ] - //----------------------------- - { - if (e判定 != E判定.Miss && chipNoHit.nチャンネル番号 == 0x11) - { - this.tドラムヒット処理(nTime, Eパッド.LRed, chipNoHit, false, nUsePlayer); - bHitted = true; - } - if (e判定 != E判定.Miss && (_isBigDonTaiko || chipNoHit.nチャンネル番号 == 0x1A) && !TJAPlayer3.ConfigIni.b大音符判定) - { - this.tドラムヒット処理(nTime, Eパッド.LRed, chipNoHit, true, nUsePlayer); - bHitted = true; - this.nWaitButton = 0; - break; - } - if (e判定 != E判定.Miss && (_isBigDonTaiko || chipNoHit.nチャンネル番号 == 0x1A) && TJAPlayer3.ConfigIni.b大音符判定) - { - if (chipNoHit.eNoteState == ENoteState.none) - { - float time = chipNoHit.n発声時刻ms - (float)(CSound管理.rc演奏用タイマ.n現在時刻ms * (((double)TJAPlayer3.ConfigIni.n演奏速度) / 20.0)); - if (time <= 110) - { - chipNoHit.nProcessTime = (int)(CSound管理.rc演奏用タイマ.n現在時刻 * (((double)TJAPlayer3.ConfigIni.n演奏速度) / 20.0)); - chipNoHit.eNoteState = ENoteState.wait; - this.nWaitButton = 2; - } - } - else if (chipNoHit.eNoteState == ENoteState.wait) - { - float time = chipNoHit.n発声時刻ms - (float)(CSound管理.rc演奏用タイマ.n現在時刻ms * (((double)TJAPlayer3.ConfigIni.n演奏速度) / 20.0)); - int nWaitTime = TJAPlayer3.ConfigIni.n両手判定の待ち時間; - if (this.nWaitButton == 1 && time <= 110 && chipNoHit.nProcessTime + nWaitTime > (int)(CSound管理.rc演奏用タイマ.n現在時刻 * (((double)TJAPlayer3.ConfigIni.n演奏速度) / 20.0))) - { - this.tドラムヒット処理(nTime, Eパッド.LRed, chipNoHit, true, nUsePlayer); - bHitted = true; - this.nWaitButton = 0; - } - else if (this.nWaitButton == 2 && time <= 110 && chipNoHit.nProcessTime + nWaitTime < (int)(CSound管理.rc演奏用タイマ.n現在時刻 * (((double)TJAPlayer3.ConfigIni.n演奏速度) / 20.0))) - { - this.tドラムヒット処理(nTime, Eパッド.LRed, chipNoHit, false, nUsePlayer); - bHitted = true; - this.nWaitButton = 0; - } - } - } - if (e判定 != E判定.Miss && (chipNoHit.nチャンネル番号 == 0x15 || chipNoHit.nチャンネル番号 == 0x16 || chipNoHit.nチャンネル番号 == 0x17)) - { - this.tドラムヒット処理(nTime, Eパッド.LRed, chipNoHit, false, nUsePlayer); - } + } - if (!bHitted) - break; - continue; - } + + if (e判定 != ENoteJudge.Miss && NotesManager.IsADLIB(chipNoHit)) { + this.tドラムヒット処理(nTime, (EPad)nPad, chipNoHit, false, nUsePlayer); + bHitted = true; + } + + if (e判定 != ENoteJudge.Miss && NotesManager.IsMine(chipNoHit)) { + this.tドラムヒット処理(nTime, (EPad)nPad, chipNoHit, false, nUsePlayer); + bHitted = true; + } + + + + #region [ (A) ヒットしていればヒット処理して次の inputEvent へ ] + //----------------------------- + + #region [Legacy] + + /* + switch (((Eパッド)nPad)) + { + case Eパッド.LRed: + case Eパッド.LRed2P: + #region[ 面のヒット処理 ] //----------------------------- - #endregion - case Eパッド.RRed: - case Eパッド.RRed2P: - #region[ 面のヒット処理 ] - //----------------------------- - { - if (e判定 != E判定.Miss && chipNoHit.nチャンネル番号 == 0x11) - { - this.tドラムヒット処理(nTime, Eパッド.RRed, chipNoHit, false, nUsePlayer); - bHitted = true; - } - if (e判定 != E判定.Miss && (_isBigDonTaiko || chipNoHit.nチャンネル番号 == 0x1A) && !TJAPlayer3.ConfigIni.b大音符判定) - { - this.tドラムヒット処理(nTime, Eパッド.RRed, chipNoHit, true, nUsePlayer); - bHitted = true; - this.nWaitButton = 0; - break; - } - if (e判定 != E判定.Miss && (_isBigDonTaiko || chipNoHit.nチャンネル番号 == 0x1A) && TJAPlayer3.ConfigIni.b大音符判定) - { - if (chipNoHit.eNoteState == ENoteState.none) - { - float time = chipNoHit.n発声時刻ms - (float)(CSound管理.rc演奏用タイマ.n現在時刻ms * (((double)TJAPlayer3.ConfigIni.n演奏速度) / 20.0)); - if (time <= 110) - { - chipNoHit.nProcessTime = (int)CSound管理.rc演奏用タイマ.n現在時刻ms; - this.n待機中の大音符の座標 = chipNoHit.nバーからの距離dot.Taiko; - chipNoHit.eNoteState = ENoteState.wait; - this.nWaitButton = 1; - } - } - else if (chipNoHit.eNoteState == ENoteState.wait) - { - float time = chipNoHit.n発声時刻ms - (float)(CSound管理.rc演奏用タイマ.n現在時刻ms * (((double)TJAPlayer3.ConfigIni.n演奏速度) / 20.0)); - int nWaitTime = TJAPlayer3.ConfigIni.n両手判定の待ち時間; - if (this.nWaitButton == 2 && time <= 110 && chipNoHit.nProcessTime + nWaitTime > (int)(CSound管理.rc演奏用タイマ.n現在時刻 * (((double)TJAPlayer3.ConfigIni.n演奏速度) / 20.0))) - { - this.tドラムヒット処理(nTime, Eパッド.RRed, chipNoHit, true, nUsePlayer); - bHitted = true; - this.nWaitButton = 0; - break; - } - else if (this.nWaitButton == 2 && time <= 110 && chipNoHit.nProcessTime + nWaitTime < (int)(CSound管理.rc演奏用タイマ.n現在時刻 * (((double)TJAPlayer3.ConfigIni.n演奏速度) / 20.0))) - { - this.tドラムヒット処理(nTime, Eパッド.RRed, chipNoHit, false, nUsePlayer); - bHitted = true; - this.nWaitButton = 0; - } - } - } - if (e判定 != E判定.Miss && (chipNoHit.nチャンネル番号 == 0x15 || chipNoHit.nチャンネル番号 == 0x16 || chipNoHit.nチャンネル番号 == 0x17)) - { - this.tドラムヒット処理(nTime, Eパッド.RRed, chipNoHit, false, nUsePlayer); - } - - if (!bHitted) - break; - - continue; + { + if (e判定 != E判定.Miss && chipNoHit.nチャンネル番号 == 0x11) + { + this.tドラムヒット処理(nTime, Eパッド.LRed, chipNoHit, false, nUsePlayer); + bHitted = true; } - //----------------------------- - #endregion - - case Eパッド.LBlue: - case Eパッド.LBlue2P: - #region[ ふちのヒット処理 ] - //----------------------------- + if (e判定 != E判定.Miss && (_isBigDonTaiko || chipNoHit.nチャンネル番号 == 0x1A) && !TJAPlayer3.ConfigIni.b大音符判定) { + this.tドラムヒット処理(nTime, Eパッド.LRed, chipNoHit, true, nUsePlayer); + bHitted = true; + this.nWaitButton = 0; + break; + } + if (e判定 != E判定.Miss && (_isBigDonTaiko || chipNoHit.nチャンネル番号 == 0x1A) && TJAPlayer3.ConfigIni.b大音符判定) + { + if (chipNoHit.eNoteState == ENoteState.none) + { + float time = chipNoHit.n発声時刻ms - (float)(CSound管理.rc演奏用タイマ.n現在時刻ms * (((double)TJAPlayer3.ConfigIni.n演奏速度) / 20.0)); + if (time <= 110) + { + chipNoHit.nProcessTime = (int)(CSound管理.rc演奏用タイマ.n現在時刻 * (((double)TJAPlayer3.ConfigIni.n演奏速度) / 20.0)); + chipNoHit.eNoteState = ENoteState.wait; + this.nWaitButton = 2; + } + } + else if (chipNoHit.eNoteState == ENoteState.wait) + { + float time = chipNoHit.n発声時刻ms - (float)(CSound管理.rc演奏用タイマ.n現在時刻ms * (((double)TJAPlayer3.ConfigIni.n演奏速度) / 20.0)); + int nWaitTime = TJAPlayer3.ConfigIni.n両手判定の待ち時間; + if (this.nWaitButton == 1 && time <= 110 && chipNoHit.nProcessTime + nWaitTime > (int)(CSound管理.rc演奏用タイマ.n現在時刻 * (((double)TJAPlayer3.ConfigIni.n演奏速度) / 20.0))) + { + this.tドラムヒット処理(nTime, Eパッド.LRed, chipNoHit, true, nUsePlayer); + bHitted = true; + this.nWaitButton = 0; + } + else if (this.nWaitButton == 2 && time <= 110 && chipNoHit.nProcessTime + nWaitTime < (int)(CSound管理.rc演奏用タイマ.n現在時刻 * (((double)TJAPlayer3.ConfigIni.n演奏速度) / 20.0))) + { + this.tドラムヒット処理(nTime, Eパッド.LRed, chipNoHit, false, nUsePlayer); + bHitted = true; + this.nWaitButton = 0; + } + } + } + if (e判定 != E判定.Miss && (chipNoHit.nチャンネル番号 == 0x15 || chipNoHit.nチャンネル番号 == 0x16 || chipNoHit.nチャンネル番号 == 0x17)) + { + this.tドラムヒット処理(nTime, Eパッド.LRed, chipNoHit, false, nUsePlayer); + } - + if (!bHitted) + break; + continue; + } + //----------------------------- + #endregion + case Eパッド.RRed: + case Eパッド.RRed2P: + #region[ 面のヒット処理 ] + //----------------------------- + { + if (e判定 != E判定.Miss && chipNoHit.nチャンネル番号 == 0x11) + { + this.tドラムヒット処理(nTime, Eパッド.RRed, chipNoHit, false, nUsePlayer); + bHitted = true; + } + if (e判定 != E判定.Miss && (_isBigDonTaiko || chipNoHit.nチャンネル番号 == 0x1A) && !TJAPlayer3.ConfigIni.b大音符判定) + { + this.tドラムヒット処理(nTime, Eパッド.RRed, chipNoHit, true, nUsePlayer); + bHitted = true; + this.nWaitButton = 0; + break; + } + if (e判定 != E判定.Miss && (_isBigDonTaiko || chipNoHit.nチャンネル番号 == 0x1A) && TJAPlayer3.ConfigIni.b大音符判定) + { + if (chipNoHit.eNoteState == ENoteState.none) + { + float time = chipNoHit.n発声時刻ms - (float)(CSound管理.rc演奏用タイマ.n現在時刻ms * (((double)TJAPlayer3.ConfigIni.n演奏速度) / 20.0)); + if (time <= 110) + { + chipNoHit.nProcessTime = (int)CSound管理.rc演奏用タイマ.n現在時刻ms; + this.n待機中の大音符の座標 = chipNoHit.nバーからの距離dot.Taiko; + chipNoHit.eNoteState = ENoteState.wait; + this.nWaitButton = 1; + } + } + else if (chipNoHit.eNoteState == ENoteState.wait) + { + float time = chipNoHit.n発声時刻ms - (float)(CSound管理.rc演奏用タイマ.n現在時刻ms * (((double)TJAPlayer3.ConfigIni.n演奏速度) / 20.0)); + int nWaitTime = TJAPlayer3.ConfigIni.n両手判定の待ち時間; + if (this.nWaitButton == 2 && time <= 110 && chipNoHit.nProcessTime + nWaitTime > (int)(CSound管理.rc演奏用タイマ.n現在時刻 * (((double)TJAPlayer3.ConfigIni.n演奏速度) / 20.0))) + { + this.tドラムヒット処理(nTime, Eパッド.RRed, chipNoHit, true, nUsePlayer); + bHitted = true; + this.nWaitButton = 0; + break; + } + else if (this.nWaitButton == 2 && time <= 110 && chipNoHit.nProcessTime + nWaitTime < (int)(CSound管理.rc演奏用タイマ.n現在時刻 * (((double)TJAPlayer3.ConfigIni.n演奏速度) / 20.0))) + { + this.tドラムヒット処理(nTime, Eパッド.RRed, chipNoHit, false, nUsePlayer); + bHitted = true; + this.nWaitButton = 0; + } + } + } + if (e判定 != E判定.Miss && (chipNoHit.nチャンネル番号 == 0x15 || chipNoHit.nチャンネル番号 == 0x16 || chipNoHit.nチャンネル番号 == 0x17)) + { + this.tドラムヒット処理(nTime, Eパッド.RRed, chipNoHit, false, nUsePlayer); + } + if (!bHitted) + break; + + continue; + } + //----------------------------- + #endregion + + case Eパッド.LBlue: + case Eパッド.LBlue2P: + #region[ ふちのヒット処理 ] + //----------------------------- + { + + + + if (e判定 != E判定.Miss && chipNoHit.nチャンネル番号 == 0x12) + { + this.tドラムヒット処理(nTime, Eパッド.LBlue, chipNoHit, false, nUsePlayer); + bHitted = true; + } + if (e判定 != E判定.Miss && (chipNoHit.nチャンネル番号 == 0x14 || chipNoHit.nチャンネル番号 == 0x1B) && !TJAPlayer3.ConfigIni.b大音符判定) + { + this.tドラムヒット処理(nTime, Eパッド.LBlue, chipNoHit, true, nUsePlayer); + bHitted = true; + this.nWaitButton = 0; + break; + } + if (e判定 != E判定.Miss && (chipNoHit.nチャンネル番号 == 0x14 || chipNoHit.nチャンネル番号 == 0x1B) && TJAPlayer3.ConfigIni.b大音符判定) + { + if (chipNoHit.eNoteState == ENoteState.none) + { + float time = chipNoHit.n発声時刻ms - (float)(CSound管理.rc演奏用タイマ.n現在時刻ms * (((double)TJAPlayer3.ConfigIni.n演奏速度) / 20.0)); + if (time <= 110) + { + chipNoHit.nProcessTime = (int)CSound管理.rc演奏用タイマ.n現在時刻ms; + chipNoHit.eNoteState = ENoteState.wait; + this.nWaitButton = 2; + } + } + else if (chipNoHit.eNoteState == ENoteState.wait) + { + float time = chipNoHit.n発声時刻ms - (float)(CSound管理.rc演奏用タイマ.n現在時刻ms * (((double)TJAPlayer3.ConfigIni.n演奏速度) / 20.0)); + int nWaitTime = TJAPlayer3.ConfigIni.n両手判定の待ち時間; + if (this.nWaitButton == 1 && time <= 110 && chipNoHit.nProcessTime + nWaitTime > (int)(CSound管理.rc演奏用タイマ.n現在時刻 * (((double)TJAPlayer3.ConfigIni.n演奏速度) / 20.0))) + { + this.tドラムヒット処理(nTime, Eパッド.LBlue, chipNoHit, true, nUsePlayer); + bHitted = true; + this.nWaitButton = 0; + } + else if (this.nWaitButton == 2 && time <= 110 && chipNoHit.nProcessTime + nWaitTime < (int)(CSound管理.rc演奏用タイマ.n現在時刻 * (((double)TJAPlayer3.ConfigIni.n演奏速度) / 20.0))) + { + this.tドラムヒット処理(nTime, Eパッド.LBlue, chipNoHit, false, nUsePlayer); + bHitted = true; + this.nWaitButton = 0; + } + } + } + if (e判定 != E判定.Miss && (chipNoHit.nチャンネル番号 == 0x15 || chipNoHit.nチャンネル番号 == 0x16)) + { + this.tドラムヒット処理(nTime, Eパッド.LBlue, chipNoHit, false, nUsePlayer); + } + + if (!bHitted) + break; + continue; + } + //----------------------------- + #endregion + + case Eパッド.RBlue: + case Eパッド.RBlue2P: + #region[ ふちのヒット処理 ] + //----------------------------- + { if (e判定 != E判定.Miss && chipNoHit.nチャンネル番号 == 0x12) { - this.tドラムヒット処理(nTime, Eパッド.LBlue, chipNoHit, false, nUsePlayer); - bHitted = true; - } - if (e判定 != E判定.Miss && (chipNoHit.nチャンネル番号 == 0x14 || chipNoHit.nチャンネル番号 == 0x1B) && !TJAPlayer3.ConfigIni.b大音符判定) + this.tドラムヒット処理(nTime, Eパッド.RBlue, chipNoHit, false, nUsePlayer); + bHitted = true; + } + if (e判定 != E判定.Miss && (chipNoHit.nチャンネル番号 == 0x14 || chipNoHit.nチャンネル番号 == 0x1B) && !TJAPlayer3.ConfigIni.b大音符判定) + { + this.tドラムヒット処理(nTime, Eパッド.RBlue, chipNoHit, true, nUsePlayer); + bHitted = true; + this.nWaitButton = 0; + break; + } + if (e判定 != E判定.Miss && (chipNoHit.nチャンネル番号 == 0x14 || chipNoHit.nチャンネル番号 == 0x1B) && TJAPlayer3.ConfigIni.b大音符判定) + { + if (chipNoHit.eNoteState == ENoteState.none) { - this.tドラムヒット処理(nTime, Eパッド.LBlue, chipNoHit, true, nUsePlayer); - bHitted = true; - this.nWaitButton = 0; - break; - } - if (e判定 != E判定.Miss && (chipNoHit.nチャンネル番号 == 0x14 || chipNoHit.nチャンネル番号 == 0x1B) && TJAPlayer3.ConfigIni.b大音符判定) - { - if (chipNoHit.eNoteState == ENoteState.none) + float time = chipNoHit.n発声時刻ms - (float)(CSound管理.rc演奏用タイマ.n現在時刻ms * (((double)TJAPlayer3.ConfigIni.n演奏速度) / 20.0)); + if (time <= 110) { - float time = chipNoHit.n発声時刻ms - (float)(CSound管理.rc演奏用タイマ.n現在時刻ms * (((double)TJAPlayer3.ConfigIni.n演奏速度) / 20.0)); - if (time <= 110) - { - chipNoHit.nProcessTime = (int)CSound管理.rc演奏用タイマ.n現在時刻ms; - chipNoHit.eNoteState = ENoteState.wait; - this.nWaitButton = 2; - } + chipNoHit.nProcessTime = (int)CSound管理.rc演奏用タイマ.n現在時刻ms; + this.n待機中の大音符の座標 = chipNoHit.nバーからの距離dot.Taiko; + chipNoHit.eNoteState = ENoteState.wait; + this.nWaitButton = 1; } - else if (chipNoHit.eNoteState == ENoteState.wait) + } + else if (chipNoHit.eNoteState == ENoteState.wait) + { + float time = chipNoHit.n発声時刻ms - (float)(CSound管理.rc演奏用タイマ.n現在時刻ms * (((double)TJAPlayer3.ConfigIni.n演奏速度) / 20.0)); + int nWaitTime = TJAPlayer3.ConfigIni.n両手判定の待ち時間; + if (this.nWaitButton == 2 && time <= 110 && chipNoHit.nProcessTime + nWaitTime > (int)(CSound管理.rc演奏用タイマ.n現在時刻 * (((double)TJAPlayer3.ConfigIni.n演奏速度) / 20.0))) { - float time = chipNoHit.n発声時刻ms - (float)(CSound管理.rc演奏用タイマ.n現在時刻ms * (((double)TJAPlayer3.ConfigIni.n演奏速度) / 20.0)); - int nWaitTime = TJAPlayer3.ConfigIni.n両手判定の待ち時間; - if (this.nWaitButton == 1 && time <= 110 && chipNoHit.nProcessTime + nWaitTime > (int)(CSound管理.rc演奏用タイマ.n現在時刻 * (((double)TJAPlayer3.ConfigIni.n演奏速度) / 20.0))) - { - this.tドラムヒット処理(nTime, Eパッド.LBlue, chipNoHit, true, nUsePlayer); - bHitted = true; - this.nWaitButton = 0; - } - else if (this.nWaitButton == 2 && time <= 110 && chipNoHit.nProcessTime + nWaitTime < (int)(CSound管理.rc演奏用タイマ.n現在時刻 * (((double)TJAPlayer3.ConfigIni.n演奏速度) / 20.0))) - { - this.tドラムヒット処理(nTime, Eパッド.LBlue, chipNoHit, false, nUsePlayer); - bHitted = true; - this.nWaitButton = 0; - } + this.tドラムヒット処理(nTime, Eパッド.RBlue, chipNoHit, true, nUsePlayer); + bHitted = true; + this.nWaitButton = 0; + break; + } + else if (this.nWaitButton == 2 && time <= 110 && chipNoHit.nProcessTime + nWaitTime < (int)(CSound管理.rc演奏用タイマ.n現在時刻 * (((double)TJAPlayer3.ConfigIni.n演奏速度) / 20.0))) + { + this.tドラムヒット処理(nTime, Eパッド.RBlue, chipNoHit, false, nUsePlayer); + bHitted = true; + this.nWaitButton = 0; } } - if (e判定 != E判定.Miss && (chipNoHit.nチャンネル番号 == 0x15 || chipNoHit.nチャンネル番号 == 0x16)) - { - this.tドラムヒット処理(nTime, Eパッド.LBlue, chipNoHit, false, nUsePlayer); - } + } + if (e判定 != E判定.Miss && (chipNoHit.nチャンネル番号 == 0x15 || chipNoHit.nチャンネル番号 == 0x16)) + { + this.tドラムヒット処理(nTime, Eパッド.RBlue, chipNoHit, false, nUsePlayer); + } - if (!bHitted) - break; - continue; - } + if (!bHitted) + break; + continue; + } //----------------------------- #endregion + } + */ - case Eパッド.RBlue: - case Eパッド.RBlue2P: - #region[ ふちのヒット処理 ] - //----------------------------- - { - if (e判定 != E判定.Miss && chipNoHit.nチャンネル番号 == 0x12) - { - this.tドラムヒット処理(nTime, Eパッド.RBlue, chipNoHit, false, nUsePlayer); - bHitted = true; - } - if (e判定 != E判定.Miss && (chipNoHit.nチャンネル番号 == 0x14 || chipNoHit.nチャンネル番号 == 0x1B) && !TJAPlayer3.ConfigIni.b大音符判定) - { - this.tドラムヒット処理(nTime, Eパッド.RBlue, chipNoHit, true, nUsePlayer); - bHitted = true; - this.nWaitButton = 0; - break; - } - if (e判定 != E判定.Miss && (chipNoHit.nチャンネル番号 == 0x14 || chipNoHit.nチャンネル番号 == 0x1B) && TJAPlayer3.ConfigIni.b大音符判定) - { - if (chipNoHit.eNoteState == ENoteState.none) - { - float time = chipNoHit.n発声時刻ms - (float)(CSound管理.rc演奏用タイマ.n現在時刻ms * (((double)TJAPlayer3.ConfigIni.n演奏速度) / 20.0)); - if (time <= 110) - { - chipNoHit.nProcessTime = (int)CSound管理.rc演奏用タイマ.n現在時刻ms; - this.n待機中の大音符の座標 = chipNoHit.nバーからの距離dot.Taiko; - chipNoHit.eNoteState = ENoteState.wait; - this.nWaitButton = 1; - } - } - else if (chipNoHit.eNoteState == ENoteState.wait) - { - float time = chipNoHit.n発声時刻ms - (float)(CSound管理.rc演奏用タイマ.n現在時刻ms * (((double)TJAPlayer3.ConfigIni.n演奏速度) / 20.0)); - int nWaitTime = TJAPlayer3.ConfigIni.n両手判定の待ち時間; - if (this.nWaitButton == 2 && time <= 110 && chipNoHit.nProcessTime + nWaitTime > (int)(CSound管理.rc演奏用タイマ.n現在時刻 * (((double)TJAPlayer3.ConfigIni.n演奏速度) / 20.0))) - { - this.tドラムヒット処理(nTime, Eパッド.RBlue, chipNoHit, true, nUsePlayer); - bHitted = true; - this.nWaitButton = 0; - break; - } - else if (this.nWaitButton == 2 && time <= 110 && chipNoHit.nProcessTime + nWaitTime < (int)(CSound管理.rc演奏用タイマ.n現在時刻 * (((double)TJAPlayer3.ConfigIni.n演奏速度) / 20.0))) - { - this.tドラムヒット処理(nTime, Eパッド.RBlue, chipNoHit, false, nUsePlayer); - bHitted = true; - this.nWaitButton = 0; - } - } - } - if (e判定 != E判定.Miss && (chipNoHit.nチャンネル番号 == 0x15 || chipNoHit.nチャンネル番号 == 0x16)) - { - this.tドラムヒット処理(nTime, Eパッド.RBlue, chipNoHit, false, nUsePlayer); - } + #endregion - if (!bHitted) - break; - continue; - } - //----------------------------- - #endregion - } - */ - - #endregion - - //2016.07.14 kairera0467 Adlibの場合、一括して処理を行う。 - - - //----------------------------- - #endregion - - - #region [ (B) ヒットしてなかった場合は、レーンフラッシュ、パッドアニメ、空打ち音再生を実行 ] - //----------------------------- - int pad = nPad; // 以下、nPad の代わりに pad を用いる。(成りすまし用) - // BAD or TIGHT 時の処理。 - if (OpenTaiko.ConfigIni.bTight && !b連打中[nUsePlayer]) // 18/8/13 - 連打時にこれが発動すると困る!!! (AioiLight) - this.tチップのヒット処理_BadならびにTight時のMiss(chipNoHit.nコース, EInstrumentPad.Drums, 0, EInstrumentPad.Taiko); - //----------------------------- - #endregion - } + //2016.07.14 kairera0467 Adlibの場合、一括して処理を行う。 + + + //----------------------------- + #endregion + + + #region [ (B) ヒットしてなかった場合は、レーンフラッシュ、パッドアニメ、空打ち音再生を実行 ] + //----------------------------- + int pad = nPad; // 以下、nPad の代わりに pad を用いる。(成りすまし用) + // BAD or TIGHT 時の処理。 + if (OpenTaiko.ConfigIni.bTight && !b連打中[nUsePlayer]) // 18/8/13 - 連打時にこれが発動すると困る!!! (AioiLight) + this.tチップのヒット処理_BadならびにTight時のMiss(chipNoHit.nコース, EInstrumentPad.Drums, 0, EInstrumentPad.Taiko); + //----------------------------- + #endregion } } + } - protected override void t背景テクスチャの生成() { - Rectangle bgrect = new Rectangle(0, 0, 1280, 720); - string DefaultBgFilename = @$"Graphics{Path.DirectorySeparatorChar}5_Game{Path.DirectorySeparatorChar}5_Background{Path.DirectorySeparatorChar}0{Path.DirectorySeparatorChar}Background.png"; - string BgFilename = ""; - if (!String.IsNullOrEmpty(OpenTaiko.DTX.strBGIMAGE_PATH)) - BgFilename = OpenTaiko.DTX.strBGIMAGE_PATH; - base.t背景テクスチャの生成(DefaultBgFilename, bgrect, BgFilename); - } - protected override void t進行描画_チップ_Taiko(CConfigIni configIni, ref CDTX dTX, ref CDTX.CChip pChip, int nPlayer) { - int nLane = (int)PlayerLane.FlashType.Red; - EGameType _gt = OpenTaiko.ConfigIni.nGameType[OpenTaiko.GetActualPlayer(nPlayer)]; - - - #region[ 作り直したもの ] - - if (pChip.b可視) { - if (!pChip.bHit) { - long nPlayTime = (long)(SoundManager.PlayTimer.NowTimeMs * OpenTaiko.ConfigIni.SongPlaybackSpeed); - if ((!pChip.bHit) && (pChip.n発声時刻ms <= nPlayTime)) { - bool bAutoPlay = OpenTaiko.ConfigIni.bAutoPlay[nPlayer]; - switch (nPlayer) { - case 1: - bAutoPlay = OpenTaiko.ConfigIni.bAutoPlay[nPlayer] || OpenTaiko.ConfigIni.bAIBattleMode; - break; - } - - if (bAutoPlay && !this.bPAUSE && !NotesManager.IsMine(pChip)) { - pChip.bHit = true; - if (!NotesManager.IsADLIB(pChip)) // Provisional, to avoid crash on 0x101 - this.FlyingNotes.Start(ChannelNumToFlyNoteNum(pChip, nPlayer), nPlayer); - - //this.actChipFireTaiko.Start(pChip.nチャンネル番号 < 0x1A ? (pChip.nチャンネル番号 - 0x10) : (pChip.nチャンネル番号 - 0x17), nPlayer); - if (pChip.nチャンネル番号 == 0x12 || pChip.nチャンネル番号 == 0x14 || pChip.nチャンネル番号 == 0x1B) nLane = (int)PlayerLane.FlashType.Blue; - - if (pChip.nチャンネル番号 == 0x14 && _gt == EGameType.Konga) nLane = (int)PlayerLane.FlashType.Clap; - - OpenTaiko.stage演奏ドラム画面.actTaikoLaneFlash.PlayerLane[nPlayer].Start((PlayerLane.FlashType)nLane); - OpenTaiko.stage演奏ドラム画面.actTaikoLaneFlash.PlayerLane[nPlayer].Start(PlayerLane.FlashType.Hit); - - this.actMtaiko.tMtaikoEvent(pChip.nチャンネル番号, this.nHand[nPlayer], nPlayer); - - int n大音符 = (pChip.nチャンネル番号 == 0x11 || pChip.nチャンネル番号 == 0x12 ? 2 : 0); - - this.tチップのヒット処理(pChip.n発声時刻ms, pChip, EInstrumentPad.Taiko, true, nLane + n大音符, nPlayer, false); - this.tサウンド再生(pChip, nPlayer); - return; - } - } + protected override void t背景テクスチャの生成() { + Rectangle bgrect = new Rectangle(0, 0, 1280, 720); + string DefaultBgFilename = @$"Graphics{Path.DirectorySeparatorChar}5_Game{Path.DirectorySeparatorChar}5_Background{Path.DirectorySeparatorChar}0{Path.DirectorySeparatorChar}Background.png"; + string BgFilename = ""; + if (!String.IsNullOrEmpty(OpenTaiko.DTX.strBGIMAGE_PATH)) + BgFilename = OpenTaiko.DTX.strBGIMAGE_PATH; + base.t背景テクスチャの生成(DefaultBgFilename, bgrect, BgFilename); + } + protected override void t進行描画_チップ_Taiko(CConfigIni configIni, ref CDTX dTX, ref CDTX.CChip pChip, int nPlayer) { + int nLane = (int)PlayerLane.FlashType.Red; + EGameType _gt = OpenTaiko.ConfigIni.nGameType[OpenTaiko.GetActualPlayer(nPlayer)]; - if (pChip.nノーツ出現時刻ms != 0 && (nPlayTime < pChip.n発声時刻ms - pChip.nノーツ出現時刻ms)) - pChip.bShow = false; - else - pChip.bShow = true; - + #region[ 作り直したもの ] + if (pChip.b可視) { + if (!pChip.bHit) { + long nPlayTime = (long)(SoundManager.PlayTimer.NowTimeMs * OpenTaiko.ConfigIni.SongPlaybackSpeed); + if ((!pChip.bHit) && (pChip.n発声時刻ms <= nPlayTime)) { + bool bAutoPlay = OpenTaiko.ConfigIni.bAutoPlay[nPlayer]; switch (nPlayer) { - case 0: - break; - case 1: - break; - } - switch (pChip.nPlayerSide) { case 1: + bAutoPlay = OpenTaiko.ConfigIni.bAutoPlay[nPlayer] || OpenTaiko.ConfigIni.bAIBattleMode; break; } - int x = pChip.nバーからの距離dot.Taiko; - int y = NoteOriginY[nPlayer];// + ((int)(pChip.nコース) * 100) - - int xTemp = 0; - int yTemp = 0; - - #region[ スクロール方向変更 ] - if (pChip.nスクロール方向 != 0) { - xTemp = x; - yTemp = y; + if (bAutoPlay && !this.bPAUSE && !NotesManager.IsMine(pChip)) { + pChip.bHit = true; + if (!NotesManager.IsADLIB(pChip)) // Provisional, to avoid crash on 0x101 + this.FlyingNotes.Start(ChannelNumToFlyNoteNum(pChip, nPlayer), nPlayer); + + //this.actChipFireTaiko.Start(pChip.nチャンネル番号 < 0x1A ? (pChip.nチャンネル番号 - 0x10) : (pChip.nチャンネル番号 - 0x17), nPlayer); + if (pChip.nチャンネル番号 == 0x12 || pChip.nチャンネル番号 == 0x14 || pChip.nチャンネル番号 == 0x1B) nLane = (int)PlayerLane.FlashType.Blue; + + if (pChip.nチャンネル番号 == 0x14 && _gt == EGameType.Konga) nLane = (int)PlayerLane.FlashType.Clap; + + OpenTaiko.stage演奏ドラム画面.actTaikoLaneFlash.PlayerLane[nPlayer].Start((PlayerLane.FlashType)nLane); + OpenTaiko.stage演奏ドラム画面.actTaikoLaneFlash.PlayerLane[nPlayer].Start(PlayerLane.FlashType.Hit); + + this.actMtaiko.tMtaikoEvent(pChip.nチャンネル番号, this.nHand[nPlayer], nPlayer); + + int n大音符 = (pChip.nチャンネル番号 == 0x11 || pChip.nチャンネル番号 == 0x12 ? 2 : 0); + + this.tチップのヒット処理(pChip.n発声時刻ms, pChip, EInstrumentPad.Taiko, true, nLane + n大音符, nPlayer, false); + this.tサウンド再生(pChip, nPlayer); + return; } - switch (pChip.nスクロール方向) { - case 0: - x += (NoteOriginX[nPlayer]); - break; - case 1: - x = (NoteOriginX[nPlayer]); - y = NoteOriginY[nPlayer] - xTemp; - break; - case 2: - x = (NoteOriginX[nPlayer] + 3); - y = NoteOriginY[nPlayer] + xTemp; - break; - case 3: - x += (NoteOriginX[nPlayer]); - y = NoteOriginY[nPlayer] - xTemp; - break; - case 4: - x += (NoteOriginX[nPlayer]); - y = NoteOriginY[nPlayer] + xTemp; - break; - case 5: - x = (NoteOriginX[nPlayer] + 10) - xTemp; - break; - case 6: - x = (NoteOriginX[nPlayer]) - xTemp; - y = NoteOriginY[nPlayer] - xTemp; - break; - case 7: - x = (NoteOriginX[nPlayer]) - xTemp; - y = NoteOriginY[nPlayer] + xTemp; - break; - } - #endregion - - #region[ 両手待ち時 ] - if (pChip.eNoteState == ENoteState.Wait) { + } + + + if (pChip.nノーツ出現時刻ms != 0 && (nPlayTime < pChip.n発声時刻ms - pChip.nノーツ出現時刻ms)) + pChip.bShow = false; + else + pChip.bShow = true; + + + switch (nPlayer) { + case 0: + break; + case 1: + break; + } + switch (pChip.nPlayerSide) { + case 1: + break; + } + + int x = pChip.nバーからの距離dot.Taiko; + int y = NoteOriginY[nPlayer];// + ((int)(pChip.nコース) * 100) + + int xTemp = 0; + int yTemp = 0; + + #region[ スクロール方向変更 ] + if (pChip.nスクロール方向 != 0) { + xTemp = x; + yTemp = y; + } + switch (pChip.nスクロール方向) { + case 0: + x += (NoteOriginX[nPlayer]); + break; + case 1: x = (NoteOriginX[nPlayer]); - } - #endregion - - #region[ HIDSUD & STEALTH ] - if (OpenTaiko.ConfigIni.eSTEALTH[OpenTaiko.GetActualPlayer(nPlayer)] == EStealthMode.Stealth || OpenTaiko.stage演奏ドラム画面.bCustomDoron) { - pChip.bShow = false; - } - #endregion - - long __dbt = (long)(SoundManager.PlayTimer.NowTimeMs * OpenTaiko.ConfigIni.SongPlaybackSpeed); - long time = pChip.n発声時刻ms - __dbt; - - if (pChip.dbSCROLL_Y != 0.0) { - var dbSCROLL = pChip.eScrollMode == EScrollMode.BMScroll ? 1.0 : pChip.dbSCROLL; - - y = NoteOriginY[nPlayer]; - - - double _scrollSpeed = pChip.dbSCROLL_Y * (this.act譜面スクロール速度.db現在の譜面スクロール速度[nPlayer] + 1.0) / 10.0; - float play_bpm_time = this.GetNowPBMTime(dTX, 0); - - y += NotesManager.GetNoteY(pChip, time * pChip.dbBPM, _scrollSpeed, OpenTaiko.Skin.Game_Notes_Interval, play_bpm_time, pChip.eScrollMode, false); - } - - if (bSplitLane[nPlayer] || OpenTaiko.Tx.Puchichara[PuchiChara.tGetPuchiCharaIndexByName(OpenTaiko.GetActualPlayer(nPlayer))].effect.SplitLane) { - if (NotesManager.IsDonNote(pChip)) { - y -= OpenTaiko.Skin.Game_Notes_Size[1] / 3; - } else if (NotesManager.IsKaNote(pChip)) { - y += OpenTaiko.Skin.Game_Notes_Size[1] / 3; - } - } - - if (time < 0) { - this.actGame.st叩ききりまショー.b最初のチップが叩かれた = true; - } - - if (x > 0 - OpenTaiko.Skin.Game_Notes_Size[0] && x < OpenTaiko.Skin.Resolution[0]) { - if (OpenTaiko.Tx.Notes[(int)_gt] != null) { - //int num9 = this.actCombo.n現在のコンボ数.Drums >= 50 ? this.ctチップ模様アニメ.Drums.n現在の値 * 130 : 0; - int num9 = 0; - if (OpenTaiko.Skin.Game_Notes_Anime && !OpenTaiko.ConfigIni.SimpleMode) { - if (this.actCombo.n現在のコンボ数[nPlayer] >= 300 && ctChipAnimeLag[nPlayer].IsEnded) { - //num9 = ctChipAnime[nPlayer].n現在の値 != 0 ? 260 : 0; - if ((int)ctChipAnime[nPlayer].CurrentValue == 1 || (int)ctChipAnime[nPlayer].CurrentValue == 3) { - num9 = OpenTaiko.Skin.Game_Notes_Size[1] * 2; - } else { - num9 = 0; - } - } else if (this.actCombo.n現在のコンボ数[nPlayer] >= 300 && !ctChipAnimeLag[nPlayer].IsEnded) { - //num9 = base.n現在の音符の顔番号 != 0 ? base.n現在の音符の顔番号 * 130 : 0; - if ((int)ctChipAnime[nPlayer].CurrentValue == 1 || (int)ctChipAnime[nPlayer].CurrentValue == 3) { - num9 = OpenTaiko.Skin.Game_Notes_Size[1]; - } else { - num9 = 0; - } - } else if (this.actCombo.n現在のコンボ数[nPlayer] >= 150) { - //num9 = base.n現在の音符の顔番号 != 0 ? base.n現在の音符の顔番号 * 130 : 0; - if ((int)ctChipAnime[nPlayer].CurrentValue == 1 || (int)ctChipAnime[nPlayer].CurrentValue == 3) { - num9 = OpenTaiko.Skin.Game_Notes_Size[1]; - } else { - num9 = 0; - } - } else if (this.actCombo.n現在のコンボ数[nPlayer] >= 50 && ctChipAnimeLag[nPlayer].IsEnded) { - //num9 = base.n現在の音符の顔番号 != 0 ? base.n現在の音符の顔番号 * 130 : 0; - if ((int)ctChipAnime[nPlayer].CurrentValue <= 1) { - num9 = OpenTaiko.Skin.Game_Notes_Size[1]; - } else { - num9 = 0; - } - } else if (this.actCombo.n現在のコンボ数[nPlayer] >= 50 && !ctChipAnimeLag[nPlayer].IsEnded) { - //num9 = base.n現在の音符の顔番号 != 0 ? base.n現在の音符の顔番号 * 130 : 0; - num9 = 0; - } else { - num9 = 0; - } - } - - - - int nSenotesX = 0; - int nSenotesY = 0; - - switch (OpenTaiko.ConfigIni.nPlayerCount) { - case 1: - case 2: - nSenotesX = OpenTaiko.Skin.nSENotesX[nPlayer]; - nSenotesY = OpenTaiko.Skin.nSENotesY[nPlayer]; - break; - case 3: - case 4: - nSenotesX = OpenTaiko.Skin.nSENotes_4P[0]; - nSenotesY = OpenTaiko.Skin.nSENotes_4P[1]; - break; - case 5: - nSenotesX = OpenTaiko.Skin.nSENotes_5P[0]; - nSenotesY = OpenTaiko.Skin.nSENotes_5P[1]; - break; - } - - this.ct手つなぎ.TickLoop(); - float fHand = (this.ct手つなぎ.CurrentValue < 30 ? this.ct手つなぎ.CurrentValue : 60 - this.ct手つなぎ.CurrentValue) / 30.0f; - - - //x = ( x ) - ( ( int ) ( (TJAPlayer3.Skin.Game_Note_Size[0] * pChip.dbチップサイズ倍率 ) / 2.0 ) ); - - //TJAPlayer3.Tx.Notes[(int)_gt].b加算合成 = false; - //TJAPlayer3.Tx.SENotes.b加算合成 = false; - - switch (pChip.nチャンネル番号) { - case 0x11: - case 0x12: - case 0x13: - case 0x14: - case 0x1C: - case 0x101: { - NotesManager.DisplayNote(nPlayer, x, y, pChip, num9); - NotesManager.DisplaySENotes(nPlayer, x + nSenotesX, y + nSenotesY, pChip); - - //TJAPlayer3.Tx.SENotes[(int)_gt]?.t2D描画(device, x - 2, y + nSenotesY, new Rectangle(0, 30 * pChip.nSenote, 136, 30)); - break; - } - - case 0x1A: - case 0x1B: { - int moveX = (int)(fHand * OpenTaiko.Skin.Game_Notes_Arm_Move[0]); - int moveY = (int)(fHand * OpenTaiko.Skin.Game_Notes_Arm_Move[1]); - if (OpenTaiko.ConfigIni.eSTEALTH[OpenTaiko.GetActualPlayer(nPlayer)] == EStealthMode.Off && pChip.bShow) { - if (nPlayer != OpenTaiko.ConfigIni.nPlayerCount - 1) { - //上から下 - OpenTaiko.Tx.Notes_Arm?.t2D上下反転描画( - x + OpenTaiko.Skin.Game_Notes_Arm_Offset_Left_X[0] + moveX, - y + OpenTaiko.Skin.Game_Notes_Arm_Offset_Left_Y[0] + moveY); - OpenTaiko.Tx.Notes_Arm?.t2D上下反転描画( - x + OpenTaiko.Skin.Game_Notes_Arm_Offset_Right_X[0] - moveX, - y + OpenTaiko.Skin.Game_Notes_Arm_Offset_Right_Y[0] - moveY); - } - if (nPlayer != 0) { - //下から上 - OpenTaiko.Tx.Notes_Arm?.t2D描画( - x + OpenTaiko.Skin.Game_Notes_Arm_Offset_Left_X[1] + moveX, - y + OpenTaiko.Skin.Game_Notes_Arm_Offset_Left_Y[1] + moveY); - OpenTaiko.Tx.Notes_Arm?.t2D描画( - x + OpenTaiko.Skin.Game_Notes_Arm_Offset_Right_X[1] - moveX, - y + OpenTaiko.Skin.Game_Notes_Arm_Offset_Right_Y[1] - moveY); - } - NotesManager.DisplayNote(nPlayer, x, y, pChip, num9); - NotesManager.DisplaySENotes(nPlayer, x + nSenotesX, y + nSenotesY, pChip); - } - break; - } - - case 0x1F: { - NotesManager.DisplayNote(nPlayer, x, y, pChip, num9); - } - break; - default: { - } - break; - - } - //CDTXMania.act文字コンソール.tPrint( x + 60, y + 160, C文字コンソール.Eフォント種別.白, pChip.nPlayerSide.ToString() ); - } - } + y = NoteOriginY[nPlayer] - xTemp; + break; + case 2: + x = (NoteOriginX[nPlayer] + 3); + y = NoteOriginY[nPlayer] + xTemp; + break; + case 3: + x += (NoteOriginX[nPlayer]); + y = NoteOriginY[nPlayer] - xTemp; + break; + case 4: + x += (NoteOriginX[nPlayer]); + y = NoteOriginY[nPlayer] + xTemp; + break; + case 5: + x = (NoteOriginX[nPlayer] + 10) - xTemp; + break; + case 6: + x = (NoteOriginX[nPlayer]) - xTemp; + y = NoteOriginY[nPlayer] - xTemp; + break; + case 7: + x = (NoteOriginX[nPlayer]) - xTemp; + y = NoteOriginY[nPlayer] + xTemp; + break; } - } else { - return; - } - #endregion - } - protected override void t進行描画_チップ_Taiko連打(CConfigIni configIni, ref CDTX dTX, ref CDTX.CChip pChip, int nPlayer) { - int nSenotesX = 0; - int nSenotesY = 0; - long nowTime = (long)(SoundManager.PlayTimer.NowTimeMs * OpenTaiko.ConfigIni.SongPlaybackSpeed); + #endregion - switch (OpenTaiko.ConfigIni.nPlayerCount) { - case 1: - case 2: - nSenotesX = OpenTaiko.Skin.nSENotesX[nPlayer]; - nSenotesY = OpenTaiko.Skin.nSENotesY[nPlayer]; - break; - case 3: - case 4: - nSenotesX = OpenTaiko.Skin.nSENotes_4P[0]; - nSenotesY = OpenTaiko.Skin.nSENotes_4P[1]; - break; - case 5: - nSenotesX = OpenTaiko.Skin.nSENotes_5P[0]; - nSenotesY = OpenTaiko.Skin.nSENotes_5P[1]; - break; - } - - int nノート座標 = pChip.nバーからの距離dot.Taiko; - int nノート末端座標 = pChip.nバーからのノーツ末端距離dot; - int nノート末端座標_Y = pChip.nバーからのノーツ末端距離dot_Y; - int n先頭発声位置 = 0; - - EGameType _gt = OpenTaiko.ConfigIni.nGameType[OpenTaiko.GetActualPlayer(nPlayer)]; - - // 2016.11.2 kairera0467 - // 黄連打音符を赤くするやつの実装方法メモ - //前面を黄色、背面を変色後にしたものを重ねて、打数に応じて前面の透明度を操作すれば、色を操作できるはず。 - //ただしテクスチャのαチャンネル部分が太くなるなどのデメリットが出る。備えよう。 - - #region[ 作り直したもの ] - if (pChip.b可視) { - if (NotesManager.IsGenericRoll(pChip)) { - if (pChip.nノーツ出現時刻ms != 0 && (nowTime < pChip.n発声時刻ms - pChip.nノーツ出現時刻ms)) - pChip.bShow = false; - else if (pChip.nノーツ出現時刻ms != 0 && pChip.nノーツ移動開始時刻ms != 0) - pChip.bShow = true; + #region[ 両手待ち時 ] + if (pChip.eNoteState == ENoteState.Wait) { + x = (NoteOriginX[nPlayer]); } - if (NotesManager.IsRollEnd(pChip)) { - if (pChip.nノーツ出現時刻ms != 0 && (nowTime < n先頭発声位置 - pChip.nノーツ出現時刻ms)) - pChip.bShow = false; - else - pChip.bShow = true; + #endregion - CDTX.CChip cChip = null; - if (pChip.nノーツ移動開始時刻ms != 0) // n先頭発声位置 value is only used when this condition is met - { - cChip = OpenTaiko.stage演奏ドラム画面.r指定時刻に一番近い連打Chip_ヒット未済問わず不可視考慮(pChip.n発声時刻ms, 0x10 + pChip.n連打音符State, 0, nPlayer); - if (cChip != null) { - n先頭発声位置 = cChip.n発声時刻ms; - } - } + #region[ HIDSUD & STEALTH ] + if (OpenTaiko.ConfigIni.eSTEALTH[OpenTaiko.GetActualPlayer(nPlayer)] == EStealthMode.Stealth || OpenTaiko.stage演奏ドラム画面.bCustomDoron) { + pChip.bShow = false; } + #endregion - int x = NoteOriginX[nPlayer] + nノート座標; - int x末端 = NoteOriginX[nPlayer] + nノート末端座標; - int y末端 = NoteOriginY[nPlayer] + nノート末端座標_Y; - int y = NoteOriginY[nPlayer]; + long __dbt = (long)(SoundManager.PlayTimer.NowTimeMs * OpenTaiko.ConfigIni.SongPlaybackSpeed); + long time = pChip.n発声時刻ms - __dbt; if (pChip.dbSCROLL_Y != 0.0) { + var dbSCROLL = pChip.eScrollMode == EScrollMode.BMScroll ? 1.0 : pChip.dbSCROLL; + + y = NoteOriginY[nPlayer]; + + double _scrollSpeed = pChip.dbSCROLL_Y * (this.act譜面スクロール速度.db現在の譜面スクロール速度[nPlayer] + 1.0) / 10.0; - long __dbt = nowTime; - long time = pChip.n発声時刻ms - __dbt; float play_bpm_time = this.GetNowPBMTime(dTX, 0); + y += NotesManager.GetNoteY(pChip, time * pChip.dbBPM, _scrollSpeed, OpenTaiko.Skin.Game_Notes_Interval, play_bpm_time, pChip.eScrollMode, false); } if (bSplitLane[nPlayer] || OpenTaiko.Tx.Puchichara[PuchiChara.tGetPuchiCharaIndexByName(OpenTaiko.GetActualPlayer(nPlayer))].effect.SplitLane) { - if (OpenTaiko.ConfigIni.nGameType[nPlayer] == EGameType.Konga) { - if (NotesManager.IsClapRoll(pChip)) { - } else if (NotesManager.IsYellowRoll(pChip)) { - y += OpenTaiko.Skin.Game_Notes_Size[1] / 2; - y末端 += OpenTaiko.Skin.Game_Notes_Size[1] / 2; - } else if (NotesManager.IsRoll(pChip)) { - y -= OpenTaiko.Skin.Game_Notes_Size[1] / 2; - y末端 -= OpenTaiko.Skin.Game_Notes_Size[1] / 2; - } + if (NotesManager.IsDonNote(pChip)) { + y -= OpenTaiko.Skin.Game_Notes_Size[1] / 3; + } else if (NotesManager.IsKaNote(pChip)) { + y += OpenTaiko.Skin.Game_Notes_Size[1] / 3; } - } - - #region[ HIDSUD & STEALTH ] - - if (OpenTaiko.ConfigIni.eSTEALTH[OpenTaiko.GetActualPlayer(nPlayer)] == EStealthMode.Stealth || OpenTaiko.stage演奏ドラム画面.bCustomDoron) { - pChip.bShow = false; - } - - #endregion - - //if( CDTXMania.ConfigIni.eScrollMode != EScrollMode.Normal ) - //x -= 10; - - //if(x末端 > 0 - TJAPlayer3.Skin.Game_Notes_Size[0] && x < TJAPlayer3.Skin.Resolution[0]) - if ((Math.Min(x, x末端) < OpenTaiko.Skin.Resolution[0] && Math.Max(x, x末端) > 0 - OpenTaiko.Skin.Game_Notes_Size[0])) { - if (OpenTaiko.Tx.Notes[(int)_gt] != null) { - //int num9 = this.actCombo.n現在のコンボ数.Drums >= 50 ? this.ctチップ模様アニメ.Drums.n現在の値 * 130 : 0; - //int num9 = this.actCombo.n現在のコンボ数.Drums >= 50 ? base.n現在の音符の顔番号 * 130 : 0; - int num9 = 0; - //if( this.actCombo.n現在のコンボ数[ nPlayer ] >= 300 ) - //{ - // num9 = base.n現在の音符の顔番号 != 0 ? 260 : 0; - //} - //else if( this.actCombo.n現在のコンボ数[ nPlayer ] >= 50 ) - //{ - // num9 = base.n現在の音符の顔番号 != 0 ? base.n現在の音符の顔番号 * 130 : 0; - //} + } + + if (time < 0) { + this.actGame.st叩ききりまショー.b最初のチップが叩かれた = true; + } + + if (x > 0 - OpenTaiko.Skin.Game_Notes_Size[0] && x < OpenTaiko.Skin.Resolution[0]) { + if (OpenTaiko.Tx.Notes[(int)_gt] != null) { + //int num9 = this.actCombo.n現在のコンボ数.Drums >= 50 ? this.ctチップ模様アニメ.Drums.n現在の値 * 130 : 0; + int num9 = 0; if (OpenTaiko.Skin.Game_Notes_Anime && !OpenTaiko.ConfigIni.SimpleMode) { - if (this.actCombo.n現在のコンボ数[nPlayer] >= 300 && ctChipAnimeLag[nPlayer].IsEnded) { - //num9 = ctChipAnime[nPlayer].db現在の値 != 0 ? 260 : 0; + if (this.actCombo.n現在のコンボ数[nPlayer] >= 300 && ctChipAnimeLag[nPlayer].IsEnded) { + //num9 = ctChipAnime[nPlayer].n現在の値 != 0 ? 260 : 0; if ((int)ctChipAnime[nPlayer].CurrentValue == 1 || (int)ctChipAnime[nPlayer].CurrentValue == 3) { num9 = OpenTaiko.Skin.Game_Notes_Size[1] * 2; } else { num9 = 0; } - } else if (this.actCombo.n現在のコンボ数[nPlayer] >= 300 && !ctChipAnimeLag[nPlayer].IsEnded) { - //num9 = base.n現在の音符の顔番号 != 0 ? base.n現在の音符の顔番号 * 130 : 0; + } else if (this.actCombo.n現在のコンボ数[nPlayer] >= 300 && !ctChipAnimeLag[nPlayer].IsEnded) { + //num9 = base.n現在の音符の顔番号 != 0 ? base.n現在の音符の顔番号 * 130 : 0; if ((int)ctChipAnime[nPlayer].CurrentValue == 1 || (int)ctChipAnime[nPlayer].CurrentValue == 3) { num9 = OpenTaiko.Skin.Game_Notes_Size[1]; } else { num9 = 0; } - } else if (this.actCombo.n現在のコンボ数[nPlayer] >= 150) { - //num9 = base.n現在の音符の顔番号 != 0 ? base.n現在の音符の顔番号 * 130 : 0; + } else if (this.actCombo.n現在のコンボ数[nPlayer] >= 150) { + //num9 = base.n現在の音符の顔番号 != 0 ? base.n現在の音符の顔番号 * 130 : 0; if ((int)ctChipAnime[nPlayer].CurrentValue == 1 || (int)ctChipAnime[nPlayer].CurrentValue == 3) { num9 = OpenTaiko.Skin.Game_Notes_Size[1]; } else { num9 = 0; } - } else if (this.actCombo.n現在のコンボ数[nPlayer] >= 50 && ctChipAnimeLag[nPlayer].IsEnded) { - //num9 = base.n現在の音符の顔番号 != 0 ? base.n現在の音符の顔番号 * 130 : 0; + } else if (this.actCombo.n現在のコンボ数[nPlayer] >= 50 && ctChipAnimeLag[nPlayer].IsEnded) { + //num9 = base.n現在の音符の顔番号 != 0 ? base.n現在の音符の顔番号 * 130 : 0; if ((int)ctChipAnime[nPlayer].CurrentValue <= 1) { num9 = OpenTaiko.Skin.Game_Notes_Size[1]; } else { num9 = 0; } - } else if (this.actCombo.n現在のコンボ数[nPlayer] >= 50 && !ctChipAnimeLag[nPlayer].IsEnded) { - //num9 = base.n現在の音符の顔番号 != 0 ? base.n現在の音符の顔番号 * 130 : 0; + } else if (this.actCombo.n現在のコンボ数[nPlayer] >= 50 && !ctChipAnimeLag[nPlayer].IsEnded) { + //num9 = base.n現在の音符の顔番号 != 0 ? base.n現在の音符の顔番号 * 130 : 0; num9 = 0; } else { num9 = 0; } - } - - //kairera0467氏 の TJAPlayer2forPC のコードを参考にし、打数に応じて色を変える(打数の変更以外はほとんどそのまんま) ろみゅ~? 2018/8/20 - pChip.RollInputTime?.Tick(); - pChip.RollDelay?.Tick(); - - if (pChip.RollInputTime != null && pChip.RollInputTime.IsEnded) { - pChip.RollInputTime.Stop(); - pChip.RollInputTime.CurrentValue = 0; - pChip.RollDelay = new CCounter(0, 1, 1, OpenTaiko.Timer); } - if (pChip.RollDelay != null && pChip.RollDelay.IsEnded && pChip.RollEffectLevel > 0) { - pChip.RollEffectLevel--; - pChip.RollDelay = new CCounter(0, 1, 1, OpenTaiko.Timer); - pChip.RollDelay.CurrentValue = 0; + + + int nSenotesX = 0; + int nSenotesY = 0; + + switch (OpenTaiko.ConfigIni.nPlayerCount) { + case 1: + case 2: + nSenotesX = OpenTaiko.Skin.nSENotesX[nPlayer]; + nSenotesY = OpenTaiko.Skin.nSENotesY[nPlayer]; + break; + case 3: + case 4: + nSenotesX = OpenTaiko.Skin.nSENotes_4P[0]; + nSenotesY = OpenTaiko.Skin.nSENotes_4P[1]; + break; + case 5: + nSenotesX = OpenTaiko.Skin.nSENotes_5P[0]; + nSenotesY = OpenTaiko.Skin.nSENotes_5P[1]; + break; } - float f減少するカラー = 1.0f - ((0.95f / 100) * pChip.RollEffectLevel); - var effectedColor = new Color4(1.0f, f減少するカラー, f減少するカラー, 1f); - var normalColor = new Color4(1.0f, 1.0f, 1.0f, 1f); - //float f末端ノーツのテクスチャ位置調整 = 65f; - - //136, 30 - var _size = OpenTaiko.Skin.Game_SENote_Size; - int _60_cut = 60 * _size[0] / 136; - int _58_cut = 58 * _size[0] / 136; - int _78_cut = 78 * _size[0] / 136; - - if (NotesManager.IsRoll(pChip) || NotesManager.IsFuzeRoll(pChip)) { - if (NotesManager.IsFuzeRoll(pChip) - && nowTime >= pChip.n発声時刻ms && nowTime < pChip.nノーツ終了時刻ms) { - x = NoteOriginX[nPlayer]; - y = NoteOriginY[nPlayer]; - } + this.ct手つなぎ.TickLoop(); + float fHand = (this.ct手つなぎ.CurrentValue < 30 ? this.ct手つなぎ.CurrentValue : 60 - this.ct手つなぎ.CurrentValue) / 30.0f; - NotesManager.DisplayRoll(nPlayer, x, y, pChip, num9, normalColor, effectedColor, x末端, y末端); + //x = ( x ) - ( ( int ) ( (TJAPlayer3.Skin.Game_Note_Size[0] * pChip.dbチップサイズ倍率 ) / 2.0 ) ); - if (OpenTaiko.Tx.SENotes[(int)_gt] != null) { - int _shift = NotesManager.IsBigRoll(pChip) ? 26 : 0; + //TJAPlayer3.Tx.Notes[(int)_gt].b加算合成 = false; + //TJAPlayer3.Tx.SENotes.b加算合成 = false; - if (!NotesManager.IsFuzeRoll(pChip)) { - OpenTaiko.Tx.SENotes[(int)_gt].vcScaleRatio.X = x末端 - x - 44 - _shift; - OpenTaiko.Tx.SENotes[(int)_gt].t2D描画(x + 90 + _shift, y + nSenotesY, new Rectangle(_60_cut, 8 * _size[1], 1, _size[1])); - OpenTaiko.Tx.SENotes[(int)_gt].vcScaleRatio.X = 1.0f; - OpenTaiko.Tx.SENotes[(int)_gt].t2D描画(x + 30 + _shift, y + nSenotesY, new Rectangle(0, 8 * _size[1], _60_cut, _size[1])); - OpenTaiko.Tx.SENotes[(int)_gt].t2D描画(x - (_shift / 13), y + nSenotesY, new Rectangle(0, _size[1] * pChip.nSenote, _size[0], _size[1])); - } else { + switch (pChip.nチャンネル番号) { + case 0x11: + case 0x12: + case 0x13: + case 0x14: + case 0x1C: + case 0x101: { + NotesManager.DisplayNote(nPlayer, x, y, pChip, num9); NotesManager.DisplaySENotes(nPlayer, x + nSenotesX, y + nSenotesY, pChip); + + //TJAPlayer3.Tx.SENotes[(int)_gt]?.t2D描画(device, x - 2, y + nSenotesY, new Rectangle(0, 30 * pChip.nSenote, 136, 30)); + break; } - } - - } - - if (NotesManager.IsBalloon(pChip) || NotesManager.IsKusudama(pChip)) { - if (pChip.bShow) { - if (nowTime >= pChip.n発声時刻ms && nowTime < pChip.nノーツ終了時刻ms) - x = NoteOriginX[nPlayer]; - else if (nowTime >= pChip.nノーツ終了時刻ms) - x = (NoteOriginX[nPlayer] + pChip.nバーからのノーツ末端距離dot); - - NotesManager.DisplayNote(nPlayer, x, y, pChip, num9, OpenTaiko.Skin.Game_Notes_Size[0] * 2); - NotesManager.DisplaySENotes(nPlayer, x + nSenotesX, y + nSenotesY, pChip); - - /* - if (TJAPlayer3.ConfigIni.eSTEALTH != Eステルスモード.DORON) - TJAPlayer3.Tx.Notes[(int)_gt].t2D描画(x, y, new Rectangle(1430, num9, 260, 130)); - */ - - //TJAPlayer3.Tx.SENotes.t2D描画(x - 2, y + nSenotesY, new Rectangle(0, 30 * pChip.nSenote, 136, 30)); - } - } - if (NotesManager.IsRollEnd(pChip)) { - //大きい連打か小さい連打かの区別方法を考えてなかったよちくしょう - if (OpenTaiko.Tx.Notes[(int)_gt] != null) - OpenTaiko.Tx.Notes[(int)_gt].vcScaleRatio.X = 1.0f; - int n = 0; - switch (pChip.n連打音符State) { - case 5: - n = 910; - break; - case 6: - n = 1300; - break; - default: - n = 910; - break; - } - if (pChip.n連打音符State != 7 && pChip.n連打音符State != 9 && pChip.n連打音符State != 13) { - //if( CDTXMania.ConfigIni.eSTEALTH != Eステルスモード.DORON ) - // CDTXMania.Tx.Notes.t2D描画( CDTXMania.app.Device, x, y, new Rectangle( n, num9, 130, 130 ) );//大音符:1170 - OpenTaiko.Tx.SENotes[(int)_gt]?.t2D描画(x + 56, y + nSenotesY, new Rectangle(_58_cut, 9 * _size[1], _78_cut, _size[1])); - } + case 0x1A: + case 0x1B: { + int moveX = (int)(fHand * OpenTaiko.Skin.Game_Notes_Arm_Move[0]); + int moveY = (int)(fHand * OpenTaiko.Skin.Game_Notes_Arm_Move[1]); + if (OpenTaiko.ConfigIni.eSTEALTH[OpenTaiko.GetActualPlayer(nPlayer)] == EStealthMode.Off && pChip.bShow) { + if (nPlayer != OpenTaiko.ConfigIni.nPlayerCount - 1) { + //上から下 + OpenTaiko.Tx.Notes_Arm?.t2D上下反転描画( + x + OpenTaiko.Skin.Game_Notes_Arm_Offset_Left_X[0] + moveX, + y + OpenTaiko.Skin.Game_Notes_Arm_Offset_Left_Y[0] + moveY); + OpenTaiko.Tx.Notes_Arm?.t2D上下反転描画( + x + OpenTaiko.Skin.Game_Notes_Arm_Offset_Right_X[0] - moveX, + y + OpenTaiko.Skin.Game_Notes_Arm_Offset_Right_Y[0] - moveY); + } + if (nPlayer != 0) { + //下から上 + OpenTaiko.Tx.Notes_Arm?.t2D描画( + x + OpenTaiko.Skin.Game_Notes_Arm_Offset_Left_X[1] + moveX, + y + OpenTaiko.Skin.Game_Notes_Arm_Offset_Left_Y[1] + moveY); + OpenTaiko.Tx.Notes_Arm?.t2D描画( + x + OpenTaiko.Skin.Game_Notes_Arm_Offset_Right_X[1] - moveX, + y + OpenTaiko.Skin.Game_Notes_Arm_Offset_Right_Y[1] - moveY); + } + NotesManager.DisplayNote(nPlayer, x, y, pChip, num9); + NotesManager.DisplaySENotes(nPlayer, x + nSenotesX, y + nSenotesY, pChip); + } + break; + } + + case 0x1F: { + NotesManager.DisplayNote(nPlayer, x, y, pChip, num9); + } + break; + default: { + } + break; } + //CDTXMania.act文字コンソール.tPrint( x + 60, y + 160, C文字コンソール.Eフォント種別.白, pChip.nPlayerSide.ToString() ); } } + } + } else { + return; + } + #endregion + } + protected override void t進行描画_チップ_Taiko連打(CConfigIni configIni, ref CDTX dTX, ref CDTX.CChip pChip, int nPlayer) { + int nSenotesX = 0; + int nSenotesY = 0; + long nowTime = (long)(SoundManager.PlayTimer.NowTimeMs * OpenTaiko.ConfigIni.SongPlaybackSpeed); - if (pChip.n発声時刻ms < nowTime && pChip.nノーツ終了時刻ms > nowTime) { - var puchichara = OpenTaiko.Tx.Puchichara[PuchiChara.tGetPuchiCharaIndexByName(OpenTaiko.GetActualPlayer(nPlayer))]; - - //時間内でかつ0x9Aじゃないならならヒット処理 - if (!NotesManager.IsRollEnd(pChip) && - ((nPlayer != 1 ? OpenTaiko.ConfigIni.bAutoPlay[nPlayer] : - (OpenTaiko.ConfigIni.bAutoPlay[nPlayer] || OpenTaiko.ConfigIni.bAIBattleMode)) || - puchichara.effect.Autoroll > 0)) - this.tチップのヒット処理(pChip.n発声時刻ms, pChip, EInstrumentPad.Taiko, false, 0, nPlayer, puchichara.effect.Autoroll > 0); + switch (OpenTaiko.ConfigIni.nPlayerCount) { + case 1: + case 2: + nSenotesX = OpenTaiko.Skin.nSENotesX[nPlayer]; + nSenotesY = OpenTaiko.Skin.nSENotesY[nPlayer]; + break; + case 3: + case 4: + nSenotesX = OpenTaiko.Skin.nSENotes_4P[0]; + nSenotesY = OpenTaiko.Skin.nSENotes_4P[1]; + break; + case 5: + nSenotesX = OpenTaiko.Skin.nSENotes_5P[0]; + nSenotesY = OpenTaiko.Skin.nSENotes_5P[1]; + break; + } + + int nノート座標 = pChip.nバーからの距離dot.Taiko; + int nノート末端座標 = pChip.nバーからのノーツ末端距離dot; + int nノート末端座標_Y = pChip.nバーからのノーツ末端距離dot_Y; + int n先頭発声位置 = 0; + + EGameType _gt = OpenTaiko.ConfigIni.nGameType[OpenTaiko.GetActualPlayer(nPlayer)]; + + // 2016.11.2 kairera0467 + // 黄連打音符を赤くするやつの実装方法メモ + //前面を黄色、背面を変色後にしたものを重ねて、打数に応じて前面の透明度を操作すれば、色を操作できるはず。 + //ただしテクスチャのαチャンネル部分が太くなるなどのデメリットが出る。備えよう。 + + #region[ 作り直したもの ] + if (pChip.b可視) { + if (NotesManager.IsGenericRoll(pChip)) { + if (pChip.nノーツ出現時刻ms != 0 && (nowTime < pChip.n発声時刻ms - pChip.nノーツ出現時刻ms)) + pChip.bShow = false; + else if (pChip.nノーツ出現時刻ms != 0 && pChip.nノーツ移動開始時刻ms != 0) + pChip.bShow = true; + } + if (NotesManager.IsRollEnd(pChip)) { + if (pChip.nノーツ出現時刻ms != 0 && (nowTime < n先頭発声位置 - pChip.nノーツ出現時刻ms)) + pChip.bShow = false; + else + pChip.bShow = true; + + CDTX.CChip cChip = null; + if (pChip.nノーツ移動開始時刻ms != 0) // n先頭発声位置 value is only used when this condition is met + { + cChip = OpenTaiko.stage演奏ドラム画面.r指定時刻に一番近い連打Chip_ヒット未済問わず不可視考慮(pChip.n発声時刻ms, 0x10 + pChip.n連打音符State, 0, nPlayer); + if (cChip != null) { + n先頭発声位置 = cChip.n発声時刻ms; + } } - } - #endregion - } + } - protected override void t進行描画_チップ_ドラムス(CConfigIni configIni, ref CDTX dTX, ref CDTX.CChip pChip) { - } - protected override void t進行描画_チップ本体_ドラムス(CConfigIni configIni, ref CDTX dTX, ref CDTX.CChip pChip) { - } - protected override void t進行描画_チップ_フィルイン(CConfigIni configIni, ref CDTX dTX, ref CDTX.CChip pChip) { - - } - protected override void t進行描画_チップ_小節線(CConfigIni configIni, ref CDTX dTX, ref CDTX.CChip pChip, int nPlayer) { - if (pChip.nコース != this.n現在のコース[nPlayer]) - return; - - //int n小節番号plus1 = pChip.n発声位置 / 384; - //int n小節番号plus1 = this.actPlayInfo.NowMeasure[nPlayer]; - int x = NoteOriginX[nPlayer] + pChip.nバーからの距離dot.Taiko; + int x = NoteOriginX[nPlayer] + nノート座標; + int x末端 = NoteOriginX[nPlayer] + nノート末端座標; + int y末端 = NoteOriginY[nPlayer] + nノート末端座標_Y; int y = NoteOriginY[nPlayer]; if (pChip.dbSCROLL_Y != 0.0) { double _scrollSpeed = pChip.dbSCROLL_Y * (this.act譜面スクロール速度.db現在の譜面スクロール速度[nPlayer] + 1.0) / 10.0; - long __dbt = (long)(SoundManager.PlayTimer.NowTimeMs * OpenTaiko.ConfigIni.SongPlaybackSpeed); + long __dbt = nowTime; long time = pChip.n発声時刻ms - __dbt; float play_bpm_time = this.GetNowPBMTime(dTX, 0); - y += NotesManager.GetNoteY(pChip, time * pChip.dbBPM, _scrollSpeed, OpenTaiko.Skin.Game_Notes_Interval, play_bpm_time, pChip.eScrollMode, false); - - //y += (int)(((pChip.n発声時刻ms - (CSound管理.rc演奏用タイマ.n現在時刻 * (((double)TJAPlayer3.ConfigIni.n演奏速度) / 20.0))) * pChip.dbBPM * pChip.dbSCROLL_Y * (this.act譜面スクロール速度.db現在の譜面スクロール速度[nPlayer] + 1.5)) / 628.7); + y += NotesManager.GetNoteY(pChip, time * pChip.dbBPM, _scrollSpeed, OpenTaiko.Skin.Game_Notes_Interval, play_bpm_time, pChip.eScrollMode, false); } - if ((pChip.b可視 && !pChip.bHideBarLine) && (OpenTaiko.Tx.Bar != null)) { - if (x >= 0 && x <= SampleFramework.GameWindowSize.Width) { - if (pChip.bBranch) { - //this.tx小節線_branch.t2D描画( CDTXMania.app.Device, x - 3, y, new Rectangle( 0, 0, 3, 130 ) ); - OpenTaiko.Tx.Bar_Branch?.t2D描画(x + ((OpenTaiko.Skin.Game_Notes_Size[0] - OpenTaiko.Tx.Bar_Branch.szTextureSize.Width) / 2), y, new Rectangle(0, 0, OpenTaiko.Tx.Bar_Branch.szTextureSize.Width, OpenTaiko.Skin.Game_Notes_Size[1])); - } else { - //this.tx小節線.t2D描画( CDTXMania.app.Device, x - 3, y, new Rectangle( 0, 0, 3, 130 ) ); - OpenTaiko.Tx.Bar?.t2D描画(x + ((OpenTaiko.Skin.Game_Notes_Size[0] - OpenTaiko.Tx.Bar.szTextureSize.Width) / 2), y, new Rectangle(0, 0, OpenTaiko.Tx.Bar.szTextureSize.Width, OpenTaiko.Skin.Game_Notes_Size[1])); + if (bSplitLane[nPlayer] || OpenTaiko.Tx.Puchichara[PuchiChara.tGetPuchiCharaIndexByName(OpenTaiko.GetActualPlayer(nPlayer))].effect.SplitLane) { + if (OpenTaiko.ConfigIni.nGameType[nPlayer] == EGameType.Konga) { + if (NotesManager.IsClapRoll(pChip)) { + } else if (NotesManager.IsYellowRoll(pChip)) { + y += OpenTaiko.Skin.Game_Notes_Size[1] / 2; + y末端 += OpenTaiko.Skin.Game_Notes_Size[1] / 2; + } else if (NotesManager.IsRoll(pChip)) { + y -= OpenTaiko.Skin.Game_Notes_Size[1] / 2; + y末端 -= OpenTaiko.Skin.Game_Notes_Size[1] / 2; } } } - } - - /// - /// 全体にわたる制御をする。 - /// - public void t全体制御メソッド() { - int t = (int)SoundManager.PlayTimer.NowTimeMs; - //CDTXMania.act文字コンソール.tPrint( 0, 16, C文字コンソール.Eフォント種別.白, t.ToString() ); - - this.actBalloon.tDrawKusudama(); - for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { - var chkChip = this.chip現在処理中の連打チップ[i]; - if (chkChip != null) { - long nowTime = (long)(SoundManager.PlayTimer.NowTime * OpenTaiko.ConfigIni.SongPlaybackSpeed); - //int n = this.chip現在処理中の連打チップ[i].nチャンネル番号; - if ((NotesManager.IsGenericBalloon(chkChip) || NotesManager.IsKusudama(chkChip)) && (this.b連打中[i] == true)) { - //if (this.chip現在処理中の連打チップ.n発声時刻ms <= (int)CSound管理.rc演奏用タイマ.n現在時刻ms && this.chip現在処理中の連打チップ.nノーツ終了時刻ms >= (int)CSound管理.rc演奏用タイマ.n現在時刻ms) - if (chkChip.n発声時刻ms <= (int)nowTime - && chkChip.nノーツ終了時刻ms + 500 >= (int)nowTime) { - var balloon = NotesManager.IsKusudama(chkChip) ? nCurrentKusudamaCount : chkChip.nBalloon; - if (!NotesManager.IsFuzeRoll(chkChip)) chkChip.bShow = false; - this.actBalloon.On進行描画( - balloon, - this.n風船残り[i], - i, - NotesManager.IsFuzeRoll(chkChip) - ? CActImplBalloon.EBalloonType.FUSEROLL - : NotesManager.IsKusudama(chkChip) + #region[ HIDSUD & STEALTH ] + + if (OpenTaiko.ConfigIni.eSTEALTH[OpenTaiko.GetActualPlayer(nPlayer)] == EStealthMode.Stealth || OpenTaiko.stage演奏ドラム画面.bCustomDoron) { + pChip.bShow = false; + } + + #endregion + + //if( CDTXMania.ConfigIni.eScrollMode != EScrollMode.Normal ) + //x -= 10; + + //if(x末端 > 0 - TJAPlayer3.Skin.Game_Notes_Size[0] && x < TJAPlayer3.Skin.Resolution[0]) + if ((Math.Min(x, x末端) < OpenTaiko.Skin.Resolution[0] && Math.Max(x, x末端) > 0 - OpenTaiko.Skin.Game_Notes_Size[0])) { + if (OpenTaiko.Tx.Notes[(int)_gt] != null) { + //int num9 = this.actCombo.n現在のコンボ数.Drums >= 50 ? this.ctチップ模様アニメ.Drums.n現在の値 * 130 : 0; + //int num9 = this.actCombo.n現在のコンボ数.Drums >= 50 ? base.n現在の音符の顔番号 * 130 : 0; + int num9 = 0; + //if( this.actCombo.n現在のコンボ数[ nPlayer ] >= 300 ) + //{ + // num9 = base.n現在の音符の顔番号 != 0 ? 260 : 0; + //} + //else if( this.actCombo.n現在のコンボ数[ nPlayer ] >= 50 ) + //{ + // num9 = base.n現在の音符の顔番号 != 0 ? base.n現在の音符の顔番号 * 130 : 0; + //} + if (OpenTaiko.Skin.Game_Notes_Anime && !OpenTaiko.ConfigIni.SimpleMode) { + if (this.actCombo.n現在のコンボ数[nPlayer] >= 300 && ctChipAnimeLag[nPlayer].IsEnded) { + //num9 = ctChipAnime[nPlayer].db現在の値 != 0 ? 260 : 0; + if ((int)ctChipAnime[nPlayer].CurrentValue == 1 || (int)ctChipAnime[nPlayer].CurrentValue == 3) { + num9 = OpenTaiko.Skin.Game_Notes_Size[1] * 2; + } else { + num9 = 0; + } + } else if (this.actCombo.n現在のコンボ数[nPlayer] >= 300 && !ctChipAnimeLag[nPlayer].IsEnded) { + //num9 = base.n現在の音符の顔番号 != 0 ? base.n現在の音符の顔番号 * 130 : 0; + if ((int)ctChipAnime[nPlayer].CurrentValue == 1 || (int)ctChipAnime[nPlayer].CurrentValue == 3) { + num9 = OpenTaiko.Skin.Game_Notes_Size[1]; + } else { + num9 = 0; + } + } else if (this.actCombo.n現在のコンボ数[nPlayer] >= 150) { + //num9 = base.n現在の音符の顔番号 != 0 ? base.n現在の音符の顔番号 * 130 : 0; + if ((int)ctChipAnime[nPlayer].CurrentValue == 1 || (int)ctChipAnime[nPlayer].CurrentValue == 3) { + num9 = OpenTaiko.Skin.Game_Notes_Size[1]; + } else { + num9 = 0; + } + } else if (this.actCombo.n現在のコンボ数[nPlayer] >= 50 && ctChipAnimeLag[nPlayer].IsEnded) { + //num9 = base.n現在の音符の顔番号 != 0 ? base.n現在の音符の顔番号 * 130 : 0; + if ((int)ctChipAnime[nPlayer].CurrentValue <= 1) { + num9 = OpenTaiko.Skin.Game_Notes_Size[1]; + } else { + num9 = 0; + } + } else if (this.actCombo.n現在のコンボ数[nPlayer] >= 50 && !ctChipAnimeLag[nPlayer].IsEnded) { + //num9 = base.n現在の音符の顔番号 != 0 ? base.n現在の音符の顔番号 * 130 : 0; + num9 = 0; + } else { + num9 = 0; + } + } + + //kairera0467氏 の TJAPlayer2forPC のコードを参考にし、打数に応じて色を変える(打数の変更以外はほとんどそのまんま) ろみゅ~? 2018/8/20 + pChip.RollInputTime?.Tick(); + pChip.RollDelay?.Tick(); + + if (pChip.RollInputTime != null && pChip.RollInputTime.IsEnded) { + pChip.RollInputTime.Stop(); + pChip.RollInputTime.CurrentValue = 0; + pChip.RollDelay = new CCounter(0, 1, 1, OpenTaiko.Timer); + } + + if (pChip.RollDelay != null && pChip.RollDelay.IsEnded && pChip.RollEffectLevel > 0) { + pChip.RollEffectLevel--; + pChip.RollDelay = new CCounter(0, 1, 1, OpenTaiko.Timer); + pChip.RollDelay.CurrentValue = 0; + } + + float f減少するカラー = 1.0f - ((0.95f / 100) * pChip.RollEffectLevel); + var effectedColor = new Color4(1.0f, f減少するカラー, f減少するカラー, 1f); + var normalColor = new Color4(1.0f, 1.0f, 1.0f, 1f); + //float f末端ノーツのテクスチャ位置調整 = 65f; + + //136, 30 + var _size = OpenTaiko.Skin.Game_SENote_Size; + int _60_cut = 60 * _size[0] / 136; + int _58_cut = 58 * _size[0] / 136; + int _78_cut = 78 * _size[0] / 136; + + if (NotesManager.IsRoll(pChip) || NotesManager.IsFuzeRoll(pChip)) { + if (NotesManager.IsFuzeRoll(pChip) + && nowTime >= pChip.n発声時刻ms && nowTime < pChip.nノーツ終了時刻ms) { + x = NoteOriginX[nPlayer]; + y = NoteOriginY[nPlayer]; + } + + + NotesManager.DisplayRoll(nPlayer, x, y, pChip, num9, normalColor, effectedColor, x末端, y末端); + + if (OpenTaiko.Tx.SENotes[(int)_gt] != null) { + int _shift = NotesManager.IsBigRoll(pChip) ? 26 : 0; + + if (!NotesManager.IsFuzeRoll(pChip)) { + OpenTaiko.Tx.SENotes[(int)_gt].vcScaleRatio.X = x末端 - x - 44 - _shift; + OpenTaiko.Tx.SENotes[(int)_gt].t2D描画(x + 90 + _shift, y + nSenotesY, new Rectangle(_60_cut, 8 * _size[1], 1, _size[1])); + OpenTaiko.Tx.SENotes[(int)_gt].vcScaleRatio.X = 1.0f; + OpenTaiko.Tx.SENotes[(int)_gt].t2D描画(x + 30 + _shift, y + nSenotesY, new Rectangle(0, 8 * _size[1], _60_cut, _size[1])); + OpenTaiko.Tx.SENotes[(int)_gt].t2D描画(x - (_shift / 13), y + nSenotesY, new Rectangle(0, _size[1] * pChip.nSenote, _size[0], _size[1])); + } else { + NotesManager.DisplaySENotes(nPlayer, x + nSenotesX, y + nSenotesY, pChip); + } + + } + + } + + if (NotesManager.IsBalloon(pChip) || NotesManager.IsKusudama(pChip)) { + if (pChip.bShow) { + if (nowTime >= pChip.n発声時刻ms && nowTime < pChip.nノーツ終了時刻ms) + x = NoteOriginX[nPlayer]; + else if (nowTime >= pChip.nノーツ終了時刻ms) + x = (NoteOriginX[nPlayer] + pChip.nバーからのノーツ末端距離dot); + + NotesManager.DisplayNote(nPlayer, x, y, pChip, num9, OpenTaiko.Skin.Game_Notes_Size[0] * 2); + NotesManager.DisplaySENotes(nPlayer, x + nSenotesX, y + nSenotesY, pChip); + + /* + if (TJAPlayer3.ConfigIni.eSTEALTH != Eステルスモード.DORON) + TJAPlayer3.Tx.Notes[(int)_gt].t2D描画(x, y, new Rectangle(1430, num9, 260, 130)); + */ + + //TJAPlayer3.Tx.SENotes.t2D描画(x - 2, y + nSenotesY, new Rectangle(0, 30 * pChip.nSenote, 136, 30)); + } + } + if (NotesManager.IsRollEnd(pChip)) { + //大きい連打か小さい連打かの区別方法を考えてなかったよちくしょう + if (OpenTaiko.Tx.Notes[(int)_gt] != null) + OpenTaiko.Tx.Notes[(int)_gt].vcScaleRatio.X = 1.0f; + int n = 0; + switch (pChip.n連打音符State) { + case 5: + n = 910; + break; + case 6: + n = 1300; + break; + default: + n = 910; + break; + } + if (pChip.n連打音符State != 7 && pChip.n連打音符State != 9 && pChip.n連打音符State != 13) { + //if( CDTXMania.ConfigIni.eSTEALTH != Eステルスモード.DORON ) + // CDTXMania.Tx.Notes.t2D描画( CDTXMania.app.Device, x, y, new Rectangle( n, num9, 130, 130 ) );//大音符:1170 + OpenTaiko.Tx.SENotes[(int)_gt]?.t2D描画(x + 56, y + nSenotesY, new Rectangle(_58_cut, 9 * _size[1], _78_cut, _size[1])); + } + + } + } + } + + if (pChip.n発声時刻ms < nowTime && pChip.nノーツ終了時刻ms > nowTime) { + var puchichara = OpenTaiko.Tx.Puchichara[PuchiChara.tGetPuchiCharaIndexByName(OpenTaiko.GetActualPlayer(nPlayer))]; + + //時間内でかつ0x9Aじゃないならならヒット処理 + if (!NotesManager.IsRollEnd(pChip) && + ((nPlayer != 1 ? OpenTaiko.ConfigIni.bAutoPlay[nPlayer] : + (OpenTaiko.ConfigIni.bAutoPlay[nPlayer] || OpenTaiko.ConfigIni.bAIBattleMode)) || + puchichara.effect.Autoroll > 0)) + this.tチップのヒット処理(pChip.n発声時刻ms, pChip, EInstrumentPad.Taiko, false, 0, nPlayer, puchichara.effect.Autoroll > 0); + } + } + #endregion + } + + protected override void t進行描画_チップ_ドラムス(CConfigIni configIni, ref CDTX dTX, ref CDTX.CChip pChip) { + } + protected override void t進行描画_チップ本体_ドラムス(CConfigIni configIni, ref CDTX dTX, ref CDTX.CChip pChip) { + } + protected override void t進行描画_チップ_フィルイン(CConfigIni configIni, ref CDTX dTX, ref CDTX.CChip pChip) { + + } + protected override void t進行描画_チップ_小節線(CConfigIni configIni, ref CDTX dTX, ref CDTX.CChip pChip, int nPlayer) { + if (pChip.nコース != this.n現在のコース[nPlayer]) + return; + + //int n小節番号plus1 = pChip.n発声位置 / 384; + //int n小節番号plus1 = this.actPlayInfo.NowMeasure[nPlayer]; + int x = NoteOriginX[nPlayer] + pChip.nバーからの距離dot.Taiko; + int y = NoteOriginY[nPlayer]; + + if (pChip.dbSCROLL_Y != 0.0) { + double _scrollSpeed = pChip.dbSCROLL_Y * (this.act譜面スクロール速度.db現在の譜面スクロール速度[nPlayer] + 1.0) / 10.0; + long __dbt = (long)(SoundManager.PlayTimer.NowTimeMs * OpenTaiko.ConfigIni.SongPlaybackSpeed); + long time = pChip.n発声時刻ms - __dbt; + float play_bpm_time = this.GetNowPBMTime(dTX, 0); + y += NotesManager.GetNoteY(pChip, time * pChip.dbBPM, _scrollSpeed, OpenTaiko.Skin.Game_Notes_Interval, play_bpm_time, pChip.eScrollMode, false); + + //y += (int)(((pChip.n発声時刻ms - (CSound管理.rc演奏用タイマ.n現在時刻 * (((double)TJAPlayer3.ConfigIni.n演奏速度) / 20.0))) * pChip.dbBPM * pChip.dbSCROLL_Y * (this.act譜面スクロール速度.db現在の譜面スクロール速度[nPlayer] + 1.5)) / 628.7); + } + + if ((pChip.b可視 && !pChip.bHideBarLine) && (OpenTaiko.Tx.Bar != null)) { + if (x >= 0 && x <= SampleFramework.GameWindowSize.Width) { + if (pChip.bBranch) { + //this.tx小節線_branch.t2D描画( CDTXMania.app.Device, x - 3, y, new Rectangle( 0, 0, 3, 130 ) ); + OpenTaiko.Tx.Bar_Branch?.t2D描画(x + ((OpenTaiko.Skin.Game_Notes_Size[0] - OpenTaiko.Tx.Bar_Branch.szTextureSize.Width) / 2), y, new Rectangle(0, 0, OpenTaiko.Tx.Bar_Branch.szTextureSize.Width, OpenTaiko.Skin.Game_Notes_Size[1])); + } else { + //this.tx小節線.t2D描画( CDTXMania.app.Device, x - 3, y, new Rectangle( 0, 0, 3, 130 ) ); + OpenTaiko.Tx.Bar?.t2D描画(x + ((OpenTaiko.Skin.Game_Notes_Size[0] - OpenTaiko.Tx.Bar.szTextureSize.Width) / 2), y, new Rectangle(0, 0, OpenTaiko.Tx.Bar.szTextureSize.Width, OpenTaiko.Skin.Game_Notes_Size[1])); + } + } + } + } + + /// + /// 全体にわたる制御をする。 + /// + public void t全体制御メソッド() { + int t = (int)SoundManager.PlayTimer.NowTimeMs; + //CDTXMania.act文字コンソール.tPrint( 0, 16, C文字コンソール.Eフォント種別.白, t.ToString() ); + + this.actBalloon.tDrawKusudama(); + + for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { + var chkChip = this.chip現在処理中の連打チップ[i]; + if (chkChip != null) { + long nowTime = (long)(SoundManager.PlayTimer.NowTime * OpenTaiko.ConfigIni.SongPlaybackSpeed); + //int n = this.chip現在処理中の連打チップ[i].nチャンネル番号; + if ((NotesManager.IsGenericBalloon(chkChip) || NotesManager.IsKusudama(chkChip)) && (this.b連打中[i] == true)) { + //if (this.chip現在処理中の連打チップ.n発声時刻ms <= (int)CSound管理.rc演奏用タイマ.n現在時刻ms && this.chip現在処理中の連打チップ.nノーツ終了時刻ms >= (int)CSound管理.rc演奏用タイマ.n現在時刻ms) + if (chkChip.n発声時刻ms <= (int)nowTime + && chkChip.nノーツ終了時刻ms + 500 >= (int)nowTime) { + var balloon = NotesManager.IsKusudama(chkChip) ? nCurrentKusudamaCount : chkChip.nBalloon; + if (!NotesManager.IsFuzeRoll(chkChip)) chkChip.bShow = false; + this.actBalloon.On進行描画( + balloon, + this.n風船残り[i], + i, + NotesManager.IsFuzeRoll(chkChip) + ? CActImplBalloon.EBalloonType.FUSEROLL + : NotesManager.IsKusudama(chkChip) ? CActImplBalloon.EBalloonType.KUSUDAMA : CActImplBalloon.EBalloonType.BALLOON - ); - } else { - this.n現在の連打数[i] = 0; - } - + ); + } else { + this.n現在の連打数[i] = 0; } + } - } - #region [ Treat big notes hit with a single hand ] - //常時イベントが発生しているメソッドのほうがいいんじゃないかという予想。 - //CDTX.CChip chipNoHit = this.r指定時刻に一番近い未ヒットChip((int)CSound管理.rc演奏用タイマ.n現在時刻ms, 0); - for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { - CDTX.CChip chipNoHit = r指定時刻に一番近い未ヒットChipを過去方向優先で検索する((long)(SoundManager.PlayTimer.NowTime * OpenTaiko.ConfigIni.SongPlaybackSpeed), i); + } + } + #region [ Treat big notes hit with a single hand ] + //常時イベントが発生しているメソッドのほうがいいんじゃないかという予想。 + //CDTX.CChip chipNoHit = this.r指定時刻に一番近い未ヒットChip((int)CSound管理.rc演奏用タイマ.n現在時刻ms, 0); + for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { + CDTX.CChip chipNoHit = r指定時刻に一番近い未ヒットChipを過去方向優先で検索する((long)(SoundManager.PlayTimer.NowTime * OpenTaiko.ConfigIni.SongPlaybackSpeed), i); - EGameType _gt = OpenTaiko.ConfigIni.nGameType[OpenTaiko.GetActualPlayer(i)]; - bool _isBigKaTaiko = NotesManager.IsBigKaTaiko(chipNoHit, _gt); - bool _isBigDonTaiko = NotesManager.IsBigDonTaiko(chipNoHit, _gt); - bool _isSwapNote = NotesManager.IsSwapNote(chipNoHit, _gt); + EGameType _gt = OpenTaiko.ConfigIni.nGameType[OpenTaiko.GetActualPlayer(i)]; + bool _isBigKaTaiko = NotesManager.IsBigKaTaiko(chipNoHit, _gt); + bool _isBigDonTaiko = NotesManager.IsBigDonTaiko(chipNoHit, _gt); + bool _isSwapNote = NotesManager.IsSwapNote(chipNoHit, _gt); - if (chipNoHit != null && (_isBigDonTaiko || _isBigKaTaiko)) { - float timeC = chipNoHit.n発声時刻ms - (float)(SoundManager.PlayTimer.NowTime * OpenTaiko.ConfigIni.SongPlaybackSpeed); - int nWaitTime = OpenTaiko.ConfigIni.nBigNoteWaitTimems; - if (chipNoHit.eNoteState == ENoteState.Wait && timeC <= 110 - && chipNoHit.nProcessTime + nWaitTime <= (int)(SoundManager.PlayTimer.NowTime * OpenTaiko.ConfigIni.SongPlaybackSpeed)) { - if (!_isSwapNote) { - this.tドラムヒット処理(chipNoHit.nProcessTime, EPad.RRed, chipNoHit, false, i); - //this.nWaitButton = 0; - this.nStoredHit[i] = 0; - chipNoHit.bHit = true; - chipNoHit.IsHitted = true; - } - - - chipNoHit.eNoteState = ENoteState.None; + if (chipNoHit != null && (_isBigDonTaiko || _isBigKaTaiko)) { + float timeC = chipNoHit.n発声時刻ms - (float)(SoundManager.PlayTimer.NowTime * OpenTaiko.ConfigIni.SongPlaybackSpeed); + int nWaitTime = OpenTaiko.ConfigIni.nBigNoteWaitTimems; + if (chipNoHit.eNoteState == ENoteState.Wait && timeC <= 110 + && chipNoHit.nProcessTime + nWaitTime <= (int)(SoundManager.PlayTimer.NowTime * OpenTaiko.ConfigIni.SongPlaybackSpeed)) { + if (!_isSwapNote) { + this.tドラムヒット処理(chipNoHit.nProcessTime, EPad.RRed, chipNoHit, false, i); + //this.nWaitButton = 0; + this.nStoredHit[i] = 0; + chipNoHit.bHit = true; + chipNoHit.IsHitted = true; } + + + chipNoHit.eNoteState = ENoteState.None; } - } - - #endregion - - //string strNull = "Found"; - - if (OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.F1)) { - if (!this.actPauseMenu.bIsActivePopupMenu && this.bPAUSE == false) { - OpenTaiko.Skin.soundChangeSFX.tPlay(); + } + } - SoundManager.PlayTimer.Pause(); - OpenTaiko.Timer.Pause(); - OpenTaiko.DTX.t全チップの再生一時停止(); - this.actAVI.tPauseControl(); + #endregion - this.bPAUSE = true; - this.actPauseMenu.tActivatePopupMenu(0); - } + //string strNull = "Found"; + if (OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.F1)) { + if (!this.actPauseMenu.bIsActivePopupMenu && this.bPAUSE == false) { + OpenTaiko.Skin.soundChangeSFX.tPlay(); + + SoundManager.PlayTimer.Pause(); + OpenTaiko.Timer.Pause(); + OpenTaiko.DTX.t全チップの再生一時停止(); + this.actAVI.tPauseControl(); + + this.bPAUSE = true; + this.actPauseMenu.tActivatePopupMenu(0); } } - private void t進行描画_リアルタイム判定数表示() { - var showJudgeInfo = false; + } - if (OpenTaiko.ConfigIni.nPlayerCount == 1 ? (OpenTaiko.ConfigIni.bJudgeCountDisplay && !OpenTaiko.ConfigIni.bAutoPlay[0]) : false) showJudgeInfo = true; - if (OpenTaiko.ConfigIni.bTokkunMode) showJudgeInfo = true; + private void t進行描画_リアルタイム判定数表示() { + var showJudgeInfo = false; - if (showJudgeInfo) { - //ボードの横幅は333px - //数字フォントの小さいほうはリザルトのものと同じ。 - if (OpenTaiko.Tx.Judge_Meter != null) - OpenTaiko.Tx.Judge_Meter.t2D描画(OpenTaiko.Skin.Game_Judge_Meter[0], OpenTaiko.Skin.Game_Judge_Meter[1]); + if (OpenTaiko.ConfigIni.nPlayerCount == 1 ? (OpenTaiko.ConfigIni.bJudgeCountDisplay && !OpenTaiko.ConfigIni.bAutoPlay[0]) : false) showJudgeInfo = true; + if (OpenTaiko.ConfigIni.bTokkunMode) showJudgeInfo = true; - this.t小文字表示(OpenTaiko.Skin.Game_Judge_Meter_Perfect[0], OpenTaiko.Skin.Game_Judge_Meter_Perfect[1], this.nヒット数_Auto含まない.Drums.Perfect, false, false); - this.t小文字表示(OpenTaiko.Skin.Game_Judge_Meter_Good[0], OpenTaiko.Skin.Game_Judge_Meter_Good[1], this.nヒット数_Auto含まない.Drums.Great, false, false); - this.t小文字表示(OpenTaiko.Skin.Game_Judge_Meter_Miss[0], OpenTaiko.Skin.Game_Judge_Meter_Miss[1], this.nヒット数_Auto含まない.Drums.Miss, false, false); - this.t小文字表示(OpenTaiko.Skin.Game_Judge_Meter_Roll[0], OpenTaiko.Skin.Game_Judge_Meter_Roll[1], GetRoll(0), false, false); + if (showJudgeInfo) { + //ボードの横幅は333px + //数字フォントの小さいほうはリザルトのものと同じ。 + if (OpenTaiko.Tx.Judge_Meter != null) + OpenTaiko.Tx.Judge_Meter.t2D描画(OpenTaiko.Skin.Game_Judge_Meter[0], OpenTaiko.Skin.Game_Judge_Meter[1]); - int nNowTotal = this.nヒット数_Auto含まない.Drums.Perfect + this.nヒット数_Auto含まない.Drums.Great + this.nヒット数_Auto含まない.Drums.Miss; - double dbたたけた率 = Math.Round((100.0 * (OpenTaiko.stage演奏ドラム画面.nヒット数_Auto含まない.Drums.Perfect + OpenTaiko.stage演奏ドラム画面.nヒット数_Auto含まない.Drums.Great)) / (double)nNowTotal); - double dbPERFECT率 = Math.Round((100.0 * OpenTaiko.stage演奏ドラム画面.nヒット数_Auto含まない.Drums.Perfect) / (double)nNowTotal); - double dbGREAT率 = Math.Round((100.0 * OpenTaiko.stage演奏ドラム画面.nヒット数_Auto含まない.Drums.Great / (double)nNowTotal)); - double dbMISS率 = Math.Round((100.0 * OpenTaiko.stage演奏ドラム画面.nヒット数_Auto含まない.Drums.Miss / (double)nNowTotal)); + this.t小文字表示(OpenTaiko.Skin.Game_Judge_Meter_Perfect[0], OpenTaiko.Skin.Game_Judge_Meter_Perfect[1], this.nヒット数_Auto含まない.Drums.Perfect, false, false); + this.t小文字表示(OpenTaiko.Skin.Game_Judge_Meter_Good[0], OpenTaiko.Skin.Game_Judge_Meter_Good[1], this.nヒット数_Auto含まない.Drums.Great, false, false); + this.t小文字表示(OpenTaiko.Skin.Game_Judge_Meter_Miss[0], OpenTaiko.Skin.Game_Judge_Meter_Miss[1], this.nヒット数_Auto含まない.Drums.Miss, false, false); + this.t小文字表示(OpenTaiko.Skin.Game_Judge_Meter_Roll[0], OpenTaiko.Skin.Game_Judge_Meter_Roll[1], GetRoll(0), false, false); - if (double.IsNaN(dbたたけた率)) - dbたたけた率 = 0; - if (double.IsNaN(dbPERFECT率)) - dbPERFECT率 = 0; - if (double.IsNaN(dbGREAT率)) - dbGREAT率 = 0; - if (double.IsNaN(dbMISS率)) - dbMISS率 = 0; + int nNowTotal = this.nヒット数_Auto含まない.Drums.Perfect + this.nヒット数_Auto含まない.Drums.Great + this.nヒット数_Auto含まない.Drums.Miss; + double dbたたけた率 = Math.Round((100.0 * (OpenTaiko.stage演奏ドラム画面.nヒット数_Auto含まない.Drums.Perfect + OpenTaiko.stage演奏ドラム画面.nヒット数_Auto含まない.Drums.Great)) / (double)nNowTotal); + double dbPERFECT率 = Math.Round((100.0 * OpenTaiko.stage演奏ドラム画面.nヒット数_Auto含まない.Drums.Perfect) / (double)nNowTotal); + double dbGREAT率 = Math.Round((100.0 * OpenTaiko.stage演奏ドラム画面.nヒット数_Auto含まない.Drums.Great / (double)nNowTotal)); + double dbMISS率 = Math.Round((100.0 * OpenTaiko.stage演奏ドラム画面.nヒット数_Auto含まない.Drums.Miss / (double)nNowTotal)); - this.t大文字表示(OpenTaiko.Skin.Game_Judge_Meter_HitRate[0], OpenTaiko.Skin.Game_Judge_Meter_HitRate[1], (int)dbたたけた率); - this.t小文字表示(OpenTaiko.Skin.Game_Judge_Meter_PerfectRate[0], OpenTaiko.Skin.Game_Judge_Meter_PerfectRate[1], (int)dbPERFECT率, false, true); - this.t小文字表示(OpenTaiko.Skin.Game_Judge_Meter_GoodRate[0], OpenTaiko.Skin.Game_Judge_Meter_GoodRate[1], (int)dbGREAT率, false, true); - this.t小文字表示(OpenTaiko.Skin.Game_Judge_Meter_MissRate[0], OpenTaiko.Skin.Game_Judge_Meter_MissRate[1], (int)dbMISS率, false, true); - } + if (double.IsNaN(dbたたけた率)) + dbたたけた率 = 0; + if (double.IsNaN(dbPERFECT率)) + dbPERFECT率 = 0; + if (double.IsNaN(dbGREAT率)) + dbGREAT率 = 0; + if (double.IsNaN(dbMISS率)) + dbMISS率 = 0; + + this.t大文字表示(OpenTaiko.Skin.Game_Judge_Meter_HitRate[0], OpenTaiko.Skin.Game_Judge_Meter_HitRate[1], (int)dbたたけた率); + this.t小文字表示(OpenTaiko.Skin.Game_Judge_Meter_PerfectRate[0], OpenTaiko.Skin.Game_Judge_Meter_PerfectRate[1], (int)dbPERFECT率, false, true); + this.t小文字表示(OpenTaiko.Skin.Game_Judge_Meter_GoodRate[0], OpenTaiko.Skin.Game_Judge_Meter_GoodRate[1], (int)dbGREAT率, false, true); + this.t小文字表示(OpenTaiko.Skin.Game_Judge_Meter_MissRate[0], OpenTaiko.Skin.Game_Judge_Meter_MissRate[1], (int)dbMISS率, false, true); + } + } + + private void t小文字表示(int x, int y, int num, bool bOrange, bool drawPercent) { + float width = OpenTaiko.Tx.Result_Number.sz画像サイズ.Width / 11.0f; + float height = OpenTaiko.Tx.Result_Number.sz画像サイズ.Height / 2.0f; + + int[] nums = CConversion.SeparateDigits(num); + + if (drawPercent) { + OpenTaiko.Tx.Result_Number.t2D拡大率考慮中央基準描画(x + (OpenTaiko.Skin.Result_Number_Interval[0] * 3.0f) + (width / 2), + y + (OpenTaiko.Skin.Result_Number_Interval[1] * 3.0f) + (height / 2), + new System.Drawing.RectangleF(width * 10, 0, width, height)); } - private void t小文字表示(int x, int y, int num, bool bOrange, bool drawPercent) { + for (int j = 0; j < nums.Length; j++) { + float offset = j - 1.5f; + float _x = x - (OpenTaiko.Skin.Result_Number_Interval[0] * offset); + float _y = y - (OpenTaiko.Skin.Result_Number_Interval[1] * offset); + + OpenTaiko.Tx.Result_Number.t2D拡大率考慮中央基準描画(_x + (width / 2), _y + (height / 2), + new System.Drawing.RectangleF(width * nums[j], 0, width, height)); + } + } + + private void t大文字表示(int x, int y, int num) { + int[] nums = CConversion.SeparateDigits(num); + for (int j = 0; j < nums.Length; j++) { + float offset = j - 1.5f; + float _x = x - ((OpenTaiko.Skin.Result_Number_Interval[0] * 1.27f) * offset); + float _y = y - ((OpenTaiko.Skin.Result_Number_Interval[1] * 1.27f) * offset); + float width = OpenTaiko.Tx.Result_Number.sz画像サイズ.Width / 11.0f; float height = OpenTaiko.Tx.Result_Number.sz画像サイズ.Height / 2.0f; - int[] nums = CConversion.SeparateDigits(num); - - if (drawPercent) { - OpenTaiko.Tx.Result_Number.t2D拡大率考慮中央基準描画(x + (OpenTaiko.Skin.Result_Number_Interval[0] * 3.0f) + (width / 2), - y + (OpenTaiko.Skin.Result_Number_Interval[1] * 3.0f) + (height / 2), - new System.Drawing.RectangleF(width * 10, 0, width, height)); - } - - for (int j = 0; j < nums.Length; j++) { - float offset = j - 1.5f; - float _x = x - (OpenTaiko.Skin.Result_Number_Interval[0] * offset); - float _y = y - (OpenTaiko.Skin.Result_Number_Interval[1] * offset); - - OpenTaiko.Tx.Result_Number.t2D拡大率考慮中央基準描画(_x + (width / 2), _y + (height / 2), - new System.Drawing.RectangleF(width * nums[j], 0, width, height)); - } + OpenTaiko.Tx.Result_Number.t2D拡大率考慮中央基準描画(_x + (width / 2), _y + (height / 2), + new System.Drawing.RectangleF(width * nums[j], height, width, height)); } - - private void t大文字表示(int x, int y, int num) { - int[] nums = CConversion.SeparateDigits(num); - for (int j = 0; j < nums.Length; j++) { - float offset = j - 1.5f; - float _x = x - ((OpenTaiko.Skin.Result_Number_Interval[0] * 1.27f) * offset); - float _y = y - ((OpenTaiko.Skin.Result_Number_Interval[1] * 1.27f) * offset); - - float width = OpenTaiko.Tx.Result_Number.sz画像サイズ.Width / 11.0f; - float height = OpenTaiko.Tx.Result_Number.sz画像サイズ.Height / 2.0f; - - OpenTaiko.Tx.Result_Number.t2D拡大率考慮中央基準描画(_x + (width / 2), _y + (height / 2), - new System.Drawing.RectangleF(width * nums[j], height, width, height)); - } - } - #endregion } + #endregion } diff --git a/OpenTaiko/src/Stages/07.Game/Taiko/Dan_Cert.cs b/OpenTaiko/src/Stages/07.Game/Taiko/Dan_Cert.cs index d0a12f51..3469b994 100644 --- a/OpenTaiko/src/Stages/07.Game/Taiko/Dan_Cert.cs +++ b/OpenTaiko/src/Stages/07.Game/Taiko/Dan_Cert.cs @@ -5,1167 +5,1167 @@ using Color = System.Drawing.Color; using Rectangle = System.Drawing.Rectangle; using RectangleF = System.Drawing.RectangleF; -namespace OpenTaiko { - static internal class CExamInfo { - // Includes the gauge exam, DanCert max number of exams is 6 - public static readonly int cMaxExam = 7; +namespace OpenTaiko; - // Max number of songs for a Dan chart - public static readonly int cExamMaxSongs = 9; +static internal class CExamInfo { + // Includes the gauge exam, DanCert max number of exams is 6 + public static readonly int cMaxExam = 7; + + // Max number of songs for a Dan chart + public static readonly int cExamMaxSongs = 9; +} + + +internal class Dan_Cert : CActivity { + /// + /// 段位認定 + /// + public Dan_Cert() { + base.IsDeActivated = true; } + // + Dan_C[] Challenge = new Dan_C[CExamInfo.cMaxExam]; + // - internal class Dan_Cert : CActivity { - /// - /// 段位認定 - /// - public Dan_Cert() { - base.IsDeActivated = true; + public void Start(int number) { + NowShowingNumber = number; + if (number == 0) { + Counter_Wait = new CCounter(0, 2299, 1, OpenTaiko.Timer); + } else { + Counter_In = new CCounter(0, 999, 1, OpenTaiko.Timer); } + bExamChangeCheck = false; - // - Dan_C[] Challenge = new Dan_C[CExamInfo.cMaxExam]; - // + if (number == 0) { + for (int i = 0; i < CExamInfo.cMaxExam; i++) + ExamChange[i] = false; - public void Start(int number) { - NowShowingNumber = number; - if (number == 0) { - Counter_Wait = new CCounter(0, 2299, 1, OpenTaiko.Timer); - } else { - Counter_In = new CCounter(0, 999, 1, OpenTaiko.Timer); - } - bExamChangeCheck = false; - - if (number == 0) { - for (int i = 0; i < CExamInfo.cMaxExam; i++) - ExamChange[i] = false; - - for (int j = 0; j < CExamInfo.cMaxExam; j++) { - if (OpenTaiko.stageSongSelect.rChoosenSong.DanSongs[0].Dan_C[j] != null) { - Challenge[j] = OpenTaiko.stageSongSelect.rChoosenSong.DanSongs[NowShowingNumber].Dan_C[j]; - if (OpenTaiko.stageSongSelect.rChoosenSong.DanSongs[OpenTaiko.stageSongSelect.rChoosenSong.DanSongs.Count - 1].Dan_C[j] != null - && OpenTaiko.stageSongSelect.rChoosenSong.DanSongs.Count > 1) // Individual exams, not counted if dan is only a single song - { - if (OpenTaiko.stageSongSelect.rChoosenSong.DanSongs[NowShowingNumber].Dan_C[j].GetExamRange() == Exam.Range.Less) { - OpenTaiko.stageSongSelect.rChoosenSong.DanSongs[NowShowingNumber].Dan_C[j].Amount = OpenTaiko.stageSongSelect.rChoosenSong.DanSongs[NowShowingNumber].Dan_C[j].Value[0]; - } else { - OpenTaiko.stageSongSelect.rChoosenSong.DanSongs[NowShowingNumber].Dan_C[j].Amount = 0; - } - - ExamChange[j] = true; + for (int j = 0; j < CExamInfo.cMaxExam; j++) { + if (OpenTaiko.stageSongSelect.rChoosenSong.DanSongs[0].Dan_C[j] != null) { + Challenge[j] = OpenTaiko.stageSongSelect.rChoosenSong.DanSongs[NowShowingNumber].Dan_C[j]; + if (OpenTaiko.stageSongSelect.rChoosenSong.DanSongs[OpenTaiko.stageSongSelect.rChoosenSong.DanSongs.Count - 1].Dan_C[j] != null + && OpenTaiko.stageSongSelect.rChoosenSong.DanSongs.Count > 1) // Individual exams, not counted if dan is only a single song + { + if (OpenTaiko.stageSongSelect.rChoosenSong.DanSongs[NowShowingNumber].Dan_C[j].GetExamRange() == Exam.Range.Less) { + OpenTaiko.stageSongSelect.rChoosenSong.DanSongs[NowShowingNumber].Dan_C[j].Amount = OpenTaiko.stageSongSelect.rChoosenSong.DanSongs[NowShowingNumber].Dan_C[j].Value[0]; + } else { + OpenTaiko.stageSongSelect.rChoosenSong.DanSongs[NowShowingNumber].Dan_C[j].Amount = 0; } + + ExamChange[j] = true; } } } - - ScreenPoint = new double[] { OpenTaiko.Skin.Game_Lane_X[0] - OpenTaiko.Tx.DanC_Screen.szTextureSize.Width / 2, OpenTaiko.Skin.Resolution[0] }; - - OpenTaiko.stage演奏ドラム画面.ReSetScore(OpenTaiko.DTX.List_DanSongs[NowShowingNumber].ScoreInit, OpenTaiko.DTX.List_DanSongs[NowShowingNumber].ScoreDiff); - - OpenTaiko.stage演奏ドラム画面.ftDanReSetScoreNiji(OpenTaiko.DTX.nDan_NotesCount[NowShowingNumber], OpenTaiko.DTX.nDan_BalloonCount[NowShowingNumber]); - OpenTaiko.stage演奏ドラム画面.ftDanReSetBranches(OpenTaiko.DTX.bHasBranchDan[NowShowingNumber]); - - IsAnimating = true; - - //段位道場 - //TJAPlayer3.stage演奏ドラム画面.actPanel.SetPanelString(TJAPlayer3.DTX.List_DanSongs[NowShowingNumber].Title, TJAPlayer3.DTX.List_DanSongs[NowShowingNumber].Genre, 1 + NowShowingNumber + "曲目"); - OpenTaiko.stage演奏ドラム画面.actPanel.SetPanelString(OpenTaiko.DTX.List_DanSongs[NowShowingNumber].Title, - CLangManager.LangInstance.GetString("TITLE_MODE_DAN"), - 1 + NowShowingNumber + "曲目"); - - if (number == 0) Sound_Section_First?.PlayStart(); - else Sound_Section?.PlayStart(); } - public override void Activate() { - for (int i = 0; i < CExamInfo.cMaxExam; i++) { - if (OpenTaiko.DTX.Dan_C[i] != null) Challenge[i] = new Dan_C(OpenTaiko.DTX.Dan_C[i]); + ScreenPoint = new double[] { OpenTaiko.Skin.Game_Lane_X[0] - OpenTaiko.Tx.DanC_Screen.szTextureSize.Width / 2, OpenTaiko.Skin.Resolution[0] }; - for (int j = 0; j < OpenTaiko.stageSongSelect.rChoosenSong.DanSongs.Count; j++) { - if (OpenTaiko.stageSongSelect.rChoosenSong.DanSongs[j].Dan_C[i] != null) { - OpenTaiko.stageSongSelect.rChoosenSong.DanSongs[j].Dan_C[i] = new Dan_C(OpenTaiko.stageSongSelect.rChoosenSong.DanSongs[j].Dan_C[i]); - } + OpenTaiko.stage演奏ドラム画面.ReSetScore(OpenTaiko.DTX.List_DanSongs[NowShowingNumber].ScoreInit, OpenTaiko.DTX.List_DanSongs[NowShowingNumber].ScoreDiff); + + OpenTaiko.stage演奏ドラム画面.ftDanReSetScoreNiji(OpenTaiko.DTX.nDan_NotesCount[NowShowingNumber], OpenTaiko.DTX.nDan_BalloonCount[NowShowingNumber]); + OpenTaiko.stage演奏ドラム画面.ftDanReSetBranches(OpenTaiko.DTX.bHasBranchDan[NowShowingNumber]); + + IsAnimating = true; + + //段位道場 + //TJAPlayer3.stage演奏ドラム画面.actPanel.SetPanelString(TJAPlayer3.DTX.List_DanSongs[NowShowingNumber].Title, TJAPlayer3.DTX.List_DanSongs[NowShowingNumber].Genre, 1 + NowShowingNumber + "曲目"); + OpenTaiko.stage演奏ドラム画面.actPanel.SetPanelString(OpenTaiko.DTX.List_DanSongs[NowShowingNumber].Title, + CLangManager.LangInstance.GetString("TITLE_MODE_DAN"), + 1 + NowShowingNumber + "曲目"); + + if (number == 0) Sound_Section_First?.PlayStart(); + else Sound_Section?.PlayStart(); + } + + public override void Activate() { + for (int i = 0; i < CExamInfo.cMaxExam; i++) { + if (OpenTaiko.DTX.Dan_C[i] != null) Challenge[i] = new Dan_C(OpenTaiko.DTX.Dan_C[i]); + + for (int j = 0; j < OpenTaiko.stageSongSelect.rChoosenSong.DanSongs.Count; j++) { + if (OpenTaiko.stageSongSelect.rChoosenSong.DanSongs[j].Dan_C[i] != null) { + OpenTaiko.stageSongSelect.rChoosenSong.DanSongs[j].Dan_C[i] = new Dan_C(OpenTaiko.stageSongSelect.rChoosenSong.DanSongs[j].Dan_C[i]); + } + } + } + + if (OpenTaiko.stage演奏ドラム画面.ListDan_Number >= 1 && FirstSectionAnime) + OpenTaiko.stage演奏ドラム画面.ListDan_Number = 0; + + FirstSectionAnime = false; + // 始点を決定する。 + // ExamCount = 0; + + songsnotesremain = new int[OpenTaiko.stageSongSelect.rChoosenSong.DanSongs.Count]; + this.ct虹アニメ = new CCounter(0, OpenTaiko.Skin.Game_Gauge_Dan_Rainbow_Ptn - 1, 30, OpenTaiko.Timer); + this.ct虹透明度 = new CCounter(0, OpenTaiko.Skin.Game_Gauge_Rainbow_Timer - 1, 1, OpenTaiko.Timer); + + this.pfExamFont = HPrivateFastFont.tInstantiateMainFont(OpenTaiko.Skin.Game_DanC_ExamFont_Size); + + this.ttkExams = new TitleTextureKey[(int)Exam.Type.Total]; + for (int i = 0; i < this.ttkExams.Length; i++) { + this.ttkExams[i] = new TitleTextureKey(CLangManager.LangInstance.GetExamName(i), this.pfExamFont, Color.White, Color.SaddleBrown, 1000); + } + + NowCymbolShowingNumber = 0; + bExamChangeCheck = false; + + for (int i = 0; i < CExamInfo.cMaxExam; i++) { + Status[i] = new ChallengeStatus(); + Status[i].Timer_Amount = new CCounter(); + Status[i].Timer_Gauge = new CCounter(); + Status[i].Timer_Failed = new CCounter(); + } + + IsEnded = new bool[OpenTaiko.stageSongSelect.rChoosenSong.DanSongs.Count]; + + if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) IsAnimating = true; + + Dan_Plate = OpenTaiko.tテクスチャの生成(Path.GetDirectoryName(OpenTaiko.DTX.strファイル名の絶対パス) + @$"{Path.DirectorySeparatorChar}Dan_Plate.png"); + + base.Activate(); + } + + public void Update() { + for (int i = 0; i < CExamInfo.cMaxExam; i++) { + if (Challenge[i] == null || !Challenge[i].GetEnable()) continue; + if (ExamChange[i] && Challenge[i] != OpenTaiko.stageSongSelect.rChoosenSong.DanSongs[NowShowingNumber].Dan_C[i]) continue; + + var oldReached = Challenge[i].GetReached(); + var isChangedAmount = false; + + int totalGoods = (int)OpenTaiko.stage演奏ドラム画面.nヒット数_Auto含む.Drums.Perfect + OpenTaiko.stage演奏ドラム画面.nヒット数_Auto含まない.Drums.Perfect; + int totalOks = (int)OpenTaiko.stage演奏ドラム画面.nヒット数_Auto含む.Drums.Great + OpenTaiko.stage演奏ドラム画面.nヒット数_Auto含まない.Drums.Great; + int totalBads = (int)OpenTaiko.stage演奏ドラム画面.nヒット数_Auto含まない.Drums.Miss; + int totalCombo = (int)OpenTaiko.stage演奏ドラム画面.actCombo.n現在のコンボ数.最高値[0]; + + int individualGoods = OpenTaiko.stage演奏ドラム画面.n良[NowShowingNumber]; + int individualOks = OpenTaiko.stage演奏ドラム画面.n可[NowShowingNumber]; + int individualBads = OpenTaiko.stage演奏ドラム画面.n不可[NowShowingNumber]; + int individualCombo = OpenTaiko.stage演奏ドラム画面.nHighestCombo[NowShowingNumber]; + + int totalADLIBs = OpenTaiko.stage演奏ドラム画面.CChartScore[0].nADLIB; + int totalMines = OpenTaiko.stage演奏ドラム画面.CChartScore[0].nMine; + + int individualADLIBs = OpenTaiko.stage演奏ドラム画面.nADLIB[NowShowingNumber]; + int individualMines = OpenTaiko.stage演奏ドラム画面.nMine[NowShowingNumber]; + + double accuracy = (totalGoods * 100 + totalOks * 50) / (double)(totalGoods + totalOks + totalBads); + double individualAccuracy = (individualGoods * 100 + individualOks * 50) / (double)(individualGoods + individualOks + individualBads); + + switch (Challenge[i].GetExamType()) { + case Exam.Type.Gauge: + isChangedAmount = Challenge[i].Update((int)OpenTaiko.stage演奏ドラム画面.actGauge.db現在のゲージ値[0]); + break; + case Exam.Type.JudgePerfect: + isChangedAmount = Challenge[i].Update(ExamChange[i] ? individualGoods : totalGoods); + break; + case Exam.Type.JudgeGood: + isChangedAmount = Challenge[i].Update(ExamChange[i] ? individualOks : totalOks); + break; + case Exam.Type.JudgeBad: + isChangedAmount = Challenge[i].Update(ExamChange[i] ? individualBads : totalBads); + break; + case Exam.Type.JudgeADLIB: + isChangedAmount = Challenge[i].Update(ExamChange[i] ? individualADLIBs : totalADLIBs); + break; + case Exam.Type.JudgeMine: + isChangedAmount = Challenge[i].Update(ExamChange[i] ? individualMines : totalMines); + break; + case Exam.Type.Score: + isChangedAmount = Challenge[i].Update((int)OpenTaiko.stage演奏ドラム画面.actScore.GetScore(0)); + break; + case Exam.Type.Roll: + isChangedAmount = Challenge[i].Update(ExamChange[i] ? OpenTaiko.stage演奏ドラム画面.n連打[NowShowingNumber] : (int)(OpenTaiko.stage演奏ドラム画面.GetRoll(0))); + break; + case Exam.Type.Hit: + isChangedAmount = Challenge[i].Update(ExamChange[i] ? OpenTaiko.stage演奏ドラム画面.n良[NowShowingNumber] + OpenTaiko.stage演奏ドラム画面.n可[NowShowingNumber] + OpenTaiko.stage演奏ドラム画面.n連打[NowShowingNumber] : (int)(OpenTaiko.stage演奏ドラム画面.nヒット数_Auto含む.Drums.Perfect + OpenTaiko.stage演奏ドラム画面.nヒット数_Auto含まない.Drums.Perfect + OpenTaiko.stage演奏ドラム画面.nヒット数_Auto含む.Drums.Great + OpenTaiko.stage演奏ドラム画面.nヒット数_Auto含まない.Drums.Great + OpenTaiko.stage演奏ドラム画面.GetRoll(0))); + break; + case Exam.Type.Combo: + isChangedAmount = Challenge[i].Update(ExamChange[i] ? individualCombo : totalCombo); + break; + case Exam.Type.Accuracy: + isChangedAmount = Challenge[i].Update(ExamChange[i] ? (int)individualAccuracy : (int)accuracy); + break; + default: + break; + } + + // 値が変更されていたらアニメーションを行う。 + if (isChangedAmount) { + if (Status[i].Timer_Amount != null && Status[i].Timer_Amount.IsUnEnded) { + Status[i].Timer_Amount = new CCounter(0, 11, 12, OpenTaiko.Timer); + Status[i].Timer_Amount.CurrentValue = 1; + } else { + Status[i].Timer_Amount = new CCounter(0, 11, 12, OpenTaiko.Timer); } } - if (OpenTaiko.stage演奏ドラム画面.ListDan_Number >= 1 && FirstSectionAnime) - OpenTaiko.stage演奏ドラム画面.ListDan_Number = 0; + // 条件の達成見込みがあるかどうか判断する。 + if (Challenge[i].GetExamRange() == Exam.Range.Less) { + Challenge[i].SetReached(!Challenge[i].IsCleared[0]); + } else { + songsnotesremain[NowShowingNumber] = OpenTaiko.DTX.nDan_NotesCount[NowShowingNumber] + - (OpenTaiko.stage演奏ドラム画面.n良[NowShowingNumber] + + OpenTaiko.stage演奏ドラム画面.n可[NowShowingNumber] + + OpenTaiko.stage演奏ドラム画面.n不可[NowShowingNumber]); - FirstSectionAnime = false; - // 始点を決定する。 - // ExamCount = 0; + /* + notesremain = TJAPlayer3.DTX.nノーツ数[3] + - (TJAPlayer3.stage演奏ドラム画面.nヒット数_Auto含む.Drums.Perfect + + TJAPlayer3.stage演奏ドラム画面.nヒット数_Auto含まない.Drums.Perfect) + - (TJAPlayer3.stage演奏ドラム画面.nヒット数_Auto含む.Drums.Great + + TJAPlayer3.stage演奏ドラム画面.nヒット数_Auto含まない.Drums.Great) + - (TJAPlayer3.stage演奏ドラム画面.nヒット数_Auto含む.Drums.Miss + + TJAPlayer3.stage演奏ドラム画面.nヒット数_Auto含まない.Drums.Miss); + */ - songsnotesremain = new int[OpenTaiko.stageSongSelect.rChoosenSong.DanSongs.Count]; - this.ct虹アニメ = new CCounter(0, OpenTaiko.Skin.Game_Gauge_Dan_Rainbow_Ptn - 1, 30, OpenTaiko.Timer); - this.ct虹透明度 = new CCounter(0, OpenTaiko.Skin.Game_Gauge_Rainbow_Timer - 1, 1, OpenTaiko.Timer); + notesremain = OpenTaiko.DTX.nノーツ数[3] + - (OpenTaiko.stage演奏ドラム画面.CChartScore[0].nGood + + OpenTaiko.stage演奏ドラム画面.CChartScore[0].nGreat + + OpenTaiko.stage演奏ドラム画面.CChartScore[0].nMiss); - this.pfExamFont = HPrivateFastFont.tInstantiateMainFont(OpenTaiko.Skin.Game_DanC_ExamFont_Size); + // 残り音符数が0になったときに判断されるやつ - this.ttkExams = new TitleTextureKey[(int)Exam.Type.Total]; - for (int i = 0; i < this.ttkExams.Length; i++) { - this.ttkExams[i] = new TitleTextureKey(CLangManager.LangInstance.GetExamName(i), this.pfExamFont, Color.White, Color.SaddleBrown, 1000); - } - - NowCymbolShowingNumber = 0; - bExamChangeCheck = false; - - for (int i = 0; i < CExamInfo.cMaxExam; i++) { - Status[i] = new ChallengeStatus(); - Status[i].Timer_Amount = new CCounter(); - Status[i].Timer_Gauge = new CCounter(); - Status[i].Timer_Failed = new CCounter(); - } - - IsEnded = new bool[OpenTaiko.stageSongSelect.rChoosenSong.DanSongs.Count]; - - if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) IsAnimating = true; - - Dan_Plate = OpenTaiko.tテクスチャの生成(Path.GetDirectoryName(OpenTaiko.DTX.strファイル名の絶対パス) + @$"{Path.DirectorySeparatorChar}Dan_Plate.png"); - - base.Activate(); - } - - public void Update() { - for (int i = 0; i < CExamInfo.cMaxExam; i++) { - if (Challenge[i] == null || !Challenge[i].GetEnable()) continue; - if (ExamChange[i] && Challenge[i] != OpenTaiko.stageSongSelect.rChoosenSong.DanSongs[NowShowingNumber].Dan_C[i]) continue; - - var oldReached = Challenge[i].GetReached(); - var isChangedAmount = false; - - int totalGoods = (int)OpenTaiko.stage演奏ドラム画面.nヒット数_Auto含む.Drums.Perfect + OpenTaiko.stage演奏ドラム画面.nヒット数_Auto含まない.Drums.Perfect; - int totalOks = (int)OpenTaiko.stage演奏ドラム画面.nヒット数_Auto含む.Drums.Great + OpenTaiko.stage演奏ドラム画面.nヒット数_Auto含まない.Drums.Great; - int totalBads = (int)OpenTaiko.stage演奏ドラム画面.nヒット数_Auto含まない.Drums.Miss; - int totalCombo = (int)OpenTaiko.stage演奏ドラム画面.actCombo.n現在のコンボ数.最高値[0]; - - int individualGoods = OpenTaiko.stage演奏ドラム画面.n良[NowShowingNumber]; - int individualOks = OpenTaiko.stage演奏ドラム画面.n可[NowShowingNumber]; - int individualBads = OpenTaiko.stage演奏ドラム画面.n不可[NowShowingNumber]; - int individualCombo = OpenTaiko.stage演奏ドラム画面.nHighestCombo[NowShowingNumber]; - - int totalADLIBs = OpenTaiko.stage演奏ドラム画面.CChartScore[0].nADLIB; - int totalMines = OpenTaiko.stage演奏ドラム画面.CChartScore[0].nMine; - - int individualADLIBs = OpenTaiko.stage演奏ドラム画面.nADLIB[NowShowingNumber]; - int individualMines = OpenTaiko.stage演奏ドラム画面.nMine[NowShowingNumber]; - - double accuracy = (totalGoods * 100 + totalOks * 50) / (double)(totalGoods + totalOks + totalBads); - double individualAccuracy = (individualGoods * 100 + individualOks * 50) / (double)(individualGoods + individualOks + individualBads); + // Challenges that are judged when there are no remaining notes + if (ExamChange[i] ? songsnotesremain[NowShowingNumber] <= 0 : notesremain <= 0) { + // 残り音符数ゼロ + switch (Challenge[i].GetExamType()) { + case Exam.Type.Gauge: + if (Challenge[i].Amount < Challenge[i].Value[0]) Challenge[i].SetReached(true); + break; + case Exam.Type.Accuracy: + if (Challenge[i].Amount < Challenge[i].Value[0]) Challenge[i].SetReached(true); + break; + default: + // 何もしない + break; + } + } + // Challenges that are monitored in live switch (Challenge[i].GetExamType()) { - case Exam.Type.Gauge: - isChangedAmount = Challenge[i].Update((int)OpenTaiko.stage演奏ドラム画面.actGauge.db現在のゲージ値[0]); - break; case Exam.Type.JudgePerfect: - isChangedAmount = Challenge[i].Update(ExamChange[i] ? individualGoods : totalGoods); - break; case Exam.Type.JudgeGood: - isChangedAmount = Challenge[i].Update(ExamChange[i] ? individualOks : totalOks); - break; case Exam.Type.JudgeBad: - isChangedAmount = Challenge[i].Update(ExamChange[i] ? individualBads : totalBads); - break; - case Exam.Type.JudgeADLIB: - isChangedAmount = Challenge[i].Update(ExamChange[i] ? individualADLIBs : totalADLIBs); - break; - case Exam.Type.JudgeMine: - isChangedAmount = Challenge[i].Update(ExamChange[i] ? individualMines : totalMines); - break; - case Exam.Type.Score: - isChangedAmount = Challenge[i].Update((int)OpenTaiko.stage演奏ドラム画面.actScore.GetScore(0)); - break; - case Exam.Type.Roll: - isChangedAmount = Challenge[i].Update(ExamChange[i] ? OpenTaiko.stage演奏ドラム画面.n連打[NowShowingNumber] : (int)(OpenTaiko.stage演奏ドラム画面.GetRoll(0))); - break; - case Exam.Type.Hit: - isChangedAmount = Challenge[i].Update(ExamChange[i] ? OpenTaiko.stage演奏ドラム画面.n良[NowShowingNumber] + OpenTaiko.stage演奏ドラム画面.n可[NowShowingNumber] + OpenTaiko.stage演奏ドラム画面.n連打[NowShowingNumber] : (int)(OpenTaiko.stage演奏ドラム画面.nヒット数_Auto含む.Drums.Perfect + OpenTaiko.stage演奏ドラム画面.nヒット数_Auto含まない.Drums.Perfect + OpenTaiko.stage演奏ドラム画面.nヒット数_Auto含む.Drums.Great + OpenTaiko.stage演奏ドラム画面.nヒット数_Auto含まない.Drums.Great + OpenTaiko.stage演奏ドラム画面.GetRoll(0))); + if (ExamChange[i] + ? songsnotesremain[NowShowingNumber] < (Challenge[i].Value[0] - Challenge[i].Amount) + : notesremain < (Challenge[i].Value[0] - Challenge[i].Amount)) Challenge[i].SetReached(true); break; case Exam.Type.Combo: - isChangedAmount = Challenge[i].Update(ExamChange[i] ? individualCombo : totalCombo); - break; - case Exam.Type.Accuracy: - isChangedAmount = Challenge[i].Update(ExamChange[i] ? (int)individualAccuracy : (int)accuracy); + if (notesremain + OpenTaiko.stage演奏ドラム画面.actCombo.n現在のコンボ数.P1 < ((Challenge[i].Value[0])) + && OpenTaiko.stage演奏ドラム画面.actCombo.n現在のコンボ数.最高値[0] < (Challenge[i].Value[0])) Challenge[i].SetReached(true); break; default: break; } - // 値が変更されていたらアニメーションを行う。 - if (isChangedAmount) { - if (Status[i].Timer_Amount != null && Status[i].Timer_Amount.IsUnEnded) { - Status[i].Timer_Amount = new CCounter(0, 11, 12, OpenTaiko.Timer); - Status[i].Timer_Amount.CurrentValue = 1; - } else { - Status[i].Timer_Amount = new CCounter(0, 11, 12, OpenTaiko.Timer); - } - } + // 音源が終了したやつの分岐。 + // ( CDTXMania.DTX.listChip.Count > 0 ) ? CDTXMania.DTX.listChip[ CDTXMania.DTX.listChip.Count - 1 ].n発声時刻ms : 0; - // 条件の達成見込みがあるかどうか判断する。 - if (Challenge[i].GetExamRange() == Exam.Range.Less) { - Challenge[i].SetReached(!Challenge[i].IsCleared[0]); - } else { - songsnotesremain[NowShowingNumber] = OpenTaiko.DTX.nDan_NotesCount[NowShowingNumber] - - (OpenTaiko.stage演奏ドラム画面.n良[NowShowingNumber] - + OpenTaiko.stage演奏ドラム画面.n可[NowShowingNumber] - + OpenTaiko.stage演奏ドラム画面.n不可[NowShowingNumber]); + // Check challenge fails at the end of each songs - /* - notesremain = TJAPlayer3.DTX.nノーツ数[3] - - (TJAPlayer3.stage演奏ドラム画面.nヒット数_Auto含む.Drums.Perfect - + TJAPlayer3.stage演奏ドラム画面.nヒット数_Auto含まない.Drums.Perfect) - - (TJAPlayer3.stage演奏ドラム画面.nヒット数_Auto含む.Drums.Great - + TJAPlayer3.stage演奏ドラム画面.nヒット数_Auto含まない.Drums.Great) - - (TJAPlayer3.stage演奏ドラム画面.nヒット数_Auto含む.Drums.Miss - + TJAPlayer3.stage演奏ドラム画面.nヒット数_Auto含まない.Drums.Miss); - */ - - notesremain = OpenTaiko.DTX.nノーツ数[3] - - (OpenTaiko.stage演奏ドラム画面.CChartScore[0].nGood - + OpenTaiko.stage演奏ドラム画面.CChartScore[0].nGreat - + OpenTaiko.stage演奏ドラム画面.CChartScore[0].nMiss); - - // 残り音符数が0になったときに判断されるやつ - - // Challenges that are judged when there are no remaining notes - if (ExamChange[i] ? songsnotesremain[NowShowingNumber] <= 0 : notesremain <= 0) { - // 残り音符数ゼロ + if (OpenTaiko.DTX.listChip.Count > 0) { + if (ExamChange[i] + ? OpenTaiko.DTX.pDan_LastChip[NowShowingNumber].n発声時刻ms <= SoundManager.PlayTimer.NowTime//TJAPlayer3.Timer.n現在時刻 + : OpenTaiko.DTX.listChip[OpenTaiko.DTX.listChip.Count - 1].n発声時刻ms <= SoundManager.PlayTimer.NowTime)//TJAPlayer3.Timer.n現在時刻) + { switch (Challenge[i].GetExamType()) { - case Exam.Type.Gauge: - if (Challenge[i].Amount < Challenge[i].Value[0]) Challenge[i].SetReached(true); - break; - case Exam.Type.Accuracy: + case Exam.Type.Score: + case Exam.Type.Hit: + // Should be checked in live "If no remaining roll" + case Exam.Type.Roll: + // Should be checked in live "If no remaining ADLIB/Mine" + case Exam.Type.JudgeADLIB: + case Exam.Type.JudgeMine: if (Challenge[i].Amount < Challenge[i].Value[0]) Challenge[i].SetReached(true); break; default: - // 何もしない break; } } + } - // Challenges that are monitored in live - switch (Challenge[i].GetExamType()) { - case Exam.Type.JudgePerfect: - case Exam.Type.JudgeGood: - case Exam.Type.JudgeBad: - if (ExamChange[i] - ? songsnotesremain[NowShowingNumber] < (Challenge[i].Value[0] - Challenge[i].Amount) - : notesremain < (Challenge[i].Value[0] - Challenge[i].Amount)) Challenge[i].SetReached(true); - break; - case Exam.Type.Combo: - if (notesremain + OpenTaiko.stage演奏ドラム画面.actCombo.n現在のコンボ数.P1 < ((Challenge[i].Value[0])) - && OpenTaiko.stage演奏ドラム画面.actCombo.n現在のコンボ数.最高値[0] < (Challenge[i].Value[0])) Challenge[i].SetReached(true); - break; - default: - break; - } - - // 音源が終了したやつの分岐。 - // ( CDTXMania.DTX.listChip.Count > 0 ) ? CDTXMania.DTX.listChip[ CDTXMania.DTX.listChip.Count - 1 ].n発声時刻ms : 0; - - // Check challenge fails at the end of each songs - - if (OpenTaiko.DTX.listChip.Count > 0) { - if (ExamChange[i] - ? OpenTaiko.DTX.pDan_LastChip[NowShowingNumber].n発声時刻ms <= SoundManager.PlayTimer.NowTime//TJAPlayer3.Timer.n現在時刻 - : OpenTaiko.DTX.listChip[OpenTaiko.DTX.listChip.Count - 1].n発声時刻ms <= SoundManager.PlayTimer.NowTime)//TJAPlayer3.Timer.n現在時刻) - { - switch (Challenge[i].GetExamType()) { - case Exam.Type.Score: - case Exam.Type.Hit: - // Should be checked in live "If no remaining roll" - case Exam.Type.Roll: - // Should be checked in live "If no remaining ADLIB/Mine" - case Exam.Type.JudgeADLIB: - case Exam.Type.JudgeMine: - if (Challenge[i].Amount < Challenge[i].Value[0]) Challenge[i].SetReached(true); - break; - default: - break; - } - } - } - - /* - if (!IsEnded[NowShowingNumber]) + /* + if (!IsEnded[NowShowingNumber]) + { + if (TJAPlayer3.DTX.listChip.Count <= 0) continue; + if (ExamChange[i] + ? TJAPlayer3.DTX.pDan_LastChip[NowShowingNumber].n発声時刻ms <= CSound管理.rc演奏用タイマ.n現在時刻//TJAPlayer3.Timer.n現在時刻 + : TJAPlayer3.DTX.listChip[TJAPlayer3.DTX.listChip.Count - 1].n発声時刻ms <= CSound管理.rc演奏用タイマ.n現在時刻)//TJAPlayer3.Timer.n現在時刻) { - if (TJAPlayer3.DTX.listChip.Count <= 0) continue; - if (ExamChange[i] - ? TJAPlayer3.DTX.pDan_LastChip[NowShowingNumber].n発声時刻ms <= CSound管理.rc演奏用タイマ.n現在時刻//TJAPlayer3.Timer.n現在時刻 - : TJAPlayer3.DTX.listChip[TJAPlayer3.DTX.listChip.Count - 1].n発声時刻ms <= CSound管理.rc演奏用タイマ.n現在時刻)//TJAPlayer3.Timer.n現在時刻) - { - IsEnded[NowShowingNumber] = true; - } + IsEnded[NowShowingNumber] = true; } - */ - } - if (oldReached == false && Challenge[i].GetReached() == true) { - Sound_Failed?.PlayStart(); - } + } + */ + } + if (oldReached == false && Challenge[i].GetReached() == true) { + Sound_Failed?.PlayStart(); } } + } - public override void DeActivate() { - for (int i = 0; i < CExamInfo.cMaxExam; i++) { - Challenge[i] = null; - } - - for (int i = 0; i < CExamInfo.cMaxExam; i++) { - Status[i].Timer_Amount = null; - Status[i].Timer_Gauge = null; - Status[i].Timer_Failed = null; - } - for (int i = 0; i < IsEnded.Length; i++) - IsEnded[i] = false; - - OpenTaiko.tDisposeSafely(ref this.pfExamFont); - - Dan_Plate?.Dispose(); - - base.DeActivate(); + public override void DeActivate() { + for (int i = 0; i < CExamInfo.cMaxExam; i++) { + Challenge[i] = null; } - public override void CreateManagedResource() { - Sound_Section = OpenTaiko.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}Dan{Path.DirectorySeparatorChar}Section.ogg"), ESoundGroup.SoundEffect); - Sound_Section_First = OpenTaiko.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}Dan{Path.DirectorySeparatorChar}Section_First.wav"), ESoundGroup.SoundEffect); - Sound_Failed = OpenTaiko.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}Dan{Path.DirectorySeparatorChar}Failed.ogg"), ESoundGroup.SoundEffect); - base.CreateManagedResource(); + for (int i = 0; i < CExamInfo.cMaxExam; i++) { + Status[i].Timer_Amount = null; + Status[i].Timer_Gauge = null; + Status[i].Timer_Failed = null; } + for (int i = 0; i < IsEnded.Length; i++) + IsEnded[i] = false; - public override void ReleaseManagedResource() { - Sound_Section_First?.Dispose(); - Sound_Section?.tDispose(); - Sound_Failed?.tDispose(); - base.ReleaseManagedResource(); - } + OpenTaiko.tDisposeSafely(ref this.pfExamFont); - public override int Draw() { - if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] != (int)Difficulty.Dan) return base.Draw(); - Counter_In?.Tick(); - Counter_Wait?.Tick(); - Counter_Out?.Tick(); - Counter_Text?.Tick(); + Dan_Plate?.Dispose(); - if (Counter_Text != null) { - if (Counter_Text.CurrentValue >= 2000) { - for (int i = Counter_Text_Old; i < Counter_Text.CurrentValue; i++) { - if (i % 2 == 0) { - if (OpenTaiko.DTX.List_DanSongs[NowShowingNumber].TitleTex != null) { - OpenTaiko.DTX.List_DanSongs[NowShowingNumber].TitleTex.Opacity--; - } - if (OpenTaiko.DTX.List_DanSongs[NowShowingNumber].SubTitleTex != null) { - OpenTaiko.DTX.List_DanSongs[NowShowingNumber].SubTitleTex.Opacity--; - } + base.DeActivate(); + } + + public override void CreateManagedResource() { + Sound_Section = OpenTaiko.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}Dan{Path.DirectorySeparatorChar}Section.ogg"), ESoundGroup.SoundEffect); + Sound_Section_First = OpenTaiko.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}Dan{Path.DirectorySeparatorChar}Section_First.wav"), ESoundGroup.SoundEffect); + Sound_Failed = OpenTaiko.SoundManager.tCreateSound(CSkin.Path(@$"Sounds{Path.DirectorySeparatorChar}Dan{Path.DirectorySeparatorChar}Failed.ogg"), ESoundGroup.SoundEffect); + base.CreateManagedResource(); + } + + public override void ReleaseManagedResource() { + Sound_Section_First?.Dispose(); + Sound_Section?.tDispose(); + Sound_Failed?.tDispose(); + base.ReleaseManagedResource(); + } + + public override int Draw() { + if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] != (int)Difficulty.Dan) return base.Draw(); + Counter_In?.Tick(); + Counter_Wait?.Tick(); + Counter_Out?.Tick(); + Counter_Text?.Tick(); + + if (Counter_Text != null) { + if (Counter_Text.CurrentValue >= 2000) { + for (int i = Counter_Text_Old; i < Counter_Text.CurrentValue; i++) { + if (i % 2 == 0) { + if (OpenTaiko.DTX.List_DanSongs[NowShowingNumber].TitleTex != null) { + OpenTaiko.DTX.List_DanSongs[NowShowingNumber].TitleTex.Opacity--; + } + if (OpenTaiko.DTX.List_DanSongs[NowShowingNumber].SubTitleTex != null) { + OpenTaiko.DTX.List_DanSongs[NowShowingNumber].SubTitleTex.Opacity--; } } - } else { - if (OpenTaiko.DTX.List_DanSongs[NowShowingNumber].TitleTex != null) { - OpenTaiko.DTX.List_DanSongs[NowShowingNumber].TitleTex.Opacity = 255; - } - if (OpenTaiko.DTX.List_DanSongs[NowShowingNumber].SubTitleTex != null) { - OpenTaiko.DTX.List_DanSongs[NowShowingNumber].SubTitleTex.Opacity = 255; - } } - Counter_Text_Old = Counter_Text.CurrentValue; - } - - for (int i = 0; i < CExamInfo.cMaxExam; i++) { - Status[i].Timer_Amount?.Tick(); - } - - // 背景を描画する。 - - OpenTaiko.Tx.DanC_Background?.t2D描画(0, 0); - - DrawExam(Challenge); - - // 幕のアニメーション - if (Counter_In != null) { - if (Counter_In.IsUnEnded) { - for (int i = Counter_In_Old; i < Counter_In.CurrentValue; i++) { - ScreenPoint[0] += (OpenTaiko.Skin.Game_Lane_X[0] - ScreenPoint[0]) / 180.0; - ScreenPoint[1] += ((OpenTaiko.Skin.Resolution[0] / 2 + OpenTaiko.Skin.Game_Lane_X[0] / 2) - ScreenPoint[1]) / 180.0; - } - Counter_In_Old = Counter_In.CurrentValue; - OpenTaiko.Tx.DanC_Screen?.t2D描画((int)ScreenPoint[0], OpenTaiko.Skin.Game_Lane_Y[0], new Rectangle(0, 0, OpenTaiko.Tx.DanC_Screen.szTextureSize.Width / 2, OpenTaiko.Tx.DanC_Screen.szTextureSize.Height)); - OpenTaiko.Tx.DanC_Screen?.t2D描画((int)ScreenPoint[1], OpenTaiko.Skin.Game_Lane_Y[0], new Rectangle(OpenTaiko.Tx.DanC_Screen.szTextureSize.Width / 2, 0, OpenTaiko.Tx.DanC_Screen.szTextureSize.Width / 2, OpenTaiko.Tx.DanC_Screen.szTextureSize.Height)); - //CDTXMania.act文字コンソール.tPrint(0, 420, C文字コンソール.Eフォント種別.白, String.Format("{0} : {1}", ScreenPoint[0], ScreenPoint[1])); + } else { + if (OpenTaiko.DTX.List_DanSongs[NowShowingNumber].TitleTex != null) { + OpenTaiko.DTX.List_DanSongs[NowShowingNumber].TitleTex.Opacity = 255; } - if (Counter_In.IsEnded) { - Counter_In = null; - Counter_Wait = new CCounter(0, 2299, 1, OpenTaiko.Timer); + if (OpenTaiko.DTX.List_DanSongs[NowShowingNumber].SubTitleTex != null) { + OpenTaiko.DTX.List_DanSongs[NowShowingNumber].SubTitleTex.Opacity = 255; } } + Counter_Text_Old = Counter_Text.CurrentValue; + } - if (Counter_Wait != null) { - if (Counter_Wait.IsUnEnded) { - OpenTaiko.Tx.DanC_Screen?.t2D描画(OpenTaiko.Skin.Game_Lane_X[0], OpenTaiko.Skin.Game_Lane_Y[0]); + for (int i = 0; i < CExamInfo.cMaxExam; i++) { + Status[i].Timer_Amount?.Tick(); + } - if (NowShowingNumber != 0) { - if (Counter_Wait.CurrentValue >= 800) { - if (!bExamChangeCheck) { - for (int i = 0; i < CExamInfo.cMaxExam; i++) - ExamChange[i] = false; + // 背景を描画する。 - for (int j = 0; j < CExamInfo.cMaxExam; j++) { - if (OpenTaiko.stageSongSelect.rChoosenSong.DanSongs[0].Dan_C[j] != null) { - if (OpenTaiko.stageSongSelect.rChoosenSong.DanSongs[OpenTaiko.stageSongSelect.rChoosenSong.DanSongs.Count - 1].Dan_C[j] != null) //個別の条件がありますよー - { - Challenge[j] = OpenTaiko.stageSongSelect.rChoosenSong.DanSongs[NowShowingNumber].Dan_C[j]; - ExamChange[j] = true; - } + OpenTaiko.Tx.DanC_Background?.t2D描画(0, 0); + + DrawExam(Challenge); + + // 幕のアニメーション + if (Counter_In != null) { + if (Counter_In.IsUnEnded) { + for (int i = Counter_In_Old; i < Counter_In.CurrentValue; i++) { + ScreenPoint[0] += (OpenTaiko.Skin.Game_Lane_X[0] - ScreenPoint[0]) / 180.0; + ScreenPoint[1] += ((OpenTaiko.Skin.Resolution[0] / 2 + OpenTaiko.Skin.Game_Lane_X[0] / 2) - ScreenPoint[1]) / 180.0; + } + Counter_In_Old = Counter_In.CurrentValue; + OpenTaiko.Tx.DanC_Screen?.t2D描画((int)ScreenPoint[0], OpenTaiko.Skin.Game_Lane_Y[0], new Rectangle(0, 0, OpenTaiko.Tx.DanC_Screen.szTextureSize.Width / 2, OpenTaiko.Tx.DanC_Screen.szTextureSize.Height)); + OpenTaiko.Tx.DanC_Screen?.t2D描画((int)ScreenPoint[1], OpenTaiko.Skin.Game_Lane_Y[0], new Rectangle(OpenTaiko.Tx.DanC_Screen.szTextureSize.Width / 2, 0, OpenTaiko.Tx.DanC_Screen.szTextureSize.Width / 2, OpenTaiko.Tx.DanC_Screen.szTextureSize.Height)); + //CDTXMania.act文字コンソール.tPrint(0, 420, C文字コンソール.Eフォント種別.白, String.Format("{0} : {1}", ScreenPoint[0], ScreenPoint[1])); + } + if (Counter_In.IsEnded) { + Counter_In = null; + Counter_Wait = new CCounter(0, 2299, 1, OpenTaiko.Timer); + } + } + + if (Counter_Wait != null) { + if (Counter_Wait.IsUnEnded) { + OpenTaiko.Tx.DanC_Screen?.t2D描画(OpenTaiko.Skin.Game_Lane_X[0], OpenTaiko.Skin.Game_Lane_Y[0]); + + if (NowShowingNumber != 0) { + if (Counter_Wait.CurrentValue >= 800) { + if (!bExamChangeCheck) { + for (int i = 0; i < CExamInfo.cMaxExam; i++) + ExamChange[i] = false; + + for (int j = 0; j < CExamInfo.cMaxExam; j++) { + if (OpenTaiko.stageSongSelect.rChoosenSong.DanSongs[0].Dan_C[j] != null) { + if (OpenTaiko.stageSongSelect.rChoosenSong.DanSongs[OpenTaiko.stageSongSelect.rChoosenSong.DanSongs.Count - 1].Dan_C[j] != null) //個別の条件がありますよー + { + Challenge[j] = OpenTaiko.stageSongSelect.rChoosenSong.DanSongs[NowShowingNumber].Dan_C[j]; + ExamChange[j] = true; } } - NowCymbolShowingNumber = NowShowingNumber; - bExamChangeCheck = true; } + NowCymbolShowingNumber = NowShowingNumber; + bExamChangeCheck = true; } } } - if (Counter_Wait.IsEnded) { - Counter_Wait = null; - Counter_Out = new CCounter(0, 90, 3, OpenTaiko.Timer); - Counter_Text = new CCounter(0, 2899, 1, OpenTaiko.Timer); + } + if (Counter_Wait.IsEnded) { + Counter_Wait = null; + Counter_Out = new CCounter(0, 90, 3, OpenTaiko.Timer); + Counter_Text = new CCounter(0, 2899, 1, OpenTaiko.Timer); + } + } + if (Counter_Text != null) { + if (Counter_Text.IsUnEnded) { + var title = OpenTaiko.DTX.List_DanSongs[NowShowingNumber].TitleTex; + var subTitle = OpenTaiko.DTX.List_DanSongs[NowShowingNumber].SubTitleTex; + if (subTitle == null) + title?.t2D拡大率考慮中央基準描画(OpenTaiko.Skin.Game_DanC_Title_X[0], OpenTaiko.Skin.Game_DanC_Title_Y[0]); + else { + title?.t2D拡大率考慮中央基準描画(OpenTaiko.Skin.Game_DanC_Title_X[1], OpenTaiko.Skin.Game_DanC_Title_Y[1]); + subTitle?.t2D拡大率考慮中央基準描画(OpenTaiko.Skin.Game_DanC_SubTitle[0], OpenTaiko.Skin.Game_DanC_SubTitle[1]); } } - if (Counter_Text != null) { - if (Counter_Text.IsUnEnded) { - var title = OpenTaiko.DTX.List_DanSongs[NowShowingNumber].TitleTex; - var subTitle = OpenTaiko.DTX.List_DanSongs[NowShowingNumber].SubTitleTex; - if (subTitle == null) - title?.t2D拡大率考慮中央基準描画(OpenTaiko.Skin.Game_DanC_Title_X[0], OpenTaiko.Skin.Game_DanC_Title_Y[0]); - else { - title?.t2D拡大率考慮中央基準描画(OpenTaiko.Skin.Game_DanC_Title_X[1], OpenTaiko.Skin.Game_DanC_Title_Y[1]); - subTitle?.t2D拡大率考慮中央基準描画(OpenTaiko.Skin.Game_DanC_SubTitle[0], OpenTaiko.Skin.Game_DanC_SubTitle[1]); - } - } - if (Counter_Text.IsEnded) { - Counter_Text = null; - IsAnimating = false; - } + if (Counter_Text.IsEnded) { + Counter_Text = null; + IsAnimating = false; } - if (Counter_Out != null) { - if (Counter_Out.IsUnEnded) { - ScreenPoint[0] = OpenTaiko.Skin.Game_Lane_X[0] - Math.Sin(Counter_Out.CurrentValue * (Math.PI / 180)) * 500; - ScreenPoint[1] = OpenTaiko.Skin.Game_Lane_X[0] + OpenTaiko.Tx.DanC_Screen.szTextureSize.Width / 2 + Math.Sin(Counter_Out.CurrentValue * (Math.PI / 180)) * 500; - OpenTaiko.Tx.DanC_Screen?.t2D描画((int)ScreenPoint[0], OpenTaiko.Skin.Game_Lane_Y[0], new Rectangle(0, 0, OpenTaiko.Tx.DanC_Screen.szTextureSize.Width / 2, OpenTaiko.Tx.DanC_Screen.szTextureSize.Height)); - OpenTaiko.Tx.DanC_Screen?.t2D描画((int)ScreenPoint[1], OpenTaiko.Skin.Game_Lane_Y[0], new Rectangle(OpenTaiko.Tx.DanC_Screen.szTextureSize.Width / 2, 0, OpenTaiko.Tx.DanC_Screen.szTextureSize.Width / 2, OpenTaiko.Tx.DanC_Screen.szTextureSize.Height)); - //CDTXMania.act文字コンソール.tPrint(0, 420, C文字コンソール.Eフォント種別.白, String.Format("{0} : {1}", ScreenPoint[0], ScreenPoint[1])); - } - if (Counter_Out.IsEnded) { - Counter_Out = null; - } + } + if (Counter_Out != null) { + if (Counter_Out.IsUnEnded) { + ScreenPoint[0] = OpenTaiko.Skin.Game_Lane_X[0] - Math.Sin(Counter_Out.CurrentValue * (Math.PI / 180)) * 500; + ScreenPoint[1] = OpenTaiko.Skin.Game_Lane_X[0] + OpenTaiko.Tx.DanC_Screen.szTextureSize.Width / 2 + Math.Sin(Counter_Out.CurrentValue * (Math.PI / 180)) * 500; + OpenTaiko.Tx.DanC_Screen?.t2D描画((int)ScreenPoint[0], OpenTaiko.Skin.Game_Lane_Y[0], new Rectangle(0, 0, OpenTaiko.Tx.DanC_Screen.szTextureSize.Width / 2, OpenTaiko.Tx.DanC_Screen.szTextureSize.Height)); + OpenTaiko.Tx.DanC_Screen?.t2D描画((int)ScreenPoint[1], OpenTaiko.Skin.Game_Lane_Y[0], new Rectangle(OpenTaiko.Tx.DanC_Screen.szTextureSize.Width / 2, 0, OpenTaiko.Tx.DanC_Screen.szTextureSize.Width / 2, OpenTaiko.Tx.DanC_Screen.szTextureSize.Height)); + //CDTXMania.act文字コンソール.tPrint(0, 420, C文字コンソール.Eフォント種別.白, String.Format("{0} : {1}", ScreenPoint[0], ScreenPoint[1])); + } + if (Counter_Out.IsEnded) { + Counter_Out = null; } - - #region [Dan Plate] - - CActSelect段位リスト.tDisplayDanPlate(Dan_Plate, - null, - OpenTaiko.Skin.Game_DanC_Dan_Plate[0], - OpenTaiko.Skin.Game_DanC_Dan_Plate[1]); - - #endregion - - /* - TJAPlayer3.act文字コンソール.tPrint(0, 0, C文字コンソール.Eフォント種別.白, TJAPlayer3.DTX.pDan_LastChip[NowShowingNumber].n発声時刻ms + " / " + CSound管理.rc演奏用タイマ.n現在時刻); - - TJAPlayer3.act文字コンソール.tPrint(100, 20, C文字コンソール.Eフォント種別.白, TJAPlayer3.DTX.pDan_LastChip[NowShowingNumber].n発声時刻ms.ToString()); - TJAPlayer3.act文字コンソール.tPrint(100, 40, C文字コンソール.Eフォント種別.白, TJAPlayer3.DTX.listChip[TJAPlayer3.DTX.listChip.Count - 1].n発声時刻ms.ToString()); - TJAPlayer3.act文字コンソール.tPrint(100, 60, C文字コンソール.Eフォント種別.白, TJAPlayer3.Timer.n現在時刻.ToString()); - */ - - // Challenges that are judged when the song stops - - return base.Draw(); } - // Regular ingame exams draw - public void DrawExam(Dan_C[] dan_C, bool isResult = false, int offX = 0) { - int count = 0; - int countNoGauge = 0; + #region [Dan Plate] - // Count exams, both with and without gauge - for (int i = 0; i < CExamInfo.cMaxExam; i++) { - if (dan_C[i] != null && dan_C[i].GetEnable() == true) { - count++; - if (dan_C[i].GetExamType() != Exam.Type.Gauge) - countNoGauge++; - } + CActSelect段位リスト.tDisplayDanPlate(Dan_Plate, + null, + OpenTaiko.Skin.Game_DanC_Dan_Plate[0], + OpenTaiko.Skin.Game_DanC_Dan_Plate[1]); + #endregion + + /* + TJAPlayer3.act文字コンソール.tPrint(0, 0, C文字コンソール.Eフォント種別.白, TJAPlayer3.DTX.pDan_LastChip[NowShowingNumber].n発声時刻ms + " / " + CSound管理.rc演奏用タイマ.n現在時刻); + + TJAPlayer3.act文字コンソール.tPrint(100, 20, C文字コンソール.Eフォント種別.白, TJAPlayer3.DTX.pDan_LastChip[NowShowingNumber].n発声時刻ms.ToString()); + TJAPlayer3.act文字コンソール.tPrint(100, 40, C文字コンソール.Eフォント種別.白, TJAPlayer3.DTX.listChip[TJAPlayer3.DTX.listChip.Count - 1].n発声時刻ms.ToString()); + TJAPlayer3.act文字コンソール.tPrint(100, 60, C文字コンソール.Eフォント種別.白, TJAPlayer3.Timer.n現在時刻.ToString()); + */ + + // Challenges that are judged when the song stops + + return base.Draw(); + } + + // Regular ingame exams draw + public void DrawExam(Dan_C[] dan_C, bool isResult = false, int offX = 0) { + int count = 0; + int countNoGauge = 0; + + // Count exams, both with and without gauge + for (int i = 0; i < CExamInfo.cMaxExam; i++) { + if (dan_C[i] != null && dan_C[i].GetEnable() == true) { + count++; + if (dan_C[i].GetExamType() != Exam.Type.Gauge) + countNoGauge++; } - // Bar position on the cert - int currentPosition = -1; + } - for (int i = 0; i < CExamInfo.cMaxExam; i++) { - if (dan_C[i] == null || dan_C[i].GetEnable() != true) - continue; + // Bar position on the cert + int currentPosition = -1; - if (dan_C[i].GetExamType() != Exam.Type.Gauge - || isResult) { - if (dan_C[i].GetExamType() != Exam.Type.Gauge) - currentPosition++; + for (int i = 0; i < CExamInfo.cMaxExam; i++) { + if (dan_C[i] == null || dan_C[i].GetEnable() != true) + continue; - // Determines if a small bar will be used to optimise the display layout - bool isSmallGauge = currentPosition >= 3 || (countNoGauge > 3 && countNoGauge % 3 > currentPosition) || countNoGauge == 6; + if (dan_C[i].GetExamType() != Exam.Type.Gauge + || isResult) { + if (dan_C[i].GetExamType() != Exam.Type.Gauge) + currentPosition++; - // Y index of the gauge - int yIndex = (currentPosition % 3) + 1; + // Determines if a small bar will be used to optimise the display layout + bool isSmallGauge = currentPosition >= 3 || (countNoGauge > 3 && countNoGauge % 3 > currentPosition) || countNoGauge == 6; - // Specific case for gauge - if (dan_C[i].GetExamType() == Exam.Type.Gauge) { - yIndex = 0; - isSmallGauge = false; - } + // Y index of the gauge + int yIndex = (currentPosition % 3) + 1; + + // Specific case for gauge + if (dan_C[i].GetExamType() == Exam.Type.Gauge) { + yIndex = 0; + isSmallGauge = false; + } - // Panel origin - int xOrigin = (isResult) ? OpenTaiko.Skin.DanResult_Exam[0] + offX : OpenTaiko.Skin.Game_DanC_X[1]; - int yOrigin = (isResult) ? OpenTaiko.Skin.DanResult_Exam[1] : OpenTaiko.Skin.Game_DanC_Y[1]; + // Panel origin + int xOrigin = (isResult) ? OpenTaiko.Skin.DanResult_Exam[0] + offX : OpenTaiko.Skin.Game_DanC_X[1]; + int yOrigin = (isResult) ? OpenTaiko.Skin.DanResult_Exam[1] : OpenTaiko.Skin.Game_DanC_Y[1]; - // Origin position which will be used as a reference for bar elements - int barXOffset = xOrigin + (currentPosition >= 3 ? OpenTaiko.Skin.Game_DanC_Base_Offset_X[1] : OpenTaiko.Skin.Game_DanC_Base_Offset_X[0]); - int barYOffset = yOrigin + (currentPosition >= 3 ? OpenTaiko.Skin.Game_DanC_Base_Offset_Y[1] : OpenTaiko.Skin.Game_DanC_Base_Offset_Y[0]) + OpenTaiko.Skin.Game_DanC_Size[1] * yIndex + (yIndex * OpenTaiko.Skin.Game_DanC_Padding); + // Origin position which will be used as a reference for bar elements + int barXOffset = xOrigin + (currentPosition >= 3 ? OpenTaiko.Skin.Game_DanC_Base_Offset_X[1] : OpenTaiko.Skin.Game_DanC_Base_Offset_X[0]); + int barYOffset = yOrigin + (currentPosition >= 3 ? OpenTaiko.Skin.Game_DanC_Base_Offset_Y[1] : OpenTaiko.Skin.Game_DanC_Base_Offset_Y[0]) + OpenTaiko.Skin.Game_DanC_Size[1] * yIndex + (yIndex * OpenTaiko.Skin.Game_DanC_Padding); - // Small bar - int lowerBarYOffset = barYOffset + OpenTaiko.Skin.Game_DanC_Size[1] + OpenTaiko.Skin.Game_DanC_Padding; + // Small bar + int lowerBarYOffset = barYOffset + OpenTaiko.Skin.Game_DanC_Size[1] + OpenTaiko.Skin.Game_DanC_Padding; - // Skin X : 70 - // Skin Y : 292 + // Skin X : 70 + // Skin Y : 292 - #region [Gauge base] + #region [Gauge base] - if (!isSmallGauge) - OpenTaiko.Tx.DanC_Base?.t2D描画(barXOffset, barYOffset, new RectangleF(0, ExamChange[i] ? OpenTaiko.Tx.DanC_Base.szTextureSize.Height / 2 : 0, OpenTaiko.Tx.DanC_Base.szTextureSize.Width, OpenTaiko.Tx.DanC_Base.szTextureSize.Height / 2)); - else - OpenTaiko.Tx.DanC_Base_Small?.t2D描画(barXOffset, barYOffset, new RectangleF(0, ExamChange[i] ? OpenTaiko.Tx.DanC_Base_Small.szTextureSize.Height / 2 : 0, OpenTaiko.Tx.DanC_Base_Small.szTextureSize.Width, OpenTaiko.Tx.DanC_Base_Small.szTextureSize.Height / 2)); + if (!isSmallGauge) + OpenTaiko.Tx.DanC_Base?.t2D描画(barXOffset, barYOffset, new RectangleF(0, ExamChange[i] ? OpenTaiko.Tx.DanC_Base.szTextureSize.Height / 2 : 0, OpenTaiko.Tx.DanC_Base.szTextureSize.Width, OpenTaiko.Tx.DanC_Base.szTextureSize.Height / 2)); + else + OpenTaiko.Tx.DanC_Base_Small?.t2D描画(barXOffset, barYOffset, new RectangleF(0, ExamChange[i] ? OpenTaiko.Tx.DanC_Base_Small.szTextureSize.Height / 2 : 0, OpenTaiko.Tx.DanC_Base_Small.szTextureSize.Width, OpenTaiko.Tx.DanC_Base_Small.szTextureSize.Height / 2)); - #endregion + #endregion - #region [Counter wait variables] + #region [Counter wait variables] - int counter800 = (Counter_Wait != null ? Counter_Wait.CurrentValue - 800 : 0); - int counter255M255 = (Counter_Wait != null ? 255 - (Counter_Wait.CurrentValue - (800 - 255)) : 0); + int counter800 = (Counter_Wait != null ? Counter_Wait.CurrentValue - 800 : 0); + int counter255M255 = (Counter_Wait != null ? 255 - (Counter_Wait.CurrentValue - (800 - 255)) : 0); - #endregion + #endregion - #region [Small bars] + #region [Small bars] - if (ExamChange[i] == true) { - for (int j = 1; j < OpenTaiko.stageSongSelect.rChoosenSong.DanSongs.Count; j++) { + if (ExamChange[i] == true) { + for (int j = 1; j < OpenTaiko.stageSongSelect.rChoosenSong.DanSongs.Count; j++) { - if (!(OpenTaiko.stageSongSelect.rChoosenSong.DanSongs[j - 1].Dan_C[i] != null && OpenTaiko.stageSongSelect.rChoosenSong.DanSongs[NowShowingNumber].Dan_C[i] != null)) - continue; + if (!(OpenTaiko.stageSongSelect.rChoosenSong.DanSongs[j - 1].Dan_C[i] != null && OpenTaiko.stageSongSelect.rChoosenSong.DanSongs[NowShowingNumber].Dan_C[i] != null)) + continue; - // rainbowBetterSuccess (bool) : is current minibar better success ? | drawGaugeTypetwo (int) : Gauge style [0,2] - #region [Success type variables] + // rainbowBetterSuccess (bool) : is current minibar better success ? | drawGaugeTypetwo (int) : Gauge style [0,2] + #region [Success type variables] - bool rainbowBetterSuccess = GetExamStatus(OpenTaiko.stageSongSelect.rChoosenSong.DanSongs[j - 1].Dan_C[i]) == Exam.Status.Better_Success - && GetExamConfirmStatus(OpenTaiko.stageSongSelect.rChoosenSong.DanSongs[j - 1].Dan_C[i]); + bool rainbowBetterSuccess = GetExamStatus(OpenTaiko.stageSongSelect.rChoosenSong.DanSongs[j - 1].Dan_C[i]) == Exam.Status.Better_Success + && GetExamConfirmStatus(OpenTaiko.stageSongSelect.rChoosenSong.DanSongs[j - 1].Dan_C[i]); - int amountToPercent; - int drawGaugeTypetwo = 0; + int amountToPercent; + int drawGaugeTypetwo = 0; - if (!rainbowBetterSuccess) { - amountToPercent = OpenTaiko.stageSongSelect.rChoosenSong.DanSongs[j - 1].Dan_C[i].GetAmountToPercent(); + if (!rainbowBetterSuccess) { + amountToPercent = OpenTaiko.stageSongSelect.rChoosenSong.DanSongs[j - 1].Dan_C[i].GetAmountToPercent(); - if (amountToPercent >= 100) - drawGaugeTypetwo = 2; - else if (OpenTaiko.stageSongSelect.rChoosenSong.DanSongs[j - 1].Dan_C[i].GetExamRange() == Exam.Range.More && amountToPercent >= 70 || amountToPercent > 70) - drawGaugeTypetwo = 1; - } + if (amountToPercent >= 100) + drawGaugeTypetwo = 2; + else if (OpenTaiko.stageSongSelect.rChoosenSong.DanSongs[j - 1].Dan_C[i].GetExamRange() == Exam.Range.More && amountToPercent >= 70 || amountToPercent > 70) + drawGaugeTypetwo = 1; + } - #endregion + #endregion - // Small bar elements base opacity - #region [Default opacity] + // Small bar elements base opacity + #region [Default opacity] - OpenTaiko.Tx.DanC_SmallBase.Opacity = 255; - OpenTaiko.Tx.DanC_Small_ExamCymbol.Opacity = 255; + OpenTaiko.Tx.DanC_SmallBase.Opacity = 255; + OpenTaiko.Tx.DanC_Small_ExamCymbol.Opacity = 255; - OpenTaiko.Tx.Gauge_Dan_Rainbow[0].Opacity = 255; - OpenTaiko.Tx.DanC_MiniNumber.Opacity = 255; + OpenTaiko.Tx.Gauge_Dan_Rainbow[0].Opacity = 255; + OpenTaiko.Tx.DanC_MiniNumber.Opacity = 255; - OpenTaiko.Tx.DanC_Gauge[drawGaugeTypetwo].Opacity = 255; + OpenTaiko.Tx.DanC_Gauge[drawGaugeTypetwo].Opacity = 255; - int miniIconOpacity = 255; + int miniIconOpacity = 255; - #endregion + #endregion - // Currently showing song parameters - if (NowShowingNumber == j) { - if (Counter_Wait != null && Counter_Wait.CurrentValue >= 800) { - #region [counter800 opacity] + // Currently showing song parameters + if (NowShowingNumber == j) { + if (Counter_Wait != null && Counter_Wait.CurrentValue >= 800) { + #region [counter800 opacity] - OpenTaiko.Tx.DanC_SmallBase.Opacity = counter800; - OpenTaiko.Tx.DanC_Small_ExamCymbol.Opacity = counter800; + OpenTaiko.Tx.DanC_SmallBase.Opacity = counter800; + OpenTaiko.Tx.DanC_Small_ExamCymbol.Opacity = counter800; - OpenTaiko.Tx.Gauge_Dan_Rainbow[0].Opacity = counter800; - OpenTaiko.Tx.DanC_MiniNumber.Opacity = counter800; + OpenTaiko.Tx.Gauge_Dan_Rainbow[0].Opacity = counter800; + OpenTaiko.Tx.DanC_MiniNumber.Opacity = counter800; - OpenTaiko.Tx.DanC_Gauge[drawGaugeTypetwo].Opacity = counter800; + OpenTaiko.Tx.DanC_Gauge[drawGaugeTypetwo].Opacity = counter800; - miniIconOpacity = counter800; + miniIconOpacity = counter800; - #endregion - } else if (Counter_In != null || (Counter_Wait != null && Counter_Wait.CurrentValue < 800)) { - #region [0 opacity] + #endregion + } else if (Counter_In != null || (Counter_Wait != null && Counter_Wait.CurrentValue < 800)) { + #region [0 opacity] - OpenTaiko.Tx.DanC_SmallBase.Opacity = 0; - OpenTaiko.Tx.DanC_Small_ExamCymbol.Opacity = 0; + OpenTaiko.Tx.DanC_SmallBase.Opacity = 0; + OpenTaiko.Tx.DanC_Small_ExamCymbol.Opacity = 0; - OpenTaiko.Tx.Gauge_Dan_Rainbow[0].Opacity = 0; - OpenTaiko.Tx.DanC_MiniNumber.Opacity = 0; + OpenTaiko.Tx.Gauge_Dan_Rainbow[0].Opacity = 0; + OpenTaiko.Tx.DanC_MiniNumber.Opacity = 0; - OpenTaiko.Tx.DanC_Gauge[drawGaugeTypetwo].Opacity = 0; + OpenTaiko.Tx.DanC_Gauge[drawGaugeTypetwo].Opacity = 0; - miniIconOpacity = 0; - - #endregion - } - } - - // Bars starting from the song N - if (NowShowingNumber >= j && (j - NowShowingNumber) > -2) { - // Determine bars width - OpenTaiko.Tx.DanC_SmallBase.vcScaleRatio.X = isSmallGauge ? 0.34f : 1f; - - int smallBarGap = (int)(33f * OpenTaiko.Skin.Resolution[1] / 720f); - - // 815 : Small base (70 + 745) - int miniBarPositionX = barXOffset + (isSmallGauge ? OpenTaiko.Skin.Game_DanC_SmallBase_Offset_X[1] : OpenTaiko.Skin.Game_DanC_SmallBase_Offset_X[0]); - - // 613 + (j - 1) * 33 : Small base (barYoffset for 3rd exam : 494 + 119 + Local song offset (j - 1) * 33) - int miniBarPositionY = (barYOffset + (isSmallGauge ? OpenTaiko.Skin.Game_DanC_SmallBase_Offset_Y[1] : OpenTaiko.Skin.Game_DanC_SmallBase_Offset_Y[0])) + ((j - 1) % 2) * smallBarGap - (OpenTaiko.Skin.Game_DanC_Size[1] + (OpenTaiko.Skin.Game_DanC_Padding)); - - // Display bars - #region [Displayables] - - // Display mini-bar base and small symbol - OpenTaiko.Tx.DanC_SmallBase?.t2D描画(miniBarPositionX, miniBarPositionY); - OpenTaiko.Tx.DanC_Small_ExamCymbol?.t2D描画(miniBarPositionX - 30, miniBarPositionY - 3, new RectangleF(0, (j - 1) * 28, 30, 28)); - - // Display bar content - if (rainbowBetterSuccess) { - OpenTaiko.Tx.Gauge_Dan_Rainbow[0].vcScaleRatio.X = 0.23875f * OpenTaiko.Tx.DanC_SmallBase.vcScaleRatio.X * (isSmallGauge ? 0.94f : 1f); - OpenTaiko.Tx.Gauge_Dan_Rainbow[0].vcScaleRatio.Y = 0.35185f; - - OpenTaiko.Tx.Gauge_Dan_Rainbow[0]?.t2D描画(miniBarPositionX + 3, miniBarPositionY + 2, - new Rectangle(0, 0, (int)(OpenTaiko.stageSongSelect.rChoosenSong.DanSongs[j - 1].Dan_C[i].GetAmountToPercent() * (OpenTaiko.Tx.Gauge_Dan_Rainbow[0].szTextureSize.Width / 100.0)), OpenTaiko.Tx.Gauge_Dan_Rainbow[0].szTextureSize.Height)); - } else { - OpenTaiko.Tx.DanC_Gauge[drawGaugeTypetwo].vcScaleRatio.X = 0.23875f * OpenTaiko.Tx.DanC_SmallBase.vcScaleRatio.X * (isSmallGauge ? 0.94f : 1f); - OpenTaiko.Tx.DanC_Gauge[drawGaugeTypetwo].vcScaleRatio.Y = 0.35185f; - - OpenTaiko.Tx.DanC_Gauge[drawGaugeTypetwo]?.t2D描画(miniBarPositionX + 3, miniBarPositionY + 2, - new Rectangle(0, 0, (int)(OpenTaiko.stageSongSelect.rChoosenSong.DanSongs[j - 1].Dan_C[i].GetAmountToPercent() * (OpenTaiko.Tx.DanC_Gauge[drawGaugeTypetwo].szTextureSize.Width / 100.0)), OpenTaiko.Tx.DanC_Gauge[drawGaugeTypetwo].szTextureSize.Height)); - } - - int _tmpMiniPadding = (int)(14f * OpenTaiko.Skin.Resolution[0] / 1280f); - - // Usually +23 for gold and +17 for white, to test - DrawMiniNumber( - OpenTaiko.stageSongSelect.rChoosenSong.DanSongs[j - 1].Dan_C[i].GetAmount(), - miniBarPositionX + 11, - miniBarPositionY + 20, - _tmpMiniPadding, - OpenTaiko.stageSongSelect.rChoosenSong.DanSongs[j - 1].Dan_C[i]); - - CActSelect段位リスト.tDisplayDanIcon(j, miniBarPositionX + OpenTaiko.Skin.Game_DanC_DanIcon_Offset_Mini[0], miniBarPositionY + OpenTaiko.Skin.Game_DanC_DanIcon_Offset_Mini[1], miniIconOpacity, 0.5f, false); + miniIconOpacity = 0; #endregion } } - } - #endregion + // Bars starting from the song N + if (NowShowingNumber >= j && (j - NowShowingNumber) > -2) { + // Determine bars width + OpenTaiko.Tx.DanC_SmallBase.vcScaleRatio.X = isSmallGauge ? 0.34f : 1f; - #region [Currently playing song icons] + int smallBarGap = (int)(33f * OpenTaiko.Skin.Resolution[1] / 720f); - OpenTaiko.Tx.DanC_ExamCymbol.Opacity = 255; + // 815 : Small base (70 + 745) + int miniBarPositionX = barXOffset + (isSmallGauge ? OpenTaiko.Skin.Game_DanC_SmallBase_Offset_X[1] : OpenTaiko.Skin.Game_DanC_SmallBase_Offset_X[0]); - if (ExamChange[i] && NowShowingNumber != 0) { - if (Counter_Wait != null) { - if (Counter_Wait.CurrentValue >= 800) - OpenTaiko.Tx.DanC_ExamCymbol.Opacity = counter800; - else if (Counter_Wait.CurrentValue >= 800 - 255) - OpenTaiko.Tx.DanC_ExamCymbol.Opacity = counter255M255; - } - } + // 613 + (j - 1) * 33 : Small base (barYoffset for 3rd exam : 494 + 119 + Local song offset (j - 1) * 33) + int miniBarPositionY = (barYOffset + (isSmallGauge ? OpenTaiko.Skin.Game_DanC_SmallBase_Offset_Y[1] : OpenTaiko.Skin.Game_DanC_SmallBase_Offset_Y[0])) + ((j - 1) % 2) * smallBarGap - (OpenTaiko.Skin.Game_DanC_Size[1] + (OpenTaiko.Skin.Game_DanC_Padding)); - //75, 418 - // 292 - 228 = 64 - if (ExamChange[i]) { - OpenTaiko.Tx.DanC_ExamCymbol.t2D描画(barXOffset + 5, lowerBarYOffset - 64, new RectangleF(0, 41 * NowCymbolShowingNumber, 197, 41)); - } + // Display bars + #region [Displayables] - #endregion + // Display mini-bar base and small symbol + OpenTaiko.Tx.DanC_SmallBase?.t2D描画(miniBarPositionX, miniBarPositionY); + OpenTaiko.Tx.DanC_Small_ExamCymbol?.t2D描画(miniBarPositionX - 30, miniBarPositionY - 3, new RectangleF(0, (j - 1) * 28, 30, 28)); - #region [Large bars] + // Display bar content + if (rainbowBetterSuccess) { + OpenTaiko.Tx.Gauge_Dan_Rainbow[0].vcScaleRatio.X = 0.23875f * OpenTaiko.Tx.DanC_SmallBase.vcScaleRatio.X * (isSmallGauge ? 0.94f : 1f); + OpenTaiko.Tx.Gauge_Dan_Rainbow[0].vcScaleRatio.Y = 0.35185f; - // LrainbowBetterSuccess (bool) : is current minibar better success ? | LdrawGaugeTypetwo (int) : Gauge style [0,2] - #region [Success type variables] + OpenTaiko.Tx.Gauge_Dan_Rainbow[0]?.t2D描画(miniBarPositionX + 3, miniBarPositionY + 2, + new Rectangle(0, 0, (int)(OpenTaiko.stageSongSelect.rChoosenSong.DanSongs[j - 1].Dan_C[i].GetAmountToPercent() * (OpenTaiko.Tx.Gauge_Dan_Rainbow[0].szTextureSize.Width / 100.0)), OpenTaiko.Tx.Gauge_Dan_Rainbow[0].szTextureSize.Height)); + } else { + OpenTaiko.Tx.DanC_Gauge[drawGaugeTypetwo].vcScaleRatio.X = 0.23875f * OpenTaiko.Tx.DanC_SmallBase.vcScaleRatio.X * (isSmallGauge ? 0.94f : 1f); + OpenTaiko.Tx.DanC_Gauge[drawGaugeTypetwo].vcScaleRatio.Y = 0.35185f; - bool LrainbowBetterSuccess = GetExamStatus(dan_C[i]) == Exam.Status.Better_Success && GetExamConfirmStatus(dan_C[i]); + OpenTaiko.Tx.DanC_Gauge[drawGaugeTypetwo]?.t2D描画(miniBarPositionX + 3, miniBarPositionY + 2, + new Rectangle(0, 0, (int)(OpenTaiko.stageSongSelect.rChoosenSong.DanSongs[j - 1].Dan_C[i].GetAmountToPercent() * (OpenTaiko.Tx.DanC_Gauge[drawGaugeTypetwo].szTextureSize.Width / 100.0)), OpenTaiko.Tx.DanC_Gauge[drawGaugeTypetwo].szTextureSize.Height)); + } - int LamountToPercent; - int LdrawGaugeTypetwo = 0; + int _tmpMiniPadding = (int)(14f * OpenTaiko.Skin.Resolution[0] / 1280f); - if (!LrainbowBetterSuccess) { - LamountToPercent = dan_C[i].GetAmountToPercent(); + // Usually +23 for gold and +17 for white, to test + DrawMiniNumber( + OpenTaiko.stageSongSelect.rChoosenSong.DanSongs[j - 1].Dan_C[i].GetAmount(), + miniBarPositionX + 11, + miniBarPositionY + 20, + _tmpMiniPadding, + OpenTaiko.stageSongSelect.rChoosenSong.DanSongs[j - 1].Dan_C[i]); - if (LamountToPercent >= 100) - LdrawGaugeTypetwo = 2; - else if (dan_C[i].GetExamRange() == Exam.Range.More && LamountToPercent >= 70 || LamountToPercent > 70) - LdrawGaugeTypetwo = 1; - } - - - - #endregion - - // rainbowIndex : Rainbow bar texture to display (int), rainbowBase : same as rainbowIndex, but 0 if the counter is maxed - #region [Rainbow gauge counter] - - int rainbowIndex = 0; - int rainbowBase = 0; - if (LrainbowBetterSuccess) { - this.ct虹アニメ.TickLoop(); - this.ct虹透明度.TickLoop(); - - rainbowIndex = this.ct虹アニメ.CurrentValue; - - rainbowBase = rainbowIndex; - if (rainbowBase == ct虹アニメ.EndValue) rainbowBase = 0; - } - - #endregion - - #region [Default opacity] - - OpenTaiko.Tx.DanC_Gauge[LdrawGaugeTypetwo].Opacity = 255; - - OpenTaiko.Tx.Gauge_Dan_Rainbow[rainbowIndex].Opacity = 255; - - OpenTaiko.Tx.DanC_Number.Opacity = 255; - OpenTaiko.Tx.DanC_ExamRange.Opacity = 255; - OpenTaiko.Tx.DanC_Small_Number.Opacity = 255; - - #endregion - - int iconOpacity = 255; - - if (ExamChange[i] && NowShowingNumber != 0 && Counter_Wait != null) { - if (Counter_Wait.CurrentValue >= 800) { - #region [counter800 opacity] - - OpenTaiko.Tx.DanC_Gauge[LdrawGaugeTypetwo].Opacity = counter800; - - OpenTaiko.Tx.Gauge_Dan_Rainbow[rainbowIndex].Opacity = counter800; - - OpenTaiko.Tx.DanC_Number.Opacity = counter800; - OpenTaiko.Tx.DanC_ExamRange.Opacity = counter800; - OpenTaiko.Tx.DanC_Small_Number.Opacity = counter800; - - iconOpacity = counter800; - - #endregion - } else if (Counter_Wait.CurrentValue >= 800 - 255) { - #region [counter255M255 opacity] - - OpenTaiko.Tx.DanC_Gauge[LdrawGaugeTypetwo].Opacity = counter255M255; - - OpenTaiko.Tx.Gauge_Dan_Rainbow[rainbowIndex].Opacity = counter255M255; - - OpenTaiko.Tx.DanC_Number.Opacity = counter255M255; - OpenTaiko.Tx.DanC_ExamRange.Opacity = counter255M255; - OpenTaiko.Tx.DanC_Small_Number.Opacity = counter255M255; - - iconOpacity = counter255M255; + CActSelect段位リスト.tDisplayDanIcon(j, miniBarPositionX + OpenTaiko.Skin.Game_DanC_DanIcon_Offset_Mini[0], miniBarPositionY + OpenTaiko.Skin.Game_DanC_DanIcon_Offset_Mini[1], miniIconOpacity, 0.5f, false); #endregion } } + } - #region [Displayables] + #endregion - // Non individual : 209 / 650 : 0.32154f - // Individual : 97 / 432 : 0.22454f + #region [Currently playing song icons] - float xExtend = ExamChange[i] ? (isSmallGauge ? 0.215f * 0.663333333f : 0.663333333f) : (isSmallGauge ? 0.32154f : 1.0f); + OpenTaiko.Tx.DanC_ExamCymbol.Opacity = 255; - if (LrainbowBetterSuccess) { - #region [Rainbow gauge display] + if (ExamChange[i] && NowShowingNumber != 0) { + if (Counter_Wait != null) { + if (Counter_Wait.CurrentValue >= 800) + OpenTaiko.Tx.DanC_ExamCymbol.Opacity = counter800; + else if (Counter_Wait.CurrentValue >= 800 - 255) + OpenTaiko.Tx.DanC_ExamCymbol.Opacity = counter255M255; + } + } - OpenTaiko.Tx.Gauge_Dan_Rainbow[rainbowIndex].vcScaleRatio.X = xExtend; + //75, 418 + // 292 - 228 = 64 + if (ExamChange[i]) { + OpenTaiko.Tx.DanC_ExamCymbol.t2D描画(barXOffset + 5, lowerBarYOffset - 64, new RectangleF(0, 41 * NowCymbolShowingNumber, 197, 41)); + } - // Reset base since it was used for minibars - OpenTaiko.Tx.Gauge_Dan_Rainbow[0].vcScaleRatio.X = xExtend; - OpenTaiko.Tx.Gauge_Dan_Rainbow[0].vcScaleRatio.Y = 1.0f; + #endregion - if (Counter_Wait != null && !(Counter_Wait.CurrentValue <= 1055 && Counter_Wait.CurrentValue >= 800 - 255)) { - OpenTaiko.Tx.Gauge_Dan_Rainbow[rainbowIndex].Opacity = 255; - } + #region [Large bars] - OpenTaiko.Tx.Gauge_Dan_Rainbow[rainbowIndex]?.t2D拡大率考慮下基準描画( - barXOffset + OpenTaiko.Skin.Game_DanC_Offset[0], lowerBarYOffset - OpenTaiko.Skin.Game_DanC_Offset[1], - new Rectangle(0, 0, (int)(dan_C[i].GetAmountToPercent() * (OpenTaiko.Tx.Gauge_Dan_Rainbow[rainbowIndex].szTextureSize.Width / 100.0)), OpenTaiko.Tx.Gauge_Dan_Rainbow[rainbowIndex].szTextureSize.Height)); + // LrainbowBetterSuccess (bool) : is current minibar better success ? | LdrawGaugeTypetwo (int) : Gauge style [0,2] + #region [Success type variables] - if (Counter_Wait != null && !(Counter_Wait.CurrentValue <= 1055 && Counter_Wait.CurrentValue >= 800 - 255)) { - OpenTaiko.Tx.Gauge_Dan_Rainbow[rainbowBase].Opacity = (ct虹透明度.CurrentValue * 255 / (int)ct虹透明度.EndValue) / 1; - } + bool LrainbowBetterSuccess = GetExamStatus(dan_C[i]) == Exam.Status.Better_Success && GetExamConfirmStatus(dan_C[i]); - OpenTaiko.Tx.Gauge_Dan_Rainbow[rainbowBase]?.t2D拡大率考慮下基準描画( - barXOffset + OpenTaiko.Skin.Game_DanC_Offset[0], lowerBarYOffset - OpenTaiko.Skin.Game_DanC_Offset[1], - new Rectangle(0, 0, (int)(dan_C[i].GetAmountToPercent() * (OpenTaiko.Tx.Gauge_Dan_Rainbow[rainbowBase].szTextureSize.Width / 100.0)), OpenTaiko.Tx.Gauge_Dan_Rainbow[rainbowIndex].szTextureSize.Height)); + int LamountToPercent; + int LdrawGaugeTypetwo = 0; + + if (!LrainbowBetterSuccess) { + LamountToPercent = dan_C[i].GetAmountToPercent(); + + if (LamountToPercent >= 100) + LdrawGaugeTypetwo = 2; + else if (dan_C[i].GetExamRange() == Exam.Range.More && LamountToPercent >= 70 || LamountToPercent > 70) + LdrawGaugeTypetwo = 1; + } + + + + #endregion + + // rainbowIndex : Rainbow bar texture to display (int), rainbowBase : same as rainbowIndex, but 0 if the counter is maxed + #region [Rainbow gauge counter] + + int rainbowIndex = 0; + int rainbowBase = 0; + if (LrainbowBetterSuccess) { + this.ct虹アニメ.TickLoop(); + this.ct虹透明度.TickLoop(); + + rainbowIndex = this.ct虹アニメ.CurrentValue; + + rainbowBase = rainbowIndex; + if (rainbowBase == ct虹アニメ.EndValue) rainbowBase = 0; + } + + #endregion + + #region [Default opacity] + + OpenTaiko.Tx.DanC_Gauge[LdrawGaugeTypetwo].Opacity = 255; + + OpenTaiko.Tx.Gauge_Dan_Rainbow[rainbowIndex].Opacity = 255; + + OpenTaiko.Tx.DanC_Number.Opacity = 255; + OpenTaiko.Tx.DanC_ExamRange.Opacity = 255; + OpenTaiko.Tx.DanC_Small_Number.Opacity = 255; + + #endregion + + int iconOpacity = 255; + + if (ExamChange[i] && NowShowingNumber != 0 && Counter_Wait != null) { + if (Counter_Wait.CurrentValue >= 800) { + #region [counter800 opacity] + + OpenTaiko.Tx.DanC_Gauge[LdrawGaugeTypetwo].Opacity = counter800; + + OpenTaiko.Tx.Gauge_Dan_Rainbow[rainbowIndex].Opacity = counter800; + + OpenTaiko.Tx.DanC_Number.Opacity = counter800; + OpenTaiko.Tx.DanC_ExamRange.Opacity = counter800; + OpenTaiko.Tx.DanC_Small_Number.Opacity = counter800; + + iconOpacity = counter800; #endregion - } else { - #region [Regular gauge display] + } else if (Counter_Wait.CurrentValue >= 800 - 255) { + #region [counter255M255 opacity] - OpenTaiko.Tx.DanC_Gauge[LdrawGaugeTypetwo].vcScaleRatio.X = xExtend; - OpenTaiko.Tx.DanC_Gauge[LdrawGaugeTypetwo].vcScaleRatio.Y = 1.0f; - OpenTaiko.Tx.DanC_Gauge[LdrawGaugeTypetwo]?.t2D拡大率考慮下基準描画( - barXOffset + OpenTaiko.Skin.Game_DanC_Offset[0], lowerBarYOffset - OpenTaiko.Skin.Game_DanC_Offset[1], - new Rectangle(0, 0, (int)(dan_C[i].GetAmountToPercent() * (OpenTaiko.Tx.DanC_Gauge[LdrawGaugeTypetwo].szTextureSize.Width / 100.0)), OpenTaiko.Tx.DanC_Gauge[LdrawGaugeTypetwo].szTextureSize.Height)); + OpenTaiko.Tx.DanC_Gauge[LdrawGaugeTypetwo].Opacity = counter255M255; + + OpenTaiko.Tx.Gauge_Dan_Rainbow[rainbowIndex].Opacity = counter255M255; + + OpenTaiko.Tx.DanC_Number.Opacity = counter255M255; + OpenTaiko.Tx.DanC_ExamRange.Opacity = counter255M255; + OpenTaiko.Tx.DanC_Small_Number.Opacity = counter255M255; + + iconOpacity = counter255M255; #endregion } + } - #endregion + #region [Displayables] + // Non individual : 209 / 650 : 0.32154f + // Individual : 97 / 432 : 0.22454f - #endregion + float xExtend = ExamChange[i] ? (isSmallGauge ? 0.215f * 0.663333333f : 0.663333333f) : (isSmallGauge ? 0.32154f : 1.0f); - #region [Print the current value number] + if (LrainbowBetterSuccess) { + #region [Rainbow gauge display] - int nowAmount = dan_C[i].Amount; + OpenTaiko.Tx.Gauge_Dan_Rainbow[rainbowIndex].vcScaleRatio.X = xExtend; - if (dan_C[i].GetExamRange() == Exam.Range.Less) - nowAmount = dan_C[i].Value[0] - dan_C[i].Amount; + // Reset base since it was used for minibars + OpenTaiko.Tx.Gauge_Dan_Rainbow[0].vcScaleRatio.X = xExtend; + OpenTaiko.Tx.Gauge_Dan_Rainbow[0].vcScaleRatio.Y = 1.0f; - if (nowAmount < 0) nowAmount = 0; - - float numberXScale = isSmallGauge ? OpenTaiko.Skin.Game_DanC_Number_Small_Scale * 0.6f : OpenTaiko.Skin.Game_DanC_Number_Small_Scale; - float numberYScale = isSmallGauge ? OpenTaiko.Skin.Game_DanC_Number_Small_Scale * 0.8f : OpenTaiko.Skin.Game_DanC_Number_Small_Scale; - int numberPadding = (int)(OpenTaiko.Skin.Game_DanC_Number_Padding * (isSmallGauge ? 0.6f : 1f)); - - DrawNumber(nowAmount, - barXOffset + OpenTaiko.Skin.Game_DanC_Number_Small_Number_Offset[0], - lowerBarYOffset - OpenTaiko.Skin.Game_DanC_Number_Small_Number_Offset[1], - numberPadding, - true, - dan_C[i], - numberXScale, - numberYScale, - (Status[i].Timer_Amount != null ? ScoreScale[Status[i].Timer_Amount.CurrentValue] : 0f)); - - #endregion - - if (ExamChange[i]) { - CActSelect段位リスト.tDisplayDanIcon(NowShowingNumber + 1, barXOffset + OpenTaiko.Skin.Game_DanC_DanIcon_Offset[0], barYOffset + OpenTaiko.Skin.Game_DanC_DanIcon_Offset[1], iconOpacity, 0.6f, true); + if (Counter_Wait != null && !(Counter_Wait.CurrentValue <= 1055 && Counter_Wait.CurrentValue >= 800 - 255)) { + OpenTaiko.Tx.Gauge_Dan_Rainbow[rainbowIndex].Opacity = 255; } + OpenTaiko.Tx.Gauge_Dan_Rainbow[rainbowIndex]?.t2D拡大率考慮下基準描画( + barXOffset + OpenTaiko.Skin.Game_DanC_Offset[0], lowerBarYOffset - OpenTaiko.Skin.Game_DanC_Offset[1], + new Rectangle(0, 0, (int)(dan_C[i].GetAmountToPercent() * (OpenTaiko.Tx.Gauge_Dan_Rainbow[rainbowIndex].szTextureSize.Width / 100.0)), OpenTaiko.Tx.Gauge_Dan_Rainbow[rainbowIndex].szTextureSize.Height)); - #region [Dan conditions display] - - int offset = OpenTaiko.Skin.Game_DanC_Exam_Offset[0]; - - OpenTaiko.Tx.DanC_ExamType.vcScaleRatio.X = 1.0f; - OpenTaiko.Tx.DanC_ExamType.vcScaleRatio.Y = 1.0f; - - // Exam range (Less than/More) - OpenTaiko.Tx.DanC_ExamRange?.t2D拡大率考慮下基準描画( - barXOffset + offset - OpenTaiko.Tx.DanC_ExamRange.szTextureSize.Width, - lowerBarYOffset - OpenTaiko.Skin.Game_DanC_Exam_Offset[1], - new Rectangle(0, OpenTaiko.Skin.Game_DanC_ExamRange_Size[1] * (int)dan_C[i].GetExamRange(), OpenTaiko.Skin.Game_DanC_ExamRange_Size[0], OpenTaiko.Skin.Game_DanC_ExamRange_Size[1])); - - offset -= OpenTaiko.Skin.Game_DanC_ExamRange_Padding; - - // Condition number - DrawNumber( - dan_C[i].Value[0], - barXOffset + offset - dan_C[i].Value[0].ToString().Length * (int)(OpenTaiko.Skin.Game_DanC_Number_Small_Padding * OpenTaiko.Skin.Game_DanC_Exam_Number_Scale), - lowerBarYOffset - OpenTaiko.Skin.Game_DanC_Exam_Offset[1] - 1, - (int)(OpenTaiko.Skin.Game_DanC_Number_Small_Padding * OpenTaiko.Skin.Game_DanC_Exam_Number_Scale), - false, - dan_C[i]); - - int _offexX = (int)(22f * OpenTaiko.Skin.Resolution[0] / 1280f); - int _offexY = (int)(48f * OpenTaiko.Skin.Resolution[1] / 720f); - int _examX = barXOffset + OpenTaiko.Skin.Game_DanC_Exam_Offset[0] - OpenTaiko.Tx.DanC_ExamType.szTextureSize.Width + _offexX; - int _examY = lowerBarYOffset - OpenTaiko.Skin.Game_DanC_Exam_Offset[1] - _offexY; - - // Exam type flag - OpenTaiko.Tx.DanC_ExamType?.t2D拡大率考慮下基準描画( - _examX, - _examY, - new Rectangle(0, 0, OpenTaiko.Skin.Game_DanC_ExamType_Size[0], OpenTaiko.Skin.Game_DanC_ExamType_Size[1])); - - if ((int)dan_C[i].GetExamType() < this.ttkExams.Length) - TitleTextureKey.ResolveTitleTexture(this.ttkExams[(int)dan_C[i].GetExamType()]).t2D拡大率考慮中央基準描画( - _examX + OpenTaiko.Skin.Game_DanC_ExamType_Size[0] / 2, - _examY - OpenTaiko.Skin.Game_DanC_ExamType_Size[1] / 2); - - - /* - TJAPlayer3.Tx.DanC_ExamType?.t2D拡大率考慮下基準描画( - barXOffset + TJAPlayer3.Skin.Game_DanC_Exam_Offset[0] - TJAPlayer3.Tx.DanC_ExamType.szテクスチャサイズ.Width + 22, - lowerBarYOffset - TJAPlayer3.Skin.Game_DanC_Exam_Offset[1] - 48, - new Rectangle(0, TJAPlayer3.Skin.Game_DanC_ExamType_Size[1] * (int)dan_C[i].GetExamType(), TJAPlayer3.Skin.Game_DanC_ExamType_Size[0], TJAPlayer3.Skin.Game_DanC_ExamType_Size[1])); - */ - - #endregion - - #region [Failed condition box] - - OpenTaiko.Tx.DanC_Failed.vcScaleRatio.X = isSmallGauge ? 0.33f : 1f; - - if (dan_C[i].GetReached()) { - OpenTaiko.Tx.DanC_Failed.t2D拡大率考慮下基準描画( - barXOffset + OpenTaiko.Skin.Game_DanC_Offset[0], - lowerBarYOffset - OpenTaiko.Skin.Game_DanC_Offset[1]); + if (Counter_Wait != null && !(Counter_Wait.CurrentValue <= 1055 && Counter_Wait.CurrentValue >= 800 - 255)) { + OpenTaiko.Tx.Gauge_Dan_Rainbow[rainbowBase].Opacity = (ct虹透明度.CurrentValue * 255 / (int)ct虹透明度.EndValue) / 1; } - #endregion + OpenTaiko.Tx.Gauge_Dan_Rainbow[rainbowBase]?.t2D拡大率考慮下基準描画( + barXOffset + OpenTaiko.Skin.Game_DanC_Offset[0], lowerBarYOffset - OpenTaiko.Skin.Game_DanC_Offset[1], + new Rectangle(0, 0, (int)(dan_C[i].GetAmountToPercent() * (OpenTaiko.Tx.Gauge_Dan_Rainbow[rainbowBase].szTextureSize.Width / 100.0)), OpenTaiko.Tx.Gauge_Dan_Rainbow[rainbowIndex].szTextureSize.Height)); + #endregion } else { - #region [Gauge dan condition] + #region [Regular gauge display] - int _scale = (int)(14f * OpenTaiko.Skin.Resolution[0] / 1280f); - int _nbX = (int)(292f * OpenTaiko.Skin.Resolution[0] / 1280f); - int _nbY = (int)(64f * OpenTaiko.Skin.Resolution[0] / 1280f); - int _offexX = (int)(104f * OpenTaiko.Skin.Resolution[0] / 1280f); - int _offexY = (int)(21f * OpenTaiko.Skin.Resolution[1] / 720f); - - OpenTaiko.Tx.DanC_Gauge_Base?.t2D描画( - OpenTaiko.Skin.Game_DanC_X[0] - ((50 - dan_C[i].GetValue(false) / 2) * _scale) + 4, - OpenTaiko.Skin.Game_DanC_Y[0]); - - TitleTextureKey.ResolveTitleTexture(this.ttkExams[(int)Exam.Type.Gauge]).t2D拡大率考慮中央基準描画( - OpenTaiko.Skin.Game_DanC_X[0] - ((50 - dan_C[i].GetValue(false) / 2) * _scale) + _offexX, - OpenTaiko.Skin.Game_DanC_Y[0] + _offexY); - - // Display percentage here - DrawNumber( - dan_C[i].Value[0], - OpenTaiko.Skin.Game_DanC_X[0] - ((50 - dan_C[i].GetValue(false) / 2) * _scale) + _nbX - dan_C[i].Value[0].ToString().Length * (int)(OpenTaiko.Skin.Game_DanC_Number_Small_Padding * OpenTaiko.Skin.Game_DanC_Exam_Number_Scale), - OpenTaiko.Skin.Game_DanC_Y[0] - OpenTaiko.Skin.Game_DanC_Exam_Offset[1] + _nbY, - (int)(OpenTaiko.Skin.Game_DanC_Number_Small_Padding * OpenTaiko.Skin.Game_DanC_Exam_Number_Scale), - false, - dan_C[i]); + OpenTaiko.Tx.DanC_Gauge[LdrawGaugeTypetwo].vcScaleRatio.X = xExtend; + OpenTaiko.Tx.DanC_Gauge[LdrawGaugeTypetwo].vcScaleRatio.Y = 1.0f; + OpenTaiko.Tx.DanC_Gauge[LdrawGaugeTypetwo]?.t2D拡大率考慮下基準描画( + barXOffset + OpenTaiko.Skin.Game_DanC_Offset[0], lowerBarYOffset - OpenTaiko.Skin.Game_DanC_Offset[1], + new Rectangle(0, 0, (int)(dan_C[i].GetAmountToPercent() * (OpenTaiko.Tx.DanC_Gauge[LdrawGaugeTypetwo].szTextureSize.Width / 100.0)), OpenTaiko.Tx.DanC_Gauge[LdrawGaugeTypetwo].szTextureSize.Height)); #endregion } + + #endregion + + + #endregion + + #region [Print the current value number] + + int nowAmount = dan_C[i].Amount; + + if (dan_C[i].GetExamRange() == Exam.Range.Less) + nowAmount = dan_C[i].Value[0] - dan_C[i].Amount; + + if (nowAmount < 0) nowAmount = 0; + + float numberXScale = isSmallGauge ? OpenTaiko.Skin.Game_DanC_Number_Small_Scale * 0.6f : OpenTaiko.Skin.Game_DanC_Number_Small_Scale; + float numberYScale = isSmallGauge ? OpenTaiko.Skin.Game_DanC_Number_Small_Scale * 0.8f : OpenTaiko.Skin.Game_DanC_Number_Small_Scale; + int numberPadding = (int)(OpenTaiko.Skin.Game_DanC_Number_Padding * (isSmallGauge ? 0.6f : 1f)); + + DrawNumber(nowAmount, + barXOffset + OpenTaiko.Skin.Game_DanC_Number_Small_Number_Offset[0], + lowerBarYOffset - OpenTaiko.Skin.Game_DanC_Number_Small_Number_Offset[1], + numberPadding, + true, + dan_C[i], + numberXScale, + numberYScale, + (Status[i].Timer_Amount != null ? ScoreScale[Status[i].Timer_Amount.CurrentValue] : 0f)); + + #endregion + + if (ExamChange[i]) { + CActSelect段位リスト.tDisplayDanIcon(NowShowingNumber + 1, barXOffset + OpenTaiko.Skin.Game_DanC_DanIcon_Offset[0], barYOffset + OpenTaiko.Skin.Game_DanC_DanIcon_Offset[1], iconOpacity, 0.6f, true); + } + + + #region [Dan conditions display] + + int offset = OpenTaiko.Skin.Game_DanC_Exam_Offset[0]; + + OpenTaiko.Tx.DanC_ExamType.vcScaleRatio.X = 1.0f; + OpenTaiko.Tx.DanC_ExamType.vcScaleRatio.Y = 1.0f; + + // Exam range (Less than/More) + OpenTaiko.Tx.DanC_ExamRange?.t2D拡大率考慮下基準描画( + barXOffset + offset - OpenTaiko.Tx.DanC_ExamRange.szTextureSize.Width, + lowerBarYOffset - OpenTaiko.Skin.Game_DanC_Exam_Offset[1], + new Rectangle(0, OpenTaiko.Skin.Game_DanC_ExamRange_Size[1] * (int)dan_C[i].GetExamRange(), OpenTaiko.Skin.Game_DanC_ExamRange_Size[0], OpenTaiko.Skin.Game_DanC_ExamRange_Size[1])); + + offset -= OpenTaiko.Skin.Game_DanC_ExamRange_Padding; + + // Condition number + DrawNumber( + dan_C[i].Value[0], + barXOffset + offset - dan_C[i].Value[0].ToString().Length * (int)(OpenTaiko.Skin.Game_DanC_Number_Small_Padding * OpenTaiko.Skin.Game_DanC_Exam_Number_Scale), + lowerBarYOffset - OpenTaiko.Skin.Game_DanC_Exam_Offset[1] - 1, + (int)(OpenTaiko.Skin.Game_DanC_Number_Small_Padding * OpenTaiko.Skin.Game_DanC_Exam_Number_Scale), + false, + dan_C[i]); + + int _offexX = (int)(22f * OpenTaiko.Skin.Resolution[0] / 1280f); + int _offexY = (int)(48f * OpenTaiko.Skin.Resolution[1] / 720f); + int _examX = barXOffset + OpenTaiko.Skin.Game_DanC_Exam_Offset[0] - OpenTaiko.Tx.DanC_ExamType.szTextureSize.Width + _offexX; + int _examY = lowerBarYOffset - OpenTaiko.Skin.Game_DanC_Exam_Offset[1] - _offexY; + + // Exam type flag + OpenTaiko.Tx.DanC_ExamType?.t2D拡大率考慮下基準描画( + _examX, + _examY, + new Rectangle(0, 0, OpenTaiko.Skin.Game_DanC_ExamType_Size[0], OpenTaiko.Skin.Game_DanC_ExamType_Size[1])); + + if ((int)dan_C[i].GetExamType() < this.ttkExams.Length) + TitleTextureKey.ResolveTitleTexture(this.ttkExams[(int)dan_C[i].GetExamType()]).t2D拡大率考慮中央基準描画( + _examX + OpenTaiko.Skin.Game_DanC_ExamType_Size[0] / 2, + _examY - OpenTaiko.Skin.Game_DanC_ExamType_Size[1] / 2); + + + /* + TJAPlayer3.Tx.DanC_ExamType?.t2D拡大率考慮下基準描画( + barXOffset + TJAPlayer3.Skin.Game_DanC_Exam_Offset[0] - TJAPlayer3.Tx.DanC_ExamType.szテクスチャサイズ.Width + 22, + lowerBarYOffset - TJAPlayer3.Skin.Game_DanC_Exam_Offset[1] - 48, + new Rectangle(0, TJAPlayer3.Skin.Game_DanC_ExamType_Size[1] * (int)dan_C[i].GetExamType(), TJAPlayer3.Skin.Game_DanC_ExamType_Size[0], TJAPlayer3.Skin.Game_DanC_ExamType_Size[1])); + */ + + #endregion + + #region [Failed condition box] + + OpenTaiko.Tx.DanC_Failed.vcScaleRatio.X = isSmallGauge ? 0.33f : 1f; + + if (dan_C[i].GetReached()) { + OpenTaiko.Tx.DanC_Failed.t2D拡大率考慮下基準描画( + barXOffset + OpenTaiko.Skin.Game_DanC_Offset[0], + lowerBarYOffset - OpenTaiko.Skin.Game_DanC_Offset[1]); + } + + #endregion + + } else { + #region [Gauge dan condition] + + int _scale = (int)(14f * OpenTaiko.Skin.Resolution[0] / 1280f); + int _nbX = (int)(292f * OpenTaiko.Skin.Resolution[0] / 1280f); + int _nbY = (int)(64f * OpenTaiko.Skin.Resolution[0] / 1280f); + int _offexX = (int)(104f * OpenTaiko.Skin.Resolution[0] / 1280f); + int _offexY = (int)(21f * OpenTaiko.Skin.Resolution[1] / 720f); + + OpenTaiko.Tx.DanC_Gauge_Base?.t2D描画( + OpenTaiko.Skin.Game_DanC_X[0] - ((50 - dan_C[i].GetValue(false) / 2) * _scale) + 4, + OpenTaiko.Skin.Game_DanC_Y[0]); + + TitleTextureKey.ResolveTitleTexture(this.ttkExams[(int)Exam.Type.Gauge]).t2D拡大率考慮中央基準描画( + OpenTaiko.Skin.Game_DanC_X[0] - ((50 - dan_C[i].GetValue(false) / 2) * _scale) + _offexX, + OpenTaiko.Skin.Game_DanC_Y[0] + _offexY); + + // Display percentage here + DrawNumber( + dan_C[i].Value[0], + OpenTaiko.Skin.Game_DanC_X[0] - ((50 - dan_C[i].GetValue(false) / 2) * _scale) + _nbX - dan_C[i].Value[0].ToString().Length * (int)(OpenTaiko.Skin.Game_DanC_Number_Small_Padding * OpenTaiko.Skin.Game_DanC_Exam_Number_Scale), + OpenTaiko.Skin.Game_DanC_Y[0] - OpenTaiko.Skin.Game_DanC_Exam_Offset[1] + _nbY, + (int)(OpenTaiko.Skin.Game_DanC_Number_Small_Padding * OpenTaiko.Skin.Game_DanC_Exam_Number_Scale), + false, + dan_C[i]); + + #endregion } } + } - /// - /// 段位チャレンジの数字フォントで数字を描画します。 - /// - /// 値。 - /// 一桁目のX座標。 - /// 一桁目のY座標 - /// 桁数間の字間 - /// 拡大率X - /// 拡大率Y - /// アニメーション用拡大率(Yに加算される)。 - private void DrawNumber(int value, int x, int y, int padding, bool bBig, Dan_C dan_c, float scaleX = 1.0f, float scaleY = 1.0f, float scaleJump = 0.0f) { + /// + /// 段位チャレンジの数字フォントで数字を描画します。 + /// + /// 値。 + /// 一桁目のX座標。 + /// 一桁目のY座標 + /// 桁数間の字間 + /// 拡大率X + /// 拡大率Y + /// アニメーション用拡大率(Yに加算される)。 + private void DrawNumber(int value, int x, int y, int padding, bool bBig, Dan_C dan_c, float scaleX = 1.0f, float scaleY = 1.0f, float scaleJump = 0.0f) { - if (OpenTaiko.Tx.DanC_Number == null || OpenTaiko.Tx.DanC_Small_Number == null || value < 0) - return; + if (OpenTaiko.Tx.DanC_Number == null || OpenTaiko.Tx.DanC_Small_Number == null || value < 0) + return; - if (value == 0) { - OpenTaiko.Tx.DanC_Number.color4 = CConversion.ColorToColor4(Color.Gray); - OpenTaiko.Tx.DanC_Small_Number.color4 = CConversion.ColorToColor4(Color.Gray); - } else { - OpenTaiko.Tx.DanC_Number.color4 = CConversion.ColorToColor4(Color.White); - OpenTaiko.Tx.DanC_Small_Number.color4 = CConversion.ColorToColor4(Color.White); - } - - if (bBig) { - var notesRemainDigit = 0; - for (int i = 0; i < value.ToString().Length; i++) { - var number = Convert.ToInt32(value.ToString()[i].ToString()); - Rectangle rectangle = new Rectangle(OpenTaiko.Skin.Game_DanC_Number_Size[0] * number - 1, GetExamConfirmStatus(dan_c) ? OpenTaiko.Skin.Game_DanC_Number_Size[1] : 0, OpenTaiko.Skin.Game_DanC_Number_Size[0], OpenTaiko.Skin.Game_DanC_Number_Size[1]); - if (OpenTaiko.Tx.DanC_Number != null) { - OpenTaiko.Tx.DanC_Number.vcScaleRatio.X = scaleX; - OpenTaiko.Tx.DanC_Number.vcScaleRatio.Y = scaleY + scaleJump; - } - OpenTaiko.Tx.DanC_Number?.t2D拡大率考慮下中心基準描画(x - (notesRemainDigit * padding), y, rectangle); - notesRemainDigit--; - } - } else { - var notesRemainDigit = 0; - for (int i = 0; i < value.ToString().Length; i++) { - var number = Convert.ToInt32(value.ToString()[i].ToString()); - Rectangle rectangle = new Rectangle(OpenTaiko.Skin.Game_DanC_Small_Number_Size[0] * number - 1, 0, OpenTaiko.Skin.Game_DanC_Small_Number_Size[0], OpenTaiko.Skin.Game_DanC_Small_Number_Size[1]); - if (OpenTaiko.Tx.DanC_Small_Number != null) { - OpenTaiko.Tx.DanC_Small_Number.vcScaleRatio.X = scaleX; - OpenTaiko.Tx.DanC_Small_Number.vcScaleRatio.Y = scaleY + scaleJump; - } - OpenTaiko.Tx.DanC_Small_Number?.t2D拡大率考慮下中心基準描画(x - (notesRemainDigit * padding), y, rectangle); - notesRemainDigit--; - } - } + if (value == 0) { + OpenTaiko.Tx.DanC_Number.color4 = CConversion.ColorToColor4(Color.Gray); + OpenTaiko.Tx.DanC_Small_Number.color4 = CConversion.ColorToColor4(Color.Gray); + } else { + OpenTaiko.Tx.DanC_Number.color4 = CConversion.ColorToColor4(Color.White); + OpenTaiko.Tx.DanC_Small_Number.color4 = CConversion.ColorToColor4(Color.White); } - public void DrawMiniNumber(int value, int x, int y, int padding, Dan_C dan_c) { - if (OpenTaiko.Tx.DanC_MiniNumber == null || value < 0) - return; - + if (bBig) { var notesRemainDigit = 0; - if (value < 0) - return; for (int i = 0; i < value.ToString().Length; i++) { var number = Convert.ToInt32(value.ToString()[i].ToString()); - Rectangle rectangle = new Rectangle(OpenTaiko.Skin.Game_DanC_MiniNumber_Size[0] * number - 1, GetExamConfirmStatus(dan_c) ? OpenTaiko.Skin.Game_DanC_MiniNumber_Size[1] : 0, OpenTaiko.Skin.Game_DanC_MiniNumber_Size[0], OpenTaiko.Skin.Game_DanC_MiniNumber_Size[1]); - OpenTaiko.Tx.DanC_MiniNumber.t2D拡大率考慮下中心基準描画(x - (notesRemainDigit * padding), y, rectangle); + Rectangle rectangle = new Rectangle(OpenTaiko.Skin.Game_DanC_Number_Size[0] * number - 1, GetExamConfirmStatus(dan_c) ? OpenTaiko.Skin.Game_DanC_Number_Size[1] : 0, OpenTaiko.Skin.Game_DanC_Number_Size[0], OpenTaiko.Skin.Game_DanC_Number_Size[1]); + if (OpenTaiko.Tx.DanC_Number != null) { + OpenTaiko.Tx.DanC_Number.vcScaleRatio.X = scaleX; + OpenTaiko.Tx.DanC_Number.vcScaleRatio.Y = scaleY + scaleJump; + } + OpenTaiko.Tx.DanC_Number?.t2D拡大率考慮下中心基準描画(x - (notesRemainDigit * padding), y, rectangle); + notesRemainDigit--; + } + } else { + var notesRemainDigit = 0; + for (int i = 0; i < value.ToString().Length; i++) { + var number = Convert.ToInt32(value.ToString()[i].ToString()); + Rectangle rectangle = new Rectangle(OpenTaiko.Skin.Game_DanC_Small_Number_Size[0] * number - 1, 0, OpenTaiko.Skin.Game_DanC_Small_Number_Size[0], OpenTaiko.Skin.Game_DanC_Small_Number_Size[1]); + if (OpenTaiko.Tx.DanC_Small_Number != null) { + OpenTaiko.Tx.DanC_Small_Number.vcScaleRatio.X = scaleX; + OpenTaiko.Tx.DanC_Small_Number.vcScaleRatio.Y = scaleY + scaleJump; + } + OpenTaiko.Tx.DanC_Small_Number?.t2D拡大率考慮下中心基準描画(x - (notesRemainDigit * padding), y, rectangle); notesRemainDigit--; } } - - /// - /// n個の条件がひとつ以上達成失敗しているかどうかを返します。 - /// - /// n個の条件がひとつ以上達成失敗しているか。 - public bool GetFailedAllChallenges() { - var isFailed = false; - for (int i = 0; i < CExamInfo.cMaxExam; i++) { - if (Challenge[i] == null) continue; - - for (int j = 0; j < OpenTaiko.stageSongSelect.rChoosenSong.DanSongs.Count; j++) { - if (OpenTaiko.stageSongSelect.rChoosenSong.DanSongs[j].Dan_C[i] != null) { - if (OpenTaiko.stageSongSelect.rChoosenSong.DanSongs[j].Dan_C[i].GetReached()) isFailed = true; - } - } - if (Challenge[i].GetReached()) isFailed = true; - } - return isFailed; - } - - /// - /// n個の条件で段位認定モードのステータスを返します。 - /// - /// 条件。 - /// ExamStatus。 - public Exam.Status GetExamStatus(Dan_C[] dan_C) { - var status = Exam.Status.Better_Success; - - for (int i = 0; i < CExamInfo.cMaxExam; i++) { - - - if (ExamChange[i] == true) { - for (int j = 1; j < OpenTaiko.stageSongSelect.rChoosenSong.DanSongs.Count; j++) { - if (!(OpenTaiko.stageSongSelect.rChoosenSong.DanSongs[j - 1].Dan_C[i] != null)) - continue; - - bool rainbowBetterSuccess = GetExamStatus(OpenTaiko.stageSongSelect.rChoosenSong.DanSongs[j - 1].Dan_C[i]) == Exam.Status.Better_Success; - - if (!rainbowBetterSuccess) status = Exam.Status.Success; - } - } - - - if (dan_C[i] == null || dan_C[i].GetEnable() != true) - continue; - - if (!dan_C[i].GetCleared()[1]) status = Exam.Status.Success; - if (!dan_C[i].GetCleared()[0]) return (Exam.Status.Failure); - } - - return status; - } - - public Exam.Status GetExamStatus(Dan_C dan_C) { - var status = Exam.Status.Better_Success; - if (!dan_C.GetCleared()[1]) status = Exam.Status.Success; - if (!dan_C.GetCleared()[0]) status = Exam.Status.Failure; - return status; - } - - public bool GetExamConfirmStatus(Dan_C dan_C) { - switch (dan_C.GetExamRange()) { - case Exam.Range.Less: { - if (GetExamStatus(dan_C) == Exam.Status.Better_Success && notesremain == 0) - return true; - else - return false; - } - - case Exam.Range.More: { - if (dan_C.GetExamType() == Exam.Type.Accuracy && notesremain != 0) - return false; - else if (GetExamStatus(dan_C) == Exam.Status.Better_Success) - return true; - else - return false; - } - } - return false; - } - - public Dan_C[] GetExam() { - return Challenge; - } - - - private readonly float[] ScoreScale = new float[] - { - 0.000f, - 0.111f, // リピート - 0.222f, - 0.185f, - 0.148f, - 0.129f, - 0.111f, - 0.074f, - 0.065f, - 0.033f, - 0.015f, - 0.000f - }; - - [StructLayout(LayoutKind.Sequential)] - struct ChallengeStatus { - public Color4 Color; - public CCounter Timer_Gauge; - public CCounter Timer_Amount; - public CCounter Timer_Failed; - } - - #region[ private ] - //----------------- - - private bool bExamChangeCheck; - private int notesremain; - private int[] songsnotesremain; - private bool[] ExamChange = new bool[CExamInfo.cMaxExam]; - private int ExamCount; - private ChallengeStatus[] Status = new ChallengeStatus[CExamInfo.cMaxExam]; - private CTexture Dan_Plate; - private bool[] IsEnded; - public bool FirstSectionAnime; - - // アニメ関連 - public int NowShowingNumber; - public int NowCymbolShowingNumber; - private CCounter Counter_In, Counter_Wait, Counter_Out, Counter_Text; - private double[] ScreenPoint; - private int Counter_In_Old, Counter_Out_Old, Counter_Text_Old; - public bool IsAnimating; - - //音声関連 - private CSound Sound_Section; - private CSound Sound_Section_First; - private CSound Sound_Failed; - - private CCounter ct虹アニメ; - private CCounter ct虹透明度; - - private CCachedFontRenderer pfExamFont; - private TitleTextureKey[] ttkExams; - - //----------------- - #endregion } + + public void DrawMiniNumber(int value, int x, int y, int padding, Dan_C dan_c) { + if (OpenTaiko.Tx.DanC_MiniNumber == null || value < 0) + return; + + var notesRemainDigit = 0; + if (value < 0) + return; + for (int i = 0; i < value.ToString().Length; i++) { + var number = Convert.ToInt32(value.ToString()[i].ToString()); + Rectangle rectangle = new Rectangle(OpenTaiko.Skin.Game_DanC_MiniNumber_Size[0] * number - 1, GetExamConfirmStatus(dan_c) ? OpenTaiko.Skin.Game_DanC_MiniNumber_Size[1] : 0, OpenTaiko.Skin.Game_DanC_MiniNumber_Size[0], OpenTaiko.Skin.Game_DanC_MiniNumber_Size[1]); + OpenTaiko.Tx.DanC_MiniNumber.t2D拡大率考慮下中心基準描画(x - (notesRemainDigit * padding), y, rectangle); + notesRemainDigit--; + } + } + + /// + /// n個の条件がひとつ以上達成失敗しているかどうかを返します。 + /// + /// n個の条件がひとつ以上達成失敗しているか。 + public bool GetFailedAllChallenges() { + var isFailed = false; + for (int i = 0; i < CExamInfo.cMaxExam; i++) { + if (Challenge[i] == null) continue; + + for (int j = 0; j < OpenTaiko.stageSongSelect.rChoosenSong.DanSongs.Count; j++) { + if (OpenTaiko.stageSongSelect.rChoosenSong.DanSongs[j].Dan_C[i] != null) { + if (OpenTaiko.stageSongSelect.rChoosenSong.DanSongs[j].Dan_C[i].GetReached()) isFailed = true; + } + } + if (Challenge[i].GetReached()) isFailed = true; + } + return isFailed; + } + + /// + /// n個の条件で段位認定モードのステータスを返します。 + /// + /// 条件。 + /// ExamStatus。 + public Exam.Status GetExamStatus(Dan_C[] dan_C) { + var status = Exam.Status.Better_Success; + + for (int i = 0; i < CExamInfo.cMaxExam; i++) { + + + if (ExamChange[i] == true) { + for (int j = 1; j < OpenTaiko.stageSongSelect.rChoosenSong.DanSongs.Count; j++) { + if (!(OpenTaiko.stageSongSelect.rChoosenSong.DanSongs[j - 1].Dan_C[i] != null)) + continue; + + bool rainbowBetterSuccess = GetExamStatus(OpenTaiko.stageSongSelect.rChoosenSong.DanSongs[j - 1].Dan_C[i]) == Exam.Status.Better_Success; + + if (!rainbowBetterSuccess) status = Exam.Status.Success; + } + } + + + if (dan_C[i] == null || dan_C[i].GetEnable() != true) + continue; + + if (!dan_C[i].GetCleared()[1]) status = Exam.Status.Success; + if (!dan_C[i].GetCleared()[0]) return (Exam.Status.Failure); + } + + return status; + } + + public Exam.Status GetExamStatus(Dan_C dan_C) { + var status = Exam.Status.Better_Success; + if (!dan_C.GetCleared()[1]) status = Exam.Status.Success; + if (!dan_C.GetCleared()[0]) status = Exam.Status.Failure; + return status; + } + + public bool GetExamConfirmStatus(Dan_C dan_C) { + switch (dan_C.GetExamRange()) { + case Exam.Range.Less: { + if (GetExamStatus(dan_C) == Exam.Status.Better_Success && notesremain == 0) + return true; + else + return false; + } + + case Exam.Range.More: { + if (dan_C.GetExamType() == Exam.Type.Accuracy && notesremain != 0) + return false; + else if (GetExamStatus(dan_C) == Exam.Status.Better_Success) + return true; + else + return false; + } + } + return false; + } + + public Dan_C[] GetExam() { + return Challenge; + } + + + private readonly float[] ScoreScale = new float[] + { + 0.000f, + 0.111f, // リピート + 0.222f, + 0.185f, + 0.148f, + 0.129f, + 0.111f, + 0.074f, + 0.065f, + 0.033f, + 0.015f, + 0.000f + }; + + [StructLayout(LayoutKind.Sequential)] + struct ChallengeStatus { + public Color4 Color; + public CCounter Timer_Gauge; + public CCounter Timer_Amount; + public CCounter Timer_Failed; + } + + #region[ private ] + //----------------- + + private bool bExamChangeCheck; + private int notesremain; + private int[] songsnotesremain; + private bool[] ExamChange = new bool[CExamInfo.cMaxExam]; + private int ExamCount; + private ChallengeStatus[] Status = new ChallengeStatus[CExamInfo.cMaxExam]; + private CTexture Dan_Plate; + private bool[] IsEnded; + public bool FirstSectionAnime; + + // アニメ関連 + public int NowShowingNumber; + public int NowCymbolShowingNumber; + private CCounter Counter_In, Counter_Wait, Counter_Out, Counter_Text; + private double[] ScreenPoint; + private int Counter_In_Old, Counter_Out_Old, Counter_Text_Old; + public bool IsAnimating; + + //音声関連 + private CSound Sound_Section; + private CSound Sound_Section_First; + private CSound Sound_Failed; + + private CCounter ct虹アニメ; + private CCounter ct虹透明度; + + private CCachedFontRenderer pfExamFont; + private TitleTextureKey[] ttkExams; + + //----------------- + #endregion } diff --git a/OpenTaiko/src/Stages/07.Game/Taiko/EndAnimeScript.cs b/OpenTaiko/src/Stages/07.Game/Taiko/EndAnimeScript.cs index 67eb9d63..f4a2208b 100644 --- a/OpenTaiko/src/Stages/07.Game/Taiko/EndAnimeScript.cs +++ b/OpenTaiko/src/Stages/07.Game/Taiko/EndAnimeScript.cs @@ -1,59 +1,59 @@ using NLua; -namespace OpenTaiko { - class EndAnimeScript : ScriptBG { - private LuaFunction LuaPlayEndAnime; +namespace OpenTaiko; - public EndAnimeScript(string filePath) : base(filePath) { - if (LuaScript != null) { - LuaPlayEndAnime = LuaScript.GetFunction("playEndAnime"); - } +class EndAnimeScript : ScriptBG { + private LuaFunction LuaPlayEndAnime; + + public EndAnimeScript(string filePath) : base(filePath) { + if (LuaScript != null) { + LuaPlayEndAnime = LuaScript.GetFunction("playEndAnime"); } + } - public new void Dispose() { - base.Dispose(); - LuaPlayEndAnime?.Dispose(); + public new void Dispose() { + base.Dispose(); + LuaPlayEndAnime?.Dispose(); + } + + public void PlayEndAnime(int player) { + if (LuaScript == null) return; + try { + LuaPlayEndAnime.Call(player); + } catch (Exception ex) { } + } - public void PlayEndAnime(int player) { - if (LuaScript == null) return; - try { - LuaPlayEndAnime.Call(player); - } catch (Exception ex) { + public new void Update(int player) { + if (LuaScript == null) return; + try { + float currentFloorPositionMax140 = 0; + + if (OpenTaiko.stageSongSelect.rChoosenSong.arスコア[5] != null) { + int maxFloor = OpenTaiko.stageSongSelect.rChoosenSong.arスコア[5].譜面情報.nTotalFloor; + int nightTime = Math.Max(140, maxFloor / 2); + + currentFloorPositionMax140 = Math.Min(OpenTaiko.stage演奏ドラム画面.actPlayInfo.NowMeasure[0] / (float)nightTime, 1f); } + + LuaUpdateValues.Call(OpenTaiko.FPS.DeltaTime, OpenTaiko.FPS.NowFPS, OpenTaiko.stage演奏ドラム画面.bIsAlreadyCleared, (double)currentFloorPositionMax140); + /*LuaScript.SetObjectToPath("fps", TJAPlayer3.FPS.n現在のFPS); + LuaScript.SetObjectToPath("deltaTime", TJAPlayer3.FPS.DeltaTime); + LuaScript.SetObjectToPath("isClear", TJAPlayer3.stage演奏ドラム画面.bIsAlreadyCleared); + LuaScript.SetObjectToPath("towerNightOpacity", (double)(255 * currentFloorPositionMax140));*/ + if (!OpenTaiko.stage演奏ドラム画面.bPAUSE) LuaUpdate.Call(player); + } catch (Exception ex) { + LuaScript.Dispose(); + LuaScript = null; } - - public new void Update(int player) { - if (LuaScript == null) return; - try { - float currentFloorPositionMax140 = 0; - - if (OpenTaiko.stageSongSelect.rChoosenSong.arスコア[5] != null) { - int maxFloor = OpenTaiko.stageSongSelect.rChoosenSong.arスコア[5].譜面情報.nTotalFloor; - int nightTime = Math.Max(140, maxFloor / 2); - - currentFloorPositionMax140 = Math.Min(OpenTaiko.stage演奏ドラム画面.actPlayInfo.NowMeasure[0] / (float)nightTime, 1f); - } - - LuaUpdateValues.Call(OpenTaiko.FPS.DeltaTime, OpenTaiko.FPS.NowFPS, OpenTaiko.stage演奏ドラム画面.bIsAlreadyCleared, (double)currentFloorPositionMax140); - /*LuaScript.SetObjectToPath("fps", TJAPlayer3.FPS.n現在のFPS); - LuaScript.SetObjectToPath("deltaTime", TJAPlayer3.FPS.DeltaTime); - LuaScript.SetObjectToPath("isClear", TJAPlayer3.stage演奏ドラム画面.bIsAlreadyCleared); - LuaScript.SetObjectToPath("towerNightOpacity", (double)(255 * currentFloorPositionMax140));*/ - if (!OpenTaiko.stage演奏ドラム画面.bPAUSE) LuaUpdate.Call(player); - } catch (Exception ex) { - LuaScript.Dispose(); - LuaScript = null; - } - } - public new void Draw(int player) { - if (LuaScript == null) return; - try { - LuaDraw.Call(player); - } catch (Exception ex) { - LuaScript.Dispose(); - LuaScript = null; - } + } + public new void Draw(int player) { + if (LuaScript == null) return; + try { + LuaDraw.Call(player); + } catch (Exception ex) { + LuaScript.Dispose(); + LuaScript = null; } } } diff --git a/OpenTaiko/src/Stages/07.Game/Taiko/FireWorks.cs b/OpenTaiko/src/Stages/07.Game/Taiko/FireWorks.cs index 062134e5..bd338042 100644 --- a/OpenTaiko/src/Stages/07.Game/Taiko/FireWorks.cs +++ b/OpenTaiko/src/Stages/07.Game/Taiko/FireWorks.cs @@ -2,93 +2,92 @@ using System.Runtime.InteropServices; using FDK; -namespace OpenTaiko { - internal class FireWorks : CActivity { - // コンストラクタ +namespace OpenTaiko; - public FireWorks() { - base.IsDeActivated = true; - } +internal class FireWorks : CActivity { + // コンストラクタ + + public FireWorks() { + base.IsDeActivated = true; + } - // メソッド + // メソッド - /// - /// 大音符の花火エフェクト - /// - /// - public virtual void Start(int nLane, int nPlayer, double x, double y) { - if (OpenTaiko.ConfigIni.SimpleMode) return; + /// + /// 大音符の花火エフェクト + /// + /// + public virtual void Start(int nLane, int nPlayer, double x, double y) { + if (OpenTaiko.ConfigIni.SimpleMode) return; - for (int i = 0; i < 32; i++) { - if (!FireWork[i].IsUsing) { - FireWork[i].IsUsing = true; - FireWork[i].Lane = nLane; - FireWork[i].Player = nPlayer; - FireWork[i].X = x; - FireWork[i].Y = y; - FireWork[i].Counter = new CCounter(0, OpenTaiko.Skin.Game_Effect_FireWorks[2] - 1, OpenTaiko.Skin.Game_Effect_FireWorks_Timer, OpenTaiko.Timer); - break; - } + for (int i = 0; i < 32; i++) { + if (!FireWork[i].IsUsing) { + FireWork[i].IsUsing = true; + FireWork[i].Lane = nLane; + FireWork[i].Player = nPlayer; + FireWork[i].X = x; + FireWork[i].Y = y; + FireWork[i].Counter = new CCounter(0, OpenTaiko.Skin.Game_Effect_FireWorks[2] - 1, OpenTaiko.Skin.Game_Effect_FireWorks_Timer, OpenTaiko.Timer); + break; } } + } - // CActivity 実装 + // CActivity 実装 - public override void Activate() { + public override void Activate() { + for (int i = 0; i < 32; i++) { + FireWork[i] = new Status(); + FireWork[i].IsUsing = false; + FireWork[i].Counter = new CCounter(); + } + base.Activate(); + } + public override void DeActivate() { + for (int i = 0; i < 32; i++) { + FireWork[i].Counter = null; + } + base.DeActivate(); + } + public override void CreateManagedResource() { + base.CreateManagedResource(); + } + public override void ReleaseManagedResource() { + base.ReleaseManagedResource(); + } + public override int Draw() { + if (!base.IsDeActivated && !OpenTaiko.ConfigIni.SimpleMode) { for (int i = 0; i < 32; i++) { - FireWork[i] = new Status(); - FireWork[i].IsUsing = false; - FireWork[i].Counter = new CCounter(); - } - base.Activate(); - } - public override void DeActivate() { - for (int i = 0; i < 32; i++) { - FireWork[i].Counter = null; - } - base.DeActivate(); - } - public override void CreateManagedResource() { - base.CreateManagedResource(); - } - public override void ReleaseManagedResource() { - base.ReleaseManagedResource(); - } - public override int Draw() { - if (!base.IsDeActivated && !OpenTaiko.ConfigIni.SimpleMode) { - for (int i = 0; i < 32; i++) { - if (FireWork[i].IsUsing) { - FireWork[i].Counter.Tick(); - OpenTaiko.Tx.Effects_Hit_FireWorks?.t2D中心基準描画((float)FireWork[i].X, (float)FireWork[i].Y, 1, new Rectangle(FireWork[i].Counter.CurrentValue * OpenTaiko.Skin.Game_Effect_FireWorks[0], 0, OpenTaiko.Skin.Game_Effect_FireWorks[0], OpenTaiko.Skin.Game_Effect_FireWorks[1])); - if (FireWork[i].Counter.IsEnded) { - FireWork[i].Counter.Stop(); - FireWork[i].IsUsing = false; - } + if (FireWork[i].IsUsing) { + FireWork[i].Counter.Tick(); + OpenTaiko.Tx.Effects_Hit_FireWorks?.t2D中心基準描画((float)FireWork[i].X, (float)FireWork[i].Y, 1, new Rectangle(FireWork[i].Counter.CurrentValue * OpenTaiko.Skin.Game_Effect_FireWorks[0], 0, OpenTaiko.Skin.Game_Effect_FireWorks[0], OpenTaiko.Skin.Game_Effect_FireWorks[1])); + if (FireWork[i].Counter.IsEnded) { + FireWork[i].Counter.Stop(); + FireWork[i].IsUsing = false; } } } - return 0; } - - - // その他 - - #region [ private ] - //----------------- - [StructLayout(LayoutKind.Sequential)] - private struct Status { - public int Lane; - public int Player; - public bool IsUsing; - public CCounter Counter; - public double X; - public double Y; - } - private Status[] FireWork = new Status[32]; - - //----------------- - #endregion + return 0; } -} + + // その他 + + #region [ private ] + //----------------- + [StructLayout(LayoutKind.Sequential)] + private struct Status { + public int Lane; + public int Player; + public bool IsUsing; + public CCounter Counter; + public double X; + public double Y; + } + private Status[] FireWork = new Status[32]; + + //----------------- + #endregion +} diff --git a/OpenTaiko/src/Stages/07.Game/Taiko/FlyingNotes.cs b/OpenTaiko/src/Stages/07.Game/Taiko/FlyingNotes.cs index cd677cb5..54e2d74a 100644 --- a/OpenTaiko/src/Stages/07.Game/Taiko/FlyingNotes.cs +++ b/OpenTaiko/src/Stages/07.Game/Taiko/FlyingNotes.cs @@ -1,202 +1,202 @@ using System.Runtime.InteropServices; using FDK; -namespace OpenTaiko { - internal class FlyingNotes : CActivity { - // Constructor +namespace OpenTaiko; - public FlyingNotes() { - base.IsDeActivated = true; - } +internal class FlyingNotes : CActivity { + // Constructor + + public FlyingNotes() { + base.IsDeActivated = true; + } - // メソッド - public virtual void Start(int nLane, int nPlayer, bool isRoll = false) { - if (OpenTaiko.ConfigIni.nPlayerCount > 2 || OpenTaiko.ConfigIni.SimpleMode) return; - EGameType _gt = OpenTaiko.ConfigIni.nGameType[OpenTaiko.GetActualPlayer(nPlayer)]; + // メソッド + public virtual void Start(int nLane, int nPlayer, bool isRoll = false) { + if (OpenTaiko.ConfigIni.nPlayerCount > 2 || OpenTaiko.ConfigIni.SimpleMode) return; + EGameType _gt = OpenTaiko.ConfigIni.nGameType[OpenTaiko.GetActualPlayer(nPlayer)]; - if (OpenTaiko.Tx.Notes[(int)_gt] != null) { - for (int i = 0; i < 128; i++) { - if (!Flying[i].IsUsing) { - // 初期化 - Flying[i].IsUsing = true; - Flying[i].Lane = nLane; - Flying[i].Player = nPlayer; - Flying[i].X = -100; //StartPointX[nPlayer]; - Flying[i].Y = -100; //TJAPlayer3.Skin.Game_Effect_FlyingNotes_StartPoint_Y[nPlayer]; - Flying[i].StartPointX = StartPointX[nPlayer]; - Flying[i].StartPointY = OpenTaiko.Skin.Game_Effect_FlyingNotes_StartPoint_Y[nPlayer]; - Flying[i].OldValue = 0; - Flying[i].IsRoll = isRoll; - // 角度の決定 - Flying[i].Height = Math.Abs(OpenTaiko.Skin.Game_Effect_FlyingNotes_EndPoint_Y[nPlayer] - OpenTaiko.Skin.Game_Effect_FlyingNotes_StartPoint_Y[nPlayer]); - Flying[i].Width = (Math.Abs((OpenTaiko.Skin.Game_Effect_FlyingNotes_EndPoint_X[nPlayer] - StartPointX[nPlayer])) / 2); - //Console.WriteLine("{0}, {1}", width2P, height2P); - Flying[i].Theta = ((Math.Atan2(Flying[i].Height, Flying[i].Width) * 180.0) / Math.PI); - Flying[i].Counter = new CCounter(0, 140, OpenTaiko.Skin.Game_Effect_FlyingNotes_Timer, OpenTaiko.Timer); - //Flying[i].Counter = new CCounter(0, 200000, CDTXMania.Skin.Game_Effect_FlyingNotes_Timer, CDTXMania.Timer); + if (OpenTaiko.Tx.Notes[(int)_gt] != null) { + for (int i = 0; i < 128; i++) { + if (!Flying[i].IsUsing) { + // 初期化 + Flying[i].IsUsing = true; + Flying[i].Lane = nLane; + Flying[i].Player = nPlayer; + Flying[i].X = -100; //StartPointX[nPlayer]; + Flying[i].Y = -100; //TJAPlayer3.Skin.Game_Effect_FlyingNotes_StartPoint_Y[nPlayer]; + Flying[i].StartPointX = StartPointX[nPlayer]; + Flying[i].StartPointY = OpenTaiko.Skin.Game_Effect_FlyingNotes_StartPoint_Y[nPlayer]; + Flying[i].OldValue = 0; + Flying[i].IsRoll = isRoll; + // 角度の決定 + Flying[i].Height = Math.Abs(OpenTaiko.Skin.Game_Effect_FlyingNotes_EndPoint_Y[nPlayer] - OpenTaiko.Skin.Game_Effect_FlyingNotes_StartPoint_Y[nPlayer]); + Flying[i].Width = (Math.Abs((OpenTaiko.Skin.Game_Effect_FlyingNotes_EndPoint_X[nPlayer] - StartPointX[nPlayer])) / 2); + //Console.WriteLine("{0}, {1}", width2P, height2P); + Flying[i].Theta = ((Math.Atan2(Flying[i].Height, Flying[i].Width) * 180.0) / Math.PI); + Flying[i].Counter = new CCounter(0, 140, OpenTaiko.Skin.Game_Effect_FlyingNotes_Timer, OpenTaiko.Timer); + //Flying[i].Counter = new CCounter(0, 200000, CDTXMania.Skin.Game_Effect_FlyingNotes_Timer, CDTXMania.Timer); - Flying[i].IncreaseX = (1.00 * Math.Abs((OpenTaiko.Skin.Game_Effect_FlyingNotes_EndPoint_X[nPlayer] - StartPointX[nPlayer]))) / (180); - Flying[i].IncreaseY = (1.00 * Math.Abs((OpenTaiko.Skin.Game_Effect_FlyingNotes_EndPoint_Y[nPlayer] - OpenTaiko.Skin.Game_Effect_FlyingNotes_StartPoint_Y[nPlayer]))) / (180); - break; - } + Flying[i].IncreaseX = (1.00 * Math.Abs((OpenTaiko.Skin.Game_Effect_FlyingNotes_EndPoint_X[nPlayer] - StartPointX[nPlayer]))) / (180); + Flying[i].IncreaseY = (1.00 * Math.Abs((OpenTaiko.Skin.Game_Effect_FlyingNotes_EndPoint_Y[nPlayer] - OpenTaiko.Skin.Game_Effect_FlyingNotes_StartPoint_Y[nPlayer]))) / (180); + break; } } } + } - // CActivity 実装 + // CActivity 実装 - public override void Activate() { + public override void Activate() { + for (int i = 0; i < 128; i++) { + Flying[i] = new Status(); + Flying[i].IsUsing = false; + Flying[i].Counter = new CCounter(); + } + for (int i = 0; i < 2; i++) { + StartPointX[i] = OpenTaiko.Skin.Game_Effect_FlyingNotes_StartPoint_X[i]; + } + base.Activate(); + } + public override void DeActivate() { + for (int i = 0; i < 128; i++) { + Flying[i].Counter = null; + } + base.DeActivate(); + } + public override void CreateManagedResource() { + base.CreateManagedResource(); + } + public override void ReleaseManagedResource() { + base.ReleaseManagedResource(); + } + public override int Draw() { + if (!base.IsDeActivated && !OpenTaiko.ConfigIni.SimpleMode) { for (int i = 0; i < 128; i++) { - Flying[i] = new Status(); - Flying[i].IsUsing = false; - Flying[i].Counter = new CCounter(); - } - for (int i = 0; i < 2; i++) { - StartPointX[i] = OpenTaiko.Skin.Game_Effect_FlyingNotes_StartPoint_X[i]; - } - base.Activate(); - } - public override void DeActivate() { - for (int i = 0; i < 128; i++) { - Flying[i].Counter = null; - } - base.DeActivate(); - } - public override void CreateManagedResource() { - base.CreateManagedResource(); - } - public override void ReleaseManagedResource() { - base.ReleaseManagedResource(); - } - public override int Draw() { - if (!base.IsDeActivated && !OpenTaiko.ConfigIni.SimpleMode) { - for (int i = 0; i < 128; i++) { - if (Flying[i].IsUsing) { - Flying[i].OldValue = Flying[i].Counter.CurrentValue; - Flying[i].Counter.Tick(); - if (Flying[i].Counter.IsEnded) { - Flying[i].Counter.Stop(); - Flying[i].IsUsing = false; - OpenTaiko.stage演奏ドラム画面.actGauge.Start(Flying[i].Lane, ENoteJudge.Perfect, Flying[i].Player); - OpenTaiko.stage演奏ドラム画面.actChipEffects.Start(Flying[i].Player, Flying[i].Lane); + if (Flying[i].IsUsing) { + Flying[i].OldValue = Flying[i].Counter.CurrentValue; + Flying[i].Counter.Tick(); + if (Flying[i].Counter.IsEnded) { + Flying[i].Counter.Stop(); + Flying[i].IsUsing = false; + OpenTaiko.stage演奏ドラム画面.actGauge.Start(Flying[i].Lane, ENoteJudge.Perfect, Flying[i].Player); + OpenTaiko.stage演奏ドラム画面.actChipEffects.Start(Flying[i].Player, Flying[i].Lane); + } + for (int n = Flying[i].OldValue; n < Flying[i].Counter.CurrentValue; n += 16) { + int endX; + int endY; + + if (OpenTaiko.ConfigIni.bAIBattleMode) { + endX = OpenTaiko.Skin.Game_Effect_FlyingNotes_EndPoint_X_AI[Flying[i].Player]; + endY = OpenTaiko.Skin.Game_Effect_FlyingNotes_EndPoint_Y_AI[Flying[i].Player]; + } else { + endX = OpenTaiko.Skin.Game_Effect_FlyingNotes_EndPoint_X[Flying[i].Player]; + endY = OpenTaiko.Skin.Game_Effect_FlyingNotes_EndPoint_Y[Flying[i].Player]; } - for (int n = Flying[i].OldValue; n < Flying[i].Counter.CurrentValue; n += 16) { - int endX; - int endY; - if (OpenTaiko.ConfigIni.bAIBattleMode) { - endX = OpenTaiko.Skin.Game_Effect_FlyingNotes_EndPoint_X_AI[Flying[i].Player]; - endY = OpenTaiko.Skin.Game_Effect_FlyingNotes_EndPoint_Y_AI[Flying[i].Player]; - } else { - endX = OpenTaiko.Skin.Game_Effect_FlyingNotes_EndPoint_X[Flying[i].Player]; - endY = OpenTaiko.Skin.Game_Effect_FlyingNotes_EndPoint_Y[Flying[i].Player]; - } - - int movingDistanceX = endX - StartPointX[Flying[i].Player]; - int movingDistanceY = endY - OpenTaiko.Skin.Game_Effect_FlyingNotes_StartPoint_Y[Flying[i].Player]; - - /* - if (TJAPlayer3.Skin.Game_Effect_FlyingNotes_IsUsingEasing) - { - Flying[i].X = (Flying[i].StartPointX + movingDistanceX + ((-Math.Cos(Flying[i].Counter.n現在の値 * (Math.PI / 180)) * movingDistanceX))) - 85; - //Flying[i].X += (Math.Cos(Flying[i].Counter.n現在の値 * (Math.PI / 180))) * Flying[i].Increase; - } - else - { - Flying[i].X += Flying[i].IncreaseX; - } - */ - - double value = (Flying[i].Counter.CurrentValue / 140.0); - - Flying[i].X = StartPointX[Flying[i].Player] + OpenTaiko.stage演奏ドラム画面.GetJPOSCROLLX(Flying[i].Player) + (movingDistanceX * value); - Flying[i].Y = OpenTaiko.Skin.Game_Effect_FlyingNotes_StartPoint_Y[Flying[i].Player] + OpenTaiko.stage演奏ドラム画面.GetJPOSCROLLY(Flying[i].Player) + (int)(movingDistanceY * value); - - if (OpenTaiko.ConfigIni.bAIBattleMode) { - Flying[i].Y += Math.Sin(value * Math.PI) * ((Flying[i].Player == 0 ? -OpenTaiko.Skin.Game_Effect_FlyingNotes_Sine : OpenTaiko.Skin.Game_Effect_FlyingNotes_Sine) / 3.0); - } else { - Flying[i].Y += Math.Sin(value * Math.PI) * (Flying[i].Player == 0 ? -OpenTaiko.Skin.Game_Effect_FlyingNotes_Sine : OpenTaiko.Skin.Game_Effect_FlyingNotes_Sine); - } - - if (OpenTaiko.Skin.Game_Effect_FlyingNotes_IsUsingEasing) { - } else { - } - - if (n % OpenTaiko.Skin.Game_Effect_FireWorks_Timing == 0 && !Flying[i].IsRoll && Flying[i].Counter.CurrentValue > 18) { - if (Flying[i].Lane == 3 || Flying[i].Lane == 4) { - OpenTaiko.stage演奏ドラム画面.FireWorks.Start(Flying[i].Lane, Flying[i].Player, Flying[i].X, Flying[i].Y); - } - } - - /* - if (Flying[i].Player == 0) - { - Flying[i].Y = ((TJAPlayer3.Skin.Game_Effect_FlyingNotes_StartPoint_Y[Flying[i].Player]) + -Math.Sin(Flying[i].Counter.n現在の値 * (Math.PI / 180)) * 559) + 329; - Flying[i].Y -= Flying[i].IncreaseY * Flying[i].Counter.n現在の値; - } - else - { - Flying[i].Y = ((TJAPlayer3.Skin.Game_Effect_FlyingNotes_StartPoint_Y[Flying[i].Player]) + Math.Sin(Flying[i].Counter.n現在の値 * (Math.PI / 180)) * 559) - 329; - Flying[i].Y += Flying[i].IncreaseY * Flying[i].Counter.n現在の値; - } - */ - } - //Flying[i].OldValue = Flying[i].Counter.n現在の値; - - NotesManager.DisplayNote(Flying[i].Player, (int)Flying[i].X, (int)Flying[i].Y, Flying[i].Lane); + int movingDistanceX = endX - StartPointX[Flying[i].Player]; + int movingDistanceY = endY - OpenTaiko.Skin.Game_Effect_FlyingNotes_StartPoint_Y[Flying[i].Player]; /* - EGameType _gt = TJAPlayer3.ConfigIni.nGameType[TJAPlayer3.GetActualPlayer(Flying[i].Player)]; - - TJAPlayer3.Tx.Notes[(int)_gt]?.t2D中心基準描画((int)Flying[i].X, (int)Flying[i].Y, new Rectangle(Flying[i].Lane * 130, 0, 130, 130)); + if (TJAPlayer3.Skin.Game_Effect_FlyingNotes_IsUsingEasing) + { + Flying[i].X = (Flying[i].StartPointX + movingDistanceX + ((-Math.Cos(Flying[i].Counter.n現在の値 * (Math.PI / 180)) * movingDistanceX))) - 85; + //Flying[i].X += (Math.Cos(Flying[i].Counter.n現在の値 * (Math.PI / 180))) * Flying[i].Increase; + } + else + { + Flying[i].X += Flying[i].IncreaseX; + } */ + double value = (Flying[i].Counter.CurrentValue / 140.0); + + Flying[i].X = StartPointX[Flying[i].Player] + OpenTaiko.stage演奏ドラム画面.GetJPOSCROLLX(Flying[i].Player) + (movingDistanceX * value); + Flying[i].Y = OpenTaiko.Skin.Game_Effect_FlyingNotes_StartPoint_Y[Flying[i].Player] + OpenTaiko.stage演奏ドラム画面.GetJPOSCROLLY(Flying[i].Player) + (int)(movingDistanceY * value); + + if (OpenTaiko.ConfigIni.bAIBattleMode) { + Flying[i].Y += Math.Sin(value * Math.PI) * ((Flying[i].Player == 0 ? -OpenTaiko.Skin.Game_Effect_FlyingNotes_Sine : OpenTaiko.Skin.Game_Effect_FlyingNotes_Sine) / 3.0); + } else { + Flying[i].Y += Math.Sin(value * Math.PI) * (Flying[i].Player == 0 ? -OpenTaiko.Skin.Game_Effect_FlyingNotes_Sine : OpenTaiko.Skin.Game_Effect_FlyingNotes_Sine); + } + + if (OpenTaiko.Skin.Game_Effect_FlyingNotes_IsUsingEasing) { + } else { + } + + if (n % OpenTaiko.Skin.Game_Effect_FireWorks_Timing == 0 && !Flying[i].IsRoll && Flying[i].Counter.CurrentValue > 18) { + if (Flying[i].Lane == 3 || Flying[i].Lane == 4) { + OpenTaiko.stage演奏ドラム画面.FireWorks.Start(Flying[i].Lane, Flying[i].Player, Flying[i].X, Flying[i].Y); + } + } + /* if (Flying[i].Player == 0) { - + Flying[i].Y = ((TJAPlayer3.Skin.Game_Effect_FlyingNotes_StartPoint_Y[Flying[i].Player]) + -Math.Sin(Flying[i].Counter.n現在の値 * (Math.PI / 180)) * 559) + 329; + Flying[i].Y -= Flying[i].IncreaseY * Flying[i].Counter.n現在の値; } - else if (Flying[i].Player == 1) + else { - // - TJAPlayer3.Tx.Notes?.t2D中心基準描画((int)Flying[i].X, (int)Flying[i].Y, new Rectangle(Flying[i].Lane * 130, 0, 130, 130)); + Flying[i].Y = ((TJAPlayer3.Skin.Game_Effect_FlyingNotes_StartPoint_Y[Flying[i].Player]) + Math.Sin(Flying[i].Counter.n現在の値 * (Math.PI / 180)) * 559) - 329; + Flying[i].Y += Flying[i].IncreaseY * Flying[i].Counter.n現在の値; } */ } + //Flying[i].OldValue = Flying[i].Counter.n現在の値; + + NotesManager.DisplayNote(Flying[i].Player, (int)Flying[i].X, (int)Flying[i].Y, Flying[i].Lane); + + /* + EGameType _gt = TJAPlayer3.ConfigIni.nGameType[TJAPlayer3.GetActualPlayer(Flying[i].Player)]; + + TJAPlayer3.Tx.Notes[(int)_gt]?.t2D中心基準描画((int)Flying[i].X, (int)Flying[i].Y, new Rectangle(Flying[i].Lane * 130, 0, 130, 130)); + */ + + /* + if (Flying[i].Player == 0) + { + + } + else if (Flying[i].Player == 1) + { + // + TJAPlayer3.Tx.Notes?.t2D中心基準描画((int)Flying[i].X, (int)Flying[i].Y, new Rectangle(Flying[i].Lane * 130, 0, 130, 130)); + } + */ } } - return base.Draw(); } - - - #region [ private ] - //----------------- - - [StructLayout(LayoutKind.Sequential)] - private struct Status { - public int Lane; - public int Player; - public bool IsUsing; - public CCounter Counter; - public int OldValue; - public double X; - public double Y; - public int Height; - public int Width; - public double IncreaseX; - public double IncreaseY; - public bool IsRoll; - public int StartPointX; - public int StartPointY; - public double Theta; - } - - private Status[] Flying = new Status[128]; - - public readonly int[] StartPointX = new int[2]; - - //----------------- - #endregion + return base.Draw(); } + + + #region [ private ] + //----------------- + + [StructLayout(LayoutKind.Sequential)] + private struct Status { + public int Lane; + public int Player; + public bool IsUsing; + public CCounter Counter; + public int OldValue; + public double X; + public double Y; + public int Height; + public int Width; + public double IncreaseX; + public double IncreaseY; + public bool IsRoll; + public int StartPointX; + public int StartPointY; + public double Theta; + } + + private Status[] Flying = new Status[128]; + + public readonly int[] StartPointX = new int[2]; + + //----------------- + #endregion } diff --git a/OpenTaiko/src/Stages/07.Game/Taiko/GoGoSplash.cs b/OpenTaiko/src/Stages/07.Game/Taiko/GoGoSplash.cs index 00bdd1fa..62da40a6 100644 --- a/OpenTaiko/src/Stages/07.Game/Taiko/GoGoSplash.cs +++ b/OpenTaiko/src/Stages/07.Game/Taiko/GoGoSplash.cs @@ -1,61 +1,61 @@ using System.Drawing; using FDK; -namespace OpenTaiko { - class GoGoSplash : CActivity { - public GoGoSplash() { - this.IsDeActivated = true; - } +namespace OpenTaiko; - public override void Activate() { - Splash = new CCounter(); - base.Activate(); - } - - public override void DeActivate() { - base.DeActivate(); - } - - /// - /// ゴーゴースプラッシュの描画処理です。 - /// SkinCofigで本数を変更することができます。 - /// - /// - public override int Draw() { - if (Splash == null || OpenTaiko.ConfigIni.SimpleMode) return base.Draw(); - Splash.Tick(); - if (Splash.IsEnded) { - Splash.CurrentValue = 0; - Splash.Stop(); - } - if (Splash.IsTicked) { - for (int i = 0; i < OpenTaiko.Skin.Game_Effect_GoGoSplash_X.Length; i++) { - if (i > OpenTaiko.Skin.Game_Effect_GoGoSplash_Y.Length) break; - // Yの配列がiよりも小さかったらそこでキャンセルする。 - if (OpenTaiko.Skin.Game_Effect_GoGoSplash_Rotate && OpenTaiko.Tx.Effects_GoGoSplash != null) { - // Switch文を使いたかったが、定数じゃないから使えねぇ!!!! - if (i == 0) { - OpenTaiko.Tx.Effects_GoGoSplash.fZ軸中心回転 = -0.2792526803190927f; - } else if (i == 1) { - OpenTaiko.Tx.Effects_GoGoSplash.fZ軸中心回転 = -0.13962634015954636f; - } else if (i == OpenTaiko.Skin.Game_Effect_GoGoSplash_X.Length - 2) { - OpenTaiko.Tx.Effects_GoGoSplash.fZ軸中心回転 = 0.13962634015954636f; - } else if (i == OpenTaiko.Skin.Game_Effect_GoGoSplash_X.Length - 1) { - OpenTaiko.Tx.Effects_GoGoSplash.fZ軸中心回転 = 0.2792526803190927f; - } else { - OpenTaiko.Tx.Effects_GoGoSplash.fZ軸中心回転 = 0.0f; - } - } - OpenTaiko.Tx.Effects_GoGoSplash?.t2D拡大率考慮下中心基準描画(OpenTaiko.Skin.Game_Effect_GoGoSplash_X[i], OpenTaiko.Skin.Game_Effect_GoGoSplash_Y[i], new Rectangle(OpenTaiko.Skin.Game_Effect_GoGoSplash[0] * Splash.CurrentValue, 0, OpenTaiko.Skin.Game_Effect_GoGoSplash[0], OpenTaiko.Skin.Game_Effect_GoGoSplash[1])); - } - } - return base.Draw(); - } - - public void StartSplash() { - Splash = new CCounter(0, OpenTaiko.Skin.Game_Effect_GoGoSplash[2] - 1, OpenTaiko.Skin.Game_Effect_GoGoSplash_Timer, OpenTaiko.Timer); - } - - private CCounter Splash; +class GoGoSplash : CActivity { + public GoGoSplash() { + this.IsDeActivated = true; } + + public override void Activate() { + Splash = new CCounter(); + base.Activate(); + } + + public override void DeActivate() { + base.DeActivate(); + } + + /// + /// ゴーゴースプラッシュの描画処理です。 + /// SkinCofigで本数を変更することができます。 + /// + /// + public override int Draw() { + if (Splash == null || OpenTaiko.ConfigIni.SimpleMode) return base.Draw(); + Splash.Tick(); + if (Splash.IsEnded) { + Splash.CurrentValue = 0; + Splash.Stop(); + } + if (Splash.IsTicked) { + for (int i = 0; i < OpenTaiko.Skin.Game_Effect_GoGoSplash_X.Length; i++) { + if (i > OpenTaiko.Skin.Game_Effect_GoGoSplash_Y.Length) break; + // Yの配列がiよりも小さかったらそこでキャンセルする。 + if (OpenTaiko.Skin.Game_Effect_GoGoSplash_Rotate && OpenTaiko.Tx.Effects_GoGoSplash != null) { + // Switch文を使いたかったが、定数じゃないから使えねぇ!!!! + if (i == 0) { + OpenTaiko.Tx.Effects_GoGoSplash.fZ軸中心回転 = -0.2792526803190927f; + } else if (i == 1) { + OpenTaiko.Tx.Effects_GoGoSplash.fZ軸中心回転 = -0.13962634015954636f; + } else if (i == OpenTaiko.Skin.Game_Effect_GoGoSplash_X.Length - 2) { + OpenTaiko.Tx.Effects_GoGoSplash.fZ軸中心回転 = 0.13962634015954636f; + } else if (i == OpenTaiko.Skin.Game_Effect_GoGoSplash_X.Length - 1) { + OpenTaiko.Tx.Effects_GoGoSplash.fZ軸中心回転 = 0.2792526803190927f; + } else { + OpenTaiko.Tx.Effects_GoGoSplash.fZ軸中心回転 = 0.0f; + } + } + OpenTaiko.Tx.Effects_GoGoSplash?.t2D拡大率考慮下中心基準描画(OpenTaiko.Skin.Game_Effect_GoGoSplash_X[i], OpenTaiko.Skin.Game_Effect_GoGoSplash_Y[i], new Rectangle(OpenTaiko.Skin.Game_Effect_GoGoSplash[0] * Splash.CurrentValue, 0, OpenTaiko.Skin.Game_Effect_GoGoSplash[0], OpenTaiko.Skin.Game_Effect_GoGoSplash[1])); + } + } + return base.Draw(); + } + + public void StartSplash() { + Splash = new CCounter(0, OpenTaiko.Skin.Game_Effect_GoGoSplash[2] - 1, OpenTaiko.Skin.Game_Effect_GoGoSplash_Timer, OpenTaiko.Timer); + } + + private CCounter Splash; } diff --git a/OpenTaiko/src/Stages/07.Game/Taiko/KusudamaScript.cs b/OpenTaiko/src/Stages/07.Game/Taiko/KusudamaScript.cs index ce736f2c..62b9876a 100644 --- a/OpenTaiko/src/Stages/07.Game/Taiko/KusudamaScript.cs +++ b/OpenTaiko/src/Stages/07.Game/Taiko/KusudamaScript.cs @@ -1,48 +1,48 @@ using NLua; -namespace OpenTaiko { - internal class KusudamaScript : ScriptBG { - private LuaFunction LuaKusuIn; - private LuaFunction LuaKusuBroke; - private LuaFunction LuaKusuMiss; +namespace OpenTaiko; - public KusudamaScript(string filePath) : base(filePath) { - if (LuaScript != null) { - LuaKusuIn = LuaScript.GetFunction("kusuIn"); - LuaKusuBroke = LuaScript.GetFunction("kusuBroke"); - LuaKusuMiss = LuaScript.GetFunction("kusuMiss"); - } +internal class KusudamaScript : ScriptBG { + private LuaFunction LuaKusuIn; + private LuaFunction LuaKusuBroke; + private LuaFunction LuaKusuMiss; + + public KusudamaScript(string filePath) : base(filePath) { + if (LuaScript != null) { + LuaKusuIn = LuaScript.GetFunction("kusuIn"); + LuaKusuBroke = LuaScript.GetFunction("kusuBroke"); + LuaKusuMiss = LuaScript.GetFunction("kusuMiss"); } + } - public new void Dispose() { - base.Dispose(); - LuaKusuIn?.Dispose(); - LuaKusuBroke?.Dispose(); - LuaKusuMiss?.Dispose(); + public new void Dispose() { + base.Dispose(); + LuaKusuIn?.Dispose(); + LuaKusuBroke?.Dispose(); + LuaKusuMiss?.Dispose(); + } + + public void KusuIn() { + if (LuaScript == null) return; + try { + LuaKusuIn.Call(); + } catch (Exception ex) { } + } - public void KusuIn() { - if (LuaScript == null) return; - try { - LuaKusuIn.Call(); - } catch (Exception ex) { - } + public void KusuBroke() { + if (LuaScript == null) return; + try { + LuaKusuBroke.Call(); + } catch (Exception ex) { } + } - public void KusuBroke() { - if (LuaScript == null) return; - try { - LuaKusuBroke.Call(); - } catch (Exception ex) { - } - } - - public void KusuMiss() { - if (LuaScript == null) return; - try { - LuaKusuMiss.Call(); - } catch (Exception ex) { - } + public void KusuMiss() { + if (LuaScript == null) return; + try { + LuaKusuMiss.Call(); + } catch (Exception ex) { } } } diff --git a/OpenTaiko/src/Stages/07.Game/Taiko/LaneFlash.cs b/OpenTaiko/src/Stages/07.Game/Taiko/LaneFlash.cs index 76198a4a..c08cfd27 100644 --- a/OpenTaiko/src/Stages/07.Game/Taiko/LaneFlash.cs +++ b/OpenTaiko/src/Stages/07.Game/Taiko/LaneFlash.cs @@ -1,59 +1,59 @@ using FDK; -namespace OpenTaiko { - /// - /// レーンフラッシュのクラス。 - /// - public class LaneFlash : CActivity { +namespace OpenTaiko; - public LaneFlash(ref CTexture texture, int player) { - Texture = texture; - Player = player; - base.IsDeActivated = true; - } +/// +/// レーンフラッシュのクラス。 +/// +public class LaneFlash : CActivity { - public void Start() { - Counter = new CCounter(0, 100, 1, OpenTaiko.Timer); - } - - public override void Activate() { - Counter = new CCounter(); - base.Activate(); - } - - public override void DeActivate() { - Counter = null; - base.DeActivate(); - } - - public override int Draw() { - if (Texture == null || Counter == null) return base.Draw(); - if (!Counter.IsStoped) { - int x; - int y; - - if (OpenTaiko.ConfigIni.nPlayerCount == 5) { - x = OpenTaiko.Skin.Game_Lane_5P[0] + (OpenTaiko.Skin.Game_UIMove_5P[0] * Player); - y = OpenTaiko.Skin.Game_Lane_5P[1] + (OpenTaiko.Skin.Game_UIMove_5P[1] * Player); - } else if (OpenTaiko.ConfigIni.nPlayerCount == 4 || OpenTaiko.ConfigIni.nPlayerCount == 3) { - x = OpenTaiko.Skin.Game_Lane_4P[0] + (OpenTaiko.Skin.Game_UIMove_4P[0] * Player); - y = OpenTaiko.Skin.Game_Lane_4P[1] + (OpenTaiko.Skin.Game_UIMove_4P[1] * Player); - } else { - x = OpenTaiko.Skin.Game_Lane_X[Player]; - y = OpenTaiko.Skin.Game_Lane_Y[Player]; - } - - Counter.Tick(); - if (Counter.IsEnded) Counter.Stop(); - int opacity = (((150 - Counter.CurrentValue) * 255) / 100); - Texture.Opacity = opacity; - Texture.t2D描画(x, y); - } - return base.Draw(); - } - - private CTexture Texture; - private CCounter Counter; - private int Player; + public LaneFlash(ref CTexture texture, int player) { + Texture = texture; + Player = player; + base.IsDeActivated = true; } + + public void Start() { + Counter = new CCounter(0, 100, 1, OpenTaiko.Timer); + } + + public override void Activate() { + Counter = new CCounter(); + base.Activate(); + } + + public override void DeActivate() { + Counter = null; + base.DeActivate(); + } + + public override int Draw() { + if (Texture == null || Counter == null) return base.Draw(); + if (!Counter.IsStoped) { + int x; + int y; + + if (OpenTaiko.ConfigIni.nPlayerCount == 5) { + x = OpenTaiko.Skin.Game_Lane_5P[0] + (OpenTaiko.Skin.Game_UIMove_5P[0] * Player); + y = OpenTaiko.Skin.Game_Lane_5P[1] + (OpenTaiko.Skin.Game_UIMove_5P[1] * Player); + } else if (OpenTaiko.ConfigIni.nPlayerCount == 4 || OpenTaiko.ConfigIni.nPlayerCount == 3) { + x = OpenTaiko.Skin.Game_Lane_4P[0] + (OpenTaiko.Skin.Game_UIMove_4P[0] * Player); + y = OpenTaiko.Skin.Game_Lane_4P[1] + (OpenTaiko.Skin.Game_UIMove_4P[1] * Player); + } else { + x = OpenTaiko.Skin.Game_Lane_X[Player]; + y = OpenTaiko.Skin.Game_Lane_Y[Player]; + } + + Counter.Tick(); + if (Counter.IsEnded) Counter.Stop(); + int opacity = (((150 - Counter.CurrentValue) * 255) / 100); + Texture.Opacity = opacity; + Texture.t2D描画(x, y); + } + return base.Draw(); + } + + private CTexture Texture; + private CCounter Counter; + private int Player; } diff --git a/OpenTaiko/src/Stages/07.Game/Taiko/ModIcons.cs b/OpenTaiko/src/Stages/07.Game/Taiko/ModIcons.cs index a043bfac..e1ffddfa 100644 --- a/OpenTaiko/src/Stages/07.Game/Taiko/ModIcons.cs +++ b/OpenTaiko/src/Stages/07.Game/Taiko/ModIcons.cs @@ -1,173 +1,173 @@ -namespace OpenTaiko { - class ModIcons { - static Dictionary> __methods = new Dictionary>() - { - {0, (x, y, a, p) => tDisplayHSIcon(x, y, a) }, - {1, (x, y, a, p) => tDisplayDoronIcon(x, y, a) }, - {2, (x, y, a, p) => tDisplayRandomIcon(x, y, a) }, - {3, (x, y, a, p) => tDisplayFunModIcon(x, y, a) }, - {4, (x, y, a, p) => tDisplayJustIcon(x, y, a) }, - {5, (x, y, a, p) => tDisplayTimingIcon(x, y, a) }, - {6, (x, y, a, p) => tDisplaySongSpeedIcon(x, y, p) }, - {7, (x, y, a, p) => tDisplayAutoIcon(x, y, p) }, - }; +namespace OpenTaiko; - static public void tDisplayMods(int x, int y, int player) { - // +30 x/y - int actual = OpenTaiko.GetActualPlayer(player); +class ModIcons { + static Dictionary> __methods = new Dictionary>() + { + {0, (x, y, a, p) => tDisplayHSIcon(x, y, a) }, + {1, (x, y, a, p) => tDisplayDoronIcon(x, y, a) }, + {2, (x, y, a, p) => tDisplayRandomIcon(x, y, a) }, + {3, (x, y, a, p) => tDisplayFunModIcon(x, y, a) }, + {4, (x, y, a, p) => tDisplayJustIcon(x, y, a) }, + {5, (x, y, a, p) => tDisplayTimingIcon(x, y, a) }, + {6, (x, y, a, p) => tDisplaySongSpeedIcon(x, y, p) }, + {7, (x, y, a, p) => tDisplayAutoIcon(x, y, p) }, + }; - for (int i = 0; i < 8; i++) { - __methods[i](x + OpenTaiko.Skin.ModIcons_OffsetX[i], y + OpenTaiko.Skin.ModIcons_OffsetY[i], actual, player); - } + static public void tDisplayMods(int x, int y, int player) { + // +30 x/y + int actual = OpenTaiko.GetActualPlayer(player); + + for (int i = 0; i < 8; i++) { + __methods[i](x + OpenTaiko.Skin.ModIcons_OffsetX[i], y + OpenTaiko.Skin.ModIcons_OffsetY[i], actual, player); } - - static public void tDisplayModsMenu(int x, int y, int player) { - if (OpenTaiko.Tx.Mod_None != null) - OpenTaiko.Tx.Mod_None.Opacity = 0; - - int actual = OpenTaiko.GetActualPlayer(player); - - for (int i = 0; i < 8; i++) { - __methods[i](x + OpenTaiko.Skin.ModIcons_OffsetX_Menu[i], y + OpenTaiko.Skin.ModIcons_OffsetY_Menu[i], actual, player); - } - - if (OpenTaiko.Tx.Mod_None != null) - OpenTaiko.Tx.Mod_None.Opacity = 255; - } - - #region [Displayables] - - static private void tDisplayHSIcon(int x, int y, int player) { - // TO DO : Add HS x0.5 icon (_vals == 4) - var _vals = new int[] { 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 24, 29, 34, 39 }; - int _i = -1; - - for (int j = 0; j < _vals.Length; j++) { - if (OpenTaiko.ConfigIni.nScrollSpeed[player] >= _vals[j] && j < OpenTaiko.Tx.HiSp.Length) - _i = j; - else - break; - } - - if (_i >= 0) - OpenTaiko.Tx.HiSp[_i]?.t2D描画(x, y); - else - OpenTaiko.Tx.Mod_None?.t2D描画(x, y); - } - - static private void tDisplayAutoIcon(int x, int y, int player) { - bool _displayed = false; - - if (OpenTaiko.ConfigIni.bAutoPlay[player]) - _displayed = true; - - if (_displayed == true) - OpenTaiko.Tx.Mod_Auto?.t2D描画(x, y); - else - OpenTaiko.Tx.Mod_None?.t2D描画(x, y); - } - - static private void tDisplayDoronIcon(int x, int y, int player) { - var conf_ = OpenTaiko.ConfigIni.eSTEALTH[player]; - - if (conf_ == EStealthMode.Doron) - OpenTaiko.Tx.Mod_Doron?.t2D描画(x, y); - else if (conf_ == EStealthMode.Stealth) - OpenTaiko.Tx.Mod_Stealth?.t2D描画(x, y); - else - OpenTaiko.Tx.Mod_None?.t2D描画(x, y); - } - - static private void tDisplayJustIcon(int x, int y, int player) { - var conf_ = OpenTaiko.ConfigIni.bJust[player]; - - if (conf_ == 1) - OpenTaiko.Tx.Mod_Just?.t2D描画(x, y); - else if (conf_ == 2) - OpenTaiko.Tx.Mod_Safe?.t2D描画(x, y); - else - OpenTaiko.Tx.Mod_None?.t2D描画(x, y); - } - - static private void tDisplayRandomIcon(int x, int y, int player) { - var rand_ = OpenTaiko.ConfigIni.eRandom[player]; - - if (rand_ == ERandomMode.Mirror) - OpenTaiko.Tx.Mod_Mirror?.t2D描画(x, y); - else if (rand_ == ERandomMode.Random) - OpenTaiko.Tx.Mod_Random?.t2D描画(x, y); - else if (rand_ == ERandomMode.SuperRandom) - OpenTaiko.Tx.Mod_Super?.t2D描画(x, y); - else if (rand_ == ERandomMode.MirrorRandom) - OpenTaiko.Tx.Mod_Hyper?.t2D描画(x, y); - else - OpenTaiko.Tx.Mod_None?.t2D描画(x, y); - } - - static private void tDisplaySongSpeedIcon(int x, int y, int player) { - if (OpenTaiko.ConfigIni.nSongSpeed > 20) - OpenTaiko.Tx.Mod_SongSpeed[1]?.t2D描画(x, y); - else if (OpenTaiko.ConfigIni.nSongSpeed < 20) - OpenTaiko.Tx.Mod_SongSpeed[0]?.t2D描画(x, y); - else - OpenTaiko.Tx.Mod_None?.t2D描画(x, y); - } - - static private void tDisplayFunModIcon(int x, int y, int player) { - int nFun = (int)OpenTaiko.ConfigIni.nFunMods[player]; - - if (nFun > 0) - OpenTaiko.Tx.Mod_Fun[nFun]?.t2D描画(x, y); - else - OpenTaiko.Tx.Mod_None?.t2D描画(x, y); - } - - static private void tDisplayTimingIcon(int x, int y, int player) { - int zones = OpenTaiko.ConfigIni.nTimingZones[player]; - - if (zones != 2) - OpenTaiko.Tx.Mod_Timing[zones]?.t2D描画(x, y); - else - OpenTaiko.Tx.Mod_None?.t2D描画(x, y); - } - - static private void PLACEHOLDER_tDisplayNoneIcon(int x, int y, int player) { - OpenTaiko.Tx.Mod_None?.t2D描画(x, y); - } - - #endregion - - #region [Mod flags] - - static public bool tPlayIsStock(int player) { - int actual = OpenTaiko.GetActualPlayer(player); - - if (OpenTaiko.ConfigIni.nFunMods[actual] != EFunMods.None) return false; - if (OpenTaiko.ConfigIni.bJust[actual] != 0) return false; - if (OpenTaiko.ConfigIni.nTimingZones[actual] != 2) return false; - if (OpenTaiko.ConfigIni.nSongSpeed != 20) return false; - if (OpenTaiko.ConfigIni.eRandom[actual] != ERandomMode.Off) return false; - if (OpenTaiko.ConfigIni.eSTEALTH[actual] != EStealthMode.Off) return false; - if (OpenTaiko.ConfigIni.nScrollSpeed[actual] != 9) return false; - - return true; - } - static public Int64 tModsToPlayModsFlags(int player) { - byte[] _flags = new byte[8] { 0, 0, 0, 0, 0, 0, 0, 0 }; - int actual = OpenTaiko.GetActualPlayer(player); - - _flags[0] = (byte)Math.Min(255, OpenTaiko.ConfigIni.nScrollSpeed[actual]); - _flags[1] = (byte)OpenTaiko.ConfigIni.eSTEALTH[actual]; - _flags[2] = (byte)OpenTaiko.ConfigIni.eRandom[actual]; - _flags[3] = (byte)Math.Min(255, OpenTaiko.ConfigIni.nSongSpeed); - _flags[4] = (byte)OpenTaiko.ConfigIni.nTimingZones[actual]; - _flags[5] = (byte)OpenTaiko.ConfigIni.bJust[actual]; - _flags[7] = (byte)OpenTaiko.ConfigIni.nFunMods[actual]; - - return BitConverter.ToInt64(_flags, 0); - } - - - #endregion } + + static public void tDisplayModsMenu(int x, int y, int player) { + if (OpenTaiko.Tx.Mod_None != null) + OpenTaiko.Tx.Mod_None.Opacity = 0; + + int actual = OpenTaiko.GetActualPlayer(player); + + for (int i = 0; i < 8; i++) { + __methods[i](x + OpenTaiko.Skin.ModIcons_OffsetX_Menu[i], y + OpenTaiko.Skin.ModIcons_OffsetY_Menu[i], actual, player); + } + + if (OpenTaiko.Tx.Mod_None != null) + OpenTaiko.Tx.Mod_None.Opacity = 255; + } + + #region [Displayables] + + static private void tDisplayHSIcon(int x, int y, int player) { + // TO DO : Add HS x0.5 icon (_vals == 4) + var _vals = new int[] { 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 24, 29, 34, 39 }; + int _i = -1; + + for (int j = 0; j < _vals.Length; j++) { + if (OpenTaiko.ConfigIni.nScrollSpeed[player] >= _vals[j] && j < OpenTaiko.Tx.HiSp.Length) + _i = j; + else + break; + } + + if (_i >= 0) + OpenTaiko.Tx.HiSp[_i]?.t2D描画(x, y); + else + OpenTaiko.Tx.Mod_None?.t2D描画(x, y); + } + + static private void tDisplayAutoIcon(int x, int y, int player) { + bool _displayed = false; + + if (OpenTaiko.ConfigIni.bAutoPlay[player]) + _displayed = true; + + if (_displayed == true) + OpenTaiko.Tx.Mod_Auto?.t2D描画(x, y); + else + OpenTaiko.Tx.Mod_None?.t2D描画(x, y); + } + + static private void tDisplayDoronIcon(int x, int y, int player) { + var conf_ = OpenTaiko.ConfigIni.eSTEALTH[player]; + + if (conf_ == EStealthMode.Doron) + OpenTaiko.Tx.Mod_Doron?.t2D描画(x, y); + else if (conf_ == EStealthMode.Stealth) + OpenTaiko.Tx.Mod_Stealth?.t2D描画(x, y); + else + OpenTaiko.Tx.Mod_None?.t2D描画(x, y); + } + + static private void tDisplayJustIcon(int x, int y, int player) { + var conf_ = OpenTaiko.ConfigIni.bJust[player]; + + if (conf_ == 1) + OpenTaiko.Tx.Mod_Just?.t2D描画(x, y); + else if (conf_ == 2) + OpenTaiko.Tx.Mod_Safe?.t2D描画(x, y); + else + OpenTaiko.Tx.Mod_None?.t2D描画(x, y); + } + + static private void tDisplayRandomIcon(int x, int y, int player) { + var rand_ = OpenTaiko.ConfigIni.eRandom[player]; + + if (rand_ == ERandomMode.Mirror) + OpenTaiko.Tx.Mod_Mirror?.t2D描画(x, y); + else if (rand_ == ERandomMode.Random) + OpenTaiko.Tx.Mod_Random?.t2D描画(x, y); + else if (rand_ == ERandomMode.SuperRandom) + OpenTaiko.Tx.Mod_Super?.t2D描画(x, y); + else if (rand_ == ERandomMode.MirrorRandom) + OpenTaiko.Tx.Mod_Hyper?.t2D描画(x, y); + else + OpenTaiko.Tx.Mod_None?.t2D描画(x, y); + } + + static private void tDisplaySongSpeedIcon(int x, int y, int player) { + if (OpenTaiko.ConfigIni.nSongSpeed > 20) + OpenTaiko.Tx.Mod_SongSpeed[1]?.t2D描画(x, y); + else if (OpenTaiko.ConfigIni.nSongSpeed < 20) + OpenTaiko.Tx.Mod_SongSpeed[0]?.t2D描画(x, y); + else + OpenTaiko.Tx.Mod_None?.t2D描画(x, y); + } + + static private void tDisplayFunModIcon(int x, int y, int player) { + int nFun = (int)OpenTaiko.ConfigIni.nFunMods[player]; + + if (nFun > 0) + OpenTaiko.Tx.Mod_Fun[nFun]?.t2D描画(x, y); + else + OpenTaiko.Tx.Mod_None?.t2D描画(x, y); + } + + static private void tDisplayTimingIcon(int x, int y, int player) { + int zones = OpenTaiko.ConfigIni.nTimingZones[player]; + + if (zones != 2) + OpenTaiko.Tx.Mod_Timing[zones]?.t2D描画(x, y); + else + OpenTaiko.Tx.Mod_None?.t2D描画(x, y); + } + + static private void PLACEHOLDER_tDisplayNoneIcon(int x, int y, int player) { + OpenTaiko.Tx.Mod_None?.t2D描画(x, y); + } + + #endregion + + #region [Mod flags] + + static public bool tPlayIsStock(int player) { + int actual = OpenTaiko.GetActualPlayer(player); + + if (OpenTaiko.ConfigIni.nFunMods[actual] != EFunMods.None) return false; + if (OpenTaiko.ConfigIni.bJust[actual] != 0) return false; + if (OpenTaiko.ConfigIni.nTimingZones[actual] != 2) return false; + if (OpenTaiko.ConfigIni.nSongSpeed != 20) return false; + if (OpenTaiko.ConfigIni.eRandom[actual] != ERandomMode.Off) return false; + if (OpenTaiko.ConfigIni.eSTEALTH[actual] != EStealthMode.Off) return false; + if (OpenTaiko.ConfigIni.nScrollSpeed[actual] != 9) return false; + + return true; + } + static public Int64 tModsToPlayModsFlags(int player) { + byte[] _flags = new byte[8] { 0, 0, 0, 0, 0, 0, 0, 0 }; + int actual = OpenTaiko.GetActualPlayer(player); + + _flags[0] = (byte)Math.Min(255, OpenTaiko.ConfigIni.nScrollSpeed[actual]); + _flags[1] = (byte)OpenTaiko.ConfigIni.eSTEALTH[actual]; + _flags[2] = (byte)OpenTaiko.ConfigIni.eRandom[actual]; + _flags[3] = (byte)Math.Min(255, OpenTaiko.ConfigIni.nSongSpeed); + _flags[4] = (byte)OpenTaiko.ConfigIni.nTimingZones[actual]; + _flags[5] = (byte)OpenTaiko.ConfigIni.bJust[actual]; + _flags[7] = (byte)OpenTaiko.ConfigIni.nFunMods[actual]; + + return BitConverter.ToInt64(_flags, 0); + } + + + #endregion } diff --git a/OpenTaiko/src/Stages/07.Game/Taiko/NotesManager.cs b/OpenTaiko/src/Stages/07.Game/Taiko/NotesManager.cs index baf06881..5e40b55b 100644 --- a/OpenTaiko/src/Stages/07.Game/Taiko/NotesManager.cs +++ b/OpenTaiko/src/Stages/07.Game/Taiko/NotesManager.cs @@ -1,443 +1,442 @@ using System.Drawing; using FDK; -namespace OpenTaiko { +namespace OpenTaiko; - // Simple class containing functions to simplify readability of CChip elements - class NotesManager { +// Simple class containing functions to simplify readability of CChip elements +class NotesManager { - #region [Parsing] + #region [Parsing] - public static Dictionary NoteCorrespondanceDictionnary = new Dictionary() { - ["0"] = 0, // Empty - ["1"] = 1, // Small Don (Taiko) | Red (right) hit (Konga) - ["2"] = 2, // Small Ka (Taiko) | Yellow (left) hit (Konga) - ["3"] = 3, // Big Don (Taiko) | Pink note (Konga) - ["4"] = 4, // Big Ka (Taiko) | Clap (Konga) - ["5"] = 5, // Small roll start | Konga red roll - ["6"] = 6, // Big roll start | Konga pink roll - ["7"] = 7, // Balloon - ["8"] = 8, // Roll/Balloon end - ["9"] = 9, // Kusudama - ["A"] = 10, // Joint Big Don (2P) - ["B"] = 11, // Joint Big Ka (2P) - ["C"] = 12, // Mine - ["D"] = 13, // ProjectOutfox's Fuse roll - ["E"] = 0, // Unused - ["F"] = 15, // ADLib - ["G"] = 0xF1, // Green (Purple) double hit note - ["H"] = 16, // Konga clap roll | Taiko big roll - ["I"] = 17, // Konga yellow roll | Taiko small roll - }; - - public static bool FastFlankedParsing(string s) { - if (s[0] >= '0' && s[0] <= '9') - return true; - - for (int i = 0; i < s.Length; i++) { - if (GetNoteValueFromChar(s.Substring(i, 1)) == -1 - && s.Substring(i, 1) != ",") - return false; - } + public static Dictionary NoteCorrespondanceDictionnary = new Dictionary() { + ["0"] = 0, // Empty + ["1"] = 1, // Small Don (Taiko) | Red (right) hit (Konga) + ["2"] = 2, // Small Ka (Taiko) | Yellow (left) hit (Konga) + ["3"] = 3, // Big Don (Taiko) | Pink note (Konga) + ["4"] = 4, // Big Ka (Taiko) | Clap (Konga) + ["5"] = 5, // Small roll start | Konga red roll + ["6"] = 6, // Big roll start | Konga pink roll + ["7"] = 7, // Balloon + ["8"] = 8, // Roll/Balloon end + ["9"] = 9, // Kusudama + ["A"] = 10, // Joint Big Don (2P) + ["B"] = 11, // Joint Big Ka (2P) + ["C"] = 12, // Mine + ["D"] = 13, // ProjectOutfox's Fuse roll + ["E"] = 0, // Unused + ["F"] = 15, // ADLib + ["G"] = 0xF1, // Green (Purple) double hit note + ["H"] = 16, // Konga clap roll | Taiko big roll + ["I"] = 17, // Konga yellow roll | Taiko small roll + }; + public static bool FastFlankedParsing(string s) { + if (s[0] >= '0' && s[0] <= '9') return true; + + for (int i = 0; i < s.Length; i++) { + if (GetNoteValueFromChar(s.Substring(i, 1)) == -1 + && s.Substring(i, 1) != ",") + return false; } - public static int GetNoteValueFromChar(string chr) { - if (NoteCorrespondanceDictionnary.ContainsKey(chr)) - return NoteCorrespondanceDictionnary[chr]; - return -1; - } - - public static int GetNoteX(CDTX.CChip pChip, double timems, double scroll, int interval, float play_bpm_time, EScrollMode eScrollMode, bool roll) { - double hbtime = ((roll ? pChip.fBMSCROLLTime_end : pChip.fBMSCROLLTime) - (play_bpm_time)); - double screen_ratio = OpenTaiko.Skin.Resolution[0] / 1280.0; - switch (eScrollMode) { - case EScrollMode.Normal: - return (int)((timems / 240000.0) * interval * scroll * screen_ratio); - case EScrollMode.BMScroll: { - return (int)((hbtime / 16.0) * interval * screen_ratio); - } - case EScrollMode.HBScroll: { - return (int)((hbtime / 16.0) * interval * scroll * screen_ratio); - } - default: - return 0; - } - } - - public static int GetNoteY(CDTX.CChip pChip, double timems, double scroll, int interval, float play_bpm_time, EScrollMode eScrollMode, bool roll) { - double hbtime = ((roll ? pChip.fBMSCROLLTime_end : pChip.fBMSCROLLTime) - (play_bpm_time)); - double screen_ratio = OpenTaiko.Skin.Resolution[1] / 720.0; - switch (eScrollMode) { - case EScrollMode.Normal: - return (int)((timems / 240000.0) * interval * scroll * screen_ratio); - case EScrollMode.BMScroll: { - return 0; - } - case EScrollMode.HBScroll: { - return (int)((hbtime / 16.0) * interval * scroll * screen_ratio); - } - default: - return 0; - } - } - - #endregion - - #region [Gameplay] - - public static bool IsExpectedPad(int stored, int hit, CDTX.CChip chip, EGameType gt) { - var inPad = (EPad)hit; - var onPad = (EPad)stored; - - if (chip == null) return false; - - if (IsBigKaTaiko(chip, gt)) { - return (inPad == EPad.LBlue && onPad == EPad.RBlue) - || (inPad == EPad.RBlue && onPad == EPad.LBlue); - } - - if (IsBigDonTaiko(chip, gt)) { - return (inPad == EPad.LRed && onPad == EPad.RRed) - || (inPad == EPad.RRed && onPad == EPad.LRed); - } - - if (IsSwapNote(chip, gt)) { - bool hitBlue = inPad == EPad.LBlue || inPad == EPad.RBlue; - bool hitRed = inPad == EPad.LRed || inPad == EPad.RRed; - bool storedBlue = onPad == EPad.LBlue || onPad == EPad.RBlue; - bool storedRed = onPad == EPad.LRed || onPad == EPad.RRed; - - return (storedRed && hitBlue) - || (storedBlue && hitRed); - } - - return false; - } - - #endregion - - #region [General] - - public static bool IsCommonNote(CDTX.CChip chip) { - if (chip == null) return false; - return chip.nチャンネル番号 >= 0x11 && chip.nチャンネル番号 < 0x18; - } - public static bool IsMine(CDTX.CChip chip) { - if (chip == null) return false; - return chip.nチャンネル番号 == 0x1C; - } - - public static bool IsDonNote(CDTX.CChip chip) { - if (chip == null) return false; - return chip.nチャンネル番号 == 0x11 || chip.nチャンネル番号 == 0x13 || chip.nチャンネル番号 == 0x1A; - } - - public static bool IsKaNote(CDTX.CChip chip) { - if (chip == null) return false; - return chip.nチャンネル番号 == 0x12 || chip.nチャンネル番号 == 0x14 || chip.nチャンネル番号 == 0x1B; - } - - public static bool IsSmallNote(CDTX.CChip chip, bool blue) { - if (chip == null) return false; - return blue ? chip.nチャンネル番号 == 0x12 : chip.nチャンネル番号 == 0x11; - } - - public static bool IsSmallNote(CDTX.CChip chip) { - if (chip == null) return false; - return chip.nチャンネル番号 == 0x12 || chip.nチャンネル番号 == 0x11; - } - - public static bool IsBigNote(CDTX.CChip chip) { - if (chip == null) return false; - return (chip.nチャンネル番号 == 0x13 || chip.nチャンネル番号 == 0x14 || chip.nチャンネル番号 == 0x1A || chip.nチャンネル番号 == 0x1B); - } - - public static bool IsBigKaTaiko(CDTX.CChip chip, EGameType gt) { - if (chip == null) return false; - return (chip.nチャンネル番号 == 0x14 || chip.nチャンネル番号 == 0x1B) && gt == EGameType.Taiko; - } - - public static bool IsBigDonTaiko(CDTX.CChip chip, EGameType gt) { - if (chip == null) return false; - return (chip.nチャンネル番号 == 0x13 || chip.nチャンネル番号 == 0x1A) && gt == EGameType.Taiko; - } - - public static bool IsClapKonga(CDTX.CChip chip, EGameType gt) { - if (chip == null) return false; - return (chip.nチャンネル番号 == 0x14 || chip.nチャンネル番号 == 0x1B) && gt == EGameType.Konga; - } - - public static bool IsSwapNote(CDTX.CChip chip, EGameType gt) { - if (chip == null) return false; - return ( - IsKongaPink(chip, gt) // Konga Pink note - || IsPurpleNote(chip) // Purple (Green) note - ); - } - - public static bool IsKongaPink(CDTX.CChip chip, EGameType gt) { - if (chip == null) return false; - // Purple notes are treated as Pink in Konga - return (chip.nチャンネル番号 == 0x13 || chip.nチャンネル番号 == 0x1A || IsPurpleNote(chip)) && gt == EGameType.Konga; - } - public static bool IsPurpleNote(CDTX.CChip chip) { - if (chip == null) return false; - return (chip.nチャンネル番号 == 0x101); - } - - public static bool IsYellowRoll(CDTX.CChip chip) { - if (chip == null) return false; - return chip.nチャンネル番号 == 0x21; - } - - public static bool IsClapRoll(CDTX.CChip chip) { - if (chip == null) return false; - return chip.nチャンネル番号 == 0x20; - } - - public static bool IsKusudama(CDTX.CChip chip) { - if (chip == null) return false; - return chip.nチャンネル番号 == 0x19; - } - - public static bool IsFuzeRoll(CDTX.CChip chip) { - if (chip == null) return false; - return chip.nチャンネル番号 == 0x1D; - } - - public static bool IsRollEnd(CDTX.CChip chip) { - if (chip == null) return false; - return chip.nチャンネル番号 == 0x18; - } - - public static bool IsBalloon(CDTX.CChip chip) { - if (chip == null) return false; - return chip.nチャンネル番号 == 0x17; - } - - public static bool IsBigRoll(CDTX.CChip chip) { - if (chip == null) return false; - return chip.nチャンネル番号 == 0x16; - } - - public static bool IsSmallRoll(CDTX.CChip chip) { - if (chip == null) return false; - return chip.nチャンネル番号 == 0x15; - } - - public static bool IsADLIB(CDTX.CChip chip) { - if (chip == null) return false; - return chip.nチャンネル番号 == 0x1F; - } - - public static bool IsRoll(CDTX.CChip chip) { - if (chip == null) return false; - return IsBigRoll(chip) || IsSmallRoll(chip) || IsClapRoll(chip) || IsYellowRoll(chip); - } - - public static bool IsGenericBalloon(CDTX.CChip chip) { - if (chip == null) return false; - return IsBalloon(chip) || IsKusudama(chip) || IsFuzeRoll(chip); - } - - public static bool IsGenericRoll(CDTX.CChip chip) { - if (chip == null) return false; - return (0x15 <= chip.nチャンネル番号 && chip.nチャンネル番号 <= 0x19) || - (chip.nチャンネル番号 == 0x20 || chip.nチャンネル番号 == 0x21) - || chip.nチャンネル番号 == 0x1D; - } - - public static bool IsMissableNote(CDTX.CChip chip) { - if (chip == null) return false; - return (0x11 <= chip.nチャンネル番号 && chip.nチャンネル番号 <= 0x14) - || chip.nチャンネル番号 == 0x1A - || chip.nチャンネル番号 == 0x1B - || chip.nチャンネル番号 == 0x101; - } - - public static bool IsHittableNote(CDTX.CChip chip) { - if (chip == null) return false; - return IsMissableNote(chip) - || IsGenericRoll(chip) - || IsADLIB(chip) - || IsMine(chip); - } - - #endregion - - #region [Displayables] - - // Flying notes - public static void DisplayNote(int player, int x, int y, int Lane) { - EGameType _gt = OpenTaiko.ConfigIni.nGameType[OpenTaiko.GetActualPlayer(player)]; - - switch (Lane) { - case 1: - case 2: - case 3: - case 4: - OpenTaiko.Tx.Notes[(int)_gt]?.t2D中心基準描画(x, y, new Rectangle(Lane * OpenTaiko.Skin.Game_Notes_Size[0], OpenTaiko.Skin.Game_Notes_Size[1] * 3, OpenTaiko.Skin.Game_Notes_Size[0], OpenTaiko.Skin.Game_Notes_Size[1])); - break; - case 5: - OpenTaiko.Tx.Note_Swap?.t2D中心基準描画(x, y, new Rectangle(0, OpenTaiko.Skin.Game_Notes_Size[1] * 3, OpenTaiko.Skin.Game_Notes_Size[0], OpenTaiko.Skin.Game_Notes_Size[1])); - break; - } - } - - // Regular display - public static void DisplayNote(int player, int x, int y, CDTX.CChip chip, int frame, int length = -1) { - if (OpenTaiko.ConfigIni.eSTEALTH[OpenTaiko.GetActualPlayer(player)] != EStealthMode.Off || !chip.bShow) - return; - - if (length == -1) { - length = OpenTaiko.Skin.Game_Notes_Size[0]; - } - - EGameType _gt = OpenTaiko.ConfigIni.nGameType[OpenTaiko.GetActualPlayer(player)]; - - int noteType = 1; - if (IsSmallNote(chip, true)) noteType = 2; - else if (IsBigDonTaiko(chip, _gt) || IsKongaPink(chip, _gt)) noteType = 3; - else if (IsBigKaTaiko(chip, _gt) || IsClapKonga(chip, _gt)) noteType = 4; - else if (IsBalloon(chip)) noteType = 11; - - else if (IsMine(chip)) { - OpenTaiko.Tx.Note_Mine?.t2D描画(x, y); - return; - } else if (IsPurpleNote(chip)) { - OpenTaiko.Tx.Note_Swap?.t2D描画(x, y, new Rectangle(0, frame, OpenTaiko.Skin.Game_Notes_Size[0], OpenTaiko.Skin.Game_Notes_Size[1])); - return; - } else if (IsKusudama(chip)) { - OpenTaiko.Tx.Note_Kusu?.t2D描画(x, y, new Rectangle(0, frame, length, OpenTaiko.Skin.Game_Notes_Size[1])); - return; - } else if (IsADLIB(chip)) { - var puchichara = OpenTaiko.Tx.Puchichara[PuchiChara.tGetPuchiCharaIndexByName(OpenTaiko.GetActualPlayer(player))]; - if (puchichara.effect.ShowAdlib) { - OpenTaiko.Tx.Note_Adlib?.tUpdateOpacity(50); - OpenTaiko.Tx.Note_Adlib?.t2D描画(x, y, new Rectangle(0, frame, length, OpenTaiko.Skin.Game_Notes_Size[1])); - } - return; - } - - OpenTaiko.Tx.Notes[(int)_gt]?.t2D描画(x, y, new Rectangle(noteType * OpenTaiko.Skin.Game_Notes_Size[0], frame, length, OpenTaiko.Skin.Game_Notes_Size[1])); - } - - // Roll display - public static void DisplayRoll(int player, int x, int y, CDTX.CChip chip, int frame, - Color4 normalColor, Color4 effectedColor, int x末端, int y末端) { - EGameType _gt = OpenTaiko.ConfigIni.nGameType[OpenTaiko.GetActualPlayer(player)]; - - if (OpenTaiko.ConfigIni.eSTEALTH[OpenTaiko.GetActualPlayer(player)] != EStealthMode.Off || !chip.bShow) - return; - - int _offset = 0; - var _texarr = OpenTaiko.Tx.Notes[(int)_gt]; - int rollOrigin = (OpenTaiko.Skin.Game_Notes_Size[0] * 5); - float _adjust = OpenTaiko.Skin.Game_Notes_Size[0] / 2.0f; - float image_size = OpenTaiko.Skin.Game_Notes_Size[0]; - - if (IsSmallRoll(chip) || (_gt == EGameType.Taiko && IsYellowRoll(chip))) { - _offset = 0; - } - if (IsBigRoll(chip) || (_gt == EGameType.Taiko && IsClapRoll(chip))) { - _offset = OpenTaiko.Skin.Game_Notes_Size[0] * 3; - } else if (IsClapRoll(chip) && _gt == EGameType.Konga) { - _offset = OpenTaiko.Skin.Game_Notes_Size[0] * 11; - } else if (IsYellowRoll(chip) && _gt == EGameType.Konga) { - _offset = OpenTaiko.Skin.Game_Notes_Size[0] * 8; - } else if (IsFuzeRoll(chip)) { - _texarr = OpenTaiko.Tx.Note_FuseRoll; - _offset = -rollOrigin; - } - - if (_texarr == null) return; - - int index = x末端 - x; - - - //var theta = -Math.Atan2(chip.dbSCROLL_Y, chip.dbSCROLL); - var theta = -Math.Atan2(y末端 - y, x末端 - x); - // Temporary patch for odd math bug, to fix later, still bugs on katharsis (negative roll) - if (chip.dbSCROLL_Y == 0)//theta == 0 || theta == -Math.PI) - theta += 0.00000000001; - - - var dist = Math.Sqrt(Math.Pow(x末端 - x, 2) + Math.Pow(y末端 - y, 2)) + 1; - var div = dist / image_size; - //var odiv = (index - _adjust + _adjust + 1) / TJAPlayer3.Skin.Game_Notes_Size[0]; - - if (OpenTaiko.Skin.Game_RollColorMode != CSkin.RollColorMode.None) - _texarr.color4 = effectedColor; - else - _texarr.color4 = normalColor; - - // Body - _texarr.vcScaleRatio.X = (float)div; - _texarr.fZ軸中心回転 = (float)theta; - //var _x0 = x + _adjust; - //var _y0 = y + 0f; - - var _center_x = (x + x末端 + image_size) / 2; - var _center_y = _adjust + (y + y末端) / 2; - //TJAPlayer3.Tx.Notes[(int)_gt].t2D描画(_x0, _y0, new Rectangle(rollOrigin + TJAPlayer3.Skin.Game_Notes_Size[0] + _offset, 0, TJAPlayer3.Skin.Game_Notes_Size[0], TJAPlayer3.Skin.Game_Notes_Size[1])); - _texarr.t2D_DisplayImage_RollNote((int)_center_x, (int)_center_y, new Rectangle(rollOrigin + OpenTaiko.Skin.Game_Notes_Size[0] + _offset, 0, OpenTaiko.Skin.Game_Notes_Size[0], OpenTaiko.Skin.Game_Notes_Size[1])); - //t2D拡大率考慮中央基準描画 t2D中心基準描画 - - // Tail - _texarr.vcScaleRatio.X = 1.0f; - - // Only display the roll tail if the distance is high enough to see the tail texture to avoid math issues - if (dist > 3) { - //var _x0 = x末端 + _adjust; - //var _y0 = y末端 + 0f; - var _d = _adjust; - - var x1 = x + _adjust; - var y1 = y + _adjust; - var x2 = x末端 + _adjust; - var y2 = y末端 + _adjust; - var _xc = x2 + (x2 - x1) * _d / dist; - var _yc = y2 + (y2 - y1) * _d / dist; - //TJAPlayer3.Tx.Notes[(int)_gt].t2D描画((int)_x0, (int)_y0, 0, new Rectangle(rollOrigin + (TJAPlayer3.Skin.Game_Notes_Size[0] * 2) + _offset, frame, TJAPlayer3.Skin.Game_Notes_Size[0], TJAPlayer3.Skin.Game_Notes_Size[1])); - _texarr.t2D中心基準描画((int)_xc, (int)_yc, 0, new Rectangle(rollOrigin + (OpenTaiko.Skin.Game_Notes_Size[0] * 2) + _offset, frame, OpenTaiko.Skin.Game_Notes_Size[0], OpenTaiko.Skin.Game_Notes_Size[1])); - } - - _texarr.fZ軸中心回転 = 0; - - if (OpenTaiko.Skin.Game_RollColorMode == CSkin.RollColorMode.All) - _texarr.color4 = effectedColor; - else - _texarr.color4 = normalColor; - - // Head - _texarr.t2D描画(x, y, 0, new Rectangle(rollOrigin + _offset, frame, OpenTaiko.Skin.Game_Notes_Size[0], OpenTaiko.Skin.Game_Notes_Size[1])); - _texarr.color4 = normalColor; - } - - // SENotes - public static void DisplaySENotes(int player, int x, int y, CDTX.CChip chip) { - if (OpenTaiko.ConfigIni.eSTEALTH[OpenTaiko.GetActualPlayer(player)] == EStealthMode.Stealth) - return; - - EGameType _gt = OpenTaiko.ConfigIni.nGameType[OpenTaiko.GetActualPlayer(player)]; - - if (IsMine(chip)) { - OpenTaiko.Tx.SENotesExtension?.t2D描画(x, y, new Rectangle(0, OpenTaiko.Skin.Game_SENote_Size[1], OpenTaiko.Skin.Game_SENote_Size[0], OpenTaiko.Skin.Game_SENote_Size[1])); - } else if (IsPurpleNote(chip) && _gt != EGameType.Konga) { - OpenTaiko.Tx.SENotesExtension?.t2D描画(x, y, new Rectangle(0, 0, OpenTaiko.Skin.Game_SENote_Size[0], OpenTaiko.Skin.Game_SENote_Size[1])); - } else if (IsFuzeRoll(chip)) { - OpenTaiko.Tx.SENotesExtension?.t2D描画(x, y, new Rectangle(0, OpenTaiko.Skin.Game_SENote_Size[1] * 2, OpenTaiko.Skin.Game_SENote_Size[0], OpenTaiko.Skin.Game_SENote_Size[1])); - } else if (IsKusudama(chip)) { - OpenTaiko.Tx.SENotesExtension?.t2D描画(x, y, new Rectangle(0, OpenTaiko.Skin.Game_SENote_Size[1] * 3, OpenTaiko.Skin.Game_SENote_Size[0], OpenTaiko.Skin.Game_SENote_Size[1])); - } else { - OpenTaiko.Tx.SENotes[(int)_gt]?.t2D描画(x, y, new Rectangle(0, OpenTaiko.Skin.Game_SENote_Size[1] * chip.nSenote, OpenTaiko.Skin.Game_SENote_Size[0], OpenTaiko.Skin.Game_SENote_Size[1])); - } - } - - - #endregion - + return true; } + + public static int GetNoteValueFromChar(string chr) { + if (NoteCorrespondanceDictionnary.ContainsKey(chr)) + return NoteCorrespondanceDictionnary[chr]; + return -1; + } + + public static int GetNoteX(CDTX.CChip pChip, double timems, double scroll, int interval, float play_bpm_time, EScrollMode eScrollMode, bool roll) { + double hbtime = ((roll ? pChip.fBMSCROLLTime_end : pChip.fBMSCROLLTime) - (play_bpm_time)); + double screen_ratio = OpenTaiko.Skin.Resolution[0] / 1280.0; + switch (eScrollMode) { + case EScrollMode.Normal: + return (int)((timems / 240000.0) * interval * scroll * screen_ratio); + case EScrollMode.BMScroll: { + return (int)((hbtime / 16.0) * interval * screen_ratio); + } + case EScrollMode.HBScroll: { + return (int)((hbtime / 16.0) * interval * scroll * screen_ratio); + } + default: + return 0; + } + } + + public static int GetNoteY(CDTX.CChip pChip, double timems, double scroll, int interval, float play_bpm_time, EScrollMode eScrollMode, bool roll) { + double hbtime = ((roll ? pChip.fBMSCROLLTime_end : pChip.fBMSCROLLTime) - (play_bpm_time)); + double screen_ratio = OpenTaiko.Skin.Resolution[1] / 720.0; + switch (eScrollMode) { + case EScrollMode.Normal: + return (int)((timems / 240000.0) * interval * scroll * screen_ratio); + case EScrollMode.BMScroll: { + return 0; + } + case EScrollMode.HBScroll: { + return (int)((hbtime / 16.0) * interval * scroll * screen_ratio); + } + default: + return 0; + } + } + + #endregion + + #region [Gameplay] + + public static bool IsExpectedPad(int stored, int hit, CDTX.CChip chip, EGameType gt) { + var inPad = (EPad)hit; + var onPad = (EPad)stored; + + if (chip == null) return false; + + if (IsBigKaTaiko(chip, gt)) { + return (inPad == EPad.LBlue && onPad == EPad.RBlue) + || (inPad == EPad.RBlue && onPad == EPad.LBlue); + } + + if (IsBigDonTaiko(chip, gt)) { + return (inPad == EPad.LRed && onPad == EPad.RRed) + || (inPad == EPad.RRed && onPad == EPad.LRed); + } + + if (IsSwapNote(chip, gt)) { + bool hitBlue = inPad == EPad.LBlue || inPad == EPad.RBlue; + bool hitRed = inPad == EPad.LRed || inPad == EPad.RRed; + bool storedBlue = onPad == EPad.LBlue || onPad == EPad.RBlue; + bool storedRed = onPad == EPad.LRed || onPad == EPad.RRed; + + return (storedRed && hitBlue) + || (storedBlue && hitRed); + } + + return false; + } + + #endregion + + #region [General] + + public static bool IsCommonNote(CDTX.CChip chip) { + if (chip == null) return false; + return chip.nチャンネル番号 >= 0x11 && chip.nチャンネル番号 < 0x18; + } + public static bool IsMine(CDTX.CChip chip) { + if (chip == null) return false; + return chip.nチャンネル番号 == 0x1C; + } + + public static bool IsDonNote(CDTX.CChip chip) { + if (chip == null) return false; + return chip.nチャンネル番号 == 0x11 || chip.nチャンネル番号 == 0x13 || chip.nチャンネル番号 == 0x1A; + } + + public static bool IsKaNote(CDTX.CChip chip) { + if (chip == null) return false; + return chip.nチャンネル番号 == 0x12 || chip.nチャンネル番号 == 0x14 || chip.nチャンネル番号 == 0x1B; + } + + public static bool IsSmallNote(CDTX.CChip chip, bool blue) { + if (chip == null) return false; + return blue ? chip.nチャンネル番号 == 0x12 : chip.nチャンネル番号 == 0x11; + } + + public static bool IsSmallNote(CDTX.CChip chip) { + if (chip == null) return false; + return chip.nチャンネル番号 == 0x12 || chip.nチャンネル番号 == 0x11; + } + + public static bool IsBigNote(CDTX.CChip chip) { + if (chip == null) return false; + return (chip.nチャンネル番号 == 0x13 || chip.nチャンネル番号 == 0x14 || chip.nチャンネル番号 == 0x1A || chip.nチャンネル番号 == 0x1B); + } + + public static bool IsBigKaTaiko(CDTX.CChip chip, EGameType gt) { + if (chip == null) return false; + return (chip.nチャンネル番号 == 0x14 || chip.nチャンネル番号 == 0x1B) && gt == EGameType.Taiko; + } + + public static bool IsBigDonTaiko(CDTX.CChip chip, EGameType gt) { + if (chip == null) return false; + return (chip.nチャンネル番号 == 0x13 || chip.nチャンネル番号 == 0x1A) && gt == EGameType.Taiko; + } + + public static bool IsClapKonga(CDTX.CChip chip, EGameType gt) { + if (chip == null) return false; + return (chip.nチャンネル番号 == 0x14 || chip.nチャンネル番号 == 0x1B) && gt == EGameType.Konga; + } + + public static bool IsSwapNote(CDTX.CChip chip, EGameType gt) { + if (chip == null) return false; + return ( + IsKongaPink(chip, gt) // Konga Pink note + || IsPurpleNote(chip) // Purple (Green) note + ); + } + + public static bool IsKongaPink(CDTX.CChip chip, EGameType gt) { + if (chip == null) return false; + // Purple notes are treated as Pink in Konga + return (chip.nチャンネル番号 == 0x13 || chip.nチャンネル番号 == 0x1A || IsPurpleNote(chip)) && gt == EGameType.Konga; + } + public static bool IsPurpleNote(CDTX.CChip chip) { + if (chip == null) return false; + return (chip.nチャンネル番号 == 0x101); + } + + public static bool IsYellowRoll(CDTX.CChip chip) { + if (chip == null) return false; + return chip.nチャンネル番号 == 0x21; + } + + public static bool IsClapRoll(CDTX.CChip chip) { + if (chip == null) return false; + return chip.nチャンネル番号 == 0x20; + } + + public static bool IsKusudama(CDTX.CChip chip) { + if (chip == null) return false; + return chip.nチャンネル番号 == 0x19; + } + + public static bool IsFuzeRoll(CDTX.CChip chip) { + if (chip == null) return false; + return chip.nチャンネル番号 == 0x1D; + } + + public static bool IsRollEnd(CDTX.CChip chip) { + if (chip == null) return false; + return chip.nチャンネル番号 == 0x18; + } + + public static bool IsBalloon(CDTX.CChip chip) { + if (chip == null) return false; + return chip.nチャンネル番号 == 0x17; + } + + public static bool IsBigRoll(CDTX.CChip chip) { + if (chip == null) return false; + return chip.nチャンネル番号 == 0x16; + } + + public static bool IsSmallRoll(CDTX.CChip chip) { + if (chip == null) return false; + return chip.nチャンネル番号 == 0x15; + } + + public static bool IsADLIB(CDTX.CChip chip) { + if (chip == null) return false; + return chip.nチャンネル番号 == 0x1F; + } + + public static bool IsRoll(CDTX.CChip chip) { + if (chip == null) return false; + return IsBigRoll(chip) || IsSmallRoll(chip) || IsClapRoll(chip) || IsYellowRoll(chip); + } + + public static bool IsGenericBalloon(CDTX.CChip chip) { + if (chip == null) return false; + return IsBalloon(chip) || IsKusudama(chip) || IsFuzeRoll(chip); + } + + public static bool IsGenericRoll(CDTX.CChip chip) { + if (chip == null) return false; + return (0x15 <= chip.nチャンネル番号 && chip.nチャンネル番号 <= 0x19) || + (chip.nチャンネル番号 == 0x20 || chip.nチャンネル番号 == 0x21) + || chip.nチャンネル番号 == 0x1D; + } + + public static bool IsMissableNote(CDTX.CChip chip) { + if (chip == null) return false; + return (0x11 <= chip.nチャンネル番号 && chip.nチャンネル番号 <= 0x14) + || chip.nチャンネル番号 == 0x1A + || chip.nチャンネル番号 == 0x1B + || chip.nチャンネル番号 == 0x101; + } + + public static bool IsHittableNote(CDTX.CChip chip) { + if (chip == null) return false; + return IsMissableNote(chip) + || IsGenericRoll(chip) + || IsADLIB(chip) + || IsMine(chip); + } + + #endregion + + #region [Displayables] + + // Flying notes + public static void DisplayNote(int player, int x, int y, int Lane) { + EGameType _gt = OpenTaiko.ConfigIni.nGameType[OpenTaiko.GetActualPlayer(player)]; + + switch (Lane) { + case 1: + case 2: + case 3: + case 4: + OpenTaiko.Tx.Notes[(int)_gt]?.t2D中心基準描画(x, y, new Rectangle(Lane * OpenTaiko.Skin.Game_Notes_Size[0], OpenTaiko.Skin.Game_Notes_Size[1] * 3, OpenTaiko.Skin.Game_Notes_Size[0], OpenTaiko.Skin.Game_Notes_Size[1])); + break; + case 5: + OpenTaiko.Tx.Note_Swap?.t2D中心基準描画(x, y, new Rectangle(0, OpenTaiko.Skin.Game_Notes_Size[1] * 3, OpenTaiko.Skin.Game_Notes_Size[0], OpenTaiko.Skin.Game_Notes_Size[1])); + break; + } + } + + // Regular display + public static void DisplayNote(int player, int x, int y, CDTX.CChip chip, int frame, int length = -1) { + if (OpenTaiko.ConfigIni.eSTEALTH[OpenTaiko.GetActualPlayer(player)] != EStealthMode.Off || !chip.bShow) + return; + + if (length == -1) { + length = OpenTaiko.Skin.Game_Notes_Size[0]; + } + + EGameType _gt = OpenTaiko.ConfigIni.nGameType[OpenTaiko.GetActualPlayer(player)]; + + int noteType = 1; + if (IsSmallNote(chip, true)) noteType = 2; + else if (IsBigDonTaiko(chip, _gt) || IsKongaPink(chip, _gt)) noteType = 3; + else if (IsBigKaTaiko(chip, _gt) || IsClapKonga(chip, _gt)) noteType = 4; + else if (IsBalloon(chip)) noteType = 11; + + else if (IsMine(chip)) { + OpenTaiko.Tx.Note_Mine?.t2D描画(x, y); + return; + } else if (IsPurpleNote(chip)) { + OpenTaiko.Tx.Note_Swap?.t2D描画(x, y, new Rectangle(0, frame, OpenTaiko.Skin.Game_Notes_Size[0], OpenTaiko.Skin.Game_Notes_Size[1])); + return; + } else if (IsKusudama(chip)) { + OpenTaiko.Tx.Note_Kusu?.t2D描画(x, y, new Rectangle(0, frame, length, OpenTaiko.Skin.Game_Notes_Size[1])); + return; + } else if (IsADLIB(chip)) { + var puchichara = OpenTaiko.Tx.Puchichara[PuchiChara.tGetPuchiCharaIndexByName(OpenTaiko.GetActualPlayer(player))]; + if (puchichara.effect.ShowAdlib) { + OpenTaiko.Tx.Note_Adlib?.tUpdateOpacity(50); + OpenTaiko.Tx.Note_Adlib?.t2D描画(x, y, new Rectangle(0, frame, length, OpenTaiko.Skin.Game_Notes_Size[1])); + } + return; + } + + OpenTaiko.Tx.Notes[(int)_gt]?.t2D描画(x, y, new Rectangle(noteType * OpenTaiko.Skin.Game_Notes_Size[0], frame, length, OpenTaiko.Skin.Game_Notes_Size[1])); + } + + // Roll display + public static void DisplayRoll(int player, int x, int y, CDTX.CChip chip, int frame, + Color4 normalColor, Color4 effectedColor, int x末端, int y末端) { + EGameType _gt = OpenTaiko.ConfigIni.nGameType[OpenTaiko.GetActualPlayer(player)]; + + if (OpenTaiko.ConfigIni.eSTEALTH[OpenTaiko.GetActualPlayer(player)] != EStealthMode.Off || !chip.bShow) + return; + + int _offset = 0; + var _texarr = OpenTaiko.Tx.Notes[(int)_gt]; + int rollOrigin = (OpenTaiko.Skin.Game_Notes_Size[0] * 5); + float _adjust = OpenTaiko.Skin.Game_Notes_Size[0] / 2.0f; + float image_size = OpenTaiko.Skin.Game_Notes_Size[0]; + + if (IsSmallRoll(chip) || (_gt == EGameType.Taiko && IsYellowRoll(chip))) { + _offset = 0; + } + if (IsBigRoll(chip) || (_gt == EGameType.Taiko && IsClapRoll(chip))) { + _offset = OpenTaiko.Skin.Game_Notes_Size[0] * 3; + } else if (IsClapRoll(chip) && _gt == EGameType.Konga) { + _offset = OpenTaiko.Skin.Game_Notes_Size[0] * 11; + } else if (IsYellowRoll(chip) && _gt == EGameType.Konga) { + _offset = OpenTaiko.Skin.Game_Notes_Size[0] * 8; + } else if (IsFuzeRoll(chip)) { + _texarr = OpenTaiko.Tx.Note_FuseRoll; + _offset = -rollOrigin; + } + + if (_texarr == null) return; + + int index = x末端 - x; + + + //var theta = -Math.Atan2(chip.dbSCROLL_Y, chip.dbSCROLL); + var theta = -Math.Atan2(y末端 - y, x末端 - x); + // Temporary patch for odd math bug, to fix later, still bugs on katharsis (negative roll) + if (chip.dbSCROLL_Y == 0)//theta == 0 || theta == -Math.PI) + theta += 0.00000000001; + + + var dist = Math.Sqrt(Math.Pow(x末端 - x, 2) + Math.Pow(y末端 - y, 2)) + 1; + var div = dist / image_size; + //var odiv = (index - _adjust + _adjust + 1) / TJAPlayer3.Skin.Game_Notes_Size[0]; + + if (OpenTaiko.Skin.Game_RollColorMode != CSkin.RollColorMode.None) + _texarr.color4 = effectedColor; + else + _texarr.color4 = normalColor; + + // Body + _texarr.vcScaleRatio.X = (float)div; + _texarr.fZ軸中心回転 = (float)theta; + //var _x0 = x + _adjust; + //var _y0 = y + 0f; + + var _center_x = (x + x末端 + image_size) / 2; + var _center_y = _adjust + (y + y末端) / 2; + //TJAPlayer3.Tx.Notes[(int)_gt].t2D描画(_x0, _y0, new Rectangle(rollOrigin + TJAPlayer3.Skin.Game_Notes_Size[0] + _offset, 0, TJAPlayer3.Skin.Game_Notes_Size[0], TJAPlayer3.Skin.Game_Notes_Size[1])); + _texarr.t2D_DisplayImage_RollNote((int)_center_x, (int)_center_y, new Rectangle(rollOrigin + OpenTaiko.Skin.Game_Notes_Size[0] + _offset, 0, OpenTaiko.Skin.Game_Notes_Size[0], OpenTaiko.Skin.Game_Notes_Size[1])); + //t2D拡大率考慮中央基準描画 t2D中心基準描画 + + // Tail + _texarr.vcScaleRatio.X = 1.0f; + + // Only display the roll tail if the distance is high enough to see the tail texture to avoid math issues + if (dist > 3) { + //var _x0 = x末端 + _adjust; + //var _y0 = y末端 + 0f; + var _d = _adjust; + + var x1 = x + _adjust; + var y1 = y + _adjust; + var x2 = x末端 + _adjust; + var y2 = y末端 + _adjust; + var _xc = x2 + (x2 - x1) * _d / dist; + var _yc = y2 + (y2 - y1) * _d / dist; + //TJAPlayer3.Tx.Notes[(int)_gt].t2D描画((int)_x0, (int)_y0, 0, new Rectangle(rollOrigin + (TJAPlayer3.Skin.Game_Notes_Size[0] * 2) + _offset, frame, TJAPlayer3.Skin.Game_Notes_Size[0], TJAPlayer3.Skin.Game_Notes_Size[1])); + _texarr.t2D中心基準描画((int)_xc, (int)_yc, 0, new Rectangle(rollOrigin + (OpenTaiko.Skin.Game_Notes_Size[0] * 2) + _offset, frame, OpenTaiko.Skin.Game_Notes_Size[0], OpenTaiko.Skin.Game_Notes_Size[1])); + } + + _texarr.fZ軸中心回転 = 0; + + if (OpenTaiko.Skin.Game_RollColorMode == CSkin.RollColorMode.All) + _texarr.color4 = effectedColor; + else + _texarr.color4 = normalColor; + + // Head + _texarr.t2D描画(x, y, 0, new Rectangle(rollOrigin + _offset, frame, OpenTaiko.Skin.Game_Notes_Size[0], OpenTaiko.Skin.Game_Notes_Size[1])); + _texarr.color4 = normalColor; + } + + // SENotes + public static void DisplaySENotes(int player, int x, int y, CDTX.CChip chip) { + if (OpenTaiko.ConfigIni.eSTEALTH[OpenTaiko.GetActualPlayer(player)] == EStealthMode.Stealth) + return; + + EGameType _gt = OpenTaiko.ConfigIni.nGameType[OpenTaiko.GetActualPlayer(player)]; + + if (IsMine(chip)) { + OpenTaiko.Tx.SENotesExtension?.t2D描画(x, y, new Rectangle(0, OpenTaiko.Skin.Game_SENote_Size[1], OpenTaiko.Skin.Game_SENote_Size[0], OpenTaiko.Skin.Game_SENote_Size[1])); + } else if (IsPurpleNote(chip) && _gt != EGameType.Konga) { + OpenTaiko.Tx.SENotesExtension?.t2D描画(x, y, new Rectangle(0, 0, OpenTaiko.Skin.Game_SENote_Size[0], OpenTaiko.Skin.Game_SENote_Size[1])); + } else if (IsFuzeRoll(chip)) { + OpenTaiko.Tx.SENotesExtension?.t2D描画(x, y, new Rectangle(0, OpenTaiko.Skin.Game_SENote_Size[1] * 2, OpenTaiko.Skin.Game_SENote_Size[0], OpenTaiko.Skin.Game_SENote_Size[1])); + } else if (IsKusudama(chip)) { + OpenTaiko.Tx.SENotesExtension?.t2D描画(x, y, new Rectangle(0, OpenTaiko.Skin.Game_SENote_Size[1] * 3, OpenTaiko.Skin.Game_SENote_Size[0], OpenTaiko.Skin.Game_SENote_Size[1])); + } else { + OpenTaiko.Tx.SENotes[(int)_gt]?.t2D描画(x, y, new Rectangle(0, OpenTaiko.Skin.Game_SENote_Size[1] * chip.nSenote, OpenTaiko.Skin.Game_SENote_Size[0], OpenTaiko.Skin.Game_SENote_Size[1])); + } + } + + + #endregion + } diff --git a/OpenTaiko/src/Stages/07.Game/Taiko/Rainbow.cs b/OpenTaiko/src/Stages/07.Game/Taiko/Rainbow.cs index 6804b4d5..c6e3706a 100644 --- a/OpenTaiko/src/Stages/07.Game/Taiko/Rainbow.cs +++ b/OpenTaiko/src/Stages/07.Game/Taiko/Rainbow.cs @@ -2,133 +2,133 @@ using System.Runtime.InteropServices; using FDK; -namespace OpenTaiko { - internal class Rainbow : CActivity { - // コンストラクタ +namespace OpenTaiko; - public Rainbow() { - base.IsDeActivated = true; - } +internal class Rainbow : CActivity { + // コンストラクタ - public virtual void Start(int player) { - if (OpenTaiko.Tx.Effects_Rainbow != null && !OpenTaiko.ConfigIni.SimpleMode) { - for (int i = 0; i < 2; i++) { - if (!this.Rainbow1P[i].IsUsing && player == 0) { - this.Rainbow1P[i].IsUsing = true; - this.Rainbow1P[i].Counter = new CCounter(0, 164, OpenTaiko.Skin.Game_Effect_Rainbow_Timer, OpenTaiko.Timer); // カウンタ - this.Rainbow1P[i].Player = player; - break; - } - if (!this.Rainbow2P[i].IsUsing && player == 1) { - this.Rainbow2P[i].IsUsing = true; - this.Rainbow2P[i].Counter = new CCounter(0, 164, OpenTaiko.Skin.Game_Effect_Rainbow_Timer, OpenTaiko.Timer); // カウンタ - this.Rainbow2P[i].Player = player; - break; - } - } - } - } - - - // CActivity 実装 - - public override void Activate() { - for (int i = 0; i < 2; i++) { - this.Rainbow1P[i].Counter = new CCounter(); - this.Rainbow2P[i].Counter = new CCounter(); - } - base.Activate(); - } - public override void DeActivate() { - for (int i = 0; i < 2; i++) { - this.Rainbow1P[i].Counter = null; - this.Rainbow2P[i].Counter = null; - } - base.DeActivate(); - } - public override void CreateManagedResource() { - base.CreateManagedResource(); - } - public override void ReleaseManagedResource() { - base.ReleaseManagedResource(); - } - public override int Draw() { - if (!base.IsDeActivated && !OpenTaiko.ConfigIni.SimpleMode) { - if (OpenTaiko.ConfigIni.nPlayerCount > 2) return base.Draw(); - for (int f = 0; f < 2; f++) { - if (this.Rainbow1P[f].IsUsing) { - this.Rainbow1P[f].Counter.Tick(); - if (this.Rainbow1P[f].Counter.IsEnded) { - this.Rainbow1P[f].Counter.Stop(); - this.Rainbow1P[f].IsUsing = false; - } - - if (OpenTaiko.Tx.Effects_Rainbow != null && this.Rainbow1P[f].Player == 0) //画像が出来るまで - { - //this.st虹[f].ct進行.n現在の値 = 164; - - if (this.Rainbow1P[f].Counter.CurrentValue < 82) { - int nRectX = ((this.Rainbow1P[f].Counter.CurrentValue * OpenTaiko.Tx.Effects_Rainbow.szTextureSize.Width) / 85); - OpenTaiko.Tx.Effects_Rainbow.t2D描画(OpenTaiko.Skin.Game_Effect_Rainbow_X[0], OpenTaiko.Skin.Game_Effect_Rainbow_Y[0], - new Rectangle(0, 0, nRectX, OpenTaiko.Tx.Effects_Rainbow.szTextureSize.Height)); - } else if (this.Rainbow1P[f].Counter.CurrentValue >= 82) { - int nRectX = (((this.Rainbow1P[f].Counter.CurrentValue - 82) * OpenTaiko.Tx.Effects_Rainbow.szTextureSize.Width) / 85); - OpenTaiko.Tx.Effects_Rainbow.t2D描画(OpenTaiko.Skin.Game_Effect_Rainbow_X[0] + nRectX, OpenTaiko.Skin.Game_Effect_Rainbow_Y[0], - new Rectangle(nRectX, 0, OpenTaiko.Tx.Effects_Rainbow.szTextureSize.Width - nRectX, OpenTaiko.Tx.Effects_Rainbow.szTextureSize.Height)); - } - - } - - } - } - for (int f = 0; f < 2; f++) { - if (this.Rainbow2P[f].IsUsing) { - this.Rainbow2P[f].Counter.Tick(); - if (this.Rainbow2P[f].Counter.IsEnded) { - this.Rainbow2P[f].Counter.Stop(); - this.Rainbow2P[f].IsUsing = false; - } - - if (OpenTaiko.Tx.Effects_Rainbow != null && this.Rainbow2P[f].Player == 1) //画像が出来るまで - { - //this.st虹[f].ct進行.n現在の値 = 164; - - if (this.Rainbow2P[f].Counter.CurrentValue < 82) { - int nRectX = ((this.Rainbow2P[f].Counter.CurrentValue * OpenTaiko.Tx.Effects_Rainbow.szTextureSize.Width) / 85); - OpenTaiko.Tx.Effects_Rainbow.t2D上下反転描画(OpenTaiko.Skin.Game_Effect_Rainbow_X[0], OpenTaiko.Skin.Game_Effect_Rainbow_Y[1], - new Rectangle(0, 0, nRectX, OpenTaiko.Tx.Effects_Rainbow.szTextureSize.Height)); - } else if (this.Rainbow2P[f].Counter.CurrentValue >= 82) { - int nRectX = (((this.Rainbow2P[f].Counter.CurrentValue - 82) * OpenTaiko.Tx.Effects_Rainbow.szTextureSize.Width) / 85); - OpenTaiko.Tx.Effects_Rainbow.t2D上下反転描画(OpenTaiko.Skin.Game_Effect_Rainbow_X[0] + nRectX, OpenTaiko.Skin.Game_Effect_Rainbow_Y[1], - new Rectangle(nRectX, 0, OpenTaiko.Tx.Effects_Rainbow.szTextureSize.Width - nRectX, OpenTaiko.Tx.Effects_Rainbow.szTextureSize.Height)); - } - - } - - } - } - } - return base.Draw(); - } - - - // その他 - - #region [ private ] - //----------------- - - [StructLayout(LayoutKind.Sequential)] - private struct StructRainbow { - public bool IsUsing; - public int Player; - public CCounter Counter; - public float X; - } - - private StructRainbow[] Rainbow1P = new StructRainbow[2]; - private StructRainbow[] Rainbow2P = new StructRainbow[2]; - - //----------------- - #endregion + public Rainbow() { + base.IsDeActivated = true; } + + public virtual void Start(int player) { + if (OpenTaiko.Tx.Effects_Rainbow != null && !OpenTaiko.ConfigIni.SimpleMode) { + for (int i = 0; i < 2; i++) { + if (!this.Rainbow1P[i].IsUsing && player == 0) { + this.Rainbow1P[i].IsUsing = true; + this.Rainbow1P[i].Counter = new CCounter(0, 164, OpenTaiko.Skin.Game_Effect_Rainbow_Timer, OpenTaiko.Timer); // カウンタ + this.Rainbow1P[i].Player = player; + break; + } + if (!this.Rainbow2P[i].IsUsing && player == 1) { + this.Rainbow2P[i].IsUsing = true; + this.Rainbow2P[i].Counter = new CCounter(0, 164, OpenTaiko.Skin.Game_Effect_Rainbow_Timer, OpenTaiko.Timer); // カウンタ + this.Rainbow2P[i].Player = player; + break; + } + } + } + } + + + // CActivity 実装 + + public override void Activate() { + for (int i = 0; i < 2; i++) { + this.Rainbow1P[i].Counter = new CCounter(); + this.Rainbow2P[i].Counter = new CCounter(); + } + base.Activate(); + } + public override void DeActivate() { + for (int i = 0; i < 2; i++) { + this.Rainbow1P[i].Counter = null; + this.Rainbow2P[i].Counter = null; + } + base.DeActivate(); + } + public override void CreateManagedResource() { + base.CreateManagedResource(); + } + public override void ReleaseManagedResource() { + base.ReleaseManagedResource(); + } + public override int Draw() { + if (!base.IsDeActivated && !OpenTaiko.ConfigIni.SimpleMode) { + if (OpenTaiko.ConfigIni.nPlayerCount > 2) return base.Draw(); + for (int f = 0; f < 2; f++) { + if (this.Rainbow1P[f].IsUsing) { + this.Rainbow1P[f].Counter.Tick(); + if (this.Rainbow1P[f].Counter.IsEnded) { + this.Rainbow1P[f].Counter.Stop(); + this.Rainbow1P[f].IsUsing = false; + } + + if (OpenTaiko.Tx.Effects_Rainbow != null && this.Rainbow1P[f].Player == 0) //画像が出来るまで + { + //this.st虹[f].ct進行.n現在の値 = 164; + + if (this.Rainbow1P[f].Counter.CurrentValue < 82) { + int nRectX = ((this.Rainbow1P[f].Counter.CurrentValue * OpenTaiko.Tx.Effects_Rainbow.szTextureSize.Width) / 85); + OpenTaiko.Tx.Effects_Rainbow.t2D描画(OpenTaiko.Skin.Game_Effect_Rainbow_X[0], OpenTaiko.Skin.Game_Effect_Rainbow_Y[0], + new Rectangle(0, 0, nRectX, OpenTaiko.Tx.Effects_Rainbow.szTextureSize.Height)); + } else if (this.Rainbow1P[f].Counter.CurrentValue >= 82) { + int nRectX = (((this.Rainbow1P[f].Counter.CurrentValue - 82) * OpenTaiko.Tx.Effects_Rainbow.szTextureSize.Width) / 85); + OpenTaiko.Tx.Effects_Rainbow.t2D描画(OpenTaiko.Skin.Game_Effect_Rainbow_X[0] + nRectX, OpenTaiko.Skin.Game_Effect_Rainbow_Y[0], + new Rectangle(nRectX, 0, OpenTaiko.Tx.Effects_Rainbow.szTextureSize.Width - nRectX, OpenTaiko.Tx.Effects_Rainbow.szTextureSize.Height)); + } + + } + + } + } + for (int f = 0; f < 2; f++) { + if (this.Rainbow2P[f].IsUsing) { + this.Rainbow2P[f].Counter.Tick(); + if (this.Rainbow2P[f].Counter.IsEnded) { + this.Rainbow2P[f].Counter.Stop(); + this.Rainbow2P[f].IsUsing = false; + } + + if (OpenTaiko.Tx.Effects_Rainbow != null && this.Rainbow2P[f].Player == 1) //画像が出来るまで + { + //this.st虹[f].ct進行.n現在の値 = 164; + + if (this.Rainbow2P[f].Counter.CurrentValue < 82) { + int nRectX = ((this.Rainbow2P[f].Counter.CurrentValue * OpenTaiko.Tx.Effects_Rainbow.szTextureSize.Width) / 85); + OpenTaiko.Tx.Effects_Rainbow.t2D上下反転描画(OpenTaiko.Skin.Game_Effect_Rainbow_X[0], OpenTaiko.Skin.Game_Effect_Rainbow_Y[1], + new Rectangle(0, 0, nRectX, OpenTaiko.Tx.Effects_Rainbow.szTextureSize.Height)); + } else if (this.Rainbow2P[f].Counter.CurrentValue >= 82) { + int nRectX = (((this.Rainbow2P[f].Counter.CurrentValue - 82) * OpenTaiko.Tx.Effects_Rainbow.szTextureSize.Width) / 85); + OpenTaiko.Tx.Effects_Rainbow.t2D上下反転描画(OpenTaiko.Skin.Game_Effect_Rainbow_X[0] + nRectX, OpenTaiko.Skin.Game_Effect_Rainbow_Y[1], + new Rectangle(nRectX, 0, OpenTaiko.Tx.Effects_Rainbow.szTextureSize.Width - nRectX, OpenTaiko.Tx.Effects_Rainbow.szTextureSize.Height)); + } + + } + + } + } + } + return base.Draw(); + } + + + // その他 + + #region [ private ] + //----------------- + + [StructLayout(LayoutKind.Sequential)] + private struct StructRainbow { + public bool IsUsing; + public int Player; + public CCounter Counter; + public float X; + } + + private StructRainbow[] Rainbow1P = new StructRainbow[2]; + private StructRainbow[] Rainbow2P = new StructRainbow[2]; + + //----------------- + #endregion } diff --git a/OpenTaiko/src/Stages/07.Game/Taiko/ScriptBG.cs b/OpenTaiko/src/Stages/07.Game/Taiko/ScriptBG.cs index 1d4cabc7..74cae00c 100644 --- a/OpenTaiko/src/Stages/07.Game/Taiko/ScriptBG.cs +++ b/OpenTaiko/src/Stages/07.Game/Taiko/ScriptBG.cs @@ -2,289 +2,289 @@ using FDK; using NLua; -namespace OpenTaiko { - class ScriptBGFunc { - private Dictionary Textures; - private string DirPath; +namespace OpenTaiko; - public ScriptBGFunc(Dictionary texs, string dirPath) { - Textures = texs; - DirPath = dirPath; - } - public void DrawText(double x, double y, string text) { - OpenTaiko.actTextConsole.Print((int)x, (int)y, CTextConsole.EFontType.White, text); - } - public void DrawNum(double x, double y, double text) { - OpenTaiko.actTextConsole.Print((int)x, (int)y, CTextConsole.EFontType.White, text.ToString()); - } - public void AddGraph(string fileName) { - string trueFileName = fileName.Replace('/', Path.DirectorySeparatorChar); - trueFileName = trueFileName.Replace('\\', Path.DirectorySeparatorChar); - Textures.Add(fileName, OpenTaiko.tテクスチャの生成($@"{DirPath}{Path.DirectorySeparatorChar}{trueFileName}")); - } - public void DrawGraph(double x, double y, string fileName) { - Textures[fileName]?.t2D描画((int)x, (int)y); - } - public void DrawRectGraph(double x, double y, int rect_x, int rect_y, int rect_width, int rect_height, string fileName) { - Textures[fileName]?.t2D描画((int)x, (int)y, new System.Drawing.RectangleF(rect_x, rect_y, rect_width, rect_height)); - } - public void DrawGraphCenter(double x, double y, string fileName) { - Textures[fileName]?.t2D拡大率考慮中央基準描画((int)x, (int)y); - } - public void DrawGraphRectCenter(double x, double y, int rect_x, int rect_y, int rect_width, int rect_height, string fileName) { - Textures[fileName]?.t2D拡大率考慮中央基準描画((int)x, (int)y, new System.Drawing.RectangleF(rect_x, rect_y, rect_width, rect_height)); - } - public void SetOpacity(double opacity, string fileName) { - if (Textures[fileName] != null) - Textures[fileName].Opacity = (int)opacity; - } - public void SetScale(double xscale, double yscale, string fileName) { - if (Textures[fileName] != null) { - Textures[fileName].vcScaleRatio.X = (float)xscale; - Textures[fileName].vcScaleRatio.Y = (float)yscale; - } - } - public void SetRotation(double angle, string fileName) { - if (Textures[fileName] != null) { - Textures[fileName].fZ軸中心回転 = (float)(angle * Math.PI / 180); - } - } - public void SetColor(double r, double g, double b, string fileName) { - if (Textures[fileName] != null) { - Textures[fileName].color4 = new Color4((float)r, (float)g, (float)b, 1f); - } - } - public void SetBlendMode(string type, string fileName) { - if (Textures[fileName] != null) { - switch (type) { - case "Normal": - default: - Textures[fileName].b加算合成 = false; - Textures[fileName].b乗算合成 = false; - Textures[fileName].b減算合成 = false; - Textures[fileName].bスクリーン合成 = false; - break; - case "Add": - Textures[fileName].b加算合成 = true; - Textures[fileName].b乗算合成 = false; - Textures[fileName].b減算合成 = false; - Textures[fileName].bスクリーン合成 = false; - break; - case "Multi": - Textures[fileName].b加算合成 = false; - Textures[fileName].b乗算合成 = true; - Textures[fileName].b減算合成 = false; - Textures[fileName].bスクリーン合成 = false; - break; - case "Sub": - Textures[fileName].b加算合成 = false; - Textures[fileName].b乗算合成 = false; - Textures[fileName].b減算合成 = true; - Textures[fileName].bスクリーン合成 = false; - break; - case "Screen": - Textures[fileName].b加算合成 = false; - Textures[fileName].b乗算合成 = false; - Textures[fileName].b減算合成 = false; - Textures[fileName].bスクリーン合成 = true; - break; - } - } - } +class ScriptBGFunc { + private Dictionary Textures; + private string DirPath; - public double GetTextureWidth(string fileName) { - if (Textures[fileName] != null) { - return Textures[fileName].szTextureSize.Width; - } - return -1; - } - - public double GetTextureHeight(string fileName) { - if (Textures[fileName] != null) { - return Textures[fileName].szTextureSize.Height; - } - return -1; + public ScriptBGFunc(Dictionary texs, string dirPath) { + Textures = texs; + DirPath = dirPath; + } + public void DrawText(double x, double y, string text) { + OpenTaiko.actTextConsole.Print((int)x, (int)y, CTextConsole.EFontType.White, text); + } + public void DrawNum(double x, double y, double text) { + OpenTaiko.actTextConsole.Print((int)x, (int)y, CTextConsole.EFontType.White, text.ToString()); + } + public void AddGraph(string fileName) { + string trueFileName = fileName.Replace('/', Path.DirectorySeparatorChar); + trueFileName = trueFileName.Replace('\\', Path.DirectorySeparatorChar); + Textures.Add(fileName, OpenTaiko.tテクスチャの生成($@"{DirPath}{Path.DirectorySeparatorChar}{trueFileName}")); + } + public void DrawGraph(double x, double y, string fileName) { + Textures[fileName]?.t2D描画((int)x, (int)y); + } + public void DrawRectGraph(double x, double y, int rect_x, int rect_y, int rect_width, int rect_height, string fileName) { + Textures[fileName]?.t2D描画((int)x, (int)y, new System.Drawing.RectangleF(rect_x, rect_y, rect_width, rect_height)); + } + public void DrawGraphCenter(double x, double y, string fileName) { + Textures[fileName]?.t2D拡大率考慮中央基準描画((int)x, (int)y); + } + public void DrawGraphRectCenter(double x, double y, int rect_x, int rect_y, int rect_width, int rect_height, string fileName) { + Textures[fileName]?.t2D拡大率考慮中央基準描画((int)x, (int)y, new System.Drawing.RectangleF(rect_x, rect_y, rect_width, rect_height)); + } + public void SetOpacity(double opacity, string fileName) { + if (Textures[fileName] != null) + Textures[fileName].Opacity = (int)opacity; + } + public void SetScale(double xscale, double yscale, string fileName) { + if (Textures[fileName] != null) { + Textures[fileName].vcScaleRatio.X = (float)xscale; + Textures[fileName].vcScaleRatio.Y = (float)yscale; + } + } + public void SetRotation(double angle, string fileName) { + if (Textures[fileName] != null) { + Textures[fileName].fZ軸中心回転 = (float)(angle * Math.PI / 180); + } + } + public void SetColor(double r, double g, double b, string fileName) { + if (Textures[fileName] != null) { + Textures[fileName].color4 = new Color4((float)r, (float)g, (float)b, 1f); + } + } + public void SetBlendMode(string type, string fileName) { + if (Textures[fileName] != null) { + switch (type) { + case "Normal": + default: + Textures[fileName].b加算合成 = false; + Textures[fileName].b乗算合成 = false; + Textures[fileName].b減算合成 = false; + Textures[fileName].bスクリーン合成 = false; + break; + case "Add": + Textures[fileName].b加算合成 = true; + Textures[fileName].b乗算合成 = false; + Textures[fileName].b減算合成 = false; + Textures[fileName].bスクリーン合成 = false; + break; + case "Multi": + Textures[fileName].b加算合成 = false; + Textures[fileName].b乗算合成 = true; + Textures[fileName].b減算合成 = false; + Textures[fileName].bスクリーン合成 = false; + break; + case "Sub": + Textures[fileName].b加算合成 = false; + Textures[fileName].b乗算合成 = false; + Textures[fileName].b減算合成 = true; + Textures[fileName].bスクリーン合成 = false; + break; + case "Screen": + Textures[fileName].b加算合成 = false; + Textures[fileName].b乗算合成 = false; + Textures[fileName].b減算合成 = false; + Textures[fileName].bスクリーン合成 = true; + break; + } } } - class ScriptBG : IDisposable { - public Dictionary Textures; - protected Lua LuaScript; + public double GetTextureWidth(string fileName) { + if (Textures[fileName] != null) { + return Textures[fileName].szTextureSize.Width; + } + return -1; + } - protected LuaFunction LuaSetConstValues; - protected LuaFunction LuaUpdateValues; - protected LuaFunction LuaClearIn; - protected LuaFunction LuaClearOut; - protected LuaFunction LuaInit; - protected LuaFunction LuaUpdate; - protected LuaFunction LuaDraw; + public double GetTextureHeight(string fileName) { + if (Textures[fileName] != null) { + return Textures[fileName].szTextureSize.Height; + } + return -1; + } +} +class ScriptBG : IDisposable { + public Dictionary Textures; - public ScriptBG(string filePath) { - Textures = new Dictionary(); + protected Lua LuaScript; - if (!File.Exists(filePath)) return; + protected LuaFunction LuaSetConstValues; + protected LuaFunction LuaUpdateValues; + protected LuaFunction LuaClearIn; + protected LuaFunction LuaClearOut; + protected LuaFunction LuaInit; + protected LuaFunction LuaUpdate; + protected LuaFunction LuaDraw; - LuaScript = new Lua(); - LuaScript.State.Encoding = Encoding.UTF8; + public ScriptBG(string filePath) { + Textures = new Dictionary(); - LuaScript["func"] = new ScriptBGFunc(Textures, Path.GetDirectoryName(filePath)); + if (!File.Exists(filePath)) return; + + LuaScript = new Lua(); + LuaScript.State.Encoding = Encoding.UTF8; + + LuaScript["func"] = new ScriptBGFunc(Textures, Path.GetDirectoryName(filePath)); - try { - using (var streamAPI = new StreamReader("BGScriptAPI.lua", Encoding.UTF8)) { - using (var stream = new StreamReader(filePath, Encoding.UTF8)) { - var text = $"{streamAPI.ReadToEnd()}\n{stream.ReadToEnd()}"; - LuaScript.DoString(text); - } + try { + using (var streamAPI = new StreamReader("BGScriptAPI.lua", Encoding.UTF8)) { + using (var stream = new StreamReader(filePath, Encoding.UTF8)) { + var text = $"{streamAPI.ReadToEnd()}\n{stream.ReadToEnd()}"; + LuaScript.DoString(text); } - - LuaSetConstValues = LuaScript.GetFunction("setConstValues"); - LuaUpdateValues = LuaScript.GetFunction("updateValues"); - LuaClearIn = LuaScript.GetFunction("clearIn"); - LuaClearOut = LuaScript.GetFunction("clearOut"); - LuaInit = LuaScript.GetFunction("init"); - LuaUpdate = LuaScript.GetFunction("update"); - LuaDraw = LuaScript.GetFunction("draw"); - } catch (Exception ex) { - LuaScript.Dispose(); - LuaScript = null; - } - } - public bool Exists() { - return LuaScript != null; - } - public void Dispose() { - List texs = new List(); - foreach (var tex in Textures.Values) { - texs.Add(tex); - } - for (int i = 0; i < texs.Count; i++) { - var tex = texs[i]; - OpenTaiko.tテクスチャの解放(ref tex); } - Textures.Clear(); - - LuaScript?.Dispose(); - - LuaSetConstValues?.Dispose(); - LuaUpdateValues?.Dispose(); - LuaClearIn?.Dispose(); - LuaClearOut?.Dispose(); - LuaInit?.Dispose(); - LuaUpdate?.Dispose(); - LuaDraw?.Dispose(); + LuaSetConstValues = LuaScript.GetFunction("setConstValues"); + LuaUpdateValues = LuaScript.GetFunction("updateValues"); + LuaClearIn = LuaScript.GetFunction("clearIn"); + LuaClearOut = LuaScript.GetFunction("clearOut"); + LuaInit = LuaScript.GetFunction("init"); + LuaUpdate = LuaScript.GetFunction("update"); + LuaDraw = LuaScript.GetFunction("draw"); + } catch (Exception ex) { + LuaScript.Dispose(); + LuaScript = null; + } + } + public bool Exists() { + return LuaScript != null; + } + public void Dispose() { + List texs = new List(); + foreach (var tex in Textures.Values) { + texs.Add(tex); + } + for (int i = 0; i < texs.Count; i++) { + var tex = texs[i]; + OpenTaiko.tテクスチャの解放(ref tex); } - public void ClearIn(int player) { - if (LuaScript == null) return; - try { - LuaClearIn.Call(player); - } catch (Exception ex) { - LuaScript.Dispose(); - LuaScript = null; - } - } - public void ClearOut(int player) { - if (LuaScript == null) return; - try { - LuaClearOut.Call(player); - } catch (Exception ex) { - LuaScript.Dispose(); - LuaScript = null; - } - } - public void Init() { - if (LuaScript == null) return; - try { - // Preprocessing - string[] raritiesP = { "Common", "Common", "Common", "Common", "Common" }; - string[] raritiesC = { "Common", "Common", "Common", "Common", "Common" }; + Textures.Clear(); - if (OpenTaiko.Tx.Puchichara != null && OpenTaiko.Tx.Characters != null) { - for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { - raritiesP[i] = OpenTaiko.Tx.Puchichara[PuchiChara.tGetPuchiCharaIndexByName(OpenTaiko.GetActualPlayer(i))].metadata.Rarity; - raritiesC[i] = OpenTaiko.Tx.Characters[OpenTaiko.SaveFileInstances[OpenTaiko.GetActualPlayer(i)].data.Character].metadata.Rarity; - } + LuaScript?.Dispose(); + + LuaSetConstValues?.Dispose(); + LuaUpdateValues?.Dispose(); + LuaClearIn?.Dispose(); + LuaClearOut?.Dispose(); + LuaInit?.Dispose(); + LuaUpdate?.Dispose(); + LuaDraw?.Dispose(); + } + + public void ClearIn(int player) { + if (LuaScript == null) return; + try { + LuaClearIn.Call(player); + } catch (Exception ex) { + LuaScript.Dispose(); + LuaScript = null; + } + } + public void ClearOut(int player) { + if (LuaScript == null) return; + try { + LuaClearOut.Call(player); + } catch (Exception ex) { + LuaScript.Dispose(); + LuaScript = null; + } + } + public void Init() { + if (LuaScript == null) return; + try { + // Preprocessing + string[] raritiesP = { "Common", "Common", "Common", "Common", "Common" }; + string[] raritiesC = { "Common", "Common", "Common", "Common", "Common" }; + + if (OpenTaiko.Tx.Puchichara != null && OpenTaiko.Tx.Characters != null) { + for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { + raritiesP[i] = OpenTaiko.Tx.Puchichara[PuchiChara.tGetPuchiCharaIndexByName(OpenTaiko.GetActualPlayer(i))].metadata.Rarity; + raritiesC[i] = OpenTaiko.Tx.Characters[OpenTaiko.SaveFileInstances[OpenTaiko.GetActualPlayer(i)].data.Character].metadata.Rarity; } - - // Initialisation - LuaSetConstValues.Call(OpenTaiko.ConfigIni.nPlayerCount, - OpenTaiko.P1IsBlue(), - OpenTaiko.ConfigIni.sLang, - OpenTaiko.ConfigIni.SimpleMode, - raritiesP, - raritiesC - ); - - LuaUpdateValues.Call(OpenTaiko.FPS.DeltaTime, - OpenTaiko.FPS.NowFPS, - OpenTaiko.stage演奏ドラム画面.bIsAlreadyCleared, - 0, - OpenTaiko.stage演奏ドラム画面.AIBattleState, - OpenTaiko.stage演奏ドラム画面.bIsAIBattleWin, - OpenTaiko.stage演奏ドラム画面.actGauge.db現在のゲージ値, - OpenTaiko.stage演奏ドラム画面.actPlayInfo.dbBPM, - new bool[] { false, false, false, false, false }, - -1 - ); - - LuaInit.Call(); - } catch (Exception ex) { - LuaScript.Dispose(); - LuaScript = null; } + + // Initialisation + LuaSetConstValues.Call(OpenTaiko.ConfigIni.nPlayerCount, + OpenTaiko.P1IsBlue(), + OpenTaiko.ConfigIni.sLang, + OpenTaiko.ConfigIni.SimpleMode, + raritiesP, + raritiesC + ); + + LuaUpdateValues.Call(OpenTaiko.FPS.DeltaTime, + OpenTaiko.FPS.NowFPS, + OpenTaiko.stage演奏ドラム画面.bIsAlreadyCleared, + 0, + OpenTaiko.stage演奏ドラム画面.AIBattleState, + OpenTaiko.stage演奏ドラム画面.bIsAIBattleWin, + OpenTaiko.stage演奏ドラム画面.actGauge.db現在のゲージ値, + OpenTaiko.stage演奏ドラム画面.actPlayInfo.dbBPM, + new bool[] { false, false, false, false, false }, + -1 + ); + + LuaInit.Call(); + } catch (Exception ex) { + LuaScript.Dispose(); + LuaScript = null; } - public void Update() { - if (LuaScript == null) return; - try { - float currentFloorPositionMax140 = 0; + } + public void Update() { + if (LuaScript == null) return; + try { + float currentFloorPositionMax140 = 0; - if (OpenTaiko.stageSongSelect.rChoosenSong != null && OpenTaiko.stageSongSelect.rChoosenSong.arスコア[5] != null) { - int maxFloor = OpenTaiko.stageSongSelect.rChoosenSong.arスコア[5].譜面情報.nTotalFloor; - int nightTime = Math.Max(140, maxFloor / 2); + if (OpenTaiko.stageSongSelect.rChoosenSong != null && OpenTaiko.stageSongSelect.rChoosenSong.arスコア[5] != null) { + int maxFloor = OpenTaiko.stageSongSelect.rChoosenSong.arスコア[5].譜面情報.nTotalFloor; + int nightTime = Math.Max(140, maxFloor / 2); - currentFloorPositionMax140 = Math.Min(OpenTaiko.stage演奏ドラム画面.actPlayInfo.NowMeasure[0] / (float)nightTime, 1f); - } - double timestamp = -1.0; + currentFloorPositionMax140 = Math.Min(OpenTaiko.stage演奏ドラム画面.actPlayInfo.NowMeasure[0] / (float)nightTime, 1f); + } + double timestamp = -1.0; - if (OpenTaiko.DTX != null) { - double timeoffset = OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] != (int)Difficulty.Dan ? -2.0 : -8.2; - // Due to the fact that all Dans use DELAY to offset instead of OFFSET, Dan offset can't be properly synced. ¯\_(ツ)_/¯ + if (OpenTaiko.DTX != null) { + double timeoffset = OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] != (int)Difficulty.Dan ? -2.0 : -8.2; + // Due to the fact that all Dans use DELAY to offset instead of OFFSET, Dan offset can't be properly synced. ¯\_(ツ)_/¯ - timestamp = (((double)(SoundManager.PlayTimer.NowTime * OpenTaiko.ConfigIni.SongPlaybackSpeed)) / 1000.0) + + timestamp = (((double)(SoundManager.PlayTimer.NowTime * OpenTaiko.ConfigIni.SongPlaybackSpeed)) / 1000.0) + (-(OpenTaiko.ConfigIni.MusicPreTimeMs + OpenTaiko.DTX.nOFFSET) / 1000.0) + timeoffset; - } + } - LuaUpdateValues.Call(OpenTaiko.FPS.DeltaTime, - OpenTaiko.FPS.NowFPS, - OpenTaiko.stage演奏ドラム画面.bIsAlreadyCleared, - (double)currentFloorPositionMax140, - OpenTaiko.stage演奏ドラム画面.AIBattleState, - OpenTaiko.stage演奏ドラム画面.bIsAIBattleWin, - OpenTaiko.stage演奏ドラム画面.actGauge.db現在のゲージ値, - OpenTaiko.stage演奏ドラム画面.actPlayInfo.dbBPM, - OpenTaiko.stage演奏ドラム画面.bIsGOGOTIME, - timestamp); - /*LuaScript.SetObjectToPath("fps", TJAPlayer3.FPS.n現在のFPS); - LuaScript.SetObjectToPath("deltaTime", TJAPlayer3.FPS.DeltaTime); - LuaScript.SetObjectToPath("isClear", TJAPlayer3.stage演奏ドラム画面.bIsAlreadyCleared); - LuaScript.SetObjectToPath("towerNightOpacity", (double)(255 * currentFloorPositionMax140));*/ - LuaUpdate.Call(); - } catch (Exception ex) { - LuaScript.Dispose(); - LuaScript = null; - } + LuaUpdateValues.Call(OpenTaiko.FPS.DeltaTime, + OpenTaiko.FPS.NowFPS, + OpenTaiko.stage演奏ドラム画面.bIsAlreadyCleared, + (double)currentFloorPositionMax140, + OpenTaiko.stage演奏ドラム画面.AIBattleState, + OpenTaiko.stage演奏ドラム画面.bIsAIBattleWin, + OpenTaiko.stage演奏ドラム画面.actGauge.db現在のゲージ値, + OpenTaiko.stage演奏ドラム画面.actPlayInfo.dbBPM, + OpenTaiko.stage演奏ドラム画面.bIsGOGOTIME, + timestamp); + /*LuaScript.SetObjectToPath("fps", TJAPlayer3.FPS.n現在のFPS); + LuaScript.SetObjectToPath("deltaTime", TJAPlayer3.FPS.DeltaTime); + LuaScript.SetObjectToPath("isClear", TJAPlayer3.stage演奏ドラム画面.bIsAlreadyCleared); + LuaScript.SetObjectToPath("towerNightOpacity", (double)(255 * currentFloorPositionMax140));*/ + LuaUpdate.Call(); + } catch (Exception ex) { + LuaScript.Dispose(); + LuaScript = null; } - public void Draw() { - if (LuaScript == null) return; - try { - LuaDraw.Call(); - } catch (Exception ex) { - LuaScript.Dispose(); - LuaScript = null; - } + } + public void Draw() { + if (LuaScript == null) return; + try { + LuaDraw.Call(); + } catch (Exception ex) { + LuaScript.Dispose(); + LuaScript = null; } } } diff --git a/OpenTaiko/src/Stages/07.Game/Taiko/TaikoLaneFlash.cs b/OpenTaiko/src/Stages/07.Game/Taiko/TaikoLaneFlash.cs index 85a64ba8..1d42371c 100644 --- a/OpenTaiko/src/Stages/07.Game/Taiko/TaikoLaneFlash.cs +++ b/OpenTaiko/src/Stages/07.Game/Taiko/TaikoLaneFlash.cs @@ -1,78 +1,78 @@ using FDK; using static OpenTaiko.PlayerLane; -namespace OpenTaiko { - internal class TaikoLaneFlash : CActivity { - // コンストラクタ +namespace OpenTaiko; - public TaikoLaneFlash() { - base.IsDeActivated = true; - } - - - public override void Activate() { - PlayerLane = new PlayerLane[OpenTaiko.ConfigIni.nPlayerCount]; - for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { - PlayerLane[i] = new PlayerLane(i); - } - base.Activate(); - } - public override void DeActivate() { - for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { - PlayerLane[i] = null; - } - base.DeActivate(); - } - - public override int Draw() { - for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { - for (int j = 0; j < (int)FlashType.Total; j++) { - PlayerLane[i].Flash[j].Draw(); - } - } - return base.Draw(); - } - - public PlayerLane[] PlayerLane; +internal class TaikoLaneFlash : CActivity { + // コンストラクタ + public TaikoLaneFlash() { + base.IsDeActivated = true; } - public class PlayerLane { - public PlayerLane(int player) { - Flash = new LaneFlash[(int)FlashType.Total]; - var _gt = OpenTaiko.ConfigIni.nGameType[OpenTaiko.GetActualPlayer(player)]; - for (int i = 0; i < (int)FlashType.Total; i++) { - switch (i) { - case (int)FlashType.Red: - Flash[i] = new LaneFlash(ref OpenTaiko.Tx.Lane_Red[(int)_gt], player); - break; - case (int)FlashType.Blue: - Flash[i] = new LaneFlash(ref OpenTaiko.Tx.Lane_Blue[(int)_gt], player); - break; - case (int)FlashType.Clap: - Flash[i] = new LaneFlash(ref OpenTaiko.Tx.Lane_Clap[(int)_gt], player); - break; - case (int)FlashType.Hit: - Flash[i] = new LaneFlash(ref OpenTaiko.Tx.Lane_Yellow, player); - break; - default: - break; - } + + public override void Activate() { + PlayerLane = new PlayerLane[OpenTaiko.ConfigIni.nPlayerCount]; + for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { + PlayerLane[i] = new PlayerLane(i); + } + base.Activate(); + } + public override void DeActivate() { + for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { + PlayerLane[i] = null; + } + base.DeActivate(); + } + + public override int Draw() { + for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { + for (int j = 0; j < (int)FlashType.Total; j++) { + PlayerLane[i].Flash[j].Draw(); } } - public void Start(FlashType flashType) { - if (flashType == FlashType.Total) return; - Flash[(int)flashType].Start(); - } + return base.Draw(); + } - public LaneFlash[] Flash; + public PlayerLane[] PlayerLane; - public enum FlashType { - Red, - Blue, - Clap, - Hit, - Total +} +public class PlayerLane { + public PlayerLane(int player) { + Flash = new LaneFlash[(int)FlashType.Total]; + var _gt = OpenTaiko.ConfigIni.nGameType[OpenTaiko.GetActualPlayer(player)]; + + for (int i = 0; i < (int)FlashType.Total; i++) { + switch (i) { + case (int)FlashType.Red: + Flash[i] = new LaneFlash(ref OpenTaiko.Tx.Lane_Red[(int)_gt], player); + break; + case (int)FlashType.Blue: + Flash[i] = new LaneFlash(ref OpenTaiko.Tx.Lane_Blue[(int)_gt], player); + break; + case (int)FlashType.Clap: + Flash[i] = new LaneFlash(ref OpenTaiko.Tx.Lane_Clap[(int)_gt], player); + break; + case (int)FlashType.Hit: + Flash[i] = new LaneFlash(ref OpenTaiko.Tx.Lane_Yellow, player); + break; + default: + break; + } } } + public void Start(FlashType flashType) { + if (flashType == FlashType.Total) return; + Flash[(int)flashType].Start(); + } + + public LaneFlash[] Flash; + + public enum FlashType { + Red, + Blue, + Clap, + Hit, + Total + } } diff --git a/OpenTaiko/src/Stages/08.Result/CActResultImage.cs b/OpenTaiko/src/Stages/08.Result/CActResultImage.cs index b6c492d2..00cb1955 100644 --- a/OpenTaiko/src/Stages/08.Result/CActResultImage.cs +++ b/OpenTaiko/src/Stages/08.Result/CActResultImage.cs @@ -1,84 +1,84 @@ using System.Diagnostics; using FDK; -namespace OpenTaiko { - internal class CActResultImage : CActivity { - // コンストラクタ - /// - /// リザルト画像を表示させるクラス。XG化するにあたって動画は廃止。 - /// また、中央の画像も表示する。(STAGE表示、STANDARD_CLASSICなど) - /// - public CActResultImage() { - base.IsDeActivated = true; - } +namespace OpenTaiko; - - // メソッド - - public void tアニメを完了させる() { - this.ct登場用.CurrentValue = (int)this.ct登場用.EndValue; - } - - - // CActivity 実装 - - public override void Activate() { - - base.Activate(); - } - public override void DeActivate() { - if (this.ct登場用 != null) { - this.ct登場用 = null; - } - base.DeActivate(); - } - public override void CreateManagedResource() { - base.CreateManagedResource(); - } - public override void ReleaseManagedResource() { - base.ReleaseManagedResource(); - } - public override unsafe int Draw() { - if (base.IsDeActivated) { - return 0; - } - if (base.IsFirstDraw) { - this.ct登場用 = new CCounter(0, 100, 5, OpenTaiko.Timer); - base.IsFirstDraw = false; - } - this.ct登場用.Tick(); - - if (!this.ct登場用.IsEnded) { - return 0; - } - return 1; - } - - - // その他 - - #region [ private ] - //----------------- - private CCounter ct登場用; - private CTexture r表示するリザルト画像; - private CTexture txリザルト画像; - - private bool tプレビュー画像の指定があれば構築する() { - if (string.IsNullOrEmpty(OpenTaiko.DTX.PREIMAGE)) { - return false; - } - OpenTaiko.tDisposeSafely(ref this.txリザルト画像); - this.r表示するリザルト画像 = null; - string path = OpenTaiko.DTX.strフォルダ名 + OpenTaiko.DTX.PREIMAGE; - if (!File.Exists(path)) { - Trace.TraceWarning("ファイルが存在しません。({0})", new object[] { path }); - return false; - } - this.txリザルト画像 = OpenTaiko.tテクスチャの生成(path); - this.r表示するリザルト画像 = this.txリザルト画像; - return (this.r表示するリザルト画像 != null); - } - //----------------- - #endregion +internal class CActResultImage : CActivity { + // コンストラクタ + /// + /// リザルト画像を表示させるクラス。XG化するにあたって動画は廃止。 + /// また、中央の画像も表示する。(STAGE表示、STANDARD_CLASSICなど) + /// + public CActResultImage() { + base.IsDeActivated = true; } + + + // メソッド + + public void tアニメを完了させる() { + this.ct登場用.CurrentValue = (int)this.ct登場用.EndValue; + } + + + // CActivity 実装 + + public override void Activate() { + + base.Activate(); + } + public override void DeActivate() { + if (this.ct登場用 != null) { + this.ct登場用 = null; + } + base.DeActivate(); + } + public override void CreateManagedResource() { + base.CreateManagedResource(); + } + public override void ReleaseManagedResource() { + base.ReleaseManagedResource(); + } + public override unsafe int Draw() { + if (base.IsDeActivated) { + return 0; + } + if (base.IsFirstDraw) { + this.ct登場用 = new CCounter(0, 100, 5, OpenTaiko.Timer); + base.IsFirstDraw = false; + } + this.ct登場用.Tick(); + + if (!this.ct登場用.IsEnded) { + return 0; + } + return 1; + } + + + // その他 + + #region [ private ] + //----------------- + private CCounter ct登場用; + private CTexture r表示するリザルト画像; + private CTexture txリザルト画像; + + private bool tプレビュー画像の指定があれば構築する() { + if (string.IsNullOrEmpty(OpenTaiko.DTX.PREIMAGE)) { + return false; + } + OpenTaiko.tDisposeSafely(ref this.txリザルト画像); + this.r表示するリザルト画像 = null; + string path = OpenTaiko.DTX.strフォルダ名 + OpenTaiko.DTX.PREIMAGE; + if (!File.Exists(path)) { + Trace.TraceWarning("ファイルが存在しません。({0})", new object[] { path }); + return false; + } + this.txリザルト画像 = OpenTaiko.tテクスチャの生成(path); + this.r表示するリザルト画像 = this.txリザルト画像; + return (this.r表示するリザルト画像 != null); + } + //----------------- + #endregion } diff --git a/OpenTaiko/src/Stages/08.Result/CActResultParameterPanel.cs b/OpenTaiko/src/Stages/08.Result/CActResultParameterPanel.cs index 41828957..c702f9b3 100644 --- a/OpenTaiko/src/Stages/08.Result/CActResultParameterPanel.cs +++ b/OpenTaiko/src/Stages/08.Result/CActResultParameterPanel.cs @@ -2,459 +2,460 @@ using System.Runtime.InteropServices; using FDK; -namespace OpenTaiko { - internal class CActResultParameterPanel : CActivity { - // Constructor +namespace OpenTaiko; - public CActResultParameterPanel() { - ST文字位置[] st文字位置Array = new ST文字位置[11]; - ST文字位置 st文字位置 = new ST文字位置(); - st文字位置.ch = '0'; - st文字位置.pt = new Point(0, 0); - st文字位置Array[0] = st文字位置; - ST文字位置 st文字位置2 = new ST文字位置(); - st文字位置2.ch = '1'; - st文字位置2.pt = new Point(32, 0); - st文字位置Array[1] = st文字位置2; - ST文字位置 st文字位置3 = new ST文字位置(); - st文字位置3.ch = '2'; - st文字位置3.pt = new Point(64, 0); - st文字位置Array[2] = st文字位置3; - ST文字位置 st文字位置4 = new ST文字位置(); - st文字位置4.ch = '3'; - st文字位置4.pt = new Point(96, 0); - st文字位置Array[3] = st文字位置4; - ST文字位置 st文字位置5 = new ST文字位置(); - st文字位置5.ch = '4'; - st文字位置5.pt = new Point(128, 0); - st文字位置Array[4] = st文字位置5; - ST文字位置 st文字位置6 = new ST文字位置(); - st文字位置6.ch = '5'; - st文字位置6.pt = new Point(160, 0); - st文字位置Array[5] = st文字位置6; - ST文字位置 st文字位置7 = new ST文字位置(); - st文字位置7.ch = '6'; - st文字位置7.pt = new Point(192, 0); - st文字位置Array[6] = st文字位置7; - ST文字位置 st文字位置8 = new ST文字位置(); - st文字位置8.ch = '7'; - st文字位置8.pt = new Point(224, 0); - st文字位置Array[7] = st文字位置8; - ST文字位置 st文字位置9 = new ST文字位置(); - st文字位置9.ch = '8'; - st文字位置9.pt = new Point(256, 0); - st文字位置Array[8] = st文字位置9; - ST文字位置 st文字位置10 = new ST文字位置(); - st文字位置10.ch = '9'; - st文字位置10.pt = new Point(288, 0); - st文字位置Array[9] = st文字位置10; - ST文字位置 st文字位置11 = new ST文字位置(); - st文字位置11.ch = ' '; - st文字位置11.pt = new Point(0, 0); - st文字位置Array[10] = st文字位置11; - this.st小文字位置 = st文字位置Array; +internal class CActResultParameterPanel : CActivity { + // Constructor - ST文字位置[] st文字位置Array2 = new ST文字位置[11]; - ST文字位置 st文字位置12 = new ST文字位置(); - st文字位置12.ch = '0'; - st文字位置12.pt = new Point(0, 0); - st文字位置Array2[0] = st文字位置12; - ST文字位置 st文字位置13 = new ST文字位置(); - st文字位置13.ch = '1'; - st文字位置13.pt = new Point(32, 0); - st文字位置Array2[1] = st文字位置13; - ST文字位置 st文字位置14 = new ST文字位置(); - st文字位置14.ch = '2'; - st文字位置14.pt = new Point(64, 0); - st文字位置Array2[2] = st文字位置14; - ST文字位置 st文字位置15 = new ST文字位置(); - st文字位置15.ch = '3'; - st文字位置15.pt = new Point(96, 0); - st文字位置Array2[3] = st文字位置15; - ST文字位置 st文字位置16 = new ST文字位置(); - st文字位置16.ch = '4'; - st文字位置16.pt = new Point(128, 0); - st文字位置Array2[4] = st文字位置16; - ST文字位置 st文字位置17 = new ST文字位置(); - st文字位置17.ch = '5'; - st文字位置17.pt = new Point(160, 0); - st文字位置Array2[5] = st文字位置17; - ST文字位置 st文字位置18 = new ST文字位置(); - st文字位置18.ch = '6'; - st文字位置18.pt = new Point(192, 0); - st文字位置Array2[6] = st文字位置18; - ST文字位置 st文字位置19 = new ST文字位置(); - st文字位置19.ch = '7'; - st文字位置19.pt = new Point(224, 0); - st文字位置Array2[7] = st文字位置19; - ST文字位置 st文字位置20 = new ST文字位置(); - st文字位置20.ch = '8'; - st文字位置20.pt = new Point(256, 0); - st文字位置Array2[8] = st文字位置20; - ST文字位置 st文字位置21 = new ST文字位置(); - st文字位置21.ch = '9'; - st文字位置21.pt = new Point(288, 0); - st文字位置Array2[9] = st文字位置21; - ST文字位置 st文字位置22 = new ST文字位置(); - st文字位置22.ch = '%'; - st文字位置22.pt = new Point(0x37, 0); - st文字位置Array2[10] = st文字位置22; - this.st大文字位置 = st文字位置Array2; + public CActResultParameterPanel() { + ST文字位置[] st文字位置Array = new ST文字位置[11]; + ST文字位置 st文字位置 = new ST文字位置(); + st文字位置.ch = '0'; + st文字位置.pt = new Point(0, 0); + st文字位置Array[0] = st文字位置; + ST文字位置 st文字位置2 = new ST文字位置(); + st文字位置2.ch = '1'; + st文字位置2.pt = new Point(32, 0); + st文字位置Array[1] = st文字位置2; + ST文字位置 st文字位置3 = new ST文字位置(); + st文字位置3.ch = '2'; + st文字位置3.pt = new Point(64, 0); + st文字位置Array[2] = st文字位置3; + ST文字位置 st文字位置4 = new ST文字位置(); + st文字位置4.ch = '3'; + st文字位置4.pt = new Point(96, 0); + st文字位置Array[3] = st文字位置4; + ST文字位置 st文字位置5 = new ST文字位置(); + st文字位置5.ch = '4'; + st文字位置5.pt = new Point(128, 0); + st文字位置Array[4] = st文字位置5; + ST文字位置 st文字位置6 = new ST文字位置(); + st文字位置6.ch = '5'; + st文字位置6.pt = new Point(160, 0); + st文字位置Array[5] = st文字位置6; + ST文字位置 st文字位置7 = new ST文字位置(); + st文字位置7.ch = '6'; + st文字位置7.pt = new Point(192, 0); + st文字位置Array[6] = st文字位置7; + ST文字位置 st文字位置8 = new ST文字位置(); + st文字位置8.ch = '7'; + st文字位置8.pt = new Point(224, 0); + st文字位置Array[7] = st文字位置8; + ST文字位置 st文字位置9 = new ST文字位置(); + st文字位置9.ch = '8'; + st文字位置9.pt = new Point(256, 0); + st文字位置Array[8] = st文字位置9; + ST文字位置 st文字位置10 = new ST文字位置(); + st文字位置10.ch = '9'; + st文字位置10.pt = new Point(288, 0); + st文字位置Array[9] = st文字位置10; + ST文字位置 st文字位置11 = new ST文字位置(); + st文字位置11.ch = ' '; + st文字位置11.pt = new Point(0, 0); + st文字位置Array[10] = st文字位置11; + this.st小文字位置 = st文字位置Array; - ST文字位置[] stScore文字位置Array = new ST文字位置[10]; - ST文字位置 stScore文字位置 = new ST文字位置(); - stScore文字位置.ch = '0'; - stScore文字位置.pt = new Point(0, 0); - stScore文字位置Array[0] = stScore文字位置; - ST文字位置 stScore文字位置2 = new ST文字位置(); - stScore文字位置2.ch = '1'; - stScore文字位置2.pt = new Point(51, 0); - stScore文字位置Array[1] = stScore文字位置2; - ST文字位置 stScore文字位置3 = new ST文字位置(); - stScore文字位置3.ch = '2'; - stScore文字位置3.pt = new Point(102, 0); - stScore文字位置Array[2] = stScore文字位置3; - ST文字位置 stScore文字位置4 = new ST文字位置(); - stScore文字位置4.ch = '3'; - stScore文字位置4.pt = new Point(153, 0); - stScore文字位置Array[3] = stScore文字位置4; - ST文字位置 stScore文字位置5 = new ST文字位置(); - stScore文字位置5.ch = '4'; - stScore文字位置5.pt = new Point(204, 0); - stScore文字位置Array[4] = stScore文字位置5; - ST文字位置 stScore文字位置6 = new ST文字位置(); - stScore文字位置6.ch = '5'; - stScore文字位置6.pt = new Point(255, 0); - stScore文字位置Array[5] = stScore文字位置6; - ST文字位置 stScore文字位置7 = new ST文字位置(); - stScore文字位置7.ch = '6'; - stScore文字位置7.pt = new Point(306, 0); - stScore文字位置Array[6] = stScore文字位置7; - ST文字位置 stScore文字位置8 = new ST文字位置(); - stScore文字位置8.ch = '7'; - stScore文字位置8.pt = new Point(357, 0); - stScore文字位置Array[7] = stScore文字位置8; - ST文字位置 stScore文字位置9 = new ST文字位置(); - stScore文字位置9.ch = '8'; - stScore文字位置9.pt = new Point(408, 0); - stScore文字位置Array[8] = stScore文字位置9; - ST文字位置 stScore文字位置10 = new ST文字位置(); - stScore文字位置10.ch = '9'; - stScore文字位置10.pt = new Point(459, 0); - stScore文字位置Array[9] = stScore文字位置10; - this.stScoreFont = stScore文字位置Array; + ST文字位置[] st文字位置Array2 = new ST文字位置[11]; + ST文字位置 st文字位置12 = new ST文字位置(); + st文字位置12.ch = '0'; + st文字位置12.pt = new Point(0, 0); + st文字位置Array2[0] = st文字位置12; + ST文字位置 st文字位置13 = new ST文字位置(); + st文字位置13.ch = '1'; + st文字位置13.pt = new Point(32, 0); + st文字位置Array2[1] = st文字位置13; + ST文字位置 st文字位置14 = new ST文字位置(); + st文字位置14.ch = '2'; + st文字位置14.pt = new Point(64, 0); + st文字位置Array2[2] = st文字位置14; + ST文字位置 st文字位置15 = new ST文字位置(); + st文字位置15.ch = '3'; + st文字位置15.pt = new Point(96, 0); + st文字位置Array2[3] = st文字位置15; + ST文字位置 st文字位置16 = new ST文字位置(); + st文字位置16.ch = '4'; + st文字位置16.pt = new Point(128, 0); + st文字位置Array2[4] = st文字位置16; + ST文字位置 st文字位置17 = new ST文字位置(); + st文字位置17.ch = '5'; + st文字位置17.pt = new Point(160, 0); + st文字位置Array2[5] = st文字位置17; + ST文字位置 st文字位置18 = new ST文字位置(); + st文字位置18.ch = '6'; + st文字位置18.pt = new Point(192, 0); + st文字位置Array2[6] = st文字位置18; + ST文字位置 st文字位置19 = new ST文字位置(); + st文字位置19.ch = '7'; + st文字位置19.pt = new Point(224, 0); + st文字位置Array2[7] = st文字位置19; + ST文字位置 st文字位置20 = new ST文字位置(); + st文字位置20.ch = '8'; + st文字位置20.pt = new Point(256, 0); + st文字位置Array2[8] = st文字位置20; + ST文字位置 st文字位置21 = new ST文字位置(); + st文字位置21.ch = '9'; + st文字位置21.pt = new Point(288, 0); + st文字位置Array2[9] = st文字位置21; + ST文字位置 st文字位置22 = new ST文字位置(); + st文字位置22.ch = '%'; + st文字位置22.pt = new Point(0x37, 0); + st文字位置Array2[10] = st文字位置22; + this.st大文字位置 = st文字位置Array2; - base.ChildActivities.Add(this.PuchiChara = new PuchiChara()); + ST文字位置[] stScore文字位置Array = new ST文字位置[10]; + ST文字位置 stScore文字位置 = new ST文字位置(); + stScore文字位置.ch = '0'; + stScore文字位置.pt = new Point(0, 0); + stScore文字位置Array[0] = stScore文字位置; + ST文字位置 stScore文字位置2 = new ST文字位置(); + stScore文字位置2.ch = '1'; + stScore文字位置2.pt = new Point(51, 0); + stScore文字位置Array[1] = stScore文字位置2; + ST文字位置 stScore文字位置3 = new ST文字位置(); + stScore文字位置3.ch = '2'; + stScore文字位置3.pt = new Point(102, 0); + stScore文字位置Array[2] = stScore文字位置3; + ST文字位置 stScore文字位置4 = new ST文字位置(); + stScore文字位置4.ch = '3'; + stScore文字位置4.pt = new Point(153, 0); + stScore文字位置Array[3] = stScore文字位置4; + ST文字位置 stScore文字位置5 = new ST文字位置(); + stScore文字位置5.ch = '4'; + stScore文字位置5.pt = new Point(204, 0); + stScore文字位置Array[4] = stScore文字位置5; + ST文字位置 stScore文字位置6 = new ST文字位置(); + stScore文字位置6.ch = '5'; + stScore文字位置6.pt = new Point(255, 0); + stScore文字位置Array[5] = stScore文字位置6; + ST文字位置 stScore文字位置7 = new ST文字位置(); + stScore文字位置7.ch = '6'; + stScore文字位置7.pt = new Point(306, 0); + stScore文字位置Array[6] = stScore文字位置7; + ST文字位置 stScore文字位置8 = new ST文字位置(); + stScore文字位置8.ch = '7'; + stScore文字位置8.pt = new Point(357, 0); + stScore文字位置Array[7] = stScore文字位置8; + ST文字位置 stScore文字位置9 = new ST文字位置(); + stScore文字位置9.ch = '8'; + stScore文字位置9.pt = new Point(408, 0); + stScore文字位置Array[8] = stScore文字位置9; + ST文字位置 stScore文字位置10 = new ST文字位置(); + stScore文字位置10.ch = '9'; + stScore文字位置10.pt = new Point(459, 0); + stScore文字位置Array[9] = stScore文字位置10; + this.stScoreFont = stScore文字位置Array; - this.ptFullCombo位置 = new Point[] { new Point(0x80, 0xed), new Point(0xdf, 0xed), new Point(0x141, 0xed) }; - base.IsDeActivated = true; + base.ChildActivities.Add(this.PuchiChara = new PuchiChara()); + + this.ptFullCombo位置 = new Point[] { new Point(0x80, 0xed), new Point(0xdf, 0xed), new Point(0x141, 0xed) }; + base.IsDeActivated = true; + } + + + // メソッド + + public void tアニメを完了させる() { + this.ct表示用.CurrentValue = (int)this.ct表示用.EndValue; + } + + + public void tSkipResultAnimations() { + OpenTaiko.stage結果.Background.SkipAnimation(); + ctMainCounter.CurrentValue = (int)MountainAppearValue; + + for (int i = 0; i < b音声再生.Length; i++) { + b音声再生[i] = true; } - - // メソッド - - public void tアニメを完了させる() { - this.ct表示用.CurrentValue = (int)this.ct表示用.EndValue; + for (int i = 0; i < 5; i++) { + if (!ctゲージアニメ[i].IsTicked) + ctゲージアニメ[i].Start(0, gaugeValues[i] / 2, 59, OpenTaiko.Timer); + ctゲージアニメ[i].CurrentValue = (int)ctゲージアニメ[i].EndValue; } + OpenTaiko.Skin.soundGauge.tStop(); + } - public void tSkipResultAnimations() { - OpenTaiko.stage結果.Background.SkipAnimation(); - ctMainCounter.CurrentValue = (int)MountainAppearValue; + // CActivity 実装 - for (int i = 0; i < b音声再生.Length; i++) { - b音声再生[i] = true; + public override void Activate() { + this.sdDTXで指定されたフルコンボ音 = null; + + ttkAISection = new TitleTextureKey[OpenTaiko.stage演奏ドラム画面.AIBattleSections.Count]; + for (int i = 0; i < ttkAISection.Length; i++) { + ttkAISection[i] = new TitleTextureKey(CLangManager.LangInstance.GetString("AI_SECTION", i + 1), pfAISectionText, Color.White, Color.Black, 1280); + + } + + for (int i = 0; i < 5; i++) { + ttkSpeechText[i] = new TitleTextureKey[6]; + + int _charaId = OpenTaiko.SaveFileInstances[OpenTaiko.GetActualPlayer(i)].data.Character; + + for (int j = 0; j < 6; j++) { + // { "simplestyleSweat", "...", "○", "◎", "★", "!!!!" } + ttkSpeechText[i][j] = new TitleTextureKey( + OpenTaiko.Tx.Characters[_charaId].metadata.SpeechText[j].GetString(""), + pfSpeechText, Color.White, Color.Black, OpenTaiko.Skin.Result_Speech_Text_MaxWidth); } - - for (int i = 0; i < 5; i++) { - if (!ctゲージアニメ[i].IsTicked) - ctゲージアニメ[i].Start(0, gaugeValues[i] / 2, 59, OpenTaiko.Timer); - ctゲージアニメ[i].CurrentValue = (int)ctゲージアニメ[i].EndValue; - } - - OpenTaiko.Skin.soundGauge.tStop(); } - // CActivity 実装 + ctMainCounter = new CCounter(0, 50000, 1, OpenTaiko.Timer); - public override void Activate() { + ctゲージアニメ = new CCounter[5]; + for (int i = 0; i < 5; i++) + ctゲージアニメ[i] = new CCounter(); + + ct虹ゲージアニメ = new CCounter(); + + ctSoul = new CCounter(); + + ctEndAnime = new CCounter(); + ctBackgroundAnime = new CCounter(0, 1000, 1, OpenTaiko.Timer); + ctBackgroundAnime_Clear = new CCounter(0, 1000, 1, OpenTaiko.Timer); + ctMountain_ClearIn = new CCounter(); + + RandomText = OpenTaiko.Random.Next(3); + + ctFlash_Icon = new CCounter(0, 3000, 1, OpenTaiko.Timer); + ctRotate_Flowers = new CCounter(0, 1500, 1, OpenTaiko.Timer); + ctShine_Plate = new CCounter(0, 1000, 1, OpenTaiko.Timer); + + ctAISectionChange = new CCounter(0, 2000, 1, OpenTaiko.Timer); + ctAISectionChange.CurrentValue = 255; + + ctUIMove = new CCounter(); + + for (int i = 0; i < 5; i++) { + CResultCharacter.tMenuResetTimer(CResultCharacter.ECharacterResult.NORMAL); + CResultCharacter.tDisableCounter(CResultCharacter.ECharacterResult.CLEAR); + CResultCharacter.tDisableCounter(CResultCharacter.ECharacterResult.FAILED); + CResultCharacter.tDisableCounter(CResultCharacter.ECharacterResult.FAILED_IN); + } + + gaugeValues = new int[5]; + for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { + gaugeValues[i] = (int)OpenTaiko.stage演奏ドラム画面.actGauge.db現在のゲージ値[i]; + } + + // Replace by max between 2 gauges if 2p + GaugeFactor = Math.Max(Math.Max(Math.Max(Math.Max(gaugeValues[0], gaugeValues[1]), gaugeValues[2]), gaugeValues[3]), gaugeValues[4]) / 2; + + MountainAppearValue = 10275 + (66 * GaugeFactor); + + this.PuchiChara.IdleAnimation(); + + base.Activate(); + } + public override void DeActivate() { + if (this.ct表示用 != null) { + this.ct表示用 = null; + } + + for (int i = 0; i < this.b音声再生.Length; i++) { + b音声再生[i] = false; + } + + if (this.sdDTXで指定されたフルコンボ音 != null) { + OpenTaiko.SoundManager.tDisposeSound(this.sdDTXで指定されたフルコンボ音); this.sdDTXで指定されたフルコンボ音 = null; + } + base.DeActivate(); + } + public override void CreateManagedResource() { + pfSpeechText = HPrivateFastFont.tInstantiateMainFont(OpenTaiko.Skin.Result_Speech_Text_Size); + pfAISectionText = HPrivateFastFont.tInstantiateMainFont(OpenTaiko.Skin.Result_AIBattle_SectionText_Scale); - ttkAISection = new TitleTextureKey[OpenTaiko.stage演奏ドラム画面.AIBattleSections.Count]; - for (int i = 0; i < ttkAISection.Length; i++) { - ttkAISection[i] = new TitleTextureKey(CLangManager.LangInstance.GetString("AI_SECTION", i + 1), pfAISectionText, Color.White, Color.Black, 1280); + base.CreateManagedResource(); + } + public override void ReleaseManagedResource() { + OpenTaiko.tDisposeSafely(ref pfSpeechText); + OpenTaiko.tDisposeSafely(ref pfAISectionText); - } + base.ReleaseManagedResource(); + } + public override int Draw() { + if (base.IsDeActivated) { + return 0; + } + if (base.IsFirstDraw) { + this.ct表示用 = new CCounter(0, 0x3e7, 2, OpenTaiko.Timer); + base.IsFirstDraw = false; + } + this.ct表示用.Tick(); - for (int i = 0; i < 5; i++) { - ttkSpeechText[i] = new TitleTextureKey[6]; + ctMainCounter.Tick(); - int _charaId = OpenTaiko.SaveFileInstances[OpenTaiko.GetActualPlayer(i)].data.Character; + for (int i = 0; i < 5; i++) + ctゲージアニメ[i].Tick(); - for (int j = 0; j < 6; j++) { - // { "simplestyleSweat", "...", "○", "◎", "★", "!!!!" } - ttkSpeechText[i][j] = new TitleTextureKey( - OpenTaiko.Tx.Characters[_charaId].metadata.SpeechText[j].GetString(""), - pfSpeechText, Color.White, Color.Black, OpenTaiko.Skin.Result_Speech_Text_MaxWidth); - } - } + ctEndAnime.Tick(); + ctBackgroundAnime.TickLoop(); + ctMountain_ClearIn.Tick(); - ctMainCounter = new CCounter(0, 50000, 1, OpenTaiko.Timer); + ctFlash_Icon.TickLoop(); + ctRotate_Flowers.TickLoop(); + ctShine_Plate.TickLoop(); - ctゲージアニメ = new CCounter[5]; - for (int i = 0; i < 5; i++) - ctゲージアニメ[i] = new CCounter(); + ctAISectionChange.Tick(); - ct虹ゲージアニメ = new CCounter(); + // this.PuchiChara.IdleAnimation(); - ctSoul = new CCounter(); + if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] != (int)Difficulty.Dan && OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] != (int)Difficulty.Tower) { + int[] namePlate_x = new int[5]; + int[] namePlate_y = new int[5]; - ctEndAnime = new CCounter(); - ctBackgroundAnime = new CCounter(0, 1000, 1, OpenTaiko.Timer); - ctBackgroundAnime_Clear = new CCounter(0, 1000, 1, OpenTaiko.Timer); - ctMountain_ClearIn = new CCounter(); - - RandomText = OpenTaiko.Random.Next(3); - - ctFlash_Icon = new CCounter(0, 3000, 1, OpenTaiko.Timer); - ctRotate_Flowers = new CCounter(0, 1500, 1, OpenTaiko.Timer); - ctShine_Plate = new CCounter(0, 1000, 1, OpenTaiko.Timer); - - ctAISectionChange = new CCounter(0, 2000, 1, OpenTaiko.Timer); - ctAISectionChange.CurrentValue = 255; - - ctUIMove = new CCounter(); - - for (int i = 0; i < 5; i++) { - CResultCharacter.tMenuResetTimer(CResultCharacter.ECharacterResult.NORMAL); - CResultCharacter.tDisableCounter(CResultCharacter.ECharacterResult.CLEAR); - CResultCharacter.tDisableCounter(CResultCharacter.ECharacterResult.FAILED); - CResultCharacter.tDisableCounter(CResultCharacter.ECharacterResult.FAILED_IN); - } - - gaugeValues = new int[5]; for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { - gaugeValues[i] = (int)OpenTaiko.stage演奏ドラム画面.actGauge.db現在のゲージ値[i]; - } - - // Replace by max between 2 gauges if 2p - GaugeFactor = Math.Max(Math.Max(Math.Max(Math.Max(gaugeValues[0], gaugeValues[1]), gaugeValues[2]), gaugeValues[3]), gaugeValues[4]) / 2; - - MountainAppearValue = 10275 + (66 * GaugeFactor); - - this.PuchiChara.IdleAnimation(); - - base.Activate(); - } - public override void DeActivate() { - if (this.ct表示用 != null) { - this.ct表示用 = null; - } - - for (int i = 0; i < this.b音声再生.Length; i++) { - b音声再生[i] = false; - } - - if (this.sdDTXで指定されたフルコンボ音 != null) { - OpenTaiko.SoundManager.tDisposeSound(this.sdDTXで指定されたフルコンボ音); - this.sdDTXで指定されたフルコンボ音 = null; - } - base.DeActivate(); - } - public override void CreateManagedResource() { - pfSpeechText = HPrivateFastFont.tInstantiateMainFont(OpenTaiko.Skin.Result_Speech_Text_Size); - pfAISectionText = HPrivateFastFont.tInstantiateMainFont(OpenTaiko.Skin.Result_AIBattle_SectionText_Scale); - - base.CreateManagedResource(); - } - public override void ReleaseManagedResource() { - OpenTaiko.tDisposeSafely(ref pfSpeechText); - OpenTaiko.tDisposeSafely(ref pfAISectionText); - - base.ReleaseManagedResource(); - } - public override int Draw() { - if (base.IsDeActivated) { - return 0; - } - if (base.IsFirstDraw) { - this.ct表示用 = new CCounter(0, 0x3e7, 2, OpenTaiko.Timer); - base.IsFirstDraw = false; - } - this.ct表示用.Tick(); - - ctMainCounter.Tick(); - - for (int i = 0; i < 5; i++) - ctゲージアニメ[i].Tick(); - - ctEndAnime.Tick(); - ctBackgroundAnime.TickLoop(); - ctMountain_ClearIn.Tick(); - - ctFlash_Icon.TickLoop(); - ctRotate_Flowers.TickLoop(); - ctShine_Plate.TickLoop(); - - ctAISectionChange.Tick(); - - // this.PuchiChara.IdleAnimation(); - - if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] != (int)Difficulty.Dan && OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] != (int)Difficulty.Tower) { - int[] namePlate_x = new int[5]; - int[] namePlate_y = new int[5]; - - for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { - if (OpenTaiko.ConfigIni.nPlayerCount == 5) { - namePlate_x[i] = OpenTaiko.Skin.Result_NamePlate_5P[0] + OpenTaiko.Skin.Result_UIMove_5P_X[i]; - namePlate_y[i] = OpenTaiko.Skin.Result_NamePlate_5P[1] + OpenTaiko.Skin.Result_UIMove_5P_Y[i]; - } else if (OpenTaiko.ConfigIni.nPlayerCount == 4 || OpenTaiko.ConfigIni.nPlayerCount == 3) { - namePlate_x[i] = OpenTaiko.Skin.Result_NamePlate_4P[0] + OpenTaiko.Skin.Result_UIMove_4P_X[i]; - namePlate_y[i] = OpenTaiko.Skin.Result_NamePlate_4P[1] + OpenTaiko.Skin.Result_UIMove_4P_Y[i]; - } else { - int pos = i; - if (OpenTaiko.P1IsBlue()) - pos = 1; - namePlate_x[pos] = OpenTaiko.Skin.Result_NamePlate_X[pos]; - namePlate_y[pos] = OpenTaiko.Skin.Result_NamePlate_Y[pos]; - } - } - - ctUIMove.Tick(); - - #region [ Ensou result contents ] - - int AnimeCount = 3000 + GaugeFactor * 59; - int ScoreApparitionTimeStamp = AnimeCount + 420 * 4 + 840; - - bool is1P = (OpenTaiko.ConfigIni.nPlayerCount == 1); - bool is2PSide = OpenTaiko.P1IsBlue(); - - int shift = 635; - - int uioffset_x = 0; - double uioffset_value = Math.Sin((ctUIMove.CurrentValue / 1000.0) * Math.PI / 2.0); - if (is1P) { - uioffset_x = (int)(uioffset_value * OpenTaiko.Skin.Resolution[0] / 2.0); - if (is2PSide) uioffset_x *= -1; - } - - for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { - if (OpenTaiko.ConfigIni.bAIBattleMode && i == 1) break; - - // 1 if right, 0 if left - int shiftPos = (i == 1 || is2PSide) ? 1 : i; + if (OpenTaiko.ConfigIni.nPlayerCount == 5) { + namePlate_x[i] = OpenTaiko.Skin.Result_NamePlate_5P[0] + OpenTaiko.Skin.Result_UIMove_5P_X[i]; + namePlate_y[i] = OpenTaiko.Skin.Result_NamePlate_5P[1] + OpenTaiko.Skin.Result_UIMove_5P_Y[i]; + } else if (OpenTaiko.ConfigIni.nPlayerCount == 4 || OpenTaiko.ConfigIni.nPlayerCount == 3) { + namePlate_x[i] = OpenTaiko.Skin.Result_NamePlate_4P[0] + OpenTaiko.Skin.Result_UIMove_4P_X[i]; + namePlate_y[i] = OpenTaiko.Skin.Result_NamePlate_4P[1] + OpenTaiko.Skin.Result_UIMove_4P_Y[i]; + } else { int pos = i; - if (is2PSide) + if (OpenTaiko.P1IsBlue()) pos = 1; + namePlate_x[pos] = OpenTaiko.Skin.Result_NamePlate_X[pos]; + namePlate_y[pos] = OpenTaiko.Skin.Result_NamePlate_Y[pos]; + } + } + + ctUIMove.Tick(); + + #region [ Ensou result contents ] + + int AnimeCount = 3000 + GaugeFactor * 59; + int ScoreApparitionTimeStamp = AnimeCount + 420 * 4 + 840; + + bool is1P = (OpenTaiko.ConfigIni.nPlayerCount == 1); + bool is2PSide = OpenTaiko.P1IsBlue(); + + int shift = 635; + + int uioffset_x = 0; + double uioffset_value = Math.Sin((ctUIMove.CurrentValue / 1000.0) * Math.PI / 2.0); + if (is1P) { + uioffset_x = (int)(uioffset_value * OpenTaiko.Skin.Resolution[0] / 2.0); + if (is2PSide) uioffset_x *= -1; + } + + for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { + if (OpenTaiko.ConfigIni.bAIBattleMode && i == 1) break; + + // 1 if right, 0 if left + int shiftPos = (i == 1 || is2PSide) ? 1 : i; + int pos = i; + if (is2PSide) + pos = 1; - #region [General plate animations] + #region [General plate animations] - if (OpenTaiko.ConfigIni.nPlayerCount <= 2) { - if (shiftPos == 0) - OpenTaiko.Tx.Result_Panel.t2D描画(0 + uioffset_x, 0); - else - OpenTaiko.Tx.Result_Panel_2P.t2D描画(0 + uioffset_x, 0); + if (OpenTaiko.ConfigIni.nPlayerCount <= 2) { + if (shiftPos == 0) + OpenTaiko.Tx.Result_Panel.t2D描画(0 + uioffset_x, 0); + else + OpenTaiko.Tx.Result_Panel_2P.t2D描画(0 + uioffset_x, 0); + } else { + if (OpenTaiko.ConfigIni.nPlayerCount == 5) { + OpenTaiko.Tx.Result_Panel_5P[i].t2D描画(OpenTaiko.Skin.Result_UIMove_5P_X[i], OpenTaiko.Skin.Result_UIMove_5P_Y[i]); } else { - if (OpenTaiko.ConfigIni.nPlayerCount == 5) { - OpenTaiko.Tx.Result_Panel_5P[i].t2D描画(OpenTaiko.Skin.Result_UIMove_5P_X[i], OpenTaiko.Skin.Result_UIMove_5P_Y[i]); - } else { - OpenTaiko.Tx.Result_Panel_4P[i].t2D描画(OpenTaiko.Skin.Result_UIMove_4P_X[i], OpenTaiko.Skin.Result_UIMove_4P_Y[i]); - } + OpenTaiko.Tx.Result_Panel_4P[i].t2D描画(OpenTaiko.Skin.Result_UIMove_4P_X[i], OpenTaiko.Skin.Result_UIMove_4P_Y[i]); + } + } + + //if (TJAPlayer3.ConfigIni.nPlayerCount <= 2) + var _frame = OpenTaiko.Tx.Result_Gauge_Frame; + if (_frame != null) { + int bar_x; + int bar_y; + int gauge_base_x; + int gauge_base_y; + + + if (OpenTaiko.ConfigIni.nPlayerCount == 5) { + _frame.vcScaleRatio.X = 0.5f; + bar_x = OpenTaiko.Skin.Result_DifficultyBar_5P[0] + OpenTaiko.Skin.Result_UIMove_5P_X[pos]; + bar_y = OpenTaiko.Skin.Result_DifficultyBar_5P[1] + OpenTaiko.Skin.Result_UIMove_5P_Y[pos]; + gauge_base_x = OpenTaiko.Skin.Result_Gauge_Base_5P[0] + OpenTaiko.Skin.Result_UIMove_5P_X[pos]; + gauge_base_y = OpenTaiko.Skin.Result_Gauge_Base_5P[1] + OpenTaiko.Skin.Result_UIMove_5P_Y[pos]; + } else if (OpenTaiko.ConfigIni.nPlayerCount == 4 || OpenTaiko.ConfigIni.nPlayerCount == 3) { + _frame.vcScaleRatio.X = 0.5f; + bar_x = OpenTaiko.Skin.Result_DifficultyBar_4P[0] + OpenTaiko.Skin.Result_UIMove_4P_X[pos]; + bar_y = OpenTaiko.Skin.Result_DifficultyBar_4P[1] + OpenTaiko.Skin.Result_UIMove_4P_Y[pos]; + gauge_base_x = OpenTaiko.Skin.Result_Gauge_Base_4P[0] + OpenTaiko.Skin.Result_UIMove_4P_X[pos]; + gauge_base_y = OpenTaiko.Skin.Result_Gauge_Base_4P[1] + OpenTaiko.Skin.Result_UIMove_4P_Y[pos]; + } else { + _frame.vcScaleRatio.X = 1.0f; + bar_x = OpenTaiko.Skin.Result_DifficultyBar_X[pos] + uioffset_x; + bar_y = OpenTaiko.Skin.Result_DifficultyBar_Y[pos]; + gauge_base_x = OpenTaiko.Skin.Result_Gauge_Base_X[pos] + uioffset_x; + gauge_base_y = OpenTaiko.Skin.Result_Gauge_Base_Y[pos]; } - //if (TJAPlayer3.ConfigIni.nPlayerCount <= 2) - var _frame = OpenTaiko.Tx.Result_Gauge_Frame; - if (_frame != null) { - int bar_x; - int bar_y; - int gauge_base_x; - int gauge_base_y; - - - if (OpenTaiko.ConfigIni.nPlayerCount == 5) { - _frame.vcScaleRatio.X = 0.5f; - bar_x = OpenTaiko.Skin.Result_DifficultyBar_5P[0] + OpenTaiko.Skin.Result_UIMove_5P_X[pos]; - bar_y = OpenTaiko.Skin.Result_DifficultyBar_5P[1] + OpenTaiko.Skin.Result_UIMove_5P_Y[pos]; - gauge_base_x = OpenTaiko.Skin.Result_Gauge_Base_5P[0] + OpenTaiko.Skin.Result_UIMove_5P_X[pos]; - gauge_base_y = OpenTaiko.Skin.Result_Gauge_Base_5P[1] + OpenTaiko.Skin.Result_UIMove_5P_Y[pos]; - } else if (OpenTaiko.ConfigIni.nPlayerCount == 4 || OpenTaiko.ConfigIni.nPlayerCount == 3) { - _frame.vcScaleRatio.X = 0.5f; - bar_x = OpenTaiko.Skin.Result_DifficultyBar_4P[0] + OpenTaiko.Skin.Result_UIMove_4P_X[pos]; - bar_y = OpenTaiko.Skin.Result_DifficultyBar_4P[1] + OpenTaiko.Skin.Result_UIMove_4P_Y[pos]; - gauge_base_x = OpenTaiko.Skin.Result_Gauge_Base_4P[0] + OpenTaiko.Skin.Result_UIMove_4P_X[pos]; - gauge_base_y = OpenTaiko.Skin.Result_Gauge_Base_4P[1] + OpenTaiko.Skin.Result_UIMove_4P_Y[pos]; - } else { - _frame.vcScaleRatio.X = 1.0f; - bar_x = OpenTaiko.Skin.Result_DifficultyBar_X[pos] + uioffset_x; - bar_y = OpenTaiko.Skin.Result_DifficultyBar_Y[pos]; - gauge_base_x = OpenTaiko.Skin.Result_Gauge_Base_X[pos] + uioffset_x; - gauge_base_y = OpenTaiko.Skin.Result_Gauge_Base_Y[pos]; - } - - OpenTaiko.Tx.Result_Diff_Bar.t2D描画(bar_x, bar_y, + OpenTaiko.Tx.Result_Diff_Bar.t2D描画(bar_x, bar_y, new RectangleF(0, OpenTaiko.stageSongSelect.nChoosenSongDifficulty[i] * OpenTaiko.Skin.Result_DifficultyBar_Size[1], OpenTaiko.Skin.Result_DifficultyBar_Size[0], OpenTaiko.Skin.Result_DifficultyBar_Size[1])); - _frame.t2D描画(gauge_base_x, gauge_base_y); - _frame.vcScaleRatio.X = 1.0f; + _frame.t2D描画(gauge_base_x, gauge_base_y); + _frame.vcScaleRatio.X = 1.0f; + } + + if (ctMainCounter.CurrentValue >= 2000) { + #region [ Gauge updates ] + + if (!b音声再生[0]) { + OpenTaiko.Skin.soundGauge.tPlay(); + b音声再生[0] = true; } - if (ctMainCounter.CurrentValue >= 2000) { - #region [ Gauge updates ] - - if (!b音声再生[0]) { - OpenTaiko.Skin.soundGauge.tPlay(); - b音声再生[0] = true; - } - - // Split gauge counter, one for each player in two - if (!ctゲージアニメ[i].IsTicked) { - ctゲージアニメ[i].Start(0, gaugeValues[i] / 2, 59, OpenTaiko.Timer); - if (ctMainCounter.CurrentValue >= MountainAppearValue) - ctゲージアニメ[i].CurrentValue = (int)ctゲージアニメ[i].EndValue; - } + // Split gauge counter, one for each player in two + if (!ctゲージアニメ[i].IsTicked) { + ctゲージアニメ[i].Start(0, gaugeValues[i] / 2, 59, OpenTaiko.Timer); + if (ctMainCounter.CurrentValue >= MountainAppearValue) + ctゲージアニメ[i].CurrentValue = (int)ctゲージアニメ[i].EndValue; + } - if (ctゲージアニメ[i].IsEnded) { - if (ctゲージアニメ[i].CurrentValue != 50) { - // Gauge didn't reach rainbow - if (OpenTaiko.ConfigIni.nPlayerCount < 2 - || ctゲージアニメ[(i == 0) ? 1 : 0].IsEnded) - OpenTaiko.Skin.soundGauge.tStop(); - } else { - // Gauge reached rainbow - if (!OpenTaiko.Skin.soundGauge.bIsPlaying) { - OpenTaiko.Skin.soundGauge.tStop(); - } - - if (!ct虹ゲージアニメ.IsTicked) - ct虹ゲージアニメ.Start(0, OpenTaiko.Skin.Result_Gauge_Rainbow_Ptn - 1, OpenTaiko.Skin.Result_Gauge_Rainbow_Interval, OpenTaiko.Timer); - - if (!ctSoul.IsTicked) - ctSoul.Start(0, 8, 33, OpenTaiko.Timer); - - ct虹ゲージアニメ.TickLoop(); - ctSoul.TickLoop(); + if (ctゲージアニメ[i].IsEnded) { + if (ctゲージアニメ[i].CurrentValue != 50) { + // Gauge didn't reach rainbow + if (OpenTaiko.ConfigIni.nPlayerCount < 2 + || ctゲージアニメ[(i == 0) ? 1 : 0].IsEnded) + OpenTaiko.Skin.soundGauge.tStop(); + } else { + // Gauge reached rainbow + if (!OpenTaiko.Skin.soundGauge.bIsPlaying) { + OpenTaiko.Skin.soundGauge.tStop(); } + + if (!ct虹ゲージアニメ.IsTicked) + ct虹ゲージアニメ.Start(0, OpenTaiko.Skin.Result_Gauge_Rainbow_Ptn - 1, OpenTaiko.Skin.Result_Gauge_Rainbow_Interval, OpenTaiko.Timer); + + if (!ctSoul.IsTicked) + ctSoul.Start(0, 8, 33, OpenTaiko.Timer); + + ct虹ゲージアニメ.TickLoop(); + ctSoul.TickLoop(); } - - HGaugeMethods.UNSAFE_DrawResultGaugeFast(i, shiftPos, pos, ctゲージアニメ[i].CurrentValue, ct虹ゲージアニメ.CurrentValue, ctSoul.CurrentValue, uioffset_x); - - #endregion } - if (ctMainCounter.CurrentValue >= 2000) { - // Change score kiroku to total scores to have the contents for both players, unbloat it + HGaugeMethods.UNSAFE_DrawResultGaugeFast(i, shiftPos, pos, ctゲージアニメ[i].CurrentValue, ct虹ゲージアニメ.CurrentValue, ctSoul.CurrentValue, uioffset_x); + + #endregion + } + + if (ctMainCounter.CurrentValue >= 2000) { + // Change score kiroku to total scores to have the contents for both players, unbloat it + { + #region [ Separate results display (excluding score) ] + + int Interval = 420; + + float AddCount = 135; + + int[] scoresArr = { - #region [ Separate results display (excluding score) ] - - int Interval = 420; - - float AddCount = 135; - - int[] scoresArr = - { OpenTaiko.stage演奏ドラム画面.CChartScore[i].nGreat, OpenTaiko.stage演奏ドラム画面.CChartScore[i].nGood, OpenTaiko.stage演奏ドラム画面.CChartScore[i].nMiss, @@ -464,786 +465,785 @@ namespace OpenTaiko { OpenTaiko.stage演奏ドラム画面.CChartScore[i].nMine, }; - int[][] num_x; + int[][] num_x; - int[][] num_y; - if (OpenTaiko.ConfigIni.nPlayerCount == 5) { - num_x = new int[][] { new int[5], new int[5], new int[5], new int[5], new int[5], new int[5], new int[5] }; - num_y = new int[][] { new int[5], new int[5], new int[5], new int[5], new int[5], new int[5], new int[5] }; + int[][] num_y; + if (OpenTaiko.ConfigIni.nPlayerCount == 5) { + num_x = new int[][] { new int[5], new int[5], new int[5], new int[5], new int[5], new int[5], new int[5] }; + num_y = new int[][] { new int[5], new int[5], new int[5], new int[5], new int[5], new int[5], new int[5] }; - num_x[0][pos] = OpenTaiko.Skin.Result_Perfect_5P[0] + OpenTaiko.Skin.Result_UIMove_5P_X[pos]; - num_y[0][pos] = OpenTaiko.Skin.Result_Perfect_5P[1] + OpenTaiko.Skin.Result_UIMove_5P_Y[pos]; + num_x[0][pos] = OpenTaiko.Skin.Result_Perfect_5P[0] + OpenTaiko.Skin.Result_UIMove_5P_X[pos]; + num_y[0][pos] = OpenTaiko.Skin.Result_Perfect_5P[1] + OpenTaiko.Skin.Result_UIMove_5P_Y[pos]; - num_x[1][pos] = OpenTaiko.Skin.Result_Good_5P[0] + OpenTaiko.Skin.Result_UIMove_5P_X[pos]; - num_y[1][pos] = OpenTaiko.Skin.Result_Good_5P[1] + OpenTaiko.Skin.Result_UIMove_5P_Y[pos]; + num_x[1][pos] = OpenTaiko.Skin.Result_Good_5P[0] + OpenTaiko.Skin.Result_UIMove_5P_X[pos]; + num_y[1][pos] = OpenTaiko.Skin.Result_Good_5P[1] + OpenTaiko.Skin.Result_UIMove_5P_Y[pos]; - num_x[2][pos] = OpenTaiko.Skin.Result_Miss_5P[0] + OpenTaiko.Skin.Result_UIMove_5P_X[pos]; - num_y[2][pos] = OpenTaiko.Skin.Result_Miss_5P[1] + OpenTaiko.Skin.Result_UIMove_5P_Y[pos]; + num_x[2][pos] = OpenTaiko.Skin.Result_Miss_5P[0] + OpenTaiko.Skin.Result_UIMove_5P_X[pos]; + num_y[2][pos] = OpenTaiko.Skin.Result_Miss_5P[1] + OpenTaiko.Skin.Result_UIMove_5P_Y[pos]; - num_x[3][pos] = OpenTaiko.Skin.Result_Roll_5P[0] + OpenTaiko.Skin.Result_UIMove_5P_X[pos]; - num_y[3][pos] = OpenTaiko.Skin.Result_Roll_5P[1] + OpenTaiko.Skin.Result_UIMove_5P_Y[pos]; + num_x[3][pos] = OpenTaiko.Skin.Result_Roll_5P[0] + OpenTaiko.Skin.Result_UIMove_5P_X[pos]; + num_y[3][pos] = OpenTaiko.Skin.Result_Roll_5P[1] + OpenTaiko.Skin.Result_UIMove_5P_Y[pos]; - num_x[4][pos] = OpenTaiko.Skin.Result_MaxCombo_5P[0] + OpenTaiko.Skin.Result_UIMove_5P_X[pos]; - num_y[4][pos] = OpenTaiko.Skin.Result_MaxCombo_5P[1] + OpenTaiko.Skin.Result_UIMove_5P_Y[pos]; + num_x[4][pos] = OpenTaiko.Skin.Result_MaxCombo_5P[0] + OpenTaiko.Skin.Result_UIMove_5P_X[pos]; + num_y[4][pos] = OpenTaiko.Skin.Result_MaxCombo_5P[1] + OpenTaiko.Skin.Result_UIMove_5P_Y[pos]; - num_x[5][pos] = OpenTaiko.Skin.Result_ADLib_5P[0] + OpenTaiko.Skin.Result_UIMove_5P_X[pos]; - num_y[5][pos] = OpenTaiko.Skin.Result_ADLib_5P[1] + OpenTaiko.Skin.Result_UIMove_5P_Y[pos]; + num_x[5][pos] = OpenTaiko.Skin.Result_ADLib_5P[0] + OpenTaiko.Skin.Result_UIMove_5P_X[pos]; + num_y[5][pos] = OpenTaiko.Skin.Result_ADLib_5P[1] + OpenTaiko.Skin.Result_UIMove_5P_Y[pos]; - num_x[6][pos] = OpenTaiko.Skin.Result_Bomb_5P[0] + OpenTaiko.Skin.Result_UIMove_5P_X[pos]; - num_y[6][pos] = OpenTaiko.Skin.Result_Bomb_5P[1] + OpenTaiko.Skin.Result_UIMove_5P_Y[pos]; - } else if (OpenTaiko.ConfigIni.nPlayerCount > 2) { - num_x = new int[][] { new int[5], new int[5], new int[5], new int[5], new int[5], new int[5], new int[5] }; - num_y = new int[][] { new int[5], new int[5], new int[5], new int[5], new int[5], new int[5], new int[5] }; + num_x[6][pos] = OpenTaiko.Skin.Result_Bomb_5P[0] + OpenTaiko.Skin.Result_UIMove_5P_X[pos]; + num_y[6][pos] = OpenTaiko.Skin.Result_Bomb_5P[1] + OpenTaiko.Skin.Result_UIMove_5P_Y[pos]; + } else if (OpenTaiko.ConfigIni.nPlayerCount > 2) { + num_x = new int[][] { new int[5], new int[5], new int[5], new int[5], new int[5], new int[5], new int[5] }; + num_y = new int[][] { new int[5], new int[5], new int[5], new int[5], new int[5], new int[5], new int[5] }; - num_x[0][pos] = OpenTaiko.Skin.Result_Perfect_4P[0] + OpenTaiko.Skin.Result_UIMove_4P_X[pos]; - num_y[0][pos] = OpenTaiko.Skin.Result_Perfect_4P[1] + OpenTaiko.Skin.Result_UIMove_4P_Y[pos]; + num_x[0][pos] = OpenTaiko.Skin.Result_Perfect_4P[0] + OpenTaiko.Skin.Result_UIMove_4P_X[pos]; + num_y[0][pos] = OpenTaiko.Skin.Result_Perfect_4P[1] + OpenTaiko.Skin.Result_UIMove_4P_Y[pos]; - num_x[1][pos] = OpenTaiko.Skin.Result_Good_4P[0] + OpenTaiko.Skin.Result_UIMove_4P_X[pos]; - num_y[1][pos] = OpenTaiko.Skin.Result_Good_4P[1] + OpenTaiko.Skin.Result_UIMove_4P_Y[pos]; + num_x[1][pos] = OpenTaiko.Skin.Result_Good_4P[0] + OpenTaiko.Skin.Result_UIMove_4P_X[pos]; + num_y[1][pos] = OpenTaiko.Skin.Result_Good_4P[1] + OpenTaiko.Skin.Result_UIMove_4P_Y[pos]; - num_x[2][pos] = OpenTaiko.Skin.Result_Miss_4P[0] + OpenTaiko.Skin.Result_UIMove_4P_X[pos]; - num_y[2][pos] = OpenTaiko.Skin.Result_Miss_4P[1] + OpenTaiko.Skin.Result_UIMove_4P_Y[pos]; + num_x[2][pos] = OpenTaiko.Skin.Result_Miss_4P[0] + OpenTaiko.Skin.Result_UIMove_4P_X[pos]; + num_y[2][pos] = OpenTaiko.Skin.Result_Miss_4P[1] + OpenTaiko.Skin.Result_UIMove_4P_Y[pos]; - num_x[3][pos] = OpenTaiko.Skin.Result_Roll_4P[0] + OpenTaiko.Skin.Result_UIMove_4P_X[pos]; - num_y[3][pos] = OpenTaiko.Skin.Result_Roll_4P[1] + OpenTaiko.Skin.Result_UIMove_4P_Y[pos]; + num_x[3][pos] = OpenTaiko.Skin.Result_Roll_4P[0] + OpenTaiko.Skin.Result_UIMove_4P_X[pos]; + num_y[3][pos] = OpenTaiko.Skin.Result_Roll_4P[1] + OpenTaiko.Skin.Result_UIMove_4P_Y[pos]; - num_x[4][pos] = OpenTaiko.Skin.Result_MaxCombo_4P[0] + OpenTaiko.Skin.Result_UIMove_4P_X[pos]; - num_y[4][pos] = OpenTaiko.Skin.Result_MaxCombo_4P[1] + OpenTaiko.Skin.Result_UIMove_4P_Y[pos]; + num_x[4][pos] = OpenTaiko.Skin.Result_MaxCombo_4P[0] + OpenTaiko.Skin.Result_UIMove_4P_X[pos]; + num_y[4][pos] = OpenTaiko.Skin.Result_MaxCombo_4P[1] + OpenTaiko.Skin.Result_UIMove_4P_Y[pos]; - num_x[5][pos] = OpenTaiko.Skin.Result_ADLib_4P[0] + OpenTaiko.Skin.Result_UIMove_4P_X[pos]; - num_y[5][pos] = OpenTaiko.Skin.Result_ADLib_4P[1] + OpenTaiko.Skin.Result_UIMove_4P_Y[pos]; + num_x[5][pos] = OpenTaiko.Skin.Result_ADLib_4P[0] + OpenTaiko.Skin.Result_UIMove_4P_X[pos]; + num_y[5][pos] = OpenTaiko.Skin.Result_ADLib_4P[1] + OpenTaiko.Skin.Result_UIMove_4P_Y[pos]; - num_x[6][pos] = OpenTaiko.Skin.Result_Bomb_4P[0] + OpenTaiko.Skin.Result_UIMove_4P_X[pos]; - num_y[6][pos] = OpenTaiko.Skin.Result_Bomb_4P[1] + OpenTaiko.Skin.Result_UIMove_4P_Y[pos]; - } else { - num_x = new int[][] { - OpenTaiko.Skin.Result_Perfect_X, - OpenTaiko.Skin.Result_Good_X, - OpenTaiko.Skin.Result_Miss_X, - OpenTaiko.Skin.Result_Roll_X, - OpenTaiko.Skin.Result_MaxCombo_X, - OpenTaiko.Skin.Result_ADLib_X, - OpenTaiko.Skin.Result_Bomb_X - }; + num_x[6][pos] = OpenTaiko.Skin.Result_Bomb_4P[0] + OpenTaiko.Skin.Result_UIMove_4P_X[pos]; + num_y[6][pos] = OpenTaiko.Skin.Result_Bomb_4P[1] + OpenTaiko.Skin.Result_UIMove_4P_Y[pos]; + } else { + num_x = new int[][] { + OpenTaiko.Skin.Result_Perfect_X, + OpenTaiko.Skin.Result_Good_X, + OpenTaiko.Skin.Result_Miss_X, + OpenTaiko.Skin.Result_Roll_X, + OpenTaiko.Skin.Result_MaxCombo_X, + OpenTaiko.Skin.Result_ADLib_X, + OpenTaiko.Skin.Result_Bomb_X + }; - num_y = new int[][] { - OpenTaiko.Skin.Result_Perfect_Y, - OpenTaiko.Skin.Result_Good_Y, - OpenTaiko.Skin.Result_Miss_Y, - OpenTaiko.Skin.Result_Roll_Y, - OpenTaiko.Skin.Result_MaxCombo_Y, - OpenTaiko.Skin.Result_ADLib_Y, - OpenTaiko.Skin.Result_Bomb_Y - }; - } + num_y = new int[][] { + OpenTaiko.Skin.Result_Perfect_Y, + OpenTaiko.Skin.Result_Good_Y, + OpenTaiko.Skin.Result_Miss_Y, + OpenTaiko.Skin.Result_Roll_Y, + OpenTaiko.Skin.Result_MaxCombo_Y, + OpenTaiko.Skin.Result_ADLib_Y, + OpenTaiko.Skin.Result_Bomb_Y + }; + } - for (int k = 0; k < 7; k++) { - if (ctMainCounter.CurrentValue >= AnimeCount + (Interval * k)) { - float numScale = 1.0f; - - if (OpenTaiko.ConfigIni.nPlayerCount == 5) { - numScale = OpenTaiko.Skin.Result_Number_Scale_5P; - } else if (OpenTaiko.ConfigIni.nPlayerCount == 3 || OpenTaiko.ConfigIni.nPlayerCount == 4) { - numScale = OpenTaiko.Skin.Result_Number_Scale_4P; - } - OpenTaiko.Tx.Result_Number.vcScaleRatio.X = ctMainCounter.CurrentValue <= AnimeCount + (Interval * k) + AddCount ? 1.3f - (float)Math.Sin((ctMainCounter.CurrentValue - (AnimeCount + (Interval * k))) / (AddCount / 90) * (Math.PI / 180)) * 0.3f : 1.0f; - OpenTaiko.Tx.Result_Number.vcScaleRatio.Y = ctMainCounter.CurrentValue <= AnimeCount + (Interval * k) + AddCount ? 1.3f - (float)Math.Sin((ctMainCounter.CurrentValue - (AnimeCount + (Interval * k))) / (AddCount / 90) * (Math.PI / 180)) * 0.3f : 1.0f; - - if ((k != 5 || OpenTaiko.Skin.Result_ADLib_Show) && (k != 6 || OpenTaiko.Skin.Result_Bomb_Show)) { - this.t小文字表示(num_x[k][pos] + uioffset_x, num_y[k][pos], scoresArr[k], numScale); - } - - OpenTaiko.Tx.Result_Number.vcScaleRatio.X = 1f; - OpenTaiko.Tx.Result_Number.vcScaleRatio.Y = 1f; - - if (!this.b音声再生[1 + k]) { - if ((k != 5 || OpenTaiko.Skin.Result_ADLib_Show) && (k != 6 || OpenTaiko.Skin.Result_Bomb_Show)) { - OpenTaiko.Skin.soundPon.tPlay(); - } - this.b音声再生[1 + k] = true; - } - } else - break; - } - - #endregion - - #region [ Score display ] - - if (ctMainCounter.CurrentValue >= AnimeCount + Interval * 4 + 840) { + for (int k = 0; k < 7; k++) { + if (ctMainCounter.CurrentValue >= AnimeCount + (Interval * k)) { float numScale = 1.0f; - int score_x; - int score_y; + if (OpenTaiko.ConfigIni.nPlayerCount == 5) { - numScale = OpenTaiko.Skin.Result_Score_Scale_5P; - score_x = OpenTaiko.Skin.Result_Score_5P[0] + OpenTaiko.Skin.Result_UIMove_5P_X[pos]; - score_y = OpenTaiko.Skin.Result_Score_5P[1] + OpenTaiko.Skin.Result_UIMove_5P_Y[pos]; - } else if (OpenTaiko.ConfigIni.nPlayerCount == 4 || OpenTaiko.ConfigIni.nPlayerCount == 3) { - numScale = OpenTaiko.Skin.Result_Score_Scale_4P; - score_x = OpenTaiko.Skin.Result_Score_4P[0] + OpenTaiko.Skin.Result_UIMove_4P_X[pos]; - score_y = OpenTaiko.Skin.Result_Score_4P[1] + OpenTaiko.Skin.Result_UIMove_4P_Y[pos]; - } else { - score_x = OpenTaiko.Skin.Result_Score_X[pos] + uioffset_x; - score_y = OpenTaiko.Skin.Result_Score_Y[pos]; + numScale = OpenTaiko.Skin.Result_Number_Scale_5P; + } else if (OpenTaiko.ConfigIni.nPlayerCount == 3 || OpenTaiko.ConfigIni.nPlayerCount == 4) { + numScale = OpenTaiko.Skin.Result_Number_Scale_4P; + } + OpenTaiko.Tx.Result_Number.vcScaleRatio.X = ctMainCounter.CurrentValue <= AnimeCount + (Interval * k) + AddCount ? 1.3f - (float)Math.Sin((ctMainCounter.CurrentValue - (AnimeCount + (Interval * k))) / (AddCount / 90) * (Math.PI / 180)) * 0.3f : 1.0f; + OpenTaiko.Tx.Result_Number.vcScaleRatio.Y = ctMainCounter.CurrentValue <= AnimeCount + (Interval * k) + AddCount ? 1.3f - (float)Math.Sin((ctMainCounter.CurrentValue - (AnimeCount + (Interval * k))) / (AddCount / 90) * (Math.PI / 180)) * 0.3f : 1.0f; + + if ((k != 5 || OpenTaiko.Skin.Result_ADLib_Show) && (k != 6 || OpenTaiko.Skin.Result_Bomb_Show)) { + this.t小文字表示(num_x[k][pos] + uioffset_x, num_y[k][pos], scoresArr[k], numScale); } - int AnimeCount1 = AnimeCount + Interval * 4 + 840; + OpenTaiko.Tx.Result_Number.vcScaleRatio.X = 1f; + OpenTaiko.Tx.Result_Number.vcScaleRatio.Y = 1f; - OpenTaiko.Tx.Result_Score_Number.vcScaleRatio.X = ctMainCounter.CurrentValue <= AnimeCount1 + 270 ? 1.0f + (float)Math.Sin((ctMainCounter.CurrentValue - AnimeCount1) / 1.5f * (Math.PI / 180)) * 0.65f : - ctMainCounter.CurrentValue <= AnimeCount1 + 360 ? 1.0f - (float)Math.Sin((ctMainCounter.CurrentValue - AnimeCount1 - 270) * (Math.PI / 180)) * 0.1f : 1.0f; - OpenTaiko.Tx.Result_Score_Number.vcScaleRatio.Y = ctMainCounter.CurrentValue <= AnimeCount1 + 270 ? 1.0f + (float)Math.Sin((ctMainCounter.CurrentValue - AnimeCount1) / 1.5f * (Math.PI / 180)) * 0.65f : - ctMainCounter.CurrentValue <= AnimeCount1 + 360 ? 1.0f - (float)Math.Sin((ctMainCounter.CurrentValue - AnimeCount1 - 270) * (Math.PI / 180)) * 0.1f : 1.0f; - - this.tスコア文字表示(score_x, score_y, (int)OpenTaiko.stage演奏ドラム画面.actScore.Get(i), numScale);// TJAPlayer3.stage演奏ドラム画面.CChartScore[i].nScore.ToString())); - - if (!b音声再生[8]) { - OpenTaiko.Skin.soundScoreDon.tPlay(); - b音声再生[8] = true; + if (!this.b音声再生[1 + k]) { + if ((k != 5 || OpenTaiko.Skin.Result_ADLib_Show) && (k != 6 || OpenTaiko.Skin.Result_Bomb_Show)) { + OpenTaiko.Skin.soundPon.tPlay(); + } + this.b音声再生[1 + k] = true; } - } - - #endregion - } - } - - #endregion - - } - - if (ctAISectionChange.CurrentValue == ctAISectionChange.EndValue && OpenTaiko.stage演奏ドラム画面.AIBattleSections.Count > 5) { - NextAISection(); - } else if (nNowAISection > 0 && OpenTaiko.stage演奏ドラム画面.AIBattleSections.Count <= 5) { - // Fix locked sections - nNowAISection = 0; - } - - if (OpenTaiko.ConfigIni.bAIBattleMode) { - OpenTaiko.Tx.Result_AIBattle_Panel_AI.t2D描画(0, 0); - - int batch_width = OpenTaiko.Tx.Result_AIBattle_Batch.szTextureSize.Width / 3; - int batch_height = OpenTaiko.Tx.Result_AIBattle_Batch.szTextureSize.Height; - - - for (int i = 0; i < OpenTaiko.stage演奏ドラム画面.AIBattleSections.Count; i++) { - int nowIndex = (i / 5); - int drawCount = Math.Min(OpenTaiko.stage演奏ドラム画面.AIBattleSections.Count - (nowIndex * 5), 5); - - int drawPos = i % 5; - int batch_total_width = OpenTaiko.Skin.Result_AIBattle_Batch_Move[0] * drawCount; - - var section = OpenTaiko.stage演奏ドラム画面.AIBattleSections[i]; - int upDown = (drawPos % 2); - - int x = OpenTaiko.Skin.Result_AIBattle_Batch[0] + (OpenTaiko.Skin.Result_AIBattle_Batch_Move[0] * drawPos) - (batch_total_width / 2); - int y = OpenTaiko.Skin.Result_AIBattle_Batch[1] + (OpenTaiko.Skin.Result_AIBattle_Batch_Move[1] * upDown); - - int opacityCounter = Math.Min(ctAISectionChange.CurrentValue, 255); - - if (nowIndex == nNowAISection) { - OpenTaiko.Tx.Result_AIBattle_Batch.Opacity = opacityCounter; - OpenTaiko.Tx.Result_AIBattle_SectionPlate.Opacity = opacityCounter; - if (TitleTextureKey.ResolveTitleTexture(ttkAISection[i]) != null) - TitleTextureKey.ResolveTitleTexture(ttkAISection[i]).Opacity = opacityCounter; - } else { - OpenTaiko.Tx.Result_AIBattle_Batch.Opacity = 255 - opacityCounter; - OpenTaiko.Tx.Result_AIBattle_SectionPlate.Opacity = 255 - opacityCounter; - if (TitleTextureKey.ResolveTitleTexture(ttkAISection[i]) != null) - TitleTextureKey.ResolveTitleTexture(ttkAISection[i]).Opacity = 255 - opacityCounter; - } - - OpenTaiko.Tx.Result_AIBattle_Batch.t2D描画(x, y, new RectangleF(batch_width * 0, 0, batch_width, batch_height)); - - switch (section.End) { - case CStage演奏画面共通.AIBattleSection.EndType.Clear: - OpenTaiko.Tx.Result_AIBattle_Batch.t2D描画(x, y, new Rectangle(batch_width * 1, 0, batch_width, batch_height)); - break; - case CStage演奏画面共通.AIBattleSection.EndType.Lose: - OpenTaiko.Tx.Result_AIBattle_Batch.t2D描画(x, y, new Rectangle(batch_width * 2, 0, batch_width, batch_height)); + } else break; } - OpenTaiko.Tx.Result_AIBattle_Batch.Opacity = 255; - - OpenTaiko.Tx.Result_AIBattle_SectionPlate.t2D描画(x + OpenTaiko.Skin.Result_AIBattle_SectionPlate_Offset[0], y + OpenTaiko.Skin.Result_AIBattle_SectionPlate_Offset[1]); - - TitleTextureKey.ResolveTitleTexture(ttkAISection[i])?.t2D中心基準描画(x + OpenTaiko.Skin.Result_AIBattle_SectionText_Offset[0], y + OpenTaiko.Skin.Result_AIBattle_SectionText_Offset[1]); - } - - if (ctMainCounter.CurrentValue >= MountainAppearValue) { - float flagScale = 2.0f - (Math.Min(Math.Max(ctMainCounter.CurrentValue - MountainAppearValue, 0), 200) / 200.0f); - - CTexture tex = OpenTaiko.stage結果.bClear[0] ? OpenTaiko.Tx.Result_AIBattle_WinFlag_Clear : OpenTaiko.Tx.Result_AIBattle_WinFlag_Lose; - - tex.vcScaleRatio.X = flagScale; - tex.vcScaleRatio.Y = flagScale; - - tex.t2D拡大率考慮中央基準描画(OpenTaiko.Skin.Result_AIBattle_WinFlag[0], OpenTaiko.Skin.Result_AIBattle_WinFlag[1]); - } - } - - - // Should be Score + 4000, to synchronize with Stage Kekka - - // MountainAppearValue = 2000 + (ctゲージアニメ.n終了値 * 66) + 8360 - 85; - - - - #region [Character related animations] - - for (int p = 0; p < OpenTaiko.ConfigIni.nPlayerCount; p++) { - if (OpenTaiko.ConfigIni.bAIBattleMode && p == 1) break; - - int pos = p; - if (is2PSide) - pos = 1; - - if (ctMainCounter.CurrentValue >= MountainAppearValue) { - #region [Mountain animation counter setup] - - if (!this.ctMountain_ClearIn.IsTicked) - this.ctMountain_ClearIn.Start(0, 515, 3, OpenTaiko.Timer); - - if (ctUIMove.EndValue != 1000 && OpenTaiko.Skin.Result_Use1PUI && is1P) ctUIMove = new CCounter(0, 1000, 0.5, OpenTaiko.Timer); - - if (OpenTaiko.stage結果.bClear[p]) { - if (!CResultCharacter.tIsCounterProcessing(p, CResultCharacter.ECharacterResult.CLEAR)) - CResultCharacter.tMenuResetTimer(p, CResultCharacter.ECharacterResult.CLEAR); - } else { - if (!CResultCharacter.tIsCounterProcessing(p, CResultCharacter.ECharacterResult.FAILED_IN)) - CResultCharacter.tMenuResetTimer(p, CResultCharacter.ECharacterResult.FAILED_IN); - else if (CResultCharacter.tIsCounterEnded(p, CResultCharacter.ECharacterResult.FAILED_IN) - && !CResultCharacter.tIsCounterProcessing(p, CResultCharacter.ECharacterResult.FAILED)) - CResultCharacter.tMenuResetTimer(p, CResultCharacter.ECharacterResult.FAILED); - } - - #endregion - /* TO DO */ + #region [ Score display ] - // Alter Mountain appear value/Crown appear value if no Score Rank/no Crown - } - - #region [Character Animations] - - int _charaId = OpenTaiko.SaveFileInstances[OpenTaiko.GetActualPlayer(p)].data.Character; - - //int chara_x = TJAPlayer3.Skin.Characters_Result_X[_charaId][pos]; - //int chara_y = TJAPlayer3.Skin.Characters_Result_Y[_charaId][pos]; - - int chara_x = namePlate_x[pos] - (OpenTaiko.Skin.Characters_UseResult1P[_charaId] ? uioffset_x : 0) + OpenTaiko.Tx.NamePlateBase.szTextureSize.Width / 2; - int chara_y = namePlate_y[pos]; - - int p1chara_x = is2PSide ? OpenTaiko.Skin.Resolution[0] / 2 : 0; - int p1chara_y = OpenTaiko.Skin.Resolution[1] - (int)(uioffset_value * OpenTaiko.Skin.Resolution[1]); - float renderRatioX = OpenTaiko.Skin.Resolution[0] / (float)OpenTaiko.Skin.Characters_Resolution[_charaId][0]; - float renderRatioY = OpenTaiko.Skin.Resolution[1] / (float)OpenTaiko.Skin.Characters_Resolution[_charaId][1]; - - if (CResultCharacter.tIsCounterProcessing(p, CResultCharacter.ECharacterResult.CLEAR)) { - CResultCharacter.tMenuDisplayCharacter(p, chara_x, chara_y, CResultCharacter.ECharacterResult.CLEAR, pos); - - var tex = pos == 0 ? OpenTaiko.Tx.Characters_Result_Clear_1P[_charaId] : OpenTaiko.Tx.Characters_Result_Clear_2P[_charaId]; - if (OpenTaiko.Skin.Characters_UseResult1P[_charaId] && OpenTaiko.Skin.Result_Use1PUI && tex != null) { - tex.vcScaleRatio.X = renderRatioX; - tex.vcScaleRatio.Y = renderRatioY; - if (is2PSide) { - tex.t2D左右反転描画(p1chara_x, p1chara_y); - } else { - tex.t2D描画(p1chara_x, p1chara_y); - } - } - } else if (CResultCharacter.tIsCounterProcessing(p, CResultCharacter.ECharacterResult.FAILED)) { - CResultCharacter.tMenuDisplayCharacter(p, chara_x, chara_y, CResultCharacter.ECharacterResult.FAILED, pos); - if (OpenTaiko.Skin.Characters_UseResult1P[_charaId] && OpenTaiko.Skin.Result_Use1PUI && OpenTaiko.Tx.Characters_Result_Failed_1P[_charaId] != null) { - OpenTaiko.Tx.Characters_Result_Failed_1P[_charaId].vcScaleRatio.X = renderRatioX; - OpenTaiko.Tx.Characters_Result_Failed_1P[_charaId].vcScaleRatio.Y = renderRatioY; - if (is2PSide) { - OpenTaiko.Tx.Characters_Result_Failed_1P[_charaId].t2D左右反転描画(p1chara_x, p1chara_y); - } else { - OpenTaiko.Tx.Characters_Result_Failed_1P[_charaId].t2D描画(p1chara_x, p1chara_y); - } - } - } else if (CResultCharacter.tIsCounterProcessing(p, CResultCharacter.ECharacterResult.FAILED_IN) && OpenTaiko.Tx.Characters_Result_Failed_1P[_charaId] != null) { - CResultCharacter.tMenuDisplayCharacter(p, chara_x, chara_y, CResultCharacter.ECharacterResult.FAILED_IN, pos); - if (OpenTaiko.Skin.Characters_UseResult1P[_charaId] && OpenTaiko.Skin.Result_Use1PUI) { - OpenTaiko.Tx.Characters_Result_Failed_1P[_charaId].vcScaleRatio.X = renderRatioX; - OpenTaiko.Tx.Characters_Result_Failed_1P[_charaId].vcScaleRatio.Y = renderRatioY; - if (is2PSide) { - OpenTaiko.Tx.Characters_Result_Failed_1P[_charaId].t2D左右反転描画(p1chara_x, p1chara_y); - } else { - OpenTaiko.Tx.Characters_Result_Failed_1P[_charaId].t2D描画(p1chara_x, p1chara_y); - } - } - } else - CResultCharacter.tMenuDisplayCharacter(p, chara_x, chara_y, CResultCharacter.ECharacterResult.NORMAL, pos); - - #endregion - - - #region [PuchiChara] - - int puchi_x = chara_x + OpenTaiko.Skin.Adjustments_MenuPuchichara_X[OpenTaiko.ConfigIni.nPlayerCount <= 2 ? pos : 0]; - int puchi_y = chara_y + OpenTaiko.Skin.Adjustments_MenuPuchichara_Y[OpenTaiko.ConfigIni.nPlayerCount <= 2 ? pos : 0]; - - //int ttdiff = 640 - 152; - //int ttps = 640 + ((pos == 1) ? ttdiff + 60 : -ttdiff); - - //this.PuchiChara.On進行描画(ttps, 562, false, 255, false, p); - - this.PuchiChara.On進行描画(puchi_x, puchi_y, false, 255, false, p); - - #endregion - - if (ctMainCounter.CurrentValue >= MountainAppearValue) { - float AddCount = 135; - - int baseX = (pos == 1) ? 1280 - 182 : 182; - int baseY = 602; - - #region [Cherry blossom animation] - - if (gaugeValues[p] >= 80.0f && OpenTaiko.ConfigIni.nPlayerCount <= 2) { - OpenTaiko.Tx.Result_Flower.vcScaleRatio.X = 0.6f * (ctMainCounter.CurrentValue <= MountainAppearValue + AddCount ? 1.3f - (float)Math.Sin((ctMainCounter.CurrentValue - MountainAppearValue) / (AddCount / 90) * (Math.PI / 180)) * 0.3f : 1.0f); - OpenTaiko.Tx.Result_Flower.vcScaleRatio.Y = 0.6f * (ctMainCounter.CurrentValue <= MountainAppearValue + AddCount ? 1.3f - (float)Math.Sin((ctMainCounter.CurrentValue - MountainAppearValue) / (AddCount / 90) * (Math.PI / 180)) * 0.3f : 1.0f); - - int flower_width = OpenTaiko.Tx.Result_Flower.szTextureSize.Width; - int flower_height = OpenTaiko.Tx.Result_Flower.szTextureSize.Height / 2; - - OpenTaiko.Tx.Result_Flower.t2D拡大率考慮中央基準描画(OpenTaiko.Skin.Result_Flower_X[pos], OpenTaiko.Skin.Result_Flower_Y[pos], - new Rectangle(0, 0, flower_width, flower_height)); - } - - #endregion - - #region [Cherry blossom Rotating flowers] - - if (gaugeValues[p] >= 80.0f && OpenTaiko.ConfigIni.nPlayerCount <= 2) { - float FlowerTime = ctRotate_Flowers.CurrentValue; - - for (int i = 0; i < 5; i++) { - - if ((int)FlowerTime < ApparitionTimeStamps[i] || (int)FlowerTime > ApparitionTimeStamps[i] + 2 * ApparitionFade + ApparitionDuration) - OpenTaiko.Tx.Result_Flower_Rotate[i].Opacity = 0; - else if ((int)FlowerTime <= ApparitionTimeStamps[i] + ApparitionDuration + ApparitionFade && (int)FlowerTime >= ApparitionTimeStamps[i] + ApparitionFade) - OpenTaiko.Tx.Result_Flower_Rotate[i].Opacity = 255; - else { - int CurrentGradiant = 0; - if ((int)FlowerTime >= ApparitionTimeStamps[i] + ApparitionFade + ApparitionDuration) - CurrentGradiant = ApparitionFade - ((int)FlowerTime - ApparitionTimeStamps[i] - ApparitionDuration - ApparitionFade); - else - CurrentGradiant = (int)FlowerTime - ApparitionTimeStamps[i]; - - - OpenTaiko.Tx.Result_Flower_Rotate[i].Opacity = (255 * CurrentGradiant) / ApparitionFade; - } - - OpenTaiko.Tx.Result_Flower_Rotate[i].vcScaleRatio.X = 0.6f; - OpenTaiko.Tx.Result_Flower_Rotate[i].vcScaleRatio.Y = 0.6f; - OpenTaiko.Tx.Result_Flower_Rotate[i].fZ軸中心回転 = (float)(FlowerTime - ApparitionTimeStamps[i]) / (FlowerRotationSpeeds[i] * 360f); - - OpenTaiko.Tx.Result_Flower_Rotate[i].t2D中心基準描画(OpenTaiko.Skin.Result_Flower_Rotate_X[pos][i], OpenTaiko.Skin.Result_Flower_Rotate_Y[pos][i]); - } - - } - - #endregion - - #region [Panel shines] - - if (gaugeValues[p] >= 80.0f && OpenTaiko.ConfigIni.nPlayerCount <= 2) { - int ShineTime = (int)ctShine_Plate.CurrentValue; - int Quadrant500 = ShineTime % 500; - - for (int i = 0; i < OpenTaiko.Skin.Result_PlateShine_Count; i++) { - if (i < 3 && ShineTime >= 500 || i >= 3 && ShineTime < 500) - OpenTaiko.Tx.Result_Shine.Opacity = 0; - else if (Quadrant500 >= ShinePFade && Quadrant500 <= 500 - ShinePFade) - OpenTaiko.Tx.Result_Shine.Opacity = 255; - else - OpenTaiko.Tx.Result_Shine.Opacity = (255 * Math.Min(Quadrant500, 500 - Quadrant500)) / ShinePFade; - - OpenTaiko.Tx.Result_Shine.vcScaleRatio.X = 0.15f; - OpenTaiko.Tx.Result_Shine.vcScaleRatio.Y = 0.15f; - - OpenTaiko.Tx.Result_Shine.t2D中心基準描画(OpenTaiko.Skin.Result_PlateShine_X[pos][i], OpenTaiko.Skin.Result_PlateShine_Y[pos][i]); - } - - } - - - #endregion - - #region [Speech bubble animation] - // Speech Bubble - - int Mood = 0; - int MoodV2 = 0; - - if (gaugeValues[p] >= 100.0f) - Mood = 3; - else if (gaugeValues[p] >= 80.0f) - Mood = 2; - else if (gaugeValues[p] >= 40.0f) - Mood = 1; - - if (OpenTaiko.stage結果.nクリア[p] == 4) { - MoodV2 = 5; - } else if (OpenTaiko.stage結果.nクリア[p] == 3) { - MoodV2 = 4; - } else if (OpenTaiko.stage結果.nクリア[p] >= 1) { - if (gaugeValues[p] >= 100.0f) { - MoodV2 = 3; - } else { - MoodV2 = 2; - } - } else if (OpenTaiko.stage結果.nクリア[p] == 0) { - if (gaugeValues[p] >= 40.0f) { - MoodV2 = 1; - } else { - MoodV2 = 0; - } - } - - if (OpenTaiko.ConfigIni.nPlayerCount <= 2) { - int speechBuddle_width = OpenTaiko.Tx.Result_Speech_Bubble[pos].szTextureSize.Width / 4; - int speechBuddle_height = OpenTaiko.Tx.Result_Speech_Bubble[pos].szTextureSize.Height / 3; - - OpenTaiko.Tx.Result_Speech_Bubble[pos].vcScaleRatio.X = 0.9f * (ctMainCounter.CurrentValue <= MountainAppearValue + AddCount ? 1.3f - (float)Math.Sin((ctMainCounter.CurrentValue - MountainAppearValue) / (AddCount / 90) * (Math.PI / 180)) * 0.3f : 1.0f); - OpenTaiko.Tx.Result_Speech_Bubble[pos].vcScaleRatio.Y = 0.9f * (ctMainCounter.CurrentValue <= MountainAppearValue + AddCount ? 1.3f - (float)Math.Sin((ctMainCounter.CurrentValue - MountainAppearValue) / (AddCount / 90) * (Math.PI / 180)) * 0.3f : 1.0f); - OpenTaiko.Tx.Result_Speech_Bubble[pos].t2D拡大率考慮中央基準描画(OpenTaiko.Skin.Result_Speech_Bubble_X[pos], OpenTaiko.Skin.Result_Speech_Bubble_Y[pos], - new Rectangle(Mood * speechBuddle_width, RandomText * speechBuddle_height, speechBuddle_width, speechBuddle_height)); - } - int speech_vubble_index = OpenTaiko.ConfigIni.nPlayerCount <= 2 ? pos : 2; - if (OpenTaiko.Tx.Result_Speech_Bubble_V2[speech_vubble_index] != null) { - int speechBuddle_width = OpenTaiko.Tx.Result_Speech_Bubble_V2[speech_vubble_index].szTextureSize.Width; - int speechBuddle_height = OpenTaiko.Tx.Result_Speech_Bubble_V2[speech_vubble_index].szTextureSize.Height / 6; - - int speech_bubble_x; - int speech_bubble_y; - float scale; + if (ctMainCounter.CurrentValue >= AnimeCount + Interval * 4 + 840) { + float numScale = 1.0f; + int score_x; + int score_y; if (OpenTaiko.ConfigIni.nPlayerCount == 5) { - speech_bubble_x = OpenTaiko.Skin.Result_Speech_Bubble_V2_5P[0] + OpenTaiko.Skin.Result_UIMove_5P_X[pos]; - speech_bubble_y = OpenTaiko.Skin.Result_Speech_Bubble_V2_5P[1] + OpenTaiko.Skin.Result_UIMove_5P_Y[pos]; - scale = 0.5f; + numScale = OpenTaiko.Skin.Result_Score_Scale_5P; + score_x = OpenTaiko.Skin.Result_Score_5P[0] + OpenTaiko.Skin.Result_UIMove_5P_X[pos]; + score_y = OpenTaiko.Skin.Result_Score_5P[1] + OpenTaiko.Skin.Result_UIMove_5P_Y[pos]; } else if (OpenTaiko.ConfigIni.nPlayerCount == 4 || OpenTaiko.ConfigIni.nPlayerCount == 3) { - speech_bubble_x = OpenTaiko.Skin.Result_Speech_Bubble_V2_4P[0] + OpenTaiko.Skin.Result_UIMove_4P_X[pos]; - speech_bubble_y = OpenTaiko.Skin.Result_Speech_Bubble_V2_4P[1] + OpenTaiko.Skin.Result_UIMove_4P_Y[pos]; - scale = 0.5f; - } else if (OpenTaiko.ConfigIni.nPlayerCount == 2) { - speech_bubble_x = OpenTaiko.Skin.Result_Speech_Bubble_V2_2P_X[pos]; - speech_bubble_y = OpenTaiko.Skin.Result_Speech_Bubble_V2_2P_Y[pos]; - scale = 0.5f; + numScale = OpenTaiko.Skin.Result_Score_Scale_4P; + score_x = OpenTaiko.Skin.Result_Score_4P[0] + OpenTaiko.Skin.Result_UIMove_4P_X[pos]; + score_y = OpenTaiko.Skin.Result_Score_4P[1] + OpenTaiko.Skin.Result_UIMove_4P_Y[pos]; } else { - speech_bubble_x = OpenTaiko.Skin.Result_Speech_Bubble_V2_X[pos]; - speech_bubble_y = OpenTaiko.Skin.Result_Speech_Bubble_V2_Y[pos]; - scale = 1.0f; + score_x = OpenTaiko.Skin.Result_Score_X[pos] + uioffset_x; + score_y = OpenTaiko.Skin.Result_Score_Y[pos]; } - OpenTaiko.Tx.Result_Speech_Bubble_V2[speech_vubble_index].vcScaleRatio.X = 0.9f * scale * (ctMainCounter.CurrentValue <= MountainAppearValue + AddCount ? 1.3f - (float)Math.Sin((ctMainCounter.CurrentValue - MountainAppearValue) / (AddCount / 90) * (Math.PI / 180)) * 0.3f : 1.0f); - OpenTaiko.Tx.Result_Speech_Bubble_V2[speech_vubble_index].vcScaleRatio.Y = 0.9f * scale * (ctMainCounter.CurrentValue <= MountainAppearValue + AddCount ? 1.3f - (float)Math.Sin((ctMainCounter.CurrentValue - MountainAppearValue) / (AddCount / 90) * (Math.PI / 180)) * 0.3f : 1.0f); - OpenTaiko.Tx.Result_Speech_Bubble_V2[speech_vubble_index].t2D拡大率考慮中央基準描画(speech_bubble_x, speech_bubble_y, - new Rectangle(0, MoodV2 * speechBuddle_height, speechBuddle_width, speechBuddle_height)); + int AnimeCount1 = AnimeCount + Interval * 4 + 840; - TitleTextureKey.ResolveTitleTexture(ttkSpeechText[p][MoodV2]).vcScaleRatio.X = scale; - TitleTextureKey.ResolveTitleTexture(ttkSpeechText[p][MoodV2]).vcScaleRatio.Y = scale; - TitleTextureKey.ResolveTitleTexture(ttkSpeechText[p][MoodV2]).t2D拡大率考慮中央基準描画( - speech_bubble_x + (int)(OpenTaiko.Skin.Result_Speech_Text_Offset[0] * scale), - speech_bubble_y + (int)(OpenTaiko.Skin.Result_Speech_Text_Offset[1] * scale)); - } - if (!b音声再生[11]) { - if (gaugeValues[p] >= 80.0f) { - //TJAPlayer3.Skin.soundDonClear.t再生する(); - OpenTaiko.Skin.voiceResultClearSuccess[OpenTaiko.GetActualPlayer(p)]?.tPlay(); - } else { - //TJAPlayer3.Skin.soundDonFailed.t再生する(); - OpenTaiko.Skin.voiceResultClearFailed[OpenTaiko.GetActualPlayer(p)]?.tPlay(); + OpenTaiko.Tx.Result_Score_Number.vcScaleRatio.X = ctMainCounter.CurrentValue <= AnimeCount1 + 270 ? 1.0f + (float)Math.Sin((ctMainCounter.CurrentValue - AnimeCount1) / 1.5f * (Math.PI / 180)) * 0.65f : + ctMainCounter.CurrentValue <= AnimeCount1 + 360 ? 1.0f - (float)Math.Sin((ctMainCounter.CurrentValue - AnimeCount1 - 270) * (Math.PI / 180)) * 0.1f : 1.0f; + OpenTaiko.Tx.Result_Score_Number.vcScaleRatio.Y = ctMainCounter.CurrentValue <= AnimeCount1 + 270 ? 1.0f + (float)Math.Sin((ctMainCounter.CurrentValue - AnimeCount1) / 1.5f * (Math.PI / 180)) * 0.65f : + ctMainCounter.CurrentValue <= AnimeCount1 + 360 ? 1.0f - (float)Math.Sin((ctMainCounter.CurrentValue - AnimeCount1 - 270) * (Math.PI / 180)) * 0.1f : 1.0f; + + this.tスコア文字表示(score_x, score_y, (int)OpenTaiko.stage演奏ドラム画面.actScore.Get(i), numScale);// TJAPlayer3.stage演奏ドラム画面.CChartScore[i].nScore.ToString())); + + if (!b音声再生[8]) { + OpenTaiko.Skin.soundScoreDon.tPlay(); + b音声再生[8] = true; } - - if (p == OpenTaiko.ConfigIni.nPlayerCount - 1) - b音声再生[11] = true; } #endregion } - - - - - - - if (ctMainCounter.CurrentValue >= ScoreApparitionTimeStamp + 1000) { - //if (TJAPlayer3.ConfigIni.nPlayerCount <= 2) - { - #region [Score rank apparition] - - int scoreRank_width = OpenTaiko.Tx.Result_ScoreRankEffect.szTextureSize.Width / 7; - int scoreRank_height = OpenTaiko.Tx.Result_ScoreRankEffect.szTextureSize.Height / 4; - - if (ctMainCounter.CurrentValue <= ScoreApparitionTimeStamp + 1180) { - OpenTaiko.Tx.Result_ScoreRankEffect.Opacity = (int)((ctMainCounter.CurrentValue - (ScoreApparitionTimeStamp + 1000)) / 180.0f * 255.0f); - OpenTaiko.Tx.Result_ScoreRankEffect.vcScaleRatio.X = 1.0f + (float)Math.Sin((float)(ctMainCounter.CurrentValue - (ScoreApparitionTimeStamp + 910)) / 1.5f * (Math.PI / 180)) * 1.4f; - OpenTaiko.Tx.Result_ScoreRankEffect.vcScaleRatio.Y = 1.0f + (float)Math.Sin((float)(ctMainCounter.CurrentValue - (ScoreApparitionTimeStamp + 910)) / 1.5f * (Math.PI / 180)) * 1.4f; - } else if (ctMainCounter.CurrentValue <= ScoreApparitionTimeStamp + 1270) { - OpenTaiko.Tx.Result_ScoreRankEffect.vcScaleRatio.X = 0.5f + (float)Math.Sin((float)(ctMainCounter.CurrentValue - (ScoreApparitionTimeStamp + 1180)) * (Math.PI / 180)) * 0.5f; - OpenTaiko.Tx.Result_ScoreRankEffect.vcScaleRatio.Y = 0.5f + (float)Math.Sin((float)(ctMainCounter.CurrentValue - (ScoreApparitionTimeStamp + 1180)) * (Math.PI / 180)) * 0.5f; - } else { - OpenTaiko.Tx.Result_ScoreRankEffect.Opacity = 255; - OpenTaiko.Tx.Result_ScoreRankEffect.vcScaleRatio.X = 1f; - OpenTaiko.Tx.Result_ScoreRankEffect.vcScaleRatio.Y = 1f; - } - - if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] != (int)Difficulty.Dan && OpenTaiko.stage結果.nスコアランク[p] > 0) { - int CurrentFlash = 0; - int[] FlashTimes = { 1500, 1540, 1580, 1620, 1660, 1700, 1740, 1780 }; - - if (ctFlash_Icon.CurrentValue >= FlashTimes[0] && ctFlash_Icon.CurrentValue <= FlashTimes[1] || ctFlash_Icon.CurrentValue >= FlashTimes[4] && ctFlash_Icon.CurrentValue <= FlashTimes[5]) - CurrentFlash = 1; - else if (ctFlash_Icon.CurrentValue >= FlashTimes[1] && ctFlash_Icon.CurrentValue <= FlashTimes[2] || ctFlash_Icon.CurrentValue >= FlashTimes[5] && ctFlash_Icon.CurrentValue <= FlashTimes[6]) - CurrentFlash = 2; - else if (ctFlash_Icon.CurrentValue >= FlashTimes[2] && ctFlash_Icon.CurrentValue <= FlashTimes[3] || ctFlash_Icon.CurrentValue >= FlashTimes[6] && ctFlash_Icon.CurrentValue <= FlashTimes[7]) - CurrentFlash = 3; - - - int scoreRankEffect_x; - int scoreRankEffect_y; - if (OpenTaiko.ConfigIni.nPlayerCount == 5) { - scoreRankEffect_x = OpenTaiko.Skin.Result_ScoreRankEffect_5P[0] + OpenTaiko.Skin.Result_UIMove_5P_X[pos]; - scoreRankEffect_y = OpenTaiko.Skin.Result_ScoreRankEffect_5P[1] + OpenTaiko.Skin.Result_UIMove_5P_Y[pos]; - } else if (OpenTaiko.ConfigIni.nPlayerCount == 4 || OpenTaiko.ConfigIni.nPlayerCount == 3) { - scoreRankEffect_x = OpenTaiko.Skin.Result_ScoreRankEffect_4P[0] + OpenTaiko.Skin.Result_UIMove_4P_X[pos]; - scoreRankEffect_y = OpenTaiko.Skin.Result_ScoreRankEffect_4P[1] + OpenTaiko.Skin.Result_UIMove_4P_Y[pos]; - } else { - scoreRankEffect_x = OpenTaiko.Skin.Result_ScoreRankEffect_X[pos] + uioffset_x; - scoreRankEffect_y = OpenTaiko.Skin.Result_ScoreRankEffect_Y[pos]; - } - - OpenTaiko.Tx.Result_ScoreRankEffect.t2D拡大率考慮中央基準描画(scoreRankEffect_x, scoreRankEffect_y, - new Rectangle((OpenTaiko.stage結果.nスコアランク[p] - 1) * scoreRank_width, CurrentFlash * scoreRank_height, scoreRank_width, scoreRank_height)); - - if (!b音声再生[9] && ctMainCounter.CurrentValue >= ScoreApparitionTimeStamp + 1180) { - OpenTaiko.Skin.soundRankIn.tPlay(); - b音声再生[9] = true; - } - } - - #endregion - } - } - - - if (ctMainCounter.CurrentValue >= ScoreApparitionTimeStamp + 2500) { - //if (TJAPlayer3.ConfigIni.nPlayerCount <= 2) - { - #region [Crown apparition] - - int crownEffect_width = OpenTaiko.Tx.Result_CrownEffect.szTextureSize.Width / 4; - int crownEffect_height = OpenTaiko.Tx.Result_CrownEffect.szTextureSize.Height / 4; - - if (ctMainCounter.CurrentValue <= ScoreApparitionTimeStamp + 2680) { - OpenTaiko.Tx.Result_CrownEffect.Opacity = (int)((ctMainCounter.CurrentValue - (ScoreApparitionTimeStamp + 2500)) / 180.0f * 255.0f); - OpenTaiko.Tx.Result_CrownEffect.vcScaleRatio.X = 1.0f + (float)Math.Sin((float)(ctMainCounter.CurrentValue - (ScoreApparitionTimeStamp + 2410)) / 1.5f * (Math.PI / 180)) * 1.4f; - OpenTaiko.Tx.Result_CrownEffect.vcScaleRatio.Y = 1.0f + (float)Math.Sin((float)(ctMainCounter.CurrentValue - (ScoreApparitionTimeStamp + 2410)) / 1.5f * (Math.PI / 180)) * 1.4f; - } else if (ctMainCounter.CurrentValue <= ScoreApparitionTimeStamp + 2770) { - OpenTaiko.Tx.Result_CrownEffect.vcScaleRatio.X = 0.5f + (float)Math.Sin((float)(ctMainCounter.CurrentValue - (ScoreApparitionTimeStamp + 2680)) * (Math.PI / 180)) * 0.5f; - OpenTaiko.Tx.Result_CrownEffect.vcScaleRatio.Y = 0.5f + (float)Math.Sin((float)(ctMainCounter.CurrentValue - (ScoreApparitionTimeStamp + 2680)) * (Math.PI / 180)) * 0.5f; - } else { - OpenTaiko.Tx.Result_CrownEffect.Opacity = 255; - OpenTaiko.Tx.Result_CrownEffect.vcScaleRatio.X = 1f; - OpenTaiko.Tx.Result_CrownEffect.vcScaleRatio.Y = 1f; - } - - int ClearType = OpenTaiko.stage結果.nクリア[p] - 1; - - if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] != (int)(Difficulty.Dan) && ClearType >= 0) { - int CurrentFlash = 0; - int[] FlashTimes = { 2000, 2040, 2080, 2120, 2160, 2200, 2240, 2280 }; - - if (ctFlash_Icon.CurrentValue >= FlashTimes[0] && ctFlash_Icon.CurrentValue <= FlashTimes[1] || ctFlash_Icon.CurrentValue >= FlashTimes[4] && ctFlash_Icon.CurrentValue <= FlashTimes[5]) - CurrentFlash = 1; - else if (ctFlash_Icon.CurrentValue >= FlashTimes[1] && ctFlash_Icon.CurrentValue <= FlashTimes[2] || ctFlash_Icon.CurrentValue >= FlashTimes[5] && ctFlash_Icon.CurrentValue <= FlashTimes[6]) - CurrentFlash = 2; - else if (ctFlash_Icon.CurrentValue >= FlashTimes[2] && ctFlash_Icon.CurrentValue <= FlashTimes[3] || ctFlash_Icon.CurrentValue >= FlashTimes[6] && ctFlash_Icon.CurrentValue <= FlashTimes[7]) - CurrentFlash = 3; - - - int crownEffect_x; - int crownEffect_y; - if (OpenTaiko.ConfigIni.nPlayerCount == 5) { - crownEffect_x = OpenTaiko.Skin.Result_CrownEffect_5P[0] + OpenTaiko.Skin.Result_UIMove_5P_X[pos]; - crownEffect_y = OpenTaiko.Skin.Result_CrownEffect_5P[1] + OpenTaiko.Skin.Result_UIMove_5P_Y[pos]; - } else if (OpenTaiko.ConfigIni.nPlayerCount == 4 || OpenTaiko.ConfigIni.nPlayerCount == 3) { - crownEffect_x = OpenTaiko.Skin.Result_CrownEffect_4P[0] + OpenTaiko.Skin.Result_UIMove_4P_X[pos]; - crownEffect_y = OpenTaiko.Skin.Result_CrownEffect_4P[1] + OpenTaiko.Skin.Result_UIMove_4P_Y[pos]; - } else { - crownEffect_x = OpenTaiko.Skin.Result_CrownEffect_X[pos] + uioffset_x; - crownEffect_y = OpenTaiko.Skin.Result_CrownEffect_Y[pos]; - } - - OpenTaiko.Tx.Result_CrownEffect.t2D拡大率考慮中央基準描画(crownEffect_x, crownEffect_y, - new Rectangle(ClearType * crownEffect_width, CurrentFlash * crownEffect_height, crownEffect_width, crownEffect_height)); - - if (!b音声再生[10] && ctMainCounter.CurrentValue >= ScoreApparitionTimeStamp + 2680) { - OpenTaiko.Skin.soundCrownIn.tPlay(); - b音声再生[10] = true; - } - } - - #endregion - } - } } #endregion - - - #endregion } - if (!this.ct表示用.IsEnded) { - return 0; - } - return 1; - } - - - - // その他 - - #region [ private ] - //----------------- - [StructLayout(LayoutKind.Sequential)] - private struct ST文字位置 { - public char ch; - public Point pt; - } - - public CCounter ctMainCounter; - public CCounter[] ctゲージアニメ; - private CCounter ct虹ゲージアニメ; - private CCounter ctSoul; - - public CCounter ctEndAnime; - public CCounter ctMountain_ClearIn; - public CCounter ctBackgroundAnime; - public CCounter ctBackgroundAnime_Clear; - - private int RandomText; - - private CCounter ctFlash_Icon; - private CCounter ctRotate_Flowers; - private CCounter ctShine_Plate; - - public PuchiChara PuchiChara; - - public float MountainAppearValue; - private int GaugeFactor; - - public bool[] b音声再生 = { false, false, false, false, false, false, false, false, false, false, false, false, false, false, false }; - - // Cherry blossom flowers variables - /* - public int[] FlowerXPos = { -114, -37, 114, 78, -75 }; - public int[] FlowerYPos = { -33, 3, -36, -81, -73 }; - */ - public float[] FlowerRotationSpeeds = { 5f, 3f, -6f, 4f, -2f }; - public int[] ApparitionTimeStamps = { 10, 30, 50, 100, 190 }; - public int ApparitionFade = 100; - public int ApparitionDuration = 300; - - // Plate shine variables - public int[] ShinePXPos = { 114 - 25, 114 - 16, -37 - 23, -37 - 9, -75 + 20, 78 - 13 }; - public int[] ShinePYPos = { -36 + 52, -36 + 2, 3 - 7, 3 + 30, -73 - 23, -81 - 31 }; - public int ShinePFade = 100; - - public int[] gaugeValues; - - private CCounter ct表示用; - private readonly Point[] ptFullCombo位置; - private CSound sdDTXで指定されたフルコンボ音; - private readonly ST文字位置[] st小文字位置; - private readonly ST文字位置[] st大文字位置; - private ST文字位置[] stScoreFont; - - private TitleTextureKey[] ttkAISection; - - private TitleTextureKey[][] ttkSpeechText = new TitleTextureKey[5][]; - - private CCachedFontRenderer pfSpeechText; - private CCachedFontRenderer pfAISectionText; - - private CCounter ctAISectionChange; - - private CCounter ctUIMove; - - private int nNowAISection; - - private void NextAISection() { - ctAISectionChange = new CCounter(0, 2000, 1, OpenTaiko.Timer); - ctAISectionChange.CurrentValue = 0; - - nNowAISection++; - if (nNowAISection >= Math.Ceiling(OpenTaiko.stage演奏ドラム画面.AIBattleSections.Count / 5.0)) { + if (ctAISectionChange.CurrentValue == ctAISectionChange.EndValue && OpenTaiko.stage演奏ドラム画面.AIBattleSections.Count > 5) { + NextAISection(); + } else if (nNowAISection > 0 && OpenTaiko.stage演奏ドラム画面.AIBattleSections.Count <= 5) { + // Fix locked sections nNowAISection = 0; - } - } - public void t小文字表示(int x, int y, int num, float scale) { - OpenTaiko.Tx.Result_Number.vcScaleRatio.X *= scale; - OpenTaiko.Tx.Result_Number.vcScaleRatio.Y *= scale; - int[] nums = CConversion.SeparateDigits(num); - for (int j = 0; j < nums.Length; j++) { - float offset = j; + if (OpenTaiko.ConfigIni.bAIBattleMode) { + OpenTaiko.Tx.Result_AIBattle_Panel_AI.t2D描画(0, 0); - float width = (OpenTaiko.Tx.Result_Number.sz画像サイズ.Width / 11.0f); - float height = (OpenTaiko.Tx.Result_Number.sz画像サイズ.Height / 2.0f); + int batch_width = OpenTaiko.Tx.Result_AIBattle_Batch.szTextureSize.Width / 3; + int batch_height = OpenTaiko.Tx.Result_AIBattle_Batch.szTextureSize.Height; - float _x = x - ((OpenTaiko.Skin.Result_Number_Interval[0] * scale) * offset) + (width * 2); - float _y = y - ((OpenTaiko.Skin.Result_Number_Interval[1] * scale) * offset); - OpenTaiko.Tx.Result_Number.t2D拡大率考慮中央基準描画(_x + (width * scale / 2), _y + (height * scale / 2), - new RectangleF(width * nums[j], 0, width, height)); + for (int i = 0; i < OpenTaiko.stage演奏ドラム画面.AIBattleSections.Count; i++) { + int nowIndex = (i / 5); + int drawCount = Math.Min(OpenTaiko.stage演奏ドラム画面.AIBattleSections.Count - (nowIndex * 5), 5); + + int drawPos = i % 5; + int batch_total_width = OpenTaiko.Skin.Result_AIBattle_Batch_Move[0] * drawCount; + + var section = OpenTaiko.stage演奏ドラム画面.AIBattleSections[i]; + int upDown = (drawPos % 2); + + int x = OpenTaiko.Skin.Result_AIBattle_Batch[0] + (OpenTaiko.Skin.Result_AIBattle_Batch_Move[0] * drawPos) - (batch_total_width / 2); + int y = OpenTaiko.Skin.Result_AIBattle_Batch[1] + (OpenTaiko.Skin.Result_AIBattle_Batch_Move[1] * upDown); + + int opacityCounter = Math.Min(ctAISectionChange.CurrentValue, 255); + + if (nowIndex == nNowAISection) { + OpenTaiko.Tx.Result_AIBattle_Batch.Opacity = opacityCounter; + OpenTaiko.Tx.Result_AIBattle_SectionPlate.Opacity = opacityCounter; + if (TitleTextureKey.ResolveTitleTexture(ttkAISection[i]) != null) + TitleTextureKey.ResolveTitleTexture(ttkAISection[i]).Opacity = opacityCounter; + } else { + OpenTaiko.Tx.Result_AIBattle_Batch.Opacity = 255 - opacityCounter; + OpenTaiko.Tx.Result_AIBattle_SectionPlate.Opacity = 255 - opacityCounter; + if (TitleTextureKey.ResolveTitleTexture(ttkAISection[i]) != null) + TitleTextureKey.ResolveTitleTexture(ttkAISection[i]).Opacity = 255 - opacityCounter; + } + + OpenTaiko.Tx.Result_AIBattle_Batch.t2D描画(x, y, new RectangleF(batch_width * 0, 0, batch_width, batch_height)); + + switch (section.End) { + case CStage演奏画面共通.AIBattleSection.EndType.Clear: + OpenTaiko.Tx.Result_AIBattle_Batch.t2D描画(x, y, new Rectangle(batch_width * 1, 0, batch_width, batch_height)); + break; + case CStage演奏画面共通.AIBattleSection.EndType.Lose: + OpenTaiko.Tx.Result_AIBattle_Batch.t2D描画(x, y, new Rectangle(batch_width * 2, 0, batch_width, batch_height)); + break; + } + + OpenTaiko.Tx.Result_AIBattle_Batch.Opacity = 255; + + OpenTaiko.Tx.Result_AIBattle_SectionPlate.t2D描画(x + OpenTaiko.Skin.Result_AIBattle_SectionPlate_Offset[0], y + OpenTaiko.Skin.Result_AIBattle_SectionPlate_Offset[1]); + + TitleTextureKey.ResolveTitleTexture(ttkAISection[i])?.t2D中心基準描画(x + OpenTaiko.Skin.Result_AIBattle_SectionText_Offset[0], y + OpenTaiko.Skin.Result_AIBattle_SectionText_Offset[1]); + } + + if (ctMainCounter.CurrentValue >= MountainAppearValue) { + float flagScale = 2.0f - (Math.Min(Math.Max(ctMainCounter.CurrentValue - MountainAppearValue, 0), 200) / 200.0f); + + CTexture tex = OpenTaiko.stage結果.bClear[0] ? OpenTaiko.Tx.Result_AIBattle_WinFlag_Clear : OpenTaiko.Tx.Result_AIBattle_WinFlag_Lose; + + tex.vcScaleRatio.X = flagScale; + tex.vcScaleRatio.Y = flagScale; + + tex.t2D拡大率考慮中央基準描画(OpenTaiko.Skin.Result_AIBattle_WinFlag[0], OpenTaiko.Skin.Result_AIBattle_WinFlag[1]); + } } - } - private void t大文字表示(int x, int y, string str) { - this.t大文字表示(x, y, str, false); - } - private void t大文字表示(int x, int y, string str, bool b強調) { - foreach (char ch in str) { - for (int i = 0; i < this.st大文字位置.Length; i++) { - if (this.st大文字位置[i].ch == ch) { - Rectangle rectangle = new Rectangle(this.st大文字位置[i].pt.X, this.st大文字位置[i].pt.Y, 11, 0x10); - if (ch == '.') { - rectangle.Width -= 2; - rectangle.Height -= 2; + + + // Should be Score + 4000, to synchronize with Stage Kekka + + // MountainAppearValue = 2000 + (ctゲージアニメ.n終了値 * 66) + 8360 - 85; + + + + #region [Character related animations] + + for (int p = 0; p < OpenTaiko.ConfigIni.nPlayerCount; p++) { + if (OpenTaiko.ConfigIni.bAIBattleMode && p == 1) break; + + int pos = p; + if (is2PSide) + pos = 1; + + if (ctMainCounter.CurrentValue >= MountainAppearValue) { + #region [Mountain animation counter setup] + + if (!this.ctMountain_ClearIn.IsTicked) + this.ctMountain_ClearIn.Start(0, 515, 3, OpenTaiko.Timer); + + if (ctUIMove.EndValue != 1000 && OpenTaiko.Skin.Result_Use1PUI && is1P) ctUIMove = new CCounter(0, 1000, 0.5, OpenTaiko.Timer); + + if (OpenTaiko.stage結果.bClear[p]) { + if (!CResultCharacter.tIsCounterProcessing(p, CResultCharacter.ECharacterResult.CLEAR)) + CResultCharacter.tMenuResetTimer(p, CResultCharacter.ECharacterResult.CLEAR); + } else { + if (!CResultCharacter.tIsCounterProcessing(p, CResultCharacter.ECharacterResult.FAILED_IN)) + CResultCharacter.tMenuResetTimer(p, CResultCharacter.ECharacterResult.FAILED_IN); + else if (CResultCharacter.tIsCounterEnded(p, CResultCharacter.ECharacterResult.FAILED_IN) + && !CResultCharacter.tIsCounterProcessing(p, CResultCharacter.ECharacterResult.FAILED)) + CResultCharacter.tMenuResetTimer(p, CResultCharacter.ECharacterResult.FAILED); + } + + + #endregion + + /* TO DO */ + + // Alter Mountain appear value/Crown appear value if no Score Rank/no Crown + } + + #region [Character Animations] + + int _charaId = OpenTaiko.SaveFileInstances[OpenTaiko.GetActualPlayer(p)].data.Character; + + //int chara_x = TJAPlayer3.Skin.Characters_Result_X[_charaId][pos]; + //int chara_y = TJAPlayer3.Skin.Characters_Result_Y[_charaId][pos]; + + int chara_x = namePlate_x[pos] - (OpenTaiko.Skin.Characters_UseResult1P[_charaId] ? uioffset_x : 0) + OpenTaiko.Tx.NamePlateBase.szTextureSize.Width / 2; + int chara_y = namePlate_y[pos]; + + int p1chara_x = is2PSide ? OpenTaiko.Skin.Resolution[0] / 2 : 0; + int p1chara_y = OpenTaiko.Skin.Resolution[1] - (int)(uioffset_value * OpenTaiko.Skin.Resolution[1]); + float renderRatioX = OpenTaiko.Skin.Resolution[0] / (float)OpenTaiko.Skin.Characters_Resolution[_charaId][0]; + float renderRatioY = OpenTaiko.Skin.Resolution[1] / (float)OpenTaiko.Skin.Characters_Resolution[_charaId][1]; + + if (CResultCharacter.tIsCounterProcessing(p, CResultCharacter.ECharacterResult.CLEAR)) { + CResultCharacter.tMenuDisplayCharacter(p, chara_x, chara_y, CResultCharacter.ECharacterResult.CLEAR, pos); + + var tex = pos == 0 ? OpenTaiko.Tx.Characters_Result_Clear_1P[_charaId] : OpenTaiko.Tx.Characters_Result_Clear_2P[_charaId]; + if (OpenTaiko.Skin.Characters_UseResult1P[_charaId] && OpenTaiko.Skin.Result_Use1PUI && tex != null) { + tex.vcScaleRatio.X = renderRatioX; + tex.vcScaleRatio.Y = renderRatioY; + if (is2PSide) { + tex.t2D左右反転描画(p1chara_x, p1chara_y); + } else { + tex.t2D描画(p1chara_x, p1chara_y); } - if (OpenTaiko.Tx.Result_Number != null) { - OpenTaiko.Tx.Result_Number.t2D描画(x, y, rectangle); + } + } else if (CResultCharacter.tIsCounterProcessing(p, CResultCharacter.ECharacterResult.FAILED)) { + CResultCharacter.tMenuDisplayCharacter(p, chara_x, chara_y, CResultCharacter.ECharacterResult.FAILED, pos); + if (OpenTaiko.Skin.Characters_UseResult1P[_charaId] && OpenTaiko.Skin.Result_Use1PUI && OpenTaiko.Tx.Characters_Result_Failed_1P[_charaId] != null) { + OpenTaiko.Tx.Characters_Result_Failed_1P[_charaId].vcScaleRatio.X = renderRatioX; + OpenTaiko.Tx.Characters_Result_Failed_1P[_charaId].vcScaleRatio.Y = renderRatioY; + if (is2PSide) { + OpenTaiko.Tx.Characters_Result_Failed_1P[_charaId].t2D左右反転描画(p1chara_x, p1chara_y); + } else { + OpenTaiko.Tx.Characters_Result_Failed_1P[_charaId].t2D描画(p1chara_x, p1chara_y); } - break; + } + } else if (CResultCharacter.tIsCounterProcessing(p, CResultCharacter.ECharacterResult.FAILED_IN) && OpenTaiko.Tx.Characters_Result_Failed_1P[_charaId] != null) { + CResultCharacter.tMenuDisplayCharacter(p, chara_x, chara_y, CResultCharacter.ECharacterResult.FAILED_IN, pos); + if (OpenTaiko.Skin.Characters_UseResult1P[_charaId] && OpenTaiko.Skin.Result_Use1PUI) { + OpenTaiko.Tx.Characters_Result_Failed_1P[_charaId].vcScaleRatio.X = renderRatioX; + OpenTaiko.Tx.Characters_Result_Failed_1P[_charaId].vcScaleRatio.Y = renderRatioY; + if (is2PSide) { + OpenTaiko.Tx.Characters_Result_Failed_1P[_charaId].t2D左右反転描画(p1chara_x, p1chara_y); + } else { + OpenTaiko.Tx.Characters_Result_Failed_1P[_charaId].t2D描画(p1chara_x, p1chara_y); + } + } + } else + CResultCharacter.tMenuDisplayCharacter(p, chara_x, chara_y, CResultCharacter.ECharacterResult.NORMAL, pos); + + #endregion + + + #region [PuchiChara] + + int puchi_x = chara_x + OpenTaiko.Skin.Adjustments_MenuPuchichara_X[OpenTaiko.ConfigIni.nPlayerCount <= 2 ? pos : 0]; + int puchi_y = chara_y + OpenTaiko.Skin.Adjustments_MenuPuchichara_Y[OpenTaiko.ConfigIni.nPlayerCount <= 2 ? pos : 0]; + + //int ttdiff = 640 - 152; + //int ttps = 640 + ((pos == 1) ? ttdiff + 60 : -ttdiff); + + //this.PuchiChara.On進行描画(ttps, 562, false, 255, false, p); + + this.PuchiChara.On進行描画(puchi_x, puchi_y, false, 255, false, p); + + #endregion + + if (ctMainCounter.CurrentValue >= MountainAppearValue) { + float AddCount = 135; + + int baseX = (pos == 1) ? 1280 - 182 : 182; + int baseY = 602; + + #region [Cherry blossom animation] + + if (gaugeValues[p] >= 80.0f && OpenTaiko.ConfigIni.nPlayerCount <= 2) { + OpenTaiko.Tx.Result_Flower.vcScaleRatio.X = 0.6f * (ctMainCounter.CurrentValue <= MountainAppearValue + AddCount ? 1.3f - (float)Math.Sin((ctMainCounter.CurrentValue - MountainAppearValue) / (AddCount / 90) * (Math.PI / 180)) * 0.3f : 1.0f); + OpenTaiko.Tx.Result_Flower.vcScaleRatio.Y = 0.6f * (ctMainCounter.CurrentValue <= MountainAppearValue + AddCount ? 1.3f - (float)Math.Sin((ctMainCounter.CurrentValue - MountainAppearValue) / (AddCount / 90) * (Math.PI / 180)) * 0.3f : 1.0f); + + int flower_width = OpenTaiko.Tx.Result_Flower.szTextureSize.Width; + int flower_height = OpenTaiko.Tx.Result_Flower.szTextureSize.Height / 2; + + OpenTaiko.Tx.Result_Flower.t2D拡大率考慮中央基準描画(OpenTaiko.Skin.Result_Flower_X[pos], OpenTaiko.Skin.Result_Flower_Y[pos], + new Rectangle(0, 0, flower_width, flower_height)); + } + + #endregion + + #region [Cherry blossom Rotating flowers] + + if (gaugeValues[p] >= 80.0f && OpenTaiko.ConfigIni.nPlayerCount <= 2) { + float FlowerTime = ctRotate_Flowers.CurrentValue; + + for (int i = 0; i < 5; i++) { + + if ((int)FlowerTime < ApparitionTimeStamps[i] || (int)FlowerTime > ApparitionTimeStamps[i] + 2 * ApparitionFade + ApparitionDuration) + OpenTaiko.Tx.Result_Flower_Rotate[i].Opacity = 0; + else if ((int)FlowerTime <= ApparitionTimeStamps[i] + ApparitionDuration + ApparitionFade && (int)FlowerTime >= ApparitionTimeStamps[i] + ApparitionFade) + OpenTaiko.Tx.Result_Flower_Rotate[i].Opacity = 255; + else { + int CurrentGradiant = 0; + if ((int)FlowerTime >= ApparitionTimeStamps[i] + ApparitionFade + ApparitionDuration) + CurrentGradiant = ApparitionFade - ((int)FlowerTime - ApparitionTimeStamps[i] - ApparitionDuration - ApparitionFade); + else + CurrentGradiant = (int)FlowerTime - ApparitionTimeStamps[i]; + + + OpenTaiko.Tx.Result_Flower_Rotate[i].Opacity = (255 * CurrentGradiant) / ApparitionFade; + } + + OpenTaiko.Tx.Result_Flower_Rotate[i].vcScaleRatio.X = 0.6f; + OpenTaiko.Tx.Result_Flower_Rotate[i].vcScaleRatio.Y = 0.6f; + OpenTaiko.Tx.Result_Flower_Rotate[i].fZ軸中心回転 = (float)(FlowerTime - ApparitionTimeStamps[i]) / (FlowerRotationSpeeds[i] * 360f); + + OpenTaiko.Tx.Result_Flower_Rotate[i].t2D中心基準描画(OpenTaiko.Skin.Result_Flower_Rotate_X[pos][i], OpenTaiko.Skin.Result_Flower_Rotate_Y[pos][i]); + } + + } + + #endregion + + #region [Panel shines] + + if (gaugeValues[p] >= 80.0f && OpenTaiko.ConfigIni.nPlayerCount <= 2) { + int ShineTime = (int)ctShine_Plate.CurrentValue; + int Quadrant500 = ShineTime % 500; + + for (int i = 0; i < OpenTaiko.Skin.Result_PlateShine_Count; i++) { + if (i < 3 && ShineTime >= 500 || i >= 3 && ShineTime < 500) + OpenTaiko.Tx.Result_Shine.Opacity = 0; + else if (Quadrant500 >= ShinePFade && Quadrant500 <= 500 - ShinePFade) + OpenTaiko.Tx.Result_Shine.Opacity = 255; + else + OpenTaiko.Tx.Result_Shine.Opacity = (255 * Math.Min(Quadrant500, 500 - Quadrant500)) / ShinePFade; + + OpenTaiko.Tx.Result_Shine.vcScaleRatio.X = 0.15f; + OpenTaiko.Tx.Result_Shine.vcScaleRatio.Y = 0.15f; + + OpenTaiko.Tx.Result_Shine.t2D中心基準描画(OpenTaiko.Skin.Result_PlateShine_X[pos][i], OpenTaiko.Skin.Result_PlateShine_Y[pos][i]); + } + + } + + + #endregion + + #region [Speech bubble animation] + // Speech Bubble + + int Mood = 0; + int MoodV2 = 0; + + if (gaugeValues[p] >= 100.0f) + Mood = 3; + else if (gaugeValues[p] >= 80.0f) + Mood = 2; + else if (gaugeValues[p] >= 40.0f) + Mood = 1; + + if (OpenTaiko.stage結果.nクリア[p] == 4) { + MoodV2 = 5; + } else if (OpenTaiko.stage結果.nクリア[p] == 3) { + MoodV2 = 4; + } else if (OpenTaiko.stage結果.nクリア[p] >= 1) { + if (gaugeValues[p] >= 100.0f) { + MoodV2 = 3; + } else { + MoodV2 = 2; + } + } else if (OpenTaiko.stage結果.nクリア[p] == 0) { + if (gaugeValues[p] >= 40.0f) { + MoodV2 = 1; + } else { + MoodV2 = 0; + } + } + + if (OpenTaiko.ConfigIni.nPlayerCount <= 2) { + int speechBuddle_width = OpenTaiko.Tx.Result_Speech_Bubble[pos].szTextureSize.Width / 4; + int speechBuddle_height = OpenTaiko.Tx.Result_Speech_Bubble[pos].szTextureSize.Height / 3; + + OpenTaiko.Tx.Result_Speech_Bubble[pos].vcScaleRatio.X = 0.9f * (ctMainCounter.CurrentValue <= MountainAppearValue + AddCount ? 1.3f - (float)Math.Sin((ctMainCounter.CurrentValue - MountainAppearValue) / (AddCount / 90) * (Math.PI / 180)) * 0.3f : 1.0f); + OpenTaiko.Tx.Result_Speech_Bubble[pos].vcScaleRatio.Y = 0.9f * (ctMainCounter.CurrentValue <= MountainAppearValue + AddCount ? 1.3f - (float)Math.Sin((ctMainCounter.CurrentValue - MountainAppearValue) / (AddCount / 90) * (Math.PI / 180)) * 0.3f : 1.0f); + OpenTaiko.Tx.Result_Speech_Bubble[pos].t2D拡大率考慮中央基準描画(OpenTaiko.Skin.Result_Speech_Bubble_X[pos], OpenTaiko.Skin.Result_Speech_Bubble_Y[pos], + new Rectangle(Mood * speechBuddle_width, RandomText * speechBuddle_height, speechBuddle_width, speechBuddle_height)); + } + int speech_vubble_index = OpenTaiko.ConfigIni.nPlayerCount <= 2 ? pos : 2; + if (OpenTaiko.Tx.Result_Speech_Bubble_V2[speech_vubble_index] != null) { + int speechBuddle_width = OpenTaiko.Tx.Result_Speech_Bubble_V2[speech_vubble_index].szTextureSize.Width; + int speechBuddle_height = OpenTaiko.Tx.Result_Speech_Bubble_V2[speech_vubble_index].szTextureSize.Height / 6; + + int speech_bubble_x; + int speech_bubble_y; + float scale; + if (OpenTaiko.ConfigIni.nPlayerCount == 5) { + speech_bubble_x = OpenTaiko.Skin.Result_Speech_Bubble_V2_5P[0] + OpenTaiko.Skin.Result_UIMove_5P_X[pos]; + speech_bubble_y = OpenTaiko.Skin.Result_Speech_Bubble_V2_5P[1] + OpenTaiko.Skin.Result_UIMove_5P_Y[pos]; + scale = 0.5f; + } else if (OpenTaiko.ConfigIni.nPlayerCount == 4 || OpenTaiko.ConfigIni.nPlayerCount == 3) { + speech_bubble_x = OpenTaiko.Skin.Result_Speech_Bubble_V2_4P[0] + OpenTaiko.Skin.Result_UIMove_4P_X[pos]; + speech_bubble_y = OpenTaiko.Skin.Result_Speech_Bubble_V2_4P[1] + OpenTaiko.Skin.Result_UIMove_4P_Y[pos]; + scale = 0.5f; + } else if (OpenTaiko.ConfigIni.nPlayerCount == 2) { + speech_bubble_x = OpenTaiko.Skin.Result_Speech_Bubble_V2_2P_X[pos]; + speech_bubble_y = OpenTaiko.Skin.Result_Speech_Bubble_V2_2P_Y[pos]; + scale = 0.5f; + } else { + speech_bubble_x = OpenTaiko.Skin.Result_Speech_Bubble_V2_X[pos]; + speech_bubble_y = OpenTaiko.Skin.Result_Speech_Bubble_V2_Y[pos]; + scale = 1.0f; + } + + OpenTaiko.Tx.Result_Speech_Bubble_V2[speech_vubble_index].vcScaleRatio.X = 0.9f * scale * (ctMainCounter.CurrentValue <= MountainAppearValue + AddCount ? 1.3f - (float)Math.Sin((ctMainCounter.CurrentValue - MountainAppearValue) / (AddCount / 90) * (Math.PI / 180)) * 0.3f : 1.0f); + OpenTaiko.Tx.Result_Speech_Bubble_V2[speech_vubble_index].vcScaleRatio.Y = 0.9f * scale * (ctMainCounter.CurrentValue <= MountainAppearValue + AddCount ? 1.3f - (float)Math.Sin((ctMainCounter.CurrentValue - MountainAppearValue) / (AddCount / 90) * (Math.PI / 180)) * 0.3f : 1.0f); + OpenTaiko.Tx.Result_Speech_Bubble_V2[speech_vubble_index].t2D拡大率考慮中央基準描画(speech_bubble_x, speech_bubble_y, + new Rectangle(0, MoodV2 * speechBuddle_height, speechBuddle_width, speechBuddle_height)); + + TitleTextureKey.ResolveTitleTexture(ttkSpeechText[p][MoodV2]).vcScaleRatio.X = scale; + TitleTextureKey.ResolveTitleTexture(ttkSpeechText[p][MoodV2]).vcScaleRatio.Y = scale; + TitleTextureKey.ResolveTitleTexture(ttkSpeechText[p][MoodV2]).t2D拡大率考慮中央基準描画( + speech_bubble_x + (int)(OpenTaiko.Skin.Result_Speech_Text_Offset[0] * scale), + speech_bubble_y + (int)(OpenTaiko.Skin.Result_Speech_Text_Offset[1] * scale)); + } + if (!b音声再生[11]) { + if (gaugeValues[p] >= 80.0f) { + //TJAPlayer3.Skin.soundDonClear.t再生する(); + OpenTaiko.Skin.voiceResultClearSuccess[OpenTaiko.GetActualPlayer(p)]?.tPlay(); + } else { + //TJAPlayer3.Skin.soundDonFailed.t再生する(); + OpenTaiko.Skin.voiceResultClearFailed[OpenTaiko.GetActualPlayer(p)]?.tPlay(); + } + + if (p == OpenTaiko.ConfigIni.nPlayerCount - 1) + b音声再生[11] = true; + } + + #endregion + } + + + + + + + if (ctMainCounter.CurrentValue >= ScoreApparitionTimeStamp + 1000) { + //if (TJAPlayer3.ConfigIni.nPlayerCount <= 2) + { + #region [Score rank apparition] + + int scoreRank_width = OpenTaiko.Tx.Result_ScoreRankEffect.szTextureSize.Width / 7; + int scoreRank_height = OpenTaiko.Tx.Result_ScoreRankEffect.szTextureSize.Height / 4; + + if (ctMainCounter.CurrentValue <= ScoreApparitionTimeStamp + 1180) { + OpenTaiko.Tx.Result_ScoreRankEffect.Opacity = (int)((ctMainCounter.CurrentValue - (ScoreApparitionTimeStamp + 1000)) / 180.0f * 255.0f); + OpenTaiko.Tx.Result_ScoreRankEffect.vcScaleRatio.X = 1.0f + (float)Math.Sin((float)(ctMainCounter.CurrentValue - (ScoreApparitionTimeStamp + 910)) / 1.5f * (Math.PI / 180)) * 1.4f; + OpenTaiko.Tx.Result_ScoreRankEffect.vcScaleRatio.Y = 1.0f + (float)Math.Sin((float)(ctMainCounter.CurrentValue - (ScoreApparitionTimeStamp + 910)) / 1.5f * (Math.PI / 180)) * 1.4f; + } else if (ctMainCounter.CurrentValue <= ScoreApparitionTimeStamp + 1270) { + OpenTaiko.Tx.Result_ScoreRankEffect.vcScaleRatio.X = 0.5f + (float)Math.Sin((float)(ctMainCounter.CurrentValue - (ScoreApparitionTimeStamp + 1180)) * (Math.PI / 180)) * 0.5f; + OpenTaiko.Tx.Result_ScoreRankEffect.vcScaleRatio.Y = 0.5f + (float)Math.Sin((float)(ctMainCounter.CurrentValue - (ScoreApparitionTimeStamp + 1180)) * (Math.PI / 180)) * 0.5f; + } else { + OpenTaiko.Tx.Result_ScoreRankEffect.Opacity = 255; + OpenTaiko.Tx.Result_ScoreRankEffect.vcScaleRatio.X = 1f; + OpenTaiko.Tx.Result_ScoreRankEffect.vcScaleRatio.Y = 1f; + } + + if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] != (int)Difficulty.Dan && OpenTaiko.stage結果.nスコアランク[p] > 0) { + int CurrentFlash = 0; + int[] FlashTimes = { 1500, 1540, 1580, 1620, 1660, 1700, 1740, 1780 }; + + if (ctFlash_Icon.CurrentValue >= FlashTimes[0] && ctFlash_Icon.CurrentValue <= FlashTimes[1] || ctFlash_Icon.CurrentValue >= FlashTimes[4] && ctFlash_Icon.CurrentValue <= FlashTimes[5]) + CurrentFlash = 1; + else if (ctFlash_Icon.CurrentValue >= FlashTimes[1] && ctFlash_Icon.CurrentValue <= FlashTimes[2] || ctFlash_Icon.CurrentValue >= FlashTimes[5] && ctFlash_Icon.CurrentValue <= FlashTimes[6]) + CurrentFlash = 2; + else if (ctFlash_Icon.CurrentValue >= FlashTimes[2] && ctFlash_Icon.CurrentValue <= FlashTimes[3] || ctFlash_Icon.CurrentValue >= FlashTimes[6] && ctFlash_Icon.CurrentValue <= FlashTimes[7]) + CurrentFlash = 3; + + + int scoreRankEffect_x; + int scoreRankEffect_y; + if (OpenTaiko.ConfigIni.nPlayerCount == 5) { + scoreRankEffect_x = OpenTaiko.Skin.Result_ScoreRankEffect_5P[0] + OpenTaiko.Skin.Result_UIMove_5P_X[pos]; + scoreRankEffect_y = OpenTaiko.Skin.Result_ScoreRankEffect_5P[1] + OpenTaiko.Skin.Result_UIMove_5P_Y[pos]; + } else if (OpenTaiko.ConfigIni.nPlayerCount == 4 || OpenTaiko.ConfigIni.nPlayerCount == 3) { + scoreRankEffect_x = OpenTaiko.Skin.Result_ScoreRankEffect_4P[0] + OpenTaiko.Skin.Result_UIMove_4P_X[pos]; + scoreRankEffect_y = OpenTaiko.Skin.Result_ScoreRankEffect_4P[1] + OpenTaiko.Skin.Result_UIMove_4P_Y[pos]; + } else { + scoreRankEffect_x = OpenTaiko.Skin.Result_ScoreRankEffect_X[pos] + uioffset_x; + scoreRankEffect_y = OpenTaiko.Skin.Result_ScoreRankEffect_Y[pos]; + } + + OpenTaiko.Tx.Result_ScoreRankEffect.t2D拡大率考慮中央基準描画(scoreRankEffect_x, scoreRankEffect_y, + new Rectangle((OpenTaiko.stage結果.nスコアランク[p] - 1) * scoreRank_width, CurrentFlash * scoreRank_height, scoreRank_width, scoreRank_height)); + + if (!b音声再生[9] && ctMainCounter.CurrentValue >= ScoreApparitionTimeStamp + 1180) { + OpenTaiko.Skin.soundRankIn.tPlay(); + b音声再生[9] = true; + } + } + + #endregion + } + } + + + if (ctMainCounter.CurrentValue >= ScoreApparitionTimeStamp + 2500) { + //if (TJAPlayer3.ConfigIni.nPlayerCount <= 2) + { + #region [Crown apparition] + + int crownEffect_width = OpenTaiko.Tx.Result_CrownEffect.szTextureSize.Width / 4; + int crownEffect_height = OpenTaiko.Tx.Result_CrownEffect.szTextureSize.Height / 4; + + if (ctMainCounter.CurrentValue <= ScoreApparitionTimeStamp + 2680) { + OpenTaiko.Tx.Result_CrownEffect.Opacity = (int)((ctMainCounter.CurrentValue - (ScoreApparitionTimeStamp + 2500)) / 180.0f * 255.0f); + OpenTaiko.Tx.Result_CrownEffect.vcScaleRatio.X = 1.0f + (float)Math.Sin((float)(ctMainCounter.CurrentValue - (ScoreApparitionTimeStamp + 2410)) / 1.5f * (Math.PI / 180)) * 1.4f; + OpenTaiko.Tx.Result_CrownEffect.vcScaleRatio.Y = 1.0f + (float)Math.Sin((float)(ctMainCounter.CurrentValue - (ScoreApparitionTimeStamp + 2410)) / 1.5f * (Math.PI / 180)) * 1.4f; + } else if (ctMainCounter.CurrentValue <= ScoreApparitionTimeStamp + 2770) { + OpenTaiko.Tx.Result_CrownEffect.vcScaleRatio.X = 0.5f + (float)Math.Sin((float)(ctMainCounter.CurrentValue - (ScoreApparitionTimeStamp + 2680)) * (Math.PI / 180)) * 0.5f; + OpenTaiko.Tx.Result_CrownEffect.vcScaleRatio.Y = 0.5f + (float)Math.Sin((float)(ctMainCounter.CurrentValue - (ScoreApparitionTimeStamp + 2680)) * (Math.PI / 180)) * 0.5f; + } else { + OpenTaiko.Tx.Result_CrownEffect.Opacity = 255; + OpenTaiko.Tx.Result_CrownEffect.vcScaleRatio.X = 1f; + OpenTaiko.Tx.Result_CrownEffect.vcScaleRatio.Y = 1f; + } + + int ClearType = OpenTaiko.stage結果.nクリア[p] - 1; + + if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] != (int)(Difficulty.Dan) && ClearType >= 0) { + int CurrentFlash = 0; + int[] FlashTimes = { 2000, 2040, 2080, 2120, 2160, 2200, 2240, 2280 }; + + if (ctFlash_Icon.CurrentValue >= FlashTimes[0] && ctFlash_Icon.CurrentValue <= FlashTimes[1] || ctFlash_Icon.CurrentValue >= FlashTimes[4] && ctFlash_Icon.CurrentValue <= FlashTimes[5]) + CurrentFlash = 1; + else if (ctFlash_Icon.CurrentValue >= FlashTimes[1] && ctFlash_Icon.CurrentValue <= FlashTimes[2] || ctFlash_Icon.CurrentValue >= FlashTimes[5] && ctFlash_Icon.CurrentValue <= FlashTimes[6]) + CurrentFlash = 2; + else if (ctFlash_Icon.CurrentValue >= FlashTimes[2] && ctFlash_Icon.CurrentValue <= FlashTimes[3] || ctFlash_Icon.CurrentValue >= FlashTimes[6] && ctFlash_Icon.CurrentValue <= FlashTimes[7]) + CurrentFlash = 3; + + + int crownEffect_x; + int crownEffect_y; + if (OpenTaiko.ConfigIni.nPlayerCount == 5) { + crownEffect_x = OpenTaiko.Skin.Result_CrownEffect_5P[0] + OpenTaiko.Skin.Result_UIMove_5P_X[pos]; + crownEffect_y = OpenTaiko.Skin.Result_CrownEffect_5P[1] + OpenTaiko.Skin.Result_UIMove_5P_Y[pos]; + } else if (OpenTaiko.ConfigIni.nPlayerCount == 4 || OpenTaiko.ConfigIni.nPlayerCount == 3) { + crownEffect_x = OpenTaiko.Skin.Result_CrownEffect_4P[0] + OpenTaiko.Skin.Result_UIMove_4P_X[pos]; + crownEffect_y = OpenTaiko.Skin.Result_CrownEffect_4P[1] + OpenTaiko.Skin.Result_UIMove_4P_Y[pos]; + } else { + crownEffect_x = OpenTaiko.Skin.Result_CrownEffect_X[pos] + uioffset_x; + crownEffect_y = OpenTaiko.Skin.Result_CrownEffect_Y[pos]; + } + + OpenTaiko.Tx.Result_CrownEffect.t2D拡大率考慮中央基準描画(crownEffect_x, crownEffect_y, + new Rectangle(ClearType * crownEffect_width, CurrentFlash * crownEffect_height, crownEffect_width, crownEffect_height)); + + if (!b音声再生[10] && ctMainCounter.CurrentValue >= ScoreApparitionTimeStamp + 2680) { + OpenTaiko.Skin.soundCrownIn.tPlay(); + b音声再生[10] = true; + } + } + + #endregion } } - x += 8; } + + #endregion + + + + #endregion } - public void tスコア文字表示(int x, int y, int num, float scale) { - OpenTaiko.Tx.Result_Score_Number.vcScaleRatio.X *= scale; - OpenTaiko.Tx.Result_Score_Number.vcScaleRatio.Y *= scale; - int[] nums = CConversion.SeparateDigits(num); - for (int j = 0; j < nums.Length; j++) { - float offset = j; - float _x = x - (OpenTaiko.Skin.Result_Score_Number_Interval[0] * scale * offset); - float _y = y - (OpenTaiko.Skin.Result_Score_Number_Interval[1] * scale * offset); - - float width = (OpenTaiko.Tx.Result_Score_Number.sz画像サイズ.Width / 10.0f); - float height = (OpenTaiko.Tx.Result_Score_Number.sz画像サイズ.Height); - - OpenTaiko.Tx.Result_Score_Number.t2D拡大率考慮中央基準描画(_x, _y + (height * scale / 2), new RectangleF(width * nums[j], 0, width, height)); - } + if (!this.ct表示用.IsEnded) { + return 0; } - //----------------- - #endregion + return 1; } + + + + // その他 + + #region [ private ] + //----------------- + [StructLayout(LayoutKind.Sequential)] + private struct ST文字位置 { + public char ch; + public Point pt; + } + + public CCounter ctMainCounter; + public CCounter[] ctゲージアニメ; + private CCounter ct虹ゲージアニメ; + private CCounter ctSoul; + + public CCounter ctEndAnime; + public CCounter ctMountain_ClearIn; + public CCounter ctBackgroundAnime; + public CCounter ctBackgroundAnime_Clear; + + private int RandomText; + + private CCounter ctFlash_Icon; + private CCounter ctRotate_Flowers; + private CCounter ctShine_Plate; + + public PuchiChara PuchiChara; + + public float MountainAppearValue; + private int GaugeFactor; + + public bool[] b音声再生 = { false, false, false, false, false, false, false, false, false, false, false, false, false, false, false }; + + // Cherry blossom flowers variables + /* + public int[] FlowerXPos = { -114, -37, 114, 78, -75 }; + public int[] FlowerYPos = { -33, 3, -36, -81, -73 }; + */ + public float[] FlowerRotationSpeeds = { 5f, 3f, -6f, 4f, -2f }; + public int[] ApparitionTimeStamps = { 10, 30, 50, 100, 190 }; + public int ApparitionFade = 100; + public int ApparitionDuration = 300; + + // Plate shine variables + public int[] ShinePXPos = { 114 - 25, 114 - 16, -37 - 23, -37 - 9, -75 + 20, 78 - 13 }; + public int[] ShinePYPos = { -36 + 52, -36 + 2, 3 - 7, 3 + 30, -73 - 23, -81 - 31 }; + public int ShinePFade = 100; + + public int[] gaugeValues; + + private CCounter ct表示用; + private readonly Point[] ptFullCombo位置; + private CSound sdDTXで指定されたフルコンボ音; + private readonly ST文字位置[] st小文字位置; + private readonly ST文字位置[] st大文字位置; + private ST文字位置[] stScoreFont; + + private TitleTextureKey[] ttkAISection; + + private TitleTextureKey[][] ttkSpeechText = new TitleTextureKey[5][]; + + private CCachedFontRenderer pfSpeechText; + private CCachedFontRenderer pfAISectionText; + + private CCounter ctAISectionChange; + + private CCounter ctUIMove; + + private int nNowAISection; + + private void NextAISection() { + ctAISectionChange = new CCounter(0, 2000, 1, OpenTaiko.Timer); + ctAISectionChange.CurrentValue = 0; + + nNowAISection++; + if (nNowAISection >= Math.Ceiling(OpenTaiko.stage演奏ドラム画面.AIBattleSections.Count / 5.0)) { + nNowAISection = 0; + + } + } + + public void t小文字表示(int x, int y, int num, float scale) { + OpenTaiko.Tx.Result_Number.vcScaleRatio.X *= scale; + OpenTaiko.Tx.Result_Number.vcScaleRatio.Y *= scale; + int[] nums = CConversion.SeparateDigits(num); + for (int j = 0; j < nums.Length; j++) { + float offset = j; + + float width = (OpenTaiko.Tx.Result_Number.sz画像サイズ.Width / 11.0f); + float height = (OpenTaiko.Tx.Result_Number.sz画像サイズ.Height / 2.0f); + + float _x = x - ((OpenTaiko.Skin.Result_Number_Interval[0] * scale) * offset) + (width * 2); + float _y = y - ((OpenTaiko.Skin.Result_Number_Interval[1] * scale) * offset); + + OpenTaiko.Tx.Result_Number.t2D拡大率考慮中央基準描画(_x + (width * scale / 2), _y + (height * scale / 2), + new RectangleF(width * nums[j], 0, width, height)); + } + } + private void t大文字表示(int x, int y, string str) { + this.t大文字表示(x, y, str, false); + } + private void t大文字表示(int x, int y, string str, bool b強調) { + foreach (char ch in str) { + for (int i = 0; i < this.st大文字位置.Length; i++) { + if (this.st大文字位置[i].ch == ch) { + Rectangle rectangle = new Rectangle(this.st大文字位置[i].pt.X, this.st大文字位置[i].pt.Y, 11, 0x10); + if (ch == '.') { + rectangle.Width -= 2; + rectangle.Height -= 2; + } + if (OpenTaiko.Tx.Result_Number != null) { + OpenTaiko.Tx.Result_Number.t2D描画(x, y, rectangle); + } + break; + } + } + x += 8; + } + } + + public void tスコア文字表示(int x, int y, int num, float scale) { + OpenTaiko.Tx.Result_Score_Number.vcScaleRatio.X *= scale; + OpenTaiko.Tx.Result_Score_Number.vcScaleRatio.Y *= scale; + int[] nums = CConversion.SeparateDigits(num); + for (int j = 0; j < nums.Length; j++) { + float offset = j; + float _x = x - (OpenTaiko.Skin.Result_Score_Number_Interval[0] * scale * offset); + float _y = y - (OpenTaiko.Skin.Result_Score_Number_Interval[1] * scale * offset); + + float width = (OpenTaiko.Tx.Result_Score_Number.sz画像サイズ.Width / 10.0f); + float height = (OpenTaiko.Tx.Result_Score_Number.sz画像サイズ.Height); + + OpenTaiko.Tx.Result_Score_Number.t2D拡大率考慮中央基準描画(_x, _y + (height * scale / 2), new RectangleF(width * nums[j], 0, width, height)); + } + } + //----------------- + #endregion } diff --git a/OpenTaiko/src/Stages/08.Result/CActResultRank.cs b/OpenTaiko/src/Stages/08.Result/CActResultRank.cs index af766a6c..85fb75bc 100644 --- a/OpenTaiko/src/Stages/08.Result/CActResultRank.cs +++ b/OpenTaiko/src/Stages/08.Result/CActResultRank.cs @@ -1,52 +1,52 @@ using FDK; -namespace OpenTaiko { - internal class CActResultRank : CActivity { - // コンストラクタ +namespace OpenTaiko; - public CActResultRank() { - base.IsDeActivated = true; - } +internal class CActResultRank : CActivity { + // コンストラクタ - // CActivity 実装 - - public override void Activate() { - - base.Activate(); - } - public override void DeActivate() { - - base.DeActivate(); - } - public override void CreateManagedResource() { - if (!base.IsDeActivated) { - - base.CreateManagedResource(); - } - } - public override void ReleaseManagedResource() { - if (!base.IsDeActivated) { - - base.ReleaseManagedResource(); - } - } - public override int Draw() { - if (base.IsDeActivated) { - return 0; - } - if (base.IsFirstDraw) { - base.IsFirstDraw = false; - } - - return 1; - } - - - // その他 - - #region [ private ] - //----------------- - //----------------- - #endregion + public CActResultRank() { + base.IsDeActivated = true; } + + // CActivity 実装 + + public override void Activate() { + + base.Activate(); + } + public override void DeActivate() { + + base.DeActivate(); + } + public override void CreateManagedResource() { + if (!base.IsDeActivated) { + + base.CreateManagedResource(); + } + } + public override void ReleaseManagedResource() { + if (!base.IsDeActivated) { + + base.ReleaseManagedResource(); + } + } + public override int Draw() { + if (base.IsDeActivated) { + return 0; + } + if (base.IsFirstDraw) { + base.IsFirstDraw = false; + } + + return 1; + } + + + // その他 + + #region [ private ] + //----------------- + //----------------- + #endregion } diff --git a/OpenTaiko/src/Stages/08.Result/CActResultSongBar.cs b/OpenTaiko/src/Stages/08.Result/CActResultSongBar.cs index c3c610e6..245a2f29 100644 --- a/OpenTaiko/src/Stages/08.Result/CActResultSongBar.cs +++ b/OpenTaiko/src/Stages/08.Result/CActResultSongBar.cs @@ -1,84 +1,84 @@ using FDK; -namespace OpenTaiko { - internal class CActResultSongBar : CActivity { - // コンストラクタ +namespace OpenTaiko; - public CActResultSongBar() { - base.IsDeActivated = true; - } +internal class CActResultSongBar : CActivity { + // コンストラクタ - - // メソッド - - public void tアニメを完了させる() { - this.ct登場用.CurrentValue = (int)this.ct登場用.EndValue; - } - - - // CActivity 実装 - - public override void Activate() { - - var title = OpenTaiko.DTX.TITLE.GetString(""); - - using (var bmpSongTitle = pfMusicName.DrawText(title, OpenTaiko.Skin.Result_MusicName_ForeColor, OpenTaiko.Skin.Result_MusicName_BackColor, null, 30)) { - this.txMusicName = OpenTaiko.tテクスチャの生成(bmpSongTitle, false); - txMusicName.vcScaleRatio.X = OpenTaiko.GetSongNameXScaling(ref txMusicName, OpenTaiko.Skin.Result_MusicName_MaxSize); - } - - base.Activate(); - } - public override void DeActivate() { - if (this.ct登場用 != null) { - this.ct登場用 = null; - } - - OpenTaiko.tテクスチャの解放(ref this.txMusicName); - base.DeActivate(); - } - public override void CreateManagedResource() { - this.pfMusicName = HPrivateFastFont.tInstantiateMainFont(OpenTaiko.Skin.Result_MusicName_FontSize); - base.CreateManagedResource(); - } - public override void ReleaseManagedResource() { - OpenTaiko.tDisposeSafely(ref this.pfMusicName); - base.ReleaseManagedResource(); - } - public override int Draw() { - if (base.IsDeActivated) { - return 0; - } - if (base.IsFirstDraw) { - this.ct登場用 = new CCounter(0, 270, 4, OpenTaiko.Timer); - base.IsFirstDraw = false; - } - this.ct登場用.Tick(); - - if (OpenTaiko.Skin.Result_MusicName_ReferencePoint == CSkin.ReferencePoint.Center) { - this.txMusicName.t2D描画(OpenTaiko.Skin.Result_MusicName_X - ((this.txMusicName.szTextureSize.Width * txMusicName.vcScaleRatio.X) / 2), OpenTaiko.Skin.Result_MusicName_Y); - } else if (OpenTaiko.Skin.Result_MusicName_ReferencePoint == CSkin.ReferencePoint.Left) { - this.txMusicName.t2D描画(OpenTaiko.Skin.Result_MusicName_X, OpenTaiko.Skin.Result_MusicName_Y); - } else { - this.txMusicName.t2D描画(OpenTaiko.Skin.Result_MusicName_X - this.txMusicName.szTextureSize.Width * txMusicName.vcScaleRatio.X, OpenTaiko.Skin.Result_MusicName_Y); - } - - if (!this.ct登場用.IsEnded) { - return 0; - } - return 1; - } - - - // その他 - - #region [ private ] - //----------------- - private CCounter ct登場用; - - private CTexture txMusicName; - private CCachedFontRenderer pfMusicName; - //----------------- - #endregion + public CActResultSongBar() { + base.IsDeActivated = true; } + + + // メソッド + + public void tアニメを完了させる() { + this.ct登場用.CurrentValue = (int)this.ct登場用.EndValue; + } + + + // CActivity 実装 + + public override void Activate() { + + var title = OpenTaiko.DTX.TITLE.GetString(""); + + using (var bmpSongTitle = pfMusicName.DrawText(title, OpenTaiko.Skin.Result_MusicName_ForeColor, OpenTaiko.Skin.Result_MusicName_BackColor, null, 30)) { + this.txMusicName = OpenTaiko.tテクスチャの生成(bmpSongTitle, false); + txMusicName.vcScaleRatio.X = OpenTaiko.GetSongNameXScaling(ref txMusicName, OpenTaiko.Skin.Result_MusicName_MaxSize); + } + + base.Activate(); + } + public override void DeActivate() { + if (this.ct登場用 != null) { + this.ct登場用 = null; + } + + OpenTaiko.tテクスチャの解放(ref this.txMusicName); + base.DeActivate(); + } + public override void CreateManagedResource() { + this.pfMusicName = HPrivateFastFont.tInstantiateMainFont(OpenTaiko.Skin.Result_MusicName_FontSize); + base.CreateManagedResource(); + } + public override void ReleaseManagedResource() { + OpenTaiko.tDisposeSafely(ref this.pfMusicName); + base.ReleaseManagedResource(); + } + public override int Draw() { + if (base.IsDeActivated) { + return 0; + } + if (base.IsFirstDraw) { + this.ct登場用 = new CCounter(0, 270, 4, OpenTaiko.Timer); + base.IsFirstDraw = false; + } + this.ct登場用.Tick(); + + if (OpenTaiko.Skin.Result_MusicName_ReferencePoint == CSkin.ReferencePoint.Center) { + this.txMusicName.t2D描画(OpenTaiko.Skin.Result_MusicName_X - ((this.txMusicName.szTextureSize.Width * txMusicName.vcScaleRatio.X) / 2), OpenTaiko.Skin.Result_MusicName_Y); + } else if (OpenTaiko.Skin.Result_MusicName_ReferencePoint == CSkin.ReferencePoint.Left) { + this.txMusicName.t2D描画(OpenTaiko.Skin.Result_MusicName_X, OpenTaiko.Skin.Result_MusicName_Y); + } else { + this.txMusicName.t2D描画(OpenTaiko.Skin.Result_MusicName_X - this.txMusicName.szTextureSize.Width * txMusicName.vcScaleRatio.X, OpenTaiko.Skin.Result_MusicName_Y); + } + + if (!this.ct登場用.IsEnded) { + return 0; + } + return 1; + } + + + // その他 + + #region [ private ] + //----------------- + private CCounter ct登場用; + + private CTexture txMusicName; + private CCachedFontRenderer pfMusicName; + //----------------- + #endregion } diff --git a/OpenTaiko/src/Stages/08.Result/CStage結果.cs b/OpenTaiko/src/Stages/08.Result/CStage結果.cs index d292ad8e..bd80782b 100644 --- a/OpenTaiko/src/Stages/08.Result/CStage結果.cs +++ b/OpenTaiko/src/Stages/08.Result/CStage結果.cs @@ -4,1785 +4,1785 @@ using System.Text; using DiscordRPC; using FDK; -namespace OpenTaiko { - internal class CStage結果 : CStage { - // Modals Lua management +namespace OpenTaiko; - public CLuaModalScript lcModal { get; private set; } +internal class CStage結果 : CStage { + // Modals Lua management - public void RefreshSkin() { - lcModal?.Dispose(); - lcModal = new CLuaModalScript(CSkin.Path("Modules/Modal")); + public CLuaModalScript lcModal { get; private set; } + public void RefreshSkin() { + lcModal?.Dispose(); + lcModal = new CLuaModalScript(CSkin.Path("Modules/Modal")); + + } + + // Properties + + public STDGBVALUE b新記録スキル; + public STDGBVALUE b新記録スコア; + public STDGBVALUE b新記録ランク; + public STDGBVALUE fPerfect率; + public STDGBVALUE fGreat率; + public STDGBVALUE fGood率; + public STDGBVALUE fPoor率; + public STDGBVALUE fMiss率; + public STDGBVALUE bオート; // #23596 10.11.16 add ikanick + // 10.11.17 change (int to bool) ikanick + + public STDGBVALUE nランク値; + public STDGBVALUE n演奏回数; + public STDGBVALUE nScoreRank; + public int n総合ランク値; + + public int[] nクリア = { 0, 0, 0, 0, 0 }; //0:未クリア 1:クリア 2:フルコンボ 3:ドンダフルコンボ + public int[] nスコアランク = { 0, 0, 0, 0, 0 }; //0:未取得 1:白粋 2:銅粋 3:銀粋 4:金雅 5:桃雅 6:紫雅 7:虹極 + public int[] nHighScore = { 0, 0, 0, 0, 0 }; + + public CDTX.CChip[] r空うちドラムチップ; + public STDGBVALUE st演奏記録; + + + // Constructor + + public CStage結果() { + this.st演奏記録.Drums = new CScoreIni.C演奏記録(); + this.st演奏記録.Guitar = new CScoreIni.C演奏記録(); + this.st演奏記録.Bass = new CScoreIni.C演奏記録(); + this.st演奏記録.Taiko = new CScoreIni.C演奏記録(); + this.r空うちドラムチップ = new CDTX.CChip[10]; + this.n総合ランク値 = -1; + this.nチャンネル0Atoレーン07 = new int[] { 1, 2, 3, 4, 5, 7, 6, 1, 7, 0 }; + base.eStageID = CStage.EStage.Results; + base.ePhaseID = CStage.EPhase.Common_NORMAL; + base.IsDeActivated = true; + base.ChildActivities.Add(this.actParameterPanel = new CActResultParameterPanel()); + base.ChildActivities.Add(this.actSongBar = new CActResultSongBar()); + base.ChildActivities.Add(this.actOption = new CActオプションパネル()); + base.ChildActivities.Add(this.actFI = new CActFIFOResult()); + base.ChildActivities.Add(this.actFO = new CActFIFOBlack()); + } + + + public bool isAutoDisabled(int player) { + return ((player != 1 && !OpenTaiko.ConfigIni.bAutoPlay[player]) + || (player == 1 && !OpenTaiko.ConfigIni.bAutoPlay[player] && !OpenTaiko.ConfigIni.bAIBattleMode)); + } + + + public int GetTowerScoreRank() { + int tmpClear = 0; + double progress = CFloorManagement.LastRegisteredFloor / ((double)OpenTaiko.stageSongSelect.rChoosenSong.arスコア[5].譜面情報.nTotalFloor); + + // Clear badges : 10% (E), 25% (D), 50% (C), 75% (B), Clear (A), FC (S), DFC (X) + bool[] conditions = + { + progress >= 0.1, + progress >= 0.25, + progress >= 0.5, + progress >= 0.75, + progress == 1 && CFloorManagement.CurrentNumberOfLives > 0, + OpenTaiko.stage演奏ドラム画面.CChartScore[0].nMiss == 0 && OpenTaiko.stage演奏ドラム画面.CChartScore[0].nMine == 0, + OpenTaiko.stage演奏ドラム画面.CChartScore[0].nGood == 0 + }; + + for (int i = 0; i < conditions.Length; i++) { + if (conditions[i] == true) + tmpClear++; + else + break; } - // Properties + return tmpClear; + } - public STDGBVALUE b新記録スキル; - public STDGBVALUE b新記録スコア; - public STDGBVALUE b新記録ランク; - public STDGBVALUE fPerfect率; - public STDGBVALUE fGreat率; - public STDGBVALUE fGood率; - public STDGBVALUE fPoor率; - public STDGBVALUE fMiss率; - public STDGBVALUE bオート; // #23596 10.11.16 add ikanick - // 10.11.17 change (int to bool) ikanick + // CStage 実装 - public STDGBVALUE nランク値; - public STDGBVALUE n演奏回数; - public STDGBVALUE nScoreRank; - public int n総合ランク値; + public override void Activate() { - public int[] nクリア = { 0, 0, 0, 0, 0 }; //0:未クリア 1:クリア 2:フルコンボ 3:ドンダフルコンボ - public int[] nスコアランク = { 0, 0, 0, 0, 0 }; //0:未取得 1:白粋 2:銅粋 3:銀粋 4:金雅 5:桃雅 6:紫雅 7:虹極 - public int[] nHighScore = { 0, 0, 0, 0, 0 }; + Trace.TraceInformation("結果ステージを活性化します。"); + Trace.Indent(); + bAddedToRecentlyPlayedSongs = false; + try { + /* + * Notes about the difference between Replay - Save statuses and the "Assisted clear" clear status + * + * - The values for replay files are 0 if no status, while for save files they start by -1 + * - The "Assisted clear" status is used on the save files, but NOT on the replay files + * - The "Assisted clear" status is also not used in the coins evaluations + */ + int[] ClearStatus_Replay = new int[5] { 0, 0, 0, 0, 0 }; + int[] ScoreRank_Replay = new int[5] { 0, 0, 0, 0, 0 }; - public CDTX.CChip[] r空うちドラムチップ; - public STDGBVALUE st演奏記録; - - - // Constructor - - public CStage結果() { - this.st演奏記録.Drums = new CScoreIni.C演奏記録(); - this.st演奏記録.Guitar = new CScoreIni.C演奏記録(); - this.st演奏記録.Bass = new CScoreIni.C演奏記録(); - this.st演奏記録.Taiko = new CScoreIni.C演奏記録(); - this.r空うちドラムチップ = new CDTX.CChip[10]; - this.n総合ランク値 = -1; - this.nチャンネル0Atoレーン07 = new int[] { 1, 2, 3, 4, 5, 7, 6, 1, 7, 0 }; - base.eStageID = CStage.EStage.Results; - base.ePhaseID = CStage.EPhase.Common_NORMAL; - base.IsDeActivated = true; - base.ChildActivities.Add(this.actParameterPanel = new CActResultParameterPanel()); - base.ChildActivities.Add(this.actSongBar = new CActResultSongBar()); - base.ChildActivities.Add(this.actOption = new CActオプションパネル()); - base.ChildActivities.Add(this.actFI = new CActFIFOResult()); - base.ChildActivities.Add(this.actFO = new CActFIFOBlack()); - } - - - public bool isAutoDisabled(int player) { - return ((player != 1 && !OpenTaiko.ConfigIni.bAutoPlay[player]) - || (player == 1 && !OpenTaiko.ConfigIni.bAutoPlay[player] && !OpenTaiko.ConfigIni.bAIBattleMode)); - } - - - public int GetTowerScoreRank() { - int tmpClear = 0; - double progress = CFloorManagement.LastRegisteredFloor / ((double)OpenTaiko.stageSongSelect.rChoosenSong.arスコア[5].譜面情報.nTotalFloor); - - // Clear badges : 10% (E), 25% (D), 50% (C), 75% (B), Clear (A), FC (S), DFC (X) - bool[] conditions = + int[] clearStatuses = { - progress >= 0.1, - progress >= 0.25, - progress >= 0.5, - progress >= 0.75, - progress == 1 && CFloorManagement.CurrentNumberOfLives > 0, - OpenTaiko.stage演奏ドラム画面.CChartScore[0].nMiss == 0 && OpenTaiko.stage演奏ドラム画面.CChartScore[0].nMine == 0, - OpenTaiko.stage演奏ドラム画面.CChartScore[0].nGood == 0 + -1, + -1, + -1, + -1, + -1 }; - for (int i = 0; i < conditions.Length; i++) { - if (conditions[i] == true) - tmpClear++; - else - break; - } + int[] scoreRanks = + { + -1, + -1, + -1, + -1, + -1 + }; - return tmpClear; - } + bool[] assistedClear = + { + (OpenTaiko.stageSongSelect.actPlayOption.tGetModMultiplier(CActPlayOption.EBalancingType.SCORE, false, 0) < 1f), + (OpenTaiko.stageSongSelect.actPlayOption.tGetModMultiplier(CActPlayOption.EBalancingType.SCORE, false, 1) < 1f), + (OpenTaiko.stageSongSelect.actPlayOption.tGetModMultiplier(CActPlayOption.EBalancingType.SCORE, false, 2) < 1f), + (OpenTaiko.stageSongSelect.actPlayOption.tGetModMultiplier(CActPlayOption.EBalancingType.SCORE, false, 3) < 1f), + (OpenTaiko.stageSongSelect.actPlayOption.tGetModMultiplier(CActPlayOption.EBalancingType.SCORE, false, 4) < 1f) + }; - // CStage 実装 + { + #region [ 初期化 ] + //--------------------- + this.eフェードアウト完了時の戻り値 = E戻り値.継続; + this.bアニメが完了 = false; + this.bIsCheckedWhetherResultScreenShouldSaveOrNot = false; // #24609 2011.3.14 yyagi + this.n最後に再生したHHのWAV番号 = -1; + this.n最後に再生したHHのチャンネル番号 = 0; - public override void Activate() { + for (int i = 0; i < 3; i++) { + this.b新記録スキル[i] = false; + this.b新記録スコア[i] = false; + this.b新記録ランク[i] = false; + } + //--------------------- + #endregion - Trace.TraceInformation("結果ステージを活性化します。"); - Trace.Indent(); - bAddedToRecentlyPlayedSongs = false; - try { - /* - * Notes about the difference between Replay - Save statuses and the "Assisted clear" clear status - * - * - The values for replay files are 0 if no status, while for save files they start by -1 - * - The "Assisted clear" status is used on the save files, but NOT on the replay files - * - The "Assisted clear" status is also not used in the coins evaluations - */ - int[] ClearStatus_Replay = new int[5] { 0, 0, 0, 0, 0 }; - int[] ScoreRank_Replay = new int[5] { 0, 0, 0, 0, 0 }; + #region [ Results calculus ] + //--------------------- - int[] clearStatuses = - { - -1, - -1, - -1, - -1, - -1 - }; - - int[] scoreRanks = - { - -1, - -1, - -1, - -1, - -1 - }; - - bool[] assistedClear = - { - (OpenTaiko.stageSongSelect.actPlayOption.tGetModMultiplier(CActPlayOption.EBalancingType.SCORE, false, 0) < 1f), - (OpenTaiko.stageSongSelect.actPlayOption.tGetModMultiplier(CActPlayOption.EBalancingType.SCORE, false, 1) < 1f), - (OpenTaiko.stageSongSelect.actPlayOption.tGetModMultiplier(CActPlayOption.EBalancingType.SCORE, false, 2) < 1f), - (OpenTaiko.stageSongSelect.actPlayOption.tGetModMultiplier(CActPlayOption.EBalancingType.SCORE, false, 3) < 1f), - (OpenTaiko.stageSongSelect.actPlayOption.tGetModMultiplier(CActPlayOption.EBalancingType.SCORE, false, 4) < 1f) - }; - - { - #region [ 初期化 ] - //--------------------- - this.eフェードアウト完了時の戻り値 = E戻り値.継続; - this.bアニメが完了 = false; - this.bIsCheckedWhetherResultScreenShouldSaveOrNot = false; // #24609 2011.3.14 yyagi - this.n最後に再生したHHのWAV番号 = -1; - this.n最後に再生したHHのチャンネル番号 = 0; - - for (int i = 0; i < 3; i++) { - this.b新記録スキル[i] = false; - this.b新記録スコア[i] = false; - this.b新記録ランク[i] = false; - } - //--------------------- - #endregion - - #region [ Results calculus ] - //--------------------- - - if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] != (int)Difficulty.Dan && OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] != (int)Difficulty.Tower) { - for (int p = 0; p < OpenTaiko.ConfigIni.nPlayerCount; p++) { - var ccf = OpenTaiko.stage演奏ドラム画面.CChartScore[p]; - - this.nクリア[p] = 0; - if (HGaugeMethods.UNSAFE_FastNormaCheck(p)) { - this.nクリア[p] = 2; - if (ccf.nMiss == 0 && ccf.nMine == 0) { - this.nクリア[p] = 3; - if (ccf.nGood == 0) this.nクリア[p] = 4; - } - - if (assistedClear[p]) this.nクリア[p] = 1; - - clearStatuses[p] = this.nクリア[p] - 1; + if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] != (int)Difficulty.Dan && OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] != (int)Difficulty.Tower) { + for (int p = 0; p < OpenTaiko.ConfigIni.nPlayerCount; p++) { + var ccf = OpenTaiko.stage演奏ドラム画面.CChartScore[p]; + this.nクリア[p] = 0; + if (HGaugeMethods.UNSAFE_FastNormaCheck(p)) { + this.nクリア[p] = 2; + if (ccf.nMiss == 0 && ccf.nMine == 0) { + this.nクリア[p] = 3; + if (ccf.nGood == 0) this.nクリア[p] = 4; } - if ((int)OpenTaiko.stage演奏ドラム画面.actScore.Get(p) < 500000) { - this.nスコアランク[p] = 0; - } else { - var sr = OpenTaiko.stage演奏ドラム画面.ScoreRank.ScoreRank[p]; + if (assistedClear[p]) this.nクリア[p] = 1; - for (int i = 0; i < 7; i++) { - if ((int)OpenTaiko.stage演奏ドラム画面.actScore.Get(p) >= sr[i]) { - this.nスコアランク[p] = i + 1; - } + clearStatuses[p] = this.nクリア[p] - 1; + + } + + if ((int)OpenTaiko.stage演奏ドラム画面.actScore.Get(p) < 500000) { + this.nスコアランク[p] = 0; + } else { + var sr = OpenTaiko.stage演奏ドラム画面.ScoreRank.ScoreRank[p]; + + for (int i = 0; i < 7; i++) { + if ((int)OpenTaiko.stage演奏ドラム画面.actScore.Get(p) >= sr[i]) { + this.nスコアランク[p] = i + 1; } } - scoreRanks[p] = this.nスコアランク[p] - 1; - } - + scoreRanks[p] = this.nスコアランク[p] - 1; } - //--------------------- - #endregion - - #region [ Saves calculus ] - //--------------------- - - // Clear and score ranks - - - - if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] != (int)Difficulty.Dan && OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] != (int)Difficulty.Tower) { - // Regular (Ensou game) Score and Score Rank saves - - #region [Regular saves] - - for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { - int diff = OpenTaiko.stageSongSelect.nChoosenSongDifficulty[i]; - - ClearStatus_Replay[i] = this.nクリア[i]; - ScoreRank_Replay[i] = this.nスコアランク[i]; - } - - #endregion - - } else if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) { - /* == Specific format for DaniDoujou charts == - ** - ** Higher is better, takes the Clear0 spot (Usually the spot allocated for Kantan Clear crowns) - ** - ** 0 (Fugoukaku, no insign) - ** Silver Iki (Clear) : 1 (Red Goukaku) / 2 (Gold Goukaku) - ** Gold Iki (Full Combo) : 3 (Red Goukaku) / 4 (Gold Goukaku) - ** Rainbow Iki (Donda Full Combo) : 5 (Red Goukaku) / 6 (Gold Goukaku) - ** - */ - - #region [Dan scores] - - Exam.Status examStatus = OpenTaiko.stage演奏ドラム画面.actDan.GetExamStatus(OpenTaiko.stage結果.st演奏記録.Drums.Dan_C); - - int clearValue = 0; - - if (examStatus != Exam.Status.Failure) { - // Red Goukaku - clearValue += 1; - - // Gold Goukaku - if (examStatus == Exam.Status.Better_Success) - clearValue += 1; - - // Gold Iki - if (this.st演奏記録.Drums.nBadCount == 0) { - clearValue += 2; - - // Rainbow Iki - if (this.st演奏記録.Drums.nOkCount == 0) - clearValue += 2; - } - - if (assistedClear[0]) clearStatuses[0] = (examStatus == Exam.Status.Better_Success) ? 1 : 0; - else clearStatuses[0] = clearValue + 1; - - } - - if (isAutoDisabled(0)) { - ClearStatus_Replay[0] = clearValue; - } - - // this.st演奏記録[0].nクリア[0] = Math.Max(ini[0].stセクション[0].nクリア[0], clearValue); - - // Unlock dan grade - if (clearValue > 0 && !OpenTaiko.ConfigIni.bAutoPlay[0]) { - /* - this.newGradeGranted = TJAPlayer3.NamePlateConfig.tUpdateDanTitle(TJAPlayer3.stage選曲.r確定された曲.strタイトル.Substring(0, 2), - clearValue % 2 == 0, - (clearValue - 1) / 2, - TJAPlayer3.SaveFile); - */ - - this.newGradeGranted = OpenTaiko.SaveFileInstances[OpenTaiko.SaveFile].tUpdateDanTitle(OpenTaiko.stageSongSelect.rChoosenSong.ldTitle.GetString("").Substring(0, 2), - clearValue % 2 == 0, - (clearValue - 1) / 2); - } - - #endregion - - } else if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Tower) { - // Clear if top reached, then FC or DFC like any regular chart - // Score Rank cointains highest reached floor - - #region [Tower scores] - - int tmpClear = GetTowerScoreRank(); - - if (tmpClear != 0) clearStatuses[0] = assistedClear[0] ? 0 : tmpClear; - - if (isAutoDisabled(0)) { - ClearStatus_Replay[0] = tmpClear; - } - - #endregion - - } - - //--------------------- - #endregion } - string diffToString(int diff) { - string[] diffArr = - { - " Easy ", - " Normal ", - " Hard ", - " Extreme ", - " Extra ", - " Tower ", - " Dan " - }; - string[] diffArrIcon = - { - "-", - "", - "+" - }; + //--------------------- + #endregion - int level = OpenTaiko.stageSongSelect.rChoosenSong.nLevel[diff]; - CDTX.ELevelIcon levelIcon = OpenTaiko.stageSongSelect.rChoosenSong.nLevelIcon[diff]; + #region [ Saves calculus ] + //--------------------- - return (diffArr[Math.Min(diff, 6)] + "Lv." + level + diffArrIcon[(int)levelIcon]); - } - - string details = OpenTaiko.ConfigIni.SendDiscordPlayingInformation ? OpenTaiko.stageSongSelect.rChoosenSong.ldTitle.GetString("") - + diffToString(OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0]) : ""; - - // Byte count must be used instead of String.Length. - // The byte count is what Discord is concerned with. Some chars are greater than one byte. - if (Encoding.UTF8.GetBytes(details).Length > 128) { - byte[] details_byte = Encoding.UTF8.GetBytes(details); - Array.Resize(ref details_byte, 128); - details = Encoding.UTF8.GetString(details_byte); - } - - // Discord Presenseの更新 - OpenTaiko.DiscordClient?.SetPresence(new RichPresence() { - Details = details, - State = "Result" + (OpenTaiko.ConfigIni.bAutoPlay[0] == true ? " (Auto)" : ""), - Timestamps = new Timestamps(OpenTaiko.StartupTime), - Assets = new Assets() { - LargeImageKey = OpenTaiko.LargeImageKey, - LargeImageText = OpenTaiko.LargeImageText, - } - }); - - - #region [Earned medals] - - this.nEarnedMedalsCount[0] = 0; - this.nEarnedMedalsCount[1] = 0; - this.nEarnedMedalsCount[2] = 0; - this.nEarnedMedalsCount[3] = 0; - this.nEarnedMedalsCount[4] = 0; + // Clear and score ranks - // Medals + if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] != (int)Difficulty.Dan && OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] != (int)Difficulty.Tower) { + // Regular (Ensou game) Score and Score Rank saves - int nTotalHits = this.st演奏記録.Drums.nOkCount + this.st演奏記録.Drums.nBadCount + this.st演奏記録.Drums.nGoodCount; + #region [Regular saves] - double dAccuracyRate = Math.Pow((50 * this.st演奏記録.Drums.nOkCount + 100 * this.st演奏記録.Drums.nGoodCount) / (double)(100 * nTotalHits), 3); + for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { + int diff = OpenTaiko.stageSongSelect.nChoosenSongDifficulty[i]; - int diffModifier; - float starRate; - float redStarRate; - - - float[] modMultipliers = - { - OpenTaiko.stageSongSelect.actPlayOption.tGetModMultiplier(CActPlayOption.EBalancingType.COINS, false, 0), - OpenTaiko.stageSongSelect.actPlayOption.tGetModMultiplier(CActPlayOption.EBalancingType.COINS, false, 1), - OpenTaiko.stageSongSelect.actPlayOption.tGetModMultiplier(CActPlayOption.EBalancingType.COINS, false, 2), - OpenTaiko.stageSongSelect.actPlayOption.tGetModMultiplier(CActPlayOption.EBalancingType.COINS, false, 3), - OpenTaiko.stageSongSelect.actPlayOption.tGetModMultiplier(CActPlayOption.EBalancingType.COINS, false, 4) - }; - - float getCoinMul(int player) { - var chara = OpenTaiko.Tx.Characters[OpenTaiko.SaveFileInstances[OpenTaiko.GetActualPlayer(player)].data.Character]; - var puchichara = OpenTaiko.Tx.Puchichara[PuchiChara.tGetPuchiCharaIndexByName(OpenTaiko.GetActualPlayer(player))]; - - - return chara.GetEffectCoinMultiplier() * puchichara.GetEffectCoinMultiplier(); - } - - if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Tower) { - diffModifier = 3; - - int stars = OpenTaiko.stageSongSelect.rChoosenSong.arスコア[(int)Difficulty.Tower].譜面情報.nレベル[(int)Difficulty.Tower]; - - starRate = Math.Min(10, stars) / 2; - redStarRate = Math.Max(0, stars - 10) * 4; - - int maxFloors = OpenTaiko.stageSongSelect.rChoosenSong.arスコア[(int)Difficulty.Tower].譜面情報.nTotalFloor; - - double floorRate = Math.Pow(CFloorManagement.LastRegisteredFloor / (double)maxFloors, 2); - double lengthBonus = Math.Max(1, maxFloors / 140.0); - - #region [Clear modifier] - - int clearModifier = 0; - - if (this.st演奏記録.Drums.nBadCount == 0) { - clearModifier = (int)(5 * lengthBonus); - if (this.st演奏記録.Drums.nOkCount == 0) { - clearModifier = (int)(12 * lengthBonus); - } + ClearStatus_Replay[i] = this.nクリア[i]; + ScoreRank_Replay[i] = this.nスコアランク[i]; } #endregion - // this.nEarnedMedalsCount[0] = stars; - this.nEarnedMedalsCount[0] = 5 + (int)((diffModifier * (starRate + redStarRate)) * (floorRate * lengthBonus)) + clearModifier; - this.nEarnedMedalsCount[0] = Math.Max(5, (int)(this.nEarnedMedalsCount[0] * modMultipliers[0] * getCoinMul(0))); } else if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) { - int partialScore = 0; + /* == Specific format for DaniDoujou charts == + ** + ** Higher is better, takes the Clear0 spot (Usually the spot allocated for Kantan Clear crowns) + ** + ** 0 (Fugoukaku, no insign) + ** Silver Iki (Clear) : 1 (Red Goukaku) / 2 (Gold Goukaku) + ** Gold Iki (Full Combo) : 3 (Red Goukaku) / 4 (Gold Goukaku) + ** Rainbow Iki (Donda Full Combo) : 5 (Red Goukaku) / 6 (Gold Goukaku) + ** + */ - #region [Clear and Goukaku modifier] + #region [Dan scores] Exam.Status examStatus = OpenTaiko.stage演奏ドラム画面.actDan.GetExamStatus(OpenTaiko.stage結果.st演奏記録.Drums.Dan_C); - int clearModifier = -1; - int goukakuModifier = 0; + int clearValue = 0; if (examStatus != Exam.Status.Failure) { - clearModifier = 0; - if (this.st演奏記録.Drums.nBadCount == 0) { - clearModifier = 4; - if (this.st演奏記録.Drums.nOkCount == 0) - clearModifier = 6; - } + // Red Goukaku + clearValue += 1; + // Gold Goukaku if (examStatus == Exam.Status.Better_Success) - goukakuModifier = 20; - } + clearValue += 1; - #endregion + // Gold Iki + if (this.st演奏記録.Drums.nBadCount == 0) { + clearValue += 2; - #region [Partial scores] - - for (int i = 0; i < OpenTaiko.stageSongSelect.rChoosenSong.DanSongs.Count; i++) { - if (OpenTaiko.stageSongSelect.rChoosenSong.DanSongs[i] != null) { - int diff = OpenTaiko.stageSongSelect.rChoosenSong.DanSongs[i].Difficulty; - int stars = OpenTaiko.stageSongSelect.rChoosenSong.DanSongs[i].Level; - - diffModifier = Math.Max(1, Math.Min(3, diff)); - - starRate = Math.Min(10, stars) / 2; - redStarRate = Math.Max(0, stars - 10) * 4; - - partialScore += (int)(diffModifier * (starRate + redStarRate)); + // Rainbow Iki + if (this.st演奏記録.Drums.nOkCount == 0) + clearValue += 2; } + if (assistedClear[0]) clearStatuses[0] = (examStatus == Exam.Status.Better_Success) ? 1 : 0; + else clearStatuses[0] = clearValue + 1; + + } + + if (isAutoDisabled(0)) { + ClearStatus_Replay[0] = clearValue; + } + + // this.st演奏記録[0].nクリア[0] = Math.Max(ini[0].stセクション[0].nクリア[0], clearValue); + + // Unlock dan grade + if (clearValue > 0 && !OpenTaiko.ConfigIni.bAutoPlay[0]) { + /* + this.newGradeGranted = TJAPlayer3.NamePlateConfig.tUpdateDanTitle(TJAPlayer3.stage選曲.r確定された曲.strタイトル.Substring(0, 2), + clearValue % 2 == 0, + (clearValue - 1) / 2, + TJAPlayer3.SaveFile); + */ + + this.newGradeGranted = OpenTaiko.SaveFileInstances[OpenTaiko.SaveFile].tUpdateDanTitle(OpenTaiko.stageSongSelect.rChoosenSong.ldTitle.GetString("").Substring(0, 2), + clearValue % 2 == 0, + (clearValue - 1) / 2); } #endregion - if (clearModifier < 0) - this.nEarnedMedalsCount[0] = 10; - else { - this.nEarnedMedalsCount[0] = 10 + goukakuModifier + clearModifier + (int)(partialScore * dAccuracyRate); - this.nEarnedMedalsCount[0] = Math.Max(10, (int)(this.nEarnedMedalsCount[0] * modMultipliers[0] * getCoinMul(0))); + } else if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Tower) { + // Clear if top reached, then FC or DFC like any regular chart + // Score Rank cointains highest reached floor + + #region [Tower scores] + + int tmpClear = GetTowerScoreRank(); + + if (tmpClear != 0) clearStatuses[0] = assistedClear[0] ? 0 : tmpClear; + + if (isAutoDisabled(0)) { + ClearStatus_Replay[0] = tmpClear; } - } else { - for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { - int diff = OpenTaiko.stageSongSelect.nChoosenSongDifficulty[i]; - int stars = OpenTaiko.stageSongSelect.rChoosenSong.arスコア[diff].譜面情報.nレベル[diff]; + + #endregion + + } + + //--------------------- + #endregion + + } + + string diffToString(int diff) { + string[] diffArr = + { + " Easy ", + " Normal ", + " Hard ", + " Extreme ", + " Extra ", + " Tower ", + " Dan " + }; + string[] diffArrIcon = + { + "-", + "", + "+" + }; + + int level = OpenTaiko.stageSongSelect.rChoosenSong.nLevel[diff]; + CDTX.ELevelIcon levelIcon = OpenTaiko.stageSongSelect.rChoosenSong.nLevelIcon[diff]; + + return (diffArr[Math.Min(diff, 6)] + "Lv." + level + diffArrIcon[(int)levelIcon]); + } + + string details = OpenTaiko.ConfigIni.SendDiscordPlayingInformation ? OpenTaiko.stageSongSelect.rChoosenSong.ldTitle.GetString("") + + diffToString(OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0]) : ""; + + // Byte count must be used instead of String.Length. + // The byte count is what Discord is concerned with. Some chars are greater than one byte. + if (Encoding.UTF8.GetBytes(details).Length > 128) { + byte[] details_byte = Encoding.UTF8.GetBytes(details); + Array.Resize(ref details_byte, 128); + details = Encoding.UTF8.GetString(details_byte); + } + + // Discord Presenseの更新 + OpenTaiko.DiscordClient?.SetPresence(new RichPresence() { + Details = details, + State = "Result" + (OpenTaiko.ConfigIni.bAutoPlay[0] == true ? " (Auto)" : ""), + Timestamps = new Timestamps(OpenTaiko.StartupTime), + Assets = new Assets() { + LargeImageKey = OpenTaiko.LargeImageKey, + LargeImageText = OpenTaiko.LargeImageText, + } + }); + + + #region [Earned medals] + + this.nEarnedMedalsCount[0] = 0; + this.nEarnedMedalsCount[1] = 0; + this.nEarnedMedalsCount[2] = 0; + this.nEarnedMedalsCount[3] = 0; + this.nEarnedMedalsCount[4] = 0; + + + + // Medals + + int nTotalHits = this.st演奏記録.Drums.nOkCount + this.st演奏記録.Drums.nBadCount + this.st演奏記録.Drums.nGoodCount; + + double dAccuracyRate = Math.Pow((50 * this.st演奏記録.Drums.nOkCount + 100 * this.st演奏記録.Drums.nGoodCount) / (double)(100 * nTotalHits), 3); + + int diffModifier; + float starRate; + float redStarRate; + + + float[] modMultipliers = + { + OpenTaiko.stageSongSelect.actPlayOption.tGetModMultiplier(CActPlayOption.EBalancingType.COINS, false, 0), + OpenTaiko.stageSongSelect.actPlayOption.tGetModMultiplier(CActPlayOption.EBalancingType.COINS, false, 1), + OpenTaiko.stageSongSelect.actPlayOption.tGetModMultiplier(CActPlayOption.EBalancingType.COINS, false, 2), + OpenTaiko.stageSongSelect.actPlayOption.tGetModMultiplier(CActPlayOption.EBalancingType.COINS, false, 3), + OpenTaiko.stageSongSelect.actPlayOption.tGetModMultiplier(CActPlayOption.EBalancingType.COINS, false, 4) + }; + + float getCoinMul(int player) { + var chara = OpenTaiko.Tx.Characters[OpenTaiko.SaveFileInstances[OpenTaiko.GetActualPlayer(player)].data.Character]; + var puchichara = OpenTaiko.Tx.Puchichara[PuchiChara.tGetPuchiCharaIndexByName(OpenTaiko.GetActualPlayer(player))]; + + + return chara.GetEffectCoinMultiplier() * puchichara.GetEffectCoinMultiplier(); + } + + if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Tower) { + diffModifier = 3; + + int stars = OpenTaiko.stageSongSelect.rChoosenSong.arスコア[(int)Difficulty.Tower].譜面情報.nレベル[(int)Difficulty.Tower]; + + starRate = Math.Min(10, stars) / 2; + redStarRate = Math.Max(0, stars - 10) * 4; + + int maxFloors = OpenTaiko.stageSongSelect.rChoosenSong.arスコア[(int)Difficulty.Tower].譜面情報.nTotalFloor; + + double floorRate = Math.Pow(CFloorManagement.LastRegisteredFloor / (double)maxFloors, 2); + double lengthBonus = Math.Max(1, maxFloors / 140.0); + + #region [Clear modifier] + + int clearModifier = 0; + + if (this.st演奏記録.Drums.nBadCount == 0) { + clearModifier = (int)(5 * lengthBonus); + if (this.st演奏記録.Drums.nOkCount == 0) { + clearModifier = (int)(12 * lengthBonus); + } + } + + #endregion + + // this.nEarnedMedalsCount[0] = stars; + this.nEarnedMedalsCount[0] = 5 + (int)((diffModifier * (starRate + redStarRate)) * (floorRate * lengthBonus)) + clearModifier; + this.nEarnedMedalsCount[0] = Math.Max(5, (int)(this.nEarnedMedalsCount[0] * modMultipliers[0] * getCoinMul(0))); + } else if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) { + int partialScore = 0; + + #region [Clear and Goukaku modifier] + + Exam.Status examStatus = OpenTaiko.stage演奏ドラム画面.actDan.GetExamStatus(OpenTaiko.stage結果.st演奏記録.Drums.Dan_C); + + int clearModifier = -1; + int goukakuModifier = 0; + + if (examStatus != Exam.Status.Failure) { + clearModifier = 0; + if (this.st演奏記録.Drums.nBadCount == 0) { + clearModifier = 4; + if (this.st演奏記録.Drums.nOkCount == 0) + clearModifier = 6; + } + + if (examStatus == Exam.Status.Better_Success) + goukakuModifier = 20; + } + + #endregion + + #region [Partial scores] + + for (int i = 0; i < OpenTaiko.stageSongSelect.rChoosenSong.DanSongs.Count; i++) { + if (OpenTaiko.stageSongSelect.rChoosenSong.DanSongs[i] != null) { + int diff = OpenTaiko.stageSongSelect.rChoosenSong.DanSongs[i].Difficulty; + int stars = OpenTaiko.stageSongSelect.rChoosenSong.DanSongs[i].Level; diffModifier = Math.Max(1, Math.Min(3, diff)); starRate = Math.Min(10, stars) / 2; redStarRate = Math.Max(0, stars - 10) * 4; - #region [Clear modifier] - - int[] modifiers = { -1, 0, 2, 3 }; - - int clearModifier = modifiers[0]; - - if (HGaugeMethods.UNSAFE_FastNormaCheck(i)) { - clearModifier = modifiers[1] * diffModifier; - if (OpenTaiko.stage演奏ドラム画面.CChartScore[i].nMiss == 0) { - clearModifier = modifiers[2] * diffModifier; - if (OpenTaiko.stage演奏ドラム画面.CChartScore[i].nGood == 0) - clearModifier = modifiers[3] * diffModifier; - } - } - - #endregion - - #region [Score rank modifier] - - int[] srModifiers = { 0, 0, 0, 0, 1, 1, 2, 3 }; - - // int s = TJAPlayer3.stage演奏ドラム画面.ScoreRank.ScoreRank[1]; - - int scoreRankModifier = srModifiers[0] * diffModifier; - - for (int j = 1; j < 8; j++) { - if (OpenTaiko.stage演奏ドラム画面.actScore.GetScore(i) >= OpenTaiko.stage演奏ドラム画面.ScoreRank.ScoreRank[i][j - 1]) - scoreRankModifier = srModifiers[j] * diffModifier; - } - - #endregion - - nTotalHits = OpenTaiko.stage演奏ドラム画面.CChartScore[i].nGood + OpenTaiko.stage演奏ドラム画面.CChartScore[i].nMiss + OpenTaiko.stage演奏ドラム画面.CChartScore[i].nGreat; - - dAccuracyRate = Math.Pow((50 * OpenTaiko.stage演奏ドラム画面.CChartScore[i].nGood + 100 * OpenTaiko.stage演奏ドラム画面.CChartScore[i].nGreat) / (double)(100 * nTotalHits), 3); - - if (clearModifier < 0) - this.nEarnedMedalsCount[i] = 5; - else { - this.nEarnedMedalsCount[i] = 5 + (int)((diffModifier * (starRate + redStarRate)) * dAccuracyRate) + clearModifier + scoreRankModifier; - this.nEarnedMedalsCount[i] = Math.Max(5, (int)(this.nEarnedMedalsCount[i] * modMultipliers[i] * getCoinMul(i))); - } - } - } - - // ADLIB bonuses : 1 coin per ADLIB - for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { - // Too broken on some charts, ADLibs should get either no bonus or just extra stats - //this.nEarnedMedalsCount[i] += Math.Min(10, TJAPlayer3.stage演奏ドラム画面.CChartScore[i].nADLIB); - - if (OpenTaiko.ConfigIni.bAutoPlay[i]) - this.nEarnedMedalsCount[i] = 0; - if (OpenTaiko.ConfigIni.bAIBattleMode && i == 1) - this.nEarnedMedalsCount[i] = 0; - - var _sf = OpenTaiko.SaveFileInstances[OpenTaiko.GetActualPlayer(i)]; - - if (OpenTaiko.ConfigIni.bAIBattleMode && i == 0) { - _sf.tRegisterAIBattleModePlay(bClear[0]); + partialScore += (int)(diffModifier * (starRate + redStarRate)); } - if (this.nEarnedMedalsCount[i] > 0) - _sf.tEarnCoins(this.nEarnedMedalsCount[i]); - - if (!OpenTaiko.ConfigIni.bAutoPlay[i] - && !(OpenTaiko.ConfigIni.bAIBattleMode && i == 1)) { - int _cs = -1; - if (HGaugeMethods.UNSAFE_FastNormaCheck(i)) { - _cs = 0; - if (OpenTaiko.stage演奏ドラム画面.CChartScore[i].nMiss == 0) { - _cs = 1; - if (OpenTaiko.stage演奏ドラム画面.CChartScore[i].nGood == 0) - _cs = 2; - } - } - - // Unsafe function, it is the only appropriate place to call it - DBSaves.RegisterPlay(i, clearStatuses[i], scoreRanks[i]); - } - } - - - //TJAPlayer3.NamePlateConfig.tEarnCoins(this.nEarnedMedalsCount); - - #endregion - - #region [Replay files generation] - - for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { - if (OpenTaiko.ConfigIni.bAutoPlay[i]) - continue; - if (OpenTaiko.ConfigIni.bAIBattleMode && i == 1) - continue; - OpenTaiko.ReplayInstances[i].tResultsRegisterReplayInformations(this.nEarnedMedalsCount[i], ClearStatus_Replay[i], ScoreRank_Replay[i]); - OpenTaiko.ReplayInstances[i].tSaveReplayFile(); } #endregion - #region [Modals preprocessing] - - if (OpenTaiko.ConfigIni.nPlayerCount == 1 || OpenTaiko.ConfigIni.bAIBattleMode) { - mqModals = new ModalQueue(Modal.EModalFormat.Full); - } else if (OpenTaiko.ConfigIni.nPlayerCount == 2) { - mqModals = new ModalQueue(Modal.EModalFormat.Half); - } else if (OpenTaiko.ConfigIni.nPlayerCount == 3 || OpenTaiko.ConfigIni.nPlayerCount == 4) { - mqModals = new ModalQueue(Modal.EModalFormat.Half_4P); - } else if (OpenTaiko.ConfigIni.nPlayerCount == 5) { - mqModals = new ModalQueue(Modal.EModalFormat.Half_5P); + if (clearModifier < 0) + this.nEarnedMedalsCount[0] = 10; + else { + this.nEarnedMedalsCount[0] = 10 + goukakuModifier + clearModifier + (int)(partialScore * dAccuracyRate); + this.nEarnedMedalsCount[0] = Math.Max(10, (int)(this.nEarnedMedalsCount[0] * modMultipliers[0] * getCoinMul(0))); } - + } else { for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { - if (OpenTaiko.ConfigIni.bAutoPlay[i] || OpenTaiko.ConfigIni.bAIBattleMode && i == 1) continue; + int diff = OpenTaiko.stageSongSelect.nChoosenSongDifficulty[i]; + int stars = OpenTaiko.stageSongSelect.rChoosenSong.arスコア[diff].譜面情報.nレベル[diff]; - if (this.nEarnedMedalsCount[i] > 0) - mqModals.tAddModal( - new Modal( - Modal.EModalType.Coin, - 0, - (long)this.nEarnedMedalsCount[i], - OpenTaiko.SaveFileInstances[OpenTaiko.GetActualPlayer(i)].data.Medals - ), - i); + diffModifier = Math.Max(1, Math.Min(3, diff)); - // Check unlockables - { - OpenTaiko.Databases.DBNameplateUnlockables.tGetUnlockedItems(i, mqModals); - OpenTaiko.Databases.DBSongUnlockables.tGetUnlockedItems(i, mqModals); + starRate = Math.Min(10, stars) / 2; + redStarRate = Math.Max(0, stars - 10) * 4; - foreach (var puchi in OpenTaiko.Tx.Puchichara) { - puchi.tGetUnlockedItems(i, mqModals); - } + #region [Clear modifier] - foreach (var chara in OpenTaiko.Tx.Characters) { - chara.tGetUnlockedItems(i, mqModals); + int[] modifiers = { -1, 0, 2, 3 }; + + int clearModifier = modifiers[0]; + + if (HGaugeMethods.UNSAFE_FastNormaCheck(i)) { + clearModifier = modifiers[1] * diffModifier; + if (OpenTaiko.stage演奏ドラム画面.CChartScore[i].nMiss == 0) { + clearModifier = modifiers[2] * diffModifier; + if (OpenTaiko.stage演奏ドラム画面.CChartScore[i].nGood == 0) + clearModifier = modifiers[3] * diffModifier; } } + #endregion + + #region [Score rank modifier] + + int[] srModifiers = { 0, 0, 0, 0, 1, 1, 2, 3 }; + + // int s = TJAPlayer3.stage演奏ドラム画面.ScoreRank.ScoreRank[1]; + + int scoreRankModifier = srModifiers[0] * diffModifier; + + for (int j = 1; j < 8; j++) { + if (OpenTaiko.stage演奏ドラム画面.actScore.GetScore(i) >= OpenTaiko.stage演奏ドラム画面.ScoreRank.ScoreRank[i][j - 1]) + scoreRankModifier = srModifiers[j] * diffModifier; + } + + #endregion + + nTotalHits = OpenTaiko.stage演奏ドラム画面.CChartScore[i].nGood + OpenTaiko.stage演奏ドラム画面.CChartScore[i].nMiss + OpenTaiko.stage演奏ドラム画面.CChartScore[i].nGreat; + + dAccuracyRate = Math.Pow((50 * OpenTaiko.stage演奏ドラム画面.CChartScore[i].nGood + 100 * OpenTaiko.stage演奏ドラム画面.CChartScore[i].nGreat) / (double)(100 * nTotalHits), 3); + + if (clearModifier < 0) + this.nEarnedMedalsCount[i] = 5; + else { + this.nEarnedMedalsCount[i] = 5 + (int)((diffModifier * (starRate + redStarRate)) * dAccuracyRate) + clearModifier + scoreRankModifier; + this.nEarnedMedalsCount[i] = Math.Max(5, (int)(this.nEarnedMedalsCount[i] * modMultipliers[i] * getCoinMul(i))); + } } - - displayedModals = null; - - #endregion - - OpenTaiko.stageSongSelect.actSongList.bFirstCrownLoad = false; - - this.ctPhase1 = null; - this.ctPhase2 = null; - this.ctPhase3 = null; - examsShift = 0; - - Dan_Plate = OpenTaiko.tテクスチャの生成(Path.GetDirectoryName(OpenTaiko.DTX.strファイル名の絶対パス) + @$"{Path.DirectorySeparatorChar}Dan_Plate.png"); - - base.Activate(); - - - ctShine_Plate = new CCounter(0, 1000, 1, OpenTaiko.Timer); - ctWork_Plate = new CCounter(0, 4000, 1, OpenTaiko.Timer); - - if (OpenTaiko.Tx.TowerResult_Background != null) - ctTower_Animation = new CCounter(0, OpenTaiko.Tx.TowerResult_Background.szTextureSize.Height - OpenTaiko.Skin.Resolution[1], 25, OpenTaiko.Timer); - else - ctTower_Animation = new CCounter(); - - - ctDanSongInfoChange = new CCounter(0, 3000, 1, OpenTaiko.Timer); - ctDanSongInfoChange.CurrentValue = 255; - - b音声再生 = false; - this.EndAnime = false; - - if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Tower) { - this.ttkMaxFloors = new TitleTextureKey("/" + OpenTaiko.stageSongSelect.rChoosenSong.arスコア[5].譜面情報.nTotalFloor.ToString() + CLangManager.LangInstance.GetString("TOWER_FLOOR_INITIAL"), pfTowerText48, Color.Black, Color.Transparent, 700); - this.ttkToutatsu = new TitleTextureKey(CLangManager.LangInstance.GetString("TOWER_FLOOR_REACHED"), pfTowerText48, Color.White, Color.Black, 700); - this.ttkTen = new TitleTextureKey(CLangManager.LangInstance.GetString("TOWER_SCORE_INITIAL"), pfTowerText, Color.Black, Color.Transparent, 700); - this.ttkReachedFloor = new TitleTextureKey(CFloorManagement.LastRegisteredFloor.ToString(), pfTowerText72, Color.Orange, Color.Black, 700); - this.ttkScore = new TitleTextureKey(CLangManager.LangInstance.GetString("TOWER_SCORE"), pfTowerText, Color.Black, Color.Transparent, 700); - this.ttkRemaningLifes = new TitleTextureKey(CFloorManagement.CurrentNumberOfLives.ToString() + " / " + CFloorManagement.MaxNumberOfLives.ToString(), pfTowerText, Color.Black, Color.Transparent, 700); - this.ttkScoreCount = new TitleTextureKey(OpenTaiko.stage演奏ドラム画面.actScore.GetScore(0).ToString(), pfTowerText, Color.Black, Color.Transparent, 700); - } else if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) { - Background = new ResultBG(CSkin.Path($@"{TextureLoader.BASE}{TextureLoader.DANRESULT}Script.lua")); - Background.Init(); - } else if (OpenTaiko.ConfigIni.bAIBattleMode) { - Background = new ResultBG(CSkin.Path($@"{TextureLoader.BASE}{TextureLoader.RESULT}AIBattle{Path.DirectorySeparatorChar}Script.lua")); - Background.Init(); - } else { - //Luaに移植する時にコメントアウトを解除 - Background = new ResultBG(CSkin.Path($@"{TextureLoader.BASE}{TextureLoader.RESULT}{Path.DirectorySeparatorChar}Script.lua")); - Background.Init(); - } - - this.ttkDanTitles = new TitleTextureKey[OpenTaiko.stageSongSelect.rChoosenSong.DanSongs.Count]; - - for (int i = 0; i < OpenTaiko.stageSongSelect.rChoosenSong.DanSongs.Count; i++) { - this.ttkDanTitles[i] = new TitleTextureKey(OpenTaiko.stageSongSelect.rChoosenSong.DanSongs[i].bTitleShow - ? "???" - : OpenTaiko.stageSongSelect.rChoosenSong.DanSongs[i].Title, - pfDanTitles, - Color.White, - Color.Black, - 700); - } - } finally { - Trace.TraceInformation("結果ステージの活性化を完了しました。"); - Trace.Unindent(); } - if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] != (int)Difficulty.Dan && OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] != (int)Difficulty.Tower) - bgmResultIn.tPlay(); - } - public override void DeActivate() { - OpenTaiko.tDisposeSafely(ref Background); + // ADLIB bonuses : 1 coin per ADLIB + for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { + // Too broken on some charts, ADLibs should get either no bonus or just extra stats + //this.nEarnedMedalsCount[i] += Math.Min(10, TJAPlayer3.stage演奏ドラム画面.CChartScore[i].nADLIB); - if (this.rResultSound != null) { - OpenTaiko.SoundManager.tDisposeSound(this.rResultSound); - this.rResultSound = null; + if (OpenTaiko.ConfigIni.bAutoPlay[i]) + this.nEarnedMedalsCount[i] = 0; + if (OpenTaiko.ConfigIni.bAIBattleMode && i == 1) + this.nEarnedMedalsCount[i] = 0; + + var _sf = OpenTaiko.SaveFileInstances[OpenTaiko.GetActualPlayer(i)]; + + if (OpenTaiko.ConfigIni.bAIBattleMode && i == 0) { + _sf.tRegisterAIBattleModePlay(bClear[0]); + } + + if (this.nEarnedMedalsCount[i] > 0) + _sf.tEarnCoins(this.nEarnedMedalsCount[i]); + + if (!OpenTaiko.ConfigIni.bAutoPlay[i] + && !(OpenTaiko.ConfigIni.bAIBattleMode && i == 1)) { + int _cs = -1; + if (HGaugeMethods.UNSAFE_FastNormaCheck(i)) { + _cs = 0; + if (OpenTaiko.stage演奏ドラム画面.CChartScore[i].nMiss == 0) { + _cs = 1; + if (OpenTaiko.stage演奏ドラム画面.CChartScore[i].nGood == 0) + _cs = 2; + } + } + + // Unsafe function, it is the only appropriate place to call it + DBSaves.RegisterPlay(i, clearStatuses[i], scoreRanks[i]); + } } - if (this.ct登場用 != null) { - this.ct登場用 = null; + + //TJAPlayer3.NamePlateConfig.tEarnCoins(this.nEarnedMedalsCount); + + #endregion + + #region [Replay files generation] + + for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { + if (OpenTaiko.ConfigIni.bAutoPlay[i]) + continue; + if (OpenTaiko.ConfigIni.bAIBattleMode && i == 1) + continue; + OpenTaiko.ReplayInstances[i].tResultsRegisterReplayInformations(this.nEarnedMedalsCount[i], ClearStatus_Replay[i], ScoreRank_Replay[i]); + OpenTaiko.ReplayInstances[i].tSaveReplayFile(); } - Dan_Plate?.Dispose(); - base.DeActivate(); - } - public override void CreateManagedResource() { - this.pfTowerText = HPrivateFastFont.tInstantiateMainFont(OpenTaiko.Skin.TowerResult_Font_TowerText); - this.pfTowerText48 = HPrivateFastFont.tInstantiateMainFont(OpenTaiko.Skin.TowerResult_Font_TowerText48); - this.pfTowerText72 = HPrivateFastFont.tInstantiateMainFont(OpenTaiko.Skin.TowerResult_Font_TowerText72); + #endregion - this.pfDanTitles = HPrivateFastFont.tInstantiateMainFont(OpenTaiko.Skin.DanResult_Font_DanTitles_Size); + #region [Modals preprocessing] - base.CreateManagedResource(); - } - public override void ReleaseManagedResource() { + if (OpenTaiko.ConfigIni.nPlayerCount == 1 || OpenTaiko.ConfigIni.bAIBattleMode) { + mqModals = new ModalQueue(Modal.EModalFormat.Full); + } else if (OpenTaiko.ConfigIni.nPlayerCount == 2) { + mqModals = new ModalQueue(Modal.EModalFormat.Half); + } else if (OpenTaiko.ConfigIni.nPlayerCount == 3 || OpenTaiko.ConfigIni.nPlayerCount == 4) { + mqModals = new ModalQueue(Modal.EModalFormat.Half_4P); + } else if (OpenTaiko.ConfigIni.nPlayerCount == 5) { + mqModals = new ModalQueue(Modal.EModalFormat.Half_5P); + } + + for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { + if (OpenTaiko.ConfigIni.bAutoPlay[i] || OpenTaiko.ConfigIni.bAIBattleMode && i == 1) continue; + + if (this.nEarnedMedalsCount[i] > 0) + mqModals.tAddModal( + new Modal( + Modal.EModalType.Coin, + 0, + (long)this.nEarnedMedalsCount[i], + OpenTaiko.SaveFileInstances[OpenTaiko.GetActualPlayer(i)].data.Medals + ), + i); + + // Check unlockables + { + OpenTaiko.Databases.DBNameplateUnlockables.tGetUnlockedItems(i, mqModals); + OpenTaiko.Databases.DBSongUnlockables.tGetUnlockedItems(i, mqModals); + + foreach (var puchi in OpenTaiko.Tx.Puchichara) { + puchi.tGetUnlockedItems(i, mqModals); + } + + foreach (var chara in OpenTaiko.Tx.Characters) { + chara.tGetUnlockedItems(i, mqModals); + } + } + + } + + displayedModals = null; + + #endregion + + OpenTaiko.stageSongSelect.actSongList.bFirstCrownLoad = false; + + this.ctPhase1 = null; + this.ctPhase2 = null; + this.ctPhase3 = null; + examsShift = 0; + + Dan_Plate = OpenTaiko.tテクスチャの生成(Path.GetDirectoryName(OpenTaiko.DTX.strファイル名の絶対パス) + @$"{Path.DirectorySeparatorChar}Dan_Plate.png"); + + base.Activate(); + + + ctShine_Plate = new CCounter(0, 1000, 1, OpenTaiko.Timer); + ctWork_Plate = new CCounter(0, 4000, 1, OpenTaiko.Timer); + + if (OpenTaiko.Tx.TowerResult_Background != null) + ctTower_Animation = new CCounter(0, OpenTaiko.Tx.TowerResult_Background.szTextureSize.Height - OpenTaiko.Skin.Resolution[1], 25, OpenTaiko.Timer); + else + ctTower_Animation = new CCounter(); + + + ctDanSongInfoChange = new CCounter(0, 3000, 1, OpenTaiko.Timer); + ctDanSongInfoChange.CurrentValue = 255; + + b音声再生 = false; + this.EndAnime = false; if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Tower) { - OpenTaiko.tDisposeSafely(ref pfTowerText); - OpenTaiko.tDisposeSafely(ref pfTowerText48); - OpenTaiko.tDisposeSafely(ref pfTowerText72); + this.ttkMaxFloors = new TitleTextureKey("/" + OpenTaiko.stageSongSelect.rChoosenSong.arスコア[5].譜面情報.nTotalFloor.ToString() + CLangManager.LangInstance.GetString("TOWER_FLOOR_INITIAL"), pfTowerText48, Color.Black, Color.Transparent, 700); + this.ttkToutatsu = new TitleTextureKey(CLangManager.LangInstance.GetString("TOWER_FLOOR_REACHED"), pfTowerText48, Color.White, Color.Black, 700); + this.ttkTen = new TitleTextureKey(CLangManager.LangInstance.GetString("TOWER_SCORE_INITIAL"), pfTowerText, Color.Black, Color.Transparent, 700); + this.ttkReachedFloor = new TitleTextureKey(CFloorManagement.LastRegisteredFloor.ToString(), pfTowerText72, Color.Orange, Color.Black, 700); + this.ttkScore = new TitleTextureKey(CLangManager.LangInstance.GetString("TOWER_SCORE"), pfTowerText, Color.Black, Color.Transparent, 700); + this.ttkRemaningLifes = new TitleTextureKey(CFloorManagement.CurrentNumberOfLives.ToString() + " / " + CFloorManagement.MaxNumberOfLives.ToString(), pfTowerText, Color.Black, Color.Transparent, 700); + this.ttkScoreCount = new TitleTextureKey(OpenTaiko.stage演奏ドラム画面.actScore.GetScore(0).ToString(), pfTowerText, Color.Black, Color.Transparent, 700); } else if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) { - OpenTaiko.tDisposeSafely(ref pfDanTitles); + Background = new ResultBG(CSkin.Path($@"{TextureLoader.BASE}{TextureLoader.DANRESULT}Script.lua")); + Background.Init(); + } else if (OpenTaiko.ConfigIni.bAIBattleMode) { + Background = new ResultBG(CSkin.Path($@"{TextureLoader.BASE}{TextureLoader.RESULT}AIBattle{Path.DirectorySeparatorChar}Script.lua")); + Background.Init(); + } else { + //Luaに移植する時にコメントアウトを解除 + Background = new ResultBG(CSkin.Path($@"{TextureLoader.BASE}{TextureLoader.RESULT}{Path.DirectorySeparatorChar}Script.lua")); + Background.Init(); } - base.ReleaseManagedResource(); + this.ttkDanTitles = new TitleTextureKey[OpenTaiko.stageSongSelect.rChoosenSong.DanSongs.Count]; + + for (int i = 0; i < OpenTaiko.stageSongSelect.rChoosenSong.DanSongs.Count; i++) { + this.ttkDanTitles[i] = new TitleTextureKey(OpenTaiko.stageSongSelect.rChoosenSong.DanSongs[i].bTitleShow + ? "???" + : OpenTaiko.stageSongSelect.rChoosenSong.DanSongs[i].Title, + pfDanTitles, + Color.White, + Color.Black, + 700); + } + } finally { + Trace.TraceInformation("結果ステージの活性化を完了しました。"); + Trace.Unindent(); } - public override int Draw() { - if (!base.IsDeActivated) { - ctShine_Plate.TickLoop(); + if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] != (int)Difficulty.Dan && OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] != (int)Difficulty.Tower) + bgmResultIn.tPlay(); + } + public override void DeActivate() { + OpenTaiko.tDisposeSafely(ref Background); - // int num; + if (this.rResultSound != null) { + OpenTaiko.SoundManager.tDisposeSound(this.rResultSound); + this.rResultSound = null; + } - if (base.IsFirstDraw) { - this.ct登場用 = new CCounter(0, 100, 5, OpenTaiko.Timer); - this.actFI.tフェードイン開始(); - base.ePhaseID = CStage.EPhase.Common_FADEIN; + if (this.ct登場用 != null) { + this.ct登場用 = null; + } + Dan_Plate?.Dispose(); - if (this.rResultSound != null) { - this.rResultSound.PlayStart(); - } + base.DeActivate(); + } + public override void CreateManagedResource() { + this.pfTowerText = HPrivateFastFont.tInstantiateMainFont(OpenTaiko.Skin.TowerResult_Font_TowerText); + this.pfTowerText48 = HPrivateFastFont.tInstantiateMainFont(OpenTaiko.Skin.TowerResult_Font_TowerText48); + this.pfTowerText72 = HPrivateFastFont.tInstantiateMainFont(OpenTaiko.Skin.TowerResult_Font_TowerText72); - base.IsFirstDraw = false; - } - this.bアニメが完了 = true; - if (this.ct登場用.IsTicked) { - this.ct登場用.Tick(); - if (this.ct登場用.IsEnded) { - this.ct登場用.Stop(); - } else { - this.bアニメが完了 = false; - } + this.pfDanTitles = HPrivateFastFont.tInstantiateMainFont(OpenTaiko.Skin.DanResult_Font_DanTitles_Size); + + base.CreateManagedResource(); + } + public override void ReleaseManagedResource() { + + if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Tower) { + OpenTaiko.tDisposeSafely(ref pfTowerText); + OpenTaiko.tDisposeSafely(ref pfTowerText48); + OpenTaiko.tDisposeSafely(ref pfTowerText72); + } else if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) { + OpenTaiko.tDisposeSafely(ref pfDanTitles); + } + + base.ReleaseManagedResource(); + } + public override int Draw() { + if (!base.IsDeActivated) { + + ctShine_Plate.TickLoop(); + + // int num; + + if (base.IsFirstDraw) { + this.ct登場用 = new CCounter(0, 100, 5, OpenTaiko.Timer); + this.actFI.tフェードイン開始(); + base.ePhaseID = CStage.EPhase.Common_FADEIN; + + if (this.rResultSound != null) { + this.rResultSound.PlayStart(); } - // 描画 + base.IsFirstDraw = false; + } + this.bアニメが完了 = true; + if (this.ct登場用.IsTicked) { + this.ct登場用.Tick(); + if (this.ct登場用.IsEnded) { + this.ct登場用.Stop(); + } else { + this.bアニメが完了 = false; + } + } - Background?.Update(); - Background?.Draw(); + // 描画 - if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] != (int)Difficulty.Dan && OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] != (int)Difficulty.Tower) { - #region [Ensou game result screen] + Background?.Update(); + Background?.Draw(); - if (!b音声再生 && !bgmResultIn.bIsPlaying) { - bgmResultLoop.tPlay(); - b音声再生 = true; - } - if (!OpenTaiko.ConfigIni.bAIBattleMode) { - /* - if (TJAPlayer3.Tx.Result_Background != null) + if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] != (int)Difficulty.Dan && OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] != (int)Difficulty.Tower) { + #region [Ensou game result screen] + + if (!b音声再生 && !bgmResultIn.bIsPlaying) { + bgmResultLoop.tPlay(); + b音声再生 = true; + } + if (!OpenTaiko.ConfigIni.bAIBattleMode) { + /* + if (TJAPlayer3.Tx.Result_Background != null) + { + bool is1P = (TJAPlayer3.ConfigIni.nPlayerCount == 1); + bool is2PSide = TJAPlayer3.P1IsBlue(); + int mountainTexId = (is2PSide && is1P) ? 2 : 0; + + int CloudType = 0; + float MountainAppearValue = this.actParameterPanel.MountainAppearValue; + + //2000 + (this.actParameterPanel.ctゲージアニメ.n終了値 * 66) + 8360 - 85; + int gaugeAnimFactors = 0; + + if (this.actParameterPanel.ct全体進行.n現在の値 >= MountainAppearValue && is1P) { - bool is1P = (TJAPlayer3.ConfigIni.nPlayerCount == 1); - bool is2PSide = TJAPlayer3.P1IsBlue(); - int mountainTexId = (is2PSide && is1P) ? 2 : 0; + #region [Mountain Bump (1P only)] - int CloudType = 0; - float MountainAppearValue = this.actParameterPanel.MountainAppearValue; - - //2000 + (this.actParameterPanel.ctゲージアニメ.n終了値 * 66) + 8360 - 85; - int gaugeAnimFactors = 0; - - if (this.actParameterPanel.ct全体進行.n現在の値 >= MountainAppearValue && is1P) + if (bClear[0]) { - #region [Mountain Bump (1P only)] + //int gaugeAnimationFactor = (this.actParameterPanel.ct全体進行.n現在の値 - (10275 + ((int)this.actParameterPanel.ctゲージアニメ[0].n終了値 * 66))) * 3; - if (bClear[0]) + gaugeAnimFactors = (this.actParameterPanel.ct全体進行.n現在の値 - (int)MountainAppearValue) * 3; + + TJAPlayer3.Tx.Result_Background[1].Opacity = gaugeAnimFactors; + + TJAPlayer3.Tx.Result_Mountain[mountainTexId + 1].Opacity = gaugeAnimFactors; + TJAPlayer3.Tx.Result_Mountain[mountainTexId + 0].Opacity = 255 - gaugeAnimFactors; + + if (this.actParameterPanel.ctMountain_ClearIn.n現在の値 <= 90) { - //int gaugeAnimationFactor = (this.actParameterPanel.ct全体進行.n現在の値 - (10275 + ((int)this.actParameterPanel.ctゲージアニメ[0].n終了値 * 66))) * 3; + TJAPlayer3.Tx.Result_Mountain[mountainTexId + 1].vc拡大縮小倍率.Y = 1.0f - (float)Math.Sin((float)this.actParameterPanel.ctMountain_ClearIn.n現在の値 * (Math.PI / 180)) * 0.18f; + } + else if (this.actParameterPanel.ctMountain_ClearIn.n現在の値 <= 225) + { + TJAPlayer3.Tx.Result_Mountain[mountainTexId + 1].vc拡大縮小倍率.Y = 0.82f + (float)Math.Sin((float)(this.actParameterPanel.ctMountain_ClearIn.n現在の値 - 90) / 1.5f * (Math.PI / 180)) * 0.58f; + } + else if (this.actParameterPanel.ctMountain_ClearIn.n現在の値 <= 245) + { + TJAPlayer3.Tx.Result_Mountain[mountainTexId + 1].vc拡大縮小倍率.Y = 1.4f; + } + else if (this.actParameterPanel.ctMountain_ClearIn.n現在の値 <= 335) + { + TJAPlayer3.Tx.Result_Mountain[mountainTexId + 1].vc拡大縮小倍率.Y = 0.9f + (float)Math.Sin((float)(this.actParameterPanel.ctMountain_ClearIn.n現在の値 - 155) * (Math.PI / 180)) * 0.5f; + } + else if (this.actParameterPanel.ctMountain_ClearIn.n現在の値 <= 515) + { + TJAPlayer3.Tx.Result_Mountain[mountainTexId + 1].vc拡大縮小倍率.Y = 0.9f + (float)Math.Sin((float)(this.actParameterPanel.ctMountain_ClearIn.n現在の値 - 335) * (Math.PI / 180)) * 0.4f; + } + } - gaugeAnimFactors = (this.actParameterPanel.ct全体進行.n現在の値 - (int)MountainAppearValue) * 3; + #endregion + } + else if (is1P) + { - TJAPlayer3.Tx.Result_Background[1].Opacity = gaugeAnimFactors; + TJAPlayer3.Tx.Result_Background[1].Opacity = 0; + TJAPlayer3.Tx.Result_Mountain[mountainTexId + 0].Opacity = 255; + TJAPlayer3.Tx.Result_Mountain[mountainTexId + 1].Opacity = 0; + } - TJAPlayer3.Tx.Result_Mountain[mountainTexId + 1].Opacity = gaugeAnimFactors; - TJAPlayer3.Tx.Result_Mountain[mountainTexId + 0].Opacity = 255 - gaugeAnimFactors; + #region [Display background] - if (this.actParameterPanel.ctMountain_ClearIn.n現在の値 <= 90) + if (is1P) + { + if (is2PSide) + TJAPlayer3.Tx.Result_Background[2].t2D描画(0, 0); + else + TJAPlayer3.Tx.Result_Background[0].t2D描画(0, 0); + TJAPlayer3.Tx.Result_Background[1].t2D描画(0, 0); + } + else + { + if (TJAPlayer3.ConfigIni.nPlayerCount <= 2) + { + gaugeAnimFactors = (this.actParameterPanel.ct全体進行.n現在の値 - (int)MountainAppearValue) * 3; + + int width1 = TJAPlayer3.Tx.Result_Background[1].szテクスチャサイズ.Width / 2; + int height1 = TJAPlayer3.Tx.Result_Background[1].szテクスチャサイズ.Height; + + for (int i = 0; i < 2; i++) + { + int width2 = TJAPlayer3.Tx.Result_Background[2 * i].szテクスチャサイズ.Width / 2; + int height2 = TJAPlayer3.Tx.Result_Background[2 * i].szテクスチャサイズ.Height; + TJAPlayer3.Tx.Result_Background[2 * i].t2D描画(width2 * i, 0, new Rectangle(width2 * i, 0, width2, height2)); + + if (bClear[i]) { - TJAPlayer3.Tx.Result_Mountain[mountainTexId + 1].vc拡大縮小倍率.Y = 1.0f - (float)Math.Sin((float)this.actParameterPanel.ctMountain_ClearIn.n現在の値 * (Math.PI / 180)) * 0.18f; - } - else if (this.actParameterPanel.ctMountain_ClearIn.n現在の値 <= 225) - { - TJAPlayer3.Tx.Result_Mountain[mountainTexId + 1].vc拡大縮小倍率.Y = 0.82f + (float)Math.Sin((float)(this.actParameterPanel.ctMountain_ClearIn.n現在の値 - 90) / 1.5f * (Math.PI / 180)) * 0.58f; - } - else if (this.actParameterPanel.ctMountain_ClearIn.n現在の値 <= 245) - { - TJAPlayer3.Tx.Result_Mountain[mountainTexId + 1].vc拡大縮小倍率.Y = 1.4f; - } - else if (this.actParameterPanel.ctMountain_ClearIn.n現在の値 <= 335) - { - TJAPlayer3.Tx.Result_Mountain[mountainTexId + 1].vc拡大縮小倍率.Y = 0.9f + (float)Math.Sin((float)(this.actParameterPanel.ctMountain_ClearIn.n現在の値 - 155) * (Math.PI / 180)) * 0.5f; - } - else if (this.actParameterPanel.ctMountain_ClearIn.n現在の値 <= 515) - { - TJAPlayer3.Tx.Result_Mountain[mountainTexId + 1].vc拡大縮小倍率.Y = 0.9f + (float)Math.Sin((float)(this.actParameterPanel.ctMountain_ClearIn.n現在の値 - 335) * (Math.PI / 180)) * 0.4f; + TJAPlayer3.Tx.Result_Background[1].Opacity = gaugeAnimFactors; + TJAPlayer3.Tx.Result_Background[1].t2D描画(width1 * i, 0, new Rectangle(width1 * i, 0, width1, height1)); } } - - #endregion - } - else if (is1P) - { - - TJAPlayer3.Tx.Result_Background[1].Opacity = 0; - TJAPlayer3.Tx.Result_Mountain[mountainTexId + 0].Opacity = 255; - TJAPlayer3.Tx.Result_Mountain[mountainTexId + 1].Opacity = 0; - } - - #region [Display background] - - if (is1P) - { - if (is2PSide) - TJAPlayer3.Tx.Result_Background[2].t2D描画(0, 0); - else - TJAPlayer3.Tx.Result_Background[0].t2D描画(0, 0); - TJAPlayer3.Tx.Result_Background[1].t2D描画(0, 0); } else { - if (TJAPlayer3.ConfigIni.nPlayerCount <= 2) + CTexture[] texs = new CTexture[5] { + TJAPlayer3.Tx.Result_Background[0], + TJAPlayer3.Tx.Result_Background[2], + TJAPlayer3.Tx.Result_Background[3], + TJAPlayer3.Tx.Result_Background[4], + TJAPlayer3.Tx.Result_Background[5] + }; + int count = Math.Max(TJAPlayer3.ConfigIni.nPlayerCount, 4); + for (int i = 0; i < count; i++) { - gaugeAnimFactors = (this.actParameterPanel.ct全体進行.n現在の値 - (int)MountainAppearValue) * 3; - - int width1 = TJAPlayer3.Tx.Result_Background[1].szテクスチャサイズ.Width / 2; - int height1 = TJAPlayer3.Tx.Result_Background[1].szテクスチャサイズ.Height; - - for (int i = 0; i < 2; i++) + if (bClear[i]) { - int width2 = TJAPlayer3.Tx.Result_Background[2 * i].szテクスチャサイズ.Width / 2; - int height2 = TJAPlayer3.Tx.Result_Background[2 * i].szテクスチャサイズ.Height; - TJAPlayer3.Tx.Result_Background[2 * i].t2D描画(width2 * i, 0, new Rectangle(width2 * i, 0, width2, height2)); - - if (bClear[i]) - { - TJAPlayer3.Tx.Result_Background[1].Opacity = gaugeAnimFactors; - TJAPlayer3.Tx.Result_Background[1].t2D描画(width1 * i, 0, new Rectangle(width1 * i, 0, width1, height1)); - } - } - } - else - { - CTexture[] texs = new CTexture[5] { - TJAPlayer3.Tx.Result_Background[0], - TJAPlayer3.Tx.Result_Background[2], - TJAPlayer3.Tx.Result_Background[3], - TJAPlayer3.Tx.Result_Background[4], - TJAPlayer3.Tx.Result_Background[5] - }; - int count = Math.Max(TJAPlayer3.ConfigIni.nPlayerCount, 4); - for (int i = 0; i < count; i++) - { - if (bClear[i]) - { - gaugeAnimFactors = (this.actParameterPanel.ct全体進行.n現在の値 - (int)MountainAppearValue) * 3; - TJAPlayer3.Tx.Result_Background[1].Opacity = gaugeAnimFactors; - } - int width = texs[i].szテクスチャサイズ.Width / count; - texs[i].t2D描画(width * i, 0, new RectangleF(width * i, 0, width, texs[i].szテクスチャサイズ.Height)); - if (bClear[i]) - TJAPlayer3.Tx.Result_Background[1].t2D描画(width * i, 0, new RectangleF(width * i, 0, width, texs[i].szテクスチャサイズ.Height)); + gaugeAnimFactors = (this.actParameterPanel.ct全体進行.n現在の値 - (int)MountainAppearValue) * 3; + TJAPlayer3.Tx.Result_Background[1].Opacity = gaugeAnimFactors; } + int width = texs[i].szテクスチャサイズ.Width / count; + texs[i].t2D描画(width * i, 0, new RectangleF(width * i, 0, width, texs[i].szテクスチャサイズ.Height)); + if (bClear[i]) + TJAPlayer3.Tx.Result_Background[1].t2D描画(width * i, 0, new RectangleF(width * i, 0, width, texs[i].szテクスチャサイズ.Height)); } + } + } + + #endregion + + if (is1P) + { + TJAPlayer3.Tx.Result_Mountain[mountainTexId + 0].t2D描画(0, 0); + TJAPlayer3.Tx.Result_Mountain[mountainTexId + 1].t2D拡大率考慮下基準描画(0, TJAPlayer3.Tx.Result_Mountain[mountainTexId + 1].szテクスチャサイズ.Height); + + // TJAPlayer3.act文字コンソール.tPrint(0, 0, C文字コンソール.Eフォント種別.白, ctShine_Plate.n現在の値.ToString()); + // TJAPlayer3.act文字コンソール.tPrint(10, 10, C文字コンソール.Eフォント種別.白, this.actParameterPanel.ct全体進行.n現在の値.ToString()); + + #region [Background Clouds] + + if (bClear[0] && this.actParameterPanel.ct全体進行.n現在の値 >= MountainAppearValue) + { + CloudType = Math.Min(255, Math.Max(0, (int)this.actParameterPanel.ct全体進行.n現在の値 - (int)MountainAppearValue)); + } + + int cloud_width = TJAPlayer3.Tx.Result_Cloud.szテクスチャサイズ.Width / TJAPlayer3.Skin.Result_Cloud_Count; + int cloud_height = TJAPlayer3.Tx.Result_Cloud.szテクスチャサイズ.Height / 3; + + for (int i = TJAPlayer3.Skin.Result_Cloud_Count - 1; i >= 0; i--) + { + int CurMoveRed = (int)((double)TJAPlayer3.Skin.Result_Cloud_MaxMove[i] * Math.Tanh((double)this.actParameterPanel.ct全体進行.n現在の値 / 10000)); + int CurMoveGold = (int)((double)TJAPlayer3.Skin.Result_Cloud_MaxMove[i] * Math.Tanh(Math.Max(0, (double)this.actParameterPanel.ct全体進行.n現在の値 - (double)MountainAppearValue) / 10000)); + + int cloudOffset = (is2PSide) ? cloud_height * 2 : 0; + + TJAPlayer3.Tx.Result_Cloud.vc拡大縮小倍率.X = 0.65f; + TJAPlayer3.Tx.Result_Cloud.vc拡大縮小倍率.Y = 0.65f; + TJAPlayer3.Tx.Result_Cloud.Opacity = CloudType; + + TJAPlayer3.Tx.Result_Cloud.t2D拡大率考慮中央基準描画(TJAPlayer3.Skin.Result_Cloud_X[i] - CurMoveGold, TJAPlayer3.Skin.Result_Cloud_Y[i], + new Rectangle(i * cloud_width, cloud_height, cloud_width, cloud_height)); + + TJAPlayer3.Tx.Result_Cloud.Opacity = 255 - CloudType; + + TJAPlayer3.Tx.Result_Cloud.t2D拡大率考慮中央基準描画(TJAPlayer3.Skin.Result_Cloud_X[i] - CurMoveRed, TJAPlayer3.Skin.Result_Cloud_Y[i], + new Rectangle(i * cloud_width, cloudOffset, cloud_width, cloud_height)); } #endregion - if (is1P) + if (bClear[0] && this.actParameterPanel.ct全体進行.n現在の値 >= MountainAppearValue) { - TJAPlayer3.Tx.Result_Mountain[mountainTexId + 0].t2D描画(0, 0); - TJAPlayer3.Tx.Result_Mountain[mountainTexId + 1].t2D拡大率考慮下基準描画(0, TJAPlayer3.Tx.Result_Mountain[mountainTexId + 1].szテクスチャサイズ.Height); - // TJAPlayer3.act文字コンソール.tPrint(0, 0, C文字コンソール.Eフォント種別.白, ctShine_Plate.n現在の値.ToString()); - // TJAPlayer3.act文字コンソール.tPrint(10, 10, C文字コンソール.Eフォント種別.白, this.actParameterPanel.ct全体進行.n現在の値.ToString()); + #region [Background shines] - #region [Background Clouds] + int ShineTime = (int)ctShine_Plate.n現在の値; + int Quadrant500 = ShineTime % 500; - if (bClear[0] && this.actParameterPanel.ct全体進行.n現在の値 >= MountainAppearValue) + for (int i = 0; i < TJAPlayer3.Skin.Result_Shine_Count; i++) { - CloudType = Math.Min(255, Math.Max(0, (int)this.actParameterPanel.ct全体進行.n現在の値 - (int)MountainAppearValue)); - } + if (i < 2 && ShineTime >= 500 || i >= 2 && ShineTime < 500) + TJAPlayer3.Tx.Result_Shine.Opacity = 0; + else if (Quadrant500 >= ShinePFade && Quadrant500 <= 500 - ShinePFade) + TJAPlayer3.Tx.Result_Shine.Opacity = 255; + else + TJAPlayer3.Tx.Result_Shine.Opacity = (255 * Math.Min(Quadrant500, 500 - Quadrant500)) / ShinePFade; - int cloud_width = TJAPlayer3.Tx.Result_Cloud.szテクスチャサイズ.Width / TJAPlayer3.Skin.Result_Cloud_Count; - int cloud_height = TJAPlayer3.Tx.Result_Cloud.szテクスチャサイズ.Height / 3; + TJAPlayer3.Tx.Result_Shine.vc拡大縮小倍率.X = TJAPlayer3.Skin.Result_Shine_Size[i]; + TJAPlayer3.Tx.Result_Shine.vc拡大縮小倍率.Y = TJAPlayer3.Skin.Result_Shine_Size[i]; - for (int i = TJAPlayer3.Skin.Result_Cloud_Count - 1; i >= 0; i--) - { - int CurMoveRed = (int)((double)TJAPlayer3.Skin.Result_Cloud_MaxMove[i] * Math.Tanh((double)this.actParameterPanel.ct全体進行.n現在の値 / 10000)); - int CurMoveGold = (int)((double)TJAPlayer3.Skin.Result_Cloud_MaxMove[i] * Math.Tanh(Math.Max(0, (double)this.actParameterPanel.ct全体進行.n現在の値 - (double)MountainAppearValue) / 10000)); - - int cloudOffset = (is2PSide) ? cloud_height * 2 : 0; - - TJAPlayer3.Tx.Result_Cloud.vc拡大縮小倍率.X = 0.65f; - TJAPlayer3.Tx.Result_Cloud.vc拡大縮小倍率.Y = 0.65f; - TJAPlayer3.Tx.Result_Cloud.Opacity = CloudType; - - TJAPlayer3.Tx.Result_Cloud.t2D拡大率考慮中央基準描画(TJAPlayer3.Skin.Result_Cloud_X[i] - CurMoveGold, TJAPlayer3.Skin.Result_Cloud_Y[i], - new Rectangle(i * cloud_width, cloud_height, cloud_width, cloud_height)); - - TJAPlayer3.Tx.Result_Cloud.Opacity = 255 - CloudType; - - TJAPlayer3.Tx.Result_Cloud.t2D拡大率考慮中央基準描画(TJAPlayer3.Skin.Result_Cloud_X[i] - CurMoveRed, TJAPlayer3.Skin.Result_Cloud_Y[i], - new Rectangle(i * cloud_width, cloudOffset, cloud_width, cloud_height)); + TJAPlayer3.Tx.Result_Shine.t2D中心基準描画(TJAPlayer3.Skin.Result_Shine_X[is2PSide ? 1 : 0][i], TJAPlayer3.Skin.Result_Shine_Y[is2PSide ? 1 : 0][i]); } #endregion - if (bClear[0] && this.actParameterPanel.ct全体進行.n現在の値 >= MountainAppearValue) + #region [Fireworks] + + // Primary pop + if (this.actParameterPanel.ct全体進行.n現在の値 <= MountainAppearValue + 1000) { - - #region [Background shines] - - int ShineTime = (int)ctShine_Plate.n現在の値; - int Quadrant500 = ShineTime % 500; - - for (int i = 0; i < TJAPlayer3.Skin.Result_Shine_Count; i++) + for (int i = 0; i < 3; i++) { - if (i < 2 && ShineTime >= 500 || i >= 2 && ShineTime < 500) - TJAPlayer3.Tx.Result_Shine.Opacity = 0; - else if (Quadrant500 >= ShinePFade && Quadrant500 <= 500 - ShinePFade) - TJAPlayer3.Tx.Result_Shine.Opacity = 255; + if (this.actParameterPanel.ct全体進行.n現在の値 <= MountainAppearValue + 255) + { + int TmpTimer = (int)(this.actParameterPanel.ct全体進行.n現在の値 - MountainAppearValue); + + TJAPlayer3.Tx.Result_Work[i].Opacity = TmpTimer; + TJAPlayer3.Tx.Result_Work[i].vc拡大縮小倍率.X = 0.6f * ((float)TmpTimer / 225f); + TJAPlayer3.Tx.Result_Work[i].vc拡大縮小倍率.Y = 0.6f * ((float)TmpTimer / 225f); + } else - TJAPlayer3.Tx.Result_Shine.Opacity = (255 * Math.Min(Quadrant500, 500 - Quadrant500)) / ShinePFade; - - TJAPlayer3.Tx.Result_Shine.vc拡大縮小倍率.X = TJAPlayer3.Skin.Result_Shine_Size[i]; - TJAPlayer3.Tx.Result_Shine.vc拡大縮小倍率.Y = TJAPlayer3.Skin.Result_Shine_Size[i]; - - TJAPlayer3.Tx.Result_Shine.t2D中心基準描画(TJAPlayer3.Skin.Result_Shine_X[is2PSide ? 1 : 0][i], TJAPlayer3.Skin.Result_Shine_Y[is2PSide ? 1 : 0][i]); - } - - #endregion - - #region [Fireworks] - - // Primary pop - if (this.actParameterPanel.ct全体進行.n現在の値 <= MountainAppearValue + 1000) - { - for (int i = 0; i < 3; i++) { - if (this.actParameterPanel.ct全体進行.n現在の値 <= MountainAppearValue + 255) - { - int TmpTimer = (int)(this.actParameterPanel.ct全体進行.n現在の値 - MountainAppearValue); + int TmpTimer = Math.Max(0, (2 * 255) - (int)(this.actParameterPanel.ct全体進行.n現在の値 - MountainAppearValue - 255)); - TJAPlayer3.Tx.Result_Work[i].Opacity = TmpTimer; - TJAPlayer3.Tx.Result_Work[i].vc拡大縮小倍率.X = 0.6f * ((float)TmpTimer / 225f); - TJAPlayer3.Tx.Result_Work[i].vc拡大縮小倍率.Y = 0.6f * ((float)TmpTimer / 225f); - } - else - { - int TmpTimer = Math.Max(0, (2 * 255) - (int)(this.actParameterPanel.ct全体進行.n現在の値 - MountainAppearValue - 255)); - - TJAPlayer3.Tx.Result_Work[i].Opacity = TmpTimer / 2; - TJAPlayer3.Tx.Result_Work[i].vc拡大縮小倍率.X = 0.6f; - TJAPlayer3.Tx.Result_Work[i].vc拡大縮小倍率.Y = 0.6f; - } - - TJAPlayer3.Tx.Result_Work[i].t2D拡大率考慮中央基準描画(TJAPlayer3.Skin.Result_Work_X[is2PSide ? 1 : 0][i], TJAPlayer3.Skin.Result_Work_Y[is2PSide ? 1 : 0][i]); + TJAPlayer3.Tx.Result_Work[i].Opacity = TmpTimer / 2; + TJAPlayer3.Tx.Result_Work[i].vc拡大縮小倍率.X = 0.6f; + TJAPlayer3.Tx.Result_Work[i].vc拡大縮小倍率.Y = 0.6f; } + + TJAPlayer3.Tx.Result_Work[i].t2D拡大率考慮中央基準描画(TJAPlayer3.Skin.Result_Work_X[is2PSide ? 1 : 0][i], TJAPlayer3.Skin.Result_Work_Y[is2PSide ? 1 : 0][i]); } - else - { - ctWork_Plate.t進行Loop(); - - for (int i = 0; i < 3; i++) - { - int TmpStamp = WorksTimeStamp[i]; - - if (ctWork_Plate.n現在の値 <= TmpStamp + 255) - { - int TmpTimer = (int)(ctWork_Plate.n現在の値 - TmpStamp); - - TJAPlayer3.Tx.Result_Work[i].Opacity = TmpTimer; - TJAPlayer3.Tx.Result_Work[i].vc拡大縮小倍率.X = 0.6f * ((float)TmpTimer / 225f); - TJAPlayer3.Tx.Result_Work[i].vc拡大縮小倍率.Y = 0.6f * ((float)TmpTimer / 225f); - } - else - { - int TmpTimer = Math.Max(0, (2 * 255) - (int)(ctWork_Plate.n現在の値 - TmpStamp - 255)); - - TJAPlayer3.Tx.Result_Work[i].Opacity = TmpTimer / 2; - TJAPlayer3.Tx.Result_Work[i].vc拡大縮小倍率.X = 0.6f; - TJAPlayer3.Tx.Result_Work[i].vc拡大縮小倍率.Y = 0.6f; - } - - TJAPlayer3.Tx.Result_Work[i].t2D拡大率考慮中央基準描画(TJAPlayer3.Skin.Result_Work_X[is2PSide ? 1 : 0][i], TJAPlayer3.Skin.Result_Work_Y[is2PSide ? 1 : 0][i]); - } - } - - #endregion - } + else + { + ctWork_Plate.t進行Loop(); + + for (int i = 0; i < 3; i++) + { + int TmpStamp = WorksTimeStamp[i]; + + if (ctWork_Plate.n現在の値 <= TmpStamp + 255) + { + int TmpTimer = (int)(ctWork_Plate.n現在の値 - TmpStamp); + + TJAPlayer3.Tx.Result_Work[i].Opacity = TmpTimer; + TJAPlayer3.Tx.Result_Work[i].vc拡大縮小倍率.X = 0.6f * ((float)TmpTimer / 225f); + TJAPlayer3.Tx.Result_Work[i].vc拡大縮小倍率.Y = 0.6f * ((float)TmpTimer / 225f); + } + else + { + int TmpTimer = Math.Max(0, (2 * 255) - (int)(ctWork_Plate.n現在の値 - TmpStamp - 255)); + + TJAPlayer3.Tx.Result_Work[i].Opacity = TmpTimer / 2; + TJAPlayer3.Tx.Result_Work[i].vc拡大縮小倍率.X = 0.6f; + TJAPlayer3.Tx.Result_Work[i].vc拡大縮小倍率.Y = 0.6f; + } + + TJAPlayer3.Tx.Result_Work[i].t2D拡大率考慮中央基準描画(TJAPlayer3.Skin.Result_Work_X[is2PSide ? 1 : 0][i], TJAPlayer3.Skin.Result_Work_Y[is2PSide ? 1 : 0][i]); + } + } + + #endregion + } } - */ - if (OpenTaiko.Tx.Result_Header != null) { - OpenTaiko.Tx.Result_Header.t2D描画(0, 0); + } + */ + if (OpenTaiko.Tx.Result_Header != null) { + OpenTaiko.Tx.Result_Header.t2D描画(0, 0); + } + } + + if (this.ct登場用.IsTicked && (OpenTaiko.Tx.Result_Header != null)) { + double num2 = ((double)this.ct登場用.CurrentValue) / 100.0; + double num3 = Math.Sin(Math.PI / 2 * num2); + + // num = ((int)(TJAPlayer3.Tx.Result_Header.sz画像サイズ.Height * num3)) - TJAPlayer3.Tx.Result_Header.sz画像サイズ.Height; + } + /* + else + { + num = 0; + } + */ + + if (!b音声再生 && !bgmResultIn.bIsPlaying) { + bgmResultLoop.tPlay(); + b音声再生 = true; + } + + + #endregion + + } else { + if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) { + double screen_ratio_x = OpenTaiko.Skin.Resolution[0] / 1280.0; + + #region [Counter processings] + + int songCount = OpenTaiko.stageSongSelect.rChoosenSong.DanSongs.Count; + + /* + ** 1600 => Dan plate + ** 3200 + 300 * count => Songs display + ** 5500 + 300 * count => Exams plate display + ** 8200 + 300 * count => Goukaku/Fugoukaku display => Step 2 (Prompt the user to tap enter and let them swaping between informations hitting kas) + ** ??? => Success/Fail animation + */ + if (ctPhase1 == null) { + ctPhase1 = new CCounter(0, 8200 + songCount * 300, 0.5f, OpenTaiko.Timer); + ctPhase1.CurrentValue = 0; + } + + ctPhase1.Tick(); + + if (ctPhase2 != null) + ctPhase2.Tick(); + + #endregion + + + #region [DaniDoujou result screen] + + if (!b音声再生 && !OpenTaiko.Skin.bgmDanResult.bIsPlaying) { + OpenTaiko.Skin.bgmDanResult.tPlay(); + b音声再生 = true; + } + + //DanResult_Background.t2D描画(0, 0); + OpenTaiko.Tx.DanResult_SongPanel_Base.t2D描画(0, 0); + + #region [DanPlate] + + // To add : Animation at 1 sec + + Dan_Plate?.t2D中心基準描画(138, 220); + + int plateOffset = Math.Max(0, 1600 - ctPhase1.CurrentValue) * 2; + + CActSelect段位リスト.tDisplayDanPlate(Dan_Plate, + null, + 138, + 220 - plateOffset); + + #endregion + + #region [Charts Individual Results] + + ctDanSongInfoChange.Tick(); + + if (ctDanSongInfoChange.CurrentValue == ctDanSongInfoChange.EndValue && songCount > 3) { + NextDanSongInfo(); + } else if (nNowDanSongInfo > 0 && songCount <= 3) { + nNowDanSongInfo = 0; + } + + for (int i = 0; i < songCount; i++) { + int songOffset = (int)(Math.Max(0, 3200 + 300 * i - ctPhase1.CurrentValue) * screen_ratio_x); + + int quadrant = i / 3; + if (quadrant == nNowDanSongInfo) + ftDanDisplaySongInfo(i, songOffset); + } + + #endregion + + #region [Exam informations] + + int examsOffset = 0; + + if (ctPhase2 != null && examsShift != 0) + examsOffset = (examsShift < 0) ? 1280 - ctPhase2.CurrentValue : ctPhase2.CurrentValue; + else if (ctPhase1.IsUnEnded) + examsOffset = Math.Max(0, 5500 + 300 * songCount - ctPhase1.CurrentValue) * 2; + + examsOffset = (int)(examsOffset * screen_ratio_x); + + ftDanDisplayExamInfo(examsOffset); + + #endregion + + #region [PassLogo] + + Exam.Status examStatus = OpenTaiko.stage演奏ドラム画面.actDan.GetExamStatus(OpenTaiko.stage結果.st演奏記録.Drums.Dan_C); + + int unitsBeforeAppearance = Math.Max(0, 8200 + 300 * songCount - ctPhase1.CurrentValue); + + if (unitsBeforeAppearance <= 270) { + OpenTaiko.Tx.DanResult_Rank.Opacity = 255; + + int rank_width = OpenTaiko.Tx.DanResult_Rank.szTextureSize.Width / 7; + int rank_height = OpenTaiko.Tx.DanResult_Rank.szTextureSize.Height; + + if (examStatus != Exam.Status.Failure) { + #region [Goukaku] + + #region [ Appear animation ] + + if (unitsBeforeAppearance >= 90) { + OpenTaiko.Tx.DanResult_Rank.Opacity = (int)((270 - unitsBeforeAppearance) / 180.0f * 255.0f); + OpenTaiko.Tx.DanResult_Rank.vcScaleRatio.X = 1.0f + (float)Math.Sin((360 - unitsBeforeAppearance) / 1.5f * (Math.PI / 180)) * 1.4f; + OpenTaiko.Tx.DanResult_Rank.vcScaleRatio.Y = 1.0f + (float)Math.Sin((360 - unitsBeforeAppearance) / 1.5f * (Math.PI / 180)) * 1.4f; + } else if (unitsBeforeAppearance > 0) { + OpenTaiko.Tx.Result_ScoreRankEffect.vcScaleRatio.X = 0.5f + (float)Math.Sin((float)(90 - unitsBeforeAppearance) * (Math.PI / 180)) * 0.5f; + OpenTaiko.Tx.Result_ScoreRankEffect.vcScaleRatio.Y = 0.5f + (float)Math.Sin((float)(90 - unitsBeforeAppearance) * (Math.PI / 180)) * 0.5f; + } else { + OpenTaiko.Tx.DanResult_Rank.vcScaleRatio.X = 1f; + OpenTaiko.Tx.DanResult_Rank.vcScaleRatio.Y = 1f; + } + + #endregion + + #region [ Goukaku plate type calculus ] + + int successType = 0; + + if (examStatus == Exam.Status.Better_Success) + successType += 1; + + int comboType = 0; + if (this.st演奏記録.Drums.nBadCount == 0) { + comboType += 1; + + if (this.st演奏記録.Drums.nOkCount == 0) + comboType += 1; + } + + #endregion + + OpenTaiko.Tx.DanResult_Rank.t2D拡大率考慮中央基準描画(OpenTaiko.Skin.DanResult_Rank[0], OpenTaiko.Skin.DanResult_Rank[1], + new Rectangle(rank_width * (2 * comboType + successType + 1), 0, rank_width, rank_height)); + + #endregion + } else { + #region [Fugoukaku] + + #region [ Appear animation ] + + if (unitsBeforeAppearance >= 90) { + OpenTaiko.Tx.DanResult_Rank.Opacity = (int)((270 - unitsBeforeAppearance) / 180.0f * 255.0f); + } + + OpenTaiko.Tx.DanResult_Rank.vcScaleRatio.X = 1f; + OpenTaiko.Tx.DanResult_Rank.vcScaleRatio.Y = 1f; + + #endregion + + OpenTaiko.Tx.DanResult_Rank.t2D拡大率考慮中央基準描画(OpenTaiko.Skin.DanResult_Rank[0], OpenTaiko.Skin.DanResult_Rank[1] - (unitsBeforeAppearance / 10f), + new Rectangle(0, 0, rank_width, rank_height)); + + #endregion } } - if (this.ct登場用.IsTicked && (OpenTaiko.Tx.Result_Header != null)) { - double num2 = ((double)this.ct登場用.CurrentValue) / 100.0; - double num3 = Math.Sin(Math.PI / 2 * num2); + #endregion - // num = ((int)(TJAPlayer3.Tx.Result_Header.sz画像サイズ.Height * num3)) - TJAPlayer3.Tx.Result_Header.sz画像サイズ.Height; + if (!b音声再生 && !OpenTaiko.Skin.bgmDanResult.bIsPlaying) { + OpenTaiko.Skin.bgmDanResult.tPlay(); + b音声再生 = true; } - /* - else - { - num = 0; - } - */ - if (!b音声再生 && !bgmResultIn.bIsPlaying) { - bgmResultLoop.tPlay(); + #endregion + + } else { + #region [Tower result screen] + + if (!b音声再生 && !OpenTaiko.Skin.bgmTowerResult.bIsPlaying) { + OpenTaiko.Skin.bgmTowerResult.tPlay(); + b音声再生 = true; + } + + // Pictures here + + this.ctTower_Animation.Tick(); + + #region [Tower background] + + if (OpenTaiko.Skin.Game_Tower_Ptn_Result > 0) { + int xFactor = 0; + float yFactor = 1f; + + int currentTowerType = Array.IndexOf(OpenTaiko.Skin.Game_Tower_Names, OpenTaiko.stageSongSelect.rChoosenSong.arスコア[5].譜面情報.nTowerType); + + if (currentTowerType < 0 || currentTowerType >= OpenTaiko.Skin.Game_Tower_Ptn_Result) + currentTowerType = 0; + + if (OpenTaiko.Tx.TowerResult_Background != null && OpenTaiko.Tx.TowerResult_Tower[currentTowerType] != null) { + xFactor = (OpenTaiko.Tx.TowerResult_Background.szTextureSize.Width - OpenTaiko.Tx.TowerResult_Tower[currentTowerType].szTextureSize.Width) / 2; + yFactor = OpenTaiko.Tx.TowerResult_Tower[currentTowerType].szTextureSize.Height / (float)OpenTaiko.Tx.TowerResult_Background.szTextureSize.Height; + } + + OpenTaiko.Tx.TowerResult_Background?.t2D描画(0, -1 * this.ctTower_Animation.CurrentValue); + OpenTaiko.Tx.TowerResult_Tower[currentTowerType]?.t2D描画(xFactor, -1 * yFactor * this.ctTower_Animation.CurrentValue); + } + + #endregion + + OpenTaiko.Tx.TowerResult_Panel?.t2D描画(0, 0); + + #region [Score Rank] + + int sc = GetTowerScoreRank() - 1; + + OpenTaiko.actTextConsole.Print(0, 40, CTextConsole.EFontType.White, sc.ToString()); + + if (sc >= 0 && OpenTaiko.Tx.TowerResult_ScoreRankEffect != null) { + int scoreRankEffect_width = OpenTaiko.Tx.TowerResult_ScoreRankEffect.szTextureSize.Width / 7; + int scoreRankEffect_height = OpenTaiko.Tx.TowerResult_ScoreRankEffect.szTextureSize.Height; + + OpenTaiko.Tx.TowerResult_ScoreRankEffect.Opacity = 255; + OpenTaiko.Tx.TowerResult_ScoreRankEffect.vcScaleRatio.X = 1f; + OpenTaiko.Tx.TowerResult_ScoreRankEffect.vcScaleRatio.Y = 1f; + OpenTaiko.Tx.TowerResult_ScoreRankEffect.t2D拡大率考慮中央基準描画( + OpenTaiko.Skin.TowerResult_ScoreRankEffect[0], + OpenTaiko.Skin.TowerResult_ScoreRankEffect[1], + new Rectangle(sc * scoreRankEffect_width, 0, scoreRankEffect_width, scoreRankEffect_height)); + } + + + #endregion + + + #region [Text elements] + + TitleTextureKey.ResolveTitleTexture(this.ttkToutatsu)?.t2D描画(OpenTaiko.Skin.TowerResult_Toutatsu[0], OpenTaiko.Skin.TowerResult_Toutatsu[1]); + TitleTextureKey.ResolveTitleTexture(this.ttkMaxFloors)?.t2D描画(OpenTaiko.Skin.TowerResult_MaxFloors[0], OpenTaiko.Skin.TowerResult_MaxFloors[1]); + TitleTextureKey.ResolveTitleTexture(this.ttkTen)?.t2D描画(OpenTaiko.Skin.TowerResult_Ten[0], OpenTaiko.Skin.TowerResult_Ten[1]); + TitleTextureKey.ResolveTitleTexture(this.ttkScore)?.t2D描画(OpenTaiko.Skin.TowerResult_Score[0], OpenTaiko.Skin.TowerResult_Score[1]); + + CTexture tmpScoreCount = TitleTextureKey.ResolveTitleTexture(this.ttkScoreCount); + CTexture tmpCurrentFloor = TitleTextureKey.ResolveTitleTexture(this.ttkReachedFloor); + CTexture tmpRemainingLifes = TitleTextureKey.ResolveTitleTexture(this.ttkRemaningLifes); + + tmpCurrentFloor?.t2D描画(OpenTaiko.Skin.TowerResult_CurrentFloor[0] - tmpCurrentFloor.szTextureSize.Width, OpenTaiko.Skin.TowerResult_CurrentFloor[1]); + tmpScoreCount?.t2D描画(OpenTaiko.Skin.TowerResult_ScoreCount[0] - tmpScoreCount.szTextureSize.Width, OpenTaiko.Skin.TowerResult_ScoreCount[1]); + tmpRemainingLifes?.t2D描画(OpenTaiko.Skin.TowerResult_RemainingLifes[0] - tmpRemainingLifes.szTextureSize.Width, OpenTaiko.Skin.TowerResult_RemainingLifes[1]); + + int soul_width = OpenTaiko.Tx.Gauge_Soul.szTextureSize.Width; + int soul_height = OpenTaiko.Tx.Gauge_Soul.szTextureSize.Height / 2; + + OpenTaiko.Tx.Gauge_Soul?.t2D描画(OpenTaiko.Skin.TowerResult_Gauge_Soul[0], OpenTaiko.Skin.TowerResult_Gauge_Soul[1], new Rectangle(0, 0, soul_width, soul_height)); + + #endregion + + if (!b音声再生 && !OpenTaiko.Skin.bgmTowerResult.bIsPlaying) { + OpenTaiko.Skin.bgmTowerResult.tPlay(); b音声再生 = true; } #endregion + } + + } + + // Display medals debug + + // TJAPlayer3.act文字コンソール.tPrint(0, 12, C文字コンソール.Eフォント種別.白, this.nEarnedMedalsCount[0].ToString()); + //TJAPlayer3.act文字コンソール.tPrint(0, 25, C文字コンソール.Eフォント種別.白, this.nEarnedMedalsCount[1].ToString()); + + + + if (this.actParameterPanel.Draw() == 0) { + this.bアニメが完了 = false; + } + + if (this.actSongBar.Draw() == 0) { + this.bアニメが完了 = false; + } + + #region Nameplate + + for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { + if (OpenTaiko.ConfigIni.bAIBattleMode && i == 1) break; + + int pos = i; + if (OpenTaiko.P1IsBlue() && OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] < (int)Difficulty.Tower) + pos = 1; + + int namePlate_x; + int namePlate_y; + int modIcons_x; + int modIcons_y; + + if (OpenTaiko.ConfigIni.nPlayerCount == 5) { + namePlate_x = OpenTaiko.Skin.Result_NamePlate_5P[0] + OpenTaiko.Skin.Result_UIMove_5P_X[pos]; + namePlate_y = OpenTaiko.Skin.Result_NamePlate_5P[1] + OpenTaiko.Skin.Result_UIMove_5P_Y[pos]; + modIcons_x = OpenTaiko.Skin.Result_ModIcons_5P[0] + OpenTaiko.Skin.Result_UIMove_5P_X[pos]; + modIcons_y = OpenTaiko.Skin.Result_ModIcons_5P[1] + OpenTaiko.Skin.Result_UIMove_5P_Y[pos]; + } else if (OpenTaiko.ConfigIni.nPlayerCount == 4 || OpenTaiko.ConfigIni.nPlayerCount == 3) { + namePlate_x = OpenTaiko.Skin.Result_NamePlate_4P[0] + OpenTaiko.Skin.Result_UIMove_4P_X[pos]; + namePlate_y = OpenTaiko.Skin.Result_NamePlate_4P[1] + OpenTaiko.Skin.Result_UIMove_4P_Y[pos]; + modIcons_x = OpenTaiko.Skin.Result_ModIcons_4P[0] + OpenTaiko.Skin.Result_UIMove_4P_X[pos]; + modIcons_y = OpenTaiko.Skin.Result_ModIcons_4P[1] + OpenTaiko.Skin.Result_UIMove_4P_Y[pos]; } else { - if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) { - double screen_ratio_x = OpenTaiko.Skin.Resolution[0] / 1280.0; - - #region [Counter processings] - - int songCount = OpenTaiko.stageSongSelect.rChoosenSong.DanSongs.Count; - - /* - ** 1600 => Dan plate - ** 3200 + 300 * count => Songs display - ** 5500 + 300 * count => Exams plate display - ** 8200 + 300 * count => Goukaku/Fugoukaku display => Step 2 (Prompt the user to tap enter and let them swaping between informations hitting kas) - ** ??? => Success/Fail animation - */ - if (ctPhase1 == null) { - ctPhase1 = new CCounter(0, 8200 + songCount * 300, 0.5f, OpenTaiko.Timer); - ctPhase1.CurrentValue = 0; - } - - ctPhase1.Tick(); - - if (ctPhase2 != null) - ctPhase2.Tick(); - - #endregion - - - #region [DaniDoujou result screen] - - if (!b音声再生 && !OpenTaiko.Skin.bgmDanResult.bIsPlaying) { - OpenTaiko.Skin.bgmDanResult.tPlay(); - b音声再生 = true; - } - - //DanResult_Background.t2D描画(0, 0); - OpenTaiko.Tx.DanResult_SongPanel_Base.t2D描画(0, 0); - - #region [DanPlate] - - // To add : Animation at 1 sec - - Dan_Plate?.t2D中心基準描画(138, 220); - - int plateOffset = Math.Max(0, 1600 - ctPhase1.CurrentValue) * 2; - - CActSelect段位リスト.tDisplayDanPlate(Dan_Plate, - null, - 138, - 220 - plateOffset); - - #endregion - - #region [Charts Individual Results] - - ctDanSongInfoChange.Tick(); - - if (ctDanSongInfoChange.CurrentValue == ctDanSongInfoChange.EndValue && songCount > 3) { - NextDanSongInfo(); - } else if (nNowDanSongInfo > 0 && songCount <= 3) { - nNowDanSongInfo = 0; - } - - for (int i = 0; i < songCount; i++) { - int songOffset = (int)(Math.Max(0, 3200 + 300 * i - ctPhase1.CurrentValue) * screen_ratio_x); - - int quadrant = i / 3; - if (quadrant == nNowDanSongInfo) - ftDanDisplaySongInfo(i, songOffset); - } - - #endregion - - #region [Exam informations] - - int examsOffset = 0; - - if (ctPhase2 != null && examsShift != 0) - examsOffset = (examsShift < 0) ? 1280 - ctPhase2.CurrentValue : ctPhase2.CurrentValue; - else if (ctPhase1.IsUnEnded) - examsOffset = Math.Max(0, 5500 + 300 * songCount - ctPhase1.CurrentValue) * 2; - - examsOffset = (int)(examsOffset * screen_ratio_x); - - ftDanDisplayExamInfo(examsOffset); - - #endregion - - #region [PassLogo] - - Exam.Status examStatus = OpenTaiko.stage演奏ドラム画面.actDan.GetExamStatus(OpenTaiko.stage結果.st演奏記録.Drums.Dan_C); - - int unitsBeforeAppearance = Math.Max(0, 8200 + 300 * songCount - ctPhase1.CurrentValue); - - if (unitsBeforeAppearance <= 270) { - OpenTaiko.Tx.DanResult_Rank.Opacity = 255; - - int rank_width = OpenTaiko.Tx.DanResult_Rank.szTextureSize.Width / 7; - int rank_height = OpenTaiko.Tx.DanResult_Rank.szTextureSize.Height; - - if (examStatus != Exam.Status.Failure) { - #region [Goukaku] - - #region [ Appear animation ] - - if (unitsBeforeAppearance >= 90) { - OpenTaiko.Tx.DanResult_Rank.Opacity = (int)((270 - unitsBeforeAppearance) / 180.0f * 255.0f); - OpenTaiko.Tx.DanResult_Rank.vcScaleRatio.X = 1.0f + (float)Math.Sin((360 - unitsBeforeAppearance) / 1.5f * (Math.PI / 180)) * 1.4f; - OpenTaiko.Tx.DanResult_Rank.vcScaleRatio.Y = 1.0f + (float)Math.Sin((360 - unitsBeforeAppearance) / 1.5f * (Math.PI / 180)) * 1.4f; - } else if (unitsBeforeAppearance > 0) { - OpenTaiko.Tx.Result_ScoreRankEffect.vcScaleRatio.X = 0.5f + (float)Math.Sin((float)(90 - unitsBeforeAppearance) * (Math.PI / 180)) * 0.5f; - OpenTaiko.Tx.Result_ScoreRankEffect.vcScaleRatio.Y = 0.5f + (float)Math.Sin((float)(90 - unitsBeforeAppearance) * (Math.PI / 180)) * 0.5f; - } else { - OpenTaiko.Tx.DanResult_Rank.vcScaleRatio.X = 1f; - OpenTaiko.Tx.DanResult_Rank.vcScaleRatio.Y = 1f; - } - - #endregion - - #region [ Goukaku plate type calculus ] - - int successType = 0; - - if (examStatus == Exam.Status.Better_Success) - successType += 1; - - int comboType = 0; - if (this.st演奏記録.Drums.nBadCount == 0) { - comboType += 1; - - if (this.st演奏記録.Drums.nOkCount == 0) - comboType += 1; - } - - #endregion - - OpenTaiko.Tx.DanResult_Rank.t2D拡大率考慮中央基準描画(OpenTaiko.Skin.DanResult_Rank[0], OpenTaiko.Skin.DanResult_Rank[1], - new Rectangle(rank_width * (2 * comboType + successType + 1), 0, rank_width, rank_height)); - - #endregion - } else { - #region [Fugoukaku] - - #region [ Appear animation ] - - if (unitsBeforeAppearance >= 90) { - OpenTaiko.Tx.DanResult_Rank.Opacity = (int)((270 - unitsBeforeAppearance) / 180.0f * 255.0f); - } - - OpenTaiko.Tx.DanResult_Rank.vcScaleRatio.X = 1f; - OpenTaiko.Tx.DanResult_Rank.vcScaleRatio.Y = 1f; - - #endregion - - OpenTaiko.Tx.DanResult_Rank.t2D拡大率考慮中央基準描画(OpenTaiko.Skin.DanResult_Rank[0], OpenTaiko.Skin.DanResult_Rank[1] - (unitsBeforeAppearance / 10f), - new Rectangle(0, 0, rank_width, rank_height)); - - #endregion - } - } - - #endregion - - if (!b音声再生 && !OpenTaiko.Skin.bgmDanResult.bIsPlaying) { - OpenTaiko.Skin.bgmDanResult.tPlay(); - b音声再生 = true; - } - - #endregion - - } else { - #region [Tower result screen] - - if (!b音声再生 && !OpenTaiko.Skin.bgmTowerResult.bIsPlaying) { - OpenTaiko.Skin.bgmTowerResult.tPlay(); - b音声再生 = true; - } - - // Pictures here - - this.ctTower_Animation.Tick(); - - #region [Tower background] - - if (OpenTaiko.Skin.Game_Tower_Ptn_Result > 0) { - int xFactor = 0; - float yFactor = 1f; - - int currentTowerType = Array.IndexOf(OpenTaiko.Skin.Game_Tower_Names, OpenTaiko.stageSongSelect.rChoosenSong.arスコア[5].譜面情報.nTowerType); - - if (currentTowerType < 0 || currentTowerType >= OpenTaiko.Skin.Game_Tower_Ptn_Result) - currentTowerType = 0; - - if (OpenTaiko.Tx.TowerResult_Background != null && OpenTaiko.Tx.TowerResult_Tower[currentTowerType] != null) { - xFactor = (OpenTaiko.Tx.TowerResult_Background.szTextureSize.Width - OpenTaiko.Tx.TowerResult_Tower[currentTowerType].szTextureSize.Width) / 2; - yFactor = OpenTaiko.Tx.TowerResult_Tower[currentTowerType].szTextureSize.Height / (float)OpenTaiko.Tx.TowerResult_Background.szTextureSize.Height; - } - - OpenTaiko.Tx.TowerResult_Background?.t2D描画(0, -1 * this.ctTower_Animation.CurrentValue); - OpenTaiko.Tx.TowerResult_Tower[currentTowerType]?.t2D描画(xFactor, -1 * yFactor * this.ctTower_Animation.CurrentValue); - } - - #endregion - - OpenTaiko.Tx.TowerResult_Panel?.t2D描画(0, 0); - - #region [Score Rank] - - int sc = GetTowerScoreRank() - 1; - - OpenTaiko.actTextConsole.Print(0, 40, CTextConsole.EFontType.White, sc.ToString()); - - if (sc >= 0 && OpenTaiko.Tx.TowerResult_ScoreRankEffect != null) { - int scoreRankEffect_width = OpenTaiko.Tx.TowerResult_ScoreRankEffect.szTextureSize.Width / 7; - int scoreRankEffect_height = OpenTaiko.Tx.TowerResult_ScoreRankEffect.szTextureSize.Height; - - OpenTaiko.Tx.TowerResult_ScoreRankEffect.Opacity = 255; - OpenTaiko.Tx.TowerResult_ScoreRankEffect.vcScaleRatio.X = 1f; - OpenTaiko.Tx.TowerResult_ScoreRankEffect.vcScaleRatio.Y = 1f; - OpenTaiko.Tx.TowerResult_ScoreRankEffect.t2D拡大率考慮中央基準描画( - OpenTaiko.Skin.TowerResult_ScoreRankEffect[0], - OpenTaiko.Skin.TowerResult_ScoreRankEffect[1], - new Rectangle(sc * scoreRankEffect_width, 0, scoreRankEffect_width, scoreRankEffect_height)); - } - - - #endregion - - - #region [Text elements] - - TitleTextureKey.ResolveTitleTexture(this.ttkToutatsu)?.t2D描画(OpenTaiko.Skin.TowerResult_Toutatsu[0], OpenTaiko.Skin.TowerResult_Toutatsu[1]); - TitleTextureKey.ResolveTitleTexture(this.ttkMaxFloors)?.t2D描画(OpenTaiko.Skin.TowerResult_MaxFloors[0], OpenTaiko.Skin.TowerResult_MaxFloors[1]); - TitleTextureKey.ResolveTitleTexture(this.ttkTen)?.t2D描画(OpenTaiko.Skin.TowerResult_Ten[0], OpenTaiko.Skin.TowerResult_Ten[1]); - TitleTextureKey.ResolveTitleTexture(this.ttkScore)?.t2D描画(OpenTaiko.Skin.TowerResult_Score[0], OpenTaiko.Skin.TowerResult_Score[1]); - - CTexture tmpScoreCount = TitleTextureKey.ResolveTitleTexture(this.ttkScoreCount); - CTexture tmpCurrentFloor = TitleTextureKey.ResolveTitleTexture(this.ttkReachedFloor); - CTexture tmpRemainingLifes = TitleTextureKey.ResolveTitleTexture(this.ttkRemaningLifes); - - tmpCurrentFloor?.t2D描画(OpenTaiko.Skin.TowerResult_CurrentFloor[0] - tmpCurrentFloor.szTextureSize.Width, OpenTaiko.Skin.TowerResult_CurrentFloor[1]); - tmpScoreCount?.t2D描画(OpenTaiko.Skin.TowerResult_ScoreCount[0] - tmpScoreCount.szTextureSize.Width, OpenTaiko.Skin.TowerResult_ScoreCount[1]); - tmpRemainingLifes?.t2D描画(OpenTaiko.Skin.TowerResult_RemainingLifes[0] - tmpRemainingLifes.szTextureSize.Width, OpenTaiko.Skin.TowerResult_RemainingLifes[1]); - - int soul_width = OpenTaiko.Tx.Gauge_Soul.szTextureSize.Width; - int soul_height = OpenTaiko.Tx.Gauge_Soul.szTextureSize.Height / 2; - - OpenTaiko.Tx.Gauge_Soul?.t2D描画(OpenTaiko.Skin.TowerResult_Gauge_Soul[0], OpenTaiko.Skin.TowerResult_Gauge_Soul[1], new Rectangle(0, 0, soul_width, soul_height)); - - #endregion - - if (!b音声再生 && !OpenTaiko.Skin.bgmTowerResult.bIsPlaying) { - OpenTaiko.Skin.bgmTowerResult.tPlay(); - b音声再生 = true; - } - - - #endregion - } - - + namePlate_x = OpenTaiko.Skin.Result_NamePlate_X[pos]; + namePlate_y = OpenTaiko.Skin.Result_NamePlate_Y[pos]; + modIcons_x = OpenTaiko.Skin.Result_ModIcons_X[pos]; + modIcons_y = OpenTaiko.Skin.Result_ModIcons_Y[pos]; } - // Display medals debug + OpenTaiko.NamePlate.tNamePlateDraw(namePlate_x, namePlate_y, i); - // TJAPlayer3.act文字コンソール.tPrint(0, 12, C文字コンソール.Eフォント種別.白, this.nEarnedMedalsCount[0].ToString()); - //TJAPlayer3.act文字コンソール.tPrint(0, 25, C文字コンソール.Eフォント種別.白, this.nEarnedMedalsCount[1].ToString()); + #region Mods + + ModIcons.tDisplayModsMenu(modIcons_x, modIcons_y, i); + + #endregion + } + + #endregion - if (this.actParameterPanel.Draw() == 0) { - this.bアニメが完了 = false; + + #region [Display modals] + + if (displayedModals != null) { + lcModal?.Update(); + lcModal?.Draw(); + } + + #endregion + + if (base.ePhaseID == CStage.EPhase.Common_FADEIN) { + if (this.actFI.Draw() != 0) { + base.ePhaseID = CStage.EPhase.Common_NORMAL; } + } else if ((base.ePhaseID == CStage.EPhase.Common_FADEOUT)) //&& ( this.actFO.On進行描画() != 0 ) ) + { + return (int)this.eフェードアウト完了時の戻り値; + } - if (this.actSongBar.Draw() == 0) { - this.bアニメが完了 = false; - } + #region [ #24609 2011.3.14 yyagi ランク更新or演奏型スキル更新時、リザルト画像をpngで保存する ] + if (this.bアニメが完了 == true && this.bIsCheckedWhetherResultScreenShouldSaveOrNot == false // #24609 2011.3.14 yyagi; to save result screen in case BestRank or HiSkill. + && OpenTaiko.ConfigIni.bIsAutoResultCapture) // #25399 2011.6.9 yyagi + { + string strFullPath = + Path.Combine(OpenTaiko.strEXEのあるフォルダ, "Capture_img"); + strFullPath = Path.Combine(strFullPath, DateTime.Now.ToString("yyyyMMddHHmmss") + ".png"); + OpenTaiko.app.SaveResultScreen(strFullPath); - #region Nameplate + this.bIsCheckedWhetherResultScreenShouldSaveOrNot = true; + } + #endregion - for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { - if (OpenTaiko.ConfigIni.bAIBattleMode && i == 1) break; + // キー入力 - int pos = i; - if (OpenTaiko.P1IsBlue() && OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] < (int)Difficulty.Tower) - pos = 1; + if (base.ePhaseID == CStage.EPhase.Common_NORMAL) { + if (OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Escape)) { + #region [ Return to song select screen (Faster method) ] - int namePlate_x; - int namePlate_y; - int modIcons_x; - int modIcons_y; + bgmResultLoop.tStop(); + OpenTaiko.Skin.bgmDanResult.tStop(); + OpenTaiko.Skin.bgmTowerResult.tStop(); + OpenTaiko.Skin.soundDecideSFX.tPlay(); + actFI.tフェードアウト開始(); - if (OpenTaiko.ConfigIni.nPlayerCount == 5) { - namePlate_x = OpenTaiko.Skin.Result_NamePlate_5P[0] + OpenTaiko.Skin.Result_UIMove_5P_X[pos]; - namePlate_y = OpenTaiko.Skin.Result_NamePlate_5P[1] + OpenTaiko.Skin.Result_UIMove_5P_Y[pos]; - modIcons_x = OpenTaiko.Skin.Result_ModIcons_5P[0] + OpenTaiko.Skin.Result_UIMove_5P_X[pos]; - modIcons_y = OpenTaiko.Skin.Result_ModIcons_5P[1] + OpenTaiko.Skin.Result_UIMove_5P_Y[pos]; - } else if (OpenTaiko.ConfigIni.nPlayerCount == 4 || OpenTaiko.ConfigIni.nPlayerCount == 3) { - namePlate_x = OpenTaiko.Skin.Result_NamePlate_4P[0] + OpenTaiko.Skin.Result_UIMove_4P_X[pos]; - namePlate_y = OpenTaiko.Skin.Result_NamePlate_4P[1] + OpenTaiko.Skin.Result_UIMove_4P_Y[pos]; - modIcons_x = OpenTaiko.Skin.Result_ModIcons_4P[0] + OpenTaiko.Skin.Result_UIMove_4P_X[pos]; - modIcons_y = OpenTaiko.Skin.Result_ModIcons_4P[1] + OpenTaiko.Skin.Result_UIMove_4P_Y[pos]; - } else { - namePlate_x = OpenTaiko.Skin.Result_NamePlate_X[pos]; - namePlate_y = OpenTaiko.Skin.Result_NamePlate_Y[pos]; - modIcons_x = OpenTaiko.Skin.Result_ModIcons_X[pos]; - modIcons_y = OpenTaiko.Skin.Result_ModIcons_Y[pos]; - } + if (OpenTaiko.latestSongSelect == OpenTaiko.stageSongSelect)// TJAPlayer3.stage選曲.n確定された曲の難易度[0] != (int)Difficulty.Dan) + if (OpenTaiko.stageSongSelect.rNowSelectedSong.rParentNode != null) + OpenTaiko.stageSongSelect.actSongList.tCloseBOX(); - OpenTaiko.NamePlate.tNamePlateDraw(namePlate_x, namePlate_y, i); - - #region Mods - - ModIcons.tDisplayModsMenu(modIcons_x, modIcons_y, i); + tPostprocessing(); + base.ePhaseID = CStage.EPhase.Common_FADEOUT; + this.eフェードアウト完了時の戻り値 = E戻り値.完了; #endregion } - - #endregion + if (((OpenTaiko.Pad.bPressedDGB(EPad.CY) + || OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.RD)) + || (OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.LC) + || (OpenTaiko.Pad.bPressedDGB(EPad.Decide) + || OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Return))))) { + #region [ Skip animations ] - - #region [Display modals] - - if (displayedModals != null) { - lcModal?.Update(); - lcModal?.Draw(); - } - - #endregion - - if (base.ePhaseID == CStage.EPhase.Common_FADEIN) { - if (this.actFI.Draw() != 0) { - base.ePhaseID = CStage.EPhase.Common_NORMAL; - } - } else if ((base.ePhaseID == CStage.EPhase.Common_FADEOUT)) //&& ( this.actFO.On進行描画() != 0 ) ) - { - return (int)this.eフェードアウト完了時の戻り値; - } - - #region [ #24609 2011.3.14 yyagi ランク更新or演奏型スキル更新時、リザルト画像をpngで保存する ] - if (this.bアニメが完了 == true && this.bIsCheckedWhetherResultScreenShouldSaveOrNot == false // #24609 2011.3.14 yyagi; to save result screen in case BestRank or HiSkill. - && OpenTaiko.ConfigIni.bIsAutoResultCapture) // #25399 2011.6.9 yyagi - { - string strFullPath = - Path.Combine(OpenTaiko.strEXEのあるフォルダ, "Capture_img"); - strFullPath = Path.Combine(strFullPath, DateTime.Now.ToString("yyyyMMddHHmmss") + ".png"); - OpenTaiko.app.SaveResultScreen(strFullPath); - - this.bIsCheckedWhetherResultScreenShouldSaveOrNot = true; - } - #endregion - - // キー入力 - - if (base.ePhaseID == CStage.EPhase.Common_NORMAL) { - if (OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Escape)) { - #region [ Return to song select screen (Faster method) ] - - bgmResultLoop.tStop(); - OpenTaiko.Skin.bgmDanResult.tStop(); - OpenTaiko.Skin.bgmTowerResult.tStop(); + if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] < (int)Difficulty.Tower + && this.actParameterPanel.ctMainCounter.CurrentValue < this.actParameterPanel.MountainAppearValue) { OpenTaiko.Skin.soundDecideSFX.tPlay(); - actFI.tフェードアウト開始(); - - if (OpenTaiko.latestSongSelect == OpenTaiko.stageSongSelect)// TJAPlayer3.stage選曲.n確定された曲の難易度[0] != (int)Difficulty.Dan) - if (OpenTaiko.stageSongSelect.rNowSelectedSong.rParentNode != null) - OpenTaiko.stageSongSelect.actSongList.tCloseBOX(); - - tPostprocessing(); - base.ePhaseID = CStage.EPhase.Common_FADEOUT; - this.eフェードアウト完了時の戻り値 = E戻り値.完了; - - #endregion + this.actParameterPanel.tSkipResultAnimations(); + } else if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan + && (ctPhase1 != null && ctPhase1.IsUnEnded)) { + OpenTaiko.Skin.soundDecideSFX.tPlay(); + ctPhase1.CurrentValue = (int)ctPhase1.EndValue; } - if (((OpenTaiko.Pad.bPressedDGB(EPad.CY) - || OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.RD)) - || (OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.LC) - || (OpenTaiko.Pad.bPressedDGB(EPad.Decide) - || OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Return))))) { + #endregion - #region [ Skip animations ] - - if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] < (int)Difficulty.Tower - && this.actParameterPanel.ctMainCounter.CurrentValue < this.actParameterPanel.MountainAppearValue) { + else { + if ((lcModal?.AnimationFinished() ?? true)) { OpenTaiko.Skin.soundDecideSFX.tPlay(); - this.actParameterPanel.tSkipResultAnimations(); - } else if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan - && (ctPhase1 != null && ctPhase1.IsUnEnded)) { - OpenTaiko.Skin.soundDecideSFX.tPlay(); - ctPhase1.CurrentValue = (int)ctPhase1.EndValue; - } - #endregion - - else { - if ((lcModal?.AnimationFinished() ?? true)) { - OpenTaiko.Skin.soundDecideSFX.tPlay(); - - if (!mqModals.tAreBothQueuesEmpty() + if (!mqModals.tAreBothQueuesEmpty() && (OpenTaiko.Pad.bPressedDGB(EPad.Decide) || OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Return))) { - displayedModals = mqModals.tPopModalInOrder(); + displayedModals = mqModals.tPopModalInOrder(); - } else if (OpenTaiko.ConfigIni.nPlayerCount == 1 || mqModals.tAreBothQueuesEmpty()) { + } else if (OpenTaiko.ConfigIni.nPlayerCount == 1 || mqModals.tAreBothQueuesEmpty()) { - if (!mqModals.tAreBothQueuesEmpty()) - LogNotification.PopError("Unexpected Error: Exited results screen with remaining modals, this is likely due to a Lua script issue."); + if (!mqModals.tAreBothQueuesEmpty()) + LogNotification.PopError("Unexpected Error: Exited results screen with remaining modals, this is likely due to a Lua script issue."); - #region [ Return to song select screen ] + #region [ Return to song select screen ] - actFI.tフェードアウト開始(); + actFI.tフェードアウト開始(); - if (OpenTaiko.latestSongSelect == OpenTaiko.stageSongSelect) - if (OpenTaiko.stageSongSelect.rNowSelectedSong.rParentNode != null) - OpenTaiko.stageSongSelect.actSongList.tCloseBOX(); + if (OpenTaiko.latestSongSelect == OpenTaiko.stageSongSelect) + if (OpenTaiko.stageSongSelect.rNowSelectedSong.rParentNode != null) + OpenTaiko.stageSongSelect.actSongList.tCloseBOX(); - tPostprocessing(); + tPostprocessing(); - { - base.ePhaseID = CStage.EPhase.Common_FADEOUT; - this.eフェードアウト完了時の戻り値 = E戻り値.完了; - bgmResultLoop.tStop(); - OpenTaiko.Skin.bgmDanResult.tStop(); - OpenTaiko.Skin.bgmTowerResult.tStop(); - } - - #endregion + { + base.ePhaseID = CStage.EPhase.Common_FADEOUT; + this.eフェードアウト完了時の戻り値 = E戻り値.完了; + bgmResultLoop.tStop(); + OpenTaiko.Skin.bgmDanResult.tStop(); + OpenTaiko.Skin.bgmTowerResult.tStop(); } - } + #endregion + } } + } + } - if (OpenTaiko.InputManager.Keyboard.KeyPressing((int)SlimDXKeys.Key.LeftArrow) || - OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.LeftChange) || - OpenTaiko.InputManager.Keyboard.KeyPressing((int)SlimDXKeys.Key.RightArrow) || - OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.RightChange)) { - if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) { - #region [ Phase 2 (Swap freely between Exams and Songs) ] + if (OpenTaiko.InputManager.Keyboard.KeyPressing((int)SlimDXKeys.Key.LeftArrow) || + OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.LeftChange) || + OpenTaiko.InputManager.Keyboard.KeyPressing((int)SlimDXKeys.Key.RightArrow) || + OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.RightChange)) { + if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) { + #region [ Phase 2 (Swap freely between Exams and Songs) ] - if (ctPhase1 != null && ctPhase1.IsEnded && (ctPhase2 == null || ctPhase2.IsEnded)) { - ctPhase2 = new CCounter(0, 1280, 0.5f, OpenTaiko.Timer); - ctPhase2.CurrentValue = 0; + if (ctPhase1 != null && ctPhase1.IsEnded && (ctPhase2 == null || ctPhase2.IsEnded)) { + ctPhase2 = new CCounter(0, 1280, 0.5f, OpenTaiko.Timer); + ctPhase2.CurrentValue = 0; - if (examsShift == 0) - examsShift = 1; - else - examsShift = -examsShift; + if (examsShift == 0) + examsShift = 1; + else + examsShift = -examsShift; - OpenTaiko.Skin.soundChangeSFX.tPlay(); - } - - #endregion + OpenTaiko.Skin.soundChangeSFX.tPlay(); } + + #endregion } } } - return 0; } + return 0; + } - #region [Dan result exam information] + #region [Dan result exam information] - private void ftDanDisplayExamInfo(int offset = 0) { - int baseX = OpenTaiko.Skin.DanResult_StatePanel[0] + offset; - int baseY = OpenTaiko.Skin.DanResult_StatePanel[1]; + private void ftDanDisplayExamInfo(int offset = 0) { + int baseX = OpenTaiko.Skin.DanResult_StatePanel[0] + offset; + int baseY = OpenTaiko.Skin.DanResult_StatePanel[1]; - OpenTaiko.Tx.DanResult_StatePanel_Base.t2D描画(baseX, baseY); - OpenTaiko.Tx.DanResult_StatePanel_Main.t2D描画(baseX, baseY); + OpenTaiko.Tx.DanResult_StatePanel_Base.t2D描画(baseX, baseY); + OpenTaiko.Tx.DanResult_StatePanel_Main.t2D描画(baseX, baseY); - #region [ Global scores ] + #region [ Global scores ] - int totalHit = OpenTaiko.stage演奏ドラム画面.CChartScore[0].nGreat - + OpenTaiko.stage演奏ドラム画面.CChartScore[0].nGood - + OpenTaiko.stage演奏ドラム画面.GetRoll(0); + int totalHit = OpenTaiko.stage演奏ドラム画面.CChartScore[0].nGreat + + OpenTaiko.stage演奏ドラム画面.CChartScore[0].nGood + + OpenTaiko.stage演奏ドラム画面.GetRoll(0); - // Small digits - this.actParameterPanel.t小文字表示(OpenTaiko.Skin.DanResult_Perfect[0] + offset, OpenTaiko.Skin.DanResult_Perfect[1], - OpenTaiko.stage演奏ドラム画面.CChartScore[0].nGreat, 1.0f); + // Small digits + this.actParameterPanel.t小文字表示(OpenTaiko.Skin.DanResult_Perfect[0] + offset, OpenTaiko.Skin.DanResult_Perfect[1], + OpenTaiko.stage演奏ドラム画面.CChartScore[0].nGreat, 1.0f); - this.actParameterPanel.t小文字表示(OpenTaiko.Skin.DanResult_Good[0] + offset, OpenTaiko.Skin.DanResult_Good[1], - OpenTaiko.stage演奏ドラム画面.CChartScore[0].nGood, 1.0f); + this.actParameterPanel.t小文字表示(OpenTaiko.Skin.DanResult_Good[0] + offset, OpenTaiko.Skin.DanResult_Good[1], + OpenTaiko.stage演奏ドラム画面.CChartScore[0].nGood, 1.0f); - this.actParameterPanel.t小文字表示(OpenTaiko.Skin.DanResult_Miss[0] + offset, OpenTaiko.Skin.DanResult_Miss[1], - OpenTaiko.stage演奏ドラム画面.CChartScore[0].nMiss, 1.0f); + this.actParameterPanel.t小文字表示(OpenTaiko.Skin.DanResult_Miss[0] + offset, OpenTaiko.Skin.DanResult_Miss[1], + OpenTaiko.stage演奏ドラム画面.CChartScore[0].nMiss, 1.0f); - this.actParameterPanel.t小文字表示(OpenTaiko.Skin.DanResult_Roll[0] + offset, OpenTaiko.Skin.DanResult_Roll[1], - OpenTaiko.stage演奏ドラム画面.GetRoll(0), 1.0f); + this.actParameterPanel.t小文字表示(OpenTaiko.Skin.DanResult_Roll[0] + offset, OpenTaiko.Skin.DanResult_Roll[1], + OpenTaiko.stage演奏ドラム画面.GetRoll(0), 1.0f); - this.actParameterPanel.t小文字表示(OpenTaiko.Skin.DanResult_MaxCombo[0] + offset, OpenTaiko.Skin.DanResult_MaxCombo[1], - OpenTaiko.stage演奏ドラム画面.actCombo.n現在のコンボ数.最高値[0], 1.0f); + this.actParameterPanel.t小文字表示(OpenTaiko.Skin.DanResult_MaxCombo[0] + offset, OpenTaiko.Skin.DanResult_MaxCombo[1], + OpenTaiko.stage演奏ドラム画面.actCombo.n現在のコンボ数.最高値[0], 1.0f); - this.actParameterPanel.t小文字表示(OpenTaiko.Skin.DanResult_TotalHit[0] + offset, OpenTaiko.Skin.DanResult_TotalHit[1], - totalHit, 1.0f); + this.actParameterPanel.t小文字表示(OpenTaiko.Skin.DanResult_TotalHit[0] + offset, OpenTaiko.Skin.DanResult_TotalHit[1], + totalHit, 1.0f); - // Large digits - this.actParameterPanel.tスコア文字表示(OpenTaiko.Skin.DanResult_Score[0] + offset, OpenTaiko.Skin.DanResult_Score[1], (int)OpenTaiko.stage演奏ドラム画面.actScore.Get(0), 1.0f); - - #endregion - - #region [ Display exams ] - - OpenTaiko.stage演奏ドラム画面.actDan.DrawExam(OpenTaiko.stage結果.st演奏記録.Drums.Dan_C, true, offset); - - #endregion - } + // Large digits + this.actParameterPanel.tスコア文字表示(OpenTaiko.Skin.DanResult_Score[0] + offset, OpenTaiko.Skin.DanResult_Score[1], (int)OpenTaiko.stage演奏ドラム画面.actScore.Get(0), 1.0f); #endregion + #region [ Display exams ] - #region [Dan result individual song information] + OpenTaiko.stage演奏ドラム画面.actDan.DrawExam(OpenTaiko.stage結果.st演奏記録.Drums.Dan_C, true, offset); - private void ftDanDisplaySongInfo(int i, int offset = 0) { - int drawPos = i % 3; - int nowIndex = (i / 3); - - int opacityCounter = Math.Min(ctDanSongInfoChange.CurrentValue, 255); - int opacity; - - if (nowIndex == nNowDanSongInfo) { - opacity = opacityCounter; - } else { - opacity = 255 - opacityCounter; - } - - /* - int baseX = 255 + offset; - int baseY = 100 + 183 * i; - */ - - var song = OpenTaiko.stageSongSelect.rChoosenSong.DanSongs[i]; - - // TJAPlayer3.Tx.Dani_Difficulty_Cymbol.t2D中心基準描画(scroll + 377, 180 + i * 73, new Rectangle(song.Difficulty * 53, 0, 53, 53)); - - int songPanel_main_width = OpenTaiko.Tx.DanResult_SongPanel_Main.szTextureSize.Width; - int songPanel_main_height = OpenTaiko.Tx.DanResult_SongPanel_Main.szTextureSize.Height / 3; - - OpenTaiko.Tx.DanResult_SongPanel_Main.Opacity = opacity; - OpenTaiko.Tx.DanResult_SongPanel_Main.t2D描画(OpenTaiko.Skin.DanResult_SongPanel_Main_X[drawPos] + offset, OpenTaiko.Skin.DanResult_SongPanel_Main_Y[drawPos], new Rectangle(0, songPanel_main_height * Math.Min(i, 2), songPanel_main_width, songPanel_main_height)); - - int difficulty_cymbol_width = OpenTaiko.Tx.Dani_Difficulty_Cymbol.szTextureSize.Width / 5; - int difficulty_cymbol_height = OpenTaiko.Tx.Dani_Difficulty_Cymbol.szTextureSize.Height; - - OpenTaiko.Tx.Dani_Difficulty_Cymbol.Opacity = opacity; - OpenTaiko.Tx.Dani_Difficulty_Cymbol.t2D中心基準描画(OpenTaiko.Skin.DanResult_Difficulty_Cymbol_X[drawPos] + offset, OpenTaiko.Skin.DanResult_Difficulty_Cymbol_Y[drawPos], new Rectangle(song.Difficulty * difficulty_cymbol_width, 0, difficulty_cymbol_width, difficulty_cymbol_height)); - OpenTaiko.Tx.Dani_Difficulty_Cymbol.Opacity = 255; - - OpenTaiko.Tx.Dani_Level_Number.Opacity = opacity; - OpenTaiko.stage段位選択.段位リスト.tLevelNumberDraw(OpenTaiko.Skin.DanResult_Level_Number_X[drawPos] + offset, OpenTaiko.Skin.DanResult_Level_Number_Y[drawPos], song.Level); - OpenTaiko.Tx.Dani_Level_Number.Opacity = 255; - - int[] scoresArr = - { - OpenTaiko.stage演奏ドラム画面.n良[i], - OpenTaiko.stage演奏ドラム画面.n可[i], - OpenTaiko.stage演奏ドラム画面.n不可[i], - OpenTaiko.stage演奏ドラム画面.n連打[i] - }; - - int[] num_x = { - OpenTaiko.Skin.DanResult_Sections_Perfect_X[drawPos], - OpenTaiko.Skin.DanResult_Sections_Good_X[drawPos], - OpenTaiko.Skin.DanResult_Sections_Miss_X[drawPos], - OpenTaiko.Skin.DanResult_Sections_Roll_X[drawPos], - }; - - int[] num_y = { - OpenTaiko.Skin.DanResult_Sections_Perfect_Y[drawPos], - OpenTaiko.Skin.DanResult_Sections_Good_Y[drawPos], - OpenTaiko.Skin.DanResult_Sections_Miss_Y[drawPos], - OpenTaiko.Skin.DanResult_Sections_Roll_Y[drawPos], - }; - - OpenTaiko.Tx.Result_Number.Opacity = opacity; - for (int j = 0; j < 4; j++) - this.actParameterPanel.t小文字表示(num_x[j] + offset, num_y[j], scoresArr[j], 1.0f); - OpenTaiko.Tx.Result_Number.Opacity = 255; - - TitleTextureKey.ResolveTitleTexture(this.ttkDanTitles[i]).Opacity = opacity; - TitleTextureKey.ResolveTitleTexture(this.ttkDanTitles[i]).t2D描画(OpenTaiko.Skin.DanResult_DanTitles_X[drawPos] + offset, OpenTaiko.Skin.DanResult_DanTitles_Y[drawPos]); - - CActSelect段位リスト.tDisplayDanIcon(i + 1, OpenTaiko.Skin.DanResult_DanIcon_X[drawPos] + offset, OpenTaiko.Skin.DanResult_DanIcon_Y[drawPos], opacity, 1.0f); - - } - - #endregion - - - public void tPostprocessing() { - - if (!bAddedToRecentlyPlayedSongs) { - // Song added to recently added songs here - - OpenTaiko.RecentlyPlayedSongs.tAddChart(OpenTaiko.stageSongSelect.rChoosenSong.uniqueId.data.id); - - bAddedToRecentlyPlayedSongs = true; - } - - } - - public enum E戻り値 : int { - 継続, - 完了 - } - - // その他 - - #region [ private ] - //----------------- - - public bool bAddedToRecentlyPlayedSongs; - public bool b音声再生; - public bool EndAnime; - - private CCounter ct登場用; - private E戻り値 eフェードアウト完了時の戻り値; - private CActFIFOResult actFI; - private CActFIFOBlack actFO; - private CActオプションパネル actOption; - private CActResultParameterPanel actParameterPanel; - - private CActResultSongBar actSongBar; - private bool bアニメが完了; - private bool bIsCheckedWhetherResultScreenShouldSaveOrNot; // #24509 2011.3.14 yyagi - private readonly int[] nチャンネル0Atoレーン07; - private int n最後に再生したHHのWAV番号; - private int n最後に再生したHHのチャンネル番号; - private CSound rResultSound; - public ResultBG Background; - - public bool[] bClear { - get { - if (OpenTaiko.ConfigIni.bAIBattleMode) { - int clearCount = 0; - for (int i = 0; i < OpenTaiko.stage演奏ドラム画面.AIBattleSections.Count; i++) { - if (OpenTaiko.stage演奏ドラム画面.AIBattleSections[i].End == CStage演奏画面共通.AIBattleSection.EndType.Clear) { - clearCount++; - } - } - return new bool[] { clearCount >= OpenTaiko.stage演奏ドラム画面.AIBattleSections.Count / 2.0, false }; - } else { - return new bool[] { OpenTaiko.stage演奏ドラム画面.bIsAlreadyCleared[0], OpenTaiko.stage演奏ドラム画面.bIsAlreadyCleared[1], OpenTaiko.stage演奏ドラム画面.bIsAlreadyCleared[2], OpenTaiko.stage演奏ドラム画面.bIsAlreadyCleared[3], OpenTaiko.stage演奏ドラム画面.bIsAlreadyCleared[4] }; - } - } - } - - private CCounter ctDanSongInfoChange; - - private int nNowDanSongInfo; - - private void NextDanSongInfo() { - ctDanSongInfoChange = new CCounter(0, 2000, 1, OpenTaiko.Timer); - ctDanSongInfoChange.CurrentValue = 0; - - nNowDanSongInfo++; - if (nNowDanSongInfo >= Math.Ceiling(OpenTaiko.stageSongSelect.rChoosenSong.DanSongs.Count / 3.0)) { - nNowDanSongInfo = 0; - } - } - - // Cloud informations - /* - private int[] CloudXPos = { 642, 612, 652, 1148, 1180, 112, 8, 1088, 1100, 32, 412 }; - private int[] CloudYPos = { 202, 424, 636, 530, 636, 636, 102, 52, 108, 326, 644 }; - private int[] CloudMaxMove = { 150, 120, 180, 60, 90, 150, 120, 50, 45, 120, 180 }; - */ - - // Shines informations - private CCounter ctShine_Plate; - - /* - private int[] ShinePXPos = { 805, 1175, 645, 810, 1078, 1060 }; - private int[] ShinePYPos = { 650, 405, 645, 420, 202, 585 }; - - private float[] ShinePSize = { 0.44f, 0.6f, 0.4f, 0.15f, 0.35f, 0.6f }; - */ - - private int ShinePFade = 100; - - // Fireworks informations - private CCounter ctWork_Plate; - - /* - private int[] WorksPosX = { 800, 900, 1160 }; - private int[] WorksPosY = { 435, 185, 260 }; - */ - - private int[] WorksTimeStamp = { 1000, 2000, 3000 }; - - // Dan informations - private CTexture Dan_Plate; - private TitleTextureKey[] ttkDanTitles; - private CCachedFontRenderer pfDanTitles; - private CCounter ctPhase1; // Info display - private CCounter ctPhase2; // Free swipe - private CCounter ctPhase3; // Background & grade granted if changes - private int examsShift = 0; - private bool newGradeGranted = false; - - // Tower informations - private CCounter ctTower_Animation; - private TitleTextureKey ttkMaxFloors; - private TitleTextureKey ttkToutatsu; - private TitleTextureKey ttkTen; - private TitleTextureKey ttkReachedFloor; - private TitleTextureKey ttkScore; - private TitleTextureKey ttkRemaningLifes; - private TitleTextureKey ttkScoreCount; - private CCachedFontRenderer pfTowerText; - private CCachedFontRenderer pfTowerText48; - private CCachedFontRenderer pfTowerText72; - - private CSkin.CSystemSound bgmResultIn { - get { - if (OpenTaiko.ConfigIni.bAIBattleMode) { - return OpenTaiko.Skin.bgmResultIn_AI; - } else { - return OpenTaiko.Skin.bgmリザルトイン音; - } - } - } - - private CSkin.CSystemSound bgmResultLoop { - get { - if (OpenTaiko.ConfigIni.bAIBattleMode) { - return OpenTaiko.Skin.bgmResult_AI; - } else { - return OpenTaiko.Skin.bgmリザルト音; - } - } - } - - // Modal queues - private ModalQueue mqModals; - private Modal? displayedModals; - - // Coins information - private int[] nEarnedMedalsCount = { 0, 0, 0, 0, 0 }; - - - //----------------- #endregion } + + #endregion + + + #region [Dan result individual song information] + + private void ftDanDisplaySongInfo(int i, int offset = 0) { + int drawPos = i % 3; + int nowIndex = (i / 3); + + int opacityCounter = Math.Min(ctDanSongInfoChange.CurrentValue, 255); + int opacity; + + if (nowIndex == nNowDanSongInfo) { + opacity = opacityCounter; + } else { + opacity = 255 - opacityCounter; + } + + /* + int baseX = 255 + offset; + int baseY = 100 + 183 * i; + */ + + var song = OpenTaiko.stageSongSelect.rChoosenSong.DanSongs[i]; + + // TJAPlayer3.Tx.Dani_Difficulty_Cymbol.t2D中心基準描画(scroll + 377, 180 + i * 73, new Rectangle(song.Difficulty * 53, 0, 53, 53)); + + int songPanel_main_width = OpenTaiko.Tx.DanResult_SongPanel_Main.szTextureSize.Width; + int songPanel_main_height = OpenTaiko.Tx.DanResult_SongPanel_Main.szTextureSize.Height / 3; + + OpenTaiko.Tx.DanResult_SongPanel_Main.Opacity = opacity; + OpenTaiko.Tx.DanResult_SongPanel_Main.t2D描画(OpenTaiko.Skin.DanResult_SongPanel_Main_X[drawPos] + offset, OpenTaiko.Skin.DanResult_SongPanel_Main_Y[drawPos], new Rectangle(0, songPanel_main_height * Math.Min(i, 2), songPanel_main_width, songPanel_main_height)); + + int difficulty_cymbol_width = OpenTaiko.Tx.Dani_Difficulty_Cymbol.szTextureSize.Width / 5; + int difficulty_cymbol_height = OpenTaiko.Tx.Dani_Difficulty_Cymbol.szTextureSize.Height; + + OpenTaiko.Tx.Dani_Difficulty_Cymbol.Opacity = opacity; + OpenTaiko.Tx.Dani_Difficulty_Cymbol.t2D中心基準描画(OpenTaiko.Skin.DanResult_Difficulty_Cymbol_X[drawPos] + offset, OpenTaiko.Skin.DanResult_Difficulty_Cymbol_Y[drawPos], new Rectangle(song.Difficulty * difficulty_cymbol_width, 0, difficulty_cymbol_width, difficulty_cymbol_height)); + OpenTaiko.Tx.Dani_Difficulty_Cymbol.Opacity = 255; + + OpenTaiko.Tx.Dani_Level_Number.Opacity = opacity; + OpenTaiko.stage段位選択.段位リスト.tLevelNumberDraw(OpenTaiko.Skin.DanResult_Level_Number_X[drawPos] + offset, OpenTaiko.Skin.DanResult_Level_Number_Y[drawPos], song.Level); + OpenTaiko.Tx.Dani_Level_Number.Opacity = 255; + + int[] scoresArr = + { + OpenTaiko.stage演奏ドラム画面.n良[i], + OpenTaiko.stage演奏ドラム画面.n可[i], + OpenTaiko.stage演奏ドラム画面.n不可[i], + OpenTaiko.stage演奏ドラム画面.n連打[i] + }; + + int[] num_x = { + OpenTaiko.Skin.DanResult_Sections_Perfect_X[drawPos], + OpenTaiko.Skin.DanResult_Sections_Good_X[drawPos], + OpenTaiko.Skin.DanResult_Sections_Miss_X[drawPos], + OpenTaiko.Skin.DanResult_Sections_Roll_X[drawPos], + }; + + int[] num_y = { + OpenTaiko.Skin.DanResult_Sections_Perfect_Y[drawPos], + OpenTaiko.Skin.DanResult_Sections_Good_Y[drawPos], + OpenTaiko.Skin.DanResult_Sections_Miss_Y[drawPos], + OpenTaiko.Skin.DanResult_Sections_Roll_Y[drawPos], + }; + + OpenTaiko.Tx.Result_Number.Opacity = opacity; + for (int j = 0; j < 4; j++) + this.actParameterPanel.t小文字表示(num_x[j] + offset, num_y[j], scoresArr[j], 1.0f); + OpenTaiko.Tx.Result_Number.Opacity = 255; + + TitleTextureKey.ResolveTitleTexture(this.ttkDanTitles[i]).Opacity = opacity; + TitleTextureKey.ResolveTitleTexture(this.ttkDanTitles[i]).t2D描画(OpenTaiko.Skin.DanResult_DanTitles_X[drawPos] + offset, OpenTaiko.Skin.DanResult_DanTitles_Y[drawPos]); + + CActSelect段位リスト.tDisplayDanIcon(i + 1, OpenTaiko.Skin.DanResult_DanIcon_X[drawPos] + offset, OpenTaiko.Skin.DanResult_DanIcon_Y[drawPos], opacity, 1.0f); + + } + + #endregion + + + public void tPostprocessing() { + + if (!bAddedToRecentlyPlayedSongs) { + // Song added to recently added songs here + + OpenTaiko.RecentlyPlayedSongs.tAddChart(OpenTaiko.stageSongSelect.rChoosenSong.uniqueId.data.id); + + bAddedToRecentlyPlayedSongs = true; + } + + } + + public enum E戻り値 : int { + 継続, + 完了 + } + + // その他 + + #region [ private ] + //----------------- + + public bool bAddedToRecentlyPlayedSongs; + public bool b音声再生; + public bool EndAnime; + + private CCounter ct登場用; + private E戻り値 eフェードアウト完了時の戻り値; + private CActFIFOResult actFI; + private CActFIFOBlack actFO; + private CActオプションパネル actOption; + private CActResultParameterPanel actParameterPanel; + + private CActResultSongBar actSongBar; + private bool bアニメが完了; + private bool bIsCheckedWhetherResultScreenShouldSaveOrNot; // #24509 2011.3.14 yyagi + private readonly int[] nチャンネル0Atoレーン07; + private int n最後に再生したHHのWAV番号; + private int n最後に再生したHHのチャンネル番号; + private CSound rResultSound; + public ResultBG Background; + + public bool[] bClear { + get { + if (OpenTaiko.ConfigIni.bAIBattleMode) { + int clearCount = 0; + for (int i = 0; i < OpenTaiko.stage演奏ドラム画面.AIBattleSections.Count; i++) { + if (OpenTaiko.stage演奏ドラム画面.AIBattleSections[i].End == CStage演奏画面共通.AIBattleSection.EndType.Clear) { + clearCount++; + } + } + return new bool[] { clearCount >= OpenTaiko.stage演奏ドラム画面.AIBattleSections.Count / 2.0, false }; + } else { + return new bool[] { OpenTaiko.stage演奏ドラム画面.bIsAlreadyCleared[0], OpenTaiko.stage演奏ドラム画面.bIsAlreadyCleared[1], OpenTaiko.stage演奏ドラム画面.bIsAlreadyCleared[2], OpenTaiko.stage演奏ドラム画面.bIsAlreadyCleared[3], OpenTaiko.stage演奏ドラム画面.bIsAlreadyCleared[4] }; + } + } + } + + private CCounter ctDanSongInfoChange; + + private int nNowDanSongInfo; + + private void NextDanSongInfo() { + ctDanSongInfoChange = new CCounter(0, 2000, 1, OpenTaiko.Timer); + ctDanSongInfoChange.CurrentValue = 0; + + nNowDanSongInfo++; + if (nNowDanSongInfo >= Math.Ceiling(OpenTaiko.stageSongSelect.rChoosenSong.DanSongs.Count / 3.0)) { + nNowDanSongInfo = 0; + } + } + + // Cloud informations + /* + private int[] CloudXPos = { 642, 612, 652, 1148, 1180, 112, 8, 1088, 1100, 32, 412 }; + private int[] CloudYPos = { 202, 424, 636, 530, 636, 636, 102, 52, 108, 326, 644 }; + private int[] CloudMaxMove = { 150, 120, 180, 60, 90, 150, 120, 50, 45, 120, 180 }; + */ + + // Shines informations + private CCounter ctShine_Plate; + + /* + private int[] ShinePXPos = { 805, 1175, 645, 810, 1078, 1060 }; + private int[] ShinePYPos = { 650, 405, 645, 420, 202, 585 }; + + private float[] ShinePSize = { 0.44f, 0.6f, 0.4f, 0.15f, 0.35f, 0.6f }; + */ + + private int ShinePFade = 100; + + // Fireworks informations + private CCounter ctWork_Plate; + + /* + private int[] WorksPosX = { 800, 900, 1160 }; + private int[] WorksPosY = { 435, 185, 260 }; + */ + + private int[] WorksTimeStamp = { 1000, 2000, 3000 }; + + // Dan informations + private CTexture Dan_Plate; + private TitleTextureKey[] ttkDanTitles; + private CCachedFontRenderer pfDanTitles; + private CCounter ctPhase1; // Info display + private CCounter ctPhase2; // Free swipe + private CCounter ctPhase3; // Background & grade granted if changes + private int examsShift = 0; + private bool newGradeGranted = false; + + // Tower informations + private CCounter ctTower_Animation; + private TitleTextureKey ttkMaxFloors; + private TitleTextureKey ttkToutatsu; + private TitleTextureKey ttkTen; + private TitleTextureKey ttkReachedFloor; + private TitleTextureKey ttkScore; + private TitleTextureKey ttkRemaningLifes; + private TitleTextureKey ttkScoreCount; + private CCachedFontRenderer pfTowerText; + private CCachedFontRenderer pfTowerText48; + private CCachedFontRenderer pfTowerText72; + + private CSkin.CSystemSound bgmResultIn { + get { + if (OpenTaiko.ConfigIni.bAIBattleMode) { + return OpenTaiko.Skin.bgmResultIn_AI; + } else { + return OpenTaiko.Skin.bgmリザルトイン音; + } + } + } + + private CSkin.CSystemSound bgmResultLoop { + get { + if (OpenTaiko.ConfigIni.bAIBattleMode) { + return OpenTaiko.Skin.bgmResult_AI; + } else { + return OpenTaiko.Skin.bgmリザルト音; + } + } + } + + // Modal queues + private ModalQueue mqModals; + private Modal? displayedModals; + + // Coins information + private int[] nEarnedMedalsCount = { 0, 0, 0, 0, 0 }; + + + //----------------- + #endregion } diff --git a/OpenTaiko/src/Stages/08.Result/ResultBG.cs b/OpenTaiko/src/Stages/08.Result/ResultBG.cs index bb17ecf7..b5901e40 100644 --- a/OpenTaiko/src/Stages/08.Result/ResultBG.cs +++ b/OpenTaiko/src/Stages/08.Result/ResultBG.cs @@ -1,26 +1,26 @@ using NLua; -namespace OpenTaiko { - class ResultBG : ScriptBG { - private LuaFunction LuaSkipAnimation; +namespace OpenTaiko; - public ResultBG(string filePath) : base(filePath) { - if (LuaScript != null) { - LuaSkipAnimation = LuaScript.GetFunction("skipAnime"); - } +class ResultBG : ScriptBG { + private LuaFunction LuaSkipAnimation; + + public ResultBG(string filePath) : base(filePath) { + if (LuaScript != null) { + LuaSkipAnimation = LuaScript.GetFunction("skipAnime"); } + } - public new void Dispose() { - base.Dispose(); - LuaSkipAnimation?.Dispose(); - } + public new void Dispose() { + base.Dispose(); + LuaSkipAnimation?.Dispose(); + } - public void SkipAnimation() { - if (LuaScript == null) return; - try { - LuaSkipAnimation.Call(); - } catch (Exception ex) { - } + public void SkipAnimation() { + if (LuaScript == null) return; + try { + LuaSkipAnimation.Call(); + } catch (Exception ex) { } } } diff --git a/OpenTaiko/src/Stages/09.Ending/CStage終了.cs b/OpenTaiko/src/Stages/09.Ending/CStage終了.cs index 4e328eba..f336e65d 100644 --- a/OpenTaiko/src/Stages/09.Ending/CStage終了.cs +++ b/OpenTaiko/src/Stages/09.Ending/CStage終了.cs @@ -1,109 +1,109 @@ using System.Diagnostics; using FDK; -namespace OpenTaiko { - internal class CStage終了 : CStage { - // Constructor +namespace OpenTaiko; - public CStage終了() { - base.eStageID = CStage.EStage.End; - base.ePhaseID = CStage.EPhase.Common_NORMAL; - base.IsDeActivated = true; - } +internal class CStage終了 : CStage { + // Constructor - - // CStage 実装 - - public override void Activate() { - Trace.TraceInformation("終了ステージを活性化します。"); - Trace.Indent(); - try { - this.ct時間稼ぎ = new CCounter(); - - Background = new ScriptBG(CSkin.Path($"{TextureLoader.BASE}{TextureLoader.EXIT}Script.lua")); - Background.Init(); - - base.Activate(); - } finally { - Trace.TraceInformation("終了ステージの活性化を完了しました。"); - Trace.Unindent(); - } - } - public override void DeActivate() { - Trace.TraceInformation("終了ステージを非活性化します。"); - Trace.Indent(); - try { - OpenTaiko.tDisposeSafely(ref Background); - base.DeActivate(); - } finally { - Trace.TraceInformation("終了ステージの非活性化を完了しました。"); - Trace.Unindent(); - } - } - public override void CreateManagedResource() { - - // this.tx文字 = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\9_text.png" ) ); - // this.tx文字2 = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\9_text.png" ) ); - // this.tx文字3 = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\9_text.png" ) ); - //this.tx背景 = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\9_background.jpg" ), false ); - // this.tx白 = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\Tile white 64x64.png" ), false ); - // this.ds背景 = CDTXMania.t失敗してもスキップ可能なDirectShowを生成する( CSkin.Path( @"Graphics\9_background.mp4" ), CDTXMania.app.WindowHandle, true ); - base.CreateManagedResource(); - } - public override void ReleaseManagedResource() { - - //CDTXMania.tテクスチャの解放( ref this.tx背景 ); - // CDTXMania.tテクスチャの解放( ref this.tx文字 ); - // CDTXMania.tテクスチャの解放( ref this.tx文字2 ); - // CDTXMania.tテクスチャの解放( ref this.tx文字3 ); - // CDTXMania.tテクスチャの解放( ref this.tx白 ); - // CDTXMania.t安全にDisposeする( ref this.ds背景 ); - base.ReleaseManagedResource(); - } - public override int Draw() { - /* - if( !TJAPlayer3.ConfigIni.bEndingAnime ) //2017.01.27 DD - { - return 1; - } - */ - - if (!base.IsDeActivated) { - if (base.IsFirstDraw) { - OpenTaiko.Skin.soundゲーム終了音.tPlay(); - this.ct時間稼ぎ.Start(0, OpenTaiko.Skin.Exit_Duration, 1, OpenTaiko.Timer); - base.IsFirstDraw = false; - } - - - this.ct時間稼ぎ.Tick(); - - Background.Update(); - Background.Draw(); - - //TJAPlayer3.Tx.Exit_Background?.t2D描画( 0, 0 ); - - if (this.ct時間稼ぎ.IsEnded && !OpenTaiko.Skin.soundゲーム終了音.bIsPlaying) { - return 1; - } - } - return 0; - } - - - // その他 - - #region [ private ] - //----------------- - private ScriptBG Background; - private CCounter ct時間稼ぎ; - //private CTexture tx背景; - // private CTexture tx文字; - // private CTexture tx文字2; - // private CTexture tx文字3; - // private CDirectShow ds背景; - // private CTexture tx白; - //----------------- - #endregion + public CStage終了() { + base.eStageID = CStage.EStage.End; + base.ePhaseID = CStage.EPhase.Common_NORMAL; + base.IsDeActivated = true; } + + + // CStage 実装 + + public override void Activate() { + Trace.TraceInformation("終了ステージを活性化します。"); + Trace.Indent(); + try { + this.ct時間稼ぎ = new CCounter(); + + Background = new ScriptBG(CSkin.Path($"{TextureLoader.BASE}{TextureLoader.EXIT}Script.lua")); + Background.Init(); + + base.Activate(); + } finally { + Trace.TraceInformation("終了ステージの活性化を完了しました。"); + Trace.Unindent(); + } + } + public override void DeActivate() { + Trace.TraceInformation("終了ステージを非活性化します。"); + Trace.Indent(); + try { + OpenTaiko.tDisposeSafely(ref Background); + base.DeActivate(); + } finally { + Trace.TraceInformation("終了ステージの非活性化を完了しました。"); + Trace.Unindent(); + } + } + public override void CreateManagedResource() { + + // this.tx文字 = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\9_text.png" ) ); + // this.tx文字2 = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\9_text.png" ) ); + // this.tx文字3 = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\9_text.png" ) ); + //this.tx背景 = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\9_background.jpg" ), false ); + // this.tx白 = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\Tile white 64x64.png" ), false ); + // this.ds背景 = CDTXMania.t失敗してもスキップ可能なDirectShowを生成する( CSkin.Path( @"Graphics\9_background.mp4" ), CDTXMania.app.WindowHandle, true ); + base.CreateManagedResource(); + } + public override void ReleaseManagedResource() { + + //CDTXMania.tテクスチャの解放( ref this.tx背景 ); + // CDTXMania.tテクスチャの解放( ref this.tx文字 ); + // CDTXMania.tテクスチャの解放( ref this.tx文字2 ); + // CDTXMania.tテクスチャの解放( ref this.tx文字3 ); + // CDTXMania.tテクスチャの解放( ref this.tx白 ); + // CDTXMania.t安全にDisposeする( ref this.ds背景 ); + base.ReleaseManagedResource(); + } + public override int Draw() { + /* + if( !TJAPlayer3.ConfigIni.bEndingAnime ) //2017.01.27 DD + { + return 1; + } + */ + + if (!base.IsDeActivated) { + if (base.IsFirstDraw) { + OpenTaiko.Skin.soundゲーム終了音.tPlay(); + this.ct時間稼ぎ.Start(0, OpenTaiko.Skin.Exit_Duration, 1, OpenTaiko.Timer); + base.IsFirstDraw = false; + } + + + this.ct時間稼ぎ.Tick(); + + Background.Update(); + Background.Draw(); + + //TJAPlayer3.Tx.Exit_Background?.t2D描画( 0, 0 ); + + if (this.ct時間稼ぎ.IsEnded && !OpenTaiko.Skin.soundゲーム終了音.bIsPlaying) { + return 1; + } + } + return 0; + } + + + // その他 + + #region [ private ] + //----------------- + private ScriptBG Background; + private CCounter ct時間稼ぎ; + //private CTexture tx背景; + // private CTexture tx文字; + // private CTexture tx文字2; + // private CTexture tx文字3; + // private CDirectShow ds背景; + // private CTexture tx白; + //----------------- + #endregion } diff --git a/OpenTaiko/src/Stages/10.ChangeSkin/CStageChangeSkin.cs b/OpenTaiko/src/Stages/10.ChangeSkin/CStageChangeSkin.cs index 9bc3e32f..aff21f8a 100644 --- a/OpenTaiko/src/Stages/10.ChangeSkin/CStageChangeSkin.cs +++ b/OpenTaiko/src/Stages/10.ChangeSkin/CStageChangeSkin.cs @@ -1,79 +1,79 @@ using System.Diagnostics; -namespace OpenTaiko { - /// - /// box.defによるスキン変更時に一時的に遷移する、スキン画像の一切無いステージ。 - /// - internal class CStageChangeSkin : CStage { - // Constructor +namespace OpenTaiko; - public CStageChangeSkin() { - base.eStageID = CStage.EStage.ChangeSkin; - base.IsDeActivated = true; - } +/// +/// box.defによるスキン変更時に一時的に遷移する、スキン画像の一切無いステージ。 +/// +internal class CStageChangeSkin : CStage { + // Constructor - - // CStage 実装 - - public override void Activate() { - Trace.TraceInformation("スキン変更ステージを活性化します。"); - Trace.Indent(); - try { - base.Activate(); - Trace.TraceInformation("スキン変更ステージの活性化を完了しました。"); - } finally { - Trace.Unindent(); - } - } - public override void DeActivate() { - Trace.TraceInformation("スキン変更ステージを非活性化します。"); - Trace.Indent(); - try { - base.DeActivate(); - Trace.TraceInformation("スキン変更ステージの非活性化を完了しました。"); - } finally { - Trace.Unindent(); - } - } - public override void CreateManagedResource() { - if (!base.IsDeActivated) { - base.CreateManagedResource(); - } - } - public override void ReleaseManagedResource() { - if (!base.IsDeActivated) { - base.ReleaseManagedResource(); - } - } - public override int Draw() { - if (!base.IsDeActivated) { - if (base.IsFirstDraw) { - base.IsFirstDraw = false; - return 0; - } - - //スキン変更処理 - OpenTaiko.app.RefreshSkin(); - - return 1; - } - return 0; - } - //public void tChangeSkinMain() - //{ - // Trace.TraceInformation( "スキン変更:" + CDTXMania.Skin.GetCurrentSkinSubfolderFullName( false ) ); - - // CDTXMania.act文字コンソール.On非活性化(); - - // CDTXMania.Skin.PrepareReloadSkin(); - // CDTXMania.Skin.ReloadSkin(); - - - // CDTXMania.Tx.DisposeTexture(); - // CDTXMania.Tx.LoadTexture(); - - // CDTXMania.act文字コンソール.On活性化(); - //} + public CStageChangeSkin() { + base.eStageID = CStage.EStage.ChangeSkin; + base.IsDeActivated = true; } + + + // CStage 実装 + + public override void Activate() { + Trace.TraceInformation("スキン変更ステージを活性化します。"); + Trace.Indent(); + try { + base.Activate(); + Trace.TraceInformation("スキン変更ステージの活性化を完了しました。"); + } finally { + Trace.Unindent(); + } + } + public override void DeActivate() { + Trace.TraceInformation("スキン変更ステージを非活性化します。"); + Trace.Indent(); + try { + base.DeActivate(); + Trace.TraceInformation("スキン変更ステージの非活性化を完了しました。"); + } finally { + Trace.Unindent(); + } + } + public override void CreateManagedResource() { + if (!base.IsDeActivated) { + base.CreateManagedResource(); + } + } + public override void ReleaseManagedResource() { + if (!base.IsDeActivated) { + base.ReleaseManagedResource(); + } + } + public override int Draw() { + if (!base.IsDeActivated) { + if (base.IsFirstDraw) { + base.IsFirstDraw = false; + return 0; + } + + //スキン変更処理 + OpenTaiko.app.RefreshSkin(); + + return 1; + } + return 0; + } + //public void tChangeSkinMain() + //{ + // Trace.TraceInformation( "スキン変更:" + CDTXMania.Skin.GetCurrentSkinSubfolderFullName( false ) ); + + // CDTXMania.act文字コンソール.On非活性化(); + + // CDTXMania.Skin.PrepareReloadSkin(); + // CDTXMania.Skin.ReloadSkin(); + + + // CDTXMania.Tx.DisposeTexture(); + // CDTXMania.Tx.LoadTexture(); + + // CDTXMania.act文字コンソール.On活性化(); + //} } diff --git a/OpenTaiko/src/Stages/11.Heya/CHeyaDisplayAssetInformations.cs b/OpenTaiko/src/Stages/11.Heya/CHeyaDisplayAssetInformations.cs index 504abc6c..7ad1fdc5 100644 --- a/OpenTaiko/src/Stages/11.Heya/CHeyaDisplayAssetInformations.cs +++ b/OpenTaiko/src/Stages/11.Heya/CHeyaDisplayAssetInformations.cs @@ -2,100 +2,100 @@ using static OpenTaiko.CActSelect曲リスト; using Color = System.Drawing.Color; -namespace OpenTaiko { - class CHeyaDisplayAssetInformations { - private static TitleTextureKey? ttkDescription = null; +namespace OpenTaiko; - private static String ToHex(System.Drawing.Color c) => $"#{c.R:X2}{c.G:X2}{c.B:X2}"; +class CHeyaDisplayAssetInformations { + private static TitleTextureKey? ttkDescription = null; - private static int XOrigin { - get { - return OpenTaiko.Skin.Heya_DescriptionTextOrigin[0]; - } - } - - private static int YOrigin { - get { - return OpenTaiko.Skin.Heya_DescriptionTextOrigin[1]; - } - } - - public static void DisplayCharacterInfo(CCachedFontRenderer pf, CCharacter character) { - string description = ""; - description += $"{CLangManager.LangInstance.GetString("HEYA_DESCRIPTION_NAME").SafeFormat(character.metadata.tGetName())}\n"; - description += $"{CLangManager.LangInstance.GetString("HEYA_DESCRIPTION_RARITY").SafeFormat( - "" - + CLangManager.LangInstance.GetString($"HEYA_DESCRIPTION_RARITY{HRarity.tRarityToLangInt(character.metadata.Rarity)}") - + "" - )}\n"; - if (character.metadata.tGetDescription() != "") description += character.metadata.tGetDescription() + "\n"; - description += $"{CLangManager.LangInstance.GetString("HEYA_DESCRIPTION_AUTHOR").SafeFormat(character.metadata.tGetAuthor())}\n\n"; - - var gaugeType = character.effect.Gauge; - if (gaugeType == "Normal") { - description += $"{CLangManager.LangInstance.GetString("HEYA_DESCRIPTION_EFFECTS_GAUGETYPE").SafeFormat(CLangManager.LangInstance.GetString("HEYA_DESCRIPTION_EFFECTS_GAUGETYPE_NORMAL"))}\n"; - description += $"{CLangManager.LangInstance.GetString("HEYA_DESCRIPTION_EFFECTS_GAUGETYPE_NORMAL_DESC")}\n"; - } else if (gaugeType == "Hard") { - description += $"{CLangManager.LangInstance.GetString("HEYA_DESCRIPTION_EFFECTS_GAUGETYPE").SafeFormat("" + CLangManager.LangInstance.GetString("HEYA_DESCRIPTION_EFFECTS_GAUGETYPE_HARD") + "")}\n"; - description += $"{CLangManager.LangInstance.GetString("HEYA_DESCRIPTION_EFFECTS_GAUGETYPE_HARD_DESC")}\n"; - } else if (gaugeType == "Extreme") { - description += $"{CLangManager.LangInstance.GetString("HEYA_DESCRIPTION_EFFECTS_GAUGETYPE").SafeFormat("" + CLangManager.LangInstance.GetString("HEYA_DESCRIPTION_EFFECTS_GAUGETYPE_EXTREME") + "")}\n"; - description += $"{CLangManager.LangInstance.GetString("HEYA_DESCRIPTION_EFFECTS_GAUGETYPE_EXTREME_DESC")}\n"; - } - - var bombFactor = character.effect.BombFactor; - - - if (bombFactor < 10) description += $"{CLangManager.LangInstance.GetString("HEYA_DESCRIPTION_EFFECTS_BOMBFACTOR").SafeFormat($"{bombFactor}")}\n"; - else if (bombFactor < 25) description += $"{CLangManager.LangInstance.GetString("HEYA_DESCRIPTION_EFFECTS_BOMBFACTOR").SafeFormat($"{bombFactor}")}\n"; - else description += $"{CLangManager.LangInstance.GetString("HEYA_DESCRIPTION_EFFECTS_BOMBFACTOR").SafeFormat($"{bombFactor}")}\n"; - - var fuseFactor = character.effect.FuseRollFactor; - if (fuseFactor < 10) description += $"{CLangManager.LangInstance.GetString("HEYA_DESCRIPTION_EFFECTS_FUSEFACTOR").SafeFormat($"{fuseFactor}")}\n"; - else if (fuseFactor < 25) description += $"{CLangManager.LangInstance.GetString("HEYA_DESCRIPTION_EFFECTS_FUSEFACTOR").SafeFormat($"{fuseFactor}")}\n"; - else description += $"{CLangManager.LangInstance.GetString("HEYA_DESCRIPTION_EFFECTS_FUSEFACTOR").SafeFormat($"{fuseFactor}")}\n"; - description += $"{CLangManager.LangInstance.GetString("HEYA_DESCRIPTION_COIN_MULTIPLIER").SafeFormat(character.effect.GetCoinMultiplier())}\n"; - - - if (ttkDescription is null || ttkDescription.str != description) { - ttkDescription = new TitleTextureKey(description, pf, Color.White, Color.Black, 1000); - } - - OpenTaiko.Tx.Heya_Description_Panel?.t2D描画(0, 0); - TitleTextureKey.ResolveTitleTexture(ttkDescription).t2D描画(XOrigin, YOrigin); - } - - public static void DisplayPuchicharaInfo(CCachedFontRenderer pf, CPuchichara puchi) { - string description = ""; - description += $"{CLangManager.LangInstance.GetString("HEYA_DESCRIPTION_NAME").SafeFormat(puchi.metadata.tGetName())}\n"; - description += $"{CLangManager.LangInstance.GetString("HEYA_DESCRIPTION_RARITY").SafeFormat( - "" - + CLangManager.LangInstance.GetString($"HEYA_DESCRIPTION_RARITY{HRarity.tRarityToLangInt(puchi.metadata.Rarity)}") - + "" - )}\n"; - if (puchi.metadata.tGetDescription() != "") description += puchi.metadata.tGetDescription() + "\n"; - description += $"{CLangManager.LangInstance.GetString("HEYA_DESCRIPTION_AUTHOR").SafeFormat(puchi.metadata.tGetAuthor())}\n\n"; - - if (puchi.effect.AllPurple) description += CLangManager.LangInstance.GetString("HEYA_DESCRIPTION_EFFECTS_ALLSWAP") + "\n"; - if (puchi.effect.ShowAdlib) description += CLangManager.LangInstance.GetString("HEYA_DESCRIPTION_EFFECTS_SHOWADLIB") + "\n"; - if (puchi.effect.Autoroll > 0) description += CLangManager.LangInstance.GetString("HEYA_DESCRIPTION_EFFECTS_AUTOROLL", puchi.effect.Autoroll) + "\n"; - if (puchi.effect.SplitLane) description += CLangManager.LangInstance.GetString("HEYA_DESCRIPTION_EFFECTS_SPLITLANE") + "\n"; - description += $"{CLangManager.LangInstance.GetString("HEYA_DESCRIPTION_COIN_MULTIPLIER").SafeFormat(puchi.effect.GetCoinMultiplier())}\n"; - - if (ttkDescription is null || ttkDescription.str != description) { - ttkDescription = new TitleTextureKey(description, pf, Color.White, Color.Black, 1000); - } - - OpenTaiko.Tx.Heya_Description_Panel?.t2D描画(0, 0); - TitleTextureKey.ResolveTitleTexture(ttkDescription).t2D描画(XOrigin, YOrigin); - } - - public static void DisplayNameplateTitleInfo(CCachedFontRenderer pf) { - - } - - public static void DisplayDanplateInfo(CCachedFontRenderer pf) { + private static String ToHex(System.Drawing.Color c) => $"#{c.R:X2}{c.G:X2}{c.B:X2}"; + private static int XOrigin { + get { + return OpenTaiko.Skin.Heya_DescriptionTextOrigin[0]; } } + + private static int YOrigin { + get { + return OpenTaiko.Skin.Heya_DescriptionTextOrigin[1]; + } + } + + public static void DisplayCharacterInfo(CCachedFontRenderer pf, CCharacter character) { + string description = ""; + description += $"{CLangManager.LangInstance.GetString("HEYA_DESCRIPTION_NAME").SafeFormat(character.metadata.tGetName())}\n"; + description += $"{CLangManager.LangInstance.GetString("HEYA_DESCRIPTION_RARITY").SafeFormat( + "" + + CLangManager.LangInstance.GetString($"HEYA_DESCRIPTION_RARITY{HRarity.tRarityToLangInt(character.metadata.Rarity)}") + + "" + )}\n"; + if (character.metadata.tGetDescription() != "") description += character.metadata.tGetDescription() + "\n"; + description += $"{CLangManager.LangInstance.GetString("HEYA_DESCRIPTION_AUTHOR").SafeFormat(character.metadata.tGetAuthor())}\n\n"; + + var gaugeType = character.effect.Gauge; + if (gaugeType == "Normal") { + description += $"{CLangManager.LangInstance.GetString("HEYA_DESCRIPTION_EFFECTS_GAUGETYPE").SafeFormat(CLangManager.LangInstance.GetString("HEYA_DESCRIPTION_EFFECTS_GAUGETYPE_NORMAL"))}\n"; + description += $"{CLangManager.LangInstance.GetString("HEYA_DESCRIPTION_EFFECTS_GAUGETYPE_NORMAL_DESC")}\n"; + } else if (gaugeType == "Hard") { + description += $"{CLangManager.LangInstance.GetString("HEYA_DESCRIPTION_EFFECTS_GAUGETYPE").SafeFormat("" + CLangManager.LangInstance.GetString("HEYA_DESCRIPTION_EFFECTS_GAUGETYPE_HARD") + "")}\n"; + description += $"{CLangManager.LangInstance.GetString("HEYA_DESCRIPTION_EFFECTS_GAUGETYPE_HARD_DESC")}\n"; + } else if (gaugeType == "Extreme") { + description += $"{CLangManager.LangInstance.GetString("HEYA_DESCRIPTION_EFFECTS_GAUGETYPE").SafeFormat("" + CLangManager.LangInstance.GetString("HEYA_DESCRIPTION_EFFECTS_GAUGETYPE_EXTREME") + "")}\n"; + description += $"{CLangManager.LangInstance.GetString("HEYA_DESCRIPTION_EFFECTS_GAUGETYPE_EXTREME_DESC")}\n"; + } + + var bombFactor = character.effect.BombFactor; + + + if (bombFactor < 10) description += $"{CLangManager.LangInstance.GetString("HEYA_DESCRIPTION_EFFECTS_BOMBFACTOR").SafeFormat($"{bombFactor}")}\n"; + else if (bombFactor < 25) description += $"{CLangManager.LangInstance.GetString("HEYA_DESCRIPTION_EFFECTS_BOMBFACTOR").SafeFormat($"{bombFactor}")}\n"; + else description += $"{CLangManager.LangInstance.GetString("HEYA_DESCRIPTION_EFFECTS_BOMBFACTOR").SafeFormat($"{bombFactor}")}\n"; + + var fuseFactor = character.effect.FuseRollFactor; + if (fuseFactor < 10) description += $"{CLangManager.LangInstance.GetString("HEYA_DESCRIPTION_EFFECTS_FUSEFACTOR").SafeFormat($"{fuseFactor}")}\n"; + else if (fuseFactor < 25) description += $"{CLangManager.LangInstance.GetString("HEYA_DESCRIPTION_EFFECTS_FUSEFACTOR").SafeFormat($"{fuseFactor}")}\n"; + else description += $"{CLangManager.LangInstance.GetString("HEYA_DESCRIPTION_EFFECTS_FUSEFACTOR").SafeFormat($"{fuseFactor}")}\n"; + description += $"{CLangManager.LangInstance.GetString("HEYA_DESCRIPTION_COIN_MULTIPLIER").SafeFormat(character.effect.GetCoinMultiplier())}\n"; + + + if (ttkDescription is null || ttkDescription.str != description) { + ttkDescription = new TitleTextureKey(description, pf, Color.White, Color.Black, 1000); + } + + OpenTaiko.Tx.Heya_Description_Panel?.t2D描画(0, 0); + TitleTextureKey.ResolveTitleTexture(ttkDescription).t2D描画(XOrigin, YOrigin); + } + + public static void DisplayPuchicharaInfo(CCachedFontRenderer pf, CPuchichara puchi) { + string description = ""; + description += $"{CLangManager.LangInstance.GetString("HEYA_DESCRIPTION_NAME").SafeFormat(puchi.metadata.tGetName())}\n"; + description += $"{CLangManager.LangInstance.GetString("HEYA_DESCRIPTION_RARITY").SafeFormat( + "" + + CLangManager.LangInstance.GetString($"HEYA_DESCRIPTION_RARITY{HRarity.tRarityToLangInt(puchi.metadata.Rarity)}") + + "" + )}\n"; + if (puchi.metadata.tGetDescription() != "") description += puchi.metadata.tGetDescription() + "\n"; + description += $"{CLangManager.LangInstance.GetString("HEYA_DESCRIPTION_AUTHOR").SafeFormat(puchi.metadata.tGetAuthor())}\n\n"; + + if (puchi.effect.AllPurple) description += CLangManager.LangInstance.GetString("HEYA_DESCRIPTION_EFFECTS_ALLSWAP") + "\n"; + if (puchi.effect.ShowAdlib) description += CLangManager.LangInstance.GetString("HEYA_DESCRIPTION_EFFECTS_SHOWADLIB") + "\n"; + if (puchi.effect.Autoroll > 0) description += CLangManager.LangInstance.GetString("HEYA_DESCRIPTION_EFFECTS_AUTOROLL", puchi.effect.Autoroll) + "\n"; + if (puchi.effect.SplitLane) description += CLangManager.LangInstance.GetString("HEYA_DESCRIPTION_EFFECTS_SPLITLANE") + "\n"; + description += $"{CLangManager.LangInstance.GetString("HEYA_DESCRIPTION_COIN_MULTIPLIER").SafeFormat(puchi.effect.GetCoinMultiplier())}\n"; + + if (ttkDescription is null || ttkDescription.str != description) { + ttkDescription = new TitleTextureKey(description, pf, Color.White, Color.Black, 1000); + } + + OpenTaiko.Tx.Heya_Description_Panel?.t2D描画(0, 0); + TitleTextureKey.ResolveTitleTexture(ttkDescription).t2D描画(XOrigin, YOrigin); + } + + public static void DisplayNameplateTitleInfo(CCachedFontRenderer pf) { + + } + + public static void DisplayDanplateInfo(CCachedFontRenderer pf) { + + } } diff --git a/OpenTaiko/src/Stages/11.Heya/CStageHeya.cs b/OpenTaiko/src/Stages/11.Heya/CStageHeya.cs index 071eba68..acb2f0a2 100644 --- a/OpenTaiko/src/Stages/11.Heya/CStageHeya.cs +++ b/OpenTaiko/src/Stages/11.Heya/CStageHeya.cs @@ -2,930 +2,930 @@ using FDK; using Color = System.Drawing.Color; using Rectangle = System.Drawing.Rectangle; -namespace OpenTaiko { - class CStageHeya : CStage { - public CStageHeya() { - base.eStageID = EStage.Heya; - base.ePhaseID = CStage.EPhase.Common_NORMAL; +namespace OpenTaiko; - base.ChildActivities.Add(this.actFOtoTitle = new CActFIFOBlack()); +class CStageHeya : CStage { + public CStageHeya() { + base.eStageID = EStage.Heya; + base.ePhaseID = CStage.EPhase.Common_NORMAL; - base.ChildActivities.Add(this.PuchiChara = new PuchiChara()); + base.ChildActivities.Add(this.actFOtoTitle = new CActFIFOBlack()); + + base.ChildActivities.Add(this.PuchiChara = new PuchiChara()); + } + + + public override void Activate() { + if (base.IsActivated) + return; + + base.ePhaseID = CStage.EPhase.Common_NORMAL; + this.eフェードアウト完了時の戻り値 = E戻り値.継続; + + ctChara_In = new CCounter(); + //ctChara_Normal = new CCounter(0, TJAPlayer3.Tx.SongSelect_Chara_Normal.Length - 1, 1000 / 45, TJAPlayer3.Timer); + + CMenuCharacter.tMenuResetTimer(CMenuCharacter.ECharacterAnimation.NORMAL); + + bInSongPlayed = false; + + this.pfHeyaFont = HPrivateFastFont.tInstantiateMainFont(OpenTaiko.Skin.Heya_Font_Scale); + + ScrollCounter = new CCounter(0, 1000, 0.15f, OpenTaiko.Timer); + + // 1P, configure later for default 2P + iPlayer = OpenTaiko.SaveFile; + + #region [Main menu] + + this.ttkMainMenuOpt = new TitleTextureKey[5]; + + this.ttkMainMenuOpt[0] = new TitleTextureKey(CLangManager.LangInstance.GetString("MENU_RETURN"), this.pfHeyaFont, Color.White, Color.DarkGreen, 1000); + this.ttkMainMenuOpt[1] = new TitleTextureKey(CLangManager.LangInstance.GetString("HEYA_PUCHI"), this.pfHeyaFont, Color.White, Color.DarkGreen, 1000); + this.ttkMainMenuOpt[2] = new TitleTextureKey(CLangManager.LangInstance.GetString("HEYA_CHARA"), this.pfHeyaFont, Color.White, Color.DarkGreen, 1000); + this.ttkMainMenuOpt[3] = new TitleTextureKey(CLangManager.LangInstance.GetString("HEYA_DAN"), this.pfHeyaFont, Color.White, Color.DarkGreen, 1000); + this.ttkMainMenuOpt[4] = new TitleTextureKey(CLangManager.LangInstance.GetString("HEYA_NAMEPLATE"), this.pfHeyaFont, Color.White, Color.DarkGreen, 1000); + //for (int i = 1; i < ttkMainMenuOpt.Length; i++) + //{ + // this.ttkMainMenuOpt[i] = new TitleTextureKey(CLangManager.LangInstance.GetString(1030 + i), this.pfHeyaFont, Color.White, Color.DarkGreen, 1000); + //} + + #endregion + + #region [Dan title] + + int amount = 1; + if (OpenTaiko.SaveFileInstances[iPlayer].data.DanTitles != null) + amount += OpenTaiko.SaveFileInstances[iPlayer].data.DanTitles.Count; + + this.ttkDanTitles = new TitleTextureKey[amount]; + this.sDanTitles = new string[amount]; + + // Silver Shinjin (default rank) always avaliable by default + this.ttkDanTitles[0] = new TitleTextureKey("新人", this.pfHeyaFont, Color.White, Color.Black, 1000); + this.sDanTitles[0] = "新人"; + + int idx = 1; + if (OpenTaiko.SaveFileInstances[iPlayer].data.DanTitles != null) { + foreach (var item in OpenTaiko.SaveFileInstances[iPlayer].data.DanTitles) { + this.sDanTitles[idx] = item.Key; + if (item.Value.isGold == true) + this.ttkDanTitles[idx] = new TitleTextureKey($"{item.Key}", this.pfHeyaFont, Color.Gold, Color.Black, 1000); + else + this.ttkDanTitles[idx] = new TitleTextureKey(item.Key, this.pfHeyaFont, Color.White, Color.Black, 1000); + idx++; + } } + #endregion - public override void Activate() { - if (base.IsActivated) - return; + #region [Plate title] - base.ePhaseID = CStage.EPhase.Common_NORMAL; - this.eフェードアウト完了時の戻り値 = E戻り値.継続; + amount = 1; + if (OpenTaiko.SaveFileInstances[iPlayer].data.UnlockedNameplateIds != null) + amount += OpenTaiko.SaveFileInstances[iPlayer].data.UnlockedNameplateIds.Count; - ctChara_In = new CCounter(); - //ctChara_Normal = new CCounter(0, TJAPlayer3.Tx.SongSelect_Chara_Normal.Length - 1, 1000 / 45, TJAPlayer3.Timer); + this.ttkTitles = new TitleTextureKey[amount]; + this.titlesKeys = new int[amount]; - CMenuCharacter.tMenuResetTimer(CMenuCharacter.ECharacterAnimation.NORMAL); + // Wood shoshinsha (default title) always avaliable by default + this.ttkTitles[0] = new TitleTextureKey("初心者", this.pfHeyaFont, Color.Black, Color.Transparent, 1000); + this.titlesKeys[0] = 0; // Regular nameplate unlockable start by 1 (Important) - bInSongPlayed = false; - - this.pfHeyaFont = HPrivateFastFont.tInstantiateMainFont(OpenTaiko.Skin.Heya_Font_Scale); - - ScrollCounter = new CCounter(0, 1000, 0.15f, OpenTaiko.Timer); - - // 1P, configure later for default 2P - iPlayer = OpenTaiko.SaveFile; - - #region [Main menu] - - this.ttkMainMenuOpt = new TitleTextureKey[5]; - - this.ttkMainMenuOpt[0] = new TitleTextureKey(CLangManager.LangInstance.GetString("MENU_RETURN"), this.pfHeyaFont, Color.White, Color.DarkGreen, 1000); - this.ttkMainMenuOpt[1] = new TitleTextureKey(CLangManager.LangInstance.GetString("HEYA_PUCHI"), this.pfHeyaFont, Color.White, Color.DarkGreen, 1000); - this.ttkMainMenuOpt[2] = new TitleTextureKey(CLangManager.LangInstance.GetString("HEYA_CHARA"), this.pfHeyaFont, Color.White, Color.DarkGreen, 1000); - this.ttkMainMenuOpt[3] = new TitleTextureKey(CLangManager.LangInstance.GetString("HEYA_DAN"), this.pfHeyaFont, Color.White, Color.DarkGreen, 1000); - this.ttkMainMenuOpt[4] = new TitleTextureKey(CLangManager.LangInstance.GetString("HEYA_NAMEPLATE"), this.pfHeyaFont, Color.White, Color.DarkGreen, 1000); - //for (int i = 1; i < ttkMainMenuOpt.Length; i++) - //{ - // this.ttkMainMenuOpt[i] = new TitleTextureKey(CLangManager.LangInstance.GetString(1030 + i), this.pfHeyaFont, Color.White, Color.DarkGreen, 1000); - //} - - #endregion - - #region [Dan title] - - int amount = 1; - if (OpenTaiko.SaveFileInstances[iPlayer].data.DanTitles != null) - amount += OpenTaiko.SaveFileInstances[iPlayer].data.DanTitles.Count; - - this.ttkDanTitles = new TitleTextureKey[amount]; - this.sDanTitles = new string[amount]; - - // Silver Shinjin (default rank) always avaliable by default - this.ttkDanTitles[0] = new TitleTextureKey("新人", this.pfHeyaFont, Color.White, Color.Black, 1000); - this.sDanTitles[0] = "新人"; - - int idx = 1; - if (OpenTaiko.SaveFileInstances[iPlayer].data.DanTitles != null) { - foreach (var item in OpenTaiko.SaveFileInstances[iPlayer].data.DanTitles) { - this.sDanTitles[idx] = item.Key; - if (item.Value.isGold == true) - this.ttkDanTitles[idx] = new TitleTextureKey($"{item.Key}", this.pfHeyaFont, Color.Gold, Color.Black, 1000); - else - this.ttkDanTitles[idx] = new TitleTextureKey(item.Key, this.pfHeyaFont, Color.White, Color.Black, 1000); + idx = 1; + if (OpenTaiko.SaveFileInstances[iPlayer].data.UnlockedNameplateIds != null) { + foreach (var _ref in OpenTaiko.SaveFileInstances[iPlayer].data.UnlockedNameplateIds) { + var item = OpenTaiko.Databases.DBNameplateUnlockables.data?[_ref]; + if (item != null) { + this.ttkTitles[idx] = new TitleTextureKey(item.nameplateInfo.cld.GetString(""), this.pfHeyaFont, Color.Black, Color.Transparent, 1000); + this.titlesKeys[idx] = _ref; idx++; } + } - - #endregion - - #region [Plate title] - - amount = 1; - if (OpenTaiko.SaveFileInstances[iPlayer].data.UnlockedNameplateIds != null) - amount += OpenTaiko.SaveFileInstances[iPlayer].data.UnlockedNameplateIds.Count; - - this.ttkTitles = new TitleTextureKey[amount]; - this.titlesKeys = new int[amount]; - - // Wood shoshinsha (default title) always avaliable by default - this.ttkTitles[0] = new TitleTextureKey("初心者", this.pfHeyaFont, Color.Black, Color.Transparent, 1000); - this.titlesKeys[0] = 0; // Regular nameplate unlockable start by 1 (Important) - - idx = 1; - if (OpenTaiko.SaveFileInstances[iPlayer].data.UnlockedNameplateIds != null) { - foreach (var _ref in OpenTaiko.SaveFileInstances[iPlayer].data.UnlockedNameplateIds) { - var item = OpenTaiko.Databases.DBNameplateUnlockables.data?[_ref]; - if (item != null) { - this.ttkTitles[idx] = new TitleTextureKey(item.nameplateInfo.cld.GetString(""), this.pfHeyaFont, Color.Black, Color.Transparent, 1000); - this.titlesKeys[idx] = _ref; - idx++; - } - - } - } - - #endregion - - // -1 : Main Menu, >= 0 : See Main menu opt - iCurrentMenu = -1; - iMainMenuCurrent = 0; - - #region [PuchiChara stuff] - - iPuchiCharaCount = OpenTaiko.Skin.Puchichara_Ptn; - - ttkPuchiCharaNames = new TitleTextureKey[iPuchiCharaCount]; - ttkPuchiCharaAuthors = new TitleTextureKey[iPuchiCharaCount]; - - for (int i = 0; i < iPuchiCharaCount; i++) { - var textColor = HRarity.tRarityToColor(OpenTaiko.Tx.Puchichara[i].metadata.Rarity); - ttkPuchiCharaNames[i] = new TitleTextureKey(OpenTaiko.Tx.Puchichara[i].metadata.tGetName(), this.pfHeyaFont, textColor, Color.Black, 1000); - ttkPuchiCharaAuthors[i] = new TitleTextureKey(OpenTaiko.Tx.Puchichara[i].metadata.tGetAuthor(), this.pfHeyaFont, Color.White, Color.Black, 1000); - } - - #endregion - - #region [Character stuff] - - iCharacterCount = OpenTaiko.Skin.Characters_Ptn; - - ttkCharacterAuthors = new TitleTextureKey[iCharacterCount]; - ttkCharacterNames = new TitleTextureKey[iCharacterCount]; - - for (int i = 0; i < iCharacterCount; i++) { - var textColor = HRarity.tRarityToColor(OpenTaiko.Tx.Characters[i].metadata.Rarity); - ttkCharacterNames[i] = new TitleTextureKey(OpenTaiko.Tx.Characters[i].metadata.tGetName(), this.pfHeyaFont, textColor, Color.Black, 1000); - ttkCharacterAuthors[i] = new TitleTextureKey(OpenTaiko.Tx.Characters[i].metadata.tGetAuthor(), this.pfHeyaFont, Color.White, Color.Black, 1000); - } - - #endregion - - this.tResetOpts(); - - this.PuchiChara.IdleAnimation(); - - Background = new ScriptBG(CSkin.Path($"{TextureLoader.BASE}{TextureLoader.HEYA}Script.lua")); - Background.Init(); - - base.Activate(); } - public override void DeActivate() { - OpenTaiko.tDisposeSafely(ref Background); + #endregion - base.DeActivate(); + // -1 : Main Menu, >= 0 : See Main menu opt + iCurrentMenu = -1; + iMainMenuCurrent = 0; + + #region [PuchiChara stuff] + + iPuchiCharaCount = OpenTaiko.Skin.Puchichara_Ptn; + + ttkPuchiCharaNames = new TitleTextureKey[iPuchiCharaCount]; + ttkPuchiCharaAuthors = new TitleTextureKey[iPuchiCharaCount]; + + for (int i = 0; i < iPuchiCharaCount; i++) { + var textColor = HRarity.tRarityToColor(OpenTaiko.Tx.Puchichara[i].metadata.Rarity); + ttkPuchiCharaNames[i] = new TitleTextureKey(OpenTaiko.Tx.Puchichara[i].metadata.tGetName(), this.pfHeyaFont, textColor, Color.Black, 1000); + ttkPuchiCharaAuthors[i] = new TitleTextureKey(OpenTaiko.Tx.Puchichara[i].metadata.tGetAuthor(), this.pfHeyaFont, Color.White, Color.Black, 1000); } - public override void CreateManagedResource() { + #endregion + #region [Character stuff] - base.CreateManagedResource(); + iCharacterCount = OpenTaiko.Skin.Characters_Ptn; + + ttkCharacterAuthors = new TitleTextureKey[iCharacterCount]; + ttkCharacterNames = new TitleTextureKey[iCharacterCount]; + + for (int i = 0; i < iCharacterCount; i++) { + var textColor = HRarity.tRarityToColor(OpenTaiko.Tx.Characters[i].metadata.Rarity); + ttkCharacterNames[i] = new TitleTextureKey(OpenTaiko.Tx.Characters[i].metadata.tGetName(), this.pfHeyaFont, textColor, Color.Black, 1000); + ttkCharacterAuthors[i] = new TitleTextureKey(OpenTaiko.Tx.Characters[i].metadata.tGetAuthor(), this.pfHeyaFont, Color.White, Color.Black, 1000); } - public override void ReleaseManagedResource() { + #endregion - base.ReleaseManagedResource(); + this.tResetOpts(); + + this.PuchiChara.IdleAnimation(); + + Background = new ScriptBG(CSkin.Path($"{TextureLoader.BASE}{TextureLoader.HEYA}Script.lua")); + Background.Init(); + + base.Activate(); + } + + public override void DeActivate() { + OpenTaiko.tDisposeSafely(ref Background); + + base.DeActivate(); + } + + public override void CreateManagedResource() { + + + base.CreateManagedResource(); + } + + public override void ReleaseManagedResource() { + + base.ReleaseManagedResource(); + } + + public override int Draw() { + //ctChara_Normal.t進行Loop(); + ctChara_In.Tick(); + + ScrollCounter.Tick(); + + Background.Update(); + Background.Draw(); + //Heya_Background.t2D描画(0, 0); + + #region [Main menu (Side bar)] + + for (int i = 0; i < this.ttkMainMenuOpt.Length; i++) { + CTexture tmpTex = TitleTextureKey.ResolveTitleTexture(this.ttkMainMenuOpt[i]); + + if (iCurrentMenu != -1 || iMainMenuCurrent != i) { + tmpTex.color4 = CConversion.ColorToColor4(Color.DarkGray); + OpenTaiko.Tx.Heya_Side_Menu?.tUpdateColor4(CConversion.ColorToColor4(Color.DarkGray)); + } else { + tmpTex.color4 = CConversion.ColorToColor4(Color.White); + OpenTaiko.Tx.Heya_Side_Menu?.tUpdateColor4(CConversion.ColorToColor4(Color.White)); + } + + OpenTaiko.Tx.Heya_Side_Menu?.t2D拡大率考慮上中央基準描画(OpenTaiko.Skin.Heya_Main_Menu_X[i], OpenTaiko.Skin.Heya_Main_Menu_Y[i]); + tmpTex.t2D拡大率考慮上中央基準描画(OpenTaiko.Skin.Heya_Main_Menu_X[i] + OpenTaiko.Skin.Heya_Main_Menu_Font_Offset[0], OpenTaiko.Skin.Heya_Main_Menu_Y[i] + OpenTaiko.Skin.Heya_Main_Menu_Font_Offset[1]); } - public override int Draw() { - //ctChara_Normal.t進行Loop(); - ctChara_In.Tick(); + #endregion - ScrollCounter.Tick(); + #region [Background center] - Background.Update(); - Background.Draw(); - //Heya_Background.t2D描画(0, 0); + if (iCurrentMenu >= 0) { + OpenTaiko.Tx.Heya_Center_Menu_Background?.t2D描画(0, 0); + } - #region [Main menu (Side bar)] + #endregion - for (int i = 0; i < this.ttkMainMenuOpt.Length; i++) { - CTexture tmpTex = TitleTextureKey.ResolveTitleTexture(this.ttkMainMenuOpt[i]); + #region [Render field] - if (iCurrentMenu != -1 || iMainMenuCurrent != i) { - tmpTex.color4 = CConversion.ColorToColor4(Color.DarkGray); - OpenTaiko.Tx.Heya_Side_Menu?.tUpdateColor4(CConversion.ColorToColor4(Color.DarkGray)); + float renderRatioX = 1.0f; + float renderRatioY = 1.0f; + + if (OpenTaiko.Skin.Characters_Resolution[iCharacterCurrent] != null) { + renderRatioX = OpenTaiko.Skin.Resolution[0] / (float)OpenTaiko.Skin.Characters_Resolution[iCharacterCurrent][0]; + renderRatioY = OpenTaiko.Skin.Resolution[1] / (float)OpenTaiko.Skin.Characters_Resolution[iCharacterCurrent][1]; + } + + if (OpenTaiko.Tx.Characters_Heya_Render[iCharacterCurrent] != null) { + OpenTaiko.Tx.Characters_Heya_Render[iCharacterCurrent].vcScaleRatio.X = renderRatioX; + OpenTaiko.Tx.Characters_Heya_Render[iCharacterCurrent].vcScaleRatio.Y = renderRatioY; + } + if (iCurrentMenu == 0 || iCurrentMenu == 1) OpenTaiko.Tx.Heya_Render_Field?.t2D描画(0, 0); + if (iCurrentMenu == 0) OpenTaiko.Tx.Puchichara[iPuchiCharaCurrent].render?.t2D描画(0, 0); + if (iCurrentMenu == 1) OpenTaiko.Tx.Characters_Heya_Render[iCharacterCurrent]?.t2D描画(OpenTaiko.Skin.Characters_Heya_Render_Offset[iCharacterCurrent][0] * renderRatioX, OpenTaiko.Skin.Characters_Heya_Render_Offset[iCharacterCurrent][1] * renderRatioY); + + #endregion + + #region [Menus display] + + #region [Petit chara] + + if (iCurrentMenu == 0) { + for (int i = -(OpenTaiko.Skin.Heya_Center_Menu_Box_Count / 2); i < (OpenTaiko.Skin.Heya_Center_Menu_Box_Count / 2) + 1; i++) { + int pos = (iPuchiCharaCount * 5 + iPuchiCharaCurrent + i) % iPuchiCharaCount; + + if (i != 0) { + OpenTaiko.Tx.Puchichara[pos].tx?.tUpdateColor4(CConversion.ColorToColor4(Color.DarkGray)); + OpenTaiko.Tx.Heya_Center_Menu_Box_Slot?.tUpdateColor4(CConversion.ColorToColor4(Color.DarkGray)); + OpenTaiko.Tx.Heya_Lock?.tUpdateColor4(CConversion.ColorToColor4(Color.DarkGray)); } else { - tmpTex.color4 = CConversion.ColorToColor4(Color.White); - OpenTaiko.Tx.Heya_Side_Menu?.tUpdateColor4(CConversion.ColorToColor4(Color.White)); + OpenTaiko.Tx.Puchichara[pos].tx?.tUpdateColor4(CConversion.ColorToColor4(Color.White)); + OpenTaiko.Tx.Heya_Center_Menu_Box_Slot?.tUpdateColor4(CConversion.ColorToColor4(Color.White)); + OpenTaiko.Tx.Heya_Lock?.tUpdateColor4(CConversion.ColorToColor4(Color.White)); } - OpenTaiko.Tx.Heya_Side_Menu?.t2D拡大率考慮上中央基準描画(OpenTaiko.Skin.Heya_Main_Menu_X[i], OpenTaiko.Skin.Heya_Main_Menu_Y[i]); - tmpTex.t2D拡大率考慮上中央基準描画(OpenTaiko.Skin.Heya_Main_Menu_X[i] + OpenTaiko.Skin.Heya_Main_Menu_Font_Offset[0], OpenTaiko.Skin.Heya_Main_Menu_Y[i] + OpenTaiko.Skin.Heya_Main_Menu_Font_Offset[1]); - } + var scroll = DrawBox_Slot(i + (OpenTaiko.Skin.Heya_Center_Menu_Box_Count / 2)); - #endregion + int puriColumn = pos % 5; + int puriRow = pos / 5; - #region [Background center] + if (OpenTaiko.Tx.Puchichara[pos].tx != null) { + float puchiScale = OpenTaiko.Skin.Resolution[1] / 1080.0f; - if (iCurrentMenu >= 0) { - OpenTaiko.Tx.Heya_Center_Menu_Background?.t2D描画(0, 0); - } + OpenTaiko.Tx.Puchichara[pos].tx.vcScaleRatio.X = puchiScale; + OpenTaiko.Tx.Puchichara[pos].tx.vcScaleRatio.Y = puchiScale; + } - #endregion - - #region [Render field] - - float renderRatioX = 1.0f; - float renderRatioY = 1.0f; - - if (OpenTaiko.Skin.Characters_Resolution[iCharacterCurrent] != null) { - renderRatioX = OpenTaiko.Skin.Resolution[0] / (float)OpenTaiko.Skin.Characters_Resolution[iCharacterCurrent][0]; - renderRatioY = OpenTaiko.Skin.Resolution[1] / (float)OpenTaiko.Skin.Characters_Resolution[iCharacterCurrent][1]; - } - - if (OpenTaiko.Tx.Characters_Heya_Render[iCharacterCurrent] != null) { - OpenTaiko.Tx.Characters_Heya_Render[iCharacterCurrent].vcScaleRatio.X = renderRatioX; - OpenTaiko.Tx.Characters_Heya_Render[iCharacterCurrent].vcScaleRatio.Y = renderRatioY; - } - if (iCurrentMenu == 0 || iCurrentMenu == 1) OpenTaiko.Tx.Heya_Render_Field?.t2D描画(0, 0); - if (iCurrentMenu == 0) OpenTaiko.Tx.Puchichara[iPuchiCharaCurrent].render?.t2D描画(0, 0); - if (iCurrentMenu == 1) OpenTaiko.Tx.Characters_Heya_Render[iCharacterCurrent]?.t2D描画(OpenTaiko.Skin.Characters_Heya_Render_Offset[iCharacterCurrent][0] * renderRatioX, OpenTaiko.Skin.Characters_Heya_Render_Offset[iCharacterCurrent][1] * renderRatioY); - - #endregion - - #region [Menus display] - - #region [Petit chara] - - if (iCurrentMenu == 0) { - for (int i = -(OpenTaiko.Skin.Heya_Center_Menu_Box_Count / 2); i < (OpenTaiko.Skin.Heya_Center_Menu_Box_Count / 2) + 1; i++) { - int pos = (iPuchiCharaCount * 5 + iPuchiCharaCurrent + i) % iPuchiCharaCount; - - if (i != 0) { - OpenTaiko.Tx.Puchichara[pos].tx?.tUpdateColor4(CConversion.ColorToColor4(Color.DarkGray)); - OpenTaiko.Tx.Heya_Center_Menu_Box_Slot?.tUpdateColor4(CConversion.ColorToColor4(Color.DarkGray)); - OpenTaiko.Tx.Heya_Lock?.tUpdateColor4(CConversion.ColorToColor4(Color.DarkGray)); - } else { - OpenTaiko.Tx.Puchichara[pos].tx?.tUpdateColor4(CConversion.ColorToColor4(Color.White)); - OpenTaiko.Tx.Heya_Center_Menu_Box_Slot?.tUpdateColor4(CConversion.ColorToColor4(Color.White)); - OpenTaiko.Tx.Heya_Lock?.tUpdateColor4(CConversion.ColorToColor4(Color.White)); - } - - var scroll = DrawBox_Slot(i + (OpenTaiko.Skin.Heya_Center_Menu_Box_Count / 2)); - - int puriColumn = pos % 5; - int puriRow = pos / 5; - - if (OpenTaiko.Tx.Puchichara[pos].tx != null) { - float puchiScale = OpenTaiko.Skin.Resolution[1] / 1080.0f; - - OpenTaiko.Tx.Puchichara[pos].tx.vcScaleRatio.X = puchiScale; - OpenTaiko.Tx.Puchichara[pos].tx.vcScaleRatio.Y = puchiScale; - } - - OpenTaiko.Tx.Puchichara[pos].tx?.t2D拡大率考慮中央基準描画(scroll.Item1 + OpenTaiko.Skin.Heya_Center_Menu_Box_Item_Offset[0], - scroll.Item2 + OpenTaiko.Skin.Heya_Center_Menu_Box_Item_Offset[1] + (int)(PuchiChara.sineY), - new Rectangle((PuchiChara.Counter.CurrentValue + 2 * puriColumn) * OpenTaiko.Skin.Game_PuchiChara[0], + OpenTaiko.Tx.Puchichara[pos].tx?.t2D拡大率考慮中央基準描画(scroll.Item1 + OpenTaiko.Skin.Heya_Center_Menu_Box_Item_Offset[0], + scroll.Item2 + OpenTaiko.Skin.Heya_Center_Menu_Box_Item_Offset[1] + (int)(PuchiChara.sineY), + new Rectangle((PuchiChara.Counter.CurrentValue + 2 * puriColumn) * OpenTaiko.Skin.Game_PuchiChara[0], puriRow * OpenTaiko.Skin.Game_PuchiChara[1], OpenTaiko.Skin.Game_PuchiChara[0], OpenTaiko.Skin.Game_PuchiChara[1])); - OpenTaiko.Tx.Puchichara[pos].tx?.tUpdateColor4(CConversion.ColorToColor4(Color.White)); + OpenTaiko.Tx.Puchichara[pos].tx?.tUpdateColor4(CConversion.ColorToColor4(Color.White)); - #region [Database related values] - - if (ttkPuchiCharaNames[pos] != null) { - CTexture tmpTex = TitleTextureKey.ResolveTitleTexture(ttkPuchiCharaNames[pos]); - - tmpTex.t2D拡大率考慮上中央基準描画(scroll.Item1 + OpenTaiko.Skin.Heya_Center_Menu_Box_Name_Offset[0], - scroll.Item2 + OpenTaiko.Skin.Heya_Center_Menu_Box_Name_Offset[1]); - } - - if (ttkPuchiCharaAuthors[pos] != null) { - CTexture tmpTex = TitleTextureKey.ResolveTitleTexture(ttkPuchiCharaAuthors[pos]); - - tmpTex.t2D拡大率考慮上中央基準描画(scroll.Item1 + OpenTaiko.Skin.Heya_Center_Menu_Box_Authors_Offset[0], - scroll.Item2 + OpenTaiko.Skin.Heya_Center_Menu_Box_Authors_Offset[1]); - } - - if (OpenTaiko.Tx.Puchichara[pos].unlock != null - && !OpenTaiko.SaveFileInstances[iPlayer].data.UnlockedPuchicharas.Contains(OpenTaiko.Skin.Puchicharas_Name[pos])) - OpenTaiko.Tx.Heya_Lock?.t2D拡大率考慮上中央基準描画(scroll.Item1, scroll.Item2); - - #endregion + #region [Database related values] + if (ttkPuchiCharaNames[pos] != null) { + CTexture tmpTex = TitleTextureKey.ResolveTitleTexture(ttkPuchiCharaNames[pos]); + tmpTex.t2D拡大率考慮上中央基準描画(scroll.Item1 + OpenTaiko.Skin.Heya_Center_Menu_Box_Name_Offset[0], + scroll.Item2 + OpenTaiko.Skin.Heya_Center_Menu_Box_Name_Offset[1]); } - } - #endregion + if (ttkPuchiCharaAuthors[pos] != null) { + CTexture tmpTex = TitleTextureKey.ResolveTitleTexture(ttkPuchiCharaAuthors[pos]); - #region [Character] - - if (iCurrentMenu == 1) { - for (int i = -(OpenTaiko.Skin.Heya_Center_Menu_Box_Count / 2); i < (OpenTaiko.Skin.Heya_Center_Menu_Box_Count / 2) + 1; i++) { - int pos = (iCharacterCount * 5 + iCharacterCurrent + i) % iCharacterCount; - - float charaRatioX = 1.0f; - float charaRatioY = 1.0f; - - if (i != 0) { - OpenTaiko.Tx.Characters_Heya_Preview[pos]?.tUpdateColor4(CConversion.ColorToColor4(Color.DarkGray)); - OpenTaiko.Tx.Heya_Center_Menu_Box_Slot?.tUpdateColor4(CConversion.ColorToColor4(Color.DarkGray)); - OpenTaiko.Tx.Heya_Lock?.tUpdateColor4(CConversion.ColorToColor4(Color.DarkGray)); - } else { - OpenTaiko.Tx.Characters_Heya_Preview[pos]?.tUpdateColor4(CConversion.ColorToColor4(Color.White)); - OpenTaiko.Tx.Heya_Center_Menu_Box_Slot?.tUpdateColor4(CConversion.ColorToColor4(Color.White)); - OpenTaiko.Tx.Heya_Lock?.tUpdateColor4(CConversion.ColorToColor4(Color.White)); - } - - var scroll = DrawBox_Slot(i + (OpenTaiko.Skin.Heya_Center_Menu_Box_Count / 2)); - - if (OpenTaiko.Skin.Characters_Resolution[pos] != null) { - charaRatioX = OpenTaiko.Skin.Resolution[0] / (float)OpenTaiko.Skin.Characters_Resolution[pos][0]; - charaRatioY = OpenTaiko.Skin.Resolution[1] / (float)OpenTaiko.Skin.Characters_Resolution[pos][1]; - } - - if (OpenTaiko.Tx.Characters_Heya_Preview[pos] != null) { - OpenTaiko.Tx.Characters_Heya_Preview[pos].vcScaleRatio.X = charaRatioX; - OpenTaiko.Tx.Characters_Heya_Preview[pos].vcScaleRatio.Y = charaRatioY; - } - - OpenTaiko.Tx.Characters_Heya_Preview[pos]?.t2D拡大率考慮中央基準描画(scroll.Item1 + OpenTaiko.Skin.Heya_Center_Menu_Box_Item_Offset[0], - scroll.Item2 + OpenTaiko.Skin.Heya_Center_Menu_Box_Item_Offset[1]); - - OpenTaiko.Tx.Characters_Heya_Preview[pos]?.tUpdateColor4(CConversion.ColorToColor4(Color.White)); - - #region [Database related values] - - if (ttkCharacterNames[pos] != null) { - CTexture tmpTex = TitleTextureKey.ResolveTitleTexture(ttkCharacterNames[pos]); - - tmpTex.t2D拡大率考慮上中央基準描画(scroll.Item1 + OpenTaiko.Skin.Heya_Center_Menu_Box_Name_Offset[0], - scroll.Item2 + OpenTaiko.Skin.Heya_Center_Menu_Box_Name_Offset[1]); - } - - if (ttkCharacterAuthors[pos] != null) { - CTexture tmpTex = TitleTextureKey.ResolveTitleTexture(ttkCharacterAuthors[pos]); - - tmpTex.t2D拡大率考慮上中央基準描画(scroll.Item1 + OpenTaiko.Skin.Heya_Center_Menu_Box_Authors_Offset[0], - scroll.Item2 + OpenTaiko.Skin.Heya_Center_Menu_Box_Authors_Offset[1]); - } - - if (OpenTaiko.Tx.Characters[pos].unlock != null - && !OpenTaiko.SaveFileInstances[iPlayer].data.UnlockedCharacters.Contains(OpenTaiko.Skin.Characters_DirName[pos])) - OpenTaiko.Tx.Heya_Lock?.t2D拡大率考慮上中央基準描画(scroll.Item1, scroll.Item2); - - #endregion + tmpTex.t2D拡大率考慮上中央基準描画(scroll.Item1 + OpenTaiko.Skin.Heya_Center_Menu_Box_Authors_Offset[0], + scroll.Item2 + OpenTaiko.Skin.Heya_Center_Menu_Box_Authors_Offset[1]); } - } - #endregion - - #region [Dan title] - - if (iCurrentMenu == 2) { - for (int i = -(OpenTaiko.Skin.Heya_Side_Menu_Count / 2); i < (OpenTaiko.Skin.Heya_Side_Menu_Count / 2) + 1; i++) { - int pos = (this.ttkDanTitles.Length * 5 + iDanTitleCurrent + i) % this.ttkDanTitles.Length; - - CTexture tmpTex = TitleTextureKey.ResolveTitleTexture(this.ttkDanTitles[pos]); - - if (i != 0) { - tmpTex.color4 = CConversion.ColorToColor4(Color.DarkGray); - OpenTaiko.Tx.Heya_Side_Menu.color4 = CConversion.ColorToColor4(Color.DarkGray); - //TJAPlayer3.Tx.NamePlateBase.color4 = CConversion.ColorToColor4(Color.DarkGray); - } else { - tmpTex.color4 = CConversion.ColorToColor4(Color.White); - OpenTaiko.Tx.Heya_Side_Menu.color4 = CConversion.ColorToColor4(Color.White); - //TJAPlayer3.Tx.NamePlateBase.color4 = CConversion.ColorToColor4(Color.White); - } - - int danGrade = 0; - if (pos > 0) { - danGrade = OpenTaiko.SaveFileInstances[iPlayer].data.DanTitles[this.sDanTitles[pos]].clearStatus; - } - - var scroll = DrawSide_Menu(i + (OpenTaiko.Skin.Heya_Side_Menu_Count / 2)); - - /* - TJAPlayer3.NamePlate.tNamePlateDisplayNamePlateBase( - scroll.Item1 - TJAPlayer3.Tx.NamePlateBase.szTextureSize.Width / 2, - scroll.Item2 - TJAPlayer3.Tx.NamePlateBase.szTextureSize.Height / 24, - (8 + danGrade)); - TJAPlayer3.Tx.NamePlateBase.color4 = CConversion.ColorToColor4(Color.White); - - tmpTex.t2D拡大率考慮上中央基準描画(scroll.Item1 + TJAPlayer3.Skin.Heya_Side_Menu_Font_Offset[0], scroll.Item2 + TJAPlayer3.Skin.Heya_Side_Menu_Font_Offset[1]); - */ - OpenTaiko.NamePlate.lcNamePlate.DrawDan(scroll.Item1, scroll.Item2, 255, danGrade, tmpTex); - - } - } - - #endregion - - #region [Title plate] - - if (iCurrentMenu == 3) { - for (int i = -(OpenTaiko.Skin.Heya_Side_Menu_Count / 2); i < (OpenTaiko.Skin.Heya_Side_Menu_Count / 2) + 1; i++) { - int pos = (this.ttkTitles.Length * 5 + iTitleCurrent + i) % this.ttkTitles.Length; - - CTexture tmpTex = TitleTextureKey.ResolveTitleTexture(this.ttkTitles[pos]); - - if (i != 0) { - tmpTex.color4 = CConversion.ColorToColor4(Color.DarkGray); - OpenTaiko.Tx.Heya_Side_Menu.color4 = CConversion.ColorToColor4(Color.DarkGray); - } else { - tmpTex.color4 = CConversion.ColorToColor4(Color.White); - OpenTaiko.Tx.Heya_Side_Menu.color4 = CConversion.ColorToColor4(Color.White); - } - - var scroll = DrawSide_Menu(i + (OpenTaiko.Skin.Heya_Side_Menu_Count / 2)); - - int iType = -1; - int _rarity = 1; - int _titleid = -1; - - if (OpenTaiko.SaveFileInstances[iPlayer].data.UnlockedNameplateIds != null && - OpenTaiko.SaveFileInstances[iPlayer].data.UnlockedNameplateIds.Contains(this.titlesKeys[pos])) { - var _dc = OpenTaiko.Databases.DBNameplateUnlockables.data[this.titlesKeys[pos]]; - iType = _dc.nameplateInfo.iType; - _rarity = HRarity.tRarityToLangInt(_dc.rarity); - _titleid = this.titlesKeys[pos]; - //iType = TJAPlayer3.SaveFileInstances[iPlayer].data.NamePlateTitles[this.titlesKeys[pos]].iType; - } else if (pos == 0) - iType = 0; - - /* - if (iType >= 0 && iType < TJAPlayer3.Skin.Config_NamePlate_Ptn_Title) - { - TJAPlayer3.Tx.NamePlate_Title[iType][TJAPlayer3.NamePlate.ctAnimatedNamePlateTitle.CurrentValue % TJAPlayer3.Skin.Config_NamePlate_Ptn_Title_Boxes[iType]].t2D拡大率考慮上中央基準描画( - scroll.Item1, - scroll.Item2); - - } - */ - OpenTaiko.NamePlate.lcNamePlate.DrawTitlePlate(scroll.Item1, scroll.Item2, 255, iType, tmpTex, _rarity, _titleid); - - //tmpTex.t2D拡大率考慮上中央基準描画(scroll.Item1 + TJAPlayer3.Skin.Heya_Side_Menu_Font_Offset[0], scroll.Item2 + TJAPlayer3.Skin.Heya_Side_Menu_Font_Offset[1]); - - } - } - - #endregion - - #endregion - - #region [Description area] - - if (iCurrentMenu >= 0) { - #region [Unlockable information zone] - - if (this.ttkInfoSection != null && this.ttkInfoSection.str != "") - OpenTaiko.Tx.Heya_Box?.t2D描画(0, 0); - - if (this.ttkInfoSection != null) - TitleTextureKey.ResolveTitleTexture(this.ttkInfoSection) - .t2D拡大率考慮上中央基準描画(OpenTaiko.Skin.Heya_InfoSection[0], OpenTaiko.Skin.Heya_InfoSection[1]); + if (OpenTaiko.Tx.Puchichara[pos].unlock != null + && !OpenTaiko.SaveFileInstances[iPlayer].data.UnlockedPuchicharas.Contains(OpenTaiko.Skin.Puchicharas_Name[pos])) + OpenTaiko.Tx.Heya_Lock?.t2D拡大率考慮上中央基準描画(scroll.Item1, scroll.Item2); #endregion - #region [Asset description] - if (this.ttkInfoSection == null || this.ttkInfoSection.str == "") { - if (iCurrentMenu == 0) CHeyaDisplayAssetInformations.DisplayPuchicharaInfo(this.pfHeyaFont, OpenTaiko.Tx.Puchichara[iPuchiCharaCurrent]); - if (iCurrentMenu == 1) CHeyaDisplayAssetInformations.DisplayCharacterInfo(this.pfHeyaFont, OpenTaiko.Tx.Characters[iCharacterCurrent]); - } - - #endregion } + } - #endregion + #endregion - #region [General Chara animations] + #region [Character] - if (!ctChara_In.IsStarted) { - OpenTaiko.Skin.soundHeyaBGM.tPlay(); - ctChara_In.Start(0, 180, 1.25f, OpenTaiko.Timer); - } + if (iCurrentMenu == 1) { + for (int i = -(OpenTaiko.Skin.Heya_Center_Menu_Box_Count / 2); i < (OpenTaiko.Skin.Heya_Center_Menu_Box_Count / 2) + 1; i++) { + int pos = (iCharacterCount * 5 + iCharacterCurrent + i) % iCharacterCount; - #region [ キャラ関連 ] + float charaRatioX = 1.0f; + float charaRatioY = 1.0f; - if (ctChara_In.CurrentValue != 90) { - float CharaX = 0f, CharaY = 0f; - - CharaX = -200 + (float)Math.Sin(ctChara_In.CurrentValue / 2 * (Math.PI / 180)) * 200f; - CharaY = ((float)Math.Sin((90 + (ctChara_In.CurrentValue / 2)) * (Math.PI / 180)) * 150f); - - //int _charaId = TJAPlayer3.NamePlateConfig.data.Character[TJAPlayer3.GetActualPlayer(0)]; - - //int chara_x = (int)(TJAPlayer3.Skin.Characters_Menu_X[_charaId][0] + (-200 + CharaX)); - //int chara_y = (int)(TJAPlayer3.Skin.Characters_Menu_Y[_charaId][0] - CharaY); - - int chara_x = (int)CharaX + OpenTaiko.Skin.SongSelect_NamePlate_X[0] + OpenTaiko.Tx.NamePlateBase.szTextureSize.Width / 2; - int chara_y = OpenTaiko.Skin.SongSelect_NamePlate_Y[0] - (int)CharaY; - - int puchi_x = chara_x + OpenTaiko.Skin.Adjustments_MenuPuchichara_X[0]; - int puchi_y = chara_y + OpenTaiko.Skin.Adjustments_MenuPuchichara_Y[0]; - - //TJAPlayer3.Tx.SongSelect_Chara_Normal[ctChara_Normal.n現在の値].Opacity = ctChara_In.n現在の値 * 2; - //TJAPlayer3.Tx.SongSelect_Chara_Normal[ctChara_Normal.n現在の値].t2D描画(-200 + CharaX, 336 - CharaY); - - CMenuCharacter.tMenuDisplayCharacter(0, chara_x, chara_y, CMenuCharacter.ECharacterAnimation.NORMAL); - - #region [PuchiChara] - - this.PuchiChara.On進行描画(puchi_x, puchi_y, false); - - #endregion - } - - #endregion - - OpenTaiko.NamePlate.tNamePlateDraw(OpenTaiko.Skin.SongSelect_NamePlate_X[0], OpenTaiko.Skin.SongSelect_NamePlate_Y[0] + 5, 0); - - #endregion - - - - #region [ Inputs ] - - if (OpenTaiko.InputManager.Keyboard.KeyPressing((int)SlimDXKeys.Key.RightArrow) || - OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.RightChange)) { - if (this.tMove(1)) { - OpenTaiko.Skin.soundChangeSFX.tPlay(); - } - } else if (OpenTaiko.InputManager.Keyboard.KeyPressing((int)SlimDXKeys.Key.LeftArrow) || - OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.LeftChange)) { - if (this.tMove(-1)) { - OpenTaiko.Skin.soundChangeSFX.tPlay(); - } - } else if (OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Return) || - OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.Decide)) { - - #region [Decide] - - ESelectStatus ess = ESelectStatus.SELECTED; - - // Return to main menu - if (iCurrentMenu == -1 && iMainMenuCurrent == 0) { - OpenTaiko.Skin.soundHeyaBGM.tStop(); - this.eフェードアウト完了時の戻り値 = E戻り値.タイトルに戻る; - this.actFOtoTitle.tフェードアウト開始(); - base.ePhaseID = CStage.EPhase.Common_FADEOUT; - } else if (iCurrentMenu == -1) { - iCurrentMenu = iMainMenuCurrent - 1; - - if (iCurrentMenu == 0) { - this.tUpdateUnlockableTextChara(); - this.tUpdateUnlockableTextPuchi(); - } - } else if (iCurrentMenu == 0) { - ess = this.tSelectPuchi(); - - if (ess == ESelectStatus.SELECTED) { - //PuchiChara.tGetPuchiCharaIndexByName(p); - //TJAPlayer3.NamePlateConfig.data.PuchiChara[iPlayer] = TJAPlayer3.Skin.Puchicharas_Name[iPuchiCharaCurrent];// iPuchiCharaCurrent; - //TJAPlayer3.NamePlateConfig.tApplyHeyaChanges(); - OpenTaiko.SaveFileInstances[iPlayer].data.PuchiChara = OpenTaiko.Skin.Puchicharas_Name[iPuchiCharaCurrent];// iPuchiCharaCurrent; - OpenTaiko.SaveFileInstances[iPlayer].tApplyHeyaChanges(); - OpenTaiko.Tx.Puchichara[iPuchiCharaCurrent].welcome.tPlay(); - - iCurrentMenu = -1; - this.tResetOpts(); - } else if (ess == ESelectStatus.SUCCESS) { - //TJAPlayer3.NamePlateConfig.data.UnlockedPuchicharas[iPlayer].Add(TJAPlayer3.Skin.Puchicharas_Name[iPuchiCharaCurrent]); - //TJAPlayer3.NamePlateConfig.tSpendCoins(TJAPlayer3.Tx.Puchichara[iPuchiCharaCurrent].unlock.Values[0], iPlayer); - OpenTaiko.SaveFileInstances[iPlayer].data.UnlockedPuchicharas.Add(OpenTaiko.Skin.Puchicharas_Name[iPuchiCharaCurrent]); - DBSaves.RegisterStringUnlockedAsset(OpenTaiko.SaveFileInstances[iPlayer].data.SaveId, "unlocked_puchicharas", OpenTaiko.Skin.Puchicharas_Name[iPuchiCharaCurrent]); - OpenTaiko.SaveFileInstances[iPlayer].tSpendCoins(OpenTaiko.Tx.Puchichara[iPuchiCharaCurrent].unlock.Values[0]); - - } - } else if (iCurrentMenu == 1) { - ess = this.tSelectChara(); - - if (ess == ESelectStatus.SELECTED) { - //TJAPlayer3.Tx.Loading?.t2D描画(18, 7); - - // Reload character, a bit time expensive but with a O(N) memory complexity instead of O(N * M) - OpenTaiko.Tx.ReloadCharacter(OpenTaiko.SaveFileInstances[iPlayer].data.Character, iCharacterCurrent, iPlayer); - OpenTaiko.SaveFileInstances[iPlayer].data.Character = iCharacterCurrent; - - // Update the character - OpenTaiko.SaveFileInstances[iPlayer].tUpdateCharacterName(OpenTaiko.Skin.Characters_DirName[iCharacterCurrent]); - - // Welcome voice using Sanka - OpenTaiko.Skin.voiceTitleSanka[iPlayer]?.tPlay(); - - CMenuCharacter.tMenuResetTimer(CMenuCharacter.ECharacterAnimation.NORMAL); - - OpenTaiko.SaveFileInstances[iPlayer].tApplyHeyaChanges(); - - iCurrentMenu = -1; - this.tResetOpts(); - } else if (ess == ESelectStatus.SUCCESS) { - OpenTaiko.SaveFileInstances[iPlayer].data.UnlockedCharacters.Add(OpenTaiko.Skin.Characters_DirName[iCharacterCurrent]); - DBSaves.RegisterStringUnlockedAsset(OpenTaiko.SaveFileInstances[iPlayer].data.SaveId, "unlocked_characters", OpenTaiko.Skin.Characters_DirName[iCharacterCurrent]); - OpenTaiko.SaveFileInstances[iPlayer].tSpendCoins(OpenTaiko.Tx.Characters[iCharacterCurrent].unlock.Values[0]); - // Play modal animation here ? - } - } else if (iCurrentMenu == 2) { - bool iG = false; - int cs = 0; - - if (iDanTitleCurrent > 0) { - iG = OpenTaiko.SaveFileInstances[iPlayer].data.DanTitles[this.sDanTitles[iDanTitleCurrent]].isGold; - cs = OpenTaiko.SaveFileInstances[iPlayer].data.DanTitles[this.sDanTitles[iDanTitleCurrent]].clearStatus; - } - - OpenTaiko.SaveFileInstances[iPlayer].data.Dan = this.sDanTitles[iDanTitleCurrent]; - OpenTaiko.SaveFileInstances[iPlayer].data.DanGold = iG; - OpenTaiko.SaveFileInstances[iPlayer].data.DanType = cs; - - OpenTaiko.NamePlate.tNamePlateRefreshTitles(0); - - OpenTaiko.SaveFileInstances[iPlayer].tApplyHeyaChanges(); - - iCurrentMenu = -1; - this.tResetOpts(); - } else if (iCurrentMenu == 3) { - OpenTaiko.SaveFileInstances[iPlayer].data.Title = this.ttkTitles[iTitleCurrent].str; - - if (OpenTaiko.SaveFileInstances[iPlayer].data.UnlockedNameplateIds != null - && OpenTaiko.SaveFileInstances[iPlayer].data.UnlockedNameplateIds.Contains(this.titlesKeys[iTitleCurrent])) { - var _dc = OpenTaiko.Databases.DBNameplateUnlockables.data[this.titlesKeys[iTitleCurrent]]; - OpenTaiko.SaveFileInstances[iPlayer].data.TitleType = _dc.nameplateInfo.iType; - OpenTaiko.SaveFileInstances[iPlayer].data.TitleId = this.titlesKeys[iTitleCurrent]; - OpenTaiko.SaveFileInstances[iPlayer].data.TitleRarityInt = HRarity.tRarityToLangInt(_dc.rarity); - } else if (iTitleCurrent == 0) { - OpenTaiko.SaveFileInstances[iPlayer].data.TitleType = 0; - OpenTaiko.SaveFileInstances[iPlayer].data.TitleId = -1; - OpenTaiko.SaveFileInstances[iPlayer].data.TitleRarityInt = 1; - } else { - OpenTaiko.SaveFileInstances[iPlayer].data.TitleType = -1; - OpenTaiko.SaveFileInstances[iPlayer].data.TitleId = -1; - OpenTaiko.SaveFileInstances[iPlayer].data.TitleRarityInt = 1; - } - - - OpenTaiko.NamePlate.tNamePlateRefreshTitles(0); - - OpenTaiko.SaveFileInstances[iPlayer].tApplyHeyaChanges(); - - iCurrentMenu = -1; - this.tResetOpts(); - } - - if (ess == ESelectStatus.SELECTED) - OpenTaiko.Skin.soundDecideSFX.tPlay(); - else if (ess == ESelectStatus.FAILED) - OpenTaiko.Skin.soundError.tPlay(); - else - OpenTaiko.Skin.SoundBanapas.tPlay(); // To change with a more appropriate sfx sooner or later - - #endregion - } else if (OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Escape) || - OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.Cancel)) { - - OpenTaiko.Skin.soundCancelSFX.tPlay(); - - if (iCurrentMenu == -1) { - OpenTaiko.Skin.soundHeyaBGM.tStop(); - this.eフェードアウト完了時の戻り値 = E戻り値.タイトルに戻る; - this.actFOtoTitle.tフェードアウト開始(); - base.ePhaseID = CStage.EPhase.Common_FADEOUT; + if (i != 0) { + OpenTaiko.Tx.Characters_Heya_Preview[pos]?.tUpdateColor4(CConversion.ColorToColor4(Color.DarkGray)); + OpenTaiko.Tx.Heya_Center_Menu_Box_Slot?.tUpdateColor4(CConversion.ColorToColor4(Color.DarkGray)); + OpenTaiko.Tx.Heya_Lock?.tUpdateColor4(CConversion.ColorToColor4(Color.DarkGray)); } else { - iCurrentMenu = -1; - this.ttkInfoSection = null; - this.tResetOpts(); + OpenTaiko.Tx.Characters_Heya_Preview[pos]?.tUpdateColor4(CConversion.ColorToColor4(Color.White)); + OpenTaiko.Tx.Heya_Center_Menu_Box_Slot?.tUpdateColor4(CConversion.ColorToColor4(Color.White)); + OpenTaiko.Tx.Heya_Lock?.tUpdateColor4(CConversion.ColorToColor4(Color.White)); } + var scroll = DrawBox_Slot(i + (OpenTaiko.Skin.Heya_Center_Menu_Box_Count / 2)); - return 0; + if (OpenTaiko.Skin.Characters_Resolution[pos] != null) { + charaRatioX = OpenTaiko.Skin.Resolution[0] / (float)OpenTaiko.Skin.Characters_Resolution[pos][0]; + charaRatioY = OpenTaiko.Skin.Resolution[1] / (float)OpenTaiko.Skin.Characters_Resolution[pos][1]; + } + + if (OpenTaiko.Tx.Characters_Heya_Preview[pos] != null) { + OpenTaiko.Tx.Characters_Heya_Preview[pos].vcScaleRatio.X = charaRatioX; + OpenTaiko.Tx.Characters_Heya_Preview[pos].vcScaleRatio.Y = charaRatioY; + } + + OpenTaiko.Tx.Characters_Heya_Preview[pos]?.t2D拡大率考慮中央基準描画(scroll.Item1 + OpenTaiko.Skin.Heya_Center_Menu_Box_Item_Offset[0], + scroll.Item2 + OpenTaiko.Skin.Heya_Center_Menu_Box_Item_Offset[1]); + + OpenTaiko.Tx.Characters_Heya_Preview[pos]?.tUpdateColor4(CConversion.ColorToColor4(Color.White)); + + #region [Database related values] + + if (ttkCharacterNames[pos] != null) { + CTexture tmpTex = TitleTextureKey.ResolveTitleTexture(ttkCharacterNames[pos]); + + tmpTex.t2D拡大率考慮上中央基準描画(scroll.Item1 + OpenTaiko.Skin.Heya_Center_Menu_Box_Name_Offset[0], + scroll.Item2 + OpenTaiko.Skin.Heya_Center_Menu_Box_Name_Offset[1]); + } + + if (ttkCharacterAuthors[pos] != null) { + CTexture tmpTex = TitleTextureKey.ResolveTitleTexture(ttkCharacterAuthors[pos]); + + tmpTex.t2D拡大率考慮上中央基準描画(scroll.Item1 + OpenTaiko.Skin.Heya_Center_Menu_Box_Authors_Offset[0], + scroll.Item2 + OpenTaiko.Skin.Heya_Center_Menu_Box_Authors_Offset[1]); + } + + if (OpenTaiko.Tx.Characters[pos].unlock != null + && !OpenTaiko.SaveFileInstances[iPlayer].data.UnlockedCharacters.Contains(OpenTaiko.Skin.Characters_DirName[pos])) + OpenTaiko.Tx.Heya_Lock?.t2D拡大率考慮上中央基準描画(scroll.Item1, scroll.Item2); + + #endregion } + } + + #endregion + + #region [Dan title] + + if (iCurrentMenu == 2) { + for (int i = -(OpenTaiko.Skin.Heya_Side_Menu_Count / 2); i < (OpenTaiko.Skin.Heya_Side_Menu_Count / 2) + 1; i++) { + int pos = (this.ttkDanTitles.Length * 5 + iDanTitleCurrent + i) % this.ttkDanTitles.Length; + + CTexture tmpTex = TitleTextureKey.ResolveTitleTexture(this.ttkDanTitles[pos]); + + if (i != 0) { + tmpTex.color4 = CConversion.ColorToColor4(Color.DarkGray); + OpenTaiko.Tx.Heya_Side_Menu.color4 = CConversion.ColorToColor4(Color.DarkGray); + //TJAPlayer3.Tx.NamePlateBase.color4 = CConversion.ColorToColor4(Color.DarkGray); + } else { + tmpTex.color4 = CConversion.ColorToColor4(Color.White); + OpenTaiko.Tx.Heya_Side_Menu.color4 = CConversion.ColorToColor4(Color.White); + //TJAPlayer3.Tx.NamePlateBase.color4 = CConversion.ColorToColor4(Color.White); + } + + int danGrade = 0; + if (pos > 0) { + danGrade = OpenTaiko.SaveFileInstances[iPlayer].data.DanTitles[this.sDanTitles[pos]].clearStatus; + } + + var scroll = DrawSide_Menu(i + (OpenTaiko.Skin.Heya_Side_Menu_Count / 2)); + + /* + TJAPlayer3.NamePlate.tNamePlateDisplayNamePlateBase( + scroll.Item1 - TJAPlayer3.Tx.NamePlateBase.szTextureSize.Width / 2, + scroll.Item2 - TJAPlayer3.Tx.NamePlateBase.szTextureSize.Height / 24, + (8 + danGrade)); + TJAPlayer3.Tx.NamePlateBase.color4 = CConversion.ColorToColor4(Color.White); + + tmpTex.t2D拡大率考慮上中央基準描画(scroll.Item1 + TJAPlayer3.Skin.Heya_Side_Menu_Font_Offset[0], scroll.Item2 + TJAPlayer3.Skin.Heya_Side_Menu_Font_Offset[1]); + */ + OpenTaiko.NamePlate.lcNamePlate.DrawDan(scroll.Item1, scroll.Item2, 255, danGrade, tmpTex); + + } + } + + #endregion + + #region [Title plate] + + if (iCurrentMenu == 3) { + for (int i = -(OpenTaiko.Skin.Heya_Side_Menu_Count / 2); i < (OpenTaiko.Skin.Heya_Side_Menu_Count / 2) + 1; i++) { + int pos = (this.ttkTitles.Length * 5 + iTitleCurrent + i) % this.ttkTitles.Length; + + CTexture tmpTex = TitleTextureKey.ResolveTitleTexture(this.ttkTitles[pos]); + + if (i != 0) { + tmpTex.color4 = CConversion.ColorToColor4(Color.DarkGray); + OpenTaiko.Tx.Heya_Side_Menu.color4 = CConversion.ColorToColor4(Color.DarkGray); + } else { + tmpTex.color4 = CConversion.ColorToColor4(Color.White); + OpenTaiko.Tx.Heya_Side_Menu.color4 = CConversion.ColorToColor4(Color.White); + } + + var scroll = DrawSide_Menu(i + (OpenTaiko.Skin.Heya_Side_Menu_Count / 2)); + + int iType = -1; + int _rarity = 1; + int _titleid = -1; + + if (OpenTaiko.SaveFileInstances[iPlayer].data.UnlockedNameplateIds != null && + OpenTaiko.SaveFileInstances[iPlayer].data.UnlockedNameplateIds.Contains(this.titlesKeys[pos])) { + var _dc = OpenTaiko.Databases.DBNameplateUnlockables.data[this.titlesKeys[pos]]; + iType = _dc.nameplateInfo.iType; + _rarity = HRarity.tRarityToLangInt(_dc.rarity); + _titleid = this.titlesKeys[pos]; + //iType = TJAPlayer3.SaveFileInstances[iPlayer].data.NamePlateTitles[this.titlesKeys[pos]].iType; + } else if (pos == 0) + iType = 0; + + /* + if (iType >= 0 && iType < TJAPlayer3.Skin.Config_NamePlate_Ptn_Title) + { + TJAPlayer3.Tx.NamePlate_Title[iType][TJAPlayer3.NamePlate.ctAnimatedNamePlateTitle.CurrentValue % TJAPlayer3.Skin.Config_NamePlate_Ptn_Title_Boxes[iType]].t2D拡大率考慮上中央基準描画( + scroll.Item1, + scroll.Item2); + + } + */ + OpenTaiko.NamePlate.lcNamePlate.DrawTitlePlate(scroll.Item1, scroll.Item2, 255, iType, tmpTex, _rarity, _titleid); + + //tmpTex.t2D拡大率考慮上中央基準描画(scroll.Item1 + TJAPlayer3.Skin.Heya_Side_Menu_Font_Offset[0], scroll.Item2 + TJAPlayer3.Skin.Heya_Side_Menu_Font_Offset[1]); + + } + } + + #endregion + + #endregion + + #region [Description area] + + if (iCurrentMenu >= 0) { + #region [Unlockable information zone] + + if (this.ttkInfoSection != null && this.ttkInfoSection.str != "") + OpenTaiko.Tx.Heya_Box?.t2D描画(0, 0); + + if (this.ttkInfoSection != null) + TitleTextureKey.ResolveTitleTexture(this.ttkInfoSection) + .t2D拡大率考慮上中央基準描画(OpenTaiko.Skin.Heya_InfoSection[0], OpenTaiko.Skin.Heya_InfoSection[1]); #endregion - switch (base.ePhaseID) { - case CStage.EPhase.Common_FADEOUT: - if (this.actFOtoTitle.Draw() == 0) { - break; - } - return (int)this.eフェードアウト完了時の戻り値; + #region [Asset description] + if (this.ttkInfoSection == null || this.ttkInfoSection.str == "") { + if (iCurrentMenu == 0) CHeyaDisplayAssetInformations.DisplayPuchicharaInfo(this.pfHeyaFont, OpenTaiko.Tx.Puchichara[iPuchiCharaCurrent]); + if (iCurrentMenu == 1) CHeyaDisplayAssetInformations.DisplayCharacterInfo(this.pfHeyaFont, OpenTaiko.Tx.Characters[iCharacterCurrent]); } + #endregion + } + + #endregion + + #region [General Chara animations] + + if (!ctChara_In.IsStarted) { + OpenTaiko.Skin.soundHeyaBGM.tPlay(); + ctChara_In.Start(0, 180, 1.25f, OpenTaiko.Timer); + } + + #region [ キャラ関連 ] + + if (ctChara_In.CurrentValue != 90) { + float CharaX = 0f, CharaY = 0f; + + CharaX = -200 + (float)Math.Sin(ctChara_In.CurrentValue / 2 * (Math.PI / 180)) * 200f; + CharaY = ((float)Math.Sin((90 + (ctChara_In.CurrentValue / 2)) * (Math.PI / 180)) * 150f); + + //int _charaId = TJAPlayer3.NamePlateConfig.data.Character[TJAPlayer3.GetActualPlayer(0)]; + + //int chara_x = (int)(TJAPlayer3.Skin.Characters_Menu_X[_charaId][0] + (-200 + CharaX)); + //int chara_y = (int)(TJAPlayer3.Skin.Characters_Menu_Y[_charaId][0] - CharaY); + + int chara_x = (int)CharaX + OpenTaiko.Skin.SongSelect_NamePlate_X[0] + OpenTaiko.Tx.NamePlateBase.szTextureSize.Width / 2; + int chara_y = OpenTaiko.Skin.SongSelect_NamePlate_Y[0] - (int)CharaY; + + int puchi_x = chara_x + OpenTaiko.Skin.Adjustments_MenuPuchichara_X[0]; + int puchi_y = chara_y + OpenTaiko.Skin.Adjustments_MenuPuchichara_Y[0]; + + //TJAPlayer3.Tx.SongSelect_Chara_Normal[ctChara_Normal.n現在の値].Opacity = ctChara_In.n現在の値 * 2; + //TJAPlayer3.Tx.SongSelect_Chara_Normal[ctChara_Normal.n現在の値].t2D描画(-200 + CharaX, 336 - CharaY); + + CMenuCharacter.tMenuDisplayCharacter(0, chara_x, chara_y, CMenuCharacter.ECharacterAnimation.NORMAL); + + #region [PuchiChara] + + this.PuchiChara.On進行描画(puchi_x, puchi_y, false); + + #endregion + } + + #endregion + + OpenTaiko.NamePlate.tNamePlateDraw(OpenTaiko.Skin.SongSelect_NamePlate_X[0], OpenTaiko.Skin.SongSelect_NamePlate_Y[0] + 5, 0); + + #endregion + + + + #region [ Inputs ] + + if (OpenTaiko.InputManager.Keyboard.KeyPressing((int)SlimDXKeys.Key.RightArrow) || + OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.RightChange)) { + if (this.tMove(1)) { + OpenTaiko.Skin.soundChangeSFX.tPlay(); + } + } else if (OpenTaiko.InputManager.Keyboard.KeyPressing((int)SlimDXKeys.Key.LeftArrow) || + OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.LeftChange)) { + if (this.tMove(-1)) { + OpenTaiko.Skin.soundChangeSFX.tPlay(); + } + } else if (OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Return) || + OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.Decide)) { + + #region [Decide] + + ESelectStatus ess = ESelectStatus.SELECTED; + + // Return to main menu + if (iCurrentMenu == -1 && iMainMenuCurrent == 0) { + OpenTaiko.Skin.soundHeyaBGM.tStop(); + this.eフェードアウト完了時の戻り値 = E戻り値.タイトルに戻る; + this.actFOtoTitle.tフェードアウト開始(); + base.ePhaseID = CStage.EPhase.Common_FADEOUT; + } else if (iCurrentMenu == -1) { + iCurrentMenu = iMainMenuCurrent - 1; + + if (iCurrentMenu == 0) { + this.tUpdateUnlockableTextChara(); + this.tUpdateUnlockableTextPuchi(); + } + } else if (iCurrentMenu == 0) { + ess = this.tSelectPuchi(); + + if (ess == ESelectStatus.SELECTED) { + //PuchiChara.tGetPuchiCharaIndexByName(p); + //TJAPlayer3.NamePlateConfig.data.PuchiChara[iPlayer] = TJAPlayer3.Skin.Puchicharas_Name[iPuchiCharaCurrent];// iPuchiCharaCurrent; + //TJAPlayer3.NamePlateConfig.tApplyHeyaChanges(); + OpenTaiko.SaveFileInstances[iPlayer].data.PuchiChara = OpenTaiko.Skin.Puchicharas_Name[iPuchiCharaCurrent];// iPuchiCharaCurrent; + OpenTaiko.SaveFileInstances[iPlayer].tApplyHeyaChanges(); + OpenTaiko.Tx.Puchichara[iPuchiCharaCurrent].welcome.tPlay(); + + iCurrentMenu = -1; + this.tResetOpts(); + } else if (ess == ESelectStatus.SUCCESS) { + //TJAPlayer3.NamePlateConfig.data.UnlockedPuchicharas[iPlayer].Add(TJAPlayer3.Skin.Puchicharas_Name[iPuchiCharaCurrent]); + //TJAPlayer3.NamePlateConfig.tSpendCoins(TJAPlayer3.Tx.Puchichara[iPuchiCharaCurrent].unlock.Values[0], iPlayer); + OpenTaiko.SaveFileInstances[iPlayer].data.UnlockedPuchicharas.Add(OpenTaiko.Skin.Puchicharas_Name[iPuchiCharaCurrent]); + DBSaves.RegisterStringUnlockedAsset(OpenTaiko.SaveFileInstances[iPlayer].data.SaveId, "unlocked_puchicharas", OpenTaiko.Skin.Puchicharas_Name[iPuchiCharaCurrent]); + OpenTaiko.SaveFileInstances[iPlayer].tSpendCoins(OpenTaiko.Tx.Puchichara[iPuchiCharaCurrent].unlock.Values[0]); + + } + } else if (iCurrentMenu == 1) { + ess = this.tSelectChara(); + + if (ess == ESelectStatus.SELECTED) { + //TJAPlayer3.Tx.Loading?.t2D描画(18, 7); + + // Reload character, a bit time expensive but with a O(N) memory complexity instead of O(N * M) + OpenTaiko.Tx.ReloadCharacter(OpenTaiko.SaveFileInstances[iPlayer].data.Character, iCharacterCurrent, iPlayer); + OpenTaiko.SaveFileInstances[iPlayer].data.Character = iCharacterCurrent; + + // Update the character + OpenTaiko.SaveFileInstances[iPlayer].tUpdateCharacterName(OpenTaiko.Skin.Characters_DirName[iCharacterCurrent]); + + // Welcome voice using Sanka + OpenTaiko.Skin.voiceTitleSanka[iPlayer]?.tPlay(); + + CMenuCharacter.tMenuResetTimer(CMenuCharacter.ECharacterAnimation.NORMAL); + + OpenTaiko.SaveFileInstances[iPlayer].tApplyHeyaChanges(); + + iCurrentMenu = -1; + this.tResetOpts(); + } else if (ess == ESelectStatus.SUCCESS) { + OpenTaiko.SaveFileInstances[iPlayer].data.UnlockedCharacters.Add(OpenTaiko.Skin.Characters_DirName[iCharacterCurrent]); + DBSaves.RegisterStringUnlockedAsset(OpenTaiko.SaveFileInstances[iPlayer].data.SaveId, "unlocked_characters", OpenTaiko.Skin.Characters_DirName[iCharacterCurrent]); + OpenTaiko.SaveFileInstances[iPlayer].tSpendCoins(OpenTaiko.Tx.Characters[iCharacterCurrent].unlock.Values[0]); + // Play modal animation here ? + } + } else if (iCurrentMenu == 2) { + bool iG = false; + int cs = 0; + + if (iDanTitleCurrent > 0) { + iG = OpenTaiko.SaveFileInstances[iPlayer].data.DanTitles[this.sDanTitles[iDanTitleCurrent]].isGold; + cs = OpenTaiko.SaveFileInstances[iPlayer].data.DanTitles[this.sDanTitles[iDanTitleCurrent]].clearStatus; + } + + OpenTaiko.SaveFileInstances[iPlayer].data.Dan = this.sDanTitles[iDanTitleCurrent]; + OpenTaiko.SaveFileInstances[iPlayer].data.DanGold = iG; + OpenTaiko.SaveFileInstances[iPlayer].data.DanType = cs; + + OpenTaiko.NamePlate.tNamePlateRefreshTitles(0); + + OpenTaiko.SaveFileInstances[iPlayer].tApplyHeyaChanges(); + + iCurrentMenu = -1; + this.tResetOpts(); + } else if (iCurrentMenu == 3) { + OpenTaiko.SaveFileInstances[iPlayer].data.Title = this.ttkTitles[iTitleCurrent].str; + + if (OpenTaiko.SaveFileInstances[iPlayer].data.UnlockedNameplateIds != null + && OpenTaiko.SaveFileInstances[iPlayer].data.UnlockedNameplateIds.Contains(this.titlesKeys[iTitleCurrent])) { + var _dc = OpenTaiko.Databases.DBNameplateUnlockables.data[this.titlesKeys[iTitleCurrent]]; + OpenTaiko.SaveFileInstances[iPlayer].data.TitleType = _dc.nameplateInfo.iType; + OpenTaiko.SaveFileInstances[iPlayer].data.TitleId = this.titlesKeys[iTitleCurrent]; + OpenTaiko.SaveFileInstances[iPlayer].data.TitleRarityInt = HRarity.tRarityToLangInt(_dc.rarity); + } else if (iTitleCurrent == 0) { + OpenTaiko.SaveFileInstances[iPlayer].data.TitleType = 0; + OpenTaiko.SaveFileInstances[iPlayer].data.TitleId = -1; + OpenTaiko.SaveFileInstances[iPlayer].data.TitleRarityInt = 1; + } else { + OpenTaiko.SaveFileInstances[iPlayer].data.TitleType = -1; + OpenTaiko.SaveFileInstances[iPlayer].data.TitleId = -1; + OpenTaiko.SaveFileInstances[iPlayer].data.TitleRarityInt = 1; + } + + + OpenTaiko.NamePlate.tNamePlateRefreshTitles(0); + + OpenTaiko.SaveFileInstances[iPlayer].tApplyHeyaChanges(); + + iCurrentMenu = -1; + this.tResetOpts(); + } + + if (ess == ESelectStatus.SELECTED) + OpenTaiko.Skin.soundDecideSFX.tPlay(); + else if (ess == ESelectStatus.FAILED) + OpenTaiko.Skin.soundError.tPlay(); + else + OpenTaiko.Skin.SoundBanapas.tPlay(); // To change with a more appropriate sfx sooner or later + + #endregion + } else if (OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Escape) || + OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.Cancel)) { + + OpenTaiko.Skin.soundCancelSFX.tPlay(); + + if (iCurrentMenu == -1) { + OpenTaiko.Skin.soundHeyaBGM.tStop(); + this.eフェードアウト完了時の戻り値 = E戻り値.タイトルに戻る; + this.actFOtoTitle.tフェードアウト開始(); + base.ePhaseID = CStage.EPhase.Common_FADEOUT; + } else { + iCurrentMenu = -1; + this.ttkInfoSection = null; + this.tResetOpts(); + } + + return 0; } - public enum E戻り値 : int { - 継続, - タイトルに戻る, - 選曲した - } - - public bool bInSongPlayed; - - private CCounter ctChara_In; - //private CCounter ctChara_Normal; - - private PuchiChara PuchiChara; - - private int iPlayer; - - private int iMainMenuCurrent; - private int iPuchiCharaCurrent; - - private TitleTextureKey[] ttkPuchiCharaNames; - private TitleTextureKey[] ttkPuchiCharaAuthors; - private TitleTextureKey[] ttkCharacterNames; - private TitleTextureKey[] ttkCharacterAuthors; - private TitleTextureKey ttkInfoSection; - - private int iCharacterCurrent; - private int iDanTitleCurrent; - private int iTitleCurrent; - - private int iCurrentMenu; - - private void tResetOpts() { - // Retrieve titles if they exist - //var _titles = TJAPlayer3.SaveFileInstances[iPlayer].data.NamePlateTitles; - var _titles = OpenTaiko.SaveFileInstances[iPlayer].data.UnlockedNameplateIds; - var _title = OpenTaiko.SaveFileInstances[iPlayer].data.Title; - var _dans = OpenTaiko.SaveFileInstances[iPlayer].data.DanTitles; - var _dan = OpenTaiko.SaveFileInstances[iPlayer].data.Dan; - - iTitleCurrent = 0; - - // Think of a replacement later - /* - if (_titles != null && _titles.ContainsKey(_title)) { } - iTitleCurrent = _titles.Keys.ToList().IndexOf(_title) + 1; - */ - - iDanTitleCurrent = 0; - - if (_dans != null && _dans.ContainsKey(_dan)) - iDanTitleCurrent = _dans.Keys.ToList().IndexOf(_dan) + 1; - - foreach (var plate in _titles.Select((value, i) => new { i, value })) { - if (OpenTaiko.SaveFileInstances[iPlayer].data.TitleId == plate.value) - iTitleCurrent = plate.i + 1; - } - - iCharacterCurrent = Math.Max(0, Math.Min(OpenTaiko.Skin.Characters_Ptn - 1, OpenTaiko.SaveFileInstances[iPlayer].data.Character)); - - //iPuchiCharaCurrent = Math.Max(0, Math.Min(TJAPlayer3.Skin.Puchichara_Ptn - 1, TJAPlayer3.NamePlateConfig.data.PuchiChara[this.iPlayer])); - iPuchiCharaCurrent = PuchiChara.tGetPuchiCharaIndexByName(this.iPlayer); - } - - - - private bool tMove(int off) { - if (ScrollCounter.CurrentValue < ScrollCounter.EndValue - && (OpenTaiko.InputManager.Keyboard.KeyPressing((int)SlimDXKeys.Key.RightArrow) - || OpenTaiko.InputManager.Keyboard.KeyPressing((int)SlimDXKeys.Key.LeftArrow))) - return false; - - ScrollMode = off; - ScrollCounter.CurrentValue = 0; - - if (iCurrentMenu == -1) - iMainMenuCurrent = (this.ttkMainMenuOpt.Length + iMainMenuCurrent + off) % this.ttkMainMenuOpt.Length; - else if (iCurrentMenu == 0) { - iPuchiCharaCurrent = (iPuchiCharaCount + iPuchiCharaCurrent + off) % iPuchiCharaCount; - tUpdateUnlockableTextPuchi(); - } else if (iCurrentMenu == 1) { - iCharacterCurrent = (iCharacterCount + iCharacterCurrent + off) % iCharacterCount; - tUpdateUnlockableTextChara(); - } else if (iCurrentMenu == 2) - iDanTitleCurrent = (this.ttkDanTitles.Length + iDanTitleCurrent + off) % this.ttkDanTitles.Length; - else if (iCurrentMenu == 3) - iTitleCurrent = (this.ttkTitles.Length + iTitleCurrent + off) % this.ttkTitles.Length; - else - return false; - - return true; - } - - private (int, int) DrawBox_Slot(int i) { - double value = (1.0 - Math.Sin((((ScrollCounter.CurrentValue) / 2000.0)) * Math.PI)); - - int nextIndex = i + ScrollMode; - nextIndex = Math.Min(OpenTaiko.Skin.Heya_Center_Menu_Box_Count - 1, nextIndex); - nextIndex = Math.Max(0, nextIndex); - - int x = OpenTaiko.Skin.Heya_Center_Menu_Box_X[i] + (int)((OpenTaiko.Skin.Heya_Center_Menu_Box_X[nextIndex] - OpenTaiko.Skin.Heya_Center_Menu_Box_X[i]) * value); - int y = OpenTaiko.Skin.Heya_Center_Menu_Box_Y[i] + (int)((OpenTaiko.Skin.Heya_Center_Menu_Box_Y[nextIndex] - OpenTaiko.Skin.Heya_Center_Menu_Box_Y[i]) * value); - - OpenTaiko.Tx.Heya_Center_Menu_Box_Slot?.t2D拡大率考慮上中央基準描画(x, y); - return (x, y); - } - - private (int, int) DrawSide_Menu(int i) { - double value = (1.0 - Math.Sin((((ScrollCounter.CurrentValue) / 2000.0)) * Math.PI)); - - int nextIndex = i + ScrollMode; - nextIndex = Math.Min(OpenTaiko.Skin.Heya_Side_Menu_Count - 1, nextIndex); - nextIndex = Math.Max(0, nextIndex); - - int x = OpenTaiko.Skin.Heya_Side_Menu_X[i] + (int)((OpenTaiko.Skin.Heya_Side_Menu_X[nextIndex] - OpenTaiko.Skin.Heya_Side_Menu_X[i]) * value); - int y = OpenTaiko.Skin.Heya_Side_Menu_Y[i] + (int)((OpenTaiko.Skin.Heya_Side_Menu_Y[nextIndex] - OpenTaiko.Skin.Heya_Side_Menu_Y[i]) * value); - - OpenTaiko.Tx.Heya_Side_Menu.t2D拡大率考慮上中央基準描画(x, y); - return (x, y); - } - - #region [Unlockables] - - /* - * FAILED : Selection/Purchase failed (failed condition) - * SUCCESS : Purchase succeed (without selection) - * SELECTED : Selection succeed - */ - private enum ESelectStatus { - FAILED, - SUCCESS, - SELECTED - }; - - - #region [Chara unlockables] - - private void tUpdateUnlockableTextChara() { - #region [Check unlockable] - - if (OpenTaiko.Tx.Characters[iCharacterCurrent].unlock != null - && !OpenTaiko.SaveFileInstances[iPlayer].data.UnlockedCharacters.Contains(OpenTaiko.Skin.Characters_DirName[iCharacterCurrent])) { - string _cond = "???"; - if (HRarity.tRarityToModalInt(OpenTaiko.Tx.Characters[iCharacterCurrent].metadata.Rarity) - < HRarity.tRarityToModalInt("Epic")) - _cond = OpenTaiko.Tx.Characters[iCharacterCurrent].unlock.tConditionMessage(); - this.ttkInfoSection = new TitleTextureKey(_cond, this.pfHeyaFont, Color.White, Color.Black, 1000); - } else - this.ttkInfoSection = null; - - #endregion - } - private ESelectStatus tSelectChara() { - // Add "If unlocked" to select directly - - if (OpenTaiko.Tx.Characters[iCharacterCurrent].unlock != null - && !OpenTaiko.SaveFileInstances[iPlayer].data.UnlockedCharacters.Contains(OpenTaiko.Skin.Characters_DirName[iCharacterCurrent])) { - (bool, string?) response = OpenTaiko.Tx.Characters[iCharacterCurrent].unlock.tConditionMetWrapper(OpenTaiko.SaveFile); - //TJAPlayer3.Tx.Characters[iCharacterCurrent].unlock.tConditionMet( - //new int[] { TJAPlayer3.SaveFileInstances[TJAPlayer3.SaveFile].data.Medals }); - - Color responseColor = (response.Item1) ? Color.Lime : Color.Red; - - // Send coins here for the unlock, considering that only coin-paid puchicharas can be unlocked directly from the Heya menu - - this.ttkInfoSection = new TitleTextureKey(response.Item2 ?? this.ttkInfoSection.str, this.pfHeyaFont, responseColor, Color.Black, 1000); - - return (response.Item1) ? ESelectStatus.SUCCESS : ESelectStatus.FAILED; - } - - this.ttkInfoSection = null; - return ESelectStatus.SELECTED; - } - #endregion - #region [Puchi unlockables] - private void tUpdateUnlockableTextPuchi() { - #region [Check unlockable] + switch (base.ePhaseID) { + case CStage.EPhase.Common_FADEOUT: + if (this.actFOtoTitle.Draw() == 0) { + break; + } + return (int)this.eフェードアウト完了時の戻り値; - if (OpenTaiko.Tx.Puchichara[iPuchiCharaCurrent].unlock != null - && !OpenTaiko.SaveFileInstances[iPlayer].data.UnlockedPuchicharas.Contains(OpenTaiko.Skin.Puchicharas_Name[iPuchiCharaCurrent])) { - string _cond = "???"; - if (HRarity.tRarityToModalInt(OpenTaiko.Tx.Puchichara[iPuchiCharaCurrent].metadata.Rarity) - < HRarity.tRarityToModalInt("Epic")) - _cond = OpenTaiko.Tx.Puchichara[iPuchiCharaCurrent].unlock.tConditionMessage(); - this.ttkInfoSection = new TitleTextureKey(_cond, this.pfHeyaFont, Color.White, Color.Black, 1000); - } else - this.ttkInfoSection = null; - - #endregion } - private ESelectStatus tSelectPuchi() { - // Add "If unlocked" to select directly - - if (OpenTaiko.Tx.Puchichara[iPuchiCharaCurrent].unlock != null - && !OpenTaiko.SaveFileInstances[iPlayer].data.UnlockedPuchicharas.Contains(OpenTaiko.Skin.Puchicharas_Name[iPuchiCharaCurrent])) { - (bool, string?) response = OpenTaiko.Tx.Puchichara[iPuchiCharaCurrent].unlock.tConditionMetWrapper(OpenTaiko.SaveFile); - //tConditionMet( - //new int[] { TJAPlayer3.SaveFileInstances[TJAPlayer3.SaveFile].data.Medals }); - - Color responseColor = (response.Item1) ? Color.Lime : Color.Red; - - // Send coins here for the unlock, considering that only coin-paid puchicharas can be unlocked directly from the Heya menu - - this.ttkInfoSection = new TitleTextureKey(response.Item2 ?? this.ttkInfoSection.str, this.pfHeyaFont, responseColor, Color.Black, 1000); - - return (response.Item1) ? ESelectStatus.SUCCESS : ESelectStatus.FAILED; - } - - this.ttkInfoSection = null; - return ESelectStatus.SELECTED; - } - - #endregion - - #endregion - - private ScriptBG Background; - - private TitleTextureKey[] ttkMainMenuOpt; - private CCachedFontRenderer pfHeyaFont; - - private TitleTextureKey[] ttkDanTitles; - private string[] sDanTitles; - - private TitleTextureKey[] ttkTitles; - private int[] titlesKeys; - - private int iPuchiCharaCount; - private int iCharacterCount; - - private CCounter ScrollCounter; - private const int SideInterval_X = 10; - private const int SideInterval_Y = 70; - private int ScrollMode; - - public E戻り値 eフェードアウト完了時の戻り値; - - public CActFIFOBlack actFOtoTitle; + return 0; } + + public enum E戻り値 : int { + 継続, + タイトルに戻る, + 選曲した + } + + public bool bInSongPlayed; + + private CCounter ctChara_In; + //private CCounter ctChara_Normal; + + private PuchiChara PuchiChara; + + private int iPlayer; + + private int iMainMenuCurrent; + private int iPuchiCharaCurrent; + + private TitleTextureKey[] ttkPuchiCharaNames; + private TitleTextureKey[] ttkPuchiCharaAuthors; + private TitleTextureKey[] ttkCharacterNames; + private TitleTextureKey[] ttkCharacterAuthors; + private TitleTextureKey ttkInfoSection; + + private int iCharacterCurrent; + private int iDanTitleCurrent; + private int iTitleCurrent; + + private int iCurrentMenu; + + private void tResetOpts() { + // Retrieve titles if they exist + //var _titles = TJAPlayer3.SaveFileInstances[iPlayer].data.NamePlateTitles; + var _titles = OpenTaiko.SaveFileInstances[iPlayer].data.UnlockedNameplateIds; + var _title = OpenTaiko.SaveFileInstances[iPlayer].data.Title; + var _dans = OpenTaiko.SaveFileInstances[iPlayer].data.DanTitles; + var _dan = OpenTaiko.SaveFileInstances[iPlayer].data.Dan; + + iTitleCurrent = 0; + + // Think of a replacement later + /* + if (_titles != null && _titles.ContainsKey(_title)) { } + iTitleCurrent = _titles.Keys.ToList().IndexOf(_title) + 1; + */ + + iDanTitleCurrent = 0; + + if (_dans != null && _dans.ContainsKey(_dan)) + iDanTitleCurrent = _dans.Keys.ToList().IndexOf(_dan) + 1; + + foreach (var plate in _titles.Select((value, i) => new { i, value })) { + if (OpenTaiko.SaveFileInstances[iPlayer].data.TitleId == plate.value) + iTitleCurrent = plate.i + 1; + } + + iCharacterCurrent = Math.Max(0, Math.Min(OpenTaiko.Skin.Characters_Ptn - 1, OpenTaiko.SaveFileInstances[iPlayer].data.Character)); + + //iPuchiCharaCurrent = Math.Max(0, Math.Min(TJAPlayer3.Skin.Puchichara_Ptn - 1, TJAPlayer3.NamePlateConfig.data.PuchiChara[this.iPlayer])); + iPuchiCharaCurrent = PuchiChara.tGetPuchiCharaIndexByName(this.iPlayer); + } + + + + private bool tMove(int off) { + if (ScrollCounter.CurrentValue < ScrollCounter.EndValue + && (OpenTaiko.InputManager.Keyboard.KeyPressing((int)SlimDXKeys.Key.RightArrow) + || OpenTaiko.InputManager.Keyboard.KeyPressing((int)SlimDXKeys.Key.LeftArrow))) + return false; + + ScrollMode = off; + ScrollCounter.CurrentValue = 0; + + if (iCurrentMenu == -1) + iMainMenuCurrent = (this.ttkMainMenuOpt.Length + iMainMenuCurrent + off) % this.ttkMainMenuOpt.Length; + else if (iCurrentMenu == 0) { + iPuchiCharaCurrent = (iPuchiCharaCount + iPuchiCharaCurrent + off) % iPuchiCharaCount; + tUpdateUnlockableTextPuchi(); + } else if (iCurrentMenu == 1) { + iCharacterCurrent = (iCharacterCount + iCharacterCurrent + off) % iCharacterCount; + tUpdateUnlockableTextChara(); + } else if (iCurrentMenu == 2) + iDanTitleCurrent = (this.ttkDanTitles.Length + iDanTitleCurrent + off) % this.ttkDanTitles.Length; + else if (iCurrentMenu == 3) + iTitleCurrent = (this.ttkTitles.Length + iTitleCurrent + off) % this.ttkTitles.Length; + else + return false; + + return true; + } + + private (int, int) DrawBox_Slot(int i) { + double value = (1.0 - Math.Sin((((ScrollCounter.CurrentValue) / 2000.0)) * Math.PI)); + + int nextIndex = i + ScrollMode; + nextIndex = Math.Min(OpenTaiko.Skin.Heya_Center_Menu_Box_Count - 1, nextIndex); + nextIndex = Math.Max(0, nextIndex); + + int x = OpenTaiko.Skin.Heya_Center_Menu_Box_X[i] + (int)((OpenTaiko.Skin.Heya_Center_Menu_Box_X[nextIndex] - OpenTaiko.Skin.Heya_Center_Menu_Box_X[i]) * value); + int y = OpenTaiko.Skin.Heya_Center_Menu_Box_Y[i] + (int)((OpenTaiko.Skin.Heya_Center_Menu_Box_Y[nextIndex] - OpenTaiko.Skin.Heya_Center_Menu_Box_Y[i]) * value); + + OpenTaiko.Tx.Heya_Center_Menu_Box_Slot?.t2D拡大率考慮上中央基準描画(x, y); + return (x, y); + } + + private (int, int) DrawSide_Menu(int i) { + double value = (1.0 - Math.Sin((((ScrollCounter.CurrentValue) / 2000.0)) * Math.PI)); + + int nextIndex = i + ScrollMode; + nextIndex = Math.Min(OpenTaiko.Skin.Heya_Side_Menu_Count - 1, nextIndex); + nextIndex = Math.Max(0, nextIndex); + + int x = OpenTaiko.Skin.Heya_Side_Menu_X[i] + (int)((OpenTaiko.Skin.Heya_Side_Menu_X[nextIndex] - OpenTaiko.Skin.Heya_Side_Menu_X[i]) * value); + int y = OpenTaiko.Skin.Heya_Side_Menu_Y[i] + (int)((OpenTaiko.Skin.Heya_Side_Menu_Y[nextIndex] - OpenTaiko.Skin.Heya_Side_Menu_Y[i]) * value); + + OpenTaiko.Tx.Heya_Side_Menu.t2D拡大率考慮上中央基準描画(x, y); + return (x, y); + } + + #region [Unlockables] + + /* + * FAILED : Selection/Purchase failed (failed condition) + * SUCCESS : Purchase succeed (without selection) + * SELECTED : Selection succeed + */ + private enum ESelectStatus { + FAILED, + SUCCESS, + SELECTED + }; + + + #region [Chara unlockables] + + private void tUpdateUnlockableTextChara() { + #region [Check unlockable] + + if (OpenTaiko.Tx.Characters[iCharacterCurrent].unlock != null + && !OpenTaiko.SaveFileInstances[iPlayer].data.UnlockedCharacters.Contains(OpenTaiko.Skin.Characters_DirName[iCharacterCurrent])) { + string _cond = "???"; + if (HRarity.tRarityToModalInt(OpenTaiko.Tx.Characters[iCharacterCurrent].metadata.Rarity) + < HRarity.tRarityToModalInt("Epic")) + _cond = OpenTaiko.Tx.Characters[iCharacterCurrent].unlock.tConditionMessage(); + this.ttkInfoSection = new TitleTextureKey(_cond, this.pfHeyaFont, Color.White, Color.Black, 1000); + } else + this.ttkInfoSection = null; + + #endregion + } + private ESelectStatus tSelectChara() { + // Add "If unlocked" to select directly + + if (OpenTaiko.Tx.Characters[iCharacterCurrent].unlock != null + && !OpenTaiko.SaveFileInstances[iPlayer].data.UnlockedCharacters.Contains(OpenTaiko.Skin.Characters_DirName[iCharacterCurrent])) { + (bool, string?) response = OpenTaiko.Tx.Characters[iCharacterCurrent].unlock.tConditionMetWrapper(OpenTaiko.SaveFile); + //TJAPlayer3.Tx.Characters[iCharacterCurrent].unlock.tConditionMet( + //new int[] { TJAPlayer3.SaveFileInstances[TJAPlayer3.SaveFile].data.Medals }); + + Color responseColor = (response.Item1) ? Color.Lime : Color.Red; + + // Send coins here for the unlock, considering that only coin-paid puchicharas can be unlocked directly from the Heya menu + + this.ttkInfoSection = new TitleTextureKey(response.Item2 ?? this.ttkInfoSection.str, this.pfHeyaFont, responseColor, Color.Black, 1000); + + return (response.Item1) ? ESelectStatus.SUCCESS : ESelectStatus.FAILED; + } + + this.ttkInfoSection = null; + return ESelectStatus.SELECTED; + } + + #endregion + + #region [Puchi unlockables] + private void tUpdateUnlockableTextPuchi() { + #region [Check unlockable] + + if (OpenTaiko.Tx.Puchichara[iPuchiCharaCurrent].unlock != null + && !OpenTaiko.SaveFileInstances[iPlayer].data.UnlockedPuchicharas.Contains(OpenTaiko.Skin.Puchicharas_Name[iPuchiCharaCurrent])) { + string _cond = "???"; + if (HRarity.tRarityToModalInt(OpenTaiko.Tx.Puchichara[iPuchiCharaCurrent].metadata.Rarity) + < HRarity.tRarityToModalInt("Epic")) + _cond = OpenTaiko.Tx.Puchichara[iPuchiCharaCurrent].unlock.tConditionMessage(); + this.ttkInfoSection = new TitleTextureKey(_cond, this.pfHeyaFont, Color.White, Color.Black, 1000); + } else + this.ttkInfoSection = null; + + #endregion + } + + private ESelectStatus tSelectPuchi() { + // Add "If unlocked" to select directly + + if (OpenTaiko.Tx.Puchichara[iPuchiCharaCurrent].unlock != null + && !OpenTaiko.SaveFileInstances[iPlayer].data.UnlockedPuchicharas.Contains(OpenTaiko.Skin.Puchicharas_Name[iPuchiCharaCurrent])) { + (bool, string?) response = OpenTaiko.Tx.Puchichara[iPuchiCharaCurrent].unlock.tConditionMetWrapper(OpenTaiko.SaveFile); + //tConditionMet( + //new int[] { TJAPlayer3.SaveFileInstances[TJAPlayer3.SaveFile].data.Medals }); + + Color responseColor = (response.Item1) ? Color.Lime : Color.Red; + + // Send coins here for the unlock, considering that only coin-paid puchicharas can be unlocked directly from the Heya menu + + this.ttkInfoSection = new TitleTextureKey(response.Item2 ?? this.ttkInfoSection.str, this.pfHeyaFont, responseColor, Color.Black, 1000); + + return (response.Item1) ? ESelectStatus.SUCCESS : ESelectStatus.FAILED; + } + + this.ttkInfoSection = null; + return ESelectStatus.SELECTED; + } + + #endregion + + #endregion + + private ScriptBG Background; + + private TitleTextureKey[] ttkMainMenuOpt; + private CCachedFontRenderer pfHeyaFont; + + private TitleTextureKey[] ttkDanTitles; + private string[] sDanTitles; + + private TitleTextureKey[] ttkTitles; + private int[] titlesKeys; + + private int iPuchiCharaCount; + private int iCharacterCount; + + private CCounter ScrollCounter; + private const int SideInterval_X = 10; + private const int SideInterval_Y = 70; + private int ScrollMode; + + public E戻り値 eフェードアウト完了時の戻り値; + + public CActFIFOBlack actFOtoTitle; } diff --git a/OpenTaiko/src/Stages/12.OnlineLounge/API.cs b/OpenTaiko/src/Stages/12.OnlineLounge/API.cs index 25ddce78..37439603 100644 --- a/OpenTaiko/src/Stages/12.OnlineLounge/API.cs +++ b/OpenTaiko/src/Stages/12.OnlineLounge/API.cs @@ -1,127 +1,127 @@ using Newtonsoft.Json; using Newtonsoft.Json.Serialization; -namespace OpenTaiko { - internal class API { - public class APICharterInfo { - public string charter_name; +namespace OpenTaiko; + +internal class API { + public class APICharterInfo { + public string charter_name; + } + + public class APIGenreInfo { + public string genre; + } + + public class APISongData { + public int Id; + public string SongTitle; + public string SongSubtitle; + public int D0; // Easy + public int D1; // Normal + public int D2; // Hard + public int D3; // Extreme + public int D4; // Extra + public int D5; // Tower + public int D6; // Dan + public int Life; // Tower only + public string Md5; + + // Additional + public APICharterInfo charter; + public APIGenreInfo Genre; + + [JsonIgnore] + public bool DownloadNow; + } + + #region [ContractResolver override for properties] + + + + public class SongContractResolver : DefaultContractResolver { + private Dictionary PropertyMappings { get; set; } + + private string GetAssignedLanguageValue(Dictionary ens) { + if (ens.ContainsKey(OpenTaiko.ConfigIni.sLang)) + return ens[OpenTaiko.ConfigIni.sLang]; + return ens["default"]; } - public class APIGenreInfo { - public string genre; + public SongContractResolver(DBCDN.CDNData cdnData) { + this.PropertyMappings = new Dictionary + { + {"SongTitle", GetAssignedLanguageValue(cdnData.Hooks.title)}, + {"SongSubtitle", GetAssignedLanguageValue(cdnData.Hooks.subtitle)}, + {"Md5", GetAssignedLanguageValue(cdnData.Hooks.md5)}, + {"Id", cdnData.Hooks.id}, + {"D0", cdnData.Hooks.difficulties[0]}, + {"D1", cdnData.Hooks.difficulties[1]}, + {"D2", cdnData.Hooks.difficulties[2]}, + {"D3", cdnData.Hooks.difficulties[3]}, + {"D4", cdnData.Hooks.difficulties[4]}, + {"D5", cdnData.Hooks.difficulties[5]}, + {"D6", cdnData.Hooks.difficulties[6]}, + {"Tower", cdnData.Hooks.life}, + {"Genre", cdnData.Hooks.genre}, + {"genre", GetAssignedLanguageValue(cdnData.Hooks.genreSub)}, + }; } - public class APISongData { - public int Id; - public string SongTitle; - public string SongSubtitle; - public int D0; // Easy - public int D1; // Normal - public int D2; // Hard - public int D3; // Extreme - public int D4; // Extra - public int D5; // Tower - public int D6; // Dan - public int Life; // Tower only - public string Md5; - - // Additional - public APICharterInfo charter; - public APIGenreInfo Genre; - - [JsonIgnore] - public bool DownloadNow; + protected override string ResolvePropertyName(string propertyName) { + string resolvedName = null; + var resolved = this.PropertyMappings.TryGetValue(propertyName, out resolvedName); + return (resolved) ? resolvedName : base.ResolvePropertyName(propertyName); } + } - #region [ContractResolver override for properties] + #endregion + + public API(DBCDN.CDNData selectedCDN) { + cdnData = selectedCDN; + FetchedSongsList = new APISongData[0]; + } + + public APISongData[] FetchedSongsList; + + public void tLoadSongsFromInternalCDN() { + string url = cdnData.BaseUrl + cdnData.SongList; + var _fetched = GetCallAPI(url); - public class SongContractResolver : DefaultContractResolver { - private Dictionary PropertyMappings { get; set; } + _fetched.Wait(); - private string GetAssignedLanguageValue(Dictionary ens) { - if (ens.ContainsKey(OpenTaiko.ConfigIni.sLang)) - return ens[OpenTaiko.ConfigIni.sLang]; - return ens["default"]; - } + if (_fetched.Result != null) + FetchedSongsList = _fetched.Result; - public SongContractResolver(DBCDN.CDNData cdnData) { - this.PropertyMappings = new Dictionary - { - {"SongTitle", GetAssignedLanguageValue(cdnData.Hooks.title)}, - {"SongSubtitle", GetAssignedLanguageValue(cdnData.Hooks.subtitle)}, - {"Md5", GetAssignedLanguageValue(cdnData.Hooks.md5)}, - {"Id", cdnData.Hooks.id}, - {"D0", cdnData.Hooks.difficulties[0]}, - {"D1", cdnData.Hooks.difficulties[1]}, - {"D2", cdnData.Hooks.difficulties[2]}, - {"D3", cdnData.Hooks.difficulties[3]}, - {"D4", cdnData.Hooks.difficulties[4]}, - {"D5", cdnData.Hooks.difficulties[5]}, - {"D6", cdnData.Hooks.difficulties[6]}, - {"Tower", cdnData.Hooks.life}, - {"Genre", cdnData.Hooks.genre}, - {"genre", GetAssignedLanguageValue(cdnData.Hooks.genreSub)}, - }; - } - - protected override string ResolvePropertyName(string propertyName) { - string resolvedName = null; - var resolved = this.PropertyMappings.TryGetValue(propertyName, out resolvedName); - return (resolved) ? resolvedName : base.ResolvePropertyName(propertyName); - } - } - - #endregion - - public API(DBCDN.CDNData selectedCDN) { - cdnData = selectedCDN; - FetchedSongsList = new APISongData[0]; - } - - public APISongData[] FetchedSongsList; - - public void tLoadSongsFromInternalCDN() { - string url = cdnData.BaseUrl + cdnData.SongList; - - - var _fetched = GetCallAPI(url); - - _fetched.Wait(); - - if (_fetched.Result != null) - FetchedSongsList = _fetched.Result; - - - } - - #region [private] - - private DBCDN.CDNData cdnData; - - private async Task GetCallAPI(string url) { - try { - using (HttpClient client = new HttpClient()) { - var response = await client.GetAsync(url).ConfigureAwait(false); - - if (response != null) { - var jsonString = await response.Content.ReadAsStringAsync().ConfigureAwait(false); - - var settings = new JsonSerializerSettings(); - settings.ContractResolver = new SongContractResolver(cdnData); - settings.NullValueHandling = NullValueHandling.Ignore; - return JsonConvert.DeserializeObject(jsonString, settings); - } - } - } catch (Exception e) { - //throw e; - } - return null; - } - - - #endregion } + + #region [private] + + private DBCDN.CDNData cdnData; + + private async Task GetCallAPI(string url) { + try { + using (HttpClient client = new HttpClient()) { + var response = await client.GetAsync(url).ConfigureAwait(false); + + if (response != null) { + var jsonString = await response.Content.ReadAsStringAsync().ConfigureAwait(false); + + var settings = new JsonSerializerSettings(); + settings.ContractResolver = new SongContractResolver(cdnData); + settings.NullValueHandling = NullValueHandling.Ignore; + return JsonConvert.DeserializeObject(jsonString, settings); + } + } + } catch (Exception e) { + //throw e; + } + return null; + } + + + #endregion + } diff --git a/OpenTaiko/src/Stages/12.OnlineLounge/CStageOnlineLounge.cs b/OpenTaiko/src/Stages/12.OnlineLounge/CStageOnlineLounge.cs index 6c3e5518..5023af45 100644 --- a/OpenTaiko/src/Stages/12.OnlineLounge/CStageOnlineLounge.cs +++ b/OpenTaiko/src/Stages/12.OnlineLounge/CStageOnlineLounge.cs @@ -4,694 +4,694 @@ using System.Text; using FDK; using static OpenTaiko.CActSelect曲リスト; -namespace OpenTaiko { - class CStageOnlineLounge : CStage { +namespace OpenTaiko; - public CStageOnlineLounge() { - base.eStageID = EStage.OnlineLounge; - base.ePhaseID = CStage.EPhase.Common_NORMAL; +class CStageOnlineLounge : CStage { - // Load CActivity objects here - // base.list子Activities.Add(this.act = new CAct()); + public CStageOnlineLounge() { + base.eStageID = EStage.OnlineLounge; + base.ePhaseID = CStage.EPhase.Common_NORMAL; - base.ChildActivities.Add(this.actFOtoTitle = new CActFIFOBlack()); + // Load CActivity objects here + // base.list子Activities.Add(this.act = new CAct()); - } - - private static string GetMenuName(int menu) { - switch (menu) { - case (int)ECurrentMenu.RETURN: - default: - return CLangManager.LangInstance.GetString("ONLINE_EXIT"); - case (int)ECurrentMenu.MAIN: - return CLangManager.LangInstance.GetString("MENU_RETURN"); - case (int)ECurrentMenu.CDN_SELECT: - return CLangManager.LangInstance.GetString("ONLINE_DOWNLOAD"); - case (int)ECurrentMenu.CDN_OPTION: - return CLangManager.LangInstance.GetString("ONLINE_DOWNLOAD_CDN"); - case (int)ECurrentMenu.CDN_SONGS: - return CLangManager.LangInstance.GetString("ONLINE_DOWNLOAD_SONG"); - case (int)ECurrentMenu.CDN_CHARACTERS: - return CLangManager.LangInstance.GetString("ONLINE_DOWNLOAD_CHARA"); - case (int)ECurrentMenu.CDN_PUCHICHARAS: - return CLangManager.LangInstance.GetString("ONLINE_DOWNLOAD_PUCHI"); - case (int)ECurrentMenu.MULTI_SELECT: - return CLangManager.LangInstance.GetString("ONLINE_MULTIPLAYER"); - } - } - - public override void Activate() { - // On activation - - if (base.IsActivated) - return; - - base.ePhaseID = CStage.EPhase.Common_NORMAL; - this.eフェードアウト完了時の戻り値 = EReturnValue.Continuation; - - OpenTaiko.Skin.soundOnlineLoungeBGM?.tPlay(); - - this.currentMenu = ECurrentMenu.MAIN; - this.menuPointer = ECurrentMenu.CDN_SELECT; - this.menus = new CMenuInfo[(int)ECurrentMenu.TOTAL]; - - for (int i = 0; i < (int)ECurrentMenu.TOTAL; i++) - this.menus[i] = new CMenuInfo(GetMenuName(i)); - - - - dbCDN = OpenTaiko.Databases.DBCDN; - dbCDNData = null; - - IsDownloading = false; - - #region [Main menu] - - this.ttkMainMenuOpt = new TitleTextureKey[3]; - - this.ttkMainMenuOpt[0] = new TitleTextureKey(GetMenuName((int)ECurrentMenu.RETURN), this.pfOLFont, Color.White, Color.DarkRed, 1000); - this.ttkMainMenuOpt[1] = new TitleTextureKey(GetMenuName((int)ECurrentMenu.CDN_SELECT), this.pfOLFont, Color.White, Color.DarkRed, 1000); - this.ttkMainMenuOpt[2] = new TitleTextureKey(GetMenuName((int)ECurrentMenu.MULTI_SELECT), this.pfOLFont, Color.White, Color.DarkRed, 1000); - - this.mainMenu = new ECurrentMenu[] { ECurrentMenu.RETURN, ECurrentMenu.CDN_SELECT, ECurrentMenu.MULTI_SELECT }; - - this.mainMenuIndex = 0; - - #endregion - - #region [CDN Select] - - int keyCount = dbCDN.data.Count; - - this.ttkCDNSelectOpt = new TitleTextureKey[keyCount + 1]; - - this.ttkCDNSelectOpt[0] = new TitleTextureKey(GetMenuName((int)ECurrentMenu.MAIN), this.pfOLFont, Color.White, Color.DarkRed, 1000); - - for (int i = 0; i < keyCount; i++) { - this.ttkCDNSelectOpt[i + 1] = new TitleTextureKey(dbCDN.data.ElementAt(i).Key, this.pfOLFont, Color.White, Color.DarkRed, 1000); - } - - this.CDNSelectIndex = 0; - - #endregion - - #region [CDN Option] - - this.ttkCDNOptionOpt = new TitleTextureKey[4]; - - this.ttkCDNOptionOpt[0] = new TitleTextureKey(GetMenuName((int)ECurrentMenu.MAIN), this.pfOLFont, Color.White, Color.DarkRed, 1000); - this.ttkCDNOptionOpt[1] = new TitleTextureKey(GetMenuName((int)ECurrentMenu.CDN_SONGS), this.pfOLFont, Color.White, Color.DarkRed, 1000); - this.ttkCDNOptionOpt[2] = new TitleTextureKey(GetMenuName((int)ECurrentMenu.CDN_CHARACTERS), this.pfOLFont, Color.White, Color.DarkRed, 1000); - this.ttkCDNOptionOpt[3] = new TitleTextureKey(GetMenuName((int)ECurrentMenu.CDN_PUCHICHARAS), this.pfOLFont, Color.White, Color.DarkRed, 1000); - - this.cdnOptMenu = new ECurrentMenu[] { ECurrentMenu.CDN_SELECT, ECurrentMenu.CDN_SONGS, ECurrentMenu.CDN_CHARACTERS, ECurrentMenu.CDN_PUCHICHARAS }; - - this.cdnOptMenuIndex = 0; - - #endregion - - Background = new ScriptBG(CSkin.Path($"{TextureLoader.BASE}{TextureLoader.ONLINELOUNGE}Script.lua")); - Background.Init(); - - base.Activate(); - } - - public override void DeActivate() { - // On de-activation - - OpenTaiko.tDisposeSafely(ref Background); - - OpenTaiko.Songs管理.UpdateDownloadBox(); - - base.DeActivate(); - } - - public override void CreateManagedResource() { - // Ressource allocation - - this.pfOLFont = HPrivateFastFont.tInstantiateMainFont(OpenTaiko.Skin.OnlineLounge_Font_OLFont); - this.pfOLFontLarge = HPrivateFastFont.tInstantiateMainFont(OpenTaiko.Skin.OnlineLounge_Font_OLFontLarge); - - base.CreateManagedResource(); - } - - public override void ReleaseManagedResource() { - // Ressource freeing - this.pfOLFont?.Dispose(); - this.pfOLFontLarge?.Dispose(); - - base.ReleaseManagedResource(); - } - - public override int Draw() { - Background.Update(); - Background.Draw(); - - //OnlineLounge_Background.t2D描画(0, 0); - - #region [Menus] - - - #region [Base Menus] - - TitleTextureKey[] _ref = this.ttkMainMenuOpt; - int _selector = mainMenuIndex; - - if (currentMenu == ECurrentMenu.CDN_SELECT) { - _ref = this.ttkCDNSelectOpt; - _selector = CDNSelectIndex; - } else if (currentMenu == ECurrentMenu.CDN_OPTION) { - _ref = this.ttkCDNOptionOpt; - _selector = cdnOptMenuIndex; - } - - - if (currentMenu == ECurrentMenu.MAIN - || currentMenu == ECurrentMenu.CDN_SELECT - || currentMenu == ECurrentMenu.CDN_OPTION) { - int baseX = OpenTaiko.Skin.OnlineLounge_Side_Menu[0] - _ref.Length * (OpenTaiko.Skin.OnlineLounge_Side_Menu_Move[0] / 2); - int baseY = OpenTaiko.Skin.OnlineLounge_Side_Menu[1] - _ref.Length * (OpenTaiko.Skin.OnlineLounge_Side_Menu_Move[1] / 2); - - for (int i = 0; i < _ref.Length; i++) { - CTexture tmpTex = TitleTextureKey.ResolveTitleTexture(_ref[i]); - - if (_selector != i) { - tmpTex.color4 = CConversion.ColorToColor4(Color.DarkGray); - OpenTaiko.Tx.OnlineLounge_Side_Menu?.tUpdateColor4(CConversion.ColorToColor4(Color.DarkGray)); - } else { - tmpTex.color4 = CConversion.ColorToColor4(Color.White); - OpenTaiko.Tx.OnlineLounge_Side_Menu?.tUpdateColor4(CConversion.ColorToColor4(Color.White)); - } - - OpenTaiko.Tx.OnlineLounge_Side_Menu?.t2D拡大率考慮上中央基準描画(baseX + OpenTaiko.Skin.OnlineLounge_Side_Menu_Move[0] * i, - baseY + OpenTaiko.Skin.OnlineLounge_Side_Menu_Move[1] * i); - tmpTex.t2D拡大率考慮上中央基準描画( - baseX + OpenTaiko.Skin.OnlineLounge_Side_Menu_Text_Offset[0] + OpenTaiko.Skin.OnlineLounge_Side_Menu_Move[0] * i, - baseY + OpenTaiko.Skin.OnlineLounge_Side_Menu_Text_Offset[1] + OpenTaiko.Skin.OnlineLounge_Side_Menu_Move[1] * i); - } - } - - #endregion - - #region [Song list menu] - - if (currentMenu == ECurrentMenu.CDN_SONGS) { - _ref = this.ttkCDNSongList; - _selector = cdnSongListIndex; - - int baseX = OpenTaiko.Skin.OnlineLounge_Song[0]; - int baseY = OpenTaiko.Skin.OnlineLounge_Song[1]; - - for (int i = -4; i < 4; i++) { - int pos = (_ref.Length * 5 + _selector + i) % _ref.Length; - - CTexture tmpTex = TitleTextureKey.ResolveTitleTexture(_ref[pos]); - CTexture tmpSubtitle = TitleTextureKey.ResolveTitleTexture(ttkCDNSongSubtitles[pos]); - - var _color = CConversion.ColorToColor4(Color.DarkGray); - - if (i == 0) - _color = CConversion.ColorToColor4(Color.White); - if (pos > 0 && i != 0) { - var song = apiMethods.FetchedSongsList[pos - 1]; - var downloadLink = GetDownloadLink(song); - - if (CSongDict.tContainsSongUrl(downloadLink)) - _color = CConversion.ColorToColor4(Color.DimGray); - } - - - tmpTex.color4 = _color; - tmpSubtitle.color4 = _color; - - int x = baseX + OpenTaiko.Skin.OnlineLounge_Song_Move[0] * i; - int y = baseY + OpenTaiko.Skin.OnlineLounge_Song_Move[1] * i; - - if (pos == 0) { - OpenTaiko.Tx.OnlineLounge_Return_Box?.tUpdateColor4(_color); - OpenTaiko.Tx.OnlineLounge_Return_Box?.t2D拡大率考慮上中央基準描画(x, y); - } else { - OpenTaiko.Tx.OnlineLounge_Song_Box?.tUpdateColor4(_color); - OpenTaiko.Tx.OnlineLounge_Song_Box?.t2D拡大率考慮上中央基準描画(x, y); - } - - - tmpTex.t2D拡大率考慮上中央基準描画(x + OpenTaiko.Skin.OnlineLounge_Song_Title_Offset[0], y + OpenTaiko.Skin.OnlineLounge_Song_Title_Offset[1]); - tmpSubtitle.t2D拡大率考慮上中央基準描画(x + OpenTaiko.Skin.OnlineLounge_Song_SubTitle_Offset[0], y + OpenTaiko.Skin.OnlineLounge_Song_SubTitle_Offset[1]); - - if (pos != 0 && i == 0) { - OpenTaiko.Tx.OnlineLounge_Context.t2D描画(0, 0); - - var song_ = apiMethods.FetchedSongsList[pos - 1]; - - int[] diffs = new int[] - { - song_.D0, - song_.D1, - song_.D2, - song_.D3, - song_.D4, - song_.D5, - song_.D6, - }; - - #region [Charter Name] - - if (song_.charter != null && song_.charter.charter_name != null && song_.charter.charter_name != "") { - var charter_ = TitleTextureKey.ResolveTitleTexture( - new TitleTextureKey("Charter : " + song_.charter.charter_name, this.pfOLFontLarge, Color.White, Color.Black, 1000)); - charter_?.t2D中心基準描画(OpenTaiko.Skin.OnlineLounge_Context_Charter[0], OpenTaiko.Skin.OnlineLounge_Context_Charter[1]); - } - - #endregion - - #region [Song Genre] - - if (song_.Genre != null && song_.Genre.genre != null && song_.Genre.genre != "") { - var genre_ = TitleTextureKey.ResolveTitleTexture( - new TitleTextureKey(song_.Genre.genre, this.pfOLFontLarge, Color.White, Color.Black, 1000)); - genre_?.t2D中心基準描画(OpenTaiko.Skin.OnlineLounge_Context_Genre[0], OpenTaiko.Skin.OnlineLounge_Context_Genre[1]); - } - - #endregion - - #region [Difficulties] - - for (int k = 0; k < (int)Difficulty.Total; k++) { - int diff = diffs[k]; - - int column = (k >= 3) ? OpenTaiko.Skin.OnlineLounge_Context_Couse_Move[0] : 0; - int row = OpenTaiko.Skin.OnlineLounge_Context_Couse_Move[1] * (k % 3); - - if (diff > 0) { - OpenTaiko.Tx.Couse_Symbol[k]?.t2D中心基準描画( - OpenTaiko.Skin.OnlineLounge_Context_Couse_Symbol[0] + column, - OpenTaiko.Skin.OnlineLounge_Context_Couse_Symbol[1] + row); - - var difnb_ = TitleTextureKey.ResolveTitleTexture( - new TitleTextureKey(diff.ToString(), this.pfOLFontLarge, (diff > 10) ? Color.Red : Color.White, Color.Black, 1000)); - difnb_?.t2D中心基準描画(OpenTaiko.Skin.OnlineLounge_Context_Level[0] + column, OpenTaiko.Skin.OnlineLounge_Context_Level[1] + row); - } - - } - - #endregion - - - } - - } - } - - #endregion - - if (IsDownloading) { - OpenTaiko.Tx.OnlineLounge_Box.t2D描画(0, 0); - - var text = TitleTextureKey.ResolveTitleTexture( - new TitleTextureKey("Downloading...", this.pfOLFontLarge, Color.White, Color.Black, 1000)); - text.t2D中心基準描画(OpenTaiko.Skin.OnlineLounge_Downloading[0], OpenTaiko.Skin.OnlineLounge_Downloading[1]); - } - - #endregion - - - - #region [Input] - - //if (!IsDownloading) - { - if (OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.RightArrow) || - OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.RightChange)) { - if (this.tMove(1)) { - OpenTaiko.Skin.soundChangeSFX.tPlay(); - } - } else if (OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.LeftArrow) || - OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.LeftChange)) { - if (this.tMove(-1)) { - OpenTaiko.Skin.soundChangeSFX.tPlay(); - } - } else if (OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Escape) || - OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.Cancel)) { - - #region [Fast return (Escape)] - - OpenTaiko.Skin.soundCancelSFX.tPlay(); - - if (currentMenu == ECurrentMenu.MAIN) { - // Return to title screen - OpenTaiko.Skin.soundOnlineLoungeBGM?.tStop(); - this.eフェードアウト完了時の戻り値 = EReturnValue.ReturnToTitle; - this.actFOtoTitle.tフェードアウト開始(); - base.ePhaseID = CStage.EPhase.Common_FADEOUT; - } else if (currentMenu == ECurrentMenu.CDN_SELECT || currentMenu == ECurrentMenu.MULTI_SELECT) { - // Return to base menu - currentMenu = ECurrentMenu.MAIN; - } else if (currentMenu == ECurrentMenu.CDN_OPTION) { - // Return to CDN select menu - currentMenu = ECurrentMenu.CDN_SELECT; - } else if (currentMenu == ECurrentMenu.CDN_SONGS || currentMenu == ECurrentMenu.CDN_CHARACTERS || currentMenu == ECurrentMenu.CDN_PUCHICHARAS) { - // Return to CDN select option - currentMenu = ECurrentMenu.CDN_OPTION; - } - - return 0; - - #endregion - } else if (OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Return) || - OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.Decide)) { - - #region [Decide] - - if (currentMenu == ECurrentMenu.MAIN) { - if (mainMenu[mainMenuIndex] == ECurrentMenu.CDN_SELECT || !IsDownloading) { - // Base menu - currentMenu = mainMenu[mainMenuIndex]; - if (currentMenu == ECurrentMenu.RETURN) { - // Quit - OpenTaiko.Skin.soundCancelSFX.tPlay(); - OpenTaiko.Skin.soundOnlineLoungeBGM?.tStop(); - this.eフェードアウト完了時の戻り値 = EReturnValue.ReturnToTitle; - this.actFOtoTitle.tフェードアウト開始(); - base.ePhaseID = CStage.EPhase.Common_FADEOUT; - } else { - OpenTaiko.Skin.soundDecideSFX.tPlay(); - } - } else { - OpenTaiko.Skin.soundError.tPlay(); - } - } else if (currentMenu == ECurrentMenu.CDN_SELECT) { - // CDN Select Menu - if (CDNSelectIndex > 0) { - currentMenu = ECurrentMenu.CDN_OPTION; - dbCDNData = dbCDN.data.ElementAt(CDNSelectIndex - 1).Value; - OpenTaiko.Skin.soundDecideSFX.tPlay(); - } else { - currentMenu = ECurrentMenu.MAIN; - OpenTaiko.Skin.soundCancelSFX.tPlay(); - } - } else if (currentMenu == ECurrentMenu.CDN_OPTION) { - // CDN Option Menu - currentMenu = cdnOptMenu[cdnOptMenuIndex]; - if (currentMenu == ECurrentMenu.CDN_SELECT) - OpenTaiko.Skin.soundCancelSFX.tPlay(); - else { - if (currentMenu == ECurrentMenu.CDN_SONGS) { - apiMethods = new API(dbCDNData); - apiMethods.tLoadSongsFromInternalCDN(); - - #region [Generate song list values] - - int songCountPlusOne = apiMethods.FetchedSongsList.Length + 1; - - this.ttkCDNSongList = new TitleTextureKey[songCountPlusOne]; - this.ttkCDNSongSubtitles = new TitleTextureKey[songCountPlusOne]; - - this.ttkCDNSongList[0] = new TitleTextureKey(GetMenuName((int)ECurrentMenu.MAIN), this.pfOLFont, Color.White, Color.DarkRed, 1000); - this.ttkCDNSongSubtitles[0] = new TitleTextureKey("", this.pfOLFont, Color.White, Color.DarkRed, 1000); - - for (int i = 0; i < apiMethods.FetchedSongsList.Length; i++) { - this.ttkCDNSongList[i + 1] = new TitleTextureKey(apiMethods.FetchedSongsList[i].SongTitle, this.pfOLFont, Color.White, Color.DarkRed, 1000); - - string subtitle_ = apiMethods.FetchedSongsList[i].SongSubtitle; - if (subtitle_.Length >= 2) - subtitle_ = subtitle_.Substring(2); - this.ttkCDNSongSubtitles[i + 1] = new TitleTextureKey(subtitle_, this.pfOLFont, Color.White, Color.DarkRed, 1000); - } - - this.cdnSongListIndex = 0; - - #endregion - } - OpenTaiko.Skin.soundDecideSFX.tPlay(); - } - - } else if (currentMenu == ECurrentMenu.CDN_SONGS) { - if (this.cdnSongListIndex == 0) { - OpenTaiko.Skin.soundCancelSFX.tPlay(); - currentMenu = ECurrentMenu.CDN_OPTION; - } else { - if (this.cdnSongListIndex < apiMethods.FetchedSongsList.Length) { - var song = apiMethods.FetchedSongsList[this.cdnSongListIndex - 1]; - //var zipPath = $@"Cache{Path.DirectorySeparatorChar}{song.Md5}.zip"; - var downloadLink = GetDownloadLink(song); - - if (CSongDict.tContainsSongUrl(downloadLink) || song.DownloadNow) { - OpenTaiko.Skin.soundError.tPlay(); - } else { - OpenTaiko.Skin.soundDecideSFX.tPlay(); - System.Threading.Thread download = - new System.Threading.Thread(new System.Threading.ThreadStart(DownloadSong)); - download.Start(); - } - } - } - } - - - #endregion - } - } - #endregion - - // Menu exit fade out transition - #region [FadeOut] - - switch (base.ePhaseID) { - case CStage.EPhase.Common_FADEOUT: - if (this.actFOtoTitle.Draw() == 0) { - break; - } - return (int)this.eフェードアウト完了時の戻り値; - - } - - #endregion - - return 0; - } - - public bool tMove(int val) { - if (currentMenu == ECurrentMenu.MAIN) { - if (mainMenuIndex + val < 0 || mainMenuIndex + val >= mainMenu.Length) - return false; - - mainMenuIndex += val; - } else if (currentMenu == ECurrentMenu.CDN_SELECT) { - if (CDNSelectIndex + val < 0 || CDNSelectIndex + val >= ttkCDNSelectOpt.Length) - return false; - - CDNSelectIndex += val; - } else if (currentMenu == ECurrentMenu.CDN_OPTION) { - if (cdnOptMenuIndex + val < 0 || cdnOptMenuIndex + val >= cdnOptMenu.Length) - return false; - - cdnOptMenuIndex += val; - } else if (currentMenu == ECurrentMenu.CDN_SONGS) { - cdnSongListIndex = (ttkCDNSongList.Length + cdnSongListIndex + val) % ttkCDNSongList.Length; - } - - return true; - } - - #region [Song Downloading] - - public string ReplaceInvalidChars(string filename, string substitute = "_") { - return string.Join(substitute, filename.Split(Path.GetInvalidFileNameChars())); - } - - public string TruncateString(string s, int length) { - return s.Substring(0, Math.Min(length, s.Length)); - } - - private string GetAssignedLanguageValue(Dictionary ens) { - if (ens.ContainsKey(OpenTaiko.ConfigIni.sLang)) - return ens[OpenTaiko.ConfigIni.sLang]; - return ens["default"]; - } - - private string GetDownloadLink(API.APISongData song) { - return $"{dbCDNData.BaseUrl}{GetAssignedLanguageValue(dbCDNData.Download)}{song.Id}"; - } - - private void DownloadSong() { - IsDownloading = true; - - // Create Cache folder if does not exist - Directory.CreateDirectory($@"Cache{Path.DirectorySeparatorChar}"); - - - var song = apiMethods.FetchedSongsList[this.cdnSongListIndex - 1]; - song.DownloadNow = true; - var zipName = ReplaceInvalidChars($@"{TruncateString(song.SongTitle, 16)}-{TruncateString(song.Md5, 10)}"); - var zipPath = $@"Cache{Path.DirectorySeparatorChar}{zipName}.zip"; - var downloadLink = GetDownloadLink(song); - - try { - // Download zip from cdn - - if (!File.Exists(zipPath)) { - System.Net.WebClient wc = new System.Net.WebClient(); - - wc.DownloadFile(downloadLink, zipPath); - wc.Dispose(); - } - - // Fetch closest Download folder node - CSongListNode downloadBox = null; - for (int i = 0; i < OpenTaiko.Songs管理.list曲ルート.Count; i++) { - if (OpenTaiko.Songs管理.list曲ルート[i].strジャンル == "Download") { - downloadBox = OpenTaiko.Songs管理.list曲ルート[i]; - if (downloadBox.rParentNode != null) downloadBox = downloadBox.rParentNode; - break; - } - } - - // If there is at least one download folder, transfer the zip contents in it - if (downloadBox != null) { - var path = downloadBox.arスコア[0].ファイル情報.フォルダの絶対パス; - var genredPath = $@"{path}{Path.DirectorySeparatorChar}{song.Genre.genre}{Path.DirectorySeparatorChar}"; - - if (!Directory.Exists(genredPath)) { - // Create Genre sub-folder if does not exist - Directory.CreateDirectory(genredPath); - - // Search a corresponding box-def if exists - CSongListNode correspondingBox = null; - for (int i = 0; i < OpenTaiko.Songs管理.list曲ルート.Count; i++) { - if (OpenTaiko.Songs管理.list曲ルート[i].strジャンル == song.Genre.genre - && OpenTaiko.Songs管理.list曲ルート[i].eノード種別 == CSongListNode.ENodeType.BOX) - correspondingBox = OpenTaiko.Songs管理.list曲ルート[i]; - } - - var newBoxDef = $@"{genredPath}{Path.DirectorySeparatorChar}box.def"; - - if (correspondingBox == null) { - // Generate box.def if none available - - //File.Create(newBoxDef); - - StreamWriter sw = new StreamWriter(newBoxDef, false, Encoding.GetEncoding(OpenTaiko.sEncType)); - - sw.WriteLine($@"#TITLE:{song.Genre.genre}"); - sw.WriteLine($@"#GENRE:{song.Genre.genre}"); - sw.WriteLine($@"#BOXEXPLANATION1:"); - sw.WriteLine($@"#BOXEXPLANATION2:"); - sw.WriteLine($@"#BOXEXPLANATION3:"); - sw.WriteLine($@"#BGCOLOR:#ff00a2"); - sw.WriteLine($@"#BOXCOLOR:#ff00a2"); - sw.WriteLine($@"#BOXTYPE:0"); - sw.WriteLine($@"#BGTYPE:1"); - sw.WriteLine($@"#BOXCHARA:0"); - sw.Close(); - } else { - // Copy the existing box.def if available - var corPath = correspondingBox.arスコア[0].ファイル情報.フォルダの絶対パス; - - File.Copy($@"{corPath}{Path.DirectorySeparatorChar}box.def", newBoxDef); - } - - - } - - - var songPath = $@"{genredPath}{zipName}"; - - System.IO.Compression.ZipFile.ExtractToDirectory(zipPath, songPath); - - // Generate Unique ID with URL - var idPath = songPath; - while (1 == 1) { - var directories = Directory.GetDirectories(idPath); - if (directories.Length < 1) - break; - - idPath = directories[0]; - } - - var uid = new CSongUniqueID(idPath + @$"{Path.DirectorySeparatorChar}uniqueID.json"); - uid.tAttachOnlineAddress(downloadLink); - CSongDict.tAddSongUrl(uid); - - } - - //System.IO.Compression.ZipFile.ExtractToDirectory(zipPath, $@"Songs{Path.DirectorySeparatorChar}S3 Download{Path.DirectorySeparatorChar}{song.Md5}"); - } catch (Exception e) { - Trace.TraceInformation(e.ToString()); - OpenTaiko.Skin.soundError.tPlay(); - } - - - song.DownloadNow = false; - IsDownloading = false; - } - - #endregion - - #region [Enums] - - public enum ECurrentMenu : int { - RETURN, // Return button - MAIN, // Choice between select CDN and Online multiplayer - CDN_SELECT, // Select a registered CDN - CDN_OPTION, // Select between Download songs, Download characters and Download puchicharas - CDN_SONGS, // List songs - CDN_CHARACTERS, // List characters - CDN_PUCHICHARAS,// List puchicharas - MULTI_SELECT, // Main online multiplayer menu - TOTAL, // Submenus count - } - - #endregion - - #region [Private] - - private ScriptBG Background; - - private ECurrentMenu currentMenu; - private ECurrentMenu menuPointer; - private CMenuInfo[] menus; - public EReturnValue eフェードアウト完了時の戻り値; - public CActFIFOBlack actFOtoTitle; - - - private CCachedFontRenderer pfOLFont; - private CCachedFontRenderer pfOLFontLarge; - - private DBCDN dbCDN; - private DBCDN.CDNData dbCDNData; - private API apiMethods; - - // Main Menu - private TitleTextureKey[] ttkMainMenuOpt; - private ECurrentMenu[] mainMenu; - private int mainMenuIndex; - - // CDN Select - private TitleTextureKey[] ttkCDNSelectOpt; - private int CDNSelectIndex; - - // CDN Option - private TitleTextureKey[] ttkCDNOptionOpt; - private ECurrentMenu[] cdnOptMenu; - private int cdnOptMenuIndex; - - // CDN List songs option - private TitleTextureKey[] ttkCDNSongList; - private TitleTextureKey[] ttkCDNSongSubtitles; - private int cdnSongListIndex; - - private bool IsDownloading; - - private class CMenuInfo { - public CMenuInfo(string ttl) { - title = ttl; - } - - public string title; - } - - #endregion + base.ChildActivities.Add(this.actFOtoTitle = new CActFIFOBlack()); } + + private static string GetMenuName(int menu) { + switch (menu) { + case (int)ECurrentMenu.RETURN: + default: + return CLangManager.LangInstance.GetString("ONLINE_EXIT"); + case (int)ECurrentMenu.MAIN: + return CLangManager.LangInstance.GetString("MENU_RETURN"); + case (int)ECurrentMenu.CDN_SELECT: + return CLangManager.LangInstance.GetString("ONLINE_DOWNLOAD"); + case (int)ECurrentMenu.CDN_OPTION: + return CLangManager.LangInstance.GetString("ONLINE_DOWNLOAD_CDN"); + case (int)ECurrentMenu.CDN_SONGS: + return CLangManager.LangInstance.GetString("ONLINE_DOWNLOAD_SONG"); + case (int)ECurrentMenu.CDN_CHARACTERS: + return CLangManager.LangInstance.GetString("ONLINE_DOWNLOAD_CHARA"); + case (int)ECurrentMenu.CDN_PUCHICHARAS: + return CLangManager.LangInstance.GetString("ONLINE_DOWNLOAD_PUCHI"); + case (int)ECurrentMenu.MULTI_SELECT: + return CLangManager.LangInstance.GetString("ONLINE_MULTIPLAYER"); + } + } + + public override void Activate() { + // On activation + + if (base.IsActivated) + return; + + base.ePhaseID = CStage.EPhase.Common_NORMAL; + this.eフェードアウト完了時の戻り値 = EReturnValue.Continuation; + + OpenTaiko.Skin.soundOnlineLoungeBGM?.tPlay(); + + this.currentMenu = ECurrentMenu.MAIN; + this.menuPointer = ECurrentMenu.CDN_SELECT; + this.menus = new CMenuInfo[(int)ECurrentMenu.TOTAL]; + + for (int i = 0; i < (int)ECurrentMenu.TOTAL; i++) + this.menus[i] = new CMenuInfo(GetMenuName(i)); + + + + dbCDN = OpenTaiko.Databases.DBCDN; + dbCDNData = null; + + IsDownloading = false; + + #region [Main menu] + + this.ttkMainMenuOpt = new TitleTextureKey[3]; + + this.ttkMainMenuOpt[0] = new TitleTextureKey(GetMenuName((int)ECurrentMenu.RETURN), this.pfOLFont, Color.White, Color.DarkRed, 1000); + this.ttkMainMenuOpt[1] = new TitleTextureKey(GetMenuName((int)ECurrentMenu.CDN_SELECT), this.pfOLFont, Color.White, Color.DarkRed, 1000); + this.ttkMainMenuOpt[2] = new TitleTextureKey(GetMenuName((int)ECurrentMenu.MULTI_SELECT), this.pfOLFont, Color.White, Color.DarkRed, 1000); + + this.mainMenu = new ECurrentMenu[] { ECurrentMenu.RETURN, ECurrentMenu.CDN_SELECT, ECurrentMenu.MULTI_SELECT }; + + this.mainMenuIndex = 0; + + #endregion + + #region [CDN Select] + + int keyCount = dbCDN.data.Count; + + this.ttkCDNSelectOpt = new TitleTextureKey[keyCount + 1]; + + this.ttkCDNSelectOpt[0] = new TitleTextureKey(GetMenuName((int)ECurrentMenu.MAIN), this.pfOLFont, Color.White, Color.DarkRed, 1000); + + for (int i = 0; i < keyCount; i++) { + this.ttkCDNSelectOpt[i + 1] = new TitleTextureKey(dbCDN.data.ElementAt(i).Key, this.pfOLFont, Color.White, Color.DarkRed, 1000); + } + + this.CDNSelectIndex = 0; + + #endregion + + #region [CDN Option] + + this.ttkCDNOptionOpt = new TitleTextureKey[4]; + + this.ttkCDNOptionOpt[0] = new TitleTextureKey(GetMenuName((int)ECurrentMenu.MAIN), this.pfOLFont, Color.White, Color.DarkRed, 1000); + this.ttkCDNOptionOpt[1] = new TitleTextureKey(GetMenuName((int)ECurrentMenu.CDN_SONGS), this.pfOLFont, Color.White, Color.DarkRed, 1000); + this.ttkCDNOptionOpt[2] = new TitleTextureKey(GetMenuName((int)ECurrentMenu.CDN_CHARACTERS), this.pfOLFont, Color.White, Color.DarkRed, 1000); + this.ttkCDNOptionOpt[3] = new TitleTextureKey(GetMenuName((int)ECurrentMenu.CDN_PUCHICHARAS), this.pfOLFont, Color.White, Color.DarkRed, 1000); + + this.cdnOptMenu = new ECurrentMenu[] { ECurrentMenu.CDN_SELECT, ECurrentMenu.CDN_SONGS, ECurrentMenu.CDN_CHARACTERS, ECurrentMenu.CDN_PUCHICHARAS }; + + this.cdnOptMenuIndex = 0; + + #endregion + + Background = new ScriptBG(CSkin.Path($"{TextureLoader.BASE}{TextureLoader.ONLINELOUNGE}Script.lua")); + Background.Init(); + + base.Activate(); + } + + public override void DeActivate() { + // On de-activation + + OpenTaiko.tDisposeSafely(ref Background); + + OpenTaiko.Songs管理.UpdateDownloadBox(); + + base.DeActivate(); + } + + public override void CreateManagedResource() { + // Ressource allocation + + this.pfOLFont = HPrivateFastFont.tInstantiateMainFont(OpenTaiko.Skin.OnlineLounge_Font_OLFont); + this.pfOLFontLarge = HPrivateFastFont.tInstantiateMainFont(OpenTaiko.Skin.OnlineLounge_Font_OLFontLarge); + + base.CreateManagedResource(); + } + + public override void ReleaseManagedResource() { + // Ressource freeing + this.pfOLFont?.Dispose(); + this.pfOLFontLarge?.Dispose(); + + base.ReleaseManagedResource(); + } + + public override int Draw() { + Background.Update(); + Background.Draw(); + + //OnlineLounge_Background.t2D描画(0, 0); + + #region [Menus] + + + #region [Base Menus] + + TitleTextureKey[] _ref = this.ttkMainMenuOpt; + int _selector = mainMenuIndex; + + if (currentMenu == ECurrentMenu.CDN_SELECT) { + _ref = this.ttkCDNSelectOpt; + _selector = CDNSelectIndex; + } else if (currentMenu == ECurrentMenu.CDN_OPTION) { + _ref = this.ttkCDNOptionOpt; + _selector = cdnOptMenuIndex; + } + + + if (currentMenu == ECurrentMenu.MAIN + || currentMenu == ECurrentMenu.CDN_SELECT + || currentMenu == ECurrentMenu.CDN_OPTION) { + int baseX = OpenTaiko.Skin.OnlineLounge_Side_Menu[0] - _ref.Length * (OpenTaiko.Skin.OnlineLounge_Side_Menu_Move[0] / 2); + int baseY = OpenTaiko.Skin.OnlineLounge_Side_Menu[1] - _ref.Length * (OpenTaiko.Skin.OnlineLounge_Side_Menu_Move[1] / 2); + + for (int i = 0; i < _ref.Length; i++) { + CTexture tmpTex = TitleTextureKey.ResolveTitleTexture(_ref[i]); + + if (_selector != i) { + tmpTex.color4 = CConversion.ColorToColor4(Color.DarkGray); + OpenTaiko.Tx.OnlineLounge_Side_Menu?.tUpdateColor4(CConversion.ColorToColor4(Color.DarkGray)); + } else { + tmpTex.color4 = CConversion.ColorToColor4(Color.White); + OpenTaiko.Tx.OnlineLounge_Side_Menu?.tUpdateColor4(CConversion.ColorToColor4(Color.White)); + } + + OpenTaiko.Tx.OnlineLounge_Side_Menu?.t2D拡大率考慮上中央基準描画(baseX + OpenTaiko.Skin.OnlineLounge_Side_Menu_Move[0] * i, + baseY + OpenTaiko.Skin.OnlineLounge_Side_Menu_Move[1] * i); + tmpTex.t2D拡大率考慮上中央基準描画( + baseX + OpenTaiko.Skin.OnlineLounge_Side_Menu_Text_Offset[0] + OpenTaiko.Skin.OnlineLounge_Side_Menu_Move[0] * i, + baseY + OpenTaiko.Skin.OnlineLounge_Side_Menu_Text_Offset[1] + OpenTaiko.Skin.OnlineLounge_Side_Menu_Move[1] * i); + } + } + + #endregion + + #region [Song list menu] + + if (currentMenu == ECurrentMenu.CDN_SONGS) { + _ref = this.ttkCDNSongList; + _selector = cdnSongListIndex; + + int baseX = OpenTaiko.Skin.OnlineLounge_Song[0]; + int baseY = OpenTaiko.Skin.OnlineLounge_Song[1]; + + for (int i = -4; i < 4; i++) { + int pos = (_ref.Length * 5 + _selector + i) % _ref.Length; + + CTexture tmpTex = TitleTextureKey.ResolveTitleTexture(_ref[pos]); + CTexture tmpSubtitle = TitleTextureKey.ResolveTitleTexture(ttkCDNSongSubtitles[pos]); + + var _color = CConversion.ColorToColor4(Color.DarkGray); + + if (i == 0) + _color = CConversion.ColorToColor4(Color.White); + if (pos > 0 && i != 0) { + var song = apiMethods.FetchedSongsList[pos - 1]; + var downloadLink = GetDownloadLink(song); + + if (CSongDict.tContainsSongUrl(downloadLink)) + _color = CConversion.ColorToColor4(Color.DimGray); + } + + + tmpTex.color4 = _color; + tmpSubtitle.color4 = _color; + + int x = baseX + OpenTaiko.Skin.OnlineLounge_Song_Move[0] * i; + int y = baseY + OpenTaiko.Skin.OnlineLounge_Song_Move[1] * i; + + if (pos == 0) { + OpenTaiko.Tx.OnlineLounge_Return_Box?.tUpdateColor4(_color); + OpenTaiko.Tx.OnlineLounge_Return_Box?.t2D拡大率考慮上中央基準描画(x, y); + } else { + OpenTaiko.Tx.OnlineLounge_Song_Box?.tUpdateColor4(_color); + OpenTaiko.Tx.OnlineLounge_Song_Box?.t2D拡大率考慮上中央基準描画(x, y); + } + + + tmpTex.t2D拡大率考慮上中央基準描画(x + OpenTaiko.Skin.OnlineLounge_Song_Title_Offset[0], y + OpenTaiko.Skin.OnlineLounge_Song_Title_Offset[1]); + tmpSubtitle.t2D拡大率考慮上中央基準描画(x + OpenTaiko.Skin.OnlineLounge_Song_SubTitle_Offset[0], y + OpenTaiko.Skin.OnlineLounge_Song_SubTitle_Offset[1]); + + if (pos != 0 && i == 0) { + OpenTaiko.Tx.OnlineLounge_Context.t2D描画(0, 0); + + var song_ = apiMethods.FetchedSongsList[pos - 1]; + + int[] diffs = new int[] + { + song_.D0, + song_.D1, + song_.D2, + song_.D3, + song_.D4, + song_.D5, + song_.D6, + }; + + #region [Charter Name] + + if (song_.charter != null && song_.charter.charter_name != null && song_.charter.charter_name != "") { + var charter_ = TitleTextureKey.ResolveTitleTexture( + new TitleTextureKey("Charter : " + song_.charter.charter_name, this.pfOLFontLarge, Color.White, Color.Black, 1000)); + charter_?.t2D中心基準描画(OpenTaiko.Skin.OnlineLounge_Context_Charter[0], OpenTaiko.Skin.OnlineLounge_Context_Charter[1]); + } + + #endregion + + #region [Song Genre] + + if (song_.Genre != null && song_.Genre.genre != null && song_.Genre.genre != "") { + var genre_ = TitleTextureKey.ResolveTitleTexture( + new TitleTextureKey(song_.Genre.genre, this.pfOLFontLarge, Color.White, Color.Black, 1000)); + genre_?.t2D中心基準描画(OpenTaiko.Skin.OnlineLounge_Context_Genre[0], OpenTaiko.Skin.OnlineLounge_Context_Genre[1]); + } + + #endregion + + #region [Difficulties] + + for (int k = 0; k < (int)Difficulty.Total; k++) { + int diff = diffs[k]; + + int column = (k >= 3) ? OpenTaiko.Skin.OnlineLounge_Context_Couse_Move[0] : 0; + int row = OpenTaiko.Skin.OnlineLounge_Context_Couse_Move[1] * (k % 3); + + if (diff > 0) { + OpenTaiko.Tx.Couse_Symbol[k]?.t2D中心基準描画( + OpenTaiko.Skin.OnlineLounge_Context_Couse_Symbol[0] + column, + OpenTaiko.Skin.OnlineLounge_Context_Couse_Symbol[1] + row); + + var difnb_ = TitleTextureKey.ResolveTitleTexture( + new TitleTextureKey(diff.ToString(), this.pfOLFontLarge, (diff > 10) ? Color.Red : Color.White, Color.Black, 1000)); + difnb_?.t2D中心基準描画(OpenTaiko.Skin.OnlineLounge_Context_Level[0] + column, OpenTaiko.Skin.OnlineLounge_Context_Level[1] + row); + } + + } + + #endregion + + + } + + } + } + + #endregion + + if (IsDownloading) { + OpenTaiko.Tx.OnlineLounge_Box.t2D描画(0, 0); + + var text = TitleTextureKey.ResolveTitleTexture( + new TitleTextureKey("Downloading...", this.pfOLFontLarge, Color.White, Color.Black, 1000)); + text.t2D中心基準描画(OpenTaiko.Skin.OnlineLounge_Downloading[0], OpenTaiko.Skin.OnlineLounge_Downloading[1]); + } + + #endregion + + + + #region [Input] + + //if (!IsDownloading) + { + if (OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.RightArrow) || + OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.RightChange)) { + if (this.tMove(1)) { + OpenTaiko.Skin.soundChangeSFX.tPlay(); + } + } else if (OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.LeftArrow) || + OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.LeftChange)) { + if (this.tMove(-1)) { + OpenTaiko.Skin.soundChangeSFX.tPlay(); + } + } else if (OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Escape) || + OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.Cancel)) { + + #region [Fast return (Escape)] + + OpenTaiko.Skin.soundCancelSFX.tPlay(); + + if (currentMenu == ECurrentMenu.MAIN) { + // Return to title screen + OpenTaiko.Skin.soundOnlineLoungeBGM?.tStop(); + this.eフェードアウト完了時の戻り値 = EReturnValue.ReturnToTitle; + this.actFOtoTitle.tフェードアウト開始(); + base.ePhaseID = CStage.EPhase.Common_FADEOUT; + } else if (currentMenu == ECurrentMenu.CDN_SELECT || currentMenu == ECurrentMenu.MULTI_SELECT) { + // Return to base menu + currentMenu = ECurrentMenu.MAIN; + } else if (currentMenu == ECurrentMenu.CDN_OPTION) { + // Return to CDN select menu + currentMenu = ECurrentMenu.CDN_SELECT; + } else if (currentMenu == ECurrentMenu.CDN_SONGS || currentMenu == ECurrentMenu.CDN_CHARACTERS || currentMenu == ECurrentMenu.CDN_PUCHICHARAS) { + // Return to CDN select option + currentMenu = ECurrentMenu.CDN_OPTION; + } + + return 0; + + #endregion + } else if (OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Return) || + OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.Decide)) { + + #region [Decide] + + if (currentMenu == ECurrentMenu.MAIN) { + if (mainMenu[mainMenuIndex] == ECurrentMenu.CDN_SELECT || !IsDownloading) { + // Base menu + currentMenu = mainMenu[mainMenuIndex]; + if (currentMenu == ECurrentMenu.RETURN) { + // Quit + OpenTaiko.Skin.soundCancelSFX.tPlay(); + OpenTaiko.Skin.soundOnlineLoungeBGM?.tStop(); + this.eフェードアウト完了時の戻り値 = EReturnValue.ReturnToTitle; + this.actFOtoTitle.tフェードアウト開始(); + base.ePhaseID = CStage.EPhase.Common_FADEOUT; + } else { + OpenTaiko.Skin.soundDecideSFX.tPlay(); + } + } else { + OpenTaiko.Skin.soundError.tPlay(); + } + } else if (currentMenu == ECurrentMenu.CDN_SELECT) { + // CDN Select Menu + if (CDNSelectIndex > 0) { + currentMenu = ECurrentMenu.CDN_OPTION; + dbCDNData = dbCDN.data.ElementAt(CDNSelectIndex - 1).Value; + OpenTaiko.Skin.soundDecideSFX.tPlay(); + } else { + currentMenu = ECurrentMenu.MAIN; + OpenTaiko.Skin.soundCancelSFX.tPlay(); + } + } else if (currentMenu == ECurrentMenu.CDN_OPTION) { + // CDN Option Menu + currentMenu = cdnOptMenu[cdnOptMenuIndex]; + if (currentMenu == ECurrentMenu.CDN_SELECT) + OpenTaiko.Skin.soundCancelSFX.tPlay(); + else { + if (currentMenu == ECurrentMenu.CDN_SONGS) { + apiMethods = new API(dbCDNData); + apiMethods.tLoadSongsFromInternalCDN(); + + #region [Generate song list values] + + int songCountPlusOne = apiMethods.FetchedSongsList.Length + 1; + + this.ttkCDNSongList = new TitleTextureKey[songCountPlusOne]; + this.ttkCDNSongSubtitles = new TitleTextureKey[songCountPlusOne]; + + this.ttkCDNSongList[0] = new TitleTextureKey(GetMenuName((int)ECurrentMenu.MAIN), this.pfOLFont, Color.White, Color.DarkRed, 1000); + this.ttkCDNSongSubtitles[0] = new TitleTextureKey("", this.pfOLFont, Color.White, Color.DarkRed, 1000); + + for (int i = 0; i < apiMethods.FetchedSongsList.Length; i++) { + this.ttkCDNSongList[i + 1] = new TitleTextureKey(apiMethods.FetchedSongsList[i].SongTitle, this.pfOLFont, Color.White, Color.DarkRed, 1000); + + string subtitle_ = apiMethods.FetchedSongsList[i].SongSubtitle; + if (subtitle_.Length >= 2) + subtitle_ = subtitle_.Substring(2); + this.ttkCDNSongSubtitles[i + 1] = new TitleTextureKey(subtitle_, this.pfOLFont, Color.White, Color.DarkRed, 1000); + } + + this.cdnSongListIndex = 0; + + #endregion + } + OpenTaiko.Skin.soundDecideSFX.tPlay(); + } + + } else if (currentMenu == ECurrentMenu.CDN_SONGS) { + if (this.cdnSongListIndex == 0) { + OpenTaiko.Skin.soundCancelSFX.tPlay(); + currentMenu = ECurrentMenu.CDN_OPTION; + } else { + if (this.cdnSongListIndex < apiMethods.FetchedSongsList.Length) { + var song = apiMethods.FetchedSongsList[this.cdnSongListIndex - 1]; + //var zipPath = $@"Cache{Path.DirectorySeparatorChar}{song.Md5}.zip"; + var downloadLink = GetDownloadLink(song); + + if (CSongDict.tContainsSongUrl(downloadLink) || song.DownloadNow) { + OpenTaiko.Skin.soundError.tPlay(); + } else { + OpenTaiko.Skin.soundDecideSFX.tPlay(); + System.Threading.Thread download = + new System.Threading.Thread(new System.Threading.ThreadStart(DownloadSong)); + download.Start(); + } + } + } + } + + + #endregion + } + } + #endregion + + // Menu exit fade out transition + #region [FadeOut] + + switch (base.ePhaseID) { + case CStage.EPhase.Common_FADEOUT: + if (this.actFOtoTitle.Draw() == 0) { + break; + } + return (int)this.eフェードアウト完了時の戻り値; + + } + + #endregion + + return 0; + } + + public bool tMove(int val) { + if (currentMenu == ECurrentMenu.MAIN) { + if (mainMenuIndex + val < 0 || mainMenuIndex + val >= mainMenu.Length) + return false; + + mainMenuIndex += val; + } else if (currentMenu == ECurrentMenu.CDN_SELECT) { + if (CDNSelectIndex + val < 0 || CDNSelectIndex + val >= ttkCDNSelectOpt.Length) + return false; + + CDNSelectIndex += val; + } else if (currentMenu == ECurrentMenu.CDN_OPTION) { + if (cdnOptMenuIndex + val < 0 || cdnOptMenuIndex + val >= cdnOptMenu.Length) + return false; + + cdnOptMenuIndex += val; + } else if (currentMenu == ECurrentMenu.CDN_SONGS) { + cdnSongListIndex = (ttkCDNSongList.Length + cdnSongListIndex + val) % ttkCDNSongList.Length; + } + + return true; + } + + #region [Song Downloading] + + public string ReplaceInvalidChars(string filename, string substitute = "_") { + return string.Join(substitute, filename.Split(Path.GetInvalidFileNameChars())); + } + + public string TruncateString(string s, int length) { + return s.Substring(0, Math.Min(length, s.Length)); + } + + private string GetAssignedLanguageValue(Dictionary ens) { + if (ens.ContainsKey(OpenTaiko.ConfigIni.sLang)) + return ens[OpenTaiko.ConfigIni.sLang]; + return ens["default"]; + } + + private string GetDownloadLink(API.APISongData song) { + return $"{dbCDNData.BaseUrl}{GetAssignedLanguageValue(dbCDNData.Download)}{song.Id}"; + } + + private void DownloadSong() { + IsDownloading = true; + + // Create Cache folder if does not exist + Directory.CreateDirectory($@"Cache{Path.DirectorySeparatorChar}"); + + + var song = apiMethods.FetchedSongsList[this.cdnSongListIndex - 1]; + song.DownloadNow = true; + var zipName = ReplaceInvalidChars($@"{TruncateString(song.SongTitle, 16)}-{TruncateString(song.Md5, 10)}"); + var zipPath = $@"Cache{Path.DirectorySeparatorChar}{zipName}.zip"; + var downloadLink = GetDownloadLink(song); + + try { + // Download zip from cdn + + if (!File.Exists(zipPath)) { + System.Net.WebClient wc = new System.Net.WebClient(); + + wc.DownloadFile(downloadLink, zipPath); + wc.Dispose(); + } + + // Fetch closest Download folder node + CSongListNode downloadBox = null; + for (int i = 0; i < OpenTaiko.Songs管理.list曲ルート.Count; i++) { + if (OpenTaiko.Songs管理.list曲ルート[i].strジャンル == "Download") { + downloadBox = OpenTaiko.Songs管理.list曲ルート[i]; + if (downloadBox.rParentNode != null) downloadBox = downloadBox.rParentNode; + break; + } + } + + // If there is at least one download folder, transfer the zip contents in it + if (downloadBox != null) { + var path = downloadBox.arスコア[0].ファイル情報.フォルダの絶対パス; + var genredPath = $@"{path}{Path.DirectorySeparatorChar}{song.Genre.genre}{Path.DirectorySeparatorChar}"; + + if (!Directory.Exists(genredPath)) { + // Create Genre sub-folder if does not exist + Directory.CreateDirectory(genredPath); + + // Search a corresponding box-def if exists + CSongListNode correspondingBox = null; + for (int i = 0; i < OpenTaiko.Songs管理.list曲ルート.Count; i++) { + if (OpenTaiko.Songs管理.list曲ルート[i].strジャンル == song.Genre.genre + && OpenTaiko.Songs管理.list曲ルート[i].eノード種別 == CSongListNode.ENodeType.BOX) + correspondingBox = OpenTaiko.Songs管理.list曲ルート[i]; + } + + var newBoxDef = $@"{genredPath}{Path.DirectorySeparatorChar}box.def"; + + if (correspondingBox == null) { + // Generate box.def if none available + + //File.Create(newBoxDef); + + StreamWriter sw = new StreamWriter(newBoxDef, false, Encoding.GetEncoding(OpenTaiko.sEncType)); + + sw.WriteLine($@"#TITLE:{song.Genre.genre}"); + sw.WriteLine($@"#GENRE:{song.Genre.genre}"); + sw.WriteLine($@"#BOXEXPLANATION1:"); + sw.WriteLine($@"#BOXEXPLANATION2:"); + sw.WriteLine($@"#BOXEXPLANATION3:"); + sw.WriteLine($@"#BGCOLOR:#ff00a2"); + sw.WriteLine($@"#BOXCOLOR:#ff00a2"); + sw.WriteLine($@"#BOXTYPE:0"); + sw.WriteLine($@"#BGTYPE:1"); + sw.WriteLine($@"#BOXCHARA:0"); + sw.Close(); + } else { + // Copy the existing box.def if available + var corPath = correspondingBox.arスコア[0].ファイル情報.フォルダの絶対パス; + + File.Copy($@"{corPath}{Path.DirectorySeparatorChar}box.def", newBoxDef); + } + + + } + + + var songPath = $@"{genredPath}{zipName}"; + + System.IO.Compression.ZipFile.ExtractToDirectory(zipPath, songPath); + + // Generate Unique ID with URL + var idPath = songPath; + while (1 == 1) { + var directories = Directory.GetDirectories(idPath); + if (directories.Length < 1) + break; + + idPath = directories[0]; + } + + var uid = new CSongUniqueID(idPath + @$"{Path.DirectorySeparatorChar}uniqueID.json"); + uid.tAttachOnlineAddress(downloadLink); + CSongDict.tAddSongUrl(uid); + + } + + //System.IO.Compression.ZipFile.ExtractToDirectory(zipPath, $@"Songs{Path.DirectorySeparatorChar}S3 Download{Path.DirectorySeparatorChar}{song.Md5}"); + } catch (Exception e) { + Trace.TraceInformation(e.ToString()); + OpenTaiko.Skin.soundError.tPlay(); + } + + + song.DownloadNow = false; + IsDownloading = false; + } + + #endregion + + #region [Enums] + + public enum ECurrentMenu : int { + RETURN, // Return button + MAIN, // Choice between select CDN and Online multiplayer + CDN_SELECT, // Select a registered CDN + CDN_OPTION, // Select between Download songs, Download characters and Download puchicharas + CDN_SONGS, // List songs + CDN_CHARACTERS, // List characters + CDN_PUCHICHARAS,// List puchicharas + MULTI_SELECT, // Main online multiplayer menu + TOTAL, // Submenus count + } + + #endregion + + #region [Private] + + private ScriptBG Background; + + private ECurrentMenu currentMenu; + private ECurrentMenu menuPointer; + private CMenuInfo[] menus; + public EReturnValue eフェードアウト完了時の戻り値; + public CActFIFOBlack actFOtoTitle; + + + private CCachedFontRenderer pfOLFont; + private CCachedFontRenderer pfOLFontLarge; + + private DBCDN dbCDN; + private DBCDN.CDNData dbCDNData; + private API apiMethods; + + // Main Menu + private TitleTextureKey[] ttkMainMenuOpt; + private ECurrentMenu[] mainMenu; + private int mainMenuIndex; + + // CDN Select + private TitleTextureKey[] ttkCDNSelectOpt; + private int CDNSelectIndex; + + // CDN Option + private TitleTextureKey[] ttkCDNOptionOpt; + private ECurrentMenu[] cdnOptMenu; + private int cdnOptMenuIndex; + + // CDN List songs option + private TitleTextureKey[] ttkCDNSongList; + private TitleTextureKey[] ttkCDNSongSubtitles; + private int cdnSongListIndex; + + private bool IsDownloading; + + private class CMenuInfo { + public CMenuInfo(string ttl) { + title = ttl; + } + + public string title; + } + + #endregion + } diff --git a/OpenTaiko/src/Stages/13.TowerSelect/CStageTowerSelect.cs b/OpenTaiko/src/Stages/13.TowerSelect/CStageTowerSelect.cs index e39b0601..7e820ae1 100644 --- a/OpenTaiko/src/Stages/13.TowerSelect/CStageTowerSelect.cs +++ b/OpenTaiko/src/Stages/13.TowerSelect/CStageTowerSelect.cs @@ -4,304 +4,304 @@ using System.Text; using FDK; // Minimalist menu class to use for custom menus -namespace OpenTaiko { - class CStageTowerSelect : CStage { - public CStageTowerSelect() { - base.eStageID = EStage.TaikoTowers; - base.ePhaseID = CStage.EPhase.Common_NORMAL; +namespace OpenTaiko; - // Load CActivity objects here - // base.list子Activities.Add(this.act = new CAct()); +class CStageTowerSelect : CStage { + public CStageTowerSelect() { + base.eStageID = EStage.TaikoTowers; + base.ePhaseID = CStage.EPhase.Common_NORMAL; - base.ChildActivities.Add(this.actFOtoNowLoading = new CActFIFOStart()); - base.ChildActivities.Add(this.actFOtoTitle = new CActFIFOBlack()); + // Load CActivity objects here + // base.list子Activities.Add(this.act = new CAct()); + base.ChildActivities.Add(this.actFOtoNowLoading = new CActFIFOStart()); + base.ChildActivities.Add(this.actFOtoTitle = new CActFIFOBlack()); + + } + + public override void Activate() { + // On activation + + if (base.IsActivated) + return; + + base.ePhaseID = CStage.EPhase.Common_NORMAL; + this.eフェードアウト完了時の戻り値 = EReturnValue.Continuation; + + if (listSongs == null) + listSongs = OpenTaiko.Songs管理.list曲ルート_Tower; + + tUpdateBarInfos(); + + Background = new ScriptBG(CSkin.Path($"{TextureLoader.BASE}{TextureLoader.TOWERSELECT}Script.lua")); + Background.Init(); + + base.Activate(); + } + + public override void DeActivate() { + // On de-activation + + OpenTaiko.tDisposeSafely(ref Background); + + base.DeActivate(); + } + + public override void CreateManagedResource() { + // Ressource allocation + + pfTitleFont = HPrivateFastFont.tInstantiateMainFont(OpenTaiko.Skin.TowerSelect_Title_Size); + pfSubTitleFont = HPrivateFastFont.tInstantiateMainFont(OpenTaiko.Skin.TowerSelect_SubTitle_Size); + + base.CreateManagedResource(); + } + + public override void ReleaseManagedResource() { + // Ressource freeing + + pfTitleFont?.Dispose(); + pfSubTitleFont?.Dispose(); + + base.ReleaseManagedResource(); + } + + public override int Draw() { + Background.Update(); + Background.Draw(); + + for (int i = 0; i < OpenTaiko.Skin.TowerSelect_Bar_Count; i++) { + int currentSong = nCurrentSongIndex + i - ((OpenTaiko.Skin.TowerSelect_Bar_Count - 1) / 2); + if (currentSong < 0 || currentSong >= BarInfos.Length) continue; + var bar = BarInfos[currentSong]; + + int x = OpenTaiko.Skin.TowerSelect_Bar_X[i]; + int y = OpenTaiko.Skin.TowerSelect_Bar_Y[i]; + tDrawTower(x, y, bar); } - public override void Activate() { - // On activation + #region [Input] - if (base.IsActivated) - return; - - base.ePhaseID = CStage.EPhase.Common_NORMAL; - this.eフェードアウト完了時の戻り値 = EReturnValue.Continuation; - - if (listSongs == null) - listSongs = OpenTaiko.Songs管理.list曲ルート_Tower; - - tUpdateBarInfos(); - - Background = new ScriptBG(CSkin.Path($"{TextureLoader.BASE}{TextureLoader.TOWERSELECT}Script.lua")); - Background.Init(); - - base.Activate(); - } - - public override void DeActivate() { - // On de-activation - - OpenTaiko.tDisposeSafely(ref Background); - - base.DeActivate(); - } - - public override void CreateManagedResource() { - // Ressource allocation - - pfTitleFont = HPrivateFastFont.tInstantiateMainFont(OpenTaiko.Skin.TowerSelect_Title_Size); - pfSubTitleFont = HPrivateFastFont.tInstantiateMainFont(OpenTaiko.Skin.TowerSelect_SubTitle_Size); - - base.CreateManagedResource(); - } - - public override void ReleaseManagedResource() { - // Ressource freeing - - pfTitleFont?.Dispose(); - pfSubTitleFont?.Dispose(); - - base.ReleaseManagedResource(); - } - - public override int Draw() { - Background.Update(); - Background.Draw(); - - for (int i = 0; i < OpenTaiko.Skin.TowerSelect_Bar_Count; i++) { - int currentSong = nCurrentSongIndex + i - ((OpenTaiko.Skin.TowerSelect_Bar_Count - 1) / 2); - if (currentSong < 0 || currentSong >= BarInfos.Length) continue; - var bar = BarInfos[currentSong]; - - int x = OpenTaiko.Skin.TowerSelect_Bar_X[i]; - int y = OpenTaiko.Skin.TowerSelect_Bar_Y[i]; - tDrawTower(x, y, bar); + if (this.eフェードアウト完了時の戻り値 == EReturnValue.Continuation) { + int returnTitle() { + OpenTaiko.Skin.soundCancelSFX.tPlay(); + this.eフェードアウト完了時の戻り値 = EReturnValue.ReturnToTitle; + this.actFOtoTitle.tフェードアウト開始(); + base.ePhaseID = CStage.EPhase.Common_FADEOUT; + return 0; } - #region [Input] + if (OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.RightArrow) || + OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.RightChange)) { + OpenTaiko.Skin.soundChangeSFX.tPlay(); - if (this.eフェードアウト完了時の戻り値 == EReturnValue.Continuation) { - int returnTitle() { - OpenTaiko.Skin.soundCancelSFX.tPlay(); - this.eフェードアウト完了時の戻り値 = EReturnValue.ReturnToTitle; - this.actFOtoTitle.tフェードアウト開始(); - base.ePhaseID = CStage.EPhase.Common_FADEOUT; - return 0; + if (nCurrentSongIndex < BarInfos.Length - 1) { + nCurrentSongIndex++; } + } else if (OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.LeftArrow) || + OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.LeftChange)) { + OpenTaiko.Skin.soundChangeSFX.tPlay(); - if (OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.RightArrow) || - OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.RightChange)) { - OpenTaiko.Skin.soundChangeSFX.tPlay(); + if (nCurrentSongIndex > 0) { + nCurrentSongIndex--; + } + } else if (OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Escape) || + OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.Cancel)) { - if (nCurrentSongIndex < BarInfos.Length - 1) { - nCurrentSongIndex++; - } - } else if (OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.LeftArrow) || - OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.LeftChange)) { - OpenTaiko.Skin.soundChangeSFX.tPlay(); + #region [Fast return (Escape)] - if (nCurrentSongIndex > 0) { - nCurrentSongIndex--; - } - } else if (OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Escape) || - OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.Cancel)) { + OpenTaiko.Skin.soundCancelSFX.tPlay(); + returnTitle(); - #region [Fast return (Escape)] + #endregion + } else if (OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Return) || + OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.Decide)) { + #region [Decide] - OpenTaiko.Skin.soundCancelSFX.tPlay(); - returnTitle(); + OpenTaiko.Skin.soundDecideSFX.tPlay(); - #endregion - } else if (OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Return) || - OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.Decide)) { - #region [Decide] - - OpenTaiko.Skin.soundDecideSFX.tPlay(); - - switch (currentSong.eノード種別) { - case CSongListNode.ENodeType.SCORE: - tSelectSong(); - break; - case CSongListNode.ENodeType.RANDOM: - tSelectSongRandomly(); - break; - case CSongListNode.ENodeType.BOX: - tOpenFolder(currentSong); - break; - case CSongListNode.ENodeType.BACKBOX: { - if (OpenTaiko.Songs管理.list曲ルート.Contains(currentSong.rParentNode) && currentSong.rParentNode.strジャンル == "太鼓タワー") { - returnTitle(); - } else { - tCloseFolder(currentSong); - } + switch (currentSong.eノード種別) { + case CSongListNode.ENodeType.SCORE: + tSelectSong(); + break; + case CSongListNode.ENodeType.RANDOM: + tSelectSongRandomly(); + break; + case CSongListNode.ENodeType.BOX: + tOpenFolder(currentSong); + break; + case CSongListNode.ENodeType.BACKBOX: { + if (OpenTaiko.Songs管理.list曲ルート.Contains(currentSong.rParentNode) && currentSong.rParentNode.strジャンル == "太鼓タワー") { + returnTitle(); + } else { + tCloseFolder(currentSong); } - break; - } - - #endregion + } + break; } - } - #endregion - - - - // Menu exit fade out transition - switch (base.ePhaseID) { - case CStage.EPhase.SongSelect_FadeOutToNowLoading: - if (this.actFOtoNowLoading.Draw() == 0) { - break; - } - return (int)this.eフェードアウト完了時の戻り値; - case CStage.EPhase.Common_FADEOUT: - if (this.actFOtoTitle.Draw() == 0) { - break; - } - return (int)this.eフェードアウト完了時の戻り値; - - } - - return 0; - } - - #region [Private] - - private class BarInfo { - public string strTitle; - public string strSubTitle; - public CSongListNode.ENodeType eノード種別; - public TitleTextureKey ttkTitle; - public TitleTextureKey ttkSubTitle; - } - - public void tSelectSong() { - OpenTaiko.ConfigIni.bTokkunMode = false; - OpenTaiko.stageSongSelect.rChoosenSong = listSongs[nCurrentSongIndex]; - OpenTaiko.stageSongSelect.r確定されたスコア = listSongs[nCurrentSongIndex].arスコア[(int)Difficulty.Tower]; - OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] = (int)Difficulty.Tower; - OpenTaiko.stageSongSelect.str確定された曲のジャンル = listSongs[nCurrentSongIndex].strジャンル; - if ((OpenTaiko.stageSongSelect.rChoosenSong != null) && (OpenTaiko.stageSongSelect.r確定されたスコア != null)) { - CFloorManagement.reinitialize(OpenTaiko.stageSongSelect.rChoosenSong.arスコア[(int)Difficulty.Tower].譜面情報.nLife); - this.eフェードアウト完了時の戻り値 = EReturnValue.SongChoosen; - this.actFOtoNowLoading.tフェードアウト開始(); // #27787 2012.3.10 yyagi 曲決定時の画面フェードアウトの省略 - base.ePhaseID = CStage.EPhase.SongSelect_FadeOutToNowLoading; - } - // TJAPlayer3.Skin.bgm選曲画面.t停止する(); - CSongSelectSongManager.stopSong(); - } - - private bool tSelectSongRandomly() { - var mandatoryDiffs = new List(); - CSongListNode song = currentSong; - - List songs = new List(); - OpenTaiko.stageSongSelect.t指定された曲の子リストの曲を列挙する_孫リスト含む(song.rParentNode, ref songs, ref mandatoryDiffs, true, Difficulty.Tower); - song.listランダム用ノードリスト = songs; - - int selectableSongCount = song.listランダム用ノードリスト.Count; - - if (selectableSongCount == 0) { - return false; - } - - int randomSongIndex = OpenTaiko.Random.Next(selectableSongCount); - - if (OpenTaiko.ConfigIni.bOutputDetailedDTXLog) { - StringBuilder builder = new StringBuilder(0x400); - builder.Append(string.Format("Total number of songs to randomly choose from {0}. Randomly selected index {0}.", selectableSongCount, randomSongIndex)); - Trace.TraceInformation(builder.ToString()); - } - - // Third assignment - OpenTaiko.stageSongSelect.rChoosenSong = song.listランダム用ノードリスト[randomSongIndex]; - OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] = (int)Difficulty.Tower; - - CFloorManagement.reinitialize(OpenTaiko.stageSongSelect.rChoosenSong.arスコア[(int)Difficulty.Tower].譜面情報.nLife); - OpenTaiko.stageSongSelect.r確定されたスコア = OpenTaiko.stageSongSelect.rChoosenSong.arスコア[OpenTaiko.stageSongSelect.actSongList.n現在のアンカ難易度レベルに最も近い難易度レベルを返す(OpenTaiko.stageSongSelect.rChoosenSong)]; - OpenTaiko.stageSongSelect.str確定された曲のジャンル = OpenTaiko.stageSongSelect.rChoosenSong.strジャンル; - - //TJAPlayer3.Skin.sound曲決定音.t再生する(); - - this.eフェードアウト完了時の戻り値 = EReturnValue.SongChoosen; - this.actFOtoNowLoading.tフェードアウト開始(); // #27787 2012.3.10 yyagi 曲決定時の画面フェードアウトの省略 - base.ePhaseID = CStage.EPhase.SongSelect_FadeOutToNowLoading; - - CSongSelectSongManager.stopSong(); - - return true; - } - - private void tDrawTower(int x, int y, BarInfo barInfo) { - switch (barInfo.eノード種別) { - case CSongListNode.ENodeType.SCORE: - OpenTaiko.Tx.TowerSelect_Tower.t2D中心基準描画(x, y); - break; - case CSongListNode.ENodeType.RANDOM: - OpenTaiko.Tx.TowerSelect_Tower.t2D中心基準描画(x, y); - break; - case CSongListNode.ENodeType.BOX: - OpenTaiko.Tx.TowerSelect_Tower.t2D中心基準描画(x, y); - break; - case CSongListNode.ENodeType.BACKBOX: - OpenTaiko.Tx.TowerSelect_Tower.t2D中心基準描画(x, y); - break; - } - - TitleTextureKey.ResolveTitleTexture(barInfo.ttkTitle).t2D拡大率考慮中央基準描画(x + OpenTaiko.Skin.TowerSelect_Title_Offset[0], y + OpenTaiko.Skin.TowerSelect_Title_Offset[1]); - TitleTextureKey.ResolveTitleTexture(barInfo.ttkSubTitle).t2D拡大率考慮中央基準描画(x + OpenTaiko.Skin.TowerSelect_SubTitle_Offset[0], y + OpenTaiko.Skin.TowerSelect_SubTitle_Offset[1]); - } - - private void tUpdateBarInfos() { - BarInfos = new BarInfo[listSongs.Count]; - tSetBarInfos(); - } - - private void tOpenFolder(CSongListNode song) { - nCurrentSongIndex = 0; - listSongs = song.list子リスト; - tUpdateBarInfos(); - } - - private void tCloseFolder(CSongListNode song) { - nCurrentSongIndex = 0; - listSongs = song.rParentNode.rParentNode.list子リスト; - tUpdateBarInfos(); - } - - private void tSetBarInfos() { - for (int i = 0; i < BarInfos.Length; i++) { - BarInfos[i] = new BarInfo(); - BarInfo bar = BarInfos[i]; - CSongListNode song = listSongs[i]; - - bar.strTitle = song.ldTitle.GetString(""); - bar.strSubTitle = song.ldSubtitle.GetString(""); - bar.eノード種別 = song.eノード種別; - - bar.ttkTitle = new TitleTextureKey(bar.strTitle, pfTitleFont, Color.Black, Color.Transparent, OpenTaiko.Skin.TowerSelect_Title_MaxWidth); - bar.ttkSubTitle = new TitleTextureKey(bar.strSubTitle, pfTitleFont, Color.Black, Color.Transparent, OpenTaiko.Skin.TowerSelect_SubTitle_MaxWidth); - } - } - - private BarInfo[] BarInfos; - private List listSongs; - - private ScriptBG Background; - - private CCachedFontRenderer pfTitleFont; - private CCachedFontRenderer pfSubTitleFont; - - public EReturnValue eフェードアウト完了時の戻り値; - public CActFIFOStart actFOtoNowLoading; - public CActFIFOBlack actFOtoTitle; - - private int nCurrentSongIndex; - private CSongListNode currentSong { - get { - return listSongs[nCurrentSongIndex]; + #endregion } } #endregion + + + + // Menu exit fade out transition + switch (base.ePhaseID) { + case CStage.EPhase.SongSelect_FadeOutToNowLoading: + if (this.actFOtoNowLoading.Draw() == 0) { + break; + } + return (int)this.eフェードアウト完了時の戻り値; + case CStage.EPhase.Common_FADEOUT: + if (this.actFOtoTitle.Draw() == 0) { + break; + } + return (int)this.eフェードアウト完了時の戻り値; + + } + + return 0; } + + #region [Private] + + private class BarInfo { + public string strTitle; + public string strSubTitle; + public CSongListNode.ENodeType eノード種別; + public TitleTextureKey ttkTitle; + public TitleTextureKey ttkSubTitle; + } + + public void tSelectSong() { + OpenTaiko.ConfigIni.bTokkunMode = false; + OpenTaiko.stageSongSelect.rChoosenSong = listSongs[nCurrentSongIndex]; + OpenTaiko.stageSongSelect.r確定されたスコア = listSongs[nCurrentSongIndex].arスコア[(int)Difficulty.Tower]; + OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] = (int)Difficulty.Tower; + OpenTaiko.stageSongSelect.str確定された曲のジャンル = listSongs[nCurrentSongIndex].strジャンル; + if ((OpenTaiko.stageSongSelect.rChoosenSong != null) && (OpenTaiko.stageSongSelect.r確定されたスコア != null)) { + CFloorManagement.reinitialize(OpenTaiko.stageSongSelect.rChoosenSong.arスコア[(int)Difficulty.Tower].譜面情報.nLife); + this.eフェードアウト完了時の戻り値 = EReturnValue.SongChoosen; + this.actFOtoNowLoading.tフェードアウト開始(); // #27787 2012.3.10 yyagi 曲決定時の画面フェードアウトの省略 + base.ePhaseID = CStage.EPhase.SongSelect_FadeOutToNowLoading; + } + // TJAPlayer3.Skin.bgm選曲画面.t停止する(); + CSongSelectSongManager.stopSong(); + } + + private bool tSelectSongRandomly() { + var mandatoryDiffs = new List(); + CSongListNode song = currentSong; + + List songs = new List(); + OpenTaiko.stageSongSelect.t指定された曲の子リストの曲を列挙する_孫リスト含む(song.rParentNode, ref songs, ref mandatoryDiffs, true, Difficulty.Tower); + song.listランダム用ノードリスト = songs; + + int selectableSongCount = song.listランダム用ノードリスト.Count; + + if (selectableSongCount == 0) { + return false; + } + + int randomSongIndex = OpenTaiko.Random.Next(selectableSongCount); + + if (OpenTaiko.ConfigIni.bOutputDetailedDTXLog) { + StringBuilder builder = new StringBuilder(0x400); + builder.Append(string.Format("Total number of songs to randomly choose from {0}. Randomly selected index {0}.", selectableSongCount, randomSongIndex)); + Trace.TraceInformation(builder.ToString()); + } + + // Third assignment + OpenTaiko.stageSongSelect.rChoosenSong = song.listランダム用ノードリスト[randomSongIndex]; + OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] = (int)Difficulty.Tower; + + CFloorManagement.reinitialize(OpenTaiko.stageSongSelect.rChoosenSong.arスコア[(int)Difficulty.Tower].譜面情報.nLife); + OpenTaiko.stageSongSelect.r確定されたスコア = OpenTaiko.stageSongSelect.rChoosenSong.arスコア[OpenTaiko.stageSongSelect.actSongList.n現在のアンカ難易度レベルに最も近い難易度レベルを返す(OpenTaiko.stageSongSelect.rChoosenSong)]; + OpenTaiko.stageSongSelect.str確定された曲のジャンル = OpenTaiko.stageSongSelect.rChoosenSong.strジャンル; + + //TJAPlayer3.Skin.sound曲決定音.t再生する(); + + this.eフェードアウト完了時の戻り値 = EReturnValue.SongChoosen; + this.actFOtoNowLoading.tフェードアウト開始(); // #27787 2012.3.10 yyagi 曲決定時の画面フェードアウトの省略 + base.ePhaseID = CStage.EPhase.SongSelect_FadeOutToNowLoading; + + CSongSelectSongManager.stopSong(); + + return true; + } + + private void tDrawTower(int x, int y, BarInfo barInfo) { + switch (barInfo.eノード種別) { + case CSongListNode.ENodeType.SCORE: + OpenTaiko.Tx.TowerSelect_Tower.t2D中心基準描画(x, y); + break; + case CSongListNode.ENodeType.RANDOM: + OpenTaiko.Tx.TowerSelect_Tower.t2D中心基準描画(x, y); + break; + case CSongListNode.ENodeType.BOX: + OpenTaiko.Tx.TowerSelect_Tower.t2D中心基準描画(x, y); + break; + case CSongListNode.ENodeType.BACKBOX: + OpenTaiko.Tx.TowerSelect_Tower.t2D中心基準描画(x, y); + break; + } + + TitleTextureKey.ResolveTitleTexture(barInfo.ttkTitle).t2D拡大率考慮中央基準描画(x + OpenTaiko.Skin.TowerSelect_Title_Offset[0], y + OpenTaiko.Skin.TowerSelect_Title_Offset[1]); + TitleTextureKey.ResolveTitleTexture(barInfo.ttkSubTitle).t2D拡大率考慮中央基準描画(x + OpenTaiko.Skin.TowerSelect_SubTitle_Offset[0], y + OpenTaiko.Skin.TowerSelect_SubTitle_Offset[1]); + } + + private void tUpdateBarInfos() { + BarInfos = new BarInfo[listSongs.Count]; + tSetBarInfos(); + } + + private void tOpenFolder(CSongListNode song) { + nCurrentSongIndex = 0; + listSongs = song.list子リスト; + tUpdateBarInfos(); + } + + private void tCloseFolder(CSongListNode song) { + nCurrentSongIndex = 0; + listSongs = song.rParentNode.rParentNode.list子リスト; + tUpdateBarInfos(); + } + + private void tSetBarInfos() { + for (int i = 0; i < BarInfos.Length; i++) { + BarInfos[i] = new BarInfo(); + BarInfo bar = BarInfos[i]; + CSongListNode song = listSongs[i]; + + bar.strTitle = song.ldTitle.GetString(""); + bar.strSubTitle = song.ldSubtitle.GetString(""); + bar.eノード種別 = song.eノード種別; + + bar.ttkTitle = new TitleTextureKey(bar.strTitle, pfTitleFont, Color.Black, Color.Transparent, OpenTaiko.Skin.TowerSelect_Title_MaxWidth); + bar.ttkSubTitle = new TitleTextureKey(bar.strSubTitle, pfTitleFont, Color.Black, Color.Transparent, OpenTaiko.Skin.TowerSelect_SubTitle_MaxWidth); + } + } + + private BarInfo[] BarInfos; + private List listSongs; + + private ScriptBG Background; + + private CCachedFontRenderer pfTitleFont; + private CCachedFontRenderer pfSubTitleFont; + + public EReturnValue eフェードアウト完了時の戻り値; + public CActFIFOStart actFOtoNowLoading; + public CActFIFOBlack actFOtoTitle; + + private int nCurrentSongIndex; + private CSongListNode currentSong { + get { + return listSongs[nCurrentSongIndex]; + } + } + + #endregion } diff --git a/OpenTaiko/src/Stages/CActDFPFont.cs b/OpenTaiko/src/Stages/CActDFPFont.cs index 070f345a..4dd47d9b 100644 --- a/OpenTaiko/src/Stages/CActDFPFont.cs +++ b/OpenTaiko/src/Stages/CActDFPFont.cs @@ -3,582 +3,582 @@ using FDK; using Silk.NET.Maths; using Rectangle = System.Drawing.Rectangle; -namespace OpenTaiko { - internal class CActDFPFont : CActivity { - // コンストラクタ +namespace OpenTaiko; - public CActDFPFont() { +internal class CActDFPFont : CActivity { + // コンストラクタ + + public CActDFPFont() { + } + + + // メソッド + + public int n文字列長dot(string str) { + return this.n文字列長dot(str, 1f); + } + public int n文字列長dot(string str, float fScale) { + if (string.IsNullOrEmpty(str)) { + return 0; } - - - // メソッド - - public int n文字列長dot(string str) { - return this.n文字列長dot(str, 1f); - } - public int n文字列長dot(string str, float fScale) { - if (string.IsNullOrEmpty(str)) { - return 0; - } - int num = 0; - foreach (char ch in str) { - foreach (ST文字領域 st文字領域 in this.st文字領域) { - if (st文字領域.ch == ch) { - num += (int)((st文字領域.rc.Width - 5) * fScale); - break; - } + int num = 0; + foreach (char ch in str) { + foreach (ST文字領域 st文字領域 in this.st文字領域) { + if (st文字領域.ch == ch) { + num += (int)((st文字領域.rc.Width - 5) * fScale); + break; } } - return num; } - public void t文字列描画(int x, int y, string str) { - this.t文字列描画(x, y, str, false, 1f); - } - public void t文字列描画(int x, int y, string str, bool b強調) { - this.t文字列描画(x, y, str, b強調, 1f); - } - public void t文字列描画(int x, int y, string str, bool b強調, float fScale) { - if (!base.IsDeActivated && !string.IsNullOrEmpty(str)) { - CTexture texture = b強調 ? OpenTaiko.Tx.Config_Font_Bold : OpenTaiko.Tx.Config_Font; - if (texture != null) { - texture.vcScaleRatio = new Vector3D(fScale, fScale, 1f); - foreach (char ch in str) { - foreach (ST文字領域 st文字領域 in this.st文字領域) { - if (st文字領域.ch == ch) { - texture.t2D描画(x, y, st文字領域.rc); - x += (int)((st文字領域.rc.Width - 5) * fScale); - break; - } + return num; + } + public void t文字列描画(int x, int y, string str) { + this.t文字列描画(x, y, str, false, 1f); + } + public void t文字列描画(int x, int y, string str, bool b強調) { + this.t文字列描画(x, y, str, b強調, 1f); + } + public void t文字列描画(int x, int y, string str, bool b強調, float fScale) { + if (!base.IsDeActivated && !string.IsNullOrEmpty(str)) { + CTexture texture = b強調 ? OpenTaiko.Tx.Config_Font_Bold : OpenTaiko.Tx.Config_Font; + if (texture != null) { + texture.vcScaleRatio = new Vector3D(fScale, fScale, 1f); + foreach (char ch in str) { + foreach (ST文字領域 st文字領域 in this.st文字領域) { + if (st文字領域.ch == ch) { + texture.t2D描画(x, y, st文字領域.rc); + x += (int)((st文字領域.rc.Width - 5) * fScale); + break; } } } } } - - - // CActivity 実装 - - public override void CreateManagedResource() { - //this.tx通常文字 = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\Screen font dfp.png" ), false ); - //this.tx強調文字 = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\Screen font dfp em.png" ), false ); - - - ST文字領域[] st文字領域Array = new ST文字領域[0x5d + 2]; - ST文字領域 st文字領域94 = new ST文字領域(); - ST文字領域 st文字領域 = st文字領域94; - st文字領域.ch = ' '; - st文字領域.rc = new Rectangle(10, 3, 13, 0x1b); - st文字領域Array[0] = st文字領域; - st文字領域94 = new ST文字領域(); - ST文字領域 st文字領域2 = st文字領域94; - st文字領域2.ch = '!'; - st文字領域2.rc = new Rectangle(0x19, 3, 14, 0x1b); - st文字領域Array[1] = st文字領域2; - st文字領域94 = new ST文字領域(); - ST文字領域 st文字領域3 = st文字領域94; - st文字領域3.ch = '"'; - st文字領域3.rc = new Rectangle(0x2c, 3, 0x11, 0x1b); - st文字領域Array[2] = st文字領域3; - st文字領域94 = new ST文字領域(); - ST文字領域 st文字領域4 = st文字領域94; - st文字領域4.ch = '#'; - st文字領域4.rc = new Rectangle(0x40, 3, 0x18, 0x1b); - st文字領域Array[3] = st文字領域4; - st文字領域94 = new ST文字領域(); - ST文字領域 st文字領域5 = st文字領域94; - st文字領域5.ch = '$'; - st文字領域5.rc = new Rectangle(90, 3, 0x15, 0x1b); - st文字領域Array[4] = st文字領域5; - st文字領域94 = new ST文字領域(); - ST文字領域 st文字領域6 = st文字領域94; - st文字領域6.ch = '%'; - st文字領域6.rc = new Rectangle(0x71, 3, 0x1b, 0x1b); - st文字領域Array[5] = st文字領域6; - st文字領域94 = new ST文字領域(); - ST文字領域 st文字領域7 = st文字領域94; - st文字領域7.ch = '&'; - st文字領域7.rc = new Rectangle(0x8e, 3, 0x18, 0x1b); - st文字領域Array[6] = st文字領域7; - st文字領域94 = new ST文字領域(); - ST文字領域 st文字領域8 = st文字領域94; - st文字領域8.ch = '\''; - st文字領域8.rc = new Rectangle(0xab, 3, 11, 0x1b); - st文字領域Array[7] = st文字領域8; - st文字領域94 = new ST文字領域(); - ST文字領域 st文字領域9 = st文字領域94; - st文字領域9.ch = '('; - st文字領域9.rc = new Rectangle(0xc0, 3, 0x10, 0x1b); - st文字領域Array[8] = st文字領域9; - st文字領域94 = new ST文字領域(); - ST文字領域 st文字領域10 = st文字領域94; - st文字領域10.ch = ')'; - st文字領域10.rc = new Rectangle(0xd0, 3, 0x10, 0x1b); - st文字領域Array[9] = st文字領域10; - st文字領域94 = new ST文字領域(); - ST文字領域 st文字領域11 = st文字領域94; - st文字領域11.ch = '*'; - st文字領域11.rc = new Rectangle(0xe2, 3, 0x15, 0x1b); - st文字領域Array[10] = st文字領域11; - st文字領域94 = new ST文字領域(); - ST文字領域 st文字領域12 = st文字領域94; - st文字領域12.ch = '+'; - st文字領域12.rc = new Rectangle(2, 0x1f, 0x18, 0x1b); - st文字領域Array[11] = st文字領域12; - st文字領域94 = new ST文字領域(); - ST文字領域 st文字領域13 = st文字領域94; - st文字領域13.ch = ','; - st文字領域13.rc = new Rectangle(0x1b, 0x1f, 11, 0x1b); - st文字領域Array[12] = st文字領域13; - st文字領域94 = new ST文字領域(); - ST文字領域 st文字領域14 = st文字領域94; - st文字領域14.ch = '-'; - st文字領域14.rc = new Rectangle(0x29, 0x1f, 13, 0x1b); - st文字領域Array[13] = st文字領域14; - st文字領域94 = new ST文字領域(); - ST文字領域 st文字領域15 = st文字領域94; - st文字領域15.ch = '.'; - st文字領域15.rc = new Rectangle(0x37, 0x1f, 11, 0x1b); - st文字領域Array[14] = st文字領域15; - st文字領域94 = new ST文字領域(); - ST文字領域 st文字領域16 = st文字領域94; - st文字領域16.ch = '/'; - st文字領域16.rc = new Rectangle(0x44, 0x1f, 0x15, 0x1b); - st文字領域Array[15] = st文字領域16; - st文字領域94 = new ST文字領域(); - ST文字領域 st文字領域17 = st文字領域94; - st文字領域17.ch = '0'; - st文字領域17.rc = new Rectangle(0x5b, 0x1f, 20, 0x1b); - st文字領域Array[0x10] = st文字領域17; - st文字領域94 = new ST文字領域(); - ST文字領域 st文字領域18 = st文字領域94; - st文字領域18.ch = '1'; - st文字領域18.rc = new Rectangle(0x75, 0x1f, 14, 0x1b); - st文字領域Array[0x11] = st文字領域18; - st文字領域94 = new ST文字領域(); - ST文字領域 st文字領域19 = st文字領域94; - st文字領域19.ch = '2'; - st文字領域19.rc = new Rectangle(0x86, 0x1f, 0x15, 0x1b); - st文字領域Array[0x12] = st文字領域19; - st文字領域94 = new ST文字領域(); - ST文字領域 st文字領域20 = st文字領域94; - st文字領域20.ch = '3'; - st文字領域20.rc = new Rectangle(0x9d, 0x1f, 20, 0x1b); - st文字領域Array[0x13] = st文字領域20; - st文字領域94 = new ST文字領域(); - ST文字領域 st文字領域21 = st文字領域94; - st文字領域21.ch = '4'; - st文字領域21.rc = new Rectangle(0xb3, 0x1f, 20, 0x1b); - st文字領域Array[20] = st文字領域21; - st文字領域94 = new ST文字領域(); - ST文字領域 st文字領域22 = st文字領域94; - st文字領域22.ch = '5'; - st文字領域22.rc = new Rectangle(0xca, 0x1f, 0x13, 0x1b); - st文字領域Array[0x15] = st文字領域22; - st文字領域94 = new ST文字領域(); - ST文字領域 st文字領域23 = st文字領域94; - st文字領域23.ch = '6'; - st文字領域23.rc = new Rectangle(0xe0, 0x1f, 20, 0x1b); - st文字領域Array[0x16] = st文字領域23; - st文字領域94 = new ST文字領域(); - ST文字領域 st文字領域24 = st文字領域94; - st文字領域24.ch = '7'; - st文字領域24.rc = new Rectangle(4, 0x3b, 0x13, 0x1b); - st文字領域Array[0x17] = st文字領域24; - st文字領域94 = new ST文字領域(); - ST文字領域 st文字領域25 = st文字領域94; - st文字領域25.ch = '8'; - st文字領域25.rc = new Rectangle(0x18, 0x3b, 20, 0x1b); - st文字領域Array[0x18] = st文字領域25; - st文字領域94 = new ST文字領域(); - ST文字領域 st文字領域26 = st文字領域94; - st文字領域26.ch = '9'; - st文字領域26.rc = new Rectangle(0x2f, 0x3b, 0x13, 0x1b); - st文字領域Array[0x19] = st文字領域26; - st文字領域94 = new ST文字領域(); - ST文字領域 st文字領域27 = st文字領域94; - st文字領域27.ch = ':'; - st文字領域27.rc = new Rectangle(0x44, 0x3b, 12, 0x1b); - st文字領域Array[0x1a] = st文字領域27; - st文字領域94 = new ST文字領域(); - ST文字領域 st文字領域28 = st文字領域94; - st文字領域28.ch = ';'; - st文字領域28.rc = new Rectangle(0x51, 0x3b, 13, 0x1b); - st文字領域Array[0x1b] = st文字領域28; - st文字領域94 = new ST文字領域(); - ST文字領域 st文字領域29 = st文字領域94; - st文字領域29.ch = '<'; - st文字領域29.rc = new Rectangle(0x60, 0x3b, 20, 0x1b); - st文字領域Array[0x1c] = st文字領域29; - st文字領域94 = new ST文字領域(); - ST文字領域 st文字領域30 = st文字領域94; - st文字領域30.ch = '='; - st文字領域30.rc = new Rectangle(0x74, 0x3b, 0x11, 0x1b); - st文字領域Array[0x1d] = st文字領域30; - st文字領域94 = new ST文字領域(); - ST文字領域 st文字領域31 = st文字領域94; - st文字領域31.ch = '>'; - st文字領域31.rc = new Rectangle(0x85, 0x3b, 20, 0x1b); - st文字領域Array[30] = st文字領域31; - st文字領域94 = new ST文字領域(); - ST文字領域 st文字領域32 = st文字領域94; - st文字領域32.ch = '?'; - st文字領域32.rc = new Rectangle(0x9c, 0x3b, 20, 0x1b); - st文字領域Array[0x1f] = st文字領域32; - st文字領域94 = new ST文字領域(); - ST文字領域 st文字領域33 = st文字領域94; - st文字領域33.ch = 'A'; - st文字領域33.rc = new Rectangle(0xb1, 0x3b, 0x17, 0x1b); - st文字領域Array[0x20] = st文字領域33; - st文字領域94 = new ST文字領域(); - ST文字領域 st文字領域34 = st文字領域94; - st文字領域34.ch = 'B'; - st文字領域34.rc = new Rectangle(0xcb, 0x3b, 0x15, 0x1b); - st文字領域Array[0x21] = st文字領域34; - st文字領域94 = new ST文字領域(); - ST文字領域 st文字領域35 = st文字領域94; - st文字領域35.ch = 'C'; - st文字領域35.rc = new Rectangle(0xe3, 0x3b, 0x16, 0x1b); - st文字領域Array[0x22] = st文字領域35; - st文字領域94 = new ST文字領域(); - ST文字領域 st文字領域36 = st文字領域94; - st文字領域36.ch = 'D'; - st文字領域36.rc = new Rectangle(2, 0x57, 0x16, 0x1b); - st文字領域Array[0x23] = st文字領域36; - st文字領域94 = new ST文字領域(); - ST文字領域 st文字領域37 = st文字領域94; - st文字領域37.ch = 'E'; - st文字領域37.rc = new Rectangle(0x1a, 0x57, 0x16, 0x1b); - st文字領域Array[0x24] = st文字領域37; - st文字領域94 = new ST文字領域(); - ST文字領域 st文字領域38 = st文字領域94; - st文字領域38.ch = 'F'; - st文字領域38.rc = new Rectangle(0x30, 0x57, 0x16, 0x1b); - st文字領域Array[0x25] = st文字領域38; - st文字領域94 = new ST文字領域(); - ST文字領域 st文字領域39 = st文字領域94; - st文字領域39.ch = 'G'; - st文字領域39.rc = new Rectangle(0x48, 0x57, 0x16, 0x1b); - st文字領域Array[0x26] = st文字領域39; - st文字領域94 = new ST文字領域(); - ST文字領域 st文字領域40 = st文字領域94; - st文字領域40.ch = 'H'; - st文字領域40.rc = new Rectangle(0x61, 0x57, 0x18, 0x1b); - st文字領域Array[0x27] = st文字領域40; - st文字領域94 = new ST文字領域(); - ST文字領域 st文字領域41 = st文字領域94; - st文字領域41.ch = 'I'; - st文字領域41.rc = new Rectangle(0x7a, 0x57, 13, 0x1b); - st文字領域Array[40] = st文字領域41; - st文字領域94 = new ST文字領域(); - ST文字領域 st文字領域42 = st文字領域94; - st文字領域42.ch = 'J'; - st文字領域42.rc = new Rectangle(0x88, 0x57, 20, 0x1b); - st文字領域Array[0x29] = st文字領域42; - st文字領域94 = new ST文字領域(); - ST文字領域 st文字領域43 = st文字領域94; - st文字領域43.ch = 'K'; - st文字領域43.rc = new Rectangle(0x9d, 0x57, 0x18, 0x1b); - st文字領域Array[0x2a] = st文字領域43; - st文字領域94 = new ST文字領域(); - ST文字領域 st文字領域44 = st文字領域94; - st文字領域44.ch = 'L'; - st文字領域44.rc = new Rectangle(0xb7, 0x57, 20, 0x1b); - st文字領域Array[0x2b] = st文字領域44; - st文字領域94 = new ST文字領域(); - ST文字領域 st文字領域45 = st文字領域94; - st文字領域45.ch = 'M'; - st文字領域45.rc = new Rectangle(0xce, 0x57, 0x1a, 0x1b); - st文字領域Array[0x2c] = st文字領域45; - st文字領域94 = new ST文字領域(); - ST文字領域 st文字領域46 = st文字領域94; - st文字領域46.ch = 'N'; - st文字領域46.rc = new Rectangle(0xe9, 0x57, 0x17, 0x1b); - st文字領域Array[0x2d] = st文字領域46; - st文字領域94 = new ST文字領域(); - ST文字領域 st文字領域47 = st文字領域94; - st文字領域47.ch = 'O'; - st文字領域47.rc = new Rectangle(2, 0x73, 0x18, 0x1b); - st文字領域Array[0x2e] = st文字領域47; - st文字領域94 = new ST文字領域(); - ST文字領域 st文字領域48 = st文字領域94; - st文字領域48.ch = 'P'; - st文字領域48.rc = new Rectangle(0x1c, 0x73, 0x15, 0x1b); - st文字領域Array[0x2f] = st文字領域48; - st文字領域94 = new ST文字領域(); - ST文字領域 st文字領域49 = st文字領域94; - st文字領域49.ch = 'Q'; - st文字領域49.rc = new Rectangle(0x33, 0x73, 0x17, 0x1b); - st文字領域Array[0x30] = st文字領域49; - st文字領域94 = new ST文字領域(); - ST文字領域 st文字領域50 = st文字領域94; - st文字領域50.ch = 'R'; - st文字領域50.rc = new Rectangle(0x4c, 0x73, 0x16, 0x1b); - st文字領域Array[0x31] = st文字領域50; - st文字領域94 = new ST文字領域(); - ST文字領域 st文字領域51 = st文字領域94; - st文字領域51.ch = 'S'; - st文字領域51.rc = new Rectangle(100, 0x73, 0x15, 0x1b); - st文字領域Array[50] = st文字領域51; - st文字領域94 = new ST文字領域(); - ST文字領域 st文字領域52 = st文字領域94; - st文字領域52.ch = 'T'; - st文字領域52.rc = new Rectangle(0x7c, 0x73, 0x16, 0x1b); - st文字領域Array[0x33] = st文字領域52; - st文字領域94 = new ST文字領域(); - ST文字領域 st文字領域53 = st文字領域94; - st文字領域53.ch = 'U'; - st文字領域53.rc = new Rectangle(0x93, 0x73, 0x16, 0x1b); - st文字領域Array[0x34] = st文字領域53; - st文字領域94 = new ST文字領域(); - ST文字領域 st文字領域54 = st文字領域94; - st文字領域54.ch = 'V'; - st文字領域54.rc = new Rectangle(0xad, 0x73, 0x16, 0x1b); - st文字領域Array[0x35] = st文字領域54; - st文字領域94 = new ST文字領域(); - ST文字領域 st文字領域55 = st文字領域94; - st文字領域55.ch = 'W'; - st文字領域55.rc = new Rectangle(0xc5, 0x73, 0x1a, 0x1b); - st文字領域Array[0x36] = st文字領域55; - st文字領域94 = new ST文字領域(); - ST文字領域 st文字領域56 = st文字領域94; - st文字領域56.ch = 'X'; - st文字領域56.rc = new Rectangle(0xe0, 0x73, 0x1a, 0x1b); - st文字領域Array[0x37] = st文字領域56; - st文字領域94 = new ST文字領域(); - ST文字領域 st文字領域57 = st文字領域94; - st文字領域57.ch = 'Y'; - st文字領域57.rc = new Rectangle(4, 0x8f, 0x17, 0x1b); - st文字領域Array[0x38] = st文字領域57; - st文字領域94 = new ST文字領域(); - ST文字領域 st文字領域58 = st文字領域94; - st文字領域58.ch = 'Z'; - st文字領域58.rc = new Rectangle(0x1b, 0x8f, 0x16, 0x1b); - st文字領域Array[0x39] = st文字領域58; - st文字領域94 = new ST文字領域(); - ST文字領域 st文字領域59 = st文字領域94; - st文字領域59.ch = '['; - st文字領域59.rc = new Rectangle(0x31, 0x8f, 0x11, 0x1b); - st文字領域Array[0x3a] = st文字領域59; - st文字領域94 = new ST文字領域(); - ST文字領域 st文字領域60 = st文字領域94; - st文字領域60.ch = '\\'; - st文字領域60.rc = new Rectangle(0x42, 0x8f, 0x19, 0x1b); - st文字領域Array[0x3b] = st文字領域60; - st文字領域94 = new ST文字領域(); - ST文字領域 st文字領域61 = st文字領域94; - st文字領域61.ch = ']'; - st文字領域61.rc = new Rectangle(0x5c, 0x8f, 0x11, 0x1b); - st文字領域Array[60] = st文字領域61; - st文字領域94 = new ST文字領域(); - ST文字領域 st文字領域62 = st文字領域94; - st文字領域62.ch = '^'; - st文字領域62.rc = new Rectangle(0x71, 0x8f, 0x10, 0x1b); - st文字領域Array[0x3d] = st文字領域62; - st文字領域94 = new ST文字領域(); - ST文字領域 st文字領域63 = st文字領域94; - st文字領域63.ch = '_'; - st文字領域63.rc = new Rectangle(0x81, 0x8f, 0x13, 0x1b); - st文字領域Array[0x3e] = st文字領域63; - st文字領域94 = new ST文字領域(); - ST文字領域 st文字領域64 = st文字領域94; - st文字領域64.ch = 'a'; - st文字領域64.rc = new Rectangle(150, 0x8f, 0x13, 0x1b); - st文字領域Array[0x3f] = st文字領域64; - st文字領域94 = new ST文字領域(); - ST文字領域 st文字領域65 = st文字領域94; - st文字領域65.ch = 'b'; - st文字領域65.rc = new Rectangle(0xac, 0x8f, 20, 0x1b); - st文字領域Array[0x40] = st文字領域65; - st文字領域94 = new ST文字領域(); - ST文字領域 st文字領域66 = st文字領域94; - st文字領域66.ch = 'c'; - st文字領域66.rc = new Rectangle(0xc3, 0x8f, 0x12, 0x1b); - st文字領域Array[0x41] = st文字領域66; - st文字領域94 = new ST文字領域(); - ST文字領域 st文字領域67 = st文字領域94; - st文字領域67.ch = 'd'; - st文字領域67.rc = new Rectangle(0xd8, 0x8f, 0x15, 0x1b); - st文字領域Array[0x42] = st文字領域67; - st文字領域94 = new ST文字領域(); - ST文字領域 st文字領域68 = st文字領域94; - st文字領域68.ch = 'e'; - st文字領域68.rc = new Rectangle(2, 0xab, 0x13, 0x1b); - st文字領域Array[0x43] = st文字領域68; - st文字領域94 = new ST文字領域(); - ST文字領域 st文字領域69 = st文字領域94; - st文字領域69.ch = 'f'; - st文字領域69.rc = new Rectangle(0x17, 0xab, 0x11, 0x1b); - st文字領域Array[0x44] = st文字領域69; - st文字領域94 = new ST文字領域(); - ST文字領域 st文字領域70 = st文字領域94; - st文字領域70.ch = 'g'; - st文字領域70.rc = new Rectangle(40, 0xab, 0x15, 0x1b); - st文字領域Array[0x45] = st文字領域70; - st文字領域94 = new ST文字領域(); - ST文字領域 st文字領域71 = st文字領域94; - st文字領域71.ch = 'h'; - st文字領域71.rc = new Rectangle(0x3f, 0xab, 20, 0x1b); - st文字領域Array[70] = st文字領域71; - st文字領域94 = new ST文字領域(); - ST文字領域 st文字領域72 = st文字領域94; - st文字領域72.ch = 'i'; - st文字領域72.rc = new Rectangle(0x55, 0xab, 13, 0x1b); - st文字領域Array[0x47] = st文字領域72; - st文字領域94 = new ST文字領域(); - ST文字領域 st文字領域73 = st文字領域94; - st文字領域73.ch = 'j'; - st文字領域73.rc = new Rectangle(0x62, 0xab, 0x10, 0x1b); - st文字領域Array[0x48] = st文字領域73; - st文字領域94 = new ST文字領域(); - ST文字領域 st文字領域74 = st文字領域94; - st文字領域74.ch = 'k'; - st文字領域74.rc = new Rectangle(0x74, 0xab, 20, 0x1b); - st文字領域Array[0x49] = st文字領域74; - st文字領域94 = new ST文字領域(); - ST文字領域 st文字領域75 = st文字領域94; - st文字領域75.ch = 'l'; - st文字領域75.rc = new Rectangle(0x8a, 0xab, 13, 0x1b); - st文字領域Array[0x4a] = st文字領域75; - st文字領域94 = new ST文字領域(); - ST文字領域 st文字領域76 = st文字領域94; - st文字領域76.ch = 'm'; - st文字領域76.rc = new Rectangle(0x98, 0xab, 0x1a, 0x1b); - st文字領域Array[0x4b] = st文字領域76; - st文字領域94 = new ST文字領域(); - ST文字領域 st文字領域77 = st文字領域94; - st文字領域77.ch = 'n'; - st文字領域77.rc = new Rectangle(0xb5, 0xab, 20, 0x1b); - st文字領域Array[0x4c] = st文字領域77; - st文字領域94 = new ST文字領域(); - ST文字領域 st文字領域78 = st文字領域94; - st文字領域78.ch = 'o'; - st文字領域78.rc = new Rectangle(0xcc, 0xab, 0x13, 0x1b); - st文字領域Array[0x4d] = st文字領域78; - st文字領域94 = new ST文字領域(); - ST文字領域 st文字領域79 = st文字領域94; - st文字領域79.ch = 'p'; - st文字領域79.rc = new Rectangle(0xe1, 0xab, 0x15, 0x1b); - st文字領域Array[0x4e] = st文字領域79; - st文字領域94 = new ST文字領域(); - ST文字領域 st文字領域80 = st文字領域94; - st文字領域80.ch = 'q'; - st文字領域80.rc = new Rectangle(2, 0xc7, 20, 0x1b); - st文字領域Array[0x4f] = st文字領域80; - st文字領域94 = new ST文字領域(); - ST文字領域 st文字領域81 = st文字領域94; - st文字領域81.ch = 'r'; - st文字領域81.rc = new Rectangle(0x18, 0xc7, 0x12, 0x1b); - st文字領域Array[80] = st文字領域81; - st文字領域94 = new ST文字領域(); - ST文字領域 st文字領域82 = st文字領域94; - st文字領域82.ch = 's'; - st文字領域82.rc = new Rectangle(0x2a, 0xc7, 0x13, 0x1b); - st文字領域Array[0x51] = st文字領域82; - st文字領域94 = new ST文字領域(); - ST文字領域 st文字領域83 = st文字領域94; - st文字領域83.ch = 't'; - st文字領域83.rc = new Rectangle(0x3f, 0xc7, 0x10, 0x1b); - st文字領域Array[0x52] = st文字領域83; - st文字領域94 = new ST文字領域(); - ST文字領域 st文字領域84 = st文字領域94; - st文字領域84.ch = 'u'; - st文字領域84.rc = new Rectangle(80, 0xc7, 20, 0x1b); - st文字領域Array[0x53] = st文字領域84; - st文字領域94 = new ST文字領域(); - ST文字領域 st文字領域85 = st文字領域94; - st文字領域85.ch = 'v'; - st文字領域85.rc = new Rectangle(0x68, 0xc7, 20, 0x1b); - st文字領域Array[0x54] = st文字領域85; - st文字領域94 = new ST文字領域(); - ST文字領域 st文字領域86 = st文字領域94; - st文字領域86.ch = 'w'; - st文字領域86.rc = new Rectangle(0x7f, 0xc7, 0x1a, 0x1b); - st文字領域Array[0x55] = st文字領域86; - st文字領域94 = new ST文字領域(); - ST文字領域 st文字領域87 = st文字領域94; - st文字領域87.ch = 'x'; - st文字領域87.rc = new Rectangle(0x9a, 0xc7, 0x16, 0x1b); - st文字領域Array[0x56] = st文字領域87; - st文字領域94 = new ST文字領域(); - ST文字領域 st文字領域88 = st文字領域94; - st文字領域88.ch = 'y'; - st文字領域88.rc = new Rectangle(0xb1, 0xc7, 0x16, 0x1b); - st文字領域Array[0x57] = st文字領域88; - st文字領域94 = new ST文字領域(); - ST文字領域 st文字領域89 = st文字領域94; - st文字領域89.ch = 'z'; - st文字領域89.rc = new Rectangle(200, 0xc7, 0x13, 0x1b); - st文字領域Array[0x58] = st文字領域89; - st文字領域94 = new ST文字領域(); - ST文字領域 st文字領域90 = st文字領域94; - st文字領域90.ch = '{'; - st文字領域90.rc = new Rectangle(220, 0xc7, 15, 0x1b); - st文字領域Array[0x59] = st文字領域90; - st文字領域94 = new ST文字領域(); - ST文字領域 st文字領域91 = st文字領域94; - st文字領域91.ch = '|'; - st文字領域91.rc = new Rectangle(0xeb, 0xc7, 13, 0x1b); - st文字領域Array[90] = st文字領域91; - st文字領域94 = new ST文字領域(); - ST文字領域 st文字領域92 = st文字領域94; - st文字領域92.ch = '}'; - st文字領域92.rc = new Rectangle(1, 0xe3, 15, 0x1b); - st文字領域Array[0x5b] = st文字領域92; - ST文字領域 st文字領域93 = new ST文字領域(); - st文字領域93.ch = '~'; - st文字領域93.rc = new Rectangle(0x12, 0xe3, 0x12, 0x1b); - st文字領域Array[0x5c] = st文字領域93; - - st文字領域Array[0x5d] = new ST文字領域(); // #24954 2011.4.23 yyagi - st文字領域Array[0x5d].ch = '@'; - st文字領域Array[0x5d].rc = new Rectangle(38, 227, 28, 28); - st文字領域Array[0x5e] = new ST文字領域(); - st文字領域Array[0x5e].ch = '`'; - st文字領域Array[0x5e].rc = new Rectangle(69, 226, 14, 29); - - float scaleX = OpenTaiko.Tx.Config_Font.szTextureSize.Width / 256.0f; - float scaleY = OpenTaiko.Tx.Config_Font.szTextureSize.Height / 256.0f; - - for (int i = 0; i < st文字領域Array.Length; i++) { - st文字領域Array[i].rc = new Rectangle((int)(st文字領域Array[i].rc.X * scaleX), (int)(st文字領域Array[i].rc.Y * scaleY), - (int)(st文字領域Array[i].rc.Width * scaleX), (int)(st文字領域Array[i].rc.Height * scaleY)); - } - - this.st文字領域 = st文字領域Array; - base.CreateManagedResource(); - } - public override void ReleaseManagedResource() { - //if( !base.b活性化してない ) - //{ - // if( this.tx強調文字 != null ) - // { - // this.tx強調文字.Dispose(); - // this.tx強調文字 = null; - // } - // if( this.tx通常文字 != null ) - // { - // this.tx通常文字.Dispose(); - // this.tx通常文字 = null; - // } - base.ReleaseManagedResource(); - //} - } - - - // その他 - - #region [ private ] - //----------------- - [StructLayout(LayoutKind.Sequential)] - private struct ST文字領域 { - public char ch; - public Rectangle rc; - } - - private ST文字領域[] st文字領域; - //private CTexture tx強調文字; - //private CTexture tx通常文字; - //----------------- - #endregion } + + + // CActivity 実装 + + public override void CreateManagedResource() { + //this.tx通常文字 = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\Screen font dfp.png" ), false ); + //this.tx強調文字 = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\Screen font dfp em.png" ), false ); + + + ST文字領域[] st文字領域Array = new ST文字領域[0x5d + 2]; + ST文字領域 st文字領域94 = new ST文字領域(); + ST文字領域 st文字領域 = st文字領域94; + st文字領域.ch = ' '; + st文字領域.rc = new Rectangle(10, 3, 13, 0x1b); + st文字領域Array[0] = st文字領域; + st文字領域94 = new ST文字領域(); + ST文字領域 st文字領域2 = st文字領域94; + st文字領域2.ch = '!'; + st文字領域2.rc = new Rectangle(0x19, 3, 14, 0x1b); + st文字領域Array[1] = st文字領域2; + st文字領域94 = new ST文字領域(); + ST文字領域 st文字領域3 = st文字領域94; + st文字領域3.ch = '"'; + st文字領域3.rc = new Rectangle(0x2c, 3, 0x11, 0x1b); + st文字領域Array[2] = st文字領域3; + st文字領域94 = new ST文字領域(); + ST文字領域 st文字領域4 = st文字領域94; + st文字領域4.ch = '#'; + st文字領域4.rc = new Rectangle(0x40, 3, 0x18, 0x1b); + st文字領域Array[3] = st文字領域4; + st文字領域94 = new ST文字領域(); + ST文字領域 st文字領域5 = st文字領域94; + st文字領域5.ch = '$'; + st文字領域5.rc = new Rectangle(90, 3, 0x15, 0x1b); + st文字領域Array[4] = st文字領域5; + st文字領域94 = new ST文字領域(); + ST文字領域 st文字領域6 = st文字領域94; + st文字領域6.ch = '%'; + st文字領域6.rc = new Rectangle(0x71, 3, 0x1b, 0x1b); + st文字領域Array[5] = st文字領域6; + st文字領域94 = new ST文字領域(); + ST文字領域 st文字領域7 = st文字領域94; + st文字領域7.ch = '&'; + st文字領域7.rc = new Rectangle(0x8e, 3, 0x18, 0x1b); + st文字領域Array[6] = st文字領域7; + st文字領域94 = new ST文字領域(); + ST文字領域 st文字領域8 = st文字領域94; + st文字領域8.ch = '\''; + st文字領域8.rc = new Rectangle(0xab, 3, 11, 0x1b); + st文字領域Array[7] = st文字領域8; + st文字領域94 = new ST文字領域(); + ST文字領域 st文字領域9 = st文字領域94; + st文字領域9.ch = '('; + st文字領域9.rc = new Rectangle(0xc0, 3, 0x10, 0x1b); + st文字領域Array[8] = st文字領域9; + st文字領域94 = new ST文字領域(); + ST文字領域 st文字領域10 = st文字領域94; + st文字領域10.ch = ')'; + st文字領域10.rc = new Rectangle(0xd0, 3, 0x10, 0x1b); + st文字領域Array[9] = st文字領域10; + st文字領域94 = new ST文字領域(); + ST文字領域 st文字領域11 = st文字領域94; + st文字領域11.ch = '*'; + st文字領域11.rc = new Rectangle(0xe2, 3, 0x15, 0x1b); + st文字領域Array[10] = st文字領域11; + st文字領域94 = new ST文字領域(); + ST文字領域 st文字領域12 = st文字領域94; + st文字領域12.ch = '+'; + st文字領域12.rc = new Rectangle(2, 0x1f, 0x18, 0x1b); + st文字領域Array[11] = st文字領域12; + st文字領域94 = new ST文字領域(); + ST文字領域 st文字領域13 = st文字領域94; + st文字領域13.ch = ','; + st文字領域13.rc = new Rectangle(0x1b, 0x1f, 11, 0x1b); + st文字領域Array[12] = st文字領域13; + st文字領域94 = new ST文字領域(); + ST文字領域 st文字領域14 = st文字領域94; + st文字領域14.ch = '-'; + st文字領域14.rc = new Rectangle(0x29, 0x1f, 13, 0x1b); + st文字領域Array[13] = st文字領域14; + st文字領域94 = new ST文字領域(); + ST文字領域 st文字領域15 = st文字領域94; + st文字領域15.ch = '.'; + st文字領域15.rc = new Rectangle(0x37, 0x1f, 11, 0x1b); + st文字領域Array[14] = st文字領域15; + st文字領域94 = new ST文字領域(); + ST文字領域 st文字領域16 = st文字領域94; + st文字領域16.ch = '/'; + st文字領域16.rc = new Rectangle(0x44, 0x1f, 0x15, 0x1b); + st文字領域Array[15] = st文字領域16; + st文字領域94 = new ST文字領域(); + ST文字領域 st文字領域17 = st文字領域94; + st文字領域17.ch = '0'; + st文字領域17.rc = new Rectangle(0x5b, 0x1f, 20, 0x1b); + st文字領域Array[0x10] = st文字領域17; + st文字領域94 = new ST文字領域(); + ST文字領域 st文字領域18 = st文字領域94; + st文字領域18.ch = '1'; + st文字領域18.rc = new Rectangle(0x75, 0x1f, 14, 0x1b); + st文字領域Array[0x11] = st文字領域18; + st文字領域94 = new ST文字領域(); + ST文字領域 st文字領域19 = st文字領域94; + st文字領域19.ch = '2'; + st文字領域19.rc = new Rectangle(0x86, 0x1f, 0x15, 0x1b); + st文字領域Array[0x12] = st文字領域19; + st文字領域94 = new ST文字領域(); + ST文字領域 st文字領域20 = st文字領域94; + st文字領域20.ch = '3'; + st文字領域20.rc = new Rectangle(0x9d, 0x1f, 20, 0x1b); + st文字領域Array[0x13] = st文字領域20; + st文字領域94 = new ST文字領域(); + ST文字領域 st文字領域21 = st文字領域94; + st文字領域21.ch = '4'; + st文字領域21.rc = new Rectangle(0xb3, 0x1f, 20, 0x1b); + st文字領域Array[20] = st文字領域21; + st文字領域94 = new ST文字領域(); + ST文字領域 st文字領域22 = st文字領域94; + st文字領域22.ch = '5'; + st文字領域22.rc = new Rectangle(0xca, 0x1f, 0x13, 0x1b); + st文字領域Array[0x15] = st文字領域22; + st文字領域94 = new ST文字領域(); + ST文字領域 st文字領域23 = st文字領域94; + st文字領域23.ch = '6'; + st文字領域23.rc = new Rectangle(0xe0, 0x1f, 20, 0x1b); + st文字領域Array[0x16] = st文字領域23; + st文字領域94 = new ST文字領域(); + ST文字領域 st文字領域24 = st文字領域94; + st文字領域24.ch = '7'; + st文字領域24.rc = new Rectangle(4, 0x3b, 0x13, 0x1b); + st文字領域Array[0x17] = st文字領域24; + st文字領域94 = new ST文字領域(); + ST文字領域 st文字領域25 = st文字領域94; + st文字領域25.ch = '8'; + st文字領域25.rc = new Rectangle(0x18, 0x3b, 20, 0x1b); + st文字領域Array[0x18] = st文字領域25; + st文字領域94 = new ST文字領域(); + ST文字領域 st文字領域26 = st文字領域94; + st文字領域26.ch = '9'; + st文字領域26.rc = new Rectangle(0x2f, 0x3b, 0x13, 0x1b); + st文字領域Array[0x19] = st文字領域26; + st文字領域94 = new ST文字領域(); + ST文字領域 st文字領域27 = st文字領域94; + st文字領域27.ch = ':'; + st文字領域27.rc = new Rectangle(0x44, 0x3b, 12, 0x1b); + st文字領域Array[0x1a] = st文字領域27; + st文字領域94 = new ST文字領域(); + ST文字領域 st文字領域28 = st文字領域94; + st文字領域28.ch = ';'; + st文字領域28.rc = new Rectangle(0x51, 0x3b, 13, 0x1b); + st文字領域Array[0x1b] = st文字領域28; + st文字領域94 = new ST文字領域(); + ST文字領域 st文字領域29 = st文字領域94; + st文字領域29.ch = '<'; + st文字領域29.rc = new Rectangle(0x60, 0x3b, 20, 0x1b); + st文字領域Array[0x1c] = st文字領域29; + st文字領域94 = new ST文字領域(); + ST文字領域 st文字領域30 = st文字領域94; + st文字領域30.ch = '='; + st文字領域30.rc = new Rectangle(0x74, 0x3b, 0x11, 0x1b); + st文字領域Array[0x1d] = st文字領域30; + st文字領域94 = new ST文字領域(); + ST文字領域 st文字領域31 = st文字領域94; + st文字領域31.ch = '>'; + st文字領域31.rc = new Rectangle(0x85, 0x3b, 20, 0x1b); + st文字領域Array[30] = st文字領域31; + st文字領域94 = new ST文字領域(); + ST文字領域 st文字領域32 = st文字領域94; + st文字領域32.ch = '?'; + st文字領域32.rc = new Rectangle(0x9c, 0x3b, 20, 0x1b); + st文字領域Array[0x1f] = st文字領域32; + st文字領域94 = new ST文字領域(); + ST文字領域 st文字領域33 = st文字領域94; + st文字領域33.ch = 'A'; + st文字領域33.rc = new Rectangle(0xb1, 0x3b, 0x17, 0x1b); + st文字領域Array[0x20] = st文字領域33; + st文字領域94 = new ST文字領域(); + ST文字領域 st文字領域34 = st文字領域94; + st文字領域34.ch = 'B'; + st文字領域34.rc = new Rectangle(0xcb, 0x3b, 0x15, 0x1b); + st文字領域Array[0x21] = st文字領域34; + st文字領域94 = new ST文字領域(); + ST文字領域 st文字領域35 = st文字領域94; + st文字領域35.ch = 'C'; + st文字領域35.rc = new Rectangle(0xe3, 0x3b, 0x16, 0x1b); + st文字領域Array[0x22] = st文字領域35; + st文字領域94 = new ST文字領域(); + ST文字領域 st文字領域36 = st文字領域94; + st文字領域36.ch = 'D'; + st文字領域36.rc = new Rectangle(2, 0x57, 0x16, 0x1b); + st文字領域Array[0x23] = st文字領域36; + st文字領域94 = new ST文字領域(); + ST文字領域 st文字領域37 = st文字領域94; + st文字領域37.ch = 'E'; + st文字領域37.rc = new Rectangle(0x1a, 0x57, 0x16, 0x1b); + st文字領域Array[0x24] = st文字領域37; + st文字領域94 = new ST文字領域(); + ST文字領域 st文字領域38 = st文字領域94; + st文字領域38.ch = 'F'; + st文字領域38.rc = new Rectangle(0x30, 0x57, 0x16, 0x1b); + st文字領域Array[0x25] = st文字領域38; + st文字領域94 = new ST文字領域(); + ST文字領域 st文字領域39 = st文字領域94; + st文字領域39.ch = 'G'; + st文字領域39.rc = new Rectangle(0x48, 0x57, 0x16, 0x1b); + st文字領域Array[0x26] = st文字領域39; + st文字領域94 = new ST文字領域(); + ST文字領域 st文字領域40 = st文字領域94; + st文字領域40.ch = 'H'; + st文字領域40.rc = new Rectangle(0x61, 0x57, 0x18, 0x1b); + st文字領域Array[0x27] = st文字領域40; + st文字領域94 = new ST文字領域(); + ST文字領域 st文字領域41 = st文字領域94; + st文字領域41.ch = 'I'; + st文字領域41.rc = new Rectangle(0x7a, 0x57, 13, 0x1b); + st文字領域Array[40] = st文字領域41; + st文字領域94 = new ST文字領域(); + ST文字領域 st文字領域42 = st文字領域94; + st文字領域42.ch = 'J'; + st文字領域42.rc = new Rectangle(0x88, 0x57, 20, 0x1b); + st文字領域Array[0x29] = st文字領域42; + st文字領域94 = new ST文字領域(); + ST文字領域 st文字領域43 = st文字領域94; + st文字領域43.ch = 'K'; + st文字領域43.rc = new Rectangle(0x9d, 0x57, 0x18, 0x1b); + st文字領域Array[0x2a] = st文字領域43; + st文字領域94 = new ST文字領域(); + ST文字領域 st文字領域44 = st文字領域94; + st文字領域44.ch = 'L'; + st文字領域44.rc = new Rectangle(0xb7, 0x57, 20, 0x1b); + st文字領域Array[0x2b] = st文字領域44; + st文字領域94 = new ST文字領域(); + ST文字領域 st文字領域45 = st文字領域94; + st文字領域45.ch = 'M'; + st文字領域45.rc = new Rectangle(0xce, 0x57, 0x1a, 0x1b); + st文字領域Array[0x2c] = st文字領域45; + st文字領域94 = new ST文字領域(); + ST文字領域 st文字領域46 = st文字領域94; + st文字領域46.ch = 'N'; + st文字領域46.rc = new Rectangle(0xe9, 0x57, 0x17, 0x1b); + st文字領域Array[0x2d] = st文字領域46; + st文字領域94 = new ST文字領域(); + ST文字領域 st文字領域47 = st文字領域94; + st文字領域47.ch = 'O'; + st文字領域47.rc = new Rectangle(2, 0x73, 0x18, 0x1b); + st文字領域Array[0x2e] = st文字領域47; + st文字領域94 = new ST文字領域(); + ST文字領域 st文字領域48 = st文字領域94; + st文字領域48.ch = 'P'; + st文字領域48.rc = new Rectangle(0x1c, 0x73, 0x15, 0x1b); + st文字領域Array[0x2f] = st文字領域48; + st文字領域94 = new ST文字領域(); + ST文字領域 st文字領域49 = st文字領域94; + st文字領域49.ch = 'Q'; + st文字領域49.rc = new Rectangle(0x33, 0x73, 0x17, 0x1b); + st文字領域Array[0x30] = st文字領域49; + st文字領域94 = new ST文字領域(); + ST文字領域 st文字領域50 = st文字領域94; + st文字領域50.ch = 'R'; + st文字領域50.rc = new Rectangle(0x4c, 0x73, 0x16, 0x1b); + st文字領域Array[0x31] = st文字領域50; + st文字領域94 = new ST文字領域(); + ST文字領域 st文字領域51 = st文字領域94; + st文字領域51.ch = 'S'; + st文字領域51.rc = new Rectangle(100, 0x73, 0x15, 0x1b); + st文字領域Array[50] = st文字領域51; + st文字領域94 = new ST文字領域(); + ST文字領域 st文字領域52 = st文字領域94; + st文字領域52.ch = 'T'; + st文字領域52.rc = new Rectangle(0x7c, 0x73, 0x16, 0x1b); + st文字領域Array[0x33] = st文字領域52; + st文字領域94 = new ST文字領域(); + ST文字領域 st文字領域53 = st文字領域94; + st文字領域53.ch = 'U'; + st文字領域53.rc = new Rectangle(0x93, 0x73, 0x16, 0x1b); + st文字領域Array[0x34] = st文字領域53; + st文字領域94 = new ST文字領域(); + ST文字領域 st文字領域54 = st文字領域94; + st文字領域54.ch = 'V'; + st文字領域54.rc = new Rectangle(0xad, 0x73, 0x16, 0x1b); + st文字領域Array[0x35] = st文字領域54; + st文字領域94 = new ST文字領域(); + ST文字領域 st文字領域55 = st文字領域94; + st文字領域55.ch = 'W'; + st文字領域55.rc = new Rectangle(0xc5, 0x73, 0x1a, 0x1b); + st文字領域Array[0x36] = st文字領域55; + st文字領域94 = new ST文字領域(); + ST文字領域 st文字領域56 = st文字領域94; + st文字領域56.ch = 'X'; + st文字領域56.rc = new Rectangle(0xe0, 0x73, 0x1a, 0x1b); + st文字領域Array[0x37] = st文字領域56; + st文字領域94 = new ST文字領域(); + ST文字領域 st文字領域57 = st文字領域94; + st文字領域57.ch = 'Y'; + st文字領域57.rc = new Rectangle(4, 0x8f, 0x17, 0x1b); + st文字領域Array[0x38] = st文字領域57; + st文字領域94 = new ST文字領域(); + ST文字領域 st文字領域58 = st文字領域94; + st文字領域58.ch = 'Z'; + st文字領域58.rc = new Rectangle(0x1b, 0x8f, 0x16, 0x1b); + st文字領域Array[0x39] = st文字領域58; + st文字領域94 = new ST文字領域(); + ST文字領域 st文字領域59 = st文字領域94; + st文字領域59.ch = '['; + st文字領域59.rc = new Rectangle(0x31, 0x8f, 0x11, 0x1b); + st文字領域Array[0x3a] = st文字領域59; + st文字領域94 = new ST文字領域(); + ST文字領域 st文字領域60 = st文字領域94; + st文字領域60.ch = '\\'; + st文字領域60.rc = new Rectangle(0x42, 0x8f, 0x19, 0x1b); + st文字領域Array[0x3b] = st文字領域60; + st文字領域94 = new ST文字領域(); + ST文字領域 st文字領域61 = st文字領域94; + st文字領域61.ch = ']'; + st文字領域61.rc = new Rectangle(0x5c, 0x8f, 0x11, 0x1b); + st文字領域Array[60] = st文字領域61; + st文字領域94 = new ST文字領域(); + ST文字領域 st文字領域62 = st文字領域94; + st文字領域62.ch = '^'; + st文字領域62.rc = new Rectangle(0x71, 0x8f, 0x10, 0x1b); + st文字領域Array[0x3d] = st文字領域62; + st文字領域94 = new ST文字領域(); + ST文字領域 st文字領域63 = st文字領域94; + st文字領域63.ch = '_'; + st文字領域63.rc = new Rectangle(0x81, 0x8f, 0x13, 0x1b); + st文字領域Array[0x3e] = st文字領域63; + st文字領域94 = new ST文字領域(); + ST文字領域 st文字領域64 = st文字領域94; + st文字領域64.ch = 'a'; + st文字領域64.rc = new Rectangle(150, 0x8f, 0x13, 0x1b); + st文字領域Array[0x3f] = st文字領域64; + st文字領域94 = new ST文字領域(); + ST文字領域 st文字領域65 = st文字領域94; + st文字領域65.ch = 'b'; + st文字領域65.rc = new Rectangle(0xac, 0x8f, 20, 0x1b); + st文字領域Array[0x40] = st文字領域65; + st文字領域94 = new ST文字領域(); + ST文字領域 st文字領域66 = st文字領域94; + st文字領域66.ch = 'c'; + st文字領域66.rc = new Rectangle(0xc3, 0x8f, 0x12, 0x1b); + st文字領域Array[0x41] = st文字領域66; + st文字領域94 = new ST文字領域(); + ST文字領域 st文字領域67 = st文字領域94; + st文字領域67.ch = 'd'; + st文字領域67.rc = new Rectangle(0xd8, 0x8f, 0x15, 0x1b); + st文字領域Array[0x42] = st文字領域67; + st文字領域94 = new ST文字領域(); + ST文字領域 st文字領域68 = st文字領域94; + st文字領域68.ch = 'e'; + st文字領域68.rc = new Rectangle(2, 0xab, 0x13, 0x1b); + st文字領域Array[0x43] = st文字領域68; + st文字領域94 = new ST文字領域(); + ST文字領域 st文字領域69 = st文字領域94; + st文字領域69.ch = 'f'; + st文字領域69.rc = new Rectangle(0x17, 0xab, 0x11, 0x1b); + st文字領域Array[0x44] = st文字領域69; + st文字領域94 = new ST文字領域(); + ST文字領域 st文字領域70 = st文字領域94; + st文字領域70.ch = 'g'; + st文字領域70.rc = new Rectangle(40, 0xab, 0x15, 0x1b); + st文字領域Array[0x45] = st文字領域70; + st文字領域94 = new ST文字領域(); + ST文字領域 st文字領域71 = st文字領域94; + st文字領域71.ch = 'h'; + st文字領域71.rc = new Rectangle(0x3f, 0xab, 20, 0x1b); + st文字領域Array[70] = st文字領域71; + st文字領域94 = new ST文字領域(); + ST文字領域 st文字領域72 = st文字領域94; + st文字領域72.ch = 'i'; + st文字領域72.rc = new Rectangle(0x55, 0xab, 13, 0x1b); + st文字領域Array[0x47] = st文字領域72; + st文字領域94 = new ST文字領域(); + ST文字領域 st文字領域73 = st文字領域94; + st文字領域73.ch = 'j'; + st文字領域73.rc = new Rectangle(0x62, 0xab, 0x10, 0x1b); + st文字領域Array[0x48] = st文字領域73; + st文字領域94 = new ST文字領域(); + ST文字領域 st文字領域74 = st文字領域94; + st文字領域74.ch = 'k'; + st文字領域74.rc = new Rectangle(0x74, 0xab, 20, 0x1b); + st文字領域Array[0x49] = st文字領域74; + st文字領域94 = new ST文字領域(); + ST文字領域 st文字領域75 = st文字領域94; + st文字領域75.ch = 'l'; + st文字領域75.rc = new Rectangle(0x8a, 0xab, 13, 0x1b); + st文字領域Array[0x4a] = st文字領域75; + st文字領域94 = new ST文字領域(); + ST文字領域 st文字領域76 = st文字領域94; + st文字領域76.ch = 'm'; + st文字領域76.rc = new Rectangle(0x98, 0xab, 0x1a, 0x1b); + st文字領域Array[0x4b] = st文字領域76; + st文字領域94 = new ST文字領域(); + ST文字領域 st文字領域77 = st文字領域94; + st文字領域77.ch = 'n'; + st文字領域77.rc = new Rectangle(0xb5, 0xab, 20, 0x1b); + st文字領域Array[0x4c] = st文字領域77; + st文字領域94 = new ST文字領域(); + ST文字領域 st文字領域78 = st文字領域94; + st文字領域78.ch = 'o'; + st文字領域78.rc = new Rectangle(0xcc, 0xab, 0x13, 0x1b); + st文字領域Array[0x4d] = st文字領域78; + st文字領域94 = new ST文字領域(); + ST文字領域 st文字領域79 = st文字領域94; + st文字領域79.ch = 'p'; + st文字領域79.rc = new Rectangle(0xe1, 0xab, 0x15, 0x1b); + st文字領域Array[0x4e] = st文字領域79; + st文字領域94 = new ST文字領域(); + ST文字領域 st文字領域80 = st文字領域94; + st文字領域80.ch = 'q'; + st文字領域80.rc = new Rectangle(2, 0xc7, 20, 0x1b); + st文字領域Array[0x4f] = st文字領域80; + st文字領域94 = new ST文字領域(); + ST文字領域 st文字領域81 = st文字領域94; + st文字領域81.ch = 'r'; + st文字領域81.rc = new Rectangle(0x18, 0xc7, 0x12, 0x1b); + st文字領域Array[80] = st文字領域81; + st文字領域94 = new ST文字領域(); + ST文字領域 st文字領域82 = st文字領域94; + st文字領域82.ch = 's'; + st文字領域82.rc = new Rectangle(0x2a, 0xc7, 0x13, 0x1b); + st文字領域Array[0x51] = st文字領域82; + st文字領域94 = new ST文字領域(); + ST文字領域 st文字領域83 = st文字領域94; + st文字領域83.ch = 't'; + st文字領域83.rc = new Rectangle(0x3f, 0xc7, 0x10, 0x1b); + st文字領域Array[0x52] = st文字領域83; + st文字領域94 = new ST文字領域(); + ST文字領域 st文字領域84 = st文字領域94; + st文字領域84.ch = 'u'; + st文字領域84.rc = new Rectangle(80, 0xc7, 20, 0x1b); + st文字領域Array[0x53] = st文字領域84; + st文字領域94 = new ST文字領域(); + ST文字領域 st文字領域85 = st文字領域94; + st文字領域85.ch = 'v'; + st文字領域85.rc = new Rectangle(0x68, 0xc7, 20, 0x1b); + st文字領域Array[0x54] = st文字領域85; + st文字領域94 = new ST文字領域(); + ST文字領域 st文字領域86 = st文字領域94; + st文字領域86.ch = 'w'; + st文字領域86.rc = new Rectangle(0x7f, 0xc7, 0x1a, 0x1b); + st文字領域Array[0x55] = st文字領域86; + st文字領域94 = new ST文字領域(); + ST文字領域 st文字領域87 = st文字領域94; + st文字領域87.ch = 'x'; + st文字領域87.rc = new Rectangle(0x9a, 0xc7, 0x16, 0x1b); + st文字領域Array[0x56] = st文字領域87; + st文字領域94 = new ST文字領域(); + ST文字領域 st文字領域88 = st文字領域94; + st文字領域88.ch = 'y'; + st文字領域88.rc = new Rectangle(0xb1, 0xc7, 0x16, 0x1b); + st文字領域Array[0x57] = st文字領域88; + st文字領域94 = new ST文字領域(); + ST文字領域 st文字領域89 = st文字領域94; + st文字領域89.ch = 'z'; + st文字領域89.rc = new Rectangle(200, 0xc7, 0x13, 0x1b); + st文字領域Array[0x58] = st文字領域89; + st文字領域94 = new ST文字領域(); + ST文字領域 st文字領域90 = st文字領域94; + st文字領域90.ch = '{'; + st文字領域90.rc = new Rectangle(220, 0xc7, 15, 0x1b); + st文字領域Array[0x59] = st文字領域90; + st文字領域94 = new ST文字領域(); + ST文字領域 st文字領域91 = st文字領域94; + st文字領域91.ch = '|'; + st文字領域91.rc = new Rectangle(0xeb, 0xc7, 13, 0x1b); + st文字領域Array[90] = st文字領域91; + st文字領域94 = new ST文字領域(); + ST文字領域 st文字領域92 = st文字領域94; + st文字領域92.ch = '}'; + st文字領域92.rc = new Rectangle(1, 0xe3, 15, 0x1b); + st文字領域Array[0x5b] = st文字領域92; + ST文字領域 st文字領域93 = new ST文字領域(); + st文字領域93.ch = '~'; + st文字領域93.rc = new Rectangle(0x12, 0xe3, 0x12, 0x1b); + st文字領域Array[0x5c] = st文字領域93; + + st文字領域Array[0x5d] = new ST文字領域(); // #24954 2011.4.23 yyagi + st文字領域Array[0x5d].ch = '@'; + st文字領域Array[0x5d].rc = new Rectangle(38, 227, 28, 28); + st文字領域Array[0x5e] = new ST文字領域(); + st文字領域Array[0x5e].ch = '`'; + st文字領域Array[0x5e].rc = new Rectangle(69, 226, 14, 29); + + float scaleX = OpenTaiko.Tx.Config_Font.szTextureSize.Width / 256.0f; + float scaleY = OpenTaiko.Tx.Config_Font.szTextureSize.Height / 256.0f; + + for (int i = 0; i < st文字領域Array.Length; i++) { + st文字領域Array[i].rc = new Rectangle((int)(st文字領域Array[i].rc.X * scaleX), (int)(st文字領域Array[i].rc.Y * scaleY), + (int)(st文字領域Array[i].rc.Width * scaleX), (int)(st文字領域Array[i].rc.Height * scaleY)); + } + + this.st文字領域 = st文字領域Array; + base.CreateManagedResource(); + } + public override void ReleaseManagedResource() { + //if( !base.b活性化してない ) + //{ + // if( this.tx強調文字 != null ) + // { + // this.tx強調文字.Dispose(); + // this.tx強調文字 = null; + // } + // if( this.tx通常文字 != null ) + // { + // this.tx通常文字.Dispose(); + // this.tx通常文字 = null; + // } + base.ReleaseManagedResource(); + //} + } + + + // その他 + + #region [ private ] + //----------------- + [StructLayout(LayoutKind.Sequential)] + private struct ST文字領域 { + public char ch; + public Rectangle rc; + } + + private ST文字領域[] st文字領域; + //private CTexture tx強調文字; + //private CTexture tx通常文字; + //----------------- + #endregion } diff --git a/OpenTaiko/src/Stages/CActFIFOBlack.cs b/OpenTaiko/src/Stages/CActFIFOBlack.cs index 48ff23cf..2afaa735 100644 --- a/OpenTaiko/src/Stages/CActFIFOBlack.cs +++ b/OpenTaiko/src/Stages/CActFIFOBlack.cs @@ -1,62 +1,62 @@ using FDK; -namespace OpenTaiko { - internal class CActFIFOBlack : CActivity { - // メソッド +namespace OpenTaiko; - public void tフェードアウト開始(int start = 0, int end = 100, int interval = 5) { - this.mode = EFIFOMode.FadeOut; - this.counter = new CCounter(start, end, interval, OpenTaiko.Timer); - } - public void tフェードイン開始(int start = 0, int end = 100, int interval = 5) { - this.mode = EFIFOMode.FadeIn; - this.counter = new CCounter(start, end, interval, OpenTaiko.Timer); - } +internal class CActFIFOBlack : CActivity { + // メソッド + + public void tフェードアウト開始(int start = 0, int end = 100, int interval = 5) { + this.mode = EFIFOMode.FadeOut; + this.counter = new CCounter(start, end, interval, OpenTaiko.Timer); + } + public void tフェードイン開始(int start = 0, int end = 100, int interval = 5) { + this.mode = EFIFOMode.FadeIn; + this.counter = new CCounter(start, end, interval, OpenTaiko.Timer); + } - // CActivity 実装 + // CActivity 実装 - public override void DeActivate() { - if (!base.IsDeActivated) { - //CDTXMania.tテクスチャの解放( ref this.tx黒タイル64x64 ); - base.DeActivate(); - } + public override void DeActivate() { + if (!base.IsDeActivated) { + //CDTXMania.tテクスチャの解放( ref this.tx黒タイル64x64 ); + base.DeActivate(); } - public override void CreateManagedResource() { - //this.tx黒タイル64x64 = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\Tile black 64x64.png" ), false ); - base.CreateManagedResource(); + } + public override void CreateManagedResource() { + //this.tx黒タイル64x64 = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\Tile black 64x64.png" ), false ); + base.CreateManagedResource(); + } + public override int Draw() { + if (base.IsDeActivated || (this.counter == null)) { + return 0; } - public override int Draw() { - if (base.IsDeActivated || (this.counter == null)) { - return 0; - } - this.counter.Tick(); - // Size clientSize = CDTXMania.app.Window.ClientSize; // #23510 2010.10.31 yyagi: delete as of no one use this any longer. - if (OpenTaiko.Tx.Tile_Black != null) { - OpenTaiko.Tx.Tile_Black.Opacity = (this.mode == EFIFOMode.FadeIn) ? (((100 - this.counter.CurrentValue) * 0xff) / 100) : ((this.counter.CurrentValue * 0xff) / 100); - for (int i = 0; i <= (SampleFramework.GameWindowSize.Width / OpenTaiko.Tx.Tile_Black.szTextureSize.Width); i++) // #23510 2010.10.31 yyagi: change "clientSize.Width" to "640" to fix FIFO drawing size + this.counter.Tick(); + // Size clientSize = CDTXMania.app.Window.ClientSize; // #23510 2010.10.31 yyagi: delete as of no one use this any longer. + if (OpenTaiko.Tx.Tile_Black != null) { + OpenTaiko.Tx.Tile_Black.Opacity = (this.mode == EFIFOMode.FadeIn) ? (((100 - this.counter.CurrentValue) * 0xff) / 100) : ((this.counter.CurrentValue * 0xff) / 100); + for (int i = 0; i <= (SampleFramework.GameWindowSize.Width / OpenTaiko.Tx.Tile_Black.szTextureSize.Width); i++) // #23510 2010.10.31 yyagi: change "clientSize.Width" to "640" to fix FIFO drawing size + { + for (int j = 0; j <= (SampleFramework.GameWindowSize.Height / OpenTaiko.Tx.Tile_Black.szTextureSize.Height); j++) // #23510 2010.10.31 yyagi: change "clientSize.Height" to "480" to fix FIFO drawing size { - for (int j = 0; j <= (SampleFramework.GameWindowSize.Height / OpenTaiko.Tx.Tile_Black.szTextureSize.Height); j++) // #23510 2010.10.31 yyagi: change "clientSize.Height" to "480" to fix FIFO drawing size - { - OpenTaiko.Tx.Tile_Black.t2D描画(i * OpenTaiko.Tx.Tile_Black.szTextureSize.Width, j * OpenTaiko.Tx.Tile_Black.szTextureSize.Height); - } + OpenTaiko.Tx.Tile_Black.t2D描画(i * OpenTaiko.Tx.Tile_Black.szTextureSize.Width, j * OpenTaiko.Tx.Tile_Black.szTextureSize.Height); } } - if (this.counter.CurrentValue != this.counter.EndValue) { - return 0; - } - return 1; } - - - // その他 - - #region [ private ] - //----------------- - private CCounter counter; - private EFIFOMode mode; - //private CTexture tx黒タイル64x64; - //----------------- - #endregion + if (this.counter.CurrentValue != this.counter.EndValue) { + return 0; + } + return 1; } + + + // その他 + + #region [ private ] + //----------------- + private CCounter counter; + private EFIFOMode mode; + //private CTexture tx黒タイル64x64; + //----------------- + #endregion } diff --git a/OpenTaiko/src/Stages/CActFIFOResult.cs b/OpenTaiko/src/Stages/CActFIFOResult.cs index be8a9eac..34adf8e7 100644 --- a/OpenTaiko/src/Stages/CActFIFOResult.cs +++ b/OpenTaiko/src/Stages/CActFIFOResult.cs @@ -1,80 +1,80 @@ using FDK; -namespace OpenTaiko { - internal class CActFIFOResult : CActivity { - // メソッド +namespace OpenTaiko; - public void tフェードアウト開始() { - this.mode = EFIFOMode.FadeOut; - this.counter = new CCounter(0, 100, 30, OpenTaiko.Timer); - } - public void tフェードイン開始() { - this.mode = EFIFOMode.FadeIn; - this.counter = new CCounter(0, 300, 2, OpenTaiko.Timer); - } - public void tフェードイン完了() { - this.counter.CurrentValue = (int)counter.BeginValue; - } +internal class CActFIFOResult : CActivity { + // メソッド + + public void tフェードアウト開始() { + this.mode = EFIFOMode.FadeOut; + this.counter = new CCounter(0, 100, 30, OpenTaiko.Timer); + } + public void tフェードイン開始() { + this.mode = EFIFOMode.FadeIn; + this.counter = new CCounter(0, 300, 2, OpenTaiko.Timer); + } + public void tフェードイン完了() { + this.counter.CurrentValue = (int)counter.BeginValue; + } - // CActivity 実装 + // CActivity 実装 - public override void DeActivate() { - if (!base.IsDeActivated) { - //CDTXMania.tテクスチャの解放( ref this.tx黒タイル64x64 ); - base.DeActivate(); - } + public override void DeActivate() { + if (!base.IsDeActivated) { + //CDTXMania.tテクスチャの解放( ref this.tx黒タイル64x64 ); + base.DeActivate(); } - public override void CreateManagedResource() { - //this.tx黒タイル64x64 = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\Tile black 64x64.png" ), false ); - base.CreateManagedResource(); + } + public override void CreateManagedResource() { + //this.tx黒タイル64x64 = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\Tile black 64x64.png" ), false ); + base.CreateManagedResource(); + } + public override int Draw() { + if (base.IsDeActivated || (this.counter == null)) { + return 0; } - public override int Draw() { - if (base.IsDeActivated || (this.counter == null)) { - return 0; - } - this.counter.Tick(); - // Size clientSize = CDTXMania.app.Window.ClientSize; // #23510 2010.10.31 yyagi: delete as of no one use this any longer. - if (OpenTaiko.Tx.Tile_Black != null) { - if (this.mode == EFIFOMode.FadeIn) { - if (counter.CurrentValue >= 200) { - OpenTaiko.Tx.Tile_Black.Opacity = (((100 - (this.counter.CurrentValue - 200)) * 0xff) / 100); - } else { - OpenTaiko.Tx.Tile_Black.Opacity = 255; - } + this.counter.Tick(); + // Size clientSize = CDTXMania.app.Window.ClientSize; // #23510 2010.10.31 yyagi: delete as of no one use this any longer. + if (OpenTaiko.Tx.Tile_Black != null) { + if (this.mode == EFIFOMode.FadeIn) { + if (counter.CurrentValue >= 200) { + OpenTaiko.Tx.Tile_Black.Opacity = (((100 - (this.counter.CurrentValue - 200)) * 0xff) / 100); } else { - OpenTaiko.Tx.Tile_Black.Opacity = (((this.counter.CurrentValue) * 0xff) / 100); - } - - for (int i = 0; i <= (SampleFramework.GameWindowSize.Width / OpenTaiko.Tx.Tile_Black.szTextureSize.Width); i++) // #23510 2010.10.31 yyagi: change "clientSize.Width" to "640" to fix FIFO drawing size - { - for (int j = 0; j <= (SampleFramework.GameWindowSize.Height / OpenTaiko.Tx.Tile_Black.szTextureSize.Height); j++) // #23510 2010.10.31 yyagi: change "clientSize.Height" to "480" to fix FIFO drawing size - { - OpenTaiko.Tx.Tile_Black.t2D描画(i * OpenTaiko.Tx.Tile_Black.szTextureSize.Width, j * OpenTaiko.Tx.Tile_Black.szTextureSize.Height); - } - } - } - if (this.mode == EFIFOMode.FadeOut) { - if (this.counter.CurrentValue != 100) { - return 0; + OpenTaiko.Tx.Tile_Black.Opacity = 255; } } else { - if (this.counter.CurrentValue != 300) { - return 0; + OpenTaiko.Tx.Tile_Black.Opacity = (((this.counter.CurrentValue) * 0xff) / 100); + } + + for (int i = 0; i <= (SampleFramework.GameWindowSize.Width / OpenTaiko.Tx.Tile_Black.szTextureSize.Width); i++) // #23510 2010.10.31 yyagi: change "clientSize.Width" to "640" to fix FIFO drawing size + { + for (int j = 0; j <= (SampleFramework.GameWindowSize.Height / OpenTaiko.Tx.Tile_Black.szTextureSize.Height); j++) // #23510 2010.10.31 yyagi: change "clientSize.Height" to "480" to fix FIFO drawing size + { + OpenTaiko.Tx.Tile_Black.t2D描画(i * OpenTaiko.Tx.Tile_Black.szTextureSize.Width, j * OpenTaiko.Tx.Tile_Black.szTextureSize.Height); } } - return 1; } - - - // その他 - - #region [ private ] - //----------------- - private CCounter counter; - private EFIFOMode mode; - //private CTexture tx黒タイル64x64; - //----------------- - #endregion + if (this.mode == EFIFOMode.FadeOut) { + if (this.counter.CurrentValue != 100) { + return 0; + } + } else { + if (this.counter.CurrentValue != 300) { + return 0; + } + } + return 1; } + + + // その他 + + #region [ private ] + //----------------- + private CCounter counter; + private EFIFOMode mode; + //private CTexture tx黒タイル64x64; + //----------------- + #endregion } diff --git a/OpenTaiko/src/Stages/CActFIFOStart.cs b/OpenTaiko/src/Stages/CActFIFOStart.cs index c94b4eaa..9191096c 100644 --- a/OpenTaiko/src/Stages/CActFIFOStart.cs +++ b/OpenTaiko/src/Stages/CActFIFOStart.cs @@ -1,236 +1,236 @@ using System.Drawing; using FDK; -namespace OpenTaiko { - internal class CActFIFOStart : CActivity { - // メソッド +namespace OpenTaiko; - public void tフェードアウト開始() { - this.mode = EFIFOMode.FadeOut; +internal class CActFIFOStart : CActivity { + // メソッド - OpenTaiko.Skin.soundDanSelectBGM.tStop(); - if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) - this.counter = new CCounter(0, 1255, 1, OpenTaiko.Timer); - else if (OpenTaiko.ConfigIni.bAIBattleMode) { - this.counter = new CCounter(0, 5500, 1, OpenTaiko.Timer); + public void tフェードアウト開始() { + this.mode = EFIFOMode.FadeOut; + + OpenTaiko.Skin.soundDanSelectBGM.tStop(); + if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) + this.counter = new CCounter(0, 1255, 1, OpenTaiko.Timer); + else if (OpenTaiko.ConfigIni.bAIBattleMode) { + this.counter = new CCounter(0, 5500, 1, OpenTaiko.Timer); + } else { + this.counter = new CCounter(0, 3580, 1, OpenTaiko.Timer); + } + } + public void tフェードイン開始() { + this.mode = EFIFOMode.FadeIn; + + if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) { + this.counter = new CCounter(0, 255, 1, OpenTaiko.Timer); + + OpenTaiko.stage演奏ドラム画面.actDan.Start(OpenTaiko.stage演奏ドラム画面.ListDan_Number); + OpenTaiko.stage演奏ドラム画面.ListDan_Number++; + } else if (OpenTaiko.ConfigIni.bAIBattleMode) { + this.counter = new CCounter(0, 3580, 1, OpenTaiko.Timer); + } else { + this.counter = new CCounter(0, 3580, 1, OpenTaiko.Timer); + } + } + public void tフェードイン完了() // #25406 2011.6.9 yyagi + { + this.counter.CurrentValue = (int)this.counter.EndValue; + } + + // CActivity 実装 + + public override void DeActivate() { + //CDTXMania.tテクスチャの解放( ref this.tx幕 ); + base.DeActivate(); + } + public override void CreateManagedResource() { + //this.tx幕 = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\6_FO.png" ) ); + // this.tx幕2 = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\6_FI.png" ) ); + base.CreateManagedResource(); + } + public override int Draw() { + if (base.IsDeActivated || (this.counter == null)) { + return 0; + } + this.counter.Tick(); + + if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] >= (int)Difficulty.Tower) { + if (OpenTaiko.Tx.Tile_Black != null) { + OpenTaiko.Tx.Tile_Black.Opacity = this.mode == EFIFOMode.FadeOut ? -1000 + counter.CurrentValue : 255 - counter.CurrentValue; + for (int i = 0; i <= (SampleFramework.GameWindowSize.Width / OpenTaiko.Tx.Tile_Black.szTextureSize.Width); i++) // #23510 2010.10.31 yyagi: change "clientSize.Width" to "640" to fix FIFO drawing size + { + for (int j = 0; j <= (SampleFramework.GameWindowSize.Height / OpenTaiko.Tx.Tile_Black.szTextureSize.Height); j++) // #23510 2010.10.31 yyagi: change "clientSize.Height" to "480" to fix FIFO drawing size + { + OpenTaiko.Tx.Tile_Black.t2D描画(i * OpenTaiko.Tx.Tile_Black.szTextureSize.Width, j * OpenTaiko.Tx.Tile_Black.szTextureSize.Height); + } + } + } + } else if (OpenTaiko.ConfigIni.bAIBattleMode) { + if (this.mode == EFIFOMode.FadeOut) { + var preTime = (this.counter.CurrentValue >= 2000 ? this.counter.CurrentValue - 2000 : 0) * 2; + + OpenTaiko.Tx.SongLoading_Fade_AI.Opacity = preTime; + OpenTaiko.Tx.SongLoading_Fade_AI.t2D描画(0, 0); + + if (preTime > 500) { + OpenTaiko.Tx.SongLoading_Fade_AI_Anime_Base.vcScaleRatio.X = Math.Min(((preTime - 500) / 255.0f), 1.0f); + OpenTaiko.Tx.SongLoading_Fade_AI_Anime_Base.t2D拡大率考慮中央基準描画(OpenTaiko.Skin.Resolution[0] / 2, OpenTaiko.Skin.Resolution[1] / 2); + } + + if (preTime > 1000) { + OpenTaiko.Tx.SongLoading_Fade_AI_Anime_Ring.Opacity = preTime - 1000; + OpenTaiko.Tx.SongLoading_Fade_AI_Anime_Ring.fZ軸中心回転 = preTime / 6000.0f; + OpenTaiko.Tx.SongLoading_Fade_AI_Anime_Ring.t2D描画(OpenTaiko.Skin.SongLoading_Fade_AI_Anime_Ring[0], OpenTaiko.Skin.SongLoading_Fade_AI_Anime_Ring[1]); + if (preTime - 1000 < 1500) { + OpenTaiko.Tx.SongLoading_Fade_AI_Anime_NowLoading.Opacity = preTime - 1000; + OpenTaiko.Tx.SongLoading_Fade_AI_Anime_NowLoading.t2D描画(0, 0); + + OpenTaiko.Tx.SongLoading_Fade_AI_Anime_LoadBar_Base.t2D描画(OpenTaiko.Skin.SongLoading_Fade_AI_Anime_LoadBar[0], OpenTaiko.Skin.SongLoading_Fade_AI_Anime_LoadBar[1]); + + float value = (preTime - 1000) / 1500.0f; + value = 1.0f - (float)Math.Cos(value * Math.PI / 2.0); + value = 1.0f - (float)Math.Cos(value * Math.PI / 2.0); + value = 1.0f - (float)Math.Cos(value * Math.PI / 2.0); + + OpenTaiko.Tx.SongLoading_Fade_AI_Anime_LoadBar.t2D描画(OpenTaiko.Skin.SongLoading_Fade_AI_Anime_LoadBar[0], OpenTaiko.Skin.SongLoading_Fade_AI_Anime_LoadBar[1], + new RectangleF(0, 0, OpenTaiko.Tx.SongLoading_Fade_AI_Anime_LoadBar.szTextureSize.Width * value, + OpenTaiko.Tx.SongLoading_Fade_AI_Anime_LoadBar.szTextureSize.Height)); + } else { + OpenTaiko.Tx.SongLoading_Fade_AI_Anime_Start.t2D描画(0, 0); + } + } + + var time = this.counter.CurrentValue >= 5000 ? this.counter.CurrentValue - 5000 : 0; + + OpenTaiko.Tx.SongLoading_Bg_AI.Opacity = time; + OpenTaiko.Tx.SongLoading_Bg_AI.t2D描画(0, 0); + + OpenTaiko.Tx.SongLoading_Bg_AI_Wait.Opacity = time - 255; + OpenTaiko.Tx.SongLoading_Bg_AI_Wait.t2D描画(0, 0); + + OpenTaiko.Tx.SongLoading_Plate_AI.Opacity = time - 255; + if (OpenTaiko.Skin.SongLoading_Plate_ReferencePoint == CSkin.ReferencePoint.Left) { + OpenTaiko.Tx.SongLoading_Plate_AI.t2D描画(OpenTaiko.Skin.SongLoading_Plate_X_AI, OpenTaiko.Skin.SongLoading_Plate_Y_AI - (OpenTaiko.Tx.SongLoading_Plate_AI.sz画像サイズ.Height / 2)); + } else if (OpenTaiko.Skin.SongLoading_Plate_ReferencePoint == CSkin.ReferencePoint.Right) { + OpenTaiko.Tx.SongLoading_Plate_AI.t2D描画(OpenTaiko.Skin.SongLoading_Plate_X_AI - OpenTaiko.Tx.SongLoading_Plate_AI.sz画像サイズ.Width, OpenTaiko.Skin.SongLoading_Plate_Y_AI - (OpenTaiko.Tx.SongLoading_Plate_AI.sz画像サイズ.Height / 2)); + } else { + OpenTaiko.Tx.SongLoading_Plate_AI.t2D描画(OpenTaiko.Skin.SongLoading_Plate_X_AI - (OpenTaiko.Tx.SongLoading_Plate_AI.sz画像サイズ.Width / 2), OpenTaiko.Skin.SongLoading_Plate_Y_AI - (OpenTaiko.Tx.SongLoading_Plate_AI.sz画像サイズ.Height / 2)); + } } else { - this.counter = new CCounter(0, 3580, 1, OpenTaiko.Timer); + OpenTaiko.Tx.SongLoading_Bg_AI.Opacity = 255 - counter.CurrentValue; + OpenTaiko.Tx.SongLoading_Bg_AI.t2D描画(0, 0); + } + } else { + if (this.mode == EFIFOMode.FadeOut) { + if (OpenTaiko.Tx.SongLoading_Fade != null) { + // 曲開始幕アニメ。 + // 地味に横の拡大率が変動しているのが一番厄介... + var time = this.counter.CurrentValue >= 2580 ? this.counter.CurrentValue - 2580 : 0; + var FadeValue = (time - 670f) / 330.0f; + if (FadeValue >= 1.0) FadeValue = 1.0f; else if (FadeValue <= 0.0) FadeValue = 0.0f; + + DrawBack(time < 500.0 ? OpenTaiko.Tx.SongLoading_Fade : OpenTaiko.Tx.SongLoading_Bg, time, 0, 500.0, false); + DrawStar(FadeValue * 255f); + DrawPlate(FadeValue * 255f, FadeValue); + DrawChara(time, (time - 730f) * (255f / 270f)); + } + + } else { + if (OpenTaiko.Tx.SongLoading_Fade != null) { + // 曲開始幕アニメ。 + // 地味に横の拡大率が変動しているのが一番厄介... + var time = this.counter.CurrentValue; + var FadeValue = time / 140f; + if (FadeValue >= 1.0) FadeValue = 1.0f; else if (FadeValue <= 0.0) FadeValue = 0.0f; + + DrawBack(time < 300.0 ? OpenTaiko.Tx.SongLoading_Bg : OpenTaiko.Tx.SongLoading_Fade, time, 300.0, 500.0, true); + DrawStar(255f - (FadeValue * 255f)); + DrawPlate(255f - (FadeValue * 255f), 1f + (FadeValue * 0.5f), 1f - FadeValue); + DrawChara(time, (time <= 80.0 ? 255 : 255f - (float)((Math.Pow((time - 80f), 1.5f) / Math.Pow(220f, 1.5f)) * 255f)), 250f, (time <= 80.0 ? ((time / 80f) * 30f) : 30f - (float)((Math.Pow((time - 80f), 1.5f) / Math.Pow(220f, 1.5f)) * 320f))); + } } } - public void tフェードイン開始() { - this.mode = EFIFOMode.FadeIn; - if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) { - this.counter = new CCounter(0, 255, 1, OpenTaiko.Timer); - - OpenTaiko.stage演奏ドラム画面.actDan.Start(OpenTaiko.stage演奏ドラム画面.ListDan_Number); - OpenTaiko.stage演奏ドラム画面.ListDan_Number++; - } else if (OpenTaiko.ConfigIni.bAIBattleMode) { - this.counter = new CCounter(0, 3580, 1, OpenTaiko.Timer); - } else { - this.counter = new CCounter(0, 3580, 1, OpenTaiko.Timer); - } - } - public void tフェードイン完了() // #25406 2011.6.9 yyagi - { - this.counter.CurrentValue = (int)this.counter.EndValue; - } - - // CActivity 実装 - - public override void DeActivate() { - //CDTXMania.tテクスチャの解放( ref this.tx幕 ); - base.DeActivate(); - } - public override void CreateManagedResource() { - //this.tx幕 = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\6_FO.png" ) ); - // this.tx幕2 = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\6_FI.png" ) ); - base.CreateManagedResource(); - } - public override int Draw() { - if (base.IsDeActivated || (this.counter == null)) { + if (this.mode == EFIFOMode.FadeOut) { + if (this.counter.CurrentValue != this.counter.EndValue) { return 0; } - this.counter.Tick(); - - if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] >= (int)Difficulty.Tower) { - if (OpenTaiko.Tx.Tile_Black != null) { - OpenTaiko.Tx.Tile_Black.Opacity = this.mode == EFIFOMode.FadeOut ? -1000 + counter.CurrentValue : 255 - counter.CurrentValue; - for (int i = 0; i <= (SampleFramework.GameWindowSize.Width / OpenTaiko.Tx.Tile_Black.szTextureSize.Width); i++) // #23510 2010.10.31 yyagi: change "clientSize.Width" to "640" to fix FIFO drawing size - { - for (int j = 0; j <= (SampleFramework.GameWindowSize.Height / OpenTaiko.Tx.Tile_Black.szTextureSize.Height); j++) // #23510 2010.10.31 yyagi: change "clientSize.Height" to "480" to fix FIFO drawing size - { - OpenTaiko.Tx.Tile_Black.t2D描画(i * OpenTaiko.Tx.Tile_Black.szTextureSize.Width, j * OpenTaiko.Tx.Tile_Black.szTextureSize.Height); - } - } - } - } else if (OpenTaiko.ConfigIni.bAIBattleMode) { - if (this.mode == EFIFOMode.FadeOut) { - var preTime = (this.counter.CurrentValue >= 2000 ? this.counter.CurrentValue - 2000 : 0) * 2; - - OpenTaiko.Tx.SongLoading_Fade_AI.Opacity = preTime; - OpenTaiko.Tx.SongLoading_Fade_AI.t2D描画(0, 0); - - if (preTime > 500) { - OpenTaiko.Tx.SongLoading_Fade_AI_Anime_Base.vcScaleRatio.X = Math.Min(((preTime - 500) / 255.0f), 1.0f); - OpenTaiko.Tx.SongLoading_Fade_AI_Anime_Base.t2D拡大率考慮中央基準描画(OpenTaiko.Skin.Resolution[0] / 2, OpenTaiko.Skin.Resolution[1] / 2); - } - - if (preTime > 1000) { - OpenTaiko.Tx.SongLoading_Fade_AI_Anime_Ring.Opacity = preTime - 1000; - OpenTaiko.Tx.SongLoading_Fade_AI_Anime_Ring.fZ軸中心回転 = preTime / 6000.0f; - OpenTaiko.Tx.SongLoading_Fade_AI_Anime_Ring.t2D描画(OpenTaiko.Skin.SongLoading_Fade_AI_Anime_Ring[0], OpenTaiko.Skin.SongLoading_Fade_AI_Anime_Ring[1]); - if (preTime - 1000 < 1500) { - OpenTaiko.Tx.SongLoading_Fade_AI_Anime_NowLoading.Opacity = preTime - 1000; - OpenTaiko.Tx.SongLoading_Fade_AI_Anime_NowLoading.t2D描画(0, 0); - - OpenTaiko.Tx.SongLoading_Fade_AI_Anime_LoadBar_Base.t2D描画(OpenTaiko.Skin.SongLoading_Fade_AI_Anime_LoadBar[0], OpenTaiko.Skin.SongLoading_Fade_AI_Anime_LoadBar[1]); - - float value = (preTime - 1000) / 1500.0f; - value = 1.0f - (float)Math.Cos(value * Math.PI / 2.0); - value = 1.0f - (float)Math.Cos(value * Math.PI / 2.0); - value = 1.0f - (float)Math.Cos(value * Math.PI / 2.0); - - OpenTaiko.Tx.SongLoading_Fade_AI_Anime_LoadBar.t2D描画(OpenTaiko.Skin.SongLoading_Fade_AI_Anime_LoadBar[0], OpenTaiko.Skin.SongLoading_Fade_AI_Anime_LoadBar[1], - new RectangleF(0, 0, OpenTaiko.Tx.SongLoading_Fade_AI_Anime_LoadBar.szTextureSize.Width * value, - OpenTaiko.Tx.SongLoading_Fade_AI_Anime_LoadBar.szTextureSize.Height)); - } else { - OpenTaiko.Tx.SongLoading_Fade_AI_Anime_Start.t2D描画(0, 0); - } - } - - var time = this.counter.CurrentValue >= 5000 ? this.counter.CurrentValue - 5000 : 0; - - OpenTaiko.Tx.SongLoading_Bg_AI.Opacity = time; - OpenTaiko.Tx.SongLoading_Bg_AI.t2D描画(0, 0); - - OpenTaiko.Tx.SongLoading_Bg_AI_Wait.Opacity = time - 255; - OpenTaiko.Tx.SongLoading_Bg_AI_Wait.t2D描画(0, 0); - - OpenTaiko.Tx.SongLoading_Plate_AI.Opacity = time - 255; - if (OpenTaiko.Skin.SongLoading_Plate_ReferencePoint == CSkin.ReferencePoint.Left) { - OpenTaiko.Tx.SongLoading_Plate_AI.t2D描画(OpenTaiko.Skin.SongLoading_Plate_X_AI, OpenTaiko.Skin.SongLoading_Plate_Y_AI - (OpenTaiko.Tx.SongLoading_Plate_AI.sz画像サイズ.Height / 2)); - } else if (OpenTaiko.Skin.SongLoading_Plate_ReferencePoint == CSkin.ReferencePoint.Right) { - OpenTaiko.Tx.SongLoading_Plate_AI.t2D描画(OpenTaiko.Skin.SongLoading_Plate_X_AI - OpenTaiko.Tx.SongLoading_Plate_AI.sz画像サイズ.Width, OpenTaiko.Skin.SongLoading_Plate_Y_AI - (OpenTaiko.Tx.SongLoading_Plate_AI.sz画像サイズ.Height / 2)); - } else { - OpenTaiko.Tx.SongLoading_Plate_AI.t2D描画(OpenTaiko.Skin.SongLoading_Plate_X_AI - (OpenTaiko.Tx.SongLoading_Plate_AI.sz画像サイズ.Width / 2), OpenTaiko.Skin.SongLoading_Plate_Y_AI - (OpenTaiko.Tx.SongLoading_Plate_AI.sz画像サイズ.Height / 2)); - } - } else { - OpenTaiko.Tx.SongLoading_Bg_AI.Opacity = 255 - counter.CurrentValue; - OpenTaiko.Tx.SongLoading_Bg_AI.t2D描画(0, 0); - } - } else { - if (this.mode == EFIFOMode.FadeOut) { - if (OpenTaiko.Tx.SongLoading_Fade != null) { - // 曲開始幕アニメ。 - // 地味に横の拡大率が変動しているのが一番厄介... - var time = this.counter.CurrentValue >= 2580 ? this.counter.CurrentValue - 2580 : 0; - var FadeValue = (time - 670f) / 330.0f; - if (FadeValue >= 1.0) FadeValue = 1.0f; else if (FadeValue <= 0.0) FadeValue = 0.0f; - - DrawBack(time < 500.0 ? OpenTaiko.Tx.SongLoading_Fade : OpenTaiko.Tx.SongLoading_Bg, time, 0, 500.0, false); - DrawStar(FadeValue * 255f); - DrawPlate(FadeValue * 255f, FadeValue); - DrawChara(time, (time - 730f) * (255f / 270f)); - } - - } else { - if (OpenTaiko.Tx.SongLoading_Fade != null) { - // 曲開始幕アニメ。 - // 地味に横の拡大率が変動しているのが一番厄介... - var time = this.counter.CurrentValue; - var FadeValue = time / 140f; - if (FadeValue >= 1.0) FadeValue = 1.0f; else if (FadeValue <= 0.0) FadeValue = 0.0f; - - DrawBack(time < 300.0 ? OpenTaiko.Tx.SongLoading_Bg : OpenTaiko.Tx.SongLoading_Fade, time, 300.0, 500.0, true); - DrawStar(255f - (FadeValue * 255f)); - DrawPlate(255f - (FadeValue * 255f), 1f + (FadeValue * 0.5f), 1f - FadeValue); - DrawChara(time, (time <= 80.0 ? 255 : 255f - (float)((Math.Pow((time - 80f), 1.5f) / Math.Pow(220f, 1.5f)) * 255f)), 250f, (time <= 80.0 ? ((time / 80f) * 30f) : 30f - (float)((Math.Pow((time - 80f), 1.5f) / Math.Pow(220f, 1.5f)) * 320f))); - } - } + } else if (this.mode == EFIFOMode.FadeIn) { + if (this.counter.CurrentValue != this.counter.EndValue) { + return 0; } - - if (this.mode == EFIFOMode.FadeOut) { - if (this.counter.CurrentValue != this.counter.EndValue) { - return 0; - } - } else if (this.mode == EFIFOMode.FadeIn) { - if (this.counter.CurrentValue != this.counter.EndValue) { - return 0; - } - } - return 1; } - - private void DrawBack(CTexture ShowTex, double time, double max, double end, bool IsExit) { - if (ShowTex == null) return; - if (time - max >= end) time = end + max; - - var SizeXHarf = ShowTex.szTextureSize.Width / 2f; - var SizeY = ShowTex.szTextureSize.Height; - var StartScaleX = 0.5f; - var ScaleX = (float)((IsExit ? 1f - StartScaleX : 0f) - ((time >= max ? (time - max) : 0) * ((1f - StartScaleX) / end))) * (IsExit ? 1f : -1f); - var Value = (float)((IsExit ? 1f : 0f) - ((time >= max ? (time - max) : 0) * (1f / end))) * (IsExit ? 1f : -1f); - - ShowTex.vcScaleRatio.X = StartScaleX + ScaleX; - ShowTex.t2D描画(-(SizeXHarf * StartScaleX) + (Value * (SizeXHarf * StartScaleX)), 0, new RectangleF(0, 0, SizeXHarf, SizeY)); - ShowTex.t2D描画((SizeXHarf + (SizeXHarf * StartScaleX)) - (Value * (SizeXHarf * StartScaleX)) + ((1f - ShowTex.vcScaleRatio.X) * SizeXHarf), 0, new RectangleF(SizeXHarf, 0, SizeXHarf, SizeY)); - - } - /// - /// キラキラ✨ - /// - /// - private void DrawStar(float opacity) { - if (OpenTaiko.Tx.SongLoading_BgWait is null) return; - - OpenTaiko.Tx.SongLoading_BgWait.Opacity = (int)opacity; - OpenTaiko.Tx.SongLoading_BgWait.t2D描画(0, 0); - } - - /// - /// 横に伸びるプレートを描画 - /// - /// - /// - private void DrawPlate(float opacity, float scaleX, float scaleY = 1f) { - if (OpenTaiko.Tx.SongLoading_Plate is null) return; - var SizeX_Harf = OpenTaiko.Tx.SongLoading_Plate.szTextureSize.Width / 2.0f; - var SizeY_Harf = OpenTaiko.Tx.SongLoading_Plate.szTextureSize.Height / 2.0f; - - OpenTaiko.Tx.SongLoading_Plate.Opacity = (int)opacity; - OpenTaiko.Tx.SongLoading_Plate.vcScaleRatio.X = scaleX; - OpenTaiko.Tx.SongLoading_Plate.vcScaleRatio.Y = scaleY; - OpenTaiko.Tx.SongLoading_Plate.t2D描画(OpenTaiko.Skin.SongLoading_Plate_X + SizeX_Harf - (SizeX_Harf * scaleX) - SizeX_Harf, OpenTaiko.Skin.SongLoading_Plate_Y - SizeY_Harf + ((1f - scaleY) * SizeY_Harf)); - } - - private void DrawChara(double time, float opacity, float X = -1, float Y = -1) { - if (OpenTaiko.Tx.SongLoading_Plate is null || (X == -1 && Y == -1 ? time <= 680 : false)) return; - var SizeXHarf = OpenTaiko.Tx.SongLoading_Chara.szTextureSize.Width / 2f; - var SizeY = OpenTaiko.Tx.SongLoading_Chara.szTextureSize.Height; - - if (X == -1 && Y == -1) { - Y = (float)(Math.Sin((time - 680f) * (Math.PI / 320.0)) * OpenTaiko.Skin.SongLoading_Chara_Move[1]); - X = (float)((time - 680f) / 320.0) * OpenTaiko.Skin.SongLoading_Chara_Move[0]; - } - - OpenTaiko.Tx.SongLoading_Chara.Opacity = (int)opacity; - //左キャラ - OpenTaiko.Tx.SongLoading_Chara.t2D描画(-OpenTaiko.Skin.SongLoading_Chara_Move[0] + X, Y, new RectangleF(0, 0, SizeXHarf, SizeY)); - //左キャラ - OpenTaiko.Tx.SongLoading_Chara.t2D描画(SizeXHarf + OpenTaiko.Skin.SongLoading_Chara_Move[0] - X, Y, new RectangleF(SizeXHarf, 0, SizeXHarf, SizeY)); - } - - // その他 - - #region [ private ] - //----------------- - private CCounter counter; - private CCounter ct待機; - private EFIFOMode mode; - //private CTexture tx幕; - //private CTexture tx幕2; - //----------------- - #endregion + return 1; } + + private void DrawBack(CTexture ShowTex, double time, double max, double end, bool IsExit) { + if (ShowTex == null) return; + if (time - max >= end) time = end + max; + + var SizeXHarf = ShowTex.szTextureSize.Width / 2f; + var SizeY = ShowTex.szTextureSize.Height; + var StartScaleX = 0.5f; + var ScaleX = (float)((IsExit ? 1f - StartScaleX : 0f) - ((time >= max ? (time - max) : 0) * ((1f - StartScaleX) / end))) * (IsExit ? 1f : -1f); + var Value = (float)((IsExit ? 1f : 0f) - ((time >= max ? (time - max) : 0) * (1f / end))) * (IsExit ? 1f : -1f); + + ShowTex.vcScaleRatio.X = StartScaleX + ScaleX; + ShowTex.t2D描画(-(SizeXHarf * StartScaleX) + (Value * (SizeXHarf * StartScaleX)), 0, new RectangleF(0, 0, SizeXHarf, SizeY)); + ShowTex.t2D描画((SizeXHarf + (SizeXHarf * StartScaleX)) - (Value * (SizeXHarf * StartScaleX)) + ((1f - ShowTex.vcScaleRatio.X) * SizeXHarf), 0, new RectangleF(SizeXHarf, 0, SizeXHarf, SizeY)); + + } + /// + /// キラキラ✨ + /// + /// + private void DrawStar(float opacity) { + if (OpenTaiko.Tx.SongLoading_BgWait is null) return; + + OpenTaiko.Tx.SongLoading_BgWait.Opacity = (int)opacity; + OpenTaiko.Tx.SongLoading_BgWait.t2D描画(0, 0); + } + + /// + /// 横に伸びるプレートを描画 + /// + /// + /// + private void DrawPlate(float opacity, float scaleX, float scaleY = 1f) { + if (OpenTaiko.Tx.SongLoading_Plate is null) return; + var SizeX_Harf = OpenTaiko.Tx.SongLoading_Plate.szTextureSize.Width / 2.0f; + var SizeY_Harf = OpenTaiko.Tx.SongLoading_Plate.szTextureSize.Height / 2.0f; + + OpenTaiko.Tx.SongLoading_Plate.Opacity = (int)opacity; + OpenTaiko.Tx.SongLoading_Plate.vcScaleRatio.X = scaleX; + OpenTaiko.Tx.SongLoading_Plate.vcScaleRatio.Y = scaleY; + OpenTaiko.Tx.SongLoading_Plate.t2D描画(OpenTaiko.Skin.SongLoading_Plate_X + SizeX_Harf - (SizeX_Harf * scaleX) - SizeX_Harf, OpenTaiko.Skin.SongLoading_Plate_Y - SizeY_Harf + ((1f - scaleY) * SizeY_Harf)); + } + + private void DrawChara(double time, float opacity, float X = -1, float Y = -1) { + if (OpenTaiko.Tx.SongLoading_Plate is null || (X == -1 && Y == -1 ? time <= 680 : false)) return; + var SizeXHarf = OpenTaiko.Tx.SongLoading_Chara.szTextureSize.Width / 2f; + var SizeY = OpenTaiko.Tx.SongLoading_Chara.szTextureSize.Height; + + if (X == -1 && Y == -1) { + Y = (float)(Math.Sin((time - 680f) * (Math.PI / 320.0)) * OpenTaiko.Skin.SongLoading_Chara_Move[1]); + X = (float)((time - 680f) / 320.0) * OpenTaiko.Skin.SongLoading_Chara_Move[0]; + } + + OpenTaiko.Tx.SongLoading_Chara.Opacity = (int)opacity; + //左キャラ + OpenTaiko.Tx.SongLoading_Chara.t2D描画(-OpenTaiko.Skin.SongLoading_Chara_Move[0] + X, Y, new RectangleF(0, 0, SizeXHarf, SizeY)); + //左キャラ + OpenTaiko.Tx.SongLoading_Chara.t2D描画(SizeXHarf + OpenTaiko.Skin.SongLoading_Chara_Move[0] - X, Y, new RectangleF(SizeXHarf, 0, SizeXHarf, SizeY)); + } + + // その他 + + #region [ private ] + //----------------- + private CCounter counter; + private CCounter ct待機; + private EFIFOMode mode; + //private CTexture tx幕; + //private CTexture tx幕2; + //----------------- + #endregion } diff --git a/OpenTaiko/src/Stages/CActFIFOWhite.cs b/OpenTaiko/src/Stages/CActFIFOWhite.cs index 2ea64c81..5c5c0760 100644 --- a/OpenTaiko/src/Stages/CActFIFOWhite.cs +++ b/OpenTaiko/src/Stages/CActFIFOWhite.cs @@ -1,70 +1,70 @@ using FDK; -namespace OpenTaiko { - internal class CActFIFOWhite : CActivity { - // メソッド +namespace OpenTaiko; - public void tフェードアウト開始() { - this.mode = EFIFOMode.FadeOut; - this.counter = new CCounter(0, 100, 3, OpenTaiko.Timer); - } - public void tフェードイン開始() { - this.mode = EFIFOMode.FadeIn; - this.counter = new CCounter(0, 100, 3, OpenTaiko.Timer); - } - public void tフェードイン完了() // #25406 2011.6.9 yyagi - { - this.counter.CurrentValue = (int)this.counter.EndValue; - } +internal class CActFIFOWhite : CActivity { + // メソッド - // CActivity 実装 + public void tフェードアウト開始() { + this.mode = EFIFOMode.FadeOut; + this.counter = new CCounter(0, 100, 3, OpenTaiko.Timer); + } + public void tフェードイン開始() { + this.mode = EFIFOMode.FadeIn; + this.counter = new CCounter(0, 100, 3, OpenTaiko.Timer); + } + public void tフェードイン完了() // #25406 2011.6.9 yyagi + { + this.counter.CurrentValue = (int)this.counter.EndValue; + } - public override void DeActivate() { - if (!base.IsDeActivated) { - //CDTXMania.tテクスチャの解放( ref this.tx白タイル64x64 ); - base.DeActivate(); - } - } - public override void CreateManagedResource() { - //this.tx白タイル64x64 = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\Tile white 64x64.png" ), false ); - base.CreateManagedResource(); - } + // CActivity 実装 - public override void ReleaseUnmanagedResource() { - base.ReleaseUnmanagedResource(); + public override void DeActivate() { + if (!base.IsDeActivated) { + //CDTXMania.tテクスチャの解放( ref this.tx白タイル64x64 ); + base.DeActivate(); } - public override int Draw() { - if (base.IsDeActivated || (this.counter == null)) { - return 0; - } - this.counter.Tick(); + } + public override void CreateManagedResource() { + //this.tx白タイル64x64 = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\Tile white 64x64.png" ), false ); + base.CreateManagedResource(); + } - // Size clientSize = CDTXMania.app.Window.ClientSize; // #23510 2010.10.31 yyagi: delete as of no one use this any longer. - if (OpenTaiko.Tx.Tile_Black != null) { - OpenTaiko.Tx.Tile_Black.Opacity = (this.mode == EFIFOMode.FadeIn) ? (((100 - this.counter.CurrentValue) * 0xff) / 100) : ((this.counter.CurrentValue * 0xff) / 100); - for (int i = 0; i <= (SampleFramework.GameWindowSize.Width / OpenTaiko.Tx.Tile_Black.szTextureSize.Width); i++) // #23510 2010.10.31 yyagi: change "clientSize.Width" to "640" to fix FIFO drawing size + public override void ReleaseUnmanagedResource() { + base.ReleaseUnmanagedResource(); + } + public override int Draw() { + if (base.IsDeActivated || (this.counter == null)) { + return 0; + } + this.counter.Tick(); + + // Size clientSize = CDTXMania.app.Window.ClientSize; // #23510 2010.10.31 yyagi: delete as of no one use this any longer. + if (OpenTaiko.Tx.Tile_Black != null) { + OpenTaiko.Tx.Tile_Black.Opacity = (this.mode == EFIFOMode.FadeIn) ? (((100 - this.counter.CurrentValue) * 0xff) / 100) : ((this.counter.CurrentValue * 0xff) / 100); + for (int i = 0; i <= (SampleFramework.GameWindowSize.Width / OpenTaiko.Tx.Tile_Black.szTextureSize.Width); i++) // #23510 2010.10.31 yyagi: change "clientSize.Width" to "640" to fix FIFO drawing size + { + for (int j = 0; j <= (SampleFramework.GameWindowSize.Height / OpenTaiko.Tx.Tile_Black.szTextureSize.Height); j++) // #23510 2010.10.31 yyagi: change "clientSize.Height" to "480" to fix FIFO drawing size { - for (int j = 0; j <= (SampleFramework.GameWindowSize.Height / OpenTaiko.Tx.Tile_Black.szTextureSize.Height); j++) // #23510 2010.10.31 yyagi: change "clientSize.Height" to "480" to fix FIFO drawing size - { - OpenTaiko.Tx.Tile_Black.t2D描画(i * OpenTaiko.Tx.Tile_Black.szTextureSize.Width, j * OpenTaiko.Tx.Tile_Black.szTextureSize.Height); - } + OpenTaiko.Tx.Tile_Black.t2D描画(i * OpenTaiko.Tx.Tile_Black.szTextureSize.Width, j * OpenTaiko.Tx.Tile_Black.szTextureSize.Height); } } - if (this.counter.CurrentValue != 100) { - return 0; - } - return 1; } - - - // その他 - - #region [ private ] - //----------------- - private CCounter counter; - private EFIFOMode mode; - //private CTexture tx白タイル64x64; - //----------------- - #endregion + if (this.counter.CurrentValue != 100) { + return 0; + } + return 1; } + + + // その他 + + #region [ private ] + //----------------- + private CCounter counter; + private EFIFOMode mode; + //private CTexture tx白タイル64x64; + //----------------- + #endregion } diff --git a/OpenTaiko/src/Stages/CActLVLNFont.cs b/OpenTaiko/src/Stages/CActLVLNFont.cs index 8ccfea75..65072ff2 100644 --- a/OpenTaiko/src/Stages/CActLVLNFont.cs +++ b/OpenTaiko/src/Stages/CActLVLNFont.cs @@ -2,98 +2,98 @@ using System.Runtime.InteropServices; using FDK; -namespace OpenTaiko { - public class CActLVLNFont : CActivity { - // コンストラクタ +namespace OpenTaiko; - const int numWidth = 15; - const int numHeight = 19; +public class CActLVLNFont : CActivity { + // コンストラクタ - public CActLVLNFont() { - string numChars = "0123456789?-"; - st数字 = new ST数字[12, 4]; + const int numWidth = 15; + const int numHeight = 19; - for (int j = 0; j < 4; j++) { - for (int i = 0; i < 12; i++) { - this.st数字[i, j].ch = numChars[i]; - this.st数字[i, j].rc = new Rectangle( - (i % 4) * numWidth + (j % 2) * 64, - (i / 4) * numHeight + (j / 2) * 64, - numWidth, - numHeight - ); - } + public CActLVLNFont() { + string numChars = "0123456789?-"; + st数字 = new ST数字[12, 4]; + + for (int j = 0; j < 4; j++) { + for (int i = 0; i < 12; i++) { + this.st数字[i, j].ch = numChars[i]; + this.st数字[i, j].rc = new Rectangle( + (i % 4) * numWidth + (j % 2) * 64, + (i / 4) * numHeight + (j / 2) * 64, + numWidth, + numHeight + ); } } - - - // メソッド - public void t文字列描画(int x, int y, string str) { - this.t文字列描画(x, y, str, EFontColor.White, EFontAlign.Right); - } - public void t文字列描画(int x, int y, string str, EFontColor efc, EFontAlign efa) { - if (!base.IsDeActivated && !string.IsNullOrEmpty(str)) { - if (this.tx数値 != null) { - bool bRightAlign = (efa == EFontAlign.Right); - - if (bRightAlign) // 右詰なら文字列反転して右から描画 - { - char[] chars = str.ToCharArray(); - Array.Reverse(chars); - str = new string(chars); - } - - foreach (char ch in str) { - int p = (ch == '-' ? 11 : ch - '0'); - ST数字 s = st数字[p, (int)efc]; - int sw = s.rc.Width; - int delta = bRightAlign ? 0 : -sw; - this.tx数値.t2D描画(x + delta, y, s.rc); - x += bRightAlign ? -sw : sw; - } - } - } - } - - - // CActivity 実装 - - public override void CreateManagedResource() { - this.tx数値 = OpenTaiko.tテクスチャの生成(CSkin.Path(@"Graphics\ScreenSelect level numbers.png")); - base.CreateManagedResource(); - } - public override void ReleaseManagedResource() { - if (this.tx数値 != null) { - this.tx数値.Dispose(); - this.tx数値 = null; - } - base.ReleaseManagedResource(); - } - - - // その他 - - #region [ private ] - //----------------- - [StructLayout(LayoutKind.Sequential)] - private struct ST数字 { - public char ch; - public Rectangle rc; - } - - public enum EFontColor { - Red = 0, - Yellow = 1, - Orange = 2, - White = 3 - } - public enum EFontAlign { - Left, - Right - } - private ST数字[,] st数字; - private CTexture tx数値; - //----------------- - #endregion } + + + // メソッド + public void t文字列描画(int x, int y, string str) { + this.t文字列描画(x, y, str, EFontColor.White, EFontAlign.Right); + } + public void t文字列描画(int x, int y, string str, EFontColor efc, EFontAlign efa) { + if (!base.IsDeActivated && !string.IsNullOrEmpty(str)) { + if (this.tx数値 != null) { + bool bRightAlign = (efa == EFontAlign.Right); + + if (bRightAlign) // 右詰なら文字列反転して右から描画 + { + char[] chars = str.ToCharArray(); + Array.Reverse(chars); + str = new string(chars); + } + + foreach (char ch in str) { + int p = (ch == '-' ? 11 : ch - '0'); + ST数字 s = st数字[p, (int)efc]; + int sw = s.rc.Width; + int delta = bRightAlign ? 0 : -sw; + this.tx数値.t2D描画(x + delta, y, s.rc); + x += bRightAlign ? -sw : sw; + } + } + } + } + + + // CActivity 実装 + + public override void CreateManagedResource() { + this.tx数値 = OpenTaiko.tテクスチャの生成(CSkin.Path(@"Graphics\ScreenSelect level numbers.png")); + base.CreateManagedResource(); + } + public override void ReleaseManagedResource() { + if (this.tx数値 != null) { + this.tx数値.Dispose(); + this.tx数値 = null; + } + base.ReleaseManagedResource(); + } + + + // その他 + + #region [ private ] + //----------------- + [StructLayout(LayoutKind.Sequential)] + private struct ST数字 { + public char ch; + public Rectangle rc; + } + + public enum EFontColor { + Red = 0, + Yellow = 1, + Orange = 2, + White = 3 + } + public enum EFontAlign { + Left, + Right + } + private ST数字[,] st数字; + private CTexture tx数値; + //----------------- + #endregion } diff --git a/OpenTaiko/src/Stages/CActNewHeya.cs b/OpenTaiko/src/Stages/CActNewHeya.cs index 24b79b2d..26fcd519 100644 --- a/OpenTaiko/src/Stages/CActNewHeya.cs +++ b/OpenTaiko/src/Stages/CActNewHeya.cs @@ -2,691 +2,688 @@ using System.Drawing; using DiscordRPC; using FDK; -namespace OpenTaiko { - class CActNewHeya : CActivity { - public bool IsOpend { get; private set; } - private CCachedFontRenderer MenuFont; +namespace OpenTaiko; - private TitleTextureKey[] MenuTitleKeys = new TitleTextureKey[5]; - private TitleTextureKey[] ttkPuchiCharaNames; - private TitleTextureKey[] ttkPuchiCharaAuthors; - private TitleTextureKey[] ttkCharacterNames; - private TitleTextureKey[] ttkCharacterAuthors; - private TitleTextureKey ttkInfoSection; - private TitleTextureKey[] ttkDanTitles; - private TitleTextureKey[] ttkTitles; - private string[] titlesKeys; +class CActNewHeya : CActivity { + public bool IsOpend { get; private set; } + private CCachedFontRenderer MenuFont; - public CCounter InFade; + private TitleTextureKey[] MenuTitleKeys = new TitleTextureKey[5]; + private TitleTextureKey[] ttkPuchiCharaNames; + private TitleTextureKey[] ttkPuchiCharaAuthors; + private TitleTextureKey[] ttkCharacterNames; + private TitleTextureKey[] ttkCharacterAuthors; + private TitleTextureKey ttkInfoSection; + private TitleTextureKey[] ttkDanTitles; + private TitleTextureKey[] ttkTitles; + private string[] titlesKeys; - public CCounter CharaBoxAnime; + public CCounter InFade; - private int CurrentIndex; + public CCounter CharaBoxAnime; - private int CurrentMaxIndex; + private int CurrentIndex; - private int CurrentPlayer; + private int CurrentMaxIndex; - private enum SelectableInfo { - PlayerSelect, - ModeSelect, - Select - } + private int CurrentPlayer; - private enum ModeType { - None = -1, - PuchiChara, - Chara, - DanTitle, - SubTitle - } + private enum SelectableInfo { + PlayerSelect, + ModeSelect, + Select + } - private SelectableInfo CurrentState; + private enum ModeType { + None = -1, + PuchiChara, + Chara, + DanTitle, + SubTitle + } - private ModeType CurrentMode = ModeType.None; + private SelectableInfo CurrentState; - private void SetState(SelectableInfo selectableInfo) { - CurrentState = selectableInfo; - switch (selectableInfo) { - case SelectableInfo.PlayerSelect: - CurrentIndex = 1; - CurrentMaxIndex = OpenTaiko.ConfigIni.nPlayerCount + 1; - break; - case SelectableInfo.ModeSelect: - CurrentIndex = 1; - CurrentMaxIndex = 5; - break; - case SelectableInfo.Select: - CurrentMode = (ModeType)(CurrentIndex - 1); - switch (CurrentMode) { - case ModeType.Chara: - CurrentMaxIndex = OpenTaiko.Skin.Characters_Ptn; - break; - case ModeType.PuchiChara: - CurrentMaxIndex = OpenTaiko.Skin.Puchichara_Ptn; - break; - case ModeType.DanTitle: { - int amount = 1; - if (OpenTaiko.SaveFileInstances[CurrentPlayer].data.DanTitles != null) - amount += OpenTaiko.SaveFileInstances[CurrentPlayer].data.DanTitles.Count; + private ModeType CurrentMode = ModeType.None; - this.ttkDanTitles = new TitleTextureKey[amount]; - - // Silver Shinjin (default rank) always avaliable by default - this.ttkDanTitles[0] = new TitleTextureKey("新人", this.MenuFont, Color.White, Color.Black, 1000); - - int idx = 1; - if (OpenTaiko.SaveFileInstances[CurrentPlayer].data.DanTitles != null) { - foreach (var item in OpenTaiko.SaveFileInstances[CurrentPlayer].data.DanTitles) { - if (item.Value.isGold == true) - this.ttkDanTitles[idx] = new TitleTextureKey(item.Key, this.MenuFont, Color.Gold, Color.Black, 1000); - else - this.ttkDanTitles[idx] = new TitleTextureKey(item.Key, this.MenuFont, Color.White, Color.Black, 1000); - idx++; - } - } - - CurrentMaxIndex = amount; - } - break; - case ModeType.SubTitle: { - int amount = 1; - if (OpenTaiko.SaveFileInstances[CurrentPlayer].data.UnlockedNameplateIds != null) - amount += OpenTaiko.SaveFileInstances[CurrentPlayer].data.UnlockedNameplateIds.Count; - - this.ttkTitles = new TitleTextureKey[amount]; - this.titlesKeys = new string[amount]; - - // Wood shojinsha (default title) always avaliable by default - this.ttkTitles[0] = new TitleTextureKey("初心者", this.MenuFont, Color.Black, Color.Transparent, 1000); - this.titlesKeys[0] = "初心者"; - - int idx = 1; - if (OpenTaiko.SaveFileInstances[CurrentPlayer].data.UnlockedNameplateIds != null) { - foreach (var item in OpenTaiko.SaveFileInstances[CurrentPlayer].data.UnlockedNameplateIds) { - var name = OpenTaiko.Databases.DBNameplateUnlockables.data[item]; - this.ttkTitles[idx] = new TitleTextureKey(name.nameplateInfo.cld.GetString(""), this.MenuFont, Color.Black, Color.Transparent, 1000); - this.titlesKeys[idx] = name.nameplateInfo.cld.GetString(""); - idx++; - } - } - - CurrentMaxIndex = amount; - } - break; - } - CurrentIndex = 0; - break; - } - } - - private void ChangeIndex(int change) { - CurrentIndex += change; - - if (CurrentIndex < 0) CurrentIndex = CurrentMaxIndex - 1; - else if (CurrentIndex >= CurrentMaxIndex) CurrentIndex = 0; - if (CurrentState == SelectableInfo.Select) { + private void SetState(SelectableInfo selectableInfo) { + CurrentState = selectableInfo; + switch (selectableInfo) { + case SelectableInfo.PlayerSelect: + CurrentIndex = 1; + CurrentMaxIndex = OpenTaiko.ConfigIni.nPlayerCount + 1; + break; + case SelectableInfo.ModeSelect: + CurrentIndex = 1; + CurrentMaxIndex = 5; + break; + case SelectableInfo.Select: + CurrentMode = (ModeType)(CurrentIndex - 1); switch (CurrentMode) { - case ModeType.PuchiChara: - tUpdateUnlockableTextPuchi(); - break; case ModeType.Chara: - tUpdateUnlockableTextChara(); + CurrentMaxIndex = OpenTaiko.Skin.Characters_Ptn; break; - case ModeType.DanTitle: + case ModeType.PuchiChara: + CurrentMaxIndex = OpenTaiko.Skin.Puchichara_Ptn; break; - case ModeType.SubTitle: - break; - } - } - } + case ModeType.DanTitle: { + int amount = 1; + if (OpenTaiko.SaveFileInstances[CurrentPlayer].data.DanTitles != null) + amount += OpenTaiko.SaveFileInstances[CurrentPlayer].data.DanTitles.Count; - public void Open() { - InFade = new CCounter(0, 255, 1.0, OpenTaiko.Timer); - IsOpend = true; - CurrentMode = ModeType.None; + this.ttkDanTitles = new TitleTextureKey[amount]; - SetState(SelectableInfo.PlayerSelect); - } + // Silver Shinjin (default rank) always avaliable by default + this.ttkDanTitles[0] = new TitleTextureKey("新人", this.MenuFont, Color.White, Color.Black, 1000); - public void Close() { - IsOpend = false; - } - - public override void Activate() { - InFade = new CCounter(); - CharaBoxAnime = new CCounter(); - - MenuTitleKeys[0] = new TitleTextureKey(CLangManager.LangInstance.GetString("MENU_RETURN"), MenuFont, Color.White, Color.Black, 9999); - MenuTitleKeys[1] = new TitleTextureKey(CLangManager.LangInstance.GetString("HEYA_PUCHI"), MenuFont, Color.White, Color.Black, 9999); - MenuTitleKeys[2] = new TitleTextureKey(CLangManager.LangInstance.GetString("HEYA_CHARA"), MenuFont, Color.White, Color.Black, 9999); - MenuTitleKeys[3] = new TitleTextureKey(CLangManager.LangInstance.GetString("HEYA_DAN"), MenuFont, Color.White, Color.Black, 9999); - MenuTitleKeys[4] = new TitleTextureKey(CLangManager.LangInstance.GetString("HEYA_NAMEPLATE"), MenuFont, Color.White, Color.Black, 9999); - - ttkPuchiCharaNames = new TitleTextureKey[OpenTaiko.Skin.Puchichara_Ptn]; - ttkPuchiCharaAuthors = new TitleTextureKey[OpenTaiko.Skin.Puchichara_Ptn]; - - for (int i = 0; i < OpenTaiko.Skin.Puchichara_Ptn; i++) { - var textColor = HRarity.tRarityToColor(OpenTaiko.Tx.Puchichara[i].metadata.Rarity); - ttkPuchiCharaNames[i] = new TitleTextureKey(OpenTaiko.Tx.Puchichara[i].metadata.tGetName(), this.MenuFont, textColor, Color.Black, 1000); - ttkPuchiCharaAuthors[i] = new TitleTextureKey(OpenTaiko.Tx.Puchichara[i].metadata.tGetAuthor(), this.MenuFont, Color.White, Color.Black, 1000); - } - - - ttkCharacterAuthors = new TitleTextureKey[OpenTaiko.Skin.Characters_Ptn]; - ttkCharacterNames = new TitleTextureKey[OpenTaiko.Skin.Characters_Ptn]; - - for (int i = 0; i < OpenTaiko.Skin.Characters_Ptn; i++) { - var textColor = HRarity.tRarityToColor(OpenTaiko.Tx.Characters[i].metadata.Rarity); - ttkCharacterNames[i] = new TitleTextureKey(OpenTaiko.Tx.Characters[i].metadata.tGetName(), this.MenuFont, textColor, Color.Black, 1000); - ttkCharacterAuthors[i] = new TitleTextureKey(OpenTaiko.Tx.Characters[i].metadata.tGetAuthor(), this.MenuFont, Color.White, Color.Black, 1000); - } - - - base.Activate(); - } - - public override void DeActivate() { - - base.DeActivate(); - } - - public override void CreateManagedResource() { - this.MenuFont = HPrivateFastFont.tInstantiateMainFont(OpenTaiko.Skin.Heya_Font_Scale); - base.CreateManagedResource(); - } - - public override void ReleaseManagedResource() { - MenuFont.Dispose(); - - base.ReleaseManagedResource(); - } - - public override int Draw() { - if ((OpenTaiko.Pad.bPressedDGB(EPad.Decide)) || ((OpenTaiko.ConfigIni.bEnterIsNotUsedInKeyAssignments && OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Return)))) { - switch (CurrentState) { - case SelectableInfo.PlayerSelect: { - switch (CurrentIndex) { - case 0: - Close(); - OpenTaiko.Skin.soundCancelSFX.tPlay(); - break; - default: { - CurrentPlayer = OpenTaiko.GetActualPlayer(CurrentIndex - 1); - SetState(SelectableInfo.ModeSelect); - OpenTaiko.Skin.soundDecideSFX.tPlay(); - } - break; + int idx = 1; + if (OpenTaiko.SaveFileInstances[CurrentPlayer].data.DanTitles != null) { + foreach (var item in OpenTaiko.SaveFileInstances[CurrentPlayer].data.DanTitles) { + if (item.Value.isGold == true) + this.ttkDanTitles[idx] = new TitleTextureKey(item.Key, this.MenuFont, Color.Gold, Color.Black, 1000); + else + this.ttkDanTitles[idx] = new TitleTextureKey(item.Key, this.MenuFont, Color.White, Color.Black, 1000); + idx++; + } } + + CurrentMaxIndex = amount; } break; - case SelectableInfo.ModeSelect: { - switch (CurrentIndex) { - case 0: - SetState(SelectableInfo.PlayerSelect); - OpenTaiko.Skin.soundCancelSFX.tPlay(); - break; - default: { - SetState(SelectableInfo.Select); - OpenTaiko.Skin.soundDecideSFX.tPlay(); - } - break; + case ModeType.SubTitle: { + int amount = 1; + if (OpenTaiko.SaveFileInstances[CurrentPlayer].data.UnlockedNameplateIds != null) + amount += OpenTaiko.SaveFileInstances[CurrentPlayer].data.UnlockedNameplateIds.Count; + + this.ttkTitles = new TitleTextureKey[amount]; + this.titlesKeys = new string[amount]; + + // Wood shojinsha (default title) always avaliable by default + this.ttkTitles[0] = new TitleTextureKey("初心者", this.MenuFont, Color.Black, Color.Transparent, 1000); + this.titlesKeys[0] = "初心者"; + + int idx = 1; + if (OpenTaiko.SaveFileInstances[CurrentPlayer].data.UnlockedNameplateIds != null) { + foreach (var item in OpenTaiko.SaveFileInstances[CurrentPlayer].data.UnlockedNameplateIds) { + var name = OpenTaiko.Databases.DBNameplateUnlockables.data[item]; + this.ttkTitles[idx] = new TitleTextureKey(name.nameplateInfo.cld.GetString(""), this.MenuFont, Color.Black, Color.Transparent, 1000); + this.titlesKeys[idx] = name.nameplateInfo.cld.GetString(""); + idx++; + } } - } - break; - case SelectableInfo.Select: { - switch (CurrentMode) { - case ModeType.PuchiChara: { - var ess = this.tSelectPuchi(); - if (ess == ESelectStatus.SELECTED) { - //PuchiChara.tGetPuchiCharaIndexByName(p); - //TJAPlayer3.NamePlateConfig.data.PuchiChara[iPlayer] = TJAPlayer3.Skin.Puchicharas_Name[iPuchiCharaCurrent];// iPuchiCharaCurrent; - //TJAPlayer3.NamePlateConfig.tApplyHeyaChanges(); - OpenTaiko.SaveFileInstances[CurrentPlayer].data.PuchiChara = OpenTaiko.Skin.Puchicharas_Name[CurrentIndex];// iPuchiCharaCurrent; - OpenTaiko.SaveFileInstances[CurrentPlayer].tApplyHeyaChanges(); - OpenTaiko.Skin.soundDecideSFX.tPlay(); - OpenTaiko.Tx.Puchichara[CurrentIndex].welcome.tPlay(); - - SetState(SelectableInfo.PlayerSelect); - } else if (ess == ESelectStatus.SUCCESS) { - //TJAPlayer3.NamePlateConfig.data.UnlockedPuchicharas[iPlayer].Add(TJAPlayer3.Skin.Puchicharas_Name[iPuchiCharaCurrent]); - //TJAPlayer3.NamePlateConfig.tSpendCoins(TJAPlayer3.Tx.Puchichara[iPuchiCharaCurrent].unlock.Values[0], iPlayer); - OpenTaiko.SaveFileInstances[CurrentPlayer].data.UnlockedPuchicharas.Add(OpenTaiko.Skin.Puchicharas_Name[CurrentIndex]); - OpenTaiko.SaveFileInstances[CurrentPlayer].tSpendCoins(OpenTaiko.Tx.Puchichara[CurrentIndex].unlock.Values[0]); - OpenTaiko.Skin.soundDecideSFX.tPlay(); - } else { - OpenTaiko.Skin.soundError.tPlay(); - } - } - break; - case ModeType.Chara: { - var ess = this.tSelectChara(); - - if (ess == ESelectStatus.SELECTED) { - //TJAPlayer3.Tx.Loading?.t2D描画(18, 7); - - // Reload character, a bit time expensive but with a O(N) memory complexity instead of O(N * M) - OpenTaiko.Tx.ReloadCharacter(OpenTaiko.SaveFileInstances[CurrentPlayer].data.Character, CurrentIndex, CurrentPlayer); - OpenTaiko.SaveFileInstances[CurrentPlayer].data.Character = CurrentIndex; - - // Update the character - OpenTaiko.SaveFileInstances[CurrentPlayer].tUpdateCharacterName(OpenTaiko.Skin.Characters_DirName[CurrentIndex]); - - // Welcome voice using Sanka - OpenTaiko.Skin.soundDecideSFX.tPlay(); - OpenTaiko.Skin.voiceTitleSanka[CurrentPlayer]?.tPlay(); - - CMenuCharacter.tMenuResetTimer(CMenuCharacter.ECharacterAnimation.NORMAL); - - OpenTaiko.SaveFileInstances[CurrentPlayer].tApplyHeyaChanges(); - - SetState(SelectableInfo.PlayerSelect); - CurrentMode = ModeType.None; - } else if (ess == ESelectStatus.SUCCESS) { - OpenTaiko.SaveFileInstances[CurrentPlayer].data.UnlockedCharacters.Add(OpenTaiko.Skin.Characters_DirName[CurrentIndex]); - OpenTaiko.SaveFileInstances[CurrentPlayer].tSpendCoins(OpenTaiko.Tx.Characters[CurrentIndex].unlock.Values[0]); - OpenTaiko.Skin.soundDecideSFX.tPlay(); - } else { - OpenTaiko.Skin.soundError.tPlay(); - } - } - break; - case ModeType.DanTitle: { - bool iG = false; - int cs = 0; - - if (CurrentIndex > 0) { - iG = OpenTaiko.SaveFileInstances[CurrentPlayer].data.DanTitles[this.ttkDanTitles[CurrentIndex].str].isGold; - cs = OpenTaiko.SaveFileInstances[CurrentPlayer].data.DanTitles[this.ttkDanTitles[CurrentIndex].str].clearStatus; - } - - OpenTaiko.SaveFileInstances[CurrentPlayer].data.Dan = this.ttkDanTitles[CurrentIndex].str; - OpenTaiko.SaveFileInstances[CurrentPlayer].data.DanGold = iG; - OpenTaiko.SaveFileInstances[CurrentPlayer].data.DanType = cs; - - OpenTaiko.NamePlate.tNamePlateRefreshTitles(CurrentPlayer); - - OpenTaiko.SaveFileInstances[CurrentPlayer].tApplyHeyaChanges(); - - OpenTaiko.Skin.soundDecideSFX.tPlay(); - SetState(SelectableInfo.PlayerSelect); - } - break; - case ModeType.SubTitle: { - - if (CurrentIndex == 0) { - OpenTaiko.SaveFileInstances[CurrentPlayer].data.TitleType = 0; - OpenTaiko.SaveFileInstances[CurrentPlayer].data.TitleId = -1; - OpenTaiko.SaveFileInstances[CurrentPlayer].data.TitleRarityInt = 1; - OpenTaiko.SaveFileInstances[CurrentPlayer].data.Title = "初心者"; - } - else if (OpenTaiko.SaveFileInstances[CurrentPlayer].data.UnlockedNameplateIds != null && - OpenTaiko.Databases.DBNameplateUnlockables.data.ContainsKey(OpenTaiko.SaveFileInstances[CurrentPlayer].data.UnlockedNameplateIds[CurrentIndex - 1])) { - var id = OpenTaiko.SaveFileInstances[CurrentPlayer].data.UnlockedNameplateIds[CurrentIndex - 1]; - var nameplate = OpenTaiko.Databases.DBNameplateUnlockables.data[id]; - - OpenTaiko.SaveFileInstances[CurrentPlayer].data.TitleId = id; - OpenTaiko.SaveFileInstances[CurrentPlayer].data.Title = nameplate.nameplateInfo.cld.GetString(""); - OpenTaiko.SaveFileInstances[CurrentPlayer].data.TitleRarityInt = HRarity.tRarityToLangInt(nameplate.rarity); - OpenTaiko.SaveFileInstances[CurrentPlayer].data.TitleType = nameplate.nameplateInfo.iType; - } - else { - OpenTaiko.SaveFileInstances[CurrentPlayer].data.TitleType = -1; - OpenTaiko.SaveFileInstances[CurrentPlayer].data.TitleId = -1; - OpenTaiko.SaveFileInstances[CurrentPlayer].data.TitleRarityInt = 1; - OpenTaiko.SaveFileInstances[CurrentPlayer].data.Title = ""; - } - - OpenTaiko.NamePlate.tNamePlateRefreshTitles(CurrentPlayer); - - OpenTaiko.SaveFileInstances[CurrentPlayer].tApplyHeyaChanges(); - - OpenTaiko.Skin.soundDecideSFX.tPlay(); - SetState(SelectableInfo.PlayerSelect); - } - break; - } + CurrentMaxIndex = amount; } break; } - } else if ((OpenTaiko.Pad.bPressedDGB(EPad.Cancel) || OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Escape))) { - Close(); - OpenTaiko.Skin.soundCancelSFX.tPlay(); - } else if (OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.LeftChange) - || OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.LeftArrow)) { - ChangeIndex(-1); - OpenTaiko.Skin.soundChangeSFX.tPlay(); - } else if (OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.RightChange) - || OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.RightArrow)) { - ChangeIndex(1); - OpenTaiko.Skin.soundChangeSFX.tPlay(); + CurrentIndex = 0; + break; + } + } + + private void ChangeIndex(int change) { + CurrentIndex += change; + + if (CurrentIndex < 0) CurrentIndex = CurrentMaxIndex - 1; + else if (CurrentIndex >= CurrentMaxIndex) CurrentIndex = 0; + if (CurrentState == SelectableInfo.Select) { + switch (CurrentMode) { + case ModeType.PuchiChara: + tUpdateUnlockableTextPuchi(); + break; + case ModeType.Chara: + tUpdateUnlockableTextChara(); + break; + case ModeType.DanTitle: + break; + case ModeType.SubTitle: + break; } + } + } - InFade.Tick(); + public void Open() { + InFade = new CCounter(0, 255, 1.0, OpenTaiko.Timer); + IsOpend = true; + CurrentMode = ModeType.None; - if (OpenTaiko.Tx.Tile_Black != null) { - OpenTaiko.Tx.Tile_Black.Opacity = InFade.CurrentValue / 2; - for (int i = 0; i <= (SampleFramework.GameWindowSize.Width / OpenTaiko.Tx.Tile_Black.szTextureSize.Width); i++) // #23510 2010.10.31 yyagi: change "clientSize.Width" to "640" to fix FIFO drawing size - { - for (int j = 0; j <= (SampleFramework.GameWindowSize.Height / OpenTaiko.Tx.Tile_Black.szTextureSize.Height); j++) // #23510 2010.10.31 yyagi: change "clientSize.Height" to "480" to fix FIFO drawing size - { - OpenTaiko.Tx.Tile_Black.t2D描画(i * OpenTaiko.Tx.Tile_Black.szTextureSize.Width, j * OpenTaiko.Tx.Tile_Black.szTextureSize.Height); - } - } - } + SetState(SelectableInfo.PlayerSelect); + } + + public void Close() { + IsOpend = false; + } + + public override void Activate() { + InFade = new CCounter(); + CharaBoxAnime = new CCounter(); + + MenuTitleKeys[0] = new TitleTextureKey(CLangManager.LangInstance.GetString("MENU_RETURN"), MenuFont, Color.White, Color.Black, 9999); + MenuTitleKeys[1] = new TitleTextureKey(CLangManager.LangInstance.GetString("HEYA_PUCHI"), MenuFont, Color.White, Color.Black, 9999); + MenuTitleKeys[2] = new TitleTextureKey(CLangManager.LangInstance.GetString("HEYA_CHARA"), MenuFont, Color.White, Color.Black, 9999); + MenuTitleKeys[3] = new TitleTextureKey(CLangManager.LangInstance.GetString("HEYA_DAN"), MenuFont, Color.White, Color.Black, 9999); + MenuTitleKeys[4] = new TitleTextureKey(CLangManager.LangInstance.GetString("HEYA_NAMEPLATE"), MenuFont, Color.White, Color.Black, 9999); + + ttkPuchiCharaNames = new TitleTextureKey[OpenTaiko.Skin.Puchichara_Ptn]; + ttkPuchiCharaAuthors = new TitleTextureKey[OpenTaiko.Skin.Puchichara_Ptn]; + + for (int i = 0; i < OpenTaiko.Skin.Puchichara_Ptn; i++) { + var textColor = HRarity.tRarityToColor(OpenTaiko.Tx.Puchichara[i].metadata.Rarity); + ttkPuchiCharaNames[i] = new TitleTextureKey(OpenTaiko.Tx.Puchichara[i].metadata.tGetName(), this.MenuFont, textColor, Color.Black, 1000); + ttkPuchiCharaAuthors[i] = new TitleTextureKey(OpenTaiko.Tx.Puchichara[i].metadata.tGetAuthor(), this.MenuFont, Color.White, Color.Black, 1000); + } + ttkCharacterAuthors = new TitleTextureKey[OpenTaiko.Skin.Characters_Ptn]; + ttkCharacterNames = new TitleTextureKey[OpenTaiko.Skin.Characters_Ptn]; + + for (int i = 0; i < OpenTaiko.Skin.Characters_Ptn; i++) { + var textColor = HRarity.tRarityToColor(OpenTaiko.Tx.Characters[i].metadata.Rarity); + ttkCharacterNames[i] = new TitleTextureKey(OpenTaiko.Tx.Characters[i].metadata.tGetName(), this.MenuFont, textColor, Color.Black, 1000); + ttkCharacterAuthors[i] = new TitleTextureKey(OpenTaiko.Tx.Characters[i].metadata.tGetAuthor(), this.MenuFont, Color.White, Color.Black, 1000); + } + + + base.Activate(); + } + + public override void DeActivate() { + + base.DeActivate(); + } + + public override void CreateManagedResource() { + this.MenuFont = HPrivateFastFont.tInstantiateMainFont(OpenTaiko.Skin.Heya_Font_Scale); + base.CreateManagedResource(); + } + + public override void ReleaseManagedResource() { + MenuFont.Dispose(); + + base.ReleaseManagedResource(); + } + + public override int Draw() { + if ((OpenTaiko.Pad.bPressedDGB(EPad.Decide)) || ((OpenTaiko.ConfigIni.bEnterIsNotUsedInKeyAssignments && OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Return)))) { switch (CurrentState) { - case SelectableInfo.PlayerSelect: - if (CurrentIndex == 0) { - OpenTaiko.Tx.NewHeya_Close_Select.t2D描画(OpenTaiko.Skin.SongSelect_NewHeya_Close_Select[0], OpenTaiko.Skin.SongSelect_NewHeya_Close_Select[1]); - } else { - OpenTaiko.Tx.NewHeya_PlayerPlate_Select.t2D描画(OpenTaiko.Skin.SongSelect_NewHeya_PlayerPlate_X[CurrentIndex - 1], OpenTaiko.Skin.SongSelect_NewHeya_PlayerPlate_Y[CurrentIndex - 1]); + case SelectableInfo.PlayerSelect: { + switch (CurrentIndex) { + case 0: + Close(); + OpenTaiko.Skin.soundCancelSFX.tPlay(); + break; + default: { + CurrentPlayer = OpenTaiko.GetActualPlayer(CurrentIndex - 1); + SetState(SelectableInfo.ModeSelect); + OpenTaiko.Skin.soundDecideSFX.tPlay(); + } + break; + } } break; case SelectableInfo.ModeSelect: { - OpenTaiko.Tx.NewHeya_ModeBar_Select.t2D描画(OpenTaiko.Skin.SongSelect_NewHeya_ModeBar_X[CurrentIndex], OpenTaiko.Skin.SongSelect_NewHeya_ModeBar_Y[CurrentIndex]); + switch (CurrentIndex) { + case 0: + SetState(SelectableInfo.PlayerSelect); + OpenTaiko.Skin.soundCancelSFX.tPlay(); + break; + default: { + SetState(SelectableInfo.Select); + OpenTaiko.Skin.soundDecideSFX.tPlay(); + } + break; + } } break; case SelectableInfo.Select: { switch (CurrentMode) { - case ModeType.Chara: - for (int i = 1; i < OpenTaiko.Skin.SongSelect_NewHeya_Box_Count - 1; i++) { - int x = OpenTaiko.Skin.SongSelect_NewHeya_Box_X[i]; - int y = OpenTaiko.Skin.SongSelect_NewHeya_Box_Y[i]; - int index = i - (OpenTaiko.Skin.SongSelect_NewHeya_Box_Count / 2) + CurrentIndex; - while (index < 0) { - index += CurrentMaxIndex; - } - while (index >= CurrentMaxIndex) { - index -= CurrentMaxIndex; - } - OpenTaiko.Tx.NewHeya_Box.t2D描画(x, y); + case ModeType.PuchiChara: { + var ess = this.tSelectPuchi(); + if (ess == ESelectStatus.SELECTED) { + //PuchiChara.tGetPuchiCharaIndexByName(p); + //TJAPlayer3.NamePlateConfig.data.PuchiChara[iPlayer] = TJAPlayer3.Skin.Puchicharas_Name[iPuchiCharaCurrent];// iPuchiCharaCurrent; + //TJAPlayer3.NamePlateConfig.tApplyHeyaChanges(); + OpenTaiko.SaveFileInstances[CurrentPlayer].data.PuchiChara = OpenTaiko.Skin.Puchicharas_Name[CurrentIndex];// iPuchiCharaCurrent; + OpenTaiko.SaveFileInstances[CurrentPlayer].tApplyHeyaChanges(); + OpenTaiko.Skin.soundDecideSFX.tPlay(); + OpenTaiko.Tx.Puchichara[CurrentIndex].welcome.tPlay(); - float charaRatioX = 1.0f; - float charaRatioY = 1.0f; - if (OpenTaiko.Skin.Characters_Resolution[index] != null) { - charaRatioX = OpenTaiko.Skin.Resolution[0] / (float)OpenTaiko.Skin.Characters_Resolution[index][0]; - charaRatioY = OpenTaiko.Skin.Resolution[1] / (float)OpenTaiko.Skin.Characters_Resolution[index][1]; - } - - if (OpenTaiko.Tx.Characters_Heya_Preview[index] != null) { - OpenTaiko.Tx.Characters_Heya_Preview[index].vcScaleRatio.X = charaRatioX; - OpenTaiko.Tx.Characters_Heya_Preview[index].vcScaleRatio.Y = charaRatioY; - } - - OpenTaiko.Tx.Characters_Heya_Preview[index]?.t2D拡大率考慮中央基準描画(x + OpenTaiko.Skin.SongSelect_NewHeya_Box_Chara_Offset[0], y + OpenTaiko.Skin.SongSelect_NewHeya_Box_Chara_Offset[1]); - OpenTaiko.Tx.Characters_Heya_Preview[index]?.tUpdateColor4(CConversion.ColorToColor4(Color.White)); - - if (ttkCharacterNames[index] != null) { - CTexture tmpTex = TitleTextureKey.ResolveTitleTexture(ttkCharacterNames[index]); - - tmpTex.t2D拡大率考慮上中央基準描画(x + OpenTaiko.Skin.SongSelect_NewHeya_Box_Name_Offset[0], y + OpenTaiko.Skin.SongSelect_NewHeya_Box_Name_Offset[1]); - } - - if (ttkCharacterAuthors[index] != null) { - CTexture tmpTex = TitleTextureKey.ResolveTitleTexture(ttkCharacterAuthors[index]); - - tmpTex.t2D拡大率考慮上中央基準描画(x + OpenTaiko.Skin.SongSelect_NewHeya_Box_Author_Offset[0], y + OpenTaiko.Skin.SongSelect_NewHeya_Box_Author_Offset[1]); - } - - if (OpenTaiko.Tx.Characters[index].unlock != null - && !OpenTaiko.SaveFileInstances[CurrentPlayer].data.UnlockedCharacters.Contains(OpenTaiko.Skin.Characters_DirName[index])) { - OpenTaiko.Tx.NewHeya_Lock?.t2D描画(x + OpenTaiko.Skin.SongSelect_NewHeya_Lock_Offset[0], y + OpenTaiko.Skin.SongSelect_NewHeya_Lock_Offset[1]); - - if (this.ttkInfoSection != null) - TitleTextureKey.ResolveTitleTexture(this.ttkInfoSection) - .t2D拡大率考慮上中央基準描画(x + OpenTaiko.Skin.SongSelect_NewHeya_InfoSection_Offset[0], y + OpenTaiko.Skin.SongSelect_NewHeya_InfoSection_Offset[1]); - } - } - break; - case ModeType.PuchiChara: - for (int i = 1; i < OpenTaiko.Skin.SongSelect_NewHeya_Box_Count - 1; i++) { - int x = OpenTaiko.Skin.SongSelect_NewHeya_Box_X[i]; - int y = OpenTaiko.Skin.SongSelect_NewHeya_Box_Y[i]; - int index = i - (OpenTaiko.Skin.SongSelect_NewHeya_Box_Count / 2) + CurrentIndex; - while (index < 0) { - index += CurrentMaxIndex; - } - while (index >= CurrentMaxIndex) { - index -= CurrentMaxIndex; - } - OpenTaiko.Tx.NewHeya_Box.t2D描画(x, y); - - int puriColumn = index % 5; - int puriRow = index / 5; - - if (OpenTaiko.Tx.Puchichara[index].tx != null) { - float puchiScale = OpenTaiko.Skin.Resolution[1] / 1080.0f; - - OpenTaiko.Tx.Puchichara[index].tx.vcScaleRatio.X = puchiScale; - OpenTaiko.Tx.Puchichara[index].tx.vcScaleRatio.Y = puchiScale; - } - - OpenTaiko.Tx.Puchichara[index].tx?.t2D拡大率考慮中央基準描画(x + OpenTaiko.Skin.SongSelect_NewHeya_Box_Chara_Offset[0], - y + OpenTaiko.Skin.SongSelect_NewHeya_Box_Chara_Offset[1] + (int)(OpenTaiko.stageSongSelect.PuchiChara.sineY), - new Rectangle((OpenTaiko.stageSongSelect.PuchiChara.Counter.CurrentValue + 2 * puriColumn) * OpenTaiko.Skin.Game_PuchiChara[0], - puriRow * OpenTaiko.Skin.Game_PuchiChara[1], - OpenTaiko.Skin.Game_PuchiChara[0], - OpenTaiko.Skin.Game_PuchiChara[1])); - - OpenTaiko.Tx.Puchichara[index].tx?.tUpdateColor4(CConversion.ColorToColor4(Color.White)); - - - if (ttkPuchiCharaNames[index] != null) { - CTexture tmpTex = TitleTextureKey.ResolveTitleTexture(ttkPuchiCharaNames[index]); - - tmpTex.t2D拡大率考慮上中央基準描画(x + OpenTaiko.Skin.SongSelect_NewHeya_Box_Name_Offset[0], y + OpenTaiko.Skin.SongSelect_NewHeya_Box_Name_Offset[1]); - } - - if (ttkPuchiCharaAuthors[index] != null) { - CTexture tmpTex = TitleTextureKey.ResolveTitleTexture(ttkPuchiCharaAuthors[index]); - - tmpTex.t2D拡大率考慮上中央基準描画(x + OpenTaiko.Skin.SongSelect_NewHeya_Box_Author_Offset[0], y + OpenTaiko.Skin.SongSelect_NewHeya_Box_Author_Offset[1]); - } - - if (OpenTaiko.Tx.Puchichara[index].unlock != null - && !OpenTaiko.SaveFileInstances[CurrentPlayer].data.UnlockedPuchicharas.Contains(OpenTaiko.Skin.Puchicharas_Name[index])) { - OpenTaiko.Tx.NewHeya_Lock?.t2D描画(x + OpenTaiko.Skin.SongSelect_NewHeya_Lock_Offset[0], y + OpenTaiko.Skin.SongSelect_NewHeya_Lock_Offset[1]); - - if (this.ttkInfoSection != null) - TitleTextureKey.ResolveTitleTexture(this.ttkInfoSection) - .t2D拡大率考慮上中央基準描画(x + OpenTaiko.Skin.SongSelect_NewHeya_InfoSection_Offset[0], y + OpenTaiko.Skin.SongSelect_NewHeya_InfoSection_Offset[1]); - } - } - break; - case ModeType.SubTitle: - for (int i = 1; i < OpenTaiko.Skin.SongSelect_NewHeya_Box_Count - 1; i++) { - int x = OpenTaiko.Skin.SongSelect_NewHeya_Box_X[i]; - int y = OpenTaiko.Skin.SongSelect_NewHeya_Box_Y[i]; - int index = i - (OpenTaiko.Skin.SongSelect_NewHeya_Box_Count / 2) + CurrentIndex; - while (index < 0) { - index += CurrentMaxIndex; - } - while (index >= CurrentMaxIndex) { - index -= CurrentMaxIndex; - } - CTexture tmpTex = TitleTextureKey.ResolveTitleTexture(this.ttkTitles[index]); - - if (i != 0) { - tmpTex.color4 = CConversion.ColorToColor4(Color.DarkGray); + SetState(SelectableInfo.PlayerSelect); + } else if (ess == ESelectStatus.SUCCESS) { + //TJAPlayer3.NamePlateConfig.data.UnlockedPuchicharas[iPlayer].Add(TJAPlayer3.Skin.Puchicharas_Name[iPuchiCharaCurrent]); + //TJAPlayer3.NamePlateConfig.tSpendCoins(TJAPlayer3.Tx.Puchichara[iPuchiCharaCurrent].unlock.Values[0], iPlayer); + OpenTaiko.SaveFileInstances[CurrentPlayer].data.UnlockedPuchicharas.Add(OpenTaiko.Skin.Puchicharas_Name[CurrentIndex]); + OpenTaiko.SaveFileInstances[CurrentPlayer].tSpendCoins(OpenTaiko.Tx.Puchichara[CurrentIndex].unlock.Values[0]); + OpenTaiko.Skin.soundDecideSFX.tPlay(); } else { - tmpTex.color4 = CConversion.ColorToColor4(Color.White); + OpenTaiko.Skin.soundError.tPlay(); + } + } + break; + case ModeType.Chara: { + var ess = this.tSelectChara(); + + if (ess == ESelectStatus.SELECTED) { + //TJAPlayer3.Tx.Loading?.t2D描画(18, 7); + + // Reload character, a bit time expensive but with a O(N) memory complexity instead of O(N * M) + OpenTaiko.Tx.ReloadCharacter(OpenTaiko.SaveFileInstances[CurrentPlayer].data.Character, CurrentIndex, CurrentPlayer); + OpenTaiko.SaveFileInstances[CurrentPlayer].data.Character = CurrentIndex; + + // Update the character + OpenTaiko.SaveFileInstances[CurrentPlayer].tUpdateCharacterName(OpenTaiko.Skin.Characters_DirName[CurrentIndex]); + + // Welcome voice using Sanka + OpenTaiko.Skin.soundDecideSFX.tPlay(); + OpenTaiko.Skin.voiceTitleSanka[CurrentPlayer]?.tPlay(); + + CMenuCharacter.tMenuResetTimer(CMenuCharacter.ECharacterAnimation.NORMAL); + + OpenTaiko.SaveFileInstances[CurrentPlayer].tApplyHeyaChanges(); + + SetState(SelectableInfo.PlayerSelect); + CurrentMode = ModeType.None; + } else if (ess == ESelectStatus.SUCCESS) { + OpenTaiko.SaveFileInstances[CurrentPlayer].data.UnlockedCharacters.Add(OpenTaiko.Skin.Characters_DirName[CurrentIndex]); + OpenTaiko.SaveFileInstances[CurrentPlayer].tSpendCoins(OpenTaiko.Tx.Characters[CurrentIndex].unlock.Values[0]); + OpenTaiko.Skin.soundDecideSFX.tPlay(); + } else { + OpenTaiko.Skin.soundError.tPlay(); + } + } + break; + case ModeType.DanTitle: { + bool iG = false; + int cs = 0; + + if (CurrentIndex > 0) { + iG = OpenTaiko.SaveFileInstances[CurrentPlayer].data.DanTitles[this.ttkDanTitles[CurrentIndex].str].isGold; + cs = OpenTaiko.SaveFileInstances[CurrentPlayer].data.DanTitles[this.ttkDanTitles[CurrentIndex].str].clearStatus; } - OpenTaiko.Tx.NewHeya_Box.t2D描画(x, y); + OpenTaiko.SaveFileInstances[CurrentPlayer].data.Dan = this.ttkDanTitles[CurrentIndex].str; + OpenTaiko.SaveFileInstances[CurrentPlayer].data.DanGold = iG; + OpenTaiko.SaveFileInstances[CurrentPlayer].data.DanType = cs; - x += OpenTaiko.Skin.SongSelect_NewHeya_Box_Chara_Offset[0]; - y += OpenTaiko.Skin.SongSelect_NewHeya_Box_Chara_Offset[1]; + OpenTaiko.NamePlate.tNamePlateRefreshTitles(CurrentPlayer); - int iType = -1; - int rarity = 1; - int id = -1; + OpenTaiko.SaveFileInstances[CurrentPlayer].tApplyHeyaChanges(); - if (index == 0) { - iType = 0; - } - else if (OpenTaiko.SaveFileInstances[CurrentPlayer].data.UnlockedNameplateIds != null && - OpenTaiko.Databases.DBNameplateUnlockables.data.ContainsKey(OpenTaiko.SaveFileInstances[CurrentPlayer].data.UnlockedNameplateIds[index - 1])) { - id = OpenTaiko.SaveFileInstances[CurrentPlayer].data.UnlockedNameplateIds[index - 1]; + OpenTaiko.Skin.soundDecideSFX.tPlay(); + SetState(SelectableInfo.PlayerSelect); + } + break; + case ModeType.SubTitle: { + + if (CurrentIndex == 0) { + OpenTaiko.SaveFileInstances[CurrentPlayer].data.TitleType = 0; + OpenTaiko.SaveFileInstances[CurrentPlayer].data.TitleId = -1; + OpenTaiko.SaveFileInstances[CurrentPlayer].data.TitleRarityInt = 1; + OpenTaiko.SaveFileInstances[CurrentPlayer].data.Title = "初心者"; + } else if (OpenTaiko.SaveFileInstances[CurrentPlayer].data.UnlockedNameplateIds != null && + OpenTaiko.Databases.DBNameplateUnlockables.data.ContainsKey(OpenTaiko.SaveFileInstances[CurrentPlayer].data.UnlockedNameplateIds[CurrentIndex - 1])) { + var id = OpenTaiko.SaveFileInstances[CurrentPlayer].data.UnlockedNameplateIds[CurrentIndex - 1]; var nameplate = OpenTaiko.Databases.DBNameplateUnlockables.data[id]; - iType = nameplate.nameplateInfo.iType; - rarity = HRarity.tRarityToLangInt(nameplate.rarity); - } - - - tmpTex.t2D拡大率考慮上中央基準描画(x + OpenTaiko.Skin.Heya_Side_Menu_Font_Offset[0], y + OpenTaiko.Skin.Heya_Side_Menu_Font_Offset[1]); - - OpenTaiko.NamePlate.lcNamePlate.DrawTitlePlate(x, y, 255, iType, tmpTex, rarity, id); - - } - break; - case ModeType.DanTitle: - for (int i = 1; i < OpenTaiko.Skin.SongSelect_NewHeya_Box_Count - 1; i++) { - int x = OpenTaiko.Skin.SongSelect_NewHeya_Box_X[i]; - int y = OpenTaiko.Skin.SongSelect_NewHeya_Box_Y[i]; - int index = i - (OpenTaiko.Skin.SongSelect_NewHeya_Box_Count / 2) + CurrentIndex; - while (index < 0) { - index += CurrentMaxIndex; - } - while (index >= CurrentMaxIndex) { - index -= CurrentMaxIndex; - } - CTexture tmpTex = TitleTextureKey.ResolveTitleTexture(this.ttkDanTitles[index]); - - if (i != 0) { - tmpTex.color4 = CConversion.ColorToColor4(Color.DarkGray); - OpenTaiko.Tx.NamePlateBase.color4 = CConversion.ColorToColor4(Color.DarkGray); + OpenTaiko.SaveFileInstances[CurrentPlayer].data.TitleId = id; + OpenTaiko.SaveFileInstances[CurrentPlayer].data.Title = nameplate.nameplateInfo.cld.GetString(""); + OpenTaiko.SaveFileInstances[CurrentPlayer].data.TitleRarityInt = HRarity.tRarityToLangInt(nameplate.rarity); + OpenTaiko.SaveFileInstances[CurrentPlayer].data.TitleType = nameplate.nameplateInfo.iType; } else { - tmpTex.color4 = CConversion.ColorToColor4(Color.White); - OpenTaiko.Tx.NamePlateBase.color4 = CConversion.ColorToColor4(Color.White); + OpenTaiko.SaveFileInstances[CurrentPlayer].data.TitleType = -1; + OpenTaiko.SaveFileInstances[CurrentPlayer].data.TitleId = -1; + OpenTaiko.SaveFileInstances[CurrentPlayer].data.TitleRarityInt = 1; + OpenTaiko.SaveFileInstances[CurrentPlayer].data.Title = ""; } - OpenTaiko.Tx.NewHeya_Box.t2D描画(x, y); + OpenTaiko.NamePlate.tNamePlateRefreshTitles(CurrentPlayer); - x += OpenTaiko.Skin.SongSelect_NewHeya_Box_Chara_Offset[0]; - y += OpenTaiko.Skin.SongSelect_NewHeya_Box_Chara_Offset[1]; + OpenTaiko.SaveFileInstances[CurrentPlayer].tApplyHeyaChanges(); - int danGrade = 0; - if (index > 0) { - danGrade = OpenTaiko.SaveFileInstances[CurrentPlayer].data.DanTitles[this.ttkDanTitles[index].str].clearStatus; - } - - OpenTaiko.NamePlate.lcNamePlate.DrawDan(x, y, 255, danGrade, tmpTex); - - /* - TJAPlayer3.NamePlate.tNamePlateDisplayNamePlateBase( - x - TJAPlayer3.Tx.NamePlateBase.szTextureSize.Width / 2, - y - TJAPlayer3.Tx.NamePlateBase.szTextureSize.Height / 24, - (8 + danGrade)); - TJAPlayer3.Tx.NamePlateBase.color4 = CConversion.ColorToColor4(Color.White); - - tmpTex.t2D拡大率考慮上中央基準描画(x + TJAPlayer3.Skin.Heya_Side_Menu_Font_Offset[0], y + TJAPlayer3.Skin.Heya_Side_Menu_Font_Offset[1]); - */ + OpenTaiko.Skin.soundDecideSFX.tPlay(); + SetState(SelectableInfo.PlayerSelect); } break; } } break; } - - OpenTaiko.Tx.NewHeya_Close.t2D描画(0, 0); - - for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { - OpenTaiko.Tx.NewHeya_PlayerPlate[OpenTaiko.GetActualPlayer(i)].t2D描画(OpenTaiko.Skin.SongSelect_NewHeya_PlayerPlate_X[i], OpenTaiko.Skin.SongSelect_NewHeya_PlayerPlate_Y[i]); - } - - for (int i = 0; i < 5; i++) { - OpenTaiko.Tx.NewHeya_ModeBar.t2D描画(OpenTaiko.Skin.SongSelect_NewHeya_ModeBar_X[i], OpenTaiko.Skin.SongSelect_NewHeya_ModeBar_Y[i]); - int title_x = OpenTaiko.Skin.SongSelect_NewHeya_ModeBar_X[i] + OpenTaiko.Skin.SongSelect_NewHeya_ModeBar_Font_Offset[0]; - int title_y = OpenTaiko.Skin.SongSelect_NewHeya_ModeBar_Y[i] + OpenTaiko.Skin.SongSelect_NewHeya_ModeBar_Font_Offset[1]; - TitleTextureKey.ResolveTitleTexture(MenuTitleKeys[i], false).t2D拡大率考慮中央基準描画(title_x, title_y); - } - - return base.Draw(); + } else if ((OpenTaiko.Pad.bPressedDGB(EPad.Cancel) || OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Escape))) { + Close(); + OpenTaiko.Skin.soundCancelSFX.tPlay(); + } else if (OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.LeftChange) + || OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.LeftArrow)) { + ChangeIndex(-1); + OpenTaiko.Skin.soundChangeSFX.tPlay(); + } else if (OpenTaiko.Pad.bPressed(EInstrumentPad.Drums, EPad.RightChange) + || OpenTaiko.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.RightArrow)) { + ChangeIndex(1); + OpenTaiko.Skin.soundChangeSFX.tPlay(); } - /* - * FAILED : Selection/Purchase failed (failed condition) - * SUCCESS : Purchase succeed (without selection) - * SELECTED : Selection succeed - */ - private enum ESelectStatus { - FAILED, - SUCCESS, - SELECTED - }; + InFade.Tick(); - private ESelectStatus tSelectPuchi() { - // Add "If unlocked" to select directly - - if (OpenTaiko.Tx.Puchichara[CurrentIndex].unlock != null - && !OpenTaiko.SaveFileInstances[CurrentPlayer].data.UnlockedPuchicharas.Contains(OpenTaiko.Skin.Puchicharas_Name[CurrentIndex])) { - (bool, string?) response = OpenTaiko.Tx.Puchichara[CurrentIndex].unlock.tConditionMetWrapper(OpenTaiko.SaveFile); - //tConditionMet( - //new int[] { TJAPlayer3.SaveFileInstances[TJAPlayer3.SaveFile].data.Medals }); - - Color responseColor = (response.Item1) ? Color.Lime : Color.Red; - - // Send coins here for the unlock, considering that only coin-paid puchicharas can be unlocked directly from the Heya menu - - this.ttkInfoSection = new TitleTextureKey(response.Item2 ?? this.ttkInfoSection.str, this.MenuFont, responseColor, Color.Black, 1000); - - return (response.Item1) ? ESelectStatus.SUCCESS : ESelectStatus.FAILED; + if (OpenTaiko.Tx.Tile_Black != null) { + OpenTaiko.Tx.Tile_Black.Opacity = InFade.CurrentValue / 2; + for (int i = 0; i <= (SampleFramework.GameWindowSize.Width / OpenTaiko.Tx.Tile_Black.szTextureSize.Width); i++) // #23510 2010.10.31 yyagi: change "clientSize.Width" to "640" to fix FIFO drawing size + { + for (int j = 0; j <= (SampleFramework.GameWindowSize.Height / OpenTaiko.Tx.Tile_Black.szTextureSize.Height); j++) // #23510 2010.10.31 yyagi: change "clientSize.Height" to "480" to fix FIFO drawing size + { + OpenTaiko.Tx.Tile_Black.t2D描画(i * OpenTaiko.Tx.Tile_Black.szTextureSize.Width, j * OpenTaiko.Tx.Tile_Black.szTextureSize.Height); + } } + } + + switch (CurrentState) { + case SelectableInfo.PlayerSelect: + if (CurrentIndex == 0) { + OpenTaiko.Tx.NewHeya_Close_Select.t2D描画(OpenTaiko.Skin.SongSelect_NewHeya_Close_Select[0], OpenTaiko.Skin.SongSelect_NewHeya_Close_Select[1]); + } else { + OpenTaiko.Tx.NewHeya_PlayerPlate_Select.t2D描画(OpenTaiko.Skin.SongSelect_NewHeya_PlayerPlate_X[CurrentIndex - 1], OpenTaiko.Skin.SongSelect_NewHeya_PlayerPlate_Y[CurrentIndex - 1]); + } + break; + case SelectableInfo.ModeSelect: { + OpenTaiko.Tx.NewHeya_ModeBar_Select.t2D描画(OpenTaiko.Skin.SongSelect_NewHeya_ModeBar_X[CurrentIndex], OpenTaiko.Skin.SongSelect_NewHeya_ModeBar_Y[CurrentIndex]); + } + break; + case SelectableInfo.Select: { + switch (CurrentMode) { + case ModeType.Chara: + for (int i = 1; i < OpenTaiko.Skin.SongSelect_NewHeya_Box_Count - 1; i++) { + int x = OpenTaiko.Skin.SongSelect_NewHeya_Box_X[i]; + int y = OpenTaiko.Skin.SongSelect_NewHeya_Box_Y[i]; + int index = i - (OpenTaiko.Skin.SongSelect_NewHeya_Box_Count / 2) + CurrentIndex; + while (index < 0) { + index += CurrentMaxIndex; + } + while (index >= CurrentMaxIndex) { + index -= CurrentMaxIndex; + } + OpenTaiko.Tx.NewHeya_Box.t2D描画(x, y); + + + float charaRatioX = 1.0f; + float charaRatioY = 1.0f; + if (OpenTaiko.Skin.Characters_Resolution[index] != null) { + charaRatioX = OpenTaiko.Skin.Resolution[0] / (float)OpenTaiko.Skin.Characters_Resolution[index][0]; + charaRatioY = OpenTaiko.Skin.Resolution[1] / (float)OpenTaiko.Skin.Characters_Resolution[index][1]; + } + + if (OpenTaiko.Tx.Characters_Heya_Preview[index] != null) { + OpenTaiko.Tx.Characters_Heya_Preview[index].vcScaleRatio.X = charaRatioX; + OpenTaiko.Tx.Characters_Heya_Preview[index].vcScaleRatio.Y = charaRatioY; + } + + OpenTaiko.Tx.Characters_Heya_Preview[index]?.t2D拡大率考慮中央基準描画(x + OpenTaiko.Skin.SongSelect_NewHeya_Box_Chara_Offset[0], y + OpenTaiko.Skin.SongSelect_NewHeya_Box_Chara_Offset[1]); + OpenTaiko.Tx.Characters_Heya_Preview[index]?.tUpdateColor4(CConversion.ColorToColor4(Color.White)); + + if (ttkCharacterNames[index] != null) { + CTexture tmpTex = TitleTextureKey.ResolveTitleTexture(ttkCharacterNames[index]); + + tmpTex.t2D拡大率考慮上中央基準描画(x + OpenTaiko.Skin.SongSelect_NewHeya_Box_Name_Offset[0], y + OpenTaiko.Skin.SongSelect_NewHeya_Box_Name_Offset[1]); + } + + if (ttkCharacterAuthors[index] != null) { + CTexture tmpTex = TitleTextureKey.ResolveTitleTexture(ttkCharacterAuthors[index]); + + tmpTex.t2D拡大率考慮上中央基準描画(x + OpenTaiko.Skin.SongSelect_NewHeya_Box_Author_Offset[0], y + OpenTaiko.Skin.SongSelect_NewHeya_Box_Author_Offset[1]); + } + + if (OpenTaiko.Tx.Characters[index].unlock != null + && !OpenTaiko.SaveFileInstances[CurrentPlayer].data.UnlockedCharacters.Contains(OpenTaiko.Skin.Characters_DirName[index])) { + OpenTaiko.Tx.NewHeya_Lock?.t2D描画(x + OpenTaiko.Skin.SongSelect_NewHeya_Lock_Offset[0], y + OpenTaiko.Skin.SongSelect_NewHeya_Lock_Offset[1]); + + if (this.ttkInfoSection != null) + TitleTextureKey.ResolveTitleTexture(this.ttkInfoSection) + .t2D拡大率考慮上中央基準描画(x + OpenTaiko.Skin.SongSelect_NewHeya_InfoSection_Offset[0], y + OpenTaiko.Skin.SongSelect_NewHeya_InfoSection_Offset[1]); + } + } + break; + case ModeType.PuchiChara: + for (int i = 1; i < OpenTaiko.Skin.SongSelect_NewHeya_Box_Count - 1; i++) { + int x = OpenTaiko.Skin.SongSelect_NewHeya_Box_X[i]; + int y = OpenTaiko.Skin.SongSelect_NewHeya_Box_Y[i]; + int index = i - (OpenTaiko.Skin.SongSelect_NewHeya_Box_Count / 2) + CurrentIndex; + while (index < 0) { + index += CurrentMaxIndex; + } + while (index >= CurrentMaxIndex) { + index -= CurrentMaxIndex; + } + OpenTaiko.Tx.NewHeya_Box.t2D描画(x, y); + + int puriColumn = index % 5; + int puriRow = index / 5; + + if (OpenTaiko.Tx.Puchichara[index].tx != null) { + float puchiScale = OpenTaiko.Skin.Resolution[1] / 1080.0f; + + OpenTaiko.Tx.Puchichara[index].tx.vcScaleRatio.X = puchiScale; + OpenTaiko.Tx.Puchichara[index].tx.vcScaleRatio.Y = puchiScale; + } + + OpenTaiko.Tx.Puchichara[index].tx?.t2D拡大率考慮中央基準描画(x + OpenTaiko.Skin.SongSelect_NewHeya_Box_Chara_Offset[0], + y + OpenTaiko.Skin.SongSelect_NewHeya_Box_Chara_Offset[1] + (int)(OpenTaiko.stageSongSelect.PuchiChara.sineY), + new Rectangle((OpenTaiko.stageSongSelect.PuchiChara.Counter.CurrentValue + 2 * puriColumn) * OpenTaiko.Skin.Game_PuchiChara[0], + puriRow * OpenTaiko.Skin.Game_PuchiChara[1], + OpenTaiko.Skin.Game_PuchiChara[0], + OpenTaiko.Skin.Game_PuchiChara[1])); + + OpenTaiko.Tx.Puchichara[index].tx?.tUpdateColor4(CConversion.ColorToColor4(Color.White)); + + + if (ttkPuchiCharaNames[index] != null) { + CTexture tmpTex = TitleTextureKey.ResolveTitleTexture(ttkPuchiCharaNames[index]); + + tmpTex.t2D拡大率考慮上中央基準描画(x + OpenTaiko.Skin.SongSelect_NewHeya_Box_Name_Offset[0], y + OpenTaiko.Skin.SongSelect_NewHeya_Box_Name_Offset[1]); + } + + if (ttkPuchiCharaAuthors[index] != null) { + CTexture tmpTex = TitleTextureKey.ResolveTitleTexture(ttkPuchiCharaAuthors[index]); + + tmpTex.t2D拡大率考慮上中央基準描画(x + OpenTaiko.Skin.SongSelect_NewHeya_Box_Author_Offset[0], y + OpenTaiko.Skin.SongSelect_NewHeya_Box_Author_Offset[1]); + } + + if (OpenTaiko.Tx.Puchichara[index].unlock != null + && !OpenTaiko.SaveFileInstances[CurrentPlayer].data.UnlockedPuchicharas.Contains(OpenTaiko.Skin.Puchicharas_Name[index])) { + OpenTaiko.Tx.NewHeya_Lock?.t2D描画(x + OpenTaiko.Skin.SongSelect_NewHeya_Lock_Offset[0], y + OpenTaiko.Skin.SongSelect_NewHeya_Lock_Offset[1]); + + if (this.ttkInfoSection != null) + TitleTextureKey.ResolveTitleTexture(this.ttkInfoSection) + .t2D拡大率考慮上中央基準描画(x + OpenTaiko.Skin.SongSelect_NewHeya_InfoSection_Offset[0], y + OpenTaiko.Skin.SongSelect_NewHeya_InfoSection_Offset[1]); + } + } + break; + case ModeType.SubTitle: + for (int i = 1; i < OpenTaiko.Skin.SongSelect_NewHeya_Box_Count - 1; i++) { + int x = OpenTaiko.Skin.SongSelect_NewHeya_Box_X[i]; + int y = OpenTaiko.Skin.SongSelect_NewHeya_Box_Y[i]; + int index = i - (OpenTaiko.Skin.SongSelect_NewHeya_Box_Count / 2) + CurrentIndex; + while (index < 0) { + index += CurrentMaxIndex; + } + while (index >= CurrentMaxIndex) { + index -= CurrentMaxIndex; + } + CTexture tmpTex = TitleTextureKey.ResolveTitleTexture(this.ttkTitles[index]); + + if (i != 0) { + tmpTex.color4 = CConversion.ColorToColor4(Color.DarkGray); + } else { + tmpTex.color4 = CConversion.ColorToColor4(Color.White); + } + + OpenTaiko.Tx.NewHeya_Box.t2D描画(x, y); + + x += OpenTaiko.Skin.SongSelect_NewHeya_Box_Chara_Offset[0]; + y += OpenTaiko.Skin.SongSelect_NewHeya_Box_Chara_Offset[1]; + + int iType = -1; + int rarity = 1; + int id = -1; + + if (index == 0) { + iType = 0; + } else if (OpenTaiko.SaveFileInstances[CurrentPlayer].data.UnlockedNameplateIds != null && + OpenTaiko.Databases.DBNameplateUnlockables.data.ContainsKey(OpenTaiko.SaveFileInstances[CurrentPlayer].data.UnlockedNameplateIds[index - 1])) { + id = OpenTaiko.SaveFileInstances[CurrentPlayer].data.UnlockedNameplateIds[index - 1]; + var nameplate = OpenTaiko.Databases.DBNameplateUnlockables.data[id]; + iType = nameplate.nameplateInfo.iType; + rarity = HRarity.tRarityToLangInt(nameplate.rarity); + } + + + + tmpTex.t2D拡大率考慮上中央基準描画(x + OpenTaiko.Skin.Heya_Side_Menu_Font_Offset[0], y + OpenTaiko.Skin.Heya_Side_Menu_Font_Offset[1]); + + OpenTaiko.NamePlate.lcNamePlate.DrawTitlePlate(x, y, 255, iType, tmpTex, rarity, id); + + } + break; + case ModeType.DanTitle: + for (int i = 1; i < OpenTaiko.Skin.SongSelect_NewHeya_Box_Count - 1; i++) { + int x = OpenTaiko.Skin.SongSelect_NewHeya_Box_X[i]; + int y = OpenTaiko.Skin.SongSelect_NewHeya_Box_Y[i]; + int index = i - (OpenTaiko.Skin.SongSelect_NewHeya_Box_Count / 2) + CurrentIndex; + while (index < 0) { + index += CurrentMaxIndex; + } + while (index >= CurrentMaxIndex) { + index -= CurrentMaxIndex; + } + CTexture tmpTex = TitleTextureKey.ResolveTitleTexture(this.ttkDanTitles[index]); + + if (i != 0) { + tmpTex.color4 = CConversion.ColorToColor4(Color.DarkGray); + OpenTaiko.Tx.NamePlateBase.color4 = CConversion.ColorToColor4(Color.DarkGray); + } else { + tmpTex.color4 = CConversion.ColorToColor4(Color.White); + OpenTaiko.Tx.NamePlateBase.color4 = CConversion.ColorToColor4(Color.White); + } + + OpenTaiko.Tx.NewHeya_Box.t2D描画(x, y); + + x += OpenTaiko.Skin.SongSelect_NewHeya_Box_Chara_Offset[0]; + y += OpenTaiko.Skin.SongSelect_NewHeya_Box_Chara_Offset[1]; + + int danGrade = 0; + if (index > 0) { + danGrade = OpenTaiko.SaveFileInstances[CurrentPlayer].data.DanTitles[this.ttkDanTitles[index].str].clearStatus; + } + + OpenTaiko.NamePlate.lcNamePlate.DrawDan(x, y, 255, danGrade, tmpTex); + + /* + TJAPlayer3.NamePlate.tNamePlateDisplayNamePlateBase( + x - TJAPlayer3.Tx.NamePlateBase.szTextureSize.Width / 2, + y - TJAPlayer3.Tx.NamePlateBase.szTextureSize.Height / 24, + (8 + danGrade)); + TJAPlayer3.Tx.NamePlateBase.color4 = CConversion.ColorToColor4(Color.White); + + tmpTex.t2D拡大率考慮上中央基準描画(x + TJAPlayer3.Skin.Heya_Side_Menu_Font_Offset[0], y + TJAPlayer3.Skin.Heya_Side_Menu_Font_Offset[1]); + */ + } + break; + } + } + break; + } + + OpenTaiko.Tx.NewHeya_Close.t2D描画(0, 0); + + for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { + OpenTaiko.Tx.NewHeya_PlayerPlate[OpenTaiko.GetActualPlayer(i)].t2D描画(OpenTaiko.Skin.SongSelect_NewHeya_PlayerPlate_X[i], OpenTaiko.Skin.SongSelect_NewHeya_PlayerPlate_Y[i]); + } + + for (int i = 0; i < 5; i++) { + OpenTaiko.Tx.NewHeya_ModeBar.t2D描画(OpenTaiko.Skin.SongSelect_NewHeya_ModeBar_X[i], OpenTaiko.Skin.SongSelect_NewHeya_ModeBar_Y[i]); + int title_x = OpenTaiko.Skin.SongSelect_NewHeya_ModeBar_X[i] + OpenTaiko.Skin.SongSelect_NewHeya_ModeBar_Font_Offset[0]; + int title_y = OpenTaiko.Skin.SongSelect_NewHeya_ModeBar_Y[i] + OpenTaiko.Skin.SongSelect_NewHeya_ModeBar_Font_Offset[1]; + TitleTextureKey.ResolveTitleTexture(MenuTitleKeys[i], false).t2D拡大率考慮中央基準描画(title_x, title_y); + } + + return base.Draw(); + } + + /* + * FAILED : Selection/Purchase failed (failed condition) + * SUCCESS : Purchase succeed (without selection) + * SELECTED : Selection succeed + */ + private enum ESelectStatus { + FAILED, + SUCCESS, + SELECTED + }; + + private ESelectStatus tSelectPuchi() { + // Add "If unlocked" to select directly + + if (OpenTaiko.Tx.Puchichara[CurrentIndex].unlock != null + && !OpenTaiko.SaveFileInstances[CurrentPlayer].data.UnlockedPuchicharas.Contains(OpenTaiko.Skin.Puchicharas_Name[CurrentIndex])) { + (bool, string?) response = OpenTaiko.Tx.Puchichara[CurrentIndex].unlock.tConditionMetWrapper(OpenTaiko.SaveFile); + //tConditionMet( + //new int[] { TJAPlayer3.SaveFileInstances[TJAPlayer3.SaveFile].data.Medals }); + + Color responseColor = (response.Item1) ? Color.Lime : Color.Red; + + // Send coins here for the unlock, considering that only coin-paid puchicharas can be unlocked directly from the Heya menu + + this.ttkInfoSection = new TitleTextureKey(response.Item2 ?? this.ttkInfoSection.str, this.MenuFont, responseColor, Color.Black, 1000); + + return (response.Item1) ? ESelectStatus.SUCCESS : ESelectStatus.FAILED; + } + + this.ttkInfoSection = null; + return ESelectStatus.SELECTED; + } + + private void tUpdateUnlockableTextPuchi() { + #region [Check unlockable] + + if (OpenTaiko.Tx.Puchichara[CurrentIndex].unlock != null + && !OpenTaiko.SaveFileInstances[CurrentPlayer].data.UnlockedPuchicharas.Contains(OpenTaiko.Skin.Puchicharas_Name[CurrentIndex])) { + this.ttkInfoSection = new TitleTextureKey(OpenTaiko.Tx.Puchichara[CurrentIndex].unlock.tConditionMessage() + , this.MenuFont, Color.White, Color.Black, 1000); + } else this.ttkInfoSection = null; - return ESelectStatus.SELECTED; - } - private void tUpdateUnlockableTextPuchi() { - #region [Check unlockable] - - if (OpenTaiko.Tx.Puchichara[CurrentIndex].unlock != null - && !OpenTaiko.SaveFileInstances[CurrentPlayer].data.UnlockedPuchicharas.Contains(OpenTaiko.Skin.Puchicharas_Name[CurrentIndex])) { - this.ttkInfoSection = new TitleTextureKey(OpenTaiko.Tx.Puchichara[CurrentIndex].unlock.tConditionMessage() - , this.MenuFont, Color.White, Color.Black, 1000); - } else - this.ttkInfoSection = null; - - #endregion - } - private void tUpdateUnlockableTextChara() { - #region [Check unlockable] - - if (OpenTaiko.Tx.Characters[CurrentIndex].unlock != null - && !OpenTaiko.SaveFileInstances[CurrentPlayer].data.UnlockedCharacters.Contains(OpenTaiko.Skin.Characters_DirName[CurrentIndex])) { - this.ttkInfoSection = new TitleTextureKey(OpenTaiko.Tx.Characters[CurrentIndex].unlock.tConditionMessage() - , this.MenuFont, Color.White, Color.Black, 1000); - } else - this.ttkInfoSection = null; - - #endregion - } - - private ESelectStatus tSelectChara() { - // Add "If unlocked" to select directly - - if (OpenTaiko.Tx.Characters[CurrentIndex].unlock != null - && !OpenTaiko.SaveFileInstances[CurrentPlayer].data.UnlockedCharacters.Contains(OpenTaiko.Skin.Characters_DirName[CurrentIndex])) { - (bool, string?) response = OpenTaiko.Tx.Characters[CurrentIndex].unlock.tConditionMetWrapper(OpenTaiko.SaveFile); - //TJAPlayer3.Tx.Characters[iCharacterCurrent].unlock.tConditionMet( - //new int[] { TJAPlayer3.SaveFileInstances[TJAPlayer3.SaveFile].data.Medals }); - - Color responseColor = (response.Item1) ? Color.Lime : Color.Red; - - // Send coins here for the unlock, considering that only coin-paid puchicharas can be unlocked directly from the Heya menu - - this.ttkInfoSection = new TitleTextureKey(response.Item2 ?? this.ttkInfoSection.str, this.MenuFont, responseColor, Color.Black, 1000); - - return (response.Item1) ? ESelectStatus.SUCCESS : ESelectStatus.FAILED; - } + #endregion + } + private void tUpdateUnlockableTextChara() { + #region [Check unlockable] + if (OpenTaiko.Tx.Characters[CurrentIndex].unlock != null + && !OpenTaiko.SaveFileInstances[CurrentPlayer].data.UnlockedCharacters.Contains(OpenTaiko.Skin.Characters_DirName[CurrentIndex])) { + this.ttkInfoSection = new TitleTextureKey(OpenTaiko.Tx.Characters[CurrentIndex].unlock.tConditionMessage() + , this.MenuFont, Color.White, Color.Black, 1000); + } else this.ttkInfoSection = null; - return ESelectStatus.SELECTED; + + #endregion + } + + private ESelectStatus tSelectChara() { + // Add "If unlocked" to select directly + + if (OpenTaiko.Tx.Characters[CurrentIndex].unlock != null + && !OpenTaiko.SaveFileInstances[CurrentPlayer].data.UnlockedCharacters.Contains(OpenTaiko.Skin.Characters_DirName[CurrentIndex])) { + (bool, string?) response = OpenTaiko.Tx.Characters[CurrentIndex].unlock.tConditionMetWrapper(OpenTaiko.SaveFile); + //TJAPlayer3.Tx.Characters[iCharacterCurrent].unlock.tConditionMet( + //new int[] { TJAPlayer3.SaveFileInstances[TJAPlayer3.SaveFile].data.Medals }); + + Color responseColor = (response.Item1) ? Color.Lime : Color.Red; + + // Send coins here for the unlock, considering that only coin-paid puchicharas can be unlocked directly from the Heya menu + + this.ttkInfoSection = new TitleTextureKey(response.Item2 ?? this.ttkInfoSection.str, this.MenuFont, responseColor, Color.Black, 1000); + + return (response.Item1) ? ESelectStatus.SUCCESS : ESelectStatus.FAILED; } + + this.ttkInfoSection = null; + return ESelectStatus.SELECTED; } } diff --git a/OpenTaiko/src/Stages/CActオプションパネル.cs b/OpenTaiko/src/Stages/CActオプションパネル.cs index 2df0e4c1..bfd061f5 100644 --- a/OpenTaiko/src/Stages/CActオプションパネル.cs +++ b/OpenTaiko/src/Stages/CActオプションパネル.cs @@ -1,110 +1,110 @@ using System.Drawing; using FDK; -namespace OpenTaiko { - internal class CActオプションパネル : CActivity { - // CActivity 実装 +namespace OpenTaiko; - public override void DeActivate() { - if (!base.IsDeActivated) { - base.DeActivate(); - } +internal class CActオプションパネル : CActivity { + // CActivity 実装 + + public override void DeActivate() { + if (!base.IsDeActivated) { + base.DeActivate(); } - public override void CreateManagedResource() { - this.txオプションパネル = OpenTaiko.tテクスチャの生成(CSkin.Path(@"Graphics\Screen option panels.png"), false); - base.CreateManagedResource(); - } - public override void ReleaseManagedResource() { - OpenTaiko.tテクスチャの解放(ref this.txオプションパネル); - base.ReleaseManagedResource(); - } - public override int Draw() { - if (!base.IsDeActivated) { - CConfigIni configIni = OpenTaiko.ConfigIni; - /* - if( this.txオプションパネル != null ) - { - - - #region [ Sud/Hid/Invisible ] - this.txオプションパネル.t2D描画( device, 0x189, 12, this.rcHS[ ( configIni.bHidden.Drums ? 1 : 0 ) + ( configIni.bSudden.Drums ? 2 : 0 ) + - ( configIni.eInvisible.Drums == EInvisible.SEMI ? 4 : 0 ) + - ( configIni.eInvisible.Drums == EInvisible.FULL ? 5 : 0 ) ] ); - this.txオプションパネル.t2D描画( device, 0x189, 0x18, this.rcHS[ ( configIni.bHidden.Guitar ? 1 : 0 ) + ( configIni.bSudden.Guitar ? 2 : 0 ) + - ( configIni.eInvisible.Guitar == EInvisible.SEMI ? 4 : 0 ) + - ( configIni.eInvisible.Guitar == EInvisible.FULL ? 5 : 0 ) ] ); - this.txオプションパネル.t2D描画( device, 0x189, 0x24, this.rcHS[ ( configIni.bHidden.Bass ? 1 : 0 ) + ( configIni.bSudden.Bass ? 2 : 0 ) + - ( configIni.eInvisible.Bass == EInvisible.SEMI ? 4 : 0 ) + - ( configIni.eInvisible.Bass == EInvisible.FULL ? 5 : 0 ) ] ); - #endregion - #region [ Dark ] - this.txオプションパネル.t2D描画( device, 0x1a1, 12, this.rcDark[ (int) configIni.eDark ] ); - this.txオプションパネル.t2D描画( device, 0x1a1, 0x18, this.rcDark[ (int) configIni.eDark ] ); - this.txオプションパネル.t2D描画( device, 0x1a1, 0x24, this.rcDark[ (int) configIni.eDark ] ); - #endregion - #region [ Reverse ] - this.txオプションパネル.t2D描画( device, 0x1b9, 12, this.rcReverse[ configIni.bReverse.Drums ? 1 : 0 ] ); - this.txオプションパネル.t2D描画( device, 0x1b9, 0x18, this.rcReverse[ configIni.bReverse.Guitar ? 1 : 0 ] ); - this.txオプションパネル.t2D描画( device, 0x1b9, 0x24, this.rcReverse[ configIni.bReverse.Bass ? 1 : 0 ] ); - #endregion - #region [ Position ] - this.txオプションパネル.t2D描画( device, 0x1d1, 12, this.rcPosition[ (int) configIni.判定文字表示位置.Drums ] ); - this.txオプションパネル.t2D描画( device, 0x1d1, 0x18, this.rcPosition[ (int) configIni.判定文字表示位置.Guitar ] ); - this.txオプションパネル.t2D描画( device, 0x1d1, 0x24, this.rcPosition[ (int) configIni.判定文字表示位置.Bass ] ); - #endregion - #region [ Tight ] - this.txオプションパネル.t2D描画( device, 0x1e9, 12, this.rcTight[ configIni.bTight ? 1 : 0 ] ); - #endregion - #region [ Random ] - this.txオプションパネル.t2D描画( device, 0x1e9, 0x18, this.rcRandom[ (int) configIni.eRandom.Guitar ] ); - this.txオプションパネル.t2D描画( device, 0x1e9, 0x24, this.rcRandom[ (int) configIni.eRandom.Bass ] ); - #endregion - #region [ ComboPosition ] - this.txオプションパネル.t2D描画( device, 0x201, 12, new Rectangle(0, 0, 0, 0) ); - #endregion - #region [ Light ] - this.txオプションパネル.t2D描画( device, 0x201, 0x18, this.rcLight[ configIni.bLight.Guitar ? 1 : 0 ] ); - this.txオプションパネル.t2D描画( device, 0x201, 0x24, this.rcLight[ configIni.bLight.Bass ? 1 : 0 ] ); - #endregion - #region [ Left ] - this.txオプションパネル.t2D描画( device, 0x219, 0x18, this.rcLeft[ configIni.bLeft.Guitar ? 1 : 0 ] ); - this.txオプションパネル.t2D描画( device, 0x219, 0x24, this.rcLeft[ configIni.bLeft.Bass ? 1 : 0 ] ); - #endregion - } - */ - } - return 0; - } - - - // その他 - - #region [ private ] - //----------------- - private readonly Rectangle[] rcComboPos = new Rectangle[] { new Rectangle(0x30, 0x48, 0x18, 12), new Rectangle(0x30, 60, 0x18, 12), new Rectangle(0x30, 0x30, 0x18, 12), new Rectangle(0x18, 0x48, 0x18, 12) }; - private readonly Rectangle[] rcDark = new Rectangle[] { new Rectangle(0x18, 0, 0x18, 12), new Rectangle(0x18, 12, 0x18, 12), new Rectangle(0x18, 0x54, 0x18, 12) }; - private readonly Rectangle[] rcHS = new Rectangle[] { - new Rectangle( 0, 0, 0x18, 12 ), // OFF - new Rectangle( 0, 12, 0x18, 12 ), // Hidden - new Rectangle( 0, 0x18, 0x18, 12 ), // Sudden - new Rectangle( 0, 0x24, 0x18, 12 ), // H/S - new Rectangle(0x60, 0x54, 0x18, 12 ), // Semi-Invisible - new Rectangle( 120, 0x54, 0x18, 12 ) // Full-Invisible - }; - private readonly Rectangle[] rcLeft = new Rectangle[] { new Rectangle(0x60, 0x48, 0x18, 12), new Rectangle(120, 0x48, 0x18, 12) }; - private readonly Rectangle[] rcLight = new Rectangle[] { new Rectangle(120, 0x30, 0x18, 12), new Rectangle(120, 60, 0x18, 12) }; - private readonly Rectangle[] rcPosition = new Rectangle[] { - new Rectangle( 0, 48, 24, 12 ), // P-A - new Rectangle( 0, 60, 24, 12 ), // P-B - new Rectangle( 0, 72, 24, 12 ), // P-B - new Rectangle( 24, 72, 24, 12 ) // OFF - }; - private readonly Rectangle[] rcRandom = new Rectangle[] { new Rectangle(0x48, 0x30, 0x18, 12), new Rectangle(0x48, 60, 0x18, 12), new Rectangle(0x48, 0x48, 0x18, 12), new Rectangle(0x48, 0x54, 0x18, 12) }; - private readonly Rectangle[] rcReverse = new Rectangle[] { new Rectangle(0x18, 0x18, 0x18, 12), new Rectangle(0x18, 0x24, 0x18, 12) }; - private readonly Rectangle[] rcTight = new Rectangle[] { new Rectangle(0x60, 0x30, 0x18, 12), new Rectangle(0x60, 60, 0x18, 12) }; - private readonly Rectangle[] rc譜面スピード = new Rectangle[] { new Rectangle(0x30, 0, 0x18, 12), new Rectangle(0x30, 12, 0x18, 12), new Rectangle(0x30, 0x18, 0x18, 12), new Rectangle(0x30, 0x24, 0x18, 12), new Rectangle(0x48, 0, 0x18, 12), new Rectangle(0x48, 12, 0x18, 12), new Rectangle(0x48, 0x18, 0x18, 12), new Rectangle(0x48, 0x24, 0x18, 12), new Rectangle(0x60, 0, 0x18, 12), new Rectangle(0x60, 12, 0x18, 12), new Rectangle(0x60, 0x18, 0x18, 12), new Rectangle(0x60, 0x24, 0x18, 12), new Rectangle(120, 0, 0x18, 12), new Rectangle(120, 12, 0x18, 12), new Rectangle(120, 0x18, 0x18, 12), new Rectangle(120, 0x24, 0x18, 12) }; - private CTexture txオプションパネル; - //----------------- - #endregion } + public override void CreateManagedResource() { + this.txオプションパネル = OpenTaiko.tテクスチャの生成(CSkin.Path(@"Graphics\Screen option panels.png"), false); + base.CreateManagedResource(); + } + public override void ReleaseManagedResource() { + OpenTaiko.tテクスチャの解放(ref this.txオプションパネル); + base.ReleaseManagedResource(); + } + public override int Draw() { + if (!base.IsDeActivated) { + CConfigIni configIni = OpenTaiko.ConfigIni; + /* + if( this.txオプションパネル != null ) + { + + + #region [ Sud/Hid/Invisible ] + this.txオプションパネル.t2D描画( device, 0x189, 12, this.rcHS[ ( configIni.bHidden.Drums ? 1 : 0 ) + ( configIni.bSudden.Drums ? 2 : 0 ) + + ( configIni.eInvisible.Drums == EInvisible.SEMI ? 4 : 0 ) + + ( configIni.eInvisible.Drums == EInvisible.FULL ? 5 : 0 ) ] ); + this.txオプションパネル.t2D描画( device, 0x189, 0x18, this.rcHS[ ( configIni.bHidden.Guitar ? 1 : 0 ) + ( configIni.bSudden.Guitar ? 2 : 0 ) + + ( configIni.eInvisible.Guitar == EInvisible.SEMI ? 4 : 0 ) + + ( configIni.eInvisible.Guitar == EInvisible.FULL ? 5 : 0 ) ] ); + this.txオプションパネル.t2D描画( device, 0x189, 0x24, this.rcHS[ ( configIni.bHidden.Bass ? 1 : 0 ) + ( configIni.bSudden.Bass ? 2 : 0 ) + + ( configIni.eInvisible.Bass == EInvisible.SEMI ? 4 : 0 ) + + ( configIni.eInvisible.Bass == EInvisible.FULL ? 5 : 0 ) ] ); + #endregion + #region [ Dark ] + this.txオプションパネル.t2D描画( device, 0x1a1, 12, this.rcDark[ (int) configIni.eDark ] ); + this.txオプションパネル.t2D描画( device, 0x1a1, 0x18, this.rcDark[ (int) configIni.eDark ] ); + this.txオプションパネル.t2D描画( device, 0x1a1, 0x24, this.rcDark[ (int) configIni.eDark ] ); + #endregion + #region [ Reverse ] + this.txオプションパネル.t2D描画( device, 0x1b9, 12, this.rcReverse[ configIni.bReverse.Drums ? 1 : 0 ] ); + this.txオプションパネル.t2D描画( device, 0x1b9, 0x18, this.rcReverse[ configIni.bReverse.Guitar ? 1 : 0 ] ); + this.txオプションパネル.t2D描画( device, 0x1b9, 0x24, this.rcReverse[ configIni.bReverse.Bass ? 1 : 0 ] ); + #endregion + #region [ Position ] + this.txオプションパネル.t2D描画( device, 0x1d1, 12, this.rcPosition[ (int) configIni.判定文字表示位置.Drums ] ); + this.txオプションパネル.t2D描画( device, 0x1d1, 0x18, this.rcPosition[ (int) configIni.判定文字表示位置.Guitar ] ); + this.txオプションパネル.t2D描画( device, 0x1d1, 0x24, this.rcPosition[ (int) configIni.判定文字表示位置.Bass ] ); + #endregion + #region [ Tight ] + this.txオプションパネル.t2D描画( device, 0x1e9, 12, this.rcTight[ configIni.bTight ? 1 : 0 ] ); + #endregion + #region [ Random ] + this.txオプションパネル.t2D描画( device, 0x1e9, 0x18, this.rcRandom[ (int) configIni.eRandom.Guitar ] ); + this.txオプションパネル.t2D描画( device, 0x1e9, 0x24, this.rcRandom[ (int) configIni.eRandom.Bass ] ); + #endregion + #region [ ComboPosition ] + this.txオプションパネル.t2D描画( device, 0x201, 12, new Rectangle(0, 0, 0, 0) ); + #endregion + #region [ Light ] + this.txオプションパネル.t2D描画( device, 0x201, 0x18, this.rcLight[ configIni.bLight.Guitar ? 1 : 0 ] ); + this.txオプションパネル.t2D描画( device, 0x201, 0x24, this.rcLight[ configIni.bLight.Bass ? 1 : 0 ] ); + #endregion + #region [ Left ] + this.txオプションパネル.t2D描画( device, 0x219, 0x18, this.rcLeft[ configIni.bLeft.Guitar ? 1 : 0 ] ); + this.txオプションパネル.t2D描画( device, 0x219, 0x24, this.rcLeft[ configIni.bLeft.Bass ? 1 : 0 ] ); + #endregion + } + */ + } + return 0; + } + + + // その他 + + #region [ private ] + //----------------- + private readonly Rectangle[] rcComboPos = new Rectangle[] { new Rectangle(0x30, 0x48, 0x18, 12), new Rectangle(0x30, 60, 0x18, 12), new Rectangle(0x30, 0x30, 0x18, 12), new Rectangle(0x18, 0x48, 0x18, 12) }; + private readonly Rectangle[] rcDark = new Rectangle[] { new Rectangle(0x18, 0, 0x18, 12), new Rectangle(0x18, 12, 0x18, 12), new Rectangle(0x18, 0x54, 0x18, 12) }; + private readonly Rectangle[] rcHS = new Rectangle[] { + new Rectangle( 0, 0, 0x18, 12 ), // OFF + new Rectangle( 0, 12, 0x18, 12 ), // Hidden + new Rectangle( 0, 0x18, 0x18, 12 ), // Sudden + new Rectangle( 0, 0x24, 0x18, 12 ), // H/S + new Rectangle(0x60, 0x54, 0x18, 12 ), // Semi-Invisible + new Rectangle( 120, 0x54, 0x18, 12 ) // Full-Invisible + }; + private readonly Rectangle[] rcLeft = new Rectangle[] { new Rectangle(0x60, 0x48, 0x18, 12), new Rectangle(120, 0x48, 0x18, 12) }; + private readonly Rectangle[] rcLight = new Rectangle[] { new Rectangle(120, 0x30, 0x18, 12), new Rectangle(120, 60, 0x18, 12) }; + private readonly Rectangle[] rcPosition = new Rectangle[] { + new Rectangle( 0, 48, 24, 12 ), // P-A + new Rectangle( 0, 60, 24, 12 ), // P-B + new Rectangle( 0, 72, 24, 12 ), // P-B + new Rectangle( 24, 72, 24, 12 ) // OFF + }; + private readonly Rectangle[] rcRandom = new Rectangle[] { new Rectangle(0x48, 0x30, 0x18, 12), new Rectangle(0x48, 60, 0x18, 12), new Rectangle(0x48, 0x48, 0x18, 12), new Rectangle(0x48, 0x54, 0x18, 12) }; + private readonly Rectangle[] rcReverse = new Rectangle[] { new Rectangle(0x18, 0x18, 0x18, 12), new Rectangle(0x18, 0x24, 0x18, 12) }; + private readonly Rectangle[] rcTight = new Rectangle[] { new Rectangle(0x60, 0x30, 0x18, 12), new Rectangle(0x60, 60, 0x18, 12) }; + private readonly Rectangle[] rc譜面スピード = new Rectangle[] { new Rectangle(0x30, 0, 0x18, 12), new Rectangle(0x30, 12, 0x18, 12), new Rectangle(0x30, 0x18, 0x18, 12), new Rectangle(0x30, 0x24, 0x18, 12), new Rectangle(0x48, 0, 0x18, 12), new Rectangle(0x48, 12, 0x18, 12), new Rectangle(0x48, 0x18, 0x18, 12), new Rectangle(0x48, 0x24, 0x18, 12), new Rectangle(0x60, 0, 0x18, 12), new Rectangle(0x60, 12, 0x18, 12), new Rectangle(0x60, 0x18, 0x18, 12), new Rectangle(0x60, 0x24, 0x18, 12), new Rectangle(120, 0, 0x18, 12), new Rectangle(120, 12, 0x18, 12), new Rectangle(120, 0x18, 0x18, 12), new Rectangle(120, 0x24, 0x18, 12) }; + private CTexture txオプションパネル; + //----------------- + #endregion } diff --git a/OpenTaiko/src/Stages/CNamePlate.cs b/OpenTaiko/src/Stages/CNamePlate.cs index db2b8c20..1c2af291 100644 --- a/OpenTaiko/src/Stages/CNamePlate.cs +++ b/OpenTaiko/src/Stages/CNamePlate.cs @@ -1,70 +1,70 @@ -namespace OpenTaiko { - class CNamePlate { - public CLuaNamePlateScript lcNamePlate { get; private set; } - public void RefleshSkin() { - lcNamePlate?.Dispose(); - lcNamePlate = new CLuaNamePlateScript(CSkin.Path("Modules/NamePlate")); +namespace OpenTaiko; - for (int player = 0; player < 5; player++) { - tNamePlateRefreshTitles(player); - } +class CNamePlate { + public CLuaNamePlateScript lcNamePlate { get; private set; } + public void RefleshSkin() { + lcNamePlate?.Dispose(); + lcNamePlate = new CLuaNamePlateScript(CSkin.Path("Modules/NamePlate")); + + for (int player = 0; player < 5; player++) { + tNamePlateRefreshTitles(player); } - - public CNamePlate() { - for (int player = 0; player < 5; player++) { - if (OpenTaiko.SaveFileInstances[player].data.DanType < 0) OpenTaiko.SaveFileInstances[player].data.DanType = 0; - else if (OpenTaiko.SaveFileInstances[player].data.DanType > 2) OpenTaiko.SaveFileInstances[player].data.DanType = 2; - - if (OpenTaiko.SaveFileInstances[player].data.TitleType < 0) OpenTaiko.SaveFileInstances[player].data.TitleType = 0; - - } - RefleshSkin(); - } - - public void tNamePlateRefreshTitles(int player) { - int actualPlayer = OpenTaiko.GetActualPlayer(player); - - string[] stages = { "初", "二", "三", "四", "五", "六", "七", "八", "九", "極" }; - - string name; - string title; - string dan; - - bool isAI = OpenTaiko.ConfigIni.bAIBattleMode && player == 1; - if (isAI) { - name = CLangManager.LangInstance.GetString("AI_NAME"); - title = CLangManager.LangInstance.GetString("AI_TITLE"); - dan = stages[Math.Max(0, OpenTaiko.ConfigIni.nAILevel - 1)] + "面"; - } else { - name = OpenTaiko.SaveFileInstances[actualPlayer].data.Name; - title = OpenTaiko.SaveFileInstances[actualPlayer].data.Title; - dan = OpenTaiko.SaveFileInstances[actualPlayer].data.Dan; - } - bIsPrevAI[player] = isAI; - - if (OpenTaiko.SaveFileInstances[player].data.DanGold) - lcNamePlate.SetInfos(player, name, title, $"{dan}", OpenTaiko.SaveFileInstances[actualPlayer].data); - else - lcNamePlate.SetInfos(player, name, title, dan, OpenTaiko.SaveFileInstances[actualPlayer].data); - } - - - public void tNamePlateDraw(int x, int y, int player, bool bTitle = false, int Opacity = 255) { - float resolutionScaleX = OpenTaiko.Skin.Resolution[0] / 1280.0f; - float resolutionScaleY = OpenTaiko.Skin.Resolution[1] / 720.0f; - - int basePlayer = player; - player = OpenTaiko.GetActualPlayer(player); - - bool isAI = OpenTaiko.ConfigIni.bAIBattleMode && basePlayer == 1; - if (bIsPrevAI[basePlayer] != isAI) { - tNamePlateRefreshTitles(player); - } - bIsPrevAI[basePlayer] = isAI; - - lcNamePlate.Draw(x, y, Opacity, basePlayer, OpenTaiko.P1IsBlue() ? 1 : 0); - } - - private bool[] bIsPrevAI = new bool[5]; } -} + + public CNamePlate() { + for (int player = 0; player < 5; player++) { + if (OpenTaiko.SaveFileInstances[player].data.DanType < 0) OpenTaiko.SaveFileInstances[player].data.DanType = 0; + else if (OpenTaiko.SaveFileInstances[player].data.DanType > 2) OpenTaiko.SaveFileInstances[player].data.DanType = 2; + + if (OpenTaiko.SaveFileInstances[player].data.TitleType < 0) OpenTaiko.SaveFileInstances[player].data.TitleType = 0; + + } + RefleshSkin(); + } + + public void tNamePlateRefreshTitles(int player) { + int actualPlayer = OpenTaiko.GetActualPlayer(player); + + string[] stages = { "初", "二", "三", "四", "五", "六", "七", "八", "九", "極" }; + + string name; + string title; + string dan; + + bool isAI = OpenTaiko.ConfigIni.bAIBattleMode && player == 1; + if (isAI) { + name = CLangManager.LangInstance.GetString("AI_NAME"); + title = CLangManager.LangInstance.GetString("AI_TITLE"); + dan = stages[Math.Max(0, OpenTaiko.ConfigIni.nAILevel - 1)] + "面"; + } else { + name = OpenTaiko.SaveFileInstances[actualPlayer].data.Name; + title = OpenTaiko.SaveFileInstances[actualPlayer].data.Title; + dan = OpenTaiko.SaveFileInstances[actualPlayer].data.Dan; + } + bIsPrevAI[player] = isAI; + + if (OpenTaiko.SaveFileInstances[player].data.DanGold) + lcNamePlate.SetInfos(player, name, title, $"{dan}", OpenTaiko.SaveFileInstances[actualPlayer].data); + else + lcNamePlate.SetInfos(player, name, title, dan, OpenTaiko.SaveFileInstances[actualPlayer].data); + } + + + public void tNamePlateDraw(int x, int y, int player, bool bTitle = false, int Opacity = 255) { + float resolutionScaleX = OpenTaiko.Skin.Resolution[0] / 1280.0f; + float resolutionScaleY = OpenTaiko.Skin.Resolution[1] / 720.0f; + + int basePlayer = player; + player = OpenTaiko.GetActualPlayer(player); + + bool isAI = OpenTaiko.ConfigIni.bAIBattleMode && basePlayer == 1; + if (bIsPrevAI[basePlayer] != isAI) { + tNamePlateRefreshTitles(player); + } + bIsPrevAI[basePlayer] = isAI; + + lcNamePlate.Draw(x, y, Opacity, basePlayer, OpenTaiko.P1IsBlue() ? 1 : 0); + } + + private bool[] bIsPrevAI = new bool[5]; +} diff --git a/OpenTaiko/src/Stages/CStage.cs b/OpenTaiko/src/Stages/CStage.cs index 4723081e..0e58a02f 100644 --- a/OpenTaiko/src/Stages/CStage.cs +++ b/OpenTaiko/src/Stages/CStage.cs @@ -1,62 +1,62 @@ using FDK; -namespace OpenTaiko { - public class CStage : CActivity { - internal EStage eStageID; - public enum EStage { - None, - StartUp, - Title, // Title screen - Options, - Config, - SongSelect, - DanDojoSelect, - SongLoading, - Game, - Results, - ChangeSkin, // #28195 2011.5.4 yyagi - Heya, - TaikoTowers, - BoukenTitle, - BoukenMap, - OnlineLounge, - Encyclopedia, - AIBattleMode, - PlayerStats, - ChartEditor, - Toolbox, - TEMPLATE, // No effect, for template class - End - } +namespace OpenTaiko; - internal EPhase ePhaseID; - public enum EPhase { - Common_NORMAL, - Common_FADEIN, - Common_FADEOUT, - Common_EXIT, - Startup_0_CreateSystemSound, - Startup_1_InitializeSonglist, - Startup_2_EnumerateSongs, - Startup_3_ApplyScoreCache, - Startup_4_LoadSongsNotSeenInScoreCacheAndApplyThem, - Startup_5_PostProcessSonglist, - Startup_6_LoadTextures, - Startup_Complete, - Title_FadeIn, - SongSelect_FadeInFromResults, - SongSelect_FadeOutToCourseSelect, //2016.10.20 kairera0467 - SongSelect_FadeOutToNowLoading, - SongLoading_LoadDTXFile, - SongLoading_WaitToLoadWAVFile, - SongLoading_LoadWAVFile, - SongLoading_LoadBMPFile, - SongLoading_WaitForSoundSystemBGM, - Game_STAGE_FAILED, - Game_STAGE_FAILED_FadeOut, - Game_STAGE_CLEAR_FadeOut, - Game_EndStage, //2016.07.15 kairera0467 - Game_Reload - } +public class CStage : CActivity { + internal EStage eStageID; + public enum EStage { + None, + StartUp, + Title, // Title screen + Options, + Config, + SongSelect, + DanDojoSelect, + SongLoading, + Game, + Results, + ChangeSkin, // #28195 2011.5.4 yyagi + Heya, + TaikoTowers, + BoukenTitle, + BoukenMap, + OnlineLounge, + Encyclopedia, + AIBattleMode, + PlayerStats, + ChartEditor, + Toolbox, + TEMPLATE, // No effect, for template class + End + } + + internal EPhase ePhaseID; + public enum EPhase { + Common_NORMAL, + Common_FADEIN, + Common_FADEOUT, + Common_EXIT, + Startup_0_CreateSystemSound, + Startup_1_InitializeSonglist, + Startup_2_EnumerateSongs, + Startup_3_ApplyScoreCache, + Startup_4_LoadSongsNotSeenInScoreCacheAndApplyThem, + Startup_5_PostProcessSonglist, + Startup_6_LoadTextures, + Startup_Complete, + Title_FadeIn, + SongSelect_FadeInFromResults, + SongSelect_FadeOutToCourseSelect, //2016.10.20 kairera0467 + SongSelect_FadeOutToNowLoading, + SongLoading_LoadDTXFile, + SongLoading_WaitToLoadWAVFile, + SongLoading_LoadWAVFile, + SongLoading_LoadBMPFile, + SongLoading_WaitForSoundSystemBGM, + Game_STAGE_FAILED, + Game_STAGE_FAILED_FadeOut, + Game_STAGE_CLEAR_FadeOut, + Game_EndStage, //2016.07.15 kairera0467 + Game_Reload } } diff --git a/OpenTaiko/src/Stages/XX.Templates/CStageTemplate.cs b/OpenTaiko/src/Stages/XX.Templates/CStageTemplate.cs index 51e9b7a1..f022fb94 100644 --- a/OpenTaiko/src/Stages/XX.Templates/CStageTemplate.cs +++ b/OpenTaiko/src/Stages/XX.Templates/CStageTemplate.cs @@ -1,74 +1,74 @@ // Minimalist menu class to use for custom menus -namespace OpenTaiko { - class CStageTemplate : CStage { - public CStageTemplate() { - base.eStageID = EStage.TEMPLATE; - base.ePhaseID = CStage.EPhase.Common_NORMAL; +namespace OpenTaiko; - // Load CActivity objects here - // base.list子Activities.Add(this.act = new CAct()); +class CStageTemplate : CStage { + public CStageTemplate() { + base.eStageID = EStage.TEMPLATE; + base.ePhaseID = CStage.EPhase.Common_NORMAL; - base.ChildActivities.Add(this.actFOtoTitle = new CActFIFOBlack()); + // Load CActivity objects here + // base.list子Activities.Add(this.act = new CAct()); - } + base.ChildActivities.Add(this.actFOtoTitle = new CActFIFOBlack()); - public override void Activate() { - // On activation - - if (base.IsActivated) - return; - - base.ePhaseID = CStage.EPhase.Common_NORMAL; - this.eフェードアウト完了時の戻り値 = EReturnValue.Continuation; - - - - base.Activate(); - } - - public override void DeActivate() { - // On de-activation - - base.DeActivate(); - } - - public override void CreateManagedResource() { - // Ressource allocation - - base.CreateManagedResource(); - } - - public override void ReleaseManagedResource() { - // Ressource freeing - - base.ReleaseManagedResource(); - } - - public override int Draw() { - - - - - - // Menu exit fade out transition - switch (base.ePhaseID) { - case CStage.EPhase.Common_FADEOUT: - if (this.actFOtoTitle.Draw() == 0) { - break; - } - return (int)this.eフェードアウト完了時の戻り値; - - } - - return 0; - } - - #region [Private] - - - public EReturnValue eフェードアウト完了時の戻り値; - public CActFIFOBlack actFOtoTitle; - - #endregion } + + public override void Activate() { + // On activation + + if (base.IsActivated) + return; + + base.ePhaseID = CStage.EPhase.Common_NORMAL; + this.eフェードアウト完了時の戻り値 = EReturnValue.Continuation; + + + + base.Activate(); + } + + public override void DeActivate() { + // On de-activation + + base.DeActivate(); + } + + public override void CreateManagedResource() { + // Ressource allocation + + base.CreateManagedResource(); + } + + public override void ReleaseManagedResource() { + // Ressource freeing + + base.ReleaseManagedResource(); + } + + public override int Draw() { + + + + + + // Menu exit fade out transition + switch (base.ePhaseID) { + case CStage.EPhase.Common_FADEOUT: + if (this.actFOtoTitle.Draw() == 0) { + break; + } + return (int)this.eフェードアウト完了時の戻り値; + + } + + return 0; + } + + #region [Private] + + + public EReturnValue eフェードアウト完了時の戻り値; + public CActFIFOBlack actFOtoTitle; + + #endregion }